From 3e6c4892a88e94f6090ba43c6105f0752432ce8e Mon Sep 17 00:00:00 2001 From: support Date: Mon, 4 Apr 2022 11:47:48 +0000 Subject: [PATCH] Built motion from commit f0b1811d.|2.6.6 --- 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/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/action.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.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/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/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/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/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- 1195 files changed, 1195 insertions(+), 1195 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index cc70f54..0e8be12 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-04-04T09:57:54.461Z", + "time": "2022-04-04T11:40:39.649Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 679f08d..8de2432 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-04-04T09:57:54.461Z", + "time": "2022-04-04T11:40:39.649Z", "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 76caefd..9e9853c 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 _0xfb44=['STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x3d3e4a,_0x38d84f){var _0x30d3f0=function(_0x5bc359){while(--_0x5bc359){_0x3d3e4a['push'](_0x3d3e4a['shift']());}};_0x30d3f0(++_0x38d84f);}(_0xfb44,0xb8));var _0x4fb4=function(_0x193134,_0x37f35a){_0x193134=_0x193134-0x0;var _0x3451ed=_0xfb44[_0x193134];return _0x3451ed;};'use strict';var Sequelize=require(_0x4fb4('0x0'));module[_0x4fb4('0x1')]={'name':{'type':Sequelize[_0x4fb4('0x2')],'get':function(_0x782765){return this[_0x4fb4('0x3')](_0x4fb4('0x4'));}},'action':{'type':Sequelize[_0x4fb4('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4fb4('0x6'),_0x4fb4('0x7'),_0x4fb4('0x8'),_0x4fb4('0x9'),_0x4fb4('0xa'),'browser',_0x4fb4('0xb'),_0x4fb4('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x4fb4('0x5')](0x1000),'comment':_0x4fb4('0xd')},'data2':{'type':Sequelize[_0x4fb4('0x5')](0x1000),'comment':_0x4fb4('0xe')},'data3':{'type':Sequelize[_0x4fb4('0x5')](0x1000),'comment':_0x4fb4('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x4fb4('0x10')},'data5':{'type':Sequelize[_0x4fb4('0x5')](0x1000),'comments':_0x4fb4('0x11')},'data6':{'type':Sequelize[_0x4fb4('0x5')],'comments':_0x4fb4('0x12')},'data7':{'type':Sequelize[_0x4fb4('0x13')],'comments':_0x4fb4('0x14')}}; \ No newline at end of file +var _0x9ad7=['TEXT','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x77ae89,_0x2b65a7){var _0x19d79c=function(_0x5abc0b){while(--_0x5abc0b){_0x77ae89['push'](_0x77ae89['shift']());}};_0x19d79c(++_0x2b65a7);}(_0x9ad7,0x78));var _0x79ad=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x9ad7[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x79ad('0x0')],'get':function(_0x23d4ae){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x79ad('0x1')],'allowNull':![],'validate':{'isIn':{'args':[[_0x79ad('0x2'),_0x79ad('0x3'),_0x79ad('0x4'),_0x79ad('0x5'),_0x79ad('0x6'),'browser',_0x79ad('0x7'),_0x79ad('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x79ad('0x9')},'data1':{'type':Sequelize[_0x79ad('0x1')](0x1000),'comment':_0x79ad('0xa')},'data2':{'type':Sequelize[_0x79ad('0x1')](0x1000),'comment':_0x79ad('0xb')},'data3':{'type':Sequelize[_0x79ad('0x1')](0x1000),'comment':_0x79ad('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x79ad('0xd')},'data5':{'type':Sequelize[_0x79ad('0x1')](0x1000),'comments':_0x79ad('0xe')},'data6':{'type':Sequelize[_0x79ad('0x1')],'comments':_0x79ad('0xf')},'data7':{'type':Sequelize[_0x79ad('0x10')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6355e53..537a11c 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 _0xa5fa=['util','path','sox','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x408ff0,_0x1c30f3){var _0x4cb3eb=function(_0x3991b9){while(--_0x3991b9){_0x408ff0['push'](_0x408ff0['shift']());}};_0x4cb3eb(++_0x1c30f3);}(_0xa5fa,0x113));var _0xaa5f=function(_0x1434cf,_0x5f59bc){_0x1434cf=_0x1434cf-0x0;var _0x409877=_0xa5fa[_0x1434cf];return _0x409877;};'use strict';var emlformat=require(_0xaa5f('0x0'));var rimraf=require(_0xaa5f('0x1'));var zipdir=require(_0xaa5f('0x2'));var jsonpatch=require(_0xaa5f('0x3'));var rp=require('request-promise');var moment=require(_0xaa5f('0x4'));var BPromise=require(_0xaa5f('0x5'));var Mustache=require(_0xaa5f('0x6'));var util=require(_0xaa5f('0x7'));var path=require(_0xaa5f('0x8'));var sox=require(_0xaa5f('0x9'));var csv=require('to-csv');var ejs=require(_0xaa5f('0xa'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xb'));var _=require('lodash');var squel=require(_0xaa5f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa5f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa5f('0xe'));var Redis=require(_0xaa5f('0xf'));var authService=require(_0xaa5f('0x10'));var qs=require(_0xaa5f('0x11'));var as=require(_0xaa5f('0x12'));var hardwareService=require(_0xaa5f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaa5f('0x14'));var config=require(_0xaa5f('0x15'));var licenseUtil=require(_0xaa5f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f2d7c,_0x5dff67){_0x5dff67=_0x5dff67||0xcc;return function(_0x7940d3){if(_0x7940d3){return _0x3f2d7c[_0xaa5f('0x17')](_0x5dff67);}return _0x3f2d7c[_0xaa5f('0x18')](_0x5dff67)['end']();};}function respondWithResult(_0x16cd76,_0x33dc8a){_0x33dc8a=_0x33dc8a||0xc8;return function(_0x44c2b7){if(_0x44c2b7){return _0x16cd76[_0xaa5f('0x18')](_0x33dc8a)[_0xaa5f('0x19')](_0x44c2b7);}};}function respondWithFilteredResult(_0x4eb2c9,_0x4b85fe){return function(_0x37fc46){if(_0x37fc46){var _0x3e56b8=typeof _0x4b85fe[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x4b85fe[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x48785b=_0x37fc46[_0xaa5f('0x1d')];var _0x4d0190=_0x3e56b8?0x0:_0x4b85fe[_0xaa5f('0x1a')];var _0x52d7ee=_0x3e56b8?_0x37fc46['count']:_0x4b85fe[_0xaa5f('0x1a')]+_0x4b85fe[_0xaa5f('0x1c')];var _0x3c3d4a;if(_0x52d7ee>=_0x48785b){_0x52d7ee=_0x48785b;_0x3c3d4a=0xc8;}else{_0x3c3d4a=0xce;}_0x4eb2c9['status'](_0x3c3d4a);return _0x4eb2c9[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x4d0190+'-'+_0x52d7ee+'/'+_0x48785b)[_0xaa5f('0x19')](_0x37fc46);}return null;};}function patchUpdates(_0x4699f5){return function(_0x16b443){try{jsonpatch[_0xaa5f('0x20')](_0x16b443,_0x4699f5,!![]);}catch(_0x5e50ef){return BPromise[_0xaa5f('0x21')](_0x5e50ef);}return _0x16b443[_0xaa5f('0x22')]();};}function saveUpdates(_0xfde958,_0x46b1c5){return function(_0x4fa3fc){if(_0x4fa3fc){return _0x4fa3fc[_0xaa5f('0x23')](_0xfde958)[_0xaa5f('0x24')](function(_0x451573){return _0x451573;});}return null;};}function removeEntity(_0x17f51b,_0x1da1c5){return function(_0x45105b){if(_0x45105b){return _0x45105b['destroy']()[_0xaa5f('0x24')](function(){_0x17f51b['status'](0xcc)[_0xaa5f('0x25')]();});}};}function handleEntityNotFound(_0x3cd344,_0x153a23){return function(_0x41916d){if(!_0x41916d){_0x3cd344[_0xaa5f('0x17')](0x194);}return _0x41916d;};}function handleError(_0x77d8d,_0x2c063a){_0x2c063a=_0x2c063a||0x1f4;return function(_0x15b834){logger[_0xaa5f('0x26')](_0x15b834[_0xaa5f('0x27')]);if(_0x15b834[_0xaa5f('0x28')]){delete _0x15b834[_0xaa5f('0x28')];}_0x77d8d[_0xaa5f('0x18')](_0x2c063a)['send'](_0x15b834);};}exports[_0xaa5f('0x23')]=function(_0x46bec2,_0x29b12e){if(_0x46bec2[_0xaa5f('0x29')]['id']){delete _0x46bec2[_0xaa5f('0x29')]['id'];}return db[_0xaa5f('0x2a')][_0xaa5f('0x2b')]({'where':{'id':_0x46bec2[_0xaa5f('0x2c')]['id']}})[_0xaa5f('0x24')](handleEntityNotFound(_0x29b12e,null))[_0xaa5f('0x24')](saveUpdates(_0x46bec2[_0xaa5f('0x29')],null))[_0xaa5f('0x24')](respondWithResult(_0x29b12e,null))['catch'](handleError(_0x29b12e,null));};exports[_0xaa5f('0x2d')]=function(_0x5dc4b,_0x328bd0){return db[_0xaa5f('0x2a')][_0xaa5f('0x2b')]({'where':{'id':_0x5dc4b['params']['id']}})[_0xaa5f('0x24')](handleEntityNotFound(_0x328bd0,null))['then'](removeEntity(_0x328bd0,null))[_0xaa5f('0x2e')](handleError(_0x328bd0,null));}; \ No newline at end of file +var _0x3ea3=['name','body','find','params','Action','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack'];(function(_0xea2fb5,_0x35090d){var _0x1385c1=function(_0x54149a){while(--_0x54149a){_0xea2fb5['push'](_0xea2fb5['shift']());}};_0x1385c1(++_0x35090d);}(_0x3ea3,0xaa));var _0x33ea=function(_0x3bf0f4,_0x4362da){_0x3bf0f4=_0x3bf0f4-0x0;var _0x459a09=_0x3ea3[_0x3bf0f4];return _0x459a09;};'use strict';var emlformat=require(_0x33ea('0x0'));var rimraf=require(_0x33ea('0x1'));var zipdir=require(_0x33ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33ea('0x3'));var moment=require(_0x33ea('0x4'));var BPromise=require(_0x33ea('0x5'));var Mustache=require(_0x33ea('0x6'));var util=require(_0x33ea('0x7'));var path=require(_0x33ea('0x8'));var sox=require(_0x33ea('0x9'));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('squel');var crypto=require(_0x33ea('0xa'));var jsforce=require(_0x33ea('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x33ea('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x33ea('0xd'));var qs=require(_0x33ea('0xe'));var as=require(_0x33ea('0xf'));var hardwareService=require(_0x33ea('0x10'));var logger=require('../../config/logger')(_0x33ea('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x33ea('0x12'));var db=require(_0x33ea('0x13'))['db'];function respondWithStatusCode(_0x2fed62,_0x1fba62){_0x1fba62=_0x1fba62||0xcc;return function(_0x1b70d1){if(_0x1b70d1){return _0x2fed62[_0x33ea('0x14')](_0x1fba62);}return _0x2fed62['status'](_0x1fba62)[_0x33ea('0x15')]();};}function respondWithResult(_0x4994d2,_0x18d0db){_0x18d0db=_0x18d0db||0xc8;return function(_0x4de4b6){if(_0x4de4b6){return _0x4994d2[_0x33ea('0x16')](_0x18d0db)[_0x33ea('0x17')](_0x4de4b6);}};}function respondWithFilteredResult(_0x5099f5,_0x16cc96){return function(_0x45ca78){if(_0x45ca78){var _0x1b3584=typeof _0x16cc96[_0x33ea('0x18')]===_0x33ea('0x19')&&typeof _0x16cc96[_0x33ea('0x1a')]===_0x33ea('0x19');var _0x56046b=_0x45ca78[_0x33ea('0x1b')];var _0x602e9c=_0x1b3584?0x0:_0x16cc96['offset'];var _0x13adc1=_0x1b3584?_0x45ca78[_0x33ea('0x1b')]:_0x16cc96[_0x33ea('0x18')]+_0x16cc96[_0x33ea('0x1a')];var _0x9c00f5;if(_0x13adc1>=_0x56046b){_0x13adc1=_0x56046b;_0x9c00f5=0xc8;}else{_0x9c00f5=0xce;}_0x5099f5['status'](_0x9c00f5);return _0x5099f5[_0x33ea('0x1c')](_0x33ea('0x1d'),_0x602e9c+'-'+_0x13adc1+'/'+_0x56046b)[_0x33ea('0x17')](_0x45ca78);}return null;};}function patchUpdates(_0x2ad20a){return function(_0x31780f){try{jsonpatch['apply'](_0x31780f,_0x2ad20a,!![]);}catch(_0xd1ab41){return BPromise[_0x33ea('0x1e')](_0xd1ab41);}return _0x31780f['save']();};}function saveUpdates(_0x469cad,_0x337bcb){return function(_0x4da25a){if(_0x4da25a){return _0x4da25a[_0x33ea('0x1f')](_0x469cad)[_0x33ea('0x20')](function(_0x6c01c8){return _0x6c01c8;});}return null;};}function removeEntity(_0x5bbe32,_0x51bee4){return function(_0x5aa027){if(_0x5aa027){return _0x5aa027[_0x33ea('0x21')]()[_0x33ea('0x20')](function(){_0x5bbe32['status'](0xcc)[_0x33ea('0x15')]();});}};}function handleEntityNotFound(_0x493e03,_0x49a794){return function(_0x30890e){if(!_0x30890e){_0x493e03['sendStatus'](0x194);}return _0x30890e;};}function handleError(_0x3a470c,_0x3f1cd4){_0x3f1cd4=_0x3f1cd4||0x1f4;return function(_0xdeedb9){logger['error'](_0xdeedb9[_0x33ea('0x22')]);if(_0xdeedb9['name']){delete _0xdeedb9[_0x33ea('0x23')];}_0x3a470c[_0x33ea('0x16')](_0x3f1cd4)['send'](_0xdeedb9);};}exports['update']=function(_0x1afa77,_0x104886){if(_0x1afa77[_0x33ea('0x24')]['id']){delete _0x1afa77[_0x33ea('0x24')]['id'];}return db['Action'][_0x33ea('0x25')]({'where':{'id':_0x1afa77[_0x33ea('0x26')]['id']}})[_0x33ea('0x20')](handleEntityNotFound(_0x104886,null))['then'](saveUpdates(_0x1afa77[_0x33ea('0x24')],null))[_0x33ea('0x20')](respondWithResult(_0x104886,null))['catch'](handleError(_0x104886,null));};exports[_0x33ea('0x21')]=function(_0xd4c33e,_0x57aeb){return db[_0x33ea('0x27')][_0x33ea('0x25')]({'where':{'id':_0xd4c33e[_0x33ea('0x26')]['id']}})[_0x33ea('0x20')](handleEntityNotFound(_0x57aeb,null))['then'](removeEntity(_0x57aeb,null))[_0x33ea('0x28')](handleError(_0x57aeb,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 7c76eaa..f9fcdea 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 _0x92e2=['../../config/environment','define','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x92e2,0x19c));var _0x292e=function(_0x39c684,_0x1e0093){_0x39c684=_0x39c684-0x0;var _0x3da800=_0x92e2[_0x39c684];return _0x3da800;};'use strict';var _=require(_0x292e('0x0'));var util=require('util');var logger=require(_0x292e('0x1'))(_0x292e('0x2'));var moment=require(_0x292e('0x3'));var BPromise=require(_0x292e('0x4'));var rp=require(_0x292e('0x5'));var fs=require('fs');var path=require(_0x292e('0x6'));var rimraf=require(_0x292e('0x7'));var config=require(_0x292e('0x8'));var attributes=require('./action.attributes');module['exports']=function(_0x438572,_0x4aba1e){return _0x438572[_0x292e('0x9')](_0x292e('0xa'),attributes,{'tableName':_0x292e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ae5=['Action','tools_actions','lodash','util','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x28168d,_0x7acd3){var _0x2f6880=function(_0x5d8e92){while(--_0x5d8e92){_0x28168d['push'](_0x28168d['shift']());}};_0x2f6880(++_0x7acd3);}(_0x0ae5,0x16a));var _0x50ae=function(_0x12057d,_0x23e1a4){_0x12057d=_0x12057d-0x0;var _0xe37bbf=_0x0ae5[_0x12057d];return _0xe37bbf;};'use strict';var _=require(_0x50ae('0x0'));var util=require(_0x50ae('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50ae('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x50ae('0x3'));var rimraf=require(_0x50ae('0x4'));var config=require(_0x50ae('0x5'));var attributes=require('./action.attributes');module[_0x50ae('0x6')]=function(_0x53f8d2,_0x509c19){return _0x53f8d2[_0x50ae('0x7')](_0x50ae('0x8'),attributes,{'tableName':_0x50ae('0x9'),'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 cfe466b..a81921a 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x814b,0x1a2));var _0xb814=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0x814b[_0x214a25];return _0x405988;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x53ec,0x192));var _0xc53e=function(_0x43ebd4,_0x3b3630){_0x43ebd4=_0x43ebd4-0x0;var _0x218876=_0x53ec[_0x43ebd4];return _0x218876;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index e2c5818..7b39b36 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 _0x4f2a=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x4f2a,0x1ab));var _0xa4f2=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4f2a[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xa4f2('0x0'));var util=require(_0xa4f2('0x1'));var path=require(_0xa4f2('0x2'));var timeout=require(_0xa4f2('0x3'));var express=require(_0xa4f2('0x4'));var router=express[_0xa4f2('0x5')]();var fs_extra=require(_0xa4f2('0x6'));var auth=require(_0xa4f2('0x7'));var interaction=require(_0xa4f2('0x8'));var config=require(_0xa4f2('0x9'));var controller=require(_0xa4f2('0xa'));router[_0xa4f2('0xb')](_0xa4f2('0xc'),auth[_0xa4f2('0xd')](),controller['update']);router[_0xa4f2('0xe')](_0xa4f2('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc450=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','exports','util','path','connect-timeout','express'];(function(_0x5272e0,_0x169ce5){var _0xa4fc96=function(_0x4f359a){while(--_0x4f359a){_0x5272e0['push'](_0x5272e0['shift']());}};_0xa4fc96(++_0x169ce5);}(_0xc450,0x137));var _0x0c45=function(_0xf64967,_0x1583ac){_0xf64967=_0xf64967-0x0;var _0x34813b=_0xc450[_0xf64967];return _0x34813b;};'use strict';var multer=require('multer');var util=require(_0x0c45('0x0'));var path=require(_0x0c45('0x1'));var timeout=require(_0x0c45('0x2'));var express=require(_0x0c45('0x3'));var router=express[_0x0c45('0x4')]();var fs_extra=require(_0x0c45('0x5'));var auth=require(_0x0c45('0x6'));var interaction=require(_0x0c45('0x7'));var config=require(_0x0c45('0x8'));var controller=require(_0x0c45('0x9'));router['put'](_0x0c45('0xa'),auth['isAuthenticated'](),controller[_0x0c45('0xb')]);router[_0x0c45('0xc')](_0x0c45('0xa'),auth[_0x0c45('0xd')](),controller['destroy']);module[_0x0c45('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index e61d446..32a6d08 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x5b7e83,_0x4fea30){var _0x3a744d=function(_0x1cdc8c){while(--_0x1cdc8c){_0x5b7e83['push'](_0x5b7e83['shift']());}};_0x3a744d(++_0x4fea30);}(_0x98a8,0x12c));var _0x898a=function(_0x21e926,_0x380fe5){_0x21e926=_0x21e926-0x0;var _0x3eaff8=_0x98a8[_0x21e926];return _0x3eaff8;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x33c5=['STRING','TEXT','exports'];(function(_0x303251,_0x316d2a){var _0x623982=function(_0x4f22b7){while(--_0x4f22b7){_0x303251['push'](_0x303251['shift']());}};_0x623982(++_0x316d2a);}(_0x33c5,0xe6));var _0x533c=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0x33c5[_0x46b22a];return _0x44c2e8;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index efa5036..33d5114 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 _0xd7b8=['ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','replace','function','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','MIN(%s)','HOUR(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','Please\x20insert\x20at\x20least\x20one\x20field','select','metric','DESC','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','COUNT(*)','run','runReport','SEC_TO_TIME(%s)','value','order','eml-format','zip-dir','fast-json-patch','request-promise','moment','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/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','include','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','Sequelize'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xd7b8,0x18f));var _0x8d7b=function(_0x470f99,_0x47aec5){_0x470f99=_0x470f99-0x0;var _0x9cd79=_0xd7b8[_0x470f99];return _0x9cd79;};'use strict';var emlformat=require(_0x8d7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d7b('0x1'));var jsonpatch=require(_0x8d7b('0x2'));var rp=require(_0x8d7b('0x3'));var moment=require(_0x8d7b('0x4'));var BPromise=require(_0x8d7b('0x5'));var Mustache=require('mustache');var util=require(_0x8d7b('0x6'));var path=require('path');var sox=require(_0x8d7b('0x7'));var csv=require(_0x8d7b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d7b('0x9'));var _=require(_0x8d7b('0xa'));var squel=require(_0x8d7b('0xb'));var crypto=require(_0x8d7b('0xc'));var jsforce=require(_0x8d7b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8d7b('0x8'));var querystring=require(_0x8d7b('0xe'));var Papa=require(_0x8d7b('0xf'));var Redis=require(_0x8d7b('0x10'));var authService=require(_0x8d7b('0x11'));var qs=require(_0x8d7b('0x12'));var as=require(_0x8d7b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d7b('0x14'))(_0x8d7b('0x15'));var utils=require(_0x8d7b('0x16'));var config=require(_0x8d7b('0x17'));var licenseUtil=require(_0x8d7b('0x18'));var db=require(_0x8d7b('0x19'))['db'];var dbH=require(_0x8d7b('0x19'))[_0x8d7b('0x1a')];function respondWithStatusCode(_0x572ee1,_0x46c6f5){_0x46c6f5=_0x46c6f5||0xcc;return function(_0x724a32){if(_0x724a32){return _0x572ee1[_0x8d7b('0x1b')](_0x46c6f5);}return _0x572ee1[_0x8d7b('0x1c')](_0x46c6f5)[_0x8d7b('0x1d')]();};}function respondWithResult(_0x94894,_0x252a38){_0x252a38=_0x252a38||0xc8;return function(_0x3f2ec5){if(_0x3f2ec5){return _0x94894[_0x8d7b('0x1c')](_0x252a38)['json'](_0x3f2ec5);}};}function respondWithFilteredResult(_0x23c680,_0x3dac46){return function(_0xd7092d){if(_0xd7092d){var _0x3046df=typeof _0x3dac46['offset']===_0x8d7b('0x1e')&&typeof _0x3dac46[_0x8d7b('0x1f')]==='undefined';var _0x48b8e1=_0xd7092d[_0x8d7b('0x20')];var _0x4a2f1b=_0x3046df?0x0:_0x3dac46['offset'];var _0x30ccc6=_0x3046df?_0xd7092d[_0x8d7b('0x20')]:_0x3dac46[_0x8d7b('0x21')]+_0x3dac46[_0x8d7b('0x1f')];var _0x1b7802;if(_0x30ccc6>=_0x48b8e1){_0x30ccc6=_0x48b8e1;_0x1b7802=0xc8;}else{_0x1b7802=0xce;}_0x23c680[_0x8d7b('0x1c')](_0x1b7802);return _0x23c680[_0x8d7b('0x22')](_0x8d7b('0x23'),_0x4a2f1b+'-'+_0x30ccc6+'/'+_0x48b8e1)[_0x8d7b('0x24')](_0xd7092d);}return null;};}function patchUpdates(_0x2178c0){return function(_0x5bf4e1){try{jsonpatch[_0x8d7b('0x25')](_0x5bf4e1,_0x2178c0,!![]);}catch(_0x1b7e00){return BPromise[_0x8d7b('0x26')](_0x1b7e00);}return _0x5bf4e1['save']();};}function saveUpdates(_0x3993a1,_0x243c5e){return function(_0x545430){if(_0x545430){return _0x545430[_0x8d7b('0x27')](_0x3993a1)[_0x8d7b('0x28')](function(_0x26027e){return _0x26027e;});}return null;};}function removeEntity(_0x4d87f5,_0xd93a0d){return function(_0x6d0c36){if(_0x6d0c36){return _0x6d0c36[_0x8d7b('0x29')]()[_0x8d7b('0x28')](function(){var _0x6f62fd=_0x6d0c36[_0x8d7b('0x2a')]({'plain':!![]});var _0x3a9cd7=_0x8d7b('0x2b');return db[_0x8d7b('0x2c')]['destroy']({'where':{'type':_0x3a9cd7,'resourceId':_0x6f62fd['id']}})[_0x8d7b('0x28')](function(){return _0x6d0c36;});})[_0x8d7b('0x28')](function(){_0x4d87f5['status'](0xcc)[_0x8d7b('0x1d')]();});}};}function handleEntityNotFound(_0x57895a,_0x303adf){return function(_0x306c46){if(!_0x306c46){_0x57895a[_0x8d7b('0x1b')](0x194);}return _0x306c46;};}function handleError(_0x5b2457,_0x56d718){_0x56d718=_0x56d718||0x1f4;return function(_0x4d0b1b){logger['error'](_0x4d0b1b[_0x8d7b('0x2d')]);if(_0x4d0b1b[_0x8d7b('0x2e')]){delete _0x4d0b1b['name'];}_0x5b2457[_0x8d7b('0x1c')](_0x56d718)['send'](_0x4d0b1b);};}exports[_0x8d7b('0x2f')]=function(_0xd4699f,_0x5524c2){var _0x2fef41={},_0x1f6d64={},_0x54c689={'count':0x0,'rows':[]};var _0x6a589=_['map'](db[_0x8d7b('0x30')][_0x8d7b('0x31')],function(_0x8f7a2e){return{'name':_0x8f7a2e[_0x8d7b('0x32')],'type':_0x8f7a2e['type'][_0x8d7b('0x33')]};});_0x1f6d64['model']=_['map'](_0x6a589,_0x8d7b('0x2e'));_0x1f6d64[_0x8d7b('0x34')]=_[_0x8d7b('0x35')](_0xd4699f[_0x8d7b('0x34')]);_0x1f6d64['filters']=_[_0x8d7b('0x36')](_0x1f6d64['model'],_0x1f6d64[_0x8d7b('0x34')]);_0x2fef41[_0x8d7b('0x37')]=_['intersection'](_0x1f6d64[_0x8d7b('0x38')],qs[_0x8d7b('0x39')](_0xd4699f[_0x8d7b('0x34')][_0x8d7b('0x39')]));_0x2fef41[_0x8d7b('0x37')]=_0x2fef41[_0x8d7b('0x37')][_0x8d7b('0x3a')]?_0x2fef41['attributes']:_0x1f6d64[_0x8d7b('0x38')];if(!_0xd4699f[_0x8d7b('0x34')][_0x8d7b('0x3b')](_0x8d7b('0x3c'))){_0x2fef41[_0x8d7b('0x1f')]=qs['limit'](_0xd4699f[_0x8d7b('0x34')][_0x8d7b('0x1f')]);_0x2fef41[_0x8d7b('0x21')]=qs['offset'](_0xd4699f[_0x8d7b('0x34')][_0x8d7b('0x21')]);}_0x2fef41['order']=qs[_0x8d7b('0x3d')](_0xd4699f[_0x8d7b('0x34')][_0x8d7b('0x3d')]);_0x2fef41[_0x8d7b('0x3e')]=qs[_0x8d7b('0x3f')](_[_0x8d7b('0x40')](_0xd4699f[_0x8d7b('0x34')],_0x1f6d64[_0x8d7b('0x3f')]),_0x6a589);if(_0xd4699f[_0x8d7b('0x34')][_0x8d7b('0x41')]){_0x2fef41[_0x8d7b('0x3e')]=_['merge'](_0x2fef41[_0x8d7b('0x3e')],{'$or':_[_0x8d7b('0x42')](_0x6a589,function(_0x535ad1){if(_0x535ad1[_0x8d7b('0x43')]!==_0x8d7b('0x44')){var _0x4e58b4={};_0x4e58b4[_0x535ad1[_0x8d7b('0x2e')]]={'$like':'%'+_0xd4699f[_0x8d7b('0x34')]['filter']+'%'};return _0x4e58b4;}})});}_0x2fef41=_[_0x8d7b('0x45')]({},_0x2fef41,_0xd4699f[_0x8d7b('0x46')]);var _0x199be5={'where':_0x2fef41[_0x8d7b('0x3e')]};return db['AnalyticCustomReport'][_0x8d7b('0x20')](_0x199be5)[_0x8d7b('0x28')](function(_0x3ca18d){_0x54c689[_0x8d7b('0x20')]=_0x3ca18d;if(_0xd4699f['query'][_0x8d7b('0x47')]){_0x2fef41['include']=[{'all':!![]}];}return db[_0x8d7b('0x30')][_0x8d7b('0x48')](_0x2fef41);})[_0x8d7b('0x28')](function(_0x30fa6d){_0x54c689[_0x8d7b('0x49')]=_0x30fa6d;return _0x54c689;})[_0x8d7b('0x28')](respondWithFilteredResult(_0x5524c2,_0x2fef41))[_0x8d7b('0x4a')](handleError(_0x5524c2,null));};exports[_0x8d7b('0x4b')]=function(_0x51812f,_0x58a0ad){var _0xb62e13={'raw':![],'where':{'id':_0x51812f['params']['id']}},_0x3cb95b={};_0x3cb95b['model']=_[_0x8d7b('0x35')](db['AnalyticCustomReport'][_0x8d7b('0x31')]);_0x3cb95b[_0x8d7b('0x34')]=_[_0x8d7b('0x35')](_0x51812f[_0x8d7b('0x34')]);_0x3cb95b['filters']=_[_0x8d7b('0x36')](_0x3cb95b['model'],_0x3cb95b[_0x8d7b('0x34')]);_0xb62e13[_0x8d7b('0x37')]=_[_0x8d7b('0x36')](_0x3cb95b[_0x8d7b('0x38')],qs['fields'](_0x51812f[_0x8d7b('0x34')]['fields']));_0xb62e13[_0x8d7b('0x37')]=_0xb62e13[_0x8d7b('0x37')][_0x8d7b('0x3a')]?_0xb62e13[_0x8d7b('0x37')]:_0x3cb95b[_0x8d7b('0x38')];if(_0x51812f[_0x8d7b('0x34')][_0x8d7b('0x47')]){_0xb62e13[_0x8d7b('0x4c')]=[{'all':!![]}];}_0xb62e13=_[_0x8d7b('0x45')]({},_0xb62e13,_0x51812f[_0x8d7b('0x46')]);return db[_0x8d7b('0x30')]['find'](_0xb62e13)[_0x8d7b('0x28')](handleEntityNotFound(_0x58a0ad,null))[_0x8d7b('0x28')](respondWithResult(_0x58a0ad,null))[_0x8d7b('0x4a')](handleError(_0x58a0ad,null));};exports[_0x8d7b('0x4d')]=function(_0x5685e7,_0x5e7c27){return db['AnalyticCustomReport']['create'](_0x5685e7[_0x8d7b('0x4e')],{})[_0x8d7b('0x28')](function(_0x2dd342){var _0xe3fd6b=_0x5685e7['user'][_0x8d7b('0x2a')]({'plain':!![]});if(!_0xe3fd6b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe3fd6b['role']===_0x8d7b('0x4f')){var _0x9722ef=_0x2dd342[_0x8d7b('0x2a')]({'plain':!![]});var _0x165810=_0x8d7b('0x50');return db[_0x8d7b('0x51')]['find']({'where':{'name':_0x165810,'userProfileId':_0xe3fd6b[_0x8d7b('0x52')]},'raw':!![]})[_0x8d7b('0x28')](function(_0x5061f8){if(_0x5061f8&&_0x5061f8[_0x8d7b('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x9722ef[_0x8d7b('0x2e')],'resourceId':_0x9722ef['id'],'type':'CustomReports','sectionId':_0x5061f8['id']},{})[_0x8d7b('0x28')](function(){return _0x2dd342;});}else{return _0x2dd342;}})[_0x8d7b('0x4a')](function(_0x1a6c73){logger[_0x8d7b('0x54')](_0x8d7b('0x55'),_0x1a6c73);throw _0x1a6c73;});}return _0x2dd342;})['then'](respondWithResult(_0x5e7c27,0xc9))[_0x8d7b('0x4a')](handleError(_0x5e7c27,null));};exports['update']=function(_0x3e08c0,_0x3d0203){if(_0x3e08c0[_0x8d7b('0x4e')]['id']){delete _0x3e08c0[_0x8d7b('0x4e')]['id'];}return db[_0x8d7b('0x30')][_0x8d7b('0x56')]({'where':{'id':_0x3e08c0[_0x8d7b('0x57')]['id']}})[_0x8d7b('0x28')](handleEntityNotFound(_0x3d0203,null))['then'](saveUpdates(_0x3e08c0[_0x8d7b('0x4e')],null))[_0x8d7b('0x28')](respondWithResult(_0x3d0203,null))[_0x8d7b('0x4a')](handleError(_0x3d0203,null));};exports[_0x8d7b('0x29')]=function(_0x21c9e6,_0x513733){return db['AnalyticCustomReport'][_0x8d7b('0x56')]({'where':{'id':_0x21c9e6['params']['id']}})[_0x8d7b('0x28')](handleEntityNotFound(_0x513733,null))[_0x8d7b('0x28')](removeEntity(_0x513733,null))['catch'](handleError(_0x513733,null));};exports['preview']=function(_0xcfb345,_0x167739){var _0x21bbe8=0xa;var _0x134650=[_0x8d7b('0x58'),_0x8d7b('0x59'),_0x8d7b('0x5a'),_0x8d7b('0x5b')];var _0x5e0e34={'SUM':_0x8d7b('0x5c'),'COUNT':_0x8d7b('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8d7b('0x5e'),'MIN':'MIN(%s)','AVG':_0x8d7b('0x5f'),'GROUP_CONCAT':_0x8d7b('0x60'),'GROUP_CONCAT ASC':_0x8d7b('0x61'),'GROUP_CONCAT DESC':_0x8d7b('0x62')};var _0x10ad3c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8d7b('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x8d7b('0x64'),'UNIX_TIMESTAMP':_0x8d7b('0x65')};var _0x17efb0=function(_0x268763){return!_[_0x8d7b('0x66')]([_0x8d7b('0x67'),_0x8d7b('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x268763);};var _0x2e7f23=function(_0x48d946){if(!_0x48d946||!_0x48d946[_0x8d7b('0x69')][_0x8d7b('0x3a')]){return'';}for(var _0x1b9c5c='(',_0x318c81=0x0;_0x318c81<_0x48d946['rules'][_0x8d7b('0x3a')];_0x318c81+=0x1){_0x318c81>0x0&&(_0x1b9c5c+='\x20'+_0x48d946[_0x8d7b('0x6a')]+'\x20');_0x1b9c5c+=_0x48d946[_0x8d7b('0x69')][_0x318c81][_0x8d7b('0x6b')]?_0x2e7f23(_0x48d946[_0x8d7b('0x69')][_0x318c81][_0x8d7b('0x6b')]):_0x48d946[_0x8d7b('0x69')][_0x318c81][_0x8d7b('0x6c')]+'\x20'+_0x48d946[_0x8d7b('0x69')][_0x318c81][_0x8d7b('0x6d')]+(_0x17efb0(_0x48d946[_0x8d7b('0x69')][_0x318c81][_0x8d7b('0x6d')])?'\x20'+_0x48d946[_0x8d7b('0x69')][_0x318c81]['value']:'');}return _0x1b9c5c+')';};var _0x3193ea={'where':{'id':_0xcfb345[_0x8d7b('0x57')]['id']}},_0x362a34,_0x13cc1b,_0x1fa807,_0x499313,_0x20e683;_0x3193ea=_[_0x8d7b('0x45')]({},_0x3193ea,_0xcfb345[_0x8d7b('0x46')]);return db[_0x8d7b('0x30')][_0x8d7b('0x56')](_0x3193ea)['then'](function(_0x1455b8){if(_0x1455b8){_0x362a34=_0x1455b8;return _0x1455b8['getFields']();}return null;})[_0x8d7b('0x28')](function(_0x14ebba){if(_0x14ebba){if(!_0x14ebba['length']){throw new db[(_0x8d7b('0x6e'))][(_0x8d7b('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x13cc1b=_0x14ebba;return db[_0x8d7b('0x70')][_0x8d7b('0x48')]({'raw':!![]});}return null;})[_0x8d7b('0x28')](function(_0x574661){if(_0x574661){_0x1fa807=_[_0x8d7b('0x71')](_0x574661,'id');var _0x5c76fc;var _0x555fa9=squel['select']();_0x555fa9[_0x8d7b('0x72')](_0x362a34[_0x8d7b('0x73')]);for(var _0x2e4a93=0x0;_0x2e4a93<_0x13cc1b[_0x8d7b('0x3a')];_0x2e4a93+=0x1){_0x5c76fc=_0x13cc1b[_0x2e4a93][_0x8d7b('0x74')]?_0x1fa807[_0x13cc1b[_0x2e4a93][_0x8d7b('0x74')]]['metric']:_0x13cc1b[_0x2e4a93]['field'];_0x5c76fc=_0x13cc1b[_0x2e4a93]['function']?_[_0x8d7b('0x75')](_0x5e0e34[_0x13cc1b[_0x2e4a93][_0x8d7b('0x76')]],'%s',_0x5c76fc):_0x5c76fc;_0x5c76fc=_0x13cc1b[_0x2e4a93][_0x8d7b('0x77')]?_[_0x8d7b('0x75')](_0x10ad3c[_0x13cc1b[_0x2e4a93][_0x8d7b('0x77')]],'%s',_0x5c76fc):_0x5c76fc;if(_0x13cc1b[_0x2e4a93][_0x8d7b('0x78')]){_0x555fa9['group'](_0x5c76fc);}_0x13cc1b[_0x2e4a93][_0x8d7b('0x79')]&&_0x555fa9['order'](_0x5c76fc,_0x13cc1b[_0x2e4a93]['orderBy']==='DESC'?![]:!![]);_0x555fa9[_0x8d7b('0x6c')](_0x5c76fc,_0x13cc1b[_0x2e4a93][_0x8d7b('0x7a')]||_0x5c76fc);}if(_0x362a34[_0x8d7b('0x7b')]){_0x362a34[_0x8d7b('0x7b')]=JSON[_0x8d7b('0x7c')](_0x362a34[_0x8d7b('0x7b')]);for(var _0x20bb4c=0x0;_0x20bb4c<_0x362a34[_0x8d7b('0x7b')][_0x8d7b('0x3a')];_0x20bb4c+=0x1){if(_0x362a34[_0x8d7b('0x7b')][_0x20bb4c][_0x8d7b('0x43')]&&_[_0x8d7b('0x66')](_0x134650,_0x362a34[_0x8d7b('0x7b')][_0x20bb4c][_0x8d7b('0x43')])&&_0x362a34[_0x8d7b('0x7b')][_0x20bb4c][_0x8d7b('0x7d')]&&_0x362a34[_0x8d7b('0x7b')][_0x20bb4c]['foreignTable']&&_0x362a34[_0x8d7b('0x7b')][_0x20bb4c][_0x8d7b('0x7e')]){_0x555fa9[_0x362a34['joins'][_0x20bb4c][_0x8d7b('0x43')]](_0x362a34[_0x8d7b('0x7b')][_0x20bb4c][_0x8d7b('0x7f')],null,util[_0x8d7b('0x77')](_0x8d7b('0x80'),_0x362a34[_0x8d7b('0x73')],_0x362a34[_0x8d7b('0x7b')][_0x20bb4c]['parentKey'],_0x362a34['joins'][_0x20bb4c]['foreignTable'],_0x362a34[_0x8d7b('0x7b')][_0x20bb4c][_0x8d7b('0x7e')]));}}}if(_0x362a34[_0x8d7b('0x81')]){_0x362a34['conditions']=JSON[_0x8d7b('0x7c')](_0x362a34[_0x8d7b('0x81')]);_0x555fa9[_0x8d7b('0x3e')](_0x2e7f23(_0x362a34['conditions'][_0x8d7b('0x6b')]));}_0x20e683=_0x555fa9[_0x8d7b('0x82')]();_0x555fa9[_0x8d7b('0x1f')](_0x21bbe8);_0x555fa9[_0x8d7b('0x21')](0x0);logger[_0x8d7b('0x83')](_0x8d7b('0x84'),_0x555fa9[_0x8d7b('0x85')]());return dbH[_0x8d7b('0x86')]['query'](_0x555fa9['toString'](),{'type':dbH[_0x8d7b('0x86')][_0x8d7b('0x87')][_0x8d7b('0x88')]});}})[_0x8d7b('0x28')](respondWithResult(_0x167739,null))[_0x8d7b('0x4a')](handleError(_0x167739,null));};function runReport(_0x70699a,_0x19373b,_0x495424){var _0x24f7f3=_0x19373b[_0x8d7b('0x2e')];var _0x55b50d=0xa;var _0x5cddbe=[_0x8d7b('0x58'),'left_join','right_join',_0x8d7b('0x5b')];var _0x384e85={'SUM':_0x8d7b('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x8d7b('0x89'),'MAX':_0x8d7b('0x5e'),'MIN':_0x8d7b('0x8a'),'AVG':_0x8d7b('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8d7b('0x61'),'GROUP_CONCAT DESC':_0x8d7b('0x62')};var _0x2bb00c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8d7b('0x63'),'HOUR':_0x8d7b('0x8b'),'ROUND':_0x8d7b('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2671c9=function(_0x5d8bfa){return!_[_0x8d7b('0x66')]([_0x8d7b('0x67'),_0x8d7b('0x68'),_0x8d7b('0x8c'),_0x8d7b('0x8d')],_0x5d8bfa);};var _0x223eb9=function(_0x587b68){if(!_0x587b68||!_0x587b68[_0x8d7b('0x69')][_0x8d7b('0x3a')]){return'';}for(var _0x5d0194='(',_0x4b6f8c=0x0;_0x4b6f8c<_0x587b68[_0x8d7b('0x69')][_0x8d7b('0x3a')];_0x4b6f8c+=0x1){_0x4b6f8c>0x0&&(_0x5d0194+='\x20'+_0x587b68[_0x8d7b('0x6a')]+'\x20');_0x5d0194+=_0x587b68[_0x8d7b('0x69')][_0x4b6f8c]['group']?_0x223eb9(_0x587b68[_0x8d7b('0x69')][_0x4b6f8c]['group']):_0x587b68[_0x8d7b('0x69')][_0x4b6f8c][_0x8d7b('0x6c')]+'\x20'+_0x587b68[_0x8d7b('0x69')][_0x4b6f8c][_0x8d7b('0x6d')]+(_0x2671c9(_0x587b68[_0x8d7b('0x69')][_0x4b6f8c][_0x8d7b('0x6d')])?'\x20'+_0x587b68['rules'][_0x4b6f8c]['value']:'');}return _0x5d0194+')';};var _0x1687a7={'where':{'id':_0x70699a['id']}},_0x14e4a4,_0x27d9e3,_0x4ba3db,_0x48afc0,_0x521625;_0x1687a7=_[_0x8d7b('0x45')]({},_0x1687a7,_0x495424);return db[_0x8d7b('0x30')][_0x8d7b('0x56')](_0x1687a7)[_0x8d7b('0x28')](function(_0x4115fc){if(_0x4115fc){_0x14e4a4=_0x4115fc;return _0x4115fc[_0x8d7b('0x8e')]();}return null;})[_0x8d7b('0x28')](function(_0x4e8294){if(_0x4e8294){if(!_0x4e8294['length']){throw new db[(_0x8d7b('0x6e'))][(_0x8d7b('0x6f'))](_0x8d7b('0x8f'),0x193);}_0x27d9e3=_0x4e8294;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x8d7b('0x28')](function(_0x11e222){if(_0x11e222){_0x4ba3db=_[_0x8d7b('0x71')](_0x11e222,'id');var _0xeb0648;var _0x256fd3=squel[_0x8d7b('0x90')]();_0x256fd3['from'](_0x14e4a4[_0x8d7b('0x73')]);for(var _0x1e675f=0x0;_0x1e675f<_0x27d9e3[_0x8d7b('0x3a')];_0x1e675f+=0x1){_0xeb0648=_0x27d9e3[_0x1e675f][_0x8d7b('0x74')]?_0x4ba3db[_0x27d9e3[_0x1e675f][_0x8d7b('0x74')]][_0x8d7b('0x91')]:_0x27d9e3[_0x1e675f]['field'];_0xeb0648=_0x27d9e3[_0x1e675f][_0x8d7b('0x76')]?_['replace'](_0x384e85[_0x27d9e3[_0x1e675f]['function']],'%s',_0xeb0648):_0xeb0648;_0xeb0648=_0x27d9e3[_0x1e675f]['format']?_[_0x8d7b('0x75')](_0x2bb00c[_0x27d9e3[_0x1e675f]['format']],'%s',_0xeb0648):_0xeb0648;if(_0x27d9e3[_0x1e675f]['groupBy']){_0x256fd3['group'](_0xeb0648);}_0x27d9e3[_0x1e675f][_0x8d7b('0x79')]&&_0x256fd3['order'](_0xeb0648,_0x27d9e3[_0x1e675f][_0x8d7b('0x79')]===_0x8d7b('0x92')?![]:!![]);_0x256fd3[_0x8d7b('0x6c')](_0xeb0648,_0x27d9e3[_0x1e675f][_0x8d7b('0x7a')]||_0xeb0648);}if(_0x14e4a4['joins']){_0x14e4a4[_0x8d7b('0x7b')]=JSON[_0x8d7b('0x7c')](_0x14e4a4[_0x8d7b('0x7b')]);for(var _0x1f1e5f=0x0;_0x1f1e5f<_0x14e4a4[_0x8d7b('0x7b')][_0x8d7b('0x3a')];_0x1f1e5f+=0x1){if(_0x14e4a4['joins'][_0x1f1e5f][_0x8d7b('0x43')]&&_[_0x8d7b('0x66')](_0x5cddbe,_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f][_0x8d7b('0x43')])&&_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f][_0x8d7b('0x7d')]&&_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f][_0x8d7b('0x7f')]&&_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f][_0x8d7b('0x7e')]){_0x256fd3[_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f][_0x8d7b('0x43')]](_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f]['foreignTable'],null,util[_0x8d7b('0x77')](_0x8d7b('0x80'),_0x14e4a4[_0x8d7b('0x73')],_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f][_0x8d7b('0x7d')],_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f]['foreignTable'],_0x14e4a4[_0x8d7b('0x7b')][_0x1f1e5f]['foreignKey']));}}}if(_0x14e4a4[_0x8d7b('0x81')]){_0x14e4a4['conditions']=JSON[_0x8d7b('0x7c')](_0x14e4a4[_0x8d7b('0x81')]);_0x256fd3[_0x8d7b('0x3e')](_0x223eb9(_0x14e4a4['conditions'][_0x8d7b('0x6b')]));}_0x521625=_0x256fd3['clone']();_0x256fd3[_0x8d7b('0x1f')](_0x55b50d);_0x256fd3[_0x8d7b('0x21')](0x0);return;}})[_0x8d7b('0x28')](function(){if(_0x19373b[_0x8d7b('0x93')]===_0x8d7b('0x94')){return null;}var _0x242d93=_[_0x8d7b('0x45')](_0x19373b,{'name':_0x19373b[_0x8d7b('0x95')]||_0x19373b[_0x8d7b('0x2e')]||_0x14e4a4['name'],'basename':_0x24f7f3,'savename':util['format'](_0x8d7b('0x96'),_0x19373b[_0x8d7b('0x2e')]||_0x14e4a4[_0x8d7b('0x2e')],require(_0x8d7b('0x97'))['generate'](0x4),_0x19373b[_0x8d7b('0x93')]||_0x8d7b('0x98')),'reportId':_0x14e4a4['id'],'reportType':_0x8d7b('0x99')});return db[_0x8d7b('0x9a')]['create'](_0x242d93,{'raw':!![]});})[_0x8d7b('0x28')](function(_0x9d9f6){if(_0x14e4a4[_0x8d7b('0x73')]===_0x8d7b('0x9b')){_0x521625[_0x8d7b('0x3e')](_0x14e4a4[_0x8d7b('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x19373b[_0x8d7b('0x9c')],_0x19373b[_0x8d7b('0x9d')]);}else{_0x521625[_0x8d7b('0x3e')](_0x14e4a4[_0x8d7b('0x73')]+_0x8d7b('0x9e'),_0x19373b[_0x8d7b('0x9c')],_0x19373b[_0x8d7b('0x9d')]);}if(_0x9d9f6){logger[_0x8d7b('0x9f')](_0x8d7b('0xa0'),_0x521625[_0x8d7b('0x85')]());require('child_process')[_0x8d7b('0xa1')](path['join'](__dirname,_0x8d7b('0xa2'),_0x9d9f6[_0x8d7b('0x93')]),[_0x9d9f6['id'],_0x521625[_0x8d7b('0x85')](),path['join'](__dirname,_0x8d7b('0xa3'),_0x9d9f6['savename']),_0x24f7f3]);return _0x9d9f6;}else{var _0x22b191=squel[_0x8d7b('0x90')]();_0x22b191[_0x8d7b('0x72')]('('+_0x521625[_0x8d7b('0x85')]()+')','countTable');_0x22b191[_0x8d7b('0x6c')](_0x8d7b('0xa4'),_0x8d7b('0x20'));_0x521625[_0x8d7b('0x1f')](_0x19373b['limit']||_0x55b50d);_0x521625['offset'](_0x19373b[_0x8d7b('0x21')]||0x0);return dbH[_0x8d7b('0x86')][_0x8d7b('0x34')](_0x22b191['toString'](),{'type':dbH['sequelize'][_0x8d7b('0x87')][_0x8d7b('0x88')]})['then'](function(_0x5ee3aa){if(!_0x5ee3aa[_0x8d7b('0x3a')]){_0x48afc0=0x0;}else{_0x48afc0=_0x5ee3aa[0x0][_0x8d7b('0x20')]||0x0;}return dbH[_0x8d7b('0x86')][_0x8d7b('0x34')](_0x521625[_0x8d7b('0x85')](),{'type':dbH[_0x8d7b('0x86')][_0x8d7b('0x87')][_0x8d7b('0x88')]});})[_0x8d7b('0x28')](function(_0x368bf0){return{'rows':_0x368bf0||[],'count':_0x48afc0};});}});}exports[_0x8d7b('0xa5')]=function(_0x213013,_0x53a3d3){return runReport(_0x213013[_0x8d7b('0x57')],_0x213013[_0x8d7b('0x34')],_0x213013[_0x8d7b('0x46')])['then'](respondWithResult(_0x53a3d3,null))[_0x8d7b('0x4a')](handleError(_0x53a3d3,null));};exports[_0x8d7b('0xa6')]=runReport;exports[_0x8d7b('0x34')]=function(_0x6ba479,_0x3d4c47){var _0x5f4964=0xa;var _0xf4d559=[_0x8d7b('0x58'),_0x8d7b('0x59'),_0x8d7b('0x5a'),'cross_join'];var _0x56501b={'SUM':'SUM(%s)','COUNT':_0x8d7b('0x5d'),'COUNT DISTINCT':_0x8d7b('0x89'),'MAX':_0x8d7b('0x5e'),'MIN':_0x8d7b('0x8a'),'AVG':_0x8d7b('0x5f'),'GROUP_CONCAT':_0x8d7b('0x60'),'GROUP_CONCAT ASC':_0x8d7b('0x61'),'GROUP_CONCAT DESC':_0x8d7b('0x62')};var _0x2de87f={'SEC_TO_TIME':_0x8d7b('0xa7'),'DATE':_0x8d7b('0x63'),'HOUR':_0x8d7b('0x8b'),'ROUND':_0x8d7b('0x64'),'UNIX_TIMESTAMP':_0x8d7b('0x65')};var _0x2b037f=function(_0x2595a0){return!_[_0x8d7b('0x66')](['IS\x20NULL',_0x8d7b('0x68'),_0x8d7b('0x8c'),'IS\x20NOT\x20EMPTY'],_0x2595a0);};var _0x57ebb2=function(_0x29a34a){if(!_0x29a34a||!_0x29a34a[_0x8d7b('0x69')][_0x8d7b('0x3a')]){return'';}for(var _0x21e73b='(',_0x2a1863=0x0;_0x2a1863<_0x29a34a['rules'][_0x8d7b('0x3a')];_0x2a1863+=0x1){_0x2a1863>0x0&&(_0x21e73b+='\x20'+_0x29a34a[_0x8d7b('0x6a')]+'\x20');_0x21e73b+=_0x29a34a[_0x8d7b('0x69')][_0x2a1863][_0x8d7b('0x6b')]?_0x57ebb2(_0x29a34a[_0x8d7b('0x69')][_0x2a1863]['group']):_0x29a34a[_0x8d7b('0x69')][_0x2a1863][_0x8d7b('0x6c')]+'\x20'+_0x29a34a['rules'][_0x2a1863][_0x8d7b('0x6d')]+(_0x2b037f(_0x29a34a['rules'][_0x2a1863][_0x8d7b('0x6d')])?'\x20'+_0x29a34a[_0x8d7b('0x69')][_0x2a1863][_0x8d7b('0xa8')]:'');}return _0x21e73b+')';};var _0x135dc2={'where':{'id':_0x6ba479['params']['id']}},_0x490bdd,_0x21b63e,_0x3d784a,_0x18023c,_0xae9a34;_0x135dc2=_[_0x8d7b('0x45')]({},_0x135dc2,_0x6ba479['options']);return db[_0x8d7b('0x30')][_0x8d7b('0x56')](_0x135dc2)[_0x8d7b('0x28')](function(_0x4899f8){if(_0x4899f8){_0x490bdd=_0x4899f8;return _0x4899f8[_0x8d7b('0x8e')]();}return null;})[_0x8d7b('0x28')](function(_0x375935){if(_0x375935){if(!_0x375935['length']){throw new db[(_0x8d7b('0x6e'))][(_0x8d7b('0x6f'))](_0x8d7b('0x8f'),0x193);}_0x21b63e=_0x375935;return db[_0x8d7b('0x70')]['findAll']({'raw':!![]});}return null;})[_0x8d7b('0x28')](function(_0x34f95c){if(_0x34f95c){_0x3d784a=_[_0x8d7b('0x71')](_0x34f95c,'id');var _0x1e653e;var _0x432e25=squel[_0x8d7b('0x90')]();_0x432e25[_0x8d7b('0x72')](_0x490bdd[_0x8d7b('0x73')]);for(var _0x373709=0x0;_0x373709<_0x21b63e['length'];_0x373709+=0x1){_0x1e653e=_0x21b63e[_0x373709]['MetricId']?_0x3d784a[_0x21b63e[_0x373709][_0x8d7b('0x74')]][_0x8d7b('0x91')]:_0x21b63e[_0x373709][_0x8d7b('0x6c')];_0x1e653e=_0x21b63e[_0x373709][_0x8d7b('0x76')]?_[_0x8d7b('0x75')](_0x56501b[_0x21b63e[_0x373709]['function']],'%s',_0x1e653e):_0x1e653e;_0x1e653e=_0x21b63e[_0x373709][_0x8d7b('0x77')]?_[_0x8d7b('0x75')](_0x2de87f[_0x21b63e[_0x373709][_0x8d7b('0x77')]],'%s',_0x1e653e):_0x1e653e;if(_0x21b63e[_0x373709][_0x8d7b('0x78')]){_0x432e25[_0x8d7b('0x6b')](_0x1e653e);}_0x21b63e[_0x373709][_0x8d7b('0x79')]&&_0x432e25[_0x8d7b('0xa9')](_0x1e653e,_0x21b63e[_0x373709][_0x8d7b('0x79')]===_0x8d7b('0x92')?![]:!![]);_0x432e25[_0x8d7b('0x6c')](_0x1e653e,_0x21b63e[_0x373709][_0x8d7b('0x7a')]||_0x1e653e);}if(_0x490bdd['joins']){_0x490bdd['joins']=JSON[_0x8d7b('0x7c')](_0x490bdd['joins']);for(var _0x52130f=0x0;_0x52130f<_0x490bdd[_0x8d7b('0x7b')][_0x8d7b('0x3a')];_0x52130f+=0x1){if(_0x490bdd[_0x8d7b('0x7b')][_0x52130f][_0x8d7b('0x43')]&&_['includes'](_0xf4d559,_0x490bdd[_0x8d7b('0x7b')][_0x52130f][_0x8d7b('0x43')])&&_0x490bdd[_0x8d7b('0x7b')][_0x52130f][_0x8d7b('0x7d')]&&_0x490bdd[_0x8d7b('0x7b')][_0x52130f]['foreignTable']&&_0x490bdd['joins'][_0x52130f][_0x8d7b('0x7e')]){_0x432e25[_0x490bdd[_0x8d7b('0x7b')][_0x52130f][_0x8d7b('0x43')]](_0x490bdd['joins'][_0x52130f][_0x8d7b('0x7f')],null,util[_0x8d7b('0x77')](_0x8d7b('0x80'),_0x490bdd[_0x8d7b('0x73')],_0x490bdd[_0x8d7b('0x7b')][_0x52130f][_0x8d7b('0x7d')],_0x490bdd['joins'][_0x52130f]['foreignTable'],_0x490bdd[_0x8d7b('0x7b')][_0x52130f][_0x8d7b('0x7e')]));}}}if(_0x490bdd[_0x8d7b('0x81')]){_0x490bdd[_0x8d7b('0x81')]=JSON[_0x8d7b('0x7c')](_0x490bdd[_0x8d7b('0x81')]);_0x432e25[_0x8d7b('0x3e')](_0x57ebb2(_0x490bdd[_0x8d7b('0x81')]['group']));}_0xae9a34=_0x432e25[_0x8d7b('0x82')]();_0x432e25[_0x8d7b('0x1f')](_0x5f4964);_0x432e25[_0x8d7b('0x21')](0x0);logger[_0x8d7b('0x83')](_0x8d7b('0x84'),_0x432e25['toString']());return dbH['sequelize'][_0x8d7b('0x34')](_0x432e25[_0x8d7b('0x85')](),{'type':dbH[_0x8d7b('0x86')]['QueryTypes'][_0x8d7b('0x88')]});}})[_0x8d7b('0x28')](function(){return{'sql':_0xae9a34['toString']()};})['then'](respondWithResult(_0x3d4c47,null))[_0x8d7b('0x4a')](handleError(_0x3d4c47,null));}; \ No newline at end of file +var _0x93e6=['sendStatus','status','end','json','offset','undefined','limit','set','reject','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','getFields','groupBy','web','%s-%s.%s','randomstring','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','output','../../files/reports','savename','countTable','COUNT(*)','IS\x20NOT\x20NULL','eml-format','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93e6,0x11e));var _0x693e=function(_0x48cb44,_0x406b00){_0x48cb44=_0x48cb44-0x0;var _0x3cb35b=_0x93e6[_0x48cb44];return _0x3cb35b;};'use strict';var emlformat=require(_0x693e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x693e('0x1'));var rp=require('request-promise');var moment=require(_0x693e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x693e('0x3'));var util=require(_0x693e('0x4'));var path=require(_0x693e('0x5'));var sox=require('sox');var csv=require(_0x693e('0x6'));var ejs=require(_0x693e('0x7'));var fs=require('fs');var fs_extra=require(_0x693e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x693e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x693e('0x6'));var querystring=require(_0x693e('0xa'));var Papa=require(_0x693e('0xb'));var Redis=require('ioredis');var authService=require(_0x693e('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x693e('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x693e('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x693e('0xf'));var licenseUtil=require(_0x693e('0x10'));var db=require(_0x693e('0x11'))['db'];var dbH=require(_0x693e('0x11'))['dbH'];function respondWithStatusCode(_0x256143,_0x172b79){_0x172b79=_0x172b79||0xcc;return function(_0x25c4a7){if(_0x25c4a7){return _0x256143[_0x693e('0x12')](_0x172b79);}return _0x256143[_0x693e('0x13')](_0x172b79)[_0x693e('0x14')]();};}function respondWithResult(_0x3e44ba,_0x4a7626){_0x4a7626=_0x4a7626||0xc8;return function(_0x3a696c){if(_0x3a696c){return _0x3e44ba[_0x693e('0x13')](_0x4a7626)[_0x693e('0x15')](_0x3a696c);}};}function respondWithFilteredResult(_0x54d946,_0x18b748){return function(_0x7103b1){if(_0x7103b1){var _0x32b1c0=typeof _0x18b748[_0x693e('0x16')]===_0x693e('0x17')&&typeof _0x18b748[_0x693e('0x18')]===_0x693e('0x17');var _0x4f4264=_0x7103b1['count'];var _0x5e842f=_0x32b1c0?0x0:_0x18b748[_0x693e('0x16')];var _0x11407a=_0x32b1c0?_0x7103b1['count']:_0x18b748['offset']+_0x18b748[_0x693e('0x18')];var _0x175253;if(_0x11407a>=_0x4f4264){_0x11407a=_0x4f4264;_0x175253=0xc8;}else{_0x175253=0xce;}_0x54d946[_0x693e('0x13')](_0x175253);return _0x54d946[_0x693e('0x19')]('Content-Range',_0x5e842f+'-'+_0x11407a+'/'+_0x4f4264)[_0x693e('0x15')](_0x7103b1);}return null;};}function patchUpdates(_0x40aee8){return function(_0x3ce473){try{jsonpatch['apply'](_0x3ce473,_0x40aee8,!![]);}catch(_0x37d69c){return BPromise[_0x693e('0x1a')](_0x37d69c);}return _0x3ce473['save']();};}function saveUpdates(_0x433d14,_0x1e5c04){return function(_0x5850e8){if(_0x5850e8){return _0x5850e8[_0x693e('0x1b')](_0x433d14)[_0x693e('0x1c')](function(_0x51f0f0){return _0x51f0f0;});}return null;};}function removeEntity(_0x3847be,_0x25c39e){return function(_0x1fd85){if(_0x1fd85){return _0x1fd85[_0x693e('0x1d')]()[_0x693e('0x1c')](function(){var _0x322924=_0x1fd85[_0x693e('0x1e')]({'plain':!![]});var _0x13fcb9=_0x693e('0x1f');return db[_0x693e('0x20')][_0x693e('0x1d')]({'where':{'type':_0x13fcb9,'resourceId':_0x322924['id']}})[_0x693e('0x1c')](function(){return _0x1fd85;});})[_0x693e('0x1c')](function(){_0x3847be[_0x693e('0x13')](0xcc)[_0x693e('0x14')]();});}};}function handleEntityNotFound(_0x402674,_0xc86c62){return function(_0x2cf92b){if(!_0x2cf92b){_0x402674['sendStatus'](0x194);}return _0x2cf92b;};}function handleError(_0x3b6156,_0x1c002d){_0x1c002d=_0x1c002d||0x1f4;return function(_0x1ea8e1){logger[_0x693e('0x21')](_0x1ea8e1[_0x693e('0x22')]);if(_0x1ea8e1['name']){delete _0x1ea8e1[_0x693e('0x23')];}_0x3b6156['status'](_0x1c002d)[_0x693e('0x24')](_0x1ea8e1);};}exports['index']=function(_0x279c2e,_0x19e04f){var _0x4e0a08={},_0x3f6c11={},_0x2b47e7={'count':0x0,'rows':[]};var _0x4c3bc4=_[_0x693e('0x25')](db[_0x693e('0x26')][_0x693e('0x27')],function(_0x2a4101){return{'name':_0x2a4101[_0x693e('0x28')],'type':_0x2a4101[_0x693e('0x29')][_0x693e('0x2a')]};});_0x3f6c11[_0x693e('0x2b')]=_[_0x693e('0x25')](_0x4c3bc4,_0x693e('0x23'));_0x3f6c11[_0x693e('0x2c')]=_[_0x693e('0x2d')](_0x279c2e[_0x693e('0x2c')]);_0x3f6c11[_0x693e('0x2e')]=_[_0x693e('0x2f')](_0x3f6c11[_0x693e('0x2b')],_0x3f6c11[_0x693e('0x2c')]);_0x4e0a08[_0x693e('0x30')]=_[_0x693e('0x2f')](_0x3f6c11['model'],qs[_0x693e('0x31')](_0x279c2e[_0x693e('0x2c')]['fields']));_0x4e0a08[_0x693e('0x30')]=_0x4e0a08[_0x693e('0x30')]['length']?_0x4e0a08['attributes']:_0x3f6c11[_0x693e('0x2b')];if(!_0x279c2e[_0x693e('0x2c')][_0x693e('0x32')](_0x693e('0x33'))){_0x4e0a08[_0x693e('0x18')]=qs[_0x693e('0x18')](_0x279c2e[_0x693e('0x2c')][_0x693e('0x18')]);_0x4e0a08['offset']=qs[_0x693e('0x16')](_0x279c2e[_0x693e('0x2c')]['offset']);}_0x4e0a08[_0x693e('0x34')]=qs[_0x693e('0x35')](_0x279c2e[_0x693e('0x2c')][_0x693e('0x35')]);_0x4e0a08[_0x693e('0x36')]=qs[_0x693e('0x2e')](_[_0x693e('0x37')](_0x279c2e['query'],_0x3f6c11[_0x693e('0x2e')]),_0x4c3bc4);if(_0x279c2e[_0x693e('0x2c')][_0x693e('0x38')]){_0x4e0a08['where']=_[_0x693e('0x39')](_0x4e0a08['where'],{'$or':_[_0x693e('0x25')](_0x4c3bc4,function(_0x8a2f3){if(_0x8a2f3['type']!=='VIRTUAL'){var _0x37ca16={};_0x37ca16[_0x8a2f3[_0x693e('0x23')]]={'$like':'%'+_0x279c2e[_0x693e('0x2c')][_0x693e('0x38')]+'%'};return _0x37ca16;}})});}_0x4e0a08=_[_0x693e('0x39')]({},_0x4e0a08,_0x279c2e[_0x693e('0x3a')]);var _0xa47f7c={'where':_0x4e0a08[_0x693e('0x36')]};return db[_0x693e('0x26')][_0x693e('0x3b')](_0xa47f7c)[_0x693e('0x1c')](function(_0x3cec0b){_0x2b47e7['count']=_0x3cec0b;if(_0x279c2e['query'][_0x693e('0x3c')]){_0x4e0a08[_0x693e('0x3d')]=[{'all':!![]}];}return db[_0x693e('0x26')][_0x693e('0x3e')](_0x4e0a08);})[_0x693e('0x1c')](function(_0x484850){_0x2b47e7[_0x693e('0x3f')]=_0x484850;return _0x2b47e7;})[_0x693e('0x1c')](respondWithFilteredResult(_0x19e04f,_0x4e0a08))[_0x693e('0x40')](handleError(_0x19e04f,null));};exports[_0x693e('0x41')]=function(_0x31d744,_0xc3e0c){var _0x3793eb={'raw':![],'where':{'id':_0x31d744['params']['id']}},_0x261def={};_0x261def[_0x693e('0x2b')]=_['keys'](db[_0x693e('0x26')][_0x693e('0x27')]);_0x261def['query']=_[_0x693e('0x2d')](_0x31d744[_0x693e('0x2c')]);_0x261def[_0x693e('0x2e')]=_['intersection'](_0x261def[_0x693e('0x2b')],_0x261def[_0x693e('0x2c')]);_0x3793eb[_0x693e('0x30')]=_[_0x693e('0x2f')](_0x261def[_0x693e('0x2b')],qs[_0x693e('0x31')](_0x31d744[_0x693e('0x2c')][_0x693e('0x31')]));_0x3793eb[_0x693e('0x30')]=_0x3793eb[_0x693e('0x30')]['length']?_0x3793eb['attributes']:_0x261def[_0x693e('0x2b')];if(_0x31d744[_0x693e('0x2c')][_0x693e('0x3c')]){_0x3793eb[_0x693e('0x3d')]=[{'all':!![]}];}_0x3793eb=_[_0x693e('0x39')]({},_0x3793eb,_0x31d744['options']);return db[_0x693e('0x26')][_0x693e('0x42')](_0x3793eb)[_0x693e('0x1c')](handleEntityNotFound(_0xc3e0c,null))[_0x693e('0x1c')](respondWithResult(_0xc3e0c,null))[_0x693e('0x40')](handleError(_0xc3e0c,null));};exports[_0x693e('0x43')]=function(_0x511c69,_0x1cd493){return db[_0x693e('0x26')][_0x693e('0x43')](_0x511c69[_0x693e('0x44')],{})['then'](function(_0x7fd9a4){var _0x585cd7=_0x511c69[_0x693e('0x45')][_0x693e('0x1e')]({'plain':!![]});if(!_0x585cd7)throw new Error(_0x693e('0x46'));if(_0x585cd7[_0x693e('0x47')]===_0x693e('0x45')){var _0x2085a5=_0x7fd9a4[_0x693e('0x1e')]({'plain':!![]});var _0x39503e='Reports';return db['UserProfileSection'][_0x693e('0x42')]({'where':{'name':_0x39503e,'userProfileId':_0x585cd7[_0x693e('0x48')]},'raw':!![]})[_0x693e('0x1c')](function(_0x1fc19f){if(_0x1fc19f&&_0x1fc19f[_0x693e('0x49')]===0x0){return db['UserProfileResource'][_0x693e('0x43')]({'name':_0x2085a5[_0x693e('0x23')],'resourceId':_0x2085a5['id'],'type':'CustomReports','sectionId':_0x1fc19f['id']},{})[_0x693e('0x1c')](function(){return _0x7fd9a4;});}else{return _0x7fd9a4;}})[_0x693e('0x40')](function(_0x91028f){logger[_0x693e('0x21')](_0x693e('0x4a'),_0x91028f);throw _0x91028f;});}return _0x7fd9a4;})[_0x693e('0x1c')](respondWithResult(_0x1cd493,0xc9))[_0x693e('0x40')](handleError(_0x1cd493,null));};exports[_0x693e('0x1b')]=function(_0x1390c0,_0x129a75){if(_0x1390c0[_0x693e('0x44')]['id']){delete _0x1390c0[_0x693e('0x44')]['id'];}return db[_0x693e('0x26')]['find']({'where':{'id':_0x1390c0['params']['id']}})['then'](handleEntityNotFound(_0x129a75,null))[_0x693e('0x1c')](saveUpdates(_0x1390c0[_0x693e('0x44')],null))[_0x693e('0x1c')](respondWithResult(_0x129a75,null))[_0x693e('0x40')](handleError(_0x129a75,null));};exports[_0x693e('0x1d')]=function(_0x48c6cb,_0x52e652){return db[_0x693e('0x26')][_0x693e('0x42')]({'where':{'id':_0x48c6cb[_0x693e('0x4b')]['id']}})[_0x693e('0x1c')](handleEntityNotFound(_0x52e652,null))[_0x693e('0x1c')](removeEntity(_0x52e652,null))[_0x693e('0x40')](handleError(_0x52e652,null));};exports['preview']=function(_0x34a17f,_0x6d3fb7){var _0x2f35b7=0xa;var _0x29bc09=['join','left_join',_0x693e('0x4c'),_0x693e('0x4d')];var _0x4f65fe={'SUM':_0x693e('0x4e'),'COUNT':_0x693e('0x4f'),'COUNT DISTINCT':_0x693e('0x50'),'MAX':_0x693e('0x51'),'MIN':_0x693e('0x52'),'AVG':_0x693e('0x53'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x693e('0x54')};var _0xe42978={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x693e('0x55'),'ROUND':_0x693e('0x56'),'UNIX_TIMESTAMP':_0x693e('0x57')};var _0x3c8731=function(_0x432418){return!_[_0x693e('0x58')]([_0x693e('0x59'),'IS\x20NOT\x20NULL',_0x693e('0x5a'),_0x693e('0x5b')],_0x432418);};var _0x4fbf29=function(_0x53bd7c){if(!_0x53bd7c||!_0x53bd7c[_0x693e('0x5c')][_0x693e('0x5d')]){return'';}for(var _0x525641='(',_0x9f9019=0x0;_0x9f9019<_0x53bd7c[_0x693e('0x5c')]['length'];_0x9f9019+=0x1){_0x9f9019>0x0&&(_0x525641+='\x20'+_0x53bd7c[_0x693e('0x5e')]+'\x20');_0x525641+=_0x53bd7c[_0x693e('0x5c')][_0x9f9019][_0x693e('0x5f')]?_0x4fbf29(_0x53bd7c[_0x693e('0x5c')][_0x9f9019][_0x693e('0x5f')]):_0x53bd7c[_0x693e('0x5c')][_0x9f9019][_0x693e('0x60')]+'\x20'+_0x53bd7c[_0x693e('0x5c')][_0x9f9019][_0x693e('0x61')]+(_0x3c8731(_0x53bd7c[_0x693e('0x5c')][_0x9f9019][_0x693e('0x61')])?'\x20'+_0x53bd7c[_0x693e('0x5c')][_0x9f9019][_0x693e('0x62')]:'');}return _0x525641+')';};var _0x1f3f26={'where':{'id':_0x34a17f[_0x693e('0x4b')]['id']}},_0xb7af4d,_0x3cb570,_0x380ff6,_0x3c3e57,_0xfb66da;_0x1f3f26=_['merge']({},_0x1f3f26,_0x34a17f['options']);return db[_0x693e('0x26')][_0x693e('0x42')](_0x1f3f26)[_0x693e('0x1c')](function(_0x34b546){if(_0x34b546){_0xb7af4d=_0x34b546;return _0x34b546['getFields']();}return null;})[_0x693e('0x1c')](function(_0xf33634){if(_0xf33634){if(!_0xf33634[_0x693e('0x5d')]){throw new db[(_0x693e('0x63'))][(_0x693e('0x64'))](_0x693e('0x65'),0x193);}_0x3cb570=_0xf33634;return db[_0x693e('0x66')][_0x693e('0x3e')]({'raw':!![]});}return null;})[_0x693e('0x1c')](function(_0x4d91a8){if(_0x4d91a8){_0x380ff6=_[_0x693e('0x67')](_0x4d91a8,'id');var _0x77feb4;var _0x2e7310=squel[_0x693e('0x68')]();_0x2e7310[_0x693e('0x69')](_0xb7af4d[_0x693e('0x6a')]);for(var _0x2efb85=0x0;_0x2efb85<_0x3cb570[_0x693e('0x5d')];_0x2efb85+=0x1){_0x77feb4=_0x3cb570[_0x2efb85]['MetricId']?_0x380ff6[_0x3cb570[_0x2efb85][_0x693e('0x6b')]][_0x693e('0x6c')]:_0x3cb570[_0x2efb85]['field'];_0x77feb4=_0x3cb570[_0x2efb85][_0x693e('0x6d')]?_[_0x693e('0x6e')](_0x4f65fe[_0x3cb570[_0x2efb85]['function']],'%s',_0x77feb4):_0x77feb4;_0x77feb4=_0x3cb570[_0x2efb85]['format']?_['replace'](_0xe42978[_0x3cb570[_0x2efb85][_0x693e('0x6f')]],'%s',_0x77feb4):_0x77feb4;if(_0x3cb570[_0x2efb85]['groupBy']){_0x2e7310[_0x693e('0x5f')](_0x77feb4);}_0x3cb570[_0x2efb85][_0x693e('0x70')]&&_0x2e7310['order'](_0x77feb4,_0x3cb570[_0x2efb85][_0x693e('0x70')]===_0x693e('0x71')?![]:!![]);_0x2e7310[_0x693e('0x60')](_0x77feb4,_0x3cb570[_0x2efb85][_0x693e('0x72')]||_0x77feb4);}if(_0xb7af4d[_0x693e('0x73')]){_0xb7af4d[_0x693e('0x73')]=JSON['parse'](_0xb7af4d[_0x693e('0x73')]);for(var _0x38e823=0x0;_0x38e823<_0xb7af4d[_0x693e('0x73')][_0x693e('0x5d')];_0x38e823+=0x1){if(_0xb7af4d[_0x693e('0x73')][_0x38e823][_0x693e('0x29')]&&_['includes'](_0x29bc09,_0xb7af4d['joins'][_0x38e823][_0x693e('0x29')])&&_0xb7af4d['joins'][_0x38e823][_0x693e('0x74')]&&_0xb7af4d[_0x693e('0x73')][_0x38e823][_0x693e('0x75')]&&_0xb7af4d['joins'][_0x38e823][_0x693e('0x76')]){_0x2e7310[_0xb7af4d['joins'][_0x38e823][_0x693e('0x29')]](_0xb7af4d[_0x693e('0x73')][_0x38e823]['foreignTable'],null,util[_0x693e('0x6f')](_0x693e('0x77'),_0xb7af4d[_0x693e('0x6a')],_0xb7af4d[_0x693e('0x73')][_0x38e823][_0x693e('0x74')],_0xb7af4d[_0x693e('0x73')][_0x38e823][_0x693e('0x75')],_0xb7af4d[_0x693e('0x73')][_0x38e823]['foreignKey']));}}}if(_0xb7af4d[_0x693e('0x78')]){_0xb7af4d['conditions']=JSON[_0x693e('0x79')](_0xb7af4d[_0x693e('0x78')]);_0x2e7310['where'](_0x4fbf29(_0xb7af4d['conditions'][_0x693e('0x5f')]));}_0xfb66da=_0x2e7310[_0x693e('0x7a')]();_0x2e7310[_0x693e('0x18')](_0x2f35b7);_0x2e7310['offset'](0x0);logger[_0x693e('0x7b')](_0x693e('0x7c'),_0x2e7310[_0x693e('0x7d')]());return dbH[_0x693e('0x7e')][_0x693e('0x2c')](_0x2e7310[_0x693e('0x7d')](),{'type':dbH[_0x693e('0x7e')][_0x693e('0x7f')][_0x693e('0x80')]});}})[_0x693e('0x1c')](respondWithResult(_0x6d3fb7,null))[_0x693e('0x40')](handleError(_0x6d3fb7,null));};function runReport(_0x230640,_0x1d59f0,_0x13b8c1){var _0x944b0b=_0x1d59f0[_0x693e('0x23')];var _0x32aff7=0xa;var _0x27693e=[_0x693e('0x81'),_0x693e('0x82'),_0x693e('0x4c'),_0x693e('0x4d')];var _0x5a5e5d={'SUM':_0x693e('0x4e'),'COUNT':_0x693e('0x4f'),'COUNT DISTINCT':_0x693e('0x50'),'MAX':_0x693e('0x51'),'MIN':_0x693e('0x52'),'AVG':_0x693e('0x53'),'GROUP_CONCAT':_0x693e('0x83'),'GROUP_CONCAT ASC':_0x693e('0x84'),'GROUP_CONCAT DESC':_0x693e('0x54')};var _0xda6005={'SEC_TO_TIME':_0x693e('0x85'),'DATE':'DATE(%s)','HOUR':_0x693e('0x55'),'ROUND':_0x693e('0x56'),'UNIX_TIMESTAMP':_0x693e('0x57')};var _0x82aac1=function(_0x3ffba5){return!_[_0x693e('0x58')]([_0x693e('0x59'),'IS\x20NOT\x20NULL',_0x693e('0x5a'),_0x693e('0x5b')],_0x3ffba5);};var _0x19d8a1=function(_0xccfb20){if(!_0xccfb20||!_0xccfb20[_0x693e('0x5c')][_0x693e('0x5d')]){return'';}for(var _0xcb9284='(',_0x372881=0x0;_0x372881<_0xccfb20[_0x693e('0x5c')][_0x693e('0x5d')];_0x372881+=0x1){_0x372881>0x0&&(_0xcb9284+='\x20'+_0xccfb20[_0x693e('0x5e')]+'\x20');_0xcb9284+=_0xccfb20[_0x693e('0x5c')][_0x372881][_0x693e('0x5f')]?_0x19d8a1(_0xccfb20['rules'][_0x372881][_0x693e('0x5f')]):_0xccfb20['rules'][_0x372881]['field']+'\x20'+_0xccfb20[_0x693e('0x5c')][_0x372881]['condition']+(_0x82aac1(_0xccfb20['rules'][_0x372881]['condition'])?'\x20'+_0xccfb20[_0x693e('0x5c')][_0x372881]['value']:'');}return _0xcb9284+')';};var _0x59cb8a={'where':{'id':_0x230640['id']}},_0x4d0ec7,_0x4cda2f,_0x4d48ed,_0xf3cf5,_0x1107ae;_0x59cb8a=_[_0x693e('0x39')]({},_0x59cb8a,_0x13b8c1);return db['AnalyticCustomReport'][_0x693e('0x42')](_0x59cb8a)[_0x693e('0x1c')](function(_0x452a3b){if(_0x452a3b){_0x4d0ec7=_0x452a3b;return _0x452a3b[_0x693e('0x86')]();}return null;})[_0x693e('0x1c')](function(_0x30ba6a){if(_0x30ba6a){if(!_0x30ba6a[_0x693e('0x5d')]){throw new db[(_0x693e('0x63'))]['ValidationErrorItem'](_0x693e('0x65'),0x193);}_0x4cda2f=_0x30ba6a;return db[_0x693e('0x66')][_0x693e('0x3e')]({'raw':!![]});}return null;})[_0x693e('0x1c')](function(_0x289e64){if(_0x289e64){_0x4d48ed=_['keyBy'](_0x289e64,'id');var _0x2c5f01;var _0x4bbef9=squel[_0x693e('0x68')]();_0x4bbef9[_0x693e('0x69')](_0x4d0ec7[_0x693e('0x6a')]);for(var _0x1cb990=0x0;_0x1cb990<_0x4cda2f[_0x693e('0x5d')];_0x1cb990+=0x1){_0x2c5f01=_0x4cda2f[_0x1cb990]['MetricId']?_0x4d48ed[_0x4cda2f[_0x1cb990][_0x693e('0x6b')]]['metric']:_0x4cda2f[_0x1cb990]['field'];_0x2c5f01=_0x4cda2f[_0x1cb990][_0x693e('0x6d')]?_[_0x693e('0x6e')](_0x5a5e5d[_0x4cda2f[_0x1cb990][_0x693e('0x6d')]],'%s',_0x2c5f01):_0x2c5f01;_0x2c5f01=_0x4cda2f[_0x1cb990][_0x693e('0x6f')]?_['replace'](_0xda6005[_0x4cda2f[_0x1cb990][_0x693e('0x6f')]],'%s',_0x2c5f01):_0x2c5f01;if(_0x4cda2f[_0x1cb990][_0x693e('0x87')]){_0x4bbef9[_0x693e('0x5f')](_0x2c5f01);}_0x4cda2f[_0x1cb990]['orderBy']&&_0x4bbef9[_0x693e('0x34')](_0x2c5f01,_0x4cda2f[_0x1cb990]['orderBy']==='DESC'?![]:!![]);_0x4bbef9[_0x693e('0x60')](_0x2c5f01,_0x4cda2f[_0x1cb990][_0x693e('0x72')]||_0x2c5f01);}if(_0x4d0ec7[_0x693e('0x73')]){_0x4d0ec7[_0x693e('0x73')]=JSON[_0x693e('0x79')](_0x4d0ec7[_0x693e('0x73')]);for(var _0x1f8c6c=0x0;_0x1f8c6c<_0x4d0ec7[_0x693e('0x73')][_0x693e('0x5d')];_0x1f8c6c+=0x1){if(_0x4d0ec7['joins'][_0x1f8c6c][_0x693e('0x29')]&&_['includes'](_0x27693e,_0x4d0ec7['joins'][_0x1f8c6c][_0x693e('0x29')])&&_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c][_0x693e('0x74')]&&_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c]['foreignTable']&&_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c][_0x693e('0x76')]){_0x4bbef9[_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c][_0x693e('0x29')]](_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c][_0x693e('0x75')],null,util[_0x693e('0x6f')](_0x693e('0x77'),_0x4d0ec7[_0x693e('0x6a')],_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c][_0x693e('0x74')],_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c]['foreignTable'],_0x4d0ec7[_0x693e('0x73')][_0x1f8c6c]['foreignKey']));}}}if(_0x4d0ec7[_0x693e('0x78')]){_0x4d0ec7[_0x693e('0x78')]=JSON[_0x693e('0x79')](_0x4d0ec7[_0x693e('0x78')]);_0x4bbef9[_0x693e('0x36')](_0x19d8a1(_0x4d0ec7[_0x693e('0x78')]['group']));}_0x1107ae=_0x4bbef9[_0x693e('0x7a')]();_0x4bbef9['limit'](_0x32aff7);_0x4bbef9[_0x693e('0x16')](0x0);return;}})['then'](function(){if(_0x1d59f0['output']===_0x693e('0x88')){return null;}var _0x5ec9d6=_[_0x693e('0x39')](_0x1d59f0,{'name':_0x1d59f0['fullPath']||_0x1d59f0[_0x693e('0x23')]||_0x4d0ec7[_0x693e('0x23')],'basename':_0x944b0b,'savename':util[_0x693e('0x6f')](_0x693e('0x89'),_0x1d59f0[_0x693e('0x23')]||_0x4d0ec7[_0x693e('0x23')],require(_0x693e('0x8a'))['generate'](0x4),_0x1d59f0['output']||'csv'),'reportId':_0x4d0ec7['id'],'reportType':'custom'});return db[_0x693e('0x8b')][_0x693e('0x43')](_0x5ec9d6,{'raw':!![]});})[_0x693e('0x1c')](function(_0x8688be){if(_0x4d0ec7[_0x693e('0x6a')]==='cdr'){_0x1107ae[_0x693e('0x36')](_0x4d0ec7[_0x693e('0x6a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1d59f0[_0x693e('0x8c')],_0x1d59f0[_0x693e('0x8d')]);}else{_0x1107ae['where'](_0x4d0ec7[_0x693e('0x6a')]+_0x693e('0x8e'),_0x1d59f0['startDate'],_0x1d59f0['endDate']);}if(_0x8688be){logger[_0x693e('0x8f')](_0x693e('0x90'),_0x1107ae[_0x693e('0x7d')]());require('child_process')['fork'](path[_0x693e('0x81')](__dirname,_0x693e('0x91'),_0x8688be[_0x693e('0x92')]),[_0x8688be['id'],_0x1107ae[_0x693e('0x7d')](),path[_0x693e('0x81')](__dirname,_0x693e('0x93'),_0x8688be[_0x693e('0x94')]),_0x944b0b]);return _0x8688be;}else{var _0x327032=squel['select']();_0x327032['from']('('+_0x1107ae['toString']()+')',_0x693e('0x95'));_0x327032[_0x693e('0x60')](_0x693e('0x96'),_0x693e('0x3b'));_0x1107ae['limit'](_0x1d59f0['limit']||_0x32aff7);_0x1107ae[_0x693e('0x16')](_0x1d59f0[_0x693e('0x16')]||0x0);return dbH[_0x693e('0x7e')]['query'](_0x327032['toString'](),{'type':dbH[_0x693e('0x7e')]['QueryTypes']['SELECT']})[_0x693e('0x1c')](function(_0x55b4ee){if(!_0x55b4ee[_0x693e('0x5d')]){_0xf3cf5=0x0;}else{_0xf3cf5=_0x55b4ee[0x0][_0x693e('0x3b')]||0x0;}return dbH['sequelize']['query'](_0x1107ae['toString'](),{'type':dbH[_0x693e('0x7e')]['QueryTypes']['SELECT']});})[_0x693e('0x1c')](function(_0x3a5c80){return{'rows':_0x3a5c80||[],'count':_0xf3cf5};});}});}exports['run']=function(_0x14395c,_0x356701){return runReport(_0x14395c[_0x693e('0x4b')],_0x14395c[_0x693e('0x2c')],_0x14395c[_0x693e('0x3a')])['then'](respondWithResult(_0x356701,null))['catch'](handleError(_0x356701,null));};exports['runReport']=runReport;exports[_0x693e('0x2c')]=function(_0x390be9,_0x4b71e7){var _0x258574=0xa;var _0x4df7b9=[_0x693e('0x81'),_0x693e('0x82'),_0x693e('0x4c'),_0x693e('0x4d')];var _0x56faa8={'SUM':_0x693e('0x4e'),'COUNT':_0x693e('0x4f'),'COUNT DISTINCT':_0x693e('0x50'),'MAX':_0x693e('0x51'),'MIN':_0x693e('0x52'),'AVG':_0x693e('0x53'),'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 _0x3e519b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x693e('0x56'),'UNIX_TIMESTAMP':_0x693e('0x57')};var _0x252087=function(_0x4503d3){return!_[_0x693e('0x58')]([_0x693e('0x59'),_0x693e('0x97'),_0x693e('0x5a'),_0x693e('0x5b')],_0x4503d3);};var _0x4546cc=function(_0x4e26c5){if(!_0x4e26c5||!_0x4e26c5[_0x693e('0x5c')][_0x693e('0x5d')]){return'';}for(var _0x4c5d4c='(',_0x12bd27=0x0;_0x12bd27<_0x4e26c5[_0x693e('0x5c')][_0x693e('0x5d')];_0x12bd27+=0x1){_0x12bd27>0x0&&(_0x4c5d4c+='\x20'+_0x4e26c5['operator']+'\x20');_0x4c5d4c+=_0x4e26c5[_0x693e('0x5c')][_0x12bd27][_0x693e('0x5f')]?_0x4546cc(_0x4e26c5[_0x693e('0x5c')][_0x12bd27][_0x693e('0x5f')]):_0x4e26c5['rules'][_0x12bd27]['field']+'\x20'+_0x4e26c5[_0x693e('0x5c')][_0x12bd27][_0x693e('0x61')]+(_0x252087(_0x4e26c5['rules'][_0x12bd27][_0x693e('0x61')])?'\x20'+_0x4e26c5[_0x693e('0x5c')][_0x12bd27][_0x693e('0x62')]:'');}return _0x4c5d4c+')';};var _0x11b1c4={'where':{'id':_0x390be9[_0x693e('0x4b')]['id']}},_0x4550d8,_0x439c73,_0x270a5c,_0x453d48,_0x2437e6;_0x11b1c4=_[_0x693e('0x39')]({},_0x11b1c4,_0x390be9[_0x693e('0x3a')]);return db[_0x693e('0x26')][_0x693e('0x42')](_0x11b1c4)[_0x693e('0x1c')](function(_0x2cba91){if(_0x2cba91){_0x4550d8=_0x2cba91;return _0x2cba91['getFields']();}return null;})[_0x693e('0x1c')](function(_0x1d04e4){if(_0x1d04e4){if(!_0x1d04e4[_0x693e('0x5d')]){throw new db[(_0x693e('0x63'))][(_0x693e('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x439c73=_0x1d04e4;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x693e('0x1c')](function(_0x23d5d1){if(_0x23d5d1){_0x270a5c=_['keyBy'](_0x23d5d1,'id');var _0x9c63c;var _0x5bdb45=squel[_0x693e('0x68')]();_0x5bdb45[_0x693e('0x69')](_0x4550d8[_0x693e('0x6a')]);for(var _0x3336ec=0x0;_0x3336ec<_0x439c73[_0x693e('0x5d')];_0x3336ec+=0x1){_0x9c63c=_0x439c73[_0x3336ec][_0x693e('0x6b')]?_0x270a5c[_0x439c73[_0x3336ec][_0x693e('0x6b')]][_0x693e('0x6c')]:_0x439c73[_0x3336ec][_0x693e('0x60')];_0x9c63c=_0x439c73[_0x3336ec]['function']?_[_0x693e('0x6e')](_0x56faa8[_0x439c73[_0x3336ec][_0x693e('0x6d')]],'%s',_0x9c63c):_0x9c63c;_0x9c63c=_0x439c73[_0x3336ec][_0x693e('0x6f')]?_[_0x693e('0x6e')](_0x3e519b[_0x439c73[_0x3336ec]['format']],'%s',_0x9c63c):_0x9c63c;if(_0x439c73[_0x3336ec][_0x693e('0x87')]){_0x5bdb45[_0x693e('0x5f')](_0x9c63c);}_0x439c73[_0x3336ec][_0x693e('0x70')]&&_0x5bdb45['order'](_0x9c63c,_0x439c73[_0x3336ec][_0x693e('0x70')]===_0x693e('0x71')?![]:!![]);_0x5bdb45[_0x693e('0x60')](_0x9c63c,_0x439c73[_0x3336ec]['alias']||_0x9c63c);}if(_0x4550d8[_0x693e('0x73')]){_0x4550d8[_0x693e('0x73')]=JSON[_0x693e('0x79')](_0x4550d8[_0x693e('0x73')]);for(var _0x1c0515=0x0;_0x1c0515<_0x4550d8['joins'][_0x693e('0x5d')];_0x1c0515+=0x1){if(_0x4550d8[_0x693e('0x73')][_0x1c0515][_0x693e('0x29')]&&_[_0x693e('0x58')](_0x4df7b9,_0x4550d8[_0x693e('0x73')][_0x1c0515]['type'])&&_0x4550d8[_0x693e('0x73')][_0x1c0515]['parentKey']&&_0x4550d8[_0x693e('0x73')][_0x1c0515][_0x693e('0x75')]&&_0x4550d8[_0x693e('0x73')][_0x1c0515][_0x693e('0x76')]){_0x5bdb45[_0x4550d8[_0x693e('0x73')][_0x1c0515][_0x693e('0x29')]](_0x4550d8[_0x693e('0x73')][_0x1c0515][_0x693e('0x75')],null,util[_0x693e('0x6f')]('%s.%s\x20=\x20%s.%s',_0x4550d8['table'],_0x4550d8[_0x693e('0x73')][_0x1c0515][_0x693e('0x74')],_0x4550d8['joins'][_0x1c0515][_0x693e('0x75')],_0x4550d8[_0x693e('0x73')][_0x1c0515][_0x693e('0x76')]));}}}if(_0x4550d8[_0x693e('0x78')]){_0x4550d8[_0x693e('0x78')]=JSON[_0x693e('0x79')](_0x4550d8[_0x693e('0x78')]);_0x5bdb45['where'](_0x4546cc(_0x4550d8['conditions'][_0x693e('0x5f')]));}_0x2437e6=_0x5bdb45[_0x693e('0x7a')]();_0x5bdb45[_0x693e('0x18')](_0x258574);_0x5bdb45[_0x693e('0x16')](0x0);logger['debug'](_0x693e('0x7c'),_0x5bdb45['toString']());return dbH[_0x693e('0x7e')][_0x693e('0x2c')](_0x5bdb45[_0x693e('0x7d')](),{'type':dbH['sequelize'][_0x693e('0x7f')][_0x693e('0x80')]});}})[_0x693e('0x1c')](function(){return{'sql':_0x2437e6[_0x693e('0x7d')]()};})[_0x693e('0x1c')](respondWithResult(_0x4b71e7,null))[_0x693e('0x40')](handleError(_0x4b71e7,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index ee51a8f..7c0dd26 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 _0xe0c5=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash'];(function(_0x2586dd,_0x181dee){var _0x154b28=function(_0x40f40c){while(--_0x40f40c){_0x2586dd['push'](_0x2586dd['shift']());}};_0x154b28(++_0x181dee);}(_0xe0c5,0x9b));var _0x5e0c=function(_0x225603,_0x2a773e){_0x225603=_0x225603-0x0;var _0x577e4b=_0xe0c5[_0x225603];return _0x577e4b;};'use strict';var _=require(_0x5e0c('0x0'));var util=require(_0x5e0c('0x1'));var logger=require(_0x5e0c('0x2'))('api');var moment=require(_0x5e0c('0x3'));var BPromise=require(_0x5e0c('0x4'));var rp=require(_0x5e0c('0x5'));var fs=require('fs');var path=require(_0x5e0c('0x6'));var rimraf=require(_0x5e0c('0x7'));var config=require(_0x5e0c('0x8'));var attributes=require(_0x5e0c('0x9'));module[_0x5e0c('0xa')]=function(_0x50a6f6,_0x56bebf){return _0x50a6f6[_0x5e0c('0xb')](_0x5e0c('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2954=['define','AnalyticCustomReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2954,0xab));var _0x4295=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x2954[_0x3ceb54];return _0x26d8a6;};'use strict';var _=require(_0x4295('0x0'));var util=require(_0x4295('0x1'));var logger=require('../../config/logger')(_0x4295('0x2'));var moment=require(_0x4295('0x3'));var BPromise=require(_0x4295('0x4'));var rp=require(_0x4295('0x5'));var fs=require('fs');var path=require(_0x4295('0x6'));var rimraf=require(_0x4295('0x7'));var config=require(_0x4295('0x8'));var attributes=require(_0x4295('0x9'));module[_0x4295('0xa')]=function(_0x1f626c,_0x22c005){return _0x1f626c[_0x4295('0xb')](_0x4295('0xc'),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 257c318..df5c7db 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 _0xbcfd=['stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x184db2,_0x4a436d){var _0x4e7da7=function(_0x58a34e){while(--_0x58a34e){_0x184db2['push'](_0x184db2['shift']());}};_0x4e7da7(++_0x4a436d);}(_0xbcfd,0xca));var _0xdbcf=function(_0x50a3e6,_0x3e8ec2){_0x50a3e6=_0x50a3e6-0x0;var _0x315083=_0xbcfd[_0x50a3e6];return _0x315083;};'use strict';var _=require(_0xdbcf('0x0'));var util=require(_0xdbcf('0x1'));var moment=require(_0xdbcf('0x2'));var BPromise=require(_0xdbcf('0x3'));var rs=require(_0xdbcf('0x4'));var fs=require('fs');var Redis=require(_0xdbcf('0x5'));var db=require(_0xdbcf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdbcf('0x7'))(_0xdbcf('0x8'));var config=require(_0xdbcf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdbcf('0xa')][_0xdbcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x130c00,_0xb370bc,_0x4df393){return new BPromise(function(_0x5885fc,_0xa927ab){return client[_0xdbcf('0xc')](_0x130c00,_0x4df393)[_0xdbcf('0xd')](function(_0x1f2731){logger[_0xdbcf('0xe')](_0xdbcf('0xf'),_0xb370bc,_0xdbcf('0x10'));logger[_0xdbcf('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xb370bc,'request\x20sent',JSON[_0xdbcf('0x12')](_0x1f2731));if(_0x1f2731[_0xdbcf('0x13')]){if(_0x1f2731[_0xdbcf('0x13')]['code']===0x1f4){logger['error'](_0xdbcf('0xf'),_0xb370bc,_0x1f2731[_0xdbcf('0x13')][_0xdbcf('0x14')]);return _0xa927ab(_0x1f2731[_0xdbcf('0x13')][_0xdbcf('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xb370bc,_0x1f2731['error'][_0xdbcf('0x14')]);return _0x5885fc(_0x1f2731[_0xdbcf('0x13')][_0xdbcf('0x14')]);}else{logger['info'](_0xdbcf('0xf'),_0xb370bc,'request\x20sent');_0x5885fc(_0x1f2731['result'][_0xdbcf('0x14')]);}})[_0xdbcf('0x15')](function(_0x2c7203){logger[_0xdbcf('0x13')](_0xdbcf('0xf'),_0xb370bc,_0x2c7203);_0xa927ab(_0x2c7203);});});} \ No newline at end of file +var _0x5940=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util'];(function(_0x4b5c84,_0x10f9e0){var _0x46bb23=function(_0x24f329){while(--_0x24f329){_0x4b5c84['push'](_0x4b5c84['shift']());}};_0x46bb23(++_0x10f9e0);}(_0x5940,0x14f));var _0x0594=function(_0x80c82f,_0x3a403d){_0x80c82f=_0x80c82f-0x0;var _0x42eaaa=_0x5940[_0x80c82f];return _0x42eaaa;};'use strict';var _=require('lodash');var util=require(_0x0594('0x0'));var moment=require(_0x0594('0x1'));var BPromise=require(_0x0594('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0594('0x3'));var db=require(_0x0594('0x4'))['db'];var utils=require(_0x0594('0x5'));var logger=require(_0x0594('0x6'))(_0x0594('0x7'));var config=require(_0x0594('0x8'));var jayson=require(_0x0594('0x9'));var client=jayson[_0x0594('0xa')][_0x0594('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4134c7,_0x41c7cc,_0x2e683b){return new BPromise(function(_0x1c38cc,_0x9d0262){return client['request'](_0x4134c7,_0x2e683b)['then'](function(_0x474aca){logger[_0x0594('0xc')](_0x0594('0xd'),_0x41c7cc,_0x0594('0xe'));logger[_0x0594('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x41c7cc,_0x0594('0xe'),JSON[_0x0594('0x10')](_0x474aca));if(_0x474aca[_0x0594('0x11')]){if(_0x474aca['error'][_0x0594('0x12')]===0x1f4){logger[_0x0594('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x41c7cc,_0x474aca[_0x0594('0x11')][_0x0594('0x13')]);return _0x9d0262(_0x474aca['error'][_0x0594('0x13')]);}logger['error'](_0x0594('0xd'),_0x41c7cc,_0x474aca['error']['message']);return _0x1c38cc(_0x474aca[_0x0594('0x11')]['message']);}else{logger[_0x0594('0xc')](_0x0594('0xd'),_0x41c7cc,_0x0594('0xe'));_0x1c38cc(_0x474aca[_0x0594('0x14')][_0x0594('0x13')]);}})['catch'](function(_0x19d632){logger['error'](_0x0594('0xd'),_0x41c7cc,_0x19d632);_0x9d0262(_0x19d632);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 70a2f81..e71b4e9 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 _0x363e=['/:id/query','query','post','create','put','update','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','/:id','get','/:id/preview','preview','/:id/run'];(function(_0x4f2499,_0x1d0af3){var _0x13c47a=function(_0x353e79){while(--_0x353e79){_0x4f2499['push'](_0x4f2499['shift']());}};_0x13c47a(++_0x1d0af3);}(_0x363e,0x1d4));var _0xe363=function(_0x19461e,_0x3afa21){_0x19461e=_0x19461e-0x0;var _0x322988=_0x363e[_0x19461e];return _0x322988;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe363('0x0'));var timeout=require(_0xe363('0x1'));var express=require(_0xe363('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe363('0x3'));var config=require('../../config/environment');var controller=require(_0xe363('0x4'));router['get']('/',auth[_0xe363('0x5')](),controller[_0xe363('0x6')]);router['get'](_0xe363('0x7'),auth[_0xe363('0x5')](),controller['show']);router[_0xe363('0x8')](_0xe363('0x9'),auth['isAuthenticated'](),controller[_0xe363('0xa')]);router[_0xe363('0x8')](_0xe363('0xb'),auth['isAuthenticated'](),controller['run']);router[_0xe363('0x8')](_0xe363('0xc'),auth[_0xe363('0x5')](),controller[_0xe363('0xd')]);router[_0xe363('0xe')]('/',auth[_0xe363('0x5')](),controller[_0xe363('0xf')]);router[_0xe363('0x10')](_0xe363('0x7'),auth['isAuthenticated'](),controller[_0xe363('0x11')]);router['delete'](_0xe363('0x7'),auth[_0xe363('0x5')](),controller[_0xe363('0x12')]);module[_0xe363('0x13')]=router; \ No newline at end of file +var _0x5459=['query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/run','run','/:id/query'];(function(_0x584e45,_0x1d4e17){var _0x3fbeb1=function(_0xdab686){while(--_0xdab686){_0x584e45['push'](_0x584e45['shift']());}};_0x3fbeb1(++_0x1d4e17);}(_0x5459,0xd7));var _0x9545=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5459[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x9545('0x0'));var path=require(_0x9545('0x1'));var timeout=require(_0x9545('0x2'));var express=require(_0x9545('0x3'));var router=express['Router']();var fs_extra=require(_0x9545('0x4'));var auth=require(_0x9545('0x5'));var interaction=require(_0x9545('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x9545('0x7')]('/',auth['isAuthenticated'](),controller[_0x9545('0x8')]);router['get'](_0x9545('0x9'),auth[_0x9545('0xa')](),controller[_0x9545('0xb')]);router['get']('/:id/preview',auth[_0x9545('0xa')](),controller['preview']);router['get'](_0x9545('0xc'),auth[_0x9545('0xa')](),controller[_0x9545('0xd')]);router[_0x9545('0x7')](_0x9545('0xe'),auth[_0x9545('0xa')](),controller[_0x9545('0xf')]);router[_0x9545('0x10')]('/',auth['isAuthenticated'](),controller[_0x9545('0x11')]);router[_0x9545('0x12')](_0x9545('0x9'),auth['isAuthenticated'](),controller[_0x9545('0x13')]);router[_0x9545('0x14')](_0x9545('0x9'),auth['isAuthenticated'](),controller[_0x9545('0x15')]);module[_0x9545('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 24007ed..f61dc36 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x42c903,_0x5c81bc){var _0xcfd717=function(_0x34fd31){while(--_0x34fd31){_0x42c903['push'](_0x42c903['shift']());}};_0xcfd717(++_0x5c81bc);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x348860,_0x4531f6){_0x348860=_0x348860-0x0;var _0x2fc2ad=_0xfdbd[_0x348860];return _0x2fc2ad;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x2ad1b8,_0x1ea09b){var _0x52547d=function(_0x33b77c){while(--_0x33b77c){_0x2ad1b8['push'](_0x2ad1b8['shift']());}};_0x52547d(++_0x1ea09b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0xf2ca[_0x46c1d5];return _0x40fe7b;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 30a1d7d..412d8c1 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 _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x1e2d0a,_0x524a79){var _0xe56f58=function(_0x1a627c){while(--_0x1a627c){_0x1e2d0a['push'](_0x1e2d0a['shift']());}};_0xe56f58(++_0x524a79);}(_0x1261,0x144));var _0x1126=function(_0x553502,_0x4d2c0c){_0x553502=_0x553502-0x0;var _0x246c37=_0x1261[_0x553502];return _0x246c37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file +var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%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)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x444784,_0x3ccfbc){var _0x3f1675=function(_0x3813c6){while(--_0x3813c6){_0x444784['push'](_0x444784['shift']());}};_0x3f1675(++_0x3ccfbc);}(_0x1cb9,0x14e));var _0x91cb=function(_0x141ea1,_0x13a245){_0x141ea1=_0x141ea1-0x0;var _0x174108=_0x1cb9[_0x141ea1];return _0x174108;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 776a29f..1980423 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 _0x7359=['bluebird','path','../../config/environment','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x4e3e1b,_0x5e5a73){var _0x13dd55=function(_0x18367a){while(--_0x18367a){_0x4e3e1b['push'](_0x4e3e1b['shift']());}};_0x13dd55(++_0x5e5a73);}(_0x7359,0xee));var _0x9735=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7359[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x9735('0x0'));var util=require(_0x9735('0x1'));var logger=require(_0x9735('0x2'))(_0x9735('0x3'));var moment=require(_0x9735('0x4'));var BPromise=require(_0x9735('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9735('0x6'));var rimraf=require('rimraf');var config=require(_0x9735('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x4adfdb,_0x3cba33){return _0x4adfdb['define']('AnalyticDefaultReport',attributes,{'tableName':_0x9735('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9e5=['analytics_default_reports','lodash','moment','bluebird','request-promise','path','rimraf','exports','AnalyticDefaultReport'];(function(_0x5f084b,_0x55dd5a){var _0x54ee68=function(_0x287144){while(--_0x287144){_0x5f084b['push'](_0x5f084b['shift']());}};_0x54ee68(++_0x55dd5a);}(_0xf9e5,0x1c3));var _0x5f9e=function(_0x21481a,_0x145e1b){_0x21481a=_0x21481a-0x0;var _0x405315=_0xf9e5[_0x21481a];return _0x405315;};'use strict';var _=require(_0x5f9e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5f9e('0x1'));var BPromise=require(_0x5f9e('0x2'));var rp=require(_0x5f9e('0x3'));var fs=require('fs');var path=require(_0x5f9e('0x4'));var rimraf=require(_0x5f9e('0x5'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x5f9e('0x6')]=function(_0x49d3d8,_0x4c35b3){return _0x49d3d8['define'](_0x5f9e('0x7'),attributes,{'tableName':_0x5f9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 07040a4..82362c5 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 _0xf881=['debug','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent'];(function(_0x528aeb,_0x3022d5){var _0x5c4770=function(_0x4d3e56){while(--_0x4d3e56){_0x528aeb['push'](_0x528aeb['shift']());}};_0x5c4770(++_0x3022d5);}(_0xf881,0x86));var _0x1f88=function(_0x46bcee,_0x4a33c5){_0x46bcee=_0x46bcee-0x0;var _0x56fe0f=_0xf881[_0x46bcee];return _0x56fe0f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f88('0x0'));var BPromise=require(_0x1f88('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f88('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f88('0x3'))(_0x1f88('0x4'));var config=require(_0x1f88('0x5'));var jayson=require(_0x1f88('0x6'));var client=jayson[_0x1f88('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3888d0,_0x25dcea,_0x12bdb2){return new BPromise(function(_0x34ca14,_0x4cc8d9){return client['request'](_0x3888d0,_0x12bdb2)[_0x1f88('0x8')](function(_0x48997f){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x25dcea,_0x1f88('0x9'));logger[_0x1f88('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x25dcea,'request\x20sent',JSON['stringify'](_0x48997f));if(_0x48997f[_0x1f88('0xb')]){if(_0x48997f[_0x1f88('0xb')][_0x1f88('0xc')]===0x1f4){logger[_0x1f88('0xb')](_0x1f88('0xd'),_0x25dcea,_0x48997f[_0x1f88('0xb')][_0x1f88('0xe')]);return _0x4cc8d9(_0x48997f[_0x1f88('0xb')][_0x1f88('0xe')]);}logger[_0x1f88('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x25dcea,_0x48997f[_0x1f88('0xb')]['message']);return _0x34ca14(_0x48997f[_0x1f88('0xb')]['message']);}else{logger['info'](_0x1f88('0xd'),_0x25dcea,'request\x20sent');_0x34ca14(_0x48997f['result'][_0x1f88('0xe')]);}})[_0x1f88('0xf')](function(_0x5a2d17){logger[_0x1f88('0xb')](_0x1f88('0xd'),_0x25dcea,_0x5a2d17);_0x4cc8d9(_0x5a2d17);});});} \ No newline at end of file +var _0x7554=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x126d38,_0x2a6798){var _0x5535bb=function(_0x1f959f){while(--_0x1f959f){_0x126d38['push'](_0x126d38['shift']());}};_0x5535bb(++_0x2a6798);}(_0x7554,0x113));var _0x4755=function(_0x4f24ec,_0x2544e9){_0x4f24ec=_0x4f24ec-0x0;var _0x43570b=_0x7554[_0x4f24ec];return _0x43570b;};'use strict';var _=require(_0x4755('0x0'));var util=require(_0x4755('0x1'));var moment=require(_0x4755('0x2'));var BPromise=require(_0x4755('0x3'));var rs=require(_0x4755('0x4'));var fs=require('fs');var Redis=require(_0x4755('0x5'));var db=require(_0x4755('0x6'))['db'];var utils=require(_0x4755('0x7'));var logger=require(_0x4755('0x8'))(_0x4755('0x9'));var config=require('../../config/environment');var jayson=require(_0x4755('0xa'));var client=jayson[_0x4755('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f482f,_0xeaead7,_0x2358d1){return new BPromise(function(_0x166b5b,_0x2c5856){return client[_0x4755('0xc')](_0x5f482f,_0x2358d1)[_0x4755('0xd')](function(_0x152608){logger[_0x4755('0xe')](_0x4755('0xf'),_0xeaead7,_0x4755('0x10'));logger[_0x4755('0x11')](_0x4755('0x12'),_0xeaead7,_0x4755('0x10'),JSON['stringify'](_0x152608));if(_0x152608['error']){if(_0x152608[_0x4755('0x13')][_0x4755('0x14')]===0x1f4){logger[_0x4755('0x13')](_0x4755('0xf'),_0xeaead7,_0x152608[_0x4755('0x13')][_0x4755('0x15')]);return _0x2c5856(_0x152608[_0x4755('0x13')][_0x4755('0x15')]);}logger[_0x4755('0x13')](_0x4755('0xf'),_0xeaead7,_0x152608[_0x4755('0x13')][_0x4755('0x15')]);return _0x166b5b(_0x152608[_0x4755('0x13')]['message']);}else{logger[_0x4755('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xeaead7,_0x4755('0x10'));_0x166b5b(_0x152608[_0x4755('0x16')][_0x4755('0x15')]);}})[_0x4755('0x17')](function(_0xc551a4){logger[_0x4755('0x13')](_0x4755('0xf'),_0xeaead7,_0xc551a4);_0x2c5856(_0xc551a4);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 380f6d5..2dd3838 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 _0x3550=['path','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','put','exports','multer','util'];(function(_0x5c3a6a,_0x5e567a){var _0x68d5d6=function(_0x4e30a2){while(--_0x4e30a2){_0x5c3a6a['push'](_0x5c3a6a['shift']());}};_0x68d5d6(++_0x5e567a);}(_0x3550,0x11b));var _0x0355=function(_0xefec1e,_0x23ae10){_0xefec1e=_0xefec1e-0x0;var _0x4e7628=_0x3550[_0xefec1e];return _0x4e7628;};'use strict';var multer=require(_0x0355('0x0'));var util=require(_0x0355('0x1'));var path=require(_0x0355('0x2'));var timeout=require('connect-timeout');var express=require(_0x0355('0x3'));var router=express[_0x0355('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0355('0x5'));var config=require(_0x0355('0x6'));var controller=require(_0x0355('0x7'));router[_0x0355('0x8')]('/',auth[_0x0355('0x9')](),controller[_0x0355('0xa')]);router['get'](_0x0355('0xb'),auth[_0x0355('0x9')](),controller['show']);router[_0x0355('0x8')](_0x0355('0xc'),auth[_0x0355('0x9')](),controller[_0x0355('0xd')]);router[_0x0355('0x8')](_0x0355('0xe'),auth[_0x0355('0x9')](),controller['run']);router['get'](_0x0355('0xf'),auth[_0x0355('0x9')](),controller[_0x0355('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0355('0x11')]('/:id',auth[_0x0355('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x0355('0x12')]=router; \ No newline at end of file +var _0xd16c=['connect-timeout','Router','fs-extra','./analyticDefaultReport.controller','get','/:id','preview','/:id/run','run','isAuthenticated','query','create','put','update','delete','exports','multer','path'];(function(_0x21e834,_0x29609a){var _0x238b7b=function(_0x107fd0){while(--_0x107fd0){_0x21e834['push'](_0x21e834['shift']());}};_0x238b7b(++_0x29609a);}(_0xd16c,0xd6));var _0xcd16=function(_0x5524ff,_0x18a811){_0x5524ff=_0x5524ff-0x0;var _0x4eb65c=_0xd16c[_0x5524ff];return _0x4eb65c;};'use strict';var multer=require(_0xcd16('0x0'));var util=require('util');var path=require(_0xcd16('0x1'));var timeout=require(_0xcd16('0x2'));var express=require('express');var router=express[_0xcd16('0x3')]();var fs_extra=require(_0xcd16('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcd16('0x5'));router[_0xcd16('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcd16('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xcd16('0x6')]('/:id/preview',auth['isAuthenticated'](),controller[_0xcd16('0x8')]);router['get'](_0xcd16('0x9'),auth['isAuthenticated'](),controller[_0xcd16('0xa')]);router[_0xcd16('0x6')]('/:id/query',auth[_0xcd16('0xb')](),controller[_0xcd16('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcd16('0xd')]);router[_0xcd16('0xe')](_0xcd16('0x7'),auth[_0xcd16('0xb')](),controller[_0xcd16('0xf')]);router[_0xcd16('0x10')](_0xcd16('0x7'),auth[_0xcd16('0xb')](),controller['destroy']);module[_0xcd16('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8eeee5a..59d5ba7 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 _0x413d=['scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','xlsx','DATE','Loading','manual'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x413d,0x137));var _0xd413=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x413d[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0xd413('0x0'));var moment=require('moment');module[_0xd413('0x1')]={'name':{'type':Sequelize[_0xd413('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd413('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd413('0x3')]('csv','pdf',_0xd413('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd413('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd413('0x5')]},'endDate':{'type':Sequelize[_0xd413('0x5')]},'status':{'type':Sequelize[_0xd413('0x2')],'defaultValue':_0xd413('0x6')},'type':{'type':Sequelize[_0xd413('0x3')](_0xd413('0x7'),_0xd413('0x8')),'allowNull':![],'defaultValue':_0xd413('0x7')},'reportId':{'type':Sequelize[_0xd413('0x9')](0xb)[_0xd413('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdffa=['xlsx','csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','exports','STRING'];(function(_0x52f2a3,_0x4dc25d){var _0x558470=function(_0x5ac25c){while(--_0x5ac25c){_0x52f2a3['push'](_0x52f2a3['shift']());}};_0x558470(++_0x4dc25d);}(_0xdffa,0x6c));var _0xadff=function(_0x281f58,_0x6a4400){_0x281f58=_0x281f58-0x0;var _0x3b6bf4=_0xdffa[_0x281f58];return _0x3b6bf4;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xadff('0x0')]={'name':{'type':Sequelize[_0xadff('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xadff('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xadff('0x2')),'allowNull':![],'defaultValue':_0xadff('0x3')},'savename':{'type':Sequelize[_0xadff('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xadff('0x4')]},'endDate':{'type':Sequelize[_0xadff('0x4')]},'status':{'type':Sequelize[_0xadff('0x1')],'defaultValue':_0xadff('0x5')},'type':{'type':Sequelize['ENUM'](_0xadff('0x6'),_0xadff('0x7')),'allowNull':![],'defaultValue':_0xadff('0x6')},'reportId':{'type':Sequelize[_0xadff('0x8')](0xb)[_0xadff('0x9')]},'reportType':{'type':Sequelize[_0xadff('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 5e8e18b..5a43b1f 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 _0x8156=['userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','then','get','ExtractedReports','error','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x21c7af,_0x178cfd){var _0x2cded9=function(_0x2b9181){while(--_0x2b9181){_0x21c7af['push'](_0x21c7af['shift']());}};_0x2cded9(++_0x178cfd);}(_0x8156,0x145));var _0x6815=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8156[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x6815('0x0'));var rimraf=require(_0x6815('0x1'));var zipdir=require(_0x6815('0x2'));var jsonpatch=require(_0x6815('0x3'));var rp=require('request-promise');var moment=require(_0x6815('0x4'));var BPromise=require(_0x6815('0x5'));var Mustache=require(_0x6815('0x6'));var util=require(_0x6815('0x7'));var path=require('path');var sox=require(_0x6815('0x8'));var csv=require(_0x6815('0x9'));var ejs=require(_0x6815('0xa'));var fs=require('fs');var fs_extra=require(_0x6815('0xb'));var _=require(_0x6815('0xc'));var squel=require(_0x6815('0xd'));var crypto=require(_0x6815('0xe'));var jsforce=require(_0x6815('0xf'));var deskjs=require(_0x6815('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6815('0x11'));var Papa=require(_0x6815('0x12'));var Redis=require(_0x6815('0x13'));var authService=require(_0x6815('0x14'));var qs=require(_0x6815('0x15'));var as=require(_0x6815('0x16'));var hardwareService=require(_0x6815('0x17'));var logger=require(_0x6815('0x18'))(_0x6815('0x19'));var utils=require('../../config/utils');var config=require(_0x6815('0x1a'));var licenseUtil=require(_0x6815('0x1b'));var db=require(_0x6815('0x1c'))['db'];function respondWithStatusCode(_0x2d0998,_0x7b7caf){_0x7b7caf=_0x7b7caf||0xcc;return function(_0x1982f7){if(_0x1982f7){return _0x2d0998['sendStatus'](_0x7b7caf);}return _0x2d0998['status'](_0x7b7caf)[_0x6815('0x1d')]();};}function respondWithResult(_0x5a31f0,_0x4d8741){_0x4d8741=_0x4d8741||0xc8;return function(_0x332359){if(_0x332359){return _0x5a31f0[_0x6815('0x1e')](_0x4d8741)[_0x6815('0x1f')](_0x332359);}};}function respondWithFilteredResult(_0xc08e44,_0x431a33){return function(_0x260d79){if(_0x260d79){var _0x2c2f9c=typeof _0x431a33['offset']===_0x6815('0x20')&&typeof _0x431a33[_0x6815('0x21')]===_0x6815('0x20');var _0x18f0a2=_0x260d79[_0x6815('0x22')];var _0xfdd8a1=_0x2c2f9c?0x0:_0x431a33[_0x6815('0x23')];var _0x30c6f5=_0x2c2f9c?_0x260d79[_0x6815('0x22')]:_0x431a33[_0x6815('0x23')]+_0x431a33['limit'];var _0x130d37;if(_0x30c6f5>=_0x18f0a2){_0x30c6f5=_0x18f0a2;_0x130d37=0xc8;}else{_0x130d37=0xce;}_0xc08e44[_0x6815('0x1e')](_0x130d37);return _0xc08e44[_0x6815('0x24')](_0x6815('0x25'),_0xfdd8a1+'-'+_0x30c6f5+'/'+_0x18f0a2)[_0x6815('0x1f')](_0x260d79);}return null;};}function patchUpdates(_0x147ba8){return function(_0x5ad433){try{jsonpatch['apply'](_0x5ad433,_0x147ba8,!![]);}catch(_0x2492ee){return BPromise[_0x6815('0x26')](_0x2492ee);}return _0x5ad433['save']();};}function saveUpdates(_0x26cbd2,_0x2b9543){return function(_0x167393){if(_0x167393){return _0x167393[_0x6815('0x27')](_0x26cbd2)['then'](function(_0x3f6af1){return _0x3f6af1;});}return null;};}function removeEntity(_0x2b7dcf,_0x5e74ef){return function(_0x5d6c8b){if(_0x5d6c8b){return _0x5d6c8b[_0x6815('0x28')]()[_0x6815('0x29')](function(){var _0x5e9234=_0x5d6c8b[_0x6815('0x2a')]({'plain':!![]});var _0x177625=_0x6815('0x2b');return db['UserProfileResource'][_0x6815('0x28')]({'where':{'type':_0x177625,'resourceId':_0x5e9234['id']}})[_0x6815('0x29')](function(){return _0x5d6c8b;});})[_0x6815('0x29')](function(){_0x2b7dcf[_0x6815('0x1e')](0xcc)[_0x6815('0x1d')]();});}};}function handleEntityNotFound(_0x531e2d,_0x1a4497){return function(_0x52ad99){if(!_0x52ad99){_0x531e2d['sendStatus'](0x194);}return _0x52ad99;};}function handleError(_0x347ed6,_0x5a2408){_0x5a2408=_0x5a2408||0x1f4;return function(_0x49c8a6){logger[_0x6815('0x2c')](_0x49c8a6[_0x6815('0x2d')]);if(_0x49c8a6[_0x6815('0x2e')]){delete _0x49c8a6[_0x6815('0x2e')];}_0x347ed6[_0x6815('0x1e')](_0x5a2408)['send'](_0x49c8a6);};}exports[_0x6815('0x2f')]=function(_0x2725d3,_0x5146ce){var _0x579aed={},_0x547632={},_0x40ba96={'count':0x0,'rows':[]};var _0x1840a8=_['map'](db[_0x6815('0x30')][_0x6815('0x31')],function(_0x1d22cc){return{'name':_0x1d22cc[_0x6815('0x32')],'type':_0x1d22cc[_0x6815('0x33')][_0x6815('0x34')]};});_0x547632[_0x6815('0x35')]=_[_0x6815('0x36')](_0x1840a8,'name');_0x547632[_0x6815('0x37')]=_[_0x6815('0x38')](_0x2725d3[_0x6815('0x37')]);_0x547632[_0x6815('0x39')]=_[_0x6815('0x3a')](_0x547632['model'],_0x547632['query']);_0x579aed['attributes']=_[_0x6815('0x3a')](_0x547632[_0x6815('0x35')],qs[_0x6815('0x3b')](_0x2725d3[_0x6815('0x37')]['fields']));_0x579aed[_0x6815('0x3c')]=_0x579aed[_0x6815('0x3c')][_0x6815('0x3d')]?_0x579aed[_0x6815('0x3c')]:_0x547632[_0x6815('0x35')];if(!_0x2725d3[_0x6815('0x37')][_0x6815('0x3e')](_0x6815('0x3f'))){_0x579aed[_0x6815('0x21')]=qs['limit'](_0x2725d3[_0x6815('0x37')]['limit']);_0x579aed[_0x6815('0x23')]=qs[_0x6815('0x23')](_0x2725d3[_0x6815('0x37')][_0x6815('0x23')]);}_0x579aed[_0x6815('0x40')]=qs[_0x6815('0x41')](_0x2725d3['query']['sort']);_0x579aed[_0x6815('0x42')]=qs[_0x6815('0x39')](_['pick'](_0x2725d3[_0x6815('0x37')],_0x547632[_0x6815('0x39')]),_0x1840a8);if(_0x2725d3[_0x6815('0x37')]['filter']){_0x579aed['where']=_[_0x6815('0x43')](_0x579aed['where'],{'$or':_['map'](_0x1840a8,function(_0x447f34){if(_0x447f34['type']!==_0x6815('0x44')){var _0x360d03={};_0x360d03[_0x447f34[_0x6815('0x2e')]]={'$like':'%'+_0x2725d3[_0x6815('0x37')]['filter']+'%'};return _0x360d03;}})});}_0x579aed=_[_0x6815('0x43')]({},_0x579aed,_0x2725d3['options']);var _0x1cfe2c={'where':_0x579aed[_0x6815('0x42')]};return db['AnalyticExtractedReport'][_0x6815('0x22')](_0x1cfe2c)['then'](function(_0x2dc6e0){_0x40ba96[_0x6815('0x22')]=_0x2dc6e0;if(_0x2725d3['query'][_0x6815('0x45')]){_0x579aed[_0x6815('0x46')]=[{'all':!![]}];}return db[_0x6815('0x30')][_0x6815('0x47')](_0x579aed);})[_0x6815('0x29')](function(_0x3aefe2){_0x40ba96[_0x6815('0x48')]=_0x3aefe2;return _0x40ba96;})[_0x6815('0x29')](respondWithFilteredResult(_0x5146ce,_0x579aed))['catch'](handleError(_0x5146ce,null));};exports[_0x6815('0x49')]=function(_0x4ad440,_0x1e9ea2){var _0x13ebf2={'raw':!![],'where':{'id':_0x4ad440[_0x6815('0x4a')]['id']}},_0x2d1300={};_0x2d1300['model']=_[_0x6815('0x38')](db[_0x6815('0x30')]['rawAttributes']);_0x2d1300[_0x6815('0x37')]=_[_0x6815('0x38')](_0x4ad440[_0x6815('0x37')]);_0x2d1300['filters']=_['intersection'](_0x2d1300[_0x6815('0x35')],_0x2d1300['query']);_0x13ebf2[_0x6815('0x3c')]=_[_0x6815('0x3a')](_0x2d1300['model'],qs[_0x6815('0x3b')](_0x4ad440[_0x6815('0x37')]['fields']));_0x13ebf2[_0x6815('0x3c')]=_0x13ebf2[_0x6815('0x3c')][_0x6815('0x3d')]?_0x13ebf2[_0x6815('0x3c')]:_0x2d1300[_0x6815('0x35')];if(_0x4ad440[_0x6815('0x37')][_0x6815('0x45')]){_0x13ebf2['include']=[{'all':!![]}];}_0x13ebf2=_['merge']({},_0x13ebf2,_0x4ad440[_0x6815('0x4b')]);return db['AnalyticExtractedReport'][_0x6815('0x4c')](_0x13ebf2)[_0x6815('0x29')](handleEntityNotFound(_0x1e9ea2,null))[_0x6815('0x29')](respondWithResult(_0x1e9ea2,null))[_0x6815('0x4d')](handleError(_0x1e9ea2,null));};exports['create']=function(_0x385359,_0x14372d){return db[_0x6815('0x30')][_0x6815('0x4e')](_0x385359[_0x6815('0x4f')],{})[_0x6815('0x29')](function(_0x1f4fc0){var _0x11225c=_0x385359[_0x6815('0x50')][_0x6815('0x2a')]({'plain':!![]});if(!_0x11225c)throw new Error(_0x6815('0x51'));if(_0x11225c['role']===_0x6815('0x50')){var _0x5ce7c5=_0x1f4fc0['get']({'plain':!![]});var _0x59b770=_0x6815('0x2b');return db[_0x6815('0x52')]['find']({'where':{'name':_0x59b770,'userProfileId':_0x11225c[_0x6815('0x53')]},'raw':!![]})['then'](function(_0x11877f){if(_0x11877f&&_0x11877f['autoAssociation']===0x0){return db[_0x6815('0x54')][_0x6815('0x4e')]({'name':_0x5ce7c5['name'],'resourceId':_0x5ce7c5['id'],'type':_0x11877f[_0x6815('0x2e')],'sectionId':_0x11877f['id']},{})[_0x6815('0x29')](function(){return _0x1f4fc0;});}else{return _0x1f4fc0;}})['catch'](function(_0x1b51f8){logger[_0x6815('0x2c')](_0x6815('0x55'),_0x1b51f8);throw _0x1b51f8;});}return _0x1f4fc0;})[_0x6815('0x29')](respondWithResult(_0x14372d,0xc9))[_0x6815('0x4d')](handleError(_0x14372d,null));};exports[_0x6815('0x27')]=function(_0x12de69,_0x5c6a11){if(_0x12de69['body']['id']){delete _0x12de69['body']['id'];}return db[_0x6815('0x30')][_0x6815('0x4c')]({'where':{'id':_0x12de69[_0x6815('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c6a11,null))[_0x6815('0x29')](saveUpdates(_0x12de69['body'],null))[_0x6815('0x29')](respondWithResult(_0x5c6a11,null))[_0x6815('0x4d')](handleError(_0x5c6a11,null));};exports[_0x6815('0x28')]=function(_0x567c89,_0x2fe47e){return db[_0x6815('0x30')][_0x6815('0x4c')]({'where':{'id':_0x567c89[_0x6815('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fe47e,null))['then'](removeEntity(_0x2fe47e,null))[_0x6815('0x4d')](handleError(_0x2fe47e,null));};exports[_0x6815('0x56')]=function(_0xd25db5,_0xaed13c,_0x4f8f6b){return db['AnalyticExtractedReport'][_0x6815('0x4c')]({'where':{'id':_0xd25db5[_0x6815('0x4a')]['id']},'attributes':[_0x6815('0x2e'),_0x6815('0x57'),_0x6815('0x58'),_0x6815('0x59')],'raw':!![]})['then'](handleEntityNotFound(_0xaed13c,null))[_0x6815('0x29')](function(_0x2ee2ed){if(_0x2ee2ed){if(!fs[_0x6815('0x5a')](path[_0x6815('0x5b')](config[_0x6815('0x5c')],'server/files/reports',_0x2ee2ed['savename']))){throw new db[(_0x6815('0x5d'))][(_0x6815('0x5e'))](_0x6815('0x5f'));}if(_0xd25db5[_0x6815('0x37')][_0x6815('0x60')]){return _0xaed13c[_0x6815('0x61')](0xc8);}return _0xaed13c[_0x6815('0x56')](path[_0x6815('0x5b')](config[_0x6815('0x5c')],_0x6815('0x62'),_0x2ee2ed[_0x6815('0x58')]),util[_0x6815('0x63')](_0x6815('0x64'),_0x2ee2ed[_0x6815('0x57')]||_0x2ee2ed[_0x6815('0x2e')],_0x2ee2ed[_0x6815('0x59')][_0x6815('0x65')]()));}})[_0x6815('0x4d')](handleError(_0xaed13c,null));}; \ No newline at end of file +var _0x8cad=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','where','filters','filter','merge','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','name','send','index','type','key','model','map','query','keys'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0x8cad,0x1a3));var _0xd8ca=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x8cad[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0xd8ca('0x0'));var rimraf=require(_0xd8ca('0x1'));var zipdir=require(_0xd8ca('0x2'));var jsonpatch=require(_0xd8ca('0x3'));var rp=require(_0xd8ca('0x4'));var moment=require('moment');var BPromise=require(_0xd8ca('0x5'));var Mustache=require(_0xd8ca('0x6'));var util=require('util');var path=require(_0xd8ca('0x7'));var sox=require(_0xd8ca('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8ca('0x9'));var _=require(_0xd8ca('0xa'));var squel=require(_0xd8ca('0xb'));var crypto=require(_0xd8ca('0xc'));var jsforce=require(_0xd8ca('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd8ca('0xe'));var querystring=require(_0xd8ca('0xf'));var Papa=require(_0xd8ca('0x10'));var Redis=require(_0xd8ca('0x11'));var authService=require(_0xd8ca('0x12'));var qs=require(_0xd8ca('0x13'));var as=require(_0xd8ca('0x14'));var hardwareService=require(_0xd8ca('0x15'));var logger=require('../../config/logger')(_0xd8ca('0x16'));var utils=require(_0xd8ca('0x17'));var config=require(_0xd8ca('0x18'));var licenseUtil=require(_0xd8ca('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb3319d,_0x3a5501){_0x3a5501=_0x3a5501||0xcc;return function(_0x21f302){if(_0x21f302){return _0xb3319d['sendStatus'](_0x3a5501);}return _0xb3319d[_0xd8ca('0x1a')](_0x3a5501)['end']();};}function respondWithResult(_0x427978,_0x50425b){_0x50425b=_0x50425b||0xc8;return function(_0x5b88fb){if(_0x5b88fb){return _0x427978[_0xd8ca('0x1a')](_0x50425b)['json'](_0x5b88fb);}};}function respondWithFilteredResult(_0x5f3d8d,_0x474c30){return function(_0x53a54a){if(_0x53a54a){var _0x4b2184=typeof _0x474c30['offset']===_0xd8ca('0x1b')&&typeof _0x474c30['limit']===_0xd8ca('0x1b');var _0x547770=_0x53a54a[_0xd8ca('0x1c')];var _0x362227=_0x4b2184?0x0:_0x474c30['offset'];var _0x45675d=_0x4b2184?_0x53a54a[_0xd8ca('0x1c')]:_0x474c30['offset']+_0x474c30[_0xd8ca('0x1d')];var _0xbbb308;if(_0x45675d>=_0x547770){_0x45675d=_0x547770;_0xbbb308=0xc8;}else{_0xbbb308=0xce;}_0x5f3d8d[_0xd8ca('0x1a')](_0xbbb308);return _0x5f3d8d[_0xd8ca('0x1e')](_0xd8ca('0x1f'),_0x362227+'-'+_0x45675d+'/'+_0x547770)['json'](_0x53a54a);}return null;};}function patchUpdates(_0x31f918){return function(_0x48d2dc){try{jsonpatch[_0xd8ca('0x20')](_0x48d2dc,_0x31f918,!![]);}catch(_0x14680f){return BPromise['reject'](_0x14680f);}return _0x48d2dc[_0xd8ca('0x21')]();};}function saveUpdates(_0x23ecaf,_0x5360a1){return function(_0x1beb0f){if(_0x1beb0f){return _0x1beb0f[_0xd8ca('0x22')](_0x23ecaf)[_0xd8ca('0x23')](function(_0x926fe8){return _0x926fe8;});}return null;};}function removeEntity(_0x46f686,_0xb9c180){return function(_0x1a9d88){if(_0x1a9d88){return _0x1a9d88[_0xd8ca('0x24')]()[_0xd8ca('0x23')](function(){var _0x37644a=_0x1a9d88[_0xd8ca('0x25')]({'plain':!![]});var _0x39f81a=_0xd8ca('0x26');return db[_0xd8ca('0x27')][_0xd8ca('0x24')]({'where':{'type':_0x39f81a,'resourceId':_0x37644a['id']}})[_0xd8ca('0x23')](function(){return _0x1a9d88;});})[_0xd8ca('0x23')](function(){_0x46f686[_0xd8ca('0x1a')](0xcc)[_0xd8ca('0x28')]();});}};}function handleEntityNotFound(_0x351a54,_0x84a570){return function(_0x2c3d51){if(!_0x2c3d51){_0x351a54[_0xd8ca('0x29')](0x194);}return _0x2c3d51;};}function handleError(_0x53a3de,_0x56c861){_0x56c861=_0x56c861||0x1f4;return function(_0x1722b5){logger['error'](_0x1722b5['stack']);if(_0x1722b5[_0xd8ca('0x2a')]){delete _0x1722b5['name'];}_0x53a3de[_0xd8ca('0x1a')](_0x56c861)[_0xd8ca('0x2b')](_0x1722b5);};}exports[_0xd8ca('0x2c')]=function(_0x41fc3a,_0x388899){var _0x550cd4={},_0x5c72ad={},_0x27f595={'count':0x0,'rows':[]};var _0x582754=_['map'](db['AnalyticExtractedReport']['rawAttributes'],function(_0x4d8c1b){return{'name':_0x4d8c1b['fieldName'],'type':_0x4d8c1b[_0xd8ca('0x2d')][_0xd8ca('0x2e')]};});_0x5c72ad[_0xd8ca('0x2f')]=_[_0xd8ca('0x30')](_0x582754,_0xd8ca('0x2a'));_0x5c72ad[_0xd8ca('0x31')]=_[_0xd8ca('0x32')](_0x41fc3a['query']);_0x5c72ad['filters']=_[_0xd8ca('0x33')](_0x5c72ad['model'],_0x5c72ad[_0xd8ca('0x31')]);_0x550cd4[_0xd8ca('0x34')]=_[_0xd8ca('0x33')](_0x5c72ad[_0xd8ca('0x2f')],qs['fields'](_0x41fc3a[_0xd8ca('0x31')][_0xd8ca('0x35')]));_0x550cd4[_0xd8ca('0x34')]=_0x550cd4[_0xd8ca('0x34')][_0xd8ca('0x36')]?_0x550cd4[_0xd8ca('0x34')]:_0x5c72ad[_0xd8ca('0x2f')];if(!_0x41fc3a['query'][_0xd8ca('0x37')](_0xd8ca('0x38'))){_0x550cd4[_0xd8ca('0x1d')]=qs[_0xd8ca('0x1d')](_0x41fc3a['query'][_0xd8ca('0x1d')]);_0x550cd4['offset']=qs[_0xd8ca('0x39')](_0x41fc3a['query'][_0xd8ca('0x39')]);}_0x550cd4['order']=qs['sort'](_0x41fc3a[_0xd8ca('0x31')]['sort']);_0x550cd4[_0xd8ca('0x3a')]=qs[_0xd8ca('0x3b')](_['pick'](_0x41fc3a[_0xd8ca('0x31')],_0x5c72ad[_0xd8ca('0x3b')]),_0x582754);if(_0x41fc3a[_0xd8ca('0x31')][_0xd8ca('0x3c')]){_0x550cd4['where']=_[_0xd8ca('0x3d')](_0x550cd4['where'],{'$or':_[_0xd8ca('0x30')](_0x582754,function(_0x1ef11c){if(_0x1ef11c[_0xd8ca('0x2d')]!=='VIRTUAL'){var _0x5a1202={};_0x5a1202[_0x1ef11c['name']]={'$like':'%'+_0x41fc3a[_0xd8ca('0x31')]['filter']+'%'};return _0x5a1202;}})});}_0x550cd4=_['merge']({},_0x550cd4,_0x41fc3a[_0xd8ca('0x3e')]);var _0x445266={'where':_0x550cd4[_0xd8ca('0x3a')]};return db[_0xd8ca('0x3f')][_0xd8ca('0x1c')](_0x445266)['then'](function(_0x2b2ea2){_0x27f595[_0xd8ca('0x1c')]=_0x2b2ea2;if(_0x41fc3a[_0xd8ca('0x31')][_0xd8ca('0x40')]){_0x550cd4[_0xd8ca('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xd8ca('0x42')](_0x550cd4);})[_0xd8ca('0x23')](function(_0x132cb7){_0x27f595[_0xd8ca('0x43')]=_0x132cb7;return _0x27f595;})[_0xd8ca('0x23')](respondWithFilteredResult(_0x388899,_0x550cd4))[_0xd8ca('0x44')](handleError(_0x388899,null));};exports[_0xd8ca('0x45')]=function(_0x5f104e,_0x5f14a6){var _0xaefade={'raw':!![],'where':{'id':_0x5f104e[_0xd8ca('0x46')]['id']}},_0x245cd8={};_0x245cd8[_0xd8ca('0x2f')]=_[_0xd8ca('0x32')](db[_0xd8ca('0x3f')]['rawAttributes']);_0x245cd8[_0xd8ca('0x31')]=_['keys'](_0x5f104e[_0xd8ca('0x31')]);_0x245cd8[_0xd8ca('0x3b')]=_[_0xd8ca('0x33')](_0x245cd8[_0xd8ca('0x2f')],_0x245cd8[_0xd8ca('0x31')]);_0xaefade[_0xd8ca('0x34')]=_[_0xd8ca('0x33')](_0x245cd8['model'],qs[_0xd8ca('0x35')](_0x5f104e[_0xd8ca('0x31')][_0xd8ca('0x35')]));_0xaefade['attributes']=_0xaefade['attributes']['length']?_0xaefade['attributes']:_0x245cd8[_0xd8ca('0x2f')];if(_0x5f104e['query'][_0xd8ca('0x40')]){_0xaefade[_0xd8ca('0x41')]=[{'all':!![]}];}_0xaefade=_[_0xd8ca('0x3d')]({},_0xaefade,_0x5f104e['options']);return db[_0xd8ca('0x3f')][_0xd8ca('0x47')](_0xaefade)['then'](handleEntityNotFound(_0x5f14a6,null))[_0xd8ca('0x23')](respondWithResult(_0x5f14a6,null))['catch'](handleError(_0x5f14a6,null));};exports[_0xd8ca('0x48')]=function(_0x358da2,_0xc0d52b){return db['AnalyticExtractedReport'][_0xd8ca('0x48')](_0x358da2[_0xd8ca('0x49')],{})[_0xd8ca('0x23')](function(_0x5c6974){var _0x328a34=_0x358da2[_0xd8ca('0x4a')][_0xd8ca('0x25')]({'plain':!![]});if(!_0x328a34)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x328a34[_0xd8ca('0x4b')]===_0xd8ca('0x4a')){var _0x7acba7=_0x5c6974[_0xd8ca('0x25')]({'plain':!![]});var _0x38bbd5='ExtractedReports';return db['UserProfileSection'][_0xd8ca('0x47')]({'where':{'name':_0x38bbd5,'userProfileId':_0x328a34[_0xd8ca('0x4c')]},'raw':!![]})[_0xd8ca('0x23')](function(_0x329a8f){if(_0x329a8f&&_0x329a8f[_0xd8ca('0x4d')]===0x0){return db[_0xd8ca('0x27')]['create']({'name':_0x7acba7[_0xd8ca('0x2a')],'resourceId':_0x7acba7['id'],'type':_0x329a8f[_0xd8ca('0x2a')],'sectionId':_0x329a8f['id']},{})[_0xd8ca('0x23')](function(){return _0x5c6974;});}else{return _0x5c6974;}})[_0xd8ca('0x44')](function(_0x21de3a){logger['error'](_0xd8ca('0x4e'),_0x21de3a);throw _0x21de3a;});}return _0x5c6974;})[_0xd8ca('0x23')](respondWithResult(_0xc0d52b,0xc9))['catch'](handleError(_0xc0d52b,null));};exports[_0xd8ca('0x22')]=function(_0x12ae8f,_0x12a5ac){if(_0x12ae8f['body']['id']){delete _0x12ae8f[_0xd8ca('0x49')]['id'];}return db[_0xd8ca('0x3f')][_0xd8ca('0x47')]({'where':{'id':_0x12ae8f[_0xd8ca('0x46')]['id']}})[_0xd8ca('0x23')](handleEntityNotFound(_0x12a5ac,null))[_0xd8ca('0x23')](saveUpdates(_0x12ae8f['body'],null))[_0xd8ca('0x23')](respondWithResult(_0x12a5ac,null))[_0xd8ca('0x44')](handleError(_0x12a5ac,null));};exports[_0xd8ca('0x24')]=function(_0xd6c777,_0x362bea){return db['AnalyticExtractedReport'][_0xd8ca('0x47')]({'where':{'id':_0xd6c777[_0xd8ca('0x46')]['id']}})['then'](handleEntityNotFound(_0x362bea,null))[_0xd8ca('0x23')](removeEntity(_0x362bea,null))['catch'](handleError(_0x362bea,null));};exports[_0xd8ca('0x4f')]=function(_0x4bb60c,_0x574d69,_0x12d601){return db[_0xd8ca('0x3f')][_0xd8ca('0x47')]({'where':{'id':_0x4bb60c[_0xd8ca('0x46')]['id']},'attributes':[_0xd8ca('0x2a'),'basename',_0xd8ca('0x50'),_0xd8ca('0x51')],'raw':!![]})[_0xd8ca('0x23')](handleEntityNotFound(_0x574d69,null))[_0xd8ca('0x23')](function(_0x1dec80){if(_0x1dec80){if(!fs[_0xd8ca('0x52')](path[_0xd8ca('0x53')](config[_0xd8ca('0x54')],_0xd8ca('0x55'),_0x1dec80[_0xd8ca('0x50')]))){throw new db[(_0xd8ca('0x56'))][(_0xd8ca('0x57'))](_0xd8ca('0x58'));}if(_0x4bb60c[_0xd8ca('0x31')][_0xd8ca('0x59')]){return _0x574d69[_0xd8ca('0x29')](0xc8);}return _0x574d69['download'](path[_0xd8ca('0x53')](config[_0xd8ca('0x54')],_0xd8ca('0x55'),_0x1dec80['savename']),util[_0xd8ca('0x5a')](_0xd8ca('0x5b'),_0x1dec80[_0xd8ca('0x5c')]||_0x1dec80[_0xd8ca('0x2a')],_0x1dec80[_0xd8ca('0x51')][_0xd8ca('0x5d')]()));}})[_0xd8ca('0x44')](handleError(_0x574d69,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 1e37960..21c97bd 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 _0x83c2=['rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','path'];(function(_0x451869,_0x490465){var _0x1263fd=function(_0x4de1db){while(--_0x4de1db){_0x451869['push'](_0x451869['shift']());}};_0x1263fd(++_0x490465);}(_0x83c2,0xcc));var _0x283c=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0x83c2[_0xee3051];return _0x139e81;};'use strict';var _=require(_0x283c('0x0'));var util=require('util');var logger=require(_0x283c('0x1'))(_0x283c('0x2'));var moment=require(_0x283c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x283c('0x4'));var rimraf=require(_0x283c('0x5'));var config=require(_0x283c('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x283c('0x7')]=function(_0x3b5dc2,_0x477d6b){return _0x3b5dc2[_0x283c('0x8')](_0x283c('0x9'),attributes,{'tableName':_0x283c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa910=['request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','bluebird'];(function(_0x2d770f,_0x1dc91a){var _0x39f6cb=function(_0x1c6e83){while(--_0x1c6e83){_0x2d770f['push'](_0x2d770f['shift']());}};_0x39f6cb(++_0x1dc91a);}(_0xa910,0xb0));var _0x0a91=function(_0x637b74,_0x2e00e3){_0x637b74=_0x637b74-0x0;var _0x55b175=_0xa910[_0x637b74];return _0x55b175;};'use strict';var _=require(_0x0a91('0x0'));var util=require(_0x0a91('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a91('0x2'));var BPromise=require(_0x0a91('0x3'));var rp=require(_0x0a91('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a91('0x5'));var config=require(_0x0a91('0x6'));var attributes=require(_0x0a91('0x7'));module[_0x0a91('0x8')]=function(_0x221de8,_0x51dc2c){return _0x221de8[_0x0a91('0x9')](_0x0a91('0xa'),attributes,{'tableName':_0x0a91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 88715bc..c496512 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 _0x6ea0=['debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5ecec2,_0x49264f){var _0x18b681=function(_0x385785){while(--_0x385785){_0x5ecec2['push'](_0x5ecec2['shift']());}};_0x18b681(++_0x49264f);}(_0x6ea0,0x15a));var _0x06ea=function(_0x540324,_0x513340){_0x540324=_0x540324-0x0;var _0x158769=_0x6ea0[_0x540324];return _0x158769;};'use strict';var _=require(_0x06ea('0x0'));var util=require(_0x06ea('0x1'));var moment=require(_0x06ea('0x2'));var BPromise=require(_0x06ea('0x3'));var rs=require(_0x06ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x06ea('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x06ea('0x7'));var client=jayson[_0x06ea('0x8')][_0x06ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d13cb,_0x42c295,_0xaa045a){return new BPromise(function(_0x1ba877,_0x2a2569){return client[_0x06ea('0xa')](_0x2d13cb,_0xaa045a)['then'](function(_0xe1057d){logger[_0x06ea('0xb')](_0x06ea('0xc'),_0x42c295,_0x06ea('0xd'));logger[_0x06ea('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x42c295,_0x06ea('0xd'),JSON[_0x06ea('0xf')](_0xe1057d));if(_0xe1057d[_0x06ea('0x10')]){if(_0xe1057d[_0x06ea('0x10')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x42c295,_0xe1057d[_0x06ea('0x10')][_0x06ea('0x11')]);return _0x2a2569(_0xe1057d[_0x06ea('0x10')][_0x06ea('0x11')]);}logger['error'](_0x06ea('0xc'),_0x42c295,_0xe1057d['error'][_0x06ea('0x11')]);return _0x1ba877(_0xe1057d[_0x06ea('0x10')][_0x06ea('0x11')]);}else{logger[_0x06ea('0xb')](_0x06ea('0xc'),_0x42c295,_0x06ea('0xd'));_0x1ba877(_0xe1057d['result']['message']);}})['catch'](function(_0x384529){logger[_0x06ea('0x10')](_0x06ea('0xc'),_0x42c295,_0x384529);_0x2a2569(_0x384529);});});} \ No newline at end of file +var _0x6f75=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x6f75,0x71));var _0x56f7=function(_0x5506d5,_0xb4387f){_0x5506d5=_0x5506d5-0x0;var _0x317210=_0x6f75[_0x5506d5];return _0x317210;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var moment=require(_0x56f7('0x2'));var BPromise=require(_0x56f7('0x3'));var rs=require(_0x56f7('0x4'));var fs=require('fs');var Redis=require(_0x56f7('0x5'));var db=require(_0x56f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x7'))(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137d14,_0xcc51b1,_0x4b5dcc){return new BPromise(function(_0x184bf7,_0x5155ff){return client['request'](_0x137d14,_0x4b5dcc)[_0x56f7('0xa')](function(_0x1e607c){logger[_0x56f7('0xb')](_0x56f7('0xc'),_0xcc51b1,_0x56f7('0xd'));logger[_0x56f7('0xe')](_0x56f7('0xf'),_0xcc51b1,_0x56f7('0xd'),JSON[_0x56f7('0x10')](_0x1e607c));if(_0x1e607c[_0x56f7('0x11')]){if(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x12')]===0x1f4){logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c['error'][_0x56f7('0x13')]);return _0x5155ff(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);return _0x184bf7(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x56f7('0xd'));_0x184bf7(_0x1e607c[_0x56f7('0x14')][_0x56f7('0x13')]);}})[_0x56f7('0x15')](function(_0x40fb77){logger[_0x56f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x40fb77);_0x5155ff(_0x40fb77);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e8bb8e9..4fc9767 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 _0x4c36=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','put','/:id','update','multer','path','express'];(function(_0x3328b4,_0x403a24){var _0x530143=function(_0x53db2a){while(--_0x53db2a){_0x3328b4['push'](_0x3328b4['shift']());}};_0x530143(++_0x403a24);}(_0x4c36,0x162));var _0x64c3=function(_0x32d11c,_0x4447c8){_0x32d11c=_0x32d11c-0x0;var _0x5f423d=_0x4c36[_0x32d11c];return _0x5f423d;};'use strict';var multer=require(_0x64c3('0x0'));var util=require('util');var path=require(_0x64c3('0x1'));var timeout=require('connect-timeout');var express=require(_0x64c3('0x2'));var router=express[_0x64c3('0x3')]();var fs_extra=require(_0x64c3('0x4'));var auth=require(_0x64c3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x64c3('0x6'));var controller=require(_0x64c3('0x7'));router[_0x64c3('0x8')]('/',auth[_0x64c3('0x9')](),controller[_0x64c3('0xa')]);router[_0x64c3('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x64c3('0xb')]);router['get'](_0x64c3('0xc'),auth[_0x64c3('0x9')](),controller[_0x64c3('0xd')]);router['post']('/',auth[_0x64c3('0x9')](),controller['create']);router[_0x64c3('0xe')](_0x64c3('0xf'),auth[_0x64c3('0x9')](),controller[_0x64c3('0x10')]);router['delete'](_0x64c3('0xf'),auth[_0x64c3('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb9e1=['./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9e1,0x1ef));var _0x1b9e=function(_0x2c50e4,_0x15cd2f){_0x2c50e4=_0x2c50e4-0x0;var _0x474118=_0xb9e1[_0x2c50e4];return _0x474118;};'use strict';var multer=require(_0x1b9e('0x0'));var util=require(_0x1b9e('0x1'));var path=require(_0x1b9e('0x2'));var timeout=require(_0x1b9e('0x3'));var express=require(_0x1b9e('0x4'));var router=express['Router']();var fs_extra=require(_0x1b9e('0x5'));var auth=require(_0x1b9e('0x6'));var interaction=require(_0x1b9e('0x7'));var config=require(_0x1b9e('0x8'));var controller=require(_0x1b9e('0x9'));router[_0x1b9e('0xa')]('/',auth[_0x1b9e('0xb')](),controller[_0x1b9e('0xc')]);router['get'](_0x1b9e('0xd'),auth['isAuthenticated'](),controller[_0x1b9e('0xe')]);router[_0x1b9e('0xa')]('/:id/download',auth[_0x1b9e('0xb')](),controller[_0x1b9e('0xf')]);router[_0x1b9e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1b9e('0x11')](_0x1b9e('0xd'),auth[_0x1b9e('0xb')](),controller['update']);router[_0x1b9e('0x12')](_0x1b9e('0xd'),auth[_0x1b9e('0xb')](),controller[_0x1b9e('0x13')]);module[_0x1b9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index ec76398..a7d43a0 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 _0xc4c3=['BOOLEAN','TEXT','STRING'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xc4c3,0xa9));var _0x3c4c=function(_0x238a2d,_0x26865d){_0x238a2d=_0x238a2d-0x0;var _0x13eb1f=_0xc4c3[_0x238a2d];return _0x13eb1f;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x3c4c('0x0')]},'alias':{'type':Sequelize[_0x3c4c('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x3c4c('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3c4c('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7020=['STRING','BOOLEAN','TEXT'];(function(_0x1868b5,_0x1f4ad9){var _0x4015d4=function(_0x4a0c17){while(--_0x4a0c17){_0x1868b5['push'](_0x1868b5['shift']());}};_0x4015d4(++_0x1f4ad9);}(_0x7020,0x10a));var _0x0702=function(_0x49f03a,_0x45a3fb){_0x49f03a=_0x49f03a-0x0;var _0x284369=_0x7020[_0x49f03a];return _0x284369;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x0702('0x0')]},'alias':{'type':Sequelize[_0x0702('0x1')]},'function':{'type':Sequelize[_0x0702('0x1')]},'format':{'type':Sequelize[_0x0702('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0702('0x1')]},'custom':{'type':Sequelize[_0x0702('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 81c7d63..edb25d4 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 _0x09b1=['destroy','name','index','map','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','AnalyticFieldReport','findAll','rows','catch','params','length','find','create','bulkCreate','body','bulkDestroy','ids','addFields','findOne','transaction','CustomReportId','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','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','offset','limit','undefined','count','set','Content-Range','reject','save','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09b1,0x1e9));var _0x109b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x09b1[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x109b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x109b('0x1'));var rp=require(_0x109b('0x2'));var moment=require('moment');var BPromise=require(_0x109b('0x3'));var Mustache=require(_0x109b('0x4'));var util=require(_0x109b('0x5'));var path=require(_0x109b('0x6'));var sox=require(_0x109b('0x7'));var csv=require(_0x109b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x109b('0x9'));var _=require('lodash');var squel=require(_0x109b('0xa'));var crypto=require('crypto');var jsforce=require(_0x109b('0xb'));var deskjs=require(_0x109b('0xc'));var toCsv=require(_0x109b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x109b('0xd'));var authService=require(_0x109b('0xe'));var qs=require(_0x109b('0xf'));var as=require(_0x109b('0x10'));var hardwareService=require(_0x109b('0x11'));var logger=require('../../config/logger')(_0x109b('0x12'));var utils=require(_0x109b('0x13'));var config=require(_0x109b('0x14'));var licenseUtil=require(_0x109b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a7a4f,_0x4eb4bb){_0x4eb4bb=_0x4eb4bb||0xcc;return function(_0x4b6a9f){if(_0x4b6a9f){return _0x4a7a4f[_0x109b('0x16')](_0x4eb4bb);}return _0x4a7a4f[_0x109b('0x17')](_0x4eb4bb)[_0x109b('0x18')]();};}function respondWithResult(_0x48f4b8,_0x3d5eed){_0x3d5eed=_0x3d5eed||0xc8;return function(_0x567300){if(_0x567300){return _0x48f4b8['status'](_0x3d5eed)[_0x109b('0x19')](_0x567300);}};}function respondWithFilteredResult(_0x83703d,_0x2af21b){return function(_0x35f258){if(_0x35f258){var _0x60806a=typeof _0x2af21b[_0x109b('0x1a')]==='undefined'&&typeof _0x2af21b[_0x109b('0x1b')]===_0x109b('0x1c');var _0x511ca3=_0x35f258[_0x109b('0x1d')];var _0x2f6789=_0x60806a?0x0:_0x2af21b[_0x109b('0x1a')];var _0xceebf6=_0x60806a?_0x35f258[_0x109b('0x1d')]:_0x2af21b[_0x109b('0x1a')]+_0x2af21b[_0x109b('0x1b')];var _0x1dacb6;if(_0xceebf6>=_0x511ca3){_0xceebf6=_0x511ca3;_0x1dacb6=0xc8;}else{_0x1dacb6=0xce;}_0x83703d['status'](_0x1dacb6);return _0x83703d[_0x109b('0x1e')](_0x109b('0x1f'),_0x2f6789+'-'+_0xceebf6+'/'+_0x511ca3)[_0x109b('0x19')](_0x35f258);}return null;};}function patchUpdates(_0xd897ca){return function(_0x3df50b){try{jsonpatch['apply'](_0x3df50b,_0xd897ca,!![]);}catch(_0xacfe8d){return BPromise[_0x109b('0x20')](_0xacfe8d);}return _0x3df50b[_0x109b('0x21')]();};}function saveUpdates(_0x51369f,_0x2fb252){return function(_0x45524f){if(_0x45524f){return _0x45524f[_0x109b('0x22')](_0x51369f)[_0x109b('0x23')](function(_0x44ff2e){return _0x44ff2e;});}return null;};}function removeEntity(_0x58bcfd,_0x374cf8){return function(_0x2e3329){if(_0x2e3329){return _0x2e3329[_0x109b('0x24')]()[_0x109b('0x23')](function(){_0x58bcfd['status'](0xcc)[_0x109b('0x18')]();});}};}function handleEntityNotFound(_0x5e378e,_0x29f679){return function(_0x3be927){if(!_0x3be927){_0x5e378e[_0x109b('0x16')](0x194);}return _0x3be927;};}function handleError(_0x220139,_0x23b904){_0x23b904=_0x23b904||0x1f4;return function(_0x45753a){logger['error'](_0x45753a['stack']);if(_0x45753a[_0x109b('0x25')]){delete _0x45753a[_0x109b('0x25')];}_0x220139[_0x109b('0x17')](_0x23b904)['send'](_0x45753a);};}exports[_0x109b('0x26')]=function(_0x5fff95,_0x236307){var _0x4c6ede={},_0x161e01={},_0x5c6958={'count':0x0,'rows':[]};var _0xeb7483=_[_0x109b('0x27')](db['AnalyticFieldReport']['rawAttributes'],function(_0x56660b){return{'name':_0x56660b['fieldName'],'type':_0x56660b['type'][_0x109b('0x28')]};});_0x161e01[_0x109b('0x29')]=_['map'](_0xeb7483,_0x109b('0x25'));_0x161e01[_0x109b('0x2a')]=_[_0x109b('0x2b')](_0x5fff95[_0x109b('0x2a')]);_0x161e01[_0x109b('0x2c')]=_[_0x109b('0x2d')](_0x161e01['model'],_0x161e01[_0x109b('0x2a')]);_0x4c6ede[_0x109b('0x2e')]=_['intersection'](_0x161e01[_0x109b('0x29')],qs[_0x109b('0x2f')](_0x5fff95[_0x109b('0x2a')]['fields']));_0x4c6ede[_0x109b('0x2e')]=_0x4c6ede[_0x109b('0x2e')]['length']?_0x4c6ede['attributes']:_0x161e01[_0x109b('0x29')];if(!_0x5fff95[_0x109b('0x2a')][_0x109b('0x30')](_0x109b('0x31'))){_0x4c6ede[_0x109b('0x1b')]=qs[_0x109b('0x1b')](_0x5fff95[_0x109b('0x2a')][_0x109b('0x1b')]);_0x4c6ede[_0x109b('0x1a')]=qs[_0x109b('0x1a')](_0x5fff95[_0x109b('0x2a')]['offset']);}_0x4c6ede['order']=qs[_0x109b('0x32')](_0x5fff95[_0x109b('0x2a')][_0x109b('0x32')]);_0x4c6ede[_0x109b('0x33')]=qs['filters'](_[_0x109b('0x34')](_0x5fff95[_0x109b('0x2a')],_0x161e01[_0x109b('0x2c')]),_0xeb7483);if(_0x5fff95['query'][_0x109b('0x35')]){_0x4c6ede[_0x109b('0x33')]=_[_0x109b('0x36')](_0x4c6ede[_0x109b('0x33')],{'$or':_[_0x109b('0x27')](_0xeb7483,function(_0x5fcc6e){if(_0x5fcc6e[_0x109b('0x37')]!==_0x109b('0x38')){var _0x498586={};_0x498586[_0x5fcc6e['name']]={'$like':'%'+_0x5fff95['query'][_0x109b('0x35')]+'%'};return _0x498586;}})});}_0x4c6ede=_['merge']({},_0x4c6ede,_0x5fff95[_0x109b('0x39')]);var _0x15b8b9={'where':_0x4c6ede[_0x109b('0x33')]};return db['AnalyticFieldReport'][_0x109b('0x1d')](_0x15b8b9)[_0x109b('0x23')](function(_0x1839ad){_0x5c6958['count']=_0x1839ad;if(_0x5fff95['query'][_0x109b('0x3a')]){_0x4c6ede['include']=[{'all':!![]}];}return db[_0x109b('0x3b')][_0x109b('0x3c')](_0x4c6ede);})['then'](function(_0xe6277d){_0x5c6958[_0x109b('0x3d')]=_0xe6277d;return _0x5c6958;})['then'](respondWithFilteredResult(_0x236307,_0x4c6ede))[_0x109b('0x3e')](handleError(_0x236307,null));};exports['show']=function(_0x300c68,_0xdc5f70){var _0x5ac676={'raw':![],'where':{'id':_0x300c68[_0x109b('0x3f')]['id']}},_0x28134b={};_0x28134b['model']=_[_0x109b('0x2b')](db[_0x109b('0x3b')]['rawAttributes']);_0x28134b['query']=_[_0x109b('0x2b')](_0x300c68[_0x109b('0x2a')]);_0x28134b[_0x109b('0x2c')]=_[_0x109b('0x2d')](_0x28134b[_0x109b('0x29')],_0x28134b[_0x109b('0x2a')]);_0x5ac676['attributes']=_['intersection'](_0x28134b['model'],qs[_0x109b('0x2f')](_0x300c68[_0x109b('0x2a')][_0x109b('0x2f')]));_0x5ac676['attributes']=_0x5ac676['attributes'][_0x109b('0x40')]?_0x5ac676[_0x109b('0x2e')]:_0x28134b[_0x109b('0x29')];if(_0x300c68['query'][_0x109b('0x3a')]){_0x5ac676['include']=[{'all':!![]}];}_0x5ac676=_[_0x109b('0x36')]({},_0x5ac676,_0x300c68['options']);return db['AnalyticFieldReport'][_0x109b('0x41')](_0x5ac676)[_0x109b('0x23')](handleEntityNotFound(_0xdc5f70,null))['then'](respondWithResult(_0xdc5f70,null))[_0x109b('0x3e')](handleError(_0xdc5f70,null));};exports['create']=function(_0x53efd1,_0x15b550){return db['AnalyticFieldReport'][_0x109b('0x42')](_0x53efd1['body'],{})[_0x109b('0x23')](respondWithResult(_0x15b550,0xc9))[_0x109b('0x3e')](handleError(_0x15b550,null));};exports[_0x109b('0x43')]=function(_0x98040c,_0x39b537){return db[_0x109b('0x3b')][_0x109b('0x43')](_0x98040c[_0x109b('0x44')],{'raw':![],'individualHooks':!![]})[_0x109b('0x23')](respondWithResult(_0x39b537,0xc9))[_0x109b('0x3e')](handleError(_0x39b537,null));};exports[_0x109b('0x22')]=function(_0xc2eb6b,_0x26ca23){if(_0xc2eb6b[_0x109b('0x44')]['id']){delete _0xc2eb6b[_0x109b('0x44')]['id'];}return db[_0x109b('0x3b')][_0x109b('0x41')]({'where':{'id':_0xc2eb6b[_0x109b('0x3f')]['id']}})[_0x109b('0x23')](handleEntityNotFound(_0x26ca23,null))[_0x109b('0x23')](saveUpdates(_0xc2eb6b[_0x109b('0x44')],null))[_0x109b('0x23')](respondWithResult(_0x26ca23,null))['catch'](handleError(_0x26ca23,null));};exports[_0x109b('0x24')]=function(_0x19935b,_0x110288){return db[_0x109b('0x3b')][_0x109b('0x41')]({'where':{'id':_0x19935b['params']['id']}})[_0x109b('0x23')](handleEntityNotFound(_0x110288,null))[_0x109b('0x23')](removeEntity(_0x110288,null))[_0x109b('0x3e')](handleError(_0x110288,null));};exports[_0x109b('0x45')]=function(_0x17fec8,_0x27073){return db[_0x109b('0x3b')][_0x109b('0x24')]({'where':{'id':_0x17fec8[_0x109b('0x2a')][_0x109b('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x109b('0x23')](respondWithResult(_0x27073,0xcc))['catch'](handleError(_0x27073,null));};exports[_0x109b('0x47')]=function(_0x1c049f,_0x265a5e,_0x813c3c){return db['AnalyticCustomReport'][_0x109b('0x48')]({'where':{'id':_0x1c049f[_0x109b('0x3f')]['id']}})[_0x109b('0x23')](handleEntityNotFound(_0x265a5e,null))[_0x109b('0x23')](function(_0x59e438){if(_0x59e438){return db['sequelize'][_0x109b('0x49')](function(_0x531764){return db[_0x109b('0x3b')][_0x109b('0x24')]({'where':{'CustomReportId':_0x1c049f[_0x109b('0x3f')]['id']},'transaction':_0x531764})[_0x109b('0x23')](function(_0x3a3e31){var _0x47b8ab=_[_0x109b('0x27')](_0x1c049f[_0x109b('0x44')],function(_0x556492){delete _0x556492['id'];_0x556492[_0x109b('0x4a')]=_0x1c049f[_0x109b('0x3f')]['id'];return _0x556492;});return db[_0x109b('0x3b')][_0x109b('0x43')](_0x47b8ab,{'transaction':_0x531764});});})['then'](function(){return db[_0x109b('0x3b')][_0x109b('0x3c')]({'where':{'CustomReportId':_0x1c049f[_0x109b('0x3f')]['id']}});});}})[_0x109b('0x23')](respondWithResult(_0x265a5e,null))[_0x109b('0x3e')](handleError(_0x265a5e,null));}; \ No newline at end of file +var _0x3e1f=['create','body','bulkCreate','destroy','bulkDestroy','transaction','CustomReportId','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find'];(function(_0x42ce54,_0xec4416){var _0x588616=function(_0x4a6b6c){while(--_0x4a6b6c){_0x42ce54['push'](_0x42ce54['shift']());}};_0x588616(++_0xec4416);}(_0x3e1f,0xeb));var _0xf3e1=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0x3e1f[_0x4f0c2b];return _0x526436;};'use strict';var emlformat=require(_0xf3e1('0x0'));var rimraf=require(_0xf3e1('0x1'));var zipdir=require(_0xf3e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf3e1('0x3'));var BPromise=require(_0xf3e1('0x4'));var Mustache=require(_0xf3e1('0x5'));var util=require(_0xf3e1('0x6'));var path=require('path');var sox=require(_0xf3e1('0x7'));var csv=require(_0xf3e1('0x8'));var ejs=require(_0xf3e1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3e1('0xa'));var squel=require('squel');var crypto=require(_0xf3e1('0xb'));var jsforce=require(_0xf3e1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf3e1('0x8'));var querystring=require('querystring');var Papa=require(_0xf3e1('0xd'));var Redis=require(_0xf3e1('0xe'));var authService=require(_0xf3e1('0xf'));var qs=require(_0xf3e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3e1('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf3e1('0x12'));var config=require(_0xf3e1('0x13'));var licenseUtil=require(_0xf3e1('0x14'));var db=require(_0xf3e1('0x15'))['db'];function respondWithStatusCode(_0x217fa0,_0x9d9b1){_0x9d9b1=_0x9d9b1||0xcc;return function(_0x257b20){if(_0x257b20){return _0x217fa0[_0xf3e1('0x16')](_0x9d9b1);}return _0x217fa0[_0xf3e1('0x17')](_0x9d9b1)[_0xf3e1('0x18')]();};}function respondWithResult(_0x58414d,_0x1f07f3){_0x1f07f3=_0x1f07f3||0xc8;return function(_0x4663e2){if(_0x4663e2){return _0x58414d['status'](_0x1f07f3)[_0xf3e1('0x19')](_0x4663e2);}};}function respondWithFilteredResult(_0x36438d,_0x45ac17){return function(_0x97e6a2){if(_0x97e6a2){var _0x557488=typeof _0x45ac17[_0xf3e1('0x1a')]===_0xf3e1('0x1b')&&typeof _0x45ac17[_0xf3e1('0x1c')]===_0xf3e1('0x1b');var _0x1f35a5=_0x97e6a2['count'];var _0x1d8df9=_0x557488?0x0:_0x45ac17[_0xf3e1('0x1a')];var _0x1525ea=_0x557488?_0x97e6a2[_0xf3e1('0x1d')]:_0x45ac17[_0xf3e1('0x1a')]+_0x45ac17[_0xf3e1('0x1c')];var _0x7948;if(_0x1525ea>=_0x1f35a5){_0x1525ea=_0x1f35a5;_0x7948=0xc8;}else{_0x7948=0xce;}_0x36438d[_0xf3e1('0x17')](_0x7948);return _0x36438d[_0xf3e1('0x1e')](_0xf3e1('0x1f'),_0x1d8df9+'-'+_0x1525ea+'/'+_0x1f35a5)[_0xf3e1('0x19')](_0x97e6a2);}return null;};}function patchUpdates(_0x526872){return function(_0x510180){try{jsonpatch[_0xf3e1('0x20')](_0x510180,_0x526872,!![]);}catch(_0x53af95){return BPromise[_0xf3e1('0x21')](_0x53af95);}return _0x510180['save']();};}function saveUpdates(_0x1f7318,_0x173508){return function(_0x4994c9){if(_0x4994c9){return _0x4994c9[_0xf3e1('0x22')](_0x1f7318)['then'](function(_0x59278f){return _0x59278f;});}return null;};}function removeEntity(_0x1de7b7,_0x55b7ba){return function(_0x1e02ff){if(_0x1e02ff){return _0x1e02ff['destroy']()[_0xf3e1('0x23')](function(){_0x1de7b7[_0xf3e1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2192cc,_0x64c5a){return function(_0x522ba8){if(!_0x522ba8){_0x2192cc[_0xf3e1('0x16')](0x194);}return _0x522ba8;};}function handleError(_0x46d422,_0x2dc523){_0x2dc523=_0x2dc523||0x1f4;return function(_0x259c82){logger[_0xf3e1('0x24')](_0x259c82[_0xf3e1('0x25')]);if(_0x259c82[_0xf3e1('0x26')]){delete _0x259c82[_0xf3e1('0x26')];}_0x46d422[_0xf3e1('0x17')](_0x2dc523)[_0xf3e1('0x27')](_0x259c82);};}exports[_0xf3e1('0x28')]=function(_0x1f8150,_0x111320){var _0x32d9cf={},_0x103926={},_0x5e6bfa={'count':0x0,'rows':[]};var _0x2ffc4b=_[_0xf3e1('0x29')](db[_0xf3e1('0x2a')][_0xf3e1('0x2b')],function(_0x1eefb8){return{'name':_0x1eefb8[_0xf3e1('0x2c')],'type':_0x1eefb8['type'][_0xf3e1('0x2d')]};});_0x103926[_0xf3e1('0x2e')]=_[_0xf3e1('0x29')](_0x2ffc4b,_0xf3e1('0x26'));_0x103926[_0xf3e1('0x2f')]=_[_0xf3e1('0x30')](_0x1f8150[_0xf3e1('0x2f')]);_0x103926[_0xf3e1('0x31')]=_[_0xf3e1('0x32')](_0x103926[_0xf3e1('0x2e')],_0x103926['query']);_0x32d9cf[_0xf3e1('0x33')]=_[_0xf3e1('0x32')](_0x103926[_0xf3e1('0x2e')],qs[_0xf3e1('0x34')](_0x1f8150['query'][_0xf3e1('0x34')]));_0x32d9cf[_0xf3e1('0x33')]=_0x32d9cf['attributes'][_0xf3e1('0x35')]?_0x32d9cf[_0xf3e1('0x33')]:_0x103926['model'];if(!_0x1f8150[_0xf3e1('0x2f')]['hasOwnProperty'](_0xf3e1('0x36'))){_0x32d9cf[_0xf3e1('0x1c')]=qs['limit'](_0x1f8150['query']['limit']);_0x32d9cf[_0xf3e1('0x1a')]=qs[_0xf3e1('0x1a')](_0x1f8150[_0xf3e1('0x2f')][_0xf3e1('0x1a')]);}_0x32d9cf[_0xf3e1('0x37')]=qs[_0xf3e1('0x38')](_0x1f8150[_0xf3e1('0x2f')][_0xf3e1('0x38')]);_0x32d9cf['where']=qs[_0xf3e1('0x31')](_[_0xf3e1('0x39')](_0x1f8150[_0xf3e1('0x2f')],_0x103926[_0xf3e1('0x31')]),_0x2ffc4b);if(_0x1f8150[_0xf3e1('0x2f')][_0xf3e1('0x3a')]){_0x32d9cf[_0xf3e1('0x3b')]=_[_0xf3e1('0x3c')](_0x32d9cf[_0xf3e1('0x3b')],{'$or':_[_0xf3e1('0x29')](_0x2ffc4b,function(_0x1dd63d){if(_0x1dd63d['type']!==_0xf3e1('0x3d')){var _0x36c6ab={};_0x36c6ab[_0x1dd63d[_0xf3e1('0x26')]]={'$like':'%'+_0x1f8150[_0xf3e1('0x2f')][_0xf3e1('0x3a')]+'%'};return _0x36c6ab;}})});}_0x32d9cf=_[_0xf3e1('0x3c')]({},_0x32d9cf,_0x1f8150[_0xf3e1('0x3e')]);var _0x3e6ecb={'where':_0x32d9cf['where']};return db[_0xf3e1('0x2a')][_0xf3e1('0x1d')](_0x3e6ecb)['then'](function(_0x1c3749){_0x5e6bfa['count']=_0x1c3749;if(_0x1f8150[_0xf3e1('0x2f')][_0xf3e1('0x3f')]){_0x32d9cf['include']=[{'all':!![]}];}return db[_0xf3e1('0x2a')]['findAll'](_0x32d9cf);})[_0xf3e1('0x23')](function(_0x34fcc4){_0x5e6bfa[_0xf3e1('0x40')]=_0x34fcc4;return _0x5e6bfa;})[_0xf3e1('0x23')](respondWithFilteredResult(_0x111320,_0x32d9cf))[_0xf3e1('0x41')](handleError(_0x111320,null));};exports[_0xf3e1('0x42')]=function(_0xc5fc1a,_0x19d611){var _0x4bd7cd={'raw':![],'where':{'id':_0xc5fc1a[_0xf3e1('0x43')]['id']}},_0x408717={};_0x408717[_0xf3e1('0x2e')]=_[_0xf3e1('0x30')](db[_0xf3e1('0x2a')][_0xf3e1('0x2b')]);_0x408717['query']=_['keys'](_0xc5fc1a['query']);_0x408717[_0xf3e1('0x31')]=_['intersection'](_0x408717[_0xf3e1('0x2e')],_0x408717[_0xf3e1('0x2f')]);_0x4bd7cd['attributes']=_[_0xf3e1('0x32')](_0x408717[_0xf3e1('0x2e')],qs['fields'](_0xc5fc1a['query'][_0xf3e1('0x34')]));_0x4bd7cd[_0xf3e1('0x33')]=_0x4bd7cd[_0xf3e1('0x33')][_0xf3e1('0x35')]?_0x4bd7cd['attributes']:_0x408717[_0xf3e1('0x2e')];if(_0xc5fc1a[_0xf3e1('0x2f')][_0xf3e1('0x3f')]){_0x4bd7cd['include']=[{'all':!![]}];}_0x4bd7cd=_['merge']({},_0x4bd7cd,_0xc5fc1a[_0xf3e1('0x3e')]);return db['AnalyticFieldReport'][_0xf3e1('0x44')](_0x4bd7cd)['then'](handleEntityNotFound(_0x19d611,null))[_0xf3e1('0x23')](respondWithResult(_0x19d611,null))['catch'](handleError(_0x19d611,null));};exports[_0xf3e1('0x45')]=function(_0x5bdb07,_0x2b58ad){return db[_0xf3e1('0x2a')][_0xf3e1('0x45')](_0x5bdb07[_0xf3e1('0x46')],{})[_0xf3e1('0x23')](respondWithResult(_0x2b58ad,0xc9))[_0xf3e1('0x41')](handleError(_0x2b58ad,null));};exports[_0xf3e1('0x47')]=function(_0xa4982c,_0x2e4425){return db[_0xf3e1('0x2a')][_0xf3e1('0x47')](_0xa4982c[_0xf3e1('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2e4425,0xc9))['catch'](handleError(_0x2e4425,null));};exports[_0xf3e1('0x22')]=function(_0x237d69,_0x4df6b8){if(_0x237d69[_0xf3e1('0x46')]['id']){delete _0x237d69['body']['id'];}return db[_0xf3e1('0x2a')][_0xf3e1('0x44')]({'where':{'id':_0x237d69[_0xf3e1('0x43')]['id']}})[_0xf3e1('0x23')](handleEntityNotFound(_0x4df6b8,null))[_0xf3e1('0x23')](saveUpdates(_0x237d69[_0xf3e1('0x46')],null))[_0xf3e1('0x23')](respondWithResult(_0x4df6b8,null))[_0xf3e1('0x41')](handleError(_0x4df6b8,null));};exports[_0xf3e1('0x48')]=function(_0x29bcfb,_0x44eedd){return db[_0xf3e1('0x2a')]['find']({'where':{'id':_0x29bcfb[_0xf3e1('0x43')]['id']}})[_0xf3e1('0x23')](handleEntityNotFound(_0x44eedd,null))[_0xf3e1('0x23')](removeEntity(_0x44eedd,null))[_0xf3e1('0x41')](handleError(_0x44eedd,null));};exports[_0xf3e1('0x49')]=function(_0x48f779,_0x126bcd){return db[_0xf3e1('0x2a')][_0xf3e1('0x48')]({'where':{'id':_0x48f779[_0xf3e1('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xf3e1('0x23')](respondWithResult(_0x126bcd,0xcc))[_0xf3e1('0x41')](handleError(_0x126bcd,null));};exports['addFields']=function(_0x4450c9,_0x2e354d,_0x566706){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4450c9[_0xf3e1('0x43')]['id']}})[_0xf3e1('0x23')](handleEntityNotFound(_0x2e354d,null))['then'](function(_0x4946a6){if(_0x4946a6){return db['sequelize'][_0xf3e1('0x4a')](function(_0x3dd643){return db[_0xf3e1('0x2a')][_0xf3e1('0x48')]({'where':{'CustomReportId':_0x4450c9[_0xf3e1('0x43')]['id']},'transaction':_0x3dd643})['then'](function(_0x5915b9){var _0x3dfc5d=_['map'](_0x4450c9[_0xf3e1('0x46')],function(_0x17e660){delete _0x17e660['id'];_0x17e660[_0xf3e1('0x4b')]=_0x4450c9[_0xf3e1('0x43')]['id'];return _0x17e660;});return db[_0xf3e1('0x2a')]['bulkCreate'](_0x3dfc5d,{'transaction':_0x3dd643});});})[_0xf3e1('0x23')](function(){return db[_0xf3e1('0x2a')]['findAll']({'where':{'CustomReportId':_0x4450c9[_0xf3e1('0x43')]['id']}});});}})['then'](respondWithResult(_0x2e354d,null))[_0xf3e1('0x41')](handleError(_0x2e354d,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 956ffdd..6dc9538 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 _0x85cb=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x85cb,0xca));var _0xb85c=function(_0x54f248,_0x4520bd){_0x54f248=_0x54f248-0x0;var _0x21fcf0=_0x85cb[_0x54f248];return _0x21fcf0;};'use strict';var _=require(_0xb85c('0x0'));var util=require(_0xb85c('0x1'));var logger=require(_0xb85c('0x2'))('api');var moment=require(_0xb85c('0x3'));var BPromise=require(_0xb85c('0x4'));var rp=require(_0xb85c('0x5'));var fs=require('fs');var path=require(_0xb85c('0x6'));var rimraf=require(_0xb85c('0x7'));var config=require(_0xb85c('0x8'));var attributes=require(_0xb85c('0x9'));module[_0xb85c('0xa')]=function(_0x36f311,_0x232803){return _0x36f311[_0xb85c('0xb')](_0xb85c('0xc'),attributes,{'tableName':_0xb85c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a56=['AnalyticFieldReport','analytics_report_fields','lodash','util','api','bluebird','path','../../config/environment','./analyticFieldReport.attributes'];(function(_0x442ccd,_0x415d61){var _0x1a2c10=function(_0x4ddd45){while(--_0x4ddd45){_0x442ccd['push'](_0x442ccd['shift']());}};_0x1a2c10(++_0x415d61);}(_0x1a56,0x77));var _0x61a5=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x1a56[_0x309d93];return _0x2dd61d;};'use strict';var _=require(_0x61a5('0x0'));var util=require(_0x61a5('0x1'));var logger=require('../../config/logger')(_0x61a5('0x2'));var moment=require('moment');var BPromise=require(_0x61a5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61a5('0x4'));var rimraf=require('rimraf');var config=require(_0x61a5('0x5'));var attributes=require(_0x61a5('0x6'));module['exports']=function(_0x38720b,_0x2be52f){return _0x38720b['define'](_0x61a5('0x7'),attributes,{'tableName':_0x61a5('0x8'),'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 f111d7b..19542c9 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 _0x5ad0=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x297f4b,_0x317c18){var _0x29a076=function(_0x159d44){while(--_0x159d44){_0x297f4b['push'](_0x297f4b['shift']());}};_0x29a076(++_0x317c18);}(_0x5ad0,0x71));var _0x05ad=function(_0xf73390,_0x14c109){_0xf73390=_0xf73390-0x0;var _0x4b212f=_0x5ad0[_0xf73390];return _0x4b212f;};'use strict';var _=require(_0x05ad('0x0'));var util=require(_0x05ad('0x1'));var moment=require(_0x05ad('0x2'));var BPromise=require(_0x05ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05ad('0x4'));var db=require(_0x05ad('0x5'))['db'];var utils=require(_0x05ad('0x6'));var logger=require(_0x05ad('0x7'))(_0x05ad('0x8'));var config=require(_0x05ad('0x9'));var jayson=require(_0x05ad('0xa'));var client=jayson[_0x05ad('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7bb8,_0x5f5b5c,_0x109410){return new BPromise(function(_0x4572c0,_0x4b68d3){return client[_0x05ad('0xc')](_0x3f7bb8,_0x109410)[_0x05ad('0xd')](function(_0x35a1ec){logger[_0x05ad('0xe')](_0x05ad('0xf'),_0x5f5b5c,_0x05ad('0x10'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5f5b5c,_0x05ad('0x10'),JSON[_0x05ad('0x11')](_0x35a1ec));if(_0x35a1ec[_0x05ad('0x12')]){if(_0x35a1ec['error'][_0x05ad('0x13')]===0x1f4){logger['error'](_0x05ad('0xf'),_0x5f5b5c,_0x35a1ec[_0x05ad('0x12')][_0x05ad('0x14')]);return _0x4b68d3(_0x35a1ec[_0x05ad('0x12')][_0x05ad('0x14')]);}logger[_0x05ad('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5f5b5c,_0x35a1ec[_0x05ad('0x12')]['message']);return _0x4572c0(_0x35a1ec['error'][_0x05ad('0x14')]);}else{logger[_0x05ad('0xe')](_0x05ad('0xf'),_0x5f5b5c,'request\x20sent');_0x4572c0(_0x35a1ec['result'][_0x05ad('0x14')]);}})[_0x05ad('0x15')](function(_0x8ce33e){logger[_0x05ad('0x12')](_0x05ad('0xf'),_0x5f5b5c,_0x8ce33e);_0x4b68d3(_0x8ce33e);});});} \ No newline at end of file +var _0x7409=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticFieldReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring'];(function(_0x31ed4c,_0x2d09bb){var _0x4d0bd0=function(_0x42197b){while(--_0x42197b){_0x31ed4c['push'](_0x31ed4c['shift']());}};_0x4d0bd0(++_0x2d09bb);}(_0x7409,0x12f));var _0x9740=function(_0x39dae4,_0x58a305){_0x39dae4=_0x39dae4-0x0;var _0x39ab08=_0x7409[_0x39dae4];return _0x39ab08;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var moment=require(_0x9740('0x2'));var BPromise=require(_0x9740('0x3'));var rs=require(_0x9740('0x4'));var fs=require('fs');var Redis=require(_0x9740('0x5'));var db=require(_0x9740('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9740('0x7'))(_0x9740('0x8'));var config=require(_0x9740('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9740('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1738f9,_0x1b3ae5,_0x99aac6){return new BPromise(function(_0x578a2a,_0x5157a3){return client[_0x9740('0xb')](_0x1738f9,_0x99aac6)[_0x9740('0xc')](function(_0x5901cf){logger[_0x9740('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1b3ae5,_0x9740('0xe'));logger[_0x9740('0xf')](_0x9740('0x10'),_0x1b3ae5,_0x9740('0xe'),JSON[_0x9740('0x11')](_0x5901cf));if(_0x5901cf['error']){if(_0x5901cf[_0x9740('0x12')]['code']===0x1f4){logger[_0x9740('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1b3ae5,_0x5901cf[_0x9740('0x12')][_0x9740('0x13')]);return _0x5157a3(_0x5901cf['error'][_0x9740('0x13')]);}logger['error'](_0x9740('0x14'),_0x1b3ae5,_0x5901cf['error'][_0x9740('0x13')]);return _0x578a2a(_0x5901cf['error']['message']);}else{logger[_0x9740('0xd')](_0x9740('0x14'),_0x1b3ae5,_0x9740('0xe'));_0x578a2a(_0x5901cf[_0x9740('0x15')]['message']);}})['catch'](function(_0x54735a){logger[_0x9740('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1b3ae5,_0x54735a);_0x5157a3(_0x54735a);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0dd0e20..b15cccb 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(_0x22458a,_0x7966cb){var _0xd42cd5=function(_0x51bda5){while(--_0x51bda5){_0x22458a['push'](_0x22458a['shift']());}};_0xd42cd5(++_0x7966cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x328d85,_0x828433){var _0x2fbd07=function(_0x3d976b){while(--_0x3d976b){_0x328d85['push'](_0x328d85['shift']());}};_0x2fbd07(++_0x828433);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 58ea600..3cc9e3f 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 _0x85b5=['exports','name','TEXT','sequelize'];(function(_0x420a5b,_0x26c365){var _0x1a4f26=function(_0x54754e){while(--_0x54754e){_0x420a5b['push'](_0x420a5b['shift']());}};_0x1a4f26(++_0x26c365);}(_0x85b5,0x7f));var _0x585b=function(_0x233646,_0x414aa7){_0x233646=_0x233646-0x0;var _0x2a4117=_0x85b5[_0x233646];return _0x2a4117;};'use strict';var Sequelize=require(_0x585b('0x0'));module[_0x585b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x585b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x585b('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x26f9=['exports','name','STRING','sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x26f9,0x16f));var _0x926f=function(_0x2812c2,_0x2b382d){_0x2812c2=_0x2812c2-0x0;var _0x218ac9=_0x26f9[_0x2812c2];return _0x218ac9;};'use strict';var Sequelize=require(_0x926f('0x0'));module[_0x926f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x926f('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x926f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 02fd518..9621d9a 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x3cd2a1,_0x908901){var _0x4ad17e=function(_0x14c7f3){while(--_0x14c7f3){_0x3cd2a1['push'](_0x3cd2a1['shift']());}};_0x4ad17e(++_0x908901);}(_0xe14b,0x93));var _0xbe14=function(_0x1054c0,_0x35b4d2){_0x1054c0=_0x1054c0-0x0;var _0x540e33=_0xe14b[_0x1054c0];return _0x540e33;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file +var _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x11b253,_0x5b685f){var _0x3e7bdc=function(_0x523975){while(--_0x523975){_0x11b253['push'](_0x11b253['shift']());}};_0x3e7bdc(++_0x5b685f);}(_0x46ed,0x168));var _0xd46e=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x46ed[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index f3d5821..c92682f 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 _0xf483=['api','moment','bluebird','request-promise','path','rimraf','AnalyticMetric','analytics_metrics','util'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xf483,0xf2));var _0x3f48=function(_0x396fc5,_0x329084){_0x396fc5=_0x396fc5-0x0;var _0x2531fb=_0xf483[_0x396fc5];return _0x2531fb;};'use strict';var _=require('lodash');var util=require(_0x3f48('0x0'));var logger=require('../../config/logger')(_0x3f48('0x1'));var moment=require(_0x3f48('0x2'));var BPromise=require(_0x3f48('0x3'));var rp=require(_0x3f48('0x4'));var fs=require('fs');var path=require(_0x3f48('0x5'));var rimraf=require(_0x3f48('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x1a3447,_0x16905e){return _0x1a3447['define'](_0x3f48('0x7'),attributes,{'tableName':_0x3f48('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b0=['../../config/logger','api','moment','bluebird','request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x2ecfd9,_0x265b8d){var _0x2e53a0=function(_0x358997){while(--_0x358997){_0x2ecfd9['push'](_0x2ecfd9['shift']());}};_0x2e53a0(++_0x265b8d);}(_0xc9b0,0x143));var _0x0c9b=function(_0x378d98,_0x1bfdc2){_0x378d98=_0x378d98-0x0;var _0x1ed4f5=_0xc9b0[_0x378d98];return _0x1ed4f5;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var logger=require(_0x0c9b('0x2'))(_0x0c9b('0x3'));var moment=require(_0x0c9b('0x4'));var BPromise=require(_0x0c9b('0x5'));var rp=require(_0x0c9b('0x6'));var fs=require('fs');var path=require(_0x0c9b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0c9b('0x8'));module[_0x0c9b('0x9')]=function(_0x192da5,_0x368518){return _0x192da5[_0x0c9b('0xa')](_0x0c9b('0xb'),attributes,{'tableName':_0x0c9b('0xc'),'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 ed6d59a..b57e52f 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 _0xa33d=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa33d,0x1f0));var _0xda33=function(_0x2aa327,_0x409201){_0x2aa327=_0x2aa327-0x0;var _0x5dd6c1=_0xa33d[_0x2aa327];return _0x5dd6c1;};'use strict';var _=require('lodash');var util=require(_0xda33('0x0'));var moment=require(_0xda33('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda33('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xda33('0x3'));var logger=require(_0xda33('0x4'))(_0xda33('0x5'));var config=require(_0xda33('0x6'));var jayson=require(_0xda33('0x7'));var client=jayson[_0xda33('0x8')][_0xda33('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x891c92,_0x4ef544,_0x1c08a9){return new BPromise(function(_0x46e5c0,_0xb4be43){return client['request'](_0x891c92,_0x1c08a9)[_0xda33('0xa')](function(_0x289fc4){logger[_0xda33('0xb')](_0xda33('0xc'),_0x4ef544,_0xda33('0xd'));logger[_0xda33('0xe')](_0xda33('0xf'),_0x4ef544,_0xda33('0xd'),JSON[_0xda33('0x10')](_0x289fc4));if(_0x289fc4[_0xda33('0x11')]){if(_0x289fc4['error'][_0xda33('0x12')]===0x1f4){logger[_0xda33('0x11')](_0xda33('0xc'),_0x4ef544,_0x289fc4['error'][_0xda33('0x13')]);return _0xb4be43(_0x289fc4[_0xda33('0x11')][_0xda33('0x13')]);}logger[_0xda33('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x4ef544,_0x289fc4[_0xda33('0x11')][_0xda33('0x13')]);return _0x46e5c0(_0x289fc4[_0xda33('0x11')][_0xda33('0x13')]);}else{logger[_0xda33('0xb')](_0xda33('0xc'),_0x4ef544,_0xda33('0xd'));_0x46e5c0(_0x289fc4[_0xda33('0x14')][_0xda33('0x13')]);}})[_0xda33('0x15')](function(_0x5903d7){logger[_0xda33('0x11')](_0xda33('0xc'),_0x4ef544,_0x5903d7);_0xb4be43(_0x5903d7);});});} \ No newline at end of file +var _0x8359=['http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8359,0x1ae));var _0x9835=function(_0x45806b,_0x53eeae){_0x45806b=_0x45806b-0x0;var _0x3e228e=_0x8359[_0x45806b];return _0x3e228e;};'use strict';var _=require(_0x9835('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9835('0x1'));var rs=require(_0x9835('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9835('0x3'))(_0x9835('0x4'));var config=require(_0x9835('0x5'));var jayson=require(_0x9835('0x6'));var client=jayson['client'][_0x9835('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e7e06,_0x2fd687,_0xb8f73){return new BPromise(function(_0xbe185e,_0x4111fd){return client[_0x9835('0x8')](_0x5e7e06,_0xb8f73)[_0x9835('0x9')](function(_0x472d17){logger[_0x9835('0xa')](_0x9835('0xb'),_0x2fd687,_0x9835('0xc'));logger[_0x9835('0xd')](_0x9835('0xe'),_0x2fd687,'request\x20sent',JSON['stringify'](_0x472d17));if(_0x472d17['error']){if(_0x472d17['error'][_0x9835('0xf')]===0x1f4){logger[_0x9835('0x10')](_0x9835('0xb'),_0x2fd687,_0x472d17[_0x9835('0x10')][_0x9835('0x11')]);return _0x4111fd(_0x472d17[_0x9835('0x10')][_0x9835('0x11')]);}logger[_0x9835('0x10')](_0x9835('0xb'),_0x2fd687,_0x472d17[_0x9835('0x10')][_0x9835('0x11')]);return _0xbe185e(_0x472d17['error'][_0x9835('0x11')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x2fd687,'request\x20sent');_0xbe185e(_0x472d17['result'][_0x9835('0x11')]);}})[_0x9835('0x12')](function(_0x1875b3){logger[_0x9835('0x10')](_0x9835('0xb'),_0x2fd687,_0x1875b3);_0x4111fd(_0x1875b3);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a07a89a..dc0e964 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 _0x861a=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x200af4,_0x8416e8){var _0x3831b6=function(_0xf139c0){while(--_0xf139c0){_0x200af4['push'](_0x200af4['shift']());}};_0x3831b6(++_0x8416e8);}(_0x861a,0x194));var _0xa861=function(_0x2c55a5,_0x5072b0){_0x2c55a5=_0x2c55a5-0x0;var _0x4f46cb=_0x861a[_0x2c55a5];return _0x4f46cb;};'use strict';var multer=require(_0xa861('0x0'));var util=require('util');var path=require(_0xa861('0x1'));var timeout=require(_0xa861('0x2'));var express=require(_0xa861('0x3'));var router=express[_0xa861('0x4')]();var fs_extra=require(_0xa861('0x5'));var auth=require(_0xa861('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa861('0x7'));var controller=require(_0xa861('0x8'));router[_0xa861('0x9')]('/',auth[_0xa861('0xa')](),controller[_0xa861('0xb')]);router['get'](_0xa861('0xc'),auth[_0xa861('0xa')](),controller[_0xa861('0xd')]);router[_0xa861('0xe')]('/',auth[_0xa861('0xa')](),controller[_0xa861('0xf')]);router[_0xa861('0x10')](_0xa861('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa861('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa861('0x12')]);module[_0xa861('0x13')]=router; \ No newline at end of file +var _0x81d4=['show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x81d4,0x197));var _0x481d=function(_0x2afde6,_0x501cb9){_0x2afde6=_0x2afde6-0x0;var _0x2c4284=_0x81d4[_0x2afde6];return _0x2c4284;};'use strict';var multer=require('multer');var util=require(_0x481d('0x0'));var path=require(_0x481d('0x1'));var timeout=require('connect-timeout');var express=require(_0x481d('0x2'));var router=express[_0x481d('0x3')]();var fs_extra=require(_0x481d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x481d('0x5'));var controller=require(_0x481d('0x6'));router[_0x481d('0x7')]('/',auth['isAuthenticated'](),controller[_0x481d('0x8')]);router[_0x481d('0x7')](_0x481d('0x9'),auth[_0x481d('0xa')](),controller[_0x481d('0xb')]);router[_0x481d('0xc')]('/',auth['isAuthenticated'](),controller[_0x481d('0xd')]);router[_0x481d('0xe')](_0x481d('0x9'),auth['isAuthenticated'](),controller[_0x481d('0xf')]);router[_0x481d('0x10')]('/:id',auth[_0x481d('0xa')](),controller[_0x481d('0x11')]);module[_0x481d('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ae82cd0..3cbd381 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 _0xaf99=['exports','TEXT'];(function(_0x367df9,_0x2b211d){var _0x30b7a9=function(_0x1c3f0b){while(--_0x1c3f0b){_0x367df9['push'](_0x367df9['shift']());}};_0x30b7a9(++_0x2b211d);}(_0xaf99,0x172));var _0x9af9=function(_0x3b32c3,_0x50fe09){_0x3b32c3=_0x3b32c3-0x0;var _0x54c9a0=_0xaf99[_0x3b32c3];return _0x54c9a0;};'use strict';var Sequelize=require('sequelize');module[_0x9af9('0x0')]={'tree':{'type':Sequelize[_0x9af9('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xef7d=['exports'];(function(_0x5ea5d4,_0x5c54da){var _0x289a05=function(_0x250c5d){while(--_0x250c5d){_0x5ea5d4['push'](_0x5ea5d4['shift']());}};_0x289a05(++_0x5c54da);}(_0xef7d,0x1b3));var _0xdef7=function(_0x1e5f91,_0xa38bd9){_0x1e5f91=_0x1e5f91-0x0;var _0x5bb46b=_0xef7d[_0x1e5f91];return _0x5bb46b;};'use strict';var Sequelize=require('sequelize');module[_0xdef7('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 7da865b..e21e54d 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 _0x7a4a=['stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','body','find','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','reject','save','update','then','destroy'];(function(_0x5ce268,_0x1835b6){var _0x28c96a=function(_0x18c1d6){while(--_0x18c1d6){_0x5ce268['push'](_0x5ce268['shift']());}};_0x28c96a(++_0x1835b6);}(_0x7a4a,0xb3));var _0xa7a4=function(_0x147c96,_0x309657){_0x147c96=_0x147c96-0x0;var _0x4ec711=_0x7a4a[_0x147c96];return _0x4ec711;};'use strict';var emlformat=require(_0xa7a4('0x0'));var rimraf=require(_0xa7a4('0x1'));var zipdir=require(_0xa7a4('0x2'));var jsonpatch=require(_0xa7a4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa7a4('0x4'));var Mustache=require(_0xa7a4('0x5'));var util=require(_0xa7a4('0x6'));var path=require(_0xa7a4('0x7'));var sox=require(_0xa7a4('0x8'));var csv=require(_0xa7a4('0x9'));var ejs=require(_0xa7a4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7a4('0xb'));var squel=require(_0xa7a4('0xc'));var crypto=require(_0xa7a4('0xd'));var jsforce=require(_0xa7a4('0xe'));var deskjs=require(_0xa7a4('0xf'));var toCsv=require(_0xa7a4('0x9'));var querystring=require(_0xa7a4('0x10'));var Papa=require(_0xa7a4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa7a4('0x12'));var as=require(_0xa7a4('0x13'));var hardwareService=require(_0xa7a4('0x14'));var logger=require('../../config/logger')(_0xa7a4('0x15'));var utils=require(_0xa7a4('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa7a4('0x17'))['db'];function respondWithStatusCode(_0x4f384d,_0x4107b5){_0x4107b5=_0x4107b5||0xcc;return function(_0x58275e){if(_0x58275e){return _0x4f384d['sendStatus'](_0x4107b5);}return _0x4f384d['status'](_0x4107b5)[_0xa7a4('0x18')]();};}function respondWithResult(_0x52b5cc,_0x272dc7){_0x272dc7=_0x272dc7||0xc8;return function(_0x49e021){if(_0x49e021){return _0x52b5cc['status'](_0x272dc7)[_0xa7a4('0x19')](_0x49e021);}};}function respondWithFilteredResult(_0x1e39ea,_0xf62f82){return function(_0x150a73){if(_0x150a73){var _0x5573f3=typeof _0xf62f82[_0xa7a4('0x1a')]===_0xa7a4('0x1b')&&typeof _0xf62f82[_0xa7a4('0x1c')]==='undefined';var _0x3f07b6=_0x150a73[_0xa7a4('0x1d')];var _0x8810c5=_0x5573f3?0x0:_0xf62f82[_0xa7a4('0x1a')];var _0x17208d=_0x5573f3?_0x150a73[_0xa7a4('0x1d')]:_0xf62f82['offset']+_0xf62f82[_0xa7a4('0x1c')];var _0x367d06;if(_0x17208d>=_0x3f07b6){_0x17208d=_0x3f07b6;_0x367d06=0xc8;}else{_0x367d06=0xce;}_0x1e39ea[_0xa7a4('0x1e')](_0x367d06);return _0x1e39ea['set'](_0xa7a4('0x1f'),_0x8810c5+'-'+_0x17208d+'/'+_0x3f07b6)[_0xa7a4('0x19')](_0x150a73);}return null;};}function patchUpdates(_0x349c35){return function(_0x46ea59){try{jsonpatch['apply'](_0x46ea59,_0x349c35,!![]);}catch(_0x50435d){return BPromise[_0xa7a4('0x20')](_0x50435d);}return _0x46ea59[_0xa7a4('0x21')]();};}function saveUpdates(_0x231a78,_0x55e44e){return function(_0xff7689){if(_0xff7689){return _0xff7689[_0xa7a4('0x22')](_0x231a78)[_0xa7a4('0x23')](function(_0x291628){return _0x291628;});}return null;};}function removeEntity(_0xe3340a,_0x1a5456){return function(_0x5a08db){if(_0x5a08db){return _0x5a08db[_0xa7a4('0x24')]()[_0xa7a4('0x23')](function(){_0xe3340a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27fce5,_0x22f69c){return function(_0xd598af){if(!_0xd598af){_0x27fce5['sendStatus'](0x194);}return _0xd598af;};}function handleError(_0x55c58a,_0xe8f43f){_0xe8f43f=_0xe8f43f||0x1f4;return function(_0x1d287a){logger['error'](_0x1d287a[_0xa7a4('0x25')]);if(_0x1d287a[_0xa7a4('0x26')]){delete _0x1d287a[_0xa7a4('0x26')];}_0x55c58a[_0xa7a4('0x1e')](_0xe8f43f)[_0xa7a4('0x27')](_0x1d287a);};}exports[_0xa7a4('0x28')]=function(_0x1a85e4,_0x560bd7){var _0xffc256={},_0x234322={},_0x543499={'count':0x0,'rows':[]};var _0x148e3c=_[_0xa7a4('0x29')](db[_0xa7a4('0x2a')][_0xa7a4('0x2b')],function(_0x325ead){return{'name':_0x325ead[_0xa7a4('0x2c')],'type':_0x325ead[_0xa7a4('0x2d')][_0xa7a4('0x2e')]};});_0x234322[_0xa7a4('0x2f')]=_[_0xa7a4('0x29')](_0x148e3c,_0xa7a4('0x26'));_0x234322[_0xa7a4('0x30')]=_[_0xa7a4('0x31')](_0x1a85e4[_0xa7a4('0x30')]);_0x234322['filters']=_['intersection'](_0x234322[_0xa7a4('0x2f')],_0x234322['query']);_0xffc256[_0xa7a4('0x32')]=_[_0xa7a4('0x33')](_0x234322[_0xa7a4('0x2f')],qs[_0xa7a4('0x34')](_0x1a85e4[_0xa7a4('0x30')][_0xa7a4('0x34')]));_0xffc256[_0xa7a4('0x32')]=_0xffc256[_0xa7a4('0x32')][_0xa7a4('0x35')]?_0xffc256[_0xa7a4('0x32')]:_0x234322[_0xa7a4('0x2f')];if(!_0x1a85e4[_0xa7a4('0x30')][_0xa7a4('0x36')]('nolimit')){_0xffc256['limit']=qs[_0xa7a4('0x1c')](_0x1a85e4[_0xa7a4('0x30')][_0xa7a4('0x1c')]);_0xffc256[_0xa7a4('0x1a')]=qs[_0xa7a4('0x1a')](_0x1a85e4[_0xa7a4('0x30')]['offset']);}_0xffc256[_0xa7a4('0x37')]=qs['sort'](_0x1a85e4[_0xa7a4('0x30')][_0xa7a4('0x38')]);_0xffc256[_0xa7a4('0x39')]=qs[_0xa7a4('0x3a')](_[_0xa7a4('0x3b')](_0x1a85e4[_0xa7a4('0x30')],_0x234322[_0xa7a4('0x3a')]),_0x148e3c);if(_0x1a85e4[_0xa7a4('0x30')][_0xa7a4('0x3c')]){_0xffc256[_0xa7a4('0x39')]=_[_0xa7a4('0x3d')](_0xffc256['where'],{'$or':_['map'](_0x148e3c,function(_0xd37a74){if(_0xd37a74[_0xa7a4('0x2d')]!==_0xa7a4('0x3e')){var _0x19444b={};_0x19444b[_0xd37a74[_0xa7a4('0x26')]]={'$like':'%'+_0x1a85e4[_0xa7a4('0x30')][_0xa7a4('0x3c')]+'%'};return _0x19444b;}})});}_0xffc256=_['merge']({},_0xffc256,_0x1a85e4[_0xa7a4('0x3f')]);var _0x39a1d0={'where':_0xffc256[_0xa7a4('0x39')]};return db[_0xa7a4('0x2a')][_0xa7a4('0x1d')](_0x39a1d0)['then'](function(_0x5e4d13){_0x543499[_0xa7a4('0x1d')]=_0x5e4d13;if(_0x1a85e4[_0xa7a4('0x30')][_0xa7a4('0x40')]){_0xffc256[_0xa7a4('0x41')]=[{'all':!![]}];}return db[_0xa7a4('0x2a')]['findAll'](_0xffc256);})['then'](function(_0x1ea633){_0x543499[_0xa7a4('0x42')]=_0x1ea633;return _0x543499;})[_0xa7a4('0x23')](respondWithFilteredResult(_0x560bd7,_0xffc256))[_0xa7a4('0x43')](handleError(_0x560bd7,null));};exports[_0xa7a4('0x44')]=function(_0x271730,_0xf1fea5){var _0xe7c7ae={'raw':!![],'where':{'id':_0x271730[_0xa7a4('0x45')]['id']}},_0x2c74e1={};_0x2c74e1[_0xa7a4('0x2f')]=_['keys'](db[_0xa7a4('0x2a')][_0xa7a4('0x2b')]);_0x2c74e1[_0xa7a4('0x30')]=_[_0xa7a4('0x31')](_0x271730[_0xa7a4('0x30')]);_0x2c74e1[_0xa7a4('0x3a')]=_['intersection'](_0x2c74e1[_0xa7a4('0x2f')],_0x2c74e1[_0xa7a4('0x30')]);_0xe7c7ae[_0xa7a4('0x32')]=_[_0xa7a4('0x33')](_0x2c74e1[_0xa7a4('0x2f')],qs[_0xa7a4('0x34')](_0x271730[_0xa7a4('0x30')][_0xa7a4('0x34')]));_0xe7c7ae[_0xa7a4('0x32')]=_0xe7c7ae[_0xa7a4('0x32')][_0xa7a4('0x35')]?_0xe7c7ae[_0xa7a4('0x32')]:_0x2c74e1['model'];if(_0x271730[_0xa7a4('0x30')][_0xa7a4('0x40')]){_0xe7c7ae[_0xa7a4('0x41')]=[{'all':!![]}];}_0xe7c7ae=_[_0xa7a4('0x3d')]({},_0xe7c7ae,_0x271730[_0xa7a4('0x3f')]);return db['AnalyticTreeReport']['find'](_0xe7c7ae)[_0xa7a4('0x23')](handleEntityNotFound(_0xf1fea5,null))[_0xa7a4('0x23')](respondWithResult(_0xf1fea5,null))[_0xa7a4('0x43')](handleError(_0xf1fea5,null));};exports['create']=function(_0x158607,_0x2eb93a){return db[_0xa7a4('0x2a')]['create'](_0x158607[_0xa7a4('0x46')],{})[_0xa7a4('0x23')](respondWithResult(_0x2eb93a,0xc9))['catch'](handleError(_0x2eb93a,null));};exports[_0xa7a4('0x22')]=function(_0x140015,_0x566f46){if(_0x140015[_0xa7a4('0x46')]['id']){delete _0x140015[_0xa7a4('0x46')]['id'];}return db[_0xa7a4('0x2a')][_0xa7a4('0x47')]({'where':{'id':_0x140015[_0xa7a4('0x45')]['id']}})[_0xa7a4('0x23')](handleEntityNotFound(_0x566f46,null))['then'](saveUpdates(_0x140015[_0xa7a4('0x46')],null))[_0xa7a4('0x23')](respondWithResult(_0x566f46,null))[_0xa7a4('0x43')](handleError(_0x566f46,null));};exports[_0xa7a4('0x24')]=function(_0xe35bdb,_0xb2c4fd){return db[_0xa7a4('0x2a')][_0xa7a4('0x47')]({'where':{'id':_0xe35bdb[_0xa7a4('0x45')]['id']}})[_0xa7a4('0x23')](handleEntityNotFound(_0xb2c4fd,null))[_0xa7a4('0x23')](removeEntity(_0xb2c4fd,null))[_0xa7a4('0x43')](handleError(_0xb2c4fd,null));}; \ No newline at end of file +var _0xee59=['create','body','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','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/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x2aac4b,_0x2629bd){var _0xf5fba8=function(_0x390b42){while(--_0x390b42){_0x2aac4b['push'](_0x2aac4b['shift']());}};_0xf5fba8(++_0x2629bd);}(_0xee59,0x1f3));var _0x9ee5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xee59[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ee5('0x0'));var zipdir=require(_0x9ee5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ee5('0x2'));var moment=require('moment');var BPromise=require(_0x9ee5('0x3'));var Mustache=require(_0x9ee5('0x4'));var util=require(_0x9ee5('0x5'));var path=require('path');var sox=require(_0x9ee5('0x6'));var csv=require('to-csv');var ejs=require(_0x9ee5('0x7'));var fs=require('fs');var fs_extra=require(_0x9ee5('0x8'));var _=require(_0x9ee5('0x9'));var squel=require(_0x9ee5('0xa'));var crypto=require(_0x9ee5('0xb'));var jsforce=require(_0x9ee5('0xc'));var deskjs=require(_0x9ee5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9ee5('0xe'));var Papa=require(_0x9ee5('0xf'));var Redis=require(_0x9ee5('0x10'));var authService=require(_0x9ee5('0x11'));var qs=require(_0x9ee5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ee5('0x13'));var logger=require(_0x9ee5('0x14'))('api');var utils=require(_0x9ee5('0x15'));var config=require(_0x9ee5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9ee5('0x17'))['db'];function respondWithStatusCode(_0x5b8390,_0x2ddb25){_0x2ddb25=_0x2ddb25||0xcc;return function(_0x2e9a73){if(_0x2e9a73){return _0x5b8390[_0x9ee5('0x18')](_0x2ddb25);}return _0x5b8390[_0x9ee5('0x19')](_0x2ddb25)['end']();};}function respondWithResult(_0x3411b5,_0x305fa4){_0x305fa4=_0x305fa4||0xc8;return function(_0x26f230){if(_0x26f230){return _0x3411b5[_0x9ee5('0x19')](_0x305fa4)[_0x9ee5('0x1a')](_0x26f230);}};}function respondWithFilteredResult(_0x32ae2e,_0x5231c6){return function(_0x3ad260){if(_0x3ad260){var _0x33bdc1=typeof _0x5231c6[_0x9ee5('0x1b')]===_0x9ee5('0x1c')&&typeof _0x5231c6[_0x9ee5('0x1d')]==='undefined';var _0x228373=_0x3ad260[_0x9ee5('0x1e')];var _0x37ed12=_0x33bdc1?0x0:_0x5231c6[_0x9ee5('0x1b')];var _0x342487=_0x33bdc1?_0x3ad260[_0x9ee5('0x1e')]:_0x5231c6[_0x9ee5('0x1b')]+_0x5231c6['limit'];var _0x36c486;if(_0x342487>=_0x228373){_0x342487=_0x228373;_0x36c486=0xc8;}else{_0x36c486=0xce;}_0x32ae2e['status'](_0x36c486);return _0x32ae2e[_0x9ee5('0x1f')](_0x9ee5('0x20'),_0x37ed12+'-'+_0x342487+'/'+_0x228373)[_0x9ee5('0x1a')](_0x3ad260);}return null;};}function patchUpdates(_0x32c155){return function(_0x20c159){try{jsonpatch[_0x9ee5('0x21')](_0x20c159,_0x32c155,!![]);}catch(_0x5a0652){return BPromise['reject'](_0x5a0652);}return _0x20c159[_0x9ee5('0x22')]();};}function saveUpdates(_0x5c200b,_0x1b1f8d){return function(_0x5243ed){if(_0x5243ed){return _0x5243ed[_0x9ee5('0x23')](_0x5c200b)[_0x9ee5('0x24')](function(_0x482236){return _0x482236;});}return null;};}function removeEntity(_0x1b7bba,_0x548ca4){return function(_0x33ab83){if(_0x33ab83){return _0x33ab83[_0x9ee5('0x25')]()['then'](function(){_0x1b7bba[_0x9ee5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d639e,_0x3715ba){return function(_0x6d36b2){if(!_0x6d36b2){_0x1d639e['sendStatus'](0x194);}return _0x6d36b2;};}function handleError(_0x1a7456,_0x5f5bbd){_0x5f5bbd=_0x5f5bbd||0x1f4;return function(_0x40e100){logger[_0x9ee5('0x26')](_0x40e100[_0x9ee5('0x27')]);if(_0x40e100[_0x9ee5('0x28')]){delete _0x40e100[_0x9ee5('0x28')];}_0x1a7456[_0x9ee5('0x19')](_0x5f5bbd)[_0x9ee5('0x29')](_0x40e100);};}exports[_0x9ee5('0x2a')]=function(_0x3b32f5,_0x1a2dbf){var _0x157e87={},_0x36e6f3={},_0x3f39b6={'count':0x0,'rows':[]};var _0x3a6739=_[_0x9ee5('0x2b')](db[_0x9ee5('0x2c')]['rawAttributes'],function(_0x149880){return{'name':_0x149880[_0x9ee5('0x2d')],'type':_0x149880[_0x9ee5('0x2e')][_0x9ee5('0x2f')]};});_0x36e6f3[_0x9ee5('0x30')]=_[_0x9ee5('0x2b')](_0x3a6739,_0x9ee5('0x28'));_0x36e6f3[_0x9ee5('0x31')]=_['keys'](_0x3b32f5[_0x9ee5('0x31')]);_0x36e6f3['filters']=_[_0x9ee5('0x32')](_0x36e6f3[_0x9ee5('0x30')],_0x36e6f3[_0x9ee5('0x31')]);_0x157e87[_0x9ee5('0x33')]=_[_0x9ee5('0x32')](_0x36e6f3[_0x9ee5('0x30')],qs[_0x9ee5('0x34')](_0x3b32f5[_0x9ee5('0x31')][_0x9ee5('0x34')]));_0x157e87[_0x9ee5('0x33')]=_0x157e87['attributes']['length']?_0x157e87[_0x9ee5('0x33')]:_0x36e6f3[_0x9ee5('0x30')];if(!_0x3b32f5['query']['hasOwnProperty'](_0x9ee5('0x35'))){_0x157e87[_0x9ee5('0x1d')]=qs[_0x9ee5('0x1d')](_0x3b32f5[_0x9ee5('0x31')][_0x9ee5('0x1d')]);_0x157e87[_0x9ee5('0x1b')]=qs[_0x9ee5('0x1b')](_0x3b32f5['query'][_0x9ee5('0x1b')]);}_0x157e87[_0x9ee5('0x36')]=qs['sort'](_0x3b32f5[_0x9ee5('0x31')]['sort']);_0x157e87[_0x9ee5('0x37')]=qs[_0x9ee5('0x38')](_['pick'](_0x3b32f5[_0x9ee5('0x31')],_0x36e6f3[_0x9ee5('0x38')]),_0x3a6739);if(_0x3b32f5[_0x9ee5('0x31')][_0x9ee5('0x39')]){_0x157e87['where']=_[_0x9ee5('0x3a')](_0x157e87[_0x9ee5('0x37')],{'$or':_[_0x9ee5('0x2b')](_0x3a6739,function(_0xd5d02e){if(_0xd5d02e[_0x9ee5('0x2e')]!=='VIRTUAL'){var _0x2dcc7d={};_0x2dcc7d[_0xd5d02e['name']]={'$like':'%'+_0x3b32f5[_0x9ee5('0x31')][_0x9ee5('0x39')]+'%'};return _0x2dcc7d;}})});}_0x157e87=_['merge']({},_0x157e87,_0x3b32f5[_0x9ee5('0x3b')]);var _0x408acd={'where':_0x157e87[_0x9ee5('0x37')]};return db[_0x9ee5('0x2c')][_0x9ee5('0x1e')](_0x408acd)[_0x9ee5('0x24')](function(_0x3d0467){_0x3f39b6[_0x9ee5('0x1e')]=_0x3d0467;if(_0x3b32f5[_0x9ee5('0x31')][_0x9ee5('0x3c')]){_0x157e87[_0x9ee5('0x3d')]=[{'all':!![]}];}return db[_0x9ee5('0x2c')][_0x9ee5('0x3e')](_0x157e87);})[_0x9ee5('0x24')](function(_0x3e6a3a){_0x3f39b6[_0x9ee5('0x3f')]=_0x3e6a3a;return _0x3f39b6;})[_0x9ee5('0x24')](respondWithFilteredResult(_0x1a2dbf,_0x157e87))[_0x9ee5('0x40')](handleError(_0x1a2dbf,null));};exports[_0x9ee5('0x41')]=function(_0x40c5bc,_0x421fd6){var _0xb53f75={'raw':!![],'where':{'id':_0x40c5bc[_0x9ee5('0x42')]['id']}},_0x2897c6={};_0x2897c6[_0x9ee5('0x30')]=_[_0x9ee5('0x43')](db[_0x9ee5('0x2c')]['rawAttributes']);_0x2897c6['query']=_[_0x9ee5('0x43')](_0x40c5bc[_0x9ee5('0x31')]);_0x2897c6[_0x9ee5('0x38')]=_[_0x9ee5('0x32')](_0x2897c6[_0x9ee5('0x30')],_0x2897c6[_0x9ee5('0x31')]);_0xb53f75[_0x9ee5('0x33')]=_[_0x9ee5('0x32')](_0x2897c6[_0x9ee5('0x30')],qs[_0x9ee5('0x34')](_0x40c5bc['query'][_0x9ee5('0x34')]));_0xb53f75[_0x9ee5('0x33')]=_0xb53f75[_0x9ee5('0x33')]['length']?_0xb53f75[_0x9ee5('0x33')]:_0x2897c6[_0x9ee5('0x30')];if(_0x40c5bc[_0x9ee5('0x31')][_0x9ee5('0x3c')]){_0xb53f75['include']=[{'all':!![]}];}_0xb53f75=_[_0x9ee5('0x3a')]({},_0xb53f75,_0x40c5bc['options']);return db[_0x9ee5('0x2c')][_0x9ee5('0x44')](_0xb53f75)[_0x9ee5('0x24')](handleEntityNotFound(_0x421fd6,null))[_0x9ee5('0x24')](respondWithResult(_0x421fd6,null))[_0x9ee5('0x40')](handleError(_0x421fd6,null));};exports[_0x9ee5('0x45')]=function(_0x310931,_0x590e1c){return db[_0x9ee5('0x2c')][_0x9ee5('0x45')](_0x310931[_0x9ee5('0x46')],{})['then'](respondWithResult(_0x590e1c,0xc9))[_0x9ee5('0x40')](handleError(_0x590e1c,null));};exports[_0x9ee5('0x23')]=function(_0x13da2c,_0x33a01e){if(_0x13da2c['body']['id']){delete _0x13da2c[_0x9ee5('0x46')]['id'];}return db[_0x9ee5('0x2c')][_0x9ee5('0x44')]({'where':{'id':_0x13da2c['params']['id']}})[_0x9ee5('0x24')](handleEntityNotFound(_0x33a01e,null))[_0x9ee5('0x24')](saveUpdates(_0x13da2c[_0x9ee5('0x46')],null))['then'](respondWithResult(_0x33a01e,null))[_0x9ee5('0x40')](handleError(_0x33a01e,null));};exports[_0x9ee5('0x25')]=function(_0x913e1b,_0x3edea6){return db[_0x9ee5('0x2c')][_0x9ee5('0x44')]({'where':{'id':_0x913e1b[_0x9ee5('0x42')]['id']}})[_0x9ee5('0x24')](handleEntityNotFound(_0x3edea6,null))[_0x9ee5('0x24')](removeEntity(_0x3edea6,null))[_0x9ee5('0x40')](handleError(_0x3edea6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index bfccac6..27f96fe 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 _0x4a54=['../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x2c7780,_0x100f4a){var _0x580bc8=function(_0x3d435c){while(--_0x3d435c){_0x2c7780['push'](_0x2c7780['shift']());}};_0x580bc8(++_0x100f4a);}(_0x4a54,0x1a9));var _0x44a5=function(_0x30e2ac,_0x569e21){_0x30e2ac=_0x30e2ac-0x0;var _0x4eaac5=_0x4a54[_0x30e2ac];return _0x4eaac5;};'use strict';var _=require(_0x44a5('0x0'));var util=require(_0x44a5('0x1'));var logger=require(_0x44a5('0x2'))('api');var moment=require(_0x44a5('0x3'));var BPromise=require('bluebird');var rp=require(_0x44a5('0x4'));var fs=require('fs');var path=require(_0x44a5('0x5'));var rimraf=require(_0x44a5('0x6'));var config=require(_0x44a5('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x44a5('0x8')]=function(_0x511f0d,_0x454dd1){return _0x511f0d[_0x44a5('0x9')](_0x44a5('0xa'),attributes,{'tableName':_0x44a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41ab=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b3ee7,_0x3cb08a){var _0x5b6f01=function(_0x4476fc){while(--_0x4476fc){_0x4b3ee7['push'](_0x4b3ee7['shift']());}};_0x5b6f01(++_0x3cb08a);}(_0x41ab,0x141));var _0xb41a=function(_0x4ceae1,_0x437160){_0x4ceae1=_0x4ceae1-0x0;var _0x3dc47e=_0x41ab[_0x4ceae1];return _0x3dc47e;};'use strict';var _=require(_0xb41a('0x0'));var util=require(_0xb41a('0x1'));var logger=require(_0xb41a('0x2'))(_0xb41a('0x3'));var moment=require(_0xb41a('0x4'));var BPromise=require(_0xb41a('0x5'));var rp=require(_0xb41a('0x6'));var fs=require('fs');var path=require(_0xb41a('0x7'));var rimraf=require(_0xb41a('0x8'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x14600b,_0x5e483b){return _0x14600b['define'](_0xb41a('0x9'),attributes,{'tableName':_0xb41a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 24d39ab..f1c33ef 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 _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(_0x28f8fd,_0x5ad3a6){var _0x32d71f=function(_0x3d14d9){while(--_0x3d14d9){_0x28f8fd['push'](_0x28f8fd['shift']());}};_0x32d71f(++_0x5ad3a6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'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 +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3e10a9,_0x31de10){var _0x2ae051=function(_0x5b523e){while(--_0x5b523e){_0x3e10a9['push'](_0x3e10a9['shift']());}};_0x2ae051(++_0x31de10);}(_0xdb28,0x106));var _0x8db2=function(_0x17f91d,_0x48072e){_0x17f91d=_0x17f91d-0x0;var _0x25f489=_0xdb28[_0x17f91d];return _0x25f489;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 8100e99..675cd00 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 _0xbb16=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x3f560e,_0x289aa8){var _0x5bf213=function(_0xcc2f71){while(--_0xcc2f71){_0x3f560e['push'](_0x3f560e['shift']());}};_0x5bf213(++_0x289aa8);}(_0xbb16,0x1d7));var _0x6bb1=function(_0x5a6a5e,_0x428da2){_0x5a6a5e=_0x5a6a5e-0x0;var _0x4c9c26=_0xbb16[_0x5a6a5e];return _0x4c9c26;};'use strict';var multer=require('multer');var util=require(_0x6bb1('0x0'));var path=require(_0x6bb1('0x1'));var timeout=require(_0x6bb1('0x2'));var express=require(_0x6bb1('0x3'));var router=express['Router']();var fs_extra=require(_0x6bb1('0x4'));var auth=require(_0x6bb1('0x5'));var interaction=require(_0x6bb1('0x6'));var config=require(_0x6bb1('0x7'));var controller=require(_0x6bb1('0x8'));router[_0x6bb1('0x9')]('/',auth['isAuthenticated'](),controller[_0x6bb1('0xa')]);router['get'](_0x6bb1('0xb'),auth[_0x6bb1('0xc')](),controller[_0x6bb1('0xd')]);router[_0x6bb1('0xe')]('/',auth['isAuthenticated'](),controller[_0x6bb1('0xf')]);router[_0x6bb1('0x10')]('/:id',auth[_0x6bb1('0xc')](),controller[_0x6bb1('0x11')]);router[_0x6bb1('0x12')](_0x6bb1('0xb'),auth[_0x6bb1('0xc')](),controller['destroy']);module[_0x6bb1('0x13')]=router; \ No newline at end of file +var _0x4327=['../../config/environment','isAuthenticated','/:id','show','post','put','update','delete','exports','path','express','../../components/interaction/service'];(function(_0x19e08e,_0x178f46){var _0x14c229=function(_0x791b3b){while(--_0x791b3b){_0x19e08e['push'](_0x19e08e['shift']());}};_0x14c229(++_0x178f46);}(_0x4327,0x11d));var _0x7432=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x4327[_0x2cfb48];return _0xc4594f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7432('0x0'));var timeout=require('connect-timeout');var express=require(_0x7432('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7432('0x2'));var config=require(_0x7432('0x3'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x7432('0x4')](),controller['index']);router['get'](_0x7432('0x5'),auth['isAuthenticated'](),controller[_0x7432('0x6')]);router[_0x7432('0x7')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7432('0x8')]('/:id',auth[_0x7432('0x4')](),controller[_0x7432('0x9')]);router[_0x7432('0xa')]('/:id',auth[_0x7432('0x4')](),controller['destroy']);module[_0x7432('0xb')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 3d7efe4..78ba0b1 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 _0xc818=['sequelize','exports','STRING'];(function(_0x264528,_0x22b92e){var _0x5e8309=function(_0x3eaa97){while(--_0x3eaa97){_0x264528['push'](_0x264528['shift']());}};_0x5e8309(++_0x22b92e);}(_0xc818,0x1e3));var _0x8c81=function(_0x1cdcd0,_0xdb1df2){_0x1cdcd0=_0x1cdcd0-0x0;var _0x240702=_0xc818[_0x1cdcd0];return _0x240702;};'use strict';var Sequelize=require(_0x8c81('0x0'));module[_0x8c81('0x1')]={'name':{'type':Sequelize[_0x8c81('0x2')]},'basename':{'type':Sequelize[_0x8c81('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x851d=['STRING','sequelize'];(function(_0x4f1d24,_0x2d0b63){var _0x3cf780=function(_0x488e3d){while(--_0x488e3d){_0x4f1d24['push'](_0x4f1d24['shift']());}};_0x3cf780(++_0x2d0b63);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd851('0x0'));module['exports']={'name':{'type':Sequelize[_0xd851('0x1')]},'basename':{'type':Sequelize[_0xd851('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2024daa..a3e1ca1 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 _0x439b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','Attachment','includeAll','include','rows','catch','show','find','clone','get','omit','createdAt','updatedAt','create','body','params','file','originalname','basename','filename','download','findOne','root','server/files/attachments/','join','offline-chat/','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xc124fe,_0x5a412b){var _0x5e1ed7=function(_0x307a0b){while(--_0x307a0b){_0xc124fe['push'](_0xc124fe['shift']());}};_0x5e1ed7(++_0x5a412b);}(_0x439b,0xa4));var _0xb439=function(_0x3e231b,_0x126ff3){_0x3e231b=_0x3e231b-0x0;var _0x867a46=_0x439b[_0x3e231b];return _0x867a46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb439('0x0'));var zipdir=require(_0xb439('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb439('0x2'));var moment=require(_0xb439('0x3'));var BPromise=require(_0xb439('0x4'));var Mustache=require(_0xb439('0x5'));var util=require(_0xb439('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb439('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb439('0x8'));var _=require(_0xb439('0x9'));var squel=require(_0xb439('0xa'));var crypto=require(_0xb439('0xb'));var jsforce=require(_0xb439('0xc'));var deskjs=require(_0xb439('0xd'));var toCsv=require(_0xb439('0x7'));var querystring=require(_0xb439('0xe'));var Papa=require(_0xb439('0xf'));var Redis=require(_0xb439('0x10'));var authService=require(_0xb439('0x11'));var qs=require(_0xb439('0x12'));var as=require(_0xb439('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb439('0x14'));var utils=require(_0xb439('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb439('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337e0e,_0x3f879a){_0x3f879a=_0x3f879a||0xcc;return function(_0x3893d8){if(_0x3893d8){return _0x337e0e['sendStatus'](_0x3f879a);}return _0x337e0e[_0xb439('0x17')](_0x3f879a)[_0xb439('0x18')]();};}function respondWithResult(_0x3a41a5,_0x25a8eb){_0x25a8eb=_0x25a8eb||0xc8;return function(_0x580f32){if(_0x580f32){return _0x3a41a5['status'](_0x25a8eb)[_0xb439('0x19')](_0x580f32);}};}function respondWithFilteredResult(_0x342af3,_0x45120d){return function(_0x4ebfd0){if(_0x4ebfd0){var _0x2f2323=typeof _0x45120d['offset']===_0xb439('0x1a')&&typeof _0x45120d[_0xb439('0x1b')]===_0xb439('0x1a');var _0x1cd36b=_0x4ebfd0['count'];var _0xb3f705=_0x2f2323?0x0:_0x45120d[_0xb439('0x1c')];var _0x3e0fb2=_0x2f2323?_0x4ebfd0[_0xb439('0x1d')]:_0x45120d['offset']+_0x45120d[_0xb439('0x1b')];var _0x57d552;if(_0x3e0fb2>=_0x1cd36b){_0x3e0fb2=_0x1cd36b;_0x57d552=0xc8;}else{_0x57d552=0xce;}_0x342af3[_0xb439('0x17')](_0x57d552);return _0x342af3[_0xb439('0x1e')](_0xb439('0x1f'),_0xb3f705+'-'+_0x3e0fb2+'/'+_0x1cd36b)[_0xb439('0x19')](_0x4ebfd0);}return null;};}function patchUpdates(_0x1cac02){return function(_0x37b0a4){try{jsonpatch[_0xb439('0x20')](_0x37b0a4,_0x1cac02,!![]);}catch(_0xeae928){return BPromise[_0xb439('0x21')](_0xeae928);}return _0x37b0a4[_0xb439('0x22')]();};}function saveUpdates(_0x51d3ca,_0x31335b){return function(_0x5e6787){if(_0x5e6787){return _0x5e6787[_0xb439('0x23')](_0x51d3ca)[_0xb439('0x24')](function(_0x500a71){return _0x500a71;});}return null;};}function removeEntity(_0x5aa836,_0x25f57b){return function(_0x3ba062){if(_0x3ba062){return _0x3ba062[_0xb439('0x25')]()[_0xb439('0x24')](function(){_0x5aa836[_0xb439('0x17')](0xcc)[_0xb439('0x18')]();});}};}function handleEntityNotFound(_0x132136,_0x1161b5){return function(_0x57a643){if(!_0x57a643){_0x132136[_0xb439('0x26')](0x194);}return _0x57a643;};}function handleError(_0x105d8c,_0x4c5012){_0x4c5012=_0x4c5012||0x1f4;return function(_0xe4f7bd){logger[_0xb439('0x27')](_0xe4f7bd[_0xb439('0x28')]);if(_0xe4f7bd[_0xb439('0x29')]){delete _0xe4f7bd[_0xb439('0x29')];}_0x105d8c[_0xb439('0x17')](_0x4c5012)[_0xb439('0x2a')](_0xe4f7bd);};}exports[_0xb439('0x2b')]=function(_0x4229a3,_0x3251c8){var _0x1af084={},_0x3169f6={},_0x5efba8={'count':0x0,'rows':[]};var _0x2cdf2d=_[_0xb439('0x2c')](db['Attachment'][_0xb439('0x2d')],function(_0x3861a3){return{'name':_0x3861a3[_0xb439('0x2e')],'type':_0x3861a3['type'][_0xb439('0x2f')]};});_0x3169f6[_0xb439('0x30')]=_[_0xb439('0x2c')](_0x2cdf2d,'name');_0x3169f6[_0xb439('0x31')]=_[_0xb439('0x32')](_0x4229a3[_0xb439('0x31')]);_0x3169f6[_0xb439('0x33')]=_[_0xb439('0x34')](_0x3169f6['model'],_0x3169f6[_0xb439('0x31')]);_0x1af084[_0xb439('0x35')]=_['intersection'](_0x3169f6['model'],qs[_0xb439('0x36')](_0x4229a3[_0xb439('0x31')]['fields']));_0x1af084[_0xb439('0x35')]=_0x1af084[_0xb439('0x35')][_0xb439('0x37')]?_0x1af084[_0xb439('0x35')]:_0x3169f6[_0xb439('0x30')];if(!_0x4229a3['query'][_0xb439('0x38')](_0xb439('0x39'))){_0x1af084[_0xb439('0x1b')]=qs[_0xb439('0x1b')](_0x4229a3['query'][_0xb439('0x1b')]);_0x1af084[_0xb439('0x1c')]=qs[_0xb439('0x1c')](_0x4229a3[_0xb439('0x31')][_0xb439('0x1c')]);}_0x1af084[_0xb439('0x3a')]=qs['sort'](_0x4229a3[_0xb439('0x31')]['sort']);_0x1af084[_0xb439('0x3b')]=qs[_0xb439('0x33')](_[_0xb439('0x3c')](_0x4229a3[_0xb439('0x31')],_0x3169f6['filters']),_0x2cdf2d);if(_0x4229a3[_0xb439('0x31')][_0xb439('0x3d')]){_0x1af084['where']=_[_0xb439('0x3e')](_0x1af084['where'],{'$or':_['map'](_0x2cdf2d,function(_0x4508c4){if(_0x4508c4[_0xb439('0x3f')]!=='VIRTUAL'){var _0x424242={};_0x424242[_0x4508c4['name']]={'$like':'%'+_0x4229a3[_0xb439('0x31')][_0xb439('0x3d')]+'%'};return _0x424242;}})});}_0x1af084=_[_0xb439('0x3e')]({},_0x1af084,_0x4229a3[_0xb439('0x40')]);var _0x1d3ff2={'where':_0x1af084[_0xb439('0x3b')]};return db[_0xb439('0x41')]['count'](_0x1d3ff2)[_0xb439('0x24')](function(_0x751d4a){_0x5efba8['count']=_0x751d4a;if(_0x4229a3['query'][_0xb439('0x42')]){_0x1af084[_0xb439('0x43')]=[{'all':!![]}];}return db[_0xb439('0x41')]['findAll'](_0x1af084);})[_0xb439('0x24')](function(_0x5bff50){_0x5efba8[_0xb439('0x44')]=_0x5bff50;return _0x5efba8;})['then'](respondWithFilteredResult(_0x3251c8,_0x1af084))[_0xb439('0x45')](handleError(_0x3251c8,null));};exports[_0xb439('0x46')]=function(_0x305165,_0x4ec97c){var _0xa30e06={'raw':!![],'where':{'id':_0x305165['params']['id']}},_0x1ac1a4={};_0x1ac1a4[_0xb439('0x30')]=_['keys'](db[_0xb439('0x41')]['rawAttributes']);_0x1ac1a4[_0xb439('0x31')]=_[_0xb439('0x32')](_0x305165[_0xb439('0x31')]);_0x1ac1a4[_0xb439('0x33')]=_[_0xb439('0x34')](_0x1ac1a4[_0xb439('0x30')],_0x1ac1a4[_0xb439('0x31')]);_0xa30e06[_0xb439('0x35')]=_[_0xb439('0x34')](_0x1ac1a4[_0xb439('0x30')],qs['fields'](_0x305165[_0xb439('0x31')][_0xb439('0x36')]));_0xa30e06[_0xb439('0x35')]=_0xa30e06['attributes'][_0xb439('0x37')]?_0xa30e06[_0xb439('0x35')]:_0x1ac1a4[_0xb439('0x30')];if(_0x305165[_0xb439('0x31')][_0xb439('0x42')]){_0xa30e06[_0xb439('0x43')]=[{'all':!![]}];}_0xa30e06=_[_0xb439('0x3e')]({},_0xa30e06,_0x305165[_0xb439('0x40')]);return db[_0xb439('0x41')][_0xb439('0x47')](_0xa30e06)['then'](handleEntityNotFound(_0x4ec97c,null))['then'](respondWithResult(_0x4ec97c,null))['catch'](handleError(_0x4ec97c,null));};exports[_0xb439('0x48')]=function(_0x1fcebe,_0x46077b){var _0x4e110c={'where':{'id':_0x1fcebe['params']['id']}},_0x5f44f1={};_0x5f44f1[_0xb439('0x30')]=_[_0xb439('0x32')](db[_0xb439('0x41')]['rawAttributes']);_0x4e110c[_0xb439('0x35')]=_[_0xb439('0x34')](_0x5f44f1[_0xb439('0x30')],qs[_0xb439('0x36')](_0x1fcebe['query'][_0xb439('0x36')]));_0x4e110c['attributes']=_0x4e110c[_0xb439('0x35')]['length']?_0x4e110c['attributes']:_0x5f44f1['model'];if(_0x1fcebe[_0xb439('0x31')][_0xb439('0x42')]){_0x4e110c[_0xb439('0x43')]=[{'all':!![]}];}_0x4e110c=_[_0xb439('0x3e')]({},_0x4e110c,_0x1fcebe[_0xb439('0x40')]);return db[_0xb439('0x41')][_0xb439('0x47')](_0x4e110c)[_0xb439('0x24')](handleEntityNotFound(_0x46077b,null))['then'](function(_0x59c571){if(_0x59c571){var _0x1e2297=_0x59c571[_0xb439('0x49')]({'plain':!![]});_0x1e2297=qs[_0xb439('0x4a')](_0x1e2297,['id',_0xb439('0x4b'),_0xb439('0x4c')]);_0x1fcebe['body']=_[_0xb439('0x4a')](_0x1fcebe['body'],['id',_0xb439('0x4b'),_0xb439('0x4c')]);return db['Attachment'][_0xb439('0x4d')](_[_0xb439('0x3e')](_0x1e2297,_0x1fcebe[_0xb439('0x4e')]),{'include':_0x1fcebe[_0xb439('0x31')][_0xb439('0x42')]?[{'all':!![]}]:undefined});}})[_0xb439('0x24')](respondWithResult(_0x46077b,0xc9))[_0xb439('0x45')](handleError(_0x46077b,null));};exports[_0xb439('0x23')]=function(_0x383999,_0x2414a8){if(_0x383999[_0xb439('0x4e')]['id']){delete _0x383999[_0xb439('0x4e')]['id'];}return db[_0xb439('0x41')][_0xb439('0x47')]({'where':{'id':_0x383999[_0xb439('0x4f')]['id']}})[_0xb439('0x24')](handleEntityNotFound(_0x2414a8,null))[_0xb439('0x24')](saveUpdates(_0x383999[_0xb439('0x4e')],null))[_0xb439('0x24')](respondWithResult(_0x2414a8,null))['catch'](handleError(_0x2414a8,null));};exports['destroy']=function(_0x4847cc,_0x536f7b){return db[_0xb439('0x41')][_0xb439('0x47')]({'where':{'id':_0x4847cc[_0xb439('0x4f')]['id']}})[_0xb439('0x24')](handleEntityNotFound(_0x536f7b,null))[_0xb439('0x24')](removeEntity(_0x536f7b,null))[_0xb439('0x45')](handleError(_0x536f7b,null));};exports[_0xb439('0x4d')]=function(_0x5d0b88,_0x249fa9,_0x4058a1){_0x5d0b88[_0xb439('0x4e')][_0xb439('0x29')]=_0x5d0b88[_0xb439('0x50')][_0xb439('0x51')];_0x5d0b88[_0xb439('0x4e')][_0xb439('0x52')]=_0x5d0b88[_0xb439('0x50')][_0xb439('0x53')];_0x5d0b88[_0xb439('0x4e')]['type']=_0x5d0b88['file']['mimetype'];return db[_0xb439('0x41')][_0xb439('0x4d')](_0x5d0b88['body'])[_0xb439('0x24')](respondWithResult(_0x249fa9,0xc9))[_0xb439('0x45')](handleError(_0x249fa9,null));};exports[_0xb439('0x54')]=function(_0x259009,_0xb63b33,_0x144879){return db['Attachment'][_0xb439('0x55')]({'where':{'id':_0x259009[_0xb439('0x4f')]['id']},'raw':!![]})[_0xb439('0x24')](handleEntityNotFound(_0xb63b33,null))[_0xb439('0x24')](function(_0x5c4e5a){if(_0x5c4e5a){var _0x20f1b8=_0x5c4e5a['ChatOfflineMessageId']!==null;var _0x43509a=path['join'](config[_0xb439('0x56')],_0xb439('0x57'));if(_0x20f1b8){_0x43509a=path[_0xb439('0x58')](_0x43509a,_0xb439('0x59'));}var _0x3d7a46=path[_0xb439('0x58')](_0x43509a,_0x5c4e5a[_0xb439('0x52')]);return _0xb63b33[_0xb439('0x54')](_0x3d7a46);}})[_0xb439('0x45')](handleError(_0xb63b33,null));}; \ No newline at end of file +var _0x6df5=['filename','download','findOne','join','server/files/attachments/','basename','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Attachment','findAll','rows','catch','show','params','find','clone','get','updatedAt','body','omit','createdAt','create'];(function(_0x35eec1,_0x9a6437){var _0x32e069=function(_0xd5def1){while(--_0xd5def1){_0x35eec1['push'](_0x35eec1['shift']());}};_0x32e069(++_0x9a6437);}(_0x6df5,0xb4));var _0x56df=function(_0x12f35c,_0x23fe06){_0x12f35c=_0x12f35c-0x0;var _0xe7442a=_0x6df5[_0x12f35c];return _0xe7442a;};'use strict';var emlformat=require(_0x56df('0x0'));var rimraf=require(_0x56df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56df('0x2'));var rp=require(_0x56df('0x3'));var moment=require('moment');var BPromise=require(_0x56df('0x4'));var Mustache=require('mustache');var util=require(_0x56df('0x5'));var path=require(_0x56df('0x6'));var sox=require(_0x56df('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x56df('0x8'));var _=require(_0x56df('0x9'));var squel=require(_0x56df('0xa'));var crypto=require(_0x56df('0xb'));var jsforce=require(_0x56df('0xc'));var deskjs=require(_0x56df('0xd'));var toCsv=require(_0x56df('0xe'));var querystring=require(_0x56df('0xf'));var Papa=require('papaparse');var Redis=require(_0x56df('0x10'));var authService=require(_0x56df('0x11'));var qs=require(_0x56df('0x12'));var as=require(_0x56df('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56df('0x14'))(_0x56df('0x15'));var utils=require('../../config/utils');var config=require(_0x56df('0x16'));var licenseUtil=require(_0x56df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c989f,_0x5d3e74){_0x5d3e74=_0x5d3e74||0xcc;return function(_0x305e23){if(_0x305e23){return _0x5c989f['sendStatus'](_0x5d3e74);}return _0x5c989f[_0x56df('0x18')](_0x5d3e74)[_0x56df('0x19')]();};}function respondWithResult(_0x48101b,_0x595472){_0x595472=_0x595472||0xc8;return function(_0x4240f3){if(_0x4240f3){return _0x48101b[_0x56df('0x18')](_0x595472)['json'](_0x4240f3);}};}function respondWithFilteredResult(_0x12ee70,_0x35c330){return function(_0x2ea844){if(_0x2ea844){var _0x729257=typeof _0x35c330['offset']===_0x56df('0x1a')&&typeof _0x35c330[_0x56df('0x1b')]===_0x56df('0x1a');var _0xf927ba=_0x2ea844[_0x56df('0x1c')];var _0x81c0fe=_0x729257?0x0:_0x35c330[_0x56df('0x1d')];var _0x9b5949=_0x729257?_0x2ea844[_0x56df('0x1c')]:_0x35c330['offset']+_0x35c330[_0x56df('0x1b')];var _0x886ba8;if(_0x9b5949>=_0xf927ba){_0x9b5949=_0xf927ba;_0x886ba8=0xc8;}else{_0x886ba8=0xce;}_0x12ee70[_0x56df('0x18')](_0x886ba8);return _0x12ee70['set'](_0x56df('0x1e'),_0x81c0fe+'-'+_0x9b5949+'/'+_0xf927ba)[_0x56df('0x1f')](_0x2ea844);}return null;};}function patchUpdates(_0x1c38d2){return function(_0x16dbf3){try{jsonpatch[_0x56df('0x20')](_0x16dbf3,_0x1c38d2,!![]);}catch(_0x180e50){return BPromise[_0x56df('0x21')](_0x180e50);}return _0x16dbf3[_0x56df('0x22')]();};}function saveUpdates(_0x86354b,_0x2d9df0){return function(_0x52c3c8){if(_0x52c3c8){return _0x52c3c8[_0x56df('0x23')](_0x86354b)[_0x56df('0x24')](function(_0xabf566){return _0xabf566;});}return null;};}function removeEntity(_0x4e082e,_0x585586){return function(_0x3a3c7f){if(_0x3a3c7f){return _0x3a3c7f[_0x56df('0x25')]()[_0x56df('0x24')](function(){_0x4e082e[_0x56df('0x18')](0xcc)[_0x56df('0x19')]();});}};}function handleEntityNotFound(_0x12b357,_0x487a13){return function(_0x2374b8){if(!_0x2374b8){_0x12b357['sendStatus'](0x194);}return _0x2374b8;};}function handleError(_0x115846,_0x514c7c){_0x514c7c=_0x514c7c||0x1f4;return function(_0x2dc53c){logger[_0x56df('0x26')](_0x2dc53c[_0x56df('0x27')]);if(_0x2dc53c[_0x56df('0x28')]){delete _0x2dc53c['name'];}_0x115846[_0x56df('0x18')](_0x514c7c)['send'](_0x2dc53c);};}exports[_0x56df('0x29')]=function(_0x39c41e,_0x352c16){var _0x1a1a58={},_0x189a9d={},_0x4542d6={'count':0x0,'rows':[]};var _0x58d0fd=_[_0x56df('0x2a')](db['Attachment'][_0x56df('0x2b')],function(_0x9a0961){return{'name':_0x9a0961[_0x56df('0x2c')],'type':_0x9a0961[_0x56df('0x2d')][_0x56df('0x2e')]};});_0x189a9d[_0x56df('0x2f')]=_['map'](_0x58d0fd,'name');_0x189a9d[_0x56df('0x30')]=_[_0x56df('0x31')](_0x39c41e[_0x56df('0x30')]);_0x189a9d[_0x56df('0x32')]=_[_0x56df('0x33')](_0x189a9d[_0x56df('0x2f')],_0x189a9d[_0x56df('0x30')]);_0x1a1a58[_0x56df('0x34')]=_[_0x56df('0x33')](_0x189a9d['model'],qs['fields'](_0x39c41e[_0x56df('0x30')][_0x56df('0x35')]));_0x1a1a58[_0x56df('0x34')]=_0x1a1a58['attributes'][_0x56df('0x36')]?_0x1a1a58[_0x56df('0x34')]:_0x189a9d[_0x56df('0x2f')];if(!_0x39c41e[_0x56df('0x30')][_0x56df('0x37')](_0x56df('0x38'))){_0x1a1a58[_0x56df('0x1b')]=qs[_0x56df('0x1b')](_0x39c41e[_0x56df('0x30')][_0x56df('0x1b')]);_0x1a1a58[_0x56df('0x1d')]=qs[_0x56df('0x1d')](_0x39c41e[_0x56df('0x30')]['offset']);}_0x1a1a58[_0x56df('0x39')]=qs[_0x56df('0x3a')](_0x39c41e[_0x56df('0x30')]['sort']);_0x1a1a58[_0x56df('0x3b')]=qs['filters'](_[_0x56df('0x3c')](_0x39c41e['query'],_0x189a9d[_0x56df('0x32')]),_0x58d0fd);if(_0x39c41e['query'][_0x56df('0x3d')]){_0x1a1a58[_0x56df('0x3b')]=_[_0x56df('0x3e')](_0x1a1a58['where'],{'$or':_[_0x56df('0x2a')](_0x58d0fd,function(_0x457901){if(_0x457901['type']!==_0x56df('0x3f')){var _0x55f6ee={};_0x55f6ee[_0x457901[_0x56df('0x28')]]={'$like':'%'+_0x39c41e[_0x56df('0x30')][_0x56df('0x3d')]+'%'};return _0x55f6ee;}})});}_0x1a1a58=_[_0x56df('0x3e')]({},_0x1a1a58,_0x39c41e[_0x56df('0x40')]);var _0x21af9f={'where':_0x1a1a58[_0x56df('0x3b')]};return db['Attachment'][_0x56df('0x1c')](_0x21af9f)[_0x56df('0x24')](function(_0x398f54){_0x4542d6[_0x56df('0x1c')]=_0x398f54;if(_0x39c41e[_0x56df('0x30')][_0x56df('0x41')]){_0x1a1a58[_0x56df('0x42')]=[{'all':!![]}];}return db[_0x56df('0x43')][_0x56df('0x44')](_0x1a1a58);})[_0x56df('0x24')](function(_0x2d1820){_0x4542d6[_0x56df('0x45')]=_0x2d1820;return _0x4542d6;})[_0x56df('0x24')](respondWithFilteredResult(_0x352c16,_0x1a1a58))[_0x56df('0x46')](handleError(_0x352c16,null));};exports[_0x56df('0x47')]=function(_0x160601,_0x4093e5){var _0x1c456f={'raw':!![],'where':{'id':_0x160601[_0x56df('0x48')]['id']}},_0x5d37d0={};_0x5d37d0[_0x56df('0x2f')]=_[_0x56df('0x31')](db[_0x56df('0x43')][_0x56df('0x2b')]);_0x5d37d0[_0x56df('0x30')]=_[_0x56df('0x31')](_0x160601['query']);_0x5d37d0[_0x56df('0x32')]=_[_0x56df('0x33')](_0x5d37d0['model'],_0x5d37d0[_0x56df('0x30')]);_0x1c456f[_0x56df('0x34')]=_[_0x56df('0x33')](_0x5d37d0[_0x56df('0x2f')],qs[_0x56df('0x35')](_0x160601[_0x56df('0x30')][_0x56df('0x35')]));_0x1c456f['attributes']=_0x1c456f[_0x56df('0x34')][_0x56df('0x36')]?_0x1c456f[_0x56df('0x34')]:_0x5d37d0[_0x56df('0x2f')];if(_0x160601[_0x56df('0x30')][_0x56df('0x41')]){_0x1c456f[_0x56df('0x42')]=[{'all':!![]}];}_0x1c456f=_['merge']({},_0x1c456f,_0x160601[_0x56df('0x40')]);return db[_0x56df('0x43')][_0x56df('0x49')](_0x1c456f)[_0x56df('0x24')](handleEntityNotFound(_0x4093e5,null))[_0x56df('0x24')](respondWithResult(_0x4093e5,null))[_0x56df('0x46')](handleError(_0x4093e5,null));};exports[_0x56df('0x4a')]=function(_0x60c3b8,_0x175a5c){var _0x1e9b8a={'where':{'id':_0x60c3b8[_0x56df('0x48')]['id']}},_0x714660={};_0x714660[_0x56df('0x2f')]=_[_0x56df('0x31')](db[_0x56df('0x43')][_0x56df('0x2b')]);_0x1e9b8a[_0x56df('0x34')]=_[_0x56df('0x33')](_0x714660[_0x56df('0x2f')],qs[_0x56df('0x35')](_0x60c3b8['query']['fields']));_0x1e9b8a[_0x56df('0x34')]=_0x1e9b8a['attributes']['length']?_0x1e9b8a['attributes']:_0x714660[_0x56df('0x2f')];if(_0x60c3b8['query'][_0x56df('0x41')]){_0x1e9b8a[_0x56df('0x42')]=[{'all':!![]}];}_0x1e9b8a=_[_0x56df('0x3e')]({},_0x1e9b8a,_0x60c3b8['options']);return db[_0x56df('0x43')][_0x56df('0x49')](_0x1e9b8a)[_0x56df('0x24')](handleEntityNotFound(_0x175a5c,null))[_0x56df('0x24')](function(_0xb23fbe){if(_0xb23fbe){var _0x4e2eeb=_0xb23fbe[_0x56df('0x4b')]({'plain':!![]});_0x4e2eeb=qs['omit'](_0x4e2eeb,['id','createdAt',_0x56df('0x4c')]);_0x60c3b8[_0x56df('0x4d')]=_[_0x56df('0x4e')](_0x60c3b8['body'],['id',_0x56df('0x4f'),_0x56df('0x4c')]);return db[_0x56df('0x43')][_0x56df('0x50')](_[_0x56df('0x3e')](_0x4e2eeb,_0x60c3b8[_0x56df('0x4d')]),{'include':_0x60c3b8[_0x56df('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x56df('0x24')](respondWithResult(_0x175a5c,0xc9))[_0x56df('0x46')](handleError(_0x175a5c,null));};exports['update']=function(_0x5145af,_0x4749b4){if(_0x5145af[_0x56df('0x4d')]['id']){delete _0x5145af[_0x56df('0x4d')]['id'];}return db[_0x56df('0x43')]['find']({'where':{'id':_0x5145af['params']['id']}})[_0x56df('0x24')](handleEntityNotFound(_0x4749b4,null))['then'](saveUpdates(_0x5145af[_0x56df('0x4d')],null))[_0x56df('0x24')](respondWithResult(_0x4749b4,null))['catch'](handleError(_0x4749b4,null));};exports['destroy']=function(_0x418e73,_0xcef80c){return db[_0x56df('0x43')][_0x56df('0x49')]({'where':{'id':_0x418e73[_0x56df('0x48')]['id']}})['then'](handleEntityNotFound(_0xcef80c,null))[_0x56df('0x24')](removeEntity(_0xcef80c,null))[_0x56df('0x46')](handleError(_0xcef80c,null));};exports[_0x56df('0x50')]=function(_0xaa308e,_0x3b8edf,_0x579bb4){_0xaa308e[_0x56df('0x4d')]['name']=_0xaa308e['file']['originalname'];_0xaa308e[_0x56df('0x4d')]['basename']=_0xaa308e['file'][_0x56df('0x51')];_0xaa308e['body'][_0x56df('0x2d')]=_0xaa308e['file']['mimetype'];return db[_0x56df('0x43')][_0x56df('0x50')](_0xaa308e[_0x56df('0x4d')])[_0x56df('0x24')](respondWithResult(_0x3b8edf,0xc9))[_0x56df('0x46')](handleError(_0x3b8edf,null));};exports[_0x56df('0x52')]=function(_0x32e0ed,_0x2e91ab,_0x1e0064){return db[_0x56df('0x43')][_0x56df('0x53')]({'where':{'id':_0x32e0ed[_0x56df('0x48')]['id']},'raw':!![]})[_0x56df('0x24')](handleEntityNotFound(_0x2e91ab,null))[_0x56df('0x24')](function(_0x2b5954){if(_0x2b5954){var _0xe73637=_0x2b5954['ChatOfflineMessageId']!==null;var _0x1537cf=path[_0x56df('0x54')](config['root'],_0x56df('0x55'));if(_0xe73637){_0x1537cf=path[_0x56df('0x54')](_0x1537cf,'offline-chat/');}var _0x498287=path[_0x56df('0x54')](_0x1537cf,_0x2b5954[_0x56df('0x56')]);return _0x2e91ab[_0x56df('0x52')](_0x498287);}})[_0x56df('0x46')](handleError(_0x2e91ab,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 5a66440..3c2b0a7 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 _0x7faa=['../../config/logger','moment','bluebird','request-promise','rimraf','./attachment.attributes','exports','Attachment','lodash'];(function(_0xcb7bc6,_0x347531){var _0x11589f=function(_0x111b51){while(--_0x111b51){_0xcb7bc6['push'](_0xcb7bc6['shift']());}};_0x11589f(++_0x347531);}(_0x7faa,0x74));var _0xa7fa=function(_0x57f4c7,_0x21f612){_0x57f4c7=_0x57f4c7-0x0;var _0x55c1b7=_0x7faa[_0x57f4c7];return _0x55c1b7;};'use strict';var _=require(_0xa7fa('0x0'));var util=require('util');var logger=require(_0xa7fa('0x1'))('api');var moment=require(_0xa7fa('0x2'));var BPromise=require(_0xa7fa('0x3'));var rp=require(_0xa7fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7fa('0x5'));var config=require('../../config/environment');var attributes=require(_0xa7fa('0x6'));module[_0xa7fa('0x7')]=function(_0x337aa1,_0x1c9fa2){return _0x337aa1['define'](_0xa7fa('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01df=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','attachments'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x01df,0x1b8));var _0xf01d=function(_0x3fb2b7,_0x38ed27){_0x3fb2b7=_0x3fb2b7-0x0;var _0x1fdabe=_0x01df[_0x3fb2b7];return _0x1fdabe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf01d('0x0'))('api');var moment=require(_0xf01d('0x1'));var BPromise=require(_0xf01d('0x2'));var rp=require(_0xf01d('0x3'));var fs=require('fs');var path=require(_0xf01d('0x4'));var rimraf=require(_0xf01d('0x5'));var config=require(_0xf01d('0x6'));var attributes=require(_0xf01d('0x7'));module['exports']=function(_0x442197,_0x4b761f){return _0x442197[_0xf01d('0x8')]('Attachment',attributes,{'tableName':_0xf01d('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 d8668d9..75e0c95 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 _0xde6c=['stringify','error','code','message','info','catch','create','options','raw','CreateAttachment','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xde6c,0x119));var _0xcde6=function(_0x26a09d,_0x21aa2d){_0x26a09d=_0x26a09d-0x0;var _0x5c4fb4=_0xde6c[_0x26a09d];return _0x5c4fb4;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var moment=require('moment');var BPromise=require(_0xcde6('0x2'));var rs=require(_0xcde6('0x3'));var fs=require('fs');var Redis=require(_0xcde6('0x4'));var db=require(_0xcde6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcde6('0x6'))(_0xcde6('0x7'));var config=require(_0xcde6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcde6('0x9')][_0xcde6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5543d9,_0x4c37b1,_0x2f7de6){return new BPromise(function(_0x4f07e8,_0x19d6b2){return client[_0xcde6('0xb')](_0x5543d9,_0x2f7de6)[_0xcde6('0xc')](function(_0x353b84){logger['info'](_0xcde6('0xd'),_0x4c37b1,_0xcde6('0xe'));logger['debug'](_0xcde6('0xf'),_0x4c37b1,_0xcde6('0xe'),JSON[_0xcde6('0x10')](_0x353b84));if(_0x353b84[_0xcde6('0x11')]){if(_0x353b84[_0xcde6('0x11')][_0xcde6('0x12')]===0x1f4){logger[_0xcde6('0x11')](_0xcde6('0xd'),_0x4c37b1,_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);return _0x19d6b2(_0x353b84['error'][_0xcde6('0x13')]);}logger[_0xcde6('0x11')](_0xcde6('0xd'),_0x4c37b1,_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);return _0x4f07e8(_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);}else{logger[_0xcde6('0x14')](_0xcde6('0xd'),_0x4c37b1,_0xcde6('0xe'));_0x4f07e8(_0x353b84['result'][_0xcde6('0x13')]);}})[_0xcde6('0x15')](function(_0x38f82a){logger['error']('Attachment,\x20%s,\x20%s',_0x4c37b1,_0x38f82a);_0x19d6b2(_0x38f82a);});});}exports['CreateAttachment']=function(_0x44451e){var _0x49744b=this;return new Promise(function(_0x448b99,_0x96732a){return db['Attachment'][_0xcde6('0x16')](_0x44451e['body'],{'raw':_0x44451e[_0xcde6('0x17')]?_0x44451e[_0xcde6('0x17')][_0xcde6('0x18')]===undefined?!![]:![]:!![]})[_0xcde6('0xc')](function(_0x2b9522){logger[_0xcde6('0x14')](_0xcde6('0x19'),_0x44451e);logger[_0xcde6('0x1a')]('CreateAttachment',_0x44451e,JSON[_0xcde6('0x10')](_0x2b9522));_0x448b99(_0x2b9522);})[_0xcde6('0x15')](function(_0x10bfdf){logger['error'](_0xcde6('0x19'),_0x10bfdf[_0xcde6('0x13')],_0x44451e);_0x96732a(_0x49744b['error'](0x1f4,_0x10bfdf[_0xcde6('0x13')]));});});}; \ No newline at end of file +var _0xcc73=['body','raw','stringify','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateAttachment','Attachment','create'];(function(_0x79ee9e,_0x2af75b){var _0x33f608=function(_0x4b8405){while(--_0x4b8405){_0x79ee9e['push'](_0x79ee9e['shift']());}};_0x33f608(++_0x2af75b);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcc73[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x3cc7('0x0'));var moment=require(_0x3cc7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cc7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cc7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cc7('0x4'));var jayson=require(_0x3cc7('0x5'));var client=jayson[_0x3cc7('0x6')][_0x3cc7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x127590,_0x5604df,_0x416c48){return new BPromise(function(_0x37c184,_0x3f2dd7){return client[_0x3cc7('0x8')](_0x127590,_0x416c48)['then'](function(_0x2ff7ba){logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));logger[_0x3cc7('0xc')](_0x3cc7('0xd'),_0x5604df,_0x3cc7('0xb'),JSON['stringify'](_0x2ff7ba));if(_0x2ff7ba['error']){if(_0x2ff7ba[_0x3cc7('0xe')]['code']===0x1f4){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x3f2dd7(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);return _0x37c184(_0x2ff7ba[_0x3cc7('0xe')][_0x3cc7('0xf')]);}else{logger[_0x3cc7('0x9')](_0x3cc7('0xa'),_0x5604df,_0x3cc7('0xb'));_0x37c184(_0x2ff7ba[_0x3cc7('0x10')][_0x3cc7('0xf')]);}})[_0x3cc7('0x11')](function(_0x386a31){logger[_0x3cc7('0xe')](_0x3cc7('0xa'),_0x5604df,_0x386a31);_0x3f2dd7(_0x386a31);});});}exports[_0x3cc7('0x12')]=function(_0x2a4ddf){var _0xff4317=this;return new Promise(function(_0x118aa0,_0x2f196a){return db[_0x3cc7('0x13')][_0x3cc7('0x14')](_0x2a4ddf[_0x3cc7('0x15')],{'raw':_0x2a4ddf['options']?_0x2a4ddf['options'][_0x3cc7('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x41c9fb){logger[_0x3cc7('0x9')](_0x3cc7('0x12'),_0x2a4ddf);logger['debug']('CreateAttachment',_0x2a4ddf,JSON[_0x3cc7('0x17')](_0x41c9fb));_0x118aa0(_0x41c9fb);})[_0x3cc7('0x11')](function(_0x4d5b7f){logger[_0x3cc7('0xe')](_0x3cc7('0x12'),_0x4d5b7f['message'],_0x2a4ddf);_0x2f196a(_0xff4317[_0x3cc7('0xe')](0x1f4,_0x4d5b7f['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index fd63627..9927590 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x0b0e,0x187));var _0xe0b0=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x0b0e[_0x19dd7a];return _0x3feb6a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4acfd2,_0x5b9374){_0x4acfd2=_0x4acfd2-0x0;var _0x12afbe=_0x0b0e[_0x4acfd2];return _0x12afbe;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index a7f3bbb..819277f 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 _0xbd18=['passport','passport-local','Strategy','activedirectory2','../../components/auth/service','../../config/utils','api','activedirectory','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','user','agent','then','blocked','add','minutes','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User'];(function(_0x2a1ae1,_0x207e89){var _0x445e07=function(_0x33683a){while(--_0x33683a){_0x2a1ae1['push'](_0x2a1ae1['shift']());}};_0x445e07(++_0x207e89);}(_0xbd18,0x195));var _0x8bd1=function(_0x3fb9f6,_0x2f8eb3){_0x3fb9f6=_0x3fb9f6-0x0;var _0x90b016=_0xbd18[_0x3fb9f6];return _0x90b016;};'use strict';var passport=require(_0x8bd1('0x0'));var LocalStrategy=require(_0x8bd1('0x1'))[_0x8bd1('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x8bd1('0x3'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x8bd1('0x4'));var utils=require(_0x8bd1('0x5'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x8bd1('0x6'));function isActiveDirectoryConfigured(_0x136254){var _0x325bed=![];if(typeof _0x136254[_0x8bd1('0x7')]!=='undefined'){_0x325bed=_0x136254[_0x8bd1('0x7')][_0x8bd1('0x8')]&&_0x136254[_0x8bd1('0x7')]['url']&&_0x136254[_0x8bd1('0x7')][_0x8bd1('0x9')];}return _0x325bed;}function adAuthenticate(_0x9610e1,_0x5baf5f,_0x5c36df){return new BPromise(function(_0x434cf1,_0x4ae0b9){try{var _0xc299be=new ActiveDirectory(_0x9610e1);_0xc299be[_0x8bd1('0xa')](_0x5baf5f,_0x5c36df,function(_0x593032,_0x12159b){if(_0x593032){logger['error'](_0x8bd1('0xb'),_0x5baf5f,util[_0x8bd1('0xc')](_0x593032,{'showHidden':![],'depth':null}));_0x4ae0b9(_0x8bd1('0xd'));}else if(!_0x12159b){logger[_0x8bd1('0xe')](_0x8bd1('0xf'),_0x5baf5f);_0x4ae0b9(_0x8bd1('0xd'));}else{_0x434cf1(_0x12159b);}});}catch(_0x194812){_0x4ae0b9(_0x194812);}});}function ActiveDirectoryAuthenticate(_0x322d06,_0x44a6cd,_0x53e177,_0x310c94){var _0x1d446d,_0x65d556;if(!isActiveDirectoryConfigured(config)){logger[_0x8bd1('0xe')](_0x8bd1('0x10'),_0x44a6cd);return _0x310c94(null,![],{'message':_0x8bd1('0xd')});}return db['Setting'][_0x8bd1('0x11')]({'where':{'id':0x1},'attributes':[_0x8bd1('0x12'),_0x8bd1('0x13')],'raw':!![]})['then'](function(_0x48a9d0){_0x1d446d=_0x48a9d0;if(!_0x1d446d[_0x8bd1('0x12')]){logger[_0x8bd1('0xe')](_0x8bd1('0x14'),_0x44a6cd);throw new Error(_0x8bd1('0xd'));}return _0x322d06[_0x8bd1('0x11')]({'attributes':['id',_0x8bd1('0x15'),_0x8bd1('0x16'),_0x8bd1('0x17'),_0x8bd1('0x18'),_0x8bd1('0x19'),'blocked',_0x8bd1('0x1a'),_0x8bd1('0x1b')],'where':{'name':_0x44a6cd,'role':{'$or':[_0x8bd1('0x1c'),_0x8bd1('0x1d'),_0x8bd1('0x1e')]},'adSsoEnabled':!![]}});})[_0x8bd1('0x1f')](function(_0x460f09){if(!_0x460f09||_0x460f09&&_0x460f09[_0x8bd1('0x15')]!==_0x44a6cd){throw new Error(_0x8bd1('0xd'));}_0x65d556=_0x460f09;var _0x31f685=_0x65d556[_0x8bd1('0x15')]+'@'+config[_0x8bd1('0x7')]['domain'];return adAuthenticate(config[_0x8bd1('0x7')],_0x31f685,_0x53e177);})[_0x8bd1('0x1f')](function(_0x59f92d){if(_0x65d556[_0x8bd1('0x19')]){throw new Error(_0x8bd1('0xd'));}if(_0x1d446d['blockDuration']>0x0){if(_0x65d556[_0x8bd1('0x20')]){if(moment(_0x65d556[_0x8bd1('0x1a')])[_0x8bd1('0x21')](_0x1d446d['blockDuration'],_0x8bd1('0x22'))>moment()){throw new Error(_0x8bd1('0xd'));}return utils['clearBlockUser'](_0x65d556,0x0,![],null)['then'](function(){return utils[_0x8bd1('0x23')](_0x65d556);})['then'](function(){return _0x310c94(null,_0x65d556);});}else{return utils[_0x8bd1('0x23')](_0x65d556)['then'](function(){return _0x310c94(null,_0x65d556);});}}else{return utils['getLicense'](_0x65d556)[_0x8bd1('0x1f')](function(){return _0x310c94(null,_0x65d556);});}})[_0x8bd1('0x24')](function(_0x34401e){return _0x310c94(null,![],_0x34401e);});}function handleError(_0x38d8a0,_0x15b332,_0xdf3834){return _0x38d8a0['status'](_0x15b332||0x1f4)[_0x8bd1('0x25')]({'message':_0xdf3834?_0xdf3834[_0x8bd1('0x26')]||_0xdf3834:''});}exports[_0x8bd1('0x27')]=function(_0x36d806,_0xa1ea8d,_0xacc1e4){passport[_0x8bd1('0xa')](_0x8bd1('0x28'),function(_0x5dcda3,_0x33ad7d,_0x40e6ec){var _0x55bdf0=_0x5dcda3||_0x40e6ec;if(_0x55bdf0){return handleError(_0xa1ea8d,0x191,_0x55bdf0);}if(!_0x33ad7d){return handleError(_0xa1ea8d,0x194,{'message':_0x8bd1('0x29')});}else{var _0xe4e66b={'payload':{'id':_0x33ad7d['id'],'role':_0x33ad7d[_0x8bd1('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0x8bd1('0x2a')](_0xe4e66b)[_0x8bd1('0x1f')](function(_0x57f723){_0xa1ea8d[_0x8bd1('0x2b')]({'id':_0x33ad7d['id'],'token':_0x57f723,'statusCall':'','isAlreadyLogged':_0x33ad7d['online']});});}})(_0x36d806,_0xa1ea8d,_0xacc1e4);};passport['use'](_0x8bd1('0x28'),new LocalStrategy({'usernameField':_0x8bd1('0x15'),'passwordField':'password'},function(_0x4d20d8,_0x4a880e,_0x556406){return ActiveDirectoryAuthenticate(db[_0x8bd1('0x2c')],_0x4d20d8,_0x4a880e,_0x556406);})); \ No newline at end of file +var _0x2899=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','disabled','blocked','blockedAt','admin','user','add','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/logger','activedirectory','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','findOne','adSsoEnabled','blockDuration','then'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x2899,0xfe));var _0x9289=function(_0x29f791,_0xc6582f){_0x29f791=_0x29f791-0x0;var _0x5395c6=_0x2899[_0x29f791];return _0x5395c6;};'use strict';var passport=require(_0x9289('0x0'));var LocalStrategy=require(_0x9289('0x1'))[_0x9289('0x2')];var moment=require(_0x9289('0x3'));var ActiveDirectory=require(_0x9289('0x4'));var BPromise=require(_0x9289('0x5'));var util=require(_0x9289('0x6'));var db=require(_0x9289('0x7'))['db'];var authService=require(_0x9289('0x8'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x9289('0x9'))('api');function isActiveDirectoryConfigured(_0x200897){var _0x5c6e49=![];if(typeof _0x200897['activedirectory']!=='undefined'){_0x5c6e49=_0x200897['activedirectory']['baseDN']&&_0x200897['activedirectory']['url']&&_0x200897[_0x9289('0xa')][_0x9289('0xb')];}return _0x5c6e49;}function adAuthenticate(_0x2b7e62,_0x3a5cf9,_0x337da3){return new BPromise(function(_0x4bc43e,_0x1be352){try{var _0xf1b23e=new ActiveDirectory(_0x2b7e62);_0xf1b23e[_0x9289('0xc')](_0x3a5cf9,_0x337da3,function(_0x34bb27,_0x469548){if(_0x34bb27){logger[_0x9289('0xd')](_0x9289('0xe'),_0x3a5cf9,util[_0x9289('0xf')](_0x34bb27,{'showHidden':![],'depth':null}));_0x1be352(_0x9289('0x10'));}else if(!_0x469548){logger[_0x9289('0xd')](_0x9289('0x11'),_0x3a5cf9);_0x1be352('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4bc43e(_0x469548);}});}catch(_0x3fa3e2){_0x1be352(_0x3fa3e2);}});}function ActiveDirectoryAuthenticate(_0x4ba8e0,_0x3ec5b6,_0x451b6b,_0x99533a){var _0x113a61,_0x1235ce;if(!isActiveDirectoryConfigured(config)){logger[_0x9289('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x3ec5b6);return _0x99533a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x9289('0x12')]({'where':{'id':0x1},'attributes':[_0x9289('0x13'),_0x9289('0x14')],'raw':!![]})[_0x9289('0x15')](function(_0x1adc5a){_0x113a61=_0x1adc5a;if(!_0x113a61[_0x9289('0x13')]){logger[_0x9289('0xd')](_0x9289('0x16'),_0x3ec5b6);throw new Error(_0x9289('0x10'));}return _0x4ba8e0[_0x9289('0x12')]({'attributes':['id',_0x9289('0x17'),_0x9289('0x18'),'salt','role',_0x9289('0x19'),_0x9289('0x1a'),_0x9289('0x1b'),'online'],'where':{'name':_0x3ec5b6,'role':{'$or':[_0x9289('0x1c'),_0x9289('0x1d'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x29c422){if(!_0x29c422||_0x29c422&&_0x29c422[_0x9289('0x17')]!==_0x3ec5b6){throw new Error(_0x9289('0x10'));}_0x1235ce=_0x29c422;var _0x6cfbd8=_0x1235ce[_0x9289('0x17')]+'@'+config[_0x9289('0xa')][_0x9289('0xb')];return adAuthenticate(config[_0x9289('0xa')],_0x6cfbd8,_0x451b6b);})[_0x9289('0x15')](function(_0x557fe0){if(_0x1235ce[_0x9289('0x19')]){throw new Error(_0x9289('0x10'));}if(_0x113a61['blockDuration']>0x0){if(_0x1235ce[_0x9289('0x1a')]){if(moment(_0x1235ce[_0x9289('0x1b')])[_0x9289('0x1e')](_0x113a61[_0x9289('0x14')],_0x9289('0x1f'))>moment()){throw new Error(_0x9289('0x10'));}return utils[_0x9289('0x20')](_0x1235ce,0x0,![],null)[_0x9289('0x15')](function(){return utils[_0x9289('0x21')](_0x1235ce);})[_0x9289('0x15')](function(){return _0x99533a(null,_0x1235ce);});}else{return utils[_0x9289('0x21')](_0x1235ce)[_0x9289('0x15')](function(){return _0x99533a(null,_0x1235ce);});}}else{return utils[_0x9289('0x21')](_0x1235ce)[_0x9289('0x15')](function(){return _0x99533a(null,_0x1235ce);});}})[_0x9289('0x22')](function(_0x166208){return _0x99533a(null,![],_0x166208);});}function handleError(_0x406a84,_0x45b90c,_0x4ca720){return _0x406a84['status'](_0x45b90c||0x1f4)[_0x9289('0x23')]({'message':_0x4ca720?_0x4ca720[_0x9289('0x24')]||_0x4ca720:''});}exports[_0x9289('0x25')]=function(_0x3c5561,_0xb37b25,_0x243c28){passport[_0x9289('0xc')](_0x9289('0x26'),function(_0x34451c,_0x54a01e,_0x3fd922){var _0x582be0=_0x34451c||_0x3fd922;if(_0x582be0){return handleError(_0xb37b25,0x191,_0x582be0);}if(!_0x54a01e){return handleError(_0xb37b25,0x194,{'message':_0x9289('0x27')});}else{var _0x578063={'payload':{'id':_0x54a01e['id'],'role':_0x54a01e[_0x9289('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0x9289('0x29')](_0x578063)[_0x9289('0x15')](function(_0xcae459){_0xb37b25[_0x9289('0x2a')]({'id':_0x54a01e['id'],'token':_0xcae459,'statusCall':'','isAlreadyLogged':_0x54a01e[_0x9289('0x2b')]});});}})(_0x3c5561,_0xb37b25,_0x243c28);};passport[_0x9289('0x2c')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x9289('0x18')},function(_0x396b95,_0x4b734b,_0x9beb75){return ActiveDirectoryAuthenticate(db[_0x9289('0x2d')],_0x396b95,_0x4b734b,_0x9beb75);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index c0354f8..a7fc0af 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 _0x3a03=['express','Router','./authActiveDirectory.controller'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x3a03,0x84));var _0x33a0=function(_0x3748d4,_0x56948c){_0x3748d4=_0x3748d4-0x0;var _0x4e7560=_0x3a03[_0x3748d4];return _0x4e7560;};'use strict';var express=require(_0x33a0('0x0'));var router=express[_0x33a0('0x1')]();var controller=require(_0x33a0('0x2'));router['post']('/',controller['login']);module['exports']=router; \ No newline at end of file +var _0x2197=['express','Router','post','login','exports'];(function(_0x2a9a79,_0x31a7ea){var _0x41bfa6=function(_0x57f8f4){while(--_0x57f8f4){_0x2a9a79['push'](_0x2a9a79['shift']());}};_0x41bfa6(++_0x31a7ea);}(_0x2197,0xb4));var _0x7219=function(_0x575283,_0x4c7361){_0x575283=_0x575283-0x0;var _0x1aca09=_0x2197[_0x575283];return _0x1aca09;};'use strict';var express=require(_0x7219('0x0'));var router=express[_0x7219('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x7219('0x2')]('/',controller[_0x7219('0x3')]);module[_0x7219('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 2745851..56fd388 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x7a54,0x106));var _0x47a5=function(_0x14a099,_0x1c17e3){_0x14a099=_0x14a099-0x0;var _0x4b3281=_0x7a54[_0x14a099];return _0x4b3281;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4df6e3,_0x122209){var _0x314432=function(_0x590113){while(--_0x590113){_0x4df6e3['push'](_0x4df6e3['shift']());}};_0x314432(++_0x122209);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 4062fdb..4070793 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 _0x27b5=['login','get','/callback','callback','exports','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x3cafc5,_0x1f5b86){var _0x3684b6=function(_0x102f14){while(--_0x102f14){_0x3cafc5['push'](_0x3cafc5['shift']());}};_0x3684b6(++_0x1f5b86);}(_0x27b5,0x1a3));var _0x527b=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x27b5[_0x121886];return _0x20ca01;};'use strict';var express=require('express');var passport=require(_0x527b('0x0'));var router=express[_0x527b('0x1')]();var controller=require(_0x527b('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x527b('0x3'));router['get']('/',controller[_0x527b('0x4')]);router[_0x527b('0x5')](_0x527b('0x6'),controller[_0x527b('0x7')],authService['isMiddleware'],userController[_0x527b('0x4')],authService['setTokenCookie']);module[_0x527b('0x8')]=router; \ No newline at end of file +var _0x9deb=['get','login','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../../components/auth/service'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x9deb,0x12d));var _0xb9de=function(_0x3788a4,_0x3b177d){_0x3788a4=_0x3788a4-0x0;var _0x21bba6=_0x9deb[_0x3788a4];return _0x21bba6;};'use strict';var express=require('express');var passport=require(_0xb9de('0x0'));var router=express['Router']();var controller=require(_0xb9de('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0xb9de('0x2'));router[_0xb9de('0x3')]('/',controller[_0xb9de('0x4')]);router[_0xb9de('0x3')]('/callback',controller['callback'],authService[_0xb9de('0x5')],userController[_0xb9de('0x4')],authService[_0xb9de('0x6')]);module[_0xb9de('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index a9e9bf3..c685d05 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 _0xa80d=['json','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','allowedLoginAttempts','User','find','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','Setting','blockDuration','then','findOne','password','role','blocked','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','disabled','blockedAt','getLicense','catch','MailAccount','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','SendMail','error','format','message','stringify','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x2c0cb6,_0x58d6b2){var _0x43f396=function(_0x15a7aa){while(--_0x15a7aa){_0x2c0cb6['push'](_0x2c0cb6['shift']());}};_0x43f396(++_0x58d6b2);}(_0xa80d,0x100));var _0xda80=function(_0x36c34e,_0x5ed2c7){_0x36c34e=_0x36c34e-0x0;var _0x4c6947=_0xa80d[_0x36c34e];return _0x4c6947;};'use strict';var util=require(_0xda80('0x0'));var passport=require(_0xda80('0x1'));var LocalStrategy=require(_0xda80('0x2'))[_0xda80('0x3')];var jayson=require(_0xda80('0x4'));var _=require(_0xda80('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xda80('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x25d2a6,_0x30f92c,_0x389616,_0x1122b6){var _0x67a441,_0x4e253e;return db[_0xda80('0x7')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xda80('0x8')],'raw':!![]})[_0xda80('0x9')](function(_0x2d1c1){_0x67a441=_0x2d1c1;return _0x25d2a6[_0xda80('0xa')]({'attributes':['id','name',_0xda80('0xb'),'salt',_0xda80('0xc'),'disabled',_0xda80('0xd'),'blockedAt','loginAttempts'],'where':{'name':_0x30f92c,'role':{'$or':['admin',_0xda80('0xe'),'agent']}}});})['then'](function(_0x446233){if(!_0x446233||_0x446233&&_0x446233[_0xda80('0xf')]!==_0x30f92c){throw new Error(_0xda80('0x10'));}else{_0x4e253e=_0x446233;return _0x4e253e;}})[_0xda80('0x9')](function(){_0x4e253e[_0xda80('0x11')](_0x389616,function(_0x1171d6,_0x411ce6){var _0x17e5a3=_0x4e253e[_0xda80('0x12')]+0x1;if(_0x1171d6){return _0x1122b6(_0x1171d6);}else if(!_0x411ce6){if(_0x4e253e['disabled']){return _0x1122b6(null,![],{'message':_0xda80('0x10')});}else if(_0x67a441['allowedLoginAttempts']>0x0){if(_0x4e253e[_0xda80('0xd')]){if(_0x67a441[_0xda80('0x8')]>0x0){if(moment(_0x4e253e['blockedAt'])[_0xda80('0x13')](_0x67a441[_0xda80('0x8')],_0xda80('0x14'))>moment()){return _0x1122b6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xda80('0x15')](_0x4e253e,_0x17e5a3,![],null)[_0xda80('0x9')](function(){return _0x1122b6(null,![],{'message':_0xda80('0x10')});});}}else{return _0x1122b6(null,![],{'message':_0xda80('0x10')});}}else{if(_0x17e5a3>=_0x67a441['allowedLoginAttempts']){return utils['clearBlockUser'](_0x4e253e,0x0,!![],moment())[_0xda80('0x9')](function(){return _0x1122b6(null,![],{'message':_0xda80('0x10')});});}else{return utils['clearBlockUser'](_0x4e253e,_0x17e5a3,![],null)['then'](function(){return _0x1122b6(null,![],{'message':_0xda80('0x10')});});}}}else{return _0x1122b6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4e253e[_0xda80('0x16')]){return _0x1122b6(null,![],{'message':_0xda80('0x10')});}else if(_0x67a441['allowedLoginAttempts']>0x0){if(_0x4e253e[_0xda80('0xd')]){if(_0x67a441['blockDuration']>0x0){if(moment(_0x4e253e[_0xda80('0x17')])['add'](_0x67a441[_0xda80('0x8')],'minutes')>moment()){return _0x1122b6(null,![],{'message':_0xda80('0x10')});}else{return utils['clearBlockUser'](_0x4e253e,0x0,![],null)['then'](function(){return utils[_0xda80('0x18')](_0x4e253e);})[_0xda80('0x9')](function(){return _0x1122b6(null,_0x4e253e);});}}else{return _0x1122b6(null,![],{'message':_0xda80('0x10')});}}else{return utils['clearBlockUser'](_0x4e253e,0x0,![],null)['then'](function(){return utils[_0xda80('0x18')](_0x4e253e);})[_0xda80('0x9')](function(){return _0x1122b6(null,_0x4e253e);})[_0xda80('0x19')](function(_0x3b8249){return _0x1122b6(null,![],_0x3b8249);});}}else{if(_0x4e253e[_0xda80('0xd')]){return _0x1122b6(null,![],{'message':_0xda80('0x10')});}else{return utils[_0xda80('0x18')](_0x4e253e)[_0xda80('0x9')](function(){return _0x1122b6(null,_0x4e253e);});}}}});})[_0xda80('0x19')](function(_0x510a58){return _0x1122b6(null,![],_0x510a58);});}function sendServiceMail(_0x3ea3b8){return db[_0xda80('0x1a')]['find']({'where':{'service':!![]},'attributes':['id',_0xda80('0xf'),_0xda80('0x1b')],'include':[{'model':db['MailServerOut'],'as':_0xda80('0x1c'),'include':[{'model':db[_0xda80('0x1d')],'as':_0xda80('0x1d')}]}]})['then'](function(_0x396ff7){if(!_0x396ff7){throw new Error(_0xda80('0x1e'));}var _0x39e251=_0x396ff7[_0xda80('0x1f')]();var _0x5f31fd={'account':_0x39e251,'message':_[_0xda80('0x20')]({'from':util['format'](_0xda80('0x21'),_0x396ff7[_0xda80('0xf')],_0x396ff7['email']||_0x396ff7[_0xda80('0x1c')][_0xda80('0xe')])},_0x3ea3b8)};return client['request'](_0xda80('0x22'),_0x5f31fd);})[_0xda80('0x9')](function(_0x3c21cf){if(_0x3c21cf[_0xda80('0x23')]){throw new Error(util[_0xda80('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3c21cf[_0xda80('0x23')][_0xda80('0x25')]||JSON[_0xda80('0x26')](_0x3c21cf[_0xda80('0x23')])));}return!![];});}function handleError(_0x4f9059,_0x1eaac9,_0x514c61){return _0x4f9059[_0xda80('0x27')](_0x1eaac9||0x1f4)['send']({'message':_0x514c61?_0x514c61['message']||_0x514c61:''});}exports[_0xda80('0x28')]=function(_0x5be800,_0x1b3aec,_0x31fb4a){passport[_0xda80('0x11')](_0xda80('0x29'),function(_0x3b7481,_0x51502f,_0x5799e9){var _0x35d385=_0x3b7481||_0x5799e9;if(_0x35d385){return handleError(_0x1b3aec,0x191,_0x35d385);}if(!_0x51502f){return handleError(_0x1b3aec,0x194,{'message':_0xda80('0x2a')});}else{var _0x47e0ea={'payload':{'id':_0x51502f['id'],'role':_0x51502f[_0xda80('0xc')]},'options':{'expiresIn':0x15180}};return authService[_0xda80('0x2b')](_0x47e0ea)[_0xda80('0x9')](function(_0x3a45a0){_0x1b3aec[_0xda80('0x2c')]({'id':_0x51502f['id'],'token':_0x3a45a0,'statusCall':'','isAlreadyLogged':_0x51502f['online']});});}})(_0x5be800,_0x1b3aec,_0x31fb4a);};exports[_0xda80('0x2d')]=function(_0x1de48e,_0x3560e7){if(!_0x1de48e[_0xda80('0x2e')][_0xda80('0x1b')]){return handleError(_0x3560e7,0x1f4,{'message':_0xda80('0x2f')});}var _0x2227bf=rs[_0xda80('0x30')]();_0x1de48e[_0xda80('0x2e')][_0xda80('0x1b')]=_0x1de48e[_0xda80('0x2e')][_0xda80('0x1b')]['trim']()[_0xda80('0x31')]();var _0x4035a5;return db['Setting'][_0xda80('0xa')]({'where':{'id':0x1},'attributes':[_0xda80('0x32'),_0xda80('0x8')],'raw':!![]})['then'](function(_0x3761ef){_0x4035a5=_0x3761ef;return db[_0xda80('0x33')][_0xda80('0x34')]({'where':{'email':_0x1de48e[_0xda80('0x2e')][_0xda80('0x1b')]}});})[_0xda80('0x9')](function(_0x3bf509){if(!_0x3bf509){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3bf509['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3bf509[_0xda80('0xd')]){if(moment(_0x3bf509['blockedAt'])[_0xda80('0x13')](_0x4035a5[_0xda80('0x8')],_0xda80('0x14'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3bf509['blocked']=![];_0x3bf509[_0xda80('0x17')]=null;}}_0x3bf509[_0xda80('0x35')]=_0x2227bf;_0x3bf509[_0xda80('0x36')]=Date['now']()+0x36ee80;return _0x3bf509[_0xda80('0x37')]();})['then'](function(){return sendServiceMail({'to':_0x1de48e[_0xda80('0x2e')][_0xda80('0x1b')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xda80('0x38')+_0xda80('0x39')+'https://'+_0x1de48e[_0xda80('0x3a')][_0xda80('0x3b')]+_0xda80('0x3c')+_0x2227bf+'\x0a\x0a'+_0xda80('0x3d')});})['then'](function(){_0x3560e7[_0xda80('0x27')](0xc8)[_0xda80('0x3e')]({'message':_0xda80('0x3f')});})[_0xda80('0x19')](function(_0x29c073){return handleError(_0x3560e7,0x1f4,_0x29c073);});};exports[_0xda80('0x40')]=function(_0x3d7c5b,_0x5d3266){return db[_0xda80('0x33')][_0xda80('0x34')]({'where':{'resetPasswordToken':_0x3d7c5b[_0xda80('0x41')][_0xda80('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xda80('0x9')](function(_0x57f3cb){if(!_0x57f3cb){throw new Error(_0xda80('0x43'));}return db[_0xda80('0x7')][_0xda80('0xa')]({'attributes':['id',_0xda80('0x44'),_0xda80('0x45'),_0xda80('0x46')]})[_0xda80('0x9')](function(_0xd85033){if(_0xd85033['securePassword'])authService['validatePasswordPattern'](_0x3d7c5b[_0xda80('0x2e')][_0xda80('0xb')]);if(!_0xd85033['enforcePasswordHistory']||!_0x57f3cb[_0xda80('0x47')])return _0x57f3cb;authService[_0xda80('0x48')](_0x3d7c5b['body']['password'],_0x57f3cb[_0xda80('0x47')],_0xd85033[_0xda80('0x46')]);return _0x57f3cb;})[_0xda80('0x9')](function(){_0x57f3cb[_0xda80('0xb')]=_0x3d7c5b[_0xda80('0x2e')][_0xda80('0xb')];_0x57f3cb[_0xda80('0x35')]=null;_0x57f3cb['resetPasswordExpires']=null;return _0x57f3cb[_0xda80('0x37')]();});})[_0xda80('0x9')](function(){_0x5d3266['status'](0xc8)[_0xda80('0x3e')]({'message':_0xda80('0x49')});})[_0xda80('0x19')](function(_0xa1e6b6){return handleError(_0x5d3266,0x1f4,_0xa1e6b6);});};passport[_0xda80('0x4a')](_0xda80('0x29'),new LocalStrategy({'usernameField':_0xda80('0xf'),'passwordField':_0xda80('0xb')},function(_0x1f44ae,_0x1e254f,_0x3c0590){return localAuthenticate(db[_0xda80('0x33')],_0x1f44ae,_0x1e254f,_0x3c0590);})); \ No newline at end of file +var _0x9e41=['authenticate','blocked','clearBlockUser','disabled','add','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','resetPasswordExpires','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','blockDuration','then','name','password','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9e41,0x1cf));var _0x19e4=function(_0x13f93e,_0x310b7d){_0x13f93e=_0x13f93e-0x0;var _0x362548=_0x9e41[_0x13f93e];return _0x362548;};'use strict';var util=require(_0x19e4('0x0'));var passport=require('passport');var LocalStrategy=require(_0x19e4('0x1'))[_0x19e4('0x2')];var jayson=require(_0x19e4('0x3'));var _=require(_0x19e4('0x4'));var rs=require(_0x19e4('0x5'));var moment=require(_0x19e4('0x6'));var db=require(_0x19e4('0x7'))['db'];var authService=require(_0x19e4('0x8'));var utils=require(_0x19e4('0x9'));var client=jayson[_0x19e4('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x695c2,_0x58b07c,_0xb4e94a,_0x10f672){var _0x133767,_0x3291d8;return db['Setting'][_0x19e4('0xb')]({'where':{'id':0x1},'attributes':[_0x19e4('0xc'),_0x19e4('0xd')],'raw':!![]})[_0x19e4('0xe')](function(_0x2545f0){_0x133767=_0x2545f0;return _0x695c2[_0x19e4('0xb')]({'attributes':['id',_0x19e4('0xf'),_0x19e4('0x10'),'salt','role','disabled','blocked',_0x19e4('0x11'),_0x19e4('0x12')],'where':{'name':_0x58b07c,'role':{'$or':[_0x19e4('0x13'),_0x19e4('0x14'),_0x19e4('0x15')]}}});})['then'](function(_0x91c007){if(!_0x91c007||_0x91c007&&_0x91c007['name']!==_0x58b07c){throw new Error(_0x19e4('0x16'));}else{_0x3291d8=_0x91c007;return _0x3291d8;}})[_0x19e4('0xe')](function(){_0x3291d8[_0x19e4('0x17')](_0xb4e94a,function(_0x5929c6,_0x5f49b7){var _0x5ca672=_0x3291d8[_0x19e4('0x12')]+0x1;if(_0x5929c6){return _0x10f672(_0x5929c6);}else if(!_0x5f49b7){if(_0x3291d8['disabled']){return _0x10f672(null,![],{'message':_0x19e4('0x16')});}else if(_0x133767[_0x19e4('0xc')]>0x0){if(_0x3291d8[_0x19e4('0x18')]){if(_0x133767[_0x19e4('0xd')]>0x0){if(moment(_0x3291d8['blockedAt'])['add'](_0x133767[_0x19e4('0xd')],'minutes')>moment()){return _0x10f672(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x19e4('0x19')](_0x3291d8,_0x5ca672,![],null)[_0x19e4('0xe')](function(){return _0x10f672(null,![],{'message':_0x19e4('0x16')});});}}else{return _0x10f672(null,![],{'message':_0x19e4('0x16')});}}else{if(_0x5ca672>=_0x133767[_0x19e4('0xc')]){return utils[_0x19e4('0x19')](_0x3291d8,0x0,!![],moment())[_0x19e4('0xe')](function(){return _0x10f672(null,![],{'message':_0x19e4('0x16')});});}else{return utils[_0x19e4('0x19')](_0x3291d8,_0x5ca672,![],null)['then'](function(){return _0x10f672(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x10f672(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3291d8[_0x19e4('0x1a')]){return _0x10f672(null,![],{'message':_0x19e4('0x16')});}else if(_0x133767['allowedLoginAttempts']>0x0){if(_0x3291d8[_0x19e4('0x18')]){if(_0x133767[_0x19e4('0xd')]>0x0){if(moment(_0x3291d8[_0x19e4('0x11')])[_0x19e4('0x1b')](_0x133767[_0x19e4('0xd')],_0x19e4('0x1c'))>moment()){return _0x10f672(null,![],{'message':_0x19e4('0x16')});}else{return utils[_0x19e4('0x19')](_0x3291d8,0x0,![],null)[_0x19e4('0xe')](function(){return utils[_0x19e4('0x1d')](_0x3291d8);})['then'](function(){return _0x10f672(null,_0x3291d8);});}}else{return _0x10f672(null,![],{'message':_0x19e4('0x16')});}}else{return utils[_0x19e4('0x19')](_0x3291d8,0x0,![],null)[_0x19e4('0xe')](function(){return utils[_0x19e4('0x1d')](_0x3291d8);})[_0x19e4('0xe')](function(){return _0x10f672(null,_0x3291d8);})[_0x19e4('0x1e')](function(_0x54baec){return _0x10f672(null,![],_0x54baec);});}}else{if(_0x3291d8[_0x19e4('0x18')]){return _0x10f672(null,![],{'message':_0x19e4('0x16')});}else{return utils['getLicense'](_0x3291d8)[_0x19e4('0xe')](function(){return _0x10f672(null,_0x3291d8);});}}}});})[_0x19e4('0x1e')](function(_0x21d2e5){return _0x10f672(null,![],_0x21d2e5);});}function sendServiceMail(_0x336354){return db['MailAccount'][_0x19e4('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x19e4('0xf'),_0x19e4('0x20')],'include':[{'model':db[_0x19e4('0x21')],'as':_0x19e4('0x22'),'include':[{'model':db['CloudProvider'],'as':_0x19e4('0x23')}]}]})[_0x19e4('0xe')](function(_0x34eb07){if(!_0x34eb07){throw new Error(_0x19e4('0x24'));}var _0x2ed822=_0x34eb07[_0x19e4('0x25')]();var _0x1f7a23={'account':_0x2ed822,'message':_['merge']({'from':util[_0x19e4('0x26')](_0x19e4('0x27'),_0x34eb07[_0x19e4('0xf')],_0x34eb07[_0x19e4('0x20')]||_0x34eb07['Smtp'][_0x19e4('0x14')])},_0x336354)};return client['request']('SendMail',_0x1f7a23);})[_0x19e4('0xe')](function(_0x1ab442){if(_0x1ab442[_0x19e4('0x28')]){throw new Error(util['format'](_0x19e4('0x29'),_0x1ab442[_0x19e4('0x28')][_0x19e4('0x2a')]||JSON[_0x19e4('0x2b')](_0x1ab442[_0x19e4('0x28')])));}return!![];});}function handleError(_0x32e4ae,_0x3f05bd,_0x582604){return _0x32e4ae[_0x19e4('0x2c')](_0x3f05bd||0x1f4)['send']({'message':_0x582604?_0x582604[_0x19e4('0x2a')]||_0x582604:''});}exports['login']=function(_0x3e753a,_0x264acd,_0x2a0131){passport[_0x19e4('0x17')](_0x19e4('0x2d'),function(_0x1830ae,_0x4e0b7a,_0x225667){var _0x2b9d09=_0x1830ae||_0x225667;if(_0x2b9d09){return handleError(_0x264acd,0x191,_0x2b9d09);}if(!_0x4e0b7a){return handleError(_0x264acd,0x194,{'message':_0x19e4('0x2e')});}else{var _0x53decb={'payload':{'id':_0x4e0b7a['id'],'role':_0x4e0b7a['role']},'options':{'expiresIn':0x15180}};return authService[_0x19e4('0x2f')](_0x53decb)['then'](function(_0x258536){_0x264acd[_0x19e4('0x30')]({'id':_0x4e0b7a['id'],'token':_0x258536,'statusCall':'','isAlreadyLogged':_0x4e0b7a[_0x19e4('0x31')]});});}})(_0x3e753a,_0x264acd,_0x2a0131);};exports[_0x19e4('0x32')]=function(_0x569997,_0x5261b8){if(!_0x569997['body']['email']){return handleError(_0x5261b8,0x1f4,{'message':_0x19e4('0x33')});}var _0x4b0137=rs[_0x19e4('0x34')]();_0x569997['body'][_0x19e4('0x20')]=_0x569997[_0x19e4('0x35')][_0x19e4('0x20')][_0x19e4('0x36')]()['toLowerCase']();var _0x247324;return db[_0x19e4('0x37')][_0x19e4('0xb')]({'where':{'id':0x1},'attributes':[_0x19e4('0xc'),'blockDuration'],'raw':!![]})[_0x19e4('0xe')](function(_0x439f29){_0x247324=_0x439f29;return db['User'][_0x19e4('0x1f')]({'where':{'email':_0x569997[_0x19e4('0x35')][_0x19e4('0x20')]}});})['then'](function(_0x221877){if(!_0x221877){throw new Error(_0x19e4('0x38'));}if(_0x221877[_0x19e4('0x1a')]){throw new Error(_0x19e4('0x39'));}if(_0x221877[_0x19e4('0x18')]){if(moment(_0x221877[_0x19e4('0x11')])[_0x19e4('0x1b')](_0x247324[_0x19e4('0xd')],_0x19e4('0x1c'))>moment()){throw new Error(_0x19e4('0x3a'));}else{_0x221877[_0x19e4('0x18')]=![];_0x221877[_0x19e4('0x11')]=null;}}_0x221877[_0x19e4('0x3b')]=_0x4b0137;_0x221877['resetPasswordExpires']=Date[_0x19e4('0x3c')]()+0x36ee80;return _0x221877[_0x19e4('0x3d')]();})[_0x19e4('0xe')](function(){return sendServiceMail({'to':_0x569997['body'][_0x19e4('0x20')],'subject':_0x19e4('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x19e4('0x3f')+_0x19e4('0x40')+_0x569997[_0x19e4('0x41')]['host']+'/reset/'+_0x4b0137+'\x0a\x0a'+_0x19e4('0x42')});})[_0x19e4('0xe')](function(){_0x5261b8[_0x19e4('0x2c')](0xc8)[_0x19e4('0x43')]({'message':'Reset\x20Email\x20sent!'});})[_0x19e4('0x1e')](function(_0x491560){return handleError(_0x5261b8,0x1f4,_0x491560);});};exports['reset']=function(_0x255be7,_0x1403c2){return db[_0x19e4('0x44')]['find']({'where':{'resetPasswordToken':_0x255be7[_0x19e4('0x45')][_0x19e4('0x46')],'resetPasswordExpires':{'$gt':Date[_0x19e4('0x3c')]()}}})[_0x19e4('0xe')](function(_0x2d8303){if(!_0x2d8303){throw new Error(_0x19e4('0x47'));}return db[_0x19e4('0x37')][_0x19e4('0xb')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x19e4('0x48')]})['then'](function(_0x2181ef){if(_0x2181ef[_0x19e4('0x49')])authService[_0x19e4('0x4a')](_0x255be7['body'][_0x19e4('0x10')]);if(!_0x2181ef[_0x19e4('0x4b')]||!_0x2d8303['previousPasswords'])return _0x2d8303;authService[_0x19e4('0x4c')](_0x255be7[_0x19e4('0x35')][_0x19e4('0x10')],_0x2d8303[_0x19e4('0x4d')],_0x2181ef[_0x19e4('0x48')]);return _0x2d8303;})[_0x19e4('0xe')](function(){_0x2d8303['password']=_0x255be7[_0x19e4('0x35')][_0x19e4('0x10')];_0x2d8303['resetPasswordToken']=null;_0x2d8303[_0x19e4('0x4e')]=null;return _0x2d8303[_0x19e4('0x3d')]();});})['then'](function(){_0x1403c2[_0x19e4('0x2c')](0xc8)[_0x19e4('0x43')]({'message':_0x19e4('0x4f')});})['catch'](function(_0x3e951b){return handleError(_0x1403c2,0x1f4,_0x3e951b);});};passport[_0x19e4('0x50')](_0x19e4('0x2d'),new LocalStrategy({'usernameField':_0x19e4('0xf'),'passwordField':_0x19e4('0x10')},function(_0x363154,_0x1b1f70,_0x492402){return localAuthenticate(db[_0x19e4('0x44')],_0x363154,_0x1b1f70,_0x492402);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 64c48cf..dc4e6f0 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 _0x6ede=['exports','express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x6ede,0x159));var _0xe6ed=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x6ede[_0x3a2a3c];return _0x50ac9a;};'use strict';var express=require(_0xe6ed('0x0'));var router=express['Router']();var controller=require(_0xe6ed('0x1'));router[_0xe6ed('0x2')]('/',controller[_0xe6ed('0x3')]);router['post'](_0xe6ed('0x4'),controller[_0xe6ed('0x5')]);router[_0xe6ed('0x2')](_0xe6ed('0x6'),controller['reset']);module[_0xe6ed('0x7')]=router; \ No newline at end of file +var _0xb9e4=['express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x1bb0eb,_0x5ce0a0){var _0x31e097=function(_0x4c89e5){while(--_0x4c89e5){_0x1bb0eb['push'](_0x1bb0eb['shift']());}};_0x31e097(++_0x5ce0a0);}(_0xb9e4,0x183));var _0x4b9e=function(_0x4e317a,_0x30e4c2){_0x4e317a=_0x4e317a-0x0;var _0x39635b=_0xb9e4[_0x4e317a];return _0x39635b;};'use strict';var express=require(_0x4b9e('0x0'));var router=express[_0x4b9e('0x1')]();var controller=require(_0x4b9e('0x2'));router[_0x4b9e('0x3')]('/',controller[_0x4b9e('0x4')]);router[_0x4b9e('0x3')](_0x4b9e('0x5'),controller[_0x4b9e('0x6')]);router[_0x4b9e('0x3')](_0x4b9e('0x7'),controller['reset']);module[_0x4b9e('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f1aa564..1420ad4 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 _0x3002=['exports','STRING','INTEGER'];(function(_0x1a6595,_0x2a44e8){var _0x27a9a2=function(_0x23ce15){while(--_0x23ce15){_0x1a6595['push'](_0x1a6595['shift']());}};_0x27a9a2(++_0x2a44e8);}(_0x3002,0x1a1));var _0x2300=function(_0x256f07,_0x157d25){_0x256f07=_0x256f07-0x0;var _0x4e592f=_0x3002[_0x256f07];return _0x4e592f;};'use strict';var Sequelize=require('sequelize');module[_0x2300('0x0')]={'name':{'type':Sequelize[_0x2300('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2300('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2300('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xa49d=['STRING','BOOLEAN','exports'];(function(_0x1c8017,_0x34aff3){var _0x5e443f=function(_0x408aab){while(--_0x408aab){_0x1c8017['push'](_0x1c8017['shift']());}};_0x5e443f(++_0x34aff3);}(_0xa49d,0x80));var _0xda49=function(_0x537aa0,_0x44c227){_0x537aa0=_0x537aa0-0x0;var _0x233590=_0xa49d[_0x537aa0];return _0x233590;};'use strict';var Sequelize=require('sequelize');module[_0xda49('0x0')]={'name':{'type':Sequelize[_0xda49('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xda49('0x1')]},'description':{'type':Sequelize[_0xda49('0x1')]},'status':{'type':Sequelize[_0xda49('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 6eb1957..bb66172 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 _0x8bdd=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','fields','find','catch','create','body','params','addConditions','Condition','ids','getConditions','addActions','Action','omit','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','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','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length'];(function(_0x3142b0,_0x4566c0){var _0x3bc0a8=function(_0x3b7886){while(--_0x3b7886){_0x3142b0['push'](_0x3142b0['shift']());}};_0x3bc0a8(++_0x4566c0);}(_0x8bdd,0x128));var _0xd8bd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8bdd[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xd8bd('0x0'));var rimraf=require(_0xd8bd('0x1'));var zipdir=require(_0xd8bd('0x2'));var jsonpatch=require(_0xd8bd('0x3'));var rp=require(_0xd8bd('0x4'));var moment=require(_0xd8bd('0x5'));var BPromise=require(_0xd8bd('0x6'));var Mustache=require(_0xd8bd('0x7'));var util=require(_0xd8bd('0x8'));var path=require(_0xd8bd('0x9'));var sox=require(_0xd8bd('0xa'));var csv=require(_0xd8bd('0xb'));var ejs=require(_0xd8bd('0xc'));var fs=require('fs');var fs_extra=require(_0xd8bd('0xd'));var _=require(_0xd8bd('0xe'));var squel=require(_0xd8bd('0xf'));var crypto=require('crypto');var jsforce=require(_0xd8bd('0x10'));var deskjs=require(_0xd8bd('0x11'));var toCsv=require(_0xd8bd('0xb'));var querystring=require(_0xd8bd('0x12'));var Papa=require(_0xd8bd('0x13'));var Redis=require(_0xd8bd('0x14'));var authService=require(_0xd8bd('0x15'));var qs=require(_0xd8bd('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8bd('0x17'))(_0xd8bd('0x18'));var utils=require('../../config/utils');var config=require(_0xd8bd('0x19'));var licenseUtil=require(_0xd8bd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24af00,_0x3ed2ed){_0x3ed2ed=_0x3ed2ed||0xcc;return function(_0x2166cd){if(_0x2166cd){return _0x24af00[_0xd8bd('0x1b')](_0x3ed2ed);}return _0x24af00[_0xd8bd('0x1c')](_0x3ed2ed)[_0xd8bd('0x1d')]();};}function respondWithResult(_0x51fc0b,_0x23baf8){_0x23baf8=_0x23baf8||0xc8;return function(_0x4eb342){if(_0x4eb342){return _0x51fc0b[_0xd8bd('0x1c')](_0x23baf8)[_0xd8bd('0x1e')](_0x4eb342);}};}function respondWithFilteredResult(_0x5a3e09,_0x7e7bb9){return function(_0x1b28a0){if(_0x1b28a0){var _0x376413=typeof _0x7e7bb9[_0xd8bd('0x1f')]===_0xd8bd('0x20')&&typeof _0x7e7bb9[_0xd8bd('0x21')]===_0xd8bd('0x20');var _0x3b359d=_0x1b28a0[_0xd8bd('0x22')];var _0x21b93d=_0x376413?0x0:_0x7e7bb9[_0xd8bd('0x1f')];var _0x198822=_0x376413?_0x1b28a0['count']:_0x7e7bb9['offset']+_0x7e7bb9['limit'];var _0x2e0f7f;if(_0x198822>=_0x3b359d){_0x198822=_0x3b359d;_0x2e0f7f=0xc8;}else{_0x2e0f7f=0xce;}_0x5a3e09[_0xd8bd('0x1c')](_0x2e0f7f);return _0x5a3e09[_0xd8bd('0x23')](_0xd8bd('0x24'),_0x21b93d+'-'+_0x198822+'/'+_0x3b359d)['json'](_0x1b28a0);}return null;};}function patchUpdates(_0xc00ae8){return function(_0x353379){try{jsonpatch[_0xd8bd('0x25')](_0x353379,_0xc00ae8,!![]);}catch(_0x336336){return BPromise[_0xd8bd('0x26')](_0x336336);}return _0x353379[_0xd8bd('0x27')]();};}function saveUpdates(_0x5e94c1,_0x401929){return function(_0xfe1da5){if(_0xfe1da5){return _0xfe1da5[_0xd8bd('0x28')](_0x5e94c1)[_0xd8bd('0x29')](function(_0x324b39){return _0x324b39;});}return null;};}function removeEntity(_0xc4eb10,_0x423266){return function(_0x2692ef){if(_0x2692ef){return _0x2692ef[_0xd8bd('0x2a')]()[_0xd8bd('0x29')](function(){_0xc4eb10[_0xd8bd('0x1c')](0xcc)[_0xd8bd('0x1d')]();});}};}function handleEntityNotFound(_0x27d591,_0x4bbc9c){return function(_0x31190b){if(!_0x31190b){_0x27d591['sendStatus'](0x194);}return _0x31190b;};}function handleError(_0x5ac06e,_0x34530b){_0x34530b=_0x34530b||0x1f4;return function(_0x3a013b){logger[_0xd8bd('0x2b')](_0x3a013b[_0xd8bd('0x2c')]);if(_0x3a013b[_0xd8bd('0x2d')]){delete _0x3a013b[_0xd8bd('0x2d')];}_0x5ac06e['status'](_0x34530b)[_0xd8bd('0x2e')](_0x3a013b);};}exports[_0xd8bd('0x2f')]=function(_0x4e64b4,_0x155114){var _0x1054d0={},_0x499c3c={},_0x5e0714={'count':0x0,'rows':[]};var _0xc89c21=_[_0xd8bd('0x30')](db['Automation'][_0xd8bd('0x31')],function(_0x43f6f0){return{'name':_0x43f6f0[_0xd8bd('0x32')],'type':_0x43f6f0[_0xd8bd('0x33')][_0xd8bd('0x34')]};});_0x499c3c['model']=_[_0xd8bd('0x30')](_0xc89c21,_0xd8bd('0x2d'));_0x499c3c[_0xd8bd('0x35')]=_[_0xd8bd('0x36')](_0x4e64b4[_0xd8bd('0x35')]);_0x499c3c[_0xd8bd('0x37')]=_[_0xd8bd('0x38')](_0x499c3c[_0xd8bd('0x39')],_0x499c3c[_0xd8bd('0x35')]);_0x1054d0[_0xd8bd('0x3a')]=_['intersection'](_0x499c3c[_0xd8bd('0x39')],qs['fields'](_0x4e64b4[_0xd8bd('0x35')]['fields']));_0x1054d0['attributes']=_0x1054d0[_0xd8bd('0x3a')][_0xd8bd('0x3b')]?_0x1054d0[_0xd8bd('0x3a')]:_0x499c3c[_0xd8bd('0x39')];if(!_0x4e64b4[_0xd8bd('0x35')][_0xd8bd('0x3c')](_0xd8bd('0x3d'))){_0x1054d0['limit']=qs['limit'](_0x4e64b4['query']['limit']);_0x1054d0[_0xd8bd('0x1f')]=qs['offset'](_0x4e64b4[_0xd8bd('0x35')][_0xd8bd('0x1f')]);}_0x1054d0[_0xd8bd('0x3e')]=qs[_0xd8bd('0x3f')](_0x4e64b4[_0xd8bd('0x35')][_0xd8bd('0x3f')]);_0x1054d0[_0xd8bd('0x40')]=qs[_0xd8bd('0x37')](_[_0xd8bd('0x41')](_0x4e64b4[_0xd8bd('0x35')],_0x499c3c[_0xd8bd('0x37')]),_0xc89c21);if(_0x4e64b4[_0xd8bd('0x35')][_0xd8bd('0x42')]){_0x1054d0[_0xd8bd('0x40')]=_[_0xd8bd('0x43')](_0x1054d0['where'],{'$or':_['map'](_0xc89c21,function(_0x179c32){if(_0x179c32[_0xd8bd('0x33')]!==_0xd8bd('0x44')){var _0x347dcd={};_0x347dcd[_0x179c32[_0xd8bd('0x2d')]]={'$like':'%'+_0x4e64b4[_0xd8bd('0x35')][_0xd8bd('0x42')]+'%'};return _0x347dcd;}})});}_0x1054d0=_[_0xd8bd('0x43')]({},_0x1054d0,_0x4e64b4[_0xd8bd('0x45')]);var _0x40dcef={'where':_0x1054d0[_0xd8bd('0x40')]};return db[_0xd8bd('0x46')][_0xd8bd('0x22')](_0x40dcef)[_0xd8bd('0x29')](function(_0xc14fc1){_0x5e0714[_0xd8bd('0x22')]=_0xc14fc1;if(_0x4e64b4[_0xd8bd('0x35')][_0xd8bd('0x47')]){_0x1054d0[_0xd8bd('0x48')]=[{'all':!![]}];}return db[_0xd8bd('0x46')][_0xd8bd('0x49')](_0x1054d0);})[_0xd8bd('0x29')](function(_0x569eee){_0x5e0714['rows']=_0x569eee;return _0x5e0714;})[_0xd8bd('0x29')](respondWithFilteredResult(_0x155114,_0x1054d0))['catch'](handleError(_0x155114,null));};exports['show']=function(_0x1cc325,_0x3a3458){var _0x8a84ae={'raw':![],'where':{'id':_0x1cc325['params']['id']}},_0x559c5d={};_0x559c5d[_0xd8bd('0x39')]=_['keys'](db[_0xd8bd('0x46')][_0xd8bd('0x31')]);_0x559c5d[_0xd8bd('0x35')]=_[_0xd8bd('0x36')](_0x1cc325['query']);_0x559c5d[_0xd8bd('0x37')]=_[_0xd8bd('0x38')](_0x559c5d[_0xd8bd('0x39')],_0x559c5d[_0xd8bd('0x35')]);_0x8a84ae['attributes']=_[_0xd8bd('0x38')](_0x559c5d['model'],qs[_0xd8bd('0x4a')](_0x1cc325['query'][_0xd8bd('0x4a')]));_0x8a84ae[_0xd8bd('0x3a')]=_0x8a84ae[_0xd8bd('0x3a')]['length']?_0x8a84ae[_0xd8bd('0x3a')]:_0x559c5d[_0xd8bd('0x39')];if(_0x1cc325['query'][_0xd8bd('0x47')]){_0x8a84ae[_0xd8bd('0x48')]=[{'all':!![]}];}_0x8a84ae=_[_0xd8bd('0x43')]({},_0x8a84ae,_0x1cc325[_0xd8bd('0x45')]);return db[_0xd8bd('0x46')][_0xd8bd('0x4b')](_0x8a84ae)[_0xd8bd('0x29')](handleEntityNotFound(_0x3a3458,null))[_0xd8bd('0x29')](respondWithResult(_0x3a3458,null))[_0xd8bd('0x4c')](handleError(_0x3a3458,null));};exports[_0xd8bd('0x4d')]=function(_0xf90aa1,_0x4d074f){return db[_0xd8bd('0x46')][_0xd8bd('0x4d')](_0xf90aa1[_0xd8bd('0x4e')],{})[_0xd8bd('0x29')](respondWithResult(_0x4d074f,0xc9))[_0xd8bd('0x4c')](handleError(_0x4d074f,null));};exports[_0xd8bd('0x28')]=function(_0x3d1f7e,_0x46076d){if(_0x3d1f7e[_0xd8bd('0x4e')]['id']){delete _0x3d1f7e[_0xd8bd('0x4e')]['id'];}return db[_0xd8bd('0x46')][_0xd8bd('0x4b')]({'where':{'id':_0x3d1f7e[_0xd8bd('0x4f')]['id']}})[_0xd8bd('0x29')](handleEntityNotFound(_0x46076d,null))[_0xd8bd('0x29')](saveUpdates(_0x3d1f7e[_0xd8bd('0x4e')],null))[_0xd8bd('0x29')](respondWithResult(_0x46076d,null))[_0xd8bd('0x4c')](handleError(_0x46076d,null));};exports['destroy']=function(_0x130891,_0x4e8852){return db[_0xd8bd('0x46')][_0xd8bd('0x4b')]({'where':{'id':_0x130891[_0xd8bd('0x4f')]['id']}})[_0xd8bd('0x29')](handleEntityNotFound(_0x4e8852,null))[_0xd8bd('0x29')](removeEntity(_0x4e8852,null))['catch'](handleError(_0x4e8852,null));};exports[_0xd8bd('0x50')]=function(_0x390b1d,_0x5f48e4,_0x4f60d4){return db[_0xd8bd('0x51')][_0xd8bd('0x4b')]({'where':{'id':_0x390b1d['params']['id']}})['then'](handleEntityNotFound(_0x5f48e4,null))[_0xd8bd('0x29')](function(_0xe62530){if(_0xe62530){return _0xe62530['addConditions'](_0x390b1d['body'][_0xd8bd('0x52')],_['omit'](_0x390b1d[_0xd8bd('0x4e')],[_0xd8bd('0x52'),'id'])||{});}})['then'](respondWithResult(_0x5f48e4,null))['catch'](handleError(_0x5f48e4,null));};exports[_0xd8bd('0x53')]=function(_0x185bdc,_0x14380b,_0x495a2f){var _0x3afcea={};var _0x52f297={};var _0x47784d;var _0x66eec9;return db[_0xd8bd('0x46')]['findOne']({'where':{'id':_0x185bdc[_0xd8bd('0x4f')]['id']}})[_0xd8bd('0x29')](handleEntityNotFound(_0x14380b,null))[_0xd8bd('0x29')](function(_0x5af1f3){if(_0x5af1f3){_0x47784d=_0x5af1f3;_0x52f297[_0xd8bd('0x39')]=_[_0xd8bd('0x36')](db['Condition'][_0xd8bd('0x31')]);_0x52f297[_0xd8bd('0x35')]=_['keys'](_0x185bdc[_0xd8bd('0x35')]);_0x52f297[_0xd8bd('0x37')]=_['intersection'](_0x52f297[_0xd8bd('0x39')],_0x52f297[_0xd8bd('0x35')]);_0x3afcea[_0xd8bd('0x3a')]=_[_0xd8bd('0x38')](_0x52f297[_0xd8bd('0x39')],qs[_0xd8bd('0x4a')](_0x185bdc[_0xd8bd('0x35')]['fields']));_0x3afcea[_0xd8bd('0x3a')]=_0x3afcea['attributes']['length']?_0x3afcea['attributes']:_0x52f297[_0xd8bd('0x39')];_0x3afcea[_0xd8bd('0x3e')]=qs[_0xd8bd('0x3f')](_0x185bdc[_0xd8bd('0x35')]['sort']);_0x3afcea[_0xd8bd('0x40')]=qs[_0xd8bd('0x37')](_[_0xd8bd('0x41')](_0x185bdc[_0xd8bd('0x35')],_0x52f297[_0xd8bd('0x37')]));if(_0x185bdc[_0xd8bd('0x35')][_0xd8bd('0x42')]){_0x3afcea[_0xd8bd('0x40')]=_[_0xd8bd('0x43')](_0x3afcea['where'],{'$or':_['map'](_0x3afcea[_0xd8bd('0x3a')],function(_0x193f8a){var _0x11ad43={};_0x11ad43[_0x193f8a]={'$like':'%'+_0x185bdc['query'][_0xd8bd('0x42')]+'%'};return _0x11ad43;})});}_0x3afcea=_[_0xd8bd('0x43')]({},_0x3afcea,_0x185bdc[_0xd8bd('0x45')]);return _0x47784d[_0xd8bd('0x53')](_0x3afcea);}})[_0xd8bd('0x29')](function(_0xb50817){if(_0xb50817){_0x66eec9=_0xb50817[_0xd8bd('0x3b')];if(!_0x185bdc[_0xd8bd('0x35')][_0xd8bd('0x3c')](_0xd8bd('0x3d'))){_0x3afcea[_0xd8bd('0x21')]=qs[_0xd8bd('0x21')](_0x185bdc[_0xd8bd('0x35')][_0xd8bd('0x21')]);_0x3afcea[_0xd8bd('0x1f')]=qs[_0xd8bd('0x1f')](_0x185bdc['query'][_0xd8bd('0x1f')]);}return _0x47784d[_0xd8bd('0x53')](_0x3afcea);}})[_0xd8bd('0x29')](function(_0x2a8be8){if(_0x2a8be8){return _0x2a8be8?{'count':_0x66eec9,'rows':_0x2a8be8}:null;}})[_0xd8bd('0x29')](respondWithResult(_0x14380b,null))[_0xd8bd('0x4c')](handleError(_0x14380b,null));};exports[_0xd8bd('0x54')]=function(_0x3f049a,_0x85fd28,_0x50869b){return db[_0xd8bd('0x55')][_0xd8bd('0x4b')]({'where':{'id':_0x3f049a[_0xd8bd('0x4f')]['id']}})['then'](handleEntityNotFound(_0x85fd28,null))[_0xd8bd('0x29')](function(_0x831b5){if(_0x831b5){return _0x831b5[_0xd8bd('0x54')](_0x3f049a[_0xd8bd('0x4e')][_0xd8bd('0x52')],_[_0xd8bd('0x56')](_0x3f049a[_0xd8bd('0x4e')],[_0xd8bd('0x52'),'id'])||{});}})[_0xd8bd('0x29')](respondWithResult(_0x85fd28,null))[_0xd8bd('0x4c')](handleError(_0x85fd28,null));};exports[_0xd8bd('0x57')]=function(_0x309bff,_0x1bc462,_0x5e4dee){var _0x57df85={};var _0x4e9ea0={};var _0x2e4566;var _0x17a3f0;return db[_0xd8bd('0x46')][_0xd8bd('0x58')]({'where':{'id':_0x309bff[_0xd8bd('0x4f')]['id']}})[_0xd8bd('0x29')](handleEntityNotFound(_0x1bc462,null))[_0xd8bd('0x29')](function(_0x214f3b){if(_0x214f3b){_0x2e4566=_0x214f3b;_0x4e9ea0[_0xd8bd('0x39')]=_['keys'](db[_0xd8bd('0x55')][_0xd8bd('0x31')]);_0x4e9ea0[_0xd8bd('0x35')]=_[_0xd8bd('0x36')](_0x309bff[_0xd8bd('0x35')]);_0x4e9ea0[_0xd8bd('0x37')]=_[_0xd8bd('0x38')](_0x4e9ea0[_0xd8bd('0x39')],_0x4e9ea0[_0xd8bd('0x35')]);_0x57df85['attributes']=_[_0xd8bd('0x38')](_0x4e9ea0[_0xd8bd('0x39')],qs[_0xd8bd('0x4a')](_0x309bff[_0xd8bd('0x35')][_0xd8bd('0x4a')]));_0x57df85[_0xd8bd('0x3a')]=_0x57df85[_0xd8bd('0x3a')][_0xd8bd('0x3b')]?_0x57df85['attributes']:_0x4e9ea0[_0xd8bd('0x39')];_0x57df85[_0xd8bd('0x3e')]=qs[_0xd8bd('0x3f')](_0x309bff[_0xd8bd('0x35')][_0xd8bd('0x3f')]);_0x57df85[_0xd8bd('0x40')]=qs[_0xd8bd('0x37')](_[_0xd8bd('0x41')](_0x309bff[_0xd8bd('0x35')],_0x4e9ea0[_0xd8bd('0x37')]));if(_0x309bff[_0xd8bd('0x35')][_0xd8bd('0x42')]){_0x57df85[_0xd8bd('0x40')]=_[_0xd8bd('0x43')](_0x57df85[_0xd8bd('0x40')],{'$or':_[_0xd8bd('0x30')](_0x57df85['attributes'],function(_0x3e8c9c){var _0x2f9469={};_0x2f9469[_0x3e8c9c]={'$like':'%'+_0x309bff['query'][_0xd8bd('0x42')]+'%'};return _0x2f9469;})});}_0x57df85=_['merge']({},_0x57df85,_0x309bff[_0xd8bd('0x45')]);return _0x2e4566['getActions'](_0x57df85);}})[_0xd8bd('0x29')](function(_0x553fcd){if(_0x553fcd){_0x17a3f0=_0x553fcd[_0xd8bd('0x3b')];if(!_0x309bff['query'][_0xd8bd('0x3c')](_0xd8bd('0x3d'))){_0x57df85[_0xd8bd('0x21')]=qs[_0xd8bd('0x21')](_0x309bff['query'][_0xd8bd('0x21')]);_0x57df85[_0xd8bd('0x1f')]=qs[_0xd8bd('0x1f')](_0x309bff[_0xd8bd('0x35')]['offset']);}return _0x2e4566[_0xd8bd('0x57')](_0x57df85);}})[_0xd8bd('0x29')](function(_0x4b3a44){if(_0x4b3a44){return _0x4b3a44?{'count':_0x17a3f0,'rows':_0x4b3a44}:null;}})['then'](respondWithResult(_0x1bc462,null))[_0xd8bd('0x4c')](handleError(_0x1bc462,null));}; \ No newline at end of file +var _0x729a=['then','error','name','send','Automation','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','addConditions','ids','omit','getConditions','Condition','hasOwnProperty','Action','addActions','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy'];(function(_0x37a080,_0x4be368){var _0x466e3e=function(_0x55a701){while(--_0x55a701){_0x37a080['push'](_0x37a080['shift']());}};_0x466e3e(++_0x4be368);}(_0x729a,0x1d7));var _0xa729=function(_0x34057e,_0x539224){_0x34057e=_0x34057e-0x0;var _0x3497b4=_0x729a[_0x34057e];return _0x3497b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa729('0x0'));var zipdir=require(_0xa729('0x1'));var jsonpatch=require(_0xa729('0x2'));var rp=require(_0xa729('0x3'));var moment=require(_0xa729('0x4'));var BPromise=require(_0xa729('0x5'));var Mustache=require(_0xa729('0x6'));var util=require('util');var path=require(_0xa729('0x7'));var sox=require(_0xa729('0x8'));var csv=require(_0xa729('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa729('0xa'));var _=require('lodash');var squel=require(_0xa729('0xb'));var crypto=require('crypto');var jsforce=require(_0xa729('0xc'));var deskjs=require(_0xa729('0xd'));var toCsv=require(_0xa729('0x9'));var querystring=require(_0xa729('0xe'));var Papa=require(_0xa729('0xf'));var Redis=require(_0xa729('0x10'));var authService=require(_0xa729('0x11'));var qs=require(_0xa729('0x12'));var as=require(_0xa729('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa729('0x14'))(_0xa729('0x15'));var utils=require(_0xa729('0x16'));var config=require(_0xa729('0x17'));var licenseUtil=require(_0xa729('0x18'));var db=require(_0xa729('0x19'))['db'];function respondWithStatusCode(_0x25a080,_0x1771d6){_0x1771d6=_0x1771d6||0xcc;return function(_0x1df042){if(_0x1df042){return _0x25a080[_0xa729('0x1a')](_0x1771d6);}return _0x25a080[_0xa729('0x1b')](_0x1771d6)[_0xa729('0x1c')]();};}function respondWithResult(_0xde96e6,_0xd3859e){_0xd3859e=_0xd3859e||0xc8;return function(_0x4ca669){if(_0x4ca669){return _0xde96e6[_0xa729('0x1b')](_0xd3859e)[_0xa729('0x1d')](_0x4ca669);}};}function respondWithFilteredResult(_0x1b098f,_0x4d3431){return function(_0x141b28){if(_0x141b28){var _0x597138=typeof _0x4d3431[_0xa729('0x1e')]===_0xa729('0x1f')&&typeof _0x4d3431[_0xa729('0x20')]==='undefined';var _0x15fa18=_0x141b28[_0xa729('0x21')];var _0x1781f8=_0x597138?0x0:_0x4d3431[_0xa729('0x1e')];var _0x57b505=_0x597138?_0x141b28[_0xa729('0x21')]:_0x4d3431[_0xa729('0x1e')]+_0x4d3431[_0xa729('0x20')];var _0x5637d6;if(_0x57b505>=_0x15fa18){_0x57b505=_0x15fa18;_0x5637d6=0xc8;}else{_0x5637d6=0xce;}_0x1b098f[_0xa729('0x1b')](_0x5637d6);return _0x1b098f[_0xa729('0x22')](_0xa729('0x23'),_0x1781f8+'-'+_0x57b505+'/'+_0x15fa18)['json'](_0x141b28);}return null;};}function patchUpdates(_0xada803){return function(_0x5eaf7e){try{jsonpatch['apply'](_0x5eaf7e,_0xada803,!![]);}catch(_0x21e4f4){return BPromise[_0xa729('0x24')](_0x21e4f4);}return _0x5eaf7e['save']();};}function saveUpdates(_0x4f150a,_0x12e13a){return function(_0x4b32d5){if(_0x4b32d5){return _0x4b32d5[_0xa729('0x25')](_0x4f150a)['then'](function(_0x445304){return _0x445304;});}return null;};}function removeEntity(_0x45edbf,_0x5c62f7){return function(_0x2361ee){if(_0x2361ee){return _0x2361ee[_0xa729('0x26')]()[_0xa729('0x27')](function(){_0x45edbf[_0xa729('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3c3f,_0x50ed38){return function(_0x5886a4){if(!_0x5886a4){_0x2d3c3f[_0xa729('0x1a')](0x194);}return _0x5886a4;};}function handleError(_0x1413c5,_0xc7bd64){_0xc7bd64=_0xc7bd64||0x1f4;return function(_0x20eba4){logger[_0xa729('0x28')](_0x20eba4['stack']);if(_0x20eba4[_0xa729('0x29')]){delete _0x20eba4[_0xa729('0x29')];}_0x1413c5['status'](_0xc7bd64)[_0xa729('0x2a')](_0x20eba4);};}exports['index']=function(_0x3761d4,_0x400245){var _0x46d5fa={},_0x53e2da={},_0x4c1da8={'count':0x0,'rows':[]};var _0x7dfa0d=_['map'](db[_0xa729('0x2b')][_0xa729('0x2c')],function(_0x3cb172){return{'name':_0x3cb172[_0xa729('0x2d')],'type':_0x3cb172[_0xa729('0x2e')][_0xa729('0x2f')]};});_0x53e2da[_0xa729('0x30')]=_[_0xa729('0x31')](_0x7dfa0d,_0xa729('0x29'));_0x53e2da[_0xa729('0x32')]=_[_0xa729('0x33')](_0x3761d4[_0xa729('0x32')]);_0x53e2da[_0xa729('0x34')]=_[_0xa729('0x35')](_0x53e2da[_0xa729('0x30')],_0x53e2da[_0xa729('0x32')]);_0x46d5fa[_0xa729('0x36')]=_[_0xa729('0x35')](_0x53e2da[_0xa729('0x30')],qs[_0xa729('0x37')](_0x3761d4[_0xa729('0x32')][_0xa729('0x37')]));_0x46d5fa['attributes']=_0x46d5fa[_0xa729('0x36')][_0xa729('0x38')]?_0x46d5fa[_0xa729('0x36')]:_0x53e2da['model'];if(!_0x3761d4[_0xa729('0x32')]['hasOwnProperty'](_0xa729('0x39'))){_0x46d5fa[_0xa729('0x20')]=qs[_0xa729('0x20')](_0x3761d4[_0xa729('0x32')]['limit']);_0x46d5fa[_0xa729('0x1e')]=qs[_0xa729('0x1e')](_0x3761d4[_0xa729('0x32')][_0xa729('0x1e')]);}_0x46d5fa[_0xa729('0x3a')]=qs[_0xa729('0x3b')](_0x3761d4[_0xa729('0x32')][_0xa729('0x3b')]);_0x46d5fa['where']=qs[_0xa729('0x34')](_[_0xa729('0x3c')](_0x3761d4['query'],_0x53e2da['filters']),_0x7dfa0d);if(_0x3761d4[_0xa729('0x32')][_0xa729('0x3d')]){_0x46d5fa[_0xa729('0x3e')]=_[_0xa729('0x3f')](_0x46d5fa[_0xa729('0x3e')],{'$or':_[_0xa729('0x31')](_0x7dfa0d,function(_0x454e29){if(_0x454e29[_0xa729('0x2e')]!==_0xa729('0x40')){var _0x123c13={};_0x123c13[_0x454e29[_0xa729('0x29')]]={'$like':'%'+_0x3761d4[_0xa729('0x32')]['filter']+'%'};return _0x123c13;}})});}_0x46d5fa=_[_0xa729('0x3f')]({},_0x46d5fa,_0x3761d4[_0xa729('0x41')]);var _0x4e4d72={'where':_0x46d5fa[_0xa729('0x3e')]};return db['Automation'][_0xa729('0x21')](_0x4e4d72)[_0xa729('0x27')](function(_0x3e7a2a){_0x4c1da8[_0xa729('0x21')]=_0x3e7a2a;if(_0x3761d4[_0xa729('0x32')][_0xa729('0x42')]){_0x46d5fa[_0xa729('0x43')]=[{'all':!![]}];}return db[_0xa729('0x2b')][_0xa729('0x44')](_0x46d5fa);})[_0xa729('0x27')](function(_0x11568a){_0x4c1da8[_0xa729('0x45')]=_0x11568a;return _0x4c1da8;})[_0xa729('0x27')](respondWithFilteredResult(_0x400245,_0x46d5fa))[_0xa729('0x46')](handleError(_0x400245,null));};exports['show']=function(_0x6a5871,_0x59dae2){var _0x3b96fb={'raw':![],'where':{'id':_0x6a5871[_0xa729('0x47')]['id']}},_0x276ed6={};_0x276ed6['model']=_[_0xa729('0x33')](db['Automation'][_0xa729('0x2c')]);_0x276ed6[_0xa729('0x32')]=_[_0xa729('0x33')](_0x6a5871[_0xa729('0x32')]);_0x276ed6[_0xa729('0x34')]=_[_0xa729('0x35')](_0x276ed6[_0xa729('0x30')],_0x276ed6[_0xa729('0x32')]);_0x3b96fb[_0xa729('0x36')]=_[_0xa729('0x35')](_0x276ed6[_0xa729('0x30')],qs[_0xa729('0x37')](_0x6a5871[_0xa729('0x32')][_0xa729('0x37')]));_0x3b96fb[_0xa729('0x36')]=_0x3b96fb['attributes'][_0xa729('0x38')]?_0x3b96fb[_0xa729('0x36')]:_0x276ed6[_0xa729('0x30')];if(_0x6a5871[_0xa729('0x32')][_0xa729('0x42')]){_0x3b96fb['include']=[{'all':!![]}];}_0x3b96fb=_[_0xa729('0x3f')]({},_0x3b96fb,_0x6a5871[_0xa729('0x41')]);return db['Automation']['find'](_0x3b96fb)['then'](handleEntityNotFound(_0x59dae2,null))[_0xa729('0x27')](respondWithResult(_0x59dae2,null))[_0xa729('0x46')](handleError(_0x59dae2,null));};exports[_0xa729('0x48')]=function(_0x1bc508,_0x10209d){return db[_0xa729('0x2b')][_0xa729('0x48')](_0x1bc508['body'],{})[_0xa729('0x27')](respondWithResult(_0x10209d,0xc9))['catch'](handleError(_0x10209d,null));};exports[_0xa729('0x25')]=function(_0x56fc87,_0x2bae39){if(_0x56fc87[_0xa729('0x49')]['id']){delete _0x56fc87[_0xa729('0x49')]['id'];}return db['Automation'][_0xa729('0x4a')]({'where':{'id':_0x56fc87[_0xa729('0x47')]['id']}})[_0xa729('0x27')](handleEntityNotFound(_0x2bae39,null))[_0xa729('0x27')](saveUpdates(_0x56fc87[_0xa729('0x49')],null))['then'](respondWithResult(_0x2bae39,null))[_0xa729('0x46')](handleError(_0x2bae39,null));};exports[_0xa729('0x26')]=function(_0x1bf000,_0x183b19){return db[_0xa729('0x2b')][_0xa729('0x4a')]({'where':{'id':_0x1bf000[_0xa729('0x47')]['id']}})[_0xa729('0x27')](handleEntityNotFound(_0x183b19,null))[_0xa729('0x27')](removeEntity(_0x183b19,null))[_0xa729('0x46')](handleError(_0x183b19,null));};exports[_0xa729('0x4b')]=function(_0x25b62c,_0x43ed25,_0x590927){return db['Condition'][_0xa729('0x4a')]({'where':{'id':_0x25b62c['params']['id']}})[_0xa729('0x27')](handleEntityNotFound(_0x43ed25,null))[_0xa729('0x27')](function(_0x3acc56){if(_0x3acc56){return _0x3acc56[_0xa729('0x4b')](_0x25b62c[_0xa729('0x49')][_0xa729('0x4c')],_[_0xa729('0x4d')](_0x25b62c[_0xa729('0x49')],[_0xa729('0x4c'),'id'])||{});}})[_0xa729('0x27')](respondWithResult(_0x43ed25,null))[_0xa729('0x46')](handleError(_0x43ed25,null));};exports[_0xa729('0x4e')]=function(_0x146572,_0x546142,_0x1759be){var _0x1b5858={};var _0x199c75={};var _0xd62fb2;var _0x5670b3;return db[_0xa729('0x2b')]['findOne']({'where':{'id':_0x146572[_0xa729('0x47')]['id']}})[_0xa729('0x27')](handleEntityNotFound(_0x546142,null))[_0xa729('0x27')](function(_0x69671b){if(_0x69671b){_0xd62fb2=_0x69671b;_0x199c75[_0xa729('0x30')]=_[_0xa729('0x33')](db[_0xa729('0x4f')]['rawAttributes']);_0x199c75['query']=_[_0xa729('0x33')](_0x146572[_0xa729('0x32')]);_0x199c75[_0xa729('0x34')]=_[_0xa729('0x35')](_0x199c75[_0xa729('0x30')],_0x199c75['query']);_0x1b5858[_0xa729('0x36')]=_[_0xa729('0x35')](_0x199c75['model'],qs[_0xa729('0x37')](_0x146572[_0xa729('0x32')]['fields']));_0x1b5858[_0xa729('0x36')]=_0x1b5858[_0xa729('0x36')]['length']?_0x1b5858[_0xa729('0x36')]:_0x199c75[_0xa729('0x30')];_0x1b5858['order']=qs['sort'](_0x146572[_0xa729('0x32')]['sort']);_0x1b5858[_0xa729('0x3e')]=qs['filters'](_['pick'](_0x146572[_0xa729('0x32')],_0x199c75['filters']));if(_0x146572[_0xa729('0x32')][_0xa729('0x3d')]){_0x1b5858[_0xa729('0x3e')]=_[_0xa729('0x3f')](_0x1b5858[_0xa729('0x3e')],{'$or':_[_0xa729('0x31')](_0x1b5858[_0xa729('0x36')],function(_0x3a4c19){var _0x24d27d={};_0x24d27d[_0x3a4c19]={'$like':'%'+_0x146572[_0xa729('0x32')][_0xa729('0x3d')]+'%'};return _0x24d27d;})});}_0x1b5858=_[_0xa729('0x3f')]({},_0x1b5858,_0x146572[_0xa729('0x41')]);return _0xd62fb2['getConditions'](_0x1b5858);}})[_0xa729('0x27')](function(_0x2eb1cb){if(_0x2eb1cb){_0x5670b3=_0x2eb1cb[_0xa729('0x38')];if(!_0x146572[_0xa729('0x32')][_0xa729('0x50')]('nolimit')){_0x1b5858['limit']=qs[_0xa729('0x20')](_0x146572[_0xa729('0x32')][_0xa729('0x20')]);_0x1b5858['offset']=qs[_0xa729('0x1e')](_0x146572[_0xa729('0x32')][_0xa729('0x1e')]);}return _0xd62fb2['getConditions'](_0x1b5858);}})['then'](function(_0x37b832){if(_0x37b832){return _0x37b832?{'count':_0x5670b3,'rows':_0x37b832}:null;}})[_0xa729('0x27')](respondWithResult(_0x546142,null))[_0xa729('0x46')](handleError(_0x546142,null));};exports['addActions']=function(_0x31f745,_0x10d042,_0x1958aa){return db[_0xa729('0x51')][_0xa729('0x4a')]({'where':{'id':_0x31f745[_0xa729('0x47')]['id']}})[_0xa729('0x27')](handleEntityNotFound(_0x10d042,null))[_0xa729('0x27')](function(_0x15a37f){if(_0x15a37f){return _0x15a37f[_0xa729('0x52')](_0x31f745['body']['ids'],_['omit'](_0x31f745['body'],[_0xa729('0x4c'),'id'])||{});}})[_0xa729('0x27')](respondWithResult(_0x10d042,null))['catch'](handleError(_0x10d042,null));};exports[_0xa729('0x53')]=function(_0x586773,_0x10ca0f,_0x39dadf){var _0x169425={};var _0x524f10={};var _0x1cb1a1;var _0x1cd4af;return db[_0xa729('0x2b')][_0xa729('0x54')]({'where':{'id':_0x586773[_0xa729('0x47')]['id']}})[_0xa729('0x27')](handleEntityNotFound(_0x10ca0f,null))[_0xa729('0x27')](function(_0x4ce616){if(_0x4ce616){_0x1cb1a1=_0x4ce616;_0x524f10[_0xa729('0x30')]=_[_0xa729('0x33')](db[_0xa729('0x51')]['rawAttributes']);_0x524f10[_0xa729('0x32')]=_['keys'](_0x586773[_0xa729('0x32')]);_0x524f10[_0xa729('0x34')]=_[_0xa729('0x35')](_0x524f10['model'],_0x524f10[_0xa729('0x32')]);_0x169425[_0xa729('0x36')]=_[_0xa729('0x35')](_0x524f10[_0xa729('0x30')],qs[_0xa729('0x37')](_0x586773[_0xa729('0x32')][_0xa729('0x37')]));_0x169425[_0xa729('0x36')]=_0x169425[_0xa729('0x36')][_0xa729('0x38')]?_0x169425[_0xa729('0x36')]:_0x524f10[_0xa729('0x30')];_0x169425['order']=qs['sort'](_0x586773[_0xa729('0x32')]['sort']);_0x169425[_0xa729('0x3e')]=qs[_0xa729('0x34')](_[_0xa729('0x3c')](_0x586773[_0xa729('0x32')],_0x524f10[_0xa729('0x34')]));if(_0x586773[_0xa729('0x32')][_0xa729('0x3d')]){_0x169425[_0xa729('0x3e')]=_[_0xa729('0x3f')](_0x169425[_0xa729('0x3e')],{'$or':_[_0xa729('0x31')](_0x169425[_0xa729('0x36')],function(_0x5288df){var _0x1549f3={};_0x1549f3[_0x5288df]={'$like':'%'+_0x586773[_0xa729('0x32')]['filter']+'%'};return _0x1549f3;})});}_0x169425=_[_0xa729('0x3f')]({},_0x169425,_0x586773[_0xa729('0x41')]);return _0x1cb1a1['getActions'](_0x169425);}})['then'](function(_0x257fe4){if(_0x257fe4){_0x1cd4af=_0x257fe4[_0xa729('0x38')];if(!_0x586773[_0xa729('0x32')][_0xa729('0x50')](_0xa729('0x39'))){_0x169425[_0xa729('0x20')]=qs['limit'](_0x586773[_0xa729('0x32')][_0xa729('0x20')]);_0x169425[_0xa729('0x1e')]=qs[_0xa729('0x1e')](_0x586773['query'][_0xa729('0x1e')]);}return _0x1cb1a1[_0xa729('0x53')](_0x169425);}})[_0xa729('0x27')](function(_0x558efc){if(_0x558efc){return _0x558efc?{'count':_0x1cd4af,'rows':_0x558efc}:null;}})[_0xa729('0x27')](respondWithResult(_0x10ca0f,null))[_0xa729('0x46')](handleError(_0x10ca0f,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 6b95257..ec0d3d7 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 _0xbefe=['exports','define','tools_automations','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x85047b,_0x5aef26){var _0x56b415=function(_0x688e38){while(--_0x688e38){_0x85047b['push'](_0x85047b['shift']());}};_0x56b415(++_0x5aef26);}(_0xbefe,0xb7));var _0xebef=function(_0x5e0823,_0x146024){_0x5e0823=_0x5e0823-0x0;var _0x592fbb=_0xbefe[_0x5e0823];return _0x592fbb;};'use strict';var _=require(_0xebef('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xebef('0x1'));var moment=require(_0xebef('0x2'));var BPromise=require(_0xebef('0x3'));var rp=require(_0xebef('0x4'));var fs=require('fs');var path=require(_0xebef('0x5'));var rimraf=require(_0xebef('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xebef('0x7')]=function(_0x1d7ba7,_0x2039da){return _0x1d7ba7[_0xebef('0x8')]('Automation',attributes,{'tableName':_0xebef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x818f=['request-promise','path','../../config/environment','exports','Automation','tools_automations','util','../../config/logger','api','moment'];(function(_0x75bcfd,_0x548f36){var _0x5de5e8=function(_0x4b6a04){while(--_0x4b6a04){_0x75bcfd['push'](_0x75bcfd['shift']());}};_0x5de5e8(++_0x548f36);}(_0x818f,0x196));var _0xf818=function(_0x2db3aa,_0x90b8a9){_0x2db3aa=_0x2db3aa-0x0;var _0x5c3e2c=_0x818f[_0x2db3aa];return _0x5c3e2c;};'use strict';var _=require('lodash');var util=require(_0xf818('0x0'));var logger=require(_0xf818('0x1'))(_0xf818('0x2'));var moment=require(_0xf818('0x3'));var BPromise=require('bluebird');var rp=require(_0xf818('0x4'));var fs=require('fs');var path=require(_0xf818('0x5'));var rimraf=require('rimraf');var config=require(_0xf818('0x6'));var attributes=require('./automation.attributes');module[_0xf818('0x7')]=function(_0x47ac40,_0x5622fd){return _0x47ac40['define'](_0xf818('0x8'),attributes,{'tableName':_0xf818('0x9'),'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 37a1624..6246384 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 _0x86c0=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x86c0,0x133));var _0x086c=function(_0x5219a2,_0x1ab0cb){_0x5219a2=_0x5219a2-0x0;var _0x20134f=_0x86c0[_0x5219a2];return _0x20134f;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require(_0x086c('0x1'));var BPromise=require(_0x086c('0x2'));var rs=require(_0x086c('0x3'));var fs=require('fs');var Redis=require(_0x086c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x086c('0x5'));var logger=require(_0x086c('0x6'))(_0x086c('0x7'));var config=require(_0x086c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x086c('0x9')][_0x086c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e27a8,_0x387428,_0x117df9){return new BPromise(function(_0x25e437,_0x52b942){return client[_0x086c('0xb')](_0x2e27a8,_0x117df9)[_0x086c('0xc')](function(_0xa1b79a){logger['info']('Automation,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));logger[_0x086c('0xe')](_0x086c('0xf'),_0x387428,_0x086c('0xd'),JSON[_0x086c('0x10')](_0xa1b79a));if(_0xa1b79a['error']){if(_0xa1b79a[_0x086c('0x11')][_0x086c('0x12')]===0x1f4){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error']['message']);return _0x52b942(_0xa1b79a[_0x086c('0x11')]['message']);}logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error'][_0x086c('0x14')]);return _0x25e437(_0xa1b79a[_0x086c('0x11')][_0x086c('0x14')]);}else{logger[_0x086c('0x15')]('Automation,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));_0x25e437(_0xa1b79a[_0x086c('0x16')][_0x086c('0x14')]);}})['catch'](function(_0x34e74f){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0x34e74f);_0x52b942(_0x34e74f);});});} \ No newline at end of file +var _0x9123=['lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch'];(function(_0x53c85d,_0x5d5281){var _0x48f975=function(_0x18fdff){while(--_0x18fdff){_0x53c85d['push'](_0x53c85d['shift']());}};_0x48f975(++_0x5d5281);}(_0x9123,0x140));var _0x3912=function(_0x40e35a,_0x2e2e20){_0x40e35a=_0x40e35a-0x0;var _0x10f00c=_0x9123[_0x40e35a];return _0x10f00c;};'use strict';var _=require(_0x3912('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3912('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3912('0x2'))['db'];var utils=require(_0x3912('0x3'));var logger=require(_0x3912('0x4'))(_0x3912('0x5'));var config=require('../../config/environment');var jayson=require(_0x3912('0x6'));var client=jayson[_0x3912('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea5cf,_0x2b3ac0,_0x2d75b6){return new BPromise(function(_0x2325d0,_0x51fb5b){return client[_0x3912('0x8')](_0x4ea5cf,_0x2d75b6)[_0x3912('0x9')](function(_0x2f5910){logger[_0x3912('0xa')]('Automation,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'));logger[_0x3912('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'),JSON[_0x3912('0xd')](_0x2f5910));if(_0x2f5910[_0x3912('0xe')]){if(_0x2f5910[_0x3912('0xe')][_0x3912('0xf')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x2b3ac0,_0x2f5910[_0x3912('0xe')][_0x3912('0x10')]);return _0x51fb5b(_0x2f5910[_0x3912('0xe')]['message']);}logger[_0x3912('0xe')](_0x3912('0x11'),_0x2b3ac0,_0x2f5910['error'][_0x3912('0x10')]);return _0x2325d0(_0x2f5910[_0x3912('0xe')][_0x3912('0x10')]);}else{logger[_0x3912('0xa')]('Automation,\x20%s,\x20%s',_0x2b3ac0,_0x3912('0xb'));_0x2325d0(_0x2f5910[_0x3912('0x12')][_0x3912('0x10')]);}})[_0x3912('0x13')](function(_0x4658b6){logger['error'](_0x3912('0x11'),_0x2b3ac0,_0x4658b6);_0x51fb5b(_0x4658b6);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5be7499..0076a6b 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 _0x34ab=['exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','put','update','delete'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x34ab,0xf1));var _0xb34a=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x34ab[_0x5519a9];return _0x32f2cc;};'use strict';var multer=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var path=require(_0xb34a('0x2'));var timeout=require(_0xb34a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb34a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb34a('0x5'));var config=require(_0xb34a('0x6'));var controller=require(_0xb34a('0x7'));router['get']('/',auth[_0xb34a('0x8')](),controller[_0xb34a('0x9')]);router[_0xb34a('0xa')](_0xb34a('0xb'),auth[_0xb34a('0x8')](),controller[_0xb34a('0xc')]);router[_0xb34a('0xa')]('/:id/conditions',auth[_0xb34a('0x8')](),controller[_0xb34a('0xd')]);router['get'](_0xb34a('0xe'),auth[_0xb34a('0x8')](),controller[_0xb34a('0xf')]);router['post']('/',auth[_0xb34a('0x8')](),controller[_0xb34a('0x10')]);router[_0xb34a('0x11')](_0xb34a('0x12'),auth[_0xb34a('0x8')](),controller[_0xb34a('0x13')]);router[_0xb34a('0x11')](_0xb34a('0xe'),auth[_0xb34a('0x8')](),controller['addActions']);router[_0xb34a('0x14')]('/:id',auth[_0xb34a('0x8')](),controller[_0xb34a('0x15')]);router[_0xb34a('0x16')](_0xb34a('0xb'),auth[_0xb34a('0x8')](),controller['destroy']);module[_0xb34a('0x17')]=router; \ No newline at end of file +var _0x35f9=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x389339,_0x8a6ae9){var _0x49dabc=function(_0x1306bf){while(--_0x1306bf){_0x389339['push'](_0x389339['shift']());}};_0x49dabc(++_0x8a6ae9);}(_0x35f9,0x1df));var _0x935f=function(_0xace180,_0x392fce){_0xace180=_0xace180-0x0;var _0x31fff1=_0x35f9[_0xace180];return _0x31fff1;};'use strict';var multer=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var path=require(_0x935f('0x2'));var timeout=require(_0x935f('0x3'));var express=require('express');var router=express[_0x935f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x935f('0x5'));var config=require(_0x935f('0x6'));var controller=require('./automation.controller');router['get']('/',auth[_0x935f('0x7')](),controller[_0x935f('0x8')]);router[_0x935f('0x9')](_0x935f('0xa'),auth[_0x935f('0x7')](),controller[_0x935f('0xb')]);router[_0x935f('0x9')]('/:id/conditions',auth[_0x935f('0x7')](),controller[_0x935f('0xc')]);router[_0x935f('0x9')](_0x935f('0xd'),auth[_0x935f('0x7')](),controller[_0x935f('0xe')]);router[_0x935f('0xf')]('/',auth[_0x935f('0x7')](),controller[_0x935f('0x10')]);router['post']('/:id/conditions',auth[_0x935f('0x7')](),controller[_0x935f('0x11')]);router[_0x935f('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x935f('0x12')]);router[_0x935f('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x935f('0x14')]);router['delete'](_0x935f('0xa'),auth[_0x935f('0x7')](),controller[_0x935f('0x15')]);module[_0x935f('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 263f68a..5e27735 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 _0x6e0f=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\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)'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6e0f,0x1c8));var _0xf6e0=function(_0x338f03,_0x28941b){_0x338f03=_0x338f03-0x0;var _0x514d7e=_0x6e0f[_0x338f03];return _0x514d7e;};'use strict';var Sequelize=require(_0xf6e0('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6e0('0x1')],'unique':_0xf6e0('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf6e0('0x3')](_0xf6e0('0x4')),'allowNull':![],'defaultValue':_0xf6e0('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf6e0('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xf6e0('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf6e0('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf6e0('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf6e0('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf6e0('0x8')](0x5)[_0xf6e0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6e0('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf6e0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6e0('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf6e0('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf6e0('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf6e0('0x8')](0x5)[_0xf6e0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6e0('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf6e0('0x10')},'dialTimezone':{'type':Sequelize[_0xf6e0('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf6e0('0x1')],'defaultValue':_0xf6e0('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xf6e0('0x3')](_0xf6e0('0x12'),_0xf6e0('0x13'),_0xf6e0('0x14')),'defaultValue':_0xf6e0('0x12')},'dialAMDActive':{'type':Sequelize[_0xf6e0('0x15')],'defaultValue':0x0,'comment':_0xf6e0('0x16')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf6e0('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf6e0('0x17')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf6e0('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf6e0('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf6e0('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf6e0('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf6e0('0x8')](0x9)[_0xf6e0('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf6e0('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf6e0('0x8')](0x9)[_0xf6e0('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf6e0('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xf6e0('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf6e0('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf6e0('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf6e0('0x3')](_0xf6e0('0x1d'),_0xf6e0('0x1e')),'defaultValue':_0xf6e0('0x1d')},'dialPrefix':{'type':Sequelize[_0xf6e0('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf6e0('0x1f')},'dialCutDigit':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf6e0('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6e0('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xf6e0('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0x22')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6e0('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf6e0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf6e0('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6e0('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0xf6e0('0x8')](0x3)[_0xf6e0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf6e0('0x8')](0x5)[_0xf6e0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf6e0('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6e0('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf6e0('0x8')](0x5)[_0xf6e0('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6e0('0x28')}}; \ No newline at end of file +var _0x67e8=['#AMD\x20Initial\x20Silence','#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','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)','#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','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0x4aab83,_0x138c22){var _0x119a72=function(_0x42aa20){while(--_0x42aa20){_0x4aab83['push'](_0x4aab83['shift']());}};_0x119a72(++_0x138c22);}(_0x67e8,0xcf));var _0x867e=function(_0x3c06a3,_0x259d76){_0x3c06a3=_0x3c06a3-0x0;var _0x2a6ed5=_0x67e8[_0x3c06a3];return _0x2a6ed5;};'use strict';var Sequelize=require(_0x867e('0x0'));module[_0x867e('0x1')]={'name':{'type':Sequelize[_0x867e('0x2')],'unique':_0x867e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x867e('0x4')](_0x867e('0x5')),'allowNull':![],'defaultValue':_0x867e('0x5')},'description':{'type':Sequelize[_0x867e('0x2')]},'active':{'type':Sequelize[_0x867e('0x6')],'defaultValue':0x0,'comment':_0x867e('0x7')},'limitCalls':{'type':Sequelize[_0x867e('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x867e('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x867e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x867e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x867e('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x867e('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x867e('0x8')](0x5)[_0x867e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x867e('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x867e('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x867e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x867e('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x3,'comment':_0x867e('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x867e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x867e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x867e('0x2')],'defaultValue':_0x867e('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x867e('0x4')](_0x867e('0x12'),_0x867e('0x13'),_0x867e('0x14')),'defaultValue':_0x867e('0x12')},'dialAMDActive':{'type':Sequelize[_0x867e('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x867e('0x8')](0x9)[_0x867e('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x867e('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x867e('0x8')](0x9)[_0x867e('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x867e('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x867e('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x867e('0x8')](0x9)[_0x867e('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x867e('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x867e('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x867e('0x8')](0x9)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x867e('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x867e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x867e('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x867e('0x8')](0x9)[_0x867e('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x867e('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x867e('0x1c'),_0x867e('0x1d')),'defaultValue':_0x867e('0x1c')},'dialPrefix':{'type':Sequelize[_0x867e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x867e('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x867e('0x1e')},'dialCutDigit':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x867e('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x867e('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x867e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x867e('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x867e('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x867e('0x8')](0x5)[_0x867e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x867e('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x867e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x867e('0x8')](0x5)[_0x867e('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x867e('0x8')](0x3)[_0x867e('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x867e('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x867e('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x867e('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 1a6bac3..3684820 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 _0xa062=['json','reject','save','destroy','then','get','error','stack','name','send','index','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','merge','options','Campaign','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','user','role','IvrCampaigns','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','getHoppers','CmHopper','nolimit','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x2482c2,_0x3793e0){var _0x259485=function(_0x171610){while(--_0x171610){_0x2482c2['push'](_0x2482c2['shift']());}};_0x259485(++_0x3793e0);}(_0xa062,0x101));var _0x2a06=function(_0x3fb225,_0x47d95d){_0x3fb225=_0x3fb225-0x0;var _0x5122d3=_0xa062[_0x3fb225];return _0x5122d3;};'use strict';var emlformat=require(_0x2a06('0x0'));var rimraf=require(_0x2a06('0x1'));var zipdir=require(_0x2a06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a06('0x3'));var moment=require(_0x2a06('0x4'));var BPromise=require(_0x2a06('0x5'));var Mustache=require(_0x2a06('0x6'));var util=require('util');var path=require(_0x2a06('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2a06('0x8'));var fs=require('fs');var fs_extra=require(_0x2a06('0x9'));var _=require(_0x2a06('0xa'));var squel=require(_0x2a06('0xb'));var crypto=require(_0x2a06('0xc'));var jsforce=require(_0x2a06('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a06('0xe'));var querystring=require(_0x2a06('0xf'));var Papa=require('papaparse');var Redis=require(_0x2a06('0x10'));var authService=require(_0x2a06('0x11'));var qs=require(_0x2a06('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2a06('0x13'));var config=require(_0x2a06('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a06('0x15'))['db'];function respondWithStatusCode(_0x1ae9bb,_0x329cdf){_0x329cdf=_0x329cdf||0xcc;return function(_0x179b0e){if(_0x179b0e){return _0x1ae9bb[_0x2a06('0x16')](_0x329cdf);}return _0x1ae9bb[_0x2a06('0x17')](_0x329cdf)[_0x2a06('0x18')]();};}function respondWithResult(_0x490755,_0x4c0dc1){_0x4c0dc1=_0x4c0dc1||0xc8;return function(_0x43fa64){if(_0x43fa64){return _0x490755[_0x2a06('0x17')](_0x4c0dc1)['json'](_0x43fa64);}};}function respondWithFilteredResult(_0x40ac43,_0x15e63c){return function(_0xfc68b7){if(_0xfc68b7){var _0x1ba819=typeof _0x15e63c[_0x2a06('0x19')]===_0x2a06('0x1a')&&typeof _0x15e63c[_0x2a06('0x1b')]===_0x2a06('0x1a');var _0xb5011f=_0xfc68b7[_0x2a06('0x1c')];var _0x593762=_0x1ba819?0x0:_0x15e63c[_0x2a06('0x19')];var _0x23b665=_0x1ba819?_0xfc68b7[_0x2a06('0x1c')]:_0x15e63c[_0x2a06('0x19')]+_0x15e63c[_0x2a06('0x1b')];var _0x3779ac;if(_0x23b665>=_0xb5011f){_0x23b665=_0xb5011f;_0x3779ac=0xc8;}else{_0x3779ac=0xce;}_0x40ac43[_0x2a06('0x17')](_0x3779ac);return _0x40ac43[_0x2a06('0x1d')](_0x2a06('0x1e'),_0x593762+'-'+_0x23b665+'/'+_0xb5011f)[_0x2a06('0x1f')](_0xfc68b7);}return null;};}function patchUpdates(_0x249d42){return function(_0x38c6fd){try{jsonpatch['apply'](_0x38c6fd,_0x249d42,!![]);}catch(_0x304625){return BPromise[_0x2a06('0x20')](_0x304625);}return _0x38c6fd[_0x2a06('0x21')]();};}function saveUpdates(_0x393cc4,_0x1c7e4e){return function(_0x382b4a){if(_0x382b4a){return _0x382b4a['update'](_0x393cc4)['then'](function(_0x12c0cd){return _0x12c0cd;});}return null;};}function removeEntity(_0x4dbb0d,_0x58a096){return function(_0x3eef6f){if(_0x3eef6f){return _0x3eef6f[_0x2a06('0x22')]()[_0x2a06('0x23')](function(){var _0x1d61dc=_0x3eef6f[_0x2a06('0x24')]({'plain':!![]});var _0x1b377a='IvrCampaigns';return db['UserProfileResource'][_0x2a06('0x22')]({'where':{'type':_0x1b377a,'resourceId':_0x1d61dc['id']}})[_0x2a06('0x23')](function(){return _0x3eef6f;});})[_0x2a06('0x23')](function(){_0x4dbb0d[_0x2a06('0x17')](0xcc)[_0x2a06('0x18')]();});}};}function handleEntityNotFound(_0x5edc18,_0xa72125){return function(_0x39f3c4){if(!_0x39f3c4){_0x5edc18['sendStatus'](0x194);}return _0x39f3c4;};}function handleError(_0xfd1407,_0xc7b773){_0xc7b773=_0xc7b773||0x1f4;return function(_0x404631){logger[_0x2a06('0x25')](_0x404631[_0x2a06('0x26')]);if(_0x404631['name']){delete _0x404631[_0x2a06('0x27')];}_0xfd1407['status'](_0xc7b773)[_0x2a06('0x28')](_0x404631);};}exports[_0x2a06('0x29')]=function(_0x40dbc2,_0xe3dd1e){var _0x3d7a9f={},_0x5e6f5f={},_0x214067={'count':0x0,'rows':[]};var _0x22a9f5=_['map'](db['Campaign']['rawAttributes'],function(_0x3db6a3){return{'name':_0x3db6a3['fieldName'],'type':_0x3db6a3['type'][_0x2a06('0x2a')]};});_0x5e6f5f[_0x2a06('0x2b')]=_[_0x2a06('0x2c')](_0x22a9f5,_0x2a06('0x27'));_0x5e6f5f[_0x2a06('0x2d')]=_[_0x2a06('0x2e')](_0x40dbc2[_0x2a06('0x2d')]);_0x5e6f5f[_0x2a06('0x2f')]=_[_0x2a06('0x30')](_0x5e6f5f['model'],_0x5e6f5f[_0x2a06('0x2d')]);_0x3d7a9f[_0x2a06('0x31')]=_[_0x2a06('0x30')](_0x5e6f5f['model'],qs['fields'](_0x40dbc2[_0x2a06('0x2d')][_0x2a06('0x32')]));_0x3d7a9f[_0x2a06('0x31')]=_0x3d7a9f['attributes']['length']?_0x3d7a9f[_0x2a06('0x31')]:_0x5e6f5f[_0x2a06('0x2b')];if(!_0x40dbc2[_0x2a06('0x2d')][_0x2a06('0x33')]('nolimit')){_0x3d7a9f[_0x2a06('0x1b')]=qs['limit'](_0x40dbc2[_0x2a06('0x2d')][_0x2a06('0x1b')]);_0x3d7a9f['offset']=qs['offset'](_0x40dbc2[_0x2a06('0x2d')][_0x2a06('0x19')]);}_0x3d7a9f[_0x2a06('0x34')]=qs[_0x2a06('0x35')](_0x40dbc2['query']['sort']);_0x3d7a9f['where']=qs[_0x2a06('0x2f')](_[_0x2a06('0x36')](_0x40dbc2[_0x2a06('0x2d')],_0x5e6f5f[_0x2a06('0x2f')]),_0x22a9f5);if(_0x40dbc2[_0x2a06('0x2d')][_0x2a06('0x37')]){_0x3d7a9f[_0x2a06('0x38')]=_['merge'](_0x3d7a9f['where'],{'$or':_[_0x2a06('0x2c')](_0x22a9f5,function(_0x4235e8){if(_0x4235e8[_0x2a06('0x39')]!==_0x2a06('0x3a')){var _0x19d1e5={};_0x19d1e5[_0x4235e8[_0x2a06('0x27')]]={'$like':'%'+_0x40dbc2[_0x2a06('0x2d')][_0x2a06('0x37')]+'%'};return _0x19d1e5;}})});}_0x3d7a9f=_[_0x2a06('0x3b')]({},_0x3d7a9f,_0x40dbc2[_0x2a06('0x3c')]);var _0x107218={'where':_0x3d7a9f[_0x2a06('0x38')]};return db[_0x2a06('0x3d')][_0x2a06('0x1c')](_0x107218)[_0x2a06('0x23')](function(_0x349685){_0x214067[_0x2a06('0x1c')]=_0x349685;if(_0x40dbc2[_0x2a06('0x2d')]['includeAll']){_0x3d7a9f[_0x2a06('0x3e')]=[{'all':!![]}];}return db[_0x2a06('0x3d')][_0x2a06('0x3f')](_0x3d7a9f);})[_0x2a06('0x23')](function(_0x1f5c2e){_0x214067[_0x2a06('0x40')]=_0x1f5c2e;return _0x214067;})[_0x2a06('0x23')](respondWithFilteredResult(_0xe3dd1e,_0x3d7a9f))[_0x2a06('0x41')](handleError(_0xe3dd1e,null));};exports[_0x2a06('0x42')]=function(_0x3ba14f,_0x5fe992){var _0xcff7aa={'raw':![],'where':{'id':_0x3ba14f[_0x2a06('0x43')]['id']}},_0x19ae71={};_0x19ae71[_0x2a06('0x2b')]=_[_0x2a06('0x2e')](db[_0x2a06('0x3d')][_0x2a06('0x44')]);_0x19ae71[_0x2a06('0x2d')]=_[_0x2a06('0x2e')](_0x3ba14f[_0x2a06('0x2d')]);_0x19ae71['filters']=_[_0x2a06('0x30')](_0x19ae71['model'],_0x19ae71['query']);_0xcff7aa[_0x2a06('0x31')]=_['intersection'](_0x19ae71[_0x2a06('0x2b')],qs['fields'](_0x3ba14f['query'][_0x2a06('0x32')]));_0xcff7aa[_0x2a06('0x31')]=_0xcff7aa[_0x2a06('0x31')][_0x2a06('0x45')]?_0xcff7aa['attributes']:_0x19ae71[_0x2a06('0x2b')];if(_0x3ba14f[_0x2a06('0x2d')][_0x2a06('0x46')]){_0xcff7aa[_0x2a06('0x3e')]=[{'all':!![]}];}_0xcff7aa=_['merge']({},_0xcff7aa,_0x3ba14f[_0x2a06('0x3c')]);return db[_0x2a06('0x3d')][_0x2a06('0x47')](_0xcff7aa)[_0x2a06('0x23')](handleEntityNotFound(_0x5fe992,null))['then'](respondWithResult(_0x5fe992,null))[_0x2a06('0x41')](handleError(_0x5fe992,null));};exports[_0x2a06('0x48')]=function(_0x55b004,_0xcebf33){return db[_0x2a06('0x3d')]['create'](_0x55b004[_0x2a06('0x49')],{})[_0x2a06('0x23')](function(_0x2505fd){var _0x1c8007=_0x55b004[_0x2a06('0x4a')]['get']({'plain':!![]});if(!_0x1c8007)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c8007[_0x2a06('0x4b')]==='user'){var _0x123061=_0x2505fd['get']({'plain':!![]});var _0x4ce4db=_0x2a06('0x4c');return db['UserProfileSection'][_0x2a06('0x47')]({'where':{'name':_0x4ce4db,'userProfileId':_0x1c8007[_0x2a06('0x4d')]},'raw':!![]})['then'](function(_0xb0dc53){if(_0xb0dc53&&_0xb0dc53[_0x2a06('0x4e')]===0x0){return db[_0x2a06('0x4f')][_0x2a06('0x48')]({'name':_0x123061[_0x2a06('0x27')],'resourceId':_0x123061['id'],'type':_0xb0dc53[_0x2a06('0x27')],'sectionId':_0xb0dc53['id']},{})['then'](function(){return _0x2505fd;});}else{return _0x2505fd;}})[_0x2a06('0x41')](function(_0x4e7e73){logger[_0x2a06('0x25')](_0x2a06('0x50'),_0x4e7e73);throw _0x4e7e73;});}return _0x2505fd;})[_0x2a06('0x23')](respondWithResult(_0xcebf33,0xc9))[_0x2a06('0x41')](handleError(_0xcebf33,null));};exports[_0x2a06('0x51')]=function(_0x15c646,_0x588ec7){var _0x452c22={'where':{'id':_0x15c646[_0x2a06('0x43')]['id']}},_0x153a06={};_0x153a06[_0x2a06('0x2b')]=_[_0x2a06('0x2e')](db[_0x2a06('0x3d')][_0x2a06('0x44')]);_0x452c22[_0x2a06('0x31')]=_[_0x2a06('0x30')](_0x153a06['model'],qs['fields'](_0x15c646['query'][_0x2a06('0x32')]));_0x452c22[_0x2a06('0x31')]=_0x452c22['attributes']['length']?_0x452c22[_0x2a06('0x31')]:_0x153a06[_0x2a06('0x2b')];if(_0x15c646['query'][_0x2a06('0x46')]){_0x452c22[_0x2a06('0x3e')]=[{'all':!![]}];}_0x452c22=_[_0x2a06('0x3b')]({},_0x452c22,_0x15c646[_0x2a06('0x3c')]);return db[_0x2a06('0x3d')]['find'](_0x452c22)['then'](handleEntityNotFound(_0x588ec7,null))['then'](function(_0x30e529){if(_0x30e529){var _0x28c2fd=_0x30e529[_0x2a06('0x24')]({'plain':!![]});_0x28c2fd=qs[_0x2a06('0x52')](_0x28c2fd,['id',_0x2a06('0x53'),_0x2a06('0x54')]);_0x15c646[_0x2a06('0x49')]=_[_0x2a06('0x52')](_0x15c646[_0x2a06('0x49')],['id',_0x2a06('0x53'),_0x2a06('0x54')]);return db[_0x2a06('0x3d')][_0x2a06('0x48')](_[_0x2a06('0x3b')](_0x28c2fd,_0x15c646[_0x2a06('0x49')]),{'include':_0x15c646['query']['includeAll']?[{'all':!![]}]:undefined})[_0x2a06('0x23')](function(_0x569a60){var _0xb80b56=_0x15c646[_0x2a06('0x4a')][_0x2a06('0x24')]({'plain':!![]});if(!_0xb80b56)throw new Error(_0x2a06('0x55'));if(_0xb80b56[_0x2a06('0x4b')]===_0x2a06('0x4a')){var _0x524629=_0x569a60[_0x2a06('0x24')]({'plain':!![]});var _0x5156f4=_0x2a06('0x4c');return db['UserProfileSection'][_0x2a06('0x47')]({'where':{'name':_0x5156f4,'userProfileId':_0xb80b56['userProfileId']},'raw':!![]})['then'](function(_0x547b4b){if(_0x547b4b&&_0x547b4b['autoAssociation']===0x0){return db[_0x2a06('0x4f')][_0x2a06('0x48')]({'name':_0x524629['name'],'resourceId':_0x524629['id'],'type':_0x547b4b[_0x2a06('0x27')],'sectionId':_0x547b4b['id']},{})[_0x2a06('0x23')](function(){return _0x569a60;});}else{return _0x569a60;}})[_0x2a06('0x41')](function(_0x5f3d1e){logger[_0x2a06('0x25')](_0x2a06('0x50'),_0x5f3d1e);throw _0x5f3d1e;});}return _0x569a60;});}})[_0x2a06('0x23')](respondWithResult(_0x588ec7,0xc9))[_0x2a06('0x41')](handleError(_0x588ec7,null));};exports[_0x2a06('0x56')]=function(_0x19a59a,_0x4646bb){if(_0x19a59a['body']['id']){delete _0x19a59a[_0x2a06('0x49')]['id'];}return db[_0x2a06('0x3d')]['find']({'where':{'id':_0x19a59a[_0x2a06('0x43')]['id']}})['then'](handleEntityNotFound(_0x4646bb,null))['then'](saveUpdates(_0x19a59a['body'],null))[_0x2a06('0x23')](respondWithResult(_0x4646bb,null))['catch'](handleError(_0x4646bb,null));};exports[_0x2a06('0x22')]=function(_0x203e11,_0x518536){return db['Campaign'][_0x2a06('0x47')]({'where':{'id':_0x203e11[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x518536,null))[_0x2a06('0x23')](removeEntity(_0x518536,null))[_0x2a06('0x41')](handleError(_0x518536,null));};exports[_0x2a06('0x57')]=function(_0x2fdd41,_0x9135c3,_0x5966a4){var _0x40d316={'raw':!![],'where':{}};var _0x1899c4={};var _0x505c94={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2fdd41[_0x2a06('0x43')]['id']}})['then'](handleEntityNotFound(_0x9135c3,null))[_0x2a06('0x23')](function(_0x481f42){if(_0x481f42){_0x1899c4['model']=_[_0x2a06('0x2e')](db[_0x2a06('0x58')][_0x2a06('0x44')]);_0x1899c4[_0x2a06('0x2d')]=_[_0x2a06('0x2e')](_0x2fdd41[_0x2a06('0x2d')]);_0x1899c4[_0x2a06('0x2f')]=_['intersection'](_0x1899c4[_0x2a06('0x2b')],_0x1899c4[_0x2a06('0x2d')]);_0x40d316['attributes']=_['intersection'](_0x1899c4[_0x2a06('0x2b')],qs[_0x2a06('0x32')](_0x2fdd41[_0x2a06('0x2d')][_0x2a06('0x32')]));_0x40d316[_0x2a06('0x31')]=_0x40d316['attributes'][_0x2a06('0x45')]?_0x40d316[_0x2a06('0x31')]:_0x1899c4[_0x2a06('0x2b')];if(!_0x2fdd41[_0x2a06('0x2d')][_0x2a06('0x33')](_0x2a06('0x59'))){_0x40d316[_0x2a06('0x1b')]=qs['limit'](_0x2fdd41['query'][_0x2a06('0x1b')]);_0x40d316['offset']=qs[_0x2a06('0x19')](_0x2fdd41[_0x2a06('0x2d')][_0x2a06('0x19')]);}_0x40d316[_0x2a06('0x34')]=qs['sort'](_0x2fdd41['query'][_0x2a06('0x35')]);_0x40d316['where']=qs[_0x2a06('0x2f')](_[_0x2a06('0x36')](_0x2fdd41[_0x2a06('0x2d')],_0x1899c4[_0x2a06('0x2f')]));_0x40d316[_0x2a06('0x38')][_0x2a06('0x5a')]=_0x481f42['id'];if(_0x2fdd41[_0x2a06('0x2d')][_0x2a06('0x37')]){_0x40d316[_0x2a06('0x38')]=_[_0x2a06('0x3b')](_0x40d316[_0x2a06('0x38')],{'$or':_[_0x2a06('0x2c')](_0x40d316[_0x2a06('0x31')],function(_0x3b4236){var _0x3f2555={};_0x3f2555[_0x3b4236]={'$like':'%'+_0x2fdd41[_0x2a06('0x2d')][_0x2a06('0x37')]+'%'};return _0x3f2555;})});}_0x40d316=_[_0x2a06('0x3b')]({},_0x40d316,_0x2fdd41[_0x2a06('0x3c')]);return db[_0x2a06('0x58')][_0x2a06('0x1c')]({'where':_0x40d316[_0x2a06('0x38')]})['then'](function(_0x27b2ed){_0x505c94[_0x2a06('0x1c')]=_0x27b2ed;if(_0x2fdd41[_0x2a06('0x2d')][_0x2a06('0x46')]){_0x40d316[_0x2a06('0x3e')]=[{'all':!![]}];}return db[_0x2a06('0x58')]['findAll'](_0x40d316);})[_0x2a06('0x23')](function(_0x1944f8){_0x505c94[_0x2a06('0x40')]=_0x1944f8;return _0x505c94;});}})['then'](respondWithFilteredResult(_0x9135c3,_0x40d316))['catch'](handleError(_0x9135c3,null));};exports[_0x2a06('0x5b')]=function(_0x514d46,_0x225f54,_0x411f80){var _0x3091e2={'raw':!![],'where':{}};var _0x13944a={};var _0x1550a9={'count':0x0,'rows':[]};return db[_0x2a06('0x3d')][_0x2a06('0x5c')]({'where':{'id':_0x514d46['params']['id']}})['then'](handleEntityNotFound(_0x225f54,null))[_0x2a06('0x23')](function(_0x6940f1){if(_0x6940f1){_0x13944a[_0x2a06('0x2b')]=_[_0x2a06('0x2e')](db['CmHopperHistory'][_0x2a06('0x44')]);_0x13944a['query']=_['keys'](_0x514d46[_0x2a06('0x2d')]);_0x13944a[_0x2a06('0x2f')]=_[_0x2a06('0x30')](_0x13944a['model'],_0x13944a['query']);_0x3091e2[_0x2a06('0x31')]=_[_0x2a06('0x30')](_0x13944a[_0x2a06('0x2b')],qs['fields'](_0x514d46[_0x2a06('0x2d')][_0x2a06('0x32')]));_0x3091e2[_0x2a06('0x31')]=_0x3091e2['attributes'][_0x2a06('0x45')]?_0x3091e2[_0x2a06('0x31')]:_0x13944a[_0x2a06('0x2b')];if(!_0x514d46[_0x2a06('0x2d')][_0x2a06('0x33')](_0x2a06('0x59'))){_0x3091e2[_0x2a06('0x1b')]=qs['limit'](_0x514d46[_0x2a06('0x2d')][_0x2a06('0x1b')]);_0x3091e2[_0x2a06('0x19')]=qs['offset'](_0x514d46[_0x2a06('0x2d')][_0x2a06('0x19')]);}_0x3091e2['order']=qs[_0x2a06('0x35')](_0x514d46[_0x2a06('0x2d')][_0x2a06('0x35')]);_0x3091e2['where']=qs['filters'](_[_0x2a06('0x36')](_0x514d46[_0x2a06('0x2d')],_0x13944a[_0x2a06('0x2f')]));_0x3091e2[_0x2a06('0x38')]['CampaignId']=_0x6940f1['id'];if(_0x514d46[_0x2a06('0x2d')][_0x2a06('0x37')]){_0x3091e2['where']=_[_0x2a06('0x3b')](_0x3091e2['where'],{'$or':_[_0x2a06('0x2c')](_0x3091e2[_0x2a06('0x31')],function(_0x41727e){var _0x12fb70={};_0x12fb70[_0x41727e]={'$like':'%'+_0x514d46[_0x2a06('0x2d')][_0x2a06('0x37')]+'%'};return _0x12fb70;})});}_0x3091e2=_[_0x2a06('0x3b')]({},_0x3091e2,_0x514d46[_0x2a06('0x3c')]);return db[_0x2a06('0x5d')]['count']({'where':_0x3091e2[_0x2a06('0x38')]})['then'](function(_0xfc212b){_0x1550a9[_0x2a06('0x1c')]=_0xfc212b;if(_0x514d46[_0x2a06('0x2d')][_0x2a06('0x46')]){_0x3091e2['include']=[{'all':!![]}];}return db[_0x2a06('0x5d')][_0x2a06('0x3f')](_0x3091e2);})[_0x2a06('0x23')](function(_0x1403d4){_0x1550a9['rows']=_0x1403d4;return _0x1550a9;});}})['then'](respondWithFilteredResult(_0x225f54,_0x3091e2))[_0x2a06('0x41')](handleError(_0x225f54,null));};exports[_0x2a06('0x5e')]=function(_0x378603,_0x581416,_0x5ca2b5){var _0x452e0d={'raw':!![],'where':{}};var _0x700914={};var _0x5471f6={'count':0x0,'rows':[]};return db[_0x2a06('0x3d')][_0x2a06('0x5c')]({'where':{'id':_0x378603['params']['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x581416,null))[_0x2a06('0x23')](function(_0x127201){if(_0x127201){_0x700914[_0x2a06('0x2b')]=_[_0x2a06('0x2e')](db[_0x2a06('0x5f')]['rawAttributes']);_0x700914[_0x2a06('0x2d')]=_['keys'](_0x378603[_0x2a06('0x2d')]);_0x700914[_0x2a06('0x2f')]=_[_0x2a06('0x30')](_0x700914[_0x2a06('0x2b')],_0x700914[_0x2a06('0x2d')]);_0x452e0d[_0x2a06('0x31')]=_[_0x2a06('0x30')](_0x700914[_0x2a06('0x2b')],qs[_0x2a06('0x32')](_0x378603['query'][_0x2a06('0x32')]));_0x452e0d[_0x2a06('0x31')]=_0x452e0d[_0x2a06('0x31')][_0x2a06('0x45')]?_0x452e0d[_0x2a06('0x31')]:_0x700914[_0x2a06('0x2b')];if(!_0x378603['query']['hasOwnProperty']('nolimit')){_0x452e0d[_0x2a06('0x1b')]=qs[_0x2a06('0x1b')](_0x378603[_0x2a06('0x2d')][_0x2a06('0x1b')]);_0x452e0d['offset']=qs['offset'](_0x378603['query'][_0x2a06('0x19')]);}_0x452e0d['order']=qs['sort'](_0x378603[_0x2a06('0x2d')][_0x2a06('0x35')]);_0x452e0d[_0x2a06('0x38')]=qs[_0x2a06('0x2f')](_[_0x2a06('0x36')](_0x378603['query'],_0x700914[_0x2a06('0x2f')]));_0x452e0d[_0x2a06('0x38')][_0x2a06('0x5a')]=_0x127201['id'];if(_0x378603['query'][_0x2a06('0x37')]){_0x452e0d[_0x2a06('0x38')]=_[_0x2a06('0x3b')](_0x452e0d[_0x2a06('0x38')],{'$or':_[_0x2a06('0x2c')](_0x452e0d[_0x2a06('0x31')],function(_0x1924c1){var _0x139676={};_0x139676[_0x1924c1]={'$like':'%'+_0x378603[_0x2a06('0x2d')][_0x2a06('0x37')]+'%'};return _0x139676;})});}_0x452e0d=_[_0x2a06('0x3b')]({},_0x452e0d,_0x378603[_0x2a06('0x3c')]);return db[_0x2a06('0x5f')][_0x2a06('0x1c')]({'where':_0x452e0d[_0x2a06('0x38')]})['then'](function(_0x56aa46){_0x5471f6['count']=_0x56aa46;if(_0x378603[_0x2a06('0x2d')]['includeAll']){_0x452e0d[_0x2a06('0x3e')]=[{'all':!![]}];}return db[_0x2a06('0x5f')][_0x2a06('0x3f')](_0x452e0d);})[_0x2a06('0x23')](function(_0x107621){_0x5471f6[_0x2a06('0x40')]=_0x107621;return _0x5471f6;});}})[_0x2a06('0x23')](respondWithFilteredResult(_0x581416,_0x452e0d))[_0x2a06('0x41')](handleError(_0x581416,null));};exports[_0x2a06('0x60')]=function(_0x776f8d,_0x3117c8,_0x149c22){var _0x443ba7={'raw':!![],'where':{}};var _0x207f7a={};var _0x4c4f49={'count':0x0,'rows':[]};return db[_0x2a06('0x3d')][_0x2a06('0x5c')]({'where':{'id':_0x776f8d[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x3117c8,null))[_0x2a06('0x23')](function(_0x54d332){if(_0x54d332){_0x207f7a[_0x2a06('0x2b')]=_[_0x2a06('0x2e')](db[_0x2a06('0x61')][_0x2a06('0x44')]);_0x207f7a[_0x2a06('0x2d')]=_[_0x2a06('0x2e')](_0x776f8d[_0x2a06('0x2d')]);_0x207f7a['filters']=_[_0x2a06('0x30')](_0x207f7a[_0x2a06('0x2b')],_0x207f7a[_0x2a06('0x2d')]);_0x443ba7[_0x2a06('0x31')]=_['intersection'](_0x207f7a[_0x2a06('0x2b')],qs[_0x2a06('0x32')](_0x776f8d[_0x2a06('0x2d')][_0x2a06('0x32')]));_0x443ba7[_0x2a06('0x31')]=_0x443ba7[_0x2a06('0x31')][_0x2a06('0x45')]?_0x443ba7[_0x2a06('0x31')]:_0x207f7a[_0x2a06('0x2b')];if(!_0x776f8d[_0x2a06('0x2d')][_0x2a06('0x33')](_0x2a06('0x59'))){_0x443ba7[_0x2a06('0x1b')]=qs[_0x2a06('0x1b')](_0x776f8d['query'][_0x2a06('0x1b')]);_0x443ba7[_0x2a06('0x19')]=qs['offset'](_0x776f8d[_0x2a06('0x2d')][_0x2a06('0x19')]);}_0x443ba7[_0x2a06('0x34')]=qs[_0x2a06('0x35')](_0x776f8d[_0x2a06('0x2d')][_0x2a06('0x35')]);_0x443ba7['where']=qs[_0x2a06('0x2f')](_[_0x2a06('0x36')](_0x776f8d[_0x2a06('0x2d')],_0x207f7a['filters']));_0x443ba7[_0x2a06('0x38')][_0x2a06('0x5a')]=_0x54d332['id'];if(_0x776f8d[_0x2a06('0x2d')]['filter']){_0x443ba7[_0x2a06('0x38')]=_[_0x2a06('0x3b')](_0x443ba7[_0x2a06('0x38')],{'$or':_[_0x2a06('0x2c')](_0x443ba7[_0x2a06('0x31')],function(_0x45b155){var _0x464069={};_0x464069[_0x45b155]={'$like':'%'+_0x776f8d[_0x2a06('0x2d')][_0x2a06('0x37')]+'%'};return _0x464069;})});}_0x443ba7=_[_0x2a06('0x3b')]({},_0x443ba7,_0x776f8d[_0x2a06('0x3c')]);return db[_0x2a06('0x61')]['count']({'where':_0x443ba7['where']})[_0x2a06('0x23')](function(_0x3e0c88){_0x4c4f49['count']=_0x3e0c88;if(_0x776f8d[_0x2a06('0x2d')][_0x2a06('0x46')]){_0x443ba7['include']=[{'all':!![]}];}return db[_0x2a06('0x61')]['findAll'](_0x443ba7);})[_0x2a06('0x23')](function(_0x2aab21){_0x4c4f49[_0x2a06('0x40')]=_0x2aab21;return _0x4c4f49;});}})['then'](respondWithFilteredResult(_0x3117c8,_0x443ba7))[_0x2a06('0x41')](handleError(_0x3117c8,null));};exports[_0x2a06('0x62')]=function(_0x5a2e36,_0xc448c6,_0x3d6bfb){var _0xf04a32={};var _0x394595={};var _0x3a396e;var _0x52ca9a;return db[_0x2a06('0x3d')][_0x2a06('0x5c')]({'where':{'id':_0x5a2e36[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0xc448c6,null))[_0x2a06('0x23')](function(_0x5670eb){if(_0x5670eb){_0x3a396e=_0x5670eb;_0x394595['model']=_[_0x2a06('0x2e')](db[_0x2a06('0x63')][_0x2a06('0x44')]);_0x394595['query']=_[_0x2a06('0x2e')](_0x5a2e36['query']);_0x394595[_0x2a06('0x2f')]=_[_0x2a06('0x30')](_0x394595['model'],_0x394595[_0x2a06('0x2d')]);_0xf04a32[_0x2a06('0x31')]=_[_0x2a06('0x30')](_0x394595[_0x2a06('0x2b')],qs[_0x2a06('0x32')](_0x5a2e36[_0x2a06('0x2d')][_0x2a06('0x32')]));_0xf04a32[_0x2a06('0x31')]=_0xf04a32[_0x2a06('0x31')][_0x2a06('0x45')]?_0xf04a32[_0x2a06('0x31')]:_0x394595['model'];_0xf04a32[_0x2a06('0x34')]=qs[_0x2a06('0x35')](_0x5a2e36[_0x2a06('0x2d')][_0x2a06('0x35')]);_0xf04a32[_0x2a06('0x38')]=qs[_0x2a06('0x2f')](_[_0x2a06('0x36')](_0x5a2e36['query'],_0x394595[_0x2a06('0x2f')]));if(_0x5a2e36[_0x2a06('0x2d')][_0x2a06('0x37')]){_0xf04a32['where']=_[_0x2a06('0x3b')](_0xf04a32[_0x2a06('0x38')],{'$or':_['map'](_0xf04a32[_0x2a06('0x31')],function(_0x123191){var _0x3cff1a={};_0x3cff1a[_0x123191]={'$like':'%'+_0x5a2e36[_0x2a06('0x2d')][_0x2a06('0x37')]+'%'};return _0x3cff1a;})});}_0xf04a32=_[_0x2a06('0x3b')]({},_0xf04a32,_0x5a2e36[_0x2a06('0x3c')]);return _0x3a396e[_0x2a06('0x62')](_0xf04a32);}})[_0x2a06('0x23')](function(_0x5f3830){if(_0x5f3830){_0x52ca9a=_0x5f3830[_0x2a06('0x45')];if(!_0x5a2e36['query'][_0x2a06('0x33')]('nolimit')){_0xf04a32[_0x2a06('0x1b')]=qs[_0x2a06('0x1b')](_0x5a2e36[_0x2a06('0x2d')][_0x2a06('0x1b')]);_0xf04a32[_0x2a06('0x19')]=qs[_0x2a06('0x19')](_0x5a2e36[_0x2a06('0x2d')][_0x2a06('0x19')]);}return _0x3a396e['getLists'](_0xf04a32);}})[_0x2a06('0x23')](function(_0x152075){if(_0x152075){return _0x152075?{'count':_0x52ca9a,'rows':_0x152075}:null;}})['then'](respondWithResult(_0xc448c6,null))[_0x2a06('0x41')](handleError(_0xc448c6,null));};exports[_0x2a06('0x64')]=function(_0x3d98c9,_0x476d20,_0x263065){var _0x59cc37,_0x4851ba;var _0x172437=[];var _0x72e86d=moment()[_0x2a06('0x65')](_0x2a06('0x66'));return db[_0x2a06('0x3d')][_0x2a06('0x47')]({'where':{'id':_0x3d98c9[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x476d20,null))['then'](function(_0x5dcec2){if(_0x5dcec2){_0x4851ba=_0x5dcec2;return _0x5dcec2['addLists'](_0x3d98c9[_0x2a06('0x49')][_0x2a06('0x67')],_[_0x2a06('0x52')](_0x3d98c9[_0x2a06('0x49')],[_0x2a06('0x67'),'id'])||{});}return null;})[_0x2a06('0x68')](function(_0x357e6a){var _0x19b1bb;var _0xe052ee;_0x59cc37=_0x357e6a||[];var _0x327bf2=[];if(_0x357e6a){for(var _0x476df8=0x0;_0x476df8<_0x357e6a[_0x2a06('0x45')];_0x476df8+=0x1){var _0x3980b5=_0x357e6a[_0x476df8][_0x2a06('0x24')]({'plain':!![]});_0x4851ba['dialCheckDuplicateType']=_0x3d98c9['body'][_0x2a06('0x69')]?_0x3d98c9[_0x2a06('0x49')]['dialCheckDuplicateType']:_0x4851ba[_0x2a06('0x69')];switch(_0x4851ba[_0x2a06('0x69')]){case'always':_0x19b1bb=squel[_0x2a06('0x6a')]()[_0x2a06('0x6b')](_0x2a06('0x6c'))[_0x2a06('0x6d')]([_0x2a06('0x6e'),_0x2a06('0x6f'),_0x2a06('0x70'),_0x2a06('0x71'),_0x2a06('0x5a'),'createdAt',_0x2a06('0x54')],squel[_0x2a06('0x72')]()[_0x2a06('0x73')](_0x2a06('0x6e'),_0x2a06('0x6e'))[_0x2a06('0x73')](_0x2a06('0x74'),_0x2a06('0x6f'))['field']('id','ContactId')[_0x2a06('0x73')](_0x3980b5[_0x2a06('0x75')][_0x2a06('0x76')](),'ListId')[_0x2a06('0x73')](_0x3d98c9['params']['id']['toString'](),_0x2a06('0x5a'))['field']('\x27'+_0x72e86d+'\x27',_0x2a06('0x53'))[_0x2a06('0x73')]('\x27'+_0x72e86d+'\x27',_0x2a06('0x54'))[_0x2a06('0x77')](_0x2a06('0x78'))[_0x2a06('0x38')]('deletedAt\x20IS\x20NULL')[_0x2a06('0x38')](_0x2a06('0x79'),_0x3980b5[_0x2a06('0x75')][_0x2a06('0x76')]())[_0x2a06('0x38')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x2a06('0x7a'),squel[_0x2a06('0x72')]()[_0x2a06('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0x2a06('0x77')](_0x2a06('0x7b'))['where'](_0x2a06('0x7c'),_0x3d98c9[_0x2a06('0x43')]['id']['toString']()))[_0x2a06('0x38')](_0x2a06('0x7a'),squel['select']()[_0x2a06('0x73')](_0x2a06('0x7d'))['from'](_0x2a06('0x6c'))[_0x2a06('0x38')](_0x2a06('0x7c'),_0x3d98c9['params']['id']['toString']())))['toString']();break;case _0x2a06('0x7e'):_0x19b1bb=squel[_0x2a06('0x6a')]()[_0x2a06('0x6b')]('cm_hopper')[_0x2a06('0x6d')]([_0x2a06('0x6e'),_0x2a06('0x6f'),_0x2a06('0x70'),_0x2a06('0x71'),_0x2a06('0x5a'),_0x2a06('0x53'),'updatedAt'],squel[_0x2a06('0x72')]()[_0x2a06('0x73')](_0x2a06('0x6e'),_0x2a06('0x6e'))['field'](_0x2a06('0x74'),'scheduledAt')['field']('id',_0x2a06('0x70'))[_0x2a06('0x73')](_0x3980b5['CmListId']['toString'](),'ListId')[_0x2a06('0x73')](_0x3d98c9[_0x2a06('0x43')]['id'][_0x2a06('0x76')](),_0x2a06('0x5a'))['field']('\x27'+_0x72e86d+'\x27','createdAt')[_0x2a06('0x73')]('\x27'+_0x72e86d+'\x27',_0x2a06('0x54'))[_0x2a06('0x77')](_0x2a06('0x78'))[_0x2a06('0x38')](_0x2a06('0x7f'))[_0x2a06('0x38')](_0x2a06('0x79'),_0x3980b5[_0x2a06('0x75')][_0x2a06('0x76')]())[_0x2a06('0x38')](_0x2a06('0x80'))[_0x2a06('0x38')](_0x2a06('0x7a'),squel[_0x2a06('0x72')]()[_0x2a06('0x73')](_0x2a06('0x7d'))['from']('cm_hopper')['where'](_0x2a06('0x7c'),_0x3d98c9[_0x2a06('0x43')]['id'][_0x2a06('0x76')]())))[_0x2a06('0x76')]();break;default:_0x19b1bb=squel[_0x2a06('0x6a')]()['into']('cm_hopper')[_0x2a06('0x6d')]([_0x2a06('0x6e'),_0x2a06('0x6f'),_0x2a06('0x70'),_0x2a06('0x71'),_0x2a06('0x5a'),_0x2a06('0x53'),'updatedAt'],squel[_0x2a06('0x72')]()['field'](_0x2a06('0x6e'),_0x2a06('0x6e'))[_0x2a06('0x73')]('NOW()',_0x2a06('0x6f'))['field']('id',_0x2a06('0x70'))[_0x2a06('0x73')](_0x3980b5['CmListId'][_0x2a06('0x76')](),_0x2a06('0x71'))[_0x2a06('0x73')](_0x3d98c9[_0x2a06('0x43')]['id']['toString'](),_0x2a06('0x5a'))[_0x2a06('0x73')]('\x27'+_0x72e86d+'\x27','createdAt')[_0x2a06('0x73')]('\x27'+_0x72e86d+'\x27',_0x2a06('0x54'))[_0x2a06('0x77')]('cm_contacts')[_0x2a06('0x38')]('deletedAt\x20IS\x20NULL')[_0x2a06('0x38')](_0x2a06('0x79'),_0x3980b5[_0x2a06('0x75')][_0x2a06('0x76')]())[_0x2a06('0x38')](_0x2a06('0x80')))['toString']();}_0xe052ee=squel[_0x2a06('0x6a')]()[_0x2a06('0x6b')](_0x2a06('0x81'))['fromQuery'](['cmHopperId',_0x2a06('0x6f'),_0x2a06('0x6e'),_0x2a06('0x82'),'createdAt',_0x2a06('0x54')],squel[_0x2a06('0x72')]()['field'](_0x2a06('0x83'),'id')[_0x2a06('0x73')](_0x2a06('0x74'),_0x2a06('0x6f'))['field']('ci.item','phone')['field'](_0x2a06('0x84'),_0x2a06('0x82'))['field']('\x27'+_0x72e86d+'\x27','createdAt')['field']('\x27'+_0x72e86d+'\x27','updatedAt')['from'](_0x2a06('0x85'),'ci')['join']('cm_hopper','h',_0x2a06('0x86'))[_0x2a06('0x38')](_0x2a06('0x87'),_0x3980b5[_0x2a06('0x75')][_0x2a06('0x76')]())[_0x2a06('0x38')](_0x2a06('0x88'),_0x3d98c9[_0x2a06('0x43')]['id'][_0x2a06('0x76')]())[_0x2a06('0x38')]('h.createdAt\x20=\x20?',_0x72e86d))[_0x2a06('0x76')]();_0x327bf2['push'](db[_0x2a06('0x89')]['query'](_0x19b1bb));_0x172437[_0x2a06('0x8a')](db[_0x2a06('0x89')][_0x2a06('0x2d')](_0xe052ee));}return BPromise['all'](_0x327bf2);}})['then'](function(){return BPromise[_0x2a06('0x8b')](_0x172437);})[_0x2a06('0x23')](function(){return _0x59cc37;})[_0x2a06('0x23')](respondWithResult(_0x476d20,null))[_0x2a06('0x41')](handleError(_0x476d20,null));};exports['removeLists']=function(_0x478b76,_0x5c53ee,_0x2a4bba){return db[_0x2a06('0x3d')][_0x2a06('0x47')]({'where':{'id':_0x478b76[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x5c53ee,null))[_0x2a06('0x23')](function(_0x5d3dcd){if(_0x5d3dcd){return _0x5d3dcd[_0x2a06('0x8c')](_0x478b76[_0x2a06('0x2d')][_0x2a06('0x67')]);}})['then'](function(_0x5e7bb3){if(_0x5e7bb3){return db[_0x2a06('0x58')][_0x2a06('0x22')]({'where':{'ListId':_0x478b76[_0x2a06('0x2d')][_0x2a06('0x67')],'CampaignId':_0x478b76[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](function(){return _0x5e7bb3;});}})[_0x2a06('0x23')](respondWithStatusCode(_0x5c53ee,null))[_0x2a06('0x41')](handleError(_0x5c53ee,null));};exports['getBlackLists']=function(_0x86266a,_0x795d1b,_0x56d2f9){var _0x295a03={};var _0x51e0ad={};var _0x493aa4;var _0x12bb0f;return db[_0x2a06('0x3d')]['findOne']({'where':{'id':_0x86266a[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x795d1b,null))[_0x2a06('0x23')](function(_0x5bcbb8){if(_0x5bcbb8){_0x493aa4=_0x5bcbb8;_0x51e0ad[_0x2a06('0x2b')]=_[_0x2a06('0x2e')](db[_0x2a06('0x63')][_0x2a06('0x44')]);_0x51e0ad[_0x2a06('0x2d')]=_[_0x2a06('0x2e')](_0x86266a[_0x2a06('0x2d')]);_0x51e0ad['filters']=_[_0x2a06('0x30')](_0x51e0ad[_0x2a06('0x2b')],_0x51e0ad[_0x2a06('0x2d')]);_0x295a03[_0x2a06('0x31')]=_[_0x2a06('0x30')](_0x51e0ad['model'],qs['fields'](_0x86266a[_0x2a06('0x2d')]['fields']));_0x295a03['attributes']=_0x295a03['attributes'][_0x2a06('0x45')]?_0x295a03[_0x2a06('0x31')]:_0x51e0ad['model'];_0x295a03[_0x2a06('0x34')]=qs[_0x2a06('0x35')](_0x86266a[_0x2a06('0x2d')][_0x2a06('0x35')]);_0x295a03['where']=qs[_0x2a06('0x2f')](_[_0x2a06('0x36')](_0x86266a[_0x2a06('0x2d')],_0x51e0ad[_0x2a06('0x2f')]));if(_0x86266a[_0x2a06('0x2d')][_0x2a06('0x37')]){_0x295a03['where']=_['merge'](_0x295a03['where'],{'$or':_[_0x2a06('0x2c')](_0x295a03[_0x2a06('0x31')],function(_0x56d0be){var _0x421190={};_0x421190[_0x56d0be]={'$like':'%'+_0x86266a[_0x2a06('0x2d')][_0x2a06('0x37')]+'%'};return _0x421190;})});}_0x295a03=_[_0x2a06('0x3b')]({},_0x295a03,_0x86266a[_0x2a06('0x3c')]);return _0x493aa4[_0x2a06('0x8d')](_0x295a03);}})['then'](function(_0x24bcac){if(_0x24bcac){_0x12bb0f=_0x24bcac[_0x2a06('0x45')];if(!_0x86266a[_0x2a06('0x2d')][_0x2a06('0x33')]('nolimit')){_0x295a03[_0x2a06('0x1b')]=qs[_0x2a06('0x1b')](_0x86266a['query'][_0x2a06('0x1b')]);_0x295a03[_0x2a06('0x19')]=qs[_0x2a06('0x19')](_0x86266a[_0x2a06('0x2d')]['offset']);}return _0x493aa4['getBlackLists'](_0x295a03);}})[_0x2a06('0x23')](function(_0x29e22f){if(_0x29e22f){return _0x29e22f?{'count':_0x12bb0f,'rows':_0x29e22f}:null;}})[_0x2a06('0x23')](respondWithResult(_0x795d1b,null))[_0x2a06('0x41')](handleError(_0x795d1b,null));};exports['addBlackLists']=function(_0x5b87e3,_0xde6f6f,_0xfb19b8){var _0x38a536,_0x3462cf;var _0x2fb24d=[];var _0x378a66=moment()[_0x2a06('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2a06('0x3d')][_0x2a06('0x47')]({'where':{'id':_0x5b87e3[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0xde6f6f,null))[_0x2a06('0x23')](function(_0xbb1b48){if(_0xbb1b48){_0x3462cf=_0xbb1b48;return _0xbb1b48[_0x2a06('0x8e')](_0x5b87e3['body'][_0x2a06('0x67')],_[_0x2a06('0x52')](_0x5b87e3[_0x2a06('0x49')],[_0x2a06('0x67'),'id'])||{});}return null;})['spread'](function(_0x21f35c){var _0x2d0995;var _0x125b44;_0x38a536=_0x21f35c||[];var _0x31e19b=[];if(_0x21f35c){for(var _0x8b8832=0x0;_0x8b8832<_0x21f35c[_0x2a06('0x45')];_0x8b8832+=0x1){var _0x20a33c=_0x21f35c[_0x8b8832]['get']({'plain':!![]});_0x2d0995=squel[_0x2a06('0x6a')]()[_0x2a06('0x6b')]('cm_hopper_black')[_0x2a06('0x6d')]([_0x2a06('0x6e'),_0x2a06('0x70'),_0x2a06('0x71'),_0x2a06('0x5a'),_0x2a06('0x53'),_0x2a06('0x54')],squel[_0x2a06('0x72')]()[_0x2a06('0x73')]('phone','phone')[_0x2a06('0x73')]('id',_0x2a06('0x70'))[_0x2a06('0x73')](_0x20a33c[_0x2a06('0x75')][_0x2a06('0x76')](),_0x2a06('0x71'))['field'](_0x5b87e3['params']['id'][_0x2a06('0x76')](),_0x2a06('0x5a'))['field'](_0x2a06('0x74'),_0x2a06('0x53'))['field'](_0x2a06('0x74'),_0x2a06('0x54'))[_0x2a06('0x77')](_0x2a06('0x78'))[_0x2a06('0x38')](_0x2a06('0x7f'))['where'](_0x2a06('0x79'),_0x20a33c['CmListId']['toString']())[_0x2a06('0x38')](_0x2a06('0x80')))[_0x2a06('0x76')]();_0x31e19b[_0x2a06('0x8a')](db[_0x2a06('0x89')][_0x2a06('0x2d')](_0x2d0995));}return BPromise[_0x2a06('0x8b')](_0x31e19b);}})['then'](function(){return _0x38a536;})[_0x2a06('0x23')](respondWithResult(_0xde6f6f,null))[_0x2a06('0x41')](handleError(_0xde6f6f,null));};exports['removeBlackLists']=function(_0xe99e50,_0x42631d,_0x2fb2d6){return db[_0x2a06('0x3d')][_0x2a06('0x47')]({'where':{'id':_0xe99e50[_0x2a06('0x43')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x42631d,null))['then'](function(_0x1b13b0){if(_0x1b13b0){return _0x1b13b0[_0x2a06('0x8f')](_0xe99e50['query'][_0x2a06('0x67')]);}})[_0x2a06('0x23')](function(_0x411e61){if(_0x411e61){return db[_0x2a06('0x61')][_0x2a06('0x22')]({'where':{'ListId':_0xe99e50[_0x2a06('0x2d')][_0x2a06('0x67')],'CampaignId':_0xe99e50[_0x2a06('0x43')]['id']}})['then'](function(){return _0x411e61;});}})[_0x2a06('0x23')](respondWithStatusCode(_0x42631d,null))[_0x2a06('0x41')](handleError(_0x42631d,null));}; \ No newline at end of file +var _0x00a4=['destroy','end','sendStatus','error','stack','name','index','Campaign','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','clone','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','sort','pick','CampaignId','findOne','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','COALESCE(phone,\x27\x27)','into','cm_hopper_additional_phones','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','insert','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','IvrCampaigns'];(function(_0x5c0d48,_0x3731e9){var _0x1b5331=function(_0x2287b8){while(--_0x2287b8){_0x5c0d48['push'](_0x5c0d48['shift']());}};_0x1b5331(++_0x3731e9);}(_0x00a4,0x186));var _0x400a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x00a4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x400a('0x0'));var rimraf=require(_0x400a('0x1'));var zipdir=require(_0x400a('0x2'));var jsonpatch=require(_0x400a('0x3'));var rp=require(_0x400a('0x4'));var moment=require('moment');var BPromise=require(_0x400a('0x5'));var Mustache=require('mustache');var util=require(_0x400a('0x6'));var path=require(_0x400a('0x7'));var sox=require('sox');var csv=require(_0x400a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x400a('0x9'));var squel=require(_0x400a('0xa'));var crypto=require(_0x400a('0xb'));var jsforce=require(_0x400a('0xc'));var deskjs=require(_0x400a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x400a('0xe'));var Papa=require(_0x400a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x400a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x400a('0x11'))(_0x400a('0x12'));var utils=require(_0x400a('0x13'));var config=require(_0x400a('0x14'));var licenseUtil=require(_0x400a('0x15'));var db=require(_0x400a('0x16'))['db'];function respondWithStatusCode(_0x49ebbd,_0x3b81e2){_0x3b81e2=_0x3b81e2||0xcc;return function(_0x74be0f){if(_0x74be0f){return _0x49ebbd['sendStatus'](_0x3b81e2);}return _0x49ebbd['status'](_0x3b81e2)['end']();};}function respondWithResult(_0x203759,_0x188c99){_0x188c99=_0x188c99||0xc8;return function(_0x2967aa){if(_0x2967aa){return _0x203759[_0x400a('0x17')](_0x188c99)[_0x400a('0x18')](_0x2967aa);}};}function respondWithFilteredResult(_0x41f35e,_0x5d86e1){return function(_0x275286){if(_0x275286){var _0xfd25c6=typeof _0x5d86e1[_0x400a('0x19')]===_0x400a('0x1a')&&typeof _0x5d86e1[_0x400a('0x1b')]===_0x400a('0x1a');var _0x1506c4=_0x275286['count'];var _0x2e6831=_0xfd25c6?0x0:_0x5d86e1[_0x400a('0x19')];var _0x267a4e=_0xfd25c6?_0x275286[_0x400a('0x1c')]:_0x5d86e1[_0x400a('0x19')]+_0x5d86e1[_0x400a('0x1b')];var _0x4c7ddf;if(_0x267a4e>=_0x1506c4){_0x267a4e=_0x1506c4;_0x4c7ddf=0xc8;}else{_0x4c7ddf=0xce;}_0x41f35e[_0x400a('0x17')](_0x4c7ddf);return _0x41f35e[_0x400a('0x1d')](_0x400a('0x1e'),_0x2e6831+'-'+_0x267a4e+'/'+_0x1506c4)['json'](_0x275286);}return null;};}function patchUpdates(_0xd7e75d){return function(_0x1ccb14){try{jsonpatch['apply'](_0x1ccb14,_0xd7e75d,!![]);}catch(_0x47f63a){return BPromise[_0x400a('0x1f')](_0x47f63a);}return _0x1ccb14['save']();};}function saveUpdates(_0x182b05,_0x368d55){return function(_0x11e1fa){if(_0x11e1fa){return _0x11e1fa[_0x400a('0x20')](_0x182b05)[_0x400a('0x21')](function(_0x11db80){return _0x11db80;});}return null;};}function removeEntity(_0x369387,_0x7ec3bb){return function(_0x4f4912){if(_0x4f4912){return _0x4f4912['destroy']()[_0x400a('0x21')](function(){var _0x3524b8=_0x4f4912[_0x400a('0x22')]({'plain':!![]});var _0x26682f=_0x400a('0x23');return db['UserProfileResource'][_0x400a('0x24')]({'where':{'type':_0x26682f,'resourceId':_0x3524b8['id']}})[_0x400a('0x21')](function(){return _0x4f4912;});})[_0x400a('0x21')](function(){_0x369387['status'](0xcc)[_0x400a('0x25')]();});}};}function handleEntityNotFound(_0x3f8a81,_0x46a244){return function(_0x50fbc0){if(!_0x50fbc0){_0x3f8a81[_0x400a('0x26')](0x194);}return _0x50fbc0;};}function handleError(_0x4644c2,_0x1f103e){_0x1f103e=_0x1f103e||0x1f4;return function(_0x3e7c43){logger[_0x400a('0x27')](_0x3e7c43[_0x400a('0x28')]);if(_0x3e7c43[_0x400a('0x29')]){delete _0x3e7c43[_0x400a('0x29')];}_0x4644c2[_0x400a('0x17')](_0x1f103e)['send'](_0x3e7c43);};}exports[_0x400a('0x2a')]=function(_0x2caadf,_0x2753e4){var _0x445bda={},_0x1597e4={},_0x3cb8b4={'count':0x0,'rows':[]};var _0x3cb040=_['map'](db[_0x400a('0x2b')]['rawAttributes'],function(_0x1f6b23){return{'name':_0x1f6b23[_0x400a('0x2c')],'type':_0x1f6b23['type'][_0x400a('0x2d')]};});_0x1597e4['model']=_[_0x400a('0x2e')](_0x3cb040,_0x400a('0x29'));_0x1597e4['query']=_[_0x400a('0x2f')](_0x2caadf[_0x400a('0x30')]);_0x1597e4[_0x400a('0x31')]=_[_0x400a('0x32')](_0x1597e4[_0x400a('0x33')],_0x1597e4['query']);_0x445bda[_0x400a('0x34')]=_[_0x400a('0x32')](_0x1597e4['model'],qs[_0x400a('0x35')](_0x2caadf['query'][_0x400a('0x35')]));_0x445bda[_0x400a('0x34')]=_0x445bda[_0x400a('0x34')][_0x400a('0x36')]?_0x445bda['attributes']:_0x1597e4['model'];if(!_0x2caadf[_0x400a('0x30')][_0x400a('0x37')](_0x400a('0x38'))){_0x445bda[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x2caadf['query'][_0x400a('0x1b')]);_0x445bda['offset']=qs[_0x400a('0x19')](_0x2caadf[_0x400a('0x30')]['offset']);}_0x445bda[_0x400a('0x39')]=qs['sort'](_0x2caadf[_0x400a('0x30')]['sort']);_0x445bda[_0x400a('0x3a')]=qs[_0x400a('0x31')](_['pick'](_0x2caadf['query'],_0x1597e4['filters']),_0x3cb040);if(_0x2caadf['query'][_0x400a('0x3b')]){_0x445bda[_0x400a('0x3a')]=_[_0x400a('0x3c')](_0x445bda['where'],{'$or':_['map'](_0x3cb040,function(_0x3d731a){if(_0x3d731a[_0x400a('0x3d')]!==_0x400a('0x3e')){var _0x3e5cd7={};_0x3e5cd7[_0x3d731a[_0x400a('0x29')]]={'$like':'%'+_0x2caadf['query'][_0x400a('0x3b')]+'%'};return _0x3e5cd7;}})});}_0x445bda=_[_0x400a('0x3c')]({},_0x445bda,_0x2caadf[_0x400a('0x3f')]);var _0x388c38={'where':_0x445bda[_0x400a('0x3a')]};return db[_0x400a('0x2b')][_0x400a('0x1c')](_0x388c38)[_0x400a('0x21')](function(_0x409d25){_0x3cb8b4['count']=_0x409d25;if(_0x2caadf[_0x400a('0x30')][_0x400a('0x40')]){_0x445bda[_0x400a('0x41')]=[{'all':!![]}];}return db[_0x400a('0x2b')][_0x400a('0x42')](_0x445bda);})['then'](function(_0x3a5997){_0x3cb8b4[_0x400a('0x43')]=_0x3a5997;return _0x3cb8b4;})['then'](respondWithFilteredResult(_0x2753e4,_0x445bda))[_0x400a('0x44')](handleError(_0x2753e4,null));};exports[_0x400a('0x45')]=function(_0x5c8381,_0x45e71c){var _0x3125ae={'raw':![],'where':{'id':_0x5c8381[_0x400a('0x46')]['id']}},_0xff0aa7={};_0xff0aa7[_0x400a('0x33')]=_['keys'](db[_0x400a('0x2b')][_0x400a('0x47')]);_0xff0aa7[_0x400a('0x30')]=_[_0x400a('0x2f')](_0x5c8381[_0x400a('0x30')]);_0xff0aa7[_0x400a('0x31')]=_[_0x400a('0x32')](_0xff0aa7[_0x400a('0x33')],_0xff0aa7[_0x400a('0x30')]);_0x3125ae[_0x400a('0x34')]=_[_0x400a('0x32')](_0xff0aa7[_0x400a('0x33')],qs[_0x400a('0x35')](_0x5c8381['query'][_0x400a('0x35')]));_0x3125ae['attributes']=_0x3125ae['attributes'][_0x400a('0x36')]?_0x3125ae['attributes']:_0xff0aa7['model'];if(_0x5c8381[_0x400a('0x30')][_0x400a('0x40')]){_0x3125ae[_0x400a('0x41')]=[{'all':!![]}];}_0x3125ae=_[_0x400a('0x3c')]({},_0x3125ae,_0x5c8381[_0x400a('0x3f')]);return db['Campaign'][_0x400a('0x48')](_0x3125ae)[_0x400a('0x21')](handleEntityNotFound(_0x45e71c,null))['then'](respondWithResult(_0x45e71c,null))[_0x400a('0x44')](handleError(_0x45e71c,null));};exports['create']=function(_0x3ea387,_0x5671f3){return db['Campaign'][_0x400a('0x49')](_0x3ea387[_0x400a('0x4a')],{})[_0x400a('0x21')](function(_0x2af23c){var _0x3f41cb=_0x3ea387[_0x400a('0x4b')][_0x400a('0x22')]({'plain':!![]});if(!_0x3f41cb)throw new Error(_0x400a('0x4c'));if(_0x3f41cb[_0x400a('0x4d')]===_0x400a('0x4b')){var _0xf7a502=_0x2af23c[_0x400a('0x22')]({'plain':!![]});var _0x26bc33='IvrCampaigns';return db[_0x400a('0x4e')]['find']({'where':{'name':_0x26bc33,'userProfileId':_0x3f41cb['userProfileId']},'raw':!![]})[_0x400a('0x21')](function(_0x57d789){if(_0x57d789&&_0x57d789['autoAssociation']===0x0){return db['UserProfileResource'][_0x400a('0x49')]({'name':_0xf7a502['name'],'resourceId':_0xf7a502['id'],'type':_0x57d789[_0x400a('0x29')],'sectionId':_0x57d789['id']},{})['then'](function(){return _0x2af23c;});}else{return _0x2af23c;}})[_0x400a('0x44')](function(_0x2ead92){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ead92);throw _0x2ead92;});}return _0x2af23c;})['then'](respondWithResult(_0x5671f3,0xc9))['catch'](handleError(_0x5671f3,null));};exports[_0x400a('0x4f')]=function(_0x1aeb89,_0x108645){var _0x3dcbc4={'where':{'id':_0x1aeb89['params']['id']}},_0x4da092={};_0x4da092[_0x400a('0x33')]=_[_0x400a('0x2f')](db[_0x400a('0x2b')][_0x400a('0x47')]);_0x3dcbc4[_0x400a('0x34')]=_[_0x400a('0x32')](_0x4da092['model'],qs[_0x400a('0x35')](_0x1aeb89[_0x400a('0x30')][_0x400a('0x35')]));_0x3dcbc4[_0x400a('0x34')]=_0x3dcbc4[_0x400a('0x34')][_0x400a('0x36')]?_0x3dcbc4['attributes']:_0x4da092[_0x400a('0x33')];if(_0x1aeb89[_0x400a('0x30')]['includeAll']){_0x3dcbc4[_0x400a('0x41')]=[{'all':!![]}];}_0x3dcbc4=_[_0x400a('0x3c')]({},_0x3dcbc4,_0x1aeb89[_0x400a('0x3f')]);return db[_0x400a('0x2b')][_0x400a('0x48')](_0x3dcbc4)[_0x400a('0x21')](handleEntityNotFound(_0x108645,null))['then'](function(_0x167ba6){if(_0x167ba6){var _0x1cea04=_0x167ba6[_0x400a('0x22')]({'plain':!![]});_0x1cea04=qs[_0x400a('0x50')](_0x1cea04,['id',_0x400a('0x51'),'updatedAt']);_0x1aeb89[_0x400a('0x4a')]=_[_0x400a('0x50')](_0x1aeb89['body'],['id','createdAt',_0x400a('0x52')]);return db['Campaign']['create'](_[_0x400a('0x3c')](_0x1cea04,_0x1aeb89[_0x400a('0x4a')]),{'include':_0x1aeb89[_0x400a('0x30')][_0x400a('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x2c5610){var _0x2dc795=_0x1aeb89['user'][_0x400a('0x22')]({'plain':!![]});if(!_0x2dc795)throw new Error(_0x400a('0x4c'));if(_0x2dc795[_0x400a('0x4d')]==='user'){var _0x1cdfd1=_0x2c5610[_0x400a('0x22')]({'plain':!![]});var _0x527d16='IvrCampaigns';return db['UserProfileSection'][_0x400a('0x48')]({'where':{'name':_0x527d16,'userProfileId':_0x2dc795[_0x400a('0x53')]},'raw':!![]})['then'](function(_0x28f2e2){if(_0x28f2e2&&_0x28f2e2[_0x400a('0x54')]===0x0){return db['UserProfileResource'][_0x400a('0x49')]({'name':_0x1cdfd1[_0x400a('0x29')],'resourceId':_0x1cdfd1['id'],'type':_0x28f2e2[_0x400a('0x29')],'sectionId':_0x28f2e2['id']},{})['then'](function(){return _0x2c5610;});}else{return _0x2c5610;}})[_0x400a('0x44')](function(_0x4a4a70){logger[_0x400a('0x27')](_0x400a('0x55'),_0x4a4a70);throw _0x4a4a70;});}return _0x2c5610;});}})[_0x400a('0x21')](respondWithResult(_0x108645,0xc9))[_0x400a('0x44')](handleError(_0x108645,null));};exports['update']=function(_0x41e985,_0x219684){if(_0x41e985['body']['id']){delete _0x41e985['body']['id'];}return db['Campaign'][_0x400a('0x48')]({'where':{'id':_0x41e985['params']['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x219684,null))['then'](saveUpdates(_0x41e985[_0x400a('0x4a')],null))[_0x400a('0x21')](respondWithResult(_0x219684,null))[_0x400a('0x44')](handleError(_0x219684,null));};exports[_0x400a('0x24')]=function(_0x187828,_0x244aea){return db['Campaign'][_0x400a('0x48')]({'where':{'id':_0x187828['params']['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x244aea,null))[_0x400a('0x21')](removeEntity(_0x244aea,null))[_0x400a('0x44')](handleError(_0x244aea,null));};exports[_0x400a('0x56')]=function(_0x562356,_0x3ccc28,_0x2f18cc){var _0x4d8d53={'raw':!![],'where':{}};var _0x1a0d2f={};var _0x54620c={'count':0x0,'rows':[]};return db[_0x400a('0x2b')]['findOne']({'where':{'id':_0x562356[_0x400a('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ccc28,null))[_0x400a('0x21')](function(_0x9db66){if(_0x9db66){_0x1a0d2f[_0x400a('0x33')]=_['keys'](db[_0x400a('0x57')][_0x400a('0x47')]);_0x1a0d2f[_0x400a('0x30')]=_[_0x400a('0x2f')](_0x562356[_0x400a('0x30')]);_0x1a0d2f[_0x400a('0x31')]=_['intersection'](_0x1a0d2f['model'],_0x1a0d2f[_0x400a('0x30')]);_0x4d8d53[_0x400a('0x34')]=_[_0x400a('0x32')](_0x1a0d2f[_0x400a('0x33')],qs[_0x400a('0x35')](_0x562356[_0x400a('0x30')][_0x400a('0x35')]));_0x4d8d53['attributes']=_0x4d8d53[_0x400a('0x34')][_0x400a('0x36')]?_0x4d8d53[_0x400a('0x34')]:_0x1a0d2f[_0x400a('0x33')];if(!_0x562356[_0x400a('0x30')][_0x400a('0x37')](_0x400a('0x38'))){_0x4d8d53[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x562356[_0x400a('0x30')][_0x400a('0x1b')]);_0x4d8d53['offset']=qs[_0x400a('0x19')](_0x562356['query'][_0x400a('0x19')]);}_0x4d8d53[_0x400a('0x39')]=qs[_0x400a('0x58')](_0x562356[_0x400a('0x30')][_0x400a('0x58')]);_0x4d8d53['where']=qs['filters'](_[_0x400a('0x59')](_0x562356[_0x400a('0x30')],_0x1a0d2f['filters']));_0x4d8d53[_0x400a('0x3a')][_0x400a('0x5a')]=_0x9db66['id'];if(_0x562356['query'][_0x400a('0x3b')]){_0x4d8d53['where']=_[_0x400a('0x3c')](_0x4d8d53[_0x400a('0x3a')],{'$or':_['map'](_0x4d8d53[_0x400a('0x34')],function(_0x1c20c3){var _0x52918f={};_0x52918f[_0x1c20c3]={'$like':'%'+_0x562356[_0x400a('0x30')][_0x400a('0x3b')]+'%'};return _0x52918f;})});}_0x4d8d53=_[_0x400a('0x3c')]({},_0x4d8d53,_0x562356[_0x400a('0x3f')]);return db[_0x400a('0x57')][_0x400a('0x1c')]({'where':_0x4d8d53[_0x400a('0x3a')]})[_0x400a('0x21')](function(_0x591c5c){_0x54620c[_0x400a('0x1c')]=_0x591c5c;if(_0x562356['query'][_0x400a('0x40')]){_0x4d8d53[_0x400a('0x41')]=[{'all':!![]}];}return db[_0x400a('0x57')][_0x400a('0x42')](_0x4d8d53);})[_0x400a('0x21')](function(_0x4bc8e3){_0x54620c[_0x400a('0x43')]=_0x4bc8e3;return _0x54620c;});}})[_0x400a('0x21')](respondWithFilteredResult(_0x3ccc28,_0x4d8d53))[_0x400a('0x44')](handleError(_0x3ccc28,null));};exports['getHopperHistories']=function(_0x2feee9,_0x31b998,_0x5330f2){var _0xa25d43={'raw':!![],'where':{}};var _0x3a206a={};var _0x400e9f={'count':0x0,'rows':[]};return db[_0x400a('0x2b')][_0x400a('0x5b')]({'where':{'id':_0x2feee9['params']['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x31b998,null))[_0x400a('0x21')](function(_0x437b8f){if(_0x437b8f){_0x3a206a['model']=_[_0x400a('0x2f')](db['CmHopperHistory'][_0x400a('0x47')]);_0x3a206a[_0x400a('0x30')]=_['keys'](_0x2feee9[_0x400a('0x30')]);_0x3a206a['filters']=_[_0x400a('0x32')](_0x3a206a[_0x400a('0x33')],_0x3a206a[_0x400a('0x30')]);_0xa25d43[_0x400a('0x34')]=_[_0x400a('0x32')](_0x3a206a['model'],qs[_0x400a('0x35')](_0x2feee9['query'][_0x400a('0x35')]));_0xa25d43['attributes']=_0xa25d43[_0x400a('0x34')][_0x400a('0x36')]?_0xa25d43['attributes']:_0x3a206a[_0x400a('0x33')];if(!_0x2feee9[_0x400a('0x30')][_0x400a('0x37')](_0x400a('0x38'))){_0xa25d43['limit']=qs[_0x400a('0x1b')](_0x2feee9[_0x400a('0x30')][_0x400a('0x1b')]);_0xa25d43[_0x400a('0x19')]=qs[_0x400a('0x19')](_0x2feee9[_0x400a('0x30')][_0x400a('0x19')]);}_0xa25d43[_0x400a('0x39')]=qs[_0x400a('0x58')](_0x2feee9[_0x400a('0x30')]['sort']);_0xa25d43['where']=qs[_0x400a('0x31')](_['pick'](_0x2feee9[_0x400a('0x30')],_0x3a206a[_0x400a('0x31')]));_0xa25d43[_0x400a('0x3a')][_0x400a('0x5a')]=_0x437b8f['id'];if(_0x2feee9['query'][_0x400a('0x3b')]){_0xa25d43[_0x400a('0x3a')]=_[_0x400a('0x3c')](_0xa25d43[_0x400a('0x3a')],{'$or':_['map'](_0xa25d43[_0x400a('0x34')],function(_0x43cc56){var _0x19f3fa={};_0x19f3fa[_0x43cc56]={'$like':'%'+_0x2feee9[_0x400a('0x30')][_0x400a('0x3b')]+'%'};return _0x19f3fa;})});}_0xa25d43=_[_0x400a('0x3c')]({},_0xa25d43,_0x2feee9[_0x400a('0x3f')]);return db['CmHopperHistory'][_0x400a('0x1c')]({'where':_0xa25d43['where']})[_0x400a('0x21')](function(_0xacd83c){_0x400e9f[_0x400a('0x1c')]=_0xacd83c;if(_0x2feee9[_0x400a('0x30')][_0x400a('0x40')]){_0xa25d43[_0x400a('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x400a('0x42')](_0xa25d43);})[_0x400a('0x21')](function(_0x32f464){_0x400e9f[_0x400a('0x43')]=_0x32f464;return _0x400e9f;});}})['then'](respondWithFilteredResult(_0x31b998,_0xa25d43))[_0x400a('0x44')](handleError(_0x31b998,null));};exports[_0x400a('0x5c')]=function(_0x1b7fc9,_0x140b03,_0x217e2f){var _0xfd7ad3={'raw':!![],'where':{}};var _0x54f4e9={};var _0x5bf5ae={'count':0x0,'rows':[]};return db[_0x400a('0x2b')][_0x400a('0x5b')]({'where':{'id':_0x1b7fc9[_0x400a('0x46')]['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x140b03,null))['then'](function(_0x13a94c){if(_0x13a94c){_0x54f4e9['model']=_[_0x400a('0x2f')](db[_0x400a('0x5d')][_0x400a('0x47')]);_0x54f4e9['query']=_[_0x400a('0x2f')](_0x1b7fc9[_0x400a('0x30')]);_0x54f4e9[_0x400a('0x31')]=_[_0x400a('0x32')](_0x54f4e9['model'],_0x54f4e9[_0x400a('0x30')]);_0xfd7ad3['attributes']=_['intersection'](_0x54f4e9['model'],qs[_0x400a('0x35')](_0x1b7fc9[_0x400a('0x30')][_0x400a('0x35')]));_0xfd7ad3[_0x400a('0x34')]=_0xfd7ad3[_0x400a('0x34')][_0x400a('0x36')]?_0xfd7ad3[_0x400a('0x34')]:_0x54f4e9['model'];if(!_0x1b7fc9[_0x400a('0x30')][_0x400a('0x37')](_0x400a('0x38'))){_0xfd7ad3[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x1b7fc9['query']['limit']);_0xfd7ad3['offset']=qs['offset'](_0x1b7fc9[_0x400a('0x30')][_0x400a('0x19')]);}_0xfd7ad3[_0x400a('0x39')]=qs[_0x400a('0x58')](_0x1b7fc9[_0x400a('0x30')][_0x400a('0x58')]);_0xfd7ad3[_0x400a('0x3a')]=qs[_0x400a('0x31')](_[_0x400a('0x59')](_0x1b7fc9[_0x400a('0x30')],_0x54f4e9['filters']));_0xfd7ad3[_0x400a('0x3a')][_0x400a('0x5a')]=_0x13a94c['id'];if(_0x1b7fc9[_0x400a('0x30')]['filter']){_0xfd7ad3[_0x400a('0x3a')]=_[_0x400a('0x3c')](_0xfd7ad3[_0x400a('0x3a')],{'$or':_[_0x400a('0x2e')](_0xfd7ad3[_0x400a('0x34')],function(_0x1a6938){var _0x41a3b2={};_0x41a3b2[_0x1a6938]={'$like':'%'+_0x1b7fc9[_0x400a('0x30')][_0x400a('0x3b')]+'%'};return _0x41a3b2;})});}_0xfd7ad3=_[_0x400a('0x3c')]({},_0xfd7ad3,_0x1b7fc9[_0x400a('0x3f')]);return db[_0x400a('0x5d')][_0x400a('0x1c')]({'where':_0xfd7ad3[_0x400a('0x3a')]})[_0x400a('0x21')](function(_0x28d0da){_0x5bf5ae['count']=_0x28d0da;if(_0x1b7fc9[_0x400a('0x30')][_0x400a('0x40')]){_0xfd7ad3['include']=[{'all':!![]}];}return db[_0x400a('0x5d')][_0x400a('0x42')](_0xfd7ad3);})['then'](function(_0x8f251){_0x5bf5ae[_0x400a('0x43')]=_0x8f251;return _0x5bf5ae;});}})[_0x400a('0x21')](respondWithFilteredResult(_0x140b03,_0xfd7ad3))[_0x400a('0x44')](handleError(_0x140b03,null));};exports[_0x400a('0x5e')]=function(_0x57e7bf,_0x438ae3,_0x411377){var _0x2f0027={'raw':!![],'where':{}};var _0x19df36={};var _0x5d4475={'count':0x0,'rows':[]};return db[_0x400a('0x2b')][_0x400a('0x5b')]({'where':{'id':_0x57e7bf[_0x400a('0x46')]['id']}})['then'](handleEntityNotFound(_0x438ae3,null))[_0x400a('0x21')](function(_0x319f53){if(_0x319f53){_0x19df36[_0x400a('0x33')]=_[_0x400a('0x2f')](db[_0x400a('0x5f')]['rawAttributes']);_0x19df36[_0x400a('0x30')]=_[_0x400a('0x2f')](_0x57e7bf['query']);_0x19df36[_0x400a('0x31')]=_[_0x400a('0x32')](_0x19df36['model'],_0x19df36[_0x400a('0x30')]);_0x2f0027[_0x400a('0x34')]=_[_0x400a('0x32')](_0x19df36[_0x400a('0x33')],qs[_0x400a('0x35')](_0x57e7bf[_0x400a('0x30')][_0x400a('0x35')]));_0x2f0027[_0x400a('0x34')]=_0x2f0027[_0x400a('0x34')][_0x400a('0x36')]?_0x2f0027[_0x400a('0x34')]:_0x19df36[_0x400a('0x33')];if(!_0x57e7bf['query'][_0x400a('0x37')](_0x400a('0x38'))){_0x2f0027['limit']=qs[_0x400a('0x1b')](_0x57e7bf['query']['limit']);_0x2f0027[_0x400a('0x19')]=qs[_0x400a('0x19')](_0x57e7bf[_0x400a('0x30')][_0x400a('0x19')]);}_0x2f0027[_0x400a('0x39')]=qs[_0x400a('0x58')](_0x57e7bf[_0x400a('0x30')]['sort']);_0x2f0027[_0x400a('0x3a')]=qs[_0x400a('0x31')](_['pick'](_0x57e7bf[_0x400a('0x30')],_0x19df36[_0x400a('0x31')]));_0x2f0027[_0x400a('0x3a')]['CampaignId']=_0x319f53['id'];if(_0x57e7bf[_0x400a('0x30')][_0x400a('0x3b')]){_0x2f0027[_0x400a('0x3a')]=_[_0x400a('0x3c')](_0x2f0027[_0x400a('0x3a')],{'$or':_[_0x400a('0x2e')](_0x2f0027[_0x400a('0x34')],function(_0x1b59e9){var _0x4e0214={};_0x4e0214[_0x1b59e9]={'$like':'%'+_0x57e7bf[_0x400a('0x30')]['filter']+'%'};return _0x4e0214;})});}_0x2f0027=_[_0x400a('0x3c')]({},_0x2f0027,_0x57e7bf['options']);return db[_0x400a('0x5f')][_0x400a('0x1c')]({'where':_0x2f0027[_0x400a('0x3a')]})[_0x400a('0x21')](function(_0x3e164b){_0x5d4475['count']=_0x3e164b;if(_0x57e7bf[_0x400a('0x30')][_0x400a('0x40')]){_0x2f0027[_0x400a('0x41')]=[{'all':!![]}];}return db[_0x400a('0x5f')]['findAll'](_0x2f0027);})['then'](function(_0x238434){_0x5d4475[_0x400a('0x43')]=_0x238434;return _0x5d4475;});}})['then'](respondWithFilteredResult(_0x438ae3,_0x2f0027))[_0x400a('0x44')](handleError(_0x438ae3,null));};exports[_0x400a('0x60')]=function(_0x589de7,_0x4c049d,_0x18d5e0){var _0x3e1939={};var _0x639c4d={};var _0x4a9223;var _0x496bce;return db['Campaign'][_0x400a('0x5b')]({'where':{'id':_0x589de7[_0x400a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c049d,null))[_0x400a('0x21')](function(_0x301317){if(_0x301317){_0x4a9223=_0x301317;_0x639c4d[_0x400a('0x33')]=_[_0x400a('0x2f')](db[_0x400a('0x61')][_0x400a('0x47')]);_0x639c4d[_0x400a('0x30')]=_[_0x400a('0x2f')](_0x589de7['query']);_0x639c4d[_0x400a('0x31')]=_[_0x400a('0x32')](_0x639c4d['model'],_0x639c4d[_0x400a('0x30')]);_0x3e1939['attributes']=_['intersection'](_0x639c4d[_0x400a('0x33')],qs[_0x400a('0x35')](_0x589de7['query'][_0x400a('0x35')]));_0x3e1939['attributes']=_0x3e1939[_0x400a('0x34')][_0x400a('0x36')]?_0x3e1939[_0x400a('0x34')]:_0x639c4d[_0x400a('0x33')];_0x3e1939['order']=qs[_0x400a('0x58')](_0x589de7[_0x400a('0x30')][_0x400a('0x58')]);_0x3e1939[_0x400a('0x3a')]=qs[_0x400a('0x31')](_['pick'](_0x589de7[_0x400a('0x30')],_0x639c4d[_0x400a('0x31')]));if(_0x589de7[_0x400a('0x30')][_0x400a('0x3b')]){_0x3e1939[_0x400a('0x3a')]=_[_0x400a('0x3c')](_0x3e1939['where'],{'$or':_['map'](_0x3e1939['attributes'],function(_0x2e1d6c){var _0x111a70={};_0x111a70[_0x2e1d6c]={'$like':'%'+_0x589de7['query'][_0x400a('0x3b')]+'%'};return _0x111a70;})});}_0x3e1939=_[_0x400a('0x3c')]({},_0x3e1939,_0x589de7[_0x400a('0x3f')]);return _0x4a9223[_0x400a('0x60')](_0x3e1939);}})[_0x400a('0x21')](function(_0xa28f35){if(_0xa28f35){_0x496bce=_0xa28f35[_0x400a('0x36')];if(!_0x589de7[_0x400a('0x30')][_0x400a('0x37')](_0x400a('0x38'))){_0x3e1939[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x589de7['query'][_0x400a('0x1b')]);_0x3e1939[_0x400a('0x19')]=qs[_0x400a('0x19')](_0x589de7[_0x400a('0x30')][_0x400a('0x19')]);}return _0x4a9223[_0x400a('0x60')](_0x3e1939);}})[_0x400a('0x21')](function(_0xc8e8aa){if(_0xc8e8aa){return _0xc8e8aa?{'count':_0x496bce,'rows':_0xc8e8aa}:null;}})[_0x400a('0x21')](respondWithResult(_0x4c049d,null))[_0x400a('0x44')](handleError(_0x4c049d,null));};exports[_0x400a('0x62')]=function(_0x5e52d7,_0x34b789,_0x2238b9){var _0x32e69b,_0x360677;var _0x5ab0a6=[];var _0x350441=moment()[_0x400a('0x63')](_0x400a('0x64'));return db[_0x400a('0x2b')][_0x400a('0x48')]({'where':{'id':_0x5e52d7[_0x400a('0x46')]['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x34b789,null))['then'](function(_0x2116e1){if(_0x2116e1){_0x360677=_0x2116e1;return _0x2116e1['addLists'](_0x5e52d7[_0x400a('0x4a')][_0x400a('0x65')],_['omit'](_0x5e52d7[_0x400a('0x4a')],['ids','id'])||{});}return null;})[_0x400a('0x66')](function(_0xed2e5a){var _0x5aee8c;var _0x4d087b;_0x32e69b=_0xed2e5a||[];var _0x53b391=[];if(_0xed2e5a){for(var _0xd63b6a=0x0;_0xd63b6a<_0xed2e5a['length'];_0xd63b6a+=0x1){var _0x55294d=_0xed2e5a[_0xd63b6a]['get']({'plain':!![]});_0x360677[_0x400a('0x67')]=_0x5e52d7['body'][_0x400a('0x67')]?_0x5e52d7[_0x400a('0x4a')][_0x400a('0x67')]:_0x360677[_0x400a('0x67')];switch(_0x360677[_0x400a('0x67')]){case _0x400a('0x68'):_0x5aee8c=squel['insert']()['into'](_0x400a('0x69'))['fromQuery']([_0x400a('0x6a'),_0x400a('0x6b'),_0x400a('0x6c'),_0x400a('0x6d'),_0x400a('0x5a'),_0x400a('0x51'),_0x400a('0x52')],squel[_0x400a('0x6e')]()[_0x400a('0x6f')]('phone','phone')[_0x400a('0x6f')](_0x400a('0x70'),_0x400a('0x6b'))[_0x400a('0x6f')]('id',_0x400a('0x6c'))[_0x400a('0x6f')](_0x55294d[_0x400a('0x71')][_0x400a('0x72')](),_0x400a('0x6d'))['field'](_0x5e52d7[_0x400a('0x46')]['id']['toString'](),_0x400a('0x5a'))[_0x400a('0x6f')]('\x27'+_0x350441+'\x27',_0x400a('0x51'))[_0x400a('0x6f')]('\x27'+_0x350441+'\x27',_0x400a('0x52'))[_0x400a('0x73')]('cm_contacts')[_0x400a('0x3a')](_0x400a('0x74'))[_0x400a('0x3a')](_0x400a('0x75'),_0x55294d[_0x400a('0x71')][_0x400a('0x72')]())['where'](_0x400a('0x76'))['where'](_0x400a('0x77'),squel[_0x400a('0x6e')]()[_0x400a('0x6f')](_0x400a('0x78'))[_0x400a('0x73')]('cm_hopper_final')['where'](_0x400a('0x79'),_0x5e52d7[_0x400a('0x46')]['id'][_0x400a('0x72')]()))[_0x400a('0x3a')](_0x400a('0x77'),squel[_0x400a('0x6e')]()[_0x400a('0x6f')]('COALESCE(phone,\x27\x27)')[_0x400a('0x73')](_0x400a('0x69'))[_0x400a('0x3a')](_0x400a('0x79'),_0x5e52d7[_0x400a('0x46')]['id']['toString']())))[_0x400a('0x72')]();break;case _0x400a('0x7a'):_0x5aee8c=squel['insert']()['into']('cm_hopper')[_0x400a('0x7b')]([_0x400a('0x6a'),'scheduledAt',_0x400a('0x6c'),_0x400a('0x6d'),_0x400a('0x5a'),_0x400a('0x51'),_0x400a('0x52')],squel[_0x400a('0x6e')]()[_0x400a('0x6f')](_0x400a('0x6a'),'phone')[_0x400a('0x6f')](_0x400a('0x70'),_0x400a('0x6b'))[_0x400a('0x6f')]('id',_0x400a('0x6c'))['field'](_0x55294d['CmListId'][_0x400a('0x72')](),'ListId')[_0x400a('0x6f')](_0x5e52d7[_0x400a('0x46')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x350441+'\x27',_0x400a('0x51'))[_0x400a('0x6f')]('\x27'+_0x350441+'\x27','updatedAt')['from']('cm_contacts')[_0x400a('0x3a')](_0x400a('0x74'))[_0x400a('0x3a')](_0x400a('0x75'),_0x55294d[_0x400a('0x71')][_0x400a('0x72')]())[_0x400a('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x400a('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x400a('0x6e')]()[_0x400a('0x6f')](_0x400a('0x7c'))['from'](_0x400a('0x69'))[_0x400a('0x3a')](_0x400a('0x79'),_0x5e52d7['params']['id'][_0x400a('0x72')]())))[_0x400a('0x72')]();break;default:_0x5aee8c=squel['insert']()['into'](_0x400a('0x69'))['fromQuery']([_0x400a('0x6a'),'scheduledAt',_0x400a('0x6c'),_0x400a('0x6d'),_0x400a('0x5a'),'createdAt',_0x400a('0x52')],squel[_0x400a('0x6e')]()[_0x400a('0x6f')](_0x400a('0x6a'),_0x400a('0x6a'))['field']('NOW()','scheduledAt')[_0x400a('0x6f')]('id',_0x400a('0x6c'))[_0x400a('0x6f')](_0x55294d['CmListId']['toString'](),_0x400a('0x6d'))[_0x400a('0x6f')](_0x5e52d7['params']['id'][_0x400a('0x72')](),'CampaignId')[_0x400a('0x6f')]('\x27'+_0x350441+'\x27',_0x400a('0x51'))[_0x400a('0x6f')]('\x27'+_0x350441+'\x27',_0x400a('0x52'))[_0x400a('0x73')]('cm_contacts')[_0x400a('0x3a')](_0x400a('0x74'))[_0x400a('0x3a')](_0x400a('0x75'),_0x55294d[_0x400a('0x71')]['toString']())[_0x400a('0x3a')](_0x400a('0x76')))[_0x400a('0x72')]();}_0x4d087b=squel['insert']()[_0x400a('0x7d')](_0x400a('0x7e'))[_0x400a('0x7b')](['cmHopperId',_0x400a('0x6b'),'phone',_0x400a('0x7f'),_0x400a('0x51'),_0x400a('0x52')],squel[_0x400a('0x6e')]()[_0x400a('0x6f')](_0x400a('0x80'),'id')[_0x400a('0x6f')](_0x400a('0x70'),'scheduledAt')['field'](_0x400a('0x81'),'phone')[_0x400a('0x6f')]('ci.OrderBY','OrderBy')[_0x400a('0x6f')]('\x27'+_0x350441+'\x27',_0x400a('0x51'))[_0x400a('0x6f')]('\x27'+_0x350441+'\x27',_0x400a('0x52'))[_0x400a('0x73')](_0x400a('0x82'),'ci')['join']('cm_hopper','h',_0x400a('0x83'))['where'](_0x400a('0x84'),_0x55294d[_0x400a('0x71')][_0x400a('0x72')]())[_0x400a('0x3a')]('h.CampaignId=?',_0x5e52d7[_0x400a('0x46')]['id'][_0x400a('0x72')]())[_0x400a('0x3a')](_0x400a('0x85'),_0x350441))[_0x400a('0x72')]();_0x53b391[_0x400a('0x86')](db[_0x400a('0x87')][_0x400a('0x30')](_0x5aee8c));_0x5ab0a6[_0x400a('0x86')](db[_0x400a('0x87')][_0x400a('0x30')](_0x4d087b));}return BPromise[_0x400a('0x88')](_0x53b391);}})['then'](function(){return BPromise[_0x400a('0x88')](_0x5ab0a6);})['then'](function(){return _0x32e69b;})['then'](respondWithResult(_0x34b789,null))[_0x400a('0x44')](handleError(_0x34b789,null));};exports[_0x400a('0x89')]=function(_0x29b7cd,_0x2a596d,_0x6039cc){return db[_0x400a('0x2b')][_0x400a('0x48')]({'where':{'id':_0x29b7cd[_0x400a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a596d,null))['then'](function(_0x49f358){if(_0x49f358){return _0x49f358[_0x400a('0x89')](_0x29b7cd[_0x400a('0x30')]['ids']);}})[_0x400a('0x21')](function(_0x390d46){if(_0x390d46){return db[_0x400a('0x57')]['destroy']({'where':{'ListId':_0x29b7cd['query'][_0x400a('0x65')],'CampaignId':_0x29b7cd[_0x400a('0x46')]['id']}})[_0x400a('0x21')](function(){return _0x390d46;});}})[_0x400a('0x21')](respondWithStatusCode(_0x2a596d,null))[_0x400a('0x44')](handleError(_0x2a596d,null));};exports[_0x400a('0x8a')]=function(_0x29ded9,_0x6ac4cf,_0x4def20){var _0x3ab504={};var _0x52a2e4={};var _0x1e6b75;var _0x175b20;return db[_0x400a('0x2b')][_0x400a('0x5b')]({'where':{'id':_0x29ded9[_0x400a('0x46')]['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x6ac4cf,null))[_0x400a('0x21')](function(_0x3443ac){if(_0x3443ac){_0x1e6b75=_0x3443ac;_0x52a2e4[_0x400a('0x33')]=_[_0x400a('0x2f')](db[_0x400a('0x61')]['rawAttributes']);_0x52a2e4['query']=_[_0x400a('0x2f')](_0x29ded9['query']);_0x52a2e4[_0x400a('0x31')]=_[_0x400a('0x32')](_0x52a2e4[_0x400a('0x33')],_0x52a2e4[_0x400a('0x30')]);_0x3ab504[_0x400a('0x34')]=_[_0x400a('0x32')](_0x52a2e4['model'],qs[_0x400a('0x35')](_0x29ded9[_0x400a('0x30')][_0x400a('0x35')]));_0x3ab504[_0x400a('0x34')]=_0x3ab504[_0x400a('0x34')][_0x400a('0x36')]?_0x3ab504[_0x400a('0x34')]:_0x52a2e4[_0x400a('0x33')];_0x3ab504['order']=qs[_0x400a('0x58')](_0x29ded9[_0x400a('0x30')][_0x400a('0x58')]);_0x3ab504[_0x400a('0x3a')]=qs['filters'](_[_0x400a('0x59')](_0x29ded9[_0x400a('0x30')],_0x52a2e4['filters']));if(_0x29ded9[_0x400a('0x30')][_0x400a('0x3b')]){_0x3ab504[_0x400a('0x3a')]=_[_0x400a('0x3c')](_0x3ab504['where'],{'$or':_[_0x400a('0x2e')](_0x3ab504[_0x400a('0x34')],function(_0x20ae55){var _0x2368ee={};_0x2368ee[_0x20ae55]={'$like':'%'+_0x29ded9[_0x400a('0x30')][_0x400a('0x3b')]+'%'};return _0x2368ee;})});}_0x3ab504=_[_0x400a('0x3c')]({},_0x3ab504,_0x29ded9[_0x400a('0x3f')]);return _0x1e6b75[_0x400a('0x8a')](_0x3ab504);}})['then'](function(_0x50abfa){if(_0x50abfa){_0x175b20=_0x50abfa[_0x400a('0x36')];if(!_0x29ded9[_0x400a('0x30')][_0x400a('0x37')](_0x400a('0x38'))){_0x3ab504[_0x400a('0x1b')]=qs[_0x400a('0x1b')](_0x29ded9[_0x400a('0x30')][_0x400a('0x1b')]);_0x3ab504[_0x400a('0x19')]=qs[_0x400a('0x19')](_0x29ded9['query'][_0x400a('0x19')]);}return _0x1e6b75[_0x400a('0x8a')](_0x3ab504);}})[_0x400a('0x21')](function(_0x58f2cd){if(_0x58f2cd){return _0x58f2cd?{'count':_0x175b20,'rows':_0x58f2cd}:null;}})['then'](respondWithResult(_0x6ac4cf,null))[_0x400a('0x44')](handleError(_0x6ac4cf,null));};exports[_0x400a('0x8b')]=function(_0x595693,_0x389906,_0x408fbb){var _0x5ab519,_0x45aabc;var _0x462bf6=[];var _0x309645=moment()[_0x400a('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x400a('0x2b')][_0x400a('0x48')]({'where':{'id':_0x595693['params']['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x389906,null))[_0x400a('0x21')](function(_0x342b79){if(_0x342b79){_0x45aabc=_0x342b79;return _0x342b79[_0x400a('0x8b')](_0x595693[_0x400a('0x4a')][_0x400a('0x65')],_[_0x400a('0x50')](_0x595693[_0x400a('0x4a')],['ids','id'])||{});}return null;})[_0x400a('0x66')](function(_0x36bc92){var _0x5eec6a;var _0x33aa8f;_0x5ab519=_0x36bc92||[];var _0x10ba2a=[];if(_0x36bc92){for(var _0x5b3c26=0x0;_0x5b3c26<_0x36bc92[_0x400a('0x36')];_0x5b3c26+=0x1){var _0x51c922=_0x36bc92[_0x5b3c26][_0x400a('0x22')]({'plain':!![]});_0x5eec6a=squel[_0x400a('0x8c')]()[_0x400a('0x7d')]('cm_hopper_black')['fromQuery']([_0x400a('0x6a'),_0x400a('0x6c'),_0x400a('0x6d'),_0x400a('0x5a'),_0x400a('0x51'),_0x400a('0x52')],squel[_0x400a('0x6e')]()[_0x400a('0x6f')]('phone',_0x400a('0x6a'))[_0x400a('0x6f')]('id',_0x400a('0x6c'))[_0x400a('0x6f')](_0x51c922[_0x400a('0x71')]['toString'](),'ListId')[_0x400a('0x6f')](_0x595693[_0x400a('0x46')]['id'][_0x400a('0x72')](),_0x400a('0x5a'))[_0x400a('0x6f')]('NOW()','createdAt')['field'](_0x400a('0x70'),_0x400a('0x52'))[_0x400a('0x73')]('cm_contacts')[_0x400a('0x3a')](_0x400a('0x74'))['where']('ListId\x20=\x20?',_0x51c922['CmListId'][_0x400a('0x72')]())[_0x400a('0x3a')](_0x400a('0x76')))['toString']();_0x10ba2a[_0x400a('0x86')](db['sequelize'][_0x400a('0x30')](_0x5eec6a));}return BPromise[_0x400a('0x88')](_0x10ba2a);}})[_0x400a('0x21')](function(){return _0x5ab519;})['then'](respondWithResult(_0x389906,null))[_0x400a('0x44')](handleError(_0x389906,null));};exports[_0x400a('0x8d')]=function(_0x12545b,_0x49dc79,_0x5b5106){return db['Campaign'][_0x400a('0x48')]({'where':{'id':_0x12545b[_0x400a('0x46')]['id']}})[_0x400a('0x21')](handleEntityNotFound(_0x49dc79,null))[_0x400a('0x21')](function(_0x3972b9){if(_0x3972b9){return _0x3972b9[_0x400a('0x8d')](_0x12545b[_0x400a('0x30')][_0x400a('0x65')]);}})[_0x400a('0x21')](function(_0x4d19a2){if(_0x4d19a2){return db['CmHopperBlack'][_0x400a('0x24')]({'where':{'ListId':_0x12545b[_0x400a('0x30')][_0x400a('0x65')],'CampaignId':_0x12545b['params']['id']}})['then'](function(){return _0x4d19a2;});}})[_0x400a('0x21')](respondWithStatusCode(_0x49dc79,null))['catch'](handleError(_0x49dc79,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 6beb76f..193c5d2 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(_0x495a9f,_0x2a8214){var _0x590ae0=function(_0x162db2){while(--_0x162db2){_0x495a9f['push'](_0x495a9f['shift']());}};_0x590ae0(++_0x2a8214);}(_0x7a54,0x106));var _0x47a5=function(_0x48667c,_0x440fda){_0x48667c=_0x48667c-0x0;var _0x2c9cba=_0x7a54[_0x48667c];return _0x2c9cba;};'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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 c8826d2..b8f556c 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 _0xf3dc=['debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','limit','map','include','model','attributes'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x517082,_0xc70ef9){_0x517082=_0x517082-0x0;var _0x560118=_0xf3dc[_0x517082];return _0x560118;};'use strict';var _=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var moment=require(_0xcf3d('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf3d('0x3'));var fs=require('fs');var Redis=require(_0xcf3d('0x4'));var db=require(_0xcf3d('0x5'))['db'];var utils=require(_0xcf3d('0x6'));var logger=require(_0xcf3d('0x7'))(_0xcf3d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3427,_0x5bc3d6,_0x1a69de){return new BPromise(function(_0x10d808,_0x1c815e){return client[_0xcf3d('0x9')](_0x4e3427,_0x1a69de)[_0xcf3d('0xa')](function(_0x27c49c){logger[_0xcf3d('0xb')](_0xcf3d('0xc'),_0x5bc3d6,_0xcf3d('0xd'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x5bc3d6,'request\x20sent',JSON[_0xcf3d('0xe')](_0x27c49c));if(_0x27c49c['error']){if(_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x10')]===0x1f4){logger[_0xcf3d('0xf')](_0xcf3d('0xc'),_0x5bc3d6,_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x11')]);return _0x1c815e(_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x11')]);}logger[_0xcf3d('0xf')]('Campaign,\x20%s,\x20%s',_0x5bc3d6,_0x27c49c['error'][_0xcf3d('0x11')]);return _0x10d808(_0x27c49c[_0xcf3d('0xf')][_0xcf3d('0x11')]);}else{logger[_0xcf3d('0xb')](_0xcf3d('0xc'),_0x5bc3d6,_0xcf3d('0xd'));_0x10d808(_0x27c49c[_0xcf3d('0x12')][_0xcf3d('0x11')]);}})[_0xcf3d('0x13')](function(_0x88c2de){logger['error']('Campaign,\x20%s,\x20%s',_0x5bc3d6,_0x88c2de);_0x1c815e(_0x88c2de);});});}exports[_0xcf3d('0x14')]=function(_0x22fd74){var _0x5e4351=this;return new Promise(function(_0x3272e3,_0x15f80a){return db[_0xcf3d('0x15')][_0xcf3d('0x16')]({'raw':_0x22fd74[_0xcf3d('0x17')]?_0x22fd74['options']['raw']===undefined?!![]:![]:!![],'where':_0x22fd74['options']?_0x22fd74['options'][_0xcf3d('0x18')]||null:null,'attributes':_0x22fd74[_0xcf3d('0x17')]?_0x22fd74[_0xcf3d('0x17')]['attributes']||null:null,'limit':_0x22fd74['options']?_0x22fd74[_0xcf3d('0x17')][_0xcf3d('0x19')]||null:null,'include':_0x22fd74[_0xcf3d('0x17')]?_0x22fd74[_0xcf3d('0x17')]['include']?_[_0xcf3d('0x1a')](_0x22fd74[_0xcf3d('0x17')][_0xcf3d('0x1b')],function(_0x78a3c7){return{'model':db[_0x78a3c7[_0xcf3d('0x1c')]],'as':_0x78a3c7['as'],'attributes':_0x78a3c7[_0xcf3d('0x1d')],'include':_0x78a3c7['include']?_['map'](_0x78a3c7['include'],function(_0x2f49f0){return{'model':db[_0x2f49f0[_0xcf3d('0x1c')]],'as':_0x2f49f0['as'],'attributes':_0x2f49f0[_0xcf3d('0x1d')],'include':_0x2f49f0[_0xcf3d('0x1b')]?_[_0xcf3d('0x1a')](_0x2f49f0[_0xcf3d('0x1b')],function(_0xa32d3c){return{'model':db[_0xa32d3c[_0xcf3d('0x1c')]],'as':_0xa32d3c['as'],'attributes':_0xa32d3c[_0xcf3d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcf3d('0xa')](function(_0x2a2d66){logger[_0xcf3d('0xb')](_0xcf3d('0x14'),_0x22fd74);logger[_0xcf3d('0x1e')](_0xcf3d('0x14'),_0x22fd74,JSON['stringify'](_0x2a2d66));_0x3272e3(_0x2a2d66);})[_0xcf3d('0x13')](function(_0x45a224){logger['error'](_0xcf3d('0x14'),_0x45a224[_0xcf3d('0x11')],_0x22fd74);_0x15f80a(_0x5e4351[_0xcf3d('0xf')](0x1f4,_0x45a224[_0xcf3d('0x11')]));});});}; \ No newline at end of file +var _0xfe60=['Campaign','findAll','options','raw','where','attributes','map','include','model','then','GetCampaign','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','result','catch'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0xfe60,0x1cb));var _0x0fe6=function(_0x591dae,_0x90fa01){_0x591dae=_0x591dae-0x0;var _0x569227=_0xfe60[_0x591dae];return _0x569227;};'use strict';var _=require('lodash');var util=require(_0x0fe6('0x0'));var moment=require('moment');var BPromise=require(_0x0fe6('0x1'));var rs=require(_0x0fe6('0x2'));var fs=require('fs');var Redis=require(_0x0fe6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fe6('0x4'));var logger=require(_0x0fe6('0x5'))(_0x0fe6('0x6'));var config=require(_0x0fe6('0x7'));var jayson=require(_0x0fe6('0x8'));var client=jayson[_0x0fe6('0x9')][_0x0fe6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21775d,_0x31e58e,_0x24e88f){return new BPromise(function(_0x58d620,_0x2f1344){return client['request'](_0x21775d,_0x24e88f)['then'](function(_0x572d4f){logger[_0x0fe6('0xb')]('Campaign,\x20%s,\x20%s',_0x31e58e,_0x0fe6('0xc'));logger[_0x0fe6('0xd')](_0x0fe6('0xe'),_0x31e58e,_0x0fe6('0xc'),JSON[_0x0fe6('0xf')](_0x572d4f));if(_0x572d4f[_0x0fe6('0x10')]){if(_0x572d4f[_0x0fe6('0x10')]['code']===0x1f4){logger[_0x0fe6('0x10')](_0x0fe6('0x11'),_0x31e58e,_0x572d4f[_0x0fe6('0x10')]['message']);return _0x2f1344(_0x572d4f['error'][_0x0fe6('0x12')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x31e58e,_0x572d4f['error'][_0x0fe6('0x12')]);return _0x58d620(_0x572d4f[_0x0fe6('0x10')][_0x0fe6('0x12')]);}else{logger[_0x0fe6('0xb')](_0x0fe6('0x11'),_0x31e58e,_0x0fe6('0xc'));_0x58d620(_0x572d4f[_0x0fe6('0x13')][_0x0fe6('0x12')]);}})[_0x0fe6('0x14')](function(_0x4669c4){logger[_0x0fe6('0x10')](_0x0fe6('0x11'),_0x31e58e,_0x4669c4);_0x2f1344(_0x4669c4);});});}exports['GetCampaign']=function(_0x469a48){var _0xe6bb13=this;return new Promise(function(_0x34fc0c,_0x2d3c01){return db[_0x0fe6('0x15')][_0x0fe6('0x16')]({'raw':_0x469a48[_0x0fe6('0x17')]?_0x469a48[_0x0fe6('0x17')][_0x0fe6('0x18')]===undefined?!![]:![]:!![],'where':_0x469a48[_0x0fe6('0x17')]?_0x469a48[_0x0fe6('0x17')][_0x0fe6('0x19')]||null:null,'attributes':_0x469a48['options']?_0x469a48[_0x0fe6('0x17')][_0x0fe6('0x1a')]||null:null,'limit':_0x469a48[_0x0fe6('0x17')]?_0x469a48[_0x0fe6('0x17')]['limit']||null:null,'include':_0x469a48[_0x0fe6('0x17')]?_0x469a48[_0x0fe6('0x17')]['include']?_[_0x0fe6('0x1b')](_0x469a48['options'][_0x0fe6('0x1c')],function(_0x224741){return{'model':db[_0x224741[_0x0fe6('0x1d')]],'as':_0x224741['as'],'attributes':_0x224741[_0x0fe6('0x1a')],'include':_0x224741['include']?_[_0x0fe6('0x1b')](_0x224741[_0x0fe6('0x1c')],function(_0x7f855d){return{'model':db[_0x7f855d[_0x0fe6('0x1d')]],'as':_0x7f855d['as'],'attributes':_0x7f855d[_0x0fe6('0x1a')],'include':_0x7f855d['include']?_[_0x0fe6('0x1b')](_0x7f855d[_0x0fe6('0x1c')],function(_0x3428a7){return{'model':db[_0x3428a7[_0x0fe6('0x1d')]],'as':_0x3428a7['as'],'attributes':_0x3428a7[_0x0fe6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0fe6('0x1e')](function(_0x4e1c48){logger[_0x0fe6('0xb')](_0x0fe6('0x1f'),_0x469a48);logger[_0x0fe6('0xd')](_0x0fe6('0x1f'),_0x469a48,JSON[_0x0fe6('0xf')](_0x4e1c48));_0x34fc0c(_0x4e1c48);})[_0x0fe6('0x14')](function(_0x18fad1){logger[_0x0fe6('0x10')](_0x0fe6('0x1f'),_0x18fad1['message'],_0x469a48);_0x2d3c01(_0xe6bb13[_0x0fe6('0x10')](0x1f4,_0x18fad1[_0x0fe6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 394feaa..5312866 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 _0xf491=['destroy','delete','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','/:id/hoppers','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','/:id','update'];(function(_0x2f6ba4,_0x59e07a){var _0x1e3d24=function(_0x188c6b){while(--_0x188c6b){_0x2f6ba4['push'](_0x2f6ba4['shift']());}};_0x1e3d24(++_0x59e07a);}(_0xf491,0x178));var _0x1f49=function(_0x3c6837,_0x2312fb){_0x3c6837=_0x3c6837-0x0;var _0x5c187c=_0xf491[_0x3c6837];return _0x5c187c;};'use strict';var multer=require(_0x1f49('0x0'));var util=require(_0x1f49('0x1'));var path=require(_0x1f49('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f49('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f49('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f49('0x5'));var controller=require(_0x1f49('0x6'));router[_0x1f49('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1f49('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1f49('0x7')](_0x1f49('0x8'),auth[_0x1f49('0x9')](),controller['getHoppers']);router[_0x1f49('0x7')](_0x1f49('0xa'),auth[_0x1f49('0x9')](),controller[_0x1f49('0xb')]);router['get'](_0x1f49('0xc'),auth[_0x1f49('0x9')](),controller[_0x1f49('0xd')]);router[_0x1f49('0x7')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x1f49('0xe')]);router[_0x1f49('0x7')](_0x1f49('0xf'),auth[_0x1f49('0x9')](),controller[_0x1f49('0x10')]);router[_0x1f49('0x7')](_0x1f49('0x11'),auth[_0x1f49('0x9')](),controller[_0x1f49('0x12')]);router[_0x1f49('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1f49('0x14'),auth[_0x1f49('0x9')](),controller[_0x1f49('0x15')]);router[_0x1f49('0x13')]('/:id/lists',auth['isAuthenticated'](),controller[_0x1f49('0x16')]);router[_0x1f49('0x13')]('/:id/blacklists',auth[_0x1f49('0x9')](),controller[_0x1f49('0x17')]);router[_0x1f49('0x18')](_0x1f49('0x19'),auth[_0x1f49('0x9')](),controller[_0x1f49('0x1a')]);router['delete'](_0x1f49('0x19'),auth['isAuthenticated'](),controller[_0x1f49('0x1b')]);router['delete'](_0x1f49('0xf'),auth[_0x1f49('0x9')](),controller['removeLists']);router[_0x1f49('0x1c')](_0x1f49('0x11'),auth[_0x1f49('0x9')](),controller[_0x1f49('0x1d')]);module[_0x1f49('0x1e')]=router; \ No newline at end of file +var _0xe186=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','/:id','update','destroy','delete','removeLists','removeBlackLists','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/hoppers','getHoppers'];(function(_0x536195,_0x145f3e){var _0x293236=function(_0x6cbeec){while(--_0x6cbeec){_0x536195['push'](_0x536195['shift']());}};_0x293236(++_0x145f3e);}(_0xe186,0x146));var _0x6e18=function(_0xea16f,_0x24995b){_0xea16f=_0xea16f-0x0;var _0x32104c=_0xe186[_0xea16f];return _0x32104c;};'use strict';var multer=require(_0x6e18('0x0'));var util=require(_0x6e18('0x1'));var path=require('path');var timeout=require(_0x6e18('0x2'));var express=require(_0x6e18('0x3'));var router=express[_0x6e18('0x4')]();var fs_extra=require(_0x6e18('0x5'));var auth=require(_0x6e18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6e18('0x7'));var controller=require('./campaign.controller');router[_0x6e18('0x8')]('/',auth[_0x6e18('0x9')](),controller[_0x6e18('0xa')]);router['get']('/:id',auth[_0x6e18('0x9')](),controller[_0x6e18('0xb')]);router[_0x6e18('0x8')](_0x6e18('0xc'),auth[_0x6e18('0x9')](),controller[_0x6e18('0xd')]);router[_0x6e18('0x8')](_0x6e18('0xe'),auth['isAuthenticated'](),controller[_0x6e18('0xf')]);router[_0x6e18('0x8')](_0x6e18('0x10'),auth[_0x6e18('0x9')](),controller[_0x6e18('0x11')]);router['get'](_0x6e18('0x12'),auth['isAuthenticated'](),controller[_0x6e18('0x13')]);router[_0x6e18('0x8')](_0x6e18('0x14'),auth[_0x6e18('0x9')](),controller[_0x6e18('0x15')]);router[_0x6e18('0x8')]('/:id/blacklists',auth[_0x6e18('0x9')](),controller[_0x6e18('0x16')]);router[_0x6e18('0x17')]('/',auth['isAuthenticated'](),controller[_0x6e18('0x18')]);router[_0x6e18('0x17')](_0x6e18('0x19'),auth[_0x6e18('0x9')](),controller[_0x6e18('0x1a')]);router[_0x6e18('0x17')](_0x6e18('0x14'),auth['isAuthenticated'](),controller['addLists']);router[_0x6e18('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x6e18('0x1b')]);router['put'](_0x6e18('0x1c'),auth[_0x6e18('0x9')](),controller[_0x6e18('0x1d')]);router['delete']('/:id',auth[_0x6e18('0x9')](),controller[_0x6e18('0x1e')]);router[_0x6e18('0x1f')](_0x6e18('0x14'),auth[_0x6e18('0x9')](),controller[_0x6e18('0x20')]);router[_0x6e18('0x1f')]('/:id/blacklists',auth[_0x6e18('0x9')](),controller[_0x6e18('0x21')]);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 ca3f686..99fddd8 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 _0xeb9a=['TEXT','VIRTUAL','getDataValue','sequelize','STRING'];(function(_0x153d1b,_0x3d74d6){var _0x1eb258=function(_0xbcc8d8){while(--_0xbcc8d8){_0x153d1b['push'](_0x153d1b['shift']());}};_0x1eb258(++_0x3d74d6);}(_0xeb9a,0x1a2));var _0xaeb9=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xeb9a[_0x5cb1af];return _0x8d7940;};'use strict';var Sequelize=require(_0xaeb9('0x0'));module['exports']={'key':{'type':Sequelize[_0xaeb9('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xaeb9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xaeb9('0x3')],'get':function(){return this[_0xaeb9('0x4')]('key');}}}; \ No newline at end of file +var _0x181e=['key','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x1057a8,_0x355fd3){var _0x4fa6b1=function(_0x2646a9){while(--_0x2646a9){_0x1057a8['push'](_0x1057a8['shift']());}};_0x4fa6b1(++_0x355fd3);}(_0x181e,0x88));var _0xe181=function(_0xea73f,_0x4d4ce7){_0xea73f=_0xea73f-0x0;var _0x7ee2e9=_0x181e[_0xea73f];return _0x7ee2e9;};'use strict';var Sequelize=require(_0xe181('0x0'));module[_0xe181('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe181('0x2')],'get':function(){return this[_0xe181('0x3')](_0xe181('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 3e8d134..e3bd6cb 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 _0x2c69=['squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','CannedAnswers','UserProfileResource','name','send','index','map','CannedAnswer','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rawAttributes','include','options','find','body','params','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5958d2,_0x550300){var _0x2a4809=function(_0x48048b){while(--_0x48048b){_0x5958d2['push'](_0x5958d2['shift']());}};_0x2a4809(++_0x550300);}(_0x2c69,0x9e));var _0x92c6=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x2c69[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0x92c6('0x0'));var rimraf=require(_0x92c6('0x1'));var zipdir=require(_0x92c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92c6('0x3'));var moment=require(_0x92c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x92c6('0x5'));var path=require(_0x92c6('0x6'));var sox=require(_0x92c6('0x7'));var csv=require(_0x92c6('0x8'));var ejs=require(_0x92c6('0x9'));var fs=require('fs');var fs_extra=require(_0x92c6('0xa'));var _=require(_0x92c6('0xb'));var squel=require(_0x92c6('0xc'));var crypto=require(_0x92c6('0xd'));var jsforce=require(_0x92c6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x92c6('0x8'));var querystring=require(_0x92c6('0xf'));var Papa=require(_0x92c6('0x10'));var Redis=require('ioredis');var authService=require(_0x92c6('0x11'));var qs=require(_0x92c6('0x12'));var as=require(_0x92c6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x92c6('0x14'));var licenseUtil=require(_0x92c6('0x15'));var db=require(_0x92c6('0x16'))['db'];function respondWithStatusCode(_0xdc8929,_0x46497a){_0x46497a=_0x46497a||0xcc;return function(_0x4ec83c){if(_0x4ec83c){return _0xdc8929[_0x92c6('0x17')](_0x46497a);}return _0xdc8929['status'](_0x46497a)[_0x92c6('0x18')]();};}function respondWithResult(_0x91088f,_0x141ffa){_0x141ffa=_0x141ffa||0xc8;return function(_0x3e4efb){if(_0x3e4efb){return _0x91088f[_0x92c6('0x19')](_0x141ffa)[_0x92c6('0x1a')](_0x3e4efb);}};}function respondWithFilteredResult(_0x276e80,_0x4654ae){return function(_0x14acfb){if(_0x14acfb){var _0x38f8d7=typeof _0x4654ae[_0x92c6('0x1b')]===_0x92c6('0x1c')&&typeof _0x4654ae[_0x92c6('0x1d')]==='undefined';var _0x440731=_0x14acfb[_0x92c6('0x1e')];var _0x57704b=_0x38f8d7?0x0:_0x4654ae[_0x92c6('0x1b')];var _0x1c0349=_0x38f8d7?_0x14acfb['count']:_0x4654ae[_0x92c6('0x1b')]+_0x4654ae['limit'];var _0x426429;if(_0x1c0349>=_0x440731){_0x1c0349=_0x440731;_0x426429=0xc8;}else{_0x426429=0xce;}_0x276e80['status'](_0x426429);return _0x276e80[_0x92c6('0x1f')](_0x92c6('0x20'),_0x57704b+'-'+_0x1c0349+'/'+_0x440731)['json'](_0x14acfb);}return null;};}function patchUpdates(_0x5be053){return function(_0x30558d){try{jsonpatch[_0x92c6('0x21')](_0x30558d,_0x5be053,!![]);}catch(_0x589b9b){return BPromise[_0x92c6('0x22')](_0x589b9b);}return _0x30558d['save']();};}function saveUpdates(_0x1a020b,_0x6ee431){return function(_0x3fb39a){if(_0x3fb39a){return _0x3fb39a[_0x92c6('0x23')](_0x1a020b)[_0x92c6('0x24')](function(_0x5ad726){return _0x5ad726;});}return null;};}function removeEntity(_0x2dbdc6,_0x1644cc){return function(_0x517c7b){if(_0x517c7b){return _0x517c7b[_0x92c6('0x25')]()[_0x92c6('0x24')](function(){var _0x5cb1c5=_0x517c7b['get']({'plain':!![]});var _0x18524c=_0x92c6('0x26');return db[_0x92c6('0x27')][_0x92c6('0x25')]({'where':{'type':_0x18524c,'resourceId':_0x5cb1c5['id']}})[_0x92c6('0x24')](function(){return _0x517c7b;});})['then'](function(){_0x2dbdc6['status'](0xcc)[_0x92c6('0x18')]();});}};}function handleEntityNotFound(_0x4513a1,_0x3a3914){return function(_0x1f17b3){if(!_0x1f17b3){_0x4513a1[_0x92c6('0x17')](0x194);}return _0x1f17b3;};}function handleError(_0x5c8041,_0x40b8db){_0x40b8db=_0x40b8db||0x1f4;return function(_0x3b08a6){logger['error'](_0x3b08a6['stack']);if(_0x3b08a6[_0x92c6('0x28')]){delete _0x3b08a6['name'];}_0x5c8041['status'](_0x40b8db)[_0x92c6('0x29')](_0x3b08a6);};}exports[_0x92c6('0x2a')]=function(_0x44ea64,_0x38e6aa){var _0xb5ceb8={},_0x1bc7e6={},_0x413ad3={'count':0x0,'rows':[]};var _0x5abc64=_[_0x92c6('0x2b')](db[_0x92c6('0x2c')]['rawAttributes'],function(_0xc3ab12){return{'name':_0xc3ab12['fieldName'],'type':_0xc3ab12[_0x92c6('0x2d')][_0x92c6('0x2e')]};});_0x1bc7e6[_0x92c6('0x2f')]=_[_0x92c6('0x2b')](_0x5abc64,'name');_0x1bc7e6[_0x92c6('0x30')]=_[_0x92c6('0x31')](_0x44ea64[_0x92c6('0x30')]);_0x1bc7e6[_0x92c6('0x32')]=_[_0x92c6('0x33')](_0x1bc7e6[_0x92c6('0x2f')],_0x1bc7e6[_0x92c6('0x30')]);_0xb5ceb8[_0x92c6('0x34')]=_[_0x92c6('0x33')](_0x1bc7e6[_0x92c6('0x2f')],qs[_0x92c6('0x35')](_0x44ea64['query']['fields']));_0xb5ceb8['attributes']=_0xb5ceb8[_0x92c6('0x34')][_0x92c6('0x36')]?_0xb5ceb8[_0x92c6('0x34')]:_0x1bc7e6['model'];if(!_0x44ea64[_0x92c6('0x30')][_0x92c6('0x37')](_0x92c6('0x38'))){_0xb5ceb8[_0x92c6('0x1d')]=qs[_0x92c6('0x1d')](_0x44ea64[_0x92c6('0x30')][_0x92c6('0x1d')]);_0xb5ceb8['offset']=qs['offset'](_0x44ea64[_0x92c6('0x30')][_0x92c6('0x1b')]);}_0xb5ceb8[_0x92c6('0x39')]=qs[_0x92c6('0x3a')](_0x44ea64[_0x92c6('0x30')][_0x92c6('0x3a')]);_0xb5ceb8[_0x92c6('0x3b')]=qs[_0x92c6('0x32')](_[_0x92c6('0x3c')](_0x44ea64[_0x92c6('0x30')],_0x1bc7e6['filters']),_0x5abc64);if(_0x44ea64[_0x92c6('0x30')][_0x92c6('0x3d')]){_0xb5ceb8[_0x92c6('0x3b')]=_[_0x92c6('0x3e')](_0xb5ceb8[_0x92c6('0x3b')],{'$or':[{'key':{'$like':'%'+_0x44ea64[_0x92c6('0x30')][_0x92c6('0x3d')]+'%'}},{'value':{'$like':'%'+_0x44ea64[_0x92c6('0x30')][_0x92c6('0x3d')]+'%'}}]});}_0xb5ceb8=_[_0x92c6('0x3e')]({},_0xb5ceb8,_0x44ea64['options']);var _0x387395={'where':_0xb5ceb8['where']};return db[_0x92c6('0x2c')][_0x92c6('0x1e')](_0x387395)['then'](function(_0x10f696){_0x413ad3['count']=_0x10f696;if(_0x44ea64[_0x92c6('0x30')][_0x92c6('0x3f')]){_0xb5ceb8['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x92c6('0x40')](_0xb5ceb8);})[_0x92c6('0x24')](function(_0x4701b2){_0x413ad3['rows']=_0x4701b2;return _0x413ad3;})[_0x92c6('0x24')](respondWithFilteredResult(_0x38e6aa,_0xb5ceb8))['catch'](handleError(_0x38e6aa,null));};exports['show']=function(_0x9dbe25,_0x30ee73){var _0x179c49={'raw':!![],'where':{'id':_0x9dbe25['params']['id']}},_0x3729c4={};_0x3729c4[_0x92c6('0x2f')]=_[_0x92c6('0x31')](db[_0x92c6('0x2c')][_0x92c6('0x41')]);_0x3729c4[_0x92c6('0x30')]=_[_0x92c6('0x31')](_0x9dbe25[_0x92c6('0x30')]);_0x3729c4[_0x92c6('0x32')]=_[_0x92c6('0x33')](_0x3729c4['model'],_0x3729c4[_0x92c6('0x30')]);_0x179c49[_0x92c6('0x34')]=_[_0x92c6('0x33')](_0x3729c4[_0x92c6('0x2f')],qs[_0x92c6('0x35')](_0x9dbe25[_0x92c6('0x30')][_0x92c6('0x35')]));_0x179c49[_0x92c6('0x34')]=_0x179c49[_0x92c6('0x34')]['length']?_0x179c49[_0x92c6('0x34')]:_0x3729c4[_0x92c6('0x2f')];if(_0x9dbe25[_0x92c6('0x30')][_0x92c6('0x3f')]){_0x179c49[_0x92c6('0x42')]=[{'all':!![]}];}_0x179c49=_[_0x92c6('0x3e')]({},_0x179c49,_0x9dbe25[_0x92c6('0x43')]);return db[_0x92c6('0x2c')][_0x92c6('0x44')](_0x179c49)['then'](handleEntityNotFound(_0x30ee73,null))[_0x92c6('0x24')](respondWithResult(_0x30ee73,null))['catch'](handleError(_0x30ee73,null));};exports[_0x92c6('0x23')]=function(_0x2774c0,_0xea8f98){if(_0x2774c0[_0x92c6('0x45')]['id']){delete _0x2774c0[_0x92c6('0x45')]['id'];}return db[_0x92c6('0x2c')]['find']({'where':{'id':_0x2774c0[_0x92c6('0x46')]['id']}})[_0x92c6('0x24')](handleEntityNotFound(_0xea8f98,null))[_0x92c6('0x24')](saveUpdates(_0x2774c0[_0x92c6('0x45')],null))[_0x92c6('0x24')](respondWithResult(_0xea8f98,null))[_0x92c6('0x47')](handleError(_0xea8f98,null));};exports[_0x92c6('0x25')]=function(_0x4aa7ed,_0x1e2422){return db[_0x92c6('0x2c')]['find']({'where':{'id':_0x4aa7ed[_0x92c6('0x46')]['id']}})[_0x92c6('0x24')](handleEntityNotFound(_0x1e2422,null))['then'](removeEntity(_0x1e2422,null))[_0x92c6('0x47')](handleError(_0x1e2422,null));};exports[_0x92c6('0x48')]=function(_0x24004c,_0x3592ea){var _0x57853e={'key':_0x24004c[_0x92c6('0x45')][_0x92c6('0x2e')]};if(_0x24004c['body'][_0x92c6('0x49')]){_0x57853e[_0x92c6('0x49')]=_0x24004c[_0x92c6('0x45')][_0x92c6('0x49')];}else if(_0x24004c[_0x92c6('0x45')][_0x92c6('0x4a')]){_0x57853e[_0x92c6('0x4a')]=_0x24004c[_0x92c6('0x45')][_0x92c6('0x4a')];}else if(_0x24004c[_0x92c6('0x45')][_0x92c6('0x4b')]){_0x57853e[_0x92c6('0x4b')]=_0x24004c['body'][_0x92c6('0x4b')];}else if(_0x24004c['body'][_0x92c6('0x4c')]){_0x57853e[_0x92c6('0x4c')]=_0x24004c[_0x92c6('0x45')][_0x92c6('0x4c')];}return db['CannedAnswer'][_0x92c6('0x44')]({'where':_0x57853e})['then'](function(_0x5d0e7a){if(_0x5d0e7a){throw new db[(_0x92c6('0x4d'))][(_0x92c6('0x4e'))](_0x92c6('0x4f'));}return db[_0x92c6('0x2c')][_0x92c6('0x48')](_0x24004c[_0x92c6('0x45')]);})[_0x92c6('0x24')](function(_0x1ead23){var _0x45102a=_0x24004c[_0x92c6('0x50')]['get']({'plain':!![]});if(!_0x45102a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45102a['role']===_0x92c6('0x50')){var _0x37d820=_0x1ead23['get']({'plain':!![]});return db[_0x92c6('0x51')][_0x92c6('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x45102a[_0x92c6('0x52')]},'raw':!![]})['then'](function(_0x30179c){if(_0x30179c&&_0x30179c[_0x92c6('0x53')]===0x0){return db[_0x92c6('0x27')]['create']({'name':_0x37d820[_0x92c6('0x28')],'resourceId':_0x37d820['id'],'type':_0x30179c[_0x92c6('0x28')],'sectionId':_0x30179c['id']},{})[_0x92c6('0x24')](function(){return _0x1ead23;});}else{return _0x1ead23;}})[_0x92c6('0x47')](function(_0x2430f8){logger['error'](_0x92c6('0x54'),_0x2430f8);throw _0x2430f8;});}return _0x1ead23;})['then'](respondWithResult(_0x3592ea,0xc9))[_0x92c6('0x47')](handleError(_0x3592ea,null));}; \ No newline at end of file +var _0xb571=['The\x20inserted\x20key\x20already\x20exists.','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','index','map','CannedAnswer','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','include','findAll','show','find','catch','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError'];(function(_0x57d628,_0xda6747){var _0x2f8486=function(_0x5f2cba){while(--_0x5f2cba){_0x57d628['push'](_0x57d628['shift']());}};_0x2f8486(++_0xda6747);}(_0xb571,0x1ed));var _0x1b57=function(_0x5dec36,_0x3d2662){_0x5dec36=_0x5dec36-0x0;var _0x4f342e=_0xb571[_0x5dec36];return _0x4f342e;};'use strict';var emlformat=require(_0x1b57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1b57('0x1'));var moment=require(_0x1b57('0x2'));var BPromise=require(_0x1b57('0x3'));var Mustache=require(_0x1b57('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1b57('0x5'));var csv=require('to-csv');var ejs=require(_0x1b57('0x6'));var fs=require('fs');var fs_extra=require(_0x1b57('0x7'));var _=require(_0x1b57('0x8'));var squel=require(_0x1b57('0x9'));var crypto=require(_0x1b57('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b57('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1b57('0xc'));var Papa=require('papaparse');var Redis=require(_0x1b57('0xd'));var authService=require(_0x1b57('0xe'));var qs=require(_0x1b57('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b57('0x10'));var logger=require('../../config/logger')(_0x1b57('0x11'));var utils=require(_0x1b57('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1b57('0x13'));var db=require(_0x1b57('0x14'))['db'];function respondWithStatusCode(_0x2c6a5e,_0x551ede){_0x551ede=_0x551ede||0xcc;return function(_0x1fa92b){if(_0x1fa92b){return _0x2c6a5e[_0x1b57('0x15')](_0x551ede);}return _0x2c6a5e[_0x1b57('0x16')](_0x551ede)[_0x1b57('0x17')]();};}function respondWithResult(_0x524573,_0x1a83ab){_0x1a83ab=_0x1a83ab||0xc8;return function(_0x33db7f){if(_0x33db7f){return _0x524573[_0x1b57('0x16')](_0x1a83ab)[_0x1b57('0x18')](_0x33db7f);}};}function respondWithFilteredResult(_0x415d79,_0x2fdd39){return function(_0x435fd0){if(_0x435fd0){var _0x5ad966=typeof _0x2fdd39[_0x1b57('0x19')]===_0x1b57('0x1a')&&typeof _0x2fdd39['limit']===_0x1b57('0x1a');var _0x1329b7=_0x435fd0[_0x1b57('0x1b')];var _0x394ebf=_0x5ad966?0x0:_0x2fdd39[_0x1b57('0x19')];var _0x4e4e33=_0x5ad966?_0x435fd0['count']:_0x2fdd39[_0x1b57('0x19')]+_0x2fdd39[_0x1b57('0x1c')];var _0x1debce;if(_0x4e4e33>=_0x1329b7){_0x4e4e33=_0x1329b7;_0x1debce=0xc8;}else{_0x1debce=0xce;}_0x415d79['status'](_0x1debce);return _0x415d79[_0x1b57('0x1d')](_0x1b57('0x1e'),_0x394ebf+'-'+_0x4e4e33+'/'+_0x1329b7)[_0x1b57('0x18')](_0x435fd0);}return null;};}function patchUpdates(_0x43ade0){return function(_0x223c6e){try{jsonpatch[_0x1b57('0x1f')](_0x223c6e,_0x43ade0,!![]);}catch(_0x37954f){return BPromise[_0x1b57('0x20')](_0x37954f);}return _0x223c6e[_0x1b57('0x21')]();};}function saveUpdates(_0x55515d,_0x3b6bfe){return function(_0x581535){if(_0x581535){return _0x581535['update'](_0x55515d)[_0x1b57('0x22')](function(_0x530aa1){return _0x530aa1;});}return null;};}function removeEntity(_0x242ee4,_0x14af5b){return function(_0x12a8fc){if(_0x12a8fc){return _0x12a8fc[_0x1b57('0x23')]()['then'](function(){var _0x27f0fd=_0x12a8fc['get']({'plain':!![]});var _0x25c0da='CannedAnswers';return db[_0x1b57('0x24')][_0x1b57('0x23')]({'where':{'type':_0x25c0da,'resourceId':_0x27f0fd['id']}})[_0x1b57('0x22')](function(){return _0x12a8fc;});})[_0x1b57('0x22')](function(){_0x242ee4[_0x1b57('0x16')](0xcc)[_0x1b57('0x17')]();});}};}function handleEntityNotFound(_0x5a30aa,_0x3c6b31){return function(_0x46f123){if(!_0x46f123){_0x5a30aa['sendStatus'](0x194);}return _0x46f123;};}function handleError(_0x3c1952,_0x2ddcb0){_0x2ddcb0=_0x2ddcb0||0x1f4;return function(_0x56c73f){logger[_0x1b57('0x25')](_0x56c73f[_0x1b57('0x26')]);if(_0x56c73f[_0x1b57('0x27')]){delete _0x56c73f[_0x1b57('0x27')];}_0x3c1952[_0x1b57('0x16')](_0x2ddcb0)['send'](_0x56c73f);};}exports[_0x1b57('0x28')]=function(_0x481ba4,_0x2ce6c4){var _0x1d657d={},_0x1579f4={},_0x1caab5={'count':0x0,'rows':[]};var _0x4acb4d=_[_0x1b57('0x29')](db[_0x1b57('0x2a')]['rawAttributes'],function(_0x5118f4){return{'name':_0x5118f4['fieldName'],'type':_0x5118f4['type'][_0x1b57('0x2b')]};});_0x1579f4[_0x1b57('0x2c')]=_['map'](_0x4acb4d,'name');_0x1579f4['query']=_[_0x1b57('0x2d')](_0x481ba4[_0x1b57('0x2e')]);_0x1579f4[_0x1b57('0x2f')]=_[_0x1b57('0x30')](_0x1579f4['model'],_0x1579f4['query']);_0x1d657d[_0x1b57('0x31')]=_['intersection'](_0x1579f4[_0x1b57('0x2c')],qs[_0x1b57('0x32')](_0x481ba4[_0x1b57('0x2e')][_0x1b57('0x32')]));_0x1d657d[_0x1b57('0x31')]=_0x1d657d['attributes'][_0x1b57('0x33')]?_0x1d657d[_0x1b57('0x31')]:_0x1579f4[_0x1b57('0x2c')];if(!_0x481ba4['query']['hasOwnProperty'](_0x1b57('0x34'))){_0x1d657d['limit']=qs['limit'](_0x481ba4[_0x1b57('0x2e')]['limit']);_0x1d657d[_0x1b57('0x19')]=qs[_0x1b57('0x19')](_0x481ba4[_0x1b57('0x2e')][_0x1b57('0x19')]);}_0x1d657d[_0x1b57('0x35')]=qs[_0x1b57('0x36')](_0x481ba4[_0x1b57('0x2e')][_0x1b57('0x36')]);_0x1d657d[_0x1b57('0x37')]=qs['filters'](_['pick'](_0x481ba4[_0x1b57('0x2e')],_0x1579f4['filters']),_0x4acb4d);if(_0x481ba4['query'][_0x1b57('0x38')]){_0x1d657d['where']=_[_0x1b57('0x39')](_0x1d657d[_0x1b57('0x37')],{'$or':[{'key':{'$like':'%'+_0x481ba4[_0x1b57('0x2e')][_0x1b57('0x38')]+'%'}},{'value':{'$like':'%'+_0x481ba4[_0x1b57('0x2e')][_0x1b57('0x38')]+'%'}}]});}_0x1d657d=_[_0x1b57('0x39')]({},_0x1d657d,_0x481ba4[_0x1b57('0x3a')]);var _0x5dc750={'where':_0x1d657d[_0x1b57('0x37')]};return db[_0x1b57('0x2a')][_0x1b57('0x1b')](_0x5dc750)['then'](function(_0x4f6344){_0x1caab5[_0x1b57('0x1b')]=_0x4f6344;if(_0x481ba4[_0x1b57('0x2e')]['includeAll']){_0x1d657d[_0x1b57('0x3b')]=[{'all':!![]}];}return db[_0x1b57('0x2a')][_0x1b57('0x3c')](_0x1d657d);})['then'](function(_0x163115){_0x1caab5['rows']=_0x163115;return _0x1caab5;})[_0x1b57('0x22')](respondWithFilteredResult(_0x2ce6c4,_0x1d657d))['catch'](handleError(_0x2ce6c4,null));};exports[_0x1b57('0x3d')]=function(_0x1255d3,_0x1d8ffe){var _0x11fb56={'raw':!![],'where':{'id':_0x1255d3['params']['id']}},_0xe72aa6={};_0xe72aa6[_0x1b57('0x2c')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0xe72aa6[_0x1b57('0x2e')]=_['keys'](_0x1255d3[_0x1b57('0x2e')]);_0xe72aa6[_0x1b57('0x2f')]=_[_0x1b57('0x30')](_0xe72aa6[_0x1b57('0x2c')],_0xe72aa6[_0x1b57('0x2e')]);_0x11fb56[_0x1b57('0x31')]=_[_0x1b57('0x30')](_0xe72aa6[_0x1b57('0x2c')],qs[_0x1b57('0x32')](_0x1255d3[_0x1b57('0x2e')][_0x1b57('0x32')]));_0x11fb56['attributes']=_0x11fb56[_0x1b57('0x31')][_0x1b57('0x33')]?_0x11fb56[_0x1b57('0x31')]:_0xe72aa6['model'];if(_0x1255d3[_0x1b57('0x2e')]['includeAll']){_0x11fb56['include']=[{'all':!![]}];}_0x11fb56=_[_0x1b57('0x39')]({},_0x11fb56,_0x1255d3[_0x1b57('0x3a')]);return db[_0x1b57('0x2a')][_0x1b57('0x3e')](_0x11fb56)['then'](handleEntityNotFound(_0x1d8ffe,null))[_0x1b57('0x22')](respondWithResult(_0x1d8ffe,null))[_0x1b57('0x3f')](handleError(_0x1d8ffe,null));};exports[_0x1b57('0x40')]=function(_0x453eec,_0x200c80){if(_0x453eec[_0x1b57('0x41')]['id']){delete _0x453eec[_0x1b57('0x41')]['id'];}return db[_0x1b57('0x2a')][_0x1b57('0x3e')]({'where':{'id':_0x453eec[_0x1b57('0x42')]['id']}})[_0x1b57('0x22')](handleEntityNotFound(_0x200c80,null))[_0x1b57('0x22')](saveUpdates(_0x453eec['body'],null))[_0x1b57('0x22')](respondWithResult(_0x200c80,null))['catch'](handleError(_0x200c80,null));};exports[_0x1b57('0x23')]=function(_0x2a1d8f,_0x26f500){return db['CannedAnswer'][_0x1b57('0x3e')]({'where':{'id':_0x2a1d8f[_0x1b57('0x42')]['id']}})[_0x1b57('0x22')](handleEntityNotFound(_0x26f500,null))[_0x1b57('0x22')](removeEntity(_0x26f500,null))[_0x1b57('0x3f')](handleError(_0x26f500,null));};exports[_0x1b57('0x43')]=function(_0x261620,_0x5043a7){var _0x469d9d={'key':_0x261620['body'][_0x1b57('0x2b')]};if(_0x261620[_0x1b57('0x41')][_0x1b57('0x44')]){_0x469d9d[_0x1b57('0x44')]=_0x261620[_0x1b57('0x41')]['MailAccountId'];}else if(_0x261620[_0x1b57('0x41')][_0x1b57('0x45')]){_0x469d9d[_0x1b57('0x45')]=_0x261620['body']['SmsAccountId'];}else if(_0x261620[_0x1b57('0x41')][_0x1b57('0x46')]){_0x469d9d[_0x1b57('0x46')]=_0x261620[_0x1b57('0x41')][_0x1b57('0x46')];}else if(_0x261620['body'][_0x1b57('0x47')]){_0x469d9d[_0x1b57('0x47')]=_0x261620['body'][_0x1b57('0x47')];}return db[_0x1b57('0x2a')][_0x1b57('0x3e')]({'where':_0x469d9d})[_0x1b57('0x22')](function(_0x31edfb){if(_0x31edfb){throw new db[(_0x1b57('0x48'))][(_0x1b57('0x49'))](_0x1b57('0x4a'));}return db['CannedAnswer'][_0x1b57('0x43')](_0x261620[_0x1b57('0x41')]);})['then'](function(_0x57bf57){var _0x41576c=_0x261620['user'][_0x1b57('0x4b')]({'plain':!![]});if(!_0x41576c)throw new Error(_0x1b57('0x4c'));if(_0x41576c[_0x1b57('0x4d')]==='user'){var _0x43aafc=_0x57bf57['get']({'plain':!![]});return db['UserProfileSection'][_0x1b57('0x3e')]({'where':{'name':_0x1b57('0x4e'),'userProfileId':_0x41576c['userProfileId']},'raw':!![]})[_0x1b57('0x22')](function(_0x137faf){if(_0x137faf&&_0x137faf[_0x1b57('0x4f')]===0x0){return db[_0x1b57('0x24')][_0x1b57('0x43')]({'name':_0x43aafc['name'],'resourceId':_0x43aafc['id'],'type':_0x137faf[_0x1b57('0x27')],'sectionId':_0x137faf['id']},{})[_0x1b57('0x22')](function(){return _0x57bf57;});}else{return _0x57bf57;}})[_0x1b57('0x3f')](function(_0x1789cf){logger[_0x1b57('0x25')](_0x1b57('0x50'),_0x1789cf);throw _0x1789cf;});}return _0x57bf57;})['then'](respondWithResult(_0x5043a7,0xc9))[_0x1b57('0x3f')](handleError(_0x5043a7,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 7ce47c4..237ea61 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 _0xe6d7=['moment','bluebird','request-promise','rimraf','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0xf4b4e6,_0x11ccf0){var _0x4c61e7=function(_0x20a183){while(--_0x20a183){_0xf4b4e6['push'](_0xf4b4e6['shift']());}};_0x4c61e7(++_0x11ccf0);}(_0xe6d7,0x1ae));var _0x7e6d=function(_0x31c57a,_0x287684){_0x31c57a=_0x31c57a-0x0;var _0x18e467=_0xe6d7[_0x31c57a];return _0x18e467;};'use strict';var _=require('lodash');var util=require(_0x7e6d('0x0'));var logger=require('../../config/logger')(_0x7e6d('0x1'));var moment=require(_0x7e6d('0x2'));var BPromise=require(_0x7e6d('0x3'));var rp=require(_0x7e6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e6d('0x5'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x7e6d('0x6')]=function(_0x23c09e,_0x4faafe){return _0x23c09e[_0x7e6d('0x7')](_0x7e6d('0x8'),attributes,{'tableName':_0x7e6d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e6d('0xa'),'collate':_0x7e6d('0xb')});}; \ No newline at end of file +var _0xf770=['CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','exports'];(function(_0x2e0d04,_0x28aa4e){var _0x3294b6=function(_0x55b57c){while(--_0x55b57c){_0x2e0d04['push'](_0x2e0d04['shift']());}};_0x3294b6(++_0x28aa4e);}(_0xf770,0x107));var _0x0f77=function(_0x2bf090,_0x2a5239){_0x2bf090=_0x2bf090-0x0;var _0x596c1b=_0xf770[_0x2bf090];return _0x596c1b;};'use strict';var _=require(_0x0f77('0x0'));var util=require('util');var logger=require(_0x0f77('0x1'))('api');var moment=require(_0x0f77('0x2'));var BPromise=require(_0x0f77('0x3'));var rp=require(_0x0f77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f77('0x5'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x0f77('0x6')]=function(_0x57a93e,_0x336071){return _0x57a93e['define'](_0x0f77('0x7'),attributes,{'tableName':_0x0f77('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0f77('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 3b920d0..5ffa04d 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(_0x232b13,_0x19ad68){var _0x34e377=function(_0x18566b){while(--_0x18566b){_0x232b13['push'](_0x232b13['shift']());}};_0x34e377(++_0x19ad68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x396d19,_0x2bf082){var _0x5d307b=function(_0x1339ac){while(--_0x1339ac){_0x396d19['push'](_0x396d19['shift']());}};_0x5d307b(++_0x2bf082);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 f23e97f..0ab16f7 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 _0x8292=['/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','put'];(function(_0x1df97c,_0x3c8720){var _0x2a7d9c=function(_0x15517f){while(--_0x15517f){_0x1df97c['push'](_0x1df97c['shift']());}};_0x2a7d9c(++_0x3c8720);}(_0x8292,0x70));var _0x2829=function(_0x509771,_0x3b6a5d){_0x509771=_0x509771-0x0;var _0x1ed8fe=_0x8292[_0x509771];return _0x1ed8fe;};'use strict';var multer=require(_0x2829('0x0'));var util=require('util');var path=require(_0x2829('0x1'));var timeout=require('connect-timeout');var express=require(_0x2829('0x2'));var router=express[_0x2829('0x3')]();var fs_extra=require(_0x2829('0x4'));var auth=require(_0x2829('0x5'));var interaction=require(_0x2829('0x6'));var config=require(_0x2829('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x2829('0x8')](),controller[_0x2829('0x9')]);router[_0x2829('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2829('0xb')]);router[_0x2829('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2829('0xd')](_0x2829('0xe'),auth[_0x2829('0x8')](),controller['update']);router[_0x2829('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2829('0x10')]);module[_0x2829('0x11')]=router; \ No newline at end of file +var _0xf83c=['fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x36ac6a,_0x1195e1){var _0x1f992b=function(_0x16f319){while(--_0x16f319){_0x36ac6a['push'](_0x36ac6a['shift']());}};_0x1f992b(++_0x1195e1);}(_0xf83c,0x82));var _0xcf83=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xf83c[_0x576266];return _0x18234f;};'use strict';var multer=require(_0xcf83('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcf83('0x1'));var express=require(_0xcf83('0x2'));var router=express['Router']();var fs_extra=require(_0xcf83('0x3'));var auth=require(_0xcf83('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcf83('0x5'));var controller=require(_0xcf83('0x6'));router[_0xcf83('0x7')]('/',auth[_0xcf83('0x8')](),controller[_0xcf83('0x9')]);router['get'](_0xcf83('0xa'),auth[_0xcf83('0x8')](),controller[_0xcf83('0xb')]);router[_0xcf83('0xc')]('/',auth['isAuthenticated'](),controller[_0xcf83('0xd')]);router[_0xcf83('0xe')](_0xcf83('0xa'),auth['isAuthenticated'](),controller[_0xcf83('0xf')]);router[_0xcf83('0x10')](_0xcf83('0xa'),auth['isAuthenticated'](),controller[_0xcf83('0x11')]);module[_0xcf83('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 84d89da..f4606ef 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 _0xe74e=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x321c6c,_0x3a9191){var _0x30e55f=function(_0xaf51ab){while(--_0xaf51ab){_0x321c6c['push'](_0x321c6c['shift']());}};_0x30e55f(++_0x3a9191);}(_0xe74e,0x10a));var _0xee74=function(_0x3e9f23,_0x400bf1){_0x3e9f23=_0x3e9f23-0x0;var _0xc8c4a2=_0xe74e[_0x3e9f23];return _0xc8c4a2;};'use strict';var Sequelize=require('sequelize');module[_0xee74('0x0')]={'calldate':{'type':Sequelize[_0xee74('0x1')],'allowNull':![],'defaultValue':_0xee74('0x2')},'clid':{'type':Sequelize[_0xee74('0x3')]},'src':{'type':Sequelize[_0xee74('0x3')]},'dst':{'type':Sequelize[_0xee74('0x3')]},'dcontext':{'type':Sequelize[_0xee74('0x3')]},'channel':{'type':Sequelize[_0xee74('0x3')]},'dstchannel':{'type':Sequelize[_0xee74('0x3')]},'lastapp':{'type':Sequelize[_0xee74('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee74('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee74('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xee74('0x3')]},'uniqueid':{'type':Sequelize[_0xee74('0x3')]},'linkedid':{'type':Sequelize[_0xee74('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xee74('0x3')]},'tag':{'type':Sequelize[_0xee74('0x3')]}}; \ No newline at end of file +var _0x7072=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x1332b2,_0x4591f9){var _0x51f700=function(_0x489f93){while(--_0x489f93){_0x1332b2['push'](_0x1332b2['shift']());}};_0x51f700(++_0x4591f9);}(_0x7072,0x138));var _0x2707=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x7072[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'calldate':{'type':Sequelize[_0x2707('0x1')],'allowNull':![],'defaultValue':_0x2707('0x2')},'clid':{'type':Sequelize[_0x2707('0x3')]},'src':{'type':Sequelize[_0x2707('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2707('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x2707('0x3')]},'lastdata':{'type':Sequelize[_0x2707('0x3')]},'duration':{'type':Sequelize[_0x2707('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2707('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2707('0x3')]},'amaflags':{'type':Sequelize[_0x2707('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2707('0x3')]},'userfield':{'type':Sequelize[_0x2707('0x3')]},'uniqueid':{'type':Sequelize[_0x2707('0x3')]},'linkedid':{'type':Sequelize[_0x2707('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2707('0x3')]},'tag':{'type':Sequelize[_0x2707('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 6ac7f3b..778505d 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 _0xb458=['reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Cdr','includeAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x47bca4,_0x1646ba){var _0x226326=function(_0x149841){while(--_0x149841){_0x47bca4['push'](_0x47bca4['shift']());}};_0x226326(++_0x1646ba);}(_0xb458,0x103));var _0x8b45=function(_0x1d2eff,_0x45286f){_0x1d2eff=_0x1d2eff-0x0;var _0x25e995=_0xb458[_0x1d2eff];return _0x25e995;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['Cdr'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x29')](_0x1ba2d4,_0x8b45('0x26'));_0xf21bd1['query']=_[_0x8b45('0x2f')](_0x461017[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7[_0x8b45('0x33')]=_['intersection'](_0xf21bd1['model'],qs[_0x8b45('0x34')](_0x461017[_0x8b45('0x30')][_0x8b45('0x34')]));_0x1733a7[_0x8b45('0x33')]=_0x1733a7[_0x8b45('0x33')][_0x8b45('0x35')]?_0x1733a7['attributes']:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x30')][_0x8b45('0x36')](_0x8b45('0x37'))){_0x1733a7['limit']=qs[_0x8b45('0x1c')](_0x461017[_0x8b45('0x30')][_0x8b45('0x1c')]);_0x1733a7['offset']=qs[_0x8b45('0x1a')](_0x461017[_0x8b45('0x30')][_0x8b45('0x1a')]);}_0x1733a7['order']=qs[_0x8b45('0x38')](_0x461017[_0x8b45('0x30')][_0x8b45('0x38')]);_0x1733a7[_0x8b45('0x39')]=qs['filters'](_[_0x8b45('0x3a')](_0x461017[_0x8b45('0x30')],_0xf21bd1[_0x8b45('0x31')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x30')][_0x8b45('0x3b')]){_0x1733a7[_0x8b45('0x39')]=_['merge'](_0x1733a7['where'],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x179f3b){if(_0x179f3b[_0x8b45('0x2c')]!==_0x8b45('0x3c')){var _0x23eb2e={};_0x23eb2e[_0x179f3b['name']]={'$like':'%'+_0x461017[_0x8b45('0x30')]['filter']+'%'};return _0x23eb2e;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3e')]);var _0x5fae26={'where':_0x1733a7[_0x8b45('0x39')]};return db[_0x8b45('0x3f')][_0x8b45('0x1d')](_0x5fae26)[_0x8b45('0x23')](function(_0x1e9d50){_0x339c73[_0x8b45('0x1d')]=_0x1e9d50;if(_0x461017[_0x8b45('0x30')][_0x8b45('0x40')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x3f')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x4eda71){_0x339c73[_0x8b45('0x41')]=_0x4eda71;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x42')](handleError(_0x234f62,null));};exports[_0x8b45('0x43')]=function(_0x454cbc,_0x2770bc){var _0x58e663={'raw':!![],'where':{'id':_0x454cbc['params']['id']}},_0x6fbca4={};_0x6fbca4['model']=_[_0x8b45('0x2f')](db[_0x8b45('0x3f')][_0x8b45('0x2a')]);_0x6fbca4['query']=_[_0x8b45('0x2f')](_0x454cbc['query']);_0x6fbca4[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x6fbca4[_0x8b45('0x2e')],_0x6fbca4[_0x8b45('0x30')]);_0x58e663[_0x8b45('0x33')]=_[_0x8b45('0x32')](_0x6fbca4['model'],qs[_0x8b45('0x34')](_0x454cbc[_0x8b45('0x30')][_0x8b45('0x34')]));_0x58e663[_0x8b45('0x33')]=_0x58e663[_0x8b45('0x33')][_0x8b45('0x35')]?_0x58e663[_0x8b45('0x33')]:_0x6fbca4[_0x8b45('0x2e')];if(_0x454cbc[_0x8b45('0x30')][_0x8b45('0x40')]){_0x58e663[_0x8b45('0x44')]=[{'all':!![]}];}_0x58e663=_[_0x8b45('0x3d')]({},_0x58e663,_0x454cbc[_0x8b45('0x3e')]);return db[_0x8b45('0x3f')][_0x8b45('0x45')](_0x58e663)[_0x8b45('0x23')](handleEntityNotFound(_0x2770bc,null))['then'](respondWithResult(_0x2770bc,null))['catch'](handleError(_0x2770bc,null));};exports['create']=function(_0x308b0d,_0x214e28){return db[_0x8b45('0x3f')][_0x8b45('0x46')](_0x308b0d[_0x8b45('0x47')],{})[_0x8b45('0x23')](respondWithResult(_0x214e28,0xc9))[_0x8b45('0x42')](handleError(_0x214e28,null));};exports[_0x8b45('0x22')]=function(_0x5e2a03,_0x102d01){if(_0x5e2a03['body']['id']){delete _0x5e2a03[_0x8b45('0x47')]['id'];}return db[_0x8b45('0x3f')][_0x8b45('0x45')]({'where':{'id':_0x5e2a03[_0x8b45('0x48')]['id']}})['then'](handleEntityNotFound(_0x102d01,null))[_0x8b45('0x23')](saveUpdates(_0x5e2a03[_0x8b45('0x47')],null))['then'](respondWithResult(_0x102d01,null))[_0x8b45('0x42')](handleError(_0x102d01,null));};exports[_0x8b45('0x24')]=function(_0x52970c,_0xceb596){return db[_0x8b45('0x3f')][_0x8b45('0x45')]({'where':{'id':_0x52970c[_0x8b45('0x48')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0xceb596,null))[_0x8b45('0x23')](removeEntity(_0xceb596,null))['catch'](handleError(_0xceb596,null));};exports['describe']=function(_0x3f7a16,_0x2a2e59){return db[_0x8b45('0x3f')]['describe']()[_0x8b45('0x23')](respondWithResult(_0x2a2e59,null))[_0x8b45('0x42')](handleError(_0x2a2e59,null));}; \ No newline at end of file +var _0x8085=['name','send','index','map','Cdr','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x375add,_0x3e2336){var _0x3d94df=function(_0xf8bfd5){while(--_0xf8bfd5){_0x375add['push'](_0x375add['shift']());}};_0x3d94df(++_0x3e2336);}(_0x8085,0x71));var _0x5808=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x8085[_0x59bcb1];return _0x4a737f;};'use strict';var emlformat=require(_0x5808('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5808('0x1'));var rp=require(_0x5808('0x2'));var moment=require(_0x5808('0x3'));var BPromise=require(_0x5808('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5808('0x5'));var sox=require(_0x5808('0x6'));var csv=require('to-csv');var ejs=require(_0x5808('0x7'));var fs=require('fs');var fs_extra=require(_0x5808('0x8'));var _=require(_0x5808('0x9'));var squel=require(_0x5808('0xa'));var crypto=require(_0x5808('0xb'));var jsforce=require(_0x5808('0xc'));var deskjs=require(_0x5808('0xd'));var toCsv=require(_0x5808('0xe'));var querystring=require(_0x5808('0xf'));var Papa=require(_0x5808('0x10'));var Redis=require(_0x5808('0x11'));var authService=require(_0x5808('0x12'));var qs=require(_0x5808('0x13'));var as=require(_0x5808('0x14'));var hardwareService=require(_0x5808('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5808('0x16'));var config=require(_0x5808('0x17'));var licenseUtil=require(_0x5808('0x18'));var db=require(_0x5808('0x19'))['db'];function respondWithStatusCode(_0xab4f46,_0x19be03){_0x19be03=_0x19be03||0xcc;return function(_0x10572d){if(_0x10572d){return _0xab4f46['sendStatus'](_0x19be03);}return _0xab4f46['status'](_0x19be03)[_0x5808('0x1a')]();};}function respondWithResult(_0x19252b,_0x3582d6){_0x3582d6=_0x3582d6||0xc8;return function(_0x3e7c09){if(_0x3e7c09){return _0x19252b[_0x5808('0x1b')](_0x3582d6)[_0x5808('0x1c')](_0x3e7c09);}};}function respondWithFilteredResult(_0x299b22,_0x2af9da){return function(_0x1dda8d){if(_0x1dda8d){var _0x46dd8a=typeof _0x2af9da[_0x5808('0x1d')]==='undefined'&&typeof _0x2af9da[_0x5808('0x1e')]==='undefined';var _0x406e65=_0x1dda8d[_0x5808('0x1f')];var _0x3bf0ee=_0x46dd8a?0x0:_0x2af9da['offset'];var _0x9e58d4=_0x46dd8a?_0x1dda8d[_0x5808('0x1f')]:_0x2af9da['offset']+_0x2af9da['limit'];var _0x3c7c02;if(_0x9e58d4>=_0x406e65){_0x9e58d4=_0x406e65;_0x3c7c02=0xc8;}else{_0x3c7c02=0xce;}_0x299b22['status'](_0x3c7c02);return _0x299b22[_0x5808('0x20')](_0x5808('0x21'),_0x3bf0ee+'-'+_0x9e58d4+'/'+_0x406e65)[_0x5808('0x1c')](_0x1dda8d);}return null;};}function patchUpdates(_0xaac16a){return function(_0x578d70){try{jsonpatch['apply'](_0x578d70,_0xaac16a,!![]);}catch(_0xe82ad0){return BPromise[_0x5808('0x22')](_0xe82ad0);}return _0x578d70[_0x5808('0x23')]();};}function saveUpdates(_0x39bca3,_0x409337){return function(_0x33b583){if(_0x33b583){return _0x33b583[_0x5808('0x24')](_0x39bca3)[_0x5808('0x25')](function(_0x3a575e){return _0x3a575e;});}return null;};}function removeEntity(_0x4e1dfc,_0x5b5175){return function(_0x130590){if(_0x130590){return _0x130590[_0x5808('0x26')]()['then'](function(){_0x4e1dfc['status'](0xcc)[_0x5808('0x1a')]();});}};}function handleEntityNotFound(_0x467500,_0x1dddbd){return function(_0x4a4d05){if(!_0x4a4d05){_0x467500['sendStatus'](0x194);}return _0x4a4d05;};}function handleError(_0x24ee0f,_0x2c2cb5){_0x2c2cb5=_0x2c2cb5||0x1f4;return function(_0x27c991){logger[_0x5808('0x27')](_0x27c991[_0x5808('0x28')]);if(_0x27c991['name']){delete _0x27c991[_0x5808('0x29')];}_0x24ee0f[_0x5808('0x1b')](_0x2c2cb5)[_0x5808('0x2a')](_0x27c991);};}exports[_0x5808('0x2b')]=function(_0x28c1eb,_0x19ac63){var _0x1117ac={},_0x4ad6d8={},_0x560e83={'count':0x0,'rows':[]};var _0x4f6342=_[_0x5808('0x2c')](db[_0x5808('0x2d')]['rawAttributes'],function(_0x3faa07){return{'name':_0x3faa07[_0x5808('0x2e')],'type':_0x3faa07[_0x5808('0x2f')][_0x5808('0x30')]};});_0x4ad6d8[_0x5808('0x31')]=_[_0x5808('0x2c')](_0x4f6342,'name');_0x4ad6d8[_0x5808('0x32')]=_[_0x5808('0x33')](_0x28c1eb[_0x5808('0x32')]);_0x4ad6d8['filters']=_['intersection'](_0x4ad6d8[_0x5808('0x31')],_0x4ad6d8['query']);_0x1117ac[_0x5808('0x34')]=_[_0x5808('0x35')](_0x4ad6d8['model'],qs[_0x5808('0x36')](_0x28c1eb[_0x5808('0x32')]['fields']));_0x1117ac['attributes']=_0x1117ac[_0x5808('0x34')]['length']?_0x1117ac[_0x5808('0x34')]:_0x4ad6d8['model'];if(!_0x28c1eb[_0x5808('0x32')][_0x5808('0x37')](_0x5808('0x38'))){_0x1117ac['limit']=qs[_0x5808('0x1e')](_0x28c1eb['query'][_0x5808('0x1e')]);_0x1117ac['offset']=qs['offset'](_0x28c1eb[_0x5808('0x32')][_0x5808('0x1d')]);}_0x1117ac[_0x5808('0x39')]=qs['sort'](_0x28c1eb['query'][_0x5808('0x3a')]);_0x1117ac[_0x5808('0x3b')]=qs['filters'](_[_0x5808('0x3c')](_0x28c1eb[_0x5808('0x32')],_0x4ad6d8[_0x5808('0x3d')]),_0x4f6342);if(_0x28c1eb['query'][_0x5808('0x3e')]){_0x1117ac[_0x5808('0x3b')]=_[_0x5808('0x3f')](_0x1117ac['where'],{'$or':_[_0x5808('0x2c')](_0x4f6342,function(_0x12a045){if(_0x12a045['type']!=='VIRTUAL'){var _0x477278={};_0x477278[_0x12a045['name']]={'$like':'%'+_0x28c1eb[_0x5808('0x32')][_0x5808('0x3e')]+'%'};return _0x477278;}})});}_0x1117ac=_[_0x5808('0x3f')]({},_0x1117ac,_0x28c1eb[_0x5808('0x40')]);var _0x21fc36={'where':_0x1117ac['where']};return db['Cdr'][_0x5808('0x1f')](_0x21fc36)[_0x5808('0x25')](function(_0x402b4e){_0x560e83['count']=_0x402b4e;if(_0x28c1eb[_0x5808('0x32')][_0x5808('0x41')]){_0x1117ac[_0x5808('0x42')]=[{'all':!![]}];}return db[_0x5808('0x2d')][_0x5808('0x43')](_0x1117ac);})['then'](function(_0x1130c8){_0x560e83[_0x5808('0x44')]=_0x1130c8;return _0x560e83;})[_0x5808('0x25')](respondWithFilteredResult(_0x19ac63,_0x1117ac))['catch'](handleError(_0x19ac63,null));};exports[_0x5808('0x45')]=function(_0x287e07,_0xc62608){var _0x5e1230={'raw':!![],'where':{'id':_0x287e07[_0x5808('0x46')]['id']}},_0x5dcb50={};_0x5dcb50[_0x5808('0x31')]=_[_0x5808('0x33')](db[_0x5808('0x2d')][_0x5808('0x47')]);_0x5dcb50[_0x5808('0x32')]=_[_0x5808('0x33')](_0x287e07[_0x5808('0x32')]);_0x5dcb50[_0x5808('0x3d')]=_[_0x5808('0x35')](_0x5dcb50[_0x5808('0x31')],_0x5dcb50[_0x5808('0x32')]);_0x5e1230[_0x5808('0x34')]=_['intersection'](_0x5dcb50['model'],qs[_0x5808('0x36')](_0x287e07[_0x5808('0x32')][_0x5808('0x36')]));_0x5e1230[_0x5808('0x34')]=_0x5e1230[_0x5808('0x34')][_0x5808('0x48')]?_0x5e1230[_0x5808('0x34')]:_0x5dcb50['model'];if(_0x287e07[_0x5808('0x32')]['includeAll']){_0x5e1230[_0x5808('0x42')]=[{'all':!![]}];}_0x5e1230=_['merge']({},_0x5e1230,_0x287e07[_0x5808('0x40')]);return db['Cdr']['find'](_0x5e1230)['then'](handleEntityNotFound(_0xc62608,null))[_0x5808('0x25')](respondWithResult(_0xc62608,null))[_0x5808('0x49')](handleError(_0xc62608,null));};exports['create']=function(_0x46c8ed,_0x4568d0){return db[_0x5808('0x2d')]['create'](_0x46c8ed[_0x5808('0x4a')],{})['then'](respondWithResult(_0x4568d0,0xc9))[_0x5808('0x49')](handleError(_0x4568d0,null));};exports[_0x5808('0x24')]=function(_0x13fe11,_0x5cc977){if(_0x13fe11[_0x5808('0x4a')]['id']){delete _0x13fe11[_0x5808('0x4a')]['id'];}return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x13fe11['params']['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x5cc977,null))[_0x5808('0x25')](saveUpdates(_0x13fe11[_0x5808('0x4a')],null))[_0x5808('0x25')](respondWithResult(_0x5cc977,null))[_0x5808('0x49')](handleError(_0x5cc977,null));};exports[_0x5808('0x26')]=function(_0x5572f3,_0x23d2fe){return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x5572f3[_0x5808('0x46')]['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x23d2fe,null))['then'](removeEntity(_0x23d2fe,null))[_0x5808('0x49')](handleError(_0x23d2fe,null));};exports[_0x5808('0x4c')]=function(_0xc2c5d7,_0x44ff0a){return db[_0x5808('0x2d')][_0x5808('0x4c')]()['then'](respondWithResult(_0x44ff0a,null))[_0x5808('0x49')](handleError(_0x44ff0a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index cbbf76b..0e089c5 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x754035,_0x2fc05e){var _0x5d0368=function(_0x3b9a55){while(--_0x3b9a55){_0x754035['push'](_0x754035['shift']());}};_0x5d0368(++_0x2fc05e);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed92a,_0x24f8dc){_0x1ed92a=_0x1ed92a-0x0;var _0x201d2d=_0x7a54[_0x1ed92a];return _0x201d2d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x23dc18,_0x1e729a){var _0x248c55=function(_0x380498){while(--_0x380498){_0x23dc18['push'](_0x23dc18['shift']());}};_0x248c55(++_0x1e729a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 55f8550..d875be8 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 _0x8085=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s'];(function(_0x406c33,_0x167e69){var _0x446466=function(_0xa74637){while(--_0xa74637){_0x406c33['push'](_0x406c33['shift']());}};_0x446466(++_0x167e69);}(_0x8085,0x14e));var _0x5808=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0x8085[_0x374ada];return _0x449ed8;};'use strict';var _=require(_0x5808('0x0'));var util=require(_0x5808('0x1'));var moment=require(_0x5808('0x2'));var BPromise=require(_0x5808('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5808('0x4'))['db'];var utils=require(_0x5808('0x5'));var logger=require(_0x5808('0x6'))(_0x5808('0x7'));var config=require(_0x5808('0x8'));var jayson=require(_0x5808('0x9'));var client=jayson[_0x5808('0xa')][_0x5808('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe5972e,_0x234995,_0x506e06){return new BPromise(function(_0x2722ee,_0x3f940f){return client[_0x5808('0xc')](_0xe5972e,_0x506e06)[_0x5808('0xd')](function(_0x16f682){logger[_0x5808('0xe')](_0x5808('0xf'),_0x234995,_0x5808('0x10'));logger[_0x5808('0x11')](_0x5808('0x12'),_0x234995,'request\x20sent',JSON[_0x5808('0x13')](_0x16f682));if(_0x16f682['error']){if(_0x16f682[_0x5808('0x14')][_0x5808('0x15')]===0x1f4){logger[_0x5808('0x14')](_0x5808('0xf'),_0x234995,_0x16f682['error'][_0x5808('0x16')]);return _0x3f940f(_0x16f682[_0x5808('0x14')][_0x5808('0x16')]);}logger[_0x5808('0x14')](_0x5808('0xf'),_0x234995,_0x16f682[_0x5808('0x14')][_0x5808('0x16')]);return _0x2722ee(_0x16f682[_0x5808('0x14')][_0x5808('0x16')]);}else{logger[_0x5808('0xe')](_0x5808('0xf'),_0x234995,_0x5808('0x10'));_0x2722ee(_0x16f682[_0x5808('0x17')][_0x5808('0x16')]);}})[_0x5808('0x18')](function(_0x2a78cd){logger['error'](_0x5808('0xf'),_0x234995,_0x2a78cd);_0x3f940f(_0x2a78cd);});});} \ No newline at end of file +var _0x4fb0=['client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5610b7,_0x5095be){var _0x1c0eef=function(_0x1bd91a){while(--_0x1bd91a){_0x5610b7['push'](_0x5610b7['shift']());}};_0x1c0eef(++_0x5095be);}(_0x4fb0,0x1f2));var _0x04fb=function(_0x2cdaaa,_0x25d1a9){_0x2cdaaa=_0x2cdaaa-0x0;var _0x2822d4=_0x4fb0[_0x2cdaaa];return _0x2822d4;};'use strict';var _=require(_0x04fb('0x0'));var util=require(_0x04fb('0x1'));var moment=require(_0x04fb('0x2'));var BPromise=require(_0x04fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x04fb('0x5'));var logger=require(_0x04fb('0x6'))('rpc');var config=require(_0x04fb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x04fb('0x8')][_0x04fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d250d,_0x20d214,_0x3dd0a5){return new BPromise(function(_0x6d0890,_0x2b7b20){return client[_0x04fb('0xa')](_0x5d250d,_0x3dd0a5)[_0x04fb('0xb')](function(_0x1894f){logger[_0x04fb('0xc')](_0x04fb('0xd'),_0x20d214,_0x04fb('0xe'));logger[_0x04fb('0xf')](_0x04fb('0x10'),_0x20d214,_0x04fb('0xe'),JSON[_0x04fb('0x11')](_0x1894f));if(_0x1894f[_0x04fb('0x12')]){if(_0x1894f['error'][_0x04fb('0x13')]===0x1f4){logger[_0x04fb('0x12')](_0x04fb('0xd'),_0x20d214,_0x1894f['error'][_0x04fb('0x14')]);return _0x2b7b20(_0x1894f[_0x04fb('0x12')]['message']);}logger['error'](_0x04fb('0xd'),_0x20d214,_0x1894f['error']['message']);return _0x6d0890(_0x1894f[_0x04fb('0x12')][_0x04fb('0x14')]);}else{logger[_0x04fb('0xc')](_0x04fb('0xd'),_0x20d214,_0x04fb('0xe'));_0x6d0890(_0x1894f[_0x04fb('0x15')][_0x04fb('0x14')]);}})[_0x04fb('0x16')](function(_0x44804f){logger[_0x04fb('0x12')]('Cdr,\x20%s,\x20%s',_0x20d214,_0x44804f);_0x2b7b20(_0x44804f);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 48e143e..a602672 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(_0x44799d,_0x26c23a){var _0x4f4a20=function(_0x298a71){while(--_0x298a71){_0x44799d['push'](_0x44799d['shift']());}};_0x4f4a20(++_0x26c23a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x427572,_0x1d89f2){var _0x585590=function(_0x1699da){while(--_0x1699da){_0x427572['push'](_0x427572['shift']());}};_0x585590(++_0x1d89f2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 060ce19..7768580 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 _0xd07d=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x17d6f2,_0x32a0ff){var _0x8b6ebf=function(_0x579652){while(--_0x579652){_0x17d6f2['push'](_0x17d6f2['shift']());}};_0x8b6ebf(++_0x32a0ff);}(_0xd07d,0x1f1));var _0xdd07=function(_0x4471ff,_0x4bb7de){_0x4471ff=_0x4471ff-0x0;var _0xe723ca=_0xd07d[_0x4471ff];return _0xe723ca;};'use strict';var Sequelize=require(_0xdd07('0x0'));module[_0xdd07('0x1')]={'priority':{'type':Sequelize[_0xdd07('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdd07('0x3')],'allowNull':![],'defaultValue':_0xdd07('0x4')},'appdata':{'type':Sequelize[_0xdd07('0x5')]()},'description':{'type':Sequelize[_0xdd07('0x3')]},'interval':{'type':Sequelize[_0xdd07('0x3')],'defaultValue':_0xdd07('0x6')}}; \ No newline at end of file +var _0x55fe=['STRING','noop','TEXT','*,*,*,*','exports','INTEGER'];(function(_0x558c2e,_0x30a116){var _0x21c0c7=function(_0x1efd67){while(--_0x1efd67){_0x558c2e['push'](_0x558c2e['shift']());}};_0x21c0c7(++_0x30a116);}(_0x55fe,0x196));var _0xe55f=function(_0x4af0d1,_0x162b1a){_0x4af0d1=_0x4af0d1-0x0;var _0x2f6f4c=_0x55fe[_0x4af0d1];return _0x2f6f4c;};'use strict';var Sequelize=require('sequelize');module[_0xe55f('0x0')]={'priority':{'type':Sequelize[_0xe55f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe55f('0x2')],'allowNull':![],'defaultValue':_0xe55f('0x3')},'appdata':{'type':Sequelize[_0xe55f('0x4')]()},'description':{'type':Sequelize[_0xe55f('0x2')]},'interval':{'type':Sequelize[_0xe55f('0x2')],'defaultValue':_0xe55f('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 7b91eb0..7f4b5e3 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 _0x9bc3=['merge','options','find','catch','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','reject','save','update','then','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include'];(function(_0x22fd75,_0x2fcd94){var _0x1219dd=function(_0x3e25a6){while(--_0x3e25a6){_0x22fd75['push'](_0x22fd75['shift']());}};_0x1219dd(++_0x2fcd94);}(_0x9bc3,0x137));var _0x39bc=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x9bc3[_0x39cf70];return _0x580424;};'use strict';var emlformat=require(_0x39bc('0x0'));var rimraf=require(_0x39bc('0x1'));var zipdir=require(_0x39bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39bc('0x3'));var moment=require(_0x39bc('0x4'));var BPromise=require(_0x39bc('0x5'));var Mustache=require(_0x39bc('0x6'));var util=require('util');var path=require(_0x39bc('0x7'));var sox=require(_0x39bc('0x8'));var csv=require(_0x39bc('0x9'));var ejs=require(_0x39bc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39bc('0xb'));var squel=require(_0x39bc('0xc'));var crypto=require(_0x39bc('0xd'));var jsforce=require(_0x39bc('0xe'));var deskjs=require(_0x39bc('0xf'));var toCsv=require(_0x39bc('0x9'));var querystring=require(_0x39bc('0x10'));var Papa=require(_0x39bc('0x11'));var Redis=require('ioredis');var authService=require(_0x39bc('0x12'));var qs=require(_0x39bc('0x13'));var as=require(_0x39bc('0x14'));var hardwareService=require(_0x39bc('0x15'));var logger=require(_0x39bc('0x16'))(_0x39bc('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x39bc('0x18'));var db=require(_0x39bc('0x19'))['db'];function respondWithStatusCode(_0x4fa359,_0x32ebbb){_0x32ebbb=_0x32ebbb||0xcc;return function(_0x45f4c2){if(_0x45f4c2){return _0x4fa359[_0x39bc('0x1a')](_0x32ebbb);}return _0x4fa359['status'](_0x32ebbb)['end']();};}function respondWithResult(_0x4df4a8,_0x1aead8){_0x1aead8=_0x1aead8||0xc8;return function(_0x5296a2){if(_0x5296a2){return _0x4df4a8['status'](_0x1aead8)[_0x39bc('0x1b')](_0x5296a2);}};}function respondWithFilteredResult(_0xd97283,_0x5c63df){return function(_0x546753){if(_0x546753){var _0x413400=typeof _0x5c63df[_0x39bc('0x1c')]===_0x39bc('0x1d')&&typeof _0x5c63df['limit']===_0x39bc('0x1d');var _0x365685=_0x546753[_0x39bc('0x1e')];var _0x1e121f=_0x413400?0x0:_0x5c63df[_0x39bc('0x1c')];var _0x3f13c8=_0x413400?_0x546753[_0x39bc('0x1e')]:_0x5c63df['offset']+_0x5c63df[_0x39bc('0x1f')];var _0x2ba5a2;if(_0x3f13c8>=_0x365685){_0x3f13c8=_0x365685;_0x2ba5a2=0xc8;}else{_0x2ba5a2=0xce;}_0xd97283[_0x39bc('0x20')](_0x2ba5a2);return _0xd97283[_0x39bc('0x21')]('Content-Range',_0x1e121f+'-'+_0x3f13c8+'/'+_0x365685)[_0x39bc('0x1b')](_0x546753);}return null;};}function patchUpdates(_0x4ad3ef){return function(_0x3af32d){try{jsonpatch['apply'](_0x3af32d,_0x4ad3ef,!![]);}catch(_0x3a68dd){return BPromise[_0x39bc('0x22')](_0x3a68dd);}return _0x3af32d[_0x39bc('0x23')]();};}function saveUpdates(_0x473c1e,_0x364873){return function(_0x5e3d5e){if(_0x5e3d5e){return _0x5e3d5e[_0x39bc('0x24')](_0x473c1e)[_0x39bc('0x25')](function(_0x553765){return _0x553765;});}return null;};}function removeEntity(_0x1044a1,_0x147923){return function(_0x4fc150){if(_0x4fc150){return _0x4fc150['destroy']()[_0x39bc('0x25')](function(){_0x1044a1[_0x39bc('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8ff9f,_0x308803){return function(_0x5b6c19){if(!_0x5b6c19){_0x8ff9f['sendStatus'](0x194);}return _0x5b6c19;};}function handleError(_0x57199d,_0x2f1243){_0x2f1243=_0x2f1243||0x1f4;return function(_0x21d5cf){logger[_0x39bc('0x26')](_0x21d5cf[_0x39bc('0x27')]);if(_0x21d5cf[_0x39bc('0x28')]){delete _0x21d5cf[_0x39bc('0x28')];}_0x57199d[_0x39bc('0x20')](_0x2f1243)[_0x39bc('0x29')](_0x21d5cf);};}exports[_0x39bc('0x2a')]=function(_0x1637e8,_0x38194f){var _0x2f732b={'raw':!![],'where':{'id':_0x1637e8[_0x39bc('0x2b')]['id']}},_0x2a13bc={};_0x2a13bc[_0x39bc('0x2c')]=_[_0x39bc('0x2d')](db[_0x39bc('0x2e')][_0x39bc('0x2f')]);_0x2a13bc[_0x39bc('0x30')]=_[_0x39bc('0x2d')](_0x1637e8[_0x39bc('0x30')]);_0x2a13bc[_0x39bc('0x31')]=_['intersection'](_0x2a13bc[_0x39bc('0x2c')],_0x2a13bc['query']);_0x2f732b[_0x39bc('0x32')]=_[_0x39bc('0x33')](_0x2a13bc[_0x39bc('0x2c')],qs[_0x39bc('0x34')](_0x1637e8['query'][_0x39bc('0x34')]));_0x2f732b[_0x39bc('0x32')]=_0x2f732b[_0x39bc('0x32')]['length']?_0x2f732b[_0x39bc('0x32')]:_0x2a13bc['model'];if(_0x1637e8[_0x39bc('0x30')][_0x39bc('0x35')]){_0x2f732b[_0x39bc('0x36')]=[{'all':!![]}];}_0x2f732b=_[_0x39bc('0x37')]({},_0x2f732b,_0x1637e8[_0x39bc('0x38')]);return db[_0x39bc('0x2e')][_0x39bc('0x39')](_0x2f732b)[_0x39bc('0x25')](handleEntityNotFound(_0x38194f,null))[_0x39bc('0x25')](respondWithResult(_0x38194f,null))[_0x39bc('0x3a')](handleError(_0x38194f,null));};exports[_0x39bc('0x24')]=function(_0x1edb31,_0x40a967){if(_0x1edb31[_0x39bc('0x3b')]['id']){delete _0x1edb31[_0x39bc('0x3b')]['id'];}return db[_0x39bc('0x2e')][_0x39bc('0x39')]({'where':{'id':_0x1edb31['params']['id']}})['then'](handleEntityNotFound(_0x40a967,null))[_0x39bc('0x25')](saveUpdates(_0x1edb31[_0x39bc('0x3b')],null))['then'](respondWithResult(_0x40a967,null))[_0x39bc('0x3a')](handleError(_0x40a967,null));};exports[_0x39bc('0x3c')]=function(_0x5a5fcf,_0x1d0e59){return db[_0x39bc('0x2e')][_0x39bc('0x39')]({'where':{'id':_0x5a5fcf['params']['id']}})['then'](handleEntityNotFound(_0x1d0e59,null))['then'](removeEntity(_0x1d0e59,null))[_0x39bc('0x3a')](handleError(_0x1d0e59,null));}; \ No newline at end of file +var _0x81d5=['rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','params','model','keys','ChatApplication'];(function(_0x341860,_0x59ee1b){var _0x1fafb9=function(_0x42701f){while(--_0x42701f){_0x341860['push'](_0x341860['shift']());}};_0x1fafb9(++_0x59ee1b);}(_0x81d5,0x1ab));var _0x581d=function(_0x18994f,_0x4fc7ab){_0x18994f=_0x18994f-0x0;var _0x2aecb0=_0x81d5[_0x18994f];return _0x2aecb0;};'use strict';var emlformat=require(_0x581d('0x0'));var rimraf=require(_0x581d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x581d('0x2'));var rp=require(_0x581d('0x3'));var moment=require(_0x581d('0x4'));var BPromise=require(_0x581d('0x5'));var Mustache=require(_0x581d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x581d('0x7'));var csv=require(_0x581d('0x8'));var ejs=require(_0x581d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x581d('0xa'));var squel=require(_0x581d('0xb'));var crypto=require(_0x581d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x581d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x581d('0xe'));var authService=require(_0x581d('0xf'));var qs=require(_0x581d('0x10'));var as=require(_0x581d('0x11'));var hardwareService=require(_0x581d('0x12'));var logger=require('../../config/logger')(_0x581d('0x13'));var utils=require(_0x581d('0x14'));var config=require(_0x581d('0x15'));var licenseUtil=require(_0x581d('0x16'));var db=require(_0x581d('0x17'))['db'];function respondWithStatusCode(_0x271bd1,_0x1fb6ed){_0x1fb6ed=_0x1fb6ed||0xcc;return function(_0x3329cc){if(_0x3329cc){return _0x271bd1[_0x581d('0x18')](_0x1fb6ed);}return _0x271bd1[_0x581d('0x19')](_0x1fb6ed)['end']();};}function respondWithResult(_0x338c88,_0xfab29f){_0xfab29f=_0xfab29f||0xc8;return function(_0x51a035){if(_0x51a035){return _0x338c88['status'](_0xfab29f)['json'](_0x51a035);}};}function respondWithFilteredResult(_0x4deffa,_0x110e13){return function(_0x550365){if(_0x550365){var _0x1d609f=typeof _0x110e13[_0x581d('0x1a')]==='undefined'&&typeof _0x110e13[_0x581d('0x1b')]==='undefined';var _0x3172f6=_0x550365[_0x581d('0x1c')];var _0x1e059d=_0x1d609f?0x0:_0x110e13[_0x581d('0x1a')];var _0x1f790f=_0x1d609f?_0x550365[_0x581d('0x1c')]:_0x110e13[_0x581d('0x1a')]+_0x110e13['limit'];var _0x2be45b;if(_0x1f790f>=_0x3172f6){_0x1f790f=_0x3172f6;_0x2be45b=0xc8;}else{_0x2be45b=0xce;}_0x4deffa[_0x581d('0x19')](_0x2be45b);return _0x4deffa[_0x581d('0x1d')](_0x581d('0x1e'),_0x1e059d+'-'+_0x1f790f+'/'+_0x3172f6)[_0x581d('0x1f')](_0x550365);}return null;};}function patchUpdates(_0x2a2aba){return function(_0x4635a8){try{jsonpatch[_0x581d('0x20')](_0x4635a8,_0x2a2aba,!![]);}catch(_0x468543){return BPromise[_0x581d('0x21')](_0x468543);}return _0x4635a8[_0x581d('0x22')]();};}function saveUpdates(_0xf74d2b,_0x5add13){return function(_0xb96c3d){if(_0xb96c3d){return _0xb96c3d[_0x581d('0x23')](_0xf74d2b)[_0x581d('0x24')](function(_0x2a4cd9){return _0x2a4cd9;});}return null;};}function removeEntity(_0x2addd8,_0x4f7420){return function(_0x36cc8a){if(_0x36cc8a){return _0x36cc8a[_0x581d('0x25')]()['then'](function(){_0x2addd8[_0x581d('0x19')](0xcc)[_0x581d('0x26')]();});}};}function handleEntityNotFound(_0x2c8fdb,_0x5a3fd7){return function(_0x190545){if(!_0x190545){_0x2c8fdb[_0x581d('0x18')](0x194);}return _0x190545;};}function handleError(_0x146323,_0xc270bc){_0xc270bc=_0xc270bc||0x1f4;return function(_0x38f213){logger[_0x581d('0x27')](_0x38f213['stack']);if(_0x38f213[_0x581d('0x28')]){delete _0x38f213[_0x581d('0x28')];}_0x146323[_0x581d('0x19')](_0xc270bc)['send'](_0x38f213);};}exports['show']=function(_0x504f71,_0x489682){var _0x355efe={'raw':!![],'where':{'id':_0x504f71[_0x581d('0x29')]['id']}},_0x266a2b={};_0x266a2b[_0x581d('0x2a')]=_[_0x581d('0x2b')](db[_0x581d('0x2c')][_0x581d('0x2d')]);_0x266a2b[_0x581d('0x2e')]=_[_0x581d('0x2b')](_0x504f71[_0x581d('0x2e')]);_0x266a2b[_0x581d('0x2f')]=_['intersection'](_0x266a2b[_0x581d('0x2a')],_0x266a2b['query']);_0x355efe[_0x581d('0x30')]=_[_0x581d('0x31')](_0x266a2b[_0x581d('0x2a')],qs[_0x581d('0x32')](_0x504f71[_0x581d('0x2e')][_0x581d('0x32')]));_0x355efe['attributes']=_0x355efe[_0x581d('0x30')][_0x581d('0x33')]?_0x355efe['attributes']:_0x266a2b['model'];if(_0x504f71['query'][_0x581d('0x34')]){_0x355efe[_0x581d('0x35')]=[{'all':!![]}];}_0x355efe=_[_0x581d('0x36')]({},_0x355efe,_0x504f71[_0x581d('0x37')]);return db[_0x581d('0x2c')][_0x581d('0x38')](_0x355efe)[_0x581d('0x24')](handleEntityNotFound(_0x489682,null))['then'](respondWithResult(_0x489682,null))[_0x581d('0x39')](handleError(_0x489682,null));};exports[_0x581d('0x23')]=function(_0x55d184,_0x389e97){if(_0x55d184[_0x581d('0x3a')]['id']){delete _0x55d184[_0x581d('0x3a')]['id'];}return db[_0x581d('0x2c')][_0x581d('0x38')]({'where':{'id':_0x55d184['params']['id']}})[_0x581d('0x24')](handleEntityNotFound(_0x389e97,null))['then'](saveUpdates(_0x55d184[_0x581d('0x3a')],null))[_0x581d('0x24')](respondWithResult(_0x389e97,null))['catch'](handleError(_0x389e97,null));};exports['destroy']=function(_0x5eb9eb,_0x59fc1e){return db[_0x581d('0x2c')]['find']({'where':{'id':_0x5eb9eb[_0x581d('0x29')]['id']}})['then'](handleEntityNotFound(_0x59fc1e,null))[_0x581d('0x24')](removeEntity(_0x59fc1e,null))[_0x581d('0x39')](handleError(_0x59fc1e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 1b2509e..a232ab8 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 _0x3620=['request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0x3620,0xcf));var _0x0362=function(_0x54e8c5,_0x3027d1){_0x54e8c5=_0x54e8c5-0x0;var _0x2321e0=_0x3620[_0x54e8c5];return _0x2321e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0362('0x0'));var moment=require(_0x0362('0x1'));var BPromise=require(_0x0362('0x2'));var rp=require(_0x0362('0x3'));var fs=require('fs');var path=require(_0x0362('0x4'));var rimraf=require('rimraf');var config=require(_0x0362('0x5'));var attributes=require(_0x0362('0x6'));module[_0x0362('0x7')]=function(_0x396429,_0x1cb18d){return _0x396429[_0x0362('0x8')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0362('0x9')});}; \ No newline at end of file +var _0xf25a=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0xf25a,0x195));var _0xaf25=function(_0xbc0acd,_0x54cb30){_0xbc0acd=_0xbc0acd-0x0;var _0x2d563f=_0xf25a[_0xbc0acd];return _0x2d563f;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var logger=require(_0xaf25('0x2'))('api');var moment=require(_0xaf25('0x3'));var BPromise=require(_0xaf25('0x4'));var rp=require(_0xaf25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf25('0x6'));var config=require(_0xaf25('0x7'));var attributes=require(_0xaf25('0x8'));module['exports']=function(_0x49281b,_0x30eaae){return _0x49281b['define']('ChatApplication',attributes,{'tableName':_0xaf25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf25('0xa'),'collate':_0xaf25('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 34e5831..68c2ab9 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 _0x8e4a=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3d9afb,_0x1aa762){var _0x38ca17=function(_0x2a0ee3){while(--_0x2a0ee3){_0x3d9afb['push'](_0x3d9afb['shift']());}};_0x38ca17(++_0x1aa762);}(_0x8e4a,0x153));var _0xa8e4=function(_0x33d24b,_0x7e097c){_0x33d24b=_0x33d24b-0x0;var _0xb868a0=_0x8e4a[_0x33d24b];return _0xb868a0;};'use strict';var _=require('lodash');var util=require(_0xa8e4('0x0'));var moment=require(_0xa8e4('0x1'));var BPromise=require(_0xa8e4('0x2'));var rs=require(_0xa8e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8e4('0x4'))['db'];var utils=require(_0xa8e4('0x5'));var logger=require(_0xa8e4('0x6'))(_0xa8e4('0x7'));var config=require('../../config/environment');var jayson=require(_0xa8e4('0x8'));var client=jayson[_0xa8e4('0x9')][_0xa8e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5052a3,_0x82c926,_0x374f6e){return new BPromise(function(_0x447a7e,_0x5bffc4){return client[_0xa8e4('0xb')](_0x5052a3,_0x374f6e)[_0xa8e4('0xc')](function(_0xfd46b8){logger[_0xa8e4('0xd')](_0xa8e4('0xe'),_0x82c926,_0xa8e4('0xf'));logger[_0xa8e4('0x10')](_0xa8e4('0x11'),_0x82c926,_0xa8e4('0xf'),JSON[_0xa8e4('0x12')](_0xfd46b8));if(_0xfd46b8['error']){if(_0xfd46b8[_0xa8e4('0x13')][_0xa8e4('0x14')]===0x1f4){logger[_0xa8e4('0x13')](_0xa8e4('0xe'),_0x82c926,_0xfd46b8[_0xa8e4('0x13')]['message']);return _0x5bffc4(_0xfd46b8[_0xa8e4('0x13')][_0xa8e4('0x15')]);}logger[_0xa8e4('0x13')](_0xa8e4('0xe'),_0x82c926,_0xfd46b8[_0xa8e4('0x13')][_0xa8e4('0x15')]);return _0x447a7e(_0xfd46b8['error'][_0xa8e4('0x15')]);}else{logger['info'](_0xa8e4('0xe'),_0x82c926,_0xa8e4('0xf'));_0x447a7e(_0xfd46b8[_0xa8e4('0x16')][_0xa8e4('0x15')]);}})['catch'](function(_0x5f5dd6){logger[_0xa8e4('0x13')](_0xa8e4('0xe'),_0x82c926,_0x5f5dd6);_0x5bffc4(_0x5f5dd6);});});} \ No newline at end of file +var _0x7825=['request','then','info','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x44b827,_0x1bb1aa){var _0x527342=function(_0x481338){while(--_0x481338){_0x44b827['push'](_0x44b827['shift']());}};_0x527342(++_0x1bb1aa);}(_0x7825,0x165));var _0x5782=function(_0x492445,_0x1454f9){_0x492445=_0x492445-0x0;var _0x34ca20=_0x7825[_0x492445];return _0x34ca20;};'use strict';var _=require('lodash');var util=require(_0x5782('0x0'));var moment=require(_0x5782('0x1'));var BPromise=require(_0x5782('0x2'));var rs=require(_0x5782('0x3'));var fs=require('fs');var Redis=require(_0x5782('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5782('0x5'));var logger=require(_0x5782('0x6'))(_0x5782('0x7'));var config=require(_0x5782('0x8'));var jayson=require(_0x5782('0x9'));var client=jayson[_0x5782('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27e23a,_0xb8da92,_0x393f53){return new BPromise(function(_0x494c42,_0x4b6de9){return client[_0x5782('0xb')](_0x27e23a,_0x393f53)[_0x5782('0xc')](function(_0x7bfff1){logger[_0x5782('0xd')]('ChatApplication,\x20%s,\x20%s',_0xb8da92,'request\x20sent');logger['debug'](_0x5782('0xe'),_0xb8da92,_0x5782('0xf'),JSON[_0x5782('0x10')](_0x7bfff1));if(_0x7bfff1['error']){if(_0x7bfff1['error'][_0x5782('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0xb8da92,_0x7bfff1['error']['message']);return _0x4b6de9(_0x7bfff1[_0x5782('0x12')]['message']);}logger[_0x5782('0x12')](_0x5782('0x13'),_0xb8da92,_0x7bfff1[_0x5782('0x12')][_0x5782('0x14')]);return _0x494c42(_0x7bfff1[_0x5782('0x12')][_0x5782('0x14')]);}else{logger[_0x5782('0xd')](_0x5782('0x13'),_0xb8da92,_0x5782('0xf'));_0x494c42(_0x7bfff1[_0x5782('0x15')][_0x5782('0x14')]);}})[_0x5782('0x16')](function(_0x4aa9b6){logger['error'](_0x5782('0x13'),_0xb8da92,_0x4aa9b6);_0x4b6de9(_0x4aa9b6);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index fe2fd45..efe6f02 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 _0xece0=['put','isAuthenticated','update','destroy','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','show'];(function(_0x298a1d,_0x7c15c1){var _0x69b15a=function(_0x51c910){while(--_0x51c910){_0x298a1d['push'](_0x298a1d['shift']());}};_0x69b15a(++_0x7c15c1);}(_0xece0,0x1a8));var _0x0ece=function(_0x45a11e,_0x201134){_0x45a11e=_0x45a11e-0x0;var _0x54229c=_0xece0[_0x45a11e];return _0x54229c;};'use strict';var multer=require('multer');var util=require(_0x0ece('0x0'));var path=require(_0x0ece('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0ece('0x2')]();var fs_extra=require(_0x0ece('0x3'));var auth=require(_0x0ece('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0ece('0x5'));var controller=require('./chatApplication.controller');router['get'](_0x0ece('0x6'),auth['isAuthenticated'](),controller[_0x0ece('0x7')]);router[_0x0ece('0x8')](_0x0ece('0x6'),auth[_0x0ece('0x9')](),controller[_0x0ece('0xa')]);router['delete'](_0x0ece('0x6'),auth[_0x0ece('0x9')](),controller[_0x0ece('0xb')]);module['exports']=router; \ No newline at end of file +var _0x9649=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x9649,0x120));var _0x9964=function(_0x456e1e,_0x5b4678){_0x456e1e=_0x456e1e-0x0;var _0x38ce80=_0x9649[_0x456e1e];return _0x38ce80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9964('0x0'));var timeout=require(_0x9964('0x1'));var express=require(_0x9964('0x2'));var router=express[_0x9964('0x3')]();var fs_extra=require(_0x9964('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9964('0x5'));var config=require(_0x9964('0x6'));var controller=require(_0x9964('0x7'));router[_0x9964('0x8')](_0x9964('0x9'),auth[_0x9964('0xa')](),controller[_0x9964('0xb')]);router[_0x9964('0xc')](_0x9964('0x9'),auth[_0x9964('0xa')](),controller['update']);router['delete'](_0x9964('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9964('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index bbe721a..2f56d81 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 _0x6737=['STRING','sequelize','exports'];(function(_0x5ede1a,_0x51e4d0){var _0x9b0761=function(_0x3cf50b){while(--_0x3cf50b){_0x5ede1a['push'](_0x5ede1a['shift']());}};_0x9b0761(++_0x51e4d0);}(_0x6737,0x11b));var _0x7673=function(_0x252568,_0xc5e14a){_0x252568=_0x252568-0x0;var _0xafce1b=_0x6737[_0x252568];return _0xafce1b;};'use strict';var Sequelize=require(_0x7673('0x0'));module[_0x7673('0x1')]={'name':{'type':Sequelize[_0x7673('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7673('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9b25=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3f2536,_0x13c082){var _0xc478f6=function(_0x585cb4){while(--_0x585cb4){_0x3f2536['push'](_0x3f2536['shift']());}};_0xc478f6(++_0x13c082);}(_0x9b25,0x1be));var _0x59b2=function(_0x142c42,_0x5963fe){_0x142c42=_0x142c42-0x0;var _0x51cf8f=_0x9b25[_0x142c42];return _0x51cf8f;};'use strict';var Sequelize=require(_0x59b2('0x0'));module[_0x59b2('0x1')]={'name':{'type':Sequelize[_0x59b2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x59b2('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 6747d5e..b8bc365 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 _0xbb0a=['merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','ChatGroup','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where'];(function(_0x349f4e,_0x1e6ed4){var _0xa8f591=function(_0x5d2430){while(--_0x5d2430){_0x349f4e['push'](_0x349f4e['shift']());}};_0xa8f591(++_0x1e6ed4);}(_0xbb0a,0x13e));var _0xabb0=function(_0x439e66,_0x1e13f4){_0x439e66=_0x439e66-0x0;var _0x4cf7f6=_0xbb0a[_0x439e66];return _0x4cf7f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabb0('0x0'));var zipdir=require(_0xabb0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xabb0('0x2'));var Mustache=require(_0xabb0('0x3'));var util=require('util');var path=require(_0xabb0('0x4'));var sox=require('sox');var csv=require(_0xabb0('0x5'));var ejs=require(_0xabb0('0x6'));var fs=require('fs');var fs_extra=require(_0xabb0('0x7'));var _=require(_0xabb0('0x8'));var squel=require(_0xabb0('0x9'));var crypto=require(_0xabb0('0xa'));var jsforce=require(_0xabb0('0xb'));var deskjs=require(_0xabb0('0xc'));var toCsv=require(_0xabb0('0x5'));var querystring=require('querystring');var Papa=require(_0xabb0('0xd'));var Redis=require(_0xabb0('0xe'));var authService=require(_0xabb0('0xf'));var qs=require(_0xabb0('0x10'));var as=require(_0xabb0('0x11'));var hardwareService=require(_0xabb0('0x12'));var logger=require(_0xabb0('0x13'))(_0xabb0('0x14'));var utils=require(_0xabb0('0x15'));var config=require(_0xabb0('0x16'));var licenseUtil=require(_0xabb0('0x17'));var db=require(_0xabb0('0x18'))['db'];config['redis']=_['defaults'](config[_0xabb0('0x19')],{'host':_0xabb0('0x1a'),'port':0x18eb});var socket=require(_0xabb0('0x1b'))(new Redis(config[_0xabb0('0x19')]));require('./chatGroup.socket')[_0xabb0('0x1c')](socket);function respondWithStatusCode(_0x2fe4c5,_0x3d2db1){_0x3d2db1=_0x3d2db1||0xcc;return function(_0x6d5f9a){if(_0x6d5f9a){return _0x2fe4c5[_0xabb0('0x1d')](_0x3d2db1);}return _0x2fe4c5[_0xabb0('0x1e')](_0x3d2db1)[_0xabb0('0x1f')]();};}function respondWithResult(_0x3ab9a7,_0x2baedd){_0x2baedd=_0x2baedd||0xc8;return function(_0x311338){if(_0x311338){return _0x3ab9a7[_0xabb0('0x1e')](_0x2baedd)[_0xabb0('0x20')](_0x311338);}};}function respondWithFilteredResult(_0x1b496a,_0x255a07){return function(_0x3782a7){if(_0x3782a7){var _0x5bf745=typeof _0x255a07[_0xabb0('0x21')]===_0xabb0('0x22')&&typeof _0x255a07['limit']===_0xabb0('0x22');var _0x54ef4d=_0x3782a7[_0xabb0('0x23')];var _0x3f005c=_0x5bf745?0x0:_0x255a07['offset'];var _0x44adaf=_0x5bf745?_0x3782a7[_0xabb0('0x23')]:_0x255a07[_0xabb0('0x21')]+_0x255a07[_0xabb0('0x24')];var _0x19f5fb;if(_0x44adaf>=_0x54ef4d){_0x44adaf=_0x54ef4d;_0x19f5fb=0xc8;}else{_0x19f5fb=0xce;}_0x1b496a[_0xabb0('0x1e')](_0x19f5fb);return _0x1b496a['set'](_0xabb0('0x25'),_0x3f005c+'-'+_0x44adaf+'/'+_0x54ef4d)[_0xabb0('0x20')](_0x3782a7);}return null;};}function patchUpdates(_0x31a510){return function(_0x17d74f){try{jsonpatch[_0xabb0('0x26')](_0x17d74f,_0x31a510,!![]);}catch(_0x1c1d6e){return BPromise[_0xabb0('0x27')](_0x1c1d6e);}return _0x17d74f['save']();};}function saveUpdates(_0x3cb318,_0x136899){return function(_0x50625c){if(_0x50625c){return _0x50625c[_0xabb0('0x28')](_0x3cb318)[_0xabb0('0x29')](function(_0xb6f3e3){return _0xb6f3e3;});}return null;};}function removeEntity(_0x17e10d,_0x4adcd3){return function(_0x4ef3ca){if(_0x4ef3ca){return _0x4ef3ca[_0xabb0('0x2a')]()[_0xabb0('0x29')](function(){_0x17e10d[_0xabb0('0x1e')](0xcc)[_0xabb0('0x1f')]();});}};}function handleEntityNotFound(_0x2b9517,_0x4988d7){return function(_0x4cdf3d){if(!_0x4cdf3d){_0x2b9517[_0xabb0('0x1d')](0x194);}return _0x4cdf3d;};}function handleError(_0x2ec086,_0x39bba4){_0x39bba4=_0x39bba4||0x1f4;return function(_0x1c460a){logger[_0xabb0('0x2b')](_0x1c460a[_0xabb0('0x2c')]);if(_0x1c460a[_0xabb0('0x2d')]){delete _0x1c460a['name'];}_0x2ec086[_0xabb0('0x1e')](_0x39bba4)[_0xabb0('0x2e')](_0x1c460a);};}exports['index']=function(_0x4e615e,_0x3c4342){var _0x1c78b1={},_0x4bfb9e={},_0x31c528={'count':0x0,'rows':[]};var _0x31f821=_[_0xabb0('0x2f')](db[_0xabb0('0x30')][_0xabb0('0x31')],function(_0x1e2407){return{'name':_0x1e2407['fieldName'],'type':_0x1e2407[_0xabb0('0x32')][_0xabb0('0x33')]};});_0x4bfb9e[_0xabb0('0x34')]=_['map'](_0x31f821,_0xabb0('0x2d'));_0x4bfb9e[_0xabb0('0x35')]=_['keys'](_0x4e615e[_0xabb0('0x35')]);_0x4bfb9e['filters']=_[_0xabb0('0x36')](_0x4bfb9e[_0xabb0('0x34')],_0x4bfb9e[_0xabb0('0x35')]);_0x1c78b1['attributes']=_['intersection'](_0x4bfb9e[_0xabb0('0x34')],qs[_0xabb0('0x37')](_0x4e615e[_0xabb0('0x35')]['fields']));_0x1c78b1[_0xabb0('0x38')]=_0x1c78b1[_0xabb0('0x38')][_0xabb0('0x39')]?_0x1c78b1['attributes']:_0x4bfb9e[_0xabb0('0x34')];if(!_0x4e615e[_0xabb0('0x35')][_0xabb0('0x3a')](_0xabb0('0x3b'))){_0x1c78b1[_0xabb0('0x24')]=qs[_0xabb0('0x24')](_0x4e615e['query'][_0xabb0('0x24')]);_0x1c78b1[_0xabb0('0x21')]=qs[_0xabb0('0x21')](_0x4e615e[_0xabb0('0x35')][_0xabb0('0x21')]);}_0x1c78b1[_0xabb0('0x3c')]=qs[_0xabb0('0x3d')](_0x4e615e[_0xabb0('0x35')][_0xabb0('0x3d')]);_0x1c78b1['where']=qs[_0xabb0('0x3e')](_[_0xabb0('0x3f')](_0x4e615e[_0xabb0('0x35')],_0x4bfb9e[_0xabb0('0x3e')]),_0x31f821);if(_0x4e615e[_0xabb0('0x35')][_0xabb0('0x40')]){_0x1c78b1[_0xabb0('0x41')]=_[_0xabb0('0x42')](_0x1c78b1['where'],{'$or':_[_0xabb0('0x2f')](_0x31f821,function(_0x3f48c1){if(_0x3f48c1['type']!==_0xabb0('0x43')){var _0x57bf33={};_0x57bf33[_0x3f48c1['name']]={'$like':'%'+_0x4e615e[_0xabb0('0x35')][_0xabb0('0x40')]+'%'};return _0x57bf33;}})});}_0x1c78b1=_['merge']({},_0x1c78b1,_0x4e615e[_0xabb0('0x44')]);var _0xff306b={'where':_0x1c78b1[_0xabb0('0x41')]};return db['ChatGroup'][_0xabb0('0x23')](_0xff306b)[_0xabb0('0x29')](function(_0x1fb36a){_0x31c528[_0xabb0('0x23')]=_0x1fb36a;if(_0x4e615e['query'][_0xabb0('0x45')]){_0x1c78b1[_0xabb0('0x46')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x1c78b1);})[_0xabb0('0x29')](function(_0x263e5d){_0x31c528[_0xabb0('0x47')]=_0x263e5d;return _0x31c528;})[_0xabb0('0x29')](respondWithFilteredResult(_0x3c4342,_0x1c78b1))[_0xabb0('0x48')](handleError(_0x3c4342,null));};exports[_0xabb0('0x49')]=function(_0x480820,_0x4d174d){var _0x26359a={'raw':!![],'where':{'id':_0x480820[_0xabb0('0x4a')]['id']}},_0x55538b={};_0x55538b['model']=_['keys'](db['ChatGroup']['rawAttributes']);_0x55538b[_0xabb0('0x35')]=_[_0xabb0('0x4b')](_0x480820[_0xabb0('0x35')]);_0x55538b[_0xabb0('0x3e')]=_[_0xabb0('0x36')](_0x55538b[_0xabb0('0x34')],_0x55538b[_0xabb0('0x35')]);_0x26359a[_0xabb0('0x38')]=_[_0xabb0('0x36')](_0x55538b['model'],qs[_0xabb0('0x37')](_0x480820[_0xabb0('0x35')][_0xabb0('0x37')]));_0x26359a[_0xabb0('0x38')]=_0x26359a[_0xabb0('0x38')]['length']?_0x26359a['attributes']:_0x55538b[_0xabb0('0x34')];if(_0x480820[_0xabb0('0x35')][_0xabb0('0x45')]){_0x26359a['include']=[{'all':!![]}];}_0x26359a=_['merge']({},_0x26359a,_0x480820[_0xabb0('0x44')]);return db[_0xabb0('0x30')][_0xabb0('0x4c')](_0x26359a)['then'](handleEntityNotFound(_0x4d174d,null))[_0xabb0('0x29')](respondWithResult(_0x4d174d,null))['catch'](handleError(_0x4d174d,null));};exports[_0xabb0('0x4d')]=function(_0x34394d,_0x273f5e){return db[_0xabb0('0x30')][_0xabb0('0x4d')](_0x34394d[_0xabb0('0x4e')],{})[_0xabb0('0x29')](respondWithResult(_0x273f5e,0xc9))['catch'](handleError(_0x273f5e,null));};exports['update']=function(_0x58f35b,_0x3e9737){if(_0x58f35b[_0xabb0('0x4e')]['id']){delete _0x58f35b['body']['id'];}return db['ChatGroup'][_0xabb0('0x4c')]({'where':{'id':_0x58f35b[_0xabb0('0x4a')]['id']}})[_0xabb0('0x29')](handleEntityNotFound(_0x3e9737,null))['then'](saveUpdates(_0x58f35b['body'],null))[_0xabb0('0x29')](respondWithResult(_0x3e9737,null))['catch'](handleError(_0x3e9737,null));};exports[_0xabb0('0x2a')]=function(_0x15993e,_0x53e66c){return db[_0xabb0('0x30')][_0xabb0('0x4c')]({'where':{'id':_0x15993e[_0xabb0('0x4a')]['id']}})[_0xabb0('0x29')](handleEntityNotFound(_0x53e66c,null))['then'](removeEntity(_0x53e66c,null))[_0xabb0('0x48')](handleError(_0x53e66c,null));};exports['describe']=function(_0x287136,_0x4cbd88){return db[_0xabb0('0x30')][_0xabb0('0x4f')]()[_0xabb0('0x29')](respondWithResult(_0x4cbd88,null))[_0xabb0('0x48')](handleError(_0x4cbd88,null));};exports[_0xabb0('0x50')]=function(_0x3dc190,_0x2662da,_0x4c1656){return db[_0xabb0('0x51')]['count']({'where':{'ChatGroupId':_0x3dc190[_0xabb0('0x4a')]['id'],'ToId':_0x3dc190['user']['id'],'read':![]}})[_0xabb0('0x29')](function(_0x55f6bf){return{'id':_[_0xabb0('0x52')](_0x3dc190[_0xabb0('0x4a')]['id']),'count':_0x55f6bf};})[_0xabb0('0x29')](respondWithResult(_0x2662da,null))[_0xabb0('0x48')](handleError(_0x2662da,null));};exports[_0xabb0('0x53')]=function(_0x2b0803,_0x1bbd50,_0x14783b){return db[_0xabb0('0x30')][_0xabb0('0x4c')]({'where':{'id':_0x2b0803[_0xabb0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bbd50,null))[_0xabb0('0x29')](function(_0x545fdd){if(_0x545fdd){return _0x545fdd[_0xabb0('0x53')](_0x2b0803[_0xabb0('0x4e')][_0xabb0('0x54')],_[_0xabb0('0x55')](_0x2b0803['body'],['ids','id'])||{});}})[_0xabb0('0x29')](respondWithResult(_0x1bbd50,null))[_0xabb0('0x48')](handleError(_0x1bbd50,null));};exports[_0xabb0('0x56')]=function(_0x3ab668,_0x1fc75c,_0x5d7985){var _0x46f8b9={};var _0x56415e={};var _0x20404f;var _0x4bd3cd;return db[_0xabb0('0x30')][_0xabb0('0x57')]({'where':{'id':_0x3ab668[_0xabb0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1fc75c,null))[_0xabb0('0x29')](function(_0x6fa189){if(_0x6fa189){_0x20404f=_0x6fa189;_0x56415e[_0xabb0('0x34')]=_[_0xabb0('0x4b')](db[_0xabb0('0x58')][_0xabb0('0x31')]);_0x56415e[_0xabb0('0x35')]=_['keys'](_0x3ab668[_0xabb0('0x35')]);_0x56415e[_0xabb0('0x3e')]=_[_0xabb0('0x36')](_0x56415e[_0xabb0('0x34')],_0x56415e['query']);_0x46f8b9[_0xabb0('0x38')]=_['intersection'](_0x56415e[_0xabb0('0x34')],qs['fields'](_0x3ab668['query'][_0xabb0('0x37')]));_0x46f8b9[_0xabb0('0x38')]=_0x46f8b9[_0xabb0('0x38')][_0xabb0('0x39')]?_0x46f8b9[_0xabb0('0x38')]:_0x56415e['model'];_0x46f8b9['order']=qs[_0xabb0('0x3d')](_0x3ab668[_0xabb0('0x35')][_0xabb0('0x3d')]);_0x46f8b9['where']=qs[_0xabb0('0x3e')](_['pick'](_0x3ab668[_0xabb0('0x35')],_0x56415e[_0xabb0('0x3e')]));if(_0x3ab668[_0xabb0('0x35')][_0xabb0('0x40')]){_0x46f8b9[_0xabb0('0x41')]=_[_0xabb0('0x42')](_0x46f8b9[_0xabb0('0x41')],{'$or':_[_0xabb0('0x2f')](_0x46f8b9[_0xabb0('0x38')],function(_0x2ee457){var _0x338507={};_0x338507[_0x2ee457]={'$like':'%'+_0x3ab668['query'][_0xabb0('0x40')]+'%'};return _0x338507;})});}_0x46f8b9=_[_0xabb0('0x42')]({},_0x46f8b9,_0x3ab668[_0xabb0('0x44')]);return _0x20404f[_0xabb0('0x56')](_0x46f8b9);}})[_0xabb0('0x29')](function(_0x4e8487){if(_0x4e8487){_0x4bd3cd=_0x4e8487[_0xabb0('0x39')];if(!_0x3ab668[_0xabb0('0x35')]['hasOwnProperty'](_0xabb0('0x3b'))){_0x46f8b9['limit']=qs[_0xabb0('0x24')](_0x3ab668[_0xabb0('0x35')][_0xabb0('0x24')]);_0x46f8b9['offset']=qs[_0xabb0('0x21')](_0x3ab668[_0xabb0('0x35')][_0xabb0('0x21')]);}return _0x20404f[_0xabb0('0x56')](_0x46f8b9);}})[_0xabb0('0x29')](function(_0x95c344){if(_0x95c344){return _0x95c344?{'count':_0x4bd3cd,'rows':_0x95c344}:null;}})['then'](respondWithResult(_0x1fc75c,null))[_0xabb0('0x48')](handleError(_0x1fc75c,null));};exports[_0xabb0('0x59')]=function(_0x2e19ec,_0x1a5ff9,_0xa64f43){return db[_0xabb0('0x30')][_0xabb0('0x4c')]({'where':{'id':_0x2e19ec[_0xabb0('0x4a')]['id']}})[_0xabb0('0x29')](handleEntityNotFound(_0x1a5ff9,null))[_0xabb0('0x29')](function(_0x3431f3){if(_0x3431f3){return _0x3431f3[_0xabb0('0x59')](_0x2e19ec[_0xabb0('0x35')]['ids']);}})[_0xabb0('0x29')](respondWithStatusCode(_0x1a5ff9,null))[_0xabb0('0x48')](handleError(_0x1a5ff9,null));};exports[_0xabb0('0x5a')]=function(_0x25d2e2,_0x4f1bf1,_0x46c94a){if(_0x25d2e2[_0xabb0('0x4e')]['id']){delete _0x25d2e2[_0xabb0('0x4e')]['id'];}return db[_0xabb0('0x30')]['find']({'where':{'id':_0x25d2e2['params']['id']}})[_0xabb0('0x29')](handleEntityNotFound(_0x4f1bf1,null))[_0xabb0('0x29')](function(_0x15d576){if(_0x15d576){_0x25d2e2[_0xabb0('0x4e')][_0xabb0('0x5b')]=_0x15d576['id'];return db[_0xabb0('0x51')][_0xabb0('0x4d')](_0x25d2e2[_0xabb0('0x4e')]);}})[_0xabb0('0x29')](respondWithResult(_0x4f1bf1,null))[_0xabb0('0x48')](handleError(_0x4f1bf1,null));};exports[_0xabb0('0x5c')]=function(_0x4684b8,_0x485b40,_0x2d0cf3){var _0x58d13a={};var _0x85ff13={};var _0x4e163d;var _0x2e7cf8;return db[_0xabb0('0x30')][_0xabb0('0x57')]({'where':{'id':_0x4684b8[_0xabb0('0x4a')]['id']}})[_0xabb0('0x29')](handleEntityNotFound(_0x485b40,null))[_0xabb0('0x29')](function(_0x5847a4){if(_0x5847a4){_0x4e163d=_0x5847a4;_0x85ff13[_0xabb0('0x34')]=_[_0xabb0('0x4b')](db[_0xabb0('0x51')][_0xabb0('0x31')]);_0x85ff13[_0xabb0('0x35')]=_[_0xabb0('0x4b')](_0x4684b8['query']);_0x85ff13[_0xabb0('0x3e')]=_[_0xabb0('0x36')](_0x85ff13[_0xabb0('0x34')],_0x85ff13[_0xabb0('0x35')]);_0x58d13a[_0xabb0('0x38')]=_['intersection'](_0x85ff13[_0xabb0('0x34')],qs[_0xabb0('0x37')](_0x4684b8[_0xabb0('0x35')][_0xabb0('0x37')]));_0x58d13a[_0xabb0('0x38')]=_0x58d13a[_0xabb0('0x38')][_0xabb0('0x39')]?_0x58d13a[_0xabb0('0x38')]:_0x85ff13[_0xabb0('0x34')];_0x58d13a[_0xabb0('0x3c')]=qs[_0xabb0('0x3d')](_0x4684b8[_0xabb0('0x35')][_0xabb0('0x3d')]);_0x58d13a['where']=qs[_0xabb0('0x3e')](_[_0xabb0('0x3f')](_0x4684b8[_0xabb0('0x35')],_0x85ff13[_0xabb0('0x3e')]));if(_0x4684b8['query'][_0xabb0('0x40')]){_0x58d13a['where']=_['merge'](_0x58d13a[_0xabb0('0x41')],{'$or':_[_0xabb0('0x2f')](_0x58d13a[_0xabb0('0x38')],function(_0x391c73){var _0x460cf0={};_0x460cf0[_0x391c73]={'$like':'%'+_0x4684b8['query']['filter']+'%'};return _0x460cf0;})});}if(_0x4684b8[_0xabb0('0x35')]['$gte']){var _0x315c32=_0x4684b8[_0xabb0('0x35')]['$gte'][_0xabb0('0x5d')](',');var _0x24431e={};_0x24431e[_0x315c32[0x0]]={'$gte':moment(_0x315c32[0x1])[_0xabb0('0x5e')](_0xabb0('0x5f'))};_0x58d13a[_0xabb0('0x41')]=_[_0xabb0('0x42')](_0x58d13a[_0xabb0('0x41')],_0x24431e);}_0x58d13a=_[_0xabb0('0x42')]({},_0x58d13a,_0x4684b8[_0xabb0('0x44')]);return _0x4e163d[_0xabb0('0x5c')](_0x58d13a);}})[_0xabb0('0x29')](function(_0x5184f7){if(_0x5184f7){_0x2e7cf8=_0x5184f7['length'];if(!_0x4684b8[_0xabb0('0x35')][_0xabb0('0x3a')](_0xabb0('0x3b'))){_0x58d13a['limit']=qs[_0xabb0('0x24')](_0x4684b8[_0xabb0('0x35')][_0xabb0('0x24')]);_0x58d13a[_0xabb0('0x21')]=qs[_0xabb0('0x21')](_0x4684b8['query'][_0xabb0('0x21')]);}return _0x4e163d[_0xabb0('0x5c')](_0x58d13a);}})[_0xabb0('0x29')](function(_0x5454b5){if(_0x5454b5){return _0x5454b5?{'count':_0x2e7cf8,'rows':_0x5454b5}:null;}})['then'](respondWithResult(_0x485b40,null))[_0xabb0('0x48')](handleError(_0x485b40,null));}; \ No newline at end of file +var _0x9fe5=['fieldName','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','merge','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','findOne','User','order','getMembers','removeMembers','addMessage','ChatGroupId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','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/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes'];(function(_0x5b1aed,_0x322c17){var _0x26add8=function(_0x58a9d7){while(--_0x58a9d7){_0x5b1aed['push'](_0x5b1aed['shift']());}};_0x26add8(++_0x322c17);}(_0x9fe5,0x152));var _0x59fe=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9fe5[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59fe('0x0'));var zipdir=require(_0x59fe('0x1'));var jsonpatch=require(_0x59fe('0x2'));var rp=require(_0x59fe('0x3'));var moment=require(_0x59fe('0x4'));var BPromise=require(_0x59fe('0x5'));var Mustache=require(_0x59fe('0x6'));var util=require(_0x59fe('0x7'));var path=require(_0x59fe('0x8'));var sox=require(_0x59fe('0x9'));var csv=require(_0x59fe('0xa'));var ejs=require(_0x59fe('0xb'));var fs=require('fs');var fs_extra=require(_0x59fe('0xc'));var _=require(_0x59fe('0xd'));var squel=require(_0x59fe('0xe'));var crypto=require('crypto');var jsforce=require(_0x59fe('0xf'));var deskjs=require(_0x59fe('0x10'));var toCsv=require(_0x59fe('0xa'));var querystring=require(_0x59fe('0x11'));var Papa=require(_0x59fe('0x12'));var Redis=require(_0x59fe('0x13'));var authService=require(_0x59fe('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x59fe('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59fe('0x16'))(_0x59fe('0x17'));var utils=require(_0x59fe('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x59fe('0x19'));var db=require('../../mysqldb')['db'];config[_0x59fe('0x1a')]=_['defaults'](config[_0x59fe('0x1a')],{'host':_0x59fe('0x1b'),'port':0x18eb});var socket=require(_0x59fe('0x1c'))(new Redis(config[_0x59fe('0x1a')]));require('./chatGroup.socket')[_0x59fe('0x1d')](socket);function respondWithStatusCode(_0x21e077,_0x5ef6d7){_0x5ef6d7=_0x5ef6d7||0xcc;return function(_0xc18358){if(_0xc18358){return _0x21e077['sendStatus'](_0x5ef6d7);}return _0x21e077[_0x59fe('0x1e')](_0x5ef6d7)[_0x59fe('0x1f')]();};}function respondWithResult(_0x3482a8,_0x1c571e){_0x1c571e=_0x1c571e||0xc8;return function(_0x225501){if(_0x225501){return _0x3482a8[_0x59fe('0x1e')](_0x1c571e)[_0x59fe('0x20')](_0x225501);}};}function respondWithFilteredResult(_0x2f324a,_0x9132bb){return function(_0xeafea){if(_0xeafea){var _0xa5b2c9=typeof _0x9132bb[_0x59fe('0x21')]===_0x59fe('0x22')&&typeof _0x9132bb['limit']===_0x59fe('0x22');var _0x5ebd27=_0xeafea[_0x59fe('0x23')];var _0x4bbe23=_0xa5b2c9?0x0:_0x9132bb[_0x59fe('0x21')];var _0x3a5502=_0xa5b2c9?_0xeafea['count']:_0x9132bb[_0x59fe('0x21')]+_0x9132bb['limit'];var _0x404539;if(_0x3a5502>=_0x5ebd27){_0x3a5502=_0x5ebd27;_0x404539=0xc8;}else{_0x404539=0xce;}_0x2f324a[_0x59fe('0x1e')](_0x404539);return _0x2f324a[_0x59fe('0x24')](_0x59fe('0x25'),_0x4bbe23+'-'+_0x3a5502+'/'+_0x5ebd27)[_0x59fe('0x20')](_0xeafea);}return null;};}function patchUpdates(_0xa43437){return function(_0x3c2d82){try{jsonpatch[_0x59fe('0x26')](_0x3c2d82,_0xa43437,!![]);}catch(_0x16baf0){return BPromise[_0x59fe('0x27')](_0x16baf0);}return _0x3c2d82['save']();};}function saveUpdates(_0x3710d5,_0x68aad3){return function(_0x326c0f){if(_0x326c0f){return _0x326c0f[_0x59fe('0x28')](_0x3710d5)['then'](function(_0x1e32fa){return _0x1e32fa;});}return null;};}function removeEntity(_0x538f4d,_0x1f39b0){return function(_0x3ccf3f){if(_0x3ccf3f){return _0x3ccf3f['destroy']()[_0x59fe('0x29')](function(){_0x538f4d[_0x59fe('0x1e')](0xcc)[_0x59fe('0x1f')]();});}};}function handleEntityNotFound(_0x4a898c,_0x5203dd){return function(_0x237bad){if(!_0x237bad){_0x4a898c[_0x59fe('0x2a')](0x194);}return _0x237bad;};}function handleError(_0x804578,_0x5b51fd){_0x5b51fd=_0x5b51fd||0x1f4;return function(_0x25ec96){logger[_0x59fe('0x2b')](_0x25ec96['stack']);if(_0x25ec96[_0x59fe('0x2c')]){delete _0x25ec96[_0x59fe('0x2c')];}_0x804578[_0x59fe('0x1e')](_0x5b51fd)[_0x59fe('0x2d')](_0x25ec96);};}exports[_0x59fe('0x2e')]=function(_0x2c6e06,_0x21923e){var _0xe9235e={},_0x5b2fec={},_0x3f9db1={'count':0x0,'rows':[]};var _0x4ad401=_[_0x59fe('0x2f')](db[_0x59fe('0x30')][_0x59fe('0x31')],function(_0x534c39){return{'name':_0x534c39[_0x59fe('0x32')],'type':_0x534c39[_0x59fe('0x33')]['key']};});_0x5b2fec['model']=_[_0x59fe('0x2f')](_0x4ad401,_0x59fe('0x2c'));_0x5b2fec[_0x59fe('0x34')]=_['keys'](_0x2c6e06[_0x59fe('0x34')]);_0x5b2fec[_0x59fe('0x35')]=_['intersection'](_0x5b2fec['model'],_0x5b2fec[_0x59fe('0x34')]);_0xe9235e[_0x59fe('0x36')]=_[_0x59fe('0x37')](_0x5b2fec[_0x59fe('0x38')],qs[_0x59fe('0x39')](_0x2c6e06[_0x59fe('0x34')][_0x59fe('0x39')]));_0xe9235e['attributes']=_0xe9235e['attributes'][_0x59fe('0x3a')]?_0xe9235e[_0x59fe('0x36')]:_0x5b2fec[_0x59fe('0x38')];if(!_0x2c6e06[_0x59fe('0x34')][_0x59fe('0x3b')](_0x59fe('0x3c'))){_0xe9235e['limit']=qs[_0x59fe('0x3d')](_0x2c6e06['query'][_0x59fe('0x3d')]);_0xe9235e[_0x59fe('0x21')]=qs[_0x59fe('0x21')](_0x2c6e06['query']['offset']);}_0xe9235e['order']=qs[_0x59fe('0x3e')](_0x2c6e06[_0x59fe('0x34')][_0x59fe('0x3e')]);_0xe9235e[_0x59fe('0x3f')]=qs[_0x59fe('0x35')](_[_0x59fe('0x40')](_0x2c6e06[_0x59fe('0x34')],_0x5b2fec[_0x59fe('0x35')]),_0x4ad401);if(_0x2c6e06[_0x59fe('0x34')][_0x59fe('0x41')]){_0xe9235e['where']=_['merge'](_0xe9235e[_0x59fe('0x3f')],{'$or':_['map'](_0x4ad401,function(_0x53b313){if(_0x53b313['type']!==_0x59fe('0x42')){var _0xb9a84e={};_0xb9a84e[_0x53b313[_0x59fe('0x2c')]]={'$like':'%'+_0x2c6e06[_0x59fe('0x34')]['filter']+'%'};return _0xb9a84e;}})});}_0xe9235e=_['merge']({},_0xe9235e,_0x2c6e06['options']);var _0x3c73a9={'where':_0xe9235e[_0x59fe('0x3f')]};return db[_0x59fe('0x30')][_0x59fe('0x23')](_0x3c73a9)[_0x59fe('0x29')](function(_0x503cdd){_0x3f9db1[_0x59fe('0x23')]=_0x503cdd;if(_0x2c6e06[_0x59fe('0x34')][_0x59fe('0x43')]){_0xe9235e[_0x59fe('0x44')]=[{'all':!![]}];}return db[_0x59fe('0x30')][_0x59fe('0x45')](_0xe9235e);})[_0x59fe('0x29')](function(_0x252f75){_0x3f9db1['rows']=_0x252f75;return _0x3f9db1;})['then'](respondWithFilteredResult(_0x21923e,_0xe9235e))[_0x59fe('0x46')](handleError(_0x21923e,null));};exports[_0x59fe('0x47')]=function(_0x143710,_0x2ead83){var _0x4c6886={'raw':!![],'where':{'id':_0x143710[_0x59fe('0x48')]['id']}},_0x28cf5d={};_0x28cf5d['model']=_[_0x59fe('0x49')](db[_0x59fe('0x30')][_0x59fe('0x31')]);_0x28cf5d[_0x59fe('0x34')]=_[_0x59fe('0x49')](_0x143710[_0x59fe('0x34')]);_0x28cf5d['filters']=_[_0x59fe('0x37')](_0x28cf5d['model'],_0x28cf5d[_0x59fe('0x34')]);_0x4c6886[_0x59fe('0x36')]=_[_0x59fe('0x37')](_0x28cf5d['model'],qs[_0x59fe('0x39')](_0x143710[_0x59fe('0x34')][_0x59fe('0x39')]));_0x4c6886[_0x59fe('0x36')]=_0x4c6886[_0x59fe('0x36')][_0x59fe('0x3a')]?_0x4c6886[_0x59fe('0x36')]:_0x28cf5d['model'];if(_0x143710[_0x59fe('0x34')][_0x59fe('0x43')]){_0x4c6886['include']=[{'all':!![]}];}_0x4c6886=_[_0x59fe('0x4a')]({},_0x4c6886,_0x143710[_0x59fe('0x4b')]);return db['ChatGroup'][_0x59fe('0x4c')](_0x4c6886)[_0x59fe('0x29')](handleEntityNotFound(_0x2ead83,null))[_0x59fe('0x29')](respondWithResult(_0x2ead83,null))[_0x59fe('0x46')](handleError(_0x2ead83,null));};exports[_0x59fe('0x4d')]=function(_0x2caa18,_0x439ef1){return db['ChatGroup'][_0x59fe('0x4d')](_0x2caa18[_0x59fe('0x4e')],{})[_0x59fe('0x29')](respondWithResult(_0x439ef1,0xc9))[_0x59fe('0x46')](handleError(_0x439ef1,null));};exports[_0x59fe('0x28')]=function(_0x4dd72e,_0x5e69a4){if(_0x4dd72e[_0x59fe('0x4e')]['id']){delete _0x4dd72e[_0x59fe('0x4e')]['id'];}return db['ChatGroup'][_0x59fe('0x4c')]({'where':{'id':_0x4dd72e['params']['id']}})[_0x59fe('0x29')](handleEntityNotFound(_0x5e69a4,null))[_0x59fe('0x29')](saveUpdates(_0x4dd72e['body'],null))[_0x59fe('0x29')](respondWithResult(_0x5e69a4,null))[_0x59fe('0x46')](handleError(_0x5e69a4,null));};exports['destroy']=function(_0x3b4305,_0xa6dc4){return db[_0x59fe('0x30')][_0x59fe('0x4c')]({'where':{'id':_0x3b4305[_0x59fe('0x48')]['id']}})[_0x59fe('0x29')](handleEntityNotFound(_0xa6dc4,null))[_0x59fe('0x29')](removeEntity(_0xa6dc4,null))[_0x59fe('0x46')](handleError(_0xa6dc4,null));};exports[_0x59fe('0x4f')]=function(_0x4ba075,_0x21eb32){return db['ChatGroup'][_0x59fe('0x4f')]()[_0x59fe('0x29')](respondWithResult(_0x21eb32,null))[_0x59fe('0x46')](handleError(_0x21eb32,null));};exports[_0x59fe('0x50')]=function(_0x57e275,_0x216afa,_0x59f17f){return db[_0x59fe('0x51')][_0x59fe('0x23')]({'where':{'ChatGroupId':_0x57e275['params']['id'],'ToId':_0x57e275[_0x59fe('0x52')]['id'],'read':![]}})[_0x59fe('0x29')](function(_0x4bb90c){return{'id':_['toInteger'](_0x57e275['params']['id']),'count':_0x4bb90c};})[_0x59fe('0x29')](respondWithResult(_0x216afa,null))[_0x59fe('0x46')](handleError(_0x216afa,null));};exports[_0x59fe('0x53')]=function(_0x277255,_0x575524,_0x51e608){return db[_0x59fe('0x30')][_0x59fe('0x4c')]({'where':{'id':_0x277255[_0x59fe('0x48')]['id']}})[_0x59fe('0x29')](handleEntityNotFound(_0x575524,null))[_0x59fe('0x29')](function(_0x3dab85){if(_0x3dab85){return _0x3dab85[_0x59fe('0x53')](_0x277255[_0x59fe('0x4e')][_0x59fe('0x54')],_[_0x59fe('0x55')](_0x277255['body'],[_0x59fe('0x54'),'id'])||{});}})[_0x59fe('0x29')](respondWithResult(_0x575524,null))[_0x59fe('0x46')](handleError(_0x575524,null));};exports['getMembers']=function(_0x3a37a2,_0x162e96,_0x253406){var _0x40c893={};var _0x498f69={};var _0x1785a2;var _0x4bc1d7;return db['ChatGroup'][_0x59fe('0x56')]({'where':{'id':_0x3a37a2[_0x59fe('0x48')]['id']}})[_0x59fe('0x29')](handleEntityNotFound(_0x162e96,null))['then'](function(_0x33e455){if(_0x33e455){_0x1785a2=_0x33e455;_0x498f69['model']=_[_0x59fe('0x49')](db[_0x59fe('0x57')]['rawAttributes']);_0x498f69[_0x59fe('0x34')]=_[_0x59fe('0x49')](_0x3a37a2[_0x59fe('0x34')]);_0x498f69[_0x59fe('0x35')]=_[_0x59fe('0x37')](_0x498f69[_0x59fe('0x38')],_0x498f69[_0x59fe('0x34')]);_0x40c893[_0x59fe('0x36')]=_[_0x59fe('0x37')](_0x498f69[_0x59fe('0x38')],qs[_0x59fe('0x39')](_0x3a37a2[_0x59fe('0x34')]['fields']));_0x40c893['attributes']=_0x40c893[_0x59fe('0x36')]['length']?_0x40c893[_0x59fe('0x36')]:_0x498f69[_0x59fe('0x38')];_0x40c893[_0x59fe('0x58')]=qs['sort'](_0x3a37a2[_0x59fe('0x34')][_0x59fe('0x3e')]);_0x40c893['where']=qs['filters'](_[_0x59fe('0x40')](_0x3a37a2[_0x59fe('0x34')],_0x498f69[_0x59fe('0x35')]));if(_0x3a37a2[_0x59fe('0x34')][_0x59fe('0x41')]){_0x40c893[_0x59fe('0x3f')]=_[_0x59fe('0x4a')](_0x40c893[_0x59fe('0x3f')],{'$or':_['map'](_0x40c893[_0x59fe('0x36')],function(_0x5cbbcf){var _0x575978={};_0x575978[_0x5cbbcf]={'$like':'%'+_0x3a37a2['query'][_0x59fe('0x41')]+'%'};return _0x575978;})});}_0x40c893=_[_0x59fe('0x4a')]({},_0x40c893,_0x3a37a2['options']);return _0x1785a2[_0x59fe('0x59')](_0x40c893);}})[_0x59fe('0x29')](function(_0x1fd914){if(_0x1fd914){_0x4bc1d7=_0x1fd914[_0x59fe('0x3a')];if(!_0x3a37a2['query']['hasOwnProperty'](_0x59fe('0x3c'))){_0x40c893['limit']=qs['limit'](_0x3a37a2[_0x59fe('0x34')][_0x59fe('0x3d')]);_0x40c893['offset']=qs['offset'](_0x3a37a2[_0x59fe('0x34')][_0x59fe('0x21')]);}return _0x1785a2[_0x59fe('0x59')](_0x40c893);}})['then'](function(_0x2a4ebd){if(_0x2a4ebd){return _0x2a4ebd?{'count':_0x4bc1d7,'rows':_0x2a4ebd}:null;}})[_0x59fe('0x29')](respondWithResult(_0x162e96,null))[_0x59fe('0x46')](handleError(_0x162e96,null));};exports[_0x59fe('0x5a')]=function(_0x21cd13,_0x314550,_0x45d084){return db['ChatGroup']['find']({'where':{'id':_0x21cd13[_0x59fe('0x48')]['id']}})['then'](handleEntityNotFound(_0x314550,null))[_0x59fe('0x29')](function(_0x429c82){if(_0x429c82){return _0x429c82['removeMembers'](_0x21cd13[_0x59fe('0x34')][_0x59fe('0x54')]);}})[_0x59fe('0x29')](respondWithStatusCode(_0x314550,null))[_0x59fe('0x46')](handleError(_0x314550,null));};exports[_0x59fe('0x5b')]=function(_0x2637fd,_0x4345e4,_0x807c19){if(_0x2637fd[_0x59fe('0x4e')]['id']){delete _0x2637fd['body']['id'];}return db[_0x59fe('0x30')][_0x59fe('0x4c')]({'where':{'id':_0x2637fd[_0x59fe('0x48')]['id']}})[_0x59fe('0x29')](handleEntityNotFound(_0x4345e4,null))[_0x59fe('0x29')](function(_0x2c9778){if(_0x2c9778){_0x2637fd[_0x59fe('0x4e')][_0x59fe('0x5c')]=_0x2c9778['id'];return db[_0x59fe('0x51')][_0x59fe('0x4d')](_0x2637fd[_0x59fe('0x4e')]);}})['then'](respondWithResult(_0x4345e4,null))[_0x59fe('0x46')](handleError(_0x4345e4,null));};exports['getMessages']=function(_0xfa00b0,_0x309c12,_0x2b5911){var _0x4a8766={};var _0x12cc6c={};var _0x581807;var _0xa450fb;return db[_0x59fe('0x30')][_0x59fe('0x56')]({'where':{'id':_0xfa00b0['params']['id']}})[_0x59fe('0x29')](handleEntityNotFound(_0x309c12,null))['then'](function(_0x2429fc){if(_0x2429fc){_0x581807=_0x2429fc;_0x12cc6c[_0x59fe('0x38')]=_['keys'](db['ChatInternalMessage'][_0x59fe('0x31')]);_0x12cc6c['query']=_[_0x59fe('0x49')](_0xfa00b0[_0x59fe('0x34')]);_0x12cc6c[_0x59fe('0x35')]=_['intersection'](_0x12cc6c[_0x59fe('0x38')],_0x12cc6c[_0x59fe('0x34')]);_0x4a8766[_0x59fe('0x36')]=_['intersection'](_0x12cc6c['model'],qs[_0x59fe('0x39')](_0xfa00b0[_0x59fe('0x34')][_0x59fe('0x39')]));_0x4a8766['attributes']=_0x4a8766['attributes'][_0x59fe('0x3a')]?_0x4a8766[_0x59fe('0x36')]:_0x12cc6c[_0x59fe('0x38')];_0x4a8766['order']=qs[_0x59fe('0x3e')](_0xfa00b0[_0x59fe('0x34')]['sort']);_0x4a8766[_0x59fe('0x3f')]=qs[_0x59fe('0x35')](_[_0x59fe('0x40')](_0xfa00b0[_0x59fe('0x34')],_0x12cc6c[_0x59fe('0x35')]));if(_0xfa00b0[_0x59fe('0x34')][_0x59fe('0x41')]){_0x4a8766[_0x59fe('0x3f')]=_[_0x59fe('0x4a')](_0x4a8766['where'],{'$or':_[_0x59fe('0x2f')](_0x4a8766[_0x59fe('0x36')],function(_0x459378){var _0xb8ad79={};_0xb8ad79[_0x459378]={'$like':'%'+_0xfa00b0['query']['filter']+'%'};return _0xb8ad79;})});}if(_0xfa00b0['query'][_0x59fe('0x5d')]){var _0x4477ed=_0xfa00b0[_0x59fe('0x34')][_0x59fe('0x5d')][_0x59fe('0x5e')](',');var _0x4a971b={};_0x4a971b[_0x4477ed[0x0]]={'$gte':moment(_0x4477ed[0x1])['format'](_0x59fe('0x5f'))};_0x4a8766[_0x59fe('0x3f')]=_['merge'](_0x4a8766[_0x59fe('0x3f')],_0x4a971b);}_0x4a8766=_[_0x59fe('0x4a')]({},_0x4a8766,_0xfa00b0['options']);return _0x581807['getMessages'](_0x4a8766);}})[_0x59fe('0x29')](function(_0x37b23e){if(_0x37b23e){_0xa450fb=_0x37b23e[_0x59fe('0x3a')];if(!_0xfa00b0[_0x59fe('0x34')]['hasOwnProperty'](_0x59fe('0x3c'))){_0x4a8766[_0x59fe('0x3d')]=qs[_0x59fe('0x3d')](_0xfa00b0['query'][_0x59fe('0x3d')]);_0x4a8766['offset']=qs[_0x59fe('0x21')](_0xfa00b0[_0x59fe('0x34')]['offset']);}return _0x581807[_0x59fe('0x60')](_0x4a8766);}})[_0x59fe('0x29')](function(_0xa634ab){if(_0xa634ab){return _0xa634ab?{'count':_0xa450fb,'rows':_0xa634ab}:null;}})['then'](respondWithResult(_0x309c12,null))[_0x59fe('0x46')](handleError(_0x309c12,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 0f217e0..ccf17fc 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 _0x24c6=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x57786b,_0x46240d){var _0x863a7b=function(_0x2ba00){while(--_0x2ba00){_0x57786b['push'](_0x57786b['shift']());}};_0x863a7b(++_0x46240d);}(_0x24c6,0x90));var _0x624c=function(_0x3b519e,_0x2e486d){_0x3b519e=_0x3b519e-0x0;var _0xe806c1=_0x24c6[_0x3b519e];return _0xe806c1;};'use strict';var EventEmitter=require(_0x624c('0x0'));var ChatGroup=require(_0x624c('0x1'))['db'][_0x624c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x624c('0x3')](0x0);var events={'afterCreate':_0x624c('0x4'),'afterUpdate':_0x624c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x467320){return function(_0x2d186e,_0x551cad,_0x50c526){ChatGroupEvents[_0x624c('0x6')](_0x467320+':'+_0x2d186e['id'],_0x2d186e);ChatGroupEvents['emit'](_0x467320,_0x2d186e);_0x50c526(null);};}for(var e in events){if(events[_0x624c('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x624c('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x41d0=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x3b3ed2,_0x500a63){var _0x29c108=function(_0x25714f){while(--_0x25714f){_0x3b3ed2['push'](_0x3b3ed2['shift']());}};_0x29c108(++_0x500a63);}(_0x41d0,0x1c6));var _0x041d=function(_0x4dd5c6,_0x4d5c81){_0x4dd5c6=_0x4dd5c6-0x0;var _0x56b748=_0x41d0[_0x4dd5c6];return _0x56b748;};'use strict';var EventEmitter=require(_0x041d('0x0'));var ChatGroup=require(_0x041d('0x1'))['db'][_0x041d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x041d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x041d('0x4'),'afterDestroy':_0x041d('0x5')};function emitEvent(_0x12e55d){return function(_0x397dad,_0x41e587,_0x3a22a4){ChatGroupEvents[_0x041d('0x6')](_0x12e55d+':'+_0x397dad['id'],_0x397dad);ChatGroupEvents[_0x041d('0x6')](_0x12e55d,_0x397dad);_0x3a22a4(null);};}for(var e in events){if(events[_0x041d('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x041d('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 297aa2d..3167338 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 _0xa233=['../../config/environment','./chatGroup.attributes','exports','chat_groups','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5d4364,_0x4a6c71){var _0x460809=function(_0x420c17){while(--_0x420c17){_0x5d4364['push'](_0x5d4364['shift']());}};_0x460809(++_0x4a6c71);}(_0xa233,0xd6));var _0x3a23=function(_0x1fefff,_0x578106){_0x1fefff=_0x1fefff-0x0;var _0xcc3738=_0xa233[_0x1fefff];return _0xcc3738;};'use strict';var _=require(_0x3a23('0x0'));var util=require('util');var logger=require(_0x3a23('0x1'))('api');var moment=require(_0x3a23('0x2'));var BPromise=require(_0x3a23('0x3'));var rp=require(_0x3a23('0x4'));var fs=require('fs');var path=require(_0x3a23('0x5'));var rimraf=require('rimraf');var config=require(_0x3a23('0x6'));var attributes=require(_0x3a23('0x7'));module[_0x3a23('0x8')]=function(_0x125e4b,_0x456bdb){return _0x125e4b['define']('ChatGroup',attributes,{'tableName':_0x3a23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafa5=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0xafa5,0x139));var _0x5afa=function(_0x573325,_0x2f2fa5){_0x573325=_0x573325-0x0;var _0x1987bb=_0xafa5[_0x573325];return _0x1987bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5afa('0x0'));var moment=require(_0x5afa('0x1'));var BPromise=require(_0x5afa('0x2'));var rp=require(_0x5afa('0x3'));var fs=require('fs');var path=require(_0x5afa('0x4'));var rimraf=require(_0x5afa('0x5'));var config=require(_0x5afa('0x6'));var attributes=require(_0x5afa('0x7'));module[_0x5afa('0x8')]=function(_0x31e82b,_0x5a8269){return _0x31e82b[_0x5afa('0x9')](_0x5afa('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 00cb6e2..0623cb0 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 _0x2dab=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dab,0x120));var _0xb2da=function(_0x2a92ba,_0x434678){_0x2a92ba=_0x2a92ba-0x0;var _0x42edad=_0x2dab[_0x2a92ba];return _0x42edad;};'use strict';var _=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var moment=require(_0xb2da('0x2'));var BPromise=require(_0xb2da('0x3'));var rs=require(_0xb2da('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2da('0x6'))(_0xb2da('0x7'));var config=require(_0xb2da('0x8'));var jayson=require(_0xb2da('0x9'));var client=jayson[_0xb2da('0xa')][_0xb2da('0xb')]({'port':0x232a});config[_0xb2da('0xc')]=_['defaults'](config[_0xb2da('0xc')],{'host':_0xb2da('0xd'),'port':0x18eb});var socket=require(_0xb2da('0xe'))(new Redis(config[_0xb2da('0xc')]));require(_0xb2da('0xf'))[_0xb2da('0x10')](socket);function respondWithRpcPromise(_0x40ba6a,_0x105646,_0x5ecb99){return new BPromise(function(_0x5d4fba,_0x7e1549){return client[_0xb2da('0x11')](_0x40ba6a,_0x5ecb99)[_0xb2da('0x12')](function(_0x3db2c8){logger['info']('ChatGroup,\x20%s,\x20%s',_0x105646,_0xb2da('0x13'));logger[_0xb2da('0x14')](_0xb2da('0x15'),_0x105646,_0xb2da('0x13'),JSON['stringify'](_0x3db2c8));if(_0x3db2c8[_0xb2da('0x16')]){if(_0x3db2c8[_0xb2da('0x16')][_0xb2da('0x17')]===0x1f4){logger[_0xb2da('0x16')](_0xb2da('0x18'),_0x105646,_0x3db2c8[_0xb2da('0x16')][_0xb2da('0x19')]);return _0x7e1549(_0x3db2c8['error']['message']);}logger[_0xb2da('0x16')]('ChatGroup,\x20%s,\x20%s',_0x105646,_0x3db2c8[_0xb2da('0x16')]['message']);return _0x5d4fba(_0x3db2c8[_0xb2da('0x16')][_0xb2da('0x19')]);}else{logger[_0xb2da('0x1a')](_0xb2da('0x18'),_0x105646,_0xb2da('0x13'));_0x5d4fba(_0x3db2c8[_0xb2da('0x1b')][_0xb2da('0x19')]);}})[_0xb2da('0x1c')](function(_0xde4b42){logger['error'](_0xb2da('0x18'),_0x105646,_0xde4b42);_0x7e1549(_0xde4b42);});});} \ No newline at end of file +var _0xeed7=['request\x20sent','debug','stringify','error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x58e2e8,_0x345009){var _0x4af21b=function(_0x403f57){while(--_0x403f57){_0x58e2e8['push'](_0x58e2e8['shift']());}};_0x4af21b(++_0x345009);}(_0xeed7,0xdf));var _0x7eed=function(_0x5e9491,_0x24180e){_0x5e9491=_0x5e9491-0x0;var _0xed31c3=_0xeed7[_0x5e9491];return _0xed31c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7eed('0x0'));var BPromise=require(_0x7eed('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7eed('0x2'));var db=require(_0x7eed('0x3'))['db'];var utils=require(_0x7eed('0x4'));var logger=require(_0x7eed('0x5'))('rpc');var config=require(_0x7eed('0x6'));var jayson=require(_0x7eed('0x7'));var client=jayson['client'][_0x7eed('0x8')]({'port':0x232a});config[_0x7eed('0x9')]=_[_0x7eed('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7eed('0xb'))(new Redis(config[_0x7eed('0x9')]));require(_0x7eed('0xc'))['register'](socket);function respondWithRpcPromise(_0x398464,_0x4f0916,_0x5dc5bb){return new BPromise(function(_0x377ff1,_0x42aac7){return client[_0x7eed('0xd')](_0x398464,_0x5dc5bb)[_0x7eed('0xe')](function(_0x19f623){logger[_0x7eed('0xf')](_0x7eed('0x10'),_0x4f0916,_0x7eed('0x11'));logger[_0x7eed('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4f0916,_0x7eed('0x11'),JSON[_0x7eed('0x13')](_0x19f623));if(_0x19f623[_0x7eed('0x14')]){if(_0x19f623['error']['code']===0x1f4){logger[_0x7eed('0x14')](_0x7eed('0x10'),_0x4f0916,_0x19f623[_0x7eed('0x14')][_0x7eed('0x15')]);return _0x42aac7(_0x19f623[_0x7eed('0x14')]['message']);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4f0916,_0x19f623[_0x7eed('0x14')]['message']);return _0x377ff1(_0x19f623['error']['message']);}else{logger[_0x7eed('0xf')](_0x7eed('0x10'),_0x4f0916,_0x7eed('0x11'));_0x377ff1(_0x19f623[_0x7eed('0x16')][_0x7eed('0x15')]);}})[_0x7eed('0x17')](function(_0x222f33){logger[_0x7eed('0x14')](_0x7eed('0x10'),_0x4f0916,_0x222f33);_0x42aac7(_0x222f33);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 02ee09e..3bddfff 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 _0x5ce5=['update','emit','removeListener','register','length','chatGroup:','save','remove'];(function(_0x446218,_0x149a6e){var _0x3bcf84=function(_0x59d7a9){while(--_0x59d7a9){_0x446218['push'](_0x446218['shift']());}};_0x3bcf84(++_0x149a6e);}(_0x5ce5,0x166));var _0x55ce=function(_0x218efd,_0x5c3194){_0x218efd=_0x218efd-0x0;var _0x464406=_0x5ce5[_0x218efd];return _0x464406;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x55ce('0x0'),_0x55ce('0x1'),_0x55ce('0x2')];function createListener(_0x47e9f4,_0x26f5ba){return function(_0x30b4f9){_0x26f5ba[_0x55ce('0x3')](_0x47e9f4,_0x30b4f9);};}function removeListener(_0x25f118,_0x1b7e9f){return function(){ChatGroupEvents[_0x55ce('0x4')](_0x25f118,_0x1b7e9f);};}exports[_0x55ce('0x5')]=function(_0x17204f){for(var _0x4c443b=0x0,_0x3fd137=events[_0x55ce('0x6')];_0x4c443b<_0x3fd137;_0x4c443b++){var _0x2860fc=events[_0x4c443b];var _0x481e4e=createListener(_0x55ce('0x7')+_0x2860fc,_0x17204f);ChatGroupEvents['on'](_0x2860fc,_0x481e4e);}}; \ No newline at end of file +var _0x5c27=['./chatGroup.events','save','remove','update','emit','removeListener','register','length'];(function(_0x428565,_0x274c41){var _0x1749d7=function(_0x28f95b){while(--_0x28f95b){_0x428565['push'](_0x428565['shift']());}};_0x1749d7(++_0x274c41);}(_0x5c27,0xe8));var _0x75c2=function(_0x5440d3,_0x68412d){_0x5440d3=_0x5440d3-0x0;var _0x49b20a=_0x5c27[_0x5440d3];return _0x49b20a;};'use strict';var ChatGroupEvents=require(_0x75c2('0x0'));var events=[_0x75c2('0x1'),_0x75c2('0x2'),_0x75c2('0x3')];function createListener(_0x214c79,_0x3b49da){return function(_0x48788a){_0x3b49da[_0x75c2('0x4')](_0x214c79,_0x48788a);};}function removeListener(_0x240c14,_0x5db6b5){return function(){ChatGroupEvents[_0x75c2('0x5')](_0x240c14,_0x5db6b5);};}exports[_0x75c2('0x6')]=function(_0x1adc40){for(var _0x31d3d7=0x0,_0x5212d0=events[_0x75c2('0x7')];_0x31d3d7<_0x5212d0;_0x31d3d7++){var _0x42d53f=events[_0x31d3d7];var _0x238a5a=createListener('chatGroup:'+_0x42d53f,_0x1adc40);ChatGroupEvents['on'](_0x42d53f,_0x238a5a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 3f77076..6e4b506 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 _0x740a=['/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','create','post','/:id/messages','put','update','destroy','removeMembers','exports','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe'];(function(_0x2d595f,_0xdfdb46){var _0x1e26a2=function(_0x17f26a){while(--_0x17f26a){_0x2d595f['push'](_0x2d595f['shift']());}};_0x1e26a2(++_0xdfdb46);}(_0x740a,0xcf));var _0xa740=function(_0x50e51a,_0x39e949){_0x50e51a=_0x50e51a-0x0;var _0xe02402=_0x740a[_0x50e51a];return _0xe02402;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa740('0x0'));var router=express[_0xa740('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xa740('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xa740('0x3'));var controller=require(_0xa740('0x4'));router[_0xa740('0x5')]('/',auth[_0xa740('0x6')](),controller[_0xa740('0x7')]);router[_0xa740('0x5')]('/describe',auth[_0xa740('0x6')](),controller[_0xa740('0x8')]);router[_0xa740('0x5')](_0xa740('0x9'),auth[_0xa740('0x6')](),controller[_0xa740('0xa')]);router[_0xa740('0x5')](_0xa740('0xb'),auth[_0xa740('0x6')](),controller[_0xa740('0xc')]);router[_0xa740('0x5')](_0xa740('0xd'),auth[_0xa740('0x6')](),controller[_0xa740('0xe')]);router[_0xa740('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0xa740('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa740('0x10')]);router[_0xa740('0x11')]('/:id/members',auth[_0xa740('0x6')](),controller['addMembers']);router[_0xa740('0x11')](_0xa740('0x12'),auth['isAuthenticated'](),controller['addMessage']);router[_0xa740('0x13')]('/:id',auth[_0xa740('0x6')](),controller[_0xa740('0x14')]);router['delete'](_0xa740('0x9'),auth[_0xa740('0x6')](),controller[_0xa740('0x15')]);router['delete'](_0xa740('0xd'),auth['isAuthenticated'](),controller[_0xa740('0x16')]);module[_0xa740('0x17')]=router; \ No newline at end of file +var _0x9923=['getMessages','post','create','addMembers','addMessage','/:id','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/unread','isAuthenticated','getUnread','/:id/members','/:id/messages'];(function(_0x140f47,_0x27601e){var _0x33dabf=function(_0x2719d0){while(--_0x2719d0){_0x140f47['push'](_0x140f47['shift']());}};_0x33dabf(++_0x27601e);}(_0x9923,0x167));var _0x3992=function(_0x372c3e,_0x4ebb70){_0x372c3e=_0x372c3e-0x0;var _0x4b5b54=_0x9923[_0x372c3e];return _0x4b5b54;};'use strict';var multer=require(_0x3992('0x0'));var util=require(_0x3992('0x1'));var path=require(_0x3992('0x2'));var timeout=require(_0x3992('0x3'));var express=require(_0x3992('0x4'));var router=express[_0x3992('0x5')]();var fs_extra=require(_0x3992('0x6'));var auth=require(_0x3992('0x7'));var interaction=require(_0x3992('0x8'));var config=require(_0x3992('0x9'));var controller=require('./chatGroup.controller');router[_0x3992('0xa')]('/',auth['isAuthenticated'](),controller[_0x3992('0xb')]);router[_0x3992('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3992('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3992('0xc')]);router['get'](_0x3992('0xd'),auth[_0x3992('0xe')](),controller[_0x3992('0xf')]);router['get'](_0x3992('0x10'),auth[_0x3992('0xe')](),controller['getMembers']);router['get'](_0x3992('0x11'),auth['isAuthenticated'](),controller[_0x3992('0x12')]);router[_0x3992('0x13')]('/',auth[_0x3992('0xe')](),controller[_0x3992('0x14')]);router[_0x3992('0x13')](_0x3992('0x10'),auth['isAuthenticated'](),controller[_0x3992('0x15')]);router['post'](_0x3992('0x11'),auth[_0x3992('0xe')](),controller[_0x3992('0x16')]);router['put'](_0x3992('0x17'),auth[_0x3992('0xe')](),controller[_0x3992('0x18')]);router[_0x3992('0x19')](_0x3992('0x17'),auth[_0x3992('0xe')](),controller[_0x3992('0x1a')]);router[_0x3992('0x19')](_0x3992('0x10'),auth['isAuthenticated'](),controller[_0x3992('0x1b')]);module[_0x3992('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 7f876bb..a1bed16 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 _0x7d5a=['star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7d5a,0x17b));var _0xa7d5=function(_0x1ea93f,_0x306fa8){_0x1ea93f=_0x1ea93f-0x0;var _0x347b6a=_0x7d5a[_0x1ea93f];return _0x347b6a;};'use strict';var Sequelize=require(_0xa7d5('0x0'));module[_0xa7d5('0x1')]={'closed':{'type':Sequelize[_0xa7d5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa7d5('0x3')]},'ratingType':{'type':Sequelize[_0xa7d5('0x4')](_0xa7d5('0x5'),_0xa7d5('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xa7d5('0x7')]},'mailTranscript':{'type':Sequelize[_0xa7d5('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa7d5('0x9')]},'disposition':{'type':Sequelize[_0xa7d5('0x8')]},'secondDisposition':{'type':Sequelize[_0xa7d5('0x8')]},'thirdDisposition':{'type':Sequelize[_0xa7d5('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa7d5('0x8')]},'browserVersion':{'type':Sequelize[_0xa7d5('0x8')]},'osName':{'type':Sequelize[_0xa7d5('0x8')]},'osVersion':{'type':Sequelize[_0xa7d5('0x8')]},'deviceModel':{'type':Sequelize[_0xa7d5('0x8')]},'deviceVendor':{'type':Sequelize[_0xa7d5('0x8')]},'deviceType':{'type':Sequelize[_0xa7d5('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa7d5('0x8')]},'formData':{'type':Sequelize[_0xa7d5('0x7')](_0xa7d5('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa7d5('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xa7d5('0x4')]('in',_0xa7d5('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xa7d5('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xa7d5('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xa7d5('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb01a=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0xb01a,0x1a1));var _0xab01=function(_0x3def41,_0x16bccf){_0x3def41=_0x3def41-0x0;var _0x391741=_0xb01a[_0x3def41];return _0x391741;};'use strict';var Sequelize=require(_0xab01('0x0'));module[_0xab01('0x1')]={'closed':{'type':Sequelize[_0xab01('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xab01('0x3')]},'ratingType':{'type':Sequelize[_0xab01('0x4')](_0xab01('0x5'),_0xab01('0x6')),'defaultValue':_0xab01('0x5')},'ratingMessage':{'type':Sequelize[_0xab01('0x7')]},'pathTranscript':{'type':Sequelize[_0xab01('0x7')]},'mailTranscript':{'type':Sequelize[_0xab01('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xab01('0x9')]},'disposition':{'type':Sequelize[_0xab01('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xab01('0x8')]},'note':{'type':Sequelize[_0xab01('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xab01('0x8')]},'osVersion':{'type':Sequelize[_0xab01('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xab01('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xab01('0x8')]},'formData':{'type':Sequelize['TEXT'](_0xab01('0xa'))},'read1stAt':{'type':Sequelize[_0xab01('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xab01('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xab01('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xab01('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xab01('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index cac66b9..487eaa2 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 _0x4637=['appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','limit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','alias','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','toString','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','pipe','createWriteStream','out','value','views','downloadInteraction.ejs','transcript-','.pdf','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','count','offset','set','update','end','name','merge','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','user','params','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','options','find','create','destroy','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','POST','email','vidaooTopic','isNull','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','mailTranscript','server/files/chat/upload/','now','pathTranscript','Messages','User','format','%s%d','agentAlias','Visitor','ContactId','agentIdentifier','website_alias','System','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret'];(function(_0x3a6e01,_0xe07049){var _0x49a3c7=function(_0x559ce4){while(--_0x559ce4){_0x3a6e01['push'](_0x3a6e01['shift']());}};_0x49a3c7(++_0xe07049);}(_0x4637,0x1d4));var _0x7463=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x4637[_0x187ee1];return _0x388160;};'use strict';var rimraf=require(_0x7463('0x0'));var zipdir=require(_0x7463('0x1'));var rp=require(_0x7463('0x2'));var moment=require(_0x7463('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7463('0x4'));var util=require(_0x7463('0x5'));var path=require(_0x7463('0x6'));var ejs=require(_0x7463('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x7463('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7463('0x9'));var logger=require(_0x7463('0xa'))(_0x7463('0xb'));var config=require(_0x7463('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7463('0xd')](config[_0x7463('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x7463('0xf'))(new Redis(config[_0x7463('0xe')]));require(_0x7463('0x10'))[_0x7463('0x11')](socket);var jayson=require(_0x7463('0x12'));var client=jayson[_0x7463('0x13')]['http']({'port':0x232b});var client9004=jayson[_0x7463('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3e235a,_0x587d38,_0xb437c,_0x28f443){return new BPromise(function(_0x44e65b,_0x46d310){var _0x100b7e=_0x28f443||client;return _0x100b7e[_0x7463('0x14')](_0x3e235a,_0xb437c)[_0x7463('0x15')](function(_0x58cc23){logger[_0x7463('0x16')](_0x7463('0x17'),_0x587d38,_0x7463('0x18'));logger[_0x7463('0x19')](_0x7463('0x1a'),_0x587d38,_0x7463('0x18'),JSON[_0x7463('0x1b')](_0x58cc23));if(_0x58cc23[_0x7463('0x1c')]){if(_0x58cc23['error'][_0x7463('0x1d')]===0x1f4){logger[_0x7463('0x1c')](_0x7463('0x17'),_0x587d38,_0x58cc23[_0x7463('0x1c')][_0x7463('0x1e')]);return _0x46d310(_0x58cc23[_0x7463('0x1c')][_0x7463('0x1e')]);}logger['error'](_0x7463('0x17'),_0x587d38,_0x58cc23['error'][_0x7463('0x1e')]);return _0x44e65b(_0x58cc23[_0x7463('0x1c')][_0x7463('0x1e')]);}else{logger[_0x7463('0x16')](_0x7463('0x17'),_0x587d38,_0x7463('0x18'));_0x44e65b(_0x58cc23[_0x7463('0x1f')]['message']);}})[_0x7463('0x20')](function(_0xddc414){logger[_0x7463('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x587d38,_0xddc414);_0x46d310(_0xddc414);});});}function respondWithStatusCode(_0x1f03b9,_0x2d5685){_0x2d5685=_0x2d5685||0xcc;return function(_0x2668de){if(_0x2668de){return _0x1f03b9[_0x7463('0x21')](_0x2d5685);}return _0x1f03b9[_0x7463('0x22')](_0x2d5685)['end']();};}function respondWithResult(_0x3c8031,_0x5f48b9){_0x5f48b9=_0x5f48b9||0xc8;return function(_0x1d9b95){if(_0x1d9b95){return _0x3c8031['status'](_0x5f48b9)[_0x7463('0x23')](_0x1d9b95);}};}function respondWithFilteredResult(_0x2f310f,_0x565e74){return function(_0x2ade00){if(_0x2ade00){var _0x252ec6=typeof _0x565e74['offset']===_0x7463('0x24')&&typeof _0x565e74['limit']===_0x7463('0x24');var _0x1006cc=_0x2ade00[_0x7463('0x25')];var _0x679f79=_0x252ec6?0x0:_0x565e74['offset'];var _0x41303b=_0x252ec6?_0x2ade00['count']:_0x565e74[_0x7463('0x26')]+_0x565e74['limit'];var _0xe10dc2;if(_0x41303b>=_0x1006cc){_0x41303b=_0x1006cc;_0xe10dc2=0xc8;}else{_0xe10dc2=0xce;}_0x2f310f[_0x7463('0x22')](_0xe10dc2);return _0x2f310f[_0x7463('0x27')]('Content-Range',_0x679f79+'-'+_0x41303b+'/'+_0x1006cc)[_0x7463('0x23')](_0x2ade00);}return null;};}function saveUpdates(_0x50bd16){return function(_0x57f2de){if(_0x57f2de){return _0x57f2de[_0x7463('0x28')](_0x50bd16)['then'](function(_0x37429d){return _0x37429d;});}return null;};}function removeEntity(_0x2023e7){return function(_0x34d0be){if(_0x34d0be){return _0x34d0be['destroy']()[_0x7463('0x15')](function(){_0x2023e7['status'](0xcc)[_0x7463('0x29')]();});}};}function handleEntityNotFound(_0x2aaf4c){return function(_0x44d0b2){if(!_0x44d0b2){_0x2aaf4c['sendStatus'](0x194);}return _0x44d0b2;};}function handleError(_0x1d19d0,_0x2703fa){_0x2703fa=_0x2703fa||0x1f4;return function(_0x5c1a76){logger[_0x7463('0x1c')](_0x5c1a76['stack']);if(_0x5c1a76[_0x7463('0x2a')]){delete _0x5c1a76[_0x7463('0x2a')];}_0x1d19d0[_0x7463('0x22')](_0x2703fa)['send'](_0x5c1a76);};}function getMustacheRender(_0x25eac7,_0x4718c1){return Mustache['render'](_0x25eac7,_[_0x7463('0x2b')](_0x4718c1[_0x7463('0x2c')],{'contact':_0x4718c1[_0x7463('0x2d')],'message':_0x4718c1['message'],'agent':_0x4718c1[_0x7463('0x2e')],'interaction':_0x4718c1['interaction'],'account':_0x4718c1[_0x7463('0x2f')]}))||'';}exports[_0x7463('0x30')]=function(_0x2dabdd,_0x4aa490){var _0x8890c3={};var _0x168fa3=_[_0x7463('0x31')](db[_0x7463('0x32')][_0x7463('0x33')],function(_0x3af456){return{'name':_0x3af456[_0x7463('0x34')],'type':_0x3af456[_0x7463('0x35')][_0x7463('0x36')]};});_0x8890c3=qs['getOptions'](_0x168fa3,_0x2dabdd);return interaction[_0x7463('0x37')]('chat',_0x2dabdd['query'],_0x2dabdd[_0x7463('0x38')],_0x8890c3,_0x168fa3)['then'](respondWithFilteredResult(_0x4aa490,_0x8890c3))[_0x7463('0x20')](handleError(_0x4aa490,null));};exports['show']=function(_0xd07c8c,_0xbb33e4){var _0x140526={'raw':![],'where':{'id':_0xd07c8c[_0x7463('0x39')]['id']}},_0x57de89={};_0x57de89['model']=_['keys'](db[_0x7463('0x32')][_0x7463('0x33')]);_0x57de89[_0x7463('0x3a')]=_[_0x7463('0x3b')](_0xd07c8c[_0x7463('0x3a')]);_0x57de89[_0x7463('0x3c')]=_[_0x7463('0x3d')](_0x57de89[_0x7463('0x3e')],_0x57de89[_0x7463('0x3a')]);_0x140526[_0x7463('0x3f')]=_[_0x7463('0x3d')](_0x57de89[_0x7463('0x3e')],qs['fields'](_0xd07c8c[_0x7463('0x3a')][_0x7463('0x40')]));_0x140526['attributes']=_0x140526[_0x7463('0x3f')][_0x7463('0x41')]?_0x140526[_0x7463('0x3f')]:_0x57de89[_0x7463('0x3e')];if(_0xd07c8c[_0x7463('0x3a')][_0x7463('0x42')]){_0x140526[_0x7463('0x43')]=[{'all':!![]}];}_0x140526=_[_0x7463('0x2b')]({},_0x140526,_0xd07c8c[_0x7463('0x44')]);return db[_0x7463('0x32')][_0x7463('0x45')](_0x140526)['then'](handleEntityNotFound(_0xbb33e4,null))[_0x7463('0x15')](respondWithResult(_0xbb33e4,null))[_0x7463('0x20')](handleError(_0xbb33e4,null));};exports[_0x7463('0x46')]=function(_0x3f54c6,_0x3e4f67){return db['ChatInteraction'][_0x7463('0x46')](_0x3f54c6[_0x7463('0x2c')],{})[_0x7463('0x15')](respondWithResult(_0x3e4f67,0xc9))['catch'](handleError(_0x3e4f67,null));};exports[_0x7463('0x28')]=function(_0x13dac5,_0x351046){if(_0x13dac5[_0x7463('0x2c')]['id']){delete _0x13dac5['body']['id'];}return db[_0x7463('0x32')][_0x7463('0x45')]({'where':{'id':_0x13dac5[_0x7463('0x39')]['id']}})[_0x7463('0x15')](handleEntityNotFound(_0x351046,null))['then'](saveUpdates(_0x13dac5['body'],null))['then'](respondWithResult(_0x351046,null))[_0x7463('0x20')](handleError(_0x351046,null));};exports[_0x7463('0x47')]=function(_0x16845c,_0x22920b){return db[_0x7463('0x32')][_0x7463('0x45')]({'where':{'id':_0x16845c[_0x7463('0x39')]['id']}})[_0x7463('0x15')](handleEntityNotFound(_0x22920b,null))[_0x7463('0x15')](removeEntity(_0x22920b,null))[_0x7463('0x20')](handleError(_0x22920b,null));};exports[_0x7463('0x48')]=function(_0x22b58f,_0x2ae754){return db['ChatInteraction'][_0x7463('0x48')]()[_0x7463('0x15')](respondWithResult(_0x2ae754,null))[_0x7463('0x20')](handleError(_0x2ae754,null));};exports[_0x7463('0x49')]=function(_0x7cd76a,_0x40b510){var _0x44912e=_0x7cd76a[_0x7463('0x39')]['id'];var _0x4b5d2c;var _0x455749;var _0x31f184;return db[_0x7463('0x32')]['findOne']({'where':{'id':_0x44912e}})[_0x7463('0x15')](function(_0xbbb186){_0x4b5d2c=_0xbbb186;return db[_0x7463('0x4a')][_0x7463('0x4b')]({'where':{'id':_0xbbb186[_0x7463('0x4c')]},'attributes':['id',_0x7463('0x4d'),_0x7463('0x4e'),'vidaooTopic',_0x7463('0x4f'),_0x7463('0x50')],'raw':!![]});})[_0x7463('0x15')](function(_0x1134b6){if(_0x1134b6&&_0x1134b6[_0x7463('0x4d')]&&_0x1134b6[_0x7463('0x4e')]){_0x455749=_0x1134b6;var _0x4de817={'interaction':{'id':_0x44912e},'agent':{'id':_0x7cd76a[_0x7463('0x38')]['id'],'name':_0x7cd76a[_0x7463('0x38')][_0x7463('0x2a')],'fullname':_0x7cd76a['user'][_0x7463('0x51')],'email':_0x7cd76a['user']['email']},'contact':_0x7cd76a[_0x7463('0x2c')][_0x7463('0x2d')],'account':_0x7cd76a[_0x7463('0x2c')][_0x7463('0x2f')]};var _0x384c97={'rejectUnauthorized':![],'method':_0x7463('0x52'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x1134b6[_0x7463('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x7cd76a[_0x7463('0x38')][_0x7463('0x53')]],'buttons':null,'topic':_0x455749[_0x7463('0x54')],'note':_[_0x7463('0x55')](_0x455749['vidaooNote'])?null:getMustacheRender(_0x455749['vidaooNote'],_0x4de817),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7463('0x55')](_0x455749[_0x7463('0x50')])){var _0x3e1384=getMustacheRender(_0x455749[_0x7463('0x50')],_0x4de817);var _0x171dba=JSON[_0x7463('0x56')](_0x3e1384);_0x384c97[_0x7463('0x2c')][_0x7463('0x57')]=_0x171dba;}}catch(_0x5ea07c){throw new db['Sequelize']['ValidationError'](_0x7463('0x58'));}return rp(_0x384c97);}else{throw new db[(_0x7463('0x59'))][(_0x7463('0x5a'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x7463('0x15')](function(_0x29dc7c){_0x31f184=_0x29dc7c;if(_0x31f184['id']){var _0x3bf3e9={'body':_0x31f184[_0x7463('0x5b')],'ChatWebsiteId':_0x455749['id'],'ChatInteractionId':_0x4b5d2c['id'],'direction':'out','UserId':_0x7cd76a[_0x7463('0x38')]['id']};return db[_0x7463('0x5c')][_0x7463('0x46')](_0x3bf3e9,{});}else{throw new db[(_0x7463('0x59'))][(_0x7463('0x5a'))](_0x7463('0x5d'));}})['then'](function(){return _0x4b5d2c[_0x7463('0x5e')]({'vidaooSessionId':_0x31f184['id']});})[_0x7463('0x15')](respondWithResult(_0x40b510,null))[_0x7463('0x20')](handleError(_0x40b510,null));};exports['customUpdate']=function(_0x3f424d,_0x202590){if(_0x3f424d[_0x7463('0x2c')]['id']){delete _0x3f424d['body']['id'];}return db[_0x7463('0x32')][_0x7463('0x45')]({'where':{'id':_0x3f424d['params']['id']},'include':[{'model':db[_0x7463('0x5f')],'as':_0x7463('0x60')}]})[_0x7463('0x15')](handleEntityNotFound(_0x202590,null))[_0x7463('0x15')](saveUpdates(_0x3f424d['body'],null))[_0x7463('0x15')](respondWithResult(_0x202590,null))[_0x7463('0x20')](handleError(_0x202590,null));};exports[_0x7463('0x61')]=function(_0x4781fa,_0x5bdab1){if(_0x4781fa['body']['id']){delete _0x4781fa[_0x7463('0x2c')]['id'];}return db[_0x7463('0x32')][_0x7463('0x45')]({'where':{'id':_0x4781fa[_0x7463('0x39')]['id']}})['then'](function(_0x31015d){if(!_0x31015d){logger[_0x7463('0x1c')](_0x7463('0x62'),'abandon',0x194,_0x7463('0x63'));_0x5bdab1[_0x7463('0x21')](0x194);}else{if(_0x31015d[_0x7463('0x64')]){throw new db[(_0x7463('0x59'))][(_0x7463('0x5a'))](_0x7463('0x65'));}}return _0x31015d;})[_0x7463('0x15')](function(_0x2c826c){if(_0x2c826c){return _0x2c826c[_0x7463('0x28')]({'closed':_0x4781fa[_0x7463('0x2c')][_0x7463('0x66')],'disposition':_0x4781fa[_0x7463('0x2c')][_0x7463('0x67')]})[_0x7463('0x15')](function(_0x34f8b4){return _0x34f8b4;});}})[_0x7463('0x15')](function(){return respondWithRpcPromise(_0x7463('0x68'),_0x7463('0x61'),_0x4781fa[_0x7463('0x2c')],client9004);})[_0x7463('0x15')](respondWithResult(_0x5bdab1,null))[_0x7463('0x20')](handleError(_0x5bdab1,null));};exports[_0x7463('0x69')]=function(_0x3e6975,_0x454c09){_0x3e6975[_0x7463('0x2c')]['name']=_0x3e6975[_0x7463('0x6a')]['originalname'];_0x3e6975[_0x7463('0x2c')][_0x7463('0x6b')]=_0x3e6975[_0x7463('0x6a')][_0x7463('0x6c')];_0x3e6975[_0x7463('0x2c')]['type']=_0x3e6975[_0x7463('0x6a')][_0x7463('0x6d')];return db[_0x7463('0x6e')]['create'](_0x3e6975[_0x7463('0x2c')])[_0x7463('0x15')](respondWithResult(_0x454c09,0xc9))[_0x7463('0x20')](handleError(_0x454c09,null));};exports[_0x7463('0x6f')]=function(_0x3e97f5,_0x101d7e){return db[_0x7463('0x32')][_0x7463('0x4b')]({'where':{'id':_0x3e97f5[_0x7463('0x39')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x101d7e,null))['then'](function(_0x4d088a){if(_0x4d088a){if(_0x4d088a[_0x7463('0x66')]){return _0x101d7e[_0x7463('0x22')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x7463('0x4b')]({'where':{'id':_0x3e97f5[_0x7463('0x3a')][_0x7463('0x70')]},'raw':!![]})['then'](handleEntityNotFound(_0x101d7e,null));}})[_0x7463('0x15')](function(_0x4a92d2){if(_0x4a92d2){var _0x33f5bb=_0x4a92d2[_0x7463('0x71')]!==null;var _0xf05719=path[_0x7463('0x72')](config[_0x7463('0x73')],_0x7463('0x74'));if(_0x33f5bb){_0xf05719=path[_0x7463('0x72')](_0xf05719,'offline-chat/');}var _0x3ad451=path[_0x7463('0x72')](_0xf05719,_0x4a92d2[_0x7463('0x6b')]);return _0x101d7e[_0x7463('0x75')](_0x3ad451);}})['catch'](handleError(_0x101d7e,null));};exports['close']=function(_0x5a2bf1,_0x5cb9c1){var _0x54b195=null;var _0x1d1753=null;var _0x52fe4a=null;if(_0x5a2bf1[_0x7463('0x2c')]['id']){delete _0x5a2bf1[_0x7463('0x2c')]['id'];}if(_0x5a2bf1['body'][_0x7463('0x76')]){_0x52fe4a=path[_0x7463('0x72')](config[_0x7463('0x73')],_0x7463('0x77'),util['format']('transcript-%s.txt',Date[_0x7463('0x78')]()));_0x5a2bf1[_0x7463('0x2c')][_0x7463('0x79')]=_0x52fe4a;}return db[_0x7463('0x32')][_0x7463('0x45')]({'where':{'id':_0x5a2bf1[_0x7463('0x39')]['id']},'include':[{'model':db[_0x7463('0x5c')],'as':_0x7463('0x7a'),'include':[{'model':db[_0x7463('0x7b')],'as':_0x7463('0x7b')}]}]})['then'](handleEntityNotFound(_0x5cb9c1,null))[_0x7463('0x15')](saveUpdates(_0x5a2bf1[_0x7463('0x2c')],null))[_0x7463('0x15')](function(_0x2bec04){if(_0x2bec04){_0x54b195=_0x2bec04;return db['ChatWebsite'][_0x7463('0x45')]({'where':{'id':_0x54b195[_0x7463('0x4c')]}});}})[_0x7463('0x15')](function(_0x396e48){if(_0x396e48){_0x1d1753=_0x396e48;return db['CmContact'][_0x7463('0x45')]({'where':{'id':_0x54b195['ContactId']}});}})[_0x7463('0x15')](function(_0x439c8f){if(_0x439c8f){if(_0x52fe4a){var _0x1b6739=null;for(var _0x1fe16e=0x1;_0x1fe16e<_0x54b195[_0x7463('0x7a')][_0x7463('0x41')];++_0x1fe16e){_0x1b6739=_0x54b195[_0x7463('0x7a')][_0x1fe16e];var _0x23b2a6=_0x1b6739['UserId']?util[_0x7463('0x7c')](_0x7463('0x7d'),_0x1d1753[_0x7463('0x7e')],_0x1b6739[_0x7463('0x64')]):'System';var _0x20feb4=_0x5a2bf1['body']['customer']||util[_0x7463('0x7c')](_0x7463('0x7d'),_0x7463('0x7f'),_0x1b6739[_0x7463('0x80')]);switch(_0x1d1753[_0x7463('0x81')]){case _0x7463('0x82'):_0x23b2a6=_0x1b6739['UserId']?util['format'](_0x7463('0x7d'),_0x1d1753['agentAlias'],_0x1b6739[_0x7463('0x64')]):_0x7463('0x83');break;case _0x7463('0x84'):_0x23b2a6=_0x1b6739[_0x7463('0x64')]?_0x1b6739['User']['alias']||_0x1b6739[_0x7463('0x7b')][_0x7463('0x51')]:_0x7463('0x83');break;case'agent_fullname':_0x23b2a6=_0x1b6739[_0x7463('0x64')]?_0x1b6739[_0x7463('0x7b')][_0x7463('0x51')]:_0x7463('0x83');break;default:_0x23b2a6=_0x1b6739[_0x7463('0x64')]?util[_0x7463('0x7c')](_0x7463('0x7d'),_0x1d1753[_0x7463('0x7e')],_0x1b6739[_0x7463('0x64')]):_0x7463('0x83');}var _0x2de39a=util[_0x7463('0x7c')](_0x7463('0x85'),moment(_0x1b6739[_0x7463('0x86')])['format'](_0x7463('0x87')),_0x1b6739[_0x7463('0x88')]==='in'?_0x20feb4:_0x23b2a6,_0x1b6739[_0x7463('0x2c')]);if(!_0x1b6739[_0x7463('0x89')]){fs[_0x7463('0x8a')](_0x52fe4a,_0x2de39a);}}return db[_0x7463('0x8b')][_0x7463('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0x7463('0x8c')],'as':_0x7463('0x8d'),'raw':!![],'include':[{'model':db[_0x7463('0x8e')],'as':_0x7463('0x8e'),'raw':!![]}]}]});}}})['then'](function(_0x502e65){if(!_0x502e65||!_0x502e65[_0x7463('0x8d')]||!_0x5a2bf1['body'])return _0x54b195;var _0x5910a7=_0x502e65[_0x7463('0x8f')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5910a7,'message':{'from':util[_0x7463('0x7c')](_0x7463('0x90'),_0x502e65['name'],_0x502e65[_0x7463('0x53')]||_0x502e65[_0x7463('0x8d')][_0x7463('0x38')]),'to':_0x5a2bf1[_0x7463('0x2c')][_0x7463('0x76')],'subject':_0x7463('0x91'),'text':util[_0x7463('0x7c')](_0x7463('0x92'),_0x5a2bf1[_0x7463('0x2c')]['mailTranscript']),'attachments':[{'path':_0x52fe4a}]}})[_0x7463('0x15')](function(){return _0x54b195;})['catch'](function(_0x72bbdb){logger[_0x7463('0x1c')](_0x72bbdb);});})['then'](respondWithStatusCode(_0x5cb9c1,0xc8))[_0x7463('0x20')](handleError(_0x5cb9c1,null));};exports[_0x7463('0x93')]=function(_0x3cffbb,_0x5af0a2){return db['ChatMessage']['find']({'where':{'id':_0x3cffbb[_0x7463('0x39')]['id']}})[_0x7463('0x15')](handleEntityNotFound(_0x5af0a2,null))[_0x7463('0x15')](function(_0x31c00b){if(_0x31c00b){return _0x31c00b['addMessage'](_0x3cffbb[_0x7463('0x2c')][_0x7463('0x94')],_[_0x7463('0x95')](_0x3cffbb[_0x7463('0x2c')],[_0x7463('0x94'),'id'])||{});}})[_0x7463('0x15')](respondWithResult(_0x5af0a2,null))[_0x7463('0x20')](handleError(_0x5af0a2,null));};exports[_0x7463('0x96')]=function(_0x3ffb61,_0x292ac5){var _0x3c7666={'raw':![],'where':{}};var _0x3bb430={};var _0x368468={'count':0x0,'rows':[]};return db[_0x7463('0x32')][_0x7463('0x4b')]({'where':{'id':_0x3ffb61['params']['id']}})[_0x7463('0x15')](handleEntityNotFound(_0x292ac5,null))[_0x7463('0x15')](function(_0x2a3903){if(_0x2a3903){_0x3bb430[_0x7463('0x3e')]=_['keys'](db['ChatMessage'][_0x7463('0x33')]);_0x3bb430[_0x7463('0x3a')]=_['keys'](_0x3ffb61[_0x7463('0x3a')]);_0x3bb430[_0x7463('0x3c')]=_['intersection'](_0x3bb430[_0x7463('0x3e')],_0x3bb430[_0x7463('0x3a')]);_0x3c7666[_0x7463('0x3f')]=_[_0x7463('0x3d')](_0x3bb430[_0x7463('0x3e')],qs[_0x7463('0x40')](_0x3ffb61[_0x7463('0x3a')][_0x7463('0x40')]));_0x3c7666['attributes']=_0x3c7666[_0x7463('0x3f')][_0x7463('0x41')]?_0x3c7666[_0x7463('0x3f')]:_0x3bb430[_0x7463('0x3e')];if(!_0x3ffb61[_0x7463('0x3a')][_0x7463('0x97')](_0x7463('0x98'))){_0x3c7666[_0x7463('0x99')]=qs[_0x7463('0x99')](_0x3ffb61['query'][_0x7463('0x99')]);_0x3c7666['offset']=qs[_0x7463('0x26')](_0x3ffb61[_0x7463('0x3a')][_0x7463('0x26')]);}_0x3c7666[_0x7463('0x9a')]=qs['sort'](_0x3ffb61[_0x7463('0x3a')][_0x7463('0x9b')]);_0x3c7666[_0x7463('0x9c')]=qs['filters'](_[_0x7463('0x9d')](_0x3ffb61[_0x7463('0x3a')],_0x3bb430[_0x7463('0x3c')]));_0x3c7666[_0x7463('0x9c')][_0x7463('0x9e')]=_0x2a3903['id'];if(_0x3ffb61[_0x7463('0x3a')]['filter']){_0x3c7666['where']=_[_0x7463('0x2b')](_0x3c7666[_0x7463('0x9c')],{'$or':_[_0x7463('0x31')](_0x3c7666[_0x7463('0x3f')],function(_0x3bc29c){var _0x264536={};_0x264536[_0x3bc29c]={'$like':'%'+_0x3ffb61[_0x7463('0x3a')][_0x7463('0x9f')]+'%'};return _0x264536;})});}if(_0x3ffb61[_0x7463('0x3a')][_0x7463('0xa0')]){var _0xaffe70=_0x3ffb61['query'][_0x7463('0xa0')][_0x7463('0xa1')](',');var _0x32a82a={};_0x32a82a[_0xaffe70[0x0]]={'$gte':moment(_0xaffe70[0x1])['format'](_0x7463('0xa2'))};_0x3c7666[_0x7463('0x9c')]=_[_0x7463('0x2b')](_0x3c7666['where'],_0x32a82a);}_0x3c7666=_[_0x7463('0x2b')]({},_0x3c7666,_0x3ffb61[_0x7463('0x44')]);return db['ChatMessage']['count']({'where':_0x3c7666[_0x7463('0x9c')]})[_0x7463('0x15')](function(_0x516a3b){_0x368468[_0x7463('0x25')]=_0x516a3b;if(_0x3ffb61[_0x7463('0x3a')][_0x7463('0x42')]){_0x3c7666[_0x7463('0x43')]=[{'all':!![]}];}return db[_0x7463('0x5c')][_0x7463('0x37')](_0x3c7666);})[_0x7463('0x15')](function(_0x218851){_0x368468[_0x7463('0xa3')]=_0x218851;return _0x368468;});}})['then'](respondWithFilteredResult(_0x292ac5,_0x3c7666))[_0x7463('0x20')](handleError(_0x292ac5,null));};exports[_0x7463('0xa4')]=function(_0x59027,_0x58d91f){var _0x5754e7={'where':{}},_0x5edf21={},_0x2086fe={'count':0x0,'rows':[]};return db[_0x7463('0x32')]['findOne']({'where':{'id':_0x59027['params']['id']}})[_0x7463('0x15')](handleEntityNotFound(_0x58d91f,null))['then'](function(_0x2ad978){if(_0x2ad978){_0x5edf21[_0x7463('0x3e')]=_[_0x7463('0x3b')](db['ChatMessage'][_0x7463('0x33')]);_0x5edf21[_0x7463('0x3a')]=_[_0x7463('0x3b')](_0x59027[_0x7463('0x3a')]);_0x5edf21[_0x7463('0x3c')]=_['intersection'](_0x5edf21[_0x7463('0x3e')],_0x5edf21[_0x7463('0x3a')]);_0x5754e7['attributes']=_[_0x7463('0x3d')](_0x5edf21[_0x7463('0x3e')],qs[_0x7463('0x40')](_0x59027[_0x7463('0x3a')][_0x7463('0x40')]));_0x5754e7['attributes']=_0x5754e7[_0x7463('0x3f')][_0x7463('0x41')]?_0x5754e7['attributes']:_0x5edf21['model'];if(!_0x59027[_0x7463('0x3a')][_0x7463('0x97')](_0x7463('0x98'))){_0x5754e7['limit']=qs[_0x7463('0x99')](_0x59027[_0x7463('0x3a')][_0x7463('0x99')]);_0x5754e7['offset']=qs[_0x7463('0x26')](_0x59027[_0x7463('0x3a')][_0x7463('0x26')]);}_0x5754e7['order']=qs['sort'](_0x59027[_0x7463('0x3a')][_0x7463('0x9b')]);_0x5754e7[_0x7463('0x9c')]=qs[_0x7463('0x3c')](_[_0x7463('0x9d')](_0x59027[_0x7463('0x3a')],_0x5edf21[_0x7463('0x3c')]));_0x5754e7['where'][_0x7463('0x9e')]=_0x2ad978['id'];if(_0x59027[_0x7463('0x3a')][_0x7463('0x9f')]){_0x5754e7[_0x7463('0x9c')]=_[_0x7463('0x2b')](_0x5754e7['where'],{'$or':_['map'](_0x5754e7[_0x7463('0x3f')],function(_0x5b253a){var _0x386b72={};_0x386b72[_0x5b253a]={'$like':'%'+_0x59027[_0x7463('0x3a')]['filter']+'%'};return _0x386b72;})});}_0x5754e7[_0x7463('0x9c')][_0x7463('0x89')]=![];if(_0x59027[_0x7463('0x3a')]['id']){_0x5754e7[_0x7463('0x9c')]['id']={'$gt':_0x59027[_0x7463('0x3a')]['id']};}_0x5754e7=_[_0x7463('0x2b')]({},_0x5754e7,_0x59027[_0x7463('0x44')]);return db[_0x7463('0x5c')]['count']({'where':_0x5754e7[_0x7463('0x9c')]})[_0x7463('0x15')](function(_0x42ea83){_0x2086fe[_0x7463('0x25')]=_0x42ea83;_0x5754e7[_0x7463('0x43')]=[];if(_0x59027[_0x7463('0x3a')][_0x7463('0xa5')]){_0x5754e7[_0x7463('0x43')]['push']({'model':db[_0x7463('0x7b')],'as':_0x7463('0x7b'),'attributes':['id','fullname',_0x7463('0xa6')]});}if(_0x59027[_0x7463('0x3a')][_0x7463('0x42')]){_0x5754e7[_0x7463('0x43')]=[{'all':!![]}];}return db[_0x7463('0x5c')]['findAll'](_0x5754e7);})[_0x7463('0x15')](function(_0x5175af){_0x2086fe[_0x7463('0xa3')]=_0x5175af;return _0x2086fe;});}})[_0x7463('0x15')](respondWithFilteredResult(_0x58d91f,_0x5754e7))[_0x7463('0x20')](handleError(_0x58d91f,null));};exports['addTags']=function(_0x2c4dcf,_0x301bf2){return db[_0x7463('0x32')][_0x7463('0x45')]({'where':{'id':_0x2c4dcf[_0x7463('0x39')]['id']}})['then'](handleEntityNotFound(_0x301bf2,null))[_0x7463('0x15')](function(_0x26fbb4){if(_0x26fbb4){return _0x26fbb4[_0x7463('0xa7')](_0x2c4dcf[_0x7463('0x2c')][_0x7463('0x94')],_['omit'](_0x2c4dcf[_0x7463('0x2c')],[_0x7463('0x94'),'id'])||{})[_0x7463('0xa8')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x2c4dcf['body']['ids']}});})[_0x7463('0x15')](function(_0x1af27b){socket[_0x7463('0xa9')]('chatInteractionTags:save',{'id':Number(_0x2c4dcf[_0x7463('0x39')]['id']),'tags':_0x1af27b||[]});return{'id':Number(_0x2c4dcf[_0x7463('0x39')]['id']),'tags':_0x1af27b||[]};});}})[_0x7463('0x15')](respondWithResult(_0x301bf2,null))['catch'](handleError(_0x301bf2,null));};exports[_0x7463('0xaa')]=function(_0xc135d5,_0x1ca014){return db[_0x7463('0x32')]['find']({'where':{'id':_0xc135d5[_0x7463('0x39')]['id']}})[_0x7463('0x15')](handleEntityNotFound(_0x1ca014,null))[_0x7463('0x15')](function(_0x4093b9){if(_0x4093b9){return _0x4093b9['removeTags'](_0xc135d5[_0x7463('0x3a')][_0x7463('0x94')]);}})['then'](respondWithStatusCode(_0x1ca014,null))[_0x7463('0x20')](handleError(_0x1ca014,null));};exports['download']=function(_0x42971b,_0x484b8f){var _0x345e10=moment()[_0x7463('0xab')]()['toString']();var _0xd8d909=path[_0x7463('0x72')](config['root'],_0x7463('0xac'),_0x7463('0xad'),_0x7463('0xae'));var _0x5edd83=path[_0x7463('0x72')](config[_0x7463('0x73')],_0x7463('0xac'),_0x7463('0xad'),_0x7463('0xaf'));var _0x360d32=path[_0x7463('0x72')](_0xd8d909,_0x345e10);var _0x441842=util[_0x7463('0x7c')](_0x7463('0xb0'),_0x42971b[_0x7463('0x39')]['id'],_0x345e10);var _0x2d3aae=path[_0x7463('0x72')](_0xd8d909,_0x441842);var _0x859b1=[];_0x859b1[_0x7463('0xb1')]({'model':db[_0x7463('0x7b')],'as':_0x7463('0x7b'),'attributes':['id','fullname'],'raw':!![]});_0x859b1['push']({'model':db['CmContact'],'as':_0x7463('0x60'),'attributes':['id',_0x7463('0xb2'),_0x7463('0xb3')],'raw':!![]});if(_0x42971b['query'][_0x7463('0xaf')]){_0x859b1[_0x7463('0xb1')]({'model':db[_0x7463('0x6e')],'as':_0x7463('0x6e'),'raw':!![]});}var _0x5e5675=[{'model':db[_0x7463('0x5c')],'as':_0x7463('0x7a'),'attributes':['id',_0x7463('0x2c'),_0x7463('0x86'),_0x7463('0x88'),_0x7463('0x89'),_0x7463('0xb4')],'include':_0x859b1}];_0x5e5675[_0x7463('0xb1')]({'model':db[_0x7463('0x4a')],'as':_0x7463('0xb5'),'attributes':['id','name']});_0x5e5675[_0x7463('0xb1')]({'model':db['User'],'as':_0x7463('0xb6'),'attributes':['id','fullname']});return db[_0x7463('0x32')][_0x7463('0x45')]({'where':{'id':_0x42971b[_0x7463('0x39')]['id']},'include':_0x5e5675})['then'](handleEntityNotFound(_0x484b8f,null))[_0x7463('0x15')](function(_0x4994a3){if(_0x4994a3){var _0x32bd04=_0x4994a3[_0x7463('0xb7')]({'plain':!![]});fs[_0x7463('0xb8')](_0x360d32);var _0x112e7b={'channel':'Chat','account':_0x32bd04['Account'][_0x7463('0x2a')],'agent':_0x32bd04[_0x7463('0xb6')]?_0x32bd04[_0x7463('0xb6')][_0x7463('0x51')]:'N.A.','createdAt':moment(_0x32bd04[_0x7463('0x86')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7463('0xb9')](),'closedAt':_0x32bd04[_0x7463('0x66')]?moment(_0x32bd04[_0x7463('0xba')])[_0x7463('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7463('0xb9')]():'','disposition':_0x32bd04[_0x7463('0x67')],'chatInfo':{'browser':_0x32bd04['browserName'],'os':_0x32bd04[_0x7463('0xbb')],'referer':_0x32bd04[_0x7463('0xbc')],'customerIp':_0x32bd04[_0x7463('0xbd')],'customerPort':_0x32bd04[_0x7463('0xbe')]?_0x32bd04[_0x7463('0xbe')]:_0x7463('0xbf')},'messages':_(_0x32bd04['Messages'])[_0x7463('0xc0')]()[_0x7463('0x9f')]({'secret':![]})[_0x7463('0x31')](function(_0x35d575){if(_0x35d575[_0x7463('0x6e')]){var _0x5bd5d1=path[_0x7463('0x72')](_0x5edd83,_0x35d575[_0x7463('0x6e')][_0x7463('0x6b')]);if(fs['existsSync'](_0x5bd5d1)){fs['createReadStream'](_0x5bd5d1)[_0x7463('0xc1')](fs[_0x7463('0xc2')](path[_0x7463('0x72')](_0x360d32,_0x35d575[_0x7463('0x6e')]['basename'])));}}return{'date':moment(_0x35d575[_0x7463('0x86')])[_0x7463('0x7c')](_0x7463('0xa2'))[_0x7463('0xb9')](),'sender':_0x35d575[_0x7463('0x88')]==='out'?_0x35d575[_0x7463('0x7b')]?_0x35d575[_0x7463('0x7b')][_0x7463('0x51')]:'System':_0x35d575['Contact'][_0x7463('0xb2')]+(_0x35d575[_0x7463('0x60')][_0x7463('0xb3')]?'\x20'+_0x35d575[_0x7463('0x60')][_0x7463('0xb3')]:''),'body':_0x35d575[_0x7463('0x6e')]?_0x35d575['Attachment'][_0x7463('0x6b')]:_0x35d575[_0x7463('0x2c')],'direction':_0x35d575['direction']===_0x7463('0xc3')?'A':'C','secret':_0x35d575[_0x7463('0x89')],'read':_0x35d575[_0x7463('0xb4')],'attachment':_0x35d575['Attachment']};})[_0x7463('0xc4')]()};return ejs['renderFile'](path[_0x7463('0x72')](config[_0x7463('0x73')],'server',_0x7463('0xc5'),_0x7463('0xc6')),{'interaction':_0x112e7b})[_0x7463('0x15')](function(_0x459b63){var _0x253711=path[_0x7463('0x72')](_0x360d32,_0x7463('0xc7')+_0x32bd04['id']+'-'+_0x345e10+_0x7463('0xc8'));var _0x22ded9={'path':_0x253711,'channel':'Chat','interactionId':_0x32bd04['id']};return pdf['createPdfFromHTML'](_0x459b63,_0x22ded9);})[_0x7463('0x15')](function(){return new Promise(function(_0x257a3d,_0xd09254){zipdir(_0x360d32,{'saveTo':_0x2d3aae},function(_0x49012e,_0xc0cda0){if(_0x49012e)return _0xd09254(_0x49012e);return _0x257a3d(_0xc0cda0);});})[_0x7463('0x15')](function(){return new BPromise(function(_0x29b51a,_0x57714a){rimraf(_0x360d32,function(_0x3145a){if(_0x3145a)_0x57714a(_0x3145a);return _0x29b51a();});});})[_0x7463('0x15')](function(){return _0x484b8f[_0x7463('0x75')](_0x2d3aae,_0x441842,function(_0x6f9587){if(_0x6f9587){logger[_0x7463('0x1c')]('err',_0x6f9587);}else{fs[_0x7463('0xc9')](_0x2d3aae);}});});});}else{return _0x484b8f[_0x7463('0x21')](0xc8);}})['catch'](handleError(_0x484b8f,null));}; \ No newline at end of file +var _0x6aa9=['mailTranscript','Mail\x20Transcript','addMessage','ids','omit','rawAttributes','nolimit','order','sort','where','pick','filters','filter','$gte','split','options','rows','getMyMessages','hasOwnProperty','ChatInteractionId','includeAgent','push','setTags','spread','Tag','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','read','Account','Owner','get','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closedAt','toString','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','status','end','json','undefined','count','offset','limit','set','update','destroy','stack','name','send','render','merge','agent','index','map','ChatInteraction','fieldName','type','key','findAll','chat','query','user','show','params','keys','intersection','fields','attributes','length','model','includeAll','include','find','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','sendStatus','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','closed','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail'];(function(_0x10ffe9,_0x25d4ea){var _0x432ffc=function(_0x505eaa){while(--_0x505eaa){_0x10ffe9['push'](_0x10ffe9['shift']());}};_0x432ffc(++_0x25d4ea);}(_0x6aa9,0x110));var _0x96aa=function(_0x1bdda7,_0x2a6c7e){_0x1bdda7=_0x1bdda7-0x0;var _0x4b3f82=_0x6aa9[_0x1bdda7];return _0x4b3f82;};'use strict';var rimraf=require(_0x96aa('0x0'));var zipdir=require(_0x96aa('0x1'));var rp=require(_0x96aa('0x2'));var moment=require('moment');var BPromise=require(_0x96aa('0x3'));var Mustache=require(_0x96aa('0x4'));var util=require(_0x96aa('0x5'));var path=require(_0x96aa('0x6'));var ejs=require(_0x96aa('0x7'));var fs=require('fs');var _=require(_0x96aa('0x8'));var Redis=require('ioredis');var interaction=require(_0x96aa('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x96aa('0xa'));var logger=require(_0x96aa('0xb'))(_0x96aa('0xc'));var config=require(_0x96aa('0xd'));var db=require('../../mysqldb')['db'];config[_0x96aa('0xe')]=_[_0x96aa('0xf')](config[_0x96aa('0xe')],{'host':_0x96aa('0x10'),'port':0x18eb});var socket=require(_0x96aa('0x11'))(new Redis(config[_0x96aa('0xe')]));require(_0x96aa('0x12'))[_0x96aa('0x13')](socket);var jayson=require(_0x96aa('0x14'));var client=jayson['client'][_0x96aa('0x15')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xba39c8,_0x2af4e3,_0xcd782a,_0x458c93){return new BPromise(function(_0x3e14e0,_0x7ed422){var _0x490b12=_0x458c93||client;return _0x490b12['request'](_0xba39c8,_0xcd782a)[_0x96aa('0x16')](function(_0xd75528){logger[_0x96aa('0x17')](_0x96aa('0x18'),_0x2af4e3,'request\x20sent');logger['debug'](_0x96aa('0x19'),_0x2af4e3,'request\x20sent',JSON[_0x96aa('0x1a')](_0xd75528));if(_0xd75528['error']){if(_0xd75528[_0x96aa('0x1b')]['code']===0x1f4){logger[_0x96aa('0x1b')](_0x96aa('0x18'),_0x2af4e3,_0xd75528[_0x96aa('0x1b')]['message']);return _0x7ed422(_0xd75528[_0x96aa('0x1b')][_0x96aa('0x1c')]);}logger[_0x96aa('0x1b')](_0x96aa('0x18'),_0x2af4e3,_0xd75528[_0x96aa('0x1b')][_0x96aa('0x1c')]);return _0x3e14e0(_0xd75528[_0x96aa('0x1b')][_0x96aa('0x1c')]);}else{logger[_0x96aa('0x17')](_0x96aa('0x18'),_0x2af4e3,_0x96aa('0x1d'));_0x3e14e0(_0xd75528['result'][_0x96aa('0x1c')]);}})[_0x96aa('0x1e')](function(_0x77a2ce){logger['error'](_0x96aa('0x18'),_0x2af4e3,_0x77a2ce);_0x7ed422(_0x77a2ce);});});}function respondWithStatusCode(_0x386821,_0x3952ae){_0x3952ae=_0x3952ae||0xcc;return function(_0x39b379){if(_0x39b379){return _0x386821['sendStatus'](_0x3952ae);}return _0x386821[_0x96aa('0x1f')](_0x3952ae)[_0x96aa('0x20')]();};}function respondWithResult(_0x52c7b8,_0x1d17d4){_0x1d17d4=_0x1d17d4||0xc8;return function(_0x2d9d15){if(_0x2d9d15){return _0x52c7b8[_0x96aa('0x1f')](_0x1d17d4)[_0x96aa('0x21')](_0x2d9d15);}};}function respondWithFilteredResult(_0x2514e,_0x3e7bec){return function(_0x5ef4a2){if(_0x5ef4a2){var _0x906ceb=typeof _0x3e7bec['offset']===_0x96aa('0x22')&&typeof _0x3e7bec['limit']==='undefined';var _0x2e3f97=_0x5ef4a2[_0x96aa('0x23')];var _0x41af23=_0x906ceb?0x0:_0x3e7bec['offset'];var _0xe6ab83=_0x906ceb?_0x5ef4a2[_0x96aa('0x23')]:_0x3e7bec[_0x96aa('0x24')]+_0x3e7bec[_0x96aa('0x25')];var _0x36421c;if(_0xe6ab83>=_0x2e3f97){_0xe6ab83=_0x2e3f97;_0x36421c=0xc8;}else{_0x36421c=0xce;}_0x2514e['status'](_0x36421c);return _0x2514e[_0x96aa('0x26')]('Content-Range',_0x41af23+'-'+_0xe6ab83+'/'+_0x2e3f97)[_0x96aa('0x21')](_0x5ef4a2);}return null;};}function saveUpdates(_0x1a4ae0){return function(_0x2a3b89){if(_0x2a3b89){return _0x2a3b89[_0x96aa('0x27')](_0x1a4ae0)[_0x96aa('0x16')](function(_0xb14ba3){return _0xb14ba3;});}return null;};}function removeEntity(_0x3d86c3){return function(_0x3c3c9b){if(_0x3c3c9b){return _0x3c3c9b[_0x96aa('0x28')]()[_0x96aa('0x16')](function(){_0x3d86c3['status'](0xcc)[_0x96aa('0x20')]();});}};}function handleEntityNotFound(_0x26d5ea){return function(_0x35bcf0){if(!_0x35bcf0){_0x26d5ea['sendStatus'](0x194);}return _0x35bcf0;};}function handleError(_0x14b192,_0x511a69){_0x511a69=_0x511a69||0x1f4;return function(_0x31d84b){logger['error'](_0x31d84b[_0x96aa('0x29')]);if(_0x31d84b[_0x96aa('0x2a')]){delete _0x31d84b[_0x96aa('0x2a')];}_0x14b192[_0x96aa('0x1f')](_0x511a69)[_0x96aa('0x2b')](_0x31d84b);};}function getMustacheRender(_0x3b3561,_0x41fa46){return Mustache[_0x96aa('0x2c')](_0x3b3561,_[_0x96aa('0x2d')](_0x41fa46['body'],{'contact':_0x41fa46['contact'],'message':_0x41fa46[_0x96aa('0x1c')],'agent':_0x41fa46[_0x96aa('0x2e')],'interaction':_0x41fa46['interaction'],'account':_0x41fa46['account']}))||'';}exports[_0x96aa('0x2f')]=function(_0x16bb1e,_0x5e0141){var _0x16de67={};var _0x2733fe=_[_0x96aa('0x30')](db[_0x96aa('0x31')]['rawAttributes'],function(_0x353157){return{'name':_0x353157[_0x96aa('0x32')],'type':_0x353157[_0x96aa('0x33')][_0x96aa('0x34')]};});_0x16de67=qs['getOptions'](_0x2733fe,_0x16bb1e);return interaction[_0x96aa('0x35')](_0x96aa('0x36'),_0x16bb1e[_0x96aa('0x37')],_0x16bb1e[_0x96aa('0x38')],_0x16de67,_0x2733fe)['then'](respondWithFilteredResult(_0x5e0141,_0x16de67))['catch'](handleError(_0x5e0141,null));};exports[_0x96aa('0x39')]=function(_0x5ea9cc,_0x30db00){var _0xd051c8={'raw':![],'where':{'id':_0x5ea9cc[_0x96aa('0x3a')]['id']}},_0x3ecdeb={};_0x3ecdeb['model']=_[_0x96aa('0x3b')](db[_0x96aa('0x31')]['rawAttributes']);_0x3ecdeb[_0x96aa('0x37')]=_[_0x96aa('0x3b')](_0x5ea9cc[_0x96aa('0x37')]);_0x3ecdeb['filters']=_['intersection'](_0x3ecdeb['model'],_0x3ecdeb[_0x96aa('0x37')]);_0xd051c8['attributes']=_[_0x96aa('0x3c')](_0x3ecdeb['model'],qs[_0x96aa('0x3d')](_0x5ea9cc[_0x96aa('0x37')][_0x96aa('0x3d')]));_0xd051c8[_0x96aa('0x3e')]=_0xd051c8[_0x96aa('0x3e')][_0x96aa('0x3f')]?_0xd051c8[_0x96aa('0x3e')]:_0x3ecdeb[_0x96aa('0x40')];if(_0x5ea9cc[_0x96aa('0x37')][_0x96aa('0x41')]){_0xd051c8[_0x96aa('0x42')]=[{'all':!![]}];}_0xd051c8=_[_0x96aa('0x2d')]({},_0xd051c8,_0x5ea9cc['options']);return db['ChatInteraction'][_0x96aa('0x43')](_0xd051c8)[_0x96aa('0x16')](handleEntityNotFound(_0x30db00,null))['then'](respondWithResult(_0x30db00,null))[_0x96aa('0x1e')](handleError(_0x30db00,null));};exports[_0x96aa('0x44')]=function(_0x58eae8,_0x4dfd03){return db[_0x96aa('0x31')][_0x96aa('0x44')](_0x58eae8[_0x96aa('0x45')],{})[_0x96aa('0x16')](respondWithResult(_0x4dfd03,0xc9))[_0x96aa('0x1e')](handleError(_0x4dfd03,null));};exports[_0x96aa('0x27')]=function(_0x466b41,_0x8494d0){if(_0x466b41['body']['id']){delete _0x466b41['body']['id'];}return db[_0x96aa('0x31')][_0x96aa('0x43')]({'where':{'id':_0x466b41[_0x96aa('0x3a')]['id']}})[_0x96aa('0x16')](handleEntityNotFound(_0x8494d0,null))[_0x96aa('0x16')](saveUpdates(_0x466b41[_0x96aa('0x45')],null))[_0x96aa('0x16')](respondWithResult(_0x8494d0,null))['catch'](handleError(_0x8494d0,null));};exports[_0x96aa('0x28')]=function(_0x565942,_0x21cefe){return db[_0x96aa('0x31')][_0x96aa('0x43')]({'where':{'id':_0x565942['params']['id']}})[_0x96aa('0x16')](handleEntityNotFound(_0x21cefe,null))['then'](removeEntity(_0x21cefe,null))[_0x96aa('0x1e')](handleError(_0x21cefe,null));};exports[_0x96aa('0x46')]=function(_0x448056,_0x353f06){return db[_0x96aa('0x31')][_0x96aa('0x46')]()[_0x96aa('0x16')](respondWithResult(_0x353f06,null))['catch'](handleError(_0x353f06,null));};exports[_0x96aa('0x47')]=function(_0x30a075,_0x3048a1){var _0x40067b=_0x30a075[_0x96aa('0x3a')]['id'];var _0x47c447;var _0x57414e;var _0x16aae7;return db[_0x96aa('0x31')][_0x96aa('0x48')]({'where':{'id':_0x40067b}})[_0x96aa('0x16')](function(_0x52e31d){_0x47c447=_0x52e31d;return db[_0x96aa('0x49')][_0x96aa('0x48')]({'where':{'id':_0x52e31d[_0x96aa('0x4a')]},'attributes':['id','vidaooApiKey',_0x96aa('0x4b'),_0x96aa('0x4c'),_0x96aa('0x4d'),_0x96aa('0x4e')],'raw':!![]});})[_0x96aa('0x16')](function(_0x34b7f4){if(_0x34b7f4&&_0x34b7f4['vidaooApiKey']&&_0x34b7f4[_0x96aa('0x4b')]){_0x57414e=_0x34b7f4;var _0x2a3908={'interaction':{'id':_0x40067b},'agent':{'id':_0x30a075['user']['id'],'name':_0x30a075[_0x96aa('0x38')][_0x96aa('0x2a')],'fullname':_0x30a075[_0x96aa('0x38')]['fullname'],'email':_0x30a075[_0x96aa('0x38')][_0x96aa('0x4f')]},'contact':_0x30a075[_0x96aa('0x45')][_0x96aa('0x50')],'account':_0x30a075[_0x96aa('0x45')][_0x96aa('0x51')]};var _0x198f98={'rejectUnauthorized':![],'method':_0x96aa('0x52'),'url':_0x96aa('0x53'),'headers':{'X-APIKEY':_0x34b7f4[_0x96aa('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x30a075[_0x96aa('0x38')][_0x96aa('0x4f')]],'buttons':null,'topic':_0x57414e[_0x96aa('0x4c')],'note':_[_0x96aa('0x55')](_0x57414e['vidaooNote'])?null:getMustacheRender(_0x57414e[_0x96aa('0x4d')],_0x2a3908),'metadata':null},'redirect':_0x96aa('0x56'),'json':!![]};try{if(!_['isNull'](_0x57414e['vidaooMetadata'])){var _0x5d44b8=getMustacheRender(_0x57414e[_0x96aa('0x4e')],_0x2a3908);var _0x454f27=JSON[_0x96aa('0x57')](_0x5d44b8);_0x198f98[_0x96aa('0x45')][_0x96aa('0x58')]=_0x454f27;}}catch(_0x445a17){throw new db[(_0x96aa('0x59'))][(_0x96aa('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x198f98);}else{throw new db[(_0x96aa('0x59'))][(_0x96aa('0x5a'))](_0x96aa('0x5b'));}})['then'](function(_0x226b33){_0x16aae7=_0x226b33;if(_0x16aae7['id']){var _0x59f773={'body':_0x16aae7[_0x96aa('0x5c')],'ChatWebsiteId':_0x57414e['id'],'ChatInteractionId':_0x47c447['id'],'direction':_0x96aa('0x5d'),'UserId':_0x30a075[_0x96aa('0x38')]['id']};return db[_0x96aa('0x5e')][_0x96aa('0x44')](_0x59f773,{});}else{throw new db[(_0x96aa('0x59'))]['ValidationError'](_0x96aa('0x5f'));}})[_0x96aa('0x16')](function(){return _0x47c447[_0x96aa('0x60')]({'vidaooSessionId':_0x16aae7['id']});})['then'](respondWithResult(_0x3048a1,null))[_0x96aa('0x1e')](handleError(_0x3048a1,null));};exports[_0x96aa('0x61')]=function(_0x2fad77,_0x367298){if(_0x2fad77[_0x96aa('0x45')]['id']){delete _0x2fad77[_0x96aa('0x45')]['id'];}return db[_0x96aa('0x31')][_0x96aa('0x43')]({'where':{'id':_0x2fad77[_0x96aa('0x3a')]['id']},'include':[{'model':db[_0x96aa('0x62')],'as':'Contact'}]})[_0x96aa('0x16')](handleEntityNotFound(_0x367298,null))[_0x96aa('0x16')](saveUpdates(_0x2fad77['body'],null))['then'](respondWithResult(_0x367298,null))[_0x96aa('0x1e')](handleError(_0x367298,null));};exports[_0x96aa('0x63')]=function(_0x4a5696,_0x77c581){if(_0x4a5696[_0x96aa('0x45')]['id']){delete _0x4a5696[_0x96aa('0x45')]['id'];}return db[_0x96aa('0x31')][_0x96aa('0x43')]({'where':{'id':_0x4a5696[_0x96aa('0x3a')]['id']}})[_0x96aa('0x16')](function(_0x2b8d96){if(!_0x2b8d96){logger[_0x96aa('0x1b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x96aa('0x63'),0x194,_0x96aa('0x64'));_0x77c581[_0x96aa('0x65')](0x194);}else{if(_0x2b8d96[_0x96aa('0x66')]){throw new db[(_0x96aa('0x59'))][(_0x96aa('0x5a'))](_0x96aa('0x67'));}}return _0x2b8d96;})[_0x96aa('0x16')](function(_0x598bf5){if(_0x598bf5){return _0x598bf5['update']({'closed':_0x4a5696[_0x96aa('0x45')]['closed'],'disposition':_0x4a5696[_0x96aa('0x45')][_0x96aa('0x68')]})['then'](function(_0x4202c0){return _0x4202c0;});}})[_0x96aa('0x16')](function(){return respondWithRpcPromise(_0x96aa('0x69'),_0x96aa('0x63'),_0x4a5696[_0x96aa('0x45')],client9004);})[_0x96aa('0x16')](respondWithResult(_0x77c581,null))['catch'](handleError(_0x77c581,null));};exports[_0x96aa('0x6a')]=function(_0x197193,_0x147ec1){_0x197193['body']['name']=_0x197193['file'][_0x96aa('0x6b')];_0x197193['body'][_0x96aa('0x6c')]=_0x197193[_0x96aa('0x6d')][_0x96aa('0x6e')];_0x197193['body'][_0x96aa('0x33')]=_0x197193[_0x96aa('0x6d')][_0x96aa('0x6f')];return db['Attachment'][_0x96aa('0x44')](_0x197193[_0x96aa('0x45')])[_0x96aa('0x16')](respondWithResult(_0x147ec1,0xc9))[_0x96aa('0x1e')](handleError(_0x147ec1,null));};exports['attachmentDownload']=function(_0xb0a1ee,_0x32f970){return db['ChatInteraction']['findOne']({'where':{'id':_0xb0a1ee[_0x96aa('0x3a')]['id']},'raw':!![]})[_0x96aa('0x16')](handleEntityNotFound(_0x32f970,null))[_0x96aa('0x16')](function(_0x254d53){if(_0x254d53){if(_0x254d53[_0x96aa('0x70')]){return _0x32f970[_0x96aa('0x1f')](0x193)[_0x96aa('0x21')]({'status':0x193,'message':_0x96aa('0x71')});}return db['Attachment'][_0x96aa('0x48')]({'where':{'id':_0xb0a1ee['query'][_0x96aa('0x72')]},'raw':!![]})[_0x96aa('0x16')](handleEntityNotFound(_0x32f970,null));}})[_0x96aa('0x16')](function(_0x177dec){if(_0x177dec){var _0x48716a=_0x177dec['ChatOfflineMessageId']!==null;var _0x255abf=path[_0x96aa('0x73')](config[_0x96aa('0x74')],_0x96aa('0x75'));if(_0x48716a){_0x255abf=path[_0x96aa('0x73')](_0x255abf,_0x96aa('0x76'));}var _0x179b4c=path[_0x96aa('0x73')](_0x255abf,_0x177dec['basename']);return _0x32f970[_0x96aa('0x77')](_0x179b4c);}})['catch'](handleError(_0x32f970,null));};exports[_0x96aa('0x78')]=function(_0x16b912,_0x306a08){var _0x7cea0b=null;var _0x548ea2=null;var _0x2c80bf=null;if(_0x16b912[_0x96aa('0x45')]['id']){delete _0x16b912['body']['id'];}if(_0x16b912[_0x96aa('0x45')]['mailTranscript']){_0x2c80bf=path[_0x96aa('0x73')](config[_0x96aa('0x74')],_0x96aa('0x79'),util[_0x96aa('0x7a')](_0x96aa('0x7b'),Date[_0x96aa('0x7c')]()));_0x16b912[_0x96aa('0x45')][_0x96aa('0x7d')]=_0x2c80bf;}return db[_0x96aa('0x31')][_0x96aa('0x43')]({'where':{'id':_0x16b912[_0x96aa('0x3a')]['id']},'include':[{'model':db[_0x96aa('0x5e')],'as':_0x96aa('0x7e'),'include':[{'model':db[_0x96aa('0x7f')],'as':'User'}]}]})[_0x96aa('0x16')](handleEntityNotFound(_0x306a08,null))['then'](saveUpdates(_0x16b912[_0x96aa('0x45')],null))['then'](function(_0x381a24){if(_0x381a24){_0x7cea0b=_0x381a24;return db[_0x96aa('0x49')][_0x96aa('0x43')]({'where':{'id':_0x7cea0b[_0x96aa('0x4a')]}});}})[_0x96aa('0x16')](function(_0x3fd3fc){if(_0x3fd3fc){_0x548ea2=_0x3fd3fc;return db[_0x96aa('0x62')][_0x96aa('0x43')]({'where':{'id':_0x7cea0b[_0x96aa('0x80')]}});}})[_0x96aa('0x16')](function(_0x1b7b54){if(_0x1b7b54){if(_0x2c80bf){var _0x5f14cb=null;for(var _0x5b9b67=0x1;_0x5b9b67<_0x7cea0b[_0x96aa('0x7e')][_0x96aa('0x3f')];++_0x5b9b67){_0x5f14cb=_0x7cea0b[_0x96aa('0x7e')][_0x5b9b67];var _0x59f6eb=_0x5f14cb[_0x96aa('0x66')]?util[_0x96aa('0x7a')](_0x96aa('0x81'),_0x548ea2[_0x96aa('0x82')],_0x5f14cb['UserId']):_0x96aa('0x83');var _0x302332=_0x16b912[_0x96aa('0x45')][_0x96aa('0x84')]||util[_0x96aa('0x7a')](_0x96aa('0x81'),_0x96aa('0x85'),_0x5f14cb[_0x96aa('0x80')]);switch(_0x548ea2[_0x96aa('0x86')]){case _0x96aa('0x87'):_0x59f6eb=_0x5f14cb[_0x96aa('0x66')]?util[_0x96aa('0x7a')](_0x96aa('0x81'),_0x548ea2[_0x96aa('0x82')],_0x5f14cb['UserId']):_0x96aa('0x83');break;case _0x96aa('0x88'):_0x59f6eb=_0x5f14cb[_0x96aa('0x66')]?_0x5f14cb[_0x96aa('0x7f')][_0x96aa('0x89')]||_0x5f14cb[_0x96aa('0x7f')][_0x96aa('0x8a')]:_0x96aa('0x83');break;case _0x96aa('0x8b'):_0x59f6eb=_0x5f14cb[_0x96aa('0x66')]?_0x5f14cb[_0x96aa('0x7f')][_0x96aa('0x8a')]:'System';break;default:_0x59f6eb=_0x5f14cb[_0x96aa('0x66')]?util[_0x96aa('0x7a')](_0x96aa('0x81'),_0x548ea2[_0x96aa('0x82')],_0x5f14cb[_0x96aa('0x66')]):_0x96aa('0x83');}var _0x146e38=util[_0x96aa('0x7a')](_0x96aa('0x8c'),moment(_0x5f14cb[_0x96aa('0x8d')])[_0x96aa('0x7a')]('MM/DD/YYYY\x20HH:mm:ss'),_0x5f14cb[_0x96aa('0x8e')]==='in'?_0x302332:_0x59f6eb,_0x5f14cb[_0x96aa('0x45')]);if(!_0x5f14cb[_0x96aa('0x8f')]){fs[_0x96aa('0x90')](_0x2c80bf,_0x146e38);}}return db[_0x96aa('0x91')][_0x96aa('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x96aa('0x92'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x96aa('0x93'),'raw':!![]}]}]});}}})['then'](function(_0x34955e){if(!_0x34955e||!_0x34955e['Smtp']||!_0x16b912['body'])return _0x7cea0b;var _0x16eb47=_0x34955e['getSmtpOptions']();return respondWithRpcPromise(_0x96aa('0x94'),_0x96aa('0x95'),{'account':_0x16eb47,'message':{'from':util[_0x96aa('0x7a')]('\x22%s\x22\x20<%s>',_0x34955e[_0x96aa('0x2a')],_0x34955e[_0x96aa('0x4f')]||_0x34955e['Smtp'][_0x96aa('0x38')]),'to':_0x16b912['body'][_0x96aa('0x96')],'subject':_0x96aa('0x97'),'text':util[_0x96aa('0x7a')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x16b912[_0x96aa('0x45')][_0x96aa('0x96')]),'attachments':[{'path':_0x2c80bf}]}})[_0x96aa('0x16')](function(){return _0x7cea0b;})['catch'](function(_0x2750b3){logger['error'](_0x2750b3);});})[_0x96aa('0x16')](respondWithStatusCode(_0x306a08,0xc8))[_0x96aa('0x1e')](handleError(_0x306a08,null));};exports[_0x96aa('0x98')]=function(_0x370d78,_0x517b6f){return db[_0x96aa('0x5e')]['find']({'where':{'id':_0x370d78[_0x96aa('0x3a')]['id']}})[_0x96aa('0x16')](handleEntityNotFound(_0x517b6f,null))[_0x96aa('0x16')](function(_0xeca101){if(_0xeca101){return _0xeca101[_0x96aa('0x98')](_0x370d78['body'][_0x96aa('0x99')],_[_0x96aa('0x9a')](_0x370d78[_0x96aa('0x45')],['ids','id'])||{});}})[_0x96aa('0x16')](respondWithResult(_0x517b6f,null))['catch'](handleError(_0x517b6f,null));};exports['getMessages']=function(_0x355011,_0x4c555c){var _0xdb1ccd={'raw':![],'where':{}};var _0x4340db={};var _0x1a3f45={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x96aa('0x48')]({'where':{'id':_0x355011['params']['id']}})[_0x96aa('0x16')](handleEntityNotFound(_0x4c555c,null))[_0x96aa('0x16')](function(_0x1e2d8a){if(_0x1e2d8a){_0x4340db[_0x96aa('0x40')]=_[_0x96aa('0x3b')](db[_0x96aa('0x5e')][_0x96aa('0x9b')]);_0x4340db[_0x96aa('0x37')]=_[_0x96aa('0x3b')](_0x355011['query']);_0x4340db['filters']=_[_0x96aa('0x3c')](_0x4340db[_0x96aa('0x40')],_0x4340db[_0x96aa('0x37')]);_0xdb1ccd['attributes']=_[_0x96aa('0x3c')](_0x4340db['model'],qs[_0x96aa('0x3d')](_0x355011[_0x96aa('0x37')][_0x96aa('0x3d')]));_0xdb1ccd[_0x96aa('0x3e')]=_0xdb1ccd[_0x96aa('0x3e')][_0x96aa('0x3f')]?_0xdb1ccd[_0x96aa('0x3e')]:_0x4340db[_0x96aa('0x40')];if(!_0x355011[_0x96aa('0x37')]['hasOwnProperty'](_0x96aa('0x9c'))){_0xdb1ccd['limit']=qs[_0x96aa('0x25')](_0x355011[_0x96aa('0x37')][_0x96aa('0x25')]);_0xdb1ccd[_0x96aa('0x24')]=qs['offset'](_0x355011[_0x96aa('0x37')][_0x96aa('0x24')]);}_0xdb1ccd[_0x96aa('0x9d')]=qs[_0x96aa('0x9e')](_0x355011[_0x96aa('0x37')][_0x96aa('0x9e')]);_0xdb1ccd[_0x96aa('0x9f')]=qs['filters'](_[_0x96aa('0xa0')](_0x355011[_0x96aa('0x37')],_0x4340db[_0x96aa('0xa1')]));_0xdb1ccd[_0x96aa('0x9f')]['ChatInteractionId']=_0x1e2d8a['id'];if(_0x355011['query'][_0x96aa('0xa2')]){_0xdb1ccd[_0x96aa('0x9f')]=_['merge'](_0xdb1ccd[_0x96aa('0x9f')],{'$or':_[_0x96aa('0x30')](_0xdb1ccd[_0x96aa('0x3e')],function(_0x445eaa){var _0x598b5d={};_0x598b5d[_0x445eaa]={'$like':'%'+_0x355011['query'][_0x96aa('0xa2')]+'%'};return _0x598b5d;})});}if(_0x355011[_0x96aa('0x37')][_0x96aa('0xa3')]){var _0x502c61=_0x355011[_0x96aa('0x37')]['$gte'][_0x96aa('0xa4')](',');var _0x587df9={};_0x587df9[_0x502c61[0x0]]={'$gte':moment(_0x502c61[0x1])[_0x96aa('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')};_0xdb1ccd['where']=_['merge'](_0xdb1ccd[_0x96aa('0x9f')],_0x587df9);}_0xdb1ccd=_[_0x96aa('0x2d')]({},_0xdb1ccd,_0x355011[_0x96aa('0xa5')]);return db['ChatMessage'][_0x96aa('0x23')]({'where':_0xdb1ccd[_0x96aa('0x9f')]})[_0x96aa('0x16')](function(_0x307abf){_0x1a3f45[_0x96aa('0x23')]=_0x307abf;if(_0x355011['query']['includeAll']){_0xdb1ccd[_0x96aa('0x42')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xdb1ccd);})[_0x96aa('0x16')](function(_0x11c9b5){_0x1a3f45[_0x96aa('0xa6')]=_0x11c9b5;return _0x1a3f45;});}})[_0x96aa('0x16')](respondWithFilteredResult(_0x4c555c,_0xdb1ccd))[_0x96aa('0x1e')](handleError(_0x4c555c,null));};exports[_0x96aa('0xa7')]=function(_0x1e572f,_0x11e9b2){var _0x2c3b25={'where':{}},_0x1a1100={},_0x206933={'count':0x0,'rows':[]};return db[_0x96aa('0x31')]['findOne']({'where':{'id':_0x1e572f[_0x96aa('0x3a')]['id']}})[_0x96aa('0x16')](handleEntityNotFound(_0x11e9b2,null))[_0x96aa('0x16')](function(_0x177b3c){if(_0x177b3c){_0x1a1100[_0x96aa('0x40')]=_[_0x96aa('0x3b')](db['ChatMessage'][_0x96aa('0x9b')]);_0x1a1100[_0x96aa('0x37')]=_[_0x96aa('0x3b')](_0x1e572f['query']);_0x1a1100[_0x96aa('0xa1')]=_[_0x96aa('0x3c')](_0x1a1100[_0x96aa('0x40')],_0x1a1100[_0x96aa('0x37')]);_0x2c3b25[_0x96aa('0x3e')]=_[_0x96aa('0x3c')](_0x1a1100[_0x96aa('0x40')],qs[_0x96aa('0x3d')](_0x1e572f[_0x96aa('0x37')][_0x96aa('0x3d')]));_0x2c3b25[_0x96aa('0x3e')]=_0x2c3b25[_0x96aa('0x3e')][_0x96aa('0x3f')]?_0x2c3b25[_0x96aa('0x3e')]:_0x1a1100[_0x96aa('0x40')];if(!_0x1e572f[_0x96aa('0x37')][_0x96aa('0xa8')]('nolimit')){_0x2c3b25[_0x96aa('0x25')]=qs[_0x96aa('0x25')](_0x1e572f[_0x96aa('0x37')][_0x96aa('0x25')]);_0x2c3b25[_0x96aa('0x24')]=qs[_0x96aa('0x24')](_0x1e572f['query'][_0x96aa('0x24')]);}_0x2c3b25[_0x96aa('0x9d')]=qs[_0x96aa('0x9e')](_0x1e572f[_0x96aa('0x37')]['sort']);_0x2c3b25[_0x96aa('0x9f')]=qs[_0x96aa('0xa1')](_[_0x96aa('0xa0')](_0x1e572f[_0x96aa('0x37')],_0x1a1100['filters']));_0x2c3b25[_0x96aa('0x9f')][_0x96aa('0xa9')]=_0x177b3c['id'];if(_0x1e572f[_0x96aa('0x37')][_0x96aa('0xa2')]){_0x2c3b25[_0x96aa('0x9f')]=_[_0x96aa('0x2d')](_0x2c3b25[_0x96aa('0x9f')],{'$or':_[_0x96aa('0x30')](_0x2c3b25['attributes'],function(_0x3dfe44){var _0x79dfeb={};_0x79dfeb[_0x3dfe44]={'$like':'%'+_0x1e572f['query'][_0x96aa('0xa2')]+'%'};return _0x79dfeb;})});}_0x2c3b25['where'][_0x96aa('0x8f')]=![];if(_0x1e572f[_0x96aa('0x37')]['id']){_0x2c3b25[_0x96aa('0x9f')]['id']={'$gt':_0x1e572f[_0x96aa('0x37')]['id']};}_0x2c3b25=_[_0x96aa('0x2d')]({},_0x2c3b25,_0x1e572f[_0x96aa('0xa5')]);return db[_0x96aa('0x5e')][_0x96aa('0x23')]({'where':_0x2c3b25[_0x96aa('0x9f')]})[_0x96aa('0x16')](function(_0x1bfdf9){_0x206933[_0x96aa('0x23')]=_0x1bfdf9;_0x2c3b25['include']=[];if(_0x1e572f[_0x96aa('0x37')][_0x96aa('0xaa')]){_0x2c3b25[_0x96aa('0x42')][_0x96aa('0xab')]({'model':db[_0x96aa('0x7f')],'as':_0x96aa('0x7f'),'attributes':['id',_0x96aa('0x8a'),'alias']});}if(_0x1e572f[_0x96aa('0x37')]['includeAll']){_0x2c3b25[_0x96aa('0x42')]=[{'all':!![]}];}return db[_0x96aa('0x5e')]['findAll'](_0x2c3b25);})['then'](function(_0x639ee6){_0x206933[_0x96aa('0xa6')]=_0x639ee6;return _0x206933;});}})[_0x96aa('0x16')](respondWithFilteredResult(_0x11e9b2,_0x2c3b25))[_0x96aa('0x1e')](handleError(_0x11e9b2,null));};exports['addTags']=function(_0x3712d1,_0x39a736){return db['ChatInteraction'][_0x96aa('0x43')]({'where':{'id':_0x3712d1[_0x96aa('0x3a')]['id']}})[_0x96aa('0x16')](handleEntityNotFound(_0x39a736,null))[_0x96aa('0x16')](function(_0x1c89bd){if(_0x1c89bd){return _0x1c89bd[_0x96aa('0xac')](_0x3712d1[_0x96aa('0x45')][_0x96aa('0x99')],_[_0x96aa('0x9a')](_0x3712d1[_0x96aa('0x45')],[_0x96aa('0x99'),'id'])||{})[_0x96aa('0xad')](function(){return db[_0x96aa('0xae')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x3712d1['body'][_0x96aa('0x99')]}});})[_0x96aa('0x16')](function(_0xa65318){socket['emit']('chatInteractionTags:save',{'id':Number(_0x3712d1['params']['id']),'tags':_0xa65318||[]});return{'id':Number(_0x3712d1[_0x96aa('0x3a')]['id']),'tags':_0xa65318||[]};});}})[_0x96aa('0x16')](respondWithResult(_0x39a736,null))[_0x96aa('0x1e')](handleError(_0x39a736,null));};exports[_0x96aa('0xaf')]=function(_0x4a7427,_0x26e158){return db[_0x96aa('0x31')]['find']({'where':{'id':_0x4a7427['params']['id']}})[_0x96aa('0x16')](handleEntityNotFound(_0x26e158,null))['then'](function(_0x558398){if(_0x558398){return _0x558398['removeTags'](_0x4a7427[_0x96aa('0x37')][_0x96aa('0x99')]);}})[_0x96aa('0x16')](respondWithStatusCode(_0x26e158,null))[_0x96aa('0x1e')](handleError(_0x26e158,null));};exports['download']=function(_0xb0b1ac,_0x396c8b){var _0x46a96f=moment()[_0x96aa('0xb0')]()['toString']();var _0x1fe22a=path[_0x96aa('0x73')](config['root'],_0x96aa('0xb1'),_0x96aa('0xb2'),_0x96aa('0xb3'));var _0x33dd43=path[_0x96aa('0x73')](config[_0x96aa('0x74')],'server',_0x96aa('0xb2'),_0x96aa('0xb4'));var _0x31bca4=path['join'](_0x1fe22a,_0x46a96f);var _0x1e3476=util[_0x96aa('0x7a')](_0x96aa('0xb5'),_0xb0b1ac[_0x96aa('0x3a')]['id'],_0x46a96f);var _0x4682f6=path[_0x96aa('0x73')](_0x1fe22a,_0x1e3476);var _0x157d8f=[];_0x157d8f[_0x96aa('0xab')]({'model':db[_0x96aa('0x7f')],'as':'User','attributes':['id',_0x96aa('0x8a')],'raw':!![]});_0x157d8f[_0x96aa('0xab')]({'model':db['CmContact'],'as':_0x96aa('0xb6'),'attributes':['id',_0x96aa('0xb7'),_0x96aa('0xb8')],'raw':!![]});if(_0xb0b1ac[_0x96aa('0x37')][_0x96aa('0xb4')]){_0x157d8f[_0x96aa('0xab')]({'model':db['Attachment'],'as':_0x96aa('0xb9'),'raw':!![]});}var _0x8a397b=[{'model':db[_0x96aa('0x5e')],'as':_0x96aa('0x7e'),'attributes':['id',_0x96aa('0x45'),_0x96aa('0x8d'),_0x96aa('0x8e'),_0x96aa('0x8f'),_0x96aa('0xba')],'include':_0x157d8f}];_0x8a397b[_0x96aa('0xab')]({'model':db['ChatWebsite'],'as':_0x96aa('0xbb'),'attributes':['id','name']});_0x8a397b['push']({'model':db['User'],'as':_0x96aa('0xbc'),'attributes':['id',_0x96aa('0x8a')]});return db['ChatInteraction'][_0x96aa('0x43')]({'where':{'id':_0xb0b1ac[_0x96aa('0x3a')]['id']},'include':_0x8a397b})[_0x96aa('0x16')](handleEntityNotFound(_0x396c8b,null))[_0x96aa('0x16')](function(_0x18678b){if(_0x18678b){var _0x20344f=_0x18678b[_0x96aa('0xbd')]({'plain':!![]});fs[_0x96aa('0xbe')](_0x31bca4);var _0x2416f6={'channel':'Chat','account':_0x20344f['Account'][_0x96aa('0x2a')],'agent':_0x20344f['Owner']?_0x20344f[_0x96aa('0xbc')][_0x96aa('0x8a')]:'N.A.','createdAt':moment(_0x20344f[_0x96aa('0x8d')])[_0x96aa('0x7a')](_0x96aa('0xbf'))['toString'](),'closedAt':_0x20344f[_0x96aa('0x70')]?moment(_0x20344f[_0x96aa('0xc0')])[_0x96aa('0x7a')](_0x96aa('0xbf'))[_0x96aa('0xc1')]():'','disposition':_0x20344f['disposition'],'chatInfo':{'browser':_0x20344f[_0x96aa('0xc2')],'os':_0x20344f[_0x96aa('0xc3')],'referer':_0x20344f[_0x96aa('0xc4')],'customerIp':_0x20344f[_0x96aa('0xc5')],'customerPort':_0x20344f[_0x96aa('0xc6')]?_0x20344f[_0x96aa('0xc6')]:'N.A.'},'messages':_(_0x20344f['Messages'])[_0x96aa('0xc7')]()[_0x96aa('0xa2')]({'secret':![]})[_0x96aa('0x30')](function(_0x5a02e8){if(_0x5a02e8[_0x96aa('0xb9')]){var _0x283457=path[_0x96aa('0x73')](_0x33dd43,_0x5a02e8[_0x96aa('0xb9')]['basename']);if(fs[_0x96aa('0xc8')](_0x283457)){fs[_0x96aa('0xc9')](_0x283457)[_0x96aa('0xca')](fs['createWriteStream'](path['join'](_0x31bca4,_0x5a02e8[_0x96aa('0xb9')][_0x96aa('0x6c')])));}}return{'date':moment(_0x5a02e8['createdAt'])[_0x96aa('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x96aa('0xc1')](),'sender':_0x5a02e8[_0x96aa('0x8e')]==='out'?_0x5a02e8['User']?_0x5a02e8[_0x96aa('0x7f')][_0x96aa('0x8a')]:_0x96aa('0x83'):_0x5a02e8[_0x96aa('0xb6')][_0x96aa('0xb7')]+(_0x5a02e8[_0x96aa('0xb6')][_0x96aa('0xb8')]?'\x20'+_0x5a02e8['Contact'][_0x96aa('0xb8')]:''),'body':_0x5a02e8['Attachment']?_0x5a02e8['Attachment'][_0x96aa('0x6c')]:_0x5a02e8[_0x96aa('0x45')],'direction':_0x5a02e8[_0x96aa('0x8e')]===_0x96aa('0x5d')?'A':'C','secret':_0x5a02e8[_0x96aa('0x8f')],'read':_0x5a02e8[_0x96aa('0xba')],'attachment':_0x5a02e8['Attachment']};})['value']()};return ejs[_0x96aa('0xcb')](path[_0x96aa('0x73')](config[_0x96aa('0x74')],_0x96aa('0xb1'),_0x96aa('0xcc'),_0x96aa('0xcd')),{'interaction':_0x2416f6})[_0x96aa('0x16')](function(_0x4d5abf){var _0x47c9c2=path[_0x96aa('0x73')](_0x31bca4,_0x96aa('0xce')+_0x20344f['id']+'-'+_0x46a96f+_0x96aa('0xcf'));var _0x193d74={'path':_0x47c9c2,'channel':_0x96aa('0xd0'),'interactionId':_0x20344f['id']};return pdf[_0x96aa('0xd1')](_0x4d5abf,_0x193d74);})[_0x96aa('0x16')](function(){return new Promise(function(_0x5ac22c,_0x452066){zipdir(_0x31bca4,{'saveTo':_0x4682f6},function(_0x500e4f,_0x2fb966){if(_0x500e4f)return _0x452066(_0x500e4f);return _0x5ac22c(_0x2fb966);});})[_0x96aa('0x16')](function(){return new BPromise(function(_0x5ae545,_0x4f7a71){rimraf(_0x31bca4,function(_0x7f2e41){if(_0x7f2e41)_0x4f7a71(_0x7f2e41);return _0x5ae545();});});})['then'](function(){return _0x396c8b[_0x96aa('0x77')](_0x4682f6,_0x1e3476,function(_0x598c4c){if(_0x598c4c){logger[_0x96aa('0x1b')]('err',_0x598c4c);}else{fs[_0x96aa('0xd2')](_0x4682f6);}});});});}else{return _0x396c8b['sendStatus'](0xc8);}})[_0x96aa('0x1e')](handleError(_0x396c8b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index a786655..299864f 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 _0x231c=['setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x231c,0x108));var _0xc231=function(_0x15efa4,_0x24ceee){_0x15efa4=_0x15efa4-0x0;var _0x5be56d=_0x231c[_0x15efa4];return _0x5be56d;};'use strict';var EventEmitter=require(_0xc231('0x0'));var ChatInteraction=require(_0xc231('0x1'))['db'][_0xc231('0x2')];var ChatMessage=require(_0xc231('0x1'))['db'][_0xc231('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc231('0x4')](0x0);var events={'afterCreate':_0xc231('0x5'),'afterUpdate':'update','afterDestroy':_0xc231('0x6')};function emitEvent(_0x361ac4){return function(_0x1bf252,_0x16c721,_0x43706b){_0x1bf252['getUsers']({'attributes':['id'],'raw':!![]})[_0xc231('0x7')](function(_0x16c5cb){_0x1bf252[_0xc231('0x8')](_0xc231('0x9'),_0x16c5cb[_0xc231('0xa')](function(_0x27293b){return{'id':_0x27293b['id']};}));return ChatMessage[_0xc231('0xb')]({'where':{'ChatInteractionId':_0x1bf252['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1a0f39){_0x1bf252[_0xc231('0x8')](_0xc231('0xc'),_0x1a0f39['length']);ChatInteractionEvents[_0xc231('0xd')](_0x361ac4+':'+_0x1bf252['id'],_0x1bf252);ChatInteractionEvents[_0xc231('0xd')](_0x361ac4,_0x1bf252);_0x43706b(null);})[_0xc231('0xe')](_0x43706b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xc231('0xf')](e,emitEvent(event));}}module[_0xc231('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xe33f=['emit','catch','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x16f6ca,_0x51447c){var _0x3f87f6=function(_0x145dcb){while(--_0x145dcb){_0x16f6ca['push'](_0x16f6ca['shift']());}};_0x3f87f6(++_0x51447c);}(_0xe33f,0x136));var _0xfe33=function(_0x31c6a2,_0x3bf8b3){_0x31c6a2=_0x31c6a2-0x0;var _0xe87acb=_0xe33f[_0x31c6a2];return _0xe87acb;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xfe33('0x0'))['db'][_0xfe33('0x1')];var ChatMessage=require(_0xfe33('0x0'))['db'][_0xfe33('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xfe33('0x3')](0x0);var events={'afterCreate':_0xfe33('0x4'),'afterUpdate':_0xfe33('0x5'),'afterDestroy':_0xfe33('0x6')};function emitEvent(_0x3127bb){return function(_0x3af05f,_0x5bc1c4,_0x15c384){_0x3af05f['getUsers']({'attributes':['id'],'raw':!![]})[_0xfe33('0x7')](function(_0x3de6ce){_0x3af05f[_0xfe33('0x8')](_0xfe33('0x9'),_0x3de6ce[_0xfe33('0xa')](function(_0x293bf5){return{'id':_0x293bf5['id']};}));return ChatMessage[_0xfe33('0xb')]({'where':{'ChatInteractionId':_0x3af05f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfe33('0x7')](function(_0x3ada2b){_0x3af05f['setDataValue'](_0xfe33('0xc'),_0x3ada2b[_0xfe33('0xd')]);ChatInteractionEvents[_0xfe33('0xe')](_0x3127bb+':'+_0x3af05f['id'],_0x3af05f);ChatInteractionEvents[_0xfe33('0xe')](_0x3127bb,_0x3af05f);_0x15c384(null);})[_0xfe33('0xf')](_0x15c384(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xfe33('0x10')](e,emitEvent(event));}}module[_0xfe33('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index c81c9cf..3c4e32f 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 _0x6460=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0x42c7b5,_0x3f2ccf){var _0x3919b2=function(_0x2e04c9){while(--_0x2e04c9){_0x42c7b5['push'](_0x42c7b5['shift']());}};_0x3919b2(++_0x3f2ccf);}(_0x6460,0x64));var _0x0646=function(_0x27bd34,_0x54c1c7){_0x27bd34=_0x27bd34-0x0;var _0x5dd8c9=_0x6460[_0x27bd34];return _0x5dd8c9;};'use strict';var _=require(_0x0646('0x0'));var util=require(_0x0646('0x1'));var logger=require(_0x0646('0x2'))(_0x0646('0x3'));var moment=require(_0x0646('0x4'));var BPromise=require('bluebird');var rp=require(_0x0646('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0646('0x6'));var config=require(_0x0646('0x7'));var attributes=require(_0x0646('0x8'));module[_0x0646('0x9')]=function(_0x134e20,_0x36b0fb){return _0x134e20[_0x0646('0xa')]('ChatInteraction',attributes,{'tableName':_0x0646('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ada8e,_0x429148,_0x1f0164){if(_0x1ada8e['changed']('closed')){_0x1ada8e[_0x0646('0xc')]=moment()[_0x0646('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1f0164(null,_0x1ada8e);}},'charset':_0x0646('0xe'),'collate':_0x0646('0xf')});}; \ No newline at end of file +var _0x4acb=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5e7402,_0x193ac9){var _0x53d890=function(_0x6b1f0e){while(--_0x6b1f0e){_0x5e7402['push'](_0x5e7402['shift']());}};_0x53d890(++_0x193ac9);}(_0x4acb,0x9a));var _0xb4ac=function(_0x525b7d,_0x10def3){_0x525b7d=_0x525b7d-0x0;var _0x5c748e=_0x4acb[_0x525b7d];return _0x5c748e;};'use strict';var _=require('lodash');var util=require(_0xb4ac('0x0'));var logger=require(_0xb4ac('0x1'))(_0xb4ac('0x2'));var moment=require(_0xb4ac('0x3'));var BPromise=require(_0xb4ac('0x4'));var rp=require(_0xb4ac('0x5'));var fs=require('fs');var path=require(_0xb4ac('0x6'));var rimraf=require(_0xb4ac('0x7'));var config=require(_0xb4ac('0x8'));var attributes=require(_0xb4ac('0x9'));module[_0xb4ac('0xa')]=function(_0x8854bf,_0x2e6604){return _0x8854bf['define'](_0xb4ac('0xb'),attributes,{'tableName':_0xb4ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6a2959,_0x1e0952,_0x3525bb){if(_0x6a2959[_0xb4ac('0xd')](_0xb4ac('0xe'))){_0x6a2959['closedAt']=moment()[_0xb4ac('0xf')](_0xb4ac('0x10'));}_0x3525bb(null,_0x6a2959);}},'charset':_0xb4ac('0x11'),'collate':_0xb4ac('0x12')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 46a7806..4a12b40 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 _0x1570=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','find','addTags','body'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1570,0xd6));var _0x0157=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x1570[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0157('0x0'));var util=require(_0x0157('0x1'));var moment=require(_0x0157('0x2'));var BPromise=require(_0x0157('0x3'));var rs=require(_0x0157('0x4'));var fs=require('fs');var Redis=require(_0x0157('0x5'));var db=require(_0x0157('0x6'))['db'];var utils=require(_0x0157('0x7'));var logger=require('../../config/logger')(_0x0157('0x8'));var config=require(_0x0157('0x9'));var jayson=require(_0x0157('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0157('0xb')](config['redis'],{'host':_0x0157('0xc'),'port':0x18eb});var socket=require(_0x0157('0xd'))(new Redis(config[_0x0157('0xe')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1309eb,_0x3fbf3a,_0xfc6e06){return new BPromise(function(_0x55b362,_0x3909ba){return client[_0x0157('0xf')](_0x1309eb,_0xfc6e06)[_0x0157('0x10')](function(_0x4e28f9){logger[_0x0157('0x11')](_0x0157('0x12'),_0x3fbf3a,_0x0157('0x13'));logger[_0x0157('0x14')](_0x0157('0x15'),_0x3fbf3a,_0x0157('0x13'),JSON[_0x0157('0x16')](_0x4e28f9));if(_0x4e28f9[_0x0157('0x17')]){if(_0x4e28f9['error'][_0x0157('0x18')]===0x1f4){logger['error'](_0x0157('0x12'),_0x3fbf3a,_0x4e28f9[_0x0157('0x17')]['message']);return _0x3909ba(_0x4e28f9[_0x0157('0x17')]['message']);}logger[_0x0157('0x17')](_0x0157('0x12'),_0x3fbf3a,_0x4e28f9[_0x0157('0x17')][_0x0157('0x19')]);return _0x55b362(_0x4e28f9[_0x0157('0x17')]['message']);}else{logger[_0x0157('0x11')](_0x0157('0x12'),_0x3fbf3a,_0x0157('0x13'));_0x55b362(_0x4e28f9[_0x0157('0x1a')][_0x0157('0x19')]);}})[_0x0157('0x1b')](function(_0x309cf7){logger[_0x0157('0x17')](_0x0157('0x12'),_0x3fbf3a,_0x309cf7);_0x3909ba(_0x309cf7);});});}exports[_0x0157('0x1c')]=function(_0x2c1d29){var _0x51e5ef=this;return new Promise(function(_0xfd4fb6,_0x3cf22c){return db[_0x0157('0x1d')][_0x0157('0x1e')](_0x2c1d29['body'],{'raw':_0x2c1d29['options']?_0x2c1d29[_0x0157('0x1f')][_0x0157('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c1d29[_0x0157('0x1f')]?_0x2c1d29[_0x0157('0x1f')][_0x0157('0x21')]||null:null,'attributes':_0x2c1d29[_0x0157('0x1f')]?_0x2c1d29[_0x0157('0x1f')][_0x0157('0x22')]||null:null,'limit':_0x2c1d29[_0x0157('0x1f')]?_0x2c1d29[_0x0157('0x1f')]['limit']||null:null})[_0x0157('0x10')](function(_0xcb75ab){logger[_0x0157('0x11')]('UpdateChatInteraction',_0x2c1d29);logger[_0x0157('0x14')](_0x0157('0x1c'),_0x2c1d29,JSON[_0x0157('0x16')](_0xcb75ab));_0xfd4fb6(_0xcb75ab);})['catch'](function(_0x2a8249){logger[_0x0157('0x17')](_0x0157('0x1c'),_0x2a8249[_0x0157('0x19')],_0x2c1d29);_0x3cf22c(_0x51e5ef[_0x0157('0x17')](0x1f4,_0x2a8249[_0x0157('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x4a1f3c){return new Promise(function(_0x232cd2,_0x1a6106){return db[_0x0157('0x1d')][_0x0157('0x23')]({'where':_0x4a1f3c[_0x0157('0x1f')]?_0x4a1f3c['options'][_0x0157('0x21')]||null:null})[_0x0157('0x10')](function(_0x1e6dda){if(_0x1e6dda){return _0x1e6dda[_0x0157('0x24')](_0x4a1f3c[_0x0157('0x25')][_0x0157('0x26')],_[_0x0157('0x27')](_0x4a1f3c[_0x0157('0x25')],['ids','id'])||{});}})[_0x0157('0x28')](function(_0x448b81){logger['info'](_0x0157('0x29'),_0x4a1f3c);logger[_0x0157('0x14')]('AddTags',_0x4a1f3c,JSON[_0x0157('0x16')](_0x448b81));_0x232cd2(_0x448b81);})['catch'](function(_0xb0afc8){logger[_0x0157('0x17')](_0x0157('0x29'),_0xb0afc8[_0x0157('0x19')],_0x4a1f3c);_0x1a6106(_this[_0x0157('0x17')](0x1f4,_0xb0afc8[_0x0157('0x19')]));});});}; \ No newline at end of file +var _0x8765=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','code','error','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','options','where','attributes','limit','stringify','AddTagsToChatInteraction','find','body','ids','omit','spread','AddTags','debug'];(function(_0x168466,_0x5f37e5){var _0xcf8a4=function(_0x48cf99){while(--_0x48cf99){_0x168466['push'](_0x168466['shift']());}};_0xcf8a4(++_0x5f37e5);}(_0x8765,0x7e));var _0x5876=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8765[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x5876('0x0'));var util=require(_0x5876('0x1'));var moment=require(_0x5876('0x2'));var BPromise=require(_0x5876('0x3'));var rs=require(_0x5876('0x4'));var fs=require('fs');var Redis=require(_0x5876('0x5'));var db=require(_0x5876('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5876('0x7'));var config=require(_0x5876('0x8'));var jayson=require(_0x5876('0x9'));var client=jayson[_0x5876('0xa')][_0x5876('0xb')]({'port':0x232a});config[_0x5876('0xc')]=_[_0x5876('0xd')](config['redis'],{'host':_0x5876('0xe'),'port':0x18eb});var socket=require(_0x5876('0xf'))(new Redis(config[_0x5876('0xc')]));require(_0x5876('0x10'))[_0x5876('0x11')](socket);function respondWithRpcPromise(_0x201cda,_0x5ca96a,_0x14f43a){return new BPromise(function(_0x32d23c,_0x2b40aa){return client[_0x5876('0x12')](_0x201cda,_0x14f43a)[_0x5876('0x13')](function(_0x33dc43){logger[_0x5876('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x5ca96a,_0x5876('0x15'));logger['debug'](_0x5876('0x16'),_0x5ca96a,'request\x20sent',JSON['stringify'](_0x33dc43));if(_0x33dc43['error']){if(_0x33dc43['error'][_0x5876('0x17')]===0x1f4){logger[_0x5876('0x18')](_0x5876('0x19'),_0x5ca96a,_0x33dc43[_0x5876('0x18')][_0x5876('0x1a')]);return _0x2b40aa(_0x33dc43[_0x5876('0x18')][_0x5876('0x1a')]);}logger[_0x5876('0x18')](_0x5876('0x19'),_0x5ca96a,_0x33dc43['error'][_0x5876('0x1a')]);return _0x32d23c(_0x33dc43[_0x5876('0x18')][_0x5876('0x1a')]);}else{logger[_0x5876('0x14')](_0x5876('0x19'),_0x5ca96a,'request\x20sent');_0x32d23c(_0x33dc43['result'][_0x5876('0x1a')]);}})[_0x5876('0x1b')](function(_0xe7cf54){logger[_0x5876('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5ca96a,_0xe7cf54);_0x2b40aa(_0xe7cf54);});});}exports[_0x5876('0x1c')]=function(_0x58b040){var _0x46ccb5=this;return new Promise(function(_0x160ad4,_0x12588c){return db['ChatInteraction']['update'](_0x58b040['body'],{'raw':_0x58b040[_0x5876('0x1d')]?_0x58b040[_0x5876('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58b040[_0x5876('0x1d')]?_0x58b040['options'][_0x5876('0x1e')]||null:null,'attributes':_0x58b040[_0x5876('0x1d')]?_0x58b040[_0x5876('0x1d')][_0x5876('0x1f')]||null:null,'limit':_0x58b040['options']?_0x58b040[_0x5876('0x1d')][_0x5876('0x20')]||null:null})[_0x5876('0x13')](function(_0x6d30da){logger['info'](_0x5876('0x1c'),_0x58b040);logger['debug']('UpdateChatInteraction',_0x58b040,JSON[_0x5876('0x21')](_0x6d30da));_0x160ad4(_0x6d30da);})[_0x5876('0x1b')](function(_0x43cd80){logger[_0x5876('0x18')](_0x5876('0x1c'),_0x43cd80[_0x5876('0x1a')],_0x58b040);_0x12588c(_0x46ccb5['error'](0x1f4,_0x43cd80[_0x5876('0x1a')]));});});};exports[_0x5876('0x22')]=function(_0x3f8186){return new Promise(function(_0x7b4aeb,_0x31e3df){return db['ChatInteraction'][_0x5876('0x23')]({'where':_0x3f8186['options']?_0x3f8186[_0x5876('0x1d')][_0x5876('0x1e')]||null:null})[_0x5876('0x13')](function(_0x597447){if(_0x597447){return _0x597447['addTags'](_0x3f8186[_0x5876('0x24')][_0x5876('0x25')],_[_0x5876('0x26')](_0x3f8186[_0x5876('0x24')],[_0x5876('0x25'),'id'])||{});}})[_0x5876('0x27')](function(_0x555a48){logger[_0x5876('0x14')](_0x5876('0x28'),_0x3f8186);logger[_0x5876('0x29')](_0x5876('0x28'),_0x3f8186,JSON[_0x5876('0x21')](_0x555a48));_0x7b4aeb(_0x555a48);})[_0x5876('0x1b')](function(_0x1dbea6){logger[_0x5876('0x18')](_0x5876('0x28'),_0x1dbea6['message'],_0x3f8186);_0x31e3df(_this['error'](0x1f4,_0x1dbea6[_0x5876('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index e5227ef..1b67fb4 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 _0xa12e=['remove','emit','register','chatInteraction:'];(function(_0x4c1ab4,_0x1f7d1b){var _0x3bd6fb=function(_0x55498e){while(--_0x55498e){_0x4c1ab4['push'](_0x4c1ab4['shift']());}};_0x3bd6fb(++_0x1f7d1b);}(_0xa12e,0x1bc));var _0xea12=function(_0x5e57aa,_0x5cf040){_0x5e57aa=_0x5e57aa-0x0;var _0x4c376f=_0xa12e[_0x5e57aa];return _0x4c376f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xea12('0x0'),'update'];function createListener(_0x11714c,_0x1eeba1){return function(_0x167c20){_0x1eeba1[_0xea12('0x1')](_0x11714c,_0x167c20);};}function removeListener(_0x125e64,_0x365ba0){return function(){ChatInteractionEvents['removeListener'](_0x125e64,_0x365ba0);};}exports[_0xea12('0x2')]=function(_0x3a4019){for(var _0x57418b=0x0,_0x3bffb1=events['length'];_0x57418b<_0x3bffb1;_0x57418b++){var _0xd4d5b=events[_0x57418b];var _0x7c6ee0=createListener(_0xea12('0x3')+_0xd4d5b,_0x3a4019);ChatInteractionEvents['on'](_0xd4d5b,_0x7c6ee0);}}; \ No newline at end of file +var _0x73f9=['remove','update','emit','removeListener','length','chatInteraction:','save'];(function(_0x16b0c8,_0x51ecb2){var _0x147e60=function(_0x3214e9){while(--_0x3214e9){_0x16b0c8['push'](_0x16b0c8['shift']());}};_0x147e60(++_0x51ecb2);}(_0x73f9,0x1c6));var _0x973f=function(_0x453dc8,_0x4874b6){_0x453dc8=_0x453dc8-0x0;var _0x4c3595=_0x73f9[_0x453dc8];return _0x4c3595;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x973f('0x0'),_0x973f('0x1'),_0x973f('0x2')];function createListener(_0x1e6168,_0x3c7eaf){return function(_0x14cffe){_0x3c7eaf[_0x973f('0x3')](_0x1e6168,_0x14cffe);};}function removeListener(_0x5c85cf,_0x30897a){return function(){ChatInteractionEvents[_0x973f('0x4')](_0x5c85cf,_0x30897a);};}exports['register']=function(_0x4e752d){for(var _0x387c32=0x0,_0x4f09c1=events[_0x973f('0x5')];_0x387c32<_0x4f09c1;_0x387c32++){var _0x48feb6=events[_0x387c32];var _0x5cd408=createListener(_0x973f('0x6')+_0x48feb6,_0x4e752d);ChatInteractionEvents['on'](_0x48feb6,_0x5cd408);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f39cdd3..2e5f19e 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 _0x1fe2=['chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','chatinteraction:addtags','addTags','tracked','chatinteraction:update','put','/:id/custom_update','/:id/abandon','/:id/close','delete'];(function(_0x3c8e85,_0x5b4b57){var _0x4a6ca1=function(_0x483af5){while(--_0x483af5){_0x3c8e85['push'](_0x3c8e85['shift']());}};_0x4a6ca1(++_0x5b4b57);}(_0x1fe2,0x77));var _0x21fe=function(_0x41686c,_0x48149a){_0x41686c=_0x41686c-0x0;var _0x459d7f=_0x1fe2[_0x41686c];return _0x459d7f;};'use strict';var multer=require(_0x21fe('0x0'));var util=require(_0x21fe('0x1'));var path=require(_0x21fe('0x2'));var timeout=require(_0x21fe('0x3'));var express=require(_0x21fe('0x4'));var router=express[_0x21fe('0x5')]();var fs_extra=require(_0x21fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x21fe('0x7'));var config=require(_0x21fe('0x8'));var controller=require(_0x21fe('0x9'));router['get']('/',auth[_0x21fe('0xa')](),controller[_0x21fe('0xb')]);router['get'](_0x21fe('0xc'),auth[_0x21fe('0xa')](),controller[_0x21fe('0xd')]);router[_0x21fe('0xe')](_0x21fe('0xf'),auth[_0x21fe('0x10')](),controller[_0x21fe('0x11')]);router[_0x21fe('0xe')](_0x21fe('0x12'),auth[_0x21fe('0x10')](),controller[_0x21fe('0x13')]);router[_0x21fe('0xe')](_0x21fe('0x14'),auth[_0x21fe('0xa')](),controller[_0x21fe('0x15')]);router[_0x21fe('0xe')](_0x21fe('0x16'),auth[_0x21fe('0x10')](),controller[_0x21fe('0x17')]);router[_0x21fe('0xe')](_0x21fe('0x18'),auth[_0x21fe('0xa')](),controller[_0x21fe('0x19')]);router['post']('/',auth[_0x21fe('0xa')](),controller[_0x21fe('0x1a')]);router[_0x21fe('0x1b')](_0x21fe('0x1c'),auth[_0x21fe('0xa')](),controller[_0x21fe('0x1d')]);var upload=multer({'storage':multer[_0x21fe('0x1e')]({'destination':function(_0x5d8e09,_0x3ca3a2,_0x535749){_0x535749(null,path[_0x21fe('0x1f')](config['root'],_0x21fe('0x20')));},'filename':function(_0xf4099e,_0x511e68,_0x4427e1){_0x4427e1(null,util[_0x21fe('0x21')]('%s-%s',Date[_0x21fe('0x22')](),_0x511e68[_0x21fe('0x23')][_0x21fe('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x21fe('0x1b')](_0x21fe('0x25'),upload[_0x21fe('0x26')](_0x21fe('0x27')),controller[_0x21fe('0x28')]);router[_0x21fe('0x1b')]('/:id/messages',auth[_0x21fe('0x10')](),controller[_0x21fe('0x29')]);router[_0x21fe('0x1b')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x21fe('0x2a'),_0x21fe('0x2b')),controller[_0x21fe('0x2c')]);router['put'](_0x21fe('0xf'),auth[_0x21fe('0xa')](),interaction[_0x21fe('0x2d')](_0x21fe('0x2a'),_0x21fe('0x2e')),controller['update']);router[_0x21fe('0x2f')](_0x21fe('0x30'),controller['customUpdate']);router['put'](_0x21fe('0x31'),auth[_0x21fe('0x10')](),controller['abandon']);router[_0x21fe('0x2f')](_0x21fe('0x32'),controller['close']);router[_0x21fe('0x33')]('/:id',auth[_0x21fe('0xa')](),interaction['tracked']('chat',_0x21fe('0x34')),controller[_0x21fe('0x35')]);router['delete'](_0x21fe('0x36'),auth['isAuthenticated'](),controller[_0x21fe('0x37')]);module[_0x21fe('0x38')]=router; \ No newline at end of file +var _0x2580=['update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','download','create','post','/:id/vidaoo','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update'];(function(_0x1798e1,_0x262b8e){var _0x57a2d9=function(_0x40435e){while(--_0x40435e){_0x1798e1['push'](_0x1798e1['shift']());}};_0x57a2d9(++_0x262b8e);}(_0x2580,0x10f));var _0x0258=function(_0x4fd6e9,_0x34e6d6){_0x4fd6e9=_0x4fd6e9-0x0;var _0x54c5c4=_0x2580[_0x4fd6e9];return _0x54c5c4;};'use strict';var multer=require(_0x0258('0x0'));var util=require(_0x0258('0x1'));var path=require(_0x0258('0x2'));var timeout=require(_0x0258('0x3'));var express=require(_0x0258('0x4'));var router=express['Router']();var fs_extra=require(_0x0258('0x5'));var auth=require(_0x0258('0x6'));var interaction=require(_0x0258('0x7'));var config=require('../../config/environment');var controller=require(_0x0258('0x8'));router[_0x0258('0x9')]('/',auth[_0x0258('0xa')](),controller[_0x0258('0xb')]);router[_0x0258('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0258('0xc')]);router['get'](_0x0258('0xd'),auth[_0x0258('0xe')](),controller[_0x0258('0xf')]);router[_0x0258('0x9')](_0x0258('0x10'),auth[_0x0258('0xe')](),controller['attachmentDownload']);router['get'](_0x0258('0x11'),auth[_0x0258('0xa')](),controller['getMessages']);router[_0x0258('0x9')](_0x0258('0x12'),auth[_0x0258('0xe')](),controller[_0x0258('0x13')]);router[_0x0258('0x9')]('/:id/download',auth[_0x0258('0xa')](),controller[_0x0258('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0258('0x15')]);router[_0x0258('0x16')](_0x0258('0x17'),auth[_0x0258('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4cc3ee,_0x46680a,_0x3a2caa){_0x3a2caa(null,path[_0x0258('0x18')](config[_0x0258('0x19')],_0x0258('0x1a')));},'filename':function(_0x20c580,_0x2f538e,_0x3e4d44){_0x3e4d44(null,util[_0x0258('0x1b')](_0x0258('0x1c'),Date[_0x0258('0x1d')](),_0x2f538e[_0x0258('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x0258('0x1f'),upload['single'](_0x0258('0x20')),controller[_0x0258('0x21')]);router[_0x0258('0x16')](_0x0258('0x11'),auth[_0x0258('0xe')](),controller['addMessage']);router[_0x0258('0x16')](_0x0258('0x22'),auth[_0x0258('0xa')](),interaction[_0x0258('0x23')]('chat',_0x0258('0x24')),controller[_0x0258('0x25')]);router[_0x0258('0x26')](_0x0258('0xd'),auth[_0x0258('0xa')](),interaction[_0x0258('0x23')](_0x0258('0x27'),_0x0258('0x28')),controller[_0x0258('0x29')]);router[_0x0258('0x26')](_0x0258('0x2a'),controller[_0x0258('0x2b')]);router[_0x0258('0x26')](_0x0258('0x2c'),auth[_0x0258('0xe')](),controller[_0x0258('0x2d')]);router[_0x0258('0x26')](_0x0258('0x2e'),controller[_0x0258('0x2f')]);router['delete']('/:id',auth[_0x0258('0xa')](),interaction[_0x0258('0x23')]('chat','chatinteraction:destroy'),controller[_0x0258('0x30')]);router[_0x0258('0x31')](_0x0258('0x22'),auth[_0x0258('0xa')](),controller[_0x0258('0x32')]);module[_0x0258('0x33')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index dfc368e..84a5092 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 _0x2940=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x4d2f19,_0x7911bb){var _0x402a0c=function(_0xd7bd63){while(--_0xd7bd63){_0x4d2f19['push'](_0x4d2f19['shift']());}};_0x402a0c(++_0x7911bb);}(_0x2940,0xfa));var _0x0294=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x2940[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require('sequelize');module[_0x0294('0x0')]={'body':{'type':Sequelize[_0x0294('0x1')](_0x0294('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0294('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0294('0x4')]}}; \ No newline at end of file +var _0x6cf2=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6cf2,0xb8));var _0x26cf=function(_0x438525,_0x16ea09){_0x438525=_0x438525-0x0;var _0x288a50=_0x6cf2[_0x438525];return _0x288a50;};'use strict';var Sequelize=require(_0x26cf('0x0'));module[_0x26cf('0x1')]={'body':{'type':Sequelize['TEXT'](_0x26cf('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x26cf('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x26cf('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9900b90..f449ccd 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 _0x20d2=['sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','fields','length','find','create','body','params','describe','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','get','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','-createdAt','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./chatInternalMessage.socket','register','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order'];(function(_0x5410eb,_0x2731c2){var _0x540dca=function(_0x4b6138){while(--_0x4b6138){_0x5410eb['push'](_0x5410eb['shift']());}};_0x540dca(++_0x2731c2);}(_0x20d2,0x16a));var _0x220d=function(_0x438c88,_0x85b0a3){_0x438c88=_0x438c88-0x0;var _0x5e403a=_0x20d2[_0x438c88];return _0x5e403a;};'use strict';var emlformat=require(_0x220d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x220d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x220d('0x2'));var moment=require(_0x220d('0x3'));var BPromise=require(_0x220d('0x4'));var Mustache=require(_0x220d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x220d('0x6'));var csv=require(_0x220d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x220d('0x8'));var squel=require(_0x220d('0x9'));var crypto=require('crypto');var jsforce=require(_0x220d('0xa'));var deskjs=require(_0x220d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x220d('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x220d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x220d('0xe'));var hardwareService=require(_0x220d('0xf'));var logger=require(_0x220d('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x220d('0x11'));var licenseUtil=require(_0x220d('0x12'));var db=require(_0x220d('0x13'))['db'];config['redis']=_[_0x220d('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x220d('0x15'))(new Redis(config[_0x220d('0x16')]));require(_0x220d('0x17'))[_0x220d('0x18')](socket);function respondWithStatusCode(_0x338f4d,_0x49c2c6){_0x49c2c6=_0x49c2c6||0xcc;return function(_0x36bd02){if(_0x36bd02){return _0x338f4d['sendStatus'](_0x49c2c6);}return _0x338f4d['status'](_0x49c2c6)['end']();};}function respondWithResult(_0x1ef8e9,_0x47faf1){_0x47faf1=_0x47faf1||0xc8;return function(_0x1733a8){if(_0x1733a8){return _0x1ef8e9[_0x220d('0x19')](_0x47faf1)['json'](_0x1733a8);}};}function respondWithFilteredResult(_0x29a0e6,_0x4d8ba9){return function(_0x5336e2){if(_0x5336e2){var _0x242fe5=typeof _0x4d8ba9[_0x220d('0x1a')]===_0x220d('0x1b')&&typeof _0x4d8ba9[_0x220d('0x1c')]==='undefined';var _0x3f8125=_0x5336e2[_0x220d('0x1d')];var _0x1c6f71=_0x242fe5?0x0:_0x4d8ba9[_0x220d('0x1a')];var _0x32338c=_0x242fe5?_0x5336e2[_0x220d('0x1d')]:_0x4d8ba9[_0x220d('0x1a')]+_0x4d8ba9['limit'];var _0x58394e;if(_0x32338c>=_0x3f8125){_0x32338c=_0x3f8125;_0x58394e=0xc8;}else{_0x58394e=0xce;}_0x29a0e6[_0x220d('0x19')](_0x58394e);return _0x29a0e6[_0x220d('0x1e')](_0x220d('0x1f'),_0x1c6f71+'-'+_0x32338c+'/'+_0x3f8125)['json'](_0x5336e2);}return null;};}function patchUpdates(_0x42e232){return function(_0x878c1a){try{jsonpatch[_0x220d('0x20')](_0x878c1a,_0x42e232,!![]);}catch(_0xf7c64){return BPromise['reject'](_0xf7c64);}return _0x878c1a[_0x220d('0x21')]();};}function saveUpdates(_0x2d9fa2,_0x282a33){return function(_0x2a7d65){if(_0x2a7d65){return _0x2a7d65[_0x220d('0x22')](_0x2d9fa2)[_0x220d('0x23')](function(_0x2566cb){return _0x2566cb;});}return null;};}function removeEntity(_0x17cf4f,_0x147648){return function(_0x5e2b62){if(_0x5e2b62){return _0x5e2b62[_0x220d('0x24')]()[_0x220d('0x23')](function(){_0x17cf4f[_0x220d('0x19')](0xcc)[_0x220d('0x25')]();});}};}function handleEntityNotFound(_0x2b3578,_0x56aa65){return function(_0x40d6d2){if(!_0x40d6d2){_0x2b3578['sendStatus'](0x194);}return _0x40d6d2;};}function handleError(_0x5a80b7,_0x4aa7e1){_0x4aa7e1=_0x4aa7e1||0x1f4;return function(_0x4da079){logger[_0x220d('0x26')](_0x4da079['stack']);if(_0x4da079[_0x220d('0x27')]){delete _0x4da079[_0x220d('0x27')];}_0x5a80b7[_0x220d('0x19')](_0x4aa7e1)['send'](_0x4da079);};}exports['index']=function(_0x147d92,_0x3638bd){var _0xb8b10f={},_0x485ab5={},_0x4f81a4={'count':0x0,'rows':[]};var _0x7b706f=_[_0x220d('0x28')](db[_0x220d('0x29')][_0x220d('0x2a')],function(_0x3d07a7){return{'name':_0x3d07a7[_0x220d('0x2b')],'type':_0x3d07a7[_0x220d('0x2c')][_0x220d('0x2d')]};});_0x485ab5[_0x220d('0x2e')]=_[_0x220d('0x28')](_0x7b706f,_0x220d('0x27'));_0x485ab5[_0x220d('0x2f')]=_[_0x220d('0x30')](_0x147d92[_0x220d('0x2f')]);_0x485ab5[_0x220d('0x31')]=_[_0x220d('0x32')](_0x485ab5['model'],_0x485ab5[_0x220d('0x2f')]);_0xb8b10f[_0x220d('0x33')]=_[_0x220d('0x32')](_0x485ab5[_0x220d('0x2e')],qs['fields'](_0x147d92[_0x220d('0x2f')]['fields']));_0xb8b10f['attributes']=_0xb8b10f['attributes']['length']?_0xb8b10f[_0x220d('0x33')]:_0x485ab5['model'];if(!_0x147d92['query']['hasOwnProperty'](_0x220d('0x34'))){_0xb8b10f['limit']=qs[_0x220d('0x1c')](_0x147d92['query'][_0x220d('0x1c')]);_0xb8b10f['offset']=qs[_0x220d('0x1a')](_0x147d92['query'][_0x220d('0x1a')]);}_0xb8b10f[_0x220d('0x35')]=qs[_0x220d('0x36')](_0x147d92['query'][_0x220d('0x36')]);_0xb8b10f[_0x220d('0x37')]=qs[_0x220d('0x31')](_[_0x220d('0x38')](_0x147d92[_0x220d('0x2f')],_0x485ab5['filters']),_0x7b706f);if(_0x147d92[_0x220d('0x2f')][_0x220d('0x39')]){_0xb8b10f[_0x220d('0x37')]=_['merge'](_0xb8b10f['where'],{'$or':_[_0x220d('0x28')](_0x7b706f,function(_0x6fce61){if(_0x6fce61[_0x220d('0x2c')]!==_0x220d('0x3a')){var _0x2fc662={};_0x2fc662[_0x6fce61['name']]={'$like':'%'+_0x147d92[_0x220d('0x2f')][_0x220d('0x39')]+'%'};return _0x2fc662;}})});}_0xb8b10f=_[_0x220d('0x3b')]({},_0xb8b10f,_0x147d92[_0x220d('0x3c')]);var _0x5dd005={'where':_0xb8b10f['where']};return db[_0x220d('0x29')][_0x220d('0x1d')](_0x5dd005)[_0x220d('0x23')](function(_0x57049c){_0x4f81a4[_0x220d('0x1d')]=_0x57049c;if(_0x147d92['query'][_0x220d('0x3d')]){_0xb8b10f[_0x220d('0x3e')]=[{'all':!![]}];}return db[_0x220d('0x29')][_0x220d('0x3f')](_0xb8b10f);})[_0x220d('0x23')](function(_0x5c69ee){_0x4f81a4[_0x220d('0x40')]=_0x5c69ee;return _0x4f81a4;})[_0x220d('0x23')](respondWithFilteredResult(_0x3638bd,_0xb8b10f))[_0x220d('0x41')](handleError(_0x3638bd,null));};exports[_0x220d('0x42')]=function(_0x18885d,_0xb3acbf){var _0x489c8b={'raw':!![],'where':{'id':_0x18885d['params']['id']}},_0x1c48e3={};_0x1c48e3[_0x220d('0x2e')]=_[_0x220d('0x30')](db[_0x220d('0x29')][_0x220d('0x2a')]);_0x1c48e3[_0x220d('0x2f')]=_['keys'](_0x18885d[_0x220d('0x2f')]);_0x1c48e3[_0x220d('0x31')]=_['intersection'](_0x1c48e3['model'],_0x1c48e3[_0x220d('0x2f')]);_0x489c8b[_0x220d('0x33')]=_['intersection'](_0x1c48e3[_0x220d('0x2e')],qs[_0x220d('0x43')](_0x18885d[_0x220d('0x2f')][_0x220d('0x43')]));_0x489c8b['attributes']=_0x489c8b['attributes'][_0x220d('0x44')]?_0x489c8b[_0x220d('0x33')]:_0x1c48e3[_0x220d('0x2e')];if(_0x18885d[_0x220d('0x2f')][_0x220d('0x3d')]){_0x489c8b[_0x220d('0x3e')]=[{'all':!![]}];}_0x489c8b=_[_0x220d('0x3b')]({},_0x489c8b,_0x18885d['options']);return db[_0x220d('0x29')][_0x220d('0x45')](_0x489c8b)[_0x220d('0x23')](handleEntityNotFound(_0xb3acbf,null))[_0x220d('0x23')](respondWithResult(_0xb3acbf,null))['catch'](handleError(_0xb3acbf,null));};exports[_0x220d('0x46')]=function(_0x234c72,_0x469988){return db[_0x220d('0x29')][_0x220d('0x46')](_0x234c72[_0x220d('0x47')],{})[_0x220d('0x23')](respondWithResult(_0x469988,0xc9))['catch'](handleError(_0x469988,null));};exports[_0x220d('0x22')]=function(_0x56c95f,_0x56b984){if(_0x56c95f[_0x220d('0x47')]['id']){delete _0x56c95f[_0x220d('0x47')]['id'];}return db[_0x220d('0x29')][_0x220d('0x45')]({'where':{'id':_0x56c95f[_0x220d('0x48')]['id']}})[_0x220d('0x23')](handleEntityNotFound(_0x56b984,null))[_0x220d('0x23')](saveUpdates(_0x56c95f[_0x220d('0x47')],null))[_0x220d('0x23')](respondWithResult(_0x56b984,null))[_0x220d('0x41')](handleError(_0x56b984,null));};exports[_0x220d('0x24')]=function(_0x5954b1,_0x152d11){return db[_0x220d('0x29')]['find']({'where':{'id':_0x5954b1[_0x220d('0x48')]['id']}})[_0x220d('0x23')](handleEntityNotFound(_0x152d11,null))[_0x220d('0x23')](removeEntity(_0x152d11,null))[_0x220d('0x41')](handleError(_0x152d11,null));};exports[_0x220d('0x49')]=function(_0x276699,_0x37480a){return db['ChatInternalMessage'][_0x220d('0x49')]()[_0x220d('0x23')](respondWithResult(_0x37480a,null))[_0x220d('0x41')](handleError(_0x37480a,null));};function wrapUser(_0xe63de8){return function(_0x1b3597){var _0x26c108=_0xe63de8['get']({'plain':!![]});_0x26c108['messages']=[];if(_0x1b3597){_0x26c108[_0x220d('0x4a')]=_0x1b3597[_0x220d('0x4b')];_0x26c108[_0x220d('0x4c')]=_0x1b3597;}else{_0x26c108[_0x220d('0x4a')]=moment(0x0)[_0x220d('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x26c108['lastMessage']={};}return _0x26c108;};}exports[_0x220d('0x4e')]=function(_0x1a0723,_0x4e8f7e,_0x2877cb){var _0x53bd8a=[];return db[_0x220d('0x4f')][_0x220d('0x3f')]({'where':{'role':[_0x220d('0x50'),_0x220d('0x51'),_0x220d('0x52')]},'attributes':['id',_0x220d('0x53'),'name',_0x220d('0x54'),_0x220d('0x55'),_0x220d('0x56'),_0x220d('0x57'),_0x220d('0x58'),_0x220d('0x59'),_0x220d('0x5a')],'order':qs['sort']('-online'),'include':[{'model':db[_0x220d('0x5b')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x220d('0x23')](function(_0x370092){if(_0x370092){var _0x2cbf61=_0x1a0723[_0x220d('0x52')][_0x220d('0x5c')]({'plain':!![]});if(!_0x2cbf61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cbf61['role']===_0x220d('0x52')){return db['UserProfileSection'][_0x220d('0x45')]({'where':{'name':_0x220d('0x5d'),'userProfileId':_0x2cbf61[_0x220d('0x5e')]},'raw':!![]})['then'](function(_0x64ce91){if(_0x64ce91){if(_0x64ce91[_0x220d('0x5f')]===0x0){return db[_0x220d('0x60')]['findAll']({'where':{'sectionId':_0x64ce91['id']},'raw':!![]})[_0x220d('0x23')](function(_0x463ca1){var _0x5134b9=[];if(_[_0x220d('0x61')](_0x463ca1)){_0x5134b9=_[_0x220d('0x39')](_0x370092,function(_0x1d96e5){if(_0x1d96e5[_0x220d('0x54')]!==_0x220d('0x50')){return _0x1d96e5;}});return _0x5134b9;}else{for(var _0x4bd1de=0x0;_0x4bd1de<_0x370092['length'];_0x4bd1de++){var _0x19d3d4=_0x370092[_0x4bd1de];if(_0x19d3d4['role']===_0x220d('0x50')){var _0x3a0115=_[_0x220d('0x45')](_0x463ca1,function(_0x1f9143){return _0x1f9143[_0x220d('0x62')]===_0x19d3d4['id'];});if(_0x3a0115)_0x5134b9[_0x220d('0x63')](_0x19d3d4);}else{_0x5134b9[_0x220d('0x63')](_0x19d3d4);}}return _0x5134b9;}});}else{return _0x370092;}}else{var _0x3074f8=_[_0x220d('0x39')](_0x370092,function(_0x51f19c){if(_0x51f19c[_0x220d('0x54')]!==_0x220d('0x50')){return _0x51f19c;}});return _0x3074f8;}});}else{return _0x370092;}}})[_0x220d('0x23')](function(_0x51cc7f){var _0x828d90=[];if(_0x51cc7f){_0x53bd8a=_0x51cc7f;for(var _0x1acfbd=0x0;_0x1acfbd<_0x51cc7f[_0x220d('0x44')];_0x1acfbd+=0x1){_0x53bd8a[_0x1acfbd][_0x220d('0x64')]=[];_0x828d90['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x1a0723['user']['id'],_0x51cc7f[_0x1acfbd]['id']],'ToId':[_0x1a0723[_0x220d('0x52')]['id'],_0x51cc7f[_0x1acfbd]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x220d('0x65'),_0x220d('0x66'),'read',_0x220d('0x47')],'order':qs[_0x220d('0x36')](_0x220d('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x51cc7f[_0x1acfbd])));}return BPromise['all'](_0x828d90);}return[];})[_0x220d('0x23')](function(_0x7a68e3){return{'rows':_0x7a68e3,'count':_0x7a68e3[_0x220d('0x44')]};})[_0x220d('0x23')](respondWithResult(_0x4e8f7e,null))[_0x220d('0x41')](handleError(_0x4e8f7e,null));}; \ No newline at end of file +var _0x5b0d=['body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','user','fullname','role','internal','online','showWebBar','-online','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','catch','show','params','rawAttributes','length','options','find','create'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x5b0d,0x8f));var _0xd5b0=function(_0x3dd174,_0x31fcf6){_0x3dd174=_0x3dd174-0x0;var _0x2d0e06=_0x5b0d[_0x3dd174];return _0x2d0e06;};'use strict';var emlformat=require(_0xd5b0('0x0'));var rimraf=require(_0xd5b0('0x1'));var zipdir=require(_0xd5b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5b0('0x3'));var moment=require(_0xd5b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd5b0('0x5'));var util=require(_0xd5b0('0x6'));var path=require('path');var sox=require(_0xd5b0('0x7'));var csv=require('to-csv');var ejs=require(_0xd5b0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5b0('0x9'));var squel=require(_0xd5b0('0xa'));var crypto=require(_0xd5b0('0xb'));var jsforce=require(_0xd5b0('0xc'));var deskjs=require(_0xd5b0('0xd'));var toCsv=require(_0xd5b0('0xe'));var querystring=require('querystring');var Papa=require(_0xd5b0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd5b0('0x10'));var as=require(_0xd5b0('0x11'));var hardwareService=require(_0xd5b0('0x12'));var logger=require(_0xd5b0('0x13'))(_0xd5b0('0x14'));var utils=require(_0xd5b0('0x15'));var config=require(_0xd5b0('0x16'));var licenseUtil=require(_0xd5b0('0x17'));var db=require(_0xd5b0('0x18'))['db'];config[_0xd5b0('0x19')]=_[_0xd5b0('0x1a')](config[_0xd5b0('0x19')],{'host':_0xd5b0('0x1b'),'port':0x18eb});var socket=require(_0xd5b0('0x1c'))(new Redis(config[_0xd5b0('0x19')]));require(_0xd5b0('0x1d'))[_0xd5b0('0x1e')](socket);function respondWithStatusCode(_0x40b3eb,_0x3d44d3){_0x3d44d3=_0x3d44d3||0xcc;return function(_0x25d19d){if(_0x25d19d){return _0x40b3eb[_0xd5b0('0x1f')](_0x3d44d3);}return _0x40b3eb[_0xd5b0('0x20')](_0x3d44d3)[_0xd5b0('0x21')]();};}function respondWithResult(_0x4e2117,_0x5aacdd){_0x5aacdd=_0x5aacdd||0xc8;return function(_0x117b87){if(_0x117b87){return _0x4e2117['status'](_0x5aacdd)[_0xd5b0('0x22')](_0x117b87);}};}function respondWithFilteredResult(_0x5eeb27,_0x360884){return function(_0xec4f0f){if(_0xec4f0f){var _0x3d4661=typeof _0x360884[_0xd5b0('0x23')]===_0xd5b0('0x24')&&typeof _0x360884[_0xd5b0('0x25')]===_0xd5b0('0x24');var _0xad2471=_0xec4f0f[_0xd5b0('0x26')];var _0x570012=_0x3d4661?0x0:_0x360884[_0xd5b0('0x23')];var _0x567861=_0x3d4661?_0xec4f0f['count']:_0x360884[_0xd5b0('0x23')]+_0x360884[_0xd5b0('0x25')];var _0x183d2a;if(_0x567861>=_0xad2471){_0x567861=_0xad2471;_0x183d2a=0xc8;}else{_0x183d2a=0xce;}_0x5eeb27[_0xd5b0('0x20')](_0x183d2a);return _0x5eeb27['set'](_0xd5b0('0x27'),_0x570012+'-'+_0x567861+'/'+_0xad2471)['json'](_0xec4f0f);}return null;};}function patchUpdates(_0x4f469f){return function(_0x49ba3a){try{jsonpatch[_0xd5b0('0x28')](_0x49ba3a,_0x4f469f,!![]);}catch(_0x9d4cb2){return BPromise[_0xd5b0('0x29')](_0x9d4cb2);}return _0x49ba3a[_0xd5b0('0x2a')]();};}function saveUpdates(_0x6a37b,_0x502528){return function(_0x26db0d){if(_0x26db0d){return _0x26db0d[_0xd5b0('0x2b')](_0x6a37b)[_0xd5b0('0x2c')](function(_0x2d81d7){return _0x2d81d7;});}return null;};}function removeEntity(_0xa8ee8f,_0x853bc2){return function(_0x291673){if(_0x291673){return _0x291673[_0xd5b0('0x2d')]()[_0xd5b0('0x2c')](function(){_0xa8ee8f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5713b0,_0x545159){return function(_0x257c0a){if(!_0x257c0a){_0x5713b0[_0xd5b0('0x1f')](0x194);}return _0x257c0a;};}function handleError(_0x896fec,_0x4c543a){_0x4c543a=_0x4c543a||0x1f4;return function(_0x40afd1){logger[_0xd5b0('0x2e')](_0x40afd1[_0xd5b0('0x2f')]);if(_0x40afd1[_0xd5b0('0x30')]){delete _0x40afd1[_0xd5b0('0x30')];}_0x896fec[_0xd5b0('0x20')](_0x4c543a)[_0xd5b0('0x31')](_0x40afd1);};}exports[_0xd5b0('0x32')]=function(_0x59b07c,_0x1a345f){var _0x3918a8={},_0x8df1e9={},_0x369df9={'count':0x0,'rows':[]};var _0x3f5dee=_['map'](db[_0xd5b0('0x33')]['rawAttributes'],function(_0x238812){return{'name':_0x238812[_0xd5b0('0x34')],'type':_0x238812[_0xd5b0('0x35')][_0xd5b0('0x36')]};});_0x8df1e9[_0xd5b0('0x37')]=_[_0xd5b0('0x38')](_0x3f5dee,_0xd5b0('0x30'));_0x8df1e9[_0xd5b0('0x39')]=_[_0xd5b0('0x3a')](_0x59b07c[_0xd5b0('0x39')]);_0x8df1e9[_0xd5b0('0x3b')]=_['intersection'](_0x8df1e9[_0xd5b0('0x37')],_0x8df1e9[_0xd5b0('0x39')]);_0x3918a8[_0xd5b0('0x3c')]=_[_0xd5b0('0x3d')](_0x8df1e9[_0xd5b0('0x37')],qs['fields'](_0x59b07c[_0xd5b0('0x39')][_0xd5b0('0x3e')]));_0x3918a8[_0xd5b0('0x3c')]=_0x3918a8[_0xd5b0('0x3c')]['length']?_0x3918a8['attributes']:_0x8df1e9[_0xd5b0('0x37')];if(!_0x59b07c[_0xd5b0('0x39')][_0xd5b0('0x3f')](_0xd5b0('0x40'))){_0x3918a8[_0xd5b0('0x25')]=qs[_0xd5b0('0x25')](_0x59b07c[_0xd5b0('0x39')][_0xd5b0('0x25')]);_0x3918a8[_0xd5b0('0x23')]=qs[_0xd5b0('0x23')](_0x59b07c['query'][_0xd5b0('0x23')]);}_0x3918a8[_0xd5b0('0x41')]=qs['sort'](_0x59b07c[_0xd5b0('0x39')][_0xd5b0('0x42')]);_0x3918a8[_0xd5b0('0x43')]=qs[_0xd5b0('0x3b')](_[_0xd5b0('0x44')](_0x59b07c['query'],_0x8df1e9[_0xd5b0('0x3b')]),_0x3f5dee);if(_0x59b07c[_0xd5b0('0x39')]['filter']){_0x3918a8[_0xd5b0('0x43')]=_[_0xd5b0('0x45')](_0x3918a8[_0xd5b0('0x43')],{'$or':_['map'](_0x3f5dee,function(_0x386619){if(_0x386619[_0xd5b0('0x35')]!=='VIRTUAL'){var _0x30796e={};_0x30796e[_0x386619[_0xd5b0('0x30')]]={'$like':'%'+_0x59b07c['query'][_0xd5b0('0x46')]+'%'};return _0x30796e;}})});}_0x3918a8=_['merge']({},_0x3918a8,_0x59b07c['options']);var _0x192b69={'where':_0x3918a8[_0xd5b0('0x43')]};return db[_0xd5b0('0x33')]['count'](_0x192b69)[_0xd5b0('0x2c')](function(_0x38f210){_0x369df9[_0xd5b0('0x26')]=_0x38f210;if(_0x59b07c['query'][_0xd5b0('0x47')]){_0x3918a8[_0xd5b0('0x48')]=[{'all':!![]}];}return db[_0xd5b0('0x33')]['findAll'](_0x3918a8);})[_0xd5b0('0x2c')](function(_0x1441a9){_0x369df9['rows']=_0x1441a9;return _0x369df9;})[_0xd5b0('0x2c')](respondWithFilteredResult(_0x1a345f,_0x3918a8))[_0xd5b0('0x49')](handleError(_0x1a345f,null));};exports[_0xd5b0('0x4a')]=function(_0x125c21,_0x3ba8dd){var _0x874285={'raw':!![],'where':{'id':_0x125c21[_0xd5b0('0x4b')]['id']}},_0x565491={};_0x565491[_0xd5b0('0x37')]=_[_0xd5b0('0x3a')](db[_0xd5b0('0x33')][_0xd5b0('0x4c')]);_0x565491[_0xd5b0('0x39')]=_[_0xd5b0('0x3a')](_0x125c21[_0xd5b0('0x39')]);_0x565491[_0xd5b0('0x3b')]=_['intersection'](_0x565491[_0xd5b0('0x37')],_0x565491['query']);_0x874285['attributes']=_[_0xd5b0('0x3d')](_0x565491[_0xd5b0('0x37')],qs[_0xd5b0('0x3e')](_0x125c21[_0xd5b0('0x39')][_0xd5b0('0x3e')]));_0x874285[_0xd5b0('0x3c')]=_0x874285[_0xd5b0('0x3c')][_0xd5b0('0x4d')]?_0x874285[_0xd5b0('0x3c')]:_0x565491[_0xd5b0('0x37')];if(_0x125c21[_0xd5b0('0x39')][_0xd5b0('0x47')]){_0x874285[_0xd5b0('0x48')]=[{'all':!![]}];}_0x874285=_[_0xd5b0('0x45')]({},_0x874285,_0x125c21[_0xd5b0('0x4e')]);return db['ChatInternalMessage'][_0xd5b0('0x4f')](_0x874285)[_0xd5b0('0x2c')](handleEntityNotFound(_0x3ba8dd,null))[_0xd5b0('0x2c')](respondWithResult(_0x3ba8dd,null))[_0xd5b0('0x49')](handleError(_0x3ba8dd,null));};exports[_0xd5b0('0x50')]=function(_0x180861,_0x29d5fb){return db['ChatInternalMessage'][_0xd5b0('0x50')](_0x180861['body'],{})[_0xd5b0('0x2c')](respondWithResult(_0x29d5fb,0xc9))[_0xd5b0('0x49')](handleError(_0x29d5fb,null));};exports[_0xd5b0('0x2b')]=function(_0x39e09a,_0x3d35ea){if(_0x39e09a[_0xd5b0('0x51')]['id']){delete _0x39e09a[_0xd5b0('0x51')]['id'];}return db[_0xd5b0('0x33')]['find']({'where':{'id':_0x39e09a[_0xd5b0('0x4b')]['id']}})[_0xd5b0('0x2c')](handleEntityNotFound(_0x3d35ea,null))[_0xd5b0('0x2c')](saveUpdates(_0x39e09a['body'],null))[_0xd5b0('0x2c')](respondWithResult(_0x3d35ea,null))[_0xd5b0('0x49')](handleError(_0x3d35ea,null));};exports[_0xd5b0('0x2d')]=function(_0x14c5f0,_0x1a5aaa){return db['ChatInternalMessage'][_0xd5b0('0x4f')]({'where':{'id':_0x14c5f0[_0xd5b0('0x4b')]['id']}})[_0xd5b0('0x2c')](handleEntityNotFound(_0x1a5aaa,null))['then'](removeEntity(_0x1a5aaa,null))['catch'](handleError(_0x1a5aaa,null));};exports[_0xd5b0('0x52')]=function(_0x5a100f,_0x2793d9){return db[_0xd5b0('0x33')][_0xd5b0('0x52')]()['then'](respondWithResult(_0x2793d9,null))['catch'](handleError(_0x2793d9,null));};function wrapUser(_0x5c829f){return function(_0x5160ed){var _0x576874=_0x5c829f[_0xd5b0('0x53')]({'plain':!![]});_0x576874[_0xd5b0('0x54')]=[];if(_0x5160ed){_0x576874[_0xd5b0('0x55')]=_0x5160ed[_0xd5b0('0x56')];_0x576874[_0xd5b0('0x57')]=_0x5160ed;}else{_0x576874[_0xd5b0('0x55')]=moment(0x0)['format'](_0xd5b0('0x58'));_0x576874['lastMessage']={};}return _0x576874;};}exports[_0xd5b0('0x59')]=function(_0x5b89ba,_0x578714,_0x345f96){var _0x1c2c83=[];return db[_0xd5b0('0x5a')][_0xd5b0('0x5b')]({'where':{'role':[_0xd5b0('0x5c'),_0xd5b0('0x5d'),_0xd5b0('0x5e')]},'attributes':['id',_0xd5b0('0x5f'),_0xd5b0('0x30'),_0xd5b0('0x60'),'userpic',_0xd5b0('0x61'),_0xd5b0('0x62'),'lastLoginAt','allowmessenger',_0xd5b0('0x63')],'order':qs[_0xd5b0('0x42')](_0xd5b0('0x64')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xd5b0('0x30'),_0xd5b0('0x35')],'through':{'attributes':[]}}]})['then'](function(_0x4bf76d){if(_0x4bf76d){var _0x279e66=_0x5b89ba[_0xd5b0('0x5e')][_0xd5b0('0x53')]({'plain':!![]});if(!_0x279e66)throw new Error(_0xd5b0('0x65'));if(_0x279e66[_0xd5b0('0x60')]==='user'){return db[_0xd5b0('0x66')][_0xd5b0('0x4f')]({'where':{'name':_0xd5b0('0x67'),'userProfileId':_0x279e66[_0xd5b0('0x68')]},'raw':!![]})[_0xd5b0('0x2c')](function(_0x20f321){if(_0x20f321){if(_0x20f321['autoAssociation']===0x0){return db[_0xd5b0('0x69')][_0xd5b0('0x5b')]({'where':{'sectionId':_0x20f321['id']},'raw':!![]})[_0xd5b0('0x2c')](function(_0x23233b){var _0x32fc07=[];if(_['isEmpty'](_0x23233b)){_0x32fc07=_['filter'](_0x4bf76d,function(_0x369d52){if(_0x369d52[_0xd5b0('0x60')]!==_0xd5b0('0x5c')){return _0x369d52;}});return _0x32fc07;}else{for(var _0x1142dd=0x0;_0x1142dd<_0x4bf76d[_0xd5b0('0x4d')];_0x1142dd++){var _0x1e0d8b=_0x4bf76d[_0x1142dd];if(_0x1e0d8b[_0xd5b0('0x60')]===_0xd5b0('0x5c')){var _0x1d2672=_['find'](_0x23233b,function(_0x1b3160){return _0x1b3160[_0xd5b0('0x6a')]===_0x1e0d8b['id'];});if(_0x1d2672)_0x32fc07[_0xd5b0('0x6b')](_0x1e0d8b);}else{_0x32fc07[_0xd5b0('0x6b')](_0x1e0d8b);}}return _0x32fc07;}});}else{return _0x4bf76d;}}else{var _0x4a69d8=_[_0xd5b0('0x46')](_0x4bf76d,function(_0x2975c0){if(_0x2975c0[_0xd5b0('0x60')]!==_0xd5b0('0x5c')){return _0x2975c0;}});return _0x4a69d8;}});}else{return _0x4bf76d;}}})[_0xd5b0('0x2c')](function(_0x527615){var _0x5de861=[];if(_0x527615){_0x1c2c83=_0x527615;for(var _0x1e1a52=0x0;_0x1e1a52<_0x527615[_0xd5b0('0x4d')];_0x1e1a52+=0x1){_0x1c2c83[_0x1e1a52][_0xd5b0('0x54')]=[];_0x5de861[_0xd5b0('0x6b')](db[_0xd5b0('0x33')][_0xd5b0('0x4f')]({'where':{'FromId':[_0x5b89ba[_0xd5b0('0x5e')]['id'],_0x527615[_0x1e1a52]['id']],'ToId':[_0x5b89ba[_0xd5b0('0x5e')]['id'],_0x527615[_0x1e1a52]['id']],'ChatGroupId':null},'attributes':['id',_0xd5b0('0x56'),_0xd5b0('0x6c'),'ToId',_0xd5b0('0x6d'),_0xd5b0('0x51')],'order':qs[_0xd5b0('0x42')](_0xd5b0('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd5b0('0x2c')](wrapUser(_0x527615[_0x1e1a52])));}return BPromise[_0xd5b0('0x6f')](_0x5de861);}return[];})[_0xd5b0('0x2c')](function(_0x49f221){return{'rows':_0x49f221,'count':_0x49f221['length']};})[_0xd5b0('0x2c')](respondWithResult(_0x578714,null))[_0xd5b0('0x49')](handleError(_0x578714,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f503703..a3c81d8 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 _0x1477=['hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit'];(function(_0x15a8e1,_0x21e63d){var _0x185130=function(_0x53fa48){while(--_0x53fa48){_0x15a8e1['push'](_0x15a8e1['shift']());}};_0x185130(++_0x21e63d);}(_0x1477,0x122));var _0x7147=function(_0x44c614,_0x1653e9){_0x44c614=_0x44c614-0x0;var _0x4fcd26=_0x1477[_0x44c614];return _0x4fcd26;};'use strict';var EventEmitter=require(_0x7147('0x0'));var ChatInternalMessage=require(_0x7147('0x1'))['db'][_0x7147('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7147('0x3')](0x0);var events={'afterCreate':_0x7147('0x4'),'afterUpdate':'update','afterDestroy':_0x7147('0x5')};function emitEvent(_0x3187ef){return function(_0x54e57a,_0xdd94cc,_0x3a114e){ChatInternalMessageEvents[_0x7147('0x6')](_0x3187ef+':'+_0x54e57a['id'],_0x54e57a);ChatInternalMessageEvents[_0x7147('0x6')](_0x3187ef,_0x54e57a);_0x3a114e(null);};}for(var e in events){if(events[_0x7147('0x7')](e)){var event=events[e];ChatInternalMessage[_0x7147('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x9f7b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','ChatInternalMessage'];(function(_0x593c1b,_0x35c524){var _0x4e0c07=function(_0x8c0aab){while(--_0x8c0aab){_0x593c1b['push'](_0x593c1b['shift']());}};_0x4e0c07(++_0x35c524);}(_0x9f7b,0x104));var _0xb9f7=function(_0x1e0dac,_0x258cb8){_0x1e0dac=_0x1e0dac-0x0;var _0x397bb2=_0x9f7b[_0x1e0dac];return _0x397bb2;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xb9f7('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb9f7('0x1')](0x0);var events={'afterCreate':_0xb9f7('0x2'),'afterUpdate':_0xb9f7('0x3'),'afterDestroy':_0xb9f7('0x4')};function emitEvent(_0x4722e7){return function(_0x5c8fa2,_0x24d578,_0x34c13c){ChatInternalMessageEvents['emit'](_0x4722e7+':'+_0x5c8fa2['id'],_0x5c8fa2);ChatInternalMessageEvents[_0xb9f7('0x5')](_0x4722e7,_0x5c8fa2);_0x34c13c(null);};}for(var e in events){if(events[_0xb9f7('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb9f7('0x7')](e,emitEvent(event));}}module[_0xb9f7('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 f66f910..e144439 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 _0xe21a=['ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x27203c,_0x675cbd){var _0x38df9c=function(_0x106ba0){while(--_0x106ba0){_0x27203c['push'](_0x27203c['shift']());}};_0x38df9c(++_0x675cbd);}(_0xe21a,0xb8));var _0xae21=function(_0x198b1e,_0xeb7b00){_0x198b1e=_0x198b1e-0x0;var _0x451839=_0xe21a[_0x198b1e];return _0x451839;};'use strict';var _=require(_0xae21('0x0'));var util=require(_0xae21('0x1'));var logger=require(_0xae21('0x2'))(_0xae21('0x3'));var moment=require(_0xae21('0x4'));var BPromise=require(_0xae21('0x5'));var rp=require(_0xae21('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae21('0x7'));var config=require(_0xae21('0x8'));var attributes=require(_0xae21('0x9'));module[_0xae21('0xa')]=function(_0x649880,_0x431224){return _0x649880['define'](_0xae21('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xae21('0xc')});}; \ No newline at end of file +var _0x9245=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x5e410d,_0x4eaf38){var _0xa97676=function(_0x18d8c8){while(--_0x18d8c8){_0x5e410d['push'](_0x5e410d['shift']());}};_0xa97676(++_0x4eaf38);}(_0x9245,0x83));var _0x5924=function(_0x2c5ef0,_0x16008f){_0x2c5ef0=_0x2c5ef0-0x0;var _0x4f0947=_0x9245[_0x2c5ef0];return _0x4f0947;};'use strict';var _=require(_0x5924('0x0'));var util=require('util');var logger=require(_0x5924('0x1'))(_0x5924('0x2'));var moment=require(_0x5924('0x3'));var BPromise=require(_0x5924('0x4'));var rp=require(_0x5924('0x5'));var fs=require('fs');var path=require(_0x5924('0x6'));var rimraf=require(_0x5924('0x7'));var config=require(_0x5924('0x8'));var attributes=require(_0x5924('0x9'));module[_0x5924('0xa')]=function(_0x14d4e5,_0x4615a6){return _0x14d4e5[_0x5924('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x5924('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5924('0xd'),'collate':_0x5924('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 99281fe..356031a 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 _0x8962=['localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x47e899,_0x5dfdaa){var _0x2e27a0=function(_0x4211d4){while(--_0x4211d4){_0x47e899['push'](_0x47e899['shift']());}};_0x2e27a0(++_0x5dfdaa);}(_0x8962,0x1e2));var _0x2896=function(_0x5eb5ba,_0x2b63a8){_0x5eb5ba=_0x5eb5ba-0x0;var _0x3af9a8=_0x8962[_0x5eb5ba];return _0x3af9a8;};'use strict';var _=require('lodash');var util=require(_0x2896('0x0'));var moment=require(_0x2896('0x1'));var BPromise=require(_0x2896('0x2'));var rs=require(_0x2896('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2896('0x4'))['db'];var utils=require(_0x2896('0x5'));var logger=require(_0x2896('0x6'))(_0x2896('0x7'));var config=require(_0x2896('0x8'));var jayson=require(_0x2896('0x9'));var client=jayson['client'][_0x2896('0xa')]({'port':0x232a});config[_0x2896('0xb')]=_['defaults'](config['redis'],{'host':_0x2896('0xc'),'port':0x18eb});var socket=require(_0x2896('0xd'))(new Redis(config[_0x2896('0xb')]));require('./chatInternalMessage.socket')[_0x2896('0xe')](socket);function respondWithRpcPromise(_0x5f15b7,_0x18c576,_0x5cd009){return new BPromise(function(_0x11ed02,_0xf7f8b2){return client[_0x2896('0xf')](_0x5f15b7,_0x5cd009)[_0x2896('0x10')](function(_0x4545e2){logger[_0x2896('0x11')](_0x2896('0x12'),_0x18c576,_0x2896('0x13'));logger[_0x2896('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x18c576,_0x2896('0x13'),JSON['stringify'](_0x4545e2));if(_0x4545e2['error']){if(_0x4545e2[_0x2896('0x15')][_0x2896('0x16')]===0x1f4){logger[_0x2896('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x18c576,_0x4545e2[_0x2896('0x15')][_0x2896('0x17')]);return _0xf7f8b2(_0x4545e2[_0x2896('0x15')][_0x2896('0x17')]);}logger[_0x2896('0x15')](_0x2896('0x12'),_0x18c576,_0x4545e2[_0x2896('0x15')][_0x2896('0x17')]);return _0x11ed02(_0x4545e2[_0x2896('0x15')][_0x2896('0x17')]);}else{logger['info'](_0x2896('0x12'),_0x18c576,_0x2896('0x13'));_0x11ed02(_0x4545e2[_0x2896('0x18')]['message']);}})[_0x2896('0x19')](function(_0x3e30e1){logger[_0x2896('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x18c576,_0x3e30e1);_0xf7f8b2(_0x3e30e1);});});} \ No newline at end of file +var _0xb41c=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb41c,0x167));var _0xcb41=function(_0x5efeb6,_0x411e13){_0x5efeb6=_0x5efeb6-0x0;var _0x4f99a2=_0xb41c[_0x5efeb6];return _0x4f99a2;};'use strict';var _=require(_0xcb41('0x0'));var util=require(_0xcb41('0x1'));var moment=require(_0xcb41('0x2'));var BPromise=require(_0xcb41('0x3'));var rs=require(_0xcb41('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb41('0x5'))['db'];var utils=require(_0xcb41('0x6'));var logger=require(_0xcb41('0x7'))(_0xcb41('0x8'));var config=require(_0xcb41('0x9'));var jayson=require(_0xcb41('0xa'));var client=jayson[_0xcb41('0xb')][_0xcb41('0xc')]({'port':0x232a});config[_0xcb41('0xd')]=_[_0xcb41('0xe')](config[_0xcb41('0xd')],{'host':_0xcb41('0xf'),'port':0x18eb});var socket=require(_0xcb41('0x10'))(new Redis(config[_0xcb41('0xd')]));require(_0xcb41('0x11'))[_0xcb41('0x12')](socket);function respondWithRpcPromise(_0x3341d3,_0x5deadc,_0x1c9f4b){return new BPromise(function(_0x1fd159,_0xbaaeb){return client[_0xcb41('0x13')](_0x3341d3,_0x1c9f4b)[_0xcb41('0x14')](function(_0x4b34ec){logger[_0xcb41('0x15')](_0xcb41('0x16'),_0x5deadc,_0xcb41('0x17'));logger[_0xcb41('0x18')](_0xcb41('0x19'),_0x5deadc,_0xcb41('0x17'),JSON['stringify'](_0x4b34ec));if(_0x4b34ec[_0xcb41('0x1a')]){if(_0x4b34ec[_0xcb41('0x1a')]['code']===0x1f4){logger[_0xcb41('0x1a')](_0xcb41('0x16'),_0x5deadc,_0x4b34ec[_0xcb41('0x1a')][_0xcb41('0x1b')]);return _0xbaaeb(_0x4b34ec[_0xcb41('0x1a')][_0xcb41('0x1b')]);}logger['error'](_0xcb41('0x16'),_0x5deadc,_0x4b34ec[_0xcb41('0x1a')][_0xcb41('0x1b')]);return _0x1fd159(_0x4b34ec[_0xcb41('0x1a')]['message']);}else{logger[_0xcb41('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x5deadc,_0xcb41('0x17'));_0x1fd159(_0x4b34ec[_0xcb41('0x1c')][_0xcb41('0x1b')]);}})[_0xcb41('0x1d')](function(_0x329f30){logger['error'](_0xcb41('0x16'),_0x5deadc,_0x329f30);_0xbaaeb(_0x329f30);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 202dfc4..faeabc0 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 _0xa876=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa876,0xad));var _0x6a87=function(_0x39fa59,_0x2cdd62){_0x39fa59=_0x39fa59-0x0;var _0x66d412=_0xa876[_0x39fa59];return _0x66d412;};'use strict';var ChatInternalMessageEvents=require(_0x6a87('0x0'));var events=[_0x6a87('0x1'),_0x6a87('0x2'),_0x6a87('0x3')];function createListener(_0x28495f,_0x4ecc72){return function(_0x40bd2d){_0x4ecc72['emit'](_0x28495f,_0x40bd2d);};}function removeListener(_0x4d07c7,_0x4c2cc9){return function(){ChatInternalMessageEvents[_0x6a87('0x4')](_0x4d07c7,_0x4c2cc9);};}exports[_0x6a87('0x5')]=function(_0x1c8923){for(var _0x1ebaa6=0x0,_0x2a09ea=events[_0x6a87('0x6')];_0x1ebaa6<_0x2a09ea;_0x1ebaa6++){var _0x343876=events[_0x1ebaa6];var _0x3cbffa=createListener(_0x6a87('0x7')+_0x343876,_0x1c8923);ChatInternalMessageEvents['on'](_0x343876,_0x3cbffa);}}; \ No newline at end of file +var _0x4d5b=['remove','emit','removeListener','length','chatInternalMessage:','save'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x4d5b,0x173));var _0xb4d5=function(_0x5c8c4e,_0x4d25c0){_0x5c8c4e=_0x5c8c4e-0x0;var _0x4056db=_0x4d5b[_0x5c8c4e];return _0x4056db;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xb4d5('0x0'),_0xb4d5('0x1'),'update'];function createListener(_0x455177,_0x34957b){return function(_0x2ff397){_0x34957b[_0xb4d5('0x2')](_0x455177,_0x2ff397);};}function removeListener(_0x1c392c,_0x1f02e3){return function(){ChatInternalMessageEvents[_0xb4d5('0x3')](_0x1c392c,_0x1f02e3);};}exports['register']=function(_0x43c8a7){for(var _0x425d42=0x0,_0x5ca5f7=events[_0xb4d5('0x4')];_0x425d42<_0x5ca5f7;_0x425d42++){var _0x49cbf6=events[_0x425d42];var _0x2dbea9=createListener(_0xb4d5('0x5')+_0x49cbf6,_0x43c8a7);ChatInternalMessageEvents['on'](_0x49cbf6,_0x2dbea9);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 11419fd..48b6153 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 _0xe5dc=['put','/:id','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x150600,_0xd2d67c){var _0x3c754b=function(_0x29fe07){while(--_0x29fe07){_0x150600['push'](_0x150600['shift']());}};_0x3c754b(++_0xd2d67c);}(_0xe5dc,0x16c));var _0xce5d=function(_0x24113f,_0x307a4f){_0x24113f=_0x24113f-0x0;var _0x310533=_0xe5dc[_0x24113f];return _0x310533;};'use strict';var multer=require(_0xce5d('0x0'));var util=require(_0xce5d('0x1'));var path=require(_0xce5d('0x2'));var timeout=require(_0xce5d('0x3'));var express=require('express');var router=express[_0xce5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xce5d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce5d('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xce5d('0x7')]('/',auth[_0xce5d('0x8')](),controller['index']);router[_0xce5d('0x7')](_0xce5d('0x9'),auth[_0xce5d('0x8')](),controller[_0xce5d('0xa')]);router[_0xce5d('0x7')]('/users',auth[_0xce5d('0x8')](),controller['getUsers']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xce5d('0xb')]);router[_0xce5d('0xc')]('/',auth[_0xce5d('0x8')](),controller[_0xce5d('0xd')]);router[_0xce5d('0xe')](_0xce5d('0xf'),controller['update']);router[_0xce5d('0x10')](_0xce5d('0xf'),auth[_0xce5d('0x8')](),controller['destroy']);module[_0xce5d('0x11')]=router; \ No newline at end of file +var _0x7aba=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','describe','/users','isAuthenticated','getUsers','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x7aca28,_0x1b4025){var _0x1e4a6f=function(_0x1b802d){while(--_0x1b802d){_0x7aca28['push'](_0x7aca28['shift']());}};_0x1e4a6f(++_0x1b4025);}(_0x7aba,0xf0));var _0xa7ab=function(_0x1d0178,_0x2a3b8e){_0x1d0178=_0x1d0178-0x0;var _0xb0cd3=_0x7aba[_0x1d0178];return _0xb0cd3;};'use strict';var multer=require(_0xa7ab('0x0'));var util=require(_0xa7ab('0x1'));var path=require(_0xa7ab('0x2'));var timeout=require(_0xa7ab('0x3'));var express=require(_0xa7ab('0x4'));var router=express[_0xa7ab('0x5')]();var fs_extra=require(_0xa7ab('0x6'));var auth=require(_0xa7ab('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa7ab('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xa7ab('0x9')]('/',auth['isAuthenticated'](),controller[_0xa7ab('0xa')]);router[_0xa7ab('0x9')](_0xa7ab('0xb'),auth['isAuthenticated'](),controller[_0xa7ab('0xc')]);router[_0xa7ab('0x9')](_0xa7ab('0xd'),auth[_0xa7ab('0xe')](),controller[_0xa7ab('0xf')]);router[_0xa7ab('0x9')](_0xa7ab('0x10'),auth[_0xa7ab('0xe')](),controller[_0xa7ab('0x11')]);router[_0xa7ab('0x12')]('/',auth[_0xa7ab('0xe')](),controller[_0xa7ab('0x13')]);router['put']('/:id',controller[_0xa7ab('0x14')]);router[_0xa7ab('0x15')]('/:id',auth[_0xa7ab('0xe')](),controller[_0xa7ab('0x16')]);module[_0xa7ab('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 826379a..5f4f0f9 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 _0xefda=['BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize','medium'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xefda,0x96));var _0xaefd=function(_0x564131,_0x21efab){_0x564131=_0x564131-0x0;var _0x5cce1d=_0xefda[_0x564131];return _0x5cce1d;};'use strict';var Sequelize=require(_0xaefd('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xaefd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xaefd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xaefd('0x3')]('in',_0xaefd('0x4')),'defaultValue':_0xaefd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xaefd('0x5')]},'providerName':{'type':Sequelize[_0xaefd('0x6')]},'providerResponse':{'type':Sequelize[_0xaefd('0x7')]}}; \ No newline at end of file +var _0x48bc=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x49cee9,_0x28e9de){var _0x5c896d=function(_0x29a2dd){while(--_0x29a2dd){_0x49cee9['push'](_0x49cee9['shift']());}};_0x5c896d(++_0x28e9de);}(_0x48bc,0x1b6));var _0xc48b=function(_0x3d23c0,_0x484cd8){_0x3d23c0=_0x3d23c0-0x0;var _0x4f3c06=_0x48bc[_0x3d23c0];return _0x4f3c06;};'use strict';var Sequelize=require(_0xc48b('0x0'));module[_0xc48b('0x1')]={'body':{'type':Sequelize[_0xc48b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc48b('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc48b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc48b('0x4')]('in',_0xc48b('0x5')),'defaultValue':_0xc48b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc48b('0x6')]},'providerName':{'type':Sequelize[_0xc48b('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index aeff9d6..4326ea4 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 _0x1bb6=['set','apply','reject','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','ChatMessage','includeAll','include','findAll','rows','show','params','options','create','body','update','find','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteractionId','isNil','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','agent','fullname','email','internal','manual','interface','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','channel','motionChannel','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x341619,_0x253004){var _0x456b54=function(_0x307146){while(--_0x307146){_0x341619['push'](_0x341619['shift']());}};_0x456b54(++_0x253004);}(_0x1bb6,0xcd));var _0x61bb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1bb6[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x61bb('0x0'));var rimraf=require(_0x61bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61bb('0x2'));var rp=require('request-promise');var moment=require(_0x61bb('0x3'));var BPromise=require(_0x61bb('0x4'));var Mustache=require(_0x61bb('0x5'));var util=require(_0x61bb('0x6'));var path=require('path');var sox=require(_0x61bb('0x7'));var csv=require(_0x61bb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x61bb('0x9'));var crypto=require(_0x61bb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x61bb('0xb'));var toCsv=require(_0x61bb('0x8'));var querystring=require('querystring');var Papa=require(_0x61bb('0xc'));var Redis=require('ioredis');var authService=require(_0x61bb('0xd'));var qs=require(_0x61bb('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61bb('0xf'));var logger=require(_0x61bb('0x10'))(_0x61bb('0x11'));var utils=require('../../config/utils');var config=require(_0x61bb('0x12'));var licenseUtil=require(_0x61bb('0x13'));var db=require(_0x61bb('0x14'))['db'];config[_0x61bb('0x15')]=_['defaults'](config['redis'],{'host':_0x61bb('0x16'),'port':0x18eb});var socket=require(_0x61bb('0x17'))(new Redis(config[_0x61bb('0x15')]));require(_0x61bb('0x18'))[_0x61bb('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x61bb('0x1a')][_0x61bb('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x61bb('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2f030a,_0x5b6732,_0x173d9e,_0x5d1266){return new BPromise(function(_0x411ea8,_0x2aa14f){var _0x1f4e3b=_0x5d1266||client;return _0x1f4e3b[_0x61bb('0x1c')](_0x2f030a,_0x173d9e)[_0x61bb('0x1d')](function(_0x2cb75d){logger[_0x61bb('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x5b6732,'request\x20sent');logger[_0x61bb('0x1f')](_0x61bb('0x20'),_0x5b6732,_0x61bb('0x21'),JSON[_0x61bb('0x22')](_0x2cb75d));if(_0x2cb75d[_0x61bb('0x23')]){if(_0x2cb75d[_0x61bb('0x23')][_0x61bb('0x24')]===0x1f4){logger['error'](_0x61bb('0x25'),_0x5b6732,_0x2cb75d['error'][_0x61bb('0x26')]);return _0x2aa14f(_0x2cb75d[_0x61bb('0x23')]['message']);}logger[_0x61bb('0x23')]('ChatMessage,\x20%s,\x20%s',_0x5b6732,_0x2cb75d[_0x61bb('0x23')][_0x61bb('0x26')]);return _0x411ea8(_0x2cb75d['error'][_0x61bb('0x26')]);}else{logger[_0x61bb('0x1e')](_0x61bb('0x25'),_0x5b6732,_0x61bb('0x21'));_0x411ea8(_0x2cb75d[_0x61bb('0x27')][_0x61bb('0x26')]);}})[_0x61bb('0x28')](function(_0x12d6f3){logger[_0x61bb('0x23')](_0x61bb('0x25'),_0x5b6732,_0x12d6f3);_0x2aa14f(_0x12d6f3);});});}function respondWithStatusCode(_0x29dada,_0x5ec4bb){_0x5ec4bb=_0x5ec4bb||0xcc;return function(_0x49118c){if(_0x49118c){return _0x29dada[_0x61bb('0x29')](_0x5ec4bb);}return _0x29dada[_0x61bb('0x2a')](_0x5ec4bb)[_0x61bb('0x2b')]();};}function respondWithResult(_0x25fda4,_0x5c4c50){_0x5c4c50=_0x5c4c50||0xc8;return function(_0x471fc4){if(_0x471fc4){return _0x25fda4['status'](_0x5c4c50)[_0x61bb('0x2c')](_0x471fc4);}};}function respondWithFilteredResult(_0x47a838,_0x24faa0){return function(_0x4be868){if(_0x4be868){var _0x53102f=typeof _0x24faa0[_0x61bb('0x2d')]==='undefined'&&typeof _0x24faa0[_0x61bb('0x2e')]===_0x61bb('0x2f');var _0x4911a8=_0x4be868[_0x61bb('0x30')];var _0x33b38b=_0x53102f?0x0:_0x24faa0[_0x61bb('0x2d')];var _0x18f23a=_0x53102f?_0x4be868[_0x61bb('0x30')]:_0x24faa0[_0x61bb('0x2d')]+_0x24faa0[_0x61bb('0x2e')];var _0x485557;if(_0x18f23a>=_0x4911a8){_0x18f23a=_0x4911a8;_0x485557=0xc8;}else{_0x485557=0xce;}_0x47a838[_0x61bb('0x2a')](_0x485557);return _0x47a838[_0x61bb('0x31')]('Content-Range',_0x33b38b+'-'+_0x18f23a+'/'+_0x4911a8)[_0x61bb('0x2c')](_0x4be868);}return null;};}function patchUpdates(_0x38e3db){return function(_0x35ef0b){try{jsonpatch[_0x61bb('0x32')](_0x35ef0b,_0x38e3db,!![]);}catch(_0x771f51){return BPromise[_0x61bb('0x33')](_0x771f51);}return _0x35ef0b['save']();};}function saveUpdates(_0x47f88e,_0x233257){return function(_0x47dcdd){if(_0x47dcdd){return _0x47dcdd['update'](_0x47f88e)['then'](function(_0x4e6526){return _0x4e6526;});}return null;};}function removeEntity(_0x2e7e04,_0x43748a){return function(_0x1bf9ea){if(_0x1bf9ea){return _0x1bf9ea[_0x61bb('0x34')]()[_0x61bb('0x1d')](function(){_0x2e7e04[_0x61bb('0x2a')](0xcc)[_0x61bb('0x2b')]();});}};}function handleEntityNotFound(_0x13ac06,_0x5aa104){return function(_0x54f92f){if(!_0x54f92f){_0x13ac06[_0x61bb('0x29')](0x194);}return _0x54f92f;};}function handleError(_0x2501e2,_0x36b83c){_0x36b83c=_0x36b83c||0x1f4;return function(_0x67466d){logger[_0x61bb('0x23')](_0x67466d[_0x61bb('0x35')]);if(_0x67466d[_0x61bb('0x36')]){delete _0x67466d['name'];}_0x2501e2['status'](_0x36b83c)[_0x61bb('0x37')](_0x67466d);};}exports['index']=function(_0xa87ff,_0x502898){var _0x3335bd={},_0x844bd2={},_0x1c7e3e={'count':0x0,'rows':[]};var _0x1ea310=_[_0x61bb('0x38')](db['ChatMessage'][_0x61bb('0x39')],function(_0x209e03){return{'name':_0x209e03[_0x61bb('0x3a')],'type':_0x209e03[_0x61bb('0x3b')][_0x61bb('0x3c')]};});_0x844bd2['model']=_['map'](_0x1ea310,_0x61bb('0x36'));_0x844bd2[_0x61bb('0x3d')]=_[_0x61bb('0x3e')](_0xa87ff['query']);_0x844bd2[_0x61bb('0x3f')]=_[_0x61bb('0x40')](_0x844bd2['model'],_0x844bd2[_0x61bb('0x3d')]);_0x3335bd[_0x61bb('0x41')]=_[_0x61bb('0x40')](_0x844bd2[_0x61bb('0x42')],qs[_0x61bb('0x43')](_0xa87ff[_0x61bb('0x3d')][_0x61bb('0x43')]));_0x3335bd[_0x61bb('0x41')]=_0x3335bd[_0x61bb('0x41')][_0x61bb('0x44')]?_0x3335bd[_0x61bb('0x41')]:_0x844bd2['model'];if(!_0xa87ff[_0x61bb('0x3d')]['hasOwnProperty'](_0x61bb('0x45'))){_0x3335bd[_0x61bb('0x2e')]=qs['limit'](_0xa87ff[_0x61bb('0x3d')]['limit']);_0x3335bd[_0x61bb('0x2d')]=qs[_0x61bb('0x2d')](_0xa87ff[_0x61bb('0x3d')][_0x61bb('0x2d')]);}_0x3335bd[_0x61bb('0x46')]=qs[_0x61bb('0x47')](_0xa87ff[_0x61bb('0x3d')][_0x61bb('0x47')]);_0x3335bd[_0x61bb('0x48')]=qs['filters'](_['pick'](_0xa87ff[_0x61bb('0x3d')],_0x844bd2[_0x61bb('0x3f')]),_0x1ea310);if(_0xa87ff[_0x61bb('0x3d')][_0x61bb('0x49')]){_0x3335bd[_0x61bb('0x48')]=_[_0x61bb('0x4a')](_0x3335bd['where'],{'$or':_[_0x61bb('0x38')](_0x1ea310,function(_0x3a9fb8){if(_0x3a9fb8[_0x61bb('0x3b')]!=='VIRTUAL'){var _0x1c795b={};_0x1c795b[_0x3a9fb8['name']]={'$like':'%'+_0xa87ff[_0x61bb('0x3d')][_0x61bb('0x49')]+'%'};return _0x1c795b;}})});}_0x3335bd=_[_0x61bb('0x4a')]({},_0x3335bd,_0xa87ff['options']);var _0x5d08aa={'where':_0x3335bd[_0x61bb('0x48')]};return db[_0x61bb('0x4b')][_0x61bb('0x30')](_0x5d08aa)['then'](function(_0x570de4){_0x1c7e3e[_0x61bb('0x30')]=_0x570de4;if(_0xa87ff[_0x61bb('0x3d')][_0x61bb('0x4c')]){_0x3335bd[_0x61bb('0x4d')]=[{'all':!![]}];}return db[_0x61bb('0x4b')][_0x61bb('0x4e')](_0x3335bd);})[_0x61bb('0x1d')](function(_0x33ff7b){_0x1c7e3e[_0x61bb('0x4f')]=_0x33ff7b;return _0x1c7e3e;})['then'](respondWithFilteredResult(_0x502898,_0x3335bd))[_0x61bb('0x28')](handleError(_0x502898,null));};exports[_0x61bb('0x50')]=function(_0x243427,_0x4164b3){var _0x3fed04={'raw':!![],'where':{'id':_0x243427[_0x61bb('0x51')]['id']}},_0x3c5598={};_0x3c5598[_0x61bb('0x42')]=_[_0x61bb('0x3e')](db[_0x61bb('0x4b')][_0x61bb('0x39')]);_0x3c5598['query']=_[_0x61bb('0x3e')](_0x243427[_0x61bb('0x3d')]);_0x3c5598['filters']=_[_0x61bb('0x40')](_0x3c5598[_0x61bb('0x42')],_0x3c5598[_0x61bb('0x3d')]);_0x3fed04['attributes']=_[_0x61bb('0x40')](_0x3c5598['model'],qs[_0x61bb('0x43')](_0x243427[_0x61bb('0x3d')][_0x61bb('0x43')]));_0x3fed04[_0x61bb('0x41')]=_0x3fed04[_0x61bb('0x41')][_0x61bb('0x44')]?_0x3fed04[_0x61bb('0x41')]:_0x3c5598[_0x61bb('0x42')];if(_0x243427[_0x61bb('0x3d')]['includeAll']){_0x3fed04[_0x61bb('0x4d')]=[{'all':!![]}];}_0x3fed04=_[_0x61bb('0x4a')]({},_0x3fed04,_0x243427[_0x61bb('0x52')]);return db['ChatMessage']['find'](_0x3fed04)[_0x61bb('0x1d')](handleEntityNotFound(_0x4164b3,null))[_0x61bb('0x1d')](respondWithResult(_0x4164b3,null))[_0x61bb('0x28')](handleError(_0x4164b3,null));};exports[_0x61bb('0x53')]=function(_0x53c2b0,_0x36a686){return db[_0x61bb('0x4b')]['create'](_0x53c2b0[_0x61bb('0x54')],{})[_0x61bb('0x1d')](respondWithResult(_0x36a686,0xc9))[_0x61bb('0x28')](handleError(_0x36a686,null));};exports[_0x61bb('0x55')]=function(_0x18660d,_0x2484a1){if(_0x18660d[_0x61bb('0x54')]['id']){delete _0x18660d[_0x61bb('0x54')]['id'];}return db[_0x61bb('0x4b')][_0x61bb('0x56')]({'where':{'id':_0x18660d[_0x61bb('0x51')]['id']}})['then'](handleEntityNotFound(_0x2484a1,null))[_0x61bb('0x1d')](saveUpdates(_0x18660d['body'],null))[_0x61bb('0x1d')](respondWithResult(_0x2484a1,null))['catch'](handleError(_0x2484a1,null));};exports[_0x61bb('0x34')]=function(_0x6e5aa2,_0x101c17){return db[_0x61bb('0x4b')][_0x61bb('0x56')]({'where':{'id':_0x6e5aa2['params']['id']}})[_0x61bb('0x1d')](handleEntityNotFound(_0x101c17,null))[_0x61bb('0x1d')](removeEntity(_0x101c17,null))[_0x61bb('0x28')](handleError(_0x101c17,null));};exports[_0x61bb('0x57')]=function(_0x400a4b,_0x105863){return db[_0x61bb('0x4b')][_0x61bb('0x57')]()['then'](respondWithResult(_0x105863,null))[_0x61bb('0x28')](handleError(_0x105863,null));};var interaction_log=require('../../config/logger')(_0x61bb('0x58'));exports[_0x61bb('0x59')]=function(_0x5460a3,_0x148906,_0x25d712){var _0x582c55={'agent':{},'channel':'chat'};if(_0x5460a3[_0x61bb('0x54')]['id']){delete _0x5460a3[_0x61bb('0x54')]['id'];}_0x5460a3[_0x61bb('0x54')]['read']=!![];_0x5460a3['body'][_0x61bb('0x5a')]=moment()[_0x61bb('0x5b')](_0x61bb('0x5c'));_0x5460a3[_0x61bb('0x54')][_0x61bb('0x5d')]=_0x5460a3['body']['UserId']||_0x5460a3[_0x61bb('0x5e')]['id'];_0x582c55['agent']['id']=_0x5460a3['body']['UserId'];return db[_0x61bb('0x4b')][_0x61bb('0x56')]({'where':{'id':_0x5460a3[_0x61bb('0x51')]['id'],'UserId':null}})[_0x61bb('0x1d')](handleEntityNotFound(_0x148906,null))['then'](saveUpdates(_0x5460a3['body'],null))[_0x61bb('0x1d')](function(_0x3a2fd9){if(_0x3a2fd9){_0x582c55[_0x61bb('0x26')]=_0x3a2fd9['get']({'plain':!![]});return db['ChatInteraction'][_0x61bb('0x56')]({'where':{'id':_0x3a2fd9[_0x61bb('0x5f')]}});}return null;})[_0x61bb('0x1d')](handleEntityNotFound(_0x148906,null))['then'](function(_0x22e4a4){if(_0x22e4a4){return _0x22e4a4['update']({'UserId':_0x5460a3[_0x61bb('0x54')]['UserId'],'read1stAt':_[_0x61bb('0x60')](_0x22e4a4['read1stAt'])?moment()['format'](_0x61bb('0x5c')):undefined});}return null;})[_0x61bb('0x1d')](function(_0x2799e5){if(_0x2799e5){_0x582c55[_0x61bb('0x61')]=_0x2799e5[_0x61bb('0x62')]({'plain':!![]});interaction_log['info'](_0x61bb('0x63'),_0x5460a3[_0x61bb('0x5e')]['id'],_0x5460a3['user'][_0x61bb('0x36')],_0x5460a3['user'][_0x61bb('0x64')],_0x582c55[_0x61bb('0x61')]['id'],_0x5460a3[_0x61bb('0x54')]?JSON[_0x61bb('0x22')](_0x5460a3['body']):'null');return respondWithRpcPromise(_0x61bb('0x65'),_0x61bb('0x66'),_0x582c55);}return null;})[_0x61bb('0x1d')](function(_0x5a9061){var _0x517ffd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a9061[_0x61bb('0x26')][_0x61bb('0x67')];return db[_0x61bb('0x68')]['query'](_0x517ffd,{'type':db[_0x61bb('0x69')]['QueryTypes'][_0x61bb('0x6a')],'raw':!![]})[_0x61bb('0x1d')](function(_0x24c997){return _0x24c997;});})[_0x61bb('0x1d')](function(_0x56b412){if(_0x56b412){_0x582c55[_0x61bb('0x26')][_0x61bb('0x6b')]=_0x56b412[0x0];if(!_0x5460a3[_0x61bb('0x54')][_0x61bb('0x5d')])return;return db['User']['find']({'where':{'id':_0x5460a3[_0x61bb('0x54')][_0x61bb('0x5d')],'role':_0x61bb('0x6c')},'attributes':['id',_0x61bb('0x36'),_0x61bb('0x6d'),_0x61bb('0x6e'),_0x61bb('0x6f')],'raw':!![]});}return null;})[_0x61bb('0x1d')](function(_0x2684b6){if(!_0x2684b6)return null;_0x582c55[_0x61bb('0x26')][_0x61bb('0x6c')]=_0x2684b6;return _0x582c55;})['then'](function(_0x24dba9){if(_0x24dba9){if(_0x5460a3[_0x61bb('0x54')][_0x61bb('0x70')]){_0x582c55[_0x61bb('0x26')][_0x61bb('0x71')]=util[_0x61bb('0x5b')]('SIP/%s',_0x5460a3['user'][_0x61bb('0x36')]);_0x582c55['message']['channel']=_0x582c55['channel'];_0x582c55['message']['motionChannel']=_0x582c55['channel'];_0x582c55[_0x61bb('0x26')]['event']=_0x61bb('0x59');return respondWithRpcPromise('EventManager',_0x61bb('0x72'),{'event':_0x61bb('0x73'),'message':_[_0x61bb('0x4a')](_0x582c55[_0x61bb('0x26')],JSON[_0x61bb('0x74')](_0x582c55[_0x61bb('0x61')][_0x61bb('0x75')]))},client9002)[_0x61bb('0x1d')](function(){return _0x582c55;});}return _0x582c55;}return null;})[_0x61bb('0x1d')](respondWithResult(_0x148906,null))[_0x61bb('0x28')](handleError(_0x148906,null));};var interaction_log=require(_0x61bb('0x10'))(_0x61bb('0x58'));exports['reject']=function(_0x3e4b01,_0x27d65b,_0xffaf87){var _0x358d50={'agent':{},'channel':'chat'};if(_0x3e4b01[_0x61bb('0x54')]['id']){delete _0x3e4b01['body']['id'];}_0x3e4b01[_0x61bb('0x54')][_0x61bb('0x5d')]=_0x3e4b01['body']['UserId']||_0x3e4b01['user']['id'];_0x358d50[_0x61bb('0x6c')]['id']=_0x3e4b01['body']['UserId'];return db[_0x61bb('0x4b')][_0x61bb('0x56')]({'where':{'id':_0x3e4b01[_0x61bb('0x51')]['id'],'UserId':null}})[_0x61bb('0x1d')](handleEntityNotFound(_0x27d65b,null))['then'](function(_0x55c06a){if(_0x55c06a){_0x358d50[_0x61bb('0x26')]=_0x55c06a[_0x61bb('0x62')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x55c06a[_0x61bb('0x5f')]}});}return null;})[_0x61bb('0x1d')](handleEntityNotFound(_0x27d65b,null))[_0x61bb('0x1d')](function(_0x1079e4){if(_0x1079e4){_0x358d50['interaction']=_0x1079e4['get']({'plain':!![]});interaction_log[_0x61bb('0x1e')](_0x61bb('0x76'),_0x3e4b01['user']['id'],_0x3e4b01[_0x61bb('0x5e')]['name'],_0x3e4b01['user'][_0x61bb('0x64')],_0x358d50[_0x61bb('0x61')]['id'],_0x3e4b01['body']?JSON[_0x61bb('0x22')](_0x3e4b01[_0x61bb('0x54')]):_0x61bb('0x77'));return respondWithRpcPromise(_0x61bb('0x78'),_0x61bb('0x79'),_0x358d50);}return null;})[_0x61bb('0x1d')](function(_0x3949a2){var _0x30614f=_0x61bb('0x7a')+_0x3949a2['message'][_0x61bb('0x67')];return db['sequelize'][_0x61bb('0x3d')](_0x30614f,{'type':db[_0x61bb('0x69')][_0x61bb('0x7b')]['SELECT'],'raw':!![]})['then'](function(_0xda309b){return _0xda309b;});})[_0x61bb('0x1d')](function(_0x4ffff1){if(_0x4ffff1){_0x358d50[_0x61bb('0x26')]['contact']=_0x4ffff1[0x0];if(!_0x3e4b01[_0x61bb('0x54')]['UserId'])return;return db['User'][_0x61bb('0x56')]({'where':{'id':_0x3e4b01['body']['UserId'],'role':_0x61bb('0x6c')},'attributes':['id',_0x61bb('0x36'),_0x61bb('0x6d'),_0x61bb('0x6e'),_0x61bb('0x6f')],'raw':!![]});}return null;})[_0x61bb('0x1d')](function(_0x5ded9a){if(!_0x5ded9a)return null;_0x358d50[_0x61bb('0x26')][_0x61bb('0x6c')]=_0x5ded9a;return _0x358d50;})['then'](function(_0x3bd4f2){if(_0x3bd4f2){_0x3bd4f2[_0x61bb('0x26')][_0x61bb('0x71')]=util['format'](_0x61bb('0x7c'),_0x3e4b01[_0x61bb('0x5e')][_0x61bb('0x36')]);_0x3bd4f2[_0x61bb('0x26')]['channel']=_0x358d50[_0x61bb('0x7d')];_0x3bd4f2[_0x61bb('0x26')][_0x61bb('0x7e')]=_0x358d50[_0x61bb('0x7d')];_0x3bd4f2[_0x61bb('0x26')]['event']=_0x61bb('0x33');respondWithRpcPromise(_0x61bb('0x72'),'EventManager',{'event':'rejectmessage','message':_[_0x61bb('0x4a')](_0x358d50['message'],JSON['parse'](_0x358d50[_0x61bb('0x61')][_0x61bb('0x75')]))},client9002);return _0x358d50;}return null;})[_0x61bb('0x1d')](respondWithResult(_0x27d65b,null))[_0x61bb('0x28')](handleError(_0x27d65b,null));}; \ No newline at end of file +var _0x7459=['role','interaction','null','AcceptMessage','acceptMessage','sequelize','SELECT','contact','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','reject','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','User','interface','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','register','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','json','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','ChatInteraction','ChatInteractionId','isNil','read1stAt','user'];(function(_0x4bf83e,_0x429223){var _0x5647c9=function(_0x195bae){while(--_0x195bae){_0x4bf83e['push'](_0x4bf83e['shift']());}};_0x5647c9(++_0x429223);}(_0x7459,0x19e));var _0x9745=function(_0x42e089,_0xb150db){_0x42e089=_0x42e089-0x0;var _0x4a244e=_0x7459[_0x42e089];return _0x4a244e;};'use strict';var emlformat=require(_0x9745('0x0'));var rimraf=require(_0x9745('0x1'));var zipdir=require(_0x9745('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9745('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9745('0x4'));var util=require(_0x9745('0x5'));var path=require(_0x9745('0x6'));var sox=require(_0x9745('0x7'));var csv=require(_0x9745('0x8'));var ejs=require(_0x9745('0x9'));var fs=require('fs');var fs_extra=require(_0x9745('0xa'));var _=require(_0x9745('0xb'));var squel=require(_0x9745('0xc'));var crypto=require('crypto');var jsforce=require(_0x9745('0xd'));var deskjs=require(_0x9745('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9745('0xf'));var Papa=require(_0x9745('0x10'));var Redis=require(_0x9745('0x11'));var authService=require(_0x9745('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9745('0x13'));var hardwareService=require(_0x9745('0x14'));var logger=require(_0x9745('0x15'))(_0x9745('0x16'));var utils=require(_0x9745('0x17'));var config=require(_0x9745('0x18'));var licenseUtil=require(_0x9745('0x19'));var db=require(_0x9745('0x1a'))['db'];config[_0x9745('0x1b')]=_['defaults'](config[_0x9745('0x1b')],{'host':_0x9745('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9745('0x1d'))[_0x9745('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9745('0x1f')][_0x9745('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x9745('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x392173,_0x4c9fa8,_0x3e932c,_0x70a08){return new BPromise(function(_0x618bac,_0x555a0e){var _0x2d4b54=_0x70a08||client;return _0x2d4b54['request'](_0x392173,_0x3e932c)[_0x9745('0x21')](function(_0x2a73cf){logger[_0x9745('0x22')](_0x9745('0x23'),_0x4c9fa8,_0x9745('0x24'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4c9fa8,_0x9745('0x24'),JSON[_0x9745('0x25')](_0x2a73cf));if(_0x2a73cf['error']){if(_0x2a73cf[_0x9745('0x26')][_0x9745('0x27')]===0x1f4){logger['error'](_0x9745('0x23'),_0x4c9fa8,_0x2a73cf[_0x9745('0x26')]['message']);return _0x555a0e(_0x2a73cf[_0x9745('0x26')][_0x9745('0x28')]);}logger['error'](_0x9745('0x23'),_0x4c9fa8,_0x2a73cf[_0x9745('0x26')][_0x9745('0x28')]);return _0x618bac(_0x2a73cf[_0x9745('0x26')][_0x9745('0x28')]);}else{logger[_0x9745('0x22')](_0x9745('0x23'),_0x4c9fa8,_0x9745('0x24'));_0x618bac(_0x2a73cf[_0x9745('0x29')][_0x9745('0x28')]);}})[_0x9745('0x2a')](function(_0x30ff3e){logger[_0x9745('0x26')](_0x9745('0x23'),_0x4c9fa8,_0x30ff3e);_0x555a0e(_0x30ff3e);});});}function respondWithStatusCode(_0x4b38c3,_0x85a6b5){_0x85a6b5=_0x85a6b5||0xcc;return function(_0x441552){if(_0x441552){return _0x4b38c3[_0x9745('0x2b')](_0x85a6b5);}return _0x4b38c3[_0x9745('0x2c')](_0x85a6b5)[_0x9745('0x2d')]();};}function respondWithResult(_0x3119f2,_0x14499f){_0x14499f=_0x14499f||0xc8;return function(_0x1f77ee){if(_0x1f77ee){return _0x3119f2[_0x9745('0x2c')](_0x14499f)['json'](_0x1f77ee);}};}function respondWithFilteredResult(_0x2b2d29,_0x45909f){return function(_0x7d0674){if(_0x7d0674){var _0x2b2717=typeof _0x45909f[_0x9745('0x2e')]===_0x9745('0x2f')&&typeof _0x45909f['limit']===_0x9745('0x2f');var _0x4d784e=_0x7d0674[_0x9745('0x30')];var _0x4763c6=_0x2b2717?0x0:_0x45909f[_0x9745('0x2e')];var _0x5bffe9=_0x2b2717?_0x7d0674['count']:_0x45909f['offset']+_0x45909f[_0x9745('0x31')];var _0x40a268;if(_0x5bffe9>=_0x4d784e){_0x5bffe9=_0x4d784e;_0x40a268=0xc8;}else{_0x40a268=0xce;}_0x2b2d29[_0x9745('0x2c')](_0x40a268);return _0x2b2d29['set']('Content-Range',_0x4763c6+'-'+_0x5bffe9+'/'+_0x4d784e)[_0x9745('0x32')](_0x7d0674);}return null;};}function patchUpdates(_0x2a09e0){return function(_0x2c8e85){try{jsonpatch['apply'](_0x2c8e85,_0x2a09e0,!![]);}catch(_0x4a2a2d){return BPromise['reject'](_0x4a2a2d);}return _0x2c8e85[_0x9745('0x33')]();};}function saveUpdates(_0x45310c,_0x1f5691){return function(_0x4c6a5c){if(_0x4c6a5c){return _0x4c6a5c[_0x9745('0x34')](_0x45310c)['then'](function(_0x3ffa6d){return _0x3ffa6d;});}return null;};}function removeEntity(_0x199957,_0x5879e6){return function(_0x2fc8ac){if(_0x2fc8ac){return _0x2fc8ac[_0x9745('0x35')]()[_0x9745('0x21')](function(){_0x199957[_0x9745('0x2c')](0xcc)[_0x9745('0x2d')]();});}};}function handleEntityNotFound(_0x4970d8,_0x21381e){return function(_0x52d774){if(!_0x52d774){_0x4970d8['sendStatus'](0x194);}return _0x52d774;};}function handleError(_0x213ff3,_0x4f9665){_0x4f9665=_0x4f9665||0x1f4;return function(_0x5267f1){logger[_0x9745('0x26')](_0x5267f1[_0x9745('0x36')]);if(_0x5267f1['name']){delete _0x5267f1[_0x9745('0x37')];}_0x213ff3['status'](_0x4f9665)[_0x9745('0x38')](_0x5267f1);};}exports['index']=function(_0x567af1,_0x5d98c1){var _0x3b7dce={},_0x515fc5={},_0x853af5={'count':0x0,'rows':[]};var _0x2c6327=_[_0x9745('0x39')](db[_0x9745('0x3a')]['rawAttributes'],function(_0x1e9754){return{'name':_0x1e9754[_0x9745('0x3b')],'type':_0x1e9754[_0x9745('0x3c')]['key']};});_0x515fc5['model']=_[_0x9745('0x39')](_0x2c6327,_0x9745('0x37'));_0x515fc5[_0x9745('0x3d')]=_[_0x9745('0x3e')](_0x567af1[_0x9745('0x3d')]);_0x515fc5[_0x9745('0x3f')]=_[_0x9745('0x40')](_0x515fc5[_0x9745('0x41')],_0x515fc5[_0x9745('0x3d')]);_0x3b7dce[_0x9745('0x42')]=_[_0x9745('0x40')](_0x515fc5[_0x9745('0x41')],qs[_0x9745('0x43')](_0x567af1[_0x9745('0x3d')]['fields']));_0x3b7dce[_0x9745('0x42')]=_0x3b7dce[_0x9745('0x42')][_0x9745('0x44')]?_0x3b7dce[_0x9745('0x42')]:_0x515fc5[_0x9745('0x41')];if(!_0x567af1[_0x9745('0x3d')][_0x9745('0x45')]('nolimit')){_0x3b7dce[_0x9745('0x31')]=qs[_0x9745('0x31')](_0x567af1[_0x9745('0x3d')][_0x9745('0x31')]);_0x3b7dce['offset']=qs['offset'](_0x567af1['query'][_0x9745('0x2e')]);}_0x3b7dce[_0x9745('0x46')]=qs[_0x9745('0x47')](_0x567af1[_0x9745('0x3d')][_0x9745('0x47')]);_0x3b7dce['where']=qs['filters'](_['pick'](_0x567af1[_0x9745('0x3d')],_0x515fc5[_0x9745('0x3f')]),_0x2c6327);if(_0x567af1[_0x9745('0x3d')][_0x9745('0x48')]){_0x3b7dce[_0x9745('0x49')]=_[_0x9745('0x4a')](_0x3b7dce[_0x9745('0x49')],{'$or':_[_0x9745('0x39')](_0x2c6327,function(_0x344d69){if(_0x344d69[_0x9745('0x3c')]!=='VIRTUAL'){var _0x344003={};_0x344003[_0x344d69[_0x9745('0x37')]]={'$like':'%'+_0x567af1[_0x9745('0x3d')][_0x9745('0x48')]+'%'};return _0x344003;}})});}_0x3b7dce=_[_0x9745('0x4a')]({},_0x3b7dce,_0x567af1[_0x9745('0x4b')]);var _0x4a8d71={'where':_0x3b7dce[_0x9745('0x49')]};return db['ChatMessage'][_0x9745('0x30')](_0x4a8d71)[_0x9745('0x21')](function(_0x5d3e2d){_0x853af5['count']=_0x5d3e2d;if(_0x567af1['query'][_0x9745('0x4c')]){_0x3b7dce[_0x9745('0x4d')]=[{'all':!![]}];}return db[_0x9745('0x3a')][_0x9745('0x4e')](_0x3b7dce);})[_0x9745('0x21')](function(_0x2fd8c4){_0x853af5[_0x9745('0x4f')]=_0x2fd8c4;return _0x853af5;})['then'](respondWithFilteredResult(_0x5d98c1,_0x3b7dce))[_0x9745('0x2a')](handleError(_0x5d98c1,null));};exports[_0x9745('0x50')]=function(_0x48450e,_0x1ce2ec){var _0x27035a={'raw':!![],'where':{'id':_0x48450e[_0x9745('0x51')]['id']}},_0x301981={};_0x301981[_0x9745('0x41')]=_['keys'](db[_0x9745('0x3a')][_0x9745('0x52')]);_0x301981[_0x9745('0x3d')]=_[_0x9745('0x3e')](_0x48450e[_0x9745('0x3d')]);_0x301981[_0x9745('0x3f')]=_[_0x9745('0x40')](_0x301981[_0x9745('0x41')],_0x301981[_0x9745('0x3d')]);_0x27035a[_0x9745('0x42')]=_[_0x9745('0x40')](_0x301981[_0x9745('0x41')],qs[_0x9745('0x43')](_0x48450e[_0x9745('0x3d')][_0x9745('0x43')]));_0x27035a[_0x9745('0x42')]=_0x27035a['attributes'][_0x9745('0x44')]?_0x27035a[_0x9745('0x42')]:_0x301981['model'];if(_0x48450e['query'][_0x9745('0x4c')]){_0x27035a[_0x9745('0x4d')]=[{'all':!![]}];}_0x27035a=_[_0x9745('0x4a')]({},_0x27035a,_0x48450e[_0x9745('0x4b')]);return db[_0x9745('0x3a')][_0x9745('0x53')](_0x27035a)[_0x9745('0x21')](handleEntityNotFound(_0x1ce2ec,null))[_0x9745('0x21')](respondWithResult(_0x1ce2ec,null))[_0x9745('0x2a')](handleError(_0x1ce2ec,null));};exports['create']=function(_0x5b3c90,_0x25e21f){return db['ChatMessage']['create'](_0x5b3c90[_0x9745('0x54')],{})[_0x9745('0x21')](respondWithResult(_0x25e21f,0xc9))[_0x9745('0x2a')](handleError(_0x25e21f,null));};exports['update']=function(_0x58b1b3,_0x3e67ef){if(_0x58b1b3[_0x9745('0x54')]['id']){delete _0x58b1b3['body']['id'];}return db['ChatMessage']['find']({'where':{'id':_0x58b1b3['params']['id']}})[_0x9745('0x21')](handleEntityNotFound(_0x3e67ef,null))[_0x9745('0x21')](saveUpdates(_0x58b1b3[_0x9745('0x54')],null))[_0x9745('0x21')](respondWithResult(_0x3e67ef,null))['catch'](handleError(_0x3e67ef,null));};exports[_0x9745('0x35')]=function(_0x3ca51b,_0x3e0fd8){return db[_0x9745('0x3a')][_0x9745('0x53')]({'where':{'id':_0x3ca51b['params']['id']}})[_0x9745('0x21')](handleEntityNotFound(_0x3e0fd8,null))[_0x9745('0x21')](removeEntity(_0x3e0fd8,null))['catch'](handleError(_0x3e0fd8,null));};exports[_0x9745('0x55')]=function(_0x4a99ea,_0x4de332){return db[_0x9745('0x3a')][_0x9745('0x55')]()[_0x9745('0x21')](respondWithResult(_0x4de332,null))[_0x9745('0x2a')](handleError(_0x4de332,null));};var interaction_log=require(_0x9745('0x15'))(_0x9745('0x56'));exports[_0x9745('0x57')]=function(_0x4e846e,_0x452dc1,_0x3a0164){var _0x2b3801={'agent':{},'channel':_0x9745('0x58')};if(_0x4e846e['body']['id']){delete _0x4e846e[_0x9745('0x54')]['id'];}_0x4e846e[_0x9745('0x54')][_0x9745('0x59')]=!![];_0x4e846e[_0x9745('0x54')]['readAt']=moment()[_0x9745('0x5a')](_0x9745('0x5b'));_0x4e846e[_0x9745('0x54')][_0x9745('0x5c')]=_0x4e846e[_0x9745('0x54')][_0x9745('0x5c')]||_0x4e846e['user']['id'];_0x2b3801['agent']['id']=_0x4e846e[_0x9745('0x54')][_0x9745('0x5c')];return db[_0x9745('0x3a')][_0x9745('0x53')]({'where':{'id':_0x4e846e['params']['id'],'UserId':null}})[_0x9745('0x21')](handleEntityNotFound(_0x452dc1,null))['then'](saveUpdates(_0x4e846e[_0x9745('0x54')],null))[_0x9745('0x21')](function(_0x3e6a66){if(_0x3e6a66){_0x2b3801[_0x9745('0x28')]=_0x3e6a66['get']({'plain':!![]});return db[_0x9745('0x5d')][_0x9745('0x53')]({'where':{'id':_0x3e6a66[_0x9745('0x5e')]}});}return null;})[_0x9745('0x21')](handleEntityNotFound(_0x452dc1,null))['then'](function(_0x36ba87){if(_0x36ba87){return _0x36ba87['update']({'UserId':_0x4e846e[_0x9745('0x54')][_0x9745('0x5c')],'read1stAt':_[_0x9745('0x5f')](_0x36ba87[_0x9745('0x60')])?moment()['format'](_0x9745('0x5b')):undefined});}return null;})['then'](function(_0x1be5a6){if(_0x1be5a6){_0x2b3801['interaction']=_0x1be5a6['get']({'plain':!![]});interaction_log[_0x9745('0x22')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e846e[_0x9745('0x61')]['id'],_0x4e846e[_0x9745('0x61')][_0x9745('0x37')],_0x4e846e[_0x9745('0x61')][_0x9745('0x62')],_0x2b3801[_0x9745('0x63')]['id'],_0x4e846e[_0x9745('0x54')]?JSON[_0x9745('0x25')](_0x4e846e[_0x9745('0x54')]):_0x9745('0x64'));return respondWithRpcPromise(_0x9745('0x65'),_0x9745('0x66'),_0x2b3801);}return null;})[_0x9745('0x21')](function(_0x209735){var _0x280b15='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x209735[_0x9745('0x28')]['ContactId'];return db[_0x9745('0x67')][_0x9745('0x3d')](_0x280b15,{'type':db['Sequelize']['QueryTypes'][_0x9745('0x68')],'raw':!![]})['then'](function(_0x64ace6){return _0x64ace6;});})[_0x9745('0x21')](function(_0x2490ac){if(_0x2490ac){_0x2b3801[_0x9745('0x28')][_0x9745('0x69')]=_0x2490ac[0x0];if(!_0x4e846e['body'][_0x9745('0x5c')])return;return db['User'][_0x9745('0x53')]({'where':{'id':_0x4e846e['body']['UserId'],'role':_0x9745('0x6a')},'attributes':['id',_0x9745('0x37'),_0x9745('0x6b'),_0x9745('0x6c'),_0x9745('0x6d')],'raw':!![]});}return null;})[_0x9745('0x21')](function(_0x143c49){if(!_0x143c49)return null;_0x2b3801[_0x9745('0x28')][_0x9745('0x6a')]=_0x143c49;return _0x2b3801;})[_0x9745('0x21')](function(_0x4dd960){if(_0x4dd960){if(_0x4e846e['body'][_0x9745('0x6e')]){_0x2b3801[_0x9745('0x28')]['interface']=util[_0x9745('0x5a')](_0x9745('0x6f'),_0x4e846e[_0x9745('0x61')][_0x9745('0x37')]);_0x2b3801['message'][_0x9745('0x70')]=_0x2b3801[_0x9745('0x70')];_0x2b3801['message'][_0x9745('0x71')]=_0x2b3801['channel'];_0x2b3801[_0x9745('0x28')][_0x9745('0x72')]=_0x9745('0x57');return respondWithRpcPromise(_0x9745('0x73'),_0x9745('0x73'),{'event':_0x9745('0x74'),'message':_[_0x9745('0x4a')](_0x2b3801['message'],JSON[_0x9745('0x75')](_0x2b3801[_0x9745('0x63')]['formData']))},client9002)['then'](function(){return _0x2b3801;});}return _0x2b3801;}return null;})[_0x9745('0x21')](respondWithResult(_0x452dc1,null))['catch'](handleError(_0x452dc1,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x9745('0x76')]=function(_0x42d167,_0x53702f,_0x5e05d3){var _0x773890={'agent':{},'channel':_0x9745('0x58')};if(_0x42d167[_0x9745('0x54')]['id']){delete _0x42d167[_0x9745('0x54')]['id'];}_0x42d167[_0x9745('0x54')][_0x9745('0x5c')]=_0x42d167[_0x9745('0x54')][_0x9745('0x5c')]||_0x42d167[_0x9745('0x61')]['id'];_0x773890['agent']['id']=_0x42d167['body']['UserId'];return db[_0x9745('0x3a')]['find']({'where':{'id':_0x42d167[_0x9745('0x51')]['id'],'UserId':null}})[_0x9745('0x21')](handleEntityNotFound(_0x53702f,null))[_0x9745('0x21')](function(_0x4628c5){if(_0x4628c5){_0x773890['message']=_0x4628c5[_0x9745('0x77')]({'plain':!![]});return db[_0x9745('0x5d')][_0x9745('0x53')]({'where':{'id':_0x4628c5[_0x9745('0x5e')]}});}return null;})[_0x9745('0x21')](handleEntityNotFound(_0x53702f,null))[_0x9745('0x21')](function(_0x2854b3){if(_0x2854b3){_0x773890[_0x9745('0x63')]=_0x2854b3[_0x9745('0x77')]({'plain':!![]});interaction_log['info'](_0x9745('0x78'),_0x42d167[_0x9745('0x61')]['id'],_0x42d167['user'][_0x9745('0x37')],_0x42d167['user'][_0x9745('0x62')],_0x773890['interaction']['id'],_0x42d167[_0x9745('0x54')]?JSON[_0x9745('0x25')](_0x42d167['body']):_0x9745('0x64'));return respondWithRpcPromise(_0x9745('0x79'),'rejectMessage',_0x773890);}return null;})['then'](function(_0x464747){var _0x291397=_0x9745('0x7a')+_0x464747[_0x9745('0x28')][_0x9745('0x7b')];return db['sequelize'][_0x9745('0x3d')](_0x291397,{'type':db[_0x9745('0x7c')][_0x9745('0x7d')][_0x9745('0x68')],'raw':!![]})['then'](function(_0x20278b){return _0x20278b;});})[_0x9745('0x21')](function(_0xccc228){if(_0xccc228){_0x773890[_0x9745('0x28')]['contact']=_0xccc228[0x0];if(!_0x42d167[_0x9745('0x54')][_0x9745('0x5c')])return;return db[_0x9745('0x7e')][_0x9745('0x53')]({'where':{'id':_0x42d167[_0x9745('0x54')][_0x9745('0x5c')],'role':_0x9745('0x6a')},'attributes':['id',_0x9745('0x37'),_0x9745('0x6b'),_0x9745('0x6c'),_0x9745('0x6d')],'raw':!![]});}return null;})[_0x9745('0x21')](function(_0x56a8f9){if(!_0x56a8f9)return null;_0x773890[_0x9745('0x28')][_0x9745('0x6a')]=_0x56a8f9;return _0x773890;})[_0x9745('0x21')](function(_0x4d1567){if(_0x4d1567){_0x4d1567[_0x9745('0x28')][_0x9745('0x7f')]=util[_0x9745('0x5a')](_0x9745('0x6f'),_0x42d167[_0x9745('0x61')][_0x9745('0x37')]);_0x4d1567[_0x9745('0x28')][_0x9745('0x70')]=_0x773890[_0x9745('0x70')];_0x4d1567[_0x9745('0x28')][_0x9745('0x71')]=_0x773890['channel'];_0x4d1567[_0x9745('0x28')][_0x9745('0x72')]=_0x9745('0x76');respondWithRpcPromise(_0x9745('0x73'),_0x9745('0x73'),{'event':'rejectmessage','message':_[_0x9745('0x4a')](_0x773890['message'],JSON['parse'](_0x773890['interaction']['formData']))},client9002);return _0x773890;}return null;})[_0x9745('0x21')](respondWithResult(_0x53702f,null))[_0x9745('0x2a')](handleError(_0x53702f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0882435..ecd3891 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 _0x883d=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x1b723d,_0x59458c){var _0x1d03ab=function(_0x3a8b41){while(--_0x3a8b41){_0x1b723d['push'](_0x1b723d['shift']());}};_0x1d03ab(++_0x59458c);}(_0x883d,0x1e9));var _0xd883=function(_0x2fb12a,_0x138d87){_0x2fb12a=_0x2fb12a-0x0;var _0x139dd9=_0x883d[_0x2fb12a];return _0x139dd9;};'use strict';var EventEmitter=require(_0xd883('0x0'));var ChatMessage=require(_0xd883('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd883('0x2')](0x0);var events={'afterCreate':_0xd883('0x3'),'afterUpdate':_0xd883('0x4'),'afterDestroy':_0xd883('0x5')};function emitEvent(_0x312168){return function(_0x2a1969,_0x577d36,_0x17808a){ChatMessageEvents['emit'](_0x312168+':'+_0x2a1969['id'],_0x2a1969);ChatMessageEvents[_0xd883('0x6')](_0x312168,_0x2a1969);_0x17808a(null);};}for(var e in events){if(events[_0xd883('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x9d2a=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9d2a,0x1f2));var _0xa9d2=function(_0x247394,_0x1130c7){_0x247394=_0x247394-0x0;var _0x323f53=_0x9d2a[_0x247394];return _0x323f53;};'use strict';var EventEmitter=require(_0xa9d2('0x0'));var ChatMessage=require(_0xa9d2('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa9d2('0x2')](0x0);var events={'afterCreate':_0xa9d2('0x3'),'afterUpdate':_0xa9d2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fb1df){return function(_0x31495d,_0x4be69c,_0x185760){ChatMessageEvents[_0xa9d2('0x5')](_0x2fb1df+':'+_0x31495d['id'],_0x31495d);ChatMessageEvents[_0xa9d2('0x5')](_0x2fb1df,_0x31495d);_0x185760(null);};}for(var e in events){if(events[_0xa9d2('0x6')](e)){var event=events[e];ChatMessage[_0xa9d2('0x7')](e,emitEvent(event));}}module[_0xa9d2('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 532cfc4..98930b1 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 _0xeee4=['./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeee4,0xfb));var _0x4eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4eee('0x0'));var util=require(_0x4eee('0x1'));var logger=require(_0x4eee('0x2'))(_0x4eee('0x3'));var moment=require(_0x4eee('0x4'));var BPromise=require(_0x4eee('0x5'));var rp=require(_0x4eee('0x6'));var fs=require('fs');var path=require(_0x4eee('0x7'));var rimraf=require(_0x4eee('0x8'));var config=require(_0x4eee('0x9'));var attributes=require(_0x4eee('0xa'));module[_0x4eee('0xb')]=function(_0x3e91b3,_0x551154){return _0x3e91b3['define'](_0x4eee('0xc'),attributes,{'tableName':_0x4eee('0xd'),'paranoid':![],'indexes':[{'name':_0x4eee('0xe'),'fields':['body'],'type':_0x4eee('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x432017,_0x3be091,_0x54a2a2){var _0x5bcce8=_0x3e91b3[_0x4eee('0x10')];var _0x3a7139=_0x432017[_0x4eee('0x11')]({'plain':!![]});if(_0x3a7139[_0x4eee('0x12')][_0x4eee('0x13')]()==='in'||_0x3a7139[_0x4eee('0x12')][_0x4eee('0x13')]()===_0x4eee('0x14')&&!_0x3a7139['secret']&&!_[_0x4eee('0x15')](_0x3a7139[_0x4eee('0x16')])){_0x5bcce8['ChatInteraction'][_0x4eee('0x17')]({'where':{'id':_0x3a7139[_0x4eee('0x18')]}})['then'](function(_0x44a5b4){if(_0x44a5b4){_0x44a5b4['update']({'lastMsgAt':_0x3a7139[_0x4eee('0x19')],'lastMsgDirection':_0x3a7139[_0x4eee('0x12')]['toLowerCase']()});}})[_0x4eee('0x1a')](function(_0x548c23){console[_0x4eee('0x1b')](_0x548c23);});}_0x54a2a2();}},'charset':_0x4eee('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7cca=['findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x43fd38,_0x226b81){var _0x4cb7bd=function(_0x320be6){while(--_0x320be6){_0x43fd38['push'](_0x43fd38['shift']());}};_0x4cb7bd(++_0x226b81);}(_0x7cca,0xff));var _0xa7cc=function(_0x25aec2,_0x23844f){_0x25aec2=_0x25aec2-0x0;var _0x2cd01a=_0x7cca[_0x25aec2];return _0x2cd01a;};'use strict';var _=require(_0xa7cc('0x0'));var util=require(_0xa7cc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa7cc('0x2'));var BPromise=require(_0xa7cc('0x3'));var rp=require(_0xa7cc('0x4'));var fs=require('fs');var path=require(_0xa7cc('0x5'));var rimraf=require(_0xa7cc('0x6'));var config=require(_0xa7cc('0x7'));var attributes=require(_0xa7cc('0x8'));module[_0xa7cc('0x9')]=function(_0x16d9a6,_0xb0f7a7){return _0x16d9a6[_0xa7cc('0xa')](_0xa7cc('0xb'),attributes,{'tableName':_0xa7cc('0xc'),'paranoid':![],'indexes':[{'name':_0xa7cc('0xd'),'fields':[_0xa7cc('0xe')],'type':_0xa7cc('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d706c,_0x1b08de,_0x53013e){var _0x37028e=_0x16d9a6[_0xa7cc('0x10')];var _0x49e266=_0x2d706c[_0xa7cc('0x11')]({'plain':!![]});if(_0x49e266[_0xa7cc('0x12')][_0xa7cc('0x13')]()==='in'||_0x49e266['direction']['toLowerCase']()===_0xa7cc('0x14')&&!_0x49e266[_0xa7cc('0x15')]&&!_[_0xa7cc('0x16')](_0x49e266[_0xa7cc('0x17')])){_0x37028e['ChatInteraction'][_0xa7cc('0x18')]({'where':{'id':_0x49e266[_0xa7cc('0x19')]}})['then'](function(_0x1e0f02){if(_0x1e0f02){_0x1e0f02[_0xa7cc('0x1a')]({'lastMsgAt':_0x49e266[_0xa7cc('0x1b')],'lastMsgDirection':_0x49e266['direction'][_0xa7cc('0x13')]()});}})[_0xa7cc('0x1c')](function(_0x590ced){console[_0xa7cc('0x1d')](_0x590ced);});}_0x53013e();}},'charset':_0xa7cc('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index aa4987e..8c4ffd3 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 _0x1838=['options','raw','CreateChatMessage','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','register','request','then','debug','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','result','catch','ChatMessage','create','body'];(function(_0x22cbe7,_0x42212d){var _0x21fb3b=function(_0x166de1){while(--_0x166de1){_0x22cbe7['push'](_0x22cbe7['shift']());}};_0x21fb3b(++_0x42212d);}(_0x1838,0xb7));var _0x8183=function(_0x3078bf,_0x11c569){_0x3078bf=_0x3078bf-0x0;var _0x40012d=_0x1838[_0x3078bf];return _0x40012d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8183('0x0'));var BPromise=require(_0x8183('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8183('0x2'));var db=require(_0x8183('0x3'))['db'];var utils=require(_0x8183('0x4'));var logger=require(_0x8183('0x5'))(_0x8183('0x6'));var config=require('../../config/environment');var jayson=require(_0x8183('0x7'));var client=jayson[_0x8183('0x8')][_0x8183('0x9')]({'port':0x232a});config[_0x8183('0xa')]=_[_0x8183('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8183('0xa')]));require('./chatMessage.socket')[_0x8183('0xc')](socket);function respondWithRpcPromise(_0x597fe5,_0x169b03,_0x126130){return new BPromise(function(_0x23b875,_0x9d7dfb){return client[_0x8183('0xd')](_0x597fe5,_0x126130)[_0x8183('0xe')](function(_0x58e3fe){logger['info']('ChatMessage,\x20%s,\x20%s',_0x169b03,'request\x20sent');logger[_0x8183('0xf')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x169b03,_0x8183('0x10'),JSON[_0x8183('0x11')](_0x58e3fe));if(_0x58e3fe[_0x8183('0x12')]){if(_0x58e3fe[_0x8183('0x12')]['code']===0x1f4){logger[_0x8183('0x12')](_0x8183('0x13'),_0x169b03,_0x58e3fe[_0x8183('0x12')][_0x8183('0x14')]);return _0x9d7dfb(_0x58e3fe['error'][_0x8183('0x14')]);}logger[_0x8183('0x12')]('ChatMessage,\x20%s,\x20%s',_0x169b03,_0x58e3fe[_0x8183('0x12')][_0x8183('0x14')]);return _0x23b875(_0x58e3fe[_0x8183('0x12')]['message']);}else{logger[_0x8183('0x15')](_0x8183('0x13'),_0x169b03,_0x8183('0x10'));_0x23b875(_0x58e3fe[_0x8183('0x16')][_0x8183('0x14')]);}})[_0x8183('0x17')](function(_0x2cde83){logger[_0x8183('0x12')](_0x8183('0x13'),_0x169b03,_0x2cde83);_0x9d7dfb(_0x2cde83);});});}exports['CreateChatMessage']=function(_0x1200a7){var _0x681530=this;return new Promise(function(_0x35e1ce,_0x3fc8ca){return db[_0x8183('0x18')][_0x8183('0x19')](_0x1200a7[_0x8183('0x1a')],{'raw':_0x1200a7[_0x8183('0x1b')]?_0x1200a7['options'][_0x8183('0x1c')]===undefined?!![]:![]:!![]})[_0x8183('0xe')](function(_0x924a2c){logger[_0x8183('0x15')](_0x8183('0x1d'),_0x1200a7);logger[_0x8183('0xf')](_0x8183('0x1d'),_0x1200a7,JSON[_0x8183('0x11')](_0x924a2c));_0x35e1ce(_0x924a2c);})['catch'](function(_0x57c41d){logger[_0x8183('0x12')](_0x8183('0x1d'),_0x57c41d[_0x8183('0x14')],_0x1200a7);_0x3fc8ca(_0x681530[_0x8183('0x12')](0x1f4,_0x57c41d['message']));});});}; \ No newline at end of file +var _0xc48d=['debug','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','options','raw'];(function(_0x106b25,_0x54e987){var _0x9ba749=function(_0x3b0360){while(--_0x3b0360){_0x106b25['push'](_0x106b25['shift']());}};_0x9ba749(++_0x54e987);}(_0xc48d,0x11a));var _0xdc48=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xc48d[_0x43b06b];return _0x2c555b;};'use strict';var _=require(_0xdc48('0x0'));var util=require(_0xdc48('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc48('0x2'));var fs=require('fs');var Redis=require(_0xdc48('0x3'));var db=require(_0xdc48('0x4'))['db'];var utils=require(_0xdc48('0x5'));var logger=require(_0xdc48('0x6'))(_0xdc48('0x7'));var config=require(_0xdc48('0x8'));var jayson=require(_0xdc48('0x9'));var client=jayson[_0xdc48('0xa')][_0xdc48('0xb')]({'port':0x232a});config[_0xdc48('0xc')]=_[_0xdc48('0xd')](config[_0xdc48('0xc')],{'host':_0xdc48('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc48('0xc')]));require(_0xdc48('0xf'))[_0xdc48('0x10')](socket);function respondWithRpcPromise(_0x31c527,_0x404756,_0x27dd28){return new BPromise(function(_0xfb6101,_0x327146){return client[_0xdc48('0x11')](_0x31c527,_0x27dd28)[_0xdc48('0x12')](function(_0xa225bd){logger[_0xdc48('0x13')]('ChatMessage,\x20%s,\x20%s',_0x404756,_0xdc48('0x14'));logger['debug'](_0xdc48('0x15'),_0x404756,'request\x20sent',JSON[_0xdc48('0x16')](_0xa225bd));if(_0xa225bd[_0xdc48('0x17')]){if(_0xa225bd[_0xdc48('0x17')][_0xdc48('0x18')]===0x1f4){logger['error'](_0xdc48('0x19'),_0x404756,_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);return _0x327146(_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);}logger[_0xdc48('0x17')](_0xdc48('0x19'),_0x404756,_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);return _0xfb6101(_0xa225bd[_0xdc48('0x17')][_0xdc48('0x1a')]);}else{logger[_0xdc48('0x13')](_0xdc48('0x19'),_0x404756,_0xdc48('0x14'));_0xfb6101(_0xa225bd[_0xdc48('0x1b')]['message']);}})['catch'](function(_0x5a3747){logger[_0xdc48('0x17')]('ChatMessage,\x20%s,\x20%s',_0x404756,_0x5a3747);_0x327146(_0x5a3747);});});}exports[_0xdc48('0x1c')]=function(_0x504d24){var _0x35c20c=this;return new Promise(function(_0x3e77c3,_0x77bd0c){return db[_0xdc48('0x1d')][_0xdc48('0x1e')](_0x504d24['body'],{'raw':_0x504d24[_0xdc48('0x1f')]?_0x504d24[_0xdc48('0x1f')][_0xdc48('0x20')]===undefined?!![]:![]:!![]})[_0xdc48('0x12')](function(_0x419e78){logger[_0xdc48('0x13')](_0xdc48('0x1c'),_0x504d24);logger[_0xdc48('0x21')](_0xdc48('0x1c'),_0x504d24,JSON[_0xdc48('0x16')](_0x419e78));_0x3e77c3(_0x419e78);})[_0xdc48('0x22')](function(_0x233ba6){logger[_0xdc48('0x17')]('CreateChatMessage',_0x233ba6[_0xdc48('0x1a')],_0x504d24);_0x77bd0c(_0x35c20c[_0xdc48('0x17')](0x1f4,_0x233ba6[_0xdc48('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 18b587b..4bdfbd5 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 _0xb194=['remove','update','register','length','./chatMessage.events'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xb194,0x1b2));var _0x4b19=function(_0x320626,_0x3cc862){_0x320626=_0x320626-0x0;var _0x757d40=_0xb194[_0x320626];return _0x757d40;};'use strict';var ChatMessageEvents=require(_0x4b19('0x0'));var events=['save',_0x4b19('0x1'),_0x4b19('0x2')];function createListener(_0x10bd69,_0x2e77f6){return function(_0x3ba6e4){_0x2e77f6['emit'](_0x10bd69,_0x3ba6e4);};}function removeListener(_0x46faa3,_0x3a4700){return function(){ChatMessageEvents['removeListener'](_0x46faa3,_0x3a4700);};}exports[_0x4b19('0x3')]=function(_0x570374){for(var _0x22033b=0x0,_0x5070da=events[_0x4b19('0x4')];_0x22033b<_0x5070da;_0x22033b++){var _0x3fb52e=events[_0x22033b];var _0x1dae50=createListener('chatMessage:'+_0x3fb52e,_0x570374);ChatMessageEvents['on'](_0x3fb52e,_0x1dae50);}}; \ No newline at end of file +var _0x6b8f=['save','update','emit','removeListener','register','length'];(function(_0x4ab001,_0x532960){var _0x52c134=function(_0x3f4fc9){while(--_0x3f4fc9){_0x4ab001['push'](_0x4ab001['shift']());}};_0x52c134(++_0x532960);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x378e5b,_0x49fa7e){_0x378e5b=_0x378e5b-0x0;var _0x3410c3=_0x6b8f[_0x378e5b];return _0x3410c3;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xf6b8('0x0'),'remove',_0xf6b8('0x1')];function createListener(_0x4e006e,_0x5443a1){return function(_0x362c27){_0x5443a1[_0xf6b8('0x2')](_0x4e006e,_0x362c27);};}function removeListener(_0x4d0ee5,_0x2b5ca9){return function(){ChatMessageEvents[_0xf6b8('0x3')](_0x4d0ee5,_0x2b5ca9);};}exports[_0xf6b8('0x4')]=function(_0x549eac){for(var _0x2d035e=0x0,_0x79c66d=events[_0xf6b8('0x5')];_0x2d035e<_0x79c66d;_0x2d035e++){var _0x3c3430=events[_0x2d035e];var _0x557910=createListener('chatMessage:'+_0x3c3430,_0x549eac);ChatMessageEvents['on'](_0x3c3430,_0x557910);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 3b5a339..a9f693c 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 _0x96be=['fs-extra','../../config/environment','./chatMessage.controller','get','/describe','isAuthenticated','describe','show','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x96be,0xbc));var _0xe96b=function(_0xed2c49,_0x17a804){_0xed2c49=_0xed2c49-0x0;var _0xe20a73=_0x96be[_0xed2c49];return _0xe20a73;};'use strict';var multer=require(_0xe96b('0x0'));var util=require('util');var path=require(_0xe96b('0x1'));var timeout=require(_0xe96b('0x2'));var express=require(_0xe96b('0x3'));var router=express['Router']();var fs_extra=require(_0xe96b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe96b('0x5'));var controller=require(_0xe96b('0x6'));router[_0xe96b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe96b('0x7')](_0xe96b('0x8'),auth[_0xe96b('0x9')](),controller[_0xe96b('0xa')]);router[_0xe96b('0x7')]('/:id',auth[_0xe96b('0x9')](),controller[_0xe96b('0xb')]);router[_0xe96b('0xc')]('/',auth['isAuthenticated'](),interaction[_0xe96b('0xd')](_0xe96b('0xe'),'chatmessage:create'),controller[_0xe96b('0xf')]);router[_0xe96b('0x10')]('/:id',controller[_0xe96b('0x11')]);router[_0xe96b('0x10')](_0xe96b('0x12'),auth[_0xe96b('0x9')](),controller['accept']);router[_0xe96b('0x10')](_0xe96b('0x13'),auth['isAuthenticated'](),controller[_0xe96b('0x14')]);router['delete'](_0xe96b('0x15'),auth['isAuthenticated'](),controller[_0xe96b('0x16')]);module[_0xe96b('0x17')]=router; \ No newline at end of file +var _0x6121=['create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create'];(function(_0x33484b,_0x380ad8){var _0x4ebdef=function(_0x568f37){while(--_0x568f37){_0x33484b['push'](_0x33484b['shift']());}};_0x4ebdef(++_0x380ad8);}(_0x6121,0x7d));var _0x1612=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6121[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x1612('0x0'));var util=require(_0x1612('0x1'));var path=require(_0x1612('0x2'));var timeout=require(_0x1612('0x3'));var express=require(_0x1612('0x4'));var router=express['Router']();var fs_extra=require(_0x1612('0x5'));var auth=require(_0x1612('0x6'));var interaction=require(_0x1612('0x7'));var config=require(_0x1612('0x8'));var controller=require('./chatMessage.controller');router[_0x1612('0x9')]('/',auth[_0x1612('0xa')](),controller[_0x1612('0xb')]);router[_0x1612('0x9')](_0x1612('0xc'),auth['isAuthenticated'](),controller[_0x1612('0xd')]);router['get'](_0x1612('0xe'),auth[_0x1612('0xa')](),controller[_0x1612('0xf')]);router[_0x1612('0x10')]('/',auth[_0x1612('0xa')](),interaction[_0x1612('0x11')](_0x1612('0x12'),_0x1612('0x13')),controller[_0x1612('0x14')]);router[_0x1612('0x15')](_0x1612('0xe'),controller[_0x1612('0x16')]);router[_0x1612('0x15')](_0x1612('0x17'),auth['isAuthenticated'](),controller[_0x1612('0x18')]);router[_0x1612('0x15')](_0x1612('0x19'),auth['isAuthenticated'](),controller[_0x1612('0x1a')]);router[_0x1612('0x1b')](_0x1612('0xe'),auth[_0x1612('0xa')](),controller[_0x1612('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8709e4c..2689b98 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 _0x757a=['exports','TEXT'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x757a,0xde));var _0xa757=function(_0x38e820,_0x2a36e4){_0x38e820=_0x38e820-0x0;var _0xc0b2a3=_0x757a[_0x38e820];return _0xc0b2a3;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x3f1203,_0xffd4c7){var _0xcec45d=function(_0x38c6c8){while(--_0x38c6c8){_0x3f1203['push'](_0x3f1203['shift']());}};_0xcec45d(++_0xffd4c7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x340c3c,_0x3578b0){_0x340c3c=_0x340c3c-0x0;var _0x3e5431=_0x5f2f[_0x340c3c];return _0x3e5431;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 794a2d0..40353f5 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x9d340d,_0x59f6d7){var _0x112861=function(_0x502074){while(--_0x502074){_0x9d340d['push'](_0x9d340d['shift']());}};_0x112861(++_0x59f6d7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x590667,_0x310611){var _0x2c6e28=function(_0xd3a81d){while(--_0xd3a81d){_0x590667['push'](_0x590667['shift']());}};_0x2c6e28(++_0x310611);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 d87e6ff..f3bb299 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 _0xacd6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xacd6,0xef));var _0x6acd=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0xacd6[_0x55a89e];return _0x3aa2bd;};'use strict';var EventEmitter=require(_0x6acd('0x0'));var ChatOfflineMessage=require(_0x6acd('0x1'))['db'][_0x6acd('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6acd('0x3')](0x0);var events={'afterCreate':_0x6acd('0x4'),'afterUpdate':_0x6acd('0x5'),'afterDestroy':_0x6acd('0x6')};function emitEvent(_0x1c354f){return function(_0xac184f,_0x34bae2,_0x33c0cb){ChatOfflineMessageEvents[_0x6acd('0x7')](_0x1c354f+':'+_0xac184f['id'],_0xac184f);ChatOfflineMessageEvents['emit'](_0x1c354f,_0xac184f);_0x33c0cb(null);};}for(var e in events){if(events[_0x6acd('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x6acd('0x9')](e,emitEvent(event));}}module[_0x6acd('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xb662=['remove','emit','hasOwnProperty','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x547206,_0x33c3da){var _0x5cb60b=function(_0x30d9b1){while(--_0x30d9b1){_0x547206['push'](_0x547206['shift']());}};_0x5cb60b(++_0x33c3da);}(_0xb662,0x13e));var _0x2b66=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xb662[_0x4ed520];return _0x4415a6;};'use strict';var EventEmitter=require(_0x2b66('0x0'));var ChatOfflineMessage=require(_0x2b66('0x1'))['db'][_0x2b66('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x2b66('0x3')](0x0);var events={'afterCreate':_0x2b66('0x4'),'afterUpdate':_0x2b66('0x5'),'afterDestroy':_0x2b66('0x6')};function emitEvent(_0x1665f4){return function(_0x1cfb8d,_0x136655,_0x156bbe){ChatOfflineMessageEvents[_0x2b66('0x7')](_0x1665f4+':'+_0x1cfb8d['id'],_0x1cfb8d);ChatOfflineMessageEvents[_0x2b66('0x7')](_0x1665f4,_0x1cfb8d);_0x156bbe(null);};}for(var e in events){if(events[_0x2b66('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 0ee2f03..734d589 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 _0xe519=['./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0x295a41,_0x2f5d52){var _0x21bf9a=function(_0xa33735){while(--_0xa33735){_0x295a41['push'](_0x295a41['shift']());}};_0x21bf9a(++_0x2f5d52);}(_0xe519,0xf5));var _0x9e51=function(_0x7fd777,_0x23c362){_0x7fd777=_0x7fd777-0x0;var _0x4eb066=_0xe519[_0x7fd777];return _0x4eb066;};'use strict';var attributes=require(_0x9e51('0x0'));module[_0x9e51('0x1')]=function(_0x3e5abf){return _0x3e5abf[_0x9e51('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x9e51('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9e51('0x4')});}; \ No newline at end of file +var _0x8769=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x38867a,_0x43724f){var _0x2c77d8=function(_0x51d1a3){while(--_0x51d1a3){_0x38867a['push'](_0x38867a['shift']());}};_0x2c77d8(++_0x43724f);}(_0x8769,0x10a));var _0x9876=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x8769[_0x1e4360];return _0x31e6b4;};'use strict';var attributes=require(_0x9876('0x0'));module[_0x9876('0x1')]=function(_0x4a7b65){return _0x4a7b65[_0x9876('0x2')](_0x9876('0x3'),attributes,{'tableName':_0x9876('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9876('0x5'),'collate':_0x9876('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 72553dc..0a7377e 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 _0x4ab0=['jayson/promise','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x828fd8,_0x240398){var _0x58216b=function(_0x2c7f30){while(--_0x2c7f30){_0x828fd8['push'](_0x828fd8['shift']());}};_0x58216b(++_0x240398);}(_0x4ab0,0xd5));var _0x04ab=function(_0x2f9daf,_0xc5b4f5){_0x2f9daf=_0x2f9daf-0x0;var _0x1bd306=_0x4ab0[_0x2f9daf];return _0x1bd306;};'use strict';var _=require('lodash');var util=require(_0x04ab('0x0'));var moment=require(_0x04ab('0x1'));var BPromise=require(_0x04ab('0x2'));var rs=require(_0x04ab('0x3'));var fs=require('fs');var Redis=require(_0x04ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x04ab('0x5'))(_0x04ab('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ab('0x7'));var client=jayson[_0x04ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f5901,_0x293f1d,_0x1ff7f6){return new BPromise(function(_0x4bc05e,_0x101d6b){return client[_0x04ab('0x9')](_0x3f5901,_0x1ff7f6)[_0x04ab('0xa')](function(_0x41ce1e){logger['info'](_0x04ab('0xb'),_0x293f1d,_0x04ab('0xc'));logger[_0x04ab('0xd')](_0x04ab('0xe'),_0x293f1d,'request\x20sent',JSON[_0x04ab('0xf')](_0x41ce1e));if(_0x41ce1e[_0x04ab('0x10')]){if(_0x41ce1e[_0x04ab('0x10')][_0x04ab('0x11')]===0x1f4){logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x41ce1e['error'][_0x04ab('0x12')]);return _0x101d6b(_0x41ce1e['error'][_0x04ab('0x12')]);}logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x41ce1e[_0x04ab('0x10')]['message']);return _0x4bc05e(_0x41ce1e['error']['message']);}else{logger[_0x04ab('0x13')](_0x04ab('0xb'),_0x293f1d,_0x04ab('0xc'));_0x4bc05e(_0x41ce1e[_0x04ab('0x14')][_0x04ab('0x12')]);}})[_0x04ab('0x15')](function(_0x42c937){logger[_0x04ab('0x10')](_0x04ab('0xb'),_0x293f1d,_0x42c937);_0x101d6b(_0x42c937);});});} \ No newline at end of file +var _0xb5fc=['client','request','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ca7ee,_0x4c4c48){var _0x47123f=function(_0x55f46c){while(--_0x55f46c){_0x5ca7ee['push'](_0x5ca7ee['shift']());}};_0x47123f(++_0x4c4c48);}(_0xb5fc,0x71));var _0xcb5f=function(_0x3d3c2f,_0xedf6bc){_0x3d3c2f=_0x3d3c2f-0x0;var _0x3571be=_0xb5fc[_0x3d3c2f];return _0x3571be;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb5f('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb5f('0x1'))['db'];var utils=require(_0xcb5f('0x2'));var logger=require(_0xcb5f('0x3'))(_0xcb5f('0x4'));var config=require(_0xcb5f('0x5'));var jayson=require(_0xcb5f('0x6'));var client=jayson[_0xcb5f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13abe7,_0x48cfe1,_0x1dfeb0){return new BPromise(function(_0x29308d,_0x36535f){return client[_0xcb5f('0x8')](_0x13abe7,_0x1dfeb0)['then'](function(_0x2165f6){logger[_0xcb5f('0x9')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48cfe1,_0xcb5f('0xa'));logger[_0xcb5f('0xb')](_0xcb5f('0xc'),_0x48cfe1,_0xcb5f('0xa'),JSON[_0xcb5f('0xd')](_0x2165f6));if(_0x2165f6[_0xcb5f('0xe')]){if(_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0xf')]===0x1f4){logger[_0xcb5f('0xe')](_0xcb5f('0x10'),_0x48cfe1,_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0x11')]);return _0x36535f(_0x2165f6['error'][_0xcb5f('0x11')]);}logger[_0xcb5f('0xe')](_0xcb5f('0x10'),_0x48cfe1,_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0x11')]);return _0x29308d(_0x2165f6[_0xcb5f('0xe')][_0xcb5f('0x11')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x48cfe1,_0xcb5f('0xa'));_0x29308d(_0x2165f6[_0xcb5f('0x12')][_0xcb5f('0x11')]);}})[_0xcb5f('0x13')](function(_0x3909be){logger[_0xcb5f('0xe')](_0xcb5f('0x10'),_0x48cfe1,_0x3909be);_0x36535f(_0x3909be);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index c61643c..6607dd7 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 _0xa2a6=['show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xa2a6,0xd9));var _0x6a2a=function(_0x595256,_0x244d0b){_0x595256=_0x595256-0x0;var _0x2bc610=_0xa2a6[_0x595256];return _0x2bc610;};'use strict';var multer=require('multer');var util=require(_0x6a2a('0x0'));var path=require(_0x6a2a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a2a('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6a2a('0x3'));var controller=require(_0x6a2a('0x4'));router[_0x6a2a('0x5')]('/',auth[_0x6a2a('0x6')](),controller[_0x6a2a('0x7')]);router['get'](_0x6a2a('0x8'),auth[_0x6a2a('0x6')](),controller[_0x6a2a('0x9')]);router[_0x6a2a('0x5')](_0x6a2a('0xa'),auth['isAuthenticated'](),controller[_0x6a2a('0xb')]);router[_0x6a2a('0xc')]('/',auth['isAuthenticated'](),controller[_0x6a2a('0xd')]);router[_0x6a2a('0xe')](_0x6a2a('0xa'),auth['isAuthenticated'](),controller[_0x6a2a('0xf')]);router[_0x6a2a('0x10')](_0x6a2a('0xa'),auth['isAuthenticated'](),controller[_0x6a2a('0x11')]);module[_0x6a2a('0x12')]=router; \ No newline at end of file +var _0xd4bf=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','/:id','show','post','put','delete','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4bf,0x18a));var _0xfd4b=function(_0x4211cf,_0x3ebd73){_0x4211cf=_0x4211cf-0x0;var _0x26a121=_0xd4bf[_0x4211cf];return _0x26a121;};'use strict';var multer=require(_0xfd4b('0x0'));var util=require(_0xfd4b('0x1'));var path=require(_0xfd4b('0x2'));var timeout=require(_0xfd4b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfd4b('0x4'));var auth=require(_0xfd4b('0x5'));var interaction=require(_0xfd4b('0x6'));var config=require(_0xfd4b('0x7'));var controller=require(_0xfd4b('0x8'));router['get']('/',auth[_0xfd4b('0x9')](),controller['index']);router[_0xfd4b('0xa')](_0xfd4b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xfd4b('0xa')](_0xfd4b('0xc'),auth[_0xfd4b('0x9')](),controller[_0xfd4b('0xd')]);router[_0xfd4b('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfd4b('0xf')](_0xfd4b('0xc'),auth[_0xfd4b('0x9')](),controller['update']);router[_0xfd4b('0x10')]('/:id',auth[_0xfd4b('0x9')](),controller['destroy']);module[_0xfd4b('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 878c858..98f6539 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 _0xb1bc=['sequelize','STRING','ENUM','mouseOver'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb1bc,0x160));var _0xcb1b=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xb1bc[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0xcb1b('0x0'));module['exports']={'name':{'type':Sequelize[_0xcb1b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcb1b('0x2')]('mouseOver','timeout'),'defaultValue':_0xcb1b('0x3')},'selector':{'type':Sequelize[_0xcb1b('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5850=['timeout','mouseOver','INTEGER','STRING','ENUM'];(function(_0x3ffa1f,_0x56a0cf){var _0x4e06f1=function(_0x171ce2){while(--_0x171ce2){_0x3ffa1f['push'](_0x3ffa1f['shift']());}};_0x4e06f1(++_0x56a0cf);}(_0x5850,0x161));var _0x0585=function(_0x1df6e7,_0x58d850){_0x1df6e7=_0x1df6e7-0x0;var _0x267504=_0x5850[_0x1df6e7];return _0x267504;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0585('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x0585('0x1')]('mouseOver',_0x0585('0x2')),'defaultValue':_0x0585('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0585('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 1ffba75..12b3815 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 _0xbd50=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x4e46e9,_0x13c515){var _0x4cb249=function(_0x18bb8e){while(--_0x18bb8e){_0x4e46e9['push'](_0x4e46e9['shift']());}};_0x4cb249(++_0x13c515);}(_0xbd50,0x196));var _0x0bd5=function(_0x26fdfc,_0x5ede52){_0x26fdfc=_0x26fdfc-0x0;var _0x5c9e63=_0xbd50[_0x26fdfc];return _0x5c9e63;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={'raw':!![],'where':{'id':_0x15561b['params']['id']}},_0x2704ee={};_0x2704ee[_0x0bd5('0x29')]=_[_0x0bd5('0x2a')](db['ChatProactiveAction'][_0x0bd5('0x2b')]);_0x2704ee[_0x0bd5('0x2c')]=_['keys'](_0x15561b[_0x0bd5('0x2c')]);_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_0x2704ee[_0x0bd5('0x29')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x2f')]=_[_0x0bd5('0x2e')](_0x2704ee[_0x0bd5('0x29')],qs[_0x0bd5('0x30')](_0x15561b[_0x0bd5('0x2c')][_0x0bd5('0x30')]));_0x2e10ce['attributes']=_0x2e10ce[_0x0bd5('0x2f')]['length']?_0x2e10ce[_0x0bd5('0x2f')]:_0x2704ee[_0x0bd5('0x29')];if(_0x15561b[_0x0bd5('0x2c')][_0x0bd5('0x31')]){_0x2e10ce[_0x0bd5('0x32')]=[{'all':!![]}];}_0x2e10ce=_[_0x0bd5('0x33')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x34')]);return db[_0x0bd5('0x35')][_0x0bd5('0x36')](_0x2e10ce)[_0x0bd5('0x23')](handleEntityNotFound(_0xcbfc51,null))[_0x0bd5('0x23')](respondWithResult(_0xcbfc51,null))[_0x0bd5('0x37')](handleError(_0xcbfc51,null));};exports[_0x0bd5('0x38')]=function(_0x4c9a61,_0x3e153a){return db[_0x0bd5('0x35')]['create'](_0x4c9a61['body'],{})[_0x0bd5('0x23')](respondWithResult(_0x3e153a,0xc9))[_0x0bd5('0x37')](handleError(_0x3e153a,null));};exports[_0x0bd5('0x39')]=function(_0x3155c5,_0x1dd2e1){if(_0x3155c5[_0x0bd5('0x3a')]['id']){delete _0x3155c5[_0x0bd5('0x3a')]['id'];}return db[_0x0bd5('0x35')][_0x0bd5('0x36')]({'where':{'id':_0x3155c5[_0x0bd5('0x3b')]['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x1dd2e1,null))[_0x0bd5('0x23')](saveUpdates(_0x3155c5[_0x0bd5('0x3a')],null))['then'](respondWithResult(_0x1dd2e1,null))[_0x0bd5('0x37')](handleError(_0x1dd2e1,null));};exports['destroy']=function(_0x369d23,_0x2f17a1){return db[_0x0bd5('0x35')][_0x0bd5('0x36')]({'where':{'id':_0x369d23[_0x0bd5('0x3b')]['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x2f17a1,null))['then'](removeEntity(_0x2f17a1,null))[_0x0bd5('0x37')](handleError(_0x2f17a1,null));}; \ No newline at end of file +var _0x1224=['query','keys','filters','intersection','attributes','fields','length','merge','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','show','params','model','ChatProactiveAction'];(function(_0x5e1c60,_0x4ef580){var _0x5f025c=function(_0x3bc9b3){while(--_0x3bc9b3){_0x5e1c60['push'](_0x5e1c60['shift']());}};_0x5f025c(++_0x4ef580);}(_0x1224,0x10d));var _0x4122=function(_0x4aadbc,_0x4afc4d){_0x4aadbc=_0x4aadbc-0x0;var _0x372f33=_0x1224[_0x4aadbc];return _0x372f33;};'use strict';var emlformat=require(_0x4122('0x0'));var rimraf=require(_0x4122('0x1'));var zipdir=require(_0x4122('0x2'));var jsonpatch=require(_0x4122('0x3'));var rp=require(_0x4122('0x4'));var moment=require(_0x4122('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4122('0x6'));var util=require(_0x4122('0x7'));var path=require(_0x4122('0x8'));var sox=require('sox');var csv=require(_0x4122('0x9'));var ejs=require(_0x4122('0xa'));var fs=require('fs');var fs_extra=require(_0x4122('0xb'));var _=require(_0x4122('0xc'));var squel=require(_0x4122('0xd'));var crypto=require(_0x4122('0xe'));var jsforce=require(_0x4122('0xf'));var deskjs=require(_0x4122('0x10'));var toCsv=require(_0x4122('0x9'));var querystring=require(_0x4122('0x11'));var Papa=require(_0x4122('0x12'));var Redis=require(_0x4122('0x13'));var authService=require(_0x4122('0x14'));var qs=require(_0x4122('0x15'));var as=require(_0x4122('0x16'));var hardwareService=require(_0x4122('0x17'));var logger=require(_0x4122('0x18'))(_0x4122('0x19'));var utils=require(_0x4122('0x1a'));var config=require(_0x4122('0x1b'));var licenseUtil=require(_0x4122('0x1c'));var db=require(_0x4122('0x1d'))['db'];function respondWithStatusCode(_0x440ff0,_0x8d4876){_0x8d4876=_0x8d4876||0xcc;return function(_0xe213d){if(_0xe213d){return _0x440ff0[_0x4122('0x1e')](_0x8d4876);}return _0x440ff0[_0x4122('0x1f')](_0x8d4876)[_0x4122('0x20')]();};}function respondWithResult(_0x421ee3,_0x1a701e){_0x1a701e=_0x1a701e||0xc8;return function(_0x3a88fe){if(_0x3a88fe){return _0x421ee3['status'](_0x1a701e)[_0x4122('0x21')](_0x3a88fe);}};}function respondWithFilteredResult(_0x3c674e,_0x192e77){return function(_0x359909){if(_0x359909){var _0x520300=typeof _0x192e77[_0x4122('0x22')]===_0x4122('0x23')&&typeof _0x192e77['limit']===_0x4122('0x23');var _0x3ec4d3=_0x359909[_0x4122('0x24')];var _0x4636ae=_0x520300?0x0:_0x192e77[_0x4122('0x22')];var _0x42374d=_0x520300?_0x359909[_0x4122('0x24')]:_0x192e77['offset']+_0x192e77['limit'];var _0x586105;if(_0x42374d>=_0x3ec4d3){_0x42374d=_0x3ec4d3;_0x586105=0xc8;}else{_0x586105=0xce;}_0x3c674e[_0x4122('0x1f')](_0x586105);return _0x3c674e[_0x4122('0x25')](_0x4122('0x26'),_0x4636ae+'-'+_0x42374d+'/'+_0x3ec4d3)[_0x4122('0x21')](_0x359909);}return null;};}function patchUpdates(_0xef6995){return function(_0xb0a7d){try{jsonpatch[_0x4122('0x27')](_0xb0a7d,_0xef6995,!![]);}catch(_0x46b24e){return BPromise['reject'](_0x46b24e);}return _0xb0a7d[_0x4122('0x28')]();};}function saveUpdates(_0x50e243,_0x4f949a){return function(_0x508cd7){if(_0x508cd7){return _0x508cd7[_0x4122('0x29')](_0x50e243)[_0x4122('0x2a')](function(_0x317418){return _0x317418;});}return null;};}function removeEntity(_0x4eb35b,_0x128fde){return function(_0x386cdc){if(_0x386cdc){return _0x386cdc['destroy']()['then'](function(){_0x4eb35b[_0x4122('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db23e,_0x59895d){return function(_0x1b449b){if(!_0x1b449b){_0x4db23e[_0x4122('0x1e')](0x194);}return _0x1b449b;};}function handleError(_0xbb76e1,_0x1bb51b){_0x1bb51b=_0x1bb51b||0x1f4;return function(_0x31568f){logger[_0x4122('0x2b')](_0x31568f[_0x4122('0x2c')]);if(_0x31568f[_0x4122('0x2d')]){delete _0x31568f[_0x4122('0x2d')];}_0xbb76e1[_0x4122('0x1f')](_0x1bb51b)[_0x4122('0x2e')](_0x31568f);};}exports[_0x4122('0x2f')]=function(_0xfefaf6,_0x5f32c5){var _0x2e5bc2={'raw':!![],'where':{'id':_0xfefaf6[_0x4122('0x30')]['id']}},_0x43c51c={};_0x43c51c[_0x4122('0x31')]=_['keys'](db[_0x4122('0x32')]['rawAttributes']);_0x43c51c[_0x4122('0x33')]=_[_0x4122('0x34')](_0xfefaf6[_0x4122('0x33')]);_0x43c51c[_0x4122('0x35')]=_[_0x4122('0x36')](_0x43c51c[_0x4122('0x31')],_0x43c51c[_0x4122('0x33')]);_0x2e5bc2[_0x4122('0x37')]=_['intersection'](_0x43c51c[_0x4122('0x31')],qs[_0x4122('0x38')](_0xfefaf6['query'][_0x4122('0x38')]));_0x2e5bc2[_0x4122('0x37')]=_0x2e5bc2[_0x4122('0x37')][_0x4122('0x39')]?_0x2e5bc2['attributes']:_0x43c51c[_0x4122('0x31')];if(_0xfefaf6[_0x4122('0x33')]['includeAll']){_0x2e5bc2['include']=[{'all':!![]}];}_0x2e5bc2=_[_0x4122('0x3a')]({},_0x2e5bc2,_0xfefaf6['options']);return db[_0x4122('0x32')][_0x4122('0x3b')](_0x2e5bc2)['then'](handleEntityNotFound(_0x5f32c5,null))[_0x4122('0x2a')](respondWithResult(_0x5f32c5,null))[_0x4122('0x3c')](handleError(_0x5f32c5,null));};exports[_0x4122('0x3d')]=function(_0x5bb6d6,_0x35971b){return db['ChatProactiveAction'][_0x4122('0x3d')](_0x5bb6d6[_0x4122('0x3e')],{})[_0x4122('0x2a')](respondWithResult(_0x35971b,0xc9))['catch'](handleError(_0x35971b,null));};exports[_0x4122('0x29')]=function(_0x5427ca,_0x2da1bd){if(_0x5427ca[_0x4122('0x3e')]['id']){delete _0x5427ca['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x5427ca[_0x4122('0x30')]['id']}})['then'](handleEntityNotFound(_0x2da1bd,null))[_0x4122('0x2a')](saveUpdates(_0x5427ca[_0x4122('0x3e')],null))[_0x4122('0x2a')](respondWithResult(_0x2da1bd,null))[_0x4122('0x3c')](handleError(_0x2da1bd,null));};exports[_0x4122('0x3f')]=function(_0x517a59,_0x5c20ec){return db[_0x4122('0x32')]['find']({'where':{'id':_0x517a59[_0x4122('0x30')]['id']}})['then'](handleEntityNotFound(_0x5c20ec,null))[_0x4122('0x2a')](removeEntity(_0x5c20ec,null))[_0x4122('0x3c')](handleError(_0x5c20ec,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 71ecbf3..021bb16 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 _0x83bb=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x28d31d,_0x57a4e6){var _0x2df7c1=function(_0x52601d){while(--_0x52601d){_0x28d31d['push'](_0x28d31d['shift']());}};_0x2df7c1(++_0x57a4e6);}(_0x83bb,0x13a));var _0xb83b=function(_0x130d57,_0x28456e){_0x130d57=_0x130d57-0x0;var _0x220aa9=_0x83bb[_0x130d57];return _0x220aa9;};'use strict';var _=require(_0xb83b('0x0'));var util=require(_0xb83b('0x1'));var logger=require(_0xb83b('0x2'))(_0xb83b('0x3'));var moment=require(_0xb83b('0x4'));var BPromise=require('bluebird');var rp=require(_0xb83b('0x5'));var fs=require('fs');var path=require(_0xb83b('0x6'));var rimraf=require('rimraf');var config=require(_0xb83b('0x7'));var attributes=require(_0xb83b('0x8'));module[_0xb83b('0x9')]=function(_0x25b8a0,_0x588498){return _0x25b8a0[_0xb83b('0xa')](_0xb83b('0xb'),attributes,{'tableName':_0xb83b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81ff=['api','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger'];(function(_0x386b5e,_0x55d51a){var _0x5c4952=function(_0x5a577d){while(--_0x5a577d){_0x386b5e['push'](_0x386b5e['shift']());}};_0x5c4952(++_0x55d51a);}(_0x81ff,0x159));var _0xf81f=function(_0x5de469,_0x455259){_0x5de469=_0x5de469-0x0;var _0x3edb6f=_0x81ff[_0x5de469];return _0x3edb6f;};'use strict';var _=require(_0xf81f('0x0'));var util=require(_0xf81f('0x1'));var logger=require(_0xf81f('0x2'))(_0xf81f('0x3'));var moment=require(_0xf81f('0x4'));var BPromise=require(_0xf81f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf81f('0x6'));var rimraf=require(_0xf81f('0x7'));var config=require('../../config/environment');var attributes=require(_0xf81f('0x8'));module[_0xf81f('0x9')]=function(_0x9fc52d,_0x142421){return _0x9fc52d[_0xf81f('0xa')](_0xf81f('0xb'),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 2236b89..23867d6 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 _0xf22b=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0xf22b,0xb4));var _0xbf22=function(_0x42790d,_0x12bf0f){_0x42790d=_0x42790d-0x0;var _0x482f2c=_0xf22b[_0x42790d];return _0x482f2c;};'use strict';var _=require(_0xbf22('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbf22('0x1'));var rs=require(_0xbf22('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf22('0x3'))['db'];var utils=require(_0xbf22('0x4'));var logger=require(_0xbf22('0x5'))(_0xbf22('0x6'));var config=require(_0xbf22('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbf22('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28ebe4,_0x5b02b5,_0x16a5c7){return new BPromise(function(_0x1f9f6e,_0x428124){return client[_0xbf22('0x9')](_0x28ebe4,_0x16a5c7)['then'](function(_0x22452f){logger['info'](_0xbf22('0xa'),_0x5b02b5,_0xbf22('0xb'));logger[_0xbf22('0xc')](_0xbf22('0xd'),_0x5b02b5,'request\x20sent',JSON[_0xbf22('0xe')](_0x22452f));if(_0x22452f[_0xbf22('0xf')]){if(_0x22452f[_0xbf22('0xf')][_0xbf22('0x10')]===0x1f4){logger[_0xbf22('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b02b5,_0x22452f[_0xbf22('0xf')]['message']);return _0x428124(_0x22452f['error'][_0xbf22('0x11')]);}logger[_0xbf22('0xf')](_0xbf22('0xa'),_0x5b02b5,_0x22452f['error'][_0xbf22('0x11')]);return _0x1f9f6e(_0x22452f[_0xbf22('0xf')]['message']);}else{logger[_0xbf22('0x12')](_0xbf22('0xa'),_0x5b02b5,_0xbf22('0xb'));_0x1f9f6e(_0x22452f['result'][_0xbf22('0x11')]);}})[_0xbf22('0x13')](function(_0x3624de){logger[_0xbf22('0xf')](_0xbf22('0xa'),_0x5b02b5,_0x3624de);_0x428124(_0x3624de);});});} \ No newline at end of file +var _0x3a59=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message'];(function(_0x353934,_0x4a9d67){var _0x2ce2c5=function(_0x50bcd2){while(--_0x50bcd2){_0x353934['push'](_0x353934['shift']());}};_0x2ce2c5(++_0x4a9d67);}(_0x3a59,0xde));var _0x93a5=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x3a59[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require(_0x93a5('0x0'));var util=require(_0x93a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93a5('0x2'));var fs=require('fs');var Redis=require(_0x93a5('0x3'));var db=require(_0x93a5('0x4'))['db'];var utils=require(_0x93a5('0x5'));var logger=require(_0x93a5('0x6'))(_0x93a5('0x7'));var config=require(_0x93a5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x93a5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x452da1,_0x149302,_0x271621){return new BPromise(function(_0x49195e,_0x509c35){return client[_0x93a5('0xa')](_0x452da1,_0x271621)[_0x93a5('0xb')](function(_0x38d23f){logger[_0x93a5('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x149302,'request\x20sent');logger[_0x93a5('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x149302,_0x93a5('0xe'),JSON[_0x93a5('0xf')](_0x38d23f));if(_0x38d23f[_0x93a5('0x10')]){if(_0x38d23f[_0x93a5('0x10')][_0x93a5('0x11')]===0x1f4){logger[_0x93a5('0x10')](_0x93a5('0x12'),_0x149302,_0x38d23f[_0x93a5('0x10')]['message']);return _0x509c35(_0x38d23f[_0x93a5('0x10')]['message']);}logger[_0x93a5('0x10')](_0x93a5('0x12'),_0x149302,_0x38d23f['error'][_0x93a5('0x13')]);return _0x49195e(_0x38d23f[_0x93a5('0x10')]['message']);}else{logger[_0x93a5('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x149302,_0x93a5('0xe'));_0x49195e(_0x38d23f[_0x93a5('0x14')][_0x93a5('0x13')]);}})[_0x93a5('0x15')](function(_0x4f00ac){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x149302,_0x4f00ac);_0x509c35(_0x4f00ac);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1104eeb..65a19f5 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 _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x116e48,_0x5c3c5e){var _0x5dd00c=function(_0x147237){while(--_0x147237){_0x116e48['push'](_0x116e48['shift']());}};_0x5dd00c(++_0x5c3c5e);}(_0xd8fb,0x99));var _0xbd8f=function(_0x3f7987,_0x59dc3c){_0x3f7987=_0x3f7987-0x0;var _0x1ab653=_0xd8fb[_0x3f7987];return _0x1ab653;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0xbe5e95,_0x499866){var _0x1fe535=function(_0x55efa9){while(--_0x55efa9){_0xbe5e95['push'](_0xbe5e95['shift']());}};_0x1fe535(++_0x499866);}(_0x814b,0x1a2));var _0xb814=function(_0x4cdcdc,_0x34eac7){_0x4cdcdc=_0x4cdcdc-0x0;var _0x4704ce=_0x814b[_0x4cdcdc];return _0x4704ce;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 5872c23..06b32e1 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 _0x6edd=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x88c3c7,_0x22365b){var _0x38132e=function(_0x3aaeec){while(--_0x3aaeec){_0x88c3c7['push'](_0x88c3c7['shift']());}};_0x38132e(++_0x22365b);}(_0x6edd,0x1f0));var _0xd6ed=function(_0x62a0d1,_0x443e69){_0x62a0d1=_0x62a0d1-0x0;var _0x422c2f=_0x6edd[_0x62a0d1];return _0x422c2f;};'use strict';var Sequelize=require('sequelize');module[_0xd6ed('0x0')]={'name':{'type':Sequelize[_0xd6ed('0x1')],'unique':_0xd6ed('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd6ed('0x1')]},'timeout':{'type':Sequelize[_0xd6ed('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd6ed('0x4')](_0xd6ed('0x5'),_0xd6ed('0x6'),_0xd6ed('0x7'))}}; \ No newline at end of file +var _0x3735=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x2cc3c2,_0x4d201c){var _0x4ee36e=function(_0x5c0b26){while(--_0x5c0b26){_0x2cc3c2['push'](_0x2cc3c2['shift']());}};_0x4ee36e(++_0x4d201c);}(_0x3735,0x1e2));var _0x5373=function(_0x3ea360,_0x4a3b9e){_0x3ea360=_0x3ea360-0x0;var _0x330457=_0x3735[_0x3ea360];return _0x330457;};'use strict';var Sequelize=require(_0x5373('0x0'));module[_0x5373('0x1')]={'name':{'type':Sequelize[_0x5373('0x2')],'unique':_0x5373('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5373('0x2')]},'timeout':{'type':Sequelize[_0x5373('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5373('0x5')](_0x5373('0x6'),'beepall',_0x5373('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index cda8f1e..8cb2562 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 _0x3b92=['ChatQueue,\x20%s,\x20%s','info','result','catch','status','json','offset','undefined','limit','count','set','reject','update','ChatQueues','destroy','end','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','removeTeams','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','http','then','request\x20sent','debug','stringify','error','code','message'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x3b92,0x106));var _0x23b9=function(_0x3f9015,_0xf85b98){_0x3f9015=_0x3f9015-0x0;var _0x1d18a8=_0x3b92[_0x3f9015];return _0x1d18a8;};'use strict';var emlformat=require(_0x23b9('0x0'));var rimraf=require(_0x23b9('0x1'));var zipdir=require(_0x23b9('0x2'));var jsonpatch=require(_0x23b9('0x3'));var rp=require(_0x23b9('0x4'));var moment=require(_0x23b9('0x5'));var BPromise=require(_0x23b9('0x6'));var Mustache=require(_0x23b9('0x7'));var util=require('util');var path=require(_0x23b9('0x8'));var sox=require(_0x23b9('0x9'));var csv=require(_0x23b9('0xa'));var ejs=require(_0x23b9('0xb'));var fs=require('fs');var fs_extra=require(_0x23b9('0xc'));var _=require(_0x23b9('0xd'));var squel=require(_0x23b9('0xe'));var crypto=require('crypto');var jsforce=require(_0x23b9('0xf'));var deskjs=require(_0x23b9('0x10'));var toCsv=require(_0x23b9('0xa'));var querystring=require('querystring');var Papa=require(_0x23b9('0x11'));var Redis=require(_0x23b9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x23b9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23b9('0x14'));var logger=require(_0x23b9('0x15'))(_0x23b9('0x16'));var utils=require(_0x23b9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x23b9('0x18'));var db=require(_0x23b9('0x19'))['db'];config[_0x23b9('0x1a')]=_[_0x23b9('0x1b')](config[_0x23b9('0x1a')],{'host':_0x23b9('0x1c'),'port':0x18eb});var socket=require(_0x23b9('0x1d'))(new Redis(config[_0x23b9('0x1a')]));require(_0x23b9('0x1e'))['register'](socket);var jayson=require(_0x23b9('0x1f'));var client=jayson['client'][_0x23b9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2eac26,_0x112227,_0x4100dd,_0x5390fa){return new BPromise(function(_0x574c2e,_0x4b5fde){var _0x20a297=_0x5390fa||client;return _0x20a297['request'](_0x2eac26,_0x4100dd)[_0x23b9('0x21')](function(_0x418ea0){logger['info']('ChatQueue,\x20%s,\x20%s',_0x112227,_0x23b9('0x22'));logger[_0x23b9('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x112227,_0x23b9('0x22'),JSON[_0x23b9('0x24')](_0x418ea0));if(_0x418ea0['error']){if(_0x418ea0[_0x23b9('0x25')][_0x23b9('0x26')]===0x1f4){logger[_0x23b9('0x25')]('ChatQueue,\x20%s,\x20%s',_0x112227,_0x418ea0['error'][_0x23b9('0x27')]);return _0x4b5fde(_0x418ea0[_0x23b9('0x25')][_0x23b9('0x27')]);}logger['error'](_0x23b9('0x28'),_0x112227,_0x418ea0[_0x23b9('0x25')]['message']);return _0x574c2e(_0x418ea0[_0x23b9('0x25')][_0x23b9('0x27')]);}else{logger[_0x23b9('0x29')](_0x23b9('0x28'),_0x112227,_0x23b9('0x22'));_0x574c2e(_0x418ea0[_0x23b9('0x2a')]['message']);}})[_0x23b9('0x2b')](function(_0x3efbab){logger[_0x23b9('0x25')]('ChatQueue,\x20%s,\x20%s',_0x112227,_0x3efbab);_0x4b5fde(_0x3efbab);});});}function respondWithStatusCode(_0x49e39d,_0x459e75){_0x459e75=_0x459e75||0xcc;return function(_0x2ffe6d){if(_0x2ffe6d){return _0x49e39d['sendStatus'](_0x459e75);}return _0x49e39d[_0x23b9('0x2c')](_0x459e75)['end']();};}function respondWithResult(_0x43c011,_0x559fc7){_0x559fc7=_0x559fc7||0xc8;return function(_0x194bee){if(_0x194bee){return _0x43c011['status'](_0x559fc7)[_0x23b9('0x2d')](_0x194bee);}};}function respondWithFilteredResult(_0x4fe300,_0x484125){return function(_0x47fae9){if(_0x47fae9){var _0x14ffb9=typeof _0x484125[_0x23b9('0x2e')]===_0x23b9('0x2f')&&typeof _0x484125[_0x23b9('0x30')]===_0x23b9('0x2f');var _0x5ccb20=_0x47fae9[_0x23b9('0x31')];var _0x1cbf58=_0x14ffb9?0x0:_0x484125['offset'];var _0x303930=_0x14ffb9?_0x47fae9[_0x23b9('0x31')]:_0x484125['offset']+_0x484125[_0x23b9('0x30')];var _0x6cacb;if(_0x303930>=_0x5ccb20){_0x303930=_0x5ccb20;_0x6cacb=0xc8;}else{_0x6cacb=0xce;}_0x4fe300[_0x23b9('0x2c')](_0x6cacb);return _0x4fe300[_0x23b9('0x32')]('Content-Range',_0x1cbf58+'-'+_0x303930+'/'+_0x5ccb20)[_0x23b9('0x2d')](_0x47fae9);}return null;};}function patchUpdates(_0x5d9c6b){return function(_0x54db05){try{jsonpatch['apply'](_0x54db05,_0x5d9c6b,!![]);}catch(_0xbdc682){return BPromise[_0x23b9('0x33')](_0xbdc682);}return _0x54db05['save']();};}function saveUpdates(_0x37d455,_0x122a9a){return function(_0x57ecf2){if(_0x57ecf2){return _0x57ecf2[_0x23b9('0x34')](_0x37d455)[_0x23b9('0x21')](function(_0x2eb0ae){return _0x2eb0ae;});}return null;};}function removeEntity(_0x787d9a,_0x464808){return function(_0x3a6559){if(_0x3a6559){return _0x3a6559['destroy']()['then'](function(){var _0x33e385=_0x3a6559['get']({'plain':!![]});var _0x414c54=_0x23b9('0x35');return db['UserProfileResource'][_0x23b9('0x36')]({'where':{'type':_0x414c54,'resourceId':_0x33e385['id']}})['then'](function(){return _0x3a6559;});})[_0x23b9('0x21')](function(){_0x787d9a['status'](0xcc)[_0x23b9('0x37')]();});}};}function handleEntityNotFound(_0xd365aa,_0x972c44){return function(_0x551101){if(!_0x551101){_0xd365aa['sendStatus'](0x194);}return _0x551101;};}function handleError(_0x51a6f4,_0x4028f7){_0x4028f7=_0x4028f7||0x1f4;return function(_0x5a2895){logger[_0x23b9('0x25')](_0x5a2895['stack']);if(_0x5a2895['name']){delete _0x5a2895[_0x23b9('0x38')];}_0x51a6f4[_0x23b9('0x2c')](_0x4028f7)[_0x23b9('0x39')](_0x5a2895);};}exports[_0x23b9('0x3a')]=function(_0x11c1ea,_0x2abb99){var _0x4aa568={},_0x323454={},_0x35f9d7={'count':0x0,'rows':[]};var _0xaee8cd=_[_0x23b9('0x3b')](db[_0x23b9('0x3c')][_0x23b9('0x3d')],function(_0x17f632){return{'name':_0x17f632[_0x23b9('0x3e')],'type':_0x17f632[_0x23b9('0x3f')]['key']};});_0x323454[_0x23b9('0x40')]=_['map'](_0xaee8cd,_0x23b9('0x38'));_0x323454[_0x23b9('0x41')]=_[_0x23b9('0x42')](_0x11c1ea[_0x23b9('0x41')]);_0x323454[_0x23b9('0x43')]=_[_0x23b9('0x44')](_0x323454['model'],_0x323454[_0x23b9('0x41')]);_0x4aa568[_0x23b9('0x45')]=_[_0x23b9('0x44')](_0x323454[_0x23b9('0x40')],qs[_0x23b9('0x46')](_0x11c1ea[_0x23b9('0x41')]['fields']));_0x4aa568[_0x23b9('0x45')]=_0x4aa568['attributes'][_0x23b9('0x47')]?_0x4aa568[_0x23b9('0x45')]:_0x323454[_0x23b9('0x40')];if(!_0x11c1ea['query'][_0x23b9('0x48')]('nolimit')){_0x4aa568[_0x23b9('0x30')]=qs[_0x23b9('0x30')](_0x11c1ea[_0x23b9('0x41')][_0x23b9('0x30')]);_0x4aa568[_0x23b9('0x2e')]=qs[_0x23b9('0x2e')](_0x11c1ea[_0x23b9('0x41')][_0x23b9('0x2e')]);}_0x4aa568['order']=qs[_0x23b9('0x49')](_0x11c1ea[_0x23b9('0x41')][_0x23b9('0x49')]);_0x4aa568[_0x23b9('0x4a')]=qs[_0x23b9('0x43')](_[_0x23b9('0x4b')](_0x11c1ea[_0x23b9('0x41')],_0x323454[_0x23b9('0x43')]),_0xaee8cd);if(_0x11c1ea['query']['filter']){_0x4aa568[_0x23b9('0x4a')]=_[_0x23b9('0x4c')](_0x4aa568[_0x23b9('0x4a')],{'$or':_[_0x23b9('0x3b')](_0xaee8cd,function(_0xe5ee08){if(_0xe5ee08[_0x23b9('0x3f')]!=='VIRTUAL'){var _0x4cb554={};_0x4cb554[_0xe5ee08['name']]={'$like':'%'+_0x11c1ea[_0x23b9('0x41')][_0x23b9('0x4d')]+'%'};return _0x4cb554;}})});}_0x4aa568=_[_0x23b9('0x4c')]({},_0x4aa568,_0x11c1ea[_0x23b9('0x4e')]);var _0x182659={'where':_0x4aa568[_0x23b9('0x4a')]};return db[_0x23b9('0x3c')][_0x23b9('0x31')](_0x182659)[_0x23b9('0x21')](function(_0x49ccb4){_0x35f9d7[_0x23b9('0x31')]=_0x49ccb4;if(_0x11c1ea[_0x23b9('0x41')][_0x23b9('0x4f')]){_0x4aa568[_0x23b9('0x50')]=[{'all':!![]}];}return db['ChatQueue'][_0x23b9('0x51')](_0x4aa568);})[_0x23b9('0x21')](function(_0x3d44bf){_0x35f9d7[_0x23b9('0x52')]=_0x3d44bf;return _0x35f9d7;})['then'](respondWithFilteredResult(_0x2abb99,_0x4aa568))[_0x23b9('0x2b')](handleError(_0x2abb99,null));};exports[_0x23b9('0x53')]=function(_0x5e364b,_0x116fd0){var _0x304317={'raw':!![],'where':{'id':_0x5e364b[_0x23b9('0x54')]['id']}},_0xa34ff={};_0xa34ff[_0x23b9('0x40')]=_['keys'](db['ChatQueue']['rawAttributes']);_0xa34ff['query']=_[_0x23b9('0x42')](_0x5e364b[_0x23b9('0x41')]);_0xa34ff[_0x23b9('0x43')]=_[_0x23b9('0x44')](_0xa34ff[_0x23b9('0x40')],_0xa34ff['query']);_0x304317['attributes']=_[_0x23b9('0x44')](_0xa34ff[_0x23b9('0x40')],qs[_0x23b9('0x46')](_0x5e364b[_0x23b9('0x41')][_0x23b9('0x46')]));_0x304317[_0x23b9('0x45')]=_0x304317[_0x23b9('0x45')]['length']?_0x304317['attributes']:_0xa34ff['model'];if(_0x5e364b[_0x23b9('0x41')][_0x23b9('0x4f')]){_0x304317[_0x23b9('0x50')]=[{'all':!![]}];}_0x304317=_[_0x23b9('0x4c')]({},_0x304317,_0x5e364b[_0x23b9('0x4e')]);return db[_0x23b9('0x3c')][_0x23b9('0x55')](_0x304317)['then'](handleEntityNotFound(_0x116fd0,null))[_0x23b9('0x21')](respondWithResult(_0x116fd0,null))['catch'](handleError(_0x116fd0,null));};exports['create']=function(_0x59e6ec,_0x3edd5b){return db[_0x23b9('0x3c')][_0x23b9('0x56')](_0x59e6ec['body'],{})[_0x23b9('0x21')](function(_0xa82dd0){var _0x2ba592=_0x59e6ec[_0x23b9('0x57')]['get']({'plain':!![]});if(!_0x2ba592)throw new Error(_0x23b9('0x58'));if(_0x2ba592['role']===_0x23b9('0x57')){var _0x72f4eb=_0xa82dd0[_0x23b9('0x59')]({'plain':!![]});var _0x286fc3=_0x23b9('0x35');return db['UserProfileSection']['find']({'where':{'name':_0x286fc3,'userProfileId':_0x2ba592['userProfileId']},'raw':!![]})[_0x23b9('0x21')](function(_0x4cd86c){if(_0x4cd86c&&_0x4cd86c[_0x23b9('0x5a')]===0x0){return db[_0x23b9('0x5b')][_0x23b9('0x56')]({'name':_0x72f4eb[_0x23b9('0x38')],'resourceId':_0x72f4eb['id'],'type':_0x4cd86c['name'],'sectionId':_0x4cd86c['id']},{})['then'](function(){return _0xa82dd0;});}else{return _0xa82dd0;}})[_0x23b9('0x2b')](function(_0x37426d){logger[_0x23b9('0x25')](_0x23b9('0x5c'),_0x37426d);throw _0x37426d;});}return _0xa82dd0;})[_0x23b9('0x21')](respondWithResult(_0x3edd5b,0xc9))[_0x23b9('0x2b')](handleError(_0x3edd5b,null));};exports['update']=function(_0x31f22f,_0x491db2){if(_0x31f22f['body']['id']){delete _0x31f22f[_0x23b9('0x5d')]['id'];}return db[_0x23b9('0x3c')]['find']({'where':{'id':_0x31f22f[_0x23b9('0x54')]['id']}})[_0x23b9('0x21')](handleEntityNotFound(_0x491db2,null))['then'](saveUpdates(_0x31f22f[_0x23b9('0x5d')],null))['then'](respondWithResult(_0x491db2,null))[_0x23b9('0x2b')](handleError(_0x491db2,null));};exports['destroy']=function(_0x1aa191,_0xd56e33){return db[_0x23b9('0x3c')][_0x23b9('0x55')]({'where':{'id':_0x1aa191[_0x23b9('0x54')]['id']}})[_0x23b9('0x21')](handleEntityNotFound(_0xd56e33,null))[_0x23b9('0x21')](removeEntity(_0xd56e33,null))[_0x23b9('0x2b')](handleError(_0xd56e33,null));};exports['describe']=function(_0x297f9a,_0x28a9a3){return db[_0x23b9('0x3c')][_0x23b9('0x5e')]()[_0x23b9('0x21')](respondWithResult(_0x28a9a3,null))[_0x23b9('0x2b')](handleError(_0x28a9a3,null));};exports[_0x23b9('0x5f')]=function(_0x3fc664,_0x211760,_0x149530){var _0x1e5d83={'raw':!![],'where':{}},_0x3de456={},_0x37eac8;return db[_0x23b9('0x3c')][_0x23b9('0x60')]({'where':{'id':_0x3fc664[_0x23b9('0x54')]['id']}})[_0x23b9('0x21')](handleEntityNotFound(_0x211760,null))[_0x23b9('0x21')](function(_0x350d9a){if(_0x350d9a){_0x37eac8=_0x350d9a[_0x23b9('0x59')]({'plain':!![]});_0x3de456['model']=_['keys'](db[_0x23b9('0x61')]['rawAttributes']);_0x3de456[_0x23b9('0x41')]=_[_0x23b9('0x42')](_0x3fc664[_0x23b9('0x41')]);_0x3de456['filters']=_[_0x23b9('0x44')](_0x3de456[_0x23b9('0x40')],_0x3de456['query']);_0x1e5d83[_0x23b9('0x45')]=_[_0x23b9('0x44')](_0x3de456[_0x23b9('0x40')],qs[_0x23b9('0x46')](_0x3fc664[_0x23b9('0x41')][_0x23b9('0x46')]));_0x1e5d83[_0x23b9('0x45')]=_0x1e5d83[_0x23b9('0x45')][_0x23b9('0x47')]?_0x1e5d83['attributes']:_0x3de456[_0x23b9('0x40')];if(!_0x3fc664[_0x23b9('0x41')]['hasOwnProperty'](_0x23b9('0x62'))){_0x1e5d83[_0x23b9('0x30')]=qs[_0x23b9('0x30')](_0x3fc664[_0x23b9('0x41')][_0x23b9('0x30')]);_0x1e5d83[_0x23b9('0x2e')]=qs[_0x23b9('0x2e')](_0x3fc664[_0x23b9('0x41')]['offset']);}_0x1e5d83[_0x23b9('0x63')]=qs[_0x23b9('0x49')](_0x3fc664[_0x23b9('0x41')][_0x23b9('0x49')]);_0x1e5d83[_0x23b9('0x4a')]=qs[_0x23b9('0x43')](_[_0x23b9('0x4b')](_0x3fc664['query'],_0x3de456[_0x23b9('0x43')]));_0x1e5d83[_0x23b9('0x4a')][_0x23b9('0x64')]=_0x350d9a['id'];if(_0x3fc664['query'][_0x23b9('0x4d')]){_0x1e5d83[_0x23b9('0x4a')]=_[_0x23b9('0x4c')](_0x1e5d83['where'],{'$or':_['map'](_0x1e5d83[_0x23b9('0x45')],function(_0x246cba){var _0x5e270a={};_0x5e270a[_0x246cba]={'$like':'%'+_0x3fc664[_0x23b9('0x41')][_0x23b9('0x4d')]+'%'};return _0x5e270a;})});}_0x1e5d83=_['merge']({},_0x1e5d83,_0x3fc664['options']);return db[_0x23b9('0x61')][_0x23b9('0x51')](_0x1e5d83);}})[_0x23b9('0x21')](function(_0x40f2c1){if(_0x40f2c1){return db[_0x23b9('0x65')]['findAndCountAll']({'where':{'id':_[_0x23b9('0x3b')](_0x40f2c1,_0x23b9('0x66')),'role':_0x23b9('0x67')},'attributes':['id',_0x23b9('0x38'),_0x23b9('0x68'),_0x23b9('0x69'),_0x23b9('0x6a')]});}})[_0x23b9('0x21')](function(_0x570cee){if(_0x570cee){return{'count':_0x570cee[_0x23b9('0x31')],'rows':_[_0x23b9('0x3b')](_0x570cee[_0x23b9('0x52')],function(_0x199cbd){return{'membername':_0x199cbd['name'],'UserId':_0x199cbd['id'],'queue_name':_0x37eac8['name'],'ChatQueueId':_0x37eac8['id'],'interface':util[_0x23b9('0x6b')](_0x23b9('0x6c'),'SIP',_0x199cbd[_0x23b9('0x38')]),'penalty':0x0,'paused':_0x199cbd[_0x23b9('0x68')],'createdAt':_0x199cbd['createdAt'],'updatedAt':_0x199cbd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x23b9('0x21')](respondWithFilteredResult(_0x211760,_0x1e5d83))['catch'](handleError(_0x211760,null));};exports['getTeams']=function(_0xee0046,_0x121704,_0x5d8f5a){var _0xd7a8c7={};var _0xabd4ff={};var _0x20d9bd;var _0x5487c2;return db[_0x23b9('0x3c')][_0x23b9('0x60')]({'where':{'id':_0xee0046['params']['id']}})[_0x23b9('0x21')](handleEntityNotFound(_0x121704,null))['then'](function(_0x1f6bcd){if(_0x1f6bcd){_0x20d9bd=_0x1f6bcd;_0xabd4ff[_0x23b9('0x40')]=_[_0x23b9('0x42')](db[_0x23b9('0x6d')]['rawAttributes']);_0xabd4ff[_0x23b9('0x41')]=_[_0x23b9('0x42')](_0xee0046[_0x23b9('0x41')]);_0xabd4ff['filters']=_[_0x23b9('0x44')](_0xabd4ff[_0x23b9('0x40')],_0xabd4ff['query']);_0xd7a8c7['attributes']=_[_0x23b9('0x44')](_0xabd4ff['model'],qs[_0x23b9('0x46')](_0xee0046[_0x23b9('0x41')][_0x23b9('0x46')]));_0xd7a8c7[_0x23b9('0x45')]=_0xd7a8c7[_0x23b9('0x45')][_0x23b9('0x47')]?_0xd7a8c7[_0x23b9('0x45')]:_0xabd4ff[_0x23b9('0x40')];_0xd7a8c7['order']=qs[_0x23b9('0x49')](_0xee0046[_0x23b9('0x41')][_0x23b9('0x49')]);_0xd7a8c7[_0x23b9('0x4a')]=qs[_0x23b9('0x43')](_[_0x23b9('0x4b')](_0xee0046[_0x23b9('0x41')],_0xabd4ff[_0x23b9('0x43')]));if(_0xee0046[_0x23b9('0x41')][_0x23b9('0x4d')]){_0xd7a8c7[_0x23b9('0x4a')]=_['merge'](_0xd7a8c7['where'],{'$or':_[_0x23b9('0x3b')](_0xd7a8c7[_0x23b9('0x45')],function(_0x484a6d){var _0x211999={};_0x211999[_0x484a6d]={'$like':'%'+_0xee0046[_0x23b9('0x41')][_0x23b9('0x4d')]+'%'};return _0x211999;})});}_0xd7a8c7=_[_0x23b9('0x4c')]({},_0xd7a8c7,_0xee0046[_0x23b9('0x4e')]);return _0x20d9bd['getTeams'](_0xd7a8c7);}})[_0x23b9('0x21')](function(_0xc956c7){if(_0xc956c7){_0x5487c2=_0xc956c7[_0x23b9('0x47')];if(!_0xee0046[_0x23b9('0x41')][_0x23b9('0x48')]('nolimit')){_0xd7a8c7[_0x23b9('0x30')]=qs[_0x23b9('0x30')](_0xee0046[_0x23b9('0x41')][_0x23b9('0x30')]);_0xd7a8c7[_0x23b9('0x2e')]=qs['offset'](_0xee0046[_0x23b9('0x41')][_0x23b9('0x2e')]);}return _0x20d9bd[_0x23b9('0x6e')](_0xd7a8c7);}})['then'](function(_0x5df42c){if(_0x5df42c){return _0x5df42c?{'count':_0x5487c2,'rows':_0x5df42c}:null;}})['then'](respondWithResult(_0x121704,null))[_0x23b9('0x2b')](handleError(_0x121704,null));};exports[_0x23b9('0x6f')]=function(_0x23ba07,_0xa84b81,_0x258323){var _0x1454f3=_0x23ba07[_0x23b9('0x5d')][_0x23b9('0x70')];return db[_0x23b9('0x6d')][_0x23b9('0x51')]({'where':{'id':_0x1454f3},'attributes':['id'],'include':[{'model':db[_0x23b9('0x65')],'as':_0x23b9('0x71'),'attributes':['id','name',_0x23b9('0x72'),_0x23b9('0x73'),_0x23b9('0x74')],'raw':!![]}]})[_0x23b9('0x21')](function(_0x5da7a3){if(_0x5da7a3){var _0x4734bb=_[_0x23b9('0x75')](_0x5da7a3,function(_0x317690){var _0x42c027=_0x317690['get']({'plain':!![]});return _0x42c027[_0x23b9('0x71')];});return db[_0x23b9('0x3c')]['find']({'where':{'id':_0x23ba07['params']['id']}})['then'](function(_0x5a33f7){return db['sequelize'][_0x23b9('0x76')](function(_0x5a645f){return _0x5a33f7[_0x23b9('0x6f')](_0x1454f3,{'transaction':_0x5a645f})[_0x23b9('0x21')](function(){return BPromise[_0x23b9('0x77')](_0x4734bb,function(_0xf58648){return db['UserChatQueue'][_0x23b9('0x78')]({'where':{'UserId':_0xf58648['id'],'ChatQueueId':_0x23ba07[_0x23b9('0x54')]['id']},'transaction':_0x5a645f});});})['then'](function(){_0x4734bb[_0x23b9('0x79')](function(_0x58f5b9){socket[_0x23b9('0x7a')](_0x23b9('0x7b'),{'UserId':_0x58f5b9['id'],'ChatQueueId':_0x5a33f7['id']});});});});});}})['then'](respondWithStatusCode(_0xa84b81,null))['catch'](handleError(_0xa84b81,null));};exports['removeTeams']=function(_0x534959,_0x23e608,_0x2d3751){return db[_0x23b9('0x6d')][_0x23b9('0x51')]({'where':{'id':_0x534959[_0x23b9('0x41')][_0x23b9('0x70')]},'attributes':['id'],'include':[{'model':db[_0x23b9('0x65')],'as':_0x23b9('0x71'),'attributes':['id'],'raw':!![]}]})[_0x23b9('0x21')](handleEntityNotFound(_0x23e608,null))[_0x23b9('0x21')](function(_0x3ab018){var _0x8fc420=_[_0x23b9('0x3b')](_0x3ab018,'id');var _0x16d990=[];var _0x5de982=[];var _0xf6368e=squel[_0x23b9('0x7c')]();_0xf6368e[_0x23b9('0x7d')](_0x23b9('0x7e'))[_0x23b9('0x7f')](_0x23b9('0x80'),'tq')[_0x23b9('0x81')](_0x23b9('0x82'),'ut',_0x23b9('0x83'))[_0x23b9('0x4a')](_0x23b9('0x84'),_0x534959[_0x23b9('0x54')]['id']);for(var _0xdcb02e=0x0;_0xdcb02e<_0x3ab018[_0x23b9('0x47')];_0xdcb02e+=0x1){let _0x2b4d0f=_0x3ab018[_0xdcb02e];for(var _0x17f223=0x0;_0x17f223<_0x2b4d0f['Agents']['length'];_0x17f223+=0x1){let _0x3fc559=_0x2b4d0f['Agents'][_0x17f223];var _0x5a4cc5=_0xf6368e[_0x23b9('0x85')]();_0x5a4cc5[_0x23b9('0x4a')](_0x23b9('0x86'),_0x3fc559['id']);_0x5de982[_0x23b9('0x87')](db[_0x23b9('0x88')][_0x23b9('0x41')](_0x5a4cc5[_0x23b9('0x89')](),{'type':db[_0x23b9('0x88')][_0x23b9('0x8a')]['SELECT']})['then'](function(_0x42763b){if(_0x42763b['length']===0x1){return _0x3fc559['id'];}else{var _0x5e78f7=_[_0x23b9('0x8b')](_['map'](_0x42763b,_0x23b9('0x8c')),function(_0x13b0bd){return _[_0x23b9('0x8d')](_0x8fc420,_0x13b0bd);});if(_0x5e78f7){return _0x3fc559['id'];}}}));}}return BPromise['all'](_0x5de982)['then'](function(_0x457d3c){_0x16d990=_(_0x16d990)['union'](_0x457d3c)['compact']()['value']();return db[_0x23b9('0x3c')][_0x23b9('0x55')]({'where':{'id':_0x534959[_0x23b9('0x54')]['id']}})[_0x23b9('0x21')](function(_0x203b10){return db[_0x23b9('0x88')]['transaction'](function(_0x35a04b){return _0x203b10[_0x23b9('0x8e')](_0x534959['query']['ids'],{'transaction':_0x35a04b})[_0x23b9('0x21')](function(){if(!_[_0x23b9('0x8f')](_0x16d990)){return _0x203b10[_0x23b9('0x90')](_0x16d990,{'transaction':_0x35a04b});}})[_0x23b9('0x21')](function(){_0x16d990[_0x23b9('0x79')](function(_0x39330c){socket[_0x23b9('0x7a')]('userChatQueue:remove',{'UserId':_0x39330c,'ChatQueueId':_0x203b10['id']});});});});});});})[_0x23b9('0x21')](respondWithStatusCode(_0x23e608,null))['catch'](handleError(_0x23e608,null));};exports[_0x23b9('0x91')]=function(_0x247c48,_0x5e6dd2,_0xf9f82b){return db['ChatQueue'][_0x23b9('0x55')]({'where':{'id':_0x247c48[_0x23b9('0x54')]['id']}})[_0x23b9('0x21')](handleEntityNotFound(_0x5e6dd2,null))[_0x23b9('0x21')](function(_0x6a17e3){if(_0x6a17e3){return _0x6a17e3[_0x23b9('0x91')](_0x247c48['body'][_0x23b9('0x70')],_[_0x23b9('0x92')](_0x247c48[_0x23b9('0x5d')],[_0x23b9('0x70'),'id'])||{})[_0x23b9('0x93')](function(_0xa72f3b){for(var _0x342cbe=0x0;_0x342cbe<_0x247c48[_0x23b9('0x5d')][_0x23b9('0x70')][_0x23b9('0x47')];_0x342cbe+=0x1){socket[_0x23b9('0x7a')](_0x23b9('0x7b'),{'UserId':Number(_0x247c48['body'][_0x23b9('0x70')][_0x342cbe]),'ChatQueueId':Number(_0x247c48[_0x23b9('0x54')]['id'])});}return _0xa72f3b;});}})[_0x23b9('0x21')](respondWithResult(_0x5e6dd2,null))[_0x23b9('0x2b')](handleError(_0x5e6dd2,null));};exports['removeAgents']=function(_0x3c13ef,_0x140351,_0x2587af){return db[_0x23b9('0x3c')][_0x23b9('0x55')]({'where':{'id':_0x3c13ef['params']['id']}})['then'](handleEntityNotFound(_0x140351,null))[_0x23b9('0x21')](function(_0x461e2b){if(_0x461e2b){return _0x461e2b[_0x23b9('0x90')](_0x3c13ef[_0x23b9('0x41')]['ids'])[_0x23b9('0x21')](function(){if(_[_0x23b9('0x94')](_0x3c13ef[_0x23b9('0x41')][_0x23b9('0x70')])){for(var _0x2f7037=0x0;_0x2f7037<_0x3c13ef[_0x23b9('0x41')][_0x23b9('0x70')][_0x23b9('0x47')];_0x2f7037+=0x1){socket[_0x23b9('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x3c13ef[_0x23b9('0x41')]['ids'][_0x2f7037]),'ChatQueueId':Number(_0x3c13ef[_0x23b9('0x54')]['id'])});}}else{socket[_0x23b9('0x7a')](_0x23b9('0x95'),{'UserId':Number(_0x3c13ef['query']['ids']),'ChatQueueId':Number(_0x3c13ef[_0x23b9('0x54')]['id'])});}});}})[_0x23b9('0x21')](respondWithStatusCode(_0x140351,null))[_0x23b9('0x2b')](handleError(_0x140351,null));};exports[_0x23b9('0x96')]=function(_0x2211ca,_0x696fe3,_0x3da3cf){var _0xb58851={};var _0x3ac215={};var _0x4a225e;var _0x2f370a;return db[_0x23b9('0x3c')][_0x23b9('0x60')]({'where':{'id':_0x2211ca['params']['id']}})[_0x23b9('0x21')](handleEntityNotFound(_0x696fe3,null))[_0x23b9('0x21')](function(_0x41b0b8){if(_0x41b0b8){_0x4a225e=_0x41b0b8;_0x3ac215[_0x23b9('0x40')]=_[_0x23b9('0x42')](db[_0x23b9('0x65')][_0x23b9('0x3d')]);_0x3ac215['query']=_[_0x23b9('0x42')](_0x2211ca[_0x23b9('0x41')]);_0x3ac215[_0x23b9('0x43')]=_['intersection'](_0x3ac215[_0x23b9('0x40')],_0x3ac215['query']);_0xb58851[_0x23b9('0x45')]=_[_0x23b9('0x44')](_0x3ac215[_0x23b9('0x40')],qs[_0x23b9('0x46')](_0x2211ca[_0x23b9('0x41')][_0x23b9('0x46')]));_0xb58851['attributes']=_0xb58851[_0x23b9('0x45')][_0x23b9('0x47')]?_0xb58851['attributes']:_0x3ac215['model'];_0xb58851[_0x23b9('0x63')]=qs['sort'](_0x2211ca['query'][_0x23b9('0x49')]);_0xb58851[_0x23b9('0x4a')]=qs[_0x23b9('0x43')](_[_0x23b9('0x4b')](_0x2211ca[_0x23b9('0x41')],_0x3ac215['filters']));if(_0x2211ca[_0x23b9('0x41')][_0x23b9('0x4d')]){_0xb58851[_0x23b9('0x4a')]=_['merge'](_0xb58851['where'],{'$or':_[_0x23b9('0x3b')](_0xb58851[_0x23b9('0x45')],function(_0x43e3bc){var _0x79bcad={};_0x79bcad[_0x43e3bc]={'$like':'%'+_0x2211ca[_0x23b9('0x41')][_0x23b9('0x4d')]+'%'};return _0x79bcad;})});}_0xb58851=_[_0x23b9('0x4c')]({},_0xb58851,_0x2211ca[_0x23b9('0x4e')]);return _0x4a225e[_0x23b9('0x96')](_0xb58851);}})[_0x23b9('0x21')](function(_0x337a2e){if(_0x337a2e){_0x2f370a=_0x337a2e[_0x23b9('0x47')];if(!_0x2211ca[_0x23b9('0x41')][_0x23b9('0x48')](_0x23b9('0x62'))){_0xb58851[_0x23b9('0x30')]=qs['limit'](_0x2211ca[_0x23b9('0x41')][_0x23b9('0x30')]);_0xb58851[_0x23b9('0x2e')]=qs[_0x23b9('0x2e')](_0x2211ca[_0x23b9('0x41')][_0x23b9('0x2e')]);}return _0x4a225e['getAgents'](_0xb58851);}})['then'](function(_0xba1af8){if(_0xba1af8){return _0xba1af8?{'count':_0x2f370a,'rows':_0xba1af8}:null;}})[_0x23b9('0x21')](respondWithResult(_0x696fe3,null))[_0x23b9('0x2b')](handleError(_0x696fe3,null));}; \ No newline at end of file +var _0x81a1=['offset','limit','count','set','Content-Range','reject','update','destroy','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','fields','length','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','findOne','UserChatQueue','rawAttributes','intersection','sort','findAndCountAll','UserId','agent','format','%s/%s','SIP','chatPause','createdAt','updatedAt','getTeams','addTeams','Team','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userChatQueue:save','ids','User','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','Agents','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','transaction','removeTeams','isEmpty','addAgents','omit','spread','emit','removeAgents','isArray','userChatQueue:remove','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status'];(function(_0x32ee4b,_0x436804){var _0x326cf7=function(_0x1b0b41){while(--_0x1b0b41){_0x32ee4b['push'](_0x32ee4b['shift']());}};_0x326cf7(++_0x436804);}(_0x81a1,0x185));var _0x181a=function(_0x294342,_0x4595ff){_0x294342=_0x294342-0x0;var _0x1a93da=_0x81a1[_0x294342];return _0x1a93da;};'use strict';var emlformat=require(_0x181a('0x0'));var rimraf=require(_0x181a('0x1'));var zipdir=require(_0x181a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x181a('0x3'));var moment=require(_0x181a('0x4'));var BPromise=require(_0x181a('0x5'));var Mustache=require(_0x181a('0x6'));var util=require(_0x181a('0x7'));var path=require('path');var sox=require(_0x181a('0x8'));var csv=require('to-csv');var ejs=require(_0x181a('0x9'));var fs=require('fs');var fs_extra=require(_0x181a('0xa'));var _=require('lodash');var squel=require(_0x181a('0xb'));var crypto=require(_0x181a('0xc'));var jsforce=require(_0x181a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x181a('0xe'));var Papa=require(_0x181a('0xf'));var Redis=require('ioredis');var authService=require(_0x181a('0x10'));var qs=require(_0x181a('0x11'));var as=require(_0x181a('0x12'));var hardwareService=require(_0x181a('0x13'));var logger=require('../../config/logger')(_0x181a('0x14'));var utils=require('../../config/utils');var config=require(_0x181a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x181a('0x16'))['db'];config[_0x181a('0x17')]=_['defaults'](config[_0x181a('0x17')],{'host':_0x181a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x181a('0x17')]));require(_0x181a('0x19'))['register'](socket);var jayson=require(_0x181a('0x1a'));var client=jayson[_0x181a('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353ade,_0x481fad,_0x22699d,_0x1c2fd8){return new BPromise(function(_0x4fc0d7,_0x5bd9dd){var _0x8c1bb6=_0x1c2fd8||client;return _0x8c1bb6[_0x181a('0x1c')](_0x353ade,_0x22699d)[_0x181a('0x1d')](function(_0x1be46b){logger[_0x181a('0x1e')](_0x181a('0x1f'),_0x481fad,'request\x20sent');logger['debug'](_0x181a('0x20'),_0x481fad,_0x181a('0x21'),JSON[_0x181a('0x22')](_0x1be46b));if(_0x1be46b[_0x181a('0x23')]){if(_0x1be46b[_0x181a('0x23')][_0x181a('0x24')]===0x1f4){logger[_0x181a('0x23')]('ChatQueue,\x20%s,\x20%s',_0x481fad,_0x1be46b[_0x181a('0x23')][_0x181a('0x25')]);return _0x5bd9dd(_0x1be46b[_0x181a('0x23')]['message']);}logger[_0x181a('0x23')](_0x181a('0x1f'),_0x481fad,_0x1be46b[_0x181a('0x23')][_0x181a('0x25')]);return _0x4fc0d7(_0x1be46b[_0x181a('0x23')][_0x181a('0x25')]);}else{logger[_0x181a('0x1e')](_0x181a('0x1f'),_0x481fad,'request\x20sent');_0x4fc0d7(_0x1be46b['result'][_0x181a('0x25')]);}})[_0x181a('0x26')](function(_0x4a317c){logger[_0x181a('0x23')](_0x181a('0x1f'),_0x481fad,_0x4a317c);_0x5bd9dd(_0x4a317c);});});}function respondWithStatusCode(_0x1bfc0b,_0x45c5ef){_0x45c5ef=_0x45c5ef||0xcc;return function(_0x4a1dbe){if(_0x4a1dbe){return _0x1bfc0b['sendStatus'](_0x45c5ef);}return _0x1bfc0b[_0x181a('0x27')](_0x45c5ef)['end']();};}function respondWithResult(_0x56af89,_0x373f2b){_0x373f2b=_0x373f2b||0xc8;return function(_0x213fc4){if(_0x213fc4){return _0x56af89[_0x181a('0x27')](_0x373f2b)['json'](_0x213fc4);}};}function respondWithFilteredResult(_0x300779,_0x46a3fb){return function(_0x144af2){if(_0x144af2){var _0x4951cd=typeof _0x46a3fb[_0x181a('0x28')]==='undefined'&&typeof _0x46a3fb[_0x181a('0x29')]==='undefined';var _0x4957d1=_0x144af2[_0x181a('0x2a')];var _0x114ddf=_0x4951cd?0x0:_0x46a3fb[_0x181a('0x28')];var _0x42e689=_0x4951cd?_0x144af2[_0x181a('0x2a')]:_0x46a3fb[_0x181a('0x28')]+_0x46a3fb[_0x181a('0x29')];var _0x5ed960;if(_0x42e689>=_0x4957d1){_0x42e689=_0x4957d1;_0x5ed960=0xc8;}else{_0x5ed960=0xce;}_0x300779[_0x181a('0x27')](_0x5ed960);return _0x300779[_0x181a('0x2b')](_0x181a('0x2c'),_0x114ddf+'-'+_0x42e689+'/'+_0x4957d1)['json'](_0x144af2);}return null;};}function patchUpdates(_0x5172ca){return function(_0x5c3b52){try{jsonpatch['apply'](_0x5c3b52,_0x5172ca,!![]);}catch(_0xb69df8){return BPromise[_0x181a('0x2d')](_0xb69df8);}return _0x5c3b52['save']();};}function saveUpdates(_0x56a782,_0x508ca6){return function(_0x58ecfe){if(_0x58ecfe){return _0x58ecfe[_0x181a('0x2e')](_0x56a782)[_0x181a('0x1d')](function(_0x194ccd){return _0x194ccd;});}return null;};}function removeEntity(_0x549bda,_0x1dba0c){return function(_0x5a2275){if(_0x5a2275){return _0x5a2275[_0x181a('0x2f')]()['then'](function(){var _0x3c91c4=_0x5a2275['get']({'plain':!![]});var _0xdf3df1=_0x181a('0x30');return db[_0x181a('0x31')]['destroy']({'where':{'type':_0xdf3df1,'resourceId':_0x3c91c4['id']}})[_0x181a('0x1d')](function(){return _0x5a2275;});})[_0x181a('0x1d')](function(){_0x549bda['status'](0xcc)[_0x181a('0x32')]();});}};}function handleEntityNotFound(_0x1d1e11,_0x5ce721){return function(_0x22e9e7){if(!_0x22e9e7){_0x1d1e11['sendStatus'](0x194);}return _0x22e9e7;};}function handleError(_0x347d5d,_0xb22162){_0xb22162=_0xb22162||0x1f4;return function(_0x54be72){logger['error'](_0x54be72[_0x181a('0x33')]);if(_0x54be72[_0x181a('0x34')]){delete _0x54be72[_0x181a('0x34')];}_0x347d5d[_0x181a('0x27')](_0xb22162)[_0x181a('0x35')](_0x54be72);};}exports[_0x181a('0x36')]=function(_0x4ee94e,_0x34355d){var _0x20f8e9={},_0x227471={},_0x31bcbd={'count':0x0,'rows':[]};var _0x3cea6e=_[_0x181a('0x37')](db[_0x181a('0x38')]['rawAttributes'],function(_0x452c37){return{'name':_0x452c37[_0x181a('0x39')],'type':_0x452c37[_0x181a('0x3a')][_0x181a('0x3b')]};});_0x227471[_0x181a('0x3c')]=_[_0x181a('0x37')](_0x3cea6e,'name');_0x227471[_0x181a('0x3d')]=_[_0x181a('0x3e')](_0x4ee94e['query']);_0x227471[_0x181a('0x3f')]=_['intersection'](_0x227471['model'],_0x227471[_0x181a('0x3d')]);_0x20f8e9['attributes']=_['intersection'](_0x227471[_0x181a('0x3c')],qs[_0x181a('0x40')](_0x4ee94e['query']['fields']));_0x20f8e9['attributes']=_0x20f8e9['attributes'][_0x181a('0x41')]?_0x20f8e9[_0x181a('0x42')]:_0x227471['model'];if(!_0x4ee94e[_0x181a('0x3d')][_0x181a('0x43')](_0x181a('0x44'))){_0x20f8e9[_0x181a('0x29')]=qs[_0x181a('0x29')](_0x4ee94e['query']['limit']);_0x20f8e9[_0x181a('0x28')]=qs[_0x181a('0x28')](_0x4ee94e[_0x181a('0x3d')][_0x181a('0x28')]);}_0x20f8e9[_0x181a('0x45')]=qs['sort'](_0x4ee94e[_0x181a('0x3d')]['sort']);_0x20f8e9[_0x181a('0x46')]=qs[_0x181a('0x3f')](_[_0x181a('0x47')](_0x4ee94e[_0x181a('0x3d')],_0x227471[_0x181a('0x3f')]),_0x3cea6e);if(_0x4ee94e[_0x181a('0x3d')][_0x181a('0x48')]){_0x20f8e9[_0x181a('0x46')]=_[_0x181a('0x49')](_0x20f8e9[_0x181a('0x46')],{'$or':_[_0x181a('0x37')](_0x3cea6e,function(_0x6215cb){if(_0x6215cb[_0x181a('0x3a')]!=='VIRTUAL'){var _0x58fb92={};_0x58fb92[_0x6215cb['name']]={'$like':'%'+_0x4ee94e['query']['filter']+'%'};return _0x58fb92;}})});}_0x20f8e9=_[_0x181a('0x49')]({},_0x20f8e9,_0x4ee94e[_0x181a('0x4a')]);var _0x1be84a={'where':_0x20f8e9['where']};return db[_0x181a('0x38')][_0x181a('0x2a')](_0x1be84a)['then'](function(_0x1919aa){_0x31bcbd[_0x181a('0x2a')]=_0x1919aa;if(_0x4ee94e['query'][_0x181a('0x4b')]){_0x20f8e9[_0x181a('0x4c')]=[{'all':!![]}];}return db[_0x181a('0x38')][_0x181a('0x4d')](_0x20f8e9);})[_0x181a('0x1d')](function(_0x43b438){_0x31bcbd[_0x181a('0x4e')]=_0x43b438;return _0x31bcbd;})[_0x181a('0x1d')](respondWithFilteredResult(_0x34355d,_0x20f8e9))['catch'](handleError(_0x34355d,null));};exports[_0x181a('0x4f')]=function(_0x20d4c8,_0x520255){var _0x2ee073={'raw':!![],'where':{'id':_0x20d4c8[_0x181a('0x50')]['id']}},_0x5c8f4a={};_0x5c8f4a[_0x181a('0x3c')]=_[_0x181a('0x3e')](db[_0x181a('0x38')]['rawAttributes']);_0x5c8f4a['query']=_[_0x181a('0x3e')](_0x20d4c8[_0x181a('0x3d')]);_0x5c8f4a[_0x181a('0x3f')]=_['intersection'](_0x5c8f4a[_0x181a('0x3c')],_0x5c8f4a[_0x181a('0x3d')]);_0x2ee073['attributes']=_['intersection'](_0x5c8f4a[_0x181a('0x3c')],qs[_0x181a('0x40')](_0x20d4c8[_0x181a('0x3d')][_0x181a('0x40')]));_0x2ee073[_0x181a('0x42')]=_0x2ee073[_0x181a('0x42')][_0x181a('0x41')]?_0x2ee073['attributes']:_0x5c8f4a[_0x181a('0x3c')];if(_0x20d4c8[_0x181a('0x3d')]['includeAll']){_0x2ee073[_0x181a('0x4c')]=[{'all':!![]}];}_0x2ee073=_[_0x181a('0x49')]({},_0x2ee073,_0x20d4c8[_0x181a('0x4a')]);return db[_0x181a('0x38')]['find'](_0x2ee073)[_0x181a('0x1d')](handleEntityNotFound(_0x520255,null))['then'](respondWithResult(_0x520255,null))[_0x181a('0x26')](handleError(_0x520255,null));};exports['create']=function(_0x51bcc8,_0x1d1bdf){return db[_0x181a('0x38')][_0x181a('0x51')](_0x51bcc8[_0x181a('0x52')],{})[_0x181a('0x1d')](function(_0x973a64){var _0x3bef0a=_0x51bcc8[_0x181a('0x53')][_0x181a('0x54')]({'plain':!![]});if(!_0x3bef0a)throw new Error(_0x181a('0x55'));if(_0x3bef0a['role']===_0x181a('0x53')){var _0xc43fb1=_0x973a64['get']({'plain':!![]});var _0x3591b9=_0x181a('0x30');return db[_0x181a('0x56')]['find']({'where':{'name':_0x3591b9,'userProfileId':_0x3bef0a[_0x181a('0x57')]},'raw':!![]})[_0x181a('0x1d')](function(_0x4fc472){if(_0x4fc472&&_0x4fc472['autoAssociation']===0x0){return db[_0x181a('0x31')]['create']({'name':_0xc43fb1[_0x181a('0x34')],'resourceId':_0xc43fb1['id'],'type':_0x4fc472[_0x181a('0x34')],'sectionId':_0x4fc472['id']},{})[_0x181a('0x1d')](function(){return _0x973a64;});}else{return _0x973a64;}})[_0x181a('0x26')](function(_0x14a584){logger[_0x181a('0x23')](_0x181a('0x58'),_0x14a584);throw _0x14a584;});}return _0x973a64;})[_0x181a('0x1d')](respondWithResult(_0x1d1bdf,0xc9))[_0x181a('0x26')](handleError(_0x1d1bdf,null));};exports['update']=function(_0x3caedc,_0x2a40e2){if(_0x3caedc['body']['id']){delete _0x3caedc[_0x181a('0x52')]['id'];}return db[_0x181a('0x38')]['find']({'where':{'id':_0x3caedc[_0x181a('0x50')]['id']}})[_0x181a('0x1d')](handleEntityNotFound(_0x2a40e2,null))[_0x181a('0x1d')](saveUpdates(_0x3caedc[_0x181a('0x52')],null))[_0x181a('0x1d')](respondWithResult(_0x2a40e2,null))[_0x181a('0x26')](handleError(_0x2a40e2,null));};exports['destroy']=function(_0x1cee8e,_0x2ed2a6){return db[_0x181a('0x38')][_0x181a('0x59')]({'where':{'id':_0x1cee8e[_0x181a('0x50')]['id']}})['then'](handleEntityNotFound(_0x2ed2a6,null))[_0x181a('0x1d')](removeEntity(_0x2ed2a6,null))[_0x181a('0x26')](handleError(_0x2ed2a6,null));};exports['describe']=function(_0x562745,_0x49da78){return db['ChatQueue']['describe']()[_0x181a('0x1d')](respondWithResult(_0x49da78,null))[_0x181a('0x26')](handleError(_0x49da78,null));};exports['getMembers']=function(_0x1dcfac,_0x1724c3,_0x33b489){var _0x39d240={'raw':!![],'where':{}},_0x10f5c9={},_0x2bf67a;return db[_0x181a('0x38')][_0x181a('0x5a')]({'where':{'id':_0x1dcfac[_0x181a('0x50')]['id']}})[_0x181a('0x1d')](handleEntityNotFound(_0x1724c3,null))[_0x181a('0x1d')](function(_0x219b45){if(_0x219b45){_0x2bf67a=_0x219b45[_0x181a('0x54')]({'plain':!![]});_0x10f5c9['model']=_[_0x181a('0x3e')](db[_0x181a('0x5b')][_0x181a('0x5c')]);_0x10f5c9[_0x181a('0x3d')]=_[_0x181a('0x3e')](_0x1dcfac[_0x181a('0x3d')]);_0x10f5c9[_0x181a('0x3f')]=_[_0x181a('0x5d')](_0x10f5c9[_0x181a('0x3c')],_0x10f5c9['query']);_0x39d240[_0x181a('0x42')]=_[_0x181a('0x5d')](_0x10f5c9['model'],qs[_0x181a('0x40')](_0x1dcfac['query'][_0x181a('0x40')]));_0x39d240['attributes']=_0x39d240['attributes'][_0x181a('0x41')]?_0x39d240[_0x181a('0x42')]:_0x10f5c9[_0x181a('0x3c')];if(!_0x1dcfac['query'][_0x181a('0x43')](_0x181a('0x44'))){_0x39d240[_0x181a('0x29')]=qs[_0x181a('0x29')](_0x1dcfac[_0x181a('0x3d')][_0x181a('0x29')]);_0x39d240[_0x181a('0x28')]=qs[_0x181a('0x28')](_0x1dcfac[_0x181a('0x3d')][_0x181a('0x28')]);}_0x39d240[_0x181a('0x45')]=qs[_0x181a('0x5e')](_0x1dcfac['query']['sort']);_0x39d240[_0x181a('0x46')]=qs[_0x181a('0x3f')](_[_0x181a('0x47')](_0x1dcfac[_0x181a('0x3d')],_0x10f5c9[_0x181a('0x3f')]));_0x39d240[_0x181a('0x46')]['ChatQueueId']=_0x219b45['id'];if(_0x1dcfac['query']['filter']){_0x39d240[_0x181a('0x46')]=_[_0x181a('0x49')](_0x39d240[_0x181a('0x46')],{'$or':_['map'](_0x39d240[_0x181a('0x42')],function(_0x4557ad){var _0x1ba220={};_0x1ba220[_0x4557ad]={'$like':'%'+_0x1dcfac['query'][_0x181a('0x48')]+'%'};return _0x1ba220;})});}_0x39d240=_['merge']({},_0x39d240,_0x1dcfac[_0x181a('0x4a')]);return db[_0x181a('0x5b')][_0x181a('0x4d')](_0x39d240);}})[_0x181a('0x1d')](function(_0x40754b){if(_0x40754b){return db['User'][_0x181a('0x5f')]({'where':{'id':_[_0x181a('0x37')](_0x40754b,_0x181a('0x60')),'role':_0x181a('0x61')},'attributes':['id','name','chatPause','updatedAt','createdAt']});}})[_0x181a('0x1d')](function(_0x187b1f){if(_0x187b1f){return{'count':_0x187b1f[_0x181a('0x2a')],'rows':_[_0x181a('0x37')](_0x187b1f[_0x181a('0x4e')],function(_0x5243dd){return{'membername':_0x5243dd[_0x181a('0x34')],'UserId':_0x5243dd['id'],'queue_name':_0x2bf67a['name'],'ChatQueueId':_0x2bf67a['id'],'interface':util[_0x181a('0x62')](_0x181a('0x63'),_0x181a('0x64'),_0x5243dd[_0x181a('0x34')]),'penalty':0x0,'paused':_0x5243dd[_0x181a('0x65')],'createdAt':_0x5243dd[_0x181a('0x66')],'updatedAt':_0x5243dd[_0x181a('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1724c3,_0x39d240))[_0x181a('0x26')](handleError(_0x1724c3,null));};exports['getTeams']=function(_0x58f06b,_0x560bc6,_0x4dbd1b){var _0x3041bb={};var _0xfa018d={};var _0x359271;var _0x5683f9;return db[_0x181a('0x38')]['findOne']({'where':{'id':_0x58f06b[_0x181a('0x50')]['id']}})[_0x181a('0x1d')](handleEntityNotFound(_0x560bc6,null))[_0x181a('0x1d')](function(_0x1d2a83){if(_0x1d2a83){_0x359271=_0x1d2a83;_0xfa018d[_0x181a('0x3c')]=_[_0x181a('0x3e')](db['Team'][_0x181a('0x5c')]);_0xfa018d[_0x181a('0x3d')]=_['keys'](_0x58f06b['query']);_0xfa018d['filters']=_[_0x181a('0x5d')](_0xfa018d['model'],_0xfa018d[_0x181a('0x3d')]);_0x3041bb[_0x181a('0x42')]=_['intersection'](_0xfa018d[_0x181a('0x3c')],qs[_0x181a('0x40')](_0x58f06b[_0x181a('0x3d')][_0x181a('0x40')]));_0x3041bb[_0x181a('0x42')]=_0x3041bb[_0x181a('0x42')]['length']?_0x3041bb[_0x181a('0x42')]:_0xfa018d[_0x181a('0x3c')];_0x3041bb['order']=qs[_0x181a('0x5e')](_0x58f06b[_0x181a('0x3d')]['sort']);_0x3041bb[_0x181a('0x46')]=qs[_0x181a('0x3f')](_['pick'](_0x58f06b['query'],_0xfa018d[_0x181a('0x3f')]));if(_0x58f06b[_0x181a('0x3d')][_0x181a('0x48')]){_0x3041bb['where']=_[_0x181a('0x49')](_0x3041bb['where'],{'$or':_[_0x181a('0x37')](_0x3041bb[_0x181a('0x42')],function(_0x3308db){var _0xac6243={};_0xac6243[_0x3308db]={'$like':'%'+_0x58f06b[_0x181a('0x3d')][_0x181a('0x48')]+'%'};return _0xac6243;})});}_0x3041bb=_[_0x181a('0x49')]({},_0x3041bb,_0x58f06b['options']);return _0x359271['getTeams'](_0x3041bb);}})[_0x181a('0x1d')](function(_0x3e5864){if(_0x3e5864){_0x5683f9=_0x3e5864[_0x181a('0x41')];if(!_0x58f06b[_0x181a('0x3d')][_0x181a('0x43')]('nolimit')){_0x3041bb['limit']=qs[_0x181a('0x29')](_0x58f06b[_0x181a('0x3d')]['limit']);_0x3041bb[_0x181a('0x28')]=qs[_0x181a('0x28')](_0x58f06b[_0x181a('0x3d')][_0x181a('0x28')]);}return _0x359271[_0x181a('0x68')](_0x3041bb);}})[_0x181a('0x1d')](function(_0x28d7a1){if(_0x28d7a1){return _0x28d7a1?{'count':_0x5683f9,'rows':_0x28d7a1}:null;}})[_0x181a('0x1d')](respondWithResult(_0x560bc6,null))['catch'](handleError(_0x560bc6,null));};exports[_0x181a('0x69')]=function(_0x2d9fc9,_0x184877,_0x150b5b){var _0xe470f0=_0x2d9fc9[_0x181a('0x52')]['ids'];return db[_0x181a('0x6a')][_0x181a('0x4d')]({'where':{'id':_0xe470f0},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x181a('0x34'),'online',_0x181a('0x6b'),_0x181a('0x6c')],'raw':!![]}]})[_0x181a('0x1d')](function(_0x52ce8c){if(_0x52ce8c){var _0x1c2f4e=_[_0x181a('0x6d')](_0x52ce8c,function(_0x202e7b){var _0x282799=_0x202e7b[_0x181a('0x54')]({'plain':!![]});return _0x282799['Agents'];});return db[_0x181a('0x38')][_0x181a('0x59')]({'where':{'id':_0x2d9fc9[_0x181a('0x50')]['id']}})[_0x181a('0x1d')](function(_0x27d309){return db[_0x181a('0x6e')]['transaction'](function(_0xe8edca){return _0x27d309[_0x181a('0x69')](_0xe470f0,{'transaction':_0xe8edca})[_0x181a('0x1d')](function(){return BPromise[_0x181a('0x6f')](_0x1c2f4e,function(_0x274e70){return db[_0x181a('0x5b')][_0x181a('0x70')]({'where':{'UserId':_0x274e70['id'],'ChatQueueId':_0x2d9fc9[_0x181a('0x50')]['id']},'transaction':_0xe8edca});});})['then'](function(){_0x1c2f4e[_0x181a('0x71')](function(_0x3a349f){socket['emit'](_0x181a('0x72'),{'UserId':_0x3a349f['id'],'ChatQueueId':_0x27d309['id']});});});});});}})[_0x181a('0x1d')](respondWithStatusCode(_0x184877,null))[_0x181a('0x26')](handleError(_0x184877,null));};exports['removeTeams']=function(_0x5b24f1,_0x9e4ce8,_0x51c4da){return db[_0x181a('0x6a')]['findAll']({'where':{'id':_0x5b24f1[_0x181a('0x3d')][_0x181a('0x73')]},'attributes':['id'],'include':[{'model':db[_0x181a('0x74')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x181a('0x1d')](handleEntityNotFound(_0x9e4ce8,null))[_0x181a('0x1d')](function(_0xbfca33){var _0x25285a=_[_0x181a('0x37')](_0xbfca33,'id');var _0x3eea7a=[];var _0x1da324=[];var _0x2e13bb=squel[_0x181a('0x75')]();_0x2e13bb[_0x181a('0x76')](_0x181a('0x77'))['from']('team_has_chat_queues','tq')[_0x181a('0x78')]('user_has_teams','ut',_0x181a('0x79'))[_0x181a('0x46')]('ChatQueueId\x20=\x20?',_0x5b24f1[_0x181a('0x50')]['id']);for(var _0x2de46c=0x0;_0x2de46c<_0xbfca33[_0x181a('0x41')];_0x2de46c+=0x1){let _0x28cecc=_0xbfca33[_0x2de46c];for(var _0xcfdc19=0x0;_0xcfdc19<_0x28cecc[_0x181a('0x7a')][_0x181a('0x41')];_0xcfdc19+=0x1){let _0x40659e=_0x28cecc[_0x181a('0x7a')][_0xcfdc19];var _0x5204a1=_0x2e13bb['clone']();_0x5204a1['where'](_0x181a('0x7b'),_0x40659e['id']);_0x1da324[_0x181a('0x7c')](db[_0x181a('0x6e')][_0x181a('0x3d')](_0x5204a1[_0x181a('0x7d')](),{'type':db['sequelize'][_0x181a('0x7e')]['SELECT']})[_0x181a('0x1d')](function(_0x7ca656){if(_0x7ca656[_0x181a('0x41')]===0x1){return _0x40659e['id'];}else{var _0x4e1d96=_[_0x181a('0x7f')](_[_0x181a('0x37')](_0x7ca656,'TeamId'),function(_0x3cfc62){return _[_0x181a('0x80')](_0x25285a,_0x3cfc62);});if(_0x4e1d96){return _0x40659e['id'];}}}));}}return BPromise[_0x181a('0x81')](_0x1da324)['then'](function(_0x492d1c){_0x3eea7a=_(_0x3eea7a)[_0x181a('0x82')](_0x492d1c)[_0x181a('0x83')]()[_0x181a('0x84')]();return db[_0x181a('0x38')][_0x181a('0x59')]({'where':{'id':_0x5b24f1[_0x181a('0x50')]['id']}})[_0x181a('0x1d')](function(_0x4a256c){return db['sequelize'][_0x181a('0x85')](function(_0x4e432f){return _0x4a256c[_0x181a('0x86')](_0x5b24f1['query']['ids'],{'transaction':_0x4e432f})[_0x181a('0x1d')](function(){if(!_[_0x181a('0x87')](_0x3eea7a)){return _0x4a256c['removeAgents'](_0x3eea7a,{'transaction':_0x4e432f});}})[_0x181a('0x1d')](function(){_0x3eea7a['forEach'](function(_0x3aba10){socket['emit']('userChatQueue:remove',{'UserId':_0x3aba10,'ChatQueueId':_0x4a256c['id']});});});});});});})[_0x181a('0x1d')](respondWithStatusCode(_0x9e4ce8,null))['catch'](handleError(_0x9e4ce8,null));};exports[_0x181a('0x88')]=function(_0x1ef274,_0x218bbc,_0x4f2af4){return db[_0x181a('0x38')]['find']({'where':{'id':_0x1ef274[_0x181a('0x50')]['id']}})[_0x181a('0x1d')](handleEntityNotFound(_0x218bbc,null))[_0x181a('0x1d')](function(_0x277018){if(_0x277018){return _0x277018['addAgents'](_0x1ef274[_0x181a('0x52')][_0x181a('0x73')],_[_0x181a('0x89')](_0x1ef274[_0x181a('0x52')],['ids','id'])||{})[_0x181a('0x8a')](function(_0x571f80){for(var _0x3569c9=0x0;_0x3569c9<_0x1ef274[_0x181a('0x52')]['ids'][_0x181a('0x41')];_0x3569c9+=0x1){socket[_0x181a('0x8b')]('userChatQueue:save',{'UserId':Number(_0x1ef274['body'][_0x181a('0x73')][_0x3569c9]),'ChatQueueId':Number(_0x1ef274[_0x181a('0x50')]['id'])});}return _0x571f80;});}})[_0x181a('0x1d')](respondWithResult(_0x218bbc,null))[_0x181a('0x26')](handleError(_0x218bbc,null));};exports[_0x181a('0x8c')]=function(_0x46413e,_0x3c5f09,_0xb5de55){return db['ChatQueue']['find']({'where':{'id':_0x46413e['params']['id']}})[_0x181a('0x1d')](handleEntityNotFound(_0x3c5f09,null))[_0x181a('0x1d')](function(_0x1a37c2){if(_0x1a37c2){return _0x1a37c2[_0x181a('0x8c')](_0x46413e[_0x181a('0x3d')]['ids'])[_0x181a('0x1d')](function(){if(_[_0x181a('0x8d')](_0x46413e[_0x181a('0x3d')][_0x181a('0x73')])){for(var _0x278906=0x0;_0x278906<_0x46413e[_0x181a('0x3d')][_0x181a('0x73')][_0x181a('0x41')];_0x278906+=0x1){socket[_0x181a('0x8b')](_0x181a('0x8e'),{'UserId':Number(_0x46413e[_0x181a('0x3d')]['ids'][_0x278906]),'ChatQueueId':Number(_0x46413e['params']['id'])});}}else{socket[_0x181a('0x8b')]('userChatQueue:remove',{'UserId':Number(_0x46413e['query'][_0x181a('0x73')]),'ChatQueueId':Number(_0x46413e[_0x181a('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c5f09,null))[_0x181a('0x26')](handleError(_0x3c5f09,null));};exports['getAgents']=function(_0x313d80,_0x5a5b43,_0x4aeeb5){var _0x21ddbc={};var _0x54a1d3={};var _0x99c7d2;var _0x4bf2b6;return db[_0x181a('0x38')][_0x181a('0x5a')]({'where':{'id':_0x313d80['params']['id']}})[_0x181a('0x1d')](handleEntityNotFound(_0x5a5b43,null))[_0x181a('0x1d')](function(_0x515b75){if(_0x515b75){_0x99c7d2=_0x515b75;_0x54a1d3[_0x181a('0x3c')]=_[_0x181a('0x3e')](db[_0x181a('0x74')][_0x181a('0x5c')]);_0x54a1d3[_0x181a('0x3d')]=_['keys'](_0x313d80[_0x181a('0x3d')]);_0x54a1d3[_0x181a('0x3f')]=_[_0x181a('0x5d')](_0x54a1d3[_0x181a('0x3c')],_0x54a1d3['query']);_0x21ddbc[_0x181a('0x42')]=_[_0x181a('0x5d')](_0x54a1d3[_0x181a('0x3c')],qs[_0x181a('0x40')](_0x313d80[_0x181a('0x3d')][_0x181a('0x40')]));_0x21ddbc[_0x181a('0x42')]=_0x21ddbc[_0x181a('0x42')]['length']?_0x21ddbc[_0x181a('0x42')]:_0x54a1d3[_0x181a('0x3c')];_0x21ddbc['order']=qs[_0x181a('0x5e')](_0x313d80[_0x181a('0x3d')][_0x181a('0x5e')]);_0x21ddbc[_0x181a('0x46')]=qs[_0x181a('0x3f')](_['pick'](_0x313d80[_0x181a('0x3d')],_0x54a1d3[_0x181a('0x3f')]));if(_0x313d80[_0x181a('0x3d')]['filter']){_0x21ddbc[_0x181a('0x46')]=_[_0x181a('0x49')](_0x21ddbc[_0x181a('0x46')],{'$or':_['map'](_0x21ddbc[_0x181a('0x42')],function(_0x2da174){var _0x1950e6={};_0x1950e6[_0x2da174]={'$like':'%'+_0x313d80[_0x181a('0x3d')]['filter']+'%'};return _0x1950e6;})});}_0x21ddbc=_[_0x181a('0x49')]({},_0x21ddbc,_0x313d80[_0x181a('0x4a')]);return _0x99c7d2['getAgents'](_0x21ddbc);}})['then'](function(_0x45781d){if(_0x45781d){_0x4bf2b6=_0x45781d[_0x181a('0x41')];if(!_0x313d80['query'][_0x181a('0x43')](_0x181a('0x44'))){_0x21ddbc[_0x181a('0x29')]=qs[_0x181a('0x29')](_0x313d80[_0x181a('0x3d')][_0x181a('0x29')]);_0x21ddbc[_0x181a('0x28')]=qs[_0x181a('0x28')](_0x313d80[_0x181a('0x3d')]['offset']);}return _0x99c7d2['getAgents'](_0x21ddbc);}})['then'](function(_0x51f159){if(_0x51f159){return _0x51f159?{'count':_0x4bf2b6,'rows':_0x51f159}:null;}})[_0x181a('0x1d')](respondWithResult(_0x5a5b43,null))[_0x181a('0x26')](handleError(_0x5a5b43,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 889a982..e2ab946 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 _0xcb7f=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x582d48,_0x468a3b){var _0x29b5ef=function(_0x2a7133){while(--_0x2a7133){_0x582d48['push'](_0x582d48['shift']());}};_0x29b5ef(++_0x468a3b);}(_0xcb7f,0x1c3));var _0xfcb7=function(_0x228745,_0x5e62ca){_0x228745=_0x228745-0x0;var _0x35d765=_0xcb7f[_0x228745];return _0x35d765;};'use strict';var EventEmitter=require(_0xfcb7('0x0'));var ChatQueue=require(_0xfcb7('0x1'))['db'][_0xfcb7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xfcb7('0x3')](0x0);var events={'afterCreate':_0xfcb7('0x4'),'afterUpdate':_0xfcb7('0x5'),'afterDestroy':_0xfcb7('0x6')};function emitEvent(_0x40e8b6){return function(_0x3bd41a,_0x139ac7,_0x2cb463){ChatQueueEvents[_0xfcb7('0x7')](_0x40e8b6+':'+_0x3bd41a['id'],_0x3bd41a);ChatQueueEvents[_0xfcb7('0x7')](_0x40e8b6,_0x3bd41a);_0x2cb463(null);};}for(var e in events){if(events[_0xfcb7('0x8')](e)){var event=events[e];ChatQueue[_0xfcb7('0x9')](e,emitEvent(event));}}module[_0xfcb7('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xadab=['ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x27d0d8,_0x2b657d){var _0x2b79d1=function(_0x249ec1){while(--_0x249ec1){_0x27d0d8['push'](_0x27d0d8['shift']());}};_0x2b79d1(++_0x2b657d);}(_0xadab,0x1ca));var _0xbada=function(_0x2e0af0,_0x83719c){_0x2e0af0=_0x2e0af0-0x0;var _0x2dfdc9=_0xadab[_0x2e0af0];return _0x2dfdc9;};'use strict';var EventEmitter=require(_0xbada('0x0'));var ChatQueue=require(_0xbada('0x1'))['db'][_0xbada('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbada('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbada('0x4'),'afterDestroy':_0xbada('0x5')};function emitEvent(_0x2186f6){return function(_0x1b773c,_0x26c698,_0x42003d){ChatQueueEvents[_0xbada('0x6')](_0x2186f6+':'+_0x1b773c['id'],_0x1b773c);ChatQueueEvents['emit'](_0x2186f6,_0x1b773c);_0x42003d(null);};}for(var e in events){if(events[_0xbada('0x7')](e)){var event=events[e];ChatQueue[_0xbada('0x8')](e,emitEvent(event));}}module[_0xbada('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 e11934f..6719121 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 _0x385d=['../../config/logger','api','moment','bluebird','request-promise','path','define','ChatQueue','chat_queues','util'];(function(_0x293a6b,_0x3b9ede){var _0x2d371c=function(_0x2b115a){while(--_0x2b115a){_0x293a6b['push'](_0x293a6b['shift']());}};_0x2d371c(++_0x3b9ede);}(_0x385d,0x13f));var _0xd385=function(_0x3ac246,_0x2d94d4){_0x3ac246=_0x3ac246-0x0;var _0x456d07=_0x385d[_0x3ac246];return _0x456d07;};'use strict';var _=require('lodash');var util=require(_0xd385('0x0'));var logger=require(_0xd385('0x1'))(_0xd385('0x2'));var moment=require(_0xd385('0x3'));var BPromise=require(_0xd385('0x4'));var rp=require(_0xd385('0x5'));var fs=require('fs');var path=require(_0xd385('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module['exports']=function(_0x105276,_0x87f173){return _0x105276[_0xd385('0x7')](_0xd385('0x8'),attributes,{'tableName':_0xd385('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96a2=['util','api','bluebird','request-promise','rimraf','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x96a2,0x87));var _0x296a=function(_0x5a2233,_0x872ad7){_0x5a2233=_0x5a2233-0x0;var _0x5214e1=_0x96a2[_0x5a2233];return _0x5214e1;};'use strict';var _=require('lodash');var util=require(_0x296a('0x0'));var logger=require('../../config/logger')(_0x296a('0x1'));var moment=require('moment');var BPromise=require(_0x296a('0x2'));var rp=require(_0x296a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x296a('0x4'));var config=require('../../config/environment');var attributes=require(_0x296a('0x5'));module[_0x296a('0x6')]=function(_0x3ec27e,_0x185439){return _0x3ec27e[_0x296a('0x7')](_0x296a('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 1272028..b1b84b7 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 _0x689b=['attributes','limit','include','model','map','GetChatQueue','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ChatQueue','raw','options','where'];(function(_0x4ce392,_0x571cb5){var _0x20bd85=function(_0x593921){while(--_0x593921){_0x4ce392['push'](_0x4ce392['shift']());}};_0x20bd85(++_0x571cb5);}(_0x689b,0xeb));var _0xb689=function(_0x384160,_0x6e117d){_0x384160=_0x384160-0x0;var _0x5e8b8d=_0x689b[_0x384160];return _0x5e8b8d;};'use strict';var _=require(_0xb689('0x0'));var util=require(_0xb689('0x1'));var moment=require(_0xb689('0x2'));var BPromise=require(_0xb689('0x3'));var rs=require(_0xb689('0x4'));var fs=require('fs');var Redis=require(_0xb689('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb689('0x6'))(_0xb689('0x7'));var config=require(_0xb689('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb689('0x9')][_0xb689('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb689('0xb')],{'host':_0xb689('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb689('0xb')]));require(_0xb689('0xd'))[_0xb689('0xe')](socket);function respondWithRpcPromise(_0x3e2f74,_0x2394b9,_0xe35a91){return new BPromise(function(_0x5d3ad6,_0x201e5){return client['request'](_0x3e2f74,_0xe35a91)[_0xb689('0xf')](function(_0x29ddfa){logger[_0xb689('0x10')](_0xb689('0x11'),_0x2394b9,'request\x20sent');logger[_0xb689('0x12')](_0xb689('0x13'),_0x2394b9,'request\x20sent',JSON[_0xb689('0x14')](_0x29ddfa));if(_0x29ddfa[_0xb689('0x15')]){if(_0x29ddfa[_0xb689('0x15')][_0xb689('0x16')]===0x1f4){logger[_0xb689('0x15')](_0xb689('0x11'),_0x2394b9,_0x29ddfa['error'][_0xb689('0x17')]);return _0x201e5(_0x29ddfa[_0xb689('0x15')][_0xb689('0x17')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2394b9,_0x29ddfa['error']['message']);return _0x5d3ad6(_0x29ddfa['error'][_0xb689('0x17')]);}else{logger[_0xb689('0x10')]('ChatQueue,\x20%s,\x20%s',_0x2394b9,_0xb689('0x18'));_0x5d3ad6(_0x29ddfa[_0xb689('0x19')]['message']);}})[_0xb689('0x1a')](function(_0x4ea72c){logger[_0xb689('0x15')](_0xb689('0x11'),_0x2394b9,_0x4ea72c);_0x201e5(_0x4ea72c);});});}exports['GetChatQueue']=function(_0x49e094){var _0x2ab40e=this;return new Promise(function(_0x550f5f,_0x54f0db){return db[_0xb689('0x1b')]['findAll']({'raw':_0x49e094['options']?_0x49e094['options'][_0xb689('0x1c')]===undefined?!![]:![]:!![],'where':_0x49e094['options']?_0x49e094[_0xb689('0x1d')][_0xb689('0x1e')]||null:null,'attributes':_0x49e094[_0xb689('0x1d')]?_0x49e094[_0xb689('0x1d')][_0xb689('0x1f')]||null:null,'limit':_0x49e094[_0xb689('0x1d')]?_0x49e094[_0xb689('0x1d')][_0xb689('0x20')]||null:null,'include':_0x49e094[_0xb689('0x1d')]?_0x49e094[_0xb689('0x1d')][_0xb689('0x21')]?_['map'](_0x49e094[_0xb689('0x1d')][_0xb689('0x21')],function(_0x32d8ee){return{'model':db[_0x32d8ee[_0xb689('0x22')]],'as':_0x32d8ee['as'],'attributes':_0x32d8ee[_0xb689('0x1f')],'include':_0x32d8ee[_0xb689('0x21')]?_[_0xb689('0x23')](_0x32d8ee['include'],function(_0x413c56){return{'model':db[_0x413c56[_0xb689('0x22')]],'as':_0x413c56['as'],'attributes':_0x413c56[_0xb689('0x1f')],'include':_0x413c56[_0xb689('0x21')]?_[_0xb689('0x23')](_0x413c56[_0xb689('0x21')],function(_0x189fd4){return{'model':db[_0x189fd4[_0xb689('0x22')]],'as':_0x189fd4['as'],'attributes':_0x189fd4[_0xb689('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb689('0xf')](function(_0x456b01){logger['info'](_0xb689('0x24'),_0x49e094);logger[_0xb689('0x12')](_0xb689('0x24'),_0x49e094,JSON['stringify'](_0x456b01));_0x550f5f(_0x456b01);})[_0xb689('0x1a')](function(_0x305809){logger[_0xb689('0x15')](_0xb689('0x24'),_0x305809[_0xb689('0x17')],_0x49e094);_0x54f0db(_0x2ab40e[_0xb689('0x15')](0x1f4,_0x305809[_0xb689('0x17')]));});});};exports[_0xb689('0x25')]=function(_0x39e36f){var _0xf07dd1=this;return new Promise(function(_0x100bfe,_0x6a2c39){return db[_0xb689('0x1b')]['find']({'raw':_0x39e36f[_0xb689('0x1d')]?_0x39e36f[_0xb689('0x1d')][_0xb689('0x1c')]===undefined?!![]:![]:!![],'where':_0x39e36f[_0xb689('0x1d')]?_0x39e36f[_0xb689('0x1d')]['where']||null:null,'attributes':_0x39e36f[_0xb689('0x1d')]?_0x39e36f[_0xb689('0x1d')]['attributes']||null:null,'include':_0x39e36f['options']?_0x39e36f[_0xb689('0x1d')][_0xb689('0x21')]?_[_0xb689('0x23')](_0x39e36f[_0xb689('0x1d')]['include'],function(_0x329e30){return{'model':db[_0x329e30[_0xb689('0x22')]],'as':_0x329e30['as'],'attributes':_0x329e30['attributes'],'include':_0x329e30[_0xb689('0x21')]?_[_0xb689('0x23')](_0x329e30[_0xb689('0x21')],function(_0xa23009){return{'model':db[_0xa23009[_0xb689('0x22')]],'as':_0xa23009['as'],'attributes':_0xa23009[_0xb689('0x1f')],'include':_0xa23009[_0xb689('0x21')]?_[_0xb689('0x23')](_0xa23009[_0xb689('0x21')],function(_0x578a90){return{'model':db[_0x578a90[_0xb689('0x22')]],'as':_0x578a90['as'],'attributes':_0x578a90['attributes']};}):[]};}):[]};}):[]:[]})[_0xb689('0xf')](function(_0x442384){logger[_0xb689('0x10')]('ShowChatQueue',_0x39e36f);logger[_0xb689('0x12')]('ShowChatQueue',_0x39e36f,JSON[_0xb689('0x14')](_0x442384));_0x100bfe(_0x442384);})[_0xb689('0x1a')](function(_0x5f2956){logger[_0xb689('0x15')]('ShowChatQueue',_0x5f2956['message'],_0x39e36f);_0x6a2c39(_0xf07dd1['error'](0x1f4,_0x5f2956[_0xb689('0x17')]));});});}; \ No newline at end of file +var _0x85ed=['ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','include','map','model','catch','ShowChatQueue','find','where','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x85ed,0x1e7));var _0xd85e=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x85ed[_0x2eb5bc];return _0x51c7b1;};'use strict';var _=require(_0xd85e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd85e('0x1'));var fs=require('fs');var Redis=require(_0xd85e('0x2'));var db=require(_0xd85e('0x3'))['db'];var utils=require(_0xd85e('0x4'));var logger=require(_0xd85e('0x5'))('rpc');var config=require(_0xd85e('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xd85e('0x7')]=_[_0xd85e('0x8')](config[_0xd85e('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd85e('0x7')]));require(_0xd85e('0x9'))[_0xd85e('0xa')](socket);function respondWithRpcPromise(_0x26a05f,_0x535e1f,_0x3846ea){return new BPromise(function(_0xf28f6c,_0x80ad5a){return client[_0xd85e('0xb')](_0x26a05f,_0x3846ea)[_0xd85e('0xc')](function(_0x226c32){logger[_0xd85e('0xd')](_0xd85e('0xe'),_0x535e1f,_0xd85e('0xf'));logger[_0xd85e('0x10')](_0xd85e('0x11'),_0x535e1f,'request\x20sent',JSON[_0xd85e('0x12')](_0x226c32));if(_0x226c32['error']){if(_0x226c32['error'][_0xd85e('0x13')]===0x1f4){logger['error'](_0xd85e('0xe'),_0x535e1f,_0x226c32[_0xd85e('0x14')][_0xd85e('0x15')]);return _0x80ad5a(_0x226c32['error'][_0xd85e('0x15')]);}logger[_0xd85e('0x14')]('ChatQueue,\x20%s,\x20%s',_0x535e1f,_0x226c32[_0xd85e('0x14')][_0xd85e('0x15')]);return _0xf28f6c(_0x226c32[_0xd85e('0x14')][_0xd85e('0x15')]);}else{logger[_0xd85e('0xd')](_0xd85e('0xe'),_0x535e1f,_0xd85e('0xf'));_0xf28f6c(_0x226c32[_0xd85e('0x16')]['message']);}})['catch'](function(_0xbee319){logger[_0xd85e('0x14')](_0xd85e('0xe'),_0x535e1f,_0xbee319);_0x80ad5a(_0xbee319);});});}exports[_0xd85e('0x17')]=function(_0x1ab755){var _0x311421=this;return new Promise(function(_0xfd58ea,_0x5b5a4f){return db[_0xd85e('0x18')][_0xd85e('0x19')]({'raw':_0x1ab755[_0xd85e('0x1a')]?_0x1ab755[_0xd85e('0x1a')][_0xd85e('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ab755[_0xd85e('0x1a')]?_0x1ab755[_0xd85e('0x1a')]['where']||null:null,'attributes':_0x1ab755[_0xd85e('0x1a')]?_0x1ab755[_0xd85e('0x1a')][_0xd85e('0x1c')]||null:null,'limit':_0x1ab755['options']?_0x1ab755[_0xd85e('0x1a')]['limit']||null:null,'include':_0x1ab755['options']?_0x1ab755[_0xd85e('0x1a')][_0xd85e('0x1d')]?_[_0xd85e('0x1e')](_0x1ab755[_0xd85e('0x1a')][_0xd85e('0x1d')],function(_0x17eada){return{'model':db[_0x17eada[_0xd85e('0x1f')]],'as':_0x17eada['as'],'attributes':_0x17eada[_0xd85e('0x1c')],'include':_0x17eada[_0xd85e('0x1d')]?_[_0xd85e('0x1e')](_0x17eada['include'],function(_0x1da9d9){return{'model':db[_0x1da9d9[_0xd85e('0x1f')]],'as':_0x1da9d9['as'],'attributes':_0x1da9d9[_0xd85e('0x1c')],'include':_0x1da9d9[_0xd85e('0x1d')]?_[_0xd85e('0x1e')](_0x1da9d9[_0xd85e('0x1d')],function(_0x461413){return{'model':db[_0x461413[_0xd85e('0x1f')]],'as':_0x461413['as'],'attributes':_0x461413[_0xd85e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd85e('0xc')](function(_0x228c69){logger['info'](_0xd85e('0x17'),_0x1ab755);logger['debug'](_0xd85e('0x17'),_0x1ab755,JSON['stringify'](_0x228c69));_0xfd58ea(_0x228c69);})[_0xd85e('0x20')](function(_0x58a0b4){logger[_0xd85e('0x14')](_0xd85e('0x17'),_0x58a0b4[_0xd85e('0x15')],_0x1ab755);_0x5b5a4f(_0x311421[_0xd85e('0x14')](0x1f4,_0x58a0b4[_0xd85e('0x15')]));});});};exports[_0xd85e('0x21')]=function(_0x2a6b01){var _0x397032=this;return new Promise(function(_0x5e0147,_0x80c368){return db[_0xd85e('0x18')][_0xd85e('0x22')]({'raw':_0x2a6b01['options']?_0x2a6b01[_0xd85e('0x1a')][_0xd85e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2a6b01['options']?_0x2a6b01[_0xd85e('0x1a')][_0xd85e('0x23')]||null:null,'attributes':_0x2a6b01['options']?_0x2a6b01[_0xd85e('0x1a')]['attributes']||null:null,'include':_0x2a6b01['options']?_0x2a6b01[_0xd85e('0x1a')][_0xd85e('0x1d')]?_[_0xd85e('0x1e')](_0x2a6b01[_0xd85e('0x1a')][_0xd85e('0x1d')],function(_0x168982){return{'model':db[_0x168982[_0xd85e('0x1f')]],'as':_0x168982['as'],'attributes':_0x168982[_0xd85e('0x1c')],'include':_0x168982[_0xd85e('0x1d')]?_[_0xd85e('0x1e')](_0x168982[_0xd85e('0x1d')],function(_0x212e00){return{'model':db[_0x212e00[_0xd85e('0x1f')]],'as':_0x212e00['as'],'attributes':_0x212e00[_0xd85e('0x1c')],'include':_0x212e00['include']?_[_0xd85e('0x1e')](_0x212e00['include'],function(_0x1f63d0){return{'model':db[_0x1f63d0[_0xd85e('0x1f')]],'as':_0x1f63d0['as'],'attributes':_0x1f63d0[_0xd85e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd85e('0xc')](function(_0x166424){logger[_0xd85e('0xd')](_0xd85e('0x21'),_0x2a6b01);logger[_0xd85e('0x10')](_0xd85e('0x21'),_0x2a6b01,JSON[_0xd85e('0x12')](_0x166424));_0x5e0147(_0x166424);})[_0xd85e('0x20')](function(_0x46a99c){logger[_0xd85e('0x14')]('ShowChatQueue',_0x46a99c[_0xd85e('0x15')],_0x2a6b01);_0x80c368(_0x397032[_0xd85e('0x14')](0x1f4,_0x46a99c[_0xd85e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 708796a..11b12c3 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 _0x207c=['length','chatQueue:','save','remove','update','emit'];(function(_0x4edfe9,_0xef2192){var _0x552b55=function(_0xd1bf8c){while(--_0xd1bf8c){_0x4edfe9['push'](_0x4edfe9['shift']());}};_0x552b55(++_0xef2192);}(_0x207c,0x1e8));var _0xc207=function(_0x3ec822,_0x59a9c2){_0x3ec822=_0x3ec822-0x0;var _0x5927c6=_0x207c[_0x3ec822];return _0x5927c6;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xc207('0x0'),_0xc207('0x1'),_0xc207('0x2')];function createListener(_0xaaba3d,_0x2b40be){return function(_0x12f1f2){_0x2b40be[_0xc207('0x3')](_0xaaba3d,_0x12f1f2);};}function removeListener(_0x4b9daa,_0x38ff02){return function(){ChatQueueEvents['removeListener'](_0x4b9daa,_0x38ff02);};}exports['register']=function(_0x55023e){for(var _0xc88789=0x0,_0x314561=events[_0xc207('0x4')];_0xc88789<_0x314561;_0xc88789++){var _0x59ff6f=events[_0xc88789];var _0x25cb97=createListener(_0xc207('0x5')+_0x59ff6f,_0x55023e);ChatQueueEvents['on'](_0x59ff6f,_0x25cb97);}}; \ No newline at end of file +var _0x6334=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x331a5,_0x4a2f92){var _0x1bc5c8=function(_0x5c2d85){while(--_0x5c2d85){_0x331a5['push'](_0x331a5['shift']());}};_0x1bc5c8(++_0x4a2f92);}(_0x6334,0x119));var _0x4633=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x6334[_0x172ed7];return _0xfa8f61;};'use strict';var ChatQueueEvents=require(_0x4633('0x0'));var events=[_0x4633('0x1'),_0x4633('0x2'),_0x4633('0x3')];function createListener(_0x1e53a0,_0x47254b){return function(_0x5109db){_0x47254b[_0x4633('0x4')](_0x1e53a0,_0x5109db);};}function removeListener(_0x205442,_0x2a2b3c){return function(){ChatQueueEvents[_0x4633('0x5')](_0x205442,_0x2a2b3c);};}exports[_0x4633('0x6')]=function(_0x6493dc){for(var _0x175e14=0x0,_0x4a8997=events[_0x4633('0x7')];_0x175e14<_0x4a8997;_0x175e14++){var _0x56891d=events[_0x175e14];var _0x21af74=createListener(_0x4633('0x8')+_0x56891d,_0x6493dc);ChatQueueEvents['on'](_0x56891d,_0x21af74);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 79b9cc3..01074d5 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0xb78af9,_0x298519){var _0x1e5e26=function(_0x59057f){while(--_0x59057f){_0xb78af9['push'](_0xb78af9['shift']());}};_0x1e5e26(++_0x298519);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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/teams',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/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x5a47ed,_0x20d548){_0x5a47ed=_0x5a47ed-0x0;var _0x1642c1=_0x3e74[_0x5a47ed];return _0x1642c1;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index bb193ed..18e6a72 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 _0x347a=['STRING','DATE','moment','sequelize','exports'];(function(_0x1e93aa,_0x482c31){var _0x20b41b=function(_0x277ccd){while(--_0x277ccd){_0x1e93aa['push'](_0x1e93aa['shift']());}};_0x20b41b(++_0x482c31);}(_0x347a,0xe3));var _0xa347=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x347a[_0x474d97];return _0x1edf25;};'use strict';var moment=require(_0xa347('0x0'));var Sequelize=require(_0xa347('0x1'));module[_0xa347('0x2')]={'uniqueid':{'type':Sequelize[_0xa347('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa347('0x3')]},'joinAt':{'type':Sequelize[_0xa347('0x4')]},'leaveAt':{'type':Sequelize[_0xa347('0x4')]},'acceptAt':{'type':Sequelize[_0xa347('0x4')]},'exitAt':{'type':Sequelize[_0xa347('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd843=['STRING','DATE','moment','sequelize'];(function(_0x26071c,_0x1ca4e2){var _0x2fb70e=function(_0x1e5079){while(--_0x1e5079){_0x26071c['push'](_0x26071c['shift']());}};_0x2fb70e(++_0x1ca4e2);}(_0xd843,0x172));var _0x3d84=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0xd843[_0x3b7a0c];return _0x3bb70f;};'use strict';var moment=require(_0x3d84('0x0'));var Sequelize=require(_0x3d84('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3d84('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3d84('0x3')]},'acceptAt':{'type':Sequelize[_0x3d84('0x3')]},'exitAt':{'type':Sequelize[_0x3d84('0x3')]},'reason':{'type':Sequelize[_0x3d84('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index de34ecc..380dc3d 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 _0xf0f4=['find','create','catch','body','destroy','describe','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','ChatQueueReport','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params'];(function(_0x3b603a,_0x202383){var _0x5af002=function(_0x59771d){while(--_0x59771d){_0x3b603a['push'](_0x3b603a['shift']());}};_0x5af002(++_0x202383);}(_0xf0f4,0x182));var _0x4f0f=function(_0xe6dca0,_0x45eaa8){_0xe6dca0=_0xe6dca0-0x0;var _0x33096c=_0xf0f4[_0xe6dca0];return _0x33096c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f0f('0x3'));var util=require(_0x4f0f('0x4'));var path=require(_0x4f0f('0x5'));var sox=require(_0x4f0f('0x6'));var csv=require(_0x4f0f('0x7'));var ejs=require(_0x4f0f('0x8'));var fs=require('fs');var fs_extra=require(_0x4f0f('0x9'));var _=require('lodash');var squel=require(_0x4f0f('0xa'));var crypto=require(_0x4f0f('0xb'));var jsforce=require(_0x4f0f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f0f('0x7'));var querystring=require(_0x4f0f('0xd'));var Papa=require(_0x4f0f('0xe'));var Redis=require(_0x4f0f('0xf'));var authService=require(_0x4f0f('0x10'));var qs=require(_0x4f0f('0x11'));var as=require(_0x4f0f('0x12'));var hardwareService=require(_0x4f0f('0x13'));var logger=require('../../config/logger')(_0x4f0f('0x14'));var utils=require(_0x4f0f('0x15'));var config=require(_0x4f0f('0x16'));var licenseUtil=require(_0x4f0f('0x17'));var db=require(_0x4f0f('0x18'))['db'];function respondWithStatusCode(_0x1a1b94,_0x123845){_0x123845=_0x123845||0xcc;return function(_0x11749b){if(_0x11749b){return _0x1a1b94[_0x4f0f('0x19')](_0x123845);}return _0x1a1b94[_0x4f0f('0x1a')](_0x123845)[_0x4f0f('0x1b')]();};}function respondWithResult(_0x4e1e26,_0xebecc0){_0xebecc0=_0xebecc0||0xc8;return function(_0x447238){if(_0x447238){return _0x4e1e26[_0x4f0f('0x1a')](_0xebecc0)[_0x4f0f('0x1c')](_0x447238);}};}function respondWithFilteredResult(_0x51a713,_0xd9ad12){return function(_0x46d7cf){if(_0x46d7cf){var _0x5783=typeof _0xd9ad12[_0x4f0f('0x1d')]===_0x4f0f('0x1e')&&typeof _0xd9ad12['limit']===_0x4f0f('0x1e');var _0x1942cf=_0x46d7cf[_0x4f0f('0x1f')];var _0x566049=_0x5783?0x0:_0xd9ad12[_0x4f0f('0x1d')];var _0x86186f=_0x5783?_0x46d7cf[_0x4f0f('0x1f')]:_0xd9ad12['offset']+_0xd9ad12[_0x4f0f('0x20')];var _0x2455f9;if(_0x86186f>=_0x1942cf){_0x86186f=_0x1942cf;_0x2455f9=0xc8;}else{_0x2455f9=0xce;}_0x51a713[_0x4f0f('0x1a')](_0x2455f9);return _0x51a713[_0x4f0f('0x21')](_0x4f0f('0x22'),_0x566049+'-'+_0x86186f+'/'+_0x1942cf)[_0x4f0f('0x1c')](_0x46d7cf);}return null;};}function patchUpdates(_0x537074){return function(_0x276387){try{jsonpatch['apply'](_0x276387,_0x537074,!![]);}catch(_0x3a6f22){return BPromise[_0x4f0f('0x23')](_0x3a6f22);}return _0x276387['save']();};}function saveUpdates(_0x4e4b28,_0x1bdfb4){return function(_0x55d318){if(_0x55d318){return _0x55d318[_0x4f0f('0x24')](_0x4e4b28)[_0x4f0f('0x25')](function(_0x18abde){return _0x18abde;});}return null;};}function removeEntity(_0x17f10c,_0x454720){return function(_0x17a9e9){if(_0x17a9e9){return _0x17a9e9['destroy']()[_0x4f0f('0x25')](function(){_0x17f10c[_0x4f0f('0x1a')](0xcc)[_0x4f0f('0x1b')]();});}};}function handleEntityNotFound(_0x3bc77d,_0xe969c7){return function(_0x3e6b72){if(!_0x3e6b72){_0x3bc77d[_0x4f0f('0x19')](0x194);}return _0x3e6b72;};}function handleError(_0x419986,_0x17cf17){_0x17cf17=_0x17cf17||0x1f4;return function(_0xb20be9){logger[_0x4f0f('0x26')](_0xb20be9[_0x4f0f('0x27')]);if(_0xb20be9[_0x4f0f('0x28')]){delete _0xb20be9['name'];}_0x419986[_0x4f0f('0x1a')](_0x17cf17)[_0x4f0f('0x29')](_0xb20be9);};}exports[_0x4f0f('0x2a')]=function(_0x58ec43,_0xa8a240){var _0x4e5f0d={},_0x449788={},_0x1f4e1d={'count':0x0,'rows':[]};var _0x5ada54=_['map'](db[_0x4f0f('0x2b')]['rawAttributes'],function(_0x1a005e){return{'name':_0x1a005e[_0x4f0f('0x2c')],'type':_0x1a005e['type'][_0x4f0f('0x2d')]};});_0x449788[_0x4f0f('0x2e')]=_[_0x4f0f('0x2f')](_0x5ada54,_0x4f0f('0x28'));_0x449788['query']=_[_0x4f0f('0x30')](_0x58ec43[_0x4f0f('0x31')]);_0x449788[_0x4f0f('0x32')]=_[_0x4f0f('0x33')](_0x449788['model'],_0x449788[_0x4f0f('0x31')]);_0x4e5f0d[_0x4f0f('0x34')]=_[_0x4f0f('0x33')](_0x449788['model'],qs[_0x4f0f('0x35')](_0x58ec43[_0x4f0f('0x31')]['fields']));_0x4e5f0d[_0x4f0f('0x34')]=_0x4e5f0d[_0x4f0f('0x34')][_0x4f0f('0x36')]?_0x4e5f0d[_0x4f0f('0x34')]:_0x449788['model'];if(!_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x37')](_0x4f0f('0x38'))){_0x4e5f0d[_0x4f0f('0x20')]=qs[_0x4f0f('0x20')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x20')]);_0x4e5f0d[_0x4f0f('0x1d')]=qs['offset'](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x1d')]);}_0x4e5f0d[_0x4f0f('0x39')]=qs[_0x4f0f('0x3a')](_0x58ec43[_0x4f0f('0x31')][_0x4f0f('0x3a')]);_0x4e5f0d[_0x4f0f('0x3b')]=qs['filters'](_[_0x4f0f('0x3c')](_0x58ec43[_0x4f0f('0x31')],_0x449788[_0x4f0f('0x32')]),_0x5ada54);if(_0x58ec43['query'][_0x4f0f('0x3d')]){_0x4e5f0d['where']=_[_0x4f0f('0x3e')](_0x4e5f0d['where'],{'$or':_[_0x4f0f('0x2f')](_0x5ada54,function(_0x27b5bf){if(_0x27b5bf['type']!==_0x4f0f('0x3f')){var _0x2d58b0={};_0x2d58b0[_0x27b5bf[_0x4f0f('0x28')]]={'$like':'%'+_0x58ec43['query'][_0x4f0f('0x3d')]+'%'};return _0x2d58b0;}})});}_0x4e5f0d=_[_0x4f0f('0x3e')]({},_0x4e5f0d,_0x58ec43[_0x4f0f('0x40')]);var _0x1b91d7={'where':_0x4e5f0d[_0x4f0f('0x3b')]};return db[_0x4f0f('0x2b')][_0x4f0f('0x1f')](_0x1b91d7)[_0x4f0f('0x25')](function(_0x2659b0){_0x1f4e1d[_0x4f0f('0x1f')]=_0x2659b0;if(_0x58ec43[_0x4f0f('0x31')]['includeAll']){_0x4e5f0d[_0x4f0f('0x41')]=[{'all':!![]}];}return db[_0x4f0f('0x2b')][_0x4f0f('0x42')](_0x4e5f0d);})[_0x4f0f('0x25')](function(_0x419cb4){_0x1f4e1d[_0x4f0f('0x43')]=_0x419cb4;return _0x1f4e1d;})[_0x4f0f('0x25')](respondWithFilteredResult(_0xa8a240,_0x4e5f0d))['catch'](handleError(_0xa8a240,null));};exports[_0x4f0f('0x44')]=function(_0x2e30d6,_0x1d8017){var _0x2bf0b3={'raw':!![],'where':{'id':_0x2e30d6[_0x4f0f('0x45')]['id']}},_0x1744f9={};_0x1744f9['model']=_[_0x4f0f('0x30')](db[_0x4f0f('0x2b')]['rawAttributes']);_0x1744f9['query']=_[_0x4f0f('0x30')](_0x2e30d6[_0x4f0f('0x31')]);_0x1744f9[_0x4f0f('0x32')]=_['intersection'](_0x1744f9[_0x4f0f('0x2e')],_0x1744f9['query']);_0x2bf0b3['attributes']=_[_0x4f0f('0x33')](_0x1744f9[_0x4f0f('0x2e')],qs[_0x4f0f('0x35')](_0x2e30d6[_0x4f0f('0x31')][_0x4f0f('0x35')]));_0x2bf0b3[_0x4f0f('0x34')]=_0x2bf0b3['attributes']['length']?_0x2bf0b3[_0x4f0f('0x34')]:_0x1744f9[_0x4f0f('0x2e')];if(_0x2e30d6[_0x4f0f('0x31')]['includeAll']){_0x2bf0b3[_0x4f0f('0x41')]=[{'all':!![]}];}_0x2bf0b3=_[_0x4f0f('0x3e')]({},_0x2bf0b3,_0x2e30d6[_0x4f0f('0x40')]);return db['ChatQueueReport'][_0x4f0f('0x46')](_0x2bf0b3)['then'](handleEntityNotFound(_0x1d8017,null))[_0x4f0f('0x25')](respondWithResult(_0x1d8017,null))['catch'](handleError(_0x1d8017,null));};exports[_0x4f0f('0x47')]=function(_0x3f2c6e,_0x2b0d3e){return db[_0x4f0f('0x2b')][_0x4f0f('0x47')](_0x3f2c6e['body'],{})['then'](respondWithResult(_0x2b0d3e,0xc9))[_0x4f0f('0x48')](handleError(_0x2b0d3e,null));};exports['update']=function(_0x12e587,_0x32d298){if(_0x12e587[_0x4f0f('0x49')]['id']){delete _0x12e587[_0x4f0f('0x49')]['id'];}return db[_0x4f0f('0x2b')][_0x4f0f('0x46')]({'where':{'id':_0x12e587[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x25')](handleEntityNotFound(_0x32d298,null))['then'](saveUpdates(_0x12e587[_0x4f0f('0x49')],null))[_0x4f0f('0x25')](respondWithResult(_0x32d298,null))[_0x4f0f('0x48')](handleError(_0x32d298,null));};exports[_0x4f0f('0x4a')]=function(_0x355517,_0x3262a6){return db[_0x4f0f('0x2b')][_0x4f0f('0x46')]({'where':{'id':_0x355517[_0x4f0f('0x45')]['id']}})[_0x4f0f('0x25')](handleEntityNotFound(_0x3262a6,null))['then'](removeEntity(_0x3262a6,null))[_0x4f0f('0x48')](handleError(_0x3262a6,null));};exports['describe']=function(_0x3909c0,_0x36d13a){return db['ChatQueueReport'][_0x4f0f('0x4b')]()[_0x4f0f('0x25')](respondWithResult(_0x36d13a,null))[_0x4f0f('0x48')](handleError(_0x36d13a,null));}; \ No newline at end of file +var _0xc1dc=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x5e2a2,_0x2654ee){var _0x280de8=function(_0x1a05d8){while(--_0x1a05d8){_0x5e2a2['push'](_0x5e2a2['shift']());}};_0x280de8(++_0x2654ee);}(_0xc1dc,0x84));var _0xcc1d=function(_0x213d5d,_0x305d72){_0x213d5d=_0x213d5d-0x0;var _0x225993=_0xc1dc[_0x213d5d];return _0x225993;};'use strict';var emlformat=require(_0xcc1d('0x0'));var rimraf=require(_0xcc1d('0x1'));var zipdir=require(_0xcc1d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc1d('0x3'));var moment=require('moment');var BPromise=require(_0xcc1d('0x4'));var Mustache=require(_0xcc1d('0x5'));var util=require('util');var path=require(_0xcc1d('0x6'));var sox=require(_0xcc1d('0x7'));var csv=require(_0xcc1d('0x8'));var ejs=require(_0xcc1d('0x9'));var fs=require('fs');var fs_extra=require(_0xcc1d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc1d('0xb'));var jsforce=require(_0xcc1d('0xc'));var deskjs=require(_0xcc1d('0xd'));var toCsv=require(_0xcc1d('0x8'));var querystring=require(_0xcc1d('0xe'));var Papa=require(_0xcc1d('0xf'));var Redis=require('ioredis');var authService=require(_0xcc1d('0x10'));var qs=require(_0xcc1d('0x11'));var as=require(_0xcc1d('0x12'));var hardwareService=require(_0xcc1d('0x13'));var logger=require(_0xcc1d('0x14'))(_0xcc1d('0x15'));var utils=require('../../config/utils');var config=require(_0xcc1d('0x16'));var licenseUtil=require(_0xcc1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11a34f,_0x3e2534){_0x3e2534=_0x3e2534||0xcc;return function(_0x1440f6){if(_0x1440f6){return _0x11a34f[_0xcc1d('0x18')](_0x3e2534);}return _0x11a34f[_0xcc1d('0x19')](_0x3e2534)[_0xcc1d('0x1a')]();};}function respondWithResult(_0x18b64a,_0x5345ab){_0x5345ab=_0x5345ab||0xc8;return function(_0x5e66ce){if(_0x5e66ce){return _0x18b64a[_0xcc1d('0x19')](_0x5345ab)['json'](_0x5e66ce);}};}function respondWithFilteredResult(_0x35e177,_0x452772){return function(_0x35f147){if(_0x35f147){var _0xc71166=typeof _0x452772[_0xcc1d('0x1b')]===_0xcc1d('0x1c')&&typeof _0x452772[_0xcc1d('0x1d')]===_0xcc1d('0x1c');var _0x2147ca=_0x35f147[_0xcc1d('0x1e')];var _0x483963=_0xc71166?0x0:_0x452772['offset'];var _0x2ee388=_0xc71166?_0x35f147['count']:_0x452772[_0xcc1d('0x1b')]+_0x452772[_0xcc1d('0x1d')];var _0xf44327;if(_0x2ee388>=_0x2147ca){_0x2ee388=_0x2147ca;_0xf44327=0xc8;}else{_0xf44327=0xce;}_0x35e177[_0xcc1d('0x19')](_0xf44327);return _0x35e177[_0xcc1d('0x1f')](_0xcc1d('0x20'),_0x483963+'-'+_0x2ee388+'/'+_0x2147ca)[_0xcc1d('0x21')](_0x35f147);}return null;};}function patchUpdates(_0x1b88f4){return function(_0x438288){try{jsonpatch['apply'](_0x438288,_0x1b88f4,!![]);}catch(_0x23189c){return BPromise['reject'](_0x23189c);}return _0x438288[_0xcc1d('0x22')]();};}function saveUpdates(_0x1bcf7b,_0x167b9f){return function(_0x5a2df6){if(_0x5a2df6){return _0x5a2df6[_0xcc1d('0x23')](_0x1bcf7b)[_0xcc1d('0x24')](function(_0x31a006){return _0x31a006;});}return null;};}function removeEntity(_0x451523,_0xac9e86){return function(_0x5e2f74){if(_0x5e2f74){return _0x5e2f74[_0xcc1d('0x25')]()['then'](function(){_0x451523[_0xcc1d('0x19')](0xcc)[_0xcc1d('0x1a')]();});}};}function handleEntityNotFound(_0x3f8b30,_0x40e31c){return function(_0xd2dba0){if(!_0xd2dba0){_0x3f8b30['sendStatus'](0x194);}return _0xd2dba0;};}function handleError(_0x8ae1a4,_0x17cdfe){_0x17cdfe=_0x17cdfe||0x1f4;return function(_0xec0667){logger['error'](_0xec0667[_0xcc1d('0x26')]);if(_0xec0667['name']){delete _0xec0667[_0xcc1d('0x27')];}_0x8ae1a4['status'](_0x17cdfe)[_0xcc1d('0x28')](_0xec0667);};}exports[_0xcc1d('0x29')]=function(_0x47710b,_0x50b769){var _0x2c5c51={},_0x10f5d3={},_0x11ba24={'count':0x0,'rows':[]};var _0x4a406f=_[_0xcc1d('0x2a')](db['ChatQueueReport'][_0xcc1d('0x2b')],function(_0x2a68ef){return{'name':_0x2a68ef[_0xcc1d('0x2c')],'type':_0x2a68ef[_0xcc1d('0x2d')][_0xcc1d('0x2e')]};});_0x10f5d3['model']=_[_0xcc1d('0x2a')](_0x4a406f,_0xcc1d('0x27'));_0x10f5d3['query']=_[_0xcc1d('0x2f')](_0x47710b['query']);_0x10f5d3[_0xcc1d('0x30')]=_['intersection'](_0x10f5d3['model'],_0x10f5d3[_0xcc1d('0x31')]);_0x2c5c51['attributes']=_[_0xcc1d('0x32')](_0x10f5d3[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x2c5c51[_0xcc1d('0x35')]=_0x2c5c51['attributes'][_0xcc1d('0x36')]?_0x2c5c51['attributes']:_0x10f5d3[_0xcc1d('0x33')];if(!_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x37')](_0xcc1d('0x38'))){_0x2c5c51['limit']=qs[_0xcc1d('0x1d')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1d')]);_0x2c5c51[_0xcc1d('0x1b')]=qs[_0xcc1d('0x1b')](_0x47710b[_0xcc1d('0x31')][_0xcc1d('0x1b')]);}_0x2c5c51[_0xcc1d('0x39')]=qs[_0xcc1d('0x3a')](_0x47710b[_0xcc1d('0x31')]['sort']);_0x2c5c51['where']=qs[_0xcc1d('0x30')](_[_0xcc1d('0x3b')](_0x47710b['query'],_0x10f5d3['filters']),_0x4a406f);if(_0x47710b['query'][_0xcc1d('0x3c')]){_0x2c5c51[_0xcc1d('0x3d')]=_[_0xcc1d('0x3e')](_0x2c5c51[_0xcc1d('0x3d')],{'$or':_[_0xcc1d('0x2a')](_0x4a406f,function(_0xcc81fd){if(_0xcc81fd[_0xcc1d('0x2d')]!=='VIRTUAL'){var _0x3d35e9={};_0x3d35e9[_0xcc81fd['name']]={'$like':'%'+_0x47710b['query']['filter']+'%'};return _0x3d35e9;}})});}_0x2c5c51=_[_0xcc1d('0x3e')]({},_0x2c5c51,_0x47710b[_0xcc1d('0x3f')]);var _0x59d656={'where':_0x2c5c51['where']};return db[_0xcc1d('0x40')]['count'](_0x59d656)[_0xcc1d('0x24')](function(_0x91e50d){_0x11ba24[_0xcc1d('0x1e')]=_0x91e50d;if(_0x47710b['query'][_0xcc1d('0x41')]){_0x2c5c51[_0xcc1d('0x42')]=[{'all':!![]}];}return db[_0xcc1d('0x40')][_0xcc1d('0x43')](_0x2c5c51);})[_0xcc1d('0x24')](function(_0x350b9d){_0x11ba24[_0xcc1d('0x44')]=_0x350b9d;return _0x11ba24;})['then'](respondWithFilteredResult(_0x50b769,_0x2c5c51))[_0xcc1d('0x45')](handleError(_0x50b769,null));};exports['show']=function(_0x809c64,_0x2ac320){var _0x1d74b4={'raw':!![],'where':{'id':_0x809c64[_0xcc1d('0x46')]['id']}},_0x252361={};_0x252361[_0xcc1d('0x33')]=_[_0xcc1d('0x2f')](db[_0xcc1d('0x40')][_0xcc1d('0x2b')]);_0x252361[_0xcc1d('0x31')]=_[_0xcc1d('0x2f')](_0x809c64[_0xcc1d('0x31')]);_0x252361['filters']=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],_0x252361[_0xcc1d('0x31')]);_0x1d74b4[_0xcc1d('0x35')]=_[_0xcc1d('0x32')](_0x252361[_0xcc1d('0x33')],qs[_0xcc1d('0x34')](_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x34')]));_0x1d74b4[_0xcc1d('0x35')]=_0x1d74b4[_0xcc1d('0x35')]['length']?_0x1d74b4[_0xcc1d('0x35')]:_0x252361[_0xcc1d('0x33')];if(_0x809c64[_0xcc1d('0x31')][_0xcc1d('0x41')]){_0x1d74b4[_0xcc1d('0x42')]=[{'all':!![]}];}_0x1d74b4=_[_0xcc1d('0x3e')]({},_0x1d74b4,_0x809c64[_0xcc1d('0x3f')]);return db[_0xcc1d('0x40')][_0xcc1d('0x47')](_0x1d74b4)[_0xcc1d('0x24')](handleEntityNotFound(_0x2ac320,null))[_0xcc1d('0x24')](respondWithResult(_0x2ac320,null))[_0xcc1d('0x45')](handleError(_0x2ac320,null));};exports[_0xcc1d('0x48')]=function(_0x1ba4fc,_0x3e9a69){return db[_0xcc1d('0x40')][_0xcc1d('0x48')](_0x1ba4fc[_0xcc1d('0x49')],{})[_0xcc1d('0x24')](respondWithResult(_0x3e9a69,0xc9))[_0xcc1d('0x45')](handleError(_0x3e9a69,null));};exports['update']=function(_0x46a883,_0x4f4359){if(_0x46a883[_0xcc1d('0x49')]['id']){delete _0x46a883[_0xcc1d('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x46a883[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x4f4359,null))[_0xcc1d('0x24')](saveUpdates(_0x46a883[_0xcc1d('0x49')],null))[_0xcc1d('0x24')](respondWithResult(_0x4f4359,null))[_0xcc1d('0x45')](handleError(_0x4f4359,null));};exports['destroy']=function(_0x40b834,_0x98ee9a){return db['ChatQueueReport'][_0xcc1d('0x47')]({'where':{'id':_0x40b834[_0xcc1d('0x46')]['id']}})[_0xcc1d('0x24')](handleEntityNotFound(_0x98ee9a,null))['then'](removeEntity(_0x98ee9a,null))[_0xcc1d('0x45')](handleError(_0x98ee9a,null));};exports[_0xcc1d('0x4a')]=function(_0x3b232f,_0x50d994){return db[_0xcc1d('0x40')][_0xcc1d('0x4a')]()[_0xcc1d('0x24')](respondWithResult(_0x50d994,null))[_0xcc1d('0x45')](handleError(_0x50d994,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 34206f3..bf24386 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x22eaed,_0x226a04){var _0x27fb0f=function(_0x169ebe){while(--_0x169ebe){_0x22eaed['push'](_0x22eaed['shift']());}};_0x27fb0f(++_0x226a04);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2d72ab,_0x5a97f5){var _0x256423=function(_0x94ed46){while(--_0x94ed46){_0x2d72ab['push'](_0x2d72ab['shift']());}};_0x256423(++_0x5a97f5);}(_0xb10b,0x12a));var _0xbb10=function(_0x40d5c8,_0x411c6e){_0x40d5c8=_0x40d5c8-0x0;var _0x5f294f=_0xb10b[_0x40d5c8];return _0x5f294f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 957baad..b97b31f 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 _0x4000=['rpc','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','limit','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x4000,0x157));var _0x0400=function(_0x122dc6,_0x5df7bd){_0x122dc6=_0x122dc6-0x0;var _0xfd7503=_0x4000[_0x122dc6];return _0xfd7503;};'use strict';var _=require(_0x0400('0x0'));var util=require(_0x0400('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0400('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0400('0x3'))['db'];var utils=require(_0x0400('0x4'));var logger=require('../../config/logger')(_0x0400('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0400('0x6')][_0x0400('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x122999,_0x1aa5df,_0x1e1100){return new BPromise(function(_0x1ba9fb,_0x4db9e5){return client['request'](_0x122999,_0x1e1100)[_0x0400('0x8')](function(_0xa403a8){logger[_0x0400('0x9')](_0x0400('0xa'),_0x1aa5df,_0x0400('0xb'));logger[_0x0400('0xc')](_0x0400('0xd'),_0x1aa5df,_0x0400('0xb'),JSON[_0x0400('0xe')](_0xa403a8));if(_0xa403a8[_0x0400('0xf')]){if(_0xa403a8[_0x0400('0xf')][_0x0400('0x10')]===0x1f4){logger[_0x0400('0xf')](_0x0400('0xa'),_0x1aa5df,_0xa403a8[_0x0400('0xf')][_0x0400('0x11')]);return _0x4db9e5(_0xa403a8['error'][_0x0400('0x11')]);}logger[_0x0400('0xf')](_0x0400('0xa'),_0x1aa5df,_0xa403a8[_0x0400('0xf')]['message']);return _0x1ba9fb(_0xa403a8[_0x0400('0xf')][_0x0400('0x11')]);}else{logger['info'](_0x0400('0xa'),_0x1aa5df,'request\x20sent');_0x1ba9fb(_0xa403a8['result'][_0x0400('0x11')]);}})[_0x0400('0x12')](function(_0x26c739){logger[_0x0400('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x1aa5df,_0x26c739);_0x4db9e5(_0x26c739);});});}exports[_0x0400('0x13')]=function(_0xe378b5){var _0x54259d=this;return new Promise(function(_0x27972d,_0xf91b73){return db[_0x0400('0x14')][_0x0400('0x15')](_0xe378b5[_0x0400('0x16')],{'raw':_0xe378b5['options']?_0xe378b5[_0x0400('0x17')][_0x0400('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5a855f){logger[_0x0400('0x9')](_0x0400('0x13'),_0xe378b5);logger[_0x0400('0xc')]('CreateChatQueueReport',_0xe378b5,JSON[_0x0400('0xe')](_0x5a855f));_0x27972d(_0x5a855f);})['catch'](function(_0x59c97b){logger[_0x0400('0xf')]('CreateChatQueueReport',_0x59c97b['message'],_0xe378b5);_0xf91b73(_0x54259d[_0x0400('0xf')](0x1f4,_0x59c97b['message']));});});};exports[_0x0400('0x19')]=function(_0x175473){var _0x59a621=this;return new Promise(function(_0x12ef6a,_0x5ea29d){return db[_0x0400('0x14')][_0x0400('0x1a')](_0x175473[_0x0400('0x16')],{'raw':_0x175473[_0x0400('0x17')]?_0x175473[_0x0400('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x175473['options']?_0x175473[_0x0400('0x17')][_0x0400('0x1b')]||null:null,'attributes':_0x175473[_0x0400('0x17')]?_0x175473[_0x0400('0x17')]['attributes']||null:null,'limit':_0x175473[_0x0400('0x17')]?_0x175473[_0x0400('0x17')][_0x0400('0x1c')]||null:null})[_0x0400('0x8')](function(_0x2be813){logger[_0x0400('0x9')]('UpdateChatQueueReport',_0x175473);logger[_0x0400('0xc')]('UpdateChatQueueReport',_0x175473,JSON[_0x0400('0xe')](_0x2be813));_0x12ef6a(_0x2be813);})['catch'](function(_0xd975a6){logger[_0x0400('0xf')](_0x0400('0x19'),_0xd975a6['message'],_0x175473);_0x5ea29d(_0x59a621[_0x0400('0xf')](0x1f4,_0xd975a6['message']));});});}; \ No newline at end of file +var _0x7f1b=['ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','lodash','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x7f1b,0x12b));var _0xb7f1=function(_0x1772b7,_0x1743e7){_0x1772b7=_0x1772b7-0x0;var _0x5baaad=_0x7f1b[_0x1772b7];return _0x5baaad;};'use strict';var _=require(_0xb7f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb7f1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb7f1('0x2'));var logger=require(_0xb7f1('0x3'))(_0xb7f1('0x4'));var config=require(_0xb7f1('0x5'));var jayson=require(_0xb7f1('0x6'));var client=jayson['client'][_0xb7f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29e686,_0x7a94a1,_0x2504b3){return new BPromise(function(_0x3bee91,_0x463026){return client[_0xb7f1('0x8')](_0x29e686,_0x2504b3)[_0xb7f1('0x9')](function(_0x435f32){logger[_0xb7f1('0xa')](_0xb7f1('0xb'),_0x7a94a1,_0xb7f1('0xc'));logger[_0xb7f1('0xd')](_0xb7f1('0xe'),_0x7a94a1,_0xb7f1('0xc'),JSON[_0xb7f1('0xf')](_0x435f32));if(_0x435f32['error']){if(_0x435f32[_0xb7f1('0x10')][_0xb7f1('0x11')]===0x1f4){logger[_0xb7f1('0x10')](_0xb7f1('0xb'),_0x7a94a1,_0x435f32[_0xb7f1('0x10')][_0xb7f1('0x12')]);return _0x463026(_0x435f32[_0xb7f1('0x10')][_0xb7f1('0x12')]);}logger[_0xb7f1('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x7a94a1,_0x435f32['error'][_0xb7f1('0x12')]);return _0x3bee91(_0x435f32['error']['message']);}else{logger[_0xb7f1('0xa')](_0xb7f1('0xb'),_0x7a94a1,'request\x20sent');_0x3bee91(_0x435f32[_0xb7f1('0x13')][_0xb7f1('0x12')]);}})[_0xb7f1('0x14')](function(_0x3ced85){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x7a94a1,_0x3ced85);_0x463026(_0x3ced85);});});}exports[_0xb7f1('0x15')]=function(_0x195035){var _0x536194=this;return new Promise(function(_0xbc2361,_0x4b7db2){return db[_0xb7f1('0x16')]['create'](_0x195035[_0xb7f1('0x17')],{'raw':_0x195035[_0xb7f1('0x18')]?_0x195035[_0xb7f1('0x18')][_0xb7f1('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xa11f0c){logger[_0xb7f1('0xa')](_0xb7f1('0x15'),_0x195035);logger[_0xb7f1('0xd')]('CreateChatQueueReport',_0x195035,JSON[_0xb7f1('0xf')](_0xa11f0c));_0xbc2361(_0xa11f0c);})[_0xb7f1('0x14')](function(_0x49f3ad){logger['error'](_0xb7f1('0x15'),_0x49f3ad['message'],_0x195035);_0x4b7db2(_0x536194[_0xb7f1('0x10')](0x1f4,_0x49f3ad['message']));});});};exports[_0xb7f1('0x1a')]=function(_0x25c61a){var _0x243474=this;return new Promise(function(_0xbf1b8e,_0x2ab151){return db[_0xb7f1('0x16')][_0xb7f1('0x1b')](_0x25c61a[_0xb7f1('0x17')],{'raw':_0x25c61a['options']?_0x25c61a[_0xb7f1('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25c61a['options']?_0x25c61a[_0xb7f1('0x18')][_0xb7f1('0x1c')]||null:null,'attributes':_0x25c61a[_0xb7f1('0x18')]?_0x25c61a[_0xb7f1('0x18')][_0xb7f1('0x1d')]||null:null,'limit':_0x25c61a['options']?_0x25c61a[_0xb7f1('0x18')][_0xb7f1('0x1e')]||null:null})['then'](function(_0x4521dd){logger[_0xb7f1('0xa')](_0xb7f1('0x1a'),_0x25c61a);logger[_0xb7f1('0xd')](_0xb7f1('0x1a'),_0x25c61a,JSON[_0xb7f1('0xf')](_0x4521dd));_0xbf1b8e(_0x4521dd);})[_0xb7f1('0x14')](function(_0xe800ba){logger[_0xb7f1('0x10')](_0xb7f1('0x1a'),_0xe800ba[_0xb7f1('0x12')],_0x25c61a);_0x2ab151(_0x243474['error'](0x1f4,_0xe800ba[_0xb7f1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 78964e5..5bb542b 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 _0x1175=['show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x4d79a4,_0x31ad70){var _0x562c00=function(_0xf8ac77){while(--_0xf8ac77){_0x4d79a4['push'](_0x4d79a4['shift']());}};_0x562c00(++_0x31ad70);}(_0x1175,0x177));var _0x5117=function(_0x4e8b0b,_0x1512cf){_0x4e8b0b=_0x4e8b0b-0x0;var _0x3875bd=_0x1175[_0x4e8b0b];return _0x3875bd;};'use strict';var multer=require(_0x5117('0x0'));var util=require(_0x5117('0x1'));var path=require(_0x5117('0x2'));var timeout=require(_0x5117('0x3'));var express=require(_0x5117('0x4'));var router=express[_0x5117('0x5')]();var fs_extra=require(_0x5117('0x6'));var auth=require(_0x5117('0x7'));var interaction=require(_0x5117('0x8'));var config=require('../../config/environment');var controller=require(_0x5117('0x9'));router['get']('/',auth[_0x5117('0xa')](),controller[_0x5117('0xb')]);router[_0x5117('0xc')](_0x5117('0xd'),auth['isAuthenticated'](),controller[_0x5117('0xe')]);router[_0x5117('0xc')](_0x5117('0xf'),auth['isAuthenticated'](),controller[_0x5117('0x10')]);router[_0x5117('0x11')]('/',auth[_0x5117('0xa')](),controller[_0x5117('0x12')]);router[_0x5117('0x13')](_0x5117('0xf'),auth[_0x5117('0xa')](),controller[_0x5117('0x14')]);router['delete'](_0x5117('0xf'),auth['isAuthenticated'](),controller[_0x5117('0x15')]);module[_0x5117('0x16')]=router; \ No newline at end of file +var _0xa4f4=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4f4,0x1b8));var _0x4a4f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa4f4[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x4a4f('0x0'));var util=require(_0x4a4f('0x1'));var path=require('path');var timeout=require(_0x4a4f('0x2'));var express=require(_0x4a4f('0x3'));var router=express[_0x4a4f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a4f('0x5'));var interaction=require(_0x4a4f('0x6'));var config=require(_0x4a4f('0x7'));var controller=require(_0x4a4f('0x8'));router['get']('/',auth[_0x4a4f('0x9')](),controller[_0x4a4f('0xa')]);router[_0x4a4f('0xb')]('/describe',auth[_0x4a4f('0x9')](),controller[_0x4a4f('0xc')]);router[_0x4a4f('0xb')]('/:id',auth[_0x4a4f('0x9')](),controller[_0x4a4f('0xd')]);router[_0x4a4f('0xe')]('/',auth[_0x4a4f('0x9')](),controller[_0x4a4f('0xf')]);router[_0x4a4f('0x10')](_0x4a4f('0x11'),auth[_0x4a4f('0x9')](),controller[_0x4a4f('0x12')]);router['delete'](_0x4a4f('0x11'),auth['isAuthenticated'](),controller[_0x4a4f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index bb8e9fb..4138024 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x16aa10,_0xc22da3){var _0x3bc706=function(_0x1fd6a7){while(--_0x1fd6a7){_0x16aa10['push'](_0x16aa10['shift']());}};_0x3bc706(++_0xc22da3);}(_0x54ef,0x112));var _0xf54e=function(_0x3c4c3f,_0x113d0e){_0x3c4c3f=_0x3c4c3f-0x0;var _0x5bb89b=_0x54ef[_0x3c4c3f];return _0x5bb89b;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1f1e7d,_0x476a17){var _0x205a30=function(_0x58a806){while(--_0x58a806){_0x1f1e7d['push'](_0x1f1e7d['shift']());}};_0x205a30(++_0x476a17);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0xf3cd[_0x52f159];return _0x156799;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index e0ca85f..2ec9b5a 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 _0xee26=['undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','filter','include','findAll','rows','catch','params','keys','merge','options','find','create','body','describe','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit'];(function(_0x21a5bb,_0x23bcb7){var _0x5e2333=function(_0x173b57){while(--_0x173b57){_0x21a5bb['push'](_0x21a5bb['shift']());}};_0x5e2333(++_0x23bcb7);}(_0xee26,0x145));var _0x6ee2=function(_0x3b8f97,_0x18771){_0x3b8f97=_0x3b8f97-0x0;var _0x36667d=_0xee26[_0x3b8f97];return _0x36667d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ee2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ee2('0x1'));var BPromise=require(_0x6ee2('0x2'));var Mustache=require(_0x6ee2('0x3'));var util=require(_0x6ee2('0x4'));var path=require(_0x6ee2('0x5'));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('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6ee2('0xc'));var Papa=require(_0x6ee2('0xd'));var Redis=require(_0x6ee2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ee2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ee2('0x10'))(_0x6ee2('0x11'));var utils=require('../../config/utils');var config=require(_0x6ee2('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ee2('0x13'))['db'];function respondWithStatusCode(_0xf3e169,_0x313450){_0x313450=_0x313450||0xcc;return function(_0x117e38){if(_0x117e38){return _0xf3e169[_0x6ee2('0x14')](_0x313450);}return _0xf3e169[_0x6ee2('0x15')](_0x313450)['end']();};}function respondWithResult(_0x5f4d6d,_0x472ec8){_0x472ec8=_0x472ec8||0xc8;return function(_0x33b5eb){if(_0x33b5eb){return _0x5f4d6d['status'](_0x472ec8)[_0x6ee2('0x16')](_0x33b5eb);}};}function respondWithFilteredResult(_0x312091,_0x227ea7){return function(_0x323720){if(_0x323720){var _0x28942c=typeof _0x227ea7[_0x6ee2('0x17')]==='undefined'&&typeof _0x227ea7[_0x6ee2('0x18')]===_0x6ee2('0x19');var _0x2bf3=_0x323720[_0x6ee2('0x1a')];var _0x40dcfc=_0x28942c?0x0:_0x227ea7[_0x6ee2('0x17')];var _0x428927=_0x28942c?_0x323720[_0x6ee2('0x1a')]:_0x227ea7['offset']+_0x227ea7[_0x6ee2('0x18')];var _0x3c2e10;if(_0x428927>=_0x2bf3){_0x428927=_0x2bf3;_0x3c2e10=0xc8;}else{_0x3c2e10=0xce;}_0x312091['status'](_0x3c2e10);return _0x312091[_0x6ee2('0x1b')](_0x6ee2('0x1c'),_0x40dcfc+'-'+_0x428927+'/'+_0x2bf3)[_0x6ee2('0x16')](_0x323720);}return null;};}function patchUpdates(_0x31b794){return function(_0x4b4a82){try{jsonpatch[_0x6ee2('0x1d')](_0x4b4a82,_0x31b794,!![]);}catch(_0x5931ed){return BPromise[_0x6ee2('0x1e')](_0x5931ed);}return _0x4b4a82['save']();};}function saveUpdates(_0x265aef,_0x3ec9a0){return function(_0x51524b){if(_0x51524b){return _0x51524b[_0x6ee2('0x1f')](_0x265aef)[_0x6ee2('0x20')](function(_0x13f1ab){return _0x13f1ab;});}return null;};}function removeEntity(_0x2b55b2,_0x170112){return function(_0x359426){if(_0x359426){return _0x359426[_0x6ee2('0x21')]()[_0x6ee2('0x20')](function(){_0x2b55b2[_0x6ee2('0x15')](0xcc)[_0x6ee2('0x22')]();});}};}function handleEntityNotFound(_0x41886a,_0x86b2c0){return function(_0x3a1b04){if(!_0x3a1b04){_0x41886a['sendStatus'](0x194);}return _0x3a1b04;};}function handleError(_0x908fbe,_0x5062ab){_0x5062ab=_0x5062ab||0x1f4;return function(_0x262845){logger[_0x6ee2('0x23')](_0x262845[_0x6ee2('0x24')]);if(_0x262845[_0x6ee2('0x25')]){delete _0x262845[_0x6ee2('0x25')];}_0x908fbe['status'](_0x5062ab)[_0x6ee2('0x26')](_0x262845);};}exports[_0x6ee2('0x27')]=function(_0x53cf5d,_0xd46c12){var _0x10318d={},_0x10901d={},_0x3fc77c={'count':0x0,'rows':[]};var _0x4e358f=_[_0x6ee2('0x28')](db[_0x6ee2('0x29')][_0x6ee2('0x2a')],function(_0x1757d7){return{'name':_0x1757d7['fieldName'],'type':_0x1757d7[_0x6ee2('0x2b')][_0x6ee2('0x2c')]};});_0x10901d[_0x6ee2('0x2d')]=_[_0x6ee2('0x28')](_0x4e358f,_0x6ee2('0x25'));_0x10901d[_0x6ee2('0x2e')]=_['keys'](_0x53cf5d[_0x6ee2('0x2e')]);_0x10901d[_0x6ee2('0x2f')]=_[_0x6ee2('0x30')](_0x10901d[_0x6ee2('0x2d')],_0x10901d[_0x6ee2('0x2e')]);_0x10318d['attributes']=_[_0x6ee2('0x30')](_0x10901d[_0x6ee2('0x2d')],qs[_0x6ee2('0x31')](_0x53cf5d[_0x6ee2('0x2e')][_0x6ee2('0x31')]));_0x10318d['attributes']=_0x10318d[_0x6ee2('0x32')][_0x6ee2('0x33')]?_0x10318d[_0x6ee2('0x32')]:_0x10901d['model'];if(!_0x53cf5d[_0x6ee2('0x2e')][_0x6ee2('0x34')]('nolimit')){_0x10318d['limit']=qs[_0x6ee2('0x18')](_0x53cf5d['query'][_0x6ee2('0x18')]);_0x10318d['offset']=qs[_0x6ee2('0x17')](_0x53cf5d['query'][_0x6ee2('0x17')]);}_0x10318d[_0x6ee2('0x35')]=qs[_0x6ee2('0x36')](_0x53cf5d[_0x6ee2('0x2e')][_0x6ee2('0x36')]);_0x10318d['where']=qs['filters'](_[_0x6ee2('0x37')](_0x53cf5d[_0x6ee2('0x2e')],_0x10901d[_0x6ee2('0x2f')]),_0x4e358f);if(_0x53cf5d[_0x6ee2('0x2e')]['filter']){_0x10318d[_0x6ee2('0x38')]=_['merge'](_0x10318d[_0x6ee2('0x38')],{'$or':_[_0x6ee2('0x28')](_0x4e358f,function(_0x1e682a){if(_0x1e682a[_0x6ee2('0x2b')]!=='VIRTUAL'){var _0x24b23b={};_0x24b23b[_0x1e682a[_0x6ee2('0x25')]]={'$like':'%'+_0x53cf5d[_0x6ee2('0x2e')][_0x6ee2('0x39')]+'%'};return _0x24b23b;}})});}_0x10318d=_['merge']({},_0x10318d,_0x53cf5d['options']);var _0x345b34={'where':_0x10318d[_0x6ee2('0x38')]};return db[_0x6ee2('0x29')][_0x6ee2('0x1a')](_0x345b34)[_0x6ee2('0x20')](function(_0x51c5e2){_0x3fc77c[_0x6ee2('0x1a')]=_0x51c5e2;if(_0x53cf5d[_0x6ee2('0x2e')]['includeAll']){_0x10318d[_0x6ee2('0x3a')]=[{'all':!![]}];}return db[_0x6ee2('0x29')][_0x6ee2('0x3b')](_0x10318d);})[_0x6ee2('0x20')](function(_0x397df0){_0x3fc77c[_0x6ee2('0x3c')]=_0x397df0;return _0x3fc77c;})[_0x6ee2('0x20')](respondWithFilteredResult(_0xd46c12,_0x10318d))[_0x6ee2('0x3d')](handleError(_0xd46c12,null));};exports['show']=function(_0x45f720,_0x328e7f){var _0x5b5e98={'raw':!![],'where':{'id':_0x45f720[_0x6ee2('0x3e')]['id']}},_0xef48b3={};_0xef48b3[_0x6ee2('0x2d')]=_[_0x6ee2('0x3f')](db[_0x6ee2('0x29')][_0x6ee2('0x2a')]);_0xef48b3['query']=_[_0x6ee2('0x3f')](_0x45f720[_0x6ee2('0x2e')]);_0xef48b3['filters']=_[_0x6ee2('0x30')](_0xef48b3['model'],_0xef48b3[_0x6ee2('0x2e')]);_0x5b5e98[_0x6ee2('0x32')]=_[_0x6ee2('0x30')](_0xef48b3[_0x6ee2('0x2d')],qs[_0x6ee2('0x31')](_0x45f720[_0x6ee2('0x2e')][_0x6ee2('0x31')]));_0x5b5e98[_0x6ee2('0x32')]=_0x5b5e98[_0x6ee2('0x32')][_0x6ee2('0x33')]?_0x5b5e98[_0x6ee2('0x32')]:_0xef48b3[_0x6ee2('0x2d')];if(_0x45f720[_0x6ee2('0x2e')]['includeAll']){_0x5b5e98[_0x6ee2('0x3a')]=[{'all':!![]}];}_0x5b5e98=_[_0x6ee2('0x40')]({},_0x5b5e98,_0x45f720[_0x6ee2('0x41')]);return db['ChatTransferReport'][_0x6ee2('0x42')](_0x5b5e98)['then'](handleEntityNotFound(_0x328e7f,null))[_0x6ee2('0x20')](respondWithResult(_0x328e7f,null))[_0x6ee2('0x3d')](handleError(_0x328e7f,null));};exports[_0x6ee2('0x43')]=function(_0x3f5a68,_0x599fe5){return db['ChatTransferReport'][_0x6ee2('0x43')](_0x3f5a68[_0x6ee2('0x44')],{})[_0x6ee2('0x20')](respondWithResult(_0x599fe5,0xc9))['catch'](handleError(_0x599fe5,null));};exports[_0x6ee2('0x1f')]=function(_0x150943,_0x39d34c){if(_0x150943['body']['id']){delete _0x150943[_0x6ee2('0x44')]['id'];}return db['ChatTransferReport'][_0x6ee2('0x42')]({'where':{'id':_0x150943[_0x6ee2('0x3e')]['id']}})[_0x6ee2('0x20')](handleEntityNotFound(_0x39d34c,null))[_0x6ee2('0x20')](saveUpdates(_0x150943[_0x6ee2('0x44')],null))['then'](respondWithResult(_0x39d34c,null))[_0x6ee2('0x3d')](handleError(_0x39d34c,null));};exports['destroy']=function(_0x5e6d66,_0x5219ee){return db['ChatTransferReport']['find']({'where':{'id':_0x5e6d66[_0x6ee2('0x3e')]['id']}})[_0x6ee2('0x20')](handleEntityNotFound(_0x5219ee,null))[_0x6ee2('0x20')](removeEntity(_0x5219ee,null))['catch'](handleError(_0x5219ee,null));};exports[_0x6ee2('0x45')]=function(_0x1041de,_0x344186){return db[_0x6ee2('0x29')][_0x6ee2('0x45')]()[_0x6ee2('0x20')](respondWithResult(_0x344186,null))['catch'](handleError(_0x344186,null));}; \ No newline at end of file +var _0x62b8=['undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','ChatTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status'];(function(_0x312d9f,_0x843ecc){var _0x1d9e22=function(_0x91e95){while(--_0x91e95){_0x312d9f['push'](_0x312d9f['shift']());}};_0x1d9e22(++_0x843ecc);}(_0x62b8,0x142));var _0x862b=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x62b8[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require(_0x862b('0x0'));var rimraf=require(_0x862b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x862b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x862b('0x3'));var util=require(_0x862b('0x4'));var path=require(_0x862b('0x5'));var sox=require('sox');var csv=require(_0x862b('0x6'));var ejs=require(_0x862b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x862b('0x8'));var squel=require(_0x862b('0x9'));var crypto=require(_0x862b('0xa'));var jsforce=require(_0x862b('0xb'));var deskjs=require(_0x862b('0xc'));var toCsv=require(_0x862b('0x6'));var querystring=require('querystring');var Papa=require(_0x862b('0xd'));var Redis=require(_0x862b('0xe'));var authService=require(_0x862b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x862b('0x10'));var hardwareService=require(_0x862b('0x11'));var logger=require(_0x862b('0x12'))(_0x862b('0x13'));var utils=require(_0x862b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dc5f1,_0x32aa92){_0x32aa92=_0x32aa92||0xcc;return function(_0x399e9b){if(_0x399e9b){return _0x4dc5f1[_0x862b('0x15')](_0x32aa92);}return _0x4dc5f1[_0x862b('0x16')](_0x32aa92)['end']();};}function respondWithResult(_0x19a9b2,_0x1fc2b1){_0x1fc2b1=_0x1fc2b1||0xc8;return function(_0x5ddbd2){if(_0x5ddbd2){return _0x19a9b2[_0x862b('0x16')](_0x1fc2b1)['json'](_0x5ddbd2);}};}function respondWithFilteredResult(_0x39025b,_0x4854c1){return function(_0x6eb3d7){if(_0x6eb3d7){var _0x45dc0f=typeof _0x4854c1['offset']===_0x862b('0x17')&&typeof _0x4854c1[_0x862b('0x18')]===_0x862b('0x17');var _0x15e22f=_0x6eb3d7[_0x862b('0x19')];var _0x29a4fa=_0x45dc0f?0x0:_0x4854c1[_0x862b('0x1a')];var _0x16d314=_0x45dc0f?_0x6eb3d7[_0x862b('0x19')]:_0x4854c1[_0x862b('0x1a')]+_0x4854c1['limit'];var _0x383b9f;if(_0x16d314>=_0x15e22f){_0x16d314=_0x15e22f;_0x383b9f=0xc8;}else{_0x383b9f=0xce;}_0x39025b[_0x862b('0x16')](_0x383b9f);return _0x39025b[_0x862b('0x1b')](_0x862b('0x1c'),_0x29a4fa+'-'+_0x16d314+'/'+_0x15e22f)[_0x862b('0x1d')](_0x6eb3d7);}return null;};}function patchUpdates(_0xd93935){return function(_0x89a113){try{jsonpatch[_0x862b('0x1e')](_0x89a113,_0xd93935,!![]);}catch(_0x3b6634){return BPromise[_0x862b('0x1f')](_0x3b6634);}return _0x89a113[_0x862b('0x20')]();};}function saveUpdates(_0x4ae519,_0x1a5c92){return function(_0x49bfae){if(_0x49bfae){return _0x49bfae['update'](_0x4ae519)[_0x862b('0x21')](function(_0x1d4958){return _0x1d4958;});}return null;};}function removeEntity(_0x50149f,_0x41359d){return function(_0x1bad82){if(_0x1bad82){return _0x1bad82[_0x862b('0x22')]()[_0x862b('0x21')](function(){_0x50149f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28baaa,_0x53abac){return function(_0x4d787d){if(!_0x4d787d){_0x28baaa[_0x862b('0x15')](0x194);}return _0x4d787d;};}function handleError(_0x40e002,_0x4f6175){_0x4f6175=_0x4f6175||0x1f4;return function(_0x2eb219){logger[_0x862b('0x23')](_0x2eb219['stack']);if(_0x2eb219[_0x862b('0x24')]){delete _0x2eb219['name'];}_0x40e002['status'](_0x4f6175)[_0x862b('0x25')](_0x2eb219);};}exports['index']=function(_0x21ab35,_0x325669){var _0x277734={},_0x550a0b={},_0x5a4f1e={'count':0x0,'rows':[]};var _0x1cffaf=_['map'](db[_0x862b('0x26')]['rawAttributes'],function(_0x4dce3c){return{'name':_0x4dce3c[_0x862b('0x27')],'type':_0x4dce3c[_0x862b('0x28')][_0x862b('0x29')]};});_0x550a0b[_0x862b('0x2a')]=_[_0x862b('0x2b')](_0x1cffaf,_0x862b('0x24'));_0x550a0b[_0x862b('0x2c')]=_[_0x862b('0x2d')](_0x21ab35['query']);_0x550a0b[_0x862b('0x2e')]=_[_0x862b('0x2f')](_0x550a0b[_0x862b('0x2a')],_0x550a0b['query']);_0x277734[_0x862b('0x30')]=_[_0x862b('0x2f')](_0x550a0b[_0x862b('0x2a')],qs['fields'](_0x21ab35[_0x862b('0x2c')][_0x862b('0x31')]));_0x277734[_0x862b('0x30')]=_0x277734['attributes']['length']?_0x277734[_0x862b('0x30')]:_0x550a0b['model'];if(!_0x21ab35[_0x862b('0x2c')]['hasOwnProperty'](_0x862b('0x32'))){_0x277734['limit']=qs['limit'](_0x21ab35['query'][_0x862b('0x18')]);_0x277734[_0x862b('0x1a')]=qs[_0x862b('0x1a')](_0x21ab35[_0x862b('0x2c')][_0x862b('0x1a')]);}_0x277734[_0x862b('0x33')]=qs['sort'](_0x21ab35[_0x862b('0x2c')]['sort']);_0x277734[_0x862b('0x34')]=qs[_0x862b('0x2e')](_[_0x862b('0x35')](_0x21ab35['query'],_0x550a0b[_0x862b('0x2e')]),_0x1cffaf);if(_0x21ab35[_0x862b('0x2c')][_0x862b('0x36')]){_0x277734[_0x862b('0x34')]=_[_0x862b('0x37')](_0x277734[_0x862b('0x34')],{'$or':_[_0x862b('0x2b')](_0x1cffaf,function(_0x3b73b5){if(_0x3b73b5[_0x862b('0x28')]!==_0x862b('0x38')){var _0x221d36={};_0x221d36[_0x3b73b5[_0x862b('0x24')]]={'$like':'%'+_0x21ab35[_0x862b('0x2c')][_0x862b('0x36')]+'%'};return _0x221d36;}})});}_0x277734=_['merge']({},_0x277734,_0x21ab35[_0x862b('0x39')]);var _0x37d43e={'where':_0x277734['where']};return db[_0x862b('0x26')][_0x862b('0x19')](_0x37d43e)[_0x862b('0x21')](function(_0x74661d){_0x5a4f1e[_0x862b('0x19')]=_0x74661d;if(_0x21ab35[_0x862b('0x2c')][_0x862b('0x3a')]){_0x277734[_0x862b('0x3b')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x277734);})[_0x862b('0x21')](function(_0x3b518d){_0x5a4f1e['rows']=_0x3b518d;return _0x5a4f1e;})['then'](respondWithFilteredResult(_0x325669,_0x277734))[_0x862b('0x3c')](handleError(_0x325669,null));};exports[_0x862b('0x3d')]=function(_0x3428a2,_0x236719){var _0x5a43e3={'raw':!![],'where':{'id':_0x3428a2[_0x862b('0x3e')]['id']}},_0x3e4a8a={};_0x3e4a8a[_0x862b('0x2a')]=_[_0x862b('0x2d')](db[_0x862b('0x26')][_0x862b('0x3f')]);_0x3e4a8a[_0x862b('0x2c')]=_[_0x862b('0x2d')](_0x3428a2[_0x862b('0x2c')]);_0x3e4a8a['filters']=_[_0x862b('0x2f')](_0x3e4a8a[_0x862b('0x2a')],_0x3e4a8a['query']);_0x5a43e3[_0x862b('0x30')]=_[_0x862b('0x2f')](_0x3e4a8a[_0x862b('0x2a')],qs[_0x862b('0x31')](_0x3428a2[_0x862b('0x2c')]['fields']));_0x5a43e3['attributes']=_0x5a43e3[_0x862b('0x30')]['length']?_0x5a43e3[_0x862b('0x30')]:_0x3e4a8a['model'];if(_0x3428a2['query'][_0x862b('0x3a')]){_0x5a43e3[_0x862b('0x3b')]=[{'all':!![]}];}_0x5a43e3=_[_0x862b('0x37')]({},_0x5a43e3,_0x3428a2[_0x862b('0x39')]);return db[_0x862b('0x26')][_0x862b('0x40')](_0x5a43e3)[_0x862b('0x21')](handleEntityNotFound(_0x236719,null))['then'](respondWithResult(_0x236719,null))[_0x862b('0x3c')](handleError(_0x236719,null));};exports['create']=function(_0x3644a7,_0x1c7828){return db[_0x862b('0x26')][_0x862b('0x41')](_0x3644a7['body'],{})[_0x862b('0x21')](respondWithResult(_0x1c7828,0xc9))['catch'](handleError(_0x1c7828,null));};exports[_0x862b('0x42')]=function(_0x809b7,_0x2bbe46){if(_0x809b7[_0x862b('0x43')]['id']){delete _0x809b7[_0x862b('0x43')]['id'];}return db['ChatTransferReport'][_0x862b('0x40')]({'where':{'id':_0x809b7[_0x862b('0x3e')]['id']}})[_0x862b('0x21')](handleEntityNotFound(_0x2bbe46,null))[_0x862b('0x21')](saveUpdates(_0x809b7[_0x862b('0x43')],null))[_0x862b('0x21')](respondWithResult(_0x2bbe46,null))[_0x862b('0x3c')](handleError(_0x2bbe46,null));};exports[_0x862b('0x22')]=function(_0x3a3e65,_0x5e129e){return db[_0x862b('0x26')][_0x862b('0x40')]({'where':{'id':_0x3a3e65['params']['id']}})[_0x862b('0x21')](handleEntityNotFound(_0x5e129e,null))[_0x862b('0x21')](removeEntity(_0x5e129e,null))[_0x862b('0x3c')](handleError(_0x5e129e,null));};exports['describe']=function(_0x280db5,_0x7dbbe4){return db[_0x862b('0x26')][_0x862b('0x44')]()[_0x862b('0x21')](respondWithResult(_0x7dbbe4,null))[_0x862b('0x3c')](handleError(_0x7dbbe4,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3721629..71d055f 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 _0xd77a=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x232f19,_0x629187){var _0x59ad1b=function(_0x21c5a3){while(--_0x21c5a3){_0x232f19['push'](_0x232f19['shift']());}};_0x59ad1b(++_0x629187);}(_0xd77a,0x1af));var _0xad77=function(_0x2474d1,_0x18f4eb){_0x2474d1=_0x2474d1-0x0;var _0x2e6479=_0xd77a[_0x2474d1];return _0x2e6479;};'use strict';var _=require(_0xad77('0x0'));var util=require(_0xad77('0x1'));var logger=require(_0xad77('0x2'))('api');var moment=require(_0xad77('0x3'));var BPromise=require(_0xad77('0x4'));var rp=require(_0xad77('0x5'));var fs=require('fs');var path=require(_0xad77('0x6'));var rimraf=require(_0xad77('0x7'));var config=require(_0xad77('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0xad77('0x9')]=function(_0x125c81,_0x113522){return _0x125c81[_0xad77('0xa')]('ChatTransferReport',attributes,{'tableName':_0xad77('0xb'),'paranoid':![],'indexes':[{'name':_0xad77('0xc'),'fields':[_0xad77('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7c8=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','bluebird'];(function(_0x484999,_0x57181d){var _0x240762=function(_0x4b0433){while(--_0x4b0433){_0x484999['push'](_0x484999['shift']());}};_0x240762(++_0x57181d);}(_0xb7c8,0xd4));var _0x8b7c=function(_0x27342a,_0x9a6b52){_0x27342a=_0x27342a-0x0;var _0x444cc4=_0xb7c8[_0x27342a];return _0x444cc4;};'use strict';var _=require(_0x8b7c('0x0'));var util=require(_0x8b7c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8b7c('0x2'));var BPromise=require(_0x8b7c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7c('0x4'));var config=require(_0x8b7c('0x5'));var attributes=require(_0x8b7c('0x6'));module[_0x8b7c('0x7')]=function(_0x2f1c6e,_0xb93eec){return _0x2f1c6e[_0x8b7c('0x8')](_0x8b7c('0x9'),attributes,{'tableName':_0x8b7c('0xa'),'paranoid':![],'indexes':[{'name':_0x8b7c('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 02a590a..215a56c 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 _0x18a9=['request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x124530,_0x4ffa98){var _0x3ba722=function(_0x1b0855){while(--_0x1b0855){_0x124530['push'](_0x124530['shift']());}};_0x3ba722(++_0x4ffa98);}(_0x18a9,0x1a9));var _0x918a=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x18a9[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x918a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x918a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x918a('0x2'));var logger=require(_0x918a('0x3'))(_0x918a('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x918a('0x5')][_0x918a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x579766,_0x4c7059,_0x144938){return new BPromise(function(_0x566077,_0xec05e4){return client[_0x918a('0x7')](_0x579766,_0x144938)['then'](function(_0xb25087){logger[_0x918a('0x8')](_0x918a('0x9'),_0x4c7059,_0x918a('0xa'));logger[_0x918a('0xb')](_0x918a('0xc'),_0x4c7059,_0x918a('0xa'),JSON[_0x918a('0xd')](_0xb25087));if(_0xb25087[_0x918a('0xe')]){if(_0xb25087[_0x918a('0xe')]['code']===0x1f4){logger['error'](_0x918a('0x9'),_0x4c7059,_0xb25087[_0x918a('0xe')][_0x918a('0xf')]);return _0xec05e4(_0xb25087[_0x918a('0xe')][_0x918a('0xf')]);}logger[_0x918a('0xe')](_0x918a('0x9'),_0x4c7059,_0xb25087[_0x918a('0xe')][_0x918a('0xf')]);return _0x566077(_0xb25087['error'][_0x918a('0xf')]);}else{logger['info'](_0x918a('0x9'),_0x4c7059,_0x918a('0xa'));_0x566077(_0xb25087[_0x918a('0x10')][_0x918a('0xf')]);}})[_0x918a('0x11')](function(_0x34eeb4){logger['error'](_0x918a('0x9'),_0x4c7059,_0x34eeb4);_0xec05e4(_0x34eeb4);});});} \ No newline at end of file +var _0x841e=['client','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x15748b,_0x3a28e3){var _0x1ac58d=function(_0x16850e){while(--_0x16850e){_0x15748b['push'](_0x15748b['shift']());}};_0x1ac58d(++_0x3a28e3);}(_0x841e,0x1d9));var _0xe841=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x841e[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xe841('0x0'));var util=require('util');var moment=require(_0xe841('0x1'));var BPromise=require(_0xe841('0x2'));var rs=require(_0xe841('0x3'));var fs=require('fs');var Redis=require(_0xe841('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe841('0x5'));var logger=require('../../config/logger')(_0xe841('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe841('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6cdb,_0x52b835,_0x41ebce){return new BPromise(function(_0x255673,_0x560cdb){return client['request'](_0x1d6cdb,_0x41ebce)[_0xe841('0x8')](function(_0x16fc08){logger[_0xe841('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0x52b835,_0xe841('0xa'));logger[_0xe841('0xb')](_0xe841('0xc'),_0x52b835,_0xe841('0xa'),JSON[_0xe841('0xd')](_0x16fc08));if(_0x16fc08[_0xe841('0xe')]){if(_0x16fc08[_0xe841('0xe')][_0xe841('0xf')]===0x1f4){logger[_0xe841('0xe')](_0xe841('0x10'),_0x52b835,_0x16fc08[_0xe841('0xe')][_0xe841('0x11')]);return _0x560cdb(_0x16fc08[_0xe841('0xe')][_0xe841('0x11')]);}logger[_0xe841('0xe')](_0xe841('0x10'),_0x52b835,_0x16fc08[_0xe841('0xe')][_0xe841('0x11')]);return _0x255673(_0x16fc08[_0xe841('0xe')][_0xe841('0x11')]);}else{logger[_0xe841('0x9')]('ChatTransferReport,\x20%s,\x20%s',_0x52b835,'request\x20sent');_0x255673(_0x16fc08[_0xe841('0x12')][_0xe841('0x11')]);}})[_0xe841('0x13')](function(_0x266a2f){logger[_0xe841('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x52b835,_0x266a2f);_0x560cdb(_0x266a2f);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 09c9644..b271ab6 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 _0x702f=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x702f,0x13a));var _0xf702=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x702f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf702('0x0'));var util=require(_0xf702('0x1'));var path=require(_0xf702('0x2'));var timeout=require(_0xf702('0x3'));var express=require(_0xf702('0x4'));var router=express[_0xf702('0x5')]();var fs_extra=require(_0xf702('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf702('0x7'));var config=require('../../config/environment');var controller=require(_0xf702('0x8'));router[_0xf702('0x9')]('/',auth[_0xf702('0xa')](),controller[_0xf702('0xb')]);router[_0xf702('0x9')](_0xf702('0xc'),auth[_0xf702('0xa')](),controller[_0xf702('0xd')]);router[_0xf702('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf702('0xe')]('/',auth['isAuthenticated'](),controller[_0xf702('0xf')]);router[_0xf702('0x10')](_0xf702('0x11'),auth[_0xf702('0xa')](),controller['update']);router[_0xf702('0x12')]('/:id',auth[_0xf702('0xa')](),controller[_0xf702('0x13')]);module[_0xf702('0x14')]=router; \ No newline at end of file +var _0x525a=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','exports'];(function(_0x3b5431,_0x1809f9){var _0x161318=function(_0x522bc2){while(--_0x522bc2){_0x3b5431['push'](_0x3b5431['shift']());}};_0x161318(++_0x1809f9);}(_0x525a,0x140));var _0xa525=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x525a[_0x53c256];return _0x25feb6;};'use strict';var multer=require('multer');var util=require(_0xa525('0x0'));var path=require(_0xa525('0x1'));var timeout=require(_0xa525('0x2'));var express=require('express');var router=express[_0xa525('0x3')]();var fs_extra=require(_0xa525('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa525('0x5'));var config=require('../../config/environment');var controller=require(_0xa525('0x6'));router[_0xa525('0x7')]('/',auth[_0xa525('0x8')](),controller[_0xa525('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa525('0xa')]);router[_0xa525('0x7')](_0xa525('0xb'),auth[_0xa525('0x8')](),controller['show']);router[_0xa525('0xc')]('/',auth[_0xa525('0x8')](),controller[_0xa525('0xd')]);router[_0xa525('0xe')]('/:id',auth[_0xa525('0x8')](),controller['update']);router['delete']('/:id',auth[_0xa525('0x8')](),controller['destroy']);module[_0xa525('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e37f320..e7aabae 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 _0xa8a8=['BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','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}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3f136e,_0x2408e4){_0x3f136e=_0x3f136e-0x0;var _0x26f8b1=_0xa8a8[_0x3f136e];return _0x26f8b1;};'use strict';var Sequelize=require(_0x8a8a('0x0'));var rs=require(_0x8a8a('0x1'));module[_0x8a8a('0x2')]={'name':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8a8a('0x4')},'description':{'type':Sequelize[_0x8a8a('0x3')]},'mapKey':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x5')},'key':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x6')},'customerAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':_0x8a8a('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':_0x8a8a('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a8a('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8a8a('0x3')]},'animation':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x8a8a('0xa'),_0x8a8a('0xb')),'defaultValue':_0x8a8a('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0xc')},'start_chat_button':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0xd')},'offline_chat_button':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8a8a('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8a8a('0x10')]},'closingQuestion':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x11')},'noteTitle':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x12')},'placeholderMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x13')},'closingMessageButton':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x14')},'skipMessageButton':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x16')},'ratingType':{'type':Sequelize[_0x8a8a('0x17')](_0x8a8a('0x18'),_0x8a8a('0x19')),'defaultValue':_0x8a8a('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x8a8a('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return JSON[_0x8a8a('0x1a')]({'items':[{'type':_0x8a8a('0x1b'),'variable':null,'config':{'placeholder':_0x8a8a('0x1c'),'type':_0x8a8a('0x1d'),'required':!![]},'props':{'title':_0x8a8a('0x1c'),'helpText':''}},{'type':_0x8a8a('0x1b'),'props':{'title':_0x8a8a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8a8a('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8a8a('0x1e')](_0x8a8a('0x1f'))?JSON[_0x8a8a('0x20')](this[_0x8a8a('0x1e')](_0x8a8a('0x1f'))):{};},'set':function(_0x251315){return this[_0x8a8a('0x21')]('onlineForm',JSON[_0x8a8a('0x1a')](_0x251315));}},'offlineForm':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return JSON[_0x8a8a('0x1a')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8a8a('0x5'),'type':_0x8a8a('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8a8a('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8a8a('0x23'))?JSON[_0x8a8a('0x20')](this['getDataValue'](_0x8a8a('0x23'))):{};},'set':function(_0x2c8f27){return this[_0x8a8a('0x21')](_0x8a8a('0x23'),JSON[_0x8a8a('0x1a')](_0x2c8f27));}},'token':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':function(){return rs[_0x8a8a('0x24')]();}},'autoclose':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8a8a('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x25')},'waitingMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x26')},'offlineMessageBody':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x15')},'sendUnmanaged':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8a8a('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':function(){return _0x8a8a('0x27');}},'notificationSound':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8a8a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8a8a('0x29')},'messagesAlignment':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x2a')},'defaultTitle':{'type':Sequelize[_0x8a8a('0x3')]},'customerAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8a8a('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8a8a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':_0x8a8a('0x2b')},'systemAvatar':{'type':Sequelize[_0x8a8a('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8a8a('0xe')],'comment':_0x8a8a('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x40d509){if(!_0x40d509)this[_0x8a8a('0x21')](_0x8a8a('0x2d'),null);this['setDataValue'](_0x8a8a('0x2e'),_0x40d509);}},'vidaooEscalation':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8a8a('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a8a('0x2f')},'vidaooNote':{'type':Sequelize[_0x8a8a('0x3')],'defaultValue':function(){return _0x8a8a('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x8a8a('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8a8a('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8a8a('0x10')]}}; \ No newline at end of file +var _0xb821=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate'];(function(_0x43422c,_0x104710){var _0x324c36=function(_0x20416d){while(--_0x20416d){_0x43422c['push'](_0x43422c['shift']());}};_0x324c36(++_0x104710);}(_0xb821,0xa7));var _0x1b82=function(_0x50a3af,_0x265ce9){_0x50a3af=_0x50a3af-0x0;var _0x5c7e02=_0xb821[_0x50a3af];return _0x5c7e02;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1b82('0x0'));module[_0x1b82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1b82('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x3')},'key':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x5')},'customerAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1b82('0x4')]},'animation':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1b82('0xa')](_0x1b82('0xb'),_0x1b82('0xc')),'defaultValue':_0x1b82('0xb')},'header_online':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xd')},'offline_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1b82('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x12')},'placeholderMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xe')},'skipMessageButton':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x1b82('0x16'),_0x1b82('0x17')),'defaultValue':_0x1b82('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x1b82('0x1a'),'required':!![]},'props':{'title':_0x1b82('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1b82('0x1c'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0xf2e556){return this[_0x1b82('0x1d')](_0x1b82('0x1c'),JSON[_0x1b82('0x18')](_0xf2e556));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null},{'type':_0x1b82('0x1e'),'config':{'placeholder':_0x1b82('0x1f')},'props':{'title':_0x1b82('0x1f'),'helpText':_0x1b82('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1b82('0x21')](_0x1b82('0x22'))?JSON[_0x1b82('0x23')](this[_0x1b82('0x21')]('offlineForm')):{};},'set':function(_0x17b3aa){return this[_0x1b82('0x1d')](_0x1b82('0x22'),JSON[_0x1b82('0x18')](_0x17b3aa));}},'token':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return rs[_0x1b82('0x24')]();}},'autoclose':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1b82('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1b82('0x4')]},'waitingTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x25')},'waitingMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1b82('0x4')]},'notificationTemplate':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return _0x1b82('0x28');}},'notificationSound':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2b')},'messagesAlignment':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2c')},'defaultTitle':{'type':Sequelize[_0x1b82('0x4')]},'customerAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2d')},'systemAvatar':{'type':Sequelize[_0x1b82('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b82('0x8')],'comment':_0x1b82('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17d214){if(!_0x17d214)this['setDataValue'](_0x1b82('0x2f'),null);this['setDataValue'](_0x1b82('0x30'),_0x17d214);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x31')},'vidaooNote':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return _0x1b82('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1b82('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c6653a7..49539a6 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 _0xc361=['find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','nolimit','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','ChatWebsiteId','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','systemAvatar','join','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','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','CmList','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','asc','defaults','contact','headers','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','format','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','CompanyId','from','send','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','MailAccountId','NotifyMailAccount','notifyMail','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','remote','x-real-ip','connection','replace','render','alignment','verticalAlignment','color','labelText','textColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','status','end','json','offset','undefined','count','limit','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xb49d10,_0x103e8c){var _0x2a8e96=function(_0x11308f){while(--_0x11308f){_0xb49d10['push'](_0xb49d10['shift']());}};_0x2a8e96(++_0x103e8c);}(_0xc361,0xdb));var _0x1c36=function(_0x30f8a2,_0x23b1f7){_0x30f8a2=_0x30f8a2-0x0;var _0x38b4d7=_0xc361[_0x30f8a2];return _0x38b4d7;};'use strict';var BPromise=require(_0x1c36('0x0'));var Mustache=require(_0x1c36('0x1'));var util=require(_0x1c36('0x2'));var path=require('path');var ejs=require(_0x1c36('0x3'));var fs=require('fs');var fs_extra=require(_0x1c36('0x4'));var _=require(_0x1c36('0x5'));var querystring=require(_0x1c36('0x6'));var Redis=require(_0x1c36('0x7'));var qs=require(_0x1c36('0x8'));var logger=require(_0x1c36('0x9'))('api');var config=require('../../config/environment');var db=require(_0x1c36('0xa'))['db'];config[_0x1c36('0xb')]=_['defaults'](config[_0x1c36('0xb')],{'host':_0x1c36('0xc'),'port':0x18eb});var socket=require(_0x1c36('0xd'))(new Redis(config['redis']));require(_0x1c36('0xe'))[_0x1c36('0xf')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x1c36('0x10')][_0x1c36('0x11')]({'port':0x232c});var client9002=jayson[_0x1c36('0x10')][_0x1c36('0x11')]({'port':0x232a});var client9003=jayson[_0x1c36('0x10')]['http']({'port':0x232b});var client9001=jayson['client'][_0x1c36('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x6c7fae,_0xa62297,_0x10e928,_0x2f1ee4){return new BPromise(function(_0x433fb5,_0x37893e){var _0x56f9f3=_0x2f1ee4||client;return _0x56f9f3[_0x1c36('0x12')](_0x6c7fae,_0x10e928)[_0x1c36('0x13')](function(_0x5914ba){logger[_0x1c36('0x14')]('ChatWebsite,\x20%s,\x20%s',_0xa62297,_0x1c36('0x15'));logger[_0x1c36('0x16')](_0x1c36('0x17'),_0xa62297,'request\x20sent',JSON[_0x1c36('0x18')](_0x5914ba));if(_0x5914ba[_0x1c36('0x19')]){if(_0x5914ba[_0x1c36('0x19')][_0x1c36('0x1a')]===0x1f4){logger[_0x1c36('0x19')](_0x1c36('0x1b'),_0xa62297,_0x5914ba[_0x1c36('0x19')][_0x1c36('0x1c')]);return _0x37893e(_0x5914ba['error'][_0x1c36('0x1c')]);}logger[_0x1c36('0x19')](_0x1c36('0x1b'),_0xa62297,_0x5914ba[_0x1c36('0x19')][_0x1c36('0x1c')]);return _0x433fb5(_0x5914ba[_0x1c36('0x19')][_0x1c36('0x1c')]);}else{logger['info'](_0x1c36('0x1b'),_0xa62297,_0x1c36('0x15'));_0x433fb5(_0x5914ba['result'][_0x1c36('0x1c')]);}})['catch'](function(_0x5ab371){logger['error'](_0x1c36('0x1b'),_0xa62297,_0x5ab371);_0x37893e(_0x5ab371);});});}function respondWithStatusCode(_0x27daf4,_0x4f303a){_0x4f303a=_0x4f303a||0xcc;return function(_0x33c554){if(_0x33c554){return _0x27daf4['sendStatus'](_0x4f303a);}return _0x27daf4[_0x1c36('0x1d')](_0x4f303a)[_0x1c36('0x1e')]();};}function respondWithResult(_0x48a69e,_0x115e3e){_0x115e3e=_0x115e3e||0xc8;return function(_0x2bccae){if(_0x2bccae){return _0x48a69e[_0x1c36('0x1d')](_0x115e3e)[_0x1c36('0x1f')](_0x2bccae);}};}function respondWithFilteredResult(_0x182f50,_0x3d1adb){return function(_0x1ee123){if(_0x1ee123){var _0x5cc989=typeof _0x3d1adb[_0x1c36('0x20')]==='undefined'&&typeof _0x3d1adb['limit']===_0x1c36('0x21');var _0xacb605=_0x1ee123[_0x1c36('0x22')];var _0x4f0453=_0x5cc989?0x0:_0x3d1adb[_0x1c36('0x20')];var _0x12d8c8=_0x5cc989?_0x1ee123[_0x1c36('0x22')]:_0x3d1adb[_0x1c36('0x20')]+_0x3d1adb[_0x1c36('0x23')];var _0x477048;if(_0x12d8c8>=_0xacb605){_0x12d8c8=_0xacb605;_0x477048=0xc8;}else{_0x477048=0xce;}_0x182f50['status'](_0x477048);return _0x182f50['set'](_0x1c36('0x24'),_0x4f0453+'-'+_0x12d8c8+'/'+_0xacb605)[_0x1c36('0x1f')](_0x1ee123);}return null;};}function saveUpdates(_0x3c050c){return function(_0x3a27c6){if(_0x3a27c6){return _0x3a27c6[_0x1c36('0x25')](_0x3c050c)[_0x1c36('0x13')](function(_0x495fd1){return _0x495fd1;});}return null;};}function removeEntity(_0x180c04){return function(_0x8ae34c){if(_0x8ae34c){return _0x8ae34c[_0x1c36('0x26')]()[_0x1c36('0x13')](function(){var _0x5c3252=_0x8ae34c[_0x1c36('0x27')]({'plain':!![]});var _0x5da581=_0x1c36('0x28');return db[_0x1c36('0x29')][_0x1c36('0x26')]({'where':{'type':_0x5da581,'resourceId':_0x5c3252['id']}})[_0x1c36('0x13')](function(){return _0x8ae34c;});})[_0x1c36('0x13')](function(){_0x180c04[_0x1c36('0x1d')](0xcc)[_0x1c36('0x1e')]();});}};}function handleEntityNotFound(_0x5e90f4){return function(_0x1fc5df){if(!_0x1fc5df){_0x5e90f4[_0x1c36('0x2a')](0x194);}return _0x1fc5df;};}function handleError(_0x280f8e,_0x4ef5ba){_0x4ef5ba=_0x4ef5ba||0x1f4;return function(_0x332c23){logger[_0x1c36('0x19')](_0x332c23['stack']);if(_0x332c23['name']){delete _0x332c23[_0x1c36('0x2b')];}_0x280f8e[_0x1c36('0x1d')](_0x4ef5ba)['send'](_0x332c23);};}exports[_0x1c36('0x2c')]=function(_0x3a04b8,_0x281891){var _0x3ae2b8={'include':[{'model':db[_0x1c36('0x2d')],'as':_0x1c36('0x2e')}]},_0x4bdb7c={},_0x2aa6d2={'count':0x0,'rows':[]};var _0x5b0460=_[_0x1c36('0x2f')](db[_0x1c36('0x30')]['rawAttributes'],function(_0x3973cb){return{'name':_0x3973cb[_0x1c36('0x31')],'type':_0x3973cb[_0x1c36('0x32')]['key']};});_0x4bdb7c[_0x1c36('0x33')]=_['map'](_0x5b0460,_0x1c36('0x2b'));_0x4bdb7c[_0x1c36('0x34')]=_[_0x1c36('0x35')](_0x3a04b8[_0x1c36('0x34')]);_0x4bdb7c['filters']=_[_0x1c36('0x36')](_0x4bdb7c[_0x1c36('0x33')],_0x4bdb7c['query']);_0x3ae2b8[_0x1c36('0x37')]=_[_0x1c36('0x36')](_0x4bdb7c[_0x1c36('0x33')],qs[_0x1c36('0x38')](_0x3a04b8[_0x1c36('0x34')]['fields']));_0x3ae2b8['attributes']=_0x3ae2b8[_0x1c36('0x37')]['length']?_0x3ae2b8['attributes']:_0x4bdb7c[_0x1c36('0x33')];if(!_0x3a04b8[_0x1c36('0x34')][_0x1c36('0x39')]('nolimit')){_0x3ae2b8[_0x1c36('0x23')]=qs[_0x1c36('0x23')](_0x3a04b8[_0x1c36('0x34')][_0x1c36('0x23')]);_0x3ae2b8[_0x1c36('0x20')]=qs['offset'](_0x3a04b8['query'][_0x1c36('0x20')]);}_0x3ae2b8[_0x1c36('0x3a')]=qs[_0x1c36('0x3b')](_0x3a04b8[_0x1c36('0x34')][_0x1c36('0x3b')]);_0x3ae2b8[_0x1c36('0x3c')]=qs[_0x1c36('0x3d')](_['pick'](_0x3a04b8[_0x1c36('0x34')],_0x4bdb7c['filters']),_0x5b0460);if(_0x3a04b8[_0x1c36('0x34')][_0x1c36('0x3e')]){_0x3ae2b8[_0x1c36('0x3c')]=_[_0x1c36('0x3f')](_0x3ae2b8[_0x1c36('0x3c')],{'$or':_[_0x1c36('0x2f')](_0x5b0460,function(_0x315cb4){if(_0x315cb4[_0x1c36('0x32')]!==_0x1c36('0x40')){var _0xb9e028={};_0xb9e028[_0x315cb4['name']]={'$like':'%'+_0x3a04b8[_0x1c36('0x34')]['filter']+'%'};return _0xb9e028;}})});}_0x3ae2b8=_[_0x1c36('0x3f')]({},_0x3ae2b8,_0x3a04b8[_0x1c36('0x41')]);var _0xc4d3a1={'where':_0x3ae2b8[_0x1c36('0x3c')]};return db[_0x1c36('0x30')][_0x1c36('0x22')](_0xc4d3a1)['then'](function(_0x78a46){_0x2aa6d2[_0x1c36('0x22')]=_0x78a46;if(_0x3a04b8['query'][_0x1c36('0x42')]){_0x3ae2b8[_0x1c36('0x43')]=[{'all':!![]}];}return db[_0x1c36('0x30')][_0x1c36('0x44')](_0x3ae2b8);})['then'](function(_0x1b4343){_0x2aa6d2[_0x1c36('0x45')]=_0x1b4343;return _0x2aa6d2;})[_0x1c36('0x13')](respondWithFilteredResult(_0x281891,_0x3ae2b8))[_0x1c36('0x46')](handleError(_0x281891,null));};exports[_0x1c36('0x47')]=function(_0x49a1e3,_0x5ab599){var _0x64fe09={'raw':![],'where':{'id':_0x49a1e3[_0x1c36('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x1c36('0x2e')}]},_0x1d1877={};_0x1d1877[_0x1c36('0x33')]=_[_0x1c36('0x35')](db[_0x1c36('0x30')][_0x1c36('0x49')]);_0x1d1877['query']=_[_0x1c36('0x35')](_0x49a1e3[_0x1c36('0x34')]);_0x1d1877['filters']=_[_0x1c36('0x36')](_0x1d1877[_0x1c36('0x33')],_0x1d1877['query']);_0x64fe09[_0x1c36('0x37')]=_['intersection'](_0x1d1877[_0x1c36('0x33')],qs[_0x1c36('0x38')](_0x49a1e3[_0x1c36('0x34')]['fields']));_0x64fe09[_0x1c36('0x37')]=_0x64fe09[_0x1c36('0x37')][_0x1c36('0x4a')]?_0x64fe09['attributes']:_0x1d1877['model'];if(_0x49a1e3[_0x1c36('0x34')][_0x1c36('0x42')]){_0x64fe09[_0x1c36('0x43')]=[{'all':!![]}];}_0x64fe09=_['merge']({},_0x64fe09,_0x49a1e3[_0x1c36('0x41')]);return db[_0x1c36('0x30')]['find'](_0x64fe09)[_0x1c36('0x13')](handleEntityNotFound(_0x5ab599,null))[_0x1c36('0x13')](respondWithResult(_0x5ab599,null))[_0x1c36('0x46')](handleError(_0x5ab599,null));};exports[_0x1c36('0x4b')]=function(_0x4ffe61,_0x42e406){return db[_0x1c36('0x30')][_0x1c36('0x4b')](_0x4ffe61['body'],{})[_0x1c36('0x13')](function(_0x55a694){var _0x67607b=_0x4ffe61[_0x1c36('0x4c')]['get']({'plain':!![]});if(!_0x67607b)throw new Error(_0x1c36('0x4d'));if(_0x67607b[_0x1c36('0x4e')]===_0x1c36('0x4c')){var _0x58ca1b=_0x55a694[_0x1c36('0x27')]({'plain':!![]});var _0x38bc01=_0x1c36('0x28');return db['UserProfileSection'][_0x1c36('0x4f')]({'where':{'name':_0x38bc01,'userProfileId':_0x67607b[_0x1c36('0x50')]},'raw':!![]})['then'](function(_0x361ce4){if(_0x361ce4&&_0x361ce4[_0x1c36('0x51')]===0x0){return db[_0x1c36('0x29')]['create']({'name':_0x58ca1b[_0x1c36('0x2b')],'resourceId':_0x58ca1b['id'],'type':_0x361ce4[_0x1c36('0x2b')],'sectionId':_0x361ce4['id']},{})[_0x1c36('0x13')](function(){return _0x55a694;});}else{return _0x55a694;}})[_0x1c36('0x46')](function(_0x1c71d7){logger[_0x1c36('0x19')](_0x1c36('0x52'),_0x1c71d7);throw _0x1c71d7;});}return _0x55a694;})[_0x1c36('0x13')](respondWithResult(_0x42e406,0xc9))['catch'](handleError(_0x42e406,null));};exports[_0x1c36('0x25')]=function(_0x19ca82,_0x255e70){if(_0x19ca82[_0x1c36('0x53')]['id']){delete _0x19ca82[_0x1c36('0x53')]['id'];}return db[_0x1c36('0x30')]['find']({'where':{'id':_0x19ca82[_0x1c36('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x1c36('0x2e')}]})[_0x1c36('0x13')](handleEntityNotFound(_0x255e70,null))[_0x1c36('0x13')](saveUpdates(_0x19ca82[_0x1c36('0x53')],null))['then'](respondWithResult(_0x255e70,null))['catch'](handleError(_0x255e70,null));};exports['destroy']=function(_0x1e60c6,_0x3a8a3c){return db[_0x1c36('0x30')][_0x1c36('0x4f')]({'where':{'id':_0x1e60c6['params']['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x3a8a3c,null))['then'](removeEntity(_0x3a8a3c,null))[_0x1c36('0x46')](handleError(_0x3a8a3c,null));};exports['describe']=function(_0x15b342,_0x19c89b){return db[_0x1c36('0x30')][_0x1c36('0x54')]()[_0x1c36('0x13')](respondWithResult(_0x19c89b,null))[_0x1c36('0x46')](handleError(_0x19c89b,null));};exports[_0x1c36('0x55')]=function(_0x3db972,_0x1357f7){if(_0x3db972[_0x1c36('0x53')]['id']){delete _0x3db972[_0x1c36('0x53')]['id'];}return db['ChatWebsite'][_0x1c36('0x4f')]({'where':{'id':_0x3db972[_0x1c36('0x48')]['id']}})['then'](handleEntityNotFound(_0x1357f7,null))[_0x1c36('0x13')](function(_0x148b64){if(_0x148b64){_0x3db972[_0x1c36('0x53')]['ChatWebsiteId']=_0x148b64['id'];return db[_0x1c36('0x56')][_0x1c36('0x4b')](_0x3db972['body']);}})[_0x1c36('0x13')](respondWithResult(_0x1357f7,null))[_0x1c36('0x46')](handleError(_0x1357f7,null));};exports['getDispositions']=function(_0x485ece,_0x1de6fc){var _0x9506bf={'raw':![],'where':{}};var _0xa0465a={};var _0xf7094b={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x485ece['params']['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x1de6fc,null))[_0x1c36('0x13')](function(_0x5e4ac3){if(_0x5e4ac3){_0xa0465a['model']=_[_0x1c36('0x35')](db['Disposition'][_0x1c36('0x49')]);_0xa0465a[_0x1c36('0x34')]=_['keys'](_0x485ece[_0x1c36('0x34')]);_0xa0465a[_0x1c36('0x3d')]=_[_0x1c36('0x36')](_0xa0465a[_0x1c36('0x33')],_0xa0465a[_0x1c36('0x34')]);_0x9506bf['attributes']=_['intersection'](_0xa0465a[_0x1c36('0x33')],qs[_0x1c36('0x38')](_0x485ece['query'][_0x1c36('0x38')]));_0x9506bf[_0x1c36('0x37')]=_0x9506bf[_0x1c36('0x37')][_0x1c36('0x4a')]?_0x9506bf[_0x1c36('0x37')]:_0xa0465a['model'];if(!_0x485ece[_0x1c36('0x34')][_0x1c36('0x39')](_0x1c36('0x57'))){_0x9506bf['limit']=qs[_0x1c36('0x23')](_0x485ece[_0x1c36('0x34')][_0x1c36('0x23')]);_0x9506bf[_0x1c36('0x20')]=qs['offset'](_0x485ece[_0x1c36('0x34')]['offset']);}_0x9506bf[_0x1c36('0x3a')]=qs[_0x1c36('0x3b')](_0x485ece[_0x1c36('0x34')][_0x1c36('0x3b')]);_0x9506bf['where']=qs[_0x1c36('0x3d')](_[_0x1c36('0x58')](_0x485ece[_0x1c36('0x34')],_0xa0465a['filters']));_0x9506bf[_0x1c36('0x3c')]['ChatWebsiteId']=_0x5e4ac3['id'];if(_0x485ece[_0x1c36('0x34')][_0x1c36('0x3e')]){_0x9506bf['where']=_[_0x1c36('0x3f')](_0x9506bf[_0x1c36('0x3c')],{'$or':_[_0x1c36('0x2f')](_0x9506bf[_0x1c36('0x37')],function(_0x5cc32b){var _0x192c0e={};_0x192c0e[_0x5cc32b]={'$like':'%'+_0x485ece['query'][_0x1c36('0x3e')]+'%'};return _0x192c0e;})});}_0x9506bf=_[_0x1c36('0x3f')]({},_0x9506bf,_0x485ece[_0x1c36('0x41')]);return db[_0x1c36('0x56')]['count']({'where':_0x9506bf[_0x1c36('0x3c')]})[_0x1c36('0x13')](function(_0x55bb61){_0xf7094b['count']=_0x55bb61;if(_0x485ece[_0x1c36('0x34')][_0x1c36('0x42')]){_0x9506bf[_0x1c36('0x43')]=[{'all':!![]}];}return db[_0x1c36('0x56')]['findAll'](_0x9506bf);})[_0x1c36('0x13')](function(_0x1dbcd5){_0xf7094b['rows']=_0x1dbcd5;return _0xf7094b;});}})[_0x1c36('0x13')](respondWithFilteredResult(_0x1de6fc,_0x9506bf))['catch'](handleError(_0x1de6fc,null));};exports[_0x1c36('0x59')]=function(_0x44a594,_0x595331){return db[_0x1c36('0x30')][_0x1c36('0x4f')]({'where':{'id':_0x44a594['params']['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x595331,null))[_0x1c36('0x13')](function(_0x3826d2){if(_0x3826d2){return _0x3826d2[_0x1c36('0x59')](_0x44a594[_0x1c36('0x34')][_0x1c36('0x5a')]);}})[_0x1c36('0x13')](respondWithStatusCode(_0x595331,null))['catch'](handleError(_0x595331,null));};exports[_0x1c36('0x5b')]=function(_0x4ccdc9,_0x1d671b){if(_0x4ccdc9[_0x1c36('0x53')]['id']){delete _0x4ccdc9[_0x1c36('0x53')]['id'];}return db[_0x1c36('0x30')]['find']({'where':{'id':_0x4ccdc9[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x1d671b,null))[_0x1c36('0x13')](function(_0x537aea){if(_0x537aea){_0x4ccdc9[_0x1c36('0x53')]['ChatWebsiteId']=_0x537aea['id'];return db['CannedAnswer'][_0x1c36('0x4b')](_0x4ccdc9['body']);}})[_0x1c36('0x13')](respondWithResult(_0x1d671b,null))[_0x1c36('0x46')](handleError(_0x1d671b,null));};exports[_0x1c36('0x5c')]=function(_0xbab04d,_0xc88958){var _0x5389b4={'raw':![],'where':{}};var _0x32eef8={};var _0x3a50f8={'count':0x0,'rows':[]};return db[_0x1c36('0x30')][_0x1c36('0x5d')]({'where':{'id':_0xbab04d[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0xc88958,null))[_0x1c36('0x13')](function(_0x15a73d){if(_0x15a73d){_0x32eef8['model']=_[_0x1c36('0x35')](db[_0x1c36('0x5e')][_0x1c36('0x49')]);_0x32eef8[_0x1c36('0x34')]=_[_0x1c36('0x35')](_0xbab04d[_0x1c36('0x34')]);_0x32eef8[_0x1c36('0x3d')]=_[_0x1c36('0x36')](_0x32eef8[_0x1c36('0x33')],_0x32eef8[_0x1c36('0x34')]);_0x5389b4[_0x1c36('0x37')]=_[_0x1c36('0x36')](_0x32eef8[_0x1c36('0x33')],qs[_0x1c36('0x38')](_0xbab04d[_0x1c36('0x34')][_0x1c36('0x38')]));_0x5389b4['attributes']=_0x5389b4[_0x1c36('0x37')][_0x1c36('0x4a')]?_0x5389b4['attributes']:_0x32eef8[_0x1c36('0x33')];if(!_0xbab04d[_0x1c36('0x34')]['hasOwnProperty'](_0x1c36('0x57'))){_0x5389b4[_0x1c36('0x23')]=qs[_0x1c36('0x23')](_0xbab04d[_0x1c36('0x34')][_0x1c36('0x23')]);_0x5389b4['offset']=qs['offset'](_0xbab04d[_0x1c36('0x34')][_0x1c36('0x20')]);}_0x5389b4[_0x1c36('0x3a')]=qs[_0x1c36('0x3b')](_0xbab04d['query']['sort']);_0x5389b4[_0x1c36('0x3c')]=qs[_0x1c36('0x3d')](_[_0x1c36('0x58')](_0xbab04d[_0x1c36('0x34')],_0x32eef8['filters']));_0x5389b4[_0x1c36('0x3c')][_0x1c36('0x5f')]=_0x15a73d['id'];if(_0xbab04d[_0x1c36('0x34')][_0x1c36('0x3e')]){_0x5389b4[_0x1c36('0x3c')]=_['merge'](_0x5389b4[_0x1c36('0x3c')],{'$or':_['map'](_0x5389b4[_0x1c36('0x37')],function(_0x52dadf){var _0xfe13cb={};_0xfe13cb[_0x52dadf]={'$like':'%'+_0xbab04d[_0x1c36('0x34')][_0x1c36('0x3e')]+'%'};return _0xfe13cb;})});}_0x5389b4=_[_0x1c36('0x3f')]({},_0x5389b4,_0xbab04d[_0x1c36('0x41')]);return db['CannedAnswer'][_0x1c36('0x22')]({'where':_0x5389b4[_0x1c36('0x3c')]})[_0x1c36('0x13')](function(_0x17569e){_0x3a50f8[_0x1c36('0x22')]=_0x17569e;if(_0xbab04d[_0x1c36('0x34')][_0x1c36('0x42')]){_0x5389b4['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x1c36('0x44')](_0x5389b4);})['then'](function(_0x404ad4){_0x3a50f8[_0x1c36('0x45')]=_0x404ad4;return _0x3a50f8;});}})[_0x1c36('0x13')](respondWithFilteredResult(_0xc88958,_0x5389b4))[_0x1c36('0x46')](handleError(_0xc88958,null));};exports[_0x1c36('0x60')]=function(_0x569db1,_0x1a0672){return db[_0x1c36('0x30')]['find']({'where':{'id':_0x569db1['params']['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x1a0672,null))[_0x1c36('0x13')](function(_0x1d143d){if(_0x1d143d){return _0x1d143d[_0x1c36('0x60')](_0x569db1[_0x1c36('0x34')][_0x1c36('0x5a')]);}})['then'](respondWithStatusCode(_0x1a0672,null))[_0x1c36('0x46')](handleError(_0x1a0672,null));};exports[_0x1c36('0x61')]=function(_0x196156,_0x3fff59){_0x196156[_0x1c36('0x53')][_0x1c36('0x62')]=_0x196156[_0x1c36('0x63')][_0x1c36('0x64')];return db['ChatWebsite'][_0x1c36('0x4f')]({'where':{'id':_0x196156[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x3fff59,null))[_0x1c36('0x13')](saveUpdates(_0x196156[_0x1c36('0x53')],null))[_0x1c36('0x13')](respondWithResult(_0x3fff59,null))[_0x1c36('0x46')](handleError(_0x3fff59,null));};exports[_0x1c36('0x65')]=function(_0x199e28,_0x5ecdbf){_0x199e28[_0x1c36('0x53')]['agentAvatar']=_0x199e28[_0x1c36('0x63')][_0x1c36('0x64')];return db[_0x1c36('0x30')][_0x1c36('0x4f')]({'where':{'id':_0x199e28[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x5ecdbf,null))['then'](saveUpdates(_0x199e28[_0x1c36('0x53')],null))[_0x1c36('0x13')](respondWithResult(_0x5ecdbf,null))[_0x1c36('0x46')](handleError(_0x5ecdbf,null));};exports[_0x1c36('0x66')]=function(_0x383c0a,_0x51660d){_0x383c0a['body']['customerAvatar']=_0x383c0a[_0x1c36('0x63')][_0x1c36('0x64')];return db[_0x1c36('0x30')][_0x1c36('0x4f')]({'where':{'id':_0x383c0a[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x51660d,null))['then'](saveUpdates(_0x383c0a[_0x1c36('0x53')],null))[_0x1c36('0x13')](respondWithResult(_0x51660d,null))['catch'](handleError(_0x51660d,null));};exports['addSystemAvatar']=function(_0x35dca2,_0x59c5e0){_0x35dca2[_0x1c36('0x53')][_0x1c36('0x67')]=_0x35dca2[_0x1c36('0x63')][_0x1c36('0x64')];return db[_0x1c36('0x30')][_0x1c36('0x4f')]({'where':{'id':_0x35dca2[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x59c5e0,null))[_0x1c36('0x13')](saveUpdates(_0x35dca2[_0x1c36('0x53')],null))['then'](respondWithResult(_0x59c5e0,null))[_0x1c36('0x46')](handleError(_0x59c5e0,null));};exports['getLogo']=function(_0x2417c6,_0x303d16){var _0x32c9c1=path[_0x1c36('0x68')](config['root'],'server/files/images/logos/default_logo.svg');var _0x15755a={'where':{'id':_0x2417c6[_0x1c36('0x48')]['id']},'attributes':['id',_0x1c36('0x62')],'raw':!![]};var _0x576216=![];return require(_0x1c36('0x69'))[_0x1c36('0x6a')]()[_0x1c36('0x13')](function(_0xf45662){if(_0xf45662){_0x576216=_0xf45662[_0x1c36('0x6b')];}})[_0x1c36('0x13')](function(){return db[_0x1c36('0x30')][_0x1c36('0x4f')](_0x15755a);})[_0x1c36('0x13')](handleEntityNotFound(_0x303d16,null))[_0x1c36('0x13')](function(_0x3d6fee){if(_0x3d6fee){if(!_[_0x1c36('0x6c')](_0x3d6fee['sitepic'])){if(fs[_0x1c36('0x6d')](path[_0x1c36('0x68')](config[_0x1c36('0x6e')],_0x1c36('0x6f'),_0x3d6fee[_0x1c36('0x62')]))&&_0x576216){_0x32c9c1=path[_0x1c36('0x68')](config[_0x1c36('0x6e')],_0x1c36('0x6f'),_0x3d6fee[_0x1c36('0x62')]);}}return _0x303d16[_0x1c36('0x70')](_0x32c9c1);}})[_0x1c36('0x46')](handleError(_0x303d16,null));};exports[_0x1c36('0x71')]=function(_0x2e900e,_0x1a8ce0){var _0x40e7a4=path[_0x1c36('0x68')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x180b46={'where':{'id':_0x2e900e[_0x1c36('0x48')]['id']},'attributes':['id',_0x1c36('0x72')],'raw':!![]};return db['ChatWebsite'][_0x1c36('0x4f')](_0x180b46)[_0x1c36('0x13')](handleEntityNotFound(_0x1a8ce0,null))['then'](function(_0x275990){if(_0x275990){if(!_['isNil'](_0x275990[_0x1c36('0x72')])){if(fs['existsSync'](path[_0x1c36('0x68')](config[_0x1c36('0x6e')],_0x1c36('0x73'),_0x275990[_0x1c36('0x72')]))){_0x40e7a4=path[_0x1c36('0x68')](config[_0x1c36('0x6e')],_0x1c36('0x73'),_0x275990[_0x1c36('0x72')]);}}return _0x1a8ce0[_0x1c36('0x70')](_0x40e7a4);}})['catch'](handleError(_0x1a8ce0,null));};exports[_0x1c36('0x74')]=function(_0x2eda1d,_0xd8da46){var _0xdef7db=path[_0x1c36('0x68')](config['root'],_0x1c36('0x75'));var _0x21a2e1={'where':{'id':_0x2eda1d[_0x1c36('0x48')]['id']},'attributes':['id','customerAvatar',_0x1c36('0x76')],'raw':!![]};return db['ChatWebsite'][_0x1c36('0x4f')](_0x21a2e1)[_0x1c36('0x13')](handleEntityNotFound(_0xd8da46,null))[_0x1c36('0x13')](function(_0x4dc4fc){if(_0x4dc4fc){if(!_[_0x1c36('0x6c')](_0x4dc4fc[_0x1c36('0x77')])){if(fs['existsSync'](path['join'](config[_0x1c36('0x6e')],_0x1c36('0x73'),_0x4dc4fc[_0x1c36('0x77')]))&&_0x4dc4fc[_0x1c36('0x76')]){_0xdef7db=path[_0x1c36('0x68')](config[_0x1c36('0x6e')],_0x1c36('0x73'),_0x4dc4fc[_0x1c36('0x77')]);}}return _0xd8da46[_0x1c36('0x70')](_0xdef7db);}})[_0x1c36('0x46')](handleError(_0xd8da46,null));};exports[_0x1c36('0x78')]=function(_0x2d1b31,_0x1a9599){var _0x68dff3=path[_0x1c36('0x68')](config['root'],_0x1c36('0x79'));var _0x22dc8e={'where':{'id':_0x2d1b31[_0x1c36('0x48')]['id']},'attributes':['id',_0x1c36('0x67')],'raw':!![]};return db[_0x1c36('0x30')][_0x1c36('0x4f')](_0x22dc8e)['then'](handleEntityNotFound(_0x1a9599,null))[_0x1c36('0x13')](function(_0x52ceb3){if(_0x52ceb3){if(!_[_0x1c36('0x6c')](_0x52ceb3[_0x1c36('0x67')])){if(fs['existsSync'](path['join'](config[_0x1c36('0x6e')],'server/files/images/avatars/',_0x52ceb3[_0x1c36('0x67')]))){_0x68dff3=path[_0x1c36('0x68')](config[_0x1c36('0x6e')],_0x1c36('0x73'),_0x52ceb3[_0x1c36('0x67')]);}}return _0x1a9599[_0x1c36('0x70')](_0x68dff3);}})['catch'](handleError(_0x1a9599,null));};exports['notify']=function(_0x298b01,_0x725653){var _0x2d5a3e=require(_0x1c36('0x7a'));var _0x2752f0=new _0x2d5a3e();var _0x5c455b=_0x2752f0[_0x1c36('0x7b')](_0x298b01['headers'][_0x1c36('0x7c')])[_0x1c36('0x7d')]();var _0x454694={'body':_0x298b01[_0x1c36('0x53')],'channel':_0x1c36('0x7e')};var _0x27040b=[];var _0x40fc14=[];var _0x445590={};var _0x1a6fda=![];return db['CmContact'][_0x1c36('0x54')]()[_0x1c36('0x13')](function(_0x50dcce){if(!_0x50dcce){throw new db[(_0x1c36('0x7f'))][(_0x1c36('0x80'))](_0x1c36('0x81'));}_0x27040b=_[_0x1c36('0x82')](_['keys'](_0x50dcce),[_0x1c36('0x83'),_0x1c36('0x84')]);_0x40fc14=_[_0x1c36('0x82')](_[_0x1c36('0x35')](_0x50dcce),[_0x1c36('0x83'),'updatedAt','CompanyId',_0x1c36('0x85')]);if(_0x298b01['body']['id']){delete _0x298b01[_0x1c36('0x53')]['id'];}if(_[_0x1c36('0x6c')](_0x298b01[_0x1c36('0x53')]['from'])){throw new db['Sequelize'][(_0x1c36('0x80'))](_0x1c36('0x86'));}if(_['isNil'](_0x298b01[_0x1c36('0x53')][_0x1c36('0x53')])||_0x298b01[_0x1c36('0x53')]['body']===''){throw new db[(_0x1c36('0x7f'))]['ValidationError'](_0x1c36('0x87'));}if(_[_0x1c36('0x6c')](_0x298b01[_0x1c36('0x53')]['mapKey'])){throw new db[(_0x1c36('0x7f'))][(_0x1c36('0x80'))](_0x1c36('0x88')+_0x40fc14);}if(!_['includes'](_0x40fc14,_0x298b01['body']['mapKey'])){throw new db[(_0x1c36('0x7f'))][(_0x1c36('0x80'))](_0x1c36('0x89')+_0x40fc14);}_0x445590[_0x298b01[_0x1c36('0x53')][_0x1c36('0x8a')]]=_0x298b01['body']['from'];})['then'](function(){return db[_0x1c36('0x30')][_0x1c36('0x4f')]({'where':{'id':_0x298b01[_0x1c36('0x48')]['id']},'include':[{'model':db[_0x1c36('0x8b')],'as':_0x1c36('0x8c'),'include':[{'model':db[_0x1c36('0x8d')],'as':_0x1c36('0x8e'),'where':_0x445590,'limit':0x1,'order':[[_0x1c36('0x84'),_0x1c36('0x8f')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x725653,null))[_0x1c36('0x13')](function(_0x1aa74e){if(_0x1aa74e&&_0x1aa74e[_0x1c36('0x8c')]){_0x454694[_0x1c36('0x90')]=_0x1aa74e;_0x454694[_0x1c36('0x91')]=_0x1aa74e[_0x1c36('0x92')];_0x454694[_0x1c36('0x93')]=_0x1aa74e['List'];_0x454694['applications']=_[_0x1c36('0x94')](_0x454694[_0x1c36('0x91')],['priority'],[_0x1c36('0x95')]);if(_0x454694[_0x1c36('0x90')][_0x1c36('0x92')]){delete _0x454694[_0x1c36('0x90')][_0x1c36('0x92')];}if(_0x454694[_0x1c36('0x90')]['List']&&_0x454694[_0x1c36('0x90')]['List'][_0x1c36('0x8e')][_0x1c36('0x4a')]){return _0x454694[_0x1c36('0x90')][_0x1c36('0x8c')][_0x1c36('0x8e')][0x0];}var _0x429fd0=_[_0x1c36('0x96')](_0x298b01['body'],{'firstName':_0x298b01['body']['from'],'ListId':_0x1aa74e['ListId']});_0x429fd0[_0x298b01[_0x1c36('0x53')][_0x1c36('0x8a')]]=_0x298b01['body']['from'];return db[_0x1c36('0x8d')]['create'](_0x429fd0,{'fields':_0x27040b,'raw':!![]});}})[_0x1c36('0x13')](handleEntityNotFound(_0x725653,null))[_0x1c36('0x13')](function(_0x413c48){_0x454694[_0x1c36('0x97')]=_0x413c48;var _0x45d6d5=_0x298b01['body']['customerIp'];if(_0x298b01[_0x1c36('0x98')][_0x1c36('0x99')]){_0x45d6d5=_0x298b01['headers'][_0x1c36('0x99')];}else if(_0x298b01[_0x1c36('0x98')][_0x1c36('0x9a')]){_0x45d6d5=_['first'](_0x298b01['headers'][_0x1c36('0x9a')]['split'](','));}if(_0x413c48){var _0x22965d={'ContactId':_0x413c48['id'],'ChatWebsiteId':_0x298b01[_0x1c36('0x48')]['id'],'from':(_0x413c48[_0x1c36('0x9b')]||'')+'\x20'+(_0x413c48[_0x1c36('0x9c')]||''),'customerIp':_0x45d6d5,'customerPort':_0x298b01['headers']['x-real-port']?_0x298b01['headers'][_0x1c36('0x9d')]:null,'referer':_0x298b01['body'][_0x1c36('0x9e')],'browserName':_0x5c455b[_0x1c36('0x9f')][_0x1c36('0x2b')]&&_0x5c455b[_0x1c36('0x9f')][_0x1c36('0xa0')]?util['format'](_0x1c36('0xa1'),_0x5c455b[_0x1c36('0x9f')][_0x1c36('0x2b')],_0x5c455b['browser'][_0x1c36('0xa0')]):'unknown','browserVersion':_0x5c455b['browser']['version']||_0x1c36('0xa2'),'osName':util['format']('%s\x20%s',_0x5c455b['os']['name'],_0x5c455b['os'][_0x1c36('0xa0')]),'osVersion':_0x5c455b['os'][_0x1c36('0xa0')],'deviceModel':_0x5c455b['device'][_0x1c36('0x33')]&&_0x5c455b[_0x1c36('0xa3')]['vendor']?util[_0x1c36('0xa4')](_0x1c36('0xa5'),_0x5c455b[_0x1c36('0xa3')]['model'],_0x5c455b[_0x1c36('0xa3')][_0x1c36('0xa6')],_0x5c455b['device']['type']):null,'deviceVendor':_0x5c455b[_0x1c36('0xa3')][_0x1c36('0xa6')],'deviceType':_0x5c455b[_0x1c36('0xa3')][_0x1c36('0x32')],'formData':JSON[_0x1c36('0x18')](_0x298b01['body'])};var _0x1e11d1={'ChatWebsiteId':_0x298b01['params']['id'],'closed':![]};if(_0x298b01['body']['threadId']){_0x1e11d1['threadId']=_0x298b01['body'][_0x1c36('0xa7')];return db[_0x1c36('0xa8')]['find']({'where':_0x1e11d1})['then'](function(_0x1194e7){if(_0x1194e7){return[_0x1194e7,![]];}_0x22965d[_0x1c36('0xa7')]=_0x298b01['body']['threadId'];_0x22965d[_0x1c36('0xa9')]=_0x298b01['body'][_0x1c36('0xa9')];return db[_0x1c36('0xa8')][_0x1c36('0x4b')](_0x22965d)[_0x1c36('0x13')](function(_0x465645){return[_0x465645,!![]];});});}_0x1e11d1[_0x1c36('0xaa')]=_0x413c48['id'];if(_0x298b01['body'][_0x1c36('0xab')]&&_0x298b01[_0x1c36('0x53')][_0x1c36('0xab')]['id']){_0x1e11d1['id']=_0x298b01['body'][_0x1c36('0xab')]['id'];return db[_0x1c36('0xa8')][_0x1c36('0x4f')]({'where':_0x1e11d1})[_0x1c36('0x13')](function(_0xe60a77){if(_0xe60a77){return[_0xe60a77,![]];}return db[_0x1c36('0xa8')][_0x1c36('0x4b')](_0x22965d)[_0x1c36('0x13')](function(_0x2b43cb){return[_0x2b43cb,!![]];});});}return db[_0x1c36('0xa8')]['create'](_0x22965d)['then'](function(_0x263090){return[_0x263090,!![]];});}})['spread'](function(_0x58697d,_0x5b46b8){if(_0x58697d){_0x1a6fda=_0x5b46b8;if(!_0x5b46b8){var _0x388ca4={'from':(_0x454694[_0x1c36('0x97')][_0x1c36('0x9b')]||'')+'\x20'+(_0x454694[_0x1c36('0x97')]['lastName']||'')};if(_0x298b01[_0x1c36('0x53')][_0x1c36('0xa7')]&&_0x298b01[_0x1c36('0x53')]['messageId']&&_0x298b01[_0x1c36('0x53')]['threadId']!=_0x298b01[_0x1c36('0x53')]['messageId']){_0x388ca4[_0x1c36('0xa7')]=_0x298b01[_0x1c36('0x53')]['messageId'];}return _0x58697d[_0x1c36('0x25')](_0x388ca4);}else{return _0x58697d;}}})[_0x1c36('0x13')](function(_0x22153c){_0x454694['interaction']=_0x22153c['get']({'plain':!![]});_0x454694['interaction'][_0x1c36('0xac')]=_0x1a6fda;if(_0x454694[_0x1c36('0xab')][_0x1c36('0xac')]){if(_0x454694[_0x1c36('0x90')][_0x1c36('0xad')]){_0x454694['applications'][_0x1c36('0xae')]({'id':0x0,'priority':_0x454694['applications'][_0x1c36('0x4a')]+0x1,'app':'close','appdata':_0x1c36('0xaf'),'interval':_0x1c36('0xb0')});}}return db[_0x1c36('0xb1')][_0x1c36('0x4b')]({'body':_0x298b01['body'][_0x1c36('0x53')],'ChatWebsiteId':_0x298b01[_0x1c36('0x48')]['id'],'ChatInteractionId':_0x22153c['id'],'direction':'in','ContactId':_0x454694[_0x1c36('0x97')]['id'],'AttachmentId':_0x298b01[_0x1c36('0x53')]['AttachmentId']});})['then'](function(_0x4b952a){_0x454694['message']=_0x4b952a;if(_0x454694[_0x1c36('0xab')][_0x1c36('0xb2')]){return db[_0x1c36('0xb3')]['find']({'attributes':['id',_0x1c36('0x2b')],'where':{'id':_0x454694[_0x1c36('0xab')]['UserId']}})[_0x1c36('0x13')](function(_0x252147){if(_0x252147){_0x454694[_0x1c36('0x91')][_0x1c36('0xb4')]({'id':0x0,'priority':0x0,'app':_0x1c36('0xb5'),'appdata':_0x252147[_0x1c36('0x2b')]+','+(_0x454694[_0x1c36('0x90')]['waitForTheAssignedAgent']||0xa),'interval':_0x1c36('0xb0')});_0x454694[_0x1c36('0xb6')]=!![];}return respondWithRpcPromise(_0x1c36('0xb7'),_0x1c36('0xb8'),_0x454694);});}return respondWithRpcPromise(_0x1c36('0xb7'),_0x1c36('0xb8'),_0x454694);})['then'](function(_0x3367c4){respondWithRpcPromise(_0x1c36('0xb9'),_0x1c36('0xb9'),{'event':_0x1c36('0xba'),'message':_0x3367c4},client9002);return _0x3367c4;})[_0x1c36('0x13')](respondWithResult(_0x725653,null))[_0x1c36('0x46')](handleError(_0x725653,null));};exports[_0x1c36('0xbb')]=function(_0x225187,_0x43a37b){var _0x473703,_0x375539,_0x32395b;var _0x480ffd=[];var _0x8088b1={};var _0x13ad37=_0x225187[_0x1c36('0xbc')]||[];var _0x3c19bc=[];var _0x2277f5;return db[_0x1c36('0x8d')][_0x1c36('0x54')]()[_0x1c36('0x13')](function(_0x2ee0d0){if(!_0x2ee0d0){throw new db['Sequelize'][(_0x1c36('0x80'))](_0x1c36('0x81'));}_0x480ffd=_['difference'](_[_0x1c36('0x35')](_0x2ee0d0),['createdAt',_0x1c36('0x84'),_0x1c36('0xbd'),_0x1c36('0x85')]);if(_0x225187[_0x1c36('0x53')]['id']){delete _0x225187[_0x1c36('0x53')]['id'];}if(_['isNil'](_0x225187[_0x1c36('0x53')][_0x1c36('0xbe')])){throw _0x43a37b[_0x1c36('0x1d')](0x1f4)[_0x1c36('0xbf')](new db[(_0x1c36('0x7f'))][(_0x1c36('0x80'))](_0x1c36('0x86')));}if(_[_0x1c36('0x6c')](_0x225187[_0x1c36('0x53')][_0x1c36('0x53')])||_0x225187[_0x1c36('0x53')][_0x1c36('0x53')]===''){throw _0x43a37b[_0x1c36('0x1d')](0x1f4)[_0x1c36('0xbf')](new db[(_0x1c36('0x7f'))]['ValidationError'](_0x1c36('0x87')));}if(_[_0x1c36('0x6c')](_0x225187['body'][_0x1c36('0xc0')])){throw _0x43a37b[_0x1c36('0x1d')](0x1f4)[_0x1c36('0xbf')](new db['Sequelize'][(_0x1c36('0x80'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x480ffd));}if(!_[_0x1c36('0xc1')](_0x480ffd,_0x225187[_0x1c36('0x53')][_0x1c36('0xc0')])){throw _0x43a37b[_0x1c36('0x1d')](0x1f4)['send'](new db[(_0x1c36('0x7f'))][(_0x1c36('0x80'))](_0x1c36('0xc2')+_0x480ffd));}_0x8088b1[_0x225187[_0x1c36('0x53')][_0x1c36('0xc0')]]=_0x225187[_0x1c36('0x53')][_0x1c36('0xbe')];})['then'](function(){return db[_0x1c36('0x30')][_0x1c36('0x4f')]({'where':{'id':_0x225187[_0x1c36('0x48')]['id']},'include':[{'model':db[_0x1c36('0x8b')],'as':_0x1c36('0x8c')},{'model':db[_0x1c36('0xc3')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x43a37b,null))[_0x1c36('0x13')](function(_0x2beb20){if(_0x2beb20&&_0x2beb20[_0x1c36('0x8c')]){_0x375539=_0x2beb20;var _0x4bfc48=_[_0x1c36('0x96')](_0x225187['body'],{'firstName':_0x225187['body'][_0x1c36('0xbe')],'phone':_0x225187[_0x1c36('0x53')]['from'],'ListId':_0x2beb20[_0x1c36('0x85')]});_0x4bfc48[_0x225187[_0x1c36('0x53')]['mapKeyOffline']]=_0x225187['body']['from'];return db[_0x1c36('0x8d')][_0x1c36('0xc4')]({'where':_0x8088b1,'defaults':_0x4bfc48});}})[_0x1c36('0xc5')](function(_0x2c8a99){if(_0x2c8a99){_0x32395b=_0x2c8a99;var _0x52f1d6=fs[_0x1c36('0xc6')](path['join'](config[_0x1c36('0x6e')],_0x1c36('0xc7')),_0x1c36('0xc8'));var _0x2c8a8b=ejs['render'](_0x52f1d6,{'body':_[_0x1c36('0xc9')](_0x225187[_0x1c36('0x53')][_0x1c36('0x53')]),'bodyTitle':_0x375539[_0x1c36('0xca')]});return db['ChatOfflineMessage'][_0x1c36('0x4b')]({'body':_0x2c8a8b,'plainBody':htmlToText[_0x1c36('0xcb')](_0x2c8a8b),'ContactId':_0x2c8a99['id'],'ChatWebsiteId':_0x375539['id']});}})['then'](function(_0x559d09){_0x2277f5=_0x559d09;if(_0x13ad37[_0x1c36('0x4a')]){var _0xf3b74b=_0x13ad37[_0x1c36('0x2f')](function(_0x9ccf41){return{'name':_0x9ccf41[_0x1c36('0xcc')],'basename':_0x9ccf41[_0x1c36('0x64')],'type':_0x9ccf41[_0x1c36('0xcd')],'ChatOfflineMessageId':_0x559d09['id']};});_0x3c19bc=_0xf3b74b[_0x1c36('0x2f')](_0x1840dc=>{var _0x4a424e={'filename':_0x1840dc[_0x1c36('0x2b')],'path':path['join'](config['root'],_0x1c36('0xce'),_0x1c36('0xbc'),_0x1c36('0xcf'),'offline-chat',_0x1840dc[_0x1c36('0xd0')])};return _0x4a424e;});if(!_0x375539[_0x1c36('0xd1')]){return db[_0x1c36('0xd2')]['transaction'](function(_0x278871){return db[_0x1c36('0xd3')][_0x1c36('0xd4')](_0xf3b74b,{'transaction':_0x278871});});}}})[_0x1c36('0x13')](function(){if(_0x2277f5){_0x473703=_0x2277f5;return db[_0x1c36('0xc3')][_0x1c36('0x5d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1c36('0xd5'),'raw':!![],'include':[{'model':db[_0x1c36('0xd6')],'as':_0x1c36('0xd6'),'raw':!![]}]}]});}})[_0x1c36('0x13')](function(_0x4175e3){if(_0x4175e3&&_0x4175e3[_0x1c36('0xd5')]&&_0x375539[_0x1c36('0xd7')]&&_0x375539[_0x1c36('0xd8')]){var _0x385619=_0x4175e3[_0x1c36('0xd9')]();return respondWithRpcPromise(_0x1c36('0xda'),_0x1c36('0xdb'),{'account':_0x385619,'message':{'from':util[_0x1c36('0xa4')]('\x22%s\x22\x20<%s>',_0x4175e3[_0x1c36('0x2b')],_0x4175e3[_0x1c36('0xdc')]||_0x4175e3[_0x1c36('0xd5')][_0x1c36('0x4c')]),'to':_0x375539[_0x1c36('0xd8')],'subject':_0x375539['offlineMessageSubject'],'html':_0x473703[_0x1c36('0x53')],'attachments':_0x3c19bc}},client9003)[_0x1c36('0x13')](function(){return _0x473703;})[_0x1c36('0x46')](function(_0x1fdbb3){logger['error'](_0x1fdbb3);});}})['then'](function(){if(_0x375539&&_0x375539[_0x1c36('0xd1')]&&_0x375539['MailAccountId']){var _0x3b8de4=[];if(_0x13ad37[_0x1c36('0x4a')]){_0x3b8de4=_0x13ad37['map'](function(_0x2a16b6){return{'name':_0x2a16b6['originalname'],'basename':_0x2a16b6[_0x1c36('0x64')],'type':_0x2a16b6[_0x1c36('0xcd')],'ChatOfflineMessageId':_0x2277f5['id']};});}var _0x3d6adb;if(!_[_0x1c36('0x6c')](_0x375539[_0x1c36('0xdd')])){var _0x2ed06c=_[_0x1c36('0x2f')](_0x225187[_0x1c36('0x53')],function(_0x28599b){return _0x28599b;});var _0x141676=_[_0x1c36('0xde')](_0x2ed06c)[0x0];var _0x291011=_[_0x1c36('0xdf')](_0x141676,function(_0x420d9b){return _0x420d9b;});_0x3d6adb=_0x291011[0x1][_0x375539['subjectOffline']];}var _0x1863aa={'from':_0x32395b[_0x1c36('0xdc')],'firstName':_0x32395b[_0x1c36('0x9b')],'lastName':_0x32395b[_0x1c36('0x9c')],'mapKey':'email','message':{'from':_0x32395b[_0x1c36('0xdc')],'to':_0x375539[_0x1c36('0xc3')][_0x1c36('0xdc')],'cc':'','subject':_[_0x1c36('0x6c')](_0x3d6adb)?_0x375539[_0x1c36('0xe0')]:_0x3d6adb,'messageId':'','sentAt':new Date(),'attach':_0x3b8de4[_0x1c36('0x4a')],'attachments':_0x3b8de4,'originChannel':'Chat','ChatWebsiteId':_0x375539['id'],'ChatOfflineMessageId':_0x473703['id'],'originTo':_0x375539[_0x1c36('0xc3')][_0x1c36('0xdc')]},'body':_0x473703[_0x1c36('0x53')]};var _0x468abe={'account':{'id':_0x375539[_0x1c36('0xe1')]},'body':_0x1863aa,'log':_0x1c36('0xe2')};return respondWithRpcPromise(_0x1c36('0xe2'),_0x1c36('0xe3'),_0x468abe,client9001)[_0x1c36('0x13')](function(){return _0x473703;})[_0x1c36('0x46')](function(_0x30ea01){logger[_0x1c36('0x19')](_0x30ea01);});}return;})[_0x1c36('0x13')](function(){if(_0x473703){return _0x473703;}})[_0x1c36('0x13')](respondWithResult(_0x43a37b,null))[_0x1c36('0x46')](function(_0x1ba163){logger[_0x1c36('0x19')](_0x1c36('0x46'),_0x1ba163);for(var _0x58d189 of _0x13ad37){var _0x4c9738=path[_0x1c36('0x68')](config[_0x1c36('0x6e')],_0x1c36('0xce'),_0x1c36('0xbc'),'attachments',_0x1c36('0xe4'),_0x58d189[_0x1c36('0x64')]);fs_extra['remove'](_0x4c9738)[_0x1c36('0x46')](function(_0xe11d2c){logger['error'](_0x1c36('0xe5'),_0x4c9738,_0xe11d2c);});}});};exports[_0x1c36('0xe6')]=function(_0x562005,_0x46aa97){return db[_0x1c36('0xa8')][_0x1c36('0x4f')]({'where':{'id':_0x562005[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x46aa97,null))[_0x1c36('0x13')](function(_0x514866){if(_0x514866){return _0x514866[_0x1c36('0xe6')](_0x562005['body'][_0x1c36('0x5a')],_[_0x1c36('0xe7')](_0x562005[_0x1c36('0x53')],[_0x1c36('0x5a'),'id'])||{});}})[_0x1c36('0x13')](respondWithResult(_0x46aa97,null))[_0x1c36('0x46')](handleError(_0x46aa97,null));};exports[_0x1c36('0xe8')]=function(_0x4638d5,_0x46b4ca){var _0x5a565f={'raw':![],'where':{}};var _0x18727a={};var _0x2c9cef={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1c36('0x5d')]({'where':{'id':_0x4638d5['params']['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x46b4ca,null))[_0x1c36('0x13')](function(_0x5d0bb5){if(_0x5d0bb5){_0x18727a[_0x1c36('0x33')]=_[_0x1c36('0x35')](db[_0x1c36('0xa8')]['rawAttributes']);_0x18727a['query']=_[_0x1c36('0x35')](_0x4638d5[_0x1c36('0x34')]);_0x18727a[_0x1c36('0x3d')]=_[_0x1c36('0x36')](_0x18727a[_0x1c36('0x33')],_0x18727a['query']);_0x5a565f['attributes']=_[_0x1c36('0x36')](_0x18727a[_0x1c36('0x33')],qs[_0x1c36('0x38')](_0x4638d5[_0x1c36('0x34')]['fields']));_0x5a565f['attributes']=_0x5a565f[_0x1c36('0x37')][_0x1c36('0x4a')]?_0x5a565f['attributes']:_0x18727a[_0x1c36('0x33')];if(!_0x4638d5[_0x1c36('0x34')][_0x1c36('0x39')](_0x1c36('0x57'))){_0x5a565f[_0x1c36('0x23')]=qs['limit'](_0x4638d5[_0x1c36('0x34')][_0x1c36('0x23')]);_0x5a565f[_0x1c36('0x20')]=qs[_0x1c36('0x20')](_0x4638d5['query'][_0x1c36('0x20')]);}_0x5a565f[_0x1c36('0x3a')]=qs['sort'](_0x4638d5[_0x1c36('0x34')][_0x1c36('0x3b')]);_0x5a565f[_0x1c36('0x3c')]=qs[_0x1c36('0x3d')](_[_0x1c36('0x58')](_0x4638d5[_0x1c36('0x34')],_0x18727a['filters']));_0x5a565f['where'][_0x1c36('0x5f')]=_0x5d0bb5['id'];if(_0x4638d5['query'][_0x1c36('0x3e')]){_0x5a565f[_0x1c36('0x3c')]=_[_0x1c36('0x3f')](_0x5a565f['where'],{'$or':_[_0x1c36('0x2f')](_0x5a565f[_0x1c36('0x37')],function(_0x4902d2){var _0x462b22={};_0x462b22[_0x4902d2]={'$like':'%'+_0x4638d5[_0x1c36('0x34')]['filter']+'%'};return _0x462b22;})});}_0x5a565f=_['merge']({},_0x5a565f,_0x4638d5[_0x1c36('0x41')]);return db[_0x1c36('0xa8')]['count']({'where':_0x5a565f[_0x1c36('0x3c')]})[_0x1c36('0x13')](function(_0x57f9a8){_0x2c9cef['count']=_0x57f9a8;if(_0x4638d5[_0x1c36('0x34')][_0x1c36('0x42')]){_0x5a565f['include']=[{'model':db['CmContact'],'as':_0x1c36('0xe9'),'required':![]},{'model':db[_0x1c36('0xb3')],'as':_0x1c36('0xea'),'attributes':[_0x1c36('0x2b'),_0x1c36('0xeb'),_0x1c36('0xec')],'required':![]},{'model':db['Tag'],'as':_0x1c36('0xed'),'attributes':['id',_0x1c36('0x2b'),'color'],'where':_0x4638d5[_0x1c36('0x34')][_0x1c36('0xee')]?{'id':_0x4638d5[_0x1c36('0x34')][_0x1c36('0xee')]}:undefined,'required':_0x4638d5['query'][_0x1c36('0xee')]?!![]:![]}];}return db['ChatInteraction'][_0x1c36('0x44')](_0x5a565f);})[_0x1c36('0x13')](function(_0xee8d04){_0x2c9cef[_0x1c36('0x45')]=_0xee8d04;return _0x2c9cef;});}})[_0x1c36('0x13')](respondWithFilteredResult(_0x46b4ca,_0x5a565f))[_0x1c36('0x46')](handleError(_0x46b4ca,null));};function iftimePromise(_0x12507f,_0x17ed1f){return respondWithRpcPromise('Command',_0x1c36('0xef'),{'command':_0x17ed1f[_0x1c36('0xf0')]?util['format'](_0x1c36('0xf1'),_0x12507f[_0x1c36('0xf2')],_0x17ed1f[_0x1c36('0xf0')]):util['format'](_0x1c36('0xf3'),_0x12507f[_0x1c36('0xf2')])},client9002)[_0x1c36('0x13')](function(_0x5da7e6){var _0x420eca=_0x5da7e6&&_0x5da7e6['indexOf'](_0x1c36('0xf4'))>=0x0?!![]:![];logger[_0x1c36('0x14')](_0x1c36('0xf5'),_0x17ed1f['id'],_0x12507f['id'],_0x12507f[_0x1c36('0xf2')],_0x420eca?_0x1c36('0xf6'):_0x1c36('0xf7'),_0x17ed1f[_0x1c36('0xf0')]?_0x17ed1f[_0x1c36('0xf0')]:'No\x20timezone');return _0x420eca;})['catch'](function(_0x505fa2){logger[_0x1c36('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x17ed1f['id'],_0x12507f['id'],_0x12507f[_0x1c36('0xf2')],util[_0x1c36('0xf8')](_0x505fa2,{'showHidden':![],'depth':null}),_0x17ed1f[_0x1c36('0xf0')]?_0x17ed1f[_0x1c36('0xf0')]:_0x1c36('0xf9'));return![];});}exports[_0x1c36('0xef')]=function(_0x47812a,_0x29124c){var _0x83a7b1=0x0;var _0x5e2a63=0x0;var _0x297cdc=![];var _0x4a0bd3;var _0x2c198c;return db[_0x1c36('0x30')]['find']({'where':{'id':_0x47812a[_0x1c36('0x48')]['id']},'include':[{'model':db[_0x1c36('0xfa')],'as':_0x1c36('0xfa'),'include':[{'model':db[_0x1c36('0xfa')],'as':_0x1c36('0xfb'),'attributes':['id',_0x1c36('0xf2')],'raw':!![]}]}]})[_0x1c36('0x13')](handleEntityNotFound(_0x29124c,null))['then'](function(_0x5c38d1){if(_0x5c38d1){_0x4a0bd3=_0x5c38d1;return _0x5c38d1[_0x1c36('0xfc')]({'raw':!![]});}})[_0x1c36('0x13')](function(_0x2b8235){if(_0x4a0bd3){if(_0x2b8235){_0x2c198c=_0x2b8235;}}return require(_0x1c36('0x69'))[_0x1c36('0x6a')]();})[_0x1c36('0x13')](function(_0x269049){if(_0x269049){_0x5e2a63=_0x269049[_0x1c36('0xfd')];_0x297cdc=_0x269049[_0x1c36('0x6b')];}})[_0x1c36('0x13')](function(){return db[_0x1c36('0xa8')][_0x1c36('0x22')]({'where':{'closed':![]}});})[_0x1c36('0x13')](function(_0x54ee36){_0x83a7b1=_0x54ee36;if(_0x5e2a63&&_0x54ee36>_0x5e2a63){return db[_0x1c36('0xfe')][_0x1c36('0x5d')]({'where':{'id':0x1}})[_0x1c36('0x13')](function(_0x4a1209){if(_0x4a1209){_0x4a1209[_0x1c36('0xff')](_0x1c36('0x100'));}});}})[_0x1c36('0x13')](function(){if(_0x4a0bd3['Interval']&&_0x4a0bd3[_0x1c36('0xfa')][_0x1c36('0xfb')]){var _0x51414d=[];for(var _0x436b58=0x0;_0x436b58<_0x4a0bd3[_0x1c36('0xfa')][_0x1c36('0xfb')][_0x1c36('0x4a')];_0x436b58++){var _0x57c482=_0x4a0bd3[_0x1c36('0xfa')][_0x1c36('0xfb')][_0x436b58]['get']({'plain':!![]});_0x51414d[_0x1c36('0xae')](iftimePromise(_0x57c482,_0x4a0bd3));}return BPromise['all'](_0x51414d)[_0x1c36('0x13')](function(_0x8d8e09){return _['some'](_0x8d8e09);});}else{return!![];}})[_0x1c36('0x13')](function(_0x175a20){var _0x59b29f=fs['readFileSync'](path[_0x1c36('0x68')](config['root'],'server/files/chat/iframe.ejs'),_0x1c36('0xc8'));var _0xf45287={'remote':_0x4a0bd3[_0x1c36('0x101')],'query':querystring[_0x1c36('0x18')](_[_0x1c36('0x3f')](_0x4a0bd3[_0x1c36('0x27')]({'plain':!![]}),{'customerIp':_0x47812a['headers'][_0x1c36('0x9a')]||_0x47812a[_0x1c36('0x98')][_0x1c36('0x102')]||_0x47812a[_0x1c36('0x103')]['remoteAddress']||_0x47812a['ip'],'referer':_0x47812a['headers']['referer'],'openedInteractions':_0x83a7b1,'maxInteractions':_0x5e2a63,'virtual':_0x297cdc['virtual'],'online':_0x175a20,'custom':_0x297cdc}))[_0x1c36('0x104')](/'/g,'\x5c\x27')};_0x29124c[_0x1c36('0xbf')](ejs[_0x1c36('0x105')](Mustache[_0x1c36('0x105')](_0x59b29f,_0xf45287),{'proactiveActions':_0x2c198c,'alignment':_0x4a0bd3[_0x1c36('0x106')],'verticalAlignment':_0x4a0bd3[_0x1c36('0x107')],'div_color':_0x4a0bd3[_0x1c36('0x108')],'labelText':_0x4a0bd3[_0x1c36('0x109')],'text_color':_0x4a0bd3[_0x1c36('0x10a')],'text_button_color':_0x4a0bd3['textButtonColor'],'button_color':_0x4a0bd3['color_button'],'background_color':_0x4a0bd3[_0x1c36('0x10b')],'hideWhenOffline':_0x4a0bd3[_0x1c36('0x10c')],'interval':_0x4a0bd3[_0x1c36('0x10d')]}));})[_0x1c36('0x46')](handleError(_0x29124c,null));};exports[_0x1c36('0x10e')]=function(_0x1249ee,_0x197c45){var _0x5bf9b6=_0x1249ee[_0x1c36('0x48')]['id'];var _0x1d065d=_0x1249ee[_0x1c36('0x53')];var _0x2cec1e=0xc8;var _0x1ca657=null;return db[_0x1c36('0xd2')][_0x1c36('0x10f')]({'isolationLevel':db[_0x1c36('0xd2')][_0x1c36('0x110')][_0x1c36('0x111')][_0x1c36('0x112')]},function(_0x522f6d){return db[_0x1c36('0x30')][_0x1c36('0x5d')]({'where':{'id':_0x5bf9b6},'transaction':_0x522f6d})[_0x1c36('0x13')](function(_0x53b4af){if(_0x53b4af){return db[_0x1c36('0x113')]['destroy']({'where':{'ChatWebsiteId':_0x5bf9b6},'transaction':_0x522f6d})[_0x1c36('0x13')](function(){var _0x350d88=_['map'](_0x1d065d,function(_0x58a8ab){_0x58a8ab[_0x1c36('0x5f')]=_0x5bf9b6;return _0x58a8ab;});return db['ChatApplication'][_0x1c36('0xd4')](_0x350d88,{'transaction':_0x522f6d});});}else{_0x2cec1e=0x194;_0x1ca657=[];}});})[_0x1c36('0x13')](function(){if(_0x2cec1e!==0x194){return db[_0x1c36('0x113')][_0x1c36('0x114')]({'where':{'ChatWebsiteId':_0x5bf9b6},'order':_0x1c36('0x115')})[_0x1c36('0x13')](function(_0x4672b4){_0x1ca657=_0x4672b4;});}})[_0x1c36('0x46')](function(_0xc741cf){_0x2cec1e=0x1f4;logger['error'](_0xc741cf[_0x1c36('0x116')]);if(_0xc741cf[_0x1c36('0x2b')]){delete _0xc741cf[_0x1c36('0x2b')];}_0x1ca657=_0xc741cf;})[_0x1c36('0x117')](function(){if(_0x1ca657===null){_0x197c45[_0x1c36('0x2a')](_0x2cec1e);}else{if(_0x2cec1e===0x1f4){_0x197c45['status'](_0x2cec1e)[_0x1c36('0xbf')](_0x1ca657);}else{_0x197c45['status'](_0x2cec1e)['json'](_0x1ca657);}}});};exports[_0x1c36('0x118')]=function(_0x5d0178,_0x19aa2c){var _0x5c3cf7={};var _0x3e0773={};var _0x25a243;var _0xb6fac;return db[_0x1c36('0x30')][_0x1c36('0x5d')]({'where':{'id':_0x5d0178[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x19aa2c,null))[_0x1c36('0x13')](function(_0x1e7f54){if(_0x1e7f54){_0x25a243=_0x1e7f54;_0x3e0773[_0x1c36('0x33')]=_['keys'](db[_0x1c36('0x113')][_0x1c36('0x49')]);_0x3e0773[_0x1c36('0x34')]=_[_0x1c36('0x35')](_0x5d0178[_0x1c36('0x34')]);_0x3e0773['filters']=_[_0x1c36('0x36')](_0x3e0773[_0x1c36('0x33')],_0x3e0773[_0x1c36('0x34')]);_0x5c3cf7[_0x1c36('0x37')]=_[_0x1c36('0x36')](_0x3e0773[_0x1c36('0x33')],qs[_0x1c36('0x38')](_0x5d0178[_0x1c36('0x34')][_0x1c36('0x38')]));_0x5c3cf7[_0x1c36('0x37')]=_0x5c3cf7['attributes'][_0x1c36('0x4a')]?_0x5c3cf7[_0x1c36('0x37')]:_0x3e0773[_0x1c36('0x33')];_0x5c3cf7['order']=qs[_0x1c36('0x3b')](_0x5d0178[_0x1c36('0x34')][_0x1c36('0x3b')]);_0x5c3cf7[_0x1c36('0x3c')]=qs[_0x1c36('0x3d')](_[_0x1c36('0x58')](_0x5d0178[_0x1c36('0x34')],_0x3e0773[_0x1c36('0x3d')]));if(_0x5d0178[_0x1c36('0x34')][_0x1c36('0x3e')]){_0x5c3cf7[_0x1c36('0x3c')]=_[_0x1c36('0x3f')](_0x5c3cf7[_0x1c36('0x3c')],{'$or':_[_0x1c36('0x2f')](_0x5c3cf7[_0x1c36('0x37')],function(_0x89e89a){var _0x278e4a={};_0x278e4a[_0x89e89a]={'$like':'%'+_0x5d0178[_0x1c36('0x34')][_0x1c36('0x3e')]+'%'};return _0x278e4a;})});}_0x5c3cf7=_[_0x1c36('0x3f')]({},_0x5c3cf7,_0x5d0178[_0x1c36('0x41')]);return _0x25a243[_0x1c36('0x118')](_0x5c3cf7);}})['then'](function(_0x48e2c2){if(_0x48e2c2){_0xb6fac=_0x48e2c2['length'];if(!_0x5d0178[_0x1c36('0x34')][_0x1c36('0x39')](_0x1c36('0x57'))){_0x5c3cf7['limit']=qs[_0x1c36('0x23')](_0x5d0178['query'][_0x1c36('0x23')]);_0x5c3cf7[_0x1c36('0x20')]=qs[_0x1c36('0x20')](_0x5d0178['query'][_0x1c36('0x20')]);}return _0x25a243['getApplications'](_0x5c3cf7);}})[_0x1c36('0x13')](function(_0x5e9b66){if(_0x5e9b66){return _0x5e9b66?{'count':_0xb6fac,'rows':_0x5e9b66}:null;}})[_0x1c36('0x13')](respondWithResult(_0x19aa2c,null))[_0x1c36('0x46')](handleError(_0x19aa2c,null));};exports[_0x1c36('0x119')]=function(_0x33c0d5,_0x447a13){return db['chatProactiveAction']['find']({'where':{'id':_0x33c0d5[_0x1c36('0x48')]['id']}})['then'](handleEntityNotFound(_0x447a13,null))['then'](function(_0x2a3d3e){if(_0x2a3d3e){return _0x2a3d3e[_0x1c36('0x119')](_0x33c0d5[_0x1c36('0x53')]['ids'],_[_0x1c36('0xe7')](_0x33c0d5[_0x1c36('0x53')],[_0x1c36('0x5a'),'id'])||{});}})[_0x1c36('0x13')](respondWithResult(_0x447a13,null))[_0x1c36('0x46')](handleError(_0x447a13,null));};exports[_0x1c36('0xfc')]=function(_0x5c03dc,_0x470e3f){var _0x4b014e={};var _0x42afae={};var _0x57e902;var _0x349d08;return db[_0x1c36('0x30')][_0x1c36('0x5d')]({'where':{'id':_0x5c03dc[_0x1c36('0x48')]['id']}})['then'](handleEntityNotFound(_0x470e3f,null))['then'](function(_0x188590){if(_0x188590){_0x57e902=_0x188590;_0x42afae[_0x1c36('0x33')]=_[_0x1c36('0x35')](db[_0x1c36('0x11a')][_0x1c36('0x49')]);_0x42afae['query']=_[_0x1c36('0x35')](_0x5c03dc[_0x1c36('0x34')]);_0x42afae['filters']=_['intersection'](_0x42afae[_0x1c36('0x33')],_0x42afae[_0x1c36('0x34')]);_0x4b014e[_0x1c36('0x37')]=_['intersection'](_0x42afae[_0x1c36('0x33')],qs['fields'](_0x5c03dc[_0x1c36('0x34')][_0x1c36('0x38')]));_0x4b014e[_0x1c36('0x37')]=_0x4b014e[_0x1c36('0x37')][_0x1c36('0x4a')]?_0x4b014e[_0x1c36('0x37')]:_0x42afae[_0x1c36('0x33')];_0x4b014e['order']=qs[_0x1c36('0x3b')](_0x5c03dc['query']['sort']);_0x4b014e[_0x1c36('0x3c')]=qs[_0x1c36('0x3d')](_['pick'](_0x5c03dc[_0x1c36('0x34')],_0x42afae[_0x1c36('0x3d')]));if(_0x5c03dc[_0x1c36('0x34')]['filter']){_0x4b014e[_0x1c36('0x3c')]=_[_0x1c36('0x3f')](_0x4b014e[_0x1c36('0x3c')],{'$or':_['map'](_0x4b014e[_0x1c36('0x37')],function(_0x702246){var _0x322c40={};_0x322c40[_0x702246]={'$like':'%'+_0x5c03dc[_0x1c36('0x34')][_0x1c36('0x3e')]+'%'};return _0x322c40;})});}_0x4b014e=_[_0x1c36('0x3f')]({},_0x4b014e,_0x5c03dc[_0x1c36('0x41')]);return _0x57e902[_0x1c36('0xfc')](_0x4b014e);}})[_0x1c36('0x13')](function(_0x29c568){if(_0x29c568){_0x349d08=_0x29c568[_0x1c36('0x4a')];if(!_0x5c03dc['query'][_0x1c36('0x39')](_0x1c36('0x57'))){_0x4b014e['limit']=qs['limit'](_0x5c03dc[_0x1c36('0x34')][_0x1c36('0x23')]);_0x4b014e[_0x1c36('0x20')]=qs['offset'](_0x5c03dc[_0x1c36('0x34')][_0x1c36('0x20')]);}return _0x57e902[_0x1c36('0xfc')](_0x4b014e);}})['then'](function(_0x170d24){if(_0x170d24){return _0x170d24?{'count':_0x349d08,'rows':_0x170d24}:null;}})[_0x1c36('0x13')](respondWithResult(_0x470e3f,null))['catch'](handleError(_0x470e3f,null));};exports[_0x1c36('0x11b')]=function(_0x113286,_0x4a6244){var _0x583411=_0x113286['query']['online']===_0x1c36('0x11c')?_0x1c36('0x11d'):_0x1c36('0x11e');return db['ChatWebsite'][_0x1c36('0x4f')]({'attributes':['id',_0x583411],'where':{'id':_0x113286['params']['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x4a6244,null))[_0x1c36('0x13')](function(_0x31ac81){if(_0x31ac81){var _0x4a6dd5=_0x31ac81[_0x583411];var _0xccfb08=_0x4a6dd5&&_0x4a6dd5['items']?_0x4a6dd5[_0x1c36('0x11f')]:[];_0x4a6244[_0x1c36('0xbf')]({'fromKey':_[_0x1c36('0x6c')](_0x4a6dd5[_0x1c36('0x120')])?undefined:_0x4a6dd5[_0x1c36('0x120')],'count':_0xccfb08[_0x1c36('0x4a')],'rows':_0xccfb08});}})['catch'](handleError(_0x4a6244,null));};exports[_0x1c36('0x121')]=function(_0x1778a1,_0x280d89){var _0x426f17={'raw':![],'where':{}};var _0x507ddf={};var _0x2fff22={'count':0x0,'rows':[]};return db[_0x1c36('0x30')][_0x1c36('0x5d')]({'where':{'id':_0x1778a1[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x280d89,null))['then'](function(_0xff5a0b){if(_0xff5a0b){_0x507ddf[_0x1c36('0x33')]=_[_0x1c36('0x35')](db[_0x1c36('0x122')][_0x1c36('0x49')]);_0x507ddf[_0x1c36('0x34')]=_['keys'](_0x1778a1[_0x1c36('0x34')]);_0x507ddf[_0x1c36('0x3d')]=_['intersection'](_0x507ddf[_0x1c36('0x33')],_0x507ddf[_0x1c36('0x34')]);_0x426f17[_0x1c36('0x37')]=_['intersection'](_0x507ddf['model'],qs[_0x1c36('0x38')](_0x1778a1[_0x1c36('0x34')][_0x1c36('0x38')]));_0x426f17['attributes']=_0x426f17['attributes'][_0x1c36('0x4a')]?_0x426f17[_0x1c36('0x37')]:_0x507ddf[_0x1c36('0x33')];if(!_0x1778a1['query'][_0x1c36('0x39')](_0x1c36('0x57'))){_0x426f17[_0x1c36('0x23')]=qs[_0x1c36('0x23')](_0x1778a1[_0x1c36('0x34')]['limit']);_0x426f17[_0x1c36('0x20')]=qs['offset'](_0x1778a1[_0x1c36('0x34')][_0x1c36('0x20')]);}_0x426f17[_0x1c36('0x3a')]=qs['sort'](_0x1778a1[_0x1c36('0x34')]['sort']);_0x426f17[_0x1c36('0x3c')]=qs['filters'](_[_0x1c36('0x58')](_0x1778a1['query'],_0x507ddf['filters']));_0x426f17[_0x1c36('0x3c')][_0x1c36('0x5f')]=_0xff5a0b['id'];if(_0x1778a1[_0x1c36('0x34')][_0x1c36('0x3e')]){_0x426f17[_0x1c36('0x3c')]=_[_0x1c36('0x3f')](_0x426f17[_0x1c36('0x3c')],{'$or':_[_0x1c36('0x2f')](_0x426f17['attributes'],function(_0x28f1c4){var _0x5599f9={};_0x5599f9[_0x28f1c4]={'$like':'%'+_0x1778a1[_0x1c36('0x34')][_0x1c36('0x3e')]+'%'};return _0x5599f9;})});}_0x426f17=_[_0x1c36('0x3f')]({},_0x426f17,_0x1778a1['options']);return db[_0x1c36('0x122')]['count']({'where':_0x426f17[_0x1c36('0x3c')]})[_0x1c36('0x13')](function(_0x20f7cb){_0x2fff22[_0x1c36('0x22')]=_0x20f7cb;if(_0x1778a1[_0x1c36('0x34')][_0x1c36('0x42')]){_0x426f17[_0x1c36('0x43')]=[{'all':!![]}];}else{_0x426f17[_0x1c36('0x43')]=[{'model':db[_0x1c36('0x8d')],'as':_0x1c36('0xe9'),'required':![]},{'model':db['Attachment'],'as':_0x1c36('0x123'),'required':![]}];}return db[_0x1c36('0x122')][_0x1c36('0x44')](_0x426f17);})[_0x1c36('0x13')](function(_0x4430cf){_0x2fff22['rows']=_0x4430cf;return _0x2fff22;});}})[_0x1c36('0x13')](respondWithFilteredResult(_0x280d89,_0x426f17))[_0x1c36('0x46')](handleError(_0x280d89,null));};exports[_0x1c36('0x124')]=function(_0x53601d,_0x20cb63){return db[_0x1c36('0x30')]['find']({'where':{'id':_0x53601d['params']['id']}})['then'](handleEntityNotFound(_0x20cb63,null))[_0x1c36('0x13')](function(_0x228744){if(_0x228744){return _0x228744[_0x1c36('0x124')](_0x53601d['body']['ids'],_[_0x1c36('0xe7')](_0x53601d[_0x1c36('0x53')],[_0x1c36('0x5a'),'id'])||{})[_0x1c36('0xc5')](function(_0x4aac90){for(var _0x227997=0x0;_0x227997<_0x53601d[_0x1c36('0x53')]['ids']['length'];_0x227997+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x53601d[_0x1c36('0x53')][_0x1c36('0x5a')][_0x227997]),'ChatWebsiteId':Number(_0x53601d[_0x1c36('0x48')]['id'])});}return _0x4aac90;});}})[_0x1c36('0x13')](respondWithResult(_0x20cb63,null))[_0x1c36('0x46')](handleError(_0x20cb63,null));};exports[_0x1c36('0x125')]=function(_0x57fc3e,_0x3d3a2a){return db['ChatWebsite'][_0x1c36('0x4f')]({'where':{'id':_0x57fc3e['params']['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x3d3a2a,null))[_0x1c36('0x13')](function(_0x4d6921){if(_0x4d6921){return _0x4d6921[_0x1c36('0x125')](_0x57fc3e[_0x1c36('0x34')][_0x1c36('0x5a')])[_0x1c36('0x13')](function(){if(_[_0x1c36('0x126')](_0x57fc3e['query']['ids'])){for(var _0x555a68=0x0;_0x555a68<_0x57fc3e['query']['ids']['length'];_0x555a68+=0x1){socket[_0x1c36('0x127')](_0x1c36('0x128'),{'UserId':Number(_0x57fc3e[_0x1c36('0x34')][_0x1c36('0x5a')][_0x555a68]),'ChatWebsiteId':Number(_0x57fc3e[_0x1c36('0x48')]['id'])});}}else{socket['emit'](_0x1c36('0x128'),{'UserId':Number(_0x57fc3e[_0x1c36('0x34')]['ids']),'ChatWebsiteId':Number(_0x57fc3e[_0x1c36('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d3a2a,null))[_0x1c36('0x46')](handleError(_0x3d3a2a,null));};exports[_0x1c36('0x129')]=function(_0x56ff43,_0x279155){var _0x137914={};var _0x493ecd={};var _0x4e4d1b;var _0x1c581a;return db[_0x1c36('0x30')][_0x1c36('0x5d')]({'where':{'id':_0x56ff43[_0x1c36('0x48')]['id']}})[_0x1c36('0x13')](handleEntityNotFound(_0x279155,null))[_0x1c36('0x13')](function(_0x1112e8){if(_0x1112e8){_0x4e4d1b=_0x1112e8;_0x493ecd['model']=_[_0x1c36('0x35')](db['User'][_0x1c36('0x49')]);_0x493ecd[_0x1c36('0x34')]=_[_0x1c36('0x35')](_0x56ff43[_0x1c36('0x34')]);_0x493ecd[_0x1c36('0x3d')]=_[_0x1c36('0x36')](_0x493ecd[_0x1c36('0x33')],_0x493ecd[_0x1c36('0x34')]);_0x137914[_0x1c36('0x37')]=_['intersection'](_0x493ecd[_0x1c36('0x33')],qs['fields'](_0x56ff43[_0x1c36('0x34')][_0x1c36('0x38')]));_0x137914[_0x1c36('0x37')]=_0x137914[_0x1c36('0x37')][_0x1c36('0x4a')]?_0x137914[_0x1c36('0x37')]:_0x493ecd['model'];_0x137914[_0x1c36('0x3a')]=qs[_0x1c36('0x3b')](_0x56ff43[_0x1c36('0x34')][_0x1c36('0x3b')]);_0x137914[_0x1c36('0x3c')]=qs[_0x1c36('0x3d')](_[_0x1c36('0x58')](_0x56ff43['query'],_0x493ecd[_0x1c36('0x3d')]));if(_0x56ff43['query'][_0x1c36('0x3e')]){_0x137914[_0x1c36('0x3c')]=_['merge'](_0x137914[_0x1c36('0x3c')],{'$or':_['map'](_0x137914[_0x1c36('0x37')],function(_0x39527f){var _0x52bcd2={};_0x52bcd2[_0x39527f]={'$like':'%'+_0x56ff43[_0x1c36('0x34')][_0x1c36('0x3e')]+'%'};return _0x52bcd2;})});}_0x137914=_[_0x1c36('0x3f')]({},_0x137914,_0x56ff43[_0x1c36('0x41')]);return _0x4e4d1b[_0x1c36('0x129')](_0x137914);}})[_0x1c36('0x13')](function(_0x2a9a05){if(_0x2a9a05){_0x1c581a=_0x2a9a05[_0x1c36('0x4a')];if(!_0x56ff43['query'][_0x1c36('0x39')](_0x1c36('0x57'))){_0x137914[_0x1c36('0x23')]=qs[_0x1c36('0x23')](_0x56ff43[_0x1c36('0x34')][_0x1c36('0x23')]);_0x137914[_0x1c36('0x20')]=qs[_0x1c36('0x20')](_0x56ff43[_0x1c36('0x34')][_0x1c36('0x20')]);}return _0x4e4d1b[_0x1c36('0x129')](_0x137914);}})['then'](function(_0x335e79){if(_0x335e79){return _0x335e79?{'count':_0x1c581a,'rows':_0x335e79}:null;}})['then'](respondWithResult(_0x279155,null))[_0x1c36('0x46')](handleError(_0x279155,null));}; \ No newline at end of file +var _0x68ba=['ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','CannedAnswer','getAnswers','order','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','account','Applications','list','orderBy','applications','priority','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','fromString','originalname','mimetype','server','attachments','sequelize','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','ids','getInteractions','Contact','User','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','get'];(function(_0xf2f1a1,_0x40d89e){var _0x276d73=function(_0x4482e4){while(--_0x4482e4){_0xf2f1a1['push'](_0xf2f1a1['shift']());}};_0x276d73(++_0x40d89e);}(_0x68ba,0x100));var _0xa68b=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x68ba[_0x77773a];return _0x1091a2;};'use strict';var BPromise=require(_0xa68b('0x0'));var Mustache=require('mustache');var util=require(_0xa68b('0x1'));var path=require(_0xa68b('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa68b('0x3'));var _=require(_0xa68b('0x4'));var querystring=require(_0xa68b('0x5'));var Redis=require(_0xa68b('0x6'));var qs=require(_0xa68b('0x7'));var logger=require(_0xa68b('0x8'))(_0xa68b('0x9'));var config=require(_0xa68b('0xa'));var db=require(_0xa68b('0xb'))['db'];config[_0xa68b('0xc')]=_[_0xa68b('0xd')](config['redis'],{'host':_0xa68b('0xe'),'port':0x18eb});var socket=require(_0xa68b('0xf'))(new Redis(config[_0xa68b('0xc')]));require(_0xa68b('0x10'))[_0xa68b('0x11')](socket);var htmlToText=require(_0xa68b('0x12'));var jayson=require(_0xa68b('0x13'));var client=jayson[_0xa68b('0x14')][_0xa68b('0x15')]({'port':0x232c});var client9002=jayson['client'][_0xa68b('0x15')]({'port':0x232a});var client9003=jayson[_0xa68b('0x14')][_0xa68b('0x15')]({'port':0x232b});var client9001=jayson[_0xa68b('0x14')][_0xa68b('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x2309b8,_0x137252,_0x471906,_0x42e144){return new BPromise(function(_0x28afab,_0x18926d){var _0x8dbf89=_0x42e144||client;return _0x8dbf89[_0xa68b('0x16')](_0x2309b8,_0x471906)[_0xa68b('0x17')](function(_0x4cd271){logger[_0xa68b('0x18')](_0xa68b('0x19'),_0x137252,_0xa68b('0x1a'));logger[_0xa68b('0x1b')](_0xa68b('0x1c'),_0x137252,'request\x20sent',JSON[_0xa68b('0x1d')](_0x4cd271));if(_0x4cd271[_0xa68b('0x1e')]){if(_0x4cd271[_0xa68b('0x1e')][_0xa68b('0x1f')]===0x1f4){logger['error'](_0xa68b('0x19'),_0x137252,_0x4cd271[_0xa68b('0x1e')][_0xa68b('0x20')]);return _0x18926d(_0x4cd271[_0xa68b('0x1e')][_0xa68b('0x20')]);}logger[_0xa68b('0x1e')](_0xa68b('0x19'),_0x137252,_0x4cd271['error']['message']);return _0x28afab(_0x4cd271['error'][_0xa68b('0x20')]);}else{logger['info'](_0xa68b('0x19'),_0x137252,'request\x20sent');_0x28afab(_0x4cd271['result']['message']);}})['catch'](function(_0x56f4fb){logger['error'](_0xa68b('0x19'),_0x137252,_0x56f4fb);_0x18926d(_0x56f4fb);});});}function respondWithStatusCode(_0x4df31a,_0xadf4d){_0xadf4d=_0xadf4d||0xcc;return function(_0x216c0e){if(_0x216c0e){return _0x4df31a[_0xa68b('0x21')](_0xadf4d);}return _0x4df31a[_0xa68b('0x22')](_0xadf4d)[_0xa68b('0x23')]();};}function respondWithResult(_0x494cd0,_0x2fe297){_0x2fe297=_0x2fe297||0xc8;return function(_0x30d0b1){if(_0x30d0b1){return _0x494cd0[_0xa68b('0x22')](_0x2fe297)[_0xa68b('0x24')](_0x30d0b1);}};}function respondWithFilteredResult(_0xc2f26b,_0x3957e1){return function(_0x499c10){if(_0x499c10){var _0x408211=typeof _0x3957e1['offset']===_0xa68b('0x25')&&typeof _0x3957e1[_0xa68b('0x26')]===_0xa68b('0x25');var _0x13ecfa=_0x499c10[_0xa68b('0x27')];var _0x71f373=_0x408211?0x0:_0x3957e1[_0xa68b('0x28')];var _0x424364=_0x408211?_0x499c10[_0xa68b('0x27')]:_0x3957e1[_0xa68b('0x28')]+_0x3957e1['limit'];var _0x12531a;if(_0x424364>=_0x13ecfa){_0x424364=_0x13ecfa;_0x12531a=0xc8;}else{_0x12531a=0xce;}_0xc2f26b[_0xa68b('0x22')](_0x12531a);return _0xc2f26b[_0xa68b('0x29')]('Content-Range',_0x71f373+'-'+_0x424364+'/'+_0x13ecfa)[_0xa68b('0x24')](_0x499c10);}return null;};}function saveUpdates(_0x1159c0){return function(_0x1d2530){if(_0x1d2530){return _0x1d2530[_0xa68b('0x2a')](_0x1159c0)[_0xa68b('0x17')](function(_0x5e2cd8){return _0x5e2cd8;});}return null;};}function removeEntity(_0x161cad){return function(_0x26130d){if(_0x26130d){return _0x26130d[_0xa68b('0x2b')]()['then'](function(){var _0x557a0c=_0x26130d[_0xa68b('0x2c')]({'plain':!![]});var _0x2b817f=_0xa68b('0x2d');return db[_0xa68b('0x2e')][_0xa68b('0x2b')]({'where':{'type':_0x2b817f,'resourceId':_0x557a0c['id']}})[_0xa68b('0x17')](function(){return _0x26130d;});})[_0xa68b('0x17')](function(){_0x161cad[_0xa68b('0x22')](0xcc)[_0xa68b('0x23')]();});}};}function handleEntityNotFound(_0x216d37){return function(_0x2b85c2){if(!_0x2b85c2){_0x216d37[_0xa68b('0x21')](0x194);}return _0x2b85c2;};}function handleError(_0x3fe918,_0x2f6a35){_0x2f6a35=_0x2f6a35||0x1f4;return function(_0xed6691){logger[_0xa68b('0x1e')](_0xed6691[_0xa68b('0x2f')]);if(_0xed6691[_0xa68b('0x30')]){delete _0xed6691[_0xa68b('0x30')];}_0x3fe918[_0xa68b('0x22')](_0x2f6a35)['send'](_0xed6691);};}exports[_0xa68b('0x31')]=function(_0x223f16,_0x308f0c){var _0x4b8fc6={'include':[{'model':db[_0xa68b('0x32')],'as':_0xa68b('0x33')}]},_0x346f1f={},_0x5818fd={'count':0x0,'rows':[]};var _0x44e820=_[_0xa68b('0x34')](db[_0xa68b('0x35')][_0xa68b('0x36')],function(_0x530aed){return{'name':_0x530aed[_0xa68b('0x37')],'type':_0x530aed[_0xa68b('0x38')][_0xa68b('0x39')]};});_0x346f1f[_0xa68b('0x3a')]=_[_0xa68b('0x34')](_0x44e820,'name');_0x346f1f['query']=_[_0xa68b('0x3b')](_0x223f16[_0xa68b('0x3c')]);_0x346f1f[_0xa68b('0x3d')]=_[_0xa68b('0x3e')](_0x346f1f['model'],_0x346f1f[_0xa68b('0x3c')]);_0x4b8fc6[_0xa68b('0x3f')]=_['intersection'](_0x346f1f['model'],qs[_0xa68b('0x40')](_0x223f16[_0xa68b('0x3c')][_0xa68b('0x40')]));_0x4b8fc6[_0xa68b('0x3f')]=_0x4b8fc6[_0xa68b('0x3f')]['length']?_0x4b8fc6['attributes']:_0x346f1f['model'];if(!_0x223f16[_0xa68b('0x3c')][_0xa68b('0x41')]('nolimit')){_0x4b8fc6[_0xa68b('0x26')]=qs[_0xa68b('0x26')](_0x223f16['query'][_0xa68b('0x26')]);_0x4b8fc6[_0xa68b('0x28')]=qs[_0xa68b('0x28')](_0x223f16[_0xa68b('0x3c')][_0xa68b('0x28')]);}_0x4b8fc6['order']=qs[_0xa68b('0x42')](_0x223f16[_0xa68b('0x3c')][_0xa68b('0x42')]);_0x4b8fc6['where']=qs[_0xa68b('0x3d')](_['pick'](_0x223f16[_0xa68b('0x3c')],_0x346f1f[_0xa68b('0x3d')]),_0x44e820);if(_0x223f16[_0xa68b('0x3c')][_0xa68b('0x43')]){_0x4b8fc6[_0xa68b('0x44')]=_[_0xa68b('0x45')](_0x4b8fc6['where'],{'$or':_['map'](_0x44e820,function(_0x3bc89){if(_0x3bc89[_0xa68b('0x38')]!==_0xa68b('0x46')){var _0x4a7eb3={};_0x4a7eb3[_0x3bc89[_0xa68b('0x30')]]={'$like':'%'+_0x223f16[_0xa68b('0x3c')]['filter']+'%'};return _0x4a7eb3;}})});}_0x4b8fc6=_[_0xa68b('0x45')]({},_0x4b8fc6,_0x223f16[_0xa68b('0x47')]);var _0x28103c={'where':_0x4b8fc6[_0xa68b('0x44')]};return db[_0xa68b('0x35')][_0xa68b('0x27')](_0x28103c)[_0xa68b('0x17')](function(_0x137187){_0x5818fd[_0xa68b('0x27')]=_0x137187;if(_0x223f16[_0xa68b('0x3c')][_0xa68b('0x48')]){_0x4b8fc6[_0xa68b('0x49')]=[{'all':!![]}];}return db['ChatWebsite'][_0xa68b('0x4a')](_0x4b8fc6);})[_0xa68b('0x17')](function(_0x539c51){_0x5818fd[_0xa68b('0x4b')]=_0x539c51;return _0x5818fd;})[_0xa68b('0x17')](respondWithFilteredResult(_0x308f0c,_0x4b8fc6))[_0xa68b('0x4c')](handleError(_0x308f0c,null));};exports[_0xa68b('0x4d')]=function(_0x4ea721,_0xbe2cc8){var _0x5a8fb8={'raw':![],'where':{'id':_0x4ea721[_0xa68b('0x4e')]['id']},'include':[{'model':db[_0xa68b('0x32')],'as':_0xa68b('0x33')}]},_0x1fdaea={};_0x1fdaea['model']=_[_0xa68b('0x3b')](db[_0xa68b('0x35')][_0xa68b('0x36')]);_0x1fdaea[_0xa68b('0x3c')]=_[_0xa68b('0x3b')](_0x4ea721[_0xa68b('0x3c')]);_0x1fdaea['filters']=_[_0xa68b('0x3e')](_0x1fdaea[_0xa68b('0x3a')],_0x1fdaea['query']);_0x5a8fb8[_0xa68b('0x3f')]=_[_0xa68b('0x3e')](_0x1fdaea[_0xa68b('0x3a')],qs[_0xa68b('0x40')](_0x4ea721[_0xa68b('0x3c')][_0xa68b('0x40')]));_0x5a8fb8[_0xa68b('0x3f')]=_0x5a8fb8[_0xa68b('0x3f')][_0xa68b('0x4f')]?_0x5a8fb8[_0xa68b('0x3f')]:_0x1fdaea['model'];if(_0x4ea721[_0xa68b('0x3c')][_0xa68b('0x48')]){_0x5a8fb8[_0xa68b('0x49')]=[{'all':!![]}];}_0x5a8fb8=_[_0xa68b('0x45')]({},_0x5a8fb8,_0x4ea721[_0xa68b('0x47')]);return db[_0xa68b('0x35')]['find'](_0x5a8fb8)[_0xa68b('0x17')](handleEntityNotFound(_0xbe2cc8,null))[_0xa68b('0x17')](respondWithResult(_0xbe2cc8,null))[_0xa68b('0x4c')](handleError(_0xbe2cc8,null));};exports[_0xa68b('0x50')]=function(_0xe154bb,_0xd9ad89){return db[_0xa68b('0x35')][_0xa68b('0x50')](_0xe154bb[_0xa68b('0x51')],{})[_0xa68b('0x17')](function(_0x8ec6fc){var _0x3cb6ed=_0xe154bb['user'][_0xa68b('0x2c')]({'plain':!![]});if(!_0x3cb6ed)throw new Error(_0xa68b('0x52'));if(_0x3cb6ed[_0xa68b('0x53')]===_0xa68b('0x54')){var _0x2a7e7e=_0x8ec6fc[_0xa68b('0x2c')]({'plain':!![]});var _0x3a4c3b='ChatWebsites';return db['UserProfileSection'][_0xa68b('0x55')]({'where':{'name':_0x3a4c3b,'userProfileId':_0x3cb6ed[_0xa68b('0x56')]},'raw':!![]})[_0xa68b('0x17')](function(_0x2e99a0){if(_0x2e99a0&&_0x2e99a0[_0xa68b('0x57')]===0x0){return db[_0xa68b('0x2e')][_0xa68b('0x50')]({'name':_0x2a7e7e[_0xa68b('0x30')],'resourceId':_0x2a7e7e['id'],'type':_0x2e99a0['name'],'sectionId':_0x2e99a0['id']},{})[_0xa68b('0x17')](function(){return _0x8ec6fc;});}else{return _0x8ec6fc;}})[_0xa68b('0x4c')](function(_0x1f793f){logger['error'](_0xa68b('0x58'),_0x1f793f);throw _0x1f793f;});}return _0x8ec6fc;})[_0xa68b('0x17')](respondWithResult(_0xd9ad89,0xc9))[_0xa68b('0x4c')](handleError(_0xd9ad89,null));};exports['update']=function(_0x12d45a,_0x3767a1){if(_0x12d45a['body']['id']){delete _0x12d45a[_0xa68b('0x51')]['id'];}return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x12d45a[_0xa68b('0x4e')]['id']},'include':[{'model':db['Pause'],'as':_0xa68b('0x33')}]})[_0xa68b('0x17')](handleEntityNotFound(_0x3767a1,null))[_0xa68b('0x17')](saveUpdates(_0x12d45a[_0xa68b('0x51')],null))[_0xa68b('0x17')](respondWithResult(_0x3767a1,null))['catch'](handleError(_0x3767a1,null));};exports['destroy']=function(_0x437ea1,_0x2f63eb){return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x437ea1[_0xa68b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2f63eb,null))[_0xa68b('0x17')](removeEntity(_0x2f63eb,null))['catch'](handleError(_0x2f63eb,null));};exports[_0xa68b('0x59')]=function(_0x5041cc,_0x1e56a3){return db[_0xa68b('0x35')][_0xa68b('0x59')]()[_0xa68b('0x17')](respondWithResult(_0x1e56a3,null))[_0xa68b('0x4c')](handleError(_0x1e56a3,null));};exports[_0xa68b('0x5a')]=function(_0x9dd515,_0x128183){if(_0x9dd515[_0xa68b('0x51')]['id']){delete _0x9dd515['body']['id'];}return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x9dd515[_0xa68b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x128183,null))['then'](function(_0x3c394c){if(_0x3c394c){_0x9dd515[_0xa68b('0x51')][_0xa68b('0x5b')]=_0x3c394c['id'];return db[_0xa68b('0x5c')][_0xa68b('0x50')](_0x9dd515[_0xa68b('0x51')]);}})[_0xa68b('0x17')](respondWithResult(_0x128183,null))['catch'](handleError(_0x128183,null));};exports[_0xa68b('0x5d')]=function(_0x595864,_0x49ff67){var _0x37aca3={'raw':![],'where':{}};var _0x33238a={};var _0x33fe22={'count':0x0,'rows':[]};return db[_0xa68b('0x35')][_0xa68b('0x5e')]({'where':{'id':_0x595864['params']['id']}})['then'](handleEntityNotFound(_0x49ff67,null))['then'](function(_0x34ddec){if(_0x34ddec){_0x33238a[_0xa68b('0x3a')]=_[_0xa68b('0x3b')](db[_0xa68b('0x5c')][_0xa68b('0x36')]);_0x33238a[_0xa68b('0x3c')]=_[_0xa68b('0x3b')](_0x595864[_0xa68b('0x3c')]);_0x33238a['filters']=_[_0xa68b('0x3e')](_0x33238a[_0xa68b('0x3a')],_0x33238a[_0xa68b('0x3c')]);_0x37aca3['attributes']=_[_0xa68b('0x3e')](_0x33238a['model'],qs[_0xa68b('0x40')](_0x595864[_0xa68b('0x3c')][_0xa68b('0x40')]));_0x37aca3[_0xa68b('0x3f')]=_0x37aca3[_0xa68b('0x3f')]['length']?_0x37aca3[_0xa68b('0x3f')]:_0x33238a['model'];if(!_0x595864[_0xa68b('0x3c')]['hasOwnProperty'](_0xa68b('0x5f'))){_0x37aca3['limit']=qs[_0xa68b('0x26')](_0x595864[_0xa68b('0x3c')][_0xa68b('0x26')]);_0x37aca3[_0xa68b('0x28')]=qs[_0xa68b('0x28')](_0x595864[_0xa68b('0x3c')][_0xa68b('0x28')]);}_0x37aca3['order']=qs[_0xa68b('0x42')](_0x595864[_0xa68b('0x3c')][_0xa68b('0x42')]);_0x37aca3[_0xa68b('0x44')]=qs[_0xa68b('0x3d')](_[_0xa68b('0x60')](_0x595864[_0xa68b('0x3c')],_0x33238a[_0xa68b('0x3d')]));_0x37aca3['where'][_0xa68b('0x5b')]=_0x34ddec['id'];if(_0x595864[_0xa68b('0x3c')]['filter']){_0x37aca3[_0xa68b('0x44')]=_['merge'](_0x37aca3['where'],{'$or':_[_0xa68b('0x34')](_0x37aca3[_0xa68b('0x3f')],function(_0x64381){var _0x2e1bb4={};_0x2e1bb4[_0x64381]={'$like':'%'+_0x595864[_0xa68b('0x3c')][_0xa68b('0x43')]+'%'};return _0x2e1bb4;})});}_0x37aca3=_[_0xa68b('0x45')]({},_0x37aca3,_0x595864['options']);return db[_0xa68b('0x5c')][_0xa68b('0x27')]({'where':_0x37aca3[_0xa68b('0x44')]})[_0xa68b('0x17')](function(_0x5cfebb){_0x33fe22['count']=_0x5cfebb;if(_0x595864[_0xa68b('0x3c')]['includeAll']){_0x37aca3[_0xa68b('0x49')]=[{'all':!![]}];}return db[_0xa68b('0x5c')]['findAll'](_0x37aca3);})[_0xa68b('0x17')](function(_0x2c3034){_0x33fe22['rows']=_0x2c3034;return _0x33fe22;});}})[_0xa68b('0x17')](respondWithFilteredResult(_0x49ff67,_0x37aca3))[_0xa68b('0x4c')](handleError(_0x49ff67,null));};exports[_0xa68b('0x61')]=function(_0x1010cf,_0x5bc607){return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x1010cf['params']['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x5bc607,null))[_0xa68b('0x17')](function(_0x16cc1c){if(_0x16cc1c){return _0x16cc1c[_0xa68b('0x61')](_0x1010cf[_0xa68b('0x3c')]['ids']);}})[_0xa68b('0x17')](respondWithStatusCode(_0x5bc607,null))['catch'](handleError(_0x5bc607,null));};exports['addAnswer']=function(_0x20ca55,_0x1a4a06){if(_0x20ca55[_0xa68b('0x51')]['id']){delete _0x20ca55[_0xa68b('0x51')]['id'];}return db[_0xa68b('0x35')]['find']({'where':{'id':_0x20ca55[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x1a4a06,null))[_0xa68b('0x17')](function(_0xfc8e3b){if(_0xfc8e3b){_0x20ca55[_0xa68b('0x51')][_0xa68b('0x5b')]=_0xfc8e3b['id'];return db[_0xa68b('0x62')][_0xa68b('0x50')](_0x20ca55[_0xa68b('0x51')]);}})[_0xa68b('0x17')](respondWithResult(_0x1a4a06,null))['catch'](handleError(_0x1a4a06,null));};exports[_0xa68b('0x63')]=function(_0x32d278,_0xfae93e){var _0x454437={'raw':![],'where':{}};var _0x1b9f41={};var _0x555e24={'count':0x0,'rows':[]};return db[_0xa68b('0x35')][_0xa68b('0x5e')]({'where':{'id':_0x32d278[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0xfae93e,null))[_0xa68b('0x17')](function(_0x43d127){if(_0x43d127){_0x1b9f41[_0xa68b('0x3a')]=_[_0xa68b('0x3b')](db['CannedAnswer'][_0xa68b('0x36')]);_0x1b9f41[_0xa68b('0x3c')]=_['keys'](_0x32d278[_0xa68b('0x3c')]);_0x1b9f41['filters']=_[_0xa68b('0x3e')](_0x1b9f41['model'],_0x1b9f41[_0xa68b('0x3c')]);_0x454437[_0xa68b('0x3f')]=_['intersection'](_0x1b9f41[_0xa68b('0x3a')],qs[_0xa68b('0x40')](_0x32d278['query'][_0xa68b('0x40')]));_0x454437[_0xa68b('0x3f')]=_0x454437[_0xa68b('0x3f')]['length']?_0x454437[_0xa68b('0x3f')]:_0x1b9f41[_0xa68b('0x3a')];if(!_0x32d278['query']['hasOwnProperty'](_0xa68b('0x5f'))){_0x454437[_0xa68b('0x26')]=qs[_0xa68b('0x26')](_0x32d278[_0xa68b('0x3c')][_0xa68b('0x26')]);_0x454437['offset']=qs['offset'](_0x32d278[_0xa68b('0x3c')][_0xa68b('0x28')]);}_0x454437[_0xa68b('0x64')]=qs[_0xa68b('0x42')](_0x32d278[_0xa68b('0x3c')][_0xa68b('0x42')]);_0x454437[_0xa68b('0x44')]=qs[_0xa68b('0x3d')](_[_0xa68b('0x60')](_0x32d278[_0xa68b('0x3c')],_0x1b9f41[_0xa68b('0x3d')]));_0x454437['where'][_0xa68b('0x5b')]=_0x43d127['id'];if(_0x32d278['query'][_0xa68b('0x43')]){_0x454437[_0xa68b('0x44')]=_['merge'](_0x454437[_0xa68b('0x44')],{'$or':_[_0xa68b('0x34')](_0x454437[_0xa68b('0x3f')],function(_0x31840a){var _0x2de3c8={};_0x2de3c8[_0x31840a]={'$like':'%'+_0x32d278['query'][_0xa68b('0x43')]+'%'};return _0x2de3c8;})});}_0x454437=_[_0xa68b('0x45')]({},_0x454437,_0x32d278[_0xa68b('0x47')]);return db[_0xa68b('0x62')][_0xa68b('0x27')]({'where':_0x454437['where']})[_0xa68b('0x17')](function(_0x32d8ae){_0x555e24[_0xa68b('0x27')]=_0x32d8ae;if(_0x32d278[_0xa68b('0x3c')][_0xa68b('0x48')]){_0x454437[_0xa68b('0x49')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x454437);})['then'](function(_0x3a8552){_0x555e24[_0xa68b('0x4b')]=_0x3a8552;return _0x555e24;});}})[_0xa68b('0x17')](respondWithFilteredResult(_0xfae93e,_0x454437))[_0xa68b('0x4c')](handleError(_0xfae93e,null));};exports[_0xa68b('0x65')]=function(_0x4f5583,_0x3c7aed){return db['ChatWebsite'][_0xa68b('0x55')]({'where':{'id':_0x4f5583['params']['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x3c7aed,null))['then'](function(_0x494223){if(_0x494223){return _0x494223[_0xa68b('0x65')](_0x4f5583[_0xa68b('0x3c')]['ids']);}})[_0xa68b('0x17')](respondWithStatusCode(_0x3c7aed,null))[_0xa68b('0x4c')](handleError(_0x3c7aed,null));};exports['addLogo']=function(_0x1a35c9,_0x4169d0){_0x1a35c9[_0xa68b('0x51')][_0xa68b('0x66')]=_0x1a35c9[_0xa68b('0x67')][_0xa68b('0x68')];return db['ChatWebsite'][_0xa68b('0x55')]({'where':{'id':_0x1a35c9[_0xa68b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4169d0,null))['then'](saveUpdates(_0x1a35c9[_0xa68b('0x51')],null))['then'](respondWithResult(_0x4169d0,null))['catch'](handleError(_0x4169d0,null));};exports[_0xa68b('0x69')]=function(_0x3b33c1,_0x49a513){_0x3b33c1[_0xa68b('0x51')][_0xa68b('0x6a')]=_0x3b33c1[_0xa68b('0x67')]['filename'];return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x3b33c1[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x49a513,null))[_0xa68b('0x17')](saveUpdates(_0x3b33c1[_0xa68b('0x51')],null))[_0xa68b('0x17')](respondWithResult(_0x49a513,null))[_0xa68b('0x4c')](handleError(_0x49a513,null));};exports[_0xa68b('0x6b')]=function(_0x3a3a7c,_0x4d8e9f){_0x3a3a7c[_0xa68b('0x51')][_0xa68b('0x6c')]=_0x3a3a7c['file'][_0xa68b('0x68')];return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x3a3a7c['params']['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x4d8e9f,null))[_0xa68b('0x17')](saveUpdates(_0x3a3a7c[_0xa68b('0x51')],null))['then'](respondWithResult(_0x4d8e9f,null))[_0xa68b('0x4c')](handleError(_0x4d8e9f,null));};exports[_0xa68b('0x6d')]=function(_0x179049,_0x52c174){_0x179049[_0xa68b('0x51')][_0xa68b('0x6e')]=_0x179049[_0xa68b('0x67')][_0xa68b('0x68')];return db['ChatWebsite'][_0xa68b('0x55')]({'where':{'id':_0x179049[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x52c174,null))[_0xa68b('0x17')](saveUpdates(_0x179049[_0xa68b('0x51')],null))[_0xa68b('0x17')](respondWithResult(_0x52c174,null))[_0xa68b('0x4c')](handleError(_0x52c174,null));};exports[_0xa68b('0x6f')]=function(_0x25e21e,_0x36c2af){var _0x4ed9a8=path['join'](config[_0xa68b('0x70')],_0xa68b('0x71'));var _0x5ed5ab={'where':{'id':_0x25e21e[_0xa68b('0x4e')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2d040c=![];return require(_0xa68b('0x72'))[_0xa68b('0x73')]()['then'](function(_0x3bcf13){if(_0x3bcf13){_0x2d040c=_0x3bcf13[_0xa68b('0x74')];}})[_0xa68b('0x17')](function(){return db[_0xa68b('0x35')][_0xa68b('0x55')](_0x5ed5ab);})[_0xa68b('0x17')](handleEntityNotFound(_0x36c2af,null))[_0xa68b('0x17')](function(_0x5c32c8){if(_0x5c32c8){if(!_[_0xa68b('0x75')](_0x5c32c8[_0xa68b('0x66')])){if(fs[_0xa68b('0x76')](path['join'](config[_0xa68b('0x70')],'server/files/images/logos/',_0x5c32c8[_0xa68b('0x66')]))&&_0x2d040c){_0x4ed9a8=path[_0xa68b('0x77')](config['root'],_0xa68b('0x78'),_0x5c32c8['sitepic']);}}return _0x36c2af[_0xa68b('0x79')](_0x4ed9a8);}})[_0xa68b('0x4c')](handleError(_0x36c2af,null));};exports[_0xa68b('0x7a')]=function(_0x504490,_0x46b079){var _0x265cc8=path[_0xa68b('0x77')](config['root'],_0xa68b('0x7b'));var _0x834d83={'where':{'id':_0x504490[_0xa68b('0x4e')]['id']},'attributes':['id',_0xa68b('0x6a')],'raw':!![]};return db['ChatWebsite']['find'](_0x834d83)[_0xa68b('0x17')](handleEntityNotFound(_0x46b079,null))[_0xa68b('0x17')](function(_0x2b992b){if(_0x2b992b){if(!_[_0xa68b('0x75')](_0x2b992b[_0xa68b('0x6a')])){if(fs[_0xa68b('0x76')](path[_0xa68b('0x77')](config[_0xa68b('0x70')],_0xa68b('0x7c'),_0x2b992b[_0xa68b('0x6a')]))){_0x265cc8=path[_0xa68b('0x77')](config[_0xa68b('0x70')],_0xa68b('0x7c'),_0x2b992b[_0xa68b('0x6a')]);}}return _0x46b079[_0xa68b('0x79')](_0x265cc8);}})[_0xa68b('0x4c')](handleError(_0x46b079,null));};exports[_0xa68b('0x7d')]=function(_0x89c370,_0x39cb9c){var _0xae1415=path[_0xa68b('0x77')](config[_0xa68b('0x70')],'server/files/images/avatars/customer_avatar.png');var _0x5cf42a={'where':{'id':_0x89c370[_0xa68b('0x4e')]['id']},'attributes':['id','customerAvatar',_0xa68b('0x7e')],'raw':!![]};return db['ChatWebsite']['find'](_0x5cf42a)[_0xa68b('0x17')](handleEntityNotFound(_0x39cb9c,null))[_0xa68b('0x17')](function(_0x8a48ed){if(_0x8a48ed){if(!_['isNil'](_0x8a48ed['customerAvatar'])){if(fs[_0xa68b('0x76')](path[_0xa68b('0x77')](config['root'],'server/files/images/avatars/',_0x8a48ed[_0xa68b('0x6c')]))&&_0x8a48ed[_0xa68b('0x7e')]){_0xae1415=path['join'](config[_0xa68b('0x70')],_0xa68b('0x7c'),_0x8a48ed[_0xa68b('0x6c')]);}}return _0x39cb9c[_0xa68b('0x79')](_0xae1415);}})[_0xa68b('0x4c')](handleError(_0x39cb9c,null));};exports[_0xa68b('0x7f')]=function(_0x2624fd,_0x4c3834){var _0x504ebd=path[_0xa68b('0x77')](config['root'],_0xa68b('0x80'));var _0x333979={'where':{'id':_0x2624fd['params']['id']},'attributes':['id',_0xa68b('0x6e')],'raw':!![]};return db['ChatWebsite'][_0xa68b('0x55')](_0x333979)[_0xa68b('0x17')](handleEntityNotFound(_0x4c3834,null))[_0xa68b('0x17')](function(_0x4a8db0){if(_0x4a8db0){if(!_['isNil'](_0x4a8db0[_0xa68b('0x6e')])){if(fs[_0xa68b('0x76')](path['join'](config[_0xa68b('0x70')],'server/files/images/avatars/',_0x4a8db0[_0xa68b('0x6e')]))){_0x504ebd=path[_0xa68b('0x77')](config[_0xa68b('0x70')],_0xa68b('0x7c'),_0x4a8db0[_0xa68b('0x6e')]);}}return _0x4c3834[_0xa68b('0x79')](_0x504ebd);}})['catch'](handleError(_0x4c3834,null));};exports[_0xa68b('0x81')]=function(_0x31b018,_0x245775){var _0x21ae75=require(_0xa68b('0x82'));var _0x298528=new _0x21ae75();var _0x47b14b=_0x298528['setUA'](_0x31b018[_0xa68b('0x83')][_0xa68b('0x84')])[_0xa68b('0x85')]();var _0x197faa={'body':_0x31b018[_0xa68b('0x51')],'channel':_0xa68b('0x86')};var _0x488222=[];var _0xe9355=[];var _0x2d0bf2={};var _0x1db3b0=![];return db[_0xa68b('0x87')][_0xa68b('0x59')]()[_0xa68b('0x17')](function(_0xf32753){if(!_0xf32753){throw new db[(_0xa68b('0x88'))][(_0xa68b('0x89'))](_0xa68b('0x8a'));}_0x488222=_['difference'](_[_0xa68b('0x3b')](_0xf32753),[_0xa68b('0x8b'),_0xa68b('0x8c')]);_0xe9355=_[_0xa68b('0x8d')](_[_0xa68b('0x3b')](_0xf32753),[_0xa68b('0x8b'),_0xa68b('0x8c'),'CompanyId',_0xa68b('0x8e')]);if(_0x31b018['body']['id']){delete _0x31b018['body']['id'];}if(_['isNil'](_0x31b018['body']['from'])){throw new db['Sequelize'][(_0xa68b('0x89'))](_0xa68b('0x8f'));}if(_['isNil'](_0x31b018[_0xa68b('0x51')][_0xa68b('0x51')])||_0x31b018[_0xa68b('0x51')][_0xa68b('0x51')]===''){throw new db[(_0xa68b('0x88'))][(_0xa68b('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa68b('0x75')](_0x31b018[_0xa68b('0x51')]['mapKey'])){throw new db[(_0xa68b('0x88'))][(_0xa68b('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe9355);}if(!_['includes'](_0xe9355,_0x31b018[_0xa68b('0x51')][_0xa68b('0x90')])){throw new db[(_0xa68b('0x88'))]['ValidationError'](_0xa68b('0x91')+_0xe9355);}_0x2d0bf2[_0x31b018[_0xa68b('0x51')]['mapKey']]=_0x31b018['body'][_0xa68b('0x92')];})['then'](function(){return db[_0xa68b('0x35')]['find']({'where':{'id':_0x31b018[_0xa68b('0x4e')]['id']},'include':[{'model':db[_0xa68b('0x93')],'as':_0xa68b('0x94'),'include':[{'model':db[_0xa68b('0x87')],'as':_0xa68b('0x95'),'where':_0x2d0bf2,'limit':0x1,'order':[[_0xa68b('0x8c'),_0xa68b('0x96')]]}]},{'model':db[_0xa68b('0x97')],'as':'Applications'}]});})[_0xa68b('0x17')](handleEntityNotFound(_0x245775,null))['then'](function(_0xf6afe){if(_0xf6afe&&_0xf6afe[_0xa68b('0x94')]){_0x197faa[_0xa68b('0x98')]=_0xf6afe;_0x197faa['applications']=_0xf6afe[_0xa68b('0x99')];_0x197faa[_0xa68b('0x9a')]=_0xf6afe[_0xa68b('0x94')];_0x197faa['applications']=_[_0xa68b('0x9b')](_0x197faa[_0xa68b('0x9c')],[_0xa68b('0x9d')],['asc']);if(_0x197faa[_0xa68b('0x98')][_0xa68b('0x99')]){delete _0x197faa[_0xa68b('0x98')][_0xa68b('0x99')];}if(_0x197faa[_0xa68b('0x98')][_0xa68b('0x94')]&&_0x197faa['account'][_0xa68b('0x94')][_0xa68b('0x95')][_0xa68b('0x4f')]){return _0x197faa[_0xa68b('0x98')][_0xa68b('0x94')][_0xa68b('0x95')][0x0];}var _0x5f27cc=_[_0xa68b('0xd')](_0x31b018['body'],{'firstName':_0x31b018[_0xa68b('0x51')][_0xa68b('0x92')],'ListId':_0xf6afe[_0xa68b('0x8e')]});_0x5f27cc[_0x31b018['body'][_0xa68b('0x90')]]=_0x31b018['body'][_0xa68b('0x92')];return db[_0xa68b('0x87')][_0xa68b('0x50')](_0x5f27cc,{'fields':_0x488222,'raw':!![]});}})[_0xa68b('0x17')](handleEntityNotFound(_0x245775,null))[_0xa68b('0x17')](function(_0x1c4ca3){_0x197faa['contact']=_0x1c4ca3;var _0x416fb3=_0x31b018[_0xa68b('0x51')]['customerIp'];if(_0x31b018[_0xa68b('0x83')][_0xa68b('0x9e')]){_0x416fb3=_0x31b018[_0xa68b('0x83')][_0xa68b('0x9e')];}else if(_0x31b018[_0xa68b('0x83')][_0xa68b('0x9f')]){_0x416fb3=_[_0xa68b('0xa0')](_0x31b018[_0xa68b('0x83')][_0xa68b('0x9f')][_0xa68b('0xa1')](','));}if(_0x1c4ca3){var _0x2d2175={'ContactId':_0x1c4ca3['id'],'ChatWebsiteId':_0x31b018[_0xa68b('0x4e')]['id'],'from':(_0x1c4ca3['firstName']||'')+'\x20'+(_0x1c4ca3[_0xa68b('0xa2')]||''),'customerIp':_0x416fb3,'customerPort':_0x31b018[_0xa68b('0x83')][_0xa68b('0xa3')]?_0x31b018[_0xa68b('0x83')][_0xa68b('0xa3')]:null,'referer':_0x31b018[_0xa68b('0x51')][_0xa68b('0xa4')],'browserName':_0x47b14b[_0xa68b('0xa5')][_0xa68b('0x30')]&&_0x47b14b['browser'][_0xa68b('0xa6')]?util[_0xa68b('0xa7')]('%s\x20%s',_0x47b14b[_0xa68b('0xa5')][_0xa68b('0x30')],_0x47b14b[_0xa68b('0xa5')]['version']):_0xa68b('0xa8'),'browserVersion':_0x47b14b[_0xa68b('0xa5')][_0xa68b('0xa6')]||_0xa68b('0xa8'),'osName':util[_0xa68b('0xa7')](_0xa68b('0xa9'),_0x47b14b['os'][_0xa68b('0x30')],_0x47b14b['os'][_0xa68b('0xa6')]),'osVersion':_0x47b14b['os'][_0xa68b('0xa6')],'deviceModel':_0x47b14b[_0xa68b('0xaa')][_0xa68b('0x3a')]&&_0x47b14b[_0xa68b('0xaa')]['vendor']?util[_0xa68b('0xa7')](_0xa68b('0xab'),_0x47b14b[_0xa68b('0xaa')][_0xa68b('0x3a')],_0x47b14b['device'][_0xa68b('0xac')],_0x47b14b['device']['type']):null,'deviceVendor':_0x47b14b[_0xa68b('0xaa')][_0xa68b('0xac')],'deviceType':_0x47b14b[_0xa68b('0xaa')][_0xa68b('0x38')],'formData':JSON['stringify'](_0x31b018[_0xa68b('0x51')])};var _0x5c8d00={'ChatWebsiteId':_0x31b018[_0xa68b('0x4e')]['id'],'closed':![]};if(_0x31b018['body']['threadId']){_0x5c8d00[_0xa68b('0xad')]=_0x31b018[_0xa68b('0x51')][_0xa68b('0xad')];return db[_0xa68b('0xae')][_0xa68b('0x55')]({'where':_0x5c8d00})[_0xa68b('0x17')](function(_0x5c18de){if(_0x5c18de){return[_0x5c18de,![]];}_0x2d2175[_0xa68b('0xad')]=_0x31b018['body'][_0xa68b('0xad')];_0x2d2175[_0xa68b('0xaf')]=_0x31b018['body'][_0xa68b('0xaf')];return db['ChatInteraction'][_0xa68b('0x50')](_0x2d2175)[_0xa68b('0x17')](function(_0x5d0f13){return[_0x5d0f13,!![]];});});}_0x5c8d00[_0xa68b('0xb0')]=_0x1c4ca3['id'];if(_0x31b018[_0xa68b('0x51')]['interaction']&&_0x31b018['body'][_0xa68b('0xb1')]['id']){_0x5c8d00['id']=_0x31b018['body'][_0xa68b('0xb1')]['id'];return db[_0xa68b('0xae')]['find']({'where':_0x5c8d00})[_0xa68b('0x17')](function(_0x17c513){if(_0x17c513){return[_0x17c513,![]];}return db[_0xa68b('0xae')][_0xa68b('0x50')](_0x2d2175)[_0xa68b('0x17')](function(_0x42da20){return[_0x42da20,!![]];});});}return db['ChatInteraction'][_0xa68b('0x50')](_0x2d2175)[_0xa68b('0x17')](function(_0x1a8b06){return[_0x1a8b06,!![]];});}})['spread'](function(_0x506a58,_0x192f5f){if(_0x506a58){_0x1db3b0=_0x192f5f;if(!_0x192f5f){var _0x2fa121={'from':(_0x197faa[_0xa68b('0xb2')][_0xa68b('0xb3')]||'')+'\x20'+(_0x197faa['contact'][_0xa68b('0xa2')]||'')};if(_0x31b018[_0xa68b('0x51')]['threadId']&&_0x31b018[_0xa68b('0x51')][_0xa68b('0xb4')]&&_0x31b018['body'][_0xa68b('0xad')]!=_0x31b018[_0xa68b('0x51')][_0xa68b('0xb4')]){_0x2fa121[_0xa68b('0xad')]=_0x31b018['body']['messageId'];}return _0x506a58[_0xa68b('0x2a')](_0x2fa121);}else{return _0x506a58;}}})['then'](function(_0x45af30){_0x197faa[_0xa68b('0xb1')]=_0x45af30['get']({'plain':!![]});_0x197faa['interaction'][_0xa68b('0xb5')]=_0x1db3b0;if(_0x197faa['interaction']['created']){if(_0x197faa[_0xa68b('0x98')][_0xa68b('0xb6')]){_0x197faa[_0xa68b('0x9c')][_0xa68b('0xb7')]({'id':0x0,'priority':_0x197faa[_0xa68b('0x9c')]['length']+0x1,'app':'close','appdata':_0xa68b('0xb8'),'interval':_0xa68b('0xb9')});}}return db[_0xa68b('0xba')][_0xa68b('0x50')]({'body':_0x31b018[_0xa68b('0x51')]['body'],'ChatWebsiteId':_0x31b018[_0xa68b('0x4e')]['id'],'ChatInteractionId':_0x45af30['id'],'direction':'in','ContactId':_0x197faa[_0xa68b('0xb2')]['id'],'AttachmentId':_0x31b018['body'][_0xa68b('0xbb')]});})[_0xa68b('0x17')](function(_0xc30e93){_0x197faa[_0xa68b('0x20')]=_0xc30e93;if(_0x197faa[_0xa68b('0xb1')][_0xa68b('0xbc')]){return db['User'][_0xa68b('0x55')]({'attributes':['id',_0xa68b('0x30')],'where':{'id':_0x197faa['interaction'][_0xa68b('0xbc')]}})[_0xa68b('0x17')](function(_0x2ec90f){if(_0x2ec90f){_0x197faa['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xa68b('0xbd'),'appdata':_0x2ec90f[_0xa68b('0x30')]+','+(_0x197faa[_0xa68b('0x98')][_0xa68b('0xbe')]||0xa),'interval':_0xa68b('0xb9')});_0x197faa[_0xa68b('0xbf')]=!![];}return respondWithRpcPromise(_0xa68b('0xc0'),_0xa68b('0xc1'),_0x197faa);});}return respondWithRpcPromise(_0xa68b('0xc0'),'startRouting',_0x197faa);})[_0xa68b('0x17')](function(_0x478414){respondWithRpcPromise(_0xa68b('0xc2'),'EventManager',{'event':_0xa68b('0x81'),'message':_0x478414},client9002);return _0x478414;})[_0xa68b('0x17')](respondWithResult(_0x245775,null))[_0xa68b('0x4c')](handleError(_0x245775,null));};exports[_0xa68b('0xc3')]=function(_0x4d6796,_0x448930){var _0x59f516,_0x3995a3,_0x48f2a5;var _0x375bc7=[];var _0x491a0d={};var _0x5f2f69=_0x4d6796[_0xa68b('0xc4')]||[];var _0x596fc5=[];var _0x20b942;return db[_0xa68b('0x87')][_0xa68b('0x59')]()['then'](function(_0x1f4a63){if(!_0x1f4a63){throw new db[(_0xa68b('0x88'))]['ValidationError'](_0xa68b('0x8a'));}_0x375bc7=_[_0xa68b('0x8d')](_[_0xa68b('0x3b')](_0x1f4a63),[_0xa68b('0x8b'),_0xa68b('0x8c'),_0xa68b('0xc5'),_0xa68b('0x8e')]);if(_0x4d6796[_0xa68b('0x51')]['id']){delete _0x4d6796[_0xa68b('0x51')]['id'];}if(_[_0xa68b('0x75')](_0x4d6796[_0xa68b('0x51')][_0xa68b('0x92')])){throw _0x448930[_0xa68b('0x22')](0x1f4)[_0xa68b('0xc6')](new db['Sequelize'][(_0xa68b('0x89'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x4d6796['body'][_0xa68b('0x51')])||_0x4d6796[_0xa68b('0x51')][_0xa68b('0x51')]===''){throw _0x448930[_0xa68b('0x22')](0x1f4)[_0xa68b('0xc6')](new db['Sequelize'][(_0xa68b('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xa68b('0x75')](_0x4d6796[_0xa68b('0x51')][_0xa68b('0xc7')])){throw _0x448930['status'](0x1f4)[_0xa68b('0xc6')](new db[(_0xa68b('0x88'))][(_0xa68b('0x89'))](_0xa68b('0xc8')+_0x375bc7));}if(!_['includes'](_0x375bc7,_0x4d6796[_0xa68b('0x51')]['mapKeyOffline'])){throw _0x448930[_0xa68b('0x22')](0x1f4)[_0xa68b('0xc6')](new db[(_0xa68b('0x88'))][(_0xa68b('0x89'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x375bc7));}_0x491a0d[_0x4d6796[_0xa68b('0x51')][_0xa68b('0xc7')]]=_0x4d6796[_0xa68b('0x51')][_0xa68b('0x92')];})[_0xa68b('0x17')](function(){return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x4d6796['params']['id']},'include':[{'model':db[_0xa68b('0x93')],'as':_0xa68b('0x94')},{'model':db['MailAccount'],'as':_0xa68b('0xc9')}]});})[_0xa68b('0x17')](handleEntityNotFound(_0x448930,null))[_0xa68b('0x17')](function(_0x4fe870){if(_0x4fe870&&_0x4fe870['List']){_0x3995a3=_0x4fe870;var _0x125a28=_['defaults'](_0x4d6796[_0xa68b('0x51')],{'firstName':_0x4d6796[_0xa68b('0x51')][_0xa68b('0x92')],'phone':_0x4d6796[_0xa68b('0x51')]['from'],'ListId':_0x4fe870[_0xa68b('0x8e')]});_0x125a28[_0x4d6796[_0xa68b('0x51')][_0xa68b('0xc7')]]=_0x4d6796[_0xa68b('0x51')][_0xa68b('0x92')];return db[_0xa68b('0x87')]['findOrCreate']({'where':_0x491a0d,'defaults':_0x125a28});}})[_0xa68b('0xca')](function(_0x314fbe){if(_0x314fbe){_0x48f2a5=_0x314fbe;var _0x981bb=fs['readFileSync'](path[_0xa68b('0x77')](config[_0xa68b('0x70')],_0xa68b('0xcb')),_0xa68b('0xcc'));var _0x3ddf25=ejs[_0xa68b('0xcd')](_0x981bb,{'body':_['toPairs'](_0x4d6796[_0xa68b('0x51')][_0xa68b('0x51')]),'bodyTitle':_0x3995a3[_0xa68b('0xce')]});return db['ChatOfflineMessage'][_0xa68b('0x50')]({'body':_0x3ddf25,'plainBody':htmlToText[_0xa68b('0xcf')](_0x3ddf25),'ContactId':_0x314fbe['id'],'ChatWebsiteId':_0x3995a3['id']});}})[_0xa68b('0x17')](function(_0x38afd6){_0x20b942=_0x38afd6;if(_0x5f2f69[_0xa68b('0x4f')]){var _0x54d183=_0x5f2f69['map'](function(_0x29c3b8){return{'name':_0x29c3b8[_0xa68b('0xd0')],'basename':_0x29c3b8[_0xa68b('0x68')],'type':_0x29c3b8[_0xa68b('0xd1')],'ChatOfflineMessageId':_0x38afd6['id']};});_0x596fc5=_0x54d183['map'](_0x4f1267=>{var _0x2e27bb={'filename':_0x4f1267['name'],'path':path[_0xa68b('0x77')](config[_0xa68b('0x70')],_0xa68b('0xd2'),_0xa68b('0xc4'),_0xa68b('0xd3'),'offline-chat',_0x4f1267['basename'])};return _0x2e27bb;});if(!_0x3995a3['openNewInteraction']){return db[_0xa68b('0xd4')]['transaction'](function(_0x168774){return db[_0xa68b('0xd5')]['bulkCreate'](_0x54d183,{'transaction':_0x168774});});}}})['then'](function(){if(_0x20b942){_0x59f516=_0x20b942;return db[_0xa68b('0xc9')][_0xa68b('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0xa68b('0xd6')],'as':_0xa68b('0xd7'),'raw':!![],'include':[{'model':db[_0xa68b('0xd8')],'as':_0xa68b('0xd8'),'raw':!![]}]}]});}})['then'](function(_0x2eec5c){if(_0x2eec5c&&_0x2eec5c[_0xa68b('0xd7')]&&_0x3995a3[_0xa68b('0xd9')]&&_0x3995a3['forwardOfflineAddress']){var _0x9f04f8=_0x2eec5c['getSmtpOptions']();return respondWithRpcPromise(_0xa68b('0xda'),_0xa68b('0xdb'),{'account':_0x9f04f8,'message':{'from':util[_0xa68b('0xa7')](_0xa68b('0xdc'),_0x2eec5c[_0xa68b('0x30')],_0x2eec5c[_0xa68b('0xdd')]||_0x2eec5c[_0xa68b('0xd7')][_0xa68b('0x54')]),'to':_0x3995a3[_0xa68b('0xde')],'subject':_0x3995a3[_0xa68b('0xdf')],'html':_0x59f516[_0xa68b('0x51')],'attachments':_0x596fc5}},client9003)[_0xa68b('0x17')](function(){return _0x59f516;})[_0xa68b('0x4c')](function(_0x39f93f){logger[_0xa68b('0x1e')](_0x39f93f);});}})[_0xa68b('0x17')](function(){if(_0x3995a3&&_0x3995a3[_0xa68b('0xe0')]&&_0x3995a3[_0xa68b('0xe1')]){var _0x152a03=[];if(_0x5f2f69[_0xa68b('0x4f')]){_0x152a03=_0x5f2f69[_0xa68b('0x34')](function(_0x18c8a3){return{'name':_0x18c8a3[_0xa68b('0xd0')],'basename':_0x18c8a3[_0xa68b('0x68')],'type':_0x18c8a3[_0xa68b('0xd1')],'ChatOfflineMessageId':_0x20b942['id']};});}var _0x2ec608;if(!_[_0xa68b('0x75')](_0x3995a3[_0xa68b('0xe2')])){var _0x5cad8c=_[_0xa68b('0x34')](_0x4d6796[_0xa68b('0x51')],function(_0x40e9dd){return _0x40e9dd;});var _0x2c8491=_[_0xa68b('0xe3')](_0x5cad8c)[0x0];var _0x3c2226=_[_0xa68b('0xe4')](_0x2c8491,function(_0x3b5615){return _0x3b5615;});_0x2ec608=_0x3c2226[0x1][_0x3995a3[_0xa68b('0xe2')]];}var _0x28ca5e={'from':_0x48f2a5[_0xa68b('0xdd')],'firstName':_0x48f2a5[_0xa68b('0xb3')],'lastName':_0x48f2a5['lastName'],'mapKey':_0xa68b('0xdd'),'message':{'from':_0x48f2a5[_0xa68b('0xdd')],'to':_0x3995a3[_0xa68b('0xc9')][_0xa68b('0xdd')],'cc':'','subject':_['isNil'](_0x2ec608)?_0x3995a3[_0xa68b('0xdf')]:_0x2ec608,'messageId':'','sentAt':new Date(),'attach':_0x152a03[_0xa68b('0x4f')],'attachments':_0x152a03,'originChannel':_0xa68b('0xe5'),'ChatWebsiteId':_0x3995a3['id'],'ChatOfflineMessageId':_0x59f516['id'],'originTo':_0x3995a3[_0xa68b('0xc9')][_0xa68b('0xdd')]},'body':_0x59f516[_0xa68b('0x51')]};var _0x123008={'account':{'id':_0x3995a3[_0xa68b('0xe1')]},'body':_0x28ca5e,'log':_0xa68b('0xe6')};return respondWithRpcPromise(_0xa68b('0xe6'),_0xa68b('0xe7'),_0x123008,client9001)[_0xa68b('0x17')](function(){return _0x59f516;})[_0xa68b('0x4c')](function(_0x5914be){logger['error'](_0x5914be);});}return;})['then'](function(){if(_0x59f516){return _0x59f516;}})['then'](respondWithResult(_0x448930,null))[_0xa68b('0x4c')](function(_0x4c2960){logger[_0xa68b('0x1e')](_0xa68b('0x4c'),_0x4c2960);for(var _0x30e099 of _0x5f2f69){var _0xb65c21=path[_0xa68b('0x77')](config[_0xa68b('0x70')],'server','files',_0xa68b('0xd3'),'offline-chat',_0x30e099[_0xa68b('0x68')]);fs_extra['remove'](_0xb65c21)[_0xa68b('0x4c')](function(_0x45b1bd){logger['error'](_0xa68b('0xe8'),_0xb65c21,_0x45b1bd);});}});};exports[_0xa68b('0xe9')]=function(_0x339b62,_0x491417){return db[_0xa68b('0xae')]['find']({'where':{'id':_0x339b62[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x491417,null))[_0xa68b('0x17')](function(_0x3d55c7){if(_0x3d55c7){return _0x3d55c7[_0xa68b('0xe9')](_0x339b62[_0xa68b('0x51')]['ids'],_[_0xa68b('0xea')](_0x339b62['body'],[_0xa68b('0xeb'),'id'])||{});}})[_0xa68b('0x17')](respondWithResult(_0x491417,null))[_0xa68b('0x4c')](handleError(_0x491417,null));};exports[_0xa68b('0xec')]=function(_0x5593ea,_0x41635e){var _0x5781e7={'raw':![],'where':{}};var _0x4a5dfb={};var _0x12b436={'count':0x0,'rows':[]};return db[_0xa68b('0x35')][_0xa68b('0x5e')]({'where':{'id':_0x5593ea[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x41635e,null))[_0xa68b('0x17')](function(_0xcc7d8f){if(_0xcc7d8f){_0x4a5dfb[_0xa68b('0x3a')]=_[_0xa68b('0x3b')](db[_0xa68b('0xae')][_0xa68b('0x36')]);_0x4a5dfb[_0xa68b('0x3c')]=_[_0xa68b('0x3b')](_0x5593ea[_0xa68b('0x3c')]);_0x4a5dfb[_0xa68b('0x3d')]=_['intersection'](_0x4a5dfb['model'],_0x4a5dfb[_0xa68b('0x3c')]);_0x5781e7[_0xa68b('0x3f')]=_[_0xa68b('0x3e')](_0x4a5dfb[_0xa68b('0x3a')],qs[_0xa68b('0x40')](_0x5593ea['query'][_0xa68b('0x40')]));_0x5781e7[_0xa68b('0x3f')]=_0x5781e7[_0xa68b('0x3f')][_0xa68b('0x4f')]?_0x5781e7['attributes']:_0x4a5dfb[_0xa68b('0x3a')];if(!_0x5593ea[_0xa68b('0x3c')][_0xa68b('0x41')]('nolimit')){_0x5781e7[_0xa68b('0x26')]=qs[_0xa68b('0x26')](_0x5593ea[_0xa68b('0x3c')][_0xa68b('0x26')]);_0x5781e7[_0xa68b('0x28')]=qs[_0xa68b('0x28')](_0x5593ea[_0xa68b('0x3c')][_0xa68b('0x28')]);}_0x5781e7[_0xa68b('0x64')]=qs[_0xa68b('0x42')](_0x5593ea[_0xa68b('0x3c')][_0xa68b('0x42')]);_0x5781e7[_0xa68b('0x44')]=qs[_0xa68b('0x3d')](_[_0xa68b('0x60')](_0x5593ea[_0xa68b('0x3c')],_0x4a5dfb['filters']));_0x5781e7['where']['ChatWebsiteId']=_0xcc7d8f['id'];if(_0x5593ea[_0xa68b('0x3c')][_0xa68b('0x43')]){_0x5781e7[_0xa68b('0x44')]=_[_0xa68b('0x45')](_0x5781e7['where'],{'$or':_['map'](_0x5781e7[_0xa68b('0x3f')],function(_0x5f2e0b){var _0xe23bca={};_0xe23bca[_0x5f2e0b]={'$like':'%'+_0x5593ea[_0xa68b('0x3c')][_0xa68b('0x43')]+'%'};return _0xe23bca;})});}_0x5781e7=_['merge']({},_0x5781e7,_0x5593ea['options']);return db[_0xa68b('0xae')][_0xa68b('0x27')]({'where':_0x5781e7[_0xa68b('0x44')]})['then'](function(_0x148df1){_0x12b436['count']=_0x148df1;if(_0x5593ea['query'][_0xa68b('0x48')]){_0x5781e7[_0xa68b('0x49')]=[{'model':db[_0xa68b('0x87')],'as':_0xa68b('0xed'),'required':![]},{'model':db[_0xa68b('0xee')],'as':'Owner','attributes':[_0xa68b('0x30'),_0xa68b('0xef'),'internal'],'required':![]},{'model':db[_0xa68b('0xf0')],'as':_0xa68b('0xf1'),'attributes':['id',_0xa68b('0x30'),_0xa68b('0xf2')],'where':_0x5593ea[_0xa68b('0x3c')][_0xa68b('0xf3')]?{'id':_0x5593ea[_0xa68b('0x3c')]['tag']}:undefined,'required':_0x5593ea['query'][_0xa68b('0xf3')]?!![]:![]}];}return db['ChatInteraction'][_0xa68b('0x4a')](_0x5781e7);})[_0xa68b('0x17')](function(_0x39431f){_0x12b436[_0xa68b('0x4b')]=_0x39431f;return _0x12b436;});}})[_0xa68b('0x17')](respondWithFilteredResult(_0x41635e,_0x5781e7))[_0xa68b('0x4c')](handleError(_0x41635e,null));};function iftimePromise(_0x2562bb,_0x378dac){return respondWithRpcPromise(_0xa68b('0xf4'),_0xa68b('0xf5'),{'command':_0x378dac[_0xa68b('0xf6')]?util[_0xa68b('0xa7')]('iftime\x20%s,%s',_0x2562bb[_0xa68b('0xf7')],_0x378dac[_0xa68b('0xf6')]):util[_0xa68b('0xa7')](_0xa68b('0xf8'),_0x2562bb[_0xa68b('0xf7')])},client9002)[_0xa68b('0x17')](function(_0x320290){var _0x5f1644=_0x320290&&_0x320290[_0xa68b('0xf9')](_0xa68b('0xfa'))>=0x0?!![]:![];logger[_0xa68b('0x18')](_0xa68b('0xfb'),_0x378dac['id'],_0x2562bb['id'],_0x2562bb[_0xa68b('0xf7')],_0x5f1644?'ONLINE':_0xa68b('0xfc'),_0x378dac[_0xa68b('0xf6')]?_0x378dac[_0xa68b('0xf6')]:_0xa68b('0xfd'));return _0x5f1644;})[_0xa68b('0x4c')](function(_0xc37715){logger[_0xa68b('0x1e')](_0xa68b('0xfb'),_0x378dac['id'],_0x2562bb['id'],_0x2562bb['interval'],util[_0xa68b('0xfe')](_0xc37715,{'showHidden':![],'depth':null}),_0x378dac[_0xa68b('0xf6')]?_0x378dac[_0xa68b('0xf6')]:_0xa68b('0xfd'));return![];});}exports[_0xa68b('0xf5')]=function(_0x385aae,_0x3c3fe0){var _0xf2564d=0x0;var _0x1e5e65=0x0;var _0x304ff0=![];var _0x4f19e2;var _0x599ade;return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0x385aae['params']['id']},'include':[{'model':db[_0xa68b('0xff')],'as':'Interval','include':[{'model':db[_0xa68b('0xff')],'as':_0xa68b('0x100'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3c3fe0,null))[_0xa68b('0x17')](function(_0x5e008d){if(_0x5e008d){_0x4f19e2=_0x5e008d;return _0x5e008d[_0xa68b('0x101')]({'raw':!![]});}})['then'](function(_0xcf0058){if(_0x4f19e2){if(_0xcf0058){_0x599ade=_0xcf0058;}}return require(_0xa68b('0x72'))[_0xa68b('0x73')]();})[_0xa68b('0x17')](function(_0x48afc8){if(_0x48afc8){_0x1e5e65=_0x48afc8[_0xa68b('0x102')];_0x304ff0=_0x48afc8[_0xa68b('0x74')];}})['then'](function(){return db[_0xa68b('0xae')][_0xa68b('0x27')]({'where':{'closed':![]}});})['then'](function(_0x51a0ff){_0xf2564d=_0x51a0ff;if(_0x1e5e65&&_0x51a0ff>_0x1e5e65){return db[_0xa68b('0x103')][_0xa68b('0x5e')]({'where':{'id':0x1}})[_0xa68b('0x17')](function(_0x1c006c){if(_0x1c006c){_0x1c006c['increment'](_0xa68b('0x104'));}});}})['then'](function(){if(_0x4f19e2['Interval']&&_0x4f19e2[_0xa68b('0xff')][_0xa68b('0x100')]){var _0x945b58=[];for(var _0x32780c=0x0;_0x32780c<_0x4f19e2[_0xa68b('0xff')][_0xa68b('0x100')][_0xa68b('0x4f')];_0x32780c++){var _0x4d4e76=_0x4f19e2[_0xa68b('0xff')][_0xa68b('0x100')][_0x32780c][_0xa68b('0x2c')]({'plain':!![]});_0x945b58[_0xa68b('0xb7')](iftimePromise(_0x4d4e76,_0x4f19e2));}return BPromise[_0xa68b('0x105')](_0x945b58)['then'](function(_0x144710){return _[_0xa68b('0x106')](_0x144710);});}else{return!![];}})[_0xa68b('0x17')](function(_0x32dd04){var _0x5de1bb=fs[_0xa68b('0x107')](path['join'](config[_0xa68b('0x70')],_0xa68b('0x108')),'utf8');var _0xa80a2a={'remote':_0x4f19e2[_0xa68b('0x109')],'query':querystring[_0xa68b('0x1d')](_[_0xa68b('0x45')](_0x4f19e2[_0xa68b('0x2c')]({'plain':!![]}),{'customerIp':_0x385aae['headers']['x-forwarded-for']||_0x385aae[_0xa68b('0x83')][_0xa68b('0x10a')]||_0x385aae[_0xa68b('0x10b')]['remoteAddress']||_0x385aae['ip'],'referer':_0x385aae['headers']['referer'],'openedInteractions':_0xf2564d,'maxInteractions':_0x1e5e65,'virtual':_0x304ff0[_0xa68b('0x102')],'online':_0x32dd04,'custom':_0x304ff0}))[_0xa68b('0x10c')](/'/g,'\x5c\x27')};_0x3c3fe0[_0xa68b('0xc6')](ejs[_0xa68b('0xcd')](Mustache['render'](_0x5de1bb,_0xa80a2a),{'proactiveActions':_0x599ade,'alignment':_0x4f19e2['alignment'],'verticalAlignment':_0x4f19e2[_0xa68b('0x10d')],'div_color':_0x4f19e2[_0xa68b('0xf2')],'labelText':_0x4f19e2[_0xa68b('0x10e')],'text_color':_0x4f19e2[_0xa68b('0x10f')],'text_button_color':_0x4f19e2[_0xa68b('0x110')],'button_color':_0x4f19e2[_0xa68b('0x111')],'background_color':_0x4f19e2['backgroundColor'],'hideWhenOffline':_0x4f19e2[_0xa68b('0x112')],'interval':_0x4f19e2[_0xa68b('0x113')]}));})[_0xa68b('0x4c')](handleError(_0x3c3fe0,null));};exports[_0xa68b('0x114')]=function(_0x9c0744,_0x35b482){var _0x2fa604=_0x9c0744[_0xa68b('0x4e')]['id'];var _0x5251e3=_0x9c0744[_0xa68b('0x51')];var _0x28e987=0xc8;var _0x5a765c=null;return db[_0xa68b('0xd4')]['transaction']({'isolationLevel':db[_0xa68b('0xd4')][_0xa68b('0x115')][_0xa68b('0x116')][_0xa68b('0x117')]},function(_0x4df97c){return db['ChatWebsite'][_0xa68b('0x5e')]({'where':{'id':_0x2fa604},'transaction':_0x4df97c})[_0xa68b('0x17')](function(_0x1c91b7){if(_0x1c91b7){return db[_0xa68b('0x97')][_0xa68b('0x2b')]({'where':{'ChatWebsiteId':_0x2fa604},'transaction':_0x4df97c})[_0xa68b('0x17')](function(){var _0x317ee7=_[_0xa68b('0x34')](_0x5251e3,function(_0x2d4341){_0x2d4341['ChatWebsiteId']=_0x2fa604;return _0x2d4341;});return db[_0xa68b('0x97')][_0xa68b('0x118')](_0x317ee7,{'transaction':_0x4df97c});});}else{_0x28e987=0x194;_0x5a765c=[];}});})[_0xa68b('0x17')](function(){if(_0x28e987!==0x194){return db['ChatApplication'][_0xa68b('0x119')]({'where':{'ChatWebsiteId':_0x2fa604},'order':_0xa68b('0x9d')})[_0xa68b('0x17')](function(_0x412577){_0x5a765c=_0x412577;});}})[_0xa68b('0x4c')](function(_0x5ee83f){_0x28e987=0x1f4;logger['error'](_0x5ee83f['stack']);if(_0x5ee83f[_0xa68b('0x30')]){delete _0x5ee83f[_0xa68b('0x30')];}_0x5a765c=_0x5ee83f;})[_0xa68b('0x11a')](function(){if(_0x5a765c===null){_0x35b482[_0xa68b('0x21')](_0x28e987);}else{if(_0x28e987===0x1f4){_0x35b482[_0xa68b('0x22')](_0x28e987)[_0xa68b('0xc6')](_0x5a765c);}else{_0x35b482[_0xa68b('0x22')](_0x28e987)[_0xa68b('0x24')](_0x5a765c);}}});};exports[_0xa68b('0x11b')]=function(_0x1dd255,_0x52bd36){var _0x3b028c={};var _0x3a370c={};var _0x41575d;var _0x28c1b5;return db['ChatWebsite'][_0xa68b('0x5e')]({'where':{'id':_0x1dd255[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x52bd36,null))[_0xa68b('0x17')](function(_0x136480){if(_0x136480){_0x41575d=_0x136480;_0x3a370c['model']=_[_0xa68b('0x3b')](db[_0xa68b('0x97')]['rawAttributes']);_0x3a370c[_0xa68b('0x3c')]=_[_0xa68b('0x3b')](_0x1dd255[_0xa68b('0x3c')]);_0x3a370c[_0xa68b('0x3d')]=_[_0xa68b('0x3e')](_0x3a370c['model'],_0x3a370c[_0xa68b('0x3c')]);_0x3b028c[_0xa68b('0x3f')]=_[_0xa68b('0x3e')](_0x3a370c['model'],qs[_0xa68b('0x40')](_0x1dd255[_0xa68b('0x3c')]['fields']));_0x3b028c['attributes']=_0x3b028c[_0xa68b('0x3f')][_0xa68b('0x4f')]?_0x3b028c[_0xa68b('0x3f')]:_0x3a370c['model'];_0x3b028c['order']=qs[_0xa68b('0x42')](_0x1dd255[_0xa68b('0x3c')][_0xa68b('0x42')]);_0x3b028c[_0xa68b('0x44')]=qs[_0xa68b('0x3d')](_[_0xa68b('0x60')](_0x1dd255['query'],_0x3a370c[_0xa68b('0x3d')]));if(_0x1dd255[_0xa68b('0x3c')]['filter']){_0x3b028c[_0xa68b('0x44')]=_[_0xa68b('0x45')](_0x3b028c[_0xa68b('0x44')],{'$or':_[_0xa68b('0x34')](_0x3b028c[_0xa68b('0x3f')],function(_0x24b373){var _0x28c59b={};_0x28c59b[_0x24b373]={'$like':'%'+_0x1dd255[_0xa68b('0x3c')]['filter']+'%'};return _0x28c59b;})});}_0x3b028c=_[_0xa68b('0x45')]({},_0x3b028c,_0x1dd255[_0xa68b('0x47')]);return _0x41575d[_0xa68b('0x11b')](_0x3b028c);}})['then'](function(_0x3c8a73){if(_0x3c8a73){_0x28c1b5=_0x3c8a73[_0xa68b('0x4f')];if(!_0x1dd255[_0xa68b('0x3c')]['hasOwnProperty']('nolimit')){_0x3b028c[_0xa68b('0x26')]=qs[_0xa68b('0x26')](_0x1dd255[_0xa68b('0x3c')][_0xa68b('0x26')]);_0x3b028c[_0xa68b('0x28')]=qs[_0xa68b('0x28')](_0x1dd255[_0xa68b('0x3c')][_0xa68b('0x28')]);}return _0x41575d['getApplications'](_0x3b028c);}})[_0xa68b('0x17')](function(_0x3e4aca){if(_0x3e4aca){return _0x3e4aca?{'count':_0x28c1b5,'rows':_0x3e4aca}:null;}})[_0xa68b('0x17')](respondWithResult(_0x52bd36,null))['catch'](handleError(_0x52bd36,null));};exports[_0xa68b('0x11c')]=function(_0x5c3ca5,_0x1e306d){return db[_0xa68b('0x11d')]['find']({'where':{'id':_0x5c3ca5['params']['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x1e306d,null))[_0xa68b('0x17')](function(_0x3d9960){if(_0x3d9960){return _0x3d9960['addProactiveActions'](_0x5c3ca5[_0xa68b('0x51')][_0xa68b('0xeb')],_[_0xa68b('0xea')](_0x5c3ca5['body'],[_0xa68b('0xeb'),'id'])||{});}})[_0xa68b('0x17')](respondWithResult(_0x1e306d,null))[_0xa68b('0x4c')](handleError(_0x1e306d,null));};exports[_0xa68b('0x101')]=function(_0x1751b2,_0x2a688a){var _0x249586={};var _0x2994d5={};var _0x1da71a;var _0x568579;return db[_0xa68b('0x35')][_0xa68b('0x5e')]({'where':{'id':_0x1751b2[_0xa68b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a688a,null))[_0xa68b('0x17')](function(_0x2bce){if(_0x2bce){_0x1da71a=_0x2bce;_0x2994d5[_0xa68b('0x3a')]=_[_0xa68b('0x3b')](db[_0xa68b('0x11e')][_0xa68b('0x36')]);_0x2994d5['query']=_[_0xa68b('0x3b')](_0x1751b2[_0xa68b('0x3c')]);_0x2994d5[_0xa68b('0x3d')]=_['intersection'](_0x2994d5[_0xa68b('0x3a')],_0x2994d5[_0xa68b('0x3c')]);_0x249586[_0xa68b('0x3f')]=_[_0xa68b('0x3e')](_0x2994d5[_0xa68b('0x3a')],qs[_0xa68b('0x40')](_0x1751b2[_0xa68b('0x3c')]['fields']));_0x249586[_0xa68b('0x3f')]=_0x249586[_0xa68b('0x3f')]['length']?_0x249586['attributes']:_0x2994d5['model'];_0x249586['order']=qs[_0xa68b('0x42')](_0x1751b2[_0xa68b('0x3c')][_0xa68b('0x42')]);_0x249586[_0xa68b('0x44')]=qs[_0xa68b('0x3d')](_['pick'](_0x1751b2[_0xa68b('0x3c')],_0x2994d5[_0xa68b('0x3d')]));if(_0x1751b2[_0xa68b('0x3c')]['filter']){_0x249586[_0xa68b('0x44')]=_[_0xa68b('0x45')](_0x249586['where'],{'$or':_['map'](_0x249586[_0xa68b('0x3f')],function(_0x197327){var _0x596173={};_0x596173[_0x197327]={'$like':'%'+_0x1751b2[_0xa68b('0x3c')]['filter']+'%'};return _0x596173;})});}_0x249586=_['merge']({},_0x249586,_0x1751b2[_0xa68b('0x47')]);return _0x1da71a[_0xa68b('0x101')](_0x249586);}})[_0xa68b('0x17')](function(_0x391592){if(_0x391592){_0x568579=_0x391592[_0xa68b('0x4f')];if(!_0x1751b2['query'][_0xa68b('0x41')]('nolimit')){_0x249586[_0xa68b('0x26')]=qs[_0xa68b('0x26')](_0x1751b2['query'][_0xa68b('0x26')]);_0x249586[_0xa68b('0x28')]=qs['offset'](_0x1751b2[_0xa68b('0x3c')][_0xa68b('0x28')]);}return _0x1da71a[_0xa68b('0x101')](_0x249586);}})['then'](function(_0x961fbd){if(_0x961fbd){return _0x961fbd?{'count':_0x568579,'rows':_0x961fbd}:null;}})['then'](respondWithResult(_0x2a688a,null))[_0xa68b('0x4c')](handleError(_0x2a688a,null));};exports[_0xa68b('0x11f')]=function(_0x30fae7,_0x59105b){var _0x41cfa4=_0x30fae7[_0xa68b('0x3c')][_0xa68b('0x120')]==='false'?_0xa68b('0x121'):_0xa68b('0x122');return db[_0xa68b('0x35')]['find']({'attributes':['id',_0x41cfa4],'where':{'id':_0x30fae7['params']['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x59105b,null))['then'](function(_0x2f32bb){if(_0x2f32bb){var _0x29cbf0=_0x2f32bb[_0x41cfa4];var _0x36ad24=_0x29cbf0&&_0x29cbf0[_0xa68b('0x123')]?_0x29cbf0[_0xa68b('0x123')]:[];_0x59105b[_0xa68b('0xc6')]({'fromKey':_[_0xa68b('0x75')](_0x29cbf0[_0xa68b('0x124')])?undefined:_0x29cbf0['fromKey'],'count':_0x36ad24[_0xa68b('0x4f')],'rows':_0x36ad24});}})[_0xa68b('0x4c')](handleError(_0x59105b,null));};exports[_0xa68b('0x125')]=function(_0xdee5f8,_0x4bbaa9){var _0x53c2f8={'raw':![],'where':{}};var _0x269bb2={};var _0x2d2aa7={'count':0x0,'rows':[]};return db[_0xa68b('0x35')]['findOne']({'where':{'id':_0xdee5f8['params']['id']}})['then'](handleEntityNotFound(_0x4bbaa9,null))[_0xa68b('0x17')](function(_0x51d76a){if(_0x51d76a){_0x269bb2[_0xa68b('0x3a')]=_[_0xa68b('0x3b')](db[_0xa68b('0x126')][_0xa68b('0x36')]);_0x269bb2[_0xa68b('0x3c')]=_['keys'](_0xdee5f8['query']);_0x269bb2['filters']=_['intersection'](_0x269bb2[_0xa68b('0x3a')],_0x269bb2[_0xa68b('0x3c')]);_0x53c2f8[_0xa68b('0x3f')]=_[_0xa68b('0x3e')](_0x269bb2[_0xa68b('0x3a')],qs[_0xa68b('0x40')](_0xdee5f8['query'][_0xa68b('0x40')]));_0x53c2f8['attributes']=_0x53c2f8['attributes']['length']?_0x53c2f8[_0xa68b('0x3f')]:_0x269bb2['model'];if(!_0xdee5f8['query']['hasOwnProperty'](_0xa68b('0x5f'))){_0x53c2f8['limit']=qs[_0xa68b('0x26')](_0xdee5f8[_0xa68b('0x3c')][_0xa68b('0x26')]);_0x53c2f8[_0xa68b('0x28')]=qs[_0xa68b('0x28')](_0xdee5f8[_0xa68b('0x3c')][_0xa68b('0x28')]);}_0x53c2f8[_0xa68b('0x64')]=qs[_0xa68b('0x42')](_0xdee5f8[_0xa68b('0x3c')][_0xa68b('0x42')]);_0x53c2f8['where']=qs[_0xa68b('0x3d')](_[_0xa68b('0x60')](_0xdee5f8[_0xa68b('0x3c')],_0x269bb2[_0xa68b('0x3d')]));_0x53c2f8[_0xa68b('0x44')][_0xa68b('0x5b')]=_0x51d76a['id'];if(_0xdee5f8[_0xa68b('0x3c')][_0xa68b('0x43')]){_0x53c2f8['where']=_[_0xa68b('0x45')](_0x53c2f8['where'],{'$or':_[_0xa68b('0x34')](_0x53c2f8[_0xa68b('0x3f')],function(_0x1cdf8d){var _0x134f68={};_0x134f68[_0x1cdf8d]={'$like':'%'+_0xdee5f8[_0xa68b('0x3c')]['filter']+'%'};return _0x134f68;})});}_0x53c2f8=_['merge']({},_0x53c2f8,_0xdee5f8['options']);return db['ChatOfflineMessage'][_0xa68b('0x27')]({'where':_0x53c2f8[_0xa68b('0x44')]})['then'](function(_0x4980cd){_0x2d2aa7[_0xa68b('0x27')]=_0x4980cd;if(_0xdee5f8['query'][_0xa68b('0x48')]){_0x53c2f8['include']=[{'all':!![]}];}else{_0x53c2f8['include']=[{'model':db[_0xa68b('0x87')],'as':_0xa68b('0xed'),'required':![]},{'model':db['Attachment'],'as':_0xa68b('0x127'),'required':![]}];}return db[_0xa68b('0x126')][_0xa68b('0x4a')](_0x53c2f8);})['then'](function(_0x38808c){_0x2d2aa7[_0xa68b('0x4b')]=_0x38808c;return _0x2d2aa7;});}})[_0xa68b('0x17')](respondWithFilteredResult(_0x4bbaa9,_0x53c2f8))[_0xa68b('0x4c')](handleError(_0x4bbaa9,null));};exports[_0xa68b('0x128')]=function(_0x192242,_0x56cc03){return db['ChatWebsite'][_0xa68b('0x55')]({'where':{'id':_0x192242[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x56cc03,null))['then'](function(_0x34c004){if(_0x34c004){return _0x34c004[_0xa68b('0x128')](_0x192242[_0xa68b('0x51')][_0xa68b('0xeb')],_[_0xa68b('0xea')](_0x192242['body'],[_0xa68b('0xeb'),'id'])||{})[_0xa68b('0xca')](function(_0x536849){for(var _0xb91d9b=0x0;_0xb91d9b<_0x192242[_0xa68b('0x51')][_0xa68b('0xeb')][_0xa68b('0x4f')];_0xb91d9b+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x192242['body'][_0xa68b('0xeb')][_0xb91d9b]),'ChatWebsiteId':Number(_0x192242[_0xa68b('0x4e')]['id'])});}return _0x536849;});}})['then'](respondWithResult(_0x56cc03,null))['catch'](handleError(_0x56cc03,null));};exports[_0xa68b('0x129')]=function(_0xdd795b,_0x5a18e7){return db[_0xa68b('0x35')][_0xa68b('0x55')]({'where':{'id':_0xdd795b[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x5a18e7,null))[_0xa68b('0x17')](function(_0x43d463){if(_0x43d463){return _0x43d463[_0xa68b('0x129')](_0xdd795b[_0xa68b('0x3c')][_0xa68b('0xeb')])[_0xa68b('0x17')](function(){if(_['isArray'](_0xdd795b[_0xa68b('0x3c')]['ids'])){for(var _0x154a1f=0x0;_0x154a1f<_0xdd795b[_0xa68b('0x3c')][_0xa68b('0xeb')]['length'];_0x154a1f+=0x1){socket[_0xa68b('0x12a')](_0xa68b('0x12b'),{'UserId':Number(_0xdd795b[_0xa68b('0x3c')]['ids'][_0x154a1f]),'ChatWebsiteId':Number(_0xdd795b['params']['id'])});}}else{socket[_0xa68b('0x12a')](_0xa68b('0x12b'),{'UserId':Number(_0xdd795b['query'][_0xa68b('0xeb')]),'ChatWebsiteId':Number(_0xdd795b[_0xa68b('0x4e')]['id'])});}});}})[_0xa68b('0x17')](respondWithStatusCode(_0x5a18e7,null))[_0xa68b('0x4c')](handleError(_0x5a18e7,null));};exports[_0xa68b('0x12c')]=function(_0x261518,_0x23b3e4){var _0x435a23={};var _0x497e78={};var _0x4a59b3;var _0x193d29;return db[_0xa68b('0x35')]['findOne']({'where':{'id':_0x261518[_0xa68b('0x4e')]['id']}})[_0xa68b('0x17')](handleEntityNotFound(_0x23b3e4,null))['then'](function(_0x47fe45){if(_0x47fe45){_0x4a59b3=_0x47fe45;_0x497e78['model']=_[_0xa68b('0x3b')](db[_0xa68b('0xee')][_0xa68b('0x36')]);_0x497e78[_0xa68b('0x3c')]=_[_0xa68b('0x3b')](_0x261518['query']);_0x497e78[_0xa68b('0x3d')]=_[_0xa68b('0x3e')](_0x497e78[_0xa68b('0x3a')],_0x497e78[_0xa68b('0x3c')]);_0x435a23['attributes']=_[_0xa68b('0x3e')](_0x497e78[_0xa68b('0x3a')],qs[_0xa68b('0x40')](_0x261518[_0xa68b('0x3c')][_0xa68b('0x40')]));_0x435a23[_0xa68b('0x3f')]=_0x435a23[_0xa68b('0x3f')][_0xa68b('0x4f')]?_0x435a23[_0xa68b('0x3f')]:_0x497e78[_0xa68b('0x3a')];_0x435a23['order']=qs['sort'](_0x261518[_0xa68b('0x3c')]['sort']);_0x435a23[_0xa68b('0x44')]=qs[_0xa68b('0x3d')](_[_0xa68b('0x60')](_0x261518[_0xa68b('0x3c')],_0x497e78[_0xa68b('0x3d')]));if(_0x261518[_0xa68b('0x3c')]['filter']){_0x435a23[_0xa68b('0x44')]=_['merge'](_0x435a23[_0xa68b('0x44')],{'$or':_[_0xa68b('0x34')](_0x435a23['attributes'],function(_0x306cf5){var _0x5cbfe7={};_0x5cbfe7[_0x306cf5]={'$like':'%'+_0x261518['query'][_0xa68b('0x43')]+'%'};return _0x5cbfe7;})});}_0x435a23=_[_0xa68b('0x45')]({},_0x435a23,_0x261518[_0xa68b('0x47')]);return _0x4a59b3[_0xa68b('0x12c')](_0x435a23);}})[_0xa68b('0x17')](function(_0x13dc3b){if(_0x13dc3b){_0x193d29=_0x13dc3b[_0xa68b('0x4f')];if(!_0x261518[_0xa68b('0x3c')][_0xa68b('0x41')](_0xa68b('0x5f'))){_0x435a23[_0xa68b('0x26')]=qs[_0xa68b('0x26')](_0x261518[_0xa68b('0x3c')][_0xa68b('0x26')]);_0x435a23[_0xa68b('0x28')]=qs[_0xa68b('0x28')](_0x261518['query']['offset']);}return _0x4a59b3[_0xa68b('0x12c')](_0x435a23);}})[_0xa68b('0x17')](function(_0x4d0bbc){if(_0x4d0bbc){return _0x4d0bbc?{'count':_0x193d29,'rows':_0x4d0bbc}:null;}})[_0xa68b('0x17')](respondWithResult(_0x23b3e4,null))[_0xa68b('0x4c')](handleError(_0x23b3e4,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 7b22e9e..ea95061 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 _0x0f89=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','save','update','remove','emit'];(function(_0x4eb7cb,_0x3ea56e){var _0x373e3b=function(_0x11056b){while(--_0x11056b){_0x4eb7cb['push'](_0x4eb7cb['shift']());}};_0x373e3b(++_0x3ea56e);}(_0x0f89,0x111));var _0x90f8=function(_0x2cae51,_0x4687c0){_0x2cae51=_0x2cae51-0x0;var _0x1cc24e=_0x0f89[_0x2cae51];return _0x1cc24e;};'use strict';var EventEmitter=require(_0x90f8('0x0'));var ChatWebsite=require(_0x90f8('0x1'))['db'][_0x90f8('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90f8('0x3'),'afterUpdate':_0x90f8('0x4'),'afterDestroy':_0x90f8('0x5')};function emitEvent(_0x2bc511){return function(_0x518478,_0x7211af,_0x255b78){ChatWebsiteEvents['emit'](_0x2bc511+':'+_0x518478['id'],_0x518478);ChatWebsiteEvents[_0x90f8('0x6')](_0x2bc511,_0x518478);_0x255b78(null);};}for(var e in events){if(events[_0x90f8('0x7')](e)){var event=events[e];ChatWebsite[_0x90f8('0x8')](e,emitEvent(event));}}module[_0x90f8('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa98d=['hasOwnProperty','hook','exports','events','ChatWebsite','save','update','emit'];(function(_0x4b3ed9,_0x4bb280){var _0x56c9a4=function(_0xa615c8){while(--_0xa615c8){_0x4b3ed9['push'](_0x4b3ed9['shift']());}};_0x56c9a4(++_0x4bb280);}(_0xa98d,0xa3));var _0xda98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa98d[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0xda98('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xda98('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda98('0x2'),'afterUpdate':_0xda98('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5e5a09){return function(_0xf9ae27,_0x3a4432,_0x5ddf11){ChatWebsiteEvents[_0xda98('0x4')](_0x5e5a09+':'+_0xf9ae27['id'],_0xf9ae27);ChatWebsiteEvents[_0xda98('0x4')](_0x5e5a09,_0xf9ae27);_0x5ddf11(null);};}for(var e in events){if(events[_0xda98('0x5')](e)){var event=events[e];ChatWebsite[_0xda98('0x6')](e,emitEvent(event));}}module[_0xda98('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 3feaf67..27c2e8c 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 _0x02ff=['bluebird','path','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x314dd6,_0x8576aa){var _0x53b99c=function(_0x2d4c47){while(--_0x2d4c47){_0x314dd6['push'](_0x314dd6['shift']());}};_0x53b99c(++_0x8576aa);}(_0x02ff,0xc2));var _0xf02f=function(_0x206b4d,_0x18fe60){_0x206b4d=_0x206b4d-0x0;var _0x2f34cb=_0x02ff[_0x206b4d];return _0x2f34cb;};'use strict';var _=require(_0xf02f('0x0'));var util=require(_0xf02f('0x1'));var logger=require(_0xf02f('0x2'))(_0xf02f('0x3'));var moment=require('moment');var BPromise=require(_0xf02f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf02f('0x5'));var rimraf=require('rimraf');var config=require(_0xf02f('0x6'));var attributes=require(_0xf02f('0x7'));module[_0xf02f('0x8')]=function(_0x4ae8b0,_0xf29c96){return _0x4ae8b0[_0xf02f('0x9')]('ChatWebsite',attributes,{'tableName':_0xf02f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8255=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash'];(function(_0x511705,_0x14a5e8){var _0xe6ddee=function(_0x2a70a5){while(--_0x2a70a5){_0x511705['push'](_0x511705['shift']());}};_0xe6ddee(++_0x14a5e8);}(_0x8255,0x99));var _0x5825=function(_0x4b9893,_0x5048e4){_0x4b9893=_0x4b9893-0x0;var _0x4625b9=_0x8255[_0x4b9893];return _0x4625b9;};'use strict';var _=require(_0x5825('0x0'));var util=require(_0x5825('0x1'));var logger=require(_0x5825('0x2'))(_0x5825('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5825('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5825('0x5'));var config=require(_0x5825('0x6'));var attributes=require(_0x5825('0x7'));module['exports']=function(_0x29babe,_0x44e00e){return _0x29babe[_0x5825('0x8')](_0x5825('0x9'),attributes,{'tableName':_0x5825('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 3153fe2..102af6d 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 _0x7e66=['register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket'];(function(_0x417bcc,_0x5c728d){var _0x5b975e=function(_0x175be2){while(--_0x175be2){_0x417bcc['push'](_0x417bcc['shift']());}};_0x5b975e(++_0x5c728d);}(_0x7e66,0xa4));var _0x67e6=function(_0x2cd95f,_0x219f54){_0x2cd95f=_0x2cd95f-0x0;var _0x5ae297=_0x7e66[_0x2cd95f];return _0x5ae297;};'use strict';var _=require(_0x67e6('0x0'));var util=require(_0x67e6('0x1'));var moment=require('moment');var BPromise=require(_0x67e6('0x2'));var rs=require(_0x67e6('0x3'));var fs=require('fs');var Redis=require(_0x67e6('0x4'));var db=require(_0x67e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x67e6('0x6'))(_0x67e6('0x7'));var config=require(_0x67e6('0x8'));var jayson=require(_0x67e6('0x9'));var client=jayson['client'][_0x67e6('0xa')]({'port':0x232a});config[_0x67e6('0xb')]=_[_0x67e6('0xc')](config[_0x67e6('0xb')],{'host':_0x67e6('0xd'),'port':0x18eb});var socket=require(_0x67e6('0xe'))(new Redis(config[_0x67e6('0xb')]));require(_0x67e6('0xf'))[_0x67e6('0x10')](socket);function respondWithRpcPromise(_0x368e5d,_0x34f9ed,_0x42a208){return new BPromise(function(_0x189302,_0x96135e){return client[_0x67e6('0x11')](_0x368e5d,_0x42a208)[_0x67e6('0x12')](function(_0x5c4234){logger[_0x67e6('0x13')](_0x67e6('0x14'),_0x34f9ed,_0x67e6('0x15'));logger[_0x67e6('0x16')](_0x67e6('0x17'),_0x34f9ed,_0x67e6('0x15'),JSON[_0x67e6('0x18')](_0x5c4234));if(_0x5c4234[_0x67e6('0x19')]){if(_0x5c4234['error'][_0x67e6('0x1a')]===0x1f4){logger['error'](_0x67e6('0x14'),_0x34f9ed,_0x5c4234['error'][_0x67e6('0x1b')]);return _0x96135e(_0x5c4234['error'][_0x67e6('0x1b')]);}logger[_0x67e6('0x19')](_0x67e6('0x14'),_0x34f9ed,_0x5c4234['error'][_0x67e6('0x1b')]);return _0x189302(_0x5c4234['error'][_0x67e6('0x1b')]);}else{logger[_0x67e6('0x13')](_0x67e6('0x14'),_0x34f9ed,_0x67e6('0x15'));_0x189302(_0x5c4234[_0x67e6('0x1c')][_0x67e6('0x1b')]);}})[_0x67e6('0x1d')](function(_0x5b10d7){logger['error'](_0x67e6('0x14'),_0x34f9ed,_0x5b10d7);_0x96135e(_0x5b10d7);});});} \ No newline at end of file +var _0xa1b3=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0xa1b3,0x163));var _0x3a1b=function(_0xfbfed8,_0x4de223){_0xfbfed8=_0xfbfed8-0x0;var _0x5e837d=_0xa1b3[_0xfbfed8];return _0x5e837d;};'use strict';var _=require(_0x3a1b('0x0'));var util=require(_0x3a1b('0x1'));var moment=require('moment');var BPromise=require(_0x3a1b('0x2'));var rs=require(_0x3a1b('0x3'));var fs=require('fs');var Redis=require(_0x3a1b('0x4'));var db=require(_0x3a1b('0x5'))['db'];var utils=require(_0x3a1b('0x6'));var logger=require('../../config/logger')(_0x3a1b('0x7'));var config=require(_0x3a1b('0x8'));var jayson=require(_0x3a1b('0x9'));var client=jayson[_0x3a1b('0xa')][_0x3a1b('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3a1b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a1b('0xc')]));require(_0x3a1b('0xd'))[_0x3a1b('0xe')](socket);function respondWithRpcPromise(_0x461bb7,_0x376ece,_0x3a0f31){return new BPromise(function(_0x43a384,_0x16eda8){return client[_0x3a1b('0xf')](_0x461bb7,_0x3a0f31)[_0x3a1b('0x10')](function(_0x3ddcb8){logger[_0x3a1b('0x11')](_0x3a1b('0x12'),_0x376ece,_0x3a1b('0x13'));logger['debug'](_0x3a1b('0x14'),_0x376ece,'request\x20sent',JSON[_0x3a1b('0x15')](_0x3ddcb8));if(_0x3ddcb8[_0x3a1b('0x16')]){if(_0x3ddcb8[_0x3a1b('0x16')][_0x3a1b('0x17')]===0x1f4){logger[_0x3a1b('0x16')](_0x3a1b('0x12'),_0x376ece,_0x3ddcb8[_0x3a1b('0x16')][_0x3a1b('0x18')]);return _0x16eda8(_0x3ddcb8[_0x3a1b('0x16')][_0x3a1b('0x18')]);}logger[_0x3a1b('0x16')](_0x3a1b('0x12'),_0x376ece,_0x3ddcb8[_0x3a1b('0x16')]['message']);return _0x43a384(_0x3ddcb8['error'][_0x3a1b('0x18')]);}else{logger[_0x3a1b('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x376ece,_0x3a1b('0x13'));_0x43a384(_0x3ddcb8[_0x3a1b('0x19')]['message']);}})[_0x3a1b('0x1a')](function(_0xeb217){logger[_0x3a1b('0x16')](_0x3a1b('0x12'),_0x376ece,_0xeb217);_0x16eda8(_0xeb217);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3670766..54470de 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 _0x2415=['chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register','length'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0x2415,0x101));var _0x5241=function(_0x1b15fe,_0x1708dd){_0x1b15fe=_0x1b15fe-0x0;var _0x187524=_0x2415[_0x1b15fe];return _0x187524;};'use strict';var ChatWebsiteEvents=require(_0x5241('0x0'));var events=[_0x5241('0x1'),'remove',_0x5241('0x2')];function createListener(_0x356d0a,_0x312f1e){return function(_0x5dadb2){_0x312f1e[_0x5241('0x3')](_0x356d0a,_0x5dadb2);};}function removeListener(_0x44e9cd,_0x28e956){return function(){ChatWebsiteEvents[_0x5241('0x4')](_0x44e9cd,_0x28e956);};}exports[_0x5241('0x5')]=function(_0x5f1d11){for(var _0x2ee1aa=0x0,_0x465c46=events[_0x5241('0x6')];_0x2ee1aa<_0x465c46;_0x2ee1aa++){var _0x453485=events[_0x2ee1aa];var _0x5b1ea5=createListener(_0x5241('0x7')+_0x453485,_0x5f1d11);ChatWebsiteEvents['on'](_0x453485,_0x5b1ea5);}}; \ No newline at end of file +var _0x6b95=['./chatWebsite.events','remove','update','emit','removeListener','length','chatWebsite:'];(function(_0x53b30d,_0x4e8041){var _0x1a5e40=function(_0x38bcde){while(--_0x38bcde){_0x53b30d['push'](_0x53b30d['shift']());}};_0x1a5e40(++_0x4e8041);}(_0x6b95,0x1a4));var _0x56b9=function(_0x5162e9,_0x1b613c){_0x5162e9=_0x5162e9-0x0;var _0x6dfe81=_0x6b95[_0x5162e9];return _0x6dfe81;};'use strict';var ChatWebsiteEvents=require(_0x56b9('0x0'));var events=['save',_0x56b9('0x1'),_0x56b9('0x2')];function createListener(_0x9d0f76,_0x5bb556){return function(_0x4c43d4){_0x5bb556[_0x56b9('0x3')](_0x9d0f76,_0x4c43d4);};}function removeListener(_0x34952f,_0x29a245){return function(){ChatWebsiteEvents[_0x56b9('0x4')](_0x34952f,_0x29a245);};}exports['register']=function(_0x139fcf){for(var _0x38cd05=0x0,_0x257429=events[_0x56b9('0x5')];_0x38cd05<_0x257429;_0x38cd05++){var _0x486180=events[_0x38cd05];var _0x1d2d91=createListener(_0x56b9('0x6')+_0x486180,_0x139fcf);ChatWebsiteEvents['on'](_0x486180,_0x1d2d91);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4c93567..ae4691b 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 _0x6f10=['getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addAvatar','now','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6f10,0x1f4));var _0x06f1=function(_0x5c870d,_0x2f3ba8){_0x5c870d=_0x5c870d-0x0;var _0x41450e=_0x6f10[_0x5c870d];return _0x41450e;};'use strict';var multer=require(_0x06f1('0x0'));var util=require(_0x06f1('0x1'));var path=require(_0x06f1('0x2'));var timeout=require(_0x06f1('0x3'));var express=require(_0x06f1('0x4'));var router=express[_0x06f1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x06f1('0x6'));var interaction=require(_0x06f1('0x7'));var config=require(_0x06f1('0x8'));var controller=require(_0x06f1('0x9'));router[_0x06f1('0xa')]('/',auth[_0x06f1('0xb')](),controller[_0x06f1('0xc')]);router[_0x06f1('0xa')](_0x06f1('0xd'),auth[_0x06f1('0xb')](),controller[_0x06f1('0xe')]);router[_0x06f1('0xa')](_0x06f1('0xf'),auth['isAuthenticated'](),controller[_0x06f1('0x10')]);router[_0x06f1('0xa')](_0x06f1('0x11'),auth[_0x06f1('0xb')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x06f1('0xb')](),controller[_0x06f1('0x12')]);router[_0x06f1('0xa')](_0x06f1('0x13'),controller['getLogo']);router['get'](_0x06f1('0x14'),controller['getAvatar']);router['get'](_0x06f1('0x15'),controller[_0x06f1('0x16')]);router[_0x06f1('0xa')](_0x06f1('0x17'),controller[_0x06f1('0x18')]);router[_0x06f1('0xa')](_0x06f1('0x19'),auth[_0x06f1('0xb')](),controller['getInteractions']);router[_0x06f1('0xa')]('/:id/snippet',controller[_0x06f1('0x1a')]);router['get'](_0x06f1('0x1b'),auth[_0x06f1('0xb')](),controller[_0x06f1('0x1c')]);router['get']('/:id/proactive_actions',auth[_0x06f1('0xb')](),controller[_0x06f1('0x1d')]);router[_0x06f1('0xa')]('/:id/fields',controller[_0x06f1('0x1e')]);router[_0x06f1('0xa')](_0x06f1('0x1f'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x06f1('0xa')](_0x06f1('0x20'),auth[_0x06f1('0xb')](),controller[_0x06f1('0x21')]);router['post']('/',auth[_0x06f1('0xb')](),controller[_0x06f1('0x22')]);router[_0x06f1('0x23')](_0x06f1('0x11'),auth['isAuthenticated'](),controller[_0x06f1('0x24')]);router[_0x06f1('0x23')](_0x06f1('0x25'),auth[_0x06f1('0xb')](),controller[_0x06f1('0x26')]);var upload=multer({'storage':multer[_0x06f1('0x27')]({'destination':function(_0x50cb64,_0x463c1f,_0x3ef05d){_0x3ef05d(null,path[_0x06f1('0x28')](config[_0x06f1('0x29')],_0x06f1('0x2a')));},'filename':function(_0x31aefb,_0x1c815c,_0x35c533){_0x35c533(null,util[_0x06f1('0x2b')](_0x06f1('0x2c'),Date['now'](),_0x1c815c[_0x06f1('0x2d')]));}})});router[_0x06f1('0x23')]('/:id/logo',upload['single'](_0x06f1('0x2e')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32b922,_0x2fd16c,_0x284b68){_0x284b68(null,path['join'](config[_0x06f1('0x29')],'server/files/images/avatars/'));},'filename':function(_0x316fb4,_0x4e04b8,_0x189736){_0x189736(null,util[_0x06f1('0x2b')]('%s-%s',Date['now'](),_0x4e04b8[_0x06f1('0x2d')]));}})});router['post'](_0x06f1('0x14'),upload['single'](_0x06f1('0x2e')),controller[_0x06f1('0x2f')]);var upload=multer({'storage':multer[_0x06f1('0x27')]({'destination':function(_0x3ce778,_0x579979,_0x1cd60e){_0x1cd60e(null,path['join'](config[_0x06f1('0x29')],'server/files/images/avatars/'));},'filename':function(_0x1dccaf,_0x1769b8,_0xf6edaf){_0xf6edaf(null,util[_0x06f1('0x2b')](_0x06f1('0x2c'),Date[_0x06f1('0x30')](),_0x1769b8['originalname']));}})});router[_0x06f1('0x23')]('/:id/customer_avatar',upload[_0x06f1('0x31')](_0x06f1('0x2e')),controller[_0x06f1('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe613bd,_0x181005,_0x34d22e){_0x34d22e(null,path[_0x06f1('0x28')](config[_0x06f1('0x29')],'server/files/images/avatars/'));},'filename':function(_0xadfd64,_0x5315e3,_0x253809){_0x253809(null,util[_0x06f1('0x2b')](_0x06f1('0x2c'),Date[_0x06f1('0x30')](),_0x5315e3[_0x06f1('0x2d')]));}})});router[_0x06f1('0x23')](_0x06f1('0x17'),upload['single'](_0x06f1('0x2e')),controller[_0x06f1('0x33')]);router['post'](_0x06f1('0x34'),controller[_0x06f1('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x06f1('0x27')]({'destination':function(_0x15e3b,_0x53dadb,_0x4413af){const _0x1c3501=path[_0x06f1('0x28')](config[_0x06f1('0x29')],_0x06f1('0x36'),_0x06f1('0x37'),_0x06f1('0x38'));fs_extra[_0x06f1('0x39')](_0x1c3501,function(){_0x4413af(null,_0x1c3501);});},'filename':function(_0x314882,_0x3976e4,_0x289188){const _0x4bebd9=_0x3976e4['originalname'][_0x06f1('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2e2b2d=path[_0x06f1('0x3b')](_0x4bebd9);const _0x351e92=Date[_0x06f1('0x30')]()+'-'+_0x4bebd9['replace'](_0x2e2b2d,'')+_0x2e2b2d;_0x289188(null,_0x351e92);}})});router[_0x06f1('0x23')](_0x06f1('0x3c'),offlineUploadMulter[_0x06f1('0x3d')](),controller[_0x06f1('0x3e')]);router[_0x06f1('0x23')](_0x06f1('0x19'),auth['isAuthenticated'](),controller[_0x06f1('0x3f')]);router[_0x06f1('0x23')](_0x06f1('0x1b'),auth[_0x06f1('0xb')](),controller[_0x06f1('0x40')]);router['post'](_0x06f1('0x41'),auth[_0x06f1('0xb')](),controller['addProactiveActions']);router[_0x06f1('0x23')](_0x06f1('0x20'),auth['isAuthenticated'](),controller[_0x06f1('0x42')]);router[_0x06f1('0x43')](_0x06f1('0xf'),auth['isAuthenticated'](),controller[_0x06f1('0x44')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x06f1('0x45')]);router[_0x06f1('0x46')](_0x06f1('0x11'),auth[_0x06f1('0xb')](),controller[_0x06f1('0x47')]);router[_0x06f1('0x46')]('/:id/canned_answers',auth[_0x06f1('0xb')](),controller['removeAnswers']);router[_0x06f1('0x46')](_0x06f1('0x20'),auth[_0x06f1('0xb')](),controller[_0x06f1('0x48')]);module[_0x06f1('0x49')]=router; \ No newline at end of file +var _0x1921=['/:id/users','put','update','delete','destroy','/:id/dispositions','removeDispositions','/:id/canned_answers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','/describe','describe','/:id','show','isAuthenticated','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','post','addAnswer','diskStorage','join','server/files/images/logos/','%s-%s','now','single','file','addLogo','root','server/files/images/avatars/','addAvatar','format','originalname','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','offline-chat','replace','any','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions'];(function(_0x4de836,_0x82ac62){var _0x224b7a=function(_0x14f7f8){while(--_0x14f7f8){_0x4de836['push'](_0x4de836['shift']());}};_0x224b7a(++_0x82ac62);}(_0x1921,0xcc));var _0x1192=function(_0x38b27f,_0x4b9a43){_0x38b27f=_0x38b27f-0x0;var _0x5b9c4d=_0x1921[_0x38b27f];return _0x5b9c4d;};'use strict';var multer=require(_0x1192('0x0'));var util=require(_0x1192('0x1'));var path=require(_0x1192('0x2'));var timeout=require(_0x1192('0x3'));var express=require(_0x1192('0x4'));var router=express['Router']();var fs_extra=require(_0x1192('0x5'));var auth=require(_0x1192('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1192('0x7'));var controller=require(_0x1192('0x8'));router[_0x1192('0x9')]('/',auth['isAuthenticated'](),controller[_0x1192('0xa')]);router[_0x1192('0x9')](_0x1192('0xb'),auth['isAuthenticated'](),controller[_0x1192('0xc')]);router[_0x1192('0x9')](_0x1192('0xd'),auth['isAuthenticated'](),controller[_0x1192('0xe')]);router[_0x1192('0x9')]('/:id/dispositions',auth[_0x1192('0xf')](),controller['getDispositions']);router[_0x1192('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1192('0x10')]);router[_0x1192('0x9')](_0x1192('0x11'),controller[_0x1192('0x12')]);router[_0x1192('0x9')]('/:id/avatar',controller[_0x1192('0x13')]);router[_0x1192('0x9')]('/:id/customer_avatar',controller[_0x1192('0x14')]);router['get'](_0x1192('0x15'),controller[_0x1192('0x16')]);router[_0x1192('0x9')](_0x1192('0x17'),auth[_0x1192('0xf')](),controller['getInteractions']);router[_0x1192('0x9')](_0x1192('0x18'),controller['getSnippet']);router[_0x1192('0x9')]('/:id/applications',auth[_0x1192('0xf')](),controller[_0x1192('0x19')]);router[_0x1192('0x9')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x1192('0x1a')]);router['get'](_0x1192('0x1b'),controller[_0x1192('0x1c')]);router[_0x1192('0x9')](_0x1192('0x1d'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x1192('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x1192('0x1e')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1192('0x1e')]('/:id/dispositions',auth[_0x1192('0xf')](),controller['addDisposition']);router[_0x1192('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1192('0x1f')]);var upload=multer({'storage':multer[_0x1192('0x20')]({'destination':function(_0x46f08d,_0x437cea,_0x4c464e){_0x4c464e(null,path[_0x1192('0x21')](config['root'],_0x1192('0x22')));},'filename':function(_0x3a4e0c,_0x18fb52,_0x6c0138){_0x6c0138(null,util['format'](_0x1192('0x23'),Date[_0x1192('0x24')](),_0x18fb52['originalname']));}})});router[_0x1192('0x1e')](_0x1192('0x11'),upload[_0x1192('0x25')](_0x1192('0x26')),controller[_0x1192('0x27')]);var upload=multer({'storage':multer[_0x1192('0x20')]({'destination':function(_0x595e88,_0x3c0134,_0x35f06a){_0x35f06a(null,path[_0x1192('0x21')](config[_0x1192('0x28')],_0x1192('0x29')));},'filename':function(_0x2f9b1e,_0x1d0fca,_0x19e280){_0x19e280(null,util['format'](_0x1192('0x23'),Date[_0x1192('0x24')](),_0x1d0fca['originalname']));}})});router[_0x1192('0x1e')]('/:id/avatar',upload['single'](_0x1192('0x26')),controller[_0x1192('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xcd3898,_0x261b11,_0x41af3f){_0x41af3f(null,path[_0x1192('0x21')](config['root'],_0x1192('0x29')));},'filename':function(_0x1199b2,_0x4feaad,_0x10fa6b){_0x10fa6b(null,util[_0x1192('0x2b')](_0x1192('0x23'),Date[_0x1192('0x24')](),_0x4feaad[_0x1192('0x2c')]));}})});router[_0x1192('0x1e')](_0x1192('0x2d'),upload['single'](_0x1192('0x26')),controller[_0x1192('0x2e')]);var upload=multer({'storage':multer[_0x1192('0x20')]({'destination':function(_0x4576bf,_0x1eff2b,_0x495fbe){_0x495fbe(null,path['join'](config[_0x1192('0x28')],'server/files/images/avatars/'));},'filename':function(_0x469804,_0x9c6534,_0x58e7a0){_0x58e7a0(null,util[_0x1192('0x2b')]('%s-%s',Date[_0x1192('0x24')](),_0x9c6534[_0x1192('0x2c')]));}})});router[_0x1192('0x1e')](_0x1192('0x15'),upload[_0x1192('0x25')]('file'),controller[_0x1192('0x2f')]);router[_0x1192('0x1e')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5f37b2,_0x1381fc,_0x31bac3){const _0x5dd14e=path[_0x1192('0x21')](config[_0x1192('0x28')],'server/files','attachments',_0x1192('0x30'));fs_extra['ensureDir'](_0x5dd14e,function(){_0x31bac3(null,_0x5dd14e);});},'filename':function(_0x512213,_0x31de8a,_0x44cb37){const _0x5eb46d=_0x31de8a[_0x1192('0x2c')][_0x1192('0x31')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x31922f=path['extname'](_0x5eb46d);const _0x2be751=Date[_0x1192('0x24')]()+'-'+_0x5eb46d[_0x1192('0x31')](_0x31922f,'')+_0x31922f;_0x44cb37(null,_0x2be751);}})});router[_0x1192('0x1e')]('/:id/offline',offlineUploadMulter[_0x1192('0x32')](),controller['offline']);router[_0x1192('0x1e')]('/:id/interactions',auth[_0x1192('0xf')](),controller[_0x1192('0x33')]);router[_0x1192('0x1e')](_0x1192('0x34'),auth['isAuthenticated'](),controller[_0x1192('0x35')]);router[_0x1192('0x1e')](_0x1192('0x36'),auth[_0x1192('0xf')](),controller[_0x1192('0x37')]);router['post'](_0x1192('0x38'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1192('0x39')](_0x1192('0xd'),auth['isAuthenticated'](),controller[_0x1192('0x3a')]);router[_0x1192('0x3b')](_0x1192('0xd'),auth[_0x1192('0xf')](),controller[_0x1192('0x3c')]);router[_0x1192('0x3b')](_0x1192('0x3d'),auth[_0x1192('0xf')](),controller[_0x1192('0x3e')]);router[_0x1192('0x3b')](_0x1192('0x3f'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x1192('0x3b')]('/:id/users',auth['isAuthenticated'](),controller[_0x1192('0x40')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 0947cad..5a0819c 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 _0xce9c=['use','isAuthenticated','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce9c,0x1ca));var _0xcce9=function(_0x4299be,_0x224e8f){_0x4299be=_0x4299be-0x0;var _0x540351=_0xce9c[_0x4299be];return _0x540351;};var beaverLogger=require(_0xcce9('0x0'));var express=require('express');var auth=require(_0xcce9('0x1'));var config=require(_0xcce9('0x2'));var router=express[_0xcce9('0x3')]();var isProduction=config[_0xcce9('0x4')]===_0xcce9('0x5')||![];function clientSideLogs(_0x1c6805,_0x840ea6,_0x20e202){var _0x4af872=_0x1c6805['app'][_0xcce9('0x6')](_0xcce9('0x7'));if(!_0x4af872){throw new Error(_0xcce9('0x8'));}return beaverLogger[_0xcce9('0x9')]({'uri':'/client-logs','logger':_0x4af872,'enableCors':!isProduction})(_0x1c6805,_0x840ea6,_0x20e202);}router[_0xcce9('0xa')](auth[_0xcce9('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x5f29=['use','exports','beaver-logger/server','express','../config/environment','Router','env','app','get','/client-logs'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x5f29,0x84));var _0x95f2=function(_0x45321d,_0x58eb4f){_0x45321d=_0x45321d-0x0;var _0x1a999a=_0x5f29[_0x45321d];return _0x1a999a;};var beaverLogger=require(_0x95f2('0x0'));var express=require(_0x95f2('0x1'));var auth=require('../components/auth/service');var config=require(_0x95f2('0x2'));var router=express[_0x95f2('0x3')]();var isProduction=config[_0x95f2('0x4')]==='production'||![];function clientSideLogs(_0xc3b8b2,_0x414800,_0x50a428){var _0x1fcbcf=_0xc3b8b2[_0x95f2('0x5')][_0x95f2('0x6')]('client-side-logger');if(!_0x1fcbcf){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x95f2('0x7'),'logger':_0x1fcbcf,'enableCors':!isProduction})(_0xc3b8b2,_0x414800,_0x50a428);}router[_0x95f2('0x8')](auth['isAuthenticated'](),clientSideLogs);module[_0x95f2('0x9')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 222dc03..9b8df05 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 _0xd355=['TEXT','MicrosoftAzure\x20=>\x20access_token','sequelize','STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x3efbb2,_0xf28fa8){var _0x51ec34=function(_0xff61b){while(--_0xff61b){_0x3efbb2['push'](_0x3efbb2['shift']());}};_0x51ec34(++_0xf28fa8);}(_0xd355,0x183));var _0x5d35=function(_0x544010,_0x94a6ce){_0x544010=_0x544010-0x0;var _0x15443a=_0xd355[_0x544010];return _0x15443a;};'use strict';var Sequelize=require(_0x5d35('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d35('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5d35('0x2')]('AmazonAWS','Google',_0x5d35('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5d35('0x2')](_0x5d35('0x4'),_0x5d35('0x5'))},'data1':{'type':Sequelize[_0x5d35('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x5d35('0x1')],'comment':_0x5d35('0x6')},'data3':{'type':Sequelize['STRING'],'comment':_0x5d35('0x7')},'data4':{'type':Sequelize[_0x5d35('0x1')],'comment':_0x5d35('0x8')},'data5':{'type':Sequelize[_0x5d35('0x9')],'comment':_0x5d35('0xa')},'data6':{'type':Sequelize[_0x5d35('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x5d35('0x9')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xb0c0=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x170ce6,_0x14de47){var _0x3bcc9b=function(_0x444771){while(--_0x444771){_0x170ce6['push'](_0x170ce6['shift']());}};_0x3bcc9b(++_0x14de47);}(_0xb0c0,0x9e));var _0x0b0c=function(_0x420104,_0x1138c2){_0x420104=_0x420104-0x0;var _0x50ec32=_0xb0c0[_0x420104];return _0x50ec32;};'use strict';var Sequelize=require(_0x0b0c('0x0'));module[_0x0b0c('0x1')]={'name':{'type':Sequelize[_0x0b0c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0b0c('0x3')](_0x0b0c('0x4'),_0x0b0c('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b0c('0x3')](_0x0b0c('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x0b0c('0x2')],'comment':_0x0b0c('0x7')},'data2':{'type':Sequelize[_0x0b0c('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x0b0c('0x2')],'comment':_0x0b0c('0x8')},'data4':{'type':Sequelize[_0x0b0c('0x2')],'comment':_0x0b0c('0x9')},'data5':{'type':Sequelize[_0x0b0c('0xa')],'comment':_0x0b0c('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x0b0c('0xc')},'data7':{'type':Sequelize[_0x0b0c('0xa')],'comment':_0x0b0c('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 2c676bd..3298257 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 _0xf0c8=['Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','json','offset','undefined','limit','count','status','set','update','then','destroy','end','stack','name','send','padEnd','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','findOne','user','oauth2MicrosoftCallback','error','get','state','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xf0c8,0x175));var _0x8f0c=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0xf0c8[_0x477491];return _0xac6aec;};'use strict';var _=require(_0x8f0c('0x0'));var Redis=require(_0x8f0c('0x1'));var qs=require(_0x8f0c('0x2'));var encryptor=require(_0x8f0c('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x8f0c('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0x8f0c('0x5'));config[_0x8f0c('0x6')]=_[_0x8f0c('0x7')](config['redis'],{'host':_0x8f0c('0x8'),'port':0x18eb});var socket=require(_0x8f0c('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x8f0c('0x6')]);function respondWithStatusCode(_0x1d1f37,_0x53259a){_0x53259a=_0x53259a||0xcc;return function(_0x2006f9){if(_0x2006f9){return _0x1d1f37[_0x8f0c('0xa')](_0x53259a);}return _0x1d1f37['status'](_0x53259a)['end']();};}function respondWithResult(_0x553bb1,_0x613b9e){_0x613b9e=_0x613b9e||0xc8;return function(_0x2d1c7c){if(_0x2d1c7c){return _0x553bb1['status'](_0x613b9e)[_0x8f0c('0xb')](_0x2d1c7c);}};}function respondWithFilteredResult(_0x4658f1,_0xaa3a76){return function(_0x5a986d){if(_0x5a986d){var _0x143391=typeof _0xaa3a76[_0x8f0c('0xc')]===_0x8f0c('0xd')&&typeof _0xaa3a76[_0x8f0c('0xe')]==='undefined';var _0x2e7d0c=_0x5a986d['count'];var _0x72f0f=_0x143391?0x0:_0xaa3a76[_0x8f0c('0xc')];var _0x5006e0=_0x143391?_0x5a986d[_0x8f0c('0xf')]:_0xaa3a76[_0x8f0c('0xc')]+_0xaa3a76[_0x8f0c('0xe')];var _0x5a314c;if(_0x5006e0>=_0x2e7d0c){_0x5006e0=_0x2e7d0c;_0x5a314c=0xc8;}else{_0x5a314c=0xce;}_0x4658f1[_0x8f0c('0x10')](_0x5a314c);return _0x4658f1[_0x8f0c('0x11')]('Content-Range',_0x72f0f+'-'+_0x5006e0+'/'+_0x2e7d0c)[_0x8f0c('0xb')](_0x5a986d);}return null;};}function saveUpdates(_0x1c1c3e){return function(_0x218937){if(_0x218937){return _0x218937[_0x8f0c('0x12')](_0x1c1c3e)[_0x8f0c('0x13')](function(_0x2b9e2c){return _0x2b9e2c;});}return null;};}function removeEntity(_0x1f0c1c){return function(_0x2160ce){if(_0x2160ce){return _0x2160ce[_0x8f0c('0x14')]()[_0x8f0c('0x13')](function(){_0x1f0c1c[_0x8f0c('0x10')](0xcc)[_0x8f0c('0x15')]();});}};}function handleEntityNotFound(_0x4020e2){return function(_0x163794){if(!_0x163794){_0x4020e2[_0x8f0c('0xa')](0x194);}return _0x163794;};}function handleError(_0x358677,_0x4e2cf6){_0x4e2cf6=_0x4e2cf6||0x1f4;return function(_0x17ed3a){logger['error'](_0x17ed3a[_0x8f0c('0x16')]);if(_0x17ed3a[_0x8f0c('0x17')]){delete _0x17ed3a['name'];}_0x358677[_0x8f0c('0x10')](_0x4e2cf6)[_0x8f0c('0x18')](_0x17ed3a);};}function maskClientSecret(_0x268b9b){return _[_0x8f0c('0x19')](_0x268b9b['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x35cfc9,_0x17b733){var _0x4f6d2f={},_0x1b4f48={},_0x3b7dc3={'count':0x0,'rows':[]};var _0x54f790=_['map'](db['CloudProvider']['rawAttributes'],function(_0xa8e109){return{'name':_0xa8e109[_0x8f0c('0x1a')],'type':_0xa8e109[_0x8f0c('0x1b')]['key']};});_0x1b4f48[_0x8f0c('0x1c')]=_[_0x8f0c('0x1d')](_0x54f790,_0x8f0c('0x17'));_0x1b4f48['query']=_[_0x8f0c('0x1e')](_0x35cfc9[_0x8f0c('0x1f')]);_0x1b4f48['filters']=_[_0x8f0c('0x20')](_0x1b4f48['model'],_0x1b4f48['query']);_0x4f6d2f[_0x8f0c('0x21')]=_[_0x8f0c('0x20')](_0x1b4f48[_0x8f0c('0x1c')],qs[_0x8f0c('0x22')](_0x35cfc9['query'][_0x8f0c('0x22')]));_0x4f6d2f[_0x8f0c('0x21')]=_0x4f6d2f[_0x8f0c('0x21')][_0x8f0c('0x23')]?_0x4f6d2f[_0x8f0c('0x21')]:_0x1b4f48[_0x8f0c('0x1c')];if(!_0x35cfc9[_0x8f0c('0x1f')]['hasOwnProperty'](_0x8f0c('0x24'))){_0x4f6d2f[_0x8f0c('0xe')]=qs['limit'](_0x35cfc9[_0x8f0c('0x1f')][_0x8f0c('0xe')]);_0x4f6d2f['offset']=qs[_0x8f0c('0xc')](_0x35cfc9[_0x8f0c('0x1f')][_0x8f0c('0xc')]);}_0x4f6d2f[_0x8f0c('0x25')]=qs[_0x8f0c('0x26')](_0x35cfc9[_0x8f0c('0x1f')][_0x8f0c('0x26')]);_0x4f6d2f[_0x8f0c('0x27')]=qs[_0x8f0c('0x28')](_[_0x8f0c('0x29')](_0x35cfc9['query'],_0x1b4f48[_0x8f0c('0x28')]),_0x54f790);if(_0x35cfc9['query'][_0x8f0c('0x2a')]){_0x4f6d2f[_0x8f0c('0x27')]=_[_0x8f0c('0x2b')](_0x4f6d2f[_0x8f0c('0x27')],{'$or':_[_0x8f0c('0x1d')](_0x54f790,function(_0x344a72){if(_0x344a72[_0x8f0c('0x1b')]!==_0x8f0c('0x2c')){var _0x343e6b={};_0x343e6b[_0x344a72[_0x8f0c('0x17')]]={'$like':'%'+_0x35cfc9[_0x8f0c('0x1f')][_0x8f0c('0x2a')]+'%'};return _0x343e6b;}})});}_0x4f6d2f=_[_0x8f0c('0x2b')]({},_0x4f6d2f,_0x35cfc9[_0x8f0c('0x2d')]);var _0x37652e={'where':_0x4f6d2f[_0x8f0c('0x27')]};return db[_0x8f0c('0x2e')]['count'](_0x37652e)['then'](function(_0x381720){_0x3b7dc3[_0x8f0c('0xf')]=_0x381720;if(_0x35cfc9['query'][_0x8f0c('0x2f')]){_0x4f6d2f['include']=[{'all':!![]}];}return db[_0x8f0c('0x2e')][_0x8f0c('0x30')](_0x4f6d2f);})[_0x8f0c('0x13')](function(_0x14ec08){_0x3b7dc3[_0x8f0c('0x31')]=_['map'](_0x14ec08,function(_0x3c4704){if(_0x3c4704[_0x8f0c('0x32')]===_0x8f0c('0x33')){var _0x448f20=encryptor[_0x8f0c('0x34')](_0x3c4704[_0x8f0c('0x35')]);_0x3c4704['data3']=maskClientSecret(_0x448f20);}return _0x3c4704;});return _0x3b7dc3;})[_0x8f0c('0x13')](respondWithFilteredResult(_0x17b733,_0x4f6d2f))[_0x8f0c('0x36')](handleError(_0x17b733,null));};exports[_0x8f0c('0x37')]=function(_0x5b1922,_0x32b69a){var _0x1017b5={'raw':!![],'where':{'id':_0x5b1922[_0x8f0c('0x38')]['id']}},_0x42d8c4={};_0x42d8c4[_0x8f0c('0x1c')]=_['keys'](db[_0x8f0c('0x2e')][_0x8f0c('0x39')]);_0x42d8c4[_0x8f0c('0x1f')]=_['keys'](_0x5b1922[_0x8f0c('0x1f')]);_0x42d8c4['filters']=_[_0x8f0c('0x20')](_0x42d8c4[_0x8f0c('0x1c')],_0x42d8c4[_0x8f0c('0x1f')]);_0x1017b5[_0x8f0c('0x21')]=_[_0x8f0c('0x20')](_0x42d8c4[_0x8f0c('0x1c')],qs[_0x8f0c('0x22')](_0x5b1922['query'][_0x8f0c('0x22')]));_0x1017b5[_0x8f0c('0x21')]=_0x1017b5[_0x8f0c('0x21')][_0x8f0c('0x23')]?_0x1017b5['attributes']:_0x42d8c4[_0x8f0c('0x1c')];if(_0x5b1922[_0x8f0c('0x1f')][_0x8f0c('0x2f')]){_0x1017b5['include']=[{'all':!![]}];}_0x1017b5=_[_0x8f0c('0x2b')]({},_0x1017b5,_0x5b1922[_0x8f0c('0x2d')]);return db[_0x8f0c('0x2e')][_0x8f0c('0x3a')](_0x1017b5)[_0x8f0c('0x13')](handleEntityNotFound(_0x32b69a,null))['then'](function(_0x483ddb){if(_0x483ddb[_0x8f0c('0x32')]===_0x8f0c('0x33')){var _0x42346d=encryptor[_0x8f0c('0x34')](_0x483ddb[_0x8f0c('0x35')]);_0x483ddb['data3']=maskClientSecret(_0x42346d);}return _0x483ddb;})[_0x8f0c('0x13')](respondWithResult(_0x32b69a,null))[_0x8f0c('0x36')](handleError(_0x32b69a,null));};exports[_0x8f0c('0x3b')]=function(_0x154d65,_0x51e993){if(!_0x154d65[_0x8f0c('0x3c')][_0x8f0c('0x17')])throw new Error(_0x8f0c('0x3d'));if(!_0x154d65[_0x8f0c('0x3c')][_0x8f0c('0x32')])throw new Error(_0x8f0c('0x3e'));var _0x333403=db[_0x8f0c('0x2e')][_0x8f0c('0x39')]['service'][_0x8f0c('0x3f')];if(!_0x333403[_0x8f0c('0x40')](_0x154d65[_0x8f0c('0x3c')]['service']))throw new Error(_0x8f0c('0x41')+_0x333403[_0x8f0c('0x42')](',\x20'));if(_0x154d65[_0x8f0c('0x3c')][_0x8f0c('0x32')]==='MicrosoftAzure'&&_0x154d65[_0x8f0c('0x3c')][_0x8f0c('0x35')]){_0x154d65[_0x8f0c('0x3c')]['data3']=encryptor['encryptString'](_0x154d65[_0x8f0c('0x3c')]['data3']);}return db[_0x8f0c('0x2e')][_0x8f0c('0x3b')](_0x154d65[_0x8f0c('0x3c')],{})[_0x8f0c('0x13')](respondWithResult(_0x51e993,0xc9))[_0x8f0c('0x36')](handleError(_0x51e993,null));};exports[_0x8f0c('0x12')]=function(_0x24f218,_0x37d0d1){if(_0x24f218[_0x8f0c('0x3c')]['id']){delete _0x24f218[_0x8f0c('0x3c')]['id'];}return db[_0x8f0c('0x2e')][_0x8f0c('0x3a')]({'where':{'id':_0x24f218[_0x8f0c('0x38')]['id']}})['then'](handleEntityNotFound(_0x37d0d1,null))[_0x8f0c('0x13')](function(_0x252812){if(_0x252812[_0x8f0c('0x32')]===_0x8f0c('0x33')&&_0x24f218['body'][_0x8f0c('0x35')]){_0x24f218[_0x8f0c('0x3c')]['data3']=encryptor['encryptString'](_0x24f218[_0x8f0c('0x3c')]['data3']);}return _0x252812;})[_0x8f0c('0x13')](saveUpdates(_0x24f218[_0x8f0c('0x3c')],null))[_0x8f0c('0x13')](respondWithResult(_0x37d0d1,null))[_0x8f0c('0x36')](handleError(_0x37d0d1,null));};exports[_0x8f0c('0x14')]=function(_0x2ce8ce,_0xb751c5){return db[_0x8f0c('0x2e')][_0x8f0c('0x3a')]({'where':{'id':_0x2ce8ce[_0x8f0c('0x38')]['id']}})[_0x8f0c('0x13')](handleEntityNotFound(_0xb751c5,null))['then'](removeEntity(_0xb751c5,null))['catch'](handleError(_0xb751c5,null));};exports['oauth2MicrosoftAuthorize']=function(_0x9d67ff,_0x77e791){return db[_0x8f0c('0x2e')][_0x8f0c('0x43')]({'where':{'id':_0x9d67ff['params']['id']},'raw':!![]})[_0x8f0c('0x13')](function(_0x1ab9c3){if(!_0x1ab9c3)return _0x77e791[_0x8f0c('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x1ab9c3,_0x9d67ff[_0x8f0c('0x44')]['id'])};})[_0x8f0c('0x13')](respondWithResult(_0x77e791,null))['catch'](handleError(_0x77e791,null));};exports[_0x8f0c('0x45')]=function(_0x31dbeb,_0x5f4d0a){var _0x501fdd=_0x31dbeb[_0x8f0c('0x3c')];var _0x127fed;var _0x5cbaab;if(_0x501fdd[_0x8f0c('0x46')])throw _0x501fdd;redis[_0x8f0c('0x47')](_0x501fdd[_0x8f0c('0x48')])[_0x8f0c('0x13')](function(_0x5ac3c3){if(!_0x5ac3c3)throw new Error('Invalid\x20state\x20parameter');_0x127fed=JSON['parse'](_0x5ac3c3);var _0x501bda=Buffer[_0x8f0c('0x49')](_0x501fdd[_0x8f0c('0x48')],_0x8f0c('0x4a'))[_0x8f0c('0x4b')]('ascii');_0x5cbaab=JSON[_0x8f0c('0x4c')](_0x501bda);if(!oauth[_0x8f0c('0x4d')](_0x501fdd[_0x8f0c('0x4e')],_0x127fed[_0x8f0c('0x4f')]))throw new Error(_0x8f0c('0x50'));redis[_0x8f0c('0x51')](_0x501fdd['state']);return oauth[_0x8f0c('0x52')](_0x501fdd[_0x8f0c('0x53')],_0x127fed);})[_0x8f0c('0x13')](function(_0x11cdff){_0x127fed[_0x8f0c('0x54')]=_0x11cdff[_0x8f0c('0x55')];_0x127fed[_0x8f0c('0x56')]=_0x11cdff[_0x8f0c('0x57')];return db[_0x8f0c('0x2e')]['update']({'data5':_0x127fed[_0x8f0c('0x54')],'data6':_0x127fed[_0x8f0c('0x56')]},{'where':{'id':_0x127fed['id']}});})[_0x8f0c('0x13')](function(){oauth[_0x8f0c('0x58')](_0x127fed);socket[_0x8f0c('0x59')]('microsoftAuthorization:success',{'id':_0x5cbaab['id']});return;})['then'](respondWithStatusCode(_0x5f4d0a,null))[_0x8f0c('0x36')](function(_0xb3977d){if(_0x5cbaab){socket['emit'](_0x8f0c('0x5a'),{'id':_0x5cbaab['id']});}if(!_0x127fed){logger[_0x8f0c('0x46')](_0x8f0c('0x5b'),_0xb3977d);return _0x5f4d0a['status'](0x1f4)[_0x8f0c('0x18')](_0xb3977d['message']);}logger[_0x8f0c('0x46')](_0x8f0c('0x5c'),_0x127fed['id'],JSON['stringify'](_0xb3977d));});}; \ No newline at end of file +var _0x1b8c=['includeAll','include','rows','service','decryptString','catch','show','rawAttributes','find','MicrosoftAzure','data3','create','Name\x20parameter\x20not\x20specified','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options'];(function(_0x557a23,_0x3894ff){var _0x599c2b=function(_0x179333){while(--_0x179333){_0x557a23['push'](_0x557a23['shift']());}};_0x599c2b(++_0x3894ff);}(_0x1b8c,0x8d));var _0xc1b8=function(_0xb2e780,_0x1b6730){_0xb2e780=_0xb2e780-0x0;var _0x4a45d3=_0x1b8c[_0xb2e780];return _0x4a45d3;};'use strict';var _=require(_0xc1b8('0x0'));var Redis=require(_0xc1b8('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc1b8('0x2'));var config=require(_0xc1b8('0x3'));var logger=require(_0xc1b8('0x4'))(_0xc1b8('0x5'));var db=require(_0xc1b8('0x6'))['db'];var oauth=require(_0xc1b8('0x7'));config[_0xc1b8('0x8')]=_[_0xc1b8('0x9')](config[_0xc1b8('0x8')],{'host':_0xc1b8('0xa'),'port':0x18eb});var socket=require(_0xc1b8('0xb'))(new Redis(config['redis']));var redis=new Redis(config[_0xc1b8('0x8')]);function respondWithStatusCode(_0x5189a3,_0x3aa189){_0x3aa189=_0x3aa189||0xcc;return function(_0x5e08a2){if(_0x5e08a2){return _0x5189a3[_0xc1b8('0xc')](_0x3aa189);}return _0x5189a3[_0xc1b8('0xd')](_0x3aa189)[_0xc1b8('0xe')]();};}function respondWithResult(_0x416a3d,_0x357286){_0x357286=_0x357286||0xc8;return function(_0x205ff7){if(_0x205ff7){return _0x416a3d[_0xc1b8('0xd')](_0x357286)[_0xc1b8('0xf')](_0x205ff7);}};}function respondWithFilteredResult(_0x1b6e19,_0x1e859f){return function(_0x3f2d51){if(_0x3f2d51){var _0x179b0f=typeof _0x1e859f['offset']==='undefined'&&typeof _0x1e859f[_0xc1b8('0x10')]===_0xc1b8('0x11');var _0x5a0cf6=_0x3f2d51[_0xc1b8('0x12')];var _0x265378=_0x179b0f?0x0:_0x1e859f[_0xc1b8('0x13')];var _0x32c1a4=_0x179b0f?_0x3f2d51[_0xc1b8('0x12')]:_0x1e859f[_0xc1b8('0x13')]+_0x1e859f[_0xc1b8('0x10')];var _0x2c66b2;if(_0x32c1a4>=_0x5a0cf6){_0x32c1a4=_0x5a0cf6;_0x2c66b2=0xc8;}else{_0x2c66b2=0xce;}_0x1b6e19[_0xc1b8('0xd')](_0x2c66b2);return _0x1b6e19['set'](_0xc1b8('0x14'),_0x265378+'-'+_0x32c1a4+'/'+_0x5a0cf6)[_0xc1b8('0xf')](_0x3f2d51);}return null;};}function saveUpdates(_0xecc1ee){return function(_0x48cf0c){if(_0x48cf0c){return _0x48cf0c[_0xc1b8('0x15')](_0xecc1ee)[_0xc1b8('0x16')](function(_0x3d6229){return _0x3d6229;});}return null;};}function removeEntity(_0x5e523d){return function(_0x205181){if(_0x205181){return _0x205181[_0xc1b8('0x17')]()[_0xc1b8('0x16')](function(){_0x5e523d[_0xc1b8('0xd')](0xcc)[_0xc1b8('0xe')]();});}};}function handleEntityNotFound(_0x2bd187){return function(_0x5b3648){if(!_0x5b3648){_0x2bd187['sendStatus'](0x194);}return _0x5b3648;};}function handleError(_0x1c096f,_0x115fa3){_0x115fa3=_0x115fa3||0x1f4;return function(_0x276199){logger[_0xc1b8('0x18')](_0x276199[_0xc1b8('0x19')]);if(_0x276199[_0xc1b8('0x1a')]){delete _0x276199[_0xc1b8('0x1a')];}_0x1c096f[_0xc1b8('0xd')](_0x115fa3)[_0xc1b8('0x1b')](_0x276199);};}function maskClientSecret(_0x31d9f9){return _[_0xc1b8('0x1c')](_0x31d9f9[_0xc1b8('0x1d')](0x0,0x3),0x14,'*');}exports['index']=function(_0x4d2556,_0x5794ff){var _0x170f80={},_0x596428={},_0x1678c5={'count':0x0,'rows':[]};var _0x5beae5=_[_0xc1b8('0x1e')](db[_0xc1b8('0x1f')]['rawAttributes'],function(_0x3a23de){return{'name':_0x3a23de[_0xc1b8('0x20')],'type':_0x3a23de[_0xc1b8('0x21')][_0xc1b8('0x22')]};});_0x596428[_0xc1b8('0x23')]=_['map'](_0x5beae5,_0xc1b8('0x1a'));_0x596428[_0xc1b8('0x24')]=_[_0xc1b8('0x25')](_0x4d2556[_0xc1b8('0x24')]);_0x596428[_0xc1b8('0x26')]=_[_0xc1b8('0x27')](_0x596428[_0xc1b8('0x23')],_0x596428['query']);_0x170f80[_0xc1b8('0x28')]=_[_0xc1b8('0x27')](_0x596428[_0xc1b8('0x23')],qs['fields'](_0x4d2556['query'][_0xc1b8('0x29')]));_0x170f80[_0xc1b8('0x28')]=_0x170f80[_0xc1b8('0x28')]['length']?_0x170f80['attributes']:_0x596428['model'];if(!_0x4d2556['query'][_0xc1b8('0x2a')](_0xc1b8('0x2b'))){_0x170f80['limit']=qs[_0xc1b8('0x10')](_0x4d2556[_0xc1b8('0x24')]['limit']);_0x170f80[_0xc1b8('0x13')]=qs[_0xc1b8('0x13')](_0x4d2556['query'][_0xc1b8('0x13')]);}_0x170f80[_0xc1b8('0x2c')]=qs[_0xc1b8('0x2d')](_0x4d2556[_0xc1b8('0x24')][_0xc1b8('0x2d')]);_0x170f80[_0xc1b8('0x2e')]=qs[_0xc1b8('0x26')](_['pick'](_0x4d2556[_0xc1b8('0x24')],_0x596428[_0xc1b8('0x26')]),_0x5beae5);if(_0x4d2556[_0xc1b8('0x24')]['filter']){_0x170f80[_0xc1b8('0x2e')]=_[_0xc1b8('0x2f')](_0x170f80[_0xc1b8('0x2e')],{'$or':_[_0xc1b8('0x1e')](_0x5beae5,function(_0x58c81e){if(_0x58c81e[_0xc1b8('0x21')]!==_0xc1b8('0x30')){var _0x5e9b98={};_0x5e9b98[_0x58c81e[_0xc1b8('0x1a')]]={'$like':'%'+_0x4d2556[_0xc1b8('0x24')][_0xc1b8('0x31')]+'%'};return _0x5e9b98;}})});}_0x170f80=_[_0xc1b8('0x2f')]({},_0x170f80,_0x4d2556[_0xc1b8('0x32')]);var _0x21797f={'where':_0x170f80[_0xc1b8('0x2e')]};return db[_0xc1b8('0x1f')][_0xc1b8('0x12')](_0x21797f)[_0xc1b8('0x16')](function(_0x494fd8){_0x1678c5['count']=_0x494fd8;if(_0x4d2556['query'][_0xc1b8('0x33')]){_0x170f80[_0xc1b8('0x34')]=[{'all':!![]}];}return db[_0xc1b8('0x1f')]['findAll'](_0x170f80);})[_0xc1b8('0x16')](function(_0x4d67f4){_0x1678c5[_0xc1b8('0x35')]=_[_0xc1b8('0x1e')](_0x4d67f4,function(_0x50af9c){if(_0x50af9c[_0xc1b8('0x36')]==='MicrosoftAzure'){var _0x441ff=encryptor[_0xc1b8('0x37')](_0x50af9c['data3']);_0x50af9c['data3']=maskClientSecret(_0x441ff);}return _0x50af9c;});return _0x1678c5;})[_0xc1b8('0x16')](respondWithFilteredResult(_0x5794ff,_0x170f80))[_0xc1b8('0x38')](handleError(_0x5794ff,null));};exports[_0xc1b8('0x39')]=function(_0x5df23d,_0x1fcfcb){var _0x1e0339={'raw':!![],'where':{'id':_0x5df23d['params']['id']}},_0x3e1527={};_0x3e1527[_0xc1b8('0x23')]=_[_0xc1b8('0x25')](db['CloudProvider'][_0xc1b8('0x3a')]);_0x3e1527['query']=_[_0xc1b8('0x25')](_0x5df23d[_0xc1b8('0x24')]);_0x3e1527[_0xc1b8('0x26')]=_[_0xc1b8('0x27')](_0x3e1527[_0xc1b8('0x23')],_0x3e1527['query']);_0x1e0339[_0xc1b8('0x28')]=_[_0xc1b8('0x27')](_0x3e1527[_0xc1b8('0x23')],qs[_0xc1b8('0x29')](_0x5df23d['query'][_0xc1b8('0x29')]));_0x1e0339['attributes']=_0x1e0339[_0xc1b8('0x28')]['length']?_0x1e0339[_0xc1b8('0x28')]:_0x3e1527[_0xc1b8('0x23')];if(_0x5df23d['query']['includeAll']){_0x1e0339[_0xc1b8('0x34')]=[{'all':!![]}];}_0x1e0339=_[_0xc1b8('0x2f')]({},_0x1e0339,_0x5df23d['options']);return db[_0xc1b8('0x1f')][_0xc1b8('0x3b')](_0x1e0339)[_0xc1b8('0x16')](handleEntityNotFound(_0x1fcfcb,null))[_0xc1b8('0x16')](function(_0x542f56){if(_0x542f56[_0xc1b8('0x36')]===_0xc1b8('0x3c')){var _0x19ddd4=encryptor[_0xc1b8('0x37')](_0x542f56[_0xc1b8('0x3d')]);_0x542f56[_0xc1b8('0x3d')]=maskClientSecret(_0x19ddd4);}return _0x542f56;})[_0xc1b8('0x16')](respondWithResult(_0x1fcfcb,null))['catch'](handleError(_0x1fcfcb,null));};exports[_0xc1b8('0x3e')]=function(_0x4e0925,_0x1908e5){if(!_0x4e0925['body'][_0xc1b8('0x1a')])throw new Error(_0xc1b8('0x3f'));if(!_0x4e0925['body'][_0xc1b8('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5cbdb5=db[_0xc1b8('0x1f')]['rawAttributes'][_0xc1b8('0x36')][_0xc1b8('0x40')];if(!_0x5cbdb5[_0xc1b8('0x41')](_0x4e0925[_0xc1b8('0x42')][_0xc1b8('0x36')]))throw new Error(_0xc1b8('0x43')+_0x5cbdb5[_0xc1b8('0x44')](',\x20'));if(_0x4e0925['body']['service']==='MicrosoftAzure'&&_0x4e0925[_0xc1b8('0x42')][_0xc1b8('0x3d')]){_0x4e0925[_0xc1b8('0x42')][_0xc1b8('0x3d')]=encryptor[_0xc1b8('0x45')](_0x4e0925[_0xc1b8('0x42')][_0xc1b8('0x3d')]);}return db[_0xc1b8('0x1f')]['create'](_0x4e0925['body'],{})[_0xc1b8('0x16')](respondWithResult(_0x1908e5,0xc9))[_0xc1b8('0x38')](handleError(_0x1908e5,null));};exports['update']=function(_0x2b7dae,_0x143f68){if(_0x2b7dae[_0xc1b8('0x42')]['id']){delete _0x2b7dae[_0xc1b8('0x42')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x2b7dae[_0xc1b8('0x46')]['id']}})['then'](handleEntityNotFound(_0x143f68,null))['then'](function(_0x452aa1){if(_0x452aa1[_0xc1b8('0x36')]===_0xc1b8('0x3c')&&_0x2b7dae['body']['data3']){_0x2b7dae[_0xc1b8('0x42')]['data3']=encryptor['encryptString'](_0x2b7dae[_0xc1b8('0x42')]['data3']);}return _0x452aa1;})[_0xc1b8('0x16')](saveUpdates(_0x2b7dae[_0xc1b8('0x42')],null))[_0xc1b8('0x16')](respondWithResult(_0x143f68,null))[_0xc1b8('0x38')](handleError(_0x143f68,null));};exports[_0xc1b8('0x17')]=function(_0x2d1435,_0x1f6a8d){return db['CloudProvider'][_0xc1b8('0x3b')]({'where':{'id':_0x2d1435[_0xc1b8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f6a8d,null))[_0xc1b8('0x16')](removeEntity(_0x1f6a8d,null))[_0xc1b8('0x38')](handleError(_0x1f6a8d,null));};exports[_0xc1b8('0x47')]=function(_0x2d7dfe,_0x5ca603){return db[_0xc1b8('0x1f')]['findOne']({'where':{'id':_0x2d7dfe['params']['id']},'raw':!![]})[_0xc1b8('0x16')](function(_0x384ae3){if(!_0x384ae3)return _0x5ca603[_0xc1b8('0xc')](0x194);return{'url':oauth[_0xc1b8('0x48')](_0x384ae3,_0x2d7dfe[_0xc1b8('0x49')]['id'])};})['then'](respondWithResult(_0x5ca603,null))['catch'](handleError(_0x5ca603,null));};exports[_0xc1b8('0x4a')]=function(_0x75f3d6,_0x379e5d){var _0x3ffb9a=_0x75f3d6[_0xc1b8('0x42')];var _0x132fe7;var _0x2c85d1;if(_0x3ffb9a[_0xc1b8('0x18')])throw _0x3ffb9a;redis['get'](_0x3ffb9a['state'])[_0xc1b8('0x16')](function(_0x500fe){if(!_0x500fe)throw new Error(_0xc1b8('0x4b'));_0x132fe7=JSON[_0xc1b8('0x4c')](_0x500fe);var _0x44cc8c=Buffer['from'](_0x3ffb9a['state'],'base64')['toString'](_0xc1b8('0x4d'));_0x2c85d1=JSON[_0xc1b8('0x4c')](_0x44cc8c);if(!oauth[_0xc1b8('0x4e')](_0x3ffb9a['id_token'],_0x132fe7[_0xc1b8('0x4f')]))throw new Error(_0xc1b8('0x50'));redis[_0xc1b8('0x51')](_0x3ffb9a[_0xc1b8('0x52')]);return oauth[_0xc1b8('0x53')](_0x3ffb9a[_0xc1b8('0x54')],_0x132fe7);})['then'](function(_0x2b4703){_0x132fe7[_0xc1b8('0x55')]=_0x2b4703[_0xc1b8('0x56')];_0x132fe7[_0xc1b8('0x57')]=_0x2b4703[_0xc1b8('0x58')];return db[_0xc1b8('0x1f')][_0xc1b8('0x15')]({'data5':_0x132fe7[_0xc1b8('0x55')],'data6':_0x132fe7['data6']},{'where':{'id':_0x132fe7['id']}});})[_0xc1b8('0x16')](function(){oauth[_0xc1b8('0x59')](_0x132fe7);socket[_0xc1b8('0x5a')](_0xc1b8('0x5b'),{'id':_0x2c85d1['id']});return;})['then'](respondWithStatusCode(_0x379e5d,null))[_0xc1b8('0x38')](function(_0x354ca1){if(_0x2c85d1){socket[_0xc1b8('0x5a')]('microsoftAuthorization:error',{'id':_0x2c85d1['id']});}if(!_0x132fe7){logger[_0xc1b8('0x18')](_0xc1b8('0x5c'),_0x354ca1);return _0x379e5d[_0xc1b8('0xd')](0x1f4)[_0xc1b8('0x1b')](_0x354ca1[_0xc1b8('0x5d')]);}logger[_0xc1b8('0x18')](_0xc1b8('0x5e'),_0x132fe7['id'],JSON[_0xc1b8('0x5f')](_0x354ca1));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 052d146..b0774f7 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 _0x2eb5=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','../../config/logger','moment','bluebird'];(function(_0x316558,_0x569532){var _0x4aca9f=function(_0x5330d7){while(--_0x5330d7){_0x316558['push'](_0x316558['shift']());}};_0x4aca9f(++_0x569532);}(_0x2eb5,0x188));var _0x52eb=function(_0x1aeba5,_0x48d286){_0x1aeba5=_0x1aeba5-0x0;var _0x54499d=_0x2eb5[_0x1aeba5];return _0x54499d;};'use strict';var _=require(_0x52eb('0x0'));var util=require('util');var logger=require(_0x52eb('0x1'))('api');var moment=require(_0x52eb('0x2'));var BPromise=require(_0x52eb('0x3'));var rp=require(_0x52eb('0x4'));var fs=require('fs');var path=require(_0x52eb('0x5'));var rimraf=require(_0x52eb('0x6'));var config=require(_0x52eb('0x7'));var attributes=require(_0x52eb('0x8'));module[_0x52eb('0x9')]=function(_0x938ecf,_0x1aa95e){return _0x938ecf[_0x52eb('0xa')]('CloudProvider',attributes,{'tableName':_0x52eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ade=['define','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x220b09,_0x2cd7f6){var _0x50b125=function(_0x7eff01){while(--_0x7eff01){_0x220b09['push'](_0x220b09['shift']());}};_0x50b125(++_0x2cd7f6);}(_0x0ade,0x178));var _0xe0ad=function(_0x192ff1,_0x410b3){_0x192ff1=_0x192ff1-0x0;var _0x217b14=_0x0ade[_0x192ff1];return _0x217b14;};'use strict';var _=require(_0xe0ad('0x0'));var util=require(_0xe0ad('0x1'));var logger=require(_0xe0ad('0x2'))('api');var moment=require(_0xe0ad('0x3'));var BPromise=require(_0xe0ad('0x4'));var rp=require(_0xe0ad('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe0ad('0x6'));var attributes=require(_0xe0ad('0x7'));module[_0xe0ad('0x8')]=function(_0x12ef21,_0x34832a){return _0x12ef21[_0xe0ad('0x9')]('CloudProvider',attributes,{'tableName':_0xe0ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 3097957..c7f0c08 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 _0x5c3c=['[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../components/encryptor','../../config/environment','../../mysqldb','redis','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','Dynamics365','push','/.default','join','data7','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','form_post','scope','nonce','prompt','oauth2Claims','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','catch','error','authorization_code','intervals','findAll','all'];(function(_0x1e82f1,_0x3db8ce){var _0x961b43=function(_0x3b5ab2){while(--_0x3b5ab2){_0x1e82f1['push'](_0x1e82f1['shift']());}};_0x961b43(++_0x3db8ce);}(_0x5c3c,0x17e));var _0xc5c3=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5c3c[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0xc5c3('0x0'));var crypto=require(_0xc5c3('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0xc5c3('0x2'));var Redis=require('ioredis');var rp=require(_0xc5c3('0x3'));var util=require(_0xc5c3('0x4'));var encryptor=require(_0xc5c3('0x5'));var config=require(_0xc5c3('0x6'));var logger=require('../../config/logger')('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xc5c3('0x7'))['db'];config['redis']=_['defaults'](config[_0xc5c3('0x8')],{'host':_0xc5c3('0x9'),'port':0x18eb});var redis=new Redis(config[_0xc5c3('0x8')]);var MICROSOFT_AUTH_URL=_0xc5c3('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xc5c3('0xb'),_0xc5c3('0xc'),_0xc5c3('0xd'),_0xc5c3('0xe'),_0xc5c3('0xf'),_0xc5c3('0x10'),_0xc5c3('0x11')],'Dynamics365':[_0xc5c3('0xb'),_0xc5c3('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xc5c3('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xc5c3('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4cccbf){var _0x20ec75=_[_0xc5c3('0x14')](AZURE_AUTH_SCOPES[_0x4cccbf[_0xc5c3('0x15')]]);if(_0x4cccbf[_0xc5c3('0x15')]===_0xc5c3('0x16'))_0x20ec75[_0xc5c3('0x17')](_0x4cccbf['data7']+_0xc5c3('0x18'));return _0x20ec75[_0xc5c3('0x19')]('\x20');}function getAccessTokenScope(_0x2ff08b){if(_0x2ff08b['type']==='Outlook365')return _0xc5c3('0xf');if(_0x2ff08b[_0xc5c3('0x15')]===_0xc5c3('0x16'))return _0x2ff08b[_0xc5c3('0x1a')]+_0xc5c3('0x18');}function generateMicrosoftAuthorizationUrl(_0x50a666,_0xd7bdb6){var _0x5f263f=MICROSOFT_AUTH_URL[_0xc5c3('0x1b')](_0xc5c3('0x1c'),_0x50a666[_0xc5c3('0x1d')]);var _0x5c67c6=['code',_0xc5c3('0x1e')];var _0x581cea=Buffer[_0xc5c3('0x1f')](JSON[_0xc5c3('0x20')]({'id':_0xd7bdb6}))[_0xc5c3('0x21')](_0xc5c3('0x22'));var _0x5bdcab=crypto[_0xc5c3('0x23')](0x10)[_0xc5c3('0x21')](_0xc5c3('0x24'));var _0x42f064=getAuthorizationScopes(_0x50a666);var _0x5cc14e=[{'key':_0xc5c3('0x25'),'value':_0x50a666[_0xc5c3('0x26')]},{'key':_0xc5c3('0x27'),'value':encodeURIComponent(_0x5c67c6[_0xc5c3('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x50a666[_0xc5c3('0x28')]},{'key':'response_mode','value':_0xc5c3('0x29')},{'key':_0xc5c3('0x2a'),'value':encodeURIComponent(_0x42f064)},{'key':'state','value':_0x581cea},{'key':_0xc5c3('0x2b'),'value':_0x5bdcab},{'key':_0xc5c3('0x2c'),'value':'login'}];var _0x168bc3=_0x5f263f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc5c3('0x14')](_0x5cc14e,function(_0x1d8aac){return _0x1d8aac['key']+'='+_0x1d8aac['value'];})[_0xc5c3('0x19')]('&');_0x50a666[_0xc5c3('0x2d')]={'issuer':_0x5f263f[_0xc5c3('0x1b')]('oauth2/',''),'audience':_0x50a666['data1'],'state':_0x581cea,'nonce':_0x5bdcab};redis[_0xc5c3('0x2e')](_0x581cea,JSON[_0xc5c3('0x20')](_0x50a666));return _0x168bc3;}function isValidIdToken(_0x4ff279,_0x21c68c){try{var _0x2d79e9=jwt[_0xc5c3('0x2f')](_0x4ff279,{'complete':!![]});var _0x4429dd=_0x2d79e9[_0xc5c3('0x30')];if(_0x4429dd[_0xc5c3('0x31')]!==_0x21c68c[_0xc5c3('0x32')])return![];if(_0x4429dd[_0xc5c3('0x33')]!==_0x21c68c[_0xc5c3('0x34')])return![];if(_0x4429dd[_0xc5c3('0x2b')]!==_0x21c68c[_0xc5c3('0x2b')])return![];if(moment()[_0xc5c3('0x35')](moment[_0xc5c3('0x36')](_0x4429dd[_0xc5c3('0x37')])))return![];return!![];}catch(_0x454bb5){throw _0x454bb5;}}function refreshOauth2MicrosoftAccessToken(_0x233494){return Promise[_0xc5c3('0x38')]()[_0xc5c3('0x39')](function(){if(_0x233494[_0xc5c3('0x3a')])return _0x233494;return db[_0xc5c3('0x3b')][_0xc5c3('0x3c')]({'where':{'id':_0x233494['id']},'raw':!![]});})[_0xc5c3('0x39')](function(_0x46f77a){var _0x691d4f={'grant_type':_0xc5c3('0x3d'),'refresh_token':_0x46f77a[_0xc5c3('0x3e')],'scope':getAccessTokenScope(_0x46f77a),'redirect_uri':_0x46f77a[_0xc5c3('0x28')],'client_id':_0x46f77a[_0xc5c3('0x26')],'client_secret':encryptor[_0xc5c3('0x3f')](_0x46f77a['data3'])};var _0x58f915={'method':_0xc5c3('0x40'),'uri':MICROSOFT_AUTH_URL[_0xc5c3('0x1b')](_0xc5c3('0x1c'),_0x46f77a['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x691d4f,'json':!![]};return rp(_0x58f915);})[_0xc5c3('0x39')](function(_0x174007){_0x233494[_0xc5c3('0x41')]=_0x174007[_0xc5c3('0x42')];_0x233494['data6']=_0x174007[_0xc5c3('0x3d')];return db[_0xc5c3('0x3b')][_0xc5c3('0x43')]({'data5':_0x233494[_0xc5c3('0x41')],'data6':_0x233494[_0xc5c3('0x3e')]},{'where':{'id':_0x233494['id']}});})[_0xc5c3('0x39')](function(){return _0x233494;})[_0xc5c3('0x44')](function(_0x1e7c5f){logger[_0xc5c3('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x233494['id'],_0x1e7c5f);});}function getOauth2MicrosoftAccessToken(_0x54d59f,_0x251156){var _0x518e51={'grant_type':_0xc5c3('0x46'),'code':_0x54d59f,'scope':getAccessTokenScope(_0x251156),'redirect_uri':_0x251156[_0xc5c3('0x28')],'client_id':_0x251156[_0xc5c3('0x26')],'client_secret':encryptor[_0xc5c3('0x3f')](_0x251156[_0xc5c3('0x3a')])};var _0x3190f4={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xc5c3('0x1b')]('{TENANT_ID}',_0x251156[_0xc5c3('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x518e51,'json':!![]};return rp(_0x3190f4);}function startRefreshInterval(_0x1ec791){var _0x45dfa9=schedule[_0xc5c3('0x47')];if(_0x45dfa9[_0x1ec791['id']])clearInterval(_0x45dfa9[_0x1ec791['id']]);_0x45dfa9[_0x1ec791['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1ec791['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc5c3('0x47')]=_0x45dfa9;}function startAllRefreshIntervals(){return db[_0xc5c3('0x3b')][_0xc5c3('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc5c3('0x39')](function(_0x923f20){var _0x35fa55=_0x923f20[_0xc5c3('0x14')](function(_0x3933e6){return refreshOauth2MicrosoftAccessToken(_0x3933e6)[_0xc5c3('0x39')](function(_0x1c8463){startRefreshInterval(_0x1c8463);});});return Promise[_0xc5c3('0x49')](_0x35fa55);})['catch'](function(_0x189e3f){var _0x33a6a7=_0x189e3f?util['inspect'](_0x189e3f,{'showHidden':![],'depth':null}):'';logger[_0xc5c3('0x45')](_0xc5c3('0x4a'),_0x33a6a7);});}module[_0xc5c3('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xff49=['data2','code','id_token','stringify','toString','base64','randomBytes','hex','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','key','value','set','decode','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','decryptString','data3','POST','{TENANT_ID}','access_token','data5','data6','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','all','catch','inspect','exports','lodash','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','/token','map','type','Dynamics365','push','join','Outlook365','data7','/.default','replace'];(function(_0x4bdda3,_0x25f960){var _0x3f8722=function(_0x341120){while(--_0x341120){_0x4bdda3['push'](_0x4bdda3['shift']());}};_0x3f8722(++_0x25f960);}(_0xff49,0x167));var _0x9ff4=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0xff49[_0x19d24c];return _0x2fae8d;};'use strict';var _=require(_0x9ff4('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x9ff4('0x1'));var rp=require(_0x9ff4('0x2'));var util=require(_0x9ff4('0x3'));var encryptor=require(_0x9ff4('0x4'));var config=require(_0x9ff4('0x5'));var logger=require(_0x9ff4('0x6'))(_0x9ff4('0x7'));var schedule=require(_0x9ff4('0x8'));var db=require(_0x9ff4('0x9'))['db'];config[_0x9ff4('0xa')]=_['defaults'](config[_0x9ff4('0xa')],{'host':_0x9ff4('0xb'),'port':0x18eb});var redis=new Redis(config[_0x9ff4('0xa')]);var MICROSOFT_AUTH_URL=_0x9ff4('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9ff4('0xd'),_0x9ff4('0xe'),'offline_access',_0x9ff4('0xf'),_0x9ff4('0x10'),_0x9ff4('0x11')],'Dynamics365':[_0x9ff4('0x12'),_0x9ff4('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x9ff4('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x9ff4('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x15ddfa){var _0x1d7380=_[_0x9ff4('0x16')](AZURE_AUTH_SCOPES[_0x15ddfa[_0x9ff4('0x17')]]);if(_0x15ddfa['type']===_0x9ff4('0x18'))_0x1d7380[_0x9ff4('0x19')](_0x15ddfa['data7']+'/.default');return _0x1d7380[_0x9ff4('0x1a')]('\x20');}function getAccessTokenScope(_0x236e93){if(_0x236e93[_0x9ff4('0x17')]===_0x9ff4('0x1b'))return _0x9ff4('0xf');if(_0x236e93['type']===_0x9ff4('0x18'))return _0x236e93[_0x9ff4('0x1c')]+_0x9ff4('0x1d');}function generateMicrosoftAuthorizationUrl(_0x5313a2,_0x4383d9){var _0x46cd52=MICROSOFT_AUTH_URL[_0x9ff4('0x1e')]('{TENANT_ID}',_0x5313a2[_0x9ff4('0x1f')]);var _0x50c94e=[_0x9ff4('0x20'),_0x9ff4('0x21')];var _0x1f7d80=Buffer['from'](JSON[_0x9ff4('0x22')]({'id':_0x4383d9}))[_0x9ff4('0x23')](_0x9ff4('0x24'));var _0x59687b=crypto[_0x9ff4('0x25')](0x10)[_0x9ff4('0x23')](_0x9ff4('0x26'));var _0x11e9d4=getAuthorizationScopes(_0x5313a2);var _0x7bcf6=[{'key':'client_id','value':_0x5313a2[_0x9ff4('0x27')]},{'key':_0x9ff4('0x28'),'value':encodeURIComponent(_0x50c94e[_0x9ff4('0x1a')]('\x20'))},{'key':_0x9ff4('0x29'),'value':_0x5313a2[_0x9ff4('0x2a')]},{'key':_0x9ff4('0x2b'),'value':_0x9ff4('0x2c')},{'key':_0x9ff4('0x2d'),'value':encodeURIComponent(_0x11e9d4)},{'key':_0x9ff4('0x2e'),'value':_0x1f7d80},{'key':_0x9ff4('0x2f'),'value':_0x59687b},{'key':'prompt','value':_0x9ff4('0x30')}];var _0xd0b760=_0x46cd52+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9ff4('0x16')](_0x7bcf6,function(_0x3f0973){return _0x3f0973[_0x9ff4('0x31')]+'='+_0x3f0973[_0x9ff4('0x32')];})[_0x9ff4('0x1a')]('&');_0x5313a2['oauth2Claims']={'issuer':_0x46cd52[_0x9ff4('0x1e')]('oauth2/',''),'audience':_0x5313a2[_0x9ff4('0x27')],'state':_0x1f7d80,'nonce':_0x59687b};redis[_0x9ff4('0x33')](_0x1f7d80,JSON[_0x9ff4('0x22')](_0x5313a2));return _0xd0b760;}function isValidIdToken(_0x40bd1b,_0x1f92e7){try{var _0x2c799c=jwt[_0x9ff4('0x34')](_0x40bd1b,{'complete':!![]});var _0x4beb17=_0x2c799c['payload'];if(_0x4beb17['iss']!==_0x1f92e7['issuer'])return![];if(_0x4beb17[_0x9ff4('0x35')]!==_0x1f92e7[_0x9ff4('0x36')])return![];if(_0x4beb17['nonce']!==_0x1f92e7['nonce'])return![];if(moment()[_0x9ff4('0x37')](moment[_0x9ff4('0x38')](_0x4beb17[_0x9ff4('0x39')])))return![];return!![];}catch(_0xb632f3){throw _0xb632f3;}}function refreshOauth2MicrosoftAccessToken(_0x228b82){return Promise[_0x9ff4('0x3a')]()[_0x9ff4('0x3b')](function(){if(_0x228b82['data3'])return _0x228b82;return db[_0x9ff4('0x3c')][_0x9ff4('0x3d')]({'where':{'id':_0x228b82['id']},'raw':!![]});})[_0x9ff4('0x3b')](function(_0x171f07){var _0x30d0e8={'grant_type':_0x9ff4('0x3e'),'refresh_token':_0x171f07['data6'],'scope':getAccessTokenScope(_0x171f07),'redirect_uri':_0x171f07[_0x9ff4('0x2a')],'client_id':_0x171f07[_0x9ff4('0x27')],'client_secret':encryptor[_0x9ff4('0x3f')](_0x171f07[_0x9ff4('0x40')])};var _0x17eebf={'method':_0x9ff4('0x41'),'uri':MICROSOFT_AUTH_URL[_0x9ff4('0x1e')](_0x9ff4('0x42'),_0x171f07[_0x9ff4('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x30d0e8,'json':!![]};return rp(_0x17eebf);})[_0x9ff4('0x3b')](function(_0x2cca98){_0x228b82['data5']=_0x2cca98[_0x9ff4('0x43')];_0x228b82['data6']=_0x2cca98['refresh_token'];return db[_0x9ff4('0x3c')]['update']({'data5':_0x228b82[_0x9ff4('0x44')],'data6':_0x228b82[_0x9ff4('0x45')]},{'where':{'id':_0x228b82['id']}});})[_0x9ff4('0x3b')](function(){return _0x228b82;})['catch'](function(_0x354c1b){logger[_0x9ff4('0x46')](_0x9ff4('0x47'),_0x228b82['id'],_0x354c1b);});}function getOauth2MicrosoftAccessToken(_0x1804f8,_0x443cd5){var _0x1a3783={'grant_type':_0x9ff4('0x48'),'code':_0x1804f8,'scope':getAccessTokenScope(_0x443cd5),'redirect_uri':_0x443cd5['data4'],'client_id':_0x443cd5[_0x9ff4('0x27')],'client_secret':encryptor[_0x9ff4('0x3f')](_0x443cd5['data3'])};var _0x5b769b={'method':_0x9ff4('0x41'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x443cd5['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1a3783,'json':!![]};return rp(_0x5b769b);}function startRefreshInterval(_0x684251){var _0x52cd8f=schedule[_0x9ff4('0x49')];if(_0x52cd8f[_0x684251['id']])clearInterval(_0x52cd8f[_0x684251['id']]);_0x52cd8f[_0x684251['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x684251['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9ff4('0x49')]=_0x52cd8f;}function startAllRefreshIntervals(){return db[_0x9ff4('0x3c')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9ff4('0x3b')](function(_0x1b69c8){var _0x2c37e2=_0x1b69c8[_0x9ff4('0x16')](function(_0x28de7e){return refreshOauth2MicrosoftAccessToken(_0x28de7e)[_0x9ff4('0x3b')](function(_0x50bd47){startRefreshInterval(_0x50bd47);});});return Promise[_0x9ff4('0x4a')](_0x2c37e2);})[_0x9ff4('0x4b')](function(_0x246b87){var _0x39ab2d=_0x246b87?util[_0x9ff4('0x4c')](_0x246b87,{'showHidden':![],'depth':null}):'';logger[_0x9ff4('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x39ab2d);});}module[_0x9ff4('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 27104a9..25df8fd 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 _0xd914=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x2472b0,_0x471095){var _0x7cb74c=function(_0x3c25ca){while(--_0x3c25ca){_0x2472b0['push'](_0x2472b0['shift']());}};_0x7cb74c(++_0x471095);}(_0xd914,0x17f));var _0x4d91=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0xd914[_0x45fe9c];return _0x233d48;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ce3,_0x27c0d5,_0x22f2a4){return new BPromise(function(_0x150767,_0x3016c0){return client[_0x4d91('0xb')](_0x175ce3,_0x22f2a4)['then'](function(_0x37bde4){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x27c0d5,'request\x20sent',JSON['stringify'](_0x37bde4));if(_0x37bde4[_0x4d91('0x11')]){if(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')]['message']);return _0x3016c0(_0x37bde4['error'][_0x4d91('0x13')]);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger['info'](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));_0x150767(_0x37bde4[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x554ca8){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x554ca8);_0x3016c0(_0x554ca8);});});} \ No newline at end of file +var _0x1131=['client','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5fda16,_0x3bf048){var _0x46c10a=function(_0x37558d){while(--_0x37558d){_0x5fda16['push'](_0x5fda16['shift']());}};_0x46c10a(++_0x3bf048);}(_0x1131,0x71));var _0x1113=function(_0x5b8590,_0x3a7c08){_0x5b8590=_0x5b8590-0x0;var _0x5e3b2a=_0x1131[_0x5b8590];return _0x5e3b2a;};'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']('CloudProvider,\x20%s,\x20%s',_0x500c86,_0x3e20dd['error'][_0x1113('0x11')]);return _0x458f86(_0x3e20dd[_0x1113('0xf')][_0x1113('0x11')]);}else{logger[_0x1113('0xa')]('CloudProvider,\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);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 0b84f67..b72ce47 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x193d07,_0x41784a){var _0x4337d4=function(_0x374af4){while(--_0x374af4){_0x193d07['push'](_0x193d07['shift']());}};_0x4337d4(++_0x41784a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x48d5fd,_0x5498a0){var _0x245c47=function(_0x27b62b){while(--_0x27b62b){_0x48d5fd['push'](_0x48d5fd['shift']());}};_0x245c47(++_0x5498a0);}(_0x2ef3,0xba));var _0x32ef=function(_0x32182d,_0x15e3f3){_0x32182d=_0x32182d-0x0;var _0x376ee0=_0x2ef3[_0x32182d];return _0x376ee0;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 6cc45a8..1c4a672 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 _0x4919=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4919,0xd7));var _0x9491=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4919[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x9491('0x0'));module[_0x9491('0x1')]={'name':{'type':Sequelize[_0x9491('0x2')],'unique':_0x9491('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9491('0x2')]},'companyId':{'type':Sequelize[_0x9491('0x2')]},'website':{'type':Sequelize[_0x9491('0x2')]},'phone':{'type':Sequelize[_0x9491('0x2')]},'fax':{'type':Sequelize[_0x9491('0x2')]},'type':{'type':Sequelize[_0x9491('0x2')]},'street':{'type':Sequelize[_0x9491('0x2')]},'postalCode':{'type':Sequelize[_0x9491('0x2')]},'city':{'type':Sequelize[_0x9491('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9491('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9491('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x9491('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9491('0x2')]},'description':{'type':Sequelize[_0x9491('0x2')]}}; \ No newline at end of file +var _0x48c4=['exports','STRING','sequelize'];(function(_0x4346bb,_0x21c6f8){var _0x3fd272=function(_0x4ec982){while(--_0x4ec982){_0x4346bb['push'](_0x4346bb['shift']());}};_0x3fd272(++_0x21c6f8);}(_0x48c4,0x134));var _0x448c=function(_0x205273,_0x1de635){_0x205273=_0x205273-0x0;var _0x1a7900=_0x48c4[_0x205273];return _0x1a7900;};'use strict';var Sequelize=require(_0x448c('0x0'));module[_0x448c('0x1')]={'name':{'type':Sequelize[_0x448c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x448c('0x2')]},'companyId':{'type':Sequelize[_0x448c('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x448c('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x448c('0x2')]},'postalCode':{'type':Sequelize[_0x448c('0x2')]},'city':{'type':Sequelize[_0x448c('0x2')]},'country':{'type':Sequelize[_0x448c('0x2')]},'email':{'type':Sequelize[_0x448c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x448c('0x2')]},'sPostalCode':{'type':Sequelize[_0x448c('0x2')]},'sCity':{'type':Sequelize[_0x448c('0x2')]},'sCountry':{'type':Sequelize[_0x448c('0x2')]},'description':{'type':Sequelize[_0x448c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2cd11bd..0afb40e 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 _0xe0a1=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','index','CmCompany','describe','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0a1,0x180));var _0x1e0a=function(_0x92539a,_0x5e56d7){_0x92539a=_0x92539a-0x0;var _0x572c9e=_0xe0a1[_0x92539a];return _0x572c9e;};'use strict';var emlformat=require(_0x1e0a('0x0'));var rimraf=require(_0x1e0a('0x1'));var zipdir=require(_0x1e0a('0x2'));var jsonpatch=require(_0x1e0a('0x3'));var rp=require(_0x1e0a('0x4'));var moment=require(_0x1e0a('0x5'));var BPromise=require(_0x1e0a('0x6'));var Mustache=require('mustache');var util=require(_0x1e0a('0x7'));var path=require(_0x1e0a('0x8'));var sox=require(_0x1e0a('0x9'));var csv=require(_0x1e0a('0xa'));var ejs=require(_0x1e0a('0xb'));var fs=require('fs');var fs_extra=require(_0x1e0a('0xc'));var _=require(_0x1e0a('0xd'));var squel=require('squel');var crypto=require(_0x1e0a('0xe'));var jsforce=require(_0x1e0a('0xf'));var deskjs=require(_0x1e0a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e0a('0x11'));var Redis=require(_0x1e0a('0x12'));var authService=require(_0x1e0a('0x13'));var qs=require(_0x1e0a('0x14'));var as=require(_0x1e0a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e0a('0x16'))('api');var utils=require(_0x1e0a('0x17'));var config=require(_0x1e0a('0x18'));var licenseUtil=require(_0x1e0a('0x19'));var db=require(_0x1e0a('0x1a'))['db'];function respondWithStatusCode(_0x2076ae,_0x54bb74){_0x54bb74=_0x54bb74||0xcc;return function(_0x58a829){if(_0x58a829){return _0x2076ae['sendStatus'](_0x54bb74);}return _0x2076ae['status'](_0x54bb74)[_0x1e0a('0x1b')]();};}function respondWithResult(_0x3f3d79,_0x2014c6){_0x2014c6=_0x2014c6||0xc8;return function(_0x36b7e6){if(_0x36b7e6){return _0x3f3d79[_0x1e0a('0x1c')](_0x2014c6)[_0x1e0a('0x1d')](_0x36b7e6);}};}function respondWithFilteredResult(_0x12854f,_0x9602aa){return function(_0x40f63b){if(_0x40f63b){var _0x271a01=typeof _0x9602aa['offset']===_0x1e0a('0x1e')&&typeof _0x9602aa[_0x1e0a('0x1f')]===_0x1e0a('0x1e');var _0xf80c24=_0x40f63b[_0x1e0a('0x20')];var _0x271ee6=_0x271a01?0x0:_0x9602aa['offset'];var _0x2cfcdd=_0x271a01?_0x40f63b[_0x1e0a('0x20')]:_0x9602aa[_0x1e0a('0x21')]+_0x9602aa['limit'];var _0x37b9ab;if(_0x2cfcdd>=_0xf80c24){_0x2cfcdd=_0xf80c24;_0x37b9ab=0xc8;}else{_0x37b9ab=0xce;}_0x12854f[_0x1e0a('0x1c')](_0x37b9ab);return _0x12854f[_0x1e0a('0x22')](_0x1e0a('0x23'),_0x271ee6+'-'+_0x2cfcdd+'/'+_0xf80c24)[_0x1e0a('0x1d')](_0x40f63b);}return null;};}function patchUpdates(_0x578aa5){return function(_0x4bd5d9){try{jsonpatch[_0x1e0a('0x24')](_0x4bd5d9,_0x578aa5,!![]);}catch(_0x29efaa){return BPromise['reject'](_0x29efaa);}return _0x4bd5d9[_0x1e0a('0x25')]();};}function saveUpdates(_0xd25db6,_0x28ed17){return function(_0x4411b9){if(_0x4411b9){return _0x4411b9[_0x1e0a('0x26')](_0xd25db6)[_0x1e0a('0x27')](function(_0x3a1426){return _0x3a1426;});}return null;};}function removeEntity(_0x4e79a9,_0x35b77e){return function(_0x38988f){if(_0x38988f){return _0x38988f[_0x1e0a('0x28')]()[_0x1e0a('0x27')](function(){var _0x482bb4=_0x38988f[_0x1e0a('0x29')]({'plain':!![]});var _0x41a1e2=_0x1e0a('0x2a');return db[_0x1e0a('0x2b')]['destroy']({'where':{'type':_0x41a1e2,'resourceId':_0x482bb4['id']}})[_0x1e0a('0x27')](function(){return _0x38988f;});})[_0x1e0a('0x27')](function(){_0x4e79a9[_0x1e0a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1856f0,_0xaaef1f){return function(_0x5c1eed){if(!_0x5c1eed){_0x1856f0[_0x1e0a('0x2c')](0x194);}return _0x5c1eed;};}function handleError(_0x1b6366,_0x159b0a){_0x159b0a=_0x159b0a||0x1f4;return function(_0x2aa5e8){logger[_0x1e0a('0x2d')](_0x2aa5e8[_0x1e0a('0x2e')]);if(_0x2aa5e8[_0x1e0a('0x2f')]){delete _0x2aa5e8['name'];}_0x1b6366[_0x1e0a('0x1c')](_0x159b0a)['send'](_0x2aa5e8);};}exports[_0x1e0a('0x30')]=function(_0x3c8aef,_0xb8d6bf){var _0x5af607={},_0xe1299={},_0x5bf682={'count':0x0,'rows':[]};return db[_0x1e0a('0x31')][_0x1e0a('0x32')]()[_0x1e0a('0x27')](function(_0x49f4b2){_0xe1299[_0x1e0a('0x33')]=_['keys'](_0x49f4b2);_0xe1299[_0x1e0a('0x34')]=_[_0x1e0a('0x35')](_0x3c8aef[_0x1e0a('0x34')]);_0xe1299[_0x1e0a('0x36')]=_['intersection'](_0xe1299[_0x1e0a('0x33')],_0xe1299[_0x1e0a('0x34')]);_0x5af607[_0x1e0a('0x37')]=_[_0x1e0a('0x38')](_0xe1299[_0x1e0a('0x33')],qs['fields'](_0x3c8aef[_0x1e0a('0x34')][_0x1e0a('0x39')]));_0x5af607[_0x1e0a('0x37')]=_0x5af607['attributes'][_0x1e0a('0x3a')]?_0x5af607[_0x1e0a('0x37')]:_0xe1299['model'];if(!_0x3c8aef[_0x1e0a('0x34')][_0x1e0a('0x3b')](_0x1e0a('0x3c'))){_0x5af607[_0x1e0a('0x1f')]=qs[_0x1e0a('0x1f')](_0x3c8aef[_0x1e0a('0x34')]['limit']);_0x5af607[_0x1e0a('0x21')]=qs['offset'](_0x3c8aef[_0x1e0a('0x34')]['offset']);}_0x5af607[_0x1e0a('0x3d')]=qs[_0x1e0a('0x3e')](_0x3c8aef[_0x1e0a('0x34')][_0x1e0a('0x3e')]);_0x5af607[_0x1e0a('0x3f')]=qs[_0x1e0a('0x36')](_[_0x1e0a('0x40')](_0x3c8aef['query'],_0xe1299['filters']),_0x49f4b2);if(_0x3c8aef[_0x1e0a('0x34')][_0x1e0a('0x41')]){_0x5af607[_0x1e0a('0x3f')]=_[_0x1e0a('0x42')](_0x5af607['where'],{'$or':_['map'](_0x5af607[_0x1e0a('0x37')],function(_0xb6fea6){var _0x55e2af={};_0x55e2af[_0xb6fea6]={'$like':'%'+_0x3c8aef['query']['filter']+'%'};return _0x55e2af;})});}_0x5af607=_[_0x1e0a('0x42')]({},_0x5af607,_0x3c8aef['options']);var _0x54e0fe={'where':_0x5af607[_0x1e0a('0x3f')]};return db['CmCompany'][_0x1e0a('0x20')](_0x54e0fe)[_0x1e0a('0x27')](function(_0x1c2d2b){_0x5bf682['count']=_0x1c2d2b;if(_0x3c8aef['query'][_0x1e0a('0x43')]){_0x5af607[_0x1e0a('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0x1e0a('0x45')](_0x5af607);})[_0x1e0a('0x27')](function(_0x1701d5){_0x5bf682[_0x1e0a('0x46')]=_0x1701d5;return _0x5bf682;})[_0x1e0a('0x27')](respondWithFilteredResult(_0xb8d6bf,_0x5af607))[_0x1e0a('0x47')](handleError(_0xb8d6bf,null));})[_0x1e0a('0x47')](handleError(_0xb8d6bf,null));};exports[_0x1e0a('0x48')]=function(_0x437be5,_0x576aff){var _0x4c9b8d={'raw':![],'where':{'id':_0x437be5['params']['id']}},_0x258332={};_0x258332[_0x1e0a('0x33')]=_[_0x1e0a('0x35')](db[_0x1e0a('0x31')][_0x1e0a('0x49')]);_0x258332[_0x1e0a('0x34')]=_['keys'](_0x437be5[_0x1e0a('0x34')]);_0x258332[_0x1e0a('0x36')]=_[_0x1e0a('0x38')](_0x258332[_0x1e0a('0x33')],_0x258332[_0x1e0a('0x34')]);_0x4c9b8d[_0x1e0a('0x37')]=_[_0x1e0a('0x38')](_0x258332[_0x1e0a('0x33')],qs[_0x1e0a('0x39')](_0x437be5[_0x1e0a('0x34')]['fields']));_0x4c9b8d[_0x1e0a('0x37')]=_0x4c9b8d[_0x1e0a('0x37')][_0x1e0a('0x3a')]?_0x4c9b8d['attributes']:_0x258332[_0x1e0a('0x33')];if(_0x437be5[_0x1e0a('0x34')]['includeAll']){_0x4c9b8d[_0x1e0a('0x44')]=[{'all':!![]}];}_0x4c9b8d=_[_0x1e0a('0x42')]({},_0x4c9b8d,_0x437be5[_0x1e0a('0x4a')]);return db[_0x1e0a('0x31')][_0x1e0a('0x4b')](_0x4c9b8d)[_0x1e0a('0x27')](handleEntityNotFound(_0x576aff,null))[_0x1e0a('0x27')](respondWithResult(_0x576aff,null))[_0x1e0a('0x47')](handleError(_0x576aff,null));};exports[_0x1e0a('0x4c')]=function(_0xc2ff08,_0x578891){return db[_0x1e0a('0x31')][_0x1e0a('0x4c')](_0xc2ff08[_0x1e0a('0x4d')],{})[_0x1e0a('0x27')](function(_0x3bdd62){var _0x50eeb2=_0xc2ff08[_0x1e0a('0x4e')][_0x1e0a('0x29')]({'plain':!![]});if(!_0x50eeb2)throw new Error(_0x1e0a('0x4f'));if(_0x50eeb2[_0x1e0a('0x50')]===_0x1e0a('0x4e')){var _0x48032d=_0x3bdd62[_0x1e0a('0x29')]({'plain':!![]});var _0x30cb15=_0x1e0a('0x2a');return db[_0x1e0a('0x51')][_0x1e0a('0x4b')]({'where':{'name':_0x30cb15,'userProfileId':_0x50eeb2[_0x1e0a('0x52')]},'raw':!![]})[_0x1e0a('0x27')](function(_0x4bcf4e){if(_0x4bcf4e&&_0x4bcf4e[_0x1e0a('0x53')]===0x0){return db['UserProfileResource'][_0x1e0a('0x4c')]({'name':_0x48032d[_0x1e0a('0x2f')],'resourceId':_0x48032d['id'],'type':_0x4bcf4e[_0x1e0a('0x2f')],'sectionId':_0x4bcf4e['id']},{})['then'](function(){return _0x3bdd62;});}else{return _0x3bdd62;}})[_0x1e0a('0x47')](function(_0x48a33b){logger[_0x1e0a('0x2d')](_0x1e0a('0x54'),_0x48a33b);throw _0x48a33b;});}return _0x3bdd62;})[_0x1e0a('0x27')](respondWithResult(_0x578891,0xc9))['catch'](handleError(_0x578891,null));};exports[_0x1e0a('0x26')]=function(_0x1dbc92,_0x461b02){if(_0x1dbc92[_0x1e0a('0x4d')]['id']){delete _0x1dbc92['body']['id'];}return db[_0x1e0a('0x31')][_0x1e0a('0x4b')]({'where':{'id':_0x1dbc92[_0x1e0a('0x55')]['id']}})[_0x1e0a('0x27')](handleEntityNotFound(_0x461b02,null))[_0x1e0a('0x27')](saveUpdates(_0x1dbc92[_0x1e0a('0x4d')],null))[_0x1e0a('0x27')](respondWithResult(_0x461b02,null))['catch'](handleError(_0x461b02,null));};exports['destroy']=function(_0x109b23,_0x5b53b5){return db['CmCompany'][_0x1e0a('0x4b')]({'where':{'id':_0x109b23[_0x1e0a('0x55')]['id']}})[_0x1e0a('0x27')](handleEntityNotFound(_0x5b53b5,null))[_0x1e0a('0x27')](removeEntity(_0x5b53b5,null))[_0x1e0a('0x47')](handleError(_0x5b53b5,null));};exports[_0x1e0a('0x32')]=function(_0x3911bd,_0x1d0610){return db[_0x1e0a('0x31')][_0x1e0a('0x32')]()[_0x1e0a('0x27')](respondWithResult(_0x1d0610,null))[_0x1e0a('0x47')](handleError(_0x1d0610,null));};exports[_0x1e0a('0x56')]=function(_0x18d749,_0x512316,_0x402f34){return db[_0x1e0a('0x57')][_0x1e0a('0x4b')]({'where':{'id':_0x18d749[_0x1e0a('0x55')]['id']}})[_0x1e0a('0x27')](handleEntityNotFound(_0x512316,null))['then'](function(_0x180145){if(_0x180145){return _0x180145['addContacts'](_0x18d749[_0x1e0a('0x4d')][_0x1e0a('0x58')],_[_0x1e0a('0x59')](_0x18d749[_0x1e0a('0x4d')],[_0x1e0a('0x58'),'id'])||{});}})['then'](respondWithResult(_0x512316,null))[_0x1e0a('0x47')](handleError(_0x512316,null));};exports[_0x1e0a('0x5a')]=function(_0x7111e7,_0x40b267,_0x4dc22a){var _0x41d254={};var _0x11d719={};var _0x1959e0;var _0x35d722;return db['CmCompany'][_0x1e0a('0x5b')]({'where':{'id':_0x7111e7[_0x1e0a('0x55')]['id']}})['then'](handleEntityNotFound(_0x40b267,null))['then'](function(_0xced44b){if(_0xced44b){_0x1959e0=_0xced44b;_0x11d719[_0x1e0a('0x33')]=_[_0x1e0a('0x35')](db['CmContact'][_0x1e0a('0x49')]);_0x11d719[_0x1e0a('0x34')]=_['keys'](_0x7111e7[_0x1e0a('0x34')]);_0x11d719[_0x1e0a('0x36')]=_['intersection'](_0x11d719['model'],_0x11d719[_0x1e0a('0x34')]);_0x41d254[_0x1e0a('0x37')]=_[_0x1e0a('0x38')](_0x11d719[_0x1e0a('0x33')],qs[_0x1e0a('0x39')](_0x7111e7[_0x1e0a('0x34')][_0x1e0a('0x39')]));_0x41d254[_0x1e0a('0x37')]=_0x41d254[_0x1e0a('0x37')][_0x1e0a('0x3a')]?_0x41d254['attributes']:_0x11d719[_0x1e0a('0x33')];_0x41d254[_0x1e0a('0x3d')]=qs[_0x1e0a('0x3e')](_0x7111e7['query'][_0x1e0a('0x3e')]);_0x41d254['where']=qs[_0x1e0a('0x36')](_[_0x1e0a('0x40')](_0x7111e7[_0x1e0a('0x34')],_0x11d719[_0x1e0a('0x36')]));if(_0x7111e7[_0x1e0a('0x34')][_0x1e0a('0x41')]){_0x41d254[_0x1e0a('0x3f')]=_['merge'](_0x41d254['where'],{'$or':_['map'](_0x41d254['attributes'],function(_0x23f848){var _0x5b6ddd={};_0x5b6ddd[_0x23f848]={'$like':'%'+_0x7111e7[_0x1e0a('0x34')][_0x1e0a('0x41')]+'%'};return _0x5b6ddd;})});}_0x41d254=_[_0x1e0a('0x42')]({},_0x41d254,_0x7111e7[_0x1e0a('0x4a')]);return _0x1959e0[_0x1e0a('0x5a')](_0x41d254);}})['then'](function(_0x1a4a60){if(_0x1a4a60){_0x35d722=_0x1a4a60[_0x1e0a('0x3a')];if(!_0x7111e7[_0x1e0a('0x34')]['hasOwnProperty']('nolimit')){_0x41d254[_0x1e0a('0x1f')]=qs[_0x1e0a('0x1f')](_0x7111e7[_0x1e0a('0x34')][_0x1e0a('0x1f')]);_0x41d254[_0x1e0a('0x21')]=qs[_0x1e0a('0x21')](_0x7111e7['query']['offset']);}return _0x1959e0[_0x1e0a('0x5a')](_0x41d254);}})[_0x1e0a('0x27')](function(_0x120b25){if(_0x120b25){return _0x120b25?{'count':_0x35d722,'rows':_0x120b25}:null;}})[_0x1e0a('0x27')](respondWithResult(_0x40b267,null))[_0x1e0a('0x47')](handleError(_0x40b267,null));}; \ No newline at end of file +var _0xf0e6=['request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','then','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x356527,_0x3e536b){var _0x1d8923=function(_0x11db9c){while(--_0x11db9c){_0x356527['push'](_0x356527['shift']());}};_0x1d8923(++_0x3e536b);}(_0xf0e6,0x1af));var _0x6f0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf0e6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6f0e('0x0'));var rimraf=require(_0x6f0e('0x1'));var zipdir=require(_0x6f0e('0x2'));var jsonpatch=require(_0x6f0e('0x3'));var rp=require(_0x6f0e('0x4'));var moment=require('moment');var BPromise=require(_0x6f0e('0x5'));var Mustache=require(_0x6f0e('0x6'));var util=require('util');var path=require(_0x6f0e('0x7'));var sox=require(_0x6f0e('0x8'));var csv=require(_0x6f0e('0x9'));var ejs=require(_0x6f0e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f0e('0xb'));var squel=require(_0x6f0e('0xc'));var crypto=require('crypto');var jsforce=require(_0x6f0e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6f0e('0x9'));var querystring=require('querystring');var Papa=require(_0x6f0e('0xe'));var Redis=require(_0x6f0e('0xf'));var authService=require(_0x6f0e('0x10'));var qs=require(_0x6f0e('0x11'));var as=require(_0x6f0e('0x12'));var hardwareService=require(_0x6f0e('0x13'));var logger=require(_0x6f0e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6f0e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f0e('0x16'))['db'];function respondWithStatusCode(_0xa1aec,_0x84392){_0x84392=_0x84392||0xcc;return function(_0x29b973){if(_0x29b973){return _0xa1aec[_0x6f0e('0x17')](_0x84392);}return _0xa1aec[_0x6f0e('0x18')](_0x84392)['end']();};}function respondWithResult(_0x663aa5,_0x109ee){_0x109ee=_0x109ee||0xc8;return function(_0x3f6586){if(_0x3f6586){return _0x663aa5[_0x6f0e('0x18')](_0x109ee)[_0x6f0e('0x19')](_0x3f6586);}};}function respondWithFilteredResult(_0x3585d9,_0x1ad0d1){return function(_0x172056){if(_0x172056){var _0x594ac1=typeof _0x1ad0d1['offset']===_0x6f0e('0x1a')&&typeof _0x1ad0d1[_0x6f0e('0x1b')]==='undefined';var _0x551368=_0x172056['count'];var _0x5b7486=_0x594ac1?0x0:_0x1ad0d1['offset'];var _0x259380=_0x594ac1?_0x172056[_0x6f0e('0x1c')]:_0x1ad0d1[_0x6f0e('0x1d')]+_0x1ad0d1['limit'];var _0xdf30c0;if(_0x259380>=_0x551368){_0x259380=_0x551368;_0xdf30c0=0xc8;}else{_0xdf30c0=0xce;}_0x3585d9['status'](_0xdf30c0);return _0x3585d9['set'](_0x6f0e('0x1e'),_0x5b7486+'-'+_0x259380+'/'+_0x551368)[_0x6f0e('0x19')](_0x172056);}return null;};}function patchUpdates(_0x5de194){return function(_0x5f3cd2){try{jsonpatch[_0x6f0e('0x1f')](_0x5f3cd2,_0x5de194,!![]);}catch(_0xdc383b){return BPromise['reject'](_0xdc383b);}return _0x5f3cd2[_0x6f0e('0x20')]();};}function saveUpdates(_0x2c5ac3,_0x30c917){return function(_0x4b6fd1){if(_0x4b6fd1){return _0x4b6fd1['update'](_0x2c5ac3)['then'](function(_0x273fe5){return _0x273fe5;});}return null;};}function removeEntity(_0x1c2644,_0x47d65c){return function(_0x51f59c){if(_0x51f59c){return _0x51f59c[_0x6f0e('0x21')]()[_0x6f0e('0x22')](function(){var _0x2d6a11=_0x51f59c[_0x6f0e('0x23')]({'plain':!![]});var _0x232fbd=_0x6f0e('0x24');return db[_0x6f0e('0x25')][_0x6f0e('0x21')]({'where':{'type':_0x232fbd,'resourceId':_0x2d6a11['id']}})['then'](function(){return _0x51f59c;});})[_0x6f0e('0x22')](function(){_0x1c2644[_0x6f0e('0x18')](0xcc)[_0x6f0e('0x26')]();});}};}function handleEntityNotFound(_0x507918,_0x2efd8c){return function(_0xa5d5dc){if(!_0xa5d5dc){_0x507918[_0x6f0e('0x17')](0x194);}return _0xa5d5dc;};}function handleError(_0x58f3f5,_0x1eda01){_0x1eda01=_0x1eda01||0x1f4;return function(_0x3f01b3){logger['error'](_0x3f01b3[_0x6f0e('0x27')]);if(_0x3f01b3[_0x6f0e('0x28')]){delete _0x3f01b3[_0x6f0e('0x28')];}_0x58f3f5[_0x6f0e('0x18')](_0x1eda01)[_0x6f0e('0x29')](_0x3f01b3);};}exports[_0x6f0e('0x2a')]=function(_0x13d083,_0x3a2b66){var _0x48fa96={},_0x443e7e={},_0x1e0fcb={'count':0x0,'rows':[]};return db[_0x6f0e('0x2b')][_0x6f0e('0x2c')]()[_0x6f0e('0x22')](function(_0x5c4691){_0x443e7e[_0x6f0e('0x2d')]=_['keys'](_0x5c4691);_0x443e7e['query']=_['keys'](_0x13d083[_0x6f0e('0x2e')]);_0x443e7e[_0x6f0e('0x2f')]=_[_0x6f0e('0x30')](_0x443e7e[_0x6f0e('0x2d')],_0x443e7e['query']);_0x48fa96[_0x6f0e('0x31')]=_['intersection'](_0x443e7e[_0x6f0e('0x2d')],qs[_0x6f0e('0x32')](_0x13d083[_0x6f0e('0x2e')]['fields']));_0x48fa96[_0x6f0e('0x31')]=_0x48fa96['attributes'][_0x6f0e('0x33')]?_0x48fa96[_0x6f0e('0x31')]:_0x443e7e[_0x6f0e('0x2d')];if(!_0x13d083[_0x6f0e('0x2e')][_0x6f0e('0x34')](_0x6f0e('0x35'))){_0x48fa96['limit']=qs['limit'](_0x13d083['query'][_0x6f0e('0x1b')]);_0x48fa96[_0x6f0e('0x1d')]=qs[_0x6f0e('0x1d')](_0x13d083[_0x6f0e('0x2e')][_0x6f0e('0x1d')]);}_0x48fa96[_0x6f0e('0x36')]=qs[_0x6f0e('0x37')](_0x13d083[_0x6f0e('0x2e')]['sort']);_0x48fa96[_0x6f0e('0x38')]=qs[_0x6f0e('0x2f')](_[_0x6f0e('0x39')](_0x13d083['query'],_0x443e7e['filters']),_0x5c4691);if(_0x13d083[_0x6f0e('0x2e')][_0x6f0e('0x3a')]){_0x48fa96[_0x6f0e('0x38')]=_[_0x6f0e('0x3b')](_0x48fa96[_0x6f0e('0x38')],{'$or':_[_0x6f0e('0x3c')](_0x48fa96[_0x6f0e('0x31')],function(_0x587e99){var _0xd11329={};_0xd11329[_0x587e99]={'$like':'%'+_0x13d083[_0x6f0e('0x2e')]['filter']+'%'};return _0xd11329;})});}_0x48fa96=_[_0x6f0e('0x3b')]({},_0x48fa96,_0x13d083[_0x6f0e('0x3d')]);var _0x5cda98={'where':_0x48fa96[_0x6f0e('0x38')]};return db[_0x6f0e('0x2b')][_0x6f0e('0x1c')](_0x5cda98)[_0x6f0e('0x22')](function(_0x1db64b){_0x1e0fcb['count']=_0x1db64b;if(_0x13d083[_0x6f0e('0x2e')][_0x6f0e('0x3e')]){_0x48fa96[_0x6f0e('0x3f')]=[{'all':!![]}];}return db[_0x6f0e('0x2b')][_0x6f0e('0x40')](_0x48fa96);})[_0x6f0e('0x22')](function(_0x52436a){_0x1e0fcb[_0x6f0e('0x41')]=_0x52436a;return _0x1e0fcb;})[_0x6f0e('0x22')](respondWithFilteredResult(_0x3a2b66,_0x48fa96))[_0x6f0e('0x42')](handleError(_0x3a2b66,null));})[_0x6f0e('0x42')](handleError(_0x3a2b66,null));};exports[_0x6f0e('0x43')]=function(_0x2a4a51,_0xb2b392){var _0x468135={'raw':![],'where':{'id':_0x2a4a51[_0x6f0e('0x44')]['id']}},_0x52d149={};_0x52d149['model']=_[_0x6f0e('0x45')](db['CmCompany'][_0x6f0e('0x46')]);_0x52d149[_0x6f0e('0x2e')]=_[_0x6f0e('0x45')](_0x2a4a51['query']);_0x52d149['filters']=_[_0x6f0e('0x30')](_0x52d149[_0x6f0e('0x2d')],_0x52d149['query']);_0x468135[_0x6f0e('0x31')]=_[_0x6f0e('0x30')](_0x52d149[_0x6f0e('0x2d')],qs[_0x6f0e('0x32')](_0x2a4a51[_0x6f0e('0x2e')][_0x6f0e('0x32')]));_0x468135[_0x6f0e('0x31')]=_0x468135[_0x6f0e('0x31')][_0x6f0e('0x33')]?_0x468135['attributes']:_0x52d149[_0x6f0e('0x2d')];if(_0x2a4a51[_0x6f0e('0x2e')]['includeAll']){_0x468135[_0x6f0e('0x3f')]=[{'all':!![]}];}_0x468135=_[_0x6f0e('0x3b')]({},_0x468135,_0x2a4a51[_0x6f0e('0x3d')]);return db['CmCompany'][_0x6f0e('0x47')](_0x468135)[_0x6f0e('0x22')](handleEntityNotFound(_0xb2b392,null))[_0x6f0e('0x22')](respondWithResult(_0xb2b392,null))[_0x6f0e('0x42')](handleError(_0xb2b392,null));};exports[_0x6f0e('0x48')]=function(_0x3d2f47,_0x8eb62){return db[_0x6f0e('0x2b')]['create'](_0x3d2f47[_0x6f0e('0x49')],{})[_0x6f0e('0x22')](function(_0x122caa){var _0x2eb083=_0x3d2f47[_0x6f0e('0x4a')][_0x6f0e('0x23')]({'plain':!![]});if(!_0x2eb083)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eb083[_0x6f0e('0x4b')]==='user'){var _0x1d6d70=_0x122caa[_0x6f0e('0x23')]({'plain':!![]});var _0x191d54=_0x6f0e('0x24');return db[_0x6f0e('0x4c')]['find']({'where':{'name':_0x191d54,'userProfileId':_0x2eb083[_0x6f0e('0x4d')]},'raw':!![]})[_0x6f0e('0x22')](function(_0x51fa52){if(_0x51fa52&&_0x51fa52[_0x6f0e('0x4e')]===0x0){return db[_0x6f0e('0x25')]['create']({'name':_0x1d6d70[_0x6f0e('0x28')],'resourceId':_0x1d6d70['id'],'type':_0x51fa52['name'],'sectionId':_0x51fa52['id']},{})[_0x6f0e('0x22')](function(){return _0x122caa;});}else{return _0x122caa;}})[_0x6f0e('0x42')](function(_0x53299b){logger[_0x6f0e('0x4f')](_0x6f0e('0x50'),_0x53299b);throw _0x53299b;});}return _0x122caa;})[_0x6f0e('0x22')](respondWithResult(_0x8eb62,0xc9))[_0x6f0e('0x42')](handleError(_0x8eb62,null));};exports[_0x6f0e('0x51')]=function(_0x4367ab,_0x5ef689){if(_0x4367ab[_0x6f0e('0x49')]['id']){delete _0x4367ab[_0x6f0e('0x49')]['id'];}return db['CmCompany'][_0x6f0e('0x47')]({'where':{'id':_0x4367ab[_0x6f0e('0x44')]['id']}})[_0x6f0e('0x22')](handleEntityNotFound(_0x5ef689,null))[_0x6f0e('0x22')](saveUpdates(_0x4367ab['body'],null))[_0x6f0e('0x22')](respondWithResult(_0x5ef689,null))[_0x6f0e('0x42')](handleError(_0x5ef689,null));};exports['destroy']=function(_0x6259c0,_0x3ff471){return db['CmCompany'][_0x6f0e('0x47')]({'where':{'id':_0x6259c0[_0x6f0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ff471,null))['then'](removeEntity(_0x3ff471,null))[_0x6f0e('0x42')](handleError(_0x3ff471,null));};exports[_0x6f0e('0x2c')]=function(_0x185e06,_0x45b9ad){return db[_0x6f0e('0x2b')][_0x6f0e('0x2c')]()[_0x6f0e('0x22')](respondWithResult(_0x45b9ad,null))[_0x6f0e('0x42')](handleError(_0x45b9ad,null));};exports[_0x6f0e('0x52')]=function(_0x4abdf1,_0x48b32,_0x126d97){return db[_0x6f0e('0x53')][_0x6f0e('0x47')]({'where':{'id':_0x4abdf1[_0x6f0e('0x44')]['id']}})[_0x6f0e('0x22')](handleEntityNotFound(_0x48b32,null))['then'](function(_0x4ea220){if(_0x4ea220){return _0x4ea220[_0x6f0e('0x52')](_0x4abdf1[_0x6f0e('0x49')][_0x6f0e('0x54')],_['omit'](_0x4abdf1[_0x6f0e('0x49')],[_0x6f0e('0x54'),'id'])||{});}})[_0x6f0e('0x22')](respondWithResult(_0x48b32,null))[_0x6f0e('0x42')](handleError(_0x48b32,null));};exports[_0x6f0e('0x55')]=function(_0x50bb8a,_0x3d5e34,_0x1e0443){var _0x324404={};var _0x562d0e={};var _0xfe6e58;var _0x1a493d;return db[_0x6f0e('0x2b')][_0x6f0e('0x56')]({'where':{'id':_0x50bb8a[_0x6f0e('0x44')]['id']}})[_0x6f0e('0x22')](handleEntityNotFound(_0x3d5e34,null))[_0x6f0e('0x22')](function(_0x57616c){if(_0x57616c){_0xfe6e58=_0x57616c;_0x562d0e[_0x6f0e('0x2d')]=_[_0x6f0e('0x45')](db[_0x6f0e('0x53')]['rawAttributes']);_0x562d0e[_0x6f0e('0x2e')]=_['keys'](_0x50bb8a[_0x6f0e('0x2e')]);_0x562d0e['filters']=_[_0x6f0e('0x30')](_0x562d0e[_0x6f0e('0x2d')],_0x562d0e[_0x6f0e('0x2e')]);_0x324404[_0x6f0e('0x31')]=_[_0x6f0e('0x30')](_0x562d0e['model'],qs['fields'](_0x50bb8a['query'][_0x6f0e('0x32')]));_0x324404[_0x6f0e('0x31')]=_0x324404[_0x6f0e('0x31')][_0x6f0e('0x33')]?_0x324404[_0x6f0e('0x31')]:_0x562d0e['model'];_0x324404['order']=qs[_0x6f0e('0x37')](_0x50bb8a['query']['sort']);_0x324404[_0x6f0e('0x38')]=qs[_0x6f0e('0x2f')](_['pick'](_0x50bb8a[_0x6f0e('0x2e')],_0x562d0e['filters']));if(_0x50bb8a['query'][_0x6f0e('0x3a')]){_0x324404[_0x6f0e('0x38')]=_[_0x6f0e('0x3b')](_0x324404[_0x6f0e('0x38')],{'$or':_[_0x6f0e('0x3c')](_0x324404[_0x6f0e('0x31')],function(_0x377f78){var _0x59e880={};_0x59e880[_0x377f78]={'$like':'%'+_0x50bb8a[_0x6f0e('0x2e')]['filter']+'%'};return _0x59e880;})});}_0x324404=_[_0x6f0e('0x3b')]({},_0x324404,_0x50bb8a[_0x6f0e('0x3d')]);return _0xfe6e58[_0x6f0e('0x55')](_0x324404);}})[_0x6f0e('0x22')](function(_0x39f114){if(_0x39f114){_0x1a493d=_0x39f114[_0x6f0e('0x33')];if(!_0x50bb8a[_0x6f0e('0x2e')]['hasOwnProperty']('nolimit')){_0x324404[_0x6f0e('0x1b')]=qs[_0x6f0e('0x1b')](_0x50bb8a[_0x6f0e('0x2e')][_0x6f0e('0x1b')]);_0x324404[_0x6f0e('0x1d')]=qs[_0x6f0e('0x1d')](_0x50bb8a[_0x6f0e('0x2e')][_0x6f0e('0x1d')]);}return _0xfe6e58['getContacts'](_0x324404);}})['then'](function(_0x58b3ed){if(_0x58b3ed){return _0x58b3ed?{'count':_0x1a493d,'rows':_0x58b3ed}:null;}})['then'](respondWithResult(_0x3d5e34,null))[_0x6f0e('0x42')](handleError(_0x3d5e34,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 43d0b2a..b22cd73 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 _0xc5db=['rimraf','../../config/environment','exports','define','CmCompany','cm_companies','util','request-promise','path'];(function(_0x2594dc,_0x33b3d0){var _0x4c4506=function(_0x1856a4){while(--_0x1856a4){_0x2594dc['push'](_0x2594dc['shift']());}};_0x4c4506(++_0x33b3d0);}(_0xc5db,0xe7));var _0xbc5d=function(_0x547783,_0x4318d0){_0x547783=_0x547783-0x0;var _0x2df0be=_0xc5db[_0x547783];return _0x2df0be;};'use strict';var _=require('lodash');var util=require(_0xbc5d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbc5d('0x1'));var fs=require('fs');var path=require(_0xbc5d('0x2'));var rimraf=require(_0xbc5d('0x3'));var config=require(_0xbc5d('0x4'));var attributes=require('./cmCompany.attributes');module[_0xbc5d('0x5')]=function(_0x370618,_0x4e5918){return _0x370618[_0xbc5d('0x6')](_0xbc5d('0x7'),attributes,{'tableName':_0xbc5d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9150=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x9150,0xa2));var _0x0915=function(_0x493086,_0x1c15dd){_0x493086=_0x493086-0x0;var _0x51b0dd=_0x9150[_0x493086];return _0x51b0dd;};'use strict';var _=require(_0x0915('0x0'));var util=require(_0x0915('0x1'));var logger=require(_0x0915('0x2'))(_0x0915('0x3'));var moment=require(_0x0915('0x4'));var BPromise=require(_0x0915('0x5'));var rp=require(_0x0915('0x6'));var fs=require('fs');var path=require(_0x0915('0x7'));var rimraf=require(_0x0915('0x8'));var config=require(_0x0915('0x9'));var attributes=require(_0x0915('0xa'));module[_0x0915('0xb')]=function(_0x1dbf04,_0x299771){return _0x1dbf04['define']('CmCompany',attributes,{'tableName':_0x0915('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 7a2ac65..d839fbd 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 _0xbad3=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0xb61bd1,_0x34f91e){var _0x2c5599=function(_0x1ecfe6){while(--_0x1ecfe6){_0xb61bd1['push'](_0xb61bd1['shift']());}};_0x2c5599(++_0x34f91e);}(_0xbad3,0xfc));var _0x3bad=function(_0x1e35a0,_0x4c9418){_0x1e35a0=_0x1e35a0-0x0;var _0x5a7e9d=_0xbad3[_0x1e35a0];return _0x5a7e9d;};'use strict';var _=require(_0x3bad('0x0'));var util=require(_0x3bad('0x1'));var moment=require(_0x3bad('0x2'));var BPromise=require('bluebird');var rs=require(_0x3bad('0x3'));var fs=require('fs');var Redis=require(_0x3bad('0x4'));var db=require(_0x3bad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bad('0x6'))(_0x3bad('0x7'));var config=require(_0x3bad('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3bad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x544403,_0x1d3b31,_0x344075){return new BPromise(function(_0x22ea3f,_0x579eab){return client[_0x3bad('0xa')](_0x544403,_0x344075)[_0x3bad('0xb')](function(_0x248925){logger[_0x3bad('0xc')](_0x3bad('0xd'),_0x1d3b31,_0x3bad('0xe'));logger[_0x3bad('0xf')](_0x3bad('0x10'),_0x1d3b31,'request\x20sent',JSON[_0x3bad('0x11')](_0x248925));if(_0x248925[_0x3bad('0x12')]){if(_0x248925[_0x3bad('0x12')]['code']===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x1d3b31,_0x248925[_0x3bad('0x12')][_0x3bad('0x13')]);return _0x579eab(_0x248925['error'][_0x3bad('0x13')]);}logger['error'](_0x3bad('0xd'),_0x1d3b31,_0x248925[_0x3bad('0x12')]['message']);return _0x22ea3f(_0x248925[_0x3bad('0x12')][_0x3bad('0x13')]);}else{logger[_0x3bad('0xc')]('CmCompany,\x20%s,\x20%s',_0x1d3b31,_0x3bad('0xe'));_0x22ea3f(_0x248925['result'][_0x3bad('0x13')]);}})[_0x3bad('0x14')](function(_0x49e6e8){logger[_0x3bad('0x12')](_0x3bad('0xd'),_0x1d3b31,_0x49e6e8);_0x579eab(_0x49e6e8);});});} \ No newline at end of file +var _0xb1d5=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x37a1e6,_0x536b85){var _0x115a59=function(_0x4173a7){while(--_0x4173a7){_0x37a1e6['push'](_0x37a1e6['shift']());}};_0x115a59(++_0x536b85);}(_0xb1d5,0xec));var _0x5b1d=function(_0x3a376f,_0x4694fb){_0x3a376f=_0x3a376f-0x0;var _0x2cc9ae=_0xb1d5[_0x3a376f];return _0x2cc9ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b1d('0x0'));var BPromise=require(_0x5b1d('0x1'));var rs=require(_0x5b1d('0x2'));var fs=require('fs');var Redis=require(_0x5b1d('0x3'));var db=require(_0x5b1d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b1d('0x5'))(_0x5b1d('0x6'));var config=require(_0x5b1d('0x7'));var jayson=require(_0x5b1d('0x8'));var client=jayson[_0x5b1d('0x9')][_0x5b1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ba70e,_0x5663bc,_0x4f68fe){return new BPromise(function(_0x387b32,_0x47ea5d){return client[_0x5b1d('0xb')](_0x5ba70e,_0x4f68fe)[_0x5b1d('0xc')](function(_0x1bd8ae){logger[_0x5b1d('0xd')](_0x5b1d('0xe'),_0x5663bc,_0x5b1d('0xf'));logger['debug'](_0x5b1d('0x10'),_0x5663bc,_0x5b1d('0xf'),JSON[_0x5b1d('0x11')](_0x1bd8ae));if(_0x1bd8ae[_0x5b1d('0x12')]){if(_0x1bd8ae['error'][_0x5b1d('0x13')]===0x1f4){logger[_0x5b1d('0x12')](_0x5b1d('0xe'),_0x5663bc,_0x1bd8ae['error'][_0x5b1d('0x14')]);return _0x47ea5d(_0x1bd8ae[_0x5b1d('0x12')]['message']);}logger[_0x5b1d('0x12')](_0x5b1d('0xe'),_0x5663bc,_0x1bd8ae['error'][_0x5b1d('0x14')]);return _0x387b32(_0x1bd8ae['error'][_0x5b1d('0x14')]);}else{logger[_0x5b1d('0xd')]('CmCompany,\x20%s,\x20%s',_0x5663bc,'request\x20sent');_0x387b32(_0x1bd8ae[_0x5b1d('0x15')]['message']);}})['catch'](function(_0x51d65e){logger[_0x5b1d('0x12')]('CmCompany,\x20%s,\x20%s',_0x5663bc,_0x51d65e);_0x47ea5d(_0x51d65e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index ca5623b..32517c9 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 _0x38c7=['addContacts','put','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post'];(function(_0x546de4,_0x140c80){var _0x29d774=function(_0x1d630d){while(--_0x1d630d){_0x546de4['push'](_0x546de4['shift']());}};_0x29d774(++_0x140c80);}(_0x38c7,0x6d));var _0x738c=function(_0x41a205,_0x23af6e){_0x41a205=_0x41a205-0x0;var _0xca95ec=_0x38c7[_0x41a205];return _0xca95ec;};'use strict';var multer=require(_0x738c('0x0'));var util=require(_0x738c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x738c('0x2')]();var fs_extra=require(_0x738c('0x3'));var auth=require(_0x738c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x738c('0x5'));var controller=require(_0x738c('0x6'));router[_0x738c('0x7')]('/',auth[_0x738c('0x8')](),controller['index']);router[_0x738c('0x7')](_0x738c('0x9'),auth['isAuthenticated'](),controller[_0x738c('0xa')]);router[_0x738c('0x7')](_0x738c('0xb'),auth[_0x738c('0x8')](),controller[_0x738c('0xc')]);router[_0x738c('0x7')](_0x738c('0xd'),auth[_0x738c('0x8')](),controller[_0x738c('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x738c('0xf')]);router[_0x738c('0x10')]('/:id/contacts',auth[_0x738c('0x8')](),controller[_0x738c('0x11')]);router[_0x738c('0x12')](_0x738c('0xb'),auth[_0x738c('0x8')](),controller['update']);router['delete'](_0x738c('0xb'),auth[_0x738c('0x8')](),controller[_0x738c('0x13')]);module[_0x738c('0x14')]=router; \ No newline at end of file +var _0xf45d=['express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post','put','update','destroy','multer','util','connect-timeout'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xf45d,0x151));var _0xdf45=function(_0x58e001,_0x3b2a88){_0x58e001=_0x58e001-0x0;var _0x37f3b8=_0xf45d[_0x58e001];return _0x37f3b8;};'use strict';var multer=require(_0xdf45('0x0'));var util=require(_0xdf45('0x1'));var path=require('path');var timeout=require(_0xdf45('0x2'));var express=require(_0xdf45('0x3'));var router=express[_0xdf45('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdf45('0x5'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0xdf45('0x6')]('/',auth[_0xdf45('0x7')](),controller[_0xdf45('0x8')]);router[_0xdf45('0x6')](_0xdf45('0x9'),auth[_0xdf45('0x7')](),controller[_0xdf45('0xa')]);router[_0xdf45('0x6')](_0xdf45('0xb'),auth['isAuthenticated'](),controller[_0xdf45('0xc')]);router[_0xdf45('0x6')](_0xdf45('0xd'),auth['isAuthenticated'](),controller[_0xdf45('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdf45('0xf')]);router[_0xdf45('0x10')](_0xdf45('0xd'),auth[_0xdf45('0x7')](),controller['addContacts']);router[_0xdf45('0x11')](_0xdf45('0xb'),auth[_0xdf45('0x7')](),controller[_0xdf45('0x12')]);router['delete']('/:id',auth[_0xdf45('0x7')](),controller[_0xdf45('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 07d2a43..bc85f50 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 _0xd240=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0x502e4b,_0x65da3f){var _0x53fdc2=function(_0x1f0ff8){while(--_0x1f0ff8){_0x502e4b['push'](_0x502e4b['shift']());}};_0x53fdc2(++_0x65da3f);}(_0xd240,0x94));var _0x0d24=function(_0x1903aa,_0x343458){_0x1903aa=_0x1903aa-0x0;var _0x51fe28=_0xd240[_0x1903aa];return _0x51fe28;};'use strict';var _=require(_0x0d24('0x0'));var Sequelize=require(_0x0d24('0x1'));module[_0x0d24('0x2')]={'firstName':{'type':Sequelize[_0x0d24('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0d24('0x3')]},'street':{'type':Sequelize[_0x0d24('0x3')]},'postalCode':{'type':Sequelize[_0x0d24('0x3')]},'city':{'type':Sequelize[_0x0d24('0x3')]},'country':{'type':Sequelize[_0x0d24('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0d24('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0d24('0x3')]},'fax':{'type':Sequelize[_0x0d24('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x0d24('0x3')]},'facebook':{'type':Sequelize[_0x0d24('0x3')]},'fb_data':{'type':Sequelize[_0x0d24('0x3')]},'twitter':{'type':Sequelize[_0x0d24('0x3')]},'skype':{'type':Sequelize[_0x0d24('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x0d24('0x3')]},'wechat':{'type':Sequelize[_0x0d24('0x3')]},'telegram':{'type':Sequelize[_0x0d24('0x3')]},'UserId':{'type':Sequelize[_0x0d24('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0d24('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0d24('0x6')],'defaultValue':Sequelize[_0x0d24('0x7')]},'dialTimezone':{'type':Sequelize[_0x0d24('0x3')]},'utcOffset':{'type':Sequelize[_0x0d24('0x4')]}}; \ No newline at end of file +var _0xbb05=['TEXT','INTEGER','DATE','NOW','lodash','sequelize','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xbb05,0xcf));var _0x5bb0=function(_0xb24c13,_0xbafb19){_0xb24c13=_0xb24c13-0x0;var _0x55cc8e=_0xbb05[_0xb24c13];return _0x55cc8e;};'use strict';var _=require(_0x5bb0('0x0'));var Sequelize=require(_0x5bb0('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x5bb0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5bb0('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5bb0('0x2')]},'city':{'type':Sequelize[_0x5bb0('0x2')]},'country':{'type':Sequelize[_0x5bb0('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bb0('0x3')]},'phone':{'type':Sequelize[_0x5bb0('0x2')]},'mobile':{'type':Sequelize[_0x5bb0('0x2')]},'fax':{'type':Sequelize[_0x5bb0('0x2')]},'email':{'type':Sequelize[_0x5bb0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x5bb0('0x2')]},'fb_data':{'type':Sequelize[_0x5bb0('0x2')]},'twitter':{'type':Sequelize[_0x5bb0('0x2')]},'skype':{'type':Sequelize[_0x5bb0('0x2')]},'teams':{'type':Sequelize[_0x5bb0('0x2')]},'viber':{'type':Sequelize[_0x5bb0('0x2')]},'line':{'type':Sequelize[_0x5bb0('0x2')]},'wechat':{'type':Sequelize[_0x5bb0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x5bb0('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5bb0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5bb0('0x5')],'defaultValue':Sequelize[_0x5bb0('0x6')]},'dialTimezone':{'type':Sequelize[_0x5bb0('0x2')]},'utcOffset':{'type':Sequelize[_0x5bb0('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 939b0cd..07eea9f 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','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','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','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','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];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 respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 2fbc664..42e75c9 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 _0x9bdc=['exports','../../mysqldb','CmContact','save','update','remove','emit','hook'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9bdc,0x1f1));var _0xc9bd=function(_0x3135da,_0x2fff48){_0x3135da=_0x3135da-0x0;var _0x100a2a=_0x9bdc[_0x3135da];return _0x100a2a;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xc9bd('0x0'))['db'][_0xc9bd('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc9bd('0x2'),'afterUpdate':_0xc9bd('0x3'),'afterDestroy':_0xc9bd('0x4')};function emitEvent(_0x998f76){return function(_0x49ced6,_0x36c6d9,_0x24622a){CmContactEvents[_0xc9bd('0x5')](_0x998f76+':'+_0x49ced6['id'],_0x49ced6);CmContactEvents[_0xc9bd('0x5')](_0x998f76,_0x49ced6);_0x24622a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xc9bd('0x6')](e,emitEvent(event));}}module[_0xc9bd('0x7')]=CmContactEvents; \ No newline at end of file +var _0x8653=['hook','exports','events','CmContact','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x112337,_0xb6c8fb){var _0x299602=function(_0x79d17c){while(--_0x79d17c){_0x112337['push'](_0x112337['shift']());}};_0x299602(++_0xb6c8fb);}(_0x8653,0xf5));var _0x3865=function(_0x5843f2,_0x189651){_0x5843f2=_0x5843f2-0x0;var _0x179536=_0x8653[_0x5843f2];return _0x179536;};'use strict';var EventEmitter=require(_0x3865('0x0'));var CmContact=require('../../mysqldb')['db'][_0x3865('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3865('0x2')](0x0);var events={'afterCreate':_0x3865('0x3'),'afterUpdate':_0x3865('0x4'),'afterDestroy':'remove'};function emitEvent(_0x10d20b){return function(_0x748f57,_0x25fbb9,_0x32ec4c){CmContactEvents[_0x3865('0x5')](_0x10d20b+':'+_0x748f57['id'],_0x748f57);CmContactEvents[_0x3865('0x5')](_0x10d20b,_0x748f57);_0x32ec4c(null);};}for(var e in events){if(events[_0x3865('0x6')](e)){var event=events[e];CmContact[_0x3865('0x7')](e,emitEvent(event));}}module[_0x3865('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index d5d77e4..7542bfa 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 _0xc2ec=['format','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','CmHopperFinal','catch','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmContact.attributes','exports','CmContact','cm_contacts','phone','firstName','lastName','mobile','email','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','then','isNil','dialTimezone','timezones','utcOffset','add','minutes'];(function(_0x2552b5,_0x323484){var _0x532d82=function(_0x37fd3a){while(--_0x37fd3a){_0x2552b5['push'](_0x2552b5['shift']());}};_0x532d82(++_0x323484);}(_0xc2ec,0x1d5));var _0xcc2e=function(_0x51aa55,_0x85e2ec){_0x51aa55=_0x51aa55-0x0;var _0x51f6d1=_0xc2ec[_0x51aa55];return _0x51f6d1;};'use strict';var _=require(_0xcc2e('0x0'));var util=require(_0xcc2e('0x1'));var logger=require(_0xcc2e('0x2'))('api');var moment=require(_0xcc2e('0x3'));var BPromise=require(_0xcc2e('0x4'));var rp=require(_0xcc2e('0x5'));var fs=require('fs');var path=require(_0xcc2e('0x6'));var rimraf=require(_0xcc2e('0x7'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0xcc2e('0x8'));module[_0xcc2e('0x9')]=function(_0x207c9d,_0x8843f0){return _0x207c9d['define'](_0xcc2e('0xa'),attributes,{'tableName':_0xcc2e('0xb'),'paranoid':!![],'indexes':[{'name':_0xcc2e('0xc'),'fields':[_0xcc2e('0xc')]},{'name':'fti_cm_contacts','fields':[_0xcc2e('0xd'),_0xcc2e('0xe'),_0xcc2e('0xc'),_0xcc2e('0xf'),'fax',_0xcc2e('0x10')],'type':_0xcc2e('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xcc2e('0x12'),'hooks':{'afterCreate':function(_0x14a25c,_0x42aa1e,_0x4e1b64){var _0x1ae954=_0x207c9d[_0xcc2e('0x13')];var _0x287980=_0x14a25c[_0xcc2e('0x14')]({'plain':!![]});function _0x368e16(){return function(_0x389ad3){logger[_0xcc2e('0x15')](_0xcc2e('0x16'),_0xcc2e('0x17'),util[_0xcc2e('0x18')](_0x389ad3,{'showHidden':![],'depth':null}));};}function _0x4ee07e(_0x52e6cd,_0x1c65b6){var _0x472a5d=_0x1c65b6[_0xcc2e('0x19')]?_0x1c65b6[_0xcc2e('0x19')]:moment()['format'](_0xcc2e('0x1a'));return new BPromise(function(_0x2f9000,_0x5d31e0){if(_['isNil'](_0x1c65b6['dialTimezone'])){_0x2f9000({'ret':_0x472a5d});}else{_0x1ae954[_0xcc2e('0x1b')]['findOne']({'where':{'id':_0x52e6cd['id']}})[_0xcc2e('0x1c')](function(_0x49bb72){if(!_[_0xcc2e('0x1d')](_0x49bb72)){var _0x425c0b=_0x49bb72[_0xcc2e('0x1e')];if(!_['isNil'](_0x425c0b)){var _0x200cce=shared[_0xcc2e('0x1f')];var _0x172096=_0x200cce[_0x425c0b];var _0x1f6695=_0x200cce[_0x1c65b6[_0xcc2e('0x1e')]];if(!_[_0xcc2e('0x1d')](_0x172096)&&!_[_0xcc2e('0x1d')](_0x1f6695)){var _0x1c309d=_0x172096[_0xcc2e('0x20')]-_0x1f6695[_0xcc2e('0x20')];_0x472a5d=_0x1c65b6[_0xcc2e('0x19')]?_0x1c65b6[_0xcc2e('0x19')]:moment();var _0x31d418=moment(_0x472a5d)[_0xcc2e('0x21')](_0x1c309d,_0xcc2e('0x22'));_0x2f9000({'ret':_0x31d418[_0xcc2e('0x23')](_0xcc2e('0x1a'))});}else _0x2f9000({'ret':_0x472a5d});}else _0x2f9000({'ret':_0x472a5d});}else{_0x2f9000({'ret':_0x472a5d});}});}});return 0xa;}var _0x44b046=function(_0x6edcea){return new BPromise(function(_0x161611,_0x1e121f){_0x4ee07e(_0x6edcea,_0x287980)[_0xcc2e('0x1c')](function(_0x30ad3b){_0x287980['scheduledat']=_0x30ad3b[_0xcc2e('0x24')];_0x1ae954[_0xcc2e('0x25')][_0xcc2e('0x26')]({'where':{'phone':_0x287980['phone'],'VoiceQueueId':_0x6edcea['id']}})[_0xcc2e('0x1c')](function(_0x58ea02){if(!_[_0xcc2e('0x1d')](_0x58ea02)){throw new Error(_0xcc2e('0x27')+_0x287980[_0xcc2e('0xc')]+_0xcc2e('0x28')+_0x6edcea['id']);}return _0x1ae954['CmHopper'][_0xcc2e('0x29')]({'phone':_0x287980[_0xcc2e('0xc')],'ContactId':_0x287980['id'],'ListId':_0x287980[_0xcc2e('0x2a')],'priority':_0x287980[_0xcc2e('0x2b')]?_0x287980[_0xcc2e('0x2b')]:0x2,'scheduledat':_0x287980[_0xcc2e('0x19')]?_0x287980['scheduledat']:moment()[_0xcc2e('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x287980[_0xcc2e('0x2c')]?!![]:![],'callbackuniqueid':_0x287980[_0xcc2e('0x2c')]?_0x287980[_0xcc2e('0x2c')]:undefined,'callbackat':_0x287980[_0xcc2e('0x2c')]?moment()[_0xcc2e('0x23')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x6edcea['id']});})['catch'](function(_0x2311e5){_0x1e121f(_0x2311e5);});});});};var _0x433a21=function(_0x26a72c){return new BPromise(function(_0x2acaf6,_0xb49ac3){_0x4ee07e(_0x26a72c,_0x287980)[_0xcc2e('0x1c')](function(_0x21dd32){_0x287980['scheduledat']=_0x21dd32[_0xcc2e('0x24')];_0x1ae954[_0xcc2e('0x25')]['findOne']({'where':{'phone':_0x287980[_0xcc2e('0xc')],'VoiceQueueId':_0x26a72c['id']}})['then'](function(_0x11112a){if(!_[_0xcc2e('0x1d')](_0x11112a)){throw new Error(_0xcc2e('0x27')+_0x287980[_0xcc2e('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x26a72c['id']);}return _0x1ae954[_0xcc2e('0x2d')][_0xcc2e('0x26')]({'where':{'calleridnum':_0x287980['phone'],'VoiceQueueId':_0x26a72c['id']}});})[_0xcc2e('0x1c')](function(_0x34b553){if(!_[_0xcc2e('0x1d')](_0x34b553)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x287980['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x26a72c['id']);}return _0x1ae954[_0xcc2e('0x25')][_0xcc2e('0x29')]({'phone':_0x287980[_0xcc2e('0xc')],'ContactId':_0x287980['id'],'ListId':_0x287980['ListId'],'priority':_0x287980[_0xcc2e('0x2b')]?_0x287980[_0xcc2e('0x2b')]:0x2,'scheduledat':_0x287980['scheduledat']?_0x287980[_0xcc2e('0x19')]:moment()[_0xcc2e('0x23')](_0xcc2e('0x1a')),'callback':_0x287980[_0xcc2e('0x2c')]?!![]:![],'callbackuniqueid':_0x287980[_0xcc2e('0x2c')]?_0x287980[_0xcc2e('0x2c')]:undefined,'callbackat':_0x287980[_0xcc2e('0x2c')]?moment()[_0xcc2e('0x23')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x26a72c['id']});})[_0xcc2e('0x2e')](function(_0x43dc85){_0xb49ac3(_0x43dc85);});});});};function _0x5d9326(){return function(_0x34e06e){logger['error']('cmContact',_0xcc2e('0x17'),util['inspect'](_0x34e06e,{'showHidden':![],'depth':null}));};}function _0x218185(_0x4bb17f,_0x5b526f){var _0x2cdef9=_0x5b526f[_0xcc2e('0x19')]?_0x5b526f['scheduledat']:moment()[_0xcc2e('0x23')](_0xcc2e('0x1a'));return new BPromise(function(_0x39495f,_0x18363d){if(_[_0xcc2e('0x1d')](_0x5b526f[_0xcc2e('0x1e')])){_0x39495f({'ret':_0x2cdef9});}else{_0x1ae954[_0xcc2e('0x2f')][_0xcc2e('0x26')]({'where':{'id':_0x4bb17f['id']}})[_0xcc2e('0x1c')](function(_0x1baab3){if(!_['isNil'](_0x1baab3)){var _0x3e16e0=_0x1baab3[_0xcc2e('0x1e')];if(!_[_0xcc2e('0x1d')](_0x3e16e0)){var _0x3c543c=shared[_0xcc2e('0x1f')];var _0x525334=_0x3c543c[_0x3e16e0];var _0x4ab4d9=_0x3c543c[_0x5b526f[_0xcc2e('0x1e')]];if(!_['isNil'](_0x525334)&&!_[_0xcc2e('0x1d')](_0x4ab4d9)){var _0x42867f=_0x525334['utcOffset']-_0x4ab4d9['utcOffset'];_0x2cdef9=_0x5b526f[_0xcc2e('0x19')]?_0x5b526f[_0xcc2e('0x19')]:moment();var _0x2cd4e8=moment(_0x2cdef9)[_0xcc2e('0x21')](_0x42867f,_0xcc2e('0x22'));_0x39495f({'ret':_0x2cd4e8[_0xcc2e('0x23')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x39495f({'ret':_0x2cdef9});}else _0x39495f({'ret':_0x2cdef9});}else{_0x39495f({'ret':_0x2cdef9});}});}});return 0xa;}var _0x5020db=function(_0x3223d8){return new BPromise(function(_0x2de6ff,_0x41cdec){_0x218185(_0x3223d8,_0x287980)['then'](function(_0x1caa48){_0x287980[_0xcc2e('0x19')]=_0x1caa48[_0xcc2e('0x24')];_0x1ae954[_0xcc2e('0x25')][_0xcc2e('0x26')]({'where':{'phone':_0x287980['phone'],'CampaignId':_0x3223d8['id']}})['then'](function(_0x5ba07c){if(!_[_0xcc2e('0x1d')](_0x5ba07c)){throw new Error(_0xcc2e('0x27')+_0x287980[_0xcc2e('0xc')]+_0xcc2e('0x30')+_0x3223d8['id']);}return _0x1ae954[_0xcc2e('0x25')][_0xcc2e('0x29')]({'phone':_0x287980['phone'],'ContactId':_0x287980['id'],'ListId':_0x287980[_0xcc2e('0x2a')],'priority':_0x287980['priority']?_0x287980['priority']:0x2,'scheduledat':_0x287980[_0xcc2e('0x19')]?_0x287980[_0xcc2e('0x19')]:moment()[_0xcc2e('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x287980[_0xcc2e('0x2c')]?!![]:![],'callbackuniqueid':_0x287980['callbackUniqueid']?_0x287980['callbackUniqueid']:undefined,'callbackat':_0x287980['callbackUniqueid']?moment()['format'](_0xcc2e('0x1a')):undefined,'CampaignId':_0x3223d8['id']});})['catch'](function(_0x48280c){_0x41cdec(_0x48280c);});});});};var _0x17f904=function(_0x4b3de3){return new BPromise(function(_0x485141,_0x38420c){_0x218185(_0x4b3de3,_0x287980)[_0xcc2e('0x1c')](function(_0x203808){_0x287980[_0xcc2e('0x19')]=_0x203808[_0xcc2e('0x24')];_0x1ae954[_0xcc2e('0x25')][_0xcc2e('0x26')]({'where':{'phone':_0x287980[_0xcc2e('0xc')],'CampaignId':_0x4b3de3['id']}})[_0xcc2e('0x1c')](function(_0x7cbf2){if(!_[_0xcc2e('0x1d')](_0x7cbf2)){throw new Error(_0xcc2e('0x27')+_0x287980['phone']+_0xcc2e('0x31')+_0x4b3de3['id']);}return _0x1ae954['CmHopperFinal'][_0xcc2e('0x26')]({'where':{'calleridnum':_0x287980[_0xcc2e('0xc')],'CampaignId':_0x4b3de3['id']}});})[_0xcc2e('0x1c')](function(_0x325fa3){if(!_[_0xcc2e('0x1d')](_0x325fa3)){throw new Error(_0xcc2e('0x32')+_0x287980[_0xcc2e('0xc')]+_0xcc2e('0x33')+_0x4b3de3['id']);}return _0x1ae954[_0xcc2e('0x25')][_0xcc2e('0x29')]({'phone':_0x287980[_0xcc2e('0xc')],'ContactId':_0x287980['id'],'ListId':_0x287980[_0xcc2e('0x2a')],'priority':_0x287980[_0xcc2e('0x2b')]?_0x287980[_0xcc2e('0x2b')]:0x2,'scheduledat':_0x287980['scheduledat']?_0x287980[_0xcc2e('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x287980[_0xcc2e('0x2c')]?!![]:![],'callbackuniqueid':_0x287980[_0xcc2e('0x2c')]?_0x287980[_0xcc2e('0x2c')]:undefined,'callbackat':_0x287980['callbackUniqueid']?moment()[_0xcc2e('0x23')](_0xcc2e('0x1a')):undefined,'CampaignId':_0x4b3de3['id']});})['catch'](function(_0x5aef9f){_0x38420c(_0x5aef9f);});});});};if(_0x287980[_0xcc2e('0x2a')]){_0x1ae954[_0xcc2e('0x1b')][_0xcc2e('0x34')]({'where':{'type':_0xcc2e('0x35')},'attributes':['id',_0xcc2e('0x36'),_0xcc2e('0x1e')],'include':[{'model':_0x1ae954[_0xcc2e('0x37')],'as':_0xcc2e('0x38'),'where':{'id':_0x287980['ListId']}}]})[_0xcc2e('0x1c')](function(_0x1d715b){if(_0x1d715b){var _0x1a265d=[];for(var _0x2f0b3d=0x0,_0x3efb14;_0x2f0b3d<_0x1d715b[_0xcc2e('0x39')];_0x2f0b3d+=0x1){_0x3efb14=_0x1d715b[_0x2f0b3d][_0xcc2e('0x14')]({'plain':!![]});switch(_0x3efb14[_0xcc2e('0x36')]){case _0xcc2e('0x3a'):_0x433a21(_0x3efb14)[_0xcc2e('0x2e')](_0x368e16());break;case _0xcc2e('0x3b'):_0x44b046(_0x3efb14)[_0xcc2e('0x2e')](_0x368e16());break;default:_0x218185(_0x3efb14,_0x287980)['then'](function(_0x3b41dd){_0x287980[_0xcc2e('0x19')]=_0x3b41dd[_0xcc2e('0x24')];_0x1ae954[_0xcc2e('0x25')][_0xcc2e('0x29')]({'phone':_0x287980['phone'],'ContactId':_0x287980['id'],'ListId':_0x287980[_0xcc2e('0x2a')],'scheduledat':_0x287980['scheduledat']?_0x287980[_0xcc2e('0x19')]:moment()[_0xcc2e('0x23')](_0xcc2e('0x1a')),'priority':_0x287980[_0xcc2e('0x2b')]?_0x287980[_0xcc2e('0x2b')]:0x2,'callback':_0x287980[_0xcc2e('0x2c')]?!![]:![],'callbackuniqueid':_0x287980[_0xcc2e('0x2c')]?_0x287980[_0xcc2e('0x2c')]:undefined,'callbackat':_0x287980[_0xcc2e('0x2c')]?moment()[_0xcc2e('0x23')](_0xcc2e('0x1a')):undefined,'VoiceQueueId':_0x3efb14['id']})[_0xcc2e('0x2e')](_0x368e16());});}}}})['then'](function(){return _0x1ae954[_0xcc2e('0x1b')]['findAll']({'where':{'type':_0xcc2e('0x35')},'attributes':['id'],'include':[{'model':_0x1ae954[_0xcc2e('0x37')],'as':_0xcc2e('0x3c'),'where':{'id':_0x287980['ListId']}}]})['then'](function(_0x232654){if(_0x232654){var _0x5f239a=[];for(var _0x4fcd6b=0x0,_0x394975;_0x4fcd6b<_0x232654[_0xcc2e('0x39')];_0x4fcd6b+=0x1){_0x394975=_0x232654[_0x4fcd6b][_0xcc2e('0x14')]({'plain':!![]});_0x1ae954[_0xcc2e('0x3d')][_0xcc2e('0x29')]({'phone':_0x287980[_0xcc2e('0xc')],'ContactId':_0x287980['id'],'ListId':_0x287980[_0xcc2e('0x2a')],'VoiceQueueId':_0x394975['id']})['catch'](function(_0x57e092){logger['error']('cmContact,\x20%s,\x20%s',_0xcc2e('0x17'),_0x57e092['message']);});}}});})[_0xcc2e('0x1c')](function(){return _0x1ae954[_0xcc2e('0x2f')][_0xcc2e('0x34')]({'attributes':['id',_0xcc2e('0x36'),_0xcc2e('0x1e')],'include':[{'model':_0x1ae954['CmList'],'as':'Lists','where':{'id':_0x287980[_0xcc2e('0x2a')]}}]})['then'](function(_0x50ce18){if(_0x50ce18){var _0xba7bd9=[];for(var _0x435f23=0x0,_0x1af4ca;_0x435f23<_0x50ce18['length'];_0x435f23+=0x1){_0x1af4ca=_0x50ce18[_0x435f23][_0xcc2e('0x14')]({'plain':!![]});switch(_0x1af4ca[_0xcc2e('0x36')]){case'always':_0x17f904(_0x1af4ca)[_0xcc2e('0x2e')](_0x5d9326());break;case _0xcc2e('0x3b'):_0x5020db(_0x1af4ca)[_0xcc2e('0x2e')](_0x5d9326());break;default:_0x1ae954[_0xcc2e('0x25')]['create']({'phone':_0x287980['phone'],'ContactId':_0x287980['id'],'ListId':_0x287980[_0xcc2e('0x2a')],'scheduledat':_0x287980['scheduledat']?_0x287980[_0xcc2e('0x19')]:moment()[_0xcc2e('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x287980['priority']?_0x287980['priority']:0x2,'callback':_0x287980[_0xcc2e('0x2c')]?!![]:![],'callbackuniqueid':_0x287980[_0xcc2e('0x2c')]?_0x287980[_0xcc2e('0x2c')]:undefined,'callbackat':_0x287980[_0xcc2e('0x2c')]?moment()['format'](_0xcc2e('0x1a')):undefined,'CampaignId':_0x1af4ca['id']})[_0xcc2e('0x2e')](_0x5d9326());}}}});})[_0xcc2e('0x1c')](function(){return _0x1ae954['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x1ae954['CmList'],'as':_0xcc2e('0x3c'),'where':{'id':_0x287980[_0xcc2e('0x2a')]}}]})[_0xcc2e('0x1c')](function(_0x4c1fd9){if(_0x4c1fd9){var _0x63da21=[];for(var _0x4c37f9=0x0,_0xdeb0f3;_0x4c37f9<_0x4c1fd9[_0xcc2e('0x39')];_0x4c37f9+=0x1){_0xdeb0f3=_0x4c1fd9[_0x4c37f9][_0xcc2e('0x14')]({'plain':!![]});_0x1ae954[_0xcc2e('0x3d')]['create']({'phone':_0x287980[_0xcc2e('0xc')],'ContactId':_0x287980['id'],'ListId':_0x287980[_0xcc2e('0x2a')],'CampaignId':_0xdeb0f3['id']})['catch'](function(_0x3e95eb){logger[_0xcc2e('0x15')](_0xcc2e('0x3e'),'afterCreate',_0x3e95eb[_0xcc2e('0x3f')]);});}}});})[_0xcc2e('0x1c')](function(){_0x4e1b64();})['catch'](function(_0x1e3db9){logger[_0xcc2e('0x15')](_0xcc2e('0x3e'),_0xcc2e('0x17'),_0x1e3db9['message']);_0x4e1b64(_0x1e3db9);});}else{_0x4e1b64(new Error(_0xcc2e('0x40')));}},'afterDestroy':function(_0x317d8a,_0x55aa62,_0x396e17){var _0x114b54=_0x207c9d[_0xcc2e('0x13')];var _0x138ce8=_0x317d8a['get']({'plain':!![]});return _0x114b54[_0xcc2e('0x25')][_0xcc2e('0x34')]({'raw':!![],'where':{'ListId':_0x138ce8['ListId'],'ContactId':_0x138ce8['id']}})[_0xcc2e('0x1c')](function(_0x436c99){if(!_['isEmpty'](_0x436c99)){var _0x43f0de=[];for(var _0x12a01d=0x0;_0x12a01d<_0x436c99[_0xcc2e('0x39')];_0x12a01d+=0x1){var _0x5713d3=_0x114b54[_0xcc2e('0x25')]['destroy']({'where':{'ListId':_0x436c99[_0x12a01d][_0xcc2e('0x2a')],'ContactId':_0x436c99[_0x12a01d][_0xcc2e('0x41')],'VoiceQueueId':_0x436c99[_0x12a01d][_0xcc2e('0x42')],'CampaignId':_0x436c99[_0x12a01d]['CampaignId']}});_0x43f0de[_0xcc2e('0x43')](_0x5713d3);}return BPromise[_0xcc2e('0x44')](_0x43f0de);}})[_0xcc2e('0x1c')](function(_0x5e1189){logger[_0xcc2e('0x45')](_0xcc2e('0x46'),util[_0xcc2e('0x18')](_0x5e1189,{'showHidden':![],'depth':null}));_0x396e17();})[_0xcc2e('0x2e')](function(_0x2a2aec){logger[_0xcc2e('0x15')](_0xcc2e('0x47'),util[_0xcc2e('0x18')](_0x2a2aec,{'showHidden':![],'depth':null}));_0x396e17(_0x2a2aec);});}}});}; \ No newline at end of file +var _0x5af7=['length','onlyIfOpen','BlackLists','CmHopperBlack','message','always','Campaign','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','info','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','utf8mb4_unicode_ci','models','get','error','cmContact','inspect','scheduledat','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','add','format','YYYY-MM-DD\x20HH:mm:ss','CmHopper','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','catch','ret','\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','ListId','afterCreate','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','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists'];(function(_0xee6ce3,_0x584c02){var _0x578ab=function(_0x2781d3){while(--_0x2781d3){_0xee6ce3['push'](_0xee6ce3['shift']());}};_0x578ab(++_0x584c02);}(_0x5af7,0x17d));var _0x75af=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x5af7[_0x1f1e31];return _0x229b56;};'use strict';var _=require(_0x75af('0x0'));var util=require('util');var logger=require(_0x75af('0x1'))(_0x75af('0x2'));var moment=require('moment');var BPromise=require(_0x75af('0x3'));var rp=require(_0x75af('0x4'));var fs=require('fs');var path=require(_0x75af('0x5'));var rimraf=require(_0x75af('0x6'));var config=require(_0x75af('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x75af('0x8'));module[_0x75af('0x9')]=function(_0x54505c,_0x767cf2){return _0x54505c[_0x75af('0xa')](_0x75af('0xb'),attributes,{'tableName':_0x75af('0xc'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x75af('0xd')]},{'name':'fti_cm_contacts','fields':[_0x75af('0xe'),_0x75af('0xf'),_0x75af('0xd'),'mobile',_0x75af('0x10'),_0x75af('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0x75af('0x12'),'hooks':{'afterCreate':function(_0x31a6cb,_0xeb5aa2,_0x518918){var _0x49e4de=_0x54505c[_0x75af('0x13')];var _0x5ce75c=_0x31a6cb[_0x75af('0x14')]({'plain':!![]});function _0x1e3176(){return function(_0x1a3c25){logger[_0x75af('0x15')](_0x75af('0x16'),'afterCreate',util[_0x75af('0x17')](_0x1a3c25,{'showHidden':![],'depth':null}));};}function _0x3462dc(_0x2aa450,_0x1da463){var _0x1fe6f0=_0x1da463['scheduledat']?_0x1da463[_0x75af('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x4b459e,_0x1cb3e6){if(_[_0x75af('0x19')](_0x1da463['dialTimezone'])){_0x4b459e({'ret':_0x1fe6f0});}else{_0x49e4de[_0x75af('0x1a')][_0x75af('0x1b')]({'where':{'id':_0x2aa450['id']}})[_0x75af('0x1c')](function(_0x3f2bfd){if(!_[_0x75af('0x19')](_0x3f2bfd)){var _0xe4e188=_0x3f2bfd[_0x75af('0x1d')];if(!_[_0x75af('0x19')](_0xe4e188)){var _0x5a892c=shared[_0x75af('0x1e')];var _0x3c3c69=_0x5a892c[_0xe4e188];var _0x417a06=_0x5a892c[_0x1da463[_0x75af('0x1d')]];if(!_['isNil'](_0x3c3c69)&&!_[_0x75af('0x19')](_0x417a06)){var _0x5071b8=_0x3c3c69[_0x75af('0x1f')]-_0x417a06[_0x75af('0x1f')];_0x1fe6f0=_0x1da463['scheduledat']?_0x1da463['scheduledat']:moment();var _0x509464=moment(_0x1fe6f0)[_0x75af('0x20')](_0x5071b8,'minutes');_0x4b459e({'ret':_0x509464[_0x75af('0x21')](_0x75af('0x22'))});}else _0x4b459e({'ret':_0x1fe6f0});}else _0x4b459e({'ret':_0x1fe6f0});}else{_0x4b459e({'ret':_0x1fe6f0});}});}});return 0xa;}var _0x1842b6=function(_0x505199){return new BPromise(function(_0x5a517d,_0x383513){_0x3462dc(_0x505199,_0x5ce75c)['then'](function(_0x17c9ad){_0x5ce75c[_0x75af('0x18')]=_0x17c9ad['ret'];_0x49e4de[_0x75af('0x23')]['findOne']({'where':{'phone':_0x5ce75c[_0x75af('0xd')],'VoiceQueueId':_0x505199['id']}})['then'](function(_0x143285){if(!_[_0x75af('0x19')](_0x143285)){throw new Error(_0x75af('0x24')+_0x5ce75c['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x505199['id']);}return _0x49e4de[_0x75af('0x23')][_0x75af('0x25')]({'phone':_0x5ce75c['phone'],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c['ListId'],'priority':_0x5ce75c['priority']?_0x5ce75c[_0x75af('0x26')]:0x2,'scheduledat':_0x5ce75c['scheduledat']?_0x5ce75c[_0x75af('0x18')]:moment()[_0x75af('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5ce75c[_0x75af('0x27')]?!![]:![],'callbackuniqueid':_0x5ce75c[_0x75af('0x27')]?_0x5ce75c[_0x75af('0x27')]:undefined,'callbackat':_0x5ce75c[_0x75af('0x27')]?moment()[_0x75af('0x21')](_0x75af('0x22')):undefined,'VoiceQueueId':_0x505199['id']});})[_0x75af('0x28')](function(_0x4fb8e5){_0x383513(_0x4fb8e5);});});});};var _0x4ac476=function(_0x1761c4){return new BPromise(function(_0x2f7fc4,_0xb6192e){_0x3462dc(_0x1761c4,_0x5ce75c)['then'](function(_0xa9647b){_0x5ce75c['scheduledat']=_0xa9647b[_0x75af('0x29')];_0x49e4de[_0x75af('0x23')]['findOne']({'where':{'phone':_0x5ce75c[_0x75af('0xd')],'VoiceQueueId':_0x1761c4['id']}})['then'](function(_0x1150e3){if(!_['isNil'](_0x1150e3)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5ce75c['phone']+_0x75af('0x2a')+_0x1761c4['id']);}return _0x49e4de[_0x75af('0x2b')][_0x75af('0x1b')]({'where':{'calleridnum':_0x5ce75c[_0x75af('0xd')],'VoiceQueueId':_0x1761c4['id']}});})[_0x75af('0x1c')](function(_0x381dc3){if(!_[_0x75af('0x19')](_0x381dc3)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5ce75c['phone']+_0x75af('0x2c')+_0x1761c4['id']);}return _0x49e4de[_0x75af('0x23')]['create']({'phone':_0x5ce75c[_0x75af('0xd')],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c[_0x75af('0x2d')],'priority':_0x5ce75c[_0x75af('0x26')]?_0x5ce75c[_0x75af('0x26')]:0x2,'scheduledat':_0x5ce75c[_0x75af('0x18')]?_0x5ce75c[_0x75af('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5ce75c[_0x75af('0x27')]?!![]:![],'callbackuniqueid':_0x5ce75c[_0x75af('0x27')]?_0x5ce75c[_0x75af('0x27')]:undefined,'callbackat':_0x5ce75c[_0x75af('0x27')]?moment()['format'](_0x75af('0x22')):undefined,'VoiceQueueId':_0x1761c4['id']});})[_0x75af('0x28')](function(_0x2eaa79){_0xb6192e(_0x2eaa79);});});});};function _0x40de2d(){return function(_0x450c59){logger[_0x75af('0x15')]('cmContact',_0x75af('0x2e'),util[_0x75af('0x17')](_0x450c59,{'showHidden':![],'depth':null}));};}function _0x420b80(_0x95fc9,_0x780c44){var _0x3e5841=_0x780c44['scheduledat']?_0x780c44[_0x75af('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0xec5482,_0x537e22){if(_[_0x75af('0x19')](_0x780c44[_0x75af('0x1d')])){_0xec5482({'ret':_0x3e5841});}else{_0x49e4de['Campaign']['findOne']({'where':{'id':_0x95fc9['id']}})[_0x75af('0x1c')](function(_0x48aa8c){if(!_[_0x75af('0x19')](_0x48aa8c)){var _0x829308=_0x48aa8c[_0x75af('0x1d')];if(!_[_0x75af('0x19')](_0x829308)){var _0x5f2a0e=shared['timezones'];var _0x5ebea2=_0x5f2a0e[_0x829308];var _0x3c652b=_0x5f2a0e[_0x780c44[_0x75af('0x1d')]];if(!_[_0x75af('0x19')](_0x5ebea2)&&!_[_0x75af('0x19')](_0x3c652b)){var _0x3e05cb=_0x5ebea2[_0x75af('0x1f')]-_0x3c652b[_0x75af('0x1f')];_0x3e5841=_0x780c44[_0x75af('0x18')]?_0x780c44[_0x75af('0x18')]:moment();var _0x2fc948=moment(_0x3e5841)['add'](_0x3e05cb,_0x75af('0x2f'));_0xec5482({'ret':_0x2fc948[_0x75af('0x21')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0xec5482({'ret':_0x3e5841});}else _0xec5482({'ret':_0x3e5841});}else{_0xec5482({'ret':_0x3e5841});}});}});return 0xa;}var _0x234b67=function(_0x1d7b2c){return new BPromise(function(_0x23e504,_0x22e87a){_0x420b80(_0x1d7b2c,_0x5ce75c)[_0x75af('0x1c')](function(_0x14b1f0){_0x5ce75c['scheduledat']=_0x14b1f0[_0x75af('0x29')];_0x49e4de['CmHopper'][_0x75af('0x1b')]({'where':{'phone':_0x5ce75c[_0x75af('0xd')],'CampaignId':_0x1d7b2c['id']}})[_0x75af('0x1c')](function(_0x53621e){if(!_[_0x75af('0x19')](_0x53621e)){throw new Error(_0x75af('0x24')+_0x5ce75c[_0x75af('0xd')]+_0x75af('0x30')+_0x1d7b2c['id']);}return _0x49e4de['CmHopper']['create']({'phone':_0x5ce75c[_0x75af('0xd')],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c['ListId'],'priority':_0x5ce75c[_0x75af('0x26')]?_0x5ce75c[_0x75af('0x26')]:0x2,'scheduledat':_0x5ce75c[_0x75af('0x18')]?_0x5ce75c['scheduledat']:moment()[_0x75af('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5ce75c[_0x75af('0x27')]?!![]:![],'callbackuniqueid':_0x5ce75c[_0x75af('0x27')]?_0x5ce75c[_0x75af('0x27')]:undefined,'callbackat':_0x5ce75c[_0x75af('0x27')]?moment()[_0x75af('0x21')](_0x75af('0x22')):undefined,'CampaignId':_0x1d7b2c['id']});})[_0x75af('0x28')](function(_0x5c883d){_0x22e87a(_0x5c883d);});});});};var _0x5c3c86=function(_0x39541d){return new BPromise(function(_0x443d88,_0x5ce723){_0x420b80(_0x39541d,_0x5ce75c)[_0x75af('0x1c')](function(_0xcd6cb9){_0x5ce75c['scheduledat']=_0xcd6cb9[_0x75af('0x29')];_0x49e4de[_0x75af('0x23')][_0x75af('0x1b')]({'where':{'phone':_0x5ce75c[_0x75af('0xd')],'CampaignId':_0x39541d['id']}})[_0x75af('0x1c')](function(_0x1333d6){if(!_['isNil'](_0x1333d6)){throw new Error(_0x75af('0x24')+_0x5ce75c[_0x75af('0xd')]+_0x75af('0x31')+_0x39541d['id']);}return _0x49e4de['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x5ce75c['phone'],'CampaignId':_0x39541d['id']}});})[_0x75af('0x1c')](function(_0x30789b){if(!_[_0x75af('0x19')](_0x30789b)){throw new Error(_0x75af('0x32')+_0x5ce75c[_0x75af('0xd')]+_0x75af('0x33')+_0x39541d['id']);}return _0x49e4de[_0x75af('0x23')][_0x75af('0x25')]({'phone':_0x5ce75c[_0x75af('0xd')],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c[_0x75af('0x2d')],'priority':_0x5ce75c[_0x75af('0x26')]?_0x5ce75c[_0x75af('0x26')]:0x2,'scheduledat':_0x5ce75c[_0x75af('0x18')]?_0x5ce75c[_0x75af('0x18')]:moment()[_0x75af('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5ce75c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5ce75c[_0x75af('0x27')]?_0x5ce75c['callbackUniqueid']:undefined,'callbackat':_0x5ce75c[_0x75af('0x27')]?moment()[_0x75af('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x39541d['id']});})[_0x75af('0x28')](function(_0x4b230b){_0x5ce723(_0x4b230b);});});});};if(_0x5ce75c[_0x75af('0x2d')]){_0x49e4de[_0x75af('0x1a')][_0x75af('0x34')]({'where':{'type':_0x75af('0x35')},'attributes':['id',_0x75af('0x36'),_0x75af('0x1d')],'include':[{'model':_0x49e4de[_0x75af('0x37')],'as':_0x75af('0x38'),'where':{'id':_0x5ce75c[_0x75af('0x2d')]}}]})['then'](function(_0x422a0f){if(_0x422a0f){var _0x1211a8=[];for(var _0x4bbad8=0x0,_0x568a02;_0x4bbad8<_0x422a0f[_0x75af('0x39')];_0x4bbad8+=0x1){_0x568a02=_0x422a0f[_0x4bbad8]['get']({'plain':!![]});switch(_0x568a02[_0x75af('0x36')]){case'always':_0x4ac476(_0x568a02)[_0x75af('0x28')](_0x1e3176());break;case _0x75af('0x3a'):_0x1842b6(_0x568a02)[_0x75af('0x28')](_0x1e3176());break;default:_0x420b80(_0x568a02,_0x5ce75c)[_0x75af('0x1c')](function(_0x58a58a){_0x5ce75c[_0x75af('0x18')]=_0x58a58a['ret'];_0x49e4de[_0x75af('0x23')][_0x75af('0x25')]({'phone':_0x5ce75c[_0x75af('0xd')],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c['ListId'],'scheduledat':_0x5ce75c[_0x75af('0x18')]?_0x5ce75c[_0x75af('0x18')]:moment()['format'](_0x75af('0x22')),'priority':_0x5ce75c[_0x75af('0x26')]?_0x5ce75c['priority']:0x2,'callback':_0x5ce75c[_0x75af('0x27')]?!![]:![],'callbackuniqueid':_0x5ce75c[_0x75af('0x27')]?_0x5ce75c[_0x75af('0x27')]:undefined,'callbackat':_0x5ce75c['callbackUniqueid']?moment()['format'](_0x75af('0x22')):undefined,'VoiceQueueId':_0x568a02['id']})[_0x75af('0x28')](_0x1e3176());});}}}})[_0x75af('0x1c')](function(){return _0x49e4de[_0x75af('0x1a')][_0x75af('0x34')]({'where':{'type':_0x75af('0x35')},'attributes':['id'],'include':[{'model':_0x49e4de[_0x75af('0x37')],'as':_0x75af('0x3b'),'where':{'id':_0x5ce75c[_0x75af('0x2d')]}}]})['then'](function(_0x51f28e){if(_0x51f28e){var _0x237562=[];for(var _0x4ec9fa=0x0,_0x3d38fa;_0x4ec9fa<_0x51f28e['length'];_0x4ec9fa+=0x1){_0x3d38fa=_0x51f28e[_0x4ec9fa][_0x75af('0x14')]({'plain':!![]});_0x49e4de[_0x75af('0x3c')][_0x75af('0x25')]({'phone':_0x5ce75c[_0x75af('0xd')],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c[_0x75af('0x2d')],'VoiceQueueId':_0x3d38fa['id']})[_0x75af('0x28')](function(_0x4b1685){logger[_0x75af('0x15')]('cmContact,\x20%s,\x20%s',_0x75af('0x2e'),_0x4b1685[_0x75af('0x3d')]);});}}});})[_0x75af('0x1c')](function(){return _0x49e4de['Campaign'][_0x75af('0x34')]({'attributes':['id',_0x75af('0x36'),_0x75af('0x1d')],'include':[{'model':_0x49e4de[_0x75af('0x37')],'as':_0x75af('0x38'),'where':{'id':_0x5ce75c[_0x75af('0x2d')]}}]})['then'](function(_0x4908c0){if(_0x4908c0){var _0x2653a5=[];for(var _0x440d8c=0x0,_0xab0eb3;_0x440d8c<_0x4908c0[_0x75af('0x39')];_0x440d8c+=0x1){_0xab0eb3=_0x4908c0[_0x440d8c][_0x75af('0x14')]({'plain':!![]});switch(_0xab0eb3[_0x75af('0x36')]){case _0x75af('0x3e'):_0x5c3c86(_0xab0eb3)[_0x75af('0x28')](_0x40de2d());break;case'onlyIfOpen':_0x234b67(_0xab0eb3)[_0x75af('0x28')](_0x40de2d());break;default:_0x49e4de[_0x75af('0x23')][_0x75af('0x25')]({'phone':_0x5ce75c[_0x75af('0xd')],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c['ListId'],'scheduledat':_0x5ce75c[_0x75af('0x18')]?_0x5ce75c['scheduledat']:moment()[_0x75af('0x21')](_0x75af('0x22')),'priority':_0x5ce75c[_0x75af('0x26')]?_0x5ce75c[_0x75af('0x26')]:0x2,'callback':_0x5ce75c[_0x75af('0x27')]?!![]:![],'callbackuniqueid':_0x5ce75c[_0x75af('0x27')]?_0x5ce75c[_0x75af('0x27')]:undefined,'callbackat':_0x5ce75c[_0x75af('0x27')]?moment()[_0x75af('0x21')](_0x75af('0x22')):undefined,'CampaignId':_0xab0eb3['id']})[_0x75af('0x28')](_0x40de2d());}}}});})[_0x75af('0x1c')](function(){return _0x49e4de[_0x75af('0x3f')][_0x75af('0x34')]({'attributes':['id'],'include':[{'model':_0x49e4de[_0x75af('0x37')],'as':_0x75af('0x3b'),'where':{'id':_0x5ce75c[_0x75af('0x2d')]}}]})[_0x75af('0x1c')](function(_0x272aa8){if(_0x272aa8){var _0x5ca93c=[];for(var _0x49f7fb=0x0,_0x1a4f11;_0x49f7fb<_0x272aa8[_0x75af('0x39')];_0x49f7fb+=0x1){_0x1a4f11=_0x272aa8[_0x49f7fb][_0x75af('0x14')]({'plain':!![]});_0x49e4de[_0x75af('0x3c')]['create']({'phone':_0x5ce75c[_0x75af('0xd')],'ContactId':_0x5ce75c['id'],'ListId':_0x5ce75c[_0x75af('0x2d')],'CampaignId':_0x1a4f11['id']})['catch'](function(_0x530093){logger[_0x75af('0x15')]('cmContact,\x20%s,\x20%s',_0x75af('0x2e'),_0x530093[_0x75af('0x3d')]);});}}});})[_0x75af('0x1c')](function(){_0x518918();})[_0x75af('0x28')](function(_0x574a59){logger[_0x75af('0x15')](_0x75af('0x40'),'afterCreate',_0x574a59[_0x75af('0x3d')]);_0x518918(_0x574a59);});}else{_0x518918(new Error(_0x75af('0x41')));}},'afterDestroy':function(_0x1a292b,_0x606c79,_0x49e2cb){var _0x1b3170=_0x54505c[_0x75af('0x13')];var _0x1d36b1=_0x1a292b[_0x75af('0x14')]({'plain':!![]});return _0x1b3170['CmHopper'][_0x75af('0x34')]({'raw':!![],'where':{'ListId':_0x1d36b1[_0x75af('0x2d')],'ContactId':_0x1d36b1['id']}})[_0x75af('0x1c')](function(_0x24ccdc){if(!_[_0x75af('0x42')](_0x24ccdc)){var _0x256641=[];for(var _0x2808af=0x0;_0x2808af<_0x24ccdc[_0x75af('0x39')];_0x2808af+=0x1){var _0x237c2e=_0x1b3170[_0x75af('0x23')][_0x75af('0x43')]({'where':{'ListId':_0x24ccdc[_0x2808af]['ListId'],'ContactId':_0x24ccdc[_0x2808af]['ContactId'],'VoiceQueueId':_0x24ccdc[_0x2808af][_0x75af('0x44')],'CampaignId':_0x24ccdc[_0x2808af][_0x75af('0x45')]}});_0x256641[_0x75af('0x46')](_0x237c2e);}return BPromise[_0x75af('0x47')](_0x256641);}})[_0x75af('0x1c')](function(_0xd7373c){logger[_0x75af('0x48')]('[CmContact][afterDestroy][Succesfull]',util[_0x75af('0x17')](_0xd7373c,{'showHidden':![],'depth':null}));_0x49e2cb();})[_0x75af('0x28')](function(_0x2296ad){logger[_0x75af('0x15')]('[CmContact][afterDestroy][Error]',util[_0x75af('0x17')](_0x2296ad,{'showHidden':![],'depth':null}));_0x49e2cb(_0x2296ad);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 66d5f15..03c1d09 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x411d34,_0x328479){var _0x412d36=function(_0x29a84f){while(--_0x29a84f){_0x411d34['push'](_0x411d34['shift']());}};_0x412d36(++_0x328479);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 945db61..7a2fe42 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 _0x765b=['STRING','INTEGER'];(function(_0x36e328,_0xf3f97b){var _0x49d6e9=function(_0x58a9a5){while(--_0x58a9a5){_0x36e328['push'](_0x36e328['shift']());}};_0x49d6e9(++_0xf3f97b);}(_0x765b,0x18c));var _0xb765=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0x765b[_0x3b7b8a];return _0x441206;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xb765('0x0')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xb765('0x0')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xb765('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xb765('0x0')],'defaultValue':null}}; \ No newline at end of file +var _0xdb4b=['STRING','INTEGER','PHONE','exports'];(function(_0x37c88c,_0x211269){var _0x2ad952=function(_0x4f4b8f){while(--_0x4f4b8f){_0x37c88c['push'](_0x37c88c['shift']());}};_0x2ad952(++_0x211269);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x397004,_0x7949f){_0x397004=_0x397004-0x0;var _0xa7a10=_0xdb4b[_0x397004];return _0xa7a10;};'use strict';var Sequelize=require('sequelize');module[_0xbdb4('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xbdb4('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xbdb4('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xbdb4('0x1')],'defaultValue':_0xbdb4('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xbdb4('0x1')],'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 39423f3..8e8de3b 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 _0x696e=['name','send','CmContactHasItem','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','error','stack'];(function(_0x590455,_0x338a42){var _0x1b5a98=function(_0x29f08c){while(--_0x29f08c){_0x590455['push'](_0x590455['shift']());}};_0x1b5a98(++_0x338a42);}(_0x696e,0x16a));var _0xe696=function(_0x2456a6,_0x4ccbdb){_0x2456a6=_0x2456a6-0x0;var _0x849833=_0x696e[_0x2456a6];return _0x849833;};'use strict';var emlformat=require(_0xe696('0x0'));var rimraf=require(_0xe696('0x1'));var zipdir=require(_0xe696('0x2'));var jsonpatch=require(_0xe696('0x3'));var rp=require(_0xe696('0x4'));var moment=require(_0xe696('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe696('0x6'));var path=require(_0xe696('0x7'));var sox=require(_0xe696('0x8'));var csv=require(_0xe696('0x9'));var ejs=require(_0xe696('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe696('0xb'));var squel=require(_0xe696('0xc'));var crypto=require(_0xe696('0xd'));var jsforce=require(_0xe696('0xe'));var deskjs=require(_0xe696('0xf'));var toCsv=require(_0xe696('0x9'));var querystring=require(_0xe696('0x10'));var Papa=require(_0xe696('0x11'));var Redis=require(_0xe696('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe696('0x13'));var as=require(_0xe696('0x14'));var hardwareService=require(_0xe696('0x15'));var logger=require(_0xe696('0x16'))(_0xe696('0x17'));var utils=require(_0xe696('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe696('0x19'))['db'];function respondWithStatusCode(_0x6868cb,_0x3c3d20){_0x3c3d20=_0x3c3d20||0xcc;return function(_0x2ebbcb){if(_0x2ebbcb){return _0x6868cb[_0xe696('0x1a')](_0x3c3d20);}return _0x6868cb[_0xe696('0x1b')](_0x3c3d20)[_0xe696('0x1c')]();};}function respondWithResult(_0x4c7fe8,_0x1ee103){_0x1ee103=_0x1ee103||0xc8;return function(_0x777dfc){if(_0x777dfc){return _0x4c7fe8[_0xe696('0x1b')](_0x1ee103)['json'](_0x777dfc);}};}function respondWithFilteredResult(_0x12c4dd,_0x3617cf){return function(_0x2e2a51){if(_0x2e2a51){var _0x534d48=typeof _0x3617cf[_0xe696('0x1d')]==='undefined'&&typeof _0x3617cf[_0xe696('0x1e')]===_0xe696('0x1f');var _0x3c1e8a=_0x2e2a51['count'];var _0x20fa4f=_0x534d48?0x0:_0x3617cf['offset'];var _0x27f12c=_0x534d48?_0x2e2a51[_0xe696('0x20')]:_0x3617cf[_0xe696('0x1d')]+_0x3617cf[_0xe696('0x1e')];var _0x7237bd;if(_0x27f12c>=_0x3c1e8a){_0x27f12c=_0x3c1e8a;_0x7237bd=0xc8;}else{_0x7237bd=0xce;}_0x12c4dd[_0xe696('0x1b')](_0x7237bd);return _0x12c4dd[_0xe696('0x21')](_0xe696('0x22'),_0x20fa4f+'-'+_0x27f12c+'/'+_0x3c1e8a)['json'](_0x2e2a51);}return null;};}function patchUpdates(_0x51a70c){return function(_0x4c2e6f){try{jsonpatch['apply'](_0x4c2e6f,_0x51a70c,!![]);}catch(_0x1d0c93){return BPromise[_0xe696('0x23')](_0x1d0c93);}return _0x4c2e6f[_0xe696('0x24')]();};}function saveUpdates(_0x5609f2,_0x22d187){return function(_0xe0ed64){if(_0xe0ed64){return _0xe0ed64[_0xe696('0x25')](_0x5609f2)[_0xe696('0x26')](function(_0x1b9311){return _0x1b9311;});}return null;};}function removeEntity(_0x1fae3c,_0x3c6965){return function(_0x1324cb){if(_0x1324cb){return _0x1324cb['destroy']()[_0xe696('0x26')](function(){var _0x13f694=_0x1324cb[_0xe696('0x27')]({'plain':!![]});var _0x403c33='CmContactHasItems';return db[_0xe696('0x28')]['destroy']({'where':{'type':_0x403c33,'resourceId':_0x13f694['id']}})['then'](function(){return _0x1324cb;});})[_0xe696('0x26')](function(){_0x1fae3c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aa4bc,_0x43583f){return function(_0x6227b4){if(!_0x6227b4){_0x2aa4bc['sendStatus'](0x194);}return _0x6227b4;};}function handleError(_0x526d01,_0x24bf0c){_0x24bf0c=_0x24bf0c||0x1f4;return function(_0x6df676){logger[_0xe696('0x29')](_0x6df676[_0xe696('0x2a')]);if(_0x6df676[_0xe696('0x2b')]){delete _0x6df676[_0xe696('0x2b')];}_0x526d01[_0xe696('0x1b')](_0x24bf0c)[_0xe696('0x2c')](_0x6df676);};}exports['index']=function(_0x3262af,_0x396c33){var _0x50eaef={},_0x42f6d0={},_0x2d3228={'count':0x0,'rows':[]};var _0x150884=_['map'](db[_0xe696('0x2d')]['rawAttributes'],function(_0x280fcd){return{'name':_0x280fcd[_0xe696('0x2e')],'type':_0x280fcd[_0xe696('0x2f')][_0xe696('0x30')]};});_0x42f6d0[_0xe696('0x31')]=_[_0xe696('0x32')](_0x150884,_0xe696('0x2b'));_0x42f6d0[_0xe696('0x33')]=_['keys'](_0x3262af[_0xe696('0x33')]);_0x42f6d0[_0xe696('0x34')]=_[_0xe696('0x35')](_0x42f6d0[_0xe696('0x31')],_0x42f6d0['query']);_0x50eaef[_0xe696('0x36')]=_[_0xe696('0x35')](_0x42f6d0[_0xe696('0x31')],qs['fields'](_0x3262af[_0xe696('0x33')][_0xe696('0x37')]));_0x50eaef[_0xe696('0x36')]=_0x50eaef[_0xe696('0x36')]['length']?_0x50eaef[_0xe696('0x36')]:_0x42f6d0['model'];if(!_0x3262af['query']['hasOwnProperty'](_0xe696('0x38'))){_0x50eaef['limit']=qs['limit'](_0x3262af[_0xe696('0x33')][_0xe696('0x1e')]);_0x50eaef['offset']=qs[_0xe696('0x1d')](_0x3262af['query']['offset']);}_0x50eaef[_0xe696('0x39')]=qs[_0xe696('0x3a')](_0x3262af[_0xe696('0x33')]['sort']);_0x50eaef[_0xe696('0x3b')]=qs[_0xe696('0x34')](_[_0xe696('0x3c')](_0x3262af['query'],_0x42f6d0['filters']),_0x150884);if(_0x3262af[_0xe696('0x33')][_0xe696('0x3d')]){_0x50eaef[_0xe696('0x3b')]=_[_0xe696('0x3e')](_0x50eaef[_0xe696('0x3b')],{'$or':_[_0xe696('0x32')](_0x150884,function(_0x335ae4){if(_0x335ae4[_0xe696('0x2f')]!==_0xe696('0x3f')){var _0x443053={};_0x443053[_0x335ae4[_0xe696('0x2b')]]={'$like':'%'+_0x3262af[_0xe696('0x33')][_0xe696('0x3d')]+'%'};return _0x443053;}})});}_0x50eaef=_[_0xe696('0x3e')]({},_0x50eaef,_0x3262af[_0xe696('0x40')]);var _0x512f1e={'where':_0x50eaef[_0xe696('0x3b')]};return db['CmContactHasItem'][_0xe696('0x20')](_0x512f1e)['then'](function(_0x37ce8b){_0x2d3228[_0xe696('0x20')]=_0x37ce8b;if(_0x3262af[_0xe696('0x33')][_0xe696('0x41')]){_0x50eaef[_0xe696('0x42')]=[{'all':!![]}];}return db[_0xe696('0x2d')][_0xe696('0x43')](_0x50eaef);})[_0xe696('0x26')](function(_0x5ee296){_0x2d3228['rows']=_0x5ee296;return _0x2d3228;})[_0xe696('0x26')](respondWithFilteredResult(_0x396c33,_0x50eaef))[_0xe696('0x44')](handleError(_0x396c33,null));};exports['show']=function(_0x9036b3,_0x22180a){var _0x4ad435={'raw':!![],'where':{'id':_0x9036b3[_0xe696('0x45')]['id']}},_0x56ba7e={};_0x56ba7e['model']=_[_0xe696('0x46')](db[_0xe696('0x2d')]['rawAttributes']);_0x56ba7e['query']=_[_0xe696('0x46')](_0x9036b3[_0xe696('0x33')]);_0x56ba7e[_0xe696('0x34')]=_['intersection'](_0x56ba7e[_0xe696('0x31')],_0x56ba7e[_0xe696('0x33')]);_0x4ad435[_0xe696('0x36')]=_['intersection'](_0x56ba7e[_0xe696('0x31')],qs['fields'](_0x9036b3[_0xe696('0x33')][_0xe696('0x37')]));_0x4ad435['attributes']=_0x4ad435[_0xe696('0x36')]['length']?_0x4ad435[_0xe696('0x36')]:_0x56ba7e[_0xe696('0x31')];if(_0x9036b3[_0xe696('0x33')][_0xe696('0x41')]){_0x4ad435[_0xe696('0x42')]=[{'all':!![]}];}_0x4ad435=_[_0xe696('0x3e')]({},_0x4ad435,_0x9036b3[_0xe696('0x40')]);return db[_0xe696('0x2d')][_0xe696('0x47')](_0x4ad435)[_0xe696('0x26')](handleEntityNotFound(_0x22180a,null))[_0xe696('0x26')](respondWithResult(_0x22180a,null))[_0xe696('0x44')](handleError(_0x22180a,null));};exports[_0xe696('0x48')]=function(_0x1f8d62,_0x14c0c0){return db['CmContactHasItem'][_0xe696('0x48')](_0x1f8d62['body'],{})[_0xe696('0x26')](function(_0x3d8484){var _0x37301b=_0x1f8d62[_0xe696('0x49')][_0xe696('0x27')]({'plain':!![]});if(!_0x37301b)throw new Error(_0xe696('0x4a'));if(_0x37301b[_0xe696('0x4b')]==='user'){var _0x11b9b2=_0x3d8484[_0xe696('0x27')]({'plain':!![]});var _0x82a6b5=_0xe696('0x4c');return db[_0xe696('0x4d')][_0xe696('0x47')]({'where':{'name':_0x82a6b5,'userProfileId':_0x37301b['userProfileId']},'raw':!![]})[_0xe696('0x26')](function(_0x5b5d1d){if(_0x5b5d1d&&_0x5b5d1d[_0xe696('0x4e')]===0x0){return db[_0xe696('0x28')]['create']({'name':_0x11b9b2[_0xe696('0x2b')],'resourceId':_0x11b9b2['id'],'type':_0x5b5d1d[_0xe696('0x2b')],'sectionId':_0x5b5d1d['id']},{})['then'](function(){return _0x3d8484;});}else{return _0x3d8484;}})[_0xe696('0x44')](function(_0x2bc6ab){logger[_0xe696('0x29')](_0xe696('0x4f'),_0x2bc6ab);throw _0x2bc6ab;});}return _0x3d8484;})['then'](respondWithResult(_0x14c0c0,0xc9))[_0xe696('0x44')](handleError(_0x14c0c0,null));};exports[_0xe696('0x25')]=function(_0x93ab86,_0x1c9954){if(_0x93ab86[_0xe696('0x50')]['id']){delete _0x93ab86[_0xe696('0x50')]['id'];}return db[_0xe696('0x2d')][_0xe696('0x47')]({'where':{'id':_0x93ab86[_0xe696('0x45')]['id']}})[_0xe696('0x26')](handleEntityNotFound(_0x1c9954,null))[_0xe696('0x26')](saveUpdates(_0x93ab86[_0xe696('0x50')],null))[_0xe696('0x26')](respondWithResult(_0x1c9954,null))[_0xe696('0x44')](handleError(_0x1c9954,null));};exports['destroy']=function(_0x10507b,_0x9b1016){return db['CmContactHasItem']['find']({'where':{'id':_0x10507b['params']['id']}})[_0xe696('0x26')](handleEntityNotFound(_0x9b1016,null))[_0xe696('0x26')](removeEntity(_0x9b1016,null))[_0xe696('0x44')](handleError(_0x9b1016,null));}; \ No newline at end of file +var _0x5230=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','CmContactHasItems','UserProfileResource','destroy','error','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort'];(function(_0x15b817,_0x26beac){var _0x56dd81=function(_0x17159d){while(--_0x17159d){_0x15b817['push'](_0x15b817['shift']());}};_0x56dd81(++_0x26beac);}(_0x5230,0x1f0));var _0x0523=function(_0x36c71f,_0x2846e8){_0x36c71f=_0x36c71f-0x0;var _0x3863ce=_0x5230[_0x36c71f];return _0x3863ce;};'use strict';var emlformat=require(_0x0523('0x0'));var rimraf=require(_0x0523('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0523('0x2'));var rp=require(_0x0523('0x3'));var moment=require(_0x0523('0x4'));var BPromise=require(_0x0523('0x5'));var Mustache=require(_0x0523('0x6'));var util=require('util');var path=require(_0x0523('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0523('0x8'));var fs=require('fs');var fs_extra=require(_0x0523('0x9'));var _=require(_0x0523('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0523('0xb'));var deskjs=require(_0x0523('0xc'));var toCsv=require(_0x0523('0xd'));var querystring=require(_0x0523('0xe'));var Papa=require(_0x0523('0xf'));var Redis=require(_0x0523('0x10'));var authService=require(_0x0523('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0523('0x12'));var logger=require(_0x0523('0x13'))('api');var utils=require(_0x0523('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0523('0x15'));var db=require(_0x0523('0x16'))['db'];function respondWithStatusCode(_0x1915b7,_0x3b5a5c){_0x3b5a5c=_0x3b5a5c||0xcc;return function(_0x3b3c14){if(_0x3b3c14){return _0x1915b7[_0x0523('0x17')](_0x3b5a5c);}return _0x1915b7[_0x0523('0x18')](_0x3b5a5c)[_0x0523('0x19')]();};}function respondWithResult(_0x12c2a5,_0x4acc63){_0x4acc63=_0x4acc63||0xc8;return function(_0x3a74f5){if(_0x3a74f5){return _0x12c2a5['status'](_0x4acc63)[_0x0523('0x1a')](_0x3a74f5);}};}function respondWithFilteredResult(_0x5f4bb4,_0x53b8d4){return function(_0x1891ff){if(_0x1891ff){var _0x5a628a=typeof _0x53b8d4[_0x0523('0x1b')]===_0x0523('0x1c')&&typeof _0x53b8d4[_0x0523('0x1d')]===_0x0523('0x1c');var _0x18cd70=_0x1891ff[_0x0523('0x1e')];var _0x5ba1e8=_0x5a628a?0x0:_0x53b8d4[_0x0523('0x1b')];var _0x4e3669=_0x5a628a?_0x1891ff[_0x0523('0x1e')]:_0x53b8d4[_0x0523('0x1b')]+_0x53b8d4[_0x0523('0x1d')];var _0x579e1e;if(_0x4e3669>=_0x18cd70){_0x4e3669=_0x18cd70;_0x579e1e=0xc8;}else{_0x579e1e=0xce;}_0x5f4bb4['status'](_0x579e1e);return _0x5f4bb4[_0x0523('0x1f')](_0x0523('0x20'),_0x5ba1e8+'-'+_0x4e3669+'/'+_0x18cd70)['json'](_0x1891ff);}return null;};}function patchUpdates(_0x1eb2df){return function(_0x10c504){try{jsonpatch[_0x0523('0x21')](_0x10c504,_0x1eb2df,!![]);}catch(_0x4e4160){return BPromise['reject'](_0x4e4160);}return _0x10c504['save']();};}function saveUpdates(_0x3d58eb,_0x516af1){return function(_0x418280){if(_0x418280){return _0x418280['update'](_0x3d58eb)[_0x0523('0x22')](function(_0x33f557){return _0x33f557;});}return null;};}function removeEntity(_0x416c3e,_0x946c17){return function(_0x54441c){if(_0x54441c){return _0x54441c['destroy']()[_0x0523('0x22')](function(){var _0x5b611b=_0x54441c[_0x0523('0x23')]({'plain':!![]});var _0x20f3d1=_0x0523('0x24');return db[_0x0523('0x25')][_0x0523('0x26')]({'where':{'type':_0x20f3d1,'resourceId':_0x5b611b['id']}})[_0x0523('0x22')](function(){return _0x54441c;});})[_0x0523('0x22')](function(){_0x416c3e[_0x0523('0x18')](0xcc)[_0x0523('0x19')]();});}};}function handleEntityNotFound(_0x271ed7,_0x1160d5){return function(_0x31ddd5){if(!_0x31ddd5){_0x271ed7[_0x0523('0x17')](0x194);}return _0x31ddd5;};}function handleError(_0x155e70,_0x105084){_0x105084=_0x105084||0x1f4;return function(_0x4309aa){logger[_0x0523('0x27')](_0x4309aa['stack']);if(_0x4309aa['name']){delete _0x4309aa[_0x0523('0x28')];}_0x155e70[_0x0523('0x18')](_0x105084)[_0x0523('0x29')](_0x4309aa);};}exports[_0x0523('0x2a')]=function(_0x5bae1f,_0x146861){var _0x318289={},_0x3a10d5={},_0x50b74e={'count':0x0,'rows':[]};var _0x450502=_['map'](db[_0x0523('0x2b')][_0x0523('0x2c')],function(_0x109de1){return{'name':_0x109de1[_0x0523('0x2d')],'type':_0x109de1[_0x0523('0x2e')]['key']};});_0x3a10d5[_0x0523('0x2f')]=_[_0x0523('0x30')](_0x450502,_0x0523('0x28'));_0x3a10d5[_0x0523('0x31')]=_['keys'](_0x5bae1f[_0x0523('0x31')]);_0x3a10d5[_0x0523('0x32')]=_[_0x0523('0x33')](_0x3a10d5[_0x0523('0x2f')],_0x3a10d5[_0x0523('0x31')]);_0x318289['attributes']=_['intersection'](_0x3a10d5['model'],qs[_0x0523('0x34')](_0x5bae1f[_0x0523('0x31')]['fields']));_0x318289[_0x0523('0x35')]=_0x318289['attributes']['length']?_0x318289[_0x0523('0x35')]:_0x3a10d5[_0x0523('0x2f')];if(!_0x5bae1f[_0x0523('0x31')][_0x0523('0x36')]('nolimit')){_0x318289['limit']=qs[_0x0523('0x1d')](_0x5bae1f[_0x0523('0x31')][_0x0523('0x1d')]);_0x318289[_0x0523('0x1b')]=qs[_0x0523('0x1b')](_0x5bae1f[_0x0523('0x31')][_0x0523('0x1b')]);}_0x318289[_0x0523('0x37')]=qs['sort'](_0x5bae1f['query'][_0x0523('0x38')]);_0x318289[_0x0523('0x39')]=qs['filters'](_['pick'](_0x5bae1f[_0x0523('0x31')],_0x3a10d5['filters']),_0x450502);if(_0x5bae1f[_0x0523('0x31')][_0x0523('0x3a')]){_0x318289[_0x0523('0x39')]=_['merge'](_0x318289[_0x0523('0x39')],{'$or':_['map'](_0x450502,function(_0x494f18){if(_0x494f18[_0x0523('0x2e')]!==_0x0523('0x3b')){var _0x5da04b={};_0x5da04b[_0x494f18[_0x0523('0x28')]]={'$like':'%'+_0x5bae1f['query'][_0x0523('0x3a')]+'%'};return _0x5da04b;}})});}_0x318289=_[_0x0523('0x3c')]({},_0x318289,_0x5bae1f[_0x0523('0x3d')]);var _0x17cfce={'where':_0x318289['where']};return db[_0x0523('0x2b')][_0x0523('0x1e')](_0x17cfce)[_0x0523('0x22')](function(_0x1eefb5){_0x50b74e[_0x0523('0x1e')]=_0x1eefb5;if(_0x5bae1f[_0x0523('0x31')][_0x0523('0x3e')]){_0x318289[_0x0523('0x3f')]=[{'all':!![]}];}return db[_0x0523('0x2b')][_0x0523('0x40')](_0x318289);})['then'](function(_0x5e7672){_0x50b74e['rows']=_0x5e7672;return _0x50b74e;})[_0x0523('0x22')](respondWithFilteredResult(_0x146861,_0x318289))[_0x0523('0x41')](handleError(_0x146861,null));};exports[_0x0523('0x42')]=function(_0x4729be,_0x55f0e1){var _0x2b2493={'raw':!![],'where':{'id':_0x4729be['params']['id']}},_0x2d2a31={};_0x2d2a31[_0x0523('0x2f')]=_[_0x0523('0x43')](db[_0x0523('0x2b')]['rawAttributes']);_0x2d2a31[_0x0523('0x31')]=_[_0x0523('0x43')](_0x4729be['query']);_0x2d2a31[_0x0523('0x32')]=_[_0x0523('0x33')](_0x2d2a31[_0x0523('0x2f')],_0x2d2a31[_0x0523('0x31')]);_0x2b2493[_0x0523('0x35')]=_[_0x0523('0x33')](_0x2d2a31[_0x0523('0x2f')],qs['fields'](_0x4729be[_0x0523('0x31')]['fields']));_0x2b2493[_0x0523('0x35')]=_0x2b2493[_0x0523('0x35')][_0x0523('0x44')]?_0x2b2493['attributes']:_0x2d2a31[_0x0523('0x2f')];if(_0x4729be[_0x0523('0x31')][_0x0523('0x3e')]){_0x2b2493[_0x0523('0x3f')]=[{'all':!![]}];}_0x2b2493=_[_0x0523('0x3c')]({},_0x2b2493,_0x4729be[_0x0523('0x3d')]);return db['CmContactHasItem'][_0x0523('0x45')](_0x2b2493)[_0x0523('0x22')](handleEntityNotFound(_0x55f0e1,null))[_0x0523('0x22')](respondWithResult(_0x55f0e1,null))[_0x0523('0x41')](handleError(_0x55f0e1,null));};exports[_0x0523('0x46')]=function(_0x26387b,_0x4e8a55){return db[_0x0523('0x2b')]['create'](_0x26387b[_0x0523('0x47')],{})[_0x0523('0x22')](function(_0x44df1f){var _0x310906=_0x26387b[_0x0523('0x48')][_0x0523('0x23')]({'plain':!![]});if(!_0x310906)throw new Error(_0x0523('0x49'));if(_0x310906[_0x0523('0x4a')]==='user'){var _0x548647=_0x44df1f['get']({'plain':!![]});var _0x2fe53d='CmContactHasItems';return db[_0x0523('0x4b')]['find']({'where':{'name':_0x2fe53d,'userProfileId':_0x310906['userProfileId']},'raw':!![]})[_0x0523('0x22')](function(_0x2f6855){if(_0x2f6855&&_0x2f6855[_0x0523('0x4c')]===0x0){return db[_0x0523('0x25')]['create']({'name':_0x548647[_0x0523('0x28')],'resourceId':_0x548647['id'],'type':_0x2f6855[_0x0523('0x28')],'sectionId':_0x2f6855['id']},{})[_0x0523('0x22')](function(){return _0x44df1f;});}else{return _0x44df1f;}})[_0x0523('0x41')](function(_0x4b80ad){logger[_0x0523('0x27')](_0x0523('0x4d'),_0x4b80ad);throw _0x4b80ad;});}return _0x44df1f;})[_0x0523('0x22')](respondWithResult(_0x4e8a55,0xc9))[_0x0523('0x41')](handleError(_0x4e8a55,null));};exports[_0x0523('0x4e')]=function(_0x3e274b,_0x346019){if(_0x3e274b[_0x0523('0x47')]['id']){delete _0x3e274b[_0x0523('0x47')]['id'];}return db['CmContactHasItem'][_0x0523('0x45')]({'where':{'id':_0x3e274b['params']['id']}})[_0x0523('0x22')](handleEntityNotFound(_0x346019,null))[_0x0523('0x22')](saveUpdates(_0x3e274b['body'],null))[_0x0523('0x22')](respondWithResult(_0x346019,null))[_0x0523('0x41')](handleError(_0x346019,null));};exports[_0x0523('0x26')]=function(_0x3f937f,_0xfbbe8f){return db[_0x0523('0x2b')]['find']({'where':{'id':_0x3f937f['params']['id']}})[_0x0523('0x22')](handleEntityNotFound(_0xfbbe8f,null))[_0x0523('0x22')](removeEntity(_0xfbbe8f,null))[_0x0523('0x41')](handleError(_0xfbbe8f,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 72ae9f5..48805b9 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 _0x6b07=['./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6b07,0xa9));var _0x76b0=function(_0x3d76b8,_0x3d1e1c){_0x3d76b8=_0x3d76b8-0x0;var _0x1fd3bb=_0x6b07[_0x3d76b8];return _0x1fd3bb;};'use strict';var _=require(_0x76b0('0x0'));var util=require(_0x76b0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x76b0('0x2'));var BPromise=require(_0x76b0('0x3'));var rp=require(_0x76b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76b0('0x5'));var config=require(_0x76b0('0x6'));var attributes=require(_0x76b0('0x7'));module[_0x76b0('0x8')]=function(_0x14cae5,_0x3f4cfc){return _0x14cae5['define'](_0x76b0('0x9'),attributes,{'tableName':_0x76b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b10=['rimraf','exports','define','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a3cf6,_0x10a82f){var _0x5de42b=function(_0x16727f){while(--_0x16727f){_0x5a3cf6['push'](_0x5a3cf6['shift']());}};_0x5de42b(++_0x10a82f);}(_0x9b10,0x15a));var _0x09b1=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9b10[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x09b1('0x0'));var util=require('util');var logger=require(_0x09b1('0x1'))(_0x09b1('0x2'));var moment=require(_0x09b1('0x3'));var BPromise=require(_0x09b1('0x4'));var rp=require(_0x09b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09b1('0x6'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x09b1('0x7')]=function(_0xbdcec4,_0x2361a3){return _0xbdcec4[_0x09b1('0x8')](_0x09b1('0x9'),attributes,{'tableName':_0x09b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index cd572aa..4e6973b 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 _0x9664=['../../config/logger','rpc','client','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x15293d,_0x4c9514){var _0x1bc1e0=function(_0x1ff64a){while(--_0x1ff64a){_0x15293d['push'](_0x15293d['shift']());}};_0x1bc1e0(++_0x4c9514);}(_0x9664,0x8b));var _0x4966=function(_0x142071,_0x500736){_0x142071=_0x142071-0x0;var _0x8a949f=_0x9664[_0x142071];return _0x8a949f;};'use strict';var _=require('lodash');var util=require(_0x4966('0x0'));var moment=require(_0x4966('0x1'));var BPromise=require(_0x4966('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4966('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4966('0x4'));var logger=require(_0x4966('0x5'))(_0x4966('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4966('0x7')][_0x4966('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ed7c6,_0xa04d4f,_0x281bc4){return new BPromise(function(_0xb3b0f1,_0x391201){return client[_0x4966('0x9')](_0x3ed7c6,_0x281bc4)['then'](function(_0x6172ab){logger['info'](_0x4966('0xa'),_0xa04d4f,_0x4966('0xb'));logger[_0x4966('0xc')](_0x4966('0xd'),_0xa04d4f,'request\x20sent',JSON[_0x4966('0xe')](_0x6172ab));if(_0x6172ab[_0x4966('0xf')]){if(_0x6172ab['error'][_0x4966('0x10')]===0x1f4){logger[_0x4966('0xf')](_0x4966('0xa'),_0xa04d4f,_0x6172ab['error'][_0x4966('0x11')]);return _0x391201(_0x6172ab[_0x4966('0xf')][_0x4966('0x11')]);}logger[_0x4966('0xf')](_0x4966('0xa'),_0xa04d4f,_0x6172ab['error'][_0x4966('0x11')]);return _0xb3b0f1(_0x6172ab[_0x4966('0xf')][_0x4966('0x11')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0xa04d4f,'request\x20sent');_0xb3b0f1(_0x6172ab['result']['message']);}})['catch'](function(_0x547cf9){logger[_0x4966('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0xa04d4f,_0x547cf9);_0x391201(_0x547cf9);});});} \ No newline at end of file +var _0xf103=['util','moment','randomstring','ioredis','../../config/logger','client','http','request','then','info','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf103,0x8b));var _0x3f10=function(_0x3685d1,_0x30868b){_0x3685d1=_0x3685d1-0x0;var _0x35e9cc=_0xf103[_0x3685d1];return _0x35e9cc;};'use strict';var _=require(_0x3f10('0x0'));var util=require(_0x3f10('0x1'));var moment=require(_0x3f10('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f10('0x3'));var fs=require('fs');var Redis=require(_0x3f10('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f10('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f10('0x6')][_0x3f10('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x285746,_0x1c67dd,_0x57b7c8){return new BPromise(function(_0x3ee355,_0x3b3865){return client[_0x3f10('0x8')](_0x285746,_0x57b7c8)[_0x3f10('0x9')](function(_0x5b7ffe){logger[_0x3f10('0xa')]('CmContactHasItem,\x20%s,\x20%s',_0x1c67dd,'request\x20sent');logger[_0x3f10('0xb')](_0x3f10('0xc'),_0x1c67dd,_0x3f10('0xd'),JSON[_0x3f10('0xe')](_0x5b7ffe));if(_0x5b7ffe['error']){if(_0x5b7ffe[_0x3f10('0xf')][_0x3f10('0x10')]===0x1f4){logger[_0x3f10('0xf')](_0x3f10('0x11'),_0x1c67dd,_0x5b7ffe[_0x3f10('0xf')][_0x3f10('0x12')]);return _0x3b3865(_0x5b7ffe[_0x3f10('0xf')]['message']);}logger[_0x3f10('0xf')](_0x3f10('0x11'),_0x1c67dd,_0x5b7ffe[_0x3f10('0xf')]['message']);return _0x3ee355(_0x5b7ffe['error']['message']);}else{logger[_0x3f10('0xa')](_0x3f10('0x11'),_0x1c67dd,_0x3f10('0xd'));_0x3ee355(_0x5b7ffe['result'][_0x3f10('0x12')]);}})[_0x3f10('0x13')](function(_0x94266a){logger['error'](_0x3f10('0x11'),_0x1c67dd,_0x94266a);_0x3b3865(_0x94266a);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 351d9d6..0c2bbe6 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 _0x4e34=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','path'];(function(_0x479a36,_0x16ada3){var _0x2e17c8=function(_0x43327d){while(--_0x43327d){_0x479a36['push'](_0x479a36['shift']());}};_0x2e17c8(++_0x16ada3);}(_0x4e34,0x1d2));var _0x44e3=function(_0x543abc,_0x23f930){_0x543abc=_0x543abc-0x0;var _0xa316e4=_0x4e34[_0x543abc];return _0xa316e4;};'use strict';var multer=require(_0x44e3('0x0'));var util=require('util');var path=require(_0x44e3('0x1'));var timeout=require(_0x44e3('0x2'));var express=require(_0x44e3('0x3'));var router=express[_0x44e3('0x4')]();var fs_extra=require(_0x44e3('0x5'));var auth=require(_0x44e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x44e3('0x7'));var controller=require(_0x44e3('0x8'));router[_0x44e3('0x9')]('/',auth[_0x44e3('0xa')](),controller[_0x44e3('0xb')]);router['get'](_0x44e3('0xc'),auth[_0x44e3('0xa')](),controller['show']);router['post']('/',auth[_0x44e3('0xa')](),controller[_0x44e3('0xd')]);router['put'](_0x44e3('0xc'),auth['isAuthenticated'](),controller[_0x44e3('0xe')]);router[_0x44e3('0xf')](_0x44e3('0xc'),auth[_0x44e3('0xa')](),controller[_0x44e3('0x10')]);module[_0x44e3('0x11')]=router; \ No newline at end of file +var _0x7899=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x12ea80,_0x4656df){var _0x382c43=function(_0x3635e2){while(--_0x3635e2){_0x12ea80['push'](_0x12ea80['shift']());}};_0x382c43(++_0x4656df);}(_0x7899,0x168));var _0x9789=function(_0x272d90,_0x5e70ff){_0x272d90=_0x272d90-0x0;var _0x2bf4a2=_0x7899[_0x272d90];return _0x2bf4a2;};'use strict';var multer=require(_0x9789('0x0'));var util=require(_0x9789('0x1'));var path=require(_0x9789('0x2'));var timeout=require(_0x9789('0x3'));var express=require(_0x9789('0x4'));var router=express[_0x9789('0x5')]();var fs_extra=require(_0x9789('0x6'));var auth=require(_0x9789('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9789('0x8'));var controller=require('./cmContactHasItem.controller');router[_0x9789('0x9')]('/',auth[_0x9789('0xa')](),controller[_0x9789('0xb')]);router['get'](_0x9789('0xc'),auth['isAuthenticated'](),controller[_0x9789('0xd')]);router[_0x9789('0xe')]('/',auth[_0x9789('0xa')](),controller[_0x9789('0xf')]);router[_0x9789('0x10')](_0x9789('0xc'),auth[_0x9789('0xa')](),controller[_0x9789('0x11')]);router[_0x9789('0x12')](_0x9789('0xc'),auth[_0x9789('0xa')](),controller[_0x9789('0x13')]);module[_0x9789('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 878bf3c..59fd765 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 _0xa53c=['isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','long','select','values'];(function(_0x1e6b81,_0x1eb3ec){var _0x457c87=function(_0x46f35e){while(--_0x46f35e){_0x1e6b81['push'](_0x1e6b81['shift']());}};_0x457c87(++_0x1eb3ec);}(_0xa53c,0x1d6));var _0xca53=function(_0x50eb75,_0x1fc0c5){_0x50eb75=_0x50eb75-0x0;var _0x404a85=_0xa53c[_0x50eb75];return _0x404a85;};'use strict';var Sequelize=require(_0xca53('0x0'));var _=require(_0xca53('0x1'));module[_0xca53('0x2')]={'name':{'type':Sequelize[_0xca53('0x3')],'get':function(_0x5caf9c){return this[_0xca53('0x4')](_0xca53('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x157eca){this['setDataValue'](_0xca53('0x5'),_0x157eca?_0x157eca:this[_0xca53('0x4')]('name'));}},'type':{'type':Sequelize[_0xca53('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xca53('0x7')),'get':function(){if(this['getDataValue']('type')===_0xca53('0x8')){return JSON['parse'](this[_0xca53('0x4')](_0xca53('0x9')));}else{return this[_0xca53('0x4')](_0xca53('0x9'));}},'set':function(_0x3ed5a4){if(Array[_0xca53('0xa')](_0x3ed5a4)){this[_0xca53('0xb')]('values',JSON[_0xca53('0xc')](_0x3ed5a4));}else{this[_0xca53('0xb')](_0xca53('0x9'),_0x3ed5a4);}}},'required':{'type':Sequelize[_0xca53('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xca53('0xe')](_0xca53('0xf'))}}; \ No newline at end of file +var _0x9232=['sequelize','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name','TEXT','long','type','select','parse','values','BOOLEAN','ENUM','voice'];(function(_0x33fc8d,_0x358809){var _0x28d830=function(_0x4897d3){while(--_0x4897d3){_0x33fc8d['push'](_0x33fc8d['shift']());}};_0x28d830(++_0x358809);}(_0x9232,0x165));var _0x2923=function(_0x9c8b20,_0x9b8963){_0x9c8b20=_0x9c8b20-0x0;var _0x21c78d=_0x9232[_0x9c8b20];return _0x21c78d;};'use strict';var Sequelize=require(_0x2923('0x0'));var _=require(_0x2923('0x1'));module[_0x2923('0x2')]={'name':{'type':Sequelize[_0x2923('0x3')],'get':function(_0x544b86){return this[_0x2923('0x4')](_0x2923('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3de269){this[_0x2923('0x6')](_0x2923('0x5'),_0x3de269?_0x3de269:this['getDataValue'](_0x2923('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x2923('0x8')](_0x2923('0x9')),'get':function(){if(this[_0x2923('0x4')](_0x2923('0xa'))===_0x2923('0xb')){return JSON[_0x2923('0xc')](this[_0x2923('0x4')]('values'));}else{return this[_0x2923('0x4')](_0x2923('0xd'));}},'set':function(_0x4ef9cc){if(Array['isArray'](_0x4ef9cc)){this[_0x2923('0x6')](_0x2923('0xd'),JSON['stringify'](_0x4ef9cc));}else{this[_0x2923('0x6')]('values',_0x4ef9cc);}}},'required':{'type':Sequelize[_0x2923('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2923('0xf')](_0x2923('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 75d0119..f3f5854 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 _0xbc49=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','merge','type','includeAll','include','findAll','catch','show','params','keys','options','find','body','transaction','create','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','cm_contacts','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x174b2b,_0x4e5104){var _0x96b4bf=function(_0x4a6d9f){while(--_0x4a6d9f){_0x174b2b['push'](_0x174b2b['shift']());}};_0x96b4bf(++_0x4e5104);}(_0xbc49,0x1a2));var _0x9bc4=function(_0x2353fe,_0x4b0bca){_0x2353fe=_0x2353fe-0x0;var _0x4d43f6=_0xbc49[_0x2353fe];return _0x4d43f6;};'use strict';var emlformat=require(_0x9bc4('0x0'));var rimraf=require(_0x9bc4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9bc4('0x2'));var rp=require(_0x9bc4('0x3'));var moment=require(_0x9bc4('0x4'));var BPromise=require(_0x9bc4('0x5'));var Mustache=require(_0x9bc4('0x6'));var util=require(_0x9bc4('0x7'));var path=require(_0x9bc4('0x8'));var sox=require(_0x9bc4('0x9'));var csv=require(_0x9bc4('0xa'));var ejs=require(_0x9bc4('0xb'));var fs=require('fs');var fs_extra=require(_0x9bc4('0xc'));var _=require(_0x9bc4('0xd'));var squel=require('squel');var crypto=require(_0x9bc4('0xe'));var jsforce=require(_0x9bc4('0xf'));var deskjs=require(_0x9bc4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9bc4('0x11'));var Redis=require(_0x9bc4('0x12'));var authService=require(_0x9bc4('0x13'));var qs=require(_0x9bc4('0x14'));var as=require(_0x9bc4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bc4('0x16'))(_0x9bc4('0x17'));var utils=require(_0x9bc4('0x18'));var config=require(_0x9bc4('0x19'));var licenseUtil=require(_0x9bc4('0x1a'));var db=require(_0x9bc4('0x1b'))['db'];function respondWithStatusCode(_0x3aca87,_0x2a5bc1){_0x2a5bc1=_0x2a5bc1||0xcc;return function(_0x565d5c){if(_0x565d5c){return _0x3aca87[_0x9bc4('0x1c')](_0x2a5bc1);}return _0x3aca87['status'](_0x2a5bc1)['end']();};}function respondWithResult(_0x1d7640,_0x5bbe98){_0x5bbe98=_0x5bbe98||0xc8;return function(_0x1676ed){if(_0x1676ed){return _0x1d7640['status'](_0x5bbe98)[_0x9bc4('0x1d')](_0x1676ed);}};}function respondWithFilteredResult(_0x7004c9,_0x3c8b1e){return function(_0x4afd82){if(_0x4afd82){var _0x3bee8e=typeof _0x3c8b1e[_0x9bc4('0x1e')]===_0x9bc4('0x1f')&&typeof _0x3c8b1e[_0x9bc4('0x20')]===_0x9bc4('0x1f');var _0x39c577=_0x4afd82[_0x9bc4('0x21')];var _0x51df05=_0x3bee8e?0x0:_0x3c8b1e[_0x9bc4('0x1e')];var _0x524921=_0x3bee8e?_0x4afd82[_0x9bc4('0x21')]:_0x3c8b1e[_0x9bc4('0x1e')]+_0x3c8b1e[_0x9bc4('0x20')];var _0x5403a2;if(_0x524921>=_0x39c577){_0x524921=_0x39c577;_0x5403a2=0xc8;}else{_0x5403a2=0xce;}_0x7004c9[_0x9bc4('0x22')](_0x5403a2);return _0x7004c9[_0x9bc4('0x23')](_0x9bc4('0x24'),_0x51df05+'-'+_0x524921+'/'+_0x39c577)[_0x9bc4('0x1d')](_0x4afd82);}return null;};}function patchUpdates(_0x3ba232){return function(_0x88dbed){try{jsonpatch[_0x9bc4('0x25')](_0x88dbed,_0x3ba232,!![]);}catch(_0x10190a){return BPromise[_0x9bc4('0x26')](_0x10190a);}return _0x88dbed[_0x9bc4('0x27')]();};}function saveUpdates(_0x180547,_0x5afd07){return function(_0x5a8ae6){if(_0x5a8ae6){return _0x5a8ae6[_0x9bc4('0x28')](_0x180547)[_0x9bc4('0x29')](function(_0x37326f){return _0x37326f;});}return null;};}function removeEntity(_0x30655a,_0xd06875){return function(_0x91c216){if(_0x91c216){return _0x91c216[_0x9bc4('0x2a')]()[_0x9bc4('0x29')](function(){_0x30655a[_0x9bc4('0x22')](0xcc)[_0x9bc4('0x2b')]();});}};}function handleEntityNotFound(_0x10958f,_0x357ca8){return function(_0x25511a){if(!_0x25511a){_0x10958f['sendStatus'](0x194);}return _0x25511a;};}function handleError(_0x2741ec,_0x2737f1){_0x2737f1=_0x2737f1||0x1f4;return function(_0xcf4beb){logger[_0x9bc4('0x2c')](_0xcf4beb[_0x9bc4('0x2d')]);if(_0xcf4beb[_0x9bc4('0x2e')]){delete _0xcf4beb[_0x9bc4('0x2e')];}_0x2741ec[_0x9bc4('0x22')](_0x2737f1)[_0x9bc4('0x2f')](_0xcf4beb);};}exports[_0x9bc4('0x30')]=function(_0x277c72,_0x1313f4){var _0x5dad07={},_0x3d22de={},_0x12eea3={'count':0x0,'rows':[]};var _0x348812=_[_0x9bc4('0x31')](db[_0x9bc4('0x32')][_0x9bc4('0x33')],function(_0x5a6384){return{'name':_0x5a6384[_0x9bc4('0x34')],'type':_0x5a6384['type'][_0x9bc4('0x35')]};});_0x3d22de[_0x9bc4('0x36')]=_['differenceBy'](_[_0x9bc4('0x31')](_0x348812,_0x9bc4('0x2e')),[_0x9bc4('0x2e')]);_0x3d22de[_0x9bc4('0x37')]=_['keys'](_0x277c72[_0x9bc4('0x37')]);_0x3d22de[_0x9bc4('0x38')]=_['intersection'](_0x3d22de[_0x9bc4('0x36')],_0x3d22de[_0x9bc4('0x37')]);_0x5dad07[_0x9bc4('0x39')]=_[_0x9bc4('0x3a')](_0x3d22de[_0x9bc4('0x36')],qs[_0x9bc4('0x3b')](_0x277c72[_0x9bc4('0x37')][_0x9bc4('0x3b')]));_0x5dad07[_0x9bc4('0x39')]=_0x5dad07[_0x9bc4('0x39')][_0x9bc4('0x3c')]?_0x5dad07[_0x9bc4('0x39')]:_0x3d22de[_0x9bc4('0x36')];if(!_0x277c72[_0x9bc4('0x37')][_0x9bc4('0x3d')]('nolimit')){_0x5dad07[_0x9bc4('0x20')]=qs[_0x9bc4('0x20')](_0x277c72[_0x9bc4('0x37')][_0x9bc4('0x20')]);_0x5dad07[_0x9bc4('0x1e')]=qs[_0x9bc4('0x1e')](_0x277c72[_0x9bc4('0x37')][_0x9bc4('0x1e')]);}_0x5dad07[_0x9bc4('0x3e')]=qs['sort'](_0x277c72[_0x9bc4('0x37')]['sort']);_0x5dad07['where']=qs[_0x9bc4('0x38')](_['pick'](_0x277c72[_0x9bc4('0x37')],_0x3d22de['filters']),_0x348812);if(_0x277c72[_0x9bc4('0x37')]['filter']){_0x5dad07[_0x9bc4('0x3f')]=_[_0x9bc4('0x40')](_0x5dad07[_0x9bc4('0x3f')],{'$or':_[_0x9bc4('0x31')](_0x348812,function(_0x3f89b4){if(_0x3f89b4[_0x9bc4('0x41')]!=='VIRTUAL'){var _0x3cc8ad={};_0x3cc8ad[_0x3f89b4['name']]={'$like':'%'+_0x277c72[_0x9bc4('0x37')]['filter']+'%'};return _0x3cc8ad;}})});}_0x5dad07=_[_0x9bc4('0x40')]({},_0x5dad07,_0x277c72['options']);var _0x52405e={'where':_0x5dad07[_0x9bc4('0x3f')]};return db[_0x9bc4('0x32')]['count'](_0x52405e)[_0x9bc4('0x29')](function(_0x44543d){_0x12eea3[_0x9bc4('0x21')]=_0x44543d;if(_0x277c72[_0x9bc4('0x37')][_0x9bc4('0x42')]){_0x5dad07[_0x9bc4('0x43')]=[{'all':!![]}];}return db[_0x9bc4('0x32')][_0x9bc4('0x44')](_0x5dad07);})[_0x9bc4('0x29')](function(_0x247a70){_0x12eea3['rows']=_0x247a70;return _0x12eea3;})['then'](respondWithFilteredResult(_0x1313f4,_0x5dad07))[_0x9bc4('0x45')](handleError(_0x1313f4,null));};exports[_0x9bc4('0x46')]=function(_0x14fe60,_0x2585cb){var _0x4025b6={'raw':!![],'where':{'id':_0x14fe60[_0x9bc4('0x47')]['id']}},_0x215663={};_0x215663['model']=_['keys'](db[_0x9bc4('0x32')]['rawAttributes']);_0x215663[_0x9bc4('0x37')]=_[_0x9bc4('0x48')](_0x14fe60[_0x9bc4('0x37')]);_0x215663[_0x9bc4('0x38')]=_[_0x9bc4('0x3a')](_0x215663[_0x9bc4('0x36')],_0x215663['query']);_0x4025b6['attributes']=_[_0x9bc4('0x3a')](_0x215663['model'],qs[_0x9bc4('0x3b')](_0x14fe60[_0x9bc4('0x37')][_0x9bc4('0x3b')]));_0x4025b6[_0x9bc4('0x39')]=_0x4025b6['attributes'][_0x9bc4('0x3c')]?_0x4025b6[_0x9bc4('0x39')]:_0x215663['model'];if(_0x14fe60[_0x9bc4('0x37')][_0x9bc4('0x42')]){_0x4025b6[_0x9bc4('0x43')]=[{'all':!![]}];}_0x4025b6=_[_0x9bc4('0x40')]({},_0x4025b6,_0x14fe60[_0x9bc4('0x49')]);return db['CmCustomField'][_0x9bc4('0x4a')](_0x4025b6)[_0x9bc4('0x29')](handleEntityNotFound(_0x2585cb,null))[_0x9bc4('0x29')](respondWithResult(_0x2585cb,null))['catch'](handleError(_0x2585cb,null));};exports[_0x9bc4('0x28')]=function(_0x2636fb,_0x50802c){if(_0x2636fb[_0x9bc4('0x4b')]['id']){delete _0x2636fb[_0x9bc4('0x4b')]['id'];}return db[_0x9bc4('0x32')]['find']({'where':{'id':_0x2636fb['params']['id']}})[_0x9bc4('0x29')](handleEntityNotFound(_0x50802c,null))[_0x9bc4('0x29')](saveUpdates(_0x2636fb['body'],null))[_0x9bc4('0x29')](respondWithResult(_0x50802c,null))['catch'](handleError(_0x50802c,null));};exports[_0x9bc4('0x2a')]=function(_0x23bd33,_0x27f04c){return db['CmCustomField']['find']({'where':{'id':_0x23bd33[_0x9bc4('0x47')]['id']}})[_0x9bc4('0x29')](handleEntityNotFound(_0x27f04c,null))[_0x9bc4('0x29')](removeEntity(_0x27f04c,null))['catch'](handleError(_0x27f04c,null));};exports['create']=function(_0x421def,_0x4bb383){var _0x182c7c;return db['sequelize'][_0x9bc4('0x4c')](function(_0x2c1bb1){return db[_0x9bc4('0x32')][_0x9bc4('0x4d')](_0x421def[_0x9bc4('0x4b')],{'transaction':_0x2c1bb1})['then'](function(_0x458ed9){_0x182c7c=_0x458ed9;var _0x3c0e66={'type':db[_0x9bc4('0x4e')][_0x9bc4('0x4f')],'transaction':_0x2c1bb1};switch(_0x421def[_0x9bc4('0x4b')][_0x9bc4('0x41')]){case _0x9bc4('0x50'):_0x3c0e66[_0x9bc4('0x41')]=db['Sequelize']['TEXT'];break;case _0x9bc4('0x51'):_0x3c0e66[_0x9bc4('0x41')]=db['Sequelize'][_0x9bc4('0x52')];break;case'switch':_0x3c0e66[_0x9bc4('0x41')]=db[_0x9bc4('0x4e')][_0x9bc4('0x53')];_0x3c0e66['defaultValue']=![];break;default:}return db['sequelize'][_0x9bc4('0x54')]['addColumn'](_0x9bc4('0x55'),util[_0x9bc4('0x56')]('cf_%d',_0x182c7c['id']),_0x3c0e66);})[_0x9bc4('0x29')](function(){return _0x182c7c;});})['then'](respondWithResult(_0x4bb383,0xc9))[_0x9bc4('0x45')](handleError(_0x4bb383,null));}; \ No newline at end of file +var _0x4282=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','offset','limit','undefined','count','set','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','map','CmCustomField','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','rawAttributes','find','body','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d'];(function(_0x4ef600,_0x97aecd){var _0x27c11a=function(_0x5208ed){while(--_0x5208ed){_0x4ef600['push'](_0x4ef600['shift']());}};_0x27c11a(++_0x97aecd);}(_0x4282,0x168));var _0x2428=function(_0x41cfa5,_0x41b8ef){_0x41cfa5=_0x41cfa5-0x0;var _0xae5fd7=_0x4282[_0x41cfa5];return _0xae5fd7;};'use strict';var emlformat=require(_0x2428('0x0'));var rimraf=require(_0x2428('0x1'));var zipdir=require(_0x2428('0x2'));var jsonpatch=require(_0x2428('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2428('0x4'));var Mustache=require(_0x2428('0x5'));var util=require(_0x2428('0x6'));var path=require(_0x2428('0x7'));var sox=require(_0x2428('0x8'));var csv=require(_0x2428('0x9'));var ejs=require(_0x2428('0xa'));var fs=require('fs');var fs_extra=require(_0x2428('0xb'));var _=require(_0x2428('0xc'));var squel=require(_0x2428('0xd'));var crypto=require(_0x2428('0xe'));var jsforce=require(_0x2428('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2428('0x10'));var Papa=require(_0x2428('0x11'));var Redis=require(_0x2428('0x12'));var authService=require(_0x2428('0x13'));var qs=require(_0x2428('0x14'));var as=require(_0x2428('0x15'));var hardwareService=require(_0x2428('0x16'));var logger=require(_0x2428('0x17'))(_0x2428('0x18'));var utils=require('../../config/utils');var config=require(_0x2428('0x19'));var licenseUtil=require(_0x2428('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f95d2,_0x1d93b9){_0x1d93b9=_0x1d93b9||0xcc;return function(_0x40e715){if(_0x40e715){return _0x3f95d2['sendStatus'](_0x1d93b9);}return _0x3f95d2['status'](_0x1d93b9)[_0x2428('0x1b')]();};}function respondWithResult(_0x361222,_0x29db8e){_0x29db8e=_0x29db8e||0xc8;return function(_0x5e10b0){if(_0x5e10b0){return _0x361222[_0x2428('0x1c')](_0x29db8e)['json'](_0x5e10b0);}};}function respondWithFilteredResult(_0x3be097,_0x194188){return function(_0x44d39c){if(_0x44d39c){var _0x5f8570=typeof _0x194188[_0x2428('0x1d')]==='undefined'&&typeof _0x194188[_0x2428('0x1e')]===_0x2428('0x1f');var _0x59d53e=_0x44d39c['count'];var _0x21495c=_0x5f8570?0x0:_0x194188[_0x2428('0x1d')];var _0x26710e=_0x5f8570?_0x44d39c[_0x2428('0x20')]:_0x194188[_0x2428('0x1d')]+_0x194188[_0x2428('0x1e')];var _0x11b419;if(_0x26710e>=_0x59d53e){_0x26710e=_0x59d53e;_0x11b419=0xc8;}else{_0x11b419=0xce;}_0x3be097['status'](_0x11b419);return _0x3be097[_0x2428('0x21')](_0x2428('0x22'),_0x21495c+'-'+_0x26710e+'/'+_0x59d53e)[_0x2428('0x23')](_0x44d39c);}return null;};}function patchUpdates(_0x285639){return function(_0x48c1c2){try{jsonpatch['apply'](_0x48c1c2,_0x285639,!![]);}catch(_0x156197){return BPromise['reject'](_0x156197);}return _0x48c1c2[_0x2428('0x24')]();};}function saveUpdates(_0x410193,_0x54e172){return function(_0x155c40){if(_0x155c40){return _0x155c40[_0x2428('0x25')](_0x410193)[_0x2428('0x26')](function(_0x37218b){return _0x37218b;});}return null;};}function removeEntity(_0x3eb353,_0x12f225){return function(_0x2fb73e){if(_0x2fb73e){return _0x2fb73e[_0x2428('0x27')]()[_0x2428('0x26')](function(){_0x3eb353[_0x2428('0x1c')](0xcc)[_0x2428('0x1b')]();});}};}function handleEntityNotFound(_0x2b4155,_0x8ccb3b){return function(_0xa98392){if(!_0xa98392){_0x2b4155[_0x2428('0x28')](0x194);}return _0xa98392;};}function handleError(_0x451b8b,_0x43426b){_0x43426b=_0x43426b||0x1f4;return function(_0x3c5e1d){logger[_0x2428('0x29')](_0x3c5e1d[_0x2428('0x2a')]);if(_0x3c5e1d[_0x2428('0x2b')]){delete _0x3c5e1d[_0x2428('0x2b')];}_0x451b8b[_0x2428('0x1c')](_0x43426b)[_0x2428('0x2c')](_0x3c5e1d);};}exports['index']=function(_0x437032,_0x3f3bcc){var _0x548ffb={},_0x467af8={},_0x3defc9={'count':0x0,'rows':[]};var _0x3b18c0=_[_0x2428('0x2d')](db[_0x2428('0x2e')]['rawAttributes'],function(_0x3ae015){return{'name':_0x3ae015[_0x2428('0x2f')],'type':_0x3ae015[_0x2428('0x30')][_0x2428('0x31')]};});_0x467af8[_0x2428('0x32')]=_[_0x2428('0x33')](_[_0x2428('0x2d')](_0x3b18c0,'name'),[_0x2428('0x2b')]);_0x467af8['query']=_[_0x2428('0x34')](_0x437032[_0x2428('0x35')]);_0x467af8[_0x2428('0x36')]=_[_0x2428('0x37')](_0x467af8['model'],_0x467af8[_0x2428('0x35')]);_0x548ffb[_0x2428('0x38')]=_['intersection'](_0x467af8[_0x2428('0x32')],qs[_0x2428('0x39')](_0x437032[_0x2428('0x35')]['fields']));_0x548ffb['attributes']=_0x548ffb[_0x2428('0x38')]['length']?_0x548ffb[_0x2428('0x38')]:_0x467af8[_0x2428('0x32')];if(!_0x437032[_0x2428('0x35')][_0x2428('0x3a')](_0x2428('0x3b'))){_0x548ffb['limit']=qs[_0x2428('0x1e')](_0x437032[_0x2428('0x35')][_0x2428('0x1e')]);_0x548ffb[_0x2428('0x1d')]=qs[_0x2428('0x1d')](_0x437032[_0x2428('0x35')][_0x2428('0x1d')]);}_0x548ffb[_0x2428('0x3c')]=qs['sort'](_0x437032[_0x2428('0x35')][_0x2428('0x3d')]);_0x548ffb[_0x2428('0x3e')]=qs['filters'](_['pick'](_0x437032[_0x2428('0x35')],_0x467af8[_0x2428('0x36')]),_0x3b18c0);if(_0x437032[_0x2428('0x35')][_0x2428('0x3f')]){_0x548ffb[_0x2428('0x3e')]=_['merge'](_0x548ffb[_0x2428('0x3e')],{'$or':_[_0x2428('0x2d')](_0x3b18c0,function(_0x1a110d){if(_0x1a110d['type']!=='VIRTUAL'){var _0x5ac1fc={};_0x5ac1fc[_0x1a110d['name']]={'$like':'%'+_0x437032[_0x2428('0x35')]['filter']+'%'};return _0x5ac1fc;}})});}_0x548ffb=_[_0x2428('0x40')]({},_0x548ffb,_0x437032[_0x2428('0x41')]);var _0x10cd89={'where':_0x548ffb[_0x2428('0x3e')]};return db[_0x2428('0x2e')][_0x2428('0x20')](_0x10cd89)['then'](function(_0x3a9fc8){_0x3defc9[_0x2428('0x20')]=_0x3a9fc8;if(_0x437032[_0x2428('0x35')]['includeAll']){_0x548ffb[_0x2428('0x42')]=[{'all':!![]}];}return db['CmCustomField'][_0x2428('0x43')](_0x548ffb);})[_0x2428('0x26')](function(_0x6722d7){_0x3defc9[_0x2428('0x44')]=_0x6722d7;return _0x3defc9;})[_0x2428('0x26')](respondWithFilteredResult(_0x3f3bcc,_0x548ffb))[_0x2428('0x45')](handleError(_0x3f3bcc,null));};exports[_0x2428('0x46')]=function(_0x57a793,_0x108760){var _0x5d27a0={'raw':!![],'where':{'id':_0x57a793['params']['id']}},_0x3f183b={};_0x3f183b['model']=_[_0x2428('0x34')](db[_0x2428('0x2e')][_0x2428('0x47')]);_0x3f183b[_0x2428('0x35')]=_[_0x2428('0x34')](_0x57a793[_0x2428('0x35')]);_0x3f183b[_0x2428('0x36')]=_[_0x2428('0x37')](_0x3f183b[_0x2428('0x32')],_0x3f183b[_0x2428('0x35')]);_0x5d27a0['attributes']=_[_0x2428('0x37')](_0x3f183b[_0x2428('0x32')],qs[_0x2428('0x39')](_0x57a793[_0x2428('0x35')][_0x2428('0x39')]));_0x5d27a0[_0x2428('0x38')]=_0x5d27a0[_0x2428('0x38')]['length']?_0x5d27a0[_0x2428('0x38')]:_0x3f183b[_0x2428('0x32')];if(_0x57a793[_0x2428('0x35')]['includeAll']){_0x5d27a0[_0x2428('0x42')]=[{'all':!![]}];}_0x5d27a0=_[_0x2428('0x40')]({},_0x5d27a0,_0x57a793[_0x2428('0x41')]);return db[_0x2428('0x2e')][_0x2428('0x48')](_0x5d27a0)[_0x2428('0x26')](handleEntityNotFound(_0x108760,null))[_0x2428('0x26')](respondWithResult(_0x108760,null))['catch'](handleError(_0x108760,null));};exports[_0x2428('0x25')]=function(_0x53928f,_0x3c1dc1){if(_0x53928f[_0x2428('0x49')]['id']){delete _0x53928f['body']['id'];}return db[_0x2428('0x2e')][_0x2428('0x48')]({'where':{'id':_0x53928f[_0x2428('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c1dc1,null))[_0x2428('0x26')](saveUpdates(_0x53928f[_0x2428('0x49')],null))[_0x2428('0x26')](respondWithResult(_0x3c1dc1,null))[_0x2428('0x45')](handleError(_0x3c1dc1,null));};exports[_0x2428('0x27')]=function(_0x54d949,_0x4fdc4e){return db[_0x2428('0x2e')][_0x2428('0x48')]({'where':{'id':_0x54d949[_0x2428('0x4a')]['id']}})[_0x2428('0x26')](handleEntityNotFound(_0x4fdc4e,null))['then'](removeEntity(_0x4fdc4e,null))[_0x2428('0x45')](handleError(_0x4fdc4e,null));};exports[_0x2428('0x4b')]=function(_0x3b5c32,_0x4c2744){var _0x2b325c;return db[_0x2428('0x4c')][_0x2428('0x4d')](function(_0x2d41e2){return db[_0x2428('0x2e')][_0x2428('0x4b')](_0x3b5c32['body'],{'transaction':_0x2d41e2})['then'](function(_0x56b3c9){_0x2b325c=_0x56b3c9;var _0x25098d={'type':db[_0x2428('0x4e')][_0x2428('0x4f')],'transaction':_0x2d41e2};switch(_0x3b5c32[_0x2428('0x49')][_0x2428('0x30')]){case _0x2428('0x50'):_0x25098d['type']=db[_0x2428('0x4e')][_0x2428('0x4f')];break;case _0x2428('0x51'):_0x25098d[_0x2428('0x30')]=db[_0x2428('0x4e')][_0x2428('0x52')];break;case _0x2428('0x53'):_0x25098d[_0x2428('0x30')]=db[_0x2428('0x4e')][_0x2428('0x54')];_0x25098d[_0x2428('0x55')]=![];break;default:}return db['sequelize'][_0x2428('0x56')][_0x2428('0x57')](_0x2428('0x58'),util['format'](_0x2428('0x59'),_0x2b325c['id']),_0x25098d);})[_0x2428('0x26')](function(){return _0x2b325c;});})[_0x2428('0x26')](respondWithResult(_0x4c2744,0xc9))[_0x2428('0x45')](handleError(_0x4c2744,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index d6dbb88..6165555 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 _0xb583=['exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb583,0xd5));var _0x3b58=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb583[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x3b58('0x0'));var util=require('util');var logger=require(_0x3b58('0x1'))('api');var moment=require(_0x3b58('0x2'));var BPromise=require(_0x3b58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3b58('0x4'));var config=require(_0x3b58('0x5'));var attributes=require(_0x3b58('0x6'));module[_0x3b58('0x7')]=function(_0xa53db8,_0x5dc1e7){return _0xa53db8[_0x3b58('0x8')](_0x3b58('0x9'),attributes,{'tableName':_0x3b58('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3589=['exports','define','CmCustomField','cm_custom_fields','util','../../config/logger','api','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x3589,0x1d0));var _0x9358=function(_0x51ffa7,_0x1fd8ff){_0x51ffa7=_0x51ffa7-0x0;var _0x3d1c22=_0x3589[_0x51ffa7];return _0x3d1c22;};'use strict';var _=require('lodash');var util=require(_0x9358('0x0'));var logger=require(_0x9358('0x1'))(_0x9358('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9358('0x3'));var config=require(_0x9358('0x4'));var attributes=require(_0x9358('0x5'));module[_0x9358('0x6')]=function(_0x522dea,_0x30af7c){return _0x522dea[_0x9358('0x7')](_0x9358('0x8'),attributes,{'tableName':_0x9358('0x9'),'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 bddf1b7..9681e84 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 _0x60dd=['CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x60dd,0xf0));var _0xd60d=function(_0x13ceb1,_0x55a322){_0x13ceb1=_0x13ceb1-0x0;var _0x3a6498=_0x60dd[_0x13ceb1];return _0x3a6498;};'use strict';var _=require(_0xd60d('0x0'));var util=require(_0xd60d('0x1'));var moment=require(_0xd60d('0x2'));var BPromise=require('bluebird');var rs=require(_0xd60d('0x3'));var fs=require('fs');var Redis=require(_0xd60d('0x4'));var db=require(_0xd60d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd60d('0x6'))(_0xd60d('0x7'));var config=require(_0xd60d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd60d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24221e,_0xf1e879,_0x5b1bb){return new BPromise(function(_0x106f65,_0x1a765a){return client[_0xd60d('0xa')](_0x24221e,_0x5b1bb)[_0xd60d('0xb')](function(_0xedf002){logger['info'](_0xd60d('0xc'),_0xf1e879,_0xd60d('0xd'));logger['debug'](_0xd60d('0xe'),_0xf1e879,_0xd60d('0xd'),JSON[_0xd60d('0xf')](_0xedf002));if(_0xedf002['error']){if(_0xedf002[_0xd60d('0x10')][_0xd60d('0x11')]===0x1f4){logger[_0xd60d('0x10')](_0xd60d('0xc'),_0xf1e879,_0xedf002[_0xd60d('0x10')][_0xd60d('0x12')]);return _0x1a765a(_0xedf002[_0xd60d('0x10')][_0xd60d('0x12')]);}logger[_0xd60d('0x10')](_0xd60d('0xc'),_0xf1e879,_0xedf002[_0xd60d('0x10')][_0xd60d('0x12')]);return _0x106f65(_0xedf002[_0xd60d('0x10')][_0xd60d('0x12')]);}else{logger[_0xd60d('0x13')](_0xd60d('0xc'),_0xf1e879,_0xd60d('0xd'));_0x106f65(_0xedf002['result'][_0xd60d('0x12')]);}})[_0xd60d('0x14')](function(_0x25ddb8){logger[_0xd60d('0x10')](_0xd60d('0xc'),_0xf1e879,_0x25ddb8);_0x1a765a(_0x25ddb8);});});} \ No newline at end of file +var _0xfaa6=['rpc','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x15b162,_0xbc2e51){var _0x41d5b3=function(_0x20af12){while(--_0x20af12){_0x15b162['push'](_0x15b162['shift']());}};_0x41d5b3(++_0xbc2e51);}(_0xfaa6,0xbd));var _0x6faa=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xfaa6[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0x6faa('0x0'));var util=require(_0x6faa('0x1'));var moment=require(_0x6faa('0x2'));var BPromise=require(_0x6faa('0x3'));var rs=require(_0x6faa('0x4'));var fs=require('fs');var Redis=require(_0x6faa('0x5'));var db=require(_0x6faa('0x6'))['db'];var utils=require(_0x6faa('0x7'));var logger=require(_0x6faa('0x8'))(_0x6faa('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6faa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229c57,_0x325fc7,_0x27195c){return new BPromise(function(_0x874022,_0x23311b){return client['request'](_0x229c57,_0x27195c)[_0x6faa('0xb')](function(_0x1d682b){logger[_0x6faa('0xc')](_0x6faa('0xd'),_0x325fc7,_0x6faa('0xe'));logger[_0x6faa('0xf')](_0x6faa('0x10'),_0x325fc7,'request\x20sent',JSON[_0x6faa('0x11')](_0x1d682b));if(_0x1d682b[_0x6faa('0x12')]){if(_0x1d682b[_0x6faa('0x12')]['code']===0x1f4){logger[_0x6faa('0x12')](_0x6faa('0xd'),_0x325fc7,_0x1d682b[_0x6faa('0x12')][_0x6faa('0x13')]);return _0x23311b(_0x1d682b[_0x6faa('0x12')][_0x6faa('0x13')]);}logger[_0x6faa('0x12')](_0x6faa('0xd'),_0x325fc7,_0x1d682b[_0x6faa('0x12')]['message']);return _0x874022(_0x1d682b['error'][_0x6faa('0x13')]);}else{logger[_0x6faa('0xc')](_0x6faa('0xd'),_0x325fc7,_0x6faa('0xe'));_0x874022(_0x1d682b[_0x6faa('0x14')][_0x6faa('0x13')]);}})[_0x6faa('0x15')](function(_0x52b967){logger['error']('CmCustomField,\x20%s,\x20%s',_0x325fc7,_0x52b967);_0x23311b(_0x52b967);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index dd76204..7a5b700 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 _0xdf70=['exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','show','post','create','put','update','delete','destroy'];(function(_0x561dc4,_0x3381c4){var _0x333ef1=function(_0xc9ccc){while(--_0xc9ccc){_0x561dc4['push'](_0x561dc4['shift']());}};_0x333ef1(++_0x3381c4);}(_0xdf70,0x86));var _0x0df7=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0xdf70[_0x43dc7e];return _0x21e12d;};'use strict';var multer=require(_0x0df7('0x0'));var util=require(_0x0df7('0x1'));var path=require(_0x0df7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0df7('0x3'));var router=express[_0x0df7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0df7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0df7('0x6'));var controller=require(_0x0df7('0x7'));router['get']('/',auth[_0x0df7('0x8')](),controller[_0x0df7('0x9')]);router[_0x0df7('0xa')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0xb')]);router[_0x0df7('0xc')]('/',auth[_0x0df7('0x8')](),controller[_0x0df7('0xd')]);router[_0x0df7('0xe')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0xf')]);router[_0x0df7('0x10')]('/:id',auth[_0x0df7('0x8')](),controller[_0x0df7('0x11')]);module[_0x0df7('0x12')]=router; \ No newline at end of file +var _0x45aa=['/:id','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45aa,0xdf));var _0xa45a=function(_0x16dd2c,_0x51188b){_0x16dd2c=_0x16dd2c-0x0;var _0x4fe5c3=_0x45aa[_0x16dd2c];return _0x4fe5c3;};'use strict';var multer=require('multer');var util=require(_0xa45a('0x0'));var path=require(_0xa45a('0x1'));var timeout=require(_0xa45a('0x2'));var express=require(_0xa45a('0x3'));var router=express['Router']();var fs_extra=require(_0xa45a('0x4'));var auth=require(_0xa45a('0x5'));var interaction=require(_0xa45a('0x6'));var config=require(_0xa45a('0x7'));var controller=require(_0xa45a('0x8'));router[_0xa45a('0x9')]('/',auth[_0xa45a('0xa')](),controller['index']);router[_0xa45a('0x9')](_0xa45a('0xb'),auth[_0xa45a('0xa')](),controller['show']);router[_0xa45a('0xc')]('/',auth[_0xa45a('0xa')](),controller[_0xa45a('0xd')]);router['put'](_0xa45a('0xb'),auth[_0xa45a('0xa')](),controller[_0xa45a('0xe')]);router[_0xa45a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa45a('0x10')]);module[_0xa45a('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 42fa7cd..5d79ce7 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 _0xa28d=['exports','STRING','DATE','format','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0xa28d,0x18b));var _0xda28=function(_0x5e0d8d,_0x371f09){_0x5e0d8d=_0x5e0d8d-0x0;var _0x18aebf=_0xa28d[_0x5e0d8d];return _0x18aebf;};'use strict';var moment=require(_0xda28('0x0'));var Sequelize=require('sequelize');module[_0xda28('0x1')]={'phone':{'type':Sequelize[_0xda28('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xda28('0x3')],'defaultValue':moment()[_0xda28('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xda28('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xda28('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xda28('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xda28('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xda28('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xda28('0x5')],'unique':_0xda28('0x8')},'ListId':{'type':Sequelize[_0xda28('0x5')],'unique':_0xda28('0x8')},'UserId':{'type':Sequelize[_0xda28('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xda28('0x5')],'unique':_0xda28('0x8')},'CampaignId':{'type':Sequelize[_0xda28('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xda28('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xda28('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xda28('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xda28('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xda28('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xda28('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x80d0=['sequelize','exports','BOOLEAN','DATE','INTEGER','STRING','UNSIGNED','contactListQueue','moment'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x80d0,0x10d));var _0x080d=function(_0x1155f4,_0x107a57){_0x1155f4=_0x1155f4-0x0;var _0x5da85b=_0x80d0[_0x1155f4];return _0x5da85b;};'use strict';var moment=require(_0x080d('0x0'));var Sequelize=require(_0x080d('0x1'));module[_0x080d('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x080d('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x080d('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x080d('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x080d('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x080d('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x080d('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x080d('0x5')](0x2)[_0x080d('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x080d('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x080d('0x5')],'unique':_0x080d('0x8')},'UserId':{'type':Sequelize[_0x080d('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x080d('0x5')],'unique':_0x080d('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x080d('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x080d('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x080d('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x080d('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x080d('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'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 23dc44b..c01015e 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 _0xb66c=['$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','find','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','keys','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','update','then','name','send','map','CmHopper','rawAttributes','model','query','filters','intersection','concat','$and','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$notIn','$like','$notLike'];(function(_0x2b94e6,_0x21c862){var _0x3a1a77=function(_0x2cbd43){while(--_0x2cbd43){_0x2b94e6['push'](_0x2b94e6['shift']());}};_0x3a1a77(++_0x21c862);}(_0xb66c,0x175));var _0xcb66=function(_0x430fc0,_0x3ee3b6){_0x430fc0=_0x430fc0-0x0;var _0x34f0a9=_0xb66c[_0x430fc0];return _0x34f0a9;};'use strict';var moment=require(_0xcb66('0x0'));var _=require('lodash');var qs=require(_0xcb66('0x1'));var logger=require('../../config/logger')(_0xcb66('0x2'));var shared=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];function respondWithResult(_0x5f487c,_0x35d439){_0x35d439=_0x35d439||0xc8;return function(_0x386241){if(_0x386241){return _0x5f487c[_0xcb66('0x5')](_0x35d439)[_0xcb66('0x6')](_0x386241);}};}function respondWithFilteredResult(_0x5d766d,_0x518163){return function(_0x19adf5){if(_0x19adf5){var _0x1b6852=typeof _0x518163[_0xcb66('0x7')]===_0xcb66('0x8')&&typeof _0x518163[_0xcb66('0x9')]==='undefined';var _0x2c62ad=_0x19adf5[_0xcb66('0xa')];var _0x174969=_0x1b6852?0x0:_0x518163[_0xcb66('0x7')];var _0x3c4ce1=_0x1b6852?_0x19adf5['count']:_0x518163[_0xcb66('0x7')]+_0x518163[_0xcb66('0x9')];var _0xf12828;if(_0x3c4ce1>=_0x2c62ad){_0x3c4ce1=_0x2c62ad;_0xf12828=0xc8;}else{_0xf12828=0xce;}_0x5d766d[_0xcb66('0x5')](_0xf12828);return _0x5d766d['set'](_0xcb66('0xb'),_0x174969+'-'+_0x3c4ce1+'/'+_0x2c62ad)[_0xcb66('0x6')](_0x19adf5);}return null;};}function saveUpdates(_0x4105d2,_0x2339bb){return function(_0x582523){if(_0x582523){return _0x582523[_0xcb66('0xc')](_0x4105d2)[_0xcb66('0xd')](function(_0x36c846){return _0x36c846;});}return null;};}function handleEntityNotFound(_0x401bc9,_0x58fb9e){return function(_0x19072b){if(!_0x19072b){_0x401bc9['sendStatus'](0x194);}return _0x19072b;};}function handleError(_0x6af5b5,_0x52b058){_0x52b058=_0x52b058||0x1f4;return function(_0x27442d){logger['error'](_0x27442d['stack']);if(_0x27442d[_0xcb66('0xe')]){delete _0x27442d[_0xcb66('0xe')];}_0x6af5b5[_0xcb66('0x5')](_0x52b058)[_0xcb66('0xf')](_0x27442d);};}exports['index']=function(_0x3a6e26,_0x42ad03){var _0x8a0f3f={},_0x58bca0={},_0x2e4126={'count':0x0,'rows':[]};var _0x496d12=_[_0xcb66('0x10')](db[_0xcb66('0x11')][_0xcb66('0x12')],function(_0x1ccb71){return{'name':_0x1ccb71['fieldName'],'type':_0x1ccb71['type']['key']};});_0x58bca0[_0xcb66('0x13')]=_['map'](_0x496d12,'name');_0x58bca0[_0xcb66('0x14')]=_['keys'](_0x3a6e26[_0xcb66('0x14')]);_0x58bca0[_0xcb66('0x15')]=_[_0xcb66('0x16')](_0x58bca0[_0xcb66('0x13')],_0x58bca0[_0xcb66('0x14')]);_0x58bca0[_0xcb66('0x15')]=_[_0xcb66('0x17')](_0x58bca0['filters'],[_0xcb66('0x18'),'$or','$gt',_0xcb66('0x19'),_0xcb66('0x1a'),_0xcb66('0x1b'),'$ne',_0xcb66('0x1c'),_0xcb66('0x1d'),_0xcb66('0x1e'),_0xcb66('0x1f'),'$in',_0xcb66('0x20'),_0xcb66('0x21'),_0xcb66('0x22'),_0xcb66('0x23'),_0xcb66('0x24'),_0xcb66('0x21'),_0xcb66('0x25'),_0xcb66('0x26'),_0xcb66('0x27'),_0xcb66('0x28')]);_0x8a0f3f['attributes']=_[_0xcb66('0x16')](_0x58bca0['model'],qs['fields'](_0x3a6e26['query'][_0xcb66('0x29')]));_0x8a0f3f['attributes']=_0x8a0f3f[_0xcb66('0x2a')][_0xcb66('0x2b')]?_0x8a0f3f[_0xcb66('0x2a')]:_0x58bca0['model'];if(!_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x2c')](_0xcb66('0x2d'))){_0x8a0f3f[_0xcb66('0x9')]=qs[_0xcb66('0x9')](_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x9')]);_0x8a0f3f[_0xcb66('0x7')]=qs[_0xcb66('0x7')](_0x3a6e26[_0xcb66('0x14')]['offset']);}_0x8a0f3f[_0xcb66('0x2e')]=qs[_0xcb66('0x2f')](_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x2f')]);_0x8a0f3f[_0xcb66('0x30')]=qs[_0xcb66('0x15')](_[_0xcb66('0x31')](_0x3a6e26['query'],_0x58bca0[_0xcb66('0x15')]),_0x496d12);if(_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x32')]){_0x8a0f3f[_0xcb66('0x30')]=_['merge'](_0x8a0f3f[_0xcb66('0x30')],{'$or':_[_0xcb66('0x10')](_0x496d12,function(_0x907fff){if(_0x907fff[_0xcb66('0x33')]!==_0xcb66('0x34')){var _0x1d9957={};_0x1d9957[_0x907fff[_0xcb66('0xe')]]={'$like':'%'+_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x32')]+'%'};return _0x1d9957;}})});}_0x8a0f3f=_[_0xcb66('0x35')]({},_0x8a0f3f,_0x3a6e26[_0xcb66('0x36')]);var _0x17b087={'where':_0x8a0f3f['where']};return db['CmHopper']['count'](_0x17b087)[_0xcb66('0xd')](function(_0x4182f9){_0x2e4126[_0xcb66('0xa')]=_0x4182f9;if(_0x3a6e26[_0xcb66('0x14')][_0xcb66('0x37')]){_0x8a0f3f[_0xcb66('0x38')]=[{'all':!![]}];}return db['CmHopper'][_0xcb66('0x39')](_0x8a0f3f);})['then'](function(_0x4b25f0){_0x2e4126['rows']=_0x4b25f0;return _0x2e4126;})[_0xcb66('0xd')](respondWithFilteredResult(_0x42ad03,_0x8a0f3f))[_0xcb66('0x3a')](handleError(_0x42ad03,null));};exports[_0xcb66('0x3b')]=function(_0x9db922,_0x11d2ac){var _0x3e71a7={'raw':!![],'where':{'id':_0x9db922[_0xcb66('0x3c')]['id']}},_0x3422b6={};_0x3422b6[_0xcb66('0x13')]=_['keys'](db[_0xcb66('0x11')][_0xcb66('0x12')]);_0x3422b6[_0xcb66('0x14')]=_['keys'](_0x9db922[_0xcb66('0x14')]);_0x3422b6[_0xcb66('0x15')]=_['intersection'](_0x3422b6['model'],_0x3422b6[_0xcb66('0x14')]);_0x3e71a7['attributes']=_['intersection'](_0x3422b6[_0xcb66('0x13')],qs[_0xcb66('0x29')](_0x9db922[_0xcb66('0x14')][_0xcb66('0x29')]));_0x3e71a7[_0xcb66('0x2a')]=_0x3e71a7[_0xcb66('0x2a')][_0xcb66('0x2b')]?_0x3e71a7[_0xcb66('0x2a')]:_0x3422b6[_0xcb66('0x13')];if(_0x9db922['query']['includeAll']){_0x3e71a7['include']=[{'all':!![]}];}_0x3e71a7=_[_0xcb66('0x35')]({},_0x3e71a7,_0x9db922['options']);return db[_0xcb66('0x11')]['find'](_0x3e71a7)[_0xcb66('0xd')](handleEntityNotFound(_0x11d2ac,null))[_0xcb66('0xd')](respondWithResult(_0x11d2ac,null))[_0xcb66('0x3a')](handleError(_0x11d2ac,null));};exports[_0xcb66('0x3d')]=function(_0x3115e2,_0xbc92e){return db['CmHopper']['create'](_0x3115e2[_0xcb66('0x3e')],{})[_0xcb66('0xd')](respondWithResult(_0xbc92e,0xc9))[_0xcb66('0x3a')](handleError(_0xbc92e,null));};exports[_0xcb66('0xc')]=function(_0xf2c532,_0x1c149b){if(_0xf2c532[_0xcb66('0x3e')]['id']){delete _0xf2c532[_0xcb66('0x3e')]['id'];}return db[_0xcb66('0x11')]['find']({'where':{'id':_0xf2c532[_0xcb66('0x3c')]['id']}})[_0xcb66('0xd')](handleEntityNotFound(_0x1c149b,null))[_0xcb66('0xd')](saveUpdates(_0xf2c532[_0xcb66('0x3e')],null))['then'](respondWithResult(_0x1c149b,null))[_0xcb66('0x3a')](handleError(_0x1c149b,null));};exports[_0xcb66('0x3f')]=function(_0x1aab4e,_0x5a1083){return db[_0xcb66('0x11')][_0xcb66('0x3f')]()[_0xcb66('0xd')](respondWithResult(_0x5a1083,null))[_0xcb66('0x3a')](handleError(_0x5a1083,null));};exports['destroy']=function(_0x43e0e0,_0xb0854f){var _0x3b839b;var _0x4b1d46=_0x43e0e0['params']['id'];return db[_0xcb66('0x11')]['find']({'where':{'id':_0x43e0e0[_0xcb66('0x3c')]['id']}})['then'](handleEntityNotFound(_0xb0854f,null))[_0xcb66('0xd')](function(_0x416448){if(_0x416448){return _0x416448[_0xcb66('0x40')]()['then'](function(_0x2071d5){return _0x2071d5;});}})['then'](function(_0x228504){_0x3b839b=_0x228504;if(_0x228504){if(_0x228504[_0xcb66('0x41')]||_0x228504[_0xcb66('0x42')]){return db[_0x228504[_0xcb66('0x41')]?_0xcb66('0x43'):'Campaign'][_0xcb66('0x44')]({'where':{'id':_0x228504['VoiceQueueId']?_0x228504[_0xcb66('0x41')]:_0x228504[_0xcb66('0x42')]},'attributes':['id',_0xcb66('0xe')],'raw':!![]});}}})['then'](function(_0x48d7a3){var _0x52ff91={};if(_0x48d7a3){_[_0xcb66('0x35')](_0x52ff91,_[_0xcb66('0x45')](_0x3b839b[_0xcb66('0x46')],[_0xcb66('0x47'),_0xcb66('0x48'),'id']));_0x52ff91[_0xcb66('0x49')]=0x15;_0x52ff91[_0xcb66('0x4a')]=_0xcb66('0x4b');_0x52ff91[_0xcb66('0x4c')]=_0x48d7a3[_0xcb66('0xe')];_0x52ff91['membername']=_0x43e0e0[_0xcb66('0x4d')][_0xcb66('0xe')];_0x52ff91[_0xcb66('0x4e')]=_0x43e0e0[_0xcb66('0x4d')]['id'];_0x52ff91['deleted']=!![];_0x52ff91['deletedat']=moment()[_0xcb66('0x4f')](_0xcb66('0x50'));_0x52ff91[_0xcb66('0x51')]=_0x3b839b[_0xcb66('0x52')];_0x52ff91[_0xcb66('0x53')]=_0x3b839b[_0xcb66('0x41')]?'queue':_0xcb66('0x54');return db[_0xcb66('0x55')][_0xcb66('0x44')]({'where':{'id':_0x52ff91[_0xcb66('0x56')]},'attributes':['firstName',_0xcb66('0x57')]})['then'](function(_0xd37bbd){if(!_['isNil'](_0xb0854f)&&!_[_0xcb66('0x58')](_0xd37bbd[_0xcb66('0x59')])){_0x52ff91[_0xcb66('0x5a')]=_0xd37bbd['firstName'];if(!_['isNil'](_0xd37bbd[_0xcb66('0x57')])){_0x52ff91[_0xcb66('0x5a')]+='\x20'+_0xd37bbd['lastName'];}}})['finally'](function(){return db[_0xcb66('0x5b')]['create'](_0x52ff91);});}})[_0xcb66('0xd')](function(_0x56e524){return db[_0xcb66('0x5c')][_0xcb66('0x40')]({'where':{'CmHopperId':_0x4b1d46}});})[_0xcb66('0xd')](function(){return _0xb0854f['status'](0xcc)[_0xcb66('0x5d')]();})[_0xcb66('0x3a')](handleError(_0xb0854f,null));};exports['getPreview']=function(_0x244003,_0x27e83c){var _0x417c7e=[];return db[_0xcb66('0x55')][_0xcb66('0x3f')]()[_0xcb66('0xd')](function(_0x5352aa){_0x417c7e=_[_0xcb66('0x5e')](_0x5352aa);return _0x244003[_0xcb66('0x4d')][_0xcb66('0x5f')]({'where':{'type':_0xcb66('0x60'),'dialActive':!![],'dialMethod':_0xcb66('0x61')},'attributes':['id',_0xcb66('0x62'),_0xcb66('0x63')],'raw':!![]});})[_0xcb66('0xd')](function(_0x1e2287){if(_0x1e2287&&_0x1e2287['length']){return db[_0xcb66('0x64')][_0xcb66('0x65')](function(_0x25e648){var _0x3ab8b3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb66('0x4f')](_0xcb66('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x1e2287,'id')},'$or':[{'UserId':null},{'UserId':_0x244003[_0xcb66('0x4d')]['id']}]};var _0x40d4f3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1e2287)['filter']([_0xcb66('0x63'),0x0])[_0xcb66('0x10')]('id')[_0xcb66('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x244003[_0xcb66('0x4d')]['id']}]};var _0x5b6e1f={'$or':[_0x3ab8b3,_0x40d4f3]};var _0x3dbc42=[];if(_0x244003[_0xcb66('0x3e')][_0xcb66('0x67')]&&_0x244003[_0xcb66('0x3e')][_0xcb66('0x67')]===_0xcb66('0x68')){if(!_[_0xcb66('0x69')](_0x244003[_0xcb66('0x3e')][_0xcb66('0x6a')])){_0x5b6e1f['id']={'$in':_0x244003[_0xcb66('0x3e')]['hopperIds']};}_0x3dbc42=[[_0xcb66('0x6b'),_0xcb66('0x6c')],[_0xcb66('0x6d'),_0x1e2287[0x0][_0xcb66('0x62')]==='ASC'?_0xcb66('0x6e'):_0xcb66('0x6c')],db[_0xcb66('0x64')][_0xcb66('0x6f')](_0xcb66('0x70')),['id',_0xcb66('0x6e')]];}else{if(!_[_0xcb66('0x69')](_0x244003['body']['hopperIds'])){_0x5b6e1f['id']={'$notIn':_0x244003[_0xcb66('0x3e')][_0xcb66('0x6a')]};}_0x3dbc42=[[_0xcb66('0x6b'),_0xcb66('0x6e')],[_0xcb66('0x6d'),_0x1e2287[0x0][_0xcb66('0x62')]],db['sequelize'][_0xcb66('0x6f')](_0xcb66('0x71')),['id',_0xcb66('0x6c')]];}return db[_0xcb66('0x11')][_0xcb66('0x72')]({'attributes':['id',_0xcb66('0x73'),'phone',_0xcb66('0x74')],'where':_0x5b6e1f,'order':_0x3dbc42,'transaction':_0x25e648,'lock':_0x25e648[_0xcb66('0x75')][_0xcb66('0x76')],'include':[{'model':db[_0xcb66('0x55')],'as':_0xcb66('0x77'),'attributes':_0x417c7e,'include':[{'model':db[_0xcb66('0x78')],'as':_0xcb66('0x79'),'attributes':['id',_0xcb66('0xe')]}]},{'model':db[_0xcb66('0x7a')],'as':_0xcb66('0x7b'),'attributes':['id',_0xcb66('0xe')]},{'model':db[_0xcb66('0x43')],'as':_0xcb66('0x7c'),'attributes':['id',_0xcb66('0xe'),_0xcb66('0x7d')]}]})[_0xcb66('0xd')](function(_0x3b0f10){if(_0x3b0f10){return _0x3b0f10[_0xcb66('0xc')]({'UserId':_0x244003[_0xcb66('0x4d')]['id']},{'transaction':_0x25e648});}});});}})['then'](handleEntityNotFound(_0x27e83c,null))[_0xcb66('0xd')](respondWithResult(_0x27e83c,null))['catch'](handleError(_0x27e83c,null));};exports[_0xcb66('0x7e')]=function(_0x51311b,_0x279264,_0x2912c9){var _0x42a71a=[];var _0x1a4cdb=_0x51311b[_0xcb66('0x3c')]['id'];var _0x283600=_0x51311b[_0xcb66('0x4d')]['id'];return db[_0xcb66('0x55')][_0xcb66('0x3f')]()[_0xcb66('0xd')](function(_0xf7c710){_0x42a71a=_[_0xcb66('0x5e')](_0xf7c710);return db[_0xcb66('0x64')]['transaction'](function(_0x91725a){const _0x45b25e={'id':_0x1a4cdb};return db[_0xcb66('0x11')]['findOne']({'attributes':['id',_0xcb66('0x73'),_0xcb66('0x74')],'where':_0x45b25e,'transaction':_0x91725a,'lock':_0x91725a[_0xcb66('0x75')]['UPDATE'],'include':[{'model':db[_0xcb66('0x55')],'as':_0xcb66('0x77'),'attributes':_0x42a71a,'include':[{'model':db[_0xcb66('0x78')],'as':_0xcb66('0x79'),'attributes':['id',_0xcb66('0xe')]}]},{'model':db[_0xcb66('0x7a')],'as':'List','attributes':['id',_0xcb66('0xe')]},{'model':db['VoiceQueue'],'as':_0xcb66('0x7c'),'attributes':['id','name',_0xcb66('0x7d')]}]})['then'](function(_0x3b4c30){if(_0x3b4c30){return _0x3b4c30[_0xcb66('0xc')]({'UserId':_0x283600},{'transaction':_0x91725a});}});});})[_0xcb66('0xd')](handleEntityNotFound(_0x279264,null))['then'](respondWithResult(_0x279264,null))[_0xcb66('0x3a')](handleError(_0x279264,null));};exports['getOpenContacts']=function(_0x112f25,_0x21d871){return _0x112f25[_0xcb66('0x4d')][_0xcb66('0x5f')]({'where':{'type':_0xcb66('0x60'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xcb66('0xd')](function(_0xfa72ee){if(_0xfa72ee&&_0xfa72ee[_0xcb66('0x2b')]){return db[_0xcb66('0x11')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcb66('0x4f')](_0xcb66('0x50'))},'VoiceQueueId':{'$in':_['map'](_0xfa72ee,'id')},'$or':[{'UserId':null},{'UserId':_0x112f25[_0xcb66('0x4d')]['id']}]}});}return 0x0;})[_0xcb66('0xd')](function(_0x16f9a3){if(!_[_0xcb66('0x58')](_0x16f9a3)&&_['isNumber'](_0x16f9a3)){return _0x21d871[_0xcb66('0x5')](0xc8)[_0xcb66('0x6')]({'contacts':_0x16f9a3});}else{logger[_0xcb66('0x7f')](_0xcb66('0x80'),_0xcb66('0x81'),0x194,'entity\x20not\x20found');_0x21d871[_0xcb66('0x82')](0x194);}})[_0xcb66('0x3a')](handleError(_0x21d871,null));};exports[_0xcb66('0x83')]=function(_0x1105d5,_0xb3a1e){var _0xf7b62b=shared[_0xcb66('0x84')];var _0x5b0db8=[];_['map'](_0xf7b62b,function(_0x56b8d5){_0x5b0db8[_0xcb66('0x85')]({'id':_0x56b8d5[_0xcb66('0xe')],'name':_0x56b8d5['name'],'utcOffset':_0x56b8d5[_0xcb66('0x86')]});});return _0xb3a1e['status'](0xc8)[_0xcb66('0x6')]({'tz':_0x5b0db8});};exports[_0xcb66('0x87')]=function(_0x220fea,_0x28987a){var _0x4d45b2=shared[_0xcb66('0x84')];var _0x2c08fc={};if(!_[_0xcb66('0x58')](_0x4d45b2[_0x220fea[_0xcb66('0x3e')]['id']]))_0x2c08fc=_0x4d45b2[_0x220fea[_0xcb66('0x3e')]['id']];return _0x28987a['status'](0xc8)['json'](_0x2c08fc);}; \ No newline at end of file +var _0x8098=['preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','LOCK','UPDATE','Company','CmList','dialActive','scheduledat','Contact','CmCompany','List','outbound','isNumber','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','concat','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','CmHopper','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','updatedAt','state','statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','getVoiceQueues'];(function(_0x89ace6,_0x39064b){var _0x302694=function(_0x7dd49){while(--_0x7dd49){_0x89ace6['push'](_0x89ace6['shift']());}};_0x302694(++_0x39064b);}(_0x8098,0x1ba));var _0x8809=function(_0x538c7d,_0x4c5a83){_0x538c7d=_0x538c7d-0x0;var _0x5af70f=_0x8098[_0x538c7d];return _0x5af70f;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x8809('0x0'));var logger=require(_0x8809('0x1'))(_0x8809('0x2'));var shared=require(_0x8809('0x3'));var db=require(_0x8809('0x4'))['db'];function respondWithResult(_0x4b0838,_0x2bb438){_0x2bb438=_0x2bb438||0xc8;return function(_0x1d7425){if(_0x1d7425){return _0x4b0838[_0x8809('0x5')](_0x2bb438)[_0x8809('0x6')](_0x1d7425);}};}function respondWithFilteredResult(_0x5804f0,_0xeb811){return function(_0x2af39c){if(_0x2af39c){var _0x54880c=typeof _0xeb811[_0x8809('0x7')]===_0x8809('0x8')&&typeof _0xeb811[_0x8809('0x9')]===_0x8809('0x8');var _0x1cb2ba=_0x2af39c[_0x8809('0xa')];var _0x2e2c3c=_0x54880c?0x0:_0xeb811[_0x8809('0x7')];var _0x25ed44=_0x54880c?_0x2af39c[_0x8809('0xa')]:_0xeb811[_0x8809('0x7')]+_0xeb811[_0x8809('0x9')];var _0x16053f;if(_0x25ed44>=_0x1cb2ba){_0x25ed44=_0x1cb2ba;_0x16053f=0xc8;}else{_0x16053f=0xce;}_0x5804f0[_0x8809('0x5')](_0x16053f);return _0x5804f0[_0x8809('0xb')](_0x8809('0xc'),_0x2e2c3c+'-'+_0x25ed44+'/'+_0x1cb2ba)['json'](_0x2af39c);}return null;};}function saveUpdates(_0x388b99,_0x455989){return function(_0x4d3b4c){if(_0x4d3b4c){return _0x4d3b4c[_0x8809('0xd')](_0x388b99)[_0x8809('0xe')](function(_0x5d2f30){return _0x5d2f30;});}return null;};}function handleEntityNotFound(_0x5d87df,_0x316f2c){return function(_0x2e4279){if(!_0x2e4279){_0x5d87df[_0x8809('0xf')](0x194);}return _0x2e4279;};}function handleError(_0x13b958,_0x131716){_0x131716=_0x131716||0x1f4;return function(_0x3d4d7e){logger[_0x8809('0x10')](_0x3d4d7e['stack']);if(_0x3d4d7e[_0x8809('0x11')]){delete _0x3d4d7e[_0x8809('0x11')];}_0x13b958['status'](_0x131716)[_0x8809('0x12')](_0x3d4d7e);};}exports[_0x8809('0x13')]=function(_0x5f032e,_0x3b0562){var _0x8ec527={},_0x7ec1a6={},_0x17289e={'count':0x0,'rows':[]};var _0x9f2f9d=_['map'](db['CmHopper'][_0x8809('0x14')],function(_0xc998a3){return{'name':_0xc998a3[_0x8809('0x15')],'type':_0xc998a3[_0x8809('0x16')][_0x8809('0x17')]};});_0x7ec1a6[_0x8809('0x18')]=_[_0x8809('0x19')](_0x9f2f9d,_0x8809('0x11'));_0x7ec1a6[_0x8809('0x1a')]=_[_0x8809('0x1b')](_0x5f032e[_0x8809('0x1a')]);_0x7ec1a6[_0x8809('0x1c')]=_[_0x8809('0x1d')](_0x7ec1a6['model'],_0x7ec1a6['query']);_0x7ec1a6[_0x8809('0x1c')]=_[_0x8809('0x1e')](_0x7ec1a6['filters'],['$and','$or',_0x8809('0x1f'),_0x8809('0x20'),_0x8809('0x21'),_0x8809('0x22'),_0x8809('0x23'),_0x8809('0x24'),_0x8809('0x25'),_0x8809('0x26'),_0x8809('0x27'),_0x8809('0x28'),_0x8809('0x29'),_0x8809('0x2a'),'$notLike',_0x8809('0x2b'),_0x8809('0x2c'),_0x8809('0x2a'),'$overlap',_0x8809('0x2d'),_0x8809('0x2e'),_0x8809('0x2f')]);_0x8ec527[_0x8809('0x30')]=_[_0x8809('0x1d')](_0x7ec1a6['model'],qs[_0x8809('0x31')](_0x5f032e['query'][_0x8809('0x31')]));_0x8ec527[_0x8809('0x30')]=_0x8ec527['attributes'][_0x8809('0x32')]?_0x8ec527['attributes']:_0x7ec1a6[_0x8809('0x18')];if(!_0x5f032e[_0x8809('0x1a')][_0x8809('0x33')](_0x8809('0x34'))){_0x8ec527[_0x8809('0x9')]=qs[_0x8809('0x9')](_0x5f032e['query']['limit']);_0x8ec527[_0x8809('0x7')]=qs[_0x8809('0x7')](_0x5f032e[_0x8809('0x1a')][_0x8809('0x7')]);}_0x8ec527[_0x8809('0x35')]=qs['sort'](_0x5f032e[_0x8809('0x1a')]['sort']);_0x8ec527['where']=qs[_0x8809('0x1c')](_['pick'](_0x5f032e[_0x8809('0x1a')],_0x7ec1a6['filters']),_0x9f2f9d);if(_0x5f032e[_0x8809('0x1a')][_0x8809('0x36')]){_0x8ec527[_0x8809('0x37')]=_[_0x8809('0x38')](_0x8ec527[_0x8809('0x37')],{'$or':_[_0x8809('0x19')](_0x9f2f9d,function(_0x58db84){if(_0x58db84[_0x8809('0x16')]!==_0x8809('0x39')){var _0x5b7b13={};_0x5b7b13[_0x58db84[_0x8809('0x11')]]={'$like':'%'+_0x5f032e[_0x8809('0x1a')][_0x8809('0x36')]+'%'};return _0x5b7b13;}})});}_0x8ec527=_[_0x8809('0x38')]({},_0x8ec527,_0x5f032e[_0x8809('0x3a')]);var _0x356817={'where':_0x8ec527['where']};return db[_0x8809('0x3b')][_0x8809('0xa')](_0x356817)[_0x8809('0xe')](function(_0x2af931){_0x17289e[_0x8809('0xa')]=_0x2af931;if(_0x5f032e[_0x8809('0x1a')][_0x8809('0x3c')]){_0x8ec527[_0x8809('0x3d')]=[{'all':!![]}];}return db['CmHopper'][_0x8809('0x3e')](_0x8ec527);})[_0x8809('0xe')](function(_0x225b03){_0x17289e[_0x8809('0x3f')]=_0x225b03;return _0x17289e;})['then'](respondWithFilteredResult(_0x3b0562,_0x8ec527))[_0x8809('0x40')](handleError(_0x3b0562,null));};exports[_0x8809('0x41')]=function(_0x35d449,_0x306bc7){var _0x8e60e2={'raw':!![],'where':{'id':_0x35d449[_0x8809('0x42')]['id']}},_0x17e4e7={};_0x17e4e7[_0x8809('0x18')]=_[_0x8809('0x1b')](db[_0x8809('0x3b')][_0x8809('0x14')]);_0x17e4e7[_0x8809('0x1a')]=_[_0x8809('0x1b')](_0x35d449[_0x8809('0x1a')]);_0x17e4e7[_0x8809('0x1c')]=_[_0x8809('0x1d')](_0x17e4e7[_0x8809('0x18')],_0x17e4e7[_0x8809('0x1a')]);_0x8e60e2[_0x8809('0x30')]=_[_0x8809('0x1d')](_0x17e4e7[_0x8809('0x18')],qs[_0x8809('0x31')](_0x35d449[_0x8809('0x1a')]['fields']));_0x8e60e2[_0x8809('0x30')]=_0x8e60e2[_0x8809('0x30')]['length']?_0x8e60e2[_0x8809('0x30')]:_0x17e4e7[_0x8809('0x18')];if(_0x35d449[_0x8809('0x1a')][_0x8809('0x3c')]){_0x8e60e2[_0x8809('0x3d')]=[{'all':!![]}];}_0x8e60e2=_['merge']({},_0x8e60e2,_0x35d449['options']);return db[_0x8809('0x3b')][_0x8809('0x43')](_0x8e60e2)[_0x8809('0xe')](handleEntityNotFound(_0x306bc7,null))[_0x8809('0xe')](respondWithResult(_0x306bc7,null))['catch'](handleError(_0x306bc7,null));};exports['create']=function(_0x3cb60d,_0x2eeca7){return db['CmHopper'][_0x8809('0x44')](_0x3cb60d[_0x8809('0x45')],{})['then'](respondWithResult(_0x2eeca7,0xc9))[_0x8809('0x40')](handleError(_0x2eeca7,null));};exports[_0x8809('0xd')]=function(_0x4655b0,_0x129c06){if(_0x4655b0['body']['id']){delete _0x4655b0[_0x8809('0x45')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x4655b0[_0x8809('0x42')]['id']}})[_0x8809('0xe')](handleEntityNotFound(_0x129c06,null))[_0x8809('0xe')](saveUpdates(_0x4655b0[_0x8809('0x45')],null))[_0x8809('0xe')](respondWithResult(_0x129c06,null))[_0x8809('0x40')](handleError(_0x129c06,null));};exports['describe']=function(_0x2bd916,_0x3d6c26){return db[_0x8809('0x3b')][_0x8809('0x46')]()[_0x8809('0xe')](respondWithResult(_0x3d6c26,null))[_0x8809('0x40')](handleError(_0x3d6c26,null));};exports[_0x8809('0x47')]=function(_0x373bf4,_0x23f6f6){var _0x3da832;var _0x548b0d=_0x373bf4[_0x8809('0x42')]['id'];return db[_0x8809('0x3b')][_0x8809('0x43')]({'where':{'id':_0x373bf4[_0x8809('0x42')]['id']}})[_0x8809('0xe')](handleEntityNotFound(_0x23f6f6,null))[_0x8809('0xe')](function(_0x12506c){if(_0x12506c){return _0x12506c['destroy']()[_0x8809('0xe')](function(_0x5496a3){return _0x5496a3;});}})[_0x8809('0xe')](function(_0x3bb5dd){_0x3da832=_0x3bb5dd;if(_0x3bb5dd){if(_0x3bb5dd[_0x8809('0x48')]||_0x3bb5dd[_0x8809('0x49')]){return db[_0x3bb5dd[_0x8809('0x48')]?_0x8809('0x4a'):_0x8809('0x4b')][_0x8809('0x43')]({'where':{'id':_0x3bb5dd['VoiceQueueId']?_0x3bb5dd[_0x8809('0x48')]:_0x3bb5dd[_0x8809('0x49')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x37133){var _0x36d549={};if(_0x37133){_['merge'](_0x36d549,_[_0x8809('0x4c')](_0x3da832['dataValues'],['createdAt',_0x8809('0x4d'),'id']));_0x36d549[_0x8809('0x4e')]=0x15;_0x36d549[_0x8809('0x4f')]=_0x8809('0x50');_0x36d549[_0x8809('0x51')]=_0x37133[_0x8809('0x11')];_0x36d549[_0x8809('0x52')]=_0x373bf4['user'][_0x8809('0x11')];_0x36d549[_0x8809('0x53')]=_0x373bf4[_0x8809('0x54')]['id'];_0x36d549[_0x8809('0x50')]=!![];_0x36d549[_0x8809('0x55')]=moment()[_0x8809('0x56')](_0x8809('0x57'));_0x36d549[_0x8809('0x58')]=_0x3da832[_0x8809('0x59')];_0x36d549[_0x8809('0x5a')]=_0x3da832['VoiceQueueId']?_0x8809('0x5b'):_0x8809('0x5c');return db[_0x8809('0x5d')][_0x8809('0x43')]({'where':{'id':_0x36d549[_0x8809('0x5e')]},'attributes':[_0x8809('0x5f'),'lastName']})[_0x8809('0xe')](function(_0x26d484){if(!_[_0x8809('0x60')](_0x23f6f6)&&!_[_0x8809('0x60')](_0x26d484[_0x8809('0x5f')])){_0x36d549['calleridname']=_0x26d484[_0x8809('0x5f')];if(!_[_0x8809('0x60')](_0x26d484['lastName'])){_0x36d549['calleridname']+='\x20'+_0x26d484[_0x8809('0x61')];}}})[_0x8809('0x62')](function(){return db[_0x8809('0x63')]['create'](_0x36d549);});}})[_0x8809('0xe')](function(_0xdd485b){return db[_0x8809('0x64')][_0x8809('0x47')]({'where':{'CmHopperId':_0x548b0d}});})[_0x8809('0xe')](function(){return _0x23f6f6[_0x8809('0x5')](0xcc)['end']();})['catch'](handleError(_0x23f6f6,null));};exports['getPreview']=function(_0x1734d1,_0xf698e4){var _0x4b1573=[];return db['CmContact']['describe']()[_0x8809('0xe')](function(_0x1b72d8){_0x4b1573=_['keys'](_0x1b72d8);return _0x1734d1[_0x8809('0x54')][_0x8809('0x65')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x8809('0x66')},'attributes':['id',_0x8809('0x67'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x8809('0xe')](function(_0x4e2a3e){if(_0x4e2a3e&&_0x4e2a3e[_0x8809('0x32')]){return db[_0x8809('0x68')][_0x8809('0x69')](function(_0x1d252e){var _0x2fa1af={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8809('0x56')](_0x8809('0x57'))},'VoiceQueueId':{'$in':_[_0x8809('0x19')](_0x4e2a3e,'id')},'$or':[{'UserId':null},{'UserId':_0x1734d1[_0x8809('0x54')]['id']}]};var _0x10ade5={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4e2a3e)[_0x8809('0x36')]([_0x8809('0x6a'),0x0])[_0x8809('0x19')]('id')[_0x8809('0x6b')]()},'$or':[{'UserId':null},{'UserId':_0x1734d1[_0x8809('0x54')]['id']}]};var _0x1a827e={'$or':[_0x2fa1af,_0x10ade5]};var _0x5e2b75=[];if(_0x1734d1[_0x8809('0x45')]['direction']&&_0x1734d1[_0x8809('0x45')][_0x8809('0x6c')]==='prev'){if(!_['isEmpty'](_0x1734d1[_0x8809('0x45')][_0x8809('0x6d')])){_0x1a827e['id']={'$in':_0x1734d1['body'][_0x8809('0x6d')]};}_0x5e2b75=[[_0x8809('0x6e'),_0x8809('0x6f')],[_0x8809('0x70'),_0x4e2a3e[0x0][_0x8809('0x67')]===_0x8809('0x6f')?_0x8809('0x71'):'ASC'],db[_0x8809('0x68')][_0x8809('0x72')](_0x8809('0x73')),['id',_0x8809('0x71')]];}else{if(!_['isEmpty'](_0x1734d1[_0x8809('0x45')]['hopperIds'])){_0x1a827e['id']={'$notIn':_0x1734d1['body'][_0x8809('0x6d')]};}_0x5e2b75=[[_0x8809('0x6e'),_0x8809('0x71')],[_0x8809('0x70'),_0x4e2a3e[0x0][_0x8809('0x67')]],db['sequelize'][_0x8809('0x72')](_0x8809('0x74')),['id','ASC']];}return db[_0x8809('0x3b')][_0x8809('0x75')]({'attributes':['id','scheduledat',_0x8809('0x59'),_0x8809('0x76')],'where':_0x1a827e,'order':_0x5e2b75,'transaction':_0x1d252e,'lock':_0x1d252e[_0x8809('0x77')][_0x8809('0x78')],'include':[{'model':db[_0x8809('0x5d')],'as':'Contact','attributes':_0x4b1573,'include':[{'model':db['CmCompany'],'as':_0x8809('0x79'),'attributes':['id',_0x8809('0x11')]}]},{'model':db[_0x8809('0x7a')],'as':'List','attributes':['id',_0x8809('0x11')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x8809('0x11'),_0x8809('0x7b')]}]})['then'](function(_0x3a688b){if(_0x3a688b){return _0x3a688b[_0x8809('0xd')]({'UserId':_0x1734d1['user']['id']},{'transaction':_0x1d252e});}});});}})[_0x8809('0xe')](handleEntityNotFound(_0xf698e4,null))[_0x8809('0xe')](respondWithResult(_0xf698e4,null))[_0x8809('0x40')](handleError(_0xf698e4,null));};exports['getPreviewRecall']=function(_0x491e1f,_0x56853a,_0x55cfe8){var _0x394525=[];var _0x350a9b=_0x491e1f['params']['id'];var _0x18fdce=_0x491e1f[_0x8809('0x54')]['id'];return db['CmContact'][_0x8809('0x46')]()[_0x8809('0xe')](function(_0x27b641){_0x394525=_[_0x8809('0x1b')](_0x27b641);return db['sequelize']['transaction'](function(_0x5c058a){const _0x578528={'id':_0x350a9b};return db[_0x8809('0x3b')][_0x8809('0x75')]({'attributes':['id',_0x8809('0x7c'),_0x8809('0x76')],'where':_0x578528,'transaction':_0x5c058a,'lock':_0x5c058a[_0x8809('0x77')][_0x8809('0x78')],'include':[{'model':db[_0x8809('0x5d')],'as':_0x8809('0x7d'),'attributes':_0x394525,'include':[{'model':db[_0x8809('0x7e')],'as':_0x8809('0x79'),'attributes':['id',_0x8809('0x11')]}]},{'model':db[_0x8809('0x7a')],'as':_0x8809('0x7f'),'attributes':['id',_0x8809('0x11')]},{'model':db[_0x8809('0x4a')],'as':'Queue','attributes':['id','name',_0x8809('0x7b')]}]})[_0x8809('0xe')](function(_0x24a2cc){if(_0x24a2cc){return _0x24a2cc[_0x8809('0xd')]({'UserId':_0x18fdce},{'transaction':_0x5c058a});}});});})[_0x8809('0xe')](handleEntityNotFound(_0x56853a,null))[_0x8809('0xe')](respondWithResult(_0x56853a,null))[_0x8809('0x40')](handleError(_0x56853a,null));};exports['getOpenContacts']=function(_0x427447,_0x174251){return _0x427447[_0x8809('0x54')][_0x8809('0x65')]({'where':{'type':_0x8809('0x80'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x8809('0xe')](function(_0x45f8a5){if(_0x45f8a5&&_0x45f8a5[_0x8809('0x32')]){return db[_0x8809('0x3b')][_0x8809('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8809('0x19')](_0x45f8a5,'id')},'$or':[{'UserId':null},{'UserId':_0x427447[_0x8809('0x54')]['id']}]}});}return 0x0;})['then'](function(_0x4c3461){if(!_[_0x8809('0x60')](_0x4c3461)&&_[_0x8809('0x81')](_0x4c3461)){return _0x174251[_0x8809('0x5')](0xc8)['json']({'contacts':_0x4c3461});}else{logger[_0x8809('0x10')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x8809('0x82'),0x194,_0x8809('0x83'));_0x174251[_0x8809('0xf')](0x194);}})[_0x8809('0x40')](handleError(_0x174251,null));};exports[_0x8809('0x84')]=function(_0x2a0ce0,_0x1a4c26){var _0x371d37=shared[_0x8809('0x85')];var _0x3451a4=[];_[_0x8809('0x19')](_0x371d37,function(_0x33bb07){_0x3451a4['push']({'id':_0x33bb07['name'],'name':_0x33bb07['name'],'utcOffset':_0x33bb07[_0x8809('0x86')]});});return _0x1a4c26[_0x8809('0x5')](0xc8)['json']({'tz':_0x3451a4});};exports[_0x8809('0x87')]=function(_0x9552fe,_0x43b3ad){var _0x22cb6d=shared[_0x8809('0x85')];var _0x27552f={};if(!_[_0x8809('0x60')](_0x22cb6d[_0x9552fe[_0x8809('0x45')]['id']]))_0x27552f=_0x22cb6d[_0x9552fe[_0x8809('0x45')]['id']];return _0x43b3ad[_0x8809('0x5')](0xc8)[_0x8809('0x6')](_0x27552f);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 79347e1..945dda7 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x2c73c6,_0x28332b){var _0x2e203c=function(_0x181ffa){while(--_0x181ffa){_0x2c73c6['push'](_0x2c73c6['shift']());}};_0x2e203c(++_0x28332b);}(_0x2a07,0x74));var _0x72a0=function(_0x4be18a,_0x326e6d){_0x4be18a=_0x4be18a-0x0;var _0x5042d4=_0x2a07[_0x4be18a];return _0x5042d4;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['define','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x3f21ea,_0xf1c7ce){var _0x5ce7f7=function(_0xa6ee86){while(--_0xa6ee86){_0x3f21ea['push'](_0x3f21ea['shift']());}};_0x5ce7f7(++_0xf1c7ce);}(_0xf494,0x1c6));var _0x4f49=function(_0x5759ae,_0x178f0f){_0x5759ae=_0x5759ae-0x0;var _0x1797cc=_0xf494[_0x5759ae];return _0x1797cc;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 33b20c7..7e54be6 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 _0xfa78=['Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','order','LOCK','UPDATE','all','GetContactRecallMe','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','bluebird','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopper,\x20%s,\x20%s','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','info','catch','ShowCmHopper','find','body','raw','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x5f4480,_0x3de732){var _0x1c3708=function(_0x310b3e){while(--_0x310b3e){_0x5f4480['push'](_0x5f4480['shift']());}};_0x1c3708(++_0x3de732);}(_0xfa78,0x122));var _0x8fa7=function(_0x1fea5b,_0x2c3692){_0x1fea5b=_0x1fea5b-0x0;var _0x8ffd74=_0xfa78[_0x1fea5b];return _0x8ffd74;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8fa7('0x0'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x8fa7('0x1'));var jayson=require(_0x8fa7('0x2'));var client=jayson[_0x8fa7('0x3')][_0x8fa7('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x304222,_0x97fa0b,_0x180b69){return new BPromise(function(_0xfc128f,_0x232936){return client[_0x8fa7('0x5')](_0x304222,_0x180b69)[_0x8fa7('0x6')](function(_0x401f6c){logger['info']('CmHopper,\x20%s,\x20%s',_0x97fa0b,_0x8fa7('0x7'));logger[_0x8fa7('0x8')](_0x8fa7('0x9'),_0x97fa0b,_0x8fa7('0x7'),JSON[_0x8fa7('0xa')](_0x401f6c));if(_0x401f6c[_0x8fa7('0xb')]){if(_0x401f6c[_0x8fa7('0xb')]['code']===0x1f4){logger[_0x8fa7('0xb')]('CmHopper,\x20%s,\x20%s',_0x97fa0b,_0x401f6c['error'][_0x8fa7('0xc')]);return _0x232936(_0x401f6c[_0x8fa7('0xb')]['message']);}logger[_0x8fa7('0xb')]('CmHopper,\x20%s,\x20%s',_0x97fa0b,_0x401f6c[_0x8fa7('0xb')][_0x8fa7('0xc')]);return _0xfc128f(_0x401f6c[_0x8fa7('0xb')][_0x8fa7('0xc')]);}else{logger['info'](_0x8fa7('0xd'),_0x97fa0b,'request\x20sent');_0xfc128f(_0x401f6c['result']['message']);}})['catch'](function(_0x22a392){logger['error']('CmHopper,\x20%s,\x20%s',_0x97fa0b,_0x22a392);_0x232936(_0x22a392);});});}exports[_0x8fa7('0xe')]=function(_0xe61023){var _0x2321be=this;return new Promise(function(_0x15e020,_0x5da567){return db[_0x8fa7('0xf')][_0x8fa7('0x10')]({'raw':_0xe61023[_0x8fa7('0x11')]?_0xe61023[_0x8fa7('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0xe61023[_0x8fa7('0x11')]?_0xe61023[_0x8fa7('0x11')][_0x8fa7('0x12')]||null:null,'attributes':_0xe61023[_0x8fa7('0x11')]?_0xe61023['options'][_0x8fa7('0x13')]||null:null,'limit':_0xe61023[_0x8fa7('0x11')]?_0xe61023['options'][_0x8fa7('0x14')]||null:null,'include':_0xe61023[_0x8fa7('0x11')]?_0xe61023['options'][_0x8fa7('0x15')]?_[_0x8fa7('0x16')](_0xe61023[_0x8fa7('0x11')][_0x8fa7('0x15')],function(_0x599a2e){return{'model':db[_0x599a2e[_0x8fa7('0x17')]],'as':_0x599a2e['as'],'attributes':_0x599a2e[_0x8fa7('0x13')],'include':_0x599a2e['include']?_[_0x8fa7('0x16')](_0x599a2e['include'],function(_0x59578e){return{'model':db[_0x59578e[_0x8fa7('0x17')]],'as':_0x59578e['as'],'attributes':_0x59578e[_0x8fa7('0x13')],'include':_0x59578e['include']?_[_0x8fa7('0x16')](_0x59578e[_0x8fa7('0x15')],function(_0x4ba0fc){return{'model':db[_0x4ba0fc[_0x8fa7('0x17')]],'as':_0x4ba0fc['as'],'attributes':_0x4ba0fc[_0x8fa7('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8fa7('0x6')](function(_0x10505c){logger[_0x8fa7('0x18')](_0x8fa7('0xe'),_0xe61023);logger['debug'](_0x8fa7('0xe'),_0xe61023,JSON[_0x8fa7('0xa')](_0x10505c));_0x15e020(_0x10505c);})[_0x8fa7('0x19')](function(_0x376aa1){logger['error'](_0x8fa7('0xe'),_0x376aa1[_0x8fa7('0xc')],_0xe61023);_0x5da567(_0x2321be[_0x8fa7('0xb')](0x1f4,_0x376aa1[_0x8fa7('0xc')]));});});};exports[_0x8fa7('0x1a')]=function(_0x2e6238){var _0x90d8a9=this;return new Promise(function(_0x505729,_0x444fc6){return db[_0x8fa7('0xf')][_0x8fa7('0x1b')]({'raw':_0x2e6238[_0x8fa7('0x11')]?_0x2e6238[_0x8fa7('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x2e6238['options']?_0x2e6238[_0x8fa7('0x11')][_0x8fa7('0x12')]||null:null,'attributes':_0x2e6238[_0x8fa7('0x11')]?_0x2e6238['options'][_0x8fa7('0x13')]||null:null,'include':_0x2e6238[_0x8fa7('0x11')]?_0x2e6238[_0x8fa7('0x11')][_0x8fa7('0x15')]?_[_0x8fa7('0x16')](_0x2e6238[_0x8fa7('0x11')][_0x8fa7('0x15')],function(_0x310525){return{'model':db[_0x310525[_0x8fa7('0x17')]],'as':_0x310525['as'],'attributes':_0x310525[_0x8fa7('0x13')],'include':_0x310525[_0x8fa7('0x15')]?_['map'](_0x310525[_0x8fa7('0x15')],function(_0x17951f){return{'model':db[_0x17951f[_0x8fa7('0x17')]],'as':_0x17951f['as'],'attributes':_0x17951f[_0x8fa7('0x13')],'include':_0x17951f['include']?_[_0x8fa7('0x16')](_0x17951f['include'],function(_0x1e62c5){return{'model':db[_0x1e62c5[_0x8fa7('0x17')]],'as':_0x1e62c5['as'],'attributes':_0x1e62c5[_0x8fa7('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8fa7('0x6')](function(_0x15be5e){logger['info'](_0x8fa7('0x1a'),_0x2e6238);logger['debug'](_0x8fa7('0x1a'),_0x2e6238,JSON[_0x8fa7('0xa')](_0x15be5e));_0x505729(_0x15be5e);})[_0x8fa7('0x19')](function(_0x20153b){logger[_0x8fa7('0xb')](_0x8fa7('0x1a'),_0x20153b[_0x8fa7('0xc')],_0x2e6238);_0x444fc6(_0x90d8a9[_0x8fa7('0xb')](0x1f4,_0x20153b[_0x8fa7('0xc')]));});});};exports['CreateCmHopper']=function(_0x4f228d){var _0x5f4733=this;return new Promise(function(_0xf32294,_0x57eeab){return db['CmHopper']['create'](_0x4f228d[_0x8fa7('0x1c')],{'raw':_0x4f228d['options']?_0x4f228d[_0x8fa7('0x11')][_0x8fa7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3f2967){logger[_0x8fa7('0x18')](_0x8fa7('0x1e'),_0x4f228d);logger[_0x8fa7('0x8')](_0x8fa7('0x1e'),_0x4f228d,JSON[_0x8fa7('0xa')](_0x3f2967));_0xf32294(_0x3f2967);})[_0x8fa7('0x19')](function(_0x116dc7){logger[_0x8fa7('0xb')](_0x8fa7('0x1e'),_0x116dc7[_0x8fa7('0xc')],_0x4f228d);_0x57eeab(_0x5f4733[_0x8fa7('0xb')](0x1f4,_0x116dc7['message']));});});};exports[_0x8fa7('0x1f')]=function(_0x215708){var _0xadb58f=this;return new Promise(function(_0x5d258a,_0x1354a7){return db['CmHopper'][_0x8fa7('0x20')](_0x215708['body'],{'raw':_0x215708['options']?_0x215708[_0x8fa7('0x11')][_0x8fa7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x215708[_0x8fa7('0x11')]?_0x215708['options'][_0x8fa7('0x12')]||null:null,'attributes':_0x215708[_0x8fa7('0x11')]?_0x215708[_0x8fa7('0x11')][_0x8fa7('0x13')]||null:null,'limit':_0x215708[_0x8fa7('0x11')]?_0x215708[_0x8fa7('0x11')][_0x8fa7('0x14')]||null:null})['then'](function(_0x63cf2d){logger['info'](_0x8fa7('0x1f'),_0x215708);logger[_0x8fa7('0x18')](_0x8fa7('0x21'),JSON[_0x8fa7('0xa')](_0x215708[_0x8fa7('0x11')]['where']),_0x215708['body'][_0x8fa7('0x22')]);logger['debug']('UpdateCmHopper',_0x215708,JSON[_0x8fa7('0xa')](_0x63cf2d));_0x5d258a(_0x63cf2d);})[_0x8fa7('0x19')](function(_0x55478d){logger[_0x8fa7('0xb')](_0x8fa7('0x1f'),_0x55478d['message'],_0x215708);_0x1354a7(_0xadb58f[_0x8fa7('0xb')](0x1f4,_0x55478d[_0x8fa7('0xc')]));});});};exports[_0x8fa7('0x23')]=function(_0x471bdf){var _0x487229=this;return new Promise(function(_0x29633f,_0x43e75e){return db[_0x8fa7('0xf')][_0x8fa7('0x24')]({'where':_0x471bdf['options']?_0x471bdf[_0x8fa7('0x11')]['where']||null:null})['then'](function(_0x4ac749){logger[_0x8fa7('0x18')](_0x8fa7('0x23'),_0x471bdf);logger['debug'](_0x8fa7('0x23'),_0x471bdf,JSON['stringify'](_0x4ac749));_0x29633f(_0x4ac749);})[_0x8fa7('0x19')](function(_0x4b4554){logger['error'](_0x8fa7('0x23'),_0x4b4554[_0x8fa7('0xc')],_0x471bdf);_0x43e75e(_0x487229[_0x8fa7('0xb')](0x1f4,_0x4b4554['message']));});});};exports[_0x8fa7('0x25')]=function(_0x30e883){var _0x23bf63=this;return new Promise(function(_0x176ad9,_0x58bbf3){return db[_0x8fa7('0x26')][_0x8fa7('0x27')]()[_0x8fa7('0x6')](function(_0x40f263){return db[_0x8fa7('0x28')][_0x8fa7('0x29')](function(_0x1443f3){return db[_0x8fa7('0xf')][_0x8fa7('0x10')]({'where':_0x30e883[_0x8fa7('0x11')]?_0x30e883[_0x8fa7('0x11')][_0x8fa7('0x12')]||null:null,'attributes':_0x30e883[_0x8fa7('0x11')]?_0x30e883[_0x8fa7('0x11')]['attributes']||null:null,'limit':_0x30e883[_0x8fa7('0x11')]?_0x30e883[_0x8fa7('0x11')][_0x8fa7('0x14')]||null:null,'order':_0x30e883[_0x8fa7('0x11')]?_0x30e883[_0x8fa7('0x11')]['order']||null:null,'transaction':_0x1443f3,'lock':_0x1443f3['LOCK']['UPDATE'],'include':[{'model':db[_0x8fa7('0x26')],'as':_0x8fa7('0x2a'),'attributes':_[_0x8fa7('0x2b')](_0x40f263)},{'model':db[_0x8fa7('0x2c')],'as':_0x8fa7('0x2d'),'attributes':['id',_0x8fa7('0x2e'),_0x8fa7('0x2f')]}]})['then'](function(_0x5429f0){var _0x46c64e=[];var _0x5b6367=[];for(var _0x3d55ff=0x0;_0x3d55ff<_0x5429f0[_0x8fa7('0x30')];_0x3d55ff+=0x1){var _0xea9e60=_0x5429f0[_0x3d55ff][_0x8fa7('0x31')];if(_0xea9e60===null){_0x46c64e[_0x8fa7('0x32')](_0x5429f0[_0x3d55ff][_0x8fa7('0x20')](_0x30e883[_0x8fa7('0x1c')],{'transaction':_0x1443f3}));}else if(!_0x5b6367[_0x8fa7('0x33')](_0xea9e60)){_0x5b6367[_0x8fa7('0x32')](_0xea9e60);_0x46c64e['push'](_0x5429f0[_0x3d55ff][_0x8fa7('0x20')](_0x30e883[_0x8fa7('0x1c')],{'transaction':_0x1443f3}));}}return BPromise['all'](_0x46c64e);});})[_0x8fa7('0x6')](function(_0x441837){logger['info'](_0x8fa7('0x25'),_0x30e883);if(_0x441837[_0x8fa7('0x30')]>0x0){logger[_0x8fa7('0x18')](_0x8fa7('0x34'),_0x441837[0x0][_0x8fa7('0x35')]['id'],_0x441837[0x0][_0x8fa7('0x35')][_0x8fa7('0x36')],_0x441837[0x0][_0x8fa7('0x35')][_0x8fa7('0x22')]);}logger['debug'](_0x8fa7('0x25'),_0x30e883,JSON[_0x8fa7('0xa')](_0x441837));_0x176ad9(_0x441837);})[_0x8fa7('0x19')](function(_0x5a8458){logger[_0x8fa7('0xb')](_0x8fa7('0x25'),_0x5a8458[_0x8fa7('0xc')],_0x30e883);_0x58bbf3(_0x23bf63['error'](0x1f4,_0x5a8458[_0x8fa7('0xc')]));});});});};exports[_0x8fa7('0x37')]=function(_0x3c2942){var _0x4ae847=this;return new Promise(function(_0x1dca26,_0x54add4){return db[_0x8fa7('0x28')]['transaction'](function(_0x55bf71){return db[_0x8fa7('0x38')]['create'](_0x3c2942[_0x8fa7('0x1c')],{'raw':_0x3c2942[_0x8fa7('0x11')]?_0x3c2942[_0x8fa7('0x11')][_0x8fa7('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x55bf71})[_0x8fa7('0x6')](function(){logger['info'](_0x8fa7('0x39'),JSON[_0x8fa7('0xa')](_0x3c2942[_0x8fa7('0x11')]['where']),_0x3c2942[_0x8fa7('0x11')][_0x8fa7('0x12')][_0x8fa7('0x22')]);return db[_0x8fa7('0xf')][_0x8fa7('0x24')]({'where':_0x3c2942[_0x8fa7('0x11')]?_0x3c2942['options'][_0x8fa7('0x12')]||null:null,'transaction':_0x55bf71});});})[_0x8fa7('0x6')](function(_0x1d076d){logger[_0x8fa7('0x18')](_0x8fa7('0x37'),_0x3c2942);logger[_0x8fa7('0x8')](_0x8fa7('0x37'),_0x3c2942,JSON[_0x8fa7('0xa')](_0x1d076d));_0x1dca26(_0x1d076d);})[_0x8fa7('0x19')](function(_0xc20604){logger[_0x8fa7('0xb')](_0x8fa7('0x37'),_0xc20604['message'],_0x3c2942);_0x54add4(_0x4ae847[_0x8fa7('0xb')](0x1f4,_0xc20604[_0x8fa7('0xc')]));});});};exports[_0x8fa7('0x3a')]=function(_0xda643f){var _0x971ce9=this;return new Promise(function(_0x16ae81,_0x31090a){return db[_0x8fa7('0xf')][_0x8fa7('0x10')]({'raw':_0xda643f[_0x8fa7('0x11')]?_0xda643f[_0x8fa7('0x11')][_0x8fa7('0x1d')]===undefined?!![]:![]:!![],'where':_0xda643f[_0x8fa7('0x11')]?_0xda643f[_0x8fa7('0x11')][_0x8fa7('0x12')]||null:null,'attributes':[[db[_0x8fa7('0x28')]['fn'](_0x8fa7('0x3b'),db[_0x8fa7('0x28')]['fn']('IF',db['sequelize'][_0x8fa7('0x3c')](_0x8fa7('0x3d')+util[_0x8fa7('0x3e')](_0x8fa7('0x3f'),moment()[_0x8fa7('0x3e')](_0x8fa7('0x40')))+_0x8fa7('0x41')))),'contactsRescheduled']]})[_0x8fa7('0x6')](function(_0xc82982){logger['info'](_0x8fa7('0x3a'),_0xda643f);logger[_0x8fa7('0x8')](_0x8fa7('0x3a'),_0xda643f,JSON[_0x8fa7('0xa')](_0xc82982));_0x16ae81(_0xc82982);})[_0x8fa7('0x19')](function(_0x4e1e78){logger['error'](_0x8fa7('0x3a'),_0x4e1e78[_0x8fa7('0xc')],_0xda643f);_0x31090a(_0x971ce9[_0x8fa7('0xb')](0x1f4,_0x4e1e78['message']));});});};exports['GetContactRecallMe']=function(_0x5efc66){var _0x334cf9=this;return new Promise(function(_0x262159,_0x4f12c){return db['CmContact']['describe']()[_0x8fa7('0x6')](function(_0x2bc2f2){return db[_0x8fa7('0x28')][_0x8fa7('0x29')](function(_0x11f2b5){return db[_0x8fa7('0xf')]['findAll']({'where':_0x5efc66[_0x8fa7('0x11')]?_0x5efc66['options'][_0x8fa7('0x12')]||null:null,'attributes':_0x5efc66[_0x8fa7('0x11')]?_0x5efc66[_0x8fa7('0x11')]['attributes']||null:null,'limit':0x1,'order':_0x5efc66[_0x8fa7('0x11')]?_0x5efc66[_0x8fa7('0x11')][_0x8fa7('0x42')]||null:null,'group':db[_0x8fa7('0xf')][_0x8fa7('0x31')],'transaction':_0x11f2b5,'lock':_0x11f2b5[_0x8fa7('0x43')][_0x8fa7('0x44')],'include':_0x5efc66[_0x8fa7('0x11')]?_0x5efc66[_0x8fa7('0x11')][_0x8fa7('0x15')]?_[_0x8fa7('0x16')](_0x5efc66[_0x8fa7('0x11')][_0x8fa7('0x15')],function(_0x39cad4){return{'model':db[_0x39cad4[_0x8fa7('0x17')]],'as':_0x39cad4['as'],'attributes':_0x39cad4[_0x8fa7('0x13')],'include':_0x39cad4['include']?_['map'](_0x39cad4[_0x8fa7('0x15')],function(_0x3ac926){return{'model':db[_0x3ac926['model']],'as':_0x3ac926['as'],'attributes':_0x3ac926[_0x8fa7('0x13')],'include':_0x3ac926[_0x8fa7('0x15')]?_[_0x8fa7('0x16')](_0x3ac926['include'],function(_0x2265c){return{'model':db[_0x2265c[_0x8fa7('0x17')]],'as':_0x2265c['as'],'attributes':_0x2265c[_0x8fa7('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8fa7('0x6')](function(_0x9a0494){var _0x562081=[];for(var _0x4307cd=0x0;_0x4307cd<_0x9a0494['length'];_0x4307cd+=0x1){_0x562081[_0x8fa7('0x32')](_0x9a0494[_0x4307cd][_0x8fa7('0x20')](_0x5efc66[_0x8fa7('0x1c')],{'transaction':_0x11f2b5}));}return BPromise[_0x8fa7('0x45')](_0x562081);});})['then'](function(_0x2c798d){logger[_0x8fa7('0x18')](_0x8fa7('0x46'),_0x5efc66);logger[_0x8fa7('0x8')](_0x8fa7('0x46'),_0x5efc66,JSON[_0x8fa7('0xa')](_0x2c798d));_0x262159(_0x2c798d);})[_0x8fa7('0x19')](function(_0x44fd02){logger[_0x8fa7('0xb')]('GetContactRecallMe',_0x44fd02[_0x8fa7('0xc')],_0x5efc66);_0x4f12c(_0x334cf9[_0x8fa7('0xb')](0x1f4,_0x44fd02[_0x8fa7('0xc')]));});});});};exports['GetCmHopperPreview']=function(_0x26bc96){var _0x39e72f=this;return new Promise(function(_0x51a15e,_0x4bd5da){db[_0x8fa7('0x26')][_0x8fa7('0x27')]()[_0x8fa7('0x6')](function(_0x3a12b3){return db[_0x8fa7('0xf')][_0x8fa7('0x10')]({'raw':_0x26bc96[_0x8fa7('0x11')]?_0x26bc96[_0x8fa7('0x11')][_0x8fa7('0x1d')]===undefined?!![]:![]:!![],'where':_0x26bc96[_0x8fa7('0x11')]?_0x26bc96[_0x8fa7('0x11')][_0x8fa7('0x12')]||null:null,'attributes':_0x26bc96[_0x8fa7('0x11')]?_0x26bc96[_0x8fa7('0x11')][_0x8fa7('0x13')]||null:null,'limit':_0x26bc96[_0x8fa7('0x11')]?_0x26bc96[_0x8fa7('0x11')]['limit']||null:null,'include':_0x26bc96['options']?_0x26bc96[_0x8fa7('0x11')]['include']?_[_0x8fa7('0x16')](_0x26bc96['options'][_0x8fa7('0x15')],function(_0x2ad516){return{'model':db[_0x2ad516['model']],'as':_0x2ad516['as'],'attributes':_0x2ad516['as']==='Contact'?_[_0x8fa7('0x2b')](_0x3a12b3):_0x2ad516[_0x8fa7('0x13')],'include':_0x2ad516['include']?_[_0x8fa7('0x16')](_0x2ad516[_0x8fa7('0x15')],function(_0x3dfa5b){return{'model':db[_0x3dfa5b[_0x8fa7('0x17')]],'as':_0x3dfa5b['as'],'attributes':_0x3dfa5b[_0x8fa7('0x13')],'include':_0x3dfa5b['include']?_[_0x8fa7('0x16')](_0x3dfa5b[_0x8fa7('0x15')],function(_0x35030f){return{'model':db[_0x35030f['model']],'as':_0x35030f['as'],'attributes':_0x35030f[_0x8fa7('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8fa7('0x6')](function(_0x2b4c71){logger[_0x8fa7('0x18')](_0x8fa7('0xe'),_0x26bc96);logger[_0x8fa7('0x8')](_0x8fa7('0xe'),_0x26bc96,JSON[_0x8fa7('0xa')](_0x2b4c71));_0x51a15e(_0x2b4c71);})[_0x8fa7('0x19')](function(_0x4ba234){logger[_0x8fa7('0xb')]('GetCmHopper',_0x4ba234[_0x8fa7('0xc')],_0x26bc96);_0x4bd5da(_0x39e72f[_0x8fa7('0xb')](0x1f4,_0x4ba234[_0x8fa7('0xc')]));});});});};exports['GetContactByPhone']=function(_0x258104){var _0x3cface=this;return new Promise(function(_0x267ffc,_0x2177a8){return db[_0x8fa7('0x26')]['findOne']({'raw':!![],'where':{'phone':_0x258104[_0x8fa7('0x11')]['where'][_0x8fa7('0x47')]},'attributes':['id','dialTimezone'],'order':[['id',_0x8fa7('0x48')]]})[_0x8fa7('0x6')](function(_0xf36b54){logger[_0x8fa7('0x18')](_0x8fa7('0x49'),_0x258104);logger[_0x8fa7('0x8')]('getContactByPhone',_0x258104,JSON[_0x8fa7('0xa')](_0xf36b54));_0x267ffc(_0xf36b54);})['catch'](function(_0x5adede){logger[_0x8fa7('0xb')](_0x8fa7('0x49'),_0x5adede[_0x8fa7('0xc')],_0x258104);_0x2177a8(_0x3cface[_0x8fa7('0xb')](0x1f4,_0x5adede['message']));});});};exports[_0x8fa7('0x4a')]=function(_0x4f62b3){var _0x5a7b32=this;return new Promise(function(_0x4e3297,_0x4931d7){return db['sequelize'][_0x8fa7('0x29')](function(_0x2b092a){return db[_0x8fa7('0xf')][_0x8fa7('0x20')](_0x4f62b3[_0x8fa7('0x1c')],{'where':{},'transaction':_0x2b092a})[_0x8fa7('0x6')](function(_0x1a80f0){logger['info'](_0x8fa7('0x4a'),_0x4f62b3);logger[_0x8fa7('0x8')](_0x8fa7('0x4a'),_0x4f62b3,JSON['stringify'](_0x1a80f0));_0x4e3297(_0x1a80f0);})['catch'](function(_0x56ac16){logger[_0x8fa7('0xb')](_0x8fa7('0x4a'),_0x56ac16[_0x8fa7('0xc')],_0x4f62b3);_0x4931d7(_0x5a7b32['error'](0x1f4,_0x56ac16[_0x8fa7('0xc')]));});});});};exports[_0x8fa7('0x4b')]=function(_0x5d5c49){var _0x5096c1=this;var _0x2a586f=_0x5d5c49[_0x8fa7('0x1c')][_0x8fa7('0x12')][_0x8fa7('0x4c')];var _0x563a60=_0x5d5c49[_0x8fa7('0x1c')]['where'][_0x8fa7('0x4d')];var _0xfb5218=_0x5d5c49[_0x8fa7('0x1c')][_0x8fa7('0x12')][_0x8fa7('0x4e')];return new Promise(function(_0x44bdf9,_0x323675){return db[_0x8fa7('0xf')]['findAll']({'where':{'voiceQueueId':{'$in':_0x2a586f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x8fa7('0x28')][_0x8fa7('0x3c')](_0x8fa7('0x4f')+_0x563a60+_0x8fa7('0x50')),'$gt':db['sequelize'][_0x8fa7('0x3c')]('NOW()')}},'UserId':{'$in':_0xfb5218}},'include':[{'model':db[_0x8fa7('0x26')],'as':_0x8fa7('0x2a')},{'model':db['User'],'as':_0x8fa7('0x2d'),'attributes':['id','name',_0x8fa7('0x2f')]},{'model':db[_0x8fa7('0x51')],'as':_0x8fa7('0x52')}]})[_0x8fa7('0x6')](function(_0x1107e1){if(_0x1107e1[_0x8fa7('0x30')]>0x0){return db[_0x8fa7('0x28')][_0x8fa7('0x29')](function(_0x1dd761){return db[_0x8fa7('0xf')][_0x8fa7('0x20')]({'recallmeNotifiedDate':db[_0x8fa7('0x28')][_0x8fa7('0x3c')]('NOW()')},{'where':{'id':{'$in':_[_0x8fa7('0x16')](_0x1107e1,'id')}},'transaction':_0x1dd761})[_0x8fa7('0x6')](function(){_0x44bdf9(_0x1107e1);})[_0x8fa7('0x19')](function(_0x3be967){logger[_0x8fa7('0xb')](_0x8fa7('0x4b'),_0x3be967[_0x8fa7('0xc')],_0x5d5c49);_0x323675(_0x5096c1[_0x8fa7('0xb')](0x1f4,_0x3be967['message']));});})[_0x8fa7('0x19')](function(_0x3e28f8){logger[_0x8fa7('0xb')](_0x8fa7('0x4b'),_0x3e28f8[_0x8fa7('0xc')],_0x5d5c49);_0x323675(_0x5096c1[_0x8fa7('0xb')](0x1f4,_0x3e28f8[_0x8fa7('0xc')]));});}else{_0x44bdf9(_0x1107e1);}});});}; \ No newline at end of file +var _0x0ae9=['then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','findAll','raw','options','where','attributes','include','map','model','find','ShowCmHopper','CreateCmHopper','CmHopper','create','UpdateCmHopper','update','limit','body','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','length','UserId','push','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','\x20MINUTE','NOW()','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x606a15,_0x172191){var _0x238702=function(_0x192d7e){while(--_0x192d7e){_0x606a15['push'](_0x606a15['shift']());}};_0x238702(++_0x172191);}(_0x0ae9,0x105));var _0x90ae=function(_0x497416,_0x3ab375){_0x497416=_0x497416-0x0;var _0x45f974=_0x0ae9[_0x497416];return _0x45f974;};'use strict';var _=require(_0x90ae('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x90ae('0x1'));var db=require(_0x90ae('0x2'))['db'];var logger=require(_0x90ae('0x3'))(_0x90ae('0x4'));var jayson=require(_0x90ae('0x5'));var client=jayson[_0x90ae('0x6')][_0x90ae('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x30c2ab,_0x1949ac,_0x319533){return new BPromise(function(_0x2afb33,_0x331827){return client[_0x90ae('0x8')](_0x30c2ab,_0x319533)[_0x90ae('0x9')](function(_0x2ef768){logger[_0x90ae('0xa')](_0x90ae('0xb'),_0x1949ac,_0x90ae('0xc'));logger[_0x90ae('0xd')](_0x90ae('0xe'),_0x1949ac,_0x90ae('0xc'),JSON[_0x90ae('0xf')](_0x2ef768));if(_0x2ef768[_0x90ae('0x10')]){if(_0x2ef768['error'][_0x90ae('0x11')]===0x1f4){logger[_0x90ae('0x10')](_0x90ae('0xb'),_0x1949ac,_0x2ef768['error'][_0x90ae('0x12')]);return _0x331827(_0x2ef768['error'][_0x90ae('0x12')]);}logger[_0x90ae('0x10')]('CmHopper,\x20%s,\x20%s',_0x1949ac,_0x2ef768['error'][_0x90ae('0x12')]);return _0x2afb33(_0x2ef768[_0x90ae('0x10')][_0x90ae('0x12')]);}else{logger[_0x90ae('0xa')](_0x90ae('0xb'),_0x1949ac,'request\x20sent');_0x2afb33(_0x2ef768[_0x90ae('0x13')][_0x90ae('0x12')]);}})[_0x90ae('0x14')](function(_0x557bf9){logger[_0x90ae('0x10')](_0x90ae('0xb'),_0x1949ac,_0x557bf9);_0x331827(_0x557bf9);});});}exports[_0x90ae('0x15')]=function(_0x4cda45){var _0x2a1d1e=this;return new Promise(function(_0xd84f25,_0xa5b3b1){return db['CmHopper'][_0x90ae('0x16')]({'raw':_0x4cda45['options']?_0x4cda45['options'][_0x90ae('0x17')]===undefined?!![]:![]:!![],'where':_0x4cda45['options']?_0x4cda45[_0x90ae('0x18')][_0x90ae('0x19')]||null:null,'attributes':_0x4cda45[_0x90ae('0x18')]?_0x4cda45['options'][_0x90ae('0x1a')]||null:null,'limit':_0x4cda45[_0x90ae('0x18')]?_0x4cda45[_0x90ae('0x18')]['limit']||null:null,'include':_0x4cda45[_0x90ae('0x18')]?_0x4cda45['options'][_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x4cda45[_0x90ae('0x18')][_0x90ae('0x1b')],function(_0x1f6aae){return{'model':db[_0x1f6aae[_0x90ae('0x1d')]],'as':_0x1f6aae['as'],'attributes':_0x1f6aae['attributes'],'include':_0x1f6aae[_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x1f6aae[_0x90ae('0x1b')],function(_0x2abaa1){return{'model':db[_0x2abaa1[_0x90ae('0x1d')]],'as':_0x2abaa1['as'],'attributes':_0x2abaa1[_0x90ae('0x1a')],'include':_0x2abaa1['include']?_[_0x90ae('0x1c')](_0x2abaa1[_0x90ae('0x1b')],function(_0x1555db){return{'model':db[_0x1555db[_0x90ae('0x1d')]],'as':_0x1555db['as'],'attributes':_0x1555db['attributes']};}):[]};}):[]};}):[]:[]})[_0x90ae('0x9')](function(_0x19a0f6){logger['info']('GetCmHopper',_0x4cda45);logger[_0x90ae('0xd')]('GetCmHopper',_0x4cda45,JSON['stringify'](_0x19a0f6));_0xd84f25(_0x19a0f6);})['catch'](function(_0x33df32){logger['error']('GetCmHopper',_0x33df32[_0x90ae('0x12')],_0x4cda45);_0xa5b3b1(_0x2a1d1e['error'](0x1f4,_0x33df32[_0x90ae('0x12')]));});});};exports['ShowCmHopper']=function(_0x212945){var _0x2108b4=this;return new Promise(function(_0xd22091,_0x362aee){return db['CmHopper'][_0x90ae('0x1e')]({'raw':_0x212945['options']?_0x212945[_0x90ae('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x212945[_0x90ae('0x18')]?_0x212945[_0x90ae('0x18')]['where']||null:null,'attributes':_0x212945[_0x90ae('0x18')]?_0x212945[_0x90ae('0x18')][_0x90ae('0x1a')]||null:null,'include':_0x212945['options']?_0x212945['options']['include']?_['map'](_0x212945['options'][_0x90ae('0x1b')],function(_0x1e29c0){return{'model':db[_0x1e29c0[_0x90ae('0x1d')]],'as':_0x1e29c0['as'],'attributes':_0x1e29c0[_0x90ae('0x1a')],'include':_0x1e29c0[_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x1e29c0[_0x90ae('0x1b')],function(_0x1840ed){return{'model':db[_0x1840ed[_0x90ae('0x1d')]],'as':_0x1840ed['as'],'attributes':_0x1840ed[_0x90ae('0x1a')],'include':_0x1840ed['include']?_[_0x90ae('0x1c')](_0x1840ed[_0x90ae('0x1b')],function(_0x5100ff){return{'model':db[_0x5100ff['model']],'as':_0x5100ff['as'],'attributes':_0x5100ff[_0x90ae('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x90ae('0x9')](function(_0x38615e){logger[_0x90ae('0xa')]('ShowCmHopper',_0x212945);logger[_0x90ae('0xd')](_0x90ae('0x1f'),_0x212945,JSON[_0x90ae('0xf')](_0x38615e));_0xd22091(_0x38615e);})['catch'](function(_0x259017){logger['error'](_0x90ae('0x1f'),_0x259017['message'],_0x212945);_0x362aee(_0x2108b4[_0x90ae('0x10')](0x1f4,_0x259017[_0x90ae('0x12')]));});});};exports[_0x90ae('0x20')]=function(_0x598119){var _0x45cf15=this;return new Promise(function(_0x56cad0,_0x53a4ff){return db[_0x90ae('0x21')][_0x90ae('0x22')](_0x598119['body'],{'raw':_0x598119['options']?_0x598119[_0x90ae('0x18')][_0x90ae('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5d824a){logger[_0x90ae('0xa')](_0x90ae('0x20'),_0x598119);logger[_0x90ae('0xd')](_0x90ae('0x20'),_0x598119,JSON[_0x90ae('0xf')](_0x5d824a));_0x56cad0(_0x5d824a);})[_0x90ae('0x14')](function(_0x3d9014){logger[_0x90ae('0x10')]('CreateCmHopper',_0x3d9014['message'],_0x598119);_0x53a4ff(_0x45cf15[_0x90ae('0x10')](0x1f4,_0x3d9014['message']));});});};exports[_0x90ae('0x23')]=function(_0xc484bc){var _0x4408ed=this;return new Promise(function(_0x2fbb33,_0x302879){return db[_0x90ae('0x21')][_0x90ae('0x24')](_0xc484bc['body'],{'raw':_0xc484bc[_0x90ae('0x18')]?_0xc484bc[_0x90ae('0x18')][_0x90ae('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc484bc['options']?_0xc484bc[_0x90ae('0x18')]['where']||null:null,'attributes':_0xc484bc[_0x90ae('0x18')]?_0xc484bc['options'][_0x90ae('0x1a')]||null:null,'limit':_0xc484bc[_0x90ae('0x18')]?_0xc484bc['options'][_0x90ae('0x25')]||null:null})[_0x90ae('0x9')](function(_0x2291a2){logger[_0x90ae('0xa')]('UpdateCmHopper',_0xc484bc);logger[_0x90ae('0xa')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0xc484bc[_0x90ae('0x18')][_0x90ae('0x19')]),_0xc484bc[_0x90ae('0x26')][_0x90ae('0x27')]);logger[_0x90ae('0xd')](_0x90ae('0x23'),_0xc484bc,JSON[_0x90ae('0xf')](_0x2291a2));_0x2fbb33(_0x2291a2);})[_0x90ae('0x14')](function(_0xd811cc){logger[_0x90ae('0x10')](_0x90ae('0x23'),_0xd811cc['message'],_0xc484bc);_0x302879(_0x4408ed[_0x90ae('0x10')](0x1f4,_0xd811cc['message']));});});};exports[_0x90ae('0x28')]=function(_0x136eb2){var _0x6e61fb=this;return new Promise(function(_0x72264f,_0x16bb42){return db[_0x90ae('0x21')][_0x90ae('0x29')]({'where':_0x136eb2[_0x90ae('0x18')]?_0x136eb2[_0x90ae('0x18')]['where']||null:null})[_0x90ae('0x9')](function(_0x279ac7){logger[_0x90ae('0xa')](_0x90ae('0x28'),_0x136eb2);logger[_0x90ae('0xd')]('DestroyCmHopper',_0x136eb2,JSON[_0x90ae('0xf')](_0x279ac7));_0x72264f(_0x279ac7);})[_0x90ae('0x14')](function(_0x402e0b){logger[_0x90ae('0x10')]('DestroyCmHopper',_0x402e0b[_0x90ae('0x12')],_0x136eb2);_0x16bb42(_0x6e61fb[_0x90ae('0x10')](0x1f4,_0x402e0b[_0x90ae('0x12')]));});});};exports['GetContactDialer']=function(_0x296747){var _0x36f91a=this;return new Promise(function(_0x56fa9f,_0x22a915){return db[_0x90ae('0x2a')][_0x90ae('0x2b')]()[_0x90ae('0x9')](function(_0x3a2c62){return db[_0x90ae('0x2c')][_0x90ae('0x2d')](function(_0x45af53){return db[_0x90ae('0x21')][_0x90ae('0x16')]({'where':_0x296747['options']?_0x296747[_0x90ae('0x18')][_0x90ae('0x19')]||null:null,'attributes':_0x296747[_0x90ae('0x18')]?_0x296747[_0x90ae('0x18')]['attributes']||null:null,'limit':_0x296747[_0x90ae('0x18')]?_0x296747[_0x90ae('0x18')][_0x90ae('0x25')]||null:null,'order':_0x296747[_0x90ae('0x18')]?_0x296747[_0x90ae('0x18')][_0x90ae('0x2e')]||null:null,'transaction':_0x45af53,'lock':_0x45af53[_0x90ae('0x2f')][_0x90ae('0x30')],'include':[{'model':db[_0x90ae('0x2a')],'as':_0x90ae('0x31'),'attributes':_[_0x90ae('0x32')](_0x3a2c62)},{'model':db[_0x90ae('0x33')],'as':_0x90ae('0x34'),'attributes':['id',_0x90ae('0x35'),'voicePause']}]})[_0x90ae('0x9')](function(_0x5e9d8e){var _0x12f27c=[];var _0x4486e6=[];for(var _0x38c4bb=0x0;_0x38c4bb<_0x5e9d8e[_0x90ae('0x36')];_0x38c4bb+=0x1){var _0x509ea5=_0x5e9d8e[_0x38c4bb][_0x90ae('0x37')];if(_0x509ea5===null){_0x12f27c[_0x90ae('0x38')](_0x5e9d8e[_0x38c4bb][_0x90ae('0x24')](_0x296747[_0x90ae('0x26')],{'transaction':_0x45af53}));}else if(!_0x4486e6['includes'](_0x509ea5)){_0x4486e6[_0x90ae('0x38')](_0x509ea5);_0x12f27c[_0x90ae('0x38')](_0x5e9d8e[_0x38c4bb][_0x90ae('0x24')](_0x296747[_0x90ae('0x26')],{'transaction':_0x45af53}));}}return BPromise[_0x90ae('0x39')](_0x12f27c);});})[_0x90ae('0x9')](function(_0x121b11){logger[_0x90ae('0xa')](_0x90ae('0x3a'),_0x296747);if(_0x121b11['length']>0x0){logger[_0x90ae('0xa')](_0x90ae('0x3b'),_0x121b11[0x0][_0x90ae('0x3c')]['id'],_0x121b11[0x0][_0x90ae('0x3c')][_0x90ae('0x3d')],_0x121b11[0x0][_0x90ae('0x3c')][_0x90ae('0x27')]);}logger[_0x90ae('0xd')]('GetContactDialer',_0x296747,JSON[_0x90ae('0xf')](_0x121b11));_0x56fa9f(_0x121b11);})['catch'](function(_0x40e535){logger[_0x90ae('0x10')](_0x90ae('0x3a'),_0x40e535[_0x90ae('0x12')],_0x296747);_0x22a915(_0x36f91a['error'](0x1f4,_0x40e535[_0x90ae('0x12')]));});});});};exports[_0x90ae('0x3e')]=function(_0x33b45){var _0x10fcd5=this;return new Promise(function(_0x275173,_0x38bf7f){return db[_0x90ae('0x2c')][_0x90ae('0x2d')](function(_0x222039){return db[_0x90ae('0x3f')][_0x90ae('0x22')](_0x33b45[_0x90ae('0x26')],{'raw':_0x33b45[_0x90ae('0x18')]?_0x33b45['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x222039})[_0x90ae('0x9')](function(){logger[_0x90ae('0xa')](_0x90ae('0x40'),JSON[_0x90ae('0xf')](_0x33b45[_0x90ae('0x18')][_0x90ae('0x19')]),_0x33b45[_0x90ae('0x18')][_0x90ae('0x19')][_0x90ae('0x27')]);return db[_0x90ae('0x21')][_0x90ae('0x29')]({'where':_0x33b45['options']?_0x33b45['options'][_0x90ae('0x19')]||null:null,'transaction':_0x222039});});})[_0x90ae('0x9')](function(_0x2d168a){logger[_0x90ae('0xa')](_0x90ae('0x3e'),_0x33b45);logger[_0x90ae('0xd')](_0x90ae('0x3e'),_0x33b45,JSON[_0x90ae('0xf')](_0x2d168a));_0x275173(_0x2d168a);})[_0x90ae('0x14')](function(_0x51ad92){logger[_0x90ae('0x10')](_0x90ae('0x3e'),_0x51ad92[_0x90ae('0x12')],_0x33b45);_0x38bf7f(_0x10fcd5[_0x90ae('0x10')](0x1f4,_0x51ad92['message']));});});};exports['CountReScheduled']=function(_0x1195b3){var _0x4e946b=this;return new Promise(function(_0x130ecd,_0x446d4b){return db[_0x90ae('0x21')][_0x90ae('0x16')]({'raw':_0x1195b3['options']?_0x1195b3[_0x90ae('0x18')][_0x90ae('0x17')]===undefined?!![]:![]:!![],'where':_0x1195b3[_0x90ae('0x18')]?_0x1195b3['options'][_0x90ae('0x19')]||null:null,'attributes':[[db[_0x90ae('0x2c')]['fn'](_0x90ae('0x41'),db[_0x90ae('0x2c')]['fn']('IF',db['sequelize'][_0x90ae('0x42')](_0x90ae('0x43')+util[_0x90ae('0x44')]('\x22%s\x22',moment()[_0x90ae('0x44')](_0x90ae('0x45')))+_0x90ae('0x46')))),_0x90ae('0x47')]]})[_0x90ae('0x9')](function(_0x4cba92){logger['info']('CountReScheduled',_0x1195b3);logger[_0x90ae('0xd')](_0x90ae('0x48'),_0x1195b3,JSON[_0x90ae('0xf')](_0x4cba92));_0x130ecd(_0x4cba92);})[_0x90ae('0x14')](function(_0x52f261){logger[_0x90ae('0x10')]('CountReScheduled',_0x52f261[_0x90ae('0x12')],_0x1195b3);_0x446d4b(_0x4e946b[_0x90ae('0x10')](0x1f4,_0x52f261['message']));});});};exports['GetContactRecallMe']=function(_0x1ca79f){var _0x58a629=this;return new Promise(function(_0x387bd5,_0x1b5ee8){return db['CmContact']['describe']()[_0x90ae('0x9')](function(_0x54dc67){return db['sequelize'][_0x90ae('0x2d')](function(_0x110854){return db['CmHopper'][_0x90ae('0x16')]({'where':_0x1ca79f[_0x90ae('0x18')]?_0x1ca79f[_0x90ae('0x18')][_0x90ae('0x19')]||null:null,'attributes':_0x1ca79f[_0x90ae('0x18')]?_0x1ca79f['options'][_0x90ae('0x1a')]||null:null,'limit':0x1,'order':_0x1ca79f[_0x90ae('0x18')]?_0x1ca79f[_0x90ae('0x18')][_0x90ae('0x2e')]||null:null,'group':db[_0x90ae('0x21')][_0x90ae('0x37')],'transaction':_0x110854,'lock':_0x110854[_0x90ae('0x2f')][_0x90ae('0x30')],'include':_0x1ca79f[_0x90ae('0x18')]?_0x1ca79f[_0x90ae('0x18')]['include']?_['map'](_0x1ca79f[_0x90ae('0x18')][_0x90ae('0x1b')],function(_0x21243e){return{'model':db[_0x21243e[_0x90ae('0x1d')]],'as':_0x21243e['as'],'attributes':_0x21243e[_0x90ae('0x1a')],'include':_0x21243e[_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x21243e[_0x90ae('0x1b')],function(_0x26f5e2){return{'model':db[_0x26f5e2[_0x90ae('0x1d')]],'as':_0x26f5e2['as'],'attributes':_0x26f5e2[_0x90ae('0x1a')],'include':_0x26f5e2[_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x26f5e2['include'],function(_0x38acfc){return{'model':db[_0x38acfc[_0x90ae('0x1d')]],'as':_0x38acfc['as'],'attributes':_0x38acfc[_0x90ae('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x90ae('0x9')](function(_0x32e0d4){var _0x245c7e=[];for(var _0x600658=0x0;_0x600658<_0x32e0d4[_0x90ae('0x36')];_0x600658+=0x1){_0x245c7e[_0x90ae('0x38')](_0x32e0d4[_0x600658][_0x90ae('0x24')](_0x1ca79f[_0x90ae('0x26')],{'transaction':_0x110854}));}return BPromise[_0x90ae('0x39')](_0x245c7e);});})[_0x90ae('0x9')](function(_0x1e1dcd){logger[_0x90ae('0xa')](_0x90ae('0x49'),_0x1ca79f);logger[_0x90ae('0xd')](_0x90ae('0x49'),_0x1ca79f,JSON[_0x90ae('0xf')](_0x1e1dcd));_0x387bd5(_0x1e1dcd);})[_0x90ae('0x14')](function(_0x1c7895){logger['error'](_0x90ae('0x49'),_0x1c7895[_0x90ae('0x12')],_0x1ca79f);_0x1b5ee8(_0x58a629[_0x90ae('0x10')](0x1f4,_0x1c7895['message']));});});});};exports[_0x90ae('0x4a')]=function(_0x4a5d39){var _0x446c1b=this;return new Promise(function(_0x401f91,_0x2ebc98){db[_0x90ae('0x2a')]['describe']()[_0x90ae('0x9')](function(_0x10d944){return db[_0x90ae('0x21')]['findAll']({'raw':_0x4a5d39[_0x90ae('0x18')]?_0x4a5d39[_0x90ae('0x18')][_0x90ae('0x17')]===undefined?!![]:![]:!![],'where':_0x4a5d39[_0x90ae('0x18')]?_0x4a5d39[_0x90ae('0x18')][_0x90ae('0x19')]||null:null,'attributes':_0x4a5d39[_0x90ae('0x18')]?_0x4a5d39[_0x90ae('0x18')][_0x90ae('0x1a')]||null:null,'limit':_0x4a5d39[_0x90ae('0x18')]?_0x4a5d39[_0x90ae('0x18')][_0x90ae('0x25')]||null:null,'include':_0x4a5d39['options']?_0x4a5d39['options'][_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x4a5d39[_0x90ae('0x18')][_0x90ae('0x1b')],function(_0x280921){return{'model':db[_0x280921['model']],'as':_0x280921['as'],'attributes':_0x280921['as']===_0x90ae('0x31')?_[_0x90ae('0x32')](_0x10d944):_0x280921[_0x90ae('0x1a')],'include':_0x280921[_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x280921['include'],function(_0x3756fb){return{'model':db[_0x3756fb[_0x90ae('0x1d')]],'as':_0x3756fb['as'],'attributes':_0x3756fb[_0x90ae('0x1a')],'include':_0x3756fb[_0x90ae('0x1b')]?_[_0x90ae('0x1c')](_0x3756fb['include'],function(_0x21eadb){return{'model':db[_0x21eadb[_0x90ae('0x1d')]],'as':_0x21eadb['as'],'attributes':_0x21eadb['attributes']};}):[]};}):[]};}):[]:[]})[_0x90ae('0x9')](function(_0x246595){logger[_0x90ae('0xa')]('GetCmHopper',_0x4a5d39);logger[_0x90ae('0xd')](_0x90ae('0x15'),_0x4a5d39,JSON[_0x90ae('0xf')](_0x246595));_0x401f91(_0x246595);})['catch'](function(_0x108280){logger[_0x90ae('0x10')](_0x90ae('0x15'),_0x108280[_0x90ae('0x12')],_0x4a5d39);_0x2ebc98(_0x446c1b['error'](0x1f4,_0x108280[_0x90ae('0x12')]));});});});};exports[_0x90ae('0x4b')]=function(_0x425e30){var _0x4081c6=this;return new Promise(function(_0x4bab6c,_0x4573a2){return db[_0x90ae('0x2a')][_0x90ae('0x4c')]({'raw':!![],'where':{'phone':_0x425e30[_0x90ae('0x18')][_0x90ae('0x19')][_0x90ae('0x4d')]},'attributes':['id',_0x90ae('0x4e')],'order':[['id',_0x90ae('0x4f')]]})[_0x90ae('0x9')](function(_0x53c939){logger[_0x90ae('0xa')](_0x90ae('0x50'),_0x425e30);logger[_0x90ae('0xd')](_0x90ae('0x50'),_0x425e30,JSON[_0x90ae('0xf')](_0x53c939));_0x4bab6c(_0x53c939);})[_0x90ae('0x14')](function(_0x1a0c64){logger[_0x90ae('0x10')](_0x90ae('0x50'),_0x1a0c64[_0x90ae('0x12')],_0x425e30);_0x4573a2(_0x4081c6['error'](0x1f4,_0x1a0c64[_0x90ae('0x12')]));});});};exports['ResetActiveCalls']=function(_0x43a15d){var _0x13c0f5=this;return new Promise(function(_0x3fb86f,_0x6a8761){return db[_0x90ae('0x2c')][_0x90ae('0x2d')](function(_0x49c95b){return db[_0x90ae('0x21')][_0x90ae('0x24')](_0x43a15d['body'],{'where':{},'transaction':_0x49c95b})[_0x90ae('0x9')](function(_0x32ac25){logger['info'](_0x90ae('0x51'),_0x43a15d);logger[_0x90ae('0xd')](_0x90ae('0x51'),_0x43a15d,JSON[_0x90ae('0xf')](_0x32ac25));_0x3fb86f(_0x32ac25);})[_0x90ae('0x14')](function(_0x264845){logger[_0x90ae('0x10')](_0x90ae('0x51'),_0x264845['message'],_0x43a15d);_0x6a8761(_0x13c0f5[_0x90ae('0x10')](0x1f4,_0x264845['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0xe8cbc6){var _0x4be8d8=this;var _0x36752d=_0xe8cbc6[_0x90ae('0x26')][_0x90ae('0x19')][_0x90ae('0x52')];var _0x34546d=_0xe8cbc6['body'][_0x90ae('0x19')][_0x90ae('0x53')];var _0x3b860b=_0xe8cbc6[_0x90ae('0x26')]['where']['availableAgentsIds'];return new Promise(function(_0xa6594b,_0xf22821){return db[_0x90ae('0x21')][_0x90ae('0x16')]({'where':{'voiceQueueId':{'$in':_0x36752d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x34546d+_0x90ae('0x54')),'$gt':db['sequelize'][_0x90ae('0x42')](_0x90ae('0x55'))}},'UserId':{'$in':_0x3b860b}},'include':[{'model':db[_0x90ae('0x2a')],'as':'Contact'},{'model':db[_0x90ae('0x33')],'as':_0x90ae('0x34'),'attributes':['id',_0x90ae('0x35'),_0x90ae('0x56')]},{'model':db[_0x90ae('0x57')],'as':_0x90ae('0x58')}]})['then'](function(_0x5b380d){if(_0x5b380d[_0x90ae('0x36')]>0x0){return db[_0x90ae('0x2c')]['transaction'](function(_0xbd1345){return db[_0x90ae('0x21')][_0x90ae('0x24')]({'recallmeNotifiedDate':db[_0x90ae('0x2c')]['literal']('NOW()')},{'where':{'id':{'$in':_[_0x90ae('0x1c')](_0x5b380d,'id')}},'transaction':_0xbd1345})[_0x90ae('0x9')](function(){_0xa6594b(_0x5b380d);})['catch'](function(_0x1ec849){logger['error'](_0x90ae('0x59'),_0x1ec849[_0x90ae('0x12')],_0xe8cbc6);_0xf22821(_0x4be8d8['error'](0x1f4,_0x1ec849[_0x90ae('0x12')]));});})['catch'](function(_0xc1f840){logger[_0x90ae('0x10')](_0x90ae('0x59'),_0xc1f840[_0x90ae('0x12')],_0xe8cbc6);_0xf22821(_0x4be8d8[_0x90ae('0x10')](0x1f4,_0xc1f840[_0x90ae('0x12')]));});}else{_0xa6594b(_0x5b380d);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 1249908..c2a9f9a 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 _0xff3f=['get','isAuthenticated','index','/describe','describe','/opencontacts','/timezones','/:id','show','getPreviewRecall','post','create','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller'];(function(_0xe97e4c,_0x486a93){var _0x2a2f09=function(_0x4a7575){while(--_0x4a7575){_0xe97e4c['push'](_0xe97e4c['shift']());}};_0x2a2f09(++_0x486a93);}(_0xff3f,0x104));var _0xfff3=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xff3f[_0x8af54b];return _0x27d8f0;};'use strict';var express=require(_0xfff3('0x0'));var router=express[_0xfff3('0x1')]();var auth=require(_0xfff3('0x2'));var controller=require(_0xfff3('0x3'));router[_0xfff3('0x4')]('/',auth[_0xfff3('0x5')](),controller[_0xfff3('0x6')]);router[_0xfff3('0x4')](_0xfff3('0x7'),auth['isAuthenticated'](),controller[_0xfff3('0x8')]);router['get'](_0xfff3('0x9'),auth[_0xfff3('0x5')](),controller['getOpenContacts']);router['get'](_0xfff3('0xa'),auth[_0xfff3('0x5')](),controller['getTimezones']);router[_0xfff3('0x4')](_0xfff3('0xb'),auth[_0xfff3('0x5')](),controller[_0xfff3('0xc')]);router[_0xfff3('0x4')]('/:id/previewrecall',auth[_0xfff3('0x5')](),controller[_0xfff3('0xd')]);router[_0xfff3('0xe')]('/',auth['isAuthenticated'](),controller[_0xfff3('0xf')]);router[_0xfff3('0xe')]('/preview',auth[_0xfff3('0x5')](),controller[_0xfff3('0x10')]);router[_0xfff3('0xe')](_0xfff3('0x11'),auth[_0xfff3('0x5')](),controller[_0xfff3('0x12')]);router[_0xfff3('0x13')]('/:id',auth[_0xfff3('0x5')](),controller[_0xfff3('0x14')]);router[_0xfff3('0x15')]('/:id',auth[_0xfff3('0x5')](),controller[_0xfff3('0x16')]);module[_0xfff3('0x17')]=router; \ No newline at end of file +var _0x1289=['update','delete','destroy','express','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put'];(function(_0xd8dab8,_0x5d35da){var _0x41c119=function(_0x2ba039){while(--_0x2ba039){_0xd8dab8['push'](_0xd8dab8['shift']());}};_0x41c119(++_0x5d35da);}(_0x1289,0x13b));var _0x9128=function(_0x4777f6,_0x429478){_0x4777f6=_0x4777f6-0x0;var _0x56c2de=_0x1289[_0x4777f6];return _0x56c2de;};'use strict';var express=require(_0x9128('0x0'));var router=express['Router']();var auth=require(_0x9128('0x1'));var controller=require(_0x9128('0x2'));router[_0x9128('0x3')]('/',auth[_0x9128('0x4')](),controller[_0x9128('0x5')]);router['get'](_0x9128('0x6'),auth[_0x9128('0x4')](),controller[_0x9128('0x7')]);router[_0x9128('0x3')](_0x9128('0x8'),auth[_0x9128('0x4')](),controller[_0x9128('0x9')]);router[_0x9128('0x3')](_0x9128('0xa'),auth[_0x9128('0x4')](),controller['getTimezones']);router[_0x9128('0x3')](_0x9128('0xb'),auth[_0x9128('0x4')](),controller[_0x9128('0xc')]);router[_0x9128('0x3')](_0x9128('0xd'),auth['isAuthenticated'](),controller[_0x9128('0xe')]);router[_0x9128('0xf')]('/',auth[_0x9128('0x4')](),controller[_0x9128('0x10')]);router[_0x9128('0xf')](_0x9128('0x11'),auth[_0x9128('0x4')](),controller[_0x9128('0x12')]);router[_0x9128('0xf')]('/timezone',auth[_0x9128('0x4')](),controller[_0x9128('0x13')]);router[_0x9128('0x14')](_0x9128('0xb'),auth[_0x9128('0x4')](),controller[_0x9128('0x15')]);router[_0x9128('0x16')](_0x9128('0xb'),auth[_0x9128('0x4')](),controller[_0x9128('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index f684254..133e09d 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 _0x821d=['INTEGER','STRING','DATE','format','moment','exports'];(function(_0xd4f7b8,_0x14f6a0){var _0x22c47f=function(_0xe1282f){while(--_0xe1282f){_0xd4f7b8['push'](_0xd4f7b8['shift']());}};_0x22c47f(++_0x14f6a0);}(_0x821d,0xe2));var _0xd821=function(_0x2a56ef,_0x3916cf){_0x2a56ef=_0x2a56ef-0x0;var _0x372718=_0x821d[_0x2a56ef];return _0x372718;};'use strict';var moment=require(_0xd821('0x0'));var Sequelize=require('sequelize');module[_0xd821('0x1')]={'CmHopperId':{'type':Sequelize[_0xd821('0x2')]},'phone':{'type':Sequelize[_0xd821('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xd821('0x4')],'defaultValue':moment()[_0xd821('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd821('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf104=['format','moment','exports','INTEGER','STRING','DATE'];(function(_0x205123,_0x240ebe){var _0x5b69fb=function(_0x488aaf){while(--_0x488aaf){_0x205123['push'](_0x205123['shift']());}};_0x5b69fb(++_0x240ebe);}(_0xf104,0xeb));var _0x4f10=function(_0x58746d,_0x393abc){_0x58746d=_0x58746d-0x0;var _0x442bed=_0xf104[_0x58746d];return _0x442bed;};'use strict';var moment=require(_0x4f10('0x0'));var Sequelize=require('sequelize');module[_0x4f10('0x1')]={'CmHopperId':{'type':Sequelize[_0x4f10('0x2')]},'phone':{'type':Sequelize[_0x4f10('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x4f10('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4f10('0x4')],'defaultValue':moment()[_0x4f10('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x4f10('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4f10('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4f10('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4f10('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4f10('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4f10('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4f10('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 c68fad5..e7cbb88 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 _0x4f29=['../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','CmHopperAdditionalPhones','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3a2bd5,_0x2edcd8){var _0x972381=function(_0xb676f9){while(--_0xb676f9){_0x3a2bd5['push'](_0x3a2bd5['shift']());}};_0x972381(++_0x2edcd8);}(_0x4f29,0xe4));var _0x94f2=function(_0x569357,_0x2db198){_0x569357=_0x569357-0x0;var _0x9a039f=_0x4f29[_0x569357];return _0x9a039f;};'use strict';var emlformat=require(_0x94f2('0x0'));var rimraf=require(_0x94f2('0x1'));var zipdir=require(_0x94f2('0x2'));var jsonpatch=require(_0x94f2('0x3'));var rp=require('request-promise');var moment=require(_0x94f2('0x4'));var BPromise=require(_0x94f2('0x5'));var Mustache=require(_0x94f2('0x6'));var util=require('util');var path=require(_0x94f2('0x7'));var sox=require(_0x94f2('0x8'));var csv=require('to-csv');var ejs=require(_0x94f2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94f2('0xa'));var squel=require(_0x94f2('0xb'));var crypto=require(_0x94f2('0xc'));var jsforce=require(_0x94f2('0xd'));var deskjs=require(_0x94f2('0xe'));var toCsv=require(_0x94f2('0xf'));var querystring=require(_0x94f2('0x10'));var Papa=require(_0x94f2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x94f2('0x12'));var as=require(_0x94f2('0x13'));var hardwareService=require(_0x94f2('0x14'));var logger=require(_0x94f2('0x15'))(_0x94f2('0x16'));var utils=require('../../config/utils');var config=require(_0x94f2('0x17'));var licenseUtil=require(_0x94f2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b066f,_0x389a1a){_0x389a1a=_0x389a1a||0xcc;return function(_0x4beeb3){if(_0x4beeb3){return _0x4b066f[_0x94f2('0x19')](_0x389a1a);}return _0x4b066f['status'](_0x389a1a)[_0x94f2('0x1a')]();};}function respondWithResult(_0x4ba1d1,_0x4c8716){_0x4c8716=_0x4c8716||0xc8;return function(_0x5267dc){if(_0x5267dc){return _0x4ba1d1[_0x94f2('0x1b')](_0x4c8716)[_0x94f2('0x1c')](_0x5267dc);}};}function respondWithFilteredResult(_0x51ad9c,_0xd4a3ef){return function(_0x5acc8f){if(_0x5acc8f){var _0x10e748=typeof _0xd4a3ef[_0x94f2('0x1d')]==='undefined'&&typeof _0xd4a3ef['limit']===_0x94f2('0x1e');var _0x1d1a1f=_0x5acc8f['count'];var _0x315ccf=_0x10e748?0x0:_0xd4a3ef[_0x94f2('0x1d')];var _0x2131c0=_0x10e748?_0x5acc8f[_0x94f2('0x1f')]:_0xd4a3ef[_0x94f2('0x1d')]+_0xd4a3ef[_0x94f2('0x20')];var _0x4aaed9;if(_0x2131c0>=_0x1d1a1f){_0x2131c0=_0x1d1a1f;_0x4aaed9=0xc8;}else{_0x4aaed9=0xce;}_0x51ad9c[_0x94f2('0x1b')](_0x4aaed9);return _0x51ad9c[_0x94f2('0x21')](_0x94f2('0x22'),_0x315ccf+'-'+_0x2131c0+'/'+_0x1d1a1f)['json'](_0x5acc8f);}return null;};}function patchUpdates(_0x5c6ea8){return function(_0x58570c){try{jsonpatch[_0x94f2('0x23')](_0x58570c,_0x5c6ea8,!![]);}catch(_0x5272b1){return BPromise[_0x94f2('0x24')](_0x5272b1);}return _0x58570c['save']();};}function saveUpdates(_0x3e07c3,_0x45ee85){return function(_0x8d82e2){if(_0x8d82e2){return _0x8d82e2[_0x94f2('0x25')](_0x3e07c3)[_0x94f2('0x26')](function(_0x3b0c3c){return _0x3b0c3c;});}return null;};}function removeEntity(_0x5c08df,_0x249b97){return function(_0xb0c40f){if(_0xb0c40f){return _0xb0c40f[_0x94f2('0x27')]()['then'](function(){var _0xa2f2fa=_0xb0c40f[_0x94f2('0x28')]({'plain':!![]});var _0x517233=_0x94f2('0x29');return db['UserProfileResource'][_0x94f2('0x27')]({'where':{'type':_0x517233,'resourceId':_0xa2f2fa['id']}})[_0x94f2('0x26')](function(){return _0xb0c40f;});})[_0x94f2('0x26')](function(){_0x5c08df['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b8c8e,_0x5a0acb){return function(_0xec3a3a){if(!_0xec3a3a){_0x2b8c8e[_0x94f2('0x19')](0x194);}return _0xec3a3a;};}function handleError(_0x132ca9,_0x4178f8){_0x4178f8=_0x4178f8||0x1f4;return function(_0x23a004){logger['error'](_0x23a004[_0x94f2('0x2a')]);if(_0x23a004[_0x94f2('0x2b')]){delete _0x23a004[_0x94f2('0x2b')];}_0x132ca9[_0x94f2('0x1b')](_0x4178f8)['send'](_0x23a004);};}exports[_0x94f2('0x2c')]=function(_0x2b4e35,_0x194af7){var _0x106b50={},_0x5b71a3={},_0x39e4c9={'count':0x0,'rows':[]};var _0x145e9f=_[_0x94f2('0x2d')](db[_0x94f2('0x2e')][_0x94f2('0x2f')],function(_0x1c5a07){return{'name':_0x1c5a07['fieldName'],'type':_0x1c5a07[_0x94f2('0x30')][_0x94f2('0x31')]};});_0x5b71a3[_0x94f2('0x32')]=_[_0x94f2('0x2d')](_0x145e9f,_0x94f2('0x2b'));_0x5b71a3[_0x94f2('0x33')]=_['keys'](_0x2b4e35[_0x94f2('0x33')]);_0x5b71a3['filters']=_[_0x94f2('0x34')](_0x5b71a3[_0x94f2('0x32')],_0x5b71a3['query']);_0x106b50['attributes']=_[_0x94f2('0x34')](_0x5b71a3['model'],qs[_0x94f2('0x35')](_0x2b4e35[_0x94f2('0x33')][_0x94f2('0x35')]));_0x106b50[_0x94f2('0x36')]=_0x106b50[_0x94f2('0x36')][_0x94f2('0x37')]?_0x106b50['attributes']:_0x5b71a3[_0x94f2('0x32')];if(!_0x2b4e35[_0x94f2('0x33')][_0x94f2('0x38')]('nolimit')){_0x106b50['limit']=qs[_0x94f2('0x20')](_0x2b4e35[_0x94f2('0x33')][_0x94f2('0x20')]);_0x106b50[_0x94f2('0x1d')]=qs[_0x94f2('0x1d')](_0x2b4e35[_0x94f2('0x33')][_0x94f2('0x1d')]);}_0x106b50[_0x94f2('0x39')]=qs[_0x94f2('0x3a')](_0x2b4e35['query'][_0x94f2('0x3a')]);_0x106b50[_0x94f2('0x3b')]=qs[_0x94f2('0x3c')](_[_0x94f2('0x3d')](_0x2b4e35[_0x94f2('0x33')],_0x5b71a3[_0x94f2('0x3c')]),_0x145e9f);if(_0x2b4e35[_0x94f2('0x33')][_0x94f2('0x3e')]){_0x106b50[_0x94f2('0x3b')]=_[_0x94f2('0x3f')](_0x106b50[_0x94f2('0x3b')],{'$or':_['map'](_0x145e9f,function(_0xa2cbfa){if(_0xa2cbfa[_0x94f2('0x30')]!==_0x94f2('0x40')){var _0x49395d={};_0x49395d[_0xa2cbfa[_0x94f2('0x2b')]]={'$like':'%'+_0x2b4e35[_0x94f2('0x33')][_0x94f2('0x3e')]+'%'};return _0x49395d;}})});}_0x106b50=_['merge']({},_0x106b50,_0x2b4e35[_0x94f2('0x41')]);var _0x5326cc={'where':_0x106b50[_0x94f2('0x3b')]};return db[_0x94f2('0x2e')]['count'](_0x5326cc)[_0x94f2('0x26')](function(_0x38e42d){_0x39e4c9['count']=_0x38e42d;if(_0x2b4e35['query'][_0x94f2('0x42')]){_0x106b50[_0x94f2('0x43')]=[{'all':!![]}];}return db[_0x94f2('0x2e')][_0x94f2('0x44')](_0x106b50);})[_0x94f2('0x26')](function(_0x21653a){_0x39e4c9[_0x94f2('0x45')]=_0x21653a;return _0x39e4c9;})[_0x94f2('0x26')](respondWithFilteredResult(_0x194af7,_0x106b50))[_0x94f2('0x46')](handleError(_0x194af7,null));};exports[_0x94f2('0x47')]=function(_0x56dcc0,_0x5d5874){var _0x506035={'raw':!![],'where':{'id':_0x56dcc0[_0x94f2('0x48')]['id']}},_0x4d152c={};_0x4d152c[_0x94f2('0x32')]=_['keys'](db['CmHopperAdditionalPhone'][_0x94f2('0x2f')]);_0x4d152c[_0x94f2('0x33')]=_[_0x94f2('0x49')](_0x56dcc0['query']);_0x4d152c[_0x94f2('0x3c')]=_['intersection'](_0x4d152c[_0x94f2('0x32')],_0x4d152c[_0x94f2('0x33')]);_0x506035['attributes']=_['intersection'](_0x4d152c['model'],qs['fields'](_0x56dcc0[_0x94f2('0x33')][_0x94f2('0x35')]));_0x506035['attributes']=_0x506035[_0x94f2('0x36')]['length']?_0x506035[_0x94f2('0x36')]:_0x4d152c[_0x94f2('0x32')];if(_0x56dcc0['query'][_0x94f2('0x42')]){_0x506035[_0x94f2('0x43')]=[{'all':!![]}];}_0x506035=_[_0x94f2('0x3f')]({},_0x506035,_0x56dcc0[_0x94f2('0x41')]);return db['CmHopperAdditionalPhone'][_0x94f2('0x4a')](_0x506035)['then'](handleEntityNotFound(_0x5d5874,null))[_0x94f2('0x26')](respondWithResult(_0x5d5874,null))[_0x94f2('0x46')](handleError(_0x5d5874,null));};exports[_0x94f2('0x4b')]=function(_0x1a1c34,_0x288edf){return db[_0x94f2('0x2e')][_0x94f2('0x4b')](_0x1a1c34[_0x94f2('0x4c')],{})[_0x94f2('0x26')](function(_0x443890){var _0x2d9250=_0x1a1c34[_0x94f2('0x4d')][_0x94f2('0x28')]({'plain':!![]});if(!_0x2d9250)throw new Error(_0x94f2('0x4e'));if(_0x2d9250[_0x94f2('0x4f')]===_0x94f2('0x4d')){var _0x373f6a=_0x443890[_0x94f2('0x28')]({'plain':!![]});var _0x2469e2=_0x94f2('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x2469e2,'userProfileId':_0x2d9250[_0x94f2('0x50')]},'raw':!![]})[_0x94f2('0x26')](function(_0x5a1114){if(_0x5a1114&&_0x5a1114['autoAssociation']===0x0){return db[_0x94f2('0x51')]['create']({'name':_0x373f6a[_0x94f2('0x2b')],'resourceId':_0x373f6a['id'],'type':_0x5a1114[_0x94f2('0x2b')],'sectionId':_0x5a1114['id']},{})[_0x94f2('0x26')](function(){return _0x443890;});}else{return _0x443890;}})[_0x94f2('0x46')](function(_0x5df8b9){logger[_0x94f2('0x52')](_0x94f2('0x53'),_0x5df8b9);throw _0x5df8b9;});}return _0x443890;})[_0x94f2('0x26')](respondWithResult(_0x288edf,0xc9))[_0x94f2('0x46')](handleError(_0x288edf,null));};exports[_0x94f2('0x25')]=function(_0x3aaa40,_0x28be54){if(_0x3aaa40[_0x94f2('0x4c')]['id']){delete _0x3aaa40[_0x94f2('0x4c')]['id'];}return db[_0x94f2('0x2e')]['find']({'where':{'id':_0x3aaa40['params']['id']}})[_0x94f2('0x26')](handleEntityNotFound(_0x28be54,null))[_0x94f2('0x26')](saveUpdates(_0x3aaa40[_0x94f2('0x4c')],null))[_0x94f2('0x26')](respondWithResult(_0x28be54,null))[_0x94f2('0x46')](handleError(_0x28be54,null));};exports[_0x94f2('0x27')]=function(_0x3b9d32,_0x4e7a55){return db[_0x94f2('0x2e')][_0x94f2('0x4a')]({'where':{'id':_0x3b9d32[_0x94f2('0x48')]['id']}})[_0x94f2('0x26')](handleEntityNotFound(_0x4e7a55,null))[_0x94f2('0x26')](removeEntity(_0x4e7a55,null))[_0x94f2('0x46')](handleError(_0x4e7a55,null));}; \ No newline at end of file +var _0xa5a4=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','CmHopperAdditionalPhones','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','query','keys','model','attributes'];(function(_0x191eb7,_0x4385e6){var _0x5a0ce1=function(_0x51dd18){while(--_0x51dd18){_0x191eb7['push'](_0x191eb7['shift']());}};_0x5a0ce1(++_0x4385e6);}(_0xa5a4,0x172));var _0x4a5a=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0xa5a4[_0x2a56ad];return _0x425175;};'use strict';var emlformat=require(_0x4a5a('0x0'));var rimraf=require(_0x4a5a('0x1'));var zipdir=require(_0x4a5a('0x2'));var jsonpatch=require(_0x4a5a('0x3'));var rp=require(_0x4a5a('0x4'));var moment=require(_0x4a5a('0x5'));var BPromise=require(_0x4a5a('0x6'));var Mustache=require(_0x4a5a('0x7'));var util=require('util');var path=require(_0x4a5a('0x8'));var sox=require(_0x4a5a('0x9'));var csv=require(_0x4a5a('0xa'));var ejs=require(_0x4a5a('0xb'));var fs=require('fs');var fs_extra=require(_0x4a5a('0xc'));var _=require(_0x4a5a('0xd'));var squel=require(_0x4a5a('0xe'));var crypto=require(_0x4a5a('0xf'));var jsforce=require(_0x4a5a('0x10'));var deskjs=require(_0x4a5a('0x11'));var toCsv=require(_0x4a5a('0xa'));var querystring=require(_0x4a5a('0x12'));var Papa=require(_0x4a5a('0x13'));var Redis=require('ioredis');var authService=require(_0x4a5a('0x14'));var qs=require(_0x4a5a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a5a('0x16'));var utils=require('../../config/utils');var config=require(_0x4a5a('0x17'));var licenseUtil=require(_0x4a5a('0x18'));var db=require(_0x4a5a('0x19'))['db'];function respondWithStatusCode(_0x3df89c,_0x10f425){_0x10f425=_0x10f425||0xcc;return function(_0x435915){if(_0x435915){return _0x3df89c[_0x4a5a('0x1a')](_0x10f425);}return _0x3df89c[_0x4a5a('0x1b')](_0x10f425)[_0x4a5a('0x1c')]();};}function respondWithResult(_0x25627f,_0x5996c8){_0x5996c8=_0x5996c8||0xc8;return function(_0x3b8a82){if(_0x3b8a82){return _0x25627f[_0x4a5a('0x1b')](_0x5996c8)[_0x4a5a('0x1d')](_0x3b8a82);}};}function respondWithFilteredResult(_0x5e6065,_0x4d4c50){return function(_0x5247fb){if(_0x5247fb){var _0x1db666=typeof _0x4d4c50[_0x4a5a('0x1e')]===_0x4a5a('0x1f')&&typeof _0x4d4c50[_0x4a5a('0x20')]===_0x4a5a('0x1f');var _0x5efd67=_0x5247fb[_0x4a5a('0x21')];var _0x50644b=_0x1db666?0x0:_0x4d4c50[_0x4a5a('0x1e')];var _0x510ea2=_0x1db666?_0x5247fb[_0x4a5a('0x21')]:_0x4d4c50[_0x4a5a('0x1e')]+_0x4d4c50[_0x4a5a('0x20')];var _0x317389;if(_0x510ea2>=_0x5efd67){_0x510ea2=_0x5efd67;_0x317389=0xc8;}else{_0x317389=0xce;}_0x5e6065[_0x4a5a('0x1b')](_0x317389);return _0x5e6065[_0x4a5a('0x22')](_0x4a5a('0x23'),_0x50644b+'-'+_0x510ea2+'/'+_0x5efd67)[_0x4a5a('0x1d')](_0x5247fb);}return null;};}function patchUpdates(_0x3d4a88){return function(_0x40fbdc){try{jsonpatch[_0x4a5a('0x24')](_0x40fbdc,_0x3d4a88,!![]);}catch(_0x504a2e){return BPromise['reject'](_0x504a2e);}return _0x40fbdc['save']();};}function saveUpdates(_0xd5651a,_0x4bd34d){return function(_0x315a15){if(_0x315a15){return _0x315a15[_0x4a5a('0x25')](_0xd5651a)[_0x4a5a('0x26')](function(_0x514852){return _0x514852;});}return null;};}function removeEntity(_0x47a986,_0x85d95b){return function(_0x37b4a1){if(_0x37b4a1){return _0x37b4a1[_0x4a5a('0x27')]()[_0x4a5a('0x26')](function(){var _0x2366f0=_0x37b4a1[_0x4a5a('0x28')]({'plain':!![]});var _0xcb3f33=_0x4a5a('0x29');return db['UserProfileResource'][_0x4a5a('0x27')]({'where':{'type':_0xcb3f33,'resourceId':_0x2366f0['id']}})[_0x4a5a('0x26')](function(){return _0x37b4a1;});})[_0x4a5a('0x26')](function(){_0x47a986['status'](0xcc)[_0x4a5a('0x1c')]();});}};}function handleEntityNotFound(_0x12e74c,_0x3c8829){return function(_0x3854fa){if(!_0x3854fa){_0x12e74c[_0x4a5a('0x1a')](0x194);}return _0x3854fa;};}function handleError(_0x3c2050,_0x29e488){_0x29e488=_0x29e488||0x1f4;return function(_0x3dfa1d){logger[_0x4a5a('0x2a')](_0x3dfa1d[_0x4a5a('0x2b')]);if(_0x3dfa1d['name']){delete _0x3dfa1d[_0x4a5a('0x2c')];}_0x3c2050[_0x4a5a('0x1b')](_0x29e488)[_0x4a5a('0x2d')](_0x3dfa1d);};}exports['index']=function(_0xf61b33,_0x3e1737){var _0x5d60b1={},_0xbc2650={},_0x79e519={'count':0x0,'rows':[]};var _0x19e806=_[_0x4a5a('0x2e')](db[_0x4a5a('0x2f')][_0x4a5a('0x30')],function(_0x19ff86){return{'name':_0x19ff86[_0x4a5a('0x31')],'type':_0x19ff86[_0x4a5a('0x32')]['key']};});_0xbc2650['model']=_[_0x4a5a('0x2e')](_0x19e806,_0x4a5a('0x2c'));_0xbc2650[_0x4a5a('0x33')]=_[_0x4a5a('0x34')](_0xf61b33[_0x4a5a('0x33')]);_0xbc2650['filters']=_['intersection'](_0xbc2650[_0x4a5a('0x35')],_0xbc2650[_0x4a5a('0x33')]);_0x5d60b1[_0x4a5a('0x36')]=_[_0x4a5a('0x37')](_0xbc2650[_0x4a5a('0x35')],qs[_0x4a5a('0x38')](_0xf61b33[_0x4a5a('0x33')]['fields']));_0x5d60b1[_0x4a5a('0x36')]=_0x5d60b1['attributes'][_0x4a5a('0x39')]?_0x5d60b1[_0x4a5a('0x36')]:_0xbc2650[_0x4a5a('0x35')];if(!_0xf61b33[_0x4a5a('0x33')][_0x4a5a('0x3a')](_0x4a5a('0x3b'))){_0x5d60b1[_0x4a5a('0x20')]=qs[_0x4a5a('0x20')](_0xf61b33[_0x4a5a('0x33')][_0x4a5a('0x20')]);_0x5d60b1[_0x4a5a('0x1e')]=qs['offset'](_0xf61b33[_0x4a5a('0x33')][_0x4a5a('0x1e')]);}_0x5d60b1[_0x4a5a('0x3c')]=qs[_0x4a5a('0x3d')](_0xf61b33[_0x4a5a('0x33')][_0x4a5a('0x3d')]);_0x5d60b1[_0x4a5a('0x3e')]=qs[_0x4a5a('0x3f')](_[_0x4a5a('0x40')](_0xf61b33[_0x4a5a('0x33')],_0xbc2650['filters']),_0x19e806);if(_0xf61b33[_0x4a5a('0x33')]['filter']){_0x5d60b1[_0x4a5a('0x3e')]=_[_0x4a5a('0x41')](_0x5d60b1['where'],{'$or':_['map'](_0x19e806,function(_0x4901c4){if(_0x4901c4[_0x4a5a('0x32')]!==_0x4a5a('0x42')){var _0x2fc9ef={};_0x2fc9ef[_0x4901c4[_0x4a5a('0x2c')]]={'$like':'%'+_0xf61b33[_0x4a5a('0x33')][_0x4a5a('0x43')]+'%'};return _0x2fc9ef;}})});}_0x5d60b1=_[_0x4a5a('0x41')]({},_0x5d60b1,_0xf61b33['options']);var _0x1b964a={'where':_0x5d60b1[_0x4a5a('0x3e')]};return db[_0x4a5a('0x2f')][_0x4a5a('0x21')](_0x1b964a)['then'](function(_0x3c2a30){_0x79e519[_0x4a5a('0x21')]=_0x3c2a30;if(_0xf61b33['query'][_0x4a5a('0x44')]){_0x5d60b1[_0x4a5a('0x45')]=[{'all':!![]}];}return db[_0x4a5a('0x2f')][_0x4a5a('0x46')](_0x5d60b1);})['then'](function(_0x2cbf0c){_0x79e519[_0x4a5a('0x47')]=_0x2cbf0c;return _0x79e519;})[_0x4a5a('0x26')](respondWithFilteredResult(_0x3e1737,_0x5d60b1))['catch'](handleError(_0x3e1737,null));};exports[_0x4a5a('0x48')]=function(_0x3bd645,_0x14778d){var _0x396625={'raw':!![],'where':{'id':_0x3bd645['params']['id']}},_0x5d23e4={};_0x5d23e4[_0x4a5a('0x35')]=_[_0x4a5a('0x34')](db[_0x4a5a('0x2f')][_0x4a5a('0x30')]);_0x5d23e4['query']=_[_0x4a5a('0x34')](_0x3bd645[_0x4a5a('0x33')]);_0x5d23e4['filters']=_[_0x4a5a('0x37')](_0x5d23e4[_0x4a5a('0x35')],_0x5d23e4[_0x4a5a('0x33')]);_0x396625['attributes']=_[_0x4a5a('0x37')](_0x5d23e4[_0x4a5a('0x35')],qs[_0x4a5a('0x38')](_0x3bd645[_0x4a5a('0x33')][_0x4a5a('0x38')]));_0x396625[_0x4a5a('0x36')]=_0x396625[_0x4a5a('0x36')][_0x4a5a('0x39')]?_0x396625[_0x4a5a('0x36')]:_0x5d23e4[_0x4a5a('0x35')];if(_0x3bd645[_0x4a5a('0x33')][_0x4a5a('0x44')]){_0x396625[_0x4a5a('0x45')]=[{'all':!![]}];}_0x396625=_['merge']({},_0x396625,_0x3bd645[_0x4a5a('0x49')]);return db[_0x4a5a('0x2f')][_0x4a5a('0x4a')](_0x396625)['then'](handleEntityNotFound(_0x14778d,null))[_0x4a5a('0x26')](respondWithResult(_0x14778d,null))[_0x4a5a('0x4b')](handleError(_0x14778d,null));};exports[_0x4a5a('0x4c')]=function(_0x2268ce,_0x422237){return db['CmHopperAdditionalPhone'][_0x4a5a('0x4c')](_0x2268ce[_0x4a5a('0x4d')],{})[_0x4a5a('0x26')](function(_0x40ef7b){var _0xe794ea=_0x2268ce[_0x4a5a('0x4e')][_0x4a5a('0x28')]({'plain':!![]});if(!_0xe794ea)throw new Error(_0x4a5a('0x4f'));if(_0xe794ea[_0x4a5a('0x50')]===_0x4a5a('0x4e')){var _0xc8870f=_0x40ef7b[_0x4a5a('0x28')]({'plain':!![]});var _0x1e3c88='CmHopperAdditionalPhones';return db[_0x4a5a('0x51')][_0x4a5a('0x4a')]({'where':{'name':_0x1e3c88,'userProfileId':_0xe794ea['userProfileId']},'raw':!![]})[_0x4a5a('0x26')](function(_0x352c6b){if(_0x352c6b&&_0x352c6b[_0x4a5a('0x52')]===0x0){return db['UserProfileResource'][_0x4a5a('0x4c')]({'name':_0xc8870f[_0x4a5a('0x2c')],'resourceId':_0xc8870f['id'],'type':_0x352c6b[_0x4a5a('0x2c')],'sectionId':_0x352c6b['id']},{})[_0x4a5a('0x26')](function(){return _0x40ef7b;});}else{return _0x40ef7b;}})[_0x4a5a('0x4b')](function(_0x46986f){logger[_0x4a5a('0x2a')](_0x4a5a('0x53'),_0x46986f);throw _0x46986f;});}return _0x40ef7b;})[_0x4a5a('0x26')](respondWithResult(_0x422237,0xc9))[_0x4a5a('0x4b')](handleError(_0x422237,null));};exports[_0x4a5a('0x25')]=function(_0x183444,_0x3a602f){if(_0x183444['body']['id']){delete _0x183444['body']['id'];}return db['CmHopperAdditionalPhone'][_0x4a5a('0x4a')]({'where':{'id':_0x183444['params']['id']}})[_0x4a5a('0x26')](handleEntityNotFound(_0x3a602f,null))['then'](saveUpdates(_0x183444['body'],null))['then'](respondWithResult(_0x3a602f,null))[_0x4a5a('0x4b')](handleError(_0x3a602f,null));};exports['destroy']=function(_0xccb57c,_0x7a5807){return db[_0x4a5a('0x2f')][_0x4a5a('0x4a')]({'where':{'id':_0xccb57c[_0x4a5a('0x54')]['id']}})[_0x4a5a('0x26')](handleEntityNotFound(_0x7a5807,null))[_0x4a5a('0x26')](removeEntity(_0x7a5807,null))[_0x4a5a('0x4b')](handleError(_0x7a5807,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 118d10a..038e56d 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 _0x5c48=['rimraf','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4750da,_0x25dd7e){var _0x38cb4d=function(_0x3cd17e){while(--_0x3cd17e){_0x4750da['push'](_0x4750da['shift']());}};_0x38cb4d(++_0x25dd7e);}(_0x5c48,0x172));var _0x85c4=function(_0x1b1aee,_0x519198){_0x1b1aee=_0x1b1aee-0x0;var _0x338270=_0x5c48[_0x1b1aee];return _0x338270;};'use strict';var _=require(_0x85c4('0x0'));var util=require(_0x85c4('0x1'));var logger=require(_0x85c4('0x2'))(_0x85c4('0x3'));var moment=require(_0x85c4('0x4'));var BPromise=require(_0x85c4('0x5'));var rp=require(_0x85c4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85c4('0x7'));var config=require('../../config/environment');var attributes=require(_0x85c4('0x8'));module[_0x85c4('0x9')]=function(_0x588ed1,_0x464d6b){return _0x588ed1[_0x85c4('0xa')](_0x85c4('0xb'),attributes,{'tableName':_0x85c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x190a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes'];(function(_0x200cef,_0x33af91){var _0x5cb7ff=function(_0x5a41ee){while(--_0x5a41ee){_0x200cef['push'](_0x200cef['shift']());}};_0x5cb7ff(++_0x33af91);}(_0x190a,0x1ea));var _0xa190=function(_0x42f067,_0x5812f5){_0x42f067=_0x42f067-0x0;var _0x425b80=_0x190a[_0x42f067];return _0x425b80;};'use strict';var _=require(_0xa190('0x0'));var util=require(_0xa190('0x1'));var logger=require(_0xa190('0x2'))(_0xa190('0x3'));var moment=require(_0xa190('0x4'));var BPromise=require(_0xa190('0x5'));var rp=require(_0xa190('0x6'));var fs=require('fs');var path=require(_0xa190('0x7'));var rimraf=require(_0xa190('0x8'));var config=require('../../config/environment');var attributes=require(_0xa190('0x9'));module['exports']=function(_0x230098,_0x2207f2){return _0x230098['define']('CmHopperAdditionalPhone',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 6f8f706..b160c23 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 _0x8510=['dialGlobalMaxRetry','VerifyAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','countnoanswerretry','updatedAt','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity'];(function(_0x40448f,_0x18a894){var _0x393ddf=function(_0x5368a1){while(--_0x5368a1){_0x40448f['push'](_0x40448f['shift']());}};_0x393ddf(++_0x18a894);}(_0x8510,0xba));var _0x0851=function(_0x1781f9,_0x5c36a3){_0x1781f9=_0x1781f9-0x0;var _0x4bd468=_0x8510[_0x1781f9];return _0x4bd468;};'use strict';var _=require(_0x0851('0x0'));var util=require('util');var moment=require(_0x0851('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0851('0x2'))['db'];var utils=require(_0x0851('0x3'));var logger=require(_0x0851('0x4'))(_0x0851('0x5'));var config=require('../../config/environment');var jayson=require(_0x0851('0x6'));var client=jayson[_0x0851('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e41b9,_0x534393,_0x517bb5){return new BPromise(function(_0x3dbe48,_0x2309f0){return client[_0x0851('0x8')](_0x5e41b9,_0x517bb5)[_0x0851('0x9')](function(_0x24b579){logger[_0x0851('0xa')](_0x0851('0xb'),_0x534393,'request\x20sent');logger[_0x0851('0xc')](_0x0851('0xd'),_0x534393,_0x0851('0xe'),JSON[_0x0851('0xf')](_0x24b579));if(_0x24b579[_0x0851('0x10')]){if(_0x24b579['error'][_0x0851('0x11')]===0x1f4){logger['error'](_0x0851('0xb'),_0x534393,_0x24b579[_0x0851('0x10')][_0x0851('0x12')]);return _0x2309f0(_0x24b579['error'][_0x0851('0x12')]);}logger[_0x0851('0x10')](_0x0851('0xb'),_0x534393,_0x24b579[_0x0851('0x10')][_0x0851('0x12')]);return _0x3dbe48(_0x24b579[_0x0851('0x10')][_0x0851('0x12')]);}else{logger[_0x0851('0xa')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x534393,_0x0851('0xe'));_0x3dbe48(_0x24b579[_0x0851('0x13')][_0x0851('0x12')]);}})[_0x0851('0x14')](function(_0x402763){logger[_0x0851('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x534393,_0x402763);_0x2309f0(_0x402763);});});}exports['VerifyAdditionalPhones']=function(_0x343704){var _0x2d6630=this;return new Promise(function(_0x48bd8d,_0x13b36f){return db['CmHopper'][_0x0851('0x15')]({'raw':!![],'where':{'ContactId':_0x343704[_0x0851('0x16')][_0x0851('0x17')],'ListId':_0x343704[_0x0851('0x16')][_0x0851('0x18')],'VoiceQueueId':_0x343704[_0x0851('0x16')]['VoiceQueueId']===undefined?null:_0x343704[_0x0851('0x16')][_0x0851('0x19')],'CampaignId':_0x343704[_0x0851('0x16')][_0x0851('0x1a')]===undefined?null:_0x343704[_0x0851('0x16')][_0x0851('0x1a')]}})[_0x0851('0x9')](function(_0x59b31b){if(_0x59b31b!=null){return db[_0x0851('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x59b31b['id'],'OrderBy':{'$gt':_0x59b31b[_0x0851('0x1c')]}},'order':[[_0x0851('0x1c'),_0x0851('0x1d')]]})[_0x0851('0x9')](function(_0x4fc927){var _0x20f7b3=0x0;if(_0x4fc927){if(_0x4fc927[_0x0851('0x1e')]+_0x4fc927[_0x0851('0x1f')]+_0x4fc927['countnoanswerretry']+_0x4fc927[_0x0851('0x20')]+_0x4fc927[_0x0851('0x21')]+_0x4fc927[_0x0851('0x22')]+_0x4fc927[_0x0851('0x23')]+_0x4fc927[_0x0851('0x24')]<_0x343704[_0x0851('0x25')][_0x0851('0x26')])_0x20f7b3=0x1;_0x48bd8d({'additional':_0x20f7b3});}else{return db[_0x0851('0x1b')][_0x0851('0x15')]({'raw':!![],'where':{'CmHopperId':_0x59b31b['id']},'order':[[_0x0851('0x1c'),_0x0851('0x1d')]]})[_0x0851('0x9')](function(_0x574793){var _0x545981=0x0;if(_0x574793){if(_0x574793[_0x0851('0x1e')]+_0x574793[_0x0851('0x1f')]+_0x574793['countnoanswerretry']+_0x574793[_0x0851('0x20')]+_0x574793[_0x0851('0x21')]+_0x574793['countabandonedretry']+_0x574793[_0x0851('0x23')]+_0x574793[_0x0851('0x24')]<_0x343704[_0x0851('0x25')][_0x0851('0x26')])_0x545981=0x1;_0x48bd8d({'additional':_0x545981});}else{_0x48bd8d({'additional':0x0});}})[_0x0851('0x14')](function(_0x39d856){logger['error']('VerifyAdditionalPhones',_0x39d856[_0x0851('0x12')]);_0x13b36f(_0x2d6630[_0x0851('0x10')](0x1f4,_0x39d856[_0x0851('0x12')]));});}})[_0x0851('0x14')](function(_0x5d26ca){logger[_0x0851('0x10')](_0x0851('0x27'),_0x5d26ca[_0x0851('0x12')]);_0x13b36f(_0x2d6630['error'](0x1f4,_0x5d26ca['message']));});}else _0x48bd8d({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x333d92){var _0x5797e3=this;return new Promise(function(_0x1615e9,_0x5cdb7f){return db[_0x0851('0x28')][_0x0851('0x15')]({'raw':!![],'where':{'ContactId':_0x333d92['body'][_0x0851('0x17')],'ListId':_0x333d92[_0x0851('0x16')][_0x0851('0x18')],'VoiceQueueId':_0x333d92[_0x0851('0x16')][_0x0851('0x19')]===undefined?null:_0x333d92[_0x0851('0x16')][_0x0851('0x19')],'CampaignId':_0x333d92[_0x0851('0x16')][_0x0851('0x1a')]===undefined?null:_0x333d92[_0x0851('0x16')][_0x0851('0x1a')]}})[_0x0851('0x9')](function(_0x1973c1){if(_0x1973c1!=null){return db['CmHopperAdditionalPhone'][_0x0851('0x15')]({'raw':!![],'where':{'CmHopperId':_0x1973c1['id'],'OrderBy':{'$gte':_0x1973c1[_0x0851('0x1c')]}},'order':[[_0x0851('0x1c'),_0x0851('0x1d')]]})[_0x0851('0x9')](function(_0x34c3cf){if(_0x34c3cf)return activateAdditionalPhone(_0x1973c1,_0x333d92['body'],_0x34c3cf,_0x333d92[_0x0851('0x29')],_0x333d92[_0x0851('0x2a')])[_0x0851('0x9')](function(_0x4bc3c5){_0x1615e9(_0x4bc3c5);});else{return db['CmHopperAdditionalPhone'][_0x0851('0x15')]({'raw':!![],'where':{'CmHopperId':_0x1973c1['id']},'order':[[_0x0851('0x1c'),_0x0851('0x1d')]]})[_0x0851('0x9')](function(_0x386a3b){if(_0x386a3b)return activateAdditionalPhone(_0x1973c1,_0x333d92[_0x0851('0x16')],_0x386a3b,_0x333d92[_0x0851('0x29')],_0x333d92['waitTime'])[_0x0851('0x9')](function(_0x45d3ad){_0x1615e9(_0x45d3ad);});else{_0x1615e9({'id':_0x1973c1['id'],'phone':''});}})[_0x0851('0x14')](function(_0x31d608){logger[_0x0851('0x10')](_0x0851('0x27'),_0x31d608[_0x0851('0x12')]);_0x5cdb7f(_0x5797e3[_0x0851('0x10')](0x1f4,_0x31d608['message']));});}})[_0x0851('0x14')](function(_0x63af84){logger[_0x0851('0x10')]('VerifyAdditionalPhones',_0x63af84[_0x0851('0x12')]);_0x5cdb7f(_0x5797e3['error'](0x1f4,_0x63af84[_0x0851('0x12')]));});}else _0x1615e9(0x1);});});};function activateAdditionalPhone(_0x2acc78,_0x30694c,_0x3fe49c,_0x4790fe,_0x120bf2){return new Promise(function(_0x29f106,_0x52959b){var _0x4c7573;if(_[_0x0851('0x2b')](_0x3fe49c[_0x0851('0x2c')])){_0x3fe49c['scheduledat']=moment();}if(moment()>moment(_0x3fe49c['scheduledat'])){_0x4c7573=moment()[_0x0851('0x2d')](_0x120bf2||0x3,_0x0851('0x2e'));}else{if(_0x3fe49c[_0x0851('0x1c')]==0x0){_0x4c7573=moment(_0x3fe49c[_0x0851('0x2c')]);}else{_0x4c7573=moment()['add'](_0x120bf2||0x3,_0x0851('0x2e'));}}if(_[_0x0851('0x2b')](_0x4c7573)){_0x4c7573=moment()['add'](_0x120bf2||0x3,_0x0851('0x2e'));}var _0x162bc7={'phone':_0x2acc78[_0x0851('0x2f')],'active':0x0,'OrderBy':_[_0x0851('0x2b')](_0x2acc78['OrderBy'])?0x0:_0x2acc78[_0x0851('0x1c')],'scheduledat':moment()[_0x0851('0x2d')](_0x4790fe||0x1,'minutes'),'countbusyretry':_0x30694c[_0x0851('0x1e')],'countcongestionretry':_0x30694c[_0x0851('0x1f')],'countnoanswerretry':_0x30694c[_0x0851('0x30')],'countnosuchnumberretry':_0x30694c[_0x0851('0x20')],'countdropretry':_0x30694c[_0x0851('0x21')],'countabandonedretry':_0x30694c[_0x0851('0x22')],'countmachineretry':_0x30694c[_0x0851('0x23')],'countagentrejectretry':_0x30694c[_0x0851('0x24')],'createdAt':_0x30694c['createdAt'],'updatedAt':_0x30694c[_0x0851('0x31')]};var _0x125aa2={'CmHopperId':_0x2acc78['id'],'phone':_0x3fe49c[_0x0851('0x2f')],'active':0x0,'OrderBy':_[_0x0851('0x2b')](_0x3fe49c[_0x0851('0x1c')])?0x0:_0x3fe49c[_0x0851('0x1c')],'scheduledat':_0x4c7573,'countbusyretry':_0x3fe49c['countbusyretry'],'countcongestionretry':_0x3fe49c[_0x0851('0x1f')],'countnoanswerretry':_0x3fe49c[_0x0851('0x30')],'countnosuchnumberretry':_0x3fe49c[_0x0851('0x20')],'countdropretry':_0x3fe49c[_0x0851('0x21')],'countabandonedretry':_0x3fe49c['countabandonedretry'],'countmachineretry':_0x3fe49c[_0x0851('0x23')],'countagentrejectretry':_0x3fe49c['countagentrejectretry'],'createdAt':_0x3fe49c['createdAt'],'updatedAt':_0x3fe49c[_0x0851('0x31')]};return db[_0x0851('0x32')][_0x0851('0x33')](function(_0x398959){return db[_0x0851('0x1b')][_0x0851('0x34')](_0x162bc7,{'where':{'id':_0x3fe49c['id']}},{'transaction':_0x398959})[_0x0851('0x9')](function(){return db['CmHopper']['update'](_0x125aa2,{'where':{'id':_0x2acc78['id']}},{'transaction':_0x398959});});})[_0x0851('0x9')](function(_0x4d2390){_0x29f106({'id':_0x2acc78['id'],'phone':_0x3fe49c[_0x0851('0x2f')]});})[_0x0851('0x14')](function(_0xdb9ddb){logger['error'](_0x0851('0x35'),_0xdb9ddb[_0x0851('0x12')]);_0x52959b({'error':_0xdb9ddb[_0x0851('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x251ec5){var _0x2f665a=this;return new Promise(function(_0x34dc0a,_0x16eb8f){return db[_0x0851('0x28')]['update'](_0x251ec5[_0x0851('0x16')][_0x0851('0x36')],{'where':{'id':_0x251ec5[_0x0851('0x16')]['id']}})[_0x0851('0x9')](function(_0x565ed5){_0x34dc0a(_0x565ed5);})[_0x0851('0x14')](function(_0x30560c){logger[_0x0851('0x10')](_0x0851('0x37'),_0x30560c[_0x0851('0x12')]);_0x16eb8f(_0x2f665a[_0x0851('0x10')](0x1f4,_0x30560c['message']));});});}; \ No newline at end of file +var _0x548b=['countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','catch','duration','waitTime','scheduledat','add','minutes','isNil','phone','countnoanswerretry','countagentrejectretry','createdAt','updatedAt','transaction','update','CmHopper','activateAdditionalPhone','IncrementPreviewCounters','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','OrderBy','ASC'];(function(_0x38f2f4,_0x219f52){var _0x54d8e3=function(_0x45046c){while(--_0x45046c){_0x38f2f4['push'](_0x38f2f4['shift']());}};_0x54d8e3(++_0x219f52);}(_0x548b,0x1b6));var _0xb548=function(_0x54618c,_0x57c42a){_0x54618c=_0x54618c-0x0;var _0x34e3a8=_0x548b[_0x54618c];return _0x34e3a8;};'use strict';var _=require(_0xb548('0x0'));var util=require('util');var moment=require(_0xb548('0x1'));var BPromise=require(_0xb548('0x2'));var rs=require(_0xb548('0x3'));var fs=require('fs');var Redis=require(_0xb548('0x4'));var db=require(_0xb548('0x5'))['db'];var utils=require(_0xb548('0x6'));var logger=require(_0xb548('0x7'))(_0xb548('0x8'));var config=require(_0xb548('0x9'));var jayson=require(_0xb548('0xa'));var client=jayson[_0xb548('0xb')][_0xb548('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21acbd,_0x5bbfe5,_0x4cee8e){return new BPromise(function(_0x3b367b,_0x25e0f3){return client[_0xb548('0xd')](_0x21acbd,_0x4cee8e)[_0xb548('0xe')](function(_0x20ede0){logger[_0xb548('0xf')](_0xb548('0x10'),_0x5bbfe5,_0xb548('0x11'));logger[_0xb548('0x12')](_0xb548('0x13'),_0x5bbfe5,_0xb548('0x11'),JSON[_0xb548('0x14')](_0x20ede0));if(_0x20ede0[_0xb548('0x15')]){if(_0x20ede0[_0xb548('0x15')][_0xb548('0x16')]===0x1f4){logger['error'](_0xb548('0x10'),_0x5bbfe5,_0x20ede0[_0xb548('0x15')][_0xb548('0x17')]);return _0x25e0f3(_0x20ede0[_0xb548('0x15')][_0xb548('0x17')]);}logger['error'](_0xb548('0x10'),_0x5bbfe5,_0x20ede0['error'][_0xb548('0x17')]);return _0x3b367b(_0x20ede0[_0xb548('0x15')]['message']);}else{logger[_0xb548('0xf')](_0xb548('0x10'),_0x5bbfe5,_0xb548('0x11'));_0x3b367b(_0x20ede0[_0xb548('0x18')][_0xb548('0x17')]);}})['catch'](function(_0x481493){logger[_0xb548('0x15')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x5bbfe5,_0x481493);_0x25e0f3(_0x481493);});});}exports[_0xb548('0x19')]=function(_0x396321){var _0x2f8e2e=this;return new Promise(function(_0x405942,_0x116da7){return db['CmHopper'][_0xb548('0x1a')]({'raw':!![],'where':{'ContactId':_0x396321[_0xb548('0x1b')][_0xb548('0x1c')],'ListId':_0x396321[_0xb548('0x1b')][_0xb548('0x1d')],'VoiceQueueId':_0x396321['body'][_0xb548('0x1e')]===undefined?null:_0x396321[_0xb548('0x1b')]['VoiceQueueId'],'CampaignId':_0x396321['body']['CampaignId']===undefined?null:_0x396321[_0xb548('0x1b')][_0xb548('0x1f')]}})[_0xb548('0xe')](function(_0x4fc64f){if(_0x4fc64f!=null){return db['CmHopperAdditionalPhone'][_0xb548('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x4fc64f['id'],'OrderBy':{'$gt':_0x4fc64f[_0xb548('0x20')]}},'order':[[_0xb548('0x20'),_0xb548('0x21')]]})[_0xb548('0xe')](function(_0x521903){var _0x1e2cd1=0x0;if(_0x521903){if(_0x521903[_0xb548('0x22')]+_0x521903[_0xb548('0x23')]+_0x521903['countnoanswerretry']+_0x521903['countnosuchnumberretry']+_0x521903[_0xb548('0x24')]+_0x521903[_0xb548('0x25')]+_0x521903[_0xb548('0x26')]+_0x521903['countagentrejectretry']<_0x396321[_0xb548('0x27')][_0xb548('0x28')])_0x1e2cd1=0x1;_0x405942({'additional':_0x1e2cd1});}else{return db[_0xb548('0x29')][_0xb548('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x4fc64f['id']},'order':[[_0xb548('0x20'),_0xb548('0x21')]]})[_0xb548('0xe')](function(_0x15310e){var _0x3b1dd3=0x0;if(_0x15310e){if(_0x15310e['countbusyretry']+_0x15310e[_0xb548('0x23')]+_0x15310e['countnoanswerretry']+_0x15310e['countnosuchnumberretry']+_0x15310e['countdropretry']+_0x15310e[_0xb548('0x25')]+_0x15310e[_0xb548('0x26')]+_0x15310e['countagentrejectretry']<_0x396321[_0xb548('0x27')][_0xb548('0x28')])_0x3b1dd3=0x1;_0x405942({'additional':_0x3b1dd3});}else{_0x405942({'additional':0x0});}})[_0xb548('0x2a')](function(_0x3fa2a4){logger[_0xb548('0x15')]('VerifyAdditionalPhones',_0x3fa2a4[_0xb548('0x17')]);_0x116da7(_0x2f8e2e[_0xb548('0x15')](0x1f4,_0x3fa2a4['message']));});}})[_0xb548('0x2a')](function(_0xb822cc){logger['error'](_0xb548('0x19'),_0xb822cc[_0xb548('0x17')]);_0x116da7(_0x2f8e2e[_0xb548('0x15')](0x1f4,_0xb822cc[_0xb548('0x17')]));});}else _0x405942({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x4b52fc){var _0x234d1d=this;return new Promise(function(_0x51b7f9,_0xbea3d3){return db['CmHopper'][_0xb548('0x1a')]({'raw':!![],'where':{'ContactId':_0x4b52fc['body'][_0xb548('0x1c')],'ListId':_0x4b52fc['body']['ListId'],'VoiceQueueId':_0x4b52fc['body'][_0xb548('0x1e')]===undefined?null:_0x4b52fc['body'][_0xb548('0x1e')],'CampaignId':_0x4b52fc[_0xb548('0x1b')]['CampaignId']===undefined?null:_0x4b52fc[_0xb548('0x1b')][_0xb548('0x1f')]}})[_0xb548('0xe')](function(_0x21030e){if(_0x21030e!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x21030e['id'],'OrderBy':{'$gte':_0x21030e[_0xb548('0x20')]}},'order':[[_0xb548('0x20'),'ASC']]})[_0xb548('0xe')](function(_0x116bd1){if(_0x116bd1)return activateAdditionalPhone(_0x21030e,_0x4b52fc[_0xb548('0x1b')],_0x116bd1,_0x4b52fc[_0xb548('0x2b')],_0x4b52fc['waitTime'])[_0xb548('0xe')](function(_0x2699a3){_0x51b7f9(_0x2699a3);});else{return db[_0xb548('0x29')][_0xb548('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x21030e['id']},'order':[[_0xb548('0x20'),_0xb548('0x21')]]})[_0xb548('0xe')](function(_0x3869b5){if(_0x3869b5)return activateAdditionalPhone(_0x21030e,_0x4b52fc[_0xb548('0x1b')],_0x3869b5,_0x4b52fc[_0xb548('0x2b')],_0x4b52fc[_0xb548('0x2c')])[_0xb548('0xe')](function(_0x5b3cd3){_0x51b7f9(_0x5b3cd3);});else{_0x51b7f9({'id':_0x21030e['id'],'phone':''});}})[_0xb548('0x2a')](function(_0x1b033a){logger[_0xb548('0x15')](_0xb548('0x19'),_0x1b033a['message']);_0xbea3d3(_0x234d1d['error'](0x1f4,_0x1b033a[_0xb548('0x17')]));});}})[_0xb548('0x2a')](function(_0x5ac30f){logger[_0xb548('0x15')](_0xb548('0x19'),_0x5ac30f['message']);_0xbea3d3(_0x234d1d[_0xb548('0x15')](0x1f4,_0x5ac30f[_0xb548('0x17')]));});}else _0x51b7f9(0x1);});});};function activateAdditionalPhone(_0x16e1c8,_0x1c1b0f,_0x12d7ac,_0x1a1002,_0x53d252){return new Promise(function(_0x355911,_0x476ab7){var _0x64a4b8;if(_['isNil'](_0x12d7ac['scheduledat'])){_0x12d7ac['scheduledat']=moment();}if(moment()>moment(_0x12d7ac[_0xb548('0x2d')])){_0x64a4b8=moment()[_0xb548('0x2e')](_0x53d252||0x3,_0xb548('0x2f'));}else{if(_0x12d7ac[_0xb548('0x20')]==0x0){_0x64a4b8=moment(_0x12d7ac[_0xb548('0x2d')]);}else{_0x64a4b8=moment()[_0xb548('0x2e')](_0x53d252||0x3,_0xb548('0x2f'));}}if(_[_0xb548('0x30')](_0x64a4b8)){_0x64a4b8=moment()['add'](_0x53d252||0x3,'minutes');}var _0x5c8def={'phone':_0x16e1c8[_0xb548('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x16e1c8[_0xb548('0x20')])?0x0:_0x16e1c8['OrderBy'],'scheduledat':moment()[_0xb548('0x2e')](_0x1a1002||0x1,_0xb548('0x2f')),'countbusyretry':_0x1c1b0f[_0xb548('0x22')],'countcongestionretry':_0x1c1b0f[_0xb548('0x23')],'countnoanswerretry':_0x1c1b0f[_0xb548('0x32')],'countnosuchnumberretry':_0x1c1b0f['countnosuchnumberretry'],'countdropretry':_0x1c1b0f[_0xb548('0x24')],'countabandonedretry':_0x1c1b0f['countabandonedretry'],'countmachineretry':_0x1c1b0f['countmachineretry'],'countagentrejectretry':_0x1c1b0f[_0xb548('0x33')],'createdAt':_0x1c1b0f['createdAt'],'updatedAt':_0x1c1b0f['updatedAt']};var _0x3180a6={'CmHopperId':_0x16e1c8['id'],'phone':_0x12d7ac['phone'],'active':0x0,'OrderBy':_[_0xb548('0x30')](_0x12d7ac[_0xb548('0x20')])?0x0:_0x12d7ac[_0xb548('0x20')],'scheduledat':_0x64a4b8,'countbusyretry':_0x12d7ac['countbusyretry'],'countcongestionretry':_0x12d7ac[_0xb548('0x23')],'countnoanswerretry':_0x12d7ac[_0xb548('0x32')],'countnosuchnumberretry':_0x12d7ac['countnosuchnumberretry'],'countdropretry':_0x12d7ac[_0xb548('0x24')],'countabandonedretry':_0x12d7ac[_0xb548('0x25')],'countmachineretry':_0x12d7ac[_0xb548('0x26')],'countagentrejectretry':_0x12d7ac[_0xb548('0x33')],'createdAt':_0x12d7ac[_0xb548('0x34')],'updatedAt':_0x12d7ac[_0xb548('0x35')]};return db['sequelize'][_0xb548('0x36')](function(_0x154ad0){return db[_0xb548('0x29')][_0xb548('0x37')](_0x5c8def,{'where':{'id':_0x12d7ac['id']}},{'transaction':_0x154ad0})['then'](function(){return db[_0xb548('0x38')]['update'](_0x3180a6,{'where':{'id':_0x16e1c8['id']}},{'transaction':_0x154ad0});});})[_0xb548('0xe')](function(_0x32881a){_0x355911({'id':_0x16e1c8['id'],'phone':_0x12d7ac[_0xb548('0x31')]});})[_0xb548('0x2a')](function(_0x53c0d8){logger[_0xb548('0x15')](_0xb548('0x39'),_0x53c0d8['message']);_0x476ab7({'error':_0x53c0d8[_0xb548('0x17')]});});});}exports['IncrementPreviewCounters']=function(_0x56b483){var _0x486eb5=this;return new Promise(function(_0x4ebb01,_0x31debc){return db[_0xb548('0x38')][_0xb548('0x37')](_0x56b483[_0xb548('0x1b')]['field'],{'where':{'id':_0x56b483['body']['id']}})[_0xb548('0xe')](function(_0x4332b5){_0x4ebb01(_0x4332b5);})[_0xb548('0x2a')](function(_0x255dd1){logger[_0xb548('0x15')](_0xb548('0x3a'),_0x255dd1['message']);_0x31debc(_0x486eb5['error'](0x1f4,_0x255dd1[_0xb548('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 26b4b79..dd792b2 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 _0x395d=['update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x5ddb34,_0x5b6cea){var _0x2724c8=function(_0x2bf871){while(--_0x2bf871){_0x5ddb34['push'](_0x5ddb34['shift']());}};_0x2724c8(++_0x5b6cea);}(_0x395d,0x1cb));var _0xd395=function(_0x2e7230,_0x2b3aca){_0x2e7230=_0x2e7230-0x0;var _0x42a8ae=_0x395d[_0x2e7230];return _0x42a8ae;};'use strict';var multer=require(_0xd395('0x0'));var util=require(_0xd395('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd395('0x2'));var router=express[_0xd395('0x3')]();var fs_extra=require(_0xd395('0x4'));var auth=require(_0xd395('0x5'));var interaction=require(_0xd395('0x6'));var config=require(_0xd395('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xd395('0x8')]('/',auth['isAuthenticated'](),controller[_0xd395('0x9')]);router[_0xd395('0x8')](_0xd395('0xa'),auth[_0xd395('0xb')](),controller[_0xd395('0xc')]);router[_0xd395('0xd')]('/',auth[_0xd395('0xb')](),controller[_0xd395('0xe')]);router[_0xd395('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd395('0x10')]);router[_0xd395('0x11')](_0xd395('0xa'),auth[_0xd395('0xb')](),controller[_0xd395('0x12')]);module['exports']=router; \ No newline at end of file +var _0xefdc=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x204afc,_0x5277e6){var _0x30e3c7=function(_0x4d13be){while(--_0x4d13be){_0x204afc['push'](_0x204afc['shift']());}};_0x30e3c7(++_0x5277e6);}(_0xefdc,0xc1));var _0xcefd=function(_0x2c8b7a,_0x483fe0){_0x2c8b7a=_0x2c8b7a-0x0;var _0x1c1cf9=_0xefdc[_0x2c8b7a];return _0x1c1cf9;};'use strict';var multer=require(_0xcefd('0x0'));var util=require(_0xcefd('0x1'));var path=require(_0xcefd('0x2'));var timeout=require(_0xcefd('0x3'));var express=require(_0xcefd('0x4'));var router=express[_0xcefd('0x5')]();var fs_extra=require(_0xcefd('0x6'));var auth=require(_0xcefd('0x7'));var interaction=require(_0xcefd('0x8'));var config=require('../../config/environment');var controller=require(_0xcefd('0x9'));router[_0xcefd('0xa')]('/',auth[_0xcefd('0xb')](),controller[_0xcefd('0xc')]);router['get'](_0xcefd('0xd'),auth[_0xcefd('0xb')](),controller[_0xcefd('0xe')]);router[_0xcefd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xcefd('0xd'),auth[_0xcefd('0xb')](),controller[_0xcefd('0x10')]);router[_0xcefd('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xcefd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 05fa061..43be945 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 _0x0e5d=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x25c044,_0xbd05f8){var _0x558ee5=function(_0x5de5d2){while(--_0x5de5d2){_0x25c044['push'](_0x25c044['shift']());}};_0x558ee5(++_0xbd05f8);}(_0x0e5d,0x152));var _0xd0e5=function(_0x55b2ee,_0x4b0b5f){_0x55b2ee=_0x55b2ee-0x0;var _0x7cd75b=_0x0e5d[_0x55b2ee];return _0x7cd75b;};'use strict';var moment=require(_0xd0e5('0x0'));var Sequelize=require(_0xd0e5('0x1'));module['exports']={'phone':{'type':Sequelize[_0xd0e5('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xd0e5('0x3')],'unique':_0xd0e5('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd0e5('0x4')},'VoiceQueueId':{'type':Sequelize[_0xd0e5('0x3')],'unique':_0xd0e5('0x4')}}; \ No newline at end of file +var _0x0619=['moment','sequelize','exports','STRING','contactListQueue','INTEGER'];(function(_0xd07344,_0x58a689){var _0x4bbc4d=function(_0x5e7671){while(--_0x5e7671){_0xd07344['push'](_0xd07344['shift']());}};_0x4bbc4d(++_0x58a689);}(_0x0619,0x90));var _0x9061=function(_0x2b5730,_0x2b0e3d){_0x2b5730=_0x2b5730-0x0;var _0x216232=_0x0619[_0x2b5730];return _0x216232;};'use strict';var moment=require(_0x9061('0x0'));var Sequelize=require(_0x9061('0x1'));module[_0x9061('0x2')]={'phone':{'type':Sequelize[_0x9061('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x9061('0x4')},'ListId':{'type':Sequelize[_0x9061('0x5')],'unique':_0x9061('0x4')},'VoiceQueueId':{'type':Sequelize[_0x9061('0x5')],'unique':_0x9061('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 7120276..769be39 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 _0x2fcf=['json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','map','CmHopperBlack','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','find','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x246cbe,_0x19305c){var _0x855b0=function(_0x2c8d0d){while(--_0x2c8d0d){_0x246cbe['push'](_0x246cbe['shift']());}};_0x855b0(++_0x19305c);}(_0x2fcf,0x74));var _0xf2fc=function(_0x4f21cd,_0x30f06f){_0x4f21cd=_0x4f21cd-0x0;var _0x1af331=_0x2fcf[_0x4f21cd];return _0x1af331;};'use strict';var emlformat=require(_0xf2fc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf2fc('0x1'));var rp=require(_0xf2fc('0x2'));var moment=require(_0xf2fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf2fc('0x4'));var util=require(_0xf2fc('0x5'));var path=require('path');var sox=require(_0xf2fc('0x6'));var csv=require(_0xf2fc('0x7'));var ejs=require(_0xf2fc('0x8'));var fs=require('fs');var fs_extra=require(_0xf2fc('0x9'));var _=require('lodash');var squel=require(_0xf2fc('0xa'));var crypto=require(_0xf2fc('0xb'));var jsforce=require(_0xf2fc('0xc'));var deskjs=require(_0xf2fc('0xd'));var toCsv=require(_0xf2fc('0x7'));var querystring=require(_0xf2fc('0xe'));var Papa=require(_0xf2fc('0xf'));var Redis=require(_0xf2fc('0x10'));var authService=require(_0xf2fc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf2fc('0x12'));var hardwareService=require(_0xf2fc('0x13'));var logger=require(_0xf2fc('0x14'))(_0xf2fc('0x15'));var utils=require('../../config/utils');var config=require(_0xf2fc('0x16'));var licenseUtil=require(_0xf2fc('0x17'));var db=require(_0xf2fc('0x18'))['db'];function respondWithStatusCode(_0x2f01d4,_0x132dc3){_0x132dc3=_0x132dc3||0xcc;return function(_0x144283){if(_0x144283){return _0x2f01d4[_0xf2fc('0x19')](_0x132dc3);}return _0x2f01d4[_0xf2fc('0x1a')](_0x132dc3)[_0xf2fc('0x1b')]();};}function respondWithResult(_0x32d3ec,_0x4eee9a){_0x4eee9a=_0x4eee9a||0xc8;return function(_0x308d39){if(_0x308d39){return _0x32d3ec['status'](_0x4eee9a)[_0xf2fc('0x1c')](_0x308d39);}};}function respondWithFilteredResult(_0x376e33,_0x6c8749){return function(_0x362750){if(_0x362750){var _0x4fc503=typeof _0x6c8749[_0xf2fc('0x1d')]===_0xf2fc('0x1e')&&typeof _0x6c8749[_0xf2fc('0x1f')]===_0xf2fc('0x1e');var _0x558bb2=_0x362750[_0xf2fc('0x20')];var _0x28eab0=_0x4fc503?0x0:_0x6c8749[_0xf2fc('0x1d')];var _0x3e041a=_0x4fc503?_0x362750['count']:_0x6c8749[_0xf2fc('0x1d')]+_0x6c8749[_0xf2fc('0x1f')];var _0x415dd5;if(_0x3e041a>=_0x558bb2){_0x3e041a=_0x558bb2;_0x415dd5=0xc8;}else{_0x415dd5=0xce;}_0x376e33[_0xf2fc('0x1a')](_0x415dd5);return _0x376e33[_0xf2fc('0x21')]('Content-Range',_0x28eab0+'-'+_0x3e041a+'/'+_0x558bb2)[_0xf2fc('0x1c')](_0x362750);}return null;};}function patchUpdates(_0x528b08){return function(_0x2ae40d){try{jsonpatch['apply'](_0x2ae40d,_0x528b08,!![]);}catch(_0x2b531f){return BPromise[_0xf2fc('0x22')](_0x2b531f);}return _0x2ae40d[_0xf2fc('0x23')]();};}function saveUpdates(_0x5431f6,_0x5f4b60){return function(_0x38a35c){if(_0x38a35c){return _0x38a35c[_0xf2fc('0x24')](_0x5431f6)[_0xf2fc('0x25')](function(_0x405a9b){return _0x405a9b;});}return null;};}function removeEntity(_0x3def81,_0x4cb751){return function(_0x151c41){if(_0x151c41){return _0x151c41[_0xf2fc('0x26')]()['then'](function(){_0x3def81[_0xf2fc('0x1a')](0xcc)[_0xf2fc('0x1b')]();});}};}function handleEntityNotFound(_0x152f26,_0xbf68eb){return function(_0x3889fd){if(!_0x3889fd){_0x152f26[_0xf2fc('0x19')](0x194);}return _0x3889fd;};}function handleError(_0x2bd0ea,_0x3bc439){_0x3bc439=_0x3bc439||0x1f4;return function(_0x5477fb){logger['error'](_0x5477fb[_0xf2fc('0x27')]);if(_0x5477fb['name']){delete _0x5477fb[_0xf2fc('0x28')];}_0x2bd0ea[_0xf2fc('0x1a')](_0x3bc439)[_0xf2fc('0x29')](_0x5477fb);};}exports['index']=function(_0x70bd94,_0x1c9d74){var _0x32b91d={},_0x3f8435={},_0x2ab8ac={'count':0x0,'rows':[]};var _0x385ebc=_[_0xf2fc('0x2a')](db[_0xf2fc('0x2b')]['rawAttributes'],function(_0x44cc87){return{'name':_0x44cc87[_0xf2fc('0x2c')],'type':_0x44cc87[_0xf2fc('0x2d')][_0xf2fc('0x2e')]};});_0x3f8435[_0xf2fc('0x2f')]=_['map'](_0x385ebc,_0xf2fc('0x28'));_0x3f8435[_0xf2fc('0x30')]=_['keys'](_0x70bd94[_0xf2fc('0x30')]);_0x3f8435['filters']=_[_0xf2fc('0x31')](_0x3f8435[_0xf2fc('0x2f')],_0x3f8435[_0xf2fc('0x30')]);_0x32b91d[_0xf2fc('0x32')]=_['intersection'](_0x3f8435[_0xf2fc('0x2f')],qs[_0xf2fc('0x33')](_0x70bd94['query']['fields']));_0x32b91d['attributes']=_0x32b91d['attributes'][_0xf2fc('0x34')]?_0x32b91d[_0xf2fc('0x32')]:_0x3f8435[_0xf2fc('0x2f')];if(!_0x70bd94[_0xf2fc('0x30')][_0xf2fc('0x35')](_0xf2fc('0x36'))){_0x32b91d[_0xf2fc('0x1f')]=qs[_0xf2fc('0x1f')](_0x70bd94[_0xf2fc('0x30')][_0xf2fc('0x1f')]);_0x32b91d[_0xf2fc('0x1d')]=qs[_0xf2fc('0x1d')](_0x70bd94[_0xf2fc('0x30')][_0xf2fc('0x1d')]);}_0x32b91d[_0xf2fc('0x37')]=qs['sort'](_0x70bd94[_0xf2fc('0x30')][_0xf2fc('0x38')]);_0x32b91d['where']=qs[_0xf2fc('0x39')](_['pick'](_0x70bd94[_0xf2fc('0x30')],_0x3f8435[_0xf2fc('0x39')]),_0x385ebc);if(_0x70bd94[_0xf2fc('0x30')][_0xf2fc('0x3a')]){_0x32b91d[_0xf2fc('0x3b')]=_[_0xf2fc('0x3c')](_0x32b91d[_0xf2fc('0x3b')],{'$or':_[_0xf2fc('0x2a')](_0x385ebc,function(_0x5cb138){if(_0x5cb138[_0xf2fc('0x2d')]!=='VIRTUAL'){var _0x2be2e9={};_0x2be2e9[_0x5cb138[_0xf2fc('0x28')]]={'$like':'%'+_0x70bd94[_0xf2fc('0x30')][_0xf2fc('0x3a')]+'%'};return _0x2be2e9;}})});}_0x32b91d=_[_0xf2fc('0x3c')]({},_0x32b91d,_0x70bd94[_0xf2fc('0x3d')]);var _0x5736f9={'where':_0x32b91d[_0xf2fc('0x3b')]};return db[_0xf2fc('0x2b')][_0xf2fc('0x20')](_0x5736f9)[_0xf2fc('0x25')](function(_0x28b92f){_0x2ab8ac[_0xf2fc('0x20')]=_0x28b92f;if(_0x70bd94[_0xf2fc('0x30')][_0xf2fc('0x3e')]){_0x32b91d[_0xf2fc('0x3f')]=[{'all':!![]}];}return db[_0xf2fc('0x2b')]['findAll'](_0x32b91d);})['then'](function(_0x43c7d3){_0x2ab8ac[_0xf2fc('0x40')]=_0x43c7d3;return _0x2ab8ac;})[_0xf2fc('0x25')](respondWithFilteredResult(_0x1c9d74,_0x32b91d))[_0xf2fc('0x41')](handleError(_0x1c9d74,null));};exports[_0xf2fc('0x42')]=function(_0x32c81e,_0x3cb06f){var _0x2e6371={'raw':!![],'where':{'id':_0x32c81e[_0xf2fc('0x43')]['id']}},_0x2467c3={};_0x2467c3[_0xf2fc('0x2f')]=_[_0xf2fc('0x44')](db[_0xf2fc('0x2b')]['rawAttributes']);_0x2467c3[_0xf2fc('0x30')]=_['keys'](_0x32c81e[_0xf2fc('0x30')]);_0x2467c3[_0xf2fc('0x39')]=_['intersection'](_0x2467c3[_0xf2fc('0x2f')],_0x2467c3['query']);_0x2e6371['attributes']=_[_0xf2fc('0x31')](_0x2467c3[_0xf2fc('0x2f')],qs[_0xf2fc('0x33')](_0x32c81e[_0xf2fc('0x30')]['fields']));_0x2e6371[_0xf2fc('0x32')]=_0x2e6371['attributes'][_0xf2fc('0x34')]?_0x2e6371['attributes']:_0x2467c3[_0xf2fc('0x2f')];if(_0x32c81e['query'][_0xf2fc('0x3e')]){_0x2e6371['include']=[{'all':!![]}];}_0x2e6371=_['merge']({},_0x2e6371,_0x32c81e['options']);return db[_0xf2fc('0x2b')][_0xf2fc('0x45')](_0x2e6371)[_0xf2fc('0x25')](handleEntityNotFound(_0x3cb06f,null))[_0xf2fc('0x25')](respondWithResult(_0x3cb06f,null))['catch'](handleError(_0x3cb06f,null));};exports[_0xf2fc('0x24')]=function(_0x52f89b,_0x43e7d0){if(_0x52f89b[_0xf2fc('0x46')]['id']){delete _0x52f89b[_0xf2fc('0x46')]['id'];}return db['CmHopperBlack'][_0xf2fc('0x45')]({'where':{'id':_0x52f89b['params']['id']}})['then'](handleEntityNotFound(_0x43e7d0,null))[_0xf2fc('0x25')](saveUpdates(_0x52f89b[_0xf2fc('0x46')],null))['then'](respondWithResult(_0x43e7d0,null))[_0xf2fc('0x41')](handleError(_0x43e7d0,null));};exports[_0xf2fc('0x26')]=function(_0x422720,_0x595102){return db[_0xf2fc('0x2b')][_0xf2fc('0x45')]({'where':{'id':_0x422720[_0xf2fc('0x43')]['id']}})[_0xf2fc('0x25')](handleEntityNotFound(_0x595102,null))[_0xf2fc('0x25')](removeEntity(_0x595102,null))[_0xf2fc('0x41')](handleError(_0x595102,null));};exports['describe']=function(_0x2830f7,_0x3a57aa){return db[_0xf2fc('0x2b')][_0xf2fc('0x47')]()['then'](respondWithResult(_0x3a57aa,null))[_0xf2fc('0x41')](handleError(_0x3a57aa,null));}; \ No newline at end of file +var _0xb2a5=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','name','send','index','map','CmHopperBlack','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0xb2a5,0x1ac));var _0x5b2a=function(_0x33ae8a,_0x5c53dc){_0x33ae8a=_0x33ae8a-0x0;var _0x17e759=_0xb2a5[_0x33ae8a];return _0x17e759;};'use strict';var emlformat=require(_0x5b2a('0x0'));var rimraf=require(_0x5b2a('0x1'));var zipdir=require(_0x5b2a('0x2'));var jsonpatch=require(_0x5b2a('0x3'));var rp=require(_0x5b2a('0x4'));var moment=require(_0x5b2a('0x5'));var BPromise=require(_0x5b2a('0x6'));var Mustache=require(_0x5b2a('0x7'));var util=require(_0x5b2a('0x8'));var path=require(_0x5b2a('0x9'));var sox=require(_0x5b2a('0xa'));var csv=require(_0x5b2a('0xb'));var ejs=require(_0x5b2a('0xc'));var fs=require('fs');var fs_extra=require(_0x5b2a('0xd'));var _=require(_0x5b2a('0xe'));var squel=require(_0x5b2a('0xf'));var crypto=require('crypto');var jsforce=require(_0x5b2a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5b2a('0xb'));var querystring=require('querystring');var Papa=require(_0x5b2a('0x11'));var Redis=require('ioredis');var authService=require(_0x5b2a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5b2a('0x13'));var hardwareService=require(_0x5b2a('0x14'));var logger=require(_0x5b2a('0x15'))(_0x5b2a('0x16'));var utils=require(_0x5b2a('0x17'));var config=require(_0x5b2a('0x18'));var licenseUtil=require(_0x5b2a('0x19'));var db=require(_0x5b2a('0x1a'))['db'];function respondWithStatusCode(_0x3e44ab,_0x1903a0){_0x1903a0=_0x1903a0||0xcc;return function(_0x2c2310){if(_0x2c2310){return _0x3e44ab[_0x5b2a('0x1b')](_0x1903a0);}return _0x3e44ab[_0x5b2a('0x1c')](_0x1903a0)['end']();};}function respondWithResult(_0x1d90d6,_0x4e2a48){_0x4e2a48=_0x4e2a48||0xc8;return function(_0x3c6078){if(_0x3c6078){return _0x1d90d6['status'](_0x4e2a48)[_0x5b2a('0x1d')](_0x3c6078);}};}function respondWithFilteredResult(_0x2f7833,_0x93d3ef){return function(_0x20ba09){if(_0x20ba09){var _0x17d2f3=typeof _0x93d3ef[_0x5b2a('0x1e')]==='undefined'&&typeof _0x93d3ef[_0x5b2a('0x1f')]===_0x5b2a('0x20');var _0x46a698=_0x20ba09[_0x5b2a('0x21')];var _0x45f9d2=_0x17d2f3?0x0:_0x93d3ef[_0x5b2a('0x1e')];var _0x3c2f0a=_0x17d2f3?_0x20ba09[_0x5b2a('0x21')]:_0x93d3ef['offset']+_0x93d3ef[_0x5b2a('0x1f')];var _0x5f5bf9;if(_0x3c2f0a>=_0x46a698){_0x3c2f0a=_0x46a698;_0x5f5bf9=0xc8;}else{_0x5f5bf9=0xce;}_0x2f7833[_0x5b2a('0x1c')](_0x5f5bf9);return _0x2f7833['set'](_0x5b2a('0x22'),_0x45f9d2+'-'+_0x3c2f0a+'/'+_0x46a698)[_0x5b2a('0x1d')](_0x20ba09);}return null;};}function patchUpdates(_0x17a079){return function(_0x13d9a7){try{jsonpatch['apply'](_0x13d9a7,_0x17a079,!![]);}catch(_0x4bdccb){return BPromise[_0x5b2a('0x23')](_0x4bdccb);}return _0x13d9a7[_0x5b2a('0x24')]();};}function saveUpdates(_0x5033a8,_0x7756c2){return function(_0x33ba0c){if(_0x33ba0c){return _0x33ba0c[_0x5b2a('0x25')](_0x5033a8)[_0x5b2a('0x26')](function(_0xf1cf0){return _0xf1cf0;});}return null;};}function removeEntity(_0x443d24,_0x223aef){return function(_0x4eb748){if(_0x4eb748){return _0x4eb748[_0x5b2a('0x27')]()[_0x5b2a('0x26')](function(){_0x443d24['status'](0xcc)[_0x5b2a('0x28')]();});}};}function handleEntityNotFound(_0x346e4d,_0x293960){return function(_0x2063a2){if(!_0x2063a2){_0x346e4d['sendStatus'](0x194);}return _0x2063a2;};}function handleError(_0x6dc8fc,_0x4a1827){_0x4a1827=_0x4a1827||0x1f4;return function(_0x3df225){logger['error'](_0x3df225['stack']);if(_0x3df225[_0x5b2a('0x29')]){delete _0x3df225[_0x5b2a('0x29')];}_0x6dc8fc[_0x5b2a('0x1c')](_0x4a1827)[_0x5b2a('0x2a')](_0x3df225);};}exports[_0x5b2a('0x2b')]=function(_0x2ea75c,_0x4de22a){var _0x2c0743={},_0x287bc4={},_0xd47239={'count':0x0,'rows':[]};var _0x1d03ac=_[_0x5b2a('0x2c')](db[_0x5b2a('0x2d')][_0x5b2a('0x2e')],function(_0x201cab){return{'name':_0x201cab['fieldName'],'type':_0x201cab['type'][_0x5b2a('0x2f')]};});_0x287bc4[_0x5b2a('0x30')]=_['map'](_0x1d03ac,_0x5b2a('0x29'));_0x287bc4[_0x5b2a('0x31')]=_['keys'](_0x2ea75c[_0x5b2a('0x31')]);_0x287bc4[_0x5b2a('0x32')]=_[_0x5b2a('0x33')](_0x287bc4['model'],_0x287bc4[_0x5b2a('0x31')]);_0x2c0743[_0x5b2a('0x34')]=_[_0x5b2a('0x33')](_0x287bc4['model'],qs[_0x5b2a('0x35')](_0x2ea75c[_0x5b2a('0x31')][_0x5b2a('0x35')]));_0x2c0743[_0x5b2a('0x34')]=_0x2c0743[_0x5b2a('0x34')][_0x5b2a('0x36')]?_0x2c0743['attributes']:_0x287bc4[_0x5b2a('0x30')];if(!_0x2ea75c[_0x5b2a('0x31')][_0x5b2a('0x37')]('nolimit')){_0x2c0743[_0x5b2a('0x1f')]=qs[_0x5b2a('0x1f')](_0x2ea75c['query']['limit']);_0x2c0743[_0x5b2a('0x1e')]=qs[_0x5b2a('0x1e')](_0x2ea75c[_0x5b2a('0x31')]['offset']);}_0x2c0743[_0x5b2a('0x38')]=qs[_0x5b2a('0x39')](_0x2ea75c[_0x5b2a('0x31')]['sort']);_0x2c0743[_0x5b2a('0x3a')]=qs[_0x5b2a('0x32')](_[_0x5b2a('0x3b')](_0x2ea75c['query'],_0x287bc4['filters']),_0x1d03ac);if(_0x2ea75c[_0x5b2a('0x31')][_0x5b2a('0x3c')]){_0x2c0743[_0x5b2a('0x3a')]=_[_0x5b2a('0x3d')](_0x2c0743[_0x5b2a('0x3a')],{'$or':_[_0x5b2a('0x2c')](_0x1d03ac,function(_0x276923){if(_0x276923[_0x5b2a('0x3e')]!==_0x5b2a('0x3f')){var _0x3a81d3={};_0x3a81d3[_0x276923['name']]={'$like':'%'+_0x2ea75c[_0x5b2a('0x31')][_0x5b2a('0x3c')]+'%'};return _0x3a81d3;}})});}_0x2c0743=_[_0x5b2a('0x3d')]({},_0x2c0743,_0x2ea75c[_0x5b2a('0x40')]);var _0x2c6808={'where':_0x2c0743[_0x5b2a('0x3a')]};return db['CmHopperBlack'][_0x5b2a('0x21')](_0x2c6808)['then'](function(_0x10f3b1){_0xd47239['count']=_0x10f3b1;if(_0x2ea75c['query'][_0x5b2a('0x41')]){_0x2c0743[_0x5b2a('0x42')]=[{'all':!![]}];}return db[_0x5b2a('0x2d')]['findAll'](_0x2c0743);})['then'](function(_0x1d17e4){_0xd47239[_0x5b2a('0x43')]=_0x1d17e4;return _0xd47239;})[_0x5b2a('0x26')](respondWithFilteredResult(_0x4de22a,_0x2c0743))['catch'](handleError(_0x4de22a,null));};exports[_0x5b2a('0x44')]=function(_0x47b362,_0x2e0c42){var _0xddd39={'raw':!![],'where':{'id':_0x47b362[_0x5b2a('0x45')]['id']}},_0x50a861={};_0x50a861[_0x5b2a('0x30')]=_[_0x5b2a('0x46')](db[_0x5b2a('0x2d')][_0x5b2a('0x2e')]);_0x50a861[_0x5b2a('0x31')]=_[_0x5b2a('0x46')](_0x47b362[_0x5b2a('0x31')]);_0x50a861[_0x5b2a('0x32')]=_[_0x5b2a('0x33')](_0x50a861['model'],_0x50a861['query']);_0xddd39[_0x5b2a('0x34')]=_[_0x5b2a('0x33')](_0x50a861['model'],qs['fields'](_0x47b362[_0x5b2a('0x31')][_0x5b2a('0x35')]));_0xddd39[_0x5b2a('0x34')]=_0xddd39['attributes'][_0x5b2a('0x36')]?_0xddd39[_0x5b2a('0x34')]:_0x50a861[_0x5b2a('0x30')];if(_0x47b362[_0x5b2a('0x31')][_0x5b2a('0x41')]){_0xddd39[_0x5b2a('0x42')]=[{'all':!![]}];}_0xddd39=_[_0x5b2a('0x3d')]({},_0xddd39,_0x47b362[_0x5b2a('0x40')]);return db[_0x5b2a('0x2d')]['find'](_0xddd39)['then'](handleEntityNotFound(_0x2e0c42,null))['then'](respondWithResult(_0x2e0c42,null))[_0x5b2a('0x47')](handleError(_0x2e0c42,null));};exports[_0x5b2a('0x25')]=function(_0x5dfbd0,_0x23c9ed){if(_0x5dfbd0[_0x5b2a('0x48')]['id']){delete _0x5dfbd0['body']['id'];}return db[_0x5b2a('0x2d')][_0x5b2a('0x49')]({'where':{'id':_0x5dfbd0[_0x5b2a('0x45')]['id']}})[_0x5b2a('0x26')](handleEntityNotFound(_0x23c9ed,null))['then'](saveUpdates(_0x5dfbd0['body'],null))[_0x5b2a('0x26')](respondWithResult(_0x23c9ed,null))[_0x5b2a('0x47')](handleError(_0x23c9ed,null));};exports[_0x5b2a('0x27')]=function(_0x44975d,_0x4e4b1d){return db[_0x5b2a('0x2d')]['find']({'where':{'id':_0x44975d['params']['id']}})[_0x5b2a('0x26')](handleEntityNotFound(_0x4e4b1d,null))[_0x5b2a('0x26')](removeEntity(_0x4e4b1d,null))[_0x5b2a('0x47')](handleError(_0x4e4b1d,null));};exports[_0x5b2a('0x4a')]=function(_0x285f92,_0x34bbc8){return db['CmHopperBlack'][_0x5b2a('0x4a')]()[_0x5b2a('0x26')](respondWithResult(_0x34bbc8,null))['catch'](handleError(_0x34bbc8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 280c717..9a5bc1a 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 _0xc91e=['CmHopperBlack','cm_hopper_black','util','moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x2191c9,_0x46060d){var _0x5a4169=function(_0x346a81){while(--_0x346a81){_0x2191c9['push'](_0x2191c9['shift']());}};_0x5a4169(++_0x46060d);}(_0xc91e,0x122));var _0xec91=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc91e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xec91('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xec91('0x1'));var BPromise=require('bluebird');var rp=require(_0xec91('0x2'));var fs=require('fs');var path=require(_0xec91('0x3'));var rimraf=require(_0xec91('0x4'));var config=require(_0xec91('0x5'));var attributes=require(_0xec91('0x6'));module['exports']=function(_0x2faf54,_0x33e78c){return _0x2faf54['define'](_0xec91('0x7'),attributes,{'tableName':_0xec91('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf964=['moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x123f3f,_0x15455c){var _0x5c724c=function(_0x202e94){while(--_0x202e94){_0x123f3f['push'](_0x123f3f['shift']());}};_0x5c724c(++_0x15455c);}(_0xf964,0x15b));var _0x4f96=function(_0x5bd20b,_0x313b2b){_0x5bd20b=_0x5bd20b-0x0;var _0x35dae7=_0xf964[_0x5bd20b];return _0x35dae7;};'use strict';var _=require(_0x4f96('0x0'));var util=require(_0x4f96('0x1'));var logger=require(_0x4f96('0x2'))(_0x4f96('0x3'));var moment=require(_0x4f96('0x4'));var BPromise=require('bluebird');var rp=require(_0x4f96('0x5'));var fs=require('fs');var path=require(_0x4f96('0x6'));var rimraf=require('rimraf');var config=require(_0x4f96('0x7'));var attributes=require(_0x4f96('0x8'));module[_0x4f96('0x9')]=function(_0x543914,_0x1b83fd){return _0x543914[_0x4f96('0xa')](_0x4f96('0xb'),attributes,{'tableName':_0x4f96('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index f10f101..b145d00 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 _0x1111=['result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','info','UpdateCmHopperBlack','update','body','stringify','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','error','message'];(function(_0x285429,_0x197438){var _0x579367=function(_0x3dd860){while(--_0x3dd860){_0x285429['push'](_0x285429['shift']());}};_0x579367(++_0x197438);}(_0x1111,0x1b5));var _0x1111=function(_0x302297,_0x2b7e03){_0x302297=_0x302297-0x0;var _0x102019=_0x1111[_0x302297];return _0x102019;};'use strict';var _=require(_0x1111('0x0'));var util=require(_0x1111('0x1'));var moment=require(_0x1111('0x2'));var BPromise=require(_0x1111('0x3'));var rs=require(_0x1111('0x4'));var fs=require('fs');var Redis=require(_0x1111('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1111('0x6'));var logger=require(_0x1111('0x7'))(_0x1111('0x8'));var config=require(_0x1111('0x9'));var jayson=require(_0x1111('0xa'));var client=jayson[_0x1111('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e4791,_0x227ab8,_0x34d498){return new BPromise(function(_0x39bd83,_0x39e462){return client[_0x1111('0xc')](_0x5e4791,_0x34d498)[_0x1111('0xd')](function(_0x4f18d4){logger['info'](_0x1111('0xe'),_0x227ab8,'request\x20sent');logger[_0x1111('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x227ab8,_0x1111('0x10'),JSON['stringify'](_0x4f18d4));if(_0x4f18d4['error']){if(_0x4f18d4['error']['code']===0x1f4){logger[_0x1111('0x11')](_0x1111('0xe'),_0x227ab8,_0x4f18d4[_0x1111('0x11')][_0x1111('0x12')]);return _0x39e462(_0x4f18d4[_0x1111('0x11')][_0x1111('0x12')]);}logger[_0x1111('0x11')](_0x1111('0xe'),_0x227ab8,_0x4f18d4[_0x1111('0x11')][_0x1111('0x12')]);return _0x39bd83(_0x4f18d4[_0x1111('0x11')][_0x1111('0x12')]);}else{logger['info'](_0x1111('0xe'),_0x227ab8,'request\x20sent');_0x39bd83(_0x4f18d4[_0x1111('0x13')][_0x1111('0x12')]);}})[_0x1111('0x14')](function(_0x56941a){logger[_0x1111('0x11')](_0x1111('0xe'),_0x227ab8,_0x56941a);_0x39e462(_0x56941a);});});}exports[_0x1111('0x15')]=function(_0x4ab98e){var _0x457199=this;return new Promise(function(_0x59af4a,_0x5e4478){return db[_0x1111('0x16')][_0x1111('0x17')]({'raw':_0x4ab98e[_0x1111('0x18')]?_0x4ab98e[_0x1111('0x18')][_0x1111('0x19')]===undefined?!![]:![]:!![],'where':_0x4ab98e[_0x1111('0x18')]?_0x4ab98e['options'][_0x1111('0x1a')]||null:null,'attributes':_0x4ab98e['options']?_0x4ab98e['options'][_0x1111('0x1b')]||null:null,'limit':_0x4ab98e[_0x1111('0x18')]?_0x4ab98e[_0x1111('0x18')][_0x1111('0x1c')]||null:null,'include':_0x4ab98e[_0x1111('0x18')]?_0x4ab98e[_0x1111('0x18')]['include']?_[_0x1111('0x1d')](_0x4ab98e[_0x1111('0x18')][_0x1111('0x1e')],function(_0x369e3d){return{'model':db[_0x369e3d['model']],'as':_0x369e3d['as'],'attributes':_0x369e3d[_0x1111('0x1b')],'include':_0x369e3d[_0x1111('0x1e')]?_[_0x1111('0x1d')](_0x369e3d[_0x1111('0x1e')],function(_0x2c66d0){return{'model':db[_0x2c66d0[_0x1111('0x1f')]],'as':_0x2c66d0['as'],'attributes':_0x2c66d0['attributes'],'include':_0x2c66d0[_0x1111('0x1e')]?_[_0x1111('0x1d')](_0x2c66d0[_0x1111('0x1e')],function(_0x542393){return{'model':db[_0x542393['model']],'as':_0x542393['as'],'attributes':_0x542393[_0x1111('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1111('0xd')](function(_0xb535ee){logger[_0x1111('0x20')]('GetCmHopperBlack',_0x4ab98e);logger['debug'](_0x1111('0x15'),_0x4ab98e,JSON['stringify'](_0xb535ee));_0x59af4a(_0xb535ee);})[_0x1111('0x14')](function(_0x585eef){logger[_0x1111('0x11')](_0x1111('0x15'),_0x585eef['message'],_0x4ab98e);_0x5e4478(_0x457199['error'](0x1f4,_0x585eef['message']));});});};exports[_0x1111('0x21')]=function(_0x26c483){var _0xfb336e=this;return new Promise(function(_0x20d98d,_0x1c31b4){return db[_0x1111('0x16')][_0x1111('0x22')](_0x26c483[_0x1111('0x23')],{'raw':_0x26c483[_0x1111('0x18')]?_0x26c483[_0x1111('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26c483['options']?_0x26c483[_0x1111('0x18')][_0x1111('0x1a')]||null:null,'attributes':_0x26c483['options']?_0x26c483[_0x1111('0x18')][_0x1111('0x1b')]||null:null,'limit':_0x26c483['options']?_0x26c483[_0x1111('0x18')]['limit']||null:null})[_0x1111('0xd')](function(_0x91e5dc){logger[_0x1111('0x20')](_0x1111('0x21'),_0x26c483);logger[_0x1111('0xf')](_0x1111('0x21'),_0x26c483,JSON[_0x1111('0x24')](_0x91e5dc));_0x20d98d(_0x91e5dc);})[_0x1111('0x14')](function(_0x470d2e){logger[_0x1111('0x11')](_0x1111('0x21'),_0x470d2e[_0x1111('0x12')],_0x26c483);_0x1c31b4(_0xfb336e[_0x1111('0x11')](0x1f4,_0x470d2e[_0x1111('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0xe53c88){var _0x436167=this;return new Promise(function(_0xf8eee,_0x493665){return db[_0x1111('0x16')]['destroy']({'where':_0xe53c88[_0x1111('0x18')]?_0xe53c88['options']['where']||null:null})['then'](function(_0x3c8dd9){logger[_0x1111('0x20')](_0x1111('0x25'),_0xe53c88);logger[_0x1111('0xf')](_0x1111('0x25'),_0xe53c88,JSON[_0x1111('0x24')](_0x3c8dd9));_0xf8eee(_0x3c8dd9);})['catch'](function(_0x39346d){logger[_0x1111('0x11')]('DestroyCmHopperBlack',_0x39346d['message'],_0xe53c88);_0x493665(_0x436167['error'](0x1f4,_0x39346d['message']));});});}; \ No newline at end of file +var _0xe5bd=['UpdateCmHopperBlack','CmHopperBlack','body','raw','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','findAll','options','where','attributes','limit','include','model','map'];(function(_0x39b869,_0x3142d7){var _0x1529af=function(_0x3befc0){while(--_0x3befc0){_0x39b869['push'](_0x39b869['shift']());}};_0x1529af(++_0x3142d7);}(_0xe5bd,0xa6));var _0xde5b=function(_0x3c395f,_0x59277b){_0x3c395f=_0x3c395f-0x0;var _0x44d41e=_0xe5bd[_0x3c395f];return _0x44d41e;};'use strict';var _=require(_0xde5b('0x0'));var util=require(_0xde5b('0x1'));var moment=require(_0xde5b('0x2'));var BPromise=require(_0xde5b('0x3'));var rs=require(_0xde5b('0x4'));var fs=require('fs');var Redis=require(_0xde5b('0x5'));var db=require(_0xde5b('0x6'))['db'];var utils=require(_0xde5b('0x7'));var logger=require(_0xde5b('0x8'))(_0xde5b('0x9'));var config=require(_0xde5b('0xa'));var jayson=require(_0xde5b('0xb'));var client=jayson[_0xde5b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x400e48,_0x10334b,_0x19dd70){return new BPromise(function(_0x202eff,_0x454627){return client[_0xde5b('0xd')](_0x400e48,_0x19dd70)[_0xde5b('0xe')](function(_0x2d496b){logger[_0xde5b('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x10334b,_0xde5b('0x10'));logger[_0xde5b('0x11')](_0xde5b('0x12'),_0x10334b,_0xde5b('0x10'),JSON[_0xde5b('0x13')](_0x2d496b));if(_0x2d496b[_0xde5b('0x14')]){if(_0x2d496b[_0xde5b('0x14')][_0xde5b('0x15')]===0x1f4){logger[_0xde5b('0x14')](_0xde5b('0x16'),_0x10334b,_0x2d496b[_0xde5b('0x14')][_0xde5b('0x17')]);return _0x454627(_0x2d496b[_0xde5b('0x14')][_0xde5b('0x17')]);}logger[_0xde5b('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x10334b,_0x2d496b[_0xde5b('0x14')][_0xde5b('0x17')]);return _0x202eff(_0x2d496b[_0xde5b('0x14')][_0xde5b('0x17')]);}else{logger[_0xde5b('0xf')](_0xde5b('0x16'),_0x10334b,_0xde5b('0x10'));_0x202eff(_0x2d496b['result'][_0xde5b('0x17')]);}})[_0xde5b('0x18')](function(_0x2b21d2){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x10334b,_0x2b21d2);_0x454627(_0x2b21d2);});});}exports[_0xde5b('0x19')]=function(_0x361488){var _0x184f60=this;return new Promise(function(_0xc68e5b,_0x9b4e42){return db['CmHopperBlack'][_0xde5b('0x1a')]({'raw':_0x361488[_0xde5b('0x1b')]?_0x361488[_0xde5b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x361488[_0xde5b('0x1b')]?_0x361488[_0xde5b('0x1b')][_0xde5b('0x1c')]||null:null,'attributes':_0x361488['options']?_0x361488[_0xde5b('0x1b')][_0xde5b('0x1d')]||null:null,'limit':_0x361488[_0xde5b('0x1b')]?_0x361488['options'][_0xde5b('0x1e')]||null:null,'include':_0x361488[_0xde5b('0x1b')]?_0x361488[_0xde5b('0x1b')][_0xde5b('0x1f')]?_['map'](_0x361488[_0xde5b('0x1b')][_0xde5b('0x1f')],function(_0x586aae){return{'model':db[_0x586aae[_0xde5b('0x20')]],'as':_0x586aae['as'],'attributes':_0x586aae['attributes'],'include':_0x586aae['include']?_[_0xde5b('0x21')](_0x586aae[_0xde5b('0x1f')],function(_0x1b1935){return{'model':db[_0x1b1935[_0xde5b('0x20')]],'as':_0x1b1935['as'],'attributes':_0x1b1935['attributes'],'include':_0x1b1935[_0xde5b('0x1f')]?_['map'](_0x1b1935['include'],function(_0x3e3456){return{'model':db[_0x3e3456[_0xde5b('0x20')]],'as':_0x3e3456['as'],'attributes':_0x3e3456[_0xde5b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38be13){logger[_0xde5b('0xf')](_0xde5b('0x19'),_0x361488);logger['debug'](_0xde5b('0x19'),_0x361488,JSON[_0xde5b('0x13')](_0x38be13));_0xc68e5b(_0x38be13);})['catch'](function(_0x2dce39){logger[_0xde5b('0x14')]('GetCmHopperBlack',_0x2dce39[_0xde5b('0x17')],_0x361488);_0x9b4e42(_0x184f60['error'](0x1f4,_0x2dce39['message']));});});};exports[_0xde5b('0x22')]=function(_0x1d43a1){var _0x33cac9=this;return new Promise(function(_0x1e4829,_0x109d35){return db[_0xde5b('0x23')]['update'](_0x1d43a1[_0xde5b('0x24')],{'raw':_0x1d43a1[_0xde5b('0x1b')]?_0x1d43a1[_0xde5b('0x1b')][_0xde5b('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d43a1[_0xde5b('0x1b')]?_0x1d43a1[_0xde5b('0x1b')][_0xde5b('0x1c')]||null:null,'attributes':_0x1d43a1[_0xde5b('0x1b')]?_0x1d43a1['options'][_0xde5b('0x1d')]||null:null,'limit':_0x1d43a1[_0xde5b('0x1b')]?_0x1d43a1[_0xde5b('0x1b')][_0xde5b('0x1e')]||null:null})[_0xde5b('0xe')](function(_0x59cbbe){logger[_0xde5b('0xf')](_0xde5b('0x22'),_0x1d43a1);logger[_0xde5b('0x11')]('UpdateCmHopperBlack',_0x1d43a1,JSON['stringify'](_0x59cbbe));_0x1e4829(_0x59cbbe);})[_0xde5b('0x18')](function(_0x128784){logger['error']('UpdateCmHopperBlack',_0x128784['message'],_0x1d43a1);_0x109d35(_0x33cac9[_0xde5b('0x14')](0x1f4,_0x128784[_0xde5b('0x17')]));});});};exports[_0xde5b('0x26')]=function(_0x41b809){var _0x199b71=this;return new Promise(function(_0x16628d,_0x344c5d){return db[_0xde5b('0x23')][_0xde5b('0x27')]({'where':_0x41b809[_0xde5b('0x1b')]?_0x41b809[_0xde5b('0x1b')][_0xde5b('0x1c')]||null:null})[_0xde5b('0xe')](function(_0x5a9965){logger[_0xde5b('0xf')](_0xde5b('0x26'),_0x41b809);logger[_0xde5b('0x11')](_0xde5b('0x26'),_0x41b809,JSON[_0xde5b('0x13')](_0x5a9965));_0x16628d(_0x5a9965);})[_0xde5b('0x18')](function(_0x3643c2){logger['error']('DestroyCmHopperBlack',_0x3643c2[_0xde5b('0x17')],_0x41b809);_0x344c5d(_0x199b71[_0xde5b('0x14')](0x1f4,_0x3643c2[_0xde5b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index f9c5c25..0866a64 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 _0x8f9d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','/:id','show','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8f9d,0x93));var _0xd8f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8f9d[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['describe']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['put']('/:id',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0x10')](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);module[_0xd8f9('0x12')]=router; \ No newline at end of file +var _0x7b84=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7b84,0x17c));var _0x47b8=function(_0x232167,_0x4a398e){_0x232167=_0x232167-0x0;var _0x537e8a=_0x7b84[_0x232167];return _0x537e8a;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0x11')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);module[_0x47b8('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5b77335..75e684a 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 _0xc418=['sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','BOOLEAN'];(function(_0x466382,_0x479d69){var _0x3d9c72=function(_0x3ff201){while(--_0x3ff201){_0x466382['push'](_0x466382['shift']());}};_0x3d9c72(++_0x479d69);}(_0xc418,0x1ae));var _0x8c41=function(_0x424428,_0x222f5c){_0x424428=_0x424428-0x0;var _0x4ea469=_0xc418[_0x424428];return _0x4ea469;};'use strict';var Sequelize=require(_0x8c41('0x0'));var moment=require(_0x8c41('0x1'));module[_0x8c41('0x2')]={'state':{'type':Sequelize[_0x8c41('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8c41('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8c41('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x8c41('0x4')]},'originatecalleridname':{'type':Sequelize[_0x8c41('0x4')]},'calleridnum':{'type':Sequelize[_0x8c41('0x4')]},'calleridname':{'type':Sequelize[_0x8c41('0x4')]},'starttime':{'type':Sequelize[_0x8c41('0x5')]},'responsetime':{'type':Sequelize[_0x8c41('0x5')]},'answertime':{'type':Sequelize[_0x8c41('0x5')]},'droptime':{'type':Sequelize[_0x8c41('0x5')]},'endtime':{'type':Sequelize[_0x8c41('0x5')]},'ringtime':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8c41('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8c41('0x4')]},'reason':{'type':Sequelize[_0x8c41('0x4')]},'disposition':{'type':Sequelize[_0x8c41('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x8c41('0x5')],'set':function(_0x511902){var _0x1adffe=this[_0x8c41('0x6')](_0x8c41('0x7'));if(_0x1adffe&&_0x511902){this['setDataValue'](_0x8c41('0x8'),moment(_0x511902)['diff'](moment(_0x1adffe),'seconds'));}}},'amd':{'type':Sequelize[_0x8c41('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8c41('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8c41('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8c41('0x5')]},'callback':{'type':Sequelize[_0x8c41('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8c41('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8c41('0x5')]},'recallme':{'type':Sequelize[_0x8c41('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8c41('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8c41('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9a15=['followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','setDataValue'];(function(_0x1db672,_0x54925b){var _0x46f874=function(_0xb7772c){while(--_0xb7772c){_0x1db672['push'](_0x1db672['shift']());}};_0x46f874(++_0x54925b);}(_0x9a15,0x19b));var _0x59a1=function(_0x2fc117,_0x5bf83d){_0x2fc117=_0x2fc117-0x0;var _0x339be9=_0x9a15[_0x2fc117];return _0x339be9;};'use strict';var Sequelize=require(_0x59a1('0x0'));var moment=require(_0x59a1('0x1'));module[_0x59a1('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x59a1('0x3')]},'scheduledat':{'type':Sequelize[_0x59a1('0x4')]},'countbusyretry':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x59a1('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x59a1('0x3')]},'calleridname':{'type':Sequelize[_0x59a1('0x3')]},'starttime':{'type':Sequelize[_0x59a1('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x59a1('0x4')]},'endtime':{'type':Sequelize[_0x59a1('0x4')]},'ringtime':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x59a1('0x3')]},'membername':{'type':Sequelize[_0x59a1('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x59a1('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x59a1('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x21bc88){var _0x3d0bca=this['getDataValue']('endtime');if(_0x3d0bca&&_0x21bc88){this[_0x59a1('0x6')](_0x59a1('0x7'),moment(_0x21bc88)[_0x59a1('0x8')](moment(_0x3d0bca),_0x59a1('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x59a1('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x59a1('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x59a1('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x59a1('0x4')]},'callback':{'type':Sequelize[_0x59a1('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x59a1('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x59a1('0x4')]},'deleted':{'type':Sequelize[_0x59a1('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x59a1('0x4')]},'recallme':{'type':Sequelize[_0x59a1('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x59a1('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x59a1('0x5')],'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 3c9f1bf..6711901 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 _0x7c09=['sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','noAnswerContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','createdAt','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','state\x20=\x204','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x40d902,_0x530689){var _0x2219bc=function(_0x18a4d7){while(--_0x18a4d7){_0x40d902['push'](_0x40d902['shift']());}};_0x2219bc(++_0x530689);}(_0x7c09,0x102));var _0x97c0=function(_0x4d1e61,_0x5bc22d){_0x4d1e61=_0x4d1e61-0x0;var _0x24c184=_0x7c09[_0x4d1e61];return _0x24c184;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['CmHopperFinal'][_0x97c0('0x48')]()[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,null))[_0x97c0('0x43')](handleError(_0x4ff0a5,null));};exports['update']=function(_0x3e09d5,_0xac56ac){if(_0x3e09d5[_0x97c0('0x49')][_0x97c0('0x4a')]){delete _0x3e09d5[_0x97c0('0x49')]['uniqueid'];}return db[_0x97c0('0x2b')][_0x97c0('0x47')]({'where':{'uniqueid':_0x3e09d5[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0xac56ac,null))['then'](saveUpdates(_0x3e09d5[_0x97c0('0x49')],null))['then'](respondWithResult(_0xac56ac,null))['catch'](handleError(_0xac56ac,null));};exports[_0x97c0('0x4b')]=function(_0x20e2a5,_0x23c7ad,_0x53a255){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x20e2a5[_0x97c0('0x45')]['id']},'attributes':[[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x4f')))),'noSuchContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x50')))),'noAnswerContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x53')))),_0x97c0('0x54')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x55')))),_0x97c0('0x56')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x59')))),'reCallContacts'],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x97c0('0x5a')]]})[_0x97c0('0x24')](handleEntityNotFound(_0x23c7ad,null))[_0x97c0('0x24')](respondWithResult(_0x23c7ad,null))[_0x97c0('0x43')](handleError(_0x23c7ad,null));};exports[_0x97c0('0x5b')]=function(_0x2bb5d3,_0x52643e,_0x3349df){return db[_0x97c0('0x2b')][_0x97c0('0x41')]({'raw':![],'where':{'CampaignId':_0x2bb5d3[_0x97c0('0x45')]['id']},'attributes':[[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x200,\x201,\x20null'))),_0x97c0('0x5c')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x50')))),_0x97c0('0x5d')],[db['sequelize']['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x51')))),_0x97c0('0x52')],[db[_0x97c0('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),_0x97c0('0x54')],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x55')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db['sequelize'][_0x97c0('0x4e')](_0x97c0('0x57')))),_0x97c0('0x58')],[db[_0x97c0('0x4c')]['fn'](_0x97c0('0x4d'),db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x59')))),_0x97c0('0x5e')],[db[_0x97c0('0x4c')]['fn']('COUNT',db[_0x97c0('0x4c')]['fn']('IF',db[_0x97c0('0x4c')][_0x97c0('0x4e')](_0x97c0('0x5f')))),_0x97c0('0x5a')]]})['then'](handleEntityNotFound(_0x52643e,null))[_0x97c0('0x24')](respondWithResult(_0x52643e,null))[_0x97c0('0x43')](handleError(_0x52643e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x4116c9,_0x30ffa8,_0x1cfe22){return db['VoiceQueue'][_0x97c0('0x47')]({'where':{'id':_0x4116c9[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x30ffa8,null))[_0x97c0('0x24')](function(_0x4d40cd){var _0x4ee6a2;if(_0x4d40cd){_0x4ee6a2=squel['insert']()[_0x97c0('0x60')](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),_0x97c0('0x66'),_0x97c0('0x67'),'createdAt','updatedAt'],squel[_0x97c0('0x68')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x64'))[_0x97c0('0x69')](_0x97c0('0x6b'),'ContactId')['field'](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x6d'),'VoiceQueueId')[_0x97c0('0x69')]('NOW()',_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x74'),_0x4116c9['body']['state'][_0x97c0('0x73')]())[_0x97c0('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x97c0('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x97c0('0x68')]()[_0x97c0('0x69')]('phone')[_0x97c0('0x70')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x4116c9[_0x97c0('0x45')]['id'][_0x97c0('0x73')]()))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x72'),_0x4116c9['params']['id'][_0x97c0('0x73')]())['where']('state\x20=\x204'))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')]['query'](_0x4ee6a2);}return[];})[_0x97c0('0x24')](respondWithResult(_0x30ffa8,null))[_0x97c0('0x43')](handleError(_0x30ffa8,null));};exports[_0x97c0('0x78')]=function(_0x5bb9de,_0x388ba1,_0x550a68){return db[_0x97c0('0x79')][_0x97c0('0x47')]({'where':{'id':_0x5bb9de[_0x97c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x388ba1,null))[_0x97c0('0x24')](function(_0x44f6bc){var _0x37cdb3;if(_0x44f6bc){_0x37cdb3=squel[_0x97c0('0x7a')]()['into'](_0x97c0('0x61'))[_0x97c0('0x62')]([_0x97c0('0x63'),_0x97c0('0x64'),_0x97c0('0x65'),'ListId',_0x97c0('0x7b'),_0x97c0('0x6e'),'updatedAt'],squel['select']()[_0x97c0('0x69')](_0x97c0('0x7c'),_0x97c0('0x63'))['field']('NOW()',_0x97c0('0x64'))['field'](_0x97c0('0x6b'),_0x97c0('0x65'))[_0x97c0('0x69')](_0x97c0('0x6c'),_0x97c0('0x66'))[_0x97c0('0x69')](_0x97c0('0x7d'),'CampaignId')[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6e'))[_0x97c0('0x69')](_0x97c0('0x6a'),_0x97c0('0x6f'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de[_0x97c0('0x45')]['id'][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x74'),_0x5bb9de['body'][_0x97c0('0x7f')][_0x97c0('0x73')]())[_0x97c0('0x39')](_0x97c0('0x80'))['where'](_0x97c0('0x75'),squel[_0x97c0('0x68')]()[_0x97c0('0x69')](_0x97c0('0x63'))[_0x97c0('0x70')](_0x97c0('0x61'))[_0x97c0('0x39')]('CampaignId\x20=\x20?',_0x5bb9de[_0x97c0('0x45')]['id']['toString']()))[_0x97c0('0x39')](_0x97c0('0x75'),squel[_0x97c0('0x68')]()['field'](_0x97c0('0x76'))[_0x97c0('0x70')](_0x97c0('0x71'))[_0x97c0('0x39')](_0x97c0('0x7e'),_0x5bb9de['params']['id'][_0x97c0('0x73')]())['where'](_0x97c0('0x81')))[_0x97c0('0x77')]('ContactId'))[_0x97c0('0x73')]();return db[_0x97c0('0x4c')][_0x97c0('0x2f')](_0x37cdb3);}return[];})[_0x97c0('0x24')](respondWithResult(_0x388ba1,null))[_0x97c0('0x43')](handleError(_0x388ba1,null));};exports[_0x97c0('0x82')]=function(_0x3ebd11,_0x44b374,_0x493e62){return db[_0x97c0('0x83')][_0x97c0('0x84')]({'where':{'VoiceQueueId':_0x3ebd11[_0x97c0('0x49')]['VoiceQueueId'],'CampaignId':_0x3ebd11['body'][_0x97c0('0x7b')],'ContactId':_0x3ebd11[_0x97c0('0x49')][_0x97c0('0x65')]}})[_0x97c0('0x24')](handleEntityNotFound(_0x44b374,null))[_0x97c0('0x24')](function(_0x120d78){if(_0x120d78){return _0x120d78;}return null;})[_0x97c0('0x24')](respondWithResult(_0x44b374,null))[_0x97c0('0x43')](handleError(_0x44b374,null));}; \ No newline at end of file +var _0x7a54=['calleridnum\x20NOT\x20IN\x20(?)','calleridnum','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','group','checkContactHopper','findOne','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','CmHopperFinal','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','uniqueid','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL'];(function(_0x20dd32,_0x595bb0){var _0x40bddf=function(_0x5e82b3){while(--_0x5e82b3){_0x20dd32['push'](_0x20dd32['shift']());}};_0x40bddf(++_0x595bb0);}(_0x7a54,0x106));var _0x47a5=function(_0x31e78e,_0xeeb77f){_0x31e78e=_0x31e78e-0x0;var _0x45d800=_0x7a54[_0x31e78e];return _0x45d800;};'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['CmHopperFinal'][_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['CmHopperFinal']['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['describe']=function(_0x2d38de,_0x23bb04){return db['CmHopperFinal']['describe']()[_0x47a5('0x23')](respondWithResult(_0x23bb04,null))['catch'](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0xd93e37,_0x54c35f){if(_0xd93e37['body'][_0x47a5('0x47')]){delete _0xd93e37['body'][_0x47a5('0x47')];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'uniqueid':_0xd93e37[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x54c35f,null))[_0x47a5('0x23')](saveUpdates(_0xd93e37[_0x47a5('0x48')],null))['then'](respondWithResult(_0x54c35f,null))['catch'](handleError(_0x54c35f,null));};exports[_0x47a5('0x49')]=function(_0x411230,_0x1163e3,_0x9ea93e){return db[_0x47a5('0x2a')][_0x47a5('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x411230[_0x47a5('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x4c')))),'noSuchContacts'],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x4d')))),_0x47a5('0x4e')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),_0x47a5('0x50')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0x47a5('0x51')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x52')))),'dropContacts'],[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x47a5('0x53')))),'abandonedContacts'],[db[_0x47a5('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x2022,\x201,\x20null'))),_0x47a5('0x54')],[db[_0x47a5('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x55')))),_0x47a5('0x56')]]})['then'](handleEntityNotFound(_0x1163e3,null))[_0x47a5('0x23')](respondWithResult(_0x1163e3,null))[_0x47a5('0x46')](handleError(_0x1163e3,null));};exports[_0x47a5('0x57')]=function(_0x5a33b8,_0x30ea7a,_0x4db625){return db[_0x47a5('0x2a')][_0x47a5('0x3e')]({'raw':![],'where':{'CampaignId':_0x5a33b8[_0x47a5('0x41')]['id']},'attributes':[[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x47a5('0x4e')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x58')))),'busyContacts'],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db['sequelize']['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x59')))),_0x47a5('0x51')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')]['literal'](_0x47a5('0x52')))),_0x47a5('0x5a')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db['sequelize'][_0x47a5('0x4f')](_0x47a5('0x53')))),_0x47a5('0x5b')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')](_0x47a5('0x5c')))),_0x47a5('0x54')],[db[_0x47a5('0x4b')]['fn'](_0x47a5('0x4a'),db[_0x47a5('0x4b')]['fn']('IF',db[_0x47a5('0x4b')][_0x47a5('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x47a5('0x56')]]})[_0x47a5('0x23')](handleEntityNotFound(_0x30ea7a,null))[_0x47a5('0x23')](respondWithResult(_0x30ea7a,null))['catch'](handleError(_0x30ea7a,null));};exports[_0x47a5('0x5d')]=function(_0x2e46af,_0x36c67,_0x26f1ac){return db['VoiceQueue'][_0x47a5('0x45')]({'where':{'id':_0x2e46af['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x36c67,null))['then'](function(_0x43f649){var _0x4cf7c5;if(_0x43f649){_0x4cf7c5=squel[_0x47a5('0x5e')]()[_0x47a5('0x5f')](_0x47a5('0x60'))['fromQuery'](['phone','scheduledAt',_0x47a5('0x61'),_0x47a5('0x62'),_0x47a5('0x63'),_0x47a5('0x64'),'updatedAt'],squel[_0x47a5('0x65')]()[_0x47a5('0x66')](_0x47a5('0x67'),_0x47a5('0x68'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x6a'))[_0x47a5('0x66')](_0x47a5('0x6b'),_0x47a5('0x61'))[_0x47a5('0x66')](_0x47a5('0x6c'),'ListId')[_0x47a5('0x66')]('ANY_VALUE(VoiceQueueId)',_0x47a5('0x63'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x64'))[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x6d'))[_0x47a5('0x6e')](_0x47a5('0x6f'))[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id'][_0x47a5('0x71')]())[_0x47a5('0x38')](_0x47a5('0x72'),_0x2e46af['body']['state']['toString']())['where'](_0x47a5('0x73'))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x47a5('0x65')]()[_0x47a5('0x66')](_0x47a5('0x68'))[_0x47a5('0x6e')](_0x47a5('0x60'))[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id'][_0x47a5('0x71')]()))[_0x47a5('0x38')](_0x47a5('0x74'),squel['select']()[_0x47a5('0x66')](_0x47a5('0x75'))[_0x47a5('0x6e')]('cm_hopper_final')[_0x47a5('0x38')](_0x47a5('0x70'),_0x2e46af[_0x47a5('0x41')]['id']['toString']())[_0x47a5('0x38')]('state\x20=\x204'))['group'](_0x47a5('0x61')))[_0x47a5('0x71')]();return db[_0x47a5('0x4b')][_0x47a5('0x2f')](_0x4cf7c5);}return[];})[_0x47a5('0x23')](respondWithResult(_0x36c67,null))[_0x47a5('0x46')](handleError(_0x36c67,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x592322,_0x3e0dbd,_0x4f2361){return db[_0x47a5('0x76')][_0x47a5('0x45')]({'where':{'id':_0x592322[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x3e0dbd,null))['then'](function(_0x3c66e3){var _0x550bde;if(_0x3c66e3){_0x550bde=squel['insert']()[_0x47a5('0x5f')](_0x47a5('0x60'))['fromQuery']([_0x47a5('0x68'),_0x47a5('0x6a'),_0x47a5('0x61'),'ListId',_0x47a5('0x77'),'createdAt',_0x47a5('0x6d')],squel[_0x47a5('0x65')]()[_0x47a5('0x66')]('ANY_VALUE(calleridnum)',_0x47a5('0x68'))[_0x47a5('0x66')](_0x47a5('0x69'),'scheduledAt')[_0x47a5('0x66')]('ANY_VALUE(ContactId)',_0x47a5('0x61'))['field'](_0x47a5('0x6c'),_0x47a5('0x62'))[_0x47a5('0x66')](_0x47a5('0x78'),'CampaignId')[_0x47a5('0x66')](_0x47a5('0x69'),_0x47a5('0x64'))[_0x47a5('0x66')](_0x47a5('0x69'),'updatedAt')['from'](_0x47a5('0x6f'))['where'](_0x47a5('0x79'),_0x592322[_0x47a5('0x41')]['id'][_0x47a5('0x71')]())['where'](_0x47a5('0x72'),_0x592322[_0x47a5('0x48')]['state'][_0x47a5('0x71')]())[_0x47a5('0x38')](_0x47a5('0x73'))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x47a5('0x66')](_0x47a5('0x68'))['from'](_0x47a5('0x60'))[_0x47a5('0x38')]('CampaignId\x20=\x20?',_0x592322[_0x47a5('0x41')]['id'][_0x47a5('0x71')]()))[_0x47a5('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x47a5('0x65')]()['field'](_0x47a5('0x75'))['from'](_0x47a5('0x6f'))[_0x47a5('0x38')]('CampaignId\x20=\x20?',_0x592322[_0x47a5('0x41')]['id']['toString']())[_0x47a5('0x38')](_0x47a5('0x7a')))[_0x47a5('0x7b')](_0x47a5('0x61')))['toString']();return db[_0x47a5('0x4b')]['query'](_0x550bde);}return[];})['then'](respondWithResult(_0x3e0dbd,null))[_0x47a5('0x46')](handleError(_0x3e0dbd,null));};exports[_0x47a5('0x7c')]=function(_0x352238,_0x96fb22,_0x380c8b){return db['CmHopper'][_0x47a5('0x7d')]({'where':{'VoiceQueueId':_0x352238[_0x47a5('0x48')][_0x47a5('0x63')],'CampaignId':_0x352238[_0x47a5('0x48')]['CampaignId'],'ContactId':_0x352238[_0x47a5('0x48')]['ContactId']}})[_0x47a5('0x23')](handleEntityNotFound(_0x96fb22,null))[_0x47a5('0x23')](function(_0x3f93f0){if(_0x3f93f0){return _0x3f93f0;}return null;})[_0x47a5('0x23')](respondWithResult(_0x96fb22,null))[_0x47a5('0x46')](handleError(_0x96fb22,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 72d6330..ca26e47 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 _0xea74=['cm_hopper_final','calleridnum','uniqueid','lodash','api','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x1a070b,_0x46d2c8){var _0x20b48d=function(_0x4e8510){while(--_0x4e8510){_0x1a070b['push'](_0x1a070b['shift']());}};_0x20b48d(++_0x46d2c8);}(_0xea74,0x1d7));var _0x4ea7=function(_0x5f04c1,_0x1752c2){_0x5f04c1=_0x5f04c1-0x0;var _0x505de5=_0xea74[_0x5f04c1];return _0x505de5;};'use strict';var _=require(_0x4ea7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4ea7('0x1'));var moment=require('moment');var BPromise=require(_0x4ea7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ea7('0x3'));var rimraf=require(_0x4ea7('0x4'));var config=require(_0x4ea7('0x5'));var attributes=require(_0x4ea7('0x6'));module[_0x4ea7('0x7')]=function(_0x37894e,_0x23f602){return _0x37894e[_0x4ea7('0x8')](_0x4ea7('0x9'),attributes,{'tableName':_0x4ea7('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x4ea7('0xb')]},{'name':'uniqueid','fields':[_0x4ea7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f7e=['rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x9b9c97,_0x84bbce){var _0x3860e2=function(_0xe2d70a){while(--_0xe2d70a){_0x9b9c97['push'](_0x9b9c97['shift']());}};_0x3860e2(++_0x84bbce);}(_0x0f7e,0x1d9));var _0xe0f7=function(_0x58d5de,_0x1419c2){_0x58d5de=_0x58d5de-0x0;var _0x1c70e7=_0x0f7e[_0x58d5de];return _0x1c70e7;};'use strict';var _=require(_0xe0f7('0x0'));var util=require('util');var logger=require(_0xe0f7('0x1'))(_0xe0f7('0x2'));var moment=require(_0xe0f7('0x3'));var BPromise=require(_0xe0f7('0x4'));var rp=require(_0xe0f7('0x5'));var fs=require('fs');var path=require(_0xe0f7('0x6'));var rimraf=require(_0xe0f7('0x7'));var config=require(_0xe0f7('0x8'));var attributes=require(_0xe0f7('0x9'));module[_0xe0f7('0xa')]=function(_0x5db9e9,_0x52d01b){return _0x5db9e9[_0xe0f7('0xb')](_0xe0f7('0xc'),attributes,{'tableName':_0xe0f7('0xd'),'paranoid':![],'indexes':[{'name':_0xe0f7('0xe'),'fields':['calleridnum']},{'name':_0xe0f7('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 527f3ed..f812f12 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(_0x16a844,_0x42adf3){var _0x5c3fc5=function(_0x5831e0){while(--_0x5831e0){_0x16a844['push'](_0x16a844['shift']());}};_0x5c3fc5(++_0x42adf3);}(_0x7a54,0x106));var _0x47a5=function(_0x27d60a,_0x427dca){_0x27d60a=_0x27d60a-0x0;var _0xbc4615=_0x7a54[_0x27d60a];return _0xbc4615;};'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(_0x1e3029,_0x5aac32){var _0x3dcfe5=function(_0x36a3f1){while(--_0x36a3f1){_0x1e3029['push'](_0x1e3029['shift']());}};_0x3dcfe5(++_0x5aac32);}(_0xb10b,0x12a));var _0xbb10=function(_0xd4470d,_0x47318d){_0xd4470d=_0xd4470d-0x0;var _0x5544c5=_0xb10b[_0xd4470d];return _0x5544c5;};'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 4dc463c..35235e2 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 _0xf9fd=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','describe','isAuthenticated','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','util','path','connect-timeout'];(function(_0x8dd613,_0x2f3eed){var _0x34166e=function(_0x1c348b){while(--_0x1c348b){_0x8dd613['push'](_0x8dd613['shift']());}};_0x34166e(++_0x2f3eed);}(_0xf9fd,0x14f));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xdf9f('0x0'));var path=require(_0xdf9f('0x1'));var timeout=require(_0xdf9f('0x2'));var express=require(_0xdf9f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdf9f('0x4'));var interaction=require(_0xdf9f('0x5'));var config=require(_0xdf9f('0x6'));var controller=require(_0xdf9f('0x7'));router[_0xdf9f('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf9f('0x9')]);router[_0xdf9f('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xdf9f('0xa')]);router[_0xdf9f('0x8')]('/:id',auth[_0xdf9f('0xb')](),controller[_0xdf9f('0xc')]);router[_0xdf9f('0x8')](_0xdf9f('0xd'),auth[_0xdf9f('0xb')](),controller[_0xdf9f('0xe')]);router[_0xdf9f('0x8')](_0xdf9f('0xf'),auth['isAuthenticated'](),controller[_0xdf9f('0x10')]);router['post'](_0xdf9f('0x11'),auth[_0xdf9f('0xb')](),controller[_0xdf9f('0x12')]);router[_0xdf9f('0x13')](_0xdf9f('0x14'),auth[_0xdf9f('0xb')](),controller[_0xdf9f('0x15')]);router['post'](_0xdf9f('0x16'),auth['isAuthenticated'](),controller[_0xdf9f('0x17')]);router['put']('/:id',auth[_0xdf9f('0xb')](),controller[_0xdf9f('0x18')]);module[_0xdf9f('0x19')]=router; \ No newline at end of file +var _0xe440=['../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','/:id','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xc71e23,_0x434337){var _0x119ad7=function(_0x503498){while(--_0x503498){_0xc71e23['push'](_0xc71e23['shift']());}};_0x119ad7(++_0x434337);}(_0xe440,0x10d));var _0x0e44=function(_0x1a140b,_0x49695f){_0x1a140b=_0x1a140b-0x0;var _0x383cc4=_0xe440[_0x1a140b];return _0x383cc4;};'use strict';var multer=require('multer');var util=require(_0x0e44('0x0'));var path=require(_0x0e44('0x1'));var timeout=require(_0x0e44('0x2'));var express=require(_0x0e44('0x3'));var router=express[_0x0e44('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e44('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0e44('0x6'));var controller=require(_0x0e44('0x7'));router[_0x0e44('0x8')]('/',auth[_0x0e44('0x9')](),controller[_0x0e44('0xa')]);router[_0x0e44('0x8')](_0x0e44('0xb'),auth['isAuthenticated'](),controller[_0x0e44('0xc')]);router[_0x0e44('0x8')]('/:id',auth[_0x0e44('0x9')](),controller[_0x0e44('0xd')]);router[_0x0e44('0x8')]('/voice/queue/countAttributes/:id',auth[_0x0e44('0x9')](),controller[_0x0e44('0xe')]);router[_0x0e44('0x8')](_0x0e44('0xf'),auth[_0x0e44('0x9')](),controller[_0x0e44('0x10')]);router[_0x0e44('0x11')](_0x0e44('0x12'),auth['isAuthenticated'](),controller[_0x0e44('0x13')]);router[_0x0e44('0x11')](_0x0e44('0x14'),auth[_0x0e44('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x0e44('0x11')](_0x0e44('0x15'),auth[_0x0e44('0x9')](),controller[_0x0e44('0x16')]);router[_0x0e44('0x17')](_0x0e44('0x18'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index dcd7578..8759d80 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 _0x10b2=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x1bd498,_0x14b925){var _0xb4473e=function(_0x367808){while(--_0x367808){_0x1bd498['push'](_0x1bd498['shift']());}};_0xb4473e(++_0x14b925);}(_0x10b2,0x1be));var _0x210b=function(_0x175fed,_0x391f13){_0x175fed=_0x175fed-0x0;var _0xb0e7f5=_0x10b2[_0x175fed];return _0xb0e7f5;};'use strict';var Sequelize=require(_0x210b('0x0'));module[_0x210b('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x210b('0x2')]},'scheduledat':{'type':Sequelize[_0x210b('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x210b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x210b('0x2')]},'originatecalleridname':{'type':Sequelize[_0x210b('0x2')]},'calleridnum':{'type':Sequelize[_0x210b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x210b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x210b('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x210b('0x3')]},'ringtime':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x210b('0x2')]},'campaign':{'type':Sequelize[_0x210b('0x2')]},'campaigntype':{'type':Sequelize[_0x210b('0x2')]},'membername':{'type':Sequelize[_0x210b('0x2')]},'reason':{'type':Sequelize[_0x210b('0x2')]},'amd':{'type':Sequelize[_0x210b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x210b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x210b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x210b('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x210b('0x3')]},'edited':{'type':Sequelize[_0x210b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x210b('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x210b('0x2')]}}; \ No newline at end of file +var _0x5f02=['BOOLEAN','sequelize','INTEGER','DATE','STRING'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x5f02,0xa6));var _0x25f0=function(_0x707bae,_0x61938e){_0x707bae=_0x707bae-0x0;var _0x13a79b=_0x5f02[_0x707bae];return _0x13a79b;};'use strict';var Sequelize=require(_0x25f0('0x0'));module['exports']={'state':{'type':Sequelize[_0x25f0('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x25f0('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x25f0('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x25f0('0x3')]},'calleridname':{'type':Sequelize[_0x25f0('0x3')]},'starttime':{'type':Sequelize[_0x25f0('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x25f0('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x25f0('0x3')]},'campaigntype':{'type':Sequelize[_0x25f0('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x25f0('0x3')]},'amd':{'type':Sequelize[_0x25f0('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x25f0('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x25f0('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x25f0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x25f0('0x2')]},'recallme':{'type':Sequelize[_0x25f0('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x25f0('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x25f0('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 212f4c9..14df34c 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 _0xf138=['include','findAll','show','params','keys','options','find','catch','create','body','describe','uniqueid','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','then','destroy','error','name','CmHopperHistory','rawAttributes','key','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll'];(function(_0x519e7a,_0x4c36b6){var _0x2f8209=function(_0x3d8ce5){while(--_0x3d8ce5){_0x519e7a['push'](_0x519e7a['shift']());}};_0x2f8209(++_0x4c36b6);}(_0xf138,0x108));var _0x8f13=function(_0x1f8258,_0x981916){_0x1f8258=_0x1f8258-0x0;var _0x54a437=_0xf138[_0x1f8258];return _0x54a437;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8f13('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f13('0x1'));var moment=require('moment');var BPromise=require(_0x8f13('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8f13('0x3'));var sox=require(_0x8f13('0x4'));var csv=require(_0x8f13('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f13('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f13('0x7'));var jsforce=require(_0x8f13('0x8'));var deskjs=require(_0x8f13('0x9'));var toCsv=require(_0x8f13('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8f13('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f13('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f13('0xc'))('api');var utils=require(_0x8f13('0xd'));var config=require('../../config/environment');var licenseUtil=require(_0x8f13('0xe'));var db=require(_0x8f13('0xf'))['db'];function respondWithStatusCode(_0x1d6c83,_0x21ade1){_0x21ade1=_0x21ade1||0xcc;return function(_0x4e8cc2){if(_0x4e8cc2){return _0x1d6c83[_0x8f13('0x10')](_0x21ade1);}return _0x1d6c83[_0x8f13('0x11')](_0x21ade1)[_0x8f13('0x12')]();};}function respondWithResult(_0x2c635b,_0x54de7c){_0x54de7c=_0x54de7c||0xc8;return function(_0x421fe0){if(_0x421fe0){return _0x2c635b['status'](_0x54de7c)[_0x8f13('0x13')](_0x421fe0);}};}function respondWithFilteredResult(_0x54cd0a,_0x368f18){return function(_0x4c3a0c){if(_0x4c3a0c){var _0x2e8717=typeof _0x368f18[_0x8f13('0x14')]===_0x8f13('0x15')&&typeof _0x368f18[_0x8f13('0x16')]===_0x8f13('0x15');var _0x3bea84=_0x4c3a0c[_0x8f13('0x17')];var _0x4e6a37=_0x2e8717?0x0:_0x368f18[_0x8f13('0x14')];var _0x2ee573=_0x2e8717?_0x4c3a0c['count']:_0x368f18[_0x8f13('0x14')]+_0x368f18[_0x8f13('0x16')];var _0x80519f;if(_0x2ee573>=_0x3bea84){_0x2ee573=_0x3bea84;_0x80519f=0xc8;}else{_0x80519f=0xce;}_0x54cd0a[_0x8f13('0x11')](_0x80519f);return _0x54cd0a['set']('Content-Range',_0x4e6a37+'-'+_0x2ee573+'/'+_0x3bea84)[_0x8f13('0x13')](_0x4c3a0c);}return null;};}function patchUpdates(_0x348448){return function(_0x433768){try{jsonpatch['apply'](_0x433768,_0x348448,!![]);}catch(_0x2efc51){return BPromise[_0x8f13('0x18')](_0x2efc51);}return _0x433768[_0x8f13('0x19')]();};}function saveUpdates(_0x48300a,_0xd56246){return function(_0x59d608){if(_0x59d608){return _0x59d608['update'](_0x48300a)[_0x8f13('0x1a')](function(_0x11379b){return _0x11379b;});}return null;};}function removeEntity(_0x19887c,_0x1e78ee){return function(_0x3248e0){if(_0x3248e0){return _0x3248e0[_0x8f13('0x1b')]()[_0x8f13('0x1a')](function(){_0x19887c['status'](0xcc)[_0x8f13('0x12')]();});}};}function handleEntityNotFound(_0x5c6b84,_0xb96301){return function(_0x330ee7){if(!_0x330ee7){_0x5c6b84[_0x8f13('0x10')](0x194);}return _0x330ee7;};}function handleError(_0xb4f122,_0x4229d2){_0x4229d2=_0x4229d2||0x1f4;return function(_0x1cd55c){logger[_0x8f13('0x1c')](_0x1cd55c['stack']);if(_0x1cd55c['name']){delete _0x1cd55c[_0x8f13('0x1d')];}_0xb4f122[_0x8f13('0x11')](_0x4229d2)['send'](_0x1cd55c);};}exports['index']=function(_0x3bed4c,_0x3c8852){var _0x54d1dd={},_0x457839={},_0x5ce1c0={'count':0x0,'rows':[]};var _0x2c008c=_['map'](db[_0x8f13('0x1e')][_0x8f13('0x1f')],function(_0x747539){return{'name':_0x747539['fieldName'],'type':_0x747539['type'][_0x8f13('0x20')]};});_0x457839['model']=_[_0x8f13('0x21')](_0x2c008c,'name');_0x457839[_0x8f13('0x22')]=_['keys'](_0x3bed4c['query']);_0x457839[_0x8f13('0x23')]=_[_0x8f13('0x24')](_0x457839[_0x8f13('0x25')],_0x457839[_0x8f13('0x22')]);_0x54d1dd[_0x8f13('0x26')]=_[_0x8f13('0x24')](_0x457839[_0x8f13('0x25')],qs[_0x8f13('0x27')](_0x3bed4c[_0x8f13('0x22')]['fields']));_0x54d1dd[_0x8f13('0x26')]=_0x54d1dd[_0x8f13('0x26')][_0x8f13('0x28')]?_0x54d1dd['attributes']:_0x457839['model'];if(!_0x3bed4c[_0x8f13('0x22')]['hasOwnProperty'](_0x8f13('0x29'))){_0x54d1dd[_0x8f13('0x16')]=qs['limit'](_0x3bed4c[_0x8f13('0x22')][_0x8f13('0x16')]);_0x54d1dd[_0x8f13('0x14')]=qs[_0x8f13('0x14')](_0x3bed4c['query'][_0x8f13('0x14')]);}_0x54d1dd[_0x8f13('0x2a')]=qs[_0x8f13('0x2b')](_0x3bed4c['query'][_0x8f13('0x2b')]);_0x54d1dd[_0x8f13('0x2c')]=qs[_0x8f13('0x23')](_[_0x8f13('0x2d')](_0x3bed4c[_0x8f13('0x22')],_0x457839['filters']),_0x2c008c);if(_0x3bed4c['query']['filter']){_0x54d1dd[_0x8f13('0x2c')]=_[_0x8f13('0x2e')](_0x54d1dd[_0x8f13('0x2c')],{'$or':_[_0x8f13('0x21')](_0x2c008c,function(_0x2848e2){if(_0x2848e2[_0x8f13('0x2f')]!==_0x8f13('0x30')){var _0x4c192c={};_0x4c192c[_0x2848e2[_0x8f13('0x1d')]]={'$like':'%'+_0x3bed4c['query'][_0x8f13('0x31')]+'%'};return _0x4c192c;}})});}_0x54d1dd=_[_0x8f13('0x2e')]({},_0x54d1dd,_0x3bed4c['options']);var _0x4accae={'where':_0x54d1dd[_0x8f13('0x2c')]};return db['CmHopperHistory'][_0x8f13('0x17')](_0x4accae)['then'](function(_0x177334){_0x5ce1c0[_0x8f13('0x17')]=_0x177334;if(_0x3bed4c[_0x8f13('0x22')][_0x8f13('0x32')]){_0x54d1dd[_0x8f13('0x33')]=[{'all':!![]}];}return db[_0x8f13('0x1e')][_0x8f13('0x34')](_0x54d1dd);})[_0x8f13('0x1a')](function(_0x297434){_0x5ce1c0['rows']=_0x297434;return _0x5ce1c0;})[_0x8f13('0x1a')](respondWithFilteredResult(_0x3c8852,_0x54d1dd))['catch'](handleError(_0x3c8852,null));};exports[_0x8f13('0x35')]=function(_0x43b813,_0x2f7e6a){var _0x57c864={'raw':!![],'where':{'id':_0x43b813[_0x8f13('0x36')]['id']}},_0x4108aa={};_0x4108aa[_0x8f13('0x25')]=_[_0x8f13('0x37')](db[_0x8f13('0x1e')][_0x8f13('0x1f')]);_0x4108aa[_0x8f13('0x22')]=_[_0x8f13('0x37')](_0x43b813[_0x8f13('0x22')]);_0x4108aa[_0x8f13('0x23')]=_[_0x8f13('0x24')](_0x4108aa[_0x8f13('0x25')],_0x4108aa[_0x8f13('0x22')]);_0x57c864[_0x8f13('0x26')]=_[_0x8f13('0x24')](_0x4108aa[_0x8f13('0x25')],qs[_0x8f13('0x27')](_0x43b813['query'][_0x8f13('0x27')]));_0x57c864[_0x8f13('0x26')]=_0x57c864[_0x8f13('0x26')][_0x8f13('0x28')]?_0x57c864['attributes']:_0x4108aa[_0x8f13('0x25')];if(_0x43b813['query'][_0x8f13('0x32')]){_0x57c864['include']=[{'all':!![]}];}_0x57c864=_[_0x8f13('0x2e')]({},_0x57c864,_0x43b813[_0x8f13('0x38')]);return db[_0x8f13('0x1e')][_0x8f13('0x39')](_0x57c864)[_0x8f13('0x1a')](handleEntityNotFound(_0x2f7e6a,null))[_0x8f13('0x1a')](respondWithResult(_0x2f7e6a,null))[_0x8f13('0x3a')](handleError(_0x2f7e6a,null));};exports[_0x8f13('0x3b')]=function(_0x26f94f,_0x5a6d1f){return db['CmHopperHistory']['create'](_0x26f94f[_0x8f13('0x3c')],{})[_0x8f13('0x1a')](respondWithResult(_0x5a6d1f,0xc9))[_0x8f13('0x3a')](handleError(_0x5a6d1f,null));};exports[_0x8f13('0x3d')]=function(_0x1672a9,_0xe0b374){return db[_0x8f13('0x1e')][_0x8f13('0x3d')]()['then'](respondWithResult(_0xe0b374,null))[_0x8f13('0x3a')](handleError(_0xe0b374,null));};exports['update']=function(_0x21ad16,_0x5f008c){if(_0x21ad16[_0x8f13('0x3c')][_0x8f13('0x3e')]){delete _0x21ad16[_0x8f13('0x3c')][_0x8f13('0x3e')];}return db[_0x8f13('0x1e')]['find']({'where':{'uniqueid':_0x21ad16[_0x8f13('0x36')]['id']}})[_0x8f13('0x1a')](handleEntityNotFound(_0x5f008c,null))[_0x8f13('0x1a')](saveUpdates(_0x21ad16[_0x8f13('0x3c')],null))[_0x8f13('0x1a')](respondWithResult(_0x5f008c,null))[_0x8f13('0x3a')](handleError(_0x5f008c,null));}; \ No newline at end of file +var _0x0158=['VIRTUAL','merge','options','CmHopperHistory','findAll','rows','catch','show','params','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','type'];(function(_0xd5219a,_0x1ae736){var _0x38ff0f=function(_0x70aac){while(--_0x70aac){_0xd5219a['push'](_0xd5219a['shift']());}};_0x38ff0f(++_0x1ae736);}(_0x0158,0x1b8));var _0x8015=function(_0x50c534,_0x3c8dce){_0x50c534=_0x50c534-0x0;var _0x4677df=_0x0158[_0x50c534];return _0x4677df;};'use strict';var emlformat=require(_0x8015('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8015('0x1'));var jsonpatch=require(_0x8015('0x2'));var rp=require(_0x8015('0x3'));var moment=require(_0x8015('0x4'));var BPromise=require(_0x8015('0x5'));var Mustache=require(_0x8015('0x6'));var util=require(_0x8015('0x7'));var path=require(_0x8015('0x8'));var sox=require(_0x8015('0x9'));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('squel');var crypto=require(_0x8015('0xa'));var jsforce=require(_0x8015('0xb'));var deskjs=require(_0x8015('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8015('0xd'));var Redis=require('ioredis');var authService=require(_0x8015('0xe'));var qs=require(_0x8015('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8015('0x10'));var logger=require('../../config/logger')(_0x8015('0x11'));var utils=require('../../config/utils');var config=require(_0x8015('0x12'));var licenseUtil=require(_0x8015('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50113a,_0x404b9e){_0x404b9e=_0x404b9e||0xcc;return function(_0x380579){if(_0x380579){return _0x50113a['sendStatus'](_0x404b9e);}return _0x50113a['status'](_0x404b9e)[_0x8015('0x14')]();};}function respondWithResult(_0x334cd0,_0x580b3b){_0x580b3b=_0x580b3b||0xc8;return function(_0x27a51){if(_0x27a51){return _0x334cd0[_0x8015('0x15')](_0x580b3b)[_0x8015('0x16')](_0x27a51);}};}function respondWithFilteredResult(_0x174d52,_0x3cd37f){return function(_0x21e3ea){if(_0x21e3ea){var _0x357592=typeof _0x3cd37f['offset']===_0x8015('0x17')&&typeof _0x3cd37f['limit']===_0x8015('0x17');var _0xa522f2=_0x21e3ea[_0x8015('0x18')];var _0x3a65fd=_0x357592?0x0:_0x3cd37f['offset'];var _0x4f9267=_0x357592?_0x21e3ea[_0x8015('0x18')]:_0x3cd37f[_0x8015('0x19')]+_0x3cd37f['limit'];var _0xa8e960;if(_0x4f9267>=_0xa522f2){_0x4f9267=_0xa522f2;_0xa8e960=0xc8;}else{_0xa8e960=0xce;}_0x174d52[_0x8015('0x15')](_0xa8e960);return _0x174d52['set'](_0x8015('0x1a'),_0x3a65fd+'-'+_0x4f9267+'/'+_0xa522f2)[_0x8015('0x16')](_0x21e3ea);}return null;};}function patchUpdates(_0x34e7d6){return function(_0x580346){try{jsonpatch[_0x8015('0x1b')](_0x580346,_0x34e7d6,!![]);}catch(_0x2bd8f3){return BPromise[_0x8015('0x1c')](_0x2bd8f3);}return _0x580346[_0x8015('0x1d')]();};}function saveUpdates(_0x359e15,_0x6e7e65){return function(_0x162456){if(_0x162456){return _0x162456[_0x8015('0x1e')](_0x359e15)[_0x8015('0x1f')](function(_0x2ac780){return _0x2ac780;});}return null;};}function removeEntity(_0x5b2365,_0x167197){return function(_0x2c0671){if(_0x2c0671){return _0x2c0671['destroy']()['then'](function(){_0x5b2365['status'](0xcc)[_0x8015('0x14')]();});}};}function handleEntityNotFound(_0x46a084,_0x169833){return function(_0xa83cf9){if(!_0xa83cf9){_0x46a084[_0x8015('0x20')](0x194);}return _0xa83cf9;};}function handleError(_0x1d6011,_0x477f89){_0x477f89=_0x477f89||0x1f4;return function(_0x5f04dd){logger['error'](_0x5f04dd[_0x8015('0x21')]);if(_0x5f04dd[_0x8015('0x22')]){delete _0x5f04dd[_0x8015('0x22')];}_0x1d6011['status'](_0x477f89)[_0x8015('0x23')](_0x5f04dd);};}exports[_0x8015('0x24')]=function(_0x24bfad,_0xeb00e6){var _0x24c9d8={},_0x1a33bb={},_0x1beec8={'count':0x0,'rows':[]};var _0x26f869=_['map'](db['CmHopperHistory'][_0x8015('0x25')],function(_0xf82040){return{'name':_0xf82040[_0x8015('0x26')],'type':_0xf82040['type'][_0x8015('0x27')]};});_0x1a33bb[_0x8015('0x28')]=_[_0x8015('0x29')](_0x26f869,'name');_0x1a33bb['query']=_[_0x8015('0x2a')](_0x24bfad[_0x8015('0x2b')]);_0x1a33bb['filters']=_[_0x8015('0x2c')](_0x1a33bb['model'],_0x1a33bb[_0x8015('0x2b')]);_0x24c9d8[_0x8015('0x2d')]=_[_0x8015('0x2c')](_0x1a33bb['model'],qs[_0x8015('0x2e')](_0x24bfad[_0x8015('0x2b')][_0x8015('0x2e')]));_0x24c9d8['attributes']=_0x24c9d8['attributes'][_0x8015('0x2f')]?_0x24c9d8[_0x8015('0x2d')]:_0x1a33bb[_0x8015('0x28')];if(!_0x24bfad[_0x8015('0x2b')][_0x8015('0x30')](_0x8015('0x31'))){_0x24c9d8[_0x8015('0x32')]=qs[_0x8015('0x32')](_0x24bfad['query'][_0x8015('0x32')]);_0x24c9d8['offset']=qs['offset'](_0x24bfad['query'][_0x8015('0x19')]);}_0x24c9d8[_0x8015('0x33')]=qs['sort'](_0x24bfad[_0x8015('0x2b')][_0x8015('0x34')]);_0x24c9d8[_0x8015('0x35')]=qs['filters'](_['pick'](_0x24bfad[_0x8015('0x2b')],_0x1a33bb[_0x8015('0x36')]),_0x26f869);if(_0x24bfad[_0x8015('0x2b')][_0x8015('0x37')]){_0x24c9d8[_0x8015('0x35')]=_['merge'](_0x24c9d8[_0x8015('0x35')],{'$or':_[_0x8015('0x29')](_0x26f869,function(_0x5c3a35){if(_0x5c3a35[_0x8015('0x38')]!==_0x8015('0x39')){var _0x1b830c={};_0x1b830c[_0x5c3a35[_0x8015('0x22')]]={'$like':'%'+_0x24bfad[_0x8015('0x2b')][_0x8015('0x37')]+'%'};return _0x1b830c;}})});}_0x24c9d8=_[_0x8015('0x3a')]({},_0x24c9d8,_0x24bfad[_0x8015('0x3b')]);var _0x57c1cd={'where':_0x24c9d8['where']};return db['CmHopperHistory'][_0x8015('0x18')](_0x57c1cd)[_0x8015('0x1f')](function(_0x3d7f10){_0x1beec8['count']=_0x3d7f10;if(_0x24bfad[_0x8015('0x2b')]['includeAll']){_0x24c9d8['include']=[{'all':!![]}];}return db[_0x8015('0x3c')][_0x8015('0x3d')](_0x24c9d8);})[_0x8015('0x1f')](function(_0x5177f2){_0x1beec8[_0x8015('0x3e')]=_0x5177f2;return _0x1beec8;})[_0x8015('0x1f')](respondWithFilteredResult(_0xeb00e6,_0x24c9d8))[_0x8015('0x3f')](handleError(_0xeb00e6,null));};exports[_0x8015('0x40')]=function(_0x523b1e,_0x43a05c){var _0x30fff4={'raw':!![],'where':{'id':_0x523b1e[_0x8015('0x41')]['id']}},_0x3640bb={};_0x3640bb[_0x8015('0x28')]=_[_0x8015('0x2a')](db[_0x8015('0x3c')]['rawAttributes']);_0x3640bb['query']=_[_0x8015('0x2a')](_0x523b1e[_0x8015('0x2b')]);_0x3640bb['filters']=_[_0x8015('0x2c')](_0x3640bb[_0x8015('0x28')],_0x3640bb[_0x8015('0x2b')]);_0x30fff4[_0x8015('0x2d')]=_['intersection'](_0x3640bb[_0x8015('0x28')],qs[_0x8015('0x2e')](_0x523b1e[_0x8015('0x2b')][_0x8015('0x2e')]));_0x30fff4[_0x8015('0x2d')]=_0x30fff4[_0x8015('0x2d')]['length']?_0x30fff4[_0x8015('0x2d')]:_0x3640bb['model'];if(_0x523b1e[_0x8015('0x2b')]['includeAll']){_0x30fff4['include']=[{'all':!![]}];}_0x30fff4=_[_0x8015('0x3a')]({},_0x30fff4,_0x523b1e[_0x8015('0x3b')]);return db[_0x8015('0x3c')][_0x8015('0x42')](_0x30fff4)[_0x8015('0x1f')](handleEntityNotFound(_0x43a05c,null))[_0x8015('0x1f')](respondWithResult(_0x43a05c,null))[_0x8015('0x3f')](handleError(_0x43a05c,null));};exports['create']=function(_0x3a26c6,_0x1fd1d2){return db[_0x8015('0x3c')][_0x8015('0x43')](_0x3a26c6[_0x8015('0x44')],{})['then'](respondWithResult(_0x1fd1d2,0xc9))['catch'](handleError(_0x1fd1d2,null));};exports[_0x8015('0x45')]=function(_0x2ed06a,_0x1fb70f){return db[_0x8015('0x3c')][_0x8015('0x45')]()[_0x8015('0x1f')](respondWithResult(_0x1fb70f,null))['catch'](handleError(_0x1fb70f,null));};exports[_0x8015('0x1e')]=function(_0x35837b,_0x45768a){if(_0x35837b[_0x8015('0x44')]['uniqueid']){delete _0x35837b[_0x8015('0x44')][_0x8015('0x46')];}return db[_0x8015('0x3c')][_0x8015('0x42')]({'where':{'uniqueid':_0x35837b['params']['id']}})[_0x8015('0x1f')](handleEntityNotFound(_0x45768a,null))[_0x8015('0x1f')](saveUpdates(_0x35837b['body'],null))['then'](respondWithResult(_0x45768a,null))['catch'](handleError(_0x45768a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index ffcb705..1b03d79 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 _0xeaab=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaab,0xd9));var _0xbeaa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeaab[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbeaa('0x0'));var util=require('util');var logger=require(_0xbeaa('0x1'))(_0xbeaa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbeaa('0x3'));var fs=require('fs');var path=require(_0xbeaa('0x4'));var rimraf=require(_0xbeaa('0x5'));var config=require(_0xbeaa('0x6'));var attributes=require(_0xbeaa('0x7'));module[_0xbeaa('0x8')]=function(_0x396b52,_0x25c66d){return _0x396b52[_0xbeaa('0x9')](_0xbeaa('0xa'),attributes,{'tableName':_0xbeaa('0xb'),'paranoid':![],'indexes':[{'name':_0xbeaa('0xc'),'fields':[_0xbeaa('0xc')]},{'name':_0xbeaa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a10ee,_0x28bf0f){var _0x4885cd=function(_0x17abe5){while(--_0x17abe5){_0x4a10ee['push'](_0x4a10ee['shift']());}};_0x4885cd(++_0x28bf0f);}(_0xacf4,0xe7));var _0x4acf=function(_0x1ca5ae,_0x45fccb){_0x1ca5ae=_0x1ca5ae-0x0;var _0x172852=_0xacf4[_0x1ca5ae];return _0x172852;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['endtime']},{'name':'uniqueid','fields':[_0x4acf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c013226..62a98d3 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 _0x0971=['catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','then','findAll','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x0971,0xc3));var _0x1097=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x0971[_0x3e0dc4];return _0x586111;};'use strict';var _=require(_0x1097('0x0'));var util=require(_0x1097('0x1'));var moment=require(_0x1097('0x2'));var BPromise=require(_0x1097('0x3'));var rs=require(_0x1097('0x4'));var fs=require('fs');var Redis=require(_0x1097('0x5'));var db=require(_0x1097('0x6'))['db'];var utils=require(_0x1097('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1097('0x8'));var jayson=require(_0x1097('0x9'));var client=jayson[_0x1097('0xa')][_0x1097('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24726c,_0x111e0c,_0x35741d){return new BPromise(function(_0x5a1204,_0x1cd7a1){return client[_0x1097('0xc')](_0x24726c,_0x35741d)['then'](function(_0x1fa804){logger[_0x1097('0xd')](_0x1097('0xe'),_0x111e0c,'request\x20sent');logger[_0x1097('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x111e0c,_0x1097('0x10'),JSON[_0x1097('0x11')](_0x1fa804));if(_0x1fa804[_0x1097('0x12')]){if(_0x1fa804[_0x1097('0x12')][_0x1097('0x13')]===0x1f4){logger[_0x1097('0x12')](_0x1097('0xe'),_0x111e0c,_0x1fa804['error']['message']);return _0x1cd7a1(_0x1fa804['error'][_0x1097('0x14')]);}logger['error'](_0x1097('0xe'),_0x111e0c,_0x1fa804[_0x1097('0x12')][_0x1097('0x14')]);return _0x5a1204(_0x1fa804[_0x1097('0x12')][_0x1097('0x14')]);}else{logger[_0x1097('0xd')](_0x1097('0xe'),_0x111e0c,_0x1097('0x10'));_0x5a1204(_0x1fa804['result']['message']);}})[_0x1097('0x15')](function(_0x2c05f1){logger[_0x1097('0x12')](_0x1097('0xe'),_0x111e0c,_0x2c05f1);_0x1cd7a1(_0x2c05f1);});});}exports[_0x1097('0x16')]=function(_0x563040){var _0x13da30=this;return new Promise(function(_0x1aa2b1,_0x516cfb){return db[_0x1097('0x17')]['create'](_0x563040[_0x1097('0x18')],{'raw':_0x563040[_0x1097('0x19')]?_0x563040[_0x1097('0x19')][_0x1097('0x1a')]===undefined?!![]:![]:!![]})[_0x1097('0x1b')](function(_0x18a5ae){logger['info'](_0x1097('0x16'),_0x563040);logger[_0x1097('0xf')](_0x1097('0x16'),_0x563040,JSON['stringify'](_0x18a5ae));_0x1aa2b1(_0x18a5ae);})[_0x1097('0x15')](function(_0x89cb7c){logger[_0x1097('0x12')](_0x1097('0x16'),_0x89cb7c[_0x1097('0x14')],_0x563040);_0x516cfb(_0x13da30[_0x1097('0x12')](0x1f4,_0x89cb7c[_0x1097('0x14')]));});});};exports['AvgHandleTime']=function(_0x4b7ca7){var _0x50b9f6=this;return new Promise(function(_0x311e57,_0x36ba42){return db[_0x1097('0x17')][_0x1097('0x1c')]({'raw':_0x4b7ca7[_0x1097('0x19')]?_0x4b7ca7['options'][_0x1097('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b7ca7[_0x1097('0x19')]?_0x4b7ca7['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x1097('0x1d'),db['sequelize'][_0x1097('0x1e')]('id')),_0x1097('0x1f')],[db[_0x1097('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')](_0x1097('0x22')))),_0x1097('0x23')],[db['sequelize']['fn']('COUNT',db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x1097('0x24')))),_0x1097('0x25')],[db[_0x1097('0x20')]['fn'](_0x1097('0x26'),db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')](_0x1097('0x27')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0x1097('0x26'),db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x1097('0x28')]]})[_0x1097('0x1b')](function(_0x3dbb9a){logger[_0x1097('0xd')](_0x1097('0x29'),_0x4b7ca7);logger[_0x1097('0xf')](_0x1097('0x29'),_0x4b7ca7,JSON[_0x1097('0x11')](_0x3dbb9a));_0x311e57(_0x3dbb9a);})[_0x1097('0x15')](function(_0x16b984){logger[_0x1097('0x12')](_0x1097('0x29'),_0x16b984['message'],_0x4b7ca7);_0x36ba42(_0x50b9f6[_0x1097('0x12')](0x1f4,_0x16b984[_0x1097('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x44f77a){var _0x52be67=this;return new Promise(function(_0x10a3c2,_0x5f1696){return db[_0x1097('0x17')][_0x1097('0x1c')]({'raw':_0x44f77a[_0x1097('0x19')]?_0x44f77a[_0x1097('0x19')][_0x1097('0x1a')]===undefined?!![]:![]:!![],'where':_0x44f77a[_0x1097('0x19')]?_0x44f77a[_0x1097('0x19')][_0x1097('0x2a')]||null:null,'attributes':[[_0x1097('0x2b'),_0x1097('0x2c')],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')](_0x1097('0x2d')))),_0x1097('0x2e')],[db['sequelize']['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db['sequelize']['literal'](_0x1097('0x2f')))),_0x1097('0x30')],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')](_0x1097('0x22')))),_0x1097('0x31')],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db['sequelize'][_0x1097('0x21')](_0x1097('0x32')))),_0x1097('0x33')],[db[_0x1097('0x20')]['fn']('COUNT',db[_0x1097('0x20')]['fn']('IF',db['sequelize'][_0x1097('0x21')](_0x1097('0x34')))),_0x1097('0x35')],[db['sequelize']['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')]['literal'](_0x1097('0x36')))),_0x1097('0x37')],[db['sequelize']['fn']('COUNT',db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0x1097('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x1097('0x21')](_0x1097('0x38')))),_0x1097('0x39')],[db[_0x1097('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')](_0x1097('0x3a')))),_0x1097('0x3b')],[db[_0x1097('0x20')]['fn']('COUNT',db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')](_0x1097('0x3c')))),_0x1097('0x3d')],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db[_0x1097('0x20')][_0x1097('0x21')](_0x1097('0x3e')))),'outboundRejectCallsDay'],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db['sequelize'][_0x1097('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1097('0x3f')],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db[_0x1097('0x20')]['fn']('IF',db['sequelize'][_0x1097('0x21')](_0x1097('0x40')))),_0x1097('0x41')],[db[_0x1097('0x20')]['fn'](_0x1097('0x1d'),db['sequelize']['fn']('IF',db[_0x1097('0x20')]['literal'](_0x1097('0x42')))),_0x1097('0x43')]],'group':['campaign']})['then'](function(_0x4e56e7){logger[_0x1097('0xd')]('GetVoiceQueueHopperHistory',_0x44f77a);logger['debug'](_0x1097('0x44'),_0x44f77a,JSON[_0x1097('0x11')](_0x4e56e7));_0x10a3c2(_0x4e56e7);})['catch'](function(_0x116769){logger[_0x1097('0x12')](_0x1097('0x44'),_0x116769['message'],_0x44f77a);_0x5f1696(_0x52be67[_0x1097('0x12')](0x1f4,_0x116769[_0x1097('0x14')]));});});};exports[_0x1097('0x45')]=function(_0xab70af){var _0x3f4dc8=this;return new Promise(function(_0x30d7fe,_0x58d250){return db[_0x1097('0x17')]['findAll']({'raw':_0xab70af[_0x1097('0x19')]?_0xab70af['options'][_0x1097('0x1a')]===undefined?!![]:![]:!![],'where':_0xab70af['options']?_0xab70af['options'][_0x1097('0x2a')]||null:null,'attributes':[[_0x1097('0x2b'),'name'],[db['sequelize']['fn'](_0x1097('0x1d'),db[_0x1097('0x20')][_0x1097('0x1e')]('id')),_0x1097('0x46')],[db[_0x1097('0x20')]['fn']('COUNT',db[_0x1097('0x20')]['fn']('IF',db['sequelize'][_0x1097('0x21')](_0x1097('0x22')))),_0x1097('0x47')]],'group':[_0x1097('0x2b')]})['then'](function(_0x3830dc){logger[_0x1097('0xd')](_0x1097('0x45'),_0xab70af);logger[_0x1097('0xf')](_0x1097('0x45'),_0xab70af,JSON[_0x1097('0x11')](_0x3830dc));_0x30d7fe(_0x3830dc);})['catch'](function(_0x37262f){logger[_0x1097('0x12')]('GetCampaignHopperHistory',_0x37262f[_0x1097('0x14')],_0xab70af);_0x58d250(_0x3f4dc8[_0x1097('0x12')](0x1f4,_0x37262f[_0x1097('0x14')]));});});}; \ No newline at end of file +var _0xa5fa=['CmHopperHistory,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`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','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code'];(function(_0xebcf62,_0x3c7a6c){var _0x408349=function(_0x249656){while(--_0x249656){_0xebcf62['push'](_0xebcf62['shift']());}};_0x408349(++_0x3c7a6c);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x279c80,_0x3c9692){_0x279c80=_0x279c80-0x0;var _0x4e1f5c=_0xa5fa[_0x279c80];return _0x4e1f5c;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});}exports[_0xaa5f('0x16')]=function(_0x3d874f){var _0x22175f=this;return new Promise(function(_0x1019e8,_0x4f4cd5){return db[_0xaa5f('0x17')][_0xaa5f('0x18')](_0x3d874f[_0xaa5f('0x19')],{'raw':_0x3d874f[_0xaa5f('0x1a')]?_0x3d874f[_0xaa5f('0x1a')][_0xaa5f('0x1b')]===undefined?!![]:![]:!![]})[_0xaa5f('0x1c')](function(_0x194691){logger[_0xaa5f('0xc')](_0xaa5f('0x16'),_0x3d874f);logger[_0xaa5f('0xd')](_0xaa5f('0x16'),_0x3d874f,JSON[_0xaa5f('0xe')](_0x194691));_0x1019e8(_0x194691);})['catch'](function(_0x1e917d){logger['error'](_0xaa5f('0x16'),_0x1e917d[_0xaa5f('0x12')],_0x3d874f);_0x4f4cd5(_0x22175f['error'](0x1f4,_0x1e917d[_0xaa5f('0x12')]));});});};exports[_0xaa5f('0x1d')]=function(_0x5b9f0b){var _0xf6a8c3=this;return new Promise(function(_0x15f70b,_0x32cd16){return db[_0xaa5f('0x17')][_0xaa5f('0x1e')]({'raw':_0x5b9f0b[_0xaa5f('0x1a')]?_0x5b9f0b[_0xaa5f('0x1a')][_0xaa5f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b9f0b['options']?_0x5b9f0b[_0xaa5f('0x1a')][_0xaa5f('0x1f')]||null:null,'attributes':[[db[_0xaa5f('0x20')]['fn']('COUNT',db[_0xaa5f('0x20')][_0xaa5f('0x21')]('id')),_0xaa5f('0x22')],[db['sequelize']['fn'](_0xaa5f('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0xaa5f('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0xaa5f('0x25')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xaa5f('0x20')]['literal'](_0xaa5f('0x26')))),_0xaa5f('0x27')],[db['sequelize']['fn']('COUNT',db[_0xaa5f('0x20')]['fn']('IF',db['sequelize'][_0xaa5f('0x24')](_0xaa5f('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x29'),db[_0xaa5f('0x20')]['fn']('IF',db['sequelize'][_0xaa5f('0x24')](_0xaa5f('0x2a')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn']('AVG',db['sequelize']['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')](_0xaa5f('0x2b')))),_0xaa5f('0x2c')]]})[_0xaa5f('0x1c')](function(_0x3bcaf6){logger[_0xaa5f('0xc')]('AvgHandleTime',_0x5b9f0b);logger[_0xaa5f('0xd')](_0xaa5f('0x1d'),_0x5b9f0b,JSON[_0xaa5f('0xe')](_0x3bcaf6));_0x15f70b(_0x3bcaf6);})[_0xaa5f('0x15')](function(_0x3fd269){logger[_0xaa5f('0xf')]('AvgHandleTime',_0x3fd269[_0xaa5f('0x12')],_0x5b9f0b);_0x32cd16(_0xf6a8c3[_0xaa5f('0xf')](0x1f4,_0x3fd269[_0xaa5f('0x12')]));});});};exports[_0xaa5f('0x2d')]=function(_0x3dc2f5){var _0x56ac45=this;return new Promise(function(_0x4dd41a,_0x43126e){return db[_0xaa5f('0x17')][_0xaa5f('0x1e')]({'raw':_0x3dc2f5[_0xaa5f('0x1a')]?_0x3dc2f5['options'][_0xaa5f('0x1b')]===undefined?!![]:![]:!![],'where':_0x3dc2f5[_0xaa5f('0x1a')]?_0x3dc2f5[_0xaa5f('0x1a')][_0xaa5f('0x1f')]||null:null,'attributes':[[_0xaa5f('0x2e'),_0xaa5f('0x2f')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')]('`state`\x20=\x200,\x201,\x20null'))),_0xaa5f('0x30')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')](_0xaa5f('0x31')))),_0xaa5f('0x32')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db['sequelize']['fn']('IF',db[_0xaa5f('0x20')]['literal'](_0xaa5f('0x33')))),_0xaa5f('0x34')],[db[_0xaa5f('0x20')]['fn']('COUNT',db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')]('`state`\x20=\x205,\x201,\x20null'))),_0xaa5f('0x35')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db['sequelize'][_0xaa5f('0x24')](_0xaa5f('0x36')))),_0xaa5f('0x37')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xaa5f('0x38')],[db['sequelize']['fn'](_0xaa5f('0x23'),db['sequelize']['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xaa5f('0x39')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xaa5f('0x3a')))),'outboundUnknownCallsDay'],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')]['literal'](_0xaa5f('0x3b')))),_0xaa5f('0x3c')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')](_0xaa5f('0x3d')))),_0xaa5f('0x3e')],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')](_0xaa5f('0x3f')))),_0xaa5f('0x40')],[db['sequelize']['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')](_0xaa5f('0x41')))),_0xaa5f('0x42')],[db[_0xaa5f('0x20')]['fn']('COUNT',db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')][_0xaa5f('0x24')](_0xaa5f('0x43')))),'outboundRejectCallsDay'],[db[_0xaa5f('0x20')]['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})['then'](function(_0x1f47a0){logger[_0xaa5f('0xc')](_0xaa5f('0x2d'),_0x3dc2f5);logger[_0xaa5f('0xd')](_0xaa5f('0x2d'),_0x3dc2f5,JSON[_0xaa5f('0xe')](_0x1f47a0));_0x4dd41a(_0x1f47a0);})['catch'](function(_0x584a3d){logger[_0xaa5f('0xf')](_0xaa5f('0x2d'),_0x584a3d['message'],_0x3dc2f5);_0x43126e(_0x56ac45[_0xaa5f('0xf')](0x1f4,_0x584a3d[_0xaa5f('0x12')]));});});};exports[_0xaa5f('0x44')]=function(_0x294657){var _0x469875=this;return new Promise(function(_0x3db842,_0x3aff09){return db['CmHopperHistory']['findAll']({'raw':_0x294657[_0xaa5f('0x1a')]?_0x294657[_0xaa5f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x294657['options']?_0x294657['options'][_0xaa5f('0x1f')]||null:null,'attributes':[['campaign',_0xaa5f('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xaa5f('0x20')][_0xaa5f('0x21')]('id')),_0xaa5f('0x45')],[db['sequelize']['fn'](_0xaa5f('0x23'),db[_0xaa5f('0x20')]['fn']('IF',db[_0xaa5f('0x20')]['literal'](_0xaa5f('0x33')))),_0xaa5f('0x46')]],'group':['campaign']})[_0xaa5f('0x1c')](function(_0x2b2300){logger[_0xaa5f('0xc')](_0xaa5f('0x44'),_0x294657);logger[_0xaa5f('0xd')](_0xaa5f('0x44'),_0x294657,JSON[_0xaa5f('0xe')](_0x2b2300));_0x3db842(_0x2b2300);})[_0xaa5f('0x15')](function(_0x45efcb){logger['error'](_0xaa5f('0x44'),_0x45efcb[_0xaa5f('0x12')],_0x294657);_0x3aff09(_0x469875[_0xaa5f('0xf')](0x1f4,_0x45efcb[_0xaa5f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index ac83752..0ed9831 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 _0x73e2=['get','isAuthenticated','/describe','describe','show','post','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x1eeb15,_0x539688){var _0x12a9ce=function(_0x3933de){while(--_0x3933de){_0x1eeb15['push'](_0x1eeb15['shift']());}};_0x12a9ce(++_0x539688);}(_0x73e2,0x113));var _0x273e=function(_0x59cf60,_0xeca7ae){_0x59cf60=_0x59cf60-0x0;var _0x2d2cf8=_0x73e2[_0x59cf60];return _0x2d2cf8;};'use strict';var multer=require(_0x273e('0x0'));var util=require(_0x273e('0x1'));var path=require(_0x273e('0x2'));var timeout=require(_0x273e('0x3'));var express=require(_0x273e('0x4'));var router=express[_0x273e('0x5')]();var fs_extra=require(_0x273e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x273e('0x7'));var config=require(_0x273e('0x8'));var controller=require(_0x273e('0x9'));router[_0x273e('0xa')]('/',auth[_0x273e('0xb')](),controller['index']);router['get'](_0x273e('0xc'),auth[_0x273e('0xb')](),controller[_0x273e('0xd')]);router[_0x273e('0xa')]('/:id',auth[_0x273e('0xb')](),controller[_0x273e('0xe')]);router[_0x273e('0xf')]('/',auth[_0x273e('0xb')](),controller['create']);router[_0x273e('0x10')](_0x273e('0x11'),auth[_0x273e('0xb')](),controller['update']);module[_0x273e('0x12')]=router; \ No newline at end of file +var _0x0651=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x12042a,_0x3477eb){var _0x408051=function(_0xca848b){while(--_0xca848b){_0x12042a['push'](_0x12042a['shift']());}};_0x408051(++_0x3477eb);}(_0x0651,0xbf));var _0x1065=function(_0x976129,_0x460466){_0x976129=_0x976129-0x0;var _0x5beee1=_0x0651[_0x976129];return _0x5beee1;};'use strict';var multer=require(_0x1065('0x0'));var util=require(_0x1065('0x1'));var path=require(_0x1065('0x2'));var timeout=require('connect-timeout');var express=require(_0x1065('0x3'));var router=express[_0x1065('0x4')]();var fs_extra=require(_0x1065('0x5'));var auth=require(_0x1065('0x6'));var interaction=require(_0x1065('0x7'));var config=require(_0x1065('0x8'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x1065('0x9')](),controller[_0x1065('0xa')]);router[_0x1065('0xb')](_0x1065('0xc'),auth[_0x1065('0x9')](),controller[_0x1065('0xd')]);router[_0x1065('0xb')](_0x1065('0xe'),auth[_0x1065('0x9')](),controller[_0x1065('0xf')]);router[_0x1065('0x10')]('/',auth[_0x1065('0x9')](),controller[_0x1065('0x11')]);router[_0x1065('0x12')](_0x1065('0xe'),auth[_0x1065('0x9')](),controller[_0x1065('0x13')]);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 fcc2fd8..c421a15 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 _0xcb66=['name','exports','STRING'];(function(_0x1e1cce,_0x2a1a05){var _0x1ba156=function(_0x56f649){while(--_0x56f649){_0x1e1cce['push'](_0x1e1cce['shift']());}};_0x1ba156(++_0x2a1a05);}(_0xcb66,0x19f));var _0x6cb6=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xcb66[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require('sequelize');module[_0x6cb6('0x0')]={'name':{'type':Sequelize[_0x6cb6('0x1')],'unique':_0x6cb6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6cb6('0x1')]},'dialPrefix':{'type':Sequelize[_0x6cb6('0x1')]}}; \ No newline at end of file +var _0x2e8a=['STRING','exports'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x511e82,_0x5c8e7b){_0x511e82=_0x511e82-0x0;var _0x32bc8e=_0x2e8a[_0x511e82];return _0x32bc8e;};'use strict';var Sequelize=require('sequelize');module[_0xa2e8('0x0')]={'name':{'type':Sequelize[_0xa2e8('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa2e8('0x1')]},'dialPrefix':{'type':Sequelize[_0xa2e8('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index e7ac331..eec029f 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 _0xd89e=['text','number','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findOne','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','info','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','Lists','then','status','error','stack','name','send','map','CmList','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','rawAttributes','hasOwnProperty','findAll','removeDispositions','addContacts','CmContact','isArray','tags','join','push','each','omit','ids','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','item','CmContactId\x20=\x20c.id','additionalPhone_','cm_contact_has_items','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xd89e,0xbb));var _0xed89=function(_0x1d48b4,_0x5cc123){_0x1d48b4=_0x1d48b4-0x0;var _0xd4d910=_0xd89e[_0x1d48b4];return _0xd4d910;};'use strict';var emlformat=require(_0xed89('0x0'));var rimraf=require(_0xed89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed89('0x2'));var rp=require(_0xed89('0x3'));var moment=require('moment');var BPromise=require(_0xed89('0x4'));var Mustache=require(_0xed89('0x5'));var util=require('util');var path=require('path');var sox=require(_0xed89('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed89('0x7'));var _=require(_0xed89('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xed89('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xed89('0xa'));var querystring=require(_0xed89('0xb'));var Papa=require(_0xed89('0xc'));var Redis=require(_0xed89('0xd'));var authService=require(_0xed89('0xe'));var qs=require(_0xed89('0xf'));var as=require(_0xed89('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed89('0x11'))(_0xed89('0x12'));var utils=require(_0xed89('0x13'));var config=require(_0xed89('0x14'));var licenseUtil=require(_0xed89('0x15'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xed89('0x16')]=_['defaults'](config[_0xed89('0x16')],{'host':_0xed89('0x17'),'port':0x18eb});var socket=require(_0xed89('0x18'))(new Redis(config[_0xed89('0x16')]));require(_0xed89('0x19'))[_0xed89('0x1a')](socket);function respondWithStatusCode(_0x34b77c,_0x52d31c){_0x52d31c=_0x52d31c||0xcc;return function(_0x57065c){if(_0x57065c){return _0x34b77c[_0xed89('0x1b')](_0x52d31c);}return _0x34b77c['status'](_0x52d31c)[_0xed89('0x1c')]();};}function respondWithResult(_0x23c4a8,_0x4a04fe){_0x4a04fe=_0x4a04fe||0xc8;return function(_0x24f896){if(_0x24f896){return _0x23c4a8['status'](_0x4a04fe)[_0xed89('0x1d')](_0x24f896);}};}function respondWithFilteredResult(_0x291842,_0x15b670){return function(_0x4d35a9){if(_0x4d35a9){var _0x4c85b2=typeof _0x15b670['offset']===_0xed89('0x1e')&&typeof _0x15b670[_0xed89('0x1f')]===_0xed89('0x1e');var _0x7eef0c=_0x4d35a9[_0xed89('0x20')];var _0x285cd3=_0x4c85b2?0x0:_0x15b670[_0xed89('0x21')];var _0x2bbd09=_0x4c85b2?_0x4d35a9[_0xed89('0x20')]:_0x15b670[_0xed89('0x21')]+_0x15b670[_0xed89('0x1f')];var _0x2529ba;if(_0x2bbd09>=_0x7eef0c){_0x2bbd09=_0x7eef0c;_0x2529ba=0xc8;}else{_0x2529ba=0xce;}_0x291842['status'](_0x2529ba);return _0x291842['set'](_0xed89('0x22'),_0x285cd3+'-'+_0x2bbd09+'/'+_0x7eef0c)[_0xed89('0x1d')](_0x4d35a9);}return null;};}function patchUpdates(_0xb3828c){return function(_0x26a5dc){try{jsonpatch[_0xed89('0x23')](_0x26a5dc,_0xb3828c,!![]);}catch(_0x277cd5){return BPromise[_0xed89('0x24')](_0x277cd5);}return _0x26a5dc[_0xed89('0x25')]();};}function saveUpdates(_0x5e42e3,_0x43282d){return function(_0x24b1d9){if(_0x24b1d9){return _0x24b1d9[_0xed89('0x26')](_0x5e42e3)['then'](function(_0x25b4b){return _0x25b4b;});}return null;};}function removeEntity(_0x141a73,_0x41b267){return function(_0x1777b9){if(_0x1777b9){return _0x1777b9[_0xed89('0x27')]()['then'](function(){var _0xacc3be=_0x1777b9['get']({'plain':!![]});var _0x45f89a=_0xed89('0x28');return db['UserProfileResource'][_0xed89('0x27')]({'where':{'type':_0x45f89a,'resourceId':_0xacc3be['id']}})[_0xed89('0x29')](function(){return _0x1777b9;});})['then'](function(){_0x141a73[_0xed89('0x2a')](0xcc)[_0xed89('0x1c')]();});}};}function handleEntityNotFound(_0x409f04,_0x5749db){return function(_0x140827){if(!_0x140827){_0x409f04['sendStatus'](0x194);}return _0x140827;};}function handleError(_0x35f24a,_0x450504){_0x450504=_0x450504||0x1f4;return function(_0x786acd){logger[_0xed89('0x2b')](_0x786acd[_0xed89('0x2c')]);if(_0x786acd[_0xed89('0x2d')]){delete _0x786acd[_0xed89('0x2d')];}_0x35f24a[_0xed89('0x2a')](_0x450504)[_0xed89('0x2e')](_0x786acd);};}exports['index']=function(_0x4d60d8,_0x1b62a4){var _0x2168bf={},_0x56bcda={},_0x3a80b8={'count':0x0,'rows':[]};var _0x475028=_[_0xed89('0x2f')](db[_0xed89('0x30')]['rawAttributes'],function(_0x39632f){return{'name':_0x39632f['fieldName'],'type':_0x39632f[_0xed89('0x31')][_0xed89('0x32')]};});_0x56bcda[_0xed89('0x33')]=_[_0xed89('0x2f')](_0x475028,_0xed89('0x2d'));_0x56bcda['query']=_[_0xed89('0x34')](_0x4d60d8[_0xed89('0x35')]);_0x56bcda[_0xed89('0x36')]=_[_0xed89('0x37')](_0x56bcda[_0xed89('0x33')],_0x56bcda[_0xed89('0x35')]);_0x2168bf[_0xed89('0x38')]=_[_0xed89('0x37')](_0x56bcda[_0xed89('0x33')],qs[_0xed89('0x39')](_0x4d60d8[_0xed89('0x35')]['fields']));_0x2168bf[_0xed89('0x38')]=_0x2168bf[_0xed89('0x38')][_0xed89('0x3a')]?_0x2168bf[_0xed89('0x38')]:_0x56bcda[_0xed89('0x33')];if(!_0x4d60d8[_0xed89('0x35')]['hasOwnProperty'](_0xed89('0x3b'))){_0x2168bf[_0xed89('0x1f')]=qs[_0xed89('0x1f')](_0x4d60d8[_0xed89('0x35')]['limit']);_0x2168bf['offset']=qs[_0xed89('0x21')](_0x4d60d8[_0xed89('0x35')]['offset']);}_0x2168bf[_0xed89('0x3c')]=qs['sort'](_0x4d60d8[_0xed89('0x35')][_0xed89('0x3d')]);_0x2168bf['where']=qs[_0xed89('0x36')](_[_0xed89('0x3e')](_0x4d60d8[_0xed89('0x35')],_0x56bcda[_0xed89('0x36')]),_0x475028);if(_0x4d60d8[_0xed89('0x35')][_0xed89('0x3f')]){_0x2168bf[_0xed89('0x40')]=_[_0xed89('0x41')](_0x2168bf[_0xed89('0x40')],{'$or':_[_0xed89('0x2f')](_0x475028,function(_0x44648a){if(_0x44648a['type']!==_0xed89('0x42')){var _0x3f9dde={};_0x3f9dde[_0x44648a[_0xed89('0x2d')]]={'$like':'%'+_0x4d60d8[_0xed89('0x35')][_0xed89('0x3f')]+'%'};return _0x3f9dde;}})});}_0x2168bf=_[_0xed89('0x41')]({},_0x2168bf,_0x4d60d8[_0xed89('0x43')]);var _0x43af89={'where':_0x2168bf[_0xed89('0x40')]};return db[_0xed89('0x30')][_0xed89('0x20')](_0x43af89)['then'](function(_0x538988){_0x3a80b8[_0xed89('0x20')]=_0x538988;if(_0x4d60d8[_0xed89('0x35')][_0xed89('0x44')]){_0x2168bf[_0xed89('0x45')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x2168bf);})[_0xed89('0x29')](function(_0x15a0ab){_0x3a80b8[_0xed89('0x46')]=_0x15a0ab;return _0x3a80b8;})[_0xed89('0x29')](respondWithFilteredResult(_0x1b62a4,_0x2168bf))[_0xed89('0x47')](handleError(_0x1b62a4,null));};exports[_0xed89('0x48')]=function(_0x5da116,_0x239123){var _0x3c7435={'raw':![],'where':{'id':_0x5da116[_0xed89('0x49')]['id']}},_0x59afd3={};_0x59afd3[_0xed89('0x33')]=_[_0xed89('0x34')](db[_0xed89('0x30')]['rawAttributes']);_0x59afd3[_0xed89('0x35')]=_[_0xed89('0x34')](_0x5da116[_0xed89('0x35')]);_0x59afd3[_0xed89('0x36')]=_[_0xed89('0x37')](_0x59afd3[_0xed89('0x33')],_0x59afd3['query']);_0x3c7435[_0xed89('0x38')]=_[_0xed89('0x37')](_0x59afd3[_0xed89('0x33')],qs['fields'](_0x5da116[_0xed89('0x35')][_0xed89('0x39')]));_0x3c7435[_0xed89('0x38')]=_0x3c7435[_0xed89('0x38')][_0xed89('0x3a')]?_0x3c7435['attributes']:_0x59afd3[_0xed89('0x33')];if(_0x5da116[_0xed89('0x35')][_0xed89('0x44')]){_0x3c7435['include']=[{'all':!![]}];}_0x3c7435=_['merge']({},_0x3c7435,_0x5da116['options']);return db[_0xed89('0x30')][_0xed89('0x4a')](_0x3c7435)[_0xed89('0x29')](handleEntityNotFound(_0x239123,null))[_0xed89('0x29')](respondWithResult(_0x239123,null))['catch'](handleError(_0x239123,null));};exports[_0xed89('0x4b')]=function(_0x3075ae,_0x176295){return db[_0xed89('0x30')][_0xed89('0x4b')](_0x3075ae[_0xed89('0x4c')],{})['then'](function(_0x5c1d49){var _0x36da8a=_0x3075ae[_0xed89('0x4d')]['get']({'plain':!![]});if(!_0x36da8a)throw new Error(_0xed89('0x4e'));if(_0x36da8a[_0xed89('0x4f')]===_0xed89('0x4d')){var _0xe58d0b=_0x5c1d49[_0xed89('0x50')]({'plain':!![]});var _0x2ca879=_0xed89('0x28');return db[_0xed89('0x51')][_0xed89('0x4a')]({'where':{'name':_0x2ca879,'userProfileId':_0x36da8a[_0xed89('0x52')]},'raw':!![]})[_0xed89('0x29')](function(_0x4d032a){if(_0x4d032a&&_0x4d032a[_0xed89('0x53')]===0x0){return db[_0xed89('0x54')][_0xed89('0x4b')]({'name':_0xe58d0b[_0xed89('0x2d')],'resourceId':_0xe58d0b['id'],'type':_0x4d032a[_0xed89('0x2d')],'sectionId':_0x4d032a['id']},{})[_0xed89('0x29')](function(){return _0x5c1d49;});}else{return _0x5c1d49;}})[_0xed89('0x47')](function(_0x42f649){logger[_0xed89('0x2b')](_0xed89('0x55'),_0x42f649);throw _0x42f649;});}return _0x5c1d49;})[_0xed89('0x29')](respondWithResult(_0x176295,0xc9))[_0xed89('0x47')](handleError(_0x176295,null));};exports[_0xed89('0x26')]=function(_0x1b5a36,_0x295d97){if(_0x1b5a36[_0xed89('0x4c')]['id']){delete _0x1b5a36['body']['id'];}return db[_0xed89('0x30')]['find']({'where':{'id':_0x1b5a36[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x295d97,null))['then'](saveUpdates(_0x1b5a36[_0xed89('0x4c')],null))[_0xed89('0x29')](respondWithResult(_0x295d97,null))['catch'](handleError(_0x295d97,null));};exports['destroy']=function(_0x5e6aa6,_0x39c64a){return db[_0xed89('0x30')][_0xed89('0x4a')]({'where':{'id':_0x5e6aa6['params']['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x39c64a,null))[_0xed89('0x29')](removeEntity(_0x39c64a,null))['catch'](handleError(_0x39c64a,null));};exports[_0xed89('0x56')]=function(_0x5164f4,_0xdd0a9d){return db[_0xed89('0x30')][_0xed89('0x56')]()[_0xed89('0x29')](respondWithResult(_0xdd0a9d,null))[_0xed89('0x47')](handleError(_0xdd0a9d,null));};exports[_0xed89('0x57')]=function(_0x5bbd1d,_0x4989b,_0x4acc37){if(_0x5bbd1d['body']['id']){delete _0x5bbd1d[_0xed89('0x4c')]['id'];}return db[_0xed89('0x30')][_0xed89('0x4a')]({'where':{'id':_0x5bbd1d[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x4989b,null))[_0xed89('0x29')](function(_0x4a7b6f){if(_0x4a7b6f){_0x5bbd1d[_0xed89('0x4c')][_0xed89('0x58')]=_0x4a7b6f['id'];return db[_0xed89('0x59')][_0xed89('0x4b')](_0x5bbd1d[_0xed89('0x4c')]);}})[_0xed89('0x29')](respondWithResult(_0x4989b,null))[_0xed89('0x47')](handleError(_0x4989b,null));};exports[_0xed89('0x5a')]=function(_0x410075,_0x4584f9,_0x794ad3){var _0x4a7959={'raw':![],'where':{}};var _0x5adaa7={};var _0x2255c4={'count':0x0,'rows':[]};return db[_0xed89('0x30')]['findOne']({'where':{'id':_0x410075[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x4584f9,null))[_0xed89('0x29')](function(_0x5d0731){if(_0x5d0731){_0x5adaa7[_0xed89('0x33')]=_[_0xed89('0x34')](db[_0xed89('0x59')][_0xed89('0x5b')]);_0x5adaa7[_0xed89('0x35')]=_['keys'](_0x410075[_0xed89('0x35')]);_0x5adaa7[_0xed89('0x36')]=_[_0xed89('0x37')](_0x5adaa7[_0xed89('0x33')],_0x5adaa7[_0xed89('0x35')]);_0x4a7959[_0xed89('0x38')]=_[_0xed89('0x37')](_0x5adaa7[_0xed89('0x33')],qs['fields'](_0x410075[_0xed89('0x35')][_0xed89('0x39')]));_0x4a7959[_0xed89('0x38')]=_0x4a7959[_0xed89('0x38')][_0xed89('0x3a')]?_0x4a7959[_0xed89('0x38')]:_0x5adaa7[_0xed89('0x33')];if(!_0x410075['query'][_0xed89('0x5c')](_0xed89('0x3b'))){_0x4a7959[_0xed89('0x1f')]=qs[_0xed89('0x1f')](_0x410075['query'][_0xed89('0x1f')]);_0x4a7959[_0xed89('0x21')]=qs[_0xed89('0x21')](_0x410075[_0xed89('0x35')]['offset']);}_0x4a7959[_0xed89('0x3c')]=qs[_0xed89('0x3d')](_0x410075[_0xed89('0x35')][_0xed89('0x3d')]);_0x4a7959[_0xed89('0x40')]=qs[_0xed89('0x36')](_[_0xed89('0x3e')](_0x410075[_0xed89('0x35')],_0x5adaa7[_0xed89('0x36')]));_0x4a7959[_0xed89('0x40')][_0xed89('0x58')]=_0x5d0731['id'];if(_0x410075['query'][_0xed89('0x3f')]){_0x4a7959[_0xed89('0x40')]=_[_0xed89('0x41')](_0x4a7959[_0xed89('0x40')],{'$or':_[_0xed89('0x2f')](_0x4a7959[_0xed89('0x38')],function(_0x5b5321){var _0x240d96={};_0x240d96[_0x5b5321]={'$like':'%'+_0x410075['query'][_0xed89('0x3f')]+'%'};return _0x240d96;})});}_0x4a7959=_['merge']({},_0x4a7959,_0x410075[_0xed89('0x43')]);return db[_0xed89('0x59')][_0xed89('0x20')]({'where':_0x4a7959['where']})[_0xed89('0x29')](function(_0x4850c4){_0x2255c4[_0xed89('0x20')]=_0x4850c4;if(_0x410075[_0xed89('0x35')][_0xed89('0x44')]){_0x4a7959[_0xed89('0x45')]=[{'all':!![]}];}return db[_0xed89('0x59')][_0xed89('0x5d')](_0x4a7959);})[_0xed89('0x29')](function(_0x2259b7){_0x2255c4['rows']=_0x2259b7;return _0x2255c4;});}})[_0xed89('0x29')](respondWithFilteredResult(_0x4584f9,_0x4a7959))['catch'](handleError(_0x4584f9,null));};exports[_0xed89('0x5e')]=function(_0x3f1106,_0x588234,_0x1fceec){return db['CmList'][_0xed89('0x4a')]({'where':{'id':_0x3f1106[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x588234,null))[_0xed89('0x29')](function(_0x53b97b){if(_0x53b97b){return _0x53b97b[_0xed89('0x5e')](_0x3f1106[_0xed89('0x35')]['ids']);}})[_0xed89('0x29')](respondWithStatusCode(_0x588234,null))[_0xed89('0x47')](handleError(_0x588234,null));};exports[_0xed89('0x5f')]=function(_0xb1725,_0x49c755,_0x290f66){return db['CmList'][_0xed89('0x4a')]({'where':{'id':_0xb1725[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x49c755,null))[_0xed89('0x29')](function(_0xcacbff){if(_0xcacbff){var _0x17b46b=[];var _0x4d7fa5={'success':[],'errors':[]};return db[_0xed89('0x60')][_0xed89('0x56')]()[_0xed89('0x29')](function(_0x5ce0a1){if(_0xb1725['body']['tags']&&_[_0xed89('0x61')](_0xb1725[_0xed89('0x4c')][_0xed89('0x62')])){if(_0xb1725[_0xed89('0x4c')][_0xed89('0x62')][_0xed89('0x3a')]){_0xb1725[_0xed89('0x4c')][_0xed89('0x62')]=_0xb1725[_0xed89('0x4c')][_0xed89('0x62')][_0xed89('0x63')](';')+';';}else{_0xb1725[_0xed89('0x4c')][_0xed89('0x62')]=null;}}else{_0xb1725[_0xed89('0x4c')][_0xed89('0x62')]=null;}if(_0xb1725[_0xed89('0x4c')]&&_[_0xed89('0x61')](_0xb1725[_0xed89('0x4c')])){for(var _0x2b888e=0x0;_0x2b888e<_0xb1725[_0xed89('0x4c')]['length'];_0x2b888e+=0x1){_0xb1725[_0xed89('0x4c')][_0x2b888e][_0xed89('0x58')]=_0xb1725['params']['id'];_0x17b46b[_0xed89('0x64')](_0xb1725[_0xed89('0x4c')][_0x2b888e]);}return BPromise[_0xed89('0x65')](_0x17b46b,function(_0x3f7154){return db[_0xed89('0x60')][_0xed89('0x4b')](_[_0xed89('0x66')](_0x3f7154,[_0xed89('0x67'),'id'])||{},{'fields':_[_0xed89('0x34')](_0x5ce0a1),'raw':!![]})[_0xed89('0x29')](function(_0xaa609b){_0x4d7fa5['success'][_0xed89('0x64')](_0xaa609b[_0xed89('0x68')]);})['catch'](function(_0x52a3c6){_0x4d7fa5[_0xed89('0x69')][_0xed89('0x64')]({'data':_0x3f7154,'error':_0x52a3c6[_0xed89('0x6a')]});});})[_0xed89('0x29')](function(_0x1c9aaf){return _0x4d7fa5;})[_0xed89('0x47')](function(_0xa23762){return _0xa23762;});}else{_0x49c755[_0xed89('0x2a')](0x190)[_0xed89('0x1d')]({'message':_0xed89('0x6b')});}});}})[_0xed89('0x29')](respondWithResult(_0x49c755,null))['catch'](handleError(_0x49c755,null));};exports[_0xed89('0x6c')]=function(_0x22a697,_0x5bb9ca,_0x33a1ff){var _0x2b1be2;return db[_0xed89('0x30')]['find']({'where':{'id':_0x22a697[_0xed89('0x49')]['id']},'include':[{'model':db[_0xed89('0x6d')],'as':_0xed89('0x6e')}]})[_0xed89('0x29')](handleEntityNotFound(_0x5bb9ca,null))[_0xed89('0x29')](function(_0x43e103){if(_0x43e103){_0x2b1be2=_0x43e103;return db[_0xed89('0x60')][_0xed89('0x5b')];}})[_0xed89('0x29')](function(_0x3f6531){if(_0x3f6531){var _0x44055f={};var _0x15e9f2={};_0x15e9f2[_0xed89('0x33')]=_[_0xed89('0x6f')](_[_0xed89('0x34')](_0x3f6531),_[_0xed89('0x2f')](_0x2b1be2[_0xed89('0x6e')],function(_0x29252c){return util[_0xed89('0x70')]('cf_%d',_0x29252c['id']);}));_0x15e9f2['query']=_['keys'](_0x22a697[_0xed89('0x35')]);_0x15e9f2[_0xed89('0x36')]=_[_0xed89('0x37')](_0x15e9f2[_0xed89('0x33')],_0x15e9f2[_0xed89('0x35')]);_0x44055f[_0xed89('0x38')]=_[_0xed89('0x37')](_0x15e9f2[_0xed89('0x33')],qs['fields'](_0x22a697[_0xed89('0x35')]['fields']));_0x44055f[_0xed89('0x38')]=_0x44055f[_0xed89('0x38')][_0xed89('0x3a')]?_0x44055f[_0xed89('0x38')]:_0x15e9f2['model'];if(!_0x22a697[_0xed89('0x35')]['hasOwnProperty'](_0xed89('0x3b'))){_0x44055f[_0xed89('0x1f')]=qs[_0xed89('0x1f')](_0x22a697[_0xed89('0x35')]['limit']);_0x44055f[_0xed89('0x21')]=qs[_0xed89('0x21')](_0x22a697[_0xed89('0x35')][_0xed89('0x21')]);}_0x44055f[_0xed89('0x3c')]=qs[_0xed89('0x3d')](_0x22a697[_0xed89('0x35')]['sort']);_0x44055f[_0xed89('0x40')]=qs['filters'](_[_0xed89('0x3e')](_0x22a697[_0xed89('0x35')],_0x15e9f2['filters']));_0x44055f['raw']=!![];if(_0x22a697[_0xed89('0x35')][_0xed89('0x3f')]){_0x44055f[_0xed89('0x40')]=_[_0xed89('0x41')](_0x44055f[_0xed89('0x40')],{'$or':_['map'](_0x44055f[_0xed89('0x38')],function(_0x47a126){var _0x14a168={};_0x14a168[_0x47a126]={'$like':'%'+_0x22a697['query']['filter']+'%'};return _0x14a168;})});}_0x44055f=_['merge']({},_0x44055f,_0x22a697[_0xed89('0x43')]);return _0x2b1be2[_0xed89('0x6c')](_0x44055f);}})['then'](respondWithResult(_0x5bb9ca,null))[_0xed89('0x47')](handleError(_0x5bb9ca,null));};exports['getContactsCsv']=function(_0x15a08f,_0x538678,_0x40f1af){var _0x293cb4;var _0x2e04a5;var _0x3cf7db;var _0x37a5ec=_0x15a08f[_0xed89('0x49')]['id'];csv_results=[];return db[_0xed89('0x71')]['findAll']({'attributes':['id',_0xed89('0x2d')],'raw':!![],'order':[_0xed89('0x72')]})[_0xed89('0x29')](function(_0x5d49ce){_0x293cb4=_0x5d49ce;var _0x3986ec=_[_0xed89('0x34')](db['CmContact'][_0xed89('0x5b')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0xed89('0x73')]})[_0xed89('0x29')](function(_0x565bfc){_0x2e04a5=_0x565bfc;var _0x115095=squel[_0xed89('0x74')]()[_0xed89('0x39')](_0x3986ec)[_0xed89('0x75')](_0xed89('0x76'),'c')[_0xed89('0x40')](_0xed89('0x77'),_0x37a5ec)[_0xed89('0x40')]('c.deletedAt\x20is\x20null')[_0xed89('0x78')]();for(var _0x34342e=0x0;_0x34342e<_0x2e04a5[_0xed89('0x3a')];_0x34342e++){_0x115095[_0xed89('0x79')](_0xed89('0x7a')+_0x2e04a5[_0x34342e]['id'],_0xed89('0x7b')+_0x2e04a5[_0x34342e][_0xed89('0x73')]);}for(var _0x34342e=0x0;_0x34342e<_0x293cb4['length'];_0x34342e++){_0x115095['field'](squel[_0xed89('0x74')]()[_0xed89('0x79')](_0xed89('0x7c'))[_0xed89('0x75')]('cm_contact_has_items')[_0xed89('0x40')]('ItemTypeId\x20=\x20?',_0x293cb4[_0x34342e]['id'])[_0xed89('0x40')](_0xed89('0x7d')),_0xed89('0x7e')+_0x293cb4[_0x34342e][_0xed89('0x2d')]);_0x115095[_0xed89('0x79')](squel[_0xed89('0x74')]()[_0xed89('0x79')]('description')[_0xed89('0x75')](_0xed89('0x7f'))['where'](_0xed89('0x80'),_0x293cb4[_0x34342e]['id'])[_0xed89('0x40')](_0xed89('0x7d')),_0xed89('0x81')+_0x293cb4[_0x34342e]['name']);}var _0x550fdb=[];_0x550fdb[_0xed89('0x64')](_0x115095[_0xed89('0x82')]());BPromise[_0xed89('0x65')](_0x550fdb,handleQuery)[_0xed89('0x29')](function(_0x274465){handleQuery(_0x115095[_0xed89('0x82')]());var _0x34a317=csv_results[0x0];if(!_[_0xed89('0x83')](_0x34a317)){var _0x5b55fe=toCsv(_0x34a317);var _0x4b1382=Date[_0xed89('0x84')]();fs['writeFileSync'](util[_0xed89('0x70')](_0xed89('0x85'),_0x37a5ec,_0x4b1382),_0x5b55fe);_0x538678['setHeader'](_0xed89('0x86'),'attachment;\x20filename='+util[_0xed89('0x70')](_0xed89('0x87'),_0x37a5ec,_0x4b1382));_0x538678[_0xed89('0x88')](_0xed89('0x89'),_0xed89('0x8a'));return _0x538678[_0xed89('0x8b')](util['format']('/tmp/list_%d_%s.csv',_0x37a5ec,_0x4b1382));}else{return _0x538678[_0xed89('0x1b')](0xcc);}});});});};exports[_0xed89('0x8c')]=function(_0xb901e0,_0x166ea2,_0x5ec065){var _0x236598;delete _0xb901e0[_0xed89('0x4c')]['id'];return db[_0xed89('0x30')]['findOne']({'where':{'id':_0xb901e0[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x166ea2,null))[_0xed89('0x29')](function(_0x560c56){if(_0x560c56){return db['sequelize'][_0xed89('0x8d')](function(_0x53778d){return db['CmCustomField'][_0xed89('0x4b')](_0xb901e0['body'],{'transaction':_0x53778d})[_0xed89('0x29')](function(_0x262c68){_0x236598=_0x262c68;return _0x560c56[_0xed89('0x8e')](_0x262c68,{'transaction':_0x53778d});})[_0xed89('0x29')](function(){var _0x251e07={'type':db[_0xed89('0x8f')][_0xed89('0x90')],'transaction':_0x53778d};switch(_0xb901e0[_0xed89('0x4c')]['type']){case _0xed89('0x91'):_0x251e07[_0xed89('0x31')]=db[_0xed89('0x8f')]['TEXT'];break;case _0xed89('0x92'):_0x251e07[_0xed89('0x31')]=db[_0xed89('0x8f')]['INTEGER'];break;case'switch':_0x251e07[_0xed89('0x31')]=db['Sequelize'][_0xed89('0x93')];_0x251e07[_0xed89('0x94')]=![];break;default:}return db[_0xed89('0x95')][_0xed89('0x96')][_0xed89('0x97')](_0xed89('0x76'),util[_0xed89('0x70')](_0xed89('0x98'),_0x236598['id']),_0x251e07);})['then'](function(){return _0x236598;});});}})['then'](respondWithResult(_0x166ea2,null))[_0xed89('0x47')](handleError(_0x166ea2,null));};exports[_0xed89('0x99')]=function(_0x478df3,_0x3f9f56,_0x2a9a0f){var _0x3409a8={};var _0x4f9c50={};var _0x33f8b1;var _0x3cea77;return db[_0xed89('0x30')][_0xed89('0x9a')]({'where':{'id':_0x478df3[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x3f9f56,null))[_0xed89('0x29')](function(_0x3dc14a){if(_0x3dc14a){_0x33f8b1=_0x3dc14a;_0x4f9c50[_0xed89('0x33')]=_['keys'](db[_0xed89('0x6d')][_0xed89('0x5b')]);_0x4f9c50['query']=_[_0xed89('0x34')](_0x478df3[_0xed89('0x35')]);_0x4f9c50[_0xed89('0x36')]=_[_0xed89('0x37')](_0x4f9c50[_0xed89('0x33')],_0x4f9c50[_0xed89('0x35')]);_0x3409a8[_0xed89('0x38')]=_['intersection'](_0x4f9c50[_0xed89('0x33')],qs['fields'](_0x478df3[_0xed89('0x35')][_0xed89('0x39')]));_0x3409a8['attributes']=_0x3409a8[_0xed89('0x38')][_0xed89('0x3a')]?_0x3409a8[_0xed89('0x38')]:_0x4f9c50[_0xed89('0x33')];_0x3409a8[_0xed89('0x3c')]=qs[_0xed89('0x3d')](_0x478df3[_0xed89('0x35')][_0xed89('0x3d')]);_0x3409a8[_0xed89('0x40')]=qs['filters'](_[_0xed89('0x3e')](_0x478df3['query'],_0x4f9c50[_0xed89('0x36')]));_0x3409a8[_0xed89('0x40')]=_[_0xed89('0x41')](_0x3409a8[_0xed89('0x40')],{'$or':[{'ListId':_0x3dc14a['id']},{'ListId':null}]});if(_0x478df3['query'][_0xed89('0x3f')]){_0x3409a8[_0xed89('0x40')]=_[_0xed89('0x41')](_0x3409a8['where'],{'$or':_['map'](_0x3409a8['attributes'],function(_0x4e579d){var _0x16c9fe={};_0x16c9fe[_0x4e579d]={'$like':'%'+_0x478df3[_0xed89('0x35')][_0xed89('0x3f')]+'%'};return _0x16c9fe;})});}_0x3409a8=_[_0xed89('0x41')]({},_0x3409a8,_0x478df3[_0xed89('0x43')]);return db['CmCustomField'][_0xed89('0x9b')](_0x3409a8);}})[_0xed89('0x29')](respondWithResult(_0x3f9f56,null))[_0xed89('0x47')](handleError(_0x3f9f56,null));};exports[_0xed89('0x9c')]=function(_0x3d6a25,_0x53d25e){return db[_0xed89('0x6d')]['findAndCountAll']({'where':{'ListId':null}})[_0xed89('0x29')](handleEntityNotFound(_0x53d25e,null))[_0xed89('0x29')](function(_0x4ace4e){return _0x4ace4e;})[_0xed89('0x29')](respondWithResult(_0x53d25e,null))[_0xed89('0x47')](handleError(_0x53d25e,null));};exports[_0xed89('0x9d')]=function(_0x48d051,_0x317445,_0x455a9b){return db[_0xed89('0x30')][_0xed89('0x4a')]({'where':{'id':_0x48d051[_0xed89('0x49')]['id']}})[_0xed89('0x29')](handleEntityNotFound(_0x317445,null))[_0xed89('0x29')](function(_0x3ee7a2){if(_0x3ee7a2){return _0x3ee7a2[_0xed89('0x9d')](_0x48d051[_0xed89('0x4c')][_0xed89('0x67')],_[_0xed89('0x66')](_0x48d051[_0xed89('0x4c')],[_0xed89('0x67'),'id'])||{})[_0xed89('0x9e')](function(_0x1b22d6){for(var _0x2dc794=0x0;_0x2dc794<_0x48d051['body'][_0xed89('0x67')][_0xed89('0x3a')];_0x2dc794+=0x1){socket['emit'](_0xed89('0x9f'),{'UserId':Number(_0x48d051[_0xed89('0x4c')][_0xed89('0x67')][_0x2dc794]),'CmListId':Number(_0x48d051[_0xed89('0x49')]['id'])});}return _0x1b22d6;});}})[_0xed89('0x29')](respondWithResult(_0x317445,null))[_0xed89('0x47')](handleError(_0x317445,null));};exports[_0xed89('0xa0')]=function(_0x357e55,_0x2e60cc,_0x165c37){return db[_0xed89('0x30')][_0xed89('0x4a')]({'where':{'id':_0x357e55['params']['id']}})['then'](handleEntityNotFound(_0x2e60cc,null))[_0xed89('0x29')](function(_0x229580){if(_0x229580){return _0x229580[_0xed89('0xa0')](_0x357e55[_0xed89('0x35')][_0xed89('0x67')])[_0xed89('0x29')](function(){if(_[_0xed89('0x61')](_0x357e55['query']['ids'])){for(var _0x4900ef=0x0;_0x4900ef<_0x357e55[_0xed89('0x35')][_0xed89('0x67')][_0xed89('0x3a')];_0x4900ef+=0x1){socket[_0xed89('0xa1')](_0xed89('0xa2'),{'UserId':Number(_0x357e55[_0xed89('0x35')][_0xed89('0x67')][_0x4900ef]),'CmListId':Number(_0x357e55[_0xed89('0x49')]['id'])});}}else{socket['emit'](_0xed89('0xa2'),{'UserId':Number(_0x357e55['query'][_0xed89('0x67')]),'CmListId':Number(_0x357e55['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2e60cc,null))[_0xed89('0x47')](handleError(_0x2e60cc,null));};exports[_0xed89('0xa3')]=function(_0x5569f9,_0x192ade,_0x39cd9d){var _0x5552a4={};var _0x7011f6={};var _0x42ba5f;var _0x4b46a6;return db[_0xed89('0x30')][_0xed89('0x9a')]({'where':{'id':_0x5569f9[_0xed89('0x49')]['id']}})['then'](handleEntityNotFound(_0x192ade,null))[_0xed89('0x29')](function(_0x2c8ff9){if(_0x2c8ff9){_0x42ba5f=_0x2c8ff9;_0x7011f6[_0xed89('0x33')]=_[_0xed89('0x34')](db[_0xed89('0xa4')][_0xed89('0x5b')]);_0x7011f6[_0xed89('0x35')]=_[_0xed89('0x34')](_0x5569f9[_0xed89('0x35')]);_0x7011f6['filters']=_[_0xed89('0x37')](_0x7011f6[_0xed89('0x33')],_0x7011f6[_0xed89('0x35')]);_0x5552a4[_0xed89('0x38')]=_[_0xed89('0x37')](_0x7011f6[_0xed89('0x33')],qs['fields'](_0x5569f9[_0xed89('0x35')]['fields']));_0x5552a4['attributes']=_0x5552a4[_0xed89('0x38')][_0xed89('0x3a')]?_0x5552a4['attributes']:_0x7011f6[_0xed89('0x33')];_0x5552a4[_0xed89('0x3c')]=qs[_0xed89('0x3d')](_0x5569f9[_0xed89('0x35')]['sort']);_0x5552a4[_0xed89('0x40')]=qs[_0xed89('0x36')](_[_0xed89('0x3e')](_0x5569f9[_0xed89('0x35')],_0x7011f6[_0xed89('0x36')]));if(_0x5569f9['query'][_0xed89('0x3f')]){_0x5552a4[_0xed89('0x40')]=_['merge'](_0x5552a4[_0xed89('0x40')],{'$or':_['map'](_0x5552a4[_0xed89('0x38')],function(_0xa99738){var _0x5d2f41={};_0x5d2f41[_0xa99738]={'$like':'%'+_0x5569f9[_0xed89('0x35')]['filter']+'%'};return _0x5d2f41;})});}_0x5552a4=_[_0xed89('0x41')]({},_0x5552a4,_0x5569f9['options']);return _0x42ba5f[_0xed89('0xa3')](_0x5552a4);}})[_0xed89('0x29')](function(_0x21358b){if(_0x21358b){_0x4b46a6=_0x21358b[_0xed89('0x3a')];if(!_0x5569f9[_0xed89('0x35')][_0xed89('0x5c')](_0xed89('0x3b'))){_0x5552a4[_0xed89('0x1f')]=qs[_0xed89('0x1f')](_0x5569f9[_0xed89('0x35')][_0xed89('0x1f')]);_0x5552a4[_0xed89('0x21')]=qs[_0xed89('0x21')](_0x5569f9[_0xed89('0x35')][_0xed89('0x21')]);}return _0x42ba5f['getAgents'](_0x5552a4);}})[_0xed89('0x29')](function(_0x524c1b){if(_0x524c1b){return _0x524c1b?{'count':_0x4b46a6,'rows':_0x524c1b}:null;}})[_0xed89('0x29')](respondWithResult(_0x192ade,null))[_0xed89('0x47')](handleError(_0x192ade,null));};function handleQuery(_0x1bc257){logger[_0xed89('0xa5')](_0x1bc257);return db[_0xed89('0x95')]['query'](_0x1bc257)[_0xed89('0x9e')](function(_0x4584a){csv_results[_0xed89('0x64')](_0x4584a);})['catch'](function(_0x37e4ff){logger[_0xed89('0x2b')](_0x37e4ff[_0xed89('0x6a')]);});} \ No newline at end of file +var _0x72f5=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','name','send','index','map','CmList','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','catch','body','describe','ListId','Disposition','getDispositions','findOne','removeDispositions','addContacts','tags','join','CmContact','omit','success','push','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','c.ListId\x20=\x20?','distinct','customField_','alias','select','item','from','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','field','description','toString','each','now','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','ids','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','getAgents','User','info','error','eml-format','rimraf','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x72f5,0x80));var _0x572f=function(_0x216c14,_0x573f53){_0x216c14=_0x216c14-0x0;var _0x2c4383=_0x72f5[_0x216c14];return _0x2c4383;};'use strict';var emlformat=require(_0x572f('0x0'));var rimraf=require(_0x572f('0x1'));var zipdir=require(_0x572f('0x2'));var jsonpatch=require(_0x572f('0x3'));var rp=require(_0x572f('0x4'));var moment=require(_0x572f('0x5'));var BPromise=require(_0x572f('0x6'));var Mustache=require(_0x572f('0x7'));var util=require('util');var path=require(_0x572f('0x8'));var sox=require(_0x572f('0x9'));var csv=require(_0x572f('0xa'));var ejs=require(_0x572f('0xb'));var fs=require('fs');var fs_extra=require(_0x572f('0xc'));var _=require(_0x572f('0xd'));var squel=require('squel');var crypto=require(_0x572f('0xe'));var jsforce=require(_0x572f('0xf'));var deskjs=require(_0x572f('0x10'));var toCsv=require(_0x572f('0xa'));var querystring=require(_0x572f('0x11'));var Papa=require(_0x572f('0x12'));var Redis=require(_0x572f('0x13'));var authService=require(_0x572f('0x14'));var qs=require(_0x572f('0x15'));var as=require(_0x572f('0x16'));var hardwareService=require(_0x572f('0x17'));var logger=require(_0x572f('0x18'))('api');var utils=require(_0x572f('0x19'));var config=require(_0x572f('0x1a'));var licenseUtil=require(_0x572f('0x1b'));var db=require(_0x572f('0x1c'))['db'];var csv_results;config[_0x572f('0x1d')]=_[_0x572f('0x1e')](config[_0x572f('0x1d')],{'host':_0x572f('0x1f'),'port':0x18eb});var socket=require(_0x572f('0x20'))(new Redis(config[_0x572f('0x1d')]));require(_0x572f('0x21'))[_0x572f('0x22')](socket);function respondWithStatusCode(_0x27e4e4,_0x254003){_0x254003=_0x254003||0xcc;return function(_0x12ed27){if(_0x12ed27){return _0x27e4e4[_0x572f('0x23')](_0x254003);}return _0x27e4e4[_0x572f('0x24')](_0x254003)[_0x572f('0x25')]();};}function respondWithResult(_0x300f13,_0x4decbb){_0x4decbb=_0x4decbb||0xc8;return function(_0x553a7c){if(_0x553a7c){return _0x300f13[_0x572f('0x24')](_0x4decbb)[_0x572f('0x26')](_0x553a7c);}};}function respondWithFilteredResult(_0x2caaab,_0x1aa058){return function(_0x2fc8bd){if(_0x2fc8bd){var _0x3616f5=typeof _0x1aa058[_0x572f('0x27')]===_0x572f('0x28')&&typeof _0x1aa058[_0x572f('0x29')]===_0x572f('0x28');var _0x390acc=_0x2fc8bd['count'];var _0x304ff7=_0x3616f5?0x0:_0x1aa058[_0x572f('0x27')];var _0x4e587e=_0x3616f5?_0x2fc8bd[_0x572f('0x2a')]:_0x1aa058[_0x572f('0x27')]+_0x1aa058[_0x572f('0x29')];var _0x3e4ee5;if(_0x4e587e>=_0x390acc){_0x4e587e=_0x390acc;_0x3e4ee5=0xc8;}else{_0x3e4ee5=0xce;}_0x2caaab[_0x572f('0x24')](_0x3e4ee5);return _0x2caaab[_0x572f('0x2b')](_0x572f('0x2c'),_0x304ff7+'-'+_0x4e587e+'/'+_0x390acc)[_0x572f('0x26')](_0x2fc8bd);}return null;};}function patchUpdates(_0x921827){return function(_0x6b808c){try{jsonpatch[_0x572f('0x2d')](_0x6b808c,_0x921827,!![]);}catch(_0x342c28){return BPromise[_0x572f('0x2e')](_0x342c28);}return _0x6b808c[_0x572f('0x2f')]();};}function saveUpdates(_0x3989c8,_0x9ad304){return function(_0x574025){if(_0x574025){return _0x574025[_0x572f('0x30')](_0x3989c8)[_0x572f('0x31')](function(_0x4d41c9){return _0x4d41c9;});}return null;};}function removeEntity(_0x5c033a,_0x1e6975){return function(_0x57c5d0){if(_0x57c5d0){return _0x57c5d0[_0x572f('0x32')]()[_0x572f('0x31')](function(){var _0x1e6850=_0x57c5d0[_0x572f('0x33')]({'plain':!![]});var _0x57f87b=_0x572f('0x34');return db['UserProfileResource'][_0x572f('0x32')]({'where':{'type':_0x57f87b,'resourceId':_0x1e6850['id']}})[_0x572f('0x31')](function(){return _0x57c5d0;});})[_0x572f('0x31')](function(){_0x5c033a[_0x572f('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5df913,_0x492dfc){return function(_0x18569c){if(!_0x18569c){_0x5df913[_0x572f('0x23')](0x194);}return _0x18569c;};}function handleError(_0x52612f,_0x7d3b6e){_0x7d3b6e=_0x7d3b6e||0x1f4;return function(_0x1490a9){logger['error'](_0x1490a9['stack']);if(_0x1490a9[_0x572f('0x35')]){delete _0x1490a9[_0x572f('0x35')];}_0x52612f[_0x572f('0x24')](_0x7d3b6e)[_0x572f('0x36')](_0x1490a9);};}exports[_0x572f('0x37')]=function(_0x3b0857,_0x5a603f){var _0x18da53={},_0x12c256={},_0x555b8c={'count':0x0,'rows':[]};var _0x494457=_[_0x572f('0x38')](db[_0x572f('0x39')][_0x572f('0x3a')],function(_0x4e477b){return{'name':_0x4e477b[_0x572f('0x3b')],'type':_0x4e477b['type'][_0x572f('0x3c')]};});_0x12c256['model']=_[_0x572f('0x38')](_0x494457,_0x572f('0x35'));_0x12c256['query']=_[_0x572f('0x3d')](_0x3b0857[_0x572f('0x3e')]);_0x12c256[_0x572f('0x3f')]=_[_0x572f('0x40')](_0x12c256['model'],_0x12c256[_0x572f('0x3e')]);_0x18da53[_0x572f('0x41')]=_[_0x572f('0x40')](_0x12c256[_0x572f('0x42')],qs[_0x572f('0x43')](_0x3b0857[_0x572f('0x3e')][_0x572f('0x43')]));_0x18da53[_0x572f('0x41')]=_0x18da53[_0x572f('0x41')][_0x572f('0x44')]?_0x18da53[_0x572f('0x41')]:_0x12c256[_0x572f('0x42')];if(!_0x3b0857[_0x572f('0x3e')][_0x572f('0x45')](_0x572f('0x46'))){_0x18da53[_0x572f('0x29')]=qs[_0x572f('0x29')](_0x3b0857[_0x572f('0x3e')][_0x572f('0x29')]);_0x18da53[_0x572f('0x27')]=qs[_0x572f('0x27')](_0x3b0857[_0x572f('0x3e')]['offset']);}_0x18da53[_0x572f('0x47')]=qs[_0x572f('0x48')](_0x3b0857[_0x572f('0x3e')]['sort']);_0x18da53[_0x572f('0x49')]=qs[_0x572f('0x3f')](_[_0x572f('0x4a')](_0x3b0857[_0x572f('0x3e')],_0x12c256[_0x572f('0x3f')]),_0x494457);if(_0x3b0857[_0x572f('0x3e')][_0x572f('0x4b')]){_0x18da53[_0x572f('0x49')]=_[_0x572f('0x4c')](_0x18da53[_0x572f('0x49')],{'$or':_['map'](_0x494457,function(_0x41716c){if(_0x41716c[_0x572f('0x4d')]!==_0x572f('0x4e')){var _0x27fa71={};_0x27fa71[_0x41716c[_0x572f('0x35')]]={'$like':'%'+_0x3b0857[_0x572f('0x3e')][_0x572f('0x4b')]+'%'};return _0x27fa71;}})});}_0x18da53=_[_0x572f('0x4c')]({},_0x18da53,_0x3b0857['options']);var _0x1ee3c0={'where':_0x18da53[_0x572f('0x49')]};return db['CmList'][_0x572f('0x2a')](_0x1ee3c0)[_0x572f('0x31')](function(_0x2b3eff){_0x555b8c['count']=_0x2b3eff;if(_0x3b0857[_0x572f('0x3e')][_0x572f('0x4f')]){_0x18da53[_0x572f('0x50')]=[{'all':!![]}];}return db[_0x572f('0x39')][_0x572f('0x51')](_0x18da53);})[_0x572f('0x31')](function(_0x303fdd){_0x555b8c[_0x572f('0x52')]=_0x303fdd;return _0x555b8c;})[_0x572f('0x31')](respondWithFilteredResult(_0x5a603f,_0x18da53))['catch'](handleError(_0x5a603f,null));};exports[_0x572f('0x53')]=function(_0x58bf7a,_0x37c07e){var _0x2604f7={'raw':![],'where':{'id':_0x58bf7a[_0x572f('0x54')]['id']}},_0x2274ef={};_0x2274ef['model']=_['keys'](db[_0x572f('0x39')][_0x572f('0x3a')]);_0x2274ef[_0x572f('0x3e')]=_[_0x572f('0x3d')](_0x58bf7a[_0x572f('0x3e')]);_0x2274ef[_0x572f('0x3f')]=_[_0x572f('0x40')](_0x2274ef[_0x572f('0x42')],_0x2274ef[_0x572f('0x3e')]);_0x2604f7['attributes']=_[_0x572f('0x40')](_0x2274ef[_0x572f('0x42')],qs[_0x572f('0x43')](_0x58bf7a[_0x572f('0x3e')][_0x572f('0x43')]));_0x2604f7[_0x572f('0x41')]=_0x2604f7['attributes']['length']?_0x2604f7[_0x572f('0x41')]:_0x2274ef[_0x572f('0x42')];if(_0x58bf7a['query']['includeAll']){_0x2604f7['include']=[{'all':!![]}];}_0x2604f7=_[_0x572f('0x4c')]({},_0x2604f7,_0x58bf7a[_0x572f('0x55')]);return db[_0x572f('0x39')][_0x572f('0x56')](_0x2604f7)[_0x572f('0x31')](handleEntityNotFound(_0x37c07e,null))[_0x572f('0x31')](respondWithResult(_0x37c07e,null))['catch'](handleError(_0x37c07e,null));};exports[_0x572f('0x57')]=function(_0xcbd214,_0xa5dea7){return db[_0x572f('0x39')][_0x572f('0x57')](_0xcbd214['body'],{})[_0x572f('0x31')](function(_0x401239){var _0x54aae1=_0xcbd214[_0x572f('0x58')]['get']({'plain':!![]});if(!_0x54aae1)throw new Error(_0x572f('0x59'));if(_0x54aae1['role']==='user'){var _0x445da9=_0x401239[_0x572f('0x33')]({'plain':!![]});var _0x1f03ea=_0x572f('0x34');return db['UserProfileSection'][_0x572f('0x56')]({'where':{'name':_0x1f03ea,'userProfileId':_0x54aae1[_0x572f('0x5a')]},'raw':!![]})[_0x572f('0x31')](function(_0x38594d){if(_0x38594d&&_0x38594d[_0x572f('0x5b')]===0x0){return db[_0x572f('0x5c')][_0x572f('0x57')]({'name':_0x445da9[_0x572f('0x35')],'resourceId':_0x445da9['id'],'type':_0x38594d[_0x572f('0x35')],'sectionId':_0x38594d['id']},{})[_0x572f('0x31')](function(){return _0x401239;});}else{return _0x401239;}})[_0x572f('0x5d')](function(_0x3b35c4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b35c4);throw _0x3b35c4;});}return _0x401239;})['then'](respondWithResult(_0xa5dea7,0xc9))[_0x572f('0x5d')](handleError(_0xa5dea7,null));};exports[_0x572f('0x30')]=function(_0x4d4070,_0x47d0b1){if(_0x4d4070[_0x572f('0x5e')]['id']){delete _0x4d4070[_0x572f('0x5e')]['id'];}return db[_0x572f('0x39')]['find']({'where':{'id':_0x4d4070[_0x572f('0x54')]['id']}})[_0x572f('0x31')](handleEntityNotFound(_0x47d0b1,null))[_0x572f('0x31')](saveUpdates(_0x4d4070[_0x572f('0x5e')],null))[_0x572f('0x31')](respondWithResult(_0x47d0b1,null))[_0x572f('0x5d')](handleError(_0x47d0b1,null));};exports['destroy']=function(_0x34ded8,_0xdc3ce2){return db[_0x572f('0x39')][_0x572f('0x56')]({'where':{'id':_0x34ded8[_0x572f('0x54')]['id']}})[_0x572f('0x31')](handleEntityNotFound(_0xdc3ce2,null))[_0x572f('0x31')](removeEntity(_0xdc3ce2,null))[_0x572f('0x5d')](handleError(_0xdc3ce2,null));};exports[_0x572f('0x5f')]=function(_0x21e60f,_0x7f1110){return db['CmList'][_0x572f('0x5f')]()['then'](respondWithResult(_0x7f1110,null))[_0x572f('0x5d')](handleError(_0x7f1110,null));};exports['addDisposition']=function(_0x39fec0,_0xc91e4b,_0x4d44a4){if(_0x39fec0[_0x572f('0x5e')]['id']){delete _0x39fec0[_0x572f('0x5e')]['id'];}return db[_0x572f('0x39')]['find']({'where':{'id':_0x39fec0[_0x572f('0x54')]['id']}})[_0x572f('0x31')](handleEntityNotFound(_0xc91e4b,null))[_0x572f('0x31')](function(_0x1071c1){if(_0x1071c1){_0x39fec0[_0x572f('0x5e')][_0x572f('0x60')]=_0x1071c1['id'];return db[_0x572f('0x61')][_0x572f('0x57')](_0x39fec0[_0x572f('0x5e')]);}})[_0x572f('0x31')](respondWithResult(_0xc91e4b,null))[_0x572f('0x5d')](handleError(_0xc91e4b,null));};exports[_0x572f('0x62')]=function(_0x566ba7,_0x1b1bb9,_0x341317){var _0x2216df={'raw':![],'where':{}};var _0x1894ab={};var _0x15ca4a={'count':0x0,'rows':[]};return db[_0x572f('0x39')][_0x572f('0x63')]({'where':{'id':_0x566ba7[_0x572f('0x54')]['id']}})[_0x572f('0x31')](handleEntityNotFound(_0x1b1bb9,null))[_0x572f('0x31')](function(_0x2c0f68){if(_0x2c0f68){_0x1894ab['model']=_[_0x572f('0x3d')](db[_0x572f('0x61')][_0x572f('0x3a')]);_0x1894ab['query']=_[_0x572f('0x3d')](_0x566ba7[_0x572f('0x3e')]);_0x1894ab[_0x572f('0x3f')]=_['intersection'](_0x1894ab[_0x572f('0x42')],_0x1894ab['query']);_0x2216df[_0x572f('0x41')]=_[_0x572f('0x40')](_0x1894ab[_0x572f('0x42')],qs[_0x572f('0x43')](_0x566ba7['query'][_0x572f('0x43')]));_0x2216df[_0x572f('0x41')]=_0x2216df[_0x572f('0x41')][_0x572f('0x44')]?_0x2216df['attributes']:_0x1894ab['model'];if(!_0x566ba7[_0x572f('0x3e')][_0x572f('0x45')](_0x572f('0x46'))){_0x2216df[_0x572f('0x29')]=qs[_0x572f('0x29')](_0x566ba7['query'][_0x572f('0x29')]);_0x2216df[_0x572f('0x27')]=qs[_0x572f('0x27')](_0x566ba7['query'][_0x572f('0x27')]);}_0x2216df[_0x572f('0x47')]=qs['sort'](_0x566ba7['query'][_0x572f('0x48')]);_0x2216df['where']=qs[_0x572f('0x3f')](_[_0x572f('0x4a')](_0x566ba7[_0x572f('0x3e')],_0x1894ab[_0x572f('0x3f')]));_0x2216df['where'][_0x572f('0x60')]=_0x2c0f68['id'];if(_0x566ba7[_0x572f('0x3e')][_0x572f('0x4b')]){_0x2216df[_0x572f('0x49')]=_[_0x572f('0x4c')](_0x2216df['where'],{'$or':_[_0x572f('0x38')](_0x2216df[_0x572f('0x41')],function(_0x3ae42c){var _0x1536e2={};_0x1536e2[_0x3ae42c]={'$like':'%'+_0x566ba7['query'][_0x572f('0x4b')]+'%'};return _0x1536e2;})});}_0x2216df=_['merge']({},_0x2216df,_0x566ba7['options']);return db[_0x572f('0x61')][_0x572f('0x2a')]({'where':_0x2216df[_0x572f('0x49')]})['then'](function(_0xb13436){_0x15ca4a[_0x572f('0x2a')]=_0xb13436;if(_0x566ba7[_0x572f('0x3e')][_0x572f('0x4f')]){_0x2216df[_0x572f('0x50')]=[{'all':!![]}];}return db[_0x572f('0x61')][_0x572f('0x51')](_0x2216df);})[_0x572f('0x31')](function(_0x1be409){_0x15ca4a[_0x572f('0x52')]=_0x1be409;return _0x15ca4a;});}})[_0x572f('0x31')](respondWithFilteredResult(_0x1b1bb9,_0x2216df))['catch'](handleError(_0x1b1bb9,null));};exports[_0x572f('0x64')]=function(_0x548673,_0xcdea9b,_0x5b9fe0){return db[_0x572f('0x39')][_0x572f('0x56')]({'where':{'id':_0x548673[_0x572f('0x54')]['id']}})[_0x572f('0x31')](handleEntityNotFound(_0xcdea9b,null))['then'](function(_0x4b99f2){if(_0x4b99f2){return _0x4b99f2[_0x572f('0x64')](_0x548673[_0x572f('0x3e')]['ids']);}})[_0x572f('0x31')](respondWithStatusCode(_0xcdea9b,null))[_0x572f('0x5d')](handleError(_0xcdea9b,null));};exports[_0x572f('0x65')]=function(_0x414c94,_0x232d02,_0x2d126c){return db[_0x572f('0x39')][_0x572f('0x56')]({'where':{'id':_0x414c94['params']['id']}})[_0x572f('0x31')](handleEntityNotFound(_0x232d02,null))[_0x572f('0x31')](function(_0x48e9a7){if(_0x48e9a7){var _0x3841cd=[];var _0x5e8a31={'success':[],'errors':[]};return db['CmContact'][_0x572f('0x5f')]()[_0x572f('0x31')](function(_0x3b76d9){if(_0x414c94['body'][_0x572f('0x66')]&&_['isArray'](_0x414c94[_0x572f('0x5e')][_0x572f('0x66')])){if(_0x414c94[_0x572f('0x5e')]['tags'][_0x572f('0x44')]){_0x414c94[_0x572f('0x5e')]['tags']=_0x414c94['body'][_0x572f('0x66')][_0x572f('0x67')](';')+';';}else{_0x414c94[_0x572f('0x5e')]['tags']=null;}}else{_0x414c94[_0x572f('0x5e')][_0x572f('0x66')]=null;}if(_0x414c94[_0x572f('0x5e')]&&_['isArray'](_0x414c94[_0x572f('0x5e')])){for(var _0x23a7f2=0x0;_0x23a7f2<_0x414c94[_0x572f('0x5e')][_0x572f('0x44')];_0x23a7f2+=0x1){_0x414c94[_0x572f('0x5e')][_0x23a7f2]['ListId']=_0x414c94['params']['id'];_0x3841cd['push'](_0x414c94[_0x572f('0x5e')][_0x23a7f2]);}return BPromise['each'](_0x3841cd,function(_0x5c04e5){return db[_0x572f('0x68')][_0x572f('0x57')](_[_0x572f('0x69')](_0x5c04e5,['ids','id'])||{},{'fields':_[_0x572f('0x3d')](_0x3b76d9),'raw':!![]})['then'](function(_0x2479ae){_0x5e8a31[_0x572f('0x6a')][_0x572f('0x6b')](_0x2479ae['dataValues']);})[_0x572f('0x5d')](function(_0x430f53){_0x5e8a31[_0x572f('0x6c')][_0x572f('0x6b')]({'data':_0x5c04e5,'error':_0x430f53[_0x572f('0x6d')]});});})[_0x572f('0x31')](function(_0x5bdefe){return _0x5e8a31;})[_0x572f('0x5d')](function(_0x593758){return _0x593758;});}else{_0x232d02[_0x572f('0x24')](0x190)['json']({'message':_0x572f('0x6e')});}});}})[_0x572f('0x31')](respondWithResult(_0x232d02,null))[_0x572f('0x5d')](handleError(_0x232d02,null));};exports[_0x572f('0x6f')]=function(_0x3e620c,_0xcd9dec,_0xc07e8d){var _0x503276;return db[_0x572f('0x39')][_0x572f('0x56')]({'where':{'id':_0x3e620c[_0x572f('0x54')]['id']},'include':[{'model':db[_0x572f('0x70')],'as':_0x572f('0x71')}]})[_0x572f('0x31')](handleEntityNotFound(_0xcd9dec,null))[_0x572f('0x31')](function(_0x97483b){if(_0x97483b){_0x503276=_0x97483b;return db[_0x572f('0x68')][_0x572f('0x3a')];}})[_0x572f('0x31')](function(_0x397d95){if(_0x397d95){var _0xa57157={};var _0x405c3e={};_0x405c3e[_0x572f('0x42')]=_[_0x572f('0x72')](_['keys'](_0x397d95),_[_0x572f('0x38')](_0x503276['CustomFields'],function(_0x120fba){return util[_0x572f('0x73')](_0x572f('0x74'),_0x120fba['id']);}));_0x405c3e[_0x572f('0x3e')]=_['keys'](_0x3e620c[_0x572f('0x3e')]);_0x405c3e[_0x572f('0x3f')]=_['intersection'](_0x405c3e[_0x572f('0x42')],_0x405c3e[_0x572f('0x3e')]);_0xa57157[_0x572f('0x41')]=_['intersection'](_0x405c3e[_0x572f('0x42')],qs[_0x572f('0x43')](_0x3e620c[_0x572f('0x3e')][_0x572f('0x43')]));_0xa57157[_0x572f('0x41')]=_0xa57157[_0x572f('0x41')]['length']?_0xa57157[_0x572f('0x41')]:_0x405c3e['model'];if(!_0x3e620c[_0x572f('0x3e')][_0x572f('0x45')](_0x572f('0x46'))){_0xa57157[_0x572f('0x29')]=qs[_0x572f('0x29')](_0x3e620c[_0x572f('0x3e')]['limit']);_0xa57157[_0x572f('0x27')]=qs[_0x572f('0x27')](_0x3e620c[_0x572f('0x3e')][_0x572f('0x27')]);}_0xa57157['order']=qs[_0x572f('0x48')](_0x3e620c[_0x572f('0x3e')][_0x572f('0x48')]);_0xa57157[_0x572f('0x49')]=qs['filters'](_[_0x572f('0x4a')](_0x3e620c[_0x572f('0x3e')],_0x405c3e[_0x572f('0x3f')]));_0xa57157[_0x572f('0x75')]=!![];if(_0x3e620c[_0x572f('0x3e')]['filter']){_0xa57157[_0x572f('0x49')]=_['merge'](_0xa57157[_0x572f('0x49')],{'$or':_[_0x572f('0x38')](_0xa57157[_0x572f('0x41')],function(_0x5f1cf0){var _0x593830={};_0x593830[_0x5f1cf0]={'$like':'%'+_0x3e620c[_0x572f('0x3e')]['filter']+'%'};return _0x593830;})});}_0xa57157=_[_0x572f('0x4c')]({},_0xa57157,_0x3e620c['options']);return _0x503276[_0x572f('0x6f')](_0xa57157);}})[_0x572f('0x31')](respondWithResult(_0xcd9dec,null))[_0x572f('0x5d')](handleError(_0xcd9dec,null));};exports[_0x572f('0x76')]=function(_0x3f557f,_0x34117b,_0x2a859e){var _0x4560f2;var _0x211a27;var _0x204096;var _0x80dbd9=_0x3f557f['params']['id'];csv_results=[];return db[_0x572f('0x77')][_0x572f('0x51')]({'attributes':['id',_0x572f('0x35')],'raw':!![],'order':[_0x572f('0x78')]})['then'](function(_0x1eb2b4){_0x4560f2=_0x1eb2b4;var _0x728644=_['keys'](db[_0x572f('0x68')][_0x572f('0x3a')]);return db['CmCustomField'][_0x572f('0x51')]({'raw':!![],'attributes':['id','alias']})[_0x572f('0x31')](function(_0x3acaf6){_0x211a27=_0x3acaf6;var _0x230add=squel['select']()[_0x572f('0x43')](_0x728644)['from']('cm_contacts','c')[_0x572f('0x49')](_0x572f('0x79'),_0x80dbd9)[_0x572f('0x49')]('c.deletedAt\x20is\x20null')[_0x572f('0x7a')]();for(var _0x46e8b8=0x0;_0x46e8b8<_0x211a27[_0x572f('0x44')];_0x46e8b8++){_0x230add['field']('c.cf_'+_0x211a27[_0x46e8b8]['id'],_0x572f('0x7b')+_0x211a27[_0x46e8b8][_0x572f('0x7c')]);}for(var _0x46e8b8=0x0;_0x46e8b8<_0x4560f2[_0x572f('0x44')];_0x46e8b8++){_0x230add['field'](squel[_0x572f('0x7d')]()['field'](_0x572f('0x7e'))[_0x572f('0x7f')]('cm_contact_has_items')['where'](_0x572f('0x80'),_0x4560f2[_0x46e8b8]['id'])[_0x572f('0x49')](_0x572f('0x81')),_0x572f('0x82')+_0x4560f2[_0x46e8b8]['name']);_0x230add[_0x572f('0x83')](squel[_0x572f('0x7d')]()[_0x572f('0x83')](_0x572f('0x84'))[_0x572f('0x7f')]('cm_contact_has_items')[_0x572f('0x49')](_0x572f('0x80'),_0x4560f2[_0x46e8b8]['id'])[_0x572f('0x49')](_0x572f('0x81')),'description_additionalPhone_'+_0x4560f2[_0x46e8b8]['name']);}var _0x120695=[];_0x120695['push'](_0x230add[_0x572f('0x85')]());BPromise[_0x572f('0x86')](_0x120695,handleQuery)['then'](function(_0x34e526){handleQuery(_0x230add[_0x572f('0x85')]());var _0x4b3128=csv_results[0x0];if(!_['isEmpty'](_0x4b3128)){var _0x1a373a=toCsv(_0x4b3128);var _0x3b995a=Date[_0x572f('0x87')]();fs['writeFileSync'](util[_0x572f('0x73')](_0x572f('0x88'),_0x80dbd9,_0x3b995a),_0x1a373a);_0x34117b[_0x572f('0x89')]('Content-disposition','attachment;\x20filename='+util[_0x572f('0x73')](_0x572f('0x8a'),_0x80dbd9,_0x3b995a));_0x34117b['setHeader'](_0x572f('0x8b'),_0x572f('0x8c'));return _0x34117b[_0x572f('0x8d')](util[_0x572f('0x73')](_0x572f('0x88'),_0x80dbd9,_0x3b995a));}else{return _0x34117b[_0x572f('0x23')](0xcc);}});});});};exports[_0x572f('0x8e')]=function(_0x54b119,_0xda8eed,_0x27d42e){var _0x3f22e7;delete _0x54b119[_0x572f('0x5e')]['id'];return db['CmList']['findOne']({'where':{'id':_0x54b119['params']['id']}})[_0x572f('0x31')](handleEntityNotFound(_0xda8eed,null))[_0x572f('0x31')](function(_0x482bdc){if(_0x482bdc){return db[_0x572f('0x8f')][_0x572f('0x90')](function(_0x5aac11){return db[_0x572f('0x70')][_0x572f('0x57')](_0x54b119['body'],{'transaction':_0x5aac11})[_0x572f('0x31')](function(_0xd662fb){_0x3f22e7=_0xd662fb;return _0x482bdc[_0x572f('0x91')](_0xd662fb,{'transaction':_0x5aac11});})['then'](function(){var _0x5373f1={'type':db[_0x572f('0x92')][_0x572f('0x93')],'transaction':_0x5aac11};switch(_0x54b119[_0x572f('0x5e')]['type']){case _0x572f('0x94'):_0x5373f1['type']=db[_0x572f('0x92')]['TEXT'];break;case'number':_0x5373f1[_0x572f('0x4d')]=db[_0x572f('0x92')][_0x572f('0x95')];break;case'switch':_0x5373f1[_0x572f('0x4d')]=db[_0x572f('0x92')][_0x572f('0x96')];_0x5373f1[_0x572f('0x97')]=![];break;default:}return db[_0x572f('0x8f')]['queryInterface'][_0x572f('0x98')](_0x572f('0x99'),util[_0x572f('0x73')](_0x572f('0x9a'),_0x3f22e7['id']),_0x5373f1);})[_0x572f('0x31')](function(){return _0x3f22e7;});});}})['then'](respondWithResult(_0xda8eed,null))['catch'](handleError(_0xda8eed,null));};exports[_0x572f('0x9b')]=function(_0x3571b5,_0x482970,_0x5b5ae2){var _0x34818e={};var _0x97b054={};var _0x577744;var _0x5cc2ed;return db['CmList'][_0x572f('0x63')]({'where':{'id':_0x3571b5[_0x572f('0x54')]['id']}})['then'](handleEntityNotFound(_0x482970,null))[_0x572f('0x31')](function(_0x3aa756){if(_0x3aa756){_0x577744=_0x3aa756;_0x97b054[_0x572f('0x42')]=_[_0x572f('0x3d')](db[_0x572f('0x70')][_0x572f('0x3a')]);_0x97b054[_0x572f('0x3e')]=_[_0x572f('0x3d')](_0x3571b5['query']);_0x97b054[_0x572f('0x3f')]=_['intersection'](_0x97b054[_0x572f('0x42')],_0x97b054[_0x572f('0x3e')]);_0x34818e['attributes']=_[_0x572f('0x40')](_0x97b054[_0x572f('0x42')],qs[_0x572f('0x43')](_0x3571b5[_0x572f('0x3e')][_0x572f('0x43')]));_0x34818e[_0x572f('0x41')]=_0x34818e[_0x572f('0x41')][_0x572f('0x44')]?_0x34818e['attributes']:_0x97b054['model'];_0x34818e[_0x572f('0x47')]=qs[_0x572f('0x48')](_0x3571b5[_0x572f('0x3e')][_0x572f('0x48')]);_0x34818e[_0x572f('0x49')]=qs[_0x572f('0x3f')](_[_0x572f('0x4a')](_0x3571b5[_0x572f('0x3e')],_0x97b054[_0x572f('0x3f')]));_0x34818e[_0x572f('0x49')]=_[_0x572f('0x4c')](_0x34818e['where'],{'$or':[{'ListId':_0x3aa756['id']},{'ListId':null}]});if(_0x3571b5[_0x572f('0x3e')][_0x572f('0x4b')]){_0x34818e['where']=_[_0x572f('0x4c')](_0x34818e[_0x572f('0x49')],{'$or':_[_0x572f('0x38')](_0x34818e[_0x572f('0x41')],function(_0x403043){var _0x4560c8={};_0x4560c8[_0x403043]={'$like':'%'+_0x3571b5[_0x572f('0x3e')][_0x572f('0x4b')]+'%'};return _0x4560c8;})});}_0x34818e=_[_0x572f('0x4c')]({},_0x34818e,_0x3571b5['options']);return db[_0x572f('0x70')][_0x572f('0x9c')](_0x34818e);}})[_0x572f('0x31')](respondWithResult(_0x482970,null))[_0x572f('0x5d')](handleError(_0x482970,null));};exports[_0x572f('0x9d')]=function(_0x4f707d,_0x1a00d5){return db['CmCustomField'][_0x572f('0x9c')]({'where':{'ListId':null}})[_0x572f('0x31')](handleEntityNotFound(_0x1a00d5,null))[_0x572f('0x31')](function(_0x52ef9e){return _0x52ef9e;})[_0x572f('0x31')](respondWithResult(_0x1a00d5,null))[_0x572f('0x5d')](handleError(_0x1a00d5,null));};exports[_0x572f('0x9e')]=function(_0x25bbf2,_0x2badc1,_0x98031){return db[_0x572f('0x39')]['find']({'where':{'id':_0x25bbf2[_0x572f('0x54')]['id']}})[_0x572f('0x31')](handleEntityNotFound(_0x2badc1,null))['then'](function(_0x260f29){if(_0x260f29){return _0x260f29[_0x572f('0x9e')](_0x25bbf2[_0x572f('0x5e')]['ids'],_[_0x572f('0x69')](_0x25bbf2[_0x572f('0x5e')],[_0x572f('0x9f'),'id'])||{})[_0x572f('0xa0')](function(_0x210eed){for(var _0x2f4ff6=0x0;_0x2f4ff6<_0x25bbf2[_0x572f('0x5e')][_0x572f('0x9f')][_0x572f('0x44')];_0x2f4ff6+=0x1){socket[_0x572f('0xa1')](_0x572f('0xa2'),{'UserId':Number(_0x25bbf2['body'][_0x572f('0x9f')][_0x2f4ff6]),'CmListId':Number(_0x25bbf2['params']['id'])});}return _0x210eed;});}})[_0x572f('0x31')](respondWithResult(_0x2badc1,null))[_0x572f('0x5d')](handleError(_0x2badc1,null));};exports[_0x572f('0xa3')]=function(_0x1b7c0b,_0x505843,_0x4f4c36){return db['CmList']['find']({'where':{'id':_0x1b7c0b['params']['id']}})[_0x572f('0x31')](handleEntityNotFound(_0x505843,null))[_0x572f('0x31')](function(_0x25f23f){if(_0x25f23f){return _0x25f23f[_0x572f('0xa3')](_0x1b7c0b['query'][_0x572f('0x9f')])[_0x572f('0x31')](function(){if(_[_0x572f('0xa4')](_0x1b7c0b[_0x572f('0x3e')][_0x572f('0x9f')])){for(var _0x1a3a5b=0x0;_0x1a3a5b<_0x1b7c0b['query'][_0x572f('0x9f')][_0x572f('0x44')];_0x1a3a5b+=0x1){socket[_0x572f('0xa1')](_0x572f('0xa5'),{'UserId':Number(_0x1b7c0b[_0x572f('0x3e')][_0x572f('0x9f')][_0x1a3a5b]),'CmListId':Number(_0x1b7c0b[_0x572f('0x54')]['id'])});}}else{socket[_0x572f('0xa1')]('userCmList:remove',{'UserId':Number(_0x1b7c0b[_0x572f('0x3e')][_0x572f('0x9f')]),'CmListId':Number(_0x1b7c0b[_0x572f('0x54')]['id'])});}});}})[_0x572f('0x31')](respondWithStatusCode(_0x505843,null))[_0x572f('0x5d')](handleError(_0x505843,null));};exports[_0x572f('0xa6')]=function(_0x206145,_0x830bba,_0x457514){var _0x417dd3={};var _0x1db751={};var _0x182821;var _0x27ea07;return db[_0x572f('0x39')][_0x572f('0x63')]({'where':{'id':_0x206145['params']['id']}})['then'](handleEntityNotFound(_0x830bba,null))[_0x572f('0x31')](function(_0x205774){if(_0x205774){_0x182821=_0x205774;_0x1db751[_0x572f('0x42')]=_[_0x572f('0x3d')](db[_0x572f('0xa7')][_0x572f('0x3a')]);_0x1db751[_0x572f('0x3e')]=_['keys'](_0x206145[_0x572f('0x3e')]);_0x1db751[_0x572f('0x3f')]=_[_0x572f('0x40')](_0x1db751['model'],_0x1db751[_0x572f('0x3e')]);_0x417dd3['attributes']=_[_0x572f('0x40')](_0x1db751[_0x572f('0x42')],qs['fields'](_0x206145[_0x572f('0x3e')][_0x572f('0x43')]));_0x417dd3[_0x572f('0x41')]=_0x417dd3[_0x572f('0x41')][_0x572f('0x44')]?_0x417dd3['attributes']:_0x1db751[_0x572f('0x42')];_0x417dd3['order']=qs['sort'](_0x206145['query'][_0x572f('0x48')]);_0x417dd3[_0x572f('0x49')]=qs[_0x572f('0x3f')](_[_0x572f('0x4a')](_0x206145[_0x572f('0x3e')],_0x1db751['filters']));if(_0x206145[_0x572f('0x3e')]['filter']){_0x417dd3[_0x572f('0x49')]=_['merge'](_0x417dd3[_0x572f('0x49')],{'$or':_[_0x572f('0x38')](_0x417dd3[_0x572f('0x41')],function(_0x320146){var _0x252078={};_0x252078[_0x320146]={'$like':'%'+_0x206145[_0x572f('0x3e')]['filter']+'%'};return _0x252078;})});}_0x417dd3=_[_0x572f('0x4c')]({},_0x417dd3,_0x206145[_0x572f('0x55')]);return _0x182821[_0x572f('0xa6')](_0x417dd3);}})[_0x572f('0x31')](function(_0x4376e3){if(_0x4376e3){_0x27ea07=_0x4376e3['length'];if(!_0x206145['query'][_0x572f('0x45')](_0x572f('0x46'))){_0x417dd3[_0x572f('0x29')]=qs[_0x572f('0x29')](_0x206145['query'][_0x572f('0x29')]);_0x417dd3[_0x572f('0x27')]=qs[_0x572f('0x27')](_0x206145[_0x572f('0x3e')]['offset']);}return _0x182821[_0x572f('0xa6')](_0x417dd3);}})[_0x572f('0x31')](function(_0x5652d5){if(_0x5652d5){return _0x5652d5?{'count':_0x27ea07,'rows':_0x5652d5}:null;}})[_0x572f('0x31')](respondWithResult(_0x830bba,null))[_0x572f('0x5d')](handleError(_0x830bba,null));};function handleQuery(_0x4e9130){logger[_0x572f('0xa8')](_0x4e9130);return db[_0x572f('0x8f')][_0x572f('0x3e')](_0x4e9130)[_0x572f('0xa0')](function(_0x5a7e8a){csv_results[_0x572f('0x6b')](_0x5a7e8a);})[_0x572f('0x5d')](function(_0x46c8a9){logger[_0x572f('0xa9')](_0x46c8a9[_0x572f('0x6d')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 12e6a25..3454c93 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(_0x55d846,_0x6dc432){_0x55d846=_0x55d846-0x0;var _0x582a76=_0x3e74[_0x55d846];return _0x582a76;};'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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x121ffa,_0x2037b5){var _0x5f0bea=function(_0xd94804){while(--_0xd94804){_0x121ffa['push'](_0x121ffa['shift']());}};_0x5f0bea(++_0x2037b5);}(_0x814b,0x1a2));var _0xb814=function(_0x4da382,_0x4cfc5d){_0x4da382=_0x4da382-0x0;var _0x10073f=_0x814b[_0x4da382];return _0x10073f;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 72ca085..93da684 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 _0x5b02=['define','CmList','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x5a0cc1,_0x325e15){var _0x260fc3=function(_0x108e5e){while(--_0x108e5e){_0x5a0cc1['push'](_0x5a0cc1['shift']());}};_0x260fc3(++_0x325e15);}(_0x5b02,0xe9));var _0x25b0=function(_0x517cb5,_0x4f75f8){_0x517cb5=_0x517cb5-0x0;var _0x1d7bf8=_0x5b02[_0x517cb5];return _0x1d7bf8;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x4c8bc6,_0x1e5fa4){var _0x241983=function(_0x5539b2){while(--_0x5539b2){_0x4c8bc6['push'](_0x4c8bc6['shift']());}};_0x241983(++_0x1e5fa4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4ceeb3a..056ab95 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 _0x160f=['CmList,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0x160f,0x17f));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require(_0xf160('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf160('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf160('0x6'))('rpc');var config=require(_0xf160('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0x8')][_0xf160('0x9')]({'port':0x232a});config[_0xf160('0xa')]=_[_0xf160('0xb')](config[_0xf160('0xa')],{'host':_0xf160('0xc'),'port':0x18eb});var socket=require(_0xf160('0xd'))(new Redis(config[_0xf160('0xa')]));require(_0xf160('0xe'))['register'](socket);function respondWithRpcPromise(_0x48c5ea,_0x33d40c,_0x4b695e){return new BPromise(function(_0x13e8c4,_0x3014db){return client[_0xf160('0xf')](_0x48c5ea,_0x4b695e)[_0xf160('0x10')](function(_0x7ff51f){logger['info']('CmList,\x20%s,\x20%s',_0x33d40c,'request\x20sent');logger[_0xf160('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x33d40c,_0xf160('0x12'),JSON[_0xf160('0x13')](_0x7ff51f));if(_0x7ff51f[_0xf160('0x14')]){if(_0x7ff51f[_0xf160('0x14')][_0xf160('0x15')]===0x1f4){logger['error'](_0xf160('0x16'),_0x33d40c,_0x7ff51f[_0xf160('0x14')]['message']);return _0x3014db(_0x7ff51f[_0xf160('0x14')]['message']);}logger['error'](_0xf160('0x16'),_0x33d40c,_0x7ff51f[_0xf160('0x14')][_0xf160('0x17')]);return _0x13e8c4(_0x7ff51f[_0xf160('0x14')][_0xf160('0x17')]);}else{logger[_0xf160('0x18')](_0xf160('0x16'),_0x33d40c,_0xf160('0x12'));_0x13e8c4(_0x7ff51f[_0xf160('0x19')][_0xf160('0x17')]);}})[_0xf160('0x1a')](function(_0x5e882e){logger[_0xf160('0x14')](_0xf160('0x16'),_0x33d40c,_0x5e882e);_0x3014db(_0x5e882e);});});} \ No newline at end of file +var _0xf43a=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0xf43a,0xe2));var _0xaf43=function(_0x308aea,_0x2f5271){_0x308aea=_0x308aea-0x0;var _0x4b03b5=_0xf43a[_0x308aea];return _0x4b03b5;};'use strict';var _=require('lodash');var util=require(_0xaf43('0x0'));var moment=require(_0xaf43('0x1'));var BPromise=require(_0xaf43('0x2'));var rs=require(_0xaf43('0x3'));var fs=require('fs');var Redis=require(_0xaf43('0x4'));var db=require(_0xaf43('0x5'))['db'];var utils=require(_0xaf43('0x6'));var logger=require('../../config/logger')(_0xaf43('0x7'));var config=require(_0xaf43('0x8'));var jayson=require(_0xaf43('0x9'));var client=jayson[_0xaf43('0xa')]['http']({'port':0x232a});config[_0xaf43('0xb')]=_['defaults'](config[_0xaf43('0xb')],{'host':_0xaf43('0xc'),'port':0x18eb});var socket=require(_0xaf43('0xd'))(new Redis(config[_0xaf43('0xb')]));require('./cmList.socket')[_0xaf43('0xe')](socket);function respondWithRpcPromise(_0x32373f,_0x55a694,_0x40b769){return new BPromise(function(_0x364f96,_0x5f079c){return client[_0xaf43('0xf')](_0x32373f,_0x40b769)['then'](function(_0x4d67d4){logger['info'](_0xaf43('0x10'),_0x55a694,'request\x20sent');logger[_0xaf43('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x55a694,_0xaf43('0x12'),JSON[_0xaf43('0x13')](_0x4d67d4));if(_0x4d67d4[_0xaf43('0x14')]){if(_0x4d67d4[_0xaf43('0x14')][_0xaf43('0x15')]===0x1f4){logger[_0xaf43('0x14')](_0xaf43('0x10'),_0x55a694,_0x4d67d4[_0xaf43('0x14')]['message']);return _0x5f079c(_0x4d67d4[_0xaf43('0x14')][_0xaf43('0x16')]);}logger[_0xaf43('0x14')](_0xaf43('0x10'),_0x55a694,_0x4d67d4[_0xaf43('0x14')][_0xaf43('0x16')]);return _0x364f96(_0x4d67d4[_0xaf43('0x14')][_0xaf43('0x16')]);}else{logger[_0xaf43('0x17')](_0xaf43('0x10'),_0x55a694,_0xaf43('0x12'));_0x364f96(_0x4d67d4[_0xaf43('0x18')][_0xaf43('0x16')]);}})[_0xaf43('0x19')](function(_0x209214){logger[_0xaf43('0x14')](_0xaf43('0x10'),_0x55a694,_0x209214);_0x5f079c(_0x209214);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 25d65cf..63228d1 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 _0xcdfd=['save','remove','emit','register'];(function(_0x5cd4e5,_0x45fab1){var _0x28fb05=function(_0x2b8575){while(--_0x2b8575){_0x5cd4e5['push'](_0x5cd4e5['shift']());}};_0x28fb05(++_0x45fab1);}(_0xcdfd,0x84));var _0xdcdf=function(_0x4a4c9f,_0x5cce76){_0x4a4c9f=_0x4a4c9f-0x0;var _0x5af457=_0xcdfd[_0x4a4c9f];return _0x5af457;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xdcdf('0x0'),_0xdcdf('0x1'),'update'];function createListener(_0xf24b36,_0x5a45ae){return function(_0x19a4eb){_0x5a45ae[_0xdcdf('0x2')](_0xf24b36,_0x19a4eb);};}function removeListener(_0x101c3b,_0x59c342){return function(){CmListEvents['removeListener'](_0x101c3b,_0x59c342);};}exports[_0xdcdf('0x3')]=function(_0x1f9bd2){for(var _0x4907e3=0x0,_0x289a18=events['length'];_0x4907e3<_0x289a18;_0x4907e3++){var _0x56ef4c=events[_0x4907e3];var _0x27fbf7=createListener('cmList:'+_0x56ef4c,_0x1f9bd2);CmListEvents['on'](_0x56ef4c,_0x27fbf7);}}; \ No newline at end of file +var _0xce0b=['register','cmList:','./cmList.events','save','remove','update','removeListener'];(function(_0x10e3f7,_0x353b97){var _0x3ee398=function(_0x16d5ce){while(--_0x16d5ce){_0x10e3f7['push'](_0x10e3f7['shift']());}};_0x3ee398(++_0x353b97);}(_0xce0b,0x191));var _0xbce0=function(_0x469741,_0x28bdb7){_0x469741=_0x469741-0x0;var _0x31d7e2=_0xce0b[_0x469741];return _0x31d7e2;};'use strict';var CmListEvents=require(_0xbce0('0x0'));var events=[_0xbce0('0x1'),_0xbce0('0x2'),_0xbce0('0x3')];function createListener(_0x14a0d4,_0x38aad0){return function(_0xe8fac4){_0x38aad0['emit'](_0x14a0d4,_0xe8fac4);};}function removeListener(_0x2699fc,_0x2f35c4){return function(){CmListEvents[_0xbce0('0x4')](_0x2699fc,_0x2f35c4);};}exports[_0xbce0('0x5')]=function(_0x2b0d80){for(var _0x44960f=0x0,_0x6695bd=events['length'];_0x44960f<_0x6695bd;_0x44960f++){var _0x52adc0=events[_0x44960f];var _0x53087c=createListener(_0xbce0('0x6')+_0x52adc0,_0x2b0d80);CmListEvents['on'](_0x52adc0,_0x53087c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index d7749ee..dbc575f 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 _0x2e89=['/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','isAuthenticated','get','/describe','describe','show','getContacts'];(function(_0x41ffcb,_0x265ae9){var _0x5406ad=function(_0x3dd2d9){while(--_0x3dd2d9){_0x41ffcb['push'](_0x41ffcb['shift']());}};_0x5406ad(++_0x265ae9);}(_0x2e89,0x1e9));var _0x92e8=function(_0x252ee5,_0x4b6bcb){_0x252ee5=_0x252ee5-0x0;var _0x3cbf63=_0x2e89[_0x252ee5];return _0x3cbf63;};'use strict';var multer=require(_0x92e8('0x0'));var util=require(_0x92e8('0x1'));var path=require(_0x92e8('0x2'));var timeout=require(_0x92e8('0x3'));var express=require('express');var router=express[_0x92e8('0x4')]();var fs_extra=require(_0x92e8('0x5'));var auth=require(_0x92e8('0x6'));var interaction=require(_0x92e8('0x7'));var config=require('../../config/environment');var controller=require(_0x92e8('0x8'));router['get']('/',auth[_0x92e8('0x9')](),controller['index']);router[_0x92e8('0xa')](_0x92e8('0xb'),auth[_0x92e8('0x9')](),controller[_0x92e8('0xc')]);router[_0x92e8('0xa')]('/global_fields',auth[_0x92e8('0x9')](),controller['getGlobalCustomFields']);router[_0x92e8('0xa')]('/:id',auth[_0x92e8('0x9')](),controller[_0x92e8('0xd')]);router[_0x92e8('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x92e8('0xa')]('/:id/contacts',auth[_0x92e8('0x9')](),controller[_0x92e8('0xe')]);router[_0x92e8('0xa')](_0x92e8('0xf'),auth[_0x92e8('0x9')](),controller['getContactsCsv']);router['get'](_0x92e8('0x10'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x11')]);router[_0x92e8('0xa')](_0x92e8('0x12'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x13')]);router[_0x92e8('0x14')]('/',auth[_0x92e8('0x9')](),controller[_0x92e8('0x15')]);router[_0x92e8('0x14')](_0x92e8('0x16'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x17')]);router[_0x92e8('0x14')](_0x92e8('0x18'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x19')]);router[_0x92e8('0x14')](_0x92e8('0x10'),auth['isAuthenticated'](),controller[_0x92e8('0x1a')]);router['post'](_0x92e8('0x12'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x1b')]);router[_0x92e8('0x1c')](_0x92e8('0x1d'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x1e')]);router['delete'](_0x92e8('0x1d'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x1f')]);router[_0x92e8('0x20')](_0x92e8('0x16'),auth['isAuthenticated'](),controller[_0x92e8('0x21')]);router[_0x92e8('0x20')](_0x92e8('0x12'),auth[_0x92e8('0x9')](),controller[_0x92e8('0x22')]);module[_0x92e8('0x23')]=router; \ No newline at end of file +var _0x60bb=['show','/:id/dispositions','getDispositions','/:id/contacts/csv','/:id/users','post','create','addDisposition','addContacts','/:id/fields','addCustomField','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','/:id'];(function(_0x566f7c,_0x21812f){var _0xad1a70=function(_0x2cd277){while(--_0x2cd277){_0x566f7c['push'](_0x566f7c['shift']());}};_0xad1a70(++_0x21812f);}(_0x60bb,0x164));var _0xb60b=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0x60bb[_0x42bafd];return _0x2ed705;};'use strict';var multer=require(_0xb60b('0x0'));var util=require(_0xb60b('0x1'));var path=require(_0xb60b('0x2'));var timeout=require(_0xb60b('0x3'));var express=require(_0xb60b('0x4'));var router=express[_0xb60b('0x5')]();var fs_extra=require(_0xb60b('0x6'));var auth=require(_0xb60b('0x7'));var interaction=require(_0xb60b('0x8'));var config=require(_0xb60b('0x9'));var controller=require(_0xb60b('0xa'));router[_0xb60b('0xb')]('/',auth[_0xb60b('0xc')](),controller['index']);router[_0xb60b('0xb')](_0xb60b('0xd'),auth[_0xb60b('0xc')](),controller[_0xb60b('0xe')]);router[_0xb60b('0xb')](_0xb60b('0xf'),auth['isAuthenticated'](),controller[_0xb60b('0x10')]);router['get'](_0xb60b('0x11'),auth['isAuthenticated'](),controller[_0xb60b('0x12')]);router[_0xb60b('0xb')](_0xb60b('0x13'),auth['isAuthenticated'](),controller[_0xb60b('0x14')]);router[_0xb60b('0xb')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xb60b('0xb')](_0xb60b('0x15'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xb60b('0xb')]('/:id/fields',auth[_0xb60b('0xc')](),controller['getCustomFields']);router[_0xb60b('0xb')](_0xb60b('0x16'),auth[_0xb60b('0xc')](),controller['getAgents']);router[_0xb60b('0x17')]('/',auth[_0xb60b('0xc')](),controller[_0xb60b('0x18')]);router['post'](_0xb60b('0x13'),auth['isAuthenticated'](),controller[_0xb60b('0x19')]);router[_0xb60b('0x17')]('/:id/contacts',auth[_0xb60b('0xc')](),controller[_0xb60b('0x1a')]);router[_0xb60b('0x17')](_0xb60b('0x1b'),auth[_0xb60b('0xc')](),controller[_0xb60b('0x1c')]);router['post'](_0xb60b('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0xb60b('0xc')](),controller[_0xb60b('0x1d')]);router[_0xb60b('0x1e')]('/:id',auth[_0xb60b('0xc')](),controller[_0xb60b('0x1f')]);router[_0xb60b('0x1e')](_0xb60b('0x13'),auth[_0xb60b('0xc')](),controller[_0xb60b('0x20')]);router[_0xb60b('0x1e')](_0xb60b('0x16'),auth[_0xb60b('0xc')](),controller[_0xb60b('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index a91219e..56bd060 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 _0xbe37=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x3a1715,_0x78965a){var _0xceb678=function(_0x39aa4c){while(--_0x39aa4c){_0x3a1715['push'](_0x3a1715['shift']());}};_0xceb678(++_0x78965a);}(_0xbe37,0xee));var _0x7be3=function(_0x1f1f7c,_0x2ddf52){_0x1f1f7c=_0x1f1f7c-0x0;var _0x29195d=_0xbe37[_0x1f1f7c];return _0x29195d;};'use strict';var Sequelize=require(_0x7be3('0x0'));module[_0x7be3('0x1')]={'name':{'type':Sequelize[_0x7be3('0x2')],'get':function(_0x50d490){return this[_0x7be3('0x3')]('field');}},'field':{'type':Sequelize[_0x7be3('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7be3('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7be3('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xdd9c=['STRING','VIRTUAL','getDataValue','field'];(function(_0x22900c,_0x57bcce){var _0x52cab1=function(_0x15ca79){while(--_0x15ca79){_0x22900c['push'](_0x22900c['shift']());}};_0x52cab1(++_0x57bcce);}(_0xdd9c,0xd9));var _0xcdd9=function(_0x5e6941,_0xc3a94c){_0x5e6941=_0x5e6941-0x0;var _0x55e3bd=_0xdd9c[_0x5e6941];return _0x55e3bd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcdd9('0x0')],'get':function(_0xa4b460){return this[_0xcdd9('0x1')](_0xcdd9('0x2'));}},'field':{'type':Sequelize[_0xcdd9('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xcdd9('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0ae38b3..55f1b4b 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(_0x3911dd,_0x47bec6){var _0x53e375=function(_0x43651f){while(--_0x43651f){_0x3911dd['push'](_0x3911dd['shift']());}};_0x53e375(++_0x47bec6);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _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(_0x2f4ae8,_0x26433f){var _0x2dc376=function(_0x3d9023){while(--_0x3d9023){_0x2f4ae8['push'](_0x2f4ae8['shift']());}};_0x2dc376(++_0x26433f);}(_0x7a54,0x106));var _0x47a5=function(_0x1b9b79,_0x17897a){_0x1b9b79=_0x1b9b79-0x0;var _0x458e25=_0x7a54[_0x1b9b79];return _0x458e25;};'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 fa157a0..2f7567f 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 _0x6e5a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0x6e5a,0xe1));var _0xa6e5=function(_0x9ec73,_0x29bfa1){_0x9ec73=_0x9ec73-0x0;var _0x183635=_0x6e5a[_0x9ec73];return _0x183635;};'use strict';var _=require(_0xa6e5('0x0'));var util=require(_0xa6e5('0x1'));var logger=require(_0xa6e5('0x2'))(_0xa6e5('0x3'));var moment=require(_0xa6e5('0x4'));var BPromise=require(_0xa6e5('0x5'));var rp=require(_0xa6e5('0x6'));var fs=require('fs');var path=require(_0xa6e5('0x7'));var rimraf=require(_0xa6e5('0x8'));var config=require(_0xa6e5('0x9'));var attributes=require(_0xa6e5('0xa'));module[_0xa6e5('0xb')]=function(_0x3ce384,_0x35f74c){return _0x3ce384[_0xa6e5('0xc')](_0xa6e5('0xd'),attributes,{'tableName':_0xa6e5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cfc=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions'];(function(_0x8f18a0,_0x9f73ae){var _0xee9fc5=function(_0x4a8ee6){while(--_0x4a8ee6){_0x8f18a0['push'](_0x8f18a0['shift']());}};_0xee9fc5(++_0x9f73ae);}(_0x3cfc,0x155));var _0xc3cf=function(_0x1cd155,_0x206f1a){_0x1cd155=_0x1cd155-0x0;var _0x4ab090=_0x3cfc[_0x1cd155];return _0x4ab090;};'use strict';var _=require(_0xc3cf('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc3cf('0x1'));var BPromise=require(_0xc3cf('0x2'));var rp=require(_0xc3cf('0x3'));var fs=require('fs');var path=require(_0xc3cf('0x4'));var rimraf=require(_0xc3cf('0x5'));var config=require(_0xc3cf('0x6'));var attributes=require(_0xc3cf('0x7'));module[_0xc3cf('0x8')]=function(_0xd56c3,_0x185290){return _0xd56c3[_0xc3cf('0x9')]('Condition',attributes,{'tableName':_0xc3cf('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 faf5224..6fadc17 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 _0x5f00=['http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x46c7b2,_0xb2f3c1){var _0x5f8e26=function(_0x218f09){while(--_0x218f09){_0x46c7b2['push'](_0x46c7b2['shift']());}};_0x5f8e26(++_0xb2f3c1);}(_0x5f00,0x6d));var _0x05f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05f0('0x0'));var util=require('util');var moment=require(_0x05f0('0x1'));var BPromise=require(_0x05f0('0x2'));var rs=require(_0x05f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05f0('0x4'))['db'];var utils=require(_0x05f0('0x5'));var logger=require(_0x05f0('0x6'))(_0x05f0('0x7'));var config=require(_0x05f0('0x8'));var jayson=require(_0x05f0('0x9'));var client=jayson[_0x05f0('0xa')][_0x05f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x520090,_0x110ddd,_0x2f5e74){return new BPromise(function(_0x440bd7,_0x44bd68){return client[_0x05f0('0xc')](_0x520090,_0x2f5e74)[_0x05f0('0xd')](function(_0x2cd819){logger['info'](_0x05f0('0xe'),_0x110ddd,_0x05f0('0xf'));logger[_0x05f0('0x10')](_0x05f0('0x11'),_0x110ddd,_0x05f0('0xf'),JSON[_0x05f0('0x12')](_0x2cd819));if(_0x2cd819[_0x05f0('0x13')]){if(_0x2cd819[_0x05f0('0x13')][_0x05f0('0x14')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x110ddd,_0x2cd819[_0x05f0('0x13')][_0x05f0('0x15')]);return _0x44bd68(_0x2cd819[_0x05f0('0x13')][_0x05f0('0x15')]);}logger[_0x05f0('0x13')](_0x05f0('0xe'),_0x110ddd,_0x2cd819['error'][_0x05f0('0x15')]);return _0x440bd7(_0x2cd819[_0x05f0('0x13')][_0x05f0('0x15')]);}else{logger['info'](_0x05f0('0xe'),_0x110ddd,_0x05f0('0xf'));_0x440bd7(_0x2cd819[_0x05f0('0x16')]['message']);}})[_0x05f0('0x17')](function(_0x32603f){logger[_0x05f0('0x13')](_0x05f0('0xe'),_0x110ddd,_0x32603f);_0x44bd68(_0x32603f);});});} \ No newline at end of file +var _0x52a4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x1eb7da,_0x1f73bc){var _0x20dc66=function(_0x2a4e02){while(--_0x2a4e02){_0x1eb7da['push'](_0x1eb7da['shift']());}};_0x20dc66(++_0x1f73bc);}(_0x52a4,0x183));var _0x452a=function(_0x6aeb10,_0x1f209e){_0x6aeb10=_0x6aeb10-0x0;var _0x4dcb8d=_0x52a4[_0x6aeb10];return _0x4dcb8d;};'use strict';var _=require(_0x452a('0x0'));var util=require(_0x452a('0x1'));var moment=require(_0x452a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x452a('0x3'));var db=require(_0x452a('0x4'))['db'];var utils=require(_0x452a('0x5'));var logger=require(_0x452a('0x6'))(_0x452a('0x7'));var config=require(_0x452a('0x8'));var jayson=require(_0x452a('0x9'));var client=jayson[_0x452a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3746f8,_0x19885e,_0xe78a20){return new BPromise(function(_0x507053,_0x4e2bd0){return client[_0x452a('0xb')](_0x3746f8,_0xe78a20)[_0x452a('0xc')](function(_0x5eb5db){logger[_0x452a('0xd')](_0x452a('0xe'),_0x19885e,_0x452a('0xf'));logger[_0x452a('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x19885e,_0x452a('0xf'),JSON[_0x452a('0x11')](_0x5eb5db));if(_0x5eb5db[_0x452a('0x12')]){if(_0x5eb5db[_0x452a('0x12')][_0x452a('0x13')]===0x1f4){logger[_0x452a('0x12')](_0x452a('0xe'),_0x19885e,_0x5eb5db[_0x452a('0x12')][_0x452a('0x14')]);return _0x4e2bd0(_0x5eb5db['error']['message']);}logger[_0x452a('0x12')](_0x452a('0xe'),_0x19885e,_0x5eb5db['error']['message']);return _0x507053(_0x5eb5db[_0x452a('0x12')][_0x452a('0x14')]);}else{logger[_0x452a('0xd')](_0x452a('0xe'),_0x19885e,'request\x20sent');_0x507053(_0x5eb5db[_0x452a('0x15')][_0x452a('0x14')]);}})[_0x452a('0x16')](function(_0x157675){logger[_0x452a('0x12')](_0x452a('0xe'),_0x19885e,_0x157675);_0x4e2bd0(_0x157675);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 7831603..796cece 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 _0x51e1=['delete','destroy','exports','path','connect-timeout','express','Router','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x18140b,_0x477369){var _0x1d70db=function(_0x10b37e){while(--_0x10b37e){_0x18140b['push'](_0x18140b['shift']());}};_0x1d70db(++_0x477369);}(_0x51e1,0x18f));var _0x151e=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0x51e1[_0x2cc711];return _0x31a52e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x151e('0x0'));var timeout=require(_0x151e('0x1'));var express=require(_0x151e('0x2'));var router=express[_0x151e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x151e('0x4'));router[_0x151e('0x5')](_0x151e('0x6'),auth[_0x151e('0x7')](),controller[_0x151e('0x8')]);router[_0x151e('0x9')](_0x151e('0x6'),auth[_0x151e('0x7')](),controller[_0x151e('0xa')]);module[_0x151e('0xb')]=router; \ No newline at end of file +var _0xea8e=['../../components/interaction/service','./condition.controller','put','isAuthenticated','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0x41a898,_0x4b90b8){var _0x3c1bf9=function(_0x415464){while(--_0x415464){_0x41a898['push'](_0x41a898['shift']());}};_0x3c1bf9(++_0x4b90b8);}(_0xea8e,0x140));var _0xeea8=function(_0x5ea7e0,_0x2f46f2){_0x5ea7e0=_0x5ea7e0-0x0;var _0x1c49c7=_0xea8e[_0x5ea7e0];return _0x1c49c7;};'use strict';var multer=require(_0xeea8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeea8('0x1'));var router=express[_0xeea8('0x2')]();var fs_extra=require(_0xeea8('0x3'));var auth=require(_0xeea8('0x4'));var interaction=require(_0xeea8('0x5'));var config=require('../../config/environment');var controller=require(_0xeea8('0x6'));router[_0xeea8('0x7')]('/:id',auth[_0xeea8('0x8')](),controller[_0xeea8('0x9')]);router[_0xeea8('0xa')]('/:id',auth[_0xeea8('0x8')](),controller[_0xeea8('0xb')]);module[_0xeea8('0xc')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 7754a37..3db97d6 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 _0x9f1c=['sequelize','name','STRING'];(function(_0x4acff2,_0x57eb37){var _0x528de4=function(_0x3f2f5f){while(--_0x3f2f5f){_0x4acff2['push'](_0x4acff2['shift']());}};_0x528de4(++_0x57eb37);}(_0x9f1c,0x1a7));var _0xc9f1=function(_0x1e049c,_0x344ef9){_0x1e049c=_0x1e049c-0x0;var _0x36f95e=_0x9f1c[_0x1e049c];return _0x36f95e;};'use strict';var Sequelize=require(_0xc9f1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc9f1('0x1')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xc9f1('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xaed3=['sequelize','STRING','name','INTEGER'];(function(_0x4f8127,_0x56baec){var _0x5acf5e=function(_0x476754){while(--_0x476754){_0x4f8127['push'](_0x4f8127['shift']());}};_0x5acf5e(++_0x56baec);}(_0xaed3,0xb0));var _0x3aed=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xaed3[_0x240261];return _0x45c332;};'use strict';var Sequelize=require(_0x3aed('0x0'));module['exports']={'name':{'type':Sequelize[_0x3aed('0x1')],'allowNull':![],'unique':_0x3aed('0x2')},'OrderBy':{'type':Sequelize[_0x3aed('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x3aed('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 7117714..875b992 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 _0xcf66=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','ContactItemType','rawAttributes','type','key','model','map'];(function(_0x4aaab2,_0x69fd00){var _0x1b43ec=function(_0x54ecd1){while(--_0x54ecd1){_0x4aaab2['push'](_0x4aaab2['shift']());}};_0x1b43ec(++_0x69fd00);}(_0xcf66,0x71));var _0x6cf6=function(_0x4ac941,_0x260f68){_0x4ac941=_0x4ac941-0x0;var _0x51911e=_0xcf66[_0x4ac941];return _0x51911e;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['ContactItemType'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='ContactItemTypes';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](db[_0x6cf6('0x4f')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4699d5['params']['id']}}))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));}; \ No newline at end of file +var _0x781d=['find','CmContactHasItem','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','get','stack','name','send','index','ContactItemType','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4cefbf,_0x82b6ef){var _0x14c78f=function(_0x2e41b7){while(--_0x2e41b7){_0x4cefbf['push'](_0x4cefbf['shift']());}};_0x14c78f(++_0x82b6ef);}(_0x781d,0x14a));var _0xd781=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x781d[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){var _0x221f14=_0x31bf57[_0xd781('0x27')]({'plain':!![]});var _0x10940b='ContactItemTypes';return db['UserProfileResource'][_0xd781('0x25')]({'where':{'type':_0x10940b,'resourceId':_0x221f14['id']}})[_0xd781('0x26')](function(){return _0x31bf57;});})[_0xd781('0x26')](function(){_0x101480['status'](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x5a431b,_0x47c609){return function(_0x1e29c8){if(!_0x1e29c8){_0x5a431b['sendStatus'](0x194);}return _0x1e29c8;};}function handleError(_0x3e868,_0x123a6a){_0x123a6a=_0x123a6a||0x1f4;return function(_0x5c3848){logger['error'](_0x5c3848[_0xd781('0x28')]);if(_0x5c3848['name']){delete _0x5c3848[_0xd781('0x29')];}_0x3e868['status'](_0x123a6a)[_0xd781('0x2a')](_0x5c3848);};}exports[_0xd781('0x2b')]=function(_0x556127,_0x54521e){var _0x432d14={},_0x29e81a={},_0x1c7d83={'count':0x0,'rows':[]};var _0x5a389c=_['map'](db[_0xd781('0x2c')][_0xd781('0x2d')],function(_0x36a889){return{'name':_0x36a889['fieldName'],'type':_0x36a889['type'][_0xd781('0x2e')]};});_0x29e81a[_0xd781('0x2f')]=_['map'](_0x5a389c,_0xd781('0x29'));_0x29e81a[_0xd781('0x30')]=_['keys'](_0x556127[_0xd781('0x30')]);_0x29e81a[_0xd781('0x31')]=_[_0xd781('0x32')](_0x29e81a[_0xd781('0x2f')],_0x29e81a['query']);_0x432d14[_0xd781('0x33')]=_[_0xd781('0x32')](_0x29e81a[_0xd781('0x2f')],qs[_0xd781('0x34')](_0x556127['query'][_0xd781('0x34')]));_0x432d14[_0xd781('0x33')]=_0x432d14['attributes'][_0xd781('0x35')]?_0x432d14['attributes']:_0x29e81a[_0xd781('0x2f')];if(!_0x556127[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x36'))){_0x432d14[_0xd781('0x1e')]=qs['limit'](_0x556127[_0xd781('0x30')]['limit']);_0x432d14[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x556127['query'][_0xd781('0x1c')]);}_0x432d14[_0xd781('0x37')]=qs['sort'](_0x556127[_0xd781('0x30')][_0xd781('0x38')]);_0x432d14[_0xd781('0x39')]=qs['filters'](_[_0xd781('0x3a')](_0x556127[_0xd781('0x30')],_0x29e81a[_0xd781('0x31')]),_0x5a389c);if(_0x556127[_0xd781('0x30')][_0xd781('0x3b')]){_0x432d14[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x432d14[_0xd781('0x39')],{'$or':_[_0xd781('0x3d')](_0x5a389c,function(_0x5c6026){if(_0x5c6026[_0xd781('0x3e')]!=='VIRTUAL'){var _0x2504ac={};_0x2504ac[_0x5c6026[_0xd781('0x29')]]={'$like':'%'+_0x556127['query'][_0xd781('0x3b')]+'%'};return _0x2504ac;}})});}_0x432d14=_[_0xd781('0x3c')]({},_0x432d14,_0x556127[_0xd781('0x3f')]);var _0x402c9c={'where':_0x432d14['where']};return db[_0xd781('0x2c')]['count'](_0x402c9c)[_0xd781('0x26')](function(_0xcdaacf){_0x1c7d83['count']=_0xcdaacf;if(_0x556127['query'][_0xd781('0x40')]){_0x432d14[_0xd781('0x41')]=[{'all':!![]}];}return db[_0xd781('0x2c')][_0xd781('0x42')](_0x432d14);})['then'](function(_0x46e7f6){_0x1c7d83[_0xd781('0x43')]=_0x46e7f6;return _0x1c7d83;})['then'](respondWithFilteredResult(_0x54521e,_0x432d14))['catch'](handleError(_0x54521e,null));};exports[_0xd781('0x44')]=function(_0x1d901e,_0xaa552){var _0x4e2eea={'raw':!![],'where':{'id':_0x1d901e[_0xd781('0x45')]['id']}},_0x594f85={};_0x594f85[_0xd781('0x2f')]=_[_0xd781('0x46')](db[_0xd781('0x2c')][_0xd781('0x2d')]);_0x594f85[_0xd781('0x30')]=_['keys'](_0x1d901e['query']);_0x594f85[_0xd781('0x31')]=_[_0xd781('0x32')](_0x594f85[_0xd781('0x2f')],_0x594f85[_0xd781('0x30')]);_0x4e2eea[_0xd781('0x33')]=_['intersection'](_0x594f85[_0xd781('0x2f')],qs[_0xd781('0x34')](_0x1d901e[_0xd781('0x30')]['fields']));_0x4e2eea[_0xd781('0x33')]=_0x4e2eea[_0xd781('0x33')][_0xd781('0x35')]?_0x4e2eea['attributes']:_0x594f85[_0xd781('0x2f')];if(_0x1d901e[_0xd781('0x30')]['includeAll']){_0x4e2eea['include']=[{'all':!![]}];}_0x4e2eea=_[_0xd781('0x3c')]({},_0x4e2eea,_0x1d901e[_0xd781('0x3f')]);return db[_0xd781('0x2c')]['find'](_0x4e2eea)[_0xd781('0x26')](handleEntityNotFound(_0xaa552,null))[_0xd781('0x26')](respondWithResult(_0xaa552,null))[_0xd781('0x47')](handleError(_0xaa552,null));};exports[_0xd781('0x48')]=function(_0x336d30,_0x3828ad){return db[_0xd781('0x2c')]['create'](_0x336d30[_0xd781('0x49')],{})[_0xd781('0x26')](function(_0x1d54bd){var _0x4c7cb6=_0x336d30[_0xd781('0x4a')][_0xd781('0x27')]({'plain':!![]});if(!_0x4c7cb6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c7cb6[_0xd781('0x4b')]===_0xd781('0x4a')){var _0x41caac=_0x1d54bd[_0xd781('0x27')]({'plain':!![]});var _0x42a2f9='ContactItemTypes';return db[_0xd781('0x4c')]['find']({'where':{'name':_0x42a2f9,'userProfileId':_0x4c7cb6[_0xd781('0x4d')]},'raw':!![]})['then'](function(_0x2ce1f6){if(_0x2ce1f6&&_0x2ce1f6[_0xd781('0x4e')]===0x0){return db['UserProfileResource'][_0xd781('0x48')]({'name':_0x41caac['name'],'resourceId':_0x41caac['id'],'type':_0x2ce1f6['name'],'sectionId':_0x2ce1f6['id']},{})['then'](function(){return _0x1d54bd;});}else{return _0x1d54bd;}})[_0xd781('0x47')](function(_0x174fcd){logger['error'](_0xd781('0x4f'),_0x174fcd);throw _0x174fcd;});}return _0x1d54bd;})['then'](respondWithResult(_0x3828ad,0xc9))[_0xd781('0x47')](handleError(_0x3828ad,null));};exports[_0xd781('0x24')]=function(_0x39d47d,_0x19a6c2){if(_0x39d47d['body']['id']){delete _0x39d47d[_0xd781('0x49')]['id'];}return db['ContactItemType'][_0xd781('0x50')]({'where':{'id':_0x39d47d['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x19a6c2,null))[_0xd781('0x26')](saveUpdates(_0x39d47d['body'],null))[_0xd781('0x26')](respondWithResult(_0x19a6c2,null))[_0xd781('0x47')](handleError(_0x19a6c2,null));};exports[_0xd781('0x25')]=function(_0x32fd9f,_0xfc466c){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x32fd9f['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0xfc466c,null))[_0xd781('0x26')](db[_0xd781('0x51')][_0xd781('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x32fd9f['params']['id']}}))[_0xd781('0x26')](removeEntity(_0xfc466c,null))['catch'](handleError(_0xfc466c,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index d00ab03..002d988 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 _0x38db=['bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','api','moment'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0x38db,0x19d));var _0xb38d=function(_0x301393,_0x3a0fcc){_0x301393=_0x301393-0x0;var _0x5f2e66=_0x38db[_0x301393];return _0x5f2e66;};'use strict';var _=require('lodash');var util=require(_0xb38d('0x0'));var logger=require('../../config/logger')(_0xb38d('0x1'));var moment=require(_0xb38d('0x2'));var BPromise=require(_0xb38d('0x3'));var rp=require(_0xb38d('0x4'));var fs=require('fs');var path=require(_0xb38d('0x5'));var rimraf=require(_0xb38d('0x6'));var config=require(_0xb38d('0x7'));var attributes=require(_0xb38d('0x8'));module[_0xb38d('0x9')]=function(_0x10e5bb,_0x4611aa){return _0x10e5bb[_0xb38d('0xa')](_0xb38d('0xb'),attributes,{'tableName':_0xb38d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c81=['rimraf','../../config/environment','exports','define','tools_contact_item_types','../../config/logger','api','moment','request-promise','path'];(function(_0x5c7a09,_0x61180b){var _0x3c102f=function(_0x1916bf){while(--_0x1916bf){_0x5c7a09['push'](_0x5c7a09['shift']());}};_0x3c102f(++_0x61180b);}(_0x6c81,0x181));var _0x16c8=function(_0x1308ec,_0x32c99e){_0x1308ec=_0x1308ec-0x0;var _0x1a43c8=_0x6c81[_0x1308ec];return _0x1a43c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x16c8('0x0'))(_0x16c8('0x1'));var moment=require(_0x16c8('0x2'));var BPromise=require('bluebird');var rp=require(_0x16c8('0x3'));var fs=require('fs');var path=require(_0x16c8('0x4'));var rimraf=require(_0x16c8('0x5'));var config=require(_0x16c8('0x6'));var attributes=require('./contactItemType.attributes');module[_0x16c8('0x7')]=function(_0x4316fc,_0x473483){return _0x4316fc[_0x16c8('0x8')]('ContactItemType',attributes,{'tableName':_0x16c8('0x9'),'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 034e6e2..c1e5b7a 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 _0x7932=['info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3fdcba,_0x13ed8a){var _0xdb819c=function(_0x3d1075){while(--_0x3d1075){_0x3fdcba['push'](_0x3fdcba['shift']());}};_0xdb819c(++_0x13ed8a);}(_0x7932,0xf0));var _0x2793=function(_0x1d12a7,_0x3744be){_0x1d12a7=_0x1d12a7-0x0;var _0xbc1e6a=_0x7932[_0x1d12a7];return _0xbc1e6a;};'use strict';var _=require(_0x2793('0x0'));var util=require(_0x2793('0x1'));var moment=require('moment');var BPromise=require(_0x2793('0x2'));var rs=require(_0x2793('0x3'));var fs=require('fs');var Redis=require(_0x2793('0x4'));var db=require(_0x2793('0x5'))['db'];var utils=require(_0x2793('0x6'));var logger=require(_0x2793('0x7'))(_0x2793('0x8'));var config=require('../../config/environment');var jayson=require(_0x2793('0x9'));var client=jayson[_0x2793('0xa')][_0x2793('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35659f,_0xd39da5,_0x36285c){return new BPromise(function(_0x5c1b63,_0x5a1e23){return client[_0x2793('0xc')](_0x35659f,_0x36285c)['then'](function(_0x51ce06){logger[_0x2793('0xd')](_0x2793('0xe'),_0xd39da5,'request\x20sent');logger[_0x2793('0xf')](_0x2793('0x10'),_0xd39da5,'request\x20sent',JSON['stringify'](_0x51ce06));if(_0x51ce06[_0x2793('0x11')]){if(_0x51ce06[_0x2793('0x11')][_0x2793('0x12')]===0x1f4){logger[_0x2793('0x11')]('ContactItemType,\x20%s,\x20%s',_0xd39da5,_0x51ce06[_0x2793('0x11')][_0x2793('0x13')]);return _0x5a1e23(_0x51ce06['error'][_0x2793('0x13')]);}logger[_0x2793('0x11')](_0x2793('0xe'),_0xd39da5,_0x51ce06['error'][_0x2793('0x13')]);return _0x5c1b63(_0x51ce06['error'][_0x2793('0x13')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0xd39da5,_0x2793('0x14'));_0x5c1b63(_0x51ce06[_0x2793('0x15')][_0x2793('0x13')]);}})[_0x2793('0x16')](function(_0x5f5633){logger[_0x2793('0x11')]('ContactItemType,\x20%s,\x20%s',_0xd39da5,_0x5f5633);_0x5a1e23(_0x5f5633);});});} \ No newline at end of file +var _0x3715=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x34a209,_0x2956c1){var _0x394785=function(_0xf136ae){while(--_0xf136ae){_0x34a209['push'](_0x34a209['shift']());}};_0x394785(++_0x2956c1);}(_0x3715,0xc3));var _0x5371=function(_0x55a85f,_0x48c076){_0x55a85f=_0x55a85f-0x0;var _0x46cd73=_0x3715[_0x55a85f];return _0x46cd73;};'use strict';var _=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var moment=require(_0x5371('0x2'));var BPromise=require(_0x5371('0x3'));var rs=require(_0x5371('0x4'));var fs=require('fs');var Redis=require(_0x5371('0x5'));var db=require(_0x5371('0x6'))['db'];var utils=require(_0x5371('0x7'));var logger=require(_0x5371('0x8'))(_0x5371('0x9'));var config=require(_0x5371('0xa'));var jayson=require(_0x5371('0xb'));var client=jayson['client'][_0x5371('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x340e44,_0x5edddc,_0x426a2a){return new BPromise(function(_0x16c64a,_0x41d142){return client['request'](_0x340e44,_0x426a2a)[_0x5371('0xd')](function(_0x48b76c){logger['info'](_0x5371('0xe'),_0x5edddc,_0x5371('0xf'));logger[_0x5371('0x10')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x5edddc,_0x5371('0xf'),JSON[_0x5371('0x11')](_0x48b76c));if(_0x48b76c[_0x5371('0x12')]){if(_0x48b76c['error'][_0x5371('0x13')]===0x1f4){logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x48b76c[_0x5371('0x12')]['message']);return _0x41d142(_0x48b76c[_0x5371('0x12')]['message']);}logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x48b76c['error'][_0x5371('0x14')]);return _0x16c64a(_0x48b76c[_0x5371('0x12')][_0x5371('0x14')]);}else{logger[_0x5371('0x15')](_0x5371('0xe'),_0x5edddc,_0x5371('0xf'));_0x16c64a(_0x48b76c[_0x5371('0x16')]['message']);}})[_0x5371('0x17')](function(_0x3e7169){logger[_0x5371('0x12')](_0x5371('0xe'),_0x5edddc,_0x3e7169);_0x41d142(_0x3e7169);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 19cc715..4f2ccfd 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 _0x8524=['index','get','/:id','show','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8524,0x1d4));var _0x4852=function(_0x228446,_0x37bff0){_0x228446=_0x228446-0x0;var _0x4a6e46=_0x8524[_0x228446];return _0x4a6e46;};'use strict';var multer=require(_0x4852('0x0'));var util=require(_0x4852('0x1'));var path=require(_0x4852('0x2'));var timeout=require(_0x4852('0x3'));var express=require(_0x4852('0x4'));var router=express[_0x4852('0x5')]();var fs_extra=require(_0x4852('0x6'));var auth=require(_0x4852('0x7'));var interaction=require(_0x4852('0x8'));var config=require(_0x4852('0x9'));var controller=require(_0x4852('0xa'));router['get']('/',auth[_0x4852('0xb')](),controller[_0x4852('0xc')]);router[_0x4852('0xd')](_0x4852('0xe'),auth[_0x4852('0xb')](),controller[_0x4852('0xf')]);router['post']('/',auth[_0x4852('0xb')](),controller[_0x4852('0x10')]);router[_0x4852('0x11')](_0x4852('0xe'),auth[_0x4852('0xb')](),controller[_0x4852('0x12')]);router[_0x4852('0x13')](_0x4852('0xe'),auth[_0x4852('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe153=['create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./contactItemType.controller','get','index','/:id','isAuthenticated','show'];(function(_0xe47126,_0x32bfd3){var _0x1ada08=function(_0x39649c){while(--_0x39649c){_0xe47126['push'](_0xe47126['shift']());}};_0x1ada08(++_0x32bfd3);}(_0xe153,0x70));var _0x3e15=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe153[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x3e15('0x0'));var util=require(_0x3e15('0x1'));var path=require(_0x3e15('0x2'));var timeout=require(_0x3e15('0x3'));var express=require(_0x3e15('0x4'));var router=express[_0x3e15('0x5')]();var fs_extra=require(_0x3e15('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3e15('0x7'));var controller=require(_0x3e15('0x8'));router[_0x3e15('0x9')]('/',auth['isAuthenticated'](),controller[_0x3e15('0xa')]);router[_0x3e15('0x9')](_0x3e15('0xb'),auth[_0x3e15('0xc')](),controller[_0x3e15('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3e15('0xe')]);router[_0x3e15('0xf')](_0x3e15('0xb'),auth[_0x3e15('0xc')](),controller[_0x3e15('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3e15('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9894da7..27168c7 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 _0xb10b=['name','sequelize','STRING'];(function(_0x246bb0,_0x28acb3){var _0x5970de=function(_0x1dd7f5){while(--_0x1dd7f5){_0x246bb0['push'](_0x246bb0['shift']());}};_0x5970de(++_0x28acb3);}(_0xb10b,0x12a));var _0xbb10=function(_0x47d1ae,_0x41e056){_0x47d1ae=_0x47d1ae-0x0;var _0x47328a=_0xb10b[_0x47d1ae];return _0x47328a;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index c96421f..4d3429d 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 _0x4837=['attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','attrReport','attrRefresh','stringify','addItem','DashboardItem','getItems','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','send','index','map','fieldName','key','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','Dashboard','catch','show','params','length','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','includeAll','updatedAt','createdAt','update','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4837,0x96));var _0x7483=function(_0x135c9d,_0x392049){_0x135c9d=_0x135c9d-0x0;var _0x2e2fc6=_0x4837[_0x135c9d];return _0x2e2fc6;};'use strict';var emlformat=require(_0x7483('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7483('0x1'));var jsonpatch=require(_0x7483('0x2'));var rp=require(_0x7483('0x3'));var moment=require(_0x7483('0x4'));var BPromise=require(_0x7483('0x5'));var Mustache=require(_0x7483('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7483('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7483('0x8'));var _=require(_0x7483('0x9'));var squel=require(_0x7483('0xa'));var crypto=require(_0x7483('0xb'));var jsforce=require(_0x7483('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7483('0xd'));var querystring=require(_0x7483('0xe'));var Papa=require('papaparse');var Redis=require(_0x7483('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7483('0x10'));var hardwareService=require(_0x7483('0x11'));var logger=require(_0x7483('0x12'))(_0x7483('0x13'));var utils=require(_0x7483('0x14'));var config=require(_0x7483('0x15'));var licenseUtil=require(_0x7483('0x16'));var db=require(_0x7483('0x17'))['db'];config['redis']=_[_0x7483('0x18')](config[_0x7483('0x19')],{'host':_0x7483('0x1a'),'port':0x18eb});var socket=require(_0x7483('0x1b'))(new Redis(config[_0x7483('0x19')]));require(_0x7483('0x1c'))[_0x7483('0x1d')](socket);function respondWithStatusCode(_0x366910,_0x11c078){_0x11c078=_0x11c078||0xcc;return function(_0x3ff27e){if(_0x3ff27e){return _0x366910[_0x7483('0x1e')](_0x11c078);}return _0x366910['status'](_0x11c078)[_0x7483('0x1f')]();};}function respondWithResult(_0x519ea7,_0x4c6fbb){_0x4c6fbb=_0x4c6fbb||0xc8;return function(_0x33127d){if(_0x33127d){return _0x519ea7[_0x7483('0x20')](_0x4c6fbb)['json'](_0x33127d);}};}function respondWithFilteredResult(_0xe2d2c7,_0x197503){return function(_0x5a7c7f){if(_0x5a7c7f){var _0x3c7e1c=typeof _0x197503['offset']===_0x7483('0x21')&&typeof _0x197503[_0x7483('0x22')]===_0x7483('0x21');var _0xd9cc5f=_0x5a7c7f[_0x7483('0x23')];var _0x1a1449=_0x3c7e1c?0x0:_0x197503['offset'];var _0x548b53=_0x3c7e1c?_0x5a7c7f[_0x7483('0x23')]:_0x197503[_0x7483('0x24')]+_0x197503[_0x7483('0x22')];var _0x391bf7;if(_0x548b53>=_0xd9cc5f){_0x548b53=_0xd9cc5f;_0x391bf7=0xc8;}else{_0x391bf7=0xce;}_0xe2d2c7[_0x7483('0x20')](_0x391bf7);return _0xe2d2c7[_0x7483('0x25')](_0x7483('0x26'),_0x1a1449+'-'+_0x548b53+'/'+_0xd9cc5f)[_0x7483('0x27')](_0x5a7c7f);}return null;};}function patchUpdates(_0x1e2f9d){return function(_0x35ee26){try{jsonpatch[_0x7483('0x28')](_0x35ee26,_0x1e2f9d,!![]);}catch(_0x55629d){return BPromise['reject'](_0x55629d);}return _0x35ee26[_0x7483('0x29')]();};}function saveUpdates(_0x53d839,_0x39083f){return function(_0x42a4b6){if(_0x42a4b6){return _0x42a4b6['update'](_0x53d839)[_0x7483('0x2a')](function(_0x273901){return _0x273901;});}return null;};}function removeEntity(_0x42f3a7,_0x6632a7){return function(_0x5ac8f9){if(_0x5ac8f9){return _0x5ac8f9[_0x7483('0x2b')]()[_0x7483('0x2a')](function(){var _0x3474ef=_0x5ac8f9[_0x7483('0x2c')]({'plain':!![]});var _0xab673f=_0x7483('0x2d');return db[_0x7483('0x2e')][_0x7483('0x2b')]({'where':{'type':_0xab673f,'resourceId':_0x3474ef['id']}})[_0x7483('0x2a')](function(){return _0x5ac8f9;});})[_0x7483('0x2a')](function(){_0x42f3a7[_0x7483('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e187,_0x463c43){return function(_0x2d157d){if(!_0x2d157d){_0x41e187[_0x7483('0x1e')](0x194);}return _0x2d157d;};}function handleError(_0x10e022,_0x1659bd){_0x1659bd=_0x1659bd||0x1f4;return function(_0x10a52d){logger[_0x7483('0x2f')](_0x10a52d[_0x7483('0x30')]);if(_0x10a52d['name']){delete _0x10a52d['name'];}_0x10e022[_0x7483('0x20')](_0x1659bd)[_0x7483('0x31')](_0x10a52d);};}exports[_0x7483('0x32')]=function(_0x1eacae,_0xbb208b){var _0x1a6e9b={},_0x3da519={},_0x474ce3={'count':0x0,'rows':[]};var _0x5a4bbf=_[_0x7483('0x33')](db['Dashboard']['rawAttributes'],function(_0x5c027a){return{'name':_0x5c027a[_0x7483('0x34')],'type':_0x5c027a['type'][_0x7483('0x35')]};});_0x3da519['model']=_[_0x7483('0x33')](_0x5a4bbf,'name');_0x3da519['query']=_[_0x7483('0x36')](_0x1eacae[_0x7483('0x37')]);_0x3da519[_0x7483('0x38')]=_[_0x7483('0x39')](_0x3da519['model'],_0x3da519['query']);_0x1a6e9b[_0x7483('0x3a')]=_[_0x7483('0x39')](_0x3da519['model'],qs[_0x7483('0x3b')](_0x1eacae['query'][_0x7483('0x3b')]));_0x1a6e9b['attributes']=_0x1a6e9b['attributes']['length']?_0x1a6e9b['attributes']:_0x3da519[_0x7483('0x3c')];if(!_0x1eacae[_0x7483('0x37')][_0x7483('0x3d')](_0x7483('0x3e'))){_0x1a6e9b[_0x7483('0x22')]=qs[_0x7483('0x22')](_0x1eacae[_0x7483('0x37')][_0x7483('0x22')]);_0x1a6e9b[_0x7483('0x24')]=qs[_0x7483('0x24')](_0x1eacae[_0x7483('0x37')][_0x7483('0x24')]);}_0x1a6e9b[_0x7483('0x3f')]=qs[_0x7483('0x40')](_0x1eacae[_0x7483('0x37')][_0x7483('0x40')]);_0x1a6e9b[_0x7483('0x41')]=qs[_0x7483('0x38')](_[_0x7483('0x42')](_0x1eacae['query'],_0x3da519[_0x7483('0x38')]),_0x5a4bbf);if(_0x1eacae[_0x7483('0x37')][_0x7483('0x43')]){_0x1a6e9b[_0x7483('0x41')]=_[_0x7483('0x44')](_0x1a6e9b[_0x7483('0x41')],{'$or':_[_0x7483('0x33')](_0x5a4bbf,function(_0x1f1c54){if(_0x1f1c54[_0x7483('0x45')]!==_0x7483('0x46')){var _0x29e751={};_0x29e751[_0x1f1c54[_0x7483('0x47')]]={'$like':'%'+_0x1eacae[_0x7483('0x37')]['filter']+'%'};return _0x29e751;}})});}_0x1a6e9b=_[_0x7483('0x44')]({},_0x1a6e9b,_0x1eacae['options']);var _0x7b16ee={'where':_0x1a6e9b[_0x7483('0x41')]};return db['Dashboard'][_0x7483('0x23')](_0x7b16ee)[_0x7483('0x2a')](function(_0xb01656){_0x474ce3[_0x7483('0x23')]=_0xb01656;if(_0x1eacae[_0x7483('0x37')]['includeAll']){_0x1a6e9b['include']=[{'all':!![]}];}return db[_0x7483('0x48')]['findAll'](_0x1a6e9b);})[_0x7483('0x2a')](function(_0x15dc06){_0x474ce3['rows']=_0x15dc06;return _0x474ce3;})[_0x7483('0x2a')](respondWithFilteredResult(_0xbb208b,_0x1a6e9b))[_0x7483('0x49')](handleError(_0xbb208b,null));};exports[_0x7483('0x4a')]=function(_0x39d7cf,_0x487d20){var _0x3c5e3c={'raw':![],'where':{'id':_0x39d7cf[_0x7483('0x4b')]['id']}},_0x15e545={};_0x15e545[_0x7483('0x3c')]=_[_0x7483('0x36')](db['Dashboard']['rawAttributes']);_0x15e545['query']=_['keys'](_0x39d7cf[_0x7483('0x37')]);_0x15e545['filters']=_['intersection'](_0x15e545[_0x7483('0x3c')],_0x15e545[_0x7483('0x37')]);_0x3c5e3c[_0x7483('0x3a')]=_[_0x7483('0x39')](_0x15e545['model'],qs[_0x7483('0x3b')](_0x39d7cf[_0x7483('0x37')][_0x7483('0x3b')]));_0x3c5e3c[_0x7483('0x3a')]=_0x3c5e3c[_0x7483('0x3a')][_0x7483('0x4c')]?_0x3c5e3c[_0x7483('0x3a')]:_0x15e545['model'];if(_0x39d7cf['query']['includeAll']){_0x3c5e3c[_0x7483('0x4d')]=[{'all':!![]}];}_0x3c5e3c=_['merge']({},_0x3c5e3c,_0x39d7cf[_0x7483('0x4e')]);return db[_0x7483('0x48')]['find'](_0x3c5e3c)[_0x7483('0x2a')](handleEntityNotFound(_0x487d20,null))['then'](respondWithResult(_0x487d20,null))[_0x7483('0x49')](handleError(_0x487d20,null));};exports[_0x7483('0x4f')]=function(_0x240ca8,_0x187680){return db['Dashboard'][_0x7483('0x4f')](_0x240ca8[_0x7483('0x50')],{})['then'](function(_0x287f5c){var _0x2e5724=_0x240ca8['user'][_0x7483('0x2c')]({'plain':!![]});if(!_0x2e5724)throw new Error(_0x7483('0x51'));if(_0x2e5724[_0x7483('0x52')]===_0x7483('0x53')){var _0x3c0eb6=_0x287f5c['get']({'plain':!![]});var _0x142275=_0x7483('0x2d');return db[_0x7483('0x54')][_0x7483('0x55')]({'where':{'name':_0x142275,'userProfileId':_0x2e5724[_0x7483('0x56')]},'raw':!![]})[_0x7483('0x2a')](function(_0x577829){if(_0x577829&&_0x577829[_0x7483('0x57')]===0x0){return db[_0x7483('0x2e')][_0x7483('0x4f')]({'name':_0x3c0eb6[_0x7483('0x47')],'resourceId':_0x3c0eb6['id'],'type':_0x577829[_0x7483('0x47')],'sectionId':_0x577829['id']},{})[_0x7483('0x2a')](function(){return _0x287f5c;});}else{return _0x287f5c;}})[_0x7483('0x49')](function(_0x28584f){logger[_0x7483('0x2f')](_0x7483('0x58'),_0x28584f);throw _0x28584f;});}return _0x287f5c;})[_0x7483('0x2a')](respondWithResult(_0x187680,0xc9))[_0x7483('0x49')](handleError(_0x187680,null));};exports[_0x7483('0x59')]=function(_0x3b38e9,_0x55fd15){var _0x1a414e={'where':{'id':_0x3b38e9[_0x7483('0x4b')]['id']}},_0x3153b4={};_0x3153b4[_0x7483('0x3c')]=_[_0x7483('0x36')](db[_0x7483('0x48')][_0x7483('0x5a')]);_0x1a414e[_0x7483('0x3a')]=_[_0x7483('0x39')](_0x3153b4[_0x7483('0x3c')],qs[_0x7483('0x3b')](_0x3b38e9['query'][_0x7483('0x3b')]));_0x1a414e[_0x7483('0x3a')]=_0x1a414e[_0x7483('0x3a')][_0x7483('0x4c')]?_0x1a414e[_0x7483('0x3a')]:_0x3153b4[_0x7483('0x3c')];if(_0x3b38e9[_0x7483('0x37')][_0x7483('0x5b')]){_0x1a414e[_0x7483('0x4d')]=[{'all':!![]}];}_0x1a414e=_['merge']({},_0x1a414e,_0x3b38e9['options']);return db['Dashboard'][_0x7483('0x55')](_0x1a414e)[_0x7483('0x2a')](handleEntityNotFound(_0x55fd15,null))[_0x7483('0x2a')](function(_0x35484e){if(_0x35484e){var _0x29d8d4=_0x35484e[_0x7483('0x2c')]({'plain':!![]});_0x29d8d4=qs['omit'](_0x29d8d4,['id','createdAt',_0x7483('0x5c')]);_0x3b38e9[_0x7483('0x50')]=_['omit'](_0x3b38e9[_0x7483('0x50')],['id',_0x7483('0x5d'),_0x7483('0x5c')]);return db[_0x7483('0x48')]['create'](_[_0x7483('0x44')](_0x29d8d4,_0x3b38e9[_0x7483('0x50')]),{'include':_0x3b38e9[_0x7483('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x7483('0x2a')](function(_0x17e783){var _0x5afc7e=_0x3b38e9[_0x7483('0x53')]['get']({'plain':!![]});if(!_0x5afc7e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5afc7e['role']===_0x7483('0x53')){var _0x594404=_0x17e783[_0x7483('0x2c')]({'plain':!![]});var _0x1017d2=_0x7483('0x2d');return db['UserProfileSection'][_0x7483('0x55')]({'where':{'name':_0x1017d2,'userProfileId':_0x5afc7e[_0x7483('0x56')]},'raw':!![]})['then'](function(_0x3e4cff){if(_0x3e4cff&&_0x3e4cff[_0x7483('0x57')]===0x0){return db[_0x7483('0x2e')][_0x7483('0x4f')]({'name':_0x594404[_0x7483('0x47')],'resourceId':_0x594404['id'],'type':_0x3e4cff[_0x7483('0x47')],'sectionId':_0x3e4cff['id']},{})['then'](function(){return _0x17e783;});}else{return _0x17e783;}})['catch'](function(_0xa3e300){logger[_0x7483('0x2f')](_0x7483('0x58'),_0xa3e300);throw _0xa3e300;});}return _0x17e783;});}})[_0x7483('0x2a')](respondWithResult(_0x55fd15,0xc9))[_0x7483('0x49')](handleError(_0x55fd15,null));};exports[_0x7483('0x5e')]=function(_0x3396fc,_0x30c6ae){if(_0x3396fc[_0x7483('0x50')]['id']){delete _0x3396fc[_0x7483('0x50')]['id'];}return db['Dashboard'][_0x7483('0x55')]({'where':{'id':_0x3396fc[_0x7483('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30c6ae,null))[_0x7483('0x2a')](saveUpdates(_0x3396fc[_0x7483('0x50')],null))[_0x7483('0x2a')](respondWithResult(_0x30c6ae,null))[_0x7483('0x49')](handleError(_0x30c6ae,null));};exports[_0x7483('0x2b')]=function(_0x1cbb48,_0x115442){return db[_0x7483('0x48')][_0x7483('0x55')]({'where':{'id':_0x1cbb48[_0x7483('0x4b')]['id']}})[_0x7483('0x2a')](handleEntityNotFound(_0x115442,null))[_0x7483('0x2a')](removeEntity(_0x115442,null))['catch'](handleError(_0x115442,null));};function widgetAttributes(_0x20b521){try{switch(_0x20b521['type']){case'iframe':return[{'name':_0x7483('0x5f'),'value':_0x20b521[_0x7483('0x5f')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x0]?_0x20b521[_0x7483('0x60')][0x0][_0x7483('0x61')]:undefined)||_0x7483('0x62')}];case _0x7483('0x63'):return[{'name':_0x7483('0x64'),'value':_0x20b521[_0x7483('0x64')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521['attrs'][0x0]?_0x20b521[_0x7483('0x60')][0x0][_0x7483('0x61')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x20b521['attrHourFormat']||(_0x20b521[_0x7483('0x60')]&&_0x20b521['attrs'][0x0]?_0x20b521[_0x7483('0x60')][0x0][_0x7483('0x61')]:undefined)||_0x7483('0x65')},{'name':'attrTimezone','value':_0x20b521[_0x7483('0x66')]||(_0x20b521['attrs']&&_0x20b521[_0x7483('0x60')][0x1]?_0x20b521['attrs'][0x1][_0x7483('0x61')]:undefined)||_0x7483('0x67')},{'name':_0x7483('0x68'),'value':_0x20b521[_0x7483('0x68')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x2]?_0x20b521['attrs'][0x2][_0x7483('0x61')]:undefined)||0xc}];case'counter':return[{'name':_0x7483('0x69'),'value':_0x20b521['attrMetric']||(_0x20b521['attrs']&&_0x20b521[_0x7483('0x60')][0x0]?_0x20b521[_0x7483('0x60')][0x0][_0x7483('0x61')]:undefined)||_0x7483('0x6a')},{'name':_0x7483('0x6b'),'value':_0x20b521['attrVoiceQueues']||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x1]?_0x20b521[_0x7483('0x60')][0x1][_0x7483('0x61')]:undefined)||[]},{'name':_0x7483('0x68'),'value':_0x20b521[_0x7483('0x68')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x2]?_0x20b521[_0x7483('0x60')][0x2][_0x7483('0x61')]:undefined)||0x14},{'name':'attrChannel','value':_0x20b521[_0x7483('0x6c')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x3]?_0x20b521[_0x7483('0x60')][0x3][_0x7483('0x61')]:undefined)||_0x7483('0x6d')},{'name':'attrEmailAccounts','value':_0x20b521['attrEmailAccounts']||(_0x20b521['attrs']&&_0x20b521[_0x7483('0x60')][0x4]?_0x20b521['attrs'][0x4]['value']:undefined)||''},{'name':_0x7483('0x6e'),'value':_0x20b521[_0x7483('0x6e')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x5]?_0x20b521['attrs'][0x5][_0x7483('0x61')]:undefined)||''},{'name':_0x7483('0x6f'),'value':_0x20b521[_0x7483('0x6f')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x6]?_0x20b521[_0x7483('0x60')][0x6]['value']:undefined)||''},{'name':_0x7483('0x70'),'value':_0x20b521[_0x7483('0x70')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x7]?_0x20b521[_0x7483('0x60')][0x7][_0x7483('0x61')]:undefined)||''},{'name':_0x7483('0x71'),'value':_0x20b521[_0x7483('0x71')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x8]?_0x20b521[_0x7483('0x60')][0x8]['value']:undefined)||''},{'name':_0x7483('0x72'),'value':_0x20b521[_0x7483('0x72')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x9]?_0x20b521[_0x7483('0x60')][0x9]['value']:undefined)||''}];case _0x7483('0x73'):case _0x7483('0x74'):return[{'name':'attrSerie1','value':_0x20b521[_0x7483('0x75')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x0]?_0x20b521[_0x7483('0x60')][0x0]['value']:undefined)||'total'},{'name':_0x7483('0x76'),'value':_0x20b521[_0x7483('0x76')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x1]?_0x20b521[_0x7483('0x60')][0x1][_0x7483('0x61')]:undefined)||null},{'name':_0x7483('0x77'),'value':_0x20b521['attrSerie3']||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x2]?_0x20b521[_0x7483('0x60')][0x2][_0x7483('0x61')]:undefined)||null},{'name':_0x7483('0x6b'),'value':_0x20b521[_0x7483('0x6b')]||(_0x20b521['attrs']&&_0x20b521[_0x7483('0x60')][0x3]?_0x20b521[_0x7483('0x60')][0x3][_0x7483('0x61')]:undefined)||[]},{'name':_0x7483('0x6c'),'value':_0x20b521[_0x7483('0x6c')]||(_0x20b521['attrs']&&_0x20b521['attrs'][0x4]?_0x20b521[_0x7483('0x60')][0x4][_0x7483('0x61')]:undefined)||_0x7483('0x6d')},{'name':_0x7483('0x78'),'value':_0x20b521[_0x7483('0x78')]||(_0x20b521['attrs']&&_0x20b521[_0x7483('0x60')][0x5]?_0x20b521['attrs'][0x5]['value']:undefined)||''},{'name':_0x7483('0x6e'),'value':_0x20b521[_0x7483('0x6e')]||(_0x20b521['attrs']&&_0x20b521[_0x7483('0x60')][0x6]?_0x20b521[_0x7483('0x60')][0x6]['value']:undefined)||''},{'name':_0x7483('0x6f'),'value':_0x20b521[_0x7483('0x6f')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521['attrs'][0x7]?_0x20b521[_0x7483('0x60')][0x7][_0x7483('0x61')]:undefined)||''},{'name':_0x7483('0x70'),'value':_0x20b521[_0x7483('0x70')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x8]?_0x20b521[_0x7483('0x60')][0x8][_0x7483('0x61')]:undefined)||''},{'name':_0x7483('0x71'),'value':_0x20b521[_0x7483('0x71')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x9]?_0x20b521[_0x7483('0x60')][0x9][_0x7483('0x61')]:undefined)||''},{'name':_0x7483('0x72'),'value':_0x20b521[_0x7483('0x72')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521['attrs'][0xa]?_0x20b521[_0x7483('0x60')][0xa][_0x7483('0x61')]:undefined)||''}];case _0x7483('0x79'):return[{'name':_0x7483('0x7a'),'type':_0x20b521['reportType']||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x0]?_0x20b521[_0x7483('0x60')][0x0][_0x7483('0x45')]:undefined)||null,'value':_0x20b521[_0x7483('0x7a')]||(_0x20b521['attrs']&&_0x20b521[_0x7483('0x60')][0x0]?_0x20b521[_0x7483('0x60')][0x0][_0x7483('0x61')]:undefined)||null},{'name':_0x7483('0x7b'),'value':_0x20b521[_0x7483('0x7b')]||(_0x20b521[_0x7483('0x60')]&&_0x20b521[_0x7483('0x60')][0x1]?_0x20b521[_0x7483('0x60')][0x1][_0x7483('0x61')]:undefined)||0x0}];default:return[];}}catch(_0xb5b691){logger[_0x7483('0x2f')]('widgetAttributes:\x20%s',JSON[_0x7483('0x7c')](_0xb5b691));return[];}}exports[_0x7483('0x7d')]=function(_0x17e5a9,_0x460530,_0x338f83){if(_0x17e5a9[_0x7483('0x50')]['id']){delete _0x17e5a9[_0x7483('0x50')]['id'];}return db[_0x7483('0x48')][_0x7483('0x55')]({'where':{'id':_0x17e5a9['params']['id']}})['then'](handleEntityNotFound(_0x460530,null))[_0x7483('0x2a')](function(_0x33ccb3){if(_0x33ccb3){_0x17e5a9[_0x7483('0x50')]['DashboardId']=_0x33ccb3['id'];_0x17e5a9['body'][_0x7483('0x60')]=widgetAttributes(_0x17e5a9[_0x7483('0x50')]);return db[_0x7483('0x7e')][_0x7483('0x4f')](_0x17e5a9[_0x7483('0x50')]);}})[_0x7483('0x2a')](respondWithResult(_0x460530,null))[_0x7483('0x49')](handleError(_0x460530,null));};exports[_0x7483('0x7f')]=function(_0x3fec10,_0x25ff5a,_0x11cd13){var _0x8eb24c={};var _0x1e86a8={};var _0x1dad05;var _0xfdafa1;return db[_0x7483('0x48')][_0x7483('0x80')]({'where':{'id':_0x3fec10[_0x7483('0x4b')]['id']}})[_0x7483('0x2a')](handleEntityNotFound(_0x25ff5a,null))['then'](function(_0x4b4e90){if(_0x4b4e90){_0x1dad05=_0x4b4e90;_0x1e86a8['model']=_[_0x7483('0x36')](db[_0x7483('0x7e')]['rawAttributes']);_0x1e86a8[_0x7483('0x37')]=_[_0x7483('0x36')](_0x3fec10[_0x7483('0x37')]);_0x1e86a8[_0x7483('0x38')]=_[_0x7483('0x39')](_0x1e86a8[_0x7483('0x3c')],_0x1e86a8['query']);_0x8eb24c[_0x7483('0x3a')]=_[_0x7483('0x39')](_0x1e86a8['model'],qs[_0x7483('0x3b')](_0x3fec10[_0x7483('0x37')]['fields']));_0x8eb24c['attributes']=_0x8eb24c[_0x7483('0x3a')][_0x7483('0x4c')]?_0x8eb24c[_0x7483('0x3a')]:_0x1e86a8[_0x7483('0x3c')];_0x8eb24c['order']=qs[_0x7483('0x40')](_0x3fec10[_0x7483('0x37')]['sort']);_0x8eb24c['where']=qs['filters'](_['pick'](_0x3fec10[_0x7483('0x37')],_0x1e86a8[_0x7483('0x38')]));if(_0x3fec10[_0x7483('0x37')][_0x7483('0x43')]){_0x8eb24c['where']=_[_0x7483('0x44')](_0x8eb24c[_0x7483('0x41')],{'$or':_['map'](_0x8eb24c[_0x7483('0x3a')],function(_0x4b326b){var _0x11260b={};_0x11260b[_0x4b326b]={'$like':'%'+_0x3fec10[_0x7483('0x37')][_0x7483('0x43')]+'%'};return _0x11260b;})});}_0x8eb24c=_[_0x7483('0x44')]({},_0x8eb24c,_0x3fec10[_0x7483('0x4e')]);return _0x1dad05[_0x7483('0x7f')](_0x8eb24c);}})[_0x7483('0x2a')](function(_0x39f239){if(_0x39f239){_0xfdafa1=_0x39f239[_0x7483('0x4c')];if(!_0x3fec10[_0x7483('0x37')][_0x7483('0x3d')](_0x7483('0x3e'))){_0x8eb24c[_0x7483('0x22')]=qs[_0x7483('0x22')](_0x3fec10[_0x7483('0x37')][_0x7483('0x22')]);_0x8eb24c['offset']=qs[_0x7483('0x24')](_0x3fec10[_0x7483('0x37')][_0x7483('0x24')]);}return _0x1dad05[_0x7483('0x7f')](_0x8eb24c);}})[_0x7483('0x2a')](function(_0x415f64){if(_0x415f64){return _0x415f64?{'count':_0xfdafa1,'rows':_0x415f64}:null;}})[_0x7483('0x2a')](respondWithResult(_0x25ff5a,null))[_0x7483('0x49')](handleError(_0x25ff5a,null));}; \ No newline at end of file +var _0x7cae=['api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','limit','count','set','apply','update','then','UserProfileResource','destroy','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total','attrSerie3','web-report','attrReport','reportType','attrRefresh','addItem','DashboardId','DashboardItem','getItems','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x7cae,0xed));var _0xe7ca=function(_0x581c99,_0xdbd802){_0x581c99=_0x581c99-0x0;var _0x19f0f3=_0x7cae[_0x581c99];return _0x19f0f3;};'use strict';var emlformat=require(_0xe7ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7ca('0x1'));var jsonpatch=require(_0xe7ca('0x2'));var rp=require(_0xe7ca('0x3'));var moment=require(_0xe7ca('0x4'));var BPromise=require(_0xe7ca('0x5'));var Mustache=require(_0xe7ca('0x6'));var util=require(_0xe7ca('0x7'));var path=require(_0xe7ca('0x8'));var sox=require(_0xe7ca('0x9'));var csv=require(_0xe7ca('0xa'));var ejs=require(_0xe7ca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7ca('0xc'));var squel=require(_0xe7ca('0xd'));var crypto=require(_0xe7ca('0xe'));var jsforce=require(_0xe7ca('0xf'));var deskjs=require(_0xe7ca('0x10'));var toCsv=require(_0xe7ca('0xa'));var querystring=require(_0xe7ca('0x11'));var Papa=require('papaparse');var Redis=require(_0xe7ca('0x12'));var authService=require(_0xe7ca('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe7ca('0x14'));var hardwareService=require(_0xe7ca('0x15'));var logger=require(_0xe7ca('0x16'))(_0xe7ca('0x17'));var utils=require(_0xe7ca('0x18'));var config=require(_0xe7ca('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ca('0x1a'))['db'];config[_0xe7ca('0x1b')]=_['defaults'](config['redis'],{'host':_0xe7ca('0x1c'),'port':0x18eb});var socket=require(_0xe7ca('0x1d'))(new Redis(config['redis']));require(_0xe7ca('0x1e'))[_0xe7ca('0x1f')](socket);function respondWithStatusCode(_0x165828,_0x121070){_0x121070=_0x121070||0xcc;return function(_0x4a8643){if(_0x4a8643){return _0x165828[_0xe7ca('0x20')](_0x121070);}return _0x165828[_0xe7ca('0x21')](_0x121070)[_0xe7ca('0x22')]();};}function respondWithResult(_0x3f7952,_0x5c5293){_0x5c5293=_0x5c5293||0xc8;return function(_0x42d10a){if(_0x42d10a){return _0x3f7952[_0xe7ca('0x21')](_0x5c5293)['json'](_0x42d10a);}};}function respondWithFilteredResult(_0x28eddb,_0x4d13e2){return function(_0x333ecf){if(_0x333ecf){var _0x20429b=typeof _0x4d13e2[_0xe7ca('0x23')]==='undefined'&&typeof _0x4d13e2[_0xe7ca('0x24')]==='undefined';var _0x3af4bb=_0x333ecf[_0xe7ca('0x25')];var _0x10f3dc=_0x20429b?0x0:_0x4d13e2['offset'];var _0x43d808=_0x20429b?_0x333ecf[_0xe7ca('0x25')]:_0x4d13e2[_0xe7ca('0x23')]+_0x4d13e2[_0xe7ca('0x24')];var _0x5b00ca;if(_0x43d808>=_0x3af4bb){_0x43d808=_0x3af4bb;_0x5b00ca=0xc8;}else{_0x5b00ca=0xce;}_0x28eddb[_0xe7ca('0x21')](_0x5b00ca);return _0x28eddb[_0xe7ca('0x26')]('Content-Range',_0x10f3dc+'-'+_0x43d808+'/'+_0x3af4bb)['json'](_0x333ecf);}return null;};}function patchUpdates(_0x42cd57){return function(_0x5a0ee2){try{jsonpatch[_0xe7ca('0x27')](_0x5a0ee2,_0x42cd57,!![]);}catch(_0x391c19){return BPromise['reject'](_0x391c19);}return _0x5a0ee2['save']();};}function saveUpdates(_0xc39dbc,_0x2ada2b){return function(_0x480b5a){if(_0x480b5a){return _0x480b5a[_0xe7ca('0x28')](_0xc39dbc)[_0xe7ca('0x29')](function(_0x1c9596){return _0x1c9596;});}return null;};}function removeEntity(_0x4a4491,_0x51fd7e){return function(_0x186d42){if(_0x186d42){return _0x186d42['destroy']()[_0xe7ca('0x29')](function(){var _0x17de52=_0x186d42['get']({'plain':!![]});var _0x1593e8='CustomDashboards';return db[_0xe7ca('0x2a')][_0xe7ca('0x2b')]({'where':{'type':_0x1593e8,'resourceId':_0x17de52['id']}})['then'](function(){return _0x186d42;});})[_0xe7ca('0x29')](function(){_0x4a4491[_0xe7ca('0x21')](0xcc)[_0xe7ca('0x22')]();});}};}function handleEntityNotFound(_0x463ac9,_0x371f62){return function(_0x4afcaf){if(!_0x4afcaf){_0x463ac9['sendStatus'](0x194);}return _0x4afcaf;};}function handleError(_0x1eaa76,_0x3b36cd){_0x3b36cd=_0x3b36cd||0x1f4;return function(_0x237f6b){logger[_0xe7ca('0x2c')](_0x237f6b[_0xe7ca('0x2d')]);if(_0x237f6b[_0xe7ca('0x2e')]){delete _0x237f6b[_0xe7ca('0x2e')];}_0x1eaa76[_0xe7ca('0x21')](_0x3b36cd)[_0xe7ca('0x2f')](_0x237f6b);};}exports[_0xe7ca('0x30')]=function(_0x28d5fd,_0x1c860b){var _0x5400d5={},_0x108eb4={},_0x1c8324={'count':0x0,'rows':[]};var _0x41aea7=_[_0xe7ca('0x31')](db[_0xe7ca('0x32')][_0xe7ca('0x33')],function(_0x22a326){return{'name':_0x22a326[_0xe7ca('0x34')],'type':_0x22a326[_0xe7ca('0x35')][_0xe7ca('0x36')]};});_0x108eb4['model']=_[_0xe7ca('0x31')](_0x41aea7,'name');_0x108eb4[_0xe7ca('0x37')]=_['keys'](_0x28d5fd[_0xe7ca('0x37')]);_0x108eb4[_0xe7ca('0x38')]=_[_0xe7ca('0x39')](_0x108eb4[_0xe7ca('0x3a')],_0x108eb4[_0xe7ca('0x37')]);_0x5400d5[_0xe7ca('0x3b')]=_[_0xe7ca('0x39')](_0x108eb4[_0xe7ca('0x3a')],qs[_0xe7ca('0x3c')](_0x28d5fd[_0xe7ca('0x37')][_0xe7ca('0x3c')]));_0x5400d5[_0xe7ca('0x3b')]=_0x5400d5[_0xe7ca('0x3b')]['length']?_0x5400d5['attributes']:_0x108eb4[_0xe7ca('0x3a')];if(!_0x28d5fd[_0xe7ca('0x37')][_0xe7ca('0x3d')](_0xe7ca('0x3e'))){_0x5400d5[_0xe7ca('0x24')]=qs[_0xe7ca('0x24')](_0x28d5fd[_0xe7ca('0x37')][_0xe7ca('0x24')]);_0x5400d5[_0xe7ca('0x23')]=qs['offset'](_0x28d5fd[_0xe7ca('0x37')][_0xe7ca('0x23')]);}_0x5400d5[_0xe7ca('0x3f')]=qs[_0xe7ca('0x40')](_0x28d5fd[_0xe7ca('0x37')][_0xe7ca('0x40')]);_0x5400d5[_0xe7ca('0x41')]=qs[_0xe7ca('0x38')](_[_0xe7ca('0x42')](_0x28d5fd[_0xe7ca('0x37')],_0x108eb4[_0xe7ca('0x38')]),_0x41aea7);if(_0x28d5fd['query'][_0xe7ca('0x43')]){_0x5400d5[_0xe7ca('0x41')]=_[_0xe7ca('0x44')](_0x5400d5[_0xe7ca('0x41')],{'$or':_[_0xe7ca('0x31')](_0x41aea7,function(_0x5ebb91){if(_0x5ebb91[_0xe7ca('0x35')]!==_0xe7ca('0x45')){var _0x5c9278={};_0x5c9278[_0x5ebb91['name']]={'$like':'%'+_0x28d5fd[_0xe7ca('0x37')]['filter']+'%'};return _0x5c9278;}})});}_0x5400d5=_[_0xe7ca('0x44')]({},_0x5400d5,_0x28d5fd[_0xe7ca('0x46')]);var _0x58ea6f={'where':_0x5400d5[_0xe7ca('0x41')]};return db['Dashboard'][_0xe7ca('0x25')](_0x58ea6f)[_0xe7ca('0x29')](function(_0x2018a5){_0x1c8324[_0xe7ca('0x25')]=_0x2018a5;if(_0x28d5fd[_0xe7ca('0x37')][_0xe7ca('0x47')]){_0x5400d5['include']=[{'all':!![]}];}return db['Dashboard'][_0xe7ca('0x48')](_0x5400d5);})[_0xe7ca('0x29')](function(_0x1d0e71){_0x1c8324[_0xe7ca('0x49')]=_0x1d0e71;return _0x1c8324;})['then'](respondWithFilteredResult(_0x1c860b,_0x5400d5))[_0xe7ca('0x4a')](handleError(_0x1c860b,null));};exports[_0xe7ca('0x4b')]=function(_0x4e7886,_0x3e1891){var _0x1e8eaf={'raw':![],'where':{'id':_0x4e7886[_0xe7ca('0x4c')]['id']}},_0x2b1d94={};_0x2b1d94[_0xe7ca('0x3a')]=_[_0xe7ca('0x4d')](db[_0xe7ca('0x32')]['rawAttributes']);_0x2b1d94[_0xe7ca('0x37')]=_[_0xe7ca('0x4d')](_0x4e7886[_0xe7ca('0x37')]);_0x2b1d94[_0xe7ca('0x38')]=_['intersection'](_0x2b1d94[_0xe7ca('0x3a')],_0x2b1d94[_0xe7ca('0x37')]);_0x1e8eaf[_0xe7ca('0x3b')]=_[_0xe7ca('0x39')](_0x2b1d94[_0xe7ca('0x3a')],qs[_0xe7ca('0x3c')](_0x4e7886[_0xe7ca('0x37')][_0xe7ca('0x3c')]));_0x1e8eaf[_0xe7ca('0x3b')]=_0x1e8eaf[_0xe7ca('0x3b')][_0xe7ca('0x4e')]?_0x1e8eaf[_0xe7ca('0x3b')]:_0x2b1d94[_0xe7ca('0x3a')];if(_0x4e7886[_0xe7ca('0x37')][_0xe7ca('0x47')]){_0x1e8eaf[_0xe7ca('0x4f')]=[{'all':!![]}];}_0x1e8eaf=_['merge']({},_0x1e8eaf,_0x4e7886[_0xe7ca('0x46')]);return db[_0xe7ca('0x32')][_0xe7ca('0x50')](_0x1e8eaf)[_0xe7ca('0x29')](handleEntityNotFound(_0x3e1891,null))[_0xe7ca('0x29')](respondWithResult(_0x3e1891,null))[_0xe7ca('0x4a')](handleError(_0x3e1891,null));};exports[_0xe7ca('0x51')]=function(_0x39ac8e,_0x5911df){return db['Dashboard']['create'](_0x39ac8e[_0xe7ca('0x52')],{})['then'](function(_0x28c45f){var _0x417870=_0x39ac8e[_0xe7ca('0x53')][_0xe7ca('0x54')]({'plain':!![]});if(!_0x417870)throw new Error(_0xe7ca('0x55'));if(_0x417870[_0xe7ca('0x56')]==='user'){var _0x1693b6=_0x28c45f['get']({'plain':!![]});var _0x402d35=_0xe7ca('0x57');return db[_0xe7ca('0x58')]['find']({'where':{'name':_0x402d35,'userProfileId':_0x417870[_0xe7ca('0x59')]},'raw':!![]})[_0xe7ca('0x29')](function(_0x311d63){if(_0x311d63&&_0x311d63[_0xe7ca('0x5a')]===0x0){return db[_0xe7ca('0x2a')][_0xe7ca('0x51')]({'name':_0x1693b6[_0xe7ca('0x2e')],'resourceId':_0x1693b6['id'],'type':_0x311d63[_0xe7ca('0x2e')],'sectionId':_0x311d63['id']},{})[_0xe7ca('0x29')](function(){return _0x28c45f;});}else{return _0x28c45f;}})[_0xe7ca('0x4a')](function(_0x22a100){logger[_0xe7ca('0x2c')](_0xe7ca('0x5b'),_0x22a100);throw _0x22a100;});}return _0x28c45f;})[_0xe7ca('0x29')](respondWithResult(_0x5911df,0xc9))[_0xe7ca('0x4a')](handleError(_0x5911df,null));};exports[_0xe7ca('0x5c')]=function(_0x1952c2,_0x405575){var _0x568df5={'where':{'id':_0x1952c2[_0xe7ca('0x4c')]['id']}},_0x267578={};_0x267578[_0xe7ca('0x3a')]=_[_0xe7ca('0x4d')](db[_0xe7ca('0x32')][_0xe7ca('0x33')]);_0x568df5[_0xe7ca('0x3b')]=_[_0xe7ca('0x39')](_0x267578[_0xe7ca('0x3a')],qs[_0xe7ca('0x3c')](_0x1952c2[_0xe7ca('0x37')]['fields']));_0x568df5[_0xe7ca('0x3b')]=_0x568df5['attributes'][_0xe7ca('0x4e')]?_0x568df5['attributes']:_0x267578[_0xe7ca('0x3a')];if(_0x1952c2[_0xe7ca('0x37')]['includeAll']){_0x568df5[_0xe7ca('0x4f')]=[{'all':!![]}];}_0x568df5=_[_0xe7ca('0x44')]({},_0x568df5,_0x1952c2[_0xe7ca('0x46')]);return db[_0xe7ca('0x32')]['find'](_0x568df5)[_0xe7ca('0x29')](handleEntityNotFound(_0x405575,null))['then'](function(_0x5bb07e){if(_0x5bb07e){var _0xe1d792=_0x5bb07e['get']({'plain':!![]});_0xe1d792=qs[_0xe7ca('0x5d')](_0xe1d792,['id','createdAt','updatedAt']);_0x1952c2[_0xe7ca('0x52')]=_['omit'](_0x1952c2['body'],['id',_0xe7ca('0x5e'),_0xe7ca('0x5f')]);return db[_0xe7ca('0x32')]['create'](_[_0xe7ca('0x44')](_0xe1d792,_0x1952c2[_0xe7ca('0x52')]),{'include':_0x1952c2[_0xe7ca('0x37')][_0xe7ca('0x47')]?[{'all':!![]}]:undefined})[_0xe7ca('0x29')](function(_0x49238f){var _0x2cc178=_0x1952c2[_0xe7ca('0x53')][_0xe7ca('0x54')]({'plain':!![]});if(!_0x2cc178)throw new Error(_0xe7ca('0x55'));if(_0x2cc178[_0xe7ca('0x56')]==='user'){var _0x55f49c=_0x49238f[_0xe7ca('0x54')]({'plain':!![]});var _0x4eff82=_0xe7ca('0x57');return db['UserProfileSection'][_0xe7ca('0x50')]({'where':{'name':_0x4eff82,'userProfileId':_0x2cc178[_0xe7ca('0x59')]},'raw':!![]})[_0xe7ca('0x29')](function(_0x33dfba){if(_0x33dfba&&_0x33dfba['autoAssociation']===0x0){return db[_0xe7ca('0x2a')][_0xe7ca('0x51')]({'name':_0x55f49c[_0xe7ca('0x2e')],'resourceId':_0x55f49c['id'],'type':_0x33dfba[_0xe7ca('0x2e')],'sectionId':_0x33dfba['id']},{})['then'](function(){return _0x49238f;});}else{return _0x49238f;}})[_0xe7ca('0x4a')](function(_0x2a6beb){logger[_0xe7ca('0x2c')](_0xe7ca('0x5b'),_0x2a6beb);throw _0x2a6beb;});}return _0x49238f;});}})['then'](respondWithResult(_0x405575,0xc9))[_0xe7ca('0x4a')](handleError(_0x405575,null));};exports[_0xe7ca('0x28')]=function(_0x53561c,_0x6c4337){if(_0x53561c[_0xe7ca('0x52')]['id']){delete _0x53561c[_0xe7ca('0x52')]['id'];}return db[_0xe7ca('0x32')][_0xe7ca('0x50')]({'where':{'id':_0x53561c[_0xe7ca('0x4c')]['id']}})[_0xe7ca('0x29')](handleEntityNotFound(_0x6c4337,null))[_0xe7ca('0x29')](saveUpdates(_0x53561c[_0xe7ca('0x52')],null))['then'](respondWithResult(_0x6c4337,null))[_0xe7ca('0x4a')](handleError(_0x6c4337,null));};exports[_0xe7ca('0x2b')]=function(_0x246df2,_0x49e4f3){return db[_0xe7ca('0x32')]['find']({'where':{'id':_0x246df2['params']['id']}})[_0xe7ca('0x29')](handleEntityNotFound(_0x49e4f3,null))[_0xe7ca('0x29')](removeEntity(_0x49e4f3,null))['catch'](handleError(_0x49e4f3,null));};function widgetAttributes(_0x20c025){try{switch(_0x20c025[_0xe7ca('0x35')]){case _0xe7ca('0x60'):return[{'name':_0xe7ca('0x61'),'value':_0x20c025[_0xe7ca('0x61')]||(_0x20c025['attrs']&&_0x20c025[_0xe7ca('0x62')][0x0]?_0x20c025[_0xe7ca('0x62')][0x0][_0xe7ca('0x63')]:undefined)||_0xe7ca('0x64')}];case _0xe7ca('0x65'):return[{'name':_0xe7ca('0x66'),'value':_0x20c025[_0xe7ca('0x66')]||(_0x20c025['attrs']&&_0x20c025['attrs'][0x0]?_0x20c025[_0xe7ca('0x62')][0x0][_0xe7ca('0x63')]:undefined)||''}];case _0xe7ca('0x67'):return[{'name':'attrHourFormat','value':_0x20c025[_0xe7ca('0x68')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x0]?_0x20c025[_0xe7ca('0x62')][0x0][_0xe7ca('0x63')]:undefined)||_0xe7ca('0x69')},{'name':_0xe7ca('0x6a'),'value':_0x20c025[_0xe7ca('0x6a')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x1]?_0x20c025[_0xe7ca('0x62')][0x1][_0xe7ca('0x63')]:undefined)||_0xe7ca('0x6b')},{'name':_0xe7ca('0x6c'),'value':_0x20c025[_0xe7ca('0x6c')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x2]?_0x20c025[_0xe7ca('0x62')][0x2][_0xe7ca('0x63')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x20c025[_0xe7ca('0x6d')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x0]?_0x20c025[_0xe7ca('0x62')][0x0][_0xe7ca('0x63')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x20c025[_0xe7ca('0x6e')]||(_0x20c025['attrs']&&_0x20c025[_0xe7ca('0x62')][0x1]?_0x20c025[_0xe7ca('0x62')][0x1][_0xe7ca('0x63')]:undefined)||[]},{'name':_0xe7ca('0x6c'),'value':_0x20c025[_0xe7ca('0x6c')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x2]?_0x20c025[_0xe7ca('0x62')][0x2][_0xe7ca('0x63')]:undefined)||0x14},{'name':_0xe7ca('0x6f'),'value':_0x20c025['attrChannel']||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x3]?_0x20c025[_0xe7ca('0x62')][0x3][_0xe7ca('0x63')]:undefined)||_0xe7ca('0x70')},{'name':_0xe7ca('0x71'),'value':_0x20c025[_0xe7ca('0x71')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025['attrs'][0x4]?_0x20c025[_0xe7ca('0x62')][0x4]['value']:undefined)||''},{'name':_0xe7ca('0x72'),'value':_0x20c025[_0xe7ca('0x72')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x5]?_0x20c025[_0xe7ca('0x62')][0x5]['value']:undefined)||''},{'name':_0xe7ca('0x73'),'value':_0x20c025['attrSmsAccounts']||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x6]?_0x20c025[_0xe7ca('0x62')][0x6][_0xe7ca('0x63')]:undefined)||''},{'name':_0xe7ca('0x74'),'value':_0x20c025[_0xe7ca('0x74')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x7]?_0x20c025[_0xe7ca('0x62')][0x7][_0xe7ca('0x63')]:undefined)||''},{'name':_0xe7ca('0x75'),'value':_0x20c025['attrWhatsappAccounts']||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x8]?_0x20c025[_0xe7ca('0x62')][0x8]['value']:undefined)||''},{'name':_0xe7ca('0x76'),'value':_0x20c025[_0xe7ca('0x76')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025['attrs'][0x9]?_0x20c025[_0xe7ca('0x62')][0x9]['value']:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x20c025[_0xe7ca('0x77')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x0]?_0x20c025[_0xe7ca('0x62')][0x0][_0xe7ca('0x63')]:undefined)||_0xe7ca('0x78')},{'name':'attrSerie2','value':_0x20c025['attrSerie2']||(_0x20c025['attrs']&&_0x20c025[_0xe7ca('0x62')][0x1]?_0x20c025[_0xe7ca('0x62')][0x1]['value']:undefined)||null},{'name':_0xe7ca('0x79'),'value':_0x20c025[_0xe7ca('0x79')]||(_0x20c025['attrs']&&_0x20c025['attrs'][0x2]?_0x20c025[_0xe7ca('0x62')][0x2]['value']:undefined)||null},{'name':_0xe7ca('0x6e'),'value':_0x20c025[_0xe7ca('0x6e')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x3]?_0x20c025[_0xe7ca('0x62')][0x3][_0xe7ca('0x63')]:undefined)||[]},{'name':_0xe7ca('0x6f'),'value':_0x20c025[_0xe7ca('0x6f')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025['attrs'][0x4]?_0x20c025[_0xe7ca('0x62')][0x4]['value']:undefined)||_0xe7ca('0x70')},{'name':_0xe7ca('0x71'),'value':_0x20c025['attrEmailAccounts']||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x5]?_0x20c025[_0xe7ca('0x62')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x20c025[_0xe7ca('0x72')]||(_0x20c025['attrs']&&_0x20c025[_0xe7ca('0x62')][0x6]?_0x20c025[_0xe7ca('0x62')][0x6]['value']:undefined)||''},{'name':_0xe7ca('0x73'),'value':_0x20c025[_0xe7ca('0x73')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x7]?_0x20c025[_0xe7ca('0x62')][0x7][_0xe7ca('0x63')]:undefined)||''},{'name':_0xe7ca('0x74'),'value':_0x20c025['attrOpenchannelAccounts']||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x8]?_0x20c025['attrs'][0x8][_0xe7ca('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x20c025['attrWhatsappAccounts']||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x9]?_0x20c025[_0xe7ca('0x62')][0x9][_0xe7ca('0x63')]:undefined)||''},{'name':'attrChatWebsites','value':_0x20c025[_0xe7ca('0x76')]||(_0x20c025['attrs']&&_0x20c025[_0xe7ca('0x62')][0xa]?_0x20c025[_0xe7ca('0x62')][0xa][_0xe7ca('0x63')]:undefined)||''}];case _0xe7ca('0x7a'):return[{'name':_0xe7ca('0x7b'),'type':_0x20c025[_0xe7ca('0x7c')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025[_0xe7ca('0x62')][0x0]?_0x20c025[_0xe7ca('0x62')][0x0]['type']:undefined)||null,'value':_0x20c025[_0xe7ca('0x7b')]||(_0x20c025['attrs']&&_0x20c025['attrs'][0x0]?_0x20c025[_0xe7ca('0x62')][0x0]['value']:undefined)||null},{'name':_0xe7ca('0x7d'),'value':_0x20c025[_0xe7ca('0x7d')]||(_0x20c025[_0xe7ca('0x62')]&&_0x20c025['attrs'][0x1]?_0x20c025[_0xe7ca('0x62')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x569f69){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x569f69));return[];}}exports[_0xe7ca('0x7e')]=function(_0x45fde9,_0x3d1a15,_0xb06700){if(_0x45fde9[_0xe7ca('0x52')]['id']){delete _0x45fde9['body']['id'];}return db[_0xe7ca('0x32')][_0xe7ca('0x50')]({'where':{'id':_0x45fde9[_0xe7ca('0x4c')]['id']}})[_0xe7ca('0x29')](handleEntityNotFound(_0x3d1a15,null))[_0xe7ca('0x29')](function(_0x28aea5){if(_0x28aea5){_0x45fde9[_0xe7ca('0x52')][_0xe7ca('0x7f')]=_0x28aea5['id'];_0x45fde9[_0xe7ca('0x52')][_0xe7ca('0x62')]=widgetAttributes(_0x45fde9['body']);return db[_0xe7ca('0x80')][_0xe7ca('0x51')](_0x45fde9[_0xe7ca('0x52')]);}})['then'](respondWithResult(_0x3d1a15,null))['catch'](handleError(_0x3d1a15,null));};exports[_0xe7ca('0x81')]=function(_0x2a620e,_0x504c0e,_0x554872){var _0x5ca60e={};var _0x243bf6={};var _0x416058;var _0x8de70e;return db['Dashboard']['findOne']({'where':{'id':_0x2a620e['params']['id']}})['then'](handleEntityNotFound(_0x504c0e,null))['then'](function(_0x5a4dde){if(_0x5a4dde){_0x416058=_0x5a4dde;_0x243bf6['model']=_['keys'](db[_0xe7ca('0x80')]['rawAttributes']);_0x243bf6[_0xe7ca('0x37')]=_[_0xe7ca('0x4d')](_0x2a620e['query']);_0x243bf6[_0xe7ca('0x38')]=_[_0xe7ca('0x39')](_0x243bf6[_0xe7ca('0x3a')],_0x243bf6['query']);_0x5ca60e['attributes']=_[_0xe7ca('0x39')](_0x243bf6[_0xe7ca('0x3a')],qs['fields'](_0x2a620e[_0xe7ca('0x37')]['fields']));_0x5ca60e[_0xe7ca('0x3b')]=_0x5ca60e[_0xe7ca('0x3b')][_0xe7ca('0x4e')]?_0x5ca60e['attributes']:_0x243bf6[_0xe7ca('0x3a')];_0x5ca60e[_0xe7ca('0x3f')]=qs['sort'](_0x2a620e['query'][_0xe7ca('0x40')]);_0x5ca60e[_0xe7ca('0x41')]=qs[_0xe7ca('0x38')](_['pick'](_0x2a620e[_0xe7ca('0x37')],_0x243bf6['filters']));if(_0x2a620e['query'][_0xe7ca('0x43')]){_0x5ca60e[_0xe7ca('0x41')]=_['merge'](_0x5ca60e[_0xe7ca('0x41')],{'$or':_[_0xe7ca('0x31')](_0x5ca60e['attributes'],function(_0x50fe8e){var _0x35b7c4={};_0x35b7c4[_0x50fe8e]={'$like':'%'+_0x2a620e[_0xe7ca('0x37')][_0xe7ca('0x43')]+'%'};return _0x35b7c4;})});}_0x5ca60e=_['merge']({},_0x5ca60e,_0x2a620e[_0xe7ca('0x46')]);return _0x416058[_0xe7ca('0x81')](_0x5ca60e);}})['then'](function(_0x43f071){if(_0x43f071){_0x8de70e=_0x43f071[_0xe7ca('0x4e')];if(!_0x2a620e[_0xe7ca('0x37')][_0xe7ca('0x3d')]('nolimit')){_0x5ca60e[_0xe7ca('0x24')]=qs[_0xe7ca('0x24')](_0x2a620e[_0xe7ca('0x37')][_0xe7ca('0x24')]);_0x5ca60e['offset']=qs['offset'](_0x2a620e[_0xe7ca('0x37')][_0xe7ca('0x23')]);}return _0x416058[_0xe7ca('0x81')](_0x5ca60e);}})['then'](function(_0x577c9d){if(_0x577c9d){return _0x577c9d?{'count':_0x8de70e,'rows':_0x577c9d}:null;}})[_0xe7ca('0x29')](respondWithResult(_0x504c0e,null))[_0xe7ca('0x4a')](handleError(_0x504c0e,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 51a5a5a..9e6c571 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 _0xe86b=['hook','exports','events','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2bf7eb,_0xf54491){var _0xa7e099=function(_0x471071){while(--_0x471071){_0x2bf7eb['push'](_0x2bf7eb['shift']());}};_0xa7e099(++_0xf54491);}(_0xe86b,0x173));var _0xbe86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe86b[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xbe86('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xbe86('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xbe86('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe86('0x3'),'afterDestroy':_0xbe86('0x4')};function emitEvent(_0x560f5d){return function(_0x246b01,_0x5c0dad,_0xf69bc4){DashboardEvents[_0xbe86('0x5')](_0x560f5d+':'+_0x246b01['id'],_0x246b01);DashboardEvents[_0xbe86('0x5')](_0x560f5d,_0x246b01);_0xf69bc4(null);};}for(var e in events){if(events[_0xbe86('0x6')](e)){var event=events[e];Dashboard[_0xbe86('0x7')](e,emitEvent(event));}}module[_0xbe86('0x8')]=DashboardEvents; \ No newline at end of file +var _0x09d3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','Dashboard'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x09d3,0x16e));var _0x309d=function(_0x2fd7e3,_0x23eef9){_0x2fd7e3=_0x2fd7e3-0x0;var _0x3f6d46=_0x09d3[_0x2fd7e3];return _0x3f6d46;};'use strict';var EventEmitter=require(_0x309d('0x0'));var Dashboard=require(_0x309d('0x1'))['db'][_0x309d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x309d('0x3')](0x0);var events={'afterCreate':_0x309d('0x4'),'afterUpdate':_0x309d('0x5'),'afterDestroy':_0x309d('0x6')};function emitEvent(_0x2a4b21){return function(_0x58d0d3,_0x2ee349,_0x1bb14b){DashboardEvents[_0x309d('0x7')](_0x2a4b21+':'+_0x58d0d3['id'],_0x58d0d3);DashboardEvents[_0x309d('0x7')](_0x2a4b21,_0x58d0d3);_0x1bb14b(null);};}for(var e in events){if(events[_0x309d('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index ea0a050..bab4c73 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 _0x22a5=['define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x8988d7,_0x3a84a8){var _0x29fbb5=function(_0x1cdff8){while(--_0x1cdff8){_0x8988d7['push'](_0x8988d7['shift']());}};_0x29fbb5(++_0x3a84a8);}(_0x22a5,0x15c));var _0x522a=function(_0x21086d,_0x484211){_0x21086d=_0x21086d-0x0;var _0x90d87d=_0x22a5[_0x21086d];return _0x90d87d;};'use strict';var _=require(_0x522a('0x0'));var util=require(_0x522a('0x1'));var logger=require(_0x522a('0x2'))(_0x522a('0x3'));var moment=require(_0x522a('0x4'));var BPromise=require(_0x522a('0x5'));var rp=require(_0x522a('0x6'));var fs=require('fs');var path=require(_0x522a('0x7'));var rimraf=require(_0x522a('0x8'));var config=require(_0x522a('0x9'));var attributes=require(_0x522a('0xa'));module[_0x522a('0xb')]=function(_0x24e7df,_0x4eb8b0){return _0x24e7df[_0x522a('0xc')](_0x522a('0xd'),attributes,{'tableName':_0x522a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb76f=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird'];(function(_0x16e725,_0x244eb4){var _0x1d419c=function(_0x4fb078){while(--_0x4fb078){_0x16e725['push'](_0x16e725['shift']());}};_0x1d419c(++_0x244eb4);}(_0xb76f,0x159));var _0xfb76=function(_0x3ad818,_0x494184){_0x3ad818=_0x3ad818-0x0;var _0x44938b=_0xb76f[_0x3ad818];return _0x44938b;};'use strict';var _=require(_0xfb76('0x0'));var util=require(_0xfb76('0x1'));var logger=require(_0xfb76('0x2'))('api');var moment=require(_0xfb76('0x3'));var BPromise=require(_0xfb76('0x4'));var rp=require(_0xfb76('0x5'));var fs=require('fs');var path=require(_0xfb76('0x6'));var rimraf=require(_0xfb76('0x7'));var config=require(_0xfb76('0x8'));var attributes=require(_0xfb76('0x9'));module[_0xfb76('0xa')]=function(_0x1b6f4c,_0x2e146c){return _0x1b6f4c[_0xfb76('0xb')](_0xfb76('0xc'),attributes,{'tableName':_0xfb76('0xd'),'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 d489bbb..370b67a 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 _0xa0e8=['client','defaults','localhost','socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x479773,_0x4a1ff1){var _0x5c4f1c=function(_0x6d7741){while(--_0x6d7741){_0x479773['push'](_0x479773['shift']());}};_0x5c4f1c(++_0x4a1ff1);}(_0xa0e8,0x102));var _0x8a0e=function(_0x2e9842,_0x514356){_0x2e9842=_0x2e9842-0x0;var _0x44e929=_0xa0e8[_0x2e9842];return _0x44e929;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a0e('0x0'));var BPromise=require(_0x8a0e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a0e('0x2'));var db=require(_0x8a0e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a0e('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8a0e('0x5'));var client=jayson[_0x8a0e('0x6')]['http']({'port':0x232a});config['redis']=_[_0x8a0e('0x7')](config['redis'],{'host':_0x8a0e('0x8'),'port':0x18eb});var socket=require(_0x8a0e('0x9'))(new Redis(config['redis']));require('./dashboard.socket')[_0x8a0e('0xa')](socket);function respondWithRpcPromise(_0x267981,_0x117421,_0x564a76){return new BPromise(function(_0xd285ff,_0x267973){return client[_0x8a0e('0xb')](_0x267981,_0x564a76)[_0x8a0e('0xc')](function(_0x6245df){logger[_0x8a0e('0xd')](_0x8a0e('0xe'),_0x117421,_0x8a0e('0xf'));logger['debug'](_0x8a0e('0x10'),_0x117421,_0x8a0e('0xf'),JSON[_0x8a0e('0x11')](_0x6245df));if(_0x6245df[_0x8a0e('0x12')]){if(_0x6245df['error'][_0x8a0e('0x13')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x117421,_0x6245df[_0x8a0e('0x12')][_0x8a0e('0x14')]);return _0x267973(_0x6245df[_0x8a0e('0x12')][_0x8a0e('0x14')]);}logger['error'](_0x8a0e('0xe'),_0x117421,_0x6245df[_0x8a0e('0x12')]['message']);return _0xd285ff(_0x6245df[_0x8a0e('0x12')]['message']);}else{logger['info'](_0x8a0e('0xe'),_0x117421,'request\x20sent');_0xd285ff(_0x6245df['result']['message']);}})[_0x8a0e('0x15')](function(_0x17b03d){logger[_0x8a0e('0x12')](_0x8a0e('0xe'),_0x117421,_0x17b03d);_0x267973(_0x17b03d);});});} \ No newline at end of file +var _0x9ef4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x554426,_0x2f4360){var _0x49ad51=function(_0x44e958){while(--_0x44e958){_0x554426['push'](_0x554426['shift']());}};_0x49ad51(++_0x2f4360);}(_0x9ef4,0xad));var _0x49ef=function(_0x4a0dd2,_0x2ce879){_0x4a0dd2=_0x4a0dd2-0x0;var _0x1b8c27=_0x9ef4[_0x4a0dd2];return _0x1b8c27;};'use strict';var _=require(_0x49ef('0x0'));var util=require('util');var moment=require(_0x49ef('0x1'));var BPromise=require(_0x49ef('0x2'));var rs=require(_0x49ef('0x3'));var fs=require('fs');var Redis=require(_0x49ef('0x4'));var db=require(_0x49ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x49ef('0x6'))('rpc');var config=require(_0x49ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x49ef('0x8')][_0x49ef('0x9')]({'port':0x232a});config[_0x49ef('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49ef('0xa')]));require(_0x49ef('0xb'))[_0x49ef('0xc')](socket);function respondWithRpcPromise(_0x33d49a,_0x3f5f29,_0x40c530){return new BPromise(function(_0x3179c4,_0x4f28e3){return client[_0x49ef('0xd')](_0x33d49a,_0x40c530)[_0x49ef('0xe')](function(_0x5db694){logger[_0x49ef('0xf')](_0x49ef('0x10'),_0x3f5f29,_0x49ef('0x11'));logger[_0x49ef('0x12')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x3f5f29,'request\x20sent',JSON[_0x49ef('0x13')](_0x5db694));if(_0x5db694['error']){if(_0x5db694[_0x49ef('0x14')][_0x49ef('0x15')]===0x1f4){logger['error'](_0x49ef('0x10'),_0x3f5f29,_0x5db694['error'][_0x49ef('0x16')]);return _0x4f28e3(_0x5db694[_0x49ef('0x14')][_0x49ef('0x16')]);}logger[_0x49ef('0x14')](_0x49ef('0x10'),_0x3f5f29,_0x5db694[_0x49ef('0x14')][_0x49ef('0x16')]);return _0x3179c4(_0x5db694[_0x49ef('0x14')]['message']);}else{logger[_0x49ef('0xf')](_0x49ef('0x10'),_0x3f5f29,_0x49ef('0x11'));_0x3179c4(_0x5db694[_0x49ef('0x17')][_0x49ef('0x16')]);}})[_0x49ef('0x18')](function(_0x425fea){logger[_0x49ef('0x14')](_0x49ef('0x10'),_0x3f5f29,_0x425fea);_0x4f28e3(_0x425fea);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f36bd05..b8ecdfa 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 _0x524d=['./dashboard.events','save','update','emit','removeListener','length','dashboard:'];(function(_0x712850,_0xf50293){var _0x248991=function(_0x108bee){while(--_0x108bee){_0x712850['push'](_0x712850['shift']());}};_0x248991(++_0xf50293);}(_0x524d,0xe7));var _0xd524=function(_0x50bdd0,_0x3b505f){_0x50bdd0=_0x50bdd0-0x0;var _0x11ba32=_0x524d[_0x50bdd0];return _0x11ba32;};'use strict';var DashboardEvents=require(_0xd524('0x0'));var events=[_0xd524('0x1'),'remove',_0xd524('0x2')];function createListener(_0x3c2a1d,_0x550ecb){return function(_0x1c65ed){_0x550ecb[_0xd524('0x3')](_0x3c2a1d,_0x1c65ed);};}function removeListener(_0x469de9,_0x1d7804){return function(){DashboardEvents[_0xd524('0x4')](_0x469de9,_0x1d7804);};}exports['register']=function(_0x5bcb1e){for(var _0x14b568=0x0,_0x3d8ccc=events[_0xd524('0x5')];_0x14b568<_0x3d8ccc;_0x14b568++){var _0x58e858=events[_0x14b568];var _0x40ed63=createListener(_0xd524('0x6')+_0x58e858,_0x5bcb1e);DashboardEvents['on'](_0x58e858,_0x40ed63);}}; \ No newline at end of file +var _0x1f65=['save','remove','emit','removeListener','register','length','./dashboard.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f65,0x6f));var _0x51f6=function(_0x1aa7b1,_0xe9e31d){_0x1aa7b1=_0x1aa7b1-0x0;var _0x5d4ff4=_0x1f65[_0x1aa7b1];return _0x5d4ff4;};'use strict';var DashboardEvents=require(_0x51f6('0x0'));var events=[_0x51f6('0x1'),_0x51f6('0x2'),'update'];function createListener(_0x3af20c,_0x2ea7d1){return function(_0xf4aea2){_0x2ea7d1[_0x51f6('0x3')](_0x3af20c,_0xf4aea2);};}function removeListener(_0x3f00ba,_0x280225){return function(){DashboardEvents[_0x51f6('0x4')](_0x3f00ba,_0x280225);};}exports[_0x51f6('0x5')]=function(_0x1b1dc5){for(var _0x41ef4f=0x0,_0x10778d=events[_0x51f6('0x6')];_0x41ef4f<_0x10778d;_0x41ef4f++){var _0x1c5493=events[_0x41ef4f];var _0x577a87=createListener('dashboard:'+_0x1c5493,_0x1b1dc5);DashboardEvents['on'](_0x1c5493,_0x577a87);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 50a18fe..5cd5214 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 _0x064d=['./dashboard.controller','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x47fb36,_0x2233c4){var _0x28f16f=function(_0x188890){while(--_0x188890){_0x47fb36['push'](_0x47fb36['shift']());}};_0x28f16f(++_0x2233c4);}(_0x064d,0x1d4));var _0xd064=function(_0x496777,_0x2bc06d){_0x496777=_0x496777-0x0;var _0x30daa9=_0x064d[_0x496777];return _0x30daa9;};'use strict';var multer=require('multer');var util=require(_0xd064('0x0'));var path=require(_0xd064('0x1'));var timeout=require(_0xd064('0x2'));var express=require('express');var router=express[_0xd064('0x3')]();var fs_extra=require(_0xd064('0x4'));var auth=require(_0xd064('0x5'));var interaction=require(_0xd064('0x6'));var config=require('../../config/environment');var controller=require(_0xd064('0x7'));router[_0xd064('0x8')]('/',auth['isAuthenticated'](),controller[_0xd064('0x9')]);router[_0xd064('0x8')](_0xd064('0xa'),auth[_0xd064('0xb')](),controller[_0xd064('0xc')]);router[_0xd064('0x8')](_0xd064('0xd'),auth[_0xd064('0xb')](),controller[_0xd064('0xe')]);router[_0xd064('0xf')]('/',auth[_0xd064('0xb')](),controller[_0xd064('0x10')]);router[_0xd064('0xf')](_0xd064('0x11'),auth['isAuthenticated'](),controller[_0xd064('0x12')]);router['post']('/:id/items',auth[_0xd064('0xb')](),controller[_0xd064('0x13')]);router[_0xd064('0x14')](_0xd064('0xa'),auth[_0xd064('0xb')](),controller[_0xd064('0x15')]);router[_0xd064('0x16')](_0xd064('0xa'),auth[_0xd064('0xb')](),controller[_0xd064('0x17')]);module[_0xd064('0x18')]=router; \ No newline at end of file +var _0x7078=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','getItems','create','/:id/clone','post','/:id/items','put','update','exports','path','connect-timeout','express','Router'];(function(_0x2437a1,_0x4dfb16){var _0x4f20dc=function(_0x55ac01){while(--_0x55ac01){_0x2437a1['push'](_0x2437a1['shift']());}};_0x4f20dc(++_0x4dfb16);}(_0x7078,0x178));var _0x8707=function(_0x2abf7f,_0x23b05a){_0x2abf7f=_0x2abf7f-0x0;var _0x248bce=_0x7078[_0x2abf7f];return _0x248bce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8707('0x0'));var timeout=require(_0x8707('0x1'));var express=require(_0x8707('0x2'));var router=express[_0x8707('0x3')]();var fs_extra=require(_0x8707('0x4'));var auth=require(_0x8707('0x5'));var interaction=require(_0x8707('0x6'));var config=require(_0x8707('0x7'));var controller=require(_0x8707('0x8'));router[_0x8707('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8707('0x9')](_0x8707('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8707('0x9')]('/:id/items',auth[_0x8707('0xb')](),controller[_0x8707('0xc')]);router['post']('/',auth[_0x8707('0xb')](),controller[_0x8707('0xd')]);router['post'](_0x8707('0xe'),auth[_0x8707('0xb')](),controller['clone']);router[_0x8707('0xf')](_0x8707('0x10'),auth[_0x8707('0xb')](),controller['addItem']);router[_0x8707('0x11')](_0x8707('0xa'),auth[_0x8707('0xb')](),controller[_0x8707('0x12')]);router['delete'](_0x8707('0xa'),auth[_0x8707('0xb')](),controller['destroy']);module[_0x8707('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 3e781d3..be2d35f 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 _0x2a07=['setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x4fc702,_0x590060){var _0x1357d3=function(_0x45a119){while(--_0x45a119){_0x4fc702['push'](_0x4fc702['shift']());}};_0x1357d3(++_0x590060);}(_0x2a07,0x74));var _0x72a0=function(_0x3bc72a,_0x25471d){_0x3bc72a=_0x3bc72a-0x0;var _0x539ff0=_0x2a07[_0x3bc72a];return _0x539ff0;};'use strict';var Sequelize=require(_0x72a0('0x0'));var squel=require(_0x72a0('0x1'));var _=require(_0x72a0('0x2'));module[_0x72a0('0x3')]={'title':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x72a0('0x5')](_0x72a0('0x6')),'get':function(){try{return JSON[_0x72a0('0x7')](this[_0x72a0('0x8')](_0x72a0('0x9')));}catch(_0xce74c){return[];}},'set':function(_0x3ccf6d){try{this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')](_0x3ccf6d));}catch(_0x21c819){this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x72a0('0xc')]},'background':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':_0x72a0('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x72a0('0x4')]},'titleFontSize':{'type':Sequelize[_0x72a0('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x687b=['sequelize','squel','lodash','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','STRING','#ffffff','#2196f3'];(function(_0x253fa6,_0xa4c7f3){var _0x4311aa=function(_0x4c0e2a){while(--_0x4c0e2a){_0x253fa6['push'](_0x253fa6['shift']());}};_0x4311aa(++_0xa4c7f3);}(_0x687b,0x14a));var _0xb687=function(_0x48105b,_0x266487){_0x48105b=_0x48105b-0x0;var _0x1ca419=_0x687b[_0x48105b];return _0x1ca419;};'use strict';var Sequelize=require(_0xb687('0x0'));var squel=require(_0xb687('0x1'));var _=require(_0xb687('0x2'));module[_0xb687('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb687('0x4')](_0xb687('0x5')),'get':function(){try{return JSON[_0xb687('0x6')](this[_0xb687('0x7')](_0xb687('0x8')));}catch(_0x194c55){return[];}},'set':function(_0x16ccf3){try{this[_0xb687('0x9')](_0xb687('0x8'),JSON[_0xb687('0xa')](_0x16ccf3));}catch(_0x48942b){this[_0xb687('0x9')](_0xb687('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb687('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb687('0xb')]},'col':{'type':Sequelize[_0xb687('0xb')]},'background':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb687('0xc')],'allowNull':![],'defaultValue':_0xb687('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb687('0xc')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index f903781..a881a32 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 _0xf966=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','include','merge','catch','type','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','attrSerie1','attrSerie2','attrSerie3','attrRefresh','stringify','create','body','find'];(function(_0x25685f,_0x4fe577){var _0x385167=function(_0x5e6d16){while(--_0x5e6d16){_0x25685f['push'](_0x25685f['shift']());}};_0x385167(++_0x4fe577);}(_0xf966,0x184));var _0x6f96=function(_0x4a9036,_0x88d8a1){_0x4a9036=_0x4a9036-0x0;var _0x165db4=_0xf966[_0x4a9036];return _0x165db4;};'use strict';var emlformat=require(_0x6f96('0x0'));var rimraf=require(_0x6f96('0x1'));var zipdir=require(_0x6f96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f96('0x3'));var moment=require(_0x6f96('0x4'));var BPromise=require(_0x6f96('0x5'));var Mustache=require('mustache');var util=require(_0x6f96('0x6'));var path=require(_0x6f96('0x7'));var sox=require(_0x6f96('0x8'));var csv=require('to-csv');var ejs=require(_0x6f96('0x9'));var fs=require('fs');var fs_extra=require(_0x6f96('0xa'));var _=require(_0x6f96('0xb'));var squel=require(_0x6f96('0xc'));var crypto=require(_0x6f96('0xd'));var jsforce=require(_0x6f96('0xe'));var deskjs=require(_0x6f96('0xf'));var toCsv=require(_0x6f96('0x10'));var querystring=require(_0x6f96('0x11'));var Papa=require(_0x6f96('0x12'));var Redis=require(_0x6f96('0x13'));var authService=require(_0x6f96('0x14'));var qs=require(_0x6f96('0x15'));var as=require(_0x6f96('0x16'));var hardwareService=require(_0x6f96('0x17'));var logger=require('../../config/logger')(_0x6f96('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6f96('0x19'));var db=require(_0x6f96('0x1a'))['db'];config['redis']=_[_0x6f96('0x1b')](config[_0x6f96('0x1c')],{'host':_0x6f96('0x1d'),'port':0x18eb});var socket=require(_0x6f96('0x1e'))(new Redis(config[_0x6f96('0x1c')]));require(_0x6f96('0x1f'))[_0x6f96('0x20')](socket);function respondWithStatusCode(_0x1e2467,_0x5cbacc){_0x5cbacc=_0x5cbacc||0xcc;return function(_0x3f8eb1){if(_0x3f8eb1){return _0x1e2467[_0x6f96('0x21')](_0x5cbacc);}return _0x1e2467['status'](_0x5cbacc)[_0x6f96('0x22')]();};}function respondWithResult(_0x2cd321,_0x55346c){_0x55346c=_0x55346c||0xc8;return function(_0x58c7aa){if(_0x58c7aa){return _0x2cd321[_0x6f96('0x23')](_0x55346c)[_0x6f96('0x24')](_0x58c7aa);}};}function respondWithFilteredResult(_0x130de4,_0x54881a){return function(_0x421e59){if(_0x421e59){var _0x48c4d5=typeof _0x54881a[_0x6f96('0x25')]===_0x6f96('0x26')&&typeof _0x54881a['limit']==='undefined';var _0x75c2db=_0x421e59[_0x6f96('0x27')];var _0x593f91=_0x48c4d5?0x0:_0x54881a[_0x6f96('0x25')];var _0x543b83=_0x48c4d5?_0x421e59[_0x6f96('0x27')]:_0x54881a[_0x6f96('0x25')]+_0x54881a[_0x6f96('0x28')];var _0x2515ca;if(_0x543b83>=_0x75c2db){_0x543b83=_0x75c2db;_0x2515ca=0xc8;}else{_0x2515ca=0xce;}_0x130de4[_0x6f96('0x23')](_0x2515ca);return _0x130de4['set'](_0x6f96('0x29'),_0x593f91+'-'+_0x543b83+'/'+_0x75c2db)['json'](_0x421e59);}return null;};}function patchUpdates(_0x46d79b){return function(_0x2b7508){try{jsonpatch['apply'](_0x2b7508,_0x46d79b,!![]);}catch(_0xa12c3b){return BPromise['reject'](_0xa12c3b);}return _0x2b7508[_0x6f96('0x2a')]();};}function saveUpdates(_0x45c1c2,_0x542388){return function(_0x2607b9){if(_0x2607b9){return _0x2607b9[_0x6f96('0x2b')](_0x45c1c2)[_0x6f96('0x2c')](function(_0x475ee9){return _0x475ee9;});}return null;};}function removeEntity(_0xc91322,_0x3a5f09){return function(_0x4f33e7){if(_0x4f33e7){return _0x4f33e7[_0x6f96('0x2d')]()[_0x6f96('0x2c')](function(){_0xc91322[_0x6f96('0x23')](0xcc)[_0x6f96('0x22')]();});}};}function handleEntityNotFound(_0x1c20aa,_0x10c8f9){return function(_0x490c5b){if(!_0x490c5b){_0x1c20aa['sendStatus'](0x194);}return _0x490c5b;};}function handleError(_0x5dd185,_0xe1c8ed){_0xe1c8ed=_0xe1c8ed||0x1f4;return function(_0x105796){logger[_0x6f96('0x2e')](_0x105796['stack']);if(_0x105796[_0x6f96('0x2f')]){delete _0x105796[_0x6f96('0x2f')];}_0x5dd185[_0x6f96('0x23')](_0xe1c8ed)[_0x6f96('0x30')](_0x105796);};}exports[_0x6f96('0x31')]=function(_0x566cb1,_0x38dbba){var _0xa25290={'raw':![],'where':{'id':_0x566cb1[_0x6f96('0x32')]['id']}},_0x5b9284={};_0x5b9284[_0x6f96('0x33')]=_[_0x6f96('0x34')](db[_0x6f96('0x35')][_0x6f96('0x36')]);_0x5b9284[_0x6f96('0x37')]=_[_0x6f96('0x34')](_0x566cb1[_0x6f96('0x37')]);_0x5b9284['filters']=_[_0x6f96('0x38')](_0x5b9284[_0x6f96('0x33')],_0x5b9284[_0x6f96('0x37')]);_0xa25290[_0x6f96('0x39')]=_[_0x6f96('0x38')](_0x5b9284[_0x6f96('0x33')],qs['fields'](_0x566cb1[_0x6f96('0x37')][_0x6f96('0x3a')]));_0xa25290[_0x6f96('0x39')]=_0xa25290[_0x6f96('0x39')][_0x6f96('0x3b')]?_0xa25290[_0x6f96('0x39')]:_0x5b9284['model'];if(_0x566cb1[_0x6f96('0x37')]['includeAll']){_0xa25290[_0x6f96('0x3c')]=[{'all':!![]}];}_0xa25290=_[_0x6f96('0x3d')]({},_0xa25290,_0x566cb1['options']);return db[_0x6f96('0x35')]['find'](_0xa25290)[_0x6f96('0x2c')](handleEntityNotFound(_0x38dbba,null))[_0x6f96('0x2c')](respondWithResult(_0x38dbba,null))[_0x6f96('0x3e')](handleError(_0x38dbba,null));};exports[_0x6f96('0x2d')]=function(_0x285539,_0x3352e9){return db['DashboardItem']['find']({'where':{'id':_0x285539[_0x6f96('0x32')]['id']}})['then'](handleEntityNotFound(_0x3352e9,null))[_0x6f96('0x2c')](removeEntity(_0x3352e9,null))['catch'](handleError(_0x3352e9,null));};function widgetAttributes(_0x3e0b67){try{switch(_0x3e0b67[_0x6f96('0x3f')]){case _0x6f96('0x40'):return[{'name':_0x6f96('0x41'),'value':_0x3e0b67[_0x6f96('0x41')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67['attrs'][0x0]?_0x3e0b67[_0x6f96('0x42')][0x0][_0x6f96('0x43')]:undefined)||_0x6f96('0x44')}];case _0x6f96('0x45'):return[{'name':'attrPath','value':_0x3e0b67[_0x6f96('0x46')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x0]?_0x3e0b67[_0x6f96('0x42')][0x0][_0x6f96('0x43')]:undefined)||''}];case _0x6f96('0x47'):return[{'name':_0x6f96('0x48'),'value':_0x3e0b67[_0x6f96('0x48')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x0]?_0x3e0b67[_0x6f96('0x42')][0x0][_0x6f96('0x43')]:undefined)||_0x6f96('0x49')},{'name':_0x6f96('0x4a'),'value':_0x3e0b67[_0x6f96('0x4a')]||(_0x3e0b67['attrs']&&_0x3e0b67[_0x6f96('0x42')][0x1]?_0x3e0b67['attrs'][0x1]['value']:undefined)||_0x6f96('0x4b')},{'name':_0x6f96('0x4c'),'value':_0x3e0b67[_0x6f96('0x4c')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x2]?_0x3e0b67['attrs'][0x2][_0x6f96('0x43')]:undefined)||0xc}];case _0x6f96('0x4d'):return[{'name':_0x6f96('0x4e'),'value':_0x3e0b67[_0x6f96('0x4e')]||(_0x3e0b67['attrs']&&_0x3e0b67[_0x6f96('0x42')][0x0]?_0x3e0b67[_0x6f96('0x42')][0x0][_0x6f96('0x43')]:undefined)||_0x6f96('0x4f')},{'name':'attrVoiceQueues','value':_0x3e0b67[_0x6f96('0x50')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x1]?_0x3e0b67[_0x6f96('0x42')][0x1][_0x6f96('0x43')]:undefined)||[]},{'name':_0x6f96('0x4c'),'value':_0x3e0b67[_0x6f96('0x4c')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67['attrs'][0x2]?_0x3e0b67['attrs'][0x2][_0x6f96('0x43')]:undefined)||0x14},{'name':_0x6f96('0x51'),'value':_0x3e0b67[_0x6f96('0x51')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x3]?_0x3e0b67['attrs'][0x3][_0x6f96('0x43')]:undefined)||_0x6f96('0x52')},{'name':_0x6f96('0x53'),'value':_0x3e0b67[_0x6f96('0x53')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x4]?_0x3e0b67[_0x6f96('0x42')][0x4][_0x6f96('0x43')]:undefined)||''},{'name':_0x6f96('0x54'),'value':_0x3e0b67[_0x6f96('0x54')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x5]?_0x3e0b67[_0x6f96('0x42')][0x5][_0x6f96('0x43')]:undefined)||''},{'name':_0x6f96('0x55'),'value':_0x3e0b67[_0x6f96('0x55')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x6]?_0x3e0b67['attrs'][0x6][_0x6f96('0x43')]:undefined)||''},{'name':_0x6f96('0x56'),'value':_0x3e0b67['attrOpenchannelAccounts']||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x7]?_0x3e0b67[_0x6f96('0x42')][0x7]['value']:undefined)||''},{'name':_0x6f96('0x57'),'value':_0x3e0b67[_0x6f96('0x57')]||(_0x3e0b67['attrs']&&_0x3e0b67[_0x6f96('0x42')][0x8]?_0x3e0b67['attrs'][0x8]['value']:undefined)||''},{'name':_0x6f96('0x58'),'value':_0x3e0b67[_0x6f96('0x58')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x9]?_0x3e0b67[_0x6f96('0x42')][0x9][_0x6f96('0x43')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x6f96('0x59'),'value':_0x3e0b67[_0x6f96('0x59')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x0]?_0x3e0b67[_0x6f96('0x42')][0x0][_0x6f96('0x43')]:undefined)||'total'},{'name':_0x6f96('0x5a'),'value':_0x3e0b67['attrSerie2']||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x1]?_0x3e0b67[_0x6f96('0x42')][0x1][_0x6f96('0x43')]:undefined)||null},{'name':_0x6f96('0x5b'),'value':_0x3e0b67[_0x6f96('0x5b')]||(_0x3e0b67['attrs']&&_0x3e0b67[_0x6f96('0x42')][0x2]?_0x3e0b67['attrs'][0x2][_0x6f96('0x43')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3e0b67['attrVoiceQueues']||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x3]?_0x3e0b67[_0x6f96('0x42')][0x3][_0x6f96('0x43')]:undefined)||[]},{'name':'attrChannel','value':_0x3e0b67[_0x6f96('0x51')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x4]?_0x3e0b67['attrs'][0x4][_0x6f96('0x43')]:undefined)||_0x6f96('0x52')},{'name':_0x6f96('0x53'),'value':_0x3e0b67[_0x6f96('0x53')]||(_0x3e0b67['attrs']&&_0x3e0b67['attrs'][0x5]?_0x3e0b67['attrs'][0x5][_0x6f96('0x43')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3e0b67['attrFaxAccounts']||(_0x3e0b67['attrs']&&_0x3e0b67[_0x6f96('0x42')][0x6]?_0x3e0b67['attrs'][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x3e0b67[_0x6f96('0x55')]||(_0x3e0b67['attrs']&&_0x3e0b67[_0x6f96('0x42')][0x7]?_0x3e0b67[_0x6f96('0x42')][0x7][_0x6f96('0x43')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3e0b67['attrOpenchannelAccounts']||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x8]?_0x3e0b67[_0x6f96('0x42')][0x8][_0x6f96('0x43')]:undefined)||''},{'name':_0x6f96('0x57'),'value':_0x3e0b67['attrWhatsappAccounts']||(_0x3e0b67['attrs']&&_0x3e0b67[_0x6f96('0x42')][0x9]?_0x3e0b67[_0x6f96('0x42')][0x9][_0x6f96('0x43')]:undefined)||''},{'name':_0x6f96('0x58'),'value':_0x3e0b67[_0x6f96('0x58')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0xa]?_0x3e0b67['attrs'][0xa][_0x6f96('0x43')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x3e0b67['reportType']||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x0]?_0x3e0b67[_0x6f96('0x42')][0x0][_0x6f96('0x3f')]:undefined)||null,'value':_0x3e0b67['attrReport']||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67['attrs'][0x0]?_0x3e0b67[_0x6f96('0x42')][0x0][_0x6f96('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x3e0b67[_0x6f96('0x5c')]||(_0x3e0b67[_0x6f96('0x42')]&&_0x3e0b67[_0x6f96('0x42')][0x1]?_0x3e0b67[_0x6f96('0x42')][0x1][_0x6f96('0x43')]:undefined)||0x0}];default:return[];}}catch(_0xd52d2a){logger[_0x6f96('0x2e')]('widgetAttributes:\x20%s',JSON[_0x6f96('0x5d')](_0xd52d2a));return[];}}exports[_0x6f96('0x5e')]=function(_0x404ef9,_0x25917b){if(_0x404ef9[_0x6f96('0x5f')]){_0x404ef9[_0x6f96('0x5f')][_0x6f96('0x42')]=widgetAttributes(_0x404ef9['body']);}return db['DashboardItem'][_0x6f96('0x5e')](_0x404ef9[_0x6f96('0x5f')],{})[_0x6f96('0x2c')](respondWithResult(_0x25917b,0xc9))['catch'](handleError(_0x25917b,null));};exports[_0x6f96('0x2b')]=function(_0x1e9841,_0x347ee6){if(_0x1e9841[_0x6f96('0x5f')]['id']){delete _0x1e9841['body']['id'];}_0x1e9841[_0x6f96('0x5f')][_0x6f96('0x42')]=widgetAttributes(_0x1e9841[_0x6f96('0x5f')]);return db[_0x6f96('0x35')][_0x6f96('0x60')]({'where':{'id':_0x1e9841[_0x6f96('0x32')]['id']}})['then'](handleEntityNotFound(_0x347ee6,null))[_0x6f96('0x2c')](saveUpdates(_0x1e9841['body'],null))[_0x6f96('0x2c')](respondWithResult(_0x347ee6,null))[_0x6f96('0x3e')](handleError(_0x347ee6,null));}; \ No newline at end of file +var _0x1c75=['attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','attrFaxAccounts','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','DashboardItem','find','catch','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x535d14,_0xe332b1){var _0x413448=function(_0x5b3d7b){while(--_0x5b3d7b){_0x535d14['push'](_0x535d14['shift']());}};_0x413448(++_0xe332b1);}(_0x1c75,0xce));var _0x51c7=function(_0x347f4e,_0x51235d){_0x347f4e=_0x347f4e-0x0;var _0x32164d=_0x1c75[_0x347f4e];return _0x32164d;};'use strict';var emlformat=require(_0x51c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51c7('0x1'));var moment=require(_0x51c7('0x2'));var BPromise=require(_0x51c7('0x3'));var Mustache=require(_0x51c7('0x4'));var util=require(_0x51c7('0x5'));var path=require(_0x51c7('0x6'));var sox=require(_0x51c7('0x7'));var csv=require(_0x51c7('0x8'));var ejs=require(_0x51c7('0x9'));var fs=require('fs');var fs_extra=require(_0x51c7('0xa'));var _=require(_0x51c7('0xb'));var squel=require('squel');var crypto=require(_0x51c7('0xc'));var jsforce=require(_0x51c7('0xd'));var deskjs=require(_0x51c7('0xe'));var toCsv=require(_0x51c7('0x8'));var querystring=require('querystring');var Papa=require(_0x51c7('0xf'));var Redis=require('ioredis');var authService=require(_0x51c7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x51c7('0x11'));var hardwareService=require(_0x51c7('0x12'));var logger=require('../../config/logger')(_0x51c7('0x13'));var utils=require(_0x51c7('0x14'));var config=require(_0x51c7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x51c7('0x16')](config[_0x51c7('0x17')],{'host':_0x51c7('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51c7('0x17')]));require('./dashboardItem.socket')[_0x51c7('0x19')](socket);function respondWithStatusCode(_0x5a5ea9,_0x2e54af){_0x2e54af=_0x2e54af||0xcc;return function(_0x48f08a){if(_0x48f08a){return _0x5a5ea9[_0x51c7('0x1a')](_0x2e54af);}return _0x5a5ea9[_0x51c7('0x1b')](_0x2e54af)[_0x51c7('0x1c')]();};}function respondWithResult(_0x39da99,_0x521d8a){_0x521d8a=_0x521d8a||0xc8;return function(_0x177e14){if(_0x177e14){return _0x39da99[_0x51c7('0x1b')](_0x521d8a)[_0x51c7('0x1d')](_0x177e14);}};}function respondWithFilteredResult(_0x3079b7,_0x209ab3){return function(_0x36b29a){if(_0x36b29a){var _0x4a64e4=typeof _0x209ab3[_0x51c7('0x1e')]===_0x51c7('0x1f')&&typeof _0x209ab3[_0x51c7('0x20')]==='undefined';var _0x3c1f43=_0x36b29a[_0x51c7('0x21')];var _0x51f751=_0x4a64e4?0x0:_0x209ab3['offset'];var _0x1fa9d5=_0x4a64e4?_0x36b29a[_0x51c7('0x21')]:_0x209ab3[_0x51c7('0x1e')]+_0x209ab3[_0x51c7('0x20')];var _0x4072b9;if(_0x1fa9d5>=_0x3c1f43){_0x1fa9d5=_0x3c1f43;_0x4072b9=0xc8;}else{_0x4072b9=0xce;}_0x3079b7[_0x51c7('0x1b')](_0x4072b9);return _0x3079b7[_0x51c7('0x22')]('Content-Range',_0x51f751+'-'+_0x1fa9d5+'/'+_0x3c1f43)[_0x51c7('0x1d')](_0x36b29a);}return null;};}function patchUpdates(_0x11c83d){return function(_0x4e0108){try{jsonpatch[_0x51c7('0x23')](_0x4e0108,_0x11c83d,!![]);}catch(_0x48b259){return BPromise[_0x51c7('0x24')](_0x48b259);}return _0x4e0108[_0x51c7('0x25')]();};}function saveUpdates(_0x414de0,_0x48e6e6){return function(_0x11f01f){if(_0x11f01f){return _0x11f01f[_0x51c7('0x26')](_0x414de0)[_0x51c7('0x27')](function(_0x13a3ad){return _0x13a3ad;});}return null;};}function removeEntity(_0x44de99,_0x1c3935){return function(_0x57fe70){if(_0x57fe70){return _0x57fe70[_0x51c7('0x28')]()['then'](function(){_0x44de99[_0x51c7('0x1b')](0xcc)[_0x51c7('0x1c')]();});}};}function handleEntityNotFound(_0x331ad9,_0x1c29fb){return function(_0x375a70){if(!_0x375a70){_0x331ad9[_0x51c7('0x1a')](0x194);}return _0x375a70;};}function handleError(_0x32ac6e,_0x198465){_0x198465=_0x198465||0x1f4;return function(_0x42745b){logger[_0x51c7('0x29')](_0x42745b[_0x51c7('0x2a')]);if(_0x42745b[_0x51c7('0x2b')]){delete _0x42745b['name'];}_0x32ac6e[_0x51c7('0x1b')](_0x198465)[_0x51c7('0x2c')](_0x42745b);};}exports[_0x51c7('0x2d')]=function(_0x2eebb4,_0x588fbb){var _0x21ff27={'raw':![],'where':{'id':_0x2eebb4[_0x51c7('0x2e')]['id']}},_0x5e90bc={};_0x5e90bc[_0x51c7('0x2f')]=_[_0x51c7('0x30')](db['DashboardItem'][_0x51c7('0x31')]);_0x5e90bc['query']=_[_0x51c7('0x30')](_0x2eebb4[_0x51c7('0x32')]);_0x5e90bc[_0x51c7('0x33')]=_[_0x51c7('0x34')](_0x5e90bc[_0x51c7('0x2f')],_0x5e90bc[_0x51c7('0x32')]);_0x21ff27[_0x51c7('0x35')]=_[_0x51c7('0x34')](_0x5e90bc[_0x51c7('0x2f')],qs[_0x51c7('0x36')](_0x2eebb4['query'][_0x51c7('0x36')]));_0x21ff27['attributes']=_0x21ff27[_0x51c7('0x35')][_0x51c7('0x37')]?_0x21ff27['attributes']:_0x5e90bc[_0x51c7('0x2f')];if(_0x2eebb4[_0x51c7('0x32')][_0x51c7('0x38')]){_0x21ff27[_0x51c7('0x39')]=[{'all':!![]}];}_0x21ff27=_['merge']({},_0x21ff27,_0x2eebb4[_0x51c7('0x3a')]);return db[_0x51c7('0x3b')][_0x51c7('0x3c')](_0x21ff27)[_0x51c7('0x27')](handleEntityNotFound(_0x588fbb,null))['then'](respondWithResult(_0x588fbb,null))[_0x51c7('0x3d')](handleError(_0x588fbb,null));};exports[_0x51c7('0x28')]=function(_0x13fa10,_0x39ba1e){return db[_0x51c7('0x3b')]['find']({'where':{'id':_0x13fa10[_0x51c7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x39ba1e,null))[_0x51c7('0x27')](removeEntity(_0x39ba1e,null))['catch'](handleError(_0x39ba1e,null));};function widgetAttributes(_0x12f54c){try{switch(_0x12f54c[_0x51c7('0x3e')]){case'iframe':return[{'name':_0x51c7('0x3f'),'value':_0x12f54c[_0x51c7('0x3f')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c['attrs'][0x0]['value']:undefined)||_0x51c7('0x41')}];case _0x51c7('0x42'):return[{'name':_0x51c7('0x43'),'value':_0x12f54c[_0x51c7('0x43')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c['attrs'][0x0][_0x51c7('0x44')]:undefined)||''}];case _0x51c7('0x45'):return[{'name':_0x51c7('0x46'),'value':_0x12f54c[_0x51c7('0x46')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x47')},{'name':_0x51c7('0x48'),'value':_0x12f54c[_0x51c7('0x48')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||'0.00'},{'name':_0x51c7('0x49'),'value':_0x12f54c[_0x51c7('0x49')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||0xc}];case _0x51c7('0x4a'):return[{'name':_0x51c7('0x4b'),'value':_0x12f54c[_0x51c7('0x4b')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x0]?_0x12f54c['attrs'][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x4c')},{'name':_0x51c7('0x4d'),'value':_0x12f54c[_0x51c7('0x4d')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||[]},{'name':_0x51c7('0x49'),'value':_0x12f54c['attrFontSize']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x12f54c[_0x51c7('0x4e')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x3]?_0x12f54c[_0x51c7('0x40')][0x3][_0x51c7('0x44')]:undefined)||_0x51c7('0x4f')},{'name':'attrEmailAccounts','value':_0x12f54c['attrEmailAccounts']||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x4]?_0x12f54c[_0x51c7('0x40')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x12f54c['attrFaxAccounts']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x5]?_0x12f54c[_0x51c7('0x40')][0x5][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x50'),'value':_0x12f54c[_0x51c7('0x50')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x6]?_0x12f54c[_0x51c7('0x40')][0x6][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x51'),'value':_0x12f54c[_0x51c7('0x51')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x7]?_0x12f54c[_0x51c7('0x40')][0x7]['value']:undefined)||''},{'name':_0x51c7('0x52'),'value':_0x12f54c[_0x51c7('0x52')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x8]?_0x12f54c[_0x51c7('0x40')][0x8]['value']:undefined)||''},{'name':_0x51c7('0x53'),'value':_0x12f54c[_0x51c7('0x53')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x9]?_0x12f54c[_0x51c7('0x40')][0x9][_0x51c7('0x44')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x51c7('0x54'),'value':_0x12f54c[_0x51c7('0x54')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x4c')},{'name':_0x51c7('0x55'),'value':_0x12f54c[_0x51c7('0x55')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||null},{'name':_0x51c7('0x56'),'value':_0x12f54c[_0x51c7('0x56')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x12f54c['attrVoiceQueues']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x3]?_0x12f54c[_0x51c7('0x40')][0x3][_0x51c7('0x44')]:undefined)||[]},{'name':'attrChannel','value':_0x12f54c[_0x51c7('0x4e')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x4]?_0x12f54c[_0x51c7('0x40')][0x4][_0x51c7('0x44')]:undefined)||'voice'},{'name':_0x51c7('0x57'),'value':_0x12f54c[_0x51c7('0x57')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x5]?_0x12f54c['attrs'][0x5]['value']:undefined)||''},{'name':_0x51c7('0x58'),'value':_0x12f54c[_0x51c7('0x58')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x6]?_0x12f54c[_0x51c7('0x40')][0x6][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x50'),'value':_0x12f54c[_0x51c7('0x50')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x7]?_0x12f54c['attrs'][0x7]['value']:undefined)||''},{'name':_0x51c7('0x51'),'value':_0x12f54c['attrOpenchannelAccounts']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x8]?_0x12f54c[_0x51c7('0x40')][0x8][_0x51c7('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x12f54c[_0x51c7('0x52')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x9]?_0x12f54c['attrs'][0x9][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x53'),'value':_0x12f54c['attrChatWebsites']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0xa]?_0x12f54c[_0x51c7('0x40')][0xa]['value']:undefined)||''}];case _0x51c7('0x59'):return[{'name':_0x51c7('0x5a'),'type':_0x12f54c[_0x51c7('0x5b')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x3e')]:undefined)||null,'value':_0x12f54c[_0x51c7('0x5a')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||null},{'name':_0x51c7('0x5c'),'value':_0x12f54c[_0x51c7('0x5c')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x1]?_0x12f54c['attrs'][0x1][_0x51c7('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x3dabf1){logger[_0x51c7('0x29')]('widgetAttributes:\x20%s',JSON[_0x51c7('0x5d')](_0x3dabf1));return[];}}exports[_0x51c7('0x5e')]=function(_0x354a96,_0x5470b7){if(_0x354a96[_0x51c7('0x5f')]){_0x354a96['body'][_0x51c7('0x40')]=widgetAttributes(_0x354a96[_0x51c7('0x5f')]);}return db['DashboardItem']['create'](_0x354a96['body'],{})[_0x51c7('0x27')](respondWithResult(_0x5470b7,0xc9))[_0x51c7('0x3d')](handleError(_0x5470b7,null));};exports[_0x51c7('0x26')]=function(_0x175bd1,_0x438e7f){if(_0x175bd1[_0x51c7('0x5f')]['id']){delete _0x175bd1[_0x51c7('0x5f')]['id'];}_0x175bd1[_0x51c7('0x5f')][_0x51c7('0x40')]=widgetAttributes(_0x175bd1['body']);return db[_0x51c7('0x3b')][_0x51c7('0x3c')]({'where':{'id':_0x175bd1['params']['id']}})[_0x51c7('0x27')](handleEntityNotFound(_0x438e7f,null))[_0x51c7('0x27')](saveUpdates(_0x175bd1[_0x51c7('0x5f')],null))['then'](respondWithResult(_0x438e7f,null))[_0x51c7('0x3d')](handleError(_0x438e7f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index cc36db5..811e61d 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 _0x4c79=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x20e8d6,_0x4d9a75){var _0x44ea29=function(_0x1eb036){while(--_0x1eb036){_0x20e8d6['push'](_0x20e8d6['shift']());}};_0x44ea29(++_0x4d9a75);}(_0x4c79,0xf9));var _0x94c7=function(_0x482f76,_0x588ec9){_0x482f76=_0x482f76-0x0;var _0x229e38=_0x4c79[_0x482f76];return _0x229e38;};'use strict';var EventEmitter=require(_0x94c7('0x0'));var DashboardItem=require(_0x94c7('0x1'))['db'][_0x94c7('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x94c7('0x3')](0x0);var events={'afterCreate':_0x94c7('0x4'),'afterUpdate':_0x94c7('0x5'),'afterDestroy':_0x94c7('0x6')};function emitEvent(_0x43d51d){return function(_0x58827d,_0x4bf06a,_0x4ac0f6){DashboardItemEvents[_0x94c7('0x7')](_0x43d51d+':'+_0x58827d['id'],_0x58827d);DashboardItemEvents[_0x94c7('0x7')](_0x43d51d,_0x58827d);_0x4ac0f6(null);};}for(var e in events){if(events[_0x94c7('0x8')](e)){var event=events[e];DashboardItem[_0x94c7('0x9')](e,emitEvent(event));}}module[_0x94c7('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x0fe0=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0fe0,0x1d2));var _0x00fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fe0[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x00fe('0x0'));var DashboardItem=require(_0x00fe('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x00fe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x00fe('0x3')};function emitEvent(_0x5b8af5){return function(_0xbff9b,_0x1303e5,_0x5601dc){DashboardItemEvents[_0x00fe('0x4')](_0x5b8af5+':'+_0xbff9b['id'],_0xbff9b);DashboardItemEvents[_0x00fe('0x4')](_0x5b8af5,_0xbff9b);_0x5601dc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x00fe('0x5')](e,emitEvent(event));}}module[_0x00fe('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 485655c..76470e4 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 _0x8ee5=['moment','path','rimraf','./dashboardItem.attributes','exports','define','dashboard_items','util','../../config/logger','api'];(function(_0x3d139b,_0x4bba6c){var _0x5af936=function(_0x2d950a){while(--_0x2d950a){_0x3d139b['push'](_0x3d139b['shift']());}};_0x5af936(++_0x4bba6c);}(_0x8ee5,0x179));var _0x58ee=function(_0x3bb9fb,_0xfb84ce){_0x3bb9fb=_0x3bb9fb-0x0;var _0x1c1230=_0x8ee5[_0x3bb9fb];return _0x1c1230;};'use strict';var _=require('lodash');var util=require(_0x58ee('0x0'));var logger=require(_0x58ee('0x1'))(_0x58ee('0x2'));var moment=require(_0x58ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ee('0x4'));var rimraf=require(_0x58ee('0x5'));var config=require('../../config/environment');var attributes=require(_0x58ee('0x6'));module[_0x58ee('0x7')]=function(_0x1695d6,_0x5b8fa8){return _0x1695d6[_0x58ee('0x8')]('DashboardItem',attributes,{'tableName':_0x58ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9251=['path','rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x9251,0x1e6));var _0x1925=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x9251[_0x1034ca];return _0x1a023a;};'use strict';var _=require('lodash');var util=require(_0x1925('0x0'));var logger=require(_0x1925('0x1'))(_0x1925('0x2'));var moment=require(_0x1925('0x3'));var BPromise=require(_0x1925('0x4'));var rp=require(_0x1925('0x5'));var fs=require('fs');var path=require(_0x1925('0x6'));var rimraf=require(_0x1925('0x7'));var config=require(_0x1925('0x8'));var attributes=require(_0x1925('0x9'));module['exports']=function(_0x24af68,_0xe3c3a5){return _0x24af68[_0x1925('0xa')](_0x1925('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 4124f7b..b1d4ef2 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 _0x5ac2=['bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x102bd4,_0x282f90){var _0x39d62d=function(_0x950751){while(--_0x950751){_0x102bd4['push'](_0x102bd4['shift']());}};_0x39d62d(++_0x282f90);}(_0x5ac2,0x105));var _0x25ac=function(_0x5c904c,_0x138fee){_0x5c904c=_0x5c904c-0x0;var _0x2005dd=_0x5ac2[_0x5c904c];return _0x2005dd;};'use strict';var _=require(_0x25ac('0x0'));var util=require(_0x25ac('0x1'));var moment=require(_0x25ac('0x2'));var BPromise=require(_0x25ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x25ac('0x5'));var config=require(_0x25ac('0x6'));var jayson=require(_0x25ac('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x25ac('0x8')](config[_0x25ac('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x25ac('0xa'))(new Redis(config['redis']));require(_0x25ac('0xb'))['register'](socket);function respondWithRpcPromise(_0x3be63f,_0x255a1f,_0x18c08d){return new BPromise(function(_0x1b8ff8,_0x219a71){return client[_0x25ac('0xc')](_0x3be63f,_0x18c08d)[_0x25ac('0xd')](function(_0x6ce98f){logger[_0x25ac('0xe')](_0x25ac('0xf'),_0x255a1f,_0x25ac('0x10'));logger['debug'](_0x25ac('0x11'),_0x255a1f,_0x25ac('0x10'),JSON['stringify'](_0x6ce98f));if(_0x6ce98f[_0x25ac('0x12')]){if(_0x6ce98f[_0x25ac('0x12')][_0x25ac('0x13')]===0x1f4){logger[_0x25ac('0x12')](_0x25ac('0xf'),_0x255a1f,_0x6ce98f['error']['message']);return _0x219a71(_0x6ce98f[_0x25ac('0x12')][_0x25ac('0x14')]);}logger[_0x25ac('0x12')](_0x25ac('0xf'),_0x255a1f,_0x6ce98f[_0x25ac('0x12')][_0x25ac('0x14')]);return _0x1b8ff8(_0x6ce98f[_0x25ac('0x12')]['message']);}else{logger['info'](_0x25ac('0xf'),_0x255a1f,_0x25ac('0x10'));_0x1b8ff8(_0x6ce98f[_0x25ac('0x15')][_0x25ac('0x14')]);}})['catch'](function(_0x5e9dc6){logger[_0x25ac('0x12')](_0x25ac('0xf'),_0x255a1f,_0x5e9dc6);_0x219a71(_0x5e9dc6);});});} \ No newline at end of file +var _0x3d34=['localhost','register','request','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DashboardItem,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x3aa1d5,_0x470cc2){var _0x931515=function(_0x2d0a02){while(--_0x2d0a02){_0x3aa1d5['push'](_0x3aa1d5['shift']());}};_0x931515(++_0x470cc2);}(_0x3d34,0x1c7));var _0x43d3=function(_0x16dfb3,_0x1613fc){_0x16dfb3=_0x16dfb3-0x0;var _0x1d8030=_0x3d34[_0x16dfb3];return _0x1d8030;};'use strict';var _=require(_0x43d3('0x0'));var util=require(_0x43d3('0x1'));var moment=require(_0x43d3('0x2'));var BPromise=require(_0x43d3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43d3('0x4'));var db=require(_0x43d3('0x5'))['db'];var utils=require(_0x43d3('0x6'));var logger=require('../../config/logger')(_0x43d3('0x7'));var config=require(_0x43d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43d3('0x9')][_0x43d3('0xa')]({'port':0x232a});config[_0x43d3('0xb')]=_[_0x43d3('0xc')](config[_0x43d3('0xb')],{'host':_0x43d3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43d3('0xb')]));require('./dashboardItem.socket')[_0x43d3('0xe')](socket);function respondWithRpcPromise(_0x13c9cb,_0x671bf2,_0x5df88c){return new BPromise(function(_0x2829c9,_0x2335ef){return client[_0x43d3('0xf')](_0x13c9cb,_0x5df88c)['then'](function(_0x167371){logger['info']('DashboardItem,\x20%s,\x20%s',_0x671bf2,_0x43d3('0x10'));logger[_0x43d3('0x11')](_0x43d3('0x12'),_0x671bf2,_0x43d3('0x10'),JSON[_0x43d3('0x13')](_0x167371));if(_0x167371[_0x43d3('0x14')]){if(_0x167371[_0x43d3('0x14')][_0x43d3('0x15')]===0x1f4){logger[_0x43d3('0x14')]('DashboardItem,\x20%s,\x20%s',_0x671bf2,_0x167371['error'][_0x43d3('0x16')]);return _0x2335ef(_0x167371[_0x43d3('0x14')][_0x43d3('0x16')]);}logger[_0x43d3('0x14')](_0x43d3('0x17'),_0x671bf2,_0x167371[_0x43d3('0x14')][_0x43d3('0x16')]);return _0x2829c9(_0x167371[_0x43d3('0x14')][_0x43d3('0x16')]);}else{logger[_0x43d3('0x18')](_0x43d3('0x17'),_0x671bf2,'request\x20sent');_0x2829c9(_0x167371['result'][_0x43d3('0x16')]);}})[_0x43d3('0x19')](function(_0x33044b){logger[_0x43d3('0x14')](_0x43d3('0x17'),_0x671bf2,_0x33044b);_0x2335ef(_0x33044b);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index cfecb59..ca133a0 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 _0xce16=['./dashboardItem.events','save','remove','update','removeListener','register','dashboardItem:'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xce16,0x173));var _0x6ce1=function(_0x4d3f2f,_0x5eaa89){_0x4d3f2f=_0x4d3f2f-0x0;var _0x430175=_0xce16[_0x4d3f2f];return _0x430175;};'use strict';var DashboardItemEvents=require(_0x6ce1('0x0'));var events=[_0x6ce1('0x1'),_0x6ce1('0x2'),_0x6ce1('0x3')];function createListener(_0x3a6cee,_0x53175c){return function(_0x2844e9){_0x53175c['emit'](_0x3a6cee,_0x2844e9);};}function removeListener(_0x1a1f4a,_0x4b2b82){return function(){DashboardItemEvents[_0x6ce1('0x4')](_0x1a1f4a,_0x4b2b82);};}exports[_0x6ce1('0x5')]=function(_0x4d22b4){for(var _0x2e5eb2=0x0,_0x4398f2=events['length'];_0x2e5eb2<_0x4398f2;_0x2e5eb2++){var _0x102ec3=events[_0x2e5eb2];var _0x1f23c5=createListener(_0x6ce1('0x6')+_0x102ec3,_0x4d22b4);DashboardItemEvents['on'](_0x102ec3,_0x1f23c5);}}; \ No newline at end of file +var _0x023a=['save','update','emit','removeListener','register','length'];(function(_0xa7f7b6,_0x4fd285){var _0x4e8221=function(_0xa0716e){while(--_0xa0716e){_0xa7f7b6['push'](_0xa7f7b6['shift']());}};_0x4e8221(++_0x4fd285);}(_0x023a,0xae));var _0xa023=function(_0x420f0b,_0x20948d){_0x420f0b=_0x420f0b-0x0;var _0x44a149=_0x023a[_0x420f0b];return _0x44a149;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xa023('0x0'),'remove',_0xa023('0x1')];function createListener(_0x258856,_0xe5b681){return function(_0x352d1a){_0xe5b681[_0xa023('0x2')](_0x258856,_0x352d1a);};}function removeListener(_0x2daf2e,_0x5edee8){return function(){DashboardItemEvents[_0xa023('0x3')](_0x2daf2e,_0x5edee8);};}exports[_0xa023('0x4')]=function(_0x5d9a55){for(var _0x5881f1=0x0,_0x299a36=events[_0xa023('0x5')];_0x5881f1<_0x299a36;_0x5881f1++){var _0x2c074a=events[_0x5881f1];var _0x46aed0=createListener('dashboardItem:'+_0x2c074a,_0x5d9a55);DashboardItemEvents['on'](_0x2c074a,_0x46aed0);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 949a3e3..5a8afed 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 _0xd7bc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x24473c,_0x4b9928){var _0x898930=function(_0x5d87e7){while(--_0x5d87e7){_0x24473c['push'](_0x24473c['shift']());}};_0x898930(++_0x4b9928);}(_0xd7bc,0x12d));var _0xcd7b=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xd7bc[_0x4b6778];return _0x22dbb9;};'use strict';var multer=require(_0xcd7b('0x0'));var util=require('util');var path=require(_0xcd7b('0x1'));var timeout=require(_0xcd7b('0x2'));var express=require(_0xcd7b('0x3'));var router=express[_0xcd7b('0x4')]();var fs_extra=require(_0xcd7b('0x5'));var auth=require(_0xcd7b('0x6'));var interaction=require(_0xcd7b('0x7'));var config=require(_0xcd7b('0x8'));var controller=require('./dashboardItem.controller');router[_0xcd7b('0x9')](_0xcd7b('0xa'),auth[_0xcd7b('0xb')](),controller[_0xcd7b('0xc')]);router[_0xcd7b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xcd7b('0xb')](),controller[_0xcd7b('0xe')]);router[_0xcd7b('0xf')](_0xcd7b('0xa'),auth['isAuthenticated'](),controller[_0xcd7b('0x10')]);module[_0xcd7b('0x11')]=router; \ No newline at end of file +var _0xf0f2=['Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x541756,_0x4f2167){var _0x4351b4=function(_0x16dc59){while(--_0x16dc59){_0x541756['push'](_0x541756['shift']());}};_0x4351b4(++_0x4f2167);}(_0xf0f2,0x75));var _0x2f0f=function(_0x462a88,_0xbf35a2){_0x462a88=_0x462a88-0x0;var _0x2e86ce=_0xf0f2[_0x462a88];return _0x2e86ce;};'use strict';var multer=require(_0x2f0f('0x0'));var util=require(_0x2f0f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2f0f('0x2')]();var fs_extra=require(_0x2f0f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2f0f('0x4'));var config=require(_0x2f0f('0x5'));var controller=require(_0x2f0f('0x6'));router['get'](_0x2f0f('0x7'),auth[_0x2f0f('0x8')](),controller[_0x2f0f('0x9')]);router[_0x2f0f('0xa')]('/',auth[_0x2f0f('0x8')](),controller[_0x2f0f('0xb')]);router[_0x2f0f('0xc')]('/:id',auth[_0x2f0f('0x8')](),controller[_0x2f0f('0xd')]);router[_0x2f0f('0xe')](_0x2f0f('0x7'),auth[_0x2f0f('0x8')](),controller[_0x2f0f('0xf')]);module[_0x2f0f('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5c0a34f..9d69c56 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 _0x0676=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x550296,_0x22e9d7){var _0x5a9993=function(_0x104c18){while(--_0x104c18){_0x550296['push'](_0x550296['shift']());}};_0x5a9993(++_0x22e9d7);}(_0x0676,0x11e));var _0x6067=function(_0xadf992,_0xc5b47d){_0xadf992=_0xadf992-0x0;var _0x24a021=_0x0676[_0xadf992];return _0x24a021;};'use strict';var Sequelize=require(_0x6067('0x0'));module[_0x6067('0x1')]={'name':{'type':Sequelize[_0x6067('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x6067('0x3')](_0x6067('0x4'),_0x6067('0x5'),_0x6067('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x6067('0x2')]}}; \ No newline at end of file +var _0x48b4=['ENUM','third','first','sequelize','exports','STRING'];(function(_0x520f3b,_0x2a7684){var _0x2e60fe=function(_0x468afb){while(--_0x468afb){_0x520f3b['push'](_0x520f3b['shift']());}};_0x2e60fe(++_0x2a7684);}(_0x48b4,0x147));var _0x448b=function(_0x214c4a,_0xfa03cd){_0x214c4a=_0x214c4a-0x0;var _0xc2011f=_0x48b4[_0x214c4a];return _0xc2011f;};'use strict';var Sequelize=require(_0x448b('0x0'));module[_0x448b('0x1')]={'name':{'type':Sequelize[_0x448b('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x448b('0x3')]('first','second',_0x448b('0x4')),'allowNull':![],'defaultValue':_0x448b('0x5')},'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 eee5c6a..e0d191a 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 _0x508e=['name','send','index','map','Disposition','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','find','destroy','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','get','Dispositions','UserProfileResource','then','error'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x508e,0x7a));var _0xe508=function(_0x500c88,_0x49c688){_0x500c88=_0x500c88-0x0;var _0x495835=_0x508e[_0x500c88];return _0x495835;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe508('0x0'));var zipdir=require(_0xe508('0x1'));var jsonpatch=require(_0xe508('0x2'));var rp=require('request-promise');var moment=require(_0xe508('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe508('0x4'));var util=require(_0xe508('0x5'));var path=require(_0xe508('0x6'));var sox=require(_0xe508('0x7'));var csv=require('to-csv');var ejs=require(_0xe508('0x8'));var fs=require('fs');var fs_extra=require(_0xe508('0x9'));var _=require(_0xe508('0xa'));var squel=require('squel');var crypto=require(_0xe508('0xb'));var jsforce=require(_0xe508('0xc'));var deskjs=require(_0xe508('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe508('0xe'));var Papa=require(_0xe508('0xf'));var Redis=require(_0xe508('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe508('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe508('0x12'))(_0xe508('0x13'));var utils=require('../../config/utils');var config=require(_0xe508('0x14'));var licenseUtil=require(_0xe508('0x15'));var db=require(_0xe508('0x16'))['db'];function respondWithStatusCode(_0x397911,_0x43c948){_0x43c948=_0x43c948||0xcc;return function(_0x15c4ce){if(_0x15c4ce){return _0x397911[_0xe508('0x17')](_0x43c948);}return _0x397911[_0xe508('0x18')](_0x43c948)[_0xe508('0x19')]();};}function respondWithResult(_0xa0ead8,_0x201d4f){_0x201d4f=_0x201d4f||0xc8;return function(_0x1aba4d){if(_0x1aba4d){return _0xa0ead8[_0xe508('0x18')](_0x201d4f)[_0xe508('0x1a')](_0x1aba4d);}};}function respondWithFilteredResult(_0x5bbd5c,_0x7798d4){return function(_0x5c89f0){if(_0x5c89f0){var _0x4584a3=typeof _0x7798d4[_0xe508('0x1b')]===_0xe508('0x1c')&&typeof _0x7798d4['limit']===_0xe508('0x1c');var _0x52490d=_0x5c89f0[_0xe508('0x1d')];var _0x5b49df=_0x4584a3?0x0:_0x7798d4[_0xe508('0x1b')];var _0x1dee9e=_0x4584a3?_0x5c89f0[_0xe508('0x1d')]:_0x7798d4['offset']+_0x7798d4[_0xe508('0x1e')];var _0x4c6c8f;if(_0x1dee9e>=_0x52490d){_0x1dee9e=_0x52490d;_0x4c6c8f=0xc8;}else{_0x4c6c8f=0xce;}_0x5bbd5c[_0xe508('0x18')](_0x4c6c8f);return _0x5bbd5c['set'](_0xe508('0x1f'),_0x5b49df+'-'+_0x1dee9e+'/'+_0x52490d)[_0xe508('0x1a')](_0x5c89f0);}return null;};}function patchUpdates(_0x68e924){return function(_0x5d6f47){try{jsonpatch[_0xe508('0x20')](_0x5d6f47,_0x68e924,!![]);}catch(_0x462c63){return BPromise[_0xe508('0x21')](_0x462c63);}return _0x5d6f47[_0xe508('0x22')]();};}function saveUpdates(_0x4d4420,_0x3ff8d7){return function(_0x2830e1){if(_0x2830e1){return _0x2830e1['update'](_0x4d4420)['then'](function(_0x14d422){return _0x14d422;});}return null;};}function removeEntity(_0x40cc8b,_0x452f3e){return function(_0x1c9657){if(_0x1c9657){return _0x1c9657['destroy']()['then'](function(){var _0x3f7f5a=_0x1c9657[_0xe508('0x23')]({'plain':!![]});var _0x3d94f9=_0xe508('0x24');return db[_0xe508('0x25')]['destroy']({'where':{'type':_0x3d94f9,'resourceId':_0x3f7f5a['id']}})[_0xe508('0x26')](function(){return _0x1c9657;});})[_0xe508('0x26')](function(){_0x40cc8b[_0xe508('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3ddb,_0x435e8f){return function(_0x34b9c8){if(!_0x34b9c8){_0x2c3ddb[_0xe508('0x17')](0x194);}return _0x34b9c8;};}function handleError(_0x8779d8,_0x2e91ef){_0x2e91ef=_0x2e91ef||0x1f4;return function(_0x17cf04){logger[_0xe508('0x27')](_0x17cf04['stack']);if(_0x17cf04['name']){delete _0x17cf04[_0xe508('0x28')];}_0x8779d8[_0xe508('0x18')](_0x2e91ef)[_0xe508('0x29')](_0x17cf04);};}exports[_0xe508('0x2a')]=function(_0x28827c,_0x230bf1){var _0x14d85f={},_0x58964a={},_0x576bb4={'count':0x0,'rows':[]};var _0x5a362d=_[_0xe508('0x2b')](db[_0xe508('0x2c')]['rawAttributes'],function(_0x56c89b){return{'name':_0x56c89b['fieldName'],'type':_0x56c89b['type'][_0xe508('0x2d')]};});_0x58964a[_0xe508('0x2e')]=_[_0xe508('0x2b')](_0x5a362d,_0xe508('0x28'));_0x58964a[_0xe508('0x2f')]=_['keys'](_0x28827c[_0xe508('0x2f')]);_0x58964a[_0xe508('0x30')]=_[_0xe508('0x31')](_0x58964a['model'],_0x58964a[_0xe508('0x2f')]);_0x14d85f['attributes']=_[_0xe508('0x31')](_0x58964a['model'],qs[_0xe508('0x32')](_0x28827c[_0xe508('0x2f')][_0xe508('0x32')]));_0x14d85f[_0xe508('0x33')]=_0x14d85f[_0xe508('0x33')]['length']?_0x14d85f[_0xe508('0x33')]:_0x58964a[_0xe508('0x2e')];if(!_0x28827c[_0xe508('0x2f')][_0xe508('0x34')](_0xe508('0x35'))){_0x14d85f['limit']=qs[_0xe508('0x1e')](_0x28827c[_0xe508('0x2f')][_0xe508('0x1e')]);_0x14d85f['offset']=qs[_0xe508('0x1b')](_0x28827c[_0xe508('0x2f')][_0xe508('0x1b')]);}_0x14d85f[_0xe508('0x36')]=qs['sort'](_0x28827c[_0xe508('0x2f')][_0xe508('0x37')]);_0x14d85f[_0xe508('0x38')]=qs['filters'](_[_0xe508('0x39')](_0x28827c[_0xe508('0x2f')],_0x58964a[_0xe508('0x30')]),_0x5a362d);if(_0x28827c[_0xe508('0x2f')]['filter']){_0x14d85f['where']=_[_0xe508('0x3a')](_0x14d85f[_0xe508('0x38')],{'$or':_[_0xe508('0x2b')](_0x5a362d,function(_0x38d35b){if(_0x38d35b[_0xe508('0x3b')]!==_0xe508('0x3c')){var _0x51e02f={};_0x51e02f[_0x38d35b['name']]={'$like':'%'+_0x28827c[_0xe508('0x2f')]['filter']+'%'};return _0x51e02f;}})});}_0x14d85f=_[_0xe508('0x3a')]({},_0x14d85f,_0x28827c[_0xe508('0x3d')]);var _0x4cdc18={'where':_0x14d85f[_0xe508('0x38')]};return db[_0xe508('0x2c')][_0xe508('0x1d')](_0x4cdc18)[_0xe508('0x26')](function(_0x10a83d){_0x576bb4[_0xe508('0x1d')]=_0x10a83d;if(_0x28827c[_0xe508('0x2f')][_0xe508('0x3e')]){_0x14d85f[_0xe508('0x3f')]=[{'all':!![]}];}return db[_0xe508('0x2c')][_0xe508('0x40')](_0x14d85f);})[_0xe508('0x26')](function(_0x5b9f59){_0x576bb4[_0xe508('0x41')]=_0x5b9f59;return _0x576bb4;})['then'](respondWithFilteredResult(_0x230bf1,_0x14d85f))['catch'](handleError(_0x230bf1,null));};exports[_0xe508('0x42')]=function(_0x381e86,_0x6fe473){var _0x4d6763={'raw':!![],'where':{'id':_0x381e86[_0xe508('0x43')]['id']}},_0x3aeeb5={};_0x3aeeb5[_0xe508('0x2e')]=_[_0xe508('0x44')](db['Disposition'][_0xe508('0x45')]);_0x3aeeb5[_0xe508('0x2f')]=_[_0xe508('0x44')](_0x381e86[_0xe508('0x2f')]);_0x3aeeb5[_0xe508('0x30')]=_[_0xe508('0x31')](_0x3aeeb5[_0xe508('0x2e')],_0x3aeeb5['query']);_0x4d6763[_0xe508('0x33')]=_[_0xe508('0x31')](_0x3aeeb5['model'],qs[_0xe508('0x32')](_0x381e86[_0xe508('0x2f')][_0xe508('0x32')]));_0x4d6763[_0xe508('0x33')]=_0x4d6763[_0xe508('0x33')][_0xe508('0x46')]?_0x4d6763[_0xe508('0x33')]:_0x3aeeb5[_0xe508('0x2e')];if(_0x381e86['query']['includeAll']){_0x4d6763[_0xe508('0x3f')]=[{'all':!![]}];}_0x4d6763=_[_0xe508('0x3a')]({},_0x4d6763,_0x381e86[_0xe508('0x3d')]);return db[_0xe508('0x2c')]['find'](_0x4d6763)['then'](handleEntityNotFound(_0x6fe473,null))[_0xe508('0x26')](respondWithResult(_0x6fe473,null))['catch'](handleError(_0x6fe473,null));};exports['create']=function(_0x3221f5,_0x4b3e44){return db[_0xe508('0x2c')][_0xe508('0x47')](_0x3221f5[_0xe508('0x48')],{})['then'](function(_0x2f403f){var _0x34f624=_0x3221f5[_0xe508('0x49')][_0xe508('0x23')]({'plain':!![]});if(!_0x34f624)throw new Error(_0xe508('0x4a'));if(_0x34f624['role']===_0xe508('0x49')){var _0x3e4150=_0x2f403f['get']({'plain':!![]});var _0x228185=_0xe508('0x24');return db[_0xe508('0x4b')]['find']({'where':{'name':_0x228185,'userProfileId':_0x34f624[_0xe508('0x4c')]},'raw':!![]})[_0xe508('0x26')](function(_0x497c2c){if(_0x497c2c&&_0x497c2c[_0xe508('0x4d')]===0x0){return db[_0xe508('0x25')][_0xe508('0x47')]({'name':_0x3e4150[_0xe508('0x28')],'resourceId':_0x3e4150['id'],'type':_0x497c2c[_0xe508('0x28')],'sectionId':_0x497c2c['id']},{})[_0xe508('0x26')](function(){return _0x2f403f;});}else{return _0x2f403f;}})[_0xe508('0x4e')](function(_0x51f466){logger[_0xe508('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51f466);throw _0x51f466;});}return _0x2f403f;})[_0xe508('0x26')](respondWithResult(_0x4b3e44,0xc9))['catch'](handleError(_0x4b3e44,null));};exports['update']=function(_0x2ef283,_0x59a3fa){if(_0x2ef283['body']['id']){delete _0x2ef283[_0xe508('0x48')]['id'];}return db[_0xe508('0x2c')][_0xe508('0x4f')]({'where':{'id':_0x2ef283['params']['id']}})[_0xe508('0x26')](handleEntityNotFound(_0x59a3fa,null))['then'](saveUpdates(_0x2ef283[_0xe508('0x48')],null))[_0xe508('0x26')](respondWithResult(_0x59a3fa,null))[_0xe508('0x4e')](handleError(_0x59a3fa,null));};exports[_0xe508('0x50')]=function(_0x391805,_0x2ed297){return db[_0xe508('0x2c')]['find']({'where':{'id':_0x391805[_0xe508('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ed297,null))[_0xe508('0x26')](removeEntity(_0x2ed297,null))['catch'](handleError(_0x2ed297,null));}; \ No newline at end of file +var _0xf360=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','Dispositions','UserProfileResource','stack','name','send','Disposition','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','get'];(function(_0x2bf284,_0x405951){var _0xd2510f=function(_0x5ccfcf){while(--_0x5ccfcf){_0x2bf284['push'](_0x2bf284['shift']());}};_0xd2510f(++_0x405951);}(_0xf360,0x9e));var _0x0f36=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf360[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x0f36('0x0'));var rimraf=require(_0x0f36('0x1'));var zipdir=require(_0x0f36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f36('0x3'));var moment=require('moment');var BPromise=require(_0x0f36('0x4'));var Mustache=require(_0x0f36('0x5'));var util=require(_0x0f36('0x6'));var path=require('path');var sox=require(_0x0f36('0x7'));var csv=require(_0x0f36('0x8'));var ejs=require(_0x0f36('0x9'));var fs=require('fs');var fs_extra=require(_0x0f36('0xa'));var _=require(_0x0f36('0xb'));var squel=require(_0x0f36('0xc'));var crypto=require(_0x0f36('0xd'));var jsforce=require(_0x0f36('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f36('0x8'));var querystring=require(_0x0f36('0xf'));var Papa=require(_0x0f36('0x10'));var Redis=require(_0x0f36('0x11'));var authService=require(_0x0f36('0x12'));var qs=require(_0x0f36('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f36('0x14'));var logger=require(_0x0f36('0x15'))(_0x0f36('0x16'));var utils=require('../../config/utils');var config=require(_0x0f36('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x478313,_0xea1040){_0xea1040=_0xea1040||0xcc;return function(_0x4e30cc){if(_0x4e30cc){return _0x478313[_0x0f36('0x18')](_0xea1040);}return _0x478313[_0x0f36('0x19')](_0xea1040)[_0x0f36('0x1a')]();};}function respondWithResult(_0xb021c,_0x5dee19){_0x5dee19=_0x5dee19||0xc8;return function(_0x1a06cc){if(_0x1a06cc){return _0xb021c['status'](_0x5dee19)[_0x0f36('0x1b')](_0x1a06cc);}};}function respondWithFilteredResult(_0x19afe8,_0x420baf){return function(_0x38e64a){if(_0x38e64a){var _0x167825=typeof _0x420baf[_0x0f36('0x1c')]===_0x0f36('0x1d')&&typeof _0x420baf['limit']==='undefined';var _0x2f26d2=_0x38e64a[_0x0f36('0x1e')];var _0x4b48eb=_0x167825?0x0:_0x420baf['offset'];var _0x121ff3=_0x167825?_0x38e64a[_0x0f36('0x1e')]:_0x420baf['offset']+_0x420baf[_0x0f36('0x1f')];var _0x28eaf2;if(_0x121ff3>=_0x2f26d2){_0x121ff3=_0x2f26d2;_0x28eaf2=0xc8;}else{_0x28eaf2=0xce;}_0x19afe8['status'](_0x28eaf2);return _0x19afe8[_0x0f36('0x20')]('Content-Range',_0x4b48eb+'-'+_0x121ff3+'/'+_0x2f26d2)['json'](_0x38e64a);}return null;};}function patchUpdates(_0x2f7972){return function(_0x1b365a){try{jsonpatch['apply'](_0x1b365a,_0x2f7972,!![]);}catch(_0x5888c5){return BPromise[_0x0f36('0x21')](_0x5888c5);}return _0x1b365a[_0x0f36('0x22')]();};}function saveUpdates(_0x5c15d9,_0x249b7a){return function(_0x567814){if(_0x567814){return _0x567814[_0x0f36('0x23')](_0x5c15d9)['then'](function(_0x2eb5be){return _0x2eb5be;});}return null;};}function removeEntity(_0x21837e,_0x15722f){return function(_0x552d90){if(_0x552d90){return _0x552d90[_0x0f36('0x24')]()[_0x0f36('0x25')](function(){var _0x1e87c9=_0x552d90['get']({'plain':!![]});var _0x2e7ee5=_0x0f36('0x26');return db[_0x0f36('0x27')][_0x0f36('0x24')]({'where':{'type':_0x2e7ee5,'resourceId':_0x1e87c9['id']}})['then'](function(){return _0x552d90;});})[_0x0f36('0x25')](function(){_0x21837e['status'](0xcc)[_0x0f36('0x1a')]();});}};}function handleEntityNotFound(_0x481492,_0x186527){return function(_0x3b8385){if(!_0x3b8385){_0x481492[_0x0f36('0x18')](0x194);}return _0x3b8385;};}function handleError(_0x40ca49,_0x4ad99d){_0x4ad99d=_0x4ad99d||0x1f4;return function(_0x398dcd){logger['error'](_0x398dcd[_0x0f36('0x28')]);if(_0x398dcd[_0x0f36('0x29')]){delete _0x398dcd[_0x0f36('0x29')];}_0x40ca49[_0x0f36('0x19')](_0x4ad99d)[_0x0f36('0x2a')](_0x398dcd);};}exports['index']=function(_0x15f872,_0x21f4c5){var _0x43974a={},_0x161e11={},_0xbd824c={'count':0x0,'rows':[]};var _0x4b76e7=_['map'](db[_0x0f36('0x2b')][_0x0f36('0x2c')],function(_0x10b43c){return{'name':_0x10b43c[_0x0f36('0x2d')],'type':_0x10b43c[_0x0f36('0x2e')]['key']};});_0x161e11[_0x0f36('0x2f')]=_['map'](_0x4b76e7,_0x0f36('0x29'));_0x161e11['query']=_[_0x0f36('0x30')](_0x15f872['query']);_0x161e11[_0x0f36('0x31')]=_[_0x0f36('0x32')](_0x161e11[_0x0f36('0x2f')],_0x161e11[_0x0f36('0x33')]);_0x43974a[_0x0f36('0x34')]=_[_0x0f36('0x32')](_0x161e11[_0x0f36('0x2f')],qs[_0x0f36('0x35')](_0x15f872[_0x0f36('0x33')][_0x0f36('0x35')]));_0x43974a[_0x0f36('0x34')]=_0x43974a[_0x0f36('0x34')][_0x0f36('0x36')]?_0x43974a[_0x0f36('0x34')]:_0x161e11[_0x0f36('0x2f')];if(!_0x15f872[_0x0f36('0x33')]['hasOwnProperty'](_0x0f36('0x37'))){_0x43974a['limit']=qs[_0x0f36('0x1f')](_0x15f872[_0x0f36('0x33')]['limit']);_0x43974a[_0x0f36('0x1c')]=qs[_0x0f36('0x1c')](_0x15f872['query'][_0x0f36('0x1c')]);}_0x43974a[_0x0f36('0x38')]=qs[_0x0f36('0x39')](_0x15f872['query']['sort']);_0x43974a[_0x0f36('0x3a')]=qs[_0x0f36('0x31')](_[_0x0f36('0x3b')](_0x15f872[_0x0f36('0x33')],_0x161e11[_0x0f36('0x31')]),_0x4b76e7);if(_0x15f872['query'][_0x0f36('0x3c')]){_0x43974a['where']=_['merge'](_0x43974a[_0x0f36('0x3a')],{'$or':_['map'](_0x4b76e7,function(_0x415807){if(_0x415807[_0x0f36('0x2e')]!=='VIRTUAL'){var _0x4d9794={};_0x4d9794[_0x415807['name']]={'$like':'%'+_0x15f872[_0x0f36('0x33')][_0x0f36('0x3c')]+'%'};return _0x4d9794;}})});}_0x43974a=_[_0x0f36('0x3d')]({},_0x43974a,_0x15f872[_0x0f36('0x3e')]);var _0x93299={'where':_0x43974a[_0x0f36('0x3a')]};return db[_0x0f36('0x2b')][_0x0f36('0x1e')](_0x93299)['then'](function(_0x25a8ef){_0xbd824c[_0x0f36('0x1e')]=_0x25a8ef;if(_0x15f872['query'][_0x0f36('0x3f')]){_0x43974a[_0x0f36('0x40')]=[{'all':!![]}];}return db['Disposition'][_0x0f36('0x41')](_0x43974a);})[_0x0f36('0x25')](function(_0xfd3189){_0xbd824c['rows']=_0xfd3189;return _0xbd824c;})[_0x0f36('0x25')](respondWithFilteredResult(_0x21f4c5,_0x43974a))[_0x0f36('0x42')](handleError(_0x21f4c5,null));};exports['show']=function(_0x23e4a2,_0x27d8df){var _0x42014c={'raw':!![],'where':{'id':_0x23e4a2[_0x0f36('0x43')]['id']}},_0x26214c={};_0x26214c['model']=_['keys'](db['Disposition']['rawAttributes']);_0x26214c[_0x0f36('0x33')]=_[_0x0f36('0x30')](_0x23e4a2['query']);_0x26214c[_0x0f36('0x31')]=_[_0x0f36('0x32')](_0x26214c[_0x0f36('0x2f')],_0x26214c['query']);_0x42014c['attributes']=_[_0x0f36('0x32')](_0x26214c[_0x0f36('0x2f')],qs['fields'](_0x23e4a2[_0x0f36('0x33')]['fields']));_0x42014c[_0x0f36('0x34')]=_0x42014c[_0x0f36('0x34')][_0x0f36('0x36')]?_0x42014c['attributes']:_0x26214c['model'];if(_0x23e4a2[_0x0f36('0x33')][_0x0f36('0x3f')]){_0x42014c[_0x0f36('0x40')]=[{'all':!![]}];}_0x42014c=_['merge']({},_0x42014c,_0x23e4a2['options']);return db[_0x0f36('0x2b')][_0x0f36('0x44')](_0x42014c)[_0x0f36('0x25')](handleEntityNotFound(_0x27d8df,null))[_0x0f36('0x25')](respondWithResult(_0x27d8df,null))['catch'](handleError(_0x27d8df,null));};exports[_0x0f36('0x45')]=function(_0x8afde7,_0x11e8e1){return db[_0x0f36('0x2b')][_0x0f36('0x45')](_0x8afde7[_0x0f36('0x46')],{})[_0x0f36('0x25')](function(_0x51099e){var _0x43d75f=_0x8afde7[_0x0f36('0x47')][_0x0f36('0x48')]({'plain':!![]});if(!_0x43d75f)throw new Error(_0x0f36('0x49'));if(_0x43d75f[_0x0f36('0x4a')]===_0x0f36('0x47')){var _0x1188f2=_0x51099e[_0x0f36('0x48')]({'plain':!![]});var _0x51ce28=_0x0f36('0x26');return db['UserProfileSection'][_0x0f36('0x44')]({'where':{'name':_0x51ce28,'userProfileId':_0x43d75f[_0x0f36('0x4b')]},'raw':!![]})[_0x0f36('0x25')](function(_0xcc6d7f){if(_0xcc6d7f&&_0xcc6d7f[_0x0f36('0x4c')]===0x0){return db[_0x0f36('0x27')]['create']({'name':_0x1188f2[_0x0f36('0x29')],'resourceId':_0x1188f2['id'],'type':_0xcc6d7f['name'],'sectionId':_0xcc6d7f['id']},{})['then'](function(){return _0x51099e;});}else{return _0x51099e;}})['catch'](function(_0x270104){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x270104);throw _0x270104;});}return _0x51099e;})[_0x0f36('0x25')](respondWithResult(_0x11e8e1,0xc9))[_0x0f36('0x42')](handleError(_0x11e8e1,null));};exports[_0x0f36('0x23')]=function(_0x2a5217,_0x2e2eb7){if(_0x2a5217[_0x0f36('0x46')]['id']){delete _0x2a5217['body']['id'];}return db['Disposition']['find']({'where':{'id':_0x2a5217[_0x0f36('0x43')]['id']}})[_0x0f36('0x25')](handleEntityNotFound(_0x2e2eb7,null))[_0x0f36('0x25')](saveUpdates(_0x2a5217[_0x0f36('0x46')],null))[_0x0f36('0x25')](respondWithResult(_0x2e2eb7,null))[_0x0f36('0x42')](handleError(_0x2e2eb7,null));};exports[_0x0f36('0x24')]=function(_0x3ab5ee,_0x3514df){return db['Disposition'][_0x0f36('0x44')]({'where':{'id':_0x3ab5ee[_0x0f36('0x43')]['id']}})['then'](handleEntityNotFound(_0x3514df,null))[_0x0f36('0x25')](removeEntity(_0x3514df,null))[_0x0f36('0x42')](handleError(_0x3514df,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 507d647..7d52916 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 _0x3b78=['bluebird','request-promise','path','rimraf','../../config/environment','exports','Disposition','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','moment'];(function(_0x1ab29e,_0x2058bd){var _0x401ea7=function(_0x361cca){while(--_0x361cca){_0x1ab29e['push'](_0x1ab29e['shift']());}};_0x401ea7(++_0x2058bd);}(_0x3b78,0x6f));var _0x83b7=function(_0x44d9e8,_0x2f0bc2){_0x44d9e8=_0x44d9e8-0x0;var _0x64816e=_0x3b78[_0x44d9e8];return _0x64816e;};'use strict';var _=require('lodash');var util=require(_0x83b7('0x0'));var logger=require(_0x83b7('0x1'))(_0x83b7('0x2'));var moment=require(_0x83b7('0x3'));var BPromise=require(_0x83b7('0x4'));var rp=require(_0x83b7('0x5'));var fs=require('fs');var path=require(_0x83b7('0x6'));var rimraf=require(_0x83b7('0x7'));var config=require(_0x83b7('0x8'));var attributes=require('./disposition.attributes');module[_0x83b7('0x9')]=function(_0x24ca49,_0x39987c){return _0x24ca49['define'](_0x83b7('0xa'),attributes,{'tableName':_0x83b7('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x83b7('0xc')]},{'unique':!![],'name':_0x83b7('0xd'),'fields':[_0x83b7('0xe'),_0x83b7('0xf')]},{'unique':!![],'name':_0x83b7('0x10'),'fields':['name',_0x83b7('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x83b7('0xe'),'SmsAccountId']},{'unique':!![],'name':_0x83b7('0x12'),'fields':[_0x83b7('0xe'),_0x83b7('0x13')]},{'unique':!![],'name':_0x83b7('0x14'),'fields':[_0x83b7('0xe'),_0x83b7('0x15')]},{'unique':!![],'name':_0x83b7('0x16'),'fields':[_0x83b7('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ea7=['api','moment','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x1841fd,_0x5482d9){var _0x45c4f6=function(_0x3e78ea){while(--_0x3e78ea){_0x1841fd['push'](_0x1841fd['shift']());}};_0x45c4f6(++_0x5482d9);}(_0x7ea7,0x162));var _0x77ea=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x7ea7[_0x540dcb];return _0x49353c;};'use strict';var _=require(_0x77ea('0x0'));var util=require(_0x77ea('0x1'));var logger=require(_0x77ea('0x2'))(_0x77ea('0x3'));var moment=require(_0x77ea('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x77ea('0x5'));var rimraf=require(_0x77ea('0x6'));var config=require(_0x77ea('0x7'));var attributes=require(_0x77ea('0x8'));module['exports']=function(_0x429dd8,_0x73b838){return _0x429dd8[_0x77ea('0x9')](_0x77ea('0xa'),attributes,{'tableName':_0x77ea('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x77ea('0xc'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x77ea('0xc'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x77ea('0xc'),_0x77ea('0xd')]},{'unique':!![],'name':_0x77ea('0xe'),'fields':[_0x77ea('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x77ea('0xf'),'fields':[_0x77ea('0xc'),_0x77ea('0x10')]},{'unique':!![],'name':_0x77ea('0x11'),'fields':['name',_0x77ea('0x12')]},{'unique':!![],'name':_0x77ea('0x13'),'fields':['name',_0x77ea('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 9187b1e..a189ddf 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(_0xbda737,_0x4f0b89){var _0x101742=function(_0x501994){while(--_0x501994){_0xbda737['push'](_0xbda737['shift']());}};_0x101742(++_0x4f0b89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x1c7ed6,_0x32ea1){var _0xb9d46a=function(_0x4bc8e4){while(--_0x4bc8e4){_0x1c7ed6['push'](_0x1c7ed6['shift']());}};_0xb9d46a(++_0x32ea1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 499aa97..3b66cde 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 _0xfc94=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','index','isAuthenticated','show','create','put','/:id'];(function(_0x6191e6,_0x596f47){var _0x3b2ec3=function(_0x5b19f0){while(--_0x5b19f0){_0x6191e6['push'](_0x6191e6['shift']());}};_0x3b2ec3(++_0x596f47);}(_0xfc94,0x16d));var _0x4fc9=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xfc94[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0x4fc9('0x0'));var util=require('util');var path=require(_0x4fc9('0x1'));var timeout=require(_0x4fc9('0x2'));var express=require('express');var router=express[_0x4fc9('0x3')]();var fs_extra=require(_0x4fc9('0x4'));var auth=require(_0x4fc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4fc9('0x6'));var controller=require(_0x4fc9('0x7'));router[_0x4fc9('0x8')]('/',auth['isAuthenticated'](),controller[_0x4fc9('0x9')]);router[_0x4fc9('0x8')]('/:id',auth[_0x4fc9('0xa')](),controller[_0x4fc9('0xb')]);router['post']('/',auth[_0x4fc9('0xa')](),controller[_0x4fc9('0xc')]);router[_0x4fc9('0xd')](_0x4fc9('0xe'),auth[_0x4fc9('0xa')](),controller[_0x4fc9('0xf')]);router[_0x4fc9('0x10')](_0x4fc9('0xe'),auth[_0x4fc9('0xa')](),controller[_0x4fc9('0x11')]);module[_0x4fc9('0x12')]=router; \ No newline at end of file +var _0x93c4=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x587393,_0x4d1a14){var _0x350c99=function(_0x1fcd99){while(--_0x1fcd99){_0x587393['push'](_0x587393['shift']());}};_0x350c99(++_0x4d1a14);}(_0x93c4,0x179));var _0x493c=function(_0xdb9a19,_0x205fcd){_0xdb9a19=_0xdb9a19-0x0;var _0x10937=_0x93c4[_0xdb9a19];return _0x10937;};'use strict';var multer=require(_0x493c('0x0'));var util=require(_0x493c('0x1'));var path=require(_0x493c('0x2'));var timeout=require(_0x493c('0x3'));var express=require(_0x493c('0x4'));var router=express[_0x493c('0x5')]();var fs_extra=require(_0x493c('0x6'));var auth=require(_0x493c('0x7'));var interaction=require(_0x493c('0x8'));var config=require(_0x493c('0x9'));var controller=require(_0x493c('0xa'));router['get']('/',auth[_0x493c('0xb')](),controller[_0x493c('0xc')]);router[_0x493c('0xd')](_0x493c('0xe'),auth[_0x493c('0xb')](),controller[_0x493c('0xf')]);router[_0x493c('0x10')]('/',auth[_0x493c('0xb')](),controller[_0x493c('0x11')]);router[_0x493c('0x12')](_0x493c('0xe'),auth[_0x493c('0xb')](),controller[_0x493c('0x13')]);router['delete']('/:id',auth[_0x493c('0xb')](),controller[_0x493c('0x14')]);module[_0x493c('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9133d08..bd3f8f8 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 _0x9800=['4800','12000','14400','9600','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400'];(function(_0x52ff2e,_0x2d4566){var _0x33ab3a=function(_0x3c5834){while(--_0x3c5834){_0x52ff2e['push'](_0x52ff2e['shift']());}};_0x33ab3a(++_0x2d4566);}(_0x9800,0xf6));var _0x0980=function(_0x44b491,_0x3311c5){_0x44b491=_0x44b491-0x0;var _0x39e935=_0x9800[_0x44b491];return _0x39e935;};'use strict';var Sequelize=require(_0x0980('0x0'));module[_0x0980('0x1')]={'name':{'type':Sequelize[_0x0980('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0980('0x2')]},'ecm':{'type':Sequelize[_0x0980('0x3')](_0x0980('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x0980('0x2')],'defaultValue':_0x0980('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x0980('0x3')](_0x0980('0x6'),_0x0980('0x7'),'7200','9600',_0x0980('0x8'),_0x0980('0x9')),'defaultValue':_0x0980('0x7')},'maxrate':{'type':Sequelize[_0x0980('0x3')](_0x0980('0x6'),_0x0980('0x7'),'7200',_0x0980('0xa'),_0x0980('0x8'),_0x0980('0x9')),'defaultValue':_0x0980('0x9')},'modem':{'type':Sequelize[_0x0980('0x2')],'defaultValue':_0x0980('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0980('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0980('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0980('0x3')](_0x0980('0xd'),_0x0980('0xe'),_0x0980('0xf'),'KHOMP'),'defaultValue':_0x0980('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0980('0x10')],'defaultValue':function(){return _0x0980('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0980('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0980('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0980('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0980('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0980('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0980('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x0980('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x0980('0x12')],'defaultValue':![],'comment':_0x0980('0x14'),'set':function(_0x4f2a3b){if(!_0x4f2a3b)this[_0x0980('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x0980('0x16'),_0x4f2a3b);}}}; \ No newline at end of file +var _0xca26=['SIP','IAX','DADHI','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','exports','STRING','yes','localstationid','ENUM','4800','7200','9600','12000','14400','2400','v17,v27,v29'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0xca26,0x1bf));var _0x6ca2=function(_0x31ebeb,_0x280752){_0x31ebeb=_0x31ebeb-0x0;var _0x300c75=_0xca26[_0x31ebeb];return _0x300c75;};'use strict';var Sequelize=require(_0x6ca2('0x0'));module[_0x6ca2('0x1')]={'name':{'type':Sequelize[_0x6ca2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6ca2('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x6ca2('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x6ca2('0x2')],'unique':_0x6ca2('0x4')},'minrate':{'type':Sequelize[_0x6ca2('0x5')]('2400',_0x6ca2('0x6'),_0x6ca2('0x7'),_0x6ca2('0x8'),_0x6ca2('0x9'),_0x6ca2('0xa')),'defaultValue':_0x6ca2('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0x6ca2('0xb'),_0x6ca2('0x6'),'7200','9600',_0x6ca2('0x9'),_0x6ca2('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x6ca2('0xc')},'gateway':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6ca2('0x5')](_0x6ca2('0xd'),_0x6ca2('0xe'),_0x6ca2('0xf'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x6ca2('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6ca2('0x10')],'defaultValue':function(){return _0x6ca2('0x11');}},'notificationSound':{'type':Sequelize[_0x6ca2('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6ca2('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ca2('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6ca2('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ca2('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6ca2('0x12')],'defaultValue':![],'comment':_0x6ca2('0x14'),'set':function(_0xa32cb1){if(!_0xa32cb1)this[_0x6ca2('0x15')](_0x6ca2('0x16'),null);this[_0x6ca2('0x15')]('mandatoryDisposition',_0xa32cb1);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 30c439b..e99da7e 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 _0xb5c7=['Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','system','description','appdata','push','Answer','CDR(type)=inbound-fax','ecm','localstationid','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','Contact\x20not\x20found','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','spread','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','http','client','request','info','debug','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','get','FaxAccounts','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','include','show','params','rawAttributes','includeAll','options','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','nolimit','order','CannedAnswer','rows','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','User','internal','Tags','color','tag','addApplications','sequelize','transaction'];(function(_0x16d73f,_0x58b0dd){var _0x36abdf=function(_0x5372fb){while(--_0x5372fb){_0x16d73f['push'](_0x16d73f['shift']());}};_0x36abdf(++_0x58b0dd);}(_0xb5c7,0x103));var _0x7b5c=function(_0x39b4f9,_0x17460b){_0x39b4f9=_0x39b4f9-0x0;var _0x5e9c86=_0xb5c7[_0x39b4f9];return _0x5e9c86;};'use strict';var emlformat=require(_0x7b5c('0x0'));var rimraf=require(_0x7b5c('0x1'));var zipdir=require(_0x7b5c('0x2'));var jsonpatch=require(_0x7b5c('0x3'));var rp=require(_0x7b5c('0x4'));var moment=require(_0x7b5c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b5c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7b5c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b5c('0x8'));var _=require('lodash');var squel=require(_0x7b5c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b5c('0xa'));var toCsv=require(_0x7b5c('0x7'));var querystring=require(_0x7b5c('0xb'));var Papa=require(_0x7b5c('0xc'));var Redis=require(_0x7b5c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7b5c('0xe'));var as=require(_0x7b5c('0xf'));var hardwareService=require(_0x7b5c('0x10'));var logger=require(_0x7b5c('0x11'))(_0x7b5c('0x12'));var utils=require(_0x7b5c('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7b5c('0x14'))['db'];config[_0x7b5c('0x15')]=_['defaults'](config[_0x7b5c('0x15')],{'host':_0x7b5c('0x16'),'port':0x18eb});var socket=require(_0x7b5c('0x17'))(new Redis(config[_0x7b5c('0x15')]));require(_0x7b5c('0x18'))[_0x7b5c('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7b5c('0x1a')]({'port':0x232c});var client9002=jayson[_0x7b5c('0x1b')][_0x7b5c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x57f584,_0x431636,_0xb59c4f,_0x1e6e72){return new BPromise(function(_0x9c3f13,_0x45dfab){var _0xdb785c=_0x1e6e72||client;return _0xdb785c[_0x7b5c('0x1c')](_0x57f584,_0xb59c4f)['then'](function(_0x287fae){logger[_0x7b5c('0x1d')]('FaxAccount,\x20%s,\x20%s',_0x431636,'request\x20sent');logger[_0x7b5c('0x1e')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x431636,_0x7b5c('0x1f'),JSON[_0x7b5c('0x20')](_0x287fae));if(_0x287fae[_0x7b5c('0x21')]){if(_0x287fae['error'][_0x7b5c('0x22')]===0x1f4){logger[_0x7b5c('0x21')](_0x7b5c('0x23'),_0x431636,_0x287fae[_0x7b5c('0x21')]['message']);return _0x45dfab(_0x287fae['error'][_0x7b5c('0x24')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x431636,_0x287fae[_0x7b5c('0x21')][_0x7b5c('0x24')]);return _0x9c3f13(_0x287fae[_0x7b5c('0x21')][_0x7b5c('0x24')]);}else{logger[_0x7b5c('0x1d')](_0x7b5c('0x23'),_0x431636,_0x7b5c('0x1f'));_0x9c3f13(_0x287fae[_0x7b5c('0x25')][_0x7b5c('0x24')]);}})[_0x7b5c('0x26')](function(_0x5d1131){logger[_0x7b5c('0x21')](_0x7b5c('0x23'),_0x431636,_0x5d1131);_0x45dfab(_0x5d1131);});});}function respondWithStatusCode(_0x4db1a6,_0xdea3b1){_0xdea3b1=_0xdea3b1||0xcc;return function(_0x150bc0){if(_0x150bc0){return _0x4db1a6[_0x7b5c('0x27')](_0xdea3b1);}return _0x4db1a6['status'](_0xdea3b1)['end']();};}function respondWithResult(_0x447eb1,_0x2e1dc3){_0x2e1dc3=_0x2e1dc3||0xc8;return function(_0x43d7f3){if(_0x43d7f3){return _0x447eb1[_0x7b5c('0x28')](_0x2e1dc3)[_0x7b5c('0x29')](_0x43d7f3);}};}function respondWithFilteredResult(_0xcfdafa,_0x2c228e){return function(_0x579315){if(_0x579315){var _0x528a08=typeof _0x2c228e['offset']===_0x7b5c('0x2a')&&typeof _0x2c228e[_0x7b5c('0x2b')]===_0x7b5c('0x2a');var _0x3b007f=_0x579315[_0x7b5c('0x2c')];var _0x288f06=_0x528a08?0x0:_0x2c228e[_0x7b5c('0x2d')];var _0x5f0391=_0x528a08?_0x579315[_0x7b5c('0x2c')]:_0x2c228e['offset']+_0x2c228e[_0x7b5c('0x2b')];var _0x2503c5;if(_0x5f0391>=_0x3b007f){_0x5f0391=_0x3b007f;_0x2503c5=0xc8;}else{_0x2503c5=0xce;}_0xcfdafa[_0x7b5c('0x28')](_0x2503c5);return _0xcfdafa['set'](_0x7b5c('0x2e'),_0x288f06+'-'+_0x5f0391+'/'+_0x3b007f)[_0x7b5c('0x29')](_0x579315);}return null;};}function patchUpdates(_0x43b47e){return function(_0xfb8804){try{jsonpatch[_0x7b5c('0x2f')](_0xfb8804,_0x43b47e,!![]);}catch(_0x27481d){return BPromise[_0x7b5c('0x30')](_0x27481d);}return _0xfb8804['save']();};}function saveUpdates(_0x22ad7a,_0x30b3b6){return function(_0x1485b1){if(_0x1485b1){return _0x1485b1[_0x7b5c('0x31')](_0x22ad7a)[_0x7b5c('0x32')](function(_0x5812d5){return _0x5812d5;});}return null;};}function removeEntity(_0xfc1bd1,_0x21ce6d){return function(_0x2a4768){if(_0x2a4768){return _0x2a4768['destroy']()[_0x7b5c('0x32')](function(){var _0x1a673e=_0x2a4768[_0x7b5c('0x33')]({'plain':!![]});var _0x4a1d6b=_0x7b5c('0x34');return db['UserProfileResource'][_0x7b5c('0x35')]({'where':{'type':_0x4a1d6b,'resourceId':_0x1a673e['id']}})[_0x7b5c('0x32')](function(){return _0x2a4768;});})[_0x7b5c('0x32')](function(){_0xfc1bd1[_0x7b5c('0x28')](0xcc)[_0x7b5c('0x36')]();});}};}function handleEntityNotFound(_0x244b93,_0x5bd3a5){return function(_0x18b359){if(!_0x18b359){_0x244b93[_0x7b5c('0x27')](0x194);}return _0x18b359;};}function handleError(_0x5ebadf,_0x4f30ba){_0x4f30ba=_0x4f30ba||0x1f4;return function(_0x338c50){logger['error'](_0x338c50[_0x7b5c('0x37')]);if(_0x338c50[_0x7b5c('0x38')]){delete _0x338c50['name'];}_0x5ebadf[_0x7b5c('0x28')](_0x4f30ba)[_0x7b5c('0x39')](_0x338c50);};}exports[_0x7b5c('0x3a')]=function(_0x4d036d,_0x685a19){var _0x2d76b0={'include':[{'model':db[_0x7b5c('0x3b')],'as':_0x7b5c('0x3c')}]},_0x1e48a1={},_0x55ef2f={'count':0x0,'rows':[]};var _0x251e3b=_['map'](db[_0x7b5c('0x3d')]['rawAttributes'],function(_0x3d7487){return{'name':_0x3d7487[_0x7b5c('0x3e')],'type':_0x3d7487[_0x7b5c('0x3f')][_0x7b5c('0x40')]};});_0x1e48a1[_0x7b5c('0x41')]=_[_0x7b5c('0x42')](_0x251e3b,_0x7b5c('0x38'));_0x1e48a1[_0x7b5c('0x43')]=_[_0x7b5c('0x44')](_0x4d036d['query']);_0x1e48a1[_0x7b5c('0x45')]=_['intersection'](_0x1e48a1[_0x7b5c('0x41')],_0x1e48a1[_0x7b5c('0x43')]);_0x2d76b0['attributes']=_[_0x7b5c('0x46')](_0x1e48a1[_0x7b5c('0x41')],qs[_0x7b5c('0x47')](_0x4d036d[_0x7b5c('0x43')][_0x7b5c('0x47')]));_0x2d76b0[_0x7b5c('0x48')]=_0x2d76b0['attributes'][_0x7b5c('0x49')]?_0x2d76b0[_0x7b5c('0x48')]:_0x1e48a1['model'];if(!_0x4d036d[_0x7b5c('0x43')][_0x7b5c('0x4a')]('nolimit')){_0x2d76b0['limit']=qs[_0x7b5c('0x2b')](_0x4d036d[_0x7b5c('0x43')][_0x7b5c('0x2b')]);_0x2d76b0['offset']=qs[_0x7b5c('0x2d')](_0x4d036d['query']['offset']);}_0x2d76b0['order']=qs[_0x7b5c('0x4b')](_0x4d036d[_0x7b5c('0x43')][_0x7b5c('0x4b')]);_0x2d76b0['where']=qs[_0x7b5c('0x45')](_[_0x7b5c('0x4c')](_0x4d036d[_0x7b5c('0x43')],_0x1e48a1['filters']),_0x251e3b);if(_0x4d036d[_0x7b5c('0x43')][_0x7b5c('0x4d')]){_0x2d76b0[_0x7b5c('0x4e')]=_['merge'](_0x2d76b0[_0x7b5c('0x4e')],{'$or':_['map'](_0x251e3b,function(_0x289520){if(_0x289520[_0x7b5c('0x3f')]!==_0x7b5c('0x4f')){var _0x49d869={};_0x49d869[_0x289520[_0x7b5c('0x38')]]={'$like':'%'+_0x4d036d[_0x7b5c('0x43')]['filter']+'%'};return _0x49d869;}})});}_0x2d76b0=_[_0x7b5c('0x50')]({},_0x2d76b0,_0x4d036d['options']);var _0x237a15={'where':_0x2d76b0[_0x7b5c('0x4e')]};return db[_0x7b5c('0x3d')][_0x7b5c('0x2c')](_0x237a15)[_0x7b5c('0x32')](function(_0x13bfce){_0x55ef2f[_0x7b5c('0x2c')]=_0x13bfce;if(_0x4d036d[_0x7b5c('0x43')]['includeAll']){_0x2d76b0[_0x7b5c('0x51')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x2d76b0);})['then'](function(_0xe62e0a){_0x55ef2f['rows']=_0xe62e0a;return _0x55ef2f;})[_0x7b5c('0x32')](respondWithFilteredResult(_0x685a19,_0x2d76b0))['catch'](handleError(_0x685a19,null));};exports[_0x7b5c('0x52')]=function(_0x5a0896,_0x476651){var _0x48f6a2={'raw':![],'where':{'id':_0x5a0896[_0x7b5c('0x53')]['id']},'include':[{'model':db[_0x7b5c('0x3b')],'as':_0x7b5c('0x3c')}]},_0x54153d={};_0x54153d[_0x7b5c('0x41')]=_[_0x7b5c('0x44')](db[_0x7b5c('0x3d')][_0x7b5c('0x54')]);_0x54153d[_0x7b5c('0x43')]=_[_0x7b5c('0x44')](_0x5a0896[_0x7b5c('0x43')]);_0x54153d[_0x7b5c('0x45')]=_[_0x7b5c('0x46')](_0x54153d['model'],_0x54153d['query']);_0x48f6a2['attributes']=_[_0x7b5c('0x46')](_0x54153d[_0x7b5c('0x41')],qs[_0x7b5c('0x47')](_0x5a0896[_0x7b5c('0x43')]['fields']));_0x48f6a2[_0x7b5c('0x48')]=_0x48f6a2['attributes'][_0x7b5c('0x49')]?_0x48f6a2[_0x7b5c('0x48')]:_0x54153d[_0x7b5c('0x41')];if(_0x5a0896[_0x7b5c('0x43')][_0x7b5c('0x55')]){_0x48f6a2[_0x7b5c('0x51')]=[{'all':!![]}];}_0x48f6a2=_[_0x7b5c('0x50')]({},_0x48f6a2,_0x5a0896[_0x7b5c('0x56')]);return db['FaxAccount']['find'](_0x48f6a2)[_0x7b5c('0x32')](handleEntityNotFound(_0x476651,null))['then'](respondWithResult(_0x476651,null))[_0x7b5c('0x26')](handleError(_0x476651,null));};exports['create']=function(_0x4a912f,_0x40b60e){return db[_0x7b5c('0x3d')]['create'](_0x4a912f[_0x7b5c('0x57')],{})['then'](function(_0x5e117){var _0x27583f=_0x4a912f[_0x7b5c('0x58')]['get']({'plain':!![]});if(!_0x27583f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27583f[_0x7b5c('0x59')]==='user'){var _0x1dedae=_0x5e117[_0x7b5c('0x33')]({'plain':!![]});var _0x49ad70=_0x7b5c('0x34');return db[_0x7b5c('0x5a')][_0x7b5c('0x5b')]({'where':{'name':_0x49ad70,'userProfileId':_0x27583f['userProfileId']},'raw':!![]})[_0x7b5c('0x32')](function(_0x28d586){if(_0x28d586&&_0x28d586[_0x7b5c('0x5c')]===0x0){return db[_0x7b5c('0x5d')][_0x7b5c('0x5e')]({'name':_0x1dedae[_0x7b5c('0x38')],'resourceId':_0x1dedae['id'],'type':_0x28d586[_0x7b5c('0x38')],'sectionId':_0x28d586['id']},{})[_0x7b5c('0x32')](function(){return _0x5e117;});}else{return _0x5e117;}})[_0x7b5c('0x26')](function(_0x53ccc1){logger[_0x7b5c('0x21')](_0x7b5c('0x5f'),_0x53ccc1);throw _0x53ccc1;});}return _0x5e117;})['then'](respondWithResult(_0x40b60e,0xc9))[_0x7b5c('0x26')](handleError(_0x40b60e,null));};exports[_0x7b5c('0x31')]=function(_0x9a5e73,_0x560171){if(_0x9a5e73[_0x7b5c('0x57')]['id']){delete _0x9a5e73['body']['id'];}return db[_0x7b5c('0x3d')][_0x7b5c('0x5b')]({'where':{'id':_0x9a5e73[_0x7b5c('0x53')]['id']},'include':[{'model':db[_0x7b5c('0x3b')],'as':_0x7b5c('0x3c')}]})[_0x7b5c('0x32')](handleEntityNotFound(_0x560171,null))['then'](saveUpdates(_0x9a5e73[_0x7b5c('0x57')],null))[_0x7b5c('0x32')](respondWithResult(_0x560171,null))[_0x7b5c('0x26')](handleError(_0x560171,null));};exports['destroy']=function(_0x12b764,_0x50b706){return db[_0x7b5c('0x3d')][_0x7b5c('0x5b')]({'where':{'id':_0x12b764[_0x7b5c('0x53')]['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x50b706,null))[_0x7b5c('0x32')](removeEntity(_0x50b706,null))[_0x7b5c('0x26')](handleError(_0x50b706,null));};exports[_0x7b5c('0x60')]=function(_0x34361d,_0x2cc7a5){return db[_0x7b5c('0x3d')][_0x7b5c('0x60')]()[_0x7b5c('0x32')](respondWithResult(_0x2cc7a5,null))[_0x7b5c('0x26')](handleError(_0x2cc7a5,null));};exports[_0x7b5c('0x61')]=function(_0x1c8d83,_0x3e23e0,_0xe26eca){if(_0x1c8d83[_0x7b5c('0x57')]['id']){delete _0x1c8d83[_0x7b5c('0x57')]['id'];}return db[_0x7b5c('0x3d')]['find']({'where':{'id':_0x1c8d83['params']['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x3e23e0,null))[_0x7b5c('0x32')](function(_0x2d4b30){if(_0x2d4b30){_0x1c8d83[_0x7b5c('0x57')][_0x7b5c('0x62')]=_0x2d4b30['id'];return db[_0x7b5c('0x63')][_0x7b5c('0x5e')](_0x1c8d83['body']);}})[_0x7b5c('0x32')](respondWithResult(_0x3e23e0,null))[_0x7b5c('0x26')](handleError(_0x3e23e0,null));};exports[_0x7b5c('0x64')]=function(_0x17dc4e,_0x2b93be,_0xc5b35e){var _0x3050dd={'raw':![],'where':{}};var _0x10e332={};var _0x3c51f4={'count':0x0,'rows':[]};return db[_0x7b5c('0x3d')]['findOne']({'where':{'id':_0x17dc4e[_0x7b5c('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b93be,null))[_0x7b5c('0x32')](function(_0x51acd4){if(_0x51acd4){_0x10e332['model']=_[_0x7b5c('0x44')](db[_0x7b5c('0x63')][_0x7b5c('0x54')]);_0x10e332[_0x7b5c('0x43')]=_[_0x7b5c('0x44')](_0x17dc4e[_0x7b5c('0x43')]);_0x10e332['filters']=_[_0x7b5c('0x46')](_0x10e332[_0x7b5c('0x41')],_0x10e332[_0x7b5c('0x43')]);_0x3050dd['attributes']=_[_0x7b5c('0x46')](_0x10e332[_0x7b5c('0x41')],qs['fields'](_0x17dc4e[_0x7b5c('0x43')]['fields']));_0x3050dd[_0x7b5c('0x48')]=_0x3050dd[_0x7b5c('0x48')][_0x7b5c('0x49')]?_0x3050dd['attributes']:_0x10e332[_0x7b5c('0x41')];if(!_0x17dc4e['query'][_0x7b5c('0x4a')]('nolimit')){_0x3050dd[_0x7b5c('0x2b')]=qs[_0x7b5c('0x2b')](_0x17dc4e[_0x7b5c('0x43')][_0x7b5c('0x2b')]);_0x3050dd[_0x7b5c('0x2d')]=qs[_0x7b5c('0x2d')](_0x17dc4e[_0x7b5c('0x43')][_0x7b5c('0x2d')]);}_0x3050dd['order']=qs[_0x7b5c('0x4b')](_0x17dc4e[_0x7b5c('0x43')]['sort']);_0x3050dd[_0x7b5c('0x4e')]=qs[_0x7b5c('0x45')](_[_0x7b5c('0x4c')](_0x17dc4e['query'],_0x10e332[_0x7b5c('0x45')]));_0x3050dd['where'][_0x7b5c('0x62')]=_0x51acd4['id'];if(_0x17dc4e['query'][_0x7b5c('0x4d')]){_0x3050dd[_0x7b5c('0x4e')]=_[_0x7b5c('0x50')](_0x3050dd[_0x7b5c('0x4e')],{'$or':_['map'](_0x3050dd['attributes'],function(_0x71d618){var _0x1c0015={};_0x1c0015[_0x71d618]={'$like':'%'+_0x17dc4e[_0x7b5c('0x43')][_0x7b5c('0x4d')]+'%'};return _0x1c0015;})});}_0x3050dd=_['merge']({},_0x3050dd,_0x17dc4e['options']);return db[_0x7b5c('0x63')]['count']({'where':_0x3050dd[_0x7b5c('0x4e')]})[_0x7b5c('0x32')](function(_0x4df288){_0x3c51f4[_0x7b5c('0x2c')]=_0x4df288;if(_0x17dc4e['query']['includeAll']){_0x3050dd[_0x7b5c('0x51')]=[{'all':!![]}];}return db[_0x7b5c('0x63')][_0x7b5c('0x65')](_0x3050dd);})[_0x7b5c('0x32')](function(_0x5eb6e3){_0x3c51f4['rows']=_0x5eb6e3;return _0x3c51f4;});}})[_0x7b5c('0x32')](respondWithFilteredResult(_0x2b93be,_0x3050dd))[_0x7b5c('0x26')](handleError(_0x2b93be,null));};exports[_0x7b5c('0x66')]=function(_0x44cc85,_0x2810f5,_0x5c8470){return db[_0x7b5c('0x3d')][_0x7b5c('0x5b')]({'where':{'id':_0x44cc85[_0x7b5c('0x53')]['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x2810f5,null))[_0x7b5c('0x32')](function(_0x300251){if(_0x300251){return _0x300251[_0x7b5c('0x66')](_0x44cc85[_0x7b5c('0x43')][_0x7b5c('0x67')]);}})[_0x7b5c('0x32')](respondWithStatusCode(_0x2810f5,null))[_0x7b5c('0x26')](handleError(_0x2810f5,null));};exports[_0x7b5c('0x68')]=function(_0x2261b4,_0xb7c8ea,_0xbb7e50){if(_0x2261b4[_0x7b5c('0x57')]['id']){delete _0x2261b4[_0x7b5c('0x57')]['id'];}return db[_0x7b5c('0x3d')][_0x7b5c('0x5b')]({'where':{'id':_0x2261b4[_0x7b5c('0x53')]['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0xb7c8ea,null))[_0x7b5c('0x32')](function(_0x3b470f){if(_0x3b470f){_0x2261b4['body']['FaxAccountId']=_0x3b470f['id'];return db['CannedAnswer'][_0x7b5c('0x5e')](_0x2261b4[_0x7b5c('0x57')]);}})[_0x7b5c('0x32')](respondWithResult(_0xb7c8ea,null))[_0x7b5c('0x26')](handleError(_0xb7c8ea,null));};exports[_0x7b5c('0x69')]=function(_0x3ba037,_0x13df50,_0x248571){var _0x3641b0={'raw':![],'where':{}};var _0x2adf7c={};var _0x3959d8={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7b5c('0x6a')]({'where':{'id':_0x3ba037['params']['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x13df50,null))[_0x7b5c('0x32')](function(_0x3af6b3){if(_0x3af6b3){_0x2adf7c['model']=_[_0x7b5c('0x44')](db['CannedAnswer'][_0x7b5c('0x54')]);_0x2adf7c[_0x7b5c('0x43')]=_[_0x7b5c('0x44')](_0x3ba037[_0x7b5c('0x43')]);_0x2adf7c[_0x7b5c('0x45')]=_['intersection'](_0x2adf7c[_0x7b5c('0x41')],_0x2adf7c[_0x7b5c('0x43')]);_0x3641b0['attributes']=_[_0x7b5c('0x46')](_0x2adf7c[_0x7b5c('0x41')],qs[_0x7b5c('0x47')](_0x3ba037[_0x7b5c('0x43')][_0x7b5c('0x47')]));_0x3641b0[_0x7b5c('0x48')]=_0x3641b0[_0x7b5c('0x48')][_0x7b5c('0x49')]?_0x3641b0[_0x7b5c('0x48')]:_0x2adf7c[_0x7b5c('0x41')];if(!_0x3ba037[_0x7b5c('0x43')]['hasOwnProperty'](_0x7b5c('0x6b'))){_0x3641b0[_0x7b5c('0x2b')]=qs[_0x7b5c('0x2b')](_0x3ba037[_0x7b5c('0x43')][_0x7b5c('0x2b')]);_0x3641b0[_0x7b5c('0x2d')]=qs['offset'](_0x3ba037[_0x7b5c('0x43')][_0x7b5c('0x2d')]);}_0x3641b0[_0x7b5c('0x6c')]=qs['sort'](_0x3ba037[_0x7b5c('0x43')][_0x7b5c('0x4b')]);_0x3641b0['where']=qs[_0x7b5c('0x45')](_[_0x7b5c('0x4c')](_0x3ba037[_0x7b5c('0x43')],_0x2adf7c[_0x7b5c('0x45')]));_0x3641b0[_0x7b5c('0x4e')][_0x7b5c('0x62')]=_0x3af6b3['id'];if(_0x3ba037[_0x7b5c('0x43')][_0x7b5c('0x4d')]){_0x3641b0[_0x7b5c('0x4e')]=_['merge'](_0x3641b0[_0x7b5c('0x4e')],{'$or':_['map'](_0x3641b0[_0x7b5c('0x48')],function(_0x2d7710){var _0x2b4b40={};_0x2b4b40[_0x2d7710]={'$like':'%'+_0x3ba037[_0x7b5c('0x43')][_0x7b5c('0x4d')]+'%'};return _0x2b4b40;})});}_0x3641b0=_['merge']({},_0x3641b0,_0x3ba037[_0x7b5c('0x56')]);return db[_0x7b5c('0x6d')][_0x7b5c('0x2c')]({'where':_0x3641b0[_0x7b5c('0x4e')]})['then'](function(_0x32587f){_0x3959d8[_0x7b5c('0x2c')]=_0x32587f;if(_0x3ba037[_0x7b5c('0x43')]['includeAll']){_0x3641b0[_0x7b5c('0x51')]=[{'all':!![]}];}return db[_0x7b5c('0x6d')][_0x7b5c('0x65')](_0x3641b0);})[_0x7b5c('0x32')](function(_0x30f4c1){_0x3959d8[_0x7b5c('0x6e')]=_0x30f4c1;return _0x3959d8;});}})['then'](respondWithFilteredResult(_0x13df50,_0x3641b0))[_0x7b5c('0x26')](handleError(_0x13df50,null));};exports[_0x7b5c('0x6f')]=function(_0x24a474,_0x5a4ba4,_0x1544fb){return db[_0x7b5c('0x3d')][_0x7b5c('0x5b')]({'where':{'id':_0x24a474['params']['id']}})['then'](handleEntityNotFound(_0x5a4ba4,null))[_0x7b5c('0x32')](function(_0x48a333){if(_0x48a333){return _0x48a333[_0x7b5c('0x6f')](_0x24a474[_0x7b5c('0x43')][_0x7b5c('0x67')]);}})[_0x7b5c('0x32')](respondWithStatusCode(_0x5a4ba4,null))['catch'](handleError(_0x5a4ba4,null));};exports[_0x7b5c('0x70')]=function(_0x3054e6,_0x960756,_0x532188){return db[_0x7b5c('0x71')][_0x7b5c('0x5b')]({'where':{'id':_0x3054e6[_0x7b5c('0x53')]['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x960756,null))[_0x7b5c('0x32')](function(_0x482395){if(_0x482395){return _0x482395[_0x7b5c('0x70')](_0x3054e6[_0x7b5c('0x57')][_0x7b5c('0x67')],_[_0x7b5c('0x72')](_0x3054e6[_0x7b5c('0x57')],[_0x7b5c('0x67'),'id'])||{});}})[_0x7b5c('0x32')](respondWithResult(_0x960756,null))[_0x7b5c('0x26')](handleError(_0x960756,null));};exports['getInteractions']=function(_0x3c7a20,_0x4c583e,_0x4b1dcd){var _0x133832={'raw':![],'where':{}};var _0x231b42={};var _0x3689b8={'count':0x0,'rows':[]};return db[_0x7b5c('0x3d')][_0x7b5c('0x6a')]({'where':{'id':_0x3c7a20[_0x7b5c('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c583e,null))[_0x7b5c('0x32')](function(_0x48faa3){if(_0x48faa3){_0x231b42[_0x7b5c('0x41')]=_[_0x7b5c('0x44')](db[_0x7b5c('0x71')]['rawAttributes']);_0x231b42['query']=_[_0x7b5c('0x44')](_0x3c7a20[_0x7b5c('0x43')]);_0x231b42[_0x7b5c('0x45')]=_[_0x7b5c('0x46')](_0x231b42[_0x7b5c('0x41')],_0x231b42['query']);_0x133832[_0x7b5c('0x48')]=_[_0x7b5c('0x46')](_0x231b42['model'],qs[_0x7b5c('0x47')](_0x3c7a20['query'][_0x7b5c('0x47')]));_0x133832['attributes']=_0x133832[_0x7b5c('0x48')][_0x7b5c('0x49')]?_0x133832[_0x7b5c('0x48')]:_0x231b42[_0x7b5c('0x41')];if(!_0x3c7a20[_0x7b5c('0x43')][_0x7b5c('0x4a')]('nolimit')){_0x133832[_0x7b5c('0x2b')]=qs[_0x7b5c('0x2b')](_0x3c7a20[_0x7b5c('0x43')][_0x7b5c('0x2b')]);_0x133832[_0x7b5c('0x2d')]=qs[_0x7b5c('0x2d')](_0x3c7a20[_0x7b5c('0x43')]['offset']);}_0x133832['order']=qs[_0x7b5c('0x4b')](_0x3c7a20[_0x7b5c('0x43')][_0x7b5c('0x4b')]);_0x133832[_0x7b5c('0x4e')]=qs[_0x7b5c('0x45')](_[_0x7b5c('0x4c')](_0x3c7a20[_0x7b5c('0x43')],_0x231b42[_0x7b5c('0x45')]));_0x133832[_0x7b5c('0x4e')][_0x7b5c('0x62')]=_0x48faa3['id'];if(_0x3c7a20[_0x7b5c('0x43')][_0x7b5c('0x4d')]){_0x133832['where']=_[_0x7b5c('0x50')](_0x133832[_0x7b5c('0x4e')],{'$or':_[_0x7b5c('0x42')](_0x133832[_0x7b5c('0x48')],function(_0x12680a){var _0x55b897={};_0x55b897[_0x12680a]={'$like':'%'+_0x3c7a20[_0x7b5c('0x43')][_0x7b5c('0x4d')]+'%'};return _0x55b897;})});}_0x133832=_['merge']({},_0x133832,_0x3c7a20[_0x7b5c('0x56')]);return db[_0x7b5c('0x71')][_0x7b5c('0x2c')]({'where':_0x133832[_0x7b5c('0x4e')]})[_0x7b5c('0x32')](function(_0x182932){_0x3689b8[_0x7b5c('0x2c')]=_0x182932;if(_0x3c7a20['query'][_0x7b5c('0x55')]){_0x133832[_0x7b5c('0x51')]=[{'model':db[_0x7b5c('0x73')],'as':_0x7b5c('0x74'),'required':![]},{'model':db[_0x7b5c('0x75')],'as':'Owner','attributes':[_0x7b5c('0x38'),'fullname',_0x7b5c('0x76')],'required':![]},{'model':db['Tag'],'as':_0x7b5c('0x77'),'attributes':['id',_0x7b5c('0x38'),_0x7b5c('0x78')],'where':_0x3c7a20[_0x7b5c('0x43')][_0x7b5c('0x79')]?{'id':_0x3c7a20[_0x7b5c('0x43')][_0x7b5c('0x79')]}:undefined,'required':_0x3c7a20['query'][_0x7b5c('0x79')]?!![]:![]}];}return db['FaxInteraction'][_0x7b5c('0x65')](_0x133832);})[_0x7b5c('0x32')](function(_0x2da215){_0x3689b8[_0x7b5c('0x6e')]=_0x2da215;return _0x3689b8;});}})[_0x7b5c('0x32')](respondWithFilteredResult(_0x4c583e,_0x133832))['catch'](handleError(_0x4c583e,null));};exports[_0x7b5c('0x7a')]=function(_0x21c815,_0x24ccd6){var _0x2c9179=_0x21c815['params']['id'];var _0x4c98ba=_0x21c815[_0x7b5c('0x57')];var _0x4fe64e=0xc8;var _0x110506=null;return db[_0x7b5c('0x7b')][_0x7b5c('0x7c')]({'isolationLevel':db[_0x7b5c('0x7b')][_0x7b5c('0x7d')]['ISOLATION_LEVELS'][_0x7b5c('0x7e')]},function(_0x59b113){return db[_0x7b5c('0x3d')][_0x7b5c('0x6a')]({'where':{'id':_0x2c9179},'transaction':_0x59b113})[_0x7b5c('0x32')](function(_0x2f03fe){if(_0x2f03fe){return db[_0x7b5c('0x7f')]['destroy']({'where':{'FaxAccountId':_0x2c9179},'transaction':_0x59b113})[_0x7b5c('0x32')](function(){var _0x26641d=_[_0x7b5c('0x42')](_0x4c98ba,function(_0x4d6d20){_0x4d6d20['FaxAccountId']=_0x2c9179;return _0x4d6d20;});return db[_0x7b5c('0x7f')][_0x7b5c('0x80')](_0x26641d,{'transaction':_0x59b113});});}else{_0x4fe64e=0x194;_0x110506=[];}});})[_0x7b5c('0x32')](function(){if(_0x4fe64e!==0x194){return db[_0x7b5c('0x7f')][_0x7b5c('0x81')]({'where':{'FaxAccountId':_0x2c9179},'order':_0x7b5c('0x82')})[_0x7b5c('0x32')](function(_0x8f0256){_0x110506=_0x8f0256;});}})[_0x7b5c('0x26')](function(_0x4fb929){_0x4fe64e=0x1f4;logger[_0x7b5c('0x21')](_0x4fb929[_0x7b5c('0x37')]);if(_0x4fb929['name']){delete _0x4fb929[_0x7b5c('0x38')];}_0x110506=_0x4fb929;})[_0x7b5c('0x83')](function(){if(_0x110506===null){_0x24ccd6[_0x7b5c('0x27')](_0x4fe64e);}else{if(_0x4fe64e===0x1f4){_0x24ccd6[_0x7b5c('0x28')](_0x4fe64e)['send'](_0x110506);}else{_0x24ccd6[_0x7b5c('0x28')](_0x4fe64e)[_0x7b5c('0x29')](_0x110506);}}});};exports['getApplications']=function(_0x1570f8,_0x27eaf0,_0x2f7801){var _0x4f1363={};var _0x2e1e7e={};var _0x2de3ae;var _0x794668;return db[_0x7b5c('0x3d')][_0x7b5c('0x6a')]({'where':{'id':_0x1570f8['params']['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x27eaf0,null))['then'](function(_0x3cb93f){if(_0x3cb93f){_0x2de3ae=_0x3cb93f;_0x2e1e7e[_0x7b5c('0x41')]=_[_0x7b5c('0x44')](db['FaxApplication'][_0x7b5c('0x54')]);_0x2e1e7e[_0x7b5c('0x43')]=_[_0x7b5c('0x44')](_0x1570f8[_0x7b5c('0x43')]);_0x2e1e7e[_0x7b5c('0x45')]=_['intersection'](_0x2e1e7e[_0x7b5c('0x41')],_0x2e1e7e[_0x7b5c('0x43')]);_0x4f1363[_0x7b5c('0x48')]=_[_0x7b5c('0x46')](_0x2e1e7e['model'],qs['fields'](_0x1570f8[_0x7b5c('0x43')][_0x7b5c('0x47')]));_0x4f1363[_0x7b5c('0x48')]=_0x4f1363['attributes'][_0x7b5c('0x49')]?_0x4f1363['attributes']:_0x2e1e7e[_0x7b5c('0x41')];_0x4f1363[_0x7b5c('0x6c')]=qs[_0x7b5c('0x4b')](_0x1570f8['query'][_0x7b5c('0x4b')]);_0x4f1363[_0x7b5c('0x4e')]=qs[_0x7b5c('0x45')](_['pick'](_0x1570f8[_0x7b5c('0x43')],_0x2e1e7e[_0x7b5c('0x45')]));if(_0x1570f8[_0x7b5c('0x43')][_0x7b5c('0x4d')]){_0x4f1363[_0x7b5c('0x4e')]=_[_0x7b5c('0x50')](_0x4f1363['where'],{'$or':_['map'](_0x4f1363[_0x7b5c('0x48')],function(_0x57c369){var _0x2bf181={};_0x2bf181[_0x57c369]={'$like':'%'+_0x1570f8[_0x7b5c('0x43')][_0x7b5c('0x4d')]+'%'};return _0x2bf181;})});}_0x4f1363=_[_0x7b5c('0x50')]({},_0x4f1363,_0x1570f8[_0x7b5c('0x56')]);return _0x2de3ae[_0x7b5c('0x84')](_0x4f1363);}})[_0x7b5c('0x32')](function(_0x131d5e){if(_0x131d5e){_0x794668=_0x131d5e['length'];if(!_0x1570f8[_0x7b5c('0x43')]['hasOwnProperty']('nolimit')){_0x4f1363[_0x7b5c('0x2b')]=qs[_0x7b5c('0x2b')](_0x1570f8[_0x7b5c('0x43')][_0x7b5c('0x2b')]);_0x4f1363[_0x7b5c('0x2d')]=qs[_0x7b5c('0x2d')](_0x1570f8['query'][_0x7b5c('0x2d')]);}return _0x2de3ae[_0x7b5c('0x84')](_0x4f1363);}})[_0x7b5c('0x32')](function(_0x14f09a){if(_0x14f09a){return _0x14f09a?{'count':_0x794668,'rows':_0x14f09a}:null;}})[_0x7b5c('0x32')](respondWithResult(_0x27eaf0,null))[_0x7b5c('0x26')](handleError(_0x27eaf0,null));};function Extension(_0xed53cb,_0x36f981,_0x4b79ae,_0x134a47){this[_0x7b5c('0x85')]=_0x7b5c('0x86');this[_0x7b5c('0x87')]=_0xed53cb['localstationid'];this['app']=_0x134a47;this[_0x7b5c('0x3f')]=_0x7b5c('0x88');this[_0x7b5c('0x89')]='Fax\x20Extension';this[_0x7b5c('0x62')]=_0xed53cb['id'];this['priority']=_0x36f981;this[_0x7b5c('0x8a')]=_0x4b79ae;}function createExtensionsReciveFax(_0xdde97d){var _0x5ec244=0x1;var _0x1b76ff=[];_0x1b76ff[_0x7b5c('0x8b')](new Extension(_0xdde97d,_0x5ec244,'',_0x7b5c('0x8c')));_0x5ec244+=0x1;_0x1b76ff[_0x7b5c('0x8b')](new Extension(_0xdde97d,_0x5ec244,_0x7b5c('0x8d'),'Set'));_0x5ec244+=0x1;for(var _0x49a57f in _0xdde97d){if(_0xdde97d[_0x7b5c('0x4a')](_0x49a57f)&&(_0x49a57f===_0x7b5c('0x8e')||_0x49a57f===_0x7b5c('0x8f')||_0x49a57f==='gateway'||_0x49a57f==='faxdetect'||_0x49a57f===_0x7b5c('0x90')||_0x49a57f===_0x7b5c('0x91')||_0x49a57f==='minrate'||_0x49a57f===_0x7b5c('0x92')||_0x49a57f===_0x7b5c('0x93'))){_0x1b76ff['push'](new Extension(_0xdde97d,_0x5ec244,_0x7b5c('0x94')+_0x49a57f+')='+_0xdde97d[_0x49a57f],_0x7b5c('0x95')));_0x5ec244+=0x1;}}_0x1b76ff['push'](new Extension(_0xdde97d,_0x5ec244,'6','Wait'));_0x5ec244+=0x1;_0x1b76ff[_0x7b5c('0x8b')](new Extension(_0xdde97d,_0x5ec244,_0x7b5c('0x96'),_0x7b5c('0x97')));_0x5ec244=0x0;return _0x1b76ff;}exports['addAccountApplications']=function(_0x368a4d,_0x55eee3,_0x4dbe44){var _0x83c73;return db[_0x7b5c('0x7b')][_0x7b5c('0x7c')](function(_0x3f654a){return db['FaxAccount'][_0x7b5c('0x5e')](_0x368a4d[_0x7b5c('0x57')],{'transaction':_0x3f654a})['then'](function(_0x1b44fa){_0x83c73=_0x1b44fa[_0x7b5c('0x33')]({'plain':!![]});return db[_0x7b5c('0x98')][_0x7b5c('0x80')](createExtensionsReciveFax(_0x83c73),{'transaction':_0x3f654a});});})['then'](function(){return _0x83c73;})[_0x7b5c('0x32')](respondWithResult(_0x55eee3,null))[_0x7b5c('0x26')](handleError(_0x55eee3,null));};exports[_0x7b5c('0x99')]=function(_0x31a2fa,_0x115731,_0x18db59){var _0x4e6450;return db[_0x7b5c('0x7b')][_0x7b5c('0x7c')](function(_0x35e6c8){return db['FaxAccount']['update'](_0x31a2fa[_0x7b5c('0x57')],{'where':{'id':_0x31a2fa[_0x7b5c('0x57')]['id']},'transaction':_0x35e6c8})[_0x7b5c('0x32')](function(_0x30894e){return db[_0x7b5c('0x98')][_0x7b5c('0x35')]({'where':{'FaxAccountId':_0x31a2fa[_0x7b5c('0x57')]['id']},'transaction':_0x35e6c8})[_0x7b5c('0x32')](function(_0x55eb29){return db['VoiceExtension'][_0x7b5c('0x80')](createExtensionsReciveFax(_[_0x7b5c('0x72')](_0x31a2fa[_0x7b5c('0x57')],[_0x7b5c('0x9a'),'key',_0x7b5c('0x9b'),_0x7b5c('0x9c'),_0x7b5c('0x9d'),_0x7b5c('0x9e')])),{'transaction':_0x35e6c8});});});})[_0x7b5c('0x32')](function(){return db[_0x7b5c('0x3d')][_0x7b5c('0x9f')](_0x31a2fa[_0x7b5c('0x57')]['id']);})[_0x7b5c('0x32')](respondWithResult(_0x115731,null))[_0x7b5c('0x26')](handleError(_0x115731,null));};exports[_0x7b5c('0xa0')]=function(_0x1a8c84,_0xd2002c,_0x41d260){var _0x365af2={'raw':!![],'where':{}};var _0x7779ad={};var _0x10514a={'count':0x0,'rows':[]};return db[_0x7b5c('0x3d')][_0x7b5c('0x6a')]({'where':{'id':_0x1a8c84[_0x7b5c('0x53')]['id']}})['then'](handleEntityNotFound(_0xd2002c,null))['then'](function(_0x22c6d9){if(_0x22c6d9){_0x7779ad[_0x7b5c('0x41')]=_['keys'](db['FaxMessage'][_0x7b5c('0x54')]);_0x7779ad[_0x7b5c('0x43')]=_['keys'](_0x1a8c84['query']);_0x7779ad[_0x7b5c('0x45')]=_[_0x7b5c('0x46')](_0x7779ad[_0x7b5c('0x41')],_0x7779ad[_0x7b5c('0x43')]);_0x365af2[_0x7b5c('0x48')]=_['intersection'](_0x7779ad['model'],qs['fields'](_0x1a8c84['query']['fields']));_0x365af2['attributes']=_0x365af2[_0x7b5c('0x48')][_0x7b5c('0x49')]?_0x365af2[_0x7b5c('0x48')]:_0x7779ad[_0x7b5c('0x41')];if(!_0x1a8c84[_0x7b5c('0x43')][_0x7b5c('0x4a')](_0x7b5c('0x6b'))){_0x365af2[_0x7b5c('0x2b')]=qs['limit'](_0x1a8c84[_0x7b5c('0x43')][_0x7b5c('0x2b')]);_0x365af2[_0x7b5c('0x2d')]=qs[_0x7b5c('0x2d')](_0x1a8c84['query']['offset']);}_0x365af2[_0x7b5c('0x6c')]=qs[_0x7b5c('0x4b')](_0x1a8c84[_0x7b5c('0x43')]['sort']);_0x365af2[_0x7b5c('0x4e')]=qs[_0x7b5c('0x45')](_[_0x7b5c('0x4c')](_0x1a8c84[_0x7b5c('0x43')],_0x7779ad[_0x7b5c('0x45')]));_0x365af2[_0x7b5c('0x4e')][_0x7b5c('0x62')]=_0x22c6d9['id'];if(_0x1a8c84[_0x7b5c('0x43')][_0x7b5c('0x4d')]){_0x365af2['where']=_[_0x7b5c('0x50')](_0x365af2['where'],{'$or':_[_0x7b5c('0x42')](_0x365af2[_0x7b5c('0x48')],function(_0x37873b){var _0x56480e={};_0x56480e[_0x37873b]={'$like':'%'+_0x1a8c84['query'][_0x7b5c('0x4d')]+'%'};return _0x56480e;})});}if(_0x1a8c84['query']['$gte']){var _0x32b5b5=_0x1a8c84[_0x7b5c('0x43')][_0x7b5c('0xa1')]['split'](',');var _0xd8be67={};_0xd8be67[_0x32b5b5[0x0]]={'$gte':moment(_0x32b5b5[0x1])[_0x7b5c('0xa2')](_0x7b5c('0xa3'))};_0x365af2[_0x7b5c('0x4e')]=_[_0x7b5c('0x50')](_0x365af2['where'],_0xd8be67);}_0x365af2=_[_0x7b5c('0x50')]({},_0x365af2,_0x1a8c84[_0x7b5c('0x56')]);return db[_0x7b5c('0xa4')][_0x7b5c('0x2c')]({'where':_0x365af2[_0x7b5c('0x4e')]})[_0x7b5c('0x32')](function(_0x5c0a47){_0x10514a['count']=_0x5c0a47;if(_0x1a8c84[_0x7b5c('0x43')][_0x7b5c('0x55')]){_0x365af2[_0x7b5c('0x51')]=[{'all':!![]}];}return db[_0x7b5c('0xa4')][_0x7b5c('0x65')](_0x365af2);})[_0x7b5c('0x32')](function(_0x1c8150){_0x10514a[_0x7b5c('0x6e')]=_0x1c8150;return _0x10514a;});}})['then'](respondWithFilteredResult(_0xd2002c,_0x365af2))[_0x7b5c('0x26')](handleError(_0xd2002c,null));};exports[_0x7b5c('0x39')]=function(_0x27b5eb,_0x5e672f,_0xf75e45){var _0xd8028c,_0x4f5f28={},_0x460cf0;if(_0x27b5eb[_0x7b5c('0x57')]['to']){_0x460cf0=_0x27b5eb[_0x7b5c('0x57')]['to'][0x0];}return db[_0x7b5c('0x3d')][_0x7b5c('0x5b')]({'where':{'id':_0x27b5eb[_0x7b5c('0x53')]['id']},'include':[{'model':db[_0x7b5c('0xa5')],'as':_0x7b5c('0xa6'),'include':[{'model':db[_0x7b5c('0x73')],'as':'Contacts','where':{'fax':_0x460cf0},'limit':0x1,'order':[[_0x7b5c('0x9c'),'DESC']]}]}]})[_0x7b5c('0x32')](handleEntityNotFound(_0x5e672f,null))['then'](function(_0xbd20ac){_0xd8028c=_0xbd20ac;if(_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')]&&_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][_0x7b5c('0x49')]){for(var _0x28f086=0x0;_0x28f086<_0x27b5eb[_0x7b5c('0x57')]['attachments']['length'];_0x28f086+=0x1){_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][_0x28f086]={'filename':_0x27b5eb[_0x7b5c('0x57')]['attachments'][_0x28f086]['name'],'id':_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][_0x28f086]['id'],'path':path['join'](config[_0x7b5c('0xa8')],_0x7b5c('0xa9'),_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][_0x28f086][_0x7b5c('0xaa')])};}}return respondWithRpcPromise(_0x7b5c('0xab'),_0x7b5c('0xab'),{'FaxAccountId':_[_0x7b5c('0xac')](_0x27b5eb['params']['id'])?undefined:_0x27b5eb[_0x7b5c('0x53')]['id'],'path':_['isNil'](_0x27b5eb[_0x7b5c('0x57')]['attachments'][0x0][_0x7b5c('0xad')])?undefined:_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][0x0]['path'],'fax':_[_0x7b5c('0xac')](_0x27b5eb[_0x7b5c('0x57')]['to'][0x0])?undefined:_0x27b5eb[_0x7b5c('0x57')]['to'][0x0]},client9002);})['then'](function(){if(_0xd8028c){if(_[_0x7b5c('0xac')](_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xae')])){_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xae')]=util['format']('\x22%s\x22\x20<%s>',_0xd8028c['name'],_0xd8028c[_0x7b5c('0xaf')]);}if(_0xd8028c[_0x7b5c('0xa6')]){if(_0xd8028c[_0x7b5c('0xa6')]['Contacts'][_0x7b5c('0x49')]){return _0xd8028c['List'][_0x7b5c('0xb0')][0x0];}else{return db[_0x7b5c('0x73')][_0x7b5c('0x5e')](_['defaults'](_0x27b5eb[_0x7b5c('0x57')],{'firstName':_0x27b5eb[_0x7b5c('0x57')]['to'][0x0],'phone':_0x27b5eb[_0x7b5c('0x57')]['to'][0x0],'fax':_0x27b5eb[_0x7b5c('0x57')]['to'][0x0],'ListId':_0xd8028c[_0x7b5c('0x9e')]}));}}else{throw new Error(_0x7b5c('0xb1'));}}else{throw new Error(_0x7b5c('0xb2'));}})['then'](function(_0x404ab4){if(_0x404ab4){return db[_0x7b5c('0x71')]['find']({'where':{'ContactId':_0x404ab4['id'],'closed':![],'FaxAccountId':_0xd8028c['id']}})[_0x7b5c('0x32')](function(_0x49ad43){if(_0x49ad43){return[_0x49ad43,![]];}return db[_0x7b5c('0x71')]['create']({'UserId':_0x27b5eb[_0x7b5c('0x58')]['id'],'ContactId':_0x404ab4['id'],'FaxAccountId':_0xd8028c['id'],'fax':_0x27b5eb[_0x7b5c('0x57')]['to'][0x0],'firstMsgDirection':_0x7b5c('0xb3'),'Messages':[_[_0x7b5c('0x50')](_0x27b5eb[_0x7b5c('0x57')],{'read':![],'body':_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][0x0]['filename'],'FaxAccountId':_0xd8028c['id'],'UserId':_0x27b5eb[_0x7b5c('0x58')]['id'],'ContactId':_0x404ab4['id'],'AttachmentId':_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x7b5c('0xa4')],'as':'Messages'}]})['then'](function(_0x551696){return[_0x551696,!![]];});});}else{throw new Error(_0x7b5c('0xb4'));}})['spread'](function(_0x6ead8c,_0x15fac5){if(_0x15fac5){return _0x6ead8c;}return db[_0x7b5c('0xa4')][_0x7b5c('0x5e')]({'direction':'out','read':![],'body':_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][0x0]['filename'],'FaxAccountId':_0xd8028c['id'],'FaxInteractionId':_0x6ead8c['id'],'UserId':_0x27b5eb['user']['id'],'ContactId':_0x6ead8c[_0x7b5c('0xb5')],'AttachmentId':_0x27b5eb['body'][_0x7b5c('0xa7')][0x0]['id']})[_0x7b5c('0x32')](function(_0xf3d938){_0x6ead8c['dataValues'][_0x7b5c('0xb6')]=[];_0x6ead8c[_0x7b5c('0xb7')][_0x7b5c('0xb6')][_0x7b5c('0x8b')](_0xf3d938[_0x7b5c('0xb7')]);return _0x6ead8c;});})[_0x7b5c('0x32')](function(_0x2df8a8){respondWithRpcPromise(_0x7b5c('0xb8'),_0x7b5c('0xb8'),{'FaxAccountId':_['isNil'](_0x27b5eb['params']['id'])?undefined:_0x27b5eb[_0x7b5c('0x53')]['id'],'path':_['isNil'](_0x27b5eb['body'][_0x7b5c('0xa7')][0x0]['path'])?undefined:_0x27b5eb['body'][_0x7b5c('0xa7')][0x0][_0x7b5c('0xad')],'fax':_[_0x7b5c('0xac')](_0x27b5eb[_0x7b5c('0x57')]['to'][0x0])?undefined:_0x27b5eb[_0x7b5c('0x57')]['to'][0x0],'AttachmentId':_0x27b5eb[_0x7b5c('0x57')][_0x7b5c('0xa7')][0x0]['id']},client9002)[_0x7b5c('0x32')](function(_0x36be2c){logger[_0x7b5c('0x1d')]('SendFaxRpc,\x20%s',_0x36be2c);})[_0x7b5c('0x26')](function(_0x147b7b){logger['info'](_0x7b5c('0xb9'),_0x147b7b);});return _0x2df8a8;})[_0x7b5c('0x32')](respondWithResult(_0x5e672f,null))[_0x7b5c('0x26')](handleError(_0x5e672f,null));};exports['addAgents']=function(_0x1dc6ba,_0x1540d0,_0x297488){return db['FaxAccount'][_0x7b5c('0x5b')]({'where':{'id':_0x1dc6ba[_0x7b5c('0x53')]['id']}})['then'](handleEntityNotFound(_0x1540d0,null))[_0x7b5c('0x32')](function(_0x4c458c){if(_0x4c458c){return _0x4c458c['addAgents'](_0x1dc6ba[_0x7b5c('0x57')]['ids'],_['omit'](_0x1dc6ba['body'],[_0x7b5c('0x67'),'id'])||{})[_0x7b5c('0xba')](function(_0x5ec7ac){for(var _0x5ddafc=0x0;_0x5ddafc<_0x1dc6ba['body'][_0x7b5c('0x67')]['length'];_0x5ddafc+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x1dc6ba[_0x7b5c('0x57')][_0x7b5c('0x67')][_0x5ddafc]),'FaxAccountId':Number(_0x1dc6ba[_0x7b5c('0x53')]['id'])});}return _0x5ec7ac;});}})['then'](respondWithResult(_0x1540d0,null))['catch'](handleError(_0x1540d0,null));};exports[_0x7b5c('0xbb')]=function(_0x3ebdcc,_0x9a0ff1,_0x49c14c){return db[_0x7b5c('0x3d')]['find']({'where':{'id':_0x3ebdcc[_0x7b5c('0x53')]['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x9a0ff1,null))['then'](function(_0x1c18ce){if(_0x1c18ce){return _0x1c18ce[_0x7b5c('0xbb')](_0x3ebdcc[_0x7b5c('0x43')][_0x7b5c('0x67')])['then'](function(){if(_[_0x7b5c('0xbc')](_0x3ebdcc['query'][_0x7b5c('0x67')])){for(var _0x4f2ba3=0x0;_0x4f2ba3<_0x3ebdcc[_0x7b5c('0x43')][_0x7b5c('0x67')][_0x7b5c('0x49')];_0x4f2ba3+=0x1){socket[_0x7b5c('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x3ebdcc[_0x7b5c('0x43')][_0x7b5c('0x67')][_0x4f2ba3]),'FaxAccountId':Number(_0x3ebdcc[_0x7b5c('0x53')]['id'])});}}else{socket[_0x7b5c('0xbd')](_0x7b5c('0xbe'),{'UserId':Number(_0x3ebdcc[_0x7b5c('0x43')][_0x7b5c('0x67')]),'FaxAccountId':Number(_0x3ebdcc[_0x7b5c('0x53')]['id'])});}});}})[_0x7b5c('0x32')](respondWithStatusCode(_0x9a0ff1,null))[_0x7b5c('0x26')](handleError(_0x9a0ff1,null));};exports[_0x7b5c('0xbf')]=function(_0x43f742,_0x3b7ab5,_0x4c94ec){var _0xa32bd0={};var _0x3dcff4={};var _0x12524f;var _0x18dbc9;return db['FaxAccount']['findOne']({'where':{'id':_0x43f742[_0x7b5c('0x53')]['id']}})[_0x7b5c('0x32')](handleEntityNotFound(_0x3b7ab5,null))[_0x7b5c('0x32')](function(_0x25f7a3){if(_0x25f7a3){_0x12524f=_0x25f7a3;_0x3dcff4[_0x7b5c('0x41')]=_[_0x7b5c('0x44')](db['User'][_0x7b5c('0x54')]);_0x3dcff4['query']=_[_0x7b5c('0x44')](_0x43f742['query']);_0x3dcff4[_0x7b5c('0x45')]=_[_0x7b5c('0x46')](_0x3dcff4[_0x7b5c('0x41')],_0x3dcff4[_0x7b5c('0x43')]);_0xa32bd0[_0x7b5c('0x48')]=_[_0x7b5c('0x46')](_0x3dcff4[_0x7b5c('0x41')],qs[_0x7b5c('0x47')](_0x43f742[_0x7b5c('0x43')][_0x7b5c('0x47')]));_0xa32bd0[_0x7b5c('0x48')]=_0xa32bd0[_0x7b5c('0x48')][_0x7b5c('0x49')]?_0xa32bd0['attributes']:_0x3dcff4[_0x7b5c('0x41')];_0xa32bd0[_0x7b5c('0x6c')]=qs[_0x7b5c('0x4b')](_0x43f742[_0x7b5c('0x43')][_0x7b5c('0x4b')]);_0xa32bd0[_0x7b5c('0x4e')]=qs[_0x7b5c('0x45')](_['pick'](_0x43f742['query'],_0x3dcff4[_0x7b5c('0x45')]));if(_0x43f742['query'][_0x7b5c('0x4d')]){_0xa32bd0['where']=_[_0x7b5c('0x50')](_0xa32bd0[_0x7b5c('0x4e')],{'$or':_[_0x7b5c('0x42')](_0xa32bd0['attributes'],function(_0x37ff45){var _0x547663={};_0x547663[_0x37ff45]={'$like':'%'+_0x43f742['query'][_0x7b5c('0x4d')]+'%'};return _0x547663;})});}_0xa32bd0=_['merge']({},_0xa32bd0,_0x43f742['options']);return _0x12524f[_0x7b5c('0xbf')](_0xa32bd0);}})['then'](function(_0x360b86){if(_0x360b86){_0x18dbc9=_0x360b86[_0x7b5c('0x49')];if(!_0x43f742[_0x7b5c('0x43')][_0x7b5c('0x4a')](_0x7b5c('0x6b'))){_0xa32bd0[_0x7b5c('0x2b')]=qs[_0x7b5c('0x2b')](_0x43f742[_0x7b5c('0x43')][_0x7b5c('0x2b')]);_0xa32bd0[_0x7b5c('0x2d')]=qs[_0x7b5c('0x2d')](_0x43f742[_0x7b5c('0x43')][_0x7b5c('0x2d')]);}return _0x12524f['getAgents'](_0xa32bd0);}})['then'](function(_0x459a00){if(_0x459a00){return _0x459a00?{'count':_0x18dbc9,'rows':_0x459a00}:null;}})[_0x7b5c('0x32')](respondWithResult(_0x3b7ab5,null))[_0x7b5c('0x26')](handleError(_0x3b7ab5,null));}; \ No newline at end of file +var _0x96c4=['fullname','internal','Tag','color','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','send','getApplications','context','app','type','appdata','push','Answer','CDR(type)=inbound-fax','ecm','localstationid','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','FaxMessage','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','message','FaxAccount,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','show','params','rawAttributes','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','options','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','omit','FaxInteraction','CmContact','Contact','User','Owner'];(function(_0x341caf,_0x568261){var _0x2fbde6=function(_0x43b64f){while(--_0x43b64f){_0x341caf['push'](_0x341caf['shift']());}};_0x2fbde6(++_0x568261);}(_0x96c4,0x111));var _0x496c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x96c4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x496c('0x0'));var jsonpatch=require(_0x496c('0x1'));var rp=require(_0x496c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x496c('0x3'));var util=require(_0x496c('0x4'));var path=require(_0x496c('0x5'));var sox=require(_0x496c('0x6'));var csv=require(_0x496c('0x7'));var ejs=require(_0x496c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x496c('0x9'));var squel=require(_0x496c('0xa'));var crypto=require(_0x496c('0xb'));var jsforce=require(_0x496c('0xc'));var deskjs=require(_0x496c('0xd'));var toCsv=require(_0x496c('0x7'));var querystring=require(_0x496c('0xe'));var Papa=require(_0x496c('0xf'));var Redis=require(_0x496c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x496c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x496c('0x12'));var logger=require(_0x496c('0x13'))(_0x496c('0x14'));var utils=require(_0x496c('0x15'));var config=require(_0x496c('0x16'));var licenseUtil=require(_0x496c('0x17'));var db=require(_0x496c('0x18'))['db'];config[_0x496c('0x19')]=_[_0x496c('0x1a')](config['redis'],{'host':_0x496c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x496c('0x19')]));require(_0x496c('0x1c'))[_0x496c('0x1d')](socket);var jayson=require(_0x496c('0x1e'));var client=jayson[_0x496c('0x1f')][_0x496c('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x101bc1,_0x21bc22,_0x1b73d5,_0x2294a2){return new BPromise(function(_0x4fe9fb,_0x412139){var _0x59376b=_0x2294a2||client;return _0x59376b[_0x496c('0x21')](_0x101bc1,_0x1b73d5)[_0x496c('0x22')](function(_0xe4e2a9){logger[_0x496c('0x23')]('FaxAccount,\x20%s,\x20%s',_0x21bc22,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x21bc22,_0x496c('0x24'),JSON[_0x496c('0x25')](_0xe4e2a9));if(_0xe4e2a9[_0x496c('0x26')]){if(_0xe4e2a9[_0x496c('0x26')]['code']===0x1f4){logger[_0x496c('0x26')]('FaxAccount,\x20%s,\x20%s',_0x21bc22,_0xe4e2a9[_0x496c('0x26')][_0x496c('0x27')]);return _0x412139(_0xe4e2a9['error'][_0x496c('0x27')]);}logger['error'](_0x496c('0x28'),_0x21bc22,_0xe4e2a9[_0x496c('0x26')]['message']);return _0x4fe9fb(_0xe4e2a9[_0x496c('0x26')][_0x496c('0x27')]);}else{logger['info'](_0x496c('0x28'),_0x21bc22,_0x496c('0x24'));_0x4fe9fb(_0xe4e2a9[_0x496c('0x29')][_0x496c('0x27')]);}})[_0x496c('0x2a')](function(_0x1423cc){logger[_0x496c('0x26')](_0x496c('0x28'),_0x21bc22,_0x1423cc);_0x412139(_0x1423cc);});});}function respondWithStatusCode(_0x2c0872,_0x1d4323){_0x1d4323=_0x1d4323||0xcc;return function(_0x361998){if(_0x361998){return _0x2c0872[_0x496c('0x2b')](_0x1d4323);}return _0x2c0872[_0x496c('0x2c')](_0x1d4323)['end']();};}function respondWithResult(_0x5deefe,_0x57cfee){_0x57cfee=_0x57cfee||0xc8;return function(_0x54e66c){if(_0x54e66c){return _0x5deefe[_0x496c('0x2c')](_0x57cfee)[_0x496c('0x2d')](_0x54e66c);}};}function respondWithFilteredResult(_0x465f83,_0x121f5f){return function(_0x2ca86e){if(_0x2ca86e){var _0xd9b69c=typeof _0x121f5f[_0x496c('0x2e')]===_0x496c('0x2f')&&typeof _0x121f5f[_0x496c('0x30')]===_0x496c('0x2f');var _0x2b1661=_0x2ca86e[_0x496c('0x31')];var _0x25b7e8=_0xd9b69c?0x0:_0x121f5f[_0x496c('0x2e')];var _0x1d4739=_0xd9b69c?_0x2ca86e[_0x496c('0x31')]:_0x121f5f['offset']+_0x121f5f[_0x496c('0x30')];var _0x506627;if(_0x1d4739>=_0x2b1661){_0x1d4739=_0x2b1661;_0x506627=0xc8;}else{_0x506627=0xce;}_0x465f83[_0x496c('0x2c')](_0x506627);return _0x465f83[_0x496c('0x32')](_0x496c('0x33'),_0x25b7e8+'-'+_0x1d4739+'/'+_0x2b1661)[_0x496c('0x2d')](_0x2ca86e);}return null;};}function patchUpdates(_0xbd420){return function(_0x57b13e){try{jsonpatch[_0x496c('0x34')](_0x57b13e,_0xbd420,!![]);}catch(_0xf4ca45){return BPromise[_0x496c('0x35')](_0xf4ca45);}return _0x57b13e[_0x496c('0x36')]();};}function saveUpdates(_0x4ca89e,_0x22bc7d){return function(_0x3ff272){if(_0x3ff272){return _0x3ff272[_0x496c('0x37')](_0x4ca89e)[_0x496c('0x22')](function(_0x36693f){return _0x36693f;});}return null;};}function removeEntity(_0x5048a6,_0x2203fe){return function(_0x3d9cfc){if(_0x3d9cfc){return _0x3d9cfc[_0x496c('0x38')]()['then'](function(){var _0x27047e=_0x3d9cfc[_0x496c('0x39')]({'plain':!![]});var _0x3a6a32=_0x496c('0x3a');return db[_0x496c('0x3b')][_0x496c('0x38')]({'where':{'type':_0x3a6a32,'resourceId':_0x27047e['id']}})[_0x496c('0x22')](function(){return _0x3d9cfc;});})[_0x496c('0x22')](function(){_0x5048a6[_0x496c('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2866d8,_0x5c5c70){return function(_0x5a0d6c){if(!_0x5a0d6c){_0x2866d8[_0x496c('0x2b')](0x194);}return _0x5a0d6c;};}function handleError(_0xf223a2,_0x4b11fe){_0x4b11fe=_0x4b11fe||0x1f4;return function(_0x47d3ae){logger[_0x496c('0x26')](_0x47d3ae[_0x496c('0x3c')]);if(_0x47d3ae[_0x496c('0x3d')]){delete _0x47d3ae[_0x496c('0x3d')];}_0xf223a2[_0x496c('0x2c')](_0x4b11fe)['send'](_0x47d3ae);};}exports[_0x496c('0x3e')]=function(_0x1294d0,_0x1f7bb9){var _0x203f07={'include':[{'model':db[_0x496c('0x3f')],'as':_0x496c('0x40')}]},_0x4dcb8d={},_0x5a8632={'count':0x0,'rows':[]};var _0x164831=_[_0x496c('0x41')](db[_0x496c('0x42')]['rawAttributes'],function(_0xe051c8){return{'name':_0xe051c8[_0x496c('0x43')],'type':_0xe051c8['type']['key']};});_0x4dcb8d[_0x496c('0x44')]=_[_0x496c('0x41')](_0x164831,_0x496c('0x3d'));_0x4dcb8d[_0x496c('0x45')]=_[_0x496c('0x46')](_0x1294d0[_0x496c('0x45')]);_0x4dcb8d[_0x496c('0x47')]=_[_0x496c('0x48')](_0x4dcb8d['model'],_0x4dcb8d['query']);_0x203f07['attributes']=_[_0x496c('0x48')](_0x4dcb8d[_0x496c('0x44')],qs[_0x496c('0x49')](_0x1294d0['query'][_0x496c('0x49')]));_0x203f07[_0x496c('0x4a')]=_0x203f07[_0x496c('0x4a')][_0x496c('0x4b')]?_0x203f07[_0x496c('0x4a')]:_0x4dcb8d[_0x496c('0x44')];if(!_0x1294d0['query']['hasOwnProperty'](_0x496c('0x4c'))){_0x203f07[_0x496c('0x30')]=qs[_0x496c('0x30')](_0x1294d0[_0x496c('0x45')][_0x496c('0x30')]);_0x203f07['offset']=qs[_0x496c('0x2e')](_0x1294d0[_0x496c('0x45')][_0x496c('0x2e')]);}_0x203f07[_0x496c('0x4d')]=qs[_0x496c('0x4e')](_0x1294d0[_0x496c('0x45')]['sort']);_0x203f07[_0x496c('0x4f')]=qs[_0x496c('0x47')](_[_0x496c('0x50')](_0x1294d0[_0x496c('0x45')],_0x4dcb8d[_0x496c('0x47')]),_0x164831);if(_0x1294d0['query'][_0x496c('0x51')]){_0x203f07[_0x496c('0x4f')]=_['merge'](_0x203f07[_0x496c('0x4f')],{'$or':_[_0x496c('0x41')](_0x164831,function(_0x5cf884){if(_0x5cf884['type']!==_0x496c('0x52')){var _0x1528de={};_0x1528de[_0x5cf884['name']]={'$like':'%'+_0x1294d0[_0x496c('0x45')][_0x496c('0x51')]+'%'};return _0x1528de;}})});}_0x203f07=_[_0x496c('0x53')]({},_0x203f07,_0x1294d0['options']);var _0x508e42={'where':_0x203f07[_0x496c('0x4f')]};return db[_0x496c('0x42')]['count'](_0x508e42)[_0x496c('0x22')](function(_0x339d9d){_0x5a8632[_0x496c('0x31')]=_0x339d9d;if(_0x1294d0[_0x496c('0x45')][_0x496c('0x54')]){_0x203f07[_0x496c('0x55')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x203f07);})[_0x496c('0x22')](function(_0x3fdca7){_0x5a8632[_0x496c('0x56')]=_0x3fdca7;return _0x5a8632;})[_0x496c('0x22')](respondWithFilteredResult(_0x1f7bb9,_0x203f07))[_0x496c('0x2a')](handleError(_0x1f7bb9,null));};exports[_0x496c('0x57')]=function(_0x394715,_0x279da8){var _0x2aecbe={'raw':![],'where':{'id':_0x394715[_0x496c('0x58')]['id']},'include':[{'model':db[_0x496c('0x3f')],'as':_0x496c('0x40')}]},_0x187215={};_0x187215[_0x496c('0x44')]=_[_0x496c('0x46')](db[_0x496c('0x42')][_0x496c('0x59')]);_0x187215[_0x496c('0x45')]=_[_0x496c('0x46')](_0x394715[_0x496c('0x45')]);_0x187215[_0x496c('0x47')]=_[_0x496c('0x48')](_0x187215['model'],_0x187215[_0x496c('0x45')]);_0x2aecbe[_0x496c('0x4a')]=_[_0x496c('0x48')](_0x187215[_0x496c('0x44')],qs['fields'](_0x394715[_0x496c('0x45')][_0x496c('0x49')]));_0x2aecbe[_0x496c('0x4a')]=_0x2aecbe[_0x496c('0x4a')][_0x496c('0x4b')]?_0x2aecbe[_0x496c('0x4a')]:_0x187215[_0x496c('0x44')];if(_0x394715[_0x496c('0x45')][_0x496c('0x54')]){_0x2aecbe[_0x496c('0x55')]=[{'all':!![]}];}_0x2aecbe=_[_0x496c('0x53')]({},_0x2aecbe,_0x394715['options']);return db[_0x496c('0x42')][_0x496c('0x5a')](_0x2aecbe)[_0x496c('0x22')](handleEntityNotFound(_0x279da8,null))['then'](respondWithResult(_0x279da8,null))[_0x496c('0x2a')](handleError(_0x279da8,null));};exports['create']=function(_0x389bdf,_0x3df984){return db['FaxAccount']['create'](_0x389bdf[_0x496c('0x5b')],{})[_0x496c('0x22')](function(_0x3393c4){var _0x515c15=_0x389bdf['user']['get']({'plain':!![]});if(!_0x515c15)throw new Error(_0x496c('0x5c'));if(_0x515c15[_0x496c('0x5d')]===_0x496c('0x5e')){var _0x30e5f9=_0x3393c4[_0x496c('0x39')]({'plain':!![]});var _0x5b2b10=_0x496c('0x3a');return db[_0x496c('0x5f')][_0x496c('0x5a')]({'where':{'name':_0x5b2b10,'userProfileId':_0x515c15[_0x496c('0x60')]},'raw':!![]})[_0x496c('0x22')](function(_0x39e29c){if(_0x39e29c&&_0x39e29c[_0x496c('0x61')]===0x0){return db[_0x496c('0x3b')]['create']({'name':_0x30e5f9[_0x496c('0x3d')],'resourceId':_0x30e5f9['id'],'type':_0x39e29c[_0x496c('0x3d')],'sectionId':_0x39e29c['id']},{})[_0x496c('0x22')](function(){return _0x3393c4;});}else{return _0x3393c4;}})[_0x496c('0x2a')](function(_0xfae4b5){logger[_0x496c('0x26')](_0x496c('0x62'),_0xfae4b5);throw _0xfae4b5;});}return _0x3393c4;})[_0x496c('0x22')](respondWithResult(_0x3df984,0xc9))[_0x496c('0x2a')](handleError(_0x3df984,null));};exports[_0x496c('0x37')]=function(_0x40825c,_0x1161cf){if(_0x40825c[_0x496c('0x5b')]['id']){delete _0x40825c[_0x496c('0x5b')]['id'];}return db[_0x496c('0x42')][_0x496c('0x5a')]({'where':{'id':_0x40825c[_0x496c('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x496c('0x40')}]})[_0x496c('0x22')](handleEntityNotFound(_0x1161cf,null))[_0x496c('0x22')](saveUpdates(_0x40825c['body'],null))[_0x496c('0x22')](respondWithResult(_0x1161cf,null))[_0x496c('0x2a')](handleError(_0x1161cf,null));};exports['destroy']=function(_0x5b50a4,_0x1e034d){return db['FaxAccount']['find']({'where':{'id':_0x5b50a4[_0x496c('0x58')]['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x1e034d,null))[_0x496c('0x22')](removeEntity(_0x1e034d,null))[_0x496c('0x2a')](handleError(_0x1e034d,null));};exports['describe']=function(_0x23bd16,_0x991f6c){return db[_0x496c('0x42')][_0x496c('0x63')]()[_0x496c('0x22')](respondWithResult(_0x991f6c,null))[_0x496c('0x2a')](handleError(_0x991f6c,null));};exports[_0x496c('0x64')]=function(_0x565dcd,_0xf62159,_0x5367fb){if(_0x565dcd[_0x496c('0x5b')]['id']){delete _0x565dcd[_0x496c('0x5b')]['id'];}return db['FaxAccount'][_0x496c('0x5a')]({'where':{'id':_0x565dcd[_0x496c('0x58')]['id']}})['then'](handleEntityNotFound(_0xf62159,null))[_0x496c('0x22')](function(_0x4e3274){if(_0x4e3274){_0x565dcd[_0x496c('0x5b')][_0x496c('0x65')]=_0x4e3274['id'];return db[_0x496c('0x66')][_0x496c('0x67')](_0x565dcd['body']);}})['then'](respondWithResult(_0xf62159,null))['catch'](handleError(_0xf62159,null));};exports[_0x496c('0x68')]=function(_0x309974,_0x3be932,_0x128fc4){var _0x470df0={'raw':![],'where':{}};var _0xa0f171={};var _0x5fa309={'count':0x0,'rows':[]};return db[_0x496c('0x42')][_0x496c('0x69')]({'where':{'id':_0x309974[_0x496c('0x58')]['id']}})['then'](handleEntityNotFound(_0x3be932,null))[_0x496c('0x22')](function(_0xa891e8){if(_0xa891e8){_0xa0f171['model']=_[_0x496c('0x46')](db[_0x496c('0x66')]['rawAttributes']);_0xa0f171[_0x496c('0x45')]=_[_0x496c('0x46')](_0x309974['query']);_0xa0f171[_0x496c('0x47')]=_[_0x496c('0x48')](_0xa0f171[_0x496c('0x44')],_0xa0f171[_0x496c('0x45')]);_0x470df0[_0x496c('0x4a')]=_[_0x496c('0x48')](_0xa0f171[_0x496c('0x44')],qs[_0x496c('0x49')](_0x309974[_0x496c('0x45')][_0x496c('0x49')]));_0x470df0[_0x496c('0x4a')]=_0x470df0[_0x496c('0x4a')][_0x496c('0x4b')]?_0x470df0[_0x496c('0x4a')]:_0xa0f171[_0x496c('0x44')];if(!_0x309974[_0x496c('0x45')][_0x496c('0x6a')](_0x496c('0x4c'))){_0x470df0[_0x496c('0x30')]=qs['limit'](_0x309974[_0x496c('0x45')][_0x496c('0x30')]);_0x470df0['offset']=qs[_0x496c('0x2e')](_0x309974['query'][_0x496c('0x2e')]);}_0x470df0[_0x496c('0x4d')]=qs[_0x496c('0x4e')](_0x309974[_0x496c('0x45')]['sort']);_0x470df0[_0x496c('0x4f')]=qs[_0x496c('0x47')](_['pick'](_0x309974[_0x496c('0x45')],_0xa0f171['filters']));_0x470df0[_0x496c('0x4f')][_0x496c('0x65')]=_0xa891e8['id'];if(_0x309974[_0x496c('0x45')]['filter']){_0x470df0[_0x496c('0x4f')]=_[_0x496c('0x53')](_0x470df0[_0x496c('0x4f')],{'$or':_[_0x496c('0x41')](_0x470df0[_0x496c('0x4a')],function(_0x2a8ed2){var _0x492e3d={};_0x492e3d[_0x2a8ed2]={'$like':'%'+_0x309974[_0x496c('0x45')]['filter']+'%'};return _0x492e3d;})});}_0x470df0=_[_0x496c('0x53')]({},_0x470df0,_0x309974[_0x496c('0x6b')]);return db[_0x496c('0x66')][_0x496c('0x31')]({'where':_0x470df0['where']})[_0x496c('0x22')](function(_0x5e9ea3){_0x5fa309['count']=_0x5e9ea3;if(_0x309974['query'][_0x496c('0x54')]){_0x470df0['include']=[{'all':!![]}];}return db[_0x496c('0x66')][_0x496c('0x6c')](_0x470df0);})[_0x496c('0x22')](function(_0x6d1075){_0x5fa309[_0x496c('0x56')]=_0x6d1075;return _0x5fa309;});}})[_0x496c('0x22')](respondWithFilteredResult(_0x3be932,_0x470df0))[_0x496c('0x2a')](handleError(_0x3be932,null));};exports['removeDispositions']=function(_0x2dedbf,_0x37e6b0,_0xf2324b){return db[_0x496c('0x42')]['find']({'where':{'id':_0x2dedbf[_0x496c('0x58')]['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x37e6b0,null))[_0x496c('0x22')](function(_0x1b166c){if(_0x1b166c){return _0x1b166c[_0x496c('0x6d')](_0x2dedbf[_0x496c('0x45')][_0x496c('0x6e')]);}})['then'](respondWithStatusCode(_0x37e6b0,null))[_0x496c('0x2a')](handleError(_0x37e6b0,null));};exports[_0x496c('0x6f')]=function(_0x261bbd,_0x2da4ce,_0x23a89f){if(_0x261bbd['body']['id']){delete _0x261bbd[_0x496c('0x5b')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x261bbd['params']['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x2da4ce,null))[_0x496c('0x22')](function(_0x5c83f8){if(_0x5c83f8){_0x261bbd[_0x496c('0x5b')]['FaxAccountId']=_0x5c83f8['id'];return db[_0x496c('0x70')][_0x496c('0x67')](_0x261bbd[_0x496c('0x5b')]);}})[_0x496c('0x22')](respondWithResult(_0x2da4ce,null))[_0x496c('0x2a')](handleError(_0x2da4ce,null));};exports['getAnswers']=function(_0x1350c2,_0x4834a4,_0x71d9c9){var _0xbb041d={'raw':![],'where':{}};var _0x4f419a={};var _0x5ab00f={'count':0x0,'rows':[]};return db[_0x496c('0x42')][_0x496c('0x69')]({'where':{'id':_0x1350c2['params']['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x4834a4,null))[_0x496c('0x22')](function(_0xbb278){if(_0xbb278){_0x4f419a[_0x496c('0x44')]=_['keys'](db['CannedAnswer'][_0x496c('0x59')]);_0x4f419a[_0x496c('0x45')]=_['keys'](_0x1350c2['query']);_0x4f419a[_0x496c('0x47')]=_['intersection'](_0x4f419a[_0x496c('0x44')],_0x4f419a[_0x496c('0x45')]);_0xbb041d[_0x496c('0x4a')]=_[_0x496c('0x48')](_0x4f419a[_0x496c('0x44')],qs[_0x496c('0x49')](_0x1350c2[_0x496c('0x45')]['fields']));_0xbb041d[_0x496c('0x4a')]=_0xbb041d[_0x496c('0x4a')][_0x496c('0x4b')]?_0xbb041d[_0x496c('0x4a')]:_0x4f419a['model'];if(!_0x1350c2['query']['hasOwnProperty'](_0x496c('0x4c'))){_0xbb041d[_0x496c('0x30')]=qs['limit'](_0x1350c2[_0x496c('0x45')][_0x496c('0x30')]);_0xbb041d[_0x496c('0x2e')]=qs[_0x496c('0x2e')](_0x1350c2[_0x496c('0x45')][_0x496c('0x2e')]);}_0xbb041d[_0x496c('0x4d')]=qs[_0x496c('0x4e')](_0x1350c2[_0x496c('0x45')][_0x496c('0x4e')]);_0xbb041d[_0x496c('0x4f')]=qs['filters'](_[_0x496c('0x50')](_0x1350c2[_0x496c('0x45')],_0x4f419a[_0x496c('0x47')]));_0xbb041d[_0x496c('0x4f')][_0x496c('0x65')]=_0xbb278['id'];if(_0x1350c2['query']['filter']){_0xbb041d[_0x496c('0x4f')]=_[_0x496c('0x53')](_0xbb041d[_0x496c('0x4f')],{'$or':_[_0x496c('0x41')](_0xbb041d[_0x496c('0x4a')],function(_0x1ddcb1){var _0x33c3fa={};_0x33c3fa[_0x1ddcb1]={'$like':'%'+_0x1350c2['query'][_0x496c('0x51')]+'%'};return _0x33c3fa;})});}_0xbb041d=_['merge']({},_0xbb041d,_0x1350c2[_0x496c('0x6b')]);return db[_0x496c('0x70')][_0x496c('0x31')]({'where':_0xbb041d[_0x496c('0x4f')]})['then'](function(_0x5c4a01){_0x5ab00f[_0x496c('0x31')]=_0x5c4a01;if(_0x1350c2[_0x496c('0x45')][_0x496c('0x54')]){_0xbb041d[_0x496c('0x55')]=[{'all':!![]}];}return db[_0x496c('0x70')][_0x496c('0x6c')](_0xbb041d);})[_0x496c('0x22')](function(_0x2a1b0e){_0x5ab00f[_0x496c('0x56')]=_0x2a1b0e;return _0x5ab00f;});}})[_0x496c('0x22')](respondWithFilteredResult(_0x4834a4,_0xbb041d))[_0x496c('0x2a')](handleError(_0x4834a4,null));};exports[_0x496c('0x71')]=function(_0x3a4261,_0x35bad2,_0x3a0837){return db['FaxAccount'][_0x496c('0x5a')]({'where':{'id':_0x3a4261[_0x496c('0x58')]['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x35bad2,null))['then'](function(_0x270699){if(_0x270699){return _0x270699['removeAnswers'](_0x3a4261[_0x496c('0x45')][_0x496c('0x6e')]);}})[_0x496c('0x22')](respondWithStatusCode(_0x35bad2,null))[_0x496c('0x2a')](handleError(_0x35bad2,null));};exports['addInteraction']=function(_0x42b22f,_0x46e02b,_0x4f140e){return db['FaxInteraction'][_0x496c('0x5a')]({'where':{'id':_0x42b22f[_0x496c('0x58')]['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x46e02b,null))[_0x496c('0x22')](function(_0x4d9dff){if(_0x4d9dff){return _0x4d9dff[_0x496c('0x72')](_0x42b22f['body'][_0x496c('0x6e')],_[_0x496c('0x73')](_0x42b22f[_0x496c('0x5b')],[_0x496c('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x46e02b,null))[_0x496c('0x2a')](handleError(_0x46e02b,null));};exports['getInteractions']=function(_0x15676b,_0x5556b5,_0x349507){var _0x5465f1={'raw':![],'where':{}};var _0x2caa5b={};var _0x22e0c5={'count':0x0,'rows':[]};return db[_0x496c('0x42')][_0x496c('0x69')]({'where':{'id':_0x15676b[_0x496c('0x58')]['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x5556b5,null))[_0x496c('0x22')](function(_0x487e5f){if(_0x487e5f){_0x2caa5b[_0x496c('0x44')]=_[_0x496c('0x46')](db[_0x496c('0x74')][_0x496c('0x59')]);_0x2caa5b['query']=_[_0x496c('0x46')](_0x15676b['query']);_0x2caa5b['filters']=_[_0x496c('0x48')](_0x2caa5b['model'],_0x2caa5b['query']);_0x5465f1[_0x496c('0x4a')]=_[_0x496c('0x48')](_0x2caa5b[_0x496c('0x44')],qs['fields'](_0x15676b[_0x496c('0x45')][_0x496c('0x49')]));_0x5465f1[_0x496c('0x4a')]=_0x5465f1['attributes']['length']?_0x5465f1[_0x496c('0x4a')]:_0x2caa5b['model'];if(!_0x15676b[_0x496c('0x45')]['hasOwnProperty']('nolimit')){_0x5465f1[_0x496c('0x30')]=qs[_0x496c('0x30')](_0x15676b[_0x496c('0x45')][_0x496c('0x30')]);_0x5465f1[_0x496c('0x2e')]=qs[_0x496c('0x2e')](_0x15676b['query'][_0x496c('0x2e')]);}_0x5465f1['order']=qs[_0x496c('0x4e')](_0x15676b[_0x496c('0x45')][_0x496c('0x4e')]);_0x5465f1['where']=qs['filters'](_[_0x496c('0x50')](_0x15676b['query'],_0x2caa5b['filters']));_0x5465f1[_0x496c('0x4f')]['FaxAccountId']=_0x487e5f['id'];if(_0x15676b['query'][_0x496c('0x51')]){_0x5465f1[_0x496c('0x4f')]=_[_0x496c('0x53')](_0x5465f1[_0x496c('0x4f')],{'$or':_[_0x496c('0x41')](_0x5465f1['attributes'],function(_0x2ba0e1){var _0x21cf81={};_0x21cf81[_0x2ba0e1]={'$like':'%'+_0x15676b[_0x496c('0x45')][_0x496c('0x51')]+'%'};return _0x21cf81;})});}_0x5465f1=_[_0x496c('0x53')]({},_0x5465f1,_0x15676b[_0x496c('0x6b')]);return db[_0x496c('0x74')][_0x496c('0x31')]({'where':_0x5465f1[_0x496c('0x4f')]})['then'](function(_0x501f52){_0x22e0c5[_0x496c('0x31')]=_0x501f52;if(_0x15676b[_0x496c('0x45')][_0x496c('0x54')]){_0x5465f1[_0x496c('0x55')]=[{'model':db[_0x496c('0x75')],'as':_0x496c('0x76'),'required':![]},{'model':db[_0x496c('0x77')],'as':_0x496c('0x78'),'attributes':[_0x496c('0x3d'),_0x496c('0x79'),_0x496c('0x7a')],'required':![]},{'model':db[_0x496c('0x7b')],'as':'Tags','attributes':['id',_0x496c('0x3d'),_0x496c('0x7c')],'where':_0x15676b[_0x496c('0x45')]['tag']?{'id':_0x15676b['query']['tag']}:undefined,'required':_0x15676b[_0x496c('0x45')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x496c('0x6c')](_0x5465f1);})[_0x496c('0x22')](function(_0x28f0ef){_0x22e0c5[_0x496c('0x56')]=_0x28f0ef;return _0x22e0c5;});}})[_0x496c('0x22')](respondWithFilteredResult(_0x5556b5,_0x5465f1))['catch'](handleError(_0x5556b5,null));};exports[_0x496c('0x7d')]=function(_0x29eef7,_0x2426a7){var _0x504d8c=_0x29eef7[_0x496c('0x58')]['id'];var _0x3a3725=_0x29eef7['body'];var _0x817287=0xc8;var _0x1736dd=null;return db[_0x496c('0x7e')][_0x496c('0x7f')]({'isolationLevel':db[_0x496c('0x7e')][_0x496c('0x80')][_0x496c('0x81')][_0x496c('0x82')]},function(_0x16407c){return db['FaxAccount'][_0x496c('0x69')]({'where':{'id':_0x504d8c},'transaction':_0x16407c})[_0x496c('0x22')](function(_0x11a109){if(_0x11a109){return db[_0x496c('0x83')][_0x496c('0x38')]({'where':{'FaxAccountId':_0x504d8c},'transaction':_0x16407c})[_0x496c('0x22')](function(){var _0x56e591=_[_0x496c('0x41')](_0x3a3725,function(_0x155923){_0x155923[_0x496c('0x65')]=_0x504d8c;return _0x155923;});return db[_0x496c('0x83')][_0x496c('0x84')](_0x56e591,{'transaction':_0x16407c});});}else{_0x817287=0x194;_0x1736dd=[];}});})[_0x496c('0x22')](function(){if(_0x817287!==0x194){return db[_0x496c('0x83')][_0x496c('0x85')]({'where':{'FaxAccountId':_0x504d8c},'order':_0x496c('0x86')})[_0x496c('0x22')](function(_0x288f89){_0x1736dd=_0x288f89;});}})[_0x496c('0x2a')](function(_0x3bd898){_0x817287=0x1f4;logger['error'](_0x3bd898[_0x496c('0x3c')]);if(_0x3bd898['name']){delete _0x3bd898[_0x496c('0x3d')];}_0x1736dd=_0x3bd898;})['finally'](function(){if(_0x1736dd===null){_0x2426a7[_0x496c('0x2b')](_0x817287);}else{if(_0x817287===0x1f4){_0x2426a7['status'](_0x817287)[_0x496c('0x87')](_0x1736dd);}else{_0x2426a7[_0x496c('0x2c')](_0x817287)['json'](_0x1736dd);}}});};exports[_0x496c('0x88')]=function(_0x375bec,_0x302b1f,_0xb8987c){var _0x246925={};var _0x3e101a={};var _0x41c7d2;var _0x403636;return db[_0x496c('0x42')][_0x496c('0x69')]({'where':{'id':_0x375bec[_0x496c('0x58')]['id']}})['then'](handleEntityNotFound(_0x302b1f,null))[_0x496c('0x22')](function(_0x54751c){if(_0x54751c){_0x41c7d2=_0x54751c;_0x3e101a[_0x496c('0x44')]=_[_0x496c('0x46')](db[_0x496c('0x83')]['rawAttributes']);_0x3e101a[_0x496c('0x45')]=_[_0x496c('0x46')](_0x375bec[_0x496c('0x45')]);_0x3e101a[_0x496c('0x47')]=_[_0x496c('0x48')](_0x3e101a[_0x496c('0x44')],_0x3e101a['query']);_0x246925['attributes']=_[_0x496c('0x48')](_0x3e101a[_0x496c('0x44')],qs[_0x496c('0x49')](_0x375bec[_0x496c('0x45')][_0x496c('0x49')]));_0x246925['attributes']=_0x246925['attributes'][_0x496c('0x4b')]?_0x246925[_0x496c('0x4a')]:_0x3e101a[_0x496c('0x44')];_0x246925[_0x496c('0x4d')]=qs['sort'](_0x375bec[_0x496c('0x45')][_0x496c('0x4e')]);_0x246925[_0x496c('0x4f')]=qs[_0x496c('0x47')](_[_0x496c('0x50')](_0x375bec['query'],_0x3e101a[_0x496c('0x47')]));if(_0x375bec[_0x496c('0x45')][_0x496c('0x51')]){_0x246925['where']=_[_0x496c('0x53')](_0x246925['where'],{'$or':_[_0x496c('0x41')](_0x246925[_0x496c('0x4a')],function(_0x340049){var _0x32bf97={};_0x32bf97[_0x340049]={'$like':'%'+_0x375bec[_0x496c('0x45')][_0x496c('0x51')]+'%'};return _0x32bf97;})});}_0x246925=_[_0x496c('0x53')]({},_0x246925,_0x375bec[_0x496c('0x6b')]);return _0x41c7d2['getApplications'](_0x246925);}})[_0x496c('0x22')](function(_0x413a23){if(_0x413a23){_0x403636=_0x413a23['length'];if(!_0x375bec[_0x496c('0x45')][_0x496c('0x6a')](_0x496c('0x4c'))){_0x246925['limit']=qs['limit'](_0x375bec[_0x496c('0x45')][_0x496c('0x30')]);_0x246925[_0x496c('0x2e')]=qs[_0x496c('0x2e')](_0x375bec[_0x496c('0x45')][_0x496c('0x2e')]);}return _0x41c7d2[_0x496c('0x88')](_0x246925);}})[_0x496c('0x22')](function(_0x13eca6){if(_0x13eca6){return _0x13eca6?{'count':_0x403636,'rows':_0x13eca6}:null;}})[_0x496c('0x22')](respondWithResult(_0x302b1f,null))[_0x496c('0x2a')](handleError(_0x302b1f,null));};function Extension(_0x4da6c0,_0x595862,_0x34b80c,_0x50fa50){this[_0x496c('0x89')]='from-voip-provider';this['exten']=_0x4da6c0['localstationid'];this[_0x496c('0x8a')]=_0x50fa50;this[_0x496c('0x8b')]='system';this['description']='Fax\x20Extension';this[_0x496c('0x65')]=_0x4da6c0['id'];this[_0x496c('0x86')]=_0x595862;this[_0x496c('0x8c')]=_0x34b80c;}function createExtensionsReciveFax(_0x3e9a50){var _0x122d4f=0x1;var _0x491240=[];_0x491240[_0x496c('0x8d')](new Extension(_0x3e9a50,_0x122d4f,'',_0x496c('0x8e')));_0x122d4f+=0x1;_0x491240['push'](new Extension(_0x3e9a50,_0x122d4f,_0x496c('0x8f'),'Set'));_0x122d4f+=0x1;for(var _0x3604be in _0x3e9a50){if(_0x3e9a50[_0x496c('0x6a')](_0x3604be)&&(_0x3604be===_0x496c('0x90')||_0x3604be===_0x496c('0x91')||_0x3604be===_0x496c('0x92')||_0x3604be==='faxdetect'||_0x3604be===_0x496c('0x93')||_0x3604be===_0x496c('0x94')||_0x3604be===_0x496c('0x95')||_0x3604be==='modem'||_0x3604be===_0x496c('0x96'))){_0x491240[_0x496c('0x8d')](new Extension(_0x3e9a50,_0x122d4f,_0x496c('0x97')+_0x3604be+')='+_0x3e9a50[_0x3604be],_0x496c('0x98')));_0x122d4f+=0x1;}}_0x491240[_0x496c('0x8d')](new Extension(_0x3e9a50,_0x122d4f,'6',_0x496c('0x99')));_0x122d4f+=0x1;_0x491240[_0x496c('0x8d')](new Extension(_0x3e9a50,_0x122d4f,_0x496c('0x9a'),'ReceiveFax'));_0x122d4f=0x0;return _0x491240;}exports[_0x496c('0x9b')]=function(_0x45516e,_0x59cbdb,_0xd3a319){var _0x5c3145;return db['sequelize']['transaction'](function(_0x39bc1d){return db[_0x496c('0x42')][_0x496c('0x67')](_0x45516e[_0x496c('0x5b')],{'transaction':_0x39bc1d})[_0x496c('0x22')](function(_0x2f1a8e){_0x5c3145=_0x2f1a8e['get']({'plain':!![]});return db['VoiceExtension'][_0x496c('0x84')](createExtensionsReciveFax(_0x5c3145),{'transaction':_0x39bc1d});});})['then'](function(){return _0x5c3145;})[_0x496c('0x22')](respondWithResult(_0x59cbdb,null))[_0x496c('0x2a')](handleError(_0x59cbdb,null));};exports['updateAccountApplications']=function(_0x5ea47c,_0x5ba516,_0x26d502){var _0x178c7e;return db[_0x496c('0x7e')]['transaction'](function(_0x4fd495){return db['FaxAccount'][_0x496c('0x37')](_0x5ea47c[_0x496c('0x5b')],{'where':{'id':_0x5ea47c[_0x496c('0x5b')]['id']},'transaction':_0x4fd495})[_0x496c('0x22')](function(_0x35de69){return db[_0x496c('0x9c')][_0x496c('0x38')]({'where':{'FaxAccountId':_0x5ea47c[_0x496c('0x5b')]['id']},'transaction':_0x4fd495})[_0x496c('0x22')](function(_0x82bd03){return db[_0x496c('0x9c')][_0x496c('0x84')](createExtensionsReciveFax(_['omit'](_0x5ea47c[_0x496c('0x5b')],[_0x496c('0x9d'),_0x496c('0x9e'),_0x496c('0x9f'),_0x496c('0xa0'),_0x496c('0xa1'),_0x496c('0xa2')])),{'transaction':_0x4fd495});});});})[_0x496c('0x22')](function(){return db['FaxAccount'][_0x496c('0xa3')](_0x5ea47c[_0x496c('0x5b')]['id']);})['then'](respondWithResult(_0x5ba516,null))[_0x496c('0x2a')](handleError(_0x5ba516,null));};exports[_0x496c('0xa4')]=function(_0x9ece46,_0x19a6c3,_0x4cf39e){var _0x2a2924={'raw':!![],'where':{}};var _0x2b14b8={};var _0x54b98={'count':0x0,'rows':[]};return db[_0x496c('0x42')][_0x496c('0x69')]({'where':{'id':_0x9ece46['params']['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x19a6c3,null))[_0x496c('0x22')](function(_0x4a29d2){if(_0x4a29d2){_0x2b14b8[_0x496c('0x44')]=_['keys'](db['FaxMessage'][_0x496c('0x59')]);_0x2b14b8['query']=_[_0x496c('0x46')](_0x9ece46['query']);_0x2b14b8[_0x496c('0x47')]=_[_0x496c('0x48')](_0x2b14b8[_0x496c('0x44')],_0x2b14b8[_0x496c('0x45')]);_0x2a2924[_0x496c('0x4a')]=_[_0x496c('0x48')](_0x2b14b8['model'],qs[_0x496c('0x49')](_0x9ece46[_0x496c('0x45')][_0x496c('0x49')]));_0x2a2924['attributes']=_0x2a2924[_0x496c('0x4a')]['length']?_0x2a2924[_0x496c('0x4a')]:_0x2b14b8[_0x496c('0x44')];if(!_0x9ece46[_0x496c('0x45')][_0x496c('0x6a')](_0x496c('0x4c'))){_0x2a2924[_0x496c('0x30')]=qs[_0x496c('0x30')](_0x9ece46['query'][_0x496c('0x30')]);_0x2a2924['offset']=qs[_0x496c('0x2e')](_0x9ece46[_0x496c('0x45')][_0x496c('0x2e')]);}_0x2a2924['order']=qs[_0x496c('0x4e')](_0x9ece46['query']['sort']);_0x2a2924[_0x496c('0x4f')]=qs[_0x496c('0x47')](_['pick'](_0x9ece46[_0x496c('0x45')],_0x2b14b8[_0x496c('0x47')]));_0x2a2924[_0x496c('0x4f')]['FaxAccountId']=_0x4a29d2['id'];if(_0x9ece46[_0x496c('0x45')][_0x496c('0x51')]){_0x2a2924[_0x496c('0x4f')]=_[_0x496c('0x53')](_0x2a2924['where'],{'$or':_[_0x496c('0x41')](_0x2a2924['attributes'],function(_0x485cd2){var _0x1887b1={};_0x1887b1[_0x485cd2]={'$like':'%'+_0x9ece46[_0x496c('0x45')][_0x496c('0x51')]+'%'};return _0x1887b1;})});}if(_0x9ece46[_0x496c('0x45')][_0x496c('0xa5')]){var _0x732b30=_0x9ece46[_0x496c('0x45')][_0x496c('0xa5')][_0x496c('0xa6')](',');var _0x119488={};_0x119488[_0x732b30[0x0]]={'$gte':moment(_0x732b30[0x1])[_0x496c('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2a2924['where']=_['merge'](_0x2a2924[_0x496c('0x4f')],_0x119488);}_0x2a2924=_[_0x496c('0x53')]({},_0x2a2924,_0x9ece46['options']);return db[_0x496c('0xa8')][_0x496c('0x31')]({'where':_0x2a2924['where']})[_0x496c('0x22')](function(_0x2e11dc){_0x54b98[_0x496c('0x31')]=_0x2e11dc;if(_0x9ece46[_0x496c('0x45')]['includeAll']){_0x2a2924[_0x496c('0x55')]=[{'all':!![]}];}return db[_0x496c('0xa8')][_0x496c('0x6c')](_0x2a2924);})[_0x496c('0x22')](function(_0x302c62){_0x54b98[_0x496c('0x56')]=_0x302c62;return _0x54b98;});}})[_0x496c('0x22')](respondWithFilteredResult(_0x19a6c3,_0x2a2924))[_0x496c('0x2a')](handleError(_0x19a6c3,null));};exports[_0x496c('0x87')]=function(_0x26b712,_0x406611,_0x1d93f6){var _0x13f6bd,_0x15fe05={},_0x329885;if(_0x26b712[_0x496c('0x5b')]['to']){_0x329885=_0x26b712['body']['to'][0x0];}return db['FaxAccount'][_0x496c('0x5a')]({'where':{'id':_0x26b712['params']['id']},'include':[{'model':db['CmList'],'as':_0x496c('0xa9'),'include':[{'model':db[_0x496c('0x75')],'as':_0x496c('0xaa'),'where':{'fax':_0x329885},'limit':0x1,'order':[[_0x496c('0xa0'),_0x496c('0xab')]]}]}]})[_0x496c('0x22')](handleEntityNotFound(_0x406611,null))['then'](function(_0x58fa8e){_0x13f6bd=_0x58fa8e;if(_0x26b712[_0x496c('0x5b')][_0x496c('0xac')]&&_0x26b712[_0x496c('0x5b')]['attachments'][_0x496c('0x4b')]){for(var _0x582960=0x0;_0x582960<_0x26b712[_0x496c('0x5b')][_0x496c('0xac')]['length'];_0x582960+=0x1){_0x26b712[_0x496c('0x5b')]['attachments'][_0x582960]={'filename':_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][_0x582960][_0x496c('0x3d')],'id':_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][_0x582960]['id'],'path':path[_0x496c('0xad')](config[_0x496c('0xae')],'server/files/attachments',_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][_0x582960][_0x496c('0xaf')])};}}return respondWithRpcPromise(_0x496c('0xb0'),_0x496c('0xb0'),{'FaxAccountId':_[_0x496c('0xb1')](_0x26b712['params']['id'])?undefined:_0x26b712[_0x496c('0x58')]['id'],'path':_['isNil'](_0x26b712[_0x496c('0x5b')]['attachments'][0x0][_0x496c('0x5')])?undefined:_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][0x0][_0x496c('0x5')],'fax':_[_0x496c('0xb1')](_0x26b712[_0x496c('0x5b')]['to'][0x0])?undefined:_0x26b712[_0x496c('0x5b')]['to'][0x0]},client9002);})[_0x496c('0x22')](function(){if(_0x13f6bd){if(_[_0x496c('0xb1')](_0x26b712['body'][_0x496c('0xb2')])){_0x26b712[_0x496c('0x5b')][_0x496c('0xb2')]=util['format']('\x22%s\x22\x20<%s>',_0x13f6bd[_0x496c('0x3d')],_0x13f6bd[_0x496c('0xb3')]);}if(_0x13f6bd['List']){if(_0x13f6bd['List'][_0x496c('0xaa')][_0x496c('0x4b')]){return _0x13f6bd['List'][_0x496c('0xaa')][0x0];}else{return db[_0x496c('0x75')][_0x496c('0x67')](_['defaults'](_0x26b712['body'],{'firstName':_0x26b712['body']['to'][0x0],'phone':_0x26b712[_0x496c('0x5b')]['to'][0x0],'fax':_0x26b712[_0x496c('0x5b')]['to'][0x0],'ListId':_0x13f6bd[_0x496c('0xa2')]}));}}else{throw new Error(_0x496c('0xb4'));}}else{throw new Error(_0x496c('0xb5'));}})[_0x496c('0x22')](function(_0x3b890f){if(_0x3b890f){return db[_0x496c('0x74')][_0x496c('0x5a')]({'where':{'ContactId':_0x3b890f['id'],'closed':![],'FaxAccountId':_0x13f6bd['id']}})[_0x496c('0x22')](function(_0x1c38df){if(_0x1c38df){return[_0x1c38df,![]];}return db[_0x496c('0x74')][_0x496c('0x67')]({'UserId':_0x26b712[_0x496c('0x5e')]['id'],'ContactId':_0x3b890f['id'],'FaxAccountId':_0x13f6bd['id'],'fax':_0x26b712[_0x496c('0x5b')]['to'][0x0],'firstMsgDirection':_0x496c('0xb6'),'Messages':[_[_0x496c('0x53')](_0x26b712[_0x496c('0x5b')],{'read':![],'body':_0x26b712['body'][_0x496c('0xac')][0x0][_0x496c('0xb7')],'FaxAccountId':_0x13f6bd['id'],'UserId':_0x26b712[_0x496c('0x5e')]['id'],'ContactId':_0x3b890f['id'],'AttachmentId':_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x496c('0xb8')}]})[_0x496c('0x22')](function(_0x20baf9){return[_0x20baf9,!![]];});});}else{throw new Error(_0x496c('0xb9'));}})[_0x496c('0xba')](function(_0x431b76,_0x3529c7){if(_0x3529c7){return _0x431b76;}return db[_0x496c('0xa8')][_0x496c('0x67')]({'direction':_0x496c('0xb6'),'read':![],'body':_0x26b712['body'][_0x496c('0xac')][0x0][_0x496c('0xb7')],'FaxAccountId':_0x13f6bd['id'],'FaxInteractionId':_0x431b76['id'],'UserId':_0x26b712[_0x496c('0x5e')]['id'],'ContactId':_0x431b76[_0x496c('0xbb')],'AttachmentId':_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][0x0]['id']})[_0x496c('0x22')](function(_0x58621a){_0x431b76[_0x496c('0xbc')]['Messages']=[];_0x431b76[_0x496c('0xbc')]['Messages'][_0x496c('0x8d')](_0x58621a[_0x496c('0xbc')]);return _0x431b76;});})[_0x496c('0x22')](function(_0x5bbb2e){respondWithRpcPromise('SendFax',_0x496c('0xbd'),{'FaxAccountId':_['isNil'](_0x26b712[_0x496c('0x58')]['id'])?undefined:_0x26b712['params']['id'],'path':_[_0x496c('0xb1')](_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][0x0][_0x496c('0x5')])?undefined:_0x26b712[_0x496c('0x5b')][_0x496c('0xac')][0x0][_0x496c('0x5')],'fax':_[_0x496c('0xb1')](_0x26b712[_0x496c('0x5b')]['to'][0x0])?undefined:_0x26b712['body']['to'][0x0],'AttachmentId':_0x26b712[_0x496c('0x5b')]['attachments'][0x0]['id']},client9002)[_0x496c('0x22')](function(_0x3f8309){logger[_0x496c('0x23')](_0x496c('0xbe'),_0x3f8309);})[_0x496c('0x2a')](function(_0x285332){logger[_0x496c('0x23')]('SendFaxRpc,\x20%s',_0x285332);});return _0x5bbb2e;})[_0x496c('0x22')](respondWithResult(_0x406611,null))['catch'](handleError(_0x406611,null));};exports[_0x496c('0xbf')]=function(_0xb21a20,_0x1f55ef,_0x4859ef){return db['FaxAccount'][_0x496c('0x5a')]({'where':{'id':_0xb21a20['params']['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x1f55ef,null))[_0x496c('0x22')](function(_0x9b7e9c){if(_0x9b7e9c){return _0x9b7e9c[_0x496c('0xbf')](_0xb21a20['body'][_0x496c('0x6e')],_[_0x496c('0x73')](_0xb21a20[_0x496c('0x5b')],['ids','id'])||{})['spread'](function(_0x394a72){for(var _0x28a3e1=0x0;_0x28a3e1<_0xb21a20['body'][_0x496c('0x6e')][_0x496c('0x4b')];_0x28a3e1+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0xb21a20[_0x496c('0x5b')][_0x496c('0x6e')][_0x28a3e1]),'FaxAccountId':Number(_0xb21a20[_0x496c('0x58')]['id'])});}return _0x394a72;});}})['then'](respondWithResult(_0x1f55ef,null))[_0x496c('0x2a')](handleError(_0x1f55ef,null));};exports[_0x496c('0xc0')]=function(_0x5d2d60,_0x4a5b4e,_0x1726af){return db[_0x496c('0x42')]['find']({'where':{'id':_0x5d2d60[_0x496c('0x58')]['id']}})['then'](handleEntityNotFound(_0x4a5b4e,null))[_0x496c('0x22')](function(_0x29c31d){if(_0x29c31d){return _0x29c31d[_0x496c('0xc0')](_0x5d2d60['query'][_0x496c('0x6e')])[_0x496c('0x22')](function(){if(_[_0x496c('0xc1')](_0x5d2d60['query']['ids'])){for(var _0xc3a33a=0x0;_0xc3a33a<_0x5d2d60[_0x496c('0x45')]['ids'][_0x496c('0x4b')];_0xc3a33a+=0x1){socket[_0x496c('0xc2')](_0x496c('0xc3'),{'UserId':Number(_0x5d2d60[_0x496c('0x45')][_0x496c('0x6e')][_0xc3a33a]),'FaxAccountId':Number(_0x5d2d60[_0x496c('0x58')]['id'])});}}else{socket[_0x496c('0xc2')](_0x496c('0xc3'),{'UserId':Number(_0x5d2d60[_0x496c('0x45')][_0x496c('0x6e')]),'FaxAccountId':Number(_0x5d2d60['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4a5b4e,null))[_0x496c('0x2a')](handleError(_0x4a5b4e,null));};exports[_0x496c('0xc4')]=function(_0x5068a3,_0x227fa3,_0x3aac06){var _0x557b7a={};var _0x5dbb7f={};var _0x5577b1;var _0x586c22;return db[_0x496c('0x42')]['findOne']({'where':{'id':_0x5068a3[_0x496c('0x58')]['id']}})[_0x496c('0x22')](handleEntityNotFound(_0x227fa3,null))[_0x496c('0x22')](function(_0x5cdd3d){if(_0x5cdd3d){_0x5577b1=_0x5cdd3d;_0x5dbb7f[_0x496c('0x44')]=_['keys'](db['User']['rawAttributes']);_0x5dbb7f[_0x496c('0x45')]=_[_0x496c('0x46')](_0x5068a3[_0x496c('0x45')]);_0x5dbb7f[_0x496c('0x47')]=_['intersection'](_0x5dbb7f[_0x496c('0x44')],_0x5dbb7f[_0x496c('0x45')]);_0x557b7a[_0x496c('0x4a')]=_[_0x496c('0x48')](_0x5dbb7f[_0x496c('0x44')],qs[_0x496c('0x49')](_0x5068a3[_0x496c('0x45')][_0x496c('0x49')]));_0x557b7a[_0x496c('0x4a')]=_0x557b7a[_0x496c('0x4a')][_0x496c('0x4b')]?_0x557b7a[_0x496c('0x4a')]:_0x5dbb7f[_0x496c('0x44')];_0x557b7a['order']=qs[_0x496c('0x4e')](_0x5068a3[_0x496c('0x45')][_0x496c('0x4e')]);_0x557b7a[_0x496c('0x4f')]=qs[_0x496c('0x47')](_['pick'](_0x5068a3[_0x496c('0x45')],_0x5dbb7f[_0x496c('0x47')]));if(_0x5068a3[_0x496c('0x45')]['filter']){_0x557b7a[_0x496c('0x4f')]=_['merge'](_0x557b7a[_0x496c('0x4f')],{'$or':_[_0x496c('0x41')](_0x557b7a[_0x496c('0x4a')],function(_0x8b9eb1){var _0x3d52c4={};_0x3d52c4[_0x8b9eb1]={'$like':'%'+_0x5068a3[_0x496c('0x45')][_0x496c('0x51')]+'%'};return _0x3d52c4;})});}_0x557b7a=_[_0x496c('0x53')]({},_0x557b7a,_0x5068a3[_0x496c('0x6b')]);return _0x5577b1[_0x496c('0xc4')](_0x557b7a);}})[_0x496c('0x22')](function(_0x3cadb9){if(_0x3cadb9){_0x586c22=_0x3cadb9['length'];if(!_0x5068a3[_0x496c('0x45')][_0x496c('0x6a')](_0x496c('0x4c'))){_0x557b7a[_0x496c('0x30')]=qs[_0x496c('0x30')](_0x5068a3[_0x496c('0x45')][_0x496c('0x30')]);_0x557b7a[_0x496c('0x2e')]=qs[_0x496c('0x2e')](_0x5068a3[_0x496c('0x45')][_0x496c('0x2e')]);}return _0x5577b1[_0x496c('0xc4')](_0x557b7a);}})[_0x496c('0x22')](function(_0x3adfb4){if(_0x3adfb4){return _0x3adfb4?{'count':_0x586c22,'rows':_0x3adfb4}:null;}})[_0x496c('0x22')](respondWithResult(_0x227fa3,null))['catch'](handleError(_0x227fa3,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7ca3950..67cdb3b 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 _0x396a=['events','FaxAccount','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x18d2bd,_0x56fcc4){var _0x1aca01=function(_0x1ee4e8){while(--_0x1ee4e8){_0x18d2bd['push'](_0x18d2bd['shift']());}};_0x1aca01(++_0x56fcc4);}(_0x396a,0x129));var _0xa396=function(_0x27f7b6,_0x2dde24){_0x27f7b6=_0x27f7b6-0x0;var _0x22fd91=_0x396a[_0x27f7b6];return _0x22fd91;};'use strict';var EventEmitter=require(_0xa396('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xa396('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa396('0x2')](0x0);var events={'afterCreate':_0xa396('0x3'),'afterUpdate':_0xa396('0x4'),'afterDestroy':_0xa396('0x5')};function emitEvent(_0x2245cb){return function(_0x11001f,_0x204e24,_0x2becb2){FaxAccountEvents['emit'](_0x2245cb+':'+_0x11001f['id'],_0x11001f);FaxAccountEvents[_0xa396('0x6')](_0x2245cb,_0x11001f);_0x2becb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xa396('0x7')](e,emitEvent(event));}}module[_0xa396('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x242d=['FaxAccount','setMaxListeners','update','emit','hook','exports','events','../../mysqldb'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x242d,0x11e));var _0xd242=function(_0xe02346,_0x5e4eb7){_0xe02346=_0xe02346-0x0;var _0x4a6a6e=_0x242d[_0xe02346];return _0x4a6a6e;};'use strict';var EventEmitter=require(_0xd242('0x0'));var FaxAccount=require(_0xd242('0x1'))['db'][_0xd242('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd242('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd242('0x4'),'afterDestroy':'remove'};function emitEvent(_0xceed1f){return function(_0x176890,_0x2b6a39,_0x380368){FaxAccountEvents['emit'](_0xceed1f+':'+_0x176890['id'],_0x176890);FaxAccountEvents[_0xd242('0x5')](_0xceed1f,_0x176890);_0x380368(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xd242('0x6')](e,emitEvent(event));}}module[_0xd242('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 247f2fa..c302e9c 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 _0xc006=['fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc006,0x85));var _0x6c00=function(_0x2538ca,_0xb651c1){_0x2538ca=_0x2538ca-0x0;var _0x5b4cee=_0xc006[_0x2538ca];return _0x5b4cee;};'use strict';var _=require('lodash');var util=require(_0x6c00('0x0'));var logger=require(_0x6c00('0x1'))(_0x6c00('0x2'));var moment=require(_0x6c00('0x3'));var BPromise=require(_0x6c00('0x4'));var rp=require(_0x6c00('0x5'));var fs=require('fs');var path=require(_0x6c00('0x6'));var rimraf=require('rimraf');var config=require(_0x6c00('0x7'));var attributes=require(_0x6c00('0x8'));module[_0x6c00('0x9')]=function(_0x565d80,_0x431ef9){return _0x565d80[_0x6c00('0xa')]('FaxAccount',attributes,{'tableName':_0x6c00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb76d=['api','bluebird','request-promise','path','rimraf','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xb76d,0x111));var _0xdb76=function(_0x148eae,_0xe0f769){_0x148eae=_0x148eae-0x0;var _0x18bcf8=_0xb76d[_0x148eae];return _0x18bcf8;};'use strict';var _=require(_0xdb76('0x0'));var util=require('util');var logger=require(_0xdb76('0x1'))(_0xdb76('0x2'));var moment=require('moment');var BPromise=require(_0xdb76('0x3'));var rp=require(_0xdb76('0x4'));var fs=require('fs');var path=require(_0xdb76('0x5'));var rimraf=require(_0xdb76('0x6'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0xdb76('0x7')]=function(_0x68af50,_0x5dca70){return _0x68af50[_0xdb76('0x8')](_0xdb76('0x9'),attributes,{'tableName':_0xdb76('0xa'),'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 3a9dd08..b8aae3f 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 _0x18d7=['create','contact','fax','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','UserId','User','name','startRouting','Start','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFaxAccount','options','attributes','limit','include','model','map','then','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','length'];(function(_0x118daf,_0x58d193){var _0x25aa14=function(_0x327f8a){while(--_0x327f8a){_0x118daf['push'](_0x118daf['shift']());}};_0x25aa14(++_0x58d193);}(_0x18d7,0x111));var _0x718d=function(_0x168c60,_0x539d96){_0x168c60=_0x168c60-0x0;var _0x29bea4=_0x18d7[_0x168c60];return _0x29bea4;};'use strict';var _=require(_0x718d('0x0'));var util=require(_0x718d('0x1'));var moment=require(_0x718d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x718d('0x3'));var db=require(_0x718d('0x4'))['db'];var utils=require(_0x718d('0x5'));var logger=require(_0x718d('0x6'))(_0x718d('0x7'));var config=require(_0x718d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x718d('0x9')]({'port':0x232c});config[_0x718d('0xa')]=_[_0x718d('0xb')](config[_0x718d('0xa')],{'host':_0x718d('0xc'),'port':0x18eb});var socket=require(_0x718d('0xd'))(new Redis(config['redis']));require(_0x718d('0xe'))[_0x718d('0xf')](socket);function respondWithRpcPromise(_0x231027,_0x1a7e5b,_0x3ea0e1){return new BPromise(function(_0x26f52d,_0x1cd4a4){return client[_0x718d('0x10')](_0x231027,_0x3ea0e1)['then'](function(_0x580ab3){logger[_0x718d('0x11')](_0x718d('0x12'),_0x1a7e5b,'request\x20sent');logger[_0x718d('0x13')](_0x718d('0x14'),_0x1a7e5b,_0x718d('0x15'),JSON[_0x718d('0x16')](_0x580ab3));if(_0x580ab3[_0x718d('0x17')]){if(_0x580ab3[_0x718d('0x17')]['code']===0x1f4){logger[_0x718d('0x17')](_0x718d('0x12'),_0x1a7e5b,_0x580ab3['error']['message']);return _0x1cd4a4(_0x580ab3['error'][_0x718d('0x18')]);}logger[_0x718d('0x17')](_0x718d('0x12'),_0x1a7e5b,_0x580ab3['error'][_0x718d('0x18')]);return _0x26f52d(_0x580ab3['error'][_0x718d('0x18')]);}else{logger[_0x718d('0x11')](_0x718d('0x12'),_0x1a7e5b,_0x718d('0x15'));_0x26f52d(_0x580ab3[_0x718d('0x19')][_0x718d('0x18')]);}})[_0x718d('0x1a')](function(_0x1cd787){logger['error'](_0x718d('0x12'),_0x1a7e5b,_0x1cd787);_0x1cd4a4(_0x1cd787);});});}exports[_0x718d('0x1b')]=function(_0x5c79dd){var _0x28a0a8=this;return new Promise(function(_0x8a6981,_0xcf1a5c){return db['FaxAccount']['findAll']({'raw':_0x5c79dd[_0x718d('0x1c')]?_0x5c79dd[_0x718d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5c79dd[_0x718d('0x1c')]?_0x5c79dd[_0x718d('0x1c')]['where']||null:null,'attributes':_0x5c79dd[_0x718d('0x1c')]?_0x5c79dd['options'][_0x718d('0x1d')]||null:null,'limit':_0x5c79dd[_0x718d('0x1c')]?_0x5c79dd[_0x718d('0x1c')][_0x718d('0x1e')]||null:null,'include':_0x5c79dd['options']?_0x5c79dd[_0x718d('0x1c')][_0x718d('0x1f')]?_['map'](_0x5c79dd[_0x718d('0x1c')]['include'],function(_0x1ff842){return{'model':db[_0x1ff842[_0x718d('0x20')]],'as':_0x1ff842['as'],'attributes':_0x1ff842[_0x718d('0x1d')],'include':_0x1ff842[_0x718d('0x1f')]?_['map'](_0x1ff842['include'],function(_0x422e68){return{'model':db[_0x422e68['model']],'as':_0x422e68['as'],'attributes':_0x422e68['attributes'],'include':_0x422e68[_0x718d('0x1f')]?_[_0x718d('0x21')](_0x422e68['include'],function(_0x438142){return{'model':db[_0x438142[_0x718d('0x20')]],'as':_0x438142['as'],'attributes':_0x438142['attributes']};}):[]};}):[]};}):[]:[]})[_0x718d('0x22')](function(_0x3aeac4){logger[_0x718d('0x11')](_0x718d('0x1b'),_0x5c79dd);logger['debug'](_0x718d('0x1b'),_0x5c79dd,JSON[_0x718d('0x16')](_0x3aeac4));_0x8a6981(_0x3aeac4);})[_0x718d('0x1a')](function(_0x5c8e01){logger[_0x718d('0x17')](_0x718d('0x1b'),_0x5c8e01[_0x718d('0x18')],_0x5c79dd);_0xcf1a5c(_0x28a0a8['error'](0x1f4,_0x5c8e01['message']));});});};exports[_0x718d('0x23')]=function(_0x3b3834,_0x40e26a,_0x1f18c6){var _0x3d9cfb=this;return new Promise(function(_0x106a7e,_0x2237cd){var _0x4a07af={'body':_0x3b3834[_0x718d('0x24')],'channel':'fax'};var _0x23158d=[];var _0x38e190=[];var _0x4ea2a0={};return db[_0x718d('0x25')][_0x718d('0x26')]()[_0x718d('0x22')](function(_0x5f4d0d){if(!_0x5f4d0d){throw new db[(_0x718d('0x27'))][(_0x718d('0x28'))](_0x718d('0x29'));}_0x23158d=_['difference'](_['keys'](_0x5f4d0d),[_0x718d('0x2a'),_0x718d('0x2b')]);_0x38e190=_[_0x718d('0x2c')](_['keys'](_0x5f4d0d),[_0x718d('0x2a'),_0x718d('0x2b'),'CompanyId',_0x718d('0x2d')]);if(_0x3b3834['body']['id']){delete _0x3b3834['body']['id'];}if(_[_0x718d('0x2e')](_0x3b3834[_0x718d('0x24')][_0x718d('0x2f')])){throw new db[(_0x718d('0x27'))][(_0x718d('0x28'))](_0x718d('0x30'));}if(_[_0x718d('0x2e')](_0x3b3834['body'][_0x718d('0x24')])||_0x3b3834['body']['body']===''){throw new db[(_0x718d('0x27'))][(_0x718d('0x28'))](_0x718d('0x31'));}if(_[_0x718d('0x2e')](_0x3b3834[_0x718d('0x24')][_0x718d('0x32')])){throw new db['Sequelize']['ValidationError'](_0x718d('0x33')+_0x38e190);}if(!_[_0x718d('0x34')](_0x38e190,_0x3b3834[_0x718d('0x24')][_0x718d('0x32')])){throw new db[(_0x718d('0x27'))][(_0x718d('0x28'))](_0x718d('0x35')+_0x38e190);}_0x4ea2a0[_0x3b3834[_0x718d('0x24')][_0x718d('0x32')]]=_0x3b3834[_0x718d('0x24')]['from'];})[_0x718d('0x22')](function(){return db[_0x718d('0x36')][_0x718d('0x37')]({'where':{'id':_0x3b3834[_0x718d('0x38')]['id']},'include':[{'model':db[_0x718d('0x39')],'as':_0x718d('0x3a'),'include':[{'model':db[_0x718d('0x25')],'as':_0x718d('0x3b'),'where':_0x4ea2a0,'limit':0x1,'order':[[_0x718d('0x2b'),_0x718d('0x3c')]]}]},{'model':db[_0x718d('0x3d')],'as':_0x718d('0x3e')}]});})['then'](function(_0x10a064){if(_0x10a064&&_0x10a064[_0x718d('0x3a')]){var _0x44be86=_0x10a064[_0x718d('0x3f')]({'plain':!![]});_0x4a07af[_0x718d('0x38')]=_0x44be86;_0x4a07af[_0x718d('0x40')]=_0x44be86[_0x718d('0x3e')];_0x4a07af['list']=_0x44be86[_0x718d('0x3a')];_0x4a07af[_0x718d('0x40')]=_[_0x718d('0x41')](_0x4a07af['applications'],['priority'],['asc']);if(_0x4a07af[_0x718d('0x38')][_0x718d('0x3e')]){delete _0x4a07af['account'][_0x718d('0x3e')];}if(_0x4a07af[_0x718d('0x38')][_0x718d('0x3a')]&&_0x4a07af['account']['List'][_0x718d('0x3b')][_0x718d('0x42')]){return _0x4a07af[_0x718d('0x38')][_0x718d('0x3a')][_0x718d('0x3b')][0x0];}var _0x5b6710=_[_0x718d('0xb')](_0x3b3834[_0x718d('0x24')],{'firstName':_0x3b3834['body']['from'],'ListId':_0x44be86[_0x718d('0x2d')]});_0x5b6710[_0x3b3834[_0x718d('0x24')][_0x718d('0x32')]]=_0x3b3834[_0x718d('0x24')][_0x718d('0x2f')];return db[_0x718d('0x25')][_0x718d('0x43')](_0x5b6710,{'fields':_0x23158d,'raw':!![]});}})[_0x718d('0x22')](function(_0x26f1c1){_0x4a07af[_0x718d('0x44')]=_0x26f1c1;if(_0x26f1c1){var _0x45c88e={'ContactId':_0x26f1c1['id'],'FaxAccountId':_0x3b3834[_0x718d('0x38')]['id'],'fax':_0x26f1c1[_0x718d('0x45')]};return db[_0x718d('0x46')]['find']({'where':{'ContactId':_0x26f1c1['id'],'closed':![],'FaxAccountId':_0x3b3834[_0x718d('0x38')]['id']}})[_0x718d('0x22')](function(_0x9528cd){if(_0x9528cd){return[_0x9528cd,![]];}return db[_0x718d('0x46')][_0x718d('0x43')](_0x45c88e)[_0x718d('0x22')](function(_0x24a061){return[_0x24a061,!![]];});});}else{throw new Error(_0x718d('0x47'));}})['spread'](function(_0x2483f7,_0x432c7e){var _0x536ac9=_0x2483f7[_0x718d('0x3f')]({'plain':!![]});if(_0x432c7e){if(_0x4a07af[_0x718d('0x38')][_0x718d('0x48')]){_0x4a07af[_0x718d('0x40')][_0x718d('0x49')]({'id':0x0,'priority':_0x4a07af[_0x718d('0x40')][_0x718d('0x42')]+0x1,'app':_0x718d('0x4a'),'appdata':_0x718d('0x4b'),'interval':_0x718d('0x4c')});}_0x536ac9[_0x718d('0x4d')]=!![];}else{_0x536ac9[_0x718d('0x4d')]=![];}_0x4a07af[_0x718d('0x4e')]=_0x536ac9;return db['FaxMessage']['create']({'body':_0x3b3834['body'][_0x718d('0x24')],'FaxAccountId':_0x3b3834[_0x718d('0x38')]['id'],'FaxInteractionId':_0x2483f7['id'],'direction':'in','ContactId':_0x2483f7[_0x718d('0x4f')],'AttachmentId':_0x3b3834[_0x718d('0x24')]['AttachmentId']});})[_0x718d('0x22')](function(_0x153b46){_0x4a07af[_0x718d('0x18')]=_0x153b46;if(_0x4a07af[_0x718d('0x4e')][_0x718d('0x50')]){return db[_0x718d('0x51')]['find']({'attributes':['id',_0x718d('0x52')],'where':{'id':_0x4a07af[_0x718d('0x4e')][_0x718d('0x50')]}})[_0x718d('0x22')](function(_0x20ce3b){if(_0x20ce3b){_0x4a07af['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x20ce3b['name']+','+(_0x4a07af[_0x718d('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x718d('0x53'),_0x4a07af);});}return respondWithRpcPromise(_0x718d('0x54'),_0x718d('0x53'),_0x4a07af);})['then'](function(_0x2f2bb0){_0x106a7e(_0x2f2bb0);})['catch'](function(_0x5acfa2){_0x2237cd(_0x3d9cfb['error'](0x1f4,_0x5acfa2[_0x718d('0x18')]));});});}; \ No newline at end of file +var _0xad14=['isNil','from','Sequelize','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','account','DESC','FaxApplication','List','get','applications','Applications','list','orderBy','asc','Contacts','create','FaxInteraction','find','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','Start','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','include','map','model','debug','NotifyFaxAccount','body','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xad14,0x7f));var _0x4ad1=function(_0x254635,_0x472b4c){_0x254635=_0x254635-0x0;var _0x35293c=_0xad14[_0x254635];return _0x35293c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4ad1('0x0'));var rs=require(_0x4ad1('0x1'));var fs=require('fs');var Redis=require(_0x4ad1('0x2'));var db=require(_0x4ad1('0x3'))['db'];var utils=require(_0x4ad1('0x4'));var logger=require(_0x4ad1('0x5'))(_0x4ad1('0x6'));var config=require('../../config/environment');var jayson=require(_0x4ad1('0x7'));var client=jayson[_0x4ad1('0x8')][_0x4ad1('0x9')]({'port':0x232c});config[_0x4ad1('0xa')]=_[_0x4ad1('0xb')](config[_0x4ad1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ad1('0xc'))(new Redis(config[_0x4ad1('0xa')]));require(_0x4ad1('0xd'))[_0x4ad1('0xe')](socket);function respondWithRpcPromise(_0x1e5f9b,_0x3881c6,_0x1fe3c3){return new BPromise(function(_0xa45354,_0x5ad0e5){return client[_0x4ad1('0xf')](_0x1e5f9b,_0x1fe3c3)[_0x4ad1('0x10')](function(_0x2cc96b){logger[_0x4ad1('0x11')](_0x4ad1('0x12'),_0x3881c6,_0x4ad1('0x13'));logger['debug'](_0x4ad1('0x14'),_0x3881c6,_0x4ad1('0x13'),JSON[_0x4ad1('0x15')](_0x2cc96b));if(_0x2cc96b[_0x4ad1('0x16')]){if(_0x2cc96b[_0x4ad1('0x16')][_0x4ad1('0x17')]===0x1f4){logger['error'](_0x4ad1('0x12'),_0x3881c6,_0x2cc96b[_0x4ad1('0x16')][_0x4ad1('0x18')]);return _0x5ad0e5(_0x2cc96b[_0x4ad1('0x16')][_0x4ad1('0x18')]);}logger['error'](_0x4ad1('0x12'),_0x3881c6,_0x2cc96b[_0x4ad1('0x16')][_0x4ad1('0x18')]);return _0xa45354(_0x2cc96b[_0x4ad1('0x16')][_0x4ad1('0x18')]);}else{logger['info'](_0x4ad1('0x12'),_0x3881c6,_0x4ad1('0x13'));_0xa45354(_0x2cc96b[_0x4ad1('0x19')][_0x4ad1('0x18')]);}})[_0x4ad1('0x1a')](function(_0x599e7b){logger[_0x4ad1('0x16')](_0x4ad1('0x12'),_0x3881c6,_0x599e7b);_0x5ad0e5(_0x599e7b);});});}exports[_0x4ad1('0x1b')]=function(_0x30c35e){var _0x2e71d1=this;return new Promise(function(_0x192b56,_0x2dd741){return db[_0x4ad1('0x1c')][_0x4ad1('0x1d')]({'raw':_0x30c35e['options']?_0x30c35e[_0x4ad1('0x1e')][_0x4ad1('0x1f')]===undefined?!![]:![]:!![],'where':_0x30c35e['options']?_0x30c35e[_0x4ad1('0x1e')]['where']||null:null,'attributes':_0x30c35e[_0x4ad1('0x1e')]?_0x30c35e[_0x4ad1('0x1e')][_0x4ad1('0x20')]||null:null,'limit':_0x30c35e[_0x4ad1('0x1e')]?_0x30c35e[_0x4ad1('0x1e')]['limit']||null:null,'include':_0x30c35e['options']?_0x30c35e[_0x4ad1('0x1e')][_0x4ad1('0x21')]?_[_0x4ad1('0x22')](_0x30c35e['options'][_0x4ad1('0x21')],function(_0xfcc65){return{'model':db[_0xfcc65[_0x4ad1('0x23')]],'as':_0xfcc65['as'],'attributes':_0xfcc65[_0x4ad1('0x20')],'include':_0xfcc65[_0x4ad1('0x21')]?_[_0x4ad1('0x22')](_0xfcc65[_0x4ad1('0x21')],function(_0xf31d3a){return{'model':db[_0xf31d3a[_0x4ad1('0x23')]],'as':_0xf31d3a['as'],'attributes':_0xf31d3a[_0x4ad1('0x20')],'include':_0xf31d3a[_0x4ad1('0x21')]?_[_0x4ad1('0x22')](_0xf31d3a[_0x4ad1('0x21')],function(_0x3395e7){return{'model':db[_0x3395e7[_0x4ad1('0x23')]],'as':_0x3395e7['as'],'attributes':_0x3395e7[_0x4ad1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4ad1('0x10')](function(_0x372646){logger[_0x4ad1('0x11')]('GetFaxAccount',_0x30c35e);logger[_0x4ad1('0x24')](_0x4ad1('0x1b'),_0x30c35e,JSON[_0x4ad1('0x15')](_0x372646));_0x192b56(_0x372646);})[_0x4ad1('0x1a')](function(_0xb0b496){logger['error']('GetFaxAccount',_0xb0b496['message'],_0x30c35e);_0x2dd741(_0x2e71d1['error'](0x1f4,_0xb0b496[_0x4ad1('0x18')]));});});};exports[_0x4ad1('0x25')]=function(_0x72bc47,_0xa5cf73,_0x49c012){var _0x4ca7d1=this;return new Promise(function(_0x447504,_0x43299d){var _0x5504b4={'body':_0x72bc47[_0x4ad1('0x26')],'channel':'fax'};var _0x1d2c03=[];var _0x49dae0=[];var _0x3d826a={};return db[_0x4ad1('0x27')][_0x4ad1('0x28')]()[_0x4ad1('0x10')](function(_0x96bf92){if(!_0x96bf92){throw new db['Sequelize'][(_0x4ad1('0x29'))](_0x4ad1('0x2a'));}_0x1d2c03=_[_0x4ad1('0x2b')](_[_0x4ad1('0x2c')](_0x96bf92),[_0x4ad1('0x2d'),_0x4ad1('0x2e')]);_0x49dae0=_[_0x4ad1('0x2b')](_[_0x4ad1('0x2c')](_0x96bf92),[_0x4ad1('0x2d'),'updatedAt',_0x4ad1('0x2f'),_0x4ad1('0x30')]);if(_0x72bc47[_0x4ad1('0x26')]['id']){delete _0x72bc47[_0x4ad1('0x26')]['id'];}if(_[_0x4ad1('0x31')](_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x32')])){throw new db[(_0x4ad1('0x33'))][(_0x4ad1('0x29'))](_0x4ad1('0x34'));}if(_[_0x4ad1('0x31')](_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x26')])||_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x26')]===''){throw new db[(_0x4ad1('0x33'))][(_0x4ad1('0x29'))](_0x4ad1('0x35'));}if(_[_0x4ad1('0x31')](_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x36')])){throw new db[(_0x4ad1('0x33'))][(_0x4ad1('0x29'))](_0x4ad1('0x37')+_0x49dae0);}if(!_[_0x4ad1('0x38')](_0x49dae0,_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x36')])){throw new db[(_0x4ad1('0x33'))][(_0x4ad1('0x29'))](_0x4ad1('0x39')+_0x49dae0);}_0x3d826a[_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x36')]]=_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x32')];})[_0x4ad1('0x10')](function(){return db['FaxAccount']['find']({'where':{'id':_0x72bc47[_0x4ad1('0x3a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3d826a,'limit':0x1,'order':[[_0x4ad1('0x2e'),_0x4ad1('0x3b')]]}]},{'model':db[_0x4ad1('0x3c')],'as':'Applications'}]});})[_0x4ad1('0x10')](function(_0x33e596){if(_0x33e596&&_0x33e596[_0x4ad1('0x3d')]){var _0x3895e5=_0x33e596[_0x4ad1('0x3e')]({'plain':!![]});_0x5504b4[_0x4ad1('0x3a')]=_0x3895e5;_0x5504b4[_0x4ad1('0x3f')]=_0x3895e5[_0x4ad1('0x40')];_0x5504b4[_0x4ad1('0x41')]=_0x3895e5[_0x4ad1('0x3d')];_0x5504b4[_0x4ad1('0x3f')]=_[_0x4ad1('0x42')](_0x5504b4['applications'],['priority'],[_0x4ad1('0x43')]);if(_0x5504b4['account'][_0x4ad1('0x40')]){delete _0x5504b4['account']['Applications'];}if(_0x5504b4[_0x4ad1('0x3a')][_0x4ad1('0x3d')]&&_0x5504b4['account'][_0x4ad1('0x3d')][_0x4ad1('0x44')]['length']){return _0x5504b4[_0x4ad1('0x3a')][_0x4ad1('0x3d')][_0x4ad1('0x44')][0x0];}var _0x273306=_['defaults'](_0x72bc47['body'],{'firstName':_0x72bc47['body'][_0x4ad1('0x32')],'ListId':_0x3895e5['ListId']});_0x273306[_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x36')]]=_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x32')];return db[_0x4ad1('0x27')][_0x4ad1('0x45')](_0x273306,{'fields':_0x1d2c03,'raw':!![]});}})[_0x4ad1('0x10')](function(_0x462420){_0x5504b4['contact']=_0x462420;if(_0x462420){var _0x1183c2={'ContactId':_0x462420['id'],'FaxAccountId':_0x72bc47[_0x4ad1('0x3a')]['id'],'fax':_0x462420['fax']};return db[_0x4ad1('0x46')][_0x4ad1('0x47')]({'where':{'ContactId':_0x462420['id'],'closed':![],'FaxAccountId':_0x72bc47['account']['id']}})[_0x4ad1('0x10')](function(_0x1714ab){if(_0x1714ab){return[_0x1714ab,![]];}return db[_0x4ad1('0x46')][_0x4ad1('0x45')](_0x1183c2)['then'](function(_0x204e14){return[_0x204e14,!![]];});});}else{throw new Error(_0x4ad1('0x48'));}})[_0x4ad1('0x49')](function(_0xcacd2d,_0x4efbab){var _0x417636=_0xcacd2d[_0x4ad1('0x3e')]({'plain':!![]});if(_0x4efbab){if(_0x5504b4['account']['autoclose']){_0x5504b4[_0x4ad1('0x3f')][_0x4ad1('0x4a')]({'id':0x0,'priority':_0x5504b4[_0x4ad1('0x3f')]['length']+0x1,'app':_0x4ad1('0x4b'),'appdata':_0x4ad1('0x4c'),'interval':_0x4ad1('0x4d')});}_0x417636[_0x4ad1('0x4e')]=!![];}else{_0x417636[_0x4ad1('0x4e')]=![];}_0x5504b4[_0x4ad1('0x4f')]=_0x417636;return db['FaxMessage'][_0x4ad1('0x45')]({'body':_0x72bc47['body']['body'],'FaxAccountId':_0x72bc47[_0x4ad1('0x3a')]['id'],'FaxInteractionId':_0xcacd2d['id'],'direction':'in','ContactId':_0xcacd2d[_0x4ad1('0x50')],'AttachmentId':_0x72bc47[_0x4ad1('0x26')][_0x4ad1('0x51')]});})[_0x4ad1('0x10')](function(_0xc8367a){_0x5504b4[_0x4ad1('0x18')]=_0xc8367a;if(_0x5504b4['interaction'][_0x4ad1('0x52')]){return db[_0x4ad1('0x53')]['find']({'attributes':['id',_0x4ad1('0x54')],'where':{'id':_0x5504b4['interaction'][_0x4ad1('0x52')]}})[_0x4ad1('0x10')](function(_0x168a61){if(_0x168a61){_0x5504b4[_0x4ad1('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4ad1('0x55'),'appdata':_0x168a61['name']+','+(_0x5504b4['account'][_0x4ad1('0x56')]||0xa),'interval':_0x4ad1('0x4d')});}return respondWithRpcPromise(_0x4ad1('0x57'),'startRouting',_0x5504b4);});}return respondWithRpcPromise(_0x4ad1('0x57'),'startRouting',_0x5504b4);})[_0x4ad1('0x10')](function(_0x4aa885){_0x447504(_0x4aa885);})[_0x4ad1('0x1a')](function(_0x7a9f16){_0x43299d(_0x4ca7d1[_0x4ad1('0x16')](0x1f4,_0x7a9f16[_0x4ad1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 851a904..7239044 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 _0x3ddd=['save','remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x136293,_0x5c52a9){var _0x496210=function(_0x12f1aa){while(--_0x12f1aa){_0x136293['push'](_0x136293['shift']());}};_0x496210(++_0x5c52a9);}(_0x3ddd,0x74));var _0xd3dd=function(_0x486243,_0x4be60c){_0x486243=_0x486243-0x0;var _0x5e47c0=_0x3ddd[_0x486243];return _0x5e47c0;};'use strict';var FaxAccountEvents=require(_0xd3dd('0x0'));var events=[_0xd3dd('0x1'),_0xd3dd('0x2'),_0xd3dd('0x3')];function createListener(_0xa9af71,_0x3e5d9a){return function(_0x27eb7b){_0x3e5d9a[_0xd3dd('0x4')](_0xa9af71,_0x27eb7b);};}function removeListener(_0x26949b,_0x190d3c){return function(){FaxAccountEvents[_0xd3dd('0x5')](_0x26949b,_0x190d3c);};}exports[_0xd3dd('0x6')]=function(_0x3368bd){for(var _0x149ce1=0x0,_0x519570=events[_0xd3dd('0x7')];_0x149ce1<_0x519570;_0x149ce1++){var _0x452c3b=events[_0x149ce1];var _0x2bc6cd=createListener(_0xd3dd('0x8')+_0x452c3b,_0x3368bd);FaxAccountEvents['on'](_0x452c3b,_0x2bc6cd);}}; \ No newline at end of file +var _0x2c6c=['emit','removeListener','faxAccount:','./faxAccount.events','save','update'];(function(_0x5a556a,_0x39b261){var _0x3f6dd5=function(_0x10c23b){while(--_0x10c23b){_0x5a556a['push'](_0x5a556a['shift']());}};_0x3f6dd5(++_0x39b261);}(_0x2c6c,0x159));var _0xc2c6=function(_0x1adda4,_0x3998fb){_0x1adda4=_0x1adda4-0x0;var _0x115486=_0x2c6c[_0x1adda4];return _0x115486;};'use strict';var FaxAccountEvents=require(_0xc2c6('0x0'));var events=[_0xc2c6('0x1'),'remove',_0xc2c6('0x2')];function createListener(_0x2c8032,_0xf1691f){return function(_0x3939eb){_0xf1691f[_0xc2c6('0x3')](_0x2c8032,_0x3939eb);};}function removeListener(_0x2321e3,_0x3461b2){return function(){FaxAccountEvents[_0xc2c6('0x4')](_0x2321e3,_0x3461b2);};}exports['register']=function(_0x39ed57){for(var _0x42684f=0x0,_0xb2b83c=events['length'];_0x42684f<_0xb2b83c;_0x42684f++){var _0x2fdd4f=events[_0x42684f];var _0x188d01=createListener(_0xc2c6('0x5')+_0x2fdd4f,_0x39ed57);FaxAccountEvents['on'](_0x2fdd4f,_0x188d01);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 45c7731..6a9e3b4 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x873bf5,_0x5d4008){var _0x3c0826=function(_0x25df97){while(--_0x25df97){_0x873bf5['push'](_0x873bf5['shift']());}};_0x3c0826(++_0x5d4008);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x151144,_0xa664db){var _0x2526ef=function(_0x99baa6){while(--_0x99baa6){_0x151144['push'](_0x151144['shift']());}};_0x2526ef(++_0xa664db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('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 680323b..aaa28a0 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 _0x614c=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0xe3fd3e,_0x454473){var _0x3faa6b=function(_0x25f9c8){while(--_0x25f9c8){_0xe3fd3e['push'](_0xe3fd3e['shift']());}};_0x3faa6b(++_0x454473);}(_0x614c,0x125));var _0xc614=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x614c[_0x3e7e96];return _0x13f6f0;};'use strict';var Sequelize=require(_0xc614('0x0'));module[_0xc614('0x1')]={'priority':{'type':Sequelize[_0xc614('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc614('0x3')},'appdata':{'type':Sequelize[_0xc614('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc614('0x5')],'defaultValue':_0xc614('0x6')}}; \ No newline at end of file +var _0xc0eb=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3ae25b,_0x84fc3c){var _0x5ddabd=function(_0xa45504){while(--_0xa45504){_0x3ae25b['push'](_0x3ae25b['shift']());}};_0x5ddabd(++_0x84fc3c);}(_0xc0eb,0x169));var _0xbc0e=function(_0xbf414,_0x150f82){_0xbf414=_0xbf414-0x0;var _0x388768=_0xc0eb[_0xbf414];return _0x388768;};'use strict';var Sequelize=require(_0xbc0e('0x0'));module[_0xbc0e('0x1')]={'priority':{'type':Sequelize[_0xbc0e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbc0e('0x3')],'allowNull':![],'defaultValue':_0xbc0e('0x4')},'appdata':{'type':Sequelize[_0xbc0e('0x5')]()},'description':{'type':Sequelize[_0xbc0e('0x3')]},'interval':{'type':Sequelize[_0xbc0e('0x3')],'defaultValue':_0xbc0e('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index ac76067..976acde 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 _0xe80f=['limit','count','set','Content-Range','json','apply','then','destroy','error','name','send','index','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','FaxApplication','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset'];(function(_0x57175f,_0x47f2a4){var _0xd1d63e=function(_0x1ef2b1){while(--_0x1ef2b1){_0x57175f['push'](_0x57175f['shift']());}};_0xd1d63e(++_0x47f2a4);}(_0xe80f,0x154));var _0xfe80=function(_0x3dcf6a,_0xc139a6){_0x3dcf6a=_0x3dcf6a-0x0;var _0x39325c=_0xe80f[_0x3dcf6a];return _0x39325c;};'use strict';var emlformat=require(_0xfe80('0x0'));var rimraf=require(_0xfe80('0x1'));var zipdir=require(_0xfe80('0x2'));var jsonpatch=require(_0xfe80('0x3'));var rp=require(_0xfe80('0x4'));var moment=require('moment');var BPromise=require(_0xfe80('0x5'));var Mustache=require(_0xfe80('0x6'));var util=require('util');var path=require(_0xfe80('0x7'));var sox=require(_0xfe80('0x8'));var csv=require(_0xfe80('0x9'));var ejs=require(_0xfe80('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe80('0xb'));var squel=require(_0xfe80('0xc'));var crypto=require(_0xfe80('0xd'));var jsforce=require(_0xfe80('0xe'));var deskjs=require(_0xfe80('0xf'));var toCsv=require(_0xfe80('0x9'));var querystring=require(_0xfe80('0x10'));var Papa=require(_0xfe80('0x11'));var Redis=require(_0xfe80('0x12'));var authService=require(_0xfe80('0x13'));var qs=require(_0xfe80('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe80('0x15'))(_0xfe80('0x16'));var utils=require(_0xfe80('0x17'));var config=require(_0xfe80('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe80('0x19'))['db'];function respondWithStatusCode(_0x173e41,_0x3b2dd3){_0x3b2dd3=_0x3b2dd3||0xcc;return function(_0x16a6ce){if(_0x16a6ce){return _0x173e41[_0xfe80('0x1a')](_0x3b2dd3);}return _0x173e41['status'](_0x3b2dd3)[_0xfe80('0x1b')]();};}function respondWithResult(_0x2d6087,_0x4b2e19){_0x4b2e19=_0x4b2e19||0xc8;return function(_0xc03432){if(_0xc03432){return _0x2d6087[_0xfe80('0x1c')](_0x4b2e19)['json'](_0xc03432);}};}function respondWithFilteredResult(_0x392201,_0x5edeee){return function(_0x119f16){if(_0x119f16){var _0x1c7a42=typeof _0x5edeee[_0xfe80('0x1d')]==='undefined'&&typeof _0x5edeee[_0xfe80('0x1e')]==='undefined';var _0x52faf9=_0x119f16[_0xfe80('0x1f')];var _0xf2540d=_0x1c7a42?0x0:_0x5edeee[_0xfe80('0x1d')];var _0x17a500=_0x1c7a42?_0x119f16[_0xfe80('0x1f')]:_0x5edeee[_0xfe80('0x1d')]+_0x5edeee['limit'];var _0x5b460e;if(_0x17a500>=_0x52faf9){_0x17a500=_0x52faf9;_0x5b460e=0xc8;}else{_0x5b460e=0xce;}_0x392201[_0xfe80('0x1c')](_0x5b460e);return _0x392201[_0xfe80('0x20')](_0xfe80('0x21'),_0xf2540d+'-'+_0x17a500+'/'+_0x52faf9)[_0xfe80('0x22')](_0x119f16);}return null;};}function patchUpdates(_0x1bb380){return function(_0x5e3e2e){try{jsonpatch[_0xfe80('0x23')](_0x5e3e2e,_0x1bb380,!![]);}catch(_0x19477c){return BPromise['reject'](_0x19477c);}return _0x5e3e2e['save']();};}function saveUpdates(_0x56d054,_0x29066b){return function(_0x3e64f4){if(_0x3e64f4){return _0x3e64f4['update'](_0x56d054)[_0xfe80('0x24')](function(_0xbc112c){return _0xbc112c;});}return null;};}function removeEntity(_0x226153,_0x176697){return function(_0xd2214f){if(_0xd2214f){return _0xd2214f[_0xfe80('0x25')]()['then'](function(){_0x226153[_0xfe80('0x1c')](0xcc)[_0xfe80('0x1b')]();});}};}function handleEntityNotFound(_0x3314cf,_0x3568cd){return function(_0x480e3b){if(!_0x480e3b){_0x3314cf[_0xfe80('0x1a')](0x194);}return _0x480e3b;};}function handleError(_0x22a334,_0xab5229){_0xab5229=_0xab5229||0x1f4;return function(_0x5ba57a){logger[_0xfe80('0x26')](_0x5ba57a['stack']);if(_0x5ba57a[_0xfe80('0x27')]){delete _0x5ba57a[_0xfe80('0x27')];}_0x22a334[_0xfe80('0x1c')](_0xab5229)[_0xfe80('0x28')](_0x5ba57a);};}exports[_0xfe80('0x29')]=function(_0x3ca891,_0x4299b1){var _0x653838={},_0x218792={},_0x3f86bd={'count':0x0,'rows':[]};var _0x3221c9=_[_0xfe80('0x2a')](db['FaxApplication']['rawAttributes'],function(_0x3c3e13){return{'name':_0x3c3e13[_0xfe80('0x2b')],'type':_0x3c3e13[_0xfe80('0x2c')][_0xfe80('0x2d')]};});_0x218792['model']=_[_0xfe80('0x2a')](_0x3221c9,_0xfe80('0x27'));_0x218792[_0xfe80('0x2e')]=_[_0xfe80('0x2f')](_0x3ca891[_0xfe80('0x2e')]);_0x218792['filters']=_[_0xfe80('0x30')](_0x218792[_0xfe80('0x31')],_0x218792['query']);_0x653838[_0xfe80('0x32')]=_[_0xfe80('0x30')](_0x218792[_0xfe80('0x31')],qs[_0xfe80('0x33')](_0x3ca891[_0xfe80('0x2e')][_0xfe80('0x33')]));_0x653838['attributes']=_0x653838[_0xfe80('0x32')][_0xfe80('0x34')]?_0x653838[_0xfe80('0x32')]:_0x218792[_0xfe80('0x31')];if(!_0x3ca891['query'][_0xfe80('0x35')](_0xfe80('0x36'))){_0x653838['limit']=qs[_0xfe80('0x1e')](_0x3ca891['query'][_0xfe80('0x1e')]);_0x653838[_0xfe80('0x1d')]=qs[_0xfe80('0x1d')](_0x3ca891[_0xfe80('0x2e')][_0xfe80('0x1d')]);}_0x653838[_0xfe80('0x37')]=qs['sort'](_0x3ca891['query'][_0xfe80('0x38')]);_0x653838['where']=qs[_0xfe80('0x39')](_[_0xfe80('0x3a')](_0x3ca891[_0xfe80('0x2e')],_0x218792[_0xfe80('0x39')]),_0x3221c9);if(_0x3ca891[_0xfe80('0x2e')][_0xfe80('0x3b')]){_0x653838[_0xfe80('0x3c')]=_[_0xfe80('0x3d')](_0x653838[_0xfe80('0x3c')],{'$or':_[_0xfe80('0x2a')](_0x3221c9,function(_0x56836e){if(_0x56836e[_0xfe80('0x2c')]!==_0xfe80('0x3e')){var _0x203d4f={};_0x203d4f[_0x56836e[_0xfe80('0x27')]]={'$like':'%'+_0x3ca891[_0xfe80('0x2e')][_0xfe80('0x3b')]+'%'};return _0x203d4f;}})});}_0x653838=_[_0xfe80('0x3d')]({},_0x653838,_0x3ca891[_0xfe80('0x3f')]);var _0x283406={'where':_0x653838[_0xfe80('0x3c')]};return db[_0xfe80('0x40')][_0xfe80('0x1f')](_0x283406)[_0xfe80('0x24')](function(_0x36b4c3){_0x3f86bd[_0xfe80('0x1f')]=_0x36b4c3;if(_0x3ca891[_0xfe80('0x2e')][_0xfe80('0x41')]){_0x653838[_0xfe80('0x42')]=[{'all':!![]}];}return db[_0xfe80('0x40')]['findAll'](_0x653838);})['then'](function(_0x3bc0eb){_0x3f86bd[_0xfe80('0x43')]=_0x3bc0eb;return _0x3f86bd;})[_0xfe80('0x24')](respondWithFilteredResult(_0x4299b1,_0x653838))[_0xfe80('0x44')](handleError(_0x4299b1,null));};exports[_0xfe80('0x45')]=function(_0x287f5b,_0x38f17d){var _0x5cb9f7={'raw':!![],'where':{'id':_0x287f5b[_0xfe80('0x46')]['id']}},_0x43fe46={};_0x43fe46[_0xfe80('0x31')]=_[_0xfe80('0x2f')](db[_0xfe80('0x40')]['rawAttributes']);_0x43fe46['query']=_['keys'](_0x287f5b[_0xfe80('0x2e')]);_0x43fe46[_0xfe80('0x39')]=_[_0xfe80('0x30')](_0x43fe46[_0xfe80('0x31')],_0x43fe46[_0xfe80('0x2e')]);_0x5cb9f7[_0xfe80('0x32')]=_[_0xfe80('0x30')](_0x43fe46[_0xfe80('0x31')],qs[_0xfe80('0x33')](_0x287f5b['query'][_0xfe80('0x33')]));_0x5cb9f7[_0xfe80('0x32')]=_0x5cb9f7[_0xfe80('0x32')][_0xfe80('0x34')]?_0x5cb9f7[_0xfe80('0x32')]:_0x43fe46[_0xfe80('0x31')];if(_0x287f5b[_0xfe80('0x2e')][_0xfe80('0x41')]){_0x5cb9f7[_0xfe80('0x42')]=[{'all':!![]}];}_0x5cb9f7=_[_0xfe80('0x3d')]({},_0x5cb9f7,_0x287f5b[_0xfe80('0x3f')]);return db[_0xfe80('0x40')][_0xfe80('0x47')](_0x5cb9f7)['then'](handleEntityNotFound(_0x38f17d,null))['then'](respondWithResult(_0x38f17d,null))[_0xfe80('0x44')](handleError(_0x38f17d,null));};exports[_0xfe80('0x48')]=function(_0x1462b7,_0x543320){return db[_0xfe80('0x40')][_0xfe80('0x48')](_0x1462b7[_0xfe80('0x49')],{})[_0xfe80('0x24')](respondWithResult(_0x543320,0xc9))['catch'](handleError(_0x543320,null));};exports['update']=function(_0x166868,_0x42fe13){if(_0x166868['body']['id']){delete _0x166868[_0xfe80('0x49')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x166868[_0xfe80('0x46')]['id']}})[_0xfe80('0x24')](handleEntityNotFound(_0x42fe13,null))[_0xfe80('0x24')](saveUpdates(_0x166868['body'],null))[_0xfe80('0x24')](respondWithResult(_0x42fe13,null))[_0xfe80('0x44')](handleError(_0x42fe13,null));};exports['destroy']=function(_0x1da6f3,_0x2ba2a3){return db['FaxApplication'][_0xfe80('0x47')]({'where':{'id':_0x1da6f3[_0xfe80('0x46')]['id']}})[_0xfe80('0x24')](handleEntityNotFound(_0x2ba2a3,null))['then'](removeEntity(_0x2ba2a3,null))[_0xfe80('0x44')](handleError(_0x2ba2a3,null));}; \ No newline at end of file +var _0x2682=['send','map','FaxApplication','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','where','merge','filter','options','include','findAll','rows','catch','params','rawAttributes','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','update','destroy','then','sendStatus','error','stack','name'];(function(_0x690188,_0x38c55d){var _0x3d3e52=function(_0x4386b1){while(--_0x4386b1){_0x690188['push'](_0x690188['shift']());}};_0x3d3e52(++_0x38c55d);}(_0x2682,0x1ea));var _0x2268=function(_0x3aed75,_0x3f7844){_0x3aed75=_0x3aed75-0x0;var _0x438e3b=_0x2682[_0x3aed75];return _0x438e3b;};'use strict';var emlformat=require(_0x2268('0x0'));var rimraf=require(_0x2268('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2268('0x2'));var rp=require(_0x2268('0x3'));var moment=require('moment');var BPromise=require(_0x2268('0x4'));var Mustache=require(_0x2268('0x5'));var util=require(_0x2268('0x6'));var path=require(_0x2268('0x7'));var sox=require('sox');var csv=require(_0x2268('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2268('0x9'));var _=require(_0x2268('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2268('0xb'));var deskjs=require(_0x2268('0xc'));var toCsv=require(_0x2268('0x8'));var querystring=require(_0x2268('0xd'));var Papa=require(_0x2268('0xe'));var Redis=require('ioredis');var authService=require(_0x2268('0xf'));var qs=require(_0x2268('0x10'));var as=require(_0x2268('0x11'));var hardwareService=require(_0x2268('0x12'));var logger=require('../../config/logger')(_0x2268('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2268('0x14'));var db=require(_0x2268('0x15'))['db'];function respondWithStatusCode(_0x1fd634,_0x442683){_0x442683=_0x442683||0xcc;return function(_0x518700){if(_0x518700){return _0x1fd634['sendStatus'](_0x442683);}return _0x1fd634[_0x2268('0x16')](_0x442683)[_0x2268('0x17')]();};}function respondWithResult(_0x5f290b,_0x473e67){_0x473e67=_0x473e67||0xc8;return function(_0x532fbb){if(_0x532fbb){return _0x5f290b[_0x2268('0x16')](_0x473e67)[_0x2268('0x18')](_0x532fbb);}};}function respondWithFilteredResult(_0x5de9de,_0xc17d09){return function(_0x357b86){if(_0x357b86){var _0x1d5843=typeof _0xc17d09[_0x2268('0x19')]===_0x2268('0x1a')&&typeof _0xc17d09['limit']===_0x2268('0x1a');var _0x558bfe=_0x357b86['count'];var _0x5bcc1a=_0x1d5843?0x0:_0xc17d09[_0x2268('0x19')];var _0x24ed25=_0x1d5843?_0x357b86[_0x2268('0x1b')]:_0xc17d09['offset']+_0xc17d09[_0x2268('0x1c')];var _0xf23d02;if(_0x24ed25>=_0x558bfe){_0x24ed25=_0x558bfe;_0xf23d02=0xc8;}else{_0xf23d02=0xce;}_0x5de9de['status'](_0xf23d02);return _0x5de9de[_0x2268('0x1d')]('Content-Range',_0x5bcc1a+'-'+_0x24ed25+'/'+_0x558bfe)[_0x2268('0x18')](_0x357b86);}return null;};}function patchUpdates(_0x19c1b0){return function(_0x3a52b1){try{jsonpatch[_0x2268('0x1e')](_0x3a52b1,_0x19c1b0,!![]);}catch(_0x424129){return BPromise['reject'](_0x424129);}return _0x3a52b1['save']();};}function saveUpdates(_0x54474f,_0xbedf70){return function(_0x237096){if(_0x237096){return _0x237096[_0x2268('0x1f')](_0x54474f)['then'](function(_0x3f1f9d){return _0x3f1f9d;});}return null;};}function removeEntity(_0xb22caa,_0x534ba7){return function(_0x5f3001){if(_0x5f3001){return _0x5f3001[_0x2268('0x20')]()[_0x2268('0x21')](function(){_0xb22caa[_0x2268('0x16')](0xcc)[_0x2268('0x17')]();});}};}function handleEntityNotFound(_0x4ad51c,_0x364e66){return function(_0x5eac2a){if(!_0x5eac2a){_0x4ad51c[_0x2268('0x22')](0x194);}return _0x5eac2a;};}function handleError(_0x17ec7e,_0x3a6bcf){_0x3a6bcf=_0x3a6bcf||0x1f4;return function(_0x9e7120){logger[_0x2268('0x23')](_0x9e7120[_0x2268('0x24')]);if(_0x9e7120[_0x2268('0x25')]){delete _0x9e7120[_0x2268('0x25')];}_0x17ec7e[_0x2268('0x16')](_0x3a6bcf)[_0x2268('0x26')](_0x9e7120);};}exports['index']=function(_0x3663c8,_0x26d6cd){var _0x3feaf1={},_0x436c0a={},_0x2b08bf={'count':0x0,'rows':[]};var _0x3e72b6=_[_0x2268('0x27')](db[_0x2268('0x28')]['rawAttributes'],function(_0x43e20e){return{'name':_0x43e20e[_0x2268('0x29')],'type':_0x43e20e[_0x2268('0x2a')]['key']};});_0x436c0a[_0x2268('0x2b')]=_[_0x2268('0x27')](_0x3e72b6,_0x2268('0x25'));_0x436c0a[_0x2268('0x2c')]=_['keys'](_0x3663c8[_0x2268('0x2c')]);_0x436c0a[_0x2268('0x2d')]=_[_0x2268('0x2e')](_0x436c0a[_0x2268('0x2b')],_0x436c0a[_0x2268('0x2c')]);_0x3feaf1[_0x2268('0x2f')]=_[_0x2268('0x2e')](_0x436c0a[_0x2268('0x2b')],qs['fields'](_0x3663c8[_0x2268('0x2c')][_0x2268('0x30')]));_0x3feaf1[_0x2268('0x2f')]=_0x3feaf1['attributes']['length']?_0x3feaf1['attributes']:_0x436c0a[_0x2268('0x2b')];if(!_0x3663c8[_0x2268('0x2c')][_0x2268('0x31')]('nolimit')){_0x3feaf1[_0x2268('0x1c')]=qs[_0x2268('0x1c')](_0x3663c8[_0x2268('0x2c')]['limit']);_0x3feaf1[_0x2268('0x19')]=qs[_0x2268('0x19')](_0x3663c8[_0x2268('0x2c')][_0x2268('0x19')]);}_0x3feaf1[_0x2268('0x32')]=qs['sort'](_0x3663c8[_0x2268('0x2c')]['sort']);_0x3feaf1[_0x2268('0x33')]=qs[_0x2268('0x2d')](_['pick'](_0x3663c8[_0x2268('0x2c')],_0x436c0a[_0x2268('0x2d')]),_0x3e72b6);if(_0x3663c8['query']['filter']){_0x3feaf1[_0x2268('0x33')]=_[_0x2268('0x34')](_0x3feaf1[_0x2268('0x33')],{'$or':_['map'](_0x3e72b6,function(_0x2e2e89){if(_0x2e2e89[_0x2268('0x2a')]!=='VIRTUAL'){var _0x28ecee={};_0x28ecee[_0x2e2e89['name']]={'$like':'%'+_0x3663c8['query'][_0x2268('0x35')]+'%'};return _0x28ecee;}})});}_0x3feaf1=_[_0x2268('0x34')]({},_0x3feaf1,_0x3663c8[_0x2268('0x36')]);var _0x4efe32={'where':_0x3feaf1[_0x2268('0x33')]};return db[_0x2268('0x28')][_0x2268('0x1b')](_0x4efe32)[_0x2268('0x21')](function(_0x5d7514){_0x2b08bf[_0x2268('0x1b')]=_0x5d7514;if(_0x3663c8[_0x2268('0x2c')]['includeAll']){_0x3feaf1[_0x2268('0x37')]=[{'all':!![]}];}return db[_0x2268('0x28')][_0x2268('0x38')](_0x3feaf1);})[_0x2268('0x21')](function(_0x3b5a96){_0x2b08bf[_0x2268('0x39')]=_0x3b5a96;return _0x2b08bf;})[_0x2268('0x21')](respondWithFilteredResult(_0x26d6cd,_0x3feaf1))[_0x2268('0x3a')](handleError(_0x26d6cd,null));};exports['show']=function(_0x117d04,_0x342a0e){var _0x11a3bd={'raw':!![],'where':{'id':_0x117d04[_0x2268('0x3b')]['id']}},_0x16171f={};_0x16171f[_0x2268('0x2b')]=_['keys'](db[_0x2268('0x28')][_0x2268('0x3c')]);_0x16171f[_0x2268('0x2c')]=_[_0x2268('0x3d')](_0x117d04[_0x2268('0x2c')]);_0x16171f[_0x2268('0x2d')]=_[_0x2268('0x2e')](_0x16171f[_0x2268('0x2b')],_0x16171f[_0x2268('0x2c')]);_0x11a3bd[_0x2268('0x2f')]=_[_0x2268('0x2e')](_0x16171f[_0x2268('0x2b')],qs[_0x2268('0x30')](_0x117d04[_0x2268('0x2c')][_0x2268('0x30')]));_0x11a3bd[_0x2268('0x2f')]=_0x11a3bd[_0x2268('0x2f')]['length']?_0x11a3bd['attributes']:_0x16171f['model'];if(_0x117d04['query'][_0x2268('0x3e')]){_0x11a3bd[_0x2268('0x37')]=[{'all':!![]}];}_0x11a3bd=_['merge']({},_0x11a3bd,_0x117d04[_0x2268('0x36')]);return db[_0x2268('0x28')][_0x2268('0x3f')](_0x11a3bd)['then'](handleEntityNotFound(_0x342a0e,null))[_0x2268('0x21')](respondWithResult(_0x342a0e,null))[_0x2268('0x3a')](handleError(_0x342a0e,null));};exports[_0x2268('0x40')]=function(_0x50b278,_0x5f420c){return db[_0x2268('0x28')][_0x2268('0x40')](_0x50b278[_0x2268('0x41')],{})['then'](respondWithResult(_0x5f420c,0xc9))['catch'](handleError(_0x5f420c,null));};exports[_0x2268('0x1f')]=function(_0x239149,_0x446913){if(_0x239149[_0x2268('0x41')]['id']){delete _0x239149[_0x2268('0x41')]['id'];}return db['FaxApplication'][_0x2268('0x3f')]({'where':{'id':_0x239149[_0x2268('0x3b')]['id']}})[_0x2268('0x21')](handleEntityNotFound(_0x446913,null))[_0x2268('0x21')](saveUpdates(_0x239149['body'],null))['then'](respondWithResult(_0x446913,null))[_0x2268('0x3a')](handleError(_0x446913,null));};exports[_0x2268('0x20')]=function(_0x2de184,_0x1d5924){return db[_0x2268('0x28')][_0x2268('0x3f')]({'where':{'id':_0x2de184[_0x2268('0x3b')]['id']}})[_0x2268('0x21')](handleEntityNotFound(_0x1d5924,null))[_0x2268('0x21')](removeEntity(_0x1d5924,null))[_0x2268('0x3a')](handleError(_0x1d5924,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 2fd4ca4..68ccb18 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 _0xa6eb=['moment','../../config/environment','exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0x533ef3,_0x42fc7c){var _0x25ceac=function(_0x462932){while(--_0x462932){_0x533ef3['push'](_0x533ef3['shift']());}};_0x25ceac(++_0x42fc7c);}(_0xa6eb,0x136));var _0xba6e=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0xa6eb[_0x52f159];return _0x156799;};'use strict';var _=require('lodash');var util=require(_0xba6e('0x0'));var logger=require('../../config/logger')(_0xba6e('0x1'));var moment=require(_0xba6e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba6e('0x3'));var attributes=require('./faxApplication.attributes');module[_0xba6e('0x4')]=function(_0x2c3d85,_0x1e8906){return _0x2c3d85['define'](_0xba6e('0x5'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba6e('0x6'),'collate':_0xba6e('0x7')});}; \ No newline at end of file +var _0x9a4f=['path','../../config/environment','./faxApplication.attributes','exports','fax_applications','util','../../config/logger','api','bluebird'];(function(_0x10f5ea,_0xeb348a){var _0x5c4f0f=function(_0x3644db){while(--_0x3644db){_0x10f5ea['push'](_0x10f5ea['shift']());}};_0x5c4f0f(++_0xeb348a);}(_0x9a4f,0x12e));var _0xf9a4=function(_0xee741b,_0x10cf16){_0xee741b=_0xee741b-0x0;var _0x9ce0a2=_0x9a4f[_0xee741b];return _0x9ce0a2;};'use strict';var _=require('lodash');var util=require(_0xf9a4('0x0'));var logger=require(_0xf9a4('0x1'))(_0xf9a4('0x2'));var moment=require('moment');var BPromise=require(_0xf9a4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9a4('0x4'));var rimraf=require('rimraf');var config=require(_0xf9a4('0x5'));var attributes=require(_0xf9a4('0x6'));module[_0xf9a4('0x7')]=function(_0x2e7bc7,_0x48f3c6){return _0x2e7bc7['define']('FaxApplication',attributes,{'tableName':_0xf9a4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9833ec5..7b722b4 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 _0x9c50=['code','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','update','body','options','raw','where','limit','bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2c9427,_0x331c7b){var _0x1b6dc8=function(_0x2b6bb0){while(--_0x2b6bb0){_0x2c9427['push'](_0x2c9427['shift']());}};_0x1b6dc8(++_0x331c7b);}(_0x9c50,0xec));var _0x09c5=function(_0x1c46e8,_0x4947b5){_0x1c46e8=_0x1c46e8-0x0;var _0x29fb65=_0x9c50[_0x1c46e8];return _0x29fb65;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x09c5('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09c5('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x09c5('0x2'))(_0x09c5('0x3'));var config=require('../../config/environment');var jayson=require(_0x09c5('0x4'));var client=jayson['client'][_0x09c5('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2830e5,_0x1f068b,_0x51ff47){return new BPromise(function(_0x27d297,_0x2ca015){return client[_0x09c5('0x6')](_0x2830e5,_0x51ff47)[_0x09c5('0x7')](function(_0x4a8703){logger[_0x09c5('0x8')]('FaxApplication,\x20%s,\x20%s',_0x1f068b,'request\x20sent');logger[_0x09c5('0x9')](_0x09c5('0xa'),_0x1f068b,_0x09c5('0xb'),JSON[_0x09c5('0xc')](_0x4a8703));if(_0x4a8703['error']){if(_0x4a8703[_0x09c5('0xd')][_0x09c5('0xe')]===0x1f4){logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x4a8703[_0x09c5('0xd')][_0x09c5('0x10')]);return _0x2ca015(_0x4a8703['error']['message']);}logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x4a8703[_0x09c5('0xd')][_0x09c5('0x10')]);return _0x27d297(_0x4a8703['error']['message']);}else{logger[_0x09c5('0x8')]('FaxApplication,\x20%s,\x20%s',_0x1f068b,'request\x20sent');_0x27d297(_0x4a8703['result'][_0x09c5('0x10')]);}})[_0x09c5('0x11')](function(_0x3d160f){logger[_0x09c5('0xd')](_0x09c5('0xf'),_0x1f068b,_0x3d160f);_0x2ca015(_0x3d160f);});});}exports[_0x09c5('0x12')]=function(_0x1040b1){var _0x3207f2=this;return new Promise(function(_0x38e59e,_0x436db2){return db['FaxApplication'][_0x09c5('0x13')](_0x1040b1[_0x09c5('0x14')],{'raw':_0x1040b1[_0x09c5('0x15')]?_0x1040b1[_0x09c5('0x15')][_0x09c5('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1040b1['options']?_0x1040b1[_0x09c5('0x15')][_0x09c5('0x17')]||null:null,'attributes':_0x1040b1[_0x09c5('0x15')]?_0x1040b1[_0x09c5('0x15')]['attributes']||null:null,'limit':_0x1040b1['options']?_0x1040b1[_0x09c5('0x15')][_0x09c5('0x18')]||null:null})[_0x09c5('0x7')](function(_0x4afc49){logger[_0x09c5('0x8')](_0x09c5('0x12'),_0x1040b1);logger[_0x09c5('0x9')](_0x09c5('0x12'),_0x1040b1,JSON['stringify'](_0x4afc49));_0x38e59e(_0x4afc49);})[_0x09c5('0x11')](function(_0x47e704){logger[_0x09c5('0xd')](_0x09c5('0x12'),_0x47e704[_0x09c5('0x10')],_0x1040b1);_0x436db2(_0x3207f2[_0x09c5('0xd')](0x1f4,_0x47e704['message']));});});}; \ No newline at end of file +var _0x4bce=['raw','where','limit','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','UpdateFaxApplication','FaxApplication','update','body','options'];(function(_0xc510c5,_0xece57d){var _0x7b45c7=function(_0x2cf214){while(--_0x2cf214){_0xc510c5['push'](_0xc510c5['shift']());}};_0x7b45c7(++_0xece57d);}(_0x4bce,0x1e5));var _0xe4bc=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0x4bce[_0x4d2f00];return _0x2d7b7f;};'use strict';var _=require(_0xe4bc('0x0'));var util=require(_0xe4bc('0x1'));var moment=require(_0xe4bc('0x2'));var BPromise=require(_0xe4bc('0x3'));var rs=require(_0xe4bc('0x4'));var fs=require('fs');var Redis=require(_0xe4bc('0x5'));var db=require(_0xe4bc('0x6'))['db'];var utils=require(_0xe4bc('0x7'));var logger=require(_0xe4bc('0x8'))(_0xe4bc('0x9'));var config=require('../../config/environment');var jayson=require(_0xe4bc('0xa'));var client=jayson[_0xe4bc('0xb')][_0xe4bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf6e45b,_0x3c4b09,_0x18b07f){return new BPromise(function(_0x3f05fb,_0x41ef07){return client[_0xe4bc('0xd')](_0xf6e45b,_0x18b07f)['then'](function(_0x31d5b1){logger[_0xe4bc('0xe')](_0xe4bc('0xf'),_0x3c4b09,'request\x20sent');logger[_0xe4bc('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3c4b09,_0xe4bc('0x11'),JSON[_0xe4bc('0x12')](_0x31d5b1));if(_0x31d5b1[_0xe4bc('0x13')]){if(_0x31d5b1['error'][_0xe4bc('0x14')]===0x1f4){logger[_0xe4bc('0x13')](_0xe4bc('0xf'),_0x3c4b09,_0x31d5b1[_0xe4bc('0x13')][_0xe4bc('0x15')]);return _0x41ef07(_0x31d5b1['error'][_0xe4bc('0x15')]);}logger[_0xe4bc('0x13')](_0xe4bc('0xf'),_0x3c4b09,_0x31d5b1[_0xe4bc('0x13')]['message']);return _0x3f05fb(_0x31d5b1[_0xe4bc('0x13')][_0xe4bc('0x15')]);}else{logger[_0xe4bc('0xe')](_0xe4bc('0xf'),_0x3c4b09,_0xe4bc('0x11'));_0x3f05fb(_0x31d5b1['result'][_0xe4bc('0x15')]);}})['catch'](function(_0x65343e){logger[_0xe4bc('0x13')](_0xe4bc('0xf'),_0x3c4b09,_0x65343e);_0x41ef07(_0x65343e);});});}exports[_0xe4bc('0x16')]=function(_0x532b47){var _0x33930f=this;return new Promise(function(_0xbec858,_0x2b86b2){return db[_0xe4bc('0x17')][_0xe4bc('0x18')](_0x532b47[_0xe4bc('0x19')],{'raw':_0x532b47[_0xe4bc('0x1a')]?_0x532b47[_0xe4bc('0x1a')][_0xe4bc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x532b47[_0xe4bc('0x1a')]?_0x532b47[_0xe4bc('0x1a')][_0xe4bc('0x1c')]||null:null,'attributes':_0x532b47[_0xe4bc('0x1a')]?_0x532b47[_0xe4bc('0x1a')]['attributes']||null:null,'limit':_0x532b47[_0xe4bc('0x1a')]?_0x532b47['options'][_0xe4bc('0x1d')]||null:null})[_0xe4bc('0x1e')](function(_0x4792ea){logger[_0xe4bc('0xe')]('UpdateFaxApplication',_0x532b47);logger[_0xe4bc('0x10')]('UpdateFaxApplication',_0x532b47,JSON[_0xe4bc('0x12')](_0x4792ea));_0xbec858(_0x4792ea);})[_0xe4bc('0x1f')](function(_0x27d069){logger[_0xe4bc('0x13')](_0xe4bc('0x16'),_0x27d069[_0xe4bc('0x15')],_0x532b47);_0x2b86b2(_0x33930f[_0xe4bc('0x13')](0x1f4,_0x27d069['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d13ae22..6c491a1 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 _0xef0f=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0xef0f,0x168));var _0xfef0=function(_0x7f4e54,_0x1650ab){_0x7f4e54=_0x7f4e54-0x0;var _0x23276c=_0xef0f[_0x7f4e54];return _0x23276c;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['post']('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xd')]);router[_0xfef0('0xe')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xf')]);router[_0xfef0('0x10')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x11')]);module[_0xfef0('0x12')]=router; \ No newline at end of file +var _0xe605=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x52a678,_0x4c73f4){var _0x1b2ba6=function(_0x230caa){while(--_0x230caa){_0x52a678['push'](_0x52a678['shift']());}};_0x1b2ba6(++_0x4c73f4);}(_0xe605,0x92));var _0x5e60=function(_0x15082,_0x3b215f){_0x15082=_0x15082-0x0;var _0xf489e2=_0xe605[_0x15082];return _0xf489e2;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x5e60('0xd')]);router[_0x5e60('0xe')](_0x5e60('0xf'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x10')]);router[_0x5e60('0x11')]('/:id',auth[_0x5e60('0xb')](),controller['destroy']);module[_0x5e60('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9c68424..ae93d53 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 _0x963b=['out','ENUM','exports','BOOLEAN','DATE','STRING'];(function(_0x4fbc90,_0x5a5a7e){var _0x3b90db=function(_0x3c68e3){while(--_0x3c68e3){_0x4fbc90['push'](_0x4fbc90['shift']());}};_0x3b90db(++_0x5a5a7e);}(_0x963b,0x1e2));var _0xb963=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x963b[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require('sequelize');module[_0xb963('0x0')]={'closed':{'type':Sequelize[_0xb963('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb963('0x2')]},'disposition':{'type':Sequelize[_0xb963('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb963('0x3')]},'note':{'type':Sequelize[_0xb963('0x3')]},'read1stAt':{'type':Sequelize[_0xb963('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb963('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb963('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xb963('0x5')]('in',_0xb963('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xbcee=['DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbcee,0xfa));var _0xebce=function(_0x1259b1,_0x52b693){_0x1259b1=_0x1259b1-0x0;var _0x23c88e=_0xbcee[_0x1259b1];return _0x23c88e;};'use strict';var Sequelize=require(_0xebce('0x0'));module[_0xebce('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xebce('0x2')]},'disposition':{'type':Sequelize[_0xebce('0x3')]},'secondDisposition':{'type':Sequelize[_0xebce('0x3')]},'thirdDisposition':{'type':Sequelize[_0xebce('0x3')]},'note':{'type':Sequelize[_0xebce('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xebce('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xebce('0x4')]('in',_0xebce('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xebce('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xebce('0x4')]('in',_0xebce('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 316831d..ff37f4b 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 _0x3770=['json','offset','count','set','update','then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','catch','show','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','hasOwnProperty','limit','order','sort','pick','where','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','emit','removeTags','download','toString','root','files','tmp','join','attachments','format','push','Attachment','Messages','createdAt','get','mkdirSync','createReadStream','pipe','createWriteStream','basename','resolve','log','err','unlinkSync','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end'];(function(_0x10c844,_0x4b98f4){var _0x19bb51=function(_0x1ec550){while(--_0x1ec550){_0x10c844['push'](_0x10c844['shift']());}};_0x19bb51(++_0x4b98f4);}(_0x3770,0x124));var _0x0377=function(_0x13eb85,_0x28c349){_0x13eb85=_0x13eb85-0x0;var _0x4cfacf=_0x3770[_0x13eb85];return _0x4cfacf;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x0377('0x0'));var moment=require(_0x0377('0x1'));var BPromise=require('bluebird');var util=require(_0x0377('0x2'));var path=require(_0x0377('0x3'));var fs=require('fs');var _=require(_0x0377('0x4'));var Redis=require(_0x0377('0x5'));var interaction=require(_0x0377('0x6'));var qs=require(_0x0377('0x7'));var logger=require('../../config/logger')(_0x0377('0x8'));var config=require(_0x0377('0x9'));var db=require(_0x0377('0xa'))['db'];config[_0x0377('0xb')]=_[_0x0377('0xc')](config[_0x0377('0xb')],{'host':_0x0377('0xd'),'port':0x18eb});var socket=require(_0x0377('0xe'))(new Redis(config['redis']));require(_0x0377('0xf'))[_0x0377('0x10')](socket);function respondWithStatusCode(_0x12415d,_0x172d43){_0x172d43=_0x172d43||0xcc;return function(_0x4cf518){if(_0x4cf518){return _0x12415d[_0x0377('0x11')](_0x172d43);}return _0x12415d[_0x0377('0x12')](_0x172d43)[_0x0377('0x13')]();};}function respondWithResult(_0x14d911,_0x48bf40){_0x48bf40=_0x48bf40||0xc8;return function(_0x3edb05){if(_0x3edb05){return _0x14d911[_0x0377('0x12')](_0x48bf40)[_0x0377('0x14')](_0x3edb05);}};}function respondWithFilteredResult(_0x981b31,_0x799b3f){return function(_0x497ffc){if(_0x497ffc){var _0x4a9776=typeof _0x799b3f[_0x0377('0x15')]==='undefined'&&typeof _0x799b3f['limit']==='undefined';var _0x482cd2=_0x497ffc[_0x0377('0x16')];var _0xb9e6e9=_0x4a9776?0x0:_0x799b3f[_0x0377('0x15')];var _0x7bee3b=_0x4a9776?_0x497ffc[_0x0377('0x16')]:_0x799b3f[_0x0377('0x15')]+_0x799b3f['limit'];var _0x69b7fa;if(_0x7bee3b>=_0x482cd2){_0x7bee3b=_0x482cd2;_0x69b7fa=0xc8;}else{_0x69b7fa=0xce;}_0x981b31['status'](_0x69b7fa);return _0x981b31[_0x0377('0x17')]('Content-Range',_0xb9e6e9+'-'+_0x7bee3b+'/'+_0x482cd2)['json'](_0x497ffc);}return null;};}function saveUpdates(_0x262a2d){return function(_0x3807b5){if(_0x3807b5){return _0x3807b5[_0x0377('0x18')](_0x262a2d)[_0x0377('0x19')](function(_0x27f9ae){return _0x27f9ae;});}return null;};}function removeEntity(_0x3bc896){return function(_0x3afa9d){if(_0x3afa9d){return _0x3afa9d[_0x0377('0x1a')]()[_0x0377('0x19')](function(){_0x3bc896[_0x0377('0x12')](0xcc)[_0x0377('0x13')]();});}};}function handleEntityNotFound(_0x48907c){return function(_0x952b5d){if(!_0x952b5d){_0x48907c[_0x0377('0x11')](0x194);}return _0x952b5d;};}function handleError(_0x3b44c9,_0x3050fd){_0x3050fd=_0x3050fd||0x1f4;return function(_0x1178f9){logger[_0x0377('0x1b')](_0x1178f9[_0x0377('0x1c')]);if(_0x1178f9[_0x0377('0x1d')]){delete _0x1178f9[_0x0377('0x1d')];}_0x3b44c9['status'](_0x3050fd)[_0x0377('0x1e')](_0x1178f9);};}exports[_0x0377('0x1f')]=function(_0x3444ce,_0x348ec5){var _0x2f3320={};var _0x138760=_[_0x0377('0x20')](db[_0x0377('0x21')][_0x0377('0x22')],function(_0x31dedb){return{'name':_0x31dedb[_0x0377('0x23')],'type':_0x31dedb[_0x0377('0x24')][_0x0377('0x25')]};});_0x2f3320=qs[_0x0377('0x26')](_0x138760,_0x3444ce);return interaction[_0x0377('0x27')]('fax',_0x3444ce[_0x0377('0x28')],_0x3444ce['user'],_0x2f3320,_0x138760)[_0x0377('0x19')](respondWithFilteredResult(_0x348ec5,_0x2f3320))[_0x0377('0x29')](handleError(_0x348ec5,null));};exports[_0x0377('0x2a')]=function(_0x1f73f4,_0x1812b4){var _0x4f65a4={'raw':![],'where':{'id':_0x1f73f4[_0x0377('0x2b')]['id']}},_0x2d78a6={};_0x2d78a6[_0x0377('0x2c')]=_[_0x0377('0x2d')](db[_0x0377('0x21')][_0x0377('0x22')]);_0x2d78a6[_0x0377('0x28')]=_[_0x0377('0x2d')](_0x1f73f4[_0x0377('0x28')]);_0x2d78a6[_0x0377('0x2e')]=_[_0x0377('0x2f')](_0x2d78a6[_0x0377('0x2c')],_0x2d78a6[_0x0377('0x28')]);_0x4f65a4[_0x0377('0x30')]=_[_0x0377('0x2f')](_0x2d78a6[_0x0377('0x2c')],qs['fields'](_0x1f73f4[_0x0377('0x28')][_0x0377('0x31')]));_0x4f65a4[_0x0377('0x30')]=_0x4f65a4[_0x0377('0x30')][_0x0377('0x32')]?_0x4f65a4[_0x0377('0x30')]:_0x2d78a6[_0x0377('0x2c')];if(_0x1f73f4['query']['includeAll']){_0x4f65a4[_0x0377('0x33')]=[{'all':!![]}];}_0x4f65a4=_[_0x0377('0x34')]({},_0x4f65a4,_0x1f73f4[_0x0377('0x35')]);return db[_0x0377('0x21')][_0x0377('0x36')](_0x4f65a4)[_0x0377('0x19')](handleEntityNotFound(_0x1812b4,null))[_0x0377('0x19')](respondWithResult(_0x1812b4,null))[_0x0377('0x29')](handleError(_0x1812b4,null));};exports[_0x0377('0x37')]=function(_0x11ec97,_0x876c89){return db[_0x0377('0x21')][_0x0377('0x37')](_0x11ec97['body'],{})[_0x0377('0x19')](respondWithResult(_0x876c89,0xc9))['catch'](handleError(_0x876c89,null));};exports[_0x0377('0x18')]=function(_0x3f7751,_0x2602d2){if(_0x3f7751[_0x0377('0x38')]['id']){delete _0x3f7751[_0x0377('0x38')]['id'];}return db[_0x0377('0x21')][_0x0377('0x36')]({'where':{'id':_0x3f7751['params']['id']}})['then'](handleEntityNotFound(_0x2602d2,null))[_0x0377('0x19')](saveUpdates(_0x3f7751[_0x0377('0x38')],null))['then'](respondWithResult(_0x2602d2,null))['catch'](handleError(_0x2602d2,null));};exports[_0x0377('0x1a')]=function(_0x6551d4,_0x2bc15c){return db[_0x0377('0x21')][_0x0377('0x36')]({'where':{'id':_0x6551d4[_0x0377('0x2b')]['id']}})[_0x0377('0x19')](handleEntityNotFound(_0x2bc15c,null))[_0x0377('0x19')](removeEntity(_0x2bc15c,null))[_0x0377('0x29')](handleError(_0x2bc15c,null));};exports[_0x0377('0x39')]=function(_0x3b3ae6,_0x12f10f){return db[_0x0377('0x21')][_0x0377('0x39')]()['then'](respondWithResult(_0x12f10f,null))['catch'](handleError(_0x12f10f,null));};exports[_0x0377('0x3a')]=function(_0xaed1cf,_0x23e814){return db[_0x0377('0x3b')][_0x0377('0x36')]({'where':{'id':_0xaed1cf['params']['id']}})['then'](handleEntityNotFound(_0x23e814,null))[_0x0377('0x19')](function(_0x2eca7e){if(_0x2eca7e){return _0x2eca7e['addMessage'](_0xaed1cf[_0x0377('0x38')][_0x0377('0x3c')],_[_0x0377('0x3d')](_0xaed1cf[_0x0377('0x38')],['ids','id'])||{});}})[_0x0377('0x19')](respondWithResult(_0x23e814,null))[_0x0377('0x29')](handleError(_0x23e814,null));};exports[_0x0377('0x3e')]=function(_0x546cf0,_0x157b66){var _0x2dd05d={'raw':![],'where':{}};var _0x40c900={};var _0x6f7950={'count':0x0,'rows':[]};return db[_0x0377('0x21')]['findOne']({'where':{'id':_0x546cf0[_0x0377('0x2b')]['id']}})[_0x0377('0x19')](handleEntityNotFound(_0x157b66,null))[_0x0377('0x19')](function(_0x1bcd0b){if(_0x1bcd0b){_0x40c900[_0x0377('0x2c')]=_[_0x0377('0x2d')](db[_0x0377('0x3b')]['rawAttributes']);_0x40c900['query']=_[_0x0377('0x2d')](_0x546cf0['query']);_0x40c900[_0x0377('0x2e')]=_[_0x0377('0x2f')](_0x40c900[_0x0377('0x2c')],_0x40c900['query']);_0x2dd05d['attributes']=_[_0x0377('0x2f')](_0x40c900[_0x0377('0x2c')],qs[_0x0377('0x31')](_0x546cf0[_0x0377('0x28')][_0x0377('0x31')]));_0x2dd05d[_0x0377('0x30')]=_0x2dd05d[_0x0377('0x30')][_0x0377('0x32')]?_0x2dd05d[_0x0377('0x30')]:_0x40c900[_0x0377('0x2c')];if(!_0x546cf0[_0x0377('0x28')][_0x0377('0x3f')]('nolimit')){_0x2dd05d[_0x0377('0x40')]=qs['limit'](_0x546cf0[_0x0377('0x28')][_0x0377('0x40')]);_0x2dd05d[_0x0377('0x15')]=qs['offset'](_0x546cf0['query']['offset']);}_0x2dd05d[_0x0377('0x41')]=qs[_0x0377('0x42')](_0x546cf0[_0x0377('0x28')]['sort']);_0x2dd05d['where']=qs[_0x0377('0x2e')](_[_0x0377('0x43')](_0x546cf0[_0x0377('0x28')],_0x40c900[_0x0377('0x2e')]));_0x2dd05d[_0x0377('0x44')][_0x0377('0x45')]=_0x1bcd0b['id'];if(_0x546cf0['query'][_0x0377('0x46')]){_0x2dd05d[_0x0377('0x44')]=_[_0x0377('0x34')](_0x2dd05d[_0x0377('0x44')],{'$or':_['map'](_0x2dd05d[_0x0377('0x30')],function(_0x45e2b6){var _0x1b6fec={};_0x1b6fec[_0x45e2b6]={'$like':'%'+_0x546cf0[_0x0377('0x28')][_0x0377('0x46')]+'%'};return _0x1b6fec;})});}if(_0x546cf0[_0x0377('0x28')][_0x0377('0x47')]){var _0x416698=_0x546cf0['query'][_0x0377('0x47')][_0x0377('0x48')](',');var _0x401576={};_0x401576[_0x416698[0x0]]={'$gte':moment(_0x416698[0x1])['format'](_0x0377('0x49'))};_0x2dd05d[_0x0377('0x44')]=_[_0x0377('0x34')](_0x2dd05d[_0x0377('0x44')],_0x401576);}_0x2dd05d=_[_0x0377('0x34')]({},_0x2dd05d,_0x546cf0[_0x0377('0x35')]);return db['FaxMessage'][_0x0377('0x16')]({'where':_0x2dd05d[_0x0377('0x44')]})[_0x0377('0x19')](function(_0x4f520c){_0x6f7950['count']=_0x4f520c;if(_0x546cf0[_0x0377('0x28')][_0x0377('0x4a')]){_0x2dd05d['include']=[{'all':!![]}];}return db[_0x0377('0x3b')]['findAll'](_0x2dd05d);})[_0x0377('0x19')](function(_0x43da9f){_0x6f7950[_0x0377('0x4b')]=_0x43da9f;return _0x6f7950;});}})['then'](respondWithFilteredResult(_0x157b66,_0x2dd05d))[_0x0377('0x29')](handleError(_0x157b66,null));};exports[_0x0377('0x4c')]=function(_0x11b6c2,_0x1ff131){return db[_0x0377('0x21')][_0x0377('0x36')]({'where':{'id':_0x11b6c2[_0x0377('0x2b')]['id']}})[_0x0377('0x19')](handleEntityNotFound(_0x1ff131,null))[_0x0377('0x19')](function(_0x42ca33){if(_0x42ca33){return _0x42ca33[_0x0377('0x4d')](_0x11b6c2[_0x0377('0x38')][_0x0377('0x3c')],_['omit'](_0x11b6c2[_0x0377('0x38')],[_0x0377('0x3c'),'id'])||{})[_0x0377('0x4e')](function(){return db[_0x0377('0x4f')][_0x0377('0x27')]({'attributes':['id',_0x0377('0x1d'),'color'],'where':{'id':_0x11b6c2['body']['ids']}});})[_0x0377('0x19')](function(_0x1a1013){socket[_0x0377('0x50')]('faxInteractionTags:save',{'id':Number(_0x11b6c2[_0x0377('0x2b')]['id']),'tags':_0x1a1013||[]});return{'id':Number(_0x11b6c2['params']['id']),'tags':_0x1a1013||[]};});}})['then'](respondWithResult(_0x1ff131,null))['catch'](handleError(_0x1ff131,null));};exports['removeTags']=function(_0x222661,_0x3e3de2){return db[_0x0377('0x21')][_0x0377('0x36')]({'where':{'id':_0x222661['params']['id']}})[_0x0377('0x19')](handleEntityNotFound(_0x3e3de2,null))[_0x0377('0x19')](function(_0x3e948a){if(_0x3e948a){return _0x3e948a[_0x0377('0x51')](_0x222661[_0x0377('0x28')][_0x0377('0x3c')]);}})[_0x0377('0x19')](respondWithStatusCode(_0x3e3de2,null))[_0x0377('0x29')](handleError(_0x3e3de2,null));};exports[_0x0377('0x52')]=function(_0x5a9201,_0x4a48f3){var _0xc6757a=moment()['unix']()[_0x0377('0x53')]();var _0x55b4b2=path['join'](config[_0x0377('0x54')],'server',_0x0377('0x55'),_0x0377('0x56'));var _0x40298f=path[_0x0377('0x57')](config[_0x0377('0x54')],'server',_0x0377('0x55'),_0x0377('0x58'));var _0x2ec58b=path[_0x0377('0x57')](_0x55b4b2,_0xc6757a);var _0x4b1a58=util[_0x0377('0x59')]('transcript-%d-%s.zip',_0x5a9201['params']['id'],_0xc6757a);var _0xc35a7c=path[_0x0377('0x57')](_0x55b4b2,_0x4b1a58);var _0x1b0444=[];_0x1b0444[_0x0377('0x5a')]({'model':db[_0x0377('0x5b')],'as':'Attachment','raw':!![]});var _0x59f96c=[{'model':db[_0x0377('0x3b')],'as':_0x0377('0x5c'),'attributes':['id',_0x0377('0x38'),_0x0377('0x5d')],'include':_0x1b0444}];return db[_0x0377('0x21')]['find']({'where':{'id':_0x5a9201['params']['id']},'include':_0x59f96c})[_0x0377('0x19')](handleEntityNotFound(_0x4a48f3,null))[_0x0377('0x19')](function(_0x1d419d){if(_0x1d419d&&_0x1d419d[_0x0377('0x5c')]){var _0x2055e2=_0x1d419d[_0x0377('0x5e')]({'plain':!![]});fs[_0x0377('0x5f')](_0x2ec58b);for(var _0x5a6911=0x0;_0x5a6911<_0x2055e2['Messages'][_0x0377('0x32')];_0x5a6911++){var _0x5d5958=_0x2055e2[_0x0377('0x5c')][_0x5a6911][_0x0377('0x5b')];if(_0x5d5958){var _0x36d4c9=path[_0x0377('0x57')](_0x40298f,_0x5d5958['basename']);if(fs['existsSync'](_0x36d4c9)){fs[_0x0377('0x60')](_0x36d4c9)[_0x0377('0x61')](fs[_0x0377('0x62')](path[_0x0377('0x57')](_0x2ec58b,_0x5d5958[_0x0377('0x63')])));}}}return BPromise[_0x0377('0x64')]()[_0x0377('0x19')](function(){return new BPromise(function(_0x1bdd2f,_0x383dc9){zipdir(_0x2ec58b,{'saveTo':_0xc35a7c},function(_0x402795,_0xdab51d){if(_0x402795)return _0x383dc9(_0x402795);return _0x1bdd2f(_0xdab51d);});})[_0x0377('0x19')](function(){return new BPromise(function(_0x33a934,_0x5b67d1){rimraf(_0x2ec58b,function(_0x1401b7){if(_0x1401b7)_0x5b67d1(_0x1401b7);return _0x33a934();});});})[_0x0377('0x19')](function(){return _0x4a48f3['download'](_0xc35a7c,_0x4b1a58,function(_0x25bc06){if(_0x25bc06){console[_0x0377('0x65')](_0x0377('0x66'),_0x25bc06);}else{fs[_0x0377('0x67')](_0xc35a7c);}});});});}else{return _0x4a48f3[_0x0377('0x11')](0xc8);}})[_0x0377('0x29')](handleError(_0x4a48f3,null));}; \ No newline at end of file +var _0x8885=['fieldName','type','key','findAll','fax','user','catch','params','keys','query','model','attributes','intersection','fields','length','includeAll','include','merge','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','filters','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','color','emit','removeTags','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','download','err','rimraf','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','update','then','error','stack','name','send','map','FaxInteraction','rawAttributes'];(function(_0x39397a,_0x43fe11){var _0x4377ba=function(_0xa02798){while(--_0xa02798){_0x39397a['push'](_0x39397a['shift']());}};_0x4377ba(++_0x43fe11);}(_0x8885,0xad));var _0x5888=function(_0x535c39,_0xfcfe16){_0x535c39=_0x535c39-0x0;var _0x46b1f3=_0x8885[_0x535c39];return _0x46b1f3;};'use strict';var rimraf=require(_0x5888('0x0'));var zipdir=require(_0x5888('0x1'));var moment=require(_0x5888('0x2'));var BPromise=require(_0x5888('0x3'));var util=require('util');var path=require(_0x5888('0x4'));var fs=require('fs');var _=require(_0x5888('0x5'));var Redis=require(_0x5888('0x6'));var interaction=require(_0x5888('0x7'));var qs=require(_0x5888('0x8'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x5888('0x9'))['db'];config[_0x5888('0xa')]=_[_0x5888('0xb')](config[_0x5888('0xa')],{'host':_0x5888('0xc'),'port':0x18eb});var socket=require(_0x5888('0xd'))(new Redis(config[_0x5888('0xa')]));require('./faxInteraction.socket')[_0x5888('0xe')](socket);function respondWithStatusCode(_0x233354,_0x4ec684){_0x4ec684=_0x4ec684||0xcc;return function(_0x1b2706){if(_0x1b2706){return _0x233354[_0x5888('0xf')](_0x4ec684);}return _0x233354[_0x5888('0x10')](_0x4ec684)[_0x5888('0x11')]();};}function respondWithResult(_0x18f571,_0x4a96cf){_0x4a96cf=_0x4a96cf||0xc8;return function(_0x14a896){if(_0x14a896){return _0x18f571['status'](_0x4a96cf)[_0x5888('0x12')](_0x14a896);}};}function respondWithFilteredResult(_0x56c656,_0x451cde){return function(_0x3d4a21){if(_0x3d4a21){var _0x8dc02c=typeof _0x451cde['offset']===_0x5888('0x13')&&typeof _0x451cde[_0x5888('0x14')]===_0x5888('0x13');var _0x3c6bbf=_0x3d4a21[_0x5888('0x15')];var _0x417933=_0x8dc02c?0x0:_0x451cde['offset'];var _0x25c87e=_0x8dc02c?_0x3d4a21[_0x5888('0x15')]:_0x451cde[_0x5888('0x16')]+_0x451cde[_0x5888('0x14')];var _0x42299e;if(_0x25c87e>=_0x3c6bbf){_0x25c87e=_0x3c6bbf;_0x42299e=0xc8;}else{_0x42299e=0xce;}_0x56c656[_0x5888('0x10')](_0x42299e);return _0x56c656[_0x5888('0x17')]('Content-Range',_0x417933+'-'+_0x25c87e+'/'+_0x3c6bbf)[_0x5888('0x12')](_0x3d4a21);}return null;};}function saveUpdates(_0x5167f4){return function(_0xd0f578){if(_0xd0f578){return _0xd0f578[_0x5888('0x18')](_0x5167f4)[_0x5888('0x19')](function(_0x3f54f9){return _0x3f54f9;});}return null;};}function removeEntity(_0x297986){return function(_0x1b8305){if(_0x1b8305){return _0x1b8305['destroy']()[_0x5888('0x19')](function(){_0x297986[_0x5888('0x10')](0xcc)[_0x5888('0x11')]();});}};}function handleEntityNotFound(_0x42f18b){return function(_0x397ed6){if(!_0x397ed6){_0x42f18b['sendStatus'](0x194);}return _0x397ed6;};}function handleError(_0x5ec7b6,_0x527974){_0x527974=_0x527974||0x1f4;return function(_0x562b89){logger[_0x5888('0x1a')](_0x562b89[_0x5888('0x1b')]);if(_0x562b89['name']){delete _0x562b89[_0x5888('0x1c')];}_0x5ec7b6['status'](_0x527974)[_0x5888('0x1d')](_0x562b89);};}exports['index']=function(_0x297cdd,_0x4f6b1f){var _0x470737={};var _0x315b5a=_[_0x5888('0x1e')](db[_0x5888('0x1f')][_0x5888('0x20')],function(_0x2b698c){return{'name':_0x2b698c[_0x5888('0x21')],'type':_0x2b698c[_0x5888('0x22')][_0x5888('0x23')]};});_0x470737=qs['getOptions'](_0x315b5a,_0x297cdd);return interaction[_0x5888('0x24')](_0x5888('0x25'),_0x297cdd['query'],_0x297cdd[_0x5888('0x26')],_0x470737,_0x315b5a)[_0x5888('0x19')](respondWithFilteredResult(_0x4f6b1f,_0x470737))[_0x5888('0x27')](handleError(_0x4f6b1f,null));};exports['show']=function(_0x3dbc18,_0x4735d6){var _0x120ce8={'raw':![],'where':{'id':_0x3dbc18[_0x5888('0x28')]['id']}},_0x378dc6={};_0x378dc6['model']=_['keys'](db['FaxInteraction'][_0x5888('0x20')]);_0x378dc6['query']=_[_0x5888('0x29')](_0x3dbc18[_0x5888('0x2a')]);_0x378dc6['filters']=_['intersection'](_0x378dc6[_0x5888('0x2b')],_0x378dc6[_0x5888('0x2a')]);_0x120ce8[_0x5888('0x2c')]=_[_0x5888('0x2d')](_0x378dc6['model'],qs[_0x5888('0x2e')](_0x3dbc18[_0x5888('0x2a')][_0x5888('0x2e')]));_0x120ce8['attributes']=_0x120ce8[_0x5888('0x2c')][_0x5888('0x2f')]?_0x120ce8['attributes']:_0x378dc6[_0x5888('0x2b')];if(_0x3dbc18[_0x5888('0x2a')][_0x5888('0x30')]){_0x120ce8[_0x5888('0x31')]=[{'all':!![]}];}_0x120ce8=_[_0x5888('0x32')]({},_0x120ce8,_0x3dbc18['options']);return db[_0x5888('0x1f')][_0x5888('0x33')](_0x120ce8)[_0x5888('0x19')](handleEntityNotFound(_0x4735d6,null))[_0x5888('0x19')](respondWithResult(_0x4735d6,null))[_0x5888('0x27')](handleError(_0x4735d6,null));};exports[_0x5888('0x34')]=function(_0x4a5e0c,_0x5f0404){return db[_0x5888('0x1f')][_0x5888('0x34')](_0x4a5e0c['body'],{})[_0x5888('0x19')](respondWithResult(_0x5f0404,0xc9))['catch'](handleError(_0x5f0404,null));};exports['update']=function(_0xf6166f,_0x1a0b39){if(_0xf6166f[_0x5888('0x35')]['id']){delete _0xf6166f[_0x5888('0x35')]['id'];}return db[_0x5888('0x1f')][_0x5888('0x33')]({'where':{'id':_0xf6166f['params']['id']}})['then'](handleEntityNotFound(_0x1a0b39,null))['then'](saveUpdates(_0xf6166f[_0x5888('0x35')],null))[_0x5888('0x19')](respondWithResult(_0x1a0b39,null))[_0x5888('0x27')](handleError(_0x1a0b39,null));};exports['destroy']=function(_0x489b40,_0x2c1ad5){return db[_0x5888('0x1f')]['find']({'where':{'id':_0x489b40['params']['id']}})[_0x5888('0x19')](handleEntityNotFound(_0x2c1ad5,null))[_0x5888('0x19')](removeEntity(_0x2c1ad5,null))[_0x5888('0x27')](handleError(_0x2c1ad5,null));};exports[_0x5888('0x36')]=function(_0x50055d,_0x5734df){return db[_0x5888('0x1f')]['describe']()['then'](respondWithResult(_0x5734df,null))[_0x5888('0x27')](handleError(_0x5734df,null));};exports[_0x5888('0x37')]=function(_0x2b8181,_0x50b833){return db[_0x5888('0x38')][_0x5888('0x33')]({'where':{'id':_0x2b8181[_0x5888('0x28')]['id']}})['then'](handleEntityNotFound(_0x50b833,null))[_0x5888('0x19')](function(_0x578987){if(_0x578987){return _0x578987[_0x5888('0x37')](_0x2b8181[_0x5888('0x35')][_0x5888('0x39')],_[_0x5888('0x3a')](_0x2b8181[_0x5888('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x50b833,null))[_0x5888('0x27')](handleError(_0x50b833,null));};exports[_0x5888('0x3b')]=function(_0x31ecde,_0x2c241a){var _0x259300={'raw':![],'where':{}};var _0x3c2693={};var _0x2dec9e={'count':0x0,'rows':[]};return db[_0x5888('0x1f')][_0x5888('0x3c')]({'where':{'id':_0x31ecde[_0x5888('0x28')]['id']}})[_0x5888('0x19')](handleEntityNotFound(_0x2c241a,null))[_0x5888('0x19')](function(_0x52507d){if(_0x52507d){_0x3c2693[_0x5888('0x2b')]=_['keys'](db[_0x5888('0x38')][_0x5888('0x20')]);_0x3c2693[_0x5888('0x2a')]=_['keys'](_0x31ecde[_0x5888('0x2a')]);_0x3c2693['filters']=_[_0x5888('0x2d')](_0x3c2693[_0x5888('0x2b')],_0x3c2693['query']);_0x259300[_0x5888('0x2c')]=_[_0x5888('0x2d')](_0x3c2693[_0x5888('0x2b')],qs[_0x5888('0x2e')](_0x31ecde[_0x5888('0x2a')][_0x5888('0x2e')]));_0x259300[_0x5888('0x2c')]=_0x259300[_0x5888('0x2c')][_0x5888('0x2f')]?_0x259300[_0x5888('0x2c')]:_0x3c2693[_0x5888('0x2b')];if(!_0x31ecde[_0x5888('0x2a')][_0x5888('0x3d')](_0x5888('0x3e'))){_0x259300[_0x5888('0x14')]=qs[_0x5888('0x14')](_0x31ecde[_0x5888('0x2a')][_0x5888('0x14')]);_0x259300[_0x5888('0x16')]=qs[_0x5888('0x16')](_0x31ecde[_0x5888('0x2a')][_0x5888('0x16')]);}_0x259300[_0x5888('0x3f')]=qs['sort'](_0x31ecde['query'][_0x5888('0x40')]);_0x259300[_0x5888('0x41')]=qs[_0x5888('0x42')](_['pick'](_0x31ecde[_0x5888('0x2a')],_0x3c2693[_0x5888('0x42')]));_0x259300['where'][_0x5888('0x43')]=_0x52507d['id'];if(_0x31ecde[_0x5888('0x2a')][_0x5888('0x44')]){_0x259300['where']=_['merge'](_0x259300[_0x5888('0x41')],{'$or':_['map'](_0x259300[_0x5888('0x2c')],function(_0x24df96){var _0x59f10d={};_0x59f10d[_0x24df96]={'$like':'%'+_0x31ecde[_0x5888('0x2a')]['filter']+'%'};return _0x59f10d;})});}if(_0x31ecde[_0x5888('0x2a')][_0x5888('0x45')]){var _0x34a77b=_0x31ecde[_0x5888('0x2a')][_0x5888('0x45')][_0x5888('0x46')](',');var _0xa294e2={};_0xa294e2[_0x34a77b[0x0]]={'$gte':moment(_0x34a77b[0x1])['format'](_0x5888('0x47'))};_0x259300[_0x5888('0x41')]=_[_0x5888('0x32')](_0x259300['where'],_0xa294e2);}_0x259300=_['merge']({},_0x259300,_0x31ecde[_0x5888('0x48')]);return db['FaxMessage'][_0x5888('0x15')]({'where':_0x259300[_0x5888('0x41')]})['then'](function(_0x547198){_0x2dec9e[_0x5888('0x15')]=_0x547198;if(_0x31ecde[_0x5888('0x2a')]['includeAll']){_0x259300[_0x5888('0x31')]=[{'all':!![]}];}return db[_0x5888('0x38')][_0x5888('0x24')](_0x259300);})['then'](function(_0x5d1fcf){_0x2dec9e[_0x5888('0x49')]=_0x5d1fcf;return _0x2dec9e;});}})['then'](respondWithFilteredResult(_0x2c241a,_0x259300))['catch'](handleError(_0x2c241a,null));};exports[_0x5888('0x4a')]=function(_0x3dcce8,_0x53eaa7){return db[_0x5888('0x1f')][_0x5888('0x33')]({'where':{'id':_0x3dcce8[_0x5888('0x28')]['id']}})['then'](handleEntityNotFound(_0x53eaa7,null))[_0x5888('0x19')](function(_0x1cfeec){if(_0x1cfeec){return _0x1cfeec[_0x5888('0x4b')](_0x3dcce8[_0x5888('0x35')][_0x5888('0x39')],_[_0x5888('0x3a')](_0x3dcce8['body'],[_0x5888('0x39'),'id'])||{})[_0x5888('0x4c')](function(){return db['Tag'][_0x5888('0x24')]({'attributes':['id','name',_0x5888('0x4d')],'where':{'id':_0x3dcce8['body'][_0x5888('0x39')]}});})['then'](function(_0x52e0bd){socket[_0x5888('0x4e')]('faxInteractionTags:save',{'id':Number(_0x3dcce8['params']['id']),'tags':_0x52e0bd||[]});return{'id':Number(_0x3dcce8[_0x5888('0x28')]['id']),'tags':_0x52e0bd||[]};});}})[_0x5888('0x19')](respondWithResult(_0x53eaa7,null))[_0x5888('0x27')](handleError(_0x53eaa7,null));};exports[_0x5888('0x4f')]=function(_0x4c0e07,_0x3af76d){return db[_0x5888('0x1f')]['find']({'where':{'id':_0x4c0e07['params']['id']}})[_0x5888('0x19')](handleEntityNotFound(_0x3af76d,null))['then'](function(_0xe4b4d3){if(_0xe4b4d3){return _0xe4b4d3[_0x5888('0x4f')](_0x4c0e07[_0x5888('0x2a')][_0x5888('0x39')]);}})['then'](respondWithStatusCode(_0x3af76d,null))[_0x5888('0x27')](handleError(_0x3af76d,null));};exports['download']=function(_0x5173aa,_0x4f73ab){var _0x25c759=moment()[_0x5888('0x50')]()[_0x5888('0x51')]();var _0x26a863=path[_0x5888('0x52')](config[_0x5888('0x53')],_0x5888('0x54'),_0x5888('0x55'),_0x5888('0x56'));var _0x43c5f4=path[_0x5888('0x52')](config[_0x5888('0x53')],_0x5888('0x54'),_0x5888('0x55'),_0x5888('0x57'));var _0x105665=path['join'](_0x26a863,_0x25c759);var _0x164684=util[_0x5888('0x58')](_0x5888('0x59'),_0x5173aa['params']['id'],_0x25c759);var _0x4fd84b=path[_0x5888('0x52')](_0x26a863,_0x164684);var _0x2b986e=[];_0x2b986e[_0x5888('0x5a')]({'model':db[_0x5888('0x5b')],'as':_0x5888('0x5b'),'raw':!![]});var _0x4a14d7=[{'model':db[_0x5888('0x38')],'as':_0x5888('0x5c'),'attributes':['id',_0x5888('0x35'),_0x5888('0x5d')],'include':_0x2b986e}];return db['FaxInteraction'][_0x5888('0x33')]({'where':{'id':_0x5173aa[_0x5888('0x28')]['id']},'include':_0x4a14d7})[_0x5888('0x19')](handleEntityNotFound(_0x4f73ab,null))['then'](function(_0x3c83ea){if(_0x3c83ea&&_0x3c83ea['Messages']){var _0x197396=_0x3c83ea[_0x5888('0x5e')]({'plain':!![]});fs['mkdirSync'](_0x105665);for(var _0x5665d4=0x0;_0x5665d4<_0x197396[_0x5888('0x5c')][_0x5888('0x2f')];_0x5665d4++){var _0xdf1122=_0x197396[_0x5888('0x5c')][_0x5665d4][_0x5888('0x5b')];if(_0xdf1122){var _0x217d62=path[_0x5888('0x52')](_0x43c5f4,_0xdf1122[_0x5888('0x5f')]);if(fs[_0x5888('0x60')](_0x217d62)){fs[_0x5888('0x61')](_0x217d62)[_0x5888('0x62')](fs[_0x5888('0x63')](path['join'](_0x105665,_0xdf1122[_0x5888('0x5f')])));}}}return BPromise[_0x5888('0x64')]()[_0x5888('0x19')](function(){return new BPromise(function(_0x4b37ad,_0x5de855){zipdir(_0x105665,{'saveTo':_0x4fd84b},function(_0x59a120,_0x485e86){if(_0x59a120)return _0x5de855(_0x59a120);return _0x4b37ad(_0x485e86);});})[_0x5888('0x19')](function(){return new BPromise(function(_0x27f58e,_0x544c9a){rimraf(_0x105665,function(_0x4af43d){if(_0x4af43d)_0x544c9a(_0x4af43d);return _0x27f58e();});});})['then'](function(){return _0x4f73ab[_0x5888('0x65')](_0x4fd84b,_0x164684,function(_0x741a25){if(_0x741a25){console['log'](_0x5888('0x66'),_0x741a25);}else{fs['unlinkSync'](_0x4fd84b);}});});});}else{return _0x4f73ab[_0x5888('0xf')](0xc8);}})['catch'](handleError(_0x4f73ab,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index aa94fca..b45421f 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 _0x151f=['FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hook','exports','events','../../mysqldb','FaxInteraction'];(function(_0x325190,_0x2d994a){var _0x5f3292=function(_0x54fa49){while(--_0x54fa49){_0x325190['push'](_0x325190['shift']());}};_0x5f3292(++_0x2d994a);}(_0x151f,0x11d));var _0xf151=function(_0x10ee51,_0x393d9b){_0x10ee51=_0x10ee51-0x0;var _0x5ab46d=_0x151f[_0x10ee51];return _0x5ab46d;};'use strict';var EventEmitter=require(_0xf151('0x0'));var FaxInteraction=require(_0xf151('0x1'))['db'][_0xf151('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xf151('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf151('0x4')](0x0);var events={'afterCreate':_0xf151('0x5'),'afterUpdate':_0xf151('0x6'),'afterDestroy':_0xf151('0x7')};function emitEvent(_0x1dd84b){return function(_0xe5dbec,_0x2269c8,_0x18972f){_0xe5dbec[_0xf151('0x8')]({'attributes':['id'],'raw':!![]})[_0xf151('0x9')](function(_0x4647fc){_0xe5dbec[_0xf151('0xa')](_0xf151('0xb'),_0x4647fc[_0xf151('0xc')](function(_0x209fda){return{'id':_0x209fda['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xe5dbec['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x37d010){_0xe5dbec[_0xf151('0xa')](_0xf151('0xd'),_0x37d010[_0xf151('0xe')]);FaxInteractionEvents['emit'](_0x1dd84b+':'+_0xe5dbec['id'],_0xe5dbec);FaxInteractionEvents[_0xf151('0xf')](_0x1dd84b,_0xe5dbec);_0x18972f(null);})['catch'](_0x18972f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xf151('0x10')](e,emitEvent(event));}}module[_0xf151('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x854b=['hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch'];(function(_0x5729c3,_0x2c3755){var _0x1478b1=function(_0x1a85ba){while(--_0x1a85ba){_0x5729c3['push'](_0x5729c3['shift']());}};_0x1478b1(++_0x2c3755);}(_0x854b,0x147));var _0xb854=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x854b[_0x2d7f0e];return _0x110b07;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xb854('0x0'))['db'][_0xb854('0x1')];var FaxMessage=require(_0xb854('0x0'))['db'][_0xb854('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb854('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb854('0x4'),'afterDestroy':_0xb854('0x5')};function emitEvent(_0x56424f){return function(_0x10f9c9,_0x5697ca,_0xcb1ef8){_0x10f9c9[_0xb854('0x6')]({'attributes':['id'],'raw':!![]})[_0xb854('0x7')](function(_0x135e85){_0x10f9c9[_0xb854('0x8')](_0xb854('0x9'),_0x135e85[_0xb854('0xa')](function(_0x3638c9){return{'id':_0x3638c9['id']};}));return FaxMessage[_0xb854('0xb')]({'where':{'FaxInteractionId':_0x10f9c9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb854('0x7')](function(_0x2222db){_0x10f9c9[_0xb854('0x8')](_0xb854('0xc'),_0x2222db['length']);FaxInteractionEvents['emit'](_0x56424f+':'+_0x10f9c9['id'],_0x10f9c9);FaxInteractionEvents[_0xb854('0xd')](_0x56424f,_0x10f9c9);_0xcb1ef8(null);})[_0xb854('0xe')](_0xcb1ef8(null));};}for(var e in events){if(events[_0xb854('0xf')](e)){var event=events[e];FaxInteraction[_0xb854('0x10')](e,emitEvent(event));}}module[_0xb854('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 998c61d..2ca3299 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 _0x7997=['define','FaxInteraction','fax_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7997,0xca));var _0x7799=function(_0x4b59e4,_0x4b331d){_0x4b59e4=_0x4b59e4-0x0;var _0x4b0c50=_0x7997[_0x4b59e4];return _0x4b0c50;};'use strict';var _=require('lodash');var util=require(_0x7799('0x0'));var logger=require('../../config/logger')(_0x7799('0x1'));var moment=require(_0x7799('0x2'));var BPromise=require(_0x7799('0x3'));var rp=require(_0x7799('0x4'));var fs=require('fs');var path=require(_0x7799('0x5'));var rimraf=require(_0x7799('0x6'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x7799('0x7')]=function(_0x150b8b,_0x3f08dc){return _0x150b8b[_0x7799('0x8')](_0x7799('0x9'),attributes,{'tableName':_0x7799('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4583f8,_0xa95339,_0x5c3bff){if(_0x4583f8[_0x7799('0xb')]('closed')){_0x4583f8[_0x7799('0xc')]=moment()['format'](_0x7799('0xd'));}_0x5c3bff(null,_0x4583f8);}}});}; \ No newline at end of file +var _0xd5f9=['closed','format','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed'];(function(_0x5eb29d,_0x3c0e8d){var _0xfd1784=function(_0x2aa6f6){while(--_0x2aa6f6){_0x5eb29d['push'](_0x5eb29d['shift']());}};_0xfd1784(++_0x3c0e8d);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xd5f9[_0x1c9c24];return _0x349c69;};'use strict';var _=require(_0x9d5f('0x0'));var util=require(_0x9d5f('0x1'));var logger=require(_0x9d5f('0x2'))(_0x9d5f('0x3'));var moment=require('moment');var BPromise=require(_0x9d5f('0x4'));var rp=require(_0x9d5f('0x5'));var fs=require('fs');var path=require(_0x9d5f('0x6'));var rimraf=require(_0x9d5f('0x7'));var config=require(_0x9d5f('0x8'));var attributes=require(_0x9d5f('0x9'));module['exports']=function(_0x546c04,_0x58edae){return _0x546c04[_0x9d5f('0xa')](_0x9d5f('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x402a35,_0x255389,_0x4bb4a2){if(_0x402a35[_0x9d5f('0xc')](_0x9d5f('0xd'))){_0x402a35['closedAt']=moment()[_0x9d5f('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4bb4a2(null,_0x402a35);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 25f5a37..831cb83 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 _0x5c26=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','raw','options','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b34bf,_0x5861ed){var _0x51caf2=function(_0x20d386){while(--_0x20d386){_0x4b34bf['push'](_0x4b34bf['shift']());}};_0x51caf2(++_0x5861ed);}(_0x5c26,0x134));var _0x65c2=function(_0x9db90e,_0x197142){_0x9db90e=_0x9db90e-0x0;var _0x322389=_0x5c26[_0x9db90e];return _0x322389;};'use strict';var _=require(_0x65c2('0x0'));var util=require(_0x65c2('0x1'));var moment=require(_0x65c2('0x2'));var BPromise=require(_0x65c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65c2('0x4'));var db=require(_0x65c2('0x5'))['db'];var utils=require(_0x65c2('0x6'));var logger=require(_0x65c2('0x7'))(_0x65c2('0x8'));var config=require(_0x65c2('0x9'));var jayson=require(_0x65c2('0xa'));var client=jayson[_0x65c2('0xb')][_0x65c2('0xc')]({'port':0x232a});config['redis']=_[_0x65c2('0xd')](config[_0x65c2('0xe')],{'host':_0x65c2('0xf'),'port':0x18eb});var socket=require(_0x65c2('0x10'))(new Redis(config[_0x65c2('0xe')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x505a74,_0x1a3c7c,_0x55db19){return new BPromise(function(_0xf22e01,_0x36a03a){return client[_0x65c2('0x11')](_0x505a74,_0x55db19)[_0x65c2('0x12')](function(_0x1bd1fc){logger[_0x65c2('0x13')](_0x65c2('0x14'),_0x1a3c7c,'request\x20sent');logger[_0x65c2('0x15')](_0x65c2('0x16'),_0x1a3c7c,_0x65c2('0x17'),JSON[_0x65c2('0x18')](_0x1bd1fc));if(_0x1bd1fc[_0x65c2('0x19')]){if(_0x1bd1fc['error'][_0x65c2('0x1a')]===0x1f4){logger[_0x65c2('0x19')](_0x65c2('0x14'),_0x1a3c7c,_0x1bd1fc[_0x65c2('0x19')][_0x65c2('0x1b')]);return _0x36a03a(_0x1bd1fc[_0x65c2('0x19')][_0x65c2('0x1b')]);}logger[_0x65c2('0x19')](_0x65c2('0x14'),_0x1a3c7c,_0x1bd1fc['error']['message']);return _0xf22e01(_0x1bd1fc[_0x65c2('0x19')][_0x65c2('0x1b')]);}else{logger[_0x65c2('0x13')](_0x65c2('0x14'),_0x1a3c7c,_0x65c2('0x17'));_0xf22e01(_0x1bd1fc['result'][_0x65c2('0x1b')]);}})[_0x65c2('0x1c')](function(_0x4c4636){logger['error'](_0x65c2('0x14'),_0x1a3c7c,_0x4c4636);_0x36a03a(_0x4c4636);});});}exports[_0x65c2('0x1d')]=function(_0x8864a7){var _0x382c90=this;return new Promise(function(_0x5e267e,_0x3f6b6a){return db[_0x65c2('0x1e')][_0x65c2('0x1f')](_0x8864a7[_0x65c2('0x20')],{'raw':_0x8864a7['options']?_0x8864a7['options'][_0x65c2('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8864a7[_0x65c2('0x22')]?_0x8864a7['options'][_0x65c2('0x23')]||null:null,'attributes':_0x8864a7[_0x65c2('0x22')]?_0x8864a7[_0x65c2('0x22')][_0x65c2('0x24')]||null:null,'limit':_0x8864a7[_0x65c2('0x22')]?_0x8864a7[_0x65c2('0x22')][_0x65c2('0x25')]||null:null})[_0x65c2('0x12')](function(_0x2e73bc){logger[_0x65c2('0x13')](_0x65c2('0x1d'),_0x8864a7);logger[_0x65c2('0x15')]('UpdateFaxInteraction',_0x8864a7,JSON[_0x65c2('0x18')](_0x2e73bc));_0x5e267e(_0x2e73bc);})['catch'](function(_0x4a0b37){logger[_0x65c2('0x19')]('UpdateFaxInteraction',_0x4a0b37[_0x65c2('0x1b')],_0x8864a7);_0x3f6b6a(_0x382c90[_0x65c2('0x19')](0x1f4,_0x4a0b37[_0x65c2('0x1b')]));});});};exports[_0x65c2('0x26')]=function(_0x276932){return new Promise(function(_0x3bacbe,_0x5cf1ab){return db['FaxInteraction'][_0x65c2('0x27')]({'where':_0x276932[_0x65c2('0x22')]?_0x276932[_0x65c2('0x22')][_0x65c2('0x23')]||null:null})['then'](function(_0x26a350){if(_0x26a350){return _0x26a350[_0x65c2('0x28')](_0x276932['body'][_0x65c2('0x29')],_[_0x65c2('0x2a')](_0x276932[_0x65c2('0x20')],[_0x65c2('0x29'),'id'])||{});}})[_0x65c2('0x2b')](function(_0x59f7cd){logger[_0x65c2('0x13')](_0x65c2('0x2c'),_0x276932);logger[_0x65c2('0x15')]('AddTags',_0x276932,JSON['stringify'](_0x59f7cd));_0x3bacbe(_0x59f7cd);})[_0x65c2('0x1c')](function(_0x22205b){logger[_0x65c2('0x19')](_0x65c2('0x2c'),_0x22205b[_0x65c2('0x1b')],_0x276932);_0x5cf1ab(_this[_0x65c2('0x19')](0x1f4,_0x22205b[_0x65c2('0x1b')]));});});}; \ No newline at end of file +var _0xe60e=['../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','FaxInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','ioredis'];(function(_0x1e8779,_0x287a0b){var _0x52378e=function(_0x22d28e){while(--_0x22d28e){_0x1e8779['push'](_0x1e8779['shift']());}};_0x52378e(++_0x287a0b);}(_0xe60e,0x1d0));var _0xee60=function(_0x13ef33,_0xeef600){_0x13ef33=_0x13ef33-0x0;var _0x3bd624=_0xe60e[_0x13ef33];return _0x3bd624;};'use strict';var _=require(_0xee60('0x0'));var util=require(_0xee60('0x1'));var moment=require(_0xee60('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee60('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xee60('0x4'));var logger=require('../../config/logger')(_0xee60('0x5'));var config=require('../../config/environment');var jayson=require(_0xee60('0x6'));var client=jayson[_0xee60('0x7')][_0xee60('0x8')]({'port':0x232a});config[_0xee60('0x9')]=_[_0xee60('0xa')](config[_0xee60('0x9')],{'host':_0xee60('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xee60('0xc'))['register'](socket);function respondWithRpcPromise(_0x3cdd5f,_0x197b1f,_0xd76016){return new BPromise(function(_0x2b1ec2,_0x441036){return client[_0xee60('0xd')](_0x3cdd5f,_0xd76016)[_0xee60('0xe')](function(_0x17b9cb){logger['info'](_0xee60('0xf'),_0x197b1f,_0xee60('0x10'));logger[_0xee60('0x11')](_0xee60('0x12'),_0x197b1f,_0xee60('0x10'),JSON[_0xee60('0x13')](_0x17b9cb));if(_0x17b9cb[_0xee60('0x14')]){if(_0x17b9cb['error'][_0xee60('0x15')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x197b1f,_0x17b9cb[_0xee60('0x14')][_0xee60('0x16')]);return _0x441036(_0x17b9cb[_0xee60('0x14')][_0xee60('0x16')]);}logger[_0xee60('0x14')](_0xee60('0xf'),_0x197b1f,_0x17b9cb[_0xee60('0x14')][_0xee60('0x16')]);return _0x2b1ec2(_0x17b9cb[_0xee60('0x14')][_0xee60('0x16')]);}else{logger[_0xee60('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x197b1f,'request\x20sent');_0x2b1ec2(_0x17b9cb['result'][_0xee60('0x16')]);}})[_0xee60('0x18')](function(_0x46f1c3){logger[_0xee60('0x14')](_0xee60('0xf'),_0x197b1f,_0x46f1c3);_0x441036(_0x46f1c3);});});}exports[_0xee60('0x19')]=function(_0x37c7e7){var _0x3bb2ad=this;return new Promise(function(_0x40e3fd,_0x40e80e){return db['FaxInteraction'][_0xee60('0x1a')](_0x37c7e7[_0xee60('0x1b')],{'raw':_0x37c7e7[_0xee60('0x1c')]?_0x37c7e7[_0xee60('0x1c')][_0xee60('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37c7e7['options']?_0x37c7e7['options'][_0xee60('0x1e')]||null:null,'attributes':_0x37c7e7[_0xee60('0x1c')]?_0x37c7e7[_0xee60('0x1c')][_0xee60('0x1f')]||null:null,'limit':_0x37c7e7[_0xee60('0x1c')]?_0x37c7e7[_0xee60('0x1c')]['limit']||null:null})[_0xee60('0xe')](function(_0x160151){logger[_0xee60('0x17')](_0xee60('0x19'),_0x37c7e7);logger['debug'](_0xee60('0x19'),_0x37c7e7,JSON[_0xee60('0x13')](_0x160151));_0x40e3fd(_0x160151);})[_0xee60('0x18')](function(_0x514d4e){logger['error'](_0xee60('0x19'),_0x514d4e[_0xee60('0x16')],_0x37c7e7);_0x40e80e(_0x3bb2ad[_0xee60('0x14')](0x1f4,_0x514d4e['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x12b878){return new Promise(function(_0x1d1704,_0x133d4e){return db[_0xee60('0x20')][_0xee60('0x21')]({'where':_0x12b878[_0xee60('0x1c')]?_0x12b878['options'][_0xee60('0x1e')]||null:null})['then'](function(_0x403734){if(_0x403734){return _0x403734[_0xee60('0x22')](_0x12b878[_0xee60('0x1b')]['ids'],_[_0xee60('0x23')](_0x12b878['body'],[_0xee60('0x24'),'id'])||{});}})[_0xee60('0x25')](function(_0x42ee86){logger[_0xee60('0x17')](_0xee60('0x26'),_0x12b878);logger[_0xee60('0x11')](_0xee60('0x26'),_0x12b878,JSON[_0xee60('0x13')](_0x42ee86));_0x1d1704(_0x42ee86);})[_0xee60('0x18')](function(_0x1a74c4){logger[_0xee60('0x14')](_0xee60('0x26'),_0x1a74c4[_0xee60('0x16')],_0x12b878);_0x133d4e(_this[_0xee60('0x14')](0x1f4,_0x1a74c4[_0xee60('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 727f93a..9be2db8 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 _0x07aa=['removeListener','register','faxInteraction:','./faxInteraction.events','update','emit'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x07aa,0x153));var _0xa07a=function(_0x1c48d2,_0x5ef574){_0x1c48d2=_0x1c48d2-0x0;var _0x25ec4a=_0x07aa[_0x1c48d2];return _0x25ec4a;};'use strict';var FaxInteractionEvents=require(_0xa07a('0x0'));var events=['save','remove',_0xa07a('0x1')];function createListener(_0x4fb814,_0xddd718){return function(_0x278a10){_0xddd718[_0xa07a('0x2')](_0x4fb814,_0x278a10);};}function removeListener(_0x4ffb8b,_0x18d3b1){return function(){FaxInteractionEvents[_0xa07a('0x3')](_0x4ffb8b,_0x18d3b1);};}exports[_0xa07a('0x4')]=function(_0x43b48c){for(var _0x1619ec=0x0,_0x4d212a=events['length'];_0x1619ec<_0x4d212a;_0x1619ec++){var _0x2c357d=events[_0x1619ec];var _0x1fd21d=createListener(_0xa07a('0x5')+_0x2c357d,_0x43b48c);FaxInteractionEvents['on'](_0x2c357d,_0x1fd21d);}}; \ No newline at end of file +var _0x2b89=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x2b89,0x126));var _0x92b8=function(_0x226e70,_0x529df0){_0x226e70=_0x226e70-0x0;var _0x342b95=_0x2b89[_0x226e70];return _0x342b95;};'use strict';var FaxInteractionEvents=require(_0x92b8('0x0'));var events=[_0x92b8('0x1'),_0x92b8('0x2'),_0x92b8('0x3')];function createListener(_0x4d2fda,_0x2eb8c9){return function(_0x1ddeab){_0x2eb8c9[_0x92b8('0x4')](_0x4d2fda,_0x1ddeab);};}function removeListener(_0x37cb89,_0x77e7c9){return function(){FaxInteractionEvents[_0x92b8('0x5')](_0x37cb89,_0x77e7c9);};}exports[_0x92b8('0x6')]=function(_0x22fcac){for(var _0x56a156=0x0,_0x19f2b9=events[_0x92b8('0x7')];_0x56a156<_0x19f2b9;_0x56a156++){var _0x1bda0f=events[_0x56a156];var _0x2423c1=createListener(_0x92b8('0x8')+_0x1bda0f,_0x22fcac);FaxInteractionEvents['on'](_0x1bda0f,_0x2423c1);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index fe8d4a1..2e214a4 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 _0x665a=['index','/describe','isAuthenticated','describe','show','getMessages','post','/:id/messages','/:id/tags','tracked','fax','addTags','faxinteraction:update','update','delete','/:id','faxinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0x665a,0xbc));var _0xa665=function(_0x23c99f,_0x3c46e8){_0x23c99f=_0x23c99f-0x0;var _0x424726=_0x665a[_0x23c99f];return _0x424726;};'use strict';var multer=require('multer');var util=require(_0xa665('0x0'));var path=require('path');var timeout=require(_0xa665('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa665('0x2'));var auth=require(_0xa665('0x3'));var interaction=require(_0xa665('0x4'));var config=require(_0xa665('0x5'));var controller=require(_0xa665('0x6'));router[_0xa665('0x7')]('/',auth['isAuthenticated'](),controller[_0xa665('0x8')]);router[_0xa665('0x7')](_0xa665('0x9'),auth[_0xa665('0xa')](),controller[_0xa665('0xb')]);router[_0xa665('0x7')]('/:id',auth[_0xa665('0xa')](),controller[_0xa665('0xc')]);router[_0xa665('0x7')]('/:id/messages',auth[_0xa665('0xa')](),controller[_0xa665('0xd')]);router[_0xa665('0x7')]('/:id/download',auth[_0xa665('0xa')](),controller['download']);router[_0xa665('0xe')]('/',auth[_0xa665('0xa')](),controller['create']);router['post'](_0xa665('0xf'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0xa665('0x10'),auth[_0xa665('0xa')](),interaction[_0xa665('0x11')](_0xa665('0x12'),'faxinteraction:addtags'),controller[_0xa665('0x13')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0xa665('0x11')](_0xa665('0x12'),_0xa665('0x14')),controller[_0xa665('0x15')]);router[_0xa665('0x16')](_0xa665('0x17'),auth[_0xa665('0xa')](),interaction[_0xa665('0x11')](_0xa665('0x12'),_0xa665('0x18')),controller[_0xa665('0x19')]);router[_0xa665('0x16')]('/:id/tags',auth[_0xa665('0xa')](),controller[_0xa665('0x1a')]);module[_0xa665('0x1b')]=router; \ No newline at end of file +var _0x050e=['../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','faxinteraction:destroy','removeTags','util','path','connect-timeout','express','Router'];(function(_0x4d75b3,_0x50e9eb){var _0x4e5813=function(_0x2b9c80){while(--_0x2b9c80){_0x4d75b3['push'](_0x4d75b3['shift']());}};_0x4e5813(++_0x50e9eb);}(_0x050e,0x131));var _0xe050=function(_0x3cedf9,_0x33753d){_0x3cedf9=_0x3cedf9-0x0;var _0x3ede26=_0x050e[_0x3cedf9];return _0x3ede26;};'use strict';var multer=require('multer');var util=require(_0xe050('0x0'));var path=require(_0xe050('0x1'));var timeout=require(_0xe050('0x2'));var express=require(_0xe050('0x3'));var router=express[_0xe050('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe050('0x5'));var config=require(_0xe050('0x6'));var controller=require(_0xe050('0x7'));router[_0xe050('0x8')]('/',auth['isAuthenticated'](),controller[_0xe050('0x9')]);router[_0xe050('0x8')](_0xe050('0xa'),auth['isAuthenticated'](),controller[_0xe050('0xb')]);router[_0xe050('0x8')](_0xe050('0xc'),auth[_0xe050('0xd')](),controller[_0xe050('0xe')]);router['get']('/:id/messages',auth[_0xe050('0xd')](),controller['getMessages']);router['get'](_0xe050('0xf'),auth[_0xe050('0xd')](),controller[_0xe050('0x10')]);router[_0xe050('0x11')]('/',auth['isAuthenticated'](),controller[_0xe050('0x12')]);router[_0xe050('0x11')](_0xe050('0x13'),auth[_0xe050('0xd')](),controller[_0xe050('0x14')]);router[_0xe050('0x11')](_0xe050('0x15'),auth[_0xe050('0xd')](),interaction[_0xe050('0x16')](_0xe050('0x17'),_0xe050('0x18')),controller[_0xe050('0x19')]);router[_0xe050('0x1a')]('/:id',auth[_0xe050('0xd')](),interaction[_0xe050('0x16')](_0xe050('0x17'),'faxinteraction:update'),controller[_0xe050('0x1b')]);router[_0xe050('0x1c')](_0xe050('0xc'),auth[_0xe050('0xd')](),interaction['tracked'](_0xe050('0x17'),_0xe050('0x1d')),controller['destroy']);router[_0xe050('0x1c')](_0xe050('0x15'),auth[_0xe050('0xd')](),controller[_0xe050('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 5860119..bfcf3c1 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 _0x8ce3=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8ce3,0xc3));var _0x38ce=function(_0x5cdae9,_0x5e30a9){_0x5cdae9=_0x5cdae9-0x0;var _0x417701=_0x8ce3[_0x5cdae9];return _0x417701;};'use strict';var Sequelize=require(_0x38ce('0x0'));module[_0x38ce('0x1')]={'body':{'type':Sequelize['TEXT'](_0x38ce('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x38ce('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x38ce('0x4')]('in',_0x38ce('0x5')),'defaultValue':_0x38ce('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x38ce('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x38ce('0x7')]}}; \ No newline at end of file +var _0xf257=['BOOLEAN','ENUM','out','DATE','TEXT','medium'];(function(_0x16a757,_0x17c6ea){var _0x5f316a=function(_0x584b49){while(--_0x584b49){_0x16a757['push'](_0x16a757['shift']());}};_0x5f316a(++_0x17c6ea);}(_0xf257,0x82));var _0x7f25=function(_0x447ce1,_0x11cf0b){_0x447ce1=_0x447ce1-0x0;var _0x4c1e7a=_0xf257[_0x447ce1];return _0x4c1e7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x7f25('0x0')](_0x7f25('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7f25('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f25('0x3')]('in','out'),'defaultValue':_0x7f25('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x7f25('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x7f25('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index bda2d55..21dfa55 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 _0x29e1=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax','FaxInteraction','RejectMessage','rejectMessage','contact','email','internal','rejectmessage','findOne','ContactId','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','root','files','attachments','Attachment','download','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','body','destroy','describe','fax-interactions','accept','read','readAt','format','UserId','user','get','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x29e1,0x142));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x129e('0x0'));var rimraf=require(_0x129e('0x1'));var zipdir=require(_0x129e('0x2'));var jsonpatch=require(_0x129e('0x3'));var rp=require('request-promise');var moment=require(_0x129e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x129e('0x5'));var util=require(_0x129e('0x6'));var path=require(_0x129e('0x7'));var sox=require(_0x129e('0x8'));var csv=require(_0x129e('0x9'));var ejs=require(_0x129e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x129e('0xb'));var squel=require(_0x129e('0xc'));var crypto=require(_0x129e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x129e('0xe'));var toCsv=require(_0x129e('0x9'));var querystring=require(_0x129e('0xf'));var Papa=require(_0x129e('0x10'));var Redis=require(_0x129e('0x11'));var authService=require(_0x129e('0x12'));var qs=require(_0x129e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x129e('0x14'))('api');var utils=require(_0x129e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x129e('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x129e('0x17')](config[_0x129e('0x18')],{'host':_0x129e('0x19'),'port':0x18eb});var socket=require(_0x129e('0x1a'))(new Redis(config[_0x129e('0x18')]));require('./faxMessage.socket')[_0x129e('0x1b')](socket);var jayson=require(_0x129e('0x1c'));var client=jayson[_0x129e('0x1d')][_0x129e('0x1e')]({'port':0x232c});var client9002=jayson[_0x129e('0x1d')][_0x129e('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x431417,_0x50f852,_0x246ef0,_0x42268f){return new BPromise(function(_0x392cca,_0x3ec3bb){var _0x276d92=_0x42268f||client;return _0x276d92[_0x129e('0x1f')](_0x431417,_0x246ef0)['then'](function(_0x5d5faa){logger[_0x129e('0x20')]('FaxMessage,\x20%s,\x20%s',_0x50f852,_0x129e('0x21'));logger['debug'](_0x129e('0x22'),_0x50f852,_0x129e('0x21'),JSON[_0x129e('0x23')](_0x5d5faa));if(_0x5d5faa[_0x129e('0x24')]){if(_0x5d5faa[_0x129e('0x24')][_0x129e('0x25')]===0x1f4){logger[_0x129e('0x24')]('FaxMessage,\x20%s,\x20%s',_0x50f852,_0x5d5faa[_0x129e('0x24')][_0x129e('0x26')]);return _0x3ec3bb(_0x5d5faa[_0x129e('0x24')][_0x129e('0x26')]);}logger[_0x129e('0x24')]('FaxMessage,\x20%s,\x20%s',_0x50f852,_0x5d5faa[_0x129e('0x24')][_0x129e('0x26')]);return _0x392cca(_0x5d5faa[_0x129e('0x24')][_0x129e('0x26')]);}else{logger[_0x129e('0x20')](_0x129e('0x27'),_0x50f852,_0x129e('0x21'));_0x392cca(_0x5d5faa[_0x129e('0x28')]['message']);}})[_0x129e('0x29')](function(_0x2fd30a){logger[_0x129e('0x24')](_0x129e('0x27'),_0x50f852,_0x2fd30a);_0x3ec3bb(_0x2fd30a);});});}function respondWithStatusCode(_0x3779b6,_0x1c96ef){_0x1c96ef=_0x1c96ef||0xcc;return function(_0x5b61a5){if(_0x5b61a5){return _0x3779b6[_0x129e('0x2a')](_0x1c96ef);}return _0x3779b6[_0x129e('0x2b')](_0x1c96ef)[_0x129e('0x2c')]();};}function respondWithResult(_0x2788b7,_0x46ef59){_0x46ef59=_0x46ef59||0xc8;return function(_0x26bea7){if(_0x26bea7){return _0x2788b7[_0x129e('0x2b')](_0x46ef59)[_0x129e('0x2d')](_0x26bea7);}};}function respondWithFilteredResult(_0x10a53a,_0x3758c5){return function(_0x10ff1b){if(_0x10ff1b){var _0x53dc0e=typeof _0x3758c5[_0x129e('0x2e')]===_0x129e('0x2f')&&typeof _0x3758c5['limit']===_0x129e('0x2f');var _0x1f5a81=_0x10ff1b['count'];var _0x51babd=_0x53dc0e?0x0:_0x3758c5[_0x129e('0x2e')];var _0x7bc73e=_0x53dc0e?_0x10ff1b[_0x129e('0x30')]:_0x3758c5[_0x129e('0x2e')]+_0x3758c5['limit'];var _0x26f372;if(_0x7bc73e>=_0x1f5a81){_0x7bc73e=_0x1f5a81;_0x26f372=0xc8;}else{_0x26f372=0xce;}_0x10a53a['status'](_0x26f372);return _0x10a53a[_0x129e('0x31')](_0x129e('0x32'),_0x51babd+'-'+_0x7bc73e+'/'+_0x1f5a81)[_0x129e('0x2d')](_0x10ff1b);}return null;};}function patchUpdates(_0x4bce01){return function(_0x59f08d){try{jsonpatch[_0x129e('0x33')](_0x59f08d,_0x4bce01,!![]);}catch(_0x2b5778){return BPromise[_0x129e('0x34')](_0x2b5778);}return _0x59f08d[_0x129e('0x35')]();};}function saveUpdates(_0xba0e36,_0x504dda){return function(_0x237ea4){if(_0x237ea4){return _0x237ea4[_0x129e('0x36')](_0xba0e36)[_0x129e('0x37')](function(_0x478550){return _0x478550;});}return null;};}function removeEntity(_0x2640b1,_0xde51e2){return function(_0x31ea05){if(_0x31ea05){return _0x31ea05['destroy']()['then'](function(){_0x2640b1[_0x129e('0x2b')](0xcc)[_0x129e('0x2c')]();});}};}function handleEntityNotFound(_0x5c0584,_0x3f1d9f){return function(_0xba13e4){if(!_0xba13e4){_0x5c0584[_0x129e('0x2a')](0x194);}return _0xba13e4;};}function handleError(_0x7a5d94,_0x252c27){_0x252c27=_0x252c27||0x1f4;return function(_0x1095b7){logger[_0x129e('0x24')](_0x1095b7[_0x129e('0x38')]);if(_0x1095b7['name']){delete _0x1095b7[_0x129e('0x39')];}_0x7a5d94[_0x129e('0x2b')](_0x252c27)['send'](_0x1095b7);};}exports[_0x129e('0x3a')]=function(_0x4dcd3c,_0x3c154c){var _0x138464={},_0x25a8f8={},_0x15a718={'count':0x0,'rows':[]};var _0x7dd88b=_[_0x129e('0x3b')](db[_0x129e('0x3c')][_0x129e('0x3d')],function(_0x335b2b){return{'name':_0x335b2b[_0x129e('0x3e')],'type':_0x335b2b[_0x129e('0x3f')][_0x129e('0x40')]};});_0x25a8f8[_0x129e('0x41')]=_['map'](_0x7dd88b,'name');_0x25a8f8[_0x129e('0x42')]=_[_0x129e('0x43')](_0x4dcd3c[_0x129e('0x42')]);_0x25a8f8[_0x129e('0x44')]=_['intersection'](_0x25a8f8[_0x129e('0x41')],_0x25a8f8[_0x129e('0x42')]);_0x138464[_0x129e('0x45')]=_['intersection'](_0x25a8f8[_0x129e('0x41')],qs[_0x129e('0x46')](_0x4dcd3c[_0x129e('0x42')][_0x129e('0x46')]));_0x138464[_0x129e('0x45')]=_0x138464[_0x129e('0x45')][_0x129e('0x47')]?_0x138464[_0x129e('0x45')]:_0x25a8f8[_0x129e('0x41')];if(!_0x4dcd3c[_0x129e('0x42')]['hasOwnProperty']('nolimit')){_0x138464['limit']=qs[_0x129e('0x48')](_0x4dcd3c[_0x129e('0x42')][_0x129e('0x48')]);_0x138464[_0x129e('0x2e')]=qs[_0x129e('0x2e')](_0x4dcd3c[_0x129e('0x42')][_0x129e('0x2e')]);}_0x138464[_0x129e('0x49')]=qs[_0x129e('0x4a')](_0x4dcd3c['query']['sort']);_0x138464[_0x129e('0x4b')]=qs['filters'](_[_0x129e('0x4c')](_0x4dcd3c[_0x129e('0x42')],_0x25a8f8['filters']),_0x7dd88b);if(_0x4dcd3c[_0x129e('0x42')][_0x129e('0x4d')]){_0x138464[_0x129e('0x4b')]=_[_0x129e('0x4e')](_0x138464['where'],{'$or':_[_0x129e('0x3b')](_0x7dd88b,function(_0x347500){if(_0x347500[_0x129e('0x3f')]!==_0x129e('0x4f')){var _0x3c9404={};_0x3c9404[_0x347500[_0x129e('0x39')]]={'$like':'%'+_0x4dcd3c[_0x129e('0x42')]['filter']+'%'};return _0x3c9404;}})});}_0x138464=_[_0x129e('0x4e')]({},_0x138464,_0x4dcd3c[_0x129e('0x50')]);var _0x4617d5={'where':_0x138464['where']};return db['FaxMessage'][_0x129e('0x30')](_0x4617d5)['then'](function(_0x1b9a56){_0x15a718[_0x129e('0x30')]=_0x1b9a56;if(_0x4dcd3c[_0x129e('0x42')][_0x129e('0x51')]){_0x138464[_0x129e('0x52')]=[{'all':!![]}];}return db[_0x129e('0x3c')]['findAll'](_0x138464);})[_0x129e('0x37')](function(_0x262f3b){_0x15a718[_0x129e('0x53')]=_0x262f3b;return _0x15a718;})[_0x129e('0x37')](respondWithFilteredResult(_0x3c154c,_0x138464))[_0x129e('0x29')](handleError(_0x3c154c,null));};exports[_0x129e('0x54')]=function(_0x222135,_0x2640d3){var _0x224c1b={'raw':!![],'where':{'id':_0x222135[_0x129e('0x55')]['id']}},_0x32e3fe={};_0x32e3fe[_0x129e('0x41')]=_['keys'](db[_0x129e('0x3c')][_0x129e('0x3d')]);_0x32e3fe[_0x129e('0x42')]=_[_0x129e('0x43')](_0x222135[_0x129e('0x42')]);_0x32e3fe[_0x129e('0x44')]=_['intersection'](_0x32e3fe['model'],_0x32e3fe[_0x129e('0x42')]);_0x224c1b[_0x129e('0x45')]=_[_0x129e('0x56')](_0x32e3fe['model'],qs[_0x129e('0x46')](_0x222135[_0x129e('0x42')][_0x129e('0x46')]));_0x224c1b[_0x129e('0x45')]=_0x224c1b['attributes'][_0x129e('0x47')]?_0x224c1b[_0x129e('0x45')]:_0x32e3fe[_0x129e('0x41')];if(_0x222135['query'][_0x129e('0x51')]){_0x224c1b[_0x129e('0x52')]=[{'all':!![]}];}_0x224c1b=_[_0x129e('0x4e')]({},_0x224c1b,_0x222135[_0x129e('0x50')]);return db[_0x129e('0x3c')][_0x129e('0x57')](_0x224c1b)['then'](handleEntityNotFound(_0x2640d3,null))[_0x129e('0x37')](respondWithResult(_0x2640d3,null))['catch'](handleError(_0x2640d3,null));};exports[_0x129e('0x36')]=function(_0x43fa01,_0x2325b7){if(_0x43fa01['body']['id']){delete _0x43fa01[_0x129e('0x58')]['id'];}return db[_0x129e('0x3c')]['find']({'where':{'id':_0x43fa01['params']['id']}})[_0x129e('0x37')](handleEntityNotFound(_0x2325b7,null))[_0x129e('0x37')](saveUpdates(_0x43fa01[_0x129e('0x58')],null))[_0x129e('0x37')](respondWithResult(_0x2325b7,null))[_0x129e('0x29')](handleError(_0x2325b7,null));};exports[_0x129e('0x59')]=function(_0x37026a,_0x14d66b){return db['FaxMessage'][_0x129e('0x57')]({'where':{'id':_0x37026a[_0x129e('0x55')]['id']}})[_0x129e('0x37')](handleEntityNotFound(_0x14d66b,null))[_0x129e('0x37')](removeEntity(_0x14d66b,null))['catch'](handleError(_0x14d66b,null));};exports[_0x129e('0x5a')]=function(_0x3a1ce4,_0x31db1f){return db[_0x129e('0x3c')][_0x129e('0x5a')]()[_0x129e('0x37')](respondWithResult(_0x31db1f,null))[_0x129e('0x29')](handleError(_0x31db1f,null));};var interaction_log=require(_0x129e('0x14'))(_0x129e('0x5b'));exports[_0x129e('0x5c')]=function(_0x2f91a1,_0x551550,_0x2a1240){var _0x451604={'agent':{},'channel':'fax'};if(_0x2f91a1[_0x129e('0x58')]['id']){delete _0x2f91a1['body']['id'];}_0x2f91a1[_0x129e('0x58')][_0x129e('0x5d')]=!![];_0x2f91a1[_0x129e('0x58')][_0x129e('0x5e')]=moment()[_0x129e('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f91a1[_0x129e('0x58')][_0x129e('0x60')]=_0x2f91a1[_0x129e('0x58')][_0x129e('0x60')]||_0x2f91a1[_0x129e('0x61')]['id'];_0x451604['agent']['id']=_0x2f91a1[_0x129e('0x58')][_0x129e('0x60')];return db[_0x129e('0x3c')][_0x129e('0x57')]({'where':{'id':_0x2f91a1['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x551550,null))[_0x129e('0x37')](saveUpdates(_0x2f91a1[_0x129e('0x58')],null))[_0x129e('0x37')](function(_0x575210){if(_0x575210){_0x451604['message']=_0x575210[_0x129e('0x62')]({'plain':!![]});return db['FaxInteraction'][_0x129e('0x57')]({'where':{'id':_0x575210[_0x129e('0x63')]}});}return null;})[_0x129e('0x37')](handleEntityNotFound(_0x551550,null))[_0x129e('0x37')](function(_0x367845){if(_0x367845){return _0x367845[_0x129e('0x36')]({'UserId':_0x2f91a1['body'][_0x129e('0x60')],'read1stAt':_[_0x129e('0x64')](_0x367845['read1stAt'])?moment()[_0x129e('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x129e('0x37')](function(_0x306dee){if(_0x306dee){_0x451604[_0x129e('0x65')]=_0x306dee[_0x129e('0x62')]({'plain':!![]});interaction_log['info'](_0x129e('0x66'),_0x2f91a1[_0x129e('0x61')]['id'],_0x2f91a1[_0x129e('0x61')][_0x129e('0x39')],_0x2f91a1[_0x129e('0x61')][_0x129e('0x67')],_0x451604['interaction']['id'],_0x2f91a1[_0x129e('0x58')]?JSON['stringify'](_0x2f91a1[_0x129e('0x58')]):_0x129e('0x68'));return respondWithRpcPromise(_0x129e('0x69'),_0x129e('0x6a'),_0x451604);}return null;})[_0x129e('0x37')](function(_0x255275){var _0x48ed9a=_0x129e('0x6b')+_0x255275[_0x129e('0x26')]['ContactId'];return db[_0x129e('0x6c')][_0x129e('0x42')](_0x48ed9a,{'type':db[_0x129e('0x6d')][_0x129e('0x6e')][_0x129e('0x6f')],'raw':!![]})[_0x129e('0x37')](function(_0x4429ae){return _0x4429ae;});})['then'](function(_0x3e6b07){if(_0x3e6b07){_0x451604[_0x129e('0x26')]['contact']=_0x3e6b07[0x0];if(!_0x2f91a1[_0x129e('0x58')][_0x129e('0x60')])return;return db[_0x129e('0x70')][_0x129e('0x57')]({'where':{'id':_0x2f91a1[_0x129e('0x58')]['UserId'],'role':'agent'},'attributes':['id','name',_0x129e('0x71'),'email','internal'],'raw':!![]});}return null;})[_0x129e('0x37')](function(_0x34736a){if(!_0x34736a)return null;_0x451604[_0x129e('0x26')][_0x129e('0x72')]=_0x34736a;return _0x451604;})[_0x129e('0x37')](function(_0x227f21){if(_0x227f21){if(_0x2f91a1[_0x129e('0x58')][_0x129e('0x73')]){_0x451604[_0x129e('0x26')]['interface']=util[_0x129e('0x5f')](_0x129e('0x74'),_0x2f91a1[_0x129e('0x61')][_0x129e('0x39')]);_0x451604['message']['channel']=_0x451604[_0x129e('0x75')];_0x451604[_0x129e('0x26')][_0x129e('0x76')]=_0x451604[_0x129e('0x75')];_0x451604['message'][_0x129e('0x77')]='accept';return respondWithRpcPromise('EventManager',_0x129e('0x78'),{'event':_0x129e('0x79'),'message':_0x451604[_0x129e('0x26')]},client9002)[_0x129e('0x37')](function(){return _0x451604;});}return _0x451604;}return null;})['then'](respondWithResult(_0x551550,null))[_0x129e('0x29')](handleError(_0x551550,null));};var interaction_log=require(_0x129e('0x14'))(_0x129e('0x5b'));exports[_0x129e('0x34')]=function(_0x97bdec,_0x450db5,_0x279d90){var _0x4040d5={'agent':{},'channel':_0x129e('0x7a')};if(_0x97bdec[_0x129e('0x58')]['id']){delete _0x97bdec[_0x129e('0x58')]['id'];}_0x97bdec['body']['UserId']=_0x97bdec['body'][_0x129e('0x60')]||_0x97bdec[_0x129e('0x61')]['id'];_0x4040d5[_0x129e('0x72')]['id']=_0x97bdec[_0x129e('0x58')][_0x129e('0x60')];return db['FaxMessage'][_0x129e('0x57')]({'where':{'id':_0x97bdec[_0x129e('0x55')]['id'],'UserId':null}})[_0x129e('0x37')](handleEntityNotFound(_0x450db5,null))[_0x129e('0x37')](function(_0x140fa1){if(_0x140fa1){_0x4040d5[_0x129e('0x26')]=_0x140fa1[_0x129e('0x62')]({'plain':!![]});return db[_0x129e('0x7b')][_0x129e('0x57')]({'where':{'id':_0x140fa1[_0x129e('0x63')]}});}return null;})[_0x129e('0x37')](handleEntityNotFound(_0x450db5,null))[_0x129e('0x37')](function(_0x163030){if(_0x163030){_0x4040d5[_0x129e('0x65')]=_0x163030['get']({'plain':!![]});interaction_log[_0x129e('0x20')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x97bdec[_0x129e('0x61')]['id'],_0x97bdec['user']['name'],_0x97bdec[_0x129e('0x61')][_0x129e('0x67')],_0x4040d5[_0x129e('0x65')]['id'],_0x97bdec[_0x129e('0x58')]?JSON[_0x129e('0x23')](_0x97bdec[_0x129e('0x58')]):_0x129e('0x68'));return respondWithRpcPromise(_0x129e('0x7c'),_0x129e('0x7d'),_0x4040d5);}return null;})['then'](function(_0x39dd94){var _0x122d0d=_0x129e('0x6b')+_0x39dd94[_0x129e('0x26')]['ContactId'];return db[_0x129e('0x6c')][_0x129e('0x42')](_0x122d0d,{'type':db[_0x129e('0x6d')][_0x129e('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x3e7c6b){return _0x3e7c6b;});})[_0x129e('0x37')](function(_0x463ca1){if(_0x463ca1){_0x4040d5[_0x129e('0x26')][_0x129e('0x7e')]=_0x463ca1[0x0];if(!_0x97bdec[_0x129e('0x58')][_0x129e('0x60')])return;return db[_0x129e('0x70')][_0x129e('0x57')]({'where':{'id':_0x97bdec[_0x129e('0x58')][_0x129e('0x60')],'role':'agent'},'attributes':['id',_0x129e('0x39'),_0x129e('0x71'),_0x129e('0x7f'),_0x129e('0x80')],'raw':!![]});}return null;})[_0x129e('0x37')](function(_0xf36c0d){if(!_0xf36c0d)return null;_0x4040d5[_0x129e('0x26')][_0x129e('0x72')]=_0xf36c0d;return _0x4040d5;})[_0x129e('0x37')](function(_0x1d5121){if(_0x1d5121){_0x1d5121[_0x129e('0x26')]['interface']=util['format'](_0x129e('0x74'),_0x97bdec[_0x129e('0x61')][_0x129e('0x39')]);_0x1d5121['message'][_0x129e('0x75')]=_0x4040d5[_0x129e('0x75')];_0x1d5121[_0x129e('0x26')]['motionChannel']=_0x4040d5[_0x129e('0x75')];_0x1d5121[_0x129e('0x26')]['event']=_0x129e('0x34');respondWithRpcPromise(_0x129e('0x78'),_0x129e('0x78'),{'event':_0x129e('0x81'),'message':_0x1d5121['message']},client9002);return _0x4040d5;}return null;})[_0x129e('0x37')](respondWithResult(_0x450db5,null))[_0x129e('0x29')](handleError(_0x450db5,null));};exports['create']=function(_0x2b1a48,_0x1e921d){var _0x1afeed;return db[_0x129e('0x3c')]['create'](_0x2b1a48['body'],{})[_0x129e('0x37')](function(_0x4e60f7){_0x1afeed=_0x4e60f7;return db['CmContact'][_0x129e('0x82')]({'where':{'id':_0x1afeed[_0x129e('0x83')]}});})[_0x129e('0x37')](function(_0x24bb08){if(_[_0x129e('0x64')](_0x24bb08)){return;}else{_0x1afeed['fax']=_0x24bb08['fax'];return db['Attachment'][_0x129e('0x82')]({'where':{'id':_0x1afeed[_0x129e('0x84')]}});}})['then'](function(_0x482c6c){return respondWithRpcPromise(_0x129e('0x85'),_0x129e('0x85'),{'FaxAccountId':_[_0x129e('0x64')](_0x2b1a48[_0x129e('0x58')])?undefined:_0x2b1a48[_0x129e('0x58')][_0x129e('0x86')],'path':_[_0x129e('0x64')](_0x482c6c)?undefined:util[_0x129e('0x5f')](_0x129e('0x87'),_0x482c6c['basename']),'fax':_[_0x129e('0x64')](_0x1afeed[_0x129e('0x7a')])?undefined:_0x1afeed[_0x129e('0x7a')],'AttachmentId':_0x1afeed[_0x129e('0x84')]},client9002);})[_0x129e('0x37')](respondWithResult(_0x1e921d,0xc9))[_0x129e('0x29')](handleError(_0x1e921d,null));};exports['download']=function(_0x34108d,_0x5cc6f4){var _0x5ca54b=path['join'](config[_0x129e('0x88')],'server',_0x129e('0x89'),_0x129e('0x8a'));return db['FaxMessage'][_0x129e('0x57')]({'where':{'id':_0x34108d[_0x129e('0x55')]['id']},'include':[{'model':db[_0x129e('0x8b')],'as':_0x129e('0x8b')}]})[_0x129e('0x37')](handleEntityNotFound(_0x5cc6f4,null))[_0x129e('0x37')](function(_0x5938f7){if(_0x5938f7){return _0x5cc6f4[_0x129e('0x8c')](path[_0x129e('0x8d')](_0x5ca54b,_0x5938f7[_0x129e('0x8b')][_0x129e('0x8e')]));}})[_0x129e('0x29')](handleError(_0x5cc6f4,null));}; \ No newline at end of file +var _0x1139=['fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','FaxMessage','includeAll','findAll','rows','keys','include','body','params','destroy','describe','fax-interactions','accept','fax','read','readAt','UserId','agent','find','get','FaxInteraction','FaxInteractionId','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','role','rejectMessage','sequelize','QueryTypes','internal','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','isNil','/var/opt/motion2/server/files/attachments/%s','join','root','files','attachments','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','count','json','reject','save','update','sendStatus','name','send','index','map','rawAttributes'];(function(_0x497ee0,_0x17c87c){var _0x47c05a=function(_0x1a8c81){while(--_0x1a8c81){_0x497ee0['push'](_0x497ee0['shift']());}};_0x47c05a(++_0x17c87c);}(_0x1139,0xd5));var _0x9113=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1139[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x9113('0x0'));var rimraf=require(_0x9113('0x1'));var zipdir=require(_0x9113('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9113('0x3'));var BPromise=require(_0x9113('0x4'));var Mustache=require('mustache');var util=require(_0x9113('0x5'));var path=require(_0x9113('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9113('0x7'));var fs=require('fs');var fs_extra=require(_0x9113('0x8'));var _=require(_0x9113('0x9'));var squel=require(_0x9113('0xa'));var crypto=require(_0x9113('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9113('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9113('0xd'));var qs=require(_0x9113('0xe'));var as=require(_0x9113('0xf'));var hardwareService=require(_0x9113('0x10'));var logger=require(_0x9113('0x11'))('api');var utils=require(_0x9113('0x12'));var config=require(_0x9113('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9113('0x14'))['db'];config[_0x9113('0x15')]=_[_0x9113('0x16')](config[_0x9113('0x15')],{'host':_0x9113('0x17'),'port':0x18eb});var socket=require(_0x9113('0x18'))(new Redis(config[_0x9113('0x15')]));require(_0x9113('0x19'))[_0x9113('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9113('0x1b')][_0x9113('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x9113('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x6f4487,_0x1f5b43,_0x24e8d9,_0x1437fe){return new BPromise(function(_0x3618c9,_0x55c605){var _0x4f2feb=_0x1437fe||client;return _0x4f2feb['request'](_0x6f4487,_0x24e8d9)[_0x9113('0x1d')](function(_0x26581e){logger[_0x9113('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x1f5b43,_0x9113('0x1f'));logger['debug'](_0x9113('0x20'),_0x1f5b43,_0x9113('0x1f'),JSON[_0x9113('0x21')](_0x26581e));if(_0x26581e['error']){if(_0x26581e[_0x9113('0x22')][_0x9113('0x23')]===0x1f4){logger['error'](_0x9113('0x24'),_0x1f5b43,_0x26581e[_0x9113('0x22')][_0x9113('0x25')]);return _0x55c605(_0x26581e[_0x9113('0x22')][_0x9113('0x25')]);}logger['error'](_0x9113('0x24'),_0x1f5b43,_0x26581e[_0x9113('0x22')][_0x9113('0x25')]);return _0x3618c9(_0x26581e[_0x9113('0x22')][_0x9113('0x25')]);}else{logger[_0x9113('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x1f5b43,_0x9113('0x1f'));_0x3618c9(_0x26581e[_0x9113('0x26')][_0x9113('0x25')]);}})[_0x9113('0x27')](function(_0x28e5e5){logger[_0x9113('0x22')](_0x9113('0x24'),_0x1f5b43,_0x28e5e5);_0x55c605(_0x28e5e5);});});}function respondWithStatusCode(_0xdb6fe7,_0x56e9f5){_0x56e9f5=_0x56e9f5||0xcc;return function(_0x498c7a){if(_0x498c7a){return _0xdb6fe7['sendStatus'](_0x56e9f5);}return _0xdb6fe7[_0x9113('0x28')](_0x56e9f5)[_0x9113('0x29')]();};}function respondWithResult(_0x3c1345,_0x107bbf){_0x107bbf=_0x107bbf||0xc8;return function(_0x17d186){if(_0x17d186){return _0x3c1345[_0x9113('0x28')](_0x107bbf)['json'](_0x17d186);}};}function respondWithFilteredResult(_0x135e28,_0x499048){return function(_0x13aa58){if(_0x13aa58){var _0x1ff53a=typeof _0x499048[_0x9113('0x2a')]==='undefined'&&typeof _0x499048[_0x9113('0x2b')]==='undefined';var _0x2e9c72=_0x13aa58[_0x9113('0x2c')];var _0x4202b6=_0x1ff53a?0x0:_0x499048[_0x9113('0x2a')];var _0x47a312=_0x1ff53a?_0x13aa58['count']:_0x499048['offset']+_0x499048[_0x9113('0x2b')];var _0x168416;if(_0x47a312>=_0x2e9c72){_0x47a312=_0x2e9c72;_0x168416=0xc8;}else{_0x168416=0xce;}_0x135e28[_0x9113('0x28')](_0x168416);return _0x135e28['set']('Content-Range',_0x4202b6+'-'+_0x47a312+'/'+_0x2e9c72)[_0x9113('0x2d')](_0x13aa58);}return null;};}function patchUpdates(_0x16a38b){return function(_0x1ba6bb){try{jsonpatch['apply'](_0x1ba6bb,_0x16a38b,!![]);}catch(_0x456cbe){return BPromise[_0x9113('0x2e')](_0x456cbe);}return _0x1ba6bb[_0x9113('0x2f')]();};}function saveUpdates(_0x542d37,_0x544bc8){return function(_0x402826){if(_0x402826){return _0x402826[_0x9113('0x30')](_0x542d37)[_0x9113('0x1d')](function(_0x537212){return _0x537212;});}return null;};}function removeEntity(_0x4a8783,_0x36ad9d){return function(_0x1585fd){if(_0x1585fd){return _0x1585fd['destroy']()[_0x9113('0x1d')](function(){_0x4a8783[_0x9113('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32c162,_0x3148e3){return function(_0x164d16){if(!_0x164d16){_0x32c162[_0x9113('0x31')](0x194);}return _0x164d16;};}function handleError(_0x126ec1,_0xf6f434){_0xf6f434=_0xf6f434||0x1f4;return function(_0x41d981){logger['error'](_0x41d981['stack']);if(_0x41d981[_0x9113('0x32')]){delete _0x41d981['name'];}_0x126ec1[_0x9113('0x28')](_0xf6f434)[_0x9113('0x33')](_0x41d981);};}exports[_0x9113('0x34')]=function(_0x192e1f,_0x415ccc){var _0x1d69eb={},_0x45c664={},_0x1d4e77={'count':0x0,'rows':[]};var _0x1afd24=_[_0x9113('0x35')](db['FaxMessage'][_0x9113('0x36')],function(_0x5575e8){return{'name':_0x5575e8[_0x9113('0x37')],'type':_0x5575e8['type']['key']};});_0x45c664[_0x9113('0x38')]=_[_0x9113('0x35')](_0x1afd24,_0x9113('0x32'));_0x45c664[_0x9113('0x39')]=_['keys'](_0x192e1f[_0x9113('0x39')]);_0x45c664[_0x9113('0x3a')]=_[_0x9113('0x3b')](_0x45c664['model'],_0x45c664[_0x9113('0x39')]);_0x1d69eb[_0x9113('0x3c')]=_[_0x9113('0x3b')](_0x45c664[_0x9113('0x38')],qs[_0x9113('0x3d')](_0x192e1f[_0x9113('0x39')]['fields']));_0x1d69eb[_0x9113('0x3c')]=_0x1d69eb[_0x9113('0x3c')][_0x9113('0x3e')]?_0x1d69eb[_0x9113('0x3c')]:_0x45c664[_0x9113('0x38')];if(!_0x192e1f[_0x9113('0x39')][_0x9113('0x3f')](_0x9113('0x40'))){_0x1d69eb[_0x9113('0x2b')]=qs[_0x9113('0x2b')](_0x192e1f[_0x9113('0x39')][_0x9113('0x2b')]);_0x1d69eb[_0x9113('0x2a')]=qs['offset'](_0x192e1f['query'][_0x9113('0x2a')]);}_0x1d69eb[_0x9113('0x41')]=qs[_0x9113('0x42')](_0x192e1f[_0x9113('0x39')][_0x9113('0x42')]);_0x1d69eb[_0x9113('0x43')]=qs[_0x9113('0x3a')](_[_0x9113('0x44')](_0x192e1f[_0x9113('0x39')],_0x45c664[_0x9113('0x3a')]),_0x1afd24);if(_0x192e1f['query'][_0x9113('0x45')]){_0x1d69eb[_0x9113('0x43')]=_['merge'](_0x1d69eb[_0x9113('0x43')],{'$or':_[_0x9113('0x35')](_0x1afd24,function(_0x1fa8ef){if(_0x1fa8ef[_0x9113('0x46')]!=='VIRTUAL'){var _0x3dfa7a={};_0x3dfa7a[_0x1fa8ef[_0x9113('0x32')]]={'$like':'%'+_0x192e1f['query'][_0x9113('0x45')]+'%'};return _0x3dfa7a;}})});}_0x1d69eb=_[_0x9113('0x47')]({},_0x1d69eb,_0x192e1f[_0x9113('0x48')]);var _0x10662b={'where':_0x1d69eb[_0x9113('0x43')]};return db[_0x9113('0x49')][_0x9113('0x2c')](_0x10662b)[_0x9113('0x1d')](function(_0x265e9a){_0x1d4e77['count']=_0x265e9a;if(_0x192e1f[_0x9113('0x39')][_0x9113('0x4a')]){_0x1d69eb['include']=[{'all':!![]}];}return db[_0x9113('0x49')][_0x9113('0x4b')](_0x1d69eb);})[_0x9113('0x1d')](function(_0x90953d){_0x1d4e77[_0x9113('0x4c')]=_0x90953d;return _0x1d4e77;})[_0x9113('0x1d')](respondWithFilteredResult(_0x415ccc,_0x1d69eb))['catch'](handleError(_0x415ccc,null));};exports['show']=function(_0x474055,_0x7695ac){var _0xd9cb4={'raw':!![],'where':{'id':_0x474055['params']['id']}},_0x28921c={};_0x28921c['model']=_[_0x9113('0x4d')](db[_0x9113('0x49')][_0x9113('0x36')]);_0x28921c[_0x9113('0x39')]=_[_0x9113('0x4d')](_0x474055['query']);_0x28921c[_0x9113('0x3a')]=_[_0x9113('0x3b')](_0x28921c[_0x9113('0x38')],_0x28921c[_0x9113('0x39')]);_0xd9cb4[_0x9113('0x3c')]=_[_0x9113('0x3b')](_0x28921c[_0x9113('0x38')],qs[_0x9113('0x3d')](_0x474055[_0x9113('0x39')][_0x9113('0x3d')]));_0xd9cb4[_0x9113('0x3c')]=_0xd9cb4[_0x9113('0x3c')][_0x9113('0x3e')]?_0xd9cb4[_0x9113('0x3c')]:_0x28921c['model'];if(_0x474055[_0x9113('0x39')][_0x9113('0x4a')]){_0xd9cb4[_0x9113('0x4e')]=[{'all':!![]}];}_0xd9cb4=_[_0x9113('0x47')]({},_0xd9cb4,_0x474055['options']);return db[_0x9113('0x49')]['find'](_0xd9cb4)[_0x9113('0x1d')](handleEntityNotFound(_0x7695ac,null))[_0x9113('0x1d')](respondWithResult(_0x7695ac,null))[_0x9113('0x27')](handleError(_0x7695ac,null));};exports[_0x9113('0x30')]=function(_0x44cb5b,_0x120616){if(_0x44cb5b[_0x9113('0x4f')]['id']){delete _0x44cb5b[_0x9113('0x4f')]['id'];}return db[_0x9113('0x49')]['find']({'where':{'id':_0x44cb5b[_0x9113('0x50')]['id']}})['then'](handleEntityNotFound(_0x120616,null))[_0x9113('0x1d')](saveUpdates(_0x44cb5b['body'],null))[_0x9113('0x1d')](respondWithResult(_0x120616,null))[_0x9113('0x27')](handleError(_0x120616,null));};exports[_0x9113('0x51')]=function(_0x44a9a4,_0xb683a0){return db['FaxMessage']['find']({'where':{'id':_0x44a9a4['params']['id']}})['then'](handleEntityNotFound(_0xb683a0,null))['then'](removeEntity(_0xb683a0,null))['catch'](handleError(_0xb683a0,null));};exports['describe']=function(_0x3aee55,_0x4fd154){return db[_0x9113('0x49')][_0x9113('0x52')]()['then'](respondWithResult(_0x4fd154,null))['catch'](handleError(_0x4fd154,null));};var interaction_log=require(_0x9113('0x11'))(_0x9113('0x53'));exports[_0x9113('0x54')]=function(_0xf94750,_0x211172,_0xf5b2af){var _0x4ebc54={'agent':{},'channel':_0x9113('0x55')};if(_0xf94750[_0x9113('0x4f')]['id']){delete _0xf94750[_0x9113('0x4f')]['id'];}_0xf94750[_0x9113('0x4f')][_0x9113('0x56')]=!![];_0xf94750['body'][_0x9113('0x57')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xf94750[_0x9113('0x4f')][_0x9113('0x58')]=_0xf94750[_0x9113('0x4f')][_0x9113('0x58')]||_0xf94750['user']['id'];_0x4ebc54[_0x9113('0x59')]['id']=_0xf94750['body'][_0x9113('0x58')];return db[_0x9113('0x49')][_0x9113('0x5a')]({'where':{'id':_0xf94750['params']['id'],'UserId':null}})[_0x9113('0x1d')](handleEntityNotFound(_0x211172,null))[_0x9113('0x1d')](saveUpdates(_0xf94750[_0x9113('0x4f')],null))[_0x9113('0x1d')](function(_0x11417c){if(_0x11417c){_0x4ebc54['message']=_0x11417c[_0x9113('0x5b')]({'plain':!![]});return db[_0x9113('0x5c')][_0x9113('0x5a')]({'where':{'id':_0x11417c[_0x9113('0x5d')]}});}return null;})[_0x9113('0x1d')](handleEntityNotFound(_0x211172,null))[_0x9113('0x1d')](function(_0x292ac8){if(_0x292ac8){return _0x292ac8[_0x9113('0x30')]({'UserId':_0xf94750[_0x9113('0x4f')][_0x9113('0x58')],'read1stAt':_['isNil'](_0x292ac8['read1stAt'])?moment()[_0x9113('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9113('0x1d')](function(_0x52ac56){if(_0x52ac56){_0x4ebc54[_0x9113('0x5f')]=_0x52ac56[_0x9113('0x5b')]({'plain':!![]});interaction_log[_0x9113('0x1e')](_0x9113('0x60'),_0xf94750[_0x9113('0x61')]['id'],_0xf94750[_0x9113('0x61')][_0x9113('0x32')],_0xf94750[_0x9113('0x61')]['role'],_0x4ebc54[_0x9113('0x5f')]['id'],_0xf94750[_0x9113('0x4f')]?JSON[_0x9113('0x21')](_0xf94750[_0x9113('0x4f')]):_0x9113('0x62'));return respondWithRpcPromise('AcceptMessage',_0x9113('0x63'),_0x4ebc54);}return null;})[_0x9113('0x1d')](function(_0x21f259){var _0x9052b8=_0x9113('0x64')+_0x21f259['message'][_0x9113('0x65')];return db['sequelize']['query'](_0x9052b8,{'type':db[_0x9113('0x66')]['QueryTypes'][_0x9113('0x67')],'raw':!![]})[_0x9113('0x1d')](function(_0x105052){return _0x105052;});})['then'](function(_0x5ed42b){if(_0x5ed42b){_0x4ebc54[_0x9113('0x25')][_0x9113('0x68')]=_0x5ed42b[0x0];if(!_0xf94750[_0x9113('0x4f')][_0x9113('0x58')])return;return db[_0x9113('0x69')]['find']({'where':{'id':_0xf94750['body']['UserId'],'role':_0x9113('0x59')},'attributes':['id',_0x9113('0x32'),_0x9113('0x6a'),_0x9113('0x6b'),'internal'],'raw':!![]});}return null;})['then'](function(_0x57df10){if(!_0x57df10)return null;_0x4ebc54[_0x9113('0x25')][_0x9113('0x59')]=_0x57df10;return _0x4ebc54;})[_0x9113('0x1d')](function(_0x4e43f2){if(_0x4e43f2){if(_0xf94750[_0x9113('0x4f')][_0x9113('0x6c')]){_0x4ebc54[_0x9113('0x25')][_0x9113('0x6d')]=util[_0x9113('0x5e')](_0x9113('0x6e'),_0xf94750[_0x9113('0x61')][_0x9113('0x32')]);_0x4ebc54[_0x9113('0x25')][_0x9113('0x6f')]=_0x4ebc54[_0x9113('0x6f')];_0x4ebc54[_0x9113('0x25')][_0x9113('0x70')]=_0x4ebc54[_0x9113('0x6f')];_0x4ebc54[_0x9113('0x25')]['event']=_0x9113('0x54');return respondWithRpcPromise(_0x9113('0x71'),_0x9113('0x71'),{'event':_0x9113('0x72'),'message':_0x4ebc54[_0x9113('0x25')]},client9002)[_0x9113('0x1d')](function(){return _0x4ebc54;});}return _0x4ebc54;}return null;})[_0x9113('0x1d')](respondWithResult(_0x211172,null))[_0x9113('0x27')](handleError(_0x211172,null));};var interaction_log=require(_0x9113('0x11'))(_0x9113('0x53'));exports[_0x9113('0x2e')]=function(_0x5d0e81,_0x428e8c,_0x46677b){var _0xc09614={'agent':{},'channel':_0x9113('0x55')};if(_0x5d0e81[_0x9113('0x4f')]['id']){delete _0x5d0e81[_0x9113('0x4f')]['id'];}_0x5d0e81['body'][_0x9113('0x58')]=_0x5d0e81[_0x9113('0x4f')][_0x9113('0x58')]||_0x5d0e81['user']['id'];_0xc09614['agent']['id']=_0x5d0e81[_0x9113('0x4f')][_0x9113('0x58')];return db[_0x9113('0x49')]['find']({'where':{'id':_0x5d0e81['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x428e8c,null))[_0x9113('0x1d')](function(_0x4e5c31){if(_0x4e5c31){_0xc09614['message']=_0x4e5c31[_0x9113('0x5b')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4e5c31[_0x9113('0x5d')]}});}return null;})[_0x9113('0x1d')](handleEntityNotFound(_0x428e8c,null))[_0x9113('0x1d')](function(_0x1f2ae5){if(_0x1f2ae5){_0xc09614['interaction']=_0x1f2ae5[_0x9113('0x5b')]({'plain':!![]});interaction_log[_0x9113('0x1e')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d0e81[_0x9113('0x61')]['id'],_0x5d0e81[_0x9113('0x61')][_0x9113('0x32')],_0x5d0e81[_0x9113('0x61')][_0x9113('0x73')],_0xc09614[_0x9113('0x5f')]['id'],_0x5d0e81[_0x9113('0x4f')]?JSON[_0x9113('0x21')](_0x5d0e81[_0x9113('0x4f')]):_0x9113('0x62'));return respondWithRpcPromise('RejectMessage',_0x9113('0x74'),_0xc09614);}return null;})[_0x9113('0x1d')](function(_0x394a9a){var _0xeebfcc=_0x9113('0x64')+_0x394a9a['message'][_0x9113('0x65')];return db[_0x9113('0x75')][_0x9113('0x39')](_0xeebfcc,{'type':db[_0x9113('0x66')][_0x9113('0x76')][_0x9113('0x67')],'raw':!![]})[_0x9113('0x1d')](function(_0x63a7a0){return _0x63a7a0;});})['then'](function(_0x6136d){if(_0x6136d){_0xc09614[_0x9113('0x25')][_0x9113('0x68')]=_0x6136d[0x0];if(!_0x5d0e81['body'][_0x9113('0x58')])return;return db[_0x9113('0x69')][_0x9113('0x5a')]({'where':{'id':_0x5d0e81[_0x9113('0x4f')][_0x9113('0x58')],'role':'agent'},'attributes':['id',_0x9113('0x32'),'fullname',_0x9113('0x6b'),_0x9113('0x77')],'raw':!![]});}return null;})[_0x9113('0x1d')](function(_0x2d55f9){if(!_0x2d55f9)return null;_0xc09614[_0x9113('0x25')]['agent']=_0x2d55f9;return _0xc09614;})[_0x9113('0x1d')](function(_0x32b833){if(_0x32b833){_0x32b833[_0x9113('0x25')]['interface']=util[_0x9113('0x5e')](_0x9113('0x6e'),_0x5d0e81['user'][_0x9113('0x32')]);_0x32b833['message']['channel']=_0xc09614['channel'];_0x32b833[_0x9113('0x25')][_0x9113('0x70')]=_0xc09614['channel'];_0x32b833[_0x9113('0x25')][_0x9113('0x78')]='reject';respondWithRpcPromise(_0x9113('0x71'),_0x9113('0x71'),{'event':_0x9113('0x79'),'message':_0x32b833[_0x9113('0x25')]},client9002);return _0xc09614;}return null;})['then'](respondWithResult(_0x428e8c,null))[_0x9113('0x27')](handleError(_0x428e8c,null));};exports[_0x9113('0x7a')]=function(_0x192615,_0x1fc23d){var _0x1f9a14;return db[_0x9113('0x49')][_0x9113('0x7a')](_0x192615[_0x9113('0x4f')],{})['then'](function(_0x4ec32f){_0x1f9a14=_0x4ec32f;return db[_0x9113('0x7b')][_0x9113('0x7c')]({'where':{'id':_0x1f9a14['ContactId']}});})[_0x9113('0x1d')](function(_0x418022){if(_['isNil'](_0x418022)){return;}else{_0x1f9a14[_0x9113('0x55')]=_0x418022[_0x9113('0x55')];return db[_0x9113('0x7d')]['findOne']({'where':{'id':_0x1f9a14[_0x9113('0x7e')]}});}})[_0x9113('0x1d')](function(_0x426716){return respondWithRpcPromise(_0x9113('0x7f'),'SendFax',{'FaxAccountId':_[_0x9113('0x80')](_0x192615['body'])?undefined:_0x192615[_0x9113('0x4f')]['FaxAccountId'],'path':_[_0x9113('0x80')](_0x426716)?undefined:util['format'](_0x9113('0x81'),_0x426716['basename']),'fax':_[_0x9113('0x80')](_0x1f9a14[_0x9113('0x55')])?undefined:_0x1f9a14['fax'],'AttachmentId':_0x1f9a14[_0x9113('0x7e')]},client9002);})[_0x9113('0x1d')](respondWithResult(_0x1fc23d,0xc9))[_0x9113('0x27')](handleError(_0x1fc23d,null));};exports['download']=function(_0x13ee69,_0x10ec47){var _0xa9fc9=path[_0x9113('0x82')](config[_0x9113('0x83')],'server',_0x9113('0x84'),_0x9113('0x85'));return db[_0x9113('0x49')][_0x9113('0x5a')]({'where':{'id':_0x13ee69[_0x9113('0x50')]['id']},'include':[{'model':db[_0x9113('0x7d')],'as':_0x9113('0x7d')}]})[_0x9113('0x1d')](handleEntityNotFound(_0x10ec47,null))[_0x9113('0x1d')](function(_0x56ceb4){if(_0x56ceb4){return _0x10ec47['download'](path[_0x9113('0x82')](_0xa9fc9,_0x56ceb4['Attachment']['basename']));}})[_0x9113('0x27')](handleError(_0x10ec47,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index c9db65e..7642c93 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 _0x3714=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x36ec31,_0x37f47e){var _0x3900b7=function(_0xba9bcf){while(--_0xba9bcf){_0x36ec31['push'](_0x36ec31['shift']());}};_0x3900b7(++_0x37f47e);}(_0x3714,0x95));var _0x4371=function(_0x402ad3,_0xb05194){_0x402ad3=_0x402ad3-0x0;var _0x2a08b2=_0x3714[_0x402ad3];return _0x2a08b2;};'use strict';var EventEmitter=require(_0x4371('0x0'));var FaxMessage=require(_0x4371('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4371('0x2')](0x0);var events={'afterCreate':_0x4371('0x3'),'afterUpdate':_0x4371('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21bccf){return function(_0x20929e,_0x2c0435,_0x5a2ffa){FaxMessageEvents[_0x4371('0x5')](_0x21bccf+':'+_0x20929e['id'],_0x20929e);FaxMessageEvents['emit'](_0x21bccf,_0x20929e);_0x5a2ffa(null);};}for(var e in events){if(events[_0x4371('0x6')](e)){var event=events[e];FaxMessage[_0x4371('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x3595=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x318262,_0xaa1967){var _0x4369=function(_0x5893dd){while(--_0x5893dd){_0x318262['push'](_0x318262['shift']());}};_0x4369(++_0xaa1967);}(_0x3595,0x147));var _0x5359=function(_0x47f19c,_0x120f2b){_0x47f19c=_0x47f19c-0x0;var _0x347ead=_0x3595[_0x47f19c];return _0x347ead;};'use strict';var EventEmitter=require(_0x5359('0x0'));var FaxMessage=require(_0x5359('0x1'))['db'][_0x5359('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5359('0x3'),'afterUpdate':_0x5359('0x4'),'afterDestroy':_0x5359('0x5')};function emitEvent(_0x3fd018){return function(_0x1fa814,_0x125c76,_0x4e42e0){FaxMessageEvents['emit'](_0x3fd018+':'+_0x1fa814['id'],_0x1fa814);FaxMessageEvents[_0x5359('0x6')](_0x3fd018,_0x1fa814);_0x4e42e0(null);};}for(var e in events){if(events[_0x5359('0x7')](e)){var event=events[e];FaxMessage[_0x5359('0x8')](e,emitEvent(event));}}module[_0x5359('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b704e0a..de96002 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 _0xe395=['./faxMessage.attributes','FaxMessage','fax_messages','models','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xe395,0xd7));var _0x5e39=function(_0x2695dc,_0x5a9469){_0x2695dc=_0x2695dc-0x0;var _0xad6b1f=_0xe395[_0x2695dc];return _0xad6b1f;};'use strict';var _=require(_0x5e39('0x0'));var util=require(_0x5e39('0x1'));var logger=require(_0x5e39('0x2'))(_0x5e39('0x3'));var moment=require(_0x5e39('0x4'));var BPromise=require(_0x5e39('0x5'));var rp=require(_0x5e39('0x6'));var fs=require('fs');var path=require(_0x5e39('0x7'));var rimraf=require(_0x5e39('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e39('0x9'));module['exports']=function(_0x16db01,_0x54c0b5){return _0x16db01['define'](_0x5e39('0xa'),attributes,{'tableName':_0x5e39('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x595f35,_0x155c3b,_0x5ec738){var _0x566788=_0x16db01[_0x5e39('0xc')];var _0x35ada9=_0x595f35[_0x5e39('0xd')]({'plain':!![]});if(_0x35ada9[_0x5e39('0xe')][_0x5e39('0xf')]()==='in'||_0x35ada9['direction'][_0x5e39('0xf')]()===_0x5e39('0x10')&&!_0x35ada9[_0x5e39('0x11')]&&!_[_0x5e39('0x12')](_0x35ada9['UserId'])){_0x566788[_0x5e39('0x13')][_0x5e39('0x14')]({'where':{'id':_0x35ada9[_0x5e39('0x15')]}})[_0x5e39('0x16')](function(_0x56a870){if(_0x56a870){_0x56a870[_0x5e39('0x17')]({'lastMsgAt':_0x35ada9[_0x5e39('0x18')],'lastMsgDirection':_0x35ada9['direction'][_0x5e39('0xf')]()});}})[_0x5e39('0x19')](function(_0x253a1c){console['error'](_0x253a1c);});}_0x5ec738();}},'charset':_0x5e39('0x1a'),'collate':_0x5e39('0x1b')});}; \ No newline at end of file +var _0x5446=['get','direction','toLowerCase','out','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','body','FULLTEXT','models'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0x5446,0x1d8));var _0x6544=function(_0xdaa2d6,_0x3d7bb1){_0xdaa2d6=_0xdaa2d6-0x0;var _0x225dcc=_0x5446[_0xdaa2d6];return _0x225dcc;};'use strict';var _=require(_0x6544('0x0'));var util=require(_0x6544('0x1'));var logger=require(_0x6544('0x2'))(_0x6544('0x3'));var moment=require(_0x6544('0x4'));var BPromise=require(_0x6544('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6544('0x6'));var attributes=require(_0x6544('0x7'));module[_0x6544('0x8')]=function(_0x360440,_0x367c24){return _0x360440[_0x6544('0x9')]('FaxMessage',attributes,{'tableName':_0x6544('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x6544('0xb')],'type':_0x6544('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27c7a9,_0x417deb,_0x232376){var _0x845584=_0x360440[_0x6544('0xd')];var _0x62d282=_0x27c7a9[_0x6544('0xe')]({'plain':!![]});if(_0x62d282[_0x6544('0xf')][_0x6544('0x10')]()==='in'||_0x62d282[_0x6544('0xf')]['toLowerCase']()===_0x6544('0x11')&&!_0x62d282['secret']&&!_['isNil'](_0x62d282['UserId'])){_0x845584[_0x6544('0x12')][_0x6544('0x13')]({'where':{'id':_0x62d282[_0x6544('0x14')]}})[_0x6544('0x15')](function(_0x5d2bd0){if(_0x5d2bd0){_0x5d2bd0[_0x6544('0x16')]({'lastMsgAt':_0x62d282[_0x6544('0x17')],'lastMsgDirection':_0x62d282[_0x6544('0xf')][_0x6544('0x10')]()});}})[_0x6544('0x18')](function(_0x59a8fd){console['error'](_0x59a8fd);});}_0x232376();}},'charset':_0x6544('0x19'),'collate':_0x6544('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 4a0f9f0..d228aad 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 _0x6aa7=['redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','options','raw','catch','update','body','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x2abb29,_0x1e0f3c){var _0x5c190f=function(_0x4f913e){while(--_0x4f913e){_0x2abb29['push'](_0x2abb29['shift']());}};_0x5c190f(++_0x1e0f3c);}(_0x6aa7,0x178));var _0x76aa=function(_0x563405,_0x4e1e7d){_0x563405=_0x563405-0x0;var _0x130646=_0x6aa7[_0x563405];return _0x130646;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});}exports[_0x76aa('0x18')]=function(_0x15b931){var _0x15109b=this;return new Promise(function(_0x191560,_0x19af92){return db[_0x76aa('0x19')][_0x76aa('0x1a')](_0x15b931['body'],{'raw':_0x15b931[_0x76aa('0x1b')]?_0x15b931[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x41463a){logger[_0x76aa('0xf')](_0x76aa('0x18'),_0x15b931);logger[_0x76aa('0x11')](_0x76aa('0x18'),_0x15b931,JSON[_0x76aa('0x13')](_0x41463a));_0x191560(_0x41463a);})[_0x76aa('0x1d')](function(_0x3363b3){logger[_0x76aa('0x14')](_0x76aa('0x18'),_0x3363b3[_0x76aa('0x16')],_0x15b931);_0x19af92(_0x15109b[_0x76aa('0x14')](0x1f4,_0x3363b3[_0x76aa('0x16')]));});});};exports['UpdateFaxMessage']=function(_0xb5e8a9){var _0x1d6d15=this;return new Promise(function(_0x25c614,_0x2e7ab4){return db[_0x76aa('0x19')][_0x76aa('0x1e')](_0xb5e8a9[_0x76aa('0x1f')],{'raw':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb5e8a9['options']?_0xb5e8a9[_0x76aa('0x1b')]['where']||null:null,'attributes':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x20')]||null:null,'limit':_0xb5e8a9[_0x76aa('0x1b')]?_0xb5e8a9[_0x76aa('0x1b')][_0x76aa('0x21')]||null:null})[_0x76aa('0xe')](function(_0x3827ec){logger[_0x76aa('0xf')](_0x76aa('0x22'),_0xb5e8a9);logger['debug'](_0x76aa('0x22'),_0xb5e8a9,JSON[_0x76aa('0x13')](_0x3827ec));_0x25c614(_0x3827ec);})[_0x76aa('0x1d')](function(_0x928ccf){logger[_0x76aa('0x14')](_0x76aa('0x22'),_0x928ccf[_0x76aa('0x16')],_0xb5e8a9);_0x2e7ab4(_0x1d6d15['error'](0x1f4,_0x928ccf[_0x76aa('0x16')]));});});}; \ No newline at end of file +var _0x98a8=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./faxMessage.socket','register','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','raw','attributes','limit','stringify','lodash','util','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x98a8,0x12c));var _0x898a=function(_0x2998d3,_0x2489bb){_0x2998d3=_0x2998d3-0x0;var _0x5b3fdc=_0x98a8[_0x2998d3];return _0x5b3fdc;};'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});config[_0x898a('0xc')]=_['defaults'](config[_0x898a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x898a('0xd'))(new Redis(config[_0x898a('0xc')]));require(_0x898a('0xe'))[_0x898a('0xf')](socket);function respondWithRpcPromise(_0x3150df,_0x388a47,_0x42faa4){return new BPromise(function(_0x1a92de,_0x3806cb){return client['request'](_0x3150df,_0x42faa4)[_0x898a('0x10')](function(_0x502e95){logger[_0x898a('0x11')]('FaxMessage,\x20%s,\x20%s',_0x388a47,_0x898a('0x12'));logger[_0x898a('0x13')](_0x898a('0x14'),_0x388a47,'request\x20sent',JSON['stringify'](_0x502e95));if(_0x502e95['error']){if(_0x502e95[_0x898a('0x15')][_0x898a('0x16')]===0x1f4){logger[_0x898a('0x15')](_0x898a('0x17'),_0x388a47,_0x502e95[_0x898a('0x15')][_0x898a('0x18')]);return _0x3806cb(_0x502e95['error'][_0x898a('0x18')]);}logger['error'](_0x898a('0x17'),_0x388a47,_0x502e95['error'][_0x898a('0x18')]);return _0x1a92de(_0x502e95['error'][_0x898a('0x18')]);}else{logger['info'](_0x898a('0x17'),_0x388a47,_0x898a('0x12'));_0x1a92de(_0x502e95[_0x898a('0x19')]['message']);}})[_0x898a('0x1a')](function(_0x5960e0){logger['error'](_0x898a('0x17'),_0x388a47,_0x5960e0);_0x3806cb(_0x5960e0);});});}exports[_0x898a('0x1b')]=function(_0x58c3ab){var _0x4d374b=this;return new Promise(function(_0x12bc0f,_0x26449a){return db[_0x898a('0x1c')][_0x898a('0x1d')](_0x58c3ab[_0x898a('0x1e')],{'raw':_0x58c3ab[_0x898a('0x1f')]?_0x58c3ab[_0x898a('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x898a('0x10')](function(_0x50718e){logger[_0x898a('0x11')](_0x898a('0x1b'),_0x58c3ab);logger[_0x898a('0x13')](_0x898a('0x1b'),_0x58c3ab,JSON['stringify'](_0x50718e));_0x12bc0f(_0x50718e);})[_0x898a('0x1a')](function(_0x16c318){logger[_0x898a('0x15')](_0x898a('0x1b'),_0x16c318[_0x898a('0x18')],_0x58c3ab);_0x26449a(_0x4d374b[_0x898a('0x15')](0x1f4,_0x16c318['message']));});});};exports[_0x898a('0x20')]=function(_0x51d501){var _0x513c6b=this;return new Promise(function(_0x53ddb2,_0x3678be){return db[_0x898a('0x1c')][_0x898a('0x21')](_0x51d501[_0x898a('0x1e')],{'raw':_0x51d501[_0x898a('0x1f')]?_0x51d501[_0x898a('0x1f')][_0x898a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51d501[_0x898a('0x1f')]?_0x51d501[_0x898a('0x1f')]['where']||null:null,'attributes':_0x51d501['options']?_0x51d501['options'][_0x898a('0x23')]||null:null,'limit':_0x51d501[_0x898a('0x1f')]?_0x51d501[_0x898a('0x1f')][_0x898a('0x24')]||null:null})[_0x898a('0x10')](function(_0x560000){logger[_0x898a('0x11')](_0x898a('0x20'),_0x51d501);logger[_0x898a('0x13')](_0x898a('0x20'),_0x51d501,JSON[_0x898a('0x25')](_0x560000));_0x53ddb2(_0x560000);})[_0x898a('0x1a')](function(_0x494127){logger[_0x898a('0x15')](_0x898a('0x20'),_0x494127[_0x898a('0x18')],_0x51d501);_0x3678be(_0x513c6b[_0x898a('0x15')](0x1f4,_0x494127[_0x898a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 7302b59..50ce26d 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 _0x6e7e=['register','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x6e7e,0xaa));var _0xe6e7=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x6e7e[_0x5d9a85];return _0x1ef8aa;};'use strict';var FaxMessageEvents=require(_0xe6e7('0x0'));var events=[_0xe6e7('0x1'),_0xe6e7('0x2'),_0xe6e7('0x3')];function createListener(_0x3cc04d,_0xba4bfe){return function(_0x47508d){_0xba4bfe[_0xe6e7('0x4')](_0x3cc04d,_0x47508d);};}function removeListener(_0xab465f,_0x3c4fe2){return function(){FaxMessageEvents['removeListener'](_0xab465f,_0x3c4fe2);};}exports[_0xe6e7('0x5')]=function(_0x493208){for(var _0x556507=0x0,_0x50f702=events['length'];_0x556507<_0x50f702;_0x556507++){var _0x204b2e=events[_0x556507];var _0x489be0=createListener(_0xe6e7('0x6')+_0x204b2e,_0x493208);FaxMessageEvents['on'](_0x204b2e,_0x489be0);}}; \ No newline at end of file +var _0x4d37=['length','faxMessage:','./faxMessage.events','save','remove','update','emit','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4d37,0x192));var _0x74d3=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0x4d37[_0x395155];return _0x179767;};'use strict';var FaxMessageEvents=require(_0x74d3('0x0'));var events=[_0x74d3('0x1'),_0x74d3('0x2'),_0x74d3('0x3')];function createListener(_0x4e11b6,_0x46973a){return function(_0xd9a31){_0x46973a[_0x74d3('0x4')](_0x4e11b6,_0xd9a31);};}function removeListener(_0x5f41e,_0x2d8789){return function(){FaxMessageEvents['removeListener'](_0x5f41e,_0x2d8789);};}exports[_0x74d3('0x5')]=function(_0x5891a4){for(var _0x8bc47b=0x0,_0x3ab75e=events[_0x74d3('0x6')];_0x8bc47b<_0x3ab75e;_0x8bc47b++){var _0x535902=events[_0x8bc47b];var _0x46ec4b=createListener(_0x74d3('0x7')+_0x535902,_0x5891a4);FaxMessageEvents['on'](_0x535902,_0x46ec4b);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index a607ca5..07f2319 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 _0x4522=['destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','fax','faxmessage:create','create','put','reject'];(function(_0x377fa3,_0x3194e4){var _0x670765=function(_0x53ff81){while(--_0x53ff81){_0x377fa3['push'](_0x377fa3['shift']());}};_0x670765(++_0x3194e4);}(_0x4522,0x1a0));var _0x2452=function(_0x23e86a,_0x519c6e){_0x23e86a=_0x23e86a-0x0;var _0x3dbd93=_0x4522[_0x23e86a];return _0x3dbd93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['get']('/:id/download',auth[_0x2452('0x9')](),controller['download']);router['post']('/',auth[_0x2452('0x9')](),interaction[_0x2452('0xf')](_0x2452('0x10'),_0x2452('0x11')),controller[_0x2452('0x12')]);router[_0x2452('0x13')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x2452('0x9')](),controller['accept']);router[_0x2452('0x13')]('/:id/reject',auth[_0x2452('0x9')](),controller[_0x2452('0x14')]);router['delete'](_0x2452('0xd'),auth['isAuthenticated'](),controller[_0x2452('0x15')]);module[_0x2452('0x16')]=router; \ No newline at end of file +var _0xde2c=['/describe','describe','show','/:id/download','download','post','fax','faxmessage:create','create','put','/:id','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index'];(function(_0x5eb559,_0x28295e){var _0x5ec974=function(_0x269ff4){while(--_0x269ff4){_0x5eb559['push'](_0x5eb559['shift']());}};_0x5ec974(++_0x28295e);}(_0xde2c,0x7f));var _0xcde2=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0xde2c[_0x344adc];return _0x4014b2;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xcde2('0x13'),_0xcde2('0x14')),controller[_0xcde2('0x15')]);router[_0xcde2('0x16')](_0xcde2('0x17'),auth[_0xcde2('0xb')](),controller['update']);router[_0xcde2('0x16')]('/:id/accept',auth[_0xcde2('0xb')](),controller['accept']);router['put'](_0xcde2('0x18'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x19')]);router[_0xcde2('0x1a')](_0xcde2('0x17'),auth['isAuthenticated'](),controller[_0xcde2('0x1b')]);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 19ea94e..91df56a 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 _0xd0bd=['INTEGER','sequelize','exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2af29a,_0x4f44bc){var _0x5ef02f=function(_0x4349ef){while(--_0x4349ef){_0x2af29a['push'](_0x2af29a['shift']());}};_0x5ef02f(++_0x4f44bc);}(_0xd0bd,0x191));var _0xdd0b=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0xd0bd[_0x359bbe];return _0x1b3353;};'use strict';var Sequelize=require(_0xdd0b('0x0'));module[_0xdd0b('0x1')]={'name':{'type':Sequelize[_0xdd0b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdd0b('0x3')](_0xdd0b('0x4'),_0xdd0b('0x5'),_0xdd0b('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xdd0b('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x757b=['beepall','INTEGER','sequelize','STRING','name','ENUM'];(function(_0x443547,_0x21d7a8){var _0x1423a8=function(_0x2f8d47){while(--_0x2f8d47){_0x443547['push'](_0x443547['shift']());}};_0x1423a8(++_0x21d7a8);}(_0x757b,0x7a));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb757('0x0'));module['exports']={'name':{'type':Sequelize[_0xb757('0x1')],'unique':_0xb757('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb757('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb757('0x3')]('rrmemory',_0xb757('0x4'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb757('0x5')],'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 7d803a2..8dcf767 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 _0x3ea4=['findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','findAndCountAll','UserId','agent','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','flatMap','sequelize','each','findOrCreate','userFaxQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','all','union','compact','value','transaction','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','UserProfileResource','destroy','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','key','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x5ef582,_0x4d6bdd){var _0x40377e=function(_0x1d2b15){while(--_0x1d2b15){_0x5ef582['push'](_0x5ef582['shift']());}};_0x40377e(++_0x4d6bdd);}(_0x3ea4,0xd6));var _0x43ea=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x3ea4[_0xa388a2];return _0x7ce7f6;};'use strict';var emlformat=require(_0x43ea('0x0'));var rimraf=require(_0x43ea('0x1'));var zipdir=require(_0x43ea('0x2'));var jsonpatch=require(_0x43ea('0x3'));var rp=require('request-promise');var moment=require(_0x43ea('0x4'));var BPromise=require(_0x43ea('0x5'));var Mustache=require(_0x43ea('0x6'));var util=require(_0x43ea('0x7'));var path=require(_0x43ea('0x8'));var sox=require(_0x43ea('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43ea('0xa'));var _=require(_0x43ea('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43ea('0xc'));var deskjs=require(_0x43ea('0xd'));var toCsv=require(_0x43ea('0xe'));var querystring=require('querystring');var Papa=require(_0x43ea('0xf'));var Redis=require(_0x43ea('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x43ea('0x11'));var hardwareService=require(_0x43ea('0x12'));var logger=require(_0x43ea('0x13'))(_0x43ea('0x14'));var utils=require(_0x43ea('0x15'));var config=require(_0x43ea('0x16'));var licenseUtil=require(_0x43ea('0x17'));var db=require(_0x43ea('0x18'))['db'];config[_0x43ea('0x19')]=_[_0x43ea('0x1a')](config['redis'],{'host':_0x43ea('0x1b'),'port':0x18eb});var socket=require(_0x43ea('0x1c'))(new Redis(config['redis']));require(_0x43ea('0x1d'))[_0x43ea('0x1e')](socket);function respondWithStatusCode(_0x38fd21,_0x21abbf){_0x21abbf=_0x21abbf||0xcc;return function(_0x5b1e2c){if(_0x5b1e2c){return _0x38fd21[_0x43ea('0x1f')](_0x21abbf);}return _0x38fd21[_0x43ea('0x20')](_0x21abbf)[_0x43ea('0x21')]();};}function respondWithResult(_0x3868ad,_0x1dd7be){_0x1dd7be=_0x1dd7be||0xc8;return function(_0xfc6f65){if(_0xfc6f65){return _0x3868ad[_0x43ea('0x20')](_0x1dd7be)[_0x43ea('0x22')](_0xfc6f65);}};}function respondWithFilteredResult(_0x2f8557,_0x583b2d){return function(_0x37fc30){if(_0x37fc30){var _0x114268=typeof _0x583b2d[_0x43ea('0x23')]===_0x43ea('0x24')&&typeof _0x583b2d[_0x43ea('0x25')]===_0x43ea('0x24');var _0x55f17b=_0x37fc30[_0x43ea('0x26')];var _0x53b4d0=_0x114268?0x0:_0x583b2d['offset'];var _0x1fa890=_0x114268?_0x37fc30[_0x43ea('0x26')]:_0x583b2d[_0x43ea('0x23')]+_0x583b2d[_0x43ea('0x25')];var _0x4422d6;if(_0x1fa890>=_0x55f17b){_0x1fa890=_0x55f17b;_0x4422d6=0xc8;}else{_0x4422d6=0xce;}_0x2f8557[_0x43ea('0x20')](_0x4422d6);return _0x2f8557[_0x43ea('0x27')](_0x43ea('0x28'),_0x53b4d0+'-'+_0x1fa890+'/'+_0x55f17b)[_0x43ea('0x22')](_0x37fc30);}return null;};}function patchUpdates(_0x2fb844){return function(_0x429b76){try{jsonpatch['apply'](_0x429b76,_0x2fb844,!![]);}catch(_0x467e68){return BPromise['reject'](_0x467e68);}return _0x429b76[_0x43ea('0x29')]();};}function saveUpdates(_0x109900,_0x47e037){return function(_0x210dfc){if(_0x210dfc){return _0x210dfc[_0x43ea('0x2a')](_0x109900)[_0x43ea('0x2b')](function(_0xfcf2e5){return _0xfcf2e5;});}return null;};}function removeEntity(_0x788b3c,_0x3d131b){return function(_0x2596fd){if(_0x2596fd){return _0x2596fd['destroy']()[_0x43ea('0x2b')](function(){var _0x1ec79d=_0x2596fd['get']({'plain':!![]});var _0x5d816b='FaxQueues';return db[_0x43ea('0x2c')][_0x43ea('0x2d')]({'where':{'type':_0x5d816b,'resourceId':_0x1ec79d['id']}})['then'](function(){return _0x2596fd;});})[_0x43ea('0x2b')](function(){_0x788b3c['status'](0xcc)[_0x43ea('0x21')]();});}};}function handleEntityNotFound(_0x169dfe,_0x2848d4){return function(_0x18d32f){if(!_0x18d32f){_0x169dfe[_0x43ea('0x1f')](0x194);}return _0x18d32f;};}function handleError(_0x3e23fd,_0x1e739e){_0x1e739e=_0x1e739e||0x1f4;return function(_0x4ed8f4){logger[_0x43ea('0x2e')](_0x4ed8f4[_0x43ea('0x2f')]);if(_0x4ed8f4[_0x43ea('0x30')]){delete _0x4ed8f4['name'];}_0x3e23fd[_0x43ea('0x20')](_0x1e739e)['send'](_0x4ed8f4);};}exports[_0x43ea('0x31')]=function(_0x4514f9,_0x38dd3d){var _0x2ee764={},_0x437da={},_0x5436df={'count':0x0,'rows':[]};var _0x4532b3=_[_0x43ea('0x32')](db[_0x43ea('0x33')][_0x43ea('0x34')],function(_0x415bc6){return{'name':_0x415bc6[_0x43ea('0x35')],'type':_0x415bc6['type'][_0x43ea('0x36')]};});_0x437da['model']=_[_0x43ea('0x32')](_0x4532b3,_0x43ea('0x30'));_0x437da['query']=_['keys'](_0x4514f9['query']);_0x437da[_0x43ea('0x37')]=_[_0x43ea('0x38')](_0x437da[_0x43ea('0x39')],_0x437da[_0x43ea('0x3a')]);_0x2ee764['attributes']=_['intersection'](_0x437da['model'],qs[_0x43ea('0x3b')](_0x4514f9['query'][_0x43ea('0x3b')]));_0x2ee764[_0x43ea('0x3c')]=_0x2ee764[_0x43ea('0x3c')][_0x43ea('0x3d')]?_0x2ee764[_0x43ea('0x3c')]:_0x437da[_0x43ea('0x39')];if(!_0x4514f9[_0x43ea('0x3a')][_0x43ea('0x3e')](_0x43ea('0x3f'))){_0x2ee764[_0x43ea('0x25')]=qs['limit'](_0x4514f9['query'][_0x43ea('0x25')]);_0x2ee764[_0x43ea('0x23')]=qs[_0x43ea('0x23')](_0x4514f9[_0x43ea('0x3a')][_0x43ea('0x23')]);}_0x2ee764[_0x43ea('0x40')]=qs['sort'](_0x4514f9[_0x43ea('0x3a')][_0x43ea('0x41')]);_0x2ee764[_0x43ea('0x42')]=qs['filters'](_[_0x43ea('0x43')](_0x4514f9[_0x43ea('0x3a')],_0x437da[_0x43ea('0x37')]),_0x4532b3);if(_0x4514f9[_0x43ea('0x3a')][_0x43ea('0x44')]){_0x2ee764[_0x43ea('0x42')]=_[_0x43ea('0x45')](_0x2ee764['where'],{'$or':_[_0x43ea('0x32')](_0x4532b3,function(_0x4b7f99){if(_0x4b7f99['type']!==_0x43ea('0x46')){var _0x41b73a={};_0x41b73a[_0x4b7f99[_0x43ea('0x30')]]={'$like':'%'+_0x4514f9[_0x43ea('0x3a')][_0x43ea('0x44')]+'%'};return _0x41b73a;}})});}_0x2ee764=_[_0x43ea('0x45')]({},_0x2ee764,_0x4514f9[_0x43ea('0x47')]);var _0x5d2dfc={'where':_0x2ee764[_0x43ea('0x42')]};return db[_0x43ea('0x33')]['count'](_0x5d2dfc)[_0x43ea('0x2b')](function(_0x35f34e){_0x5436df[_0x43ea('0x26')]=_0x35f34e;if(_0x4514f9[_0x43ea('0x3a')][_0x43ea('0x48')]){_0x2ee764[_0x43ea('0x49')]=[{'all':!![]}];}return db[_0x43ea('0x33')][_0x43ea('0x4a')](_0x2ee764);})[_0x43ea('0x2b')](function(_0x4da212){_0x5436df[_0x43ea('0x4b')]=_0x4da212;return _0x5436df;})[_0x43ea('0x2b')](respondWithFilteredResult(_0x38dd3d,_0x2ee764))[_0x43ea('0x4c')](handleError(_0x38dd3d,null));};exports[_0x43ea('0x4d')]=function(_0x5416ba,_0xa17ba0){var _0x124bc0={'raw':!![],'where':{'id':_0x5416ba[_0x43ea('0x4e')]['id']}},_0x5a8ceb={};_0x5a8ceb[_0x43ea('0x39')]=_['keys'](db[_0x43ea('0x33')][_0x43ea('0x34')]);_0x5a8ceb[_0x43ea('0x3a')]=_[_0x43ea('0x4f')](_0x5416ba['query']);_0x5a8ceb[_0x43ea('0x37')]=_[_0x43ea('0x38')](_0x5a8ceb[_0x43ea('0x39')],_0x5a8ceb[_0x43ea('0x3a')]);_0x124bc0[_0x43ea('0x3c')]=_[_0x43ea('0x38')](_0x5a8ceb['model'],qs['fields'](_0x5416ba[_0x43ea('0x3a')][_0x43ea('0x3b')]));_0x124bc0[_0x43ea('0x3c')]=_0x124bc0[_0x43ea('0x3c')]['length']?_0x124bc0['attributes']:_0x5a8ceb[_0x43ea('0x39')];if(_0x5416ba[_0x43ea('0x3a')][_0x43ea('0x48')]){_0x124bc0['include']=[{'all':!![]}];}_0x124bc0=_[_0x43ea('0x45')]({},_0x124bc0,_0x5416ba['options']);return db[_0x43ea('0x33')][_0x43ea('0x50')](_0x124bc0)['then'](handleEntityNotFound(_0xa17ba0,null))[_0x43ea('0x2b')](respondWithResult(_0xa17ba0,null))[_0x43ea('0x4c')](handleError(_0xa17ba0,null));};exports[_0x43ea('0x51')]=function(_0x45c4b3,_0x3d9cb3){return db[_0x43ea('0x33')][_0x43ea('0x51')](_0x45c4b3[_0x43ea('0x52')],{})[_0x43ea('0x2b')](function(_0x2aef26){var _0x1d7147=_0x45c4b3[_0x43ea('0x53')][_0x43ea('0x54')]({'plain':!![]});if(!_0x1d7147)throw new Error(_0x43ea('0x55'));if(_0x1d7147[_0x43ea('0x56')]===_0x43ea('0x53')){var _0x4b4fac=_0x2aef26['get']({'plain':!![]});var _0x1bede5=_0x43ea('0x57');return db[_0x43ea('0x58')]['find']({'where':{'name':_0x1bede5,'userProfileId':_0x1d7147['userProfileId']},'raw':!![]})['then'](function(_0x315877){if(_0x315877&&_0x315877['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4b4fac[_0x43ea('0x30')],'resourceId':_0x4b4fac['id'],'type':_0x315877[_0x43ea('0x30')],'sectionId':_0x315877['id']},{})['then'](function(){return _0x2aef26;});}else{return _0x2aef26;}})['catch'](function(_0x4c476f){logger['error'](_0x43ea('0x59'),_0x4c476f);throw _0x4c476f;});}return _0x2aef26;})['then'](respondWithResult(_0x3d9cb3,0xc9))[_0x43ea('0x4c')](handleError(_0x3d9cb3,null));};exports[_0x43ea('0x2a')]=function(_0x376ff0,_0xeda66e){if(_0x376ff0[_0x43ea('0x52')]['id']){delete _0x376ff0[_0x43ea('0x52')]['id'];}return db[_0x43ea('0x33')]['find']({'where':{'id':_0x376ff0['params']['id']}})[_0x43ea('0x2b')](handleEntityNotFound(_0xeda66e,null))[_0x43ea('0x2b')](saveUpdates(_0x376ff0['body'],null))[_0x43ea('0x2b')](respondWithResult(_0xeda66e,null))['catch'](handleError(_0xeda66e,null));};exports[_0x43ea('0x2d')]=function(_0x5a5b82,_0x28cee3){return db[_0x43ea('0x33')][_0x43ea('0x50')]({'where':{'id':_0x5a5b82[_0x43ea('0x4e')]['id']}})['then'](handleEntityNotFound(_0x28cee3,null))[_0x43ea('0x2b')](removeEntity(_0x28cee3,null))[_0x43ea('0x4c')](handleError(_0x28cee3,null));};exports[_0x43ea('0x5a')]=function(_0x39de99,_0x42f957){return db[_0x43ea('0x33')][_0x43ea('0x5a')]()[_0x43ea('0x2b')](respondWithResult(_0x42f957,null))[_0x43ea('0x4c')](handleError(_0x42f957,null));};exports[_0x43ea('0x5b')]=function(_0x4fe23d,_0x237be3,_0x2ba23e){var _0x3a08b3={'raw':!![],'where':{}},_0x7e2992={},_0x5ef917;return db['FaxQueue'][_0x43ea('0x5c')]({'where':{'id':_0x4fe23d['params']['id']}})[_0x43ea('0x2b')](handleEntityNotFound(_0x237be3,null))[_0x43ea('0x2b')](function(_0x2e385b){if(_0x2e385b){_0x5ef917=_0x2e385b[_0x43ea('0x54')]({'plain':!![]});_0x7e2992['model']=_[_0x43ea('0x4f')](db[_0x43ea('0x5d')]['rawAttributes']);_0x7e2992[_0x43ea('0x3a')]=_['keys'](_0x4fe23d[_0x43ea('0x3a')]);_0x7e2992[_0x43ea('0x37')]=_['intersection'](_0x7e2992[_0x43ea('0x39')],_0x7e2992[_0x43ea('0x3a')]);_0x3a08b3[_0x43ea('0x3c')]=_[_0x43ea('0x38')](_0x7e2992[_0x43ea('0x39')],qs['fields'](_0x4fe23d[_0x43ea('0x3a')][_0x43ea('0x3b')]));_0x3a08b3['attributes']=_0x3a08b3[_0x43ea('0x3c')][_0x43ea('0x3d')]?_0x3a08b3[_0x43ea('0x3c')]:_0x7e2992[_0x43ea('0x39')];if(!_0x4fe23d[_0x43ea('0x3a')]['hasOwnProperty'](_0x43ea('0x3f'))){_0x3a08b3[_0x43ea('0x25')]=qs['limit'](_0x4fe23d[_0x43ea('0x3a')]['limit']);_0x3a08b3[_0x43ea('0x23')]=qs[_0x43ea('0x23')](_0x4fe23d[_0x43ea('0x3a')]['offset']);}_0x3a08b3[_0x43ea('0x40')]=qs[_0x43ea('0x41')](_0x4fe23d['query'][_0x43ea('0x41')]);_0x3a08b3[_0x43ea('0x42')]=qs[_0x43ea('0x37')](_[_0x43ea('0x43')](_0x4fe23d['query'],_0x7e2992[_0x43ea('0x37')]));_0x3a08b3[_0x43ea('0x42')]['FaxQueueId']=_0x2e385b['id'];if(_0x4fe23d[_0x43ea('0x3a')][_0x43ea('0x44')]){_0x3a08b3[_0x43ea('0x42')]=_[_0x43ea('0x45')](_0x3a08b3[_0x43ea('0x42')],{'$or':_[_0x43ea('0x32')](_0x3a08b3[_0x43ea('0x3c')],function(_0x433821){var _0x3bcde4={};_0x3bcde4[_0x433821]={'$like':'%'+_0x4fe23d[_0x43ea('0x3a')][_0x43ea('0x44')]+'%'};return _0x3bcde4;})});}_0x3a08b3=_[_0x43ea('0x45')]({},_0x3a08b3,_0x4fe23d[_0x43ea('0x47')]);return db[_0x43ea('0x5d')][_0x43ea('0x4a')](_0x3a08b3);}})['then'](function(_0x5d55e9){if(_0x5d55e9){return db['User'][_0x43ea('0x5e')]({'where':{'id':_[_0x43ea('0x32')](_0x5d55e9,_0x43ea('0x5f')),'role':_0x43ea('0x60')},'attributes':['id',_0x43ea('0x30'),'faxPause',_0x43ea('0x61'),'createdAt']});}})[_0x43ea('0x2b')](function(_0x2da951){if(_0x2da951){return{'count':_0x2da951[_0x43ea('0x26')],'rows':_[_0x43ea('0x32')](_0x2da951[_0x43ea('0x4b')],function(_0x2f61ef){return{'membername':_0x2f61ef[_0x43ea('0x30')],'UserId':_0x2f61ef['id'],'queue_name':_0x5ef917[_0x43ea('0x30')],'FaxQueueId':_0x5ef917['id'],'interface':util['format'](_0x43ea('0x62'),_0x43ea('0x63'),_0x2f61ef['name']),'penalty':0x0,'paused':_0x2f61ef['faxPause'],'createdAt':_0x2f61ef[_0x43ea('0x64')],'updatedAt':_0x2f61ef[_0x43ea('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x43ea('0x2b')](respondWithFilteredResult(_0x237be3,_0x3a08b3))['catch'](handleError(_0x237be3,null));};exports[_0x43ea('0x65')]=function(_0x34127b,_0x13dc25,_0x213a2b){var _0x5b9357={};var _0x5c1fb9={};var _0xd8a872;var _0x3d7239;return db[_0x43ea('0x33')]['findOne']({'where':{'id':_0x34127b[_0x43ea('0x4e')]['id']}})[_0x43ea('0x2b')](handleEntityNotFound(_0x13dc25,null))['then'](function(_0xb9f13d){if(_0xb9f13d){_0xd8a872=_0xb9f13d;_0x5c1fb9['model']=_['keys'](db[_0x43ea('0x66')][_0x43ea('0x34')]);_0x5c1fb9[_0x43ea('0x3a')]=_[_0x43ea('0x4f')](_0x34127b['query']);_0x5c1fb9[_0x43ea('0x37')]=_['intersection'](_0x5c1fb9[_0x43ea('0x39')],_0x5c1fb9['query']);_0x5b9357[_0x43ea('0x3c')]=_[_0x43ea('0x38')](_0x5c1fb9[_0x43ea('0x39')],qs['fields'](_0x34127b[_0x43ea('0x3a')][_0x43ea('0x3b')]));_0x5b9357[_0x43ea('0x3c')]=_0x5b9357[_0x43ea('0x3c')]['length']?_0x5b9357['attributes']:_0x5c1fb9[_0x43ea('0x39')];_0x5b9357[_0x43ea('0x40')]=qs[_0x43ea('0x41')](_0x34127b['query'][_0x43ea('0x41')]);_0x5b9357[_0x43ea('0x42')]=qs[_0x43ea('0x37')](_[_0x43ea('0x43')](_0x34127b['query'],_0x5c1fb9[_0x43ea('0x37')]));if(_0x34127b[_0x43ea('0x3a')][_0x43ea('0x44')]){_0x5b9357['where']=_[_0x43ea('0x45')](_0x5b9357['where'],{'$or':_['map'](_0x5b9357[_0x43ea('0x3c')],function(_0x47244c){var _0xe57bdf={};_0xe57bdf[_0x47244c]={'$like':'%'+_0x34127b['query']['filter']+'%'};return _0xe57bdf;})});}_0x5b9357=_['merge']({},_0x5b9357,_0x34127b[_0x43ea('0x47')]);return _0xd8a872[_0x43ea('0x65')](_0x5b9357);}})[_0x43ea('0x2b')](function(_0x31d264){if(_0x31d264){_0x3d7239=_0x31d264[_0x43ea('0x3d')];if(!_0x34127b[_0x43ea('0x3a')][_0x43ea('0x3e')](_0x43ea('0x3f'))){_0x5b9357[_0x43ea('0x25')]=qs[_0x43ea('0x25')](_0x34127b[_0x43ea('0x3a')]['limit']);_0x5b9357[_0x43ea('0x23')]=qs[_0x43ea('0x23')](_0x34127b[_0x43ea('0x3a')][_0x43ea('0x23')]);}return _0xd8a872['getTeams'](_0x5b9357);}})[_0x43ea('0x2b')](function(_0x2da79e){if(_0x2da79e){return _0x2da79e?{'count':_0x3d7239,'rows':_0x2da79e}:null;}})[_0x43ea('0x2b')](respondWithResult(_0x13dc25,null))[_0x43ea('0x4c')](handleError(_0x13dc25,null));};exports[_0x43ea('0x67')]=function(_0x50e635,_0x15596b,_0x5adbe9){var _0x3638a7=_0x50e635[_0x43ea('0x52')][_0x43ea('0x68')];return db[_0x43ea('0x66')][_0x43ea('0x4a')]({'where':{'id':_0x3638a7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x43ea('0x69'),'attributes':['id','name',_0x43ea('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x43ea('0x2b')](function(_0x16a011){if(_0x16a011){var _0x2dc2a1=_[_0x43ea('0x6b')](_0x16a011,function(_0x5bab77){var _0x229ffe=_0x5bab77[_0x43ea('0x54')]({'plain':!![]});return _0x229ffe[_0x43ea('0x69')];});return db[_0x43ea('0x33')][_0x43ea('0x50')]({'where':{'id':_0x50e635[_0x43ea('0x4e')]['id']}})[_0x43ea('0x2b')](function(_0x4d68c4){return db[_0x43ea('0x6c')]['transaction'](function(_0x4b378d){return _0x4d68c4[_0x43ea('0x67')](_0x3638a7,{'transaction':_0x4b378d})['then'](function(){return BPromise[_0x43ea('0x6d')](_0x2dc2a1,function(_0x555fec){return db[_0x43ea('0x5d')][_0x43ea('0x6e')]({'where':{'UserId':_0x555fec['id'],'FaxQueueId':_0x50e635['params']['id']},'transaction':_0x4b378d});});})[_0x43ea('0x2b')](function(){_0x2dc2a1['forEach'](function(_0x11498d){socket['emit'](_0x43ea('0x6f'),{'UserId':_0x11498d['id'],'FaxQueueId':_0x4d68c4['id']});});});});});}})[_0x43ea('0x2b')](respondWithStatusCode(_0x15596b,null))['catch'](handleError(_0x15596b,null));};exports[_0x43ea('0x70')]=function(_0x489b82,_0x172871,_0x47c0d2){return db[_0x43ea('0x66')][_0x43ea('0x4a')]({'where':{'id':_0x489b82['query'][_0x43ea('0x68')]},'attributes':['id'],'include':[{'model':db[_0x43ea('0x71')],'as':_0x43ea('0x69'),'attributes':['id'],'raw':!![]}]})[_0x43ea('0x2b')](handleEntityNotFound(_0x172871,null))[_0x43ea('0x2b')](function(_0x4a8b65){var _0x9e0a21=_['map'](_0x4a8b65,'id');var _0x592e14=[];var _0x32ab50=[];var _0x3f1013=squel[_0x43ea('0x72')]();_0x3f1013[_0x43ea('0x73')](_0x43ea('0x74'))[_0x43ea('0x75')](_0x43ea('0x76'),'tq')[_0x43ea('0x77')](_0x43ea('0x78'),'ut',_0x43ea('0x79'))[_0x43ea('0x42')](_0x43ea('0x7a'),_0x489b82[_0x43ea('0x4e')]['id']);for(var _0x26d965=0x0;_0x26d965<_0x4a8b65[_0x43ea('0x3d')];_0x26d965+=0x1){let _0x26dc25=_0x4a8b65[_0x26d965];for(var _0x5b0b00=0x0;_0x5b0b00<_0x26dc25[_0x43ea('0x69')][_0x43ea('0x3d')];_0x5b0b00+=0x1){let _0x46d955=_0x26dc25['Agents'][_0x5b0b00];var _0x1d2c3e=_0x3f1013[_0x43ea('0x7b')]();_0x1d2c3e['where']('ut.UserId\x20=\x20?',_0x46d955['id']);_0x32ab50[_0x43ea('0x7c')](db[_0x43ea('0x6c')][_0x43ea('0x3a')](_0x1d2c3e[_0x43ea('0x7d')](),{'type':db[_0x43ea('0x6c')][_0x43ea('0x7e')]['SELECT']})[_0x43ea('0x2b')](function(_0x514d0f){if(_0x514d0f[_0x43ea('0x3d')]===0x1){return _0x46d955['id'];}else{var _0x59dc19=_[_0x43ea('0x7f')](_[_0x43ea('0x32')](_0x514d0f,_0x43ea('0x80')),function(_0x289d81){return _['includes'](_0x9e0a21,_0x289d81);});if(_0x59dc19){return _0x46d955['id'];}}}));}}return BPromise[_0x43ea('0x81')](_0x32ab50)[_0x43ea('0x2b')](function(_0x545ab9){_0x592e14=_(_0x592e14)[_0x43ea('0x82')](_0x545ab9)[_0x43ea('0x83')]()[_0x43ea('0x84')]();return db[_0x43ea('0x33')][_0x43ea('0x50')]({'where':{'id':_0x489b82['params']['id']}})[_0x43ea('0x2b')](function(_0x3b0fa7){return db[_0x43ea('0x6c')][_0x43ea('0x85')](function(_0x4d4c40){return _0x3b0fa7[_0x43ea('0x70')](_0x489b82['query']['ids'],{'transaction':_0x4d4c40})[_0x43ea('0x2b')](function(){if(!_[_0x43ea('0x86')](_0x592e14)){return _0x3b0fa7['removeAgents'](_0x592e14,{'transaction':_0x4d4c40});}})[_0x43ea('0x2b')](function(){_0x592e14[_0x43ea('0x87')](function(_0x2b134d){socket['emit'](_0x43ea('0x88'),{'UserId':_0x2b134d,'FaxQueueId':_0x3b0fa7['id']});});});});});});})[_0x43ea('0x2b')](respondWithStatusCode(_0x172871,null))[_0x43ea('0x4c')](handleError(_0x172871,null));};exports[_0x43ea('0x89')]=function(_0x4742cd,_0x1c7b91,_0x3127ef){return db[_0x43ea('0x33')][_0x43ea('0x50')]({'where':{'id':_0x4742cd[_0x43ea('0x4e')]['id']}})[_0x43ea('0x2b')](handleEntityNotFound(_0x1c7b91,null))[_0x43ea('0x2b')](function(_0x273c50){if(_0x273c50){return _0x273c50['addAgents'](_0x4742cd[_0x43ea('0x52')][_0x43ea('0x68')],_[_0x43ea('0x8a')](_0x4742cd[_0x43ea('0x52')],[_0x43ea('0x68'),'id'])||{})[_0x43ea('0x8b')](function(_0x580ebd){for(var _0x1cc5ca=0x0;_0x1cc5ca<_0x4742cd['body'][_0x43ea('0x68')][_0x43ea('0x3d')];_0x1cc5ca+=0x1){socket['emit'](_0x43ea('0x6f'),{'UserId':Number(_0x4742cd[_0x43ea('0x52')]['ids'][_0x1cc5ca]),'FaxQueueId':Number(_0x4742cd[_0x43ea('0x4e')]['id'])});}return _0x580ebd;});}})['then'](respondWithResult(_0x1c7b91,null))[_0x43ea('0x4c')](handleError(_0x1c7b91,null));};exports[_0x43ea('0x8c')]=function(_0x1281db,_0x30853e,_0xa8759a){return db[_0x43ea('0x33')]['find']({'where':{'id':_0x1281db[_0x43ea('0x4e')]['id']}})[_0x43ea('0x2b')](handleEntityNotFound(_0x30853e,null))[_0x43ea('0x2b')](function(_0x515d8b){if(_0x515d8b){return _0x515d8b['removeAgents'](_0x1281db[_0x43ea('0x3a')][_0x43ea('0x68')])['then'](function(){if(_[_0x43ea('0x8d')](_0x1281db[_0x43ea('0x3a')][_0x43ea('0x68')])){for(var _0x213197=0x0;_0x213197<_0x1281db[_0x43ea('0x3a')][_0x43ea('0x68')][_0x43ea('0x3d')];_0x213197+=0x1){socket[_0x43ea('0x8e')](_0x43ea('0x88'),{'UserId':Number(_0x1281db['query'][_0x43ea('0x68')][_0x213197]),'FaxQueueId':Number(_0x1281db[_0x43ea('0x4e')]['id'])});}}else{socket['emit'](_0x43ea('0x88'),{'UserId':Number(_0x1281db[_0x43ea('0x3a')]['ids']),'FaxQueueId':Number(_0x1281db[_0x43ea('0x4e')]['id'])});}});}})[_0x43ea('0x2b')](respondWithStatusCode(_0x30853e,null))[_0x43ea('0x4c')](handleError(_0x30853e,null));};exports[_0x43ea('0x8f')]=function(_0x19b26e,_0x124cc3,_0x4883e0){var _0x4572f3={};var _0x184d42={};var _0x1ffeef;var _0x2fd56a;return db['FaxQueue'][_0x43ea('0x5c')]({'where':{'id':_0x19b26e[_0x43ea('0x4e')]['id']}})['then'](handleEntityNotFound(_0x124cc3,null))[_0x43ea('0x2b')](function(_0x5060cb){if(_0x5060cb){_0x1ffeef=_0x5060cb;_0x184d42[_0x43ea('0x39')]=_[_0x43ea('0x4f')](db['User'][_0x43ea('0x34')]);_0x184d42['query']=_[_0x43ea('0x4f')](_0x19b26e[_0x43ea('0x3a')]);_0x184d42[_0x43ea('0x37')]=_['intersection'](_0x184d42['model'],_0x184d42[_0x43ea('0x3a')]);_0x4572f3[_0x43ea('0x3c')]=_[_0x43ea('0x38')](_0x184d42[_0x43ea('0x39')],qs[_0x43ea('0x3b')](_0x19b26e[_0x43ea('0x3a')][_0x43ea('0x3b')]));_0x4572f3[_0x43ea('0x3c')]=_0x4572f3[_0x43ea('0x3c')][_0x43ea('0x3d')]?_0x4572f3[_0x43ea('0x3c')]:_0x184d42[_0x43ea('0x39')];_0x4572f3[_0x43ea('0x40')]=qs[_0x43ea('0x41')](_0x19b26e[_0x43ea('0x3a')][_0x43ea('0x41')]);_0x4572f3[_0x43ea('0x42')]=qs['filters'](_[_0x43ea('0x43')](_0x19b26e['query'],_0x184d42['filters']));if(_0x19b26e['query'][_0x43ea('0x44')]){_0x4572f3[_0x43ea('0x42')]=_['merge'](_0x4572f3[_0x43ea('0x42')],{'$or':_[_0x43ea('0x32')](_0x4572f3[_0x43ea('0x3c')],function(_0x1d2d6a){var _0x376df9={};_0x376df9[_0x1d2d6a]={'$like':'%'+_0x19b26e[_0x43ea('0x3a')][_0x43ea('0x44')]+'%'};return _0x376df9;})});}_0x4572f3=_[_0x43ea('0x45')]({},_0x4572f3,_0x19b26e[_0x43ea('0x47')]);return _0x1ffeef[_0x43ea('0x8f')](_0x4572f3);}})['then'](function(_0x3a431c){if(_0x3a431c){_0x2fd56a=_0x3a431c[_0x43ea('0x3d')];if(!_0x19b26e[_0x43ea('0x3a')]['hasOwnProperty'](_0x43ea('0x3f'))){_0x4572f3['limit']=qs[_0x43ea('0x25')](_0x19b26e[_0x43ea('0x3a')][_0x43ea('0x25')]);_0x4572f3[_0x43ea('0x23')]=qs['offset'](_0x19b26e[_0x43ea('0x3a')]['offset']);}return _0x1ffeef[_0x43ea('0x8f')](_0x4572f3);}})['then'](function(_0x30b173){if(_0x30b173){return _0x30b173?{'count':_0x2fd56a,'rows':_0x30b173}:null;}})[_0x43ea('0x2b')](respondWithResult(_0x124cc3,null))[_0x43ea('0x4c')](handleError(_0x124cc3,null));}; \ No newline at end of file +var _0x197e=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','then','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','FaxQueueId','UserFaxQueue','findAndCountAll','agent','faxPause','updatedAt','createdAt','%s/%s','getTeams','Team','nolimit','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','all','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse'];(function(_0x22b9b2,_0xd46817){var _0x7ee463=function(_0x81a082){while(--_0x81a082){_0x22b9b2['push'](_0x22b9b2['shift']());}};_0x7ee463(++_0xd46817);}(_0x197e,0x104));var _0xe197=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x197e[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe197('0x0'));var jsonpatch=require(_0xe197('0x1'));var rp=require(_0xe197('0x2'));var moment=require('moment');var BPromise=require(_0xe197('0x3'));var Mustache=require(_0xe197('0x4'));var util=require('util');var path=require(_0xe197('0x5'));var sox=require(_0xe197('0x6'));var csv=require(_0xe197('0x7'));var ejs=require(_0xe197('0x8'));var fs=require('fs');var fs_extra=require(_0xe197('0x9'));var _=require('lodash');var squel=require(_0xe197('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe197('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe197('0xc'));var Papa=require(_0xe197('0xd'));var Redis=require(_0xe197('0xe'));var authService=require(_0xe197('0xf'));var qs=require(_0xe197('0x10'));var as=require(_0xe197('0x11'));var hardwareService=require(_0xe197('0x12'));var logger=require(_0xe197('0x13'))(_0xe197('0x14'));var utils=require(_0xe197('0x15'));var config=require(_0xe197('0x16'));var licenseUtil=require(_0xe197('0x17'));var db=require(_0xe197('0x18'))['db'];config[_0xe197('0x19')]=_['defaults'](config[_0xe197('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe197('0x1a'))(new Redis(config['redis']));require(_0xe197('0x1b'))[_0xe197('0x1c')](socket);function respondWithStatusCode(_0xd36f24,_0x4fb915){_0x4fb915=_0x4fb915||0xcc;return function(_0x54fcc7){if(_0x54fcc7){return _0xd36f24[_0xe197('0x1d')](_0x4fb915);}return _0xd36f24[_0xe197('0x1e')](_0x4fb915)[_0xe197('0x1f')]();};}function respondWithResult(_0x3ac2c3,_0x492174){_0x492174=_0x492174||0xc8;return function(_0x4c600d){if(_0x4c600d){return _0x3ac2c3[_0xe197('0x1e')](_0x492174)[_0xe197('0x20')](_0x4c600d);}};}function respondWithFilteredResult(_0x251afb,_0x2394b3){return function(_0x835122){if(_0x835122){var _0x2429c2=typeof _0x2394b3[_0xe197('0x21')]===_0xe197('0x22')&&typeof _0x2394b3[_0xe197('0x23')]==='undefined';var _0x105317=_0x835122[_0xe197('0x24')];var _0x28bf1a=_0x2429c2?0x0:_0x2394b3[_0xe197('0x21')];var _0x301de5=_0x2429c2?_0x835122[_0xe197('0x24')]:_0x2394b3[_0xe197('0x21')]+_0x2394b3[_0xe197('0x23')];var _0x21206d;if(_0x301de5>=_0x105317){_0x301de5=_0x105317;_0x21206d=0xc8;}else{_0x21206d=0xce;}_0x251afb[_0xe197('0x1e')](_0x21206d);return _0x251afb[_0xe197('0x25')]('Content-Range',_0x28bf1a+'-'+_0x301de5+'/'+_0x105317)[_0xe197('0x20')](_0x835122);}return null;};}function patchUpdates(_0x31600a){return function(_0x224adc){try{jsonpatch['apply'](_0x224adc,_0x31600a,!![]);}catch(_0x1e16eb){return BPromise['reject'](_0x1e16eb);}return _0x224adc['save']();};}function saveUpdates(_0x451caf,_0x247182){return function(_0x173849){if(_0x173849){return _0x173849['update'](_0x451caf)['then'](function(_0x5998fd){return _0x5998fd;});}return null;};}function removeEntity(_0x5ae184,_0x45f459){return function(_0x200c38){if(_0x200c38){return _0x200c38[_0xe197('0x26')]()[_0xe197('0x27')](function(){var _0x48bde9=_0x200c38['get']({'plain':!![]});var _0x41d12e='FaxQueues';return db[_0xe197('0x28')][_0xe197('0x26')]({'where':{'type':_0x41d12e,'resourceId':_0x48bde9['id']}})['then'](function(){return _0x200c38;});})[_0xe197('0x27')](function(){_0x5ae184[_0xe197('0x1e')](0xcc)[_0xe197('0x1f')]();});}};}function handleEntityNotFound(_0x329d77,_0x164bdc){return function(_0x24e20a){if(!_0x24e20a){_0x329d77[_0xe197('0x1d')](0x194);}return _0x24e20a;};}function handleError(_0x54f492,_0x44a7d1){_0x44a7d1=_0x44a7d1||0x1f4;return function(_0x3f0c0a){logger[_0xe197('0x29')](_0x3f0c0a[_0xe197('0x2a')]);if(_0x3f0c0a[_0xe197('0x2b')]){delete _0x3f0c0a['name'];}_0x54f492[_0xe197('0x1e')](_0x44a7d1)[_0xe197('0x2c')](_0x3f0c0a);};}exports[_0xe197('0x2d')]=function(_0x525a5d,_0x2cd526){var _0x12711c={},_0x26ff66={},_0x4dcb02={'count':0x0,'rows':[]};var _0x53d528=_[_0xe197('0x2e')](db[_0xe197('0x2f')][_0xe197('0x30')],function(_0x2dce4c){return{'name':_0x2dce4c[_0xe197('0x31')],'type':_0x2dce4c[_0xe197('0x32')]['key']};});_0x26ff66[_0xe197('0x33')]=_[_0xe197('0x2e')](_0x53d528,'name');_0x26ff66[_0xe197('0x34')]=_[_0xe197('0x35')](_0x525a5d[_0xe197('0x34')]);_0x26ff66['filters']=_[_0xe197('0x36')](_0x26ff66['model'],_0x26ff66[_0xe197('0x34')]);_0x12711c['attributes']=_['intersection'](_0x26ff66[_0xe197('0x33')],qs[_0xe197('0x37')](_0x525a5d[_0xe197('0x34')][_0xe197('0x37')]));_0x12711c[_0xe197('0x38')]=_0x12711c[_0xe197('0x38')][_0xe197('0x39')]?_0x12711c[_0xe197('0x38')]:_0x26ff66[_0xe197('0x33')];if(!_0x525a5d[_0xe197('0x34')][_0xe197('0x3a')]('nolimit')){_0x12711c[_0xe197('0x23')]=qs[_0xe197('0x23')](_0x525a5d['query'][_0xe197('0x23')]);_0x12711c[_0xe197('0x21')]=qs['offset'](_0x525a5d[_0xe197('0x34')][_0xe197('0x21')]);}_0x12711c['order']=qs[_0xe197('0x3b')](_0x525a5d[_0xe197('0x34')][_0xe197('0x3b')]);_0x12711c[_0xe197('0x3c')]=qs['filters'](_[_0xe197('0x3d')](_0x525a5d['query'],_0x26ff66[_0xe197('0x3e')]),_0x53d528);if(_0x525a5d[_0xe197('0x34')]['filter']){_0x12711c[_0xe197('0x3c')]=_[_0xe197('0x3f')](_0x12711c['where'],{'$or':_[_0xe197('0x2e')](_0x53d528,function(_0x2b854f){if(_0x2b854f['type']!=='VIRTUAL'){var _0x53d9f1={};_0x53d9f1[_0x2b854f[_0xe197('0x2b')]]={'$like':'%'+_0x525a5d[_0xe197('0x34')][_0xe197('0x40')]+'%'};return _0x53d9f1;}})});}_0x12711c=_[_0xe197('0x3f')]({},_0x12711c,_0x525a5d[_0xe197('0x41')]);var _0x1d1648={'where':_0x12711c[_0xe197('0x3c')]};return db[_0xe197('0x2f')][_0xe197('0x24')](_0x1d1648)['then'](function(_0x702ada){_0x4dcb02['count']=_0x702ada;if(_0x525a5d[_0xe197('0x34')][_0xe197('0x42')]){_0x12711c[_0xe197('0x43')]=[{'all':!![]}];}return db[_0xe197('0x2f')][_0xe197('0x44')](_0x12711c);})[_0xe197('0x27')](function(_0x529a13){_0x4dcb02[_0xe197('0x45')]=_0x529a13;return _0x4dcb02;})[_0xe197('0x27')](respondWithFilteredResult(_0x2cd526,_0x12711c))[_0xe197('0x46')](handleError(_0x2cd526,null));};exports['show']=function(_0x284c09,_0x17cc28){var _0x50bd65={'raw':!![],'where':{'id':_0x284c09[_0xe197('0x47')]['id']}},_0x4852db={};_0x4852db[_0xe197('0x33')]=_[_0xe197('0x35')](db[_0xe197('0x2f')][_0xe197('0x30')]);_0x4852db[_0xe197('0x34')]=_[_0xe197('0x35')](_0x284c09['query']);_0x4852db['filters']=_[_0xe197('0x36')](_0x4852db[_0xe197('0x33')],_0x4852db[_0xe197('0x34')]);_0x50bd65[_0xe197('0x38')]=_['intersection'](_0x4852db[_0xe197('0x33')],qs['fields'](_0x284c09[_0xe197('0x34')]['fields']));_0x50bd65[_0xe197('0x38')]=_0x50bd65[_0xe197('0x38')][_0xe197('0x39')]?_0x50bd65['attributes']:_0x4852db[_0xe197('0x33')];if(_0x284c09[_0xe197('0x34')]['includeAll']){_0x50bd65[_0xe197('0x43')]=[{'all':!![]}];}_0x50bd65=_[_0xe197('0x3f')]({},_0x50bd65,_0x284c09[_0xe197('0x41')]);return db[_0xe197('0x2f')][_0xe197('0x48')](_0x50bd65)[_0xe197('0x27')](handleEntityNotFound(_0x17cc28,null))['then'](respondWithResult(_0x17cc28,null))['catch'](handleError(_0x17cc28,null));};exports[_0xe197('0x49')]=function(_0xd1be69,_0x457d97){return db[_0xe197('0x2f')][_0xe197('0x49')](_0xd1be69[_0xe197('0x4a')],{})[_0xe197('0x27')](function(_0x4c8b14){var _0x3fe540=_0xd1be69[_0xe197('0x4b')][_0xe197('0x4c')]({'plain':!![]});if(!_0x3fe540)throw new Error(_0xe197('0x4d'));if(_0x3fe540[_0xe197('0x4e')]===_0xe197('0x4b')){var _0x35cba4=_0x4c8b14[_0xe197('0x4c')]({'plain':!![]});var _0x144327=_0xe197('0x4f');return db[_0xe197('0x50')][_0xe197('0x48')]({'where':{'name':_0x144327,'userProfileId':_0x3fe540[_0xe197('0x51')]},'raw':!![]})[_0xe197('0x27')](function(_0x1dd7ec){if(_0x1dd7ec&&_0x1dd7ec[_0xe197('0x52')]===0x0){return db[_0xe197('0x28')][_0xe197('0x49')]({'name':_0x35cba4[_0xe197('0x2b')],'resourceId':_0x35cba4['id'],'type':_0x1dd7ec[_0xe197('0x2b')],'sectionId':_0x1dd7ec['id']},{})[_0xe197('0x27')](function(){return _0x4c8b14;});}else{return _0x4c8b14;}})[_0xe197('0x46')](function(_0x2fc23c){logger[_0xe197('0x29')](_0xe197('0x53'),_0x2fc23c);throw _0x2fc23c;});}return _0x4c8b14;})[_0xe197('0x27')](respondWithResult(_0x457d97,0xc9))[_0xe197('0x46')](handleError(_0x457d97,null));};exports['update']=function(_0x1f74e2,_0x273c6d){if(_0x1f74e2['body']['id']){delete _0x1f74e2[_0xe197('0x4a')]['id'];}return db[_0xe197('0x2f')]['find']({'where':{'id':_0x1f74e2[_0xe197('0x47')]['id']}})['then'](handleEntityNotFound(_0x273c6d,null))[_0xe197('0x27')](saveUpdates(_0x1f74e2[_0xe197('0x4a')],null))[_0xe197('0x27')](respondWithResult(_0x273c6d,null))['catch'](handleError(_0x273c6d,null));};exports[_0xe197('0x26')]=function(_0x1de96e,_0x54f476){return db[_0xe197('0x2f')][_0xe197('0x48')]({'where':{'id':_0x1de96e['params']['id']}})[_0xe197('0x27')](handleEntityNotFound(_0x54f476,null))['then'](removeEntity(_0x54f476,null))[_0xe197('0x46')](handleError(_0x54f476,null));};exports[_0xe197('0x54')]=function(_0x4dc970,_0x1b72bf){return db[_0xe197('0x2f')][_0xe197('0x54')]()[_0xe197('0x27')](respondWithResult(_0x1b72bf,null))['catch'](handleError(_0x1b72bf,null));};exports[_0xe197('0x55')]=function(_0x32e153,_0x585b1b,_0x21e385){var _0x5c6797={'raw':!![],'where':{}},_0x3d1da2={},_0x865de6;return db['FaxQueue'][_0xe197('0x56')]({'where':{'id':_0x32e153[_0xe197('0x47')]['id']}})['then'](handleEntityNotFound(_0x585b1b,null))[_0xe197('0x27')](function(_0x1a41a8){if(_0x1a41a8){_0x865de6=_0x1a41a8['get']({'plain':!![]});_0x3d1da2['model']=_[_0xe197('0x35')](db['UserFaxQueue'][_0xe197('0x30')]);_0x3d1da2[_0xe197('0x34')]=_['keys'](_0x32e153[_0xe197('0x34')]);_0x3d1da2[_0xe197('0x3e')]=_[_0xe197('0x36')](_0x3d1da2[_0xe197('0x33')],_0x3d1da2['query']);_0x5c6797['attributes']=_[_0xe197('0x36')](_0x3d1da2[_0xe197('0x33')],qs[_0xe197('0x37')](_0x32e153[_0xe197('0x34')]['fields']));_0x5c6797[_0xe197('0x38')]=_0x5c6797[_0xe197('0x38')][_0xe197('0x39')]?_0x5c6797[_0xe197('0x38')]:_0x3d1da2[_0xe197('0x33')];if(!_0x32e153['query']['hasOwnProperty']('nolimit')){_0x5c6797[_0xe197('0x23')]=qs[_0xe197('0x23')](_0x32e153[_0xe197('0x34')][_0xe197('0x23')]);_0x5c6797['offset']=qs[_0xe197('0x21')](_0x32e153[_0xe197('0x34')][_0xe197('0x21')]);}_0x5c6797[_0xe197('0x57')]=qs['sort'](_0x32e153[_0xe197('0x34')][_0xe197('0x3b')]);_0x5c6797[_0xe197('0x3c')]=qs[_0xe197('0x3e')](_[_0xe197('0x3d')](_0x32e153[_0xe197('0x34')],_0x3d1da2[_0xe197('0x3e')]));_0x5c6797['where'][_0xe197('0x58')]=_0x1a41a8['id'];if(_0x32e153[_0xe197('0x34')][_0xe197('0x40')]){_0x5c6797['where']=_[_0xe197('0x3f')](_0x5c6797[_0xe197('0x3c')],{'$or':_[_0xe197('0x2e')](_0x5c6797[_0xe197('0x38')],function(_0x2a1ab5){var _0x116698={};_0x116698[_0x2a1ab5]={'$like':'%'+_0x32e153[_0xe197('0x34')][_0xe197('0x40')]+'%'};return _0x116698;})});}_0x5c6797=_['merge']({},_0x5c6797,_0x32e153['options']);return db[_0xe197('0x59')][_0xe197('0x44')](_0x5c6797);}})[_0xe197('0x27')](function(_0x4b8c4d){if(_0x4b8c4d){return db['User'][_0xe197('0x5a')]({'where':{'id':_[_0xe197('0x2e')](_0x4b8c4d,'UserId'),'role':_0xe197('0x5b')},'attributes':['id',_0xe197('0x2b'),_0xe197('0x5c'),_0xe197('0x5d'),_0xe197('0x5e')]});}})[_0xe197('0x27')](function(_0x2be167){if(_0x2be167){return{'count':_0x2be167[_0xe197('0x24')],'rows':_['map'](_0x2be167['rows'],function(_0x17bd61){return{'membername':_0x17bd61[_0xe197('0x2b')],'UserId':_0x17bd61['id'],'queue_name':_0x865de6['name'],'FaxQueueId':_0x865de6['id'],'interface':util['format'](_0xe197('0x5f'),'SIP',_0x17bd61[_0xe197('0x2b')]),'penalty':0x0,'paused':_0x17bd61[_0xe197('0x5c')],'createdAt':_0x17bd61[_0xe197('0x5e')],'updatedAt':_0x17bd61[_0xe197('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe197('0x27')](respondWithFilteredResult(_0x585b1b,_0x5c6797))[_0xe197('0x46')](handleError(_0x585b1b,null));};exports[_0xe197('0x60')]=function(_0x323499,_0x4fc11f,_0x47d304){var _0xa4807e={};var _0x272984={};var _0x2f0d1f;var _0x4cbc10;return db[_0xe197('0x2f')][_0xe197('0x56')]({'where':{'id':_0x323499[_0xe197('0x47')]['id']}})[_0xe197('0x27')](handleEntityNotFound(_0x4fc11f,null))[_0xe197('0x27')](function(_0x2ed463){if(_0x2ed463){_0x2f0d1f=_0x2ed463;_0x272984[_0xe197('0x33')]=_[_0xe197('0x35')](db[_0xe197('0x61')][_0xe197('0x30')]);_0x272984['query']=_['keys'](_0x323499[_0xe197('0x34')]);_0x272984[_0xe197('0x3e')]=_[_0xe197('0x36')](_0x272984[_0xe197('0x33')],_0x272984[_0xe197('0x34')]);_0xa4807e['attributes']=_[_0xe197('0x36')](_0x272984['model'],qs[_0xe197('0x37')](_0x323499['query'][_0xe197('0x37')]));_0xa4807e[_0xe197('0x38')]=_0xa4807e['attributes'][_0xe197('0x39')]?_0xa4807e[_0xe197('0x38')]:_0x272984[_0xe197('0x33')];_0xa4807e['order']=qs[_0xe197('0x3b')](_0x323499[_0xe197('0x34')]['sort']);_0xa4807e['where']=qs[_0xe197('0x3e')](_[_0xe197('0x3d')](_0x323499[_0xe197('0x34')],_0x272984[_0xe197('0x3e')]));if(_0x323499[_0xe197('0x34')][_0xe197('0x40')]){_0xa4807e['where']=_[_0xe197('0x3f')](_0xa4807e[_0xe197('0x3c')],{'$or':_[_0xe197('0x2e')](_0xa4807e['attributes'],function(_0x590519){var _0x6fca9f={};_0x6fca9f[_0x590519]={'$like':'%'+_0x323499['query'][_0xe197('0x40')]+'%'};return _0x6fca9f;})});}_0xa4807e=_[_0xe197('0x3f')]({},_0xa4807e,_0x323499[_0xe197('0x41')]);return _0x2f0d1f[_0xe197('0x60')](_0xa4807e);}})[_0xe197('0x27')](function(_0x389fac){if(_0x389fac){_0x4cbc10=_0x389fac[_0xe197('0x39')];if(!_0x323499[_0xe197('0x34')][_0xe197('0x3a')](_0xe197('0x62'))){_0xa4807e['limit']=qs[_0xe197('0x23')](_0x323499[_0xe197('0x34')]['limit']);_0xa4807e[_0xe197('0x21')]=qs['offset'](_0x323499[_0xe197('0x34')][_0xe197('0x21')]);}return _0x2f0d1f['getTeams'](_0xa4807e);}})[_0xe197('0x27')](function(_0xf2698a){if(_0xf2698a){return _0xf2698a?{'count':_0x4cbc10,'rows':_0xf2698a}:null;}})[_0xe197('0x27')](respondWithResult(_0x4fc11f,null))[_0xe197('0x46')](handleError(_0x4fc11f,null));};exports[_0xe197('0x63')]=function(_0x30c487,_0x14701a,_0x55b90e){var _0x17adfc=_0x30c487[_0xe197('0x4a')]['ids'];return db[_0xe197('0x61')][_0xe197('0x44')]({'where':{'id':_0x17adfc},'attributes':['id'],'include':[{'model':db[_0xe197('0x64')],'as':_0xe197('0x65'),'attributes':['id',_0xe197('0x2b'),_0xe197('0x66'),_0xe197('0x67'),_0xe197('0x68')],'raw':!![]}]})[_0xe197('0x27')](function(_0x31a4a9){if(_0x31a4a9){var _0x5d85d1=_[_0xe197('0x69')](_0x31a4a9,function(_0x3967c5){var _0x9bb730=_0x3967c5[_0xe197('0x4c')]({'plain':!![]});return _0x9bb730[_0xe197('0x65')];});return db['FaxQueue'][_0xe197('0x48')]({'where':{'id':_0x30c487[_0xe197('0x47')]['id']}})['then'](function(_0x457b53){return db[_0xe197('0x6a')][_0xe197('0x6b')](function(_0x12df94){return _0x457b53[_0xe197('0x63')](_0x17adfc,{'transaction':_0x12df94})[_0xe197('0x27')](function(){return BPromise[_0xe197('0x6c')](_0x5d85d1,function(_0x3e15bb){return db[_0xe197('0x59')]['findOrCreate']({'where':{'UserId':_0x3e15bb['id'],'FaxQueueId':_0x30c487[_0xe197('0x47')]['id']},'transaction':_0x12df94});});})[_0xe197('0x27')](function(){_0x5d85d1[_0xe197('0x6d')](function(_0xc49316){socket[_0xe197('0x6e')](_0xe197('0x6f'),{'UserId':_0xc49316['id'],'FaxQueueId':_0x457b53['id']});});});});});}})[_0xe197('0x27')](respondWithStatusCode(_0x14701a,null))['catch'](handleError(_0x14701a,null));};exports[_0xe197('0x70')]=function(_0x5db56d,_0x5e4d24,_0x39d6bb){return db[_0xe197('0x61')]['findAll']({'where':{'id':_0x5db56d[_0xe197('0x34')][_0xe197('0x71')]},'attributes':['id'],'include':[{'model':db[_0xe197('0x64')],'as':_0xe197('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5e4d24,null))[_0xe197('0x27')](function(_0x452bd3){var _0x32e272=_[_0xe197('0x2e')](_0x452bd3,'id');var _0x41fffb=[];var _0x2dc4f9=[];var _0x440f95=squel[_0xe197('0x72')]();_0x440f95[_0xe197('0x73')](_0xe197('0x74'))['from'](_0xe197('0x75'),'tq')['join'](_0xe197('0x76'),'ut',_0xe197('0x77'))['where'](_0xe197('0x78'),_0x5db56d[_0xe197('0x47')]['id']);for(var _0xefa7ba=0x0;_0xefa7ba<_0x452bd3[_0xe197('0x39')];_0xefa7ba+=0x1){let _0x1931e5=_0x452bd3[_0xefa7ba];for(var _0x58a7a2=0x0;_0x58a7a2<_0x1931e5[_0xe197('0x65')][_0xe197('0x39')];_0x58a7a2+=0x1){let _0x136a80=_0x1931e5[_0xe197('0x65')][_0x58a7a2];var _0x5a55fe=_0x440f95[_0xe197('0x79')]();_0x5a55fe['where']('ut.UserId\x20=\x20?',_0x136a80['id']);_0x2dc4f9[_0xe197('0x7a')](db[_0xe197('0x6a')][_0xe197('0x34')](_0x5a55fe[_0xe197('0x7b')](),{'type':db[_0xe197('0x6a')][_0xe197('0x7c')]['SELECT']})[_0xe197('0x27')](function(_0x2477da){if(_0x2477da[_0xe197('0x39')]===0x1){return _0x136a80['id'];}else{var _0x559df9=_[_0xe197('0x7d')](_['map'](_0x2477da,_0xe197('0x7e')),function(_0x5c8e6c){return _['includes'](_0x32e272,_0x5c8e6c);});if(_0x559df9){return _0x136a80['id'];}}}));}}return BPromise[_0xe197('0x7f')](_0x2dc4f9)[_0xe197('0x27')](function(_0x35bf80){_0x41fffb=_(_0x41fffb)['union'](_0x35bf80)[_0xe197('0x80')]()['value']();return db[_0xe197('0x2f')][_0xe197('0x48')]({'where':{'id':_0x5db56d[_0xe197('0x47')]['id']}})['then'](function(_0x1d471e){return db[_0xe197('0x6a')][_0xe197('0x6b')](function(_0x44cd84){return _0x1d471e[_0xe197('0x70')](_0x5db56d[_0xe197('0x34')][_0xe197('0x71')],{'transaction':_0x44cd84})[_0xe197('0x27')](function(){if(!_[_0xe197('0x81')](_0x41fffb)){return _0x1d471e[_0xe197('0x82')](_0x41fffb,{'transaction':_0x44cd84});}})[_0xe197('0x27')](function(){_0x41fffb[_0xe197('0x6d')](function(_0x503b2f){socket[_0xe197('0x6e')](_0xe197('0x83'),{'UserId':_0x503b2f,'FaxQueueId':_0x1d471e['id']});});});});});});})[_0xe197('0x27')](respondWithStatusCode(_0x5e4d24,null))['catch'](handleError(_0x5e4d24,null));};exports[_0xe197('0x84')]=function(_0x6cb179,_0x43daf5,_0x5eafab){return db[_0xe197('0x2f')][_0xe197('0x48')]({'where':{'id':_0x6cb179[_0xe197('0x47')]['id']}})[_0xe197('0x27')](handleEntityNotFound(_0x43daf5,null))[_0xe197('0x27')](function(_0x3cea91){if(_0x3cea91){return _0x3cea91[_0xe197('0x84')](_0x6cb179[_0xe197('0x4a')]['ids'],_[_0xe197('0x85')](_0x6cb179[_0xe197('0x4a')],[_0xe197('0x71'),'id'])||{})[_0xe197('0x86')](function(_0x514153){for(var _0xdfa76=0x0;_0xdfa76<_0x6cb179['body'][_0xe197('0x71')][_0xe197('0x39')];_0xdfa76+=0x1){socket['emit'](_0xe197('0x6f'),{'UserId':Number(_0x6cb179[_0xe197('0x4a')][_0xe197('0x71')][_0xdfa76]),'FaxQueueId':Number(_0x6cb179[_0xe197('0x47')]['id'])});}return _0x514153;});}})[_0xe197('0x27')](respondWithResult(_0x43daf5,null))[_0xe197('0x46')](handleError(_0x43daf5,null));};exports[_0xe197('0x82')]=function(_0x5cc60a,_0x5a59af,_0x2e36fe){return db['FaxQueue'][_0xe197('0x48')]({'where':{'id':_0x5cc60a[_0xe197('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a59af,null))[_0xe197('0x27')](function(_0x28e08f){if(_0x28e08f){return _0x28e08f[_0xe197('0x82')](_0x5cc60a['query'][_0xe197('0x71')])[_0xe197('0x27')](function(){if(_[_0xe197('0x87')](_0x5cc60a[_0xe197('0x34')][_0xe197('0x71')])){for(var _0x2c60b3=0x0;_0x2c60b3<_0x5cc60a['query'][_0xe197('0x71')][_0xe197('0x39')];_0x2c60b3+=0x1){socket[_0xe197('0x6e')](_0xe197('0x83'),{'UserId':Number(_0x5cc60a[_0xe197('0x34')][_0xe197('0x71')][_0x2c60b3]),'FaxQueueId':Number(_0x5cc60a['params']['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x5cc60a[_0xe197('0x34')][_0xe197('0x71')]),'FaxQueueId':Number(_0x5cc60a['params']['id'])});}});}})[_0xe197('0x27')](respondWithStatusCode(_0x5a59af,null))['catch'](handleError(_0x5a59af,null));};exports[_0xe197('0x88')]=function(_0x5f1f50,_0x2a97b7,_0x3adf60){var _0x3c10fb={};var _0x3f9e03={};var _0x3fd463;var _0x228149;return db['FaxQueue']['findOne']({'where':{'id':_0x5f1f50[_0xe197('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a97b7,null))[_0xe197('0x27')](function(_0xcfddf2){if(_0xcfddf2){_0x3fd463=_0xcfddf2;_0x3f9e03[_0xe197('0x33')]=_[_0xe197('0x35')](db['User'][_0xe197('0x30')]);_0x3f9e03['query']=_[_0xe197('0x35')](_0x5f1f50[_0xe197('0x34')]);_0x3f9e03[_0xe197('0x3e')]=_['intersection'](_0x3f9e03[_0xe197('0x33')],_0x3f9e03[_0xe197('0x34')]);_0x3c10fb[_0xe197('0x38')]=_[_0xe197('0x36')](_0x3f9e03[_0xe197('0x33')],qs[_0xe197('0x37')](_0x5f1f50['query']['fields']));_0x3c10fb[_0xe197('0x38')]=_0x3c10fb[_0xe197('0x38')][_0xe197('0x39')]?_0x3c10fb[_0xe197('0x38')]:_0x3f9e03[_0xe197('0x33')];_0x3c10fb['order']=qs[_0xe197('0x3b')](_0x5f1f50[_0xe197('0x34')][_0xe197('0x3b')]);_0x3c10fb[_0xe197('0x3c')]=qs['filters'](_[_0xe197('0x3d')](_0x5f1f50['query'],_0x3f9e03[_0xe197('0x3e')]));if(_0x5f1f50[_0xe197('0x34')][_0xe197('0x40')]){_0x3c10fb['where']=_['merge'](_0x3c10fb['where'],{'$or':_[_0xe197('0x2e')](_0x3c10fb[_0xe197('0x38')],function(_0x35a938){var _0x30ae76={};_0x30ae76[_0x35a938]={'$like':'%'+_0x5f1f50[_0xe197('0x34')][_0xe197('0x40')]+'%'};return _0x30ae76;})});}_0x3c10fb=_[_0xe197('0x3f')]({},_0x3c10fb,_0x5f1f50[_0xe197('0x41')]);return _0x3fd463['getAgents'](_0x3c10fb);}})[_0xe197('0x27')](function(_0x34f02e){if(_0x34f02e){_0x228149=_0x34f02e[_0xe197('0x39')];if(!_0x5f1f50['query'][_0xe197('0x3a')](_0xe197('0x62'))){_0x3c10fb[_0xe197('0x23')]=qs[_0xe197('0x23')](_0x5f1f50[_0xe197('0x34')]['limit']);_0x3c10fb[_0xe197('0x21')]=qs['offset'](_0x5f1f50[_0xe197('0x34')][_0xe197('0x21')]);}return _0x3fd463[_0xe197('0x88')](_0x3c10fb);}})['then'](function(_0x1e02f6){if(_0x1e02f6){return _0x1e02f6?{'count':_0x228149,'rows':_0x1e02f6}:null;}})[_0xe197('0x27')](respondWithResult(_0x2a97b7,null))[_0xe197('0x46')](handleError(_0x2a97b7,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 288c5f7..f7c171f 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 _0x5833=['emit','hasOwnProperty','hook','events','FaxQueue','setMaxListeners','save','remove'];(function(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0x5833,0xeb));var _0x3583=function(_0x562b94,_0x5d2d52){_0x562b94=_0x562b94-0x0;var _0xf56229=_0x5833[_0x562b94];return _0xf56229;};'use strict';var EventEmitter=require(_0x3583('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x3583('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3583('0x2')](0x0);var events={'afterCreate':_0x3583('0x3'),'afterUpdate':'update','afterDestroy':_0x3583('0x4')};function emitEvent(_0xe9343c){return function(_0x52415d,_0x134021,_0x5d38b3){FaxQueueEvents[_0x3583('0x5')](_0xe9343c+':'+_0x52415d['id'],_0x52415d);FaxQueueEvents['emit'](_0xe9343c,_0x52415d);_0x5d38b3(null);};}for(var e in events){if(events[_0x3583('0x6')](e)){var event=events[e];FaxQueue[_0x3583('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xe3ab=['FaxQueue','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xe3ab,0xc5));var _0xbe3a=function(_0x5a4113,_0x466a19){_0x5a4113=_0x5a4113-0x0;var _0x50de17=_0xe3ab[_0x5a4113];return _0x50de17;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xbe3a('0x0'))['db'][_0xbe3a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe3a('0x2'),'afterUpdate':_0xbe3a('0x3'),'afterDestroy':_0xbe3a('0x4')};function emitEvent(_0x160e8e){return function(_0x5dd778,_0x586e92,_0x3381ca){FaxQueueEvents[_0xbe3a('0x5')](_0x160e8e+':'+_0x5dd778['id'],_0x5dd778);FaxQueueEvents[_0xbe3a('0x5')](_0x160e8e,_0x5dd778);_0x3381ca(null);};}for(var e in events){if(events[_0xbe3a('0x6')](e)){var event=events[e];FaxQueue[_0xbe3a('0x7')](e,emitEvent(event));}}module[_0xbe3a('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index a9284ad..4ee4d8f 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 _0x4340=['util','bluebird','request-promise','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x4340,0x1e5));var _0x0434=function(_0x20bcb8,_0x497b5e){_0x20bcb8=_0x20bcb8-0x0;var _0x4ffce=_0x4340[_0x20bcb8];return _0x4ffce;};'use strict';var _=require(_0x0434('0x0'));var util=require(_0x0434('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0434('0x2'));var rp=require(_0x0434('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0434('0x4'));var attributes=require(_0x0434('0x5'));module['exports']=function(_0x51a740,_0x16a10f){return _0x51a740[_0x0434('0x6')](_0x0434('0x7'),attributes,{'tableName':_0x0434('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e0=['FaxQueue','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x12b09d,_0x5ae94a){var _0x331e4e=function(_0x67dd23){while(--_0x67dd23){_0x12b09d['push'](_0x12b09d['shift']());}};_0x331e4e(++_0x5ae94a);}(_0xa0e0,0x17b));var _0x0a0e=function(_0x4e9ebd,_0x33e51a){_0x4e9ebd=_0x4e9ebd-0x0;var _0x339831=_0xa0e0[_0x4e9ebd];return _0x339831;};'use strict';var _=require('lodash');var util=require(_0x0a0e('0x0'));var logger=require(_0x0a0e('0x1'))('api');var moment=require(_0x0a0e('0x2'));var BPromise=require(_0x0a0e('0x3'));var rp=require(_0x0a0e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a0e('0x5'));var config=require(_0x0a0e('0x6'));var attributes=require('./faxQueue.attributes');module[_0x0a0e('0x7')]=function(_0x230d74,_0x298562){return _0x230d74['define'](_0x0a0e('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 1cc795c..7f58eab 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 _0xc18a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','raw','options','where','attributes','limit','include','map','model','ShowFaxQueue','moment'];(function(_0x30199a,_0x4d1802){var _0x253049=function(_0x47683b){while(--_0x47683b){_0x30199a['push'](_0x30199a['shift']());}};_0x253049(++_0x4d1802);}(_0xc18a,0x137));var _0xac18=function(_0x13fca7,_0x49638c){_0x13fca7=_0x13fca7-0x0;var _0x2313d9=_0xc18a[_0x13fca7];return _0x2313d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac18('0x0'));var BPromise=require(_0xac18('0x1'));var rs=require(_0xac18('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac18('0x3'))['db'];var utils=require(_0xac18('0x4'));var logger=require(_0xac18('0x5'))('rpc');var config=require(_0xac18('0x6'));var jayson=require(_0xac18('0x7'));var client=jayson['client'][_0xac18('0x8')]({'port':0x232a});config['redis']=_[_0xac18('0x9')](config[_0xac18('0xa')],{'host':_0xac18('0xb'),'port':0x18eb});var socket=require(_0xac18('0xc'))(new Redis(config[_0xac18('0xa')]));require(_0xac18('0xd'))[_0xac18('0xe')](socket);function respondWithRpcPromise(_0x4b9eff,_0xdd5979,_0x19de6b){return new BPromise(function(_0x5e0653,_0x193cb8){return client[_0xac18('0xf')](_0x4b9eff,_0x19de6b)[_0xac18('0x10')](function(_0x5f4244){logger[_0xac18('0x11')](_0xac18('0x12'),_0xdd5979,_0xac18('0x13'));logger[_0xac18('0x14')](_0xac18('0x15'),_0xdd5979,'request\x20sent',JSON[_0xac18('0x16')](_0x5f4244));if(_0x5f4244[_0xac18('0x17')]){if(_0x5f4244[_0xac18('0x17')][_0xac18('0x18')]===0x1f4){logger[_0xac18('0x17')](_0xac18('0x12'),_0xdd5979,_0x5f4244[_0xac18('0x17')][_0xac18('0x19')]);return _0x193cb8(_0x5f4244[_0xac18('0x17')][_0xac18('0x19')]);}logger[_0xac18('0x17')]('FaxQueue,\x20%s,\x20%s',_0xdd5979,_0x5f4244[_0xac18('0x17')]['message']);return _0x5e0653(_0x5f4244[_0xac18('0x17')]['message']);}else{logger['info'](_0xac18('0x12'),_0xdd5979,_0xac18('0x13'));_0x5e0653(_0x5f4244['result'][_0xac18('0x19')]);}})[_0xac18('0x1a')](function(_0x22fa0e){logger[_0xac18('0x17')](_0xac18('0x12'),_0xdd5979,_0x22fa0e);_0x193cb8(_0x22fa0e);});});}exports[_0xac18('0x1b')]=function(_0x3adedd){var _0x59ac7b=this;return new Promise(function(_0x49d45c,_0x45c214){return db[_0xac18('0x1c')][_0xac18('0x1d')]({'raw':_0x3adedd['options']?_0x3adedd['options'][_0xac18('0x1e')]===undefined?!![]:![]:!![],'where':_0x3adedd[_0xac18('0x1f')]?_0x3adedd[_0xac18('0x1f')][_0xac18('0x20')]||null:null,'attributes':_0x3adedd[_0xac18('0x1f')]?_0x3adedd['options'][_0xac18('0x21')]||null:null,'limit':_0x3adedd[_0xac18('0x1f')]?_0x3adedd['options'][_0xac18('0x22')]||null:null,'include':_0x3adedd[_0xac18('0x1f')]?_0x3adedd[_0xac18('0x1f')][_0xac18('0x23')]?_['map'](_0x3adedd[_0xac18('0x1f')][_0xac18('0x23')],function(_0x289cff){return{'model':db[_0x289cff['model']],'as':_0x289cff['as'],'attributes':_0x289cff[_0xac18('0x21')],'include':_0x289cff[_0xac18('0x23')]?_[_0xac18('0x24')](_0x289cff[_0xac18('0x23')],function(_0x3215fe){return{'model':db[_0x3215fe['model']],'as':_0x3215fe['as'],'attributes':_0x3215fe[_0xac18('0x21')],'include':_0x3215fe['include']?_[_0xac18('0x24')](_0x3215fe[_0xac18('0x23')],function(_0x459b7e){return{'model':db[_0x459b7e[_0xac18('0x25')]],'as':_0x459b7e['as'],'attributes':_0x459b7e[_0xac18('0x21')]};}):[]};}):[]};}):[]:[]})[_0xac18('0x10')](function(_0x19cb03){logger[_0xac18('0x11')](_0xac18('0x1b'),_0x3adedd);logger[_0xac18('0x14')](_0xac18('0x1b'),_0x3adedd,JSON[_0xac18('0x16')](_0x19cb03));_0x49d45c(_0x19cb03);})[_0xac18('0x1a')](function(_0x3d1ece){logger[_0xac18('0x17')]('GetFaxQueue',_0x3d1ece['message'],_0x3adedd);_0x45c214(_0x59ac7b[_0xac18('0x17')](0x1f4,_0x3d1ece[_0xac18('0x19')]));});});};exports[_0xac18('0x26')]=function(_0x43a084){var _0x2870b4=this;return new Promise(function(_0x2dfa4b,_0x4bd8be){return db['FaxQueue']['find']({'raw':_0x43a084[_0xac18('0x1f')]?_0x43a084['options'][_0xac18('0x1e')]===undefined?!![]:![]:!![],'where':_0x43a084['options']?_0x43a084[_0xac18('0x1f')]['where']||null:null,'attributes':_0x43a084[_0xac18('0x1f')]?_0x43a084[_0xac18('0x1f')][_0xac18('0x21')]||null:null,'include':_0x43a084[_0xac18('0x1f')]?_0x43a084[_0xac18('0x1f')][_0xac18('0x23')]?_[_0xac18('0x24')](_0x43a084[_0xac18('0x1f')][_0xac18('0x23')],function(_0x569f85){return{'model':db[_0x569f85[_0xac18('0x25')]],'as':_0x569f85['as'],'attributes':_0x569f85[_0xac18('0x21')],'include':_0x569f85[_0xac18('0x23')]?_[_0xac18('0x24')](_0x569f85[_0xac18('0x23')],function(_0xd1cec0){return{'model':db[_0xd1cec0[_0xac18('0x25')]],'as':_0xd1cec0['as'],'attributes':_0xd1cec0[_0xac18('0x21')],'include':_0xd1cec0[_0xac18('0x23')]?_[_0xac18('0x24')](_0xd1cec0[_0xac18('0x23')],function(_0x324f82){return{'model':db[_0x324f82[_0xac18('0x25')]],'as':_0x324f82['as'],'attributes':_0x324f82[_0xac18('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6e7dbc){logger[_0xac18('0x11')](_0xac18('0x26'),_0x43a084);logger[_0xac18('0x14')](_0xac18('0x26'),_0x43a084,JSON[_0xac18('0x16')](_0x6e7dbc));_0x2dfa4b(_0x6e7dbc);})['catch'](function(_0x20cb00){logger[_0xac18('0x17')](_0xac18('0x26'),_0x20cb00['message'],_0x43a084);_0x4bd8be(_0x2870b4['error'](0x1f4,_0x20cb00[_0xac18('0x19')]));});});}; \ No newline at end of file +var _0x16eb=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowFaxQueue','find','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x16eb,0x1c7));var _0xb16e=function(_0x4b6531,_0xd4a85){_0x4b6531=_0x4b6531-0x0;var _0x1ccff2=_0x16eb[_0x4b6531];return _0x1ccff2;};'use strict';var _=require(_0xb16e('0x0'));var util=require(_0xb16e('0x1'));var moment=require('moment');var BPromise=require(_0xb16e('0x2'));var rs=require(_0xb16e('0x3'));var fs=require('fs');var Redis=require(_0xb16e('0x4'));var db=require(_0xb16e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb16e('0x6'))(_0xb16e('0x7'));var config=require(_0xb16e('0x8'));var jayson=require(_0xb16e('0x9'));var client=jayson['client'][_0xb16e('0xa')]({'port':0x232a});config['redis']=_[_0xb16e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb16e('0xc'))(new Redis(config[_0xb16e('0xd')]));require(_0xb16e('0xe'))['register'](socket);function respondWithRpcPromise(_0xba2120,_0x474ad2,_0x4eb56d){return new BPromise(function(_0x236b7f,_0x5399fe){return client[_0xb16e('0xf')](_0xba2120,_0x4eb56d)['then'](function(_0x514a10){logger[_0xb16e('0x10')](_0xb16e('0x11'),_0x474ad2,_0xb16e('0x12'));logger[_0xb16e('0x13')](_0xb16e('0x14'),_0x474ad2,_0xb16e('0x12'),JSON[_0xb16e('0x15')](_0x514a10));if(_0x514a10[_0xb16e('0x16')]){if(_0x514a10[_0xb16e('0x16')]['code']===0x1f4){logger['error'](_0xb16e('0x11'),_0x474ad2,_0x514a10[_0xb16e('0x16')]['message']);return _0x5399fe(_0x514a10[_0xb16e('0x16')][_0xb16e('0x17')]);}logger[_0xb16e('0x16')](_0xb16e('0x11'),_0x474ad2,_0x514a10['error'][_0xb16e('0x17')]);return _0x236b7f(_0x514a10[_0xb16e('0x16')][_0xb16e('0x17')]);}else{logger['info'](_0xb16e('0x11'),_0x474ad2,_0xb16e('0x12'));_0x236b7f(_0x514a10['result']['message']);}})[_0xb16e('0x18')](function(_0x11b98d){logger[_0xb16e('0x16')]('FaxQueue,\x20%s,\x20%s',_0x474ad2,_0x11b98d);_0x5399fe(_0x11b98d);});});}exports[_0xb16e('0x19')]=function(_0x4d081c){var _0x37702f=this;return new Promise(function(_0x11065d,_0x345f39){return db[_0xb16e('0x1a')][_0xb16e('0x1b')]({'raw':_0x4d081c[_0xb16e('0x1c')]?_0x4d081c[_0xb16e('0x1c')][_0xb16e('0x1d')]===undefined?!![]:![]:!![],'where':_0x4d081c[_0xb16e('0x1c')]?_0x4d081c[_0xb16e('0x1c')][_0xb16e('0x1e')]||null:null,'attributes':_0x4d081c[_0xb16e('0x1c')]?_0x4d081c[_0xb16e('0x1c')][_0xb16e('0x1f')]||null:null,'limit':_0x4d081c[_0xb16e('0x1c')]?_0x4d081c[_0xb16e('0x1c')]['limit']||null:null,'include':_0x4d081c[_0xb16e('0x1c')]?_0x4d081c[_0xb16e('0x1c')][_0xb16e('0x20')]?_[_0xb16e('0x21')](_0x4d081c[_0xb16e('0x1c')][_0xb16e('0x20')],function(_0x18ce25){return{'model':db[_0x18ce25['model']],'as':_0x18ce25['as'],'attributes':_0x18ce25['attributes'],'include':_0x18ce25[_0xb16e('0x20')]?_[_0xb16e('0x21')](_0x18ce25[_0xb16e('0x20')],function(_0x9d16b7){return{'model':db[_0x9d16b7['model']],'as':_0x9d16b7['as'],'attributes':_0x9d16b7[_0xb16e('0x1f')],'include':_0x9d16b7[_0xb16e('0x20')]?_[_0xb16e('0x21')](_0x9d16b7[_0xb16e('0x20')],function(_0x34c535){return{'model':db[_0x34c535[_0xb16e('0x22')]],'as':_0x34c535['as'],'attributes':_0x34c535[_0xb16e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb16e('0x23')](function(_0x257940){logger[_0xb16e('0x10')]('GetFaxQueue',_0x4d081c);logger[_0xb16e('0x13')](_0xb16e('0x19'),_0x4d081c,JSON[_0xb16e('0x15')](_0x257940));_0x11065d(_0x257940);})['catch'](function(_0x77fba){logger['error']('GetFaxQueue',_0x77fba[_0xb16e('0x17')],_0x4d081c);_0x345f39(_0x37702f[_0xb16e('0x16')](0x1f4,_0x77fba[_0xb16e('0x17')]));});});};exports[_0xb16e('0x24')]=function(_0x4e4dfb){var _0x3942fa=this;return new Promise(function(_0x27b475,_0x51c890){return db[_0xb16e('0x1a')][_0xb16e('0x25')]({'raw':_0x4e4dfb[_0xb16e('0x1c')]?_0x4e4dfb[_0xb16e('0x1c')][_0xb16e('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e4dfb[_0xb16e('0x1c')]?_0x4e4dfb[_0xb16e('0x1c')][_0xb16e('0x1e')]||null:null,'attributes':_0x4e4dfb[_0xb16e('0x1c')]?_0x4e4dfb['options']['attributes']||null:null,'include':_0x4e4dfb['options']?_0x4e4dfb[_0xb16e('0x1c')]['include']?_[_0xb16e('0x21')](_0x4e4dfb[_0xb16e('0x1c')][_0xb16e('0x20')],function(_0x2ae3c5){return{'model':db[_0x2ae3c5[_0xb16e('0x22')]],'as':_0x2ae3c5['as'],'attributes':_0x2ae3c5[_0xb16e('0x1f')],'include':_0x2ae3c5[_0xb16e('0x20')]?_[_0xb16e('0x21')](_0x2ae3c5[_0xb16e('0x20')],function(_0x3f876d){return{'model':db[_0x3f876d[_0xb16e('0x22')]],'as':_0x3f876d['as'],'attributes':_0x3f876d[_0xb16e('0x1f')],'include':_0x3f876d['include']?_[_0xb16e('0x21')](_0x3f876d['include'],function(_0x250ff7){return{'model':db[_0x250ff7[_0xb16e('0x22')]],'as':_0x250ff7['as'],'attributes':_0x250ff7[_0xb16e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30f67a){logger[_0xb16e('0x10')](_0xb16e('0x24'),_0x4e4dfb);logger[_0xb16e('0x13')]('ShowFaxQueue',_0x4e4dfb,JSON[_0xb16e('0x15')](_0x30f67a));_0x27b475(_0x30f67a);})['catch'](function(_0x194cfb){logger[_0xb16e('0x16')]('ShowFaxQueue',_0x194cfb['message'],_0x4e4dfb);_0x51c890(_0x3942fa[_0xb16e('0x16')](0x1f4,_0x194cfb['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 5e1bf3a..7b253f7 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 _0xb8ca=['save','remove','removeListener','register','faxQueue:','./faxQueue.events'];(function(_0xa37d3e,_0x6d3cc3){var _0x4f9f68=function(_0x2106af){while(--_0x2106af){_0xa37d3e['push'](_0xa37d3e['shift']());}};_0x4f9f68(++_0x6d3cc3);}(_0xb8ca,0x89));var _0xab8c=function(_0x272453,_0x55f4c4){_0x272453=_0x272453-0x0;var _0x6a74c9=_0xb8ca[_0x272453];return _0x6a74c9;};'use strict';var FaxQueueEvents=require(_0xab8c('0x0'));var events=[_0xab8c('0x1'),_0xab8c('0x2'),'update'];function createListener(_0x22f9bf,_0x1a2b0a){return function(_0x534d74){_0x1a2b0a['emit'](_0x22f9bf,_0x534d74);};}function removeListener(_0x40c0b4,_0x293bde){return function(){FaxQueueEvents[_0xab8c('0x3')](_0x40c0b4,_0x293bde);};}exports[_0xab8c('0x4')]=function(_0x31cc24){for(var _0x340159=0x0,_0x506335=events['length'];_0x340159<_0x506335;_0x340159++){var _0x32f11f=events[_0x340159];var _0x56f6ac=createListener(_0xab8c('0x5')+_0x32f11f,_0x31cc24);FaxQueueEvents['on'](_0x32f11f,_0x56f6ac);}}; \ No newline at end of file +var _0x7bee=['length','faxQueue:','save','remove','update','emit','removeListener'];(function(_0x58a364,_0x3439f6){var _0x409b74=function(_0xff5c15){while(--_0xff5c15){_0x58a364['push'](_0x58a364['shift']());}};_0x409b74(++_0x3439f6);}(_0x7bee,0x13d));var _0xe7be=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x7bee[_0x46698a];return _0x356db0;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xe7be('0x0'),_0xe7be('0x1'),_0xe7be('0x2')];function createListener(_0x30cc00,_0x3d4282){return function(_0x590b88){_0x3d4282[_0xe7be('0x3')](_0x30cc00,_0x590b88);};}function removeListener(_0xdb373e,_0x47a88e){return function(){FaxQueueEvents[_0xe7be('0x4')](_0xdb373e,_0x47a88e);};}exports['register']=function(_0x4d8520){for(var _0x16eab1=0x0,_0x554764=events[_0xe7be('0x5')];_0x16eab1<_0x554764;_0x16eab1++){var _0x595be3=events[_0x16eab1];var _0x1d5cff=createListener(_0xe7be('0x6')+_0x595be3,_0x4d8520);FaxQueueEvents['on'](_0x595be3,_0x1d5cff);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c96396c..7b7a00d 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 _0x6363=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x6363,0x13a));var _0x3636=function(_0x2734a9,_0x26968f){_0x2734a9=_0x2734a9-0x0;var _0x4ab233=_0x6363[_0x2734a9];return _0x4ab233;};'use strict';var multer=require(_0x3636('0x0'));var util=require('util');var path=require(_0x3636('0x1'));var timeout=require(_0x3636('0x2'));var express=require(_0x3636('0x3'));var router=express[_0x3636('0x4')]();var fs_extra=require(_0x3636('0x5'));var auth=require(_0x3636('0x6'));var interaction=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var controller=require(_0x3636('0x9'));router[_0x3636('0xa')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0xc')]);router[_0x3636('0xa')](_0x3636('0xd'),auth['isAuthenticated'](),controller[_0x3636('0xe')]);router['get'](_0x3636('0xf'),auth[_0x3636('0xb')](),controller[_0x3636('0x10')]);router[_0x3636('0xa')](_0x3636('0x11'),auth[_0x3636('0xb')](),controller[_0x3636('0x12')]);router[_0x3636('0xa')](_0x3636('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0x3636('0xa')]('/:id/users',auth[_0x3636('0xb')](),controller[_0x3636('0x14')]);router[_0x3636('0x15')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0x16')]);router[_0x3636('0x15')](_0x3636('0x13'),auth[_0x3636('0xb')](),controller[_0x3636('0x17')]);router[_0x3636('0x15')](_0x3636('0x18'),auth[_0x3636('0xb')](),controller[_0x3636('0x19')]);router[_0x3636('0x1a')](_0x3636('0xf'),auth[_0x3636('0xb')](),controller[_0x3636('0x1b')]);router['delete'](_0x3636('0xf'),auth[_0x3636('0xb')](),controller['destroy']);router[_0x3636('0x1c')]('/:id/teams',auth['isAuthenticated'](),controller[_0x3636('0x1d')]);router[_0x3636('0x1c')](_0x3636('0x18'),auth[_0x3636('0xb')](),controller[_0x3636('0x1e')]);module[_0x3636('0x1f')]=router; \ No newline at end of file +var _0x96f2=['post','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create'];(function(_0x4c4284,_0x581403){var _0x18e0fb=function(_0x24abe8){while(--_0x24abe8){_0x4c4284['push'](_0x4c4284['shift']());}};_0x18e0fb(++_0x581403);}(_0x96f2,0xb0));var _0x296f=function(_0x279609,_0x4ee10f){_0x279609=_0x279609-0x0;var _0x52760e=_0x96f2[_0x279609];return _0x52760e;};'use strict';var multer=require(_0x296f('0x0'));var util=require('util');var path=require(_0x296f('0x1'));var timeout=require(_0x296f('0x2'));var express=require(_0x296f('0x3'));var router=express['Router']();var fs_extra=require(_0x296f('0x4'));var auth=require(_0x296f('0x5'));var interaction=require(_0x296f('0x6'));var config=require('../../config/environment');var controller=require(_0x296f('0x7'));router[_0x296f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x296f('0x8')](_0x296f('0x9'),auth[_0x296f('0xa')](),controller[_0x296f('0xb')]);router[_0x296f('0x8')](_0x296f('0xc'),auth[_0x296f('0xa')](),controller[_0x296f('0xd')]);router[_0x296f('0x8')](_0x296f('0xe'),auth['isAuthenticated'](),controller[_0x296f('0xf')]);router[_0x296f('0x8')](_0x296f('0x10'),auth['isAuthenticated'](),controller[_0x296f('0x11')]);router[_0x296f('0x8')](_0x296f('0x12'),auth[_0x296f('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x296f('0x13')]);router[_0x296f('0x14')](_0x296f('0x10'),auth[_0x296f('0xa')](),controller['addTeams']);router[_0x296f('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x296f('0x15')]);router[_0x296f('0x16')](_0x296f('0xc'),auth[_0x296f('0xa')](),controller['update']);router['delete'](_0x296f('0xc'),auth['isAuthenticated'](),controller[_0x296f('0x17')]);router[_0x296f('0x18')](_0x296f('0x10'),auth['isAuthenticated'](),controller[_0x296f('0x19')]);router[_0x296f('0x18')]('/:id/users',auth[_0x296f('0xa')](),controller[_0x296f('0x1a')]);module[_0x296f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 3475a69..c81dcd7 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 _0x2816=['STRING','DATE','moment','sequelize'];(function(_0x11cbfd,_0x23b43f){var _0x1dfc3e=function(_0x49b86c){while(--_0x49b86c){_0x11cbfd['push'](_0x11cbfd['shift']());}};_0x1dfc3e(++_0x23b43f);}(_0x2816,0xc2));var _0x6281=function(_0xa0ba6a,_0x4094dd){_0xa0ba6a=_0xa0ba6a-0x0;var _0x4450ed=_0x2816[_0xa0ba6a];return _0x4450ed;};'use strict';var moment=require(_0x6281('0x0'));var Sequelize=require(_0x6281('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6281('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6281('0x2')]},'joinAt':{'type':Sequelize[_0x6281('0x3')]},'leaveAt':{'type':Sequelize[_0x6281('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x6281('0x2')]}}; \ No newline at end of file +var _0x89b7=['STRING','DATE','exports'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x89b7,0x1dc));var _0x789b=function(_0x336e33,_0x527fa3){_0x336e33=_0x336e33-0x0;var _0x6c333a=_0x89b7[_0x336e33];return _0x6c333a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x789b('0x0')]={'uniqueid':{'type':Sequelize[_0x789b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x789b('0x1')]},'joinAt':{'type':Sequelize[_0x789b('0x2')]},'leaveAt':{'type':Sequelize[_0x789b('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x789b('0x2')]},'reason':{'type':Sequelize[_0x789b('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index fa29a57..280a4b6 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 _0x7b6b=['filter','merge','VIRTUAL','options','include','findAll','rows','show','rawAttributes','keys','find','catch','create','params','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FaxQueueReport','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x7b6b,0xac));var _0xb7b6=function(_0x535699,_0x891194){_0x535699=_0x535699-0x0;var _0x35d212=_0x7b6b[_0x535699];return _0x35d212;};'use strict';var emlformat=require(_0xb7b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7b6('0x1'));var jsonpatch=require(_0xb7b6('0x2'));var rp=require(_0xb7b6('0x3'));var moment=require('moment');var BPromise=require(_0xb7b6('0x4'));var Mustache=require('mustache');var util=require(_0xb7b6('0x5'));var path=require(_0xb7b6('0x6'));var sox=require(_0xb7b6('0x7'));var csv=require(_0xb7b6('0x8'));var ejs=require(_0xb7b6('0x9'));var fs=require('fs');var fs_extra=require(_0xb7b6('0xa'));var _=require(_0xb7b6('0xb'));var squel=require(_0xb7b6('0xc'));var crypto=require(_0xb7b6('0xd'));var jsforce=require(_0xb7b6('0xe'));var deskjs=require(_0xb7b6('0xf'));var toCsv=require(_0xb7b6('0x8'));var querystring=require(_0xb7b6('0x10'));var Papa=require(_0xb7b6('0x11'));var Redis=require(_0xb7b6('0x12'));var authService=require(_0xb7b6('0x13'));var qs=require(_0xb7b6('0x14'));var as=require(_0xb7b6('0x15'));var hardwareService=require(_0xb7b6('0x16'));var logger=require(_0xb7b6('0x17'))('api');var utils=require(_0xb7b6('0x18'));var config=require(_0xb7b6('0x19'));var licenseUtil=require(_0xb7b6('0x1a'));var db=require(_0xb7b6('0x1b'))['db'];function respondWithStatusCode(_0xc2df62,_0x22edd8){_0x22edd8=_0x22edd8||0xcc;return function(_0x4681af){if(_0x4681af){return _0xc2df62[_0xb7b6('0x1c')](_0x22edd8);}return _0xc2df62[_0xb7b6('0x1d')](_0x22edd8)[_0xb7b6('0x1e')]();};}function respondWithResult(_0x191679,_0x37985a){_0x37985a=_0x37985a||0xc8;return function(_0x5b9e96){if(_0x5b9e96){return _0x191679['status'](_0x37985a)[_0xb7b6('0x1f')](_0x5b9e96);}};}function respondWithFilteredResult(_0x53ea93,_0x51c79a){return function(_0x6d7d){if(_0x6d7d){var _0x543440=typeof _0x51c79a[_0xb7b6('0x20')]===_0xb7b6('0x21')&&typeof _0x51c79a[_0xb7b6('0x22')]===_0xb7b6('0x21');var _0x30dc72=_0x6d7d[_0xb7b6('0x23')];var _0x3dc0f8=_0x543440?0x0:_0x51c79a[_0xb7b6('0x20')];var _0x5667d9=_0x543440?_0x6d7d[_0xb7b6('0x23')]:_0x51c79a[_0xb7b6('0x20')]+_0x51c79a['limit'];var _0xddaed6;if(_0x5667d9>=_0x30dc72){_0x5667d9=_0x30dc72;_0xddaed6=0xc8;}else{_0xddaed6=0xce;}_0x53ea93[_0xb7b6('0x1d')](_0xddaed6);return _0x53ea93['set'](_0xb7b6('0x24'),_0x3dc0f8+'-'+_0x5667d9+'/'+_0x30dc72)[_0xb7b6('0x1f')](_0x6d7d);}return null;};}function patchUpdates(_0x5deaac){return function(_0x53b183){try{jsonpatch[_0xb7b6('0x25')](_0x53b183,_0x5deaac,!![]);}catch(_0x5e5185){return BPromise[_0xb7b6('0x26')](_0x5e5185);}return _0x53b183[_0xb7b6('0x27')]();};}function saveUpdates(_0xdb7eca,_0x230aa6){return function(_0x4641dc){if(_0x4641dc){return _0x4641dc[_0xb7b6('0x28')](_0xdb7eca)[_0xb7b6('0x29')](function(_0x2ab2a1){return _0x2ab2a1;});}return null;};}function removeEntity(_0x24e856,_0x2173c5){return function(_0x2fa0d0){if(_0x2fa0d0){return _0x2fa0d0[_0xb7b6('0x2a')]()[_0xb7b6('0x29')](function(){_0x24e856['status'](0xcc)[_0xb7b6('0x1e')]();});}};}function handleEntityNotFound(_0x551e06,_0x2716b1){return function(_0x558937){if(!_0x558937){_0x551e06['sendStatus'](0x194);}return _0x558937;};}function handleError(_0x58b853,_0x349eee){_0x349eee=_0x349eee||0x1f4;return function(_0x48ace6){logger['error'](_0x48ace6[_0xb7b6('0x2b')]);if(_0x48ace6[_0xb7b6('0x2c')]){delete _0x48ace6[_0xb7b6('0x2c')];}_0x58b853[_0xb7b6('0x1d')](_0x349eee)[_0xb7b6('0x2d')](_0x48ace6);};}exports[_0xb7b6('0x2e')]=function(_0x3dc58e,_0x5c610a){var _0x5d546a={},_0x3017f5={},_0x2df0ee={'count':0x0,'rows':[]};var _0x93abd0=_[_0xb7b6('0x2f')](db[_0xb7b6('0x30')]['rawAttributes'],function(_0x177980){return{'name':_0x177980['fieldName'],'type':_0x177980['type'][_0xb7b6('0x31')]};});_0x3017f5[_0xb7b6('0x32')]=_[_0xb7b6('0x2f')](_0x93abd0,_0xb7b6('0x2c'));_0x3017f5[_0xb7b6('0x33')]=_['keys'](_0x3dc58e['query']);_0x3017f5[_0xb7b6('0x34')]=_[_0xb7b6('0x35')](_0x3017f5[_0xb7b6('0x32')],_0x3017f5[_0xb7b6('0x33')]);_0x5d546a[_0xb7b6('0x36')]=_[_0xb7b6('0x35')](_0x3017f5[_0xb7b6('0x32')],qs['fields'](_0x3dc58e[_0xb7b6('0x33')][_0xb7b6('0x37')]));_0x5d546a[_0xb7b6('0x36')]=_0x5d546a['attributes'][_0xb7b6('0x38')]?_0x5d546a[_0xb7b6('0x36')]:_0x3017f5['model'];if(!_0x3dc58e['query']['hasOwnProperty'](_0xb7b6('0x39'))){_0x5d546a['limit']=qs[_0xb7b6('0x22')](_0x3dc58e[_0xb7b6('0x33')][_0xb7b6('0x22')]);_0x5d546a[_0xb7b6('0x20')]=qs[_0xb7b6('0x20')](_0x3dc58e['query']['offset']);}_0x5d546a[_0xb7b6('0x3a')]=qs[_0xb7b6('0x3b')](_0x3dc58e[_0xb7b6('0x33')][_0xb7b6('0x3b')]);_0x5d546a[_0xb7b6('0x3c')]=qs[_0xb7b6('0x34')](_[_0xb7b6('0x3d')](_0x3dc58e[_0xb7b6('0x33')],_0x3017f5['filters']),_0x93abd0);if(_0x3dc58e[_0xb7b6('0x33')][_0xb7b6('0x3e')]){_0x5d546a['where']=_[_0xb7b6('0x3f')](_0x5d546a[_0xb7b6('0x3c')],{'$or':_[_0xb7b6('0x2f')](_0x93abd0,function(_0x54a606){if(_0x54a606['type']!==_0xb7b6('0x40')){var _0x2e7f1f={};_0x2e7f1f[_0x54a606[_0xb7b6('0x2c')]]={'$like':'%'+_0x3dc58e['query']['filter']+'%'};return _0x2e7f1f;}})});}_0x5d546a=_[_0xb7b6('0x3f')]({},_0x5d546a,_0x3dc58e[_0xb7b6('0x41')]);var _0x2240ba={'where':_0x5d546a[_0xb7b6('0x3c')]};return db[_0xb7b6('0x30')][_0xb7b6('0x23')](_0x2240ba)['then'](function(_0x1b2e67){_0x2df0ee[_0xb7b6('0x23')]=_0x1b2e67;if(_0x3dc58e['query']['includeAll']){_0x5d546a[_0xb7b6('0x42')]=[{'all':!![]}];}return db[_0xb7b6('0x30')][_0xb7b6('0x43')](_0x5d546a);})['then'](function(_0x235f79){_0x2df0ee[_0xb7b6('0x44')]=_0x235f79;return _0x2df0ee;})[_0xb7b6('0x29')](respondWithFilteredResult(_0x5c610a,_0x5d546a))['catch'](handleError(_0x5c610a,null));};exports[_0xb7b6('0x45')]=function(_0x4547fb,_0x314c73){var _0x3fbd9a={'raw':!![],'where':{'id':_0x4547fb['params']['id']}},_0x34fb85={};_0x34fb85[_0xb7b6('0x32')]=_['keys'](db['FaxQueueReport'][_0xb7b6('0x46')]);_0x34fb85[_0xb7b6('0x33')]=_[_0xb7b6('0x47')](_0x4547fb[_0xb7b6('0x33')]);_0x34fb85[_0xb7b6('0x34')]=_['intersection'](_0x34fb85[_0xb7b6('0x32')],_0x34fb85[_0xb7b6('0x33')]);_0x3fbd9a[_0xb7b6('0x36')]=_[_0xb7b6('0x35')](_0x34fb85[_0xb7b6('0x32')],qs[_0xb7b6('0x37')](_0x4547fb['query'][_0xb7b6('0x37')]));_0x3fbd9a[_0xb7b6('0x36')]=_0x3fbd9a[_0xb7b6('0x36')][_0xb7b6('0x38')]?_0x3fbd9a[_0xb7b6('0x36')]:_0x34fb85[_0xb7b6('0x32')];if(_0x4547fb[_0xb7b6('0x33')]['includeAll']){_0x3fbd9a[_0xb7b6('0x42')]=[{'all':!![]}];}_0x3fbd9a=_[_0xb7b6('0x3f')]({},_0x3fbd9a,_0x4547fb[_0xb7b6('0x41')]);return db[_0xb7b6('0x30')][_0xb7b6('0x48')](_0x3fbd9a)['then'](handleEntityNotFound(_0x314c73,null))[_0xb7b6('0x29')](respondWithResult(_0x314c73,null))[_0xb7b6('0x49')](handleError(_0x314c73,null));};exports[_0xb7b6('0x4a')]=function(_0x5e194f,_0x260102){return db['FaxQueueReport'][_0xb7b6('0x4a')](_0x5e194f['body'],{})[_0xb7b6('0x29')](respondWithResult(_0x260102,0xc9))['catch'](handleError(_0x260102,null));};exports[_0xb7b6('0x28')]=function(_0x58b4e3,_0x54c5a4){if(_0x58b4e3['body']['id']){delete _0x58b4e3['body']['id'];}return db[_0xb7b6('0x30')][_0xb7b6('0x48')]({'where':{'id':_0x58b4e3[_0xb7b6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x54c5a4,null))['then'](saveUpdates(_0x58b4e3[_0xb7b6('0x4c')],null))[_0xb7b6('0x29')](respondWithResult(_0x54c5a4,null))[_0xb7b6('0x49')](handleError(_0x54c5a4,null));};exports[_0xb7b6('0x2a')]=function(_0x1d6b00,_0x52a743){return db[_0xb7b6('0x30')][_0xb7b6('0x48')]({'where':{'id':_0x1d6b00[_0xb7b6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x52a743,null))[_0xb7b6('0x29')](removeEntity(_0x52a743,null))[_0xb7b6('0x49')](handleError(_0x52a743,null));};exports[_0xb7b6('0x4d')]=function(_0x51915d,_0x1b2b83){return db[_0xb7b6('0x30')][_0xb7b6('0x4d')]()[_0xb7b6('0x29')](respondWithResult(_0x1b2b83,null))[_0xb7b6('0x49')](handleError(_0x1b2b83,null));}; \ No newline at end of file +var _0xfb30=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfb30,0x88));var _0x0fb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfb30[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x0fb3('0x0'));var rimraf=require(_0x0fb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fb3('0x2'));var moment=require('moment');var BPromise=require(_0x0fb3('0x3'));var Mustache=require(_0x0fb3('0x4'));var util=require(_0x0fb3('0x5'));var path=require(_0x0fb3('0x6'));var sox=require(_0x0fb3('0x7'));var csv=require(_0x0fb3('0x8'));var ejs=require(_0x0fb3('0x9'));var fs=require('fs');var fs_extra=require(_0x0fb3('0xa'));var _=require(_0x0fb3('0xb'));var squel=require(_0x0fb3('0xc'));var crypto=require(_0x0fb3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0fb3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0fb3('0xf'));var Papa=require(_0x0fb3('0x10'));var Redis=require(_0x0fb3('0x11'));var authService=require(_0x0fb3('0x12'));var qs=require(_0x0fb3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fb3('0x14'))(_0x0fb3('0x15'));var utils=require(_0x0fb3('0x16'));var config=require(_0x0fb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fb3('0x18'))['db'];function respondWithStatusCode(_0x419d55,_0x4eddbe){_0x4eddbe=_0x4eddbe||0xcc;return function(_0x289ac5){if(_0x289ac5){return _0x419d55[_0x0fb3('0x19')](_0x4eddbe);}return _0x419d55[_0x0fb3('0x1a')](_0x4eddbe)[_0x0fb3('0x1b')]();};}function respondWithResult(_0xb2742,_0x116af7){_0x116af7=_0x116af7||0xc8;return function(_0x172cbb){if(_0x172cbb){return _0xb2742[_0x0fb3('0x1a')](_0x116af7)['json'](_0x172cbb);}};}function respondWithFilteredResult(_0x28eb50,_0x390f57){return function(_0x38db4c){if(_0x38db4c){var _0x3bfca3=typeof _0x390f57[_0x0fb3('0x1c')]===_0x0fb3('0x1d')&&typeof _0x390f57[_0x0fb3('0x1e')]===_0x0fb3('0x1d');var _0x57bca4=_0x38db4c[_0x0fb3('0x1f')];var _0x5c6559=_0x3bfca3?0x0:_0x390f57['offset'];var _0x5e2024=_0x3bfca3?_0x38db4c[_0x0fb3('0x1f')]:_0x390f57[_0x0fb3('0x1c')]+_0x390f57[_0x0fb3('0x1e')];var _0x500079;if(_0x5e2024>=_0x57bca4){_0x5e2024=_0x57bca4;_0x500079=0xc8;}else{_0x500079=0xce;}_0x28eb50[_0x0fb3('0x1a')](_0x500079);return _0x28eb50[_0x0fb3('0x20')](_0x0fb3('0x21'),_0x5c6559+'-'+_0x5e2024+'/'+_0x57bca4)[_0x0fb3('0x22')](_0x38db4c);}return null;};}function patchUpdates(_0x40ddf6){return function(_0x4bf44){try{jsonpatch[_0x0fb3('0x23')](_0x4bf44,_0x40ddf6,!![]);}catch(_0x4be3a1){return BPromise[_0x0fb3('0x24')](_0x4be3a1);}return _0x4bf44[_0x0fb3('0x25')]();};}function saveUpdates(_0x242953,_0x3c53e7){return function(_0x3b19c3){if(_0x3b19c3){return _0x3b19c3[_0x0fb3('0x26')](_0x242953)['then'](function(_0x3f1152){return _0x3f1152;});}return null;};}function removeEntity(_0xeb97c8,_0x2e678a){return function(_0x2ebfcb){if(_0x2ebfcb){return _0x2ebfcb[_0x0fb3('0x27')]()[_0x0fb3('0x28')](function(){_0xeb97c8[_0x0fb3('0x1a')](0xcc)[_0x0fb3('0x1b')]();});}};}function handleEntityNotFound(_0xc7949f,_0x576456){return function(_0x20b79e){if(!_0x20b79e){_0xc7949f['sendStatus'](0x194);}return _0x20b79e;};}function handleError(_0x998064,_0x48602e){_0x48602e=_0x48602e||0x1f4;return function(_0x427783){logger[_0x0fb3('0x29')](_0x427783[_0x0fb3('0x2a')]);if(_0x427783[_0x0fb3('0x2b')]){delete _0x427783['name'];}_0x998064['status'](_0x48602e)[_0x0fb3('0x2c')](_0x427783);};}exports['index']=function(_0xbf2629,_0x25bdd2){var _0x1d9987={},_0x111e9f={},_0x2708ef={'count':0x0,'rows':[]};var _0x2af61c=_[_0x0fb3('0x2d')](db[_0x0fb3('0x2e')][_0x0fb3('0x2f')],function(_0x63a500){return{'name':_0x63a500[_0x0fb3('0x30')],'type':_0x63a500[_0x0fb3('0x31')][_0x0fb3('0x32')]};});_0x111e9f[_0x0fb3('0x33')]=_[_0x0fb3('0x2d')](_0x2af61c,_0x0fb3('0x2b'));_0x111e9f[_0x0fb3('0x34')]=_[_0x0fb3('0x35')](_0xbf2629[_0x0fb3('0x34')]);_0x111e9f['filters']=_[_0x0fb3('0x36')](_0x111e9f[_0x0fb3('0x33')],_0x111e9f['query']);_0x1d9987[_0x0fb3('0x37')]=_[_0x0fb3('0x36')](_0x111e9f['model'],qs[_0x0fb3('0x38')](_0xbf2629['query'][_0x0fb3('0x38')]));_0x1d9987[_0x0fb3('0x37')]=_0x1d9987['attributes'][_0x0fb3('0x39')]?_0x1d9987[_0x0fb3('0x37')]:_0x111e9f['model'];if(!_0xbf2629[_0x0fb3('0x34')]['hasOwnProperty'](_0x0fb3('0x3a'))){_0x1d9987[_0x0fb3('0x1e')]=qs[_0x0fb3('0x1e')](_0xbf2629[_0x0fb3('0x34')][_0x0fb3('0x1e')]);_0x1d9987[_0x0fb3('0x1c')]=qs[_0x0fb3('0x1c')](_0xbf2629['query'][_0x0fb3('0x1c')]);}_0x1d9987[_0x0fb3('0x3b')]=qs[_0x0fb3('0x3c')](_0xbf2629[_0x0fb3('0x34')][_0x0fb3('0x3c')]);_0x1d9987[_0x0fb3('0x3d')]=qs[_0x0fb3('0x3e')](_['pick'](_0xbf2629[_0x0fb3('0x34')],_0x111e9f[_0x0fb3('0x3e')]),_0x2af61c);if(_0xbf2629[_0x0fb3('0x34')][_0x0fb3('0x3f')]){_0x1d9987['where']=_[_0x0fb3('0x40')](_0x1d9987['where'],{'$or':_[_0x0fb3('0x2d')](_0x2af61c,function(_0x569e31){if(_0x569e31[_0x0fb3('0x31')]!==_0x0fb3('0x41')){var _0x2a75f9={};_0x2a75f9[_0x569e31[_0x0fb3('0x2b')]]={'$like':'%'+_0xbf2629['query'][_0x0fb3('0x3f')]+'%'};return _0x2a75f9;}})});}_0x1d9987=_[_0x0fb3('0x40')]({},_0x1d9987,_0xbf2629[_0x0fb3('0x42')]);var _0x10ea57={'where':_0x1d9987[_0x0fb3('0x3d')]};return db[_0x0fb3('0x2e')][_0x0fb3('0x1f')](_0x10ea57)[_0x0fb3('0x28')](function(_0x42507c){_0x2708ef[_0x0fb3('0x1f')]=_0x42507c;if(_0xbf2629[_0x0fb3('0x34')]['includeAll']){_0x1d9987[_0x0fb3('0x43')]=[{'all':!![]}];}return db[_0x0fb3('0x2e')][_0x0fb3('0x44')](_0x1d9987);})['then'](function(_0x45f666){_0x2708ef[_0x0fb3('0x45')]=_0x45f666;return _0x2708ef;})[_0x0fb3('0x28')](respondWithFilteredResult(_0x25bdd2,_0x1d9987))[_0x0fb3('0x46')](handleError(_0x25bdd2,null));};exports[_0x0fb3('0x47')]=function(_0x4bf567,_0x62634b){var _0x48c0e7={'raw':!![],'where':{'id':_0x4bf567['params']['id']}},_0xfd091f={};_0xfd091f[_0x0fb3('0x33')]=_[_0x0fb3('0x35')](db[_0x0fb3('0x2e')][_0x0fb3('0x2f')]);_0xfd091f[_0x0fb3('0x34')]=_[_0x0fb3('0x35')](_0x4bf567[_0x0fb3('0x34')]);_0xfd091f[_0x0fb3('0x3e')]=_[_0x0fb3('0x36')](_0xfd091f[_0x0fb3('0x33')],_0xfd091f['query']);_0x48c0e7[_0x0fb3('0x37')]=_['intersection'](_0xfd091f[_0x0fb3('0x33')],qs[_0x0fb3('0x38')](_0x4bf567[_0x0fb3('0x34')][_0x0fb3('0x38')]));_0x48c0e7[_0x0fb3('0x37')]=_0x48c0e7[_0x0fb3('0x37')][_0x0fb3('0x39')]?_0x48c0e7[_0x0fb3('0x37')]:_0xfd091f[_0x0fb3('0x33')];if(_0x4bf567[_0x0fb3('0x34')][_0x0fb3('0x48')]){_0x48c0e7[_0x0fb3('0x43')]=[{'all':!![]}];}_0x48c0e7=_['merge']({},_0x48c0e7,_0x4bf567[_0x0fb3('0x42')]);return db[_0x0fb3('0x2e')][_0x0fb3('0x49')](_0x48c0e7)['then'](handleEntityNotFound(_0x62634b,null))['then'](respondWithResult(_0x62634b,null))['catch'](handleError(_0x62634b,null));};exports[_0x0fb3('0x4a')]=function(_0x3948a0,_0x289360){return db['FaxQueueReport'][_0x0fb3('0x4a')](_0x3948a0[_0x0fb3('0x4b')],{})[_0x0fb3('0x28')](respondWithResult(_0x289360,0xc9))['catch'](handleError(_0x289360,null));};exports['update']=function(_0x57e92a,_0x16a2fc){if(_0x57e92a[_0x0fb3('0x4b')]['id']){delete _0x57e92a[_0x0fb3('0x4b')]['id'];}return db[_0x0fb3('0x2e')][_0x0fb3('0x49')]({'where':{'id':_0x57e92a['params']['id']}})[_0x0fb3('0x28')](handleEntityNotFound(_0x16a2fc,null))[_0x0fb3('0x28')](saveUpdates(_0x57e92a['body'],null))[_0x0fb3('0x28')](respondWithResult(_0x16a2fc,null))[_0x0fb3('0x46')](handleError(_0x16a2fc,null));};exports[_0x0fb3('0x27')]=function(_0xa9033e,_0x2beb43){return db[_0x0fb3('0x2e')][_0x0fb3('0x49')]({'where':{'id':_0xa9033e[_0x0fb3('0x4c')]['id']}})[_0x0fb3('0x28')](handleEntityNotFound(_0x2beb43,null))[_0x0fb3('0x28')](removeEntity(_0x2beb43,null))[_0x0fb3('0x46')](handleError(_0x2beb43,null));};exports[_0x0fb3('0x4d')]=function(_0x19302e,_0x4062ac){return db['FaxQueueReport'][_0x0fb3('0x4d')]()[_0x0fb3('0x28')](respondWithResult(_0x4062ac,null))[_0x0fb3('0x46')](handleError(_0x4062ac,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a3234f8..5180f9c 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x458e2c,_0x3da14b){var _0x377558=function(_0x20ff7a){while(--_0x20ff7a){_0x458e2c['push'](_0x458e2c['shift']());}};_0x377558(++_0x3da14b);}(_0x7a54,0x106));var _0x47a5=function(_0x48d9e2,_0x4b9f06){_0x48d9e2=_0x48d9e2-0x0;var _0x546ff8=_0x7a54[_0x48d9e2];return _0x546ff8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x814b,0x1a2));var _0xb814=function(_0x282f9a,_0x63dff){_0x282f9a=_0x282f9a-0x0;var _0x52528c=_0x814b[_0x282f9a];return _0x52528c;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 3ab452c..9caadfe 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 _0x9e73=['raw','CreateFaxQueueReport','UpdateFaxQueueReport','where','attributes','stringify','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','FaxQueueReport','create','body','options'];(function(_0x1af469,_0x584d95){var _0x336171=function(_0x574e25){while(--_0x574e25){_0x1af469['push'](_0x1af469['shift']());}};_0x336171(++_0x584d95);}(_0x9e73,0x1b4));var _0x39e7=function(_0x1e0d20,_0x6d3458){_0x1e0d20=_0x1e0d20-0x0;var _0x313a35=_0x9e73[_0x1e0d20];return _0x313a35;};'use strict';var _=require(_0x39e7('0x0'));var util=require(_0x39e7('0x1'));var moment=require(_0x39e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39e7('0x4'))['db'];var utils=require(_0x39e7('0x5'));var logger=require(_0x39e7('0x6'))(_0x39e7('0x7'));var config=require(_0x39e7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x39e7('0x9')][_0x39e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x315ba7,_0x490ac5,_0x3a87dc){return new BPromise(function(_0x6c25e5,_0xd014ec){return client[_0x39e7('0xb')](_0x315ba7,_0x3a87dc)[_0x39e7('0xc')](function(_0x19a8c3){logger[_0x39e7('0xd')](_0x39e7('0xe'),_0x490ac5,_0x39e7('0xf'));logger[_0x39e7('0x10')](_0x39e7('0x11'),_0x490ac5,'request\x20sent',JSON['stringify'](_0x19a8c3));if(_0x19a8c3[_0x39e7('0x12')]){if(_0x19a8c3[_0x39e7('0x12')][_0x39e7('0x13')]===0x1f4){logger[_0x39e7('0x12')](_0x39e7('0xe'),_0x490ac5,_0x19a8c3[_0x39e7('0x12')]['message']);return _0xd014ec(_0x19a8c3[_0x39e7('0x12')][_0x39e7('0x14')]);}logger[_0x39e7('0x12')](_0x39e7('0xe'),_0x490ac5,_0x19a8c3[_0x39e7('0x12')]['message']);return _0x6c25e5(_0x19a8c3[_0x39e7('0x12')][_0x39e7('0x14')]);}else{logger[_0x39e7('0xd')](_0x39e7('0xe'),_0x490ac5,_0x39e7('0xf'));_0x6c25e5(_0x19a8c3[_0x39e7('0x15')][_0x39e7('0x14')]);}})['catch'](function(_0x3c838d){logger[_0x39e7('0x12')](_0x39e7('0xe'),_0x490ac5,_0x3c838d);_0xd014ec(_0x3c838d);});});}exports['CreateFaxQueueReport']=function(_0xfd4f2b){var _0x5dccc1=this;return new Promise(function(_0x189941,_0x29e73f){return db[_0x39e7('0x16')][_0x39e7('0x17')](_0xfd4f2b[_0x39e7('0x18')],{'raw':_0xfd4f2b[_0x39e7('0x19')]?_0xfd4f2b[_0x39e7('0x19')][_0x39e7('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xc5bb9d){logger[_0x39e7('0xd')](_0x39e7('0x1b'),_0xfd4f2b);logger[_0x39e7('0x10')](_0x39e7('0x1b'),_0xfd4f2b,JSON['stringify'](_0xc5bb9d));_0x189941(_0xc5bb9d);})['catch'](function(_0x5eb7b7){logger[_0x39e7('0x12')](_0x39e7('0x1b'),_0x5eb7b7[_0x39e7('0x14')],_0xfd4f2b);_0x29e73f(_0x5dccc1[_0x39e7('0x12')](0x1f4,_0x5eb7b7[_0x39e7('0x14')]));});});};exports[_0x39e7('0x1c')]=function(_0x1f3492){var _0x1717b2=this;return new Promise(function(_0x452326,_0x245f80){return db[_0x39e7('0x16')]['update'](_0x1f3492[_0x39e7('0x18')],{'raw':_0x1f3492[_0x39e7('0x19')]?_0x1f3492['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3492['options']?_0x1f3492[_0x39e7('0x19')][_0x39e7('0x1d')]||null:null,'attributes':_0x1f3492[_0x39e7('0x19')]?_0x1f3492[_0x39e7('0x19')][_0x39e7('0x1e')]||null:null,'limit':_0x1f3492['options']?_0x1f3492[_0x39e7('0x19')]['limit']||null:null})['then'](function(_0x44e05a){logger[_0x39e7('0xd')](_0x39e7('0x1c'),_0x1f3492);logger[_0x39e7('0x10')](_0x39e7('0x1c'),_0x1f3492,JSON[_0x39e7('0x1f')](_0x44e05a));_0x452326(_0x44e05a);})[_0x39e7('0x20')](function(_0x40d051){logger[_0x39e7('0x12')](_0x39e7('0x1c'),_0x40d051[_0x39e7('0x14')],_0x1f3492);_0x245f80(_0x1717b2['error'](0x1f4,_0x40d051['message']));});});}; \ No newline at end of file +var _0xceea=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','UpdateFaxQueueReport','update','raw','where','attributes','limit','then'];(function(_0x361038,_0x33c0b9){var _0x520321=function(_0x7d5e7a){while(--_0x7d5e7a){_0x361038['push'](_0x361038['shift']());}};_0x520321(++_0x33c0b9);}(_0xceea,0x1ea));var _0xacee=function(_0x4ae076,_0x1cbacc){_0x4ae076=_0x4ae076-0x0;var _0x11f7d3=_0xceea[_0x4ae076];return _0x11f7d3;};'use strict';var _=require(_0xacee('0x0'));var util=require(_0xacee('0x1'));var moment=require(_0xacee('0x2'));var BPromise=require(_0xacee('0x3'));var rs=require(_0xacee('0x4'));var fs=require('fs');var Redis=require(_0xacee('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xacee('0x6'));var logger=require(_0xacee('0x7'))(_0xacee('0x8'));var config=require(_0xacee('0x9'));var jayson=require(_0xacee('0xa'));var client=jayson[_0xacee('0xb')][_0xacee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x598820,_0x3b82e3,_0x186d12){return new BPromise(function(_0x17364a,_0x7ba005){return client['request'](_0x598820,_0x186d12)['then'](function(_0x3a3fce){logger[_0xacee('0xd')](_0xacee('0xe'),_0x3b82e3,_0xacee('0xf'));logger[_0xacee('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x3b82e3,_0xacee('0xf'),JSON[_0xacee('0x11')](_0x3a3fce));if(_0x3a3fce['error']){if(_0x3a3fce['error'][_0xacee('0x12')]===0x1f4){logger[_0xacee('0x13')](_0xacee('0xe'),_0x3b82e3,_0x3a3fce[_0xacee('0x13')]['message']);return _0x7ba005(_0x3a3fce[_0xacee('0x13')][_0xacee('0x14')]);}logger[_0xacee('0x13')](_0xacee('0xe'),_0x3b82e3,_0x3a3fce[_0xacee('0x13')][_0xacee('0x14')]);return _0x17364a(_0x3a3fce[_0xacee('0x13')]['message']);}else{logger[_0xacee('0xd')](_0xacee('0xe'),_0x3b82e3,_0xacee('0xf'));_0x17364a(_0x3a3fce[_0xacee('0x15')][_0xacee('0x14')]);}})[_0xacee('0x16')](function(_0x2e79b6){logger[_0xacee('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x3b82e3,_0x2e79b6);_0x7ba005(_0x2e79b6);});});}exports[_0xacee('0x17')]=function(_0x579098){var _0x3bd976=this;return new Promise(function(_0x39376a,_0x28abb5){return db[_0xacee('0x18')][_0xacee('0x19')](_0x579098[_0xacee('0x1a')],{'raw':_0x579098['options']?_0x579098[_0xacee('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1ea46e){logger[_0xacee('0xd')](_0xacee('0x17'),_0x579098);logger[_0xacee('0x10')](_0xacee('0x17'),_0x579098,JSON[_0xacee('0x11')](_0x1ea46e));_0x39376a(_0x1ea46e);})[_0xacee('0x16')](function(_0x40e61d){logger[_0xacee('0x13')](_0xacee('0x17'),_0x40e61d['message'],_0x579098);_0x28abb5(_0x3bd976[_0xacee('0x13')](0x1f4,_0x40e61d[_0xacee('0x14')]));});});};exports[_0xacee('0x1c')]=function(_0x5272e6){var _0x585384=this;return new Promise(function(_0xea1306,_0x29e70d){return db['FaxQueueReport'][_0xacee('0x1d')](_0x5272e6[_0xacee('0x1a')],{'raw':_0x5272e6['options']?_0x5272e6[_0xacee('0x1b')][_0xacee('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5272e6[_0xacee('0x1b')]?_0x5272e6[_0xacee('0x1b')][_0xacee('0x1f')]||null:null,'attributes':_0x5272e6[_0xacee('0x1b')]?_0x5272e6['options'][_0xacee('0x20')]||null:null,'limit':_0x5272e6['options']?_0x5272e6['options'][_0xacee('0x21')]||null:null})[_0xacee('0x22')](function(_0x3af3ab){logger[_0xacee('0xd')](_0xacee('0x1c'),_0x5272e6);logger['debug']('UpdateFaxQueueReport',_0x5272e6,JSON[_0xacee('0x11')](_0x3af3ab));_0xea1306(_0x3af3ab);})[_0xacee('0x16')](function(_0xdd1f31){logger[_0xacee('0x13')]('UpdateFaxQueueReport',_0xdd1f31[_0xacee('0x14')],_0x5272e6);_0x29e70d(_0x585384[_0xacee('0x13')](0x1f4,_0xdd1f31['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 975f0ad..43e2e7d 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 _0xd5d5=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xd5d5,0x1a7));var _0x5d5d=function(_0x250ce7,_0x502ad3){_0x250ce7=_0x250ce7-0x0;var _0x416428=_0xd5d5[_0x250ce7];return _0x416428;};'use strict';var multer=require(_0x5d5d('0x0'));var util=require(_0x5d5d('0x1'));var path=require(_0x5d5d('0x2'));var timeout=require(_0x5d5d('0x3'));var express=require('express');var router=express[_0x5d5d('0x4')]();var fs_extra=require(_0x5d5d('0x5'));var auth=require(_0x5d5d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5d5d('0x7'));router[_0x5d5d('0x8')]('/',auth[_0x5d5d('0x9')](),controller[_0x5d5d('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5d5d('0xb')]);router[_0x5d5d('0x8')](_0x5d5d('0xc'),auth['isAuthenticated'](),controller[_0x5d5d('0xd')]);router[_0x5d5d('0xe')]('/',auth[_0x5d5d('0x9')](),controller['create']);router[_0x5d5d('0xf')](_0x5d5d('0xc'),auth[_0x5d5d('0x9')](),controller[_0x5d5d('0x10')]);router[_0x5d5d('0x11')](_0x5d5d('0xc'),auth[_0x5d5d('0x9')](),controller[_0x5d5d('0x12')]);module[_0x5d5d('0x13')]=router; \ No newline at end of file +var _0xe649=['./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x300c38,_0x13e569){var _0x3f9468=function(_0x41dc71){while(--_0x41dc71){_0x300c38['push'](_0x300c38['shift']());}};_0x3f9468(++_0x13e569);}(_0xe649,0x1e7));var _0x9e64=function(_0x3cd1a4,_0x3b6bde){_0x3cd1a4=_0x3cd1a4-0x0;var _0x39532b=_0xe649[_0x3cd1a4];return _0x39532b;};'use strict';var multer=require(_0x9e64('0x0'));var util=require(_0x9e64('0x1'));var path=require(_0x9e64('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e64('0x3'));var router=express[_0x9e64('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e64('0x5'));var interaction=require(_0x9e64('0x6'));var config=require('../../config/environment');var controller=require(_0x9e64('0x7'));router[_0x9e64('0x8')]('/',auth[_0x9e64('0x9')](),controller[_0x9e64('0xa')]);router[_0x9e64('0x8')](_0x9e64('0xb'),auth[_0x9e64('0x9')](),controller[_0x9e64('0xc')]);router[_0x9e64('0x8')](_0x9e64('0xd'),auth[_0x9e64('0x9')](),controller[_0x9e64('0xe')]);router['post']('/',auth[_0x9e64('0x9')](),controller[_0x9e64('0xf')]);router[_0x9e64('0x10')](_0x9e64('0xd'),auth[_0x9e64('0x9')](),controller[_0x9e64('0x11')]);router[_0x9e64('0x12')](_0x9e64('0xd'),auth[_0x9e64('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 854709b..3e92833 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x644b50,_0x2a17e4){var _0x29fb0b=function(_0x35c5bd){while(--_0x35c5bd){_0x644b50['push'](_0x644b50['shift']());}};_0x29fb0b(++_0x2a17e4);}(_0xedd9,0xfc));var _0x9edd=function(_0x3dea19,_0x1e0b54){_0x3dea19=_0x3dea19-0x0;var _0x4439f7=_0xedd9[_0x3dea19];return _0x4439f7;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xba8282,_0x3a2e21){var _0x5cc178=function(_0x344847){while(--_0x344847){_0xba8282['push'](_0xba8282['shift']());}};_0x5cc178(++_0x3a2e21);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0xcb91[_0x416cdc];return _0x1931ce;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 6888144..2f89e19 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 _0x8873=['reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3554d5,_0x43076f){var _0x55e63e=function(_0x493883){while(--_0x493883){_0x3554d5['push'](_0x3554d5['shift']());}};_0x55e63e(++_0x43076f);}(_0x8873,0x19b));var _0x3887=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0x8873[_0x2842b4];return _0x2b9521;};'use strict';var emlformat=require(_0x3887('0x0'));var rimraf=require(_0x3887('0x1'));var zipdir=require(_0x3887('0x2'));var jsonpatch=require(_0x3887('0x3'));var rp=require('request-promise');var moment=require(_0x3887('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3887('0x5'));var util=require('util');var path=require(_0x3887('0x6'));var sox=require(_0x3887('0x7'));var csv=require(_0x3887('0x8'));var ejs=require(_0x3887('0x9'));var fs=require('fs');var fs_extra=require(_0x3887('0xa'));var _=require(_0x3887('0xb'));var squel=require(_0x3887('0xc'));var crypto=require(_0x3887('0xd'));var jsforce=require(_0x3887('0xe'));var deskjs=require(_0x3887('0xf'));var toCsv=require(_0x3887('0x8'));var querystring=require('querystring');var Papa=require(_0x3887('0x10'));var Redis=require(_0x3887('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3887('0x12'));var hardwareService=require(_0x3887('0x13'));var logger=require('../../config/logger')(_0x3887('0x14'));var utils=require(_0x3887('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3887('0x16'));var db=require(_0x3887('0x17'))['db'];function respondWithStatusCode(_0x4edefe,_0x4b7310){_0x4b7310=_0x4b7310||0xcc;return function(_0x327d0d){if(_0x327d0d){return _0x4edefe[_0x3887('0x18')](_0x4b7310);}return _0x4edefe[_0x3887('0x19')](_0x4b7310)[_0x3887('0x1a')]();};}function respondWithResult(_0x4358e7,_0x1a84d9){_0x1a84d9=_0x1a84d9||0xc8;return function(_0x4bef29){if(_0x4bef29){return _0x4358e7[_0x3887('0x19')](_0x1a84d9)[_0x3887('0x1b')](_0x4bef29);}};}function respondWithFilteredResult(_0x3f8a4f,_0x1ef433){return function(_0x2f6af0){if(_0x2f6af0){var _0x2051d9=typeof _0x1ef433[_0x3887('0x1c')]===_0x3887('0x1d')&&typeof _0x1ef433[_0x3887('0x1e')]===_0x3887('0x1d');var _0x54fc72=_0x2f6af0['count'];var _0x5424f8=_0x2051d9?0x0:_0x1ef433[_0x3887('0x1c')];var _0x41916d=_0x2051d9?_0x2f6af0[_0x3887('0x1f')]:_0x1ef433[_0x3887('0x1c')]+_0x1ef433[_0x3887('0x1e')];var _0x28476e;if(_0x41916d>=_0x54fc72){_0x41916d=_0x54fc72;_0x28476e=0xc8;}else{_0x28476e=0xce;}_0x3f8a4f[_0x3887('0x19')](_0x28476e);return _0x3f8a4f[_0x3887('0x20')]('Content-Range',_0x5424f8+'-'+_0x41916d+'/'+_0x54fc72)[_0x3887('0x1b')](_0x2f6af0);}return null;};}function patchUpdates(_0x214e06){return function(_0x43dcc4){try{jsonpatch['apply'](_0x43dcc4,_0x214e06,!![]);}catch(_0x5e5a1a){return BPromise[_0x3887('0x21')](_0x5e5a1a);}return _0x43dcc4[_0x3887('0x22')]();};}function saveUpdates(_0x373655,_0x268740){return function(_0x5fd09e){if(_0x5fd09e){return _0x5fd09e[_0x3887('0x23')](_0x373655)['then'](function(_0x4d7065){return _0x4d7065;});}return null;};}function removeEntity(_0x4a1c6c,_0x62fcde){return function(_0x57fbc0){if(_0x57fbc0){return _0x57fbc0[_0x3887('0x24')]()[_0x3887('0x25')](function(){_0x4a1c6c[_0x3887('0x19')](0xcc)[_0x3887('0x1a')]();});}};}function handleEntityNotFound(_0x27fb34,_0x4de144){return function(_0x2dda51){if(!_0x2dda51){_0x27fb34[_0x3887('0x18')](0x194);}return _0x2dda51;};}function handleError(_0x448726,_0x9f5fb0){_0x9f5fb0=_0x9f5fb0||0x1f4;return function(_0x372369){logger[_0x3887('0x26')](_0x372369[_0x3887('0x27')]);if(_0x372369['name']){delete _0x372369[_0x3887('0x28')];}_0x448726['status'](_0x9f5fb0)[_0x3887('0x29')](_0x372369);};}exports[_0x3887('0x2a')]=function(_0x3bb531,_0x542a02){var _0x124e12={},_0x525603={},_0x324331={'count':0x0,'rows':[]};var _0x138df8=_['map'](db['FaxTransferReport'][_0x3887('0x2b')],function(_0xbd8b65){return{'name':_0xbd8b65[_0x3887('0x2c')],'type':_0xbd8b65[_0x3887('0x2d')]['key']};});_0x525603['model']=_['map'](_0x138df8,_0x3887('0x28'));_0x525603[_0x3887('0x2e')]=_[_0x3887('0x2f')](_0x3bb531[_0x3887('0x2e')]);_0x525603['filters']=_[_0x3887('0x30')](_0x525603[_0x3887('0x31')],_0x525603[_0x3887('0x2e')]);_0x124e12[_0x3887('0x32')]=_[_0x3887('0x30')](_0x525603[_0x3887('0x31')],qs['fields'](_0x3bb531[_0x3887('0x2e')][_0x3887('0x33')]));_0x124e12['attributes']=_0x124e12[_0x3887('0x32')][_0x3887('0x34')]?_0x124e12[_0x3887('0x32')]:_0x525603[_0x3887('0x31')];if(!_0x3bb531[_0x3887('0x2e')][_0x3887('0x35')](_0x3887('0x36'))){_0x124e12[_0x3887('0x1e')]=qs['limit'](_0x3bb531[_0x3887('0x2e')][_0x3887('0x1e')]);_0x124e12[_0x3887('0x1c')]=qs[_0x3887('0x1c')](_0x3bb531[_0x3887('0x2e')][_0x3887('0x1c')]);}_0x124e12['order']=qs[_0x3887('0x37')](_0x3bb531['query'][_0x3887('0x37')]);_0x124e12['where']=qs[_0x3887('0x38')](_['pick'](_0x3bb531[_0x3887('0x2e')],_0x525603[_0x3887('0x38')]),_0x138df8);if(_0x3bb531['query'][_0x3887('0x39')]){_0x124e12[_0x3887('0x3a')]=_[_0x3887('0x3b')](_0x124e12['where'],{'$or':_['map'](_0x138df8,function(_0x3cf47e){if(_0x3cf47e[_0x3887('0x2d')]!==_0x3887('0x3c')){var _0x576e32={};_0x576e32[_0x3cf47e[_0x3887('0x28')]]={'$like':'%'+_0x3bb531[_0x3887('0x2e')][_0x3887('0x39')]+'%'};return _0x576e32;}})});}_0x124e12=_[_0x3887('0x3b')]({},_0x124e12,_0x3bb531[_0x3887('0x3d')]);var _0x40a06d={'where':_0x124e12[_0x3887('0x3a')]};return db[_0x3887('0x3e')][_0x3887('0x1f')](_0x40a06d)[_0x3887('0x25')](function(_0x1bbd69){_0x324331['count']=_0x1bbd69;if(_0x3bb531[_0x3887('0x2e')][_0x3887('0x3f')]){_0x124e12[_0x3887('0x40')]=[{'all':!![]}];}return db[_0x3887('0x3e')][_0x3887('0x41')](_0x124e12);})['then'](function(_0x27eacd){_0x324331[_0x3887('0x42')]=_0x27eacd;return _0x324331;})[_0x3887('0x25')](respondWithFilteredResult(_0x542a02,_0x124e12))[_0x3887('0x43')](handleError(_0x542a02,null));};exports[_0x3887('0x44')]=function(_0x192b5f,_0x45c335){var _0x3e0232={'raw':!![],'where':{'id':_0x192b5f[_0x3887('0x45')]['id']}},_0x178c33={};_0x178c33[_0x3887('0x31')]=_['keys'](db[_0x3887('0x3e')][_0x3887('0x2b')]);_0x178c33[_0x3887('0x2e')]=_['keys'](_0x192b5f['query']);_0x178c33[_0x3887('0x38')]=_[_0x3887('0x30')](_0x178c33[_0x3887('0x31')],_0x178c33[_0x3887('0x2e')]);_0x3e0232[_0x3887('0x32')]=_[_0x3887('0x30')](_0x178c33['model'],qs[_0x3887('0x33')](_0x192b5f['query'][_0x3887('0x33')]));_0x3e0232[_0x3887('0x32')]=_0x3e0232[_0x3887('0x32')][_0x3887('0x34')]?_0x3e0232['attributes']:_0x178c33[_0x3887('0x31')];if(_0x192b5f[_0x3887('0x2e')][_0x3887('0x3f')]){_0x3e0232[_0x3887('0x40')]=[{'all':!![]}];}_0x3e0232=_[_0x3887('0x3b')]({},_0x3e0232,_0x192b5f[_0x3887('0x3d')]);return db['FaxTransferReport']['find'](_0x3e0232)[_0x3887('0x25')](handleEntityNotFound(_0x45c335,null))['then'](respondWithResult(_0x45c335,null))[_0x3887('0x43')](handleError(_0x45c335,null));};exports[_0x3887('0x46')]=function(_0x332ccb,_0x150f36){return db[_0x3887('0x3e')][_0x3887('0x46')](_0x332ccb[_0x3887('0x47')],{})[_0x3887('0x25')](respondWithResult(_0x150f36,0xc9))[_0x3887('0x43')](handleError(_0x150f36,null));};exports[_0x3887('0x23')]=function(_0x4116b6,_0x2930ae){if(_0x4116b6['body']['id']){delete _0x4116b6['body']['id'];}return db[_0x3887('0x3e')][_0x3887('0x48')]({'where':{'id':_0x4116b6[_0x3887('0x45')]['id']}})[_0x3887('0x25')](handleEntityNotFound(_0x2930ae,null))['then'](saveUpdates(_0x4116b6[_0x3887('0x47')],null))['then'](respondWithResult(_0x2930ae,null))['catch'](handleError(_0x2930ae,null));};exports[_0x3887('0x24')]=function(_0x33938e,_0x49bd5f){return db[_0x3887('0x3e')][_0x3887('0x48')]({'where':{'id':_0x33938e['params']['id']}})[_0x3887('0x25')](handleEntityNotFound(_0x49bd5f,null))['then'](removeEntity(_0x49bd5f,null))['catch'](handleError(_0x49bd5f,null));};exports[_0x3887('0x49')]=function(_0x86ab0a,_0x5bae2e){return db[_0x3887('0x3e')][_0x3887('0x49')]()[_0x3887('0x25')](respondWithResult(_0x5bae2e,null))[_0x3887('0x43')](handleError(_0x5bae2e,null));}; \ No newline at end of file +var _0x7322=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','FaxTransferReport','includeAll','include','rows','catch','show','params','options','create','body','find','describe','eml-format','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1992cd,_0x57d364){var _0x33c636=function(_0xe94f6e){while(--_0xe94f6e){_0x1992cd['push'](_0x1992cd['shift']());}};_0x33c636(++_0x57d364);}(_0x7322,0x11a));var _0x2732=function(_0x17a754,_0x5f1052){_0x17a754=_0x17a754-0x0;var _0x545d3e=_0x7322[_0x17a754];return _0x545d3e;};'use strict';var emlformat=require(_0x2732('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2732('0x1'));var jsonpatch=require(_0x2732('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2732('0x3'));var util=require(_0x2732('0x4'));var path=require(_0x2732('0x5'));var sox=require('sox');var csv=require(_0x2732('0x6'));var ejs=require(_0x2732('0x7'));var fs=require('fs');var fs_extra=require(_0x2732('0x8'));var _=require(_0x2732('0x9'));var squel=require(_0x2732('0xa'));var crypto=require(_0x2732('0xb'));var jsforce=require(_0x2732('0xc'));var deskjs=require(_0x2732('0xd'));var toCsv=require(_0x2732('0x6'));var querystring=require(_0x2732('0xe'));var Papa=require(_0x2732('0xf'));var Redis=require(_0x2732('0x10'));var authService=require(_0x2732('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2732('0x12'));var logger=require('../../config/logger')(_0x2732('0x13'));var utils=require(_0x2732('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2732('0x15'));var db=require(_0x2732('0x16'))['db'];function respondWithStatusCode(_0x5dec25,_0x2b1ac1){_0x2b1ac1=_0x2b1ac1||0xcc;return function(_0x27873c){if(_0x27873c){return _0x5dec25[_0x2732('0x17')](_0x2b1ac1);}return _0x5dec25['status'](_0x2b1ac1)[_0x2732('0x18')]();};}function respondWithResult(_0x361b09,_0x4b70bb){_0x4b70bb=_0x4b70bb||0xc8;return function(_0xa4a98e){if(_0xa4a98e){return _0x361b09[_0x2732('0x19')](_0x4b70bb)[_0x2732('0x1a')](_0xa4a98e);}};}function respondWithFilteredResult(_0x5991a7,_0x5a435b){return function(_0x452b3d){if(_0x452b3d){var _0x1b0299=typeof _0x5a435b[_0x2732('0x1b')]===_0x2732('0x1c')&&typeof _0x5a435b[_0x2732('0x1d')]===_0x2732('0x1c');var _0x31c738=_0x452b3d[_0x2732('0x1e')];var _0x4f76c9=_0x1b0299?0x0:_0x5a435b[_0x2732('0x1b')];var _0x222508=_0x1b0299?_0x452b3d['count']:_0x5a435b[_0x2732('0x1b')]+_0x5a435b['limit'];var _0x368d2b;if(_0x222508>=_0x31c738){_0x222508=_0x31c738;_0x368d2b=0xc8;}else{_0x368d2b=0xce;}_0x5991a7[_0x2732('0x19')](_0x368d2b);return _0x5991a7[_0x2732('0x1f')](_0x2732('0x20'),_0x4f76c9+'-'+_0x222508+'/'+_0x31c738)['json'](_0x452b3d);}return null;};}function patchUpdates(_0x4383f4){return function(_0xf86cfe){try{jsonpatch[_0x2732('0x21')](_0xf86cfe,_0x4383f4,!![]);}catch(_0x2ade74){return BPromise[_0x2732('0x22')](_0x2ade74);}return _0xf86cfe[_0x2732('0x23')]();};}function saveUpdates(_0x1b4e95,_0x13d61d){return function(_0x297172){if(_0x297172){return _0x297172[_0x2732('0x24')](_0x1b4e95)['then'](function(_0x54f2be){return _0x54f2be;});}return null;};}function removeEntity(_0x3e915e,_0x16def5){return function(_0x2e4c00){if(_0x2e4c00){return _0x2e4c00[_0x2732('0x25')]()[_0x2732('0x26')](function(){_0x3e915e[_0x2732('0x19')](0xcc)[_0x2732('0x18')]();});}};}function handleEntityNotFound(_0x5d4122,_0x2066c2){return function(_0x9a3bc0){if(!_0x9a3bc0){_0x5d4122[_0x2732('0x17')](0x194);}return _0x9a3bc0;};}function handleError(_0x18efb2,_0x5b76a7){_0x5b76a7=_0x5b76a7||0x1f4;return function(_0x50b115){logger[_0x2732('0x27')](_0x50b115[_0x2732('0x28')]);if(_0x50b115[_0x2732('0x29')]){delete _0x50b115[_0x2732('0x29')];}_0x18efb2['status'](_0x5b76a7)['send'](_0x50b115);};}exports['index']=function(_0x4ec9a3,_0x17ce9a){var _0x51e8b7={},_0x4e4f8a={},_0x4da045={'count':0x0,'rows':[]};var _0x25ffb2=_[_0x2732('0x2a')](db['FaxTransferReport'][_0x2732('0x2b')],function(_0x4e4e79){return{'name':_0x4e4e79[_0x2732('0x2c')],'type':_0x4e4e79[_0x2732('0x2d')]['key']};});_0x4e4f8a[_0x2732('0x2e')]=_[_0x2732('0x2a')](_0x25ffb2,_0x2732('0x29'));_0x4e4f8a[_0x2732('0x2f')]=_[_0x2732('0x30')](_0x4ec9a3[_0x2732('0x2f')]);_0x4e4f8a['filters']=_[_0x2732('0x31')](_0x4e4f8a[_0x2732('0x2e')],_0x4e4f8a[_0x2732('0x2f')]);_0x51e8b7[_0x2732('0x32')]=_['intersection'](_0x4e4f8a[_0x2732('0x2e')],qs[_0x2732('0x33')](_0x4ec9a3[_0x2732('0x2f')][_0x2732('0x33')]));_0x51e8b7[_0x2732('0x32')]=_0x51e8b7['attributes'][_0x2732('0x34')]?_0x51e8b7[_0x2732('0x32')]:_0x4e4f8a[_0x2732('0x2e')];if(!_0x4ec9a3[_0x2732('0x2f')]['hasOwnProperty'](_0x2732('0x35'))){_0x51e8b7[_0x2732('0x1d')]=qs['limit'](_0x4ec9a3[_0x2732('0x2f')]['limit']);_0x51e8b7[_0x2732('0x1b')]=qs[_0x2732('0x1b')](_0x4ec9a3[_0x2732('0x2f')]['offset']);}_0x51e8b7[_0x2732('0x36')]=qs[_0x2732('0x37')](_0x4ec9a3['query'][_0x2732('0x37')]);_0x51e8b7[_0x2732('0x38')]=qs['filters'](_[_0x2732('0x39')](_0x4ec9a3['query'],_0x4e4f8a[_0x2732('0x3a')]),_0x25ffb2);if(_0x4ec9a3['query'][_0x2732('0x3b')]){_0x51e8b7[_0x2732('0x38')]=_[_0x2732('0x3c')](_0x51e8b7[_0x2732('0x38')],{'$or':_[_0x2732('0x2a')](_0x25ffb2,function(_0x25b96e){if(_0x25b96e[_0x2732('0x2d')]!==_0x2732('0x3d')){var _0x4f00cd={};_0x4f00cd[_0x25b96e['name']]={'$like':'%'+_0x4ec9a3[_0x2732('0x2f')][_0x2732('0x3b')]+'%'};return _0x4f00cd;}})});}_0x51e8b7=_['merge']({},_0x51e8b7,_0x4ec9a3['options']);var _0x400163={'where':_0x51e8b7[_0x2732('0x38')]};return db[_0x2732('0x3e')][_0x2732('0x1e')](_0x400163)['then'](function(_0x4c94db){_0x4da045[_0x2732('0x1e')]=_0x4c94db;if(_0x4ec9a3[_0x2732('0x2f')][_0x2732('0x3f')]){_0x51e8b7[_0x2732('0x40')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x51e8b7);})[_0x2732('0x26')](function(_0x33a163){_0x4da045[_0x2732('0x41')]=_0x33a163;return _0x4da045;})[_0x2732('0x26')](respondWithFilteredResult(_0x17ce9a,_0x51e8b7))[_0x2732('0x42')](handleError(_0x17ce9a,null));};exports[_0x2732('0x43')]=function(_0x3635cb,_0x595640){var _0x189443={'raw':!![],'where':{'id':_0x3635cb[_0x2732('0x44')]['id']}},_0x268751={};_0x268751[_0x2732('0x2e')]=_['keys'](db[_0x2732('0x3e')][_0x2732('0x2b')]);_0x268751[_0x2732('0x2f')]=_[_0x2732('0x30')](_0x3635cb[_0x2732('0x2f')]);_0x268751['filters']=_[_0x2732('0x31')](_0x268751['model'],_0x268751[_0x2732('0x2f')]);_0x189443[_0x2732('0x32')]=_[_0x2732('0x31')](_0x268751[_0x2732('0x2e')],qs[_0x2732('0x33')](_0x3635cb['query'][_0x2732('0x33')]));_0x189443['attributes']=_0x189443[_0x2732('0x32')][_0x2732('0x34')]?_0x189443[_0x2732('0x32')]:_0x268751[_0x2732('0x2e')];if(_0x3635cb[_0x2732('0x2f')]['includeAll']){_0x189443['include']=[{'all':!![]}];}_0x189443=_['merge']({},_0x189443,_0x3635cb[_0x2732('0x45')]);return db[_0x2732('0x3e')]['find'](_0x189443)['then'](handleEntityNotFound(_0x595640,null))[_0x2732('0x26')](respondWithResult(_0x595640,null))[_0x2732('0x42')](handleError(_0x595640,null));};exports['create']=function(_0x4bda5b,_0x3a2fd5){return db[_0x2732('0x3e')][_0x2732('0x46')](_0x4bda5b[_0x2732('0x47')],{})[_0x2732('0x26')](respondWithResult(_0x3a2fd5,0xc9))[_0x2732('0x42')](handleError(_0x3a2fd5,null));};exports[_0x2732('0x24')]=function(_0x553c92,_0x2ffe47){if(_0x553c92[_0x2732('0x47')]['id']){delete _0x553c92[_0x2732('0x47')]['id'];}return db[_0x2732('0x3e')][_0x2732('0x48')]({'where':{'id':_0x553c92[_0x2732('0x44')]['id']}})[_0x2732('0x26')](handleEntityNotFound(_0x2ffe47,null))['then'](saveUpdates(_0x553c92['body'],null))[_0x2732('0x26')](respondWithResult(_0x2ffe47,null))[_0x2732('0x42')](handleError(_0x2ffe47,null));};exports['destroy']=function(_0x18c81d,_0x15e4c8){return db[_0x2732('0x3e')][_0x2732('0x48')]({'where':{'id':_0x18c81d['params']['id']}})[_0x2732('0x26')](handleEntityNotFound(_0x15e4c8,null))[_0x2732('0x26')](removeEntity(_0x15e4c8,null))['catch'](handleError(_0x15e4c8,null));};exports['describe']=function(_0x318338,_0x314e3b){return db['FaxTransferReport'][_0x2732('0x49')]()[_0x2732('0x26')](respondWithResult(_0x314e3b,null))[_0x2732('0x42')](handleError(_0x314e3b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 16ac847..9994987 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 _0xeddd=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x55c3d9,_0x3bf75c){var _0x19fd97=function(_0x2b0205){while(--_0x2b0205){_0x55c3d9['push'](_0x55c3d9['shift']());}};_0x19fd97(++_0x3bf75c);}(_0xeddd,0x153));var _0xdedd=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xeddd[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var logger=require(_0xdedd('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdedd('0x3'));var rp=require(_0xdedd('0x4'));var fs=require('fs');var path=require(_0xdedd('0x5'));var rimraf=require(_0xdedd('0x6'));var config=require(_0xdedd('0x7'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x430830,_0x23bcf4){return _0x430830[_0xdedd('0x8')](_0xdedd('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xdedd('0xa'),'fields':[_0xdedd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ad0=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x160606,_0x21388a){var _0x57851b=function(_0x3adf17){while(--_0x3adf17){_0x160606['push'](_0x160606['shift']());}};_0x57851b(++_0x21388a);}(_0x8ad0,0xb7));var _0x08ad=function(_0x5f007c,_0x527cd3){_0x5f007c=_0x5f007c-0x0;var _0x1a69e3=_0x8ad0[_0x5f007c];return _0x1a69e3;};'use strict';var _=require(_0x08ad('0x0'));var util=require(_0x08ad('0x1'));var logger=require(_0x08ad('0x2'))(_0x08ad('0x3'));var moment=require(_0x08ad('0x4'));var BPromise=require(_0x08ad('0x5'));var rp=require(_0x08ad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x08ad('0x7'));var config=require(_0x08ad('0x8'));var attributes=require(_0x08ad('0x9'));module[_0x08ad('0xa')]=function(_0xcff46,_0x420a32){return _0xcff46[_0x08ad('0xb')](_0x08ad('0xc'),attributes,{'tableName':_0x08ad('0xd'),'paranoid':![],'indexes':[{'name':_0x08ad('0xe'),'fields':[_0x08ad('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 99db49a..90827f1 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 _0x2668=['http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../config/utils','jayson/promise','client'];(function(_0x30ea47,_0x3e06a5){var _0x1f9821=function(_0xd7433d){while(--_0xd7433d){_0x30ea47['push'](_0x30ea47['shift']());}};_0x1f9821(++_0x3e06a5);}(_0x2668,0x11a));var _0x8266=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x2668[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0x8266('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8266('0x1'));var fs=require('fs');var Redis=require(_0x8266('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8266('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8266('0x4'));var client=jayson[_0x8266('0x5')][_0x8266('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x32be0a,_0x3c9837,_0x93f8b9){return new BPromise(function(_0x3b158f,_0x363e82){return client[_0x8266('0x7')](_0x32be0a,_0x93f8b9)['then'](function(_0x3d8a0b){logger[_0x8266('0x8')](_0x8266('0x9'),_0x3c9837,_0x8266('0xa'));logger[_0x8266('0xb')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x3c9837,'request\x20sent',JSON[_0x8266('0xc')](_0x3d8a0b));if(_0x3d8a0b[_0x8266('0xd')]){if(_0x3d8a0b[_0x8266('0xd')][_0x8266('0xe')]===0x1f4){logger[_0x8266('0xd')](_0x8266('0x9'),_0x3c9837,_0x3d8a0b[_0x8266('0xd')][_0x8266('0xf')]);return _0x363e82(_0x3d8a0b[_0x8266('0xd')][_0x8266('0xf')]);}logger[_0x8266('0xd')](_0x8266('0x9'),_0x3c9837,_0x3d8a0b['error']['message']);return _0x3b158f(_0x3d8a0b[_0x8266('0xd')][_0x8266('0xf')]);}else{logger[_0x8266('0x8')](_0x8266('0x9'),_0x3c9837,_0x8266('0xa'));_0x3b158f(_0x3d8a0b[_0x8266('0x10')][_0x8266('0xf')]);}})[_0x8266('0x11')](function(_0x51c566){logger[_0x8266('0xd')](_0x8266('0x9'),_0x3c9837,_0x51c566);_0x363e82(_0x51c566);});});} \ No newline at end of file +var _0xc70a=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x2d3b98,_0x2138f6){var _0x457c95=function(_0xd29298){while(--_0xd29298){_0x2d3b98['push'](_0x2d3b98['shift']());}};_0x457c95(++_0x2138f6);}(_0xc70a,0x12d));var _0xac70=function(_0x5cff36,_0x15f92c){_0x5cff36=_0x5cff36-0x0;var _0x2a2b7c=_0xc70a[_0x5cff36];return _0x2a2b7c;};'use strict';var _=require(_0xac70('0x0'));var util=require('util');var moment=require(_0xac70('0x1'));var BPromise=require(_0xac70('0x2'));var rs=require(_0xac70('0x3'));var fs=require('fs');var Redis=require(_0xac70('0x4'));var db=require(_0xac70('0x5'))['db'];var utils=require(_0xac70('0x6'));var logger=require('../../config/logger')(_0xac70('0x7'));var config=require(_0xac70('0x8'));var jayson=require(_0xac70('0x9'));var client=jayson[_0xac70('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaaab82,_0x136225,_0x339ae8){return new BPromise(function(_0x1512f0,_0xa41f35){return client[_0xac70('0xb')](_0xaaab82,_0x339ae8)[_0xac70('0xc')](function(_0x5272b3){logger[_0xac70('0xd')](_0xac70('0xe'),_0x136225,'request\x20sent');logger[_0xac70('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x136225,_0xac70('0x10'),JSON[_0xac70('0x11')](_0x5272b3));if(_0x5272b3['error']){if(_0x5272b3[_0xac70('0x12')][_0xac70('0x13')]===0x1f4){logger[_0xac70('0x12')](_0xac70('0xe'),_0x136225,_0x5272b3['error'][_0xac70('0x14')]);return _0xa41f35(_0x5272b3[_0xac70('0x12')][_0xac70('0x14')]);}logger[_0xac70('0x12')](_0xac70('0xe'),_0x136225,_0x5272b3[_0xac70('0x12')][_0xac70('0x14')]);return _0x1512f0(_0x5272b3[_0xac70('0x12')][_0xac70('0x14')]);}else{logger[_0xac70('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x136225,_0xac70('0x10'));_0x1512f0(_0x5272b3[_0xac70('0x15')][_0xac70('0x14')]);}})[_0xac70('0x16')](function(_0x419c6e){logger[_0xac70('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x136225,_0x419c6e);_0xa41f35(_0x419c6e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index fec0393..7fba8d4 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 _0x78b5=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','update','delete','destroy','exports','multer','util'];(function(_0x59f7b8,_0xb2ac21){var _0x7b28c5=function(_0x427d2d){while(--_0x427d2d){_0x59f7b8['push'](_0x59f7b8['shift']());}};_0x7b28c5(++_0xb2ac21);}(_0x78b5,0x1c0));var _0x578b=function(_0x387311,_0x2e27eb){_0x387311=_0x387311-0x0;var _0x2f4aef=_0x78b5[_0x387311];return _0x2f4aef;};'use strict';var multer=require(_0x578b('0x0'));var util=require(_0x578b('0x1'));var path=require('path');var timeout=require(_0x578b('0x2'));var express=require(_0x578b('0x3'));var router=express[_0x578b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x578b('0x5'));var interaction=require(_0x578b('0x6'));var config=require('../../config/environment');var controller=require(_0x578b('0x7'));router[_0x578b('0x8')]('/',auth[_0x578b('0x9')](),controller['index']);router['get'](_0x578b('0xa'),auth['isAuthenticated'](),controller[_0x578b('0xb')]);router[_0x578b('0x8')](_0x578b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x578b('0xd')]('/',auth[_0x578b('0x9')](),controller['create']);router['put'](_0x578b('0xc'),auth['isAuthenticated'](),controller[_0x578b('0xe')]);router[_0x578b('0xf')](_0x578b('0xc'),auth[_0x578b('0x9')](),controller[_0x578b('0x10')]);module[_0x578b('0x11')]=router; \ No newline at end of file +var _0x62f5=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','index','/describe','describe','get','/:id','isAuthenticated','show','post','create','put','update','exports','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x62f5,0xfb));var _0x562f=function(_0x18949c,_0xda6153){_0x18949c=_0x18949c-0x0;var _0x177a5d=_0x62f5[_0x18949c];return _0x177a5d;};'use strict';var multer=require('multer');var util=require(_0x562f('0x0'));var path=require(_0x562f('0x1'));var timeout=require(_0x562f('0x2'));var express=require('express');var router=express[_0x562f('0x3')]();var fs_extra=require(_0x562f('0x4'));var auth=require(_0x562f('0x5'));var interaction=require(_0x562f('0x6'));var config=require(_0x562f('0x7'));var controller=require(_0x562f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x562f('0x9')]);router['get'](_0x562f('0xa'),auth['isAuthenticated'](),controller[_0x562f('0xb')]);router[_0x562f('0xc')](_0x562f('0xd'),auth[_0x562f('0xe')](),controller[_0x562f('0xf')]);router[_0x562f('0x10')]('/',auth[_0x562f('0xe')](),controller[_0x562f('0x11')]);router[_0x562f('0x12')]('/:id',auth[_0x562f('0xe')](),controller[_0x562f('0x13')]);router['delete'](_0x562f('0xd'),auth[_0x562f('0xe')](),controller['destroy']);module[_0x562f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f983bb7..b35c787 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 _0x533a=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','/:id/configurations','getFields','post','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x533a,0xd4));var _0xa533=function(_0x416468,_0x2e7a72){_0x416468=_0x416468-0x0;var _0x2ee9b7=_0x533a[_0x416468];return _0x2ee9b7;};'use strict';var multer=require(_0xa533('0x0'));var util=require(_0xa533('0x1'));var path=require(_0xa533('0x2'));var timeout=require(_0xa533('0x3'));var express=require(_0xa533('0x4'));var router=express['Router']();var fs_extra=require(_0xa533('0x5'));var auth=require(_0xa533('0x6'));var interaction=require(_0xa533('0x7'));var config=require(_0xa533('0x8'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xa533('0x9')](),controller[_0xa533('0xa')]);router['get'](_0xa533('0xb'),auth[_0xa533('0x9')](),controller['show']);router[_0xa533('0xc')](_0xa533('0xd'),auth[_0xa533('0x9')](),controller['getConfigurations']);router[_0xa533('0xc')]('/:id/fields',auth[_0xa533('0x9')](),controller[_0xa533('0xe')]);router[_0xa533('0xf')]('/',auth[_0xa533('0x9')](),controller[_0xa533('0x10')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xa533('0xb'),auth['isAuthenticated'](),controller[_0xa533('0x11')]);router[_0xa533('0x12')](_0xa533('0xb'),auth[_0xa533('0x9')](),controller[_0xa533('0x13')]);module[_0xa533('0x14')]=router; \ No newline at end of file +var _0x1ba8=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x34c371,_0x1e76a7){var _0x5b7128=function(_0x410d93){while(--_0x410d93){_0x34c371['push'](_0x34c371['shift']());}};_0x5b7128(++_0x1e76a7);}(_0x1ba8,0xd5));var _0x81ba=function(_0x2c3528,_0x5872d8){_0x2c3528=_0x2c3528-0x0;var _0x10db82=_0x1ba8[_0x2c3528];return _0x10db82;};'use strict';var multer=require(_0x81ba('0x0'));var util=require(_0x81ba('0x1'));var path=require(_0x81ba('0x2'));var timeout=require(_0x81ba('0x3'));var express=require(_0x81ba('0x4'));var router=express['Router']();var fs_extra=require(_0x81ba('0x5'));var auth=require(_0x81ba('0x6'));var interaction=require(_0x81ba('0x7'));var config=require(_0x81ba('0x8'));var controller=require(_0x81ba('0x9'));router['get']('/',auth[_0x81ba('0xa')](),controller[_0x81ba('0xb')]);router[_0x81ba('0xc')]('/:id',auth[_0x81ba('0xa')](),controller[_0x81ba('0xd')]);router[_0x81ba('0xc')]('/:id/configurations',auth[_0x81ba('0xa')](),controller['getConfigurations']);router['get'](_0x81ba('0xe'),auth['isAuthenticated'](),controller[_0x81ba('0xf')]);router[_0x81ba('0x10')]('/',auth[_0x81ba('0xa')](),controller[_0x81ba('0x11')]);router[_0x81ba('0x10')]('/:id/configurations',auth[_0x81ba('0xa')](),controller[_0x81ba('0x12')]);router['put'](_0x81ba('0x13'),auth[_0x81ba('0xa')](),controller[_0x81ba('0x14')]);router[_0x81ba('0x15')]('/:id',auth[_0x81ba('0xa')](),controller[_0x81ba('0x16')]);module[_0x81ba('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 83ea3a7..9a641e2 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 _0xdbae=['integrationTab','newTab','exports','STRING','basic'];(function(_0xf79003,_0x5a9960){var _0x4bb39c=function(_0x2017eb){while(--_0x2017eb){_0xf79003['push'](_0xf79003['shift']());}};_0x4bb39c(++_0x5a9960);}(_0xdbae,0x160));var _0xedba=function(_0x5f55a6,_0x40ff6d){_0x5f55a6=_0x5f55a6-0x0;var _0x5f2d58=_0xdbae[_0x5f55a6];return _0x5f2d58;};'use strict';var Sequelize=require('sequelize');module[_0xedba('0x0')]={'name':{'type':Sequelize[_0xedba('0x1')]},'description':{'type':Sequelize[_0xedba('0x1')]},'username':{'type':Sequelize[_0xedba('0x1')]},'remoteUri':{'type':Sequelize[_0xedba('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xedba('0x2')),'defaultValue':_0xedba('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xedba('0x1')]},'consumerSecret':{'type':Sequelize[_0xedba('0x1')]},'token':{'type':Sequelize[_0xedba('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xedba('0x3'),_0xedba('0x4')),'defaultValue':_0xedba('0x3')}}; \ No newline at end of file +var _0x826b=['sequelize','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x826b,0x1bc));var _0xb826=function(_0x181642,_0x59fa32){_0x181642=_0x181642-0x0;var _0x70f6ce=_0x826b[_0x181642];return _0x70f6ce;};'use strict';var Sequelize=require(_0xb826('0x0'));module['exports']={'name':{'type':Sequelize[_0xb826('0x1')]},'description':{'type':Sequelize[_0xb826('0x1')]},'username':{'type':Sequelize[_0xb826('0x1')]},'remoteUri':{'type':Sequelize[_0xb826('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xb826('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xb826('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb826('0x3')](_0xb826('0x4'),_0xb826('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index a451c28..38b0572 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 _0x2234=['Authorization','%s:%s','username','toString','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','DeskAccount','includeAll','findAll','catch','show','params','include','create','body','find','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x2234,0x1c8));var _0x4223=function(_0x2447d7,_0x3466fe){_0x2447d7=_0x2447d7-0x0;var _0x262442=_0x2234[_0x2447d7];return _0x262442;};'use strict';var emlformat=require(_0x4223('0x0'));var rimraf=require(_0x4223('0x1'));var zipdir=require(_0x4223('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4223('0x3'));var moment=require('moment');var BPromise=require(_0x4223('0x4'));var Mustache=require(_0x4223('0x5'));var util=require(_0x4223('0x6'));var path=require(_0x4223('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4223('0x8'));var _=require(_0x4223('0x9'));var squel=require(_0x4223('0xa'));var crypto=require(_0x4223('0xb'));var jsforce=require(_0x4223('0xc'));var deskjs=require(_0x4223('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4223('0xe'));var Papa=require('papaparse');var Redis=require(_0x4223('0xf'));var authService=require(_0x4223('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4223('0x11'));var hardwareService=require(_0x4223('0x12'));var logger=require(_0x4223('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4223('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x4223('0x15'));function respondWithStatusCode(_0x1602f9,_0x1d799c){_0x1d799c=_0x1d799c||0xcc;return function(_0x1cc4bc){if(_0x1cc4bc){return _0x1602f9['sendStatus'](_0x1d799c);}return _0x1602f9[_0x4223('0x16')](_0x1d799c)[_0x4223('0x17')]();};}function respondWithResult(_0x14c711,_0x5564a9){_0x5564a9=_0x5564a9||0xc8;return function(_0x2cdafe){if(_0x2cdafe){return _0x14c711['status'](_0x5564a9)[_0x4223('0x18')](_0x2cdafe);}};}function respondWithFilteredResult(_0x5a0927,_0x5bd8dd){return function(_0x1a9490){if(_0x1a9490){var _0xcf9220=typeof _0x5bd8dd['offset']==='undefined'&&typeof _0x5bd8dd['limit']===_0x4223('0x19');var _0xdd7469=_0x1a9490[_0x4223('0x1a')];var _0x3d5eeb=_0xcf9220?0x0:_0x5bd8dd[_0x4223('0x1b')];var _0x47d667=_0xcf9220?_0x1a9490['count']:_0x5bd8dd[_0x4223('0x1b')]+_0x5bd8dd['limit'];var _0x14c487;if(_0x47d667>=_0xdd7469){_0x47d667=_0xdd7469;_0x14c487=0xc8;}else{_0x14c487=0xce;}_0x5a0927[_0x4223('0x16')](_0x14c487);return _0x5a0927[_0x4223('0x1c')](_0x4223('0x1d'),_0x3d5eeb+'-'+_0x47d667+'/'+_0xdd7469)[_0x4223('0x18')](_0x1a9490);}return null;};}function patchUpdates(_0x144ebc){return function(_0x4251b7){try{jsonpatch[_0x4223('0x1e')](_0x4251b7,_0x144ebc,!![]);}catch(_0x502d0c){return BPromise['reject'](_0x502d0c);}return _0x4251b7[_0x4223('0x1f')]();};}function saveUpdates(_0x211c25,_0x2d787e){return function(_0x100ddf){if(_0x100ddf){return _0x100ddf[_0x4223('0x20')](_0x211c25)[_0x4223('0x21')](function(_0x15a775){return _0x15a775;});}return null;};}function removeEntity(_0x395914,_0x28fae2){return function(_0x52ad6f){if(_0x52ad6f){return _0x52ad6f[_0x4223('0x22')]()[_0x4223('0x21')](function(){_0x395914[_0x4223('0x16')](0xcc)[_0x4223('0x17')]();});}};}function handleEntityNotFound(_0x53f741,_0x57fc57){return function(_0x4b7344){if(!_0x4b7344){_0x53f741['sendStatus'](0x194);}return _0x4b7344;};}function handleError(_0x5474fe,_0x361998){_0x361998=_0x361998||0x1f4;return function(_0x1115e8){logger[_0x4223('0x23')](_0x1115e8[_0x4223('0x24')]);if(_0x1115e8[_0x4223('0x25')]){delete _0x1115e8['name'];}_0x5474fe[_0x4223('0x16')](_0x361998)[_0x4223('0x26')](_0x1115e8);};}exports[_0x4223('0x27')]=function(_0x157d81,_0x420380){var _0x207dca={},_0x20bcc9={},_0x594db8={'count':0x0,'rows':[]};var _0x379799=_[_0x4223('0x28')](db['DeskAccount'][_0x4223('0x29')],function(_0x2baa31){return{'name':_0x2baa31[_0x4223('0x2a')],'type':_0x2baa31[_0x4223('0x2b')][_0x4223('0x2c')]};});_0x20bcc9[_0x4223('0x2d')]=_[_0x4223('0x28')](_0x379799,_0x4223('0x25'));_0x20bcc9[_0x4223('0x2e')]=_[_0x4223('0x2f')](_0x157d81[_0x4223('0x2e')]);_0x20bcc9[_0x4223('0x30')]=_[_0x4223('0x31')](_0x20bcc9['model'],_0x20bcc9[_0x4223('0x2e')]);_0x207dca[_0x4223('0x32')]=_['intersection'](_0x20bcc9[_0x4223('0x2d')],qs[_0x4223('0x33')](_0x157d81[_0x4223('0x2e')][_0x4223('0x33')]));_0x207dca[_0x4223('0x32')]=_0x207dca[_0x4223('0x32')][_0x4223('0x34')]?_0x207dca['attributes']:_0x20bcc9[_0x4223('0x2d')];if(!_0x157d81[_0x4223('0x2e')]['hasOwnProperty'](_0x4223('0x35'))){_0x207dca[_0x4223('0x36')]=qs['limit'](_0x157d81['query'][_0x4223('0x36')]);_0x207dca[_0x4223('0x1b')]=qs['offset'](_0x157d81['query'][_0x4223('0x1b')]);}_0x207dca[_0x4223('0x37')]=qs['sort'](_0x157d81[_0x4223('0x2e')][_0x4223('0x38')]);_0x207dca[_0x4223('0x39')]=qs[_0x4223('0x30')](_[_0x4223('0x3a')](_0x157d81['query'],_0x20bcc9['filters']),_0x379799);if(_0x157d81[_0x4223('0x2e')][_0x4223('0x3b')]){_0x207dca[_0x4223('0x39')]=_[_0x4223('0x3c')](_0x207dca[_0x4223('0x39')],{'$or':_[_0x4223('0x28')](_0x379799,function(_0x231b47){if(_0x231b47['type']!=='VIRTUAL'){var _0x1018a6={};_0x1018a6[_0x231b47[_0x4223('0x25')]]={'$like':'%'+_0x157d81[_0x4223('0x2e')][_0x4223('0x3b')]+'%'};return _0x1018a6;}})});}_0x207dca=_['merge']({},_0x207dca,_0x157d81[_0x4223('0x3d')]);var _0x4f6905={'where':_0x207dca[_0x4223('0x39')]};return db[_0x4223('0x3e')]['count'](_0x4f6905)[_0x4223('0x21')](function(_0x3ad640){_0x594db8[_0x4223('0x1a')]=_0x3ad640;if(_0x157d81[_0x4223('0x2e')][_0x4223('0x3f')]){_0x207dca['include']=[{'all':!![]}];}return db[_0x4223('0x3e')][_0x4223('0x40')](_0x207dca);})[_0x4223('0x21')](function(_0x32e518){_0x594db8['rows']=_0x32e518;return _0x594db8;})['then'](respondWithFilteredResult(_0x420380,_0x207dca))[_0x4223('0x41')](handleError(_0x420380,null));};exports[_0x4223('0x42')]=function(_0x5999bc,_0x4824fb){var _0x3d0a37={'raw':![],'where':{'id':_0x5999bc[_0x4223('0x43')]['id']}},_0x18eb49={};_0x18eb49[_0x4223('0x2d')]=_[_0x4223('0x2f')](db['DeskAccount'][_0x4223('0x29')]);_0x18eb49[_0x4223('0x2e')]=_[_0x4223('0x2f')](_0x5999bc['query']);_0x18eb49[_0x4223('0x30')]=_['intersection'](_0x18eb49[_0x4223('0x2d')],_0x18eb49[_0x4223('0x2e')]);_0x3d0a37[_0x4223('0x32')]=_['intersection'](_0x18eb49[_0x4223('0x2d')],qs[_0x4223('0x33')](_0x5999bc[_0x4223('0x2e')][_0x4223('0x33')]));_0x3d0a37['attributes']=_0x3d0a37[_0x4223('0x32')][_0x4223('0x34')]?_0x3d0a37[_0x4223('0x32')]:_0x18eb49[_0x4223('0x2d')];if(_0x5999bc['query']['includeAll']){_0x3d0a37[_0x4223('0x44')]=[{'all':!![]}];}_0x3d0a37=_['merge']({},_0x3d0a37,_0x5999bc[_0x4223('0x3d')]);return db[_0x4223('0x3e')]['find'](_0x3d0a37)[_0x4223('0x21')](handleEntityNotFound(_0x4824fb,null))['then'](respondWithResult(_0x4824fb,null))[_0x4223('0x41')](handleError(_0x4824fb,null));};exports[_0x4223('0x45')]=function(_0x4c627c,_0x1312e0){return db[_0x4223('0x3e')]['create'](_0x4c627c[_0x4223('0x46')],{})[_0x4223('0x21')](respondWithResult(_0x1312e0,0xc9))['catch'](handleError(_0x1312e0,null));};exports[_0x4223('0x20')]=function(_0x5f3430,_0x5def43){if(_0x5f3430[_0x4223('0x46')]['id']){delete _0x5f3430[_0x4223('0x46')]['id'];}return db[_0x4223('0x3e')]['find']({'where':{'id':_0x5f3430['params']['id']}})[_0x4223('0x21')](handleEntityNotFound(_0x5def43,null))[_0x4223('0x21')](saveUpdates(_0x5f3430['body'],null))[_0x4223('0x21')](respondWithResult(_0x5def43,null))[_0x4223('0x41')](handleError(_0x5def43,null));};exports[_0x4223('0x22')]=function(_0x306a22,_0x566b5a){return db[_0x4223('0x3e')][_0x4223('0x47')]({'where':{'id':_0x306a22[_0x4223('0x43')]['id']}})[_0x4223('0x21')](handleEntityNotFound(_0x566b5a,null))[_0x4223('0x21')](removeEntity(_0x566b5a,null))['catch'](handleError(_0x566b5a,null));};exports[_0x4223('0x48')]=function(_0x414ed7,_0x2742db,_0x33ec96){var _0x1d578a={};var _0x12ef64={};var _0x26e7a0;var _0x3591e4;return db[_0x4223('0x3e')][_0x4223('0x49')]({'where':{'id':_0x414ed7['params']['id']}})[_0x4223('0x21')](handleEntityNotFound(_0x2742db,null))[_0x4223('0x21')](function(_0x13a98e){if(_0x13a98e){_0x26e7a0=_0x13a98e;_0x12ef64[_0x4223('0x2d')]=_[_0x4223('0x2f')](db['DeskConfiguration'][_0x4223('0x29')]);_0x12ef64[_0x4223('0x2e')]=_[_0x4223('0x2f')](_0x414ed7[_0x4223('0x2e')]);_0x12ef64[_0x4223('0x30')]=_['intersection'](_0x12ef64[_0x4223('0x2d')],_0x12ef64['query']);_0x1d578a[_0x4223('0x32')]=_[_0x4223('0x31')](_0x12ef64[_0x4223('0x2d')],qs[_0x4223('0x33')](_0x414ed7[_0x4223('0x2e')]['fields']));_0x1d578a[_0x4223('0x32')]=_0x1d578a[_0x4223('0x32')][_0x4223('0x34')]?_0x1d578a[_0x4223('0x32')]:_0x12ef64[_0x4223('0x2d')];_0x1d578a[_0x4223('0x37')]=qs[_0x4223('0x38')](_0x414ed7['query'][_0x4223('0x38')]);_0x1d578a['where']=qs[_0x4223('0x30')](_[_0x4223('0x3a')](_0x414ed7[_0x4223('0x2e')],_0x12ef64[_0x4223('0x30')]));if(_0x414ed7['query']['filter']){_0x1d578a['where']=_[_0x4223('0x3c')](_0x1d578a[_0x4223('0x39')],{'$or':_[_0x4223('0x28')](_0x1d578a[_0x4223('0x32')],function(_0x4b0c93){var _0x47d60f={};_0x47d60f[_0x4b0c93]={'$like':'%'+_0x414ed7[_0x4223('0x2e')]['filter']+'%'};return _0x47d60f;})});}_0x1d578a=_['merge']({},_0x1d578a,_0x414ed7[_0x4223('0x3d')]);return _0x26e7a0[_0x4223('0x48')](_0x1d578a);}})[_0x4223('0x21')](function(_0x2c9bcc){if(_0x2c9bcc){_0x3591e4=_0x2c9bcc[_0x4223('0x34')];if(!_0x414ed7['query'][_0x4223('0x4a')](_0x4223('0x35'))){_0x1d578a[_0x4223('0x36')]=qs[_0x4223('0x36')](_0x414ed7[_0x4223('0x2e')]['limit']);_0x1d578a['offset']=qs[_0x4223('0x1b')](_0x414ed7[_0x4223('0x2e')][_0x4223('0x1b')]);}return _0x26e7a0['getConfigurations'](_0x1d578a);}})[_0x4223('0x21')](function(_0xf74942){if(_0xf74942){return _0xf74942?{'count':_0x3591e4,'rows':_0xf74942}:null;}})[_0x4223('0x21')](respondWithResult(_0x2742db,null))[_0x4223('0x41')](handleError(_0x2742db,null));};exports[_0x4223('0x4b')]=function(_0x42a1e6,_0x142429,_0x1fa9d4){if(_0x42a1e6['body']['id']){delete _0x42a1e6[_0x4223('0x46')]['id'];}return db[_0x4223('0x3e')][_0x4223('0x49')]({'where':{'id':_0x42a1e6[_0x4223('0x43')]['id']}})[_0x4223('0x21')](handleEntityNotFound(_0x142429,null))[_0x4223('0x21')](function(_0x5610d2){if(_0x5610d2){_0x42a1e6[_0x4223('0x46')][_0x4223('0x4c')]=_0x5610d2['id'];_0x42a1e6['body'][_0x4223('0x4d')]=integrations[_0x4223('0x4e')](_0x42a1e6['body'][_0x4223('0x4f')],_0x42a1e6['body'][_0x4223('0x2b')]);_0x42a1e6[_0x4223('0x46')][_0x4223('0x50')]=integrations[_0x4223('0x51')](_0x42a1e6['body']['channel'],_0x42a1e6['body'][_0x4223('0x2b')]);return db[_0x4223('0x52')][_0x4223('0x45')](_0x42a1e6[_0x4223('0x46')],{'include':[{'model':db[_0x4223('0x53')],'as':_0x4223('0x4d')},{'model':db[_0x4223('0x53')],'as':_0x4223('0x50')}]});}return null;})[_0x4223('0x21')](respondWithResult(_0x142429,null))['catch'](handleError(_0x142429,null));};exports['getFields']=function(_0x1d154a,_0x164ca3,_0x334b87){var _0x596d03=[{'name':'priority','label':_0x4223('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x232e59='';return db[_0x4223('0x3e')][_0x4223('0x49')]({'where':{'id':_0x1d154a[_0x4223('0x43')]['id']},'attributes':['id',_0x4223('0x55'),_0x4223('0x56'),'username',_0x4223('0x57'),_0x4223('0x58'),_0x4223('0x59'),_0x4223('0x5a'),_0x4223('0x5b')]})[_0x4223('0x21')](handleEntityNotFound(_0x164ca3,null))['then'](function(_0x13c477){if(_0x13c477){_0x232e59=_0x13c477[_0x4223('0x55')];var _0x469119=_0x232e59[_0x4223('0x5c')](-0x1);if(_0x469119==='/'){_0x232e59=_0x232e59['substring'](0x0,_0x232e59[_0x4223('0x5d')](_0x469119));}var _0x5b0f03={'method':_0x4223('0x5e'),'uri':util[_0x4223('0x5f')](_0x4223('0x60'),_0x232e59),'headers':{'Content-Type':_0x4223('0x61'),'Accept':_0x4223('0x61')},'json':!![]};if(_0x13c477['authType']===_0x4223('0x62')){_0x5b0f03['headers'][_0x4223('0x63')]=util[_0x4223('0x5f')]('Basic\x20%s',new Buffer(util[_0x4223('0x5f')](_0x4223('0x64'),_0x13c477[_0x4223('0x65')],_0x13c477[_0x4223('0x57')]))[_0x4223('0x66')]('base64'));}return rp(_0x5b0f03)[_0x4223('0x21')](function(_0x164ecd){return _0x596d03[_0x4223('0x67')](_['map'](_0x164ecd[_0x4223('0x68')][_0x4223('0x69')],function(_0x11c3ea){return{'id':_0x11c3ea[_0x4223('0x25')],'name':_0x11c3ea['name'],'type':_0x11c3ea[_0x4223('0x2b')],'active':_0x11c3ea[_0x4223('0x6a')],'label':_0x11c3ea[_0x4223('0x6b')],'custom':!![]};}));});}})[_0x4223('0x21')](function(_0x298416){return{'count':_0x298416[_0x4223('0x34')],'rows':_0x298416};})[_0x4223('0x21')](respondWithResult(_0x164ca3,null))['catch'](function(_0x2c988b){var _0x8f83da=_0x1d154a[_0x4223('0x2e')][_0x4223('0x6c')]?0x1f4:_0x2c988b[_0x4223('0x6d')]||0x1f4;logger[_0x4223('0x23')](_0x4223('0x6e'),'getFields',_0x8f83da,JSON['stringify'](_0x2c988b));delete _0x2c988b[_0x4223('0x25')];if(_0x8f83da===0x191){_0x8f83da=0x190;}_0x164ca3[_0x4223('0x16')](_0x8f83da)['send'](_0x1d154a[_0x4223('0x2e')][_0x4223('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x2c988b[_0x4223('0x6d')]}:_0x2c988b);});}; \ No newline at end of file +var _0x9f22=['findOne','DeskConfiguration','order','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','username','password','consumerKey','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','Authorization','Basic\x20%s','%s:%s','base64','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','apply','update','destroy','then','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','type','model','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','getConfigurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f22,0x16e));var _0x29f2=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9f22[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x29f2('0x0'));var rimraf=require(_0x29f2('0x1'));var zipdir=require(_0x29f2('0x2'));var jsonpatch=require(_0x29f2('0x3'));var rp=require(_0x29f2('0x4'));var moment=require(_0x29f2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f2('0x6'));var path=require('path');var sox=require(_0x29f2('0x7'));var csv=require('to-csv');var ejs=require(_0x29f2('0x8'));var fs=require('fs');var fs_extra=require(_0x29f2('0x9'));var _=require(_0x29f2('0xa'));var squel=require(_0x29f2('0xb'));var crypto=require(_0x29f2('0xc'));var jsforce=require(_0x29f2('0xd'));var deskjs=require(_0x29f2('0xe'));var toCsv=require(_0x29f2('0xf'));var querystring=require(_0x29f2('0x10'));var Papa=require('papaparse');var Redis=require(_0x29f2('0x11'));var authService=require(_0x29f2('0x12'));var qs=require(_0x29f2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29f2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x29f2('0x15'));var licenseUtil=require(_0x29f2('0x16'));var db=require(_0x29f2('0x17'))['db'];var integrations=require(_0x29f2('0x18'));function respondWithStatusCode(_0x2bfe5b,_0x5a56d6){_0x5a56d6=_0x5a56d6||0xcc;return function(_0x51c5e8){if(_0x51c5e8){return _0x2bfe5b['sendStatus'](_0x5a56d6);}return _0x2bfe5b[_0x29f2('0x19')](_0x5a56d6)[_0x29f2('0x1a')]();};}function respondWithResult(_0x217be2,_0x11241d){_0x11241d=_0x11241d||0xc8;return function(_0x2d32fc){if(_0x2d32fc){return _0x217be2[_0x29f2('0x19')](_0x11241d)[_0x29f2('0x1b')](_0x2d32fc);}};}function respondWithFilteredResult(_0x43a37d,_0x5c8d33){return function(_0x168726){if(_0x168726){var _0x1ea0ee=typeof _0x5c8d33[_0x29f2('0x1c')]==='undefined'&&typeof _0x5c8d33[_0x29f2('0x1d')]===_0x29f2('0x1e');var _0x4f7009=_0x168726[_0x29f2('0x1f')];var _0xd2944b=_0x1ea0ee?0x0:_0x5c8d33[_0x29f2('0x1c')];var _0x1ed60e=_0x1ea0ee?_0x168726[_0x29f2('0x1f')]:_0x5c8d33[_0x29f2('0x1c')]+_0x5c8d33[_0x29f2('0x1d')];var _0x8c6d5f;if(_0x1ed60e>=_0x4f7009){_0x1ed60e=_0x4f7009;_0x8c6d5f=0xc8;}else{_0x8c6d5f=0xce;}_0x43a37d[_0x29f2('0x19')](_0x8c6d5f);return _0x43a37d[_0x29f2('0x20')]('Content-Range',_0xd2944b+'-'+_0x1ed60e+'/'+_0x4f7009)['json'](_0x168726);}return null;};}function patchUpdates(_0x619753){return function(_0x17ab10){try{jsonpatch[_0x29f2('0x21')](_0x17ab10,_0x619753,!![]);}catch(_0x24be71){return BPromise['reject'](_0x24be71);}return _0x17ab10['save']();};}function saveUpdates(_0x1b5bb7,_0x24e8e7){return function(_0x40593b){if(_0x40593b){return _0x40593b[_0x29f2('0x22')](_0x1b5bb7)['then'](function(_0x557589){return _0x557589;});}return null;};}function removeEntity(_0x549eec,_0x4314a0){return function(_0x168c36){if(_0x168c36){return _0x168c36[_0x29f2('0x23')]()[_0x29f2('0x24')](function(){_0x549eec[_0x29f2('0x19')](0xcc)[_0x29f2('0x1a')]();});}};}function handleEntityNotFound(_0x5d719e,_0x4febec){return function(_0x10c96f){if(!_0x10c96f){_0x5d719e[_0x29f2('0x25')](0x194);}return _0x10c96f;};}function handleError(_0xa27f10,_0x425a4c){_0x425a4c=_0x425a4c||0x1f4;return function(_0x12afb7){logger[_0x29f2('0x26')](_0x12afb7[_0x29f2('0x27')]);if(_0x12afb7[_0x29f2('0x28')]){delete _0x12afb7[_0x29f2('0x28')];}_0xa27f10[_0x29f2('0x19')](_0x425a4c)[_0x29f2('0x29')](_0x12afb7);};}exports[_0x29f2('0x2a')]=function(_0x7c9b9c,_0x49fe10){var _0x3a0dcd={},_0x215dcc={},_0x545957={'count':0x0,'rows':[]};var _0xf41513=_[_0x29f2('0x2b')](db[_0x29f2('0x2c')][_0x29f2('0x2d')],function(_0x484050){return{'name':_0x484050['fieldName'],'type':_0x484050[_0x29f2('0x2e')]['key']};});_0x215dcc[_0x29f2('0x2f')]=_['map'](_0xf41513,_0x29f2('0x28'));_0x215dcc['query']=_['keys'](_0x7c9b9c['query']);_0x215dcc['filters']=_[_0x29f2('0x30')](_0x215dcc[_0x29f2('0x2f')],_0x215dcc['query']);_0x3a0dcd[_0x29f2('0x31')]=_[_0x29f2('0x30')](_0x215dcc[_0x29f2('0x2f')],qs[_0x29f2('0x32')](_0x7c9b9c[_0x29f2('0x33')]['fields']));_0x3a0dcd[_0x29f2('0x31')]=_0x3a0dcd[_0x29f2('0x31')][_0x29f2('0x34')]?_0x3a0dcd[_0x29f2('0x31')]:_0x215dcc['model'];if(!_0x7c9b9c[_0x29f2('0x33')][_0x29f2('0x35')](_0x29f2('0x36'))){_0x3a0dcd[_0x29f2('0x1d')]=qs[_0x29f2('0x1d')](_0x7c9b9c[_0x29f2('0x33')][_0x29f2('0x1d')]);_0x3a0dcd[_0x29f2('0x1c')]=qs[_0x29f2('0x1c')](_0x7c9b9c[_0x29f2('0x33')][_0x29f2('0x1c')]);}_0x3a0dcd['order']=qs['sort'](_0x7c9b9c['query'][_0x29f2('0x37')]);_0x3a0dcd[_0x29f2('0x38')]=qs[_0x29f2('0x39')](_[_0x29f2('0x3a')](_0x7c9b9c[_0x29f2('0x33')],_0x215dcc[_0x29f2('0x39')]),_0xf41513);if(_0x7c9b9c[_0x29f2('0x33')][_0x29f2('0x3b')]){_0x3a0dcd[_0x29f2('0x38')]=_[_0x29f2('0x3c')](_0x3a0dcd[_0x29f2('0x38')],{'$or':_[_0x29f2('0x2b')](_0xf41513,function(_0x20aa58){if(_0x20aa58[_0x29f2('0x2e')]!==_0x29f2('0x3d')){var _0xed0391={};_0xed0391[_0x20aa58[_0x29f2('0x28')]]={'$like':'%'+_0x7c9b9c[_0x29f2('0x33')][_0x29f2('0x3b')]+'%'};return _0xed0391;}})});}_0x3a0dcd=_[_0x29f2('0x3c')]({},_0x3a0dcd,_0x7c9b9c['options']);var _0x4cd9a2={'where':_0x3a0dcd[_0x29f2('0x38')]};return db[_0x29f2('0x2c')][_0x29f2('0x1f')](_0x4cd9a2)[_0x29f2('0x24')](function(_0x208314){_0x545957['count']=_0x208314;if(_0x7c9b9c[_0x29f2('0x33')][_0x29f2('0x3e')]){_0x3a0dcd['include']=[{'all':!![]}];}return db[_0x29f2('0x2c')][_0x29f2('0x3f')](_0x3a0dcd);})[_0x29f2('0x24')](function(_0x587eb9){_0x545957['rows']=_0x587eb9;return _0x545957;})['then'](respondWithFilteredResult(_0x49fe10,_0x3a0dcd))[_0x29f2('0x40')](handleError(_0x49fe10,null));};exports[_0x29f2('0x41')]=function(_0x568fba,_0x1fc720){var _0x1b79b6={'raw':![],'where':{'id':_0x568fba[_0x29f2('0x42')]['id']}},_0x497164={};_0x497164[_0x29f2('0x2f')]=_[_0x29f2('0x43')](db[_0x29f2('0x2c')][_0x29f2('0x2d')]);_0x497164[_0x29f2('0x33')]=_['keys'](_0x568fba[_0x29f2('0x33')]);_0x497164[_0x29f2('0x39')]=_['intersection'](_0x497164[_0x29f2('0x2f')],_0x497164['query']);_0x1b79b6['attributes']=_[_0x29f2('0x30')](_0x497164[_0x29f2('0x2f')],qs[_0x29f2('0x32')](_0x568fba[_0x29f2('0x33')][_0x29f2('0x32')]));_0x1b79b6[_0x29f2('0x31')]=_0x1b79b6[_0x29f2('0x31')]['length']?_0x1b79b6[_0x29f2('0x31')]:_0x497164[_0x29f2('0x2f')];if(_0x568fba[_0x29f2('0x33')]['includeAll']){_0x1b79b6[_0x29f2('0x44')]=[{'all':!![]}];}_0x1b79b6=_['merge']({},_0x1b79b6,_0x568fba[_0x29f2('0x45')]);return db['DeskAccount'][_0x29f2('0x46')](_0x1b79b6)[_0x29f2('0x24')](handleEntityNotFound(_0x1fc720,null))[_0x29f2('0x24')](respondWithResult(_0x1fc720,null))['catch'](handleError(_0x1fc720,null));};exports[_0x29f2('0x47')]=function(_0x2a82a5,_0x527031){return db[_0x29f2('0x2c')]['create'](_0x2a82a5[_0x29f2('0x48')],{})[_0x29f2('0x24')](respondWithResult(_0x527031,0xc9))[_0x29f2('0x40')](handleError(_0x527031,null));};exports[_0x29f2('0x22')]=function(_0x28269e,_0x472bdc){if(_0x28269e[_0x29f2('0x48')]['id']){delete _0x28269e[_0x29f2('0x48')]['id'];}return db[_0x29f2('0x2c')][_0x29f2('0x46')]({'where':{'id':_0x28269e[_0x29f2('0x42')]['id']}})[_0x29f2('0x24')](handleEntityNotFound(_0x472bdc,null))[_0x29f2('0x24')](saveUpdates(_0x28269e[_0x29f2('0x48')],null))[_0x29f2('0x24')](respondWithResult(_0x472bdc,null))[_0x29f2('0x40')](handleError(_0x472bdc,null));};exports[_0x29f2('0x23')]=function(_0x476048,_0x5d6a29){return db[_0x29f2('0x2c')][_0x29f2('0x46')]({'where':{'id':_0x476048['params']['id']}})[_0x29f2('0x24')](handleEntityNotFound(_0x5d6a29,null))['then'](removeEntity(_0x5d6a29,null))[_0x29f2('0x40')](handleError(_0x5d6a29,null));};exports[_0x29f2('0x49')]=function(_0x4c120d,_0x2a1c9a,_0x38ad16){var _0x4a9880={};var _0x318c0a={};var _0x4a0565;var _0x4bbd66;return db[_0x29f2('0x2c')][_0x29f2('0x4a')]({'where':{'id':_0x4c120d[_0x29f2('0x42')]['id']}})[_0x29f2('0x24')](handleEntityNotFound(_0x2a1c9a,null))['then'](function(_0x5cbff1){if(_0x5cbff1){_0x4a0565=_0x5cbff1;_0x318c0a['model']=_[_0x29f2('0x43')](db[_0x29f2('0x4b')][_0x29f2('0x2d')]);_0x318c0a[_0x29f2('0x33')]=_[_0x29f2('0x43')](_0x4c120d[_0x29f2('0x33')]);_0x318c0a['filters']=_['intersection'](_0x318c0a[_0x29f2('0x2f')],_0x318c0a[_0x29f2('0x33')]);_0x4a9880[_0x29f2('0x31')]=_['intersection'](_0x318c0a[_0x29f2('0x2f')],qs[_0x29f2('0x32')](_0x4c120d[_0x29f2('0x33')]['fields']));_0x4a9880[_0x29f2('0x31')]=_0x4a9880[_0x29f2('0x31')]['length']?_0x4a9880['attributes']:_0x318c0a[_0x29f2('0x2f')];_0x4a9880[_0x29f2('0x4c')]=qs[_0x29f2('0x37')](_0x4c120d['query'][_0x29f2('0x37')]);_0x4a9880[_0x29f2('0x38')]=qs['filters'](_[_0x29f2('0x3a')](_0x4c120d['query'],_0x318c0a[_0x29f2('0x39')]));if(_0x4c120d[_0x29f2('0x33')][_0x29f2('0x3b')]){_0x4a9880[_0x29f2('0x38')]=_[_0x29f2('0x3c')](_0x4a9880['where'],{'$or':_[_0x29f2('0x2b')](_0x4a9880[_0x29f2('0x31')],function(_0x274f9b){var _0x13bb2d={};_0x13bb2d[_0x274f9b]={'$like':'%'+_0x4c120d[_0x29f2('0x33')][_0x29f2('0x3b')]+'%'};return _0x13bb2d;})});}_0x4a9880=_['merge']({},_0x4a9880,_0x4c120d[_0x29f2('0x45')]);return _0x4a0565[_0x29f2('0x49')](_0x4a9880);}})[_0x29f2('0x24')](function(_0x49b78f){if(_0x49b78f){_0x4bbd66=_0x49b78f['length'];if(!_0x4c120d['query']['hasOwnProperty'](_0x29f2('0x36'))){_0x4a9880[_0x29f2('0x1d')]=qs[_0x29f2('0x1d')](_0x4c120d[_0x29f2('0x33')]['limit']);_0x4a9880['offset']=qs[_0x29f2('0x1c')](_0x4c120d[_0x29f2('0x33')][_0x29f2('0x1c')]);}return _0x4a0565[_0x29f2('0x49')](_0x4a9880);}})[_0x29f2('0x24')](function(_0x4bb54a){if(_0x4bb54a){return _0x4bb54a?{'count':_0x4bbd66,'rows':_0x4bb54a}:null;}})[_0x29f2('0x24')](respondWithResult(_0x2a1c9a,null))[_0x29f2('0x40')](handleError(_0x2a1c9a,null));};exports['addConfiguration']=function(_0x5a02f1,_0x59d1cb,_0xbda078){if(_0x5a02f1[_0x29f2('0x48')]['id']){delete _0x5a02f1[_0x29f2('0x48')]['id'];}return db[_0x29f2('0x2c')][_0x29f2('0x4a')]({'where':{'id':_0x5a02f1[_0x29f2('0x42')]['id']}})['then'](handleEntityNotFound(_0x59d1cb,null))[_0x29f2('0x24')](function(_0x1156ec){if(_0x1156ec){_0x5a02f1[_0x29f2('0x48')][_0x29f2('0x4d')]=_0x1156ec['id'];_0x5a02f1[_0x29f2('0x48')][_0x29f2('0x4e')]=integrations[_0x29f2('0x4f')](_0x5a02f1['body'][_0x29f2('0x50')],_0x5a02f1[_0x29f2('0x48')][_0x29f2('0x2e')]);_0x5a02f1['body']['Descriptions']=integrations[_0x29f2('0x51')](_0x5a02f1['body']['channel'],_0x5a02f1[_0x29f2('0x48')][_0x29f2('0x2e')]);return db[_0x29f2('0x4b')][_0x29f2('0x47')](_0x5a02f1[_0x29f2('0x48')],{'include':[{'model':db[_0x29f2('0x52')],'as':'Subjects'},{'model':db[_0x29f2('0x52')],'as':_0x29f2('0x53')}]});}return null;})[_0x29f2('0x24')](respondWithResult(_0x59d1cb,null))[_0x29f2('0x40')](handleError(_0x59d1cb,null));};exports[_0x29f2('0x54')]=function(_0x433124,_0x3e7b52,_0x6dc332){var _0x53d4cd=[{'name':'priority','label':_0x29f2('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x10623b='';return db[_0x29f2('0x2c')][_0x29f2('0x4a')]({'where':{'id':_0x433124['params']['id']},'attributes':['id',_0x29f2('0x56'),'authType',_0x29f2('0x57'),_0x29f2('0x58'),_0x29f2('0x59'),'consumerSecret',_0x29f2('0x5a'),_0x29f2('0x5b')]})[_0x29f2('0x24')](handleEntityNotFound(_0x3e7b52,null))[_0x29f2('0x24')](function(_0x30f841){if(_0x30f841){_0x10623b=_0x30f841['remoteUri'];var _0x2de311=_0x10623b['slice'](-0x1);if(_0x2de311==='/'){_0x10623b=_0x10623b[_0x29f2('0x5c')](0x0,_0x10623b[_0x29f2('0x5d')](_0x2de311));}var _0x112a56={'method':_0x29f2('0x5e'),'uri':util[_0x29f2('0x5f')](_0x29f2('0x60'),_0x10623b),'headers':{'Content-Type':_0x29f2('0x61'),'Accept':_0x29f2('0x61')},'json':!![]};if(_0x30f841[_0x29f2('0x62')]==='basic'){_0x112a56['headers'][_0x29f2('0x63')]=util[_0x29f2('0x5f')](_0x29f2('0x64'),new Buffer(util[_0x29f2('0x5f')](_0x29f2('0x65'),_0x30f841[_0x29f2('0x57')],_0x30f841['password']))['toString'](_0x29f2('0x66')));}return rp(_0x112a56)[_0x29f2('0x24')](function(_0x538b05){return _0x53d4cd['concat'](_[_0x29f2('0x2b')](_0x538b05[_0x29f2('0x67')][_0x29f2('0x68')],function(_0x2a0aca){return{'id':_0x2a0aca[_0x29f2('0x28')],'name':_0x2a0aca[_0x29f2('0x28')],'type':_0x2a0aca[_0x29f2('0x2e')],'active':_0x2a0aca[_0x29f2('0x69')],'label':_0x2a0aca[_0x29f2('0x6a')],'custom':!![]};}));});}})[_0x29f2('0x24')](function(_0x423abc){return{'count':_0x423abc[_0x29f2('0x34')],'rows':_0x423abc};})['then'](respondWithResult(_0x3e7b52,null))['catch'](function(_0x14ea17){var _0x3487d2=_0x433124['query'][_0x29f2('0x6b')]?0x1f4:_0x14ea17[_0x29f2('0x6c')]||0x1f4;logger[_0x29f2('0x26')](_0x29f2('0x6d'),_0x29f2('0x54'),_0x3487d2,JSON['stringify'](_0x14ea17));delete _0x14ea17[_0x29f2('0x28')];if(_0x3487d2===0x191){_0x3487d2=0x190;}_0x3e7b52[_0x29f2('0x19')](_0x3487d2)['send'](_0x433124['query'][_0x29f2('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x14ea17[_0x29f2('0x6c')]}:_0x14ea17);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 35f6d2e..5944a40 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 _0xce1a=['define','DeskAccount','int_desk_accounts','lodash','../../config/logger','moment','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xce1a,0x87));var _0xace1=function(_0x42c0ac,_0x5fc37c){_0x42c0ac=_0x42c0ac-0x0;var _0x4bd57a=_0xce1a[_0x42c0ac];return _0x4bd57a;};'use strict';var _=require(_0xace1('0x0'));var util=require('util');var logger=require(_0xace1('0x1'))('api');var moment=require(_0xace1('0x2'));var BPromise=require('bluebird');var rp=require(_0xace1('0x3'));var fs=require('fs');var path=require(_0xace1('0x4'));var rimraf=require(_0xace1('0x5'));var config=require('../../config/environment');var attributes=require(_0xace1('0x6'));var integrations=require(_0xace1('0x7'));module['exports']=function(_0xf31128,_0x629bdd){return _0xf31128[_0xace1('0x8')](_0xace1('0x9'),attributes,{'tableName':_0xace1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe752=['path','./intDeskAccount.attributes','exports','define','int_desk_accounts','../../config/logger','moment'];(function(_0x3a7415,_0xa026b6){var _0x5487a5=function(_0x9d4a71){while(--_0x9d4a71){_0x3a7415['push'](_0x3a7415['shift']());}};_0x5487a5(++_0xa026b6);}(_0xe752,0xc2));var _0x2e75=function(_0x5f296e,_0x277111){_0x5f296e=_0x5f296e-0x0;var _0x423c21=_0xe752[_0x5f296e];return _0x423c21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e75('0x0'))('api');var moment=require(_0x2e75('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e75('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e75('0x3'));var integrations=require('../../components/integrations/configuration');module[_0x2e75('0x4')]=function(_0xff4de3,_0x2293aa){return _0xff4de3[_0x2e75('0x5')]('DeskAccount',attributes,{'tableName':_0x2e75('0x6'),'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 15655cd..7e090c9 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 _0x764f=['model','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x2aefb6,_0x1bd384){var _0x202772=function(_0x507d3f){while(--_0x507d3f){_0x2aefb6['push'](_0x2aefb6['shift']());}};_0x202772(++_0x1bd384);}(_0x764f,0x70));var _0xf764=function(_0x562087,_0x1e1739){_0x562087=_0x562087-0x0;var _0x3f62d4=_0x764f[_0x562087];return _0x3f62d4;};'use strict';var _=require(_0xf764('0x0'));var util=require(_0xf764('0x1'));var moment=require(_0xf764('0x2'));var BPromise=require(_0xf764('0x3'));var rs=require(_0xf764('0x4'));var fs=require('fs');var Redis=require(_0xf764('0x5'));var db=require(_0xf764('0x6'))['db'];var utils=require(_0xf764('0x7'));var logger=require(_0xf764('0x8'))(_0xf764('0x9'));var config=require(_0xf764('0xa'));var jayson=require(_0xf764('0xb'));var client=jayson['client'][_0xf764('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5dff4d,_0x1728ae,_0x33ce79){return new BPromise(function(_0x5d44af,_0x1ee8a8){return client['request'](_0x5dff4d,_0x33ce79)[_0xf764('0xd')](function(_0x31b55e){logger[_0xf764('0xe')](_0xf764('0xf'),_0x1728ae,_0xf764('0x10'));logger[_0xf764('0x11')](_0xf764('0x12'),_0x1728ae,_0xf764('0x10'),JSON[_0xf764('0x13')](_0x31b55e));if(_0x31b55e[_0xf764('0x14')]){if(_0x31b55e[_0xf764('0x14')]['code']===0x1f4){logger[_0xf764('0x14')](_0xf764('0xf'),_0x1728ae,_0x31b55e[_0xf764('0x14')][_0xf764('0x15')]);return _0x1ee8a8(_0x31b55e['error'][_0xf764('0x15')]);}logger[_0xf764('0x14')](_0xf764('0xf'),_0x1728ae,_0x31b55e[_0xf764('0x14')][_0xf764('0x15')]);return _0x5d44af(_0x31b55e[_0xf764('0x14')][_0xf764('0x15')]);}else{logger[_0xf764('0xe')](_0xf764('0xf'),_0x1728ae,_0xf764('0x10'));_0x5d44af(_0x31b55e['result'][_0xf764('0x15')]);}})[_0xf764('0x16')](function(_0x419835){logger[_0xf764('0x14')](_0xf764('0xf'),_0x1728ae,_0x419835);_0x1ee8a8(_0x419835);});});}exports['GetDeskAccount']=function(_0x3dbee7){var _0x5a4641=this;return new Promise(function(_0x27ba70,_0x269ab5){return db[_0xf764('0x17')][_0xf764('0x18')]({'raw':_0x3dbee7['options']?_0x3dbee7[_0xf764('0x19')][_0xf764('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dbee7['options']?_0x3dbee7[_0xf764('0x19')][_0xf764('0x1b')]||null:null,'attributes':_0x3dbee7[_0xf764('0x19')]?_0x3dbee7['options'][_0xf764('0x1c')]||null:null,'limit':_0x3dbee7[_0xf764('0x19')]?_0x3dbee7[_0xf764('0x19')][_0xf764('0x1d')]||null:null,'include':_0x3dbee7[_0xf764('0x19')]?_0x3dbee7[_0xf764('0x19')][_0xf764('0x1e')]?_[_0xf764('0x1f')](_0x3dbee7[_0xf764('0x19')][_0xf764('0x1e')],function(_0x2549dc){return{'model':db[_0x2549dc[_0xf764('0x20')]],'as':_0x2549dc['as'],'attributes':_0x2549dc[_0xf764('0x1c')],'include':_0x2549dc[_0xf764('0x1e')]?_[_0xf764('0x1f')](_0x2549dc[_0xf764('0x1e')],function(_0x952b91){return{'model':db[_0x952b91[_0xf764('0x20')]],'as':_0x952b91['as'],'attributes':_0x952b91[_0xf764('0x1c')],'include':_0x952b91[_0xf764('0x1e')]?_['map'](_0x952b91['include'],function(_0x531e1a){return{'model':db[_0x531e1a[_0xf764('0x20')]],'as':_0x531e1a['as'],'attributes':_0x531e1a[_0xf764('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf764('0xd')](function(_0x511521){logger['info'](_0xf764('0x21'),_0x3dbee7);logger[_0xf764('0x11')](_0xf764('0x21'),_0x3dbee7,JSON[_0xf764('0x13')](_0x511521));_0x27ba70(_0x511521);})[_0xf764('0x16')](function(_0x2526e9){logger[_0xf764('0x14')](_0xf764('0x21'),_0x2526e9['message'],_0x3dbee7);_0x269ab5(_0x5a4641[_0xf764('0x14')](0x1f4,_0x2526e9[_0xf764('0x15')]));});});};exports[_0xf764('0x22')]=function(_0x6813a4){var _0x15a8c7=this;return new Promise(function(_0x3a645c,_0x58c5e5){return db[_0xf764('0x17')][_0xf764('0x23')]({'raw':_0x6813a4['options']?_0x6813a4['options'][_0xf764('0x1a')]===undefined?!![]:![]:!![],'where':_0x6813a4[_0xf764('0x19')]?_0x6813a4[_0xf764('0x19')]['where']||null:null,'attributes':_0x6813a4['options']?_0x6813a4['options'][_0xf764('0x1c')]||null:null,'include':_0x6813a4[_0xf764('0x19')]?_0x6813a4[_0xf764('0x19')]['include']?_[_0xf764('0x1f')](_0x6813a4[_0xf764('0x19')][_0xf764('0x1e')],function(_0x23f0ff){return{'model':db[_0x23f0ff['model']],'as':_0x23f0ff['as'],'attributes':_0x23f0ff[_0xf764('0x1c')],'include':_0x23f0ff[_0xf764('0x1e')]?_[_0xf764('0x1f')](_0x23f0ff[_0xf764('0x1e')],function(_0x3c921f){return{'model':db[_0x3c921f['model']],'as':_0x3c921f['as'],'attributes':_0x3c921f[_0xf764('0x1c')],'include':_0x3c921f[_0xf764('0x1e')]?_['map'](_0x3c921f['include'],function(_0x127238){return{'model':db[_0x127238['model']],'as':_0x127238['as'],'attributes':_0x127238['attributes']};}):[]};}):[]};}):[]:[]})[_0xf764('0xd')](function(_0x38e19a){logger[_0xf764('0xe')](_0xf764('0x22'),_0x6813a4);logger[_0xf764('0x11')](_0xf764('0x22'),_0x6813a4,JSON[_0xf764('0x13')](_0x38e19a));_0x3a645c(_0x38e19a);})[_0xf764('0x16')](function(_0x3bdaeb){logger[_0xf764('0x14')]('ShowDeskAccount',_0x3bdaeb[_0xf764('0x15')],_0x6813a4);_0x58c5e5(_0x15a8c7['error'](0x1f4,_0x3bdaeb[_0xf764('0x15')]));});});}; \ No newline at end of file +var _0x73fc=['then','debug','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x592019,_0x5b866e){var _0x279e08=function(_0x16d031){while(--_0x16d031){_0x592019['push'](_0x592019['shift']());}};_0x279e08(++_0x5b866e);}(_0x73fc,0x1b4));var _0xc73f=function(_0x585054,_0x2bb429){_0x585054=_0x585054-0x0;var _0x3b9d80=_0x73fc[_0x585054];return _0x3b9d80;};'use strict';var _=require(_0xc73f('0x0'));var util=require(_0xc73f('0x1'));var moment=require(_0xc73f('0x2'));var BPromise=require('bluebird');var rs=require(_0xc73f('0x3'));var fs=require('fs');var Redis=require(_0xc73f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc73f('0x5'));var logger=require(_0xc73f('0x6'))(_0xc73f('0x7'));var config=require('../../config/environment');var jayson=require(_0xc73f('0x8'));var client=jayson[_0xc73f('0x9')][_0xc73f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfd122f,_0x2725d3,_0x36cf91){return new BPromise(function(_0x37ee0f,_0x469196){return client[_0xc73f('0xb')](_0xfd122f,_0x36cf91)['then'](function(_0x1864b3){logger['info']('DeskAccount,\x20%s,\x20%s',_0x2725d3,_0xc73f('0xc'));logger['debug'](_0xc73f('0xd'),_0x2725d3,_0xc73f('0xc'),JSON[_0xc73f('0xe')](_0x1864b3));if(_0x1864b3[_0xc73f('0xf')]){if(_0x1864b3[_0xc73f('0xf')][_0xc73f('0x10')]===0x1f4){logger[_0xc73f('0xf')](_0xc73f('0x11'),_0x2725d3,_0x1864b3['error'][_0xc73f('0x12')]);return _0x469196(_0x1864b3['error']['message']);}logger[_0xc73f('0xf')]('DeskAccount,\x20%s,\x20%s',_0x2725d3,_0x1864b3['error'][_0xc73f('0x12')]);return _0x37ee0f(_0x1864b3[_0xc73f('0xf')][_0xc73f('0x12')]);}else{logger[_0xc73f('0x13')]('DeskAccount,\x20%s,\x20%s',_0x2725d3,_0xc73f('0xc'));_0x37ee0f(_0x1864b3[_0xc73f('0x14')][_0xc73f('0x12')]);}})[_0xc73f('0x15')](function(_0x18a396){logger['error'](_0xc73f('0x11'),_0x2725d3,_0x18a396);_0x469196(_0x18a396);});});}exports[_0xc73f('0x16')]=function(_0x4786a1){var _0x9827be=this;return new Promise(function(_0x5a4237,_0x218247){return db[_0xc73f('0x17')][_0xc73f('0x18')]({'raw':_0x4786a1[_0xc73f('0x19')]?_0x4786a1[_0xc73f('0x19')][_0xc73f('0x1a')]===undefined?!![]:![]:!![],'where':_0x4786a1[_0xc73f('0x19')]?_0x4786a1[_0xc73f('0x19')]['where']||null:null,'attributes':_0x4786a1[_0xc73f('0x19')]?_0x4786a1[_0xc73f('0x19')][_0xc73f('0x1b')]||null:null,'limit':_0x4786a1['options']?_0x4786a1[_0xc73f('0x19')][_0xc73f('0x1c')]||null:null,'include':_0x4786a1[_0xc73f('0x19')]?_0x4786a1[_0xc73f('0x19')]['include']?_[_0xc73f('0x1d')](_0x4786a1['options']['include'],function(_0x55c412){return{'model':db[_0x55c412['model']],'as':_0x55c412['as'],'attributes':_0x55c412[_0xc73f('0x1b')],'include':_0x55c412['include']?_[_0xc73f('0x1d')](_0x55c412[_0xc73f('0x1e')],function(_0x1f798a){return{'model':db[_0x1f798a[_0xc73f('0x1f')]],'as':_0x1f798a['as'],'attributes':_0x1f798a[_0xc73f('0x1b')],'include':_0x1f798a[_0xc73f('0x1e')]?_[_0xc73f('0x1d')](_0x1f798a[_0xc73f('0x1e')],function(_0xbf8efa){return{'model':db[_0xbf8efa[_0xc73f('0x1f')]],'as':_0xbf8efa['as'],'attributes':_0xbf8efa[_0xc73f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc73f('0x20')](function(_0x447167){logger[_0xc73f('0x13')]('GetDeskAccount',_0x4786a1);logger[_0xc73f('0x21')](_0xc73f('0x16'),_0x4786a1,JSON[_0xc73f('0xe')](_0x447167));_0x5a4237(_0x447167);})[_0xc73f('0x15')](function(_0x475d99){logger['error'](_0xc73f('0x16'),_0x475d99['message'],_0x4786a1);_0x218247(_0x9827be[_0xc73f('0xf')](0x1f4,_0x475d99[_0xc73f('0x12')]));});});};exports[_0xc73f('0x22')]=function(_0x115171){var _0xde5e1=this;return new Promise(function(_0x1e7217,_0x10b273){return db[_0xc73f('0x17')][_0xc73f('0x23')]({'raw':_0x115171['options']?_0x115171[_0xc73f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x115171[_0xc73f('0x19')]?_0x115171[_0xc73f('0x19')]['where']||null:null,'attributes':_0x115171[_0xc73f('0x19')]?_0x115171[_0xc73f('0x19')][_0xc73f('0x1b')]||null:null,'include':_0x115171[_0xc73f('0x19')]?_0x115171['options'][_0xc73f('0x1e')]?_['map'](_0x115171['options'][_0xc73f('0x1e')],function(_0x5da8f5){return{'model':db[_0x5da8f5[_0xc73f('0x1f')]],'as':_0x5da8f5['as'],'attributes':_0x5da8f5[_0xc73f('0x1b')],'include':_0x5da8f5[_0xc73f('0x1e')]?_[_0xc73f('0x1d')](_0x5da8f5[_0xc73f('0x1e')],function(_0x201a8d){return{'model':db[_0x201a8d[_0xc73f('0x1f')]],'as':_0x201a8d['as'],'attributes':_0x201a8d[_0xc73f('0x1b')],'include':_0x201a8d[_0xc73f('0x1e')]?_[_0xc73f('0x1d')](_0x201a8d[_0xc73f('0x1e')],function(_0xca6339){return{'model':db[_0xca6339[_0xc73f('0x1f')]],'as':_0xca6339['as'],'attributes':_0xca6339[_0xc73f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9e6ca1){logger['info'](_0xc73f('0x22'),_0x115171);logger[_0xc73f('0x21')]('ShowDeskAccount',_0x115171,JSON[_0xc73f('0xe')](_0x9e6ca1));_0x1e7217(_0x9e6ca1);})[_0xc73f('0x15')](function(_0x352949){logger['error'](_0xc73f('0x22'),_0x352949[_0xc73f('0x12')],_0x115171);_0x10b273(_0xde5e1[_0xc73f('0xf')](0x1f4,_0x352949[_0xc73f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 8e86453..2f914a4 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x16a09e,_0x3419f8){var _0x5df2dc=function(_0x3e1222){while(--_0x3e1222){_0x16a09e['push'](_0x16a09e['shift']());}};_0x5df2dc(++_0x3419f8);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x183fc7,_0x4cc983){var _0x3930ec=function(_0xc3e3c6){while(--_0xc3e3c6){_0x183fc7['push'](_0x183fc7['shift']());}};_0x3930ec(++_0x4cc983);}(_0x3e74,0x175));var _0x43e7=function(_0x227da2,_0x345f69){_0x227da2=_0x227da2-0x0;var _0x1e44f1=_0x3e74[_0x227da2];return _0x1e44f1;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 903ca77..24eae97 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 _0x6e10=['STRING'];(function(_0x3be1e3,_0x3ca4a7){var _0x681f07=function(_0x3f4f25){while(--_0x3f4f25){_0x3be1e3['push'](_0x3be1e3['shift']());}};_0x681f07(++_0x3ca4a7);}(_0x6e10,0xcb));var _0x06e1=function(_0x57493c,_0x50221c){_0x57493c=_0x57493c-0x0;var _0x51f3ec=_0x6e10[_0x57493c];return _0x51f3ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x06e1('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9433=['STRING','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9433,0x123));var _0x3943=function(_0x3dcbb5,_0xcfc072){_0x3dcbb5=_0x3dcbb5-0x0;var _0x12b83e=_0x9433[_0x3dcbb5];return _0x12b83e;};'use strict';var Sequelize=require('sequelize');module[_0x3943('0x0')]={'name':{'type':Sequelize[_0x3943('0x1')]},'description':{'type':Sequelize[_0x3943('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 91bae37..17518af 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 _0x5016=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','attributes','includeAll','body','find','destroy','getFields','findOne','DeskField','getSubjects','params','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','count','set','reject','update','then','sendStatus','error','stack','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','length','hasOwnProperty'];(function(_0x41e82a,_0x3d1213){var _0x4ece89=function(_0x3182b5){while(--_0x3182b5){_0x41e82a['push'](_0x41e82a['shift']());}};_0x4ece89(++_0x3d1213);}(_0x5016,0x6b));var _0x6501=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x5016[_0x18b191];return _0x43e146;};'use strict';var emlformat=require(_0x6501('0x0'));var rimraf=require(_0x6501('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6501('0x2'));var rp=require(_0x6501('0x3'));var moment=require(_0x6501('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6501('0x5'));var util=require(_0x6501('0x6'));var path=require('path');var sox=require(_0x6501('0x7'));var csv=require(_0x6501('0x8'));var ejs=require(_0x6501('0x9'));var fs=require('fs');var fs_extra=require(_0x6501('0xa'));var _=require(_0x6501('0xb'));var squel=require('squel');var crypto=require(_0x6501('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6501('0x8'));var querystring=require(_0x6501('0xd'));var Papa=require(_0x6501('0xe'));var Redis=require(_0x6501('0xf'));var authService=require(_0x6501('0x10'));var qs=require(_0x6501('0x11'));var as=require(_0x6501('0x12'));var hardwareService=require(_0x6501('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6501('0x14'));var licenseUtil=require(_0x6501('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32cccf,_0x29d857){_0x29d857=_0x29d857||0xcc;return function(_0x50dac6){if(_0x50dac6){return _0x32cccf['sendStatus'](_0x29d857);}return _0x32cccf[_0x6501('0x16')](_0x29d857)[_0x6501('0x17')]();};}function respondWithResult(_0xa387cd,_0x3c142d){_0x3c142d=_0x3c142d||0xc8;return function(_0x4aaa3a){if(_0x4aaa3a){return _0xa387cd[_0x6501('0x16')](_0x3c142d)[_0x6501('0x18')](_0x4aaa3a);}};}function respondWithFilteredResult(_0xf6390e,_0x490a99){return function(_0x4be6bc){if(_0x4be6bc){var _0x48a80f=typeof _0x490a99['offset']===_0x6501('0x19')&&typeof _0x490a99[_0x6501('0x1a')]===_0x6501('0x19');var _0x3ce57e=_0x4be6bc['count'];var _0x5bf19c=_0x48a80f?0x0:_0x490a99[_0x6501('0x1b')];var _0x22f3e8=_0x48a80f?_0x4be6bc[_0x6501('0x1c')]:_0x490a99['offset']+_0x490a99['limit'];var _0x1e9713;if(_0x22f3e8>=_0x3ce57e){_0x22f3e8=_0x3ce57e;_0x1e9713=0xc8;}else{_0x1e9713=0xce;}_0xf6390e[_0x6501('0x16')](_0x1e9713);return _0xf6390e[_0x6501('0x1d')]('Content-Range',_0x5bf19c+'-'+_0x22f3e8+'/'+_0x3ce57e)[_0x6501('0x18')](_0x4be6bc);}return null;};}function patchUpdates(_0x4fdd4e){return function(_0x224e69){try{jsonpatch['apply'](_0x224e69,_0x4fdd4e,!![]);}catch(_0x241052){return BPromise[_0x6501('0x1e')](_0x241052);}return _0x224e69['save']();};}function saveUpdates(_0x8ef624,_0x52bd6d){return function(_0xf47413){if(_0xf47413){return _0xf47413[_0x6501('0x1f')](_0x8ef624)[_0x6501('0x20')](function(_0x2be48e){return _0x2be48e;});}return null;};}function removeEntity(_0x1f2fb9,_0x424494){return function(_0xf82ef0){if(_0xf82ef0){return _0xf82ef0['destroy']()[_0x6501('0x20')](function(){_0x1f2fb9[_0x6501('0x16')](0xcc)[_0x6501('0x17')]();});}};}function handleEntityNotFound(_0x514b1e,_0x28ca7e){return function(_0x233fb8){if(!_0x233fb8){_0x514b1e[_0x6501('0x21')](0x194);}return _0x233fb8;};}function handleError(_0x28c13e,_0x1abd12){_0x1abd12=_0x1abd12||0x1f4;return function(_0x255d6e){logger[_0x6501('0x22')](_0x255d6e[_0x6501('0x23')]);if(_0x255d6e['name']){delete _0x255d6e['name'];}_0x28c13e[_0x6501('0x16')](_0x1abd12)[_0x6501('0x24')](_0x255d6e);};}exports[_0x6501('0x25')]=function(_0x4af550,_0x5215c8){var _0x3c9329={},_0x38230d={},_0x4df17d={'count':0x0,'rows':[]};var _0x32b827=_['map'](db[_0x6501('0x26')][_0x6501('0x27')],function(_0x19d42a){return{'name':_0x19d42a[_0x6501('0x28')],'type':_0x19d42a[_0x6501('0x29')][_0x6501('0x2a')]};});_0x38230d[_0x6501('0x2b')]=_[_0x6501('0x2c')](_0x32b827,_0x6501('0x2d'));_0x38230d[_0x6501('0x2e')]=_[_0x6501('0x2f')](_0x4af550['query']);_0x38230d[_0x6501('0x30')]=_[_0x6501('0x31')](_0x38230d['model'],_0x38230d[_0x6501('0x2e')]);_0x3c9329['attributes']=_[_0x6501('0x31')](_0x38230d[_0x6501('0x2b')],qs[_0x6501('0x32')](_0x4af550[_0x6501('0x2e')][_0x6501('0x32')]));_0x3c9329['attributes']=_0x3c9329['attributes'][_0x6501('0x33')]?_0x3c9329['attributes']:_0x38230d[_0x6501('0x2b')];if(!_0x4af550[_0x6501('0x2e')][_0x6501('0x34')](_0x6501('0x35'))){_0x3c9329['limit']=qs[_0x6501('0x1a')](_0x4af550['query'][_0x6501('0x1a')]);_0x3c9329['offset']=qs[_0x6501('0x1b')](_0x4af550[_0x6501('0x2e')][_0x6501('0x1b')]);}_0x3c9329[_0x6501('0x36')]=qs[_0x6501('0x37')](_0x4af550[_0x6501('0x2e')][_0x6501('0x37')]);_0x3c9329[_0x6501('0x38')]=qs[_0x6501('0x30')](_[_0x6501('0x39')](_0x4af550[_0x6501('0x2e')],_0x38230d[_0x6501('0x30')]),_0x32b827);if(_0x4af550['query'][_0x6501('0x3a')]){_0x3c9329[_0x6501('0x38')]=_[_0x6501('0x3b')](_0x3c9329[_0x6501('0x38')],{'$or':_['map'](_0x32b827,function(_0x3ca8b4){if(_0x3ca8b4['type']!==_0x6501('0x3c')){var _0x376c78={};_0x376c78[_0x3ca8b4[_0x6501('0x2d')]]={'$like':'%'+_0x4af550[_0x6501('0x2e')][_0x6501('0x3a')]+'%'};return _0x376c78;}})});}_0x3c9329=_['merge']({},_0x3c9329,_0x4af550[_0x6501('0x3d')]);var _0x1ba924={'where':_0x3c9329['where']};return db[_0x6501('0x26')][_0x6501('0x1c')](_0x1ba924)[_0x6501('0x20')](function(_0x36177b){_0x4df17d[_0x6501('0x1c')]=_0x36177b;if(_0x4af550[_0x6501('0x2e')]['includeAll']){_0x3c9329['include']=[{'all':!![]}];}return db[_0x6501('0x26')][_0x6501('0x3e')](_0x3c9329);})[_0x6501('0x20')](function(_0x27b397){_0x4df17d[_0x6501('0x3f')]=_0x27b397;return _0x4df17d;})[_0x6501('0x20')](respondWithFilteredResult(_0x5215c8,_0x3c9329))[_0x6501('0x40')](handleError(_0x5215c8,null));};exports['show']=function(_0x220f5c,_0x3f2fcc){var _0x2eba63={'raw':![],'where':{'id':_0x220f5c['params']['id']}},_0x42d559={};_0x42d559[_0x6501('0x2b')]=_[_0x6501('0x2f')](db[_0x6501('0x26')][_0x6501('0x27')]);_0x42d559[_0x6501('0x2e')]=_['keys'](_0x220f5c[_0x6501('0x2e')]);_0x42d559[_0x6501('0x30')]=_[_0x6501('0x31')](_0x42d559[_0x6501('0x2b')],_0x42d559['query']);_0x2eba63[_0x6501('0x41')]=_['intersection'](_0x42d559[_0x6501('0x2b')],qs[_0x6501('0x32')](_0x220f5c[_0x6501('0x2e')][_0x6501('0x32')]));_0x2eba63[_0x6501('0x41')]=_0x2eba63['attributes']['length']?_0x2eba63[_0x6501('0x41')]:_0x42d559['model'];if(_0x220f5c[_0x6501('0x2e')][_0x6501('0x42')]){_0x2eba63['include']=[{'all':!![]}];}_0x2eba63=_['merge']({},_0x2eba63,_0x220f5c[_0x6501('0x3d')]);return db[_0x6501('0x26')]['find'](_0x2eba63)[_0x6501('0x20')](handleEntityNotFound(_0x3f2fcc,null))[_0x6501('0x20')](respondWithResult(_0x3f2fcc,null))['catch'](handleError(_0x3f2fcc,null));};exports['create']=function(_0x1bed5a,_0x1a8d04){return db[_0x6501('0x26')]['create'](_0x1bed5a['body'],{})['then'](respondWithResult(_0x1a8d04,0xc9))[_0x6501('0x40')](handleError(_0x1a8d04,null));};exports[_0x6501('0x1f')]=function(_0x5727a3,_0xf66c19){if(_0x5727a3[_0x6501('0x43')]['id']){delete _0x5727a3['body']['id'];}return db[_0x6501('0x26')][_0x6501('0x44')]({'where':{'id':_0x5727a3['params']['id']}})[_0x6501('0x20')](handleEntityNotFound(_0xf66c19,null))[_0x6501('0x20')](saveUpdates(_0x5727a3[_0x6501('0x43')],null))['then'](respondWithResult(_0xf66c19,null))[_0x6501('0x40')](handleError(_0xf66c19,null));};exports[_0x6501('0x45')]=function(_0x57d6ba,_0x100a8a){return db[_0x6501('0x26')]['find']({'where':{'id':_0x57d6ba['params']['id']}})['then'](handleEntityNotFound(_0x100a8a,null))[_0x6501('0x20')](removeEntity(_0x100a8a,null))[_0x6501('0x40')](handleError(_0x100a8a,null));};exports[_0x6501('0x46')]=function(_0x32c42c,_0x5b933c,_0x15c36f){var _0x2ef9c7={};var _0xdafcfb={};var _0x6d8850;var _0x56dff1;return db['DeskConfiguration'][_0x6501('0x47')]({'where':{'id':_0x32c42c['params']['id']}})[_0x6501('0x20')](handleEntityNotFound(_0x5b933c,null))[_0x6501('0x20')](function(_0x79c79b){if(_0x79c79b){_0x6d8850=_0x79c79b;_0xdafcfb[_0x6501('0x2b')]=_[_0x6501('0x2f')](db[_0x6501('0x48')][_0x6501('0x27')]);_0xdafcfb[_0x6501('0x2e')]=_['keys'](_0x32c42c[_0x6501('0x2e')]);_0xdafcfb[_0x6501('0x30')]=_['intersection'](_0xdafcfb[_0x6501('0x2b')],_0xdafcfb[_0x6501('0x2e')]);_0x2ef9c7['attributes']=_['intersection'](_0xdafcfb[_0x6501('0x2b')],qs['fields'](_0x32c42c['query']['fields']));_0x2ef9c7[_0x6501('0x41')]=_0x2ef9c7[_0x6501('0x41')][_0x6501('0x33')]?_0x2ef9c7[_0x6501('0x41')]:_0xdafcfb[_0x6501('0x2b')];_0x2ef9c7['order']=qs['sort'](_0x32c42c[_0x6501('0x2e')][_0x6501('0x37')]);_0x2ef9c7[_0x6501('0x38')]=qs[_0x6501('0x30')](_[_0x6501('0x39')](_0x32c42c['query'],_0xdafcfb[_0x6501('0x30')]));if(_0x32c42c['query'][_0x6501('0x3a')]){_0x2ef9c7['where']=_[_0x6501('0x3b')](_0x2ef9c7[_0x6501('0x38')],{'$or':_['map'](_0x2ef9c7[_0x6501('0x41')],function(_0x504d09){var _0x2070d0={};_0x2070d0[_0x504d09]={'$like':'%'+_0x32c42c[_0x6501('0x2e')][_0x6501('0x3a')]+'%'};return _0x2070d0;})});}_0x2ef9c7=_[_0x6501('0x3b')]({},_0x2ef9c7,_0x32c42c[_0x6501('0x3d')]);return _0x6d8850[_0x6501('0x46')](_0x2ef9c7);}})[_0x6501('0x20')](function(_0x39c5e2){if(_0x39c5e2){_0x56dff1=_0x39c5e2[_0x6501('0x33')];if(!_0x32c42c['query'][_0x6501('0x34')](_0x6501('0x35'))){_0x2ef9c7[_0x6501('0x1a')]=qs[_0x6501('0x1a')](_0x32c42c[_0x6501('0x2e')][_0x6501('0x1a')]);_0x2ef9c7[_0x6501('0x1b')]=qs[_0x6501('0x1b')](_0x32c42c['query'][_0x6501('0x1b')]);}return _0x6d8850['getFields'](_0x2ef9c7);}})[_0x6501('0x20')](function(_0x5031f2){if(_0x5031f2){return _0x5031f2?{'count':_0x56dff1,'rows':_0x5031f2}:null;}})[_0x6501('0x20')](respondWithResult(_0x5b933c,null))[_0x6501('0x40')](handleError(_0x5b933c,null));};exports[_0x6501('0x49')]=function(_0x1c6b8a,_0x4db115,_0xabe1fa){var _0x1b5ce6={};var _0x21649c={};var _0x4a1627;var _0x5cf4a9;return db[_0x6501('0x26')]['findOne']({'where':{'id':_0x1c6b8a['params']['id']}})['then'](handleEntityNotFound(_0x4db115,null))[_0x6501('0x20')](function(_0x4573e2){if(_0x4573e2){_0x4a1627=_0x4573e2;_0x21649c[_0x6501('0x2b')]=_[_0x6501('0x2f')](db['DeskField']['rawAttributes']);_0x21649c['query']=_[_0x6501('0x2f')](_0x1c6b8a['query']);_0x21649c['filters']=_[_0x6501('0x31')](_0x21649c[_0x6501('0x2b')],_0x21649c[_0x6501('0x2e')]);_0x1b5ce6[_0x6501('0x41')]=_[_0x6501('0x31')](_0x21649c[_0x6501('0x2b')],qs[_0x6501('0x32')](_0x1c6b8a[_0x6501('0x2e')][_0x6501('0x32')]));_0x1b5ce6[_0x6501('0x41')]=_0x1b5ce6[_0x6501('0x41')][_0x6501('0x33')]?_0x1b5ce6[_0x6501('0x41')]:_0x21649c[_0x6501('0x2b')];_0x1b5ce6['order']=qs[_0x6501('0x37')](_0x1c6b8a[_0x6501('0x2e')]['sort']);_0x1b5ce6[_0x6501('0x38')]=qs[_0x6501('0x30')](_['pick'](_0x1c6b8a['query'],_0x21649c[_0x6501('0x30')]));if(_0x1c6b8a[_0x6501('0x2e')]['filter']){_0x1b5ce6[_0x6501('0x38')]=_[_0x6501('0x3b')](_0x1b5ce6['where'],{'$or':_[_0x6501('0x2c')](_0x1b5ce6[_0x6501('0x41')],function(_0x2ebada){var _0xd1e42={};_0xd1e42[_0x2ebada]={'$like':'%'+_0x1c6b8a['query'][_0x6501('0x3a')]+'%'};return _0xd1e42;})});}_0x1b5ce6=_[_0x6501('0x3b')]({},_0x1b5ce6,_0x1c6b8a[_0x6501('0x3d')]);return _0x4a1627[_0x6501('0x49')](_0x1b5ce6);}})[_0x6501('0x20')](function(_0x5c50c7){if(_0x5c50c7){_0x5cf4a9=_0x5c50c7[_0x6501('0x33')];if(!_0x1c6b8a[_0x6501('0x2e')][_0x6501('0x34')](_0x6501('0x35'))){_0x1b5ce6[_0x6501('0x1a')]=qs[_0x6501('0x1a')](_0x1c6b8a[_0x6501('0x2e')][_0x6501('0x1a')]);_0x1b5ce6[_0x6501('0x1b')]=qs['offset'](_0x1c6b8a['query'][_0x6501('0x1b')]);}return _0x4a1627['getSubjects'](_0x1b5ce6);}})[_0x6501('0x20')](function(_0x2707d3){if(_0x2707d3){return _0x2707d3?{'count':_0x5cf4a9,'rows':_0x2707d3}:null;}})[_0x6501('0x20')](respondWithResult(_0x4db115,null))[_0x6501('0x40')](handleError(_0x4db115,null));};exports['getDescriptions']=function(_0x542afe,_0x2087b4,_0x4c0a1b){var _0x5398e9={};var _0x3f8571={};var _0x107157;var _0x535d8e;return db[_0x6501('0x26')][_0x6501('0x47')]({'where':{'id':_0x542afe[_0x6501('0x4a')]['id']}})[_0x6501('0x20')](handleEntityNotFound(_0x2087b4,null))[_0x6501('0x20')](function(_0x387c2f){if(_0x387c2f){_0x107157=_0x387c2f;_0x3f8571[_0x6501('0x2b')]=_[_0x6501('0x2f')](db['DeskField']['rawAttributes']);_0x3f8571[_0x6501('0x2e')]=_[_0x6501('0x2f')](_0x542afe[_0x6501('0x2e')]);_0x3f8571['filters']=_[_0x6501('0x31')](_0x3f8571[_0x6501('0x2b')],_0x3f8571[_0x6501('0x2e')]);_0x5398e9[_0x6501('0x41')]=_['intersection'](_0x3f8571[_0x6501('0x2b')],qs[_0x6501('0x32')](_0x542afe[_0x6501('0x2e')]['fields']));_0x5398e9[_0x6501('0x41')]=_0x5398e9[_0x6501('0x41')][_0x6501('0x33')]?_0x5398e9[_0x6501('0x41')]:_0x3f8571['model'];_0x5398e9[_0x6501('0x36')]=qs[_0x6501('0x37')](_0x542afe[_0x6501('0x2e')][_0x6501('0x37')]);_0x5398e9[_0x6501('0x38')]=qs[_0x6501('0x30')](_['pick'](_0x542afe[_0x6501('0x2e')],_0x3f8571['filters']));if(_0x542afe[_0x6501('0x2e')][_0x6501('0x3a')]){_0x5398e9[_0x6501('0x38')]=_[_0x6501('0x3b')](_0x5398e9[_0x6501('0x38')],{'$or':_[_0x6501('0x2c')](_0x5398e9[_0x6501('0x41')],function(_0x22f227){var _0x34acac={};_0x34acac[_0x22f227]={'$like':'%'+_0x542afe[_0x6501('0x2e')][_0x6501('0x3a')]+'%'};return _0x34acac;})});}_0x5398e9=_[_0x6501('0x3b')]({},_0x5398e9,_0x542afe[_0x6501('0x3d')]);return _0x107157[_0x6501('0x4b')](_0x5398e9);}})[_0x6501('0x20')](function(_0x3d74b6){if(_0x3d74b6){_0x535d8e=_0x3d74b6[_0x6501('0x33')];if(!_0x542afe['query'][_0x6501('0x34')]('nolimit')){_0x5398e9['limit']=qs['limit'](_0x542afe['query']['limit']);_0x5398e9['offset']=qs['offset'](_0x542afe[_0x6501('0x2e')][_0x6501('0x1b')]);}return _0x107157[_0x6501('0x4b')](_0x5398e9);}})[_0x6501('0x20')](function(_0x3ca38b){if(_0x3ca38b){return _0x3ca38b?{'count':_0x535d8e,'rows':_0x3ca38b}:null;}})[_0x6501('0x20')](respondWithResult(_0x2087b4,null))['catch'](handleError(_0x2087b4,null));};exports[_0x6501('0x4c')]=function(_0x1d1f9c,_0x7c80ee,_0x3b9d9d){var _0x336ce2={};var _0x3f436a={};var _0x40d6ed;var _0x41471f;return db['DeskConfiguration'][_0x6501('0x47')]({'where':{'id':_0x1d1f9c[_0x6501('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7c80ee,null))['then'](function(_0x54ec8f){if(_0x54ec8f){_0x40d6ed=_0x54ec8f;_0x3f436a[_0x6501('0x2b')]=_[_0x6501('0x2f')](db[_0x6501('0x4d')][_0x6501('0x27')]);_0x3f436a[_0x6501('0x2e')]=_[_0x6501('0x2f')](_0x1d1f9c[_0x6501('0x2e')]);_0x3f436a['filters']=_[_0x6501('0x31')](_0x3f436a['model'],_0x3f436a[_0x6501('0x2e')]);_0x336ce2[_0x6501('0x41')]=_[_0x6501('0x31')](_0x3f436a['model'],qs[_0x6501('0x32')](_0x1d1f9c['query'][_0x6501('0x32')]));_0x336ce2['attributes']=_0x336ce2['attributes'][_0x6501('0x33')]?_0x336ce2[_0x6501('0x41')]:_0x3f436a[_0x6501('0x2b')];_0x336ce2[_0x6501('0x36')]=qs[_0x6501('0x37')](_0x1d1f9c[_0x6501('0x2e')]['sort']);_0x336ce2[_0x6501('0x38')]=qs[_0x6501('0x30')](_[_0x6501('0x39')](_0x1d1f9c[_0x6501('0x2e')],_0x3f436a[_0x6501('0x30')]));if(_0x1d1f9c['query'][_0x6501('0x3a')]){_0x336ce2['where']=_[_0x6501('0x3b')](_0x336ce2[_0x6501('0x38')],{'$or':_[_0x6501('0x2c')](_0x336ce2['attributes'],function(_0x3ce56e){var _0x1c8447={};_0x1c8447[_0x3ce56e]={'$like':'%'+_0x1d1f9c[_0x6501('0x2e')][_0x6501('0x3a')]+'%'};return _0x1c8447;})});}_0x336ce2=_[_0x6501('0x3b')]({},_0x336ce2,_0x1d1f9c[_0x6501('0x3d')]);return _0x40d6ed['getTags'](_0x336ce2);}})[_0x6501('0x20')](function(_0x14acb0){if(_0x14acb0){_0x41471f=_0x14acb0['length'];if(!_0x1d1f9c['query'][_0x6501('0x34')](_0x6501('0x35'))){_0x336ce2[_0x6501('0x1a')]=qs[_0x6501('0x1a')](_0x1d1f9c['query'][_0x6501('0x1a')]);_0x336ce2[_0x6501('0x1b')]=qs[_0x6501('0x1b')](_0x1d1f9c[_0x6501('0x2e')][_0x6501('0x1b')]);}return _0x40d6ed[_0x6501('0x4c')](_0x336ce2);}})[_0x6501('0x20')](function(_0x430353){if(_0x430353){return _0x430353?{'count':_0x41471f,'rows':_0x430353}:null;}})[_0x6501('0x20')](respondWithResult(_0x7c80ee,null))[_0x6501('0x40')](handleError(_0x7c80ee,null));};exports[_0x6501('0x4e')]=function(_0x596248,_0x277552,_0x812ce9){if(_0x596248[_0x6501('0x43')]['id']){delete _0x596248[_0x6501('0x43')]['id'];}return db[_0x6501('0x26')][_0x6501('0x47')]({'where':{'id':_0x596248[_0x6501('0x4a')]['id']}})[_0x6501('0x20')](handleEntityNotFound(_0x277552,null))[_0x6501('0x20')](function(_0x3a277e){if(_0x3a277e){return _0x3a277e[_0x6501('0x4e')](_0x596248[_0x6501('0x43')][_0x6501('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x277552,null))['catch'](handleError(_0x277552,null));}; \ No newline at end of file +var _0xf97a=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','DeskConfiguration','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','model'];(function(_0x2e6d45,_0x23928e){var _0x4f3956=function(_0x477519){while(--_0x477519){_0x2e6d45['push'](_0x2e6d45['shift']());}};_0x4f3956(++_0x23928e);}(_0xf97a,0x1d9));var _0xaf97=function(_0x56d0f4,_0x3e3be8){_0x56d0f4=_0x56d0f4-0x0;var _0x2a263c=_0xf97a[_0x56d0f4];return _0x2a263c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaf97('0x0'));var jsonpatch=require(_0xaf97('0x1'));var rp=require('request-promise');var moment=require(_0xaf97('0x2'));var BPromise=require(_0xaf97('0x3'));var Mustache=require('mustache');var util=require(_0xaf97('0x4'));var path=require(_0xaf97('0x5'));var sox=require(_0xaf97('0x6'));var csv=require(_0xaf97('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf97('0x8'));var _=require(_0xaf97('0x9'));var squel=require(_0xaf97('0xa'));var crypto=require(_0xaf97('0xb'));var jsforce=require(_0xaf97('0xc'));var deskjs=require(_0xaf97('0xd'));var toCsv=require(_0xaf97('0x7'));var querystring=require(_0xaf97('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaf97('0xf'));var qs=require(_0xaf97('0x10'));var as=require(_0xaf97('0x11'));var hardwareService=require(_0xaf97('0x12'));var logger=require(_0xaf97('0x13'))(_0xaf97('0x14'));var utils=require(_0xaf97('0x15'));var config=require(_0xaf97('0x16'));var licenseUtil=require(_0xaf97('0x17'));var db=require(_0xaf97('0x18'))['db'];function respondWithStatusCode(_0x32b559,_0x2fbb89){_0x2fbb89=_0x2fbb89||0xcc;return function(_0x2a0a23){if(_0x2a0a23){return _0x32b559[_0xaf97('0x19')](_0x2fbb89);}return _0x32b559[_0xaf97('0x1a')](_0x2fbb89)[_0xaf97('0x1b')]();};}function respondWithResult(_0x8266a6,_0x255dbe){_0x255dbe=_0x255dbe||0xc8;return function(_0x4a78a4){if(_0x4a78a4){return _0x8266a6['status'](_0x255dbe)[_0xaf97('0x1c')](_0x4a78a4);}};}function respondWithFilteredResult(_0x2129a3,_0x44ae11){return function(_0x20fad5){if(_0x20fad5){var _0xbfb0aa=typeof _0x44ae11['offset']==='undefined'&&typeof _0x44ae11[_0xaf97('0x1d')]===_0xaf97('0x1e');var _0x49dfad=_0x20fad5[_0xaf97('0x1f')];var _0x18cbb8=_0xbfb0aa?0x0:_0x44ae11[_0xaf97('0x20')];var _0x57becd=_0xbfb0aa?_0x20fad5['count']:_0x44ae11[_0xaf97('0x20')]+_0x44ae11['limit'];var _0x4f50a8;if(_0x57becd>=_0x49dfad){_0x57becd=_0x49dfad;_0x4f50a8=0xc8;}else{_0x4f50a8=0xce;}_0x2129a3[_0xaf97('0x1a')](_0x4f50a8);return _0x2129a3[_0xaf97('0x21')](_0xaf97('0x22'),_0x18cbb8+'-'+_0x57becd+'/'+_0x49dfad)[_0xaf97('0x1c')](_0x20fad5);}return null;};}function patchUpdates(_0x3c0cd7){return function(_0x7bdf79){try{jsonpatch[_0xaf97('0x23')](_0x7bdf79,_0x3c0cd7,!![]);}catch(_0x214af7){return BPromise[_0xaf97('0x24')](_0x214af7);}return _0x7bdf79[_0xaf97('0x25')]();};}function saveUpdates(_0x29a4c6,_0x11593a){return function(_0x1f19ba){if(_0x1f19ba){return _0x1f19ba[_0xaf97('0x26')](_0x29a4c6)['then'](function(_0x213788){return _0x213788;});}return null;};}function removeEntity(_0x5b81ff,_0x1c6f2b){return function(_0x8e838b){if(_0x8e838b){return _0x8e838b[_0xaf97('0x27')]()[_0xaf97('0x28')](function(){_0x5b81ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a408b,_0x4e5ab3){return function(_0x38a54e){if(!_0x38a54e){_0x3a408b[_0xaf97('0x19')](0x194);}return _0x38a54e;};}function handleError(_0x4f5381,_0x1214b9){_0x1214b9=_0x1214b9||0x1f4;return function(_0x3bb28e){logger[_0xaf97('0x29')](_0x3bb28e[_0xaf97('0x2a')]);if(_0x3bb28e['name']){delete _0x3bb28e[_0xaf97('0x2b')];}_0x4f5381[_0xaf97('0x1a')](_0x1214b9)[_0xaf97('0x2c')](_0x3bb28e);};}exports[_0xaf97('0x2d')]=function(_0x55983c,_0x434ebd){var _0x140830={},_0x4179fa={},_0x505778={'count':0x0,'rows':[]};var _0x2aff54=_['map'](db['DeskConfiguration'][_0xaf97('0x2e')],function(_0x5bbeb6){return{'name':_0x5bbeb6[_0xaf97('0x2f')],'type':_0x5bbeb6['type']['key']};});_0x4179fa[_0xaf97('0x30')]=_['map'](_0x2aff54,_0xaf97('0x2b'));_0x4179fa[_0xaf97('0x31')]=_[_0xaf97('0x32')](_0x55983c[_0xaf97('0x31')]);_0x4179fa[_0xaf97('0x33')]=_['intersection'](_0x4179fa[_0xaf97('0x30')],_0x4179fa[_0xaf97('0x31')]);_0x140830[_0xaf97('0x34')]=_[_0xaf97('0x35')](_0x4179fa[_0xaf97('0x30')],qs[_0xaf97('0x36')](_0x55983c[_0xaf97('0x31')][_0xaf97('0x36')]));_0x140830['attributes']=_0x140830[_0xaf97('0x34')]['length']?_0x140830[_0xaf97('0x34')]:_0x4179fa[_0xaf97('0x30')];if(!_0x55983c['query'][_0xaf97('0x37')](_0xaf97('0x38'))){_0x140830[_0xaf97('0x1d')]=qs[_0xaf97('0x1d')](_0x55983c[_0xaf97('0x31')][_0xaf97('0x1d')]);_0x140830[_0xaf97('0x20')]=qs[_0xaf97('0x20')](_0x55983c[_0xaf97('0x31')][_0xaf97('0x20')]);}_0x140830[_0xaf97('0x39')]=qs[_0xaf97('0x3a')](_0x55983c[_0xaf97('0x31')][_0xaf97('0x3a')]);_0x140830[_0xaf97('0x3b')]=qs[_0xaf97('0x33')](_[_0xaf97('0x3c')](_0x55983c['query'],_0x4179fa[_0xaf97('0x33')]),_0x2aff54);if(_0x55983c['query'][_0xaf97('0x3d')]){_0x140830[_0xaf97('0x3b')]=_[_0xaf97('0x3e')](_0x140830[_0xaf97('0x3b')],{'$or':_[_0xaf97('0x3f')](_0x2aff54,function(_0x15e585){if(_0x15e585[_0xaf97('0x40')]!==_0xaf97('0x41')){var _0x1af8cf={};_0x1af8cf[_0x15e585[_0xaf97('0x2b')]]={'$like':'%'+_0x55983c['query'][_0xaf97('0x3d')]+'%'};return _0x1af8cf;}})});}_0x140830=_['merge']({},_0x140830,_0x55983c['options']);var _0x5849eb={'where':_0x140830[_0xaf97('0x3b')]};return db[_0xaf97('0x42')]['count'](_0x5849eb)[_0xaf97('0x28')](function(_0x8b4cfd){_0x505778[_0xaf97('0x1f')]=_0x8b4cfd;if(_0x55983c['query'][_0xaf97('0x43')]){_0x140830[_0xaf97('0x44')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xaf97('0x45')](_0x140830);})[_0xaf97('0x28')](function(_0x459563){_0x505778[_0xaf97('0x46')]=_0x459563;return _0x505778;})[_0xaf97('0x28')](respondWithFilteredResult(_0x434ebd,_0x140830))[_0xaf97('0x47')](handleError(_0x434ebd,null));};exports['show']=function(_0x4133d6,_0x24b490){var _0x3e2a9e={'raw':![],'where':{'id':_0x4133d6[_0xaf97('0x48')]['id']}},_0x108bb7={};_0x108bb7['model']=_[_0xaf97('0x32')](db[_0xaf97('0x42')][_0xaf97('0x2e')]);_0x108bb7[_0xaf97('0x31')]=_[_0xaf97('0x32')](_0x4133d6[_0xaf97('0x31')]);_0x108bb7[_0xaf97('0x33')]=_[_0xaf97('0x35')](_0x108bb7[_0xaf97('0x30')],_0x108bb7[_0xaf97('0x31')]);_0x3e2a9e[_0xaf97('0x34')]=_[_0xaf97('0x35')](_0x108bb7[_0xaf97('0x30')],qs[_0xaf97('0x36')](_0x4133d6['query'][_0xaf97('0x36')]));_0x3e2a9e[_0xaf97('0x34')]=_0x3e2a9e[_0xaf97('0x34')][_0xaf97('0x49')]?_0x3e2a9e[_0xaf97('0x34')]:_0x108bb7['model'];if(_0x4133d6[_0xaf97('0x31')][_0xaf97('0x43')]){_0x3e2a9e['include']=[{'all':!![]}];}_0x3e2a9e=_[_0xaf97('0x3e')]({},_0x3e2a9e,_0x4133d6[_0xaf97('0x4a')]);return db[_0xaf97('0x42')][_0xaf97('0x4b')](_0x3e2a9e)[_0xaf97('0x28')](handleEntityNotFound(_0x24b490,null))['then'](respondWithResult(_0x24b490,null))[_0xaf97('0x47')](handleError(_0x24b490,null));};exports[_0xaf97('0x4c')]=function(_0x23ead9,_0x12bb5c){return db['DeskConfiguration'][_0xaf97('0x4c')](_0x23ead9[_0xaf97('0x4d')],{})['then'](respondWithResult(_0x12bb5c,0xc9))[_0xaf97('0x47')](handleError(_0x12bb5c,null));};exports['update']=function(_0x51e4c2,_0x2c8bd0){if(_0x51e4c2[_0xaf97('0x4d')]['id']){delete _0x51e4c2['body']['id'];}return db[_0xaf97('0x42')]['find']({'where':{'id':_0x51e4c2[_0xaf97('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c8bd0,null))[_0xaf97('0x28')](saveUpdates(_0x51e4c2[_0xaf97('0x4d')],null))[_0xaf97('0x28')](respondWithResult(_0x2c8bd0,null))['catch'](handleError(_0x2c8bd0,null));};exports['destroy']=function(_0x49ff7a,_0x29f4a0){return db[_0xaf97('0x42')][_0xaf97('0x4b')]({'where':{'id':_0x49ff7a[_0xaf97('0x48')]['id']}})['then'](handleEntityNotFound(_0x29f4a0,null))[_0xaf97('0x28')](removeEntity(_0x29f4a0,null))['catch'](handleError(_0x29f4a0,null));};exports[_0xaf97('0x4e')]=function(_0x1bca1f,_0x425e45,_0x331820){var _0x337ba4={};var _0x5b6c64={};var _0x5a8cbb;var _0x599a95;return db[_0xaf97('0x42')][_0xaf97('0x4f')]({'where':{'id':_0x1bca1f[_0xaf97('0x48')]['id']}})[_0xaf97('0x28')](handleEntityNotFound(_0x425e45,null))[_0xaf97('0x28')](function(_0x14c913){if(_0x14c913){_0x5a8cbb=_0x14c913;_0x5b6c64[_0xaf97('0x30')]=_[_0xaf97('0x32')](db[_0xaf97('0x50')]['rawAttributes']);_0x5b6c64['query']=_[_0xaf97('0x32')](_0x1bca1f[_0xaf97('0x31')]);_0x5b6c64[_0xaf97('0x33')]=_[_0xaf97('0x35')](_0x5b6c64['model'],_0x5b6c64[_0xaf97('0x31')]);_0x337ba4[_0xaf97('0x34')]=_[_0xaf97('0x35')](_0x5b6c64[_0xaf97('0x30')],qs['fields'](_0x1bca1f[_0xaf97('0x31')][_0xaf97('0x36')]));_0x337ba4['attributes']=_0x337ba4[_0xaf97('0x34')]['length']?_0x337ba4[_0xaf97('0x34')]:_0x5b6c64[_0xaf97('0x30')];_0x337ba4[_0xaf97('0x39')]=qs['sort'](_0x1bca1f[_0xaf97('0x31')][_0xaf97('0x3a')]);_0x337ba4[_0xaf97('0x3b')]=qs[_0xaf97('0x33')](_[_0xaf97('0x3c')](_0x1bca1f[_0xaf97('0x31')],_0x5b6c64[_0xaf97('0x33')]));if(_0x1bca1f['query']['filter']){_0x337ba4[_0xaf97('0x3b')]=_[_0xaf97('0x3e')](_0x337ba4[_0xaf97('0x3b')],{'$or':_[_0xaf97('0x3f')](_0x337ba4[_0xaf97('0x34')],function(_0x495b46){var _0x4c1ef6={};_0x4c1ef6[_0x495b46]={'$like':'%'+_0x1bca1f[_0xaf97('0x31')][_0xaf97('0x3d')]+'%'};return _0x4c1ef6;})});}_0x337ba4=_[_0xaf97('0x3e')]({},_0x337ba4,_0x1bca1f[_0xaf97('0x4a')]);return _0x5a8cbb['getFields'](_0x337ba4);}})[_0xaf97('0x28')](function(_0x389444){if(_0x389444){_0x599a95=_0x389444['length'];if(!_0x1bca1f[_0xaf97('0x31')]['hasOwnProperty'](_0xaf97('0x38'))){_0x337ba4[_0xaf97('0x1d')]=qs[_0xaf97('0x1d')](_0x1bca1f['query']['limit']);_0x337ba4[_0xaf97('0x20')]=qs[_0xaf97('0x20')](_0x1bca1f[_0xaf97('0x31')][_0xaf97('0x20')]);}return _0x5a8cbb[_0xaf97('0x4e')](_0x337ba4);}})[_0xaf97('0x28')](function(_0x565fa3){if(_0x565fa3){return _0x565fa3?{'count':_0x599a95,'rows':_0x565fa3}:null;}})[_0xaf97('0x28')](respondWithResult(_0x425e45,null))[_0xaf97('0x47')](handleError(_0x425e45,null));};exports[_0xaf97('0x51')]=function(_0x73eaab,_0x5c97e5,_0x98d9f8){var _0x340efb={};var _0x13d321={};var _0xf9fc26;var _0x46c2c0;return db[_0xaf97('0x42')][_0xaf97('0x4f')]({'where':{'id':_0x73eaab[_0xaf97('0x48')]['id']}})[_0xaf97('0x28')](handleEntityNotFound(_0x5c97e5,null))['then'](function(_0x5b6d4d){if(_0x5b6d4d){_0xf9fc26=_0x5b6d4d;_0x13d321[_0xaf97('0x30')]=_[_0xaf97('0x32')](db['DeskField'][_0xaf97('0x2e')]);_0x13d321[_0xaf97('0x31')]=_[_0xaf97('0x32')](_0x73eaab['query']);_0x13d321[_0xaf97('0x33')]=_[_0xaf97('0x35')](_0x13d321[_0xaf97('0x30')],_0x13d321[_0xaf97('0x31')]);_0x340efb[_0xaf97('0x34')]=_[_0xaf97('0x35')](_0x13d321['model'],qs['fields'](_0x73eaab[_0xaf97('0x31')][_0xaf97('0x36')]));_0x340efb['attributes']=_0x340efb[_0xaf97('0x34')]['length']?_0x340efb['attributes']:_0x13d321['model'];_0x340efb['order']=qs[_0xaf97('0x3a')](_0x73eaab['query'][_0xaf97('0x3a')]);_0x340efb[_0xaf97('0x3b')]=qs[_0xaf97('0x33')](_[_0xaf97('0x3c')](_0x73eaab[_0xaf97('0x31')],_0x13d321[_0xaf97('0x33')]));if(_0x73eaab[_0xaf97('0x31')][_0xaf97('0x3d')]){_0x340efb[_0xaf97('0x3b')]=_[_0xaf97('0x3e')](_0x340efb[_0xaf97('0x3b')],{'$or':_[_0xaf97('0x3f')](_0x340efb[_0xaf97('0x34')],function(_0x50b060){var _0x28dbfc={};_0x28dbfc[_0x50b060]={'$like':'%'+_0x73eaab[_0xaf97('0x31')][_0xaf97('0x3d')]+'%'};return _0x28dbfc;})});}_0x340efb=_[_0xaf97('0x3e')]({},_0x340efb,_0x73eaab[_0xaf97('0x4a')]);return _0xf9fc26[_0xaf97('0x51')](_0x340efb);}})[_0xaf97('0x28')](function(_0x26c356){if(_0x26c356){_0x46c2c0=_0x26c356['length'];if(!_0x73eaab[_0xaf97('0x31')][_0xaf97('0x37')](_0xaf97('0x38'))){_0x340efb[_0xaf97('0x1d')]=qs[_0xaf97('0x1d')](_0x73eaab[_0xaf97('0x31')]['limit']);_0x340efb[_0xaf97('0x20')]=qs[_0xaf97('0x20')](_0x73eaab['query'][_0xaf97('0x20')]);}return _0xf9fc26['getSubjects'](_0x340efb);}})[_0xaf97('0x28')](function(_0x456316){if(_0x456316){return _0x456316?{'count':_0x46c2c0,'rows':_0x456316}:null;}})[_0xaf97('0x28')](respondWithResult(_0x5c97e5,null))[_0xaf97('0x47')](handleError(_0x5c97e5,null));};exports[_0xaf97('0x52')]=function(_0x94894c,_0x5e461b,_0x39035d){var _0x2ab607={};var _0x528559={};var _0x275320;var _0x49ff8a;return db['DeskConfiguration'][_0xaf97('0x4f')]({'where':{'id':_0x94894c[_0xaf97('0x48')]['id']}})[_0xaf97('0x28')](handleEntityNotFound(_0x5e461b,null))[_0xaf97('0x28')](function(_0x49dd2f){if(_0x49dd2f){_0x275320=_0x49dd2f;_0x528559['model']=_[_0xaf97('0x32')](db['DeskField']['rawAttributes']);_0x528559['query']=_[_0xaf97('0x32')](_0x94894c[_0xaf97('0x31')]);_0x528559['filters']=_['intersection'](_0x528559[_0xaf97('0x30')],_0x528559[_0xaf97('0x31')]);_0x2ab607[_0xaf97('0x34')]=_[_0xaf97('0x35')](_0x528559[_0xaf97('0x30')],qs[_0xaf97('0x36')](_0x94894c[_0xaf97('0x31')][_0xaf97('0x36')]));_0x2ab607['attributes']=_0x2ab607[_0xaf97('0x34')][_0xaf97('0x49')]?_0x2ab607[_0xaf97('0x34')]:_0x528559[_0xaf97('0x30')];_0x2ab607[_0xaf97('0x39')]=qs[_0xaf97('0x3a')](_0x94894c['query'][_0xaf97('0x3a')]);_0x2ab607['where']=qs[_0xaf97('0x33')](_['pick'](_0x94894c[_0xaf97('0x31')],_0x528559[_0xaf97('0x33')]));if(_0x94894c[_0xaf97('0x31')][_0xaf97('0x3d')]){_0x2ab607[_0xaf97('0x3b')]=_[_0xaf97('0x3e')](_0x2ab607[_0xaf97('0x3b')],{'$or':_[_0xaf97('0x3f')](_0x2ab607[_0xaf97('0x34')],function(_0x2b8b17){var _0x44a624={};_0x44a624[_0x2b8b17]={'$like':'%'+_0x94894c[_0xaf97('0x31')][_0xaf97('0x3d')]+'%'};return _0x44a624;})});}_0x2ab607=_[_0xaf97('0x3e')]({},_0x2ab607,_0x94894c[_0xaf97('0x4a')]);return _0x275320[_0xaf97('0x52')](_0x2ab607);}})[_0xaf97('0x28')](function(_0x1bd6fc){if(_0x1bd6fc){_0x49ff8a=_0x1bd6fc[_0xaf97('0x49')];if(!_0x94894c['query'][_0xaf97('0x37')](_0xaf97('0x38'))){_0x2ab607['limit']=qs[_0xaf97('0x1d')](_0x94894c['query'][_0xaf97('0x1d')]);_0x2ab607['offset']=qs['offset'](_0x94894c[_0xaf97('0x31')][_0xaf97('0x20')]);}return _0x275320[_0xaf97('0x52')](_0x2ab607);}})[_0xaf97('0x28')](function(_0x4d0e39){if(_0x4d0e39){return _0x4d0e39?{'count':_0x49ff8a,'rows':_0x4d0e39}:null;}})['then'](respondWithResult(_0x5e461b,null))[_0xaf97('0x47')](handleError(_0x5e461b,null));};exports[_0xaf97('0x53')]=function(_0x17cd67,_0x3ec565,_0x3fe700){var _0x315e63={};var _0x48e1ba={};var _0x9ca0ee;var _0x18da98;return db[_0xaf97('0x42')]['findOne']({'where':{'id':_0x17cd67[_0xaf97('0x48')]['id']}})[_0xaf97('0x28')](handleEntityNotFound(_0x3ec565,null))[_0xaf97('0x28')](function(_0x4b0cc1){if(_0x4b0cc1){_0x9ca0ee=_0x4b0cc1;_0x48e1ba['model']=_[_0xaf97('0x32')](db[_0xaf97('0x54')]['rawAttributes']);_0x48e1ba[_0xaf97('0x31')]=_['keys'](_0x17cd67[_0xaf97('0x31')]);_0x48e1ba[_0xaf97('0x33')]=_['intersection'](_0x48e1ba[_0xaf97('0x30')],_0x48e1ba[_0xaf97('0x31')]);_0x315e63[_0xaf97('0x34')]=_[_0xaf97('0x35')](_0x48e1ba['model'],qs[_0xaf97('0x36')](_0x17cd67[_0xaf97('0x31')][_0xaf97('0x36')]));_0x315e63[_0xaf97('0x34')]=_0x315e63[_0xaf97('0x34')][_0xaf97('0x49')]?_0x315e63[_0xaf97('0x34')]:_0x48e1ba[_0xaf97('0x30')];_0x315e63[_0xaf97('0x39')]=qs[_0xaf97('0x3a')](_0x17cd67[_0xaf97('0x31')][_0xaf97('0x3a')]);_0x315e63[_0xaf97('0x3b')]=qs[_0xaf97('0x33')](_['pick'](_0x17cd67['query'],_0x48e1ba[_0xaf97('0x33')]));if(_0x17cd67[_0xaf97('0x31')][_0xaf97('0x3d')]){_0x315e63[_0xaf97('0x3b')]=_[_0xaf97('0x3e')](_0x315e63[_0xaf97('0x3b')],{'$or':_[_0xaf97('0x3f')](_0x315e63['attributes'],function(_0x1f747e){var _0xbbea8b={};_0xbbea8b[_0x1f747e]={'$like':'%'+_0x17cd67[_0xaf97('0x31')][_0xaf97('0x3d')]+'%'};return _0xbbea8b;})});}_0x315e63=_[_0xaf97('0x3e')]({},_0x315e63,_0x17cd67[_0xaf97('0x4a')]);return _0x9ca0ee[_0xaf97('0x53')](_0x315e63);}})[_0xaf97('0x28')](function(_0x14a78a){if(_0x14a78a){_0x18da98=_0x14a78a[_0xaf97('0x49')];if(!_0x17cd67[_0xaf97('0x31')][_0xaf97('0x37')](_0xaf97('0x38'))){_0x315e63[_0xaf97('0x1d')]=qs[_0xaf97('0x1d')](_0x17cd67[_0xaf97('0x31')][_0xaf97('0x1d')]);_0x315e63['offset']=qs['offset'](_0x17cd67[_0xaf97('0x31')][_0xaf97('0x20')]);}return _0x9ca0ee['getTags'](_0x315e63);}})[_0xaf97('0x28')](function(_0x8c83c9){if(_0x8c83c9){return _0x8c83c9?{'count':_0x18da98,'rows':_0x8c83c9}:null;}})['then'](respondWithResult(_0x3ec565,null))[_0xaf97('0x47')](handleError(_0x3ec565,null));};exports[_0xaf97('0x55')]=function(_0x5cc96d,_0x54485b,_0x565129){if(_0x5cc96d[_0xaf97('0x4d')]['id']){delete _0x5cc96d[_0xaf97('0x4d')]['id'];}return db[_0xaf97('0x42')]['findOne']({'where':{'id':_0x5cc96d[_0xaf97('0x48')]['id']}})[_0xaf97('0x28')](handleEntityNotFound(_0x54485b,null))[_0xaf97('0x28')](function(_0x26953b){if(_0x26953b){return _0x26953b[_0xaf97('0x55')](_0x5cc96d[_0xaf97('0x4d')][_0xaf97('0x56')]||[]);}return null;})[_0xaf97('0x28')](respondWithResult(_0x54485b,null))[_0xaf97('0x47')](handleError(_0x54485b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index f111f2f..8a58a59 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 _0x7a28=['DeskConfiguration','int_desk_configurations','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define'];(function(_0x5bd7de,_0xe830e7){var _0x4481f0=function(_0x2b1aa0){while(--_0x2b1aa0){_0x5bd7de['push'](_0x5bd7de['shift']());}};_0x4481f0(++_0xe830e7);}(_0x7a28,0x176));var _0x87a2=function(_0x50f3b5,_0x5ef4ec){_0x50f3b5=_0x50f3b5-0x0;var _0x2e43a0=_0x7a28[_0x50f3b5];return _0x2e43a0;};'use strict';var _=require('lodash');var util=require(_0x87a2('0x0'));var logger=require('../../config/logger')(_0x87a2('0x1'));var moment=require('moment');var BPromise=require(_0x87a2('0x2'));var rp=require(_0x87a2('0x3'));var fs=require('fs');var path=require(_0x87a2('0x4'));var rimraf=require(_0x87a2('0x5'));var config=require(_0x87a2('0x6'));var attributes=require(_0x87a2('0x7'));module[_0x87a2('0x8')]=function(_0x43a9ef,_0x5720f8){return _0x43a9ef[_0x87a2('0x9')](_0x87a2('0xa'),attributes,{'tableName':_0x87a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c01=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash'];(function(_0x1b3e27,_0x2e03cd){var _0x37e484=function(_0x583f2d){while(--_0x583f2d){_0x1b3e27['push'](_0x1b3e27['shift']());}};_0x37e484(++_0x2e03cd);}(_0x5c01,0x83));var _0x15c0=function(_0xafb03e,_0x31a0da){_0xafb03e=_0xafb03e-0x0;var _0x12bf75=_0x5c01[_0xafb03e];return _0x12bf75;};'use strict';var _=require(_0x15c0('0x0'));var util=require(_0x15c0('0x1'));var logger=require(_0x15c0('0x2'))(_0x15c0('0x3'));var moment=require(_0x15c0('0x4'));var BPromise=require(_0x15c0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x15c0('0x6'));var config=require(_0x15c0('0x7'));var attributes=require(_0x15c0('0x8'));module[_0x15c0('0x9')]=function(_0x527116,_0x41114c){return _0x527116['define']('DeskConfiguration',attributes,{'tableName':_0x15c0('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 486043d..df8ab31 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 _0x486e=['DeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4336e4,_0x3702a2){var _0x2e6019=function(_0x4c7c12){while(--_0x4c7c12){_0x4336e4['push'](_0x4336e4['shift']());}};_0x2e6019(++_0x3702a2);}(_0x486e,0xb2));var _0xe486=function(_0x53dccc,_0xad9fb1){_0x53dccc=_0x53dccc-0x0;var _0x17241e=_0x486e[_0x53dccc];return _0x17241e;};'use strict';var _=require(_0xe486('0x0'));var util=require(_0xe486('0x1'));var moment=require('moment');var BPromise=require(_0xe486('0x2'));var rs=require(_0xe486('0x3'));var fs=require('fs');var Redis=require(_0xe486('0x4'));var db=require(_0xe486('0x5'))['db'];var utils=require(_0xe486('0x6'));var logger=require(_0xe486('0x7'))(_0xe486('0x8'));var config=require(_0xe486('0x9'));var jayson=require(_0xe486('0xa'));var client=jayson[_0xe486('0xb')][_0xe486('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fac5d,_0x2d0712,_0xea849d){return new BPromise(function(_0x8a85c7,_0x2114a5){return client[_0xe486('0xd')](_0x4fac5d,_0xea849d)[_0xe486('0xe')](function(_0x42c4b3){logger[_0xe486('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x2d0712,'request\x20sent');logger[_0xe486('0x10')](_0xe486('0x11'),_0x2d0712,_0xe486('0x12'),JSON[_0xe486('0x13')](_0x42c4b3));if(_0x42c4b3[_0xe486('0x14')]){if(_0x42c4b3[_0xe486('0x14')][_0xe486('0x15')]===0x1f4){logger[_0xe486('0x14')](_0xe486('0x16'),_0x2d0712,_0x42c4b3['error']['message']);return _0x2114a5(_0x42c4b3[_0xe486('0x14')][_0xe486('0x17')]);}logger[_0xe486('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x2d0712,_0x42c4b3['error'][_0xe486('0x17')]);return _0x8a85c7(_0x42c4b3['error'][_0xe486('0x17')]);}else{logger[_0xe486('0xf')](_0xe486('0x16'),_0x2d0712,_0xe486('0x12'));_0x8a85c7(_0x42c4b3['result']['message']);}})[_0xe486('0x18')](function(_0x21fca9){logger['error'](_0xe486('0x16'),_0x2d0712,_0x21fca9);_0x2114a5(_0x21fca9);});});} \ No newline at end of file +var _0x86c0=['DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x86c0,0x133));var _0x086c=function(_0x47d12e,_0x2d0ada){_0x47d12e=_0x47d12e-0x0;var _0x1250dc=_0x86c0[_0x47d12e];return _0x1250dc;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require(_0x086c('0x1'));var BPromise=require(_0x086c('0x2'));var rs=require(_0x086c('0x3'));var fs=require('fs');var Redis=require(_0x086c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x086c('0x5'));var logger=require(_0x086c('0x6'))(_0x086c('0x7'));var config=require(_0x086c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x086c('0x9')][_0x086c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e27a8,_0x387428,_0x117df9){return new BPromise(function(_0x25e437,_0x52b942){return client[_0x086c('0xb')](_0x2e27a8,_0x117df9)[_0x086c('0xc')](function(_0xa1b79a){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));logger[_0x086c('0xe')](_0x086c('0xf'),_0x387428,_0x086c('0xd'),JSON[_0x086c('0x10')](_0xa1b79a));if(_0xa1b79a['error']){if(_0xa1b79a[_0x086c('0x11')][_0x086c('0x12')]===0x1f4){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error']['message']);return _0x52b942(_0xa1b79a[_0x086c('0x11')]['message']);}logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error'][_0x086c('0x14')]);return _0x25e437(_0xa1b79a[_0x086c('0x11')][_0x086c('0x14')]);}else{logger[_0x086c('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));_0x25e437(_0xa1b79a[_0x086c('0x16')][_0x086c('0x14')]);}})['catch'](function(_0x34e74f){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0x34e74f);_0x52b942(_0x34e74f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index c777c98..47af602 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 _0xe3b7=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xe3b7,0x17e));var _0x7e3b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe3b7[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x7e3b('0x0'));var util=require(_0x7e3b('0x1'));var path=require(_0x7e3b('0x2'));var timeout=require(_0x7e3b('0x3'));var express=require(_0x7e3b('0x4'));var router=express['Router']();var fs_extra=require(_0x7e3b('0x5'));var auth=require(_0x7e3b('0x6'));var interaction=require(_0x7e3b('0x7'));var config=require(_0x7e3b('0x8'));var controller=require(_0x7e3b('0x9'));router[_0x7e3b('0xa')]('/',auth[_0x7e3b('0xb')](),controller[_0x7e3b('0xc')]);router[_0x7e3b('0xa')](_0x7e3b('0xd'),auth[_0x7e3b('0xb')](),controller[_0x7e3b('0xe')]);router[_0x7e3b('0xf')]('/',auth[_0x7e3b('0xb')](),controller['create']);router[_0x7e3b('0x10')](_0x7e3b('0xd'),auth[_0x7e3b('0xb')](),controller[_0x7e3b('0x11')]);router[_0x7e3b('0x12')](_0x7e3b('0xd'),auth['isAuthenticated'](),controller[_0x7e3b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1a21=['./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x537025,_0x52cd13){var _0x3bb37b=function(_0x2935e2){while(--_0x2935e2){_0x537025['push'](_0x537025['shift']());}};_0x3bb37b(++_0x52cd13);}(_0x1a21,0x1d9));var _0x11a2=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x1a21[_0x5c2e5e];return _0x46a5da;};'use strict';var multer=require(_0x11a2('0x0'));var util=require(_0x11a2('0x1'));var path=require(_0x11a2('0x2'));var timeout=require(_0x11a2('0x3'));var express=require(_0x11a2('0x4'));var router=express[_0x11a2('0x5')]();var fs_extra=require(_0x11a2('0x6'));var auth=require(_0x11a2('0x7'));var interaction=require(_0x11a2('0x8'));var config=require(_0x11a2('0x9'));var controller=require(_0x11a2('0xa'));router['get']('/',auth[_0x11a2('0xb')](),controller[_0x11a2('0xc')]);router[_0x11a2('0xd')](_0x11a2('0xe'),auth[_0x11a2('0xb')](),controller[_0x11a2('0xf')]);router['post']('/',auth[_0x11a2('0xb')](),controller[_0x11a2('0x10')]);router[_0x11a2('0x11')](_0x11a2('0xe'),auth['isAuthenticated'](),controller[_0x11a2('0x12')]);router[_0x11a2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x11a2('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 710de77..754315b 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 _0xb0db=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb0db,0x172));var _0xbb0d=function(_0x3813ef,_0xb2404e){_0x3813ef=_0x3813ef-0x0;var _0x3dc690=_0xb0db[_0x3813ef];return _0x3dc690;};'use strict';var Sequelize=require(_0xbb0d('0x0'));module[_0xbb0d('0x1')]={'type':{'type':Sequelize[_0xbb0d('0x2')](_0xbb0d('0x3'),_0xbb0d('0x4'),_0xbb0d('0x5'),'keyValue',_0xbb0d('0x6')),'defaultValue':_0xbb0d('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbb0d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xbb0d('0x3'),_0xbb0d('0x4'),_0xbb0d('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbb0d('0x7')]},'nameField':{'type':Sequelize[_0xbb0d('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb0d('0x7')]}}; \ No newline at end of file +var _0x4b89=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x5e21d0,_0x2d20eb){var _0x389286=function(_0x19614e){while(--_0x19614e){_0x5e21d0['push'](_0x5e21d0['shift']());}};_0x389286(++_0x2d20eb);}(_0x4b89,0x7b));var _0x94b8=function(_0x3f105a,_0x459d89){_0x3f105a=_0x3f105a-0x0;var _0x41a968=_0x4b89[_0x3f105a];return _0x41a968;};'use strict';var Sequelize=require('sequelize');module[_0x94b8('0x0')]={'type':{'type':Sequelize[_0x94b8('0x1')](_0x94b8('0x2'),_0x94b8('0x3'),_0x94b8('0x4'),'keyValue',_0x94b8('0x5')),'defaultValue':_0x94b8('0x2')},'content':{'type':Sequelize[_0x94b8('0x6')]},'key':{'type':Sequelize[_0x94b8('0x6')]},'keyType':{'type':Sequelize[_0x94b8('0x1')](_0x94b8('0x2'),_0x94b8('0x3'),_0x94b8('0x4'))},'keyContent':{'type':Sequelize[_0x94b8('0x6')]},'idField':{'type':Sequelize[_0x94b8('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x94b8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94b8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 853bc0e..0729fc7 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 _0xf715=['find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','api','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xf715,0x90));var _0x5f71=function(_0x4081b1,_0x32622a){_0x4081b1=_0x4081b1-0x0;var _0x10e0de=_0xf715[_0x4081b1];return _0x10e0de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f71('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f71('0x1'));var rp=require(_0x5f71('0x2'));var moment=require(_0x5f71('0x3'));var BPromise=require(_0x5f71('0x4'));var Mustache=require(_0x5f71('0x5'));var util=require(_0x5f71('0x6'));var path=require('path');var sox=require(_0x5f71('0x7'));var csv=require(_0x5f71('0x8'));var ejs=require(_0x5f71('0x9'));var fs=require('fs');var fs_extra=require(_0x5f71('0xa'));var _=require(_0x5f71('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5f71('0xc'));var deskjs=require(_0x5f71('0xd'));var toCsv=require(_0x5f71('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f71('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5f71('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f71('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5f71('0x11'))['db'];function respondWithStatusCode(_0x573f44,_0x3d0f4b){_0x3d0f4b=_0x3d0f4b||0xcc;return function(_0x17d161){if(_0x17d161){return _0x573f44['sendStatus'](_0x3d0f4b);}return _0x573f44[_0x5f71('0x12')](_0x3d0f4b)[_0x5f71('0x13')]();};}function respondWithResult(_0x3282bd,_0xffe8e){_0xffe8e=_0xffe8e||0xc8;return function(_0x39a443){if(_0x39a443){return _0x3282bd['status'](_0xffe8e)[_0x5f71('0x14')](_0x39a443);}};}function respondWithFilteredResult(_0x23dfba,_0x13a1c6){return function(_0x50867b){if(_0x50867b){var _0x32a940=typeof _0x13a1c6[_0x5f71('0x15')]==='undefined'&&typeof _0x13a1c6['limit']===_0x5f71('0x16');var _0x313b99=_0x50867b[_0x5f71('0x17')];var _0x4d95b2=_0x32a940?0x0:_0x13a1c6['offset'];var _0x36d40a=_0x32a940?_0x50867b[_0x5f71('0x17')]:_0x13a1c6[_0x5f71('0x15')]+_0x13a1c6[_0x5f71('0x18')];var _0x50b8b6;if(_0x36d40a>=_0x313b99){_0x36d40a=_0x313b99;_0x50b8b6=0xc8;}else{_0x50b8b6=0xce;}_0x23dfba[_0x5f71('0x12')](_0x50b8b6);return _0x23dfba[_0x5f71('0x19')](_0x5f71('0x1a'),_0x4d95b2+'-'+_0x36d40a+'/'+_0x313b99)['json'](_0x50867b);}return null;};}function patchUpdates(_0x418ada){return function(_0x221397){try{jsonpatch[_0x5f71('0x1b')](_0x221397,_0x418ada,!![]);}catch(_0x1f1a41){return BPromise[_0x5f71('0x1c')](_0x1f1a41);}return _0x221397[_0x5f71('0x1d')]();};}function saveUpdates(_0x4f5a76,_0x1f706a){return function(_0x278b81){if(_0x278b81){return _0x278b81[_0x5f71('0x1e')](_0x4f5a76)[_0x5f71('0x1f')](function(_0xf67617){return _0xf67617;});}return null;};}function removeEntity(_0x4b82bf,_0x27587b){return function(_0x52daa4){if(_0x52daa4){return _0x52daa4[_0x5f71('0x20')]()[_0x5f71('0x1f')](function(){_0x4b82bf['status'](0xcc)[_0x5f71('0x13')]();});}};}function handleEntityNotFound(_0x1450d1,_0x1ecf66){return function(_0x402226){if(!_0x402226){_0x1450d1[_0x5f71('0x21')](0x194);}return _0x402226;};}function handleError(_0x532d67,_0x11842d){_0x11842d=_0x11842d||0x1f4;return function(_0x3f623c){logger[_0x5f71('0x22')](_0x3f623c[_0x5f71('0x23')]);if(_0x3f623c[_0x5f71('0x24')]){delete _0x3f623c[_0x5f71('0x24')];}_0x532d67[_0x5f71('0x12')](_0x11842d)['send'](_0x3f623c);};}exports[_0x5f71('0x25')]=function(_0x48ddd4,_0x3c0b53){var _0x4ea0ed={},_0x462735={},_0x1a88a4={'count':0x0,'rows':[]};var _0x25e479=_[_0x5f71('0x26')](db[_0x5f71('0x27')][_0x5f71('0x28')],function(_0x1e3d81){return{'name':_0x1e3d81[_0x5f71('0x29')],'type':_0x1e3d81['type'][_0x5f71('0x2a')]};});_0x462735[_0x5f71('0x2b')]=_[_0x5f71('0x26')](_0x25e479,_0x5f71('0x24'));_0x462735[_0x5f71('0x2c')]=_[_0x5f71('0x2d')](_0x48ddd4['query']);_0x462735['filters']=_[_0x5f71('0x2e')](_0x462735[_0x5f71('0x2b')],_0x462735[_0x5f71('0x2c')]);_0x4ea0ed[_0x5f71('0x2f')]=_[_0x5f71('0x2e')](_0x462735['model'],qs['fields'](_0x48ddd4[_0x5f71('0x2c')][_0x5f71('0x30')]));_0x4ea0ed[_0x5f71('0x2f')]=_0x4ea0ed['attributes'][_0x5f71('0x31')]?_0x4ea0ed[_0x5f71('0x2f')]:_0x462735[_0x5f71('0x2b')];if(!_0x48ddd4[_0x5f71('0x2c')][_0x5f71('0x32')]('nolimit')){_0x4ea0ed[_0x5f71('0x18')]=qs[_0x5f71('0x18')](_0x48ddd4['query'][_0x5f71('0x18')]);_0x4ea0ed['offset']=qs[_0x5f71('0x15')](_0x48ddd4[_0x5f71('0x2c')][_0x5f71('0x15')]);}_0x4ea0ed[_0x5f71('0x33')]=qs['sort'](_0x48ddd4[_0x5f71('0x2c')]['sort']);_0x4ea0ed[_0x5f71('0x34')]=qs[_0x5f71('0x35')](_[_0x5f71('0x36')](_0x48ddd4['query'],_0x462735['filters']),_0x25e479);if(_0x48ddd4[_0x5f71('0x2c')]['filter']){_0x4ea0ed[_0x5f71('0x34')]=_[_0x5f71('0x37')](_0x4ea0ed['where'],{'$or':_[_0x5f71('0x26')](_0x25e479,function(_0xa44dc1){if(_0xa44dc1[_0x5f71('0x38')]!==_0x5f71('0x39')){var _0x207b0a={};_0x207b0a[_0xa44dc1[_0x5f71('0x24')]]={'$like':'%'+_0x48ddd4[_0x5f71('0x2c')][_0x5f71('0x3a')]+'%'};return _0x207b0a;}})});}_0x4ea0ed=_['merge']({},_0x4ea0ed,_0x48ddd4[_0x5f71('0x3b')]);var _0x50b224={'where':_0x4ea0ed['where']};return db[_0x5f71('0x27')][_0x5f71('0x17')](_0x50b224)[_0x5f71('0x1f')](function(_0x301138){_0x1a88a4['count']=_0x301138;if(_0x48ddd4['query'][_0x5f71('0x3c')]){_0x4ea0ed[_0x5f71('0x3d')]=[{'all':!![]}];}return db[_0x5f71('0x27')][_0x5f71('0x3e')](_0x4ea0ed);})['then'](function(_0x18f2e2){_0x1a88a4[_0x5f71('0x3f')]=_0x18f2e2;return _0x1a88a4;})[_0x5f71('0x1f')](respondWithFilteredResult(_0x3c0b53,_0x4ea0ed))[_0x5f71('0x40')](handleError(_0x3c0b53,null));};exports[_0x5f71('0x41')]=function(_0x38ea2f,_0x40d1d5){var _0x99beca={'raw':!![],'where':{'id':_0x38ea2f['params']['id']}},_0x328ee0={};_0x328ee0[_0x5f71('0x2b')]=_[_0x5f71('0x2d')](db[_0x5f71('0x27')][_0x5f71('0x28')]);_0x328ee0[_0x5f71('0x2c')]=_['keys'](_0x38ea2f[_0x5f71('0x2c')]);_0x328ee0['filters']=_[_0x5f71('0x2e')](_0x328ee0['model'],_0x328ee0[_0x5f71('0x2c')]);_0x99beca['attributes']=_['intersection'](_0x328ee0[_0x5f71('0x2b')],qs['fields'](_0x38ea2f[_0x5f71('0x2c')][_0x5f71('0x30')]));_0x99beca[_0x5f71('0x2f')]=_0x99beca[_0x5f71('0x2f')]['length']?_0x99beca['attributes']:_0x328ee0[_0x5f71('0x2b')];if(_0x38ea2f[_0x5f71('0x2c')][_0x5f71('0x3c')]){_0x99beca[_0x5f71('0x3d')]=[{'all':!![]}];}_0x99beca=_[_0x5f71('0x37')]({},_0x99beca,_0x38ea2f[_0x5f71('0x3b')]);return db[_0x5f71('0x27')][_0x5f71('0x42')](_0x99beca)[_0x5f71('0x1f')](handleEntityNotFound(_0x40d1d5,null))[_0x5f71('0x1f')](respondWithResult(_0x40d1d5,null))['catch'](handleError(_0x40d1d5,null));};exports[_0x5f71('0x43')]=function(_0x50d3a4,_0x5a695a){return db[_0x5f71('0x27')][_0x5f71('0x43')](_0x50d3a4[_0x5f71('0x44')],{})[_0x5f71('0x1f')](respondWithResult(_0x5a695a,0xc9))[_0x5f71('0x40')](handleError(_0x5a695a,null));};exports[_0x5f71('0x1e')]=function(_0x310afa,_0x1fe0f5){if(_0x310afa[_0x5f71('0x44')]['id']){delete _0x310afa['body']['id'];}return db[_0x5f71('0x27')][_0x5f71('0x42')]({'where':{'id':_0x310afa['params']['id']}})[_0x5f71('0x1f')](handleEntityNotFound(_0x1fe0f5,null))[_0x5f71('0x1f')](saveUpdates(_0x310afa[_0x5f71('0x44')],null))[_0x5f71('0x1f')](respondWithResult(_0x1fe0f5,null))[_0x5f71('0x40')](handleError(_0x1fe0f5,null));};exports[_0x5f71('0x20')]=function(_0x154ca9,_0x5bbe24){return db[_0x5f71('0x27')][_0x5f71('0x42')]({'where':{'id':_0x154ca9[_0x5f71('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bbe24,null))[_0x5f71('0x1f')](removeEntity(_0x5bbe24,null))[_0x5f71('0x40')](handleError(_0x5bbe24,null));}; \ No newline at end of file +var _0xb012=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','DeskField','rawAttributes','fieldName','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','length','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra'];(function(_0x545ed4,_0x4be14a){var _0x9c19c6=function(_0x13edcc){while(--_0x13edcc){_0x545ed4['push'](_0x545ed4['shift']());}};_0x9c19c6(++_0x4be14a);}(_0xb012,0x92));var _0x2b01=function(_0x82df33,_0x31f867){_0x82df33=_0x82df33-0x0;var _0x34c236=_0xb012[_0x82df33];return _0x34c236;};'use strict';var emlformat=require(_0x2b01('0x0'));var rimraf=require(_0x2b01('0x1'));var zipdir=require(_0x2b01('0x2'));var jsonpatch=require(_0x2b01('0x3'));var rp=require(_0x2b01('0x4'));var moment=require(_0x2b01('0x5'));var BPromise=require(_0x2b01('0x6'));var Mustache=require(_0x2b01('0x7'));var util=require(_0x2b01('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x2b01('0x9'));var ejs=require(_0x2b01('0xa'));var fs=require('fs');var fs_extra=require(_0x2b01('0xb'));var _=require(_0x2b01('0xc'));var squel=require(_0x2b01('0xd'));var crypto=require('crypto');var jsforce=require(_0x2b01('0xe'));var deskjs=require(_0x2b01('0xf'));var toCsv=require(_0x2b01('0x9'));var querystring=require(_0x2b01('0x10'));var Papa=require(_0x2b01('0x11'));var Redis=require(_0x2b01('0x12'));var authService=require(_0x2b01('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b01('0x14'));var logger=require(_0x2b01('0x15'))(_0x2b01('0x16'));var utils=require(_0x2b01('0x17'));var config=require(_0x2b01('0x18'));var licenseUtil=require(_0x2b01('0x19'));var db=require(_0x2b01('0x1a'))['db'];function respondWithStatusCode(_0x2488bb,_0x79b8c0){_0x79b8c0=_0x79b8c0||0xcc;return function(_0x2e57ae){if(_0x2e57ae){return _0x2488bb[_0x2b01('0x1b')](_0x79b8c0);}return _0x2488bb[_0x2b01('0x1c')](_0x79b8c0)[_0x2b01('0x1d')]();};}function respondWithResult(_0x3c81a4,_0x396429){_0x396429=_0x396429||0xc8;return function(_0x9255ea){if(_0x9255ea){return _0x3c81a4[_0x2b01('0x1c')](_0x396429)[_0x2b01('0x1e')](_0x9255ea);}};}function respondWithFilteredResult(_0x24855e,_0x3e28be){return function(_0x14eb60){if(_0x14eb60){var _0x26cf1f=typeof _0x3e28be[_0x2b01('0x1f')]===_0x2b01('0x20')&&typeof _0x3e28be[_0x2b01('0x21')]===_0x2b01('0x20');var _0x5e825a=_0x14eb60[_0x2b01('0x22')];var _0x40ddd6=_0x26cf1f?0x0:_0x3e28be['offset'];var _0x585ace=_0x26cf1f?_0x14eb60[_0x2b01('0x22')]:_0x3e28be['offset']+_0x3e28be[_0x2b01('0x21')];var _0x3fd07b;if(_0x585ace>=_0x5e825a){_0x585ace=_0x5e825a;_0x3fd07b=0xc8;}else{_0x3fd07b=0xce;}_0x24855e[_0x2b01('0x1c')](_0x3fd07b);return _0x24855e[_0x2b01('0x23')](_0x2b01('0x24'),_0x40ddd6+'-'+_0x585ace+'/'+_0x5e825a)['json'](_0x14eb60);}return null;};}function patchUpdates(_0x45beb7){return function(_0x52dcd4){try{jsonpatch[_0x2b01('0x25')](_0x52dcd4,_0x45beb7,!![]);}catch(_0x3be87e){return BPromise[_0x2b01('0x26')](_0x3be87e);}return _0x52dcd4[_0x2b01('0x27')]();};}function saveUpdates(_0xc9160d,_0x4544de){return function(_0x1a8188){if(_0x1a8188){return _0x1a8188[_0x2b01('0x28')](_0xc9160d)[_0x2b01('0x29')](function(_0x151e89){return _0x151e89;});}return null;};}function removeEntity(_0x263214,_0x392f35){return function(_0x4924ce){if(_0x4924ce){return _0x4924ce[_0x2b01('0x2a')]()[_0x2b01('0x29')](function(){_0x263214[_0x2b01('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12dd4b,_0x15ce82){return function(_0x5de415){if(!_0x5de415){_0x12dd4b['sendStatus'](0x194);}return _0x5de415;};}function handleError(_0x14e3f1,_0x5570f3){_0x5570f3=_0x5570f3||0x1f4;return function(_0x1fdee6){logger[_0x2b01('0x2b')](_0x1fdee6[_0x2b01('0x2c')]);if(_0x1fdee6[_0x2b01('0x2d')]){delete _0x1fdee6['name'];}_0x14e3f1[_0x2b01('0x1c')](_0x5570f3)['send'](_0x1fdee6);};}exports[_0x2b01('0x2e')]=function(_0x54ae57,_0x32a4ba){var _0x6a2106={},_0x9fb1f0={},_0x515c9e={'count':0x0,'rows':[]};var _0x13aa6f=_['map'](db[_0x2b01('0x2f')][_0x2b01('0x30')],function(_0x3c0699){return{'name':_0x3c0699[_0x2b01('0x31')],'type':_0x3c0699['type']['key']};});_0x9fb1f0['model']=_[_0x2b01('0x32')](_0x13aa6f,_0x2b01('0x2d'));_0x9fb1f0[_0x2b01('0x33')]=_[_0x2b01('0x34')](_0x54ae57['query']);_0x9fb1f0['filters']=_[_0x2b01('0x35')](_0x9fb1f0[_0x2b01('0x36')],_0x9fb1f0[_0x2b01('0x33')]);_0x6a2106['attributes']=_[_0x2b01('0x35')](_0x9fb1f0[_0x2b01('0x36')],qs['fields'](_0x54ae57[_0x2b01('0x33')][_0x2b01('0x37')]));_0x6a2106['attributes']=_0x6a2106[_0x2b01('0x38')]['length']?_0x6a2106['attributes']:_0x9fb1f0[_0x2b01('0x36')];if(!_0x54ae57[_0x2b01('0x33')][_0x2b01('0x39')](_0x2b01('0x3a'))){_0x6a2106['limit']=qs[_0x2b01('0x21')](_0x54ae57[_0x2b01('0x33')][_0x2b01('0x21')]);_0x6a2106[_0x2b01('0x1f')]=qs[_0x2b01('0x1f')](_0x54ae57[_0x2b01('0x33')]['offset']);}_0x6a2106[_0x2b01('0x3b')]=qs['sort'](_0x54ae57[_0x2b01('0x33')][_0x2b01('0x3c')]);_0x6a2106[_0x2b01('0x3d')]=qs[_0x2b01('0x3e')](_[_0x2b01('0x3f')](_0x54ae57[_0x2b01('0x33')],_0x9fb1f0[_0x2b01('0x3e')]),_0x13aa6f);if(_0x54ae57[_0x2b01('0x33')][_0x2b01('0x40')]){_0x6a2106[_0x2b01('0x3d')]=_[_0x2b01('0x41')](_0x6a2106[_0x2b01('0x3d')],{'$or':_[_0x2b01('0x32')](_0x13aa6f,function(_0x19190a){if(_0x19190a[_0x2b01('0x42')]!==_0x2b01('0x43')){var _0x72ab42={};_0x72ab42[_0x19190a[_0x2b01('0x2d')]]={'$like':'%'+_0x54ae57[_0x2b01('0x33')][_0x2b01('0x40')]+'%'};return _0x72ab42;}})});}_0x6a2106=_[_0x2b01('0x41')]({},_0x6a2106,_0x54ae57[_0x2b01('0x44')]);var _0x187fa0={'where':_0x6a2106[_0x2b01('0x3d')]};return db[_0x2b01('0x2f')][_0x2b01('0x22')](_0x187fa0)['then'](function(_0x2a9ed1){_0x515c9e[_0x2b01('0x22')]=_0x2a9ed1;if(_0x54ae57['query'][_0x2b01('0x45')]){_0x6a2106[_0x2b01('0x46')]=[{'all':!![]}];}return db[_0x2b01('0x2f')]['findAll'](_0x6a2106);})[_0x2b01('0x29')](function(_0x45b9c0){_0x515c9e[_0x2b01('0x47')]=_0x45b9c0;return _0x515c9e;})[_0x2b01('0x29')](respondWithFilteredResult(_0x32a4ba,_0x6a2106))['catch'](handleError(_0x32a4ba,null));};exports[_0x2b01('0x48')]=function(_0x40e3cc,_0x39bf7e){var _0xecb1be={'raw':!![],'where':{'id':_0x40e3cc['params']['id']}},_0x46c93e={};_0x46c93e[_0x2b01('0x36')]=_[_0x2b01('0x34')](db[_0x2b01('0x2f')][_0x2b01('0x30')]);_0x46c93e['query']=_[_0x2b01('0x34')](_0x40e3cc[_0x2b01('0x33')]);_0x46c93e[_0x2b01('0x3e')]=_[_0x2b01('0x35')](_0x46c93e[_0x2b01('0x36')],_0x46c93e['query']);_0xecb1be[_0x2b01('0x38')]=_[_0x2b01('0x35')](_0x46c93e[_0x2b01('0x36')],qs['fields'](_0x40e3cc['query'][_0x2b01('0x37')]));_0xecb1be['attributes']=_0xecb1be['attributes'][_0x2b01('0x49')]?_0xecb1be['attributes']:_0x46c93e[_0x2b01('0x36')];if(_0x40e3cc[_0x2b01('0x33')][_0x2b01('0x45')]){_0xecb1be[_0x2b01('0x46')]=[{'all':!![]}];}_0xecb1be=_[_0x2b01('0x41')]({},_0xecb1be,_0x40e3cc[_0x2b01('0x44')]);return db[_0x2b01('0x2f')][_0x2b01('0x4a')](_0xecb1be)['then'](handleEntityNotFound(_0x39bf7e,null))[_0x2b01('0x29')](respondWithResult(_0x39bf7e,null))['catch'](handleError(_0x39bf7e,null));};exports[_0x2b01('0x4b')]=function(_0x7895fa,_0x3faf31){return db['DeskField'][_0x2b01('0x4b')](_0x7895fa[_0x2b01('0x4c')],{})[_0x2b01('0x29')](respondWithResult(_0x3faf31,0xc9))[_0x2b01('0x4d')](handleError(_0x3faf31,null));};exports['update']=function(_0x23fbc1,_0x5072c4){if(_0x23fbc1['body']['id']){delete _0x23fbc1[_0x2b01('0x4c')]['id'];}return db[_0x2b01('0x2f')][_0x2b01('0x4a')]({'where':{'id':_0x23fbc1[_0x2b01('0x4e')]['id']}})[_0x2b01('0x29')](handleEntityNotFound(_0x5072c4,null))[_0x2b01('0x29')](saveUpdates(_0x23fbc1[_0x2b01('0x4c')],null))[_0x2b01('0x29')](respondWithResult(_0x5072c4,null))[_0x2b01('0x4d')](handleError(_0x5072c4,null));};exports['destroy']=function(_0x365fd8,_0x99006d){return db[_0x2b01('0x2f')]['find']({'where':{'id':_0x365fd8[_0x2b01('0x4e')]['id']}})['then'](handleEntityNotFound(_0x99006d,null))[_0x2b01('0x29')](removeEntity(_0x99006d,null))[_0x2b01('0x4d')](handleError(_0x99006d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 3eb8505..52483f5 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 _0xa34b=['path','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger','request-promise'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xa34b,0x1de));var _0xba34=function(_0x340f5f,_0x2cd7ab){_0x340f5f=_0x340f5f-0x0;var _0x2b1219=_0xa34b[_0x340f5f];return _0x2b1219;};'use strict';var _=require(_0xba34('0x0'));var util=require('util');var logger=require(_0xba34('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba34('0x2'));var fs=require('fs');var path=require(_0xba34('0x3'));var rimraf=require(_0xba34('0x4'));var config=require(_0xba34('0x5'));var attributes=require(_0xba34('0x6'));module[_0xba34('0x7')]=function(_0x587f7f,_0x5c5823){return _0x587f7f['define'](_0xba34('0x8'),attributes,{'tableName':_0xba34('0x9'),'paranoid':![],'indexes':[{'name':_0xba34('0xa'),'fields':[_0xba34('0xb'),_0xba34('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b05=['define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intDeskField.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6b05,0x15e));var _0x56b0=function(_0x56b4d5,_0x1609c1){_0x56b4d5=_0x56b4d5-0x0;var _0x27974a=_0x6b05[_0x56b4d5];return _0x27974a;};'use strict';var _=require(_0x56b0('0x0'));var util=require(_0x56b0('0x1'));var logger=require(_0x56b0('0x2'))(_0x56b0('0x3'));var moment=require(_0x56b0('0x4'));var BPromise=require('bluebird');var rp=require(_0x56b0('0x5'));var fs=require('fs');var path=require(_0x56b0('0x6'));var rimraf=require(_0x56b0('0x7'));var config=require('../../config/environment');var attributes=require(_0x56b0('0x8'));module[_0x56b0('0x9')]=function(_0x959e0a,_0x20b0a9){return _0x959e0a[_0x56b0('0xa')](_0x56b0('0xb'),attributes,{'tableName':_0x56b0('0xc'),'paranoid':![],'indexes':[{'name':_0x56b0('0xd'),'fields':['idField',_0x56b0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 41b0b85..34c514c 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 _0xcfc5=['error','DeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x486970,_0x291516){var _0x41546c=function(_0x4d17de){while(--_0x4d17de){_0x486970['push'](_0x486970['shift']());}};_0x41546c(++_0x291516);}(_0xcfc5,0xa0));var _0x5cfc=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xcfc5[_0x382a62];return _0x490a25;};'use strict';var _=require(_0x5cfc('0x0'));var util=require(_0x5cfc('0x1'));var moment=require(_0x5cfc('0x2'));var BPromise=require(_0x5cfc('0x3'));var rs=require(_0x5cfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cfc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cfc('0x6'))(_0x5cfc('0x7'));var config=require(_0x5cfc('0x8'));var jayson=require(_0x5cfc('0x9'));var client=jayson[_0x5cfc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x246e28,_0x23f0cc,_0x9cfe49){return new BPromise(function(_0x4ea151,_0x1281ac){return client[_0x5cfc('0xb')](_0x246e28,_0x9cfe49)[_0x5cfc('0xc')](function(_0x173b46){logger['info']('DeskField,\x20%s,\x20%s',_0x23f0cc,_0x5cfc('0xd'));logger['debug'](_0x5cfc('0xe'),_0x23f0cc,'request\x20sent',JSON[_0x5cfc('0xf')](_0x173b46));if(_0x173b46[_0x5cfc('0x10')]){if(_0x173b46['error']['code']===0x1f4){logger['error'](_0x5cfc('0x11'),_0x23f0cc,_0x173b46[_0x5cfc('0x10')][_0x5cfc('0x12')]);return _0x1281ac(_0x173b46[_0x5cfc('0x10')][_0x5cfc('0x12')]);}logger['error'](_0x5cfc('0x11'),_0x23f0cc,_0x173b46[_0x5cfc('0x10')][_0x5cfc('0x12')]);return _0x4ea151(_0x173b46[_0x5cfc('0x10')][_0x5cfc('0x12')]);}else{logger[_0x5cfc('0x13')]('DeskField,\x20%s,\x20%s',_0x23f0cc,_0x5cfc('0xd'));_0x4ea151(_0x173b46[_0x5cfc('0x14')][_0x5cfc('0x12')]);}})[_0x5cfc('0x15')](function(_0x5eb6cb){logger[_0x5cfc('0x10')](_0x5cfc('0x11'),_0x23f0cc,_0x5eb6cb);_0x1281ac(_0x5eb6cb);});});} \ No newline at end of file +var _0xf838=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x17ca78,_0x219d44){var _0x43a0d7=function(_0x2dead5){while(--_0x2dead5){_0x17ca78['push'](_0x17ca78['shift']());}};_0x43a0d7(++_0x219d44);}(_0xf838,0xf3));var _0x8f83=function(_0x12ca9f,_0x43eddc){_0x12ca9f=_0x12ca9f-0x0;var _0x5c4c85=_0xf838[_0x12ca9f];return _0x5c4c85;};'use strict';var _=require(_0x8f83('0x0'));var util=require(_0x8f83('0x1'));var moment=require(_0x8f83('0x2'));var BPromise=require(_0x8f83('0x3'));var rs=require(_0x8f83('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f83('0x5'))['db'];var utils=require(_0x8f83('0x6'));var logger=require('../../config/logger')(_0x8f83('0x7'));var config=require(_0x8f83('0x8'));var jayson=require(_0x8f83('0x9'));var client=jayson['client'][_0x8f83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e16f2,_0x5766ab,_0xc0f228){return new BPromise(function(_0x361551,_0xce6d5){return client[_0x8f83('0xb')](_0x4e16f2,_0xc0f228)[_0x8f83('0xc')](function(_0x4d96ca){logger[_0x8f83('0xd')](_0x8f83('0xe'),_0x5766ab,_0x8f83('0xf'));logger[_0x8f83('0x10')](_0x8f83('0x11'),_0x5766ab,'request\x20sent',JSON[_0x8f83('0x12')](_0x4d96ca));if(_0x4d96ca['error']){if(_0x4d96ca[_0x8f83('0x13')]['code']===0x1f4){logger[_0x8f83('0x13')](_0x8f83('0xe'),_0x5766ab,_0x4d96ca['error'][_0x8f83('0x14')]);return _0xce6d5(_0x4d96ca[_0x8f83('0x13')][_0x8f83('0x14')]);}logger['error'](_0x8f83('0xe'),_0x5766ab,_0x4d96ca[_0x8f83('0x13')][_0x8f83('0x14')]);return _0x361551(_0x4d96ca[_0x8f83('0x13')][_0x8f83('0x14')]);}else{logger[_0x8f83('0xd')](_0x8f83('0xe'),_0x5766ab,'request\x20sent');_0x361551(_0x4d96ca[_0x8f83('0x15')][_0x8f83('0x14')]);}})['catch'](function(_0x325713){logger['error']('DeskField,\x20%s,\x20%s',_0x5766ab,_0x325713);_0xce6d5(_0x325713);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b651b31..a6adca9 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 _0x75df=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Account.controller','get','index','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','addConfiguration'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x75df,0xe7));var _0xf75d=function(_0x25bc9f,_0x3dca96){_0x25bc9f=_0x25bc9f-0x0;var _0x112f0e=_0x75df[_0x25bc9f];return _0x112f0e;};'use strict';var multer=require(_0xf75d('0x0'));var util=require('util');var path=require(_0xf75d('0x1'));var timeout=require(_0xf75d('0x2'));var express=require(_0xf75d('0x3'));var router=express[_0xf75d('0x4')]();var fs_extra=require(_0xf75d('0x5'));var auth=require(_0xf75d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf75d('0x7'));router[_0xf75d('0x8')]('/',auth['isAuthenticated'](),controller[_0xf75d('0x9')]);router[_0xf75d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf75d('0xa')]);router[_0xf75d('0x8')](_0xf75d('0xb'),auth[_0xf75d('0xc')](),controller[_0xf75d('0xd')]);router[_0xf75d('0x8')](_0xf75d('0xe'),auth[_0xf75d('0xc')](),controller[_0xf75d('0xf')]);router['post']('/',auth[_0xf75d('0xc')](),controller[_0xf75d('0x10')]);router[_0xf75d('0x11')](_0xf75d('0xb'),auth[_0xf75d('0xc')](),controller[_0xf75d('0x12')]);router[_0xf75d('0x13')](_0xf75d('0x14'),auth[_0xf75d('0xc')](),controller[_0xf75d('0x15')]);router[_0xf75d('0x16')](_0xf75d('0x14'),auth[_0xf75d('0xc')](),controller[_0xf75d('0x17')]);module[_0xf75d('0x18')]=router; \ No newline at end of file +var _0x817f=['post','create','addConfiguration','put','update','destroy','exports','multer','util','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields'];(function(_0x46e251,_0x328b55){var _0x350647=function(_0x384da0){while(--_0x384da0){_0x46e251['push'](_0x46e251['shift']());}};_0x350647(++_0x328b55);}(_0x817f,0x10b));var _0xf817=function(_0x354e7a,_0x4e4dc0){_0x354e7a=_0x354e7a-0x0;var _0x17b550=_0x817f[_0x354e7a];return _0x17b550;};'use strict';var multer=require(_0xf817('0x0'));var util=require(_0xf817('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf817('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf817('0x3'));var config=require(_0xf817('0x4'));var controller=require(_0xf817('0x5'));router[_0xf817('0x6')]('/',auth[_0xf817('0x7')](),controller['index']);router[_0xf817('0x6')](_0xf817('0x8'),auth[_0xf817('0x7')](),controller[_0xf817('0x9')]);router[_0xf817('0x6')](_0xf817('0xa'),auth['isAuthenticated'](),controller[_0xf817('0xb')]);router[_0xf817('0x6')]('/:id/fields',auth[_0xf817('0x7')](),controller[_0xf817('0xc')]);router[_0xf817('0xd')]('/',auth[_0xf817('0x7')](),controller[_0xf817('0xe')]);router[_0xf817('0xd')](_0xf817('0xa'),auth[_0xf817('0x7')](),controller[_0xf817('0xf')]);router[_0xf817('0x10')](_0xf817('0x8'),auth[_0xf817('0x7')](),controller[_0xf817('0x11')]);router['delete']('/:id',auth[_0xf817('0x7')](),controller[_0xf817('0x12')]);module[_0xf817('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a9f9d47..7a3d381 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 _0x2cd0=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2911e2,_0x39c3d9){var _0x111b30=function(_0xb9e924){while(--_0xb9e924){_0x2911e2['push'](_0x2911e2['shift']());}};_0x111b30(++_0x39c3d9);}(_0x2cd0,0x8a));var _0x02cd=function(_0x4a3559,_0x42c32e){_0x4a3559=_0x4a3559-0x0;var _0xd8982e=_0x2cd0[_0x4a3559];return _0xd8982e;};'use strict';var Sequelize=require(_0x02cd('0x0'));module[_0x02cd('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x02cd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x02cd('0x2')]},'clientSecret':{'type':Sequelize[_0x02cd('0x2')]},'serverUrl':{'type':Sequelize[_0x02cd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x02cd('0x2')]},'modernAuthentication':{'type':Sequelize[_0x02cd('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa7e6=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2d8d12,_0x5ec696){var _0x3c2473=function(_0x26fb3a){while(--_0x26fb3a){_0x2d8d12['push'](_0x2d8d12['shift']());}};_0x3c2473(++_0x5ec696);}(_0xa7e6,0x74));var _0x6a7e=function(_0x423356,_0x555fd6){_0x423356=_0x423356-0x0;var _0x523fe5=_0xa7e6[_0x423356];return _0x523fe5;};'use strict';var Sequelize=require(_0x6a7e('0x0'));module[_0x6a7e('0x1')]={'name':{'type':Sequelize[_0x6a7e('0x2')]},'username':{'type':Sequelize[_0x6a7e('0x2')]},'password':{'type':Sequelize[_0x6a7e('0x2')]},'remoteUri':{'type':Sequelize[_0x6a7e('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6a7e('0x2')]},'clientSecret':{'type':Sequelize[_0x6a7e('0x2')]},'serverUrl':{'type':Sequelize[_0x6a7e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6a7e('0x2')]},'modernAuthentication':{'type':Sequelize[_0x6a7e('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 cd434cd..486c532 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 _0xc543=['addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','title','customerid','ownerid','subject','regardingobjectid','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','username','GET','Bearer\x20','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','forEach','@odata.type','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','statusCode','send','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../config/logger','api','../../components/integrations/configuration','json','offset','undefined','count','limit','status','update','then','sendStatus','error','stack','name','map','rawAttributes','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration'];(function(_0x1848d0,_0x2b6b97){var _0x3344d8=function(_0x83411d){while(--_0x83411d){_0x1848d0['push'](_0x1848d0['shift']());}};_0x3344d8(++_0x2b6b97);}(_0xc543,0x139));var _0x3c54=function(_0x280966,_0x414a3a){_0x280966=_0x280966-0x0;var _0x5e6379=_0xc543[_0x280966];return _0x5e6379;};'use strict';var rp=require(_0x3c54('0x0'));var util=require(_0x3c54('0x1'));var _=require(_0x3c54('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x3c54('0x3'))(_0x3c54('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3c54('0x5'));function respondWithResult(_0x59288f,_0x30b348){_0x30b348=_0x30b348||0xc8;return function(_0x3d8ad0){if(_0x3d8ad0){return _0x59288f['status'](_0x30b348)[_0x3c54('0x6')](_0x3d8ad0);}};}function respondWithFilteredResult(_0xafcfa4,_0x4215e8){return function(_0x39fdb2){if(_0x39fdb2){var _0x4e13b3=typeof _0x4215e8[_0x3c54('0x7')]===_0x3c54('0x8')&&typeof _0x4215e8['limit']===_0x3c54('0x8');var _0x10789c=_0x39fdb2[_0x3c54('0x9')];var _0x5effd2=_0x4e13b3?0x0:_0x4215e8[_0x3c54('0x7')];var _0x5037ee=_0x4e13b3?_0x39fdb2[_0x3c54('0x9')]:_0x4215e8[_0x3c54('0x7')]+_0x4215e8[_0x3c54('0xa')];var _0x3f6707;if(_0x5037ee>=_0x10789c){_0x5037ee=_0x10789c;_0x3f6707=0xc8;}else{_0x3f6707=0xce;}_0xafcfa4[_0x3c54('0xb')](_0x3f6707);return _0xafcfa4['set']('Content-Range',_0x5effd2+'-'+_0x5037ee+'/'+_0x10789c)['json'](_0x39fdb2);}return null;};}function saveUpdates(_0x568f52){return function(_0x1b8cfc){if(_0x1b8cfc){return _0x1b8cfc[_0x3c54('0xc')](_0x568f52)[_0x3c54('0xd')](function(_0x665597){return _0x665597;});}return null;};}function removeEntity(_0x2bd82f){return function(_0x1af68f){if(_0x1af68f){return _0x1af68f['destroy']()[_0x3c54('0xd')](function(){_0x2bd82f[_0x3c54('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3e8f){return function(_0x4008a0){if(!_0x4008a0){_0x3b3e8f[_0x3c54('0xe')](0x194);}return _0x4008a0;};}function handleError(_0x531ca3,_0x22eb27){_0x22eb27=_0x22eb27||0x1f4;return function(_0x7b9cd3){logger[_0x3c54('0xf')](_0x7b9cd3[_0x3c54('0x10')]);if(_0x7b9cd3['name']){delete _0x7b9cd3[_0x3c54('0x11')];}_0x531ca3['status'](_0x22eb27)['send'](_0x7b9cd3);};}exports['index']=function(_0x59de5e,_0xbe1bf0){var _0x21af38={},_0x3d6a49={},_0x57dded={'count':0x0,'rows':[]};var _0x30b381=_[_0x3c54('0x12')](db['Dynamics365Account'][_0x3c54('0x13')],function(_0x2126b8){return{'name':_0x2126b8['fieldName'],'type':_0x2126b8[_0x3c54('0x14')][_0x3c54('0x15')]};});_0x3d6a49['model']=_[_0x3c54('0x12')](_0x30b381,_0x3c54('0x11'));_0x3d6a49[_0x3c54('0x16')]=_[_0x3c54('0x17')](_0x59de5e[_0x3c54('0x16')]);_0x3d6a49['filters']=_['intersection'](_0x3d6a49[_0x3c54('0x18')],_0x3d6a49[_0x3c54('0x16')]);_0x21af38[_0x3c54('0x19')]=_['intersection'](_0x3d6a49['model'],qs[_0x3c54('0x1a')](_0x59de5e['query']['fields']));_0x21af38['attributes']=_0x21af38[_0x3c54('0x19')][_0x3c54('0x1b')]?_0x21af38[_0x3c54('0x19')]:_0x3d6a49[_0x3c54('0x18')];if(!_0x59de5e['query'][_0x3c54('0x1c')](_0x3c54('0x1d'))){_0x21af38[_0x3c54('0xa')]=qs['limit'](_0x59de5e[_0x3c54('0x16')][_0x3c54('0xa')]);_0x21af38[_0x3c54('0x7')]=qs[_0x3c54('0x7')](_0x59de5e[_0x3c54('0x16')]['offset']);}_0x21af38[_0x3c54('0x1e')]=qs[_0x3c54('0x1f')](_0x59de5e[_0x3c54('0x16')][_0x3c54('0x1f')]);_0x21af38['where']=qs[_0x3c54('0x20')](_[_0x3c54('0x21')](_0x59de5e[_0x3c54('0x16')],_0x3d6a49['filters']),_0x30b381);if(_0x59de5e['query'][_0x3c54('0x22')]){_0x21af38[_0x3c54('0x23')]=_[_0x3c54('0x24')](_0x21af38['where'],{'$or':_[_0x3c54('0x12')](_0x30b381,function(_0x1a62cf){if(_0x1a62cf[_0x3c54('0x14')]!==_0x3c54('0x25')){var _0x3dd1fc={};_0x3dd1fc[_0x1a62cf[_0x3c54('0x11')]]={'$like':'%'+_0x59de5e['query'][_0x3c54('0x22')]+'%'};return _0x3dd1fc;}})});}_0x21af38=_['merge']({},_0x21af38,_0x59de5e[_0x3c54('0x26')]);var _0x1e9c7c={'where':_0x21af38[_0x3c54('0x23')]};return db[_0x3c54('0x27')][_0x3c54('0x9')](_0x1e9c7c)['then'](function(_0x294428){_0x57dded[_0x3c54('0x9')]=_0x294428;if(_0x59de5e[_0x3c54('0x16')][_0x3c54('0x28')]){_0x21af38[_0x3c54('0x29')]=[{'all':!![]}];}return db[_0x3c54('0x27')][_0x3c54('0x2a')](_0x21af38);})[_0x3c54('0xd')](function(_0x3bdf71){_0x57dded[_0x3c54('0x2b')]=_0x3bdf71;return _0x57dded;})[_0x3c54('0xd')](respondWithFilteredResult(_0xbe1bf0,_0x21af38))[_0x3c54('0x2c')](handleError(_0xbe1bf0,null));};exports[_0x3c54('0x2d')]=function(_0x5bdf19,_0x5d4d3a){var _0x56cb2f={'raw':![],'where':{'id':_0x5bdf19[_0x3c54('0x2e')]['id']}},_0x30a0ff={};_0x30a0ff[_0x3c54('0x18')]=_[_0x3c54('0x17')](db[_0x3c54('0x27')][_0x3c54('0x13')]);_0x30a0ff[_0x3c54('0x16')]=_[_0x3c54('0x17')](_0x5bdf19[_0x3c54('0x16')]);_0x30a0ff[_0x3c54('0x20')]=_[_0x3c54('0x2f')](_0x30a0ff[_0x3c54('0x18')],_0x30a0ff[_0x3c54('0x16')]);_0x56cb2f[_0x3c54('0x19')]=_[_0x3c54('0x2f')](_0x30a0ff[_0x3c54('0x18')],qs['fields'](_0x5bdf19[_0x3c54('0x16')][_0x3c54('0x1a')]));_0x56cb2f[_0x3c54('0x19')]=_0x56cb2f['attributes'][_0x3c54('0x1b')]?_0x56cb2f['attributes']:_0x30a0ff[_0x3c54('0x18')];if(_0x5bdf19['query'][_0x3c54('0x28')]){_0x56cb2f[_0x3c54('0x29')]=[{'all':!![]}];}_0x56cb2f=_[_0x3c54('0x24')]({},_0x56cb2f,_0x5bdf19[_0x3c54('0x26')]);return db[_0x3c54('0x27')][_0x3c54('0x30')](_0x56cb2f)[_0x3c54('0xd')](handleEntityNotFound(_0x5d4d3a,null))['then'](respondWithResult(_0x5d4d3a,null))[_0x3c54('0x2c')](handleError(_0x5d4d3a,null));};exports[_0x3c54('0x31')]=function(_0x40c9f8,_0x36e091){return db[_0x3c54('0x27')][_0x3c54('0x31')](_0x40c9f8[_0x3c54('0x32')],{})[_0x3c54('0xd')](respondWithResult(_0x36e091,0xc9))[_0x3c54('0x2c')](handleError(_0x36e091,null));};exports[_0x3c54('0xc')]=function(_0xe6b849,_0x4355f1){if(_0xe6b849['body']['id']){delete _0xe6b849[_0x3c54('0x32')]['id'];}return db[_0x3c54('0x27')][_0x3c54('0x30')]({'where':{'id':_0xe6b849[_0x3c54('0x2e')]['id']}})[_0x3c54('0xd')](handleEntityNotFound(_0x4355f1,null))[_0x3c54('0xd')](saveUpdates(_0xe6b849['body'],null))[_0x3c54('0xd')](respondWithResult(_0x4355f1,null))[_0x3c54('0x2c')](handleError(_0x4355f1,null));};exports[_0x3c54('0x33')]=function(_0x5e21f4,_0x55a968){return db[_0x3c54('0x27')][_0x3c54('0x30')]({'where':{'id':_0x5e21f4[_0x3c54('0x2e')]['id']}})[_0x3c54('0xd')](handleEntityNotFound(_0x55a968,null))[_0x3c54('0xd')](removeEntity(_0x55a968,null))[_0x3c54('0x2c')](handleError(_0x55a968,null));};exports[_0x3c54('0x34')]=function(_0x57cd4c,_0x4adaf9){var _0x17438a={};var _0x33a957={};var _0x5b81d8;var _0x1ebf86;return db['Dynamics365Account'][_0x3c54('0x35')]({'where':{'id':_0x57cd4c[_0x3c54('0x2e')]['id']}})[_0x3c54('0xd')](handleEntityNotFound(_0x4adaf9,null))[_0x3c54('0xd')](function(_0x53fe8f){if(_0x53fe8f){_0x5b81d8=_0x53fe8f;_0x33a957[_0x3c54('0x18')]=_[_0x3c54('0x17')](db[_0x3c54('0x36')][_0x3c54('0x13')]);_0x33a957['query']=_['keys'](_0x57cd4c['query']);_0x33a957['filters']=_[_0x3c54('0x2f')](_0x33a957[_0x3c54('0x18')],_0x33a957[_0x3c54('0x16')]);_0x17438a[_0x3c54('0x19')]=_[_0x3c54('0x2f')](_0x33a957['model'],qs[_0x3c54('0x1a')](_0x57cd4c[_0x3c54('0x16')][_0x3c54('0x1a')]));_0x17438a['attributes']=_0x17438a[_0x3c54('0x19')][_0x3c54('0x1b')]?_0x17438a[_0x3c54('0x19')]:_0x33a957[_0x3c54('0x18')];_0x17438a['order']=qs['sort'](_0x57cd4c[_0x3c54('0x16')][_0x3c54('0x1f')]);_0x17438a[_0x3c54('0x23')]=qs[_0x3c54('0x20')](_[_0x3c54('0x21')](_0x57cd4c[_0x3c54('0x16')],_0x33a957[_0x3c54('0x20')]));if(_0x57cd4c[_0x3c54('0x16')]['filter']){_0x17438a['where']=_['merge'](_0x17438a['where'],{'$or':_[_0x3c54('0x12')](_0x17438a[_0x3c54('0x19')],function(_0x58cacc){var _0x128b32={};_0x128b32[_0x58cacc]={'$like':'%'+_0x57cd4c[_0x3c54('0x16')][_0x3c54('0x22')]+'%'};return _0x128b32;})});}_0x17438a=_[_0x3c54('0x24')]({},_0x17438a,_0x57cd4c[_0x3c54('0x26')]);return _0x5b81d8[_0x3c54('0x34')](_0x17438a);}})[_0x3c54('0xd')](function(_0x4d16e8){if(_0x4d16e8){_0x1ebf86=_0x4d16e8[_0x3c54('0x1b')];if(!_0x57cd4c['query']['hasOwnProperty'](_0x3c54('0x1d'))){_0x17438a[_0x3c54('0xa')]=qs[_0x3c54('0xa')](_0x57cd4c[_0x3c54('0x16')][_0x3c54('0xa')]);_0x17438a[_0x3c54('0x7')]=qs['offset'](_0x57cd4c[_0x3c54('0x16')][_0x3c54('0x7')]);}return _0x5b81d8[_0x3c54('0x34')](_0x17438a);}})[_0x3c54('0xd')](function(_0x1c519c){if(_0x1c519c){return _0x1c519c?{'count':_0x1ebf86,'rows':_0x1c519c}:null;}})[_0x3c54('0xd')](respondWithResult(_0x4adaf9,null))['catch'](handleError(_0x4adaf9,null));};exports[_0x3c54('0x37')]=function(_0x5d04d6,_0x152e71){if(_0x5d04d6[_0x3c54('0x32')]['id']){delete _0x5d04d6[_0x3c54('0x32')]['id'];}return db['Dynamics365Account'][_0x3c54('0x35')]({'where':{'id':_0x5d04d6[_0x3c54('0x2e')]['id']}})['then'](handleEntityNotFound(_0x152e71,null))[_0x3c54('0xd')](function(_0x43a515){if(_0x43a515){_0x5d04d6[_0x3c54('0x32')][_0x3c54('0x38')]=_0x43a515['id'];_0x5d04d6[_0x3c54('0x32')][_0x3c54('0x39')]=integrations[_0x3c54('0x3a')](_0x5d04d6['body']['channel'],_0x5d04d6[_0x3c54('0x32')]['type']);_0x5d04d6[_0x3c54('0x32')][_0x3c54('0x3b')]=integrations[_0x3c54('0x3c')](_0x5d04d6[_0x3c54('0x32')][_0x3c54('0x3d')],_0x5d04d6['body'][_0x3c54('0x14')]);return db[_0x3c54('0x36')][_0x3c54('0x31')](_0x5d04d6[_0x3c54('0x32')],{'include':[{'model':db[_0x3c54('0x3e')],'as':_0x3c54('0x39')},{'model':db[_0x3c54('0x3e')],'as':_0x3c54('0x3b')}]});}return null;})[_0x3c54('0xd')](respondWithResult(_0x152e71,null))[_0x3c54('0x2c')](handleError(_0x152e71,null));};function sanitizeRemoteUri(_0x358d09){var _0x56f137=_0x358d09[_0x3c54('0x3f')](-0x1);if(_0x56f137==='/')return _0x358d09[_0x3c54('0x40')](0x0,_0x358d09[_0x3c54('0x41')](_0x56f137));return _0x358d09;}function getWebApiUrl(_0x4d621b){return util[_0x3c54('0x42')](_0x3c54('0x43'),_0x4d621b);}exports[_0x3c54('0x44')]=function(_0x38c5db,_0x314919){var _0x590c04=_0x38c5db[_0x3c54('0x16')][_0x3c54('0x45')];var _0x3767bf=_0x590c04==='incident'?_0x3c54('0x46'):_0x3c54('0x47');var _0xebe29f='';var _0x1a8f4f='';var _0x2f0767='';var _0x404933='';var _0x1a7749='';var _0x1f4022='';var _0x2b1a3d='';var _0x14c03e='';var _0x398a3e=[_0x3c54('0x48'),'description',_0x3c54('0x49'),_0x3c54('0x4a'),'caseorigincode',_0x3c54('0x4b'),'phonenumber',_0x3c54('0x4c'),'directioncode','phonecall_activity_parties'];var _0x22b79a=['accountidname','accountidyominame',_0x3c54('0x4d'),'billedserviceunits',_0x3c54('0x4e'),'contactidyominame',_0x3c54('0x4f'),_0x3c54('0x50'),_0x3c54('0x51'),_0x3c54('0x52'),'createdbyname',_0x3c54('0x53'),_0x3c54('0x54'),_0x3c54('0x55'),_0x3c54('0x56'),_0x3c54('0x57'),_0x3c54('0x58'),_0x3c54('0x59'),_0x3c54('0x5a'),_0x3c54('0x5b'),_0x3c54('0x5c'),_0x3c54('0x5d'),_0x3c54('0x5e'),_0x3c54('0x5f'),_0x3c54('0x60'),_0x3c54('0x61'),_0x3c54('0x62'),_0x3c54('0x63'),_0x3c54('0x64'),_0x3c54('0x65'),_0x3c54('0x66'),_0x3c54('0x67'),'modifiedbyexternalpartyyominame',_0x3c54('0x68'),_0x3c54('0x69'),'modifiedon',_0x3c54('0x6a'),_0x3c54('0x6b'),_0x3c54('0x6c'),_0x3c54('0x6d'),_0x3c54('0x6e'),_0x3c54('0x6f'),_0x3c54('0x70'),_0x3c54('0x71'),'owneridtype',_0x3c54('0x72'),_0x3c54('0x73'),'primarycontactidname',_0x3c54('0x74'),'prioritycodename',_0x3c54('0x75'),_0x3c54('0x76'),_0x3c54('0x77'),_0x3c54('0x78'),'responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue',_0x3c54('0x79'),_0x3c54('0x7a'),_0x3c54('0x7b'),_0x3c54('0x7c'),_0x3c54('0x7d'),'subjectidname','ticketnumber',_0x3c54('0x7e'),_0x3c54('0x7f'),_0x3c54('0x80'),_0x3c54('0x81'),_0x3c54('0x82')];var _0x208597=_0x398a3e[_0x3c54('0x83')](_0x22b79a);return db[_0x3c54('0x27')]['findOne']({'where':{'id':_0x38c5db['params']['id']},'attributes':['id','username',_0x3c54('0x84'),_0x3c54('0x85'),_0x3c54('0x86'),_0x3c54('0x87'),_0x3c54('0x88'),_0x3c54('0x89')],'include':[{'model':db['CloudProvider'],'as':_0x3c54('0x8a'),'attributes':['id','data5',_0x3c54('0x8b')]}]})[_0x3c54('0xd')](handleEntityNotFound(_0x314919,null))[_0x3c54('0xd')](function(_0x3f3c56){if(_0x3f3c56){if(_0x3f3c56[_0x3c54('0x89')]){_0x3f3c56[_0x3c54('0x8c')]=_0x3f3c56['CloudProvider'][_0x3c54('0x8d')];_0x14c03e=sanitizeRemoteUri(_0x3f3c56[_0x3c54('0x8a')][_0x3c54('0x8b')]);_0x2b1a3d=getWebApiUrl(_0x14c03e);return _0x3f3c56;}_0x14c03e=sanitizeRemoteUri(_0x3f3c56['remoteUri']);_0x2b1a3d=getWebApiUrl(_0x14c03e);var _0x3d6284={'method':_0x3c54('0x8e'),'uri':_0x3c54('0x8f')+_0x3f3c56[_0x3c54('0x86')]+'/oauth2/token','form':{'client_id':_0x3f3c56[_0x3c54('0x87')],'resource':_0x14c03e,'username':_0x3f3c56[_0x3c54('0x90')],'password':_0x3f3c56[_0x3c54('0x84')],'grant_type':'password','client_secret':_0x3f3c56[_0x3c54('0x88')]},'json':!![]};return rp(_0x3d6284);}})[_0x3c54('0xd')](function(_0x42f4a6){_0x1f4022=_0x42f4a6['access_token'];var _0x5042a7={'method':_0x3c54('0x91'),'uri':encodeURI(_0x2b1a3d+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3767bf+'\x27'),'headers':{'Authorization':_0x3c54('0x92')+_0x1f4022,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5042a7);})[_0x3c54('0xd')](function(_0x5af8bb){var _0x497f72=_0x5af8bb['value'][0x0];var _0x4ab31c=_0x497f72[_0x3c54('0x93')];var _0x5e768d={'method':'GET','uri':_0x2b1a3d+'EntityDefinitions('+_0x4ab31c+_0x3c54('0x94'),'headers':{'Authorization':_0x3c54('0x92')+_0x1f4022,'If-None-Match':null,'OData-Version':_0x3c54('0x95')},'json':!![]};return rp(_0x5e768d);})[_0x3c54('0xd')](function(_0xf6e25c){_0xebe29f=_0xf6e25c;_0x1a8f4f=_0xebe29f[_0x3c54('0x96')];_0x1a8f4f=_[_0x3c54('0x97')](_0x1a8f4f,function(_0x1f774d){return!_0x208597[_0x3c54('0x98')](_0x1f774d['LogicalName']);});var _0x4e0083=[];var _0x186e86=[];_0x1a8f4f[_0x3c54('0x99')](function(_0x1f3a93){if(_0x1f3a93[_0x3c54('0x9a')]){var _0x32a775=_0x1f3a93[_0x3c54('0x9a')]['substring'](_0x1f3a93['@odata.type']['lastIndexOf']('.')+0x1);if(_0x32a775==='PicklistAttributeMetadata'){_0x4e0083['push'](getSelectList(_0x2b1a3d,_0x590c04,_0x186e86,_0xebe29f[_0x3c54('0x93')],_0x1f3a93[_0x3c54('0x93')],_0x1f4022));}}});return Promise[_0x3c54('0x9b')](_0x4e0083);})['then'](function(_0x2fdd8c){_0x2f0767=_0x2fdd8c[0x0];var _0x1d790f=[];var _0x532351=[];_0x1a8f4f[_0x3c54('0x99')](function(_0x2ca01c){if(!_[_0x3c54('0x9c')](_0x2ca01c[_0x3c54('0x9a')])){var _0x59e341=_0x2ca01c[_0x3c54('0x9a')][_0x3c54('0x40')](_0x2ca01c['@odata.type']['lastIndexOf']('.')+0x1);if(_0x59e341===_0x3c54('0x9d')){_0x1d790f[_0x3c54('0x9e')](getBooleanList(_0x2b1a3d,_0x590c04,_0x532351,_0xebe29f['MetadataId'],_0x2ca01c[_0x3c54('0x93')],_0x1f4022));}}});return Promise[_0x3c54('0x9b')](_0x1d790f);})[_0x3c54('0xd')](function(_0x45c6c1){_0x404933=_0x45c6c1[0x0];var _0x416a95=[];var _0xbe3089=[];_0x1a8f4f[_0x3c54('0x99')](function(_0x225590){if(_0x225590[_0x3c54('0x9a')]){var _0x4e91ae=_0x225590[_0x3c54('0x9a')][_0x3c54('0x40')](_0x225590[_0x3c54('0x9a')]['lastIndexOf']('.')+0x1);if(_0x4e91ae===_0x3c54('0x9f')||_0x4e91ae===_0x3c54('0xa0')||_0x4e91ae===_0x3c54('0xa1')||_0x4e91ae===_0x3c54('0xa2')||_0x4e91ae==='MemoAttributeMetadata'||_0x4e91ae===_0x3c54('0xa3')||_0x4e91ae===_0x3c54('0xa4')||_0x4e91ae===_0x3c54('0xa5')||_0x4e91ae===_0x3c54('0xa6')||_0x4e91ae==='DecimalAttributeMetadata'){_0x416a95[_0x3c54('0x9e')](getInputList(_0x2b1a3d,_0x590c04,_0x4e91ae,_0xbe3089,_0xebe29f[_0x3c54('0x93')],_0x225590[_0x3c54('0x93')],_0x1f4022));}}});return Promise[_0x3c54('0x9b')](_0x416a95);})[_0x3c54('0xd')](function(_0x4bfa69){_0x1a7749=_0x4bfa69[0x0];var _0x5b000e=_0x2f0767['concat'](_0x404933)[_0x3c54('0x83')](_0x1a7749);var _0x1d2665={'count':_0x5b000e[_0x3c54('0x1b')],'rows':_0x5b000e};return _0x1d2665;})[_0x3c54('0xd')](respondWithResult(_0x314919,null))[_0x3c54('0x2c')](function(_0x150ef3){var _0x434447=_0x38c5db[_0x3c54('0x16')]['test']?0x1f4:_0x150ef3[_0x3c54('0xa7')]||0x1f4;logger['error'](_0x150ef3[_0x3c54('0x10')]);delete _0x150ef3[_0x3c54('0x11')];if(_0x434447===0x191){_0x434447=0x190;}_0x314919[_0x3c54('0xb')](_0x434447)[_0x3c54('0xa8')](_0x38c5db['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x150ef3[_0x3c54('0xa7')]}:_0x150ef3);});};function getSelectList(_0x16296b,_0x4c13c3,_0x54b483,_0xdd3831,_0x3e818d,_0x31883c){var _0x5f4582={'method':_0x3c54('0x91'),'uri':_0x16296b+_0x3c54('0xa9')+_0xdd3831+_0x3c54('0xaa')+_0x3e818d+_0x3c54('0xab')+_0x3c54('0xac'),'headers':{'Authorization':_0x3c54('0x92')+_0x31883c,'If-None-Match':null,'OData-Version':_0x3c54('0x95')},'json':!![]};return rp(_0x5f4582)[_0x3c54('0xd')](function(_0x832ab0){var _0x11ffcc=[];var _0x1ce9f9=_0x832ab0[_0x3c54('0xad')]['Options'];_0x1ce9f9['forEach'](function(_0x38de95){_0x11ffcc[_0x3c54('0x9e')]({'name':_0x38de95[_0x3c54('0xae')][_0x3c54('0xaf')][_0x3c54('0xae')],'value':String(_0x38de95[_0x3c54('0xb0')])});});var _0x220bd2={'id':_0x4c13c3+'_'+_0x832ab0[_0x3c54('0xb1')],'name':_0x832ab0[_0x3c54('0xb2')]['UserLocalizedLabel'][_0x3c54('0xae')],'custom':![],'options':_0x11ffcc};_0x54b483[_0x3c54('0x9e')](_0x220bd2);return _0x54b483;});}function getBooleanList(_0x24b0c8,_0x3b0fc4,_0x4e8416,_0x5f511f,_0x5f9502,_0x4e1771){var _0x109b64={'method':_0x3c54('0x91'),'uri':_0x24b0c8+_0x3c54('0xa9')+_0x5f511f+_0x3c54('0xaa')+_0x5f9502+_0x3c54('0xb3'),'headers':{'Authorization':_0x3c54('0x92')+_0x4e1771,'If-None-Match':null,'OData-Version':_0x3c54('0x95')},'json':!![]};return rp(_0x109b64)[_0x3c54('0xd')](function(_0x336f5f){var _0x52655b=[];_0x52655b[_0x3c54('0x9e')]({'name':_0x336f5f[_0x3c54('0xad')][_0x3c54('0xb4')][_0x3c54('0xae')]['UserLocalizedLabel'][_0x3c54('0xae')],'value':_0x3c54('0xb5')},{'name':_0x336f5f['OptionSet'][_0x3c54('0xb6')][_0x3c54('0xae')][_0x3c54('0xaf')][_0x3c54('0xae')],'value':'false'});var _0x320b41={'id':_0x3b0fc4+'_'+_0x336f5f[_0x3c54('0xb1')],'name':_0x336f5f[_0x3c54('0xb2')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x52655b};_0x4e8416['push'](_0x320b41);return _0x4e8416;});}function getInputList(_0x3ee9b1,_0x5b5600,_0x5e1854,_0x439227,_0x1d3273,_0x2ea9fa,_0xfb952a){var _0x4b6f8c={'method':_0x3c54('0x91'),'uri':_0x3ee9b1+_0x3c54('0xa9')+_0x1d3273+')/Attributes('+_0x2ea9fa+_0x3c54('0xb7')+_0x5e1854+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x3c54('0x92')+_0xfb952a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4b6f8c)[_0x3c54('0xd')](function(_0x5bb80b){var _0x34c8c7={'id':_0x5b5600+'_'+_0x5bb80b[_0x3c54('0xb1')],'name':_0x5bb80b[_0x3c54('0xb2')]['UserLocalizedLabel']?_0x5bb80b[_0x3c54('0xb2')][_0x3c54('0xaf')][_0x3c54('0xae')]:_0x5bb80b[_0x3c54('0xb1')],'custom':![],'options':[]};_0x439227['push'](_0x34c8c7);return _0x439227;});} \ No newline at end of file +var _0xb961=['billedserviceunits','contactidname','contactidyominame','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data7','modernAuthentication','access_token','data5','POST','/oauth2/token','username','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','all','test',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','count','limit','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','key','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','directioncode','phonecall_activity_parties','accountidname'];(function(_0x4a7ab2,_0x1cfce9){var _0x4642e7=function(_0x18a51c){while(--_0x18a51c){_0x4a7ab2['push'](_0x4a7ab2['shift']());}};_0x4642e7(++_0x1cfce9);}(_0xb961,0x114));var _0x1b96=function(_0x4eb6fe,_0x318f6c){_0x4eb6fe=_0x4eb6fe-0x0;var _0x17ce75=_0xb961[_0x4eb6fe];return _0x17ce75;};'use strict';var rp=require(_0x1b96('0x0'));var util=require(_0x1b96('0x1'));var _=require(_0x1b96('0x2'));var qs=require(_0x1b96('0x3'));var logger=require('../../config/logger')(_0x1b96('0x4'));var db=require(_0x1b96('0x5'))['db'];var integrations=require(_0x1b96('0x6'));function respondWithResult(_0x350ac2,_0x45aea7){_0x45aea7=_0x45aea7||0xc8;return function(_0x3f62f9){if(_0x3f62f9){return _0x350ac2[_0x1b96('0x7')](_0x45aea7)['json'](_0x3f62f9);}};}function respondWithFilteredResult(_0x2662ce,_0x323469){return function(_0x2af5f0){if(_0x2af5f0){var _0x474491=typeof _0x323469[_0x1b96('0x8')]===_0x1b96('0x9')&&typeof _0x323469['limit']===_0x1b96('0x9');var _0x3732c3=_0x2af5f0[_0x1b96('0xa')];var _0x43cd97=_0x474491?0x0:_0x323469['offset'];var _0x3bf8e0=_0x474491?_0x2af5f0[_0x1b96('0xa')]:_0x323469[_0x1b96('0x8')]+_0x323469[_0x1b96('0xb')];var _0xfab0f3;if(_0x3bf8e0>=_0x3732c3){_0x3bf8e0=_0x3732c3;_0xfab0f3=0xc8;}else{_0xfab0f3=0xce;}_0x2662ce[_0x1b96('0x7')](_0xfab0f3);return _0x2662ce[_0x1b96('0xc')]('Content-Range',_0x43cd97+'-'+_0x3bf8e0+'/'+_0x3732c3)['json'](_0x2af5f0);}return null;};}function saveUpdates(_0x595480){return function(_0x28d0bb){if(_0x28d0bb){return _0x28d0bb[_0x1b96('0xd')](_0x595480)[_0x1b96('0xe')](function(_0x482ed0){return _0x482ed0;});}return null;};}function removeEntity(_0x1b71ce){return function(_0x4de085){if(_0x4de085){return _0x4de085[_0x1b96('0xf')]()[_0x1b96('0xe')](function(){_0x1b71ce['status'](0xcc)[_0x1b96('0x10')]();});}};}function handleEntityNotFound(_0x5ea342){return function(_0x25ffae){if(!_0x25ffae){_0x5ea342[_0x1b96('0x11')](0x194);}return _0x25ffae;};}function handleError(_0x499a5f,_0x45ec61){_0x45ec61=_0x45ec61||0x1f4;return function(_0xb6d2a2){logger[_0x1b96('0x12')](_0xb6d2a2[_0x1b96('0x13')]);if(_0xb6d2a2[_0x1b96('0x14')]){delete _0xb6d2a2[_0x1b96('0x14')];}_0x499a5f[_0x1b96('0x7')](_0x45ec61)[_0x1b96('0x15')](_0xb6d2a2);};}exports[_0x1b96('0x16')]=function(_0x14673a,_0xc26967){var _0xa412c2={},_0x43c195={},_0x58715f={'count':0x0,'rows':[]};var _0x112a05=_[_0x1b96('0x17')](db[_0x1b96('0x18')]['rawAttributes'],function(_0x349f7c){return{'name':_0x349f7c[_0x1b96('0x19')],'type':_0x349f7c[_0x1b96('0x1a')][_0x1b96('0x1b')]};});_0x43c195['model']=_[_0x1b96('0x17')](_0x112a05,'name');_0x43c195[_0x1b96('0x1c')]=_['keys'](_0x14673a['query']);_0x43c195['filters']=_['intersection'](_0x43c195[_0x1b96('0x1d')],_0x43c195[_0x1b96('0x1c')]);_0xa412c2['attributes']=_[_0x1b96('0x1e')](_0x43c195[_0x1b96('0x1d')],qs[_0x1b96('0x1f')](_0x14673a[_0x1b96('0x1c')]['fields']));_0xa412c2[_0x1b96('0x20')]=_0xa412c2[_0x1b96('0x20')][_0x1b96('0x21')]?_0xa412c2[_0x1b96('0x20')]:_0x43c195[_0x1b96('0x1d')];if(!_0x14673a[_0x1b96('0x1c')][_0x1b96('0x22')](_0x1b96('0x23'))){_0xa412c2[_0x1b96('0xb')]=qs[_0x1b96('0xb')](_0x14673a[_0x1b96('0x1c')][_0x1b96('0xb')]);_0xa412c2[_0x1b96('0x8')]=qs[_0x1b96('0x8')](_0x14673a[_0x1b96('0x1c')][_0x1b96('0x8')]);}_0xa412c2[_0x1b96('0x24')]=qs[_0x1b96('0x25')](_0x14673a[_0x1b96('0x1c')][_0x1b96('0x25')]);_0xa412c2[_0x1b96('0x26')]=qs[_0x1b96('0x27')](_[_0x1b96('0x28')](_0x14673a[_0x1b96('0x1c')],_0x43c195[_0x1b96('0x27')]),_0x112a05);if(_0x14673a['query'][_0x1b96('0x29')]){_0xa412c2[_0x1b96('0x26')]=_[_0x1b96('0x2a')](_0xa412c2[_0x1b96('0x26')],{'$or':_[_0x1b96('0x17')](_0x112a05,function(_0x58dabf){if(_0x58dabf[_0x1b96('0x1a')]!=='VIRTUAL'){var _0x391b08={};_0x391b08[_0x58dabf[_0x1b96('0x14')]]={'$like':'%'+_0x14673a[_0x1b96('0x1c')][_0x1b96('0x29')]+'%'};return _0x391b08;}})});}_0xa412c2=_[_0x1b96('0x2a')]({},_0xa412c2,_0x14673a[_0x1b96('0x2b')]);var _0x4d3141={'where':_0xa412c2[_0x1b96('0x26')]};return db[_0x1b96('0x18')][_0x1b96('0xa')](_0x4d3141)['then'](function(_0x41f694){_0x58715f[_0x1b96('0xa')]=_0x41f694;if(_0x14673a[_0x1b96('0x1c')][_0x1b96('0x2c')]){_0xa412c2['include']=[{'all':!![]}];}return db[_0x1b96('0x18')][_0x1b96('0x2d')](_0xa412c2);})['then'](function(_0x111219){_0x58715f[_0x1b96('0x2e')]=_0x111219;return _0x58715f;})[_0x1b96('0xe')](respondWithFilteredResult(_0xc26967,_0xa412c2))[_0x1b96('0x2f')](handleError(_0xc26967,null));};exports[_0x1b96('0x30')]=function(_0x3848e1,_0x3b4afa){var _0x9dc2d3={'raw':![],'where':{'id':_0x3848e1['params']['id']}},_0x328aa6={};_0x328aa6[_0x1b96('0x1d')]=_[_0x1b96('0x31')](db[_0x1b96('0x18')][_0x1b96('0x32')]);_0x328aa6[_0x1b96('0x1c')]=_[_0x1b96('0x31')](_0x3848e1[_0x1b96('0x1c')]);_0x328aa6['filters']=_[_0x1b96('0x1e')](_0x328aa6[_0x1b96('0x1d')],_0x328aa6[_0x1b96('0x1c')]);_0x9dc2d3[_0x1b96('0x20')]=_[_0x1b96('0x1e')](_0x328aa6[_0x1b96('0x1d')],qs['fields'](_0x3848e1[_0x1b96('0x1c')][_0x1b96('0x1f')]));_0x9dc2d3[_0x1b96('0x20')]=_0x9dc2d3['attributes'][_0x1b96('0x21')]?_0x9dc2d3[_0x1b96('0x20')]:_0x328aa6[_0x1b96('0x1d')];if(_0x3848e1[_0x1b96('0x1c')]['includeAll']){_0x9dc2d3[_0x1b96('0x33')]=[{'all':!![]}];}_0x9dc2d3=_[_0x1b96('0x2a')]({},_0x9dc2d3,_0x3848e1['options']);return db[_0x1b96('0x18')][_0x1b96('0x34')](_0x9dc2d3)['then'](handleEntityNotFound(_0x3b4afa,null))[_0x1b96('0xe')](respondWithResult(_0x3b4afa,null))[_0x1b96('0x2f')](handleError(_0x3b4afa,null));};exports[_0x1b96('0x35')]=function(_0x3db016,_0x1aa650){return db[_0x1b96('0x18')][_0x1b96('0x35')](_0x3db016[_0x1b96('0x36')],{})[_0x1b96('0xe')](respondWithResult(_0x1aa650,0xc9))[_0x1b96('0x2f')](handleError(_0x1aa650,null));};exports[_0x1b96('0xd')]=function(_0x3becdb,_0x5abca6){if(_0x3becdb[_0x1b96('0x36')]['id']){delete _0x3becdb[_0x1b96('0x36')]['id'];}return db[_0x1b96('0x18')][_0x1b96('0x34')]({'where':{'id':_0x3becdb[_0x1b96('0x37')]['id']}})[_0x1b96('0xe')](handleEntityNotFound(_0x5abca6,null))[_0x1b96('0xe')](saveUpdates(_0x3becdb['body'],null))[_0x1b96('0xe')](respondWithResult(_0x5abca6,null))[_0x1b96('0x2f')](handleError(_0x5abca6,null));};exports['destroy']=function(_0x5c00e6,_0x5eb22d){return db[_0x1b96('0x18')][_0x1b96('0x34')]({'where':{'id':_0x5c00e6[_0x1b96('0x37')]['id']}})[_0x1b96('0xe')](handleEntityNotFound(_0x5eb22d,null))[_0x1b96('0xe')](removeEntity(_0x5eb22d,null))['catch'](handleError(_0x5eb22d,null));};exports['getConfigurations']=function(_0x59b87,_0x508a46){var _0x3da50e={};var _0x2fda3d={};var _0x550f53;var _0x1b97c2;return db['Dynamics365Account'][_0x1b96('0x38')]({'where':{'id':_0x59b87[_0x1b96('0x37')]['id']}})['then'](handleEntityNotFound(_0x508a46,null))['then'](function(_0x1561ff){if(_0x1561ff){_0x550f53=_0x1561ff;_0x2fda3d[_0x1b96('0x1d')]=_['keys'](db['Dynamics365Configuration'][_0x1b96('0x32')]);_0x2fda3d[_0x1b96('0x1c')]=_[_0x1b96('0x31')](_0x59b87[_0x1b96('0x1c')]);_0x2fda3d['filters']=_[_0x1b96('0x1e')](_0x2fda3d['model'],_0x2fda3d[_0x1b96('0x1c')]);_0x3da50e[_0x1b96('0x20')]=_[_0x1b96('0x1e')](_0x2fda3d[_0x1b96('0x1d')],qs[_0x1b96('0x1f')](_0x59b87['query'][_0x1b96('0x1f')]));_0x3da50e['attributes']=_0x3da50e['attributes'][_0x1b96('0x21')]?_0x3da50e['attributes']:_0x2fda3d[_0x1b96('0x1d')];_0x3da50e['order']=qs[_0x1b96('0x25')](_0x59b87[_0x1b96('0x1c')][_0x1b96('0x25')]);_0x3da50e[_0x1b96('0x26')]=qs[_0x1b96('0x27')](_[_0x1b96('0x28')](_0x59b87['query'],_0x2fda3d['filters']));if(_0x59b87[_0x1b96('0x1c')][_0x1b96('0x29')]){_0x3da50e['where']=_[_0x1b96('0x2a')](_0x3da50e[_0x1b96('0x26')],{'$or':_[_0x1b96('0x17')](_0x3da50e[_0x1b96('0x20')],function(_0x2ec8f0){var _0x30a4c4={};_0x30a4c4[_0x2ec8f0]={'$like':'%'+_0x59b87[_0x1b96('0x1c')][_0x1b96('0x29')]+'%'};return _0x30a4c4;})});}_0x3da50e=_['merge']({},_0x3da50e,_0x59b87[_0x1b96('0x2b')]);return _0x550f53[_0x1b96('0x39')](_0x3da50e);}})['then'](function(_0x49813b){if(_0x49813b){_0x1b97c2=_0x49813b['length'];if(!_0x59b87[_0x1b96('0x1c')][_0x1b96('0x22')]('nolimit')){_0x3da50e[_0x1b96('0xb')]=qs[_0x1b96('0xb')](_0x59b87[_0x1b96('0x1c')][_0x1b96('0xb')]);_0x3da50e['offset']=qs['offset'](_0x59b87[_0x1b96('0x1c')][_0x1b96('0x8')]);}return _0x550f53[_0x1b96('0x39')](_0x3da50e);}})[_0x1b96('0xe')](function(_0xb817de){if(_0xb817de){return _0xb817de?{'count':_0x1b97c2,'rows':_0xb817de}:null;}})[_0x1b96('0xe')](respondWithResult(_0x508a46,null))['catch'](handleError(_0x508a46,null));};exports[_0x1b96('0x3a')]=function(_0x3ae272,_0x2fb71a){if(_0x3ae272[_0x1b96('0x36')]['id']){delete _0x3ae272[_0x1b96('0x36')]['id'];}return db['Dynamics365Account'][_0x1b96('0x38')]({'where':{'id':_0x3ae272[_0x1b96('0x37')]['id']}})['then'](handleEntityNotFound(_0x2fb71a,null))[_0x1b96('0xe')](function(_0x5a6027){if(_0x5a6027){_0x3ae272[_0x1b96('0x36')][_0x1b96('0x3b')]=_0x5a6027['id'];_0x3ae272[_0x1b96('0x36')][_0x1b96('0x3c')]=integrations[_0x1b96('0x3d')](_0x3ae272[_0x1b96('0x36')][_0x1b96('0x3e')],_0x3ae272[_0x1b96('0x36')][_0x1b96('0x1a')]);_0x3ae272[_0x1b96('0x36')][_0x1b96('0x3f')]=integrations[_0x1b96('0x40')](_0x3ae272[_0x1b96('0x36')][_0x1b96('0x3e')],_0x3ae272['body'][_0x1b96('0x1a')]);return db[_0x1b96('0x41')][_0x1b96('0x35')](_0x3ae272[_0x1b96('0x36')],{'include':[{'model':db[_0x1b96('0x42')],'as':_0x1b96('0x3c')},{'model':db[_0x1b96('0x42')],'as':_0x1b96('0x3f')}]});}return null;})[_0x1b96('0xe')](respondWithResult(_0x2fb71a,null))[_0x1b96('0x2f')](handleError(_0x2fb71a,null));};function sanitizeRemoteUri(_0x5ba58b){var _0xae78cd=_0x5ba58b[_0x1b96('0x43')](-0x1);if(_0xae78cd==='/')return _0x5ba58b[_0x1b96('0x44')](0x0,_0x5ba58b[_0x1b96('0x45')](_0xae78cd));return _0x5ba58b;}function getWebApiUrl(_0x4de472){return util[_0x1b96('0x46')](_0x1b96('0x47'),_0x4de472);}exports[_0x1b96('0x48')]=function(_0x5ba0d4,_0x33ee4e){var _0x1fe8da=_0x5ba0d4[_0x1b96('0x1c')][_0x1b96('0x49')];var _0x5f1345=_0x1fe8da===_0x1b96('0x4a')?_0x1b96('0x4b'):_0x1b96('0x4c');var _0x530aa8='';var _0x26a199='';var _0x4fa78e='';var _0x593027='';var _0x3b5c85='';var _0x2b86a9='';var _0x5fd23b='';var _0x234450='';var _0xcb7f1f=[_0x1b96('0x4d'),_0x1b96('0x4e'),_0x1b96('0x4f'),_0x1b96('0x50'),_0x1b96('0x51'),'subject',_0x1b96('0x52'),'regardingobjectid',_0x1b96('0x53'),_0x1b96('0x54')];var _0x4fbfa3=[_0x1b96('0x55'),'accountidyominame','actualserviceunits',_0x1b96('0x56'),_0x1b96('0x57'),_0x1b96('0x58'),'contractdetailidname','contractidname',_0x1b96('0x59'),_0x1b96('0x5a'),'createdbyname',_0x1b96('0x5b'),'createdon','createdonbehalfbyname','createdonbehalfbyyominame',_0x1b96('0x5c'),_0x1b96('0x5d'),'customeridyominame',_0x1b96('0x5e'),_0x1b96('0x5f'),'entityimage_timestamp','entityimage_url',_0x1b96('0x60'),_0x1b96('0x61'),_0x1b96('0x62'),'followupby',_0x1b96('0x63'),'influencescore',_0x1b96('0x64'),_0x1b96('0x65'),'masteridname',_0x1b96('0x66'),_0x1b96('0x67'),'modifiedbyname','modifiedbyyominame',_0x1b96('0x68'),'modifiedonbehalfbyname',_0x1b96('0x69'),_0x1b96('0x6a'),_0x1b96('0x6b'),_0x1b96('0x6c'),_0x1b96('0x6d'),_0x1b96('0x6e'),_0x1b96('0x6f'),_0x1b96('0x70'),'owneridyominame','parentcaseidname',_0x1b96('0x71'),'primarycontactidyominame','prioritycodename',_0x1b96('0x72'),_0x1b96('0x73'),_0x1b96('0x74'),_0x1b96('0x75'),_0x1b96('0x76'),'responsiblecontactidname',_0x1b96('0x77'),_0x1b96('0x78'),_0x1b96('0x79'),_0x1b96('0x7a'),_0x1b96('0x7b'),'statecode',_0x1b96('0x7c'),'subjectidname','ticketnumber',_0x1b96('0x7d'),_0x1b96('0x7e'),_0x1b96('0x7f'),_0x1b96('0x80'),'versionnumber'];var _0x28b8ae=_0xcb7f1f[_0x1b96('0x81')](_0x4fbfa3);return db[_0x1b96('0x18')]['findOne']({'where':{'id':_0x5ba0d4[_0x1b96('0x37')]['id']},'attributes':['id','username','password',_0x1b96('0x82'),_0x1b96('0x83'),_0x1b96('0x84'),_0x1b96('0x85'),'modernAuthentication'],'include':[{'model':db[_0x1b96('0x86')],'as':_0x1b96('0x86'),'attributes':['id','data5',_0x1b96('0x87')]}]})[_0x1b96('0xe')](handleEntityNotFound(_0x33ee4e,null))[_0x1b96('0xe')](function(_0x100b6a){if(_0x100b6a){if(_0x100b6a[_0x1b96('0x88')]){_0x100b6a[_0x1b96('0x89')]=_0x100b6a['CloudProvider'][_0x1b96('0x8a')];_0x234450=sanitizeRemoteUri(_0x100b6a[_0x1b96('0x86')][_0x1b96('0x87')]);_0x5fd23b=getWebApiUrl(_0x234450);return _0x100b6a;}_0x234450=sanitizeRemoteUri(_0x100b6a['remoteUri']);_0x5fd23b=getWebApiUrl(_0x234450);var _0x539672={'method':_0x1b96('0x8b'),'uri':'https://login.microsoftonline.com/'+_0x100b6a[_0x1b96('0x83')]+_0x1b96('0x8c'),'form':{'client_id':_0x100b6a['clientId'],'resource':_0x234450,'username':_0x100b6a[_0x1b96('0x8d')],'password':_0x100b6a['password'],'grant_type':'password','client_secret':_0x100b6a[_0x1b96('0x85')]},'json':!![]};return rp(_0x539672);}})[_0x1b96('0xe')](function(_0x135729){_0x2b86a9=_0x135729[_0x1b96('0x89')];var _0x51e51f={'method':_0x1b96('0x8e'),'uri':encodeURI(_0x5fd23b+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5f1345+'\x27'),'headers':{'Authorization':_0x1b96('0x8f')+_0x2b86a9,'If-None-Match':null,'OData-Version':_0x1b96('0x90')},'json':!![]};return rp(_0x51e51f);})[_0x1b96('0xe')](function(_0x781d3a){var _0x328049=_0x781d3a[_0x1b96('0x91')][0x0];var _0x160b41=_0x328049[_0x1b96('0x92')];var _0x233acc={'method':'GET','uri':_0x5fd23b+_0x1b96('0x93')+_0x160b41+_0x1b96('0x94'),'headers':{'Authorization':'Bearer\x20'+_0x2b86a9,'If-None-Match':null,'OData-Version':_0x1b96('0x90')},'json':!![]};return rp(_0x233acc);})[_0x1b96('0xe')](function(_0x221aa9){_0x530aa8=_0x221aa9;_0x26a199=_0x530aa8[_0x1b96('0x95')];_0x26a199=_[_0x1b96('0x96')](_0x26a199,function(_0x3bd8a8){return!_0x28b8ae['includes'](_0x3bd8a8[_0x1b96('0x97')]);});var _0x594705=[];var _0x4548e0=[];_0x26a199[_0x1b96('0x98')](function(_0x168ee3){if(_0x168ee3[_0x1b96('0x99')]){var _0x23b46a=_0x168ee3['@odata.type']['substring'](_0x168ee3[_0x1b96('0x99')][_0x1b96('0x45')]('.')+0x1);if(_0x23b46a===_0x1b96('0x9a')){_0x594705[_0x1b96('0x9b')](getSelectList(_0x5fd23b,_0x1fe8da,_0x4548e0,_0x530aa8[_0x1b96('0x92')],_0x168ee3[_0x1b96('0x92')],_0x2b86a9));}}});return Promise['all'](_0x594705);})['then'](function(_0x1f81b8){_0x4fa78e=_0x1f81b8[0x0];var _0x210c1b=[];var _0x2ddf6c=[];_0x26a199['forEach'](function(_0x3d2e7a){if(!_[_0x1b96('0x9c')](_0x3d2e7a[_0x1b96('0x99')])){var _0x7854cd=_0x3d2e7a[_0x1b96('0x99')][_0x1b96('0x44')](_0x3d2e7a[_0x1b96('0x99')][_0x1b96('0x45')]('.')+0x1);if(_0x7854cd===_0x1b96('0x9d')){_0x210c1b[_0x1b96('0x9b')](getBooleanList(_0x5fd23b,_0x1fe8da,_0x2ddf6c,_0x530aa8[_0x1b96('0x92')],_0x3d2e7a[_0x1b96('0x92')],_0x2b86a9));}}});return Promise['all'](_0x210c1b);})['then'](function(_0x2f0b47){_0x593027=_0x2f0b47[0x0];var _0x5ba5f5=[];var _0x357561=[];_0x26a199['forEach'](function(_0x433c40){if(_0x433c40[_0x1b96('0x99')]){var _0x5ac18f=_0x433c40[_0x1b96('0x99')][_0x1b96('0x44')](_0x433c40[_0x1b96('0x99')][_0x1b96('0x45')]('.')+0x1);if(_0x5ac18f===_0x1b96('0x9e')||_0x5ac18f===_0x1b96('0x9f')||_0x5ac18f===_0x1b96('0xa0')||_0x5ac18f===_0x1b96('0xa1')||_0x5ac18f===_0x1b96('0xa2')||_0x5ac18f==='DateTimeAttributeMetadata'||_0x5ac18f===_0x1b96('0xa3')||_0x5ac18f==='EntityNameAttributeMetadata'||_0x5ac18f==='StateAttributeMetadata'||_0x5ac18f==='DecimalAttributeMetadata'){_0x5ba5f5[_0x1b96('0x9b')](getInputList(_0x5fd23b,_0x1fe8da,_0x5ac18f,_0x357561,_0x530aa8[_0x1b96('0x92')],_0x433c40[_0x1b96('0x92')],_0x2b86a9));}}});return Promise[_0x1b96('0xa4')](_0x5ba5f5);})[_0x1b96('0xe')](function(_0x3aeb77){_0x3b5c85=_0x3aeb77[0x0];var _0x35f204=_0x4fa78e['concat'](_0x593027)['concat'](_0x3b5c85);var _0x5a01de={'count':_0x35f204[_0x1b96('0x21')],'rows':_0x35f204};return _0x5a01de;})[_0x1b96('0xe')](respondWithResult(_0x33ee4e,null))['catch'](function(_0x4057c0){var _0x406c2a=_0x5ba0d4[_0x1b96('0x1c')][_0x1b96('0xa5')]?0x1f4:_0x4057c0['statusCode']||0x1f4;logger[_0x1b96('0x12')](_0x4057c0[_0x1b96('0x13')]);delete _0x4057c0['name'];if(_0x406c2a===0x191){_0x406c2a=0x190;}_0x33ee4e[_0x1b96('0x7')](_0x406c2a)[_0x1b96('0x15')](_0x5ba0d4['query'][_0x1b96('0xa5')]?{'message':'Wrong\x20credentials','statusCode':_0x4057c0['statusCode']}:_0x4057c0);});};function getSelectList(_0x2ae662,_0x4781ea,_0x223968,_0x396140,_0x388e3f,_0x1e409f){var _0x2900c5={'method':_0x1b96('0x8e'),'uri':_0x2ae662+_0x1b96('0x93')+_0x396140+')/Attributes('+_0x388e3f+_0x1b96('0xa6')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x1e409f,'If-None-Match':null,'OData-Version':_0x1b96('0x90')},'json':!![]};return rp(_0x2900c5)[_0x1b96('0xe')](function(_0xb1ea8d){var _0x4e4aed=[];var _0x50cac4=_0xb1ea8d[_0x1b96('0xa7')][_0x1b96('0xa8')];_0x50cac4[_0x1b96('0x98')](function(_0x218533){_0x4e4aed[_0x1b96('0x9b')]({'name':_0x218533[_0x1b96('0xa9')][_0x1b96('0xaa')][_0x1b96('0xa9')],'value':String(_0x218533[_0x1b96('0xab')])});});var _0x109320={'id':_0x4781ea+'_'+_0xb1ea8d['LogicalName'],'name':_0xb1ea8d[_0x1b96('0xac')][_0x1b96('0xaa')][_0x1b96('0xa9')],'custom':![],'options':_0x4e4aed};_0x223968[_0x1b96('0x9b')](_0x109320);return _0x223968;});}function getBooleanList(_0x31b3c3,_0x6d8974,_0x284370,_0x301d8c,_0x19d473,_0x1c8c62){var _0x52d092={'method':'GET','uri':_0x31b3c3+_0x1b96('0x93')+_0x301d8c+_0x1b96('0xad')+_0x19d473+_0x1b96('0xae'),'headers':{'Authorization':_0x1b96('0x8f')+_0x1c8c62,'If-None-Match':null,'OData-Version':_0x1b96('0x90')},'json':!![]};return rp(_0x52d092)[_0x1b96('0xe')](function(_0x5c33c5){var _0x4590af=[];_0x4590af['push']({'name':_0x5c33c5[_0x1b96('0xa7')][_0x1b96('0xaf')][_0x1b96('0xa9')]['UserLocalizedLabel'][_0x1b96('0xa9')],'value':_0x1b96('0xb0')},{'name':_0x5c33c5[_0x1b96('0xa7')][_0x1b96('0xb1')]['Label'][_0x1b96('0xaa')][_0x1b96('0xa9')],'value':_0x1b96('0xb2')});var _0x24f9da={'id':_0x6d8974+'_'+_0x5c33c5[_0x1b96('0x97')],'name':_0x5c33c5[_0x1b96('0xac')][_0x1b96('0xaa')]['Label'],'custom':![],'options':_0x4590af};_0x284370[_0x1b96('0x9b')](_0x24f9da);return _0x284370;});}function getInputList(_0x160536,_0x1ed368,_0x1407df,_0x3d120d,_0x1ef5d4,_0xb60e3f,_0x52359e){var _0x57490e={'method':_0x1b96('0x8e'),'uri':_0x160536+_0x1b96('0x93')+_0x1ef5d4+_0x1b96('0xad')+_0xb60e3f+_0x1b96('0xb3')+_0x1407df+_0x1b96('0xb4'),'headers':{'Authorization':_0x1b96('0x8f')+_0x52359e,'If-None-Match':null,'OData-Version':_0x1b96('0x90')},'json':!![]};return rp(_0x57490e)[_0x1b96('0xe')](function(_0x718860){var _0xbc1ec0={'id':_0x1ed368+'_'+_0x718860[_0x1b96('0x97')],'name':_0x718860[_0x1b96('0xac')]['UserLocalizedLabel']?_0x718860[_0x1b96('0xac')]['UserLocalizedLabel']['Label']:_0x718860[_0x1b96('0x97')],'custom':![],'options':[]};_0x3d120d[_0x1b96('0x9b')](_0xbc1ec0);return _0x3d120d;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 78e1908..c1164ad 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(_0x103bb7,_0x5445a4){var _0xa3caaa=function(_0x39ec7f){while(--_0x39ec7f){_0x103bb7['push'](_0x103bb7['shift']());}};_0xa3caaa(++_0x5445a4);}(_0xb7e7,0x121));var _0x7b7e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb7e7[_0xefd519];return _0x4bb882;};'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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x19edc1,_0x5d5ba9){var _0x8073ab=function(_0x27ec17){while(--_0x27ec17){_0x19edc1['push'](_0x19edc1['shift']());}};_0x8073ab(++_0x5d5ba9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('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 e913909..96dfe97 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 _0xd360=['include','model','map','find','raw','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit'];(function(_0x2fc223,_0x431d1e){var _0x179c18=function(_0x150d30){while(--_0x150d30){_0x2fc223['push'](_0x2fc223['shift']());}};_0x179c18(++_0x431d1e);}(_0xd360,0x14a));var _0x0d36=function(_0xcbf547,_0x1c37fe){_0xcbf547=_0xcbf547-0x0;var _0x2a4206=_0xd360[_0xcbf547];return _0x2a4206;};'use strict';var _=require(_0x0d36('0x0'));var util=require(_0x0d36('0x1'));var moment=require(_0x0d36('0x2'));var BPromise=require(_0x0d36('0x3'));var rs=require(_0x0d36('0x4'));var fs=require('fs');var Redis=require(_0x0d36('0x5'));var db=require(_0x0d36('0x6'))['db'];var utils=require(_0x0d36('0x7'));var logger=require('../../config/logger')(_0x0d36('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0d36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2d03,_0x4693e8,_0x3dbe29){return new BPromise(function(_0x15e79e,_0x40b308){return client[_0x0d36('0xa')](_0x2b2d03,_0x3dbe29)[_0x0d36('0xb')](function(_0x307dc4){logger[_0x0d36('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x4693e8,_0x0d36('0xd'));logger[_0x0d36('0xe')](_0x0d36('0xf'),_0x4693e8,_0x0d36('0xd'),JSON[_0x0d36('0x10')](_0x307dc4));if(_0x307dc4[_0x0d36('0x11')]){if(_0x307dc4['error'][_0x0d36('0x12')]===0x1f4){logger[_0x0d36('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x4693e8,_0x307dc4['error'][_0x0d36('0x13')]);return _0x40b308(_0x307dc4['error'][_0x0d36('0x13')]);}logger[_0x0d36('0x11')](_0x0d36('0x14'),_0x4693e8,_0x307dc4[_0x0d36('0x11')][_0x0d36('0x13')]);return _0x15e79e(_0x307dc4[_0x0d36('0x11')][_0x0d36('0x13')]);}else{logger[_0x0d36('0xc')](_0x0d36('0x14'),_0x4693e8,_0x0d36('0xd'));_0x15e79e(_0x307dc4[_0x0d36('0x15')][_0x0d36('0x13')]);}})[_0x0d36('0x16')](function(_0x5880e3){logger[_0x0d36('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x4693e8,_0x5880e3);_0x40b308(_0x5880e3);});});}exports[_0x0d36('0x17')]=function(_0x121410){var _0x15d0cf=this;return new Promise(function(_0x1840f7,_0xd839a5){return db[_0x0d36('0x18')][_0x0d36('0x19')]({'raw':_0x121410[_0x0d36('0x1a')]?_0x121410['options']['raw']===undefined?!![]:![]:!![],'where':_0x121410['options']?_0x121410['options'][_0x0d36('0x1b')]||null:null,'attributes':_0x121410['options']?_0x121410[_0x0d36('0x1a')][_0x0d36('0x1c')]||null:null,'limit':_0x121410[_0x0d36('0x1a')]?_0x121410[_0x0d36('0x1a')][_0x0d36('0x1d')]||null:null,'include':_0x121410[_0x0d36('0x1a')]?_0x121410[_0x0d36('0x1a')][_0x0d36('0x1e')]?_['map'](_0x121410[_0x0d36('0x1a')]['include'],function(_0x4f839a){return{'model':db[_0x4f839a[_0x0d36('0x1f')]],'as':_0x4f839a['as'],'attributes':_0x4f839a['attributes'],'include':_0x4f839a['include']?_[_0x0d36('0x20')](_0x4f839a['include'],function(_0xc1ebec){return{'model':db[_0xc1ebec[_0x0d36('0x1f')]],'as':_0xc1ebec['as'],'attributes':_0xc1ebec[_0x0d36('0x1c')],'include':_0xc1ebec[_0x0d36('0x1e')]?_[_0x0d36('0x20')](_0xc1ebec[_0x0d36('0x1e')],function(_0x35c985){return{'model':db[_0x35c985['model']],'as':_0x35c985['as'],'attributes':_0x35c985[_0x0d36('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0d36('0xb')](function(_0x4c6ed8){logger['info'](_0x0d36('0x17'),_0x121410);logger[_0x0d36('0xe')]('GetDynamics365Account',_0x121410,JSON[_0x0d36('0x10')](_0x4c6ed8));_0x1840f7(_0x4c6ed8);})[_0x0d36('0x16')](function(_0x243158){logger[_0x0d36('0x11')](_0x0d36('0x17'),_0x243158[_0x0d36('0x13')],_0x121410);_0xd839a5(_0x15d0cf[_0x0d36('0x11')](0x1f4,_0x243158[_0x0d36('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x229600){var _0x7c5e37=this;return new Promise(function(_0x2adfcf,_0x15ed36){return db[_0x0d36('0x18')][_0x0d36('0x21')]({'raw':_0x229600[_0x0d36('0x1a')]?_0x229600[_0x0d36('0x1a')][_0x0d36('0x22')]===undefined?!![]:![]:!![],'where':_0x229600[_0x0d36('0x1a')]?_0x229600[_0x0d36('0x1a')][_0x0d36('0x1b')]||null:null,'attributes':_0x229600[_0x0d36('0x1a')]?_0x229600[_0x0d36('0x1a')][_0x0d36('0x1c')]||null:null,'include':_0x229600[_0x0d36('0x1a')]?_0x229600[_0x0d36('0x1a')][_0x0d36('0x1e')]?_[_0x0d36('0x20')](_0x229600[_0x0d36('0x1a')][_0x0d36('0x1e')],function(_0xc9fffd){return{'model':db[_0xc9fffd[_0x0d36('0x1f')]],'as':_0xc9fffd['as'],'attributes':_0xc9fffd[_0x0d36('0x1c')],'include':_0xc9fffd[_0x0d36('0x1e')]?_[_0x0d36('0x20')](_0xc9fffd[_0x0d36('0x1e')],function(_0x4ef98f){return{'model':db[_0x4ef98f[_0x0d36('0x1f')]],'as':_0x4ef98f['as'],'attributes':_0x4ef98f[_0x0d36('0x1c')],'include':_0x4ef98f['include']?_[_0x0d36('0x20')](_0x4ef98f['include'],function(_0x432e97){return{'model':db[_0x432e97[_0x0d36('0x1f')]],'as':_0x432e97['as'],'attributes':_0x432e97[_0x0d36('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x866422){logger[_0x0d36('0xc')](_0x0d36('0x23'),_0x229600);logger[_0x0d36('0xe')](_0x0d36('0x23'),_0x229600,JSON[_0x0d36('0x10')](_0x866422));_0x2adfcf(_0x866422);})[_0x0d36('0x16')](function(_0x2ee47d){logger[_0x0d36('0x11')]('ShowDynamics365Account',_0x2ee47d['message'],_0x229600);_0x15ed36(_0x7c5e37[_0x0d36('0x11')](0x1f4,_0x2ee47d['message']));});});}; \ No newline at end of file +var _0xed5c=['moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Dynamics365Account','findAll','raw','options','where','attributes','limit','include','map','model','GetDynamics365Account','ShowDynamics365Account','find','util'];(function(_0x237bb6,_0x385c71){var _0x49ee06=function(_0x5a1648){while(--_0x5a1648){_0x237bb6['push'](_0x237bb6['shift']());}};_0x49ee06(++_0x385c71);}(_0xed5c,0x13f));var _0xced5=function(_0x84e387,_0x4a90d4){_0x84e387=_0x84e387-0x0;var _0x2866be=_0xed5c[_0x84e387];return _0x2866be;};'use strict';var _=require('lodash');var util=require(_0xced5('0x0'));var moment=require(_0xced5('0x1'));var BPromise=require('bluebird');var rs=require(_0xced5('0x2'));var fs=require('fs');var Redis=require(_0xced5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xced5('0x4'))(_0xced5('0x5'));var config=require('../../config/environment');var jayson=require(_0xced5('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbe7aba,_0x1899af,_0x6a58b9){return new BPromise(function(_0x4ecf0b,_0x15cbe6){return client[_0xced5('0x7')](_0xbe7aba,_0x6a58b9)[_0xced5('0x8')](function(_0x5a708d){logger[_0xced5('0x9')](_0xced5('0xa'),_0x1899af,_0xced5('0xb'));logger[_0xced5('0xc')](_0xced5('0xd'),_0x1899af,_0xced5('0xb'),JSON[_0xced5('0xe')](_0x5a708d));if(_0x5a708d[_0xced5('0xf')]){if(_0x5a708d['error'][_0xced5('0x10')]===0x1f4){logger['error'](_0xced5('0xa'),_0x1899af,_0x5a708d[_0xced5('0xf')][_0xced5('0x11')]);return _0x15cbe6(_0x5a708d[_0xced5('0xf')][_0xced5('0x11')]);}logger[_0xced5('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x1899af,_0x5a708d['error']['message']);return _0x4ecf0b(_0x5a708d[_0xced5('0xf')][_0xced5('0x11')]);}else{logger[_0xced5('0x9')](_0xced5('0xa'),_0x1899af,_0xced5('0xb'));_0x4ecf0b(_0x5a708d['result'][_0xced5('0x11')]);}})[_0xced5('0x12')](function(_0x417b4e){logger['error'](_0xced5('0xa'),_0x1899af,_0x417b4e);_0x15cbe6(_0x417b4e);});});}exports['GetDynamics365Account']=function(_0x4a8f6c){var _0x30f530=this;return new Promise(function(_0xed0529,_0x268d08){return db[_0xced5('0x13')][_0xced5('0x14')]({'raw':_0x4a8f6c['options']?_0x4a8f6c['options'][_0xced5('0x15')]===undefined?!![]:![]:!![],'where':_0x4a8f6c[_0xced5('0x16')]?_0x4a8f6c[_0xced5('0x16')][_0xced5('0x17')]||null:null,'attributes':_0x4a8f6c['options']?_0x4a8f6c[_0xced5('0x16')][_0xced5('0x18')]||null:null,'limit':_0x4a8f6c['options']?_0x4a8f6c[_0xced5('0x16')][_0xced5('0x19')]||null:null,'include':_0x4a8f6c['options']?_0x4a8f6c['options'][_0xced5('0x1a')]?_[_0xced5('0x1b')](_0x4a8f6c[_0xced5('0x16')]['include'],function(_0x33ae3d){return{'model':db[_0x33ae3d[_0xced5('0x1c')]],'as':_0x33ae3d['as'],'attributes':_0x33ae3d['attributes'],'include':_0x33ae3d['include']?_[_0xced5('0x1b')](_0x33ae3d[_0xced5('0x1a')],function(_0xcc13c1){return{'model':db[_0xcc13c1[_0xced5('0x1c')]],'as':_0xcc13c1['as'],'attributes':_0xcc13c1[_0xced5('0x18')],'include':_0xcc13c1['include']?_['map'](_0xcc13c1[_0xced5('0x1a')],function(_0x311b18){return{'model':db[_0x311b18['model']],'as':_0x311b18['as'],'attributes':_0x311b18['attributes']};}):[]};}):[]};}):[]:[]})[_0xced5('0x8')](function(_0x58c1a0){logger[_0xced5('0x9')](_0xced5('0x1d'),_0x4a8f6c);logger[_0xced5('0xc')](_0xced5('0x1d'),_0x4a8f6c,JSON['stringify'](_0x58c1a0));_0xed0529(_0x58c1a0);})[_0xced5('0x12')](function(_0x349d1a){logger[_0xced5('0xf')](_0xced5('0x1d'),_0x349d1a[_0xced5('0x11')],_0x4a8f6c);_0x268d08(_0x30f530['error'](0x1f4,_0x349d1a[_0xced5('0x11')]));});});};exports[_0xced5('0x1e')]=function(_0x47e274){var _0x4f962d=this;return new Promise(function(_0x50b1ce,_0x310b0a){return db[_0xced5('0x13')][_0xced5('0x1f')]({'raw':_0x47e274[_0xced5('0x16')]?_0x47e274['options']['raw']===undefined?!![]:![]:!![],'where':_0x47e274[_0xced5('0x16')]?_0x47e274[_0xced5('0x16')][_0xced5('0x17')]||null:null,'attributes':_0x47e274[_0xced5('0x16')]?_0x47e274[_0xced5('0x16')][_0xced5('0x18')]||null:null,'include':_0x47e274['options']?_0x47e274['options'][_0xced5('0x1a')]?_[_0xced5('0x1b')](_0x47e274[_0xced5('0x16')][_0xced5('0x1a')],function(_0x3bbcc8){return{'model':db[_0x3bbcc8[_0xced5('0x1c')]],'as':_0x3bbcc8['as'],'attributes':_0x3bbcc8[_0xced5('0x18')],'include':_0x3bbcc8[_0xced5('0x1a')]?_[_0xced5('0x1b')](_0x3bbcc8[_0xced5('0x1a')],function(_0x363a71){return{'model':db[_0x363a71[_0xced5('0x1c')]],'as':_0x363a71['as'],'attributes':_0x363a71[_0xced5('0x18')],'include':_0x363a71['include']?_['map'](_0x363a71['include'],function(_0x489c6c){return{'model':db[_0x489c6c['model']],'as':_0x489c6c['as'],'attributes':_0x489c6c[_0xced5('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44cf18){logger[_0xced5('0x9')](_0xced5('0x1e'),_0x47e274);logger[_0xced5('0xc')](_0xced5('0x1e'),_0x47e274,JSON[_0xced5('0xe')](_0x44cf18));_0x50b1ce(_0x44cf18);})['catch'](function(_0x34b9bb){logger[_0xced5('0xf')]('ShowDynamics365Account',_0x34b9bb[_0xced5('0x11')],_0x47e274);_0x310b0a(_0x4f962d['error'](0x1f4,_0x34b9bb['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 49ae279..a3fee85 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 _0x96cf=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','/:id/fields','getFields','get','/:id/subjects','getSubjects','/:id/descriptions','post','put','update'];(function(_0x21c130,_0x225833){var _0x58f574=function(_0x49ab74){while(--_0x49ab74){_0x21c130['push'](_0x21c130['shift']());}};_0x58f574(++_0x225833);}(_0x96cf,0x7a));var _0xf96c=function(_0x136456,_0x34bec0){_0x136456=_0x136456-0x0;var _0x574b02=_0x96cf[_0x136456];return _0x574b02;};'use strict';var multer=require(_0xf96c('0x0'));var util=require(_0xf96c('0x1'));var path=require('path');var timeout=require(_0xf96c('0x2'));var express=require(_0xf96c('0x3'));var router=express[_0xf96c('0x4')]();var fs_extra=require(_0xf96c('0x5'));var auth=require(_0xf96c('0x6'));var interaction=require(_0xf96c('0x7'));var config=require(_0xf96c('0x8'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0xf96c('0x9')](),controller[_0xf96c('0xa')]);router['get'](_0xf96c('0xb'),auth[_0xf96c('0x9')](),controller[_0xf96c('0xc')]);router['get'](_0xf96c('0xd'),auth[_0xf96c('0x9')](),controller[_0xf96c('0xe')]);router[_0xf96c('0xf')](_0xf96c('0x10'),auth[_0xf96c('0x9')](),controller[_0xf96c('0x11')]);router[_0xf96c('0xf')](_0xf96c('0x12'),auth[_0xf96c('0x9')](),controller['getDescriptions']);router[_0xf96c('0x13')]('/',auth[_0xf96c('0x9')](),controller['create']);router[_0xf96c('0x14')](_0xf96c('0xb'),auth[_0xf96c('0x9')](),controller[_0xf96c('0x15')]);router[_0xf96c('0x16')](_0xf96c('0xb'),auth['isAuthenticated'](),controller[_0xf96c('0x17')]);module['exports']=router; \ No newline at end of file +var _0x4ffa=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','put','update','delete','exports','path','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ffa,0x124));var _0xa4ff=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4ffa[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa4ff('0x0'));var timeout=require('connect-timeout');var express=require(_0xa4ff('0x1'));var router=express[_0xa4ff('0x2')]();var fs_extra=require(_0xa4ff('0x3'));var auth=require(_0xa4ff('0x4'));var interaction=require(_0xa4ff('0x5'));var config=require(_0xa4ff('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xa4ff('0x7')]('/',auth[_0xa4ff('0x8')](),controller[_0xa4ff('0x9')]);router['get'](_0xa4ff('0xa'),auth['isAuthenticated'](),controller[_0xa4ff('0xb')]);router[_0xa4ff('0x7')](_0xa4ff('0xc'),auth['isAuthenticated'](),controller[_0xa4ff('0xd')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xa4ff('0xe')]);router[_0xa4ff('0x7')](_0xa4ff('0xf'),auth[_0xa4ff('0x8')](),controller['getDescriptions']);router[_0xa4ff('0x10')]('/',auth[_0xa4ff('0x8')](),controller['create']);router[_0xa4ff('0x11')](_0xa4ff('0xa'),auth['isAuthenticated'](),controller[_0xa4ff('0x12')]);router[_0xa4ff('0x13')]('/:id',auth[_0xa4ff('0x8')](),controller['destroy']);module[_0xa4ff('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 7a79533..ba02ec8 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 _0x5bca=['ENUM','incident','phonecall','contact','STRING','BOOLEAN','sequelize','exports'];(function(_0x553fd4,_0x2b2b4f){var _0x150613=function(_0x3795ab){while(--_0x3795ab){_0x553fd4['push'](_0x553fd4['shift']());}};_0x150613(++_0x2b2b4f);}(_0x5bca,0x19e));var _0xa5bc=function(_0x378380,_0x31dba0){_0x378380=_0x378380-0x0;var _0x2a4744=_0x5bca[_0x378380];return _0x2a4744;};'use strict';var Sequelize=require(_0xa5bc('0x0'));module[_0xa5bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa5bc('0x2')](_0xa5bc('0x3'),_0xa5bc('0x4')),'defaultValue':_0xa5bc('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xa5bc('0x5'),'nothing'),'defaultValue':_0xa5bc('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xa5bc('0x6')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xa5bc('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x762f=['ENUM','contact','nothing','BOOLEAN','exports','STRING','incident','phonecall'];(function(_0x2794fc,_0x290afa){var _0x3b786a=function(_0xeb5695){while(--_0xeb5695){_0x2794fc['push'](_0x2794fc['shift']());}};_0x3b786a(++_0x290afa);}(_0x762f,0x1a4));var _0xf762=function(_0x18e570,_0x257e84){_0x18e570=_0x18e570-0x0;var _0x2a421e=_0x762f[_0x18e570];return _0x2a421e;};'use strict';var Sequelize=require('sequelize');module[_0xf762('0x0')]={'name':{'type':Sequelize[_0xf762('0x1')]},'description':{'type':Sequelize[_0xf762('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xf762('0x2'),_0xf762('0x3')),'defaultValue':_0xf762('0x2')},'moduleCreate':{'type':Sequelize[_0xf762('0x4')](_0xf762('0x5'),_0xf762('0x6')),'defaultValue':_0xf762('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xf762('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xf762('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index d101fde..08df300 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 _0xdbbf=['attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','catch','params','find','create','body','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','send','index','rawAttributes','fieldName','type','key','map','name','keys','query','filters','model'];(function(_0x25d99b,_0x409bda){var _0x10e475=function(_0x59c651){while(--_0x59c651){_0x25d99b['push'](_0x25d99b['shift']());}};_0x10e475(++_0x409bda);}(_0xdbbf,0x1b7));var _0xfdbb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdbbf[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xfdbb('0x0'));var rimraf=require(_0xfdbb('0x1'));var zipdir=require(_0xfdbb('0x2'));var jsonpatch=require(_0xfdbb('0x3'));var rp=require(_0xfdbb('0x4'));var moment=require(_0xfdbb('0x5'));var BPromise=require(_0xfdbb('0x6'));var Mustache=require(_0xfdbb('0x7'));var util=require(_0xfdbb('0x8'));var path=require(_0xfdbb('0x9'));var sox=require(_0xfdbb('0xa'));var csv=require('to-csv');var ejs=require(_0xfdbb('0xb'));var fs=require('fs');var fs_extra=require(_0xfdbb('0xc'));var _=require(_0xfdbb('0xd'));var squel=require(_0xfdbb('0xe'));var crypto=require(_0xfdbb('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfdbb('0x10'));var querystring=require(_0xfdbb('0x11'));var Papa=require(_0xfdbb('0x12'));var Redis=require('ioredis');var authService=require(_0xfdbb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfdbb('0x14'));var hardwareService=require(_0xfdbb('0x15'));var logger=require(_0xfdbb('0x16'))(_0xfdbb('0x17'));var utils=require('../../config/utils');var config=require(_0xfdbb('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x335a4b,_0x3301b2){_0x3301b2=_0x3301b2||0xcc;return function(_0x5d4fed){if(_0x5d4fed){return _0x335a4b[_0xfdbb('0x19')](_0x3301b2);}return _0x335a4b['status'](_0x3301b2)[_0xfdbb('0x1a')]();};}function respondWithResult(_0x13b2c2,_0x2547a8){_0x2547a8=_0x2547a8||0xc8;return function(_0x5e78dc){if(_0x5e78dc){return _0x13b2c2[_0xfdbb('0x1b')](_0x2547a8)['json'](_0x5e78dc);}};}function respondWithFilteredResult(_0x57d98a,_0x73f06a){return function(_0x3c50a2){if(_0x3c50a2){var _0xece691=typeof _0x73f06a['offset']===_0xfdbb('0x1c')&&typeof _0x73f06a['limit']==='undefined';var _0x5779b5=_0x3c50a2['count'];var _0xca585c=_0xece691?0x0:_0x73f06a[_0xfdbb('0x1d')];var _0x4fe820=_0xece691?_0x3c50a2[_0xfdbb('0x1e')]:_0x73f06a[_0xfdbb('0x1d')]+_0x73f06a['limit'];var _0xdd19b7;if(_0x4fe820>=_0x5779b5){_0x4fe820=_0x5779b5;_0xdd19b7=0xc8;}else{_0xdd19b7=0xce;}_0x57d98a[_0xfdbb('0x1b')](_0xdd19b7);return _0x57d98a[_0xfdbb('0x1f')](_0xfdbb('0x20'),_0xca585c+'-'+_0x4fe820+'/'+_0x5779b5)[_0xfdbb('0x21')](_0x3c50a2);}return null;};}function patchUpdates(_0x10fc6f){return function(_0x1cf220){try{jsonpatch[_0xfdbb('0x22')](_0x1cf220,_0x10fc6f,!![]);}catch(_0xf3e63f){return BPromise[_0xfdbb('0x23')](_0xf3e63f);}return _0x1cf220[_0xfdbb('0x24')]();};}function saveUpdates(_0x252477,_0x2ee336){return function(_0x24c569){if(_0x24c569){return _0x24c569[_0xfdbb('0x25')](_0x252477)['then'](function(_0x537263){return _0x537263;});}return null;};}function removeEntity(_0xf709c0,_0x4e6146){return function(_0x20def9){if(_0x20def9){return _0x20def9[_0xfdbb('0x26')]()[_0xfdbb('0x27')](function(){_0xf709c0[_0xfdbb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x418612,_0x732f4){return function(_0x53ecaa){if(!_0x53ecaa){_0x418612[_0xfdbb('0x19')](0x194);}return _0x53ecaa;};}function handleError(_0x200221,_0x315334){_0x315334=_0x315334||0x1f4;return function(_0x15813b){logger['error'](_0x15813b[_0xfdbb('0x28')]);if(_0x15813b['name']){delete _0x15813b['name'];}_0x200221['status'](_0x315334)[_0xfdbb('0x29')](_0x15813b);};}exports[_0xfdbb('0x2a')]=function(_0x417a49,_0x43e025){var _0x4afdfe={},_0x5223ea={},_0xdeec8b={'count':0x0,'rows':[]};var _0x576c06=_['map'](db['Dynamics365Configuration'][_0xfdbb('0x2b')],function(_0x3f95ed){return{'name':_0x3f95ed[_0xfdbb('0x2c')],'type':_0x3f95ed[_0xfdbb('0x2d')][_0xfdbb('0x2e')]};});_0x5223ea['model']=_[_0xfdbb('0x2f')](_0x576c06,_0xfdbb('0x30'));_0x5223ea['query']=_[_0xfdbb('0x31')](_0x417a49[_0xfdbb('0x32')]);_0x5223ea[_0xfdbb('0x33')]=_['intersection'](_0x5223ea[_0xfdbb('0x34')],_0x5223ea['query']);_0x4afdfe[_0xfdbb('0x35')]=_[_0xfdbb('0x36')](_0x5223ea['model'],qs['fields'](_0x417a49[_0xfdbb('0x32')][_0xfdbb('0x37')]));_0x4afdfe[_0xfdbb('0x35')]=_0x4afdfe[_0xfdbb('0x35')][_0xfdbb('0x38')]?_0x4afdfe[_0xfdbb('0x35')]:_0x5223ea['model'];if(!_0x417a49['query']['hasOwnProperty'](_0xfdbb('0x39'))){_0x4afdfe[_0xfdbb('0x3a')]=qs[_0xfdbb('0x3a')](_0x417a49[_0xfdbb('0x32')][_0xfdbb('0x3a')]);_0x4afdfe[_0xfdbb('0x1d')]=qs[_0xfdbb('0x1d')](_0x417a49['query']['offset']);}_0x4afdfe[_0xfdbb('0x3b')]=qs['sort'](_0x417a49[_0xfdbb('0x32')][_0xfdbb('0x3c')]);_0x4afdfe[_0xfdbb('0x3d')]=qs[_0xfdbb('0x33')](_[_0xfdbb('0x3e')](_0x417a49[_0xfdbb('0x32')],_0x5223ea['filters']),_0x576c06);if(_0x417a49[_0xfdbb('0x32')][_0xfdbb('0x3f')]){_0x4afdfe[_0xfdbb('0x3d')]=_[_0xfdbb('0x40')](_0x4afdfe['where'],{'$or':_['map'](_0x576c06,function(_0x4a8919){if(_0x4a8919[_0xfdbb('0x2d')]!==_0xfdbb('0x41')){var _0x75cd93={};_0x75cd93[_0x4a8919[_0xfdbb('0x30')]]={'$like':'%'+_0x417a49[_0xfdbb('0x32')][_0xfdbb('0x3f')]+'%'};return _0x75cd93;}})});}_0x4afdfe=_[_0xfdbb('0x40')]({},_0x4afdfe,_0x417a49[_0xfdbb('0x42')]);var _0x5d77ee={'where':_0x4afdfe['where']};return db[_0xfdbb('0x43')][_0xfdbb('0x1e')](_0x5d77ee)[_0xfdbb('0x27')](function(_0x3b291d){_0xdeec8b[_0xfdbb('0x1e')]=_0x3b291d;if(_0x417a49[_0xfdbb('0x32')][_0xfdbb('0x44')]){_0x4afdfe[_0xfdbb('0x45')]=[{'all':!![]}];}return db[_0xfdbb('0x43')][_0xfdbb('0x46')](_0x4afdfe);})[_0xfdbb('0x27')](function(_0x6309eb){_0xdeec8b['rows']=_0x6309eb;return _0xdeec8b;})[_0xfdbb('0x27')](respondWithFilteredResult(_0x43e025,_0x4afdfe))[_0xfdbb('0x47')](handleError(_0x43e025,null));};exports['show']=function(_0x1b1e71,_0x2c783e){var _0x5bfcdb={'raw':![],'where':{'id':_0x1b1e71[_0xfdbb('0x48')]['id']}},_0x4db6e0={};_0x4db6e0['model']=_[_0xfdbb('0x31')](db['Dynamics365Configuration'][_0xfdbb('0x2b')]);_0x4db6e0[_0xfdbb('0x32')]=_[_0xfdbb('0x31')](_0x1b1e71['query']);_0x4db6e0[_0xfdbb('0x33')]=_[_0xfdbb('0x36')](_0x4db6e0[_0xfdbb('0x34')],_0x4db6e0[_0xfdbb('0x32')]);_0x5bfcdb[_0xfdbb('0x35')]=_[_0xfdbb('0x36')](_0x4db6e0[_0xfdbb('0x34')],qs[_0xfdbb('0x37')](_0x1b1e71[_0xfdbb('0x32')]['fields']));_0x5bfcdb['attributes']=_0x5bfcdb[_0xfdbb('0x35')][_0xfdbb('0x38')]?_0x5bfcdb['attributes']:_0x4db6e0[_0xfdbb('0x34')];if(_0x1b1e71[_0xfdbb('0x32')][_0xfdbb('0x44')]){_0x5bfcdb[_0xfdbb('0x45')]=[{'all':!![]}];}_0x5bfcdb=_[_0xfdbb('0x40')]({},_0x5bfcdb,_0x1b1e71[_0xfdbb('0x42')]);return db[_0xfdbb('0x43')][_0xfdbb('0x49')](_0x5bfcdb)[_0xfdbb('0x27')](handleEntityNotFound(_0x2c783e,null))[_0xfdbb('0x27')](respondWithResult(_0x2c783e,null))[_0xfdbb('0x47')](handleError(_0x2c783e,null));};exports[_0xfdbb('0x4a')]=function(_0x4ee7ca,_0x51bf00){return db['Dynamics365Configuration'][_0xfdbb('0x4a')](_0x4ee7ca[_0xfdbb('0x4b')],{})[_0xfdbb('0x27')](respondWithResult(_0x51bf00,0xc9))['catch'](handleError(_0x51bf00,null));};exports[_0xfdbb('0x25')]=function(_0x2ae3f5,_0xbb1cd4){if(_0x2ae3f5['body']['id']){delete _0x2ae3f5[_0xfdbb('0x4b')]['id'];}return db[_0xfdbb('0x43')][_0xfdbb('0x49')]({'where':{'id':_0x2ae3f5[_0xfdbb('0x48')]['id']}})[_0xfdbb('0x27')](handleEntityNotFound(_0xbb1cd4,null))[_0xfdbb('0x27')](saveUpdates(_0x2ae3f5[_0xfdbb('0x4b')],null))[_0xfdbb('0x27')](respondWithResult(_0xbb1cd4,null))[_0xfdbb('0x47')](handleError(_0xbb1cd4,null));};exports[_0xfdbb('0x26')]=function(_0x1da623,_0x559854){return db['Dynamics365Configuration'][_0xfdbb('0x49')]({'where':{'id':_0x1da623[_0xfdbb('0x48')]['id']}})[_0xfdbb('0x27')](handleEntityNotFound(_0x559854,null))[_0xfdbb('0x27')](removeEntity(_0x559854,null))[_0xfdbb('0x47')](handleError(_0x559854,null));};exports[_0xfdbb('0x4c')]=function(_0xe7b95d,_0x1be795,_0x472325){var _0x4ad7a5={};var _0x418592={};var _0x214fcb;var _0x1acdbb;return db[_0xfdbb('0x43')][_0xfdbb('0x4d')]({'where':{'id':_0xe7b95d['params']['id']}})['then'](handleEntityNotFound(_0x1be795,null))[_0xfdbb('0x27')](function(_0x3f6630){if(_0x3f6630){_0x214fcb=_0x3f6630;_0x418592['model']=_[_0xfdbb('0x31')](db[_0xfdbb('0x4e')][_0xfdbb('0x2b')]);_0x418592['query']=_[_0xfdbb('0x31')](_0xe7b95d[_0xfdbb('0x32')]);_0x418592[_0xfdbb('0x33')]=_[_0xfdbb('0x36')](_0x418592[_0xfdbb('0x34')],_0x418592[_0xfdbb('0x32')]);_0x4ad7a5[_0xfdbb('0x35')]=_[_0xfdbb('0x36')](_0x418592['model'],qs[_0xfdbb('0x37')](_0xe7b95d[_0xfdbb('0x32')][_0xfdbb('0x37')]));_0x4ad7a5[_0xfdbb('0x35')]=_0x4ad7a5[_0xfdbb('0x35')][_0xfdbb('0x38')]?_0x4ad7a5[_0xfdbb('0x35')]:_0x418592[_0xfdbb('0x34')];_0x4ad7a5[_0xfdbb('0x3b')]=qs[_0xfdbb('0x3c')](_0xe7b95d['query'][_0xfdbb('0x3c')]);_0x4ad7a5['where']=qs['filters'](_[_0xfdbb('0x3e')](_0xe7b95d[_0xfdbb('0x32')],_0x418592['filters']));if(_0xe7b95d[_0xfdbb('0x32')][_0xfdbb('0x3f')]){_0x4ad7a5[_0xfdbb('0x3d')]=_[_0xfdbb('0x40')](_0x4ad7a5[_0xfdbb('0x3d')],{'$or':_[_0xfdbb('0x2f')](_0x4ad7a5['attributes'],function(_0x1ba966){var _0x1230f9={};_0x1230f9[_0x1ba966]={'$like':'%'+_0xe7b95d[_0xfdbb('0x32')][_0xfdbb('0x3f')]+'%'};return _0x1230f9;})});}_0x4ad7a5=_['merge']({},_0x4ad7a5,_0xe7b95d[_0xfdbb('0x42')]);return _0x214fcb[_0xfdbb('0x4c')](_0x4ad7a5);}})[_0xfdbb('0x27')](function(_0x399b26){if(_0x399b26){_0x1acdbb=_0x399b26[_0xfdbb('0x38')];if(!_0xe7b95d['query'][_0xfdbb('0x4f')](_0xfdbb('0x39'))){_0x4ad7a5[_0xfdbb('0x3a')]=qs[_0xfdbb('0x3a')](_0xe7b95d[_0xfdbb('0x32')][_0xfdbb('0x3a')]);_0x4ad7a5[_0xfdbb('0x1d')]=qs['offset'](_0xe7b95d[_0xfdbb('0x32')][_0xfdbb('0x1d')]);}return _0x214fcb['getFields'](_0x4ad7a5);}})[_0xfdbb('0x27')](function(_0x5f50a8){if(_0x5f50a8){return _0x5f50a8?{'count':_0x1acdbb,'rows':_0x5f50a8}:null;}})[_0xfdbb('0x27')](respondWithResult(_0x1be795,null))[_0xfdbb('0x47')](handleError(_0x1be795,null));};exports['getSubjects']=function(_0xf1459a,_0x454872,_0x3d94de){var _0x295615={};var _0x2af8bf={};var _0x31154e;var _0x25be69;return db[_0xfdbb('0x43')][_0xfdbb('0x4d')]({'where':{'id':_0xf1459a[_0xfdbb('0x48')]['id']}})[_0xfdbb('0x27')](handleEntityNotFound(_0x454872,null))[_0xfdbb('0x27')](function(_0x1ed1da){if(_0x1ed1da){_0x31154e=_0x1ed1da;_0x2af8bf[_0xfdbb('0x34')]=_[_0xfdbb('0x31')](db[_0xfdbb('0x4e')]['rawAttributes']);_0x2af8bf[_0xfdbb('0x32')]=_[_0xfdbb('0x31')](_0xf1459a[_0xfdbb('0x32')]);_0x2af8bf[_0xfdbb('0x33')]=_[_0xfdbb('0x36')](_0x2af8bf['model'],_0x2af8bf['query']);_0x295615[_0xfdbb('0x35')]=_[_0xfdbb('0x36')](_0x2af8bf[_0xfdbb('0x34')],qs[_0xfdbb('0x37')](_0xf1459a[_0xfdbb('0x32')][_0xfdbb('0x37')]));_0x295615[_0xfdbb('0x35')]=_0x295615[_0xfdbb('0x35')][_0xfdbb('0x38')]?_0x295615['attributes']:_0x2af8bf[_0xfdbb('0x34')];_0x295615[_0xfdbb('0x3b')]=qs[_0xfdbb('0x3c')](_0xf1459a[_0xfdbb('0x32')][_0xfdbb('0x3c')]);_0x295615[_0xfdbb('0x3d')]=qs[_0xfdbb('0x33')](_['pick'](_0xf1459a[_0xfdbb('0x32')],_0x2af8bf[_0xfdbb('0x33')]));if(_0xf1459a['query'][_0xfdbb('0x3f')]){_0x295615[_0xfdbb('0x3d')]=_[_0xfdbb('0x40')](_0x295615['where'],{'$or':_[_0xfdbb('0x2f')](_0x295615['attributes'],function(_0x52db0d){var _0x3d0547={};_0x3d0547[_0x52db0d]={'$like':'%'+_0xf1459a[_0xfdbb('0x32')]['filter']+'%'};return _0x3d0547;})});}_0x295615=_[_0xfdbb('0x40')]({},_0x295615,_0xf1459a[_0xfdbb('0x42')]);return _0x31154e[_0xfdbb('0x50')](_0x295615);}})['then'](function(_0x5b5e93){if(_0x5b5e93){_0x25be69=_0x5b5e93[_0xfdbb('0x38')];if(!_0xf1459a['query'][_0xfdbb('0x4f')]('nolimit')){_0x295615[_0xfdbb('0x3a')]=qs[_0xfdbb('0x3a')](_0xf1459a[_0xfdbb('0x32')][_0xfdbb('0x3a')]);_0x295615[_0xfdbb('0x1d')]=qs['offset'](_0xf1459a[_0xfdbb('0x32')]['offset']);}return _0x31154e[_0xfdbb('0x50')](_0x295615);}})[_0xfdbb('0x27')](function(_0x33a1a4){if(_0x33a1a4){return _0x33a1a4?{'count':_0x25be69,'rows':_0x33a1a4}:null;}})[_0xfdbb('0x27')](respondWithResult(_0x454872,null))[_0xfdbb('0x47')](handleError(_0x454872,null));};exports[_0xfdbb('0x51')]=function(_0x4df6b2,_0x3891b9,_0x3601f0){var _0x5383e4={};var _0x505ad1={};var _0x49b42e;var _0x57f572;return db[_0xfdbb('0x43')][_0xfdbb('0x4d')]({'where':{'id':_0x4df6b2[_0xfdbb('0x48')]['id']}})[_0xfdbb('0x27')](handleEntityNotFound(_0x3891b9,null))[_0xfdbb('0x27')](function(_0x431b9b){if(_0x431b9b){_0x49b42e=_0x431b9b;_0x505ad1[_0xfdbb('0x34')]=_[_0xfdbb('0x31')](db[_0xfdbb('0x4e')][_0xfdbb('0x2b')]);_0x505ad1[_0xfdbb('0x32')]=_['keys'](_0x4df6b2[_0xfdbb('0x32')]);_0x505ad1[_0xfdbb('0x33')]=_[_0xfdbb('0x36')](_0x505ad1[_0xfdbb('0x34')],_0x505ad1[_0xfdbb('0x32')]);_0x5383e4['attributes']=_[_0xfdbb('0x36')](_0x505ad1[_0xfdbb('0x34')],qs[_0xfdbb('0x37')](_0x4df6b2[_0xfdbb('0x32')][_0xfdbb('0x37')]));_0x5383e4[_0xfdbb('0x35')]=_0x5383e4[_0xfdbb('0x35')][_0xfdbb('0x38')]?_0x5383e4[_0xfdbb('0x35')]:_0x505ad1['model'];_0x5383e4[_0xfdbb('0x3b')]=qs[_0xfdbb('0x3c')](_0x4df6b2[_0xfdbb('0x32')]['sort']);_0x5383e4[_0xfdbb('0x3d')]=qs[_0xfdbb('0x33')](_[_0xfdbb('0x3e')](_0x4df6b2[_0xfdbb('0x32')],_0x505ad1[_0xfdbb('0x33')]));if(_0x4df6b2[_0xfdbb('0x32')][_0xfdbb('0x3f')]){_0x5383e4[_0xfdbb('0x3d')]=_[_0xfdbb('0x40')](_0x5383e4[_0xfdbb('0x3d')],{'$or':_[_0xfdbb('0x2f')](_0x5383e4[_0xfdbb('0x35')],function(_0x5d1591){var _0x482c37={};_0x482c37[_0x5d1591]={'$like':'%'+_0x4df6b2['query'][_0xfdbb('0x3f')]+'%'};return _0x482c37;})});}_0x5383e4=_['merge']({},_0x5383e4,_0x4df6b2[_0xfdbb('0x42')]);return _0x49b42e['getDescriptions'](_0x5383e4);}})[_0xfdbb('0x27')](function(_0x9976e9){if(_0x9976e9){_0x57f572=_0x9976e9['length'];if(!_0x4df6b2[_0xfdbb('0x32')][_0xfdbb('0x4f')](_0xfdbb('0x39'))){_0x5383e4[_0xfdbb('0x3a')]=qs[_0xfdbb('0x3a')](_0x4df6b2[_0xfdbb('0x32')][_0xfdbb('0x3a')]);_0x5383e4[_0xfdbb('0x1d')]=qs[_0xfdbb('0x1d')](_0x4df6b2[_0xfdbb('0x32')][_0xfdbb('0x1d')]);}return _0x49b42e[_0xfdbb('0x51')](_0x5383e4);}})[_0xfdbb('0x27')](function(_0x393534){if(_0x393534){return _0x393534?{'count':_0x57f572,'rows':_0x393534}:null;}})[_0xfdbb('0x27')](respondWithResult(_0x3891b9,null))[_0xfdbb('0x47')](handleError(_0x3891b9,null));}; \ No newline at end of file +var _0xd7b2=['key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getFields','findOne','hasOwnProperty','getSubjects','Dynamics365Field','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','index','map','Dynamics365Configuration','rawAttributes','type'];(function(_0x53441a,_0x42ee13){var _0x53ab65=function(_0x258eb6){while(--_0x258eb6){_0x53441a['push'](_0x53441a['shift']());}};_0x53ab65(++_0x42ee13);}(_0xd7b2,0x76));var _0x2d7b=function(_0x373a0c,_0x4f44b5){_0x373a0c=_0x373a0c-0x0;var _0x4f0f61=_0xd7b2[_0x373a0c];return _0x4f0f61;};'use strict';var emlformat=require(_0x2d7b('0x0'));var rimraf=require(_0x2d7b('0x1'));var zipdir=require(_0x2d7b('0x2'));var jsonpatch=require(_0x2d7b('0x3'));var rp=require(_0x2d7b('0x4'));var moment=require(_0x2d7b('0x5'));var BPromise=require(_0x2d7b('0x6'));var Mustache=require(_0x2d7b('0x7'));var util=require(_0x2d7b('0x8'));var path=require(_0x2d7b('0x9'));var sox=require(_0x2d7b('0xa'));var csv=require('to-csv');var ejs=require(_0x2d7b('0xb'));var fs=require('fs');var fs_extra=require(_0x2d7b('0xc'));var _=require(_0x2d7b('0xd'));var squel=require(_0x2d7b('0xe'));var crypto=require(_0x2d7b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2d7b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2d7b('0x11'));var Papa=require(_0x2d7b('0x12'));var Redis=require(_0x2d7b('0x13'));var authService=require(_0x2d7b('0x14'));var qs=require(_0x2d7b('0x15'));var as=require(_0x2d7b('0x16'));var hardwareService=require(_0x2d7b('0x17'));var logger=require(_0x2d7b('0x18'))(_0x2d7b('0x19'));var utils=require(_0x2d7b('0x1a'));var config=require(_0x2d7b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x204cea,_0x186125){_0x186125=_0x186125||0xcc;return function(_0x18e4d0){if(_0x18e4d0){return _0x204cea[_0x2d7b('0x1c')](_0x186125);}return _0x204cea[_0x2d7b('0x1d')](_0x186125)[_0x2d7b('0x1e')]();};}function respondWithResult(_0x4d46b7,_0x430e86){_0x430e86=_0x430e86||0xc8;return function(_0xc47e2){if(_0xc47e2){return _0x4d46b7[_0x2d7b('0x1d')](_0x430e86)[_0x2d7b('0x1f')](_0xc47e2);}};}function respondWithFilteredResult(_0x5c1781,_0x22e878){return function(_0x3bb78d){if(_0x3bb78d){var _0x2b3d75=typeof _0x22e878[_0x2d7b('0x20')]===_0x2d7b('0x21')&&typeof _0x22e878[_0x2d7b('0x22')]===_0x2d7b('0x21');var _0x8bfaeb=_0x3bb78d[_0x2d7b('0x23')];var _0x4fcebe=_0x2b3d75?0x0:_0x22e878[_0x2d7b('0x20')];var _0x166474=_0x2b3d75?_0x3bb78d[_0x2d7b('0x23')]:_0x22e878['offset']+_0x22e878[_0x2d7b('0x22')];var _0x1cf46a;if(_0x166474>=_0x8bfaeb){_0x166474=_0x8bfaeb;_0x1cf46a=0xc8;}else{_0x1cf46a=0xce;}_0x5c1781[_0x2d7b('0x1d')](_0x1cf46a);return _0x5c1781[_0x2d7b('0x24')]('Content-Range',_0x4fcebe+'-'+_0x166474+'/'+_0x8bfaeb)[_0x2d7b('0x1f')](_0x3bb78d);}return null;};}function patchUpdates(_0x374baa){return function(_0x443400){try{jsonpatch['apply'](_0x443400,_0x374baa,!![]);}catch(_0x944814){return BPromise[_0x2d7b('0x25')](_0x944814);}return _0x443400[_0x2d7b('0x26')]();};}function saveUpdates(_0x16d3a2,_0x38f2d2){return function(_0x44b1f0){if(_0x44b1f0){return _0x44b1f0[_0x2d7b('0x27')](_0x16d3a2)[_0x2d7b('0x28')](function(_0x3907a6){return _0x3907a6;});}return null;};}function removeEntity(_0x58e772,_0x575824){return function(_0x3e170e){if(_0x3e170e){return _0x3e170e[_0x2d7b('0x29')]()[_0x2d7b('0x28')](function(){_0x58e772[_0x2d7b('0x1d')](0xcc)[_0x2d7b('0x1e')]();});}};}function handleEntityNotFound(_0x38da62,_0x2c29af){return function(_0x19ee01){if(!_0x19ee01){_0x38da62[_0x2d7b('0x1c')](0x194);}return _0x19ee01;};}function handleError(_0x177b5a,_0x40020c){_0x40020c=_0x40020c||0x1f4;return function(_0x1e8704){logger[_0x2d7b('0x2a')](_0x1e8704[_0x2d7b('0x2b')]);if(_0x1e8704[_0x2d7b('0x2c')]){delete _0x1e8704[_0x2d7b('0x2c')];}_0x177b5a['status'](_0x40020c)['send'](_0x1e8704);};}exports[_0x2d7b('0x2d')]=function(_0x2f9dd7,_0x1103e7){var _0x406b52={},_0x3897f4={},_0x5586b4={'count':0x0,'rows':[]};var _0x522a96=_[_0x2d7b('0x2e')](db[_0x2d7b('0x2f')][_0x2d7b('0x30')],function(_0x2f870c){return{'name':_0x2f870c['fieldName'],'type':_0x2f870c[_0x2d7b('0x31')][_0x2d7b('0x32')]};});_0x3897f4[_0x2d7b('0x33')]=_[_0x2d7b('0x2e')](_0x522a96,'name');_0x3897f4[_0x2d7b('0x34')]=_[_0x2d7b('0x35')](_0x2f9dd7[_0x2d7b('0x34')]);_0x3897f4['filters']=_[_0x2d7b('0x36')](_0x3897f4['model'],_0x3897f4['query']);_0x406b52[_0x2d7b('0x37')]=_[_0x2d7b('0x36')](_0x3897f4[_0x2d7b('0x33')],qs[_0x2d7b('0x38')](_0x2f9dd7[_0x2d7b('0x34')][_0x2d7b('0x38')]));_0x406b52[_0x2d7b('0x37')]=_0x406b52['attributes'][_0x2d7b('0x39')]?_0x406b52[_0x2d7b('0x37')]:_0x3897f4['model'];if(!_0x2f9dd7['query']['hasOwnProperty']('nolimit')){_0x406b52[_0x2d7b('0x22')]=qs[_0x2d7b('0x22')](_0x2f9dd7[_0x2d7b('0x34')][_0x2d7b('0x22')]);_0x406b52[_0x2d7b('0x20')]=qs[_0x2d7b('0x20')](_0x2f9dd7['query']['offset']);}_0x406b52[_0x2d7b('0x3a')]=qs[_0x2d7b('0x3b')](_0x2f9dd7[_0x2d7b('0x34')][_0x2d7b('0x3b')]);_0x406b52[_0x2d7b('0x3c')]=qs[_0x2d7b('0x3d')](_[_0x2d7b('0x3e')](_0x2f9dd7[_0x2d7b('0x34')],_0x3897f4[_0x2d7b('0x3d')]),_0x522a96);if(_0x2f9dd7[_0x2d7b('0x34')][_0x2d7b('0x3f')]){_0x406b52[_0x2d7b('0x3c')]=_[_0x2d7b('0x40')](_0x406b52[_0x2d7b('0x3c')],{'$or':_[_0x2d7b('0x2e')](_0x522a96,function(_0x48062b){if(_0x48062b[_0x2d7b('0x31')]!==_0x2d7b('0x41')){var _0x906d0={};_0x906d0[_0x48062b[_0x2d7b('0x2c')]]={'$like':'%'+_0x2f9dd7[_0x2d7b('0x34')][_0x2d7b('0x3f')]+'%'};return _0x906d0;}})});}_0x406b52=_[_0x2d7b('0x40')]({},_0x406b52,_0x2f9dd7[_0x2d7b('0x42')]);var _0x48197c={'where':_0x406b52['where']};return db[_0x2d7b('0x2f')][_0x2d7b('0x23')](_0x48197c)['then'](function(_0x38f8db){_0x5586b4[_0x2d7b('0x23')]=_0x38f8db;if(_0x2f9dd7[_0x2d7b('0x34')][_0x2d7b('0x43')]){_0x406b52['include']=[{'all':!![]}];}return db[_0x2d7b('0x2f')][_0x2d7b('0x44')](_0x406b52);})['then'](function(_0x52f3ae){_0x5586b4[_0x2d7b('0x45')]=_0x52f3ae;return _0x5586b4;})[_0x2d7b('0x28')](respondWithFilteredResult(_0x1103e7,_0x406b52))['catch'](handleError(_0x1103e7,null));};exports[_0x2d7b('0x46')]=function(_0x4d3b8d,_0x45ad98){var _0x11b299={'raw':![],'where':{'id':_0x4d3b8d[_0x2d7b('0x47')]['id']}},_0x61687b={};_0x61687b[_0x2d7b('0x33')]=_[_0x2d7b('0x35')](db[_0x2d7b('0x2f')][_0x2d7b('0x30')]);_0x61687b[_0x2d7b('0x34')]=_[_0x2d7b('0x35')](_0x4d3b8d[_0x2d7b('0x34')]);_0x61687b['filters']=_['intersection'](_0x61687b[_0x2d7b('0x33')],_0x61687b[_0x2d7b('0x34')]);_0x11b299[_0x2d7b('0x37')]=_[_0x2d7b('0x36')](_0x61687b['model'],qs[_0x2d7b('0x38')](_0x4d3b8d['query'][_0x2d7b('0x38')]));_0x11b299[_0x2d7b('0x37')]=_0x11b299[_0x2d7b('0x37')][_0x2d7b('0x39')]?_0x11b299[_0x2d7b('0x37')]:_0x61687b[_0x2d7b('0x33')];if(_0x4d3b8d['query'][_0x2d7b('0x43')]){_0x11b299[_0x2d7b('0x48')]=[{'all':!![]}];}_0x11b299=_['merge']({},_0x11b299,_0x4d3b8d[_0x2d7b('0x42')]);return db[_0x2d7b('0x2f')][_0x2d7b('0x49')](_0x11b299)[_0x2d7b('0x28')](handleEntityNotFound(_0x45ad98,null))[_0x2d7b('0x28')](respondWithResult(_0x45ad98,null))[_0x2d7b('0x4a')](handleError(_0x45ad98,null));};exports['create']=function(_0x1f792d,_0x5b632f){return db[_0x2d7b('0x2f')][_0x2d7b('0x4b')](_0x1f792d['body'],{})[_0x2d7b('0x28')](respondWithResult(_0x5b632f,0xc9))[_0x2d7b('0x4a')](handleError(_0x5b632f,null));};exports['update']=function(_0x4a2989,_0x4d8cfa){if(_0x4a2989[_0x2d7b('0x4c')]['id']){delete _0x4a2989[_0x2d7b('0x4c')]['id'];}return db[_0x2d7b('0x2f')][_0x2d7b('0x49')]({'where':{'id':_0x4a2989[_0x2d7b('0x47')]['id']}})[_0x2d7b('0x28')](handleEntityNotFound(_0x4d8cfa,null))[_0x2d7b('0x28')](saveUpdates(_0x4a2989[_0x2d7b('0x4c')],null))[_0x2d7b('0x28')](respondWithResult(_0x4d8cfa,null))[_0x2d7b('0x4a')](handleError(_0x4d8cfa,null));};exports[_0x2d7b('0x29')]=function(_0x197d8c,_0x22c0e1){return db[_0x2d7b('0x2f')]['find']({'where':{'id':_0x197d8c[_0x2d7b('0x47')]['id']}})['then'](handleEntityNotFound(_0x22c0e1,null))['then'](removeEntity(_0x22c0e1,null))[_0x2d7b('0x4a')](handleError(_0x22c0e1,null));};exports[_0x2d7b('0x4d')]=function(_0x4f4f68,_0x1bfa82,_0x2497b2){var _0x42ef03={};var _0x4260a8={};var _0x95dfa4;var _0x24fbcd;return db[_0x2d7b('0x2f')][_0x2d7b('0x4e')]({'where':{'id':_0x4f4f68[_0x2d7b('0x47')]['id']}})[_0x2d7b('0x28')](handleEntityNotFound(_0x1bfa82,null))[_0x2d7b('0x28')](function(_0x1a3d75){if(_0x1a3d75){_0x95dfa4=_0x1a3d75;_0x4260a8[_0x2d7b('0x33')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x4260a8[_0x2d7b('0x34')]=_[_0x2d7b('0x35')](_0x4f4f68['query']);_0x4260a8['filters']=_[_0x2d7b('0x36')](_0x4260a8[_0x2d7b('0x33')],_0x4260a8[_0x2d7b('0x34')]);_0x42ef03['attributes']=_[_0x2d7b('0x36')](_0x4260a8[_0x2d7b('0x33')],qs['fields'](_0x4f4f68[_0x2d7b('0x34')][_0x2d7b('0x38')]));_0x42ef03[_0x2d7b('0x37')]=_0x42ef03[_0x2d7b('0x37')][_0x2d7b('0x39')]?_0x42ef03[_0x2d7b('0x37')]:_0x4260a8[_0x2d7b('0x33')];_0x42ef03['order']=qs[_0x2d7b('0x3b')](_0x4f4f68['query'][_0x2d7b('0x3b')]);_0x42ef03[_0x2d7b('0x3c')]=qs['filters'](_[_0x2d7b('0x3e')](_0x4f4f68[_0x2d7b('0x34')],_0x4260a8[_0x2d7b('0x3d')]));if(_0x4f4f68[_0x2d7b('0x34')][_0x2d7b('0x3f')]){_0x42ef03[_0x2d7b('0x3c')]=_[_0x2d7b('0x40')](_0x42ef03[_0x2d7b('0x3c')],{'$or':_[_0x2d7b('0x2e')](_0x42ef03[_0x2d7b('0x37')],function(_0x1d0b32){var _0x35099e={};_0x35099e[_0x1d0b32]={'$like':'%'+_0x4f4f68[_0x2d7b('0x34')][_0x2d7b('0x3f')]+'%'};return _0x35099e;})});}_0x42ef03=_['merge']({},_0x42ef03,_0x4f4f68[_0x2d7b('0x42')]);return _0x95dfa4[_0x2d7b('0x4d')](_0x42ef03);}})[_0x2d7b('0x28')](function(_0x35f999){if(_0x35f999){_0x24fbcd=_0x35f999['length'];if(!_0x4f4f68[_0x2d7b('0x34')][_0x2d7b('0x4f')]('nolimit')){_0x42ef03['limit']=qs[_0x2d7b('0x22')](_0x4f4f68[_0x2d7b('0x34')][_0x2d7b('0x22')]);_0x42ef03['offset']=qs[_0x2d7b('0x20')](_0x4f4f68['query']['offset']);}return _0x95dfa4[_0x2d7b('0x4d')](_0x42ef03);}})[_0x2d7b('0x28')](function(_0x6b1322){if(_0x6b1322){return _0x6b1322?{'count':_0x24fbcd,'rows':_0x6b1322}:null;}})[_0x2d7b('0x28')](respondWithResult(_0x1bfa82,null))['catch'](handleError(_0x1bfa82,null));};exports[_0x2d7b('0x50')]=function(_0x3d4f12,_0x142bb4,_0x23dc8f){var _0x5a804c={};var _0x1dc989={};var _0x2b95c6;var _0x368b58;return db[_0x2d7b('0x2f')][_0x2d7b('0x4e')]({'where':{'id':_0x3d4f12[_0x2d7b('0x47')]['id']}})[_0x2d7b('0x28')](handleEntityNotFound(_0x142bb4,null))[_0x2d7b('0x28')](function(_0x25e9f4){if(_0x25e9f4){_0x2b95c6=_0x25e9f4;_0x1dc989['model']=_['keys'](db[_0x2d7b('0x51')][_0x2d7b('0x30')]);_0x1dc989[_0x2d7b('0x34')]=_[_0x2d7b('0x35')](_0x3d4f12[_0x2d7b('0x34')]);_0x1dc989[_0x2d7b('0x3d')]=_[_0x2d7b('0x36')](_0x1dc989[_0x2d7b('0x33')],_0x1dc989[_0x2d7b('0x34')]);_0x5a804c['attributes']=_[_0x2d7b('0x36')](_0x1dc989['model'],qs[_0x2d7b('0x38')](_0x3d4f12[_0x2d7b('0x34')][_0x2d7b('0x38')]));_0x5a804c[_0x2d7b('0x37')]=_0x5a804c['attributes'][_0x2d7b('0x39')]?_0x5a804c[_0x2d7b('0x37')]:_0x1dc989['model'];_0x5a804c[_0x2d7b('0x3a')]=qs[_0x2d7b('0x3b')](_0x3d4f12[_0x2d7b('0x34')]['sort']);_0x5a804c[_0x2d7b('0x3c')]=qs[_0x2d7b('0x3d')](_[_0x2d7b('0x3e')](_0x3d4f12[_0x2d7b('0x34')],_0x1dc989[_0x2d7b('0x3d')]));if(_0x3d4f12[_0x2d7b('0x34')][_0x2d7b('0x3f')]){_0x5a804c['where']=_[_0x2d7b('0x40')](_0x5a804c[_0x2d7b('0x3c')],{'$or':_[_0x2d7b('0x2e')](_0x5a804c[_0x2d7b('0x37')],function(_0xcb7ae8){var _0x1ffbff={};_0x1ffbff[_0xcb7ae8]={'$like':'%'+_0x3d4f12['query']['filter']+'%'};return _0x1ffbff;})});}_0x5a804c=_[_0x2d7b('0x40')]({},_0x5a804c,_0x3d4f12[_0x2d7b('0x42')]);return _0x2b95c6[_0x2d7b('0x50')](_0x5a804c);}})['then'](function(_0x5b0757){if(_0x5b0757){_0x368b58=_0x5b0757['length'];if(!_0x3d4f12[_0x2d7b('0x34')]['hasOwnProperty'](_0x2d7b('0x52'))){_0x5a804c[_0x2d7b('0x22')]=qs[_0x2d7b('0x22')](_0x3d4f12[_0x2d7b('0x34')]['limit']);_0x5a804c['offset']=qs[_0x2d7b('0x20')](_0x3d4f12[_0x2d7b('0x34')]['offset']);}return _0x2b95c6[_0x2d7b('0x50')](_0x5a804c);}})[_0x2d7b('0x28')](function(_0x4fb53a){if(_0x4fb53a){return _0x4fb53a?{'count':_0x368b58,'rows':_0x4fb53a}:null;}})[_0x2d7b('0x28')](respondWithResult(_0x142bb4,null))[_0x2d7b('0x4a')](handleError(_0x142bb4,null));};exports[_0x2d7b('0x53')]=function(_0x330d5c,_0x457c37,_0x3101c3){var _0x1bf136={};var _0x120bb9={};var _0x49e381;var _0x5c6684;return db['Dynamics365Configuration'][_0x2d7b('0x4e')]({'where':{'id':_0x330d5c['params']['id']}})['then'](handleEntityNotFound(_0x457c37,null))[_0x2d7b('0x28')](function(_0x2490a5){if(_0x2490a5){_0x49e381=_0x2490a5;_0x120bb9[_0x2d7b('0x33')]=_[_0x2d7b('0x35')](db['Dynamics365Field'][_0x2d7b('0x30')]);_0x120bb9[_0x2d7b('0x34')]=_[_0x2d7b('0x35')](_0x330d5c[_0x2d7b('0x34')]);_0x120bb9[_0x2d7b('0x3d')]=_[_0x2d7b('0x36')](_0x120bb9[_0x2d7b('0x33')],_0x120bb9[_0x2d7b('0x34')]);_0x1bf136['attributes']=_['intersection'](_0x120bb9[_0x2d7b('0x33')],qs[_0x2d7b('0x38')](_0x330d5c[_0x2d7b('0x34')][_0x2d7b('0x38')]));_0x1bf136['attributes']=_0x1bf136[_0x2d7b('0x37')][_0x2d7b('0x39')]?_0x1bf136[_0x2d7b('0x37')]:_0x120bb9[_0x2d7b('0x33')];_0x1bf136[_0x2d7b('0x3a')]=qs[_0x2d7b('0x3b')](_0x330d5c[_0x2d7b('0x34')][_0x2d7b('0x3b')]);_0x1bf136[_0x2d7b('0x3c')]=qs['filters'](_[_0x2d7b('0x3e')](_0x330d5c[_0x2d7b('0x34')],_0x120bb9[_0x2d7b('0x3d')]));if(_0x330d5c['query'][_0x2d7b('0x3f')]){_0x1bf136[_0x2d7b('0x3c')]=_[_0x2d7b('0x40')](_0x1bf136[_0x2d7b('0x3c')],{'$or':_[_0x2d7b('0x2e')](_0x1bf136[_0x2d7b('0x37')],function(_0x9ee31d){var _0x23aeef={};_0x23aeef[_0x9ee31d]={'$like':'%'+_0x330d5c[_0x2d7b('0x34')][_0x2d7b('0x3f')]+'%'};return _0x23aeef;})});}_0x1bf136=_[_0x2d7b('0x40')]({},_0x1bf136,_0x330d5c[_0x2d7b('0x42')]);return _0x49e381[_0x2d7b('0x53')](_0x1bf136);}})[_0x2d7b('0x28')](function(_0x336e98){if(_0x336e98){_0x5c6684=_0x336e98['length'];if(!_0x330d5c[_0x2d7b('0x34')]['hasOwnProperty']('nolimit')){_0x1bf136[_0x2d7b('0x22')]=qs[_0x2d7b('0x22')](_0x330d5c[_0x2d7b('0x34')]['limit']);_0x1bf136['offset']=qs[_0x2d7b('0x20')](_0x330d5c[_0x2d7b('0x34')][_0x2d7b('0x20')]);}return _0x49e381['getDescriptions'](_0x1bf136);}})[_0x2d7b('0x28')](function(_0x2b02c4){if(_0x2b02c4){return _0x2b02c4?{'count':_0x5c6684,'rows':_0x2b02c4}:null;}})[_0x2d7b('0x28')](respondWithResult(_0x457c37,null))['catch'](handleError(_0x457c37,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 835ed4a..8602a5e 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x2771a3,_0x14c6ee){var _0x5f4975=function(_0x2b0f6d){while(--_0x2b0f6d){_0x2771a3['push'](_0x2771a3['shift']());}};_0x5f4975(++_0x14c6ee);}(_0x9f62,0x154));var _0x29f6=function(_0x577789,_0x4935f1){_0x577789=_0x577789-0x0;var _0x2ddb0d=_0x9f62[_0x577789];return _0x2ddb0d;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0xbc1c4f,_0x1861e1){var _0x47920e=function(_0x1f842f){while(--_0x1f842f){_0xbc1c4f['push'](_0xbc1c4f['shift']());}};_0x47920e(++_0x1861e1);}(_0xdace,0xc5));var _0xedac=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0xdace[_0x49a57c];return _0x4e0316;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index b28a820..01a3a81 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 _0xb325=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x41b8e4,_0xbbc896){var _0x2db36a=function(_0x574d46){while(--_0x574d46){_0x41b8e4['push'](_0x41b8e4['shift']());}};_0x2db36a(++_0xbbc896);}(_0xb325,0xf2));var _0x5b32=function(_0x5afbec,_0x411175){_0x5afbec=_0x5afbec-0x0;var _0xd33364=_0xb325[_0x5afbec];return _0xd33364;};'use strict';var _=require(_0x5b32('0x0'));var util=require(_0x5b32('0x1'));var moment=require(_0x5b32('0x2'));var BPromise=require(_0x5b32('0x3'));var rs=require(_0x5b32('0x4'));var fs=require('fs');var Redis=require(_0x5b32('0x5'));var db=require(_0x5b32('0x6'))['db'];var utils=require(_0x5b32('0x7'));var logger=require(_0x5b32('0x8'))(_0x5b32('0x9'));var config=require(_0x5b32('0xa'));var jayson=require(_0x5b32('0xb'));var client=jayson[_0x5b32('0xc')][_0x5b32('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xcd7162,_0xf173bc,_0x461778){return new BPromise(function(_0x2359f2,_0x4ba6b9){return client[_0x5b32('0xe')](_0xcd7162,_0x461778)[_0x5b32('0xf')](function(_0x5ee4c4){logger[_0x5b32('0x10')](_0x5b32('0x11'),_0xf173bc,_0x5b32('0x12'));logger['debug'](_0x5b32('0x13'),_0xf173bc,'request\x20sent',JSON['stringify'](_0x5ee4c4));if(_0x5ee4c4['error']){if(_0x5ee4c4[_0x5b32('0x14')][_0x5b32('0x15')]===0x1f4){logger['error'](_0x5b32('0x11'),_0xf173bc,_0x5ee4c4['error'][_0x5b32('0x16')]);return _0x4ba6b9(_0x5ee4c4[_0x5b32('0x14')][_0x5b32('0x16')]);}logger[_0x5b32('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0xf173bc,_0x5ee4c4[_0x5b32('0x14')][_0x5b32('0x16')]);return _0x2359f2(_0x5ee4c4[_0x5b32('0x14')][_0x5b32('0x16')]);}else{logger[_0x5b32('0x10')](_0x5b32('0x11'),_0xf173bc,_0x5b32('0x12'));_0x2359f2(_0x5ee4c4['result'][_0x5b32('0x16')]);}})[_0x5b32('0x17')](function(_0x1ed2d2){logger[_0x5b32('0x14')](_0x5b32('0x11'),_0xf173bc,_0x1ed2d2);_0x4ba6b9(_0x1ed2d2);});});} \ No newline at end of file +var _0x826c=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x2e8dd3,_0x5bd8ec){var _0x1391b6=function(_0xeea5f4){while(--_0xeea5f4){_0x2e8dd3['push'](_0x2e8dd3['shift']());}};_0x1391b6(++_0x5bd8ec);}(_0x826c,0xda));var _0xc826=function(_0x2b7339,_0x2c57be){_0x2b7339=_0x2b7339-0x0;var _0x1f9d16=_0x826c[_0x2b7339];return _0x1f9d16;};'use strict';var _=require(_0xc826('0x0'));var util=require(_0xc826('0x1'));var moment=require(_0xc826('0x2'));var BPromise=require(_0xc826('0x3'));var rs=require(_0xc826('0x4'));var fs=require('fs');var Redis=require(_0xc826('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc826('0x6'));var logger=require('../../config/logger')(_0xc826('0x7'));var config=require(_0xc826('0x8'));var jayson=require(_0xc826('0x9'));var client=jayson[_0xc826('0xa')][_0xc826('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d5344,_0x1c4e52,_0x1d3ef4){return new BPromise(function(_0x3654a6,_0x3ddebc){return client['request'](_0x5d5344,_0x1d3ef4)[_0xc826('0xc')](function(_0x3c11c9){logger[_0xc826('0xd')](_0xc826('0xe'),_0x1c4e52,_0xc826('0xf'));logger[_0xc826('0x10')](_0xc826('0x11'),_0x1c4e52,_0xc826('0xf'),JSON[_0xc826('0x12')](_0x3c11c9));if(_0x3c11c9[_0xc826('0x13')]){if(_0x3c11c9[_0xc826('0x13')]['code']===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1c4e52,_0x3c11c9[_0xc826('0x13')][_0xc826('0x14')]);return _0x3ddebc(_0x3c11c9['error'][_0xc826('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1c4e52,_0x3c11c9[_0xc826('0x13')][_0xc826('0x14')]);return _0x3654a6(_0x3c11c9[_0xc826('0x13')][_0xc826('0x14')]);}else{logger[_0xc826('0xd')](_0xc826('0xe'),_0x1c4e52,_0xc826('0xf'));_0x3654a6(_0x3c11c9['result'][_0xc826('0x14')]);}})[_0xc826('0x15')](function(_0x1f7412){logger['error'](_0xc826('0xe'),_0x1c4e52,_0x1f7412);_0x3ddebc(_0x1f7412);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index b5d3ba6..73f3466 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 _0xee70=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0x45af57,_0x55a889){var _0x20c4d6=function(_0x1ee883){while(--_0x1ee883){_0x45af57['push'](_0x45af57['shift']());}};_0x20c4d6(++_0x55a889);}(_0xee70,0x149));var _0x0ee7=function(_0x190925,_0x580e89){_0x190925=_0x190925-0x0;var _0x16f3f1=_0xee70[_0x190925];return _0x16f3f1;};'use strict';var multer=require(_0x0ee7('0x0'));var util=require(_0x0ee7('0x1'));var path=require(_0x0ee7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ee7('0x3'));var router=express[_0x0ee7('0x4')]();var fs_extra=require(_0x0ee7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ee7('0x6'));var config=require(_0x0ee7('0x7'));var controller=require(_0x0ee7('0x8'));router[_0x0ee7('0x9')]('/',auth[_0x0ee7('0xa')](),controller['index']);router[_0x0ee7('0x9')](_0x0ee7('0xb'),auth[_0x0ee7('0xa')](),controller[_0x0ee7('0xc')]);router[_0x0ee7('0xd')]('/',auth[_0x0ee7('0xa')](),controller[_0x0ee7('0xe')]);router[_0x0ee7('0xf')](_0x0ee7('0xb'),auth['isAuthenticated'](),controller[_0x0ee7('0x10')]);router[_0x0ee7('0x11')]('/:id',auth[_0x0ee7('0xa')](),controller[_0x0ee7('0x12')]);module[_0x0ee7('0x13')]=router; \ No newline at end of file +var _0x7ba5=['express','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','path','connect-timeout'];(function(_0x18ab13,_0x2900b6){var _0x28d340=function(_0xfa1d44){while(--_0xfa1d44){_0x18ab13['push'](_0x18ab13['shift']());}};_0x28d340(++_0x2900b6);}(_0x7ba5,0x17e));var _0x57ba=function(_0x48da30,_0x34a38d){_0x48da30=_0x48da30-0x0;var _0x269fc2=_0x7ba5[_0x48da30];return _0x269fc2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x57ba('0x0'));var timeout=require(_0x57ba('0x1'));var express=require(_0x57ba('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x57ba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x57ba('0x4'));var controller=require(_0x57ba('0x5'));router[_0x57ba('0x6')]('/',auth[_0x57ba('0x7')](),controller[_0x57ba('0x8')]);router[_0x57ba('0x6')](_0x57ba('0x9'),auth[_0x57ba('0x7')](),controller[_0x57ba('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x57ba('0xb')]);router[_0x57ba('0xc')](_0x57ba('0x9'),auth[_0x57ba('0x7')](),controller[_0x57ba('0xd')]);router['delete'](_0x57ba('0x9'),auth[_0x57ba('0x7')](),controller[_0x57ba('0xe')]);module[_0x57ba('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 6cafa83..464f527 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 _0x2fdd=['string','variable','customVariable','keyValue','STRING','ENUM','sequelize','exports'];(function(_0x231f56,_0x49eff1){var _0x2ccf8c=function(_0x2f2d43){while(--_0x2f2d43){_0x231f56['push'](_0x231f56['shift']());}};_0x2ccf8c(++_0x49eff1);}(_0x2fdd,0x12e));var _0xd2fd=function(_0x32efc8,_0x34ab71){_0x32efc8=_0x32efc8-0x0;var _0x28fd0c=_0x2fdd[_0x32efc8];return _0x28fd0c;};'use strict';var Sequelize=require(_0xd2fd('0x0'));module[_0xd2fd('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd2fd('0x2'),_0xd2fd('0x3'),_0xd2fd('0x4'),_0xd2fd('0x5'),'picklist'),'defaultValue':_0xd2fd('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd2fd('0x6')]},'keyType':{'type':Sequelize[_0xd2fd('0x7')](_0xd2fd('0x2'),_0xd2fd('0x3'),_0xd2fd('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd2fd('0x6')]},'nameField':{'type':Sequelize[_0xd2fd('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd2fd('0x6')]}}; \ No newline at end of file +var _0xfa36=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x3bb572,_0x2ebdfe){var _0xaa58c5=function(_0x43cc91){while(--_0x43cc91){_0x3bb572['push'](_0x3bb572['shift']());}};_0xaa58c5(++_0x2ebdfe);}(_0xfa36,0x1b5));var _0x6fa3=function(_0xb64e9e,_0x519fb2){_0xb64e9e=_0xb64e9e-0x0;var _0x1c63f4=_0xfa36[_0xb64e9e];return _0x1c63f4;};'use strict';var Sequelize=require(_0x6fa3('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6fa3('0x1'),_0x6fa3('0x2'),_0x6fa3('0x3'),_0x6fa3('0x4'),'picklist'),'defaultValue':_0x6fa3('0x1')},'content':{'type':Sequelize[_0x6fa3('0x5')]},'key':{'type':Sequelize[_0x6fa3('0x5')]},'keyType':{'type':Sequelize[_0x6fa3('0x6')](_0x6fa3('0x1'),_0x6fa3('0x2'),_0x6fa3('0x3'))},'keyContent':{'type':Sequelize[_0x6fa3('0x5')]},'idField':{'type':Sequelize[_0x6fa3('0x5')]},'nameField':{'type':Sequelize[_0x6fa3('0x5')]},'customField':{'type':Sequelize[_0x6fa3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6fa3('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 6117f62..b5e648c 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 _0xeffc=['end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x4c3ffe,_0x457374){var _0x28d3eb=function(_0x3ae2a3){while(--_0x3ae2a3){_0x4c3ffe['push'](_0x4c3ffe['shift']());}};_0x28d3eb(++_0x457374);}(_0xeffc,0x7a));var _0xceff=function(_0x1416a9,_0x46225a){_0x1416a9=_0x1416a9-0x0;var _0x3a0e5f=_0xeffc[_0x1416a9];return _0x3a0e5f;};'use strict';var emlformat=require(_0xceff('0x0'));var rimraf=require(_0xceff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xceff('0x2'));var rp=require(_0xceff('0x3'));var moment=require(_0xceff('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xceff('0x5'));var path=require(_0xceff('0x6'));var sox=require(_0xceff('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xceff('0x8'));var _=require(_0xceff('0x9'));var squel=require(_0xceff('0xa'));var crypto=require(_0xceff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xceff('0xc'));var toCsv=require(_0xceff('0xd'));var querystring=require(_0xceff('0xe'));var Papa=require(_0xceff('0xf'));var Redis=require(_0xceff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xceff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xceff('0x12'))('api');var utils=require(_0xceff('0x13'));var config=require(_0xceff('0x14'));var licenseUtil=require(_0xceff('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf55a55,_0x118529){_0x118529=_0x118529||0xcc;return function(_0x3a4a3f){if(_0x3a4a3f){return _0xf55a55[_0xceff('0x16')](_0x118529);}return _0xf55a55[_0xceff('0x17')](_0x118529)[_0xceff('0x18')]();};}function respondWithResult(_0x251eb5,_0x13b805){_0x13b805=_0x13b805||0xc8;return function(_0x9139d5){if(_0x9139d5){return _0x251eb5['status'](_0x13b805)['json'](_0x9139d5);}};}function respondWithFilteredResult(_0x430eba,_0x56f322){return function(_0x350970){if(_0x350970){var _0x9e24a9=typeof _0x56f322['offset']===_0xceff('0x19')&&typeof _0x56f322[_0xceff('0x1a')]===_0xceff('0x19');var _0x289f7e=_0x350970[_0xceff('0x1b')];var _0x4dd08d=_0x9e24a9?0x0:_0x56f322[_0xceff('0x1c')];var _0x520335=_0x9e24a9?_0x350970[_0xceff('0x1b')]:_0x56f322[_0xceff('0x1c')]+_0x56f322[_0xceff('0x1a')];var _0x1fc42a;if(_0x520335>=_0x289f7e){_0x520335=_0x289f7e;_0x1fc42a=0xc8;}else{_0x1fc42a=0xce;}_0x430eba['status'](_0x1fc42a);return _0x430eba[_0xceff('0x1d')](_0xceff('0x1e'),_0x4dd08d+'-'+_0x520335+'/'+_0x289f7e)['json'](_0x350970);}return null;};}function patchUpdates(_0x7822a9){return function(_0x167930){try{jsonpatch[_0xceff('0x1f')](_0x167930,_0x7822a9,!![]);}catch(_0x16ca00){return BPromise[_0xceff('0x20')](_0x16ca00);}return _0x167930[_0xceff('0x21')]();};}function saveUpdates(_0x54871e,_0x3684ac){return function(_0xe830ba){if(_0xe830ba){return _0xe830ba[_0xceff('0x22')](_0x54871e)[_0xceff('0x23')](function(_0x178b4e){return _0x178b4e;});}return null;};}function removeEntity(_0x100ffe,_0x18ace6){return function(_0x58abaf){if(_0x58abaf){return _0x58abaf['destroy']()['then'](function(){_0x100ffe['status'](0xcc)[_0xceff('0x18')]();});}};}function handleEntityNotFound(_0x5a1b72,_0x39b721){return function(_0x202a2d){if(!_0x202a2d){_0x5a1b72[_0xceff('0x16')](0x194);}return _0x202a2d;};}function handleError(_0x53b6f4,_0x2f703c){_0x2f703c=_0x2f703c||0x1f4;return function(_0xd434eb){logger[_0xceff('0x24')](_0xd434eb[_0xceff('0x25')]);if(_0xd434eb[_0xceff('0x26')]){delete _0xd434eb['name'];}_0x53b6f4['status'](_0x2f703c)[_0xceff('0x27')](_0xd434eb);};}exports['index']=function(_0x297653,_0x79fd15){var _0x55da59={},_0xad197a={},_0x5acbaf={'count':0x0,'rows':[]};var _0x22e096=_['map'](db['Dynamics365Field'][_0xceff('0x28')],function(_0x75b6b5){return{'name':_0x75b6b5[_0xceff('0x29')],'type':_0x75b6b5['type'][_0xceff('0x2a')]};});_0xad197a['model']=_['map'](_0x22e096,_0xceff('0x26'));_0xad197a['query']=_[_0xceff('0x2b')](_0x297653[_0xceff('0x2c')]);_0xad197a[_0xceff('0x2d')]=_[_0xceff('0x2e')](_0xad197a['model'],_0xad197a[_0xceff('0x2c')]);_0x55da59[_0xceff('0x2f')]=_[_0xceff('0x2e')](_0xad197a[_0xceff('0x30')],qs[_0xceff('0x31')](_0x297653[_0xceff('0x2c')]['fields']));_0x55da59['attributes']=_0x55da59[_0xceff('0x2f')][_0xceff('0x32')]?_0x55da59[_0xceff('0x2f')]:_0xad197a['model'];if(!_0x297653['query'][_0xceff('0x33')](_0xceff('0x34'))){_0x55da59['limit']=qs[_0xceff('0x1a')](_0x297653['query'][_0xceff('0x1a')]);_0x55da59[_0xceff('0x1c')]=qs[_0xceff('0x1c')](_0x297653['query'][_0xceff('0x1c')]);}_0x55da59[_0xceff('0x35')]=qs[_0xceff('0x36')](_0x297653[_0xceff('0x2c')][_0xceff('0x36')]);_0x55da59['where']=qs['filters'](_[_0xceff('0x37')](_0x297653[_0xceff('0x2c')],_0xad197a[_0xceff('0x2d')]),_0x22e096);if(_0x297653[_0xceff('0x2c')][_0xceff('0x38')]){_0x55da59[_0xceff('0x39')]=_[_0xceff('0x3a')](_0x55da59[_0xceff('0x39')],{'$or':_[_0xceff('0x3b')](_0x22e096,function(_0x24b923){if(_0x24b923['type']!=='VIRTUAL'){var _0xc7ff4c={};_0xc7ff4c[_0x24b923[_0xceff('0x26')]]={'$like':'%'+_0x297653[_0xceff('0x2c')]['filter']+'%'};return _0xc7ff4c;}})});}_0x55da59=_[_0xceff('0x3a')]({},_0x55da59,_0x297653['options']);var _0x3ab77e={'where':_0x55da59['where']};return db[_0xceff('0x3c')][_0xceff('0x1b')](_0x3ab77e)[_0xceff('0x23')](function(_0x38eff1){_0x5acbaf[_0xceff('0x1b')]=_0x38eff1;if(_0x297653[_0xceff('0x2c')][_0xceff('0x3d')]){_0x55da59[_0xceff('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xceff('0x3f')](_0x55da59);})[_0xceff('0x23')](function(_0x2b768d){_0x5acbaf[_0xceff('0x40')]=_0x2b768d;return _0x5acbaf;})[_0xceff('0x23')](respondWithFilteredResult(_0x79fd15,_0x55da59))[_0xceff('0x41')](handleError(_0x79fd15,null));};exports[_0xceff('0x42')]=function(_0x150fbe,_0x261796){var _0x1749be={'raw':!![],'where':{'id':_0x150fbe[_0xceff('0x43')]['id']}},_0xda7171={};_0xda7171[_0xceff('0x30')]=_[_0xceff('0x2b')](db[_0xceff('0x3c')][_0xceff('0x28')]);_0xda7171[_0xceff('0x2c')]=_[_0xceff('0x2b')](_0x150fbe[_0xceff('0x2c')]);_0xda7171[_0xceff('0x2d')]=_[_0xceff('0x2e')](_0xda7171[_0xceff('0x30')],_0xda7171[_0xceff('0x2c')]);_0x1749be['attributes']=_[_0xceff('0x2e')](_0xda7171[_0xceff('0x30')],qs['fields'](_0x150fbe[_0xceff('0x2c')][_0xceff('0x31')]));_0x1749be[_0xceff('0x2f')]=_0x1749be['attributes'][_0xceff('0x32')]?_0x1749be[_0xceff('0x2f')]:_0xda7171[_0xceff('0x30')];if(_0x150fbe[_0xceff('0x2c')][_0xceff('0x3d')]){_0x1749be[_0xceff('0x3e')]=[{'all':!![]}];}_0x1749be=_[_0xceff('0x3a')]({},_0x1749be,_0x150fbe[_0xceff('0x44')]);return db[_0xceff('0x3c')][_0xceff('0x45')](_0x1749be)[_0xceff('0x23')](handleEntityNotFound(_0x261796,null))['then'](respondWithResult(_0x261796,null))[_0xceff('0x41')](handleError(_0x261796,null));};exports[_0xceff('0x46')]=function(_0x153409,_0xa60907){return db[_0xceff('0x3c')][_0xceff('0x46')](_0x153409[_0xceff('0x47')],{})[_0xceff('0x23')](respondWithResult(_0xa60907,0xc9))['catch'](handleError(_0xa60907,null));};exports[_0xceff('0x22')]=function(_0x253cdd,_0x196e6b){if(_0x253cdd['body']['id']){delete _0x253cdd[_0xceff('0x47')]['id'];}return db[_0xceff('0x3c')][_0xceff('0x45')]({'where':{'id':_0x253cdd[_0xceff('0x43')]['id']}})[_0xceff('0x23')](handleEntityNotFound(_0x196e6b,null))[_0xceff('0x23')](saveUpdates(_0x253cdd[_0xceff('0x47')],null))[_0xceff('0x23')](respondWithResult(_0x196e6b,null))['catch'](handleError(_0x196e6b,null));};exports[_0xceff('0x48')]=function(_0x593c6c,_0x3b4909){return db['Dynamics365Field'][_0xceff('0x45')]({'where':{'id':_0x593c6c[_0xceff('0x43')]['id']}})[_0xceff('0x23')](handleEntityNotFound(_0x3b4909,null))[_0xceff('0x23')](removeEntity(_0x3b4909,null))[_0xceff('0x41')](handleError(_0x3b4909,null));}; \ No newline at end of file +var _0x1bfc=['mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','keys','find','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1d781d,_0x11290e){var _0x5391ef=function(_0x274edf){while(--_0x274edf){_0x1d781d['push'](_0x1d781d['shift']());}};_0x5391ef(++_0x11290e);}(_0x1bfc,0xcf));var _0xc1bf=function(_0x35ed2a,_0x4bca58){_0x35ed2a=_0x35ed2a-0x0;var _0x76cc5f=_0x1bfc[_0x35ed2a];return _0x76cc5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1bf('0x0'));var zipdir=require(_0xc1bf('0x1'));var jsonpatch=require(_0xc1bf('0x2'));var rp=require(_0xc1bf('0x3'));var moment=require(_0xc1bf('0x4'));var BPromise=require(_0xc1bf('0x5'));var Mustache=require(_0xc1bf('0x6'));var util=require(_0xc1bf('0x7'));var path=require('path');var sox=require(_0xc1bf('0x8'));var csv=require(_0xc1bf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1bf('0xa'));var _=require(_0xc1bf('0xb'));var squel=require(_0xc1bf('0xc'));var crypto=require(_0xc1bf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc1bf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc1bf('0xf'));var Papa=require('papaparse');var Redis=require(_0xc1bf('0x10'));var authService=require(_0xc1bf('0x11'));var qs=require(_0xc1bf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1bf('0x13'));var logger=require(_0xc1bf('0x14'))('api');var utils=require(_0xc1bf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc1bf('0x16'));var db=require(_0xc1bf('0x17'))['db'];function respondWithStatusCode(_0x5403e3,_0x1d8d8b){_0x1d8d8b=_0x1d8d8b||0xcc;return function(_0x5402bb){if(_0x5402bb){return _0x5403e3['sendStatus'](_0x1d8d8b);}return _0x5403e3[_0xc1bf('0x18')](_0x1d8d8b)[_0xc1bf('0x19')]();};}function respondWithResult(_0x13fe6c,_0x3b80f0){_0x3b80f0=_0x3b80f0||0xc8;return function(_0x5abc87){if(_0x5abc87){return _0x13fe6c[_0xc1bf('0x18')](_0x3b80f0)[_0xc1bf('0x1a')](_0x5abc87);}};}function respondWithFilteredResult(_0x46670d,_0x44df1b){return function(_0x483927){if(_0x483927){var _0x5306b9=typeof _0x44df1b[_0xc1bf('0x1b')]===_0xc1bf('0x1c')&&typeof _0x44df1b[_0xc1bf('0x1d')]==='undefined';var _0x1788d2=_0x483927[_0xc1bf('0x1e')];var _0x253507=_0x5306b9?0x0:_0x44df1b[_0xc1bf('0x1b')];var _0x3c8cf8=_0x5306b9?_0x483927['count']:_0x44df1b['offset']+_0x44df1b[_0xc1bf('0x1d')];var _0x544718;if(_0x3c8cf8>=_0x1788d2){_0x3c8cf8=_0x1788d2;_0x544718=0xc8;}else{_0x544718=0xce;}_0x46670d[_0xc1bf('0x18')](_0x544718);return _0x46670d[_0xc1bf('0x1f')]('Content-Range',_0x253507+'-'+_0x3c8cf8+'/'+_0x1788d2)[_0xc1bf('0x1a')](_0x483927);}return null;};}function patchUpdates(_0x955158){return function(_0x4bab80){try{jsonpatch[_0xc1bf('0x20')](_0x4bab80,_0x955158,!![]);}catch(_0x57d4f9){return BPromise[_0xc1bf('0x21')](_0x57d4f9);}return _0x4bab80[_0xc1bf('0x22')]();};}function saveUpdates(_0x5a400f,_0x3fb644){return function(_0x1afdd9){if(_0x1afdd9){return _0x1afdd9[_0xc1bf('0x23')](_0x5a400f)['then'](function(_0x55a28b){return _0x55a28b;});}return null;};}function removeEntity(_0x3299a6,_0x12894c){return function(_0x42b79a){if(_0x42b79a){return _0x42b79a['destroy']()[_0xc1bf('0x24')](function(){_0x3299a6[_0xc1bf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5382d7,_0x5d02d1){return function(_0x3005af){if(!_0x3005af){_0x5382d7[_0xc1bf('0x25')](0x194);}return _0x3005af;};}function handleError(_0x5dbcf1,_0x274b1d){_0x274b1d=_0x274b1d||0x1f4;return function(_0x3707aa){logger[_0xc1bf('0x26')](_0x3707aa[_0xc1bf('0x27')]);if(_0x3707aa['name']){delete _0x3707aa[_0xc1bf('0x28')];}_0x5dbcf1[_0xc1bf('0x18')](_0x274b1d)[_0xc1bf('0x29')](_0x3707aa);};}exports[_0xc1bf('0x2a')]=function(_0x54577e,_0xb40f18){var _0x532494={},_0xbd9cc4={},_0x1ed193={'count':0x0,'rows':[]};var _0x444325=_['map'](db[_0xc1bf('0x2b')][_0xc1bf('0x2c')],function(_0x411386){return{'name':_0x411386[_0xc1bf('0x2d')],'type':_0x411386[_0xc1bf('0x2e')][_0xc1bf('0x2f')]};});_0xbd9cc4['model']=_['map'](_0x444325,_0xc1bf('0x28'));_0xbd9cc4['query']=_['keys'](_0x54577e[_0xc1bf('0x30')]);_0xbd9cc4[_0xc1bf('0x31')]=_[_0xc1bf('0x32')](_0xbd9cc4[_0xc1bf('0x33')],_0xbd9cc4[_0xc1bf('0x30')]);_0x532494[_0xc1bf('0x34')]=_[_0xc1bf('0x32')](_0xbd9cc4[_0xc1bf('0x33')],qs[_0xc1bf('0x35')](_0x54577e[_0xc1bf('0x30')][_0xc1bf('0x35')]));_0x532494[_0xc1bf('0x34')]=_0x532494[_0xc1bf('0x34')][_0xc1bf('0x36')]?_0x532494[_0xc1bf('0x34')]:_0xbd9cc4[_0xc1bf('0x33')];if(!_0x54577e[_0xc1bf('0x30')]['hasOwnProperty'](_0xc1bf('0x37'))){_0x532494[_0xc1bf('0x1d')]=qs[_0xc1bf('0x1d')](_0x54577e[_0xc1bf('0x30')][_0xc1bf('0x1d')]);_0x532494[_0xc1bf('0x1b')]=qs[_0xc1bf('0x1b')](_0x54577e['query'][_0xc1bf('0x1b')]);}_0x532494[_0xc1bf('0x38')]=qs[_0xc1bf('0x39')](_0x54577e[_0xc1bf('0x30')][_0xc1bf('0x39')]);_0x532494[_0xc1bf('0x3a')]=qs['filters'](_['pick'](_0x54577e['query'],_0xbd9cc4['filters']),_0x444325);if(_0x54577e[_0xc1bf('0x30')][_0xc1bf('0x3b')]){_0x532494['where']=_[_0xc1bf('0x3c')](_0x532494[_0xc1bf('0x3a')],{'$or':_['map'](_0x444325,function(_0x460ede){if(_0x460ede[_0xc1bf('0x2e')]!==_0xc1bf('0x3d')){var _0x1a3818={};_0x1a3818[_0x460ede['name']]={'$like':'%'+_0x54577e[_0xc1bf('0x30')]['filter']+'%'};return _0x1a3818;}})});}_0x532494=_[_0xc1bf('0x3c')]({},_0x532494,_0x54577e[_0xc1bf('0x3e')]);var _0x2869d9={'where':_0x532494[_0xc1bf('0x3a')]};return db['Dynamics365Field'][_0xc1bf('0x1e')](_0x2869d9)[_0xc1bf('0x24')](function(_0x304246){_0x1ed193[_0xc1bf('0x1e')]=_0x304246;if(_0x54577e[_0xc1bf('0x30')][_0xc1bf('0x3f')]){_0x532494[_0xc1bf('0x40')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x532494);})['then'](function(_0x4f9e18){_0x1ed193['rows']=_0x4f9e18;return _0x1ed193;})[_0xc1bf('0x24')](respondWithFilteredResult(_0xb40f18,_0x532494))[_0xc1bf('0x41')](handleError(_0xb40f18,null));};exports['show']=function(_0x12d910,_0x5079fc){var _0x133535={'raw':!![],'where':{'id':_0x12d910['params']['id']}},_0x451d00={};_0x451d00[_0xc1bf('0x33')]=_[_0xc1bf('0x42')](db['Dynamics365Field'][_0xc1bf('0x2c')]);_0x451d00[_0xc1bf('0x30')]=_['keys'](_0x12d910[_0xc1bf('0x30')]);_0x451d00[_0xc1bf('0x31')]=_['intersection'](_0x451d00[_0xc1bf('0x33')],_0x451d00['query']);_0x133535[_0xc1bf('0x34')]=_[_0xc1bf('0x32')](_0x451d00['model'],qs['fields'](_0x12d910[_0xc1bf('0x30')][_0xc1bf('0x35')]));_0x133535[_0xc1bf('0x34')]=_0x133535[_0xc1bf('0x34')][_0xc1bf('0x36')]?_0x133535[_0xc1bf('0x34')]:_0x451d00[_0xc1bf('0x33')];if(_0x12d910[_0xc1bf('0x30')][_0xc1bf('0x3f')]){_0x133535[_0xc1bf('0x40')]=[{'all':!![]}];}_0x133535=_[_0xc1bf('0x3c')]({},_0x133535,_0x12d910[_0xc1bf('0x3e')]);return db[_0xc1bf('0x2b')][_0xc1bf('0x43')](_0x133535)['then'](handleEntityNotFound(_0x5079fc,null))['then'](respondWithResult(_0x5079fc,null))[_0xc1bf('0x41')](handleError(_0x5079fc,null));};exports['create']=function(_0x11ca86,_0xf927a7){return db[_0xc1bf('0x2b')]['create'](_0x11ca86[_0xc1bf('0x44')],{})[_0xc1bf('0x24')](respondWithResult(_0xf927a7,0xc9))[_0xc1bf('0x41')](handleError(_0xf927a7,null));};exports[_0xc1bf('0x23')]=function(_0x98b245,_0x428614){if(_0x98b245[_0xc1bf('0x44')]['id']){delete _0x98b245[_0xc1bf('0x44')]['id'];}return db[_0xc1bf('0x2b')][_0xc1bf('0x43')]({'where':{'id':_0x98b245[_0xc1bf('0x45')]['id']}})[_0xc1bf('0x24')](handleEntityNotFound(_0x428614,null))[_0xc1bf('0x24')](saveUpdates(_0x98b245[_0xc1bf('0x44')],null))['then'](respondWithResult(_0x428614,null))['catch'](handleError(_0x428614,null));};exports[_0xc1bf('0x46')]=function(_0x1d97eb,_0x3e921d){return db[_0xc1bf('0x2b')][_0xc1bf('0x43')]({'where':{'id':_0x1d97eb[_0xc1bf('0x45')]['id']}})[_0xc1bf('0x24')](handleEntityNotFound(_0x3e921d,null))[_0xc1bf('0x24')](removeEntity(_0x3e921d,null))[_0xc1bf('0x41')](handleError(_0x3e921d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 74a7b7e..81d0999 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 _0xdacb=['../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1ef3e5,_0x5d6b3f){var _0x16a4d2=function(_0x5300c3){while(--_0x5300c3){_0x1ef3e5['push'](_0x1ef3e5['shift']());}};_0x16a4d2(++_0x5d6b3f);}(_0xdacb,0x168));var _0xbdac=function(_0x1073d5,_0x3fec6f){_0x1073d5=_0x1073d5-0x0;var _0x13525d=_0xdacb[_0x1073d5];return _0x13525d;};'use strict';var _=require(_0xbdac('0x0'));var util=require(_0xbdac('0x1'));var logger=require(_0xbdac('0x2'))(_0xbdac('0x3'));var moment=require('moment');var BPromise=require(_0xbdac('0x4'));var rp=require(_0xbdac('0x5'));var fs=require('fs');var path=require(_0xbdac('0x6'));var rimraf=require(_0xbdac('0x7'));var config=require(_0xbdac('0x8'));var attributes=require(_0xbdac('0x9'));module['exports']=function(_0x12348a,_0x23ece5){return _0x12348a[_0xbdac('0xa')](_0xbdac('0xb'),attributes,{'tableName':_0xbdac('0xc'),'paranoid':![],'indexes':[{'name':_0xbdac('0xd'),'fields':[_0xbdac('0xe'),_0xbdac('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa032=['dynamics365_unique_index','idField','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0xa032,0x1d6));var _0x2a03=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0xa032[_0x4fda88];return _0xe37511;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2a03('0x0'))(_0x2a03('0x1'));var moment=require(_0x2a03('0x2'));var BPromise=require('bluebird');var rp=require(_0x2a03('0x3'));var fs=require('fs');var path=require(_0x2a03('0x4'));var rimraf=require(_0x2a03('0x5'));var config=require(_0x2a03('0x6'));var attributes=require(_0x2a03('0x7'));module['exports']=function(_0x1b41fb,_0x1be195){return _0x1b41fb[_0x2a03('0x8')](_0x2a03('0x9'),attributes,{'tableName':_0x2a03('0xa'),'paranoid':![],'indexes':[{'name':_0x2a03('0xb'),'fields':[_0x2a03('0xc'),'FieldId'],'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 3a8ec06..e0494d7 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 _0x8b19=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','bluebird','randomstring'];(function(_0x295438,_0x15e23e){var _0x2610cd=function(_0x53b55f){while(--_0x53b55f){_0x295438['push'](_0x295438['shift']());}};_0x2610cd(++_0x15e23e);}(_0x8b19,0x111));var _0x98b1=function(_0x367263,_0x35681b){_0x367263=_0x367263-0x0;var _0xa6ce98=_0x8b19[_0x367263];return _0xa6ce98;};'use strict';var _=require('lodash');var util=require(_0x98b1('0x0'));var moment=require('moment');var BPromise=require(_0x98b1('0x1'));var rs=require(_0x98b1('0x2'));var fs=require('fs');var Redis=require(_0x98b1('0x3'));var db=require(_0x98b1('0x4'))['db'];var utils=require(_0x98b1('0x5'));var logger=require(_0x98b1('0x6'))(_0x98b1('0x7'));var config=require(_0x98b1('0x8'));var jayson=require(_0x98b1('0x9'));var client=jayson[_0x98b1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6eaae8,_0x3de13d,_0x88088){return new BPromise(function(_0x3e75fc,_0x448347){return client[_0x98b1('0xb')](_0x6eaae8,_0x88088)[_0x98b1('0xc')](function(_0x2335bc){logger[_0x98b1('0xd')](_0x98b1('0xe'),_0x3de13d,_0x98b1('0xf'));logger[_0x98b1('0x10')](_0x98b1('0x11'),_0x3de13d,_0x98b1('0xf'),JSON[_0x98b1('0x12')](_0x2335bc));if(_0x2335bc['error']){if(_0x2335bc['error'][_0x98b1('0x13')]===0x1f4){logger[_0x98b1('0x14')](_0x98b1('0xe'),_0x3de13d,_0x2335bc[_0x98b1('0x14')][_0x98b1('0x15')]);return _0x448347(_0x2335bc[_0x98b1('0x14')][_0x98b1('0x15')]);}logger[_0x98b1('0x14')](_0x98b1('0xe'),_0x3de13d,_0x2335bc['error']['message']);return _0x3e75fc(_0x2335bc[_0x98b1('0x14')]['message']);}else{logger['info'](_0x98b1('0xe'),_0x3de13d,_0x98b1('0xf'));_0x3e75fc(_0x2335bc['result'][_0x98b1('0x15')]);}})[_0x98b1('0x16')](function(_0x58cd7b){logger[_0x98b1('0x14')](_0x98b1('0xe'),_0x3de13d,_0x58cd7b);_0x448347(_0x58cd7b);});});} \ No newline at end of file +var _0x3d79=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x40be1a,_0x13b843){var _0x4e6f36=function(_0x85771f){while(--_0x85771f){_0x40be1a['push'](_0x40be1a['shift']());}};_0x4e6f36(++_0x13b843);}(_0x3d79,0xa2));var _0x93d7=function(_0x1b7745,_0x4f684d){_0x1b7745=_0x1b7745-0x0;var _0x2a4fcf=_0x3d79[_0x1b7745];return _0x2a4fcf;};'use strict';var _=require(_0x93d7('0x0'));var util=require(_0x93d7('0x1'));var moment=require(_0x93d7('0x2'));var BPromise=require('bluebird');var rs=require(_0x93d7('0x3'));var fs=require('fs');var Redis=require(_0x93d7('0x4'));var db=require(_0x93d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x93d7('0x6'))(_0x93d7('0x7'));var config=require(_0x93d7('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x185164,_0x1a71f4,_0x588a5e){return new BPromise(function(_0x1c81ab,_0x58d657){return client['request'](_0x185164,_0x588a5e)[_0x93d7('0x9')](function(_0x5e4c17){logger[_0x93d7('0xa')](_0x93d7('0xb'),_0x1a71f4,_0x93d7('0xc'));logger['debug'](_0x93d7('0xd'),_0x1a71f4,'request\x20sent',JSON[_0x93d7('0xe')](_0x5e4c17));if(_0x5e4c17['error']){if(_0x5e4c17['error']['code']===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x1a71f4,_0x5e4c17[_0x93d7('0xf')]['message']);return _0x58d657(_0x5e4c17[_0x93d7('0xf')]['message']);}logger[_0x93d7('0xf')](_0x93d7('0xb'),_0x1a71f4,_0x5e4c17[_0x93d7('0xf')][_0x93d7('0x10')]);return _0x1c81ab(_0x5e4c17[_0x93d7('0xf')][_0x93d7('0x10')]);}else{logger[_0x93d7('0xa')](_0x93d7('0xb'),_0x1a71f4,_0x93d7('0xc'));_0x1c81ab(_0x5e4c17['result'][_0x93d7('0x10')]);}})[_0x93d7('0x11')](function(_0x1622bf){logger['error'](_0x93d7('0xb'),_0x1a71f4,_0x1622bf);_0x58d657(_0x1622bf);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index c7de134..13382fe 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 _0xd98f=['../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x423611,_0x594bc9){var _0x377ed0=function(_0x310297){while(--_0x310297){_0x423611['push'](_0x423611['shift']());}};_0x377ed0(++_0x594bc9);}(_0xd98f,0x158));var _0xfd98=function(_0x3c7fc4,_0x205a3b){_0x3c7fc4=_0x3c7fc4-0x0;var _0x1e9e60=_0xd98f[_0x3c7fc4];return _0x1e9e60;};'use strict';var multer=require(_0xfd98('0x0'));var util=require(_0xfd98('0x1'));var path=require(_0xfd98('0x2'));var timeout=require(_0xfd98('0x3'));var express=require('express');var router=express[_0xfd98('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfd98('0x5'));var interaction=require(_0xfd98('0x6'));var config=require(_0xfd98('0x7'));var controller=require(_0xfd98('0x8'));router[_0xfd98('0x9')]('/',auth[_0xfd98('0xa')](),controller[_0xfd98('0xb')]);router[_0xfd98('0x9')](_0xfd98('0xc'),auth[_0xfd98('0xa')](),controller[_0xfd98('0xd')]);router['get'](_0xfd98('0xe'),auth[_0xfd98('0xa')](),controller[_0xfd98('0xf')]);router[_0xfd98('0x9')](_0xfd98('0x10'),auth['isAuthenticated'](),controller[_0xfd98('0x11')]);router['post']('/',auth[_0xfd98('0xa')](),controller['create']);router[_0xfd98('0x12')](_0xfd98('0xe'),auth[_0xfd98('0xa')](),controller[_0xfd98('0x13')]);router[_0xfd98('0x14')](_0xfd98('0xc'),auth[_0xfd98('0xa')](),controller[_0xfd98('0x15')]);router[_0xfd98('0x16')](_0xfd98('0xc'),auth['isAuthenticated'](),controller[_0xfd98('0x17')]);module[_0xfd98('0x18')]=router; \ No newline at end of file +var _0x2064=['/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','post'];(function(_0x4a3570,_0x169197){var _0x235ca8=function(_0x4d167b){while(--_0x4d167b){_0x4a3570['push'](_0x4a3570['shift']());}};_0x235ca8(++_0x169197);}(_0x2064,0x91));var _0x4206=function(_0xc06b19,_0x4a4230){_0xc06b19=_0xc06b19-0x0;var _0x3f0a2f=_0x2064[_0xc06b19];return _0x3f0a2f;};'use strict';var multer=require(_0x4206('0x0'));var util=require(_0x4206('0x1'));var path=require(_0x4206('0x2'));var timeout=require(_0x4206('0x3'));var express=require(_0x4206('0x4'));var router=express[_0x4206('0x5')]();var fs_extra=require(_0x4206('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4206('0x7'));var config=require(_0x4206('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x4206('0x9')]('/',auth[_0x4206('0xa')](),controller['index']);router['get'](_0x4206('0xb'),auth[_0x4206('0xa')](),controller[_0x4206('0xc')]);router['get']('/:id/configurations',auth[_0x4206('0xa')](),controller['getConfigurations']);router[_0x4206('0x9')](_0x4206('0xd'),auth[_0x4206('0xa')](),controller[_0x4206('0xe')]);router[_0x4206('0xf')]('/',auth[_0x4206('0xa')](),controller['create']);router['post'](_0x4206('0x10'),auth[_0x4206('0xa')](),controller[_0x4206('0x11')]);router[_0x4206('0x12')](_0x4206('0xb'),auth['isAuthenticated'](),controller[_0x4206('0x13')]);router[_0x4206('0x14')](_0x4206('0xb'),auth[_0x4206('0xa')](),controller[_0x4206('0x15')]);module[_0x4206('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 50dd0ef..a89f21e 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 _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x27131c,_0x40c90c){var _0x320bfc=function(_0x2a100e){while(--_0x2a100e){_0x27131c['push'](_0x27131c['shift']());}};_0x320bfc(++_0x40c90c);}(_0xe5af,0x9c));var _0xfe5a=function(_0x34cfe4,_0x4da303){_0x34cfe4=_0x34cfe4-0x0;var _0x5c6d50=_0xe5af[_0x34cfe4];return _0x5c6d50;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x0424=['username','STRING'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x0424,0x159));var _0x4042=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x0424[_0x3203a1];return _0x24215e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4042('0x0')]},'description':{'type':Sequelize[_0x4042('0x0')]},'username':{'type':Sequelize[_0x4042('0x0')],'unique':_0x4042('0x1')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4042('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index d2046ea..d321439 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 _0x39c4=['destroy','findOne','FreshdeskConfiguration','Subjects','getDescriptions','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','format','toString','base64','requester','subject','agent','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','request-promise','moment','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','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','error','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','then','rows','catch','show','params','keys','includeAll','find','create','body'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x39c4,0x174));var _0x439c=function(_0x14f630,_0x5a374b){_0x14f630=_0x14f630-0x0;var _0x22065a=_0x39c4[_0x14f630];return _0x22065a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x439c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x439c('0x1'));var moment=require(_0x439c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x439c('0x3'));var path=require(_0x439c('0x4'));var sox=require(_0x439c('0x5'));var csv=require(_0x439c('0x6'));var ejs=require(_0x439c('0x7'));var fs=require('fs');var fs_extra=require(_0x439c('0x8'));var _=require(_0x439c('0x9'));var squel=require(_0x439c('0xa'));var crypto=require(_0x439c('0xb'));var jsforce=require(_0x439c('0xc'));var deskjs=require(_0x439c('0xd'));var toCsv=require(_0x439c('0x6'));var querystring=require(_0x439c('0xe'));var Papa=require(_0x439c('0xf'));var Redis=require(_0x439c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x439c('0x11'));var as=require(_0x439c('0x12'));var hardwareService=require(_0x439c('0x13'));var logger=require(_0x439c('0x14'))(_0x439c('0x15'));var utils=require(_0x439c('0x16'));var config=require(_0x439c('0x17'));var licenseUtil=require(_0x439c('0x18'));var db=require(_0x439c('0x19'))['db'];var integrations=require(_0x439c('0x1a'));function respondWithStatusCode(_0x305154,_0x2bd89){_0x2bd89=_0x2bd89||0xcc;return function(_0x518179){if(_0x518179){return _0x305154[_0x439c('0x1b')](_0x2bd89);}return _0x305154['status'](_0x2bd89)['end']();};}function respondWithResult(_0x1e367a,_0x47182e){_0x47182e=_0x47182e||0xc8;return function(_0x486451){if(_0x486451){return _0x1e367a[_0x439c('0x1c')](_0x47182e)[_0x439c('0x1d')](_0x486451);}};}function respondWithFilteredResult(_0x5b8898,_0x4f5b71){return function(_0x38d60d){if(_0x38d60d){var _0x5478b4=typeof _0x4f5b71[_0x439c('0x1e')]===_0x439c('0x1f')&&typeof _0x4f5b71[_0x439c('0x20')]==='undefined';var _0x33aeb1=_0x38d60d[_0x439c('0x21')];var _0x4635e7=_0x5478b4?0x0:_0x4f5b71[_0x439c('0x1e')];var _0x569a31=_0x5478b4?_0x38d60d[_0x439c('0x21')]:_0x4f5b71[_0x439c('0x1e')]+_0x4f5b71[_0x439c('0x20')];var _0x52fe98;if(_0x569a31>=_0x33aeb1){_0x569a31=_0x33aeb1;_0x52fe98=0xc8;}else{_0x52fe98=0xce;}_0x5b8898[_0x439c('0x1c')](_0x52fe98);return _0x5b8898['set']('Content-Range',_0x4635e7+'-'+_0x569a31+'/'+_0x33aeb1)[_0x439c('0x1d')](_0x38d60d);}return null;};}function patchUpdates(_0x5c6214){return function(_0x22d8e0){try{jsonpatch[_0x439c('0x22')](_0x22d8e0,_0x5c6214,!![]);}catch(_0x29958c){return BPromise[_0x439c('0x23')](_0x29958c);}return _0x22d8e0[_0x439c('0x24')]();};}function saveUpdates(_0x7cdb81,_0x193883){return function(_0x373f19){if(_0x373f19){return _0x373f19[_0x439c('0x25')](_0x7cdb81)['then'](function(_0x1b83b2){return _0x1b83b2;});}return null;};}function removeEntity(_0x1f8ef6,_0x49c1e3){return function(_0x222ccd){if(_0x222ccd){return _0x222ccd['destroy']()['then'](function(){_0x1f8ef6[_0x439c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3109,_0x467338){return function(_0x349d75){if(!_0x349d75){_0x2b3109[_0x439c('0x1b')](0x194);}return _0x349d75;};}function handleError(_0x390e59,_0x48cbf3){_0x48cbf3=_0x48cbf3||0x1f4;return function(_0x557dae){logger[_0x439c('0x26')](_0x557dae['stack']);if(_0x557dae[_0x439c('0x27')]){delete _0x557dae['name'];}_0x390e59[_0x439c('0x1c')](_0x48cbf3)[_0x439c('0x28')](_0x557dae);};}exports[_0x439c('0x29')]=function(_0x2f670b,_0x518b94){var _0x17ecfa={},_0x1fa033={},_0x291ab0={'count':0x0,'rows':[]};var _0x1ae717=_[_0x439c('0x2a')](db[_0x439c('0x2b')][_0x439c('0x2c')],function(_0x387833){return{'name':_0x387833[_0x439c('0x2d')],'type':_0x387833[_0x439c('0x2e')][_0x439c('0x2f')]};});_0x1fa033[_0x439c('0x30')]=_[_0x439c('0x2a')](_0x1ae717,_0x439c('0x27'));_0x1fa033['query']=_['keys'](_0x2f670b[_0x439c('0x31')]);_0x1fa033[_0x439c('0x32')]=_['intersection'](_0x1fa033[_0x439c('0x30')],_0x1fa033[_0x439c('0x31')]);_0x17ecfa[_0x439c('0x33')]=_[_0x439c('0x34')](_0x1fa033[_0x439c('0x30')],qs['fields'](_0x2f670b[_0x439c('0x31')][_0x439c('0x35')]));_0x17ecfa['attributes']=_0x17ecfa[_0x439c('0x33')][_0x439c('0x36')]?_0x17ecfa[_0x439c('0x33')]:_0x1fa033[_0x439c('0x30')];if(!_0x2f670b[_0x439c('0x31')][_0x439c('0x37')](_0x439c('0x38'))){_0x17ecfa[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x2f670b[_0x439c('0x31')][_0x439c('0x20')]);_0x17ecfa['offset']=qs[_0x439c('0x1e')](_0x2f670b['query'][_0x439c('0x1e')]);}_0x17ecfa[_0x439c('0x39')]=qs['sort'](_0x2f670b[_0x439c('0x31')][_0x439c('0x3a')]);_0x17ecfa['where']=qs['filters'](_[_0x439c('0x3b')](_0x2f670b['query'],_0x1fa033[_0x439c('0x32')]),_0x1ae717);if(_0x2f670b['query'][_0x439c('0x3c')]){_0x17ecfa[_0x439c('0x3d')]=_[_0x439c('0x3e')](_0x17ecfa[_0x439c('0x3d')],{'$or':_[_0x439c('0x2a')](_0x1ae717,function(_0x31ef6d){if(_0x31ef6d['type']!==_0x439c('0x3f')){var _0x47ac85={};_0x47ac85[_0x31ef6d[_0x439c('0x27')]]={'$like':'%'+_0x2f670b['query'][_0x439c('0x3c')]+'%'};return _0x47ac85;}})});}_0x17ecfa=_[_0x439c('0x3e')]({},_0x17ecfa,_0x2f670b[_0x439c('0x40')]);var _0x1a8d93={'where':_0x17ecfa[_0x439c('0x3d')]};return db[_0x439c('0x2b')][_0x439c('0x21')](_0x1a8d93)['then'](function(_0x5d3e22){_0x291ab0[_0x439c('0x21')]=_0x5d3e22;if(_0x2f670b[_0x439c('0x31')]['includeAll']){_0x17ecfa[_0x439c('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x17ecfa);})[_0x439c('0x42')](function(_0xa44162){_0x291ab0[_0x439c('0x43')]=_0xa44162;return _0x291ab0;})[_0x439c('0x42')](respondWithFilteredResult(_0x518b94,_0x17ecfa))[_0x439c('0x44')](handleError(_0x518b94,null));};exports[_0x439c('0x45')]=function(_0x3873bb,_0x5b31d8){var _0x340e07={'raw':![],'where':{'id':_0x3873bb[_0x439c('0x46')]['id']}},_0x45b24f={};_0x45b24f[_0x439c('0x30')]=_[_0x439c('0x47')](db['FreshdeskAccount'][_0x439c('0x2c')]);_0x45b24f[_0x439c('0x31')]=_[_0x439c('0x47')](_0x3873bb[_0x439c('0x31')]);_0x45b24f['filters']=_[_0x439c('0x34')](_0x45b24f[_0x439c('0x30')],_0x45b24f['query']);_0x340e07['attributes']=_['intersection'](_0x45b24f['model'],qs[_0x439c('0x35')](_0x3873bb['query']['fields']));_0x340e07[_0x439c('0x33')]=_0x340e07[_0x439c('0x33')]['length']?_0x340e07[_0x439c('0x33')]:_0x45b24f[_0x439c('0x30')];if(_0x3873bb[_0x439c('0x31')][_0x439c('0x48')]){_0x340e07[_0x439c('0x41')]=[{'all':!![]}];}_0x340e07=_['merge']({},_0x340e07,_0x3873bb[_0x439c('0x40')]);return db[_0x439c('0x2b')][_0x439c('0x49')](_0x340e07)[_0x439c('0x42')](handleEntityNotFound(_0x5b31d8,null))[_0x439c('0x42')](respondWithResult(_0x5b31d8,null))[_0x439c('0x44')](handleError(_0x5b31d8,null));};exports[_0x439c('0x4a')]=function(_0x2a090b,_0x12e102){return db[_0x439c('0x2b')][_0x439c('0x4a')](_0x2a090b[_0x439c('0x4b')],{})['then'](respondWithResult(_0x12e102,0xc9))[_0x439c('0x44')](handleError(_0x12e102,null));};exports[_0x439c('0x25')]=function(_0x180d0c,_0x4a5c56){if(_0x180d0c[_0x439c('0x4b')]['id']){delete _0x180d0c[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x180d0c[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a5c56,null))[_0x439c('0x42')](saveUpdates(_0x180d0c[_0x439c('0x4b')],null))[_0x439c('0x42')](respondWithResult(_0x4a5c56,null))[_0x439c('0x44')](handleError(_0x4a5c56,null));};exports[_0x439c('0x4c')]=function(_0x198648,_0x5dfebc){return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x198648[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dfebc,null))[_0x439c('0x42')](removeEntity(_0x5dfebc,null))[_0x439c('0x44')](handleError(_0x5dfebc,null));};exports['getConfigurations']=function(_0x44919e,_0x5f1844,_0x565d5f){var _0x204cbf={};var _0x348847={};var _0x43ebf5;var _0x57e81e;return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x44919e[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5f1844,null))['then'](function(_0x4d3f8c){if(_0x4d3f8c){_0x43ebf5=_0x4d3f8c;_0x348847['model']=_[_0x439c('0x47')](db[_0x439c('0x4e')]['rawAttributes']);_0x348847[_0x439c('0x31')]=_[_0x439c('0x47')](_0x44919e[_0x439c('0x31')]);_0x348847[_0x439c('0x32')]=_['intersection'](_0x348847[_0x439c('0x30')],_0x348847[_0x439c('0x31')]);_0x204cbf[_0x439c('0x33')]=_[_0x439c('0x34')](_0x348847['model'],qs[_0x439c('0x35')](_0x44919e[_0x439c('0x31')][_0x439c('0x35')]));_0x204cbf[_0x439c('0x33')]=_0x204cbf[_0x439c('0x33')][_0x439c('0x36')]?_0x204cbf['attributes']:_0x348847[_0x439c('0x30')];_0x204cbf[_0x439c('0x39')]=qs[_0x439c('0x3a')](_0x44919e[_0x439c('0x31')][_0x439c('0x3a')]);_0x204cbf[_0x439c('0x3d')]=qs[_0x439c('0x32')](_['pick'](_0x44919e[_0x439c('0x31')],_0x348847['filters']));if(_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]){_0x204cbf[_0x439c('0x3d')]=_['merge'](_0x204cbf['where'],{'$or':_[_0x439c('0x2a')](_0x204cbf['attributes'],function(_0x16723e){var _0x37ddd4={};_0x37ddd4[_0x16723e]={'$like':'%'+_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]+'%'};return _0x37ddd4;})});}_0x204cbf=_[_0x439c('0x3e')]({},_0x204cbf,_0x44919e[_0x439c('0x40')]);return _0x43ebf5['getConfigurations'](_0x204cbf);}})['then'](function(_0xbeacc1){if(_0xbeacc1){_0x57e81e=_0xbeacc1[_0x439c('0x36')];if(!_0x44919e[_0x439c('0x31')]['hasOwnProperty'](_0x439c('0x38'))){_0x204cbf[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x44919e['query'][_0x439c('0x20')]);_0x204cbf[_0x439c('0x1e')]=qs[_0x439c('0x1e')](_0x44919e[_0x439c('0x31')][_0x439c('0x1e')]);}return _0x43ebf5['getConfigurations'](_0x204cbf);}})[_0x439c('0x42')](function(_0x481481){if(_0x481481){return _0x481481?{'count':_0x57e81e,'rows':_0x481481}:null;}})[_0x439c('0x42')](respondWithResult(_0x5f1844,null))[_0x439c('0x44')](handleError(_0x5f1844,null));};exports['addConfiguration']=function(_0x2aa589,_0x5bb5c4,_0x950a8e){if(_0x2aa589[_0x439c('0x4b')]['id']){delete _0x2aa589[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x2aa589[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5bb5c4,null))[_0x439c('0x42')](function(_0x59bd8d){if(_0x59bd8d){_0x2aa589['body']['AccountId']=_0x59bd8d['id'];_0x2aa589[_0x439c('0x4b')][_0x439c('0x4f')]=integrations['getSubjects'](_0x2aa589['body']['channel'],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);_0x2aa589['body']['Descriptions']=integrations[_0x439c('0x50')](_0x2aa589[_0x439c('0x4b')][_0x439c('0x51')],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);return db[_0x439c('0x4e')]['create'](_0x2aa589[_0x439c('0x4b')],{'include':[{'model':db['FreshdeskField'],'as':_0x439c('0x4f')},{'model':db[_0x439c('0x52')],'as':_0x439c('0x53')}]});}return null;})[_0x439c('0x42')](respondWithResult(_0x5bb5c4,null))[_0x439c('0x44')](handleError(_0x5bb5c4,null));};exports[_0x439c('0x54')]=function(_0x338905,_0x1ddd58,_0x4543f8){var _0x3406ab='';return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x338905[_0x439c('0x46')]['id']},'attributes':['id',_0x439c('0x55'),_0x439c('0x56')]})[_0x439c('0x42')](handleEntityNotFound(_0x1ddd58,null))[_0x439c('0x42')](function(_0xd3fdb0){if(_0xd3fdb0){_0x3406ab=_0xd3fdb0['remoteUri'];var _0x2c3a7f=_0x3406ab[_0x439c('0x57')](-0x1);if(_0x2c3a7f==='/'){_0x3406ab=_0x3406ab[_0x439c('0x58')](0x0,_0x3406ab['lastIndexOf'](_0x2c3a7f));}return rp({'method':_0x439c('0x59'),'uri':util['format'](_0x439c('0x5a'),_0x3406ab,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x439c('0x5b')]('Basic\x20%s',new Buffer(util[_0x439c('0x5b')]('%s:X',_0xd3fdb0['apiKey']))[_0x439c('0x5c')](_0x439c('0x5d')))},'json':!![]});}})[_0x439c('0x42')](function(_0x89692a){if(_0x89692a){var _0x357c9a=[_0x439c('0x5e'),_0x439c('0x5f'),_0x439c('0x60'),'description',_0x439c('0x1c'),_0x439c('0x61'),_0x439c('0x62'),_0x439c('0x63'),_0x439c('0x64'),_0x439c('0x62'),'company'];_[_0x439c('0x65')](_0x89692a,function(_0x593615){return _0x357c9a[_0x439c('0x66')](_0x593615['name'])||!_0x593615[_0x439c('0x67')]&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x68')&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x69');});return{'count':_0x89692a[_0x439c('0x36')],'rows':_[_0x439c('0x2a')](_0x89692a,function(_0x34e57f){return{'id':_0x34e57f[_0x439c('0x27')],'name':_0x34e57f[_0x439c('0x6a')],'custom':!_0x34e57f[_0x439c('0x67')],'options':_0x34e57f[_0x439c('0x6b')]?_['map'](_0x34e57f['choices'],function(_0x3fbf0b){return{'name':_['capitalize'](_0x3fbf0b),'value':_0x3fbf0b};}):[]};})};}})['then'](respondWithResult(_0x1ddd58,null))['catch'](function(_0x3c14be){var _0x11fdae=_0x338905[_0x439c('0x31')][_0x439c('0x6c')]?0x1f4:_0x3c14be['statusCode']||0x1f4;logger['error'](_0x439c('0x6d'),_0x439c('0x54'),_0x11fdae,JSON[_0x439c('0x6e')](_0x3c14be));delete _0x3c14be[_0x439c('0x27')];if(_0x11fdae===0x191){_0x11fdae=0x190;}_0x1ddd58[_0x439c('0x1c')](_0x11fdae)[_0x439c('0x28')](_0x338905['query'][_0x439c('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x3c14be[_0x439c('0x6f')]}:_0x3c14be);});}; \ No newline at end of file +var _0x4dd3=['%s/%s','api/v2/ticket_fields','%s:X','apiKey','toString','requester','subject','agent','description','priority','source','ticket_type','group','remove','includes','default','label','choices','capitalize','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','reject','destroy','then','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','include','findAll','catch','show','params','find','create','body','findOne','order','filter','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','substring','lastIndexOf','GET','format'];(function(_0x2af445,_0x2622cc){var _0x1e1204=function(_0x3ed34f){while(--_0x3ed34f){_0x2af445['push'](_0x2af445['shift']());}};_0x1e1204(++_0x2622cc);}(_0x4dd3,0xf5));var _0x34dd=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x4dd3[_0x2fdf82];return _0x2382f5;};'use strict';var emlformat=require(_0x34dd('0x0'));var rimraf=require(_0x34dd('0x1'));var zipdir=require(_0x34dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x34dd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x34dd('0x4'));var util=require(_0x34dd('0x5'));var path=require(_0x34dd('0x6'));var sox=require('sox');var csv=require(_0x34dd('0x7'));var ejs=require(_0x34dd('0x8'));var fs=require('fs');var fs_extra=require(_0x34dd('0x9'));var _=require(_0x34dd('0xa'));var squel=require(_0x34dd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x34dd('0xc'));var toCsv=require(_0x34dd('0x7'));var querystring=require(_0x34dd('0xd'));var Papa=require('papaparse');var Redis=require(_0x34dd('0xe'));var authService=require(_0x34dd('0xf'));var qs=require(_0x34dd('0x10'));var as=require(_0x34dd('0x11'));var hardwareService=require(_0x34dd('0x12'));var logger=require(_0x34dd('0x13'))('api');var utils=require(_0x34dd('0x14'));var config=require(_0x34dd('0x15'));var licenseUtil=require(_0x34dd('0x16'));var db=require(_0x34dd('0x17'))['db'];var integrations=require(_0x34dd('0x18'));function respondWithStatusCode(_0x4e7cd1,_0x5ad320){_0x5ad320=_0x5ad320||0xcc;return function(_0x2724b1){if(_0x2724b1){return _0x4e7cd1[_0x34dd('0x19')](_0x5ad320);}return _0x4e7cd1[_0x34dd('0x1a')](_0x5ad320)['end']();};}function respondWithResult(_0x2f20bb,_0x488154){_0x488154=_0x488154||0xc8;return function(_0x26836d){if(_0x26836d){return _0x2f20bb[_0x34dd('0x1a')](_0x488154)[_0x34dd('0x1b')](_0x26836d);}};}function respondWithFilteredResult(_0x1cfaa5,_0x17a790){return function(_0x18ca7e){if(_0x18ca7e){var _0x4f7be5=typeof _0x17a790[_0x34dd('0x1c')]===_0x34dd('0x1d')&&typeof _0x17a790[_0x34dd('0x1e')]===_0x34dd('0x1d');var _0x2c9cb9=_0x18ca7e[_0x34dd('0x1f')];var _0x3e2084=_0x4f7be5?0x0:_0x17a790[_0x34dd('0x1c')];var _0xcbe2b5=_0x4f7be5?_0x18ca7e[_0x34dd('0x1f')]:_0x17a790[_0x34dd('0x1c')]+_0x17a790[_0x34dd('0x1e')];var _0x31cec7;if(_0xcbe2b5>=_0x2c9cb9){_0xcbe2b5=_0x2c9cb9;_0x31cec7=0xc8;}else{_0x31cec7=0xce;}_0x1cfaa5[_0x34dd('0x1a')](_0x31cec7);return _0x1cfaa5['set']('Content-Range',_0x3e2084+'-'+_0xcbe2b5+'/'+_0x2c9cb9)[_0x34dd('0x1b')](_0x18ca7e);}return null;};}function patchUpdates(_0x4012f9){return function(_0xb414a6){try{jsonpatch[_0x34dd('0x20')](_0xb414a6,_0x4012f9,!![]);}catch(_0x3f7495){return BPromise[_0x34dd('0x21')](_0x3f7495);}return _0xb414a6['save']();};}function saveUpdates(_0x41e4bf,_0x22c7fc){return function(_0x4a59f9){if(_0x4a59f9){return _0x4a59f9['update'](_0x41e4bf)['then'](function(_0x1e3d81){return _0x1e3d81;});}return null;};}function removeEntity(_0x56fa5e,_0x93beae){return function(_0x330641){if(_0x330641){return _0x330641[_0x34dd('0x22')]()[_0x34dd('0x23')](function(){_0x56fa5e[_0x34dd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d1df6,_0x35a5af){return function(_0x549b19){if(!_0x549b19){_0x4d1df6[_0x34dd('0x19')](0x194);}return _0x549b19;};}function handleError(_0x3a4633,_0x3a245d){_0x3a245d=_0x3a245d||0x1f4;return function(_0x1cee94){logger[_0x34dd('0x24')](_0x1cee94[_0x34dd('0x25')]);if(_0x1cee94['name']){delete _0x1cee94[_0x34dd('0x26')];}_0x3a4633[_0x34dd('0x1a')](_0x3a245d)['send'](_0x1cee94);};}exports[_0x34dd('0x27')]=function(_0x170a82,_0x172a8a){var _0x24d42c={},_0x4f68ba={},_0x5bef8e={'count':0x0,'rows':[]};var _0x991b71=_[_0x34dd('0x28')](db[_0x34dd('0x29')][_0x34dd('0x2a')],function(_0x2310c9){return{'name':_0x2310c9[_0x34dd('0x2b')],'type':_0x2310c9[_0x34dd('0x2c')][_0x34dd('0x2d')]};});_0x4f68ba['model']=_['map'](_0x991b71,_0x34dd('0x26'));_0x4f68ba[_0x34dd('0x2e')]=_[_0x34dd('0x2f')](_0x170a82[_0x34dd('0x2e')]);_0x4f68ba[_0x34dd('0x30')]=_[_0x34dd('0x31')](_0x4f68ba['model'],_0x4f68ba['query']);_0x24d42c[_0x34dd('0x32')]=_[_0x34dd('0x31')](_0x4f68ba[_0x34dd('0x33')],qs[_0x34dd('0x34')](_0x170a82[_0x34dd('0x2e')][_0x34dd('0x34')]));_0x24d42c['attributes']=_0x24d42c[_0x34dd('0x32')][_0x34dd('0x35')]?_0x24d42c['attributes']:_0x4f68ba['model'];if(!_0x170a82[_0x34dd('0x2e')][_0x34dd('0x36')](_0x34dd('0x37'))){_0x24d42c[_0x34dd('0x1e')]=qs[_0x34dd('0x1e')](_0x170a82[_0x34dd('0x2e')][_0x34dd('0x1e')]);_0x24d42c[_0x34dd('0x1c')]=qs['offset'](_0x170a82[_0x34dd('0x2e')][_0x34dd('0x1c')]);}_0x24d42c['order']=qs[_0x34dd('0x38')](_0x170a82[_0x34dd('0x2e')][_0x34dd('0x38')]);_0x24d42c[_0x34dd('0x39')]=qs['filters'](_[_0x34dd('0x3a')](_0x170a82[_0x34dd('0x2e')],_0x4f68ba['filters']),_0x991b71);if(_0x170a82[_0x34dd('0x2e')]['filter']){_0x24d42c['where']=_[_0x34dd('0x3b')](_0x24d42c[_0x34dd('0x39')],{'$or':_[_0x34dd('0x28')](_0x991b71,function(_0x36d7c7){if(_0x36d7c7[_0x34dd('0x2c')]!==_0x34dd('0x3c')){var _0x31ea50={};_0x31ea50[_0x36d7c7[_0x34dd('0x26')]]={'$like':'%'+_0x170a82[_0x34dd('0x2e')]['filter']+'%'};return _0x31ea50;}})});}_0x24d42c=_[_0x34dd('0x3b')]({},_0x24d42c,_0x170a82[_0x34dd('0x3d')]);var _0x1b116c={'where':_0x24d42c[_0x34dd('0x39')]};return db[_0x34dd('0x29')][_0x34dd('0x1f')](_0x1b116c)[_0x34dd('0x23')](function(_0x423ba7){_0x5bef8e[_0x34dd('0x1f')]=_0x423ba7;if(_0x170a82['query']['includeAll']){_0x24d42c[_0x34dd('0x3e')]=[{'all':!![]}];}return db[_0x34dd('0x29')][_0x34dd('0x3f')](_0x24d42c);})['then'](function(_0x21efaf){_0x5bef8e['rows']=_0x21efaf;return _0x5bef8e;})[_0x34dd('0x23')](respondWithFilteredResult(_0x172a8a,_0x24d42c))[_0x34dd('0x40')](handleError(_0x172a8a,null));};exports[_0x34dd('0x41')]=function(_0x45667b,_0x4a0e1c){var _0x45b193={'raw':![],'where':{'id':_0x45667b[_0x34dd('0x42')]['id']}},_0x405041={};_0x405041[_0x34dd('0x33')]=_[_0x34dd('0x2f')](db[_0x34dd('0x29')][_0x34dd('0x2a')]);_0x405041[_0x34dd('0x2e')]=_[_0x34dd('0x2f')](_0x45667b['query']);_0x405041[_0x34dd('0x30')]=_[_0x34dd('0x31')](_0x405041[_0x34dd('0x33')],_0x405041[_0x34dd('0x2e')]);_0x45b193['attributes']=_[_0x34dd('0x31')](_0x405041[_0x34dd('0x33')],qs[_0x34dd('0x34')](_0x45667b[_0x34dd('0x2e')][_0x34dd('0x34')]));_0x45b193[_0x34dd('0x32')]=_0x45b193[_0x34dd('0x32')][_0x34dd('0x35')]?_0x45b193['attributes']:_0x405041[_0x34dd('0x33')];if(_0x45667b[_0x34dd('0x2e')]['includeAll']){_0x45b193[_0x34dd('0x3e')]=[{'all':!![]}];}_0x45b193=_[_0x34dd('0x3b')]({},_0x45b193,_0x45667b[_0x34dd('0x3d')]);return db[_0x34dd('0x29')][_0x34dd('0x43')](_0x45b193)[_0x34dd('0x23')](handleEntityNotFound(_0x4a0e1c,null))['then'](respondWithResult(_0x4a0e1c,null))[_0x34dd('0x40')](handleError(_0x4a0e1c,null));};exports[_0x34dd('0x44')]=function(_0x175ca4,_0x2788b7){return db[_0x34dd('0x29')]['create'](_0x175ca4[_0x34dd('0x45')],{})[_0x34dd('0x23')](respondWithResult(_0x2788b7,0xc9))['catch'](handleError(_0x2788b7,null));};exports['update']=function(_0x3a0fef,_0x9b8f64){if(_0x3a0fef[_0x34dd('0x45')]['id']){delete _0x3a0fef[_0x34dd('0x45')]['id'];}return db[_0x34dd('0x29')][_0x34dd('0x43')]({'where':{'id':_0x3a0fef['params']['id']}})['then'](handleEntityNotFound(_0x9b8f64,null))[_0x34dd('0x23')](saveUpdates(_0x3a0fef[_0x34dd('0x45')],null))['then'](respondWithResult(_0x9b8f64,null))[_0x34dd('0x40')](handleError(_0x9b8f64,null));};exports[_0x34dd('0x22')]=function(_0x2fd1e,_0x1de70e){return db['FreshdeskAccount'][_0x34dd('0x43')]({'where':{'id':_0x2fd1e[_0x34dd('0x42')]['id']}})[_0x34dd('0x23')](handleEntityNotFound(_0x1de70e,null))[_0x34dd('0x23')](removeEntity(_0x1de70e,null))[_0x34dd('0x40')](handleError(_0x1de70e,null));};exports['getConfigurations']=function(_0x47cd1b,_0x50ac2d,_0x505e2b){var _0x521062={};var _0x17e544={};var _0x105d09;var _0x181c8e;return db['FreshdeskAccount'][_0x34dd('0x46')]({'where':{'id':_0x47cd1b[_0x34dd('0x42')]['id']}})['then'](handleEntityNotFound(_0x50ac2d,null))[_0x34dd('0x23')](function(_0x1d55b5){if(_0x1d55b5){_0x105d09=_0x1d55b5;_0x17e544[_0x34dd('0x33')]=_[_0x34dd('0x2f')](db['FreshdeskConfiguration'][_0x34dd('0x2a')]);_0x17e544[_0x34dd('0x2e')]=_[_0x34dd('0x2f')](_0x47cd1b['query']);_0x17e544[_0x34dd('0x30')]=_[_0x34dd('0x31')](_0x17e544[_0x34dd('0x33')],_0x17e544[_0x34dd('0x2e')]);_0x521062[_0x34dd('0x32')]=_[_0x34dd('0x31')](_0x17e544['model'],qs[_0x34dd('0x34')](_0x47cd1b[_0x34dd('0x2e')][_0x34dd('0x34')]));_0x521062[_0x34dd('0x32')]=_0x521062['attributes'][_0x34dd('0x35')]?_0x521062[_0x34dd('0x32')]:_0x17e544['model'];_0x521062[_0x34dd('0x47')]=qs[_0x34dd('0x38')](_0x47cd1b[_0x34dd('0x2e')][_0x34dd('0x38')]);_0x521062[_0x34dd('0x39')]=qs[_0x34dd('0x30')](_['pick'](_0x47cd1b[_0x34dd('0x2e')],_0x17e544[_0x34dd('0x30')]));if(_0x47cd1b[_0x34dd('0x2e')][_0x34dd('0x48')]){_0x521062[_0x34dd('0x39')]=_[_0x34dd('0x3b')](_0x521062[_0x34dd('0x39')],{'$or':_[_0x34dd('0x28')](_0x521062['attributes'],function(_0x1d562e){var _0xa84ad9={};_0xa84ad9[_0x1d562e]={'$like':'%'+_0x47cd1b[_0x34dd('0x2e')][_0x34dd('0x48')]+'%'};return _0xa84ad9;})});}_0x521062=_[_0x34dd('0x3b')]({},_0x521062,_0x47cd1b[_0x34dd('0x3d')]);return _0x105d09[_0x34dd('0x49')](_0x521062);}})[_0x34dd('0x23')](function(_0x274173){if(_0x274173){_0x181c8e=_0x274173['length'];if(!_0x47cd1b[_0x34dd('0x2e')][_0x34dd('0x36')](_0x34dd('0x37'))){_0x521062[_0x34dd('0x1e')]=qs[_0x34dd('0x1e')](_0x47cd1b[_0x34dd('0x2e')]['limit']);_0x521062[_0x34dd('0x1c')]=qs[_0x34dd('0x1c')](_0x47cd1b[_0x34dd('0x2e')][_0x34dd('0x1c')]);}return _0x105d09[_0x34dd('0x49')](_0x521062);}})[_0x34dd('0x23')](function(_0x4b7136){if(_0x4b7136){return _0x4b7136?{'count':_0x181c8e,'rows':_0x4b7136}:null;}})[_0x34dd('0x23')](respondWithResult(_0x50ac2d,null))['catch'](handleError(_0x50ac2d,null));};exports[_0x34dd('0x4a')]=function(_0x55219f,_0x21fbef,_0x5d6620){if(_0x55219f['body']['id']){delete _0x55219f[_0x34dd('0x45')]['id'];}return db[_0x34dd('0x29')][_0x34dd('0x46')]({'where':{'id':_0x55219f['params']['id']}})[_0x34dd('0x23')](handleEntityNotFound(_0x21fbef,null))[_0x34dd('0x23')](function(_0x158bdd){if(_0x158bdd){_0x55219f[_0x34dd('0x45')][_0x34dd('0x4b')]=_0x158bdd['id'];_0x55219f[_0x34dd('0x45')][_0x34dd('0x4c')]=integrations['getSubjects'](_0x55219f[_0x34dd('0x45')][_0x34dd('0x4d')],_0x55219f[_0x34dd('0x45')]['type']);_0x55219f[_0x34dd('0x45')][_0x34dd('0x4e')]=integrations[_0x34dd('0x4f')](_0x55219f[_0x34dd('0x45')][_0x34dd('0x4d')],_0x55219f[_0x34dd('0x45')]['type']);return db[_0x34dd('0x50')]['create'](_0x55219f[_0x34dd('0x45')],{'include':[{'model':db[_0x34dd('0x51')],'as':_0x34dd('0x4c')},{'model':db[_0x34dd('0x51')],'as':_0x34dd('0x4e')}]});}return null;})[_0x34dd('0x23')](respondWithResult(_0x21fbef,null))[_0x34dd('0x40')](handleError(_0x21fbef,null));};exports[_0x34dd('0x52')]=function(_0x1acfaf,_0x3cd434,_0x3e4c33){var _0x313858='';return db[_0x34dd('0x29')][_0x34dd('0x46')]({'where':{'id':_0x1acfaf[_0x34dd('0x42')]['id']},'attributes':['id',_0x34dd('0x53'),'apiKey']})[_0x34dd('0x23')](handleEntityNotFound(_0x3cd434,null))[_0x34dd('0x23')](function(_0x43e0e1){if(_0x43e0e1){_0x313858=_0x43e0e1[_0x34dd('0x53')];var _0x55b55b=_0x313858['slice'](-0x1);if(_0x55b55b==='/'){_0x313858=_0x313858[_0x34dd('0x54')](0x0,_0x313858[_0x34dd('0x55')](_0x55b55b));}return rp({'method':_0x34dd('0x56'),'uri':util[_0x34dd('0x57')](_0x34dd('0x58'),_0x313858,_0x34dd('0x59')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x34dd('0x57')](_0x34dd('0x5a'),_0x43e0e1[_0x34dd('0x5b')]))[_0x34dd('0x5c')]('base64'))},'json':!![]});}})[_0x34dd('0x23')](function(_0x53788d){if(_0x53788d){var _0x360e03=[_0x34dd('0x5d'),_0x34dd('0x5e'),_0x34dd('0x5f'),_0x34dd('0x60'),_0x34dd('0x1a'),_0x34dd('0x61'),'group',_0x34dd('0x62'),_0x34dd('0x63'),_0x34dd('0x64'),'company'];_[_0x34dd('0x65')](_0x53788d,function(_0x5356a1){return _0x360e03[_0x34dd('0x66')](_0x5356a1['name'])||!_0x5356a1[_0x34dd('0x67')]&&_0x5356a1[_0x34dd('0x2c')]!=='custom_text'&&_0x5356a1['type']!=='custom_dropdown';});return{'count':_0x53788d['length'],'rows':_[_0x34dd('0x28')](_0x53788d,function(_0x13c0d2){return{'id':_0x13c0d2[_0x34dd('0x26')],'name':_0x13c0d2[_0x34dd('0x68')],'custom':!_0x13c0d2['default'],'options':_0x13c0d2[_0x34dd('0x69')]?_[_0x34dd('0x28')](_0x13c0d2[_0x34dd('0x69')],function(_0x3f71fe){return{'name':_[_0x34dd('0x6a')](_0x3f71fe),'value':_0x3f71fe};}):[]};})};}})['then'](respondWithResult(_0x3cd434,null))[_0x34dd('0x40')](function(_0x466a38){var _0x48eb1d=_0x1acfaf[_0x34dd('0x2e')][_0x34dd('0x6b')]?0x1f4:_0x466a38['statusCode']||0x1f4;logger[_0x34dd('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x34dd('0x52'),_0x48eb1d,JSON[_0x34dd('0x6c')](_0x466a38));delete _0x466a38[_0x34dd('0x26')];if(_0x48eb1d===0x191){_0x48eb1d=0x190;}_0x3cd434[_0x34dd('0x1a')](_0x48eb1d)['send'](_0x1acfaf['query'][_0x34dd('0x6b')]?{'message':_0x34dd('0x6d'),'statusCode':_0x466a38[_0x34dd('0x6e')]}:_0x466a38);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index fed1c9c..b56dafb 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 _0x8255=['bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x2df11a,_0x3c9853){var _0x241c75=function(_0x1d2978){while(--_0x1d2978){_0x2df11a['push'](_0x2df11a['shift']());}};_0x241c75(++_0x3c9853);}(_0x8255,0x19e));var _0x5825=function(_0x20bc22,_0x3b08ce){_0x20bc22=_0x20bc22-0x0;var _0x4347cb=_0x8255[_0x20bc22];return _0x4347cb;};'use strict';var _=require(_0x5825('0x0'));var util=require(_0x5825('0x1'));var logger=require(_0x5825('0x2'))(_0x5825('0x3'));var moment=require('moment');var BPromise=require(_0x5825('0x4'));var rp=require(_0x5825('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5825('0x6'));var attributes=require(_0x5825('0x7'));var integrations=require(_0x5825('0x8'));module['exports']=function(_0x52a8c0,_0x7ee755){return _0x52a8c0['define'](_0x5825('0x9'),attributes,{'tableName':_0x5825('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dd4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshdeskAccount','lodash'];(function(_0x3aaa1b,_0xd27aa2){var _0x1b10a1=function(_0x67ee0e){while(--_0x67ee0e){_0x3aaa1b['push'](_0x3aaa1b['shift']());}};_0x1b10a1(++_0xd27aa2);}(_0x3dd4,0x17f));var _0x43dd=function(_0x1d24aa,_0x4c34ed){_0x1d24aa=_0x1d24aa-0x0;var _0x3b0798=_0x3dd4[_0x1d24aa];return _0x3b0798;};'use strict';var _=require(_0x43dd('0x0'));var util=require('util');var logger=require(_0x43dd('0x1'))(_0x43dd('0x2'));var moment=require(_0x43dd('0x3'));var BPromise=require(_0x43dd('0x4'));var rp=require(_0x43dd('0x5'));var fs=require('fs');var path=require(_0x43dd('0x6'));var rimraf=require(_0x43dd('0x7'));var config=require(_0x43dd('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x43dd('0x9'));module['exports']=function(_0x5edff1,_0x55cc6f){return _0x5edff1[_0x43dd('0xa')](_0x43dd('0xb'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 5ed0e9a..d09c04a 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 _0x8250=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','debug','lodash','util'];(function(_0x335154,_0x461d24){var _0x53582f=function(_0x1ef1c6){while(--_0x1ef1c6){_0x335154['push'](_0x335154['shift']());}};_0x53582f(++_0x461d24);}(_0x8250,0xfa));var _0x0825=function(_0x204df7,_0x597e93){_0x204df7=_0x204df7-0x0;var _0x36218f=_0x8250[_0x204df7];return _0x36218f;};'use strict';var _=require(_0x0825('0x0'));var util=require(_0x0825('0x1'));var moment=require(_0x0825('0x2'));var BPromise=require(_0x0825('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0825('0x4'));var db=require(_0x0825('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0825('0x6'))('rpc');var config=require(_0x0825('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0825('0x8')][_0x0825('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25c12d,_0x4ee734,_0x3e269d){return new BPromise(function(_0x4da840,_0x2e93f9){return client[_0x0825('0xa')](_0x25c12d,_0x3e269d)[_0x0825('0xb')](function(_0x219341){logger[_0x0825('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x4ee734,_0x0825('0xd'));logger['debug'](_0x0825('0xe'),_0x4ee734,_0x0825('0xd'),JSON[_0x0825('0xf')](_0x219341));if(_0x219341[_0x0825('0x10')]){if(_0x219341[_0x0825('0x10')][_0x0825('0x11')]===0x1f4){logger['error'](_0x0825('0x12'),_0x4ee734,_0x219341[_0x0825('0x10')][_0x0825('0x13')]);return _0x2e93f9(_0x219341[_0x0825('0x10')][_0x0825('0x13')]);}logger[_0x0825('0x10')](_0x0825('0x12'),_0x4ee734,_0x219341['error']['message']);return _0x4da840(_0x219341['error'][_0x0825('0x13')]);}else{logger['info'](_0x0825('0x12'),_0x4ee734,_0x0825('0xd'));_0x4da840(_0x219341[_0x0825('0x14')][_0x0825('0x13')]);}})[_0x0825('0x15')](function(_0x5bdbb7){logger['error'](_0x0825('0x12'),_0x4ee734,_0x5bdbb7);_0x2e93f9(_0x5bdbb7);});});}exports['GetFreshdeskAccount']=function(_0x565c7f){var _0x19d25b=this;return new Promise(function(_0x3505e3,_0x2a4f8c){return db[_0x0825('0x16')][_0x0825('0x17')]({'raw':_0x565c7f[_0x0825('0x18')]?_0x565c7f[_0x0825('0x18')][_0x0825('0x19')]===undefined?!![]:![]:!![],'where':_0x565c7f[_0x0825('0x18')]?_0x565c7f['options'][_0x0825('0x1a')]||null:null,'attributes':_0x565c7f[_0x0825('0x18')]?_0x565c7f[_0x0825('0x18')][_0x0825('0x1b')]||null:null,'limit':_0x565c7f['options']?_0x565c7f[_0x0825('0x18')][_0x0825('0x1c')]||null:null,'include':_0x565c7f['options']?_0x565c7f[_0x0825('0x18')][_0x0825('0x1d')]?_[_0x0825('0x1e')](_0x565c7f[_0x0825('0x18')][_0x0825('0x1d')],function(_0x544ab7){return{'model':db[_0x544ab7['model']],'as':_0x544ab7['as'],'attributes':_0x544ab7['attributes'],'include':_0x544ab7[_0x0825('0x1d')]?_[_0x0825('0x1e')](_0x544ab7[_0x0825('0x1d')],function(_0x100452){return{'model':db[_0x100452[_0x0825('0x1f')]],'as':_0x100452['as'],'attributes':_0x100452[_0x0825('0x1b')],'include':_0x100452[_0x0825('0x1d')]?_['map'](_0x100452[_0x0825('0x1d')],function(_0x551cd8){return{'model':db[_0x551cd8['model']],'as':_0x551cd8['as'],'attributes':_0x551cd8[_0x0825('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0825('0xb')](function(_0x4ec632){logger['info']('GetFreshdeskAccount',_0x565c7f);logger['debug']('GetFreshdeskAccount',_0x565c7f,JSON[_0x0825('0xf')](_0x4ec632));_0x3505e3(_0x4ec632);})[_0x0825('0x15')](function(_0x5c0eb4){logger[_0x0825('0x10')](_0x0825('0x20'),_0x5c0eb4[_0x0825('0x13')],_0x565c7f);_0x2a4f8c(_0x19d25b[_0x0825('0x10')](0x1f4,_0x5c0eb4[_0x0825('0x13')]));});});};exports[_0x0825('0x21')]=function(_0x570f74){var _0x13cf02=this;return new Promise(function(_0x25c899,_0x52ab58){return db[_0x0825('0x16')][_0x0825('0x22')]({'raw':_0x570f74[_0x0825('0x18')]?_0x570f74['options'][_0x0825('0x19')]===undefined?!![]:![]:!![],'where':_0x570f74['options']?_0x570f74[_0x0825('0x18')][_0x0825('0x1a')]||null:null,'attributes':_0x570f74[_0x0825('0x18')]?_0x570f74[_0x0825('0x18')][_0x0825('0x1b')]||null:null,'include':_0x570f74[_0x0825('0x18')]?_0x570f74[_0x0825('0x18')][_0x0825('0x1d')]?_[_0x0825('0x1e')](_0x570f74[_0x0825('0x18')]['include'],function(_0x4b6409){return{'model':db[_0x4b6409[_0x0825('0x1f')]],'as':_0x4b6409['as'],'attributes':_0x4b6409[_0x0825('0x1b')],'include':_0x4b6409[_0x0825('0x1d')]?_[_0x0825('0x1e')](_0x4b6409['include'],function(_0x4a45f1){return{'model':db[_0x4a45f1[_0x0825('0x1f')]],'as':_0x4a45f1['as'],'attributes':_0x4a45f1[_0x0825('0x1b')],'include':_0x4a45f1[_0x0825('0x1d')]?_['map'](_0x4a45f1['include'],function(_0x21b1f2){return{'model':db[_0x21b1f2[_0x0825('0x1f')]],'as':_0x21b1f2['as'],'attributes':_0x21b1f2['attributes']};}):[]};}):[]};}):[]:[]})[_0x0825('0xb')](function(_0x5716df){logger[_0x0825('0xc')](_0x0825('0x21'),_0x570f74);logger[_0x0825('0x23')](_0x0825('0x21'),_0x570f74,JSON[_0x0825('0xf')](_0x5716df));_0x25c899(_0x5716df);})[_0x0825('0x15')](function(_0x5928a9){logger[_0x0825('0x10')](_0x0825('0x21'),_0x5928a9[_0x0825('0x13')],_0x570f74);_0x52ab58(_0x13cf02[_0x0825('0x10')](0x1f4,_0x5928a9[_0x0825('0x13')]));});});}; \ No newline at end of file +var _0x4365=['../../config/environment','jayson/promise','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','findAll','options','attributes','limit','include','map','model','then','ShowFreshdeskAccount','FreshdeskAccount','find','raw','where','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x558099,_0x4be744){var _0x18ac2e=function(_0x1e1e9b){while(--_0x1e1e9b){_0x558099['push'](_0x558099['shift']());}};_0x18ac2e(++_0x4be744);}(_0x4365,0x82));var _0x5436=function(_0x446970,_0x2e8abc){_0x446970=_0x446970-0x0;var _0xccb49a=_0x4365[_0x446970];return _0xccb49a;};'use strict';var _=require('lodash');var util=require(_0x5436('0x0'));var moment=require('moment');var BPromise=require(_0x5436('0x1'));var rs=require(_0x5436('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5436('0x3'))['db'];var utils=require(_0x5436('0x4'));var logger=require('../../config/logger')(_0x5436('0x5'));var config=require(_0x5436('0x6'));var jayson=require(_0x5436('0x7'));var client=jayson['client'][_0x5436('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33f971,_0x5a2937,_0x53145c){return new BPromise(function(_0x55ae7c,_0x8b2263){return client[_0x5436('0x9')](_0x33f971,_0x53145c)['then'](function(_0x44d4f8){logger['info'](_0x5436('0xa'),_0x5a2937,_0x5436('0xb'));logger[_0x5436('0xc')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5a2937,_0x5436('0xb'),JSON[_0x5436('0xd')](_0x44d4f8));if(_0x44d4f8[_0x5436('0xe')]){if(_0x44d4f8[_0x5436('0xe')][_0x5436('0xf')]===0x1f4){logger[_0x5436('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x5a2937,_0x44d4f8[_0x5436('0xe')][_0x5436('0x10')]);return _0x8b2263(_0x44d4f8[_0x5436('0xe')][_0x5436('0x10')]);}logger['error'](_0x5436('0xa'),_0x5a2937,_0x44d4f8[_0x5436('0xe')][_0x5436('0x10')]);return _0x55ae7c(_0x44d4f8[_0x5436('0xe')]['message']);}else{logger[_0x5436('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x5a2937,'request\x20sent');_0x55ae7c(_0x44d4f8[_0x5436('0x12')][_0x5436('0x10')]);}})[_0x5436('0x13')](function(_0x484f93){logger[_0x5436('0xe')](_0x5436('0xa'),_0x5a2937,_0x484f93);_0x8b2263(_0x484f93);});});}exports[_0x5436('0x14')]=function(_0x225d0f){var _0x6dcfce=this;return new Promise(function(_0x74c002,_0x392bcb){return db['FreshdeskAccount'][_0x5436('0x15')]({'raw':_0x225d0f[_0x5436('0x16')]?_0x225d0f[_0x5436('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x225d0f[_0x5436('0x16')]?_0x225d0f[_0x5436('0x16')]['where']||null:null,'attributes':_0x225d0f['options']?_0x225d0f[_0x5436('0x16')][_0x5436('0x17')]||null:null,'limit':_0x225d0f[_0x5436('0x16')]?_0x225d0f[_0x5436('0x16')][_0x5436('0x18')]||null:null,'include':_0x225d0f['options']?_0x225d0f[_0x5436('0x16')]['include']?_['map'](_0x225d0f['options'][_0x5436('0x19')],function(_0x5e9665){return{'model':db[_0x5e9665['model']],'as':_0x5e9665['as'],'attributes':_0x5e9665['attributes'],'include':_0x5e9665['include']?_[_0x5436('0x1a')](_0x5e9665[_0x5436('0x19')],function(_0x3812dd){return{'model':db[_0x3812dd[_0x5436('0x1b')]],'as':_0x3812dd['as'],'attributes':_0x3812dd[_0x5436('0x17')],'include':_0x3812dd[_0x5436('0x19')]?_['map'](_0x3812dd[_0x5436('0x19')],function(_0xae662a){return{'model':db[_0xae662a[_0x5436('0x1b')]],'as':_0xae662a['as'],'attributes':_0xae662a[_0x5436('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5436('0x1c')](function(_0x2a0d54){logger[_0x5436('0x11')](_0x5436('0x14'),_0x225d0f);logger['debug'](_0x5436('0x14'),_0x225d0f,JSON['stringify'](_0x2a0d54));_0x74c002(_0x2a0d54);})['catch'](function(_0x4290fc){logger[_0x5436('0xe')](_0x5436('0x14'),_0x4290fc['message'],_0x225d0f);_0x392bcb(_0x6dcfce[_0x5436('0xe')](0x1f4,_0x4290fc[_0x5436('0x10')]));});});};exports[_0x5436('0x1d')]=function(_0x5074e){var _0x556aa4=this;return new Promise(function(_0x25e61a,_0xb344e4){return db[_0x5436('0x1e')][_0x5436('0x1f')]({'raw':_0x5074e[_0x5436('0x16')]?_0x5074e[_0x5436('0x16')][_0x5436('0x20')]===undefined?!![]:![]:!![],'where':_0x5074e[_0x5436('0x16')]?_0x5074e['options'][_0x5436('0x21')]||null:null,'attributes':_0x5074e[_0x5436('0x16')]?_0x5074e[_0x5436('0x16')][_0x5436('0x17')]||null:null,'include':_0x5074e[_0x5436('0x16')]?_0x5074e[_0x5436('0x16')][_0x5436('0x19')]?_[_0x5436('0x1a')](_0x5074e['options'][_0x5436('0x19')],function(_0x5b65ac){return{'model':db[_0x5b65ac['model']],'as':_0x5b65ac['as'],'attributes':_0x5b65ac['attributes'],'include':_0x5b65ac[_0x5436('0x19')]?_[_0x5436('0x1a')](_0x5b65ac[_0x5436('0x19')],function(_0x25e859){return{'model':db[_0x25e859[_0x5436('0x1b')]],'as':_0x25e859['as'],'attributes':_0x25e859[_0x5436('0x17')],'include':_0x25e859[_0x5436('0x19')]?_[_0x5436('0x1a')](_0x25e859[_0x5436('0x19')],function(_0x3fb17f){return{'model':db[_0x3fb17f[_0x5436('0x1b')]],'as':_0x3fb17f['as'],'attributes':_0x3fb17f['attributes']};}):[]};}):[]};}):[]:[]})[_0x5436('0x1c')](function(_0x5ce2f8){logger['info']('ShowFreshdeskAccount',_0x5074e);logger[_0x5436('0xc')]('ShowFreshdeskAccount',_0x5074e,JSON['stringify'](_0x5ce2f8));_0x25e61a(_0x5ce2f8);})[_0x5436('0x13')](function(_0x208a0f){logger[_0x5436('0xe')](_0x5436('0x1d'),_0x208a0f['message'],_0x5074e);_0xb344e4(_0x556aa4[_0x5436('0xe')](0x1f4,_0x208a0f[_0x5436('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index bcefd7c..c58a20a 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 _0xac85=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','get','/:id','show'];(function(_0x24c926,_0x286ae3){var _0x289389=function(_0x44208b){while(--_0x44208b){_0x24c926['push'](_0x24c926['shift']());}};_0x289389(++_0x286ae3);}(_0xac85,0x1aa));var _0x5ac8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xac85[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ac8('0x0'));var router=express[_0x5ac8('0x1')]();var fs_extra=require(_0x5ac8('0x2'));var auth=require(_0x5ac8('0x3'));var interaction=require(_0x5ac8('0x4'));var config=require(_0x5ac8('0x5'));var controller=require(_0x5ac8('0x6'));router['get']('/',auth[_0x5ac8('0x7')](),controller['index']);router[_0x5ac8('0x8')](_0x5ac8('0x9'),auth['isAuthenticated'](),controller[_0x5ac8('0xa')]);router[_0x5ac8('0x8')]('/:id/fields',auth[_0x5ac8('0x7')](),controller[_0x5ac8('0xb')]);router[_0x5ac8('0x8')](_0x5ac8('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x5ac8('0x8')](_0x5ac8('0xd'),auth[_0x5ac8('0x7')](),controller[_0x5ac8('0xe')]);router[_0x5ac8('0x8')](_0x5ac8('0xf'),auth['isAuthenticated'](),controller[_0x5ac8('0x10')]);router[_0x5ac8('0x11')]('/',auth['isAuthenticated'](),controller[_0x5ac8('0x12')]);router[_0x5ac8('0x11')](_0x5ac8('0xf'),auth[_0x5ac8('0x7')](),controller[_0x5ac8('0x13')]);router[_0x5ac8('0x14')](_0x5ac8('0x9'),auth[_0x5ac8('0x7')](),controller[_0x5ac8('0x15')]);router['delete']('/:id',auth[_0x5ac8('0x7')](),controller['destroy']);module[_0x5ac8('0x16')]=router; \ No newline at end of file +var _0x1034=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x491842,_0x4ca9af){var _0x54b04e=function(_0x1f62b8){while(--_0x1f62b8){_0x491842['push'](_0x491842['shift']());}};_0x54b04e(++_0x4ca9af);}(_0x1034,0x1ee));var _0x4103=function(_0x239a1a,_0x2d907a){_0x239a1a=_0x239a1a-0x0;var _0x3807c4=_0x1034[_0x239a1a];return _0x3807c4;};'use strict';var multer=require(_0x4103('0x0'));var util=require(_0x4103('0x1'));var path=require(_0x4103('0x2'));var timeout=require(_0x4103('0x3'));var express=require(_0x4103('0x4'));var router=express[_0x4103('0x5')]();var fs_extra=require(_0x4103('0x6'));var auth=require(_0x4103('0x7'));var interaction=require(_0x4103('0x8'));var config=require('../../config/environment');var controller=require(_0x4103('0x9'));router[_0x4103('0xa')]('/',auth[_0x4103('0xb')](),controller['index']);router['get']('/:id',auth[_0x4103('0xb')](),controller['show']);router['get'](_0x4103('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x4103('0xa')](_0x4103('0xd'),auth[_0x4103('0xb')](),controller[_0x4103('0xe')]);router[_0x4103('0xa')](_0x4103('0xf'),auth[_0x4103('0xb')](),controller[_0x4103('0x10')]);router['get']('/:id/tags',auth[_0x4103('0xb')](),controller['getTags']);router[_0x4103('0x11')]('/',auth['isAuthenticated'](),controller[_0x4103('0x12')]);router['post'](_0x4103('0x13'),auth[_0x4103('0xb')](),controller['setTags']);router[_0x4103('0x14')](_0x4103('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x4103('0x16')](_0x4103('0x15'),auth[_0x4103('0xb')](),controller[_0x4103('0x17')]);module[_0x4103('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index baa7d71..ec1ba9b 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 _0xd176=['exports','STRING','sequelize'];(function(_0x6df151,_0xc66ff0){var _0x137f91=function(_0xfcbfdc){while(--_0xfcbfdc){_0x6df151['push'](_0x6df151['shift']());}};_0x137f91(++_0xc66ff0);}(_0xd176,0x19d));var _0x6d17=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0xd176[_0x59dccc];return _0xc97bcb;};'use strict';var Sequelize=require(_0x6d17('0x0'));module[_0x6d17('0x1')]={'name':{'type':Sequelize[_0x6d17('0x2')]},'description':{'type':Sequelize[_0x6d17('0x2')]}}; \ No newline at end of file +var _0xd50e=['exports','STRING','sequelize'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xd50e,0x18b));var _0xed50=function(_0x22c00c,_0x1de66a){_0x22c00c=_0x22c00c-0x0;var _0x50572c=_0xd50e[_0x22c00c];return _0x50572c;};'use strict';var Sequelize=require(_0xed50('0x0'));module[_0xed50('0x1')]={'name':{'type':Sequelize[_0xed50('0x2')]},'description':{'type':Sequelize[_0xed50('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 2f50adf..088ce86 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 _0xe974=['body','find','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','catch','params','includeAll','create'];(function(_0x3576a1,_0x2e3290){var _0x95ba42=function(_0x4a1fc3){while(--_0x4a1fc3){_0x3576a1['push'](_0x3576a1['shift']());}};_0x95ba42(++_0x2e3290);}(_0xe974,0x144));var _0x4e97=function(_0x364cf8,_0x146b9b){_0x364cf8=_0x364cf8-0x0;var _0x6a59ee=_0xe974[_0x364cf8];return _0x6a59ee;};'use strict';var emlformat=require(_0x4e97('0x0'));var rimraf=require(_0x4e97('0x1'));var zipdir=require(_0x4e97('0x2'));var jsonpatch=require(_0x4e97('0x3'));var rp=require(_0x4e97('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4e97('0x5'));var util=require(_0x4e97('0x6'));var path=require(_0x4e97('0x7'));var sox=require(_0x4e97('0x8'));var csv=require(_0x4e97('0x9'));var ejs=require(_0x4e97('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e97('0xb'));var crypto=require(_0x4e97('0xc'));var jsforce=require(_0x4e97('0xd'));var deskjs=require(_0x4e97('0xe'));var toCsv=require(_0x4e97('0x9'));var querystring=require(_0x4e97('0xf'));var Papa=require(_0x4e97('0x10'));var Redis=require(_0x4e97('0x11'));var authService=require(_0x4e97('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4e97('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e97('0x14'));var utils=require(_0x4e97('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4e97('0x16'))['db'];function respondWithStatusCode(_0x15a5a2,_0x384a10){_0x384a10=_0x384a10||0xcc;return function(_0x28b332){if(_0x28b332){return _0x15a5a2['sendStatus'](_0x384a10);}return _0x15a5a2[_0x4e97('0x17')](_0x384a10)[_0x4e97('0x18')]();};}function respondWithResult(_0x40245e,_0x16bd7a){_0x16bd7a=_0x16bd7a||0xc8;return function(_0xe3ddee){if(_0xe3ddee){return _0x40245e[_0x4e97('0x17')](_0x16bd7a)['json'](_0xe3ddee);}};}function respondWithFilteredResult(_0x196fe6,_0x56b50e){return function(_0x5c0862){if(_0x5c0862){var _0xd6857e=typeof _0x56b50e[_0x4e97('0x19')]===_0x4e97('0x1a')&&typeof _0x56b50e[_0x4e97('0x1b')]===_0x4e97('0x1a');var _0x5083f5=_0x5c0862[_0x4e97('0x1c')];var _0x4c6d61=_0xd6857e?0x0:_0x56b50e[_0x4e97('0x19')];var _0x495e33=_0xd6857e?_0x5c0862['count']:_0x56b50e[_0x4e97('0x19')]+_0x56b50e[_0x4e97('0x1b')];var _0x2b5491;if(_0x495e33>=_0x5083f5){_0x495e33=_0x5083f5;_0x2b5491=0xc8;}else{_0x2b5491=0xce;}_0x196fe6['status'](_0x2b5491);return _0x196fe6['set']('Content-Range',_0x4c6d61+'-'+_0x495e33+'/'+_0x5083f5)['json'](_0x5c0862);}return null;};}function patchUpdates(_0xc503a6){return function(_0x23e474){try{jsonpatch[_0x4e97('0x1d')](_0x23e474,_0xc503a6,!![]);}catch(_0x147ed0){return BPromise[_0x4e97('0x1e')](_0x147ed0);}return _0x23e474[_0x4e97('0x1f')]();};}function saveUpdates(_0x5ab6de,_0x2bc702){return function(_0x1db751){if(_0x1db751){return _0x1db751[_0x4e97('0x20')](_0x5ab6de)[_0x4e97('0x21')](function(_0xe588e1){return _0xe588e1;});}return null;};}function removeEntity(_0x1b9ad0,_0x50f19a){return function(_0x48b461){if(_0x48b461){return _0x48b461[_0x4e97('0x22')]()[_0x4e97('0x21')](function(){_0x1b9ad0[_0x4e97('0x17')](0xcc)[_0x4e97('0x18')]();});}};}function handleEntityNotFound(_0x3141af,_0x55e426){return function(_0x113305){if(!_0x113305){_0x3141af[_0x4e97('0x23')](0x194);}return _0x113305;};}function handleError(_0x4f8e71,_0x4a60a6){_0x4a60a6=_0x4a60a6||0x1f4;return function(_0x2b5108){logger['error'](_0x2b5108[_0x4e97('0x24')]);if(_0x2b5108['name']){delete _0x2b5108[_0x4e97('0x25')];}_0x4f8e71[_0x4e97('0x17')](_0x4a60a6)[_0x4e97('0x26')](_0x2b5108);};}exports[_0x4e97('0x27')]=function(_0x349089,_0x242303){var _0x42f684={},_0x1efd98={},_0x33d9fa={'count':0x0,'rows':[]};var _0x2d6f0b=_[_0x4e97('0x28')](db[_0x4e97('0x29')][_0x4e97('0x2a')],function(_0x358ed8){return{'name':_0x358ed8[_0x4e97('0x2b')],'type':_0x358ed8[_0x4e97('0x2c')][_0x4e97('0x2d')]};});_0x1efd98[_0x4e97('0x2e')]=_[_0x4e97('0x28')](_0x2d6f0b,'name');_0x1efd98[_0x4e97('0x2f')]=_[_0x4e97('0x30')](_0x349089[_0x4e97('0x2f')]);_0x1efd98[_0x4e97('0x31')]=_[_0x4e97('0x32')](_0x1efd98[_0x4e97('0x2e')],_0x1efd98[_0x4e97('0x2f')]);_0x42f684[_0x4e97('0x33')]=_[_0x4e97('0x32')](_0x1efd98[_0x4e97('0x2e')],qs[_0x4e97('0x34')](_0x349089[_0x4e97('0x2f')]['fields']));_0x42f684['attributes']=_0x42f684[_0x4e97('0x33')][_0x4e97('0x35')]?_0x42f684[_0x4e97('0x33')]:_0x1efd98[_0x4e97('0x2e')];if(!_0x349089[_0x4e97('0x2f')][_0x4e97('0x36')](_0x4e97('0x37'))){_0x42f684[_0x4e97('0x1b')]=qs['limit'](_0x349089[_0x4e97('0x2f')][_0x4e97('0x1b')]);_0x42f684[_0x4e97('0x19')]=qs[_0x4e97('0x19')](_0x349089[_0x4e97('0x2f')]['offset']);}_0x42f684[_0x4e97('0x38')]=qs[_0x4e97('0x39')](_0x349089[_0x4e97('0x2f')]['sort']);_0x42f684[_0x4e97('0x3a')]=qs[_0x4e97('0x31')](_['pick'](_0x349089[_0x4e97('0x2f')],_0x1efd98[_0x4e97('0x31')]),_0x2d6f0b);if(_0x349089[_0x4e97('0x2f')]['filter']){_0x42f684[_0x4e97('0x3a')]=_[_0x4e97('0x3b')](_0x42f684['where'],{'$or':_[_0x4e97('0x28')](_0x2d6f0b,function(_0x4b97ce){if(_0x4b97ce[_0x4e97('0x2c')]!=='VIRTUAL'){var _0x3a19a={};_0x3a19a[_0x4b97ce[_0x4e97('0x25')]]={'$like':'%'+_0x349089[_0x4e97('0x2f')][_0x4e97('0x3c')]+'%'};return _0x3a19a;}})});}_0x42f684=_['merge']({},_0x42f684,_0x349089[_0x4e97('0x3d')]);var _0x43dbad={'where':_0x42f684[_0x4e97('0x3a')]};return db['FreshdeskConfiguration'][_0x4e97('0x1c')](_0x43dbad)['then'](function(_0x6ce14c){_0x33d9fa[_0x4e97('0x1c')]=_0x6ce14c;if(_0x349089[_0x4e97('0x2f')]['includeAll']){_0x42f684['include']=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x42f684);})[_0x4e97('0x21')](function(_0x266e45){_0x33d9fa['rows']=_0x266e45;return _0x33d9fa;})[_0x4e97('0x21')](respondWithFilteredResult(_0x242303,_0x42f684))[_0x4e97('0x3e')](handleError(_0x242303,null));};exports['show']=function(_0x17a57a,_0x49c53a){var _0x226a4b={'raw':![],'where':{'id':_0x17a57a[_0x4e97('0x3f')]['id']}},_0x2ea36d={};_0x2ea36d[_0x4e97('0x2e')]=_[_0x4e97('0x30')](db[_0x4e97('0x29')]['rawAttributes']);_0x2ea36d[_0x4e97('0x2f')]=_[_0x4e97('0x30')](_0x17a57a[_0x4e97('0x2f')]);_0x2ea36d[_0x4e97('0x31')]=_[_0x4e97('0x32')](_0x2ea36d[_0x4e97('0x2e')],_0x2ea36d['query']);_0x226a4b[_0x4e97('0x33')]=_[_0x4e97('0x32')](_0x2ea36d[_0x4e97('0x2e')],qs[_0x4e97('0x34')](_0x17a57a['query'][_0x4e97('0x34')]));_0x226a4b[_0x4e97('0x33')]=_0x226a4b[_0x4e97('0x33')][_0x4e97('0x35')]?_0x226a4b[_0x4e97('0x33')]:_0x2ea36d[_0x4e97('0x2e')];if(_0x17a57a[_0x4e97('0x2f')][_0x4e97('0x40')]){_0x226a4b['include']=[{'all':!![]}];}_0x226a4b=_['merge']({},_0x226a4b,_0x17a57a['options']);return db['FreshdeskConfiguration']['find'](_0x226a4b)[_0x4e97('0x21')](handleEntityNotFound(_0x49c53a,null))[_0x4e97('0x21')](respondWithResult(_0x49c53a,null))[_0x4e97('0x3e')](handleError(_0x49c53a,null));};exports[_0x4e97('0x41')]=function(_0x3b6836,_0x2ad70d){return db[_0x4e97('0x29')]['create'](_0x3b6836[_0x4e97('0x42')],{})[_0x4e97('0x21')](respondWithResult(_0x2ad70d,0xc9))['catch'](handleError(_0x2ad70d,null));};exports[_0x4e97('0x20')]=function(_0x2f930e,_0x2bbcfe){if(_0x2f930e['body']['id']){delete _0x2f930e[_0x4e97('0x42')]['id'];}return db[_0x4e97('0x29')][_0x4e97('0x43')]({'where':{'id':_0x2f930e['params']['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x2bbcfe,null))[_0x4e97('0x21')](saveUpdates(_0x2f930e[_0x4e97('0x42')],null))[_0x4e97('0x21')](respondWithResult(_0x2bbcfe,null))['catch'](handleError(_0x2bbcfe,null));};exports[_0x4e97('0x22')]=function(_0x3c0fad,_0x321fc6){return db['FreshdeskConfiguration'][_0x4e97('0x43')]({'where':{'id':_0x3c0fad[_0x4e97('0x3f')]['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x321fc6,null))['then'](removeEntity(_0x321fc6,null))[_0x4e97('0x3e')](handleError(_0x321fc6,null));};exports[_0x4e97('0x44')]=function(_0x8bdfe9,_0x3a8d8c,_0x177a1d){var _0xa8629d={};var _0x44ebc6={};var _0x3c655f;var _0x53e2eb;return db['FreshdeskConfiguration'][_0x4e97('0x45')]({'where':{'id':_0x8bdfe9[_0x4e97('0x3f')]['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x3a8d8c,null))[_0x4e97('0x21')](function(_0x5dffbd){if(_0x5dffbd){_0x3c655f=_0x5dffbd;_0x44ebc6[_0x4e97('0x2e')]=_[_0x4e97('0x30')](db[_0x4e97('0x46')][_0x4e97('0x2a')]);_0x44ebc6[_0x4e97('0x2f')]=_[_0x4e97('0x30')](_0x8bdfe9['query']);_0x44ebc6['filters']=_['intersection'](_0x44ebc6['model'],_0x44ebc6[_0x4e97('0x2f')]);_0xa8629d['attributes']=_['intersection'](_0x44ebc6[_0x4e97('0x2e')],qs[_0x4e97('0x34')](_0x8bdfe9[_0x4e97('0x2f')]['fields']));_0xa8629d[_0x4e97('0x33')]=_0xa8629d[_0x4e97('0x33')]['length']?_0xa8629d[_0x4e97('0x33')]:_0x44ebc6[_0x4e97('0x2e')];_0xa8629d['order']=qs[_0x4e97('0x39')](_0x8bdfe9[_0x4e97('0x2f')][_0x4e97('0x39')]);_0xa8629d[_0x4e97('0x3a')]=qs['filters'](_['pick'](_0x8bdfe9[_0x4e97('0x2f')],_0x44ebc6[_0x4e97('0x31')]));if(_0x8bdfe9['query'][_0x4e97('0x3c')]){_0xa8629d[_0x4e97('0x3a')]=_[_0x4e97('0x3b')](_0xa8629d[_0x4e97('0x3a')],{'$or':_[_0x4e97('0x28')](_0xa8629d[_0x4e97('0x33')],function(_0x1a9de1){var _0x12cb63={};_0x12cb63[_0x1a9de1]={'$like':'%'+_0x8bdfe9[_0x4e97('0x2f')][_0x4e97('0x3c')]+'%'};return _0x12cb63;})});}_0xa8629d=_['merge']({},_0xa8629d,_0x8bdfe9['options']);return _0x3c655f[_0x4e97('0x44')](_0xa8629d);}})[_0x4e97('0x21')](function(_0x543f85){if(_0x543f85){_0x53e2eb=_0x543f85[_0x4e97('0x35')];if(!_0x8bdfe9['query'][_0x4e97('0x36')](_0x4e97('0x37'))){_0xa8629d[_0x4e97('0x1b')]=qs[_0x4e97('0x1b')](_0x8bdfe9['query'][_0x4e97('0x1b')]);_0xa8629d[_0x4e97('0x19')]=qs['offset'](_0x8bdfe9[_0x4e97('0x2f')][_0x4e97('0x19')]);}return _0x3c655f['getFields'](_0xa8629d);}})[_0x4e97('0x21')](function(_0x174e58){if(_0x174e58){return _0x174e58?{'count':_0x53e2eb,'rows':_0x174e58}:null;}})[_0x4e97('0x21')](respondWithResult(_0x3a8d8c,null))[_0x4e97('0x3e')](handleError(_0x3a8d8c,null));};exports['getSubjects']=function(_0x4ea19c,_0x595ed7,_0xf9de24){var _0x1a252f={};var _0x29617d={};var _0x486d6a;var _0x81cad4;return db['FreshdeskConfiguration'][_0x4e97('0x45')]({'where':{'id':_0x4ea19c[_0x4e97('0x3f')]['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x595ed7,null))[_0x4e97('0x21')](function(_0x334edb){if(_0x334edb){_0x486d6a=_0x334edb;_0x29617d[_0x4e97('0x2e')]=_['keys'](db['FreshdeskField'][_0x4e97('0x2a')]);_0x29617d[_0x4e97('0x2f')]=_[_0x4e97('0x30')](_0x4ea19c['query']);_0x29617d[_0x4e97('0x31')]=_[_0x4e97('0x32')](_0x29617d[_0x4e97('0x2e')],_0x29617d[_0x4e97('0x2f')]);_0x1a252f[_0x4e97('0x33')]=_[_0x4e97('0x32')](_0x29617d[_0x4e97('0x2e')],qs[_0x4e97('0x34')](_0x4ea19c[_0x4e97('0x2f')][_0x4e97('0x34')]));_0x1a252f[_0x4e97('0x33')]=_0x1a252f[_0x4e97('0x33')][_0x4e97('0x35')]?_0x1a252f[_0x4e97('0x33')]:_0x29617d[_0x4e97('0x2e')];_0x1a252f[_0x4e97('0x38')]=qs[_0x4e97('0x39')](_0x4ea19c[_0x4e97('0x2f')][_0x4e97('0x39')]);_0x1a252f['where']=qs[_0x4e97('0x31')](_[_0x4e97('0x47')](_0x4ea19c[_0x4e97('0x2f')],_0x29617d[_0x4e97('0x31')]));if(_0x4ea19c['query']['filter']){_0x1a252f['where']=_['merge'](_0x1a252f[_0x4e97('0x3a')],{'$or':_[_0x4e97('0x28')](_0x1a252f['attributes'],function(_0x4aa4de){var _0x1feea9={};_0x1feea9[_0x4aa4de]={'$like':'%'+_0x4ea19c['query'][_0x4e97('0x3c')]+'%'};return _0x1feea9;})});}_0x1a252f=_[_0x4e97('0x3b')]({},_0x1a252f,_0x4ea19c['options']);return _0x486d6a[_0x4e97('0x48')](_0x1a252f);}})[_0x4e97('0x21')](function(_0x406052){if(_0x406052){_0x81cad4=_0x406052[_0x4e97('0x35')];if(!_0x4ea19c[_0x4e97('0x2f')][_0x4e97('0x36')]('nolimit')){_0x1a252f[_0x4e97('0x1b')]=qs[_0x4e97('0x1b')](_0x4ea19c[_0x4e97('0x2f')][_0x4e97('0x1b')]);_0x1a252f[_0x4e97('0x19')]=qs[_0x4e97('0x19')](_0x4ea19c[_0x4e97('0x2f')][_0x4e97('0x19')]);}return _0x486d6a['getSubjects'](_0x1a252f);}})[_0x4e97('0x21')](function(_0x1406cc){if(_0x1406cc){return _0x1406cc?{'count':_0x81cad4,'rows':_0x1406cc}:null;}})[_0x4e97('0x21')](respondWithResult(_0x595ed7,null))[_0x4e97('0x3e')](handleError(_0x595ed7,null));};exports[_0x4e97('0x49')]=function(_0x456869,_0x31877d,_0x320f9c){var _0x1b6609={};var _0x124088={};var _0x4cf6fa;var _0x6a02dd;return db[_0x4e97('0x29')][_0x4e97('0x45')]({'where':{'id':_0x456869[_0x4e97('0x3f')]['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x31877d,null))['then'](function(_0x25eca6){if(_0x25eca6){_0x4cf6fa=_0x25eca6;_0x124088[_0x4e97('0x2e')]=_[_0x4e97('0x30')](db[_0x4e97('0x46')][_0x4e97('0x2a')]);_0x124088['query']=_['keys'](_0x456869[_0x4e97('0x2f')]);_0x124088['filters']=_['intersection'](_0x124088[_0x4e97('0x2e')],_0x124088[_0x4e97('0x2f')]);_0x1b6609[_0x4e97('0x33')]=_['intersection'](_0x124088[_0x4e97('0x2e')],qs[_0x4e97('0x34')](_0x456869[_0x4e97('0x2f')][_0x4e97('0x34')]));_0x1b6609[_0x4e97('0x33')]=_0x1b6609[_0x4e97('0x33')][_0x4e97('0x35')]?_0x1b6609[_0x4e97('0x33')]:_0x124088[_0x4e97('0x2e')];_0x1b6609['order']=qs[_0x4e97('0x39')](_0x456869['query'][_0x4e97('0x39')]);_0x1b6609[_0x4e97('0x3a')]=qs['filters'](_[_0x4e97('0x47')](_0x456869[_0x4e97('0x2f')],_0x124088[_0x4e97('0x31')]));if(_0x456869['query'][_0x4e97('0x3c')]){_0x1b6609[_0x4e97('0x3a')]=_[_0x4e97('0x3b')](_0x1b6609[_0x4e97('0x3a')],{'$or':_[_0x4e97('0x28')](_0x1b6609['attributes'],function(_0x5d8526){var _0x5bbde5={};_0x5bbde5[_0x5d8526]={'$like':'%'+_0x456869['query'][_0x4e97('0x3c')]+'%'};return _0x5bbde5;})});}_0x1b6609=_['merge']({},_0x1b6609,_0x456869[_0x4e97('0x3d')]);return _0x4cf6fa[_0x4e97('0x49')](_0x1b6609);}})[_0x4e97('0x21')](function(_0x13e1a3){if(_0x13e1a3){_0x6a02dd=_0x13e1a3['length'];if(!_0x456869[_0x4e97('0x2f')]['hasOwnProperty']('nolimit')){_0x1b6609['limit']=qs[_0x4e97('0x1b')](_0x456869[_0x4e97('0x2f')][_0x4e97('0x1b')]);_0x1b6609[_0x4e97('0x19')]=qs[_0x4e97('0x19')](_0x456869[_0x4e97('0x2f')][_0x4e97('0x19')]);}return _0x4cf6fa['getDescriptions'](_0x1b6609);}})[_0x4e97('0x21')](function(_0x43a410){if(_0x43a410){return _0x43a410?{'count':_0x6a02dd,'rows':_0x43a410}:null;}})[_0x4e97('0x21')](respondWithResult(_0x31877d,null))['catch'](handleError(_0x31877d,null));};exports[_0x4e97('0x4a')]=function(_0x48cbcb,_0x271c69,_0x5c671e){var _0x692f0a={};var _0x1f4ce8={};var _0x58dfd1;var _0xd50950;return db[_0x4e97('0x29')][_0x4e97('0x45')]({'where':{'id':_0x48cbcb[_0x4e97('0x3f')]['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x271c69,null))['then'](function(_0x1be778){if(_0x1be778){_0x58dfd1=_0x1be778;_0x1f4ce8[_0x4e97('0x2e')]=_[_0x4e97('0x30')](db[_0x4e97('0x4b')][_0x4e97('0x2a')]);_0x1f4ce8[_0x4e97('0x2f')]=_[_0x4e97('0x30')](_0x48cbcb[_0x4e97('0x2f')]);_0x1f4ce8[_0x4e97('0x31')]=_[_0x4e97('0x32')](_0x1f4ce8[_0x4e97('0x2e')],_0x1f4ce8[_0x4e97('0x2f')]);_0x692f0a[_0x4e97('0x33')]=_['intersection'](_0x1f4ce8[_0x4e97('0x2e')],qs[_0x4e97('0x34')](_0x48cbcb[_0x4e97('0x2f')][_0x4e97('0x34')]));_0x692f0a[_0x4e97('0x33')]=_0x692f0a[_0x4e97('0x33')][_0x4e97('0x35')]?_0x692f0a[_0x4e97('0x33')]:_0x1f4ce8[_0x4e97('0x2e')];_0x692f0a[_0x4e97('0x38')]=qs[_0x4e97('0x39')](_0x48cbcb[_0x4e97('0x2f')]['sort']);_0x692f0a[_0x4e97('0x3a')]=qs['filters'](_[_0x4e97('0x47')](_0x48cbcb[_0x4e97('0x2f')],_0x1f4ce8[_0x4e97('0x31')]));if(_0x48cbcb[_0x4e97('0x2f')][_0x4e97('0x3c')]){_0x692f0a[_0x4e97('0x3a')]=_[_0x4e97('0x3b')](_0x692f0a[_0x4e97('0x3a')],{'$or':_[_0x4e97('0x28')](_0x692f0a[_0x4e97('0x33')],function(_0x590999){var _0x37bf15={};_0x37bf15[_0x590999]={'$like':'%'+_0x48cbcb[_0x4e97('0x2f')][_0x4e97('0x3c')]+'%'};return _0x37bf15;})});}_0x692f0a=_[_0x4e97('0x3b')]({},_0x692f0a,_0x48cbcb[_0x4e97('0x3d')]);return _0x58dfd1[_0x4e97('0x4a')](_0x692f0a);}})[_0x4e97('0x21')](function(_0x53b128){if(_0x53b128){_0xd50950=_0x53b128[_0x4e97('0x35')];if(!_0x48cbcb[_0x4e97('0x2f')][_0x4e97('0x36')](_0x4e97('0x37'))){_0x692f0a[_0x4e97('0x1b')]=qs['limit'](_0x48cbcb[_0x4e97('0x2f')]['limit']);_0x692f0a[_0x4e97('0x19')]=qs[_0x4e97('0x19')](_0x48cbcb[_0x4e97('0x2f')][_0x4e97('0x19')]);}return _0x58dfd1[_0x4e97('0x4a')](_0x692f0a);}})[_0x4e97('0x21')](function(_0x3aa73c){if(_0x3aa73c){return _0x3aa73c?{'count':_0xd50950,'rows':_0x3aa73c}:null;}})[_0x4e97('0x21')](respondWithResult(_0x271c69,null))[_0x4e97('0x3e')](handleError(_0x271c69,null));};exports[_0x4e97('0x4c')]=function(_0x356bac,_0x5133ea,_0x499edc){if(_0x356bac[_0x4e97('0x42')]['id']){delete _0x356bac[_0x4e97('0x42')]['id'];}return db[_0x4e97('0x29')][_0x4e97('0x45')]({'where':{'id':_0x356bac[_0x4e97('0x3f')]['id']}})[_0x4e97('0x21')](handleEntityNotFound(_0x5133ea,null))[_0x4e97('0x21')](function(_0x2839ef){if(_0x2839ef){return _0x2839ef[_0x4e97('0x4c')](_0x356bac[_0x4e97('0x42')][_0x4e97('0x4d')]||[]);}return null;})[_0x4e97('0x21')](respondWithResult(_0x5133ea,null))[_0x4e97('0x3e')](handleError(_0x5133ea,null));}; \ No newline at end of file +var _0x9760=['index','map','FreshdeskConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','order','getSubjects','FreshdeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','name','send'];(function(_0xdd3b26,_0x2c7c63){var _0x4d757c=function(_0x2f86fe){while(--_0x2f86fe){_0xdd3b26['push'](_0xdd3b26['shift']());}};_0x4d757c(++_0x2c7c63);}(_0x9760,0x1d4));var _0x0976=function(_0x2c0fd3,_0x340eb5){_0x2c0fd3=_0x2c0fd3-0x0;var _0x34000b=_0x9760[_0x2c0fd3];return _0x34000b;};'use strict';var emlformat=require(_0x0976('0x0'));var rimraf=require(_0x0976('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0976('0x2'));var rp=require(_0x0976('0x3'));var moment=require(_0x0976('0x4'));var BPromise=require(_0x0976('0x5'));var Mustache=require(_0x0976('0x6'));var util=require(_0x0976('0x7'));var path=require('path');var sox=require(_0x0976('0x8'));var csv=require(_0x0976('0x9'));var ejs=require(_0x0976('0xa'));var fs=require('fs');var fs_extra=require(_0x0976('0xb'));var _=require(_0x0976('0xc'));var squel=require(_0x0976('0xd'));var crypto=require(_0x0976('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0976('0xf'));var toCsv=require(_0x0976('0x9'));var querystring=require(_0x0976('0x10'));var Papa=require(_0x0976('0x11'));var Redis=require(_0x0976('0x12'));var authService=require(_0x0976('0x13'));var qs=require(_0x0976('0x14'));var as=require(_0x0976('0x15'));var hardwareService=require(_0x0976('0x16'));var logger=require('../../config/logger')(_0x0976('0x17'));var utils=require(_0x0976('0x18'));var config=require(_0x0976('0x19'));var licenseUtil=require(_0x0976('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3209e5,_0x5d8d66){_0x5d8d66=_0x5d8d66||0xcc;return function(_0x2f071d){if(_0x2f071d){return _0x3209e5['sendStatus'](_0x5d8d66);}return _0x3209e5[_0x0976('0x1b')](_0x5d8d66)[_0x0976('0x1c')]();};}function respondWithResult(_0x485e42,_0x2907df){_0x2907df=_0x2907df||0xc8;return function(_0x5cae65){if(_0x5cae65){return _0x485e42[_0x0976('0x1b')](_0x2907df)[_0x0976('0x1d')](_0x5cae65);}};}function respondWithFilteredResult(_0x482b44,_0x70c25a){return function(_0x5795ed){if(_0x5795ed){var _0x19f90f=typeof _0x70c25a['offset']===_0x0976('0x1e')&&typeof _0x70c25a[_0x0976('0x1f')]===_0x0976('0x1e');var _0x28581a=_0x5795ed['count'];var _0x18ee61=_0x19f90f?0x0:_0x70c25a[_0x0976('0x20')];var _0xfb5f00=_0x19f90f?_0x5795ed[_0x0976('0x21')]:_0x70c25a[_0x0976('0x20')]+_0x70c25a['limit'];var _0x536d43;if(_0xfb5f00>=_0x28581a){_0xfb5f00=_0x28581a;_0x536d43=0xc8;}else{_0x536d43=0xce;}_0x482b44['status'](_0x536d43);return _0x482b44[_0x0976('0x22')](_0x0976('0x23'),_0x18ee61+'-'+_0xfb5f00+'/'+_0x28581a)[_0x0976('0x1d')](_0x5795ed);}return null;};}function patchUpdates(_0x47f1a7){return function(_0x2066be){try{jsonpatch[_0x0976('0x24')](_0x2066be,_0x47f1a7,!![]);}catch(_0x19ee60){return BPromise['reject'](_0x19ee60);}return _0x2066be[_0x0976('0x25')]();};}function saveUpdates(_0x194641,_0x9e35e){return function(_0x4ae27e){if(_0x4ae27e){return _0x4ae27e[_0x0976('0x26')](_0x194641)['then'](function(_0x4a0645){return _0x4a0645;});}return null;};}function removeEntity(_0x550d24,_0x16a4df){return function(_0x1d25b7){if(_0x1d25b7){return _0x1d25b7[_0x0976('0x27')]()['then'](function(){_0x550d24[_0x0976('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49b435,_0x407b68){return function(_0x53976d){if(!_0x53976d){_0x49b435['sendStatus'](0x194);}return _0x53976d;};}function handleError(_0x338da5,_0x5e013d){_0x5e013d=_0x5e013d||0x1f4;return function(_0x55cca2){logger['error'](_0x55cca2['stack']);if(_0x55cca2['name']){delete _0x55cca2[_0x0976('0x28')];}_0x338da5[_0x0976('0x1b')](_0x5e013d)[_0x0976('0x29')](_0x55cca2);};}exports[_0x0976('0x2a')]=function(_0x5c764e,_0x1213e8){var _0x214752={},_0x46da03={},_0x1bad4a={'count':0x0,'rows':[]};var _0x3f0aee=_[_0x0976('0x2b')](db[_0x0976('0x2c')][_0x0976('0x2d')],function(_0x11065d){return{'name':_0x11065d[_0x0976('0x2e')],'type':_0x11065d['type']['key']};});_0x46da03[_0x0976('0x2f')]=_[_0x0976('0x2b')](_0x3f0aee,'name');_0x46da03[_0x0976('0x30')]=_[_0x0976('0x31')](_0x5c764e[_0x0976('0x30')]);_0x46da03[_0x0976('0x32')]=_['intersection'](_0x46da03[_0x0976('0x2f')],_0x46da03['query']);_0x214752['attributes']=_[_0x0976('0x33')](_0x46da03[_0x0976('0x2f')],qs[_0x0976('0x34')](_0x5c764e[_0x0976('0x30')][_0x0976('0x34')]));_0x214752[_0x0976('0x35')]=_0x214752[_0x0976('0x35')][_0x0976('0x36')]?_0x214752[_0x0976('0x35')]:_0x46da03[_0x0976('0x2f')];if(!_0x5c764e[_0x0976('0x30')][_0x0976('0x37')](_0x0976('0x38'))){_0x214752[_0x0976('0x1f')]=qs[_0x0976('0x1f')](_0x5c764e[_0x0976('0x30')][_0x0976('0x1f')]);_0x214752[_0x0976('0x20')]=qs[_0x0976('0x20')](_0x5c764e['query'][_0x0976('0x20')]);}_0x214752['order']=qs['sort'](_0x5c764e[_0x0976('0x30')][_0x0976('0x39')]);_0x214752[_0x0976('0x3a')]=qs['filters'](_[_0x0976('0x3b')](_0x5c764e['query'],_0x46da03[_0x0976('0x32')]),_0x3f0aee);if(_0x5c764e['query'][_0x0976('0x3c')]){_0x214752[_0x0976('0x3a')]=_[_0x0976('0x3d')](_0x214752[_0x0976('0x3a')],{'$or':_[_0x0976('0x2b')](_0x3f0aee,function(_0x51b618){if(_0x51b618[_0x0976('0x3e')]!==_0x0976('0x3f')){var _0x3bb17e={};_0x3bb17e[_0x51b618['name']]={'$like':'%'+_0x5c764e[_0x0976('0x30')][_0x0976('0x3c')]+'%'};return _0x3bb17e;}})});}_0x214752=_[_0x0976('0x3d')]({},_0x214752,_0x5c764e[_0x0976('0x40')]);var _0x1c6a78={'where':_0x214752[_0x0976('0x3a')]};return db[_0x0976('0x2c')][_0x0976('0x21')](_0x1c6a78)[_0x0976('0x41')](function(_0x3007bb){_0x1bad4a[_0x0976('0x21')]=_0x3007bb;if(_0x5c764e[_0x0976('0x30')][_0x0976('0x42')]){_0x214752[_0x0976('0x43')]=[{'all':!![]}];}return db[_0x0976('0x2c')]['findAll'](_0x214752);})[_0x0976('0x41')](function(_0x1a8be7){_0x1bad4a[_0x0976('0x44')]=_0x1a8be7;return _0x1bad4a;})[_0x0976('0x41')](respondWithFilteredResult(_0x1213e8,_0x214752))[_0x0976('0x45')](handleError(_0x1213e8,null));};exports[_0x0976('0x46')]=function(_0x572635,_0x167901){var _0x48facd={'raw':![],'where':{'id':_0x572635[_0x0976('0x47')]['id']}},_0x5a380e={};_0x5a380e[_0x0976('0x2f')]=_['keys'](db[_0x0976('0x2c')][_0x0976('0x2d')]);_0x5a380e[_0x0976('0x30')]=_[_0x0976('0x31')](_0x572635[_0x0976('0x30')]);_0x5a380e[_0x0976('0x32')]=_['intersection'](_0x5a380e[_0x0976('0x2f')],_0x5a380e[_0x0976('0x30')]);_0x48facd[_0x0976('0x35')]=_[_0x0976('0x33')](_0x5a380e['model'],qs['fields'](_0x572635[_0x0976('0x30')]['fields']));_0x48facd[_0x0976('0x35')]=_0x48facd[_0x0976('0x35')][_0x0976('0x36')]?_0x48facd[_0x0976('0x35')]:_0x5a380e[_0x0976('0x2f')];if(_0x572635[_0x0976('0x30')][_0x0976('0x42')]){_0x48facd[_0x0976('0x43')]=[{'all':!![]}];}_0x48facd=_[_0x0976('0x3d')]({},_0x48facd,_0x572635[_0x0976('0x40')]);return db['FreshdeskConfiguration'][_0x0976('0x48')](_0x48facd)[_0x0976('0x41')](handleEntityNotFound(_0x167901,null))['then'](respondWithResult(_0x167901,null))[_0x0976('0x45')](handleError(_0x167901,null));};exports[_0x0976('0x49')]=function(_0x2a854a,_0x5a225e){return db['FreshdeskConfiguration'][_0x0976('0x49')](_0x2a854a[_0x0976('0x4a')],{})[_0x0976('0x41')](respondWithResult(_0x5a225e,0xc9))[_0x0976('0x45')](handleError(_0x5a225e,null));};exports[_0x0976('0x26')]=function(_0x440a2e,_0xe7db0b){if(_0x440a2e[_0x0976('0x4a')]['id']){delete _0x440a2e['body']['id'];}return db['FreshdeskConfiguration'][_0x0976('0x48')]({'where':{'id':_0x440a2e[_0x0976('0x47')]['id']}})['then'](handleEntityNotFound(_0xe7db0b,null))['then'](saveUpdates(_0x440a2e[_0x0976('0x4a')],null))[_0x0976('0x41')](respondWithResult(_0xe7db0b,null))['catch'](handleError(_0xe7db0b,null));};exports[_0x0976('0x27')]=function(_0x468aad,_0x189bbd){return db[_0x0976('0x2c')]['find']({'where':{'id':_0x468aad['params']['id']}})[_0x0976('0x41')](handleEntityNotFound(_0x189bbd,null))[_0x0976('0x41')](removeEntity(_0x189bbd,null))[_0x0976('0x45')](handleError(_0x189bbd,null));};exports[_0x0976('0x4b')]=function(_0x523ea9,_0x5e5045,_0x259f8a){var _0x10bec5={};var _0x22d633={};var _0x15a44d;var _0x18b10a;return db[_0x0976('0x2c')][_0x0976('0x4c')]({'where':{'id':_0x523ea9[_0x0976('0x47')]['id']}})[_0x0976('0x41')](handleEntityNotFound(_0x5e5045,null))[_0x0976('0x41')](function(_0xfe5ab6){if(_0xfe5ab6){_0x15a44d=_0xfe5ab6;_0x22d633[_0x0976('0x2f')]=_[_0x0976('0x31')](db['FreshdeskField'][_0x0976('0x2d')]);_0x22d633[_0x0976('0x30')]=_['keys'](_0x523ea9[_0x0976('0x30')]);_0x22d633[_0x0976('0x32')]=_['intersection'](_0x22d633[_0x0976('0x2f')],_0x22d633[_0x0976('0x30')]);_0x10bec5[_0x0976('0x35')]=_[_0x0976('0x33')](_0x22d633[_0x0976('0x2f')],qs['fields'](_0x523ea9[_0x0976('0x30')][_0x0976('0x34')]));_0x10bec5[_0x0976('0x35')]=_0x10bec5['attributes'][_0x0976('0x36')]?_0x10bec5[_0x0976('0x35')]:_0x22d633[_0x0976('0x2f')];_0x10bec5[_0x0976('0x4d')]=qs[_0x0976('0x39')](_0x523ea9['query'][_0x0976('0x39')]);_0x10bec5['where']=qs['filters'](_[_0x0976('0x3b')](_0x523ea9[_0x0976('0x30')],_0x22d633['filters']));if(_0x523ea9[_0x0976('0x30')][_0x0976('0x3c')]){_0x10bec5[_0x0976('0x3a')]=_[_0x0976('0x3d')](_0x10bec5['where'],{'$or':_[_0x0976('0x2b')](_0x10bec5[_0x0976('0x35')],function(_0x236138){var _0x30b8a2={};_0x30b8a2[_0x236138]={'$like':'%'+_0x523ea9[_0x0976('0x30')]['filter']+'%'};return _0x30b8a2;})});}_0x10bec5=_['merge']({},_0x10bec5,_0x523ea9[_0x0976('0x40')]);return _0x15a44d[_0x0976('0x4b')](_0x10bec5);}})[_0x0976('0x41')](function(_0x288464){if(_0x288464){_0x18b10a=_0x288464[_0x0976('0x36')];if(!_0x523ea9['query'][_0x0976('0x37')](_0x0976('0x38'))){_0x10bec5[_0x0976('0x1f')]=qs[_0x0976('0x1f')](_0x523ea9[_0x0976('0x30')][_0x0976('0x1f')]);_0x10bec5[_0x0976('0x20')]=qs['offset'](_0x523ea9[_0x0976('0x30')][_0x0976('0x20')]);}return _0x15a44d['getFields'](_0x10bec5);}})[_0x0976('0x41')](function(_0x62c549){if(_0x62c549){return _0x62c549?{'count':_0x18b10a,'rows':_0x62c549}:null;}})['then'](respondWithResult(_0x5e5045,null))[_0x0976('0x45')](handleError(_0x5e5045,null));};exports[_0x0976('0x4e')]=function(_0x376b4a,_0x226678,_0x5b0734){var _0x2148e3={};var _0x475a26={};var _0x4bda71;var _0x334519;return db['FreshdeskConfiguration'][_0x0976('0x4c')]({'where':{'id':_0x376b4a['params']['id']}})[_0x0976('0x41')](handleEntityNotFound(_0x226678,null))[_0x0976('0x41')](function(_0x19173d){if(_0x19173d){_0x4bda71=_0x19173d;_0x475a26[_0x0976('0x2f')]=_[_0x0976('0x31')](db[_0x0976('0x4f')]['rawAttributes']);_0x475a26[_0x0976('0x30')]=_[_0x0976('0x31')](_0x376b4a[_0x0976('0x30')]);_0x475a26[_0x0976('0x32')]=_[_0x0976('0x33')](_0x475a26[_0x0976('0x2f')],_0x475a26[_0x0976('0x30')]);_0x2148e3[_0x0976('0x35')]=_[_0x0976('0x33')](_0x475a26[_0x0976('0x2f')],qs[_0x0976('0x34')](_0x376b4a[_0x0976('0x30')][_0x0976('0x34')]));_0x2148e3[_0x0976('0x35')]=_0x2148e3[_0x0976('0x35')][_0x0976('0x36')]?_0x2148e3['attributes']:_0x475a26[_0x0976('0x2f')];_0x2148e3[_0x0976('0x4d')]=qs[_0x0976('0x39')](_0x376b4a['query'][_0x0976('0x39')]);_0x2148e3[_0x0976('0x3a')]=qs['filters'](_['pick'](_0x376b4a[_0x0976('0x30')],_0x475a26[_0x0976('0x32')]));if(_0x376b4a['query'][_0x0976('0x3c')]){_0x2148e3[_0x0976('0x3a')]=_['merge'](_0x2148e3[_0x0976('0x3a')],{'$or':_[_0x0976('0x2b')](_0x2148e3[_0x0976('0x35')],function(_0x2bcdc0){var _0x32b761={};_0x32b761[_0x2bcdc0]={'$like':'%'+_0x376b4a[_0x0976('0x30')][_0x0976('0x3c')]+'%'};return _0x32b761;})});}_0x2148e3=_[_0x0976('0x3d')]({},_0x2148e3,_0x376b4a[_0x0976('0x40')]);return _0x4bda71['getSubjects'](_0x2148e3);}})['then'](function(_0x1aef6d){if(_0x1aef6d){_0x334519=_0x1aef6d['length'];if(!_0x376b4a['query'][_0x0976('0x37')](_0x0976('0x38'))){_0x2148e3['limit']=qs[_0x0976('0x1f')](_0x376b4a['query'][_0x0976('0x1f')]);_0x2148e3[_0x0976('0x20')]=qs[_0x0976('0x20')](_0x376b4a[_0x0976('0x30')][_0x0976('0x20')]);}return _0x4bda71[_0x0976('0x4e')](_0x2148e3);}})[_0x0976('0x41')](function(_0x5d417e){if(_0x5d417e){return _0x5d417e?{'count':_0x334519,'rows':_0x5d417e}:null;}})[_0x0976('0x41')](respondWithResult(_0x226678,null))[_0x0976('0x45')](handleError(_0x226678,null));};exports['getDescriptions']=function(_0x4e811b,_0x243b42,_0x49b992){var _0x5200bf={};var _0x229be2={};var _0x1c0295;var _0x173e7c;return db[_0x0976('0x2c')]['findOne']({'where':{'id':_0x4e811b['params']['id']}})[_0x0976('0x41')](handleEntityNotFound(_0x243b42,null))['then'](function(_0x44fd77){if(_0x44fd77){_0x1c0295=_0x44fd77;_0x229be2[_0x0976('0x2f')]=_[_0x0976('0x31')](db['FreshdeskField'][_0x0976('0x2d')]);_0x229be2[_0x0976('0x30')]=_[_0x0976('0x31')](_0x4e811b[_0x0976('0x30')]);_0x229be2[_0x0976('0x32')]=_['intersection'](_0x229be2[_0x0976('0x2f')],_0x229be2[_0x0976('0x30')]);_0x5200bf[_0x0976('0x35')]=_[_0x0976('0x33')](_0x229be2[_0x0976('0x2f')],qs[_0x0976('0x34')](_0x4e811b[_0x0976('0x30')][_0x0976('0x34')]));_0x5200bf[_0x0976('0x35')]=_0x5200bf[_0x0976('0x35')][_0x0976('0x36')]?_0x5200bf[_0x0976('0x35')]:_0x229be2[_0x0976('0x2f')];_0x5200bf[_0x0976('0x4d')]=qs[_0x0976('0x39')](_0x4e811b[_0x0976('0x30')]['sort']);_0x5200bf[_0x0976('0x3a')]=qs[_0x0976('0x32')](_[_0x0976('0x3b')](_0x4e811b['query'],_0x229be2[_0x0976('0x32')]));if(_0x4e811b[_0x0976('0x30')]['filter']){_0x5200bf['where']=_['merge'](_0x5200bf[_0x0976('0x3a')],{'$or':_[_0x0976('0x2b')](_0x5200bf[_0x0976('0x35')],function(_0x16393c){var _0x545b42={};_0x545b42[_0x16393c]={'$like':'%'+_0x4e811b[_0x0976('0x30')][_0x0976('0x3c')]+'%'};return _0x545b42;})});}_0x5200bf=_[_0x0976('0x3d')]({},_0x5200bf,_0x4e811b[_0x0976('0x40')]);return _0x1c0295[_0x0976('0x50')](_0x5200bf);}})[_0x0976('0x41')](function(_0x2da46c){if(_0x2da46c){_0x173e7c=_0x2da46c[_0x0976('0x36')];if(!_0x4e811b[_0x0976('0x30')][_0x0976('0x37')](_0x0976('0x38'))){_0x5200bf[_0x0976('0x1f')]=qs[_0x0976('0x1f')](_0x4e811b['query'][_0x0976('0x1f')]);_0x5200bf[_0x0976('0x20')]=qs[_0x0976('0x20')](_0x4e811b[_0x0976('0x30')][_0x0976('0x20')]);}return _0x1c0295[_0x0976('0x50')](_0x5200bf);}})[_0x0976('0x41')](function(_0x3a77d5){if(_0x3a77d5){return _0x3a77d5?{'count':_0x173e7c,'rows':_0x3a77d5}:null;}})[_0x0976('0x41')](respondWithResult(_0x243b42,null))[_0x0976('0x45')](handleError(_0x243b42,null));};exports[_0x0976('0x51')]=function(_0x2d4618,_0x36f4ca,_0x1e1ee7){var _0x2456ca={};var _0x485b35={};var _0x39ca86;var _0x1f320d;return db[_0x0976('0x2c')]['findOne']({'where':{'id':_0x2d4618['params']['id']}})[_0x0976('0x41')](handleEntityNotFound(_0x36f4ca,null))[_0x0976('0x41')](function(_0x49d526){if(_0x49d526){_0x39ca86=_0x49d526;_0x485b35['model']=_[_0x0976('0x31')](db[_0x0976('0x52')][_0x0976('0x2d')]);_0x485b35['query']=_['keys'](_0x2d4618[_0x0976('0x30')]);_0x485b35['filters']=_[_0x0976('0x33')](_0x485b35[_0x0976('0x2f')],_0x485b35[_0x0976('0x30')]);_0x2456ca[_0x0976('0x35')]=_[_0x0976('0x33')](_0x485b35[_0x0976('0x2f')],qs['fields'](_0x2d4618[_0x0976('0x30')][_0x0976('0x34')]));_0x2456ca[_0x0976('0x35')]=_0x2456ca[_0x0976('0x35')][_0x0976('0x36')]?_0x2456ca[_0x0976('0x35')]:_0x485b35[_0x0976('0x2f')];_0x2456ca[_0x0976('0x4d')]=qs[_0x0976('0x39')](_0x2d4618['query'][_0x0976('0x39')]);_0x2456ca['where']=qs[_0x0976('0x32')](_[_0x0976('0x3b')](_0x2d4618['query'],_0x485b35[_0x0976('0x32')]));if(_0x2d4618[_0x0976('0x30')][_0x0976('0x3c')]){_0x2456ca['where']=_[_0x0976('0x3d')](_0x2456ca['where'],{'$or':_[_0x0976('0x2b')](_0x2456ca[_0x0976('0x35')],function(_0xa376ae){var _0xb1ecab={};_0xb1ecab[_0xa376ae]={'$like':'%'+_0x2d4618[_0x0976('0x30')][_0x0976('0x3c')]+'%'};return _0xb1ecab;})});}_0x2456ca=_[_0x0976('0x3d')]({},_0x2456ca,_0x2d4618['options']);return _0x39ca86[_0x0976('0x51')](_0x2456ca);}})[_0x0976('0x41')](function(_0x347678){if(_0x347678){_0x1f320d=_0x347678['length'];if(!_0x2d4618['query']['hasOwnProperty'](_0x0976('0x38'))){_0x2456ca[_0x0976('0x1f')]=qs[_0x0976('0x1f')](_0x2d4618[_0x0976('0x30')][_0x0976('0x1f')]);_0x2456ca['offset']=qs[_0x0976('0x20')](_0x2d4618['query'][_0x0976('0x20')]);}return _0x39ca86['getTags'](_0x2456ca);}})[_0x0976('0x41')](function(_0x2edae5){if(_0x2edae5){return _0x2edae5?{'count':_0x1f320d,'rows':_0x2edae5}:null;}})[_0x0976('0x41')](respondWithResult(_0x36f4ca,null))[_0x0976('0x45')](handleError(_0x36f4ca,null));};exports[_0x0976('0x53')]=function(_0x288d1f,_0x40a39b,_0x3e833c){if(_0x288d1f['body']['id']){delete _0x288d1f['body']['id'];}return db[_0x0976('0x2c')][_0x0976('0x4c')]({'where':{'id':_0x288d1f[_0x0976('0x47')]['id']}})[_0x0976('0x41')](handleEntityNotFound(_0x40a39b,null))[_0x0976('0x41')](function(_0x59de64){if(_0x59de64){return _0x59de64['setTags'](_0x288d1f['body'][_0x0976('0x54')]||[]);}return null;})['then'](respondWithResult(_0x40a39b,null))[_0x0976('0x45')](handleError(_0x40a39b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index d7bc243..b029333 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 _0xdc43=['FreshdeskConfiguration','int_freshdesk_configurations','util','api','moment','bluebird','path','../../config/environment','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc43,0x6e));var _0x3dc4=function(_0x460a6a,_0x2fd3bb){_0x460a6a=_0x460a6a-0x0;var _0x5c7c20=_0xdc43[_0x460a6a];return _0x5c7c20;};'use strict';var _=require('lodash');var util=require(_0x3dc4('0x0'));var logger=require('../../config/logger')(_0x3dc4('0x1'));var moment=require(_0x3dc4('0x2'));var BPromise=require(_0x3dc4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dc4('0x4'));var rimraf=require('rimraf');var config=require(_0x3dc4('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x215bd,_0x3677cf){return _0x215bd[_0x3dc4('0x6')](_0x3dc4('0x7'),attributes,{'tableName':_0x3dc4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bb8=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x3bb8,0x86));var _0x83bb=function(_0x5264ed,_0x41b584){_0x5264ed=_0x5264ed-0x0;var _0x75037a=_0x3bb8[_0x5264ed];return _0x75037a;};'use strict';var _=require(_0x83bb('0x0'));var util=require(_0x83bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x83bb('0x2'));var BPromise=require(_0x83bb('0x3'));var rp=require(_0x83bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83bb('0x5'));var config=require(_0x83bb('0x6'));var attributes=require(_0x83bb('0x7'));module[_0x83bb('0x8')]=function(_0x1bd237,_0x5a8d21){return _0x1bd237[_0x83bb('0x9')](_0x83bb('0xa'),attributes,{'tableName':_0x83bb('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 7dbbd01..6c4bac3 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 _0x8b87=['code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x284998,_0x4c8733){var _0x1db6d6=function(_0x8718ac){while(--_0x8718ac){_0x284998['push'](_0x284998['shift']());}};_0x1db6d6(++_0x4c8733);}(_0x8b87,0x82));var _0x78b8=function(_0x3bf13a,_0x15e179){_0x3bf13a=_0x3bf13a-0x0;var _0x3ca978=_0x8b87[_0x3bf13a];return _0x3ca978;};'use strict';var _=require(_0x78b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x78b8('0x1'));var rs=require(_0x78b8('0x2'));var fs=require('fs');var Redis=require(_0x78b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x78b8('0x4'));var logger=require('../../config/logger')(_0x78b8('0x5'));var config=require('../../config/environment');var jayson=require(_0x78b8('0x6'));var client=jayson[_0x78b8('0x7')][_0x78b8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32f8e9,_0x38adc8,_0x252960){return new BPromise(function(_0x3dd02f,_0x4b2a9f){return client[_0x78b8('0x9')](_0x32f8e9,_0x252960)[_0x78b8('0xa')](function(_0xc0399c){logger[_0x78b8('0xb')](_0x78b8('0xc'),_0x38adc8,_0x78b8('0xd'));logger['debug'](_0x78b8('0xe'),_0x38adc8,'request\x20sent',JSON[_0x78b8('0xf')](_0xc0399c));if(_0xc0399c[_0x78b8('0x10')]){if(_0xc0399c[_0x78b8('0x10')][_0x78b8('0x11')]===0x1f4){logger[_0x78b8('0x10')](_0x78b8('0xc'),_0x38adc8,_0xc0399c[_0x78b8('0x10')][_0x78b8('0x12')]);return _0x4b2a9f(_0xc0399c[_0x78b8('0x10')][_0x78b8('0x12')]);}logger[_0x78b8('0x10')](_0x78b8('0xc'),_0x38adc8,_0xc0399c[_0x78b8('0x10')][_0x78b8('0x12')]);return _0x3dd02f(_0xc0399c[_0x78b8('0x10')][_0x78b8('0x12')]);}else{logger['info'](_0x78b8('0xc'),_0x38adc8,_0x78b8('0xd'));_0x3dd02f(_0xc0399c[_0x78b8('0x13')][_0x78b8('0x12')]);}})[_0x78b8('0x14')](function(_0x7f0fa1){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x38adc8,_0x7f0fa1);_0x4b2a9f(_0x7f0fa1);});});} \ No newline at end of file +var _0x8059=['client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3e6867,_0x4f1dae){var _0x18f040=function(_0x4e7cb2){while(--_0x4e7cb2){_0x3e6867['push'](_0x3e6867['shift']());}};_0x18f040(++_0x4f1dae);}(_0x8059,0x1d5));var _0x9805=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0x8059[_0x5067db];return _0x2771e4;};'use strict';var _=require(_0x9805('0x0'));var util=require(_0x9805('0x1'));var moment=require(_0x9805('0x2'));var BPromise=require(_0x9805('0x3'));var rs=require(_0x9805('0x4'));var fs=require('fs');var Redis=require(_0x9805('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9805('0x6'));var logger=require(_0x9805('0x7'))(_0x9805('0x8'));var config=require(_0x9805('0x9'));var jayson=require(_0x9805('0xa'));var client=jayson[_0x9805('0xb')][_0x9805('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f6cea,_0x4c2810,_0x197e79){return new BPromise(function(_0x5287c6,_0x3bee2d){return client[_0x9805('0xd')](_0x4f6cea,_0x197e79)['then'](function(_0x4ac43c){logger[_0x9805('0xe')](_0x9805('0xf'),_0x4c2810,'request\x20sent');logger[_0x9805('0x10')](_0x9805('0x11'),_0x4c2810,'request\x20sent',JSON['stringify'](_0x4ac43c));if(_0x4ac43c[_0x9805('0x12')]){if(_0x4ac43c['error'][_0x9805('0x13')]===0x1f4){logger[_0x9805('0x12')](_0x9805('0xf'),_0x4c2810,_0x4ac43c[_0x9805('0x12')][_0x9805('0x14')]);return _0x3bee2d(_0x4ac43c[_0x9805('0x12')][_0x9805('0x14')]);}logger[_0x9805('0x12')](_0x9805('0xf'),_0x4c2810,_0x4ac43c[_0x9805('0x12')]['message']);return _0x5287c6(_0x4ac43c[_0x9805('0x12')][_0x9805('0x14')]);}else{logger[_0x9805('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c2810,_0x9805('0x15'));_0x5287c6(_0x4ac43c[_0x9805('0x16')][_0x9805('0x14')]);}})[_0x9805('0x17')](function(_0x3acd41){logger[_0x9805('0x12')](_0x9805('0xf'),_0x4c2810,_0x3acd41);_0x3bee2d(_0x3acd41);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3b21ad5..6f88ae5 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 _0x832a=['put','/:id','update','destroy','exports','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','create'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x832a,0x155));var _0xa832=function(_0x3dc30d,_0x3eee3c){_0x3dc30d=_0x3dc30d-0x0;var _0x225236=_0x832a[_0x3dc30d];return _0x225236;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa832('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa832('0x1'));var auth=require(_0xa832('0x2'));var interaction=require(_0xa832('0x3'));var config=require(_0xa832('0x4'));var controller=require(_0xa832('0x5'));router[_0xa832('0x6')]('/',auth[_0xa832('0x7')](),controller[_0xa832('0x8')]);router['get']('/:id',auth[_0xa832('0x7')](),controller[_0xa832('0x9')]);router['post']('/',auth[_0xa832('0x7')](),controller[_0xa832('0xa')]);router[_0xa832('0xb')](_0xa832('0xc'),auth['isAuthenticated'](),controller[_0xa832('0xd')]);router['delete'](_0xa832('0xc'),auth['isAuthenticated'](),controller[_0xa832('0xe')]);module[_0xa832('0xf')]=router; \ No newline at end of file +var _0x66a3=['../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','put','update','delete','exports','connect-timeout','Router','fs-extra'];(function(_0x400566,_0x474083){var _0x40f3e8=function(_0x34c917){while(--_0x34c917){_0x400566['push'](_0x400566['shift']());}};_0x40f3e8(++_0x474083);}(_0x66a3,0xc1));var _0x366a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x366a('0x0'));var express=require('express');var router=express[_0x366a('0x1')]();var fs_extra=require(_0x366a('0x2'));var auth=require(_0x366a('0x3'));var interaction=require(_0x366a('0x4'));var config=require('../../config/environment');var controller=require(_0x366a('0x5'));router[_0x366a('0x6')]('/',auth['isAuthenticated'](),controller[_0x366a('0x7')]);router[_0x366a('0x6')](_0x366a('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x366a('0x9')](),controller['create']);router[_0x366a('0xa')](_0x366a('0x8'),auth[_0x366a('0x9')](),controller[_0x366a('0xb')]);router[_0x366a('0xc')](_0x366a('0x8'),auth[_0x366a('0x9')](),controller['destroy']);module[_0x366a('0xd')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index cb049dc..fe6747d 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 _0xa3b9=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x1bf80a,_0x38fc8f){var _0x2c30f1=function(_0x457565){while(--_0x457565){_0x1bf80a['push'](_0x1bf80a['shift']());}};_0x2c30f1(++_0x38fc8f);}(_0xa3b9,0x104));var _0x9a3b=function(_0x1fa957,_0x373149){_0x1fa957=_0x1fa957-0x0;var _0x14f017=_0xa3b9[_0x1fa957];return _0x14f017;};'use strict';var Sequelize=require(_0x9a3b('0x0'));module[_0x9a3b('0x1')]={'type':{'type':Sequelize[_0x9a3b('0x2')](_0x9a3b('0x3'),_0x9a3b('0x4'),'customVariable',_0x9a3b('0x5'),_0x9a3b('0x6')),'defaultValue':_0x9a3b('0x3')},'content':{'type':Sequelize[_0x9a3b('0x7')]},'key':{'type':Sequelize[_0x9a3b('0x7')]},'keyType':{'type':Sequelize[_0x9a3b('0x2')](_0x9a3b('0x3'),'variable',_0x9a3b('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9a3b('0x7')]},'nameField':{'type':Sequelize[_0x9a3b('0x7')]},'customField':{'type':Sequelize[_0x9a3b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x26ca=['exports','variable','customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x316cfd,_0x1dfe9d){var _0x50d52d=function(_0x3a1b0d){while(--_0x3a1b0d){_0x316cfd['push'](_0x316cfd['shift']());}};_0x50d52d(++_0x1dfe9d);}(_0x26ca,0x121));var _0xa26c=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x26ca[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require(_0xa26c('0x0'));module[_0xa26c('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xa26c('0x2'),_0xa26c('0x3'),_0xa26c('0x4'),_0xa26c('0x5')),'defaultValue':_0xa26c('0x6')},'content':{'type':Sequelize[_0xa26c('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa26c('0x8')](_0xa26c('0x6'),_0xa26c('0x2'),_0xa26c('0x3'))},'keyContent':{'type':Sequelize[_0xa26c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa26c('0x7')]},'customField':{'type':Sequelize[_0xa26c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa26c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ffeaf4c..1010260 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 _0x41bb=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','FreshdeskField','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x55a52f,_0xadcc0a){var _0x1883fd=function(_0x50ed3b){while(--_0x50ed3b){_0x55a52f['push'](_0x55a52f['shift']());}};_0x1883fd(++_0xadcc0a);}(_0x41bb,0xc5));var _0xb41b=function(_0x4c12a1,_0x47f494){_0x4c12a1=_0x4c12a1-0x0;var _0x4799b2=_0x41bb[_0x4c12a1];return _0x4799b2;};'use strict';var emlformat=require(_0xb41b('0x0'));var rimraf=require(_0xb41b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb41b('0x2'));var rp=require('request-promise');var moment=require(_0xb41b('0x3'));var BPromise=require(_0xb41b('0x4'));var Mustache=require(_0xb41b('0x5'));var util=require(_0xb41b('0x6'));var path=require('path');var sox=require(_0xb41b('0x7'));var csv=require(_0xb41b('0x8'));var ejs=require(_0xb41b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb41b('0xa'));var jsforce=require(_0xb41b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb41b('0x8'));var querystring=require(_0xb41b('0xc'));var Papa=require(_0xb41b('0xd'));var Redis=require(_0xb41b('0xe'));var authService=require(_0xb41b('0xf'));var qs=require(_0xb41b('0x10'));var as=require(_0xb41b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb41b('0x12'))('api');var utils=require(_0xb41b('0x13'));var config=require(_0xb41b('0x14'));var licenseUtil=require(_0xb41b('0x15'));var db=require(_0xb41b('0x16'))['db'];function respondWithStatusCode(_0x2066d5,_0x5f1ea4){_0x5f1ea4=_0x5f1ea4||0xcc;return function(_0x353ba3){if(_0x353ba3){return _0x2066d5[_0xb41b('0x17')](_0x5f1ea4);}return _0x2066d5[_0xb41b('0x18')](_0x5f1ea4)[_0xb41b('0x19')]();};}function respondWithResult(_0x3be1ec,_0x4e8603){_0x4e8603=_0x4e8603||0xc8;return function(_0x4e7f11){if(_0x4e7f11){return _0x3be1ec['status'](_0x4e8603)[_0xb41b('0x1a')](_0x4e7f11);}};}function respondWithFilteredResult(_0xdc5fb0,_0x143a81){return function(_0x338920){if(_0x338920){var _0x29ea51=typeof _0x143a81['offset']===_0xb41b('0x1b')&&typeof _0x143a81[_0xb41b('0x1c')]===_0xb41b('0x1b');var _0xcf0728=_0x338920[_0xb41b('0x1d')];var _0x47154d=_0x29ea51?0x0:_0x143a81[_0xb41b('0x1e')];var _0x5df8c2=_0x29ea51?_0x338920['count']:_0x143a81['offset']+_0x143a81[_0xb41b('0x1c')];var _0x503e86;if(_0x5df8c2>=_0xcf0728){_0x5df8c2=_0xcf0728;_0x503e86=0xc8;}else{_0x503e86=0xce;}_0xdc5fb0[_0xb41b('0x18')](_0x503e86);return _0xdc5fb0[_0xb41b('0x1f')](_0xb41b('0x20'),_0x47154d+'-'+_0x5df8c2+'/'+_0xcf0728)['json'](_0x338920);}return null;};}function patchUpdates(_0x53bc44){return function(_0x1a1386){try{jsonpatch[_0xb41b('0x21')](_0x1a1386,_0x53bc44,!![]);}catch(_0xd1bc61){return BPromise[_0xb41b('0x22')](_0xd1bc61);}return _0x1a1386[_0xb41b('0x23')]();};}function saveUpdates(_0x42dccb,_0x4c73da){return function(_0x58f149){if(_0x58f149){return _0x58f149[_0xb41b('0x24')](_0x42dccb)[_0xb41b('0x25')](function(_0x871b35){return _0x871b35;});}return null;};}function removeEntity(_0x583741,_0x14e9c8){return function(_0x2441d6){if(_0x2441d6){return _0x2441d6['destroy']()[_0xb41b('0x25')](function(){_0x583741[_0xb41b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed3c7e,_0x4a7992){return function(_0x2d0f27){if(!_0x2d0f27){_0xed3c7e[_0xb41b('0x17')](0x194);}return _0x2d0f27;};}function handleError(_0x53e3a2,_0x3af2c){_0x3af2c=_0x3af2c||0x1f4;return function(_0x4265b8){logger['error'](_0x4265b8['stack']);if(_0x4265b8[_0xb41b('0x26')]){delete _0x4265b8[_0xb41b('0x26')];}_0x53e3a2[_0xb41b('0x18')](_0x3af2c)[_0xb41b('0x27')](_0x4265b8);};}exports[_0xb41b('0x28')]=function(_0x181cbd,_0x253efb){var _0x545395={},_0x26ef96={},_0xb68029={'count':0x0,'rows':[]};var _0x5069aa=_[_0xb41b('0x29')](db['FreshdeskField'][_0xb41b('0x2a')],function(_0x31d4cd){return{'name':_0x31d4cd['fieldName'],'type':_0x31d4cd[_0xb41b('0x2b')]['key']};});_0x26ef96[_0xb41b('0x2c')]=_[_0xb41b('0x29')](_0x5069aa,'name');_0x26ef96[_0xb41b('0x2d')]=_[_0xb41b('0x2e')](_0x181cbd[_0xb41b('0x2d')]);_0x26ef96[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],_0x26ef96[_0xb41b('0x2d')]);_0x545395[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],qs['fields'](_0x181cbd[_0xb41b('0x2d')]['fields']));_0x545395['attributes']=_0x545395[_0xb41b('0x31')][_0xb41b('0x32')]?_0x545395[_0xb41b('0x31')]:_0x26ef96[_0xb41b('0x2c')];if(!_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x33')](_0xb41b('0x34'))){_0x545395[_0xb41b('0x1c')]=qs[_0xb41b('0x1c')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1c')]);_0x545395['offset']=qs[_0xb41b('0x1e')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1e')]);}_0x545395[_0xb41b('0x35')]=qs[_0xb41b('0x36')](_0x181cbd[_0xb41b('0x2d')]['sort']);_0x545395['where']=qs[_0xb41b('0x2f')](_[_0xb41b('0x37')](_0x181cbd['query'],_0x26ef96[_0xb41b('0x2f')]),_0x5069aa);if(_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]){_0x545395[_0xb41b('0x39')]=_[_0xb41b('0x3a')](_0x545395['where'],{'$or':_[_0xb41b('0x29')](_0x5069aa,function(_0x5775d3){if(_0x5775d3[_0xb41b('0x2b')]!==_0xb41b('0x3b')){var _0x799d6={};_0x799d6[_0x5775d3[_0xb41b('0x26')]]={'$like':'%'+_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]+'%'};return _0x799d6;}})});}_0x545395=_[_0xb41b('0x3a')]({},_0x545395,_0x181cbd[_0xb41b('0x3c')]);var _0x2b0721={'where':_0x545395['where']};return db['FreshdeskField']['count'](_0x2b0721)[_0xb41b('0x25')](function(_0x5147ce){_0xb68029['count']=_0x5147ce;if(_0x181cbd[_0xb41b('0x2d')]['includeAll']){_0x545395[_0xb41b('0x3d')]=[{'all':!![]}];}return db[_0xb41b('0x3e')][_0xb41b('0x3f')](_0x545395);})[_0xb41b('0x25')](function(_0x4fa390){_0xb68029[_0xb41b('0x40')]=_0x4fa390;return _0xb68029;})[_0xb41b('0x25')](respondWithFilteredResult(_0x253efb,_0x545395))['catch'](handleError(_0x253efb,null));};exports[_0xb41b('0x41')]=function(_0xa70324,_0x3f181c){var _0x174d6c={'raw':!![],'where':{'id':_0xa70324[_0xb41b('0x42')]['id']}},_0x47bab5={};_0x47bab5['model']=_[_0xb41b('0x2e')](db[_0xb41b('0x3e')][_0xb41b('0x2a')]);_0x47bab5['query']=_['keys'](_0xa70324[_0xb41b('0x2d')]);_0x47bab5[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x47bab5[_0xb41b('0x2c')],_0x47bab5[_0xb41b('0x2d')]);_0x174d6c[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x47bab5['model'],qs['fields'](_0xa70324[_0xb41b('0x2d')]['fields']));_0x174d6c[_0xb41b('0x31')]=_0x174d6c['attributes'][_0xb41b('0x32')]?_0x174d6c['attributes']:_0x47bab5[_0xb41b('0x2c')];if(_0xa70324['query'][_0xb41b('0x43')]){_0x174d6c[_0xb41b('0x3d')]=[{'all':!![]}];}_0x174d6c=_[_0xb41b('0x3a')]({},_0x174d6c,_0xa70324[_0xb41b('0x3c')]);return db['FreshdeskField'][_0xb41b('0x44')](_0x174d6c)[_0xb41b('0x25')](handleEntityNotFound(_0x3f181c,null))['then'](respondWithResult(_0x3f181c,null))[_0xb41b('0x45')](handleError(_0x3f181c,null));};exports['create']=function(_0x5cc658,_0x5733d0){return db['FreshdeskField'][_0xb41b('0x46')](_0x5cc658[_0xb41b('0x47')],{})[_0xb41b('0x25')](respondWithResult(_0x5733d0,0xc9))[_0xb41b('0x45')](handleError(_0x5733d0,null));};exports[_0xb41b('0x24')]=function(_0x349a6c,_0x34d076){if(_0x349a6c[_0xb41b('0x47')]['id']){delete _0x349a6c[_0xb41b('0x47')]['id'];}return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x349a6c[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x34d076,null))[_0xb41b('0x25')](saveUpdates(_0x349a6c[_0xb41b('0x47')],null))[_0xb41b('0x25')](respondWithResult(_0x34d076,null))['catch'](handleError(_0x34d076,null));};exports[_0xb41b('0x48')]=function(_0x5e041d,_0x4a7aa3){return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x5e041d[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x4a7aa3,null))[_0xb41b('0x25')](removeEntity(_0x4a7aa3,null))[_0xb41b('0x45')](handleError(_0x4a7aa3,null));}; \ No newline at end of file +var _0xbf6e=['rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','FreshdeskField','includeAll','include','rows','catch','show','keys','intersection','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x997332,_0x3eeac6){var _0x44610d=function(_0x29b55d){while(--_0x29b55d){_0x997332['push'](_0x997332['shift']());}};_0x44610d(++_0x3eeac6);}(_0xbf6e,0x149));var _0xebf6=function(_0x2a0bb0,_0x1fa696){_0x2a0bb0=_0x2a0bb0-0x0;var _0x5552c9=_0xbf6e[_0x2a0bb0];return _0x5552c9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebf6('0x0'));var jsonpatch=require(_0xebf6('0x1'));var rp=require(_0xebf6('0x2'));var moment=require(_0xebf6('0x3'));var BPromise=require(_0xebf6('0x4'));var Mustache=require(_0xebf6('0x5'));var util=require(_0xebf6('0x6'));var path=require('path');var sox=require(_0xebf6('0x7'));var csv=require(_0xebf6('0x8'));var ejs=require(_0xebf6('0x9'));var fs=require('fs');var fs_extra=require(_0xebf6('0xa'));var _=require(_0xebf6('0xb'));var squel=require(_0xebf6('0xc'));var crypto=require(_0xebf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xebf6('0xe'));var toCsv=require(_0xebf6('0x8'));var querystring=require(_0xebf6('0xf'));var Papa=require('papaparse');var Redis=require(_0xebf6('0x10'));var authService=require(_0xebf6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebf6('0x12'));var hardwareService=require(_0xebf6('0x13'));var logger=require(_0xebf6('0x14'))(_0xebf6('0x15'));var utils=require(_0xebf6('0x16'));var config=require(_0xebf6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xebf6('0x18'))['db'];function respondWithStatusCode(_0xedc361,_0x4919f1){_0x4919f1=_0x4919f1||0xcc;return function(_0x332ca0){if(_0x332ca0){return _0xedc361[_0xebf6('0x19')](_0x4919f1);}return _0xedc361[_0xebf6('0x1a')](_0x4919f1)[_0xebf6('0x1b')]();};}function respondWithResult(_0x3f69e6,_0x4dbf51){_0x4dbf51=_0x4dbf51||0xc8;return function(_0x4c01f4){if(_0x4c01f4){return _0x3f69e6['status'](_0x4dbf51)[_0xebf6('0x1c')](_0x4c01f4);}};}function respondWithFilteredResult(_0x1ae2f7,_0x50d80f){return function(_0x35570e){if(_0x35570e){var _0x2c980f=typeof _0x50d80f[_0xebf6('0x1d')]===_0xebf6('0x1e')&&typeof _0x50d80f[_0xebf6('0x1f')]===_0xebf6('0x1e');var _0x219621=_0x35570e[_0xebf6('0x20')];var _0x2d3984=_0x2c980f?0x0:_0x50d80f[_0xebf6('0x1d')];var _0x55fa31=_0x2c980f?_0x35570e['count']:_0x50d80f[_0xebf6('0x1d')]+_0x50d80f[_0xebf6('0x1f')];var _0x10051e;if(_0x55fa31>=_0x219621){_0x55fa31=_0x219621;_0x10051e=0xc8;}else{_0x10051e=0xce;}_0x1ae2f7[_0xebf6('0x1a')](_0x10051e);return _0x1ae2f7[_0xebf6('0x21')](_0xebf6('0x22'),_0x2d3984+'-'+_0x55fa31+'/'+_0x219621)[_0xebf6('0x1c')](_0x35570e);}return null;};}function patchUpdates(_0x80f523){return function(_0x4fb497){try{jsonpatch[_0xebf6('0x23')](_0x4fb497,_0x80f523,!![]);}catch(_0x81fdb3){return BPromise[_0xebf6('0x24')](_0x81fdb3);}return _0x4fb497[_0xebf6('0x25')]();};}function saveUpdates(_0x6303ac,_0x14c8ac){return function(_0x2f419e){if(_0x2f419e){return _0x2f419e[_0xebf6('0x26')](_0x6303ac)[_0xebf6('0x27')](function(_0x2e32c6){return _0x2e32c6;});}return null;};}function removeEntity(_0x232074,_0x2dd2ed){return function(_0x43c4e2){if(_0x43c4e2){return _0x43c4e2[_0xebf6('0x28')]()[_0xebf6('0x27')](function(){_0x232074[_0xebf6('0x1a')](0xcc)[_0xebf6('0x1b')]();});}};}function handleEntityNotFound(_0x1534b2,_0x3b58cb){return function(_0x4dadf7){if(!_0x4dadf7){_0x1534b2['sendStatus'](0x194);}return _0x4dadf7;};}function handleError(_0x2605a2,_0x4dc5be){_0x4dc5be=_0x4dc5be||0x1f4;return function(_0x230d84){logger[_0xebf6('0x29')](_0x230d84['stack']);if(_0x230d84['name']){delete _0x230d84[_0xebf6('0x2a')];}_0x2605a2[_0xebf6('0x1a')](_0x4dc5be)[_0xebf6('0x2b')](_0x230d84);};}exports[_0xebf6('0x2c')]=function(_0xedaaeb,_0x2dc0cf){var _0x7976d={},_0x7551ce={},_0x4c3495={'count':0x0,'rows':[]};var _0x37cd67=_[_0xebf6('0x2d')](db['FreshdeskField'][_0xebf6('0x2e')],function(_0x28bbea){return{'name':_0x28bbea['fieldName'],'type':_0x28bbea[_0xebf6('0x2f')][_0xebf6('0x30')]};});_0x7551ce[_0xebf6('0x31')]=_[_0xebf6('0x2d')](_0x37cd67,_0xebf6('0x2a'));_0x7551ce[_0xebf6('0x32')]=_['keys'](_0xedaaeb[_0xebf6('0x32')]);_0x7551ce[_0xebf6('0x33')]=_['intersection'](_0x7551ce['model'],_0x7551ce[_0xebf6('0x32')]);_0x7976d[_0xebf6('0x34')]=_['intersection'](_0x7551ce[_0xebf6('0x31')],qs[_0xebf6('0x35')](_0xedaaeb['query'][_0xebf6('0x35')]));_0x7976d[_0xebf6('0x34')]=_0x7976d[_0xebf6('0x34')]['length']?_0x7976d[_0xebf6('0x34')]:_0x7551ce[_0xebf6('0x31')];if(!_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x36')]('nolimit')){_0x7976d['limit']=qs[_0xebf6('0x1f')](_0xedaaeb[_0xebf6('0x32')]['limit']);_0x7976d[_0xebf6('0x1d')]=qs[_0xebf6('0x1d')](_0xedaaeb['query'][_0xebf6('0x1d')]);}_0x7976d[_0xebf6('0x37')]=qs[_0xebf6('0x38')](_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x38')]);_0x7976d['where']=qs[_0xebf6('0x33')](_['pick'](_0xedaaeb[_0xebf6('0x32')],_0x7551ce['filters']),_0x37cd67);if(_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x39')]){_0x7976d[_0xebf6('0x3a')]=_[_0xebf6('0x3b')](_0x7976d[_0xebf6('0x3a')],{'$or':_[_0xebf6('0x2d')](_0x37cd67,function(_0x5eb1ea){if(_0x5eb1ea[_0xebf6('0x2f')]!==_0xebf6('0x3c')){var _0x3cd9a0={};_0x3cd9a0[_0x5eb1ea[_0xebf6('0x2a')]]={'$like':'%'+_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x39')]+'%'};return _0x3cd9a0;}})});}_0x7976d=_['merge']({},_0x7976d,_0xedaaeb[_0xebf6('0x3d')]);var _0x2782a5={'where':_0x7976d[_0xebf6('0x3a')]};return db[_0xebf6('0x3e')][_0xebf6('0x20')](_0x2782a5)[_0xebf6('0x27')](function(_0x4887a8){_0x4c3495['count']=_0x4887a8;if(_0xedaaeb['query'][_0xebf6('0x3f')]){_0x7976d[_0xebf6('0x40')]=[{'all':!![]}];}return db[_0xebf6('0x3e')]['findAll'](_0x7976d);})[_0xebf6('0x27')](function(_0x1c3809){_0x4c3495[_0xebf6('0x41')]=_0x1c3809;return _0x4c3495;})['then'](respondWithFilteredResult(_0x2dc0cf,_0x7976d))[_0xebf6('0x42')](handleError(_0x2dc0cf,null));};exports[_0xebf6('0x43')]=function(_0x53ccc8,_0x3813a5){var _0x1de50e={'raw':!![],'where':{'id':_0x53ccc8['params']['id']}},_0x17c4af={};_0x17c4af[_0xebf6('0x31')]=_['keys'](db['FreshdeskField'][_0xebf6('0x2e')]);_0x17c4af[_0xebf6('0x32')]=_[_0xebf6('0x44')](_0x53ccc8[_0xebf6('0x32')]);_0x17c4af['filters']=_[_0xebf6('0x45')](_0x17c4af['model'],_0x17c4af[_0xebf6('0x32')]);_0x1de50e[_0xebf6('0x34')]=_[_0xebf6('0x45')](_0x17c4af[_0xebf6('0x31')],qs[_0xebf6('0x35')](_0x53ccc8['query']['fields']));_0x1de50e[_0xebf6('0x34')]=_0x1de50e[_0xebf6('0x34')][_0xebf6('0x46')]?_0x1de50e[_0xebf6('0x34')]:_0x17c4af['model'];if(_0x53ccc8[_0xebf6('0x32')][_0xebf6('0x3f')]){_0x1de50e[_0xebf6('0x40')]=[{'all':!![]}];}_0x1de50e=_[_0xebf6('0x3b')]({},_0x1de50e,_0x53ccc8[_0xebf6('0x3d')]);return db[_0xebf6('0x3e')][_0xebf6('0x47')](_0x1de50e)['then'](handleEntityNotFound(_0x3813a5,null))[_0xebf6('0x27')](respondWithResult(_0x3813a5,null))[_0xebf6('0x42')](handleError(_0x3813a5,null));};exports[_0xebf6('0x48')]=function(_0x42e3e1,_0x166664){return db[_0xebf6('0x3e')][_0xebf6('0x48')](_0x42e3e1['body'],{})[_0xebf6('0x27')](respondWithResult(_0x166664,0xc9))['catch'](handleError(_0x166664,null));};exports[_0xebf6('0x26')]=function(_0x31d8ba,_0x5d84ac){if(_0x31d8ba[_0xebf6('0x49')]['id']){delete _0x31d8ba['body']['id'];}return db[_0xebf6('0x3e')][_0xebf6('0x47')]({'where':{'id':_0x31d8ba[_0xebf6('0x4a')]['id']}})[_0xebf6('0x27')](handleEntityNotFound(_0x5d84ac,null))[_0xebf6('0x27')](saveUpdates(_0x31d8ba['body'],null))[_0xebf6('0x27')](respondWithResult(_0x5d84ac,null))[_0xebf6('0x42')](handleError(_0x5d84ac,null));};exports['destroy']=function(_0x1f98fd,_0x2765f2){return db[_0xebf6('0x3e')][_0xebf6('0x47')]({'where':{'id':_0x1f98fd[_0xebf6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2765f2,null))[_0xebf6('0x27')](removeEntity(_0x2765f2,null))[_0xebf6('0x42')](handleError(_0x2765f2,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 2df299e..04e1c7d 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 _0x6782=['../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x6782,0x1f1));var _0x2678=function(_0x4dba61,_0x4d691d){_0x4dba61=_0x4dba61-0x0;var _0x2dfd7e=_0x6782[_0x4dba61];return _0x2dfd7e;};'use strict';var _=require(_0x2678('0x0'));var util=require(_0x2678('0x1'));var logger=require(_0x2678('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2678('0x3'));var rp=require(_0x2678('0x4'));var fs=require('fs');var path=require(_0x2678('0x5'));var rimraf=require(_0x2678('0x6'));var config=require(_0x2678('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x2678('0x8')]=function(_0xcdec8c,_0x479b1b){return _0xcdec8c[_0x2678('0x9')](_0x2678('0xa'),attributes,{'tableName':_0x2678('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x2678('0xc'),_0x2678('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d48=['exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','util','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x442e13,_0xdc1165){var _0x342158=function(_0x90ffa){while(--_0x90ffa){_0x442e13['push'](_0x442e13['shift']());}};_0x342158(++_0xdc1165);}(_0x8d48,0x18b));var _0x88d4=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x8d48[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require(_0x88d4('0x0'));var logger=require('../../config/logger')(_0x88d4('0x1'));var moment=require(_0x88d4('0x2'));var BPromise=require('bluebird');var rp=require(_0x88d4('0x3'));var fs=require('fs');var path=require(_0x88d4('0x4'));var rimraf=require(_0x88d4('0x5'));var config=require(_0x88d4('0x6'));var attributes=require(_0x88d4('0x7'));module[_0x88d4('0x8')]=function(_0x23cb77,_0x3b4531){return _0x23cb77['define'](_0x88d4('0x9'),attributes,{'tableName':_0x88d4('0xa'),'paranoid':![],'indexes':[{'name':_0x88d4('0xb'),'fields':['idField',_0x88d4('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index e083cfa..3d24d2a 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 _0xb81e=['../../config/logger','rpc','../../config/environment','client','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb81e,0x94));var _0xeb81=function(_0x3adde9,_0x49c6ab){_0x3adde9=_0x3adde9-0x0;var _0xf3b614=_0xb81e[_0x3adde9];return _0xf3b614;};'use strict';var _=require(_0xeb81('0x0'));var util=require(_0xeb81('0x1'));var moment=require(_0xeb81('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb81('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeb81('0x4'))(_0xeb81('0x5'));var config=require(_0xeb81('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeb81('0x7')][_0xeb81('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9eb48c,_0x487368,_0x4df85c){return new BPromise(function(_0x23e61d,_0x448d4c){return client['request'](_0x9eb48c,_0x4df85c)['then'](function(_0x5b569f){logger[_0xeb81('0x9')](_0xeb81('0xa'),_0x487368,_0xeb81('0xb'));logger[_0xeb81('0xc')](_0xeb81('0xd'),_0x487368,_0xeb81('0xb'),JSON['stringify'](_0x5b569f));if(_0x5b569f[_0xeb81('0xe')]){if(_0x5b569f[_0xeb81('0xe')][_0xeb81('0xf')]===0x1f4){logger[_0xeb81('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x487368,_0x5b569f[_0xeb81('0xe')][_0xeb81('0x10')]);return _0x448d4c(_0x5b569f[_0xeb81('0xe')][_0xeb81('0x10')]);}logger[_0xeb81('0xe')](_0xeb81('0xa'),_0x487368,_0x5b569f['error'][_0xeb81('0x10')]);return _0x23e61d(_0x5b569f[_0xeb81('0xe')][_0xeb81('0x10')]);}else{logger[_0xeb81('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x487368,_0xeb81('0xb'));_0x23e61d(_0x5b569f[_0xeb81('0x11')]['message']);}})[_0xeb81('0x12')](function(_0xa95ac4){logger[_0xeb81('0xe')](_0xeb81('0xa'),_0x487368,_0xa95ac4);_0x448d4c(_0xa95ac4);});});} \ No newline at end of file +var _0x5ef8=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','FreshdeskField,\x20%s,\x20%s','catch','util','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ef8,0x11b));var _0x85ef=function(_0x4a3acd,_0x4bf641){_0x4a3acd=_0x4a3acd-0x0;var _0x3efdaa=_0x5ef8[_0x4a3acd];return _0x3efdaa;};'use strict';var _=require('lodash');var util=require(_0x85ef('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x85ef('0x1'));var fs=require('fs');var Redis=require(_0x85ef('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x85ef('0x3'));var logger=require(_0x85ef('0x4'))(_0x85ef('0x5'));var config=require('../../config/environment');var jayson=require(_0x85ef('0x6'));var client=jayson[_0x85ef('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279fdb,_0x4178ba,_0x550f1d){return new BPromise(function(_0x498065,_0x44d918){return client[_0x85ef('0x8')](_0x279fdb,_0x550f1d)[_0x85ef('0x9')](function(_0x38926c){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x4178ba,_0x85ef('0xa'));logger[_0x85ef('0xb')](_0x85ef('0xc'),_0x4178ba,_0x85ef('0xa'),JSON[_0x85ef('0xd')](_0x38926c));if(_0x38926c[_0x85ef('0xe')]){if(_0x38926c[_0x85ef('0xe')]['code']===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x4178ba,_0x38926c['error']['message']);return _0x44d918(_0x38926c[_0x85ef('0xe')][_0x85ef('0xf')]);}logger[_0x85ef('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x4178ba,_0x38926c[_0x85ef('0xe')][_0x85ef('0xf')]);return _0x498065(_0x38926c['error']['message']);}else{logger[_0x85ef('0x10')](_0x85ef('0x11'),_0x4178ba,_0x85ef('0xa'));_0x498065(_0x38926c['result']['message']);}})[_0x85ef('0x12')](function(_0x217212){logger[_0x85ef('0xe')](_0x85ef('0x11'),_0x4178ba,_0x217212);_0x44d918(_0x217212);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0e22803..575c045 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 _0xb9be=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x136cb4,_0x22a5e3){var _0x4190bb=function(_0x315d20){while(--_0x315d20){_0x136cb4['push'](_0x136cb4['shift']());}};_0x4190bb(++_0x22a5e3);}(_0xb9be,0xc5));var _0xeb9b=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xb9be[_0x237546];return _0x233e29;};'use strict';var multer=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var path=require(_0xeb9b('0x2'));var timeout=require(_0xeb9b('0x3'));var express=require(_0xeb9b('0x4'));var router=express[_0xeb9b('0x5')]();var fs_extra=require(_0xeb9b('0x6'));var auth=require(_0xeb9b('0x7'));var interaction=require(_0xeb9b('0x8'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xeb9b('0x9')]('/',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xb')]);router['get'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xd')]);router[_0xeb9b('0x9')](_0xeb9b('0xe'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xf')]);router[_0xeb9b('0x9')](_0xeb9b('0x10'),auth['isAuthenticated'](),controller[_0xeb9b('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeb9b('0x12')]);router[_0xeb9b('0x13')]('/:id/configurations',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0x14')]);router[_0xeb9b('0x15')](_0xeb9b('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0bb5=['./intFreshsalesAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3292d9,_0x3577b6){var _0x2428e6=function(_0x333a01){while(--_0x333a01){_0x3292d9['push'](_0x3292d9['shift']());}};_0x2428e6(++_0x3577b6);}(_0x0bb5,0x148));var _0x50bb=function(_0x4fa8ab,_0x1604ca){_0x4fa8ab=_0x4fa8ab-0x0;var _0x3531a2=_0x0bb5[_0x4fa8ab];return _0x3531a2;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/configurations',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x10')]('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x10')](_0x50bb('0x12'),auth[_0x50bb('0xb')](),controller['addConfiguration']);router[_0x50bb('0x13')]('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);module[_0x50bb('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 6e6340a..0011231 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 _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x38a9e6,_0x138951){var _0x4abe60=function(_0x42fcbb){while(--_0x42fcbb){_0x38a9e6['push'](_0x38a9e6['shift']());}};_0x4abe60(++_0x138951);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x50c943,_0x154bbd){_0x50c943=_0x50c943-0x0;var _0x4dd1a1=_0x4e2e[_0x50c943];return _0x4dd1a1;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8e3f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x3704b2,_0x9b13ee){var _0x2a3ca2=function(_0x35a82d){while(--_0x35a82d){_0x3704b2['push'](_0x3704b2['shift']());}};_0x2a3ca2(++_0x9b13ee);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8e3('0x2')],'unique':_0xf8e3('0x3')},'apiKey':{'type':Sequelize[_0xf8e3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf8e3('0x4')},'serverUrl':{'type':Sequelize[_0xf8e3('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 788a47d..00cf634 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 _0xfa74=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','apply','reject','update','then','destroy','end','error','name','send','index','FreshsalesAccount','rawAttributes','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0xfa74,0xf7));var _0x4fa7=function(_0x294e75,_0x58a48e){_0x294e75=_0x294e75-0x0;var _0x3da666=_0xfa74[_0x294e75];return _0x3da666;};'use strict';var emlformat=require(_0x4fa7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4fa7('0x1'));var rp=require('request-promise');var moment=require(_0x4fa7('0x2'));var BPromise=require(_0x4fa7('0x3'));var Mustache=require(_0x4fa7('0x4'));var util=require(_0x4fa7('0x5'));var path=require('path');var sox=require(_0x4fa7('0x6'));var csv=require(_0x4fa7('0x7'));var ejs=require(_0x4fa7('0x8'));var fs=require('fs');var fs_extra=require(_0x4fa7('0x9'));var _=require(_0x4fa7('0xa'));var squel=require(_0x4fa7('0xb'));var crypto=require(_0x4fa7('0xc'));var jsforce=require(_0x4fa7('0xd'));var deskjs=require(_0x4fa7('0xe'));var toCsv=require(_0x4fa7('0x7'));var querystring=require(_0x4fa7('0xf'));var Papa=require('papaparse');var Redis=require(_0x4fa7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4fa7('0x11'));var as=require(_0x4fa7('0x12'));var hardwareService=require(_0x4fa7('0x13'));var logger=require(_0x4fa7('0x14'))(_0x4fa7('0x15'));var utils=require(_0x4fa7('0x16'));var config=require(_0x4fa7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4fa7('0x18'))['db'];var integrations=require(_0x4fa7('0x19'));function respondWithStatusCode(_0x398735,_0x314af4){_0x314af4=_0x314af4||0xcc;return function(_0x32f7d5){if(_0x32f7d5){return _0x398735[_0x4fa7('0x1a')](_0x314af4);}return _0x398735[_0x4fa7('0x1b')](_0x314af4)['end']();};}function respondWithResult(_0x3f17ae,_0x124379){_0x124379=_0x124379||0xc8;return function(_0x145454){if(_0x145454){return _0x3f17ae[_0x4fa7('0x1b')](_0x124379)[_0x4fa7('0x1c')](_0x145454);}};}function respondWithFilteredResult(_0x438595,_0x4333b7){return function(_0x358ddf){if(_0x358ddf){var _0x242b95=typeof _0x4333b7[_0x4fa7('0x1d')]===_0x4fa7('0x1e')&&typeof _0x4333b7['limit']===_0x4fa7('0x1e');var _0x2bf462=_0x358ddf[_0x4fa7('0x1f')];var _0x58e6a8=_0x242b95?0x0:_0x4333b7['offset'];var _0x16e927=_0x242b95?_0x358ddf[_0x4fa7('0x1f')]:_0x4333b7[_0x4fa7('0x1d')]+_0x4333b7[_0x4fa7('0x20')];var _0x188342;if(_0x16e927>=_0x2bf462){_0x16e927=_0x2bf462;_0x188342=0xc8;}else{_0x188342=0xce;}_0x438595['status'](_0x188342);return _0x438595['set']('Content-Range',_0x58e6a8+'-'+_0x16e927+'/'+_0x2bf462)[_0x4fa7('0x1c')](_0x358ddf);}return null;};}function patchUpdates(_0x2291a1){return function(_0x230486){try{jsonpatch[_0x4fa7('0x21')](_0x230486,_0x2291a1,!![]);}catch(_0x4c7c59){return BPromise[_0x4fa7('0x22')](_0x4c7c59);}return _0x230486['save']();};}function saveUpdates(_0x3c9a9a,_0x53ade6){return function(_0xc076e2){if(_0xc076e2){return _0xc076e2[_0x4fa7('0x23')](_0x3c9a9a)[_0x4fa7('0x24')](function(_0x1c7a25){return _0x1c7a25;});}return null;};}function removeEntity(_0x5fe9b4,_0x39269b){return function(_0x1f99af){if(_0x1f99af){return _0x1f99af[_0x4fa7('0x25')]()[_0x4fa7('0x24')](function(){_0x5fe9b4[_0x4fa7('0x1b')](0xcc)[_0x4fa7('0x26')]();});}};}function handleEntityNotFound(_0x33f382,_0x179340){return function(_0x426d94){if(!_0x426d94){_0x33f382[_0x4fa7('0x1a')](0x194);}return _0x426d94;};}function handleError(_0x516a30,_0x1c0145){_0x1c0145=_0x1c0145||0x1f4;return function(_0x2e6db9){logger[_0x4fa7('0x27')](_0x2e6db9['stack']);if(_0x2e6db9[_0x4fa7('0x28')]){delete _0x2e6db9[_0x4fa7('0x28')];}_0x516a30[_0x4fa7('0x1b')](_0x1c0145)[_0x4fa7('0x29')](_0x2e6db9);};}exports[_0x4fa7('0x2a')]=function(_0xb4b93f,_0x30e436){var _0xd30640={},_0x12c8e9={},_0x5d4186={'count':0x0,'rows':[]};var _0x3b7e7e=_['map'](db[_0x4fa7('0x2b')][_0x4fa7('0x2c')],function(_0xc3ef27){return{'name':_0xc3ef27['fieldName'],'type':_0xc3ef27[_0x4fa7('0x2d')][_0x4fa7('0x2e')]};});_0x12c8e9['model']=_[_0x4fa7('0x2f')](_0x3b7e7e,'name');_0x12c8e9['query']=_[_0x4fa7('0x30')](_0xb4b93f[_0x4fa7('0x31')]);_0x12c8e9[_0x4fa7('0x32')]=_[_0x4fa7('0x33')](_0x12c8e9[_0x4fa7('0x34')],_0x12c8e9[_0x4fa7('0x31')]);_0xd30640[_0x4fa7('0x35')]=_[_0x4fa7('0x33')](_0x12c8e9[_0x4fa7('0x34')],qs[_0x4fa7('0x36')](_0xb4b93f['query'][_0x4fa7('0x36')]));_0xd30640['attributes']=_0xd30640[_0x4fa7('0x35')][_0x4fa7('0x37')]?_0xd30640['attributes']:_0x12c8e9[_0x4fa7('0x34')];if(!_0xb4b93f[_0x4fa7('0x31')]['hasOwnProperty'](_0x4fa7('0x38'))){_0xd30640['limit']=qs[_0x4fa7('0x20')](_0xb4b93f[_0x4fa7('0x31')][_0x4fa7('0x20')]);_0xd30640['offset']=qs['offset'](_0xb4b93f[_0x4fa7('0x31')][_0x4fa7('0x1d')]);}_0xd30640['order']=qs['sort'](_0xb4b93f['query'][_0x4fa7('0x39')]);_0xd30640[_0x4fa7('0x3a')]=qs[_0x4fa7('0x32')](_[_0x4fa7('0x3b')](_0xb4b93f['query'],_0x12c8e9[_0x4fa7('0x32')]),_0x3b7e7e);if(_0xb4b93f['query'][_0x4fa7('0x3c')]){_0xd30640[_0x4fa7('0x3a')]=_[_0x4fa7('0x3d')](_0xd30640[_0x4fa7('0x3a')],{'$or':_[_0x4fa7('0x2f')](_0x3b7e7e,function(_0x586556){if(_0x586556[_0x4fa7('0x2d')]!==_0x4fa7('0x3e')){var _0x35e7f4={};_0x35e7f4[_0x586556[_0x4fa7('0x28')]]={'$like':'%'+_0xb4b93f['query'][_0x4fa7('0x3c')]+'%'};return _0x35e7f4;}})});}_0xd30640=_[_0x4fa7('0x3d')]({},_0xd30640,_0xb4b93f[_0x4fa7('0x3f')]);var _0x5821b1={'where':_0xd30640[_0x4fa7('0x3a')]};return db[_0x4fa7('0x2b')][_0x4fa7('0x1f')](_0x5821b1)['then'](function(_0x275746){_0x5d4186[_0x4fa7('0x1f')]=_0x275746;if(_0xb4b93f[_0x4fa7('0x31')][_0x4fa7('0x40')]){_0xd30640[_0x4fa7('0x41')]=[{'all':!![]}];}return db[_0x4fa7('0x2b')][_0x4fa7('0x42')](_0xd30640);})[_0x4fa7('0x24')](function(_0x299830){_0x5d4186[_0x4fa7('0x43')]=_0x299830;return _0x5d4186;})['then'](respondWithFilteredResult(_0x30e436,_0xd30640))['catch'](handleError(_0x30e436,null));};exports[_0x4fa7('0x44')]=function(_0x37d330,_0x42c910){var _0x2aafe0={'raw':![],'where':{'id':_0x37d330[_0x4fa7('0x45')]['id']}},_0x4fc637={};_0x4fc637[_0x4fa7('0x34')]=_[_0x4fa7('0x30')](db[_0x4fa7('0x2b')]['rawAttributes']);_0x4fc637[_0x4fa7('0x31')]=_[_0x4fa7('0x30')](_0x37d330[_0x4fa7('0x31')]);_0x4fc637[_0x4fa7('0x32')]=_[_0x4fa7('0x33')](_0x4fc637['model'],_0x4fc637['query']);_0x2aafe0[_0x4fa7('0x35')]=_[_0x4fa7('0x33')](_0x4fc637['model'],qs[_0x4fa7('0x36')](_0x37d330[_0x4fa7('0x31')]['fields']));_0x2aafe0[_0x4fa7('0x35')]=_0x2aafe0[_0x4fa7('0x35')]['length']?_0x2aafe0[_0x4fa7('0x35')]:_0x4fc637['model'];if(_0x37d330[_0x4fa7('0x31')][_0x4fa7('0x40')]){_0x2aafe0[_0x4fa7('0x41')]=[{'all':!![]}];}_0x2aafe0=_[_0x4fa7('0x3d')]({},_0x2aafe0,_0x37d330['options']);return db[_0x4fa7('0x2b')]['find'](_0x2aafe0)[_0x4fa7('0x24')](handleEntityNotFound(_0x42c910,null))[_0x4fa7('0x24')](respondWithResult(_0x42c910,null))[_0x4fa7('0x46')](handleError(_0x42c910,null));};exports[_0x4fa7('0x47')]=function(_0xe0751d,_0x21451e){return db[_0x4fa7('0x2b')][_0x4fa7('0x47')](_0xe0751d[_0x4fa7('0x48')],{})['then'](respondWithResult(_0x21451e,0xc9))['catch'](handleError(_0x21451e,null));};exports[_0x4fa7('0x23')]=function(_0x236034,_0x469175){if(_0x236034[_0x4fa7('0x48')]['id']){delete _0x236034['body']['id'];}return db[_0x4fa7('0x2b')][_0x4fa7('0x49')]({'where':{'id':_0x236034[_0x4fa7('0x45')]['id']}})[_0x4fa7('0x24')](handleEntityNotFound(_0x469175,null))['then'](saveUpdates(_0x236034['body'],null))['then'](respondWithResult(_0x469175,null))['catch'](handleError(_0x469175,null));};exports[_0x4fa7('0x25')]=function(_0x5a42f2,_0x1c535f){return db['FreshsalesAccount']['find']({'where':{'id':_0x5a42f2[_0x4fa7('0x45')]['id']}})[_0x4fa7('0x24')](handleEntityNotFound(_0x1c535f,null))['then'](removeEntity(_0x1c535f,null))[_0x4fa7('0x46')](handleError(_0x1c535f,null));};exports[_0x4fa7('0x4a')]=function(_0x51cf14,_0x4cfd49,_0x16ac0f){var _0x51d3e8={};var _0x31c961={};var _0x4951c3;var _0x351936;return db[_0x4fa7('0x2b')][_0x4fa7('0x4b')]({'where':{'id':_0x51cf14[_0x4fa7('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cfd49,null))[_0x4fa7('0x24')](function(_0x264f58){if(_0x264f58){_0x4951c3=_0x264f58;_0x31c961[_0x4fa7('0x34')]=_['keys'](db[_0x4fa7('0x4c')][_0x4fa7('0x2c')]);_0x31c961[_0x4fa7('0x31')]=_[_0x4fa7('0x30')](_0x51cf14['query']);_0x31c961[_0x4fa7('0x32')]=_[_0x4fa7('0x33')](_0x31c961[_0x4fa7('0x34')],_0x31c961[_0x4fa7('0x31')]);_0x51d3e8[_0x4fa7('0x35')]=_[_0x4fa7('0x33')](_0x31c961['model'],qs[_0x4fa7('0x36')](_0x51cf14[_0x4fa7('0x31')][_0x4fa7('0x36')]));_0x51d3e8[_0x4fa7('0x35')]=_0x51d3e8[_0x4fa7('0x35')][_0x4fa7('0x37')]?_0x51d3e8['attributes']:_0x31c961[_0x4fa7('0x34')];_0x51d3e8[_0x4fa7('0x4d')]=qs[_0x4fa7('0x39')](_0x51cf14[_0x4fa7('0x31')][_0x4fa7('0x39')]);_0x51d3e8[_0x4fa7('0x3a')]=qs[_0x4fa7('0x32')](_[_0x4fa7('0x3b')](_0x51cf14[_0x4fa7('0x31')],_0x31c961[_0x4fa7('0x32')]));if(_0x51cf14[_0x4fa7('0x31')][_0x4fa7('0x3c')]){_0x51d3e8[_0x4fa7('0x3a')]=_[_0x4fa7('0x3d')](_0x51d3e8['where'],{'$or':_[_0x4fa7('0x2f')](_0x51d3e8[_0x4fa7('0x35')],function(_0x23029e){var _0x49aea2={};_0x49aea2[_0x23029e]={'$like':'%'+_0x51cf14['query'][_0x4fa7('0x3c')]+'%'};return _0x49aea2;})});}_0x51d3e8=_[_0x4fa7('0x3d')]({},_0x51d3e8,_0x51cf14[_0x4fa7('0x3f')]);return _0x4951c3['getConfigurations'](_0x51d3e8);}})[_0x4fa7('0x24')](function(_0x541f74){if(_0x541f74){_0x351936=_0x541f74[_0x4fa7('0x37')];if(!_0x51cf14[_0x4fa7('0x31')]['hasOwnProperty'](_0x4fa7('0x38'))){_0x51d3e8[_0x4fa7('0x20')]=qs['limit'](_0x51cf14['query'][_0x4fa7('0x20')]);_0x51d3e8['offset']=qs[_0x4fa7('0x1d')](_0x51cf14[_0x4fa7('0x31')]['offset']);}return _0x4951c3['getConfigurations'](_0x51d3e8);}})[_0x4fa7('0x24')](function(_0x463f47){if(_0x463f47){return _0x463f47?{'count':_0x351936,'rows':_0x463f47}:null;}})[_0x4fa7('0x24')](respondWithResult(_0x4cfd49,null))[_0x4fa7('0x46')](handleError(_0x4cfd49,null));};exports[_0x4fa7('0x4e')]=function(_0x405f2b,_0x54a129,_0x3d5971){if(_0x405f2b[_0x4fa7('0x48')]['id']){delete _0x405f2b[_0x4fa7('0x48')]['id'];}return db[_0x4fa7('0x2b')]['findOne']({'where':{'id':_0x405f2b['params']['id']}})[_0x4fa7('0x24')](handleEntityNotFound(_0x54a129,null))[_0x4fa7('0x24')](function(_0x31c758){if(_0x31c758){_0x405f2b[_0x4fa7('0x48')][_0x4fa7('0x4f')]=_0x31c758['id'];_0x405f2b[_0x4fa7('0x48')][_0x4fa7('0x50')]=integrations[_0x4fa7('0x51')](_0x405f2b[_0x4fa7('0x48')][_0x4fa7('0x52')],_0x405f2b['body'][_0x4fa7('0x2d')]);_0x405f2b[_0x4fa7('0x48')][_0x4fa7('0x53')]=integrations[_0x4fa7('0x54')](_0x405f2b[_0x4fa7('0x48')][_0x4fa7('0x52')],_0x405f2b[_0x4fa7('0x48')]['type']);return db[_0x4fa7('0x4c')][_0x4fa7('0x47')](_0x405f2b['body'],{'include':[{'model':db[_0x4fa7('0x55')],'as':_0x4fa7('0x50')},{'model':db[_0x4fa7('0x55')],'as':_0x4fa7('0x53')}]});}return null;})[_0x4fa7('0x24')](respondWithResult(_0x54a129,null))[_0x4fa7('0x46')](handleError(_0x54a129,null));};exports[_0x4fa7('0x56')]=function(_0x5a8fde,_0x489728,_0x291df9){var _0x5f04ac='';var _0x2dda30='';return db[_0x4fa7('0x2b')][_0x4fa7('0x4b')]({'where':{'id':_0x5a8fde[_0x4fa7('0x45')]['id']},'attributes':['id',_0x4fa7('0x57'),'remoteUri',_0x4fa7('0x58')]})['then'](handleEntityNotFound(_0x489728,null))[_0x4fa7('0x24')](function(_0x51fd01){if(_0x51fd01){_0x2dda30=_0x51fd01['username'];_0x5f04ac=_0x51fd01['remoteUri'];var _0x379ff1=_0x51fd01[_0x4fa7('0x59')]['slice'](-0x1);if(_0x379ff1==='/'){_0x5f04ac=_0x5f04ac['substring'](0x0,_0x5f04ac[_0x4fa7('0x5a')](_0x379ff1));}return rp({'method':_0x4fa7('0x5b'),'uri':util[_0x4fa7('0x5c')]('%s%s',_0x5f04ac,_0x4fa7('0x5d')),'headers':{'Authorization':_0x4fa7('0x5e')+_0x51fd01[_0x4fa7('0x58')]},'json':!![]});}})[_0x4fa7('0x24')](function(_0x53dabc){if(_0x53dabc){var _0xea64b1=_0x53dabc[_0x4fa7('0x5f')];var _0x1556b5=![];var _0x2f34d1=null;for(_0x2f34d1=0x0;_0x2f34d1<_0xea64b1[_0x4fa7('0x37')];_0x2f34d1++){if(_0xea64b1[_0x2f34d1][_0x4fa7('0x60')]===_0x2dda30){_0x1556b5=!![];}}if(_0x1556b5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4fa7('0x61')});}}})[_0x4fa7('0x24')](respondWithResult(_0x489728,null))[_0x4fa7('0x46')](function(_0x459a75){var _0xf61392=_0x5a8fde[_0x4fa7('0x31')][_0x4fa7('0x62')]?0x1f4:_0x459a75[_0x4fa7('0x63')]||0x1f4;logger[_0x4fa7('0x27')](_0x4fa7('0x64'),_0x4fa7('0x56'),_0xf61392,JSON[_0x4fa7('0x65')](_0x459a75));delete _0x459a75['name'];if(_0xf61392===0x191){_0xf61392=0x190;}_0x489728[_0x4fa7('0x1b')](_0xf61392)['send'](_0x5a8fde['query']['test']?{'message':_0x4fa7('0x66'),'statusCode':_0x459a75['statusCode']}:_0x459a75);});}; \ No newline at end of file +var _0xbcc7=['/api/selector/owners','Token\x20token=','apiKey','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','sort','where','filters','merge','VIRTUAL','filter','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','findOne','FreshsalesConfiguration','rawAttributes','pick','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','remoteUri','username','slice','substring','lastIndexOf','GET','%s%s'];(function(_0x3f5570,_0x1902ae){var _0x2ad0f9=function(_0x4bb66d){while(--_0x4bb66d){_0x3f5570['push'](_0x3f5570['shift']());}};_0x2ad0f9(++_0x1902ae);}(_0xbcc7,0x19a));var _0x7bcc=function(_0xa05cf2,_0x2d118a){_0xa05cf2=_0xa05cf2-0x0;var _0x212397=_0xbcc7[_0xa05cf2];return _0x212397;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];var integrations=require(_0x7bcc('0x16'));function respondWithStatusCode(_0x51b0e8,_0x3e3580){_0x3e3580=_0x3e3580||0xcc;return function(_0x101354){if(_0x101354){return _0x51b0e8[_0x7bcc('0x17')](_0x3e3580);}return _0x51b0e8[_0x7bcc('0x18')](_0x3e3580)[_0x7bcc('0x19')]();};}function respondWithResult(_0x217896,_0x4a2539){_0x4a2539=_0x4a2539||0xc8;return function(_0x3998c5){if(_0x3998c5){return _0x217896[_0x7bcc('0x18')](_0x4a2539)[_0x7bcc('0x1a')](_0x3998c5);}};}function respondWithFilteredResult(_0x461ff7,_0x30caa2){return function(_0x134d55){if(_0x134d55){var _0x432960=typeof _0x30caa2['offset']===_0x7bcc('0x1b')&&typeof _0x30caa2['limit']===_0x7bcc('0x1b');var _0x43dfc4=_0x134d55[_0x7bcc('0x1c')];var _0x323525=_0x432960?0x0:_0x30caa2['offset'];var _0x51e08d=_0x432960?_0x134d55[_0x7bcc('0x1c')]:_0x30caa2[_0x7bcc('0x1d')]+_0x30caa2[_0x7bcc('0x1e')];var _0x2bb631;if(_0x51e08d>=_0x43dfc4){_0x51e08d=_0x43dfc4;_0x2bb631=0xc8;}else{_0x2bb631=0xce;}_0x461ff7[_0x7bcc('0x18')](_0x2bb631);return _0x461ff7[_0x7bcc('0x1f')](_0x7bcc('0x20'),_0x323525+'-'+_0x51e08d+'/'+_0x43dfc4)[_0x7bcc('0x1a')](_0x134d55);}return null;};}function patchUpdates(_0x15b2c3){return function(_0x5d3409){try{jsonpatch['apply'](_0x5d3409,_0x15b2c3,!![]);}catch(_0x2dcc37){return BPromise[_0x7bcc('0x21')](_0x2dcc37);}return _0x5d3409[_0x7bcc('0x22')]();};}function saveUpdates(_0x3050cf,_0x201f40){return function(_0x2ba4bf){if(_0x2ba4bf){return _0x2ba4bf[_0x7bcc('0x23')](_0x3050cf)[_0x7bcc('0x24')](function(_0x32b3ea){return _0x32b3ea;});}return null;};}function removeEntity(_0x54c611,_0x2d25b8){return function(_0x2b3d01){if(_0x2b3d01){return _0x2b3d01[_0x7bcc('0x25')]()[_0x7bcc('0x24')](function(){_0x54c611[_0x7bcc('0x18')](0xcc)[_0x7bcc('0x19')]();});}};}function handleEntityNotFound(_0x4f8562,_0x48b296){return function(_0x345dd8){if(!_0x345dd8){_0x4f8562['sendStatus'](0x194);}return _0x345dd8;};}function handleError(_0x4db3c0,_0xd3ca3b){_0xd3ca3b=_0xd3ca3b||0x1f4;return function(_0x560cec){logger[_0x7bcc('0x26')](_0x560cec[_0x7bcc('0x27')]);if(_0x560cec[_0x7bcc('0x28')]){delete _0x560cec['name'];}_0x4db3c0[_0x7bcc('0x18')](_0xd3ca3b)[_0x7bcc('0x29')](_0x560cec);};}exports[_0x7bcc('0x2a')]=function(_0x319943,_0x20c458){var _0x1ecf95={},_0x9fdacf={},_0x57aa56={'count':0x0,'rows':[]};var _0x170c48=_[_0x7bcc('0x2b')](db['FreshsalesAccount']['rawAttributes'],function(_0x472b73){return{'name':_0x472b73['fieldName'],'type':_0x472b73[_0x7bcc('0x2c')][_0x7bcc('0x2d')]};});_0x9fdacf[_0x7bcc('0x2e')]=_[_0x7bcc('0x2b')](_0x170c48,'name');_0x9fdacf[_0x7bcc('0x2f')]=_[_0x7bcc('0x30')](_0x319943[_0x7bcc('0x2f')]);_0x9fdacf['filters']=_[_0x7bcc('0x31')](_0x9fdacf[_0x7bcc('0x2e')],_0x9fdacf[_0x7bcc('0x2f')]);_0x1ecf95[_0x7bcc('0x32')]=_[_0x7bcc('0x31')](_0x9fdacf[_0x7bcc('0x2e')],qs[_0x7bcc('0x33')](_0x319943[_0x7bcc('0x2f')][_0x7bcc('0x33')]));_0x1ecf95[_0x7bcc('0x32')]=_0x1ecf95[_0x7bcc('0x32')]['length']?_0x1ecf95[_0x7bcc('0x32')]:_0x9fdacf[_0x7bcc('0x2e')];if(!_0x319943[_0x7bcc('0x2f')]['hasOwnProperty']('nolimit')){_0x1ecf95[_0x7bcc('0x1e')]=qs[_0x7bcc('0x1e')](_0x319943[_0x7bcc('0x2f')][_0x7bcc('0x1e')]);_0x1ecf95[_0x7bcc('0x1d')]=qs[_0x7bcc('0x1d')](_0x319943[_0x7bcc('0x2f')]['offset']);}_0x1ecf95['order']=qs['sort'](_0x319943['query'][_0x7bcc('0x34')]);_0x1ecf95[_0x7bcc('0x35')]=qs[_0x7bcc('0x36')](_['pick'](_0x319943[_0x7bcc('0x2f')],_0x9fdacf[_0x7bcc('0x36')]),_0x170c48);if(_0x319943[_0x7bcc('0x2f')]['filter']){_0x1ecf95['where']=_[_0x7bcc('0x37')](_0x1ecf95[_0x7bcc('0x35')],{'$or':_[_0x7bcc('0x2b')](_0x170c48,function(_0x57fafe){if(_0x57fafe['type']!==_0x7bcc('0x38')){var _0x11dd5c={};_0x11dd5c[_0x57fafe[_0x7bcc('0x28')]]={'$like':'%'+_0x319943['query'][_0x7bcc('0x39')]+'%'};return _0x11dd5c;}})});}_0x1ecf95=_[_0x7bcc('0x37')]({},_0x1ecf95,_0x319943[_0x7bcc('0x3a')]);var _0x34d62f={'where':_0x1ecf95[_0x7bcc('0x35')]};return db[_0x7bcc('0x3b')]['count'](_0x34d62f)[_0x7bcc('0x24')](function(_0x1c6edb){_0x57aa56['count']=_0x1c6edb;if(_0x319943[_0x7bcc('0x2f')][_0x7bcc('0x3c')]){_0x1ecf95[_0x7bcc('0x3d')]=[{'all':!![]}];}return db[_0x7bcc('0x3b')][_0x7bcc('0x3e')](_0x1ecf95);})[_0x7bcc('0x24')](function(_0x632cff){_0x57aa56[_0x7bcc('0x3f')]=_0x632cff;return _0x57aa56;})['then'](respondWithFilteredResult(_0x20c458,_0x1ecf95))[_0x7bcc('0x40')](handleError(_0x20c458,null));};exports[_0x7bcc('0x41')]=function(_0x3d999f,_0x10e3a2){var _0x4074d7={'raw':![],'where':{'id':_0x3d999f['params']['id']}},_0x45f4ef={};_0x45f4ef['model']=_[_0x7bcc('0x30')](db[_0x7bcc('0x3b')]['rawAttributes']);_0x45f4ef[_0x7bcc('0x2f')]=_[_0x7bcc('0x30')](_0x3d999f[_0x7bcc('0x2f')]);_0x45f4ef[_0x7bcc('0x36')]=_[_0x7bcc('0x31')](_0x45f4ef[_0x7bcc('0x2e')],_0x45f4ef[_0x7bcc('0x2f')]);_0x4074d7['attributes']=_[_0x7bcc('0x31')](_0x45f4ef[_0x7bcc('0x2e')],qs[_0x7bcc('0x33')](_0x3d999f[_0x7bcc('0x2f')][_0x7bcc('0x33')]));_0x4074d7['attributes']=_0x4074d7[_0x7bcc('0x32')][_0x7bcc('0x42')]?_0x4074d7['attributes']:_0x45f4ef[_0x7bcc('0x2e')];if(_0x3d999f[_0x7bcc('0x2f')][_0x7bcc('0x3c')]){_0x4074d7['include']=[{'all':!![]}];}_0x4074d7=_[_0x7bcc('0x37')]({},_0x4074d7,_0x3d999f[_0x7bcc('0x3a')]);return db['FreshsalesAccount'][_0x7bcc('0x43')](_0x4074d7)[_0x7bcc('0x24')](handleEntityNotFound(_0x10e3a2,null))[_0x7bcc('0x24')](respondWithResult(_0x10e3a2,null))[_0x7bcc('0x40')](handleError(_0x10e3a2,null));};exports[_0x7bcc('0x44')]=function(_0x538a2e,_0x2c552b){return db[_0x7bcc('0x3b')]['create'](_0x538a2e[_0x7bcc('0x45')],{})['then'](respondWithResult(_0x2c552b,0xc9))[_0x7bcc('0x40')](handleError(_0x2c552b,null));};exports['update']=function(_0x29cb88,_0x513cf3){if(_0x29cb88['body']['id']){delete _0x29cb88[_0x7bcc('0x45')]['id'];}return db[_0x7bcc('0x3b')][_0x7bcc('0x43')]({'where':{'id':_0x29cb88[_0x7bcc('0x46')]['id']}})[_0x7bcc('0x24')](handleEntityNotFound(_0x513cf3,null))[_0x7bcc('0x24')](saveUpdates(_0x29cb88[_0x7bcc('0x45')],null))[_0x7bcc('0x24')](respondWithResult(_0x513cf3,null))[_0x7bcc('0x40')](handleError(_0x513cf3,null));};exports[_0x7bcc('0x25')]=function(_0x8e50eb,_0x40fde8){return db[_0x7bcc('0x3b')][_0x7bcc('0x43')]({'where':{'id':_0x8e50eb[_0x7bcc('0x46')]['id']}})['then'](handleEntityNotFound(_0x40fde8,null))[_0x7bcc('0x24')](removeEntity(_0x40fde8,null))[_0x7bcc('0x40')](handleError(_0x40fde8,null));};exports['getConfigurations']=function(_0x4bfffa,_0x2f8e0d,_0x38240d){var _0x55deaf={};var _0x5cf572={};var _0x5268f2;var _0x52b09d;return db['FreshsalesAccount'][_0x7bcc('0x47')]({'where':{'id':_0x4bfffa[_0x7bcc('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f8e0d,null))['then'](function(_0x432d84){if(_0x432d84){_0x5268f2=_0x432d84;_0x5cf572[_0x7bcc('0x2e')]=_[_0x7bcc('0x30')](db[_0x7bcc('0x48')][_0x7bcc('0x49')]);_0x5cf572[_0x7bcc('0x2f')]=_['keys'](_0x4bfffa['query']);_0x5cf572[_0x7bcc('0x36')]=_[_0x7bcc('0x31')](_0x5cf572[_0x7bcc('0x2e')],_0x5cf572[_0x7bcc('0x2f')]);_0x55deaf['attributes']=_['intersection'](_0x5cf572['model'],qs[_0x7bcc('0x33')](_0x4bfffa['query'][_0x7bcc('0x33')]));_0x55deaf[_0x7bcc('0x32')]=_0x55deaf[_0x7bcc('0x32')]['length']?_0x55deaf[_0x7bcc('0x32')]:_0x5cf572['model'];_0x55deaf['order']=qs[_0x7bcc('0x34')](_0x4bfffa[_0x7bcc('0x2f')][_0x7bcc('0x34')]);_0x55deaf[_0x7bcc('0x35')]=qs[_0x7bcc('0x36')](_[_0x7bcc('0x4a')](_0x4bfffa[_0x7bcc('0x2f')],_0x5cf572[_0x7bcc('0x36')]));if(_0x4bfffa[_0x7bcc('0x2f')]['filter']){_0x55deaf[_0x7bcc('0x35')]=_[_0x7bcc('0x37')](_0x55deaf[_0x7bcc('0x35')],{'$or':_['map'](_0x55deaf[_0x7bcc('0x32')],function(_0x24c9b9){var _0x42c095={};_0x42c095[_0x24c9b9]={'$like':'%'+_0x4bfffa[_0x7bcc('0x2f')][_0x7bcc('0x39')]+'%'};return _0x42c095;})});}_0x55deaf=_[_0x7bcc('0x37')]({},_0x55deaf,_0x4bfffa[_0x7bcc('0x3a')]);return _0x5268f2[_0x7bcc('0x4b')](_0x55deaf);}})[_0x7bcc('0x24')](function(_0x27e2d1){if(_0x27e2d1){_0x52b09d=_0x27e2d1['length'];if(!_0x4bfffa[_0x7bcc('0x2f')][_0x7bcc('0x4c')]('nolimit')){_0x55deaf[_0x7bcc('0x1e')]=qs[_0x7bcc('0x1e')](_0x4bfffa[_0x7bcc('0x2f')]['limit']);_0x55deaf[_0x7bcc('0x1d')]=qs['offset'](_0x4bfffa[_0x7bcc('0x2f')][_0x7bcc('0x1d')]);}return _0x5268f2[_0x7bcc('0x4b')](_0x55deaf);}})[_0x7bcc('0x24')](function(_0x2e4a1b){if(_0x2e4a1b){return _0x2e4a1b?{'count':_0x52b09d,'rows':_0x2e4a1b}:null;}})[_0x7bcc('0x24')](respondWithResult(_0x2f8e0d,null))[_0x7bcc('0x40')](handleError(_0x2f8e0d,null));};exports['addConfiguration']=function(_0x57baed,_0x4dc93,_0x5b979b){if(_0x57baed[_0x7bcc('0x45')]['id']){delete _0x57baed[_0x7bcc('0x45')]['id'];}return db[_0x7bcc('0x3b')][_0x7bcc('0x47')]({'where':{'id':_0x57baed['params']['id']}})[_0x7bcc('0x24')](handleEntityNotFound(_0x4dc93,null))[_0x7bcc('0x24')](function(_0xc0401f){if(_0xc0401f){_0x57baed[_0x7bcc('0x45')][_0x7bcc('0x4d')]=_0xc0401f['id'];_0x57baed[_0x7bcc('0x45')][_0x7bcc('0x4e')]=integrations[_0x7bcc('0x4f')](_0x57baed[_0x7bcc('0x45')][_0x7bcc('0x50')],_0x57baed[_0x7bcc('0x45')]['type']);_0x57baed['body']['Descriptions']=integrations[_0x7bcc('0x51')](_0x57baed['body'][_0x7bcc('0x50')],_0x57baed['body'][_0x7bcc('0x2c')]);return db[_0x7bcc('0x48')][_0x7bcc('0x44')](_0x57baed[_0x7bcc('0x45')],{'include':[{'model':db[_0x7bcc('0x52')],'as':_0x7bcc('0x4e')},{'model':db[_0x7bcc('0x52')],'as':'Descriptions'}]});}return null;})[_0x7bcc('0x24')](respondWithResult(_0x4dc93,null))[_0x7bcc('0x40')](handleError(_0x4dc93,null));};exports['getFields']=function(_0x11610b,_0x57ee0f,_0x354819){var _0x4c2374='';var _0x13205f='';return db[_0x7bcc('0x3b')][_0x7bcc('0x47')]({'where':{'id':_0x11610b[_0x7bcc('0x46')]['id']},'attributes':['id','username',_0x7bcc('0x53'),'apiKey']})[_0x7bcc('0x24')](handleEntityNotFound(_0x57ee0f,null))[_0x7bcc('0x24')](function(_0x27ce03){if(_0x27ce03){_0x13205f=_0x27ce03[_0x7bcc('0x54')];_0x4c2374=_0x27ce03['remoteUri'];var _0x34cc97=_0x27ce03[_0x7bcc('0x53')][_0x7bcc('0x55')](-0x1);if(_0x34cc97==='/'){_0x4c2374=_0x4c2374[_0x7bcc('0x56')](0x0,_0x4c2374[_0x7bcc('0x57')](_0x34cc97));}return rp({'method':_0x7bcc('0x58'),'uri':util['format'](_0x7bcc('0x59'),_0x4c2374,_0x7bcc('0x5a')),'headers':{'Authorization':_0x7bcc('0x5b')+_0x27ce03[_0x7bcc('0x5c')]},'json':!![]});}})[_0x7bcc('0x24')](function(_0x10544d){if(_0x10544d){var _0xce883b=_0x10544d['users'];var _0x2f9d8d=![];var _0x36794d=null;for(_0x36794d=0x0;_0x36794d<_0xce883b[_0x7bcc('0x42')];_0x36794d++){if(_0xce883b[_0x36794d][_0x7bcc('0x5d')]===_0x13205f){_0x2f9d8d=!![];}}if(_0x2f9d8d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7bcc('0x5e')});}}})[_0x7bcc('0x24')](respondWithResult(_0x57ee0f,null))[_0x7bcc('0x40')](function(_0x19e4dd){var _0x375fd6=_0x11610b['query'][_0x7bcc('0x5f')]?0x1f4:_0x19e4dd[_0x7bcc('0x60')]||0x1f4;logger[_0x7bcc('0x26')](_0x7bcc('0x61'),_0x7bcc('0x62'),_0x375fd6,JSON['stringify'](_0x19e4dd));delete _0x19e4dd[_0x7bcc('0x28')];if(_0x375fd6===0x191){_0x375fd6=0x190;}_0x57ee0f[_0x7bcc('0x18')](_0x375fd6)[_0x7bcc('0x29')](_0x11610b[_0x7bcc('0x2f')]['test']?{'message':_0x7bcc('0x63'),'statusCode':_0x19e4dd[_0x7bcc('0x60')]}:_0x19e4dd);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 266a4b4..488dbe2 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x323f=['exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x480aef,_0x4a178a){var _0x2cc8bb=function(_0x1b7eab){while(--_0x1b7eab){_0x480aef['push'](_0x480aef['shift']());}};_0x2cc8bb(++_0x4a178a);}(_0x323f,0x1ee));var _0xf323=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x323f[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require(_0xf323('0x2'));var BPromise=require(_0xf323('0x3'));var rp=require(_0xf323('0x4'));var fs=require('fs');var path=require(_0xf323('0x5'));var rimraf=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var attributes=require(_0xf323('0x8'));var integrations=require(_0xf323('0x9'));module[_0xf323('0xa')]=function(_0x5d7d60,_0xb9a667){return _0x5d7d60[_0xf323('0xb')](_0xf323('0xc'),attributes,{'tableName':_0xf323('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb016=['../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x10b7bc,_0x2c2a4f){var _0x64b7dd=function(_0x1254a0){while(--_0x1254a0){_0x10b7bc['push'](_0x10b7bc['shift']());}};_0x64b7dd(++_0x2c2a4f);}(_0xb016,0x159));var _0x6b01=function(_0x14b1e5,_0x27fc4e){_0x14b1e5=_0x14b1e5-0x0;var _0x3589ab=_0xb016[_0x14b1e5];return _0x3589ab;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x6b01('0x7'));module[_0x6b01('0x8')]=function(_0x192b2d,_0x5759a1){return _0x192b2d['define'](_0x6b01('0x9'),attributes,{'tableName':_0x6b01('0xa'),'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 02f061b..f3da304 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0295=['find','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','raw','where','include','map','model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount'];(function(_0x41ce0a,_0x40e7e6){var _0x56d553=function(_0x35881a){while(--_0x35881a){_0x41ce0a['push'](_0x41ce0a['shift']());}};_0x56d553(++_0x40e7e6);}(_0x0295,0x1f0));var _0x5029=function(_0x1938f4,_0x5c0c98){_0x1938f4=_0x1938f4-0x0;var _0x37f4db=_0x0295[_0x1938f4];return _0x37f4db;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['GetFreshsalesAccount']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')]({'raw':_0x1ed567[_0x5029('0x17')]?_0x1ed567['options'][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')][_0x5029('0x19')]||null:null,'attributes':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')]['attributes']||null:null,'limit':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')]['limit']||null:null,'include':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')],function(_0x125c26){return{'model':db[_0x125c26[_0x5029('0x1c')]],'as':_0x125c26['as'],'attributes':_0x125c26[_0x5029('0x1d')],'include':_0x125c26['include']?_['map'](_0x125c26['include'],function(_0x588d90){return{'model':db[_0x588d90[_0x5029('0x1c')]],'as':_0x588d90['as'],'attributes':_0x588d90['attributes'],'include':_0x588d90['include']?_[_0x5029('0x1b')](_0x588d90[_0x5029('0x1a')],function(_0x36d810){return{'model':db[_0x36d810['model']],'as':_0x36d810['as'],'attributes':_0x36d810[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x5e45c4){logger[_0x5029('0xb')](_0x5029('0x1e'),_0x1ed567);logger[_0x5029('0xd')]('GetFreshsalesAccount',_0x1ed567,JSON[_0x5029('0xf')](_0x5e45c4));_0x35de81(_0x5e45c4);})[_0x5029('0x14')](function(_0xe5313e){logger['error'](_0x5029('0x1e'),_0xe5313e[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155['error'](0x1f4,_0xe5313e[_0x5029('0x12')]));});});};exports[_0x5029('0x1f')]=function(_0x4434ff){var _0x1c3dd9=this;return new Promise(function(_0x196830,_0x2a1ed6){return db[_0x5029('0x15')][_0x5029('0x20')]({'raw':_0x4434ff[_0x5029('0x17')]?_0x4434ff[_0x5029('0x17')][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x4434ff[_0x5029('0x17')]?_0x4434ff['options'][_0x5029('0x19')]||null:null,'attributes':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')]['attributes']||null:null,'include':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x4434ff['options'][_0x5029('0x1a')],function(_0x15d882){return{'model':db[_0x15d882[_0x5029('0x1c')]],'as':_0x15d882['as'],'attributes':_0x15d882[_0x5029('0x1d')],'include':_0x15d882[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x15d882[_0x5029('0x1a')],function(_0x22205e){return{'model':db[_0x22205e[_0x5029('0x1c')]],'as':_0x22205e['as'],'attributes':_0x22205e['attributes'],'include':_0x22205e[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x22205e[_0x5029('0x1a')],function(_0x1b3817){return{'model':db[_0x1b3817['model']],'as':_0x1b3817['as'],'attributes':_0x1b3817[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x3e2d88){logger['info']('ShowFreshsalesAccount',_0x4434ff);logger[_0x5029('0xd')](_0x5029('0x1f'),_0x4434ff,JSON['stringify'](_0x3e2d88));_0x196830(_0x3e2d88);})['catch'](function(_0x9656f2){logger[_0x5029('0x10')](_0x5029('0x1f'),_0x9656f2[_0x5029('0x12')],_0x4434ff);_0x2a1ed6(_0x1c3dd9[_0x5029('0x10')](0x1f4,_0x9656f2[_0x5029('0x12')]));});});}; \ No newline at end of file +var _0x3a6d=['client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowFreshsalesAccount','find','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x41a32e,_0x3383b8){var _0x4a009c=function(_0xf1b17f){while(--_0xf1b17f){_0x41a32e['push'](_0x41a32e['shift']());}};_0x4a009c(++_0x3383b8);}(_0x3a6d,0x143));var _0xd3a6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x3a6d[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')]({'raw':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1a')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'limit':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1c')]||null:null,'include':_0x8d1286['options']?_0x8d1286['options']['include']?_['map'](_0x8d1286['options'][_0xd3a6('0x1d')],function(_0x400982){return{'model':db[_0x400982[_0xd3a6('0x1e')]],'as':_0x400982['as'],'attributes':_0x400982['attributes'],'include':_0x400982[_0xd3a6('0x1d')]?_['map'](_0x400982[_0xd3a6('0x1d')],function(_0x16afc8){return{'model':db[_0x16afc8[_0xd3a6('0x1e')]],'as':_0x16afc8['as'],'attributes':_0x16afc8['attributes'],'include':_0x16afc8[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x16afc8[_0xd3a6('0x1d')],function(_0x219e32){return{'model':db[_0x219e32[_0xd3a6('0x1e')]],'as':_0x219e32['as'],'attributes':_0x219e32[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30df90){logger[_0xd3a6('0xe')](_0xd3a6('0x16'),_0x8d1286);logger[_0xd3a6('0x20')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x30df90));_0xbe58b4(_0x30df90);})['catch'](function(_0x535bd4){logger[_0xd3a6('0x13')](_0xd3a6('0x16'),_0x535bd4[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x535bd4['message']));});});};exports[_0xd3a6('0x21')]=function(_0xa4efd){var _0x4d322a=this;return new Promise(function(_0x14381c,_0x5d9867){return db[_0xd3a6('0x17')][_0xd3a6('0x22')]({'raw':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x23')]===undefined?!![]:![]:!![],'where':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')]['where']||null:null,'attributes':_0xa4efd['options']?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'include':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd['options'][_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1d')],function(_0x3ebd0d){return{'model':db[_0x3ebd0d[_0xd3a6('0x1e')]],'as':_0x3ebd0d['as'],'attributes':_0x3ebd0d[_0xd3a6('0x1b')],'include':_0x3ebd0d[_0xd3a6('0x1d')]?_['map'](_0x3ebd0d[_0xd3a6('0x1d')],function(_0x41981c){return{'model':db[_0x41981c[_0xd3a6('0x1e')]],'as':_0x41981c['as'],'attributes':_0x41981c[_0xd3a6('0x1b')],'include':_0x41981c[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x41981c['include'],function(_0x16a30a){return{'model':db[_0x16a30a['model']],'as':_0x16a30a['as'],'attributes':_0x16a30a[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0xd')](function(_0x180bb9){logger[_0xd3a6('0xe')]('ShowFreshsalesAccount',_0xa4efd);logger['debug'](_0xd3a6('0x21'),_0xa4efd,JSON[_0xd3a6('0x12')](_0x180bb9));_0x14381c(_0x180bb9);})[_0xd3a6('0x24')](function(_0x5188e1){logger[_0xd3a6('0x13')](_0xd3a6('0x21'),_0x5188e1['message'],_0xa4efd);_0x5d9867(_0x4d322a[_0xd3a6('0x13')](0x1f4,_0x5188e1['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index db59e66..264dad4 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 _0x5832=['get','/:id','/:id/subjects','getSubjects','getDescriptions','getFields','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index'];(function(_0x2202df,_0x5cf3d7){var _0x58acd7=function(_0xc4d5a5){while(--_0xc4d5a5){_0x2202df['push'](_0x2202df['shift']());}};_0x58acd7(++_0x5cf3d7);}(_0x5832,0x1c3));var _0x2583=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x5832[_0x53f37f];return _0x2fe5f8;};'use strict';var multer=require('multer');var util=require(_0x2583('0x0'));var path=require(_0x2583('0x1'));var timeout=require(_0x2583('0x2'));var express=require(_0x2583('0x3'));var router=express[_0x2583('0x4')]();var fs_extra=require(_0x2583('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2583('0x6'));var config=require(_0x2583('0x7'));var controller=require(_0x2583('0x8'));router['get']('/',auth[_0x2583('0x9')](),controller[_0x2583('0xa')]);router[_0x2583('0xb')](_0x2583('0xc'),auth[_0x2583('0x9')](),controller['show']);router['get'](_0x2583('0xd'),auth['isAuthenticated'](),controller[_0x2583('0xe')]);router[_0x2583('0xb')]('/:id/descriptions',auth[_0x2583('0x9')](),controller[_0x2583('0xf')]);router[_0x2583('0xb')]('/:id/fields',auth[_0x2583('0x9')](),controller[_0x2583('0x10')]);router[_0x2583('0x11')]('/',auth[_0x2583('0x9')](),controller['create']);router[_0x2583('0x12')](_0x2583('0xc'),auth[_0x2583('0x9')](),controller['update']);router[_0x2583('0x13')](_0x2583('0xc'),auth[_0x2583('0x9')](),controller[_0x2583('0x14')]);module[_0x2583('0x15')]=router; \ No newline at end of file +var _0x9e21=['getFields','post','create','put','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','getSubjects','getDescriptions','/:id/fields'];(function(_0x4ceb9e,_0x266071){var _0x5c96ed=function(_0x196c5e){while(--_0x196c5e){_0x4ceb9e['push'](_0x4ceb9e['shift']());}};_0x5c96ed(++_0x266071);}(_0x9e21,0x1ab));var _0x19e2=function(_0x4d7aaf,_0xb955da){_0x4d7aaf=_0x4d7aaf-0x0;var _0x33fb7b=_0x9e21[_0x4d7aaf];return _0x33fb7b;};'use strict';var multer=require('multer');var util=require(_0x19e2('0x0'));var path=require('path');var timeout=require(_0x19e2('0x1'));var express=require(_0x19e2('0x2'));var router=express[_0x19e2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x19e2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x19e2('0x5'));var controller=require(_0x19e2('0x6'));router[_0x19e2('0x7')]('/',auth['isAuthenticated'](),controller[_0x19e2('0x8')]);router[_0x19e2('0x7')](_0x19e2('0x9'),auth[_0x19e2('0xa')](),controller['show']);router[_0x19e2('0x7')]('/:id/subjects',auth[_0x19e2('0xa')](),controller[_0x19e2('0xb')]);router[_0x19e2('0x7')]('/:id/descriptions',auth[_0x19e2('0xa')](),controller[_0x19e2('0xc')]);router['get'](_0x19e2('0xd'),auth[_0x19e2('0xa')](),controller[_0x19e2('0xe')]);router[_0x19e2('0xf')]('/',auth[_0x19e2('0xa')](),controller[_0x19e2('0x10')]);router[_0x19e2('0x11')]('/:id',auth[_0x19e2('0xa')](),controller[_0x19e2('0x12')]);router[_0x19e2('0x13')](_0x19e2('0x9'),auth[_0x19e2('0xa')](),controller['destroy']);module[_0x19e2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index db2247c..666cadb 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 _0x6124=['STRING','sequelize','exports'];(function(_0x36bd78,_0x5d9860){var _0x2111b3=function(_0x407c52){while(--_0x407c52){_0x36bd78['push'](_0x36bd78['shift']());}};_0x2111b3(++_0x5d9860);}(_0x6124,0x1a5));var _0x4612=function(_0x1a544f,_0x1f5a8c){_0x1a544f=_0x1a544f-0x0;var _0x3ea514=_0x6124[_0x1a544f];return _0x3ea514;};'use strict';var Sequelize=require(_0x4612('0x0'));module[_0x4612('0x1')]={'name':{'type':Sequelize[_0x4612('0x2')]},'description':{'type':Sequelize[_0x4612('0x2')]}}; \ No newline at end of file +var _0x2a00=['STRING','sequelize'];(function(_0x533228,_0x21356e){var _0xf2792b=function(_0x223bfb){while(--_0x223bfb){_0x533228['push'](_0x533228['shift']());}};_0xf2792b(++_0x21356e);}(_0x2a00,0x12b));var _0x02a0=function(_0x3a5c68,_0x2e2c7b){_0x3a5c68=_0x3a5c68-0x0;var _0x127add=_0x2a00[_0x3a5c68];return _0x127add;};'use strict';var Sequelize=require(_0x02a0('0x0'));module['exports']={'name':{'type':Sequelize[_0x02a0('0x1')]},'description':{'type':Sequelize[_0x02a0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 9ac5d02..a456eaf 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 _0x4cb4=['getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','merge','where','map','type','VIRTUAL','options','FreshsalesConfiguration','count','includeAll','include','findAll','rows','show','length','find','catch','create','body','params','destroy'];(function(_0x1ac6d3,_0x6c3955){var _0x1e4634=function(_0x43d9a7){while(--_0x43d9a7){_0x1ac6d3['push'](_0x1ac6d3['shift']());}};_0x1e4634(++_0x6c3955);}(_0x4cb4,0xac));var _0x44cb=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0x4cb4[_0x4429e0];return _0x51a5b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x44cb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44cb('0x1'));var rp=require(_0x44cb('0x2'));var moment=require(_0x44cb('0x3'));var BPromise=require(_0x44cb('0x4'));var Mustache=require(_0x44cb('0x5'));var util=require(_0x44cb('0x6'));var path=require('path');var sox=require(_0x44cb('0x7'));var csv=require('to-csv');var ejs=require(_0x44cb('0x8'));var fs=require('fs');var fs_extra=require(_0x44cb('0x9'));var _=require(_0x44cb('0xa'));var squel=require(_0x44cb('0xb'));var crypto=require(_0x44cb('0xc'));var jsforce=require(_0x44cb('0xd'));var deskjs=require(_0x44cb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x44cb('0xf'));var Redis=require(_0x44cb('0x10'));var authService=require(_0x44cb('0x11'));var qs=require(_0x44cb('0x12'));var as=require(_0x44cb('0x13'));var hardwareService=require(_0x44cb('0x14'));var logger=require(_0x44cb('0x15'))(_0x44cb('0x16'));var utils=require(_0x44cb('0x17'));var config=require(_0x44cb('0x18'));var licenseUtil=require(_0x44cb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x480a0f,_0x499ef2){_0x499ef2=_0x499ef2||0xcc;return function(_0x327ab6){if(_0x327ab6){return _0x480a0f[_0x44cb('0x1a')](_0x499ef2);}return _0x480a0f[_0x44cb('0x1b')](_0x499ef2)[_0x44cb('0x1c')]();};}function respondWithResult(_0x2ac86f,_0x281b81){_0x281b81=_0x281b81||0xc8;return function(_0x492d0e){if(_0x492d0e){return _0x2ac86f[_0x44cb('0x1b')](_0x281b81)[_0x44cb('0x1d')](_0x492d0e);}};}function respondWithFilteredResult(_0x142979,_0x2eb04b){return function(_0x4919b3){if(_0x4919b3){var _0x50a06c=typeof _0x2eb04b[_0x44cb('0x1e')]==='undefined'&&typeof _0x2eb04b[_0x44cb('0x1f')]===_0x44cb('0x20');var _0x46d941=_0x4919b3['count'];var _0x48823a=_0x50a06c?0x0:_0x2eb04b[_0x44cb('0x1e')];var _0x12d3aa=_0x50a06c?_0x4919b3['count']:_0x2eb04b[_0x44cb('0x1e')]+_0x2eb04b[_0x44cb('0x1f')];var _0xa973b1;if(_0x12d3aa>=_0x46d941){_0x12d3aa=_0x46d941;_0xa973b1=0xc8;}else{_0xa973b1=0xce;}_0x142979['status'](_0xa973b1);return _0x142979['set'](_0x44cb('0x21'),_0x48823a+'-'+_0x12d3aa+'/'+_0x46d941)[_0x44cb('0x1d')](_0x4919b3);}return null;};}function patchUpdates(_0x1aaa21){return function(_0xfe34a6){try{jsonpatch[_0x44cb('0x22')](_0xfe34a6,_0x1aaa21,!![]);}catch(_0x113ccf){return BPromise[_0x44cb('0x23')](_0x113ccf);}return _0xfe34a6[_0x44cb('0x24')]();};}function saveUpdates(_0x18f3e4,_0x433864){return function(_0x57dfc7){if(_0x57dfc7){return _0x57dfc7[_0x44cb('0x25')](_0x18f3e4)[_0x44cb('0x26')](function(_0x32ab30){return _0x32ab30;});}return null;};}function removeEntity(_0x31e956,_0x1b535c){return function(_0x57e25c){if(_0x57e25c){return _0x57e25c['destroy']()[_0x44cb('0x26')](function(){_0x31e956[_0x44cb('0x1b')](0xcc)[_0x44cb('0x1c')]();});}};}function handleEntityNotFound(_0x1aa82c,_0x29fbd0){return function(_0x3bb29a){if(!_0x3bb29a){_0x1aa82c['sendStatus'](0x194);}return _0x3bb29a;};}function handleError(_0x596735,_0x2d4075){_0x2d4075=_0x2d4075||0x1f4;return function(_0x332375){logger[_0x44cb('0x27')](_0x332375[_0x44cb('0x28')]);if(_0x332375[_0x44cb('0x29')]){delete _0x332375[_0x44cb('0x29')];}_0x596735['status'](_0x2d4075)[_0x44cb('0x2a')](_0x332375);};}exports['index']=function(_0x3a95a3,_0x31b6b5){var _0x386862={},_0x5b1201={},_0x56bb02={'count':0x0,'rows':[]};var _0x32529d=_['map'](db['FreshsalesConfiguration'][_0x44cb('0x2b')],function(_0x48631c){return{'name':_0x48631c[_0x44cb('0x2c')],'type':_0x48631c['type']['key']};});_0x5b1201[_0x44cb('0x2d')]=_['map'](_0x32529d,_0x44cb('0x29'));_0x5b1201[_0x44cb('0x2e')]=_[_0x44cb('0x2f')](_0x3a95a3[_0x44cb('0x2e')]);_0x5b1201[_0x44cb('0x30')]=_[_0x44cb('0x31')](_0x5b1201[_0x44cb('0x2d')],_0x5b1201['query']);_0x386862[_0x44cb('0x32')]=_[_0x44cb('0x31')](_0x5b1201[_0x44cb('0x2d')],qs[_0x44cb('0x33')](_0x3a95a3['query'][_0x44cb('0x33')]));_0x386862[_0x44cb('0x32')]=_0x386862[_0x44cb('0x32')]['length']?_0x386862[_0x44cb('0x32')]:_0x5b1201['model'];if(!_0x3a95a3['query']['hasOwnProperty'](_0x44cb('0x34'))){_0x386862[_0x44cb('0x1f')]=qs[_0x44cb('0x1f')](_0x3a95a3[_0x44cb('0x2e')][_0x44cb('0x1f')]);_0x386862[_0x44cb('0x1e')]=qs[_0x44cb('0x1e')](_0x3a95a3[_0x44cb('0x2e')]['offset']);}_0x386862[_0x44cb('0x35')]=qs['sort'](_0x3a95a3[_0x44cb('0x2e')][_0x44cb('0x36')]);_0x386862['where']=qs['filters'](_[_0x44cb('0x37')](_0x3a95a3[_0x44cb('0x2e')],_0x5b1201[_0x44cb('0x30')]),_0x32529d);if(_0x3a95a3[_0x44cb('0x2e')][_0x44cb('0x38')]){_0x386862['where']=_[_0x44cb('0x39')](_0x386862[_0x44cb('0x3a')],{'$or':_[_0x44cb('0x3b')](_0x32529d,function(_0x378623){if(_0x378623[_0x44cb('0x3c')]!==_0x44cb('0x3d')){var _0x3f1406={};_0x3f1406[_0x378623[_0x44cb('0x29')]]={'$like':'%'+_0x3a95a3[_0x44cb('0x2e')][_0x44cb('0x38')]+'%'};return _0x3f1406;}})});}_0x386862=_[_0x44cb('0x39')]({},_0x386862,_0x3a95a3[_0x44cb('0x3e')]);var _0x2b05f3={'where':_0x386862['where']};return db[_0x44cb('0x3f')][_0x44cb('0x40')](_0x2b05f3)[_0x44cb('0x26')](function(_0x29f10f){_0x56bb02['count']=_0x29f10f;if(_0x3a95a3[_0x44cb('0x2e')][_0x44cb('0x41')]){_0x386862[_0x44cb('0x42')]=[{'all':!![]}];}return db[_0x44cb('0x3f')][_0x44cb('0x43')](_0x386862);})[_0x44cb('0x26')](function(_0x106361){_0x56bb02[_0x44cb('0x44')]=_0x106361;return _0x56bb02;})[_0x44cb('0x26')](respondWithFilteredResult(_0x31b6b5,_0x386862))['catch'](handleError(_0x31b6b5,null));};exports[_0x44cb('0x45')]=function(_0x3ff334,_0xeddf4a){var _0x11af2b={'raw':![],'where':{'id':_0x3ff334['params']['id']}},_0x1045a9={};_0x1045a9['model']=_[_0x44cb('0x2f')](db['FreshsalesConfiguration'][_0x44cb('0x2b')]);_0x1045a9[_0x44cb('0x2e')]=_[_0x44cb('0x2f')](_0x3ff334[_0x44cb('0x2e')]);_0x1045a9[_0x44cb('0x30')]=_[_0x44cb('0x31')](_0x1045a9[_0x44cb('0x2d')],_0x1045a9['query']);_0x11af2b[_0x44cb('0x32')]=_[_0x44cb('0x31')](_0x1045a9[_0x44cb('0x2d')],qs[_0x44cb('0x33')](_0x3ff334[_0x44cb('0x2e')]['fields']));_0x11af2b[_0x44cb('0x32')]=_0x11af2b[_0x44cb('0x32')][_0x44cb('0x46')]?_0x11af2b[_0x44cb('0x32')]:_0x1045a9[_0x44cb('0x2d')];if(_0x3ff334[_0x44cb('0x2e')][_0x44cb('0x41')]){_0x11af2b[_0x44cb('0x42')]=[{'all':!![]}];}_0x11af2b=_[_0x44cb('0x39')]({},_0x11af2b,_0x3ff334[_0x44cb('0x3e')]);return db[_0x44cb('0x3f')][_0x44cb('0x47')](_0x11af2b)[_0x44cb('0x26')](handleEntityNotFound(_0xeddf4a,null))[_0x44cb('0x26')](respondWithResult(_0xeddf4a,null))[_0x44cb('0x48')](handleError(_0xeddf4a,null));};exports[_0x44cb('0x49')]=function(_0x26a914,_0x36f67a){return db[_0x44cb('0x3f')]['create'](_0x26a914[_0x44cb('0x4a')],{})[_0x44cb('0x26')](respondWithResult(_0x36f67a,0xc9))[_0x44cb('0x48')](handleError(_0x36f67a,null));};exports[_0x44cb('0x25')]=function(_0x40289e,_0x591a98){if(_0x40289e[_0x44cb('0x4a')]['id']){delete _0x40289e[_0x44cb('0x4a')]['id'];}return db[_0x44cb('0x3f')][_0x44cb('0x47')]({'where':{'id':_0x40289e[_0x44cb('0x4b')]['id']}})[_0x44cb('0x26')](handleEntityNotFound(_0x591a98,null))['then'](saveUpdates(_0x40289e[_0x44cb('0x4a')],null))[_0x44cb('0x26')](respondWithResult(_0x591a98,null))[_0x44cb('0x48')](handleError(_0x591a98,null));};exports[_0x44cb('0x4c')]=function(_0x2a13a2,_0x1f52ea){return db[_0x44cb('0x3f')][_0x44cb('0x47')]({'where':{'id':_0x2a13a2['params']['id']}})['then'](handleEntityNotFound(_0x1f52ea,null))[_0x44cb('0x26')](removeEntity(_0x1f52ea,null))[_0x44cb('0x48')](handleError(_0x1f52ea,null));};exports[_0x44cb('0x4d')]=function(_0x3cdd43,_0x48c153,_0x424188){var _0x547af4={};var _0x5f4f67={};var _0x5f1946;var _0xca707c;return db[_0x44cb('0x3f')][_0x44cb('0x4e')]({'where':{'id':_0x3cdd43[_0x44cb('0x4b')]['id']}})[_0x44cb('0x26')](handleEntityNotFound(_0x48c153,null))[_0x44cb('0x26')](function(_0x42ebaa){if(_0x42ebaa){_0x5f1946=_0x42ebaa;_0x5f4f67[_0x44cb('0x2d')]=_[_0x44cb('0x2f')](db[_0x44cb('0x4f')][_0x44cb('0x2b')]);_0x5f4f67[_0x44cb('0x2e')]=_[_0x44cb('0x2f')](_0x3cdd43['query']);_0x5f4f67[_0x44cb('0x30')]=_[_0x44cb('0x31')](_0x5f4f67['model'],_0x5f4f67[_0x44cb('0x2e')]);_0x547af4['attributes']=_[_0x44cb('0x31')](_0x5f4f67[_0x44cb('0x2d')],qs[_0x44cb('0x33')](_0x3cdd43['query']['fields']));_0x547af4[_0x44cb('0x32')]=_0x547af4[_0x44cb('0x32')][_0x44cb('0x46')]?_0x547af4['attributes']:_0x5f4f67[_0x44cb('0x2d')];_0x547af4[_0x44cb('0x35')]=qs[_0x44cb('0x36')](_0x3cdd43[_0x44cb('0x2e')][_0x44cb('0x36')]);_0x547af4[_0x44cb('0x3a')]=qs[_0x44cb('0x30')](_[_0x44cb('0x37')](_0x3cdd43[_0x44cb('0x2e')],_0x5f4f67[_0x44cb('0x30')]));if(_0x3cdd43['query'][_0x44cb('0x38')]){_0x547af4['where']=_[_0x44cb('0x39')](_0x547af4[_0x44cb('0x3a')],{'$or':_[_0x44cb('0x3b')](_0x547af4['attributes'],function(_0xea2a37){var _0x30b6d9={};_0x30b6d9[_0xea2a37]={'$like':'%'+_0x3cdd43['query'][_0x44cb('0x38')]+'%'};return _0x30b6d9;})});}_0x547af4=_[_0x44cb('0x39')]({},_0x547af4,_0x3cdd43['options']);return _0x5f1946[_0x44cb('0x4d')](_0x547af4);}})[_0x44cb('0x26')](function(_0x5e408c){if(_0x5e408c){_0xca707c=_0x5e408c[_0x44cb('0x46')];if(!_0x3cdd43['query'][_0x44cb('0x50')]('nolimit')){_0x547af4[_0x44cb('0x1f')]=qs[_0x44cb('0x1f')](_0x3cdd43[_0x44cb('0x2e')][_0x44cb('0x1f')]);_0x547af4['offset']=qs[_0x44cb('0x1e')](_0x3cdd43[_0x44cb('0x2e')][_0x44cb('0x1e')]);}return _0x5f1946[_0x44cb('0x4d')](_0x547af4);}})[_0x44cb('0x26')](function(_0x2f5869){if(_0x2f5869){return _0x2f5869?{'count':_0xca707c,'rows':_0x2f5869}:null;}})[_0x44cb('0x26')](respondWithResult(_0x48c153,null))[_0x44cb('0x48')](handleError(_0x48c153,null));};exports['getDescriptions']=function(_0x302e49,_0x27c09e,_0x123534){var _0x115993={};var _0x4f5ca0={};var _0x5c4453;var _0x47db86;return db['FreshsalesConfiguration'][_0x44cb('0x4e')]({'where':{'id':_0x302e49[_0x44cb('0x4b')]['id']}})[_0x44cb('0x26')](handleEntityNotFound(_0x27c09e,null))[_0x44cb('0x26')](function(_0x1407cc){if(_0x1407cc){_0x5c4453=_0x1407cc;_0x4f5ca0[_0x44cb('0x2d')]=_[_0x44cb('0x2f')](db[_0x44cb('0x4f')][_0x44cb('0x2b')]);_0x4f5ca0[_0x44cb('0x2e')]=_[_0x44cb('0x2f')](_0x302e49[_0x44cb('0x2e')]);_0x4f5ca0[_0x44cb('0x30')]=_[_0x44cb('0x31')](_0x4f5ca0[_0x44cb('0x2d')],_0x4f5ca0[_0x44cb('0x2e')]);_0x115993['attributes']=_[_0x44cb('0x31')](_0x4f5ca0[_0x44cb('0x2d')],qs[_0x44cb('0x33')](_0x302e49[_0x44cb('0x2e')]['fields']));_0x115993[_0x44cb('0x32')]=_0x115993[_0x44cb('0x32')][_0x44cb('0x46')]?_0x115993[_0x44cb('0x32')]:_0x4f5ca0['model'];_0x115993[_0x44cb('0x35')]=qs[_0x44cb('0x36')](_0x302e49[_0x44cb('0x2e')][_0x44cb('0x36')]);_0x115993[_0x44cb('0x3a')]=qs[_0x44cb('0x30')](_[_0x44cb('0x37')](_0x302e49[_0x44cb('0x2e')],_0x4f5ca0[_0x44cb('0x30')]));if(_0x302e49['query'][_0x44cb('0x38')]){_0x115993[_0x44cb('0x3a')]=_['merge'](_0x115993['where'],{'$or':_[_0x44cb('0x3b')](_0x115993['attributes'],function(_0x2b7b9a){var _0x15671a={};_0x15671a[_0x2b7b9a]={'$like':'%'+_0x302e49['query'][_0x44cb('0x38')]+'%'};return _0x15671a;})});}_0x115993=_[_0x44cb('0x39')]({},_0x115993,_0x302e49[_0x44cb('0x3e')]);return _0x5c4453[_0x44cb('0x51')](_0x115993);}})[_0x44cb('0x26')](function(_0x14c66c){if(_0x14c66c){_0x47db86=_0x14c66c['length'];if(!_0x302e49[_0x44cb('0x2e')][_0x44cb('0x50')](_0x44cb('0x34'))){_0x115993[_0x44cb('0x1f')]=qs['limit'](_0x302e49[_0x44cb('0x2e')][_0x44cb('0x1f')]);_0x115993[_0x44cb('0x1e')]=qs[_0x44cb('0x1e')](_0x302e49[_0x44cb('0x2e')][_0x44cb('0x1e')]);}return _0x5c4453[_0x44cb('0x51')](_0x115993);}})['then'](function(_0x33fbc8){if(_0x33fbc8){return _0x33fbc8?{'count':_0x47db86,'rows':_0x33fbc8}:null;}})[_0x44cb('0x26')](respondWithResult(_0x27c09e,null))[_0x44cb('0x48')](handleError(_0x27c09e,null));};exports[_0x44cb('0x52')]=function(_0x30b1e1,_0x525ea8,_0x510339){var _0x1e6f2a={};var _0xfd54bf={};var _0x28f428;var _0x35e9ba;return db['FreshsalesConfiguration'][_0x44cb('0x4e')]({'where':{'id':_0x30b1e1['params']['id']}})[_0x44cb('0x26')](handleEntityNotFound(_0x525ea8,null))[_0x44cb('0x26')](function(_0xd18953){if(_0xd18953){_0x28f428=_0xd18953;_0xfd54bf[_0x44cb('0x2d')]=_[_0x44cb('0x2f')](db[_0x44cb('0x4f')]['rawAttributes']);_0xfd54bf['query']=_['keys'](_0x30b1e1[_0x44cb('0x2e')]);_0xfd54bf[_0x44cb('0x30')]=_['intersection'](_0xfd54bf[_0x44cb('0x2d')],_0xfd54bf['query']);_0x1e6f2a[_0x44cb('0x32')]=_[_0x44cb('0x31')](_0xfd54bf[_0x44cb('0x2d')],qs['fields'](_0x30b1e1[_0x44cb('0x2e')][_0x44cb('0x33')]));_0x1e6f2a['attributes']=_0x1e6f2a[_0x44cb('0x32')][_0x44cb('0x46')]?_0x1e6f2a[_0x44cb('0x32')]:_0xfd54bf[_0x44cb('0x2d')];_0x1e6f2a[_0x44cb('0x35')]=qs[_0x44cb('0x36')](_0x30b1e1[_0x44cb('0x2e')][_0x44cb('0x36')]);_0x1e6f2a[_0x44cb('0x3a')]=qs[_0x44cb('0x30')](_['pick'](_0x30b1e1[_0x44cb('0x2e')],_0xfd54bf[_0x44cb('0x30')]));if(_0x30b1e1['query']['filter']){_0x1e6f2a[_0x44cb('0x3a')]=_[_0x44cb('0x39')](_0x1e6f2a[_0x44cb('0x3a')],{'$or':_[_0x44cb('0x3b')](_0x1e6f2a[_0x44cb('0x32')],function(_0x2d1825){var _0x41e6af={};_0x41e6af[_0x2d1825]={'$like':'%'+_0x30b1e1[_0x44cb('0x2e')][_0x44cb('0x38')]+'%'};return _0x41e6af;})});}_0x1e6f2a=_[_0x44cb('0x39')]({},_0x1e6f2a,_0x30b1e1[_0x44cb('0x3e')]);return _0x28f428[_0x44cb('0x52')](_0x1e6f2a);}})[_0x44cb('0x26')](function(_0x14dee3){if(_0x14dee3){_0x35e9ba=_0x14dee3[_0x44cb('0x46')];if(!_0x30b1e1['query']['hasOwnProperty'](_0x44cb('0x34'))){_0x1e6f2a[_0x44cb('0x1f')]=qs[_0x44cb('0x1f')](_0x30b1e1[_0x44cb('0x2e')]['limit']);_0x1e6f2a[_0x44cb('0x1e')]=qs['offset'](_0x30b1e1[_0x44cb('0x2e')][_0x44cb('0x1e')]);}return _0x28f428['getFields'](_0x1e6f2a);}})['then'](function(_0x2fe134){if(_0x2fe134){return _0x2fe134?{'count':_0x35e9ba,'rows':_0x2fe134}:null;}})[_0x44cb('0x26')](respondWithResult(_0x525ea8,null))[_0x44cb('0x48')](handleError(_0x525ea8,null));}; \ No newline at end of file +var _0xc076=['save','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xc076,0x120));var _0x6c07=function(_0x4bd62e,_0x56410c){_0x4bd62e=_0x4bd62e-0x0;var _0x59bc59=_0xc076[_0x4bd62e];return _0x59bc59;};'use strict';var emlformat=require(_0x6c07('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c07('0x1'));var jsonpatch=require(_0x6c07('0x2'));var rp=require(_0x6c07('0x3'));var moment=require(_0x6c07('0x4'));var BPromise=require(_0x6c07('0x5'));var Mustache=require(_0x6c07('0x6'));var util=require(_0x6c07('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6c07('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c07('0x9'));var squel=require('squel');var crypto=require(_0x6c07('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6c07('0xb'));var toCsv=require(_0x6c07('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6c07('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6c07('0xd'));var hardwareService=require(_0x6c07('0xe'));var logger=require(_0x6c07('0xf'))(_0x6c07('0x10'));var utils=require(_0x6c07('0x11'));var config=require(_0x6c07('0x12'));var licenseUtil=require(_0x6c07('0x13'));var db=require(_0x6c07('0x14'))['db'];function respondWithStatusCode(_0x3e1bf9,_0x19d4ce){_0x19d4ce=_0x19d4ce||0xcc;return function(_0x55ff97){if(_0x55ff97){return _0x3e1bf9['sendStatus'](_0x19d4ce);}return _0x3e1bf9[_0x6c07('0x15')](_0x19d4ce)[_0x6c07('0x16')]();};}function respondWithResult(_0x4628f8,_0x56d2d5){_0x56d2d5=_0x56d2d5||0xc8;return function(_0x575197){if(_0x575197){return _0x4628f8[_0x6c07('0x15')](_0x56d2d5)['json'](_0x575197);}};}function respondWithFilteredResult(_0x1224ff,_0x2372e1){return function(_0x33e214){if(_0x33e214){var _0x338c6d=typeof _0x2372e1[_0x6c07('0x17')]===_0x6c07('0x18')&&typeof _0x2372e1[_0x6c07('0x19')]===_0x6c07('0x18');var _0x1660e3=_0x33e214['count'];var _0x1d34b9=_0x338c6d?0x0:_0x2372e1[_0x6c07('0x17')];var _0x5bfc7d=_0x338c6d?_0x33e214[_0x6c07('0x1a')]:_0x2372e1[_0x6c07('0x17')]+_0x2372e1['limit'];var _0x147b55;if(_0x5bfc7d>=_0x1660e3){_0x5bfc7d=_0x1660e3;_0x147b55=0xc8;}else{_0x147b55=0xce;}_0x1224ff[_0x6c07('0x15')](_0x147b55);return _0x1224ff[_0x6c07('0x1b')](_0x6c07('0x1c'),_0x1d34b9+'-'+_0x5bfc7d+'/'+_0x1660e3)[_0x6c07('0x1d')](_0x33e214);}return null;};}function patchUpdates(_0x6c6751){return function(_0x31758b){try{jsonpatch[_0x6c07('0x1e')](_0x31758b,_0x6c6751,!![]);}catch(_0x178912){return BPromise[_0x6c07('0x1f')](_0x178912);}return _0x31758b[_0x6c07('0x20')]();};}function saveUpdates(_0x5e5093,_0x1a5445){return function(_0x2b973e){if(_0x2b973e){return _0x2b973e['update'](_0x5e5093)[_0x6c07('0x21')](function(_0x48f6e7){return _0x48f6e7;});}return null;};}function removeEntity(_0x1e3c8a,_0x2efd6c){return function(_0x259687){if(_0x259687){return _0x259687[_0x6c07('0x22')]()['then'](function(){_0x1e3c8a[_0x6c07('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x586c0f,_0x2f243d){return function(_0x4ac4ac){if(!_0x4ac4ac){_0x586c0f[_0x6c07('0x23')](0x194);}return _0x4ac4ac;};}function handleError(_0x5082ec,_0x3edf03){_0x3edf03=_0x3edf03||0x1f4;return function(_0x3aa655){logger[_0x6c07('0x24')](_0x3aa655[_0x6c07('0x25')]);if(_0x3aa655[_0x6c07('0x26')]){delete _0x3aa655[_0x6c07('0x26')];}_0x5082ec[_0x6c07('0x15')](_0x3edf03)['send'](_0x3aa655);};}exports[_0x6c07('0x27')]=function(_0x11183b,_0x194a4d){var _0x1f93e2={},_0x3be52b={},_0x27dabc={'count':0x0,'rows':[]};var _0x2d3064=_[_0x6c07('0x28')](db[_0x6c07('0x29')][_0x6c07('0x2a')],function(_0x49cc53){return{'name':_0x49cc53[_0x6c07('0x2b')],'type':_0x49cc53['type'][_0x6c07('0x2c')]};});_0x3be52b[_0x6c07('0x2d')]=_[_0x6c07('0x28')](_0x2d3064,_0x6c07('0x26'));_0x3be52b['query']=_['keys'](_0x11183b[_0x6c07('0x2e')]);_0x3be52b[_0x6c07('0x2f')]=_['intersection'](_0x3be52b[_0x6c07('0x2d')],_0x3be52b['query']);_0x1f93e2['attributes']=_[_0x6c07('0x30')](_0x3be52b['model'],qs[_0x6c07('0x31')](_0x11183b[_0x6c07('0x2e')][_0x6c07('0x31')]));_0x1f93e2[_0x6c07('0x32')]=_0x1f93e2[_0x6c07('0x32')][_0x6c07('0x33')]?_0x1f93e2[_0x6c07('0x32')]:_0x3be52b[_0x6c07('0x2d')];if(!_0x11183b['query'][_0x6c07('0x34')](_0x6c07('0x35'))){_0x1f93e2[_0x6c07('0x19')]=qs['limit'](_0x11183b['query']['limit']);_0x1f93e2[_0x6c07('0x17')]=qs[_0x6c07('0x17')](_0x11183b[_0x6c07('0x2e')][_0x6c07('0x17')]);}_0x1f93e2[_0x6c07('0x36')]=qs[_0x6c07('0x37')](_0x11183b[_0x6c07('0x2e')]['sort']);_0x1f93e2[_0x6c07('0x38')]=qs[_0x6c07('0x2f')](_[_0x6c07('0x39')](_0x11183b['query'],_0x3be52b[_0x6c07('0x2f')]),_0x2d3064);if(_0x11183b[_0x6c07('0x2e')][_0x6c07('0x3a')]){_0x1f93e2[_0x6c07('0x38')]=_[_0x6c07('0x3b')](_0x1f93e2['where'],{'$or':_['map'](_0x2d3064,function(_0x13a883){if(_0x13a883[_0x6c07('0x3c')]!==_0x6c07('0x3d')){var _0x4ddc9f={};_0x4ddc9f[_0x13a883[_0x6c07('0x26')]]={'$like':'%'+_0x11183b['query']['filter']+'%'};return _0x4ddc9f;}})});}_0x1f93e2=_[_0x6c07('0x3b')]({},_0x1f93e2,_0x11183b['options']);var _0x3fd3a1={'where':_0x1f93e2[_0x6c07('0x38')]};return db[_0x6c07('0x29')]['count'](_0x3fd3a1)[_0x6c07('0x21')](function(_0x35fd04){_0x27dabc['count']=_0x35fd04;if(_0x11183b[_0x6c07('0x2e')][_0x6c07('0x3e')]){_0x1f93e2[_0x6c07('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x6c07('0x40')](_0x1f93e2);})[_0x6c07('0x21')](function(_0x1ee6f7){_0x27dabc[_0x6c07('0x41')]=_0x1ee6f7;return _0x27dabc;})['then'](respondWithFilteredResult(_0x194a4d,_0x1f93e2))[_0x6c07('0x42')](handleError(_0x194a4d,null));};exports[_0x6c07('0x43')]=function(_0x5461f9,_0x387649){var _0x2d0bec={'raw':![],'where':{'id':_0x5461f9[_0x6c07('0x44')]['id']}},_0x18c22c={};_0x18c22c[_0x6c07('0x2d')]=_['keys'](db[_0x6c07('0x29')]['rawAttributes']);_0x18c22c[_0x6c07('0x2e')]=_[_0x6c07('0x45')](_0x5461f9[_0x6c07('0x2e')]);_0x18c22c['filters']=_[_0x6c07('0x30')](_0x18c22c[_0x6c07('0x2d')],_0x18c22c[_0x6c07('0x2e')]);_0x2d0bec[_0x6c07('0x32')]=_[_0x6c07('0x30')](_0x18c22c['model'],qs[_0x6c07('0x31')](_0x5461f9[_0x6c07('0x2e')]['fields']));_0x2d0bec[_0x6c07('0x32')]=_0x2d0bec[_0x6c07('0x32')][_0x6c07('0x33')]?_0x2d0bec[_0x6c07('0x32')]:_0x18c22c[_0x6c07('0x2d')];if(_0x5461f9[_0x6c07('0x2e')]['includeAll']){_0x2d0bec['include']=[{'all':!![]}];}_0x2d0bec=_['merge']({},_0x2d0bec,_0x5461f9[_0x6c07('0x46')]);return db[_0x6c07('0x29')][_0x6c07('0x47')](_0x2d0bec)[_0x6c07('0x21')](handleEntityNotFound(_0x387649,null))[_0x6c07('0x21')](respondWithResult(_0x387649,null))[_0x6c07('0x42')](handleError(_0x387649,null));};exports[_0x6c07('0x48')]=function(_0x34f5b5,_0xde5abf){return db[_0x6c07('0x29')][_0x6c07('0x48')](_0x34f5b5[_0x6c07('0x49')],{})[_0x6c07('0x21')](respondWithResult(_0xde5abf,0xc9))['catch'](handleError(_0xde5abf,null));};exports[_0x6c07('0x4a')]=function(_0x33f494,_0x3497d2){if(_0x33f494[_0x6c07('0x49')]['id']){delete _0x33f494[_0x6c07('0x49')]['id'];}return db['FreshsalesConfiguration'][_0x6c07('0x47')]({'where':{'id':_0x33f494[_0x6c07('0x44')]['id']}})[_0x6c07('0x21')](handleEntityNotFound(_0x3497d2,null))[_0x6c07('0x21')](saveUpdates(_0x33f494[_0x6c07('0x49')],null))['then'](respondWithResult(_0x3497d2,null))[_0x6c07('0x42')](handleError(_0x3497d2,null));};exports[_0x6c07('0x22')]=function(_0x3275a6,_0x19cae5){return db[_0x6c07('0x29')]['find']({'where':{'id':_0x3275a6[_0x6c07('0x44')]['id']}})[_0x6c07('0x21')](handleEntityNotFound(_0x19cae5,null))[_0x6c07('0x21')](removeEntity(_0x19cae5,null))[_0x6c07('0x42')](handleError(_0x19cae5,null));};exports[_0x6c07('0x4b')]=function(_0x4f5a3d,_0x98774d,_0x140b6e){var _0x2bff43={};var _0x428ddd={};var _0x422423;var _0x718c6b;return db[_0x6c07('0x29')][_0x6c07('0x4c')]({'where':{'id':_0x4f5a3d['params']['id']}})[_0x6c07('0x21')](handleEntityNotFound(_0x98774d,null))['then'](function(_0x146897){if(_0x146897){_0x422423=_0x146897;_0x428ddd[_0x6c07('0x2d')]=_[_0x6c07('0x45')](db[_0x6c07('0x4d')][_0x6c07('0x2a')]);_0x428ddd[_0x6c07('0x2e')]=_[_0x6c07('0x45')](_0x4f5a3d['query']);_0x428ddd[_0x6c07('0x2f')]=_[_0x6c07('0x30')](_0x428ddd['model'],_0x428ddd[_0x6c07('0x2e')]);_0x2bff43[_0x6c07('0x32')]=_[_0x6c07('0x30')](_0x428ddd[_0x6c07('0x2d')],qs[_0x6c07('0x31')](_0x4f5a3d[_0x6c07('0x2e')][_0x6c07('0x31')]));_0x2bff43[_0x6c07('0x32')]=_0x2bff43[_0x6c07('0x32')]['length']?_0x2bff43[_0x6c07('0x32')]:_0x428ddd[_0x6c07('0x2d')];_0x2bff43[_0x6c07('0x36')]=qs[_0x6c07('0x37')](_0x4f5a3d['query'][_0x6c07('0x37')]);_0x2bff43[_0x6c07('0x38')]=qs[_0x6c07('0x2f')](_['pick'](_0x4f5a3d[_0x6c07('0x2e')],_0x428ddd[_0x6c07('0x2f')]));if(_0x4f5a3d['query'][_0x6c07('0x3a')]){_0x2bff43['where']=_[_0x6c07('0x3b')](_0x2bff43[_0x6c07('0x38')],{'$or':_[_0x6c07('0x28')](_0x2bff43['attributes'],function(_0x2b3d46){var _0x29188f={};_0x29188f[_0x2b3d46]={'$like':'%'+_0x4f5a3d[_0x6c07('0x2e')]['filter']+'%'};return _0x29188f;})});}_0x2bff43=_[_0x6c07('0x3b')]({},_0x2bff43,_0x4f5a3d['options']);return _0x422423[_0x6c07('0x4b')](_0x2bff43);}})['then'](function(_0x4179da){if(_0x4179da){_0x718c6b=_0x4179da[_0x6c07('0x33')];if(!_0x4f5a3d['query'][_0x6c07('0x34')]('nolimit')){_0x2bff43[_0x6c07('0x19')]=qs[_0x6c07('0x19')](_0x4f5a3d['query'][_0x6c07('0x19')]);_0x2bff43[_0x6c07('0x17')]=qs['offset'](_0x4f5a3d[_0x6c07('0x2e')][_0x6c07('0x17')]);}return _0x422423[_0x6c07('0x4b')](_0x2bff43);}})['then'](function(_0x2ce531){if(_0x2ce531){return _0x2ce531?{'count':_0x718c6b,'rows':_0x2ce531}:null;}})[_0x6c07('0x21')](respondWithResult(_0x98774d,null))[_0x6c07('0x42')](handleError(_0x98774d,null));};exports[_0x6c07('0x4e')]=function(_0x47597a,_0x170653,_0x224956){var _0x3eaa45={};var _0x3b2b08={};var _0x34a100;var _0x328213;return db[_0x6c07('0x29')]['findOne']({'where':{'id':_0x47597a[_0x6c07('0x44')]['id']}})[_0x6c07('0x21')](handleEntityNotFound(_0x170653,null))[_0x6c07('0x21')](function(_0x132977){if(_0x132977){_0x34a100=_0x132977;_0x3b2b08[_0x6c07('0x2d')]=_[_0x6c07('0x45')](db[_0x6c07('0x4d')]['rawAttributes']);_0x3b2b08[_0x6c07('0x2e')]=_[_0x6c07('0x45')](_0x47597a[_0x6c07('0x2e')]);_0x3b2b08[_0x6c07('0x2f')]=_['intersection'](_0x3b2b08['model'],_0x3b2b08[_0x6c07('0x2e')]);_0x3eaa45['attributes']=_['intersection'](_0x3b2b08[_0x6c07('0x2d')],qs[_0x6c07('0x31')](_0x47597a['query'][_0x6c07('0x31')]));_0x3eaa45[_0x6c07('0x32')]=_0x3eaa45['attributes'][_0x6c07('0x33')]?_0x3eaa45[_0x6c07('0x32')]:_0x3b2b08[_0x6c07('0x2d')];_0x3eaa45[_0x6c07('0x36')]=qs[_0x6c07('0x37')](_0x47597a[_0x6c07('0x2e')][_0x6c07('0x37')]);_0x3eaa45[_0x6c07('0x38')]=qs[_0x6c07('0x2f')](_['pick'](_0x47597a[_0x6c07('0x2e')],_0x3b2b08['filters']));if(_0x47597a[_0x6c07('0x2e')][_0x6c07('0x3a')]){_0x3eaa45[_0x6c07('0x38')]=_[_0x6c07('0x3b')](_0x3eaa45[_0x6c07('0x38')],{'$or':_[_0x6c07('0x28')](_0x3eaa45[_0x6c07('0x32')],function(_0x25a609){var _0x397da5={};_0x397da5[_0x25a609]={'$like':'%'+_0x47597a['query'][_0x6c07('0x3a')]+'%'};return _0x397da5;})});}_0x3eaa45=_[_0x6c07('0x3b')]({},_0x3eaa45,_0x47597a[_0x6c07('0x46')]);return _0x34a100[_0x6c07('0x4e')](_0x3eaa45);}})['then'](function(_0x395abb){if(_0x395abb){_0x328213=_0x395abb[_0x6c07('0x33')];if(!_0x47597a['query']['hasOwnProperty'](_0x6c07('0x35'))){_0x3eaa45['limit']=qs['limit'](_0x47597a[_0x6c07('0x2e')][_0x6c07('0x19')]);_0x3eaa45['offset']=qs[_0x6c07('0x17')](_0x47597a['query'][_0x6c07('0x17')]);}return _0x34a100[_0x6c07('0x4e')](_0x3eaa45);}})[_0x6c07('0x21')](function(_0x56e123){if(_0x56e123){return _0x56e123?{'count':_0x328213,'rows':_0x56e123}:null;}})[_0x6c07('0x21')](respondWithResult(_0x170653,null))[_0x6c07('0x42')](handleError(_0x170653,null));};exports[_0x6c07('0x4f')]=function(_0x2efffc,_0x36ece6,_0x283a38){var _0x3358bb={};var _0x44fcc4={};var _0x32c6e0;var _0x41903c;return db[_0x6c07('0x29')][_0x6c07('0x4c')]({'where':{'id':_0x2efffc[_0x6c07('0x44')]['id']}})[_0x6c07('0x21')](handleEntityNotFound(_0x36ece6,null))['then'](function(_0x165ea1){if(_0x165ea1){_0x32c6e0=_0x165ea1;_0x44fcc4[_0x6c07('0x2d')]=_[_0x6c07('0x45')](db[_0x6c07('0x4d')][_0x6c07('0x2a')]);_0x44fcc4[_0x6c07('0x2e')]=_[_0x6c07('0x45')](_0x2efffc['query']);_0x44fcc4[_0x6c07('0x2f')]=_[_0x6c07('0x30')](_0x44fcc4[_0x6c07('0x2d')],_0x44fcc4[_0x6c07('0x2e')]);_0x3358bb[_0x6c07('0x32')]=_[_0x6c07('0x30')](_0x44fcc4[_0x6c07('0x2d')],qs[_0x6c07('0x31')](_0x2efffc[_0x6c07('0x2e')][_0x6c07('0x31')]));_0x3358bb[_0x6c07('0x32')]=_0x3358bb['attributes'][_0x6c07('0x33')]?_0x3358bb[_0x6c07('0x32')]:_0x44fcc4[_0x6c07('0x2d')];_0x3358bb[_0x6c07('0x36')]=qs[_0x6c07('0x37')](_0x2efffc[_0x6c07('0x2e')][_0x6c07('0x37')]);_0x3358bb[_0x6c07('0x38')]=qs[_0x6c07('0x2f')](_['pick'](_0x2efffc[_0x6c07('0x2e')],_0x44fcc4[_0x6c07('0x2f')]));if(_0x2efffc[_0x6c07('0x2e')]['filter']){_0x3358bb['where']=_[_0x6c07('0x3b')](_0x3358bb[_0x6c07('0x38')],{'$or':_['map'](_0x3358bb['attributes'],function(_0x47bc8a){var _0x5be936={};_0x5be936[_0x47bc8a]={'$like':'%'+_0x2efffc[_0x6c07('0x2e')][_0x6c07('0x3a')]+'%'};return _0x5be936;})});}_0x3358bb=_[_0x6c07('0x3b')]({},_0x3358bb,_0x2efffc[_0x6c07('0x46')]);return _0x32c6e0['getFields'](_0x3358bb);}})['then'](function(_0x4a471b){if(_0x4a471b){_0x41903c=_0x4a471b[_0x6c07('0x33')];if(!_0x2efffc[_0x6c07('0x2e')]['hasOwnProperty'](_0x6c07('0x35'))){_0x3358bb[_0x6c07('0x19')]=qs[_0x6c07('0x19')](_0x2efffc[_0x6c07('0x2e')][_0x6c07('0x19')]);_0x3358bb[_0x6c07('0x17')]=qs[_0x6c07('0x17')](_0x2efffc[_0x6c07('0x2e')]['offset']);}return _0x32c6e0[_0x6c07('0x4f')](_0x3358bb);}})[_0x6c07('0x21')](function(_0x4d44ad){if(_0x4d44ad){return _0x4d44ad?{'count':_0x41903c,'rows':_0x4d44ad}:null;}})[_0x6c07('0x21')](respondWithResult(_0x36ece6,null))[_0x6c07('0x42')](handleError(_0x36ece6,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 62fb30c..1d6b19f 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 _0x9f93=['rimraf','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b09cb,_0xba8b05){var _0x4ce113=function(_0x341365){while(--_0x341365){_0x5b09cb['push'](_0x5b09cb['shift']());}};_0x4ce113(++_0xba8b05);}(_0x9f93,0x1b2));var _0x39f9=function(_0x36fe3a,_0x14c406){_0x36fe3a=_0x36fe3a-0x0;var _0x465273=_0x9f93[_0x36fe3a];return _0x465273;};'use strict';var _=require(_0x39f9('0x0'));var util=require(_0x39f9('0x1'));var logger=require(_0x39f9('0x2'))(_0x39f9('0x3'));var moment=require(_0x39f9('0x4'));var BPromise=require(_0x39f9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x39f9('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x5af0e2,_0x272f27){return _0x5af0e2[_0x39f9('0x7')](_0x39f9('0x8'),attributes,{'tableName':_0x39f9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60e8=['bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x60e8,0x152));var _0x860e=function(_0xcd8930,_0x483328){_0xcd8930=_0xcd8930-0x0;var _0x236ecb=_0x60e8[_0xcd8930];return _0x236ecb;};'use strict';var _=require(_0x860e('0x0'));var util=require('util');var logger=require(_0x860e('0x1'))('api');var moment=require(_0x860e('0x2'));var BPromise=require(_0x860e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x860e('0x4'));var rimraf=require(_0x860e('0x5'));var config=require(_0x860e('0x6'));var attributes=require(_0x860e('0x7'));module['exports']=function(_0x119396,_0x5124ec){return _0x119396[_0x860e('0x8')](_0x860e('0x9'),attributes,{'tableName':_0x860e('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 dde57ad..880af32 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 _0x86aa=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x86aa,0xed));var _0xa86a=function(_0x21fa69,_0x363b5a){_0x21fa69=_0x21fa69-0x0;var _0x30d165=_0x86aa[_0x21fa69];return _0x30d165;};'use strict';var _=require(_0xa86a('0x0'));var util=require('util');var moment=require(_0xa86a('0x1'));var BPromise=require(_0xa86a('0x2'));var rs=require(_0xa86a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa86a('0x4'))['db'];var utils=require(_0xa86a('0x5'));var logger=require(_0xa86a('0x6'))(_0xa86a('0x7'));var config=require('../../config/environment');var jayson=require(_0xa86a('0x8'));var client=jayson[_0xa86a('0x9')][_0xa86a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4082c6,_0x3be22d,_0x191613){return new BPromise(function(_0x1f57cb,_0x2e5198){return client[_0xa86a('0xb')](_0x4082c6,_0x191613)[_0xa86a('0xc')](function(_0x500193){logger['info'](_0xa86a('0xd'),_0x3be22d,_0xa86a('0xe'));logger[_0xa86a('0xf')](_0xa86a('0x10'),_0x3be22d,_0xa86a('0xe'),JSON[_0xa86a('0x11')](_0x500193));if(_0x500193[_0xa86a('0x12')]){if(_0x500193[_0xa86a('0x12')][_0xa86a('0x13')]===0x1f4){logger['error'](_0xa86a('0xd'),_0x3be22d,_0x500193[_0xa86a('0x12')][_0xa86a('0x14')]);return _0x2e5198(_0x500193[_0xa86a('0x12')][_0xa86a('0x14')]);}logger[_0xa86a('0x12')](_0xa86a('0xd'),_0x3be22d,_0x500193[_0xa86a('0x12')][_0xa86a('0x14')]);return _0x1f57cb(_0x500193[_0xa86a('0x12')][_0xa86a('0x14')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x3be22d,'request\x20sent');_0x1f57cb(_0x500193[_0xa86a('0x15')][_0xa86a('0x14')]);}})[_0xa86a('0x16')](function(_0x540f60){logger[_0xa86a('0x12')](_0xa86a('0xd'),_0x3be22d,_0x540f60);_0x2e5198(_0x540f60);});});} \ No newline at end of file +var _0xc062=['client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','jayson/promise'];(function(_0x12c3d1,_0x3c6ae7){var _0x282840=function(_0x4ae0d2){while(--_0x4ae0d2){_0x12c3d1['push'](_0x12c3d1['shift']());}};_0x282840(++_0x3c6ae7);}(_0xc062,0x104));var _0x2c06=function(_0x4fe260,_0x885346){_0x4fe260=_0x4fe260-0x0;var _0x2d95d1=_0xc062[_0x4fe260];return _0x2d95d1;};'use strict';var _=require(_0x2c06('0x0'));var util=require(_0x2c06('0x1'));var moment=require(_0x2c06('0x2'));var BPromise=require(_0x2c06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c06('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2c06('0x5'));var client=jayson[_0x2c06('0x6')][_0x2c06('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x25251a,_0x5abcec,_0x4d77b1){return new BPromise(function(_0x577b12,_0x1b445f){return client[_0x2c06('0x8')](_0x25251a,_0x4d77b1)[_0x2c06('0x9')](function(_0x2540a6){logger['info'](_0x2c06('0xa'),_0x5abcec,_0x2c06('0xb'));logger[_0x2c06('0xc')](_0x2c06('0xd'),_0x5abcec,_0x2c06('0xb'),JSON[_0x2c06('0xe')](_0x2540a6));if(_0x2540a6[_0x2c06('0xf')]){if(_0x2540a6[_0x2c06('0xf')]['code']===0x1f4){logger['error'](_0x2c06('0xa'),_0x5abcec,_0x2540a6[_0x2c06('0xf')]['message']);return _0x1b445f(_0x2540a6[_0x2c06('0xf')][_0x2c06('0x10')]);}logger[_0x2c06('0xf')](_0x2c06('0xa'),_0x5abcec,_0x2540a6[_0x2c06('0xf')][_0x2c06('0x10')]);return _0x577b12(_0x2540a6[_0x2c06('0xf')][_0x2c06('0x10')]);}else{logger['info'](_0x2c06('0xa'),_0x5abcec,'request\x20sent');_0x577b12(_0x2540a6[_0x2c06('0x11')][_0x2c06('0x10')]);}})[_0x2c06('0x12')](function(_0x190321){logger['error'](_0x2c06('0xa'),_0x5abcec,_0x190321);_0x1b445f(_0x190321);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8354868..5652048 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 _0x1bb2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1bb2,0x152));var _0x21bb=function(_0xed94af,_0x426703){_0xed94af=_0xed94af-0x0;var _0x1f5e8d=_0x1bb2[_0xed94af];return _0x1f5e8d;};'use strict';var multer=require('multer');var util=require(_0x21bb('0x0'));var path=require(_0x21bb('0x1'));var timeout=require(_0x21bb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x21bb('0x3'));var auth=require(_0x21bb('0x4'));var interaction=require(_0x21bb('0x5'));var config=require(_0x21bb('0x6'));var controller=require(_0x21bb('0x7'));router[_0x21bb('0x8')]('/',auth[_0x21bb('0x9')](),controller[_0x21bb('0xa')]);router[_0x21bb('0x8')](_0x21bb('0xb'),auth[_0x21bb('0x9')](),controller[_0x21bb('0xc')]);router['post']('/',auth[_0x21bb('0x9')](),controller['create']);router[_0x21bb('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x21bb('0xe')]);router[_0x21bb('0xf')](_0x21bb('0xb'),auth[_0x21bb('0x9')](),controller[_0x21bb('0x10')]);module[_0x21bb('0x11')]=router; \ No newline at end of file +var _0x7834=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x7834,0x13f));var _0x4783=function(_0x4b3300,_0x1137f1){_0x4b3300=_0x4b3300-0x0;var _0x2d26d3=_0x7834[_0x4b3300];return _0x2d26d3;};'use strict';var multer=require(_0x4783('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4783('0x1'));var express=require('express');var router=express[_0x4783('0x2')]();var fs_extra=require(_0x4783('0x3'));var auth=require(_0x4783('0x4'));var interaction=require(_0x4783('0x5'));var config=require(_0x4783('0x6'));var controller=require(_0x4783('0x7'));router[_0x4783('0x8')]('/',auth['isAuthenticated'](),controller[_0x4783('0x9')]);router[_0x4783('0x8')]('/:id',auth[_0x4783('0xa')](),controller[_0x4783('0xb')]);router[_0x4783('0xc')]('/',auth[_0x4783('0xa')](),controller[_0x4783('0xd')]);router[_0x4783('0xe')]('/:id',auth[_0x4783('0xa')](),controller[_0x4783('0xf')]);router[_0x4783('0x10')](_0x4783('0x11'),auth[_0x4783('0xa')](),controller[_0x4783('0x12')]);module[_0x4783('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 4191a11..2b2b4a6 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 _0x1e61=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','picklist'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x1e61,0x92));var _0x11e6=function(_0x2ef492,_0x216732){_0x2ef492=_0x2ef492-0x0;var _0x3e66ac=_0x1e61[_0x2ef492];return _0x3e66ac;};'use strict';var Sequelize=require(_0x11e6('0x0'));module['exports']={'type':{'type':Sequelize[_0x11e6('0x1')](_0x11e6('0x2'),_0x11e6('0x3'),_0x11e6('0x4'),'keyValue',_0x11e6('0x5')),'defaultValue':_0x11e6('0x2')},'content':{'type':Sequelize[_0x11e6('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x11e6('0x1')](_0x11e6('0x2'),_0x11e6('0x3'),_0x11e6('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x11e6('0x6')]},'nameField':{'type':Sequelize[_0x11e6('0x6')]},'customField':{'type':Sequelize[_0x11e6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11e6('0x6')]}}; \ No newline at end of file +var _0x3e54=['picklist','STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x24cf6e,_0x1da6e7){var _0x1181c5=function(_0x24a21a){while(--_0x24a21a){_0x24cf6e['push'](_0x24cf6e['shift']());}};_0x1181c5(++_0x1da6e7);}(_0x3e54,0x1bc));var _0x43e5=function(_0x1a2a36,_0x547484){_0x1a2a36=_0x1a2a36-0x0;var _0x1f7578=_0x3e54[_0x1a2a36];return _0x1f7578;};'use strict';var Sequelize=require(_0x43e5('0x0'));module[_0x43e5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x43e5('0x2'),_0x43e5('0x3'),_0x43e5('0x4'),_0x43e5('0x5'),_0x43e5('0x6')),'defaultValue':_0x43e5('0x2')},'content':{'type':Sequelize[_0x43e5('0x7')]},'key':{'type':Sequelize[_0x43e5('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x43e5('0x2'),_0x43e5('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x43e5('0x7')]},'idField':{'type':Sequelize[_0x43e5('0x7')]},'nameField':{'type':Sequelize[_0x43e5('0x7')]},'customField':{'type':Sequelize[_0x43e5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x43e5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1d0d90e..043c82b 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 _0x0e82=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','catch','params','find','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','map','rawAttributes','type','key'];(function(_0x2d0c83,_0x53551d){var _0x476504=function(_0x3b5af8){while(--_0x3b5af8){_0x2d0c83['push'](_0x2d0c83['shift']());}};_0x476504(++_0x53551d);}(_0x0e82,0x11f));var _0x20e8=function(_0x9ae685,_0x2c6652){_0x9ae685=_0x9ae685-0x0;var _0x4c492e=_0x0e82[_0x9ae685];return _0x4c492e;};'use strict';var emlformat=require(_0x20e8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20e8('0x1'));var rp=require(_0x20e8('0x2'));var moment=require('moment');var BPromise=require(_0x20e8('0x3'));var Mustache=require(_0x20e8('0x4'));var util=require(_0x20e8('0x5'));var path=require('path');var sox=require(_0x20e8('0x6'));var csv=require(_0x20e8('0x7'));var ejs=require(_0x20e8('0x8'));var fs=require('fs');var fs_extra=require(_0x20e8('0x9'));var _=require(_0x20e8('0xa'));var squel=require(_0x20e8('0xb'));var crypto=require(_0x20e8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20e8('0x7'));var querystring=require(_0x20e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x20e8('0xe'));var authService=require(_0x20e8('0xf'));var qs=require(_0x20e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20e8('0x11'));var logger=require('../../config/logger')(_0x20e8('0x12'));var utils=require('../../config/utils');var config=require(_0x20e8('0x13'));var licenseUtil=require(_0x20e8('0x14'));var db=require(_0x20e8('0x15'))['db'];function respondWithStatusCode(_0x376fd9,_0x4d1798){_0x4d1798=_0x4d1798||0xcc;return function(_0x53df6c){if(_0x53df6c){return _0x376fd9[_0x20e8('0x16')](_0x4d1798);}return _0x376fd9[_0x20e8('0x17')](_0x4d1798)['end']();};}function respondWithResult(_0x5cedc8,_0x4341fe){_0x4341fe=_0x4341fe||0xc8;return function(_0x3c3021){if(_0x3c3021){return _0x5cedc8['status'](_0x4341fe)[_0x20e8('0x18')](_0x3c3021);}};}function respondWithFilteredResult(_0x572fee,_0x10966d){return function(_0x549883){if(_0x549883){var _0x414f76=typeof _0x10966d['offset']===_0x20e8('0x19')&&typeof _0x10966d['limit']===_0x20e8('0x19');var _0x1c38ba=_0x549883[_0x20e8('0x1a')];var _0x54c0e4=_0x414f76?0x0:_0x10966d['offset'];var _0x44cadd=_0x414f76?_0x549883['count']:_0x10966d[_0x20e8('0x1b')]+_0x10966d[_0x20e8('0x1c')];var _0x5c480e;if(_0x44cadd>=_0x1c38ba){_0x44cadd=_0x1c38ba;_0x5c480e=0xc8;}else{_0x5c480e=0xce;}_0x572fee[_0x20e8('0x17')](_0x5c480e);return _0x572fee[_0x20e8('0x1d')](_0x20e8('0x1e'),_0x54c0e4+'-'+_0x44cadd+'/'+_0x1c38ba)[_0x20e8('0x18')](_0x549883);}return null;};}function patchUpdates(_0x5ee71a){return function(_0x1a05a6){try{jsonpatch[_0x20e8('0x1f')](_0x1a05a6,_0x5ee71a,!![]);}catch(_0x3d21f0){return BPromise[_0x20e8('0x20')](_0x3d21f0);}return _0x1a05a6['save']();};}function saveUpdates(_0x58b1a2,_0x54c814){return function(_0x1e5a9a){if(_0x1e5a9a){return _0x1e5a9a[_0x20e8('0x21')](_0x58b1a2)[_0x20e8('0x22')](function(_0x39a6bc){return _0x39a6bc;});}return null;};}function removeEntity(_0x32fea0,_0x1554b0){return function(_0x4f3aa3){if(_0x4f3aa3){return _0x4f3aa3[_0x20e8('0x23')]()[_0x20e8('0x22')](function(){_0x32fea0[_0x20e8('0x17')](0xcc)[_0x20e8('0x24')]();});}};}function handleEntityNotFound(_0x5dddcf,_0x5a7d10){return function(_0xad546f){if(!_0xad546f){_0x5dddcf[_0x20e8('0x16')](0x194);}return _0xad546f;};}function handleError(_0xbfcac4,_0x533c89){_0x533c89=_0x533c89||0x1f4;return function(_0x2233e6){logger['error'](_0x2233e6[_0x20e8('0x25')]);if(_0x2233e6[_0x20e8('0x26')]){delete _0x2233e6[_0x20e8('0x26')];}_0xbfcac4[_0x20e8('0x17')](_0x533c89)['send'](_0x2233e6);};}exports['index']=function(_0x37585b,_0x3df506){var _0x10b01e={},_0x319f2d={},_0x135933={'count':0x0,'rows':[]};var _0x4e9ffb=_[_0x20e8('0x27')](db['FreshsalesField'][_0x20e8('0x28')],function(_0x42e24d){return{'name':_0x42e24d['fieldName'],'type':_0x42e24d[_0x20e8('0x29')][_0x20e8('0x2a')]};});_0x319f2d[_0x20e8('0x2b')]=_[_0x20e8('0x27')](_0x4e9ffb,_0x20e8('0x26'));_0x319f2d[_0x20e8('0x2c')]=_['keys'](_0x37585b[_0x20e8('0x2c')]);_0x319f2d[_0x20e8('0x2d')]=_[_0x20e8('0x2e')](_0x319f2d[_0x20e8('0x2b')],_0x319f2d[_0x20e8('0x2c')]);_0x10b01e[_0x20e8('0x2f')]=_[_0x20e8('0x2e')](_0x319f2d[_0x20e8('0x2b')],qs['fields'](_0x37585b[_0x20e8('0x2c')][_0x20e8('0x30')]));_0x10b01e[_0x20e8('0x2f')]=_0x10b01e['attributes'][_0x20e8('0x31')]?_0x10b01e['attributes']:_0x319f2d[_0x20e8('0x2b')];if(!_0x37585b[_0x20e8('0x2c')][_0x20e8('0x32')]('nolimit')){_0x10b01e[_0x20e8('0x1c')]=qs[_0x20e8('0x1c')](_0x37585b[_0x20e8('0x2c')][_0x20e8('0x1c')]);_0x10b01e[_0x20e8('0x1b')]=qs[_0x20e8('0x1b')](_0x37585b[_0x20e8('0x2c')]['offset']);}_0x10b01e['order']=qs[_0x20e8('0x33')](_0x37585b['query'][_0x20e8('0x33')]);_0x10b01e[_0x20e8('0x34')]=qs[_0x20e8('0x2d')](_[_0x20e8('0x35')](_0x37585b['query'],_0x319f2d[_0x20e8('0x2d')]),_0x4e9ffb);if(_0x37585b[_0x20e8('0x2c')][_0x20e8('0x36')]){_0x10b01e[_0x20e8('0x34')]=_[_0x20e8('0x37')](_0x10b01e[_0x20e8('0x34')],{'$or':_[_0x20e8('0x27')](_0x4e9ffb,function(_0x477a9d){if(_0x477a9d[_0x20e8('0x29')]!==_0x20e8('0x38')){var _0x1ee598={};_0x1ee598[_0x477a9d[_0x20e8('0x26')]]={'$like':'%'+_0x37585b[_0x20e8('0x2c')][_0x20e8('0x36')]+'%'};return _0x1ee598;}})});}_0x10b01e=_[_0x20e8('0x37')]({},_0x10b01e,_0x37585b[_0x20e8('0x39')]);var _0x2d8963={'where':_0x10b01e[_0x20e8('0x34')]};return db[_0x20e8('0x3a')]['count'](_0x2d8963)['then'](function(_0xba7922){_0x135933[_0x20e8('0x1a')]=_0xba7922;if(_0x37585b[_0x20e8('0x2c')][_0x20e8('0x3b')]){_0x10b01e[_0x20e8('0x3c')]=[{'all':!![]}];}return db['FreshsalesField'][_0x20e8('0x3d')](_0x10b01e);})['then'](function(_0x2bef93){_0x135933['rows']=_0x2bef93;return _0x135933;})[_0x20e8('0x22')](respondWithFilteredResult(_0x3df506,_0x10b01e))[_0x20e8('0x3e')](handleError(_0x3df506,null));};exports['show']=function(_0x33123f,_0x221434){var _0x4fbcd8={'raw':!![],'where':{'id':_0x33123f[_0x20e8('0x3f')]['id']}},_0x2e7734={};_0x2e7734[_0x20e8('0x2b')]=_['keys'](db[_0x20e8('0x3a')][_0x20e8('0x28')]);_0x2e7734['query']=_['keys'](_0x33123f[_0x20e8('0x2c')]);_0x2e7734[_0x20e8('0x2d')]=_[_0x20e8('0x2e')](_0x2e7734[_0x20e8('0x2b')],_0x2e7734[_0x20e8('0x2c')]);_0x4fbcd8[_0x20e8('0x2f')]=_[_0x20e8('0x2e')](_0x2e7734['model'],qs[_0x20e8('0x30')](_0x33123f[_0x20e8('0x2c')][_0x20e8('0x30')]));_0x4fbcd8[_0x20e8('0x2f')]=_0x4fbcd8[_0x20e8('0x2f')][_0x20e8('0x31')]?_0x4fbcd8[_0x20e8('0x2f')]:_0x2e7734[_0x20e8('0x2b')];if(_0x33123f['query']['includeAll']){_0x4fbcd8['include']=[{'all':!![]}];}_0x4fbcd8=_[_0x20e8('0x37')]({},_0x4fbcd8,_0x33123f[_0x20e8('0x39')]);return db['FreshsalesField'][_0x20e8('0x40')](_0x4fbcd8)[_0x20e8('0x22')](handleEntityNotFound(_0x221434,null))['then'](respondWithResult(_0x221434,null))[_0x20e8('0x3e')](handleError(_0x221434,null));};exports['create']=function(_0x516569,_0x47b17e){return db[_0x20e8('0x3a')]['create'](_0x516569[_0x20e8('0x41')],{})[_0x20e8('0x22')](respondWithResult(_0x47b17e,0xc9))[_0x20e8('0x3e')](handleError(_0x47b17e,null));};exports[_0x20e8('0x21')]=function(_0x32e2d7,_0x473ffa){if(_0x32e2d7[_0x20e8('0x41')]['id']){delete _0x32e2d7[_0x20e8('0x41')]['id'];}return db['FreshsalesField'][_0x20e8('0x40')]({'where':{'id':_0x32e2d7[_0x20e8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x473ffa,null))[_0x20e8('0x22')](saveUpdates(_0x32e2d7[_0x20e8('0x41')],null))[_0x20e8('0x22')](respondWithResult(_0x473ffa,null))[_0x20e8('0x3e')](handleError(_0x473ffa,null));};exports[_0x20e8('0x23')]=function(_0x57accf,_0x39c7d7){return db[_0x20e8('0x3a')][_0x20e8('0x40')]({'where':{'id':_0x57accf[_0x20e8('0x3f')]['id']}})[_0x20e8('0x22')](handleEntityNotFound(_0x39c7d7,null))[_0x20e8('0x22')](removeEntity(_0x39c7d7,null))[_0x20e8('0x3e')](handleError(_0x39c7d7,null));}; \ No newline at end of file +var _0xd1be=['intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','findAll','catch','params','length','include','find','create','body','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','error','name','send','index','map','FreshsalesField','rawAttributes','type','key','query','keys','filters','model'];(function(_0x7fd68d,_0x337f7c){var _0x1371f3=function(_0x434fd7){while(--_0x434fd7){_0x7fd68d['push'](_0x7fd68d['shift']());}};_0x1371f3(++_0x337f7c);}(_0xd1be,0x131));var _0xed1b=function(_0x3a1cca,_0xf9cf7e){_0x3a1cca=_0x3a1cca-0x0;var _0x53b71c=_0xd1be[_0x3a1cca];return _0x53b71c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xed1b('0x0'));var jsonpatch=require(_0xed1b('0x1'));var rp=require(_0xed1b('0x2'));var moment=require(_0xed1b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed1b('0x4'));var csv=require(_0xed1b('0x5'));var ejs=require(_0xed1b('0x6'));var fs=require('fs');var fs_extra=require(_0xed1b('0x7'));var _=require(_0xed1b('0x8'));var squel=require(_0xed1b('0x9'));var crypto=require('crypto');var jsforce=require(_0xed1b('0xa'));var deskjs=require(_0xed1b('0xb'));var toCsv=require(_0xed1b('0x5'));var querystring=require(_0xed1b('0xc'));var Papa=require(_0xed1b('0xd'));var Redis=require(_0xed1b('0xe'));var authService=require(_0xed1b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xed1b('0x10'));var hardwareService=require(_0xed1b('0x11'));var logger=require(_0xed1b('0x12'))(_0xed1b('0x13'));var utils=require(_0xed1b('0x14'));var config=require(_0xed1b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xed1b('0x16'))['db'];function respondWithStatusCode(_0x2f1897,_0x99c7ee){_0x99c7ee=_0x99c7ee||0xcc;return function(_0x1d3983){if(_0x1d3983){return _0x2f1897[_0xed1b('0x17')](_0x99c7ee);}return _0x2f1897[_0xed1b('0x18')](_0x99c7ee)[_0xed1b('0x19')]();};}function respondWithResult(_0x32ea47,_0x1b31b9){_0x1b31b9=_0x1b31b9||0xc8;return function(_0x37ea2a){if(_0x37ea2a){return _0x32ea47[_0xed1b('0x18')](_0x1b31b9)[_0xed1b('0x1a')](_0x37ea2a);}};}function respondWithFilteredResult(_0x105d51,_0x410177){return function(_0x23f515){if(_0x23f515){var _0x356f7f=typeof _0x410177['offset']===_0xed1b('0x1b')&&typeof _0x410177[_0xed1b('0x1c')]==='undefined';var _0x1e5430=_0x23f515['count'];var _0x2838af=_0x356f7f?0x0:_0x410177[_0xed1b('0x1d')];var _0x8d6493=_0x356f7f?_0x23f515[_0xed1b('0x1e')]:_0x410177[_0xed1b('0x1d')]+_0x410177[_0xed1b('0x1c')];var _0x2a53e5;if(_0x8d6493>=_0x1e5430){_0x8d6493=_0x1e5430;_0x2a53e5=0xc8;}else{_0x2a53e5=0xce;}_0x105d51['status'](_0x2a53e5);return _0x105d51[_0xed1b('0x1f')]('Content-Range',_0x2838af+'-'+_0x8d6493+'/'+_0x1e5430)['json'](_0x23f515);}return null;};}function patchUpdates(_0x540647){return function(_0x55f75b){try{jsonpatch['apply'](_0x55f75b,_0x540647,!![]);}catch(_0x536f5e){return BPromise[_0xed1b('0x20')](_0x536f5e);}return _0x55f75b[_0xed1b('0x21')]();};}function saveUpdates(_0x454078,_0x41c238){return function(_0x23fc62){if(_0x23fc62){return _0x23fc62[_0xed1b('0x22')](_0x454078)[_0xed1b('0x23')](function(_0x21859d){return _0x21859d;});}return null;};}function removeEntity(_0x91affb,_0x27b530){return function(_0x4fdbcc){if(_0x4fdbcc){return _0x4fdbcc[_0xed1b('0x24')]()[_0xed1b('0x23')](function(){_0x91affb['status'](0xcc)[_0xed1b('0x19')]();});}};}function handleEntityNotFound(_0x4a43f1,_0x1c0652){return function(_0x4aacc2){if(!_0x4aacc2){_0x4a43f1[_0xed1b('0x17')](0x194);}return _0x4aacc2;};}function handleError(_0xdcac7a,_0x5b7715){_0x5b7715=_0x5b7715||0x1f4;return function(_0x4768d9){logger[_0xed1b('0x25')](_0x4768d9['stack']);if(_0x4768d9['name']){delete _0x4768d9[_0xed1b('0x26')];}_0xdcac7a[_0xed1b('0x18')](_0x5b7715)[_0xed1b('0x27')](_0x4768d9);};}exports[_0xed1b('0x28')]=function(_0x1cc7a2,_0x24c540){var _0xbe4751={},_0x2e3d3c={},_0x4e70e1={'count':0x0,'rows':[]};var _0x42eb05=_[_0xed1b('0x29')](db[_0xed1b('0x2a')][_0xed1b('0x2b')],function(_0x49ee8c){return{'name':_0x49ee8c['fieldName'],'type':_0x49ee8c[_0xed1b('0x2c')][_0xed1b('0x2d')]};});_0x2e3d3c['model']=_[_0xed1b('0x29')](_0x42eb05,_0xed1b('0x26'));_0x2e3d3c[_0xed1b('0x2e')]=_[_0xed1b('0x2f')](_0x1cc7a2['query']);_0x2e3d3c[_0xed1b('0x30')]=_['intersection'](_0x2e3d3c[_0xed1b('0x31')],_0x2e3d3c[_0xed1b('0x2e')]);_0xbe4751['attributes']=_[_0xed1b('0x32')](_0x2e3d3c[_0xed1b('0x31')],qs[_0xed1b('0x33')](_0x1cc7a2['query'][_0xed1b('0x33')]));_0xbe4751[_0xed1b('0x34')]=_0xbe4751[_0xed1b('0x34')]['length']?_0xbe4751[_0xed1b('0x34')]:_0x2e3d3c[_0xed1b('0x31')];if(!_0x1cc7a2[_0xed1b('0x2e')][_0xed1b('0x35')](_0xed1b('0x36'))){_0xbe4751[_0xed1b('0x1c')]=qs[_0xed1b('0x1c')](_0x1cc7a2[_0xed1b('0x2e')][_0xed1b('0x1c')]);_0xbe4751[_0xed1b('0x1d')]=qs[_0xed1b('0x1d')](_0x1cc7a2[_0xed1b('0x2e')][_0xed1b('0x1d')]);}_0xbe4751[_0xed1b('0x37')]=qs[_0xed1b('0x38')](_0x1cc7a2[_0xed1b('0x2e')][_0xed1b('0x38')]);_0xbe4751['where']=qs[_0xed1b('0x30')](_[_0xed1b('0x39')](_0x1cc7a2[_0xed1b('0x2e')],_0x2e3d3c[_0xed1b('0x30')]),_0x42eb05);if(_0x1cc7a2[_0xed1b('0x2e')][_0xed1b('0x3a')]){_0xbe4751['where']=_[_0xed1b('0x3b')](_0xbe4751[_0xed1b('0x3c')],{'$or':_['map'](_0x42eb05,function(_0xd8c8b4){if(_0xd8c8b4[_0xed1b('0x2c')]!=='VIRTUAL'){var _0x4e8f94={};_0x4e8f94[_0xd8c8b4[_0xed1b('0x26')]]={'$like':'%'+_0x1cc7a2['query'][_0xed1b('0x3a')]+'%'};return _0x4e8f94;}})});}_0xbe4751=_[_0xed1b('0x3b')]({},_0xbe4751,_0x1cc7a2[_0xed1b('0x3d')]);var _0x482054={'where':_0xbe4751['where']};return db[_0xed1b('0x2a')][_0xed1b('0x1e')](_0x482054)['then'](function(_0x53636b){_0x4e70e1[_0xed1b('0x1e')]=_0x53636b;if(_0x1cc7a2[_0xed1b('0x2e')][_0xed1b('0x3e')]){_0xbe4751['include']=[{'all':!![]}];}return db[_0xed1b('0x2a')][_0xed1b('0x3f')](_0xbe4751);})[_0xed1b('0x23')](function(_0x33f885){_0x4e70e1['rows']=_0x33f885;return _0x4e70e1;})[_0xed1b('0x23')](respondWithFilteredResult(_0x24c540,_0xbe4751))[_0xed1b('0x40')](handleError(_0x24c540,null));};exports['show']=function(_0x2c3afa,_0x1e279c){var _0x47c29c={'raw':!![],'where':{'id':_0x2c3afa[_0xed1b('0x41')]['id']}},_0x2f1f6e={};_0x2f1f6e['model']=_[_0xed1b('0x2f')](db[_0xed1b('0x2a')][_0xed1b('0x2b')]);_0x2f1f6e[_0xed1b('0x2e')]=_['keys'](_0x2c3afa[_0xed1b('0x2e')]);_0x2f1f6e[_0xed1b('0x30')]=_[_0xed1b('0x32')](_0x2f1f6e[_0xed1b('0x31')],_0x2f1f6e[_0xed1b('0x2e')]);_0x47c29c[_0xed1b('0x34')]=_[_0xed1b('0x32')](_0x2f1f6e['model'],qs[_0xed1b('0x33')](_0x2c3afa['query'][_0xed1b('0x33')]));_0x47c29c[_0xed1b('0x34')]=_0x47c29c[_0xed1b('0x34')][_0xed1b('0x42')]?_0x47c29c[_0xed1b('0x34')]:_0x2f1f6e[_0xed1b('0x31')];if(_0x2c3afa[_0xed1b('0x2e')][_0xed1b('0x3e')]){_0x47c29c[_0xed1b('0x43')]=[{'all':!![]}];}_0x47c29c=_['merge']({},_0x47c29c,_0x2c3afa[_0xed1b('0x3d')]);return db[_0xed1b('0x2a')][_0xed1b('0x44')](_0x47c29c)['then'](handleEntityNotFound(_0x1e279c,null))[_0xed1b('0x23')](respondWithResult(_0x1e279c,null))[_0xed1b('0x40')](handleError(_0x1e279c,null));};exports[_0xed1b('0x45')]=function(_0x10620d,_0x3b1336){return db[_0xed1b('0x2a')][_0xed1b('0x45')](_0x10620d[_0xed1b('0x46')],{})[_0xed1b('0x23')](respondWithResult(_0x3b1336,0xc9))['catch'](handleError(_0x3b1336,null));};exports[_0xed1b('0x22')]=function(_0x10cd11,_0x2379b7){if(_0x10cd11[_0xed1b('0x46')]['id']){delete _0x10cd11['body']['id'];}return db[_0xed1b('0x2a')][_0xed1b('0x44')]({'where':{'id':_0x10cd11['params']['id']}})[_0xed1b('0x23')](handleEntityNotFound(_0x2379b7,null))[_0xed1b('0x23')](saveUpdates(_0x10cd11[_0xed1b('0x46')],null))[_0xed1b('0x23')](respondWithResult(_0x2379b7,null))[_0xed1b('0x40')](handleError(_0x2379b7,null));};exports['destroy']=function(_0x285ed0,_0x28447f){return db[_0xed1b('0x2a')][_0xed1b('0x44')]({'where':{'id':_0x285ed0['params']['id']}})['then'](handleEntityNotFound(_0x28447f,null))[_0xed1b('0x23')](removeEntity(_0x28447f,null))[_0xed1b('0x40')](handleError(_0x28447f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index accc1bd..f97caef 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 _0xf7b4=['idField','FieldId','lodash','api','moment','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x2efd23,_0x44fcb2){var _0x232e4c=function(_0x1d5d3b){while(--_0x1d5d3b){_0x2efd23['push'](_0x2efd23['shift']());}};_0x232e4c(++_0x44fcb2);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5a7650,_0x454cd1){_0x5a7650=_0x5a7650-0x0;var _0x1b8bfc=_0xf7b4[_0x5a7650];return _0x1b8bfc;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[{'name':_0x4f7b('0xb'),'fields':[_0x4f7b('0xc'),_0x4f7b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd906=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd906,0x6b));var _0x6d90=function(_0x175e11,_0x4eb63c){_0x175e11=_0x175e11-0x0;var _0x57ad0c=_0xd906[_0x175e11];return _0x57ad0c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6d90('0x0'))(_0x6d90('0x1'));var moment=require(_0x6d90('0x2'));var BPromise=require(_0x6d90('0x3'));var rp=require(_0x6d90('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d90('0x5'));var config=require(_0x6d90('0x6'));var attributes=require(_0x6d90('0x7'));module[_0x6d90('0x8')]=function(_0x4fa119,_0x8ee191){return _0x4fa119[_0x6d90('0x9')](_0x6d90('0xa'),attributes,{'tableName':_0x6d90('0xb'),'paranoid':![],'indexes':[{'name':_0x6d90('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index a3f33f8..2016f87 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 _0x0295=['client','http','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5f3885,_0x35e102){var _0x5905b3=function(_0x77f129){while(--_0x77f129){_0x5f3885['push'](_0x5f3885['shift']());}};_0x5905b3(++_0x35e102);}(_0x0295,0x1f0));var _0x5029=function(_0x2b2c2f,_0x645409){_0x2b2c2f=_0x2b2c2f-0x0;var _0x2984ea=_0x0295[_0x2b2c2f];return _0x2984ea;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('FreshsalesField,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4349da,_0x133fb9){var _0x311578=function(_0x52e9e2){while(--_0x52e9e2){_0x4349da['push'](_0x4349da['shift']());}};_0x311578(++_0x133fb9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'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')]('FreshsalesField,\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/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c582cef..c1b1bbb 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(_0x5e4a8b,_0x509428){var _0x4adc98=function(_0x1cc422){while(--_0x1cc422){_0x5e4a8b['push'](_0x5e4a8b['shift']());}};_0x4adc98(++_0x509428);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x40638c,_0x58650c){var _0x3ad254=function(_0x3b6d5c){while(--_0x3b6d5c){_0x40638c['push'](_0x40638c['shift']());}};_0x3ad254(++_0x58650c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0a01d1f..dde0a54 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 _0xf347=['exports','STRING','username','ENUM','integrationTab','sequelize'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0xf347,0xa1));var _0x7f34=function(_0x297f4c,_0x4de80d){_0x297f4c=_0x297f4c-0x0;var _0x40cf4a=_0xf347[_0x297f4c];return _0x40cf4a;};'use strict';var Sequelize=require(_0x7f34('0x0'));module[_0x7f34('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7f34('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x7f34('0x3')},'remoteUri':{'type':Sequelize[_0x7f34('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x7f34('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7f34('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7f34('0x4')](_0x7f34('0x5'),'newTab'),'defaultValue':_0x7f34('0x5')}}; \ No newline at end of file +var _0xa613=['username','integrationTab','newTab','sequelize','STRING'];(function(_0x3e1b42,_0x3a482f){var _0x44365f=function(_0x25e172){while(--_0x25e172){_0x3e1b42['push'](_0x3e1b42['shift']());}};_0x44365f(++_0x3a482f);}(_0xa613,0x8a));var _0x3a61=function(_0x39479f,_0x822ae4){_0x39479f=_0x39479f-0x0;var _0x4a6d96=_0xa613[_0x39479f];return _0x4a6d96;};'use strict';var Sequelize=require(_0x3a61('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a61('0x1')]},'description':{'type':Sequelize[_0x3a61('0x1')]},'username':{'type':Sequelize[_0x3a61('0x1')],'unique':_0x3a61('0x2')},'remoteUri':{'type':Sequelize[_0x3a61('0x1')]},'password':{'type':Sequelize[_0x3a61('0x1')]},'clientId':{'type':Sequelize[_0x3a61('0x1')]},'clientSecret':{'type':Sequelize[_0x3a61('0x1')]},'securityToken':{'type':Sequelize[_0x3a61('0x1')]},'serverUrl':{'type':Sequelize[_0x3a61('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3a61('0x3'),_0x3a61('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4b2226d..fe703df 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 _0x79d8=['count','set','Content-Range','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','SalesforceAccount','includeAll','include','rows','catch','params','keys','intersection','length','merge','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','SalesforceField','getFields','Task','remoteUri','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientId','login','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','label','custom','picklistValues','boolean','True','true','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','bluebird','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x150189,_0x4a63ca){var _0x4cb9b6=function(_0x2edc29){while(--_0x2edc29){_0x150189['push'](_0x150189['shift']());}};_0x4cb9b6(++_0x4a63ca);}(_0x79d8,0xdc));var _0x879d=function(_0x1dc2bc,_0x38bb61){_0x1dc2bc=_0x1dc2bc-0x0;var _0xca4855=_0x79d8[_0x1dc2bc];return _0xca4855;};'use strict';var emlformat=require(_0x879d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x879d('0x2'));var moment=require('moment');var BPromise=require(_0x879d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x879d('0x4'));var sox=require(_0x879d('0x5'));var csv=require(_0x879d('0x6'));var ejs=require(_0x879d('0x7'));var fs=require('fs');var fs_extra=require(_0x879d('0x8'));var _=require(_0x879d('0x9'));var squel=require(_0x879d('0xa'));var crypto=require(_0x879d('0xb'));var jsforce=require(_0x879d('0xc'));var deskjs=require(_0x879d('0xd'));var toCsv=require(_0x879d('0x6'));var querystring=require(_0x879d('0xe'));var Papa=require(_0x879d('0xf'));var Redis=require(_0x879d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x879d('0x11'));var as=require(_0x879d('0x12'));var hardwareService=require(_0x879d('0x13'));var logger=require(_0x879d('0x14'))(_0x879d('0x15'));var utils=require(_0x879d('0x16'));var config=require(_0x879d('0x17'));var licenseUtil=require(_0x879d('0x18'));var db=require(_0x879d('0x19'))['db'];var integrations=require(_0x879d('0x1a'));function respondWithStatusCode(_0x349347,_0x6541a5){_0x6541a5=_0x6541a5||0xcc;return function(_0x24a90f){if(_0x24a90f){return _0x349347[_0x879d('0x1b')](_0x6541a5);}return _0x349347[_0x879d('0x1c')](_0x6541a5)[_0x879d('0x1d')]();};}function respondWithResult(_0x2bafe8,_0x103a5e){_0x103a5e=_0x103a5e||0xc8;return function(_0x23ed02){if(_0x23ed02){return _0x2bafe8['status'](_0x103a5e)[_0x879d('0x1e')](_0x23ed02);}};}function respondWithFilteredResult(_0x1af387,_0x286165){return function(_0x106583){if(_0x106583){var _0x343baa=typeof _0x286165[_0x879d('0x1f')]===_0x879d('0x20')&&typeof _0x286165[_0x879d('0x21')]===_0x879d('0x20');var _0x26a757=_0x106583['count'];var _0xbf468b=_0x343baa?0x0:_0x286165[_0x879d('0x1f')];var _0x1abe98=_0x343baa?_0x106583[_0x879d('0x22')]:_0x286165[_0x879d('0x1f')]+_0x286165[_0x879d('0x21')];var _0x1d5284;if(_0x1abe98>=_0x26a757){_0x1abe98=_0x26a757;_0x1d5284=0xc8;}else{_0x1d5284=0xce;}_0x1af387[_0x879d('0x1c')](_0x1d5284);return _0x1af387[_0x879d('0x23')](_0x879d('0x24'),_0xbf468b+'-'+_0x1abe98+'/'+_0x26a757)[_0x879d('0x1e')](_0x106583);}return null;};}function patchUpdates(_0x41df37){return function(_0x2bd3bd){try{jsonpatch['apply'](_0x2bd3bd,_0x41df37,!![]);}catch(_0x1db24f){return BPromise[_0x879d('0x25')](_0x1db24f);}return _0x2bd3bd['save']();};}function saveUpdates(_0x5c52c0,_0x35257a){return function(_0x3f9d40){if(_0x3f9d40){return _0x3f9d40[_0x879d('0x26')](_0x5c52c0)[_0x879d('0x27')](function(_0x42d5be){return _0x42d5be;});}return null;};}function removeEntity(_0x528e24,_0x5cb229){return function(_0x5bc981){if(_0x5bc981){return _0x5bc981['destroy']()[_0x879d('0x27')](function(){_0x528e24[_0x879d('0x1c')](0xcc)[_0x879d('0x1d')]();});}};}function handleEntityNotFound(_0x4c3527,_0x300f70){return function(_0x1f5133){if(!_0x1f5133){_0x4c3527[_0x879d('0x1b')](0x194);}return _0x1f5133;};}function handleError(_0x2dd405,_0x4f2185){_0x4f2185=_0x4f2185||0x1f4;return function(_0x221b53){logger[_0x879d('0x28')](_0x221b53[_0x879d('0x29')]);if(_0x221b53[_0x879d('0x2a')]){delete _0x221b53['name'];}_0x2dd405[_0x879d('0x1c')](_0x4f2185)[_0x879d('0x2b')](_0x221b53);};}exports[_0x879d('0x2c')]=function(_0x1ffa99,_0x1235c9){var _0x51a461={},_0x104bf2={},_0x52a13e={'count':0x0,'rows':[]};var _0x36a40e=_[_0x879d('0x2d')](db['SalesforceAccount'][_0x879d('0x2e')],function(_0x5e7726){return{'name':_0x5e7726['fieldName'],'type':_0x5e7726[_0x879d('0x2f')][_0x879d('0x30')]};});_0x104bf2[_0x879d('0x31')]=_[_0x879d('0x2d')](_0x36a40e,_0x879d('0x2a'));_0x104bf2[_0x879d('0x32')]=_['keys'](_0x1ffa99[_0x879d('0x32')]);_0x104bf2[_0x879d('0x33')]=_['intersection'](_0x104bf2['model'],_0x104bf2[_0x879d('0x32')]);_0x51a461['attributes']=_['intersection'](_0x104bf2['model'],qs[_0x879d('0x34')](_0x1ffa99[_0x879d('0x32')][_0x879d('0x34')]));_0x51a461[_0x879d('0x35')]=_0x51a461['attributes']['length']?_0x51a461[_0x879d('0x35')]:_0x104bf2[_0x879d('0x31')];if(!_0x1ffa99[_0x879d('0x32')][_0x879d('0x36')](_0x879d('0x37'))){_0x51a461[_0x879d('0x21')]=qs[_0x879d('0x21')](_0x1ffa99[_0x879d('0x32')][_0x879d('0x21')]);_0x51a461[_0x879d('0x1f')]=qs[_0x879d('0x1f')](_0x1ffa99['query']['offset']);}_0x51a461[_0x879d('0x38')]=qs[_0x879d('0x39')](_0x1ffa99[_0x879d('0x32')]['sort']);_0x51a461['where']=qs[_0x879d('0x33')](_[_0x879d('0x3a')](_0x1ffa99[_0x879d('0x32')],_0x104bf2[_0x879d('0x33')]),_0x36a40e);if(_0x1ffa99[_0x879d('0x32')][_0x879d('0x3b')]){_0x51a461[_0x879d('0x3c')]=_['merge'](_0x51a461[_0x879d('0x3c')],{'$or':_[_0x879d('0x2d')](_0x36a40e,function(_0x2b4397){if(_0x2b4397['type']!==_0x879d('0x3d')){var _0x992b42={};_0x992b42[_0x2b4397[_0x879d('0x2a')]]={'$like':'%'+_0x1ffa99[_0x879d('0x32')]['filter']+'%'};return _0x992b42;}})});}_0x51a461=_['merge']({},_0x51a461,_0x1ffa99['options']);var _0xfcf0c5={'where':_0x51a461[_0x879d('0x3c')]};return db[_0x879d('0x3e')][_0x879d('0x22')](_0xfcf0c5)[_0x879d('0x27')](function(_0x233b0f){_0x52a13e[_0x879d('0x22')]=_0x233b0f;if(_0x1ffa99[_0x879d('0x32')][_0x879d('0x3f')]){_0x51a461[_0x879d('0x40')]=[{'all':!![]}];}return db[_0x879d('0x3e')]['findAll'](_0x51a461);})['then'](function(_0x152724){_0x52a13e[_0x879d('0x41')]=_0x152724;return _0x52a13e;})[_0x879d('0x27')](respondWithFilteredResult(_0x1235c9,_0x51a461))[_0x879d('0x42')](handleError(_0x1235c9,null));};exports['show']=function(_0x5a7f74,_0x1e9e02){var _0x3cc546={'raw':![],'where':{'id':_0x5a7f74[_0x879d('0x43')]['id']}},_0x196762={};_0x196762['model']=_[_0x879d('0x44')](db[_0x879d('0x3e')]['rawAttributes']);_0x196762[_0x879d('0x32')]=_[_0x879d('0x44')](_0x5a7f74[_0x879d('0x32')]);_0x196762['filters']=_[_0x879d('0x45')](_0x196762[_0x879d('0x31')],_0x196762[_0x879d('0x32')]);_0x3cc546[_0x879d('0x35')]=_[_0x879d('0x45')](_0x196762['model'],qs[_0x879d('0x34')](_0x5a7f74[_0x879d('0x32')][_0x879d('0x34')]));_0x3cc546[_0x879d('0x35')]=_0x3cc546['attributes'][_0x879d('0x46')]?_0x3cc546[_0x879d('0x35')]:_0x196762[_0x879d('0x31')];if(_0x5a7f74['query'][_0x879d('0x3f')]){_0x3cc546[_0x879d('0x40')]=[{'all':!![]}];}_0x3cc546=_[_0x879d('0x47')]({},_0x3cc546,_0x5a7f74[_0x879d('0x48')]);return db[_0x879d('0x3e')][_0x879d('0x49')](_0x3cc546)[_0x879d('0x27')](handleEntityNotFound(_0x1e9e02,null))[_0x879d('0x27')](respondWithResult(_0x1e9e02,null))[_0x879d('0x42')](handleError(_0x1e9e02,null));};exports[_0x879d('0x4a')]=function(_0x5cb51c,_0x2e270b){return db[_0x879d('0x3e')][_0x879d('0x4a')](_0x5cb51c[_0x879d('0x4b')],{})[_0x879d('0x27')](respondWithResult(_0x2e270b,0xc9))[_0x879d('0x42')](handleError(_0x2e270b,null));};exports[_0x879d('0x26')]=function(_0x2bb0,_0x33e754){if(_0x2bb0['body']['id']){delete _0x2bb0['body']['id'];}return db['SalesforceAccount'][_0x879d('0x49')]({'where':{'id':_0x2bb0[_0x879d('0x43')]['id']}})['then'](handleEntityNotFound(_0x33e754,null))[_0x879d('0x27')](saveUpdates(_0x2bb0[_0x879d('0x4b')],null))['then'](respondWithResult(_0x33e754,null))[_0x879d('0x42')](handleError(_0x33e754,null));};exports['destroy']=function(_0x3e0e76,_0x5c747e){return db[_0x879d('0x3e')][_0x879d('0x49')]({'where':{'id':_0x3e0e76[_0x879d('0x43')]['id']}})[_0x879d('0x27')](handleEntityNotFound(_0x5c747e,null))[_0x879d('0x27')](removeEntity(_0x5c747e,null))[_0x879d('0x42')](handleError(_0x5c747e,null));};exports[_0x879d('0x4c')]=function(_0x16442f,_0x1faa7d,_0x26b2de){var _0x5b4212={};var _0xbef089={};var _0x478fa5;var _0x14dfb5;return db['SalesforceAccount'][_0x879d('0x4d')]({'where':{'id':_0x16442f[_0x879d('0x43')]['id']}})[_0x879d('0x27')](handleEntityNotFound(_0x1faa7d,null))['then'](function(_0x22ee71){if(_0x22ee71){_0x478fa5=_0x22ee71;_0xbef089['model']=_['keys'](db[_0x879d('0x4e')][_0x879d('0x2e')]);_0xbef089[_0x879d('0x32')]=_[_0x879d('0x44')](_0x16442f[_0x879d('0x32')]);_0xbef089[_0x879d('0x33')]=_[_0x879d('0x45')](_0xbef089[_0x879d('0x31')],_0xbef089[_0x879d('0x32')]);_0x5b4212[_0x879d('0x35')]=_[_0x879d('0x45')](_0xbef089[_0x879d('0x31')],qs[_0x879d('0x34')](_0x16442f[_0x879d('0x32')]['fields']));_0x5b4212['attributes']=_0x5b4212[_0x879d('0x35')][_0x879d('0x46')]?_0x5b4212[_0x879d('0x35')]:_0xbef089[_0x879d('0x31')];_0x5b4212[_0x879d('0x38')]=qs[_0x879d('0x39')](_0x16442f[_0x879d('0x32')][_0x879d('0x39')]);_0x5b4212[_0x879d('0x3c')]=qs[_0x879d('0x33')](_[_0x879d('0x3a')](_0x16442f[_0x879d('0x32')],_0xbef089[_0x879d('0x33')]));if(_0x16442f[_0x879d('0x32')][_0x879d('0x3b')]){_0x5b4212['where']=_[_0x879d('0x47')](_0x5b4212['where'],{'$or':_[_0x879d('0x2d')](_0x5b4212[_0x879d('0x35')],function(_0x20b7d9){var _0x32eccc={};_0x32eccc[_0x20b7d9]={'$like':'%'+_0x16442f[_0x879d('0x32')]['filter']+'%'};return _0x32eccc;})});}_0x5b4212=_['merge']({},_0x5b4212,_0x16442f[_0x879d('0x48')]);return _0x478fa5['getConfigurations'](_0x5b4212);}})[_0x879d('0x27')](function(_0x17ee7e){if(_0x17ee7e){_0x14dfb5=_0x17ee7e[_0x879d('0x46')];if(!_0x16442f[_0x879d('0x32')][_0x879d('0x36')]('nolimit')){_0x5b4212[_0x879d('0x21')]=qs[_0x879d('0x21')](_0x16442f[_0x879d('0x32')][_0x879d('0x21')]);_0x5b4212[_0x879d('0x1f')]=qs[_0x879d('0x1f')](_0x16442f[_0x879d('0x32')]['offset']);}return _0x478fa5['getConfigurations'](_0x5b4212);}})['then'](function(_0x1a3ce7){if(_0x1a3ce7){return _0x1a3ce7?{'count':_0x14dfb5,'rows':_0x1a3ce7}:null;}})[_0x879d('0x27')](respondWithResult(_0x1faa7d,null))[_0x879d('0x42')](handleError(_0x1faa7d,null));};exports[_0x879d('0x4f')]=function(_0x3882fd,_0x258300,_0x3ad01a){if(_0x3882fd[_0x879d('0x4b')]['id']){delete _0x3882fd[_0x879d('0x4b')]['id'];}return db[_0x879d('0x3e')][_0x879d('0x4d')]({'where':{'id':_0x3882fd[_0x879d('0x43')]['id']}})[_0x879d('0x27')](handleEntityNotFound(_0x258300,null))[_0x879d('0x27')](function(_0x387086){if(_0x387086){_0x3882fd[_0x879d('0x4b')][_0x879d('0x50')]=_0x387086['id'];_0x3882fd['body'][_0x879d('0x51')]=integrations[_0x879d('0x52')](_0x3882fd[_0x879d('0x4b')]['channel'],_0x3882fd[_0x879d('0x4b')]['type']);_0x3882fd[_0x879d('0x4b')][_0x879d('0x53')]=integrations['getDescriptions'](_0x3882fd[_0x879d('0x4b')]['channel'],_0x3882fd[_0x879d('0x4b')][_0x879d('0x2f')]);return db['SalesforceConfiguration'][_0x879d('0x4a')](_0x3882fd[_0x879d('0x4b')],{'include':[{'model':db['SalesforceField'],'as':_0x879d('0x51')},{'model':db[_0x879d('0x54')],'as':_0x879d('0x53')}]});}return null;})[_0x879d('0x27')](respondWithResult(_0x258300,null))[_0x879d('0x42')](handleError(_0x258300,null));};exports[_0x879d('0x55')]=function(_0x13ba8e,_0x227a71,_0x1eb9b4){var _0x65c28d;var _0x3944b0='';var _0x26d39f=_0x879d('0x56');return db[_0x879d('0x3e')]['findOne']({'where':{'id':_0x13ba8e['params']['id']},'attributes':['id',_0x879d('0x57'),'clientId','clientSecret',_0x879d('0x58'),_0x879d('0x59'),_0x879d('0x5a')]})['then'](handleEntityNotFound(_0x227a71,null))[_0x879d('0x27')](function(_0x267f7f){if(_0x267f7f){_0x3944b0=_0x267f7f[_0x879d('0x57')];var _0x455f26=_0x3944b0[_0x879d('0x5b')](-0x1);if(_0x455f26==='/'){_0x3944b0=_0x3944b0[_0x879d('0x5c')](0x0,_0x3944b0[_0x879d('0x5d')](_0x455f26));}_0x65c28d=new jsforce[(_0x879d('0x5e'))]({'oauth2':{'loginUrl':_0x3944b0,'clientId':_0x267f7f[_0x879d('0x5f')],'clientSecret':_0x267f7f['clientSecret']}});return _0x65c28d[_0x879d('0x60')](_0x267f7f[_0x879d('0x58')],_0x267f7f[_0x879d('0x59')]['concat'](_0x267f7f['securityToken']));}})[_0x879d('0x27')](function(_0x13e85b){if(_0x13e85b){if(!_[_0x879d('0x61')](_0x13ba8e['query'][_0x879d('0x62')])){_0x26d39f=_0x13ba8e[_0x879d('0x32')][_0x879d('0x62')];}return _0x65c28d[_0x879d('0x63')](_0x26d39f)[_0x879d('0x64')]();}})[_0x879d('0x27')](function(_0x2fe851){var _0x187ab3=[_0x879d('0x65'),_0x879d('0x66'),_0x879d('0x67'),_0x879d('0x68'),_0x879d('0x69'),_0x879d('0x6a')];var _0x40bb58=[_0x879d('0x6b'),_0x879d('0x6c'),_0x879d('0x6d'),'boolean',_0x879d('0x6e'),_0x879d('0x6f'),_0x879d('0x70')];if(_0x2fe851){_[_0x879d('0x71')](_0x2fe851[_0x879d('0x34')],function(_0x1d493d){return _0x187ab3[_0x879d('0x72')](_0x1d493d['name'])||!_0x40bb58[_0x879d('0x72')](_0x1d493d[_0x879d('0x2f')]);});return{'count':_0x2fe851[_0x879d('0x34')][_0x879d('0x46')],'rows':_[_0x879d('0x2d')](_0x2fe851[_0x879d('0x34')],function(_0x32b7da){return{'id':_0x32b7da['name'],'name':_0x32b7da[_0x879d('0x73')],'custom':_0x32b7da[_0x879d('0x74')],'options':_0x32b7da[_0x879d('0x75')][_0x879d('0x46')]>0x0?_['map'](_0x32b7da['picklistValues'],function(_0x365798){return{'name':_0x365798['label'],'value':_0x365798['value']};}):_0x32b7da[_0x879d('0x2f')]==_0x879d('0x76')?[{'name':_0x879d('0x77'),'value':_0x879d('0x78')},{'name':'False','value':_0x879d('0x79')}]:[]};})};}})['then'](respondWithResult(_0x227a71,null))[_0x879d('0x42')](function(_0x4b1992){var _0x356931=_0x13ba8e[_0x879d('0x32')][_0x879d('0x7a')]?0x1f4:_0x4b1992['statusCode']||0x1f4;logger[_0x879d('0x28')](_0x879d('0x7b'),'getFields',_0x356931,JSON[_0x879d('0x7c')](_0x4b1992));delete _0x4b1992[_0x879d('0x2a')];if(_0x356931===0x191){_0x356931=0x190;}_0x227a71[_0x879d('0x1c')](_0x356931)[_0x879d('0x2b')](_0x13ba8e[_0x879d('0x32')]['test']?{'message':_0x879d('0x7d'),'statusCode':_0x4b1992[_0x879d('0x7e')]}:_0x4b1992);});}; \ No newline at end of file +var _0x4f30=['count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','index','map','SalesforceAccount','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','merge','options','includeAll','include','catch','show','rawAttributes','find','create','body','params','getConfigurations','SalesforceConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','findOne','remoteUri','clientId','clientSecret','password','slice','substring','lastIndexOf','username','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','True','true','False','false','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit'];(function(_0x38b865,_0x4ceb6a){var _0x11af52=function(_0x718b93){while(--_0x718b93){_0x38b865['push'](_0x38b865['shift']());}};_0x11af52(++_0x4ceb6a);}(_0x4f30,0xe8));var _0x04f3=function(_0x41b27d,_0x3ad8c1){_0x41b27d=_0x41b27d-0x0;var _0x2dc5c3=_0x4f30[_0x41b27d];return _0x2dc5c3;};'use strict';var emlformat=require(_0x04f3('0x0'));var rimraf=require(_0x04f3('0x1'));var zipdir=require(_0x04f3('0x2'));var jsonpatch=require(_0x04f3('0x3'));var rp=require(_0x04f3('0x4'));var moment=require(_0x04f3('0x5'));var BPromise=require(_0x04f3('0x6'));var Mustache=require(_0x04f3('0x7'));var util=require(_0x04f3('0x8'));var path=require('path');var sox=require(_0x04f3('0x9'));var csv=require(_0x04f3('0xa'));var ejs=require(_0x04f3('0xb'));var fs=require('fs');var fs_extra=require(_0x04f3('0xc'));var _=require(_0x04f3('0xd'));var squel=require(_0x04f3('0xe'));var crypto=require(_0x04f3('0xf'));var jsforce=require(_0x04f3('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x04f3('0xa'));var querystring=require(_0x04f3('0x11'));var Papa=require(_0x04f3('0x12'));var Redis=require('ioredis');var authService=require(_0x04f3('0x13'));var qs=require(_0x04f3('0x14'));var as=require(_0x04f3('0x15'));var hardwareService=require(_0x04f3('0x16'));var logger=require(_0x04f3('0x17'))(_0x04f3('0x18'));var utils=require(_0x04f3('0x19'));var config=require(_0x04f3('0x1a'));var licenseUtil=require(_0x04f3('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xa744a5,_0x2d7aaf){_0x2d7aaf=_0x2d7aaf||0xcc;return function(_0x51414a){if(_0x51414a){return _0xa744a5[_0x04f3('0x1c')](_0x2d7aaf);}return _0xa744a5[_0x04f3('0x1d')](_0x2d7aaf)['end']();};}function respondWithResult(_0x5873e7,_0x3de729){_0x3de729=_0x3de729||0xc8;return function(_0x515afa){if(_0x515afa){return _0x5873e7[_0x04f3('0x1d')](_0x3de729)[_0x04f3('0x1e')](_0x515afa);}};}function respondWithFilteredResult(_0xcfa930,_0x1b7448){return function(_0x21fb4e){if(_0x21fb4e){var _0x4ecbf2=typeof _0x1b7448[_0x04f3('0x1f')]===_0x04f3('0x20')&&typeof _0x1b7448[_0x04f3('0x21')]==='undefined';var _0x2a566a=_0x21fb4e[_0x04f3('0x22')];var _0x1b3ead=_0x4ecbf2?0x0:_0x1b7448['offset'];var _0x540e8e=_0x4ecbf2?_0x21fb4e[_0x04f3('0x22')]:_0x1b7448[_0x04f3('0x1f')]+_0x1b7448['limit'];var _0xfa2dea;if(_0x540e8e>=_0x2a566a){_0x540e8e=_0x2a566a;_0xfa2dea=0xc8;}else{_0xfa2dea=0xce;}_0xcfa930[_0x04f3('0x1d')](_0xfa2dea);return _0xcfa930[_0x04f3('0x23')](_0x04f3('0x24'),_0x1b3ead+'-'+_0x540e8e+'/'+_0x2a566a)['json'](_0x21fb4e);}return null;};}function patchUpdates(_0x5c481b){return function(_0x503a48){try{jsonpatch['apply'](_0x503a48,_0x5c481b,!![]);}catch(_0x586027){return BPromise[_0x04f3('0x25')](_0x586027);}return _0x503a48[_0x04f3('0x26')]();};}function saveUpdates(_0x6567ee,_0x257c1e){return function(_0x116914){if(_0x116914){return _0x116914[_0x04f3('0x27')](_0x6567ee)['then'](function(_0x28ead8){return _0x28ead8;});}return null;};}function removeEntity(_0x2e088d,_0x2d11c5){return function(_0xdbc3){if(_0xdbc3){return _0xdbc3[_0x04f3('0x28')]()[_0x04f3('0x29')](function(){_0x2e088d[_0x04f3('0x1d')](0xcc)[_0x04f3('0x2a')]();});}};}function handleEntityNotFound(_0x423a0a,_0x8f6af3){return function(_0x13a19e){if(!_0x13a19e){_0x423a0a[_0x04f3('0x1c')](0x194);}return _0x13a19e;};}function handleError(_0x400381,_0x3a26c2){_0x3a26c2=_0x3a26c2||0x1f4;return function(_0x2fdd91){logger[_0x04f3('0x2b')](_0x2fdd91[_0x04f3('0x2c')]);if(_0x2fdd91['name']){delete _0x2fdd91[_0x04f3('0x2d')];}_0x400381[_0x04f3('0x1d')](_0x3a26c2)['send'](_0x2fdd91);};}exports[_0x04f3('0x2e')]=function(_0x9b2e2c,_0x4dc2c5){var _0x27dbfa={},_0x37aad6={},_0x96fda6={'count':0x0,'rows':[]};var _0x551220=_[_0x04f3('0x2f')](db[_0x04f3('0x30')]['rawAttributes'],function(_0x2f12fc){return{'name':_0x2f12fc[_0x04f3('0x31')],'type':_0x2f12fc['type'][_0x04f3('0x32')]};});_0x37aad6[_0x04f3('0x33')]=_[_0x04f3('0x2f')](_0x551220,_0x04f3('0x2d'));_0x37aad6[_0x04f3('0x34')]=_[_0x04f3('0x35')](_0x9b2e2c[_0x04f3('0x34')]);_0x37aad6[_0x04f3('0x36')]=_['intersection'](_0x37aad6[_0x04f3('0x33')],_0x37aad6['query']);_0x27dbfa[_0x04f3('0x37')]=_[_0x04f3('0x38')](_0x37aad6[_0x04f3('0x33')],qs['fields'](_0x9b2e2c[_0x04f3('0x34')][_0x04f3('0x39')]));_0x27dbfa[_0x04f3('0x37')]=_0x27dbfa[_0x04f3('0x37')][_0x04f3('0x3a')]?_0x27dbfa[_0x04f3('0x37')]:_0x37aad6['model'];if(!_0x9b2e2c[_0x04f3('0x34')][_0x04f3('0x3b')](_0x04f3('0x3c'))){_0x27dbfa[_0x04f3('0x21')]=qs['limit'](_0x9b2e2c[_0x04f3('0x34')][_0x04f3('0x21')]);_0x27dbfa['offset']=qs['offset'](_0x9b2e2c['query'][_0x04f3('0x1f')]);}_0x27dbfa['order']=qs[_0x04f3('0x3d')](_0x9b2e2c['query']['sort']);_0x27dbfa['where']=qs[_0x04f3('0x36')](_[_0x04f3('0x3e')](_0x9b2e2c[_0x04f3('0x34')],_0x37aad6[_0x04f3('0x36')]),_0x551220);if(_0x9b2e2c[_0x04f3('0x34')][_0x04f3('0x3f')]){_0x27dbfa[_0x04f3('0x40')]=_['merge'](_0x27dbfa['where'],{'$or':_[_0x04f3('0x2f')](_0x551220,function(_0x332f53){if(_0x332f53[_0x04f3('0x41')]!=='VIRTUAL'){var _0x296cbf={};_0x296cbf[_0x332f53['name']]={'$like':'%'+_0x9b2e2c['query'][_0x04f3('0x3f')]+'%'};return _0x296cbf;}})});}_0x27dbfa=_[_0x04f3('0x42')]({},_0x27dbfa,_0x9b2e2c[_0x04f3('0x43')]);var _0x4fa8d6={'where':_0x27dbfa[_0x04f3('0x40')]};return db[_0x04f3('0x30')][_0x04f3('0x22')](_0x4fa8d6)['then'](function(_0x30e0c2){_0x96fda6['count']=_0x30e0c2;if(_0x9b2e2c[_0x04f3('0x34')][_0x04f3('0x44')]){_0x27dbfa[_0x04f3('0x45')]=[{'all':!![]}];}return db[_0x04f3('0x30')]['findAll'](_0x27dbfa);})[_0x04f3('0x29')](function(_0x3999e4){_0x96fda6['rows']=_0x3999e4;return _0x96fda6;})[_0x04f3('0x29')](respondWithFilteredResult(_0x4dc2c5,_0x27dbfa))[_0x04f3('0x46')](handleError(_0x4dc2c5,null));};exports[_0x04f3('0x47')]=function(_0x110613,_0x4f78b3){var _0x3f7dde={'raw':![],'where':{'id':_0x110613['params']['id']}},_0x5689a8={};_0x5689a8['model']=_[_0x04f3('0x35')](db[_0x04f3('0x30')][_0x04f3('0x48')]);_0x5689a8[_0x04f3('0x34')]=_[_0x04f3('0x35')](_0x110613[_0x04f3('0x34')]);_0x5689a8[_0x04f3('0x36')]=_[_0x04f3('0x38')](_0x5689a8['model'],_0x5689a8['query']);_0x3f7dde[_0x04f3('0x37')]=_[_0x04f3('0x38')](_0x5689a8[_0x04f3('0x33')],qs[_0x04f3('0x39')](_0x110613['query'][_0x04f3('0x39')]));_0x3f7dde[_0x04f3('0x37')]=_0x3f7dde['attributes'][_0x04f3('0x3a')]?_0x3f7dde[_0x04f3('0x37')]:_0x5689a8[_0x04f3('0x33')];if(_0x110613['query'][_0x04f3('0x44')]){_0x3f7dde[_0x04f3('0x45')]=[{'all':!![]}];}_0x3f7dde=_[_0x04f3('0x42')]({},_0x3f7dde,_0x110613[_0x04f3('0x43')]);return db[_0x04f3('0x30')][_0x04f3('0x49')](_0x3f7dde)[_0x04f3('0x29')](handleEntityNotFound(_0x4f78b3,null))[_0x04f3('0x29')](respondWithResult(_0x4f78b3,null))[_0x04f3('0x46')](handleError(_0x4f78b3,null));};exports[_0x04f3('0x4a')]=function(_0x4298ba,_0x4f0725){return db['SalesforceAccount'][_0x04f3('0x4a')](_0x4298ba[_0x04f3('0x4b')],{})['then'](respondWithResult(_0x4f0725,0xc9))['catch'](handleError(_0x4f0725,null));};exports[_0x04f3('0x27')]=function(_0x90b1c,_0x67e98b){if(_0x90b1c['body']['id']){delete _0x90b1c['body']['id'];}return db[_0x04f3('0x30')][_0x04f3('0x49')]({'where':{'id':_0x90b1c[_0x04f3('0x4c')]['id']}})[_0x04f3('0x29')](handleEntityNotFound(_0x67e98b,null))['then'](saveUpdates(_0x90b1c[_0x04f3('0x4b')],null))[_0x04f3('0x29')](respondWithResult(_0x67e98b,null))[_0x04f3('0x46')](handleError(_0x67e98b,null));};exports[_0x04f3('0x28')]=function(_0x1ea28c,_0x552cd8){return db[_0x04f3('0x30')][_0x04f3('0x49')]({'where':{'id':_0x1ea28c[_0x04f3('0x4c')]['id']}})[_0x04f3('0x29')](handleEntityNotFound(_0x552cd8,null))[_0x04f3('0x29')](removeEntity(_0x552cd8,null))[_0x04f3('0x46')](handleError(_0x552cd8,null));};exports[_0x04f3('0x4d')]=function(_0x5ba7d1,_0x253fbe,_0x324dfd){var _0x1b17a8={};var _0x34d9e4={};var _0x2433f1;var _0x55bcb4;return db['SalesforceAccount']['findOne']({'where':{'id':_0x5ba7d1[_0x04f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x253fbe,null))[_0x04f3('0x29')](function(_0x58dcc7){if(_0x58dcc7){_0x2433f1=_0x58dcc7;_0x34d9e4[_0x04f3('0x33')]=_[_0x04f3('0x35')](db[_0x04f3('0x4e')]['rawAttributes']);_0x34d9e4['query']=_[_0x04f3('0x35')](_0x5ba7d1[_0x04f3('0x34')]);_0x34d9e4['filters']=_['intersection'](_0x34d9e4[_0x04f3('0x33')],_0x34d9e4[_0x04f3('0x34')]);_0x1b17a8['attributes']=_[_0x04f3('0x38')](_0x34d9e4[_0x04f3('0x33')],qs[_0x04f3('0x39')](_0x5ba7d1['query']['fields']));_0x1b17a8[_0x04f3('0x37')]=_0x1b17a8[_0x04f3('0x37')][_0x04f3('0x3a')]?_0x1b17a8['attributes']:_0x34d9e4[_0x04f3('0x33')];_0x1b17a8[_0x04f3('0x4f')]=qs[_0x04f3('0x3d')](_0x5ba7d1[_0x04f3('0x34')][_0x04f3('0x3d')]);_0x1b17a8[_0x04f3('0x40')]=qs[_0x04f3('0x36')](_[_0x04f3('0x3e')](_0x5ba7d1['query'],_0x34d9e4[_0x04f3('0x36')]));if(_0x5ba7d1[_0x04f3('0x34')]['filter']){_0x1b17a8['where']=_[_0x04f3('0x42')](_0x1b17a8[_0x04f3('0x40')],{'$or':_['map'](_0x1b17a8[_0x04f3('0x37')],function(_0x48f5e3){var _0x51296a={};_0x51296a[_0x48f5e3]={'$like':'%'+_0x5ba7d1[_0x04f3('0x34')]['filter']+'%'};return _0x51296a;})});}_0x1b17a8=_[_0x04f3('0x42')]({},_0x1b17a8,_0x5ba7d1[_0x04f3('0x43')]);return _0x2433f1[_0x04f3('0x4d')](_0x1b17a8);}})['then'](function(_0x4805ab){if(_0x4805ab){_0x55bcb4=_0x4805ab[_0x04f3('0x3a')];if(!_0x5ba7d1[_0x04f3('0x34')][_0x04f3('0x3b')](_0x04f3('0x3c'))){_0x1b17a8[_0x04f3('0x21')]=qs[_0x04f3('0x21')](_0x5ba7d1[_0x04f3('0x34')]['limit']);_0x1b17a8['offset']=qs[_0x04f3('0x1f')](_0x5ba7d1[_0x04f3('0x34')][_0x04f3('0x1f')]);}return _0x2433f1['getConfigurations'](_0x1b17a8);}})['then'](function(_0xf17dc2){if(_0xf17dc2){return _0xf17dc2?{'count':_0x55bcb4,'rows':_0xf17dc2}:null;}})[_0x04f3('0x29')](respondWithResult(_0x253fbe,null))[_0x04f3('0x46')](handleError(_0x253fbe,null));};exports[_0x04f3('0x50')]=function(_0x3f3951,_0x3bee91,_0x4a82a2){if(_0x3f3951[_0x04f3('0x4b')]['id']){delete _0x3f3951[_0x04f3('0x4b')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x3f3951[_0x04f3('0x4c')]['id']}})[_0x04f3('0x29')](handleEntityNotFound(_0x3bee91,null))[_0x04f3('0x29')](function(_0x35e536){if(_0x35e536){_0x3f3951['body'][_0x04f3('0x51')]=_0x35e536['id'];_0x3f3951[_0x04f3('0x4b')][_0x04f3('0x52')]=integrations[_0x04f3('0x53')](_0x3f3951[_0x04f3('0x4b')][_0x04f3('0x54')],_0x3f3951[_0x04f3('0x4b')][_0x04f3('0x41')]);_0x3f3951[_0x04f3('0x4b')]['Descriptions']=integrations[_0x04f3('0x55')](_0x3f3951['body'][_0x04f3('0x54')],_0x3f3951['body'][_0x04f3('0x41')]);return db[_0x04f3('0x4e')][_0x04f3('0x4a')](_0x3f3951[_0x04f3('0x4b')],{'include':[{'model':db[_0x04f3('0x56')],'as':'Subjects'},{'model':db[_0x04f3('0x56')],'as':_0x04f3('0x57')}]});}return null;})[_0x04f3('0x29')](respondWithResult(_0x3bee91,null))[_0x04f3('0x46')](handleError(_0x3bee91,null));};exports[_0x04f3('0x58')]=function(_0xda0bf2,_0x234aa8,_0x33c6c1){var _0x3529b5;var _0x22c297='';var _0x150f1c=_0x04f3('0x59');return db[_0x04f3('0x30')][_0x04f3('0x5a')]({'where':{'id':_0xda0bf2[_0x04f3('0x4c')]['id']},'attributes':['id',_0x04f3('0x5b'),_0x04f3('0x5c'),_0x04f3('0x5d'),'username',_0x04f3('0x5e'),'securityToken']})[_0x04f3('0x29')](handleEntityNotFound(_0x234aa8,null))[_0x04f3('0x29')](function(_0x2a4558){if(_0x2a4558){_0x22c297=_0x2a4558[_0x04f3('0x5b')];var _0x2f9651=_0x22c297[_0x04f3('0x5f')](-0x1);if(_0x2f9651==='/'){_0x22c297=_0x22c297[_0x04f3('0x60')](0x0,_0x22c297[_0x04f3('0x61')](_0x2f9651));}_0x3529b5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x22c297,'clientId':_0x2a4558['clientId'],'clientSecret':_0x2a4558['clientSecret']}});return _0x3529b5['login'](_0x2a4558[_0x04f3('0x62')],_0x2a4558[_0x04f3('0x5e')][_0x04f3('0x63')](_0x2a4558[_0x04f3('0x64')]));}})['then'](function(_0x541c85){if(_0x541c85){if(!_[_0x04f3('0x65')](_0xda0bf2[_0x04f3('0x34')][_0x04f3('0x66')])){_0x150f1c=_0xda0bf2['query'][_0x04f3('0x66')];}return _0x3529b5[_0x04f3('0x67')](_0x150f1c)[_0x04f3('0x68')]();}})[_0x04f3('0x29')](function(_0x1f77e1){var _0x16fcef=[_0x04f3('0x69'),_0x04f3('0x6a'),_0x04f3('0x6b'),_0x04f3('0x6c'),_0x04f3('0x6d'),_0x04f3('0x6e')];var _0x96faf1=[_0x04f3('0x6f'),_0x04f3('0x70'),_0x04f3('0x71'),_0x04f3('0x72'),_0x04f3('0x73'),_0x04f3('0x74'),_0x04f3('0x75')];if(_0x1f77e1){_[_0x04f3('0x76')](_0x1f77e1[_0x04f3('0x39')],function(_0x2a650b){return _0x16fcef[_0x04f3('0x77')](_0x2a650b[_0x04f3('0x2d')])||!_0x96faf1['includes'](_0x2a650b[_0x04f3('0x41')]);});return{'count':_0x1f77e1[_0x04f3('0x39')][_0x04f3('0x3a')],'rows':_[_0x04f3('0x2f')](_0x1f77e1[_0x04f3('0x39')],function(_0x1357db){return{'id':_0x1357db[_0x04f3('0x2d')],'name':_0x1357db['label'],'custom':_0x1357db[_0x04f3('0x78')],'options':_0x1357db[_0x04f3('0x79')]['length']>0x0?_['map'](_0x1357db[_0x04f3('0x79')],function(_0x1d80cd){return{'name':_0x1d80cd[_0x04f3('0x7a')],'value':_0x1d80cd[_0x04f3('0x7b')]};}):_0x1357db['type']=='boolean'?[{'name':_0x04f3('0x7c'),'value':_0x04f3('0x7d')},{'name':_0x04f3('0x7e'),'value':_0x04f3('0x7f')}]:[]};})};}})[_0x04f3('0x29')](respondWithResult(_0x234aa8,null))['catch'](function(_0x220b3c){var _0x514862=_0xda0bf2[_0x04f3('0x34')][_0x04f3('0x80')]?0x1f4:_0x220b3c[_0x04f3('0x81')]||0x1f4;logger[_0x04f3('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x04f3('0x58'),_0x514862,JSON[_0x04f3('0x82')](_0x220b3c));delete _0x220b3c['name'];if(_0x514862===0x191){_0x514862=0x190;}_0x234aa8[_0x04f3('0x1d')](_0x514862)[_0x04f3('0x83')](_0xda0bf2['query'][_0x04f3('0x80')]?{'message':_0x04f3('0x84'),'statusCode':_0x220b3c[_0x04f3('0x81')]}:_0x220b3c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 188f112..225b769 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 _0xae4a=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x399095,_0x133dae){var _0x40a046=function(_0x1e6803){while(--_0x1e6803){_0x399095['push'](_0x399095['shift']());}};_0x40a046(++_0x133dae);}(_0xae4a,0x68));var _0xaae4=function(_0x359d58,_0x1b7180){_0x359d58=_0x359d58-0x0;var _0x236d0c=_0xae4a[_0x359d58];return _0x236d0c;};'use strict';var _=require(_0xaae4('0x0'));var util=require(_0xaae4('0x1'));var logger=require('../../config/logger')(_0xaae4('0x2'));var moment=require(_0xaae4('0x3'));var BPromise=require('bluebird');var rp=require(_0xaae4('0x4'));var fs=require('fs');var path=require(_0xaae4('0x5'));var rimraf=require(_0xaae4('0x6'));var config=require(_0xaae4('0x7'));var attributes=require(_0xaae4('0x8'));var integrations=require(_0xaae4('0x9'));module[_0xaae4('0xa')]=function(_0x454d54,_0x106f6b){return _0x454d54[_0xaae4('0xb')](_0xaae4('0xc'),attributes,{'tableName':_0xaae4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x993c=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','util','../../config/logger'];(function(_0x12e7c9,_0x3c852b){var _0x42703c=function(_0x1cef79){while(--_0x1cef79){_0x12e7c9['push'](_0x12e7c9['shift']());}};_0x42703c(++_0x3c852b);}(_0x993c,0x97));var _0xc993=function(_0x3f48e5,_0x283064){_0x3f48e5=_0x3f48e5-0x0;var _0x2c1a9d=_0x993c[_0x3f48e5];return _0x2c1a9d;};'use strict';var _=require(_0xc993('0x0'));var util=require(_0xc993('0x1'));var logger=require(_0xc993('0x2'))(_0xc993('0x3'));var moment=require('moment');var BPromise=require(_0xc993('0x4'));var rp=require(_0xc993('0x5'));var fs=require('fs');var path=require(_0xc993('0x6'));var rimraf=require(_0xc993('0x7'));var config=require(_0xc993('0x8'));var attributes=require(_0xc993('0x9'));var integrations=require(_0xc993('0xa'));module[_0xc993('0xb')]=function(_0x3ef79b,_0x444830){return _0x3ef79b[_0xc993('0xc')](_0xc993('0xd'),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 0520064..bb4fa2e 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 _0x1c9a=['catch','SalesforceAccount','options','where','attributes','limit','include','model','map','GetSalesforceAccount','ShowSalesforceAccount','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\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);}(_0x1c9a,0x124));var _0xa1c9=function(_0x2382a1,_0x37016e){_0x2382a1=_0x2382a1-0x0;var _0x184b20=_0x1c9a[_0x2382a1];return _0x184b20;};'use strict';var _=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require(_0xa1c9('0x5'));var logger=require(_0xa1c9('0x6'))(_0xa1c9('0x7'));var config=require(_0xa1c9('0x8'));var jayson=require(_0xa1c9('0x9'));var client=jayson[_0xa1c9('0xa')][_0xa1c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c0044,_0x22a683,_0x1e4b02){return new BPromise(function(_0x262691,_0x5b7e57){return client['request'](_0x4c0044,_0x1e4b02)[_0xa1c9('0xc')](function(_0x4b02af){logger[_0xa1c9('0xd')](_0xa1c9('0xe'),_0x22a683,_0xa1c9('0xf'));logger[_0xa1c9('0x10')](_0xa1c9('0x11'),_0x22a683,_0xa1c9('0xf'),JSON[_0xa1c9('0x12')](_0x4b02af));if(_0x4b02af[_0xa1c9('0x13')]){if(_0x4b02af[_0xa1c9('0x13')][_0xa1c9('0x14')]===0x1f4){logger[_0xa1c9('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x22a683,_0x4b02af['error']['message']);return _0x5b7e57(_0x4b02af['error']['message']);}logger[_0xa1c9('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x22a683,_0x4b02af[_0xa1c9('0x13')][_0xa1c9('0x15')]);return _0x262691(_0x4b02af[_0xa1c9('0x13')][_0xa1c9('0x15')]);}else{logger[_0xa1c9('0xd')](_0xa1c9('0xe'),_0x22a683,'request\x20sent');_0x262691(_0x4b02af[_0xa1c9('0x16')]['message']);}})[_0xa1c9('0x17')](function(_0x5a1114){logger['error'](_0xa1c9('0xe'),_0x22a683,_0x5a1114);_0x5b7e57(_0x5a1114);});});}exports['GetSalesforceAccount']=function(_0x42fa03){var _0x5c5639=this;return new Promise(function(_0x395c6a,_0x10914e){return db[_0xa1c9('0x18')]['findAll']({'raw':_0x42fa03[_0xa1c9('0x19')]?_0x42fa03[_0xa1c9('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x42fa03['options']?_0x42fa03[_0xa1c9('0x19')][_0xa1c9('0x1a')]||null:null,'attributes':_0x42fa03[_0xa1c9('0x19')]?_0x42fa03['options'][_0xa1c9('0x1b')]||null:null,'limit':_0x42fa03[_0xa1c9('0x19')]?_0x42fa03[_0xa1c9('0x19')][_0xa1c9('0x1c')]||null:null,'include':_0x42fa03[_0xa1c9('0x19')]?_0x42fa03[_0xa1c9('0x19')][_0xa1c9('0x1d')]?_['map'](_0x42fa03[_0xa1c9('0x19')][_0xa1c9('0x1d')],function(_0x135191){return{'model':db[_0x135191[_0xa1c9('0x1e')]],'as':_0x135191['as'],'attributes':_0x135191[_0xa1c9('0x1b')],'include':_0x135191['include']?_[_0xa1c9('0x1f')](_0x135191[_0xa1c9('0x1d')],function(_0x887f92){return{'model':db[_0x887f92[_0xa1c9('0x1e')]],'as':_0x887f92['as'],'attributes':_0x887f92[_0xa1c9('0x1b')],'include':_0x887f92[_0xa1c9('0x1d')]?_['map'](_0x887f92['include'],function(_0x2c7685){return{'model':db[_0x2c7685[_0xa1c9('0x1e')]],'as':_0x2c7685['as'],'attributes':_0x2c7685[_0xa1c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xc')](function(_0xf8f04a){logger['info'](_0xa1c9('0x20'),_0x42fa03);logger[_0xa1c9('0x10')](_0xa1c9('0x20'),_0x42fa03,JSON['stringify'](_0xf8f04a));_0x395c6a(_0xf8f04a);})[_0xa1c9('0x17')](function(_0x5df070){logger[_0xa1c9('0x13')]('GetSalesforceAccount',_0x5df070[_0xa1c9('0x15')],_0x42fa03);_0x10914e(_0x5c5639['error'](0x1f4,_0x5df070[_0xa1c9('0x15')]));});});};exports[_0xa1c9('0x21')]=function(_0x5e0721){var _0x2737cd=this;return new Promise(function(_0x5bf0ab,_0x23bbc9){return db[_0xa1c9('0x18')]['find']({'raw':_0x5e0721[_0xa1c9('0x19')]?_0x5e0721['options'][_0xa1c9('0x22')]===undefined?!![]:![]:!![],'where':_0x5e0721[_0xa1c9('0x19')]?_0x5e0721[_0xa1c9('0x19')][_0xa1c9('0x1a')]||null:null,'attributes':_0x5e0721[_0xa1c9('0x19')]?_0x5e0721[_0xa1c9('0x19')][_0xa1c9('0x1b')]||null:null,'include':_0x5e0721['options']?_0x5e0721[_0xa1c9('0x19')][_0xa1c9('0x1d')]?_[_0xa1c9('0x1f')](_0x5e0721[_0xa1c9('0x19')][_0xa1c9('0x1d')],function(_0x264fa2){return{'model':db[_0x264fa2[_0xa1c9('0x1e')]],'as':_0x264fa2['as'],'attributes':_0x264fa2[_0xa1c9('0x1b')],'include':_0x264fa2[_0xa1c9('0x1d')]?_[_0xa1c9('0x1f')](_0x264fa2[_0xa1c9('0x1d')],function(_0x56ab7b){return{'model':db[_0x56ab7b[_0xa1c9('0x1e')]],'as':_0x56ab7b['as'],'attributes':_0x56ab7b[_0xa1c9('0x1b')],'include':_0x56ab7b[_0xa1c9('0x1d')]?_[_0xa1c9('0x1f')](_0x56ab7b['include'],function(_0x55e83d){return{'model':db[_0x55e83d[_0xa1c9('0x1e')]],'as':_0x55e83d['as'],'attributes':_0x55e83d[_0xa1c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0xc')](function(_0x4ae5df){logger['info'](_0xa1c9('0x21'),_0x5e0721);logger[_0xa1c9('0x10')]('ShowSalesforceAccount',_0x5e0721,JSON[_0xa1c9('0x12')](_0x4ae5df));_0x5bf0ab(_0x4ae5df);})[_0xa1c9('0x17')](function(_0x1be562){logger[_0xa1c9('0x13')](_0xa1c9('0x21'),_0x1be562[_0xa1c9('0x15')],_0x5e0721);_0x23bbc9(_0x2737cd[_0xa1c9('0x13')](0x1f4,_0x1be562['message']));});});}; \ No newline at end of file +var _0xe367=['attributes','limit','include','model','map','ShowSalesforceAccount','where','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw'];(function(_0x2449d8,_0x222a8d){var _0x2d274a=function(_0x398bc9){while(--_0x398bc9){_0x2449d8['push'](_0x2449d8['shift']());}};_0x2d274a(++_0x222a8d);}(_0xe367,0x10f));var _0x7e36=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe367[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7e36('0x0'));var util=require(_0x7e36('0x1'));var moment=require(_0x7e36('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e36('0x3'));var db=require(_0x7e36('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e36('0x5'))(_0x7e36('0x6'));var config=require(_0x7e36('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7e36('0x8')][_0x7e36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7c9d,_0x39cef3,_0x435088){return new BPromise(function(_0x27a14b,_0x3afe26){return client[_0x7e36('0xa')](_0x3e7c9d,_0x435088)[_0x7e36('0xb')](function(_0x38f75e){logger[_0x7e36('0xc')](_0x7e36('0xd'),_0x39cef3,_0x7e36('0xe'));logger[_0x7e36('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x39cef3,_0x7e36('0xe'),JSON[_0x7e36('0x10')](_0x38f75e));if(_0x38f75e[_0x7e36('0x11')]){if(_0x38f75e[_0x7e36('0x11')]['code']===0x1f4){logger[_0x7e36('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x39cef3,_0x38f75e[_0x7e36('0x11')][_0x7e36('0x12')]);return _0x3afe26(_0x38f75e[_0x7e36('0x11')][_0x7e36('0x12')]);}logger['error'](_0x7e36('0xd'),_0x39cef3,_0x38f75e[_0x7e36('0x11')][_0x7e36('0x12')]);return _0x27a14b(_0x38f75e[_0x7e36('0x11')][_0x7e36('0x12')]);}else{logger[_0x7e36('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x39cef3,_0x7e36('0xe'));_0x27a14b(_0x38f75e[_0x7e36('0x13')][_0x7e36('0x12')]);}})[_0x7e36('0x14')](function(_0x243f8e){logger['error'](_0x7e36('0xd'),_0x39cef3,_0x243f8e);_0x3afe26(_0x243f8e);});});}exports[_0x7e36('0x15')]=function(_0x34574e){var _0xf210c8=this;return new Promise(function(_0x1d2226,_0xa28dda){return db[_0x7e36('0x16')][_0x7e36('0x17')]({'raw':_0x34574e[_0x7e36('0x18')]?_0x34574e[_0x7e36('0x18')][_0x7e36('0x19')]===undefined?!![]:![]:!![],'where':_0x34574e[_0x7e36('0x18')]?_0x34574e[_0x7e36('0x18')]['where']||null:null,'attributes':_0x34574e[_0x7e36('0x18')]?_0x34574e[_0x7e36('0x18')][_0x7e36('0x1a')]||null:null,'limit':_0x34574e[_0x7e36('0x18')]?_0x34574e[_0x7e36('0x18')][_0x7e36('0x1b')]||null:null,'include':_0x34574e['options']?_0x34574e[_0x7e36('0x18')]['include']?_['map'](_0x34574e[_0x7e36('0x18')][_0x7e36('0x1c')],function(_0x431f3e){return{'model':db[_0x431f3e[_0x7e36('0x1d')]],'as':_0x431f3e['as'],'attributes':_0x431f3e['attributes'],'include':_0x431f3e[_0x7e36('0x1c')]?_[_0x7e36('0x1e')](_0x431f3e['include'],function(_0x39748d){return{'model':db[_0x39748d[_0x7e36('0x1d')]],'as':_0x39748d['as'],'attributes':_0x39748d[_0x7e36('0x1a')],'include':_0x39748d[_0x7e36('0x1c')]?_[_0x7e36('0x1e')](_0x39748d[_0x7e36('0x1c')],function(_0x2597aa){return{'model':db[_0x2597aa['model']],'as':_0x2597aa['as'],'attributes':_0x2597aa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5872a8){logger[_0x7e36('0xc')](_0x7e36('0x15'),_0x34574e);logger[_0x7e36('0xf')]('GetSalesforceAccount',_0x34574e,JSON['stringify'](_0x5872a8));_0x1d2226(_0x5872a8);})['catch'](function(_0x5b8282){logger[_0x7e36('0x11')](_0x7e36('0x15'),_0x5b8282[_0x7e36('0x12')],_0x34574e);_0xa28dda(_0xf210c8[_0x7e36('0x11')](0x1f4,_0x5b8282['message']));});});};exports[_0x7e36('0x1f')]=function(_0x5cd59e){var _0x3ab4d9=this;return new Promise(function(_0x4a157c,_0x3cbc0b){return db[_0x7e36('0x16')]['find']({'raw':_0x5cd59e[_0x7e36('0x18')]?_0x5cd59e[_0x7e36('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5cd59e['options']?_0x5cd59e[_0x7e36('0x18')][_0x7e36('0x20')]||null:null,'attributes':_0x5cd59e[_0x7e36('0x18')]?_0x5cd59e[_0x7e36('0x18')][_0x7e36('0x1a')]||null:null,'include':_0x5cd59e[_0x7e36('0x18')]?_0x5cd59e[_0x7e36('0x18')][_0x7e36('0x1c')]?_[_0x7e36('0x1e')](_0x5cd59e[_0x7e36('0x18')][_0x7e36('0x1c')],function(_0xe1fd5e){return{'model':db[_0xe1fd5e['model']],'as':_0xe1fd5e['as'],'attributes':_0xe1fd5e[_0x7e36('0x1a')],'include':_0xe1fd5e[_0x7e36('0x1c')]?_[_0x7e36('0x1e')](_0xe1fd5e[_0x7e36('0x1c')],function(_0x2e015e){return{'model':db[_0x2e015e['model']],'as':_0x2e015e['as'],'attributes':_0x2e015e['attributes'],'include':_0x2e015e[_0x7e36('0x1c')]?_['map'](_0x2e015e['include'],function(_0x5ef48f){return{'model':db[_0x5ef48f[_0x7e36('0x1d')]],'as':_0x5ef48f['as'],'attributes':_0x5ef48f[_0x7e36('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7e36('0xb')](function(_0x5712df){logger[_0x7e36('0xc')](_0x7e36('0x1f'),_0x5cd59e);logger[_0x7e36('0xf')]('ShowSalesforceAccount',_0x5cd59e,JSON['stringify'](_0x5712df));_0x4a157c(_0x5712df);})[_0x7e36('0x14')](function(_0x16c159){logger[_0x7e36('0x11')]('ShowSalesforceAccount',_0x16c159[_0x7e36('0x12')],_0x5cd59e);_0x3cbc0b(_0x3ab4d9[_0x7e36('0x11')](0x1f4,_0x16c159[_0x7e36('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 07d51d8..3f0c9de 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2032,0xd9));var _0x2203=function(_0xbed03e,_0x510549){_0xbed03e=_0xbed03e-0x0;var _0x24921b=_0x2032[_0xbed03e];return _0x24921b;};'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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x33ead5,_0x5e26e0){var _0x1a84b0=function(_0xc66f20){while(--_0xc66f20){_0x33ead5['push'](_0x33ead5['shift']());}};_0x1a84b0(++_0x5e26e0);}(_0xadb5,0xad));var _0x5adb=function(_0x41cc4e,_0x4ee0ac){_0x41cc4e=_0x41cc4e-0x0;var _0x2d9484=_0xadb5[_0x41cc4e];return _0x2d9484;};'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('./intSalesforceConfiguration.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('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 7ae26c4..90c9cee 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 _0x3e40=['STRING','ENUM','Task','contact','lead','account_contact_lead','contact_lead','nothing','account','sequelize'];(function(_0x2053cd,_0x5c2d05){var _0xa91e07=function(_0x34b244){while(--_0x34b244){_0x2053cd['push'](_0x2053cd['shift']());}};_0xa91e07(++_0x5c2d05);}(_0x3e40,0xef));var _0x03e4=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x3e40[_0xea8947];return _0x2455e9;};'use strict';var Sequelize=require(_0x03e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x03e4('0x1')]},'description':{'type':Sequelize[_0x03e4('0x1')]},'ticketType':{'type':Sequelize[_0x03e4('0x2')](_0x03e4('0x3'),'Case'),'defaultValue':_0x03e4('0x3')},'moduleSearch':{'type':Sequelize[_0x03e4('0x2')]('contact_lead',_0x03e4('0x4'),_0x03e4('0x5'),_0x03e4('0x6'),'account'),'defaultValue':_0x03e4('0x7')},'moduleCreate':{'type':Sequelize[_0x03e4('0x2')](_0x03e4('0x8'),_0x03e4('0x4'),'lead',_0x03e4('0x9')),'defaultValue':_0x03e4('0x5')},'leadId':{'type':Sequelize[_0x03e4('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x03e4('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xedb4=['lead','exports','STRING','ENUM','Task','Case','contact_lead','contact','account_contact_lead','account','nothing'];(function(_0x54a858,_0x13d6d6){var _0x1cc506=function(_0x53ebb2){while(--_0x53ebb2){_0x54a858['push'](_0x54a858['shift']());}};_0x1cc506(++_0x13d6d6);}(_0xedb4,0x156));var _0x4edb=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xedb4[_0x292f93];return _0x5a94b1;};'use strict';var Sequelize=require('sequelize');module[_0x4edb('0x0')]={'name':{'type':Sequelize[_0x4edb('0x1')]},'description':{'type':Sequelize[_0x4edb('0x1')]},'ticketType':{'type':Sequelize[_0x4edb('0x2')](_0x4edb('0x3'),_0x4edb('0x4')),'defaultValue':_0x4edb('0x3')},'moduleSearch':{'type':Sequelize[_0x4edb('0x2')](_0x4edb('0x5'),_0x4edb('0x6'),'lead',_0x4edb('0x7'),_0x4edb('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x4edb('0x2')](_0x4edb('0x9'),'contact',_0x4edb('0xa'),_0x4edb('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x4edb('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x4edb('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x4edb('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x4edb('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 40007ae..8269f03 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 _0x92d4=['path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','send','index','map','SalesforceConfiguration','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','length','options','find','create','update','body','getFields','SalesforceField','order','pick','hasOwnProperty','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92d4,0x95));var _0x492d=function(_0x5b8807,_0x3bd721){_0x5b8807=_0x5b8807-0x0;var _0x2bd6af=_0x92d4[_0x5b8807];return _0x2bd6af;};'use strict';var emlformat=require(_0x492d('0x0'));var rimraf=require(_0x492d('0x1'));var zipdir=require(_0x492d('0x2'));var jsonpatch=require(_0x492d('0x3'));var rp=require('request-promise');var moment=require(_0x492d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x492d('0x5'));var util=require(_0x492d('0x6'));var path=require(_0x492d('0x7'));var sox=require('sox');var csv=require(_0x492d('0x8'));var ejs=require(_0x492d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x492d('0xa'));var squel=require(_0x492d('0xb'));var crypto=require(_0x492d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x492d('0xd'));var toCsv=require(_0x492d('0x8'));var querystring=require(_0x492d('0xe'));var Papa=require('papaparse');var Redis=require(_0x492d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x492d('0x10'));var logger=require(_0x492d('0x11'))(_0x492d('0x12'));var utils=require('../../config/utils');var config=require(_0x492d('0x13'));var licenseUtil=require(_0x492d('0x14'));var db=require(_0x492d('0x15'))['db'];function respondWithStatusCode(_0x128268,_0x52a873){_0x52a873=_0x52a873||0xcc;return function(_0x49dc8d){if(_0x49dc8d){return _0x128268[_0x492d('0x16')](_0x52a873);}return _0x128268[_0x492d('0x17')](_0x52a873)[_0x492d('0x18')]();};}function respondWithResult(_0x66b0be,_0x3288f5){_0x3288f5=_0x3288f5||0xc8;return function(_0x36af54){if(_0x36af54){return _0x66b0be[_0x492d('0x17')](_0x3288f5)[_0x492d('0x19')](_0x36af54);}};}function respondWithFilteredResult(_0x357aa5,_0x471ad8){return function(_0x4808d6){if(_0x4808d6){var _0x2713ae=typeof _0x471ad8[_0x492d('0x1a')]===_0x492d('0x1b')&&typeof _0x471ad8[_0x492d('0x1c')]===_0x492d('0x1b');var _0x22d0c7=_0x4808d6['count'];var _0x281ede=_0x2713ae?0x0:_0x471ad8['offset'];var _0x53ec40=_0x2713ae?_0x4808d6[_0x492d('0x1d')]:_0x471ad8[_0x492d('0x1a')]+_0x471ad8[_0x492d('0x1c')];var _0x3e0dd0;if(_0x53ec40>=_0x22d0c7){_0x53ec40=_0x22d0c7;_0x3e0dd0=0xc8;}else{_0x3e0dd0=0xce;}_0x357aa5[_0x492d('0x17')](_0x3e0dd0);return _0x357aa5[_0x492d('0x1e')](_0x492d('0x1f'),_0x281ede+'-'+_0x53ec40+'/'+_0x22d0c7)[_0x492d('0x19')](_0x4808d6);}return null;};}function patchUpdates(_0x12384c){return function(_0x2b7ee3){try{jsonpatch['apply'](_0x2b7ee3,_0x12384c,!![]);}catch(_0xf4ee38){return BPromise[_0x492d('0x20')](_0xf4ee38);}return _0x2b7ee3['save']();};}function saveUpdates(_0x1a2bfd,_0x552b96){return function(_0x5a0f1f){if(_0x5a0f1f){return _0x5a0f1f['update'](_0x1a2bfd)[_0x492d('0x21')](function(_0x53fcb9){return _0x53fcb9;});}return null;};}function removeEntity(_0xb1d146,_0x5434c2){return function(_0x479599){if(_0x479599){return _0x479599[_0x492d('0x22')]()['then'](function(){_0xb1d146[_0x492d('0x17')](0xcc)[_0x492d('0x18')]();});}};}function handleEntityNotFound(_0x5e0244,_0xdcc2c1){return function(_0x25dbae){if(!_0x25dbae){_0x5e0244[_0x492d('0x16')](0x194);}return _0x25dbae;};}function handleError(_0x412d01,_0x376e13){_0x376e13=_0x376e13||0x1f4;return function(_0x1691d5){logger[_0x492d('0x23')](_0x1691d5[_0x492d('0x24')]);if(_0x1691d5['name']){delete _0x1691d5['name'];}_0x412d01[_0x492d('0x17')](_0x376e13)[_0x492d('0x25')](_0x1691d5);};}exports[_0x492d('0x26')]=function(_0x50d6fa,_0x3f0028){var _0x522bb9={},_0x249f4a={},_0x4e6f41={'count':0x0,'rows':[]};var _0x1cb7fc=_[_0x492d('0x27')](db[_0x492d('0x28')]['rawAttributes'],function(_0x38fff6){return{'name':_0x38fff6[_0x492d('0x29')],'type':_0x38fff6[_0x492d('0x2a')]['key']};});_0x249f4a[_0x492d('0x2b')]=_[_0x492d('0x27')](_0x1cb7fc,_0x492d('0x2c'));_0x249f4a[_0x492d('0x2d')]=_[_0x492d('0x2e')](_0x50d6fa['query']);_0x249f4a[_0x492d('0x2f')]=_[_0x492d('0x30')](_0x249f4a[_0x492d('0x2b')],_0x249f4a[_0x492d('0x2d')]);_0x522bb9[_0x492d('0x31')]=_[_0x492d('0x30')](_0x249f4a['model'],qs[_0x492d('0x32')](_0x50d6fa[_0x492d('0x2d')][_0x492d('0x32')]));_0x522bb9[_0x492d('0x31')]=_0x522bb9[_0x492d('0x31')]['length']?_0x522bb9[_0x492d('0x31')]:_0x249f4a[_0x492d('0x2b')];if(!_0x50d6fa[_0x492d('0x2d')]['hasOwnProperty'](_0x492d('0x33'))){_0x522bb9['limit']=qs[_0x492d('0x1c')](_0x50d6fa[_0x492d('0x2d')][_0x492d('0x1c')]);_0x522bb9[_0x492d('0x1a')]=qs[_0x492d('0x1a')](_0x50d6fa['query'][_0x492d('0x1a')]);}_0x522bb9['order']=qs[_0x492d('0x34')](_0x50d6fa[_0x492d('0x2d')]['sort']);_0x522bb9[_0x492d('0x35')]=qs[_0x492d('0x2f')](_['pick'](_0x50d6fa[_0x492d('0x2d')],_0x249f4a[_0x492d('0x2f')]),_0x1cb7fc);if(_0x50d6fa['query'][_0x492d('0x36')]){_0x522bb9[_0x492d('0x35')]=_[_0x492d('0x37')](_0x522bb9['where'],{'$or':_[_0x492d('0x27')](_0x1cb7fc,function(_0x3cd67e){if(_0x3cd67e['type']!==_0x492d('0x38')){var _0x2f96bc={};_0x2f96bc[_0x3cd67e[_0x492d('0x2c')]]={'$like':'%'+_0x50d6fa['query'][_0x492d('0x36')]+'%'};return _0x2f96bc;}})});}_0x522bb9=_[_0x492d('0x37')]({},_0x522bb9,_0x50d6fa['options']);var _0x28dc8b={'where':_0x522bb9['where']};return db[_0x492d('0x28')]['count'](_0x28dc8b)[_0x492d('0x21')](function(_0x23be90){_0x4e6f41[_0x492d('0x1d')]=_0x23be90;if(_0x50d6fa[_0x492d('0x2d')][_0x492d('0x39')]){_0x522bb9[_0x492d('0x3a')]=[{'all':!![]}];}return db[_0x492d('0x28')][_0x492d('0x3b')](_0x522bb9);})['then'](function(_0x14f316){_0x4e6f41['rows']=_0x14f316;return _0x4e6f41;})[_0x492d('0x21')](respondWithFilteredResult(_0x3f0028,_0x522bb9))[_0x492d('0x3c')](handleError(_0x3f0028,null));};exports[_0x492d('0x3d')]=function(_0x3c44df,_0x59e8ff){var _0x221ad4={'raw':![],'where':{'id':_0x3c44df[_0x492d('0x3e')]['id']}},_0x498821={};_0x498821['model']=_[_0x492d('0x2e')](db[_0x492d('0x28')][_0x492d('0x3f')]);_0x498821['query']=_[_0x492d('0x2e')](_0x3c44df['query']);_0x498821[_0x492d('0x2f')]=_[_0x492d('0x30')](_0x498821['model'],_0x498821[_0x492d('0x2d')]);_0x221ad4[_0x492d('0x31')]=_['intersection'](_0x498821['model'],qs[_0x492d('0x32')](_0x3c44df[_0x492d('0x2d')][_0x492d('0x32')]));_0x221ad4[_0x492d('0x31')]=_0x221ad4[_0x492d('0x31')][_0x492d('0x40')]?_0x221ad4['attributes']:_0x498821[_0x492d('0x2b')];if(_0x3c44df[_0x492d('0x2d')][_0x492d('0x39')]){_0x221ad4[_0x492d('0x3a')]=[{'all':!![]}];}_0x221ad4=_[_0x492d('0x37')]({},_0x221ad4,_0x3c44df[_0x492d('0x41')]);return db[_0x492d('0x28')][_0x492d('0x42')](_0x221ad4)[_0x492d('0x21')](handleEntityNotFound(_0x59e8ff,null))[_0x492d('0x21')](respondWithResult(_0x59e8ff,null))[_0x492d('0x3c')](handleError(_0x59e8ff,null));};exports['create']=function(_0x33da19,_0x5a92c2){return db[_0x492d('0x28')][_0x492d('0x43')](_0x33da19['body'],{})[_0x492d('0x21')](respondWithResult(_0x5a92c2,0xc9))[_0x492d('0x3c')](handleError(_0x5a92c2,null));};exports[_0x492d('0x44')]=function(_0x273fd3,_0x3d1167){if(_0x273fd3[_0x492d('0x45')]['id']){delete _0x273fd3[_0x492d('0x45')]['id'];}return db['SalesforceConfiguration'][_0x492d('0x42')]({'where':{'id':_0x273fd3[_0x492d('0x3e')]['id']}})[_0x492d('0x21')](handleEntityNotFound(_0x3d1167,null))['then'](saveUpdates(_0x273fd3[_0x492d('0x45')],null))[_0x492d('0x21')](respondWithResult(_0x3d1167,null))[_0x492d('0x3c')](handleError(_0x3d1167,null));};exports['destroy']=function(_0x123ec5,_0x8c282a){return db[_0x492d('0x28')]['find']({'where':{'id':_0x123ec5['params']['id']}})[_0x492d('0x21')](handleEntityNotFound(_0x8c282a,null))[_0x492d('0x21')](removeEntity(_0x8c282a,null))[_0x492d('0x3c')](handleError(_0x8c282a,null));};exports[_0x492d('0x46')]=function(_0x431aa2,_0x22d25c,_0xe9d0b6){var _0x29bd30={};var _0x5caa02={};var _0x56c2f9;var _0x577a14;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x431aa2[_0x492d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x22d25c,null))[_0x492d('0x21')](function(_0x262a1f){if(_0x262a1f){_0x56c2f9=_0x262a1f;_0x5caa02[_0x492d('0x2b')]=_[_0x492d('0x2e')](db[_0x492d('0x47')][_0x492d('0x3f')]);_0x5caa02[_0x492d('0x2d')]=_[_0x492d('0x2e')](_0x431aa2[_0x492d('0x2d')]);_0x5caa02[_0x492d('0x2f')]=_[_0x492d('0x30')](_0x5caa02['model'],_0x5caa02[_0x492d('0x2d')]);_0x29bd30['attributes']=_['intersection'](_0x5caa02[_0x492d('0x2b')],qs[_0x492d('0x32')](_0x431aa2['query'][_0x492d('0x32')]));_0x29bd30[_0x492d('0x31')]=_0x29bd30[_0x492d('0x31')]['length']?_0x29bd30[_0x492d('0x31')]:_0x5caa02[_0x492d('0x2b')];_0x29bd30[_0x492d('0x48')]=qs['sort'](_0x431aa2['query'][_0x492d('0x34')]);_0x29bd30['where']=qs['filters'](_[_0x492d('0x49')](_0x431aa2['query'],_0x5caa02['filters']));if(_0x431aa2[_0x492d('0x2d')][_0x492d('0x36')]){_0x29bd30[_0x492d('0x35')]=_[_0x492d('0x37')](_0x29bd30['where'],{'$or':_[_0x492d('0x27')](_0x29bd30[_0x492d('0x31')],function(_0x5b94b8){var _0x14cbf6={};_0x14cbf6[_0x5b94b8]={'$like':'%'+_0x431aa2[_0x492d('0x2d')][_0x492d('0x36')]+'%'};return _0x14cbf6;})});}_0x29bd30=_['merge']({},_0x29bd30,_0x431aa2['options']);return _0x56c2f9[_0x492d('0x46')](_0x29bd30);}})[_0x492d('0x21')](function(_0xa8eed2){if(_0xa8eed2){_0x577a14=_0xa8eed2[_0x492d('0x40')];if(!_0x431aa2[_0x492d('0x2d')][_0x492d('0x4a')](_0x492d('0x33'))){_0x29bd30['limit']=qs[_0x492d('0x1c')](_0x431aa2[_0x492d('0x2d')]['limit']);_0x29bd30[_0x492d('0x1a')]=qs[_0x492d('0x1a')](_0x431aa2[_0x492d('0x2d')][_0x492d('0x1a')]);}return _0x56c2f9['getFields'](_0x29bd30);}})[_0x492d('0x21')](function(_0x2834b6){if(_0x2834b6){return _0x2834b6?{'count':_0x577a14,'rows':_0x2834b6}:null;}})['then'](respondWithResult(_0x22d25c,null))['catch'](handleError(_0x22d25c,null));};exports[_0x492d('0x4b')]=function(_0x57ffa0,_0x7e8a57,_0xdecb02){var _0xeb2f34={};var _0x20caab={};var _0x227339;var _0x2550f2;return db[_0x492d('0x28')]['findOne']({'where':{'id':_0x57ffa0[_0x492d('0x3e')]['id']}})[_0x492d('0x21')](handleEntityNotFound(_0x7e8a57,null))[_0x492d('0x21')](function(_0x5eb4a3){if(_0x5eb4a3){_0x227339=_0x5eb4a3;_0x20caab[_0x492d('0x2b')]=_['keys'](db[_0x492d('0x47')]['rawAttributes']);_0x20caab[_0x492d('0x2d')]=_[_0x492d('0x2e')](_0x57ffa0[_0x492d('0x2d')]);_0x20caab[_0x492d('0x2f')]=_['intersection'](_0x20caab['model'],_0x20caab[_0x492d('0x2d')]);_0xeb2f34[_0x492d('0x31')]=_[_0x492d('0x30')](_0x20caab[_0x492d('0x2b')],qs[_0x492d('0x32')](_0x57ffa0['query'][_0x492d('0x32')]));_0xeb2f34['attributes']=_0xeb2f34[_0x492d('0x31')][_0x492d('0x40')]?_0xeb2f34[_0x492d('0x31')]:_0x20caab[_0x492d('0x2b')];_0xeb2f34['order']=qs['sort'](_0x57ffa0[_0x492d('0x2d')][_0x492d('0x34')]);_0xeb2f34[_0x492d('0x35')]=qs['filters'](_[_0x492d('0x49')](_0x57ffa0[_0x492d('0x2d')],_0x20caab[_0x492d('0x2f')]));if(_0x57ffa0[_0x492d('0x2d')]['filter']){_0xeb2f34[_0x492d('0x35')]=_['merge'](_0xeb2f34[_0x492d('0x35')],{'$or':_[_0x492d('0x27')](_0xeb2f34['attributes'],function(_0x88a297){var _0x3bd07d={};_0x3bd07d[_0x88a297]={'$like':'%'+_0x57ffa0[_0x492d('0x2d')]['filter']+'%'};return _0x3bd07d;})});}_0xeb2f34=_['merge']({},_0xeb2f34,_0x57ffa0['options']);return _0x227339[_0x492d('0x4b')](_0xeb2f34);}})[_0x492d('0x21')](function(_0x44db51){if(_0x44db51){_0x2550f2=_0x44db51['length'];if(!_0x57ffa0['query']['hasOwnProperty'](_0x492d('0x33'))){_0xeb2f34[_0x492d('0x1c')]=qs[_0x492d('0x1c')](_0x57ffa0['query']['limit']);_0xeb2f34[_0x492d('0x1a')]=qs[_0x492d('0x1a')](_0x57ffa0[_0x492d('0x2d')][_0x492d('0x1a')]);}return _0x227339[_0x492d('0x4b')](_0xeb2f34);}})['then'](function(_0x1fb851){if(_0x1fb851){return _0x1fb851?{'count':_0x2550f2,'rows':_0x1fb851}:null;}})[_0x492d('0x21')](respondWithResult(_0x7e8a57,null))['catch'](handleError(_0x7e8a57,null));};exports[_0x492d('0x4c')]=function(_0x3ba618,_0x24e019,_0x37f968){var _0x20d9c3={};var _0x597e65={};var _0xd9c2;var _0x507a42;return db['SalesforceConfiguration'][_0x492d('0x4d')]({'where':{'id':_0x3ba618[_0x492d('0x3e')]['id']}})[_0x492d('0x21')](handleEntityNotFound(_0x24e019,null))[_0x492d('0x21')](function(_0xd369b4){if(_0xd369b4){_0xd9c2=_0xd369b4;_0x597e65[_0x492d('0x2b')]=_[_0x492d('0x2e')](db[_0x492d('0x47')][_0x492d('0x3f')]);_0x597e65[_0x492d('0x2d')]=_[_0x492d('0x2e')](_0x3ba618[_0x492d('0x2d')]);_0x597e65[_0x492d('0x2f')]=_[_0x492d('0x30')](_0x597e65[_0x492d('0x2b')],_0x597e65['query']);_0x20d9c3['attributes']=_[_0x492d('0x30')](_0x597e65[_0x492d('0x2b')],qs[_0x492d('0x32')](_0x3ba618[_0x492d('0x2d')]['fields']));_0x20d9c3['attributes']=_0x20d9c3['attributes'][_0x492d('0x40')]?_0x20d9c3[_0x492d('0x31')]:_0x597e65[_0x492d('0x2b')];_0x20d9c3['order']=qs['sort'](_0x3ba618[_0x492d('0x2d')][_0x492d('0x34')]);_0x20d9c3[_0x492d('0x35')]=qs[_0x492d('0x2f')](_['pick'](_0x3ba618[_0x492d('0x2d')],_0x597e65['filters']));if(_0x3ba618[_0x492d('0x2d')]['filter']){_0x20d9c3[_0x492d('0x35')]=_[_0x492d('0x37')](_0x20d9c3[_0x492d('0x35')],{'$or':_[_0x492d('0x27')](_0x20d9c3[_0x492d('0x31')],function(_0x12480d){var _0x382216={};_0x382216[_0x12480d]={'$like':'%'+_0x3ba618[_0x492d('0x2d')][_0x492d('0x36')]+'%'};return _0x382216;})});}_0x20d9c3=_[_0x492d('0x37')]({},_0x20d9c3,_0x3ba618['options']);return _0xd9c2[_0x492d('0x4c')](_0x20d9c3);}})[_0x492d('0x21')](function(_0x4c384c){if(_0x4c384c){_0x507a42=_0x4c384c['length'];if(!_0x3ba618[_0x492d('0x2d')][_0x492d('0x4a')](_0x492d('0x33'))){_0x20d9c3['limit']=qs[_0x492d('0x1c')](_0x3ba618[_0x492d('0x2d')]['limit']);_0x20d9c3[_0x492d('0x1a')]=qs[_0x492d('0x1a')](_0x3ba618['query'][_0x492d('0x1a')]);}return _0xd9c2['getDescriptions'](_0x20d9c3);}})['then'](function(_0x3b21a1){if(_0x3b21a1){return _0x3b21a1?{'count':_0x507a42,'rows':_0x3b21a1}:null;}})[_0x492d('0x21')](respondWithResult(_0x24e019,null))[_0x492d('0x3c')](handleError(_0x24e019,null));}; \ No newline at end of file +var _0xa12b=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','count','offset','limit','status','set','apply','reject','save','then','destroy','error','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','getFields','findOne','SalesforceField','order','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3f16bc,_0x467768){var _0x489881=function(_0x54a246){while(--_0x54a246){_0x3f16bc['push'](_0x3f16bc['shift']());}};_0x489881(++_0x467768);}(_0xa12b,0x175));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xba12('0x0'));var rimraf=require(_0xba12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba12('0x2'));var rp=require('request-promise');var moment=require(_0xba12('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xba12('0x4'));var util=require('util');var path=require(_0xba12('0x5'));var sox=require(_0xba12('0x6'));var csv=require(_0xba12('0x7'));var ejs=require(_0xba12('0x8'));var fs=require('fs');var fs_extra=require(_0xba12('0x9'));var _=require(_0xba12('0xa'));var squel=require(_0xba12('0xb'));var crypto=require(_0xba12('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba12('0x7'));var querystring=require(_0xba12('0xd'));var Papa=require(_0xba12('0xe'));var Redis=require(_0xba12('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xba12('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba12('0x11'));var logger=require(_0xba12('0x12'))(_0xba12('0x13'));var utils=require('../../config/utils');var config=require(_0xba12('0x14'));var licenseUtil=require(_0xba12('0x15'));var db=require(_0xba12('0x16'))['db'];function respondWithStatusCode(_0x4f3cc4,_0xf36ac6){_0xf36ac6=_0xf36ac6||0xcc;return function(_0x4907c9){if(_0x4907c9){return _0x4f3cc4[_0xba12('0x17')](_0xf36ac6);}return _0x4f3cc4['status'](_0xf36ac6)['end']();};}function respondWithResult(_0x30742f,_0x42170a){_0x42170a=_0x42170a||0xc8;return function(_0x2d1435){if(_0x2d1435){return _0x30742f['status'](_0x42170a)[_0xba12('0x18')](_0x2d1435);}};}function respondWithFilteredResult(_0x4cbb1d,_0x4f5cb2){return function(_0x2f4bfc){if(_0x2f4bfc){var _0x23f0bd=typeof _0x4f5cb2['offset']===_0xba12('0x19')&&typeof _0x4f5cb2['limit']===_0xba12('0x19');var _0x3a24a1=_0x2f4bfc[_0xba12('0x1a')];var _0x5c8233=_0x23f0bd?0x0:_0x4f5cb2[_0xba12('0x1b')];var _0x54bfe0=_0x23f0bd?_0x2f4bfc['count']:_0x4f5cb2[_0xba12('0x1b')]+_0x4f5cb2[_0xba12('0x1c')];var _0x1a4cff;if(_0x54bfe0>=_0x3a24a1){_0x54bfe0=_0x3a24a1;_0x1a4cff=0xc8;}else{_0x1a4cff=0xce;}_0x4cbb1d[_0xba12('0x1d')](_0x1a4cff);return _0x4cbb1d[_0xba12('0x1e')]('Content-Range',_0x5c8233+'-'+_0x54bfe0+'/'+_0x3a24a1)[_0xba12('0x18')](_0x2f4bfc);}return null;};}function patchUpdates(_0x130e50){return function(_0xc52344){try{jsonpatch[_0xba12('0x1f')](_0xc52344,_0x130e50,!![]);}catch(_0x17b0f0){return BPromise[_0xba12('0x20')](_0x17b0f0);}return _0xc52344[_0xba12('0x21')]();};}function saveUpdates(_0x84e80f,_0x14c813){return function(_0x2d2616){if(_0x2d2616){return _0x2d2616['update'](_0x84e80f)[_0xba12('0x22')](function(_0x8accff){return _0x8accff;});}return null;};}function removeEntity(_0x1f0738,_0x47795e){return function(_0x172c65){if(_0x172c65){return _0x172c65[_0xba12('0x23')]()['then'](function(){_0x1f0738[_0xba12('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4696a5,_0x14471c){return function(_0x117feb){if(!_0x117feb){_0x4696a5[_0xba12('0x17')](0x194);}return _0x117feb;};}function handleError(_0x2a14c2,_0x1c9e28){_0x1c9e28=_0x1c9e28||0x1f4;return function(_0x2d4ef0){logger[_0xba12('0x24')](_0x2d4ef0['stack']);if(_0x2d4ef0['name']){delete _0x2d4ef0[_0xba12('0x25')];}_0x2a14c2[_0xba12('0x1d')](_0x1c9e28)[_0xba12('0x26')](_0x2d4ef0);};}exports['index']=function(_0xc81110,_0xcdb51f){var _0x36db42={},_0x3c53f1={},_0x520025={'count':0x0,'rows':[]};var _0xbffb7e=_[_0xba12('0x27')](db[_0xba12('0x28')][_0xba12('0x29')],function(_0x2071ad){return{'name':_0x2071ad[_0xba12('0x2a')],'type':_0x2071ad[_0xba12('0x2b')][_0xba12('0x2c')]};});_0x3c53f1['model']=_['map'](_0xbffb7e,_0xba12('0x25'));_0x3c53f1[_0xba12('0x2d')]=_[_0xba12('0x2e')](_0xc81110[_0xba12('0x2d')]);_0x3c53f1['filters']=_[_0xba12('0x2f')](_0x3c53f1['model'],_0x3c53f1[_0xba12('0x2d')]);_0x36db42[_0xba12('0x30')]=_['intersection'](_0x3c53f1[_0xba12('0x31')],qs[_0xba12('0x32')](_0xc81110[_0xba12('0x2d')][_0xba12('0x32')]));_0x36db42[_0xba12('0x30')]=_0x36db42['attributes'][_0xba12('0x33')]?_0x36db42['attributes']:_0x3c53f1[_0xba12('0x31')];if(!_0xc81110[_0xba12('0x2d')][_0xba12('0x34')](_0xba12('0x35'))){_0x36db42[_0xba12('0x1c')]=qs[_0xba12('0x1c')](_0xc81110[_0xba12('0x2d')][_0xba12('0x1c')]);_0x36db42[_0xba12('0x1b')]=qs[_0xba12('0x1b')](_0xc81110[_0xba12('0x2d')][_0xba12('0x1b')]);}_0x36db42['order']=qs[_0xba12('0x36')](_0xc81110[_0xba12('0x2d')][_0xba12('0x36')]);_0x36db42['where']=qs[_0xba12('0x37')](_['pick'](_0xc81110[_0xba12('0x2d')],_0x3c53f1[_0xba12('0x37')]),_0xbffb7e);if(_0xc81110[_0xba12('0x2d')][_0xba12('0x38')]){_0x36db42[_0xba12('0x39')]=_['merge'](_0x36db42[_0xba12('0x39')],{'$or':_[_0xba12('0x27')](_0xbffb7e,function(_0x2fa2b8){if(_0x2fa2b8['type']!==_0xba12('0x3a')){var _0x152054={};_0x152054[_0x2fa2b8['name']]={'$like':'%'+_0xc81110['query'][_0xba12('0x38')]+'%'};return _0x152054;}})});}_0x36db42=_[_0xba12('0x3b')]({},_0x36db42,_0xc81110[_0xba12('0x3c')]);var _0x3341cf={'where':_0x36db42[_0xba12('0x39')]};return db[_0xba12('0x28')][_0xba12('0x1a')](_0x3341cf)[_0xba12('0x22')](function(_0x41d606){_0x520025[_0xba12('0x1a')]=_0x41d606;if(_0xc81110[_0xba12('0x2d')][_0xba12('0x3d')]){_0x36db42[_0xba12('0x3e')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x36db42);})['then'](function(_0x58abdb){_0x520025[_0xba12('0x3f')]=_0x58abdb;return _0x520025;})[_0xba12('0x22')](respondWithFilteredResult(_0xcdb51f,_0x36db42))[_0xba12('0x40')](handleError(_0xcdb51f,null));};exports[_0xba12('0x41')]=function(_0x2f97c5,_0x2e7c0f){var _0x180588={'raw':![],'where':{'id':_0x2f97c5[_0xba12('0x42')]['id']}},_0x2c55dc={};_0x2c55dc[_0xba12('0x31')]=_[_0xba12('0x2e')](db[_0xba12('0x28')][_0xba12('0x29')]);_0x2c55dc[_0xba12('0x2d')]=_['keys'](_0x2f97c5[_0xba12('0x2d')]);_0x2c55dc[_0xba12('0x37')]=_[_0xba12('0x2f')](_0x2c55dc[_0xba12('0x31')],_0x2c55dc['query']);_0x180588['attributes']=_[_0xba12('0x2f')](_0x2c55dc['model'],qs[_0xba12('0x32')](_0x2f97c5[_0xba12('0x2d')][_0xba12('0x32')]));_0x180588[_0xba12('0x30')]=_0x180588[_0xba12('0x30')][_0xba12('0x33')]?_0x180588[_0xba12('0x30')]:_0x2c55dc[_0xba12('0x31')];if(_0x2f97c5[_0xba12('0x2d')][_0xba12('0x3d')]){_0x180588['include']=[{'all':!![]}];}_0x180588=_[_0xba12('0x3b')]({},_0x180588,_0x2f97c5[_0xba12('0x3c')]);return db['SalesforceConfiguration'][_0xba12('0x43')](_0x180588)[_0xba12('0x22')](handleEntityNotFound(_0x2e7c0f,null))['then'](respondWithResult(_0x2e7c0f,null))[_0xba12('0x40')](handleError(_0x2e7c0f,null));};exports[_0xba12('0x44')]=function(_0x960d18,_0x4272a6){return db['SalesforceConfiguration']['create'](_0x960d18[_0xba12('0x45')],{})[_0xba12('0x22')](respondWithResult(_0x4272a6,0xc9))['catch'](handleError(_0x4272a6,null));};exports[_0xba12('0x46')]=function(_0x19265b,_0x40f8c9){if(_0x19265b[_0xba12('0x45')]['id']){delete _0x19265b[_0xba12('0x45')]['id'];}return db[_0xba12('0x28')][_0xba12('0x43')]({'where':{'id':_0x19265b['params']['id']}})[_0xba12('0x22')](handleEntityNotFound(_0x40f8c9,null))['then'](saveUpdates(_0x19265b['body'],null))[_0xba12('0x22')](respondWithResult(_0x40f8c9,null))[_0xba12('0x40')](handleError(_0x40f8c9,null));};exports[_0xba12('0x23')]=function(_0x4003f2,_0x3e39d9){return db['SalesforceConfiguration'][_0xba12('0x43')]({'where':{'id':_0x4003f2[_0xba12('0x42')]['id']}})[_0xba12('0x22')](handleEntityNotFound(_0x3e39d9,null))[_0xba12('0x22')](removeEntity(_0x3e39d9,null))['catch'](handleError(_0x3e39d9,null));};exports[_0xba12('0x47')]=function(_0x3b5f6b,_0x365d01,_0x2b1bcc){var _0x547288={};var _0x2714fc={};var _0x1d5a68;var _0x5a5302;return db[_0xba12('0x28')][_0xba12('0x48')]({'where':{'id':_0x3b5f6b[_0xba12('0x42')]['id']}})[_0xba12('0x22')](handleEntityNotFound(_0x365d01,null))[_0xba12('0x22')](function(_0xe4b07){if(_0xe4b07){_0x1d5a68=_0xe4b07;_0x2714fc[_0xba12('0x31')]=_[_0xba12('0x2e')](db[_0xba12('0x49')][_0xba12('0x29')]);_0x2714fc[_0xba12('0x2d')]=_[_0xba12('0x2e')](_0x3b5f6b[_0xba12('0x2d')]);_0x2714fc[_0xba12('0x37')]=_['intersection'](_0x2714fc[_0xba12('0x31')],_0x2714fc[_0xba12('0x2d')]);_0x547288['attributes']=_['intersection'](_0x2714fc[_0xba12('0x31')],qs['fields'](_0x3b5f6b[_0xba12('0x2d')][_0xba12('0x32')]));_0x547288[_0xba12('0x30')]=_0x547288[_0xba12('0x30')][_0xba12('0x33')]?_0x547288['attributes']:_0x2714fc[_0xba12('0x31')];_0x547288[_0xba12('0x4a')]=qs['sort'](_0x3b5f6b[_0xba12('0x2d')][_0xba12('0x36')]);_0x547288[_0xba12('0x39')]=qs[_0xba12('0x37')](_[_0xba12('0x4b')](_0x3b5f6b[_0xba12('0x2d')],_0x2714fc[_0xba12('0x37')]));if(_0x3b5f6b[_0xba12('0x2d')][_0xba12('0x38')]){_0x547288[_0xba12('0x39')]=_['merge'](_0x547288[_0xba12('0x39')],{'$or':_['map'](_0x547288[_0xba12('0x30')],function(_0x35f851){var _0x3b0c9e={};_0x3b0c9e[_0x35f851]={'$like':'%'+_0x3b5f6b[_0xba12('0x2d')][_0xba12('0x38')]+'%'};return _0x3b0c9e;})});}_0x547288=_[_0xba12('0x3b')]({},_0x547288,_0x3b5f6b[_0xba12('0x3c')]);return _0x1d5a68['getFields'](_0x547288);}})[_0xba12('0x22')](function(_0x362c9c){if(_0x362c9c){_0x5a5302=_0x362c9c[_0xba12('0x33')];if(!_0x3b5f6b[_0xba12('0x2d')]['hasOwnProperty']('nolimit')){_0x547288[_0xba12('0x1c')]=qs[_0xba12('0x1c')](_0x3b5f6b[_0xba12('0x2d')][_0xba12('0x1c')]);_0x547288[_0xba12('0x1b')]=qs['offset'](_0x3b5f6b[_0xba12('0x2d')][_0xba12('0x1b')]);}return _0x1d5a68[_0xba12('0x47')](_0x547288);}})[_0xba12('0x22')](function(_0x5d1080){if(_0x5d1080){return _0x5d1080?{'count':_0x5a5302,'rows':_0x5d1080}:null;}})[_0xba12('0x22')](respondWithResult(_0x365d01,null))[_0xba12('0x40')](handleError(_0x365d01,null));};exports[_0xba12('0x4c')]=function(_0x346a39,_0x4ff28f,_0x3a3579){var _0x3fab4c={};var _0x3a5a8b={};var _0x4acb76;var _0x44c46c;return db[_0xba12('0x28')]['findOne']({'where':{'id':_0x346a39[_0xba12('0x42')]['id']}})[_0xba12('0x22')](handleEntityNotFound(_0x4ff28f,null))[_0xba12('0x22')](function(_0x13b781){if(_0x13b781){_0x4acb76=_0x13b781;_0x3a5a8b[_0xba12('0x31')]=_[_0xba12('0x2e')](db[_0xba12('0x49')][_0xba12('0x29')]);_0x3a5a8b[_0xba12('0x2d')]=_[_0xba12('0x2e')](_0x346a39[_0xba12('0x2d')]);_0x3a5a8b[_0xba12('0x37')]=_['intersection'](_0x3a5a8b[_0xba12('0x31')],_0x3a5a8b[_0xba12('0x2d')]);_0x3fab4c[_0xba12('0x30')]=_[_0xba12('0x2f')](_0x3a5a8b['model'],qs[_0xba12('0x32')](_0x346a39[_0xba12('0x2d')][_0xba12('0x32')]));_0x3fab4c['attributes']=_0x3fab4c['attributes'][_0xba12('0x33')]?_0x3fab4c[_0xba12('0x30')]:_0x3a5a8b['model'];_0x3fab4c[_0xba12('0x4a')]=qs[_0xba12('0x36')](_0x346a39['query'][_0xba12('0x36')]);_0x3fab4c[_0xba12('0x39')]=qs[_0xba12('0x37')](_[_0xba12('0x4b')](_0x346a39['query'],_0x3a5a8b[_0xba12('0x37')]));if(_0x346a39[_0xba12('0x2d')]['filter']){_0x3fab4c[_0xba12('0x39')]=_[_0xba12('0x3b')](_0x3fab4c['where'],{'$or':_[_0xba12('0x27')](_0x3fab4c['attributes'],function(_0x591d29){var _0x272adc={};_0x272adc[_0x591d29]={'$like':'%'+_0x346a39[_0xba12('0x2d')][_0xba12('0x38')]+'%'};return _0x272adc;})});}_0x3fab4c=_[_0xba12('0x3b')]({},_0x3fab4c,_0x346a39['options']);return _0x4acb76[_0xba12('0x4c')](_0x3fab4c);}})[_0xba12('0x22')](function(_0x3f826e){if(_0x3f826e){_0x44c46c=_0x3f826e[_0xba12('0x33')];if(!_0x346a39[_0xba12('0x2d')]['hasOwnProperty']('nolimit')){_0x3fab4c[_0xba12('0x1c')]=qs[_0xba12('0x1c')](_0x346a39['query'][_0xba12('0x1c')]);_0x3fab4c[_0xba12('0x1b')]=qs[_0xba12('0x1b')](_0x346a39[_0xba12('0x2d')]['offset']);}return _0x4acb76[_0xba12('0x4c')](_0x3fab4c);}})['then'](function(_0x4be0fe){if(_0x4be0fe){return _0x4be0fe?{'count':_0x44c46c,'rows':_0x4be0fe}:null;}})[_0xba12('0x22')](respondWithResult(_0x4ff28f,null))['catch'](handleError(_0x4ff28f,null));};exports['getDescriptions']=function(_0x8129d4,_0x12bf58,_0x21dd42){var _0x1f4757={};var _0x3c35c5={};var _0x4c29b2;var _0x5d23e1;return db[_0xba12('0x28')][_0xba12('0x48')]({'where':{'id':_0x8129d4['params']['id']}})[_0xba12('0x22')](handleEntityNotFound(_0x12bf58,null))[_0xba12('0x22')](function(_0x2b7b8b){if(_0x2b7b8b){_0x4c29b2=_0x2b7b8b;_0x3c35c5[_0xba12('0x31')]=_[_0xba12('0x2e')](db[_0xba12('0x49')][_0xba12('0x29')]);_0x3c35c5['query']=_[_0xba12('0x2e')](_0x8129d4[_0xba12('0x2d')]);_0x3c35c5['filters']=_[_0xba12('0x2f')](_0x3c35c5['model'],_0x3c35c5[_0xba12('0x2d')]);_0x1f4757[_0xba12('0x30')]=_[_0xba12('0x2f')](_0x3c35c5[_0xba12('0x31')],qs[_0xba12('0x32')](_0x8129d4[_0xba12('0x2d')]['fields']));_0x1f4757[_0xba12('0x30')]=_0x1f4757['attributes'][_0xba12('0x33')]?_0x1f4757['attributes']:_0x3c35c5['model'];_0x1f4757[_0xba12('0x4a')]=qs[_0xba12('0x36')](_0x8129d4['query'][_0xba12('0x36')]);_0x1f4757[_0xba12('0x39')]=qs[_0xba12('0x37')](_[_0xba12('0x4b')](_0x8129d4['query'],_0x3c35c5[_0xba12('0x37')]));if(_0x8129d4[_0xba12('0x2d')][_0xba12('0x38')]){_0x1f4757[_0xba12('0x39')]=_[_0xba12('0x3b')](_0x1f4757[_0xba12('0x39')],{'$or':_[_0xba12('0x27')](_0x1f4757[_0xba12('0x30')],function(_0x80fa99){var _0x3d63f3={};_0x3d63f3[_0x80fa99]={'$like':'%'+_0x8129d4['query'][_0xba12('0x38')]+'%'};return _0x3d63f3;})});}_0x1f4757=_[_0xba12('0x3b')]({},_0x1f4757,_0x8129d4[_0xba12('0x3c')]);return _0x4c29b2['getDescriptions'](_0x1f4757);}})['then'](function(_0x31ac57){if(_0x31ac57){_0x5d23e1=_0x31ac57[_0xba12('0x33')];if(!_0x8129d4[_0xba12('0x2d')][_0xba12('0x34')](_0xba12('0x35'))){_0x1f4757[_0xba12('0x1c')]=qs[_0xba12('0x1c')](_0x8129d4[_0xba12('0x2d')][_0xba12('0x1c')]);_0x1f4757[_0xba12('0x1b')]=qs[_0xba12('0x1b')](_0x8129d4[_0xba12('0x2d')]['offset']);}return _0x4c29b2[_0xba12('0x4d')](_0x1f4757);}})[_0xba12('0x22')](function(_0x2f7c8f){if(_0x2f7c8f){return _0x2f7c8f?{'count':_0x5d23e1,'rows':_0x2f7c8f}:null;}})[_0xba12('0x22')](respondWithResult(_0x12bf58,null))[_0xba12('0x40')](handleError(_0x12bf58,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c843452..de9cf9b 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 _0xa67b=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x3baeef,_0x38a155){var _0x198310=function(_0x2ced98){while(--_0x2ced98){_0x3baeef['push'](_0x3baeef['shift']());}};_0x198310(++_0x38a155);}(_0xa67b,0xc5));var _0xba67=function(_0x3106ed,_0x3dd87b){_0x3106ed=_0x3106ed-0x0;var _0x1f8cab=_0xa67b[_0x3106ed];return _0x1f8cab;};'use strict';var _=require(_0xba67('0x0'));var util=require(_0xba67('0x1'));var logger=require(_0xba67('0x2'))('api');var moment=require(_0xba67('0x3'));var BPromise=require('bluebird');var rp=require(_0xba67('0x4'));var fs=require('fs');var path=require(_0xba67('0x5'));var rimraf=require('rimraf');var config=require(_0xba67('0x6'));var attributes=require(_0xba67('0x7'));module['exports']=function(_0x7f1b9d,_0x197915){return _0x7f1b9d[_0xba67('0x8')](_0xba67('0x9'),attributes,{'tableName':_0xba67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8945=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5796bf,_0x2c93ef){var _0x1aba5c=function(_0xefcd2d){while(--_0xefcd2d){_0x5796bf['push'](_0x5796bf['shift']());}};_0x1aba5c(++_0x2c93ef);}(_0x8945,0x132));var _0x5894=function(_0x9d6743,_0x34c550){_0x9d6743=_0x9d6743-0x0;var _0x54af8e=_0x8945[_0x9d6743];return _0x54af8e;};'use strict';var _=require(_0x5894('0x0'));var util=require(_0x5894('0x1'));var logger=require(_0x5894('0x2'))(_0x5894('0x3'));var moment=require(_0x5894('0x4'));var BPromise=require(_0x5894('0x5'));var rp=require(_0x5894('0x6'));var fs=require('fs');var path=require(_0x5894('0x7'));var rimraf=require(_0x5894('0x8'));var config=require(_0x5894('0x9'));var attributes=require(_0x5894('0xa'));module['exports']=function(_0x4460f0,_0x58e8f1){return _0x4460f0[_0x5894('0xb')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 430c854..3865db6 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 _0x688e=['http','request','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x294296,_0x72fbf2){var _0x1c79c3=function(_0x1fa589){while(--_0x1fa589){_0x294296['push'](_0x294296['shift']());}};_0x1c79c3(++_0x72fbf2);}(_0x688e,0x70));var _0xe688=function(_0x105174,_0x3028e9){_0x105174=_0x105174-0x0;var _0x113d2b=_0x688e[_0x105174];return _0x113d2b;};'use strict';var _=require(_0xe688('0x0'));var util=require(_0xe688('0x1'));var moment=require(_0xe688('0x2'));var BPromise=require('bluebird');var rs=require(_0xe688('0x3'));var fs=require('fs');var Redis=require(_0xe688('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe688('0x5'));var logger=require(_0xe688('0x6'))('rpc');var config=require(_0xe688('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe688('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cf9b7,_0x37537e,_0x20602b){return new BPromise(function(_0x1543b1,_0x4e66d4){return client[_0xe688('0x9')](_0x3cf9b7,_0x20602b)['then'](function(_0x2328f1){logger['info'](_0xe688('0xa'),_0x37537e,'request\x20sent');logger['debug'](_0xe688('0xb'),_0x37537e,_0xe688('0xc'),JSON[_0xe688('0xd')](_0x2328f1));if(_0x2328f1[_0xe688('0xe')]){if(_0x2328f1[_0xe688('0xe')][_0xe688('0xf')]===0x1f4){logger['error'](_0xe688('0xa'),_0x37537e,_0x2328f1[_0xe688('0xe')][_0xe688('0x10')]);return _0x4e66d4(_0x2328f1[_0xe688('0xe')][_0xe688('0x10')]);}logger['error'](_0xe688('0xa'),_0x37537e,_0x2328f1[_0xe688('0xe')]['message']);return _0x1543b1(_0x2328f1['error'][_0xe688('0x10')]);}else{logger[_0xe688('0x11')](_0xe688('0xa'),_0x37537e,_0xe688('0xc'));_0x1543b1(_0x2328f1[_0xe688('0x12')][_0xe688('0x10')]);}})[_0xe688('0x13')](function(_0x9689e6){logger[_0xe688('0xe')](_0xe688('0xa'),_0x37537e,_0x9689e6);_0x4e66d4(_0x9689e6);});});} \ No newline at end of file +var _0xbf55=['jayson/promise','client','then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0xbf55,0x19c));var _0x5bf5=function(_0x19ec02,_0x222aff){_0x19ec02=_0x19ec02-0x0;var _0x1c8fb0=_0xbf55[_0x19ec02];return _0x1c8fb0;};'use strict';var _=require(_0x5bf5('0x0'));var util=require('util');var moment=require(_0x5bf5('0x1'));var BPromise=require(_0x5bf5('0x2'));var rs=require(_0x5bf5('0x3'));var fs=require('fs');var Redis=require(_0x5bf5('0x4'));var db=require(_0x5bf5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bf5('0x6'))('rpc');var config=require(_0x5bf5('0x7'));var jayson=require(_0x5bf5('0x8'));var client=jayson[_0x5bf5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bed77,_0x190f0f,_0x19d46){return new BPromise(function(_0x250a28,_0x2fd4fb){return client['request'](_0x5bed77,_0x19d46)[_0x5bf5('0xa')](function(_0x3116f3){logger[_0x5bf5('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x190f0f,'request\x20sent');logger['debug'](_0x5bf5('0xc'),_0x190f0f,_0x5bf5('0xd'),JSON[_0x5bf5('0xe')](_0x3116f3));if(_0x3116f3[_0x5bf5('0xf')]){if(_0x3116f3['error'][_0x5bf5('0x10')]===0x1f4){logger[_0x5bf5('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x190f0f,_0x3116f3['error'][_0x5bf5('0x11')]);return _0x2fd4fb(_0x3116f3[_0x5bf5('0xf')][_0x5bf5('0x11')]);}logger[_0x5bf5('0xf')](_0x5bf5('0x12'),_0x190f0f,_0x3116f3[_0x5bf5('0xf')][_0x5bf5('0x11')]);return _0x250a28(_0x3116f3[_0x5bf5('0xf')][_0x5bf5('0x11')]);}else{logger['info'](_0x5bf5('0x12'),_0x190f0f,_0x5bf5('0xd'));_0x250a28(_0x3116f3[_0x5bf5('0x13')][_0x5bf5('0x11')]);}})['catch'](function(_0x102f19){logger[_0x5bf5('0xf')](_0x5bf5('0x12'),_0x190f0f,_0x102f19);_0x2fd4fb(_0x102f19);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index cfcd6a8..8e81cad 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 _0xf877=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router'];(function(_0x292f4f,_0x50d6e3){var _0x2b9238=function(_0x55c207){while(--_0x55c207){_0x292f4f['push'](_0x292f4f['shift']());}};_0x2b9238(++_0x50d6e3);}(_0xf877,0x6e));var _0x7f87=function(_0x2e03ff,_0x5525a1){_0x2e03ff=_0x2e03ff-0x0;var _0x55fee0=_0xf877[_0x2e03ff];return _0x55fee0;};'use strict';var multer=require(_0x7f87('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7f87('0x1'));var express=require(_0x7f87('0x2'));var router=express[_0x7f87('0x3')]();var fs_extra=require(_0x7f87('0x4'));var auth=require(_0x7f87('0x5'));var interaction=require(_0x7f87('0x6'));var config=require(_0x7f87('0x7'));var controller=require('./intSalesforceField.controller');router[_0x7f87('0x8')]('/',auth[_0x7f87('0x9')](),controller[_0x7f87('0xa')]);router[_0x7f87('0x8')]('/:id',auth[_0x7f87('0x9')](),controller[_0x7f87('0xb')]);router[_0x7f87('0xc')]('/',auth[_0x7f87('0x9')](),controller[_0x7f87('0xd')]);router[_0x7f87('0xe')](_0x7f87('0xf'),auth['isAuthenticated'](),controller[_0x7f87('0x10')]);router[_0x7f87('0x11')](_0x7f87('0xf'),auth[_0x7f87('0x9')](),controller[_0x7f87('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb55b=['put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xb55b,0x130));var _0xbb55=function(_0x46e421,_0x1eeabf){_0x46e421=_0x46e421-0x0;var _0x3bc5b9=_0xb55b[_0x46e421];return _0x3bc5b9;};'use strict';var multer=require(_0xbb55('0x0'));var util=require(_0xbb55('0x1'));var path=require(_0xbb55('0x2'));var timeout=require('connect-timeout');var express=require(_0xbb55('0x3'));var router=express[_0xbb55('0x4')]();var fs_extra=require(_0xbb55('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbb55('0x6'));var config=require(_0xbb55('0x7'));var controller=require(_0xbb55('0x8'));router[_0xbb55('0x9')]('/',auth[_0xbb55('0xa')](),controller[_0xbb55('0xb')]);router[_0xbb55('0x9')](_0xbb55('0xc'),auth[_0xbb55('0xa')](),controller[_0xbb55('0xd')]);router[_0xbb55('0xe')]('/',auth[_0xbb55('0xa')](),controller[_0xbb55('0xf')]);router[_0xbb55('0x10')](_0xbb55('0xc'),auth[_0xbb55('0xa')](),controller[_0xbb55('0x11')]);router[_0xbb55('0x12')](_0xbb55('0xc'),auth[_0xbb55('0xa')](),controller['destroy']);module[_0xbb55('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index efc4c85..cbf2263 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 _0x318b=['STRING','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x318b,0x1f1));var _0xb318=function(_0x49d7ca,_0x514fc4){_0x49d7ca=_0x49d7ca-0x0;var _0x12422f=_0x318b[_0x49d7ca];return _0x12422f;};'use strict';var Sequelize=require('sequelize');module[_0xb318('0x0')]={'type':{'type':Sequelize[_0xb318('0x1')](_0xb318('0x2'),_0xb318('0x3'),_0xb318('0x4'),_0xb318('0x5'),_0xb318('0x6')),'defaultValue':_0xb318('0x2')},'content':{'type':Sequelize[_0xb318('0x7')]},'key':{'type':Sequelize[_0xb318('0x7')]},'keyType':{'type':Sequelize[_0xb318('0x1')](_0xb318('0x2'),_0xb318('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb318('0x7')]},'idField':{'type':Sequelize[_0xb318('0x7')]},'variableName':{'type':Sequelize[_0xb318('0x7')]}}; \ No newline at end of file +var _0x43ab=['picklist','STRING','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x43ab,0xda));var _0xb43a=function(_0x2d53ff,_0x5a8ae2){_0x2d53ff=_0x2d53ff-0x0;var _0x5e49be=_0x43ab[_0x2d53ff];return _0x5e49be;};'use strict';var Sequelize=require(_0xb43a('0x0'));module[_0xb43a('0x1')]={'type':{'type':Sequelize[_0xb43a('0x2')](_0xb43a('0x3'),'variable',_0xb43a('0x4'),_0xb43a('0x5'),_0xb43a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb43a('0x7')]},'key':{'type':Sequelize[_0xb43a('0x7')]},'keyType':{'type':Sequelize[_0xb43a('0x2')](_0xb43a('0x3'),'variable',_0xb43a('0x4'))},'keyContent':{'type':Sequelize[_0xb43a('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xb43a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index d25b5f8..364cf2c 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 _0x7093=['name','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','merge','SalesforceField','includeAll','include','catch','show','params','keys','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack'];(function(_0xfc5040,_0x2b1ef9){var _0x5e8163=function(_0x5a2252){while(--_0x5a2252){_0xfc5040['push'](_0xfc5040['shift']());}};_0x5e8163(++_0x2b1ef9);}(_0x7093,0x149));var _0x3709=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7093[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x3709('0x0'));var rimraf=require(_0x3709('0x1'));var zipdir=require(_0x3709('0x2'));var jsonpatch=require(_0x3709('0x3'));var rp=require(_0x3709('0x4'));var moment=require(_0x3709('0x5'));var BPromise=require(_0x3709('0x6'));var Mustache=require(_0x3709('0x7'));var util=require(_0x3709('0x8'));var path=require(_0x3709('0x9'));var sox=require('sox');var csv=require(_0x3709('0xa'));var ejs=require(_0x3709('0xb'));var fs=require('fs');var fs_extra=require(_0x3709('0xc'));var _=require(_0x3709('0xd'));var squel=require(_0x3709('0xe'));var crypto=require(_0x3709('0xf'));var jsforce=require(_0x3709('0x10'));var deskjs=require(_0x3709('0x11'));var toCsv=require(_0x3709('0xa'));var querystring=require(_0x3709('0x12'));var Papa=require(_0x3709('0x13'));var Redis=require(_0x3709('0x14'));var authService=require(_0x3709('0x15'));var qs=require(_0x3709('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3709('0x17'))(_0x3709('0x18'));var utils=require(_0x3709('0x19'));var config=require(_0x3709('0x1a'));var licenseUtil=require(_0x3709('0x1b'));var db=require(_0x3709('0x1c'))['db'];function respondWithStatusCode(_0x36c3a8,_0x3eb4ee){_0x3eb4ee=_0x3eb4ee||0xcc;return function(_0xdc92ad){if(_0xdc92ad){return _0x36c3a8[_0x3709('0x1d')](_0x3eb4ee);}return _0x36c3a8[_0x3709('0x1e')](_0x3eb4ee)[_0x3709('0x1f')]();};}function respondWithResult(_0x863abb,_0x4c2863){_0x4c2863=_0x4c2863||0xc8;return function(_0x497414){if(_0x497414){return _0x863abb[_0x3709('0x1e')](_0x4c2863)[_0x3709('0x20')](_0x497414);}};}function respondWithFilteredResult(_0x4dadc4,_0x27a93f){return function(_0x29a60e){if(_0x29a60e){var _0x5ece65=typeof _0x27a93f[_0x3709('0x21')]===_0x3709('0x22')&&typeof _0x27a93f[_0x3709('0x23')]==='undefined';var _0x542174=_0x29a60e['count'];var _0x71f966=_0x5ece65?0x0:_0x27a93f[_0x3709('0x21')];var _0x3451bb=_0x5ece65?_0x29a60e[_0x3709('0x24')]:_0x27a93f[_0x3709('0x21')]+_0x27a93f[_0x3709('0x23')];var _0x457ebf;if(_0x3451bb>=_0x542174){_0x3451bb=_0x542174;_0x457ebf=0xc8;}else{_0x457ebf=0xce;}_0x4dadc4[_0x3709('0x1e')](_0x457ebf);return _0x4dadc4[_0x3709('0x25')](_0x3709('0x26'),_0x71f966+'-'+_0x3451bb+'/'+_0x542174)[_0x3709('0x20')](_0x29a60e);}return null;};}function patchUpdates(_0x170af5){return function(_0xa81497){try{jsonpatch[_0x3709('0x27')](_0xa81497,_0x170af5,!![]);}catch(_0x1583b4){return BPromise[_0x3709('0x28')](_0x1583b4);}return _0xa81497[_0x3709('0x29')]();};}function saveUpdates(_0x5d178b,_0x106105){return function(_0x3ca01f){if(_0x3ca01f){return _0x3ca01f['update'](_0x5d178b)['then'](function(_0x280385){return _0x280385;});}return null;};}function removeEntity(_0x5c58ed,_0x1fa7ba){return function(_0x501edb){if(_0x501edb){return _0x501edb[_0x3709('0x2a')]()[_0x3709('0x2b')](function(){_0x5c58ed[_0x3709('0x1e')](0xcc)[_0x3709('0x1f')]();});}};}function handleEntityNotFound(_0x10b6d5,_0x21c2e6){return function(_0x5e0954){if(!_0x5e0954){_0x10b6d5['sendStatus'](0x194);}return _0x5e0954;};}function handleError(_0x48f150,_0x31f47b){_0x31f47b=_0x31f47b||0x1f4;return function(_0x2b1609){logger[_0x3709('0x2c')](_0x2b1609[_0x3709('0x2d')]);if(_0x2b1609[_0x3709('0x2e')]){delete _0x2b1609[_0x3709('0x2e')];}_0x48f150[_0x3709('0x1e')](_0x31f47b)['send'](_0x2b1609);};}exports['index']=function(_0x39c673,_0x155ab5){var _0x32a872={},_0x502982={},_0x251b99={'count':0x0,'rows':[]};var _0x207945=_[_0x3709('0x2f')](db['SalesforceField'][_0x3709('0x30')],function(_0x40c243){return{'name':_0x40c243['fieldName'],'type':_0x40c243['type'][_0x3709('0x31')]};});_0x502982[_0x3709('0x32')]=_['map'](_0x207945,'name');_0x502982['query']=_['keys'](_0x39c673[_0x3709('0x33')]);_0x502982[_0x3709('0x34')]=_[_0x3709('0x35')](_0x502982[_0x3709('0x32')],_0x502982[_0x3709('0x33')]);_0x32a872[_0x3709('0x36')]=_[_0x3709('0x35')](_0x502982[_0x3709('0x32')],qs[_0x3709('0x37')](_0x39c673[_0x3709('0x33')][_0x3709('0x37')]));_0x32a872[_0x3709('0x36')]=_0x32a872['attributes'][_0x3709('0x38')]?_0x32a872[_0x3709('0x36')]:_0x502982[_0x3709('0x32')];if(!_0x39c673[_0x3709('0x33')][_0x3709('0x39')](_0x3709('0x3a'))){_0x32a872[_0x3709('0x23')]=qs[_0x3709('0x23')](_0x39c673[_0x3709('0x33')][_0x3709('0x23')]);_0x32a872[_0x3709('0x21')]=qs[_0x3709('0x21')](_0x39c673[_0x3709('0x33')][_0x3709('0x21')]);}_0x32a872[_0x3709('0x3b')]=qs[_0x3709('0x3c')](_0x39c673[_0x3709('0x33')][_0x3709('0x3c')]);_0x32a872[_0x3709('0x3d')]=qs[_0x3709('0x34')](_[_0x3709('0x3e')](_0x39c673[_0x3709('0x33')],_0x502982[_0x3709('0x34')]),_0x207945);if(_0x39c673['query']['filter']){_0x32a872['where']=_['merge'](_0x32a872[_0x3709('0x3d')],{'$or':_['map'](_0x207945,function(_0xcead8a){if(_0xcead8a[_0x3709('0x3f')]!=='VIRTUAL'){var _0x1dfc96={};_0x1dfc96[_0xcead8a['name']]={'$like':'%'+_0x39c673[_0x3709('0x33')]['filter']+'%'};return _0x1dfc96;}})});}_0x32a872=_[_0x3709('0x40')]({},_0x32a872,_0x39c673['options']);var _0x145b28={'where':_0x32a872[_0x3709('0x3d')]};return db[_0x3709('0x41')][_0x3709('0x24')](_0x145b28)[_0x3709('0x2b')](function(_0x21e775){_0x251b99['count']=_0x21e775;if(_0x39c673[_0x3709('0x33')][_0x3709('0x42')]){_0x32a872[_0x3709('0x43')]=[{'all':!![]}];}return db[_0x3709('0x41')]['findAll'](_0x32a872);})[_0x3709('0x2b')](function(_0x4767cc){_0x251b99['rows']=_0x4767cc;return _0x251b99;})[_0x3709('0x2b')](respondWithFilteredResult(_0x155ab5,_0x32a872))[_0x3709('0x44')](handleError(_0x155ab5,null));};exports[_0x3709('0x45')]=function(_0x2b9088,_0x46960e){var _0x571382={'raw':!![],'where':{'id':_0x2b9088[_0x3709('0x46')]['id']}},_0x396013={};_0x396013[_0x3709('0x32')]=_[_0x3709('0x47')](db[_0x3709('0x41')]['rawAttributes']);_0x396013[_0x3709('0x33')]=_[_0x3709('0x47')](_0x2b9088['query']);_0x396013['filters']=_[_0x3709('0x35')](_0x396013[_0x3709('0x32')],_0x396013['query']);_0x571382[_0x3709('0x36')]=_[_0x3709('0x35')](_0x396013[_0x3709('0x32')],qs[_0x3709('0x37')](_0x2b9088['query'][_0x3709('0x37')]));_0x571382[_0x3709('0x36')]=_0x571382[_0x3709('0x36')][_0x3709('0x38')]?_0x571382['attributes']:_0x396013['model'];if(_0x2b9088[_0x3709('0x33')][_0x3709('0x42')]){_0x571382[_0x3709('0x43')]=[{'all':!![]}];}_0x571382=_[_0x3709('0x40')]({},_0x571382,_0x2b9088['options']);return db[_0x3709('0x41')]['find'](_0x571382)[_0x3709('0x2b')](handleEntityNotFound(_0x46960e,null))['then'](respondWithResult(_0x46960e,null))['catch'](handleError(_0x46960e,null));};exports['create']=function(_0x7d6f5d,_0x5d7847){return db['SalesforceField']['create'](_0x7d6f5d[_0x3709('0x48')],{})[_0x3709('0x2b')](respondWithResult(_0x5d7847,0xc9))[_0x3709('0x44')](handleError(_0x5d7847,null));};exports[_0x3709('0x49')]=function(_0x161a00,_0x222f0b){if(_0x161a00[_0x3709('0x48')]['id']){delete _0x161a00[_0x3709('0x48')]['id'];}return db[_0x3709('0x41')][_0x3709('0x4a')]({'where':{'id':_0x161a00[_0x3709('0x46')]['id']}})['then'](handleEntityNotFound(_0x222f0b,null))[_0x3709('0x2b')](saveUpdates(_0x161a00['body'],null))[_0x3709('0x2b')](respondWithResult(_0x222f0b,null))[_0x3709('0x44')](handleError(_0x222f0b,null));};exports[_0x3709('0x2a')]=function(_0x33f9d6,_0x17b6ad){return db[_0x3709('0x41')][_0x3709('0x4a')]({'where':{'id':_0x33f9d6[_0x3709('0x46')]['id']}})[_0x3709('0x2b')](handleEntityNotFound(_0x17b6ad,null))['then'](removeEntity(_0x17b6ad,null))[_0x3709('0x44')](handleError(_0x17b6ad,null));}; \ No newline at end of file +var _0x883f=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','map','SalesforceField','rawAttributes','fieldName'];(function(_0x21ecea,_0x554c14){var _0x123f9c=function(_0xf65e09){while(--_0xf65e09){_0x21ecea['push'](_0x21ecea['shift']());}};_0x123f9c(++_0x554c14);}(_0x883f,0xb3));var _0xf883=function(_0x40fa3f,_0x3f3a11){_0x40fa3f=_0x40fa3f-0x0;var _0x5cc845=_0x883f[_0x40fa3f];return _0x5cc845;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf883('0x0'));var zipdir=require(_0xf883('0x1'));var jsonpatch=require(_0xf883('0x2'));var rp=require(_0xf883('0x3'));var moment=require(_0xf883('0x4'));var BPromise=require(_0xf883('0x5'));var Mustache=require(_0xf883('0x6'));var util=require('util');var path=require(_0xf883('0x7'));var sox=require(_0xf883('0x8'));var csv=require(_0xf883('0x9'));var ejs=require(_0xf883('0xa'));var fs=require('fs');var fs_extra=require(_0xf883('0xb'));var _=require('lodash');var squel=require(_0xf883('0xc'));var crypto=require('crypto');var jsforce=require(_0xf883('0xd'));var deskjs=require(_0xf883('0xe'));var toCsv=require(_0xf883('0x9'));var querystring=require(_0xf883('0xf'));var Papa=require(_0xf883('0x10'));var Redis=require(_0xf883('0x11'));var authService=require(_0xf883('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf883('0x13'));var hardwareService=require(_0xf883('0x14'));var logger=require(_0xf883('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf883('0x16'));var licenseUtil=require(_0xf883('0x17'));var db=require(_0xf883('0x18'))['db'];function respondWithStatusCode(_0x278b90,_0x559ad1){_0x559ad1=_0x559ad1||0xcc;return function(_0x2813c1){if(_0x2813c1){return _0x278b90[_0xf883('0x19')](_0x559ad1);}return _0x278b90[_0xf883('0x1a')](_0x559ad1)['end']();};}function respondWithResult(_0x496ea5,_0x222050){_0x222050=_0x222050||0xc8;return function(_0x45aad6){if(_0x45aad6){return _0x496ea5[_0xf883('0x1a')](_0x222050)[_0xf883('0x1b')](_0x45aad6);}};}function respondWithFilteredResult(_0x2fb52f,_0x8d2e92){return function(_0x162a04){if(_0x162a04){var _0x45a614=typeof _0x8d2e92['offset']===_0xf883('0x1c')&&typeof _0x8d2e92[_0xf883('0x1d')]==='undefined';var _0x23f438=_0x162a04[_0xf883('0x1e')];var _0xdb5fe5=_0x45a614?0x0:_0x8d2e92['offset'];var _0x11a84a=_0x45a614?_0x162a04[_0xf883('0x1e')]:_0x8d2e92['offset']+_0x8d2e92[_0xf883('0x1d')];var _0x37d4f9;if(_0x11a84a>=_0x23f438){_0x11a84a=_0x23f438;_0x37d4f9=0xc8;}else{_0x37d4f9=0xce;}_0x2fb52f[_0xf883('0x1a')](_0x37d4f9);return _0x2fb52f[_0xf883('0x1f')](_0xf883('0x20'),_0xdb5fe5+'-'+_0x11a84a+'/'+_0x23f438)[_0xf883('0x1b')](_0x162a04);}return null;};}function patchUpdates(_0x458607){return function(_0x3eb74c){try{jsonpatch[_0xf883('0x21')](_0x3eb74c,_0x458607,!![]);}catch(_0x2d248d){return BPromise['reject'](_0x2d248d);}return _0x3eb74c[_0xf883('0x22')]();};}function saveUpdates(_0x2a8fd9,_0x3838a5){return function(_0x163c2f){if(_0x163c2f){return _0x163c2f[_0xf883('0x23')](_0x2a8fd9)[_0xf883('0x24')](function(_0xe2f329){return _0xe2f329;});}return null;};}function removeEntity(_0x15dd57,_0x28de50){return function(_0x1daed5){if(_0x1daed5){return _0x1daed5[_0xf883('0x25')]()[_0xf883('0x24')](function(){_0x15dd57[_0xf883('0x1a')](0xcc)[_0xf883('0x26')]();});}};}function handleEntityNotFound(_0x41adc7,_0x2b81ab){return function(_0x3afabf){if(!_0x3afabf){_0x41adc7[_0xf883('0x19')](0x194);}return _0x3afabf;};}function handleError(_0x36e541,_0x5982f4){_0x5982f4=_0x5982f4||0x1f4;return function(_0x12aa64){logger[_0xf883('0x27')](_0x12aa64[_0xf883('0x28')]);if(_0x12aa64[_0xf883('0x29')]){delete _0x12aa64[_0xf883('0x29')];}_0x36e541[_0xf883('0x1a')](_0x5982f4)['send'](_0x12aa64);};}exports['index']=function(_0x4f05db,_0x2d84d4){var _0x49d90b={},_0x370aeb={},_0x31f69a={'count':0x0,'rows':[]};var _0x23e7d6=_[_0xf883('0x2a')](db[_0xf883('0x2b')][_0xf883('0x2c')],function(_0x24f7b1){return{'name':_0x24f7b1[_0xf883('0x2d')],'type':_0x24f7b1[_0xf883('0x2e')][_0xf883('0x2f')]};});_0x370aeb[_0xf883('0x30')]=_[_0xf883('0x2a')](_0x23e7d6,_0xf883('0x29'));_0x370aeb[_0xf883('0x31')]=_['keys'](_0x4f05db[_0xf883('0x31')]);_0x370aeb[_0xf883('0x32')]=_[_0xf883('0x33')](_0x370aeb[_0xf883('0x30')],_0x370aeb['query']);_0x49d90b[_0xf883('0x34')]=_[_0xf883('0x33')](_0x370aeb[_0xf883('0x30')],qs[_0xf883('0x35')](_0x4f05db[_0xf883('0x31')][_0xf883('0x35')]));_0x49d90b[_0xf883('0x34')]=_0x49d90b[_0xf883('0x34')][_0xf883('0x36')]?_0x49d90b[_0xf883('0x34')]:_0x370aeb[_0xf883('0x30')];if(!_0x4f05db['query'][_0xf883('0x37')](_0xf883('0x38'))){_0x49d90b[_0xf883('0x1d')]=qs[_0xf883('0x1d')](_0x4f05db[_0xf883('0x31')][_0xf883('0x1d')]);_0x49d90b['offset']=qs[_0xf883('0x39')](_0x4f05db[_0xf883('0x31')][_0xf883('0x39')]);}_0x49d90b['order']=qs[_0xf883('0x3a')](_0x4f05db['query'][_0xf883('0x3a')]);_0x49d90b[_0xf883('0x3b')]=qs[_0xf883('0x32')](_[_0xf883('0x3c')](_0x4f05db['query'],_0x370aeb[_0xf883('0x32')]),_0x23e7d6);if(_0x4f05db['query'][_0xf883('0x3d')]){_0x49d90b['where']=_[_0xf883('0x3e')](_0x49d90b[_0xf883('0x3b')],{'$or':_['map'](_0x23e7d6,function(_0x24d6d8){if(_0x24d6d8[_0xf883('0x2e')]!=='VIRTUAL'){var _0x1c2546={};_0x1c2546[_0x24d6d8[_0xf883('0x29')]]={'$like':'%'+_0x4f05db[_0xf883('0x31')][_0xf883('0x3d')]+'%'};return _0x1c2546;}})});}_0x49d90b=_[_0xf883('0x3e')]({},_0x49d90b,_0x4f05db[_0xf883('0x3f')]);var _0x20243d={'where':_0x49d90b[_0xf883('0x3b')]};return db['SalesforceField'][_0xf883('0x1e')](_0x20243d)[_0xf883('0x24')](function(_0x401bda){_0x31f69a[_0xf883('0x1e')]=_0x401bda;if(_0x4f05db[_0xf883('0x31')][_0xf883('0x40')]){_0x49d90b[_0xf883('0x41')]=[{'all':!![]}];}return db[_0xf883('0x2b')][_0xf883('0x42')](_0x49d90b);})[_0xf883('0x24')](function(_0x25f353){_0x31f69a[_0xf883('0x43')]=_0x25f353;return _0x31f69a;})['then'](respondWithFilteredResult(_0x2d84d4,_0x49d90b))['catch'](handleError(_0x2d84d4,null));};exports[_0xf883('0x44')]=function(_0x32b440,_0x382b21){var _0x5ced00={'raw':!![],'where':{'id':_0x32b440[_0xf883('0x45')]['id']}},_0x71c661={};_0x71c661[_0xf883('0x30')]=_[_0xf883('0x46')](db['SalesforceField'][_0xf883('0x2c')]);_0x71c661[_0xf883('0x31')]=_[_0xf883('0x46')](_0x32b440[_0xf883('0x31')]);_0x71c661['filters']=_[_0xf883('0x33')](_0x71c661[_0xf883('0x30')],_0x71c661['query']);_0x5ced00[_0xf883('0x34')]=_[_0xf883('0x33')](_0x71c661[_0xf883('0x30')],qs[_0xf883('0x35')](_0x32b440['query'][_0xf883('0x35')]));_0x5ced00['attributes']=_0x5ced00[_0xf883('0x34')][_0xf883('0x36')]?_0x5ced00['attributes']:_0x71c661[_0xf883('0x30')];if(_0x32b440[_0xf883('0x31')]['includeAll']){_0x5ced00[_0xf883('0x41')]=[{'all':!![]}];}_0x5ced00=_['merge']({},_0x5ced00,_0x32b440[_0xf883('0x3f')]);return db[_0xf883('0x2b')][_0xf883('0x47')](_0x5ced00)[_0xf883('0x24')](handleEntityNotFound(_0x382b21,null))['then'](respondWithResult(_0x382b21,null))[_0xf883('0x48')](handleError(_0x382b21,null));};exports[_0xf883('0x49')]=function(_0x86c6a2,_0x1e8ebc){return db[_0xf883('0x2b')]['create'](_0x86c6a2[_0xf883('0x4a')],{})[_0xf883('0x24')](respondWithResult(_0x1e8ebc,0xc9))['catch'](handleError(_0x1e8ebc,null));};exports['update']=function(_0x1aadc3,_0x29dbab){if(_0x1aadc3['body']['id']){delete _0x1aadc3[_0xf883('0x4a')]['id'];}return db[_0xf883('0x2b')][_0xf883('0x47')]({'where':{'id':_0x1aadc3[_0xf883('0x45')]['id']}})['then'](handleEntityNotFound(_0x29dbab,null))[_0xf883('0x24')](saveUpdates(_0x1aadc3[_0xf883('0x4a')],null))[_0xf883('0x24')](respondWithResult(_0x29dbab,null))['catch'](handleError(_0x29dbab,null));};exports[_0xf883('0x25')]=function(_0x13463d,_0x574eb7){return db[_0xf883('0x2b')][_0xf883('0x47')]({'where':{'id':_0x13463d[_0xf883('0x45')]['id']}})[_0xf883('0x24')](handleEntityNotFound(_0x574eb7,null))[_0xf883('0x24')](removeEntity(_0x574eb7,null))['catch'](handleError(_0x574eb7,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e07f44c..d64039d 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 _0x92e3=['salesforce_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0x2364c9,_0x1ccccd){var _0x24cc36=function(_0x3ecb64){while(--_0x3ecb64){_0x2364c9['push'](_0x2364c9['shift']());}};_0x24cc36(++_0x1ccccd);}(_0x92e3,0x161));var _0x392e=function(_0x390ad3,_0x50a0e3){_0x390ad3=_0x390ad3-0x0;var _0x1d6136=_0x92e3[_0x390ad3];return _0x1d6136;};'use strict';var _=require(_0x392e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x392e('0x1'));var moment=require(_0x392e('0x2'));var BPromise=require(_0x392e('0x3'));var rp=require(_0x392e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x392e('0x5'));var config=require(_0x392e('0x6'));var attributes=require(_0x392e('0x7'));module[_0x392e('0x8')]=function(_0x36cb72,_0x4148a6){return _0x36cb72[_0x392e('0x9')](_0x392e('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x392e('0xb'),'fields':[_0x392e('0xc'),_0x392e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda93=['util','moment','bluebird','request-promise','rimraf','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x316540,_0x24c1ea){var _0x7d721d=function(_0x3fbefd){while(--_0x3fbefd){_0x316540['push'](_0x316540['shift']());}};_0x7d721d(++_0x24c1ea);}(_0xda93,0x18c));var _0x3da9=function(_0x4352e6,_0x90b841){_0x4352e6=_0x4352e6-0x0;var _0x5dfd19=_0xda93[_0x4352e6];return _0x5dfd19;};'use strict';var _=require('lodash');var util=require(_0x3da9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3da9('0x1'));var BPromise=require(_0x3da9('0x2'));var rp=require(_0x3da9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3da9('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x3da9('0x5')]=function(_0x342d7a,_0x1488ca){return _0x342d7a[_0x3da9('0x6')]('SalesforceField',attributes,{'tableName':_0x3da9('0x7'),'paranoid':![],'indexes':[{'name':_0x3da9('0x8'),'fields':[_0x3da9('0x9'),_0x3da9('0xa')],'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 539877e..f84b99d 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 _0x8b2c=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3aaf5f,_0x273ea0){var _0x2946a2=function(_0x49de8e){while(--_0x49de8e){_0x3aaf5f['push'](_0x3aaf5f['shift']());}};_0x2946a2(++_0x273ea0);}(_0x8b2c,0x106));var _0xc8b2=function(_0x32a34f,_0x48007){_0x32a34f=_0x32a34f-0x0;var _0x5ea3b8=_0x8b2c[_0x32a34f];return _0x5ea3b8;};'use strict';var _=require(_0xc8b2('0x0'));var util=require(_0xc8b2('0x1'));var moment=require(_0xc8b2('0x2'));var BPromise=require(_0xc8b2('0x3'));var rs=require(_0xc8b2('0x4'));var fs=require('fs');var Redis=require(_0xc8b2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8b2('0x6'));var logger=require(_0xc8b2('0x7'))(_0xc8b2('0x8'));var config=require(_0xc8b2('0x9'));var jayson=require(_0xc8b2('0xa'));var client=jayson['client'][_0xc8b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fb249,_0x207e19,_0x1be27f){return new BPromise(function(_0x157b1f,_0x23cdd2){return client[_0xc8b2('0xc')](_0x4fb249,_0x1be27f)[_0xc8b2('0xd')](function(_0x10c4da){logger['info'](_0xc8b2('0xe'),_0x207e19,_0xc8b2('0xf'));logger[_0xc8b2('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x207e19,_0xc8b2('0xf'),JSON[_0xc8b2('0x11')](_0x10c4da));if(_0x10c4da[_0xc8b2('0x12')]){if(_0x10c4da[_0xc8b2('0x12')]['code']===0x1f4){logger[_0xc8b2('0x12')]('SalesforceField,\x20%s,\x20%s',_0x207e19,_0x10c4da[_0xc8b2('0x12')][_0xc8b2('0x13')]);return _0x23cdd2(_0x10c4da['error']['message']);}logger[_0xc8b2('0x12')](_0xc8b2('0xe'),_0x207e19,_0x10c4da[_0xc8b2('0x12')]['message']);return _0x157b1f(_0x10c4da[_0xc8b2('0x12')][_0xc8b2('0x13')]);}else{logger[_0xc8b2('0x14')](_0xc8b2('0xe'),_0x207e19,_0xc8b2('0xf'));_0x157b1f(_0x10c4da[_0xc8b2('0x15')][_0xc8b2('0x13')]);}})[_0xc8b2('0x16')](function(_0x72d603){logger[_0xc8b2('0x12')](_0xc8b2('0xe'),_0x207e19,_0x72d603);_0x23cdd2(_0x72d603);});});} \ No newline at end of file +var _0x33a8=['jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x99189f,_0x3472e4){var _0x258e46=function(_0x4c3abb){while(--_0x4c3abb){_0x99189f['push'](_0x99189f['shift']());}};_0x258e46(++_0x3472e4);}(_0x33a8,0x150));var _0x833a=function(_0x549d20,_0xaf444a){_0x549d20=_0x549d20-0x0;var _0x2f6960=_0x33a8[_0x549d20];return _0x2f6960;};'use strict';var _=require(_0x833a('0x0'));var util=require('util');var moment=require(_0x833a('0x1'));var BPromise=require(_0x833a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x833a('0x3'));var db=require(_0x833a('0x4'))['db'];var utils=require(_0x833a('0x5'));var logger=require(_0x833a('0x6'))(_0x833a('0x7'));var config=require(_0x833a('0x8'));var jayson=require(_0x833a('0x9'));var client=jayson['client'][_0x833a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x561620,_0x39703a,_0x301a10){return new BPromise(function(_0x27d800,_0x1ef5db){return client[_0x833a('0xb')](_0x561620,_0x301a10)[_0x833a('0xc')](function(_0xa3e2e6){logger[_0x833a('0xd')](_0x833a('0xe'),_0x39703a,_0x833a('0xf'));logger[_0x833a('0x10')](_0x833a('0x11'),_0x39703a,'request\x20sent',JSON[_0x833a('0x12')](_0xa3e2e6));if(_0xa3e2e6[_0x833a('0x13')]){if(_0xa3e2e6[_0x833a('0x13')][_0x833a('0x14')]===0x1f4){logger['error'](_0x833a('0xe'),_0x39703a,_0xa3e2e6[_0x833a('0x13')][_0x833a('0x15')]);return _0x1ef5db(_0xa3e2e6['error'][_0x833a('0x15')]);}logger[_0x833a('0x13')](_0x833a('0xe'),_0x39703a,_0xa3e2e6[_0x833a('0x13')][_0x833a('0x15')]);return _0x27d800(_0xa3e2e6[_0x833a('0x13')][_0x833a('0x15')]);}else{logger[_0x833a('0xd')](_0x833a('0xe'),_0x39703a,'request\x20sent');_0x27d800(_0xa3e2e6['result'][_0x833a('0x15')]);}})[_0x833a('0x16')](function(_0x5ac0fd){logger['error'](_0x833a('0xe'),_0x39703a,_0x5ac0fd);_0x1ef5db(_0x5ac0fd);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 1aa6f65..6c15f73 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 _0x6e5f=['get','index','/:id','/:id/configurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','delete','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0xbd8543,_0x4572ff){var _0x1bd7fe=function(_0x2b34c7){while(--_0x2b34c7){_0xbd8543['push'](_0xbd8543['shift']());}};_0x1bd7fe(++_0x4572ff);}(_0x6e5f,0x1bc));var _0xf6e5=function(_0x23e65b,_0x4ed188){_0x23e65b=_0x23e65b-0x0;var _0x286049=_0x6e5f[_0x23e65b];return _0x286049;};'use strict';var multer=require(_0xf6e5('0x0'));var util=require(_0xf6e5('0x1'));var path=require('path');var timeout=require(_0xf6e5('0x2'));var express=require('express');var router=express[_0xf6e5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf6e5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf6e5('0x5'));var controller=require('./intServicenowAccount.controller');router[_0xf6e5('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6e5('0x7')]);router[_0xf6e5('0x6')](_0xf6e5('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xf6e5('0x6')](_0xf6e5('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xf6e5('0x6')](_0xf6e5('0xa'),auth[_0xf6e5('0xb')](),controller[_0xf6e5('0xc')]);router['post']('/',auth[_0xf6e5('0xb')](),controller['create']);router[_0xf6e5('0xd')](_0xf6e5('0x9'),auth[_0xf6e5('0xb')](),controller[_0xf6e5('0xe')]);router[_0xf6e5('0xf')]('/:id',auth[_0xf6e5('0xb')](),controller[_0xf6e5('0x10')]);router[_0xf6e5('0x11')]('/:id',auth[_0xf6e5('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xba28=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','update','delete','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0xba28,0xc8));var _0x8ba2=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0xba28[_0x173f10];return _0x53142d;};'use strict';var multer=require(_0x8ba2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ba2('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ba2('0x2'));var auth=require(_0x8ba2('0x3'));var interaction=require(_0x8ba2('0x4'));var config=require(_0x8ba2('0x5'));var controller=require(_0x8ba2('0x6'));router[_0x8ba2('0x7')]('/',auth[_0x8ba2('0x8')](),controller[_0x8ba2('0x9')]);router[_0x8ba2('0x7')](_0x8ba2('0xa'),auth[_0x8ba2('0x8')](),controller[_0x8ba2('0xb')]);router[_0x8ba2('0x7')](_0x8ba2('0xc'),auth[_0x8ba2('0x8')](),controller[_0x8ba2('0xd')]);router['get'](_0x8ba2('0xe'),auth['isAuthenticated'](),controller[_0x8ba2('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x8ba2('0xc'),auth[_0x8ba2('0x8')](),controller[_0x8ba2('0x10')]);router[_0x8ba2('0x11')](_0x8ba2('0xa'),auth[_0x8ba2('0x8')](),controller[_0x8ba2('0x12')]);router[_0x8ba2('0x13')](_0x8ba2('0xa'),auth[_0x8ba2('0x8')](),controller[_0x8ba2('0x14')]);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 4bd913c..560cef4 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 _0x7318=['STRING','username','remoteUri','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7318,0x1d4));var _0x8731=function(_0xe4119a,_0x21efa6){_0xe4119a=_0xe4119a-0x0;var _0x4d05c6=_0x7318[_0xe4119a];return _0x4d05c6;};'use strict';var Sequelize=require(_0x8731('0x0'));module[_0x8731('0x1')]={'name':{'type':Sequelize[_0x8731('0x2')]},'description':{'type':Sequelize[_0x8731('0x2')]},'username':{'type':Sequelize[_0x8731('0x2')],'unique':_0x8731('0x3')},'password':{'type':Sequelize[_0x8731('0x2')]},'email':{'type':Sequelize[_0x8731('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8731('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc458=['STRING','remoteUri','sequelize'];(function(_0x44b04c,_0x5786a3){var _0x1d2442=function(_0x5d6671){while(--_0x5d6671){_0x44b04c['push'](_0x44b04c['shift']());}};_0x1d2442(++_0x5786a3);}(_0xc458,0x107));var _0x8c45=function(_0x57c026,_0x44d524){_0x57c026=_0x57c026-0x0;var _0x2da5e6=_0xc458[_0x57c026];return _0x2da5e6;};'use strict';var Sequelize=require(_0x8c45('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8c45('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x8c45('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8c45('0x1')],'unique':_0x8c45('0x2')},'serverUrl':{'type':Sequelize[_0x8c45('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 5f63147..70dd176 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 _0x7f6f=['due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','push','all','includes','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','ServicenowAccount','rawAttributes','fieldName','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','order','getSubjects','Descriptions','getDescriptions','ServicenowField','Subjects','made_sla','subcategory','close_code','notify','incident_state','severity','category','parent','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','user_input','sys_domain','state','sys_created_by','knowledge','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes'];(function(_0x2c0547,_0x20e825){var _0x374e8a=function(_0x5f4607){while(--_0x5f4607){_0x2c0547['push'](_0x2c0547['shift']());}};_0x374e8a(++_0x20e825);}(_0x7f6f,0xe5));var _0xf7f6=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x7f6f[_0x1b892b];return _0xa99e57;};'use strict';var emlformat=require(_0xf7f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf7f6('0x1'));var rp=require(_0xf7f6('0x2'));var moment=require(_0xf7f6('0x3'));var BPromise=require(_0xf7f6('0x4'));var Mustache=require(_0xf7f6('0x5'));var util=require(_0xf7f6('0x6'));var path=require(_0xf7f6('0x7'));var sox=require(_0xf7f6('0x8'));var csv=require(_0xf7f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7f6('0xa'));var _=require(_0xf7f6('0xb'));var squel=require(_0xf7f6('0xc'));var crypto=require('crypto');var jsforce=require(_0xf7f6('0xd'));var deskjs=require(_0xf7f6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf7f6('0xf'));var Papa=require(_0xf7f6('0x10'));var Redis=require(_0xf7f6('0x11'));var authService=require(_0xf7f6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf7f6('0x13'));var hardwareService=require(_0xf7f6('0x14'));var logger=require(_0xf7f6('0x15'))(_0xf7f6('0x16'));var utils=require(_0xf7f6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf7f6('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf7f6('0x19'));function respondWithStatusCode(_0x1e3c86,_0x39ecb3){_0x39ecb3=_0x39ecb3||0xcc;return function(_0x379927){if(_0x379927){return _0x1e3c86[_0xf7f6('0x1a')](_0x39ecb3);}return _0x1e3c86[_0xf7f6('0x1b')](_0x39ecb3)[_0xf7f6('0x1c')]();};}function respondWithResult(_0x4db8b1,_0x6c6037){_0x6c6037=_0x6c6037||0xc8;return function(_0x221563){if(_0x221563){return _0x4db8b1[_0xf7f6('0x1b')](_0x6c6037)[_0xf7f6('0x1d')](_0x221563);}};}function respondWithFilteredResult(_0x3f97be,_0x5e3c51){return function(_0xc88369){if(_0xc88369){var _0x4b1408=typeof _0x5e3c51[_0xf7f6('0x1e')]===_0xf7f6('0x1f')&&typeof _0x5e3c51[_0xf7f6('0x20')]===_0xf7f6('0x1f');var _0x27d1d=_0xc88369[_0xf7f6('0x21')];var _0x985833=_0x4b1408?0x0:_0x5e3c51[_0xf7f6('0x1e')];var _0x947e10=_0x4b1408?_0xc88369[_0xf7f6('0x21')]:_0x5e3c51[_0xf7f6('0x1e')]+_0x5e3c51[_0xf7f6('0x20')];var _0x350b1d;if(_0x947e10>=_0x27d1d){_0x947e10=_0x27d1d;_0x350b1d=0xc8;}else{_0x350b1d=0xce;}_0x3f97be['status'](_0x350b1d);return _0x3f97be['set'](_0xf7f6('0x22'),_0x985833+'-'+_0x947e10+'/'+_0x27d1d)[_0xf7f6('0x1d')](_0xc88369);}return null;};}function patchUpdates(_0x5262db){return function(_0x1ad6fb){try{jsonpatch[_0xf7f6('0x23')](_0x1ad6fb,_0x5262db,!![]);}catch(_0xda4b2b){return BPromise[_0xf7f6('0x24')](_0xda4b2b);}return _0x1ad6fb[_0xf7f6('0x25')]();};}function saveUpdates(_0x4730c8,_0x169988){return function(_0x1e4c9c){if(_0x1e4c9c){return _0x1e4c9c[_0xf7f6('0x26')](_0x4730c8)[_0xf7f6('0x27')](function(_0x159d7a){return _0x159d7a;});}return null;};}function removeEntity(_0x3f92ae,_0x113440){return function(_0x48f457){if(_0x48f457){return _0x48f457[_0xf7f6('0x28')]()[_0xf7f6('0x27')](function(){_0x3f92ae['status'](0xcc)[_0xf7f6('0x1c')]();});}};}function handleEntityNotFound(_0x50a434,_0xe9337b){return function(_0x329267){if(!_0x329267){_0x50a434[_0xf7f6('0x1a')](0x194);}return _0x329267;};}function handleError(_0x509c66,_0x1c9056){_0x1c9056=_0x1c9056||0x1f4;return function(_0x3c6011){logger[_0xf7f6('0x29')](_0x3c6011[_0xf7f6('0x2a')]);if(_0x3c6011['name']){delete _0x3c6011['name'];}_0x509c66[_0xf7f6('0x1b')](_0x1c9056)[_0xf7f6('0x2b')](_0x3c6011);};}exports[_0xf7f6('0x2c')]=function(_0x1945fc,_0xc1a623){var _0x458c4e={},_0x4c5542={},_0x278d6f={'count':0x0,'rows':[]};var _0x53ca38=_[_0xf7f6('0x2d')](db[_0xf7f6('0x2e')][_0xf7f6('0x2f')],function(_0x975ad5){return{'name':_0x975ad5[_0xf7f6('0x30')],'type':_0x975ad5['type']['key']};});_0x4c5542[_0xf7f6('0x31')]=_[_0xf7f6('0x2d')](_0x53ca38,_0xf7f6('0x32'));_0x4c5542[_0xf7f6('0x33')]=_['keys'](_0x1945fc[_0xf7f6('0x33')]);_0x4c5542[_0xf7f6('0x34')]=_['intersection'](_0x4c5542[_0xf7f6('0x31')],_0x4c5542[_0xf7f6('0x33')]);_0x458c4e[_0xf7f6('0x35')]=_[_0xf7f6('0x36')](_0x4c5542[_0xf7f6('0x31')],qs[_0xf7f6('0x37')](_0x1945fc[_0xf7f6('0x33')][_0xf7f6('0x37')]));_0x458c4e[_0xf7f6('0x35')]=_0x458c4e['attributes'][_0xf7f6('0x38')]?_0x458c4e[_0xf7f6('0x35')]:_0x4c5542['model'];if(!_0x1945fc['query'][_0xf7f6('0x39')](_0xf7f6('0x3a'))){_0x458c4e['limit']=qs['limit'](_0x1945fc[_0xf7f6('0x33')]['limit']);_0x458c4e[_0xf7f6('0x1e')]=qs['offset'](_0x1945fc['query'][_0xf7f6('0x1e')]);}_0x458c4e['order']=qs[_0xf7f6('0x3b')](_0x1945fc['query']['sort']);_0x458c4e[_0xf7f6('0x3c')]=qs[_0xf7f6('0x34')](_[_0xf7f6('0x3d')](_0x1945fc[_0xf7f6('0x33')],_0x4c5542[_0xf7f6('0x34')]),_0x53ca38);if(_0x1945fc[_0xf7f6('0x33')][_0xf7f6('0x3e')]){_0x458c4e[_0xf7f6('0x3c')]=_['merge'](_0x458c4e[_0xf7f6('0x3c')],{'$or':_[_0xf7f6('0x2d')](_0x53ca38,function(_0x23832d){if(_0x23832d[_0xf7f6('0x3f')]!==_0xf7f6('0x40')){var _0x59f1cd={};_0x59f1cd[_0x23832d[_0xf7f6('0x32')]]={'$like':'%'+_0x1945fc[_0xf7f6('0x33')][_0xf7f6('0x3e')]+'%'};return _0x59f1cd;}})});}_0x458c4e=_[_0xf7f6('0x41')]({},_0x458c4e,_0x1945fc[_0xf7f6('0x42')]);var _0x10ad4c={'where':_0x458c4e['where']};return db[_0xf7f6('0x2e')][_0xf7f6('0x21')](_0x10ad4c)['then'](function(_0x384819){_0x278d6f['count']=_0x384819;if(_0x1945fc['query'][_0xf7f6('0x43')]){_0x458c4e[_0xf7f6('0x44')]=[{'all':!![]}];}return db[_0xf7f6('0x2e')][_0xf7f6('0x45')](_0x458c4e);})[_0xf7f6('0x27')](function(_0x4346c2){_0x278d6f[_0xf7f6('0x46')]=_0x4346c2;return _0x278d6f;})['then'](respondWithFilteredResult(_0xc1a623,_0x458c4e))[_0xf7f6('0x47')](handleError(_0xc1a623,null));};exports['show']=function(_0x3d475e,_0x2216c4){var _0xb687c7={'raw':![],'where':{'id':_0x3d475e['params']['id']}},_0x2e044={};_0x2e044[_0xf7f6('0x31')]=_['keys'](db['ServicenowAccount']['rawAttributes']);_0x2e044[_0xf7f6('0x33')]=_[_0xf7f6('0x48')](_0x3d475e[_0xf7f6('0x33')]);_0x2e044[_0xf7f6('0x34')]=_[_0xf7f6('0x36')](_0x2e044['model'],_0x2e044[_0xf7f6('0x33')]);_0xb687c7[_0xf7f6('0x35')]=_[_0xf7f6('0x36')](_0x2e044[_0xf7f6('0x31')],qs[_0xf7f6('0x37')](_0x3d475e['query'][_0xf7f6('0x37')]));_0xb687c7[_0xf7f6('0x35')]=_0xb687c7['attributes'][_0xf7f6('0x38')]?_0xb687c7[_0xf7f6('0x35')]:_0x2e044[_0xf7f6('0x31')];if(_0x3d475e[_0xf7f6('0x33')]['includeAll']){_0xb687c7[_0xf7f6('0x44')]=[{'all':!![]}];}_0xb687c7=_[_0xf7f6('0x41')]({},_0xb687c7,_0x3d475e[_0xf7f6('0x42')]);return db['ServicenowAccount']['find'](_0xb687c7)[_0xf7f6('0x27')](handleEntityNotFound(_0x2216c4,null))['then'](respondWithResult(_0x2216c4,null))[_0xf7f6('0x47')](handleError(_0x2216c4,null));};exports['create']=function(_0x5307df,_0x25ef79){return db[_0xf7f6('0x2e')][_0xf7f6('0x49')](_0x5307df[_0xf7f6('0x4a')],{})[_0xf7f6('0x27')](respondWithResult(_0x25ef79,0xc9))[_0xf7f6('0x47')](handleError(_0x25ef79,null));};exports['update']=function(_0xaab7e1,_0x2d4e72){if(_0xaab7e1['body']['id']){delete _0xaab7e1[_0xf7f6('0x4a')]['id'];}return db[_0xf7f6('0x2e')][_0xf7f6('0x4b')]({'where':{'id':_0xaab7e1[_0xf7f6('0x4c')]['id']}})[_0xf7f6('0x27')](handleEntityNotFound(_0x2d4e72,null))[_0xf7f6('0x27')](saveUpdates(_0xaab7e1[_0xf7f6('0x4a')],null))['then'](respondWithResult(_0x2d4e72,null))[_0xf7f6('0x47')](handleError(_0x2d4e72,null));};exports['destroy']=function(_0x5f2cdd,_0x1596d9){return db[_0xf7f6('0x2e')]['find']({'where':{'id':_0x5f2cdd['params']['id']}})[_0xf7f6('0x27')](handleEntityNotFound(_0x1596d9,null))[_0xf7f6('0x27')](removeEntity(_0x1596d9,null))[_0xf7f6('0x47')](handleError(_0x1596d9,null));};exports[_0xf7f6('0x4d')]=function(_0x1c6031,_0x3d7e0a,_0x212db5){var _0x2f5c5f={};var _0x24fcc8={};var _0x533919;var _0x174bd2;return db[_0xf7f6('0x2e')][_0xf7f6('0x4e')]({'where':{'id':_0x1c6031[_0xf7f6('0x4c')]['id']}})[_0xf7f6('0x27')](handleEntityNotFound(_0x3d7e0a,null))[_0xf7f6('0x27')](function(_0x3feada){if(_0x3feada){_0x533919=_0x3feada;_0x24fcc8[_0xf7f6('0x31')]=_[_0xf7f6('0x48')](db[_0xf7f6('0x4f')][_0xf7f6('0x2f')]);_0x24fcc8[_0xf7f6('0x33')]=_[_0xf7f6('0x48')](_0x1c6031[_0xf7f6('0x33')]);_0x24fcc8['filters']=_[_0xf7f6('0x36')](_0x24fcc8[_0xf7f6('0x31')],_0x24fcc8['query']);_0x2f5c5f['attributes']=_['intersection'](_0x24fcc8[_0xf7f6('0x31')],qs[_0xf7f6('0x37')](_0x1c6031[_0xf7f6('0x33')]['fields']));_0x2f5c5f[_0xf7f6('0x35')]=_0x2f5c5f['attributes'][_0xf7f6('0x38')]?_0x2f5c5f[_0xf7f6('0x35')]:_0x24fcc8[_0xf7f6('0x31')];_0x2f5c5f[_0xf7f6('0x50')]=qs[_0xf7f6('0x3b')](_0x1c6031['query'][_0xf7f6('0x3b')]);_0x2f5c5f[_0xf7f6('0x3c')]=qs[_0xf7f6('0x34')](_['pick'](_0x1c6031['query'],_0x24fcc8[_0xf7f6('0x34')]));if(_0x1c6031[_0xf7f6('0x33')]['filter']){_0x2f5c5f[_0xf7f6('0x3c')]=_['merge'](_0x2f5c5f[_0xf7f6('0x3c')],{'$or':_[_0xf7f6('0x2d')](_0x2f5c5f[_0xf7f6('0x35')],function(_0xd734b6){var _0x7bb280={};_0x7bb280[_0xd734b6]={'$like':'%'+_0x1c6031[_0xf7f6('0x33')][_0xf7f6('0x3e')]+'%'};return _0x7bb280;})});}_0x2f5c5f=_['merge']({},_0x2f5c5f,_0x1c6031[_0xf7f6('0x42')]);return _0x533919[_0xf7f6('0x4d')](_0x2f5c5f);}})[_0xf7f6('0x27')](function(_0x311332){if(_0x311332){_0x174bd2=_0x311332[_0xf7f6('0x38')];if(!_0x1c6031['query'][_0xf7f6('0x39')](_0xf7f6('0x3a'))){_0x2f5c5f[_0xf7f6('0x20')]=qs[_0xf7f6('0x20')](_0x1c6031[_0xf7f6('0x33')][_0xf7f6('0x20')]);_0x2f5c5f[_0xf7f6('0x1e')]=qs[_0xf7f6('0x1e')](_0x1c6031[_0xf7f6('0x33')][_0xf7f6('0x1e')]);}return _0x533919[_0xf7f6('0x4d')](_0x2f5c5f);}})['then'](function(_0x138eae){if(_0x138eae){return _0x138eae?{'count':_0x174bd2,'rows':_0x138eae}:null;}})[_0xf7f6('0x27')](respondWithResult(_0x3d7e0a,null))[_0xf7f6('0x47')](handleError(_0x3d7e0a,null));};exports['addConfiguration']=function(_0x35e284,_0x4e746e,_0x2d7c98){if(_0x35e284[_0xf7f6('0x4a')]['id']){delete _0x35e284[_0xf7f6('0x4a')]['id'];}return db[_0xf7f6('0x2e')][_0xf7f6('0x4e')]({'where':{'id':_0x35e284[_0xf7f6('0x4c')]['id']}})[_0xf7f6('0x27')](handleEntityNotFound(_0x4e746e,null))[_0xf7f6('0x27')](function(_0x1cd302){if(_0x1cd302){_0x35e284['body']['AccountId']=_0x1cd302['id'];_0x35e284[_0xf7f6('0x4a')]['Subjects']=integrations[_0xf7f6('0x51')](_0x35e284[_0xf7f6('0x4a')]['channel'],_0x35e284[_0xf7f6('0x4a')][_0xf7f6('0x3f')]);_0x35e284[_0xf7f6('0x4a')][_0xf7f6('0x52')]=integrations[_0xf7f6('0x53')](_0x35e284[_0xf7f6('0x4a')]['channel'],_0x35e284['body'][_0xf7f6('0x3f')]);return db['ServicenowConfiguration'][_0xf7f6('0x49')](_0x35e284[_0xf7f6('0x4a')],{'include':[{'model':db[_0xf7f6('0x54')],'as':_0xf7f6('0x55')},{'model':db[_0xf7f6('0x54')],'as':_0xf7f6('0x52')}]});}return null;})[_0xf7f6('0x27')](respondWithResult(_0x4e746e,null))[_0xf7f6('0x47')](handleError(_0x4e746e,null));};exports['getFields']=function(_0x52edf9,_0x51025e,_0x177a69){var _0x2aa910=[_0xf7f6('0x56'),'hold_reason','knowledge',_0xf7f6('0x57'),_0xf7f6('0x58'),_0xf7f6('0x59'),_0xf7f6('0x5a'),_0xf7f6('0x5b'),_0xf7f6('0x5c')];var _0x26ac88=[_0xf7f6('0x5d'),_0xf7f6('0x56'),'caused_by','watch_list',_0xf7f6('0x5e'),_0xf7f6('0x5f'),_0xf7f6('0x60'),_0xf7f6('0x61'),_0xf7f6('0x62'),_0xf7f6('0x63'),_0xf7f6('0x64'),_0xf7f6('0x65'),'opened_by',_0xf7f6('0x66'),'sys_created_on',_0xf7f6('0x67'),_0xf7f6('0x68'),_0xf7f6('0x69'),_0xf7f6('0x6a'),_0xf7f6('0x50'),'calendar_stc',_0xf7f6('0x6b'),_0xf7f6('0x6c'),_0xf7f6('0x6d'),_0xf7f6('0x6e'),_0xf7f6('0x6f'),_0xf7f6('0x70'),_0xf7f6('0x71'),_0xf7f6('0x72'),'sys_domain_path',_0xf7f6('0x73'),_0xf7f6('0x74'),'expected_start',_0xf7f6('0x75'),_0xf7f6('0x76'),_0xf7f6('0x77'),_0xf7f6('0x78'),_0xf7f6('0x79'),_0xf7f6('0x7a'),_0xf7f6('0x7b'),'approval_set','subcategory',_0xf7f6('0x7c'),_0xf7f6('0x7d'),_0xf7f6('0x58'),_0xf7f6('0x7e'),_0xf7f6('0x7f'),_0xf7f6('0x80'),'assignment_group',_0xf7f6('0x81'),_0xf7f6('0x82'),_0xf7f6('0x83'),_0xf7f6('0x84'),_0xf7f6('0x59'),_0xf7f6('0x85'),_0xf7f6('0x86'),_0xf7f6('0x87'),_0xf7f6('0x88'),_0xf7f6('0x89'),_0xf7f6('0x8a'),_0xf7f6('0x8b'),_0xf7f6('0x8c'),_0xf7f6('0x5a'),'urgency',_0xf7f6('0x8d'),_0xf7f6('0x8e'),_0xf7f6('0x8f'),'activity_due',_0xf7f6('0x90'),_0xf7f6('0x5b'),_0xf7f6('0x91'),_0xf7f6('0x92'),_0xf7f6('0x93'),_0xf7f6('0x94'),_0xf7f6('0x95'),_0xf7f6('0x96'),_0xf7f6('0x97'),_0xf7f6('0x98'),_0xf7f6('0x99'),_0xf7f6('0x9a'),_0xf7f6('0x9b'),_0xf7f6('0x9c'),_0xf7f6('0x5c')];var _0x38a9ac='';var _0x2e2dc4='';var _0xa921d0=[];var _0x3e0b48='';var _0x19e8ed='';var _0xca1db8=[];var _0x153dfd='';var _0x3efc60='';var _0x57ab3a={};var _0x2f46c8='';return db[_0xf7f6('0x2e')][_0xf7f6('0x4e')]({'where':{'id':_0x52edf9[_0xf7f6('0x4c')]['id']},'attributes':['id',_0xf7f6('0x9d'),_0xf7f6('0x9e'),_0xf7f6('0x9f'),_0xf7f6('0xa0'),_0xf7f6('0xa1')]})[_0xf7f6('0x27')](handleEntityNotFound(_0x51025e,null))[_0xf7f6('0x27')](function(_0x24e8a4){if(_0x24e8a4){_0x2f46c8=_0x24e8a4[_0xf7f6('0xa0')];var _0x4592c9=_0x2f46c8['slice'](-0x1);if(_0x4592c9==='/'){_0x2f46c8=_0x2f46c8['substring'](0x0,_0x2f46c8[_0xf7f6('0xa2')](_0x4592c9));}_0x3efc60=util['format'](_0xf7f6('0xa3'),_0x2f46c8);_0x153dfd=util[_0xf7f6('0xa4')](_0xf7f6('0xa5'),_0x2f46c8);_0x57ab3a={'user':_0x24e8a4[_0xf7f6('0x9d')],'pass':_0x24e8a4[_0xf7f6('0x9e')]};var _0x375491={'method':_0xf7f6('0xa6'),'uri':_0x3efc60+_0xf7f6('0xa7'),'auth':_0x57ab3a,'json':!![]};return rp(_0x375491);}})[_0xf7f6('0x27')](function(_0x1680af){if(_0x1680af[_0xf7f6('0xa8')][_0xf7f6('0x38')]>0x0){_0x38a9ac=_0x1680af[_0xf7f6('0xa8')];}console[_0xf7f6('0xa9')](_0xf7f6('0xaa'),_0x38a9ac);_0xca1db8=[];_0x2e2dc4=Object[_0xf7f6('0xab')]([],_0x38a9ac);_[_0xf7f6('0xac')](_0x2e2dc4,function(_0x223f3a){return!_0x2aa910['includes'](_0x223f3a[_0xf7f6('0x32')]);});_0x2e2dc4[_0xf7f6('0xad')](function(_0x431874){var _0x9269ca=createFieldObject(_0x153dfd,_0x57ab3a,_0x431874[_0xf7f6('0xae')],_0x431874['name'],_0x431874['label'],![]);_0xca1db8[_0xf7f6('0xaf')](_0x9269ca);});return Promise[_0xf7f6('0xb0')](_0xca1db8);})[_0xf7f6('0x27')](function(_0x23592f){_0xa921d0=_0x23592f;_0x3e0b48=Object[_0xf7f6('0xab')]([],_0x38a9ac);console[_0xf7f6('0xa9')]('TCL:\x20_object',_0x38a9ac);_[_0xf7f6('0xac')](_0x3e0b48,function(_0xde48c9){return _0x26ac88[_0xf7f6('0xb1')](_0xde48c9[_0xf7f6('0x32')]);});console[_0xf7f6('0xa9')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3e0b48);_0xca1db8=[];_0x3e0b48[_0xf7f6('0xad')](function(_0x3caa81){var _0x4458be=createFieldObject(_0x153dfd,_0x57ab3a,_0x3caa81['internalType'],_0x3caa81[_0xf7f6('0x32')],_0x3caa81[_0xf7f6('0xb2')],!![]);_0xca1db8['push'](_0x4458be);});return Promise[_0xf7f6('0xb0')](_0xca1db8);})[_0xf7f6('0x27')](function(_0xfd8b82){_0x19e8ed=_0xfd8b82;var _0x50ce08=_0xa921d0[_0xf7f6('0xb3')](_0x19e8ed);return{'count':_0x50ce08[_0xf7f6('0x38')],'rows':_0x50ce08};})[_0xf7f6('0x27')](respondWithResult(_0x51025e,null))['catch'](function(_0x39161f){console[_0xf7f6('0xa9')](_0xf7f6('0xb4')+_0x39161f);var _0x3cd928=_0x52edf9[_0xf7f6('0x33')][_0xf7f6('0xb5')]?0x1f4:_0x39161f[_0xf7f6('0xb6')]||0x1f4;logger[_0xf7f6('0x29')](_0x39161f[_0xf7f6('0x2a')]);delete _0x39161f[_0xf7f6('0x32')];if(_0x3cd928===0x191){_0x3cd928=0x190;}_0x51025e[_0xf7f6('0x1b')](_0x3cd928)['send'](_0x52edf9[_0xf7f6('0x33')]['test']?{'message':_0xf7f6('0xb7'),'statusCode':_0x39161f['statusCode']}:_0x39161f);});};function createFieldObject(_0x38bb01,_0x4be0c2,_0x4b9107,_0x186c02,_0x182990,_0x150f56){return new Promise(function(_0x11d05f,_0x33c1ca){var _0x11773a={'id':_0x186c02,'name':_0x182990,'custom':_0x150f56};if(_0x4b9107===_0xf7f6('0xb8')){_0x11773a[_0xf7f6('0x42')]=[{'name':_0xf7f6('0xb9'),'value':_0xf7f6('0xba')},{'name':_0xf7f6('0xbb'),'value':_0xf7f6('0xbc')}];_0x11d05f(_0x11773a);}else{var _0x20e96b={'method':_0xf7f6('0xa6'),'uri':_0x38bb01+'sys_choice?sysparm_query=name=incident^element='+_0x186c02,'auth':_0x4be0c2,'json':!![]};return rp(_0x20e96b)[_0xf7f6('0x27')](function(_0x3d76fd){var _0x548aa5=[];if(_0x3d76fd[_0xf7f6('0xa8')][_0xf7f6('0x38')]>0x0){_0x3d76fd[_0xf7f6('0xa8')]['forEach'](function(_0x2bb0d4){if(_0x2bb0d4['inactive']==='false'){var _0xb27b9f={'name':_0x2bb0d4[_0xf7f6('0xb2')],'value':_0x2bb0d4['value']};_0x548aa5[_0xf7f6('0xaf')](_0xb27b9f);}});}_0x11773a[_0xf7f6('0x42')]=_0x548aa5;if(_0x11773a['options'][_0xf7f6('0x38')]>0x0){_0x11d05f(_0x11773a);}else{if(_0x150f56==![]){_0x11d05f();}else{_0x11d05f(_0x11773a);}}});}});} \ No newline at end of file +var _0x1dbc=['incident_state','severity','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','sys_domain_path','time_worked','business_duration','group_list','reopened_time','caller_id','approval_set','work_notes','short_description','delivery_task','work_start','assignment_group','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','company','reassignment_count','comments','sla_due','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','test','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowAccount','includeAll','include','catch','show','params','keys','find','create','body','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify'];(function(_0x4c2916,_0x41d619){var _0x29ddd3=function(_0x36ab0f){while(--_0x36ab0f){_0x4c2916['push'](_0x4c2916['shift']());}};_0x29ddd3(++_0x41d619);}(_0x1dbc,0x1c8));var _0xc1db=function(_0x527ce8,_0x122695){_0x527ce8=_0x527ce8-0x0;var _0x2a8a56=_0x1dbc[_0x527ce8];return _0x2a8a56;};'use strict';var emlformat=require(_0xc1db('0x0'));var rimraf=require(_0xc1db('0x1'));var zipdir=require(_0xc1db('0x2'));var jsonpatch=require(_0xc1db('0x3'));var rp=require(_0xc1db('0x4'));var moment=require(_0xc1db('0x5'));var BPromise=require(_0xc1db('0x6'));var Mustache=require(_0xc1db('0x7'));var util=require(_0xc1db('0x8'));var path=require(_0xc1db('0x9'));var sox=require(_0xc1db('0xa'));var csv=require(_0xc1db('0xb'));var ejs=require(_0xc1db('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1db('0xd'));var squel=require(_0xc1db('0xe'));var crypto=require(_0xc1db('0xf'));var jsforce=require(_0xc1db('0x10'));var deskjs=require(_0xc1db('0x11'));var toCsv=require(_0xc1db('0xb'));var querystring=require(_0xc1db('0x12'));var Papa=require(_0xc1db('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc1db('0x14'));var hardwareService=require(_0xc1db('0x15'));var logger=require(_0xc1db('0x16'))(_0xc1db('0x17'));var utils=require(_0xc1db('0x18'));var config=require(_0xc1db('0x19'));var licenseUtil=require(_0xc1db('0x1a'));var db=require(_0xc1db('0x1b'))['db'];var integrations=require(_0xc1db('0x1c'));function respondWithStatusCode(_0x5f2f1f,_0x4c12d1){_0x4c12d1=_0x4c12d1||0xcc;return function(_0x5819b9){if(_0x5819b9){return _0x5f2f1f[_0xc1db('0x1d')](_0x4c12d1);}return _0x5f2f1f[_0xc1db('0x1e')](_0x4c12d1)['end']();};}function respondWithResult(_0x8d5ef9,_0x30d1d9){_0x30d1d9=_0x30d1d9||0xc8;return function(_0x58c8cd){if(_0x58c8cd){return _0x8d5ef9[_0xc1db('0x1e')](_0x30d1d9)[_0xc1db('0x1f')](_0x58c8cd);}};}function respondWithFilteredResult(_0x21652e,_0x54414c){return function(_0xa09c8){if(_0xa09c8){var _0x27b9a5=typeof _0x54414c[_0xc1db('0x20')]==='undefined'&&typeof _0x54414c[_0xc1db('0x21')]==='undefined';var _0x4d2575=_0xa09c8[_0xc1db('0x22')];var _0x20285c=_0x27b9a5?0x0:_0x54414c[_0xc1db('0x20')];var _0xa7d2ed=_0x27b9a5?_0xa09c8[_0xc1db('0x22')]:_0x54414c[_0xc1db('0x20')]+_0x54414c[_0xc1db('0x21')];var _0xaff96c;if(_0xa7d2ed>=_0x4d2575){_0xa7d2ed=_0x4d2575;_0xaff96c=0xc8;}else{_0xaff96c=0xce;}_0x21652e[_0xc1db('0x1e')](_0xaff96c);return _0x21652e['set'](_0xc1db('0x23'),_0x20285c+'-'+_0xa7d2ed+'/'+_0x4d2575)[_0xc1db('0x1f')](_0xa09c8);}return null;};}function patchUpdates(_0xb07e85){return function(_0xb8bdf9){try{jsonpatch[_0xc1db('0x24')](_0xb8bdf9,_0xb07e85,!![]);}catch(_0x36ad4d){return BPromise[_0xc1db('0x25')](_0x36ad4d);}return _0xb8bdf9[_0xc1db('0x26')]();};}function saveUpdates(_0x38ce97,_0x3a04e3){return function(_0x2566f1){if(_0x2566f1){return _0x2566f1[_0xc1db('0x27')](_0x38ce97)[_0xc1db('0x28')](function(_0x2a5369){return _0x2a5369;});}return null;};}function removeEntity(_0x4e075e,_0x2a27ff){return function(_0x198b18){if(_0x198b18){return _0x198b18[_0xc1db('0x29')]()[_0xc1db('0x28')](function(){_0x4e075e[_0xc1db('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46ba01,_0x4132ba){return function(_0x289718){if(!_0x289718){_0x46ba01[_0xc1db('0x1d')](0x194);}return _0x289718;};}function handleError(_0x1ff8be,_0x49206f){_0x49206f=_0x49206f||0x1f4;return function(_0x4fefd4){logger[_0xc1db('0x2a')](_0x4fefd4['stack']);if(_0x4fefd4['name']){delete _0x4fefd4[_0xc1db('0x2b')];}_0x1ff8be['status'](_0x49206f)['send'](_0x4fefd4);};}exports[_0xc1db('0x2c')]=function(_0xfc41d5,_0x5d527b){var _0x7b153e={},_0x46257c={},_0x144a63={'count':0x0,'rows':[]};var _0xf648c1=_['map'](db['ServicenowAccount'][_0xc1db('0x2d')],function(_0x3f7fa4){return{'name':_0x3f7fa4['fieldName'],'type':_0x3f7fa4['type'][_0xc1db('0x2e')]};});_0x46257c[_0xc1db('0x2f')]=_[_0xc1db('0x30')](_0xf648c1,'name');_0x46257c[_0xc1db('0x31')]=_['keys'](_0xfc41d5['query']);_0x46257c[_0xc1db('0x32')]=_[_0xc1db('0x33')](_0x46257c[_0xc1db('0x2f')],_0x46257c[_0xc1db('0x31')]);_0x7b153e[_0xc1db('0x34')]=_[_0xc1db('0x33')](_0x46257c[_0xc1db('0x2f')],qs[_0xc1db('0x35')](_0xfc41d5['query'][_0xc1db('0x35')]));_0x7b153e['attributes']=_0x7b153e[_0xc1db('0x34')][_0xc1db('0x36')]?_0x7b153e[_0xc1db('0x34')]:_0x46257c[_0xc1db('0x2f')];if(!_0xfc41d5[_0xc1db('0x31')]['hasOwnProperty'](_0xc1db('0x37'))){_0x7b153e['limit']=qs['limit'](_0xfc41d5[_0xc1db('0x31')][_0xc1db('0x21')]);_0x7b153e[_0xc1db('0x20')]=qs[_0xc1db('0x20')](_0xfc41d5[_0xc1db('0x31')][_0xc1db('0x20')]);}_0x7b153e[_0xc1db('0x38')]=qs['sort'](_0xfc41d5['query'][_0xc1db('0x39')]);_0x7b153e[_0xc1db('0x3a')]=qs[_0xc1db('0x32')](_[_0xc1db('0x3b')](_0xfc41d5[_0xc1db('0x31')],_0x46257c[_0xc1db('0x32')]),_0xf648c1);if(_0xfc41d5[_0xc1db('0x31')][_0xc1db('0x3c')]){_0x7b153e[_0xc1db('0x3a')]=_['merge'](_0x7b153e[_0xc1db('0x3a')],{'$or':_[_0xc1db('0x30')](_0xf648c1,function(_0x103fed){if(_0x103fed['type']!==_0xc1db('0x3d')){var _0x998225={};_0x998225[_0x103fed[_0xc1db('0x2b')]]={'$like':'%'+_0xfc41d5[_0xc1db('0x31')]['filter']+'%'};return _0x998225;}})});}_0x7b153e=_[_0xc1db('0x3e')]({},_0x7b153e,_0xfc41d5[_0xc1db('0x3f')]);var _0xc81813={'where':_0x7b153e[_0xc1db('0x3a')]};return db[_0xc1db('0x40')][_0xc1db('0x22')](_0xc81813)['then'](function(_0x29f622){_0x144a63[_0xc1db('0x22')]=_0x29f622;if(_0xfc41d5[_0xc1db('0x31')][_0xc1db('0x41')]){_0x7b153e[_0xc1db('0x42')]=[{'all':!![]}];}return db[_0xc1db('0x40')]['findAll'](_0x7b153e);})[_0xc1db('0x28')](function(_0x2bf3ae){_0x144a63['rows']=_0x2bf3ae;return _0x144a63;})[_0xc1db('0x28')](respondWithFilteredResult(_0x5d527b,_0x7b153e))[_0xc1db('0x43')](handleError(_0x5d527b,null));};exports[_0xc1db('0x44')]=function(_0x300667,_0x15d6dc){var _0x15837a={'raw':![],'where':{'id':_0x300667[_0xc1db('0x45')]['id']}},_0x419628={};_0x419628[_0xc1db('0x2f')]=_[_0xc1db('0x46')](db[_0xc1db('0x40')]['rawAttributes']);_0x419628[_0xc1db('0x31')]=_[_0xc1db('0x46')](_0x300667[_0xc1db('0x31')]);_0x419628[_0xc1db('0x32')]=_[_0xc1db('0x33')](_0x419628['model'],_0x419628[_0xc1db('0x31')]);_0x15837a[_0xc1db('0x34')]=_[_0xc1db('0x33')](_0x419628[_0xc1db('0x2f')],qs['fields'](_0x300667[_0xc1db('0x31')]['fields']));_0x15837a[_0xc1db('0x34')]=_0x15837a[_0xc1db('0x34')][_0xc1db('0x36')]?_0x15837a[_0xc1db('0x34')]:_0x419628['model'];if(_0x300667[_0xc1db('0x31')]['includeAll']){_0x15837a[_0xc1db('0x42')]=[{'all':!![]}];}_0x15837a=_[_0xc1db('0x3e')]({},_0x15837a,_0x300667[_0xc1db('0x3f')]);return db[_0xc1db('0x40')][_0xc1db('0x47')](_0x15837a)['then'](handleEntityNotFound(_0x15d6dc,null))['then'](respondWithResult(_0x15d6dc,null))['catch'](handleError(_0x15d6dc,null));};exports[_0xc1db('0x48')]=function(_0xbe9c09,_0x43d051){return db[_0xc1db('0x40')][_0xc1db('0x48')](_0xbe9c09[_0xc1db('0x49')],{})[_0xc1db('0x28')](respondWithResult(_0x43d051,0xc9))['catch'](handleError(_0x43d051,null));};exports[_0xc1db('0x27')]=function(_0x4326e6,_0x12db87){if(_0x4326e6[_0xc1db('0x49')]['id']){delete _0x4326e6[_0xc1db('0x49')]['id'];}return db[_0xc1db('0x40')][_0xc1db('0x47')]({'where':{'id':_0x4326e6['params']['id']}})[_0xc1db('0x28')](handleEntityNotFound(_0x12db87,null))[_0xc1db('0x28')](saveUpdates(_0x4326e6[_0xc1db('0x49')],null))[_0xc1db('0x28')](respondWithResult(_0x12db87,null))[_0xc1db('0x43')](handleError(_0x12db87,null));};exports[_0xc1db('0x29')]=function(_0x188d29,_0x2f673e){return db['ServicenowAccount'][_0xc1db('0x47')]({'where':{'id':_0x188d29[_0xc1db('0x45')]['id']}})[_0xc1db('0x28')](handleEntityNotFound(_0x2f673e,null))[_0xc1db('0x28')](removeEntity(_0x2f673e,null))[_0xc1db('0x43')](handleError(_0x2f673e,null));};exports['getConfigurations']=function(_0x4d6b61,_0xf10f2d,_0x2cad96){var _0x585bb6={};var _0x570a6d={};var _0x433616;var _0x47f569;return db[_0xc1db('0x40')][_0xc1db('0x4a')]({'where':{'id':_0x4d6b61[_0xc1db('0x45')]['id']}})[_0xc1db('0x28')](handleEntityNotFound(_0xf10f2d,null))[_0xc1db('0x28')](function(_0x4898b1){if(_0x4898b1){_0x433616=_0x4898b1;_0x570a6d['model']=_[_0xc1db('0x46')](db['ServicenowConfiguration'][_0xc1db('0x2d')]);_0x570a6d['query']=_['keys'](_0x4d6b61[_0xc1db('0x31')]);_0x570a6d[_0xc1db('0x32')]=_['intersection'](_0x570a6d[_0xc1db('0x2f')],_0x570a6d[_0xc1db('0x31')]);_0x585bb6[_0xc1db('0x34')]=_[_0xc1db('0x33')](_0x570a6d[_0xc1db('0x2f')],qs[_0xc1db('0x35')](_0x4d6b61[_0xc1db('0x31')]['fields']));_0x585bb6[_0xc1db('0x34')]=_0x585bb6[_0xc1db('0x34')][_0xc1db('0x36')]?_0x585bb6[_0xc1db('0x34')]:_0x570a6d[_0xc1db('0x2f')];_0x585bb6[_0xc1db('0x38')]=qs[_0xc1db('0x39')](_0x4d6b61['query'][_0xc1db('0x39')]);_0x585bb6[_0xc1db('0x3a')]=qs['filters'](_[_0xc1db('0x3b')](_0x4d6b61[_0xc1db('0x31')],_0x570a6d[_0xc1db('0x32')]));if(_0x4d6b61[_0xc1db('0x31')][_0xc1db('0x3c')]){_0x585bb6['where']=_[_0xc1db('0x3e')](_0x585bb6['where'],{'$or':_[_0xc1db('0x30')](_0x585bb6[_0xc1db('0x34')],function(_0x1786a1){var _0x1aaf04={};_0x1aaf04[_0x1786a1]={'$like':'%'+_0x4d6b61[_0xc1db('0x31')][_0xc1db('0x3c')]+'%'};return _0x1aaf04;})});}_0x585bb6=_[_0xc1db('0x3e')]({},_0x585bb6,_0x4d6b61[_0xc1db('0x3f')]);return _0x433616[_0xc1db('0x4b')](_0x585bb6);}})[_0xc1db('0x28')](function(_0x48b897){if(_0x48b897){_0x47f569=_0x48b897['length'];if(!_0x4d6b61[_0xc1db('0x31')][_0xc1db('0x4c')](_0xc1db('0x37'))){_0x585bb6[_0xc1db('0x21')]=qs['limit'](_0x4d6b61[_0xc1db('0x31')][_0xc1db('0x21')]);_0x585bb6[_0xc1db('0x20')]=qs[_0xc1db('0x20')](_0x4d6b61['query']['offset']);}return _0x433616[_0xc1db('0x4b')](_0x585bb6);}})[_0xc1db('0x28')](function(_0xcf54f6){if(_0xcf54f6){return _0xcf54f6?{'count':_0x47f569,'rows':_0xcf54f6}:null;}})['then'](respondWithResult(_0xf10f2d,null))[_0xc1db('0x43')](handleError(_0xf10f2d,null));};exports[_0xc1db('0x4d')]=function(_0x1858f1,_0x1bb73c,_0xe5f967){if(_0x1858f1[_0xc1db('0x49')]['id']){delete _0x1858f1[_0xc1db('0x49')]['id'];}return db[_0xc1db('0x40')]['findOne']({'where':{'id':_0x1858f1['params']['id']}})['then'](handleEntityNotFound(_0x1bb73c,null))[_0xc1db('0x28')](function(_0x2a3916){if(_0x2a3916){_0x1858f1['body'][_0xc1db('0x4e')]=_0x2a3916['id'];_0x1858f1['body'][_0xc1db('0x4f')]=integrations[_0xc1db('0x50')](_0x1858f1[_0xc1db('0x49')][_0xc1db('0x51')],_0x1858f1[_0xc1db('0x49')][_0xc1db('0x52')]);_0x1858f1['body'][_0xc1db('0x53')]=integrations[_0xc1db('0x54')](_0x1858f1[_0xc1db('0x49')][_0xc1db('0x51')],_0x1858f1[_0xc1db('0x49')][_0xc1db('0x52')]);return db[_0xc1db('0x55')][_0xc1db('0x48')](_0x1858f1[_0xc1db('0x49')],{'include':[{'model':db[_0xc1db('0x56')],'as':_0xc1db('0x4f')},{'model':db[_0xc1db('0x56')],'as':_0xc1db('0x53')}]});}return null;})[_0xc1db('0x28')](respondWithResult(_0x1bb73c,null))[_0xc1db('0x43')](handleError(_0x1bb73c,null));};exports['getFields']=function(_0x16b181,_0x4f19a8,_0x7390dd){var _0x31f043=[_0xc1db('0x57'),_0xc1db('0x58'),_0xc1db('0x59'),_0xc1db('0x5a'),_0xc1db('0x5b'),_0xc1db('0x5c'),_0xc1db('0x5d'),_0xc1db('0x5e'),_0xc1db('0x5f')];var _0x3f57c7=[_0xc1db('0x60'),_0xc1db('0x57'),_0xc1db('0x61'),_0xc1db('0x62'),'upon_reject',_0xc1db('0x63'),_0xc1db('0x64'),_0xc1db('0x58'),'approval_history',_0xc1db('0x65'),_0xc1db('0x66'),_0xc1db('0x67'),_0xc1db('0x68'),_0xc1db('0x69'),_0xc1db('0x6a'),'sys_domain',_0xc1db('0x6b'),_0xc1db('0x6c'),_0xc1db('0x59'),'order',_0xc1db('0x6d'),_0xc1db('0x6e'),_0xc1db('0x6f'),_0xc1db('0x70'),_0xc1db('0x71'),'active',_0xc1db('0x72'),_0xc1db('0x73'),'priority',_0xc1db('0x74'),'rfc',_0xc1db('0x75'),'expected_start','opened_at',_0xc1db('0x76'),_0xc1db('0x77'),'work_end',_0xc1db('0x78'),'resolved_at',_0xc1db('0x79'),_0xc1db('0x7a'),'subcategory',_0xc1db('0x7b'),_0xc1db('0x7c'),'close_code','correlation_display',_0xc1db('0x7d'),_0xc1db('0x7e'),_0xc1db('0x7f'),'business_stc',_0xc1db('0x80'),_0xc1db('0x81'),'calendar_duration',_0xc1db('0x5c'),_0xc1db('0x82'),_0xc1db('0x83'),_0xc1db('0x84'),_0xc1db('0x85'),_0xc1db('0x86'),'sys_id',_0xc1db('0x87'),_0xc1db('0x88'),_0xc1db('0x5d'),_0xc1db('0x89'),'problem_id',_0xc1db('0x8a'),_0xc1db('0x8b'),'activity_due','assigned_to',_0xc1db('0x5e'),_0xc1db('0x8c'),_0xc1db('0x8d'),'approval','comments_and_work_notes',_0xc1db('0x8e'),_0xc1db('0x8f'),_0xc1db('0x90'),_0xc1db('0x91'),_0xc1db('0x92'),_0xc1db('0x93'),_0xc1db('0x94'),_0xc1db('0x95'),_0xc1db('0x5f')];var _0x5a8abc='';var _0x5919ab='';var _0x212537=[];var _0x309f3c='';var _0x3e1573='';var _0x38d0d3=[];var _0x2bf3fc='';var _0x55b053='';var _0x418c99={};var _0xcef09='';return db[_0xc1db('0x40')][_0xc1db('0x4a')]({'where':{'id':_0x16b181['params']['id']},'attributes':['id',_0xc1db('0x96'),_0xc1db('0x97'),_0xc1db('0x98'),_0xc1db('0x99'),_0xc1db('0x9a')]})[_0xc1db('0x28')](handleEntityNotFound(_0x4f19a8,null))['then'](function(_0x66e2e7){if(_0x66e2e7){_0xcef09=_0x66e2e7['remoteUri'];var _0xbf17ca=_0xcef09[_0xc1db('0x9b')](-0x1);if(_0xbf17ca==='/'){_0xcef09=_0xcef09['substring'](0x0,_0xcef09[_0xc1db('0x9c')](_0xbf17ca));}_0x55b053=util['format'](_0xc1db('0x9d'),_0xcef09);_0x2bf3fc=util['format'](_0xc1db('0x9e'),_0xcef09);_0x418c99={'user':_0x66e2e7[_0xc1db('0x96')],'pass':_0x66e2e7[_0xc1db('0x97')]};var _0x2a09c4={'method':'GET','uri':_0x55b053+_0xc1db('0x9f'),'auth':_0x418c99,'json':!![]};return rp(_0x2a09c4);}})['then'](function(_0x253609){if(_0x253609[_0xc1db('0xa0')][_0xc1db('0x36')]>0x0){_0x5a8abc=_0x253609[_0xc1db('0xa0')];}console[_0xc1db('0xa1')](_0xc1db('0xa2'),_0x5a8abc);_0x38d0d3=[];_0x5919ab=Object[_0xc1db('0xa3')]([],_0x5a8abc);_[_0xc1db('0xa4')](_0x5919ab,function(_0x30ece0){return!_0x31f043[_0xc1db('0xa5')](_0x30ece0[_0xc1db('0x2b')]);});_0x5919ab[_0xc1db('0xa6')](function(_0x1960ec){var _0x23617b=createFieldObject(_0x2bf3fc,_0x418c99,_0x1960ec[_0xc1db('0xa7')],_0x1960ec['name'],_0x1960ec[_0xc1db('0xa8')],![]);_0x38d0d3[_0xc1db('0xa9')](_0x23617b);});return Promise[_0xc1db('0xaa')](_0x38d0d3);})[_0xc1db('0x28')](function(_0x5d79ca){_0x212537=_0x5d79ca;_0x309f3c=Object[_0xc1db('0xa3')]([],_0x5a8abc);console['log'](_0xc1db('0xab'),_0x5a8abc);_[_0xc1db('0xa4')](_0x309f3c,function(_0x135bfa){return _0x3f57c7['includes'](_0x135bfa[_0xc1db('0x2b')]);});console['log'](_0xc1db('0xac'),_0x309f3c);_0x38d0d3=[];_0x309f3c['forEach'](function(_0x5243a2){var _0x277c5d=createFieldObject(_0x2bf3fc,_0x418c99,_0x5243a2[_0xc1db('0xa7')],_0x5243a2[_0xc1db('0x2b')],_0x5243a2[_0xc1db('0xa8')],!![]);_0x38d0d3[_0xc1db('0xa9')](_0x277c5d);});return Promise[_0xc1db('0xaa')](_0x38d0d3);})[_0xc1db('0x28')](function(_0x4c02d4){_0x3e1573=_0x4c02d4;var _0xd2f26e=_0x212537[_0xc1db('0xad')](_0x3e1573);return{'count':_0xd2f26e[_0xc1db('0x36')],'rows':_0xd2f26e};})[_0xc1db('0x28')](respondWithResult(_0x4f19a8,null))[_0xc1db('0x43')](function(_0x1ea7e2){console['log'](_0xc1db('0xae')+_0x1ea7e2);var _0x22e991=_0x16b181['query']['test']?0x1f4:_0x1ea7e2[_0xc1db('0xaf')]||0x1f4;logger[_0xc1db('0x2a')](_0x1ea7e2['stack']);delete _0x1ea7e2[_0xc1db('0x2b')];if(_0x22e991===0x191){_0x22e991=0x190;}_0x4f19a8[_0xc1db('0x1e')](_0x22e991)['send'](_0x16b181[_0xc1db('0x31')][_0xc1db('0xb0')]?{'message':'Wrong\x20credentials','statusCode':_0x1ea7e2['statusCode']}:_0x1ea7e2);});};function createFieldObject(_0x2b0658,_0x32d160,_0x23fef0,_0x4ce15f,_0x149e2e,_0x2f4584){return new Promise(function(_0x110dc0,_0x334918){var _0xd6b551={'id':_0x4ce15f,'name':_0x149e2e,'custom':_0x2f4584};if(_0x23fef0==='boolean'){_0xd6b551['options']=[{'name':_0xc1db('0xb1'),'value':_0xc1db('0xb2')},{'name':_0xc1db('0xb3'),'value':_0xc1db('0xb4')}];_0x110dc0(_0xd6b551);}else{var _0x48bb37={'method':'GET','uri':_0x2b0658+_0xc1db('0xb5')+_0x4ce15f,'auth':_0x32d160,'json':!![]};return rp(_0x48bb37)[_0xc1db('0x28')](function(_0x346daa){var _0x258a37=[];if(_0x346daa['result'][_0xc1db('0x36')]>0x0){_0x346daa['result'][_0xc1db('0xa6')](function(_0xe2c133){if(_0xe2c133[_0xc1db('0xb6')]===_0xc1db('0xb4')){var _0x3c2299={'name':_0xe2c133['label'],'value':_0xe2c133['value']};_0x258a37['push'](_0x3c2299);}});}_0xd6b551['options']=_0x258a37;if(_0xd6b551[_0xc1db('0x3f')][_0xc1db('0x36')]>0x0){_0x110dc0(_0xd6b551);}else{if(_0x2f4584==![]){_0x110dc0();}else{_0x110dc0(_0xd6b551);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 19deca4..bb504b9 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 _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x222c81,_0x332a5d){var _0x164480=function(_0x141ed1){while(--_0x141ed1){_0x222c81['push'](_0x222c81['shift']());}};_0x164480(++_0x332a5d);}(_0x5075,0x73));var _0x5507=function(_0x2e334b,_0x426b6e){_0x2e334b=_0x2e334b-0x0;var _0x390570=_0x5075[_0x2e334b];return _0x390570;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','util','../../config/logger','api','bluebird'];(function(_0x3a4e9d,_0xc70aee){var _0x1a04e1=function(_0x316052){while(--_0x316052){_0x3a4e9d['push'](_0x3a4e9d['shift']());}};_0x1a04e1(++_0xc70aee);}(_0x038b,0x114));var _0xb038=function(_0x2a1345,_0x40899c){_0x2a1345=_0x2a1345-0x0;var _0x428181=_0x038b[_0x2a1345];return _0x428181;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));var integrations=require(_0xb038('0x7'));module['exports']=function(_0x54e1e7,_0x2e3e64){return _0x54e1e7[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':'int_servicenow_accounts','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 9e645c2..5ff4016 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 _0x5e49=['where','attributes','limit','include','model','map','ShowServicenowAccount','find','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw'];(function(_0x4f9e47,_0x3aadc4){var _0x269cfa=function(_0x2b7faa){while(--_0x2b7faa){_0x4f9e47['push'](_0x4f9e47['shift']());}};_0x269cfa(++_0x3aadc4);}(_0x5e49,0x194));var _0x95e4=function(_0x4782ac,_0x47975f){_0x4782ac=_0x4782ac-0x0;var _0x51f823=_0x5e49[_0x4782ac];return _0x51f823;};'use strict';var _=require(_0x95e4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x95e4('0x1'));var rs=require(_0x95e4('0x2'));var fs=require('fs');var Redis=require(_0x95e4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x95e4('0x4'))('rpc');var config=require(_0x95e4('0x5'));var jayson=require(_0x95e4('0x6'));var client=jayson['client'][_0x95e4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x126e66,_0x289864,_0x9457d6){return new BPromise(function(_0x2b4224,_0x4aeed1){return client[_0x95e4('0x8')](_0x126e66,_0x9457d6)[_0x95e4('0x9')](function(_0x355111){logger[_0x95e4('0xa')](_0x95e4('0xb'),_0x289864,_0x95e4('0xc'));logger[_0x95e4('0xd')](_0x95e4('0xe'),_0x289864,_0x95e4('0xc'),JSON[_0x95e4('0xf')](_0x355111));if(_0x355111[_0x95e4('0x10')]){if(_0x355111[_0x95e4('0x10')][_0x95e4('0x11')]===0x1f4){logger[_0x95e4('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x289864,_0x355111['error']['message']);return _0x4aeed1(_0x355111[_0x95e4('0x10')][_0x95e4('0x12')]);}logger[_0x95e4('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x289864,_0x355111[_0x95e4('0x10')][_0x95e4('0x12')]);return _0x2b4224(_0x355111[_0x95e4('0x10')][_0x95e4('0x12')]);}else{logger['info'](_0x95e4('0xb'),_0x289864,'request\x20sent');_0x2b4224(_0x355111['result'][_0x95e4('0x12')]);}})[_0x95e4('0x13')](function(_0x4063ea){logger[_0x95e4('0x10')](_0x95e4('0xb'),_0x289864,_0x4063ea);_0x4aeed1(_0x4063ea);});});}exports[_0x95e4('0x14')]=function(_0x481a51){var _0x48fa81=this;return new Promise(function(_0x942984,_0x2f8dd0){return db[_0x95e4('0x15')][_0x95e4('0x16')]({'raw':_0x481a51[_0x95e4('0x17')]?_0x481a51['options'][_0x95e4('0x18')]===undefined?!![]:![]:!![],'where':_0x481a51[_0x95e4('0x17')]?_0x481a51[_0x95e4('0x17')][_0x95e4('0x19')]||null:null,'attributes':_0x481a51[_0x95e4('0x17')]?_0x481a51[_0x95e4('0x17')][_0x95e4('0x1a')]||null:null,'limit':_0x481a51[_0x95e4('0x17')]?_0x481a51[_0x95e4('0x17')][_0x95e4('0x1b')]||null:null,'include':_0x481a51['options']?_0x481a51[_0x95e4('0x17')][_0x95e4('0x1c')]?_['map'](_0x481a51[_0x95e4('0x17')]['include'],function(_0x5d4c80){return{'model':db[_0x5d4c80[_0x95e4('0x1d')]],'as':_0x5d4c80['as'],'attributes':_0x5d4c80['attributes'],'include':_0x5d4c80['include']?_[_0x95e4('0x1e')](_0x5d4c80[_0x95e4('0x1c')],function(_0x3b43d0){return{'model':db[_0x3b43d0[_0x95e4('0x1d')]],'as':_0x3b43d0['as'],'attributes':_0x3b43d0[_0x95e4('0x1a')],'include':_0x3b43d0[_0x95e4('0x1c')]?_[_0x95e4('0x1e')](_0x3b43d0[_0x95e4('0x1c')],function(_0x429016){return{'model':db[_0x429016['model']],'as':_0x429016['as'],'attributes':_0x429016['attributes']};}):[]};}):[]};}):[]:[]})[_0x95e4('0x9')](function(_0x437168){logger[_0x95e4('0xa')]('GetServicenowAccount',_0x481a51);logger['debug']('GetServicenowAccount',_0x481a51,JSON[_0x95e4('0xf')](_0x437168));_0x942984(_0x437168);})[_0x95e4('0x13')](function(_0xdc6725){logger[_0x95e4('0x10')](_0x95e4('0x14'),_0xdc6725['message'],_0x481a51);_0x2f8dd0(_0x48fa81['error'](0x1f4,_0xdc6725[_0x95e4('0x12')]));});});};exports[_0x95e4('0x1f')]=function(_0x28c292){var _0x3a0e57=this;return new Promise(function(_0x18d8cc,_0x3765d0){return db[_0x95e4('0x15')][_0x95e4('0x20')]({'raw':_0x28c292[_0x95e4('0x17')]?_0x28c292['options'][_0x95e4('0x18')]===undefined?!![]:![]:!![],'where':_0x28c292['options']?_0x28c292[_0x95e4('0x17')]['where']||null:null,'attributes':_0x28c292[_0x95e4('0x17')]?_0x28c292['options'][_0x95e4('0x1a')]||null:null,'include':_0x28c292['options']?_0x28c292['options'][_0x95e4('0x1c')]?_[_0x95e4('0x1e')](_0x28c292[_0x95e4('0x17')][_0x95e4('0x1c')],function(_0x5298f7){return{'model':db[_0x5298f7[_0x95e4('0x1d')]],'as':_0x5298f7['as'],'attributes':_0x5298f7[_0x95e4('0x1a')],'include':_0x5298f7[_0x95e4('0x1c')]?_[_0x95e4('0x1e')](_0x5298f7['include'],function(_0x4d22d2){return{'model':db[_0x4d22d2[_0x95e4('0x1d')]],'as':_0x4d22d2['as'],'attributes':_0x4d22d2[_0x95e4('0x1a')],'include':_0x4d22d2[_0x95e4('0x1c')]?_[_0x95e4('0x1e')](_0x4d22d2['include'],function(_0x212637){return{'model':db[_0x212637['model']],'as':_0x212637['as'],'attributes':_0x212637[_0x95e4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x95e4('0x9')](function(_0x4bbc47){logger[_0x95e4('0xa')](_0x95e4('0x1f'),_0x28c292);logger[_0x95e4('0xd')](_0x95e4('0x1f'),_0x28c292,JSON['stringify'](_0x4bbc47));_0x18d8cc(_0x4bbc47);})['catch'](function(_0x3f5543){logger[_0x95e4('0x10')](_0x95e4('0x1f'),_0x3f5543[_0x95e4('0x12')],_0x28c292);_0x3765d0(_0x3a0e57[_0x95e4('0x10')](0x1f4,_0x3f5543['message']));});});}; \ No newline at end of file +var _0x5630=['request\x20sent','error','code','message','result','GetServicenowAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','catch','ShowServicenowAccount','ServicenowAccount','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s'];(function(_0x329eb5,_0x1b1b40){var _0x1f276a=function(_0x20ea33){while(--_0x20ea33){_0x329eb5['push'](_0x329eb5['shift']());}};_0x1f276a(++_0x1b1b40);}(_0x5630,0x19a));var _0x0563=function(_0x28346a,_0x3462ec){_0x28346a=_0x28346a-0x0;var _0xbcaaf9=_0x5630[_0x28346a];return _0xbcaaf9;};'use strict';var _=require(_0x0563('0x0'));var util=require(_0x0563('0x1'));var moment=require(_0x0563('0x2'));var BPromise=require('bluebird');var rs=require(_0x0563('0x3'));var fs=require('fs');var Redis=require(_0x0563('0x4'));var db=require(_0x0563('0x5'))['db'];var utils=require(_0x0563('0x6'));var logger=require(_0x0563('0x7'))(_0x0563('0x8'));var config=require(_0x0563('0x9'));var jayson=require(_0x0563('0xa'));var client=jayson[_0x0563('0xb')][_0x0563('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cf351,_0x34d4c4,_0x5a100f){return new BPromise(function(_0x41d001,_0x42a2c8){return client[_0x0563('0xd')](_0x5cf351,_0x5a100f)[_0x0563('0xe')](function(_0xedfb67){logger[_0x0563('0xf')](_0x0563('0x10'),_0x34d4c4,'request\x20sent');logger[_0x0563('0x11')](_0x0563('0x12'),_0x34d4c4,_0x0563('0x13'),JSON['stringify'](_0xedfb67));if(_0xedfb67[_0x0563('0x14')]){if(_0xedfb67[_0x0563('0x14')][_0x0563('0x15')]===0x1f4){logger[_0x0563('0x14')](_0x0563('0x10'),_0x34d4c4,_0xedfb67[_0x0563('0x14')][_0x0563('0x16')]);return _0x42a2c8(_0xedfb67[_0x0563('0x14')][_0x0563('0x16')]);}logger[_0x0563('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x34d4c4,_0xedfb67[_0x0563('0x14')]['message']);return _0x41d001(_0xedfb67[_0x0563('0x14')][_0x0563('0x16')]);}else{logger[_0x0563('0xf')](_0x0563('0x10'),_0x34d4c4,_0x0563('0x13'));_0x41d001(_0xedfb67[_0x0563('0x17')][_0x0563('0x16')]);}})['catch'](function(_0x1c806e){logger[_0x0563('0x14')](_0x0563('0x10'),_0x34d4c4,_0x1c806e);_0x42a2c8(_0x1c806e);});});}exports[_0x0563('0x18')]=function(_0x1d3506){var _0x4d0b67=this;return new Promise(function(_0x2bd6f5,_0x47d7ef){return db['ServicenowAccount'][_0x0563('0x19')]({'raw':_0x1d3506[_0x0563('0x1a')]?_0x1d3506[_0x0563('0x1a')][_0x0563('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d3506[_0x0563('0x1a')]?_0x1d3506[_0x0563('0x1a')]['where']||null:null,'attributes':_0x1d3506['options']?_0x1d3506[_0x0563('0x1a')][_0x0563('0x1c')]||null:null,'limit':_0x1d3506[_0x0563('0x1a')]?_0x1d3506[_0x0563('0x1a')][_0x0563('0x1d')]||null:null,'include':_0x1d3506[_0x0563('0x1a')]?_0x1d3506[_0x0563('0x1a')]['include']?_[_0x0563('0x1e')](_0x1d3506['options'][_0x0563('0x1f')],function(_0x401ac9){return{'model':db[_0x401ac9[_0x0563('0x20')]],'as':_0x401ac9['as'],'attributes':_0x401ac9[_0x0563('0x1c')],'include':_0x401ac9[_0x0563('0x1f')]?_[_0x0563('0x1e')](_0x401ac9[_0x0563('0x1f')],function(_0x3eb847){return{'model':db[_0x3eb847[_0x0563('0x20')]],'as':_0x3eb847['as'],'attributes':_0x3eb847[_0x0563('0x1c')],'include':_0x3eb847[_0x0563('0x1f')]?_[_0x0563('0x1e')](_0x3eb847[_0x0563('0x1f')],function(_0xe1b1ef){return{'model':db[_0xe1b1ef['model']],'as':_0xe1b1ef['as'],'attributes':_0xe1b1ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x0563('0xe')](function(_0x19d1e2){logger[_0x0563('0xf')](_0x0563('0x18'),_0x1d3506);logger[_0x0563('0x11')](_0x0563('0x18'),_0x1d3506,JSON[_0x0563('0x21')](_0x19d1e2));_0x2bd6f5(_0x19d1e2);})[_0x0563('0x22')](function(_0xcbcc56){logger[_0x0563('0x14')](_0x0563('0x18'),_0xcbcc56['message'],_0x1d3506);_0x47d7ef(_0x4d0b67[_0x0563('0x14')](0x1f4,_0xcbcc56['message']));});});};exports[_0x0563('0x23')]=function(_0x1c9826){var _0x3d7c4b=this;return new Promise(function(_0x3245ba,_0x27f20f){return db[_0x0563('0x24')][_0x0563('0x25')]({'raw':_0x1c9826[_0x0563('0x1a')]?_0x1c9826[_0x0563('0x1a')][_0x0563('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c9826[_0x0563('0x1a')]?_0x1c9826[_0x0563('0x1a')][_0x0563('0x26')]||null:null,'attributes':_0x1c9826[_0x0563('0x1a')]?_0x1c9826['options']['attributes']||null:null,'include':_0x1c9826[_0x0563('0x1a')]?_0x1c9826[_0x0563('0x1a')][_0x0563('0x1f')]?_[_0x0563('0x1e')](_0x1c9826[_0x0563('0x1a')][_0x0563('0x1f')],function(_0x476f85){return{'model':db[_0x476f85[_0x0563('0x20')]],'as':_0x476f85['as'],'attributes':_0x476f85['attributes'],'include':_0x476f85[_0x0563('0x1f')]?_[_0x0563('0x1e')](_0x476f85['include'],function(_0xf8008c){return{'model':db[_0xf8008c[_0x0563('0x20')]],'as':_0xf8008c['as'],'attributes':_0xf8008c[_0x0563('0x1c')],'include':_0xf8008c[_0x0563('0x1f')]?_['map'](_0xf8008c['include'],function(_0x47ed3c){return{'model':db[_0x47ed3c[_0x0563('0x20')]],'as':_0x47ed3c['as'],'attributes':_0x47ed3c['attributes']};}):[]};}):[]};}):[]:[]})[_0x0563('0xe')](function(_0x125c77){logger[_0x0563('0xf')](_0x0563('0x23'),_0x1c9826);logger[_0x0563('0x11')]('ShowServicenowAccount',_0x1c9826,JSON[_0x0563('0x21')](_0x125c77));_0x3245ba(_0x125c77);})['catch'](function(_0x268525){logger[_0x0563('0x14')]('ShowServicenowAccount',_0x268525[_0x0563('0x16')],_0x1c9826);_0x27f20f(_0x3d7c4b[_0x0563('0x14')](0x1f4,_0x268525[_0x0563('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7341cd4..ea895e3 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 _0x8bb5=['/:id','/:id/fields','getFields','getSubjects','getDescriptions','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index'];(function(_0x3cdcbe,_0x450f7b){var _0x5846a1=function(_0x5d2030){while(--_0x5d2030){_0x3cdcbe['push'](_0x3cdcbe['shift']());}};_0x5846a1(++_0x450f7b);}(_0x8bb5,0x131));var _0x58bb=function(_0x510232,_0x15a0db){_0x510232=_0x510232-0x0;var _0x3072be=_0x8bb5[_0x510232];return _0x3072be;};'use strict';var multer=require('multer');var util=require(_0x58bb('0x0'));var path=require('path');var timeout=require(_0x58bb('0x1'));var express=require(_0x58bb('0x2'));var router=express[_0x58bb('0x3')]();var fs_extra=require(_0x58bb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x58bb('0x5'));var config=require('../../config/environment');var controller=require(_0x58bb('0x6'));router[_0x58bb('0x7')]('/',auth[_0x58bb('0x8')](),controller[_0x58bb('0x9')]);router['get'](_0x58bb('0xa'),auth[_0x58bb('0x8')](),controller['show']);router[_0x58bb('0x7')](_0x58bb('0xb'),auth[_0x58bb('0x8')](),controller[_0x58bb('0xc')]);router[_0x58bb('0x7')]('/:id/subjects',auth[_0x58bb('0x8')](),controller[_0x58bb('0xd')]);router[_0x58bb('0x7')]('/:id/descriptions',auth[_0x58bb('0x8')](),controller[_0x58bb('0xe')]);router[_0x58bb('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x58bb('0x10')](_0x58bb('0xa'),auth[_0x58bb('0x8')](),controller[_0x58bb('0x11')]);router[_0x58bb('0x12')](_0x58bb('0xa'),auth['isAuthenticated'](),controller[_0x58bb('0x13')]);module[_0x58bb('0x14')]=router; \ No newline at end of file +var _0x095a=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0xfbc3e6,_0x18a234){var _0x4c946f=function(_0x224e37){while(--_0x224e37){_0xfbc3e6['push'](_0xfbc3e6['shift']());}};_0x4c946f(++_0x18a234);}(_0x095a,0x86));var _0xa095=function(_0x338b28,_0x483f2d){_0x338b28=_0x338b28-0x0;var _0x56f5d6=_0x095a[_0x338b28];return _0x56f5d6;};'use strict';var multer=require('multer');var util=require(_0xa095('0x0'));var path=require('path');var timeout=require(_0xa095('0x1'));var express=require(_0xa095('0x2'));var router=express[_0xa095('0x3')]();var fs_extra=require(_0xa095('0x4'));var auth=require(_0xa095('0x5'));var interaction=require(_0xa095('0x6'));var config=require(_0xa095('0x7'));var controller=require(_0xa095('0x8'));router[_0xa095('0x9')]('/',auth[_0xa095('0xa')](),controller[_0xa095('0xb')]);router[_0xa095('0x9')](_0xa095('0xc'),auth[_0xa095('0xa')](),controller['show']);router[_0xa095('0x9')]('/:id/fields',auth[_0xa095('0xa')](),controller[_0xa095('0xd')]);router[_0xa095('0x9')](_0xa095('0xe'),auth[_0xa095('0xa')](),controller[_0xa095('0xf')]);router[_0xa095('0x9')](_0xa095('0x10'),auth[_0xa095('0xa')](),controller['getDescriptions']);router[_0xa095('0x11')]('/',auth[_0xa095('0xa')](),controller[_0xa095('0x12')]);router[_0xa095('0x13')](_0xa095('0xc'),auth['isAuthenticated'](),controller[_0xa095('0x14')]);router[_0xa095('0x15')]('/:id',auth[_0xa095('0xa')](),controller[_0xa095('0x16')]);module[_0xa095('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 8c1334e..b6c91d0 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 _0xc599=['STRING','sequelize','exports'];(function(_0x11699b,_0x5c8b3e){var _0x33ed8f=function(_0xd7dbe3){while(--_0xd7dbe3){_0x11699b['push'](_0x11699b['shift']());}};_0x33ed8f(++_0x5c8b3e);}(_0xc599,0x1a2));var _0x9c59=function(_0x24fe48,_0x10e97e){_0x24fe48=_0x24fe48-0x0;var _0x51e7d5=_0xc599[_0x24fe48];return _0x51e7d5;};'use strict';var Sequelize=require(_0x9c59('0x0'));module[_0x9c59('0x1')]={'name':{'type':Sequelize[_0x9c59('0x2')]},'description':{'type':Sequelize[_0x9c59('0x2')]}}; \ No newline at end of file +var _0x519b=['STRING','sequelize','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x519b,0x1e4));var _0xb519=function(_0x4bae1a,_0x5b0916){_0x4bae1a=_0x4bae1a-0x0;var _0x27f6d2=_0x519b[_0x4bae1a];return _0x27f6d2;};'use strict';var Sequelize=require(_0xb519('0x0'));module[_0xb519('0x1')]={'name':{'type':Sequelize[_0xb519('0x2')]},'description':{'type':Sequelize[_0xb519('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index e0ca01a..01a74b2 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 _0x62a9=['key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','rows','catch','show','include','find','create','body','params','getFields','findOne','ServicenowField','length','pick','nolimit','getSubjects','rawAttributes','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','ServicenowConfiguration','fieldName'];(function(_0x1c88c6,_0xbc3582){var _0x5aa202=function(_0x95314e){while(--_0x95314e){_0x1c88c6['push'](_0x1c88c6['shift']());}};_0x5aa202(++_0xbc3582);}(_0x62a9,0x109));var _0x962a=function(_0x4fe496,_0x1d8673){_0x4fe496=_0x4fe496-0x0;var _0x422b24=_0x62a9[_0x4fe496];return _0x422b24;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x962a('0x0'));var jsonpatch=require(_0x962a('0x1'));var rp=require(_0x962a('0x2'));var moment=require(_0x962a('0x3'));var BPromise=require(_0x962a('0x4'));var Mustache=require('mustache');var util=require(_0x962a('0x5'));var path=require('path');var sox=require(_0x962a('0x6'));var csv=require(_0x962a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x962a('0x8'));var _=require('lodash');var squel=require(_0x962a('0x9'));var crypto=require(_0x962a('0xa'));var jsforce=require(_0x962a('0xb'));var deskjs=require(_0x962a('0xc'));var toCsv=require(_0x962a('0x7'));var querystring=require(_0x962a('0xd'));var Papa=require('papaparse');var Redis=require(_0x962a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x962a('0xf'));var hardwareService=require(_0x962a('0x10'));var logger=require('../../config/logger')(_0x962a('0x11'));var utils=require('../../config/utils');var config=require(_0x962a('0x12'));var licenseUtil=require(_0x962a('0x13'));var db=require(_0x962a('0x14'))['db'];function respondWithStatusCode(_0x88d5e4,_0x5414a3){_0x5414a3=_0x5414a3||0xcc;return function(_0x35de40){if(_0x35de40){return _0x88d5e4[_0x962a('0x15')](_0x5414a3);}return _0x88d5e4[_0x962a('0x16')](_0x5414a3)[_0x962a('0x17')]();};}function respondWithResult(_0x5e413c,_0x5562e6){_0x5562e6=_0x5562e6||0xc8;return function(_0x1cd1ea){if(_0x1cd1ea){return _0x5e413c[_0x962a('0x16')](_0x5562e6)[_0x962a('0x18')](_0x1cd1ea);}};}function respondWithFilteredResult(_0x2c39ff,_0x69d126){return function(_0x381ccc){if(_0x381ccc){var _0x5f553e=typeof _0x69d126[_0x962a('0x19')]===_0x962a('0x1a')&&typeof _0x69d126[_0x962a('0x1b')]===_0x962a('0x1a');var _0x3e7652=_0x381ccc[_0x962a('0x1c')];var _0x156e5a=_0x5f553e?0x0:_0x69d126['offset'];var _0x1ff494=_0x5f553e?_0x381ccc[_0x962a('0x1c')]:_0x69d126['offset']+_0x69d126[_0x962a('0x1b')];var _0x19a92d;if(_0x1ff494>=_0x3e7652){_0x1ff494=_0x3e7652;_0x19a92d=0xc8;}else{_0x19a92d=0xce;}_0x2c39ff['status'](_0x19a92d);return _0x2c39ff[_0x962a('0x1d')](_0x962a('0x1e'),_0x156e5a+'-'+_0x1ff494+'/'+_0x3e7652)['json'](_0x381ccc);}return null;};}function patchUpdates(_0x572ba2){return function(_0x3182ff){try{jsonpatch[_0x962a('0x1f')](_0x3182ff,_0x572ba2,!![]);}catch(_0x38955c){return BPromise[_0x962a('0x20')](_0x38955c);}return _0x3182ff[_0x962a('0x21')]();};}function saveUpdates(_0x18f606,_0x57dc76){return function(_0x47e50e){if(_0x47e50e){return _0x47e50e[_0x962a('0x22')](_0x18f606)[_0x962a('0x23')](function(_0x5ac13f){return _0x5ac13f;});}return null;};}function removeEntity(_0x1c1755,_0x561311){return function(_0x43afac){if(_0x43afac){return _0x43afac[_0x962a('0x24')]()[_0x962a('0x23')](function(){_0x1c1755[_0x962a('0x16')](0xcc)[_0x962a('0x17')]();});}};}function handleEntityNotFound(_0x158da5,_0x521ea0){return function(_0x166801){if(!_0x166801){_0x158da5[_0x962a('0x15')](0x194);}return _0x166801;};}function handleError(_0x1b03f0,_0x4aa9ef){_0x4aa9ef=_0x4aa9ef||0x1f4;return function(_0x3af491){logger[_0x962a('0x25')](_0x3af491[_0x962a('0x26')]);if(_0x3af491['name']){delete _0x3af491[_0x962a('0x27')];}_0x1b03f0[_0x962a('0x16')](_0x4aa9ef)['send'](_0x3af491);};}exports[_0x962a('0x28')]=function(_0x1f3578,_0x1e4570){var _0x38f4c1={},_0x711a3d={},_0x24f9d9={'count':0x0,'rows':[]};var _0x50c56c=_['map'](db[_0x962a('0x29')]['rawAttributes'],function(_0x18dbcc){return{'name':_0x18dbcc[_0x962a('0x2a')],'type':_0x18dbcc['type'][_0x962a('0x2b')]};});_0x711a3d[_0x962a('0x2c')]=_[_0x962a('0x2d')](_0x50c56c,_0x962a('0x27'));_0x711a3d[_0x962a('0x2e')]=_[_0x962a('0x2f')](_0x1f3578[_0x962a('0x2e')]);_0x711a3d['filters']=_[_0x962a('0x30')](_0x711a3d[_0x962a('0x2c')],_0x711a3d[_0x962a('0x2e')]);_0x38f4c1[_0x962a('0x31')]=_[_0x962a('0x30')](_0x711a3d[_0x962a('0x2c')],qs[_0x962a('0x32')](_0x1f3578['query'][_0x962a('0x32')]));_0x38f4c1[_0x962a('0x31')]=_0x38f4c1[_0x962a('0x31')]['length']?_0x38f4c1[_0x962a('0x31')]:_0x711a3d['model'];if(!_0x1f3578[_0x962a('0x2e')][_0x962a('0x33')]('nolimit')){_0x38f4c1[_0x962a('0x1b')]=qs['limit'](_0x1f3578['query'][_0x962a('0x1b')]);_0x38f4c1[_0x962a('0x19')]=qs['offset'](_0x1f3578[_0x962a('0x2e')][_0x962a('0x19')]);}_0x38f4c1[_0x962a('0x34')]=qs['sort'](_0x1f3578[_0x962a('0x2e')][_0x962a('0x35')]);_0x38f4c1[_0x962a('0x36')]=qs[_0x962a('0x37')](_['pick'](_0x1f3578[_0x962a('0x2e')],_0x711a3d[_0x962a('0x37')]),_0x50c56c);if(_0x1f3578[_0x962a('0x2e')][_0x962a('0x38')]){_0x38f4c1[_0x962a('0x36')]=_['merge'](_0x38f4c1[_0x962a('0x36')],{'$or':_[_0x962a('0x2d')](_0x50c56c,function(_0x27d6e4){if(_0x27d6e4['type']!=='VIRTUAL'){var _0x2e2c89={};_0x2e2c89[_0x27d6e4['name']]={'$like':'%'+_0x1f3578[_0x962a('0x2e')]['filter']+'%'};return _0x2e2c89;}})});}_0x38f4c1=_[_0x962a('0x39')]({},_0x38f4c1,_0x1f3578[_0x962a('0x3a')]);var _0x340b79={'where':_0x38f4c1['where']};return db[_0x962a('0x29')][_0x962a('0x1c')](_0x340b79)['then'](function(_0x337f72){_0x24f9d9['count']=_0x337f72;if(_0x1f3578[_0x962a('0x2e')][_0x962a('0x3b')]){_0x38f4c1['include']=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x38f4c1);})[_0x962a('0x23')](function(_0x4b8c3f){_0x24f9d9[_0x962a('0x3c')]=_0x4b8c3f;return _0x24f9d9;})[_0x962a('0x23')](respondWithFilteredResult(_0x1e4570,_0x38f4c1))[_0x962a('0x3d')](handleError(_0x1e4570,null));};exports[_0x962a('0x3e')]=function(_0x2781a0,_0x433645){var _0x172679={'raw':![],'where':{'id':_0x2781a0['params']['id']}},_0x3be777={};_0x3be777['model']=_[_0x962a('0x2f')](db[_0x962a('0x29')]['rawAttributes']);_0x3be777[_0x962a('0x2e')]=_['keys'](_0x2781a0[_0x962a('0x2e')]);_0x3be777[_0x962a('0x37')]=_[_0x962a('0x30')](_0x3be777[_0x962a('0x2c')],_0x3be777[_0x962a('0x2e')]);_0x172679[_0x962a('0x31')]=_['intersection'](_0x3be777[_0x962a('0x2c')],qs['fields'](_0x2781a0[_0x962a('0x2e')][_0x962a('0x32')]));_0x172679['attributes']=_0x172679[_0x962a('0x31')]['length']?_0x172679[_0x962a('0x31')]:_0x3be777[_0x962a('0x2c')];if(_0x2781a0[_0x962a('0x2e')]['includeAll']){_0x172679[_0x962a('0x3f')]=[{'all':!![]}];}_0x172679=_[_0x962a('0x39')]({},_0x172679,_0x2781a0[_0x962a('0x3a')]);return db['ServicenowConfiguration'][_0x962a('0x40')](_0x172679)['then'](handleEntityNotFound(_0x433645,null))[_0x962a('0x23')](respondWithResult(_0x433645,null))[_0x962a('0x3d')](handleError(_0x433645,null));};exports[_0x962a('0x41')]=function(_0x910726,_0x56252a){return db[_0x962a('0x29')][_0x962a('0x41')](_0x910726[_0x962a('0x42')],{})[_0x962a('0x23')](respondWithResult(_0x56252a,0xc9))[_0x962a('0x3d')](handleError(_0x56252a,null));};exports[_0x962a('0x22')]=function(_0xa14c5b,_0x470859){if(_0xa14c5b['body']['id']){delete _0xa14c5b['body']['id'];}return db[_0x962a('0x29')]['find']({'where':{'id':_0xa14c5b[_0x962a('0x43')]['id']}})[_0x962a('0x23')](handleEntityNotFound(_0x470859,null))[_0x962a('0x23')](saveUpdates(_0xa14c5b[_0x962a('0x42')],null))['then'](respondWithResult(_0x470859,null))[_0x962a('0x3d')](handleError(_0x470859,null));};exports[_0x962a('0x24')]=function(_0x1959b3,_0x4d50c8){return db[_0x962a('0x29')]['find']({'where':{'id':_0x1959b3[_0x962a('0x43')]['id']}})[_0x962a('0x23')](handleEntityNotFound(_0x4d50c8,null))[_0x962a('0x23')](removeEntity(_0x4d50c8,null))['catch'](handleError(_0x4d50c8,null));};exports[_0x962a('0x44')]=function(_0x1146d5,_0xca8333,_0x1fe942){var _0x30ba6c={};var _0x406dad={};var _0x1e360f;var _0x124154;return db[_0x962a('0x29')][_0x962a('0x45')]({'where':{'id':_0x1146d5[_0x962a('0x43')]['id']}})[_0x962a('0x23')](handleEntityNotFound(_0xca8333,null))[_0x962a('0x23')](function(_0x481dc5){if(_0x481dc5){_0x1e360f=_0x481dc5;_0x406dad['model']=_['keys'](db[_0x962a('0x46')]['rawAttributes']);_0x406dad[_0x962a('0x2e')]=_[_0x962a('0x2f')](_0x1146d5[_0x962a('0x2e')]);_0x406dad[_0x962a('0x37')]=_['intersection'](_0x406dad[_0x962a('0x2c')],_0x406dad[_0x962a('0x2e')]);_0x30ba6c[_0x962a('0x31')]=_[_0x962a('0x30')](_0x406dad[_0x962a('0x2c')],qs[_0x962a('0x32')](_0x1146d5['query'][_0x962a('0x32')]));_0x30ba6c[_0x962a('0x31')]=_0x30ba6c['attributes'][_0x962a('0x47')]?_0x30ba6c[_0x962a('0x31')]:_0x406dad[_0x962a('0x2c')];_0x30ba6c[_0x962a('0x34')]=qs['sort'](_0x1146d5[_0x962a('0x2e')][_0x962a('0x35')]);_0x30ba6c['where']=qs['filters'](_[_0x962a('0x48')](_0x1146d5[_0x962a('0x2e')],_0x406dad[_0x962a('0x37')]));if(_0x1146d5[_0x962a('0x2e')][_0x962a('0x38')]){_0x30ba6c[_0x962a('0x36')]=_['merge'](_0x30ba6c[_0x962a('0x36')],{'$or':_[_0x962a('0x2d')](_0x30ba6c['attributes'],function(_0x528eed){var _0x57fe50={};_0x57fe50[_0x528eed]={'$like':'%'+_0x1146d5['query'][_0x962a('0x38')]+'%'};return _0x57fe50;})});}_0x30ba6c=_['merge']({},_0x30ba6c,_0x1146d5[_0x962a('0x3a')]);return _0x1e360f[_0x962a('0x44')](_0x30ba6c);}})[_0x962a('0x23')](function(_0x286627){if(_0x286627){_0x124154=_0x286627[_0x962a('0x47')];if(!_0x1146d5[_0x962a('0x2e')]['hasOwnProperty'](_0x962a('0x49'))){_0x30ba6c[_0x962a('0x1b')]=qs[_0x962a('0x1b')](_0x1146d5[_0x962a('0x2e')][_0x962a('0x1b')]);_0x30ba6c[_0x962a('0x19')]=qs[_0x962a('0x19')](_0x1146d5[_0x962a('0x2e')]['offset']);}return _0x1e360f[_0x962a('0x44')](_0x30ba6c);}})[_0x962a('0x23')](function(_0x2b62c3){if(_0x2b62c3){return _0x2b62c3?{'count':_0x124154,'rows':_0x2b62c3}:null;}})[_0x962a('0x23')](respondWithResult(_0xca8333,null))[_0x962a('0x3d')](handleError(_0xca8333,null));};exports[_0x962a('0x4a')]=function(_0x4625e1,_0x24b024,_0x591874){var _0x1fc971={};var _0x559241={};var _0x502e1d;var _0x4e1560;return db[_0x962a('0x29')]['findOne']({'where':{'id':_0x4625e1[_0x962a('0x43')]['id']}})[_0x962a('0x23')](handleEntityNotFound(_0x24b024,null))[_0x962a('0x23')](function(_0x386ef2){if(_0x386ef2){_0x502e1d=_0x386ef2;_0x559241['model']=_[_0x962a('0x2f')](db['ServicenowField'][_0x962a('0x4b')]);_0x559241[_0x962a('0x2e')]=_['keys'](_0x4625e1[_0x962a('0x2e')]);_0x559241['filters']=_['intersection'](_0x559241[_0x962a('0x2c')],_0x559241['query']);_0x1fc971['attributes']=_[_0x962a('0x30')](_0x559241[_0x962a('0x2c')],qs[_0x962a('0x32')](_0x4625e1[_0x962a('0x2e')][_0x962a('0x32')]));_0x1fc971[_0x962a('0x31')]=_0x1fc971[_0x962a('0x31')][_0x962a('0x47')]?_0x1fc971[_0x962a('0x31')]:_0x559241['model'];_0x1fc971[_0x962a('0x34')]=qs[_0x962a('0x35')](_0x4625e1['query'][_0x962a('0x35')]);_0x1fc971[_0x962a('0x36')]=qs[_0x962a('0x37')](_[_0x962a('0x48')](_0x4625e1['query'],_0x559241['filters']));if(_0x4625e1['query'][_0x962a('0x38')]){_0x1fc971[_0x962a('0x36')]=_[_0x962a('0x39')](_0x1fc971[_0x962a('0x36')],{'$or':_[_0x962a('0x2d')](_0x1fc971['attributes'],function(_0x4b53be){var _0x8dd7a={};_0x8dd7a[_0x4b53be]={'$like':'%'+_0x4625e1[_0x962a('0x2e')][_0x962a('0x38')]+'%'};return _0x8dd7a;})});}_0x1fc971=_[_0x962a('0x39')]({},_0x1fc971,_0x4625e1[_0x962a('0x3a')]);return _0x502e1d['getSubjects'](_0x1fc971);}})[_0x962a('0x23')](function(_0x4e6d5d){if(_0x4e6d5d){_0x4e1560=_0x4e6d5d['length'];if(!_0x4625e1[_0x962a('0x2e')][_0x962a('0x33')]('nolimit')){_0x1fc971[_0x962a('0x1b')]=qs[_0x962a('0x1b')](_0x4625e1['query']['limit']);_0x1fc971[_0x962a('0x19')]=qs[_0x962a('0x19')](_0x4625e1[_0x962a('0x2e')][_0x962a('0x19')]);}return _0x502e1d[_0x962a('0x4a')](_0x1fc971);}})[_0x962a('0x23')](function(_0x502f9e){if(_0x502f9e){return _0x502f9e?{'count':_0x4e1560,'rows':_0x502f9e}:null;}})[_0x962a('0x23')](respondWithResult(_0x24b024,null))[_0x962a('0x3d')](handleError(_0x24b024,null));};exports[_0x962a('0x4c')]=function(_0x4c8528,_0x698683,_0x30805c){var _0x4a29b1={};var _0x578728={};var _0x509741;var _0x34c096;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x4c8528[_0x962a('0x43')]['id']}})[_0x962a('0x23')](handleEntityNotFound(_0x698683,null))[_0x962a('0x23')](function(_0x1315ab){if(_0x1315ab){_0x509741=_0x1315ab;_0x578728[_0x962a('0x2c')]=_[_0x962a('0x2f')](db[_0x962a('0x46')][_0x962a('0x4b')]);_0x578728[_0x962a('0x2e')]=_[_0x962a('0x2f')](_0x4c8528[_0x962a('0x2e')]);_0x578728[_0x962a('0x37')]=_[_0x962a('0x30')](_0x578728['model'],_0x578728['query']);_0x4a29b1['attributes']=_['intersection'](_0x578728[_0x962a('0x2c')],qs[_0x962a('0x32')](_0x4c8528[_0x962a('0x2e')][_0x962a('0x32')]));_0x4a29b1['attributes']=_0x4a29b1[_0x962a('0x31')][_0x962a('0x47')]?_0x4a29b1[_0x962a('0x31')]:_0x578728['model'];_0x4a29b1[_0x962a('0x34')]=qs[_0x962a('0x35')](_0x4c8528[_0x962a('0x2e')][_0x962a('0x35')]);_0x4a29b1[_0x962a('0x36')]=qs[_0x962a('0x37')](_['pick'](_0x4c8528[_0x962a('0x2e')],_0x578728[_0x962a('0x37')]));if(_0x4c8528[_0x962a('0x2e')][_0x962a('0x38')]){_0x4a29b1['where']=_['merge'](_0x4a29b1['where'],{'$or':_[_0x962a('0x2d')](_0x4a29b1['attributes'],function(_0x1349fc){var _0x3dd76a={};_0x3dd76a[_0x1349fc]={'$like':'%'+_0x4c8528['query']['filter']+'%'};return _0x3dd76a;})});}_0x4a29b1=_['merge']({},_0x4a29b1,_0x4c8528[_0x962a('0x3a')]);return _0x509741[_0x962a('0x4c')](_0x4a29b1);}})[_0x962a('0x23')](function(_0xa778e8){if(_0xa778e8){_0x34c096=_0xa778e8[_0x962a('0x47')];if(!_0x4c8528[_0x962a('0x2e')][_0x962a('0x33')](_0x962a('0x49'))){_0x4a29b1[_0x962a('0x1b')]=qs[_0x962a('0x1b')](_0x4c8528[_0x962a('0x2e')]['limit']);_0x4a29b1[_0x962a('0x19')]=qs[_0x962a('0x19')](_0x4c8528['query'][_0x962a('0x19')]);}return _0x509741[_0x962a('0x4c')](_0x4a29b1);}})['then'](function(_0x81ef78){if(_0x81ef78){return _0x81ef78?{'count':_0x34c096,'rows':_0x81ef78}:null;}})['then'](respondWithResult(_0x698683,null))[_0x962a('0x3d')](handleError(_0x698683,null));}; \ No newline at end of file +var _0xadae=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','findAll','catch','params','include','create','body','find','destroy','getFields','findOne','order','getSubjects','ServicenowField','getDescriptions','rimraf','zip-dir','fast-json-patch'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xadae,0x1a1));var _0xeada=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xadae[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeada('0x0'));var zipdir=require(_0xeada('0x1'));var jsonpatch=require(_0xeada('0x2'));var rp=require('request-promise');var moment=require(_0xeada('0x3'));var BPromise=require(_0xeada('0x4'));var Mustache=require(_0xeada('0x5'));var util=require(_0xeada('0x6'));var path=require(_0xeada('0x7'));var sox=require(_0xeada('0x8'));var csv=require(_0xeada('0x9'));var ejs=require(_0xeada('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeada('0xb'));var squel=require(_0xeada('0xc'));var crypto=require(_0xeada('0xd'));var jsforce=require(_0xeada('0xe'));var deskjs=require(_0xeada('0xf'));var toCsv=require(_0xeada('0x9'));var querystring=require(_0xeada('0x10'));var Papa=require('papaparse');var Redis=require(_0xeada('0x11'));var authService=require(_0xeada('0x12'));var qs=require(_0xeada('0x13'));var as=require(_0xeada('0x14'));var hardwareService=require(_0xeada('0x15'));var logger=require(_0xeada('0x16'))(_0xeada('0x17'));var utils=require('../../config/utils');var config=require(_0xeada('0x18'));var licenseUtil=require(_0xeada('0x19'));var db=require(_0xeada('0x1a'))['db'];function respondWithStatusCode(_0x5a1638,_0x352d5e){_0x352d5e=_0x352d5e||0xcc;return function(_0x97e879){if(_0x97e879){return _0x5a1638[_0xeada('0x1b')](_0x352d5e);}return _0x5a1638[_0xeada('0x1c')](_0x352d5e)[_0xeada('0x1d')]();};}function respondWithResult(_0x53b212,_0x3e6ec9){_0x3e6ec9=_0x3e6ec9||0xc8;return function(_0x4df775){if(_0x4df775){return _0x53b212['status'](_0x3e6ec9)[_0xeada('0x1e')](_0x4df775);}};}function respondWithFilteredResult(_0xc309b4,_0x2e2253){return function(_0x1c6e26){if(_0x1c6e26){var _0x1bcd00=typeof _0x2e2253[_0xeada('0x1f')]===_0xeada('0x20')&&typeof _0x2e2253[_0xeada('0x21')]===_0xeada('0x20');var _0x38a166=_0x1c6e26['count'];var _0x139ff0=_0x1bcd00?0x0:_0x2e2253['offset'];var _0x1d7963=_0x1bcd00?_0x1c6e26['count']:_0x2e2253[_0xeada('0x1f')]+_0x2e2253[_0xeada('0x21')];var _0x35bcba;if(_0x1d7963>=_0x38a166){_0x1d7963=_0x38a166;_0x35bcba=0xc8;}else{_0x35bcba=0xce;}_0xc309b4[_0xeada('0x1c')](_0x35bcba);return _0xc309b4[_0xeada('0x22')](_0xeada('0x23'),_0x139ff0+'-'+_0x1d7963+'/'+_0x38a166)['json'](_0x1c6e26);}return null;};}function patchUpdates(_0x2e5bd1){return function(_0xd97f2){try{jsonpatch[_0xeada('0x24')](_0xd97f2,_0x2e5bd1,!![]);}catch(_0x1d310b){return BPromise[_0xeada('0x25')](_0x1d310b);}return _0xd97f2[_0xeada('0x26')]();};}function saveUpdates(_0x2bc645,_0x368118){return function(_0x27e86a){if(_0x27e86a){return _0x27e86a[_0xeada('0x27')](_0x2bc645)[_0xeada('0x28')](function(_0x389020){return _0x389020;});}return null;};}function removeEntity(_0x281019,_0x3be0fd){return function(_0x4957ac){if(_0x4957ac){return _0x4957ac['destroy']()['then'](function(){_0x281019['status'](0xcc)[_0xeada('0x1d')]();});}};}function handleEntityNotFound(_0x40f2da,_0x34a9ae){return function(_0x5b8613){if(!_0x5b8613){_0x40f2da[_0xeada('0x1b')](0x194);}return _0x5b8613;};}function handleError(_0x3797e2,_0x523e5d){_0x523e5d=_0x523e5d||0x1f4;return function(_0x3f1a52){logger[_0xeada('0x29')](_0x3f1a52[_0xeada('0x2a')]);if(_0x3f1a52[_0xeada('0x2b')]){delete _0x3f1a52['name'];}_0x3797e2[_0xeada('0x1c')](_0x523e5d)[_0xeada('0x2c')](_0x3f1a52);};}exports[_0xeada('0x2d')]=function(_0x5d36fd,_0x34f552){var _0x2137b4={},_0x4c4116={},_0x29acbd={'count':0x0,'rows':[]};var _0x11ca56=_['map'](db[_0xeada('0x2e')][_0xeada('0x2f')],function(_0x304780){return{'name':_0x304780['fieldName'],'type':_0x304780[_0xeada('0x30')][_0xeada('0x31')]};});_0x4c4116[_0xeada('0x32')]=_['map'](_0x11ca56,_0xeada('0x2b'));_0x4c4116['query']=_[_0xeada('0x33')](_0x5d36fd[_0xeada('0x34')]);_0x4c4116[_0xeada('0x35')]=_[_0xeada('0x36')](_0x4c4116[_0xeada('0x32')],_0x4c4116[_0xeada('0x34')]);_0x2137b4[_0xeada('0x37')]=_[_0xeada('0x36')](_0x4c4116[_0xeada('0x32')],qs[_0xeada('0x38')](_0x5d36fd[_0xeada('0x34')][_0xeada('0x38')]));_0x2137b4[_0xeada('0x37')]=_0x2137b4['attributes'][_0xeada('0x39')]?_0x2137b4[_0xeada('0x37')]:_0x4c4116[_0xeada('0x32')];if(!_0x5d36fd[_0xeada('0x34')][_0xeada('0x3a')](_0xeada('0x3b'))){_0x2137b4[_0xeada('0x21')]=qs[_0xeada('0x21')](_0x5d36fd[_0xeada('0x34')][_0xeada('0x21')]);_0x2137b4[_0xeada('0x1f')]=qs['offset'](_0x5d36fd[_0xeada('0x34')][_0xeada('0x1f')]);}_0x2137b4['order']=qs[_0xeada('0x3c')](_0x5d36fd[_0xeada('0x34')][_0xeada('0x3c')]);_0x2137b4[_0xeada('0x3d')]=qs[_0xeada('0x35')](_[_0xeada('0x3e')](_0x5d36fd[_0xeada('0x34')],_0x4c4116[_0xeada('0x35')]),_0x11ca56);if(_0x5d36fd[_0xeada('0x34')][_0xeada('0x3f')]){_0x2137b4[_0xeada('0x3d')]=_[_0xeada('0x40')](_0x2137b4[_0xeada('0x3d')],{'$or':_[_0xeada('0x41')](_0x11ca56,function(_0x2901cb){if(_0x2901cb['type']!==_0xeada('0x42')){var _0x144ccb={};_0x144ccb[_0x2901cb[_0xeada('0x2b')]]={'$like':'%'+_0x5d36fd[_0xeada('0x34')][_0xeada('0x3f')]+'%'};return _0x144ccb;}})});}_0x2137b4=_[_0xeada('0x40')]({},_0x2137b4,_0x5d36fd[_0xeada('0x43')]);var _0x50c226={'where':_0x2137b4[_0xeada('0x3d')]};return db['ServicenowConfiguration'][_0xeada('0x44')](_0x50c226)[_0xeada('0x28')](function(_0x3e8d6c){_0x29acbd['count']=_0x3e8d6c;if(_0x5d36fd[_0xeada('0x34')][_0xeada('0x45')]){_0x2137b4['include']=[{'all':!![]}];}return db[_0xeada('0x2e')][_0xeada('0x46')](_0x2137b4);})[_0xeada('0x28')](function(_0x275a4f){_0x29acbd['rows']=_0x275a4f;return _0x29acbd;})[_0xeada('0x28')](respondWithFilteredResult(_0x34f552,_0x2137b4))[_0xeada('0x47')](handleError(_0x34f552,null));};exports['show']=function(_0x1f0c82,_0x32259d){var _0x22d571={'raw':![],'where':{'id':_0x1f0c82[_0xeada('0x48')]['id']}},_0x4cb205={};_0x4cb205['model']=_[_0xeada('0x33')](db[_0xeada('0x2e')]['rawAttributes']);_0x4cb205['query']=_[_0xeada('0x33')](_0x1f0c82[_0xeada('0x34')]);_0x4cb205[_0xeada('0x35')]=_[_0xeada('0x36')](_0x4cb205[_0xeada('0x32')],_0x4cb205[_0xeada('0x34')]);_0x22d571[_0xeada('0x37')]=_[_0xeada('0x36')](_0x4cb205[_0xeada('0x32')],qs['fields'](_0x1f0c82[_0xeada('0x34')]['fields']));_0x22d571[_0xeada('0x37')]=_0x22d571[_0xeada('0x37')][_0xeada('0x39')]?_0x22d571['attributes']:_0x4cb205[_0xeada('0x32')];if(_0x1f0c82[_0xeada('0x34')][_0xeada('0x45')]){_0x22d571[_0xeada('0x49')]=[{'all':!![]}];}_0x22d571=_[_0xeada('0x40')]({},_0x22d571,_0x1f0c82['options']);return db[_0xeada('0x2e')]['find'](_0x22d571)[_0xeada('0x28')](handleEntityNotFound(_0x32259d,null))[_0xeada('0x28')](respondWithResult(_0x32259d,null))[_0xeada('0x47')](handleError(_0x32259d,null));};exports[_0xeada('0x4a')]=function(_0x2e479b,_0x3fae3a){return db[_0xeada('0x2e')]['create'](_0x2e479b['body'],{})[_0xeada('0x28')](respondWithResult(_0x3fae3a,0xc9))[_0xeada('0x47')](handleError(_0x3fae3a,null));};exports['update']=function(_0x28bd4b,_0x429bd1){if(_0x28bd4b[_0xeada('0x4b')]['id']){delete _0x28bd4b[_0xeada('0x4b')]['id'];}return db[_0xeada('0x2e')][_0xeada('0x4c')]({'where':{'id':_0x28bd4b['params']['id']}})[_0xeada('0x28')](handleEntityNotFound(_0x429bd1,null))[_0xeada('0x28')](saveUpdates(_0x28bd4b[_0xeada('0x4b')],null))[_0xeada('0x28')](respondWithResult(_0x429bd1,null))['catch'](handleError(_0x429bd1,null));};exports[_0xeada('0x4d')]=function(_0x371eac,_0x54423d){return db[_0xeada('0x2e')][_0xeada('0x4c')]({'where':{'id':_0x371eac[_0xeada('0x48')]['id']}})[_0xeada('0x28')](handleEntityNotFound(_0x54423d,null))[_0xeada('0x28')](removeEntity(_0x54423d,null))[_0xeada('0x47')](handleError(_0x54423d,null));};exports[_0xeada('0x4e')]=function(_0x477e32,_0x363ffc,_0x29fd25){var _0x4117d4={};var _0x44934f={};var _0x2afa1c;var _0x427c2e;return db[_0xeada('0x2e')][_0xeada('0x4f')]({'where':{'id':_0x477e32['params']['id']}})[_0xeada('0x28')](handleEntityNotFound(_0x363ffc,null))[_0xeada('0x28')](function(_0x406516){if(_0x406516){_0x2afa1c=_0x406516;_0x44934f[_0xeada('0x32')]=_['keys'](db['ServicenowField'][_0xeada('0x2f')]);_0x44934f[_0xeada('0x34')]=_[_0xeada('0x33')](_0x477e32[_0xeada('0x34')]);_0x44934f[_0xeada('0x35')]=_[_0xeada('0x36')](_0x44934f[_0xeada('0x32')],_0x44934f[_0xeada('0x34')]);_0x4117d4['attributes']=_[_0xeada('0x36')](_0x44934f['model'],qs['fields'](_0x477e32['query'][_0xeada('0x38')]));_0x4117d4['attributes']=_0x4117d4[_0xeada('0x37')][_0xeada('0x39')]?_0x4117d4[_0xeada('0x37')]:_0x44934f[_0xeada('0x32')];_0x4117d4[_0xeada('0x50')]=qs[_0xeada('0x3c')](_0x477e32[_0xeada('0x34')][_0xeada('0x3c')]);_0x4117d4[_0xeada('0x3d')]=qs[_0xeada('0x35')](_[_0xeada('0x3e')](_0x477e32[_0xeada('0x34')],_0x44934f[_0xeada('0x35')]));if(_0x477e32['query'][_0xeada('0x3f')]){_0x4117d4['where']=_[_0xeada('0x40')](_0x4117d4[_0xeada('0x3d')],{'$or':_['map'](_0x4117d4[_0xeada('0x37')],function(_0x4bdfc9){var _0x3896f1={};_0x3896f1[_0x4bdfc9]={'$like':'%'+_0x477e32[_0xeada('0x34')]['filter']+'%'};return _0x3896f1;})});}_0x4117d4=_[_0xeada('0x40')]({},_0x4117d4,_0x477e32[_0xeada('0x43')]);return _0x2afa1c[_0xeada('0x4e')](_0x4117d4);}})['then'](function(_0xc92d93){if(_0xc92d93){_0x427c2e=_0xc92d93[_0xeada('0x39')];if(!_0x477e32[_0xeada('0x34')][_0xeada('0x3a')](_0xeada('0x3b'))){_0x4117d4['limit']=qs[_0xeada('0x21')](_0x477e32[_0xeada('0x34')][_0xeada('0x21')]);_0x4117d4['offset']=qs[_0xeada('0x1f')](_0x477e32[_0xeada('0x34')][_0xeada('0x1f')]);}return _0x2afa1c[_0xeada('0x4e')](_0x4117d4);}})['then'](function(_0x366444){if(_0x366444){return _0x366444?{'count':_0x427c2e,'rows':_0x366444}:null;}})[_0xeada('0x28')](respondWithResult(_0x363ffc,null))[_0xeada('0x47')](handleError(_0x363ffc,null));};exports[_0xeada('0x51')]=function(_0x53db17,_0x33e9ba,_0x139a53){var _0x1abce4={};var _0x196d6c={};var _0x1ac86c;var _0x1a65ee;return db[_0xeada('0x2e')][_0xeada('0x4f')]({'where':{'id':_0x53db17[_0xeada('0x48')]['id']}})[_0xeada('0x28')](handleEntityNotFound(_0x33e9ba,null))[_0xeada('0x28')](function(_0x2a6726){if(_0x2a6726){_0x1ac86c=_0x2a6726;_0x196d6c[_0xeada('0x32')]=_[_0xeada('0x33')](db[_0xeada('0x52')][_0xeada('0x2f')]);_0x196d6c['query']=_[_0xeada('0x33')](_0x53db17[_0xeada('0x34')]);_0x196d6c['filters']=_[_0xeada('0x36')](_0x196d6c[_0xeada('0x32')],_0x196d6c[_0xeada('0x34')]);_0x1abce4[_0xeada('0x37')]=_['intersection'](_0x196d6c[_0xeada('0x32')],qs[_0xeada('0x38')](_0x53db17[_0xeada('0x34')]['fields']));_0x1abce4[_0xeada('0x37')]=_0x1abce4[_0xeada('0x37')][_0xeada('0x39')]?_0x1abce4[_0xeada('0x37')]:_0x196d6c[_0xeada('0x32')];_0x1abce4[_0xeada('0x50')]=qs[_0xeada('0x3c')](_0x53db17[_0xeada('0x34')]['sort']);_0x1abce4['where']=qs[_0xeada('0x35')](_[_0xeada('0x3e')](_0x53db17['query'],_0x196d6c[_0xeada('0x35')]));if(_0x53db17['query'][_0xeada('0x3f')]){_0x1abce4[_0xeada('0x3d')]=_[_0xeada('0x40')](_0x1abce4[_0xeada('0x3d')],{'$or':_[_0xeada('0x41')](_0x1abce4[_0xeada('0x37')],function(_0xcb8f73){var _0x4dd133={};_0x4dd133[_0xcb8f73]={'$like':'%'+_0x53db17[_0xeada('0x34')][_0xeada('0x3f')]+'%'};return _0x4dd133;})});}_0x1abce4=_[_0xeada('0x40')]({},_0x1abce4,_0x53db17[_0xeada('0x43')]);return _0x1ac86c[_0xeada('0x51')](_0x1abce4);}})['then'](function(_0x448216){if(_0x448216){_0x1a65ee=_0x448216[_0xeada('0x39')];if(!_0x53db17[_0xeada('0x34')][_0xeada('0x3a')](_0xeada('0x3b'))){_0x1abce4[_0xeada('0x21')]=qs['limit'](_0x53db17[_0xeada('0x34')][_0xeada('0x21')]);_0x1abce4[_0xeada('0x1f')]=qs[_0xeada('0x1f')](_0x53db17['query'][_0xeada('0x1f')]);}return _0x1ac86c[_0xeada('0x51')](_0x1abce4);}})['then'](function(_0x3f55f2){if(_0x3f55f2){return _0x3f55f2?{'count':_0x1a65ee,'rows':_0x3f55f2}:null;}})[_0xeada('0x28')](respondWithResult(_0x33e9ba,null))[_0xeada('0x47')](handleError(_0x33e9ba,null));};exports['getDescriptions']=function(_0x1b5576,_0x214210,_0x5e246c){var _0x806c04={};var _0x384170={};var _0x4d2b15;var _0x3d14f7;return db[_0xeada('0x2e')][_0xeada('0x4f')]({'where':{'id':_0x1b5576[_0xeada('0x48')]['id']}})[_0xeada('0x28')](handleEntityNotFound(_0x214210,null))[_0xeada('0x28')](function(_0x23d6e4){if(_0x23d6e4){_0x4d2b15=_0x23d6e4;_0x384170[_0xeada('0x32')]=_[_0xeada('0x33')](db[_0xeada('0x52')][_0xeada('0x2f')]);_0x384170[_0xeada('0x34')]=_[_0xeada('0x33')](_0x1b5576[_0xeada('0x34')]);_0x384170[_0xeada('0x35')]=_['intersection'](_0x384170[_0xeada('0x32')],_0x384170[_0xeada('0x34')]);_0x806c04['attributes']=_[_0xeada('0x36')](_0x384170['model'],qs['fields'](_0x1b5576[_0xeada('0x34')][_0xeada('0x38')]));_0x806c04[_0xeada('0x37')]=_0x806c04['attributes'][_0xeada('0x39')]?_0x806c04[_0xeada('0x37')]:_0x384170[_0xeada('0x32')];_0x806c04[_0xeada('0x50')]=qs[_0xeada('0x3c')](_0x1b5576[_0xeada('0x34')][_0xeada('0x3c')]);_0x806c04[_0xeada('0x3d')]=qs[_0xeada('0x35')](_['pick'](_0x1b5576[_0xeada('0x34')],_0x384170[_0xeada('0x35')]));if(_0x1b5576[_0xeada('0x34')][_0xeada('0x3f')]){_0x806c04[_0xeada('0x3d')]=_[_0xeada('0x40')](_0x806c04[_0xeada('0x3d')],{'$or':_['map'](_0x806c04[_0xeada('0x37')],function(_0x2de84c){var _0x104722={};_0x104722[_0x2de84c]={'$like':'%'+_0x1b5576[_0xeada('0x34')][_0xeada('0x3f')]+'%'};return _0x104722;})});}_0x806c04=_[_0xeada('0x40')]({},_0x806c04,_0x1b5576[_0xeada('0x43')]);return _0x4d2b15[_0xeada('0x53')](_0x806c04);}})[_0xeada('0x28')](function(_0x3bbe85){if(_0x3bbe85){_0x3d14f7=_0x3bbe85[_0xeada('0x39')];if(!_0x1b5576[_0xeada('0x34')][_0xeada('0x3a')](_0xeada('0x3b'))){_0x806c04[_0xeada('0x21')]=qs[_0xeada('0x21')](_0x1b5576[_0xeada('0x34')][_0xeada('0x21')]);_0x806c04['offset']=qs[_0xeada('0x1f')](_0x1b5576[_0xeada('0x34')][_0xeada('0x1f')]);}return _0x4d2b15[_0xeada('0x53')](_0x806c04);}})['then'](function(_0x48fe30){if(_0x48fe30){return _0x48fe30?{'count':_0x3d14f7,'rows':_0x48fe30}:null;}})[_0xeada('0x28')](respondWithResult(_0x214210,null))[_0xeada('0x47')](handleError(_0x214210,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index afeafb5..73f3d25 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 _0x2fe3=['lodash','util','moment','request-promise','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x4ad15d,_0x265354){var _0x29fb55=function(_0x4827c3){while(--_0x4827c3){_0x4ad15d['push'](_0x4ad15d['shift']());}};_0x29fb55(++_0x265354);}(_0x2fe3,0x87));var _0x32fe=function(_0x4b73ab,_0x148010){_0x4b73ab=_0x4b73ab-0x0;var _0x3eb495=_0x2fe3[_0x4b73ab];return _0x3eb495;};'use strict';var _=require(_0x32fe('0x0'));var util=require(_0x32fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x32fe('0x2'));var BPromise=require('bluebird');var rp=require(_0x32fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32fe('0x4'));var attributes=require(_0x32fe('0x5'));module['exports']=function(_0x6605ec,_0x89aed1){return _0x6605ec[_0x32fe('0x6')](_0x32fe('0x7'),attributes,{'tableName':_0x32fe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbdd=['int_servicenow_configurations','util','api','moment','rimraf','exports','define'];(function(_0x1e0957,_0xf4026f){var _0x1e4676=function(_0x487102){while(--_0x487102){_0x1e0957['push'](_0x1e0957['shift']());}};_0x1e4676(++_0xf4026f);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbbdd[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xdbbd('0x0'));var logger=require('../../config/logger')(_0xdbbd('0x1'));var moment=require(_0xdbbd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdbbd('0x3'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0xdbbd('0x4')]=function(_0x103977,_0x3e81aa){return _0x103977[_0xdbbd('0x5')]('ServicenowConfiguration',attributes,{'tableName':_0xdbbd('0x6'),'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 6d050e5..b1b9cda 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 _0xda3b=['../../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','lodash','util'];(function(_0x5ccf93,_0x452331){var _0x2e9fc0=function(_0x295a8c){while(--_0x295a8c){_0x5ccf93['push'](_0x5ccf93['shift']());}};_0x2e9fc0(++_0x452331);}(_0xda3b,0x18d));var _0xbda3=function(_0x3d5719,_0x2fea03){_0x3d5719=_0x3d5719-0x0;var _0x2c17da=_0xda3b[_0x3d5719];return _0x2c17da;};'use strict';var _=require(_0xbda3('0x0'));var util=require(_0xbda3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbda3('0x2'))['db'];var utils=require(_0xbda3('0x3'));var logger=require(_0xbda3('0x4'))('rpc');var config=require(_0xbda3('0x5'));var jayson=require(_0xbda3('0x6'));var client=jayson[_0xbda3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7512,_0x55d4f2,_0x60d17e){return new BPromise(function(_0x135ce6,_0x4852a0){return client[_0xbda3('0x8')](_0x1f7512,_0x60d17e)[_0xbda3('0x9')](function(_0x2eddec){logger[_0xbda3('0xa')](_0xbda3('0xb'),_0x55d4f2,_0xbda3('0xc'));logger[_0xbda3('0xd')](_0xbda3('0xe'),_0x55d4f2,_0xbda3('0xc'),JSON[_0xbda3('0xf')](_0x2eddec));if(_0x2eddec[_0xbda3('0x10')]){if(_0x2eddec[_0xbda3('0x10')][_0xbda3('0x11')]===0x1f4){logger['error'](_0xbda3('0xb'),_0x55d4f2,_0x2eddec[_0xbda3('0x10')][_0xbda3('0x12')]);return _0x4852a0(_0x2eddec[_0xbda3('0x10')][_0xbda3('0x12')]);}logger[_0xbda3('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x55d4f2,_0x2eddec[_0xbda3('0x10')][_0xbda3('0x12')]);return _0x135ce6(_0x2eddec[_0xbda3('0x10')][_0xbda3('0x12')]);}else{logger[_0xbda3('0xa')](_0xbda3('0xb'),_0x55d4f2,'request\x20sent');_0x135ce6(_0x2eddec['result']['message']);}})['catch'](function(_0x476e3f){logger[_0xbda3('0x10')](_0xbda3('0xb'),_0x55d4f2,_0x476e3f);_0x4852a0(_0x476e3f);});});} \ No newline at end of file +var _0x3acb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','info','result','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4d424e,_0x8ac8c5){var _0x3c2d71=function(_0x1cd567){while(--_0x1cd567){_0x4d424e['push'](_0x4d424e['shift']());}};_0x3c2d71(++_0x8ac8c5);}(_0x3acb,0x114));var _0xb3ac=function(_0x22964a,_0x5e0b04){_0x22964a=_0x22964a-0x0;var _0x178b4c=_0x3acb[_0x22964a];return _0x178b4c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb3ac('0x0'));var BPromise=require('bluebird');var rs=require(_0xb3ac('0x1'));var fs=require('fs');var Redis=require(_0xb3ac('0x2'));var db=require(_0xb3ac('0x3'))['db'];var utils=require(_0xb3ac('0x4'));var logger=require(_0xb3ac('0x5'))('rpc');var config=require(_0xb3ac('0x6'));var jayson=require(_0xb3ac('0x7'));var client=jayson[_0xb3ac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a46e5,_0x34aea1,_0x24cbc0){return new BPromise(function(_0x539a65,_0x1d444d){return client['request'](_0x2a46e5,_0x24cbc0)[_0xb3ac('0x9')](function(_0x3263d4){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x34aea1,_0xb3ac('0xa'));logger[_0xb3ac('0xb')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x34aea1,_0xb3ac('0xa'),JSON[_0xb3ac('0xc')](_0x3263d4));if(_0x3263d4[_0xb3ac('0xd')]){if(_0x3263d4[_0xb3ac('0xd')][_0xb3ac('0xe')]===0x1f4){logger[_0xb3ac('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x34aea1,_0x3263d4[_0xb3ac('0xd')]['message']);return _0x1d444d(_0x3263d4[_0xb3ac('0xd')][_0xb3ac('0xf')]);}logger[_0xb3ac('0xd')](_0xb3ac('0x10'),_0x34aea1,_0x3263d4[_0xb3ac('0xd')]['message']);return _0x539a65(_0x3263d4['error']['message']);}else{logger[_0xb3ac('0x11')](_0xb3ac('0x10'),_0x34aea1,_0xb3ac('0xa'));_0x539a65(_0x3263d4[_0xb3ac('0x12')][_0xb3ac('0xf')]);}})[_0xb3ac('0x13')](function(_0xd63f20){logger['error'](_0xb3ac('0x10'),_0x34aea1,_0xd63f20);_0x1d444d(_0xd63f20);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 55bd68f..ec4788a 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 _0x04f7=['destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','create','put','/:id','update','delete'];(function(_0x376195,_0x401af2){var _0x5733ef=function(_0x512e97){while(--_0x512e97){_0x376195['push'](_0x376195['shift']());}};_0x5733ef(++_0x401af2);}(_0x04f7,0x133));var _0x704f=function(_0x7400cd,_0x38906e){_0x7400cd=_0x7400cd-0x0;var _0x377202=_0x04f7[_0x7400cd];return _0x377202;};'use strict';var multer=require(_0x704f('0x0'));var util=require('util');var path=require(_0x704f('0x1'));var timeout=require(_0x704f('0x2'));var express=require(_0x704f('0x3'));var router=express[_0x704f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x704f('0x5'));var interaction=require(_0x704f('0x6'));var config=require(_0x704f('0x7'));var controller=require('./intServicenowField.controller');router[_0x704f('0x8')]('/',auth[_0x704f('0x9')](),controller[_0x704f('0xa')]);router['get']('/:id',auth[_0x704f('0x9')](),controller['show']);router['post']('/',auth[_0x704f('0x9')](),controller[_0x704f('0xb')]);router[_0x704f('0xc')](_0x704f('0xd'),auth[_0x704f('0x9')](),controller[_0x704f('0xe')]);router[_0x704f('0xf')](_0x704f('0xd'),auth[_0x704f('0x9')](),controller[_0x704f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3d0f=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3d0f,0xf2));var _0xf3d0=function(_0x188c88,_0x210793){_0x188c88=_0x188c88-0x0;var _0x4e4c38=_0x3d0f[_0x188c88];return _0x4e4c38;};'use strict';var multer=require(_0xf3d0('0x0'));var util=require(_0xf3d0('0x1'));var path=require(_0xf3d0('0x2'));var timeout=require(_0xf3d0('0x3'));var express=require(_0xf3d0('0x4'));var router=express[_0xf3d0('0x5')]();var fs_extra=require(_0xf3d0('0x6'));var auth=require(_0xf3d0('0x7'));var interaction=require(_0xf3d0('0x8'));var config=require('../../config/environment');var controller=require(_0xf3d0('0x9'));router[_0xf3d0('0xa')]('/',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0xc')]);router[_0xf3d0('0xa')]('/:id',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0xd')]);router[_0xf3d0('0xe')]('/',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0xf')]);router[_0xf3d0('0x10')](_0xf3d0('0x11'),auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x12')]);router[_0xf3d0('0x13')](_0xf3d0('0x11'),auth[_0xf3d0('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 7dbecf3..7a96594 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 _0x6644=['ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6644,0xa0));var _0x4664=function(_0x1c121a,_0x1d9316){_0x1c121a=_0x1c121a-0x0;var _0x4fba76=_0x6644[_0x1c121a];return _0x4fba76;};'use strict';var Sequelize=require(_0x4664('0x0'));module[_0x4664('0x1')]={'type':{'type':Sequelize[_0x4664('0x2')](_0x4664('0x3'),_0x4664('0x4'),'customVariable','keyValue',_0x4664('0x5')),'defaultValue':_0x4664('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4664('0x6')]},'keyType':{'type':Sequelize[_0x4664('0x2')](_0x4664('0x3'),_0x4664('0x4'),_0x4664('0x7'))},'keyContent':{'type':Sequelize[_0x4664('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4664('0x6')]},'customField':{'type':Sequelize[_0x4664('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4664('0x6')]}}; \ No newline at end of file +var _0x0efa=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0efa,0x1dc));var _0xa0ef=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x0efa[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0xa0ef('0x0'));module[_0xa0ef('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa0ef('0x2'),_0xa0ef('0x3'),_0xa0ef('0x4'),_0xa0ef('0x5'),_0xa0ef('0x6')),'defaultValue':_0xa0ef('0x2')},'content':{'type':Sequelize[_0xa0ef('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa0ef('0x8')]('string',_0xa0ef('0x3'),_0xa0ef('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa0ef('0x7')]},'nameField':{'type':Sequelize[_0xa0ef('0x7')]},'customField':{'type':Sequelize[_0xa0ef('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa0ef('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c894203..153f726 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 _0xef32=['params','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','index','map','ServicenowField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','create','body','find'];(function(_0x3b4d80,_0x15af6c){var _0x3b2539=function(_0x5542ce){while(--_0x5542ce){_0x3b4d80['push'](_0x3b4d80['shift']());}};_0x3b2539(++_0x15af6c);}(_0xef32,0x126));var _0x2ef3=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0xef32[_0xe8129c];return _0x709fc5;};'use strict';var emlformat=require(_0x2ef3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ef3('0x1'));var rp=require('request-promise');var moment=require(_0x2ef3('0x2'));var BPromise=require(_0x2ef3('0x3'));var Mustache=require(_0x2ef3('0x4'));var util=require(_0x2ef3('0x5'));var path=require(_0x2ef3('0x6'));var sox=require(_0x2ef3('0x7'));var csv=require('to-csv');var ejs=require(_0x2ef3('0x8'));var fs=require('fs');var fs_extra=require(_0x2ef3('0x9'));var _=require(_0x2ef3('0xa'));var squel=require('squel');var crypto=require(_0x2ef3('0xb'));var jsforce=require(_0x2ef3('0xc'));var deskjs=require(_0x2ef3('0xd'));var toCsv=require(_0x2ef3('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2ef3('0xf'));var authService=require(_0x2ef3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2ef3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ef3('0x12'))(_0x2ef3('0x13'));var utils=require(_0x2ef3('0x14'));var config=require(_0x2ef3('0x15'));var licenseUtil=require(_0x2ef3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x367435,_0x1e775e){_0x1e775e=_0x1e775e||0xcc;return function(_0xa2dbf7){if(_0xa2dbf7){return _0x367435[_0x2ef3('0x17')](_0x1e775e);}return _0x367435[_0x2ef3('0x18')](_0x1e775e)['end']();};}function respondWithResult(_0x4307a2,_0x13fdec){_0x13fdec=_0x13fdec||0xc8;return function(_0x505574){if(_0x505574){return _0x4307a2[_0x2ef3('0x18')](_0x13fdec)[_0x2ef3('0x19')](_0x505574);}};}function respondWithFilteredResult(_0x1156c9,_0x51a0f2){return function(_0x5960a3){if(_0x5960a3){var _0x5ac3f1=typeof _0x51a0f2[_0x2ef3('0x1a')]===_0x2ef3('0x1b')&&typeof _0x51a0f2[_0x2ef3('0x1c')]===_0x2ef3('0x1b');var _0x4a5409=_0x5960a3[_0x2ef3('0x1d')];var _0x46821d=_0x5ac3f1?0x0:_0x51a0f2[_0x2ef3('0x1a')];var _0x3f56f9=_0x5ac3f1?_0x5960a3['count']:_0x51a0f2[_0x2ef3('0x1a')]+_0x51a0f2[_0x2ef3('0x1c')];var _0x1ec5f3;if(_0x3f56f9>=_0x4a5409){_0x3f56f9=_0x4a5409;_0x1ec5f3=0xc8;}else{_0x1ec5f3=0xce;}_0x1156c9[_0x2ef3('0x18')](_0x1ec5f3);return _0x1156c9[_0x2ef3('0x1e')](_0x2ef3('0x1f'),_0x46821d+'-'+_0x3f56f9+'/'+_0x4a5409)['json'](_0x5960a3);}return null;};}function patchUpdates(_0x2db4a4){return function(_0x5e42d4){try{jsonpatch[_0x2ef3('0x20')](_0x5e42d4,_0x2db4a4,!![]);}catch(_0x2b7a00){return BPromise[_0x2ef3('0x21')](_0x2b7a00);}return _0x5e42d4[_0x2ef3('0x22')]();};}function saveUpdates(_0x404bf3,_0x543594){return function(_0x2fc483){if(_0x2fc483){return _0x2fc483[_0x2ef3('0x23')](_0x404bf3)[_0x2ef3('0x24')](function(_0x15937e){return _0x15937e;});}return null;};}function removeEntity(_0x59792e,_0x268dce){return function(_0x2bed1c){if(_0x2bed1c){return _0x2bed1c['destroy']()['then'](function(){_0x59792e['status'](0xcc)[_0x2ef3('0x25')]();});}};}function handleEntityNotFound(_0x2bc084,_0x4e2605){return function(_0x31885a){if(!_0x31885a){_0x2bc084[_0x2ef3('0x17')](0x194);}return _0x31885a;};}function handleError(_0xc0367c,_0x4e5083){_0x4e5083=_0x4e5083||0x1f4;return function(_0x5393b8){logger[_0x2ef3('0x26')](_0x5393b8['stack']);if(_0x5393b8['name']){delete _0x5393b8['name'];}_0xc0367c[_0x2ef3('0x18')](_0x4e5083)['send'](_0x5393b8);};}exports[_0x2ef3('0x27')]=function(_0x78f8df,_0x354679){var _0x1fd95e={},_0x4a5e68={},_0x31fc58={'count':0x0,'rows':[]};var _0x10adff=_[_0x2ef3('0x28')](db[_0x2ef3('0x29')][_0x2ef3('0x2a')],function(_0x143fd2){return{'name':_0x143fd2['fieldName'],'type':_0x143fd2[_0x2ef3('0x2b')]['key']};});_0x4a5e68[_0x2ef3('0x2c')]=_[_0x2ef3('0x28')](_0x10adff,'name');_0x4a5e68[_0x2ef3('0x2d')]=_[_0x2ef3('0x2e')](_0x78f8df[_0x2ef3('0x2d')]);_0x4a5e68[_0x2ef3('0x2f')]=_[_0x2ef3('0x30')](_0x4a5e68[_0x2ef3('0x2c')],_0x4a5e68[_0x2ef3('0x2d')]);_0x1fd95e[_0x2ef3('0x31')]=_[_0x2ef3('0x30')](_0x4a5e68[_0x2ef3('0x2c')],qs[_0x2ef3('0x32')](_0x78f8df['query'][_0x2ef3('0x32')]));_0x1fd95e[_0x2ef3('0x31')]=_0x1fd95e[_0x2ef3('0x31')][_0x2ef3('0x33')]?_0x1fd95e['attributes']:_0x4a5e68['model'];if(!_0x78f8df[_0x2ef3('0x2d')]['hasOwnProperty'](_0x2ef3('0x34'))){_0x1fd95e[_0x2ef3('0x1c')]=qs[_0x2ef3('0x1c')](_0x78f8df[_0x2ef3('0x2d')][_0x2ef3('0x1c')]);_0x1fd95e[_0x2ef3('0x1a')]=qs[_0x2ef3('0x1a')](_0x78f8df[_0x2ef3('0x2d')][_0x2ef3('0x1a')]);}_0x1fd95e[_0x2ef3('0x35')]=qs['sort'](_0x78f8df[_0x2ef3('0x2d')][_0x2ef3('0x36')]);_0x1fd95e[_0x2ef3('0x37')]=qs[_0x2ef3('0x2f')](_[_0x2ef3('0x38')](_0x78f8df['query'],_0x4a5e68[_0x2ef3('0x2f')]),_0x10adff);if(_0x78f8df['query'][_0x2ef3('0x39')]){_0x1fd95e[_0x2ef3('0x37')]=_[_0x2ef3('0x3a')](_0x1fd95e[_0x2ef3('0x37')],{'$or':_[_0x2ef3('0x28')](_0x10adff,function(_0x3ed9ad){if(_0x3ed9ad['type']!==_0x2ef3('0x3b')){var _0x159340={};_0x159340[_0x3ed9ad[_0x2ef3('0x3c')]]={'$like':'%'+_0x78f8df[_0x2ef3('0x2d')][_0x2ef3('0x39')]+'%'};return _0x159340;}})});}_0x1fd95e=_[_0x2ef3('0x3a')]({},_0x1fd95e,_0x78f8df[_0x2ef3('0x3d')]);var _0x4f7677={'where':_0x1fd95e[_0x2ef3('0x37')]};return db['ServicenowField'][_0x2ef3('0x1d')](_0x4f7677)[_0x2ef3('0x24')](function(_0x4b0452){_0x31fc58[_0x2ef3('0x1d')]=_0x4b0452;if(_0x78f8df['query'][_0x2ef3('0x3e')]){_0x1fd95e[_0x2ef3('0x3f')]=[{'all':!![]}];}return db['ServicenowField'][_0x2ef3('0x40')](_0x1fd95e);})['then'](function(_0x1f71e1){_0x31fc58[_0x2ef3('0x41')]=_0x1f71e1;return _0x31fc58;})[_0x2ef3('0x24')](respondWithFilteredResult(_0x354679,_0x1fd95e))[_0x2ef3('0x42')](handleError(_0x354679,null));};exports[_0x2ef3('0x43')]=function(_0x4b756c,_0x281da3){var _0x57fa9c={'raw':!![],'where':{'id':_0x4b756c['params']['id']}},_0x1040da={};_0x1040da[_0x2ef3('0x2c')]=_[_0x2ef3('0x2e')](db[_0x2ef3('0x29')][_0x2ef3('0x2a')]);_0x1040da[_0x2ef3('0x2d')]=_[_0x2ef3('0x2e')](_0x4b756c[_0x2ef3('0x2d')]);_0x1040da[_0x2ef3('0x2f')]=_[_0x2ef3('0x30')](_0x1040da['model'],_0x1040da[_0x2ef3('0x2d')]);_0x57fa9c[_0x2ef3('0x31')]=_[_0x2ef3('0x30')](_0x1040da[_0x2ef3('0x2c')],qs[_0x2ef3('0x32')](_0x4b756c['query'][_0x2ef3('0x32')]));_0x57fa9c[_0x2ef3('0x31')]=_0x57fa9c['attributes'][_0x2ef3('0x33')]?_0x57fa9c[_0x2ef3('0x31')]:_0x1040da[_0x2ef3('0x2c')];if(_0x4b756c[_0x2ef3('0x2d')][_0x2ef3('0x3e')]){_0x57fa9c['include']=[{'all':!![]}];}_0x57fa9c=_[_0x2ef3('0x3a')]({},_0x57fa9c,_0x4b756c['options']);return db[_0x2ef3('0x29')]['find'](_0x57fa9c)[_0x2ef3('0x24')](handleEntityNotFound(_0x281da3,null))[_0x2ef3('0x24')](respondWithResult(_0x281da3,null))[_0x2ef3('0x42')](handleError(_0x281da3,null));};exports[_0x2ef3('0x44')]=function(_0x2060ec,_0x3cb841){return db[_0x2ef3('0x29')]['create'](_0x2060ec[_0x2ef3('0x45')],{})[_0x2ef3('0x24')](respondWithResult(_0x3cb841,0xc9))[_0x2ef3('0x42')](handleError(_0x3cb841,null));};exports[_0x2ef3('0x23')]=function(_0x47a10c,_0x4ea035){if(_0x47a10c[_0x2ef3('0x45')]['id']){delete _0x47a10c['body']['id'];}return db[_0x2ef3('0x29')][_0x2ef3('0x46')]({'where':{'id':_0x47a10c[_0x2ef3('0x47')]['id']}})[_0x2ef3('0x24')](handleEntityNotFound(_0x4ea035,null))[_0x2ef3('0x24')](saveUpdates(_0x47a10c[_0x2ef3('0x45')],null))[_0x2ef3('0x24')](respondWithResult(_0x4ea035,null))[_0x2ef3('0x42')](handleError(_0x4ea035,null));};exports[_0x2ef3('0x48')]=function(_0x3dd9da,_0x57e43e){return db[_0x2ef3('0x29')][_0x2ef3('0x46')]({'where':{'id':_0x3dd9da[_0x2ef3('0x47')]['id']}})[_0x2ef3('0x24')](handleEntityNotFound(_0x57e43e,null))[_0x2ef3('0x24')](removeEntity(_0x57e43e,null))[_0x2ef3('0x42')](handleError(_0x57e43e,null));}; \ No newline at end of file +var _0xb7dd=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','ServicenowField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','catch','params','includeAll','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','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','../../mysqldb'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xb7dd,0x1d9));var _0xdb7d=function(_0x1e3fc4,_0x4cedcf){_0x1e3fc4=_0x1e3fc4-0x0;var _0x3159d6=_0xb7dd[_0x1e3fc4];return _0x3159d6;};'use strict';var emlformat=require(_0xdb7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb7d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb7d('0x2'));var moment=require(_0xdb7d('0x3'));var BPromise=require(_0xdb7d('0x4'));var Mustache=require('mustache');var util=require(_0xdb7d('0x5'));var path=require(_0xdb7d('0x6'));var sox=require(_0xdb7d('0x7'));var csv=require('to-csv');var ejs=require(_0xdb7d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb7d('0x9'));var squel=require(_0xdb7d('0xa'));var crypto=require(_0xdb7d('0xb'));var jsforce=require(_0xdb7d('0xc'));var deskjs=require(_0xdb7d('0xd'));var toCsv=require(_0xdb7d('0xe'));var querystring=require('querystring');var Papa=require(_0xdb7d('0xf'));var Redis=require(_0xdb7d('0x10'));var authService=require(_0xdb7d('0x11'));var qs=require(_0xdb7d('0x12'));var as=require(_0xdb7d('0x13'));var hardwareService=require(_0xdb7d('0x14'));var logger=require('../../config/logger')(_0xdb7d('0x15'));var utils=require(_0xdb7d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb7d('0x17'))['db'];function respondWithStatusCode(_0x189dc3,_0x4e4e22){_0x4e4e22=_0x4e4e22||0xcc;return function(_0x208a37){if(_0x208a37){return _0x189dc3[_0xdb7d('0x18')](_0x4e4e22);}return _0x189dc3[_0xdb7d('0x19')](_0x4e4e22)[_0xdb7d('0x1a')]();};}function respondWithResult(_0x112d65,_0xb2e47d){_0xb2e47d=_0xb2e47d||0xc8;return function(_0xb35a05){if(_0xb35a05){return _0x112d65[_0xdb7d('0x19')](_0xb2e47d)['json'](_0xb35a05);}};}function respondWithFilteredResult(_0x2d9c67,_0x1ecd01){return function(_0x169c39){if(_0x169c39){var _0xf17516=typeof _0x1ecd01[_0xdb7d('0x1b')]===_0xdb7d('0x1c')&&typeof _0x1ecd01[_0xdb7d('0x1d')]==='undefined';var _0x3e7169=_0x169c39[_0xdb7d('0x1e')];var _0x7f205f=_0xf17516?0x0:_0x1ecd01[_0xdb7d('0x1b')];var _0x29ade2=_0xf17516?_0x169c39[_0xdb7d('0x1e')]:_0x1ecd01['offset']+_0x1ecd01[_0xdb7d('0x1d')];var _0xa7c0aa;if(_0x29ade2>=_0x3e7169){_0x29ade2=_0x3e7169;_0xa7c0aa=0xc8;}else{_0xa7c0aa=0xce;}_0x2d9c67[_0xdb7d('0x19')](_0xa7c0aa);return _0x2d9c67['set'](_0xdb7d('0x1f'),_0x7f205f+'-'+_0x29ade2+'/'+_0x3e7169)[_0xdb7d('0x20')](_0x169c39);}return null;};}function patchUpdates(_0x423ea6){return function(_0x452796){try{jsonpatch['apply'](_0x452796,_0x423ea6,!![]);}catch(_0x23b796){return BPromise[_0xdb7d('0x21')](_0x23b796);}return _0x452796[_0xdb7d('0x22')]();};}function saveUpdates(_0x3dfcda,_0x208e2c){return function(_0x148d2c){if(_0x148d2c){return _0x148d2c[_0xdb7d('0x23')](_0x3dfcda)[_0xdb7d('0x24')](function(_0x22fe4c){return _0x22fe4c;});}return null;};}function removeEntity(_0x528806,_0x486717){return function(_0x14820d){if(_0x14820d){return _0x14820d[_0xdb7d('0x25')]()[_0xdb7d('0x24')](function(){_0x528806[_0xdb7d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3addb4,_0x556b04){return function(_0x3a984f){if(!_0x3a984f){_0x3addb4[_0xdb7d('0x18')](0x194);}return _0x3a984f;};}function handleError(_0x8ae4db,_0x470b7f){_0x470b7f=_0x470b7f||0x1f4;return function(_0x396d79){logger[_0xdb7d('0x26')](_0x396d79[_0xdb7d('0x27')]);if(_0x396d79[_0xdb7d('0x28')]){delete _0x396d79[_0xdb7d('0x28')];}_0x8ae4db[_0xdb7d('0x19')](_0x470b7f)['send'](_0x396d79);};}exports[_0xdb7d('0x29')]=function(_0x176cf0,_0x5cba6a){var _0xe17fe0={},_0x453300={},_0x4bf388={'count':0x0,'rows':[]};var _0x36f318=_[_0xdb7d('0x2a')](db[_0xdb7d('0x2b')]['rawAttributes'],function(_0x5966b9){return{'name':_0x5966b9[_0xdb7d('0x2c')],'type':_0x5966b9[_0xdb7d('0x2d')][_0xdb7d('0x2e')]};});_0x453300[_0xdb7d('0x2f')]=_[_0xdb7d('0x2a')](_0x36f318,_0xdb7d('0x28'));_0x453300[_0xdb7d('0x30')]=_[_0xdb7d('0x31')](_0x176cf0[_0xdb7d('0x30')]);_0x453300['filters']=_[_0xdb7d('0x32')](_0x453300['model'],_0x453300['query']);_0xe17fe0[_0xdb7d('0x33')]=_[_0xdb7d('0x32')](_0x453300[_0xdb7d('0x2f')],qs['fields'](_0x176cf0[_0xdb7d('0x30')][_0xdb7d('0x34')]));_0xe17fe0[_0xdb7d('0x33')]=_0xe17fe0[_0xdb7d('0x33')][_0xdb7d('0x35')]?_0xe17fe0['attributes']:_0x453300[_0xdb7d('0x2f')];if(!_0x176cf0[_0xdb7d('0x30')]['hasOwnProperty'](_0xdb7d('0x36'))){_0xe17fe0[_0xdb7d('0x1d')]=qs['limit'](_0x176cf0[_0xdb7d('0x30')]['limit']);_0xe17fe0['offset']=qs[_0xdb7d('0x1b')](_0x176cf0['query'][_0xdb7d('0x1b')]);}_0xe17fe0[_0xdb7d('0x37')]=qs['sort'](_0x176cf0['query'][_0xdb7d('0x38')]);_0xe17fe0[_0xdb7d('0x39')]=qs[_0xdb7d('0x3a')](_[_0xdb7d('0x3b')](_0x176cf0[_0xdb7d('0x30')],_0x453300[_0xdb7d('0x3a')]),_0x36f318);if(_0x176cf0[_0xdb7d('0x30')][_0xdb7d('0x3c')]){_0xe17fe0[_0xdb7d('0x39')]=_[_0xdb7d('0x3d')](_0xe17fe0[_0xdb7d('0x39')],{'$or':_['map'](_0x36f318,function(_0x4c7f87){if(_0x4c7f87[_0xdb7d('0x2d')]!=='VIRTUAL'){var _0x24a919={};_0x24a919[_0x4c7f87[_0xdb7d('0x28')]]={'$like':'%'+_0x176cf0[_0xdb7d('0x30')]['filter']+'%'};return _0x24a919;}})});}_0xe17fe0=_[_0xdb7d('0x3d')]({},_0xe17fe0,_0x176cf0[_0xdb7d('0x3e')]);var _0x4cfa92={'where':_0xe17fe0[_0xdb7d('0x39')]};return db[_0xdb7d('0x2b')][_0xdb7d('0x1e')](_0x4cfa92)[_0xdb7d('0x24')](function(_0x26f487){_0x4bf388[_0xdb7d('0x1e')]=_0x26f487;if(_0x176cf0[_0xdb7d('0x30')]['includeAll']){_0xe17fe0[_0xdb7d('0x3f')]=[{'all':!![]}];}return db[_0xdb7d('0x2b')][_0xdb7d('0x40')](_0xe17fe0);})[_0xdb7d('0x24')](function(_0x3bbef9){_0x4bf388['rows']=_0x3bbef9;return _0x4bf388;})[_0xdb7d('0x24')](respondWithFilteredResult(_0x5cba6a,_0xe17fe0))[_0xdb7d('0x41')](handleError(_0x5cba6a,null));};exports['show']=function(_0x81062,_0x1e764e){var _0x29140b={'raw':!![],'where':{'id':_0x81062[_0xdb7d('0x42')]['id']}},_0x56eab8={};_0x56eab8[_0xdb7d('0x2f')]=_[_0xdb7d('0x31')](db[_0xdb7d('0x2b')]['rawAttributes']);_0x56eab8[_0xdb7d('0x30')]=_[_0xdb7d('0x31')](_0x81062['query']);_0x56eab8[_0xdb7d('0x3a')]=_['intersection'](_0x56eab8[_0xdb7d('0x2f')],_0x56eab8[_0xdb7d('0x30')]);_0x29140b['attributes']=_[_0xdb7d('0x32')](_0x56eab8['model'],qs[_0xdb7d('0x34')](_0x81062[_0xdb7d('0x30')][_0xdb7d('0x34')]));_0x29140b['attributes']=_0x29140b[_0xdb7d('0x33')]['length']?_0x29140b[_0xdb7d('0x33')]:_0x56eab8[_0xdb7d('0x2f')];if(_0x81062[_0xdb7d('0x30')][_0xdb7d('0x43')]){_0x29140b[_0xdb7d('0x3f')]=[{'all':!![]}];}_0x29140b=_['merge']({},_0x29140b,_0x81062[_0xdb7d('0x3e')]);return db[_0xdb7d('0x2b')][_0xdb7d('0x44')](_0x29140b)['then'](handleEntityNotFound(_0x1e764e,null))['then'](respondWithResult(_0x1e764e,null))[_0xdb7d('0x41')](handleError(_0x1e764e,null));};exports[_0xdb7d('0x45')]=function(_0x3bd55d,_0x4459d2){return db['ServicenowField']['create'](_0x3bd55d[_0xdb7d('0x46')],{})[_0xdb7d('0x24')](respondWithResult(_0x4459d2,0xc9))[_0xdb7d('0x41')](handleError(_0x4459d2,null));};exports['update']=function(_0x5cd4ce,_0x3712e7){if(_0x5cd4ce[_0xdb7d('0x46')]['id']){delete _0x5cd4ce[_0xdb7d('0x46')]['id'];}return db[_0xdb7d('0x2b')][_0xdb7d('0x44')]({'where':{'id':_0x5cd4ce[_0xdb7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3712e7,null))[_0xdb7d('0x24')](saveUpdates(_0x5cd4ce[_0xdb7d('0x46')],null))[_0xdb7d('0x24')](respondWithResult(_0x3712e7,null))[_0xdb7d('0x41')](handleError(_0x3712e7,null));};exports[_0xdb7d('0x25')]=function(_0x192842,_0x2ee398){return db[_0xdb7d('0x2b')]['find']({'where':{'id':_0x192842[_0xdb7d('0x42')]['id']}})[_0xdb7d('0x24')](handleEntityNotFound(_0x2ee398,null))['then'](removeEntity(_0x2ee398,null))['catch'](handleError(_0x2ee398,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c710036..4aa0a3f 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 _0x0ddb=['servicenow_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','ServicenowField','int_servicenow_fields'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x0ddb,0x157));var _0xb0dd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ddb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb0dd('0x0'));var util=require('util');var logger=require(_0xb0dd('0x1'))(_0xb0dd('0x2'));var moment=require(_0xb0dd('0x3'));var BPromise=require(_0xb0dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0dd('0x5'));var rimraf=require(_0xb0dd('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x3f0ed9,_0x240dfe){return _0x3f0ed9['define'](_0xb0dd('0x7'),attributes,{'tableName':_0xb0dd('0x8'),'paranoid':![],'indexes':[{'name':_0xb0dd('0x9'),'fields':['idField',_0xb0dd('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3929=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','moment','bluebird'];(function(_0x550c57,_0x545d16){var _0x12a674=function(_0xb04668){while(--_0xb04668){_0x550c57['push'](_0x550c57['shift']());}};_0x12a674(++_0x545d16);}(_0x3929,0xdc));var _0x9392=function(_0x4ac716,_0x40243f){_0x4ac716=_0x4ac716-0x0;var _0x35f56b=_0x3929[_0x4ac716];return _0x35f56b;};'use strict';var _=require(_0x9392('0x0'));var util=require(_0x9392('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9392('0x2'));var BPromise=require(_0x9392('0x3'));var rp=require(_0x9392('0x4'));var fs=require('fs');var path=require(_0x9392('0x5'));var rimraf=require(_0x9392('0x6'));var config=require(_0x9392('0x7'));var attributes=require(_0x9392('0x8'));module[_0x9392('0x9')]=function(_0x575b1c,_0x336fc8){return _0x575b1c[_0x9392('0xa')](_0x9392('0xb'),attributes,{'tableName':_0x9392('0xc'),'paranoid':![],'indexes':[{'name':_0x9392('0xd'),'fields':[_0x9392('0xe'),_0x9392('0xf')],'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 5b151f9..096b4d5 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 _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x223ee1,_0xc6a65c){var _0x4592f5=function(_0x2ab6c4){while(--_0x2ab6c4){_0x223ee1['push'](_0x223ee1['shift']());}};_0x4592f5(++_0xc6a65c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3c6ad3,_0x4d32e1){_0x3c6ad3=_0x3c6ad3-0x0;var _0x2c58b9=_0x9bde[_0x3c6ad3];return _0x2c58b9;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x13c945,_0x1c7968){var _0x4aa8de=function(_0x53f3d0){while(--_0x53f3d0){_0x13c945['push'](_0x13c945['shift']());}};_0x4aa8de(++_0x1c7968);}(_0xb7e7,0x121));var _0x7b7e=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xb7e7[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 4195635..bab4c44 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(_0x353796,_0x43a157){var _0x26e824=function(_0x3e6fc3){while(--_0x3e6fc3){_0x353796['push'](_0x353796['shift']());}};_0x26e824(++_0x43a157);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x1ea2e9,_0x37d6dd){var _0x419aec=function(_0x1b3317){while(--_0x1b3317){_0x1ea2e9['push'](_0x1ea2e9['shift']());}};_0x419aec(++_0x37d6dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 4534f5a..2db1e73 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(_0x160117,_0xde063a){var _0x4d61ec=function(_0x1a8058){while(--_0x1a8058){_0x160117['push'](_0x160117['shift']());}};_0x4d61ec(++_0xde063a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x3ce0ba,_0x3d4af8){var _0x4c37ce=function(_0x562853){while(--_0x562853){_0x3ce0ba['push'](_0x3ce0ba['shift']());}};_0x4c37ce(++_0x3d4af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 176233c..81f2a23 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 _0x8a3d=['catch','show','params','rawAttributes','find','create','body','getConfigurations','SugarcrmConfiguration','order','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','assigned_user_id','description','date_start','duration_minutes','parent_name','direction','username','remoteUri','lastIndexOf','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','Invalid\x20Login','Password\x20Expired','POST','format','get_module_fields','stringify','Calls','values','module_fields','remove','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','error','name','send','index','map','SugarcrmAccount','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x43ec89,_0x29661f){var _0x138663=function(_0xb9950e){while(--_0xb9950e){_0x43ec89['push'](_0x43ec89['shift']());}};_0x138663(++_0x29661f);}(_0x8a3d,0xa7));var _0xd8a3=function(_0x3a047f,_0x38094d){_0x3a047f=_0x3a047f-0x0;var _0x541660=_0x8a3d[_0x3a047f];return _0x541660;};'use strict';var emlformat=require(_0xd8a3('0x0'));var rimraf=require(_0xd8a3('0x1'));var zipdir=require(_0xd8a3('0x2'));var jsonpatch=require(_0xd8a3('0x3'));var rp=require(_0xd8a3('0x4'));var moment=require(_0xd8a3('0x5'));var BPromise=require(_0xd8a3('0x6'));var Mustache=require('mustache');var util=require(_0xd8a3('0x7'));var path=require(_0xd8a3('0x8'));var sox=require(_0xd8a3('0x9'));var csv=require(_0xd8a3('0xa'));var ejs=require(_0xd8a3('0xb'));var fs=require('fs');var fs_extra=require(_0xd8a3('0xc'));var _=require(_0xd8a3('0xd'));var squel=require('squel');var crypto=require(_0xd8a3('0xe'));var jsforce=require(_0xd8a3('0xf'));var deskjs=require(_0xd8a3('0x10'));var toCsv=require(_0xd8a3('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8a3('0x11'));var authService=require(_0xd8a3('0x12'));var qs=require(_0xd8a3('0x13'));var as=require(_0xd8a3('0x14'));var hardwareService=require(_0xd8a3('0x15'));var logger=require(_0xd8a3('0x16'))(_0xd8a3('0x17'));var utils=require('../../config/utils');var config=require(_0xd8a3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x39124d,_0x19449e){_0x19449e=_0x19449e||0xcc;return function(_0x10904c){if(_0x10904c){return _0x39124d[_0xd8a3('0x19')](_0x19449e);}return _0x39124d[_0xd8a3('0x1a')](_0x19449e)[_0xd8a3('0x1b')]();};}function respondWithResult(_0x517612,_0x784edd){_0x784edd=_0x784edd||0xc8;return function(_0x253ff2){if(_0x253ff2){return _0x517612[_0xd8a3('0x1a')](_0x784edd)[_0xd8a3('0x1c')](_0x253ff2);}};}function respondWithFilteredResult(_0x344802,_0x5094cc){return function(_0x40af63){if(_0x40af63){var _0x2c195c=typeof _0x5094cc[_0xd8a3('0x1d')]===_0xd8a3('0x1e')&&typeof _0x5094cc[_0xd8a3('0x1f')]==='undefined';var _0x46c662=_0x40af63[_0xd8a3('0x20')];var _0x4cfcc5=_0x2c195c?0x0:_0x5094cc[_0xd8a3('0x1d')];var _0x4834eb=_0x2c195c?_0x40af63['count']:_0x5094cc[_0xd8a3('0x1d')]+_0x5094cc[_0xd8a3('0x1f')];var _0x377601;if(_0x4834eb>=_0x46c662){_0x4834eb=_0x46c662;_0x377601=0xc8;}else{_0x377601=0xce;}_0x344802[_0xd8a3('0x1a')](_0x377601);return _0x344802['set']('Content-Range',_0x4cfcc5+'-'+_0x4834eb+'/'+_0x46c662)[_0xd8a3('0x1c')](_0x40af63);}return null;};}function patchUpdates(_0x5d033f){return function(_0x4e143e){try{jsonpatch[_0xd8a3('0x21')](_0x4e143e,_0x5d033f,!![]);}catch(_0x36d976){return BPromise['reject'](_0x36d976);}return _0x4e143e['save']();};}function saveUpdates(_0x32dfb1,_0x4fbbee){return function(_0x8f0de4){if(_0x8f0de4){return _0x8f0de4[_0xd8a3('0x22')](_0x32dfb1)[_0xd8a3('0x23')](function(_0x185f9a){return _0x185f9a;});}return null;};}function removeEntity(_0x2fe586,_0x52f82b){return function(_0x9eee76){if(_0x9eee76){return _0x9eee76[_0xd8a3('0x24')]()[_0xd8a3('0x23')](function(){_0x2fe586['status'](0xcc)[_0xd8a3('0x1b')]();});}};}function handleEntityNotFound(_0x54890f,_0x5e2e73){return function(_0x4be3cd){if(!_0x4be3cd){_0x54890f['sendStatus'](0x194);}return _0x4be3cd;};}function handleError(_0x3d63d2,_0x3bf131){_0x3bf131=_0x3bf131||0x1f4;return function(_0x4f8421){logger[_0xd8a3('0x25')](_0x4f8421['stack']);if(_0x4f8421[_0xd8a3('0x26')]){delete _0x4f8421['name'];}_0x3d63d2[_0xd8a3('0x1a')](_0x3bf131)[_0xd8a3('0x27')](_0x4f8421);};}exports[_0xd8a3('0x28')]=function(_0x4c9779,_0x41aa32){var _0x55775e={},_0x3c8c9b={},_0x688635={'count':0x0,'rows':[]};var _0x46ec4a=_[_0xd8a3('0x29')](db[_0xd8a3('0x2a')]['rawAttributes'],function(_0x17e5fe){return{'name':_0x17e5fe[_0xd8a3('0x2b')],'type':_0x17e5fe['type'][_0xd8a3('0x2c')]};});_0x3c8c9b[_0xd8a3('0x2d')]=_[_0xd8a3('0x29')](_0x46ec4a,_0xd8a3('0x26'));_0x3c8c9b[_0xd8a3('0x2e')]=_[_0xd8a3('0x2f')](_0x4c9779['query']);_0x3c8c9b['filters']=_[_0xd8a3('0x30')](_0x3c8c9b[_0xd8a3('0x2d')],_0x3c8c9b['query']);_0x55775e[_0xd8a3('0x31')]=_[_0xd8a3('0x30')](_0x3c8c9b[_0xd8a3('0x2d')],qs[_0xd8a3('0x32')](_0x4c9779[_0xd8a3('0x2e')][_0xd8a3('0x32')]));_0x55775e[_0xd8a3('0x31')]=_0x55775e[_0xd8a3('0x31')][_0xd8a3('0x33')]?_0x55775e[_0xd8a3('0x31')]:_0x3c8c9b[_0xd8a3('0x2d')];if(!_0x4c9779['query'][_0xd8a3('0x34')]('nolimit')){_0x55775e['limit']=qs[_0xd8a3('0x1f')](_0x4c9779[_0xd8a3('0x2e')][_0xd8a3('0x1f')]);_0x55775e[_0xd8a3('0x1d')]=qs['offset'](_0x4c9779['query'][_0xd8a3('0x1d')]);}_0x55775e['order']=qs[_0xd8a3('0x35')](_0x4c9779[_0xd8a3('0x2e')][_0xd8a3('0x35')]);_0x55775e['where']=qs[_0xd8a3('0x36')](_['pick'](_0x4c9779[_0xd8a3('0x2e')],_0x3c8c9b[_0xd8a3('0x36')]),_0x46ec4a);if(_0x4c9779[_0xd8a3('0x2e')][_0xd8a3('0x37')]){_0x55775e[_0xd8a3('0x38')]=_[_0xd8a3('0x39')](_0x55775e[_0xd8a3('0x38')],{'$or':_['map'](_0x46ec4a,function(_0xb73895){if(_0xb73895[_0xd8a3('0x3a')]!==_0xd8a3('0x3b')){var _0x998f1c={};_0x998f1c[_0xb73895[_0xd8a3('0x26')]]={'$like':'%'+_0x4c9779[_0xd8a3('0x2e')]['filter']+'%'};return _0x998f1c;}})});}_0x55775e=_[_0xd8a3('0x39')]({},_0x55775e,_0x4c9779[_0xd8a3('0x3c')]);var _0x282648={'where':_0x55775e[_0xd8a3('0x38')]};return db['SugarcrmAccount'][_0xd8a3('0x20')](_0x282648)[_0xd8a3('0x23')](function(_0x389f0c){_0x688635[_0xd8a3('0x20')]=_0x389f0c;if(_0x4c9779['query'][_0xd8a3('0x3d')]){_0x55775e[_0xd8a3('0x3e')]=[{'all':!![]}];}return db[_0xd8a3('0x2a')]['findAll'](_0x55775e);})['then'](function(_0x11eb26){_0x688635['rows']=_0x11eb26;return _0x688635;})[_0xd8a3('0x23')](respondWithFilteredResult(_0x41aa32,_0x55775e))[_0xd8a3('0x3f')](handleError(_0x41aa32,null));};exports[_0xd8a3('0x40')]=function(_0x1a5230,_0x384dea){var _0x41db22={'raw':![],'where':{'id':_0x1a5230[_0xd8a3('0x41')]['id']}},_0x1e5110={};_0x1e5110[_0xd8a3('0x2d')]=_[_0xd8a3('0x2f')](db[_0xd8a3('0x2a')][_0xd8a3('0x42')]);_0x1e5110[_0xd8a3('0x2e')]=_['keys'](_0x1a5230['query']);_0x1e5110['filters']=_[_0xd8a3('0x30')](_0x1e5110[_0xd8a3('0x2d')],_0x1e5110[_0xd8a3('0x2e')]);_0x41db22[_0xd8a3('0x31')]=_[_0xd8a3('0x30')](_0x1e5110[_0xd8a3('0x2d')],qs[_0xd8a3('0x32')](_0x1a5230[_0xd8a3('0x2e')][_0xd8a3('0x32')]));_0x41db22['attributes']=_0x41db22[_0xd8a3('0x31')][_0xd8a3('0x33')]?_0x41db22[_0xd8a3('0x31')]:_0x1e5110['model'];if(_0x1a5230[_0xd8a3('0x2e')]['includeAll']){_0x41db22[_0xd8a3('0x3e')]=[{'all':!![]}];}_0x41db22=_[_0xd8a3('0x39')]({},_0x41db22,_0x1a5230[_0xd8a3('0x3c')]);return db['SugarcrmAccount'][_0xd8a3('0x43')](_0x41db22)[_0xd8a3('0x23')](handleEntityNotFound(_0x384dea,null))[_0xd8a3('0x23')](respondWithResult(_0x384dea,null))[_0xd8a3('0x3f')](handleError(_0x384dea,null));};exports[_0xd8a3('0x44')]=function(_0x4da99d,_0x282497){return db[_0xd8a3('0x2a')]['create'](_0x4da99d[_0xd8a3('0x45')],{})['then'](respondWithResult(_0x282497,0xc9))[_0xd8a3('0x3f')](handleError(_0x282497,null));};exports[_0xd8a3('0x22')]=function(_0x5d42e5,_0x3a84f5){if(_0x5d42e5[_0xd8a3('0x45')]['id']){delete _0x5d42e5[_0xd8a3('0x45')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x5d42e5[_0xd8a3('0x41')]['id']}})[_0xd8a3('0x23')](handleEntityNotFound(_0x3a84f5,null))['then'](saveUpdates(_0x5d42e5[_0xd8a3('0x45')],null))[_0xd8a3('0x23')](respondWithResult(_0x3a84f5,null))[_0xd8a3('0x3f')](handleError(_0x3a84f5,null));};exports['destroy']=function(_0xbe539f,_0x3f85f0){return db['SugarcrmAccount']['find']({'where':{'id':_0xbe539f['params']['id']}})[_0xd8a3('0x23')](handleEntityNotFound(_0x3f85f0,null))[_0xd8a3('0x23')](removeEntity(_0x3f85f0,null))[_0xd8a3('0x3f')](handleError(_0x3f85f0,null));};exports[_0xd8a3('0x46')]=function(_0x486cbc,_0xfc2e0c,_0x434d73){var _0x1697b3={};var _0x3a5c78={};var _0x229917;var _0x3223e5;return db[_0xd8a3('0x2a')]['findOne']({'where':{'id':_0x486cbc[_0xd8a3('0x41')]['id']}})[_0xd8a3('0x23')](handleEntityNotFound(_0xfc2e0c,null))[_0xd8a3('0x23')](function(_0x5e0f57){if(_0x5e0f57){_0x229917=_0x5e0f57;_0x3a5c78[_0xd8a3('0x2d')]=_[_0xd8a3('0x2f')](db[_0xd8a3('0x47')][_0xd8a3('0x42')]);_0x3a5c78[_0xd8a3('0x2e')]=_[_0xd8a3('0x2f')](_0x486cbc[_0xd8a3('0x2e')]);_0x3a5c78[_0xd8a3('0x36')]=_['intersection'](_0x3a5c78[_0xd8a3('0x2d')],_0x3a5c78[_0xd8a3('0x2e')]);_0x1697b3[_0xd8a3('0x31')]=_[_0xd8a3('0x30')](_0x3a5c78['model'],qs[_0xd8a3('0x32')](_0x486cbc[_0xd8a3('0x2e')][_0xd8a3('0x32')]));_0x1697b3['attributes']=_0x1697b3[_0xd8a3('0x31')][_0xd8a3('0x33')]?_0x1697b3[_0xd8a3('0x31')]:_0x3a5c78[_0xd8a3('0x2d')];_0x1697b3[_0xd8a3('0x48')]=qs[_0xd8a3('0x35')](_0x486cbc[_0xd8a3('0x2e')]['sort']);_0x1697b3[_0xd8a3('0x38')]=qs[_0xd8a3('0x36')](_[_0xd8a3('0x49')](_0x486cbc[_0xd8a3('0x2e')],_0x3a5c78[_0xd8a3('0x36')]));if(_0x486cbc[_0xd8a3('0x2e')][_0xd8a3('0x37')]){_0x1697b3[_0xd8a3('0x38')]=_[_0xd8a3('0x39')](_0x1697b3[_0xd8a3('0x38')],{'$or':_[_0xd8a3('0x29')](_0x1697b3['attributes'],function(_0x5649e4){var _0x2eb1d4={};_0x2eb1d4[_0x5649e4]={'$like':'%'+_0x486cbc[_0xd8a3('0x2e')][_0xd8a3('0x37')]+'%'};return _0x2eb1d4;})});}_0x1697b3=_[_0xd8a3('0x39')]({},_0x1697b3,_0x486cbc[_0xd8a3('0x3c')]);return _0x229917['getConfigurations'](_0x1697b3);}})['then'](function(_0x2e5022){if(_0x2e5022){_0x3223e5=_0x2e5022[_0xd8a3('0x33')];if(!_0x486cbc[_0xd8a3('0x2e')][_0xd8a3('0x34')](_0xd8a3('0x4a'))){_0x1697b3[_0xd8a3('0x1f')]=qs['limit'](_0x486cbc['query']['limit']);_0x1697b3[_0xd8a3('0x1d')]=qs['offset'](_0x486cbc['query'][_0xd8a3('0x1d')]);}return _0x229917[_0xd8a3('0x46')](_0x1697b3);}})[_0xd8a3('0x23')](function(_0xdfbf80){if(_0xdfbf80){return _0xdfbf80?{'count':_0x3223e5,'rows':_0xdfbf80}:null;}})[_0xd8a3('0x23')](respondWithResult(_0xfc2e0c,null))['catch'](handleError(_0xfc2e0c,null));};exports[_0xd8a3('0x4b')]=function(_0x9c38d8,_0x4f7227,_0x59410d){if(_0x9c38d8[_0xd8a3('0x45')]['id']){delete _0x9c38d8[_0xd8a3('0x45')]['id'];}return db[_0xd8a3('0x2a')]['findOne']({'where':{'id':_0x9c38d8['params']['id']}})[_0xd8a3('0x23')](handleEntityNotFound(_0x4f7227,null))[_0xd8a3('0x23')](function(_0x16c9e8){if(_0x16c9e8){_0x9c38d8['body'][_0xd8a3('0x4c')]=_0x16c9e8['id'];_0x9c38d8['body'][_0xd8a3('0x4d')]=integrations[_0xd8a3('0x4e')](_0x9c38d8[_0xd8a3('0x45')][_0xd8a3('0x4f')],_0x9c38d8[_0xd8a3('0x45')][_0xd8a3('0x3a')]);_0x9c38d8['body'][_0xd8a3('0x50')]=integrations[_0xd8a3('0x51')](_0x9c38d8[_0xd8a3('0x45')][_0xd8a3('0x4f')],_0x9c38d8['body']['type']);return db[_0xd8a3('0x47')][_0xd8a3('0x44')](_0x9c38d8['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xd8a3('0x4d')},{'model':db['SugarcrmField'],'as':_0xd8a3('0x50')}]});}return null;})[_0xd8a3('0x23')](respondWithResult(_0x4f7227,null))[_0xd8a3('0x3f')](handleError(_0x4f7227,null));};exports[_0xd8a3('0x52')]=function(_0x18dece,_0x268e6b,_0x320d74){var _0x3f1729='';var _0x5b389f=['id','name',_0xd8a3('0x53'),'created_by',_0xd8a3('0x54'),_0xd8a3('0x55'),'duration_hours',_0xd8a3('0x56'),'parent_id','parent_type',_0xd8a3('0x57'),_0xd8a3('0x58')];return db[_0xd8a3('0x2a')]['findOne']({'where':{'id':_0x18dece['params']['id']},'attributes':['id',_0xd8a3('0x59'),'password',_0xd8a3('0x5a')]})[_0xd8a3('0x23')](handleEntityNotFound(_0x268e6b,null))[_0xd8a3('0x23')](function(_0xd7f68a){if(_0xd7f68a){_0x3f1729=_0xd7f68a[_0xd8a3('0x5a')];var _0xdbf4d0=_0x3f1729['slice'](-0x1);if(_0xdbf4d0==='/'){_0x3f1729=_0x3f1729['substring'](0x0,_0x3f1729[_0xd8a3('0x5b')](_0xdbf4d0));}return rp({'method':'POST','uri':util['format'](_0xd8a3('0x5c'),_0x3f1729,_0xd8a3('0x5d')),'json':!![],'form':{'method':_0xd8a3('0x5e'),'input_type':_0xd8a3('0x5f'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0xd7f68a[_0xd8a3('0x59')],'password':_0xd7f68a[_0xd8a3('0x60')],'encryption':_0xd8a3('0x61')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xd8a3('0x23')](function(_0x3c365a){if(_0x3c365a&&_0x3c365a[_0xd8a3('0x26')]!==_0xd8a3('0x62')&&_0x3c365a[_0xd8a3('0x26')]!==_0xd8a3('0x63')){return rp({'method':_0xd8a3('0x64'),'uri':util[_0xd8a3('0x65')](_0xd8a3('0x5c'),_0x3f1729,_0xd8a3('0x5d')),'json':!![],'form':{'method':_0xd8a3('0x66'),'input_type':_0xd8a3('0x5f'),'response_type':_0xd8a3('0x5f'),'rest_data':JSON[_0xd8a3('0x67')]({'session':_0x3c365a['id'],'module_name':_0xd8a3('0x68')})}})[_0xd8a3('0x23')](function(_0x10e8a7){if(_0x10e8a7){var _0x46b4f4=_[_0xd8a3('0x69')](_0x10e8a7[_0xd8a3('0x6a')]);_[_0xd8a3('0x6b')](_0x46b4f4,function(_0x396ef7){return _0x5b389f[_0xd8a3('0x6c')](_0x396ef7[_0xd8a3('0x26')]);});return{'count':_0x46b4f4['length'],'rows':_[_0xd8a3('0x29')](_0x46b4f4,function(_0x876059){return{'id':_0x876059[_0xd8a3('0x26')],'name':_0x876059[_0xd8a3('0x6d')],'custom':_['endsWith'](_0x876059['name'],'_c')?!![]:![],'options':_0x876059['options']?_[_0xd8a3('0x29')](_[_0xd8a3('0x69')](_0x876059[_0xd8a3('0x3c')]),function(_0x16cb0e){return{'name':_0x16cb0e[_0xd8a3('0x6e')],'value':_0x16cb0e[_0xd8a3('0x26')]};}):[]};})};}})[_0xd8a3('0x23')](respondWithResult(_0x268e6b,null))[_0xd8a3('0x3f')](function(_0x15f6c0){var _0x48c0b4=_0x18dece['query']['test']?0x1f4:_0x15f6c0[_0xd8a3('0x6f')]||0x1f4;logger[_0xd8a3('0x25')](_0xd8a3('0x70'),_0xd8a3('0x52'),_0x48c0b4,JSON[_0xd8a3('0x67')](_0x15f6c0));delete _0x15f6c0[_0xd8a3('0x26')];if(_0x48c0b4===0x191){_0x48c0b4=0x190;}_0x268e6b[_0xd8a3('0x1a')](_0x48c0b4)[_0xd8a3('0x27')](_0x18dece[_0xd8a3('0x2e')][_0xd8a3('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x15f6c0['statusCode']}:_0x15f6c0);});}else{var _0x44fa52=0x1f4;_0x268e6b[_0xd8a3('0x1a')](_0x44fa52)[_0xd8a3('0x27')]({'message':_0xd8a3('0x72'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xc33a=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','SugarcrmAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','include','findAll','params','keys','includeAll','find','create','catch','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','stringify','values','module_fields','remove','includes','label','endsWith','value','test','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x38936d,_0x103706){var _0x15997a=function(_0x3e8f21){while(--_0x3e8f21){_0x38936d['push'](_0x38936d['shift']());}};_0x15997a(++_0x103706);}(_0xc33a,0xd5));var _0xac33=function(_0x4f4757,_0x44241a){_0x4f4757=_0x4f4757-0x0;var _0x549c37=_0xc33a[_0x4f4757];return _0x549c37;};'use strict';var emlformat=require(_0xac33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac33('0x1'));var jsonpatch=require(_0xac33('0x2'));var rp=require(_0xac33('0x3'));var moment=require(_0xac33('0x4'));var BPromise=require(_0xac33('0x5'));var Mustache=require(_0xac33('0x6'));var util=require(_0xac33('0x7'));var path=require('path');var sox=require(_0xac33('0x8'));var csv=require(_0xac33('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac33('0xa'));var _=require(_0xac33('0xb'));var squel=require(_0xac33('0xc'));var crypto=require(_0xac33('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xac33('0xe'));var toCsv=require(_0xac33('0x9'));var querystring=require(_0xac33('0xf'));var Papa=require('papaparse');var Redis=require(_0xac33('0x10'));var authService=require(_0xac33('0x11'));var qs=require(_0xac33('0x12'));var as=require(_0xac33('0x13'));var hardwareService=require(_0xac33('0x14'));var logger=require(_0xac33('0x15'))(_0xac33('0x16'));var utils=require(_0xac33('0x17'));var config=require(_0xac33('0x18'));var licenseUtil=require(_0xac33('0x19'));var db=require(_0xac33('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x553430,_0x116889){_0x116889=_0x116889||0xcc;return function(_0x538afa){if(_0x538afa){return _0x553430[_0xac33('0x1b')](_0x116889);}return _0x553430[_0xac33('0x1c')](_0x116889)['end']();};}function respondWithResult(_0x3bf6fd,_0xce5400){_0xce5400=_0xce5400||0xc8;return function(_0x34a393){if(_0x34a393){return _0x3bf6fd[_0xac33('0x1c')](_0xce5400)[_0xac33('0x1d')](_0x34a393);}};}function respondWithFilteredResult(_0x1aad0a,_0x4570ff){return function(_0x4d886a){if(_0x4d886a){var _0x17531d=typeof _0x4570ff[_0xac33('0x1e')]===_0xac33('0x1f')&&typeof _0x4570ff[_0xac33('0x20')]===_0xac33('0x1f');var _0x450522=_0x4d886a[_0xac33('0x21')];var _0x177633=_0x17531d?0x0:_0x4570ff[_0xac33('0x1e')];var _0x154da7=_0x17531d?_0x4d886a[_0xac33('0x21')]:_0x4570ff[_0xac33('0x1e')]+_0x4570ff[_0xac33('0x20')];var _0x5f1fa1;if(_0x154da7>=_0x450522){_0x154da7=_0x450522;_0x5f1fa1=0xc8;}else{_0x5f1fa1=0xce;}_0x1aad0a[_0xac33('0x1c')](_0x5f1fa1);return _0x1aad0a[_0xac33('0x22')](_0xac33('0x23'),_0x177633+'-'+_0x154da7+'/'+_0x450522)[_0xac33('0x1d')](_0x4d886a);}return null;};}function patchUpdates(_0x12afc8){return function(_0x5ab43a){try{jsonpatch[_0xac33('0x24')](_0x5ab43a,_0x12afc8,!![]);}catch(_0x4de7d2){return BPromise[_0xac33('0x25')](_0x4de7d2);}return _0x5ab43a[_0xac33('0x26')]();};}function saveUpdates(_0xcc7662,_0x5bfee6){return function(_0x53cfb6){if(_0x53cfb6){return _0x53cfb6[_0xac33('0x27')](_0xcc7662)[_0xac33('0x28')](function(_0x5e0fab){return _0x5e0fab;});}return null;};}function removeEntity(_0x3f3a74,_0xf4fdd8){return function(_0x4c7cde){if(_0x4c7cde){return _0x4c7cde['destroy']()[_0xac33('0x28')](function(){_0x3f3a74[_0xac33('0x1c')](0xcc)[_0xac33('0x29')]();});}};}function handleEntityNotFound(_0x34abd8,_0x1e96b9){return function(_0x2efac5){if(!_0x2efac5){_0x34abd8[_0xac33('0x1b')](0x194);}return _0x2efac5;};}function handleError(_0x1d7448,_0x5500ba){_0x5500ba=_0x5500ba||0x1f4;return function(_0x58a814){logger[_0xac33('0x2a')](_0x58a814[_0xac33('0x2b')]);if(_0x58a814['name']){delete _0x58a814[_0xac33('0x2c')];}_0x1d7448[_0xac33('0x1c')](_0x5500ba)['send'](_0x58a814);};}exports[_0xac33('0x2d')]=function(_0x3514f8,_0x4be3a8){var _0x5297c5={},_0x13ab21={},_0xd3a8b9={'count':0x0,'rows':[]};var _0x134c6a=_[_0xac33('0x2e')](db[_0xac33('0x2f')][_0xac33('0x30')],function(_0x570e08){return{'name':_0x570e08['fieldName'],'type':_0x570e08[_0xac33('0x31')][_0xac33('0x32')]};});_0x13ab21['model']=_[_0xac33('0x2e')](_0x134c6a,_0xac33('0x2c'));_0x13ab21['query']=_['keys'](_0x3514f8[_0xac33('0x33')]);_0x13ab21[_0xac33('0x34')]=_[_0xac33('0x35')](_0x13ab21[_0xac33('0x36')],_0x13ab21['query']);_0x5297c5[_0xac33('0x37')]=_[_0xac33('0x35')](_0x13ab21[_0xac33('0x36')],qs[_0xac33('0x38')](_0x3514f8['query'][_0xac33('0x38')]));_0x5297c5[_0xac33('0x37')]=_0x5297c5[_0xac33('0x37')][_0xac33('0x39')]?_0x5297c5[_0xac33('0x37')]:_0x13ab21[_0xac33('0x36')];if(!_0x3514f8[_0xac33('0x33')][_0xac33('0x3a')](_0xac33('0x3b'))){_0x5297c5[_0xac33('0x20')]=qs[_0xac33('0x20')](_0x3514f8[_0xac33('0x33')][_0xac33('0x20')]);_0x5297c5['offset']=qs[_0xac33('0x1e')](_0x3514f8[_0xac33('0x33')][_0xac33('0x1e')]);}_0x5297c5['order']=qs[_0xac33('0x3c')](_0x3514f8[_0xac33('0x33')][_0xac33('0x3c')]);_0x5297c5['where']=qs[_0xac33('0x34')](_['pick'](_0x3514f8[_0xac33('0x33')],_0x13ab21[_0xac33('0x34')]),_0x134c6a);if(_0x3514f8[_0xac33('0x33')][_0xac33('0x3d')]){_0x5297c5[_0xac33('0x3e')]=_[_0xac33('0x3f')](_0x5297c5[_0xac33('0x3e')],{'$or':_[_0xac33('0x2e')](_0x134c6a,function(_0x1edcd5){if(_0x1edcd5[_0xac33('0x31')]!=='VIRTUAL'){var _0x5c651c={};_0x5c651c[_0x1edcd5[_0xac33('0x2c')]]={'$like':'%'+_0x3514f8['query'][_0xac33('0x3d')]+'%'};return _0x5c651c;}})});}_0x5297c5=_[_0xac33('0x3f')]({},_0x5297c5,_0x3514f8[_0xac33('0x40')]);var _0x361e33={'where':_0x5297c5['where']};return db[_0xac33('0x2f')][_0xac33('0x21')](_0x361e33)[_0xac33('0x28')](function(_0x524e0b){_0xd3a8b9[_0xac33('0x21')]=_0x524e0b;if(_0x3514f8[_0xac33('0x33')]['includeAll']){_0x5297c5[_0xac33('0x41')]=[{'all':!![]}];}return db[_0xac33('0x2f')][_0xac33('0x42')](_0x5297c5);})['then'](function(_0x13c0cd){_0xd3a8b9['rows']=_0x13c0cd;return _0xd3a8b9;})[_0xac33('0x28')](respondWithFilteredResult(_0x4be3a8,_0x5297c5))['catch'](handleError(_0x4be3a8,null));};exports['show']=function(_0x1b5d9a,_0x5e8382){var _0x21de4e={'raw':![],'where':{'id':_0x1b5d9a[_0xac33('0x43')]['id']}},_0x36bd6b={};_0x36bd6b[_0xac33('0x36')]=_[_0xac33('0x44')](db[_0xac33('0x2f')][_0xac33('0x30')]);_0x36bd6b[_0xac33('0x33')]=_[_0xac33('0x44')](_0x1b5d9a[_0xac33('0x33')]);_0x36bd6b[_0xac33('0x34')]=_[_0xac33('0x35')](_0x36bd6b[_0xac33('0x36')],_0x36bd6b[_0xac33('0x33')]);_0x21de4e[_0xac33('0x37')]=_[_0xac33('0x35')](_0x36bd6b[_0xac33('0x36')],qs['fields'](_0x1b5d9a[_0xac33('0x33')][_0xac33('0x38')]));_0x21de4e[_0xac33('0x37')]=_0x21de4e['attributes'][_0xac33('0x39')]?_0x21de4e[_0xac33('0x37')]:_0x36bd6b[_0xac33('0x36')];if(_0x1b5d9a[_0xac33('0x33')][_0xac33('0x45')]){_0x21de4e[_0xac33('0x41')]=[{'all':!![]}];}_0x21de4e=_['merge']({},_0x21de4e,_0x1b5d9a[_0xac33('0x40')]);return db['SugarcrmAccount'][_0xac33('0x46')](_0x21de4e)[_0xac33('0x28')](handleEntityNotFound(_0x5e8382,null))[_0xac33('0x28')](respondWithResult(_0x5e8382,null))['catch'](handleError(_0x5e8382,null));};exports[_0xac33('0x47')]=function(_0x1d827a,_0x5a49a4){return db['SugarcrmAccount'][_0xac33('0x47')](_0x1d827a['body'],{})[_0xac33('0x28')](respondWithResult(_0x5a49a4,0xc9))[_0xac33('0x48')](handleError(_0x5a49a4,null));};exports[_0xac33('0x27')]=function(_0x4da812,_0x2dfcfc){if(_0x4da812[_0xac33('0x49')]['id']){delete _0x4da812[_0xac33('0x49')]['id'];}return db[_0xac33('0x2f')][_0xac33('0x46')]({'where':{'id':_0x4da812['params']['id']}})['then'](handleEntityNotFound(_0x2dfcfc,null))[_0xac33('0x28')](saveUpdates(_0x4da812[_0xac33('0x49')],null))[_0xac33('0x28')](respondWithResult(_0x2dfcfc,null))[_0xac33('0x48')](handleError(_0x2dfcfc,null));};exports[_0xac33('0x4a')]=function(_0x3d640b,_0x162754){return db['SugarcrmAccount']['find']({'where':{'id':_0x3d640b[_0xac33('0x43')]['id']}})[_0xac33('0x28')](handleEntityNotFound(_0x162754,null))[_0xac33('0x28')](removeEntity(_0x162754,null))[_0xac33('0x48')](handleError(_0x162754,null));};exports[_0xac33('0x4b')]=function(_0x5ce1d5,_0x4643ca,_0x542429){var _0xabe7a6={};var _0x529da6={};var _0x1164f6;var _0x32ab47;return db[_0xac33('0x2f')][_0xac33('0x4c')]({'where':{'id':_0x5ce1d5[_0xac33('0x43')]['id']}})[_0xac33('0x28')](handleEntityNotFound(_0x4643ca,null))[_0xac33('0x28')](function(_0x137fd2){if(_0x137fd2){_0x1164f6=_0x137fd2;_0x529da6[_0xac33('0x36')]=_['keys'](db[_0xac33('0x4d')]['rawAttributes']);_0x529da6[_0xac33('0x33')]=_[_0xac33('0x44')](_0x5ce1d5[_0xac33('0x33')]);_0x529da6[_0xac33('0x34')]=_['intersection'](_0x529da6[_0xac33('0x36')],_0x529da6[_0xac33('0x33')]);_0xabe7a6[_0xac33('0x37')]=_[_0xac33('0x35')](_0x529da6[_0xac33('0x36')],qs[_0xac33('0x38')](_0x5ce1d5['query']['fields']));_0xabe7a6[_0xac33('0x37')]=_0xabe7a6[_0xac33('0x37')][_0xac33('0x39')]?_0xabe7a6[_0xac33('0x37')]:_0x529da6[_0xac33('0x36')];_0xabe7a6['order']=qs['sort'](_0x5ce1d5['query'][_0xac33('0x3c')]);_0xabe7a6['where']=qs[_0xac33('0x34')](_[_0xac33('0x4e')](_0x5ce1d5['query'],_0x529da6[_0xac33('0x34')]));if(_0x5ce1d5[_0xac33('0x33')][_0xac33('0x3d')]){_0xabe7a6[_0xac33('0x3e')]=_[_0xac33('0x3f')](_0xabe7a6[_0xac33('0x3e')],{'$or':_[_0xac33('0x2e')](_0xabe7a6[_0xac33('0x37')],function(_0x5c0d6a){var _0xf367cc={};_0xf367cc[_0x5c0d6a]={'$like':'%'+_0x5ce1d5['query'][_0xac33('0x3d')]+'%'};return _0xf367cc;})});}_0xabe7a6=_[_0xac33('0x3f')]({},_0xabe7a6,_0x5ce1d5[_0xac33('0x40')]);return _0x1164f6[_0xac33('0x4b')](_0xabe7a6);}})[_0xac33('0x28')](function(_0x6ae2e6){if(_0x6ae2e6){_0x32ab47=_0x6ae2e6[_0xac33('0x39')];if(!_0x5ce1d5['query']['hasOwnProperty'](_0xac33('0x3b'))){_0xabe7a6[_0xac33('0x20')]=qs[_0xac33('0x20')](_0x5ce1d5[_0xac33('0x33')]['limit']);_0xabe7a6['offset']=qs['offset'](_0x5ce1d5[_0xac33('0x33')][_0xac33('0x1e')]);}return _0x1164f6[_0xac33('0x4b')](_0xabe7a6);}})[_0xac33('0x28')](function(_0x168c4d){if(_0x168c4d){return _0x168c4d?{'count':_0x32ab47,'rows':_0x168c4d}:null;}})[_0xac33('0x28')](respondWithResult(_0x4643ca,null))['catch'](handleError(_0x4643ca,null));};exports[_0xac33('0x4f')]=function(_0x2e8c82,_0x1905b8,_0x3def47){if(_0x2e8c82[_0xac33('0x49')]['id']){delete _0x2e8c82[_0xac33('0x49')]['id'];}return db[_0xac33('0x2f')][_0xac33('0x4c')]({'where':{'id':_0x2e8c82[_0xac33('0x43')]['id']}})[_0xac33('0x28')](handleEntityNotFound(_0x1905b8,null))[_0xac33('0x28')](function(_0x30a535){if(_0x30a535){_0x2e8c82[_0xac33('0x49')][_0xac33('0x50')]=_0x30a535['id'];_0x2e8c82[_0xac33('0x49')][_0xac33('0x51')]=integrations[_0xac33('0x52')](_0x2e8c82[_0xac33('0x49')][_0xac33('0x53')],_0x2e8c82['body'][_0xac33('0x31')]);_0x2e8c82['body'][_0xac33('0x54')]=integrations['getDescriptions'](_0x2e8c82['body'][_0xac33('0x53')],_0x2e8c82['body'][_0xac33('0x31')]);return db[_0xac33('0x4d')]['create'](_0x2e8c82[_0xac33('0x49')],{'include':[{'model':db[_0xac33('0x55')],'as':_0xac33('0x51')},{'model':db[_0xac33('0x55')],'as':'Descriptions'}]});}return null;})[_0xac33('0x28')](respondWithResult(_0x1905b8,null))['catch'](handleError(_0x1905b8,null));};exports[_0xac33('0x56')]=function(_0x14d306,_0x29bb74,_0x60dd0e){var _0x3c9eff='';var _0x514cd0=['id','name',_0xac33('0x57'),_0xac33('0x58'),_0xac33('0x59'),'date_start',_0xac33('0x5a'),'duration_minutes','parent_id',_0xac33('0x5b'),_0xac33('0x5c'),_0xac33('0x5d')];return db[_0xac33('0x2f')][_0xac33('0x4c')]({'where':{'id':_0x14d306['params']['id']},'attributes':['id',_0xac33('0x5e'),'password','remoteUri']})[_0xac33('0x28')](handleEntityNotFound(_0x29bb74,null))[_0xac33('0x28')](function(_0x5c28c0){if(_0x5c28c0){_0x3c9eff=_0x5c28c0[_0xac33('0x5f')];var _0x523022=_0x3c9eff[_0xac33('0x60')](-0x1);if(_0x523022==='/'){_0x3c9eff=_0x3c9eff[_0xac33('0x61')](0x0,_0x3c9eff[_0xac33('0x62')](_0x523022));}return rp({'method':_0xac33('0x63'),'uri':util['format'](_0xac33('0x64'),_0x3c9eff,_0xac33('0x65')),'json':!![],'form':{'method':_0xac33('0x66'),'input_type':_0xac33('0x67'),'response_type':_0xac33('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5c28c0[_0xac33('0x5e')],'password':_0x5c28c0['password'],'encryption':_0xac33('0x68')},'application':_0xac33('0x69')})}});}})[_0xac33('0x28')](function(_0x330673){if(_0x330673&&_0x330673[_0xac33('0x2c')]!==_0xac33('0x6a')&&_0x330673[_0xac33('0x2c')]!==_0xac33('0x6b')){return rp({'method':_0xac33('0x63'),'uri':util[_0xac33('0x6c')](_0xac33('0x64'),_0x3c9eff,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xac33('0x67'),'rest_data':JSON[_0xac33('0x6d')]({'session':_0x330673['id'],'module_name':'Calls'})}})[_0xac33('0x28')](function(_0x4f7cb4){if(_0x4f7cb4){var _0x234dff=_[_0xac33('0x6e')](_0x4f7cb4[_0xac33('0x6f')]);_[_0xac33('0x70')](_0x234dff,function(_0x4ae62f){return _0x514cd0[_0xac33('0x71')](_0x4ae62f[_0xac33('0x2c')]);});return{'count':_0x234dff[_0xac33('0x39')],'rows':_[_0xac33('0x2e')](_0x234dff,function(_0x5342c0){return{'id':_0x5342c0[_0xac33('0x2c')],'name':_0x5342c0[_0xac33('0x72')],'custom':_[_0xac33('0x73')](_0x5342c0[_0xac33('0x2c')],'_c')?!![]:![],'options':_0x5342c0[_0xac33('0x40')]?_[_0xac33('0x2e')](_[_0xac33('0x6e')](_0x5342c0['options']),function(_0x273721){return{'name':_0x273721[_0xac33('0x74')],'value':_0x273721[_0xac33('0x2c')]};}):[]};})};}})['then'](respondWithResult(_0x29bb74,null))[_0xac33('0x48')](function(_0x14fa47){var _0x3943bb=_0x14d306['query'][_0xac33('0x75')]?0x1f4:_0x14fa47['statusCode']||0x1f4;logger[_0xac33('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0xac33('0x56'),_0x3943bb,JSON[_0xac33('0x6d')](_0x14fa47));delete _0x14fa47['name'];if(_0x3943bb===0x191){_0x3943bb=0x190;}_0x29bb74[_0xac33('0x1c')](_0x3943bb)[_0xac33('0x76')](_0x14d306[_0xac33('0x33')]['test']?{'message':_0xac33('0x77'),'statusCode':_0x14fa47[_0xac33('0x78')]}:_0x14fa47);});}else{var _0x1b3aa5=0x1f4;_0x29bb74[_0xac33('0x1c')](_0x1b3aa5)['send']({'message':_0xac33('0x77'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index e9541ea..32aaa7b 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 _0xde80=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x5dd841,_0x140973){var _0x4f3de4=function(_0x302ab0){while(--_0x302ab0){_0x5dd841['push'](_0x5dd841['shift']());}};_0x4f3de4(++_0x140973);}(_0xde80,0x1d1));var _0x0de8=function(_0x781a5e,_0x17273c){_0x781a5e=_0x781a5e-0x0;var _0x6896f2=_0xde80[_0x781a5e];return _0x6896f2;};'use strict';var _=require(_0x0de8('0x0'));var util=require(_0x0de8('0x1'));var logger=require(_0x0de8('0x2'))(_0x0de8('0x3'));var moment=require(_0x0de8('0x4'));var BPromise=require(_0x0de8('0x5'));var rp=require(_0x0de8('0x6'));var fs=require('fs');var path=require(_0x0de8('0x7'));var rimraf=require(_0x0de8('0x8'));var config=require(_0x0de8('0x9'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x0de8('0xa'));module[_0x0de8('0xb')]=function(_0x2ad29b,_0x4d8be0){return _0x2ad29b[_0x0de8('0xc')](_0x0de8('0xd'),attributes,{'tableName':_0x0de8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1a6=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb1a6,0x143));var _0x6b1a=function(_0xb9ce54,_0x4a6f6c){_0xb9ce54=_0xb9ce54-0x0;var _0x57eb3b=_0xb1a6[_0xb9ce54];return _0x57eb3b;};'use strict';var _=require(_0x6b1a('0x0'));var util=require(_0x6b1a('0x1'));var logger=require(_0x6b1a('0x2'))('api');var moment=require(_0x6b1a('0x3'));var BPromise=require(_0x6b1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b1a('0x5'));var rimraf=require(_0x6b1a('0x6'));var config=require(_0x6b1a('0x7'));var attributes=require(_0x6b1a('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x6b1a('0x9')]=function(_0x8b9422,_0x2a7d43){return _0x8b9422['define'](_0x6b1a('0xa'),attributes,{'tableName':_0x6b1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 900ffa5..8378565 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 _0x888f=['stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','SugarcrmAccount','findAll','options','limit','include','map','model','attributes','GetSugarcrmAccount','ShowSugarcrmAccount','find','raw','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug'];(function(_0x162d2a,_0x5661bc){var _0x3a6fb3=function(_0x4cbf91){while(--_0x4cbf91){_0x162d2a['push'](_0x162d2a['shift']());}};_0x3a6fb3(++_0x5661bc);}(_0x888f,0x1b8));var _0xf888=function(_0x1baedf,_0x22eacf){_0x1baedf=_0x1baedf-0x0;var _0x4e6817=_0x888f[_0x1baedf];return _0x4e6817;};'use strict';var _=require(_0xf888('0x0'));var util=require(_0xf888('0x1'));var moment=require(_0xf888('0x2'));var BPromise=require(_0xf888('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf888('0x4'));var db=require(_0xf888('0x5'))['db'];var utils=require(_0xf888('0x6'));var logger=require(_0xf888('0x7'))(_0xf888('0x8'));var config=require('../../config/environment');var jayson=require(_0xf888('0x9'));var client=jayson[_0xf888('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x293526,_0x504c03,_0x12b951){return new BPromise(function(_0x170076,_0x5068ed){return client['request'](_0x293526,_0x12b951)[_0xf888('0xb')](function(_0x47be85){logger[_0xf888('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x504c03,_0xf888('0xd'));logger[_0xf888('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x504c03,'request\x20sent',JSON[_0xf888('0xf')](_0x47be85));if(_0x47be85[_0xf888('0x10')]){if(_0x47be85[_0xf888('0x10')][_0xf888('0x11')]===0x1f4){logger[_0xf888('0x10')](_0xf888('0x12'),_0x504c03,_0x47be85[_0xf888('0x10')][_0xf888('0x13')]);return _0x5068ed(_0x47be85[_0xf888('0x10')]['message']);}logger[_0xf888('0x10')](_0xf888('0x12'),_0x504c03,_0x47be85[_0xf888('0x10')][_0xf888('0x13')]);return _0x170076(_0x47be85[_0xf888('0x10')][_0xf888('0x13')]);}else{logger[_0xf888('0xc')](_0xf888('0x12'),_0x504c03,_0xf888('0xd'));_0x170076(_0x47be85[_0xf888('0x14')][_0xf888('0x13')]);}})[_0xf888('0x15')](function(_0x5b1f16){logger[_0xf888('0x10')](_0xf888('0x12'),_0x504c03,_0x5b1f16);_0x5068ed(_0x5b1f16);});});}exports['GetSugarcrmAccount']=function(_0x37c88b){var _0x2b4930=this;return new Promise(function(_0xd42bd8,_0x46190d){return db[_0xf888('0x16')][_0xf888('0x17')]({'raw':_0x37c88b[_0xf888('0x18')]?_0x37c88b['options']['raw']===undefined?!![]:![]:!![],'where':_0x37c88b[_0xf888('0x18')]?_0x37c88b[_0xf888('0x18')]['where']||null:null,'attributes':_0x37c88b[_0xf888('0x18')]?_0x37c88b[_0xf888('0x18')]['attributes']||null:null,'limit':_0x37c88b[_0xf888('0x18')]?_0x37c88b[_0xf888('0x18')][_0xf888('0x19')]||null:null,'include':_0x37c88b['options']?_0x37c88b[_0xf888('0x18')][_0xf888('0x1a')]?_[_0xf888('0x1b')](_0x37c88b[_0xf888('0x18')][_0xf888('0x1a')],function(_0x3515ab){return{'model':db[_0x3515ab[_0xf888('0x1c')]],'as':_0x3515ab['as'],'attributes':_0x3515ab[_0xf888('0x1d')],'include':_0x3515ab[_0xf888('0x1a')]?_['map'](_0x3515ab[_0xf888('0x1a')],function(_0x5b3e8f){return{'model':db[_0x5b3e8f[_0xf888('0x1c')]],'as':_0x5b3e8f['as'],'attributes':_0x5b3e8f[_0xf888('0x1d')],'include':_0x5b3e8f[_0xf888('0x1a')]?_[_0xf888('0x1b')](_0x5b3e8f[_0xf888('0x1a')],function(_0x198f0a){return{'model':db[_0x198f0a['model']],'as':_0x198f0a['as'],'attributes':_0x198f0a[_0xf888('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf888('0xb')](function(_0x2f5deb){logger[_0xf888('0xc')](_0xf888('0x1e'),_0x37c88b);logger[_0xf888('0xe')](_0xf888('0x1e'),_0x37c88b,JSON['stringify'](_0x2f5deb));_0xd42bd8(_0x2f5deb);})['catch'](function(_0x275add){logger[_0xf888('0x10')](_0xf888('0x1e'),_0x275add['message'],_0x37c88b);_0x46190d(_0x2b4930[_0xf888('0x10')](0x1f4,_0x275add[_0xf888('0x13')]));});});};exports[_0xf888('0x1f')]=function(_0x4bf296){var _0x5557dd=this;return new Promise(function(_0x1a60b9,_0x43fd9f){return db[_0xf888('0x16')][_0xf888('0x20')]({'raw':_0x4bf296['options']?_0x4bf296[_0xf888('0x18')][_0xf888('0x21')]===undefined?!![]:![]:!![],'where':_0x4bf296[_0xf888('0x18')]?_0x4bf296[_0xf888('0x18')][_0xf888('0x22')]||null:null,'attributes':_0x4bf296[_0xf888('0x18')]?_0x4bf296['options']['attributes']||null:null,'include':_0x4bf296[_0xf888('0x18')]?_0x4bf296[_0xf888('0x18')][_0xf888('0x1a')]?_[_0xf888('0x1b')](_0x4bf296[_0xf888('0x18')][_0xf888('0x1a')],function(_0x4b9103){return{'model':db[_0x4b9103[_0xf888('0x1c')]],'as':_0x4b9103['as'],'attributes':_0x4b9103['attributes'],'include':_0x4b9103[_0xf888('0x1a')]?_[_0xf888('0x1b')](_0x4b9103[_0xf888('0x1a')],function(_0x193e46){return{'model':db[_0x193e46[_0xf888('0x1c')]],'as':_0x193e46['as'],'attributes':_0x193e46['attributes'],'include':_0x193e46['include']?_['map'](_0x193e46['include'],function(_0xe138e1){return{'model':db[_0xe138e1[_0xf888('0x1c')]],'as':_0xe138e1['as'],'attributes':_0xe138e1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd84fe2){logger[_0xf888('0xc')]('ShowSugarcrmAccount',_0x4bf296);logger[_0xf888('0xe')](_0xf888('0x1f'),_0x4bf296,JSON[_0xf888('0xf')](_0xd84fe2));_0x1a60b9(_0xd84fe2);})[_0xf888('0x15')](function(_0xe3988){logger['error'](_0xf888('0x1f'),_0xe3988[_0xf888('0x13')],_0x4bf296);_0x43fd9f(_0x5557dd[_0xf888('0x10')](0x1f4,_0xe3988['message']));});});}; \ No newline at end of file +var _0x50f8=['findAll','options','raw','where','limit','include','model','attributes','catch','find','map','ShowSugarcrmAccount','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSugarcrmAccount'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x50f8,0x13e));var _0x850f=function(_0x544550,_0x2fcf12){_0x544550=_0x544550-0x0;var _0x534ab4=_0x50f8[_0x544550];return _0x534ab4;};'use strict';var _=require(_0x850f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x850f('0x1'));var rs=require(_0x850f('0x2'));var fs=require('fs');var Redis=require(_0x850f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x850f('0x4'));var logger=require(_0x850f('0x5'))(_0x850f('0x6'));var config=require('../../config/environment');var jayson=require(_0x850f('0x7'));var client=jayson[_0x850f('0x8')][_0x850f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35f152,_0x3954ac,_0x43afe7){return new BPromise(function(_0xd7137a,_0x119707){return client[_0x850f('0xa')](_0x35f152,_0x43afe7)[_0x850f('0xb')](function(_0x58cc6c){logger[_0x850f('0xc')](_0x850f('0xd'),_0x3954ac,_0x850f('0xe'));logger[_0x850f('0xf')](_0x850f('0x10'),_0x3954ac,_0x850f('0xe'),JSON[_0x850f('0x11')](_0x58cc6c));if(_0x58cc6c[_0x850f('0x12')]){if(_0x58cc6c[_0x850f('0x12')][_0x850f('0x13')]===0x1f4){logger[_0x850f('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x3954ac,_0x58cc6c[_0x850f('0x12')][_0x850f('0x14')]);return _0x119707(_0x58cc6c['error'][_0x850f('0x14')]);}logger[_0x850f('0x12')](_0x850f('0xd'),_0x3954ac,_0x58cc6c[_0x850f('0x12')][_0x850f('0x14')]);return _0xd7137a(_0x58cc6c[_0x850f('0x12')][_0x850f('0x14')]);}else{logger[_0x850f('0xc')](_0x850f('0xd'),_0x3954ac,_0x850f('0xe'));_0xd7137a(_0x58cc6c['result'][_0x850f('0x14')]);}})['catch'](function(_0x4e3077){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x3954ac,_0x4e3077);_0x119707(_0x4e3077);});});}exports[_0x850f('0x15')]=function(_0x54bb91){var _0x757e6e=this;return new Promise(function(_0x1e78b0,_0x2eaeb6){return db['SugarcrmAccount'][_0x850f('0x16')]({'raw':_0x54bb91[_0x850f('0x17')]?_0x54bb91['options'][_0x850f('0x18')]===undefined?!![]:![]:!![],'where':_0x54bb91[_0x850f('0x17')]?_0x54bb91[_0x850f('0x17')][_0x850f('0x19')]||null:null,'attributes':_0x54bb91[_0x850f('0x17')]?_0x54bb91[_0x850f('0x17')]['attributes']||null:null,'limit':_0x54bb91['options']?_0x54bb91['options'][_0x850f('0x1a')]||null:null,'include':_0x54bb91[_0x850f('0x17')]?_0x54bb91[_0x850f('0x17')]['include']?_['map'](_0x54bb91[_0x850f('0x17')][_0x850f('0x1b')],function(_0x5a865b){return{'model':db[_0x5a865b[_0x850f('0x1c')]],'as':_0x5a865b['as'],'attributes':_0x5a865b['attributes'],'include':_0x5a865b[_0x850f('0x1b')]?_['map'](_0x5a865b['include'],function(_0x304c45){return{'model':db[_0x304c45[_0x850f('0x1c')]],'as':_0x304c45['as'],'attributes':_0x304c45[_0x850f('0x1d')],'include':_0x304c45[_0x850f('0x1b')]?_['map'](_0x304c45[_0x850f('0x1b')],function(_0x2067d4){return{'model':db[_0x2067d4[_0x850f('0x1c')]],'as':_0x2067d4['as'],'attributes':_0x2067d4[_0x850f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x850f('0xb')](function(_0x1ec58c){logger['info'](_0x850f('0x15'),_0x54bb91);logger[_0x850f('0xf')](_0x850f('0x15'),_0x54bb91,JSON[_0x850f('0x11')](_0x1ec58c));_0x1e78b0(_0x1ec58c);})[_0x850f('0x1e')](function(_0xb36645){logger[_0x850f('0x12')](_0x850f('0x15'),_0xb36645[_0x850f('0x14')],_0x54bb91);_0x2eaeb6(_0x757e6e['error'](0x1f4,_0xb36645[_0x850f('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x360207){var _0x419e02=this;return new Promise(function(_0xf6d7fe,_0x564ea8){return db['SugarcrmAccount'][_0x850f('0x1f')]({'raw':_0x360207[_0x850f('0x17')]?_0x360207[_0x850f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x360207[_0x850f('0x17')]?_0x360207[_0x850f('0x17')][_0x850f('0x19')]||null:null,'attributes':_0x360207['options']?_0x360207['options'][_0x850f('0x1d')]||null:null,'include':_0x360207[_0x850f('0x17')]?_0x360207[_0x850f('0x17')]['include']?_[_0x850f('0x20')](_0x360207[_0x850f('0x17')][_0x850f('0x1b')],function(_0x43f9f0){return{'model':db[_0x43f9f0['model']],'as':_0x43f9f0['as'],'attributes':_0x43f9f0[_0x850f('0x1d')],'include':_0x43f9f0[_0x850f('0x1b')]?_[_0x850f('0x20')](_0x43f9f0[_0x850f('0x1b')],function(_0x155c0f){return{'model':db[_0x155c0f[_0x850f('0x1c')]],'as':_0x155c0f['as'],'attributes':_0x155c0f[_0x850f('0x1d')],'include':_0x155c0f[_0x850f('0x1b')]?_['map'](_0x155c0f[_0x850f('0x1b')],function(_0x138f4b){return{'model':db[_0x138f4b[_0x850f('0x1c')]],'as':_0x138f4b['as'],'attributes':_0x138f4b[_0x850f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x850f('0xb')](function(_0x2857da){logger[_0x850f('0xc')]('ShowSugarcrmAccount',_0x360207);logger[_0x850f('0xf')](_0x850f('0x21'),_0x360207,JSON[_0x850f('0x11')](_0x2857da));_0xf6d7fe(_0x2857da);})[_0x850f('0x1e')](function(_0x8c2354){logger[_0x850f('0x12')](_0x850f('0x21'),_0x8c2354[_0x850f('0x14')],_0x360207);_0x564ea8(_0x419e02[_0x850f('0x12')](0x1f4,_0x8c2354[_0x850f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 102321f..0576be9 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 _0xefc5=['express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x590e71,_0x4c55ad){var _0x575304=function(_0x440d7b){while(--_0x440d7b){_0x590e71['push'](_0x590e71['shift']());}};_0x575304(++_0x4c55ad);}(_0xefc5,0x123));var _0x5efc=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0xefc5[_0x8560d3];return _0x33b1b5;};'use strict';var multer=require(_0x5efc('0x0'));var util=require('util');var path=require(_0x5efc('0x1'));var timeout=require(_0x5efc('0x2'));var express=require(_0x5efc('0x3'));var router=express[_0x5efc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5efc('0x5'));var config=require(_0x5efc('0x6'));var controller=require(_0x5efc('0x7'));router[_0x5efc('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5efc('0x8')]('/:id',auth[_0x5efc('0x9')](),controller[_0x5efc('0xa')]);router[_0x5efc('0x8')]('/:id/fields',auth[_0x5efc('0x9')](),controller['getFields']);router['get'](_0x5efc('0xb'),auth[_0x5efc('0x9')](),controller['getSubjects']);router[_0x5efc('0x8')]('/:id/descriptions',auth[_0x5efc('0x9')](),controller[_0x5efc('0xc')]);router[_0x5efc('0xd')]('/',auth['isAuthenticated'](),controller[_0x5efc('0xe')]);router[_0x5efc('0xf')](_0x5efc('0x10'),auth[_0x5efc('0x9')](),controller[_0x5efc('0x11')]);router[_0x5efc('0x12')](_0x5efc('0x10'),auth['isAuthenticated'](),controller[_0x5efc('0x13')]);module[_0x5efc('0x14')]=router; \ No newline at end of file +var _0x0e83=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post'];(function(_0x3a8d52,_0x55c1c1){var _0x21b57d=function(_0x3f4914){while(--_0x3f4914){_0x3a8d52['push'](_0x3a8d52['shift']());}};_0x21b57d(++_0x55c1c1);}(_0x0e83,0x1f3));var _0x30e8=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x0e83[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0x30e8('0x0'));var util=require(_0x30e8('0x1'));var path=require(_0x30e8('0x2'));var timeout=require(_0x30e8('0x3'));var express=require(_0x30e8('0x4'));var router=express[_0x30e8('0x5')]();var fs_extra=require(_0x30e8('0x6'));var auth=require(_0x30e8('0x7'));var interaction=require(_0x30e8('0x8'));var config=require(_0x30e8('0x9'));var controller=require(_0x30e8('0xa'));router[_0x30e8('0xb')]('/',auth[_0x30e8('0xc')](),controller[_0x30e8('0xd')]);router['get'](_0x30e8('0xe'),auth[_0x30e8('0xc')](),controller[_0x30e8('0xf')]);router[_0x30e8('0xb')](_0x30e8('0x10'),auth[_0x30e8('0xc')](),controller[_0x30e8('0x11')]);router['get'](_0x30e8('0x12'),auth[_0x30e8('0xc')](),controller['getSubjects']);router[_0x30e8('0xb')](_0x30e8('0x13'),auth[_0x30e8('0xc')](),controller['getDescriptions']);router[_0x30e8('0x14')]('/',auth[_0x30e8('0xc')](),controller[_0x30e8('0x15')]);router['put'](_0x30e8('0xe'),auth['isAuthenticated'](),controller[_0x30e8('0x16')]);router[_0x30e8('0x17')](_0x30e8('0xe'),auth[_0x30e8('0xc')](),controller[_0x30e8('0x18')]);module[_0x30e8('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index f118ac5..acdd3e1 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 _0x6e13=['STRING','sequelize','exports'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0x6e13,0x157));var _0x36e1=function(_0x510bf7,_0x4b394b){_0x510bf7=_0x510bf7-0x0;var _0x1a259c=_0x6e13[_0x510bf7];return _0x1a259c;};'use strict';var Sequelize=require(_0x36e1('0x0'));module[_0x36e1('0x1')]={'name':{'type':Sequelize[_0x36e1('0x2')]},'description':{'type':Sequelize[_0x36e1('0x2')]}}; \ No newline at end of file +var _0xa09d=['sequelize','STRING'];(function(_0x3ff49d,_0x3aff4b){var _0x1947b6=function(_0x5a1994){while(--_0x5a1994){_0x3ff49d['push'](_0x3ff49d['shift']());}};_0x1947b6(++_0x3aff4b);}(_0xa09d,0x11a));var _0xda09=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa09d[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0xda09('0x0'));module['exports']={'name':{'type':Sequelize[_0xda09('0x1')]},'description':{'type':Sequelize[_0xda09('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4130fa3..f735016 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 _0xd796=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','intersection','options','find','create','body','getFields','findOne','SugarcrmField','pick','filter','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x380c4b,_0x280681){var _0x5b5f66=function(_0x9784bc){while(--_0x9784bc){_0x380c4b['push'](_0x380c4b['shift']());}};_0x5b5f66(++_0x280681);}(_0xd796,0x137));var _0x6d79=function(_0x450511,_0x46634c){_0x450511=_0x450511-0x0;var _0x132cbd=_0xd796[_0x450511];return _0x132cbd;};'use strict';var emlformat=require(_0x6d79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d79('0x1'));var jsonpatch=require(_0x6d79('0x2'));var rp=require(_0x6d79('0x3'));var moment=require(_0x6d79('0x4'));var BPromise=require(_0x6d79('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6d79('0x6'));var sox=require(_0x6d79('0x7'));var csv=require(_0x6d79('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d79('0x9'));var _=require(_0x6d79('0xa'));var squel=require(_0x6d79('0xb'));var crypto=require('crypto');var jsforce=require(_0x6d79('0xc'));var deskjs=require(_0x6d79('0xd'));var toCsv=require(_0x6d79('0x8'));var querystring=require(_0x6d79('0xe'));var Papa=require('papaparse');var Redis=require(_0x6d79('0xf'));var authService=require(_0x6d79('0x10'));var qs=require(_0x6d79('0x11'));var as=require(_0x6d79('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d79('0x13'))(_0x6d79('0x14'));var utils=require('../../config/utils');var config=require(_0x6d79('0x15'));var licenseUtil=require(_0x6d79('0x16'));var db=require(_0x6d79('0x17'))['db'];function respondWithStatusCode(_0x3efda9,_0x1c4455){_0x1c4455=_0x1c4455||0xcc;return function(_0xfbf8fe){if(_0xfbf8fe){return _0x3efda9[_0x6d79('0x18')](_0x1c4455);}return _0x3efda9[_0x6d79('0x19')](_0x1c4455)['end']();};}function respondWithResult(_0x9d0a39,_0x2c6004){_0x2c6004=_0x2c6004||0xc8;return function(_0x98eb10){if(_0x98eb10){return _0x9d0a39[_0x6d79('0x19')](_0x2c6004)['json'](_0x98eb10);}};}function respondWithFilteredResult(_0x2d4fa7,_0x477494){return function(_0x55238e){if(_0x55238e){var _0x29d68e=typeof _0x477494[_0x6d79('0x1a')]==='undefined'&&typeof _0x477494['limit']===_0x6d79('0x1b');var _0x27a6bc=_0x55238e['count'];var _0x494509=_0x29d68e?0x0:_0x477494[_0x6d79('0x1a')];var _0x4d9346=_0x29d68e?_0x55238e[_0x6d79('0x1c')]:_0x477494[_0x6d79('0x1a')]+_0x477494['limit'];var _0x52a2e4;if(_0x4d9346>=_0x27a6bc){_0x4d9346=_0x27a6bc;_0x52a2e4=0xc8;}else{_0x52a2e4=0xce;}_0x2d4fa7[_0x6d79('0x19')](_0x52a2e4);return _0x2d4fa7[_0x6d79('0x1d')](_0x6d79('0x1e'),_0x494509+'-'+_0x4d9346+'/'+_0x27a6bc)[_0x6d79('0x1f')](_0x55238e);}return null;};}function patchUpdates(_0x32a6a9){return function(_0x313c19){try{jsonpatch[_0x6d79('0x20')](_0x313c19,_0x32a6a9,!![]);}catch(_0xebd196){return BPromise[_0x6d79('0x21')](_0xebd196);}return _0x313c19[_0x6d79('0x22')]();};}function saveUpdates(_0x169c0a,_0x6be082){return function(_0x26de0e){if(_0x26de0e){return _0x26de0e[_0x6d79('0x23')](_0x169c0a)[_0x6d79('0x24')](function(_0x91740c){return _0x91740c;});}return null;};}function removeEntity(_0x526353,_0x31074){return function(_0x500b67){if(_0x500b67){return _0x500b67[_0x6d79('0x25')]()[_0x6d79('0x24')](function(){_0x526353[_0x6d79('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x279be2,_0x47d809){return function(_0x2733fb){if(!_0x2733fb){_0x279be2[_0x6d79('0x18')](0x194);}return _0x2733fb;};}function handleError(_0x19e173,_0xb3555f){_0xb3555f=_0xb3555f||0x1f4;return function(_0x31c785){logger[_0x6d79('0x26')](_0x31c785[_0x6d79('0x27')]);if(_0x31c785['name']){delete _0x31c785[_0x6d79('0x28')];}_0x19e173[_0x6d79('0x19')](_0xb3555f)[_0x6d79('0x29')](_0x31c785);};}exports['index']=function(_0x45e1c0,_0x17dab4){var _0x4d38aa={},_0xdb0cc={},_0x904e6a={'count':0x0,'rows':[]};var _0xab65aa=_[_0x6d79('0x2a')](db[_0x6d79('0x2b')][_0x6d79('0x2c')],function(_0x29b388){return{'name':_0x29b388[_0x6d79('0x2d')],'type':_0x29b388['type'][_0x6d79('0x2e')]};});_0xdb0cc['model']=_['map'](_0xab65aa,_0x6d79('0x28'));_0xdb0cc[_0x6d79('0x2f')]=_[_0x6d79('0x30')](_0x45e1c0['query']);_0xdb0cc[_0x6d79('0x31')]=_['intersection'](_0xdb0cc[_0x6d79('0x32')],_0xdb0cc[_0x6d79('0x2f')]);_0x4d38aa[_0x6d79('0x33')]=_['intersection'](_0xdb0cc['model'],qs[_0x6d79('0x34')](_0x45e1c0['query']['fields']));_0x4d38aa['attributes']=_0x4d38aa[_0x6d79('0x33')][_0x6d79('0x35')]?_0x4d38aa[_0x6d79('0x33')]:_0xdb0cc[_0x6d79('0x32')];if(!_0x45e1c0[_0x6d79('0x2f')][_0x6d79('0x36')]('nolimit')){_0x4d38aa[_0x6d79('0x37')]=qs[_0x6d79('0x37')](_0x45e1c0[_0x6d79('0x2f')][_0x6d79('0x37')]);_0x4d38aa['offset']=qs['offset'](_0x45e1c0[_0x6d79('0x2f')][_0x6d79('0x1a')]);}_0x4d38aa[_0x6d79('0x38')]=qs['sort'](_0x45e1c0[_0x6d79('0x2f')][_0x6d79('0x39')]);_0x4d38aa[_0x6d79('0x3a')]=qs[_0x6d79('0x31')](_['pick'](_0x45e1c0[_0x6d79('0x2f')],_0xdb0cc['filters']),_0xab65aa);if(_0x45e1c0[_0x6d79('0x2f')]['filter']){_0x4d38aa['where']=_[_0x6d79('0x3b')](_0x4d38aa[_0x6d79('0x3a')],{'$or':_[_0x6d79('0x2a')](_0xab65aa,function(_0x1ff72f){if(_0x1ff72f[_0x6d79('0x3c')]!==_0x6d79('0x3d')){var _0x5b4d71={};_0x5b4d71[_0x1ff72f[_0x6d79('0x28')]]={'$like':'%'+_0x45e1c0[_0x6d79('0x2f')]['filter']+'%'};return _0x5b4d71;}})});}_0x4d38aa=_[_0x6d79('0x3b')]({},_0x4d38aa,_0x45e1c0['options']);var _0x55810b={'where':_0x4d38aa['where']};return db[_0x6d79('0x2b')][_0x6d79('0x1c')](_0x55810b)[_0x6d79('0x24')](function(_0x5858ad){_0x904e6a[_0x6d79('0x1c')]=_0x5858ad;if(_0x45e1c0[_0x6d79('0x2f')][_0x6d79('0x3e')]){_0x4d38aa['include']=[{'all':!![]}];}return db[_0x6d79('0x2b')][_0x6d79('0x3f')](_0x4d38aa);})['then'](function(_0x296450){_0x904e6a[_0x6d79('0x40')]=_0x296450;return _0x904e6a;})[_0x6d79('0x24')](respondWithFilteredResult(_0x17dab4,_0x4d38aa))[_0x6d79('0x41')](handleError(_0x17dab4,null));};exports[_0x6d79('0x42')]=function(_0x444925,_0x291795){var _0x4a4271={'raw':![],'where':{'id':_0x444925[_0x6d79('0x43')]['id']}},_0x56583d={};_0x56583d[_0x6d79('0x32')]=_['keys'](db[_0x6d79('0x2b')][_0x6d79('0x2c')]);_0x56583d[_0x6d79('0x2f')]=_[_0x6d79('0x30')](_0x444925[_0x6d79('0x2f')]);_0x56583d[_0x6d79('0x31')]=_['intersection'](_0x56583d[_0x6d79('0x32')],_0x56583d[_0x6d79('0x2f')]);_0x4a4271[_0x6d79('0x33')]=_[_0x6d79('0x44')](_0x56583d[_0x6d79('0x32')],qs[_0x6d79('0x34')](_0x444925[_0x6d79('0x2f')][_0x6d79('0x34')]));_0x4a4271[_0x6d79('0x33')]=_0x4a4271[_0x6d79('0x33')][_0x6d79('0x35')]?_0x4a4271[_0x6d79('0x33')]:_0x56583d[_0x6d79('0x32')];if(_0x444925[_0x6d79('0x2f')][_0x6d79('0x3e')]){_0x4a4271['include']=[{'all':!![]}];}_0x4a4271=_[_0x6d79('0x3b')]({},_0x4a4271,_0x444925[_0x6d79('0x45')]);return db[_0x6d79('0x2b')][_0x6d79('0x46')](_0x4a4271)[_0x6d79('0x24')](handleEntityNotFound(_0x291795,null))[_0x6d79('0x24')](respondWithResult(_0x291795,null))['catch'](handleError(_0x291795,null));};exports[_0x6d79('0x47')]=function(_0x312b50,_0x1d0d63){return db[_0x6d79('0x2b')][_0x6d79('0x47')](_0x312b50[_0x6d79('0x48')],{})[_0x6d79('0x24')](respondWithResult(_0x1d0d63,0xc9))['catch'](handleError(_0x1d0d63,null));};exports[_0x6d79('0x23')]=function(_0x4cd057,_0x9580a1){if(_0x4cd057[_0x6d79('0x48')]['id']){delete _0x4cd057[_0x6d79('0x48')]['id'];}return db['SugarcrmConfiguration'][_0x6d79('0x46')]({'where':{'id':_0x4cd057['params']['id']}})[_0x6d79('0x24')](handleEntityNotFound(_0x9580a1,null))[_0x6d79('0x24')](saveUpdates(_0x4cd057[_0x6d79('0x48')],null))['then'](respondWithResult(_0x9580a1,null))[_0x6d79('0x41')](handleError(_0x9580a1,null));};exports[_0x6d79('0x25')]=function(_0x215312,_0x23baf9){return db[_0x6d79('0x2b')][_0x6d79('0x46')]({'where':{'id':_0x215312['params']['id']}})[_0x6d79('0x24')](handleEntityNotFound(_0x23baf9,null))[_0x6d79('0x24')](removeEntity(_0x23baf9,null))[_0x6d79('0x41')](handleError(_0x23baf9,null));};exports[_0x6d79('0x49')]=function(_0x6aa6b1,_0xa25e22,_0x4adb82){var _0x544c3a={};var _0x27fdf2={};var _0x1d7f63;var _0x31ae31;return db[_0x6d79('0x2b')][_0x6d79('0x4a')]({'where':{'id':_0x6aa6b1[_0x6d79('0x43')]['id']}})[_0x6d79('0x24')](handleEntityNotFound(_0xa25e22,null))[_0x6d79('0x24')](function(_0x193be2){if(_0x193be2){_0x1d7f63=_0x193be2;_0x27fdf2[_0x6d79('0x32')]=_['keys'](db[_0x6d79('0x4b')][_0x6d79('0x2c')]);_0x27fdf2[_0x6d79('0x2f')]=_[_0x6d79('0x30')](_0x6aa6b1['query']);_0x27fdf2[_0x6d79('0x31')]=_['intersection'](_0x27fdf2[_0x6d79('0x32')],_0x27fdf2[_0x6d79('0x2f')]);_0x544c3a[_0x6d79('0x33')]=_['intersection'](_0x27fdf2[_0x6d79('0x32')],qs['fields'](_0x6aa6b1['query'][_0x6d79('0x34')]));_0x544c3a[_0x6d79('0x33')]=_0x544c3a['attributes'][_0x6d79('0x35')]?_0x544c3a[_0x6d79('0x33')]:_0x27fdf2['model'];_0x544c3a[_0x6d79('0x38')]=qs['sort'](_0x6aa6b1[_0x6d79('0x2f')][_0x6d79('0x39')]);_0x544c3a['where']=qs[_0x6d79('0x31')](_[_0x6d79('0x4c')](_0x6aa6b1['query'],_0x27fdf2['filters']));if(_0x6aa6b1[_0x6d79('0x2f')][_0x6d79('0x4d')]){_0x544c3a[_0x6d79('0x3a')]=_[_0x6d79('0x3b')](_0x544c3a[_0x6d79('0x3a')],{'$or':_[_0x6d79('0x2a')](_0x544c3a['attributes'],function(_0x66ac9a){var _0x40c6fc={};_0x40c6fc[_0x66ac9a]={'$like':'%'+_0x6aa6b1['query'][_0x6d79('0x4d')]+'%'};return _0x40c6fc;})});}_0x544c3a=_[_0x6d79('0x3b')]({},_0x544c3a,_0x6aa6b1[_0x6d79('0x45')]);return _0x1d7f63['getFields'](_0x544c3a);}})[_0x6d79('0x24')](function(_0x463ae9){if(_0x463ae9){_0x31ae31=_0x463ae9[_0x6d79('0x35')];if(!_0x6aa6b1[_0x6d79('0x2f')][_0x6d79('0x36')](_0x6d79('0x4e'))){_0x544c3a['limit']=qs[_0x6d79('0x37')](_0x6aa6b1[_0x6d79('0x2f')]['limit']);_0x544c3a[_0x6d79('0x1a')]=qs[_0x6d79('0x1a')](_0x6aa6b1['query'][_0x6d79('0x1a')]);}return _0x1d7f63[_0x6d79('0x49')](_0x544c3a);}})['then'](function(_0x8646f0){if(_0x8646f0){return _0x8646f0?{'count':_0x31ae31,'rows':_0x8646f0}:null;}})['then'](respondWithResult(_0xa25e22,null))['catch'](handleError(_0xa25e22,null));};exports[_0x6d79('0x4f')]=function(_0x1b5f9d,_0xc23c19,_0x2e7d80){var _0x1cfcb0={};var _0x2279d4={};var _0x526b76;var _0x4de78b;return db[_0x6d79('0x2b')][_0x6d79('0x4a')]({'where':{'id':_0x1b5f9d[_0x6d79('0x43')]['id']}})[_0x6d79('0x24')](handleEntityNotFound(_0xc23c19,null))[_0x6d79('0x24')](function(_0x31c1b9){if(_0x31c1b9){_0x526b76=_0x31c1b9;_0x2279d4['model']=_[_0x6d79('0x30')](db[_0x6d79('0x4b')][_0x6d79('0x2c')]);_0x2279d4['query']=_[_0x6d79('0x30')](_0x1b5f9d['query']);_0x2279d4[_0x6d79('0x31')]=_[_0x6d79('0x44')](_0x2279d4[_0x6d79('0x32')],_0x2279d4['query']);_0x1cfcb0[_0x6d79('0x33')]=_[_0x6d79('0x44')](_0x2279d4[_0x6d79('0x32')],qs[_0x6d79('0x34')](_0x1b5f9d['query'][_0x6d79('0x34')]));_0x1cfcb0[_0x6d79('0x33')]=_0x1cfcb0[_0x6d79('0x33')][_0x6d79('0x35')]?_0x1cfcb0[_0x6d79('0x33')]:_0x2279d4[_0x6d79('0x32')];_0x1cfcb0[_0x6d79('0x38')]=qs['sort'](_0x1b5f9d['query'][_0x6d79('0x39')]);_0x1cfcb0[_0x6d79('0x3a')]=qs['filters'](_[_0x6d79('0x4c')](_0x1b5f9d[_0x6d79('0x2f')],_0x2279d4[_0x6d79('0x31')]));if(_0x1b5f9d[_0x6d79('0x2f')]['filter']){_0x1cfcb0[_0x6d79('0x3a')]=_[_0x6d79('0x3b')](_0x1cfcb0['where'],{'$or':_[_0x6d79('0x2a')](_0x1cfcb0[_0x6d79('0x33')],function(_0x3a290f){var _0xde1d70={};_0xde1d70[_0x3a290f]={'$like':'%'+_0x1b5f9d[_0x6d79('0x2f')][_0x6d79('0x4d')]+'%'};return _0xde1d70;})});}_0x1cfcb0=_['merge']({},_0x1cfcb0,_0x1b5f9d[_0x6d79('0x45')]);return _0x526b76[_0x6d79('0x4f')](_0x1cfcb0);}})[_0x6d79('0x24')](function(_0x5c765d){if(_0x5c765d){_0x4de78b=_0x5c765d[_0x6d79('0x35')];if(!_0x1b5f9d[_0x6d79('0x2f')]['hasOwnProperty'](_0x6d79('0x4e'))){_0x1cfcb0['limit']=qs[_0x6d79('0x37')](_0x1b5f9d[_0x6d79('0x2f')]['limit']);_0x1cfcb0[_0x6d79('0x1a')]=qs['offset'](_0x1b5f9d['query'][_0x6d79('0x1a')]);}return _0x526b76[_0x6d79('0x4f')](_0x1cfcb0);}})[_0x6d79('0x24')](function(_0x175697){if(_0x175697){return _0x175697?{'count':_0x4de78b,'rows':_0x175697}:null;}})[_0x6d79('0x24')](respondWithResult(_0xc23c19,null))[_0x6d79('0x41')](handleError(_0xc23c19,null));};exports[_0x6d79('0x50')]=function(_0x598b4e,_0xf99810,_0x55864f){var _0x3cdca5={};var _0x3c4278={};var _0x2488fc;var _0x4d9fd2;return db[_0x6d79('0x2b')]['findOne']({'where':{'id':_0x598b4e[_0x6d79('0x43')]['id']}})[_0x6d79('0x24')](handleEntityNotFound(_0xf99810,null))[_0x6d79('0x24')](function(_0x7ab49c){if(_0x7ab49c){_0x2488fc=_0x7ab49c;_0x3c4278['model']=_[_0x6d79('0x30')](db['SugarcrmField'][_0x6d79('0x2c')]);_0x3c4278['query']=_[_0x6d79('0x30')](_0x598b4e[_0x6d79('0x2f')]);_0x3c4278[_0x6d79('0x31')]=_['intersection'](_0x3c4278['model'],_0x3c4278[_0x6d79('0x2f')]);_0x3cdca5[_0x6d79('0x33')]=_[_0x6d79('0x44')](_0x3c4278[_0x6d79('0x32')],qs['fields'](_0x598b4e[_0x6d79('0x2f')][_0x6d79('0x34')]));_0x3cdca5[_0x6d79('0x33')]=_0x3cdca5['attributes'][_0x6d79('0x35')]?_0x3cdca5['attributes']:_0x3c4278[_0x6d79('0x32')];_0x3cdca5['order']=qs[_0x6d79('0x39')](_0x598b4e['query'][_0x6d79('0x39')]);_0x3cdca5[_0x6d79('0x3a')]=qs['filters'](_[_0x6d79('0x4c')](_0x598b4e[_0x6d79('0x2f')],_0x3c4278[_0x6d79('0x31')]));if(_0x598b4e[_0x6d79('0x2f')]['filter']){_0x3cdca5[_0x6d79('0x3a')]=_[_0x6d79('0x3b')](_0x3cdca5[_0x6d79('0x3a')],{'$or':_['map'](_0x3cdca5[_0x6d79('0x33')],function(_0x31fea8){var _0x387fb4={};_0x387fb4[_0x31fea8]={'$like':'%'+_0x598b4e[_0x6d79('0x2f')]['filter']+'%'};return _0x387fb4;})});}_0x3cdca5=_[_0x6d79('0x3b')]({},_0x3cdca5,_0x598b4e[_0x6d79('0x45')]);return _0x2488fc['getDescriptions'](_0x3cdca5);}})[_0x6d79('0x24')](function(_0x285308){if(_0x285308){_0x4d9fd2=_0x285308[_0x6d79('0x35')];if(!_0x598b4e[_0x6d79('0x2f')]['hasOwnProperty']('nolimit')){_0x3cdca5['limit']=qs['limit'](_0x598b4e[_0x6d79('0x2f')][_0x6d79('0x37')]);_0x3cdca5['offset']=qs[_0x6d79('0x1a')](_0x598b4e[_0x6d79('0x2f')]['offset']);}return _0x2488fc[_0x6d79('0x50')](_0x3cdca5);}})['then'](function(_0xbb0153){if(_0xbb0153){return _0xbb0153?{'count':_0x4d9fd2,'rows':_0xbb0153}:null;}})['then'](respondWithResult(_0xf99810,null))[_0x6d79('0x41')](handleError(_0xf99810,null));}; \ No newline at end of file +var _0x6534=['end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','update','getFields','SugarcrmField','order','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5bb5a9,_0x36a3a0){var _0x4d71d0=function(_0x1a2b2b){while(--_0x1a2b2b){_0x5bb5a9['push'](_0x5bb5a9['shift']());}};_0x4d71d0(++_0x36a3a0);}(_0x6534,0x1cd));var _0x4653=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6534[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x4653('0x0'));var rimraf=require(_0x4653('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4653('0x2'));var rp=require(_0x4653('0x3'));var moment=require(_0x4653('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4653('0x5'));var util=require(_0x4653('0x6'));var path=require(_0x4653('0x7'));var sox=require(_0x4653('0x8'));var csv=require(_0x4653('0x9'));var ejs=require(_0x4653('0xa'));var fs=require('fs');var fs_extra=require(_0x4653('0xb'));var _=require(_0x4653('0xc'));var squel=require(_0x4653('0xd'));var crypto=require(_0x4653('0xe'));var jsforce=require(_0x4653('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4653('0x9'));var querystring=require(_0x4653('0x10'));var Papa=require('papaparse');var Redis=require(_0x4653('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4653('0x12'));var as=require(_0x4653('0x13'));var hardwareService=require(_0x4653('0x14'));var logger=require(_0x4653('0x15'))('api');var utils=require(_0x4653('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4653('0x17'));var db=require(_0x4653('0x18'))['db'];function respondWithStatusCode(_0x5bbcf5,_0x3322cc){_0x3322cc=_0x3322cc||0xcc;return function(_0x52e40f){if(_0x52e40f){return _0x5bbcf5['sendStatus'](_0x3322cc);}return _0x5bbcf5['status'](_0x3322cc)[_0x4653('0x19')]();};}function respondWithResult(_0x17f9f8,_0x3164bd){_0x3164bd=_0x3164bd||0xc8;return function(_0x5d427f){if(_0x5d427f){return _0x17f9f8['status'](_0x3164bd)[_0x4653('0x1a')](_0x5d427f);}};}function respondWithFilteredResult(_0x487c95,_0xcd0d2e){return function(_0x59bdb3){if(_0x59bdb3){var _0x2480b1=typeof _0xcd0d2e[_0x4653('0x1b')]===_0x4653('0x1c')&&typeof _0xcd0d2e[_0x4653('0x1d')]===_0x4653('0x1c');var _0x122cc3=_0x59bdb3[_0x4653('0x1e')];var _0x351f5f=_0x2480b1?0x0:_0xcd0d2e['offset'];var _0x4337ce=_0x2480b1?_0x59bdb3[_0x4653('0x1e')]:_0xcd0d2e['offset']+_0xcd0d2e[_0x4653('0x1d')];var _0x2efde9;if(_0x4337ce>=_0x122cc3){_0x4337ce=_0x122cc3;_0x2efde9=0xc8;}else{_0x2efde9=0xce;}_0x487c95[_0x4653('0x1f')](_0x2efde9);return _0x487c95[_0x4653('0x20')](_0x4653('0x21'),_0x351f5f+'-'+_0x4337ce+'/'+_0x122cc3)['json'](_0x59bdb3);}return null;};}function patchUpdates(_0x49732f){return function(_0x4250d8){try{jsonpatch[_0x4653('0x22')](_0x4250d8,_0x49732f,!![]);}catch(_0x3ced18){return BPromise[_0x4653('0x23')](_0x3ced18);}return _0x4250d8[_0x4653('0x24')]();};}function saveUpdates(_0x4e76ed,_0x1bd056){return function(_0x2e95b0){if(_0x2e95b0){return _0x2e95b0['update'](_0x4e76ed)[_0x4653('0x25')](function(_0xf83b58){return _0xf83b58;});}return null;};}function removeEntity(_0x1aee30,_0x5d821e){return function(_0x30b245){if(_0x30b245){return _0x30b245[_0x4653('0x26')]()[_0x4653('0x25')](function(){_0x1aee30[_0x4653('0x1f')](0xcc)[_0x4653('0x19')]();});}};}function handleEntityNotFound(_0x589627,_0x1eac94){return function(_0x4336e6){if(!_0x4336e6){_0x589627['sendStatus'](0x194);}return _0x4336e6;};}function handleError(_0x3495f9,_0x245852){_0x245852=_0x245852||0x1f4;return function(_0x125638){logger['error'](_0x125638[_0x4653('0x27')]);if(_0x125638[_0x4653('0x28')]){delete _0x125638['name'];}_0x3495f9[_0x4653('0x1f')](_0x245852)[_0x4653('0x29')](_0x125638);};}exports['index']=function(_0x1541ce,_0x1faff9){var _0x306e15={},_0x1d1b23={},_0x5e92b7={'count':0x0,'rows':[]};var _0x59a4df=_['map'](db[_0x4653('0x2a')][_0x4653('0x2b')],function(_0x27750d){return{'name':_0x27750d[_0x4653('0x2c')],'type':_0x27750d[_0x4653('0x2d')]['key']};});_0x1d1b23[_0x4653('0x2e')]=_[_0x4653('0x2f')](_0x59a4df,_0x4653('0x28'));_0x1d1b23[_0x4653('0x30')]=_[_0x4653('0x31')](_0x1541ce[_0x4653('0x30')]);_0x1d1b23[_0x4653('0x32')]=_['intersection'](_0x1d1b23[_0x4653('0x2e')],_0x1d1b23[_0x4653('0x30')]);_0x306e15['attributes']=_['intersection'](_0x1d1b23['model'],qs[_0x4653('0x33')](_0x1541ce[_0x4653('0x30')][_0x4653('0x33')]));_0x306e15[_0x4653('0x34')]=_0x306e15[_0x4653('0x34')][_0x4653('0x35')]?_0x306e15['attributes']:_0x1d1b23[_0x4653('0x2e')];if(!_0x1541ce[_0x4653('0x30')][_0x4653('0x36')](_0x4653('0x37'))){_0x306e15[_0x4653('0x1d')]=qs[_0x4653('0x1d')](_0x1541ce[_0x4653('0x30')][_0x4653('0x1d')]);_0x306e15[_0x4653('0x1b')]=qs[_0x4653('0x1b')](_0x1541ce[_0x4653('0x30')][_0x4653('0x1b')]);}_0x306e15['order']=qs[_0x4653('0x38')](_0x1541ce[_0x4653('0x30')]['sort']);_0x306e15[_0x4653('0x39')]=qs[_0x4653('0x32')](_[_0x4653('0x3a')](_0x1541ce[_0x4653('0x30')],_0x1d1b23['filters']),_0x59a4df);if(_0x1541ce[_0x4653('0x30')][_0x4653('0x3b')]){_0x306e15['where']=_[_0x4653('0x3c')](_0x306e15[_0x4653('0x39')],{'$or':_[_0x4653('0x2f')](_0x59a4df,function(_0x55ffb9){if(_0x55ffb9[_0x4653('0x2d')]!==_0x4653('0x3d')){var _0x5b9f25={};_0x5b9f25[_0x55ffb9['name']]={'$like':'%'+_0x1541ce['query']['filter']+'%'};return _0x5b9f25;}})});}_0x306e15=_[_0x4653('0x3c')]({},_0x306e15,_0x1541ce[_0x4653('0x3e')]);var _0x4ecb2e={'where':_0x306e15[_0x4653('0x39')]};return db['SugarcrmConfiguration'][_0x4653('0x1e')](_0x4ecb2e)['then'](function(_0x485505){_0x5e92b7[_0x4653('0x1e')]=_0x485505;if(_0x1541ce[_0x4653('0x30')][_0x4653('0x3f')]){_0x306e15[_0x4653('0x40')]=[{'all':!![]}];}return db[_0x4653('0x2a')][_0x4653('0x41')](_0x306e15);})['then'](function(_0x4759be){_0x5e92b7[_0x4653('0x42')]=_0x4759be;return _0x5e92b7;})['then'](respondWithFilteredResult(_0x1faff9,_0x306e15))[_0x4653('0x43')](handleError(_0x1faff9,null));};exports[_0x4653('0x44')]=function(_0xa97613,_0x3a96dd){var _0x37b979={'raw':![],'where':{'id':_0xa97613[_0x4653('0x45')]['id']}},_0xe44eb4={};_0xe44eb4[_0x4653('0x2e')]=_[_0x4653('0x31')](db['SugarcrmConfiguration'][_0x4653('0x2b')]);_0xe44eb4[_0x4653('0x30')]=_[_0x4653('0x31')](_0xa97613[_0x4653('0x30')]);_0xe44eb4[_0x4653('0x32')]=_[_0x4653('0x46')](_0xe44eb4['model'],_0xe44eb4[_0x4653('0x30')]);_0x37b979[_0x4653('0x34')]=_['intersection'](_0xe44eb4[_0x4653('0x2e')],qs[_0x4653('0x33')](_0xa97613[_0x4653('0x30')]['fields']));_0x37b979[_0x4653('0x34')]=_0x37b979[_0x4653('0x34')][_0x4653('0x35')]?_0x37b979[_0x4653('0x34')]:_0xe44eb4['model'];if(_0xa97613[_0x4653('0x30')][_0x4653('0x3f')]){_0x37b979['include']=[{'all':!![]}];}_0x37b979=_[_0x4653('0x3c')]({},_0x37b979,_0xa97613[_0x4653('0x3e')]);return db[_0x4653('0x2a')][_0x4653('0x47')](_0x37b979)['then'](handleEntityNotFound(_0x3a96dd,null))[_0x4653('0x25')](respondWithResult(_0x3a96dd,null))[_0x4653('0x43')](handleError(_0x3a96dd,null));};exports['create']=function(_0x26e9c4,_0xa6968b){return db[_0x4653('0x2a')][_0x4653('0x48')](_0x26e9c4[_0x4653('0x49')],{})[_0x4653('0x25')](respondWithResult(_0xa6968b,0xc9))[_0x4653('0x43')](handleError(_0xa6968b,null));};exports[_0x4653('0x4a')]=function(_0x2f4722,_0x4977b1){if(_0x2f4722[_0x4653('0x49')]['id']){delete _0x2f4722[_0x4653('0x49')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x2f4722[_0x4653('0x45')]['id']}})[_0x4653('0x25')](handleEntityNotFound(_0x4977b1,null))[_0x4653('0x25')](saveUpdates(_0x2f4722[_0x4653('0x49')],null))[_0x4653('0x25')](respondWithResult(_0x4977b1,null))[_0x4653('0x43')](handleError(_0x4977b1,null));};exports[_0x4653('0x26')]=function(_0x3deaa3,_0x5b3492){return db[_0x4653('0x2a')]['find']({'where':{'id':_0x3deaa3[_0x4653('0x45')]['id']}})[_0x4653('0x25')](handleEntityNotFound(_0x5b3492,null))[_0x4653('0x25')](removeEntity(_0x5b3492,null))[_0x4653('0x43')](handleError(_0x5b3492,null));};exports[_0x4653('0x4b')]=function(_0x2b0659,_0x3cccbc,_0x2b485b){var _0x5bb25a={};var _0x2d581a={};var _0x352055;var _0xea03c9;return db[_0x4653('0x2a')]['findOne']({'where':{'id':_0x2b0659['params']['id']}})['then'](handleEntityNotFound(_0x3cccbc,null))[_0x4653('0x25')](function(_0x4a9740){if(_0x4a9740){_0x352055=_0x4a9740;_0x2d581a[_0x4653('0x2e')]=_[_0x4653('0x31')](db[_0x4653('0x4c')][_0x4653('0x2b')]);_0x2d581a[_0x4653('0x30')]=_['keys'](_0x2b0659[_0x4653('0x30')]);_0x2d581a[_0x4653('0x32')]=_[_0x4653('0x46')](_0x2d581a[_0x4653('0x2e')],_0x2d581a[_0x4653('0x30')]);_0x5bb25a[_0x4653('0x34')]=_[_0x4653('0x46')](_0x2d581a[_0x4653('0x2e')],qs[_0x4653('0x33')](_0x2b0659['query']['fields']));_0x5bb25a[_0x4653('0x34')]=_0x5bb25a[_0x4653('0x34')][_0x4653('0x35')]?_0x5bb25a[_0x4653('0x34')]:_0x2d581a[_0x4653('0x2e')];_0x5bb25a[_0x4653('0x4d')]=qs[_0x4653('0x38')](_0x2b0659[_0x4653('0x30')][_0x4653('0x38')]);_0x5bb25a[_0x4653('0x39')]=qs[_0x4653('0x32')](_[_0x4653('0x3a')](_0x2b0659[_0x4653('0x30')],_0x2d581a[_0x4653('0x32')]));if(_0x2b0659[_0x4653('0x30')][_0x4653('0x3b')]){_0x5bb25a[_0x4653('0x39')]=_[_0x4653('0x3c')](_0x5bb25a[_0x4653('0x39')],{'$or':_[_0x4653('0x2f')](_0x5bb25a['attributes'],function(_0x4070ab){var _0x2a26d7={};_0x2a26d7[_0x4070ab]={'$like':'%'+_0x2b0659[_0x4653('0x30')][_0x4653('0x3b')]+'%'};return _0x2a26d7;})});}_0x5bb25a=_[_0x4653('0x3c')]({},_0x5bb25a,_0x2b0659[_0x4653('0x3e')]);return _0x352055[_0x4653('0x4b')](_0x5bb25a);}})[_0x4653('0x25')](function(_0x16577e){if(_0x16577e){_0xea03c9=_0x16577e[_0x4653('0x35')];if(!_0x2b0659[_0x4653('0x30')][_0x4653('0x36')](_0x4653('0x37'))){_0x5bb25a['limit']=qs[_0x4653('0x1d')](_0x2b0659[_0x4653('0x30')][_0x4653('0x1d')]);_0x5bb25a[_0x4653('0x1b')]=qs[_0x4653('0x1b')](_0x2b0659[_0x4653('0x30')]['offset']);}return _0x352055[_0x4653('0x4b')](_0x5bb25a);}})[_0x4653('0x25')](function(_0x86b506){if(_0x86b506){return _0x86b506?{'count':_0xea03c9,'rows':_0x86b506}:null;}})[_0x4653('0x25')](respondWithResult(_0x3cccbc,null))[_0x4653('0x43')](handleError(_0x3cccbc,null));};exports[_0x4653('0x4e')]=function(_0x5065d7,_0x5017e9,_0x501eb5){var _0xf48b78={};var _0x1a82cc={};var _0xa79595;var _0x47fbb0;return db[_0x4653('0x2a')][_0x4653('0x4f')]({'where':{'id':_0x5065d7[_0x4653('0x45')]['id']}})[_0x4653('0x25')](handleEntityNotFound(_0x5017e9,null))['then'](function(_0x6ced6c){if(_0x6ced6c){_0xa79595=_0x6ced6c;_0x1a82cc['model']=_[_0x4653('0x31')](db[_0x4653('0x4c')][_0x4653('0x2b')]);_0x1a82cc['query']=_[_0x4653('0x31')](_0x5065d7[_0x4653('0x30')]);_0x1a82cc[_0x4653('0x32')]=_[_0x4653('0x46')](_0x1a82cc[_0x4653('0x2e')],_0x1a82cc[_0x4653('0x30')]);_0xf48b78[_0x4653('0x34')]=_[_0x4653('0x46')](_0x1a82cc[_0x4653('0x2e')],qs[_0x4653('0x33')](_0x5065d7[_0x4653('0x30')][_0x4653('0x33')]));_0xf48b78[_0x4653('0x34')]=_0xf48b78['attributes'][_0x4653('0x35')]?_0xf48b78[_0x4653('0x34')]:_0x1a82cc[_0x4653('0x2e')];_0xf48b78['order']=qs[_0x4653('0x38')](_0x5065d7[_0x4653('0x30')]['sort']);_0xf48b78[_0x4653('0x39')]=qs[_0x4653('0x32')](_[_0x4653('0x3a')](_0x5065d7['query'],_0x1a82cc['filters']));if(_0x5065d7[_0x4653('0x30')][_0x4653('0x3b')]){_0xf48b78[_0x4653('0x39')]=_[_0x4653('0x3c')](_0xf48b78[_0x4653('0x39')],{'$or':_['map'](_0xf48b78[_0x4653('0x34')],function(_0x5c42f1){var _0x1ff718={};_0x1ff718[_0x5c42f1]={'$like':'%'+_0x5065d7[_0x4653('0x30')][_0x4653('0x3b')]+'%'};return _0x1ff718;})});}_0xf48b78=_[_0x4653('0x3c')]({},_0xf48b78,_0x5065d7['options']);return _0xa79595[_0x4653('0x4e')](_0xf48b78);}})[_0x4653('0x25')](function(_0x3385c8){if(_0x3385c8){_0x47fbb0=_0x3385c8[_0x4653('0x35')];if(!_0x5065d7[_0x4653('0x30')][_0x4653('0x36')](_0x4653('0x37'))){_0xf48b78[_0x4653('0x1d')]=qs['limit'](_0x5065d7[_0x4653('0x30')][_0x4653('0x1d')]);_0xf48b78['offset']=qs[_0x4653('0x1b')](_0x5065d7[_0x4653('0x30')][_0x4653('0x1b')]);}return _0xa79595[_0x4653('0x4e')](_0xf48b78);}})[_0x4653('0x25')](function(_0x182460){if(_0x182460){return _0x182460?{'count':_0x47fbb0,'rows':_0x182460}:null;}})[_0x4653('0x25')](respondWithResult(_0x5017e9,null))[_0x4653('0x43')](handleError(_0x5017e9,null));};exports[_0x4653('0x50')]=function(_0xfb4445,_0x4e484b,_0x5b42e5){var _0x4c293e={};var _0x581c1f={};var _0x4da93b;var _0xfdcbe7;return db[_0x4653('0x2a')][_0x4653('0x4f')]({'where':{'id':_0xfb4445[_0x4653('0x45')]['id']}})[_0x4653('0x25')](handleEntityNotFound(_0x4e484b,null))[_0x4653('0x25')](function(_0x1b560e){if(_0x1b560e){_0x4da93b=_0x1b560e;_0x581c1f[_0x4653('0x2e')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x581c1f[_0x4653('0x30')]=_[_0x4653('0x31')](_0xfb4445[_0x4653('0x30')]);_0x581c1f[_0x4653('0x32')]=_[_0x4653('0x46')](_0x581c1f[_0x4653('0x2e')],_0x581c1f[_0x4653('0x30')]);_0x4c293e['attributes']=_['intersection'](_0x581c1f['model'],qs[_0x4653('0x33')](_0xfb4445[_0x4653('0x30')]['fields']));_0x4c293e['attributes']=_0x4c293e['attributes'][_0x4653('0x35')]?_0x4c293e[_0x4653('0x34')]:_0x581c1f[_0x4653('0x2e')];_0x4c293e['order']=qs[_0x4653('0x38')](_0xfb4445[_0x4653('0x30')][_0x4653('0x38')]);_0x4c293e['where']=qs['filters'](_[_0x4653('0x3a')](_0xfb4445[_0x4653('0x30')],_0x581c1f[_0x4653('0x32')]));if(_0xfb4445[_0x4653('0x30')][_0x4653('0x3b')]){_0x4c293e[_0x4653('0x39')]=_[_0x4653('0x3c')](_0x4c293e[_0x4653('0x39')],{'$or':_[_0x4653('0x2f')](_0x4c293e[_0x4653('0x34')],function(_0x28570e){var _0x16342d={};_0x16342d[_0x28570e]={'$like':'%'+_0xfb4445[_0x4653('0x30')][_0x4653('0x3b')]+'%'};return _0x16342d;})});}_0x4c293e=_[_0x4653('0x3c')]({},_0x4c293e,_0xfb4445['options']);return _0x4da93b['getDescriptions'](_0x4c293e);}})[_0x4653('0x25')](function(_0x496b54){if(_0x496b54){_0xfdcbe7=_0x496b54['length'];if(!_0xfb4445[_0x4653('0x30')][_0x4653('0x36')](_0x4653('0x37'))){_0x4c293e['limit']=qs[_0x4653('0x1d')](_0xfb4445[_0x4653('0x30')][_0x4653('0x1d')]);_0x4c293e['offset']=qs['offset'](_0xfb4445['query']['offset']);}return _0x4da93b[_0x4653('0x50')](_0x4c293e);}})['then'](function(_0x522523){if(_0x522523){return _0x522523?{'count':_0xfdcbe7,'rows':_0x522523}:null;}})[_0x4653('0x25')](respondWithResult(_0x4e484b,null))['catch'](handleError(_0x4e484b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 4759e77..c61348f 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 _0x22ea=['bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','moment'];(function(_0x592c25,_0x1ff31a){var _0x13cd90=function(_0x1edb53){while(--_0x1edb53){_0x592c25['push'](_0x592c25['shift']());}};_0x13cd90(++_0x1ff31a);}(_0x22ea,0xa5));var _0xa22e=function(_0x30e137,_0x3f8408){_0x30e137=_0x30e137-0x0;var _0x19d31c=_0x22ea[_0x30e137];return _0x19d31c;};'use strict';var _=require('lodash');var util=require(_0xa22e('0x0'));var logger=require(_0xa22e('0x1'))('api');var moment=require(_0xa22e('0x2'));var BPromise=require(_0xa22e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa22e('0x4'));var rimraf=require(_0xa22e('0x5'));var config=require(_0xa22e('0x6'));var attributes=require(_0xa22e('0x7'));module[_0xa22e('0x8')]=function(_0x27efb1,_0x240f55){return _0x27efb1[_0xa22e('0x9')](_0xa22e('0xa'),attributes,{'tableName':_0xa22e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb01a=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','util','../../config/logger','api'];(function(_0x5d949e,_0x555707){var _0x445c1e=function(_0x160f2a){while(--_0x160f2a){_0x5d949e['push'](_0x5d949e['shift']());}};_0x445c1e(++_0x555707);}(_0xb01a,0x159));var _0xab01=function(_0x4b2693,_0x29f874){_0x4b2693=_0x4b2693-0x0;var _0x1957d7=_0xb01a[_0x4b2693];return _0x1957d7;};'use strict';var _=require('lodash');var util=require(_0xab01('0x0'));var logger=require(_0xab01('0x1'))(_0xab01('0x2'));var moment=require(_0xab01('0x3'));var BPromise=require(_0xab01('0x4'));var rp=require(_0xab01('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab01('0x6'));var config=require(_0xab01('0x7'));var attributes=require(_0xab01('0x8'));module[_0xab01('0x9')]=function(_0x1c591a,_0x57034d){return _0x1c591a[_0xab01('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0xab01('0xb'),'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 545648f..2338415 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 _0x4778=['moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4536ec,_0x4089fd){var _0x4015e5=function(_0x53ea9e){while(--_0x53ea9e){_0x4536ec['push'](_0x4536ec['shift']());}};_0x4015e5(++_0x4089fd);}(_0x4778,0x8a));var _0x8477=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x4778[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x8477('0x0'));var util=require(_0x8477('0x1'));var moment=require(_0x8477('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8477('0x3'));var db=require(_0x8477('0x4'))['db'];var utils=require(_0x8477('0x5'));var logger=require('../../config/logger')(_0x8477('0x6'));var config=require('../../config/environment');var jayson=require(_0x8477('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bc8ed,_0x10f275,_0x4d07b5){return new BPromise(function(_0x13ded6,_0x21f867){return client[_0x8477('0x8')](_0x5bc8ed,_0x4d07b5)['then'](function(_0x4d6eef){logger[_0x8477('0x9')](_0x8477('0xa'),_0x10f275,_0x8477('0xb'));logger[_0x8477('0xc')](_0x8477('0xd'),_0x10f275,_0x8477('0xb'),JSON[_0x8477('0xe')](_0x4d6eef));if(_0x4d6eef[_0x8477('0xf')]){if(_0x4d6eef[_0x8477('0xf')][_0x8477('0x10')]===0x1f4){logger[_0x8477('0xf')](_0x8477('0xa'),_0x10f275,_0x4d6eef[_0x8477('0xf')][_0x8477('0x11')]);return _0x21f867(_0x4d6eef[_0x8477('0xf')]['message']);}logger['error'](_0x8477('0xa'),_0x10f275,_0x4d6eef[_0x8477('0xf')]['message']);return _0x13ded6(_0x4d6eef[_0x8477('0xf')]['message']);}else{logger[_0x8477('0x9')](_0x8477('0xa'),_0x10f275,_0x8477('0xb'));_0x13ded6(_0x4d6eef[_0x8477('0x12')]['message']);}})[_0x8477('0x13')](function(_0x374f20){logger['error'](_0x8477('0xa'),_0x10f275,_0x374f20);_0x21f867(_0x374f20);});});} \ No newline at end of file +var _0x30ab=['randomstring','ioredis','../../config/utils','rpc','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x568a3d,_0x49c572){var _0x15c026=function(_0x26cc3f){while(--_0x26cc3f){_0x568a3d['push'](_0x568a3d['shift']());}};_0x15c026(++_0x49c572);}(_0x30ab,0x1a1));var _0xb30a=function(_0x121d33,_0x3cf3e7){_0x121d33=_0x121d33-0x0;var _0x328d6b=_0x30ab[_0x121d33];return _0x328d6b;};'use strict';var _=require(_0xb30a('0x0'));var util=require('util');var moment=require(_0xb30a('0x1'));var BPromise=require(_0xb30a('0x2'));var rs=require(_0xb30a('0x3'));var fs=require('fs');var Redis=require(_0xb30a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb30a('0x5'));var logger=require('../../config/logger')(_0xb30a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb30a('0x7')][_0xb30a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x337637,_0x27c394,_0x36d82d){return new BPromise(function(_0x51d41f,_0xe87372){return client[_0xb30a('0x9')](_0x337637,_0x36d82d)[_0xb30a('0xa')](function(_0x417774){logger['info'](_0xb30a('0xb'),_0x27c394,_0xb30a('0xc'));logger[_0xb30a('0xd')](_0xb30a('0xe'),_0x27c394,_0xb30a('0xc'),JSON[_0xb30a('0xf')](_0x417774));if(_0x417774[_0xb30a('0x10')]){if(_0x417774[_0xb30a('0x10')][_0xb30a('0x11')]===0x1f4){logger[_0xb30a('0x10')](_0xb30a('0xb'),_0x27c394,_0x417774[_0xb30a('0x10')]['message']);return _0xe87372(_0x417774[_0xb30a('0x10')][_0xb30a('0x12')]);}logger[_0xb30a('0x10')](_0xb30a('0xb'),_0x27c394,_0x417774[_0xb30a('0x10')]['message']);return _0x51d41f(_0x417774[_0xb30a('0x10')]['message']);}else{logger['info'](_0xb30a('0xb'),_0x27c394,'request\x20sent');_0x51d41f(_0x417774[_0xb30a('0x13')][_0xb30a('0x12')]);}})['catch'](function(_0x25d687){logger['error'](_0xb30a('0xb'),_0x27c394,_0x25d687);_0xe87372(_0x25d687);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 05ee9f1..471edea 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 _0x4bb6=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x58159f,_0x34dff8){var _0x28a7b8=function(_0xecedf2){while(--_0xecedf2){_0x58159f['push'](_0x58159f['shift']());}};_0x28a7b8(++_0x34dff8);}(_0x4bb6,0x10a));var _0x64bb=function(_0x104b8d,_0x5cb754){_0x104b8d=_0x104b8d-0x0;var _0x465a1a=_0x4bb6[_0x104b8d];return _0x465a1a;};'use strict';var multer=require(_0x64bb('0x0'));var util=require('util');var path=require(_0x64bb('0x1'));var timeout=require(_0x64bb('0x2'));var express=require(_0x64bb('0x3'));var router=express['Router']();var fs_extra=require(_0x64bb('0x4'));var auth=require(_0x64bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x64bb('0x6'));var controller=require(_0x64bb('0x7'));router[_0x64bb('0x8')]('/',auth[_0x64bb('0x9')](),controller[_0x64bb('0xa')]);router['get'](_0x64bb('0xb'),auth['isAuthenticated'](),controller[_0x64bb('0xc')]);router['post']('/',auth[_0x64bb('0x9')](),controller[_0x64bb('0xd')]);router['put'](_0x64bb('0xb'),auth[_0x64bb('0x9')](),controller[_0x64bb('0xe')]);router[_0x64bb('0xf')](_0x64bb('0xb'),auth[_0x64bb('0x9')](),controller[_0x64bb('0x10')]);module['exports']=router; \ No newline at end of file +var _0x52e1=['../../config/environment','./intSugarcrmField.controller','get','/:id','isAuthenticated','show','post','put','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service'];(function(_0x26b4ce,_0x17679d){var _0x34a3f0=function(_0x3f595d){while(--_0x3f595d){_0x26b4ce['push'](_0x26b4ce['shift']());}};_0x34a3f0(++_0x17679d);}(_0x52e1,0x12a));var _0x152e=function(_0xe6beba,_0x3f15d1){_0xe6beba=_0xe6beba-0x0;var _0x2f1c08=_0x52e1[_0xe6beba];return _0x2f1c08;};'use strict';var multer=require(_0x152e('0x0'));var util=require(_0x152e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x152e('0x2'));var router=express[_0x152e('0x3')]();var fs_extra=require(_0x152e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x152e('0x5'));var config=require(_0x152e('0x6'));var controller=require(_0x152e('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x152e('0x8')](_0x152e('0x9'),auth[_0x152e('0xa')](),controller[_0x152e('0xb')]);router[_0x152e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x152e('0xd')](_0x152e('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x152e('0xe')](_0x152e('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x152e('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 7c3457f..3b3a6fb 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 _0x1916=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x1916,0x1d2));var _0x6191=function(_0x2705e7,_0x41921a){_0x2705e7=_0x2705e7-0x0;var _0x125767=_0x1916[_0x2705e7];return _0x125767;};'use strict';var Sequelize=require(_0x6191('0x0'));module[_0x6191('0x1')]={'type':{'type':Sequelize[_0x6191('0x2')](_0x6191('0x3'),_0x6191('0x4'),_0x6191('0x5'),_0x6191('0x6'),'picklist'),'defaultValue':_0x6191('0x3')},'content':{'type':Sequelize[_0x6191('0x7')]},'key':{'type':Sequelize[_0x6191('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6191('0x3'),_0x6191('0x4'),_0x6191('0x5'))},'keyContent':{'type':Sequelize[_0x6191('0x7')]},'idField':{'type':Sequelize[_0x6191('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6191('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6191('0x7')]}}; \ No newline at end of file +var _0xf4b4=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf4b4,0xe6));var _0x4f4b=function(_0x4a2cc2,_0x1fbafa){_0x4a2cc2=_0x4a2cc2-0x0;var _0x3f5f5c=_0xf4b4[_0x4a2cc2];return _0x3f5f5c;};'use strict';var Sequelize=require(_0x4f4b('0x0'));module[_0x4f4b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4f4b('0x2'),_0x4f4b('0x3'),_0x4f4b('0x4'),_0x4f4b('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x4f4b('0x6')]},'key':{'type':Sequelize[_0x4f4b('0x6')]},'keyType':{'type':Sequelize[_0x4f4b('0x7')](_0x4f4b('0x2'),_0x4f4b('0x3'),_0x4f4b('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4f4b('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4f4b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4f4b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1e464a4..810b859 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 _0x8461=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','include','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key'];(function(_0x5322e1,_0x5bc686){var _0xe6d194=function(_0x4ef804){while(--_0x4ef804){_0x5322e1['push'](_0x5322e1['shift']());}};_0xe6d194(++_0x5bc686);}(_0x8461,0xb5));var _0x1846=function(_0x3f43fa,_0x1ccd65){_0x3f43fa=_0x3f43fa-0x0;var _0x3cf4bb=_0x8461[_0x3f43fa];return _0x3cf4bb;};'use strict';var emlformat=require(_0x1846('0x0'));var rimraf=require(_0x1846('0x1'));var zipdir=require(_0x1846('0x2'));var jsonpatch=require(_0x1846('0x3'));var rp=require(_0x1846('0x4'));var moment=require('moment');var BPromise=require(_0x1846('0x5'));var Mustache=require(_0x1846('0x6'));var util=require(_0x1846('0x7'));var path=require('path');var sox=require(_0x1846('0x8'));var csv=require(_0x1846('0x9'));var ejs=require(_0x1846('0xa'));var fs=require('fs');var fs_extra=require(_0x1846('0xb'));var _=require(_0x1846('0xc'));var squel=require(_0x1846('0xd'));var crypto=require(_0x1846('0xe'));var jsforce=require(_0x1846('0xf'));var deskjs=require(_0x1846('0x10'));var toCsv=require(_0x1846('0x9'));var querystring=require('querystring');var Papa=require(_0x1846('0x11'));var Redis=require(_0x1846('0x12'));var authService=require(_0x1846('0x13'));var qs=require(_0x1846('0x14'));var as=require(_0x1846('0x15'));var hardwareService=require(_0x1846('0x16'));var logger=require(_0x1846('0x17'))('api');var utils=require(_0x1846('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1846('0x19'))['db'];function respondWithStatusCode(_0x45c842,_0x1e984b){_0x1e984b=_0x1e984b||0xcc;return function(_0x2a4664){if(_0x2a4664){return _0x45c842[_0x1846('0x1a')](_0x1e984b);}return _0x45c842['status'](_0x1e984b)[_0x1846('0x1b')]();};}function respondWithResult(_0x3ee679,_0x1a1b76){_0x1a1b76=_0x1a1b76||0xc8;return function(_0x4fc7c2){if(_0x4fc7c2){return _0x3ee679[_0x1846('0x1c')](_0x1a1b76)[_0x1846('0x1d')](_0x4fc7c2);}};}function respondWithFilteredResult(_0x167e9b,_0x42eb88){return function(_0x25b6a6){if(_0x25b6a6){var _0x32af2c=typeof _0x42eb88[_0x1846('0x1e')]==='undefined'&&typeof _0x42eb88[_0x1846('0x1f')]===_0x1846('0x20');var _0xffda05=_0x25b6a6[_0x1846('0x21')];var _0xfee976=_0x32af2c?0x0:_0x42eb88[_0x1846('0x1e')];var _0x3c1b02=_0x32af2c?_0x25b6a6['count']:_0x42eb88['offset']+_0x42eb88[_0x1846('0x1f')];var _0xe686ca;if(_0x3c1b02>=_0xffda05){_0x3c1b02=_0xffda05;_0xe686ca=0xc8;}else{_0xe686ca=0xce;}_0x167e9b[_0x1846('0x1c')](_0xe686ca);return _0x167e9b[_0x1846('0x22')](_0x1846('0x23'),_0xfee976+'-'+_0x3c1b02+'/'+_0xffda05)[_0x1846('0x1d')](_0x25b6a6);}return null;};}function patchUpdates(_0x4da8a0){return function(_0x54b93b){try{jsonpatch[_0x1846('0x24')](_0x54b93b,_0x4da8a0,!![]);}catch(_0x34dad2){return BPromise[_0x1846('0x25')](_0x34dad2);}return _0x54b93b['save']();};}function saveUpdates(_0x524431,_0x174949){return function(_0x46e7c2){if(_0x46e7c2){return _0x46e7c2['update'](_0x524431)[_0x1846('0x26')](function(_0x456e3f){return _0x456e3f;});}return null;};}function removeEntity(_0x911f1c,_0x1bde5d){return function(_0x58d6e1){if(_0x58d6e1){return _0x58d6e1[_0x1846('0x27')]()['then'](function(){_0x911f1c['status'](0xcc)[_0x1846('0x1b')]();});}};}function handleEntityNotFound(_0x49da7a,_0x1cede5){return function(_0x283760){if(!_0x283760){_0x49da7a[_0x1846('0x1a')](0x194);}return _0x283760;};}function handleError(_0xa90898,_0x5e3460){_0x5e3460=_0x5e3460||0x1f4;return function(_0x2306b2){logger[_0x1846('0x28')](_0x2306b2['stack']);if(_0x2306b2['name']){delete _0x2306b2[_0x1846('0x29')];}_0xa90898[_0x1846('0x1c')](_0x5e3460)[_0x1846('0x2a')](_0x2306b2);};}exports[_0x1846('0x2b')]=function(_0x45a173,_0x82218a){var _0x4a6a84={},_0x14164d={},_0x11b1c6={'count':0x0,'rows':[]};var _0x1850b8=_[_0x1846('0x2c')](db[_0x1846('0x2d')][_0x1846('0x2e')],function(_0x58e276){return{'name':_0x58e276[_0x1846('0x2f')],'type':_0x58e276[_0x1846('0x30')][_0x1846('0x31')]};});_0x14164d[_0x1846('0x32')]=_[_0x1846('0x2c')](_0x1850b8,'name');_0x14164d[_0x1846('0x33')]=_['keys'](_0x45a173[_0x1846('0x33')]);_0x14164d[_0x1846('0x34')]=_[_0x1846('0x35')](_0x14164d['model'],_0x14164d[_0x1846('0x33')]);_0x4a6a84[_0x1846('0x36')]=_[_0x1846('0x35')](_0x14164d['model'],qs['fields'](_0x45a173[_0x1846('0x33')][_0x1846('0x37')]));_0x4a6a84[_0x1846('0x36')]=_0x4a6a84[_0x1846('0x36')][_0x1846('0x38')]?_0x4a6a84[_0x1846('0x36')]:_0x14164d['model'];if(!_0x45a173[_0x1846('0x33')][_0x1846('0x39')]('nolimit')){_0x4a6a84[_0x1846('0x1f')]=qs[_0x1846('0x1f')](_0x45a173[_0x1846('0x33')][_0x1846('0x1f')]);_0x4a6a84[_0x1846('0x1e')]=qs[_0x1846('0x1e')](_0x45a173[_0x1846('0x33')]['offset']);}_0x4a6a84[_0x1846('0x3a')]=qs[_0x1846('0x3b')](_0x45a173[_0x1846('0x33')]['sort']);_0x4a6a84['where']=qs['filters'](_[_0x1846('0x3c')](_0x45a173['query'],_0x14164d[_0x1846('0x34')]),_0x1850b8);if(_0x45a173[_0x1846('0x33')]['filter']){_0x4a6a84[_0x1846('0x3d')]=_['merge'](_0x4a6a84[_0x1846('0x3d')],{'$or':_[_0x1846('0x2c')](_0x1850b8,function(_0x219d61){if(_0x219d61['type']!==_0x1846('0x3e')){var _0x12eb1c={};_0x12eb1c[_0x219d61['name']]={'$like':'%'+_0x45a173[_0x1846('0x33')][_0x1846('0x3f')]+'%'};return _0x12eb1c;}})});}_0x4a6a84=_[_0x1846('0x40')]({},_0x4a6a84,_0x45a173[_0x1846('0x41')]);var _0x28da45={'where':_0x4a6a84[_0x1846('0x3d')]};return db[_0x1846('0x2d')][_0x1846('0x21')](_0x28da45)[_0x1846('0x26')](function(_0x32c097){_0x11b1c6['count']=_0x32c097;if(_0x45a173['query'][_0x1846('0x42')]){_0x4a6a84['include']=[{'all':!![]}];}return db[_0x1846('0x2d')][_0x1846('0x43')](_0x4a6a84);})[_0x1846('0x26')](function(_0x5c62f6){_0x11b1c6['rows']=_0x5c62f6;return _0x11b1c6;})[_0x1846('0x26')](respondWithFilteredResult(_0x82218a,_0x4a6a84))[_0x1846('0x44')](handleError(_0x82218a,null));};exports[_0x1846('0x45')]=function(_0x22d149,_0xc15af1){var _0x4b2320={'raw':!![],'where':{'id':_0x22d149[_0x1846('0x46')]['id']}},_0x2ac452={};_0x2ac452[_0x1846('0x32')]=_[_0x1846('0x47')](db[_0x1846('0x2d')]['rawAttributes']);_0x2ac452[_0x1846('0x33')]=_['keys'](_0x22d149[_0x1846('0x33')]);_0x2ac452[_0x1846('0x34')]=_[_0x1846('0x35')](_0x2ac452[_0x1846('0x32')],_0x2ac452['query']);_0x4b2320[_0x1846('0x36')]=_['intersection'](_0x2ac452['model'],qs['fields'](_0x22d149[_0x1846('0x33')]['fields']));_0x4b2320[_0x1846('0x36')]=_0x4b2320['attributes'][_0x1846('0x38')]?_0x4b2320[_0x1846('0x36')]:_0x2ac452[_0x1846('0x32')];if(_0x22d149[_0x1846('0x33')][_0x1846('0x42')]){_0x4b2320[_0x1846('0x48')]=[{'all':!![]}];}_0x4b2320=_[_0x1846('0x40')]({},_0x4b2320,_0x22d149[_0x1846('0x41')]);return db[_0x1846('0x2d')][_0x1846('0x49')](_0x4b2320)[_0x1846('0x26')](handleEntityNotFound(_0xc15af1,null))['then'](respondWithResult(_0xc15af1,null))[_0x1846('0x44')](handleError(_0xc15af1,null));};exports[_0x1846('0x4a')]=function(_0x5b8a75,_0x409b90){return db[_0x1846('0x2d')][_0x1846('0x4a')](_0x5b8a75['body'],{})['then'](respondWithResult(_0x409b90,0xc9))['catch'](handleError(_0x409b90,null));};exports[_0x1846('0x4b')]=function(_0x5072f6,_0x35ecb9){if(_0x5072f6[_0x1846('0x4c')]['id']){delete _0x5072f6[_0x1846('0x4c')]['id'];}return db['SugarcrmField'][_0x1846('0x49')]({'where':{'id':_0x5072f6[_0x1846('0x46')]['id']}})[_0x1846('0x26')](handleEntityNotFound(_0x35ecb9,null))[_0x1846('0x26')](saveUpdates(_0x5072f6[_0x1846('0x4c')],null))[_0x1846('0x26')](respondWithResult(_0x35ecb9,null))[_0x1846('0x44')](handleError(_0x35ecb9,null));};exports[_0x1846('0x27')]=function(_0x5708a9,_0x389689){return db[_0x1846('0x2d')]['find']({'where':{'id':_0x5708a9[_0x1846('0x46')]['id']}})[_0x1846('0x26')](handleEntityNotFound(_0x389689,null))[_0x1846('0x26')](removeEntity(_0x389689,null))['catch'](handleError(_0x389689,null));}; \ No newline at end of file +var _0xf28e=['index','SugarcrmField','fieldName','type','model','map','filters','intersection','query','attributes','fields','nolimit','where','pick','filter','merge','includeAll','rows','catch','show','params','keys','rawAttributes','include','options','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','name'];(function(_0x313303,_0x50cdfb){var _0x1e7316=function(_0x4f797e){while(--_0x4f797e){_0x313303['push'](_0x313303['shift']());}};_0x1e7316(++_0x50cdfb);}(_0xf28e,0xeb));var _0xef28=function(_0x5944e9,_0xf3da60){_0x5944e9=_0x5944e9-0x0;var _0x1098b8=_0xf28e[_0x5944e9];return _0x1098b8;};'use strict';var emlformat=require(_0xef28('0x0'));var rimraf=require(_0xef28('0x1'));var zipdir=require(_0xef28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef28('0x3'));var moment=require(_0xef28('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xef28('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef28('0x6'));var _=require(_0xef28('0x7'));var squel=require(_0xef28('0x8'));var crypto=require(_0xef28('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xef28('0xa'));var toCsv=require(_0xef28('0xb'));var querystring=require('querystring');var Papa=require(_0xef28('0xc'));var Redis=require(_0xef28('0xd'));var authService=require(_0xef28('0xe'));var qs=require(_0xef28('0xf'));var as=require(_0xef28('0x10'));var hardwareService=require(_0xef28('0x11'));var logger=require(_0xef28('0x12'))(_0xef28('0x13'));var utils=require(_0xef28('0x14'));var config=require(_0xef28('0x15'));var licenseUtil=require(_0xef28('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xca263b,_0x4cc893){_0x4cc893=_0x4cc893||0xcc;return function(_0x19cac3){if(_0x19cac3){return _0xca263b[_0xef28('0x17')](_0x4cc893);}return _0xca263b[_0xef28('0x18')](_0x4cc893)['end']();};}function respondWithResult(_0x2a30a0,_0x3e1528){_0x3e1528=_0x3e1528||0xc8;return function(_0x24f15d){if(_0x24f15d){return _0x2a30a0['status'](_0x3e1528)[_0xef28('0x19')](_0x24f15d);}};}function respondWithFilteredResult(_0x508f99,_0x2f946d){return function(_0x495e32){if(_0x495e32){var _0x23550b=typeof _0x2f946d[_0xef28('0x1a')]===_0xef28('0x1b')&&typeof _0x2f946d[_0xef28('0x1c')]==='undefined';var _0x4c5f12=_0x495e32[_0xef28('0x1d')];var _0x316c09=_0x23550b?0x0:_0x2f946d['offset'];var _0x11a207=_0x23550b?_0x495e32[_0xef28('0x1d')]:_0x2f946d[_0xef28('0x1a')]+_0x2f946d['limit'];var _0x4db800;if(_0x11a207>=_0x4c5f12){_0x11a207=_0x4c5f12;_0x4db800=0xc8;}else{_0x4db800=0xce;}_0x508f99[_0xef28('0x18')](_0x4db800);return _0x508f99[_0xef28('0x1e')]('Content-Range',_0x316c09+'-'+_0x11a207+'/'+_0x4c5f12)[_0xef28('0x19')](_0x495e32);}return null;};}function patchUpdates(_0x2902f5){return function(_0x2c47c0){try{jsonpatch[_0xef28('0x1f')](_0x2c47c0,_0x2902f5,!![]);}catch(_0x5a18d1){return BPromise[_0xef28('0x20')](_0x5a18d1);}return _0x2c47c0[_0xef28('0x21')]();};}function saveUpdates(_0x5f34c5,_0x440bc4){return function(_0x36459d){if(_0x36459d){return _0x36459d[_0xef28('0x22')](_0x5f34c5)['then'](function(_0x31413e){return _0x31413e;});}return null;};}function removeEntity(_0x45414e,_0x1c0278){return function(_0x10084c){if(_0x10084c){return _0x10084c[_0xef28('0x23')]()[_0xef28('0x24')](function(){_0x45414e[_0xef28('0x18')](0xcc)[_0xef28('0x25')]();});}};}function handleEntityNotFound(_0xfd3c0b,_0x14802a){return function(_0x24d13a){if(!_0x24d13a){_0xfd3c0b['sendStatus'](0x194);}return _0x24d13a;};}function handleError(_0x3eee99,_0x287abb){_0x287abb=_0x287abb||0x1f4;return function(_0x4d2ee3){logger[_0xef28('0x26')](_0x4d2ee3[_0xef28('0x27')]);if(_0x4d2ee3['name']){delete _0x4d2ee3[_0xef28('0x28')];}_0x3eee99[_0xef28('0x18')](_0x287abb)['send'](_0x4d2ee3);};}exports[_0xef28('0x29')]=function(_0x54026a,_0x2c2de3){var _0x1520dd={},_0x3ede1a={},_0x138b76={'count':0x0,'rows':[]};var _0x5450f8=_['map'](db[_0xef28('0x2a')]['rawAttributes'],function(_0x4808af){return{'name':_0x4808af[_0xef28('0x2b')],'type':_0x4808af[_0xef28('0x2c')]['key']};});_0x3ede1a[_0xef28('0x2d')]=_[_0xef28('0x2e')](_0x5450f8,_0xef28('0x28'));_0x3ede1a['query']=_['keys'](_0x54026a['query']);_0x3ede1a[_0xef28('0x2f')]=_[_0xef28('0x30')](_0x3ede1a[_0xef28('0x2d')],_0x3ede1a[_0xef28('0x31')]);_0x1520dd[_0xef28('0x32')]=_[_0xef28('0x30')](_0x3ede1a['model'],qs[_0xef28('0x33')](_0x54026a[_0xef28('0x31')]['fields']));_0x1520dd[_0xef28('0x32')]=_0x1520dd[_0xef28('0x32')]['length']?_0x1520dd['attributes']:_0x3ede1a[_0xef28('0x2d')];if(!_0x54026a[_0xef28('0x31')]['hasOwnProperty'](_0xef28('0x34'))){_0x1520dd[_0xef28('0x1c')]=qs[_0xef28('0x1c')](_0x54026a[_0xef28('0x31')]['limit']);_0x1520dd[_0xef28('0x1a')]=qs['offset'](_0x54026a['query'][_0xef28('0x1a')]);}_0x1520dd['order']=qs['sort'](_0x54026a[_0xef28('0x31')]['sort']);_0x1520dd[_0xef28('0x35')]=qs[_0xef28('0x2f')](_[_0xef28('0x36')](_0x54026a[_0xef28('0x31')],_0x3ede1a[_0xef28('0x2f')]),_0x5450f8);if(_0x54026a[_0xef28('0x31')][_0xef28('0x37')]){_0x1520dd[_0xef28('0x35')]=_[_0xef28('0x38')](_0x1520dd[_0xef28('0x35')],{'$or':_[_0xef28('0x2e')](_0x5450f8,function(_0x1e8502){if(_0x1e8502[_0xef28('0x2c')]!=='VIRTUAL'){var _0x35e104={};_0x35e104[_0x1e8502[_0xef28('0x28')]]={'$like':'%'+_0x54026a[_0xef28('0x31')]['filter']+'%'};return _0x35e104;}})});}_0x1520dd=_[_0xef28('0x38')]({},_0x1520dd,_0x54026a['options']);var _0x4c83d2={'where':_0x1520dd[_0xef28('0x35')]};return db[_0xef28('0x2a')][_0xef28('0x1d')](_0x4c83d2)[_0xef28('0x24')](function(_0x4d01e4){_0x138b76[_0xef28('0x1d')]=_0x4d01e4;if(_0x54026a[_0xef28('0x31')][_0xef28('0x39')]){_0x1520dd['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x1520dd);})[_0xef28('0x24')](function(_0x4c704a){_0x138b76[_0xef28('0x3a')]=_0x4c704a;return _0x138b76;})['then'](respondWithFilteredResult(_0x2c2de3,_0x1520dd))[_0xef28('0x3b')](handleError(_0x2c2de3,null));};exports[_0xef28('0x3c')]=function(_0x338e36,_0x16d917){var _0x1c98d4={'raw':!![],'where':{'id':_0x338e36[_0xef28('0x3d')]['id']}},_0xccd5c6={};_0xccd5c6[_0xef28('0x2d')]=_[_0xef28('0x3e')](db[_0xef28('0x2a')][_0xef28('0x3f')]);_0xccd5c6[_0xef28('0x31')]=_['keys'](_0x338e36['query']);_0xccd5c6[_0xef28('0x2f')]=_[_0xef28('0x30')](_0xccd5c6[_0xef28('0x2d')],_0xccd5c6['query']);_0x1c98d4[_0xef28('0x32')]=_[_0xef28('0x30')](_0xccd5c6[_0xef28('0x2d')],qs[_0xef28('0x33')](_0x338e36[_0xef28('0x31')][_0xef28('0x33')]));_0x1c98d4['attributes']=_0x1c98d4['attributes']['length']?_0x1c98d4['attributes']:_0xccd5c6['model'];if(_0x338e36[_0xef28('0x31')][_0xef28('0x39')]){_0x1c98d4[_0xef28('0x40')]=[{'all':!![]}];}_0x1c98d4=_[_0xef28('0x38')]({},_0x1c98d4,_0x338e36[_0xef28('0x41')]);return db[_0xef28('0x2a')]['find'](_0x1c98d4)[_0xef28('0x24')](handleEntityNotFound(_0x16d917,null))[_0xef28('0x24')](respondWithResult(_0x16d917,null))[_0xef28('0x3b')](handleError(_0x16d917,null));};exports[_0xef28('0x42')]=function(_0x18224f,_0x61a2fc){return db['SugarcrmField'][_0xef28('0x42')](_0x18224f[_0xef28('0x43')],{})[_0xef28('0x24')](respondWithResult(_0x61a2fc,0xc9))[_0xef28('0x3b')](handleError(_0x61a2fc,null));};exports[_0xef28('0x22')]=function(_0x2306f9,_0x3f5484){if(_0x2306f9['body']['id']){delete _0x2306f9[_0xef28('0x43')]['id'];}return db[_0xef28('0x2a')][_0xef28('0x44')]({'where':{'id':_0x2306f9[_0xef28('0x3d')]['id']}})[_0xef28('0x24')](handleEntityNotFound(_0x3f5484,null))['then'](saveUpdates(_0x2306f9['body'],null))[_0xef28('0x24')](respondWithResult(_0x3f5484,null))[_0xef28('0x3b')](handleError(_0x3f5484,null));};exports[_0xef28('0x23')]=function(_0x468a43,_0x3eb5c1){return db['SugarcrmField'][_0xef28('0x44')]({'where':{'id':_0x468a43[_0xef28('0x3d')]['id']}})[_0xef28('0x24')](handleEntityNotFound(_0x3eb5c1,null))[_0xef28('0x24')](removeEntity(_0x3eb5c1,null))[_0xef28('0x3b')](handleError(_0x3eb5c1,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 2004d69..0fd238a 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 _0x7fb5=['exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./intSugarcrmField.attributes'];(function(_0x57407c,_0x239176){var _0x1a9e68=function(_0x22e2b6){while(--_0x22e2b6){_0x57407c['push'](_0x57407c['shift']());}};_0x1a9e68(++_0x239176);}(_0x7fb5,0x124));var _0x57fb=function(_0xfc4b1f,_0x85c37f){_0xfc4b1f=_0xfc4b1f-0x0;var _0x44b59f=_0x7fb5[_0xfc4b1f];return _0x44b59f;};'use strict';var _=require(_0x57fb('0x0'));var util=require(_0x57fb('0x1'));var logger=require(_0x57fb('0x2'))('api');var moment=require(_0x57fb('0x3'));var BPromise=require('bluebird');var rp=require(_0x57fb('0x4'));var fs=require('fs');var path=require(_0x57fb('0x5'));var rimraf=require(_0x57fb('0x6'));var config=require('../../config/environment');var attributes=require(_0x57fb('0x7'));module[_0x57fb('0x8')]=function(_0x2a76a3,_0x18e170){return _0x2a76a3[_0x57fb('0x9')](_0x57fb('0xa'),attributes,{'tableName':_0x57fb('0xb'),'paranoid':![],'indexes':[{'name':_0x57fb('0xc'),'fields':[_0x57fb('0xd'),_0x57fb('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2459=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x5ea15f,_0x2ee943){var _0x56908e=function(_0x34c787){while(--_0x34c787){_0x5ea15f['push'](_0x5ea15f['shift']());}};_0x56908e(++_0x2ee943);}(_0x2459,0x188));var _0x9245=function(_0x3d0098,_0x22ee82){_0x3d0098=_0x3d0098-0x0;var _0x3ef587=_0x2459[_0x3d0098];return _0x3ef587;};'use strict';var _=require(_0x9245('0x0'));var util=require(_0x9245('0x1'));var logger=require(_0x9245('0x2'))('api');var moment=require(_0x9245('0x3'));var BPromise=require(_0x9245('0x4'));var rp=require(_0x9245('0x5'));var fs=require('fs');var path=require(_0x9245('0x6'));var rimraf=require(_0x9245('0x7'));var config=require(_0x9245('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x9245('0x9')]=function(_0x30c574,_0x5d7087){return _0x30c574[_0x9245('0xa')]('SugarcrmField',attributes,{'tableName':_0x9245('0xb'),'paranoid':![],'indexes':[{'name':_0x9245('0xc'),'fields':[_0x9245('0xd'),_0x9245('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 2faa217..9324785 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 _0xa2db=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x377089,_0xb071f4){var _0x3896c4=function(_0x25340b){while(--_0x25340b){_0x377089['push'](_0x377089['shift']());}};_0x3896c4(++_0xb071f4);}(_0xa2db,0x138));var _0xba2d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa2db[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require(_0xba2d('0x0'));var moment=require(_0xba2d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba2d('0x2'))['db'];var utils=require(_0xba2d('0x3'));var logger=require(_0xba2d('0x4'))(_0xba2d('0x5'));var config=require(_0xba2d('0x6'));var jayson=require(_0xba2d('0x7'));var client=jayson[_0xba2d('0x8')][_0xba2d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x177c08,_0x48e68e,_0x45de3e){return new BPromise(function(_0x5e2da7,_0x2d598f){return client[_0xba2d('0xa')](_0x177c08,_0x45de3e)[_0xba2d('0xb')](function(_0x29c8f3){logger[_0xba2d('0xc')](_0xba2d('0xd'),_0x48e68e,_0xba2d('0xe'));logger[_0xba2d('0xf')](_0xba2d('0x10'),_0x48e68e,_0xba2d('0xe'),JSON[_0xba2d('0x11')](_0x29c8f3));if(_0x29c8f3[_0xba2d('0x12')]){if(_0x29c8f3[_0xba2d('0x12')][_0xba2d('0x13')]===0x1f4){logger[_0xba2d('0x12')](_0xba2d('0xd'),_0x48e68e,_0x29c8f3[_0xba2d('0x12')][_0xba2d('0x14')]);return _0x2d598f(_0x29c8f3[_0xba2d('0x12')][_0xba2d('0x14')]);}logger[_0xba2d('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x48e68e,_0x29c8f3['error'][_0xba2d('0x14')]);return _0x5e2da7(_0x29c8f3[_0xba2d('0x12')]['message']);}else{logger[_0xba2d('0xc')](_0xba2d('0xd'),_0x48e68e,_0xba2d('0xe'));_0x5e2da7(_0x29c8f3[_0xba2d('0x15')][_0xba2d('0x14')]);}})[_0xba2d('0x16')](function(_0xff3c44){logger[_0xba2d('0x12')](_0xba2d('0xd'),_0x48e68e,_0xff3c44);_0x2d598f(_0xff3c44);});});} \ No newline at end of file +var _0x85f6=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x72eae9,_0x5b9119){var _0x1a5e79=function(_0x58641e){while(--_0x58641e){_0x72eae9['push'](_0x72eae9['shift']());}};_0x1a5e79(++_0x5b9119);}(_0x85f6,0xa7));var _0x685f=function(_0x329b97,_0x359a6d){_0x329b97=_0x329b97-0x0;var _0x2d1cc0=_0x85f6[_0x329b97];return _0x2d1cc0;};'use strict';var _=require(_0x685f('0x0'));var util=require(_0x685f('0x1'));var moment=require(_0x685f('0x2'));var BPromise=require(_0x685f('0x3'));var rs=require(_0x685f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x685f('0x5'))['db'];var utils=require(_0x685f('0x6'));var logger=require(_0x685f('0x7'))('rpc');var config=require(_0x685f('0x8'));var jayson=require(_0x685f('0x9'));var client=jayson[_0x685f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bedfb,_0x447393,_0x5ce2bf){return new BPromise(function(_0xc73e41,_0x2c0aea){return client['request'](_0x2bedfb,_0x5ce2bf)[_0x685f('0xb')](function(_0xb0ce2a){logger[_0x685f('0xc')](_0x685f('0xd'),_0x447393,_0x685f('0xe'));logger[_0x685f('0xf')](_0x685f('0x10'),_0x447393,_0x685f('0xe'),JSON[_0x685f('0x11')](_0xb0ce2a));if(_0xb0ce2a['error']){if(_0xb0ce2a[_0x685f('0x12')][_0x685f('0x13')]===0x1f4){logger[_0x685f('0x12')](_0x685f('0xd'),_0x447393,_0xb0ce2a[_0x685f('0x12')][_0x685f('0x14')]);return _0x2c0aea(_0xb0ce2a[_0x685f('0x12')]['message']);}logger[_0x685f('0x12')](_0x685f('0xd'),_0x447393,_0xb0ce2a[_0x685f('0x12')][_0x685f('0x14')]);return _0xc73e41(_0xb0ce2a['error'][_0x685f('0x14')]);}else{logger[_0x685f('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x447393,'request\x20sent');_0xc73e41(_0xb0ce2a[_0x685f('0x15')]['message']);}})[_0x685f('0x16')](function(_0x47dc90){logger['error'](_0x685f('0xd'),_0x447393,_0x47dc90);_0x2c0aea(_0x47dc90);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index aaf051c..67b82f8 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 _0xccc9=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete'];(function(_0x36e868,_0x2e2fb4){var _0x46926d=function(_0x32b25d){while(--_0x32b25d){_0x36e868['push'](_0x36e868['shift']());}};_0x46926d(++_0x2e2fb4);}(_0xccc9,0xf4));var _0x9ccc=function(_0x52435c,_0x21b9db){_0x52435c=_0x52435c-0x0;var _0x50ede4=_0xccc9[_0x52435c];return _0x50ede4;};'use strict';var multer=require(_0x9ccc('0x0'));var util=require(_0x9ccc('0x1'));var path=require(_0x9ccc('0x2'));var timeout=require(_0x9ccc('0x3'));var express=require('express');var router=express[_0x9ccc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ccc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ccc('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x9ccc('0x7')]('/',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x9')]);router[_0x9ccc('0x7')](_0x9ccc('0xa'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xb')]);router[_0x9ccc('0x7')](_0x9ccc('0xc'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xd')]);router[_0x9ccc('0x7')]('/:id/fields',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xe')]);router[_0x9ccc('0xf')]('/',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x10')]);router[_0x9ccc('0xf')](_0x9ccc('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9ccc('0x11')](_0x9ccc('0xa'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x12')]);router[_0x9ccc('0x13')](_0x9ccc('0xa'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x14')]);module[_0x9ccc('0x15')]=router; \ No newline at end of file +var _0xa663=['util','connect-timeout','express','Router','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0xa663,0xc7));var _0x3a66=function(_0xd05d0e,_0x222ec6){_0xd05d0e=_0xd05d0e-0x0;var _0xa812c=_0xa663[_0xd05d0e];return _0xa812c;};'use strict';var multer=require(_0x3a66('0x0'));var util=require(_0x3a66('0x1'));var path=require('path');var timeout=require(_0x3a66('0x2'));var express=require(_0x3a66('0x3'));var router=express[_0x3a66('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3a66('0x5'));router[_0x3a66('0x6')]('/',auth['isAuthenticated'](),controller[_0x3a66('0x7')]);router['get'](_0x3a66('0x8'),auth[_0x3a66('0x9')](),controller[_0x3a66('0xa')]);router[_0x3a66('0x6')](_0x3a66('0xb'),auth[_0x3a66('0x9')](),controller['getConfigurations']);router[_0x3a66('0x6')]('/:id/fields',auth[_0x3a66('0x9')](),controller['getFields']);router[_0x3a66('0xc')]('/',auth['isAuthenticated'](),controller[_0x3a66('0xd')]);router['post'](_0x3a66('0xb'),auth['isAuthenticated'](),controller[_0x3a66('0xe')]);router[_0x3a66('0xf')](_0x3a66('0x8'),auth[_0x3a66('0x9')](),controller[_0x3a66('0x10')]);router[_0x3a66('0x11')](_0x3a66('0x8'),auth[_0x3a66('0x9')](),controller[_0x3a66('0x12')]);module[_0x3a66('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 8235eef..082ebfa 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 _0x246f=['STRING','HelpDesk','exports'];(function(_0x3474b5,_0x1a3d28){var _0x3a4ceb=function(_0x700941){while(--_0x700941){_0x3474b5['push'](_0x3474b5['shift']());}};_0x3a4ceb(++_0x1a3d28);}(_0x246f,0x119));var _0xf246=function(_0x228503,_0xefafca){_0x228503=_0x228503-0x0;var _0x3444be=_0x246f[_0x228503];return _0x3444be;};'use strict';var Sequelize=require('sequelize');module[_0xf246('0x0')]={'name':{'type':Sequelize[_0xf246('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf246('0x1')]},'username':{'type':Sequelize[_0xf246('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf246('0x1')],'allowNull':![],'defaultValue':_0xf246('0x2')},'remoteUri':{'type':Sequelize[_0xf246('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf246('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6000=['HelpDesk','sequelize','exports','STRING'];(function(_0x307c57,_0x2ff9e5){var _0x232faa=function(_0xef7f){while(--_0xef7f){_0x307c57['push'](_0x307c57['shift']());}};_0x232faa(++_0x2ff9e5);}(_0x6000,0xc1));var _0x0600=function(_0x545c56,_0x5306b0){_0x545c56=_0x545c56-0x0;var _0x1c9cea=_0x6000[_0x545c56];return _0x1c9cea;};'use strict';var Sequelize=require(_0x0600('0x0'));module[_0x0600('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0600('0x2')]},'username':{'type':Sequelize[_0x0600('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0600('0x2')],'allowNull':![],'defaultValue':_0x0600('0x3')},'remoteUri':{'type':Sequelize[_0x0600('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0600('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0600('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index ecd03c7..a8cba5b 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 _0xa138=['destroy','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','create','VtigerField','Descriptions','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','sessionName','autogenerated','owner','includes','editable','false','label','cf_','picklist','picklistValues','vTiger\x20error:\x20','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','name','send','index','map','VtigerAccount','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','find','body','params'];(function(_0x22612a,_0x331872){var _0xb1d278=function(_0x3765ea){while(--_0x3765ea){_0x22612a['push'](_0x22612a['shift']());}};_0xb1d278(++_0x331872);}(_0xa138,0xa6));var _0x8a13=function(_0x339782,_0x1a1191){_0x339782=_0x339782-0x0;var _0x298f6a=_0xa138[_0x339782];return _0x298f6a;};'use strict';var emlformat=require(_0x8a13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a13('0x1'));var jsonpatch=require(_0x8a13('0x2'));var rp=require(_0x8a13('0x3'));var moment=require(_0x8a13('0x4'));var BPromise=require(_0x8a13('0x5'));var Mustache=require(_0x8a13('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8a13('0x7'));var csv=require(_0x8a13('0x8'));var ejs=require(_0x8a13('0x9'));var fs=require('fs');var fs_extra=require(_0x8a13('0xa'));var _=require(_0x8a13('0xb'));var squel=require(_0x8a13('0xc'));var crypto=require(_0x8a13('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8a13('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8a13('0xf'));var authService=require(_0x8a13('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8a13('0x11'));var hardwareService=require(_0x8a13('0x12'));var logger=require(_0x8a13('0x13'))(_0x8a13('0x14'));var utils=require(_0x8a13('0x15'));var config=require(_0x8a13('0x16'));var licenseUtil=require(_0x8a13('0x17'));var db=require(_0x8a13('0x18'))['db'];var integrations=require(_0x8a13('0x19'));function respondWithStatusCode(_0x1bfcc4,_0x5acc22){_0x5acc22=_0x5acc22||0xcc;return function(_0x1e2ea8){if(_0x1e2ea8){return _0x1bfcc4[_0x8a13('0x1a')](_0x5acc22);}return _0x1bfcc4[_0x8a13('0x1b')](_0x5acc22)[_0x8a13('0x1c')]();};}function respondWithResult(_0x52a7d9,_0x53c8b3){_0x53c8b3=_0x53c8b3||0xc8;return function(_0x4cffcc){if(_0x4cffcc){return _0x52a7d9['status'](_0x53c8b3)['json'](_0x4cffcc);}};}function respondWithFilteredResult(_0x33130b,_0x198ece){return function(_0x45e5d6){if(_0x45e5d6){var _0x3815b0=typeof _0x198ece[_0x8a13('0x1d')]===_0x8a13('0x1e')&&typeof _0x198ece[_0x8a13('0x1f')]===_0x8a13('0x1e');var _0x1826a2=_0x45e5d6[_0x8a13('0x20')];var _0x9253ec=_0x3815b0?0x0:_0x198ece[_0x8a13('0x1d')];var _0x195339=_0x3815b0?_0x45e5d6[_0x8a13('0x20')]:_0x198ece['offset']+_0x198ece['limit'];var _0x42eeb3;if(_0x195339>=_0x1826a2){_0x195339=_0x1826a2;_0x42eeb3=0xc8;}else{_0x42eeb3=0xce;}_0x33130b[_0x8a13('0x1b')](_0x42eeb3);return _0x33130b[_0x8a13('0x21')]('Content-Range',_0x9253ec+'-'+_0x195339+'/'+_0x1826a2)[_0x8a13('0x22')](_0x45e5d6);}return null;};}function patchUpdates(_0x34e274){return function(_0x4db74b){try{jsonpatch['apply'](_0x4db74b,_0x34e274,!![]);}catch(_0x572ad6){return BPromise[_0x8a13('0x23')](_0x572ad6);}return _0x4db74b[_0x8a13('0x24')]();};}function saveUpdates(_0x4829ee,_0x2365f1){return function(_0x561420){if(_0x561420){return _0x561420[_0x8a13('0x25')](_0x4829ee)[_0x8a13('0x26')](function(_0x3a7a59){return _0x3a7a59;});}return null;};}function removeEntity(_0xec34ec,_0x1815fe){return function(_0x1e1261){if(_0x1e1261){return _0x1e1261['destroy']()['then'](function(){_0xec34ec[_0x8a13('0x1b')](0xcc)[_0x8a13('0x1c')]();});}};}function handleEntityNotFound(_0x452c62,_0x3fa24c){return function(_0x336b9b){if(!_0x336b9b){_0x452c62[_0x8a13('0x1a')](0x194);}return _0x336b9b;};}function handleError(_0x43a3f6,_0x2376ad){_0x2376ad=_0x2376ad||0x1f4;return function(_0x206f5a){logger['error'](_0x206f5a['stack']);if(_0x206f5a[_0x8a13('0x27')]){delete _0x206f5a[_0x8a13('0x27')];}_0x43a3f6[_0x8a13('0x1b')](_0x2376ad)[_0x8a13('0x28')](_0x206f5a);};}exports[_0x8a13('0x29')]=function(_0x390772,_0x2a1302){var _0xbabc36={},_0x43f3b5={},_0x5643d1={'count':0x0,'rows':[]};var _0x26c48a=_[_0x8a13('0x2a')](db[_0x8a13('0x2b')][_0x8a13('0x2c')],function(_0x1c492c){return{'name':_0x1c492c['fieldName'],'type':_0x1c492c[_0x8a13('0x2d')][_0x8a13('0x2e')]};});_0x43f3b5[_0x8a13('0x2f')]=_[_0x8a13('0x2a')](_0x26c48a,_0x8a13('0x27'));_0x43f3b5['query']=_[_0x8a13('0x30')](_0x390772['query']);_0x43f3b5[_0x8a13('0x31')]=_[_0x8a13('0x32')](_0x43f3b5[_0x8a13('0x2f')],_0x43f3b5[_0x8a13('0x33')]);_0xbabc36[_0x8a13('0x34')]=_[_0x8a13('0x32')](_0x43f3b5[_0x8a13('0x2f')],qs[_0x8a13('0x35')](_0x390772[_0x8a13('0x33')]['fields']));_0xbabc36[_0x8a13('0x34')]=_0xbabc36['attributes'][_0x8a13('0x36')]?_0xbabc36[_0x8a13('0x34')]:_0x43f3b5[_0x8a13('0x2f')];if(!_0x390772[_0x8a13('0x33')]['hasOwnProperty'](_0x8a13('0x37'))){_0xbabc36[_0x8a13('0x1f')]=qs[_0x8a13('0x1f')](_0x390772[_0x8a13('0x33')]['limit']);_0xbabc36[_0x8a13('0x1d')]=qs[_0x8a13('0x1d')](_0x390772['query']['offset']);}_0xbabc36[_0x8a13('0x38')]=qs[_0x8a13('0x39')](_0x390772['query']['sort']);_0xbabc36[_0x8a13('0x3a')]=qs[_0x8a13('0x31')](_[_0x8a13('0x3b')](_0x390772[_0x8a13('0x33')],_0x43f3b5['filters']),_0x26c48a);if(_0x390772[_0x8a13('0x33')]['filter']){_0xbabc36[_0x8a13('0x3a')]=_['merge'](_0xbabc36[_0x8a13('0x3a')],{'$or':_[_0x8a13('0x2a')](_0x26c48a,function(_0x572424){if(_0x572424[_0x8a13('0x2d')]!=='VIRTUAL'){var _0x4ff96b={};_0x4ff96b[_0x572424[_0x8a13('0x27')]]={'$like':'%'+_0x390772['query'][_0x8a13('0x3c')]+'%'};return _0x4ff96b;}})});}_0xbabc36=_[_0x8a13('0x3d')]({},_0xbabc36,_0x390772[_0x8a13('0x3e')]);var _0x16c201={'where':_0xbabc36[_0x8a13('0x3a')]};return db[_0x8a13('0x2b')][_0x8a13('0x20')](_0x16c201)[_0x8a13('0x26')](function(_0x56f4c9){_0x5643d1[_0x8a13('0x20')]=_0x56f4c9;if(_0x390772[_0x8a13('0x33')][_0x8a13('0x3f')]){_0xbabc36[_0x8a13('0x40')]=[{'all':!![]}];}return db[_0x8a13('0x2b')][_0x8a13('0x41')](_0xbabc36);})[_0x8a13('0x26')](function(_0x130bad){_0x5643d1['rows']=_0x130bad;return _0x5643d1;})[_0x8a13('0x26')](respondWithFilteredResult(_0x2a1302,_0xbabc36))[_0x8a13('0x42')](handleError(_0x2a1302,null));};exports['show']=function(_0x37d906,_0x34838f){var _0x238007={'raw':![],'where':{'id':_0x37d906['params']['id']}},_0x5ac4d6={};_0x5ac4d6[_0x8a13('0x2f')]=_[_0x8a13('0x30')](db[_0x8a13('0x2b')][_0x8a13('0x2c')]);_0x5ac4d6['query']=_['keys'](_0x37d906[_0x8a13('0x33')]);_0x5ac4d6[_0x8a13('0x31')]=_['intersection'](_0x5ac4d6[_0x8a13('0x2f')],_0x5ac4d6[_0x8a13('0x33')]);_0x238007[_0x8a13('0x34')]=_['intersection'](_0x5ac4d6[_0x8a13('0x2f')],qs[_0x8a13('0x35')](_0x37d906[_0x8a13('0x33')][_0x8a13('0x35')]));_0x238007[_0x8a13('0x34')]=_0x238007[_0x8a13('0x34')][_0x8a13('0x36')]?_0x238007[_0x8a13('0x34')]:_0x5ac4d6[_0x8a13('0x2f')];if(_0x37d906['query']['includeAll']){_0x238007[_0x8a13('0x40')]=[{'all':!![]}];}_0x238007=_['merge']({},_0x238007,_0x37d906[_0x8a13('0x3e')]);return db[_0x8a13('0x2b')][_0x8a13('0x43')](_0x238007)[_0x8a13('0x26')](handleEntityNotFound(_0x34838f,null))[_0x8a13('0x26')](respondWithResult(_0x34838f,null))['catch'](handleError(_0x34838f,null));};exports['create']=function(_0x5009ac,_0x7ea96d){return db[_0x8a13('0x2b')]['create'](_0x5009ac['body'],{})[_0x8a13('0x26')](respondWithResult(_0x7ea96d,0xc9))[_0x8a13('0x42')](handleError(_0x7ea96d,null));};exports[_0x8a13('0x25')]=function(_0xde19b6,_0x1dbed2){if(_0xde19b6[_0x8a13('0x44')]['id']){delete _0xde19b6[_0x8a13('0x44')]['id'];}return db[_0x8a13('0x2b')][_0x8a13('0x43')]({'where':{'id':_0xde19b6[_0x8a13('0x45')]['id']}})[_0x8a13('0x26')](handleEntityNotFound(_0x1dbed2,null))[_0x8a13('0x26')](saveUpdates(_0xde19b6[_0x8a13('0x44')],null))['then'](respondWithResult(_0x1dbed2,null))['catch'](handleError(_0x1dbed2,null));};exports[_0x8a13('0x46')]=function(_0x53e44e,_0x2e3e6a){return db[_0x8a13('0x2b')][_0x8a13('0x43')]({'where':{'id':_0x53e44e[_0x8a13('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e3e6a,null))[_0x8a13('0x26')](removeEntity(_0x2e3e6a,null))[_0x8a13('0x42')](handleError(_0x2e3e6a,null));};exports[_0x8a13('0x47')]=function(_0xd3dafe,_0x34ee9e,_0xf1416){var _0x5f0579={};var _0x45e766={};var _0x2292ad;var _0x42c281;return db[_0x8a13('0x2b')][_0x8a13('0x48')]({'where':{'id':_0xd3dafe[_0x8a13('0x45')]['id']}})[_0x8a13('0x26')](handleEntityNotFound(_0x34ee9e,null))[_0x8a13('0x26')](function(_0x3aee0a){if(_0x3aee0a){_0x2292ad=_0x3aee0a;_0x45e766['model']=_['keys'](db[_0x8a13('0x49')][_0x8a13('0x2c')]);_0x45e766[_0x8a13('0x33')]=_[_0x8a13('0x30')](_0xd3dafe['query']);_0x45e766[_0x8a13('0x31')]=_[_0x8a13('0x32')](_0x45e766['model'],_0x45e766[_0x8a13('0x33')]);_0x5f0579[_0x8a13('0x34')]=_[_0x8a13('0x32')](_0x45e766[_0x8a13('0x2f')],qs[_0x8a13('0x35')](_0xd3dafe[_0x8a13('0x33')]['fields']));_0x5f0579[_0x8a13('0x34')]=_0x5f0579['attributes'][_0x8a13('0x36')]?_0x5f0579[_0x8a13('0x34')]:_0x45e766[_0x8a13('0x2f')];_0x5f0579[_0x8a13('0x38')]=qs['sort'](_0xd3dafe[_0x8a13('0x33')][_0x8a13('0x39')]);_0x5f0579[_0x8a13('0x3a')]=qs[_0x8a13('0x31')](_['pick'](_0xd3dafe[_0x8a13('0x33')],_0x45e766['filters']));if(_0xd3dafe[_0x8a13('0x33')]['filter']){_0x5f0579[_0x8a13('0x3a')]=_['merge'](_0x5f0579['where'],{'$or':_[_0x8a13('0x2a')](_0x5f0579['attributes'],function(_0x355b8f){var _0x4ffd07={};_0x4ffd07[_0x355b8f]={'$like':'%'+_0xd3dafe['query'][_0x8a13('0x3c')]+'%'};return _0x4ffd07;})});}_0x5f0579=_['merge']({},_0x5f0579,_0xd3dafe['options']);return _0x2292ad[_0x8a13('0x47')](_0x5f0579);}})[_0x8a13('0x26')](function(_0x595f38){if(_0x595f38){_0x42c281=_0x595f38[_0x8a13('0x36')];if(!_0xd3dafe[_0x8a13('0x33')][_0x8a13('0x4a')](_0x8a13('0x37'))){_0x5f0579[_0x8a13('0x1f')]=qs['limit'](_0xd3dafe[_0x8a13('0x33')][_0x8a13('0x1f')]);_0x5f0579['offset']=qs[_0x8a13('0x1d')](_0xd3dafe['query'][_0x8a13('0x1d')]);}return _0x2292ad[_0x8a13('0x47')](_0x5f0579);}})[_0x8a13('0x26')](function(_0x32c896){if(_0x32c896){return _0x32c896?{'count':_0x42c281,'rows':_0x32c896}:null;}})['then'](respondWithResult(_0x34ee9e,null))['catch'](handleError(_0x34ee9e,null));};exports['addConfiguration']=function(_0x2514ac,_0x310ccd,_0x5cd083){if(_0x2514ac[_0x8a13('0x44')]['id']){delete _0x2514ac[_0x8a13('0x44')]['id'];}return db[_0x8a13('0x2b')][_0x8a13('0x48')]({'where':{'id':_0x2514ac[_0x8a13('0x45')]['id']}})['then'](handleEntityNotFound(_0x310ccd,null))[_0x8a13('0x26')](function(_0x5052ff){if(_0x5052ff){_0x2514ac['body'][_0x8a13('0x4b')]=_0x5052ff['id'];_0x2514ac[_0x8a13('0x44')][_0x8a13('0x4c')]=integrations[_0x8a13('0x4d')](_0x2514ac[_0x8a13('0x44')][_0x8a13('0x4e')],_0x2514ac[_0x8a13('0x44')]['type']);_0x2514ac[_0x8a13('0x44')]['Descriptions']=integrations[_0x8a13('0x4f')](_0x2514ac[_0x8a13('0x44')]['channel'],_0x2514ac[_0x8a13('0x44')][_0x8a13('0x2d')]);return db[_0x8a13('0x49')][_0x8a13('0x50')](_0x2514ac[_0x8a13('0x44')],{'include':[{'model':db[_0x8a13('0x51')],'as':_0x8a13('0x4c')},{'model':db[_0x8a13('0x51')],'as':_0x8a13('0x52')}]});}return null;})[_0x8a13('0x26')](respondWithResult(_0x310ccd,null))[_0x8a13('0x42')](handleError(_0x310ccd,null));};var md5=require(_0x8a13('0x53'));exports['getFields']=function(_0x441405,_0x131e77,_0x298f2d){var _0x100f70=null;var _0x4adb98=null;var _0x1d000a=null;var _0x309be0=null;var _0x1f66d2='';return db[_0x8a13('0x2b')][_0x8a13('0x48')]({'where':{'id':_0x441405['params']['id']},'attributes':['id','name',_0x8a13('0x54'),_0x8a13('0x55'),'moduleName',_0x8a13('0x56'),_0x8a13('0x57'),_0x8a13('0x58')]})[_0x8a13('0x26')](handleEntityNotFound(_0x131e77,null))['then'](function(_0x4ca7f4){if(_0x4ca7f4){_0x100f70=_0x4ca7f4['username'];_0x4adb98=_0x4ca7f4['accessKey'];_0x1d000a=_0x4ca7f4[_0x8a13('0x59')];_0x1f66d2=_0x4ca7f4['remoteUri'];var _0x11e278=_0x1f66d2[_0x8a13('0x5a')](-0x1);if(_0x11e278==='/'){_0x1f66d2=_0x1f66d2[_0x8a13('0x5b')](0x0,_0x1f66d2[_0x8a13('0x5c')](_0x11e278));}_0x309be0=util[_0x8a13('0x5d')](_0x8a13('0x5e'),_0x1f66d2);var _0x41c751={'method':_0x8a13('0x5f'),'uri':_0x309be0,'qs':{'operation':_0x8a13('0x60'),'username':_0x4ca7f4['username']},'json':!![]};return rp(_0x41c751);}})[_0x8a13('0x26')](function(_0x32b0eb){if(_0x32b0eb[_0x8a13('0x61')]){var _0x2616ad={'method':_0x8a13('0x62'),'uri':_0x309be0,'form':{'operation':_0x8a13('0x63'),'username':_0x100f70,'accessKey':md5(_0x32b0eb[_0x8a13('0x64')][_0x8a13('0x65')]+_0x4adb98)},'json':!![]};return rp(_0x2616ad);}})[_0x8a13('0x26')](function(_0x28cfd3){if(_0x28cfd3[_0x8a13('0x61')]){var _0x5655b6={'method':_0x8a13('0x5f'),'uri':_0x309be0,'qs':{'operation':'describe','username':_0x100f70,'sessionName':_0x28cfd3[_0x8a13('0x64')][_0x8a13('0x66')],'elementType':_0x1d000a},'json':!![]};return rp(_0x5655b6);}})[_0x8a13('0x26')](function(_0xda87c7){if(_0xda87c7[_0x8a13('0x61')]){var _0x33b9b3=[_0x8a13('0x67'),'reference',_0x8a13('0x68')];_['remove'](_0xda87c7['result'][_0x8a13('0x35')],function(_0x5667b3){return _0x33b9b3[_0x8a13('0x69')](_0x5667b3[_0x8a13('0x2d')][_0x8a13('0x27')]);});_['remove'](_0xda87c7[_0x8a13('0x64')][_0x8a13('0x35')],function(_0x53d918){return _0x53d918[_0x8a13('0x6a')]===_0x8a13('0x6b');});return{'count':_0xda87c7[_0x8a13('0x64')][_0x8a13('0x35')]['length'],'rows':_['map'](_0xda87c7[_0x8a13('0x64')][_0x8a13('0x35')],function(_0xf91a02){return{'id':_0xf91a02[_0x8a13('0x27')],'name':_0xf91a02[_0x8a13('0x6c')],'custom':_['startsWith'](_0xf91a02[_0x8a13('0x27')],_0x8a13('0x6d'))?!![]:![],'options':_0xf91a02[_0x8a13('0x2d')][_0x8a13('0x27')]===_0x8a13('0x6e')&&_0xf91a02[_0x8a13('0x2d')][_0x8a13('0x6f')][_0x8a13('0x36')]>0x0?_[_0x8a13('0x2a')](_0xf91a02[_0x8a13('0x2d')]['picklistValues'],function(_0x283d1e){return{'name':_0x283d1e[_0x8a13('0x6c')],'value':_0x283d1e['value']};}):[]};})};}})[_0x8a13('0x26')](respondWithResult(_0x131e77,null))[_0x8a13('0x42')](function(_0x489804){console['log'](_0x8a13('0x70')+_0x489804);var _0x500edf=_0x441405[_0x8a13('0x33')]['test']?0x1f4:_0x489804[_0x8a13('0x71')]||0x1f4;logger[_0x8a13('0x72')](_0x8a13('0x73'),'getFields',_0x500edf,JSON[_0x8a13('0x74')](_0x489804));delete _0x489804[_0x8a13('0x27')];if(_0x500edf===0x191){_0x500edf=0x190;}_0x131e77[_0x8a13('0x1b')](_0x500edf)[_0x8a13('0x28')](_0x441405[_0x8a13('0x33')][_0x8a13('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x489804[_0x8a13('0x71')]}:_0x489804);});}; \ No newline at end of file +var _0xc5ab=['label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','sendStatus','stack','name','index','map','VtigerAccount','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','body','find','destroy','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','editable','false'];(function(_0x43566f,_0x2a6d40){var _0x11ebe6=function(_0x60dc8f){while(--_0x60dc8f){_0x43566f['push'](_0x43566f['shift']());}};_0x11ebe6(++_0x2a6d40);}(_0xc5ab,0x190));var _0xbc5a=function(_0x1a30a0,_0x16a720){_0x1a30a0=_0x1a30a0-0x0;var _0x23c9c2=_0xc5ab[_0x1a30a0];return _0x23c9c2;};'use strict';var emlformat=require(_0xbc5a('0x0'));var rimraf=require(_0xbc5a('0x1'));var zipdir=require(_0xbc5a('0x2'));var jsonpatch=require(_0xbc5a('0x3'));var rp=require(_0xbc5a('0x4'));var moment=require(_0xbc5a('0x5'));var BPromise=require(_0xbc5a('0x6'));var Mustache=require(_0xbc5a('0x7'));var util=require(_0xbc5a('0x8'));var path=require(_0xbc5a('0x9'));var sox=require(_0xbc5a('0xa'));var csv=require(_0xbc5a('0xb'));var ejs=require(_0xbc5a('0xc'));var fs=require('fs');var fs_extra=require(_0xbc5a('0xd'));var _=require('lodash');var squel=require(_0xbc5a('0xe'));var crypto=require(_0xbc5a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbc5a('0x10'));var toCsv=require(_0xbc5a('0xb'));var querystring=require(_0xbc5a('0x11'));var Papa=require(_0xbc5a('0x12'));var Redis=require(_0xbc5a('0x13'));var authService=require(_0xbc5a('0x14'));var qs=require(_0xbc5a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc5a('0x16'));var logger=require(_0xbc5a('0x17'))(_0xbc5a('0x18'));var utils=require(_0xbc5a('0x19'));var config=require(_0xbc5a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc5a('0x1b'))['db'];var integrations=require(_0xbc5a('0x1c'));function respondWithStatusCode(_0x253f78,_0x1000f7){_0x1000f7=_0x1000f7||0xcc;return function(_0x2beeba){if(_0x2beeba){return _0x253f78['sendStatus'](_0x1000f7);}return _0x253f78[_0xbc5a('0x1d')](_0x1000f7)['end']();};}function respondWithResult(_0x22dfca,_0xdf8670){_0xdf8670=_0xdf8670||0xc8;return function(_0x535606){if(_0x535606){return _0x22dfca[_0xbc5a('0x1d')](_0xdf8670)[_0xbc5a('0x1e')](_0x535606);}};}function respondWithFilteredResult(_0xc36f49,_0x26afb9){return function(_0x5008a3){if(_0x5008a3){var _0x20ea03=typeof _0x26afb9[_0xbc5a('0x1f')]===_0xbc5a('0x20')&&typeof _0x26afb9[_0xbc5a('0x21')]===_0xbc5a('0x20');var _0x42ba8e=_0x5008a3['count'];var _0x3a01a0=_0x20ea03?0x0:_0x26afb9['offset'];var _0x214023=_0x20ea03?_0x5008a3[_0xbc5a('0x22')]:_0x26afb9[_0xbc5a('0x1f')]+_0x26afb9[_0xbc5a('0x21')];var _0x40a2cd;if(_0x214023>=_0x42ba8e){_0x214023=_0x42ba8e;_0x40a2cd=0xc8;}else{_0x40a2cd=0xce;}_0xc36f49[_0xbc5a('0x1d')](_0x40a2cd);return _0xc36f49[_0xbc5a('0x23')](_0xbc5a('0x24'),_0x3a01a0+'-'+_0x214023+'/'+_0x42ba8e)[_0xbc5a('0x1e')](_0x5008a3);}return null;};}function patchUpdates(_0x2460e3){return function(_0x24778d){try{jsonpatch[_0xbc5a('0x25')](_0x24778d,_0x2460e3,!![]);}catch(_0x5889c4){return BPromise['reject'](_0x5889c4);}return _0x24778d[_0xbc5a('0x26')]();};}function saveUpdates(_0x5d3015,_0x19c664){return function(_0x3831af){if(_0x3831af){return _0x3831af['update'](_0x5d3015)[_0xbc5a('0x27')](function(_0x1c58fe){return _0x1c58fe;});}return null;};}function removeEntity(_0x5a3ea6,_0xbfa91c){return function(_0x5cb487){if(_0x5cb487){return _0x5cb487['destroy']()['then'](function(){_0x5a3ea6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d8f4,_0x15bb3e){return function(_0x5cc81e){if(!_0x5cc81e){_0x46d8f4[_0xbc5a('0x28')](0x194);}return _0x5cc81e;};}function handleError(_0x3be71f,_0x7fb60c){_0x7fb60c=_0x7fb60c||0x1f4;return function(_0x3e9fa4){logger['error'](_0x3e9fa4[_0xbc5a('0x29')]);if(_0x3e9fa4[_0xbc5a('0x2a')]){delete _0x3e9fa4[_0xbc5a('0x2a')];}_0x3be71f[_0xbc5a('0x1d')](_0x7fb60c)['send'](_0x3e9fa4);};}exports[_0xbc5a('0x2b')]=function(_0x36c69a,_0x27a088){var _0x4fcf72={},_0x1cf7b7={},_0x59b715={'count':0x0,'rows':[]};var _0x25af80=_[_0xbc5a('0x2c')](db[_0xbc5a('0x2d')]['rawAttributes'],function(_0x380ee4){return{'name':_0x380ee4['fieldName'],'type':_0x380ee4[_0xbc5a('0x2e')][_0xbc5a('0x2f')]};});_0x1cf7b7[_0xbc5a('0x30')]=_[_0xbc5a('0x2c')](_0x25af80,'name');_0x1cf7b7[_0xbc5a('0x31')]=_[_0xbc5a('0x32')](_0x36c69a[_0xbc5a('0x31')]);_0x1cf7b7['filters']=_[_0xbc5a('0x33')](_0x1cf7b7[_0xbc5a('0x30')],_0x1cf7b7[_0xbc5a('0x31')]);_0x4fcf72[_0xbc5a('0x34')]=_['intersection'](_0x1cf7b7['model'],qs[_0xbc5a('0x35')](_0x36c69a['query'][_0xbc5a('0x35')]));_0x4fcf72['attributes']=_0x4fcf72['attributes'][_0xbc5a('0x36')]?_0x4fcf72[_0xbc5a('0x34')]:_0x1cf7b7['model'];if(!_0x36c69a[_0xbc5a('0x31')][_0xbc5a('0x37')](_0xbc5a('0x38'))){_0x4fcf72[_0xbc5a('0x21')]=qs['limit'](_0x36c69a[_0xbc5a('0x31')][_0xbc5a('0x21')]);_0x4fcf72['offset']=qs[_0xbc5a('0x1f')](_0x36c69a[_0xbc5a('0x31')]['offset']);}_0x4fcf72[_0xbc5a('0x39')]=qs[_0xbc5a('0x3a')](_0x36c69a[_0xbc5a('0x31')]['sort']);_0x4fcf72[_0xbc5a('0x3b')]=qs[_0xbc5a('0x3c')](_['pick'](_0x36c69a[_0xbc5a('0x31')],_0x1cf7b7[_0xbc5a('0x3c')]),_0x25af80);if(_0x36c69a['query'][_0xbc5a('0x3d')]){_0x4fcf72[_0xbc5a('0x3b')]=_[_0xbc5a('0x3e')](_0x4fcf72['where'],{'$or':_[_0xbc5a('0x2c')](_0x25af80,function(_0xf4c0ec){if(_0xf4c0ec[_0xbc5a('0x2e')]!==_0xbc5a('0x3f')){var _0x3da5fc={};_0x3da5fc[_0xf4c0ec[_0xbc5a('0x2a')]]={'$like':'%'+_0x36c69a[_0xbc5a('0x31')]['filter']+'%'};return _0x3da5fc;}})});}_0x4fcf72=_[_0xbc5a('0x3e')]({},_0x4fcf72,_0x36c69a[_0xbc5a('0x40')]);var _0x11a3bf={'where':_0x4fcf72[_0xbc5a('0x3b')]};return db[_0xbc5a('0x2d')][_0xbc5a('0x22')](_0x11a3bf)[_0xbc5a('0x27')](function(_0x5d351a){_0x59b715[_0xbc5a('0x22')]=_0x5d351a;if(_0x36c69a[_0xbc5a('0x31')][_0xbc5a('0x41')]){_0x4fcf72[_0xbc5a('0x42')]=[{'all':!![]}];}return db[_0xbc5a('0x2d')][_0xbc5a('0x43')](_0x4fcf72);})[_0xbc5a('0x27')](function(_0x4b43c1){_0x59b715['rows']=_0x4b43c1;return _0x59b715;})[_0xbc5a('0x27')](respondWithFilteredResult(_0x27a088,_0x4fcf72))[_0xbc5a('0x44')](handleError(_0x27a088,null));};exports[_0xbc5a('0x45')]=function(_0x31819d,_0x3fda50){var _0x56826d={'raw':![],'where':{'id':_0x31819d[_0xbc5a('0x46')]['id']}},_0x22e7fe={};_0x22e7fe[_0xbc5a('0x30')]=_[_0xbc5a('0x32')](db[_0xbc5a('0x2d')][_0xbc5a('0x47')]);_0x22e7fe[_0xbc5a('0x31')]=_[_0xbc5a('0x32')](_0x31819d['query']);_0x22e7fe[_0xbc5a('0x3c')]=_[_0xbc5a('0x33')](_0x22e7fe[_0xbc5a('0x30')],_0x22e7fe['query']);_0x56826d[_0xbc5a('0x34')]=_[_0xbc5a('0x33')](_0x22e7fe[_0xbc5a('0x30')],qs[_0xbc5a('0x35')](_0x31819d[_0xbc5a('0x31')]['fields']));_0x56826d[_0xbc5a('0x34')]=_0x56826d[_0xbc5a('0x34')][_0xbc5a('0x36')]?_0x56826d[_0xbc5a('0x34')]:_0x22e7fe[_0xbc5a('0x30')];if(_0x31819d['query'][_0xbc5a('0x41')]){_0x56826d[_0xbc5a('0x42')]=[{'all':!![]}];}_0x56826d=_[_0xbc5a('0x3e')]({},_0x56826d,_0x31819d[_0xbc5a('0x40')]);return db[_0xbc5a('0x2d')]['find'](_0x56826d)[_0xbc5a('0x27')](handleEntityNotFound(_0x3fda50,null))['then'](respondWithResult(_0x3fda50,null))[_0xbc5a('0x44')](handleError(_0x3fda50,null));};exports['create']=function(_0x50a96e,_0xb187d3){return db[_0xbc5a('0x2d')]['create'](_0x50a96e[_0xbc5a('0x48')],{})[_0xbc5a('0x27')](respondWithResult(_0xb187d3,0xc9))[_0xbc5a('0x44')](handleError(_0xb187d3,null));};exports['update']=function(_0x511e67,_0x31c098){if(_0x511e67[_0xbc5a('0x48')]['id']){delete _0x511e67[_0xbc5a('0x48')]['id'];}return db[_0xbc5a('0x2d')][_0xbc5a('0x49')]({'where':{'id':_0x511e67[_0xbc5a('0x46')]['id']}})[_0xbc5a('0x27')](handleEntityNotFound(_0x31c098,null))['then'](saveUpdates(_0x511e67[_0xbc5a('0x48')],null))[_0xbc5a('0x27')](respondWithResult(_0x31c098,null))[_0xbc5a('0x44')](handleError(_0x31c098,null));};exports[_0xbc5a('0x4a')]=function(_0x2bdd6d,_0x1c6512){return db[_0xbc5a('0x2d')][_0xbc5a('0x49')]({'where':{'id':_0x2bdd6d[_0xbc5a('0x46')]['id']}})[_0xbc5a('0x27')](handleEntityNotFound(_0x1c6512,null))[_0xbc5a('0x27')](removeEntity(_0x1c6512,null))[_0xbc5a('0x44')](handleError(_0x1c6512,null));};exports[_0xbc5a('0x4b')]=function(_0x541094,_0x20fe93,_0x389cfa){var _0x345d3e={};var _0x433e25={};var _0x42e3de;var _0x217e0b;return db[_0xbc5a('0x2d')][_0xbc5a('0x4c')]({'where':{'id':_0x541094[_0xbc5a('0x46')]['id']}})[_0xbc5a('0x27')](handleEntityNotFound(_0x20fe93,null))[_0xbc5a('0x27')](function(_0x4082ac){if(_0x4082ac){_0x42e3de=_0x4082ac;_0x433e25['model']=_['keys'](db[_0xbc5a('0x4d')]['rawAttributes']);_0x433e25['query']=_[_0xbc5a('0x32')](_0x541094[_0xbc5a('0x31')]);_0x433e25[_0xbc5a('0x3c')]=_[_0xbc5a('0x33')](_0x433e25[_0xbc5a('0x30')],_0x433e25['query']);_0x345d3e[_0xbc5a('0x34')]=_[_0xbc5a('0x33')](_0x433e25[_0xbc5a('0x30')],qs[_0xbc5a('0x35')](_0x541094['query'][_0xbc5a('0x35')]));_0x345d3e[_0xbc5a('0x34')]=_0x345d3e[_0xbc5a('0x34')][_0xbc5a('0x36')]?_0x345d3e['attributes']:_0x433e25['model'];_0x345d3e[_0xbc5a('0x39')]=qs[_0xbc5a('0x3a')](_0x541094[_0xbc5a('0x31')]['sort']);_0x345d3e[_0xbc5a('0x3b')]=qs[_0xbc5a('0x3c')](_[_0xbc5a('0x4e')](_0x541094[_0xbc5a('0x31')],_0x433e25[_0xbc5a('0x3c')]));if(_0x541094[_0xbc5a('0x31')][_0xbc5a('0x3d')]){_0x345d3e[_0xbc5a('0x3b')]=_[_0xbc5a('0x3e')](_0x345d3e[_0xbc5a('0x3b')],{'$or':_[_0xbc5a('0x2c')](_0x345d3e[_0xbc5a('0x34')],function(_0x168dcc){var _0x2cc8d2={};_0x2cc8d2[_0x168dcc]={'$like':'%'+_0x541094[_0xbc5a('0x31')]['filter']+'%'};return _0x2cc8d2;})});}_0x345d3e=_['merge']({},_0x345d3e,_0x541094[_0xbc5a('0x40')]);return _0x42e3de[_0xbc5a('0x4b')](_0x345d3e);}})[_0xbc5a('0x27')](function(_0x544669){if(_0x544669){_0x217e0b=_0x544669[_0xbc5a('0x36')];if(!_0x541094[_0xbc5a('0x31')][_0xbc5a('0x37')](_0xbc5a('0x38'))){_0x345d3e[_0xbc5a('0x21')]=qs[_0xbc5a('0x21')](_0x541094[_0xbc5a('0x31')]['limit']);_0x345d3e[_0xbc5a('0x1f')]=qs[_0xbc5a('0x1f')](_0x541094[_0xbc5a('0x31')][_0xbc5a('0x1f')]);}return _0x42e3de[_0xbc5a('0x4b')](_0x345d3e);}})[_0xbc5a('0x27')](function(_0x130139){if(_0x130139){return _0x130139?{'count':_0x217e0b,'rows':_0x130139}:null;}})[_0xbc5a('0x27')](respondWithResult(_0x20fe93,null))[_0xbc5a('0x44')](handleError(_0x20fe93,null));};exports[_0xbc5a('0x4f')]=function(_0x1658da,_0x19aa09,_0x38d348){if(_0x1658da[_0xbc5a('0x48')]['id']){delete _0x1658da[_0xbc5a('0x48')]['id'];}return db[_0xbc5a('0x2d')][_0xbc5a('0x4c')]({'where':{'id':_0x1658da[_0xbc5a('0x46')]['id']}})[_0xbc5a('0x27')](handleEntityNotFound(_0x19aa09,null))[_0xbc5a('0x27')](function(_0x4067e3){if(_0x4067e3){_0x1658da[_0xbc5a('0x48')]['AccountId']=_0x4067e3['id'];_0x1658da[_0xbc5a('0x48')][_0xbc5a('0x50')]=integrations[_0xbc5a('0x51')](_0x1658da[_0xbc5a('0x48')][_0xbc5a('0x52')],_0x1658da[_0xbc5a('0x48')][_0xbc5a('0x2e')]);_0x1658da[_0xbc5a('0x48')][_0xbc5a('0x53')]=integrations[_0xbc5a('0x54')](_0x1658da['body'][_0xbc5a('0x52')],_0x1658da[_0xbc5a('0x48')]['type']);return db[_0xbc5a('0x4d')][_0xbc5a('0x55')](_0x1658da['body'],{'include':[{'model':db[_0xbc5a('0x56')],'as':_0xbc5a('0x50')},{'model':db[_0xbc5a('0x56')],'as':_0xbc5a('0x53')}]});}return null;})[_0xbc5a('0x27')](respondWithResult(_0x19aa09,null))[_0xbc5a('0x44')](handleError(_0x19aa09,null));};var md5=require(_0xbc5a('0x57'));exports['getFields']=function(_0x2a0a44,_0xdfedbd,_0x39c11b){var _0x51f7c5=null;var _0x1a1d7d=null;var _0x2b4755=null;var _0x592241=null;var _0xaef9ee='';return db[_0xbc5a('0x2d')][_0xbc5a('0x4c')]({'where':{'id':_0x2a0a44[_0xbc5a('0x46')]['id']},'attributes':['id',_0xbc5a('0x2a'),_0xbc5a('0x58'),_0xbc5a('0x59'),_0xbc5a('0x5a'),_0xbc5a('0x5b'),_0xbc5a('0x5c'),_0xbc5a('0x5d')]})[_0xbc5a('0x27')](handleEntityNotFound(_0xdfedbd,null))['then'](function(_0x55625d){if(_0x55625d){_0x51f7c5=_0x55625d['username'];_0x1a1d7d=_0x55625d[_0xbc5a('0x5d')];_0x2b4755=_0x55625d[_0xbc5a('0x5a')];_0xaef9ee=_0x55625d[_0xbc5a('0x5b')];var _0x216a07=_0xaef9ee['slice'](-0x1);if(_0x216a07==='/'){_0xaef9ee=_0xaef9ee[_0xbc5a('0x5e')](0x0,_0xaef9ee[_0xbc5a('0x5f')](_0x216a07));}_0x592241=util[_0xbc5a('0x60')]('%s/webservice.php',_0xaef9ee);var _0x47858d={'method':_0xbc5a('0x61'),'uri':_0x592241,'qs':{'operation':_0xbc5a('0x62'),'username':_0x55625d['username']},'json':!![]};return rp(_0x47858d);}})[_0xbc5a('0x27')](function(_0x393dea){if(_0x393dea[_0xbc5a('0x63')]){var _0x23b567={'method':_0xbc5a('0x64'),'uri':_0x592241,'form':{'operation':_0xbc5a('0x65'),'username':_0x51f7c5,'accessKey':md5(_0x393dea[_0xbc5a('0x66')][_0xbc5a('0x67')]+_0x1a1d7d)},'json':!![]};return rp(_0x23b567);}})[_0xbc5a('0x27')](function(_0x5c105d){if(_0x5c105d[_0xbc5a('0x63')]){var _0x50dd94={'method':_0xbc5a('0x61'),'uri':_0x592241,'qs':{'operation':_0xbc5a('0x68'),'username':_0x51f7c5,'sessionName':_0x5c105d[_0xbc5a('0x66')][_0xbc5a('0x69')],'elementType':_0x2b4755},'json':!![]};return rp(_0x50dd94);}})['then'](function(_0x5aaf6f){if(_0x5aaf6f[_0xbc5a('0x63')]){var _0x233055=[_0xbc5a('0x6a'),_0xbc5a('0x6b'),_0xbc5a('0x6c')];_[_0xbc5a('0x6d')](_0x5aaf6f[_0xbc5a('0x66')][_0xbc5a('0x35')],function(_0x3c0d89){return _0x233055['includes'](_0x3c0d89[_0xbc5a('0x2e')][_0xbc5a('0x2a')]);});_['remove'](_0x5aaf6f[_0xbc5a('0x66')][_0xbc5a('0x35')],function(_0x3b777d){return _0x3b777d[_0xbc5a('0x6e')]===_0xbc5a('0x6f');});return{'count':_0x5aaf6f[_0xbc5a('0x66')]['fields'][_0xbc5a('0x36')],'rows':_[_0xbc5a('0x2c')](_0x5aaf6f[_0xbc5a('0x66')][_0xbc5a('0x35')],function(_0x3b5ca1){return{'id':_0x3b5ca1[_0xbc5a('0x2a')],'name':_0x3b5ca1[_0xbc5a('0x70')],'custom':_[_0xbc5a('0x71')](_0x3b5ca1[_0xbc5a('0x2a')],_0xbc5a('0x72'))?!![]:![],'options':_0x3b5ca1[_0xbc5a('0x2e')][_0xbc5a('0x2a')]===_0xbc5a('0x73')&&_0x3b5ca1[_0xbc5a('0x2e')]['picklistValues'][_0xbc5a('0x36')]>0x0?_['map'](_0x3b5ca1[_0xbc5a('0x2e')][_0xbc5a('0x74')],function(_0xcbc1fa){return{'name':_0xcbc1fa[_0xbc5a('0x70')],'value':_0xcbc1fa[_0xbc5a('0x75')]};}):[]};})};}})[_0xbc5a('0x27')](respondWithResult(_0xdfedbd,null))['catch'](function(_0x2689e0){console[_0xbc5a('0x76')](_0xbc5a('0x77')+_0x2689e0);var _0xad3456=_0x2a0a44['query'][_0xbc5a('0x78')]?0x1f4:_0x2689e0[_0xbc5a('0x79')]||0x1f4;logger[_0xbc5a('0x7a')](_0xbc5a('0x7b'),_0xbc5a('0x7c'),_0xad3456,JSON[_0xbc5a('0x7d')](_0x2689e0));delete _0x2689e0[_0xbc5a('0x2a')];if(_0xad3456===0x191){_0xad3456=0x190;}_0xdfedbd[_0xbc5a('0x1d')](_0xad3456)[_0xbc5a('0x7e')](_0x2a0a44[_0xbc5a('0x31')]['test']?{'message':_0xbc5a('0x7f'),'statusCode':_0x2689e0['statusCode']}:_0x2689e0);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index df688c5..d690775 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 _0xe3ba=['moment','bluebird','request-promise','../../config/environment','VtigerAccount','lodash','util','api'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe3ba,0xf5));var _0xae3b=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0xe3ba[_0x1399d6];return _0x4a9db4;};'use strict';var _=require(_0xae3b('0x0'));var util=require(_0xae3b('0x1'));var logger=require('../../config/logger')(_0xae3b('0x2'));var moment=require(_0xae3b('0x3'));var BPromise=require(_0xae3b('0x4'));var rp=require(_0xae3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xae3b('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x58ebdf,_0x5d013c){return _0x58ebdf['define'](_0xae3b('0x7'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf296=['rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x713fbe,_0x49d0ea){var _0x19486e=function(_0x3b09a8){while(--_0x3b09a8){_0x713fbe['push'](_0x713fbe['shift']());}};_0x19486e(++_0x49d0ea);}(_0xf296,0x1a8));var _0x6f29=function(_0x3b22e9,_0x354406){_0x3b22e9=_0x3b22e9-0x0;var _0x230314=_0xf296[_0x3b22e9];return _0x230314;};'use strict';var _=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var logger=require(_0x6f29('0x2'))(_0x6f29('0x3'));var moment=require('moment');var BPromise=require(_0x6f29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6f29('0x5'));var config=require(_0x6f29('0x6'));var attributes=require(_0x6f29('0x7'));var integrations=require(_0x6f29('0x8'));module[_0x6f29('0x9')]=function(_0x3dace4,_0x410232){return _0x3dace4[_0x6f29('0xa')](_0x6f29('0xb'),attributes,{'tableName':_0x6f29('0xc'),'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 3fd0547..3c2ae3e 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 _0x750a=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','options','raw','attributes','limit','model','include','map','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','where'];(function(_0x563221,_0x1ba85e){var _0x57ea60=function(_0x3e64f0){while(--_0x3e64f0){_0x563221['push'](_0x563221['shift']());}};_0x57ea60(++_0x1ba85e);}(_0x750a,0x140));var _0xa750=function(_0x26605b,_0x54f922){_0x26605b=_0x26605b-0x0;var _0x48721c=_0x750a[_0x26605b];return _0x48721c;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['GetVtigerAccount']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['VtigerAccount']['findAll']({'raw':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['where']||null:null,'attributes':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x17')]||null:null,'limit':_0x433dbd['options']?_0x433dbd['options'][_0xa750('0x18')]||null:null,'include':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['include']?_['map'](_0x433dbd['options']['include'],function(_0x15d72f){return{'model':db[_0x15d72f[_0xa750('0x19')]],'as':_0x15d72f['as'],'attributes':_0x15d72f[_0xa750('0x17')],'include':_0x15d72f[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x15d72f[_0xa750('0x1a')],function(_0x3001bc){return{'model':db[_0x3001bc[_0xa750('0x19')]],'as':_0x3001bc['as'],'attributes':_0x3001bc[_0xa750('0x17')],'include':_0x3001bc[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x3001bc[_0xa750('0x1a')],function(_0x31ea63){return{'model':db[_0x31ea63[_0xa750('0x19')]],'as':_0x31ea63['as'],'attributes':_0x31ea63[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3923){logger[_0xa750('0xc')](_0xa750('0x1c'),_0x433dbd);logger['debug'](_0xa750('0x1c'),_0x433dbd,JSON[_0xa750('0xf')](_0x3d3923));_0x4f1faa(_0x3d3923);})[_0xa750('0x14')](function(_0x1223d2){logger['error'](_0xa750('0x1c'),_0x1223d2[_0xa750('0x13')],_0x433dbd);_0x36dcca(_0x1bde87[_0xa750('0x10')](0x1f4,_0x1223d2[_0xa750('0x13')]));});});};exports[_0xa750('0x1d')]=function(_0x59ab33){var _0x46cc11=this;return new Promise(function(_0x4c2c9e,_0x2d0e93){return db[_0xa750('0x1e')]['find']({'raw':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')][_0xa750('0x1f')]||null:null,'attributes':_0x59ab33[_0xa750('0x15')]?_0x59ab33[_0xa750('0x15')]['attributes']||null:null,'include':_0x59ab33[_0xa750('0x15')]?_0x59ab33['options'][_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x59ab33[_0xa750('0x15')][_0xa750('0x1a')],function(_0x556fde){return{'model':db[_0x556fde[_0xa750('0x19')]],'as':_0x556fde['as'],'attributes':_0x556fde[_0xa750('0x17')],'include':_0x556fde['include']?_[_0xa750('0x1b')](_0x556fde[_0xa750('0x1a')],function(_0x280b87){return{'model':db[_0x280b87[_0xa750('0x19')]],'as':_0x280b87['as'],'attributes':_0x280b87['attributes'],'include':_0x280b87[_0xa750('0x1a')]?_['map'](_0x280b87['include'],function(_0x4e59f3){return{'model':db[_0x4e59f3[_0xa750('0x19')]],'as':_0x4e59f3['as'],'attributes':_0x4e59f3[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470089){logger[_0xa750('0xc')](_0xa750('0x1d'),_0x59ab33);logger['debug'](_0xa750('0x1d'),_0x59ab33,JSON[_0xa750('0xf')](_0x470089));_0x4c2c9e(_0x470089);})[_0xa750('0x14')](function(_0x5d402a){logger[_0xa750('0x10')](_0xa750('0x1d'),_0x5d402a[_0xa750('0x13')],_0x59ab33);_0x2d0e93(_0x46cc11['error'](0x1f4,_0x5d402a[_0xa750('0x13')]));});});}; \ No newline at end of file +var _0x96cc=['model','map','debug','ShowVtigerAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0xf94131,_0x58b63d){var _0xdf5c19=function(_0xa00801){while(--_0xa00801){_0xf94131['push'](_0xf94131['shift']());}};_0xdf5c19(++_0x58b63d);}(_0x96cc,0x16c));var _0xc96c=function(_0x436981,_0x371571){_0x436981=_0x436981-0x0;var _0x2e4f86=_0x96cc[_0x436981];return _0x2e4f86;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});}exports[_0xc96c('0x17')]=function(_0x99c402){var _0x16b6ce=this;return new Promise(function(_0x2ae19a,_0x4aa6a3){return db[_0xc96c('0x18')][_0xc96c('0x19')]({'raw':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1c')]||null:null,'attributes':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'limit':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1e')]||null:null,'include':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')]?_['map'](_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')],function(_0x4456bf){return{'model':db[_0x4456bf[_0xc96c('0x20')]],'as':_0x4456bf['as'],'attributes':_0x4456bf[_0xc96c('0x1d')],'include':_0x4456bf[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4456bf[_0xc96c('0x1f')],function(_0x1a77df){return{'model':db[_0x1a77df[_0xc96c('0x20')]],'as':_0x1a77df['as'],'attributes':_0x1a77df['attributes'],'include':_0x1a77df[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x1a77df[_0xc96c('0x1f')],function(_0x294fee){return{'model':db[_0x294fee['model']],'as':_0x294fee['as'],'attributes':_0x294fee['attributes']};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x12c293){logger[_0xc96c('0xd')](_0xc96c('0x17'),_0x99c402);logger[_0xc96c('0x22')](_0xc96c('0x17'),_0x99c402,JSON[_0xc96c('0x11')](_0x12c293));_0x2ae19a(_0x12c293);})[_0xc96c('0x16')](function(_0xa0efbc){logger[_0xc96c('0x12')](_0xc96c('0x17'),_0xa0efbc[_0xc96c('0x14')],_0x99c402);_0x4aa6a3(_0x16b6ce[_0xc96c('0x12')](0x1f4,_0xa0efbc[_0xc96c('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x3aa436){var _0x53c994=this;return new Promise(function(_0x3f4b0e,_0x442c7f){return db[_0xc96c('0x18')]['find']({'raw':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436['options']['where']||null:null,'attributes':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'include':_0x3aa436['options']?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x3aa436[_0xc96c('0x1a')]['include'],function(_0x4132a9){return{'model':db[_0x4132a9[_0xc96c('0x20')]],'as':_0x4132a9['as'],'attributes':_0x4132a9['attributes'],'include':_0x4132a9[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4132a9[_0xc96c('0x1f')],function(_0x2d2595){return{'model':db[_0x2d2595[_0xc96c('0x20')]],'as':_0x2d2595['as'],'attributes':_0x2d2595[_0xc96c('0x1d')],'include':_0x2d2595['include']?_[_0xc96c('0x21')](_0x2d2595[_0xc96c('0x1f')],function(_0x15b68b){return{'model':db[_0x15b68b[_0xc96c('0x20')]],'as':_0x15b68b['as'],'attributes':_0x15b68b[_0xc96c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x52d4a2){logger['info'](_0xc96c('0x23'),_0x3aa436);logger[_0xc96c('0x22')]('ShowVtigerAccount',_0x3aa436,JSON['stringify'](_0x52d4a2));_0x3f4b0e(_0x52d4a2);})[_0xc96c('0x16')](function(_0x1df393){logger[_0xc96c('0x12')](_0xc96c('0x23'),_0x1df393[_0xc96c('0x14')],_0x3aa436);_0x442c7f(_0x53c994[_0xc96c('0x12')](0x1f4,_0x1df393[_0xc96c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ec84186..6ba27ee 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 _0x1671=['getFields','/:id/subjects','getSubjects','post','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','/:id/fields'];(function(_0x503357,_0x1920f3){var _0x48ba12=function(_0x17b04b){while(--_0x17b04b){_0x503357['push'](_0x503357['shift']());}};_0x48ba12(++_0x1920f3);}(_0x1671,0x133));var _0x1167=function(_0x113709,_0x5a4a95){_0x113709=_0x113709-0x0;var _0x63c3ac=_0x1671[_0x113709];return _0x63c3ac;};'use strict';var multer=require(_0x1167('0x0'));var util=require('util');var path=require(_0x1167('0x1'));var timeout=require(_0x1167('0x2'));var express=require(_0x1167('0x3'));var router=express[_0x1167('0x4')]();var fs_extra=require(_0x1167('0x5'));var auth=require(_0x1167('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1167('0x7'));var controller=require(_0x1167('0x8'));router[_0x1167('0x9')]('/',auth[_0x1167('0xa')](),controller['index']);router[_0x1167('0x9')](_0x1167('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1167('0x9')](_0x1167('0xc'),auth[_0x1167('0xa')](),controller[_0x1167('0xd')]);router[_0x1167('0x9')](_0x1167('0xe'),auth[_0x1167('0xa')](),controller[_0x1167('0xf')]);router[_0x1167('0x9')]('/:id/descriptions',auth[_0x1167('0xa')](),controller['getDescriptions']);router[_0x1167('0x10')]('/',auth[_0x1167('0xa')](),controller['create']);router['put'](_0x1167('0xb'),auth['isAuthenticated'](),controller[_0x1167('0x11')]);router[_0x1167('0x12')]('/:id',auth[_0x1167('0xa')](),controller[_0x1167('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3b17=['put','delete','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create'];(function(_0x5138f8,_0x523adb){var _0x1f75fb=function(_0x61b9bc){while(--_0x61b9bc){_0x5138f8['push'](_0x5138f8['shift']());}};_0x1f75fb(++_0x523adb);}(_0x3b17,0xfe));var _0x73b1=function(_0x45667f,_0x121c63){_0x45667f=_0x45667f-0x0;var _0x141c69=_0x3b17[_0x45667f];return _0x141c69;};'use strict';var multer=require('multer');var util=require(_0x73b1('0x0'));var path=require(_0x73b1('0x1'));var timeout=require(_0x73b1('0x2'));var express=require('express');var router=express[_0x73b1('0x3')]();var fs_extra=require(_0x73b1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73b1('0x5'));var config=require(_0x73b1('0x6'));var controller=require(_0x73b1('0x7'));router[_0x73b1('0x8')]('/',auth[_0x73b1('0x9')](),controller[_0x73b1('0xa')]);router['get'](_0x73b1('0xb'),auth[_0x73b1('0x9')](),controller[_0x73b1('0xc')]);router[_0x73b1('0x8')](_0x73b1('0xd'),auth[_0x73b1('0x9')](),controller[_0x73b1('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x73b1('0x8')](_0x73b1('0xf'),auth[_0x73b1('0x9')](),controller[_0x73b1('0x10')]);router[_0x73b1('0x11')]('/',auth[_0x73b1('0x9')](),controller[_0x73b1('0x12')]);router[_0x73b1('0x13')](_0x73b1('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x73b1('0x14')](_0x73b1('0xb'),auth[_0x73b1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 80d928c..baa2f76 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 _0x20d9=['STRING'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x20d9,0x1cf));var _0x920d=function(_0x4de467,_0x128113){_0x4de467=_0x4de467-0x0;var _0x410a89=_0x20d9[_0x4de467];return _0x410a89;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x920d('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x60a5=['STRING','sequelize','exports'];(function(_0x47624f,_0x487c1f){var _0x2174d7=function(_0x1a69d2){while(--_0x1a69d2){_0x47624f['push'](_0x47624f['shift']());}};_0x2174d7(++_0x487c1f);}(_0x60a5,0x14e));var _0x560a=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x60a5[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x560a('0x0'));module[_0x560a('0x1')]={'name':{'type':Sequelize[_0x560a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 619a616..5c4277e 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 _0x1e90=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','find','getFields','findOne','nolimit','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1e90,0x1c5));var _0x01e9=function(_0x2ef243,_0x497018){_0x2ef243=_0x2ef243-0x0;var _0x3f0995=_0x1e90[_0x2ef243];return _0x3f0995;};'use strict';var emlformat=require(_0x01e9('0x0'));var rimraf=require(_0x01e9('0x1'));var zipdir=require(_0x01e9('0x2'));var jsonpatch=require(_0x01e9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x01e9('0x4'));var Mustache=require(_0x01e9('0x5'));var util=require(_0x01e9('0x6'));var path=require(_0x01e9('0x7'));var sox=require(_0x01e9('0x8'));var csv=require(_0x01e9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01e9('0xa'));var _=require('lodash');var squel=require(_0x01e9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x01e9('0xc'));var toCsv=require(_0x01e9('0x9'));var querystring=require(_0x01e9('0xd'));var Papa=require(_0x01e9('0xe'));var Redis=require(_0x01e9('0xf'));var authService=require(_0x01e9('0x10'));var qs=require(_0x01e9('0x11'));var as=require(_0x01e9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01e9('0x13'))(_0x01e9('0x14'));var utils=require(_0x01e9('0x15'));var config=require(_0x01e9('0x16'));var licenseUtil=require(_0x01e9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d93c5,_0x2e0eeb){_0x2e0eeb=_0x2e0eeb||0xcc;return function(_0x17a5a8){if(_0x17a5a8){return _0x3d93c5[_0x01e9('0x18')](_0x2e0eeb);}return _0x3d93c5[_0x01e9('0x19')](_0x2e0eeb)[_0x01e9('0x1a')]();};}function respondWithResult(_0x551d04,_0x526e39){_0x526e39=_0x526e39||0xc8;return function(_0x1ff9d9){if(_0x1ff9d9){return _0x551d04['status'](_0x526e39)[_0x01e9('0x1b')](_0x1ff9d9);}};}function respondWithFilteredResult(_0x2a5eb0,_0x4ef1b7){return function(_0x4bacba){if(_0x4bacba){var _0x198025=typeof _0x4ef1b7[_0x01e9('0x1c')]==='undefined'&&typeof _0x4ef1b7['limit']===_0x01e9('0x1d');var _0x104769=_0x4bacba[_0x01e9('0x1e')];var _0x29339f=_0x198025?0x0:_0x4ef1b7[_0x01e9('0x1c')];var _0x135757=_0x198025?_0x4bacba['count']:_0x4ef1b7[_0x01e9('0x1c')]+_0x4ef1b7[_0x01e9('0x1f')];var _0x3c2c70;if(_0x135757>=_0x104769){_0x135757=_0x104769;_0x3c2c70=0xc8;}else{_0x3c2c70=0xce;}_0x2a5eb0[_0x01e9('0x19')](_0x3c2c70);return _0x2a5eb0[_0x01e9('0x20')](_0x01e9('0x21'),_0x29339f+'-'+_0x135757+'/'+_0x104769)[_0x01e9('0x1b')](_0x4bacba);}return null;};}function patchUpdates(_0x5d02f0){return function(_0x482fbc){try{jsonpatch[_0x01e9('0x22')](_0x482fbc,_0x5d02f0,!![]);}catch(_0x32b410){return BPromise[_0x01e9('0x23')](_0x32b410);}return _0x482fbc['save']();};}function saveUpdates(_0x510cfb,_0x3f1036){return function(_0x2f3d2b){if(_0x2f3d2b){return _0x2f3d2b[_0x01e9('0x24')](_0x510cfb)[_0x01e9('0x25')](function(_0x59b288){return _0x59b288;});}return null;};}function removeEntity(_0x517ce3,_0x133126){return function(_0x20e5c3){if(_0x20e5c3){return _0x20e5c3[_0x01e9('0x26')]()[_0x01e9('0x25')](function(){_0x517ce3[_0x01e9('0x19')](0xcc)[_0x01e9('0x1a')]();});}};}function handleEntityNotFound(_0x1b1c27,_0x395851){return function(_0x3d80f8){if(!_0x3d80f8){_0x1b1c27[_0x01e9('0x18')](0x194);}return _0x3d80f8;};}function handleError(_0x130a65,_0x2e7f12){_0x2e7f12=_0x2e7f12||0x1f4;return function(_0x27b7bc){logger[_0x01e9('0x27')](_0x27b7bc[_0x01e9('0x28')]);if(_0x27b7bc['name']){delete _0x27b7bc[_0x01e9('0x29')];}_0x130a65['status'](_0x2e7f12)[_0x01e9('0x2a')](_0x27b7bc);};}exports['index']=function(_0x4169f3,_0x1caad){var _0x22a403={},_0x345b95={},_0x3276f4={'count':0x0,'rows':[]};var _0x59cc10=_[_0x01e9('0x2b')](db[_0x01e9('0x2c')][_0x01e9('0x2d')],function(_0x5e0e52){return{'name':_0x5e0e52[_0x01e9('0x2e')],'type':_0x5e0e52['type']['key']};});_0x345b95[_0x01e9('0x2f')]=_[_0x01e9('0x2b')](_0x59cc10,_0x01e9('0x29'));_0x345b95['query']=_[_0x01e9('0x30')](_0x4169f3[_0x01e9('0x31')]);_0x345b95[_0x01e9('0x32')]=_[_0x01e9('0x33')](_0x345b95['model'],_0x345b95[_0x01e9('0x31')]);_0x22a403[_0x01e9('0x34')]=_[_0x01e9('0x33')](_0x345b95[_0x01e9('0x2f')],qs[_0x01e9('0x35')](_0x4169f3[_0x01e9('0x31')][_0x01e9('0x35')]));_0x22a403['attributes']=_0x22a403[_0x01e9('0x34')][_0x01e9('0x36')]?_0x22a403[_0x01e9('0x34')]:_0x345b95[_0x01e9('0x2f')];if(!_0x4169f3['query'][_0x01e9('0x37')]('nolimit')){_0x22a403[_0x01e9('0x1f')]=qs[_0x01e9('0x1f')](_0x4169f3[_0x01e9('0x31')][_0x01e9('0x1f')]);_0x22a403[_0x01e9('0x1c')]=qs[_0x01e9('0x1c')](_0x4169f3[_0x01e9('0x31')][_0x01e9('0x1c')]);}_0x22a403[_0x01e9('0x38')]=qs[_0x01e9('0x39')](_0x4169f3[_0x01e9('0x31')]['sort']);_0x22a403[_0x01e9('0x3a')]=qs[_0x01e9('0x32')](_[_0x01e9('0x3b')](_0x4169f3[_0x01e9('0x31')],_0x345b95['filters']),_0x59cc10);if(_0x4169f3[_0x01e9('0x31')][_0x01e9('0x3c')]){_0x22a403[_0x01e9('0x3a')]=_[_0x01e9('0x3d')](_0x22a403['where'],{'$or':_[_0x01e9('0x2b')](_0x59cc10,function(_0x3413d1){if(_0x3413d1[_0x01e9('0x3e')]!==_0x01e9('0x3f')){var _0x43db23={};_0x43db23[_0x3413d1[_0x01e9('0x29')]]={'$like':'%'+_0x4169f3[_0x01e9('0x31')][_0x01e9('0x3c')]+'%'};return _0x43db23;}})});}_0x22a403=_[_0x01e9('0x3d')]({},_0x22a403,_0x4169f3[_0x01e9('0x40')]);var _0x374473={'where':_0x22a403[_0x01e9('0x3a')]};return db[_0x01e9('0x2c')]['count'](_0x374473)['then'](function(_0x13953e){_0x3276f4[_0x01e9('0x1e')]=_0x13953e;if(_0x4169f3['query'][_0x01e9('0x41')]){_0x22a403[_0x01e9('0x42')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x01e9('0x43')](_0x22a403);})[_0x01e9('0x25')](function(_0xbfc55a){_0x3276f4['rows']=_0xbfc55a;return _0x3276f4;})['then'](respondWithFilteredResult(_0x1caad,_0x22a403))[_0x01e9('0x44')](handleError(_0x1caad,null));};exports['show']=function(_0xdd5b90,_0x165469){var _0x5419b8={'raw':![],'where':{'id':_0xdd5b90[_0x01e9('0x45')]['id']}},_0x137522={};_0x137522['model']=_[_0x01e9('0x30')](db['VtigerConfiguration'][_0x01e9('0x2d')]);_0x137522[_0x01e9('0x31')]=_[_0x01e9('0x30')](_0xdd5b90[_0x01e9('0x31')]);_0x137522[_0x01e9('0x32')]=_[_0x01e9('0x33')](_0x137522[_0x01e9('0x2f')],_0x137522[_0x01e9('0x31')]);_0x5419b8[_0x01e9('0x34')]=_[_0x01e9('0x33')](_0x137522[_0x01e9('0x2f')],qs[_0x01e9('0x35')](_0xdd5b90[_0x01e9('0x31')][_0x01e9('0x35')]));_0x5419b8[_0x01e9('0x34')]=_0x5419b8[_0x01e9('0x34')]['length']?_0x5419b8[_0x01e9('0x34')]:_0x137522[_0x01e9('0x2f')];if(_0xdd5b90[_0x01e9('0x31')][_0x01e9('0x41')]){_0x5419b8['include']=[{'all':!![]}];}_0x5419b8=_[_0x01e9('0x3d')]({},_0x5419b8,_0xdd5b90[_0x01e9('0x40')]);return db[_0x01e9('0x2c')]['find'](_0x5419b8)[_0x01e9('0x25')](handleEntityNotFound(_0x165469,null))['then'](respondWithResult(_0x165469,null))[_0x01e9('0x44')](handleError(_0x165469,null));};exports[_0x01e9('0x46')]=function(_0x3b743d,_0x34f6cb){return db[_0x01e9('0x2c')][_0x01e9('0x46')](_0x3b743d[_0x01e9('0x47')],{})[_0x01e9('0x25')](respondWithResult(_0x34f6cb,0xc9))['catch'](handleError(_0x34f6cb,null));};exports[_0x01e9('0x24')]=function(_0x3f0762,_0x2a4d2a){if(_0x3f0762[_0x01e9('0x47')]['id']){delete _0x3f0762['body']['id'];}return db[_0x01e9('0x2c')][_0x01e9('0x48')]({'where':{'id':_0x3f0762['params']['id']}})[_0x01e9('0x25')](handleEntityNotFound(_0x2a4d2a,null))[_0x01e9('0x25')](saveUpdates(_0x3f0762['body'],null))[_0x01e9('0x25')](respondWithResult(_0x2a4d2a,null))[_0x01e9('0x44')](handleError(_0x2a4d2a,null));};exports['destroy']=function(_0xae1299,_0x29095e){return db['VtigerConfiguration'][_0x01e9('0x48')]({'where':{'id':_0xae1299['params']['id']}})[_0x01e9('0x25')](handleEntityNotFound(_0x29095e,null))[_0x01e9('0x25')](removeEntity(_0x29095e,null))[_0x01e9('0x44')](handleError(_0x29095e,null));};exports[_0x01e9('0x49')]=function(_0x4c9c20,_0x33baa8,_0x3bd604){var _0x46839a={};var _0x2526b4={};var _0x4db610;var _0x1ba09d;return db[_0x01e9('0x2c')][_0x01e9('0x4a')]({'where':{'id':_0x4c9c20['params']['id']}})[_0x01e9('0x25')](handleEntityNotFound(_0x33baa8,null))[_0x01e9('0x25')](function(_0x512bec){if(_0x512bec){_0x4db610=_0x512bec;_0x2526b4[_0x01e9('0x2f')]=_[_0x01e9('0x30')](db['VtigerField'][_0x01e9('0x2d')]);_0x2526b4[_0x01e9('0x31')]=_['keys'](_0x4c9c20[_0x01e9('0x31')]);_0x2526b4[_0x01e9('0x32')]=_['intersection'](_0x2526b4['model'],_0x2526b4[_0x01e9('0x31')]);_0x46839a[_0x01e9('0x34')]=_[_0x01e9('0x33')](_0x2526b4[_0x01e9('0x2f')],qs['fields'](_0x4c9c20[_0x01e9('0x31')]['fields']));_0x46839a[_0x01e9('0x34')]=_0x46839a['attributes'][_0x01e9('0x36')]?_0x46839a['attributes']:_0x2526b4[_0x01e9('0x2f')];_0x46839a[_0x01e9('0x38')]=qs['sort'](_0x4c9c20[_0x01e9('0x31')][_0x01e9('0x39')]);_0x46839a[_0x01e9('0x3a')]=qs[_0x01e9('0x32')](_[_0x01e9('0x3b')](_0x4c9c20['query'],_0x2526b4[_0x01e9('0x32')]));if(_0x4c9c20[_0x01e9('0x31')][_0x01e9('0x3c')]){_0x46839a['where']=_[_0x01e9('0x3d')](_0x46839a[_0x01e9('0x3a')],{'$or':_[_0x01e9('0x2b')](_0x46839a[_0x01e9('0x34')],function(_0x339ae6){var _0x573308={};_0x573308[_0x339ae6]={'$like':'%'+_0x4c9c20[_0x01e9('0x31')][_0x01e9('0x3c')]+'%'};return _0x573308;})});}_0x46839a=_[_0x01e9('0x3d')]({},_0x46839a,_0x4c9c20[_0x01e9('0x40')]);return _0x4db610['getFields'](_0x46839a);}})[_0x01e9('0x25')](function(_0x133fe0){if(_0x133fe0){_0x1ba09d=_0x133fe0[_0x01e9('0x36')];if(!_0x4c9c20[_0x01e9('0x31')]['hasOwnProperty'](_0x01e9('0x4b'))){_0x46839a[_0x01e9('0x1f')]=qs['limit'](_0x4c9c20[_0x01e9('0x31')][_0x01e9('0x1f')]);_0x46839a[_0x01e9('0x1c')]=qs[_0x01e9('0x1c')](_0x4c9c20['query'][_0x01e9('0x1c')]);}return _0x4db610[_0x01e9('0x49')](_0x46839a);}})[_0x01e9('0x25')](function(_0x29970b){if(_0x29970b){return _0x29970b?{'count':_0x1ba09d,'rows':_0x29970b}:null;}})[_0x01e9('0x25')](respondWithResult(_0x33baa8,null))[_0x01e9('0x44')](handleError(_0x33baa8,null));};exports['getSubjects']=function(_0x19f50f,_0x2ce75e,_0x1906da){var _0x55fdc9={};var _0x1dea18={};var _0x2a3824;var _0x18a037;return db[_0x01e9('0x2c')]['findOne']({'where':{'id':_0x19f50f[_0x01e9('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ce75e,null))[_0x01e9('0x25')](function(_0x554f6f){if(_0x554f6f){_0x2a3824=_0x554f6f;_0x1dea18[_0x01e9('0x2f')]=_[_0x01e9('0x30')](db[_0x01e9('0x4c')][_0x01e9('0x2d')]);_0x1dea18[_0x01e9('0x31')]=_[_0x01e9('0x30')](_0x19f50f[_0x01e9('0x31')]);_0x1dea18['filters']=_[_0x01e9('0x33')](_0x1dea18['model'],_0x1dea18['query']);_0x55fdc9['attributes']=_['intersection'](_0x1dea18[_0x01e9('0x2f')],qs[_0x01e9('0x35')](_0x19f50f[_0x01e9('0x31')][_0x01e9('0x35')]));_0x55fdc9['attributes']=_0x55fdc9[_0x01e9('0x34')][_0x01e9('0x36')]?_0x55fdc9['attributes']:_0x1dea18[_0x01e9('0x2f')];_0x55fdc9[_0x01e9('0x38')]=qs['sort'](_0x19f50f['query'][_0x01e9('0x39')]);_0x55fdc9[_0x01e9('0x3a')]=qs[_0x01e9('0x32')](_[_0x01e9('0x3b')](_0x19f50f['query'],_0x1dea18['filters']));if(_0x19f50f[_0x01e9('0x31')][_0x01e9('0x3c')]){_0x55fdc9[_0x01e9('0x3a')]=_[_0x01e9('0x3d')](_0x55fdc9['where'],{'$or':_[_0x01e9('0x2b')](_0x55fdc9[_0x01e9('0x34')],function(_0x3cf0d6){var _0xcff315={};_0xcff315[_0x3cf0d6]={'$like':'%'+_0x19f50f['query'][_0x01e9('0x3c')]+'%'};return _0xcff315;})});}_0x55fdc9=_[_0x01e9('0x3d')]({},_0x55fdc9,_0x19f50f[_0x01e9('0x40')]);return _0x2a3824[_0x01e9('0x4d')](_0x55fdc9);}})[_0x01e9('0x25')](function(_0xb0896c){if(_0xb0896c){_0x18a037=_0xb0896c[_0x01e9('0x36')];if(!_0x19f50f[_0x01e9('0x31')][_0x01e9('0x37')](_0x01e9('0x4b'))){_0x55fdc9['limit']=qs[_0x01e9('0x1f')](_0x19f50f[_0x01e9('0x31')][_0x01e9('0x1f')]);_0x55fdc9[_0x01e9('0x1c')]=qs['offset'](_0x19f50f['query'][_0x01e9('0x1c')]);}return _0x2a3824['getSubjects'](_0x55fdc9);}})[_0x01e9('0x25')](function(_0x74e63c){if(_0x74e63c){return _0x74e63c?{'count':_0x18a037,'rows':_0x74e63c}:null;}})['then'](respondWithResult(_0x2ce75e,null))[_0x01e9('0x44')](handleError(_0x2ce75e,null));};exports['getDescriptions']=function(_0x3ccf2a,_0x41bf63,_0x23f859){var _0x106c4c={};var _0x25557b={};var _0x3ff630;var _0x2d9864;return db[_0x01e9('0x2c')][_0x01e9('0x4a')]({'where':{'id':_0x3ccf2a[_0x01e9('0x45')]['id']}})['then'](handleEntityNotFound(_0x41bf63,null))[_0x01e9('0x25')](function(_0xef87b2){if(_0xef87b2){_0x3ff630=_0xef87b2;_0x25557b[_0x01e9('0x2f')]=_[_0x01e9('0x30')](db[_0x01e9('0x4c')]['rawAttributes']);_0x25557b[_0x01e9('0x31')]=_[_0x01e9('0x30')](_0x3ccf2a[_0x01e9('0x31')]);_0x25557b[_0x01e9('0x32')]=_[_0x01e9('0x33')](_0x25557b[_0x01e9('0x2f')],_0x25557b[_0x01e9('0x31')]);_0x106c4c[_0x01e9('0x34')]=_[_0x01e9('0x33')](_0x25557b[_0x01e9('0x2f')],qs[_0x01e9('0x35')](_0x3ccf2a['query'][_0x01e9('0x35')]));_0x106c4c[_0x01e9('0x34')]=_0x106c4c[_0x01e9('0x34')]['length']?_0x106c4c[_0x01e9('0x34')]:_0x25557b[_0x01e9('0x2f')];_0x106c4c[_0x01e9('0x38')]=qs[_0x01e9('0x39')](_0x3ccf2a[_0x01e9('0x31')][_0x01e9('0x39')]);_0x106c4c[_0x01e9('0x3a')]=qs[_0x01e9('0x32')](_[_0x01e9('0x3b')](_0x3ccf2a[_0x01e9('0x31')],_0x25557b['filters']));if(_0x3ccf2a['query']['filter']){_0x106c4c[_0x01e9('0x3a')]=_[_0x01e9('0x3d')](_0x106c4c[_0x01e9('0x3a')],{'$or':_[_0x01e9('0x2b')](_0x106c4c[_0x01e9('0x34')],function(_0x4ecd48){var _0x17e0c2={};_0x17e0c2[_0x4ecd48]={'$like':'%'+_0x3ccf2a['query'][_0x01e9('0x3c')]+'%'};return _0x17e0c2;})});}_0x106c4c=_[_0x01e9('0x3d')]({},_0x106c4c,_0x3ccf2a['options']);return _0x3ff630[_0x01e9('0x4e')](_0x106c4c);}})[_0x01e9('0x25')](function(_0xe55375){if(_0xe55375){_0x2d9864=_0xe55375[_0x01e9('0x36')];if(!_0x3ccf2a[_0x01e9('0x31')]['hasOwnProperty'](_0x01e9('0x4b'))){_0x106c4c[_0x01e9('0x1f')]=qs[_0x01e9('0x1f')](_0x3ccf2a[_0x01e9('0x31')][_0x01e9('0x1f')]);_0x106c4c[_0x01e9('0x1c')]=qs['offset'](_0x3ccf2a[_0x01e9('0x31')][_0x01e9('0x1c')]);}return _0x3ff630[_0x01e9('0x4e')](_0x106c4c);}})[_0x01e9('0x25')](function(_0x529df8){if(_0x529df8){return _0x529df8?{'count':_0x2d9864,'rows':_0x529df8}:null;}})[_0x01e9('0x25')](respondWithResult(_0x41bf63,null))[_0x01e9('0x44')](handleError(_0x41bf63,null));}; \ No newline at end of file +var _0xf491=['mustache','path','sox','to-csv','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','VtigerConfiguration','then','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','findOne','VtigerField','order','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf491,0x178));var _0x1f49=function(_0xc471c0,_0xd91b0){_0xc471c0=_0xc471c0-0x0;var _0x46b386=_0xf491[_0xc471c0];return _0x46b386;};'use strict';var emlformat=require(_0x1f49('0x0'));var rimraf=require(_0x1f49('0x1'));var zipdir=require(_0x1f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1f49('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1f49('0x4'));var util=require('util');var path=require(_0x1f49('0x5'));var sox=require(_0x1f49('0x6'));var csv=require(_0x1f49('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f49('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1f49('0x9'));var toCsv=require(_0x1f49('0x7'));var querystring=require(_0x1f49('0xa'));var Papa=require('papaparse');var Redis=require(_0x1f49('0xb'));var authService=require(_0x1f49('0xc'));var qs=require(_0x1f49('0xd'));var as=require(_0x1f49('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f49('0xf'))(_0x1f49('0x10'));var utils=require(_0x1f49('0x11'));var config=require(_0x1f49('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0b1cc,_0x1a0737){_0x1a0737=_0x1a0737||0xcc;return function(_0x12e6df){if(_0x12e6df){return _0xb0b1cc[_0x1f49('0x13')](_0x1a0737);}return _0xb0b1cc[_0x1f49('0x14')](_0x1a0737)[_0x1f49('0x15')]();};}function respondWithResult(_0x275086,_0x3dba60){_0x3dba60=_0x3dba60||0xc8;return function(_0x1121a2){if(_0x1121a2){return _0x275086[_0x1f49('0x14')](_0x3dba60)['json'](_0x1121a2);}};}function respondWithFilteredResult(_0x516b5d,_0x57890c){return function(_0xb65054){if(_0xb65054){var _0x37948a=typeof _0x57890c[_0x1f49('0x16')]===_0x1f49('0x17')&&typeof _0x57890c['limit']==='undefined';var _0x8c2793=_0xb65054[_0x1f49('0x18')];var _0x5acdd1=_0x37948a?0x0:_0x57890c[_0x1f49('0x16')];var _0x3e21a7=_0x37948a?_0xb65054[_0x1f49('0x18')]:_0x57890c[_0x1f49('0x16')]+_0x57890c[_0x1f49('0x19')];var _0x2c95b6;if(_0x3e21a7>=_0x8c2793){_0x3e21a7=_0x8c2793;_0x2c95b6=0xc8;}else{_0x2c95b6=0xce;}_0x516b5d['status'](_0x2c95b6);return _0x516b5d[_0x1f49('0x1a')]('Content-Range',_0x5acdd1+'-'+_0x3e21a7+'/'+_0x8c2793)[_0x1f49('0x1b')](_0xb65054);}return null;};}function patchUpdates(_0x4d8e93){return function(_0x274ae2){try{jsonpatch[_0x1f49('0x1c')](_0x274ae2,_0x4d8e93,!![]);}catch(_0x51f8f7){return BPromise[_0x1f49('0x1d')](_0x51f8f7);}return _0x274ae2[_0x1f49('0x1e')]();};}function saveUpdates(_0xc27a85,_0x5eca89){return function(_0x286785){if(_0x286785){return _0x286785[_0x1f49('0x1f')](_0xc27a85)['then'](function(_0xa29936){return _0xa29936;});}return null;};}function removeEntity(_0x552eb3,_0x3a05b3){return function(_0xbb97c){if(_0xbb97c){return _0xbb97c[_0x1f49('0x20')]()['then'](function(){_0x552eb3[_0x1f49('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fbd63,_0x1d022d){return function(_0x1077ac){if(!_0x1077ac){_0x3fbd63[_0x1f49('0x13')](0x194);}return _0x1077ac;};}function handleError(_0x374142,_0x4f0355){_0x4f0355=_0x4f0355||0x1f4;return function(_0x20c586){logger[_0x1f49('0x21')](_0x20c586['stack']);if(_0x20c586[_0x1f49('0x22')]){delete _0x20c586[_0x1f49('0x22')];}_0x374142['status'](_0x4f0355)[_0x1f49('0x23')](_0x20c586);};}exports[_0x1f49('0x24')]=function(_0x362f7f,_0x480331){var _0x1034d2={},_0x5e5134={},_0x310763={'count':0x0,'rows':[]};var _0x21f15e=_[_0x1f49('0x25')](db['VtigerConfiguration']['rawAttributes'],function(_0x270f08){return{'name':_0x270f08[_0x1f49('0x26')],'type':_0x270f08[_0x1f49('0x27')][_0x1f49('0x28')]};});_0x5e5134['model']=_[_0x1f49('0x25')](_0x21f15e,_0x1f49('0x22'));_0x5e5134[_0x1f49('0x29')]=_[_0x1f49('0x2a')](_0x362f7f[_0x1f49('0x29')]);_0x5e5134[_0x1f49('0x2b')]=_[_0x1f49('0x2c')](_0x5e5134[_0x1f49('0x2d')],_0x5e5134[_0x1f49('0x29')]);_0x1034d2[_0x1f49('0x2e')]=_['intersection'](_0x5e5134['model'],qs[_0x1f49('0x2f')](_0x362f7f[_0x1f49('0x29')][_0x1f49('0x2f')]));_0x1034d2[_0x1f49('0x2e')]=_0x1034d2[_0x1f49('0x2e')][_0x1f49('0x30')]?_0x1034d2['attributes']:_0x5e5134[_0x1f49('0x2d')];if(!_0x362f7f[_0x1f49('0x29')][_0x1f49('0x31')](_0x1f49('0x32'))){_0x1034d2[_0x1f49('0x19')]=qs[_0x1f49('0x19')](_0x362f7f['query']['limit']);_0x1034d2[_0x1f49('0x16')]=qs[_0x1f49('0x16')](_0x362f7f['query'][_0x1f49('0x16')]);}_0x1034d2['order']=qs[_0x1f49('0x33')](_0x362f7f[_0x1f49('0x29')]['sort']);_0x1034d2['where']=qs[_0x1f49('0x2b')](_['pick'](_0x362f7f[_0x1f49('0x29')],_0x5e5134[_0x1f49('0x2b')]),_0x21f15e);if(_0x362f7f['query'][_0x1f49('0x34')]){_0x1034d2[_0x1f49('0x35')]=_[_0x1f49('0x36')](_0x1034d2[_0x1f49('0x35')],{'$or':_['map'](_0x21f15e,function(_0x78515d){if(_0x78515d[_0x1f49('0x27')]!==_0x1f49('0x37')){var _0x510301={};_0x510301[_0x78515d['name']]={'$like':'%'+_0x362f7f[_0x1f49('0x29')][_0x1f49('0x34')]+'%'};return _0x510301;}})});}_0x1034d2=_['merge']({},_0x1034d2,_0x362f7f[_0x1f49('0x38')]);var _0xf3220c={'where':_0x1034d2[_0x1f49('0x35')]};return db[_0x1f49('0x39')][_0x1f49('0x18')](_0xf3220c)[_0x1f49('0x3a')](function(_0x229665){_0x310763[_0x1f49('0x18')]=_0x229665;if(_0x362f7f[_0x1f49('0x29')][_0x1f49('0x3b')]){_0x1034d2[_0x1f49('0x3c')]=[{'all':!![]}];}return db[_0x1f49('0x39')][_0x1f49('0x3d')](_0x1034d2);})[_0x1f49('0x3a')](function(_0x3d61d0){_0x310763[_0x1f49('0x3e')]=_0x3d61d0;return _0x310763;})[_0x1f49('0x3a')](respondWithFilteredResult(_0x480331,_0x1034d2))[_0x1f49('0x3f')](handleError(_0x480331,null));};exports['show']=function(_0x274d27,_0x4d173f){var _0x3f347d={'raw':![],'where':{'id':_0x274d27['params']['id']}},_0x49e77c={};_0x49e77c[_0x1f49('0x2d')]=_['keys'](db[_0x1f49('0x39')][_0x1f49('0x40')]);_0x49e77c['query']=_['keys'](_0x274d27[_0x1f49('0x29')]);_0x49e77c[_0x1f49('0x2b')]=_[_0x1f49('0x2c')](_0x49e77c[_0x1f49('0x2d')],_0x49e77c[_0x1f49('0x29')]);_0x3f347d[_0x1f49('0x2e')]=_['intersection'](_0x49e77c['model'],qs['fields'](_0x274d27[_0x1f49('0x29')][_0x1f49('0x2f')]));_0x3f347d[_0x1f49('0x2e')]=_0x3f347d['attributes'][_0x1f49('0x30')]?_0x3f347d[_0x1f49('0x2e')]:_0x49e77c[_0x1f49('0x2d')];if(_0x274d27[_0x1f49('0x29')]['includeAll']){_0x3f347d[_0x1f49('0x3c')]=[{'all':!![]}];}_0x3f347d=_[_0x1f49('0x36')]({},_0x3f347d,_0x274d27[_0x1f49('0x38')]);return db[_0x1f49('0x39')][_0x1f49('0x41')](_0x3f347d)[_0x1f49('0x3a')](handleEntityNotFound(_0x4d173f,null))[_0x1f49('0x3a')](respondWithResult(_0x4d173f,null))['catch'](handleError(_0x4d173f,null));};exports[_0x1f49('0x42')]=function(_0x3ee921,_0x145ebe){return db[_0x1f49('0x39')][_0x1f49('0x42')](_0x3ee921[_0x1f49('0x43')],{})[_0x1f49('0x3a')](respondWithResult(_0x145ebe,0xc9))[_0x1f49('0x3f')](handleError(_0x145ebe,null));};exports[_0x1f49('0x1f')]=function(_0x50cd72,_0x5c844a){if(_0x50cd72[_0x1f49('0x43')]['id']){delete _0x50cd72[_0x1f49('0x43')]['id'];}return db[_0x1f49('0x39')]['find']({'where':{'id':_0x50cd72[_0x1f49('0x44')]['id']}})[_0x1f49('0x3a')](handleEntityNotFound(_0x5c844a,null))[_0x1f49('0x3a')](saveUpdates(_0x50cd72[_0x1f49('0x43')],null))['then'](respondWithResult(_0x5c844a,null))[_0x1f49('0x3f')](handleError(_0x5c844a,null));};exports['destroy']=function(_0x213f6a,_0x4f1c65){return db['VtigerConfiguration'][_0x1f49('0x41')]({'where':{'id':_0x213f6a[_0x1f49('0x44')]['id']}})[_0x1f49('0x3a')](handleEntityNotFound(_0x4f1c65,null))[_0x1f49('0x3a')](removeEntity(_0x4f1c65,null))[_0x1f49('0x3f')](handleError(_0x4f1c65,null));};exports['getFields']=function(_0x1d5af4,_0x37035d,_0x163cff){var _0x4373ec={};var _0x558f03={};var _0x14ab4c;var _0x3bd2f2;return db[_0x1f49('0x39')][_0x1f49('0x45')]({'where':{'id':_0x1d5af4[_0x1f49('0x44')]['id']}})[_0x1f49('0x3a')](handleEntityNotFound(_0x37035d,null))[_0x1f49('0x3a')](function(_0x2b683c){if(_0x2b683c){_0x14ab4c=_0x2b683c;_0x558f03['model']=_[_0x1f49('0x2a')](db[_0x1f49('0x46')][_0x1f49('0x40')]);_0x558f03[_0x1f49('0x29')]=_[_0x1f49('0x2a')](_0x1d5af4['query']);_0x558f03['filters']=_['intersection'](_0x558f03[_0x1f49('0x2d')],_0x558f03[_0x1f49('0x29')]);_0x4373ec[_0x1f49('0x2e')]=_[_0x1f49('0x2c')](_0x558f03[_0x1f49('0x2d')],qs[_0x1f49('0x2f')](_0x1d5af4['query'][_0x1f49('0x2f')]));_0x4373ec[_0x1f49('0x2e')]=_0x4373ec[_0x1f49('0x2e')][_0x1f49('0x30')]?_0x4373ec[_0x1f49('0x2e')]:_0x558f03[_0x1f49('0x2d')];_0x4373ec[_0x1f49('0x47')]=qs[_0x1f49('0x33')](_0x1d5af4[_0x1f49('0x29')][_0x1f49('0x33')]);_0x4373ec[_0x1f49('0x35')]=qs[_0x1f49('0x2b')](_[_0x1f49('0x48')](_0x1d5af4[_0x1f49('0x29')],_0x558f03[_0x1f49('0x2b')]));if(_0x1d5af4[_0x1f49('0x29')][_0x1f49('0x34')]){_0x4373ec[_0x1f49('0x35')]=_[_0x1f49('0x36')](_0x4373ec['where'],{'$or':_[_0x1f49('0x25')](_0x4373ec[_0x1f49('0x2e')],function(_0x1a97b4){var _0x19f796={};_0x19f796[_0x1a97b4]={'$like':'%'+_0x1d5af4[_0x1f49('0x29')][_0x1f49('0x34')]+'%'};return _0x19f796;})});}_0x4373ec=_['merge']({},_0x4373ec,_0x1d5af4[_0x1f49('0x38')]);return _0x14ab4c[_0x1f49('0x49')](_0x4373ec);}})[_0x1f49('0x3a')](function(_0x3fb24d){if(_0x3fb24d){_0x3bd2f2=_0x3fb24d[_0x1f49('0x30')];if(!_0x1d5af4[_0x1f49('0x29')][_0x1f49('0x31')](_0x1f49('0x32'))){_0x4373ec[_0x1f49('0x19')]=qs[_0x1f49('0x19')](_0x1d5af4[_0x1f49('0x29')]['limit']);_0x4373ec['offset']=qs[_0x1f49('0x16')](_0x1d5af4[_0x1f49('0x29')][_0x1f49('0x16')]);}return _0x14ab4c[_0x1f49('0x49')](_0x4373ec);}})['then'](function(_0x40c39d){if(_0x40c39d){return _0x40c39d?{'count':_0x3bd2f2,'rows':_0x40c39d}:null;}})[_0x1f49('0x3a')](respondWithResult(_0x37035d,null))['catch'](handleError(_0x37035d,null));};exports['getSubjects']=function(_0x3de8d6,_0x297d8f,_0x1e1f0e){var _0x58a99b={};var _0x40d993={};var _0x459560;var _0x69f9db;return db[_0x1f49('0x39')][_0x1f49('0x45')]({'where':{'id':_0x3de8d6[_0x1f49('0x44')]['id']}})[_0x1f49('0x3a')](handleEntityNotFound(_0x297d8f,null))['then'](function(_0x156d71){if(_0x156d71){_0x459560=_0x156d71;_0x40d993[_0x1f49('0x2d')]=_[_0x1f49('0x2a')](db['VtigerField'][_0x1f49('0x40')]);_0x40d993[_0x1f49('0x29')]=_[_0x1f49('0x2a')](_0x3de8d6['query']);_0x40d993[_0x1f49('0x2b')]=_[_0x1f49('0x2c')](_0x40d993[_0x1f49('0x2d')],_0x40d993[_0x1f49('0x29')]);_0x58a99b[_0x1f49('0x2e')]=_[_0x1f49('0x2c')](_0x40d993[_0x1f49('0x2d')],qs[_0x1f49('0x2f')](_0x3de8d6[_0x1f49('0x29')][_0x1f49('0x2f')]));_0x58a99b[_0x1f49('0x2e')]=_0x58a99b[_0x1f49('0x2e')][_0x1f49('0x30')]?_0x58a99b[_0x1f49('0x2e')]:_0x40d993[_0x1f49('0x2d')];_0x58a99b[_0x1f49('0x47')]=qs['sort'](_0x3de8d6[_0x1f49('0x29')][_0x1f49('0x33')]);_0x58a99b['where']=qs[_0x1f49('0x2b')](_[_0x1f49('0x48')](_0x3de8d6[_0x1f49('0x29')],_0x40d993['filters']));if(_0x3de8d6[_0x1f49('0x29')][_0x1f49('0x34')]){_0x58a99b[_0x1f49('0x35')]=_[_0x1f49('0x36')](_0x58a99b[_0x1f49('0x35')],{'$or':_['map'](_0x58a99b[_0x1f49('0x2e')],function(_0x425526){var _0x57ee02={};_0x57ee02[_0x425526]={'$like':'%'+_0x3de8d6[_0x1f49('0x29')]['filter']+'%'};return _0x57ee02;})});}_0x58a99b=_[_0x1f49('0x36')]({},_0x58a99b,_0x3de8d6['options']);return _0x459560[_0x1f49('0x4a')](_0x58a99b);}})[_0x1f49('0x3a')](function(_0x15fa74){if(_0x15fa74){_0x69f9db=_0x15fa74[_0x1f49('0x30')];if(!_0x3de8d6[_0x1f49('0x29')][_0x1f49('0x31')](_0x1f49('0x32'))){_0x58a99b['limit']=qs[_0x1f49('0x19')](_0x3de8d6[_0x1f49('0x29')]['limit']);_0x58a99b[_0x1f49('0x16')]=qs[_0x1f49('0x16')](_0x3de8d6[_0x1f49('0x29')][_0x1f49('0x16')]);}return _0x459560[_0x1f49('0x4a')](_0x58a99b);}})[_0x1f49('0x3a')](function(_0x2ab68){if(_0x2ab68){return _0x2ab68?{'count':_0x69f9db,'rows':_0x2ab68}:null;}})[_0x1f49('0x3a')](respondWithResult(_0x297d8f,null))[_0x1f49('0x3f')](handleError(_0x297d8f,null));};exports['getDescriptions']=function(_0x4f5610,_0x4ab42c,_0x50ad99){var _0x76f108={};var _0x372a91={};var _0x52b16b;var _0x196e8a;return db['VtigerConfiguration'][_0x1f49('0x45')]({'where':{'id':_0x4f5610[_0x1f49('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ab42c,null))[_0x1f49('0x3a')](function(_0x85af1f){if(_0x85af1f){_0x52b16b=_0x85af1f;_0x372a91['model']=_[_0x1f49('0x2a')](db[_0x1f49('0x46')][_0x1f49('0x40')]);_0x372a91[_0x1f49('0x29')]=_[_0x1f49('0x2a')](_0x4f5610[_0x1f49('0x29')]);_0x372a91[_0x1f49('0x2b')]=_['intersection'](_0x372a91['model'],_0x372a91[_0x1f49('0x29')]);_0x76f108[_0x1f49('0x2e')]=_[_0x1f49('0x2c')](_0x372a91[_0x1f49('0x2d')],qs[_0x1f49('0x2f')](_0x4f5610['query'][_0x1f49('0x2f')]));_0x76f108[_0x1f49('0x2e')]=_0x76f108['attributes'][_0x1f49('0x30')]?_0x76f108[_0x1f49('0x2e')]:_0x372a91['model'];_0x76f108[_0x1f49('0x47')]=qs['sort'](_0x4f5610[_0x1f49('0x29')][_0x1f49('0x33')]);_0x76f108[_0x1f49('0x35')]=qs[_0x1f49('0x2b')](_[_0x1f49('0x48')](_0x4f5610[_0x1f49('0x29')],_0x372a91['filters']));if(_0x4f5610[_0x1f49('0x29')][_0x1f49('0x34')]){_0x76f108[_0x1f49('0x35')]=_['merge'](_0x76f108[_0x1f49('0x35')],{'$or':_[_0x1f49('0x25')](_0x76f108['attributes'],function(_0x55cacf){var _0x3634b8={};_0x3634b8[_0x55cacf]={'$like':'%'+_0x4f5610['query'][_0x1f49('0x34')]+'%'};return _0x3634b8;})});}_0x76f108=_[_0x1f49('0x36')]({},_0x76f108,_0x4f5610['options']);return _0x52b16b[_0x1f49('0x4b')](_0x76f108);}})['then'](function(_0x44f539){if(_0x44f539){_0x196e8a=_0x44f539[_0x1f49('0x30')];if(!_0x4f5610[_0x1f49('0x29')][_0x1f49('0x31')]('nolimit')){_0x76f108[_0x1f49('0x19')]=qs['limit'](_0x4f5610[_0x1f49('0x29')][_0x1f49('0x19')]);_0x76f108[_0x1f49('0x16')]=qs[_0x1f49('0x16')](_0x4f5610['query'][_0x1f49('0x16')]);}return _0x52b16b['getDescriptions'](_0x76f108);}})['then'](function(_0x376de2){if(_0x376de2){return _0x376de2?{'count':_0x196e8a,'rows':_0x376de2}:null;}})['then'](respondWithResult(_0x4ab42c,null))[_0x1f49('0x3f')](handleError(_0x4ab42c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b0e2666..1512f3c 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 _0xc2dd=['rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','request-promise','path'];(function(_0x541dba,_0x400eea){var _0xbd5e5e=function(_0x4f0107){while(--_0x4f0107){_0x541dba['push'](_0x541dba['shift']());}};_0xbd5e5e(++_0x400eea);}(_0xc2dd,0x1c2));var _0xdc2d=function(_0x184277,_0x1e660c){_0x184277=_0x184277-0x0;var _0x5ab14c=_0xc2dd[_0x184277];return _0x5ab14c;};'use strict';var _=require(_0xdc2d('0x0'));var util=require(_0xdc2d('0x1'));var logger=require('../../config/logger')(_0xdc2d('0x2'));var moment=require(_0xdc2d('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc2d('0x4'));var fs=require('fs');var path=require(_0xdc2d('0x5'));var rimraf=require(_0xdc2d('0x6'));var config=require(_0xdc2d('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xdc2d('0x8')]=function(_0x1f8ab9,_0xf57149){return _0x1f8ab9[_0xdc2d('0x9')](_0xdc2d('0xa'),attributes,{'tableName':_0xdc2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97d5=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','api','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x97d5,0x14f));var _0x597d=function(_0x5ea099,_0x30ec16){_0x5ea099=_0x5ea099-0x0;var _0x4ed1e1=_0x97d5[_0x5ea099];return _0x4ed1e1;};'use strict';var _=require(_0x597d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x597d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x597d('0x2'));var fs=require('fs');var path=require(_0x597d('0x3'));var rimraf=require(_0x597d('0x4'));var config=require(_0x597d('0x5'));var attributes=require(_0x597d('0x6'));module[_0x597d('0x7')]=function(_0x2e1342,_0x4de43d){return _0x2e1342[_0x597d('0x8')]('VtigerConfiguration',attributes,{'tableName':_0x597d('0x9'),'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 bc35a90..39f3b58 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 _0xfc32=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x47d035,_0x4e8fca){var _0x20e35a=function(_0x4e60be){while(--_0x4e60be){_0x47d035['push'](_0x47d035['shift']());}};_0x20e35a(++_0x4e8fca);}(_0xfc32,0xaa));var _0x2fc3=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xfc32[_0x26462c];return _0x509a42;};'use strict';var _=require(_0x2fc3('0x0'));var util=require(_0x2fc3('0x1'));var moment=require(_0x2fc3('0x2'));var BPromise=require(_0x2fc3('0x3'));var rs=require(_0x2fc3('0x4'));var fs=require('fs');var Redis=require(_0x2fc3('0x5'));var db=require(_0x2fc3('0x6'))['db'];var utils=require(_0x2fc3('0x7'));var logger=require(_0x2fc3('0x8'))(_0x2fc3('0x9'));var config=require('../../config/environment');var jayson=require(_0x2fc3('0xa'));var client=jayson[_0x2fc3('0xb')][_0x2fc3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x104565,_0x15b617,_0x176e6d){return new BPromise(function(_0x5ea10b,_0x53eaf6){return client[_0x2fc3('0xd')](_0x104565,_0x176e6d)['then'](function(_0x415e4b){logger[_0x2fc3('0xe')](_0x2fc3('0xf'),_0x15b617,_0x2fc3('0x10'));logger[_0x2fc3('0x11')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x15b617,'request\x20sent',JSON[_0x2fc3('0x12')](_0x415e4b));if(_0x415e4b[_0x2fc3('0x13')]){if(_0x415e4b[_0x2fc3('0x13')][_0x2fc3('0x14')]===0x1f4){logger[_0x2fc3('0x13')](_0x2fc3('0xf'),_0x15b617,_0x415e4b[_0x2fc3('0x13')]['message']);return _0x53eaf6(_0x415e4b[_0x2fc3('0x13')][_0x2fc3('0x15')]);}logger[_0x2fc3('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x15b617,_0x415e4b[_0x2fc3('0x13')][_0x2fc3('0x15')]);return _0x5ea10b(_0x415e4b[_0x2fc3('0x13')][_0x2fc3('0x15')]);}else{logger[_0x2fc3('0xe')](_0x2fc3('0xf'),_0x15b617,_0x2fc3('0x10'));_0x5ea10b(_0x415e4b[_0x2fc3('0x16')]['message']);}})['catch'](function(_0x5e92a1){logger[_0x2fc3('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x15b617,_0x5e92a1);_0x53eaf6(_0x5e92a1);});});} \ No newline at end of file +var _0xa233=['message','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x11e256,_0x5647fa){var _0x48035a=function(_0x3736f2){while(--_0x3736f2){_0x11e256['push'](_0x11e256['shift']());}};_0x48035a(++_0x5647fa);}(_0xa233,0x1cf));var _0x3a23=function(_0x578341,_0x53d8d6){_0x578341=_0x578341-0x0;var _0x2e79d7=_0xa233[_0x578341];return _0x2e79d7;};'use strict';var _=require(_0x3a23('0x0'));var util=require('util');var moment=require(_0x3a23('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a23('0x2'));var db=require(_0x3a23('0x3'))['db'];var utils=require(_0x3a23('0x4'));var logger=require(_0x3a23('0x5'))(_0x3a23('0x6'));var config=require(_0x3a23('0x7'));var jayson=require(_0x3a23('0x8'));var client=jayson[_0x3a23('0x9')][_0x3a23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c87ab,_0x5f1cc1,_0x430d4c){return new BPromise(function(_0x37b4e5,_0x1c43ad){return client[_0x3a23('0xb')](_0x1c87ab,_0x430d4c)[_0x3a23('0xc')](function(_0x424382){logger[_0x3a23('0xd')](_0x3a23('0xe'),_0x5f1cc1,'request\x20sent');logger[_0x3a23('0xf')](_0x3a23('0x10'),_0x5f1cc1,_0x3a23('0x11'),JSON[_0x3a23('0x12')](_0x424382));if(_0x424382[_0x3a23('0x13')]){if(_0x424382[_0x3a23('0x13')][_0x3a23('0x14')]===0x1f4){logger['error'](_0x3a23('0xe'),_0x5f1cc1,_0x424382[_0x3a23('0x13')][_0x3a23('0x15')]);return _0x1c43ad(_0x424382[_0x3a23('0x13')][_0x3a23('0x15')]);}logger[_0x3a23('0x13')](_0x3a23('0xe'),_0x5f1cc1,_0x424382[_0x3a23('0x13')][_0x3a23('0x15')]);return _0x37b4e5(_0x424382[_0x3a23('0x13')]['message']);}else{logger['info'](_0x3a23('0xe'),_0x5f1cc1,_0x3a23('0x11'));_0x37b4e5(_0x424382['result']['message']);}})['catch'](function(_0x4d42d1){logger[_0x3a23('0x13')](_0x3a23('0xe'),_0x5f1cc1,_0x4d42d1);_0x1c43ad(_0x4d42d1);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index abbe347..ad53329 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 _0xbccb=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','delete','multer','util','path'];(function(_0x4a95e8,_0x4a3a8b){var _0xcbace9=function(_0x16f1a0){while(--_0x16f1a0){_0x4a95e8['push'](_0x4a95e8['shift']());}};_0xcbace9(++_0x4a3a8b);}(_0xbccb,0x1cd));var _0xbbcc=function(_0x58b301,_0x45e991){_0x58b301=_0x58b301-0x0;var _0x2171b3=_0xbccb[_0x58b301];return _0x2171b3;};'use strict';var multer=require(_0xbbcc('0x0'));var util=require(_0xbbcc('0x1'));var path=require(_0xbbcc('0x2'));var timeout=require(_0xbbcc('0x3'));var express=require(_0xbbcc('0x4'));var router=express[_0xbbcc('0x5')]();var fs_extra=require(_0xbbcc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbbcc('0x7'));var config=require('../../config/environment');var controller=require(_0xbbcc('0x8'));router[_0xbbcc('0x9')]('/',auth[_0xbbcc('0xa')](),controller[_0xbbcc('0xb')]);router[_0xbbcc('0x9')](_0xbbcc('0xc'),auth[_0xbbcc('0xa')](),controller[_0xbbcc('0xd')]);router['post']('/',auth[_0xbbcc('0xa')](),controller[_0xbbcc('0xe')]);router['put'](_0xbbcc('0xc'),auth[_0xbbcc('0xa')](),controller['update']);router[_0xbbcc('0xf')]('/:id',auth[_0xbbcc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8d5b=['util','path','connect-timeout','express','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports'];(function(_0x1ae8ab,_0x6e5c2a){var _0x1ad705=function(_0x1dfa15){while(--_0x1dfa15){_0x1ae8ab['push'](_0x1ae8ab['shift']());}};_0x1ad705(++_0x6e5c2a);}(_0x8d5b,0x165));var _0xb8d5=function(_0x53e297,_0x53189b){_0x53e297=_0x53e297-0x0;var _0x4380ff=_0x8d5b[_0x53e297];return _0x4380ff;};'use strict';var multer=require('multer');var util=require(_0xb8d5('0x0'));var path=require(_0xb8d5('0x1'));var timeout=require(_0xb8d5('0x2'));var express=require(_0xb8d5('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(_0xb8d5('0x4'));var controller=require(_0xb8d5('0x5'));router['get']('/',auth[_0xb8d5('0x6')](),controller[_0xb8d5('0x7')]);router[_0xb8d5('0x8')](_0xb8d5('0x9'),auth[_0xb8d5('0x6')](),controller[_0xb8d5('0xa')]);router[_0xb8d5('0xb')]('/',auth['isAuthenticated'](),controller[_0xb8d5('0xc')]);router[_0xb8d5('0xd')](_0xb8d5('0x9'),auth[_0xb8d5('0x6')](),controller[_0xb8d5('0xe')]);router[_0xb8d5('0xf')]('/:id',auth[_0xb8d5('0x6')](),controller['destroy']);module[_0xb8d5('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index dca25b8..71cbbce 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 _0x226c=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x287021,_0x211c8c){var _0x16ca35=function(_0xbb429a){while(--_0xbb429a){_0x287021['push'](_0x287021['shift']());}};_0x16ca35(++_0x211c8c);}(_0x226c,0xa2));var _0xc226=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x226c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc226('0x0'));module[_0xc226('0x1')]={'type':{'type':Sequelize[_0xc226('0x2')](_0xc226('0x3'),_0xc226('0x4'),_0xc226('0x5'),_0xc226('0x6'),_0xc226('0x7')),'defaultValue':_0xc226('0x3')},'content':{'type':Sequelize[_0xc226('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc226('0x2')](_0xc226('0x3'),_0xc226('0x4'),_0xc226('0x5'))},'keyContent':{'type':Sequelize[_0xc226('0x8')]},'idField':{'type':Sequelize[_0xc226('0x8')]},'nameField':{'type':Sequelize[_0xc226('0x8')]},'customField':{'type':Sequelize[_0xc226('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb766=['BOOLEAN','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x564dce,_0x4f9004){var _0x1e7dd1=function(_0x1c2e67){while(--_0x1c2e67){_0x564dce['push'](_0x564dce['shift']());}};_0x1e7dd1(++_0x4f9004);}(_0xb766,0x135));var _0x6b76=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0xb766[_0x867b0a];return _0x137438;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6b76('0x0')](_0x6b76('0x1'),'variable',_0x6b76('0x2'),_0x6b76('0x3'),'picklist'),'defaultValue':_0x6b76('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6b76('0x4')]},'keyType':{'type':Sequelize[_0x6b76('0x0')](_0x6b76('0x1'),_0x6b76('0x5'),_0x6b76('0x2'))},'keyContent':{'type':Sequelize[_0x6b76('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6b76('0x4')]},'customField':{'type':Sequelize[_0x6b76('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6b76('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 5e4f663..7f5ba17 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 _0xb594=['VtigerField','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','intersection','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','name','send','index','map'];(function(_0x2c6a0d,_0x28a135){var _0x4f9bde=function(_0x2e0f3d){while(--_0x2e0f3d){_0x2c6a0d['push'](_0x2c6a0d['shift']());}};_0x4f9bde(++_0x28a135);}(_0xb594,0xa8));var _0x4b59=function(_0xf7c208,_0x5cbc84){_0xf7c208=_0xf7c208-0x0;var _0x16992d=_0xb594[_0xf7c208];return _0x16992d;};'use strict';var emlformat=require(_0x4b59('0x0'));var rimraf=require(_0x4b59('0x1'));var zipdir=require(_0x4b59('0x2'));var jsonpatch=require(_0x4b59('0x3'));var rp=require(_0x4b59('0x4'));var moment=require(_0x4b59('0x5'));var BPromise=require(_0x4b59('0x6'));var Mustache=require(_0x4b59('0x7'));var util=require('util');var path=require(_0x4b59('0x8'));var sox=require(_0x4b59('0x9'));var csv=require(_0x4b59('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b59('0xb'));var _=require(_0x4b59('0xc'));var squel=require('squel');var crypto=require(_0x4b59('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b59('0xa'));var querystring=require(_0x4b59('0xe'));var Papa=require(_0x4b59('0xf'));var Redis=require(_0x4b59('0x10'));var authService=require(_0x4b59('0x11'));var qs=require(_0x4b59('0x12'));var as=require(_0x4b59('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4b59('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b59('0x15'))['db'];function respondWithStatusCode(_0x5e4579,_0x5b6496){_0x5b6496=_0x5b6496||0xcc;return function(_0x5e8f87){if(_0x5e8f87){return _0x5e4579[_0x4b59('0x16')](_0x5b6496);}return _0x5e4579[_0x4b59('0x17')](_0x5b6496)[_0x4b59('0x18')]();};}function respondWithResult(_0x187bf9,_0x323e96){_0x323e96=_0x323e96||0xc8;return function(_0x4d8a32){if(_0x4d8a32){return _0x187bf9[_0x4b59('0x17')](_0x323e96)[_0x4b59('0x19')](_0x4d8a32);}};}function respondWithFilteredResult(_0x32e310,_0xb796ad){return function(_0xda3791){if(_0xda3791){var _0x20eb3d=typeof _0xb796ad[_0x4b59('0x1a')]===_0x4b59('0x1b')&&typeof _0xb796ad[_0x4b59('0x1c')]==='undefined';var _0xb345a3=_0xda3791[_0x4b59('0x1d')];var _0x437799=_0x20eb3d?0x0:_0xb796ad[_0x4b59('0x1a')];var _0x323187=_0x20eb3d?_0xda3791[_0x4b59('0x1d')]:_0xb796ad[_0x4b59('0x1a')]+_0xb796ad['limit'];var _0x126354;if(_0x323187>=_0xb345a3){_0x323187=_0xb345a3;_0x126354=0xc8;}else{_0x126354=0xce;}_0x32e310[_0x4b59('0x17')](_0x126354);return _0x32e310[_0x4b59('0x1e')]('Content-Range',_0x437799+'-'+_0x323187+'/'+_0xb345a3)[_0x4b59('0x19')](_0xda3791);}return null;};}function patchUpdates(_0x170157){return function(_0x19ad94){try{jsonpatch['apply'](_0x19ad94,_0x170157,!![]);}catch(_0x39c1d2){return BPromise[_0x4b59('0x1f')](_0x39c1d2);}return _0x19ad94[_0x4b59('0x20')]();};}function saveUpdates(_0x37e6f9,_0x2a6857){return function(_0x3e2fa2){if(_0x3e2fa2){return _0x3e2fa2[_0x4b59('0x21')](_0x37e6f9)[_0x4b59('0x22')](function(_0xe4f5d){return _0xe4f5d;});}return null;};}function removeEntity(_0x47e468,_0x595685){return function(_0x33406f){if(_0x33406f){return _0x33406f['destroy']()['then'](function(){_0x47e468['status'](0xcc)[_0x4b59('0x18')]();});}};}function handleEntityNotFound(_0x42af57,_0x28899e){return function(_0x189af2){if(!_0x189af2){_0x42af57[_0x4b59('0x16')](0x194);}return _0x189af2;};}function handleError(_0x4bf31d,_0x3adfda){_0x3adfda=_0x3adfda||0x1f4;return function(_0xef60e7){logger['error'](_0xef60e7['stack']);if(_0xef60e7[_0x4b59('0x23')]){delete _0xef60e7[_0x4b59('0x23')];}_0x4bf31d[_0x4b59('0x17')](_0x3adfda)[_0x4b59('0x24')](_0xef60e7);};}exports[_0x4b59('0x25')]=function(_0x4d925c,_0x52a590){var _0xf59ed5={},_0xd70bec={},_0x5955f4={'count':0x0,'rows':[]};var _0x1d2b33=_[_0x4b59('0x26')](db[_0x4b59('0x27')][_0x4b59('0x28')],function(_0x459231){return{'name':_0x459231['fieldName'],'type':_0x459231[_0x4b59('0x29')][_0x4b59('0x2a')]};});_0xd70bec[_0x4b59('0x2b')]=_[_0x4b59('0x26')](_0x1d2b33,_0x4b59('0x23'));_0xd70bec[_0x4b59('0x2c')]=_['keys'](_0x4d925c[_0x4b59('0x2c')]);_0xd70bec['filters']=_['intersection'](_0xd70bec[_0x4b59('0x2b')],_0xd70bec['query']);_0xf59ed5[_0x4b59('0x2d')]=_['intersection'](_0xd70bec['model'],qs[_0x4b59('0x2e')](_0x4d925c[_0x4b59('0x2c')][_0x4b59('0x2e')]));_0xf59ed5[_0x4b59('0x2d')]=_0xf59ed5['attributes'][_0x4b59('0x2f')]?_0xf59ed5[_0x4b59('0x2d')]:_0xd70bec['model'];if(!_0x4d925c[_0x4b59('0x2c')][_0x4b59('0x30')](_0x4b59('0x31'))){_0xf59ed5[_0x4b59('0x1c')]=qs['limit'](_0x4d925c[_0x4b59('0x2c')][_0x4b59('0x1c')]);_0xf59ed5[_0x4b59('0x1a')]=qs[_0x4b59('0x1a')](_0x4d925c[_0x4b59('0x2c')][_0x4b59('0x1a')]);}_0xf59ed5['order']=qs[_0x4b59('0x32')](_0x4d925c[_0x4b59('0x2c')][_0x4b59('0x32')]);_0xf59ed5[_0x4b59('0x33')]=qs['filters'](_[_0x4b59('0x34')](_0x4d925c['query'],_0xd70bec[_0x4b59('0x35')]),_0x1d2b33);if(_0x4d925c[_0x4b59('0x2c')][_0x4b59('0x36')]){_0xf59ed5[_0x4b59('0x33')]=_[_0x4b59('0x37')](_0xf59ed5[_0x4b59('0x33')],{'$or':_[_0x4b59('0x26')](_0x1d2b33,function(_0x5e5e72){if(_0x5e5e72['type']!==_0x4b59('0x38')){var _0xdd6f9c={};_0xdd6f9c[_0x5e5e72['name']]={'$like':'%'+_0x4d925c['query'][_0x4b59('0x36')]+'%'};return _0xdd6f9c;}})});}_0xf59ed5=_['merge']({},_0xf59ed5,_0x4d925c[_0x4b59('0x39')]);var _0x261501={'where':_0xf59ed5[_0x4b59('0x33')]};return db[_0x4b59('0x27')][_0x4b59('0x1d')](_0x261501)[_0x4b59('0x22')](function(_0x381f4c){_0x5955f4[_0x4b59('0x1d')]=_0x381f4c;if(_0x4d925c['query'][_0x4b59('0x3a')]){_0xf59ed5[_0x4b59('0x3b')]=[{'all':!![]}];}return db[_0x4b59('0x27')]['findAll'](_0xf59ed5);})[_0x4b59('0x22')](function(_0x18f79b){_0x5955f4[_0x4b59('0x3c')]=_0x18f79b;return _0x5955f4;})[_0x4b59('0x22')](respondWithFilteredResult(_0x52a590,_0xf59ed5))[_0x4b59('0x3d')](handleError(_0x52a590,null));};exports[_0x4b59('0x3e')]=function(_0x5618cc,_0x20f80c){var _0x102329={'raw':!![],'where':{'id':_0x5618cc['params']['id']}},_0x4910ff={};_0x4910ff[_0x4b59('0x2b')]=_['keys'](db[_0x4b59('0x27')][_0x4b59('0x28')]);_0x4910ff[_0x4b59('0x2c')]=_[_0x4b59('0x3f')](_0x5618cc[_0x4b59('0x2c')]);_0x4910ff['filters']=_[_0x4b59('0x40')](_0x4910ff['model'],_0x4910ff['query']);_0x102329[_0x4b59('0x2d')]=_[_0x4b59('0x40')](_0x4910ff['model'],qs['fields'](_0x5618cc[_0x4b59('0x2c')][_0x4b59('0x2e')]));_0x102329['attributes']=_0x102329[_0x4b59('0x2d')][_0x4b59('0x2f')]?_0x102329[_0x4b59('0x2d')]:_0x4910ff['model'];if(_0x5618cc[_0x4b59('0x2c')][_0x4b59('0x3a')]){_0x102329[_0x4b59('0x3b')]=[{'all':!![]}];}_0x102329=_[_0x4b59('0x37')]({},_0x102329,_0x5618cc[_0x4b59('0x39')]);return db[_0x4b59('0x27')][_0x4b59('0x41')](_0x102329)['then'](handleEntityNotFound(_0x20f80c,null))[_0x4b59('0x22')](respondWithResult(_0x20f80c,null))[_0x4b59('0x3d')](handleError(_0x20f80c,null));};exports['create']=function(_0x1f895a,_0x137fc9){return db[_0x4b59('0x27')][_0x4b59('0x42')](_0x1f895a['body'],{})[_0x4b59('0x22')](respondWithResult(_0x137fc9,0xc9))['catch'](handleError(_0x137fc9,null));};exports[_0x4b59('0x21')]=function(_0x4b28c6,_0x546782){if(_0x4b28c6[_0x4b59('0x43')]['id']){delete _0x4b28c6[_0x4b59('0x43')]['id'];}return db[_0x4b59('0x27')][_0x4b59('0x41')]({'where':{'id':_0x4b28c6['params']['id']}})['then'](handleEntityNotFound(_0x546782,null))[_0x4b59('0x22')](saveUpdates(_0x4b28c6[_0x4b59('0x43')],null))['then'](respondWithResult(_0x546782,null))['catch'](handleError(_0x546782,null));};exports[_0x4b59('0x44')]=function(_0x90318f,_0x37880f){return db[_0x4b59('0x27')]['find']({'where':{'id':_0x90318f['params']['id']}})[_0x4b59('0x22')](handleEntityNotFound(_0x37880f,null))[_0x4b59('0x22')](removeEntity(_0x37880f,null))[_0x4b59('0x3d')](handleError(_0x37880f,null));}; \ No newline at end of file +var _0x2ffe=['name','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','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','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack'];(function(_0x2ce9c3,_0x20a165){var _0x109b3a=function(_0xfd90e2){while(--_0xfd90e2){_0x2ce9c3['push'](_0x2ce9c3['shift']());}};_0x109b3a(++_0x20a165);}(_0x2ffe,0x155));var _0xe2ff=function(_0x2dc592,_0x275729){_0x2dc592=_0x2dc592-0x0;var _0x566979=_0x2ffe[_0x2dc592];return _0x566979;};'use strict';var emlformat=require(_0xe2ff('0x0'));var rimraf=require(_0xe2ff('0x1'));var zipdir=require(_0xe2ff('0x2'));var jsonpatch=require(_0xe2ff('0x3'));var rp=require(_0xe2ff('0x4'));var moment=require('moment');var BPromise=require(_0xe2ff('0x5'));var Mustache=require(_0xe2ff('0x6'));var util=require(_0xe2ff('0x7'));var path=require(_0xe2ff('0x8'));var sox=require(_0xe2ff('0x9'));var csv=require(_0xe2ff('0xa'));var ejs=require(_0xe2ff('0xb'));var fs=require('fs');var fs_extra=require(_0xe2ff('0xc'));var _=require('lodash');var squel=require(_0xe2ff('0xd'));var crypto=require(_0xe2ff('0xe'));var jsforce=require(_0xe2ff('0xf'));var deskjs=require(_0xe2ff('0x10'));var toCsv=require(_0xe2ff('0xa'));var querystring=require('querystring');var Papa=require(_0xe2ff('0x11'));var Redis=require('ioredis');var authService=require(_0xe2ff('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe2ff('0x13'));var hardwareService=require(_0xe2ff('0x14'));var logger=require(_0xe2ff('0x15'))(_0xe2ff('0x16'));var utils=require(_0xe2ff('0x17'));var config=require(_0xe2ff('0x18'));var licenseUtil=require(_0xe2ff('0x19'));var db=require(_0xe2ff('0x1a'))['db'];function respondWithStatusCode(_0x5ee8e3,_0x1945ab){_0x1945ab=_0x1945ab||0xcc;return function(_0x5960bc){if(_0x5960bc){return _0x5ee8e3[_0xe2ff('0x1b')](_0x1945ab);}return _0x5ee8e3[_0xe2ff('0x1c')](_0x1945ab)[_0xe2ff('0x1d')]();};}function respondWithResult(_0xb0ebdf,_0x586fa9){_0x586fa9=_0x586fa9||0xc8;return function(_0x2b275f){if(_0x2b275f){return _0xb0ebdf['status'](_0x586fa9)[_0xe2ff('0x1e')](_0x2b275f);}};}function respondWithFilteredResult(_0x217ecc,_0xaa72e2){return function(_0x4a0aa3){if(_0x4a0aa3){var _0x57ba9=typeof _0xaa72e2['offset']===_0xe2ff('0x1f')&&typeof _0xaa72e2[_0xe2ff('0x20')]===_0xe2ff('0x1f');var _0x260630=_0x4a0aa3[_0xe2ff('0x21')];var _0x1d5e5a=_0x57ba9?0x0:_0xaa72e2[_0xe2ff('0x22')];var _0x4f6855=_0x57ba9?_0x4a0aa3[_0xe2ff('0x21')]:_0xaa72e2[_0xe2ff('0x22')]+_0xaa72e2['limit'];var _0x12aa77;if(_0x4f6855>=_0x260630){_0x4f6855=_0x260630;_0x12aa77=0xc8;}else{_0x12aa77=0xce;}_0x217ecc['status'](_0x12aa77);return _0x217ecc[_0xe2ff('0x23')](_0xe2ff('0x24'),_0x1d5e5a+'-'+_0x4f6855+'/'+_0x260630)[_0xe2ff('0x1e')](_0x4a0aa3);}return null;};}function patchUpdates(_0x12e2ab){return function(_0x371435){try{jsonpatch[_0xe2ff('0x25')](_0x371435,_0x12e2ab,!![]);}catch(_0x372859){return BPromise[_0xe2ff('0x26')](_0x372859);}return _0x371435[_0xe2ff('0x27')]();};}function saveUpdates(_0x587bec,_0x7e942a){return function(_0x5ba013){if(_0x5ba013){return _0x5ba013[_0xe2ff('0x28')](_0x587bec)[_0xe2ff('0x29')](function(_0x4f19f3){return _0x4f19f3;});}return null;};}function removeEntity(_0x43e839,_0x3bfea3){return function(_0x4efdc9){if(_0x4efdc9){return _0x4efdc9['destroy']()[_0xe2ff('0x29')](function(){_0x43e839['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0330,_0x306025){return function(_0x5de594){if(!_0x5de594){_0x1b0330[_0xe2ff('0x1b')](0x194);}return _0x5de594;};}function handleError(_0x340bae,_0x39839d){_0x39839d=_0x39839d||0x1f4;return function(_0x152503){logger[_0xe2ff('0x2a')](_0x152503[_0xe2ff('0x2b')]);if(_0x152503[_0xe2ff('0x2c')]){delete _0x152503[_0xe2ff('0x2c')];}_0x340bae[_0xe2ff('0x1c')](_0x39839d)['send'](_0x152503);};}exports[_0xe2ff('0x2d')]=function(_0x118a1d,_0x114a01){var _0x37b9aa={},_0x346800={},_0x47192a={'count':0x0,'rows':[]};var _0x4f45b3=_[_0xe2ff('0x2e')](db[_0xe2ff('0x2f')][_0xe2ff('0x30')],function(_0x24711f){return{'name':_0x24711f[_0xe2ff('0x31')],'type':_0x24711f[_0xe2ff('0x32')]['key']};});_0x346800[_0xe2ff('0x33')]=_[_0xe2ff('0x2e')](_0x4f45b3,_0xe2ff('0x2c'));_0x346800[_0xe2ff('0x34')]=_[_0xe2ff('0x35')](_0x118a1d['query']);_0x346800[_0xe2ff('0x36')]=_[_0xe2ff('0x37')](_0x346800['model'],_0x346800['query']);_0x37b9aa['attributes']=_['intersection'](_0x346800[_0xe2ff('0x33')],qs[_0xe2ff('0x38')](_0x118a1d[_0xe2ff('0x34')][_0xe2ff('0x38')]));_0x37b9aa['attributes']=_0x37b9aa[_0xe2ff('0x39')][_0xe2ff('0x3a')]?_0x37b9aa['attributes']:_0x346800['model'];if(!_0x118a1d[_0xe2ff('0x34')]['hasOwnProperty']('nolimit')){_0x37b9aa[_0xe2ff('0x20')]=qs[_0xe2ff('0x20')](_0x118a1d['query'][_0xe2ff('0x20')]);_0x37b9aa[_0xe2ff('0x22')]=qs[_0xe2ff('0x22')](_0x118a1d[_0xe2ff('0x34')][_0xe2ff('0x22')]);}_0x37b9aa['order']=qs[_0xe2ff('0x3b')](_0x118a1d[_0xe2ff('0x34')][_0xe2ff('0x3b')]);_0x37b9aa[_0xe2ff('0x3c')]=qs[_0xe2ff('0x36')](_[_0xe2ff('0x3d')](_0x118a1d[_0xe2ff('0x34')],_0x346800[_0xe2ff('0x36')]),_0x4f45b3);if(_0x118a1d[_0xe2ff('0x34')][_0xe2ff('0x3e')]){_0x37b9aa['where']=_[_0xe2ff('0x3f')](_0x37b9aa[_0xe2ff('0x3c')],{'$or':_[_0xe2ff('0x2e')](_0x4f45b3,function(_0x1ec9ae){if(_0x1ec9ae['type']!==_0xe2ff('0x40')){var _0x7f934a={};_0x7f934a[_0x1ec9ae[_0xe2ff('0x2c')]]={'$like':'%'+_0x118a1d[_0xe2ff('0x34')][_0xe2ff('0x3e')]+'%'};return _0x7f934a;}})});}_0x37b9aa=_['merge']({},_0x37b9aa,_0x118a1d[_0xe2ff('0x41')]);var _0x60f302={'where':_0x37b9aa[_0xe2ff('0x3c')]};return db[_0xe2ff('0x2f')][_0xe2ff('0x21')](_0x60f302)[_0xe2ff('0x29')](function(_0x2f1880){_0x47192a['count']=_0x2f1880;if(_0x118a1d['query'][_0xe2ff('0x42')]){_0x37b9aa[_0xe2ff('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0xe2ff('0x44')](_0x37b9aa);})[_0xe2ff('0x29')](function(_0xd604c1){_0x47192a[_0xe2ff('0x45')]=_0xd604c1;return _0x47192a;})[_0xe2ff('0x29')](respondWithFilteredResult(_0x114a01,_0x37b9aa))[_0xe2ff('0x46')](handleError(_0x114a01,null));};exports[_0xe2ff('0x47')]=function(_0x482f80,_0x149965){var _0x3a5110={'raw':!![],'where':{'id':_0x482f80[_0xe2ff('0x48')]['id']}},_0x48f850={};_0x48f850[_0xe2ff('0x33')]=_[_0xe2ff('0x35')](db[_0xe2ff('0x2f')][_0xe2ff('0x30')]);_0x48f850[_0xe2ff('0x34')]=_[_0xe2ff('0x35')](_0x482f80[_0xe2ff('0x34')]);_0x48f850[_0xe2ff('0x36')]=_[_0xe2ff('0x37')](_0x48f850[_0xe2ff('0x33')],_0x48f850['query']);_0x3a5110[_0xe2ff('0x39')]=_[_0xe2ff('0x37')](_0x48f850[_0xe2ff('0x33')],qs[_0xe2ff('0x38')](_0x482f80[_0xe2ff('0x34')][_0xe2ff('0x38')]));_0x3a5110[_0xe2ff('0x39')]=_0x3a5110[_0xe2ff('0x39')][_0xe2ff('0x3a')]?_0x3a5110[_0xe2ff('0x39')]:_0x48f850[_0xe2ff('0x33')];if(_0x482f80['query'][_0xe2ff('0x42')]){_0x3a5110[_0xe2ff('0x43')]=[{'all':!![]}];}_0x3a5110=_[_0xe2ff('0x3f')]({},_0x3a5110,_0x482f80['options']);return db[_0xe2ff('0x2f')][_0xe2ff('0x49')](_0x3a5110)[_0xe2ff('0x29')](handleEntityNotFound(_0x149965,null))[_0xe2ff('0x29')](respondWithResult(_0x149965,null))[_0xe2ff('0x46')](handleError(_0x149965,null));};exports['create']=function(_0x44f422,_0x43c636){return db[_0xe2ff('0x2f')][_0xe2ff('0x4a')](_0x44f422[_0xe2ff('0x4b')],{})[_0xe2ff('0x29')](respondWithResult(_0x43c636,0xc9))['catch'](handleError(_0x43c636,null));};exports[_0xe2ff('0x28')]=function(_0x874d2,_0x8e44b1){if(_0x874d2[_0xe2ff('0x4b')]['id']){delete _0x874d2[_0xe2ff('0x4b')]['id'];}return db['VtigerField'][_0xe2ff('0x49')]({'where':{'id':_0x874d2[_0xe2ff('0x48')]['id']}})['then'](handleEntityNotFound(_0x8e44b1,null))['then'](saveUpdates(_0x874d2['body'],null))['then'](respondWithResult(_0x8e44b1,null))[_0xe2ff('0x46')](handleError(_0x8e44b1,null));};exports[_0xe2ff('0x4c')]=function(_0x5be505,_0x4cc3df){return db[_0xe2ff('0x2f')][_0xe2ff('0x49')]({'where':{'id':_0x5be505[_0xe2ff('0x48')]['id']}})[_0xe2ff('0x29')](handleEntityNotFound(_0x4cc3df,null))['then'](removeEntity(_0x4cc3df,null))[_0xe2ff('0x46')](handleError(_0x4cc3df,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index a6a7005..cd86984 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 _0x0bd5=['vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x0bd5,0x183));var _0x50bd=function(_0x20be64,_0xc696ae){_0x20be64=_0x20be64-0x0;var _0x12748d=_0x0bd5[_0x20be64];return _0x12748d;};'use strict';var _=require(_0x50bd('0x0'));var util=require(_0x50bd('0x1'));var logger=require(_0x50bd('0x2'))(_0x50bd('0x3'));var moment=require('moment');var BPromise=require(_0x50bd('0x4'));var rp=require(_0x50bd('0x5'));var fs=require('fs');var path=require(_0x50bd('0x6'));var rimraf=require(_0x50bd('0x7'));var config=require(_0x50bd('0x8'));var attributes=require(_0x50bd('0x9'));module[_0x50bd('0xa')]=function(_0x2e84ea,_0x30eeb7){return _0x2e84ea['define'](_0x50bd('0xb'),attributes,{'tableName':_0x50bd('0xc'),'paranoid':![],'indexes':[{'name':_0x50bd('0xd'),'fields':[_0x50bd('0xe'),_0x50bd('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdfa9=['vtiger_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields'];(function(_0x227ca1,_0x102c98){var _0xb27a73=function(_0x421eb3){while(--_0x421eb3){_0x227ca1['push'](_0x227ca1['shift']());}};_0xb27a73(++_0x102c98);}(_0xdfa9,0x72));var _0x9dfa=function(_0x1f2f49,_0x2ff8a5){_0x1f2f49=_0x1f2f49-0x0;var _0x7ef041=_0xdfa9[_0x1f2f49];return _0x7ef041;};'use strict';var _=require('lodash');var util=require(_0x9dfa('0x0'));var logger=require(_0x9dfa('0x1'))(_0x9dfa('0x2'));var moment=require(_0x9dfa('0x3'));var BPromise=require(_0x9dfa('0x4'));var rp=require(_0x9dfa('0x5'));var fs=require('fs');var path=require(_0x9dfa('0x6'));var rimraf=require(_0x9dfa('0x7'));var config=require(_0x9dfa('0x8'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x42e96d,_0x5673bd){return _0x42e96d[_0x9dfa('0x9')](_0x9dfa('0xa'),attributes,{'tableName':_0x9dfa('0xb'),'paranoid':![],'indexes':[{'name':_0x9dfa('0xc'),'fields':['idField',_0x9dfa('0xd')],'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 c78a211..391c031 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 _0xcd4e=['../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x2bc000,_0x48320c){var _0x1fbb8a=function(_0x1c10eb){while(--_0x1c10eb){_0x2bc000['push'](_0x2bc000['shift']());}};_0x1fbb8a(++_0x48320c);}(_0xcd4e,0x187));var _0xecd4=function(_0x45b7b5,_0xd89179){_0x45b7b5=_0x45b7b5-0x0;var _0x3e4aa1=_0xcd4e[_0x45b7b5];return _0x3e4aa1;};'use strict';var _=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var moment=require(_0xecd4('0x2'));var BPromise=require(_0xecd4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecd4('0x4'))['db'];var utils=require(_0xecd4('0x5'));var logger=require('../../config/logger')(_0xecd4('0x6'));var config=require('../../config/environment');var jayson=require(_0xecd4('0x7'));var client=jayson['client'][_0xecd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24fb20,_0xd3a542,_0x4466f1){return new BPromise(function(_0x181253,_0x50c53d){return client[_0xecd4('0x9')](_0x24fb20,_0x4466f1)[_0xecd4('0xa')](function(_0x511c0f){logger[_0xecd4('0xb')]('VtigerField,\x20%s,\x20%s',_0xd3a542,_0xecd4('0xc'));logger[_0xecd4('0xd')](_0xecd4('0xe'),_0xd3a542,'request\x20sent',JSON[_0xecd4('0xf')](_0x511c0f));if(_0x511c0f[_0xecd4('0x10')]){if(_0x511c0f['error'][_0xecd4('0x11')]===0x1f4){logger['error'](_0xecd4('0x12'),_0xd3a542,_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);return _0x50c53d(_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);}logger['error'](_0xecd4('0x12'),_0xd3a542,_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);return _0x181253(_0x511c0f[_0xecd4('0x10')][_0xecd4('0x13')]);}else{logger[_0xecd4('0xb')](_0xecd4('0x12'),_0xd3a542,_0xecd4('0xc'));_0x181253(_0x511c0f[_0xecd4('0x14')]['message']);}})[_0xecd4('0x15')](function(_0x10d1e7){logger[_0xecd4('0x10')](_0xecd4('0x12'),_0xd3a542,_0x10d1e7);_0x50c53d(_0x10d1e7);});});} \ No newline at end of file +var _0x5366=['http','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x37c028,_0x123307){var _0x4627a4=function(_0x27fa4c){while(--_0x27fa4c){_0x37c028['push'](_0x37c028['shift']());}};_0x4627a4(++_0x123307);}(_0x5366,0x137));var _0x6536=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x5366[_0x4347ec];return _0x4c8314;};'use strict';var _=require(_0x6536('0x0'));var util=require(_0x6536('0x1'));var moment=require(_0x6536('0x2'));var BPromise=require(_0x6536('0x3'));var rs=require(_0x6536('0x4'));var fs=require('fs');var Redis=require(_0x6536('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6536('0x6'));var logger=require(_0x6536('0x7'))('rpc');var config=require(_0x6536('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6536('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17edbb,_0x34469a,_0x2dc2f0){return new BPromise(function(_0x5db4fb,_0x520388){return client['request'](_0x17edbb,_0x2dc2f0)['then'](function(_0x109400){logger[_0x6536('0xa')](_0x6536('0xb'),_0x34469a,_0x6536('0xc'));logger[_0x6536('0xd')](_0x6536('0xe'),_0x34469a,_0x6536('0xc'),JSON['stringify'](_0x109400));if(_0x109400[_0x6536('0xf')]){if(_0x109400[_0x6536('0xf')][_0x6536('0x10')]===0x1f4){logger[_0x6536('0xf')](_0x6536('0xb'),_0x34469a,_0x109400[_0x6536('0xf')][_0x6536('0x11')]);return _0x520388(_0x109400['error'][_0x6536('0x11')]);}logger[_0x6536('0xf')]('VtigerField,\x20%s,\x20%s',_0x34469a,_0x109400[_0x6536('0xf')]['message']);return _0x5db4fb(_0x109400['error'][_0x6536('0x11')]);}else{logger[_0x6536('0xa')]('VtigerField,\x20%s,\x20%s',_0x34469a,_0x6536('0xc'));_0x5db4fb(_0x109400[_0x6536('0x12')][_0x6536('0x11')]);}})[_0x6536('0x13')](function(_0x555311){logger['error'](_0x6536('0xb'),_0x34469a,_0x555311);_0x520388(_0x555311);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index a04fe34..4cff52e 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 _0x79fb=['/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZendeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations'];(function(_0x379e66,_0x35293e){var _0x20512c=function(_0x38f5ee){while(--_0x38f5ee){_0x379e66['push'](_0x379e66['shift']());}};_0x20512c(++_0x35293e);}(_0x79fb,0xc2));var _0xb79f=function(_0x4a2c27,_0x5aea8b){_0x4a2c27=_0x4a2c27-0x0;var _0x1e31a9=_0x79fb[_0x4a2c27];return _0x1e31a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb79f('0x0'));var timeout=require(_0xb79f('0x1'));var express=require(_0xb79f('0x2'));var router=express[_0xb79f('0x3')]();var fs_extra=require(_0xb79f('0x4'));var auth=require(_0xb79f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb79f('0x6'));router['get']('/',auth[_0xb79f('0x7')](),controller[_0xb79f('0x8')]);router[_0xb79f('0x9')]('/:id',auth[_0xb79f('0x7')](),controller[_0xb79f('0xa')]);router[_0xb79f('0x9')](_0xb79f('0xb'),auth[_0xb79f('0x7')](),controller[_0xb79f('0xc')]);router[_0xb79f('0x9')](_0xb79f('0xd'),auth['isAuthenticated'](),controller[_0xb79f('0xe')]);router[_0xb79f('0xf')]('/',auth[_0xb79f('0x7')](),controller['create']);router[_0xb79f('0xf')](_0xb79f('0xb'),auth[_0xb79f('0x7')](),controller[_0xb79f('0x10')]);router[_0xb79f('0x11')](_0xb79f('0x12'),auth[_0xb79f('0x7')](),controller[_0xb79f('0x13')]);router[_0xb79f('0x14')](_0xb79f('0x12'),auth[_0xb79f('0x7')](),controller[_0xb79f('0x15')]);module[_0xb79f('0x16')]=router; \ No newline at end of file +var _0x58ef=['isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get'];(function(_0x23c4a9,_0x15eaf1){var _0xf708c5=function(_0x22f2be){while(--_0x22f2be){_0x23c4a9['push'](_0x23c4a9['shift']());}};_0xf708c5(++_0x15eaf1);}(_0x58ef,0x100));var _0xf58e=function(_0x5b2a3f,_0x2fe8df){_0x5b2a3f=_0x5b2a3f-0x0;var _0x40e48a=_0x58ef[_0x5b2a3f];return _0x40e48a;};'use strict';var multer=require('multer');var util=require(_0xf58e('0x0'));var path=require(_0xf58e('0x1'));var timeout=require(_0xf58e('0x2'));var express=require(_0xf58e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf58e('0x4'));var interaction=require(_0xf58e('0x5'));var config=require('../../config/environment');var controller=require(_0xf58e('0x6'));router[_0xf58e('0x7')]('/',auth[_0xf58e('0x8')](),controller['index']);router[_0xf58e('0x7')](_0xf58e('0x9'),auth[_0xf58e('0x8')](),controller['show']);router['get'](_0xf58e('0xa'),auth[_0xf58e('0x8')](),controller[_0xf58e('0xb')]);router[_0xf58e('0x7')](_0xf58e('0xc'),auth['isAuthenticated'](),controller[_0xf58e('0xd')]);router['post']('/',auth[_0xf58e('0x8')](),controller[_0xf58e('0xe')]);router[_0xf58e('0xf')](_0xf58e('0xa'),auth[_0xf58e('0x8')](),controller[_0xf58e('0x10')]);router[_0xf58e('0x11')](_0xf58e('0x9'),auth['isAuthenticated'](),controller[_0xf58e('0x12')]);router[_0xf58e('0x13')](_0xf58e('0x9'),auth[_0xf58e('0x8')](),controller[_0xf58e('0x14')]);module[_0xf58e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 3ec427d..fc17e88 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 _0x1a37=['remoteUri','password','ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x2e4815,_0x20d2a6){var _0x5645cb=function(_0x546a2c){while(--_0x546a2c){_0x2e4815['push'](_0x2e4815['shift']());}};_0x5645cb(++_0x20d2a6);}(_0x1a37,0xb4));var _0x71a3=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x1a37[_0x1e7b16];return _0x37fadc;};'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')},'password':{'type':Sequelize[_0x71a3('0x2')]},'token':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'authType':{'type':Sequelize['ENUM'](_0x71a3('0x5'),'token'),'defaultValue':_0x71a3('0x5')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x71a3('0x6')](_0x71a3('0x7'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x15b2=['ENUM','integrationTab','newTab','exports','STRING','remoteUri','password'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x15b2,0x145));var _0x215b=function(_0x50d5b1,_0x3716b4){_0x50d5b1=_0x50d5b1-0x0;var _0x96ec42=_0x15b2[_0x50d5b1];return _0x96ec42;};'use strict';var Sequelize=require('sequelize');module[_0x215b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x215b('0x1')]},'username':{'type':Sequelize[_0x215b('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x215b('0x1')]},'token':{'type':Sequelize[_0x215b('0x1')]},'remoteUri':{'type':Sequelize[_0x215b('0x1')],'unique':_0x215b('0x2')},'authType':{'type':Sequelize['ENUM'](_0x215b('0x3'),'token'),'defaultValue':_0x215b('0x3')},'serverUrl':{'type':Sequelize[_0x215b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x215b('0x4')](_0x215b('0x5'),_0x215b('0x6')),'defaultValue':_0x215b('0x5')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 823921c..4c8bb69 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 _0x7334=['params','keys','rawAttributes','includeAll','options','find','create','body','destroy','ZendeskConfiguration','pick','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','findOne','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','headers','toString','base64','ValidationError','subject','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','index','map','fieldName','model','name','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','ZendeskAccount','include','findAll','rows','catch','show'];(function(_0x4c521a,_0x8444f2){var _0xbd8b0c=function(_0x570ff4){while(--_0x570ff4){_0x4c521a['push'](_0x4c521a['shift']());}};_0xbd8b0c(++_0x8444f2);}(_0x7334,0x184));var _0x4733=function(_0x5de250,_0x189d78){_0x5de250=_0x5de250-0x0;var _0x19d03f=_0x7334[_0x5de250];return _0x19d03f;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];var integrations=require(_0x4733('0x1a'));function respondWithStatusCode(_0x100ecd,_0x1c146c){_0x1c146c=_0x1c146c||0xcc;return function(_0x2c0f6b){if(_0x2c0f6b){return _0x100ecd['sendStatus'](_0x1c146c);}return _0x100ecd[_0x4733('0x1b')](_0x1c146c)['end']();};}function respondWithResult(_0x4327f3,_0x1a22e4){_0x1a22e4=_0x1a22e4||0xc8;return function(_0x2e5b1b){if(_0x2e5b1b){return _0x4327f3[_0x4733('0x1b')](_0x1a22e4)[_0x4733('0x1c')](_0x2e5b1b);}};}function respondWithFilteredResult(_0x167016,_0x12f111){return function(_0x9fff){if(_0x9fff){var _0x1920ce=typeof _0x12f111['offset']===_0x4733('0x1d')&&typeof _0x12f111[_0x4733('0x1e')]==='undefined';var _0x444824=_0x9fff[_0x4733('0x1f')];var _0x2aa223=_0x1920ce?0x0:_0x12f111[_0x4733('0x20')];var _0x579f67=_0x1920ce?_0x9fff['count']:_0x12f111[_0x4733('0x20')]+_0x12f111[_0x4733('0x1e')];var _0x50c585;if(_0x579f67>=_0x444824){_0x579f67=_0x444824;_0x50c585=0xc8;}else{_0x50c585=0xce;}_0x167016[_0x4733('0x1b')](_0x50c585);return _0x167016[_0x4733('0x21')](_0x4733('0x22'),_0x2aa223+'-'+_0x579f67+'/'+_0x444824)[_0x4733('0x1c')](_0x9fff);}return null;};}function patchUpdates(_0x493cd3){return function(_0x1232e5){try{jsonpatch[_0x4733('0x23')](_0x1232e5,_0x493cd3,!![]);}catch(_0x5d058d){return BPromise[_0x4733('0x24')](_0x5d058d);}return _0x1232e5[_0x4733('0x25')]();};}function saveUpdates(_0x478e34,_0x15a291){return function(_0x115ce4){if(_0x115ce4){return _0x115ce4[_0x4733('0x26')](_0x478e34)[_0x4733('0x27')](function(_0x3a2542){return _0x3a2542;});}return null;};}function removeEntity(_0x24db74,_0x180049){return function(_0x2bb78f){if(_0x2bb78f){return _0x2bb78f['destroy']()[_0x4733('0x27')](function(){_0x24db74[_0x4733('0x1b')](0xcc)[_0x4733('0x28')]();});}};}function handleEntityNotFound(_0x2cb247,_0x30ee9b){return function(_0x3bd683){if(!_0x3bd683){_0x2cb247[_0x4733('0x29')](0x194);}return _0x3bd683;};}function handleError(_0xc3ab0a,_0x13bc12){_0x13bc12=_0x13bc12||0x1f4;return function(_0x23fe6c){logger['error'](_0x23fe6c[_0x4733('0x2a')]);if(_0x23fe6c['name']){delete _0x23fe6c['name'];}_0xc3ab0a[_0x4733('0x1b')](_0x13bc12)['send'](_0x23fe6c);};}exports[_0x4733('0x2b')]=function(_0x479989,_0x4abc0d){var _0x517c73={},_0x2976b0={},_0x3bfe53={'count':0x0,'rows':[]};var _0x29621e=_[_0x4733('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x50f67e){return{'name':_0x50f67e[_0x4733('0x2d')],'type':_0x50f67e['type']['key']};});_0x2976b0[_0x4733('0x2e')]=_[_0x4733('0x2c')](_0x29621e,_0x4733('0x2f'));_0x2976b0['query']=_['keys'](_0x479989[_0x4733('0x30')]);_0x2976b0[_0x4733('0x31')]=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],_0x2976b0[_0x4733('0x30')]);_0x517c73['attributes']=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x479989[_0x4733('0x30')][_0x4733('0x33')]));_0x517c73['attributes']=_0x517c73['attributes'][_0x4733('0x34')]?_0x517c73[_0x4733('0x35')]:_0x2976b0[_0x4733('0x2e')];if(!_0x479989[_0x4733('0x30')][_0x4733('0x36')]('nolimit')){_0x517c73[_0x4733('0x1e')]=qs[_0x4733('0x1e')](_0x479989[_0x4733('0x30')]['limit']);_0x517c73[_0x4733('0x20')]=qs[_0x4733('0x20')](_0x479989[_0x4733('0x30')][_0x4733('0x20')]);}_0x517c73[_0x4733('0x37')]=qs[_0x4733('0x38')](_0x479989[_0x4733('0x30')][_0x4733('0x38')]);_0x517c73['where']=qs[_0x4733('0x31')](_['pick'](_0x479989[_0x4733('0x30')],_0x2976b0[_0x4733('0x31')]),_0x29621e);if(_0x479989[_0x4733('0x30')][_0x4733('0x39')]){_0x517c73[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x517c73[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x29621e,function(_0x592fc2){if(_0x592fc2[_0x4733('0x3c')]!==_0x4733('0x3d')){var _0x5e12c3={};_0x5e12c3[_0x592fc2[_0x4733('0x2f')]]={'$like':'%'+_0x479989[_0x4733('0x30')]['filter']+'%'};return _0x5e12c3;}})});}_0x517c73=_[_0x4733('0x3b')]({},_0x517c73,_0x479989['options']);var _0x43ac2d={'where':_0x517c73['where']};return db[_0x4733('0x3e')][_0x4733('0x1f')](_0x43ac2d)['then'](function(_0x515720){_0x3bfe53[_0x4733('0x1f')]=_0x515720;if(_0x479989[_0x4733('0x30')]['includeAll']){_0x517c73[_0x4733('0x3f')]=[{'all':!![]}];}return db[_0x4733('0x3e')][_0x4733('0x40')](_0x517c73);})[_0x4733('0x27')](function(_0x3ae58c){_0x3bfe53[_0x4733('0x41')]=_0x3ae58c;return _0x3bfe53;})[_0x4733('0x27')](respondWithFilteredResult(_0x4abc0d,_0x517c73))[_0x4733('0x42')](handleError(_0x4abc0d,null));};exports[_0x4733('0x43')]=function(_0x42e055,_0x444471){var _0x1d32df={'raw':![],'where':{'id':_0x42e055[_0x4733('0x44')]['id']}},_0x191c04={};_0x191c04[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x3e')][_0x4733('0x46')]);_0x191c04['query']=_[_0x4733('0x45')](_0x42e055[_0x4733('0x30')]);_0x191c04[_0x4733('0x31')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],_0x191c04[_0x4733('0x30')]);_0x1d32df[_0x4733('0x35')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x42e055[_0x4733('0x30')][_0x4733('0x33')]));_0x1d32df[_0x4733('0x35')]=_0x1d32df[_0x4733('0x35')]['length']?_0x1d32df['attributes']:_0x191c04[_0x4733('0x2e')];if(_0x42e055[_0x4733('0x30')][_0x4733('0x47')]){_0x1d32df[_0x4733('0x3f')]=[{'all':!![]}];}_0x1d32df=_[_0x4733('0x3b')]({},_0x1d32df,_0x42e055[_0x4733('0x48')]);return db[_0x4733('0x3e')][_0x4733('0x49')](_0x1d32df)[_0x4733('0x27')](handleEntityNotFound(_0x444471,null))[_0x4733('0x27')](respondWithResult(_0x444471,null))['catch'](handleError(_0x444471,null));};exports['create']=function(_0x51e201,_0x521ad3){return db[_0x4733('0x3e')][_0x4733('0x4a')](_0x51e201[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x521ad3,0xc9))[_0x4733('0x42')](handleError(_0x521ad3,null));};exports[_0x4733('0x26')]=function(_0x1c6abf,_0x2484f4){if(_0x1c6abf[_0x4733('0x4b')]['id']){delete _0x1c6abf[_0x4733('0x4b')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x1c6abf[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0x2484f4,null))[_0x4733('0x27')](saveUpdates(_0x1c6abf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x2484f4,null))['catch'](handleError(_0x2484f4,null));};exports[_0x4733('0x4c')]=function(_0x45c9ad,_0x31ae69){return db[_0x4733('0x3e')][_0x4733('0x49')]({'where':{'id':_0x45c9ad[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x31ae69,null))[_0x4733('0x27')](removeEntity(_0x31ae69,null))[_0x4733('0x42')](handleError(_0x31ae69,null));};exports['getConfigurations']=function(_0x31fb69,_0xdb1561,_0x899344){var _0x491fa5={};var _0x2effd2={};var _0x130aee;var _0xafb3f8;return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x31fb69[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0xdb1561,null))[_0x4733('0x27')](function(_0x3b8165){if(_0x3b8165){_0x130aee=_0x3b8165;_0x2effd2[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x4d')]['rawAttributes']);_0x2effd2[_0x4733('0x30')]=_[_0x4733('0x45')](_0x31fb69['query']);_0x2effd2['filters']=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],_0x2effd2[_0x4733('0x30')]);_0x491fa5[_0x4733('0x35')]=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x31fb69[_0x4733('0x30')]['fields']));_0x491fa5['attributes']=_0x491fa5[_0x4733('0x35')]['length']?_0x491fa5[_0x4733('0x35')]:_0x2effd2[_0x4733('0x2e')];_0x491fa5[_0x4733('0x37')]=qs['sort'](_0x31fb69['query']['sort']);_0x491fa5[_0x4733('0x3a')]=qs[_0x4733('0x31')](_[_0x4733('0x4e')](_0x31fb69['query'],_0x2effd2[_0x4733('0x31')]));if(_0x31fb69[_0x4733('0x30')][_0x4733('0x39')]){_0x491fa5[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x491fa5[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x491fa5['attributes'],function(_0x1ed9eb){var _0x2b5eec={};_0x2b5eec[_0x1ed9eb]={'$like':'%'+_0x31fb69['query']['filter']+'%'};return _0x2b5eec;})});}_0x491fa5=_[_0x4733('0x3b')]({},_0x491fa5,_0x31fb69[_0x4733('0x48')]);return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x475dad){if(_0x475dad){_0xafb3f8=_0x475dad[_0x4733('0x34')];if(!_0x31fb69[_0x4733('0x30')][_0x4733('0x36')](_0x4733('0x50'))){_0x491fa5['limit']=qs[_0x4733('0x1e')](_0x31fb69[_0x4733('0x30')][_0x4733('0x1e')]);_0x491fa5['offset']=qs[_0x4733('0x20')](_0x31fb69['query'][_0x4733('0x20')]);}return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x3696d6){if(_0x3696d6){return _0x3696d6?{'count':_0xafb3f8,'rows':_0x3696d6}:null;}})[_0x4733('0x27')](respondWithResult(_0xdb1561,null))[_0x4733('0x42')](handleError(_0xdb1561,null));};exports['addConfiguration']=function(_0x137793,_0x574787,_0x15552d){if(_0x137793[_0x4733('0x4b')]['id']){delete _0x137793['body']['id'];}return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x137793['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x574787,null))[_0x4733('0x27')](function(_0x1a0ebf){if(_0x1a0ebf){_0x137793[_0x4733('0x4b')][_0x4733('0x51')]=_0x1a0ebf['id'];_0x137793[_0x4733('0x4b')][_0x4733('0x52')]=integrations[_0x4733('0x53')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793['body']['type']);_0x137793[_0x4733('0x4b')][_0x4733('0x54')]=integrations[_0x4733('0x55')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793[_0x4733('0x4b')][_0x4733('0x3c')]);return db[_0x4733('0x4d')]['create'](_0x137793[_0x4733('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x4733('0x52')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4733('0x27')](respondWithResult(_0x574787,null))['catch'](handleError(_0x574787,null));};exports[_0x4733('0x56')]=function(_0x523498,_0x4e835b,_0x1a7baf){var _0x5c6083='';return db['ZendeskAccount'][_0x4733('0x57')]({'where':{'id':_0x523498[_0x4733('0x44')]['id']},'attributes':['id',_0x4733('0x58'),'password',_0x4733('0x59'),_0x4733('0x5a'),_0x4733('0x5b')]})[_0x4733('0x27')](handleEntityNotFound(_0x4e835b,null))[_0x4733('0x27')](function(_0x29f4e8){if(_0x29f4e8){_0x5c6083=_0x29f4e8['remoteUri'];var _0x3c9e3b=_0x5c6083[_0x4733('0x5c')](-0x1);if(_0x3c9e3b==='/'){_0x5c6083=_0x5c6083[_0x4733('0x5d')](0x0,_0x5c6083['lastIndexOf'](_0x3c9e3b));}var _0x2c0377={'method':_0x4733('0x5e'),'uri':util[_0x4733('0x5f')](_0x4733('0x60'),_0x5c6083,_0x4733('0x61')),'json':!![]};switch(_0x29f4e8[_0x4733('0x5a')]){case _0x4733('0x62'):_0x2c0377[_0x4733('0x63')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x62')]))[_0x4733('0x64')](_0x4733('0x65')))};break;case _0x4733('0x59'):_0x2c0377['headers']={'Authorization':util[_0x4733('0x5f')]('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s/token:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x59')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x4733('0x66'))]('Unknown\x20authentication\x20type');}return rp(_0x2c0377);}})[_0x4733('0x27')](function(_0x2fe1d3){if(_0x2fe1d3){var _0x59cc5b=[_0x4733('0x67'),'description','group',_0x4733('0x68')];_[_0x4733('0x69')](_0x2fe1d3[_0x4733('0x61')],function(_0x5a067b){return _0x59cc5b['includes'](_0x5a067b[_0x4733('0x3c')]);});return{'count':_0x2fe1d3['ticket_fields'][_0x4733('0x34')],'rows':_[_0x4733('0x2c')](_0x2fe1d3[_0x4733('0x61')],function(_0x42657b){return{'id':_0x42657b['id'],'name':_0x42657b[_0x4733('0x6a')]>0x7?_0x42657b[_0x4733('0x6b')]:_0x42657b['type'],'custom':_0x42657b[_0x4733('0x6a')]>0x7?!![]:![],'options':_0x42657b[_0x4733('0x6c')]?_0x42657b[_0x4733('0x6c')]:_0x42657b[_0x4733('0x6d')]?_0x42657b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x4e835b,null))[_0x4733('0x42')](function(_0x4d87c1){var _0x131595=_0x523498[_0x4733('0x30')][_0x4733('0x6e')]?0x1f4:_0x4d87c1[_0x4733('0x6f')]||0x1f4;logger[_0x4733('0x70')](_0x4733('0x71'),_0x4733('0x56'),_0x131595,JSON['stringify'](_0x4d87c1));delete _0x4d87c1[_0x4733('0x2f')];if(_0x131595===0x191){_0x131595=0x190;}_0x4e835b[_0x4733('0x1b')](_0x131595)['send'](_0x523498['query'][_0x4733('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4d87c1[_0x4733('0x6f')]}:_0x4d87c1);});}; \ No newline at end of file +var _0x4483=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','then','rows','catch','params','rawAttributes','length','merge','find','create','body','update','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','lastIndexOf','format','%s/%s','password','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','ticket_fields','includes','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0x4483,0x1a3));var _0x3448=function(_0x4d95b4,_0xcb8aa6){_0x4d95b4=_0x4d95b4-0x0;var _0x2a64a3=_0x4483[_0x4d95b4];return _0x2a64a3;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3448('0x1b'));function respondWithStatusCode(_0x38fbb1,_0x5f52bd){_0x5f52bd=_0x5f52bd||0xcc;return function(_0x2661e1){if(_0x2661e1){return _0x38fbb1[_0x3448('0x1c')](_0x5f52bd);}return _0x38fbb1[_0x3448('0x1d')](_0x5f52bd)['end']();};}function respondWithResult(_0x14104c,_0x2952a6){_0x2952a6=_0x2952a6||0xc8;return function(_0x4daf3e){if(_0x4daf3e){return _0x14104c[_0x3448('0x1d')](_0x2952a6)[_0x3448('0x1e')](_0x4daf3e);}};}function respondWithFilteredResult(_0x46784f,_0x4fc70f){return function(_0x472518){if(_0x472518){var _0x28f5b9=typeof _0x4fc70f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x4fc70f[_0x3448('0x21')]===_0x3448('0x20');var _0x247d1a=_0x472518[_0x3448('0x22')];var _0x4a348c=_0x28f5b9?0x0:_0x4fc70f[_0x3448('0x1f')];var _0x5b410d=_0x28f5b9?_0x472518['count']:_0x4fc70f['offset']+_0x4fc70f[_0x3448('0x21')];var _0x278736;if(_0x5b410d>=_0x247d1a){_0x5b410d=_0x247d1a;_0x278736=0xc8;}else{_0x278736=0xce;}_0x46784f[_0x3448('0x1d')](_0x278736);return _0x46784f['set'](_0x3448('0x23'),_0x4a348c+'-'+_0x5b410d+'/'+_0x247d1a)[_0x3448('0x1e')](_0x472518);}return null;};}function patchUpdates(_0x317de6){return function(_0x18608e){try{jsonpatch[_0x3448('0x24')](_0x18608e,_0x317de6,!![]);}catch(_0x715c3){return BPromise['reject'](_0x715c3);}return _0x18608e['save']();};}function saveUpdates(_0x4e6716,_0x1b3d5a){return function(_0x200f72){if(_0x200f72){return _0x200f72['update'](_0x4e6716)['then'](function(_0x2dcd40){return _0x2dcd40;});}return null;};}function removeEntity(_0x4371d6,_0x22ad5c){return function(_0x4368c7){if(_0x4368c7){return _0x4368c7[_0x3448('0x25')]()['then'](function(){_0x4371d6[_0x3448('0x1d')](0xcc)[_0x3448('0x26')]();});}};}function handleEntityNotFound(_0x114244,_0x2088de){return function(_0x951811){if(!_0x951811){_0x114244['sendStatus'](0x194);}return _0x951811;};}function handleError(_0x329947,_0x393081){_0x393081=_0x393081||0x1f4;return function(_0x52c163){logger[_0x3448('0x27')](_0x52c163[_0x3448('0x28')]);if(_0x52c163[_0x3448('0x29')]){delete _0x52c163[_0x3448('0x29')];}_0x329947[_0x3448('0x1d')](_0x393081)[_0x3448('0x2a')](_0x52c163);};}exports[_0x3448('0x2b')]=function(_0x95714e,_0x5911b8){var _0x3307dc={},_0x450704={},_0xcfdc5={'count':0x0,'rows':[]};var _0x52c09d=_[_0x3448('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x493898){return{'name':_0x493898[_0x3448('0x2d')],'type':_0x493898[_0x3448('0x2e')]['key']};});_0x450704['model']=_[_0x3448('0x2c')](_0x52c09d,_0x3448('0x29'));_0x450704[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x95714e['query']);_0x450704[_0x3448('0x31')]=_[_0x3448('0x32')](_0x450704[_0x3448('0x33')],_0x450704['query']);_0x3307dc[_0x3448('0x34')]=_[_0x3448('0x32')](_0x450704['model'],qs['fields'](_0x95714e[_0x3448('0x2f')][_0x3448('0x35')]));_0x3307dc[_0x3448('0x34')]=_0x3307dc[_0x3448('0x34')]['length']?_0x3307dc[_0x3448('0x34')]:_0x450704[_0x3448('0x33')];if(!_0x95714e[_0x3448('0x2f')][_0x3448('0x36')]('nolimit')){_0x3307dc[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x95714e['query'][_0x3448('0x21')]);_0x3307dc[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x95714e[_0x3448('0x2f')][_0x3448('0x1f')]);}_0x3307dc[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x95714e[_0x3448('0x2f')][_0x3448('0x38')]);_0x3307dc['where']=qs['filters'](_[_0x3448('0x39')](_0x95714e['query'],_0x450704[_0x3448('0x31')]),_0x52c09d);if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]){_0x3307dc[_0x3448('0x3b')]=_['merge'](_0x3307dc[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x52c09d,function(_0x495d7){if(_0x495d7[_0x3448('0x2e')]!==_0x3448('0x3c')){var _0x249131={};_0x249131[_0x495d7[_0x3448('0x29')]]={'$like':'%'+_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x249131;}})});}_0x3307dc=_['merge']({},_0x3307dc,_0x95714e[_0x3448('0x3d')]);var _0x3c92e2={'where':_0x3307dc[_0x3448('0x3b')]};return db[_0x3448('0x3e')][_0x3448('0x22')](_0x3c92e2)['then'](function(_0x18b297){_0xcfdc5[_0x3448('0x22')]=_0x18b297;if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3f')]){_0x3307dc[_0x3448('0x40')]=[{'all':!![]}];}return db[_0x3448('0x3e')][_0x3448('0x41')](_0x3307dc);})[_0x3448('0x42')](function(_0x4a8f80){_0xcfdc5[_0x3448('0x43')]=_0x4a8f80;return _0xcfdc5;})[_0x3448('0x42')](respondWithFilteredResult(_0x5911b8,_0x3307dc))[_0x3448('0x44')](handleError(_0x5911b8,null));};exports['show']=function(_0x2465ff,_0x1d2a7c){var _0x21f989={'raw':![],'where':{'id':_0x2465ff[_0x3448('0x45')]['id']}},_0x26d6b8={};_0x26d6b8[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskAccount'][_0x3448('0x46')]);_0x26d6b8[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x2465ff[_0x3448('0x2f')]);_0x26d6b8[_0x3448('0x31')]=_[_0x3448('0x32')](_0x26d6b8['model'],_0x26d6b8[_0x3448('0x2f')]);_0x21f989['attributes']=_['intersection'](_0x26d6b8[_0x3448('0x33')],qs[_0x3448('0x35')](_0x2465ff['query'][_0x3448('0x35')]));_0x21f989[_0x3448('0x34')]=_0x21f989['attributes'][_0x3448('0x47')]?_0x21f989[_0x3448('0x34')]:_0x26d6b8['model'];if(_0x2465ff[_0x3448('0x2f')][_0x3448('0x3f')]){_0x21f989[_0x3448('0x40')]=[{'all':!![]}];}_0x21f989=_[_0x3448('0x48')]({},_0x21f989,_0x2465ff[_0x3448('0x3d')]);return db[_0x3448('0x3e')][_0x3448('0x49')](_0x21f989)['then'](handleEntityNotFound(_0x1d2a7c,null))['then'](respondWithResult(_0x1d2a7c,null))[_0x3448('0x44')](handleError(_0x1d2a7c,null));};exports[_0x3448('0x4a')]=function(_0x1b82e7,_0x3f48e3){return db['ZendeskAccount'][_0x3448('0x4a')](_0x1b82e7[_0x3448('0x4b')],{})[_0x3448('0x42')](respondWithResult(_0x3f48e3,0xc9))[_0x3448('0x44')](handleError(_0x3f48e3,null));};exports[_0x3448('0x4c')]=function(_0x5d942b,_0x3edd60){if(_0x5d942b['body']['id']){delete _0x5d942b[_0x3448('0x4b')]['id'];}return db[_0x3448('0x3e')]['find']({'where':{'id':_0x5d942b[_0x3448('0x45')]['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x3edd60,null))[_0x3448('0x42')](saveUpdates(_0x5d942b[_0x3448('0x4b')],null))[_0x3448('0x42')](respondWithResult(_0x3edd60,null))[_0x3448('0x44')](handleError(_0x3edd60,null));};exports[_0x3448('0x25')]=function(_0x53236c,_0x23dbda){return db[_0x3448('0x3e')]['find']({'where':{'id':_0x53236c['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x23dbda,null))[_0x3448('0x42')](removeEntity(_0x23dbda,null))['catch'](handleError(_0x23dbda,null));};exports['getConfigurations']=function(_0x371e8a,_0xb6c293,_0x2f795d){var _0x430e74={};var _0x176e60={};var _0x39db50;var _0x2aea70;return db['ZendeskAccount']['findOne']({'where':{'id':_0x371e8a['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0xb6c293,null))[_0x3448('0x42')](function(_0x5cf3fe){if(_0x5cf3fe){_0x39db50=_0x5cf3fe;_0x176e60[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskConfiguration'][_0x3448('0x46')]);_0x176e60[_0x3448('0x2f')]=_['keys'](_0x371e8a[_0x3448('0x2f')]);_0x176e60[_0x3448('0x31')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],_0x176e60[_0x3448('0x2f')]);_0x430e74[_0x3448('0x34')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],qs[_0x3448('0x35')](_0x371e8a['query'][_0x3448('0x35')]));_0x430e74['attributes']=_0x430e74[_0x3448('0x34')][_0x3448('0x47')]?_0x430e74[_0x3448('0x34')]:_0x176e60[_0x3448('0x33')];_0x430e74[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x371e8a['query'][_0x3448('0x38')]);_0x430e74['where']=qs[_0x3448('0x31')](_[_0x3448('0x39')](_0x371e8a[_0x3448('0x2f')],_0x176e60[_0x3448('0x31')]));if(_0x371e8a[_0x3448('0x2f')]['filter']){_0x430e74['where']=_[_0x3448('0x48')](_0x430e74[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x430e74['attributes'],function(_0x7c00fe){var _0x3eb57b={};_0x3eb57b[_0x7c00fe]={'$like':'%'+_0x371e8a[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x3eb57b;})});}_0x430e74=_[_0x3448('0x48')]({},_0x430e74,_0x371e8a[_0x3448('0x3d')]);return _0x39db50[_0x3448('0x4d')](_0x430e74);}})[_0x3448('0x42')](function(_0x36a151){if(_0x36a151){_0x2aea70=_0x36a151[_0x3448('0x47')];if(!_0x371e8a[_0x3448('0x2f')][_0x3448('0x36')](_0x3448('0x4e'))){_0x430e74[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x371e8a[_0x3448('0x2f')][_0x3448('0x21')]);_0x430e74[_0x3448('0x1f')]=qs['offset'](_0x371e8a[_0x3448('0x2f')]['offset']);}return _0x39db50[_0x3448('0x4d')](_0x430e74);}})['then'](function(_0x1f1e3c){if(_0x1f1e3c){return _0x1f1e3c?{'count':_0x2aea70,'rows':_0x1f1e3c}:null;}})[_0x3448('0x42')](respondWithResult(_0xb6c293,null))['catch'](handleError(_0xb6c293,null));};exports[_0x3448('0x4f')]=function(_0x2f6517,_0x54cddd,_0x4f6902){if(_0x2f6517[_0x3448('0x4b')]['id']){delete _0x2f6517['body']['id'];}return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x2f6517[_0x3448('0x45')]['id']}})['then'](handleEntityNotFound(_0x54cddd,null))['then'](function(_0x1385b9){if(_0x1385b9){_0x2f6517[_0x3448('0x4b')][_0x3448('0x51')]=_0x1385b9['id'];_0x2f6517[_0x3448('0x4b')][_0x3448('0x52')]=integrations[_0x3448('0x53')](_0x2f6517[_0x3448('0x4b')][_0x3448('0x54')],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);_0x2f6517[_0x3448('0x4b')][_0x3448('0x55')]=integrations[_0x3448('0x56')](_0x2f6517[_0x3448('0x4b')]['channel'],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);return db['ZendeskConfiguration'][_0x3448('0x4a')](_0x2f6517[_0x3448('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x3448('0x52')},{'model':db[_0x3448('0x57')],'as':_0x3448('0x55')}]});}return null;})['then'](respondWithResult(_0x54cddd,null))['catch'](handleError(_0x54cddd,null));};exports[_0x3448('0x58')]=function(_0x489b70,_0x31dfc5,_0x42c146){var _0x5d952a='';return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x489b70[_0x3448('0x45')]['id']},'attributes':['id',_0x3448('0x59'),'password','token',_0x3448('0x5a'),_0x3448('0x5b')]})[_0x3448('0x42')](handleEntityNotFound(_0x31dfc5,null))[_0x3448('0x42')](function(_0x29dd31){if(_0x29dd31){_0x5d952a=_0x29dd31[_0x3448('0x5b')];var _0x526f38=_0x5d952a[_0x3448('0x5c')](-0x1);if(_0x526f38==='/'){_0x5d952a=_0x5d952a['substring'](0x0,_0x5d952a[_0x3448('0x5d')](_0x526f38));}var _0x2cca2f={'method':'GET','uri':util[_0x3448('0x5e')](_0x3448('0x5f'),_0x5d952a,'ticket_fields'),'json':!![]};switch(_0x29dd31['authType']){case _0x3448('0x60'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x63'),_0x29dd31[_0x3448('0x59')],_0x29dd31[_0x3448('0x60')]))[_0x3448('0x64')](_0x3448('0x65')))};break;case _0x3448('0x66'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x67'),_0x29dd31['username'],_0x29dd31['token']))[_0x3448('0x64')]('base64'))};break;default:throw new db[(_0x3448('0x68'))][(_0x3448('0x69'))]('Unknown\x20authentication\x20type');}return rp(_0x2cca2f);}})[_0x3448('0x42')](function(_0x5f4352){if(_0x5f4352){var _0x15d898=[_0x3448('0x6a'),_0x3448('0x6b'),_0x3448('0x6c'),_0x3448('0x6d')];_['remove'](_0x5f4352[_0x3448('0x6e')],function(_0x2e2b73){return _0x15d898[_0x3448('0x6f')](_0x2e2b73['type']);});return{'count':_0x5f4352[_0x3448('0x6e')][_0x3448('0x47')],'rows':_[_0x3448('0x2c')](_0x5f4352['ticket_fields'],function(_0xdb5d71){return{'id':_0xdb5d71['id'],'name':_0xdb5d71['position']>0x7?_0xdb5d71['title']:_0xdb5d71[_0x3448('0x2e')],'custom':_0xdb5d71['position']>0x7?!![]:![],'options':_0xdb5d71[_0x3448('0x70')]?_0xdb5d71['system_field_options']:_0xdb5d71[_0x3448('0x71')]?_0xdb5d71[_0x3448('0x71')]:[]};})};}})['then'](respondWithResult(_0x31dfc5,null))['catch'](function(_0x2a3e76){var _0x287e21=_0x489b70['query'][_0x3448('0x72')]?0x1f4:_0x2a3e76[_0x3448('0x73')]||0x1f4;logger['error'](_0x3448('0x74'),_0x3448('0x58'),_0x287e21,JSON[_0x3448('0x75')](_0x2a3e76));delete _0x2a3e76[_0x3448('0x29')];if(_0x287e21===0x191){_0x287e21=0x190;}_0x31dfc5['status'](_0x287e21)[_0x3448('0x2a')](_0x489b70['query'][_0x3448('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x2a3e76[_0x3448('0x73')]}:_0x2a3e76);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 54cc15a..993e238 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 _0x051b=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x4c1f1f,_0x3aa18d){var _0x4f9e3c=function(_0x1a94cb){while(--_0x1a94cb){_0x4c1f1f['push'](_0x4c1f1f['shift']());}};_0x4f9e3c(++_0x3aa18d);}(_0x051b,0x17c));var _0xb051=function(_0x112153,_0x34da28){_0x112153=_0x112153-0x0;var _0x24d83e=_0x051b[_0x112153];return _0x24d83e;};'use strict';var _=require(_0xb051('0x0'));var util=require(_0xb051('0x1'));var logger=require(_0xb051('0x2'))(_0xb051('0x3'));var moment=require('moment');var BPromise=require(_0xb051('0x4'));var rp=require(_0xb051('0x5'));var fs=require('fs');var path=require(_0xb051('0x6'));var rimraf=require(_0xb051('0x7'));var config=require(_0xb051('0x8'));var attributes=require(_0xb051('0x9'));var integrations=require(_0xb051('0xa'));module[_0xb051('0xb')]=function(_0x375150,_0x3604b7){return _0x375150[_0xb051('0xc')](_0xb051('0xd'),attributes,{'tableName':_0xb051('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c1a=['bluebird','path','rimraf','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment'];(function(_0x48068f,_0x57d27f){var _0x38fa17=function(_0x611efc){while(--_0x611efc){_0x48068f['push'](_0x48068f['shift']());}};_0x38fa17(++_0x57d27f);}(_0x7c1a,0x80));var _0xa7c1=function(_0x1d5af8,_0x4f041b){_0x1d5af8=_0x1d5af8-0x0;var _0x427556=_0x7c1a[_0x1d5af8];return _0x427556;};'use strict';var _=require(_0xa7c1('0x0'));var util=require('util');var logger=require(_0xa7c1('0x1'))(_0xa7c1('0x2'));var moment=require(_0xa7c1('0x3'));var BPromise=require(_0xa7c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7c1('0x5'));var rimraf=require(_0xa7c1('0x6'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xa7c1('0x7'));module['exports']=function(_0x596cf1,_0x1086ef){return _0x596cf1[_0xa7c1('0x8')](_0xa7c1('0x9'),attributes,{'tableName':_0xa7c1('0xa'),'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 09bc68a..e2942cf 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 _0x6d21=['attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ZendeskAccount','options','raw','where'];(function(_0x38bca2,_0x1c9bf2){var _0x82b6=function(_0x4fbb3f){while(--_0x4fbb3f){_0x38bca2['push'](_0x38bca2['shift']());}};_0x82b6(++_0x1c9bf2);}(_0x6d21,0xfd));var _0x16d2=function(_0x1ce5dd,_0x321073){_0x1ce5dd=_0x1ce5dd-0x0;var _0x2c95dd=_0x6d21[_0x1ce5dd];return _0x2c95dd;};'use strict';var _=require(_0x16d2('0x0'));var util=require('util');var moment=require(_0x16d2('0x1'));var BPromise=require(_0x16d2('0x2'));var rs=require(_0x16d2('0x3'));var fs=require('fs');var Redis=require(_0x16d2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x16d2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d2('0x6'));var jayson=require(_0x16d2('0x7'));var client=jayson[_0x16d2('0x8')][_0x16d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b4476,_0x79e7bf,_0x4d7b15){return new BPromise(function(_0x5d316f,_0x483977){return client[_0x16d2('0xa')](_0x4b4476,_0x4d7b15)[_0x16d2('0xb')](function(_0x52e84a){logger['info'](_0x16d2('0xc'),_0x79e7bf,'request\x20sent');logger[_0x16d2('0xd')](_0x16d2('0xe'),_0x79e7bf,_0x16d2('0xf'),JSON[_0x16d2('0x10')](_0x52e84a));if(_0x52e84a[_0x16d2('0x11')]){if(_0x52e84a[_0x16d2('0x11')][_0x16d2('0x12')]===0x1f4){logger[_0x16d2('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x79e7bf,_0x52e84a[_0x16d2('0x11')][_0x16d2('0x13')]);return _0x483977(_0x52e84a['error'][_0x16d2('0x13')]);}logger[_0x16d2('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x79e7bf,_0x52e84a[_0x16d2('0x11')][_0x16d2('0x13')]);return _0x5d316f(_0x52e84a[_0x16d2('0x11')][_0x16d2('0x13')]);}else{logger[_0x16d2('0x14')](_0x16d2('0xc'),_0x79e7bf,_0x16d2('0xf'));_0x5d316f(_0x52e84a[_0x16d2('0x15')][_0x16d2('0x13')]);}})[_0x16d2('0x16')](function(_0x56075b){logger[_0x16d2('0x11')](_0x16d2('0xc'),_0x79e7bf,_0x56075b);_0x483977(_0x56075b);});});}exports['GetZendeskAccount']=function(_0x162eea){var _0x346937=this;return new Promise(function(_0x36f275,_0x4f2942){return db[_0x16d2('0x17')]['findAll']({'raw':_0x162eea[_0x16d2('0x18')]?_0x162eea[_0x16d2('0x18')][_0x16d2('0x19')]===undefined?!![]:![]:!![],'where':_0x162eea[_0x16d2('0x18')]?_0x162eea[_0x16d2('0x18')][_0x16d2('0x1a')]||null:null,'attributes':_0x162eea[_0x16d2('0x18')]?_0x162eea[_0x16d2('0x18')][_0x16d2('0x1b')]||null:null,'limit':_0x162eea[_0x16d2('0x18')]?_0x162eea[_0x16d2('0x18')][_0x16d2('0x1c')]||null:null,'include':_0x162eea[_0x16d2('0x18')]?_0x162eea[_0x16d2('0x18')][_0x16d2('0x1d')]?_[_0x16d2('0x1e')](_0x162eea[_0x16d2('0x18')]['include'],function(_0x61eb7c){return{'model':db[_0x61eb7c[_0x16d2('0x1f')]],'as':_0x61eb7c['as'],'attributes':_0x61eb7c[_0x16d2('0x1b')],'include':_0x61eb7c[_0x16d2('0x1d')]?_['map'](_0x61eb7c[_0x16d2('0x1d')],function(_0x55b47a){return{'model':db[_0x55b47a[_0x16d2('0x1f')]],'as':_0x55b47a['as'],'attributes':_0x55b47a[_0x16d2('0x1b')],'include':_0x55b47a[_0x16d2('0x1d')]?_[_0x16d2('0x1e')](_0x55b47a[_0x16d2('0x1d')],function(_0x3243c8){return{'model':db[_0x3243c8[_0x16d2('0x1f')]],'as':_0x3243c8['as'],'attributes':_0x3243c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x16d2('0xb')](function(_0x89eca3){logger[_0x16d2('0x14')](_0x16d2('0x20'),_0x162eea);logger[_0x16d2('0xd')](_0x16d2('0x20'),_0x162eea,JSON['stringify'](_0x89eca3));_0x36f275(_0x89eca3);})['catch'](function(_0x288ef9){logger[_0x16d2('0x11')](_0x16d2('0x20'),_0x288ef9['message'],_0x162eea);_0x4f2942(_0x346937[_0x16d2('0x11')](0x1f4,_0x288ef9[_0x16d2('0x13')]));});});};exports[_0x16d2('0x21')]=function(_0xd8c9ed){var _0x4de6a6=this;return new Promise(function(_0x425137,_0x121ee9){return db[_0x16d2('0x17')][_0x16d2('0x22')]({'raw':_0xd8c9ed[_0x16d2('0x18')]?_0xd8c9ed[_0x16d2('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xd8c9ed[_0x16d2('0x18')]?_0xd8c9ed[_0x16d2('0x18')][_0x16d2('0x1a')]||null:null,'attributes':_0xd8c9ed['options']?_0xd8c9ed['options']['attributes']||null:null,'include':_0xd8c9ed[_0x16d2('0x18')]?_0xd8c9ed[_0x16d2('0x18')]['include']?_[_0x16d2('0x1e')](_0xd8c9ed['options'][_0x16d2('0x1d')],function(_0x56d381){return{'model':db[_0x56d381[_0x16d2('0x1f')]],'as':_0x56d381['as'],'attributes':_0x56d381['attributes'],'include':_0x56d381[_0x16d2('0x1d')]?_['map'](_0x56d381[_0x16d2('0x1d')],function(_0x22cb04){return{'model':db[_0x22cb04[_0x16d2('0x1f')]],'as':_0x22cb04['as'],'attributes':_0x22cb04['attributes'],'include':_0x22cb04['include']?_[_0x16d2('0x1e')](_0x22cb04[_0x16d2('0x1d')],function(_0x347656){return{'model':db[_0x347656[_0x16d2('0x1f')]],'as':_0x347656['as'],'attributes':_0x347656[_0x16d2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x16d2('0xb')](function(_0x34d1f8){logger[_0x16d2('0x14')](_0x16d2('0x21'),_0xd8c9ed);logger['debug'](_0x16d2('0x21'),_0xd8c9ed,JSON[_0x16d2('0x10')](_0x34d1f8));_0x425137(_0x34d1f8);})[_0x16d2('0x16')](function(_0x52c832){logger[_0x16d2('0x11')](_0x16d2('0x21'),_0x52c832[_0x16d2('0x13')],_0xd8c9ed);_0x121ee9(_0x4de6a6[_0x16d2('0x11')](0x1f4,_0x52c832[_0x16d2('0x13')]));});});}; \ No newline at end of file +var _0x9d1c=['jayson/promise','client','request','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','options','raw','where','attributes','limit','include','map','model','then','ShowZendeskAccount','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x1b2916,_0x54c8b8){var _0x386928=function(_0x1064ec){while(--_0x1064ec){_0x1b2916['push'](_0x1b2916['shift']());}};_0x386928(++_0x54c8b8);}(_0x9d1c,0xb9));var _0xc9d1=function(_0x5904d2,_0x259561){_0x5904d2=_0x5904d2-0x0;var _0x3ecff7=_0x9d1c[_0x5904d2];return _0x3ecff7;};'use strict';var _=require(_0xc9d1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc9d1('0x1'));var rs=require(_0xc9d1('0x2'));var fs=require('fs');var Redis=require(_0xc9d1('0x3'));var db=require(_0xc9d1('0x4'))['db'];var utils=require(_0xc9d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc9d1('0x6'));var jayson=require(_0xc9d1('0x7'));var client=jayson[_0xc9d1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e563,_0xeea3a0,_0x2d476c){return new BPromise(function(_0x32b599,_0x1607ec){return client[_0xc9d1('0x9')](_0x39e563,_0x2d476c)['then'](function(_0x38da4d){logger[_0xc9d1('0xa')]('ZendeskAccount,\x20%s,\x20%s',_0xeea3a0,_0xc9d1('0xb'));logger[_0xc9d1('0xc')](_0xc9d1('0xd'),_0xeea3a0,_0xc9d1('0xb'),JSON['stringify'](_0x38da4d));if(_0x38da4d[_0xc9d1('0xe')]){if(_0x38da4d[_0xc9d1('0xe')][_0xc9d1('0xf')]===0x1f4){logger[_0xc9d1('0xe')](_0xc9d1('0x10'),_0xeea3a0,_0x38da4d['error'][_0xc9d1('0x11')]);return _0x1607ec(_0x38da4d['error'][_0xc9d1('0x11')]);}logger[_0xc9d1('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0xeea3a0,_0x38da4d[_0xc9d1('0xe')][_0xc9d1('0x11')]);return _0x32b599(_0x38da4d[_0xc9d1('0xe')][_0xc9d1('0x11')]);}else{logger[_0xc9d1('0xa')](_0xc9d1('0x10'),_0xeea3a0,'request\x20sent');_0x32b599(_0x38da4d[_0xc9d1('0x12')][_0xc9d1('0x11')]);}})[_0xc9d1('0x13')](function(_0x140894){logger['error'](_0xc9d1('0x10'),_0xeea3a0,_0x140894);_0x1607ec(_0x140894);});});}exports[_0xc9d1('0x14')]=function(_0x347159){var _0x3dadb0=this;return new Promise(function(_0x51ef10,_0x38e92e){return db['ZendeskAccount']['findAll']({'raw':_0x347159[_0xc9d1('0x15')]?_0x347159[_0xc9d1('0x15')][_0xc9d1('0x16')]===undefined?!![]:![]:!![],'where':_0x347159[_0xc9d1('0x15')]?_0x347159['options'][_0xc9d1('0x17')]||null:null,'attributes':_0x347159[_0xc9d1('0x15')]?_0x347159[_0xc9d1('0x15')][_0xc9d1('0x18')]||null:null,'limit':_0x347159[_0xc9d1('0x15')]?_0x347159[_0xc9d1('0x15')][_0xc9d1('0x19')]||null:null,'include':_0x347159[_0xc9d1('0x15')]?_0x347159[_0xc9d1('0x15')][_0xc9d1('0x1a')]?_[_0xc9d1('0x1b')](_0x347159['options']['include'],function(_0x3e6dd5){return{'model':db[_0x3e6dd5[_0xc9d1('0x1c')]],'as':_0x3e6dd5['as'],'attributes':_0x3e6dd5['attributes'],'include':_0x3e6dd5[_0xc9d1('0x1a')]?_['map'](_0x3e6dd5[_0xc9d1('0x1a')],function(_0x4e13f8){return{'model':db[_0x4e13f8[_0xc9d1('0x1c')]],'as':_0x4e13f8['as'],'attributes':_0x4e13f8[_0xc9d1('0x18')],'include':_0x4e13f8[_0xc9d1('0x1a')]?_['map'](_0x4e13f8['include'],function(_0x560000){return{'model':db[_0x560000[_0xc9d1('0x1c')]],'as':_0x560000['as'],'attributes':_0x560000[_0xc9d1('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc9d1('0x1d')](function(_0x21e28a){logger['info'](_0xc9d1('0x14'),_0x347159);logger[_0xc9d1('0xc')](_0xc9d1('0x14'),_0x347159,JSON['stringify'](_0x21e28a));_0x51ef10(_0x21e28a);})[_0xc9d1('0x13')](function(_0x3aa879){logger[_0xc9d1('0xe')]('GetZendeskAccount',_0x3aa879['message'],_0x347159);_0x38e92e(_0x3dadb0[_0xc9d1('0xe')](0x1f4,_0x3aa879[_0xc9d1('0x11')]));});});};exports[_0xc9d1('0x1e')]=function(_0x869124){var _0x3199c4=this;return new Promise(function(_0x16682a,_0x519a0e){return db['ZendeskAccount']['find']({'raw':_0x869124[_0xc9d1('0x15')]?_0x869124['options'][_0xc9d1('0x16')]===undefined?!![]:![]:!![],'where':_0x869124[_0xc9d1('0x15')]?_0x869124['options']['where']||null:null,'attributes':_0x869124['options']?_0x869124[_0xc9d1('0x15')][_0xc9d1('0x18')]||null:null,'include':_0x869124[_0xc9d1('0x15')]?_0x869124[_0xc9d1('0x15')]['include']?_[_0xc9d1('0x1b')](_0x869124['options'][_0xc9d1('0x1a')],function(_0x35b6e7){return{'model':db[_0x35b6e7[_0xc9d1('0x1c')]],'as':_0x35b6e7['as'],'attributes':_0x35b6e7['attributes'],'include':_0x35b6e7[_0xc9d1('0x1a')]?_[_0xc9d1('0x1b')](_0x35b6e7['include'],function(_0x2d6b15){return{'model':db[_0x2d6b15['model']],'as':_0x2d6b15['as'],'attributes':_0x2d6b15[_0xc9d1('0x18')],'include':_0x2d6b15['include']?_[_0xc9d1('0x1b')](_0x2d6b15[_0xc9d1('0x1a')],function(_0x403f13){return{'model':db[_0x403f13[_0xc9d1('0x1c')]],'as':_0x403f13['as'],'attributes':_0x403f13[_0xc9d1('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58d042){logger[_0xc9d1('0xa')](_0xc9d1('0x1e'),_0x869124);logger[_0xc9d1('0xc')](_0xc9d1('0x1e'),_0x869124,JSON[_0xc9d1('0x1f')](_0x58d042));_0x16682a(_0x58d042);})[_0xc9d1('0x13')](function(_0xe064d9){logger[_0xc9d1('0xe')]('ShowZendeskAccount',_0xe064d9[_0xc9d1('0x11')],_0x869124);_0x519a0e(_0x3199c4[_0xc9d1('0xe')](0x1f4,_0xe064d9[_0xc9d1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index a72ab4d..5264478 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 _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x2bcf5e,_0x5d9059){var _0x94e486=function(_0x24344f){while(--_0x24344f){_0x2bcf5e['push'](_0x2bcf5e['shift']());}};_0x94e486(++_0x5d9059);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xcb91[_0x1597e2];return _0x4c8c0a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router; \ No newline at end of file +var _0x5eb8=['getTags','post','/:id/tags','setTags','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x51af56,_0x49527a){var _0x48eb3c=function(_0x55b87b){while(--_0x55b87b){_0x51af56['push'](_0x51af56['shift']());}};_0x48eb3c(++_0x49527a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3b0d98,_0x346f06){_0x3b0d98=_0x3b0d98-0x0;var _0x296885=_0x5eb8[_0x3b0d98];return _0x296885;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x9')]('/:id/tags',auth[_0x85eb('0xa')](),controller[_0x85eb('0x14')]);router[_0x85eb('0x15')]('/',auth[_0x85eb('0xa')](),controller['create']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),controller[_0x85eb('0x17')]);router[_0x85eb('0x18')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x19')]);router['delete'](_0x85eb('0xc'),auth['isAuthenticated'](),controller[_0x85eb('0x1a')]);module[_0x85eb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5b61849..019e71b 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 _0x8990=['STRING','sequelize','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8990,0x88));var _0x0899=function(_0x5c883f,_0x38f092){_0x5c883f=_0x5c883f-0x0;var _0x4210cc=_0x8990[_0x5c883f];return _0x4210cc;};'use strict';var Sequelize=require(_0x0899('0x0'));module[_0x0899('0x1')]={'name':{'type':Sequelize[_0x0899('0x2')]},'description':{'type':Sequelize[_0x0899('0x2')]}}; \ No newline at end of file +var _0x5ad3=['sequelize'];(function(_0x34fcba,_0x2a0bee){var _0x5c4f41=function(_0x44b38b){while(--_0x44b38b){_0x34fcba['push'](_0x34fcba['shift']());}};_0x5c4f41(++_0x2a0bee);}(_0x5ad3,0xc9));var _0x35ad=function(_0xe1441d,_0x36fb8e){_0xe1441d=_0xe1441d-0x0;var _0x2ef242=_0x5ad3[_0xe1441d];return _0x2ef242;};'use strict';var Sequelize=require(_0x35ad('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d4ce826..eb342fc 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 _0x0fa4=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskConfiguration','rows','catch','show','keys','create','body','find','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs'];(function(_0x323ec9,_0x35ad88){var _0x33e713=function(_0x11cbb4){while(--_0x11cbb4){_0x323ec9['push'](_0x323ec9['shift']());}};_0x33e713(++_0x35ad88);}(_0x0fa4,0xaa));var _0x40fa=function(_0x3149cf,_0x1266eb){_0x3149cf=_0x3149cf-0x0;var _0x4d283a=_0x0fa4[_0x3149cf];return _0x4d283a;};'use strict';var emlformat=require(_0x40fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40fa('0x1'));var jsonpatch=require(_0x40fa('0x2'));var rp=require(_0x40fa('0x3'));var moment=require(_0x40fa('0x4'));var BPromise=require(_0x40fa('0x5'));var Mustache=require('mustache');var util=require(_0x40fa('0x6'));var path=require(_0x40fa('0x7'));var sox=require(_0x40fa('0x8'));var csv=require('to-csv');var ejs=require(_0x40fa('0x9'));var fs=require('fs');var fs_extra=require(_0x40fa('0xa'));var _=require(_0x40fa('0xb'));var squel=require(_0x40fa('0xc'));var crypto=require(_0x40fa('0xd'));var jsforce=require(_0x40fa('0xe'));var deskjs=require(_0x40fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x40fa('0x10'));var Papa=require(_0x40fa('0x11'));var Redis=require(_0x40fa('0x12'));var authService=require(_0x40fa('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x40fa('0x14'));var hardwareService=require(_0x40fa('0x15'));var logger=require(_0x40fa('0x16'))(_0x40fa('0x17'));var utils=require(_0x40fa('0x18'));var config=require(_0x40fa('0x19'));var licenseUtil=require(_0x40fa('0x1a'));var db=require(_0x40fa('0x1b'))['db'];function respondWithStatusCode(_0x17876a,_0xdbc414){_0xdbc414=_0xdbc414||0xcc;return function(_0x214e7e){if(_0x214e7e){return _0x17876a[_0x40fa('0x1c')](_0xdbc414);}return _0x17876a[_0x40fa('0x1d')](_0xdbc414)[_0x40fa('0x1e')]();};}function respondWithResult(_0xafaf1b,_0x23ab3a){_0x23ab3a=_0x23ab3a||0xc8;return function(_0x16e0d6){if(_0x16e0d6){return _0xafaf1b[_0x40fa('0x1d')](_0x23ab3a)[_0x40fa('0x1f')](_0x16e0d6);}};}function respondWithFilteredResult(_0xdec77b,_0x41a098){return function(_0x3652d8){if(_0x3652d8){var _0x5a60e8=typeof _0x41a098[_0x40fa('0x20')]===_0x40fa('0x21')&&typeof _0x41a098[_0x40fa('0x22')]==='undefined';var _0x1d481d=_0x3652d8[_0x40fa('0x23')];var _0x588dd6=_0x5a60e8?0x0:_0x41a098['offset'];var _0x21133c=_0x5a60e8?_0x3652d8[_0x40fa('0x23')]:_0x41a098[_0x40fa('0x20')]+_0x41a098[_0x40fa('0x22')];var _0x489ebc;if(_0x21133c>=_0x1d481d){_0x21133c=_0x1d481d;_0x489ebc=0xc8;}else{_0x489ebc=0xce;}_0xdec77b[_0x40fa('0x1d')](_0x489ebc);return _0xdec77b[_0x40fa('0x24')](_0x40fa('0x25'),_0x588dd6+'-'+_0x21133c+'/'+_0x1d481d)['json'](_0x3652d8);}return null;};}function patchUpdates(_0x267ca5){return function(_0x3bdbd5){try{jsonpatch[_0x40fa('0x26')](_0x3bdbd5,_0x267ca5,!![]);}catch(_0x4ef8ff){return BPromise[_0x40fa('0x27')](_0x4ef8ff);}return _0x3bdbd5[_0x40fa('0x28')]();};}function saveUpdates(_0x4883c4,_0x3e61f2){return function(_0x421019){if(_0x421019){return _0x421019[_0x40fa('0x29')](_0x4883c4)[_0x40fa('0x2a')](function(_0x180855){return _0x180855;});}return null;};}function removeEntity(_0x55da5f,_0x514f2f){return function(_0x489091){if(_0x489091){return _0x489091[_0x40fa('0x2b')]()[_0x40fa('0x2a')](function(){_0x55da5f[_0x40fa('0x1d')](0xcc)[_0x40fa('0x1e')]();});}};}function handleEntityNotFound(_0x150e4a,_0x242fc3){return function(_0x5922db){if(!_0x5922db){_0x150e4a[_0x40fa('0x1c')](0x194);}return _0x5922db;};}function handleError(_0x24bc3d,_0x343643){_0x343643=_0x343643||0x1f4;return function(_0x5683b1){logger[_0x40fa('0x2c')](_0x5683b1[_0x40fa('0x2d')]);if(_0x5683b1[_0x40fa('0x2e')]){delete _0x5683b1[_0x40fa('0x2e')];}_0x24bc3d['status'](_0x343643)['send'](_0x5683b1);};}exports[_0x40fa('0x2f')]=function(_0x22c2ab,_0x5551db){var _0x55a73c={},_0x46ef8d={},_0x54a980={'count':0x0,'rows':[]};var _0x4ee2e6=_[_0x40fa('0x30')](db['ZendeskConfiguration'][_0x40fa('0x31')],function(_0x3de0ff){return{'name':_0x3de0ff[_0x40fa('0x32')],'type':_0x3de0ff[_0x40fa('0x33')][_0x40fa('0x34')]};});_0x46ef8d[_0x40fa('0x35')]=_[_0x40fa('0x30')](_0x4ee2e6,_0x40fa('0x2e'));_0x46ef8d[_0x40fa('0x36')]=_['keys'](_0x22c2ab[_0x40fa('0x36')]);_0x46ef8d[_0x40fa('0x37')]=_[_0x40fa('0x38')](_0x46ef8d[_0x40fa('0x35')],_0x46ef8d['query']);_0x55a73c[_0x40fa('0x39')]=_['intersection'](_0x46ef8d[_0x40fa('0x35')],qs[_0x40fa('0x3a')](_0x22c2ab[_0x40fa('0x36')][_0x40fa('0x3a')]));_0x55a73c[_0x40fa('0x39')]=_0x55a73c[_0x40fa('0x39')][_0x40fa('0x3b')]?_0x55a73c['attributes']:_0x46ef8d[_0x40fa('0x35')];if(!_0x22c2ab[_0x40fa('0x36')][_0x40fa('0x3c')](_0x40fa('0x3d'))){_0x55a73c[_0x40fa('0x22')]=qs[_0x40fa('0x22')](_0x22c2ab[_0x40fa('0x36')]['limit']);_0x55a73c[_0x40fa('0x20')]=qs[_0x40fa('0x20')](_0x22c2ab['query'][_0x40fa('0x20')]);}_0x55a73c[_0x40fa('0x3e')]=qs[_0x40fa('0x3f')](_0x22c2ab[_0x40fa('0x36')][_0x40fa('0x3f')]);_0x55a73c[_0x40fa('0x40')]=qs[_0x40fa('0x37')](_[_0x40fa('0x41')](_0x22c2ab['query'],_0x46ef8d[_0x40fa('0x37')]),_0x4ee2e6);if(_0x22c2ab['query'][_0x40fa('0x42')]){_0x55a73c[_0x40fa('0x40')]=_[_0x40fa('0x43')](_0x55a73c[_0x40fa('0x40')],{'$or':_['map'](_0x4ee2e6,function(_0x23d142){if(_0x23d142[_0x40fa('0x33')]!==_0x40fa('0x44')){var _0x219fe0={};_0x219fe0[_0x23d142[_0x40fa('0x2e')]]={'$like':'%'+_0x22c2ab[_0x40fa('0x36')][_0x40fa('0x42')]+'%'};return _0x219fe0;}})});}_0x55a73c=_[_0x40fa('0x43')]({},_0x55a73c,_0x22c2ab[_0x40fa('0x45')]);var _0x3aa469={'where':_0x55a73c['where']};return db['ZendeskConfiguration'][_0x40fa('0x23')](_0x3aa469)[_0x40fa('0x2a')](function(_0xae5ffe){_0x54a980[_0x40fa('0x23')]=_0xae5ffe;if(_0x22c2ab[_0x40fa('0x36')][_0x40fa('0x46')]){_0x55a73c[_0x40fa('0x47')]=[{'all':!![]}];}return db[_0x40fa('0x48')]['findAll'](_0x55a73c);})[_0x40fa('0x2a')](function(_0x3411ba){_0x54a980[_0x40fa('0x49')]=_0x3411ba;return _0x54a980;})[_0x40fa('0x2a')](respondWithFilteredResult(_0x5551db,_0x55a73c))[_0x40fa('0x4a')](handleError(_0x5551db,null));};exports[_0x40fa('0x4b')]=function(_0x45e2f3,_0x4aff54){var _0x1aa407={'raw':![],'where':{'id':_0x45e2f3['params']['id']}},_0x31b22c={};_0x31b22c[_0x40fa('0x35')]=_[_0x40fa('0x4c')](db[_0x40fa('0x48')][_0x40fa('0x31')]);_0x31b22c[_0x40fa('0x36')]=_[_0x40fa('0x4c')](_0x45e2f3[_0x40fa('0x36')]);_0x31b22c[_0x40fa('0x37')]=_[_0x40fa('0x38')](_0x31b22c[_0x40fa('0x35')],_0x31b22c[_0x40fa('0x36')]);_0x1aa407['attributes']=_[_0x40fa('0x38')](_0x31b22c[_0x40fa('0x35')],qs[_0x40fa('0x3a')](_0x45e2f3[_0x40fa('0x36')]['fields']));_0x1aa407['attributes']=_0x1aa407[_0x40fa('0x39')][_0x40fa('0x3b')]?_0x1aa407[_0x40fa('0x39')]:_0x31b22c[_0x40fa('0x35')];if(_0x45e2f3['query'][_0x40fa('0x46')]){_0x1aa407[_0x40fa('0x47')]=[{'all':!![]}];}_0x1aa407=_['merge']({},_0x1aa407,_0x45e2f3[_0x40fa('0x45')]);return db['ZendeskConfiguration']['find'](_0x1aa407)[_0x40fa('0x2a')](handleEntityNotFound(_0x4aff54,null))['then'](respondWithResult(_0x4aff54,null))['catch'](handleError(_0x4aff54,null));};exports[_0x40fa('0x4d')]=function(_0x331cb6,_0x33cc82){return db[_0x40fa('0x48')]['create'](_0x331cb6[_0x40fa('0x4e')],{})[_0x40fa('0x2a')](respondWithResult(_0x33cc82,0xc9))[_0x40fa('0x4a')](handleError(_0x33cc82,null));};exports[_0x40fa('0x29')]=function(_0x1eab7e,_0x1ded8d){if(_0x1eab7e[_0x40fa('0x4e')]['id']){delete _0x1eab7e[_0x40fa('0x4e')]['id'];}return db[_0x40fa('0x48')][_0x40fa('0x4f')]({'where':{'id':_0x1eab7e[_0x40fa('0x50')]['id']}})[_0x40fa('0x2a')](handleEntityNotFound(_0x1ded8d,null))[_0x40fa('0x2a')](saveUpdates(_0x1eab7e[_0x40fa('0x4e')],null))[_0x40fa('0x2a')](respondWithResult(_0x1ded8d,null))[_0x40fa('0x4a')](handleError(_0x1ded8d,null));};exports[_0x40fa('0x2b')]=function(_0x4c5f7f,_0x8fc7aa){return db['ZendeskConfiguration'][_0x40fa('0x4f')]({'where':{'id':_0x4c5f7f[_0x40fa('0x50')]['id']}})[_0x40fa('0x2a')](handleEntityNotFound(_0x8fc7aa,null))[_0x40fa('0x2a')](removeEntity(_0x8fc7aa,null))['catch'](handleError(_0x8fc7aa,null));};exports[_0x40fa('0x51')]=function(_0x4c2104,_0x5dff68,_0x27654e){var _0x3ca47d={};var _0x1f62f0={};var _0x5b1ae1;var _0xc3b2de;return db[_0x40fa('0x48')][_0x40fa('0x52')]({'where':{'id':_0x4c2104['params']['id']}})['then'](handleEntityNotFound(_0x5dff68,null))['then'](function(_0xe785fe){if(_0xe785fe){_0x5b1ae1=_0xe785fe;_0x1f62f0['model']=_[_0x40fa('0x4c')](db[_0x40fa('0x53')][_0x40fa('0x31')]);_0x1f62f0[_0x40fa('0x36')]=_[_0x40fa('0x4c')](_0x4c2104[_0x40fa('0x36')]);_0x1f62f0['filters']=_[_0x40fa('0x38')](_0x1f62f0['model'],_0x1f62f0[_0x40fa('0x36')]);_0x3ca47d[_0x40fa('0x39')]=_[_0x40fa('0x38')](_0x1f62f0['model'],qs[_0x40fa('0x3a')](_0x4c2104[_0x40fa('0x36')]['fields']));_0x3ca47d[_0x40fa('0x39')]=_0x3ca47d[_0x40fa('0x39')][_0x40fa('0x3b')]?_0x3ca47d['attributes']:_0x1f62f0[_0x40fa('0x35')];_0x3ca47d[_0x40fa('0x3e')]=qs[_0x40fa('0x3f')](_0x4c2104[_0x40fa('0x36')]['sort']);_0x3ca47d[_0x40fa('0x40')]=qs['filters'](_[_0x40fa('0x41')](_0x4c2104[_0x40fa('0x36')],_0x1f62f0[_0x40fa('0x37')]));if(_0x4c2104['query']['filter']){_0x3ca47d['where']=_[_0x40fa('0x43')](_0x3ca47d[_0x40fa('0x40')],{'$or':_['map'](_0x3ca47d['attributes'],function(_0x49cb19){var _0x538fdd={};_0x538fdd[_0x49cb19]={'$like':'%'+_0x4c2104['query'][_0x40fa('0x42')]+'%'};return _0x538fdd;})});}_0x3ca47d=_[_0x40fa('0x43')]({},_0x3ca47d,_0x4c2104[_0x40fa('0x45')]);return _0x5b1ae1['getFields'](_0x3ca47d);}})[_0x40fa('0x2a')](function(_0x76de07){if(_0x76de07){_0xc3b2de=_0x76de07[_0x40fa('0x3b')];if(!_0x4c2104[_0x40fa('0x36')][_0x40fa('0x3c')](_0x40fa('0x3d'))){_0x3ca47d[_0x40fa('0x22')]=qs[_0x40fa('0x22')](_0x4c2104['query'][_0x40fa('0x22')]);_0x3ca47d['offset']=qs['offset'](_0x4c2104[_0x40fa('0x36')][_0x40fa('0x20')]);}return _0x5b1ae1['getFields'](_0x3ca47d);}})[_0x40fa('0x2a')](function(_0x52219e){if(_0x52219e){return _0x52219e?{'count':_0xc3b2de,'rows':_0x52219e}:null;}})['then'](respondWithResult(_0x5dff68,null))[_0x40fa('0x4a')](handleError(_0x5dff68,null));};exports[_0x40fa('0x54')]=function(_0x4a6763,_0x29325a,_0x540b40){var _0x74f28e={};var _0x4c3189={};var _0x58a556;var _0x2af5ee;return db[_0x40fa('0x48')][_0x40fa('0x52')]({'where':{'id':_0x4a6763[_0x40fa('0x50')]['id']}})[_0x40fa('0x2a')](handleEntityNotFound(_0x29325a,null))[_0x40fa('0x2a')](function(_0x10a1f4){if(_0x10a1f4){_0x58a556=_0x10a1f4;_0x4c3189[_0x40fa('0x35')]=_[_0x40fa('0x4c')](db[_0x40fa('0x53')][_0x40fa('0x31')]);_0x4c3189[_0x40fa('0x36')]=_[_0x40fa('0x4c')](_0x4a6763[_0x40fa('0x36')]);_0x4c3189[_0x40fa('0x37')]=_[_0x40fa('0x38')](_0x4c3189[_0x40fa('0x35')],_0x4c3189[_0x40fa('0x36')]);_0x74f28e['attributes']=_['intersection'](_0x4c3189[_0x40fa('0x35')],qs[_0x40fa('0x3a')](_0x4a6763[_0x40fa('0x36')]['fields']));_0x74f28e[_0x40fa('0x39')]=_0x74f28e[_0x40fa('0x39')][_0x40fa('0x3b')]?_0x74f28e['attributes']:_0x4c3189['model'];_0x74f28e[_0x40fa('0x3e')]=qs['sort'](_0x4a6763[_0x40fa('0x36')][_0x40fa('0x3f')]);_0x74f28e[_0x40fa('0x40')]=qs[_0x40fa('0x37')](_[_0x40fa('0x41')](_0x4a6763[_0x40fa('0x36')],_0x4c3189[_0x40fa('0x37')]));if(_0x4a6763[_0x40fa('0x36')][_0x40fa('0x42')]){_0x74f28e[_0x40fa('0x40')]=_[_0x40fa('0x43')](_0x74f28e[_0x40fa('0x40')],{'$or':_[_0x40fa('0x30')](_0x74f28e['attributes'],function(_0x374ae9){var _0x2b0d1c={};_0x2b0d1c[_0x374ae9]={'$like':'%'+_0x4a6763[_0x40fa('0x36')][_0x40fa('0x42')]+'%'};return _0x2b0d1c;})});}_0x74f28e=_[_0x40fa('0x43')]({},_0x74f28e,_0x4a6763[_0x40fa('0x45')]);return _0x58a556[_0x40fa('0x54')](_0x74f28e);}})[_0x40fa('0x2a')](function(_0x213b58){if(_0x213b58){_0x2af5ee=_0x213b58['length'];if(!_0x4a6763['query'][_0x40fa('0x3c')]('nolimit')){_0x74f28e[_0x40fa('0x22')]=qs[_0x40fa('0x22')](_0x4a6763['query'][_0x40fa('0x22')]);_0x74f28e['offset']=qs[_0x40fa('0x20')](_0x4a6763['query'][_0x40fa('0x20')]);}return _0x58a556[_0x40fa('0x54')](_0x74f28e);}})[_0x40fa('0x2a')](function(_0x14a7b4){if(_0x14a7b4){return _0x14a7b4?{'count':_0x2af5ee,'rows':_0x14a7b4}:null;}})[_0x40fa('0x2a')](respondWithResult(_0x29325a,null))[_0x40fa('0x4a')](handleError(_0x29325a,null));};exports['getDescriptions']=function(_0x2a018d,_0x1bc7d1,_0x4ccc58){var _0x577861={};var _0x9ff89e={};var _0x5a3848;var _0x1073cf;return db[_0x40fa('0x48')]['findOne']({'where':{'id':_0x2a018d['params']['id']}})[_0x40fa('0x2a')](handleEntityNotFound(_0x1bc7d1,null))['then'](function(_0x1b401c){if(_0x1b401c){_0x5a3848=_0x1b401c;_0x9ff89e[_0x40fa('0x35')]=_[_0x40fa('0x4c')](db[_0x40fa('0x53')]['rawAttributes']);_0x9ff89e[_0x40fa('0x36')]=_[_0x40fa('0x4c')](_0x2a018d[_0x40fa('0x36')]);_0x9ff89e[_0x40fa('0x37')]=_['intersection'](_0x9ff89e[_0x40fa('0x35')],_0x9ff89e[_0x40fa('0x36')]);_0x577861[_0x40fa('0x39')]=_[_0x40fa('0x38')](_0x9ff89e[_0x40fa('0x35')],qs['fields'](_0x2a018d[_0x40fa('0x36')]['fields']));_0x577861[_0x40fa('0x39')]=_0x577861['attributes'][_0x40fa('0x3b')]?_0x577861['attributes']:_0x9ff89e[_0x40fa('0x35')];_0x577861[_0x40fa('0x3e')]=qs['sort'](_0x2a018d[_0x40fa('0x36')][_0x40fa('0x3f')]);_0x577861[_0x40fa('0x40')]=qs[_0x40fa('0x37')](_[_0x40fa('0x41')](_0x2a018d[_0x40fa('0x36')],_0x9ff89e['filters']));if(_0x2a018d[_0x40fa('0x36')]['filter']){_0x577861[_0x40fa('0x40')]=_[_0x40fa('0x43')](_0x577861['where'],{'$or':_[_0x40fa('0x30')](_0x577861[_0x40fa('0x39')],function(_0x4016d0){var _0x1984f8={};_0x1984f8[_0x4016d0]={'$like':'%'+_0x2a018d[_0x40fa('0x36')]['filter']+'%'};return _0x1984f8;})});}_0x577861=_[_0x40fa('0x43')]({},_0x577861,_0x2a018d['options']);return _0x5a3848[_0x40fa('0x55')](_0x577861);}})[_0x40fa('0x2a')](function(_0x3be765){if(_0x3be765){_0x1073cf=_0x3be765[_0x40fa('0x3b')];if(!_0x2a018d[_0x40fa('0x36')][_0x40fa('0x3c')](_0x40fa('0x3d'))){_0x577861['limit']=qs[_0x40fa('0x22')](_0x2a018d['query'][_0x40fa('0x22')]);_0x577861['offset']=qs['offset'](_0x2a018d[_0x40fa('0x36')][_0x40fa('0x20')]);}return _0x5a3848['getDescriptions'](_0x577861);}})[_0x40fa('0x2a')](function(_0x14eead){if(_0x14eead){return _0x14eead?{'count':_0x1073cf,'rows':_0x14eead}:null;}})[_0x40fa('0x2a')](respondWithResult(_0x1bc7d1,null))['catch'](handleError(_0x1bc7d1,null));};exports[_0x40fa('0x56')]=function(_0x527533,_0x554290,_0x194f92){var _0x56417f={};var _0x191b57={};var _0x33629e;var _0x23f3b5;return db[_0x40fa('0x48')][_0x40fa('0x52')]({'where':{'id':_0x527533[_0x40fa('0x50')]['id']}})[_0x40fa('0x2a')](handleEntityNotFound(_0x554290,null))['then'](function(_0x55c9ba){if(_0x55c9ba){_0x33629e=_0x55c9ba;_0x191b57[_0x40fa('0x35')]=_[_0x40fa('0x4c')](db[_0x40fa('0x57')][_0x40fa('0x31')]);_0x191b57[_0x40fa('0x36')]=_[_0x40fa('0x4c')](_0x527533[_0x40fa('0x36')]);_0x191b57[_0x40fa('0x37')]=_[_0x40fa('0x38')](_0x191b57['model'],_0x191b57['query']);_0x56417f[_0x40fa('0x39')]=_[_0x40fa('0x38')](_0x191b57[_0x40fa('0x35')],qs['fields'](_0x527533['query']['fields']));_0x56417f['attributes']=_0x56417f[_0x40fa('0x39')]['length']?_0x56417f['attributes']:_0x191b57['model'];_0x56417f['order']=qs['sort'](_0x527533[_0x40fa('0x36')][_0x40fa('0x3f')]);_0x56417f['where']=qs[_0x40fa('0x37')](_[_0x40fa('0x41')](_0x527533[_0x40fa('0x36')],_0x191b57['filters']));if(_0x527533[_0x40fa('0x36')]['filter']){_0x56417f[_0x40fa('0x40')]=_[_0x40fa('0x43')](_0x56417f[_0x40fa('0x40')],{'$or':_[_0x40fa('0x30')](_0x56417f[_0x40fa('0x39')],function(_0x1409da){var _0x2db076={};_0x2db076[_0x1409da]={'$like':'%'+_0x527533[_0x40fa('0x36')]['filter']+'%'};return _0x2db076;})});}_0x56417f=_[_0x40fa('0x43')]({},_0x56417f,_0x527533[_0x40fa('0x45')]);return _0x33629e[_0x40fa('0x56')](_0x56417f);}})['then'](function(_0x2adf40){if(_0x2adf40){_0x23f3b5=_0x2adf40['length'];if(!_0x527533[_0x40fa('0x36')][_0x40fa('0x3c')](_0x40fa('0x3d'))){_0x56417f['limit']=qs[_0x40fa('0x22')](_0x527533[_0x40fa('0x36')]['limit']);_0x56417f[_0x40fa('0x20')]=qs[_0x40fa('0x20')](_0x527533[_0x40fa('0x36')][_0x40fa('0x20')]);}return _0x33629e[_0x40fa('0x56')](_0x56417f);}})['then'](function(_0x47a35d){if(_0x47a35d){return _0x47a35d?{'count':_0x23f3b5,'rows':_0x47a35d}:null;}})['then'](respondWithResult(_0x554290,null))['catch'](handleError(_0x554290,null));};exports[_0x40fa('0x58')]=function(_0xda3ec,_0x16d40a,_0x200726){if(_0xda3ec[_0x40fa('0x4e')]['id']){delete _0xda3ec[_0x40fa('0x4e')]['id'];}return db[_0x40fa('0x48')][_0x40fa('0x52')]({'where':{'id':_0xda3ec['params']['id']}})['then'](handleEntityNotFound(_0x16d40a,null))[_0x40fa('0x2a')](function(_0x3dffad){if(_0x3dffad){return _0x3dffad[_0x40fa('0x58')](_0xda3ec[_0x40fa('0x4e')][_0x40fa('0x59')]||[]);}return null;})[_0x40fa('0x2a')](respondWithResult(_0x16d40a,null))['catch'](handleError(_0x16d40a,null));}; \ No newline at end of file +var _0x7b41=['destroy','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','then','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','getFields','findOne','ZendeskField','nolimit','pick','getSubjects','getDescriptions','Tag','getTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x7b41,0xd4));var _0x17b4=function(_0x106b04,_0x48d52b){_0x106b04=_0x106b04-0x0;var _0x47f944=_0x7b41[_0x106b04];return _0x47f944;};'use strict';var emlformat=require(_0x17b4('0x0'));var rimraf=require(_0x17b4('0x1'));var zipdir=require(_0x17b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17b4('0x3'));var moment=require(_0x17b4('0x4'));var BPromise=require(_0x17b4('0x5'));var Mustache=require(_0x17b4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x17b4('0x7'));var csv=require(_0x17b4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x17b4('0x9'));var _=require('lodash');var squel=require(_0x17b4('0xa'));var crypto=require(_0x17b4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x17b4('0xc'));var toCsv=require(_0x17b4('0x8'));var querystring=require(_0x17b4('0xd'));var Papa=require('papaparse');var Redis=require(_0x17b4('0xe'));var authService=require(_0x17b4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x17b4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17b4('0x11'))('api');var utils=require(_0x17b4('0x12'));var config=require(_0x17b4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x17b4('0x14'))['db'];function respondWithStatusCode(_0x5e72bc,_0x440f76){_0x440f76=_0x440f76||0xcc;return function(_0xafe84c){if(_0xafe84c){return _0x5e72bc[_0x17b4('0x15')](_0x440f76);}return _0x5e72bc['status'](_0x440f76)[_0x17b4('0x16')]();};}function respondWithResult(_0x562f1c,_0x268c9f){_0x268c9f=_0x268c9f||0xc8;return function(_0x400e51){if(_0x400e51){return _0x562f1c['status'](_0x268c9f)[_0x17b4('0x17')](_0x400e51);}};}function respondWithFilteredResult(_0x28a069,_0x3f62dd){return function(_0x2695b6){if(_0x2695b6){var _0x434e66=typeof _0x3f62dd[_0x17b4('0x18')]==='undefined'&&typeof _0x3f62dd[_0x17b4('0x19')]==='undefined';var _0xf136b=_0x2695b6[_0x17b4('0x1a')];var _0x34912f=_0x434e66?0x0:_0x3f62dd[_0x17b4('0x18')];var _0x9b9d24=_0x434e66?_0x2695b6[_0x17b4('0x1a')]:_0x3f62dd['offset']+_0x3f62dd[_0x17b4('0x19')];var _0x273911;if(_0x9b9d24>=_0xf136b){_0x9b9d24=_0xf136b;_0x273911=0xc8;}else{_0x273911=0xce;}_0x28a069[_0x17b4('0x1b')](_0x273911);return _0x28a069[_0x17b4('0x1c')](_0x17b4('0x1d'),_0x34912f+'-'+_0x9b9d24+'/'+_0xf136b)[_0x17b4('0x17')](_0x2695b6);}return null;};}function patchUpdates(_0x460175){return function(_0x197b3c){try{jsonpatch[_0x17b4('0x1e')](_0x197b3c,_0x460175,!![]);}catch(_0x1c4c9f){return BPromise[_0x17b4('0x1f')](_0x1c4c9f);}return _0x197b3c[_0x17b4('0x20')]();};}function saveUpdates(_0x41d306,_0x50a5d2){return function(_0x27841d){if(_0x27841d){return _0x27841d[_0x17b4('0x21')](_0x41d306)['then'](function(_0x2854ce){return _0x2854ce;});}return null;};}function removeEntity(_0x294609,_0xfddf5d){return function(_0x45b710){if(_0x45b710){return _0x45b710[_0x17b4('0x22')]()['then'](function(){_0x294609[_0x17b4('0x1b')](0xcc)[_0x17b4('0x16')]();});}};}function handleEntityNotFound(_0x57c910,_0x2c6fbc){return function(_0x370187){if(!_0x370187){_0x57c910[_0x17b4('0x15')](0x194);}return _0x370187;};}function handleError(_0x5d80ba,_0x230e41){_0x230e41=_0x230e41||0x1f4;return function(_0x4f0b10){logger[_0x17b4('0x23')](_0x4f0b10['stack']);if(_0x4f0b10[_0x17b4('0x24')]){delete _0x4f0b10[_0x17b4('0x24')];}_0x5d80ba[_0x17b4('0x1b')](_0x230e41)[_0x17b4('0x25')](_0x4f0b10);};}exports[_0x17b4('0x26')]=function(_0x12f365,_0x1a3941){var _0x966816={},_0x5a4ab3={},_0x1b3d2a={'count':0x0,'rows':[]};var _0x4571a5=_[_0x17b4('0x27')](db[_0x17b4('0x28')][_0x17b4('0x29')],function(_0x2956f2){return{'name':_0x2956f2[_0x17b4('0x2a')],'type':_0x2956f2[_0x17b4('0x2b')][_0x17b4('0x2c')]};});_0x5a4ab3[_0x17b4('0x2d')]=_[_0x17b4('0x27')](_0x4571a5,_0x17b4('0x24'));_0x5a4ab3['query']=_[_0x17b4('0x2e')](_0x12f365[_0x17b4('0x2f')]);_0x5a4ab3[_0x17b4('0x30')]=_['intersection'](_0x5a4ab3['model'],_0x5a4ab3[_0x17b4('0x2f')]);_0x966816[_0x17b4('0x31')]=_[_0x17b4('0x32')](_0x5a4ab3[_0x17b4('0x2d')],qs[_0x17b4('0x33')](_0x12f365['query'][_0x17b4('0x33')]));_0x966816[_0x17b4('0x31')]=_0x966816['attributes'][_0x17b4('0x34')]?_0x966816[_0x17b4('0x31')]:_0x5a4ab3[_0x17b4('0x2d')];if(!_0x12f365[_0x17b4('0x2f')][_0x17b4('0x35')]('nolimit')){_0x966816['limit']=qs[_0x17b4('0x19')](_0x12f365[_0x17b4('0x2f')][_0x17b4('0x19')]);_0x966816[_0x17b4('0x18')]=qs[_0x17b4('0x18')](_0x12f365[_0x17b4('0x2f')][_0x17b4('0x18')]);}_0x966816[_0x17b4('0x36')]=qs[_0x17b4('0x37')](_0x12f365[_0x17b4('0x2f')][_0x17b4('0x37')]);_0x966816['where']=qs[_0x17b4('0x30')](_['pick'](_0x12f365[_0x17b4('0x2f')],_0x5a4ab3[_0x17b4('0x30')]),_0x4571a5);if(_0x12f365[_0x17b4('0x2f')]['filter']){_0x966816[_0x17b4('0x38')]=_['merge'](_0x966816['where'],{'$or':_['map'](_0x4571a5,function(_0x1e3afd){if(_0x1e3afd[_0x17b4('0x2b')]!==_0x17b4('0x39')){var _0x5eb0d9={};_0x5eb0d9[_0x1e3afd[_0x17b4('0x24')]]={'$like':'%'+_0x12f365['query'][_0x17b4('0x3a')]+'%'};return _0x5eb0d9;}})});}_0x966816=_[_0x17b4('0x3b')]({},_0x966816,_0x12f365['options']);var _0x168e3d={'where':_0x966816['where']};return db[_0x17b4('0x28')][_0x17b4('0x1a')](_0x168e3d)[_0x17b4('0x3c')](function(_0x23f62d){_0x1b3d2a[_0x17b4('0x1a')]=_0x23f62d;if(_0x12f365[_0x17b4('0x2f')][_0x17b4('0x3d')]){_0x966816[_0x17b4('0x3e')]=[{'all':!![]}];}return db[_0x17b4('0x28')][_0x17b4('0x3f')](_0x966816);})[_0x17b4('0x3c')](function(_0x5346a9){_0x1b3d2a[_0x17b4('0x40')]=_0x5346a9;return _0x1b3d2a;})[_0x17b4('0x3c')](respondWithFilteredResult(_0x1a3941,_0x966816))[_0x17b4('0x41')](handleError(_0x1a3941,null));};exports[_0x17b4('0x42')]=function(_0x2da0f4,_0x3a8fa7){var _0x12a630={'raw':![],'where':{'id':_0x2da0f4['params']['id']}},_0x7ffcaa={};_0x7ffcaa[_0x17b4('0x2d')]=_['keys'](db['ZendeskConfiguration'][_0x17b4('0x29')]);_0x7ffcaa[_0x17b4('0x2f')]=_[_0x17b4('0x2e')](_0x2da0f4['query']);_0x7ffcaa[_0x17b4('0x30')]=_[_0x17b4('0x32')](_0x7ffcaa[_0x17b4('0x2d')],_0x7ffcaa[_0x17b4('0x2f')]);_0x12a630[_0x17b4('0x31')]=_[_0x17b4('0x32')](_0x7ffcaa[_0x17b4('0x2d')],qs[_0x17b4('0x33')](_0x2da0f4[_0x17b4('0x2f')][_0x17b4('0x33')]));_0x12a630[_0x17b4('0x31')]=_0x12a630[_0x17b4('0x31')][_0x17b4('0x34')]?_0x12a630[_0x17b4('0x31')]:_0x7ffcaa[_0x17b4('0x2d')];if(_0x2da0f4[_0x17b4('0x2f')][_0x17b4('0x3d')]){_0x12a630[_0x17b4('0x3e')]=[{'all':!![]}];}_0x12a630=_[_0x17b4('0x3b')]({},_0x12a630,_0x2da0f4[_0x17b4('0x43')]);return db[_0x17b4('0x28')][_0x17b4('0x44')](_0x12a630)['then'](handleEntityNotFound(_0x3a8fa7,null))[_0x17b4('0x3c')](respondWithResult(_0x3a8fa7,null))['catch'](handleError(_0x3a8fa7,null));};exports[_0x17b4('0x45')]=function(_0x78b715,_0x4e6056){return db[_0x17b4('0x28')][_0x17b4('0x45')](_0x78b715['body'],{})[_0x17b4('0x3c')](respondWithResult(_0x4e6056,0xc9))[_0x17b4('0x41')](handleError(_0x4e6056,null));};exports[_0x17b4('0x21')]=function(_0x1c13b5,_0xdb1db){if(_0x1c13b5[_0x17b4('0x46')]['id']){delete _0x1c13b5[_0x17b4('0x46')]['id'];}return db[_0x17b4('0x28')][_0x17b4('0x44')]({'where':{'id':_0x1c13b5[_0x17b4('0x47')]['id']}})[_0x17b4('0x3c')](handleEntityNotFound(_0xdb1db,null))['then'](saveUpdates(_0x1c13b5['body'],null))[_0x17b4('0x3c')](respondWithResult(_0xdb1db,null))[_0x17b4('0x41')](handleError(_0xdb1db,null));};exports[_0x17b4('0x22')]=function(_0x2881b5,_0x24875c){return db[_0x17b4('0x28')][_0x17b4('0x44')]({'where':{'id':_0x2881b5['params']['id']}})[_0x17b4('0x3c')](handleEntityNotFound(_0x24875c,null))['then'](removeEntity(_0x24875c,null))['catch'](handleError(_0x24875c,null));};exports[_0x17b4('0x48')]=function(_0x158d77,_0x98c424,_0x3efbb1){var _0x4daae5={};var _0x297e27={};var _0x265e7b;var _0x573cfc;return db[_0x17b4('0x28')][_0x17b4('0x49')]({'where':{'id':_0x158d77[_0x17b4('0x47')]['id']}})[_0x17b4('0x3c')](handleEntityNotFound(_0x98c424,null))['then'](function(_0x5ab4c7){if(_0x5ab4c7){_0x265e7b=_0x5ab4c7;_0x297e27[_0x17b4('0x2d')]=_[_0x17b4('0x2e')](db[_0x17b4('0x4a')]['rawAttributes']);_0x297e27[_0x17b4('0x2f')]=_[_0x17b4('0x2e')](_0x158d77['query']);_0x297e27['filters']=_[_0x17b4('0x32')](_0x297e27[_0x17b4('0x2d')],_0x297e27['query']);_0x4daae5['attributes']=_[_0x17b4('0x32')](_0x297e27[_0x17b4('0x2d')],qs[_0x17b4('0x33')](_0x158d77['query'][_0x17b4('0x33')]));_0x4daae5['attributes']=_0x4daae5['attributes'][_0x17b4('0x34')]?_0x4daae5[_0x17b4('0x31')]:_0x297e27[_0x17b4('0x2d')];_0x4daae5[_0x17b4('0x36')]=qs['sort'](_0x158d77[_0x17b4('0x2f')][_0x17b4('0x37')]);_0x4daae5[_0x17b4('0x38')]=qs['filters'](_['pick'](_0x158d77[_0x17b4('0x2f')],_0x297e27[_0x17b4('0x30')]));if(_0x158d77[_0x17b4('0x2f')]['filter']){_0x4daae5['where']=_[_0x17b4('0x3b')](_0x4daae5['where'],{'$or':_[_0x17b4('0x27')](_0x4daae5[_0x17b4('0x31')],function(_0x1d697b){var _0x4d9190={};_0x4d9190[_0x1d697b]={'$like':'%'+_0x158d77['query'][_0x17b4('0x3a')]+'%'};return _0x4d9190;})});}_0x4daae5=_[_0x17b4('0x3b')]({},_0x4daae5,_0x158d77[_0x17b4('0x43')]);return _0x265e7b[_0x17b4('0x48')](_0x4daae5);}})[_0x17b4('0x3c')](function(_0x31f983){if(_0x31f983){_0x573cfc=_0x31f983[_0x17b4('0x34')];if(!_0x158d77[_0x17b4('0x2f')][_0x17b4('0x35')](_0x17b4('0x4b'))){_0x4daae5[_0x17b4('0x19')]=qs['limit'](_0x158d77[_0x17b4('0x2f')]['limit']);_0x4daae5[_0x17b4('0x18')]=qs[_0x17b4('0x18')](_0x158d77[_0x17b4('0x2f')][_0x17b4('0x18')]);}return _0x265e7b[_0x17b4('0x48')](_0x4daae5);}})[_0x17b4('0x3c')](function(_0x74d7eb){if(_0x74d7eb){return _0x74d7eb?{'count':_0x573cfc,'rows':_0x74d7eb}:null;}})[_0x17b4('0x3c')](respondWithResult(_0x98c424,null))[_0x17b4('0x41')](handleError(_0x98c424,null));};exports['getSubjects']=function(_0x45f5a6,_0x558cf4,_0x3d6bec){var _0x132a99={};var _0x26a1b9={};var _0x26d596;var _0x16a964;return db[_0x17b4('0x28')][_0x17b4('0x49')]({'where':{'id':_0x45f5a6[_0x17b4('0x47')]['id']}})[_0x17b4('0x3c')](handleEntityNotFound(_0x558cf4,null))[_0x17b4('0x3c')](function(_0x155b18){if(_0x155b18){_0x26d596=_0x155b18;_0x26a1b9[_0x17b4('0x2d')]=_[_0x17b4('0x2e')](db[_0x17b4('0x4a')][_0x17b4('0x29')]);_0x26a1b9[_0x17b4('0x2f')]=_[_0x17b4('0x2e')](_0x45f5a6[_0x17b4('0x2f')]);_0x26a1b9[_0x17b4('0x30')]=_[_0x17b4('0x32')](_0x26a1b9[_0x17b4('0x2d')],_0x26a1b9[_0x17b4('0x2f')]);_0x132a99[_0x17b4('0x31')]=_[_0x17b4('0x32')](_0x26a1b9[_0x17b4('0x2d')],qs[_0x17b4('0x33')](_0x45f5a6['query'][_0x17b4('0x33')]));_0x132a99['attributes']=_0x132a99['attributes']['length']?_0x132a99[_0x17b4('0x31')]:_0x26a1b9[_0x17b4('0x2d')];_0x132a99[_0x17b4('0x36')]=qs[_0x17b4('0x37')](_0x45f5a6[_0x17b4('0x2f')]['sort']);_0x132a99[_0x17b4('0x38')]=qs[_0x17b4('0x30')](_[_0x17b4('0x4c')](_0x45f5a6[_0x17b4('0x2f')],_0x26a1b9[_0x17b4('0x30')]));if(_0x45f5a6[_0x17b4('0x2f')][_0x17b4('0x3a')]){_0x132a99['where']=_[_0x17b4('0x3b')](_0x132a99[_0x17b4('0x38')],{'$or':_[_0x17b4('0x27')](_0x132a99['attributes'],function(_0x453b71){var _0x25b95f={};_0x25b95f[_0x453b71]={'$like':'%'+_0x45f5a6['query']['filter']+'%'};return _0x25b95f;})});}_0x132a99=_[_0x17b4('0x3b')]({},_0x132a99,_0x45f5a6['options']);return _0x26d596[_0x17b4('0x4d')](_0x132a99);}})[_0x17b4('0x3c')](function(_0x5ef052){if(_0x5ef052){_0x16a964=_0x5ef052[_0x17b4('0x34')];if(!_0x45f5a6[_0x17b4('0x2f')][_0x17b4('0x35')]('nolimit')){_0x132a99[_0x17b4('0x19')]=qs[_0x17b4('0x19')](_0x45f5a6[_0x17b4('0x2f')][_0x17b4('0x19')]);_0x132a99[_0x17b4('0x18')]=qs['offset'](_0x45f5a6[_0x17b4('0x2f')][_0x17b4('0x18')]);}return _0x26d596[_0x17b4('0x4d')](_0x132a99);}})[_0x17b4('0x3c')](function(_0xf39e35){if(_0xf39e35){return _0xf39e35?{'count':_0x16a964,'rows':_0xf39e35}:null;}})[_0x17b4('0x3c')](respondWithResult(_0x558cf4,null))[_0x17b4('0x41')](handleError(_0x558cf4,null));};exports[_0x17b4('0x4e')]=function(_0x295e1d,_0x5c59a2,_0x34e763){var _0x3b10c8={};var _0x57127a={};var _0x5cc221;var _0x9dabaf;return db['ZendeskConfiguration'][_0x17b4('0x49')]({'where':{'id':_0x295e1d[_0x17b4('0x47')]['id']}})[_0x17b4('0x3c')](handleEntityNotFound(_0x5c59a2,null))['then'](function(_0x297441){if(_0x297441){_0x5cc221=_0x297441;_0x57127a[_0x17b4('0x2d')]=_['keys'](db[_0x17b4('0x4a')][_0x17b4('0x29')]);_0x57127a[_0x17b4('0x2f')]=_[_0x17b4('0x2e')](_0x295e1d[_0x17b4('0x2f')]);_0x57127a['filters']=_['intersection'](_0x57127a['model'],_0x57127a[_0x17b4('0x2f')]);_0x3b10c8['attributes']=_['intersection'](_0x57127a[_0x17b4('0x2d')],qs[_0x17b4('0x33')](_0x295e1d[_0x17b4('0x2f')][_0x17b4('0x33')]));_0x3b10c8[_0x17b4('0x31')]=_0x3b10c8[_0x17b4('0x31')][_0x17b4('0x34')]?_0x3b10c8['attributes']:_0x57127a[_0x17b4('0x2d')];_0x3b10c8[_0x17b4('0x36')]=qs[_0x17b4('0x37')](_0x295e1d[_0x17b4('0x2f')][_0x17b4('0x37')]);_0x3b10c8[_0x17b4('0x38')]=qs[_0x17b4('0x30')](_[_0x17b4('0x4c')](_0x295e1d[_0x17b4('0x2f')],_0x57127a[_0x17b4('0x30')]));if(_0x295e1d['query'][_0x17b4('0x3a')]){_0x3b10c8[_0x17b4('0x38')]=_[_0x17b4('0x3b')](_0x3b10c8[_0x17b4('0x38')],{'$or':_[_0x17b4('0x27')](_0x3b10c8[_0x17b4('0x31')],function(_0x4d655e){var _0x40e989={};_0x40e989[_0x4d655e]={'$like':'%'+_0x295e1d[_0x17b4('0x2f')][_0x17b4('0x3a')]+'%'};return _0x40e989;})});}_0x3b10c8=_[_0x17b4('0x3b')]({},_0x3b10c8,_0x295e1d['options']);return _0x5cc221['getDescriptions'](_0x3b10c8);}})['then'](function(_0x427e65){if(_0x427e65){_0x9dabaf=_0x427e65['length'];if(!_0x295e1d[_0x17b4('0x2f')][_0x17b4('0x35')](_0x17b4('0x4b'))){_0x3b10c8['limit']=qs['limit'](_0x295e1d[_0x17b4('0x2f')][_0x17b4('0x19')]);_0x3b10c8[_0x17b4('0x18')]=qs['offset'](_0x295e1d[_0x17b4('0x2f')][_0x17b4('0x18')]);}return _0x5cc221[_0x17b4('0x4e')](_0x3b10c8);}})['then'](function(_0x4d7aff){if(_0x4d7aff){return _0x4d7aff?{'count':_0x9dabaf,'rows':_0x4d7aff}:null;}})[_0x17b4('0x3c')](respondWithResult(_0x5c59a2,null))[_0x17b4('0x41')](handleError(_0x5c59a2,null));};exports['getTags']=function(_0x563f4f,_0x1c8f3e,_0x421197){var _0x243bec={};var _0x56bd88={};var _0x26d3d1;var _0x3c86fd;return db[_0x17b4('0x28')]['findOne']({'where':{'id':_0x563f4f[_0x17b4('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c8f3e,null))['then'](function(_0x4229fa){if(_0x4229fa){_0x26d3d1=_0x4229fa;_0x56bd88[_0x17b4('0x2d')]=_[_0x17b4('0x2e')](db[_0x17b4('0x4f')][_0x17b4('0x29')]);_0x56bd88['query']=_['keys'](_0x563f4f[_0x17b4('0x2f')]);_0x56bd88[_0x17b4('0x30')]=_[_0x17b4('0x32')](_0x56bd88[_0x17b4('0x2d')],_0x56bd88[_0x17b4('0x2f')]);_0x243bec[_0x17b4('0x31')]=_[_0x17b4('0x32')](_0x56bd88['model'],qs['fields'](_0x563f4f[_0x17b4('0x2f')][_0x17b4('0x33')]));_0x243bec['attributes']=_0x243bec[_0x17b4('0x31')]['length']?_0x243bec[_0x17b4('0x31')]:_0x56bd88[_0x17b4('0x2d')];_0x243bec[_0x17b4('0x36')]=qs[_0x17b4('0x37')](_0x563f4f['query'][_0x17b4('0x37')]);_0x243bec['where']=qs[_0x17b4('0x30')](_[_0x17b4('0x4c')](_0x563f4f[_0x17b4('0x2f')],_0x56bd88[_0x17b4('0x30')]));if(_0x563f4f[_0x17b4('0x2f')][_0x17b4('0x3a')]){_0x243bec[_0x17b4('0x38')]=_[_0x17b4('0x3b')](_0x243bec[_0x17b4('0x38')],{'$or':_[_0x17b4('0x27')](_0x243bec[_0x17b4('0x31')],function(_0x1a7e23){var _0x34016d={};_0x34016d[_0x1a7e23]={'$like':'%'+_0x563f4f[_0x17b4('0x2f')][_0x17b4('0x3a')]+'%'};return _0x34016d;})});}_0x243bec=_[_0x17b4('0x3b')]({},_0x243bec,_0x563f4f[_0x17b4('0x43')]);return _0x26d3d1[_0x17b4('0x50')](_0x243bec);}})['then'](function(_0x2e0da4){if(_0x2e0da4){_0x3c86fd=_0x2e0da4[_0x17b4('0x34')];if(!_0x563f4f[_0x17b4('0x2f')][_0x17b4('0x35')](_0x17b4('0x4b'))){_0x243bec[_0x17b4('0x19')]=qs[_0x17b4('0x19')](_0x563f4f[_0x17b4('0x2f')][_0x17b4('0x19')]);_0x243bec[_0x17b4('0x18')]=qs[_0x17b4('0x18')](_0x563f4f[_0x17b4('0x2f')][_0x17b4('0x18')]);}return _0x26d3d1[_0x17b4('0x50')](_0x243bec);}})[_0x17b4('0x3c')](function(_0x11054f){if(_0x11054f){return _0x11054f?{'count':_0x3c86fd,'rows':_0x11054f}:null;}})['then'](respondWithResult(_0x1c8f3e,null))['catch'](handleError(_0x1c8f3e,null));};exports['setTags']=function(_0x1ec167,_0x147d8e,_0x1f3021){if(_0x1ec167['body']['id']){delete _0x1ec167[_0x17b4('0x46')]['id'];}return db[_0x17b4('0x28')][_0x17b4('0x49')]({'where':{'id':_0x1ec167[_0x17b4('0x47')]['id']}})[_0x17b4('0x3c')](handleEntityNotFound(_0x147d8e,null))[_0x17b4('0x3c')](function(_0x30341d){if(_0x30341d){return _0x30341d['setTags'](_0x1ec167[_0x17b4('0x46')][_0x17b4('0x51')]||[]);}return null;})[_0x17b4('0x3c')](respondWithResult(_0x147d8e,null))[_0x17b4('0x41')](handleError(_0x147d8e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index edbe42c..73068a3 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 _0xfef3=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x21ec69,_0x11cf23){var _0x202df8=function(_0x5e92a0){while(--_0x5e92a0){_0x21ec69['push'](_0x21ec69['shift']());}};_0x202df8(++_0x11cf23);}(_0xfef3,0x118));var _0x3fef=function(_0x38bb34,_0x2e1c6b){_0x38bb34=_0x38bb34-0x0;var _0xdf1945=_0xfef3[_0x38bb34];return _0xdf1945;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var logger=require(_0x3fef('0x1'))('api');var moment=require(_0x3fef('0x2'));var BPromise=require(_0x3fef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fef('0x4'));var rimraf=require(_0x3fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3fef('0x6'));module[_0x3fef('0x7')]=function(_0x5dd9fb,_0x319a2a){return _0x5dd9fb[_0x3fef('0x8')](_0x3fef('0x9'),attributes,{'tableName':_0x3fef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0abf=['define','int_zendesk_configurations','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports'];(function(_0x19eb5d,_0x539b8a){var _0x3d76b6=function(_0x523aaf){while(--_0x523aaf){_0x19eb5d['push'](_0x19eb5d['shift']());}};_0x3d76b6(++_0x539b8a);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var logger=require(_0xf0ab('0x1'))(_0xf0ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf0ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var attributes=require(_0xf0ab('0x6'));module[_0xf0ab('0x7')]=function(_0x2ab7d6,_0x4d2ea8){return _0x2ab7d6[_0xf0ab('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0xf0ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index f649af8..929f8a7 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 _0x9aff=['then','info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3cac17,_0x174a50){var _0x38e3be=function(_0x10e160){while(--_0x10e160){_0x3cac17['push'](_0x3cac17['shift']());}};_0x38e3be(++_0x174a50);}(_0x9aff,0x1a9));var _0xf9af=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x9aff[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0xf9af('0x0'));var util=require(_0xf9af('0x1'));var moment=require(_0xf9af('0x2'));var BPromise=require(_0xf9af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9af('0x4'))['db'];var utils=require(_0xf9af('0x5'));var logger=require(_0xf9af('0x6'))(_0xf9af('0x7'));var config=require(_0xf9af('0x8'));var jayson=require(_0xf9af('0x9'));var client=jayson[_0xf9af('0xa')][_0xf9af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e01f5,_0x561f26,_0x5b5b80){return new BPromise(function(_0x70903f,_0x21cfb1){return client['request'](_0x5e01f5,_0x5b5b80)[_0xf9af('0xc')](function(_0x49988e){logger[_0xf9af('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x561f26,'request\x20sent');logger[_0xf9af('0xe')](_0xf9af('0xf'),_0x561f26,_0xf9af('0x10'),JSON[_0xf9af('0x11')](_0x49988e));if(_0x49988e[_0xf9af('0x12')]){if(_0x49988e['error'][_0xf9af('0x13')]===0x1f4){logger['error'](_0xf9af('0x14'),_0x561f26,_0x49988e[_0xf9af('0x12')][_0xf9af('0x15')]);return _0x21cfb1(_0x49988e['error'][_0xf9af('0x15')]);}logger[_0xf9af('0x12')](_0xf9af('0x14'),_0x561f26,_0x49988e[_0xf9af('0x12')][_0xf9af('0x15')]);return _0x70903f(_0x49988e[_0xf9af('0x12')][_0xf9af('0x15')]);}else{logger['info'](_0xf9af('0x14'),_0x561f26,_0xf9af('0x10'));_0x70903f(_0x49988e['result']['message']);}})[_0xf9af('0x16')](function(_0x51a5b4){logger[_0xf9af('0x12')](_0xf9af('0x14'),_0x561f26,_0x51a5b4);_0x21cfb1(_0x51a5b4);});});} \ No newline at end of file +var _0xec47=['http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x41cec7,_0x2e1f4a){var _0x5ed26a=function(_0x447ad7){while(--_0x447ad7){_0x41cec7['push'](_0x41cec7['shift']());}};_0x5ed26a(++_0x2e1f4a);}(_0xec47,0x1c5));var _0x7ec4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec47[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7ec4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7ec4('0x1'));var rs=require(_0x7ec4('0x2'));var fs=require('fs');var Redis=require(_0x7ec4('0x3'));var db=require(_0x7ec4('0x4'))['db'];var utils=require(_0x7ec4('0x5'));var logger=require('../../config/logger')(_0x7ec4('0x6'));var config=require(_0x7ec4('0x7'));var jayson=require(_0x7ec4('0x8'));var client=jayson['client'][_0x7ec4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3df28d,_0xd62287,_0x4abc2e){return new BPromise(function(_0x1e6f16,_0x2d3f9a){return client[_0x7ec4('0xa')](_0x3df28d,_0x4abc2e)[_0x7ec4('0xb')](function(_0x1da00f){logger[_0x7ec4('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0xd62287,_0x7ec4('0xd'));logger[_0x7ec4('0xe')](_0x7ec4('0xf'),_0xd62287,_0x7ec4('0xd'),JSON[_0x7ec4('0x10')](_0x1da00f));if(_0x1da00f[_0x7ec4('0x11')]){if(_0x1da00f[_0x7ec4('0x11')]['code']===0x1f4){logger[_0x7ec4('0x11')](_0x7ec4('0x12'),_0xd62287,_0x1da00f['error']['message']);return _0x2d3f9a(_0x1da00f['error']['message']);}logger[_0x7ec4('0x11')](_0x7ec4('0x12'),_0xd62287,_0x1da00f['error']['message']);return _0x1e6f16(_0x1da00f[_0x7ec4('0x11')][_0x7ec4('0x13')]);}else{logger[_0x7ec4('0xc')](_0x7ec4('0x12'),_0xd62287,_0x7ec4('0xd'));_0x1e6f16(_0x1da00f[_0x7ec4('0x14')][_0x7ec4('0x13')]);}})[_0x7ec4('0x15')](function(_0x6a3343){logger[_0x7ec4('0x11')](_0x7ec4('0x12'),_0xd62287,_0x6a3343);_0x2d3f9a(_0x6a3343);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index c81188e..5d67c6f 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 _0x5648=['fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x23d686,_0x3f1c21){var _0x5e0c57=function(_0x10b4dc){while(--_0x10b4dc){_0x23d686['push'](_0x23d686['shift']());}};_0x5e0c57(++_0x3f1c21);}(_0x5648,0x8d));var _0x8564=function(_0x6dd207,_0x76a904){_0x6dd207=_0x6dd207-0x0;var _0x289665=_0x5648[_0x6dd207];return _0x289665;};'use strict';var multer=require(_0x8564('0x0'));var util=require(_0x8564('0x1'));var path=require(_0x8564('0x2'));var timeout=require(_0x8564('0x3'));var express=require(_0x8564('0x4'));var router=express[_0x8564('0x5')]();var fs_extra=require(_0x8564('0x6'));var auth=require(_0x8564('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8564('0x8'));var controller=require(_0x8564('0x9'));router['get']('/',auth[_0x8564('0xa')](),controller[_0x8564('0xb')]);router[_0x8564('0xc')](_0x8564('0xd'),auth[_0x8564('0xa')](),controller[_0x8564('0xe')]);router[_0x8564('0xf')]('/',auth[_0x8564('0xa')](),controller[_0x8564('0x10')]);router[_0x8564('0x11')](_0x8564('0xd'),auth[_0x8564('0xa')](),controller['update']);router[_0x8564('0x12')]('/:id',auth[_0x8564('0xa')](),controller[_0x8564('0x13')]);module[_0x8564('0x14')]=router; \ No newline at end of file +var _0xf6ca=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0xf2bff9,_0x326685){var _0x4ab791=function(_0x2c7b47){while(--_0x2c7b47){_0xf2bff9['push'](_0xf2bff9['shift']());}};_0x4ab791(++_0x326685);}(_0xf6ca,0x1c1));var _0xaf6c=function(_0xa52f07,_0x2e3a4e){_0xa52f07=_0xa52f07-0x0;var _0x4647ac=_0xf6ca[_0xa52f07];return _0x4647ac;};'use strict';var multer=require('multer');var util=require(_0xaf6c('0x0'));var path=require(_0xaf6c('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf6c('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf6c('0x3'));var interaction=require(_0xaf6c('0x4'));var config=require(_0xaf6c('0x5'));var controller=require('./intZendeskField.controller');router[_0xaf6c('0x6')]('/',auth[_0xaf6c('0x7')](),controller[_0xaf6c('0x8')]);router[_0xaf6c('0x6')](_0xaf6c('0x9'),auth[_0xaf6c('0x7')](),controller[_0xaf6c('0xa')]);router[_0xaf6c('0xb')]('/',auth['isAuthenticated'](),controller[_0xaf6c('0xc')]);router[_0xaf6c('0xd')](_0xaf6c('0x9'),auth[_0xaf6c('0x7')](),controller[_0xaf6c('0xe')]);router[_0xaf6c('0xf')]('/:id',auth[_0xaf6c('0x7')](),controller[_0xaf6c('0x10')]);module[_0xaf6c('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 b19dff6..776f75e 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 _0x9bd9=['variable','customVariable','keyValue','picklist','STRING','sequelize','ENUM','string'];(function(_0x37ac46,_0x1a1808){var _0x46274f=function(_0x1e1e60){while(--_0x1e1e60){_0x37ac46['push'](_0x37ac46['shift']());}};_0x46274f(++_0x1a1808);}(_0x9bd9,0x65));var _0x99bd=function(_0x5b3946,_0x23053c){_0x5b3946=_0x5b3946-0x0;var _0x2bd577=_0x9bd9[_0x5b3946];return _0x2bd577;};'use strict';var Sequelize=require(_0x99bd('0x0'));module['exports']={'type':{'type':Sequelize[_0x99bd('0x1')](_0x99bd('0x2'),_0x99bd('0x3'),_0x99bd('0x4'),_0x99bd('0x5'),_0x99bd('0x6')),'defaultValue':_0x99bd('0x2')},'content':{'type':Sequelize[_0x99bd('0x7')]},'key':{'type':Sequelize[_0x99bd('0x7')]},'keyType':{'type':Sequelize[_0x99bd('0x1')]('string',_0x99bd('0x3'),_0x99bd('0x4'))},'keyContent':{'type':Sequelize[_0x99bd('0x7')]},'idField':{'type':Sequelize[_0x99bd('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9033=['STRING','customVariable','BOOLEAN','sequelize','ENUM','variable','picklist','string'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x9033,0x173));var _0x3903=function(_0x2405e7,_0x39a4ef){_0x2405e7=_0x2405e7-0x0;var _0x2763b8=_0x9033[_0x2405e7];return _0x2763b8;};'use strict';var Sequelize=require(_0x3903('0x0'));module['exports']={'type':{'type':Sequelize[_0x3903('0x1')]('string',_0x3903('0x2'),'customVariable','keyValue',_0x3903('0x3')),'defaultValue':_0x3903('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3903('0x5')]},'keyType':{'type':Sequelize[_0x3903('0x1')]('string','variable',_0x3903('0x6'))},'keyContent':{'type':Sequelize[_0x3903('0x5')]},'idField':{'type':Sequelize[_0x3903('0x5')]},'nameField':{'type':Sequelize[_0x3903('0x5')]},'customField':{'type':Sequelize[_0x3903('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3903('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 35e828d..1e1988a 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 _0xae11=['rows','show','params','keys','include','options','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x3c089e,_0x3bd2e9){var _0xd68551=function(_0x444f53){while(--_0x444f53){_0x3c089e['push'](_0x3c089e['shift']());}};_0xd68551(++_0x3bd2e9);}(_0xae11,0x1c1));var _0x1ae1=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0xae11[_0x1ebc6c];return _0x3a826d;};'use strict';var emlformat=require(_0x1ae1('0x0'));var rimraf=require(_0x1ae1('0x1'));var zipdir=require(_0x1ae1('0x2'));var jsonpatch=require(_0x1ae1('0x3'));var rp=require(_0x1ae1('0x4'));var moment=require(_0x1ae1('0x5'));var BPromise=require(_0x1ae1('0x6'));var Mustache=require(_0x1ae1('0x7'));var util=require(_0x1ae1('0x8'));var path=require(_0x1ae1('0x9'));var sox=require('sox');var csv=require(_0x1ae1('0xa'));var ejs=require(_0x1ae1('0xb'));var fs=require('fs');var fs_extra=require(_0x1ae1('0xc'));var _=require(_0x1ae1('0xd'));var squel=require('squel');var crypto=require(_0x1ae1('0xe'));var jsforce=require(_0x1ae1('0xf'));var deskjs=require(_0x1ae1('0x10'));var toCsv=require(_0x1ae1('0xa'));var querystring=require(_0x1ae1('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1ae1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1ae1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1ae1('0x14'));var config=require(_0x1ae1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102013,_0x456035){_0x456035=_0x456035||0xcc;return function(_0xed731d){if(_0xed731d){return _0x102013[_0x1ae1('0x16')](_0x456035);}return _0x102013[_0x1ae1('0x17')](_0x456035)['end']();};}function respondWithResult(_0x2db67d,_0xa670b7){_0xa670b7=_0xa670b7||0xc8;return function(_0x5cc8b2){if(_0x5cc8b2){return _0x2db67d[_0x1ae1('0x17')](_0xa670b7)[_0x1ae1('0x18')](_0x5cc8b2);}};}function respondWithFilteredResult(_0x5d6b16,_0xaebb30){return function(_0x12bf27){if(_0x12bf27){var _0x4e4854=typeof _0xaebb30[_0x1ae1('0x19')]==='undefined'&&typeof _0xaebb30[_0x1ae1('0x1a')]===_0x1ae1('0x1b');var _0x1e115e=_0x12bf27['count'];var _0x2ea081=_0x4e4854?0x0:_0xaebb30[_0x1ae1('0x19')];var _0xacaa88=_0x4e4854?_0x12bf27[_0x1ae1('0x1c')]:_0xaebb30['offset']+_0xaebb30[_0x1ae1('0x1a')];var _0x31d55;if(_0xacaa88>=_0x1e115e){_0xacaa88=_0x1e115e;_0x31d55=0xc8;}else{_0x31d55=0xce;}_0x5d6b16['status'](_0x31d55);return _0x5d6b16[_0x1ae1('0x1d')](_0x1ae1('0x1e'),_0x2ea081+'-'+_0xacaa88+'/'+_0x1e115e)[_0x1ae1('0x18')](_0x12bf27);}return null;};}function patchUpdates(_0x3337e2){return function(_0x1d507a){try{jsonpatch[_0x1ae1('0x1f')](_0x1d507a,_0x3337e2,!![]);}catch(_0x29833b){return BPromise['reject'](_0x29833b);}return _0x1d507a[_0x1ae1('0x20')]();};}function saveUpdates(_0x2db1f9,_0x55ef94){return function(_0x1938ef){if(_0x1938ef){return _0x1938ef[_0x1ae1('0x21')](_0x2db1f9)[_0x1ae1('0x22')](function(_0x10108b){return _0x10108b;});}return null;};}function removeEntity(_0x54897a,_0x22e21c){return function(_0x5974b3){if(_0x5974b3){return _0x5974b3['destroy']()[_0x1ae1('0x22')](function(){_0x54897a[_0x1ae1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x392c93,_0x3fa163){return function(_0x51e685){if(!_0x51e685){_0x392c93[_0x1ae1('0x16')](0x194);}return _0x51e685;};}function handleError(_0x56f891,_0x35fad6){_0x35fad6=_0x35fad6||0x1f4;return function(_0x9c92fe){logger[_0x1ae1('0x23')](_0x9c92fe[_0x1ae1('0x24')]);if(_0x9c92fe[_0x1ae1('0x25')]){delete _0x9c92fe[_0x1ae1('0x25')];}_0x56f891[_0x1ae1('0x17')](_0x35fad6)[_0x1ae1('0x26')](_0x9c92fe);};}exports[_0x1ae1('0x27')]=function(_0x1dcc4d,_0x3e0f76){var _0x40160c={},_0xbcb48b={},_0x13bf29={'count':0x0,'rows':[]};var _0xab18c0=_[_0x1ae1('0x28')](db[_0x1ae1('0x29')][_0x1ae1('0x2a')],function(_0x24d8da){return{'name':_0x24d8da[_0x1ae1('0x2b')],'type':_0x24d8da[_0x1ae1('0x2c')][_0x1ae1('0x2d')]};});_0xbcb48b[_0x1ae1('0x2e')]=_[_0x1ae1('0x28')](_0xab18c0,_0x1ae1('0x25'));_0xbcb48b[_0x1ae1('0x2f')]=_['keys'](_0x1dcc4d[_0x1ae1('0x2f')]);_0xbcb48b[_0x1ae1('0x30')]=_[_0x1ae1('0x31')](_0xbcb48b[_0x1ae1('0x2e')],_0xbcb48b[_0x1ae1('0x2f')]);_0x40160c[_0x1ae1('0x32')]=_[_0x1ae1('0x31')](_0xbcb48b[_0x1ae1('0x2e')],qs[_0x1ae1('0x33')](_0x1dcc4d['query'][_0x1ae1('0x33')]));_0x40160c[_0x1ae1('0x32')]=_0x40160c[_0x1ae1('0x32')][_0x1ae1('0x34')]?_0x40160c[_0x1ae1('0x32')]:_0xbcb48b[_0x1ae1('0x2e')];if(!_0x1dcc4d[_0x1ae1('0x2f')]['hasOwnProperty'](_0x1ae1('0x35'))){_0x40160c['limit']=qs[_0x1ae1('0x1a')](_0x1dcc4d[_0x1ae1('0x2f')][_0x1ae1('0x1a')]);_0x40160c[_0x1ae1('0x19')]=qs['offset'](_0x1dcc4d['query']['offset']);}_0x40160c[_0x1ae1('0x36')]=qs[_0x1ae1('0x37')](_0x1dcc4d['query'][_0x1ae1('0x37')]);_0x40160c[_0x1ae1('0x38')]=qs['filters'](_[_0x1ae1('0x39')](_0x1dcc4d['query'],_0xbcb48b[_0x1ae1('0x30')]),_0xab18c0);if(_0x1dcc4d['query'][_0x1ae1('0x3a')]){_0x40160c[_0x1ae1('0x38')]=_[_0x1ae1('0x3b')](_0x40160c[_0x1ae1('0x38')],{'$or':_[_0x1ae1('0x28')](_0xab18c0,function(_0x390740){if(_0x390740['type']!==_0x1ae1('0x3c')){var _0x558a2e={};_0x558a2e[_0x390740['name']]={'$like':'%'+_0x1dcc4d[_0x1ae1('0x2f')]['filter']+'%'};return _0x558a2e;}})});}_0x40160c=_[_0x1ae1('0x3b')]({},_0x40160c,_0x1dcc4d['options']);var _0x57b035={'where':_0x40160c[_0x1ae1('0x38')]};return db['ZendeskField']['count'](_0x57b035)[_0x1ae1('0x22')](function(_0x50e2fe){_0x13bf29[_0x1ae1('0x1c')]=_0x50e2fe;if(_0x1dcc4d[_0x1ae1('0x2f')][_0x1ae1('0x3d')]){_0x40160c['include']=[{'all':!![]}];}return db[_0x1ae1('0x29')]['findAll'](_0x40160c);})['then'](function(_0x1c9447){_0x13bf29[_0x1ae1('0x3e')]=_0x1c9447;return _0x13bf29;})['then'](respondWithFilteredResult(_0x3e0f76,_0x40160c))['catch'](handleError(_0x3e0f76,null));};exports[_0x1ae1('0x3f')]=function(_0x5c5518,_0x3227e6){var _0x33d5f1={'raw':!![],'where':{'id':_0x5c5518[_0x1ae1('0x40')]['id']}},_0x51e786={};_0x51e786[_0x1ae1('0x2e')]=_[_0x1ae1('0x41')](db[_0x1ae1('0x29')][_0x1ae1('0x2a')]);_0x51e786[_0x1ae1('0x2f')]=_[_0x1ae1('0x41')](_0x5c5518[_0x1ae1('0x2f')]);_0x51e786[_0x1ae1('0x30')]=_['intersection'](_0x51e786['model'],_0x51e786[_0x1ae1('0x2f')]);_0x33d5f1['attributes']=_[_0x1ae1('0x31')](_0x51e786[_0x1ae1('0x2e')],qs[_0x1ae1('0x33')](_0x5c5518['query']['fields']));_0x33d5f1[_0x1ae1('0x32')]=_0x33d5f1[_0x1ae1('0x32')][_0x1ae1('0x34')]?_0x33d5f1[_0x1ae1('0x32')]:_0x51e786[_0x1ae1('0x2e')];if(_0x5c5518[_0x1ae1('0x2f')]['includeAll']){_0x33d5f1[_0x1ae1('0x42')]=[{'all':!![]}];}_0x33d5f1=_[_0x1ae1('0x3b')]({},_0x33d5f1,_0x5c5518[_0x1ae1('0x43')]);return db[_0x1ae1('0x29')]['find'](_0x33d5f1)[_0x1ae1('0x22')](handleEntityNotFound(_0x3227e6,null))[_0x1ae1('0x22')](respondWithResult(_0x3227e6,null))[_0x1ae1('0x44')](handleError(_0x3227e6,null));};exports[_0x1ae1('0x45')]=function(_0x2aedac,_0x5a92dd){return db[_0x1ae1('0x29')]['create'](_0x2aedac[_0x1ae1('0x46')],{})['then'](respondWithResult(_0x5a92dd,0xc9))['catch'](handleError(_0x5a92dd,null));};exports['update']=function(_0x3bd92a,_0x30b9c2){if(_0x3bd92a[_0x1ae1('0x46')]['id']){delete _0x3bd92a[_0x1ae1('0x46')]['id'];}return db[_0x1ae1('0x29')][_0x1ae1('0x47')]({'where':{'id':_0x3bd92a['params']['id']}})[_0x1ae1('0x22')](handleEntityNotFound(_0x30b9c2,null))['then'](saveUpdates(_0x3bd92a[_0x1ae1('0x46')],null))[_0x1ae1('0x22')](respondWithResult(_0x30b9c2,null))[_0x1ae1('0x44')](handleError(_0x30b9c2,null));};exports[_0x1ae1('0x48')]=function(_0x306fc4,_0x1b6b22){return db[_0x1ae1('0x29')][_0x1ae1('0x47')]({'where':{'id':_0x306fc4[_0x1ae1('0x40')]['id']}})[_0x1ae1('0x22')](handleEntityNotFound(_0x1b6b22,null))[_0x1ae1('0x22')](removeEntity(_0x1b6b22,null))[_0x1ae1('0x44')](handleError(_0x1b6b22,null));}; \ No newline at end of file +var _0x5dd5=['length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','find','create','body','params','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','status','end','undefined','limit','count','offset','set','json','apply','reject','update','then','sendStatus','stack','name','send','index','map','ZendeskField','fieldName','key','keys','filters','intersection','model','query','attributes','fields'];(function(_0x12da7f,_0x493dc4){var _0x3329a6=function(_0x590fb7){while(--_0x590fb7){_0x12da7f['push'](_0x12da7f['shift']());}};_0x3329a6(++_0x493dc4);}(_0x5dd5,0x1a0));var _0x55dd=function(_0x4e6618,_0x26149d){_0x4e6618=_0x4e6618-0x0;var _0x13a2c8=_0x5dd5[_0x4e6618];return _0x13a2c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x55dd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x55dd('0x1'));var moment=require(_0x55dd('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x55dd('0x3'));var util=require(_0x55dd('0x4'));var path=require('path');var sox=require(_0x55dd('0x5'));var csv=require(_0x55dd('0x6'));var ejs=require(_0x55dd('0x7'));var fs=require('fs');var fs_extra=require(_0x55dd('0x8'));var _=require(_0x55dd('0x9'));var squel=require(_0x55dd('0xa'));var crypto=require(_0x55dd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x55dd('0xc'));var toCsv=require(_0x55dd('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x55dd('0xd'));var qs=require(_0x55dd('0xe'));var as=require(_0x55dd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55dd('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x55dd('0x11'))['db'];function respondWithStatusCode(_0x1f06ee,_0x2e743d){_0x2e743d=_0x2e743d||0xcc;return function(_0x515ac9){if(_0x515ac9){return _0x1f06ee['sendStatus'](_0x2e743d);}return _0x1f06ee[_0x55dd('0x12')](_0x2e743d)[_0x55dd('0x13')]();};}function respondWithResult(_0x1c2759,_0x331e4d){_0x331e4d=_0x331e4d||0xc8;return function(_0x175341){if(_0x175341){return _0x1c2759['status'](_0x331e4d)['json'](_0x175341);}};}function respondWithFilteredResult(_0x38e99f,_0x2d07a2){return function(_0x10fd0d){if(_0x10fd0d){var _0x48e062=typeof _0x2d07a2['offset']===_0x55dd('0x14')&&typeof _0x2d07a2[_0x55dd('0x15')]===_0x55dd('0x14');var _0x10effc=_0x10fd0d[_0x55dd('0x16')];var _0x1b075f=_0x48e062?0x0:_0x2d07a2[_0x55dd('0x17')];var _0x4cd157=_0x48e062?_0x10fd0d['count']:_0x2d07a2[_0x55dd('0x17')]+_0x2d07a2[_0x55dd('0x15')];var _0xd2096a;if(_0x4cd157>=_0x10effc){_0x4cd157=_0x10effc;_0xd2096a=0xc8;}else{_0xd2096a=0xce;}_0x38e99f[_0x55dd('0x12')](_0xd2096a);return _0x38e99f[_0x55dd('0x18')]('Content-Range',_0x1b075f+'-'+_0x4cd157+'/'+_0x10effc)[_0x55dd('0x19')](_0x10fd0d);}return null;};}function patchUpdates(_0x36b777){return function(_0x22b006){try{jsonpatch[_0x55dd('0x1a')](_0x22b006,_0x36b777,!![]);}catch(_0x4d2343){return BPromise[_0x55dd('0x1b')](_0x4d2343);}return _0x22b006['save']();};}function saveUpdates(_0x45dbd5,_0x509df1){return function(_0xe16a09){if(_0xe16a09){return _0xe16a09[_0x55dd('0x1c')](_0x45dbd5)['then'](function(_0x4cc020){return _0x4cc020;});}return null;};}function removeEntity(_0x139f8f,_0x20f049){return function(_0x4f7872){if(_0x4f7872){return _0x4f7872['destroy']()[_0x55dd('0x1d')](function(){_0x139f8f[_0x55dd('0x12')](0xcc)[_0x55dd('0x13')]();});}};}function handleEntityNotFound(_0x572829,_0x3699b4){return function(_0x6961c8){if(!_0x6961c8){_0x572829[_0x55dd('0x1e')](0x194);}return _0x6961c8;};}function handleError(_0x5ccb02,_0x237a5e){_0x237a5e=_0x237a5e||0x1f4;return function(_0x6c75f6){logger['error'](_0x6c75f6[_0x55dd('0x1f')]);if(_0x6c75f6[_0x55dd('0x20')]){delete _0x6c75f6[_0x55dd('0x20')];}_0x5ccb02['status'](_0x237a5e)[_0x55dd('0x21')](_0x6c75f6);};}exports[_0x55dd('0x22')]=function(_0x524b71,_0x43f235){var _0x2567e2={},_0x52988a={},_0x2e629e={'count':0x0,'rows':[]};var _0x5220a2=_[_0x55dd('0x23')](db[_0x55dd('0x24')]['rawAttributes'],function(_0x2d06ed){return{'name':_0x2d06ed[_0x55dd('0x25')],'type':_0x2d06ed['type'][_0x55dd('0x26')]};});_0x52988a['model']=_['map'](_0x5220a2,_0x55dd('0x20'));_0x52988a['query']=_[_0x55dd('0x27')](_0x524b71['query']);_0x52988a[_0x55dd('0x28')]=_[_0x55dd('0x29')](_0x52988a[_0x55dd('0x2a')],_0x52988a[_0x55dd('0x2b')]);_0x2567e2[_0x55dd('0x2c')]=_['intersection'](_0x52988a[_0x55dd('0x2a')],qs[_0x55dd('0x2d')](_0x524b71[_0x55dd('0x2b')][_0x55dd('0x2d')]));_0x2567e2['attributes']=_0x2567e2[_0x55dd('0x2c')][_0x55dd('0x2e')]?_0x2567e2['attributes']:_0x52988a[_0x55dd('0x2a')];if(!_0x524b71[_0x55dd('0x2b')][_0x55dd('0x2f')]('nolimit')){_0x2567e2[_0x55dd('0x15')]=qs[_0x55dd('0x15')](_0x524b71[_0x55dd('0x2b')][_0x55dd('0x15')]);_0x2567e2[_0x55dd('0x17')]=qs['offset'](_0x524b71[_0x55dd('0x2b')][_0x55dd('0x17')]);}_0x2567e2[_0x55dd('0x30')]=qs[_0x55dd('0x31')](_0x524b71['query'][_0x55dd('0x31')]);_0x2567e2['where']=qs[_0x55dd('0x28')](_[_0x55dd('0x32')](_0x524b71['query'],_0x52988a[_0x55dd('0x28')]),_0x5220a2);if(_0x524b71[_0x55dd('0x2b')][_0x55dd('0x33')]){_0x2567e2[_0x55dd('0x34')]=_[_0x55dd('0x35')](_0x2567e2['where'],{'$or':_[_0x55dd('0x23')](_0x5220a2,function(_0x56c9db){if(_0x56c9db[_0x55dd('0x36')]!==_0x55dd('0x37')){var _0x2fc894={};_0x2fc894[_0x56c9db['name']]={'$like':'%'+_0x524b71[_0x55dd('0x2b')]['filter']+'%'};return _0x2fc894;}})});}_0x2567e2=_[_0x55dd('0x35')]({},_0x2567e2,_0x524b71[_0x55dd('0x38')]);var _0x24d970={'where':_0x2567e2[_0x55dd('0x34')]};return db['ZendeskField']['count'](_0x24d970)[_0x55dd('0x1d')](function(_0x5e3c02){_0x2e629e[_0x55dd('0x16')]=_0x5e3c02;if(_0x524b71[_0x55dd('0x2b')][_0x55dd('0x39')]){_0x2567e2[_0x55dd('0x3a')]=[{'all':!![]}];}return db[_0x55dd('0x24')]['findAll'](_0x2567e2);})[_0x55dd('0x1d')](function(_0x263f18){_0x2e629e['rows']=_0x263f18;return _0x2e629e;})[_0x55dd('0x1d')](respondWithFilteredResult(_0x43f235,_0x2567e2))[_0x55dd('0x3b')](handleError(_0x43f235,null));};exports[_0x55dd('0x3c')]=function(_0x133c40,_0x21e233){var _0x58e391={'raw':!![],'where':{'id':_0x133c40['params']['id']}},_0x3ada78={};_0x3ada78[_0x55dd('0x2a')]=_[_0x55dd('0x27')](db[_0x55dd('0x24')][_0x55dd('0x3d')]);_0x3ada78['query']=_[_0x55dd('0x27')](_0x133c40[_0x55dd('0x2b')]);_0x3ada78['filters']=_[_0x55dd('0x29')](_0x3ada78[_0x55dd('0x2a')],_0x3ada78[_0x55dd('0x2b')]);_0x58e391['attributes']=_[_0x55dd('0x29')](_0x3ada78[_0x55dd('0x2a')],qs['fields'](_0x133c40[_0x55dd('0x2b')][_0x55dd('0x2d')]));_0x58e391['attributes']=_0x58e391['attributes'][_0x55dd('0x2e')]?_0x58e391['attributes']:_0x3ada78['model'];if(_0x133c40[_0x55dd('0x2b')][_0x55dd('0x39')]){_0x58e391[_0x55dd('0x3a')]=[{'all':!![]}];}_0x58e391=_[_0x55dd('0x35')]({},_0x58e391,_0x133c40[_0x55dd('0x38')]);return db[_0x55dd('0x24')][_0x55dd('0x3e')](_0x58e391)[_0x55dd('0x1d')](handleEntityNotFound(_0x21e233,null))['then'](respondWithResult(_0x21e233,null))[_0x55dd('0x3b')](handleError(_0x21e233,null));};exports[_0x55dd('0x3f')]=function(_0x8446cc,_0x181558){return db['ZendeskField'][_0x55dd('0x3f')](_0x8446cc['body'],{})[_0x55dd('0x1d')](respondWithResult(_0x181558,0xc9))[_0x55dd('0x3b')](handleError(_0x181558,null));};exports[_0x55dd('0x1c')]=function(_0x540267,_0x406ab9){if(_0x540267[_0x55dd('0x40')]['id']){delete _0x540267['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x540267[_0x55dd('0x41')]['id']}})[_0x55dd('0x1d')](handleEntityNotFound(_0x406ab9,null))[_0x55dd('0x1d')](saveUpdates(_0x540267[_0x55dd('0x40')],null))[_0x55dd('0x1d')](respondWithResult(_0x406ab9,null))[_0x55dd('0x3b')](handleError(_0x406ab9,null));};exports['destroy']=function(_0x2b2aef,_0x1e3fee){return db[_0x55dd('0x24')][_0x55dd('0x3e')]({'where':{'id':_0x2b2aef[_0x55dd('0x41')]['id']}})[_0x55dd('0x1d')](handleEntityNotFound(_0x1e3fee,null))['then'](removeEntity(_0x1e3fee,null))[_0x55dd('0x3b')](handleError(_0x1e3fee,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 38f83fd..be2b52e 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 _0xb178=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x4cbd55,_0x3adec2){var _0x4eff51=function(_0x4fe1d5){while(--_0x4fe1d5){_0x4cbd55['push'](_0x4cbd55['shift']());}};_0x4eff51(++_0x3adec2);}(_0xb178,0x67));var _0x8b17=function(_0x415260,_0x135fcb){_0x415260=_0x415260-0x0;var _0x490f21=_0xb178[_0x415260];return _0x490f21;};'use strict';var _=require(_0x8b17('0x0'));var util=require(_0x8b17('0x1'));var logger=require(_0x8b17('0x2'))(_0x8b17('0x3'));var moment=require('moment');var BPromise=require(_0x8b17('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b17('0x5'));var rimraf=require(_0x8b17('0x6'));var config=require(_0x8b17('0x7'));var attributes=require(_0x8b17('0x8'));module[_0x8b17('0x9')]=function(_0xf5deec,_0xd891f3){return _0xf5deec[_0x8b17('0xa')](_0x8b17('0xb'),attributes,{'tableName':_0x8b17('0xc'),'paranoid':![],'indexes':[{'name':_0x8b17('0xd'),'fields':[_0x8b17('0xe'),_0x8b17('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b83=['idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index'];(function(_0x54c984,_0x5052e3){var _0x4c8d1c=function(_0x54828e){while(--_0x54828e){_0x54c984['push'](_0x54c984['shift']());}};_0x4c8d1c(++_0x5052e3);}(_0x6b83,0x16a));var _0x36b8=function(_0xbd6f8e,_0x10c174){_0xbd6f8e=_0xbd6f8e-0x0;var _0x57b158=_0x6b83[_0xbd6f8e];return _0x57b158;};'use strict';var _=require(_0x36b8('0x0'));var util=require('util');var logger=require(_0x36b8('0x1'))('api');var moment=require(_0x36b8('0x2'));var BPromise=require(_0x36b8('0x3'));var rp=require(_0x36b8('0x4'));var fs=require('fs');var path=require(_0x36b8('0x5'));var rimraf=require(_0x36b8('0x6'));var config=require(_0x36b8('0x7'));var attributes=require(_0x36b8('0x8'));module[_0x36b8('0x9')]=function(_0x436380,_0x412ccf){return _0x436380[_0x36b8('0xa')]('ZendeskField',attributes,{'tableName':_0x36b8('0xb'),'paranoid':![],'indexes':[{'name':_0x36b8('0xc'),'fields':[_0x36b8('0xd'),_0x36b8('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 4836060..854b26d 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 _0x6583=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x42b09b,_0x2f8b39){var _0x26877f=function(_0x541fd6){while(--_0x541fd6){_0x42b09b['push'](_0x42b09b['shift']());}};_0x26877f(++_0x2f8b39);}(_0x6583,0x94));var _0x3658=function(_0x1b88fd,_0x3fc359){_0x1b88fd=_0x1b88fd-0x0;var _0x287cd1=_0x6583[_0x1b88fd];return _0x287cd1;};'use strict';var _=require(_0x3658('0x0'));var util=require(_0x3658('0x1'));var moment=require(_0x3658('0x2'));var BPromise=require(_0x3658('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3658('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3658('0x5'));var logger=require(_0x3658('0x6'))(_0x3658('0x7'));var config=require(_0x3658('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25ee7e,_0x2f3ecb,_0x352f7c){return new BPromise(function(_0x5325a8,_0x59ec67){return client[_0x3658('0xa')](_0x25ee7e,_0x352f7c)[_0x3658('0xb')](function(_0x501ab7){logger[_0x3658('0xc')](_0x3658('0xd'),_0x2f3ecb,'request\x20sent');logger['debug'](_0x3658('0xe'),_0x2f3ecb,_0x3658('0xf'),JSON['stringify'](_0x501ab7));if(_0x501ab7[_0x3658('0x10')]){if(_0x501ab7['error'][_0x3658('0x11')]===0x1f4){logger[_0x3658('0x10')](_0x3658('0xd'),_0x2f3ecb,_0x501ab7[_0x3658('0x10')][_0x3658('0x12')]);return _0x59ec67(_0x501ab7['error']['message']);}logger['error'](_0x3658('0xd'),_0x2f3ecb,_0x501ab7[_0x3658('0x10')][_0x3658('0x12')]);return _0x5325a8(_0x501ab7[_0x3658('0x10')]['message']);}else{logger['info'](_0x3658('0xd'),_0x2f3ecb,'request\x20sent');_0x5325a8(_0x501ab7[_0x3658('0x13')]['message']);}})[_0x3658('0x14')](function(_0x1c23b1){logger[_0x3658('0x10')](_0x3658('0xd'),_0x2f3ecb,_0x1c23b1);_0x59ec67(_0x1c23b1);});});} \ No newline at end of file +var _0xf453=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','info'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xf453,0x6c));var _0x3f45=function(_0x902641,_0x55e5d7){_0x902641=_0x902641-0x0;var _0xb01cc9=_0xf453[_0x902641];return _0xb01cc9;};'use strict';var _=require(_0x3f45('0x0'));var util=require(_0x3f45('0x1'));var moment=require(_0x3f45('0x2'));var BPromise=require(_0x3f45('0x3'));var rs=require(_0x3f45('0x4'));var fs=require('fs');var Redis=require(_0x3f45('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f45('0x6'));var logger=require(_0x3f45('0x7'))(_0x3f45('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3f45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x280262,_0x2a3c4a,_0x501006){return new BPromise(function(_0x2f6a78,_0x53f0ae){return client[_0x3f45('0xa')](_0x280262,_0x501006)['then'](function(_0x4ab2b3){logger[_0x3f45('0xb')](_0x3f45('0xc'),_0x2a3c4a,_0x3f45('0xd'));logger[_0x3f45('0xe')](_0x3f45('0xf'),_0x2a3c4a,'request\x20sent',JSON[_0x3f45('0x10')](_0x4ab2b3));if(_0x4ab2b3[_0x3f45('0x11')]){if(_0x4ab2b3['error']['code']===0x1f4){logger['error'](_0x3f45('0xc'),_0x2a3c4a,_0x4ab2b3[_0x3f45('0x11')][_0x3f45('0x12')]);return _0x53f0ae(_0x4ab2b3[_0x3f45('0x11')][_0x3f45('0x12')]);}logger[_0x3f45('0x11')]('ZendeskField,\x20%s,\x20%s',_0x2a3c4a,_0x4ab2b3[_0x3f45('0x11')]['message']);return _0x2f6a78(_0x4ab2b3[_0x3f45('0x11')][_0x3f45('0x12')]);}else{logger[_0x3f45('0xb')](_0x3f45('0xc'),_0x2a3c4a,_0x3f45('0xd'));_0x2f6a78(_0x4ab2b3[_0x3f45('0x13')][_0x3f45('0x12')]);}})['catch'](function(_0x32dc04){logger[_0x3f45('0x11')](_0x3f45('0xc'),_0x2a3c4a,_0x32dc04);_0x53f0ae(_0x32dc04);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ffe3a89..444a730 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 _0xd9b5=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','multer'];(function(_0x13647c,_0x4822a7){var _0x341ecb=function(_0x79eb2){while(--_0x79eb2){_0x13647c['push'](_0x13647c['shift']());}};_0x341ecb(++_0x4822a7);}(_0xd9b5,0x7d));var _0x5d9b=function(_0x6ef073,_0x461279){_0x6ef073=_0x6ef073-0x0;var _0x410bfd=_0xd9b5[_0x6ef073];return _0x410bfd;};'use strict';var multer=require(_0x5d9b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5d9b('0x1'));var router=express[_0x5d9b('0x2')]();var fs_extra=require(_0x5d9b('0x3'));var auth=require(_0x5d9b('0x4'));var interaction=require(_0x5d9b('0x5'));var config=require(_0x5d9b('0x6'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x5d9b('0x7')](),controller[_0x5d9b('0x8')]);router[_0x5d9b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x5d9b('0xa'),auth[_0x5d9b('0x7')](),controller[_0x5d9b('0xb')]);router[_0x5d9b('0x9')](_0x5d9b('0xc'),auth['isAuthenticated'](),controller[_0x5d9b('0xd')]);router[_0x5d9b('0xe')]('/',auth[_0x5d9b('0x7')](),controller[_0x5d9b('0xf')]);router[_0x5d9b('0xe')]('/:id/configurations',auth[_0x5d9b('0x7')](),controller[_0x5d9b('0x10')]);router[_0x5d9b('0x11')](_0x5d9b('0x12'),auth['isAuthenticated'](),controller[_0x5d9b('0x13')]);router['delete'](_0x5d9b('0x12'),auth[_0x5d9b('0x7')](),controller[_0x5d9b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7015=['post','addConfiguration','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','getFields'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0x7015,0x70));var _0x5701=function(_0x596490,_0x2a2aec){_0x596490=_0x596490-0x0;var _0x3fb0d9=_0x7015[_0x596490];return _0x3fb0d9;};'use strict';var multer=require('multer');var util=require(_0x5701('0x0'));var path=require(_0x5701('0x1'));var timeout=require(_0x5701('0x2'));var express=require('express');var router=express[_0x5701('0x3')]();var fs_extra=require(_0x5701('0x4'));var auth=require(_0x5701('0x5'));var interaction=require(_0x5701('0x6'));var config=require(_0x5701('0x7'));var controller=require(_0x5701('0x8'));router[_0x5701('0x9')]('/',auth[_0x5701('0xa')](),controller['index']);router[_0x5701('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5701('0x9')](_0x5701('0xb'),auth['isAuthenticated'](),controller[_0x5701('0xc')]);router[_0x5701('0x9')]('/:id/fields',auth[_0x5701('0xa')](),controller[_0x5701('0xd')]);router[_0x5701('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x5701('0xa')](),controller[_0x5701('0xf')]);router['put']('/:id',auth[_0x5701('0xa')](),controller[_0x5701('0x10')]);router[_0x5701('0x11')](_0x5701('0x12'),auth[_0x5701('0xa')](),controller[_0x5701('0x13')]);module[_0x5701('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 8dff425..a8ee54b 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 _0x70e0=['STRING','sequelize','exports'];(function(_0x44c60c,_0x59354c){var _0x230410=function(_0x3e553a){while(--_0x3e553a){_0x44c60c['push'](_0x44c60c['shift']());}};_0x230410(++_0x59354c);}(_0x70e0,0x17b));var _0x070e=function(_0x45b075,_0x535960){_0x45b075=_0x45b075-0x0;var _0x5a7493=_0x70e0[_0x45b075];return _0x5a7493;};'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 +var _0x22fb=['STRING'];(function(_0xe25baa,_0x317f8f){var _0x4f8f48=function(_0x53fd96){while(--_0x53fd96){_0xe25baa['push'](_0xe25baa['shift']());}};_0x4f8f48(++_0x317f8f);}(_0x22fb,0x192));var _0xb22f=function(_0x540f14,_0x2f78dd){_0x540f14=_0x540f14-0x0;var _0x3ab6d8=_0x22fb[_0x540f14];return _0x3ab6d8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index a7f61a5..7a5182b 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 _0xc0f4=['channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','clientSecret','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','error','stack','name','send','map','ZohoAccount','rawAttributes','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','intersection','options','find','catch','create','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','pick','AccountId','Subjects','getSubjects'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xc0f4,0x150));var _0x4c0f=function(_0x4bf97c,_0xbf3e89){_0x4bf97c=_0x4bf97c-0x0;var _0x55acfb=_0xc0f4[_0x4bf97c];return _0x55acfb;};'use strict';var emlformat=require(_0x4c0f('0x0'));var rimraf=require(_0x4c0f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c0f('0x2'));var rp=require(_0x4c0f('0x3'));var moment=require(_0x4c0f('0x4'));var BPromise=require(_0x4c0f('0x5'));var Mustache=require(_0x4c0f('0x6'));var util=require(_0x4c0f('0x7'));var path=require(_0x4c0f('0x8'));var sox=require(_0x4c0f('0x9'));var csv=require(_0x4c0f('0xa'));var ejs=require(_0x4c0f('0xb'));var fs=require('fs');var fs_extra=require(_0x4c0f('0xc'));var _=require(_0x4c0f('0xd'));var squel=require(_0x4c0f('0xe'));var crypto=require(_0x4c0f('0xf'));var jsforce=require(_0x4c0f('0x10'));var deskjs=require(_0x4c0f('0x11'));var toCsv=require(_0x4c0f('0xa'));var querystring=require(_0x4c0f('0x12'));var Papa=require('papaparse');var Redis=require(_0x4c0f('0x13'));var authService=require(_0x4c0f('0x14'));var qs=require(_0x4c0f('0x15'));var as=require(_0x4c0f('0x16'));var hardwareService=require(_0x4c0f('0x17'));var logger=require(_0x4c0f('0x18'))(_0x4c0f('0x19'));var utils=require('../../config/utils');var config=require(_0x4c0f('0x1a'));var licenseUtil=require(_0x4c0f('0x1b'));var db=require(_0x4c0f('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59622c,_0x134e11){_0x134e11=_0x134e11||0xcc;return function(_0x191026){if(_0x191026){return _0x59622c[_0x4c0f('0x1d')](_0x134e11);}return _0x59622c[_0x4c0f('0x1e')](_0x134e11)[_0x4c0f('0x1f')]();};}function respondWithResult(_0x4c0078,_0x2df5b0){_0x2df5b0=_0x2df5b0||0xc8;return function(_0x1bbe45){if(_0x1bbe45){return _0x4c0078[_0x4c0f('0x1e')](_0x2df5b0)['json'](_0x1bbe45);}};}function respondWithFilteredResult(_0x4d4135,_0x34a495){return function(_0x137e1e){if(_0x137e1e){var _0xc88d4=typeof _0x34a495['offset']===_0x4c0f('0x20')&&typeof _0x34a495[_0x4c0f('0x21')]==='undefined';var _0x442d33=_0x137e1e[_0x4c0f('0x22')];var _0xdf3cab=_0xc88d4?0x0:_0x34a495[_0x4c0f('0x23')];var _0x161796=_0xc88d4?_0x137e1e[_0x4c0f('0x22')]:_0x34a495[_0x4c0f('0x23')]+_0x34a495['limit'];var _0x28ec28;if(_0x161796>=_0x442d33){_0x161796=_0x442d33;_0x28ec28=0xc8;}else{_0x28ec28=0xce;}_0x4d4135[_0x4c0f('0x1e')](_0x28ec28);return _0x4d4135[_0x4c0f('0x24')](_0x4c0f('0x25'),_0xdf3cab+'-'+_0x161796+'/'+_0x442d33)[_0x4c0f('0x26')](_0x137e1e);}return null;};}function patchUpdates(_0x519f39){return function(_0x35781b){try{jsonpatch[_0x4c0f('0x27')](_0x35781b,_0x519f39,!![]);}catch(_0x5aa223){return BPromise['reject'](_0x5aa223);}return _0x35781b[_0x4c0f('0x28')]();};}function saveUpdates(_0x1a3593,_0x2e1844){return function(_0x3ad3bc){if(_0x3ad3bc){return _0x3ad3bc[_0x4c0f('0x29')](_0x1a3593)[_0x4c0f('0x2a')](function(_0x47a1ca){return _0x47a1ca;});}return null;};}function removeEntity(_0xe7f27f,_0x344a10){return function(_0x5809b1){if(_0x5809b1){return _0x5809b1['destroy']()['then'](function(){_0xe7f27f[_0x4c0f('0x1e')](0xcc)[_0x4c0f('0x1f')]();});}};}function handleEntityNotFound(_0x3ae049,_0x1b6183){return function(_0x587dd6){if(!_0x587dd6){_0x3ae049[_0x4c0f('0x1d')](0x194);}return _0x587dd6;};}function handleError(_0x29fde8,_0x5421a7){_0x5421a7=_0x5421a7||0x1f4;return function(_0x246498){logger[_0x4c0f('0x2b')](_0x246498[_0x4c0f('0x2c')]);if(_0x246498[_0x4c0f('0x2d')]){delete _0x246498['name'];}_0x29fde8[_0x4c0f('0x1e')](_0x5421a7)[_0x4c0f('0x2e')](_0x246498);};}exports['index']=function(_0xbcd7f4,_0x31aaa6){var _0x27ba28={},_0x5770a2={},_0x454628={'count':0x0,'rows':[]};var _0x35212a=_[_0x4c0f('0x2f')](db[_0x4c0f('0x30')][_0x4c0f('0x31')],function(_0xe06ca5){return{'name':_0xe06ca5['fieldName'],'type':_0xe06ca5[_0x4c0f('0x32')][_0x4c0f('0x33')]};});_0x5770a2['model']=_['map'](_0x35212a,'name');_0x5770a2[_0x4c0f('0x34')]=_['keys'](_0xbcd7f4['query']);_0x5770a2[_0x4c0f('0x35')]=_['intersection'](_0x5770a2[_0x4c0f('0x36')],_0x5770a2[_0x4c0f('0x34')]);_0x27ba28[_0x4c0f('0x37')]=_['intersection'](_0x5770a2[_0x4c0f('0x36')],qs[_0x4c0f('0x38')](_0xbcd7f4[_0x4c0f('0x34')][_0x4c0f('0x38')]));_0x27ba28[_0x4c0f('0x37')]=_0x27ba28[_0x4c0f('0x37')][_0x4c0f('0x39')]?_0x27ba28[_0x4c0f('0x37')]:_0x5770a2[_0x4c0f('0x36')];if(!_0xbcd7f4[_0x4c0f('0x34')][_0x4c0f('0x3a')](_0x4c0f('0x3b'))){_0x27ba28[_0x4c0f('0x21')]=qs['limit'](_0xbcd7f4[_0x4c0f('0x34')]['limit']);_0x27ba28[_0x4c0f('0x23')]=qs[_0x4c0f('0x23')](_0xbcd7f4['query'][_0x4c0f('0x23')]);}_0x27ba28[_0x4c0f('0x3c')]=qs[_0x4c0f('0x3d')](_0xbcd7f4[_0x4c0f('0x34')][_0x4c0f('0x3d')]);_0x27ba28['where']=qs[_0x4c0f('0x35')](_['pick'](_0xbcd7f4['query'],_0x5770a2[_0x4c0f('0x35')]),_0x35212a);if(_0xbcd7f4['query'][_0x4c0f('0x3e')]){_0x27ba28[_0x4c0f('0x3f')]=_[_0x4c0f('0x40')](_0x27ba28[_0x4c0f('0x3f')],{'$or':_[_0x4c0f('0x2f')](_0x35212a,function(_0x5b64af){if(_0x5b64af[_0x4c0f('0x32')]!==_0x4c0f('0x41')){var _0x43be16={};_0x43be16[_0x5b64af['name']]={'$like':'%'+_0xbcd7f4[_0x4c0f('0x34')][_0x4c0f('0x3e')]+'%'};return _0x43be16;}})});}_0x27ba28=_[_0x4c0f('0x40')]({},_0x27ba28,_0xbcd7f4['options']);var _0x4891d1={'where':_0x27ba28[_0x4c0f('0x3f')]};return db['ZohoAccount'][_0x4c0f('0x22')](_0x4891d1)[_0x4c0f('0x2a')](function(_0x559830){_0x454628['count']=_0x559830;if(_0xbcd7f4[_0x4c0f('0x34')][_0x4c0f('0x42')]){_0x27ba28[_0x4c0f('0x43')]=[{'all':!![]}];}return db[_0x4c0f('0x30')][_0x4c0f('0x44')](_0x27ba28);})[_0x4c0f('0x2a')](function(_0x4c47b1){_0x454628[_0x4c0f('0x45')]=_0x4c47b1;return _0x454628;})[_0x4c0f('0x2a')](respondWithFilteredResult(_0x31aaa6,_0x27ba28))['catch'](handleError(_0x31aaa6,null));};exports[_0x4c0f('0x46')]=function(_0x127cff,_0x53af6d){var _0x4815a8={'raw':![],'where':{'id':_0x127cff['params']['id']}},_0x215c83={};_0x215c83[_0x4c0f('0x36')]=_['keys'](db[_0x4c0f('0x30')]['rawAttributes']);_0x215c83['query']=_[_0x4c0f('0x47')](_0x127cff[_0x4c0f('0x34')]);_0x215c83[_0x4c0f('0x35')]=_[_0x4c0f('0x48')](_0x215c83['model'],_0x215c83[_0x4c0f('0x34')]);_0x4815a8['attributes']=_['intersection'](_0x215c83[_0x4c0f('0x36')],qs['fields'](_0x127cff[_0x4c0f('0x34')][_0x4c0f('0x38')]));_0x4815a8[_0x4c0f('0x37')]=_0x4815a8[_0x4c0f('0x37')][_0x4c0f('0x39')]?_0x4815a8[_0x4c0f('0x37')]:_0x215c83[_0x4c0f('0x36')];if(_0x127cff[_0x4c0f('0x34')][_0x4c0f('0x42')]){_0x4815a8[_0x4c0f('0x43')]=[{'all':!![]}];}_0x4815a8=_['merge']({},_0x4815a8,_0x127cff[_0x4c0f('0x49')]);return db[_0x4c0f('0x30')][_0x4c0f('0x4a')](_0x4815a8)['then'](handleEntityNotFound(_0x53af6d,null))[_0x4c0f('0x2a')](respondWithResult(_0x53af6d,null))[_0x4c0f('0x4b')](handleError(_0x53af6d,null));};exports[_0x4c0f('0x4c')]=function(_0x98ac88,_0x549be9){return db[_0x4c0f('0x30')]['create'](_0x98ac88[_0x4c0f('0x4d')],{})[_0x4c0f('0x2a')](respondWithResult(_0x549be9,0xc9))[_0x4c0f('0x4b')](handleError(_0x549be9,null));};exports[_0x4c0f('0x29')]=function(_0x3974c1,_0x5bf262){if(_0x3974c1[_0x4c0f('0x4d')]['id']){delete _0x3974c1['body']['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x3974c1[_0x4c0f('0x4e')]['id']}})[_0x4c0f('0x2a')](handleEntityNotFound(_0x5bf262,null))[_0x4c0f('0x2a')](saveUpdates(_0x3974c1[_0x4c0f('0x4d')],null))[_0x4c0f('0x2a')](respondWithResult(_0x5bf262,null))[_0x4c0f('0x4b')](handleError(_0x5bf262,null));};exports[_0x4c0f('0x4f')]=function(_0x32c9cf,_0x489028){return db[_0x4c0f('0x30')][_0x4c0f('0x4a')]({'where':{'id':_0x32c9cf['params']['id']}})[_0x4c0f('0x2a')](handleEntityNotFound(_0x489028,null))[_0x4c0f('0x2a')](removeEntity(_0x489028,null))[_0x4c0f('0x4b')](handleError(_0x489028,null));};exports[_0x4c0f('0x50')]=function(_0x47a05d,_0x471cfe,_0x2f860c){var _0x152b4d={};var _0xc003d6={};var _0x27a012;var _0x315aa6;return db[_0x4c0f('0x30')][_0x4c0f('0x51')]({'where':{'id':_0x47a05d[_0x4c0f('0x4e')]['id']}})[_0x4c0f('0x2a')](handleEntityNotFound(_0x471cfe,null))[_0x4c0f('0x2a')](function(_0x9c0522){if(_0x9c0522){_0x27a012=_0x9c0522;_0xc003d6[_0x4c0f('0x36')]=_['keys'](db[_0x4c0f('0x52')][_0x4c0f('0x31')]);_0xc003d6[_0x4c0f('0x34')]=_['keys'](_0x47a05d[_0x4c0f('0x34')]);_0xc003d6['filters']=_['intersection'](_0xc003d6[_0x4c0f('0x36')],_0xc003d6[_0x4c0f('0x34')]);_0x152b4d['attributes']=_[_0x4c0f('0x48')](_0xc003d6[_0x4c0f('0x36')],qs[_0x4c0f('0x38')](_0x47a05d['query'][_0x4c0f('0x38')]));_0x152b4d[_0x4c0f('0x37')]=_0x152b4d[_0x4c0f('0x37')]['length']?_0x152b4d['attributes']:_0xc003d6[_0x4c0f('0x36')];_0x152b4d[_0x4c0f('0x3c')]=qs['sort'](_0x47a05d[_0x4c0f('0x34')]['sort']);_0x152b4d['where']=qs[_0x4c0f('0x35')](_[_0x4c0f('0x53')](_0x47a05d[_0x4c0f('0x34')],_0xc003d6[_0x4c0f('0x35')]));if(_0x47a05d[_0x4c0f('0x34')][_0x4c0f('0x3e')]){_0x152b4d[_0x4c0f('0x3f')]=_[_0x4c0f('0x40')](_0x152b4d['where'],{'$or':_[_0x4c0f('0x2f')](_0x152b4d[_0x4c0f('0x37')],function(_0x4120a2){var _0x2a8474={};_0x2a8474[_0x4120a2]={'$like':'%'+_0x47a05d[_0x4c0f('0x34')]['filter']+'%'};return _0x2a8474;})});}_0x152b4d=_[_0x4c0f('0x40')]({},_0x152b4d,_0x47a05d['options']);return _0x27a012[_0x4c0f('0x50')](_0x152b4d);}})[_0x4c0f('0x2a')](function(_0x2614a3){if(_0x2614a3){_0x315aa6=_0x2614a3[_0x4c0f('0x39')];if(!_0x47a05d[_0x4c0f('0x34')]['hasOwnProperty']('nolimit')){_0x152b4d['limit']=qs[_0x4c0f('0x21')](_0x47a05d[_0x4c0f('0x34')][_0x4c0f('0x21')]);_0x152b4d['offset']=qs[_0x4c0f('0x23')](_0x47a05d[_0x4c0f('0x34')]['offset']);}return _0x27a012[_0x4c0f('0x50')](_0x152b4d);}})['then'](function(_0x37e59f){if(_0x37e59f){return _0x37e59f?{'count':_0x315aa6,'rows':_0x37e59f}:null;}})[_0x4c0f('0x2a')](respondWithResult(_0x471cfe,null))[_0x4c0f('0x4b')](handleError(_0x471cfe,null));};exports['addConfiguration']=function(_0x509eaf,_0x49c785,_0xf4fc33){if(_0x509eaf[_0x4c0f('0x4d')]['id']){delete _0x509eaf[_0x4c0f('0x4d')]['id'];}return db[_0x4c0f('0x30')][_0x4c0f('0x51')]({'where':{'id':_0x509eaf[_0x4c0f('0x4e')]['id']}})[_0x4c0f('0x2a')](handleEntityNotFound(_0x49c785,null))[_0x4c0f('0x2a')](function(_0x32bd8a){if(_0x32bd8a){_0x509eaf['body'][_0x4c0f('0x54')]=_0x32bd8a['id'];_0x509eaf[_0x4c0f('0x4d')][_0x4c0f('0x55')]=integrations[_0x4c0f('0x56')](_0x509eaf[_0x4c0f('0x4d')][_0x4c0f('0x57')],_0x509eaf[_0x4c0f('0x4d')][_0x4c0f('0x32')]);_0x509eaf[_0x4c0f('0x4d')][_0x4c0f('0x58')]=integrations[_0x4c0f('0x59')](_0x509eaf[_0x4c0f('0x4d')][_0x4c0f('0x57')],_0x509eaf[_0x4c0f('0x4d')]['type']);return db[_0x4c0f('0x52')]['create'](_0x509eaf['body'],{'include':[{'model':db['ZohoField'],'as':_0x4c0f('0x55')},{'model':db[_0x4c0f('0x5a')],'as':'Descriptions'}]});}return null;})[_0x4c0f('0x2a')](respondWithResult(_0x49c785,null))[_0x4c0f('0x4b')](handleError(_0x49c785,null));};function getAccessToken(_0x1734a7){return new Promise(function(_0x3e8a5c,_0x5db8b8){var _0x27c563;switch(_0x1734a7[_0x4c0f('0x5b')]){case'US':_0x27c563=_0x4c0f('0x5c');break;case'AU':_0x27c563=_0x4c0f('0x5d');break;case'EU':_0x27c563=_0x4c0f('0x5e');break;case'IN':_0x27c563=_0x4c0f('0x5f');break;case'CN':_0x27c563='https://accounts.zoho.com.cn';break;default:_0x27c563=_0x4c0f('0x5e');break;}var _0x587d9a={'method':_0x4c0f('0x60'),'uri':_0x27c563+_0x4c0f('0x61'),'qs':{'refresh_token':_0x1734a7[_0x4c0f('0x62')],'client_id':_0x1734a7['clientId'],'client_secret':_0x1734a7['clientSecret'],'grant_type':_0x4c0f('0x63')},'json':!![]};return rp(_0x587d9a)[_0x4c0f('0x2a')](function(_0x10b5d0){if(_0x10b5d0[_0x4c0f('0x64')]){_0x3e8a5c(_0x10b5d0[_0x4c0f('0x64')]);}else{_0x5db8b8(_0x4c0f('0x65'));}})['catch'](function(_0x2c8e88){_0x5db8b8(_0x2c8e88);});});}exports[_0x4c0f('0x66')]=function(_0x3d1fa2,_0x2c1104,_0x347fe1){var _0x43a087,_0x507c71,_0x57b21d,_0x3443c3,_0x497e8e;return db[_0x4c0f('0x30')][_0x4c0f('0x51')]({'where':{'id':_0x3d1fa2[_0x4c0f('0x4e')]['id']},'attributes':['id',_0x4c0f('0x67'),_0x4c0f('0x5b'),_0x4c0f('0x68'),_0x4c0f('0x69'),_0x4c0f('0x6a'),_0x4c0f('0x6b'),_0x4c0f('0x62')]})[_0x4c0f('0x2a')](handleEntityNotFound(_0x2c1104,null))[_0x4c0f('0x2a')](function(_0x5b995e){_0x497e8e=_0x5b995e;_0x43a087=_0x497e8e[_0x4c0f('0x67')];_0x507c71=_0x43a087===_0x4c0f('0x6c')?'eu':_0x4c0f('0x6d');_0x57b21d=_0x497e8e[_0x4c0f('0x6a')];var _0x9a2b6d=_0x57b21d[_0x4c0f('0x6e')](-0x1);if(_0x9a2b6d==='/'||_0x9a2b6d==='\x5c'||_0x9a2b6d===':'){_0x57b21d=_0x57b21d[_0x4c0f('0x6f')](0x0,_0x57b21d[_0x4c0f('0x70')](_0x9a2b6d));}if(!_0x497e8e[_0x4c0f('0x62')]){throw new Error(_0x4c0f('0x71'));}return getAccessToken(_0x497e8e);})[_0x4c0f('0x2a')](function(_0x1a5f33){if(_0x1a5f33){return rp({'method':_0x4c0f('0x72'),'uri':util['format'](_0x4c0f('0x73'),_0x507c71),'qs':{'module':_0x4c0f('0x74')},'headers':{'Authorization':_0x4c0f('0x75')+_0x1a5f33},'json':!![]});}})[_0x4c0f('0x2a')](function(_0x432bc1){if(_0x432bc1){if(_0x432bc1['response']&&_0x432bc1[_0x4c0f('0x76')][_0x4c0f('0x2b')]){throw new Error(_0x432bc1[_0x4c0f('0x76')]['error'][_0x4c0f('0x77')]);}var _0x3f6f51=[];var _0x4c9b4e=[];var _0x4dbe1f=[_0x4c0f('0x78'),_0x4c0f('0x79'),_0x4c0f('0x7a'),_0x4c0f('0x7b'),'Call_Duration',_0x4c0f('0x7c'),'Call_Start_Time',_0x4c0f('0x7d')];_0x4c9b4e=_[_0x4c0f('0x7e')](_0x432bc1[_0x4c0f('0x38')],function(_0x1feedb){return _0x4dbe1f[_0x4c0f('0x7f')](_0x1feedb[_0x4c0f('0x80')]);});for(var _0x2743d2=0x0;_0x2743d2<_0x4c9b4e[_0x4c0f('0x39')];_0x2743d2++){if(_0x4c9b4e[_0x2743d2][_0x4c0f('0x81')]===![]){_0x3f6f51[_0x4c0f('0x82')]({'id':_0x4c9b4e[_0x2743d2]['id'],'name':_0x4c9b4e[_0x2743d2][_0x4c0f('0x83')],'custom':_0x4c9b4e[_0x2743d2][_0x4c0f('0x84')],'options':_0x4c9b4e[_0x2743d2][_0x4c0f('0x85')]===_0x4c0f('0x86')&&_0x4c9b4e[_0x2743d2][_0x4c0f('0x87')][_0x4c0f('0x39')]>-0x1?_['map'](_0x4c9b4e[_0x2743d2][_0x4c0f('0x87')],function(_0x4927fa){return{'name':_0x4927fa,'value':_0x4927fa};}):[]});}}return{'count':_0x3f6f51[_0x4c0f('0x39')],'rows':_0x3f6f51};}else{return{'count':0x0,'rows':[]};}})[_0x4c0f('0x2a')](respondWithResult(_0x2c1104,null))[_0x4c0f('0x4b')](function(_0x19df8e){var _0x4a194a=_0x3d1fa2[_0x4c0f('0x34')][_0x4c0f('0x88')]?0x1f4:_0x19df8e[_0x4c0f('0x89')]||0x1f4;logger[_0x4c0f('0x2b')](_0x4c0f('0x8a'),_0x4c0f('0x66'),_0x4a194a,JSON[_0x4c0f('0x8b')](_0x19df8e));delete _0x19df8e[_0x4c0f('0x2d')];if(_0x4a194a===0x191){_0x4a194a=0x190;}_0x2c1104[_0x4c0f('0x1e')](_0x4a194a)[_0x4c0f('0x2e')](_0x3d1fa2['query'][_0x4c0f('0x88')]?{'message':_0x4c0f('0x8c'),'statusCode':_0x19df8e[_0x4c0f('0x89')]}:_0x19df8e);});}; \ No newline at end of file +var _0x640d=['offset','undefined','count','limit','status','set','Content-Range','save','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','ZohoAccount','findAll','rows','catch','show','find','create','body','params','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','findOne','host','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','WhoId','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json'];(function(_0x20216f,_0xc9fdd4){var _0x23e7f4=function(_0x1d3c17){while(--_0x1d3c17){_0x20216f['push'](_0x20216f['shift']());}};_0x23e7f4(++_0xc9fdd4);}(_0x640d,0x166));var _0xd640=function(_0x514af5,_0x3ebcba){_0x514af5=_0x514af5-0x0;var _0x1f049a=_0x640d[_0x514af5];return _0x1f049a;};'use strict';var emlformat=require(_0xd640('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd640('0x1'));var jsonpatch=require(_0xd640('0x2'));var rp=require(_0xd640('0x3'));var moment=require(_0xd640('0x4'));var BPromise=require(_0xd640('0x5'));var Mustache=require(_0xd640('0x6'));var util=require(_0xd640('0x7'));var path=require(_0xd640('0x8'));var sox=require('sox');var csv=require(_0xd640('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd640('0xa'));var squel=require('squel');var crypto=require(_0xd640('0xb'));var jsforce=require(_0xd640('0xc'));var deskjs=require(_0xd640('0xd'));var toCsv=require(_0xd640('0x9'));var querystring=require(_0xd640('0xe'));var Papa=require('papaparse');var Redis=require(_0xd640('0xf'));var authService=require(_0xd640('0x10'));var qs=require(_0xd640('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd640('0x12'));var logger=require('../../config/logger')(_0xd640('0x13'));var utils=require('../../config/utils');var config=require(_0xd640('0x14'));var licenseUtil=require(_0xd640('0x15'));var db=require(_0xd640('0x16'))['db'];var integrations=require(_0xd640('0x17'));function respondWithStatusCode(_0x1d6508,_0x44eec8){_0x44eec8=_0x44eec8||0xcc;return function(_0x20329b){if(_0x20329b){return _0x1d6508['sendStatus'](_0x44eec8);}return _0x1d6508['status'](_0x44eec8)[_0xd640('0x18')]();};}function respondWithResult(_0x1c4eeb,_0x43534c){_0x43534c=_0x43534c||0xc8;return function(_0x52acc1){if(_0x52acc1){return _0x1c4eeb['status'](_0x43534c)[_0xd640('0x19')](_0x52acc1);}};}function respondWithFilteredResult(_0xfbdfaa,_0x1d70fe){return function(_0x3baaa3){if(_0x3baaa3){var _0x2d4b8c=typeof _0x1d70fe[_0xd640('0x1a')]==='undefined'&&typeof _0x1d70fe['limit']===_0xd640('0x1b');var _0x1469fa=_0x3baaa3[_0xd640('0x1c')];var _0x59b01e=_0x2d4b8c?0x0:_0x1d70fe[_0xd640('0x1a')];var _0x2194e3=_0x2d4b8c?_0x3baaa3['count']:_0x1d70fe['offset']+_0x1d70fe[_0xd640('0x1d')];var _0x3694cb;if(_0x2194e3>=_0x1469fa){_0x2194e3=_0x1469fa;_0x3694cb=0xc8;}else{_0x3694cb=0xce;}_0xfbdfaa[_0xd640('0x1e')](_0x3694cb);return _0xfbdfaa[_0xd640('0x1f')](_0xd640('0x20'),_0x59b01e+'-'+_0x2194e3+'/'+_0x1469fa)[_0xd640('0x19')](_0x3baaa3);}return null;};}function patchUpdates(_0x2bca20){return function(_0x51c835){try{jsonpatch['apply'](_0x51c835,_0x2bca20,!![]);}catch(_0x45d169){return BPromise['reject'](_0x45d169);}return _0x51c835[_0xd640('0x21')]();};}function saveUpdates(_0x296e57,_0x35f034){return function(_0x3a2b83){if(_0x3a2b83){return _0x3a2b83[_0xd640('0x22')](_0x296e57)[_0xd640('0x23')](function(_0x4e9de6){return _0x4e9de6;});}return null;};}function removeEntity(_0x33991c,_0x28355c){return function(_0x218309){if(_0x218309){return _0x218309[_0xd640('0x24')]()[_0xd640('0x23')](function(){_0x33991c['status'](0xcc)[_0xd640('0x18')]();});}};}function handleEntityNotFound(_0x1beaa9,_0x89124c){return function(_0x2a4b0e){if(!_0x2a4b0e){_0x1beaa9[_0xd640('0x25')](0x194);}return _0x2a4b0e;};}function handleError(_0x37eb77,_0x195f58){_0x195f58=_0x195f58||0x1f4;return function(_0x38ab17){logger['error'](_0x38ab17[_0xd640('0x26')]);if(_0x38ab17[_0xd640('0x27')]){delete _0x38ab17[_0xd640('0x27')];}_0x37eb77[_0xd640('0x1e')](_0x195f58)['send'](_0x38ab17);};}exports[_0xd640('0x28')]=function(_0x1c8726,_0xfa1bf2){var _0x5c4a1b={},_0x29c55f={},_0x3c0041={'count':0x0,'rows':[]};var _0x37fd71=_[_0xd640('0x29')](db['ZohoAccount'][_0xd640('0x2a')],function(_0x253b5a){return{'name':_0x253b5a[_0xd640('0x2b')],'type':_0x253b5a['type'][_0xd640('0x2c')]};});_0x29c55f['model']=_[_0xd640('0x29')](_0x37fd71,_0xd640('0x27'));_0x29c55f[_0xd640('0x2d')]=_[_0xd640('0x2e')](_0x1c8726[_0xd640('0x2d')]);_0x29c55f['filters']=_[_0xd640('0x2f')](_0x29c55f[_0xd640('0x30')],_0x29c55f['query']);_0x5c4a1b[_0xd640('0x31')]=_[_0xd640('0x2f')](_0x29c55f['model'],qs[_0xd640('0x32')](_0x1c8726[_0xd640('0x2d')][_0xd640('0x32')]));_0x5c4a1b[_0xd640('0x31')]=_0x5c4a1b['attributes'][_0xd640('0x33')]?_0x5c4a1b['attributes']:_0x29c55f['model'];if(!_0x1c8726[_0xd640('0x2d')][_0xd640('0x34')](_0xd640('0x35'))){_0x5c4a1b[_0xd640('0x1d')]=qs['limit'](_0x1c8726[_0xd640('0x2d')]['limit']);_0x5c4a1b[_0xd640('0x1a')]=qs[_0xd640('0x1a')](_0x1c8726['query'][_0xd640('0x1a')]);}_0x5c4a1b[_0xd640('0x36')]=qs[_0xd640('0x37')](_0x1c8726[_0xd640('0x2d')][_0xd640('0x37')]);_0x5c4a1b[_0xd640('0x38')]=qs[_0xd640('0x39')](_[_0xd640('0x3a')](_0x1c8726[_0xd640('0x2d')],_0x29c55f['filters']),_0x37fd71);if(_0x1c8726[_0xd640('0x2d')][_0xd640('0x3b')]){_0x5c4a1b['where']=_[_0xd640('0x3c')](_0x5c4a1b[_0xd640('0x38')],{'$or':_[_0xd640('0x29')](_0x37fd71,function(_0x334cbb){if(_0x334cbb[_0xd640('0x3d')]!==_0xd640('0x3e')){var _0x10ea4c={};_0x10ea4c[_0x334cbb[_0xd640('0x27')]]={'$like':'%'+_0x1c8726['query'][_0xd640('0x3b')]+'%'};return _0x10ea4c;}})});}_0x5c4a1b=_[_0xd640('0x3c')]({},_0x5c4a1b,_0x1c8726[_0xd640('0x3f')]);var _0x563151={'where':_0x5c4a1b['where']};return db['ZohoAccount']['count'](_0x563151)[_0xd640('0x23')](function(_0x518404){_0x3c0041[_0xd640('0x1c')]=_0x518404;if(_0x1c8726[_0xd640('0x2d')][_0xd640('0x40')]){_0x5c4a1b[_0xd640('0x41')]=[{'all':!![]}];}return db[_0xd640('0x42')][_0xd640('0x43')](_0x5c4a1b);})['then'](function(_0x477524){_0x3c0041[_0xd640('0x44')]=_0x477524;return _0x3c0041;})[_0xd640('0x23')](respondWithFilteredResult(_0xfa1bf2,_0x5c4a1b))[_0xd640('0x45')](handleError(_0xfa1bf2,null));};exports[_0xd640('0x46')]=function(_0x2e26c5,_0x39d760){var _0xc40a83={'raw':![],'where':{'id':_0x2e26c5['params']['id']}},_0x405580={};_0x405580['model']=_[_0xd640('0x2e')](db[_0xd640('0x42')][_0xd640('0x2a')]);_0x405580[_0xd640('0x2d')]=_['keys'](_0x2e26c5[_0xd640('0x2d')]);_0x405580['filters']=_[_0xd640('0x2f')](_0x405580['model'],_0x405580['query']);_0xc40a83['attributes']=_[_0xd640('0x2f')](_0x405580[_0xd640('0x30')],qs['fields'](_0x2e26c5[_0xd640('0x2d')]['fields']));_0xc40a83['attributes']=_0xc40a83[_0xd640('0x31')][_0xd640('0x33')]?_0xc40a83['attributes']:_0x405580[_0xd640('0x30')];if(_0x2e26c5[_0xd640('0x2d')][_0xd640('0x40')]){_0xc40a83['include']=[{'all':!![]}];}_0xc40a83=_[_0xd640('0x3c')]({},_0xc40a83,_0x2e26c5[_0xd640('0x3f')]);return db[_0xd640('0x42')][_0xd640('0x47')](_0xc40a83)[_0xd640('0x23')](handleEntityNotFound(_0x39d760,null))['then'](respondWithResult(_0x39d760,null))['catch'](handleError(_0x39d760,null));};exports[_0xd640('0x48')]=function(_0x2c139a,_0x253b00){return db[_0xd640('0x42')][_0xd640('0x48')](_0x2c139a[_0xd640('0x49')],{})['then'](respondWithResult(_0x253b00,0xc9))[_0xd640('0x45')](handleError(_0x253b00,null));};exports[_0xd640('0x22')]=function(_0x3e8c8a,_0x366a0f){if(_0x3e8c8a[_0xd640('0x49')]['id']){delete _0x3e8c8a[_0xd640('0x49')]['id'];}return db[_0xd640('0x42')][_0xd640('0x47')]({'where':{'id':_0x3e8c8a[_0xd640('0x4a')]['id']}})['then'](handleEntityNotFound(_0x366a0f,null))[_0xd640('0x23')](saveUpdates(_0x3e8c8a[_0xd640('0x49')],null))['then'](respondWithResult(_0x366a0f,null))['catch'](handleError(_0x366a0f,null));};exports[_0xd640('0x24')]=function(_0x4432fe,_0x2921ac){return db[_0xd640('0x42')][_0xd640('0x47')]({'where':{'id':_0x4432fe[_0xd640('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2921ac,null))[_0xd640('0x23')](removeEntity(_0x2921ac,null))[_0xd640('0x45')](handleError(_0x2921ac,null));};exports[_0xd640('0x4b')]=function(_0x5c76be,_0x5a8537,_0x43c705){var _0x3d9f2e={};var _0x5c76fb={};var _0x2b877d;var _0x497ff1;return db['ZohoAccount']['findOne']({'where':{'id':_0x5c76be[_0xd640('0x4a')]['id']}})[_0xd640('0x23')](handleEntityNotFound(_0x5a8537,null))[_0xd640('0x23')](function(_0x1cd638){if(_0x1cd638){_0x2b877d=_0x1cd638;_0x5c76fb['model']=_['keys'](db['ZohoConfiguration'][_0xd640('0x2a')]);_0x5c76fb['query']=_[_0xd640('0x2e')](_0x5c76be[_0xd640('0x2d')]);_0x5c76fb[_0xd640('0x39')]=_[_0xd640('0x2f')](_0x5c76fb[_0xd640('0x30')],_0x5c76fb[_0xd640('0x2d')]);_0x3d9f2e[_0xd640('0x31')]=_[_0xd640('0x2f')](_0x5c76fb[_0xd640('0x30')],qs[_0xd640('0x32')](_0x5c76be['query'][_0xd640('0x32')]));_0x3d9f2e['attributes']=_0x3d9f2e[_0xd640('0x31')]['length']?_0x3d9f2e[_0xd640('0x31')]:_0x5c76fb[_0xd640('0x30')];_0x3d9f2e[_0xd640('0x36')]=qs[_0xd640('0x37')](_0x5c76be[_0xd640('0x2d')][_0xd640('0x37')]);_0x3d9f2e[_0xd640('0x38')]=qs[_0xd640('0x39')](_[_0xd640('0x3a')](_0x5c76be[_0xd640('0x2d')],_0x5c76fb[_0xd640('0x39')]));if(_0x5c76be[_0xd640('0x2d')][_0xd640('0x3b')]){_0x3d9f2e['where']=_[_0xd640('0x3c')](_0x3d9f2e[_0xd640('0x38')],{'$or':_[_0xd640('0x29')](_0x3d9f2e[_0xd640('0x31')],function(_0x2bac2c){var _0x4ce958={};_0x4ce958[_0x2bac2c]={'$like':'%'+_0x5c76be[_0xd640('0x2d')][_0xd640('0x3b')]+'%'};return _0x4ce958;})});}_0x3d9f2e=_[_0xd640('0x3c')]({},_0x3d9f2e,_0x5c76be['options']);return _0x2b877d[_0xd640('0x4b')](_0x3d9f2e);}})[_0xd640('0x23')](function(_0x3a2669){if(_0x3a2669){_0x497ff1=_0x3a2669['length'];if(!_0x5c76be[_0xd640('0x2d')][_0xd640('0x34')](_0xd640('0x35'))){_0x3d9f2e['limit']=qs[_0xd640('0x1d')](_0x5c76be['query']['limit']);_0x3d9f2e['offset']=qs[_0xd640('0x1a')](_0x5c76be[_0xd640('0x2d')][_0xd640('0x1a')]);}return _0x2b877d[_0xd640('0x4b')](_0x3d9f2e);}})[_0xd640('0x23')](function(_0x56970d){if(_0x56970d){return _0x56970d?{'count':_0x497ff1,'rows':_0x56970d}:null;}})[_0xd640('0x23')](respondWithResult(_0x5a8537,null))[_0xd640('0x45')](handleError(_0x5a8537,null));};exports['addConfiguration']=function(_0x370dd9,_0x7dd60a,_0xa1fdcb){if(_0x370dd9[_0xd640('0x49')]['id']){delete _0x370dd9[_0xd640('0x49')]['id'];}return db[_0xd640('0x42')]['findOne']({'where':{'id':_0x370dd9[_0xd640('0x4a')]['id']}})[_0xd640('0x23')](handleEntityNotFound(_0x7dd60a,null))[_0xd640('0x23')](function(_0x21ad98){if(_0x21ad98){_0x370dd9[_0xd640('0x49')][_0xd640('0x4c')]=_0x21ad98['id'];_0x370dd9[_0xd640('0x49')][_0xd640('0x4d')]=integrations[_0xd640('0x4e')](_0x370dd9['body']['channel'],_0x370dd9[_0xd640('0x49')][_0xd640('0x3d')]);_0x370dd9['body'][_0xd640('0x4f')]=integrations[_0xd640('0x50')](_0x370dd9['body'][_0xd640('0x51')],_0x370dd9[_0xd640('0x49')][_0xd640('0x3d')]);return db[_0xd640('0x52')][_0xd640('0x48')](_0x370dd9[_0xd640('0x49')],{'include':[{'model':db['ZohoField'],'as':_0xd640('0x4d')},{'model':db[_0xd640('0x53')],'as':_0xd640('0x4f')}]});}return null;})[_0xd640('0x23')](respondWithResult(_0x7dd60a,null))[_0xd640('0x45')](handleError(_0x7dd60a,null));};function getAccessToken(_0x38f360){return new Promise(function(_0x2e6edb,_0x1d6007){var _0x12f969;switch(_0x38f360[_0xd640('0x54')]){case'US':_0x12f969='https://accounts.zoho.com';break;case'AU':_0x12f969='https://accounts.zoho.com.au';break;case'EU':_0x12f969=_0xd640('0x55');break;case'IN':_0x12f969=_0xd640('0x56');break;case'CN':_0x12f969='https://accounts.zoho.com.cn';break;default:_0x12f969=_0xd640('0x55');break;}var _0x679700={'method':_0xd640('0x57'),'uri':_0x12f969+'/oauth/v2/token','qs':{'refresh_token':_0x38f360[_0xd640('0x58')],'client_id':_0x38f360[_0xd640('0x59')],'client_secret':_0x38f360[_0xd640('0x5a')],'grant_type':_0xd640('0x5b')},'json':!![]};return rp(_0x679700)[_0xd640('0x23')](function(_0x835142){if(_0x835142[_0xd640('0x5c')]){_0x2e6edb(_0x835142[_0xd640('0x5c')]);}else{_0x1d6007(_0xd640('0x5d'));}})[_0xd640('0x45')](function(_0x28516c){_0x1d6007(_0x28516c);});});}exports['getFields']=function(_0x1e3d45,_0x2fed2f,_0x49d191){var _0x3ce8c6,_0x4450ab,_0x22657c,_0x22b139,_0x29f43d;return db[_0xd640('0x42')][_0xd640('0x5e')]({'where':{'id':_0x1e3d45['params']['id']},'attributes':['id',_0xd640('0x5f'),_0xd640('0x54'),'clientId','clientSecret',_0xd640('0x60'),_0xd640('0x61'),_0xd640('0x58')]})[_0xd640('0x23')](handleEntityNotFound(_0x2fed2f,null))[_0xd640('0x23')](function(_0x529bf6){_0x29f43d=_0x529bf6;_0x3ce8c6=_0x29f43d[_0xd640('0x5f')];_0x4450ab=_0x3ce8c6===_0xd640('0x62')?'eu':'com';_0x22657c=_0x29f43d['serverUrl'];var _0x52f46b=_0x22657c[_0xd640('0x63')](-0x1);if(_0x52f46b==='/'||_0x52f46b==='\x5c'||_0x52f46b===':'){_0x22657c=_0x22657c[_0xd640('0x64')](0x0,_0x22657c[_0xd640('0x65')](_0x52f46b));}if(!_0x29f43d[_0xd640('0x58')]){throw new Error(_0xd640('0x66'));}return getAccessToken(_0x29f43d);})[_0xd640('0x23')](function(_0x25830d){if(_0x25830d){return rp({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4450ab),'qs':{'module':_0xd640('0x67')},'headers':{'Authorization':_0xd640('0x68')+_0x25830d},'json':!![]});}})[_0xd640('0x23')](function(_0x2fc898){if(_0x2fc898){if(_0x2fc898[_0xd640('0x69')]&&_0x2fc898[_0xd640('0x69')][_0xd640('0x6a')]){throw new Error(_0x2fc898['response']['error'][_0xd640('0x6b')]);}var _0x2af029=[];var _0x59cf38=[];var _0x25e6a3=[_0xd640('0x6c'),_0xd640('0x6d'),'Description',_0xd640('0x6e'),'Call_Duration','Call_Result','Call_Start_Time',_0xd640('0x6f')];_0x59cf38=_[_0xd640('0x70')](_0x2fc898[_0xd640('0x32')],function(_0x414ed1){return _0x25e6a3[_0xd640('0x71')](_0x414ed1[_0xd640('0x72')]);});for(var _0x4086c1=0x0;_0x4086c1<_0x59cf38['length'];_0x4086c1++){if(_0x59cf38[_0x4086c1][_0xd640('0x73')]===![]){_0x2af029[_0xd640('0x74')]({'id':_0x59cf38[_0x4086c1]['id'],'name':_0x59cf38[_0x4086c1][_0xd640('0x75')],'custom':_0x59cf38[_0x4086c1]['custom_field'],'options':_0x59cf38[_0x4086c1][_0xd640('0x76')]===_0xd640('0x77')&&_0x59cf38[_0x4086c1]['pick_list_values'][_0xd640('0x33')]>-0x1?_[_0xd640('0x29')](_0x59cf38[_0x4086c1][_0xd640('0x78')],function(_0x1cb0c1){return{'name':_0x1cb0c1,'value':_0x1cb0c1};}):[]});}}return{'count':_0x2af029[_0xd640('0x33')],'rows':_0x2af029};}else{return{'count':0x0,'rows':[]};}})[_0xd640('0x23')](respondWithResult(_0x2fed2f,null))[_0xd640('0x45')](function(_0x169590){var _0x164eef=_0x1e3d45[_0xd640('0x2d')][_0xd640('0x79')]?0x1f4:_0x169590[_0xd640('0x7a')]||0x1f4;logger[_0xd640('0x6a')](_0xd640('0x7b'),_0xd640('0x7c'),_0x164eef,JSON[_0xd640('0x7d')](_0x169590));delete _0x169590[_0xd640('0x27')];if(_0x164eef===0x191){_0x164eef=0x190;}_0x2fed2f['status'](_0x164eef)[_0xd640('0x7e')](_0x1e3d45[_0xd640('0x2d')][_0xd640('0x79')]?{'message':_0xd640('0x7f'),'statusCode':_0x169590['statusCode']}:_0x169590);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 6d78ee0..27cc920 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 _0x75eb=['serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','zone','changed'];(function(_0x36a921,_0x51cf2a){var _0x25b0d2=function(_0x1041bd){while(--_0x1041bd){_0x36a921['push'](_0x36a921['shift']());}};_0x25b0d2(++_0x51cf2a);}(_0x75eb,0x151));var _0xb75e=function(_0x222171,_0x9d197e){_0x222171=_0x222171-0x0;var _0x3010a1=_0x75eb[_0x222171];return _0x3010a1;};'use strict';var _=require(_0xb75e('0x0'));var util=require(_0xb75e('0x1'));var logger=require(_0xb75e('0x2'))(_0xb75e('0x3'));var moment=require(_0xb75e('0x4'));var BPromise=require(_0xb75e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb75e('0x6'));var rimraf=require(_0xb75e('0x7'));var config=require(_0xb75e('0x8'));var attributes=require(_0xb75e('0x9'));var integrations=require(_0xb75e('0xa'));module[_0xb75e('0xb')]=function(_0x2097cd,_0x1a8baf){return _0x2097cd[_0xb75e('0xc')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x441361,_0x491a0d,_0x5dd85b){if(_0x441361['changed'](_0xb75e('0xd'))||_0x441361[_0xb75e('0xe')](_0xb75e('0xf'))||_0x441361['changed']('clientId')||_0x441361[_0xb75e('0xe')](_0xb75e('0x10'))||_0x441361[_0xb75e('0xe')](_0xb75e('0x11'))||_0x441361[_0xb75e('0xe')](_0xb75e('0x12'))){var _0x2afb26,_0x4c4b44;_0x2afb26=_0x441361[_0xb75e('0xf')];var _0x3d5a58=_0x2afb26[_0xb75e('0x13')](-0x1);if(_0x3d5a58==='/'||_0x3d5a58==='\x5c'||_0x3d5a58===':'){_0x2afb26=_0x2afb26[_0xb75e('0x14')](0x0,_0x2afb26[_0xb75e('0x15')](_0x3d5a58));}switch(_0x441361[_0xb75e('0xd')]){case'US':_0x4c4b44='https://accounts.zoho.com';break;case'AU':_0x4c4b44=_0xb75e('0x16');break;case'IN':_0x4c4b44=_0xb75e('0x17');break;case'CN':_0x4c4b44='https://accounts.zoho.com.cn';break;default:_0x4c4b44='https://accounts.zoho.eu';break;}var _0x2cc697={'method':_0xb75e('0x18'),'uri':_0x4c4b44+_0xb75e('0x19'),'form':{'grant_type':_0xb75e('0x1a'),'client_id':_0x441361[_0xb75e('0x1b')],'client_secret':_0x441361[_0xb75e('0x10')],'redirect_uri':_0x441361[_0xb75e('0xf')],'code':_0x441361[_0xb75e('0x11')]},'headers':{'Content-Type':_0xb75e('0x1c')}};return rp(_0x2cc697)[_0xb75e('0x1d')](function(_0x106f9f){var _0x5207f5=JSON[_0xb75e('0x1e')](_0x106f9f);if(_0x5207f5['refresh_token']){_0x441361['refreshToken']=_0x5207f5[_0xb75e('0x1f')];logger[_0xb75e('0x20')](util[_0xb75e('0x21')](_0xb75e('0x22'),_0x441361[_0xb75e('0x23')],_0x441361['id']));}else{logger[_0xb75e('0x24')](util['format'](_0xb75e('0x25'),_0x441361[_0xb75e('0x23')],_0x441361['id']),util[_0xb75e('0x26')](_0x5207f5,{'showHidden':![],'depth':null}));}return _0x5dd85b(null,_0x491a0d);})[_0xb75e('0x27')](function(_0x3379d7){logger[_0xb75e('0x24')](util[_0xb75e('0x21')](_0xb75e('0x25'),_0x441361['name'],_0x441361['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5dd85b(_0x3379d7);});}else{return _0x5dd85b(null,_0x491a0d);}},'beforeUpdate':function(_0x50463a,_0x333334,_0x33a8ee){if(_0x50463a[_0xb75e('0xe')](_0xb75e('0xd'))||_0x50463a[_0xb75e('0xe')]('serverUrl')||_0x50463a[_0xb75e('0xe')](_0xb75e('0x1b'))||_0x50463a['changed']('clientSecret')||_0x50463a['changed'](_0xb75e('0x11'))||_0x50463a[_0xb75e('0xe')](_0xb75e('0x12'))){var _0xd27e22,_0x4b316e;_0xd27e22=_0x50463a[_0xb75e('0xf')];var _0x3daf2c=_0xd27e22[_0xb75e('0x13')](-0x1);if(_0x3daf2c==='/'||_0x3daf2c==='\x5c'||_0x3daf2c===':'){_0xd27e22=_0xd27e22[_0xb75e('0x14')](0x0,_0xd27e22[_0xb75e('0x15')](_0x3daf2c));}switch(_0x50463a[_0xb75e('0xd')]){case'US':_0x4b316e=_0xb75e('0x28');break;case'AU':_0x4b316e='https://accounts.zoho.com.au';break;case'IN':_0x4b316e=_0xb75e('0x17');break;case'CN':_0x4b316e=_0xb75e('0x29');break;default:_0x4b316e=_0xb75e('0x2a');break;}var _0x44f4c9={'method':_0xb75e('0x18'),'uri':_0x4b316e+_0xb75e('0x19'),'form':{'grant_type':_0xb75e('0x1a'),'client_id':_0x50463a[_0xb75e('0x1b')],'client_secret':_0x50463a[_0xb75e('0x10')],'redirect_uri':_0x50463a[_0xb75e('0xf')],'code':_0x50463a[_0xb75e('0x11')]},'headers':{'Content-Type':_0xb75e('0x1c')}};return rp(_0x44f4c9)[_0xb75e('0x1d')](function(_0x28469d){var _0x46d429=JSON[_0xb75e('0x1e')](_0x28469d);if(_0x46d429[_0xb75e('0x1f')]){_0x50463a[_0xb75e('0x2b')]=_0x46d429['refresh_token'];logger[_0xb75e('0x20')](util[_0xb75e('0x21')](_0xb75e('0x22'),_0x50463a[_0xb75e('0x23')],_0x50463a['id']));}else{logger[_0xb75e('0x24')](util['format'](_0xb75e('0x25'),_0x50463a[_0xb75e('0x23')],_0x50463a['id']),util['inspect'](_0x46d429,{'showHidden':![],'depth':null}));}return _0x33a8ee(null,_0x333334);})[_0xb75e('0x27')](function(_0x18fd81){logger[_0xb75e('0x24')](util['format'](_0xb75e('0x25'),_0x50463a[_0xb75e('0x23')],_0x50463a['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x33a8ee(_0x18fd81);});}else{return _0x33a8ee(null,_0x333334);}}}});}; \ No newline at end of file +var _0x588b=['info','format','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.eu','authorization_code','refreshToken','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','define','ZohoAccount','zone','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x588b,0x122));var _0xb588=function(_0x352fdd,_0x3a4118){_0x352fdd=_0x352fdd-0x0;var _0x1a0bac=_0x588b[_0x352fdd];return _0x1a0bac;};'use strict';var _=require(_0xb588('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb588('0x1'));var moment=require(_0xb588('0x2'));var BPromise=require(_0xb588('0x3'));var rp=require(_0xb588('0x4'));var fs=require('fs');var path=require(_0xb588('0x5'));var rimraf=require(_0xb588('0x6'));var config=require(_0xb588('0x7'));var attributes=require(_0xb588('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5530bc,_0x191c56){return _0x5530bc[_0xb588('0x9')](_0xb588('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x55e6ac,_0x4eb8ff,_0x3b509c){if(_0x55e6ac['changed'](_0xb588('0xb'))||_0x55e6ac[_0xb588('0xc')](_0xb588('0xd'))||_0x55e6ac['changed'](_0xb588('0xe'))||_0x55e6ac[_0xb588('0xc')](_0xb588('0xf'))||_0x55e6ac[_0xb588('0xc')](_0xb588('0x10'))||_0x55e6ac[_0xb588('0xc')](_0xb588('0x11'))){var _0x2c3a19,_0x58ee33;_0x2c3a19=_0x55e6ac['serverUrl'];var _0x1de484=_0x2c3a19[_0xb588('0x12')](-0x1);if(_0x1de484==='/'||_0x1de484==='\x5c'||_0x1de484===':'){_0x2c3a19=_0x2c3a19[_0xb588('0x13')](0x0,_0x2c3a19['lastIndexOf'](_0x1de484));}switch(_0x55e6ac['zone']){case'US':_0x58ee33=_0xb588('0x14');break;case'AU':_0x58ee33=_0xb588('0x15');break;case'IN':_0x58ee33=_0xb588('0x16');break;case'CN':_0x58ee33=_0xb588('0x17');break;default:_0x58ee33='https://accounts.zoho.eu';break;}var _0x18d461={'method':_0xb588('0x18'),'uri':_0x58ee33+_0xb588('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x55e6ac[_0xb588('0xe')],'client_secret':_0x55e6ac['clientSecret'],'redirect_uri':_0x55e6ac['serverUrl'],'code':_0x55e6ac[_0xb588('0x10')]},'headers':{'Content-Type':_0xb588('0x1a')}};return rp(_0x18d461)[_0xb588('0x1b')](function(_0x44d25d){var _0x26e593=JSON[_0xb588('0x1c')](_0x44d25d);if(_0x26e593[_0xb588('0x1d')]){_0x55e6ac['refreshToken']=_0x26e593[_0xb588('0x1d')];logger[_0xb588('0x1e')](util[_0xb588('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x55e6ac[_0xb588('0x20')],_0x55e6ac['id']));}else{logger[_0xb588('0x21')](util[_0xb588('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x55e6ac[_0xb588('0x20')],_0x55e6ac['id']),util[_0xb588('0x22')](_0x26e593,{'showHidden':![],'depth':null}));}return _0x3b509c(null,_0x4eb8ff);})[_0xb588('0x23')](function(_0x280af5){logger[_0xb588('0x21')](util[_0xb588('0x1f')](_0xb588('0x24'),_0x55e6ac[_0xb588('0x20')],_0x55e6ac['id']),util[_0xb588('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x3b509c(_0x280af5);});}else{return _0x3b509c(null,_0x4eb8ff);}},'beforeUpdate':function(_0x487b85,_0x176fc5,_0x124fcd){if(_0x487b85[_0xb588('0xc')](_0xb588('0xb'))||_0x487b85[_0xb588('0xc')]('serverUrl')||_0x487b85['changed']('clientId')||_0x487b85[_0xb588('0xc')]('clientSecret')||_0x487b85[_0xb588('0xc')](_0xb588('0x10'))||_0x487b85[_0xb588('0xc')](_0xb588('0x11'))){var _0x206e5e,_0x4ba7c5;_0x206e5e=_0x487b85[_0xb588('0xd')];var _0x1a6e5a=_0x206e5e['slice'](-0x1);if(_0x1a6e5a==='/'||_0x1a6e5a==='\x5c'||_0x1a6e5a===':'){_0x206e5e=_0x206e5e[_0xb588('0x13')](0x0,_0x206e5e['lastIndexOf'](_0x1a6e5a));}switch(_0x487b85[_0xb588('0xb')]){case'US':_0x4ba7c5=_0xb588('0x14');break;case'AU':_0x4ba7c5=_0xb588('0x15');break;case'IN':_0x4ba7c5='https://accounts.zoho.in';break;case'CN':_0x4ba7c5='https://accounts.zoho.com.cn';break;default:_0x4ba7c5=_0xb588('0x25');break;}var _0x3f345d={'method':_0xb588('0x18'),'uri':_0x4ba7c5+_0xb588('0x19'),'form':{'grant_type':_0xb588('0x26'),'client_id':_0x487b85[_0xb588('0xe')],'client_secret':_0x487b85['clientSecret'],'redirect_uri':_0x487b85[_0xb588('0xd')],'code':_0x487b85['code']},'headers':{'Content-Type':_0xb588('0x1a')}};return rp(_0x3f345d)['then'](function(_0x157522){var _0xee6374=JSON[_0xb588('0x1c')](_0x157522);if(_0xee6374[_0xb588('0x1d')]){_0x487b85[_0xb588('0x27')]=_0xee6374[_0xb588('0x1d')];logger[_0xb588('0x1e')](util[_0xb588('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x487b85[_0xb588('0x20')],_0x487b85['id']));}else{logger['error'](util[_0xb588('0x1f')](_0xb588('0x24'),_0x487b85[_0xb588('0x20')],_0x487b85['id']),util[_0xb588('0x22')](_0xee6374,{'showHidden':![],'depth':null}));}return _0x124fcd(null,_0x176fc5);})[_0xb588('0x23')](function(_0x493df8){logger[_0xb588('0x21')](util[_0xb588('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x487b85['name'],_0x487b85['id']),util[_0xb588('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x124fcd(_0x493df8);});}else{return _0x124fcd(null,_0x176fc5);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 7f7d230..dca431c 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 _0x5f2f=['map','include','model','attributes','then','ShowZohoAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','limit'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49b167,_0x2dc3e0){_0x49b167=_0x49b167-0x0;var _0x48c139=_0x5f2f[_0x49b167];return _0x48c139;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetZohoAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetZohoAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowZohoAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowZohoAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowZohoAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _0x5f7b=['GetZohoAccount','stringify','catch','ShowZohoAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','ZohoAccount','findAll','options','raw','attributes','limit','map','include','model'];(function(_0x50f738,_0x1f0cef){var _0x4950fa=function(_0x2285ba){while(--_0x2285ba){_0x50f738['push'](_0x50f738['shift']());}};_0x4950fa(++_0x1f0cef);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5f7b[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var moment=require('moment');var BPromise=require(_0xb5f7('0x2'));var rs=require(_0xb5f7('0x3'));var fs=require('fs');var Redis=require(_0xb5f7('0x4'));var db=require(_0xb5f7('0x5'))['db'];var utils=require(_0xb5f7('0x6'));var logger=require(_0xb5f7('0x7'))(_0xb5f7('0x8'));var config=require('../../config/environment');var jayson=require(_0xb5f7('0x9'));var client=jayson['client'][_0xb5f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x725cc9,_0x580816,_0x3087a5){return new BPromise(function(_0x2d49ba,_0x4e09dd){return client[_0xb5f7('0xb')](_0x725cc9,_0x3087a5)[_0xb5f7('0xc')](function(_0x1b04ee){logger[_0xb5f7('0xd')](_0xb5f7('0xe'),_0x580816,_0xb5f7('0xf'));logger[_0xb5f7('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x580816,_0xb5f7('0xf'),JSON['stringify'](_0x1b04ee));if(_0x1b04ee['error']){if(_0x1b04ee[_0xb5f7('0x11')][_0xb5f7('0x12')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x580816,_0x1b04ee[_0xb5f7('0x11')][_0xb5f7('0x13')]);return _0x4e09dd(_0x1b04ee[_0xb5f7('0x11')][_0xb5f7('0x13')]);}logger[_0xb5f7('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x580816,_0x1b04ee[_0xb5f7('0x11')][_0xb5f7('0x13')]);return _0x2d49ba(_0x1b04ee[_0xb5f7('0x11')][_0xb5f7('0x13')]);}else{logger[_0xb5f7('0xd')](_0xb5f7('0xe'),_0x580816,'request\x20sent');_0x2d49ba(_0x1b04ee[_0xb5f7('0x14')][_0xb5f7('0x13')]);}})['catch'](function(_0x45e8c2){logger[_0xb5f7('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x580816,_0x45e8c2);_0x4e09dd(_0x45e8c2);});});}exports['GetZohoAccount']=function(_0x286b7f){var _0x23e296=this;return new Promise(function(_0x48215b,_0xa96416){return db[_0xb5f7('0x15')][_0xb5f7('0x16')]({'raw':_0x286b7f[_0xb5f7('0x17')]?_0x286b7f[_0xb5f7('0x17')][_0xb5f7('0x18')]===undefined?!![]:![]:!![],'where':_0x286b7f[_0xb5f7('0x17')]?_0x286b7f[_0xb5f7('0x17')]['where']||null:null,'attributes':_0x286b7f[_0xb5f7('0x17')]?_0x286b7f[_0xb5f7('0x17')][_0xb5f7('0x19')]||null:null,'limit':_0x286b7f[_0xb5f7('0x17')]?_0x286b7f[_0xb5f7('0x17')][_0xb5f7('0x1a')]||null:null,'include':_0x286b7f['options']?_0x286b7f[_0xb5f7('0x17')]['include']?_[_0xb5f7('0x1b')](_0x286b7f[_0xb5f7('0x17')]['include'],function(_0x1176fa){return{'model':db[_0x1176fa['model']],'as':_0x1176fa['as'],'attributes':_0x1176fa[_0xb5f7('0x19')],'include':_0x1176fa[_0xb5f7('0x1c')]?_[_0xb5f7('0x1b')](_0x1176fa['include'],function(_0x6aacf5){return{'model':db[_0x6aacf5[_0xb5f7('0x1d')]],'as':_0x6aacf5['as'],'attributes':_0x6aacf5['attributes'],'include':_0x6aacf5[_0xb5f7('0x1c')]?_[_0xb5f7('0x1b')](_0x6aacf5[_0xb5f7('0x1c')],function(_0x2e0299){return{'model':db[_0x2e0299[_0xb5f7('0x1d')]],'as':_0x2e0299['as'],'attributes':_0x2e0299['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c4d35){logger[_0xb5f7('0xd')](_0xb5f7('0x1e'),_0x286b7f);logger[_0xb5f7('0x10')](_0xb5f7('0x1e'),_0x286b7f,JSON[_0xb5f7('0x1f')](_0x2c4d35));_0x48215b(_0x2c4d35);})[_0xb5f7('0x20')](function(_0x4b9575){logger[_0xb5f7('0x11')](_0xb5f7('0x1e'),_0x4b9575[_0xb5f7('0x13')],_0x286b7f);_0xa96416(_0x23e296['error'](0x1f4,_0x4b9575['message']));});});};exports[_0xb5f7('0x21')]=function(_0x1fec8e){var _0x2b0db9=this;return new Promise(function(_0xf8e211,_0xb98a3){return db['ZohoAccount'][_0xb5f7('0x22')]({'raw':_0x1fec8e[_0xb5f7('0x17')]?_0x1fec8e['options'][_0xb5f7('0x18')]===undefined?!![]:![]:!![],'where':_0x1fec8e[_0xb5f7('0x17')]?_0x1fec8e[_0xb5f7('0x17')][_0xb5f7('0x23')]||null:null,'attributes':_0x1fec8e[_0xb5f7('0x17')]?_0x1fec8e['options']['attributes']||null:null,'include':_0x1fec8e[_0xb5f7('0x17')]?_0x1fec8e[_0xb5f7('0x17')][_0xb5f7('0x1c')]?_['map'](_0x1fec8e[_0xb5f7('0x17')][_0xb5f7('0x1c')],function(_0x7f9a96){return{'model':db[_0x7f9a96['model']],'as':_0x7f9a96['as'],'attributes':_0x7f9a96[_0xb5f7('0x19')],'include':_0x7f9a96[_0xb5f7('0x1c')]?_[_0xb5f7('0x1b')](_0x7f9a96[_0xb5f7('0x1c')],function(_0x6d5bce){return{'model':db[_0x6d5bce[_0xb5f7('0x1d')]],'as':_0x6d5bce['as'],'attributes':_0x6d5bce['attributes'],'include':_0x6d5bce[_0xb5f7('0x1c')]?_[_0xb5f7('0x1b')](_0x6d5bce[_0xb5f7('0x1c')],function(_0x20a6ea){return{'model':db[_0x20a6ea['model']],'as':_0x20a6ea['as'],'attributes':_0x20a6ea[_0xb5f7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb5f7('0xc')](function(_0xcb4ad2){logger[_0xb5f7('0xd')](_0xb5f7('0x21'),_0x1fec8e);logger[_0xb5f7('0x10')]('ShowZohoAccount',_0x1fec8e,JSON[_0xb5f7('0x1f')](_0xcb4ad2));_0xf8e211(_0xcb4ad2);})[_0xb5f7('0x20')](function(_0xac0a2a){logger[_0xb5f7('0x11')](_0xb5f7('0x21'),_0xac0a2a['message'],_0x1fec8e);_0xb98a3(_0x2b0db9[_0xb5f7('0x11')](0x1f4,_0xac0a2a[_0xb5f7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index c5e1913..81588bc 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 _0x380a=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields'];(function(_0x1002c5,_0x17ad04){var _0x9236be=function(_0x1cb4c3){while(--_0x1cb4c3){_0x1002c5['push'](_0x1002c5['shift']());}};_0x9236be(++_0x17ad04);}(_0x380a,0x137));var _0xa380=function(_0x4ac5c1,_0x12f4bc){_0x4ac5c1=_0x4ac5c1-0x0;var _0x17c632=_0x380a[_0x4ac5c1];return _0x17c632;};'use strict';var multer=require(_0xa380('0x0'));var util=require(_0xa380('0x1'));var path=require(_0xa380('0x2'));var timeout=require('connect-timeout');var express=require(_0xa380('0x3'));var router=express[_0xa380('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa380('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa380('0x6'));var controller=require(_0xa380('0x7'));router[_0xa380('0x8')]('/',auth['isAuthenticated'](),controller[_0xa380('0x9')]);router['get'](_0xa380('0xa'),auth[_0xa380('0xb')](),controller[_0xa380('0xc')]);router[_0xa380('0x8')](_0xa380('0xd'),auth[_0xa380('0xb')](),controller[_0xa380('0xe')]);router[_0xa380('0x8')](_0xa380('0xf'),auth[_0xa380('0xb')](),controller[_0xa380('0x10')]);router[_0xa380('0x8')](_0xa380('0x11'),auth[_0xa380('0xb')](),controller[_0xa380('0x12')]);router[_0xa380('0x13')]('/',auth[_0xa380('0xb')](),controller[_0xa380('0x14')]);router['put']('/:id',auth[_0xa380('0xb')](),controller[_0xa380('0x15')]);router[_0xa380('0x16')](_0xa380('0xa'),auth[_0xa380('0xb')](),controller[_0xa380('0x17')]);module[_0xa380('0x18')]=router; \ No newline at end of file +var _0x28f8=['post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x28f8,0x85));var _0x828f=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x28f8[_0x5a27e8];return _0x4e38f7;};'use strict';var multer=require('multer');var util=require(_0x828f('0x0'));var path=require(_0x828f('0x1'));var timeout=require(_0x828f('0x2'));var express=require(_0x828f('0x3'));var router=express['Router']();var fs_extra=require(_0x828f('0x4'));var auth=require(_0x828f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x828f('0x6'));var controller=require('./intZohoConfiguration.controller');router[_0x828f('0x7')]('/',auth[_0x828f('0x8')](),controller[_0x828f('0x9')]);router['get']('/:id',auth[_0x828f('0x8')](),controller[_0x828f('0xa')]);router['get'](_0x828f('0xb'),auth[_0x828f('0x8')](),controller[_0x828f('0xc')]);router[_0x828f('0x7')](_0x828f('0xd'),auth[_0x828f('0x8')](),controller[_0x828f('0xe')]);router[_0x828f('0x7')](_0x828f('0xf'),auth[_0x828f('0x8')](),controller[_0x828f('0x10')]);router[_0x828f('0x11')]('/',auth['isAuthenticated'](),controller[_0x828f('0x12')]);router[_0x828f('0x13')](_0x828f('0x14'),auth[_0x828f('0x8')](),controller[_0x828f('0x15')]);router[_0x828f('0x16')](_0x828f('0x14'),auth[_0x828f('0x8')](),controller[_0x828f('0x17')]);module[_0x828f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index bb49a52..98394c5 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 _0xf149=['contact','lead','sequelize','exports','STRING','ENUM','nothing','contact_lead'];(function(_0x4c1e1e,_0x3964ca){var _0x394249=function(_0x4ac1af){while(--_0x4ac1af){_0x4c1e1e['push'](_0x4c1e1e['shift']());}};_0x394249(++_0x3964ca);}(_0xf149,0xda));var _0x9f14=function(_0x32be09,_0x508724){_0x32be09=_0x32be09-0x0;var _0x1db24d=_0xf149[_0x32be09];return _0x1db24d;};'use strict';var Sequelize=require(_0x9f14('0x0'));module[_0x9f14('0x1')]={'name':{'type':Sequelize[_0x9f14('0x2')]},'moduleCreate':{'type':Sequelize[_0x9f14('0x3')]('lead','contact',_0x9f14('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x9f14('0x3')](_0x9f14('0x5'),_0x9f14('0x6'),_0x9f14('0x7')),'defaultValue':_0x9f14('0x5')},'description':{'type':Sequelize[_0x9f14('0x2')]}}; \ No newline at end of file +var _0x9932=['contact','nothing','contact_lead','exports','STRING','ENUM','lead'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x9932,0xc0));var _0x2993=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x9932[_0x174ef5];return _0x1cc379;};'use strict';var Sequelize=require('sequelize');module[_0x2993('0x0')]={'name':{'type':Sequelize[_0x2993('0x1')]},'moduleCreate':{'type':Sequelize[_0x2993('0x2')](_0x2993('0x3'),_0x2993('0x4'),_0x2993('0x5')),'defaultValue':_0x2993('0x3')},'moduleSearch':{'type':Sequelize[_0x2993('0x2')](_0x2993('0x6'),_0x2993('0x4'),_0x2993('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x2993('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 60f8349..51006a2 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 _0x40c9=['json','offset','limit','undefined','count','set','apply','reject','update','then','name','map','ZohoConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getFields','ZohoField','sort','pick','getSubjects','findOne','getDescriptions','hasOwnProperty','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x442ef7,_0x2cb503){var _0x2d030e=function(_0x156f06){while(--_0x156f06){_0x442ef7['push'](_0x442ef7['shift']());}};_0x2d030e(++_0x2cb503);}(_0x40c9,0x1a3));var _0x940c=function(_0x226336,_0xff24d7){_0x226336=_0x226336-0x0;var _0x2ee251=_0x40c9[_0x226336];return _0x2ee251;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x940c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x940c('0x1'));var rp=require(_0x940c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x940c('0x3'));var util=require('util');var path=require(_0x940c('0x4'));var sox=require(_0x940c('0x5'));var csv=require(_0x940c('0x6'));var ejs=require(_0x940c('0x7'));var fs=require('fs');var fs_extra=require(_0x940c('0x8'));var _=require('lodash');var squel=require(_0x940c('0x9'));var crypto=require('crypto');var jsforce=require(_0x940c('0xa'));var deskjs=require(_0x940c('0xb'));var toCsv=require('to-csv');var querystring=require(_0x940c('0xc'));var Papa=require('papaparse');var Redis=require(_0x940c('0xd'));var authService=require(_0x940c('0xe'));var qs=require(_0x940c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x940c('0x10'));var logger=require(_0x940c('0x11'))(_0x940c('0x12'));var utils=require(_0x940c('0x13'));var config=require(_0x940c('0x14'));var licenseUtil=require(_0x940c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1f5e,_0x4e83f5){_0x4e83f5=_0x4e83f5||0xcc;return function(_0x131be3){if(_0x131be3){return _0x4b1f5e[_0x940c('0x16')](_0x4e83f5);}return _0x4b1f5e[_0x940c('0x17')](_0x4e83f5)[_0x940c('0x18')]();};}function respondWithResult(_0x4e3568,_0x2963e7){_0x2963e7=_0x2963e7||0xc8;return function(_0x5cfd14){if(_0x5cfd14){return _0x4e3568[_0x940c('0x17')](_0x2963e7)[_0x940c('0x19')](_0x5cfd14);}};}function respondWithFilteredResult(_0x5b40db,_0x60395a){return function(_0x594812){if(_0x594812){var _0xe9bb20=typeof _0x60395a[_0x940c('0x1a')]==='undefined'&&typeof _0x60395a[_0x940c('0x1b')]===_0x940c('0x1c');var _0x166b88=_0x594812[_0x940c('0x1d')];var _0x42461f=_0xe9bb20?0x0:_0x60395a['offset'];var _0x33bfee=_0xe9bb20?_0x594812[_0x940c('0x1d')]:_0x60395a[_0x940c('0x1a')]+_0x60395a['limit'];var _0x54235c;if(_0x33bfee>=_0x166b88){_0x33bfee=_0x166b88;_0x54235c=0xc8;}else{_0x54235c=0xce;}_0x5b40db[_0x940c('0x17')](_0x54235c);return _0x5b40db[_0x940c('0x1e')]('Content-Range',_0x42461f+'-'+_0x33bfee+'/'+_0x166b88)[_0x940c('0x19')](_0x594812);}return null;};}function patchUpdates(_0xe803c2){return function(_0x30c637){try{jsonpatch[_0x940c('0x1f')](_0x30c637,_0xe803c2,!![]);}catch(_0xd7cfee){return BPromise[_0x940c('0x20')](_0xd7cfee);}return _0x30c637['save']();};}function saveUpdates(_0x4d87e2,_0x5b63a3){return function(_0x245e8f){if(_0x245e8f){return _0x245e8f[_0x940c('0x21')](_0x4d87e2)['then'](function(_0x5e8dc0){return _0x5e8dc0;});}return null;};}function removeEntity(_0x2ff4e7,_0x345dae){return function(_0x25a850){if(_0x25a850){return _0x25a850['destroy']()[_0x940c('0x22')](function(){_0x2ff4e7[_0x940c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x256cdc,_0x2fe15c){return function(_0x2f6836){if(!_0x2f6836){_0x256cdc['sendStatus'](0x194);}return _0x2f6836;};}function handleError(_0x1435da,_0x3d9459){_0x3d9459=_0x3d9459||0x1f4;return function(_0x2edd86){logger['error'](_0x2edd86['stack']);if(_0x2edd86[_0x940c('0x23')]){delete _0x2edd86[_0x940c('0x23')];}_0x1435da[_0x940c('0x17')](_0x3d9459)['send'](_0x2edd86);};}exports['index']=function(_0x13a253,_0x3a0d79){var _0x37f698={},_0x31c2fb={},_0x4f3b41={'count':0x0,'rows':[]};var _0x1c012f=_[_0x940c('0x24')](db[_0x940c('0x25')][_0x940c('0x26')],function(_0x26713b){return{'name':_0x26713b['fieldName'],'type':_0x26713b['type']['key']};});_0x31c2fb[_0x940c('0x27')]=_[_0x940c('0x24')](_0x1c012f,_0x940c('0x23'));_0x31c2fb[_0x940c('0x28')]=_[_0x940c('0x29')](_0x13a253['query']);_0x31c2fb[_0x940c('0x2a')]=_[_0x940c('0x2b')](_0x31c2fb[_0x940c('0x27')],_0x31c2fb['query']);_0x37f698[_0x940c('0x2c')]=_[_0x940c('0x2b')](_0x31c2fb['model'],qs[_0x940c('0x2d')](_0x13a253[_0x940c('0x28')][_0x940c('0x2d')]));_0x37f698['attributes']=_0x37f698[_0x940c('0x2c')][_0x940c('0x2e')]?_0x37f698[_0x940c('0x2c')]:_0x31c2fb['model'];if(!_0x13a253['query']['hasOwnProperty'](_0x940c('0x2f'))){_0x37f698[_0x940c('0x1b')]=qs['limit'](_0x13a253['query'][_0x940c('0x1b')]);_0x37f698[_0x940c('0x1a')]=qs['offset'](_0x13a253['query'][_0x940c('0x1a')]);}_0x37f698[_0x940c('0x30')]=qs['sort'](_0x13a253['query']['sort']);_0x37f698['where']=qs[_0x940c('0x2a')](_['pick'](_0x13a253[_0x940c('0x28')],_0x31c2fb[_0x940c('0x2a')]),_0x1c012f);if(_0x13a253['query'][_0x940c('0x31')]){_0x37f698['where']=_[_0x940c('0x32')](_0x37f698[_0x940c('0x33')],{'$or':_[_0x940c('0x24')](_0x1c012f,function(_0x43869c){if(_0x43869c[_0x940c('0x34')]!==_0x940c('0x35')){var _0x5f5cea={};_0x5f5cea[_0x43869c[_0x940c('0x23')]]={'$like':'%'+_0x13a253[_0x940c('0x28')][_0x940c('0x31')]+'%'};return _0x5f5cea;}})});}_0x37f698=_[_0x940c('0x32')]({},_0x37f698,_0x13a253[_0x940c('0x36')]);var _0x4260a4={'where':_0x37f698[_0x940c('0x33')]};return db['ZohoConfiguration']['count'](_0x4260a4)['then'](function(_0xd16900){_0x4f3b41['count']=_0xd16900;if(_0x13a253[_0x940c('0x28')][_0x940c('0x37')]){_0x37f698['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x940c('0x38')](_0x37f698);})['then'](function(_0x278e22){_0x4f3b41[_0x940c('0x39')]=_0x278e22;return _0x4f3b41;})['then'](respondWithFilteredResult(_0x3a0d79,_0x37f698))[_0x940c('0x3a')](handleError(_0x3a0d79,null));};exports[_0x940c('0x3b')]=function(_0xf1bdf4,_0x3f1044){var _0x228ad2={'raw':![],'where':{'id':_0xf1bdf4[_0x940c('0x3c')]['id']}},_0x311ae7={};_0x311ae7[_0x940c('0x27')]=_['keys'](db['ZohoConfiguration'][_0x940c('0x26')]);_0x311ae7[_0x940c('0x28')]=_['keys'](_0xf1bdf4[_0x940c('0x28')]);_0x311ae7[_0x940c('0x2a')]=_[_0x940c('0x2b')](_0x311ae7[_0x940c('0x27')],_0x311ae7[_0x940c('0x28')]);_0x228ad2[_0x940c('0x2c')]=_[_0x940c('0x2b')](_0x311ae7[_0x940c('0x27')],qs[_0x940c('0x2d')](_0xf1bdf4[_0x940c('0x28')][_0x940c('0x2d')]));_0x228ad2['attributes']=_0x228ad2[_0x940c('0x2c')][_0x940c('0x2e')]?_0x228ad2[_0x940c('0x2c')]:_0x311ae7[_0x940c('0x27')];if(_0xf1bdf4[_0x940c('0x28')]['includeAll']){_0x228ad2[_0x940c('0x3d')]=[{'all':!![]}];}_0x228ad2=_[_0x940c('0x32')]({},_0x228ad2,_0xf1bdf4[_0x940c('0x36')]);return db[_0x940c('0x25')][_0x940c('0x3e')](_0x228ad2)[_0x940c('0x22')](handleEntityNotFound(_0x3f1044,null))[_0x940c('0x22')](respondWithResult(_0x3f1044,null))[_0x940c('0x3a')](handleError(_0x3f1044,null));};exports['create']=function(_0x211e3b,_0x2aabe8){return db['ZohoConfiguration'][_0x940c('0x3f')](_0x211e3b[_0x940c('0x40')],{})[_0x940c('0x22')](respondWithResult(_0x2aabe8,0xc9))[_0x940c('0x3a')](handleError(_0x2aabe8,null));};exports[_0x940c('0x21')]=function(_0x57c51f,_0x115e50){if(_0x57c51f['body']['id']){delete _0x57c51f['body']['id'];}return db[_0x940c('0x25')][_0x940c('0x3e')]({'where':{'id':_0x57c51f[_0x940c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x115e50,null))[_0x940c('0x22')](saveUpdates(_0x57c51f['body'],null))[_0x940c('0x22')](respondWithResult(_0x115e50,null))['catch'](handleError(_0x115e50,null));};exports[_0x940c('0x41')]=function(_0x6e81e3,_0x158a44){return db[_0x940c('0x25')][_0x940c('0x3e')]({'where':{'id':_0x6e81e3[_0x940c('0x3c')]['id']}})[_0x940c('0x22')](handleEntityNotFound(_0x158a44,null))[_0x940c('0x22')](removeEntity(_0x158a44,null))[_0x940c('0x3a')](handleError(_0x158a44,null));};exports[_0x940c('0x42')]=function(_0x3589ad,_0x1066e7,_0x16f399){var _0x5c5dcb={};var _0x3ff1ff={};var _0x434948;var _0x2204ea;return db[_0x940c('0x25')]['findOne']({'where':{'id':_0x3589ad['params']['id']}})[_0x940c('0x22')](handleEntityNotFound(_0x1066e7,null))[_0x940c('0x22')](function(_0x45efe5){if(_0x45efe5){_0x434948=_0x45efe5;_0x3ff1ff['model']=_[_0x940c('0x29')](db[_0x940c('0x43')][_0x940c('0x26')]);_0x3ff1ff[_0x940c('0x28')]=_[_0x940c('0x29')](_0x3589ad[_0x940c('0x28')]);_0x3ff1ff[_0x940c('0x2a')]=_[_0x940c('0x2b')](_0x3ff1ff['model'],_0x3ff1ff[_0x940c('0x28')]);_0x5c5dcb[_0x940c('0x2c')]=_[_0x940c('0x2b')](_0x3ff1ff[_0x940c('0x27')],qs[_0x940c('0x2d')](_0x3589ad['query'][_0x940c('0x2d')]));_0x5c5dcb[_0x940c('0x2c')]=_0x5c5dcb['attributes']['length']?_0x5c5dcb[_0x940c('0x2c')]:_0x3ff1ff[_0x940c('0x27')];_0x5c5dcb[_0x940c('0x30')]=qs[_0x940c('0x44')](_0x3589ad[_0x940c('0x28')]['sort']);_0x5c5dcb[_0x940c('0x33')]=qs['filters'](_[_0x940c('0x45')](_0x3589ad[_0x940c('0x28')],_0x3ff1ff[_0x940c('0x2a')]));if(_0x3589ad['query'][_0x940c('0x31')]){_0x5c5dcb['where']=_['merge'](_0x5c5dcb[_0x940c('0x33')],{'$or':_[_0x940c('0x24')](_0x5c5dcb['attributes'],function(_0x4f5b17){var _0x5bdeac={};_0x5bdeac[_0x4f5b17]={'$like':'%'+_0x3589ad['query'][_0x940c('0x31')]+'%'};return _0x5bdeac;})});}_0x5c5dcb=_[_0x940c('0x32')]({},_0x5c5dcb,_0x3589ad[_0x940c('0x36')]);return _0x434948[_0x940c('0x42')](_0x5c5dcb);}})[_0x940c('0x22')](function(_0x49503d){if(_0x49503d){_0x2204ea=_0x49503d['length'];if(!_0x3589ad[_0x940c('0x28')]['hasOwnProperty'](_0x940c('0x2f'))){_0x5c5dcb[_0x940c('0x1b')]=qs[_0x940c('0x1b')](_0x3589ad[_0x940c('0x28')][_0x940c('0x1b')]);_0x5c5dcb[_0x940c('0x1a')]=qs[_0x940c('0x1a')](_0x3589ad['query'][_0x940c('0x1a')]);}return _0x434948['getFields'](_0x5c5dcb);}})[_0x940c('0x22')](function(_0x47082d){if(_0x47082d){return _0x47082d?{'count':_0x2204ea,'rows':_0x47082d}:null;}})['then'](respondWithResult(_0x1066e7,null))['catch'](handleError(_0x1066e7,null));};exports[_0x940c('0x46')]=function(_0x5b058f,_0x3c7a53,_0x464c9c){var _0x102fff={};var _0x575d94={};var _0x2129fb;var _0x28cc51;return db[_0x940c('0x25')][_0x940c('0x47')]({'where':{'id':_0x5b058f[_0x940c('0x3c')]['id']}})[_0x940c('0x22')](handleEntityNotFound(_0x3c7a53,null))[_0x940c('0x22')](function(_0x10df29){if(_0x10df29){_0x2129fb=_0x10df29;_0x575d94[_0x940c('0x27')]=_[_0x940c('0x29')](db['ZohoField']['rawAttributes']);_0x575d94[_0x940c('0x28')]=_[_0x940c('0x29')](_0x5b058f[_0x940c('0x28')]);_0x575d94[_0x940c('0x2a')]=_[_0x940c('0x2b')](_0x575d94[_0x940c('0x27')],_0x575d94[_0x940c('0x28')]);_0x102fff['attributes']=_['intersection'](_0x575d94['model'],qs[_0x940c('0x2d')](_0x5b058f[_0x940c('0x28')]['fields']));_0x102fff[_0x940c('0x2c')]=_0x102fff[_0x940c('0x2c')][_0x940c('0x2e')]?_0x102fff[_0x940c('0x2c')]:_0x575d94[_0x940c('0x27')];_0x102fff[_0x940c('0x30')]=qs[_0x940c('0x44')](_0x5b058f['query'][_0x940c('0x44')]);_0x102fff[_0x940c('0x33')]=qs['filters'](_['pick'](_0x5b058f[_0x940c('0x28')],_0x575d94[_0x940c('0x2a')]));if(_0x5b058f[_0x940c('0x28')][_0x940c('0x31')]){_0x102fff[_0x940c('0x33')]=_['merge'](_0x102fff['where'],{'$or':_[_0x940c('0x24')](_0x102fff[_0x940c('0x2c')],function(_0x33f748){var _0x1c1f09={};_0x1c1f09[_0x33f748]={'$like':'%'+_0x5b058f['query'][_0x940c('0x31')]+'%'};return _0x1c1f09;})});}_0x102fff=_[_0x940c('0x32')]({},_0x102fff,_0x5b058f[_0x940c('0x36')]);return _0x2129fb['getSubjects'](_0x102fff);}})[_0x940c('0x22')](function(_0x26b5c1){if(_0x26b5c1){_0x28cc51=_0x26b5c1[_0x940c('0x2e')];if(!_0x5b058f[_0x940c('0x28')]['hasOwnProperty']('nolimit')){_0x102fff[_0x940c('0x1b')]=qs['limit'](_0x5b058f[_0x940c('0x28')][_0x940c('0x1b')]);_0x102fff['offset']=qs[_0x940c('0x1a')](_0x5b058f[_0x940c('0x28')][_0x940c('0x1a')]);}return _0x2129fb[_0x940c('0x46')](_0x102fff);}})['then'](function(_0x119e10){if(_0x119e10){return _0x119e10?{'count':_0x28cc51,'rows':_0x119e10}:null;}})[_0x940c('0x22')](respondWithResult(_0x3c7a53,null))['catch'](handleError(_0x3c7a53,null));};exports['getDescriptions']=function(_0x523dee,_0x1b3afb,_0x5926c5){var _0x7b9e29={};var _0x436d37={};var _0x571fed;var _0x40edfd;return db[_0x940c('0x25')]['findOne']({'where':{'id':_0x523dee[_0x940c('0x3c')]['id']}})[_0x940c('0x22')](handleEntityNotFound(_0x1b3afb,null))[_0x940c('0x22')](function(_0x129e0d){if(_0x129e0d){_0x571fed=_0x129e0d;_0x436d37[_0x940c('0x27')]=_[_0x940c('0x29')](db[_0x940c('0x43')][_0x940c('0x26')]);_0x436d37['query']=_[_0x940c('0x29')](_0x523dee['query']);_0x436d37['filters']=_['intersection'](_0x436d37[_0x940c('0x27')],_0x436d37['query']);_0x7b9e29[_0x940c('0x2c')]=_[_0x940c('0x2b')](_0x436d37['model'],qs[_0x940c('0x2d')](_0x523dee['query'][_0x940c('0x2d')]));_0x7b9e29[_0x940c('0x2c')]=_0x7b9e29[_0x940c('0x2c')][_0x940c('0x2e')]?_0x7b9e29['attributes']:_0x436d37[_0x940c('0x27')];_0x7b9e29[_0x940c('0x30')]=qs[_0x940c('0x44')](_0x523dee[_0x940c('0x28')][_0x940c('0x44')]);_0x7b9e29['where']=qs[_0x940c('0x2a')](_['pick'](_0x523dee['query'],_0x436d37[_0x940c('0x2a')]));if(_0x523dee['query'][_0x940c('0x31')]){_0x7b9e29[_0x940c('0x33')]=_[_0x940c('0x32')](_0x7b9e29['where'],{'$or':_['map'](_0x7b9e29['attributes'],function(_0x3c6e97){var _0x201844={};_0x201844[_0x3c6e97]={'$like':'%'+_0x523dee[_0x940c('0x28')][_0x940c('0x31')]+'%'};return _0x201844;})});}_0x7b9e29=_['merge']({},_0x7b9e29,_0x523dee['options']);return _0x571fed[_0x940c('0x48')](_0x7b9e29);}})[_0x940c('0x22')](function(_0x2eb9e7){if(_0x2eb9e7){_0x40edfd=_0x2eb9e7[_0x940c('0x2e')];if(!_0x523dee[_0x940c('0x28')][_0x940c('0x49')](_0x940c('0x2f'))){_0x7b9e29[_0x940c('0x1b')]=qs[_0x940c('0x1b')](_0x523dee[_0x940c('0x28')]['limit']);_0x7b9e29[_0x940c('0x1a')]=qs[_0x940c('0x1a')](_0x523dee[_0x940c('0x28')][_0x940c('0x1a')]);}return _0x571fed[_0x940c('0x48')](_0x7b9e29);}})[_0x940c('0x22')](function(_0x256c10){if(_0x256c10){return _0x256c10?{'count':_0x40edfd,'rows':_0x256c10}:null;}})['then'](respondWithResult(_0x1b3afb,null))[_0x940c('0x3a')](handleError(_0x1b3afb,null));}; \ No newline at end of file +var _0x782f=['options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','ZohoField','order','sort','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','send','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','merge','filter'];(function(_0x1b745b,_0x3e2d40){var _0x120a9d=function(_0x882a6c){while(--_0x882a6c){_0x1b745b['push'](_0x1b745b['shift']());}};_0x120a9d(++_0x3e2d40);}(_0x782f,0x64));var _0xf782=function(_0x43f872,_0x10318f){_0x43f872=_0x43f872-0x0;var _0x3375e3=_0x782f[_0x43f872];return _0x3375e3;};'use strict';var emlformat=require(_0xf782('0x0'));var rimraf=require(_0xf782('0x1'));var zipdir=require(_0xf782('0x2'));var jsonpatch=require(_0xf782('0x3'));var rp=require(_0xf782('0x4'));var moment=require(_0xf782('0x5'));var BPromise=require(_0xf782('0x6'));var Mustache=require(_0xf782('0x7'));var util=require(_0xf782('0x8'));var path=require(_0xf782('0x9'));var sox=require(_0xf782('0xa'));var csv=require(_0xf782('0xb'));var ejs=require(_0xf782('0xc'));var fs=require('fs');var fs_extra=require(_0xf782('0xd'));var _=require(_0xf782('0xe'));var squel=require(_0xf782('0xf'));var crypto=require(_0xf782('0x10'));var jsforce=require(_0xf782('0x11'));var deskjs=require(_0xf782('0x12'));var toCsv=require(_0xf782('0xb'));var querystring=require('querystring');var Papa=require(_0xf782('0x13'));var Redis=require(_0xf782('0x14'));var authService=require(_0xf782('0x15'));var qs=require(_0xf782('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf782('0x17'));var logger=require(_0xf782('0x18'))('api');var utils=require(_0xf782('0x19'));var config=require(_0xf782('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ed491,_0x32e60e){_0x32e60e=_0x32e60e||0xcc;return function(_0xb3c536){if(_0xb3c536){return _0x5ed491[_0xf782('0x1b')](_0x32e60e);}return _0x5ed491[_0xf782('0x1c')](_0x32e60e)['end']();};}function respondWithResult(_0x23945e,_0x4b6a28){_0x4b6a28=_0x4b6a28||0xc8;return function(_0x2ff973){if(_0x2ff973){return _0x23945e[_0xf782('0x1c')](_0x4b6a28)['json'](_0x2ff973);}};}function respondWithFilteredResult(_0x422d71,_0x232d19){return function(_0x24354e){if(_0x24354e){var _0x398e9a=typeof _0x232d19['offset']===_0xf782('0x1d')&&typeof _0x232d19[_0xf782('0x1e')]===_0xf782('0x1d');var _0xcb4d7b=_0x24354e[_0xf782('0x1f')];var _0x34f580=_0x398e9a?0x0:_0x232d19[_0xf782('0x20')];var _0x364bf2=_0x398e9a?_0x24354e[_0xf782('0x1f')]:_0x232d19[_0xf782('0x20')]+_0x232d19[_0xf782('0x1e')];var _0x2932a7;if(_0x364bf2>=_0xcb4d7b){_0x364bf2=_0xcb4d7b;_0x2932a7=0xc8;}else{_0x2932a7=0xce;}_0x422d71['status'](_0x2932a7);return _0x422d71[_0xf782('0x21')](_0xf782('0x22'),_0x34f580+'-'+_0x364bf2+'/'+_0xcb4d7b)['json'](_0x24354e);}return null;};}function patchUpdates(_0x437770){return function(_0x30eb34){try{jsonpatch[_0xf782('0x23')](_0x30eb34,_0x437770,!![]);}catch(_0xf409de){return BPromise[_0xf782('0x24')](_0xf409de);}return _0x30eb34[_0xf782('0x25')]();};}function saveUpdates(_0x43bb3d,_0x5b4567){return function(_0x3d5ab6){if(_0x3d5ab6){return _0x3d5ab6[_0xf782('0x26')](_0x43bb3d)['then'](function(_0x112fdc){return _0x112fdc;});}return null;};}function removeEntity(_0x5c758c,_0x5a07b8){return function(_0x4e5153){if(_0x4e5153){return _0x4e5153[_0xf782('0x27')]()[_0xf782('0x28')](function(){_0x5c758c[_0xf782('0x1c')](0xcc)[_0xf782('0x29')]();});}};}function handleEntityNotFound(_0x5b03bb,_0x4be4ac){return function(_0x39a7b8){if(!_0x39a7b8){_0x5b03bb[_0xf782('0x1b')](0x194);}return _0x39a7b8;};}function handleError(_0x486af7,_0x538302){_0x538302=_0x538302||0x1f4;return function(_0x451816){logger[_0xf782('0x2a')](_0x451816[_0xf782('0x2b')]);if(_0x451816['name']){delete _0x451816['name'];}_0x486af7[_0xf782('0x1c')](_0x538302)[_0xf782('0x2c')](_0x451816);};}exports['index']=function(_0x3b4df8,_0x5ba11e){var _0xcc3079={},_0xfc3b8={},_0x150c61={'count':0x0,'rows':[]};var _0x4cbc47=_['map'](db[_0xf782('0x2d')][_0xf782('0x2e')],function(_0x28b706){return{'name':_0x28b706[_0xf782('0x2f')],'type':_0x28b706[_0xf782('0x30')][_0xf782('0x31')]};});_0xfc3b8[_0xf782('0x32')]=_[_0xf782('0x33')](_0x4cbc47,_0xf782('0x34'));_0xfc3b8['query']=_[_0xf782('0x35')](_0x3b4df8[_0xf782('0x36')]);_0xfc3b8[_0xf782('0x37')]=_[_0xf782('0x38')](_0xfc3b8['model'],_0xfc3b8['query']);_0xcc3079[_0xf782('0x39')]=_[_0xf782('0x38')](_0xfc3b8['model'],qs[_0xf782('0x3a')](_0x3b4df8[_0xf782('0x36')][_0xf782('0x3a')]));_0xcc3079['attributes']=_0xcc3079[_0xf782('0x39')][_0xf782('0x3b')]?_0xcc3079['attributes']:_0xfc3b8[_0xf782('0x32')];if(!_0x3b4df8['query'][_0xf782('0x3c')](_0xf782('0x3d'))){_0xcc3079[_0xf782('0x1e')]=qs['limit'](_0x3b4df8[_0xf782('0x36')][_0xf782('0x1e')]);_0xcc3079['offset']=qs[_0xf782('0x20')](_0x3b4df8[_0xf782('0x36')]['offset']);}_0xcc3079['order']=qs['sort'](_0x3b4df8[_0xf782('0x36')]['sort']);_0xcc3079[_0xf782('0x3e')]=qs[_0xf782('0x37')](_[_0xf782('0x3f')](_0x3b4df8[_0xf782('0x36')],_0xfc3b8[_0xf782('0x37')]),_0x4cbc47);if(_0x3b4df8[_0xf782('0x36')]['filter']){_0xcc3079[_0xf782('0x3e')]=_[_0xf782('0x40')](_0xcc3079[_0xf782('0x3e')],{'$or':_[_0xf782('0x33')](_0x4cbc47,function(_0x3cada6){if(_0x3cada6[_0xf782('0x30')]!=='VIRTUAL'){var _0x8932f6={};_0x8932f6[_0x3cada6[_0xf782('0x34')]]={'$like':'%'+_0x3b4df8[_0xf782('0x36')][_0xf782('0x41')]+'%'};return _0x8932f6;}})});}_0xcc3079=_[_0xf782('0x40')]({},_0xcc3079,_0x3b4df8[_0xf782('0x42')]);var _0x129588={'where':_0xcc3079[_0xf782('0x3e')]};return db['ZohoConfiguration'][_0xf782('0x1f')](_0x129588)[_0xf782('0x28')](function(_0x158192){_0x150c61[_0xf782('0x1f')]=_0x158192;if(_0x3b4df8['query'][_0xf782('0x43')]){_0xcc3079[_0xf782('0x44')]=[{'all':!![]}];}return db[_0xf782('0x2d')][_0xf782('0x45')](_0xcc3079);})[_0xf782('0x28')](function(_0x4ffd65){_0x150c61[_0xf782('0x46')]=_0x4ffd65;return _0x150c61;})[_0xf782('0x28')](respondWithFilteredResult(_0x5ba11e,_0xcc3079))[_0xf782('0x47')](handleError(_0x5ba11e,null));};exports['show']=function(_0x4149af,_0x1f2d34){var _0x19de11={'raw':![],'where':{'id':_0x4149af[_0xf782('0x48')]['id']}},_0x1d1e39={};_0x1d1e39[_0xf782('0x32')]=_[_0xf782('0x35')](db[_0xf782('0x2d')][_0xf782('0x2e')]);_0x1d1e39[_0xf782('0x36')]=_[_0xf782('0x35')](_0x4149af[_0xf782('0x36')]);_0x1d1e39[_0xf782('0x37')]=_[_0xf782('0x38')](_0x1d1e39[_0xf782('0x32')],_0x1d1e39['query']);_0x19de11[_0xf782('0x39')]=_['intersection'](_0x1d1e39[_0xf782('0x32')],qs[_0xf782('0x3a')](_0x4149af['query'][_0xf782('0x3a')]));_0x19de11[_0xf782('0x39')]=_0x19de11['attributes'][_0xf782('0x3b')]?_0x19de11['attributes']:_0x1d1e39['model'];if(_0x4149af[_0xf782('0x36')]['includeAll']){_0x19de11['include']=[{'all':!![]}];}_0x19de11=_[_0xf782('0x40')]({},_0x19de11,_0x4149af['options']);return db[_0xf782('0x2d')][_0xf782('0x49')](_0x19de11)['then'](handleEntityNotFound(_0x1f2d34,null))[_0xf782('0x28')](respondWithResult(_0x1f2d34,null))[_0xf782('0x47')](handleError(_0x1f2d34,null));};exports[_0xf782('0x4a')]=function(_0x475d6d,_0x409f51){return db['ZohoConfiguration'][_0xf782('0x4a')](_0x475d6d['body'],{})[_0xf782('0x28')](respondWithResult(_0x409f51,0xc9))[_0xf782('0x47')](handleError(_0x409f51,null));};exports['update']=function(_0x8b5f5f,_0x395653){if(_0x8b5f5f['body']['id']){delete _0x8b5f5f['body']['id'];}return db[_0xf782('0x2d')]['find']({'where':{'id':_0x8b5f5f[_0xf782('0x48')]['id']}})[_0xf782('0x28')](handleEntityNotFound(_0x395653,null))['then'](saveUpdates(_0x8b5f5f[_0xf782('0x4b')],null))[_0xf782('0x28')](respondWithResult(_0x395653,null))[_0xf782('0x47')](handleError(_0x395653,null));};exports[_0xf782('0x27')]=function(_0x34beed,_0x155566){return db[_0xf782('0x2d')][_0xf782('0x49')]({'where':{'id':_0x34beed[_0xf782('0x48')]['id']}})[_0xf782('0x28')](handleEntityNotFound(_0x155566,null))['then'](removeEntity(_0x155566,null))[_0xf782('0x47')](handleError(_0x155566,null));};exports[_0xf782('0x4c')]=function(_0x1b8352,_0x431d9c,_0x5ced25){var _0x41e0d1={};var _0x52c704={};var _0x3ad9cf;var _0x2b91eb;return db[_0xf782('0x2d')][_0xf782('0x4d')]({'where':{'id':_0x1b8352[_0xf782('0x48')]['id']}})[_0xf782('0x28')](handleEntityNotFound(_0x431d9c,null))['then'](function(_0x117d21){if(_0x117d21){_0x3ad9cf=_0x117d21;_0x52c704['model']=_[_0xf782('0x35')](db[_0xf782('0x4e')][_0xf782('0x2e')]);_0x52c704[_0xf782('0x36')]=_[_0xf782('0x35')](_0x1b8352[_0xf782('0x36')]);_0x52c704[_0xf782('0x37')]=_[_0xf782('0x38')](_0x52c704[_0xf782('0x32')],_0x52c704[_0xf782('0x36')]);_0x41e0d1[_0xf782('0x39')]=_[_0xf782('0x38')](_0x52c704[_0xf782('0x32')],qs[_0xf782('0x3a')](_0x1b8352[_0xf782('0x36')][_0xf782('0x3a')]));_0x41e0d1['attributes']=_0x41e0d1[_0xf782('0x39')]['length']?_0x41e0d1[_0xf782('0x39')]:_0x52c704[_0xf782('0x32')];_0x41e0d1[_0xf782('0x4f')]=qs[_0xf782('0x50')](_0x1b8352[_0xf782('0x36')][_0xf782('0x50')]);_0x41e0d1['where']=qs[_0xf782('0x37')](_[_0xf782('0x3f')](_0x1b8352[_0xf782('0x36')],_0x52c704[_0xf782('0x37')]));if(_0x1b8352[_0xf782('0x36')][_0xf782('0x41')]){_0x41e0d1[_0xf782('0x3e')]=_[_0xf782('0x40')](_0x41e0d1[_0xf782('0x3e')],{'$or':_[_0xf782('0x33')](_0x41e0d1[_0xf782('0x39')],function(_0x30cf37){var _0x414579={};_0x414579[_0x30cf37]={'$like':'%'+_0x1b8352[_0xf782('0x36')][_0xf782('0x41')]+'%'};return _0x414579;})});}_0x41e0d1=_['merge']({},_0x41e0d1,_0x1b8352[_0xf782('0x42')]);return _0x3ad9cf[_0xf782('0x4c')](_0x41e0d1);}})[_0xf782('0x28')](function(_0x55bb9e){if(_0x55bb9e){_0x2b91eb=_0x55bb9e['length'];if(!_0x1b8352[_0xf782('0x36')][_0xf782('0x3c')](_0xf782('0x3d'))){_0x41e0d1[_0xf782('0x1e')]=qs[_0xf782('0x1e')](_0x1b8352[_0xf782('0x36')][_0xf782('0x1e')]);_0x41e0d1[_0xf782('0x20')]=qs[_0xf782('0x20')](_0x1b8352[_0xf782('0x36')][_0xf782('0x20')]);}return _0x3ad9cf[_0xf782('0x4c')](_0x41e0d1);}})[_0xf782('0x28')](function(_0x37e406){if(_0x37e406){return _0x37e406?{'count':_0x2b91eb,'rows':_0x37e406}:null;}})[_0xf782('0x28')](respondWithResult(_0x431d9c,null))[_0xf782('0x47')](handleError(_0x431d9c,null));};exports['getSubjects']=function(_0xce9a3e,_0x5e9aac,_0x395794){var _0x1523ed={};var _0x361d12={};var _0xe6ccc7;var _0x5b3a6c;return db[_0xf782('0x2d')]['findOne']({'where':{'id':_0xce9a3e[_0xf782('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e9aac,null))[_0xf782('0x28')](function(_0x53561f){if(_0x53561f){_0xe6ccc7=_0x53561f;_0x361d12[_0xf782('0x32')]=_['keys'](db[_0xf782('0x4e')]['rawAttributes']);_0x361d12[_0xf782('0x36')]=_[_0xf782('0x35')](_0xce9a3e[_0xf782('0x36')]);_0x361d12[_0xf782('0x37')]=_['intersection'](_0x361d12[_0xf782('0x32')],_0x361d12[_0xf782('0x36')]);_0x1523ed[_0xf782('0x39')]=_[_0xf782('0x38')](_0x361d12[_0xf782('0x32')],qs[_0xf782('0x3a')](_0xce9a3e[_0xf782('0x36')][_0xf782('0x3a')]));_0x1523ed[_0xf782('0x39')]=_0x1523ed['attributes'][_0xf782('0x3b')]?_0x1523ed['attributes']:_0x361d12['model'];_0x1523ed['order']=qs[_0xf782('0x50')](_0xce9a3e[_0xf782('0x36')]['sort']);_0x1523ed[_0xf782('0x3e')]=qs[_0xf782('0x37')](_[_0xf782('0x3f')](_0xce9a3e[_0xf782('0x36')],_0x361d12[_0xf782('0x37')]));if(_0xce9a3e['query'][_0xf782('0x41')]){_0x1523ed['where']=_['merge'](_0x1523ed['where'],{'$or':_['map'](_0x1523ed[_0xf782('0x39')],function(_0x15cd9d){var _0xf39f05={};_0xf39f05[_0x15cd9d]={'$like':'%'+_0xce9a3e[_0xf782('0x36')][_0xf782('0x41')]+'%'};return _0xf39f05;})});}_0x1523ed=_['merge']({},_0x1523ed,_0xce9a3e[_0xf782('0x42')]);return _0xe6ccc7['getSubjects'](_0x1523ed);}})[_0xf782('0x28')](function(_0x43626d){if(_0x43626d){_0x5b3a6c=_0x43626d[_0xf782('0x3b')];if(!_0xce9a3e[_0xf782('0x36')][_0xf782('0x3c')]('nolimit')){_0x1523ed[_0xf782('0x1e')]=qs[_0xf782('0x1e')](_0xce9a3e[_0xf782('0x36')]['limit']);_0x1523ed[_0xf782('0x20')]=qs[_0xf782('0x20')](_0xce9a3e[_0xf782('0x36')][_0xf782('0x20')]);}return _0xe6ccc7[_0xf782('0x51')](_0x1523ed);}})[_0xf782('0x28')](function(_0x252c7e){if(_0x252c7e){return _0x252c7e?{'count':_0x5b3a6c,'rows':_0x252c7e}:null;}})[_0xf782('0x28')](respondWithResult(_0x5e9aac,null))['catch'](handleError(_0x5e9aac,null));};exports[_0xf782('0x52')]=function(_0x4d55e7,_0x4d5312,_0x185c80){var _0x693b93={};var _0x189e08={};var _0x106530;var _0x5e5b30;return db['ZohoConfiguration'][_0xf782('0x4d')]({'where':{'id':_0x4d55e7['params']['id']}})[_0xf782('0x28')](handleEntityNotFound(_0x4d5312,null))['then'](function(_0x5046c4){if(_0x5046c4){_0x106530=_0x5046c4;_0x189e08[_0xf782('0x32')]=_[_0xf782('0x35')](db[_0xf782('0x4e')][_0xf782('0x2e')]);_0x189e08[_0xf782('0x36')]=_[_0xf782('0x35')](_0x4d55e7[_0xf782('0x36')]);_0x189e08[_0xf782('0x37')]=_[_0xf782('0x38')](_0x189e08[_0xf782('0x32')],_0x189e08['query']);_0x693b93[_0xf782('0x39')]=_['intersection'](_0x189e08[_0xf782('0x32')],qs[_0xf782('0x3a')](_0x4d55e7['query'][_0xf782('0x3a')]));_0x693b93[_0xf782('0x39')]=_0x693b93[_0xf782('0x39')][_0xf782('0x3b')]?_0x693b93[_0xf782('0x39')]:_0x189e08[_0xf782('0x32')];_0x693b93[_0xf782('0x4f')]=qs[_0xf782('0x50')](_0x4d55e7['query'][_0xf782('0x50')]);_0x693b93[_0xf782('0x3e')]=qs[_0xf782('0x37')](_[_0xf782('0x3f')](_0x4d55e7[_0xf782('0x36')],_0x189e08[_0xf782('0x37')]));if(_0x4d55e7[_0xf782('0x36')]['filter']){_0x693b93[_0xf782('0x3e')]=_[_0xf782('0x40')](_0x693b93[_0xf782('0x3e')],{'$or':_[_0xf782('0x33')](_0x693b93[_0xf782('0x39')],function(_0x26d79d){var _0xf9555a={};_0xf9555a[_0x26d79d]={'$like':'%'+_0x4d55e7['query']['filter']+'%'};return _0xf9555a;})});}_0x693b93=_[_0xf782('0x40')]({},_0x693b93,_0x4d55e7['options']);return _0x106530[_0xf782('0x52')](_0x693b93);}})[_0xf782('0x28')](function(_0x327335){if(_0x327335){_0x5e5b30=_0x327335['length'];if(!_0x4d55e7['query'][_0xf782('0x3c')](_0xf782('0x3d'))){_0x693b93[_0xf782('0x1e')]=qs['limit'](_0x4d55e7['query']['limit']);_0x693b93[_0xf782('0x20')]=qs[_0xf782('0x20')](_0x4d55e7[_0xf782('0x36')][_0xf782('0x20')]);}return _0x106530['getDescriptions'](_0x693b93);}})[_0xf782('0x28')](function(_0x32e536){if(_0x32e536){return _0x32e536?{'count':_0x5e5b30,'rows':_0x32e536}:null;}})[_0xf782('0x28')](respondWithResult(_0x4d5312,null))[_0xf782('0x47')](handleError(_0x4d5312,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 45a4be8..d4d1516 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 _0x60f9=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api'];(function(_0x19f960,_0x5b0870){var _0x4651c0=function(_0x400e9e){while(--_0x400e9e){_0x19f960['push'](_0x19f960['shift']());}};_0x4651c0(++_0x5b0870);}(_0x60f9,0x15c));var _0x960f=function(_0x4aa81d,_0x240495){_0x4aa81d=_0x4aa81d-0x0;var _0x2ba802=_0x60f9[_0x4aa81d];return _0x2ba802;};'use strict';var _=require('lodash');var util=require(_0x960f('0x0'));var logger=require(_0x960f('0x1'))(_0x960f('0x2'));var moment=require('moment');var BPromise=require(_0x960f('0x3'));var rp=require(_0x960f('0x4'));var fs=require('fs');var path=require(_0x960f('0x5'));var rimraf=require(_0x960f('0x6'));var config=require(_0x960f('0x7'));var attributes=require(_0x960f('0x8'));module[_0x960f('0x9')]=function(_0x59a172,_0x3ac803){return _0x59a172[_0x960f('0xa')](_0x960f('0xb'),attributes,{'tableName':_0x960f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5754=['int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','ZohoConfiguration'];(function(_0x6c010c,_0x53d2ed){var _0x16e337=function(_0xa8ee27){while(--_0xa8ee27){_0x6c010c['push'](_0x6c010c['shift']());}};_0x16e337(++_0x53d2ed);}(_0x5754,0x145));var _0x4575=function(_0x598b74,_0xeacf55){_0x598b74=_0x598b74-0x0;var _0x2b1e6c=_0x5754[_0x598b74];return _0x2b1e6c;};'use strict';var _=require(_0x4575('0x0'));var util=require(_0x4575('0x1'));var logger=require(_0x4575('0x2'))(_0x4575('0x3'));var moment=require(_0x4575('0x4'));var BPromise=require(_0x4575('0x5'));var rp=require(_0x4575('0x6'));var fs=require('fs');var path=require(_0x4575('0x7'));var rimraf=require(_0x4575('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x4575('0x9')]=function(_0x237e8e,_0x506969){return _0x237e8e['define'](_0x4575('0xa'),attributes,{'tableName':_0x4575('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index ccd331a..fc34529 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 _0x4800=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5eaa6a,_0x41d4f9){var _0x332a98=function(_0x27e532){while(--_0x27e532){_0x5eaa6a['push'](_0x5eaa6a['shift']());}};_0x332a98(++_0x41d4f9);}(_0x4800,0x1ee));var _0x0480=function(_0x475835,_0x3dd122){_0x475835=_0x475835-0x0;var _0x496aed=_0x4800[_0x475835];return _0x496aed;};'use strict';var _=require(_0x0480('0x0'));var util=require('util');var moment=require(_0x0480('0x1'));var BPromise=require(_0x0480('0x2'));var rs=require(_0x0480('0x3'));var fs=require('fs');var Redis=require(_0x0480('0x4'));var db=require(_0x0480('0x5'))['db'];var utils=require(_0x0480('0x6'));var logger=require(_0x0480('0x7'))(_0x0480('0x8'));var config=require(_0x0480('0x9'));var jayson=require(_0x0480('0xa'));var client=jayson[_0x0480('0xb')][_0x0480('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35c7e9,_0x5aa380,_0x1d4581){return new BPromise(function(_0x3c689a,_0x1143f7){return client[_0x0480('0xd')](_0x35c7e9,_0x1d4581)['then'](function(_0x590a4a){logger[_0x0480('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x5aa380,_0x0480('0xf'));logger[_0x0480('0x10')](_0x0480('0x11'),_0x5aa380,_0x0480('0xf'),JSON[_0x0480('0x12')](_0x590a4a));if(_0x590a4a[_0x0480('0x13')]){if(_0x590a4a[_0x0480('0x13')][_0x0480('0x14')]===0x1f4){logger[_0x0480('0x13')](_0x0480('0x15'),_0x5aa380,_0x590a4a[_0x0480('0x13')][_0x0480('0x16')]);return _0x1143f7(_0x590a4a[_0x0480('0x13')][_0x0480('0x16')]);}logger[_0x0480('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x5aa380,_0x590a4a[_0x0480('0x13')][_0x0480('0x16')]);return _0x3c689a(_0x590a4a['error']['message']);}else{logger[_0x0480('0xe')](_0x0480('0x15'),_0x5aa380,_0x0480('0xf'));_0x3c689a(_0x590a4a[_0x0480('0x17')]['message']);}})[_0x0480('0x18')](function(_0xe10eb6){logger[_0x0480('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x5aa380,_0xe10eb6);_0x1143f7(_0xe10eb6);});});} \ No newline at end of file +var _0x7759=['code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x7759,0xe1));var _0x9775=function(_0x5c5b3f,_0x451d2f){_0x5c5b3f=_0x5c5b3f-0x0;var _0x567a0e=_0x7759[_0x5c5b3f];return _0x567a0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9775('0x0'));var rs=require(_0x9775('0x1'));var fs=require('fs');var Redis=require(_0x9775('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9775('0x3'))('rpc');var config=require(_0x9775('0x4'));var jayson=require(_0x9775('0x5'));var client=jayson[_0x9775('0x6')][_0x9775('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ba38a,_0x4ed211,_0x33de36){return new BPromise(function(_0x5c7604,_0x569717){return client[_0x9775('0x8')](_0x3ba38a,_0x33de36)[_0x9775('0x9')](function(_0x1beeff){logger[_0x9775('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x4ed211,_0x9775('0xb'));logger[_0x9775('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4ed211,_0x9775('0xb'),JSON[_0x9775('0xd')](_0x1beeff));if(_0x1beeff[_0x9775('0xe')]){if(_0x1beeff[_0x9775('0xe')][_0x9775('0xf')]===0x1f4){logger['error'](_0x9775('0x10'),_0x4ed211,_0x1beeff[_0x9775('0xe')]['message']);return _0x569717(_0x1beeff['error']['message']);}logger[_0x9775('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x4ed211,_0x1beeff[_0x9775('0xe')]['message']);return _0x5c7604(_0x1beeff['error'][_0x9775('0x11')]);}else{logger[_0x9775('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x4ed211,_0x9775('0xb'));_0x5c7604(_0x1beeff[_0x9775('0x12')][_0x9775('0x11')]);}})[_0x9775('0x13')](function(_0x56b8fd){logger[_0x9775('0xe')](_0x9775('0x10'),_0x4ed211,_0x56b8fd);_0x569717(_0x56b8fd);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7b05664..d4ff964 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 _0x36c5=['index','/:id','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0x45babf,_0x243f87){var _0x50fc1=function(_0x3bf509){while(--_0x3bf509){_0x45babf['push'](_0x45babf['shift']());}};_0x50fc1(++_0x243f87);}(_0x36c5,0x149));var _0x536c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x536c('0x0'));var util=require(_0x536c('0x1'));var path=require(_0x536c('0x2'));var timeout=require('connect-timeout');var express=require(_0x536c('0x3'));var router=express[_0x536c('0x4')]();var fs_extra=require(_0x536c('0x5'));var auth=require(_0x536c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x536c('0x7'));var controller=require(_0x536c('0x8'));router[_0x536c('0x9')]('/',auth[_0x536c('0xa')](),controller[_0x536c('0xb')]);router[_0x536c('0x9')](_0x536c('0xc'),auth[_0x536c('0xa')](),controller['show']);router['post']('/',auth[_0x536c('0xa')](),controller['create']);router[_0x536c('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x536c('0xe')]);router['delete'](_0x536c('0xc'),auth['isAuthenticated'](),controller[_0x536c('0xf')]);module[_0x536c('0x10')]=router; \ No newline at end of file +var _0xb24b=['update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0xb24b,0x158));var _0xbb24=function(_0x1d9378,_0xb3dd8b){_0x1d9378=_0x1d9378-0x0;var _0x307c99=_0xb24b[_0x1d9378];return _0x307c99;};'use strict';var multer=require(_0xbb24('0x0'));var util=require('util');var path=require(_0xbb24('0x1'));var timeout=require(_0xbb24('0x2'));var express=require(_0xbb24('0x3'));var router=express[_0xbb24('0x4')]();var fs_extra=require(_0xbb24('0x5'));var auth=require(_0xbb24('0x6'));var interaction=require(_0xbb24('0x7'));var config=require(_0xbb24('0x8'));var controller=require(_0xbb24('0x9'));router[_0xbb24('0xa')]('/',auth[_0xbb24('0xb')](),controller[_0xbb24('0xc')]);router[_0xbb24('0xa')](_0xbb24('0xd'),auth[_0xbb24('0xb')](),controller['show']);router[_0xbb24('0xe')]('/',auth[_0xbb24('0xb')](),controller[_0xbb24('0xf')]);router[_0xbb24('0x10')]('/:id',auth[_0xbb24('0xb')](),controller[_0xbb24('0x11')]);router['delete']('/:id',auth[_0xbb24('0xb')](),controller['destroy']);module[_0xbb24('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 6c4e34c..3cab890 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 _0xa1df=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xa1df,0x143));var _0xfa1d=function(_0x1e0741,_0x1b24cd){_0x1e0741=_0x1e0741-0x0;var _0x4ac8dc=_0xa1df[_0x1e0741];return _0x4ac8dc;};'use strict';var Sequelize=require(_0xfa1d('0x0'));module[_0xfa1d('0x1')]={'type':{'type':Sequelize[_0xfa1d('0x2')](_0xfa1d('0x3'),_0xfa1d('0x4'),_0xfa1d('0x5'),_0xfa1d('0x6'),_0xfa1d('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfa1d('0x8')]},'key':{'type':Sequelize[_0xfa1d('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0xfa1d('0x4'),_0xfa1d('0x5'))},'keyContent':{'type':Sequelize[_0xfa1d('0x8')]},'idField':{'type':Sequelize[_0xfa1d('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfa1d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa1d('0x8')]}}; \ No newline at end of file +var _0xcdb3=['customVariable','keyValue','picklist','STRING','sequelize','exports','string','variable'];(function(_0x14d250,_0x4b2e12){var _0xb991d8=function(_0x4ea76d){while(--_0x4ea76d){_0x14d250['push'](_0x14d250['shift']());}};_0xb991d8(++_0x4b2e12);}(_0xcdb3,0x12c));var _0x3cdb=function(_0x3aac0e,_0x14d5cb){_0x3aac0e=_0x3aac0e-0x0;var _0x57bd99=_0xcdb3[_0x3aac0e];return _0x57bd99;};'use strict';var Sequelize=require(_0x3cdb('0x0'));module[_0x3cdb('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3cdb('0x2'),_0x3cdb('0x3'),_0x3cdb('0x4'),_0x3cdb('0x5'),_0x3cdb('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3cdb('0x7')]},'key':{'type':Sequelize[_0x3cdb('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3cdb('0x2'),_0x3cdb('0x3'),_0x3cdb('0x4'))},'keyContent':{'type':Sequelize[_0x3cdb('0x7')]},'idField':{'type':Sequelize[_0x3cdb('0x7')]},'nameField':{'type':Sequelize[_0x3cdb('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3cdb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 5e9e2c6..a8eddd0 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 _0x056d=['stack','name','send','index','ZohoField','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error'];(function(_0x1f8069,_0x10b62c){var _0x1c2603=function(_0x82ca43){while(--_0x82ca43){_0x1f8069['push'](_0x1f8069['shift']());}};_0x1c2603(++_0x10b62c);}(_0x056d,0xa6));var _0xd056=function(_0x12b8a3,_0x3b6d1a){_0x12b8a3=_0x12b8a3-0x0;var _0x5c71df=_0x056d[_0x12b8a3];return _0x5c71df;};'use strict';var emlformat=require(_0xd056('0x0'));var rimraf=require(_0xd056('0x1'));var zipdir=require(_0xd056('0x2'));var jsonpatch=require(_0xd056('0x3'));var rp=require(_0xd056('0x4'));var moment=require(_0xd056('0x5'));var BPromise=require(_0xd056('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd056('0x7'));var sox=require(_0xd056('0x8'));var csv=require(_0xd056('0x9'));var ejs=require(_0xd056('0xa'));var fs=require('fs');var fs_extra=require(_0xd056('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd056('0xc'));var jsforce=require(_0xd056('0xd'));var deskjs=require(_0xd056('0xe'));var toCsv=require(_0xd056('0x9'));var querystring=require(_0xd056('0xf'));var Papa=require('papaparse');var Redis=require(_0xd056('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd056('0x11'));var hardwareService=require(_0xd056('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd056('0x13'))['db'];function respondWithStatusCode(_0x3ff91f,_0x3ba811){_0x3ba811=_0x3ba811||0xcc;return function(_0xcb80ac){if(_0xcb80ac){return _0x3ff91f[_0xd056('0x14')](_0x3ba811);}return _0x3ff91f[_0xd056('0x15')](_0x3ba811)[_0xd056('0x16')]();};}function respondWithResult(_0x39b7d9,_0x44260e){_0x44260e=_0x44260e||0xc8;return function(_0x3e2f09){if(_0x3e2f09){return _0x39b7d9[_0xd056('0x15')](_0x44260e)[_0xd056('0x17')](_0x3e2f09);}};}function respondWithFilteredResult(_0x171bf7,_0x3d5ac2){return function(_0x30ff0e){if(_0x30ff0e){var _0x3f6bdf=typeof _0x3d5ac2[_0xd056('0x18')]===_0xd056('0x19')&&typeof _0x3d5ac2[_0xd056('0x1a')]===_0xd056('0x19');var _0x5b7430=_0x30ff0e['count'];var _0x291ad2=_0x3f6bdf?0x0:_0x3d5ac2[_0xd056('0x18')];var _0x4d187e=_0x3f6bdf?_0x30ff0e[_0xd056('0x1b')]:_0x3d5ac2[_0xd056('0x18')]+_0x3d5ac2['limit'];var _0x1ed921;if(_0x4d187e>=_0x5b7430){_0x4d187e=_0x5b7430;_0x1ed921=0xc8;}else{_0x1ed921=0xce;}_0x171bf7[_0xd056('0x15')](_0x1ed921);return _0x171bf7[_0xd056('0x1c')](_0xd056('0x1d'),_0x291ad2+'-'+_0x4d187e+'/'+_0x5b7430)[_0xd056('0x17')](_0x30ff0e);}return null;};}function patchUpdates(_0x135a8c){return function(_0x21107a){try{jsonpatch['apply'](_0x21107a,_0x135a8c,!![]);}catch(_0xd3a2f1){return BPromise['reject'](_0xd3a2f1);}return _0x21107a[_0xd056('0x1e')]();};}function saveUpdates(_0x8958f6,_0x370085){return function(_0x4406ea){if(_0x4406ea){return _0x4406ea[_0xd056('0x1f')](_0x8958f6)[_0xd056('0x20')](function(_0x944c0b){return _0x944c0b;});}return null;};}function removeEntity(_0x2fa0b5,_0x3b2f9f){return function(_0x5b8a3b){if(_0x5b8a3b){return _0x5b8a3b[_0xd056('0x21')]()[_0xd056('0x20')](function(){_0x2fa0b5[_0xd056('0x15')](0xcc)[_0xd056('0x16')]();});}};}function handleEntityNotFound(_0x44da3d,_0x3c1f1e){return function(_0x4c4bc3){if(!_0x4c4bc3){_0x44da3d[_0xd056('0x14')](0x194);}return _0x4c4bc3;};}function handleError(_0x3f3bc5,_0x56d78f){_0x56d78f=_0x56d78f||0x1f4;return function(_0x189512){logger[_0xd056('0x22')](_0x189512[_0xd056('0x23')]);if(_0x189512[_0xd056('0x24')]){delete _0x189512[_0xd056('0x24')];}_0x3f3bc5['status'](_0x56d78f)[_0xd056('0x25')](_0x189512);};}exports[_0xd056('0x26')]=function(_0x225376,_0x13a4ab){var _0x420cf5={},_0x440bae={},_0x50bf3c={'count':0x0,'rows':[]};var _0x14c18a=_['map'](db[_0xd056('0x27')][_0xd056('0x28')],function(_0x35b885){return{'name':_0x35b885['fieldName'],'type':_0x35b885[_0xd056('0x29')][_0xd056('0x2a')]};});_0x440bae['model']=_[_0xd056('0x2b')](_0x14c18a,_0xd056('0x24'));_0x440bae[_0xd056('0x2c')]=_[_0xd056('0x2d')](_0x225376[_0xd056('0x2c')]);_0x440bae[_0xd056('0x2e')]=_[_0xd056('0x2f')](_0x440bae['model'],_0x440bae['query']);_0x420cf5[_0xd056('0x30')]=_[_0xd056('0x2f')](_0x440bae[_0xd056('0x31')],qs['fields'](_0x225376['query'][_0xd056('0x32')]));_0x420cf5[_0xd056('0x30')]=_0x420cf5[_0xd056('0x30')][_0xd056('0x33')]?_0x420cf5[_0xd056('0x30')]:_0x440bae[_0xd056('0x31')];if(!_0x225376[_0xd056('0x2c')][_0xd056('0x34')]('nolimit')){_0x420cf5[_0xd056('0x1a')]=qs['limit'](_0x225376[_0xd056('0x2c')][_0xd056('0x1a')]);_0x420cf5[_0xd056('0x18')]=qs[_0xd056('0x18')](_0x225376['query'][_0xd056('0x18')]);}_0x420cf5[_0xd056('0x35')]=qs['sort'](_0x225376[_0xd056('0x2c')]['sort']);_0x420cf5[_0xd056('0x36')]=qs[_0xd056('0x2e')](_[_0xd056('0x37')](_0x225376[_0xd056('0x2c')],_0x440bae['filters']),_0x14c18a);if(_0x225376[_0xd056('0x2c')][_0xd056('0x38')]){_0x420cf5[_0xd056('0x36')]=_[_0xd056('0x39')](_0x420cf5[_0xd056('0x36')],{'$or':_[_0xd056('0x2b')](_0x14c18a,function(_0x5c54ef){if(_0x5c54ef[_0xd056('0x29')]!==_0xd056('0x3a')){var _0x4427b5={};_0x4427b5[_0x5c54ef[_0xd056('0x24')]]={'$like':'%'+_0x225376['query'][_0xd056('0x38')]+'%'};return _0x4427b5;}})});}_0x420cf5=_[_0xd056('0x39')]({},_0x420cf5,_0x225376[_0xd056('0x3b')]);var _0x4026da={'where':_0x420cf5['where']};return db[_0xd056('0x27')][_0xd056('0x1b')](_0x4026da)[_0xd056('0x20')](function(_0x5e0d59){_0x50bf3c[_0xd056('0x1b')]=_0x5e0d59;if(_0x225376[_0xd056('0x2c')]['includeAll']){_0x420cf5[_0xd056('0x3c')]=[{'all':!![]}];}return db[_0xd056('0x27')][_0xd056('0x3d')](_0x420cf5);})[_0xd056('0x20')](function(_0x2426e5){_0x50bf3c['rows']=_0x2426e5;return _0x50bf3c;})['then'](respondWithFilteredResult(_0x13a4ab,_0x420cf5))[_0xd056('0x3e')](handleError(_0x13a4ab,null));};exports['show']=function(_0x2fc7d9,_0x4a77e7){var _0x162b23={'raw':!![],'where':{'id':_0x2fc7d9[_0xd056('0x3f')]['id']}},_0x86c248={};_0x86c248[_0xd056('0x31')]=_[_0xd056('0x2d')](db[_0xd056('0x27')][_0xd056('0x28')]);_0x86c248[_0xd056('0x2c')]=_[_0xd056('0x2d')](_0x2fc7d9['query']);_0x86c248[_0xd056('0x2e')]=_['intersection'](_0x86c248[_0xd056('0x31')],_0x86c248['query']);_0x162b23[_0xd056('0x30')]=_[_0xd056('0x2f')](_0x86c248[_0xd056('0x31')],qs[_0xd056('0x32')](_0x2fc7d9[_0xd056('0x2c')][_0xd056('0x32')]));_0x162b23['attributes']=_0x162b23['attributes']['length']?_0x162b23['attributes']:_0x86c248[_0xd056('0x31')];if(_0x2fc7d9[_0xd056('0x2c')]['includeAll']){_0x162b23[_0xd056('0x3c')]=[{'all':!![]}];}_0x162b23=_[_0xd056('0x39')]({},_0x162b23,_0x2fc7d9['options']);return db['ZohoField'][_0xd056('0x40')](_0x162b23)[_0xd056('0x20')](handleEntityNotFound(_0x4a77e7,null))[_0xd056('0x20')](respondWithResult(_0x4a77e7,null))[_0xd056('0x3e')](handleError(_0x4a77e7,null));};exports[_0xd056('0x41')]=function(_0x2f82b4,_0x15cd2f){return db['ZohoField'][_0xd056('0x41')](_0x2f82b4[_0xd056('0x42')],{})[_0xd056('0x20')](respondWithResult(_0x15cd2f,0xc9))['catch'](handleError(_0x15cd2f,null));};exports['update']=function(_0xc3c1b3,_0x47c5be){if(_0xc3c1b3[_0xd056('0x42')]['id']){delete _0xc3c1b3['body']['id'];}return db[_0xd056('0x27')][_0xd056('0x40')]({'where':{'id':_0xc3c1b3['params']['id']}})[_0xd056('0x20')](handleEntityNotFound(_0x47c5be,null))[_0xd056('0x20')](saveUpdates(_0xc3c1b3[_0xd056('0x42')],null))[_0xd056('0x20')](respondWithResult(_0x47c5be,null))['catch'](handleError(_0x47c5be,null));};exports[_0xd056('0x21')]=function(_0xe387b3,_0x1bfa32){return db[_0xd056('0x27')][_0xd056('0x40')]({'where':{'id':_0xe387b3[_0xd056('0x3f')]['id']}})[_0xd056('0x20')](handleEntityNotFound(_0x1bfa32,null))[_0xd056('0x20')](removeEntity(_0x1bfa32,null))['catch'](handleError(_0x1bfa32,null));}; \ No newline at end of file +var _0xe354=['options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','apply','save','update','destroy','then','status','error','stack','index','map','ZohoField','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe354,0x12d));var _0x4e35=function(_0x46647a,_0x36fcfd){_0x46647a=_0x46647a-0x0;var _0xcd199b=_0xe354[_0x46647a];return _0xcd199b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4e35('0x0'));var rp=require(_0x4e35('0x1'));var moment=require(_0x4e35('0x2'));var BPromise=require(_0x4e35('0x3'));var Mustache=require(_0x4e35('0x4'));var util=require(_0x4e35('0x5'));var path=require(_0x4e35('0x6'));var sox=require('sox');var csv=require(_0x4e35('0x7'));var ejs=require(_0x4e35('0x8'));var fs=require('fs');var fs_extra=require(_0x4e35('0x9'));var _=require(_0x4e35('0xa'));var squel=require('squel');var crypto=require(_0x4e35('0xb'));var jsforce=require(_0x4e35('0xc'));var deskjs=require(_0x4e35('0xd'));var toCsv=require(_0x4e35('0x7'));var querystring=require(_0x4e35('0xe'));var Papa=require(_0x4e35('0xf'));var Redis=require(_0x4e35('0x10'));var authService=require(_0x4e35('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e35('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e35('0x13'))(_0x4e35('0x14'));var utils=require(_0x4e35('0x15'));var config=require(_0x4e35('0x16'));var licenseUtil=require(_0x4e35('0x17'));var db=require(_0x4e35('0x18'))['db'];function respondWithStatusCode(_0x191ec0,_0x553a25){_0x553a25=_0x553a25||0xcc;return function(_0x382fd0){if(_0x382fd0){return _0x191ec0[_0x4e35('0x19')](_0x553a25);}return _0x191ec0['status'](_0x553a25)['end']();};}function respondWithResult(_0x2a98e1,_0x47b937){_0x47b937=_0x47b937||0xc8;return function(_0x28d542){if(_0x28d542){return _0x2a98e1['status'](_0x47b937)[_0x4e35('0x1a')](_0x28d542);}};}function respondWithFilteredResult(_0x20aff2,_0x900d99){return function(_0x569f7a){if(_0x569f7a){var _0x44eb7d=typeof _0x900d99[_0x4e35('0x1b')]===_0x4e35('0x1c')&&typeof _0x900d99[_0x4e35('0x1d')]===_0x4e35('0x1c');var _0x5b1d4b=_0x569f7a['count'];var _0x31f249=_0x44eb7d?0x0:_0x900d99[_0x4e35('0x1b')];var _0x39cf18=_0x44eb7d?_0x569f7a[_0x4e35('0x1e')]:_0x900d99[_0x4e35('0x1b')]+_0x900d99[_0x4e35('0x1d')];var _0x1815c7;if(_0x39cf18>=_0x5b1d4b){_0x39cf18=_0x5b1d4b;_0x1815c7=0xc8;}else{_0x1815c7=0xce;}_0x20aff2['status'](_0x1815c7);return _0x20aff2['set']('Content-Range',_0x31f249+'-'+_0x39cf18+'/'+_0x5b1d4b)['json'](_0x569f7a);}return null;};}function patchUpdates(_0x1f11b5){return function(_0x44f937){try{jsonpatch[_0x4e35('0x1f')](_0x44f937,_0x1f11b5,!![]);}catch(_0x30d8ad){return BPromise['reject'](_0x30d8ad);}return _0x44f937[_0x4e35('0x20')]();};}function saveUpdates(_0x43e394,_0x15760b){return function(_0x3ea943){if(_0x3ea943){return _0x3ea943[_0x4e35('0x21')](_0x43e394)['then'](function(_0x41d244){return _0x41d244;});}return null;};}function removeEntity(_0x2afd81,_0x59c536){return function(_0x1fabcb){if(_0x1fabcb){return _0x1fabcb[_0x4e35('0x22')]()[_0x4e35('0x23')](function(){_0x2afd81[_0x4e35('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x173914,_0x1ba284){return function(_0x243fa3){if(!_0x243fa3){_0x173914[_0x4e35('0x19')](0x194);}return _0x243fa3;};}function handleError(_0x3b75e5,_0x234602){_0x234602=_0x234602||0x1f4;return function(_0x41ab41){logger[_0x4e35('0x25')](_0x41ab41[_0x4e35('0x26')]);if(_0x41ab41['name']){delete _0x41ab41['name'];}_0x3b75e5['status'](_0x234602)['send'](_0x41ab41);};}exports[_0x4e35('0x27')]=function(_0x3f3104,_0x46150f){var _0x33632f={},_0x47d28b={},_0x49c0d6={'count':0x0,'rows':[]};var _0x55ad9e=_[_0x4e35('0x28')](db[_0x4e35('0x29')]['rawAttributes'],function(_0x2ed07f){return{'name':_0x2ed07f[_0x4e35('0x2a')],'type':_0x2ed07f[_0x4e35('0x2b')][_0x4e35('0x2c')]};});_0x47d28b[_0x4e35('0x2d')]=_[_0x4e35('0x28')](_0x55ad9e,_0x4e35('0x2e'));_0x47d28b[_0x4e35('0x2f')]=_[_0x4e35('0x30')](_0x3f3104[_0x4e35('0x2f')]);_0x47d28b[_0x4e35('0x31')]=_[_0x4e35('0x32')](_0x47d28b[_0x4e35('0x2d')],_0x47d28b[_0x4e35('0x2f')]);_0x33632f[_0x4e35('0x33')]=_[_0x4e35('0x32')](_0x47d28b[_0x4e35('0x2d')],qs[_0x4e35('0x34')](_0x3f3104[_0x4e35('0x2f')]['fields']));_0x33632f['attributes']=_0x33632f[_0x4e35('0x33')]['length']?_0x33632f[_0x4e35('0x33')]:_0x47d28b[_0x4e35('0x2d')];if(!_0x3f3104[_0x4e35('0x2f')][_0x4e35('0x35')](_0x4e35('0x36'))){_0x33632f[_0x4e35('0x1d')]=qs[_0x4e35('0x1d')](_0x3f3104[_0x4e35('0x2f')][_0x4e35('0x1d')]);_0x33632f[_0x4e35('0x1b')]=qs[_0x4e35('0x1b')](_0x3f3104[_0x4e35('0x2f')][_0x4e35('0x1b')]);}_0x33632f['order']=qs[_0x4e35('0x37')](_0x3f3104[_0x4e35('0x2f')][_0x4e35('0x37')]);_0x33632f[_0x4e35('0x38')]=qs['filters'](_['pick'](_0x3f3104[_0x4e35('0x2f')],_0x47d28b[_0x4e35('0x31')]),_0x55ad9e);if(_0x3f3104['query'][_0x4e35('0x39')]){_0x33632f[_0x4e35('0x38')]=_['merge'](_0x33632f['where'],{'$or':_[_0x4e35('0x28')](_0x55ad9e,function(_0x563b36){if(_0x563b36['type']!==_0x4e35('0x3a')){var _0xbd8a17={};_0xbd8a17[_0x563b36[_0x4e35('0x2e')]]={'$like':'%'+_0x3f3104[_0x4e35('0x2f')]['filter']+'%'};return _0xbd8a17;}})});}_0x33632f=_['merge']({},_0x33632f,_0x3f3104[_0x4e35('0x3b')]);var _0x1e2ad9={'where':_0x33632f[_0x4e35('0x38')]};return db[_0x4e35('0x29')]['count'](_0x1e2ad9)['then'](function(_0x1ca4a8){_0x49c0d6[_0x4e35('0x1e')]=_0x1ca4a8;if(_0x3f3104[_0x4e35('0x2f')][_0x4e35('0x3c')]){_0x33632f[_0x4e35('0x3d')]=[{'all':!![]}];}return db[_0x4e35('0x29')][_0x4e35('0x3e')](_0x33632f);})[_0x4e35('0x23')](function(_0x2a0cbc){_0x49c0d6[_0x4e35('0x3f')]=_0x2a0cbc;return _0x49c0d6;})[_0x4e35('0x23')](respondWithFilteredResult(_0x46150f,_0x33632f))[_0x4e35('0x40')](handleError(_0x46150f,null));};exports[_0x4e35('0x41')]=function(_0x3947a3,_0x382477){var _0x420a56={'raw':!![],'where':{'id':_0x3947a3[_0x4e35('0x42')]['id']}},_0x6f29e2={};_0x6f29e2[_0x4e35('0x2d')]=_[_0x4e35('0x30')](db[_0x4e35('0x29')][_0x4e35('0x43')]);_0x6f29e2[_0x4e35('0x2f')]=_['keys'](_0x3947a3[_0x4e35('0x2f')]);_0x6f29e2[_0x4e35('0x31')]=_['intersection'](_0x6f29e2['model'],_0x6f29e2[_0x4e35('0x2f')]);_0x420a56[_0x4e35('0x33')]=_[_0x4e35('0x32')](_0x6f29e2[_0x4e35('0x2d')],qs[_0x4e35('0x34')](_0x3947a3[_0x4e35('0x2f')]['fields']));_0x420a56[_0x4e35('0x33')]=_0x420a56['attributes'][_0x4e35('0x44')]?_0x420a56[_0x4e35('0x33')]:_0x6f29e2[_0x4e35('0x2d')];if(_0x3947a3[_0x4e35('0x2f')][_0x4e35('0x3c')]){_0x420a56[_0x4e35('0x3d')]=[{'all':!![]}];}_0x420a56=_['merge']({},_0x420a56,_0x3947a3['options']);return db[_0x4e35('0x29')]['find'](_0x420a56)['then'](handleEntityNotFound(_0x382477,null))['then'](respondWithResult(_0x382477,null))['catch'](handleError(_0x382477,null));};exports[_0x4e35('0x45')]=function(_0x90e065,_0x2ef4a4){return db[_0x4e35('0x29')]['create'](_0x90e065['body'],{})['then'](respondWithResult(_0x2ef4a4,0xc9))[_0x4e35('0x40')](handleError(_0x2ef4a4,null));};exports[_0x4e35('0x21')]=function(_0x1f98a6,_0x295238){if(_0x1f98a6[_0x4e35('0x46')]['id']){delete _0x1f98a6[_0x4e35('0x46')]['id'];}return db['ZohoField'][_0x4e35('0x47')]({'where':{'id':_0x1f98a6[_0x4e35('0x42')]['id']}})[_0x4e35('0x23')](handleEntityNotFound(_0x295238,null))['then'](saveUpdates(_0x1f98a6[_0x4e35('0x46')],null))[_0x4e35('0x23')](respondWithResult(_0x295238,null))[_0x4e35('0x40')](handleError(_0x295238,null));};exports[_0x4e35('0x22')]=function(_0x1e6537,_0x305a30){return db[_0x4e35('0x29')]['find']({'where':{'id':_0x1e6537[_0x4e35('0x42')]['id']}})[_0x4e35('0x23')](handleEntityNotFound(_0x305a30,null))[_0x4e35('0x23')](removeEntity(_0x305a30,null))['catch'](handleError(_0x305a30,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b3eec40..49db744 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 _0xa6b0=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise'];(function(_0x437056,_0x1fcbf7){var _0x47703d=function(_0x29ec6){while(--_0x29ec6){_0x437056['push'](_0x437056['shift']());}};_0x47703d(++_0x1fcbf7);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x66e661,_0x11bb45){_0x66e661=_0x66e661-0x0;var _0x4f2621=_0xa6b0[_0x66e661];return _0x4f2621;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));module[_0x0a6b('0x8')]=function(_0x3dc2b0,_0x3b6967){return _0x3dc2b0[_0x0a6b('0x9')](_0x0a6b('0xa'),attributes,{'tableName':_0x0a6b('0xb'),'paranoid':![],'indexes':[{'name':_0x0a6b('0xc'),'fields':[_0x0a6b('0xd'),_0x0a6b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01d9=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'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('0xf'),_0x901d('0x10')],'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 b3b2b15..6be6dd2 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 _0x171f=['error','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0x171f,0xd7));var _0xf171=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x171f[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0xf171('0x0'));var util=require(_0xf171('0x1'));var moment=require('moment');var BPromise=require(_0xf171('0x2'));var rs=require(_0xf171('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf171('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf171('0x5'))(_0xf171('0x6'));var config=require('../../config/environment');var jayson=require(_0xf171('0x7'));var client=jayson['client'][_0xf171('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c0600,_0x34ef02,_0x2568a9){return new BPromise(function(_0x475208,_0x1f9e2a){return client[_0xf171('0x9')](_0x5c0600,_0x2568a9)[_0xf171('0xa')](function(_0x1e0a44){logger[_0xf171('0xb')]('ZohoField,\x20%s,\x20%s',_0x34ef02,_0xf171('0xc'));logger[_0xf171('0xd')](_0xf171('0xe'),_0x34ef02,'request\x20sent',JSON[_0xf171('0xf')](_0x1e0a44));if(_0x1e0a44[_0xf171('0x10')]){if(_0x1e0a44[_0xf171('0x10')]['code']===0x1f4){logger['error'](_0xf171('0x11'),_0x34ef02,_0x1e0a44[_0xf171('0x10')]['message']);return _0x1f9e2a(_0x1e0a44['error'][_0xf171('0x12')]);}logger[_0xf171('0x10')](_0xf171('0x11'),_0x34ef02,_0x1e0a44[_0xf171('0x10')][_0xf171('0x12')]);return _0x475208(_0x1e0a44[_0xf171('0x10')][_0xf171('0x12')]);}else{logger[_0xf171('0xb')](_0xf171('0x11'),_0x34ef02,'request\x20sent');_0x475208(_0x1e0a44[_0xf171('0x13')][_0xf171('0x12')]);}})[_0xf171('0x14')](function(_0x4465f3){logger['error'](_0xf171('0x11'),_0x34ef02,_0x4465f3);_0x1f9e2a(_0x4465f3);});});} \ No newline at end of file +var _0xd997=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','message','error','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xd997,0x1f2));var _0x7d99=function(_0x394879,_0x147fb3){_0x394879=_0x394879-0x0;var _0x5186f8=_0xd997[_0x394879];return _0x5186f8;};'use strict';var _=require(_0x7d99('0x0'));var util=require(_0x7d99('0x1'));var moment=require(_0x7d99('0x2'));var BPromise=require(_0x7d99('0x3'));var rs=require(_0x7d99('0x4'));var fs=require('fs');var Redis=require(_0x7d99('0x5'));var db=require(_0x7d99('0x6'))['db'];var utils=require(_0x7d99('0x7'));var logger=require(_0x7d99('0x8'))(_0x7d99('0x9'));var config=require(_0x7d99('0xa'));var jayson=require(_0x7d99('0xb'));var client=jayson['client'][_0x7d99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cf0f7,_0x3c5a9e,_0x16d0a6){return new BPromise(function(_0x2ac551,_0x4e37c8){return client[_0x7d99('0xd')](_0x1cf0f7,_0x16d0a6)['then'](function(_0x4210fe){logger[_0x7d99('0xe')](_0x7d99('0xf'),_0x3c5a9e,_0x7d99('0x10'));logger['debug'](_0x7d99('0x11'),_0x3c5a9e,_0x7d99('0x10'),JSON[_0x7d99('0x12')](_0x4210fe));if(_0x4210fe['error']){if(_0x4210fe['error']['code']===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x3c5a9e,_0x4210fe['error'][_0x7d99('0x13')]);return _0x4e37c8(_0x4210fe[_0x7d99('0x14')][_0x7d99('0x13')]);}logger[_0x7d99('0x14')](_0x7d99('0xf'),_0x3c5a9e,_0x4210fe[_0x7d99('0x14')][_0x7d99('0x13')]);return _0x2ac551(_0x4210fe[_0x7d99('0x14')][_0x7d99('0x13')]);}else{logger[_0x7d99('0xe')]('ZohoField,\x20%s,\x20%s',_0x3c5a9e,_0x7d99('0x10'));_0x2ac551(_0x4210fe[_0x7d99('0x15')][_0x7d99('0x13')]);}})['catch'](function(_0x536122){logger['error'](_0x7d99('0xf'),_0x3c5a9e,_0x536122);_0x4e37c8(_0x536122);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 449e794..65fcaf8 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x371b64,_0x67b4bb){var _0x3cf3b1=function(_0x362941){while(--_0x362941){_0x371b64['push'](_0x371b64['shift']());}};_0x3cf3b1(++_0x67b4bb);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x28696b,_0x2b4d7f){var _0xe388ed=function(_0x1ed713){while(--_0x1ed713){_0x28696b['push'](_0x28696b['shift']());}};_0xe388ed(++_0x2b4d7f);}(_0x70e0,0x17b));var _0x070e=function(_0x5b62a2,_0x4dfd6b){_0x5b62a2=_0x5b62a2-0x0;var _0x5adc36=_0x70e0[_0x5b62a2];return _0x5adc36;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 0fa58e1..5e359fa 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 _0xff4f=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x143cc6,_0xf94536){var _0x2cedba=function(_0x15a2ad){while(--_0x15a2ad){_0x143cc6['push'](_0x143cc6['shift']());}};_0x2cedba(++_0xf94536);}(_0xff4f,0x19a));var _0xfff4=function(_0x31788e,_0x532de1){_0x31788e=_0x31788e-0x0;var _0x1324bf=_0xff4f[_0x31788e];return _0x1324bf;};'use strict';var Sequelize=require(_0xfff4('0x0'));module[_0xfff4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfff4('0x2')},'version':{'type':Sequelize[_0xfff4('0x3')],'allowNull':![],'unique':_0xfff4('0x2')},'main':{'type':Sequelize[_0xfff4('0x3')],'defaultValue':_0xfff4('0x4')},'filename':{'type':Sequelize[_0xfff4('0x3')]},'path':{'type':Sequelize[_0xfff4('0x3')]},'type':{'type':Sequelize[_0xfff4('0x3')]},'size':{'type':Sequelize[_0xfff4('0x5')]},'active':{'type':Sequelize[_0xfff4('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xfff4('0x3')]},'logo':{'type':Sequelize[_0xfff4('0x3')]},'state':{'type':Sequelize[_0xfff4('0x3')],'unique':_0xfff4('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xfff4('0x3')]},'remoteUri':{'type':Sequelize[_0xfff4('0x3')]},'link':{'type':Sequelize[_0xfff4('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0x8149=['exports','unique_name_and_version','STRING','app.js','BOOLEAN','state','sequelize'];(function(_0x21a30a,_0xfc0e8f){var _0x443cc9=function(_0x31a817){while(--_0x31a817){_0x21a30a['push'](_0x21a30a['shift']());}};_0x443cc9(++_0xfc0e8f);}(_0x8149,0xe6));var _0x9814=function(_0x28fcdc,_0x17e930){_0x28fcdc=_0x28fcdc-0x0;var _0x80bd4c=_0x8149[_0x28fcdc];return _0x80bd4c;};'use strict';var Sequelize=require(_0x9814('0x0'));module[_0x9814('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9814('0x2')},'version':{'type':Sequelize[_0x9814('0x3')],'allowNull':![],'unique':_0x9814('0x2')},'main':{'type':Sequelize[_0x9814('0x3')],'defaultValue':_0x9814('0x4')},'filename':{'type':Sequelize[_0x9814('0x3')]},'path':{'type':Sequelize[_0x9814('0x3')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x9814('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x9814('0x3')]},'logo':{'type':Sequelize[_0x9814('0x3')]},'state':{'type':Sequelize[_0x9814('0x3')],'unique':_0x9814('0x6')},'description':{'type':Sequelize[_0x9814('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x9814('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index a90966a..d38d6d9 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 _0xba34=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3428cc,_0x4521ee){var _0x590a2e=function(_0x38721a){while(--_0x38721a){_0x3428cc['push'](_0x3428cc['shift']());}};_0x590a2e(++_0x4521ee);}(_0xba34,0x119));var _0x4ba3=function(_0x532912,_0xdd4c1e){_0x532912=_0x532912-0x0;var _0x52a85e=_0xba34[_0x532912];return _0x52a85e;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['Integration']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));}; \ No newline at end of file +var _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0xbe05c8,_0x26be13){var _0xbd60ca=function(_0x202473){while(--_0x202473){_0xbe05c8['push'](_0xbe05c8['shift']());}};_0xbd60ca(++_0x26be13);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1a3eb1,_0x1d986e){_0x1a3eb1=_0x1a3eb1-0x0;var _0x457e46=_0xc6ac[_0x1a3eb1];return _0x457e46;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 57171bb..abfadb2 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 _0x246e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','../../config/logger'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x246e,0x77));var _0xe246=function(_0x3d1407,_0x370899){_0x3d1407=_0x3d1407-0x0;var _0x5b435a=_0x246e[_0x3d1407];return _0x5b435a;};'use strict';var _=require(_0xe246('0x0'));var util=require('util');var logger=require(_0xe246('0x1'))(_0xe246('0x2'));var moment=require(_0xe246('0x3'));var BPromise=require(_0xe246('0x4'));var rp=require(_0xe246('0x5'));var fs=require('fs');var path=require(_0xe246('0x6'));var rimraf=require(_0xe246('0x7'));var config=require(_0xe246('0x8'));var attributes=require('./integration.attributes');module[_0xe246('0x9')]=function(_0xf78916,_0x572f95){return _0xf78916[_0xe246('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1b7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','integrations'];(function(_0x42bb7b,_0x136321){var _0x54566a=function(_0x320023){while(--_0x320023){_0x42bb7b['push'](_0x42bb7b['shift']());}};_0x54566a(++_0x136321);}(_0xe1b7,0x1e4));var _0x7e1b=function(_0x461f4c,_0x4c293d){_0x461f4c=_0x461f4c-0x0;var _0x299260=_0xe1b7[_0x461f4c];return _0x299260;};'use strict';var _=require('lodash');var util=require(_0x7e1b('0x0'));var logger=require(_0x7e1b('0x1'))(_0x7e1b('0x2'));var moment=require(_0x7e1b('0x3'));var BPromise=require(_0x7e1b('0x4'));var rp=require(_0x7e1b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e1b('0x6'));var config=require(_0x7e1b('0x7'));var attributes=require('./integration.attributes');module[_0x7e1b('0x8')]=function(_0x898a59,_0x44c261){return _0x898a59[_0x7e1b('0x9')]('Integration',attributes,{'tableName':_0x7e1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index ee5c5a7..ace171a 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 _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x24632f,_0x6fa623){var _0x3f3d22=function(_0x1bc7b8){while(--_0x1bc7b8){_0x24632f['push'](_0x24632f['shift']());}};_0x3f3d22(++_0x6fa623);}(_0x2542,0x169));var _0x2254=function(_0xc655ad,_0xf05e9b){_0xc655ad=_0xc655ad-0x0;var _0x293bd5=_0x2542[_0xc655ad];return _0x293bd5;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2c0705,_0xe7ad25){_0x2c0705=_0x2c0705-0x0;var _0x56f604=_0xc2c7[_0x2c0705];return _0x56f604;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 5c0e324..b3e6102 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 _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xdb28,0x106));var _0x8db2=function(_0xffaf7c,_0x3d53b8){_0xffaf7c=_0xffaf7c-0x0;var _0x324c40=_0xdb28[_0xffaf7c];return _0x324c40;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file +var _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x317d84,_0x55f8f8){var _0x220da2=function(_0x278ffa){while(--_0x278ffa){_0x317d84['push'](_0x317d84['shift']());}};_0x220da2(++_0x55f8f8);}(_0xba34,0x119));var _0x4ba3=function(_0x3fc274,_0x1cd584){_0x3fc274=_0x3fc274-0x0;var _0x3772f3=_0xba34[_0x3fc274];return _0x3772f3;};'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('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 4f69b99..dd4e037 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 _0xfe19=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x5a6ed9,_0x3c9b93){var _0x2689e0=function(_0xe24ad5){while(--_0xe24ad5){_0x5a6ed9['push'](_0x5a6ed9['shift']());}};_0x2689e0(++_0x3c9b93);}(_0xfe19,0x12b));var _0x9fe1=function(_0x326faa,_0x101ab9){_0x326faa=_0x326faa-0x0;var _0xa69da9=_0xfe19[_0x326faa];return _0xa69da9;};'use strict';var Sequelize=require(_0x9fe1('0x0'));module[_0x9fe1('0x1')]={'integration':{'type':Sequelize[_0x9fe1('0x2')]},'eventChannel':{'type':Sequelize[_0x9fe1('0x2')]},'exitStatus':{'type':Sequelize[_0x9fe1('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x9fe1('0x3')]},'contacts':{'type':Sequelize[_0x9fe1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9fe1('0x2')]},'queue':{'type':Sequelize[_0x9fe1('0x2')]},'interface':{'type':Sequelize[_0x9fe1('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x9fe1('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x9fe1('0x3')]},'agentacw':{'type':Sequelize[_0x9fe1('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9fe1('0x3')]},'reason':{'type':Sequelize[_0x9fe1('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9fe1('0x4')]},'agentdump':{'type':Sequelize[_0x9fe1('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x9fe1('0x2')]},'channel':{'type':Sequelize[_0x9fe1('0x2')]},'channelstate':{'type':Sequelize[_0x9fe1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9fe1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9fe1('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9fe1('0x2')]},'accountcode':{'type':Sequelize[_0x9fe1('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x9fe1('0x2')]},'priority':{'type':Sequelize[_0x9fe1('0x2')]},'destchannel':{'type':Sequelize[_0x9fe1('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9fe1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9fe1('0x2')]},'destcalleridname':{'type':Sequelize[_0x9fe1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9fe1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9fe1('0x2')]},'destlanguage':{'type':Sequelize[_0x9fe1('0x2')]},'destaccountcode':{'type':Sequelize[_0x9fe1('0x2')]},'destcontext':{'type':Sequelize[_0x9fe1('0x2')]},'destexten':{'type':Sequelize[_0x9fe1('0x2')]},'destpriority':{'type':Sequelize[_0x9fe1('0x2')]},'destuniqueid':{'type':Sequelize[_0x9fe1('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x9fe1('0x2')]},'from':{'type':Sequelize[_0x9fe1('0x2')]},'to':{'type':Sequelize[_0x9fe1('0x2')]},'cc':{'type':Sequelize[_0x9fe1('0x2')]},'attachment':{'type':Sequelize[_0x9fe1('0x6')]},'html':{'type':Sequelize[_0x9fe1('0x6')]},'text':{'type':Sequelize[_0x9fe1('0x6')]},'status':{'type':Sequelize[_0x9fe1('0x7')](_0x9fe1('0x8'),_0x9fe1('0x9'),_0x9fe1('0xa'),_0x9fe1('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x9fe1('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x9fe1('0x3')]}}; \ No newline at end of file +var _0x8376=['RECEIVED','FAILED','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING'];(function(_0x3efa80,_0x13743e){var _0xfaf149=function(_0x34304c){while(--_0x34304c){_0x3efa80['push'](_0x3efa80['shift']());}};_0xfaf149(++_0x13743e);}(_0x8376,0x1df));var _0x6837=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8376[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x6837('0x0')]},'eventChannel':{'type':Sequelize[_0x6837('0x0')]},'exitStatus':{'type':Sequelize[_0x6837('0x0')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x6837('0x1')]},'contacts':{'type':Sequelize[_0x6837('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6837('0x0')]},'calleridname':{'type':Sequelize[_0x6837('0x0')]},'queue':{'type':Sequelize[_0x6837('0x0')]},'interface':{'type':Sequelize[_0x6837('0x0')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x6837('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x6837('0x1')]},'agentcomplete':{'type':Sequelize[_0x6837('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x6837('0x1')]},'agentacw':{'type':Sequelize[_0x6837('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6837('0x0')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6837('0x2')]},'agentdump':{'type':Sequelize[_0x6837('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6837('0x2')]},'lastevent':{'type':Sequelize[_0x6837('0x0')]},'channel':{'type':Sequelize[_0x6837('0x0')]},'channelstate':{'type':Sequelize[_0x6837('0x1')]},'channelstatedesc':{'type':Sequelize[_0x6837('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6837('0x0')]},'language':{'type':Sequelize[_0x6837('0x0')]},'accountcode':{'type':Sequelize[_0x6837('0x0')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6837('0x0')]},'priority':{'type':Sequelize[_0x6837('0x0')]},'destchannel':{'type':Sequelize[_0x6837('0x0')]},'destchannelstate':{'type':Sequelize[_0x6837('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x6837('0x0')]},'destcalleridnum':{'type':Sequelize[_0x6837('0x0')]},'destcalleridname':{'type':Sequelize[_0x6837('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6837('0x0')]},'destlanguage':{'type':Sequelize[_0x6837('0x0')]},'destaccountcode':{'type':Sequelize[_0x6837('0x0')]},'destcontext':{'type':Sequelize[_0x6837('0x0')]},'destexten':{'type':Sequelize[_0x6837('0x0')]},'destpriority':{'type':Sequelize[_0x6837('0x0')]},'destuniqueid':{'type':Sequelize[_0x6837('0x0')]},'messageId':{'type':Sequelize[_0x6837('0x0')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6837('0x0')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x6837('0x0')]},'cc':{'type':Sequelize[_0x6837('0x0')]},'attachment':{'type':Sequelize[_0x6837('0x4')]},'html':{'type':Sequelize[_0x6837('0x4')]},'text':{'type':Sequelize[_0x6837('0x4')]},'status':{'type':Sequelize[_0x6837('0x5')]('SENT',_0x6837('0x6'),_0x6837('0x7'),_0x6837('0x8'))},'url':{'type':Sequelize[_0x6837('0x0')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x6837('0x1')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 8594753..7812637 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 _0xff90=['save','update','then','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x2c312f,_0x283e76){var _0x563fdc=function(_0xedbe5d){while(--_0xedbe5d){_0x2c312f['push'](_0x2c312f['shift']());}};_0x563fdc(++_0x283e76);}(_0xff90,0x1b5));var _0x0ff9=function(_0x39acf8,_0x158e5a){_0x39acf8=_0x39acf8-0x0;var _0x378ac3=_0xff90[_0x39acf8];return _0x378ac3;};'use strict';var emlformat=require(_0x0ff9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ff9('0x1'));var jsonpatch=require(_0x0ff9('0x2'));var rp=require(_0x0ff9('0x3'));var moment=require(_0x0ff9('0x4'));var BPromise=require(_0x0ff9('0x5'));var Mustache=require(_0x0ff9('0x6'));var util=require(_0x0ff9('0x7'));var path=require('path');var sox=require(_0x0ff9('0x8'));var csv=require(_0x0ff9('0x9'));var ejs=require(_0x0ff9('0xa'));var fs=require('fs');var fs_extra=require(_0x0ff9('0xb'));var _=require(_0x0ff9('0xc'));var squel=require(_0x0ff9('0xd'));var crypto=require(_0x0ff9('0xe'));var jsforce=require(_0x0ff9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0ff9('0x9'));var querystring=require('querystring');var Papa=require(_0x0ff9('0x10'));var Redis=require(_0x0ff9('0x11'));var authService=require(_0x0ff9('0x12'));var qs=require(_0x0ff9('0x13'));var as=require(_0x0ff9('0x14'));var hardwareService=require(_0x0ff9('0x15'));var logger=require(_0x0ff9('0x16'))(_0x0ff9('0x17'));var utils=require(_0x0ff9('0x18'));var config=require(_0x0ff9('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xae8438,_0x5afca2){_0x5afca2=_0x5afca2||0xcc;return function(_0x1565fc){if(_0x1565fc){return _0xae8438['sendStatus'](_0x5afca2);}return _0xae8438[_0x0ff9('0x1a')](_0x5afca2)[_0x0ff9('0x1b')]();};}function respondWithResult(_0x284097,_0x5e4bd4){_0x5e4bd4=_0x5e4bd4||0xc8;return function(_0x1f5509){if(_0x1f5509){return _0x284097['status'](_0x5e4bd4)[_0x0ff9('0x1c')](_0x1f5509);}};}function respondWithFilteredResult(_0x273d1a,_0x2f673c){return function(_0x1d936a){if(_0x1d936a){var _0x993fd7=typeof _0x2f673c[_0x0ff9('0x1d')]===_0x0ff9('0x1e')&&typeof _0x2f673c['limit']===_0x0ff9('0x1e');var _0x4ae9de=_0x1d936a[_0x0ff9('0x1f')];var _0x2bd251=_0x993fd7?0x0:_0x2f673c[_0x0ff9('0x1d')];var _0x1016cc=_0x993fd7?_0x1d936a[_0x0ff9('0x1f')]:_0x2f673c['offset']+_0x2f673c[_0x0ff9('0x20')];var _0x4c1706;if(_0x1016cc>=_0x4ae9de){_0x1016cc=_0x4ae9de;_0x4c1706=0xc8;}else{_0x4c1706=0xce;}_0x273d1a[_0x0ff9('0x1a')](_0x4c1706);return _0x273d1a[_0x0ff9('0x21')](_0x0ff9('0x22'),_0x2bd251+'-'+_0x1016cc+'/'+_0x4ae9de)[_0x0ff9('0x1c')](_0x1d936a);}return null;};}function patchUpdates(_0x551835){return function(_0xc9ed57){try{jsonpatch[_0x0ff9('0x23')](_0xc9ed57,_0x551835,!![]);}catch(_0x247f62){return BPromise[_0x0ff9('0x24')](_0x247f62);}return _0xc9ed57[_0x0ff9('0x25')]();};}function saveUpdates(_0x2cb8a6,_0x6736e9){return function(_0x1e4891){if(_0x1e4891){return _0x1e4891[_0x0ff9('0x26')](_0x2cb8a6)[_0x0ff9('0x27')](function(_0x3fd766){return _0x3fd766;});}return null;};}function removeEntity(_0x3c12f9,_0x5cc730){return function(_0x12951a){if(_0x12951a){return _0x12951a['destroy']()['then'](function(){_0x3c12f9['status'](0xcc)[_0x0ff9('0x1b')]();});}};}function handleEntityNotFound(_0x1b1d71,_0x1cdfb5){return function(_0x570f34){if(!_0x570f34){_0x1b1d71[_0x0ff9('0x28')](0x194);}return _0x570f34;};}function handleError(_0xdd12b2,_0x330e07){_0x330e07=_0x330e07||0x1f4;return function(_0x47e811){logger[_0x0ff9('0x29')](_0x47e811[_0x0ff9('0x2a')]);if(_0x47e811['name']){delete _0x47e811[_0x0ff9('0x2b')];}_0xdd12b2[_0x0ff9('0x1a')](_0x330e07)[_0x0ff9('0x2c')](_0x47e811);};}exports[_0x0ff9('0x2d')]=function(_0x349094,_0x43fd3b){var _0x246689={},_0x110c1a={},_0x252b18={'count':0x0,'rows':[]};var _0x5492f7=_[_0x0ff9('0x2e')](db[_0x0ff9('0x2f')][_0x0ff9('0x30')],function(_0x4dc2fc){return{'name':_0x4dc2fc[_0x0ff9('0x31')],'type':_0x4dc2fc[_0x0ff9('0x32')][_0x0ff9('0x33')]};});_0x110c1a[_0x0ff9('0x34')]=_[_0x0ff9('0x2e')](_0x5492f7,_0x0ff9('0x2b'));_0x110c1a[_0x0ff9('0x35')]=_[_0x0ff9('0x36')](_0x349094['query']);_0x110c1a['filters']=_['intersection'](_0x110c1a[_0x0ff9('0x34')],_0x110c1a[_0x0ff9('0x35')]);_0x246689['attributes']=_[_0x0ff9('0x37')](_0x110c1a[_0x0ff9('0x34')],qs[_0x0ff9('0x38')](_0x349094[_0x0ff9('0x35')]['fields']));_0x246689[_0x0ff9('0x39')]=_0x246689[_0x0ff9('0x39')][_0x0ff9('0x3a')]?_0x246689[_0x0ff9('0x39')]:_0x110c1a[_0x0ff9('0x34')];if(!_0x349094[_0x0ff9('0x35')][_0x0ff9('0x3b')](_0x0ff9('0x3c'))){_0x246689[_0x0ff9('0x20')]=qs['limit'](_0x349094['query'][_0x0ff9('0x20')]);_0x246689[_0x0ff9('0x1d')]=qs[_0x0ff9('0x1d')](_0x349094['query'][_0x0ff9('0x1d')]);}_0x246689['order']=qs[_0x0ff9('0x3d')](_0x349094[_0x0ff9('0x35')]['sort']);_0x246689[_0x0ff9('0x3e')]=qs[_0x0ff9('0x3f')](_[_0x0ff9('0x40')](_0x349094[_0x0ff9('0x35')],_0x110c1a[_0x0ff9('0x3f')]),_0x5492f7);if(_0x349094[_0x0ff9('0x35')]['filter']){_0x246689['where']=_[_0x0ff9('0x41')](_0x246689[_0x0ff9('0x3e')],{'$or':_[_0x0ff9('0x2e')](_0x5492f7,function(_0x449135){if(_0x449135[_0x0ff9('0x32')]!==_0x0ff9('0x42')){var _0xbec7b1={};_0xbec7b1[_0x449135[_0x0ff9('0x2b')]]={'$like':'%'+_0x349094[_0x0ff9('0x35')][_0x0ff9('0x43')]+'%'};return _0xbec7b1;}})});}_0x246689=_[_0x0ff9('0x41')]({},_0x246689,_0x349094[_0x0ff9('0x44')]);var _0x2ce535={'where':_0x246689[_0x0ff9('0x3e')]};return db['IntegrationReport'][_0x0ff9('0x1f')](_0x2ce535)[_0x0ff9('0x27')](function(_0x18c369){_0x252b18[_0x0ff9('0x1f')]=_0x18c369;if(_0x349094[_0x0ff9('0x35')][_0x0ff9('0x45')]){_0x246689[_0x0ff9('0x46')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x246689);})[_0x0ff9('0x27')](function(_0x230d08){_0x252b18[_0x0ff9('0x47')]=_0x230d08;return _0x252b18;})['then'](respondWithFilteredResult(_0x43fd3b,_0x246689))[_0x0ff9('0x48')](handleError(_0x43fd3b,null));};exports[_0x0ff9('0x49')]=function(_0x25c8a8,_0x2cc31d){var _0x43b3ad={'raw':![],'where':{'id':_0x25c8a8['params']['id']}},_0x4c5b3d={};_0x4c5b3d['model']=_[_0x0ff9('0x36')](db[_0x0ff9('0x2f')][_0x0ff9('0x30')]);_0x4c5b3d[_0x0ff9('0x35')]=_[_0x0ff9('0x36')](_0x25c8a8['query']);_0x4c5b3d[_0x0ff9('0x3f')]=_[_0x0ff9('0x37')](_0x4c5b3d[_0x0ff9('0x34')],_0x4c5b3d['query']);_0x43b3ad[_0x0ff9('0x39')]=_[_0x0ff9('0x37')](_0x4c5b3d[_0x0ff9('0x34')],qs[_0x0ff9('0x38')](_0x25c8a8[_0x0ff9('0x35')]['fields']));_0x43b3ad['attributes']=_0x43b3ad['attributes'][_0x0ff9('0x3a')]?_0x43b3ad[_0x0ff9('0x39')]:_0x4c5b3d[_0x0ff9('0x34')];if(_0x25c8a8[_0x0ff9('0x35')]['includeAll']){_0x43b3ad[_0x0ff9('0x46')]=[{'all':!![]}];}_0x43b3ad=_[_0x0ff9('0x41')]({},_0x43b3ad,_0x25c8a8[_0x0ff9('0x44')]);return db['IntegrationReport']['find'](_0x43b3ad)[_0x0ff9('0x27')](handleEntityNotFound(_0x2cc31d,null))[_0x0ff9('0x27')](respondWithResult(_0x2cc31d,null))[_0x0ff9('0x48')](handleError(_0x2cc31d,null));};exports[_0x0ff9('0x4a')]=function(_0x5967f5,_0x3a1565){return db['IntegrationReport']['create'](_0x5967f5['body'],{})[_0x0ff9('0x27')](respondWithResult(_0x3a1565,0xc9))['catch'](handleError(_0x3a1565,null));};exports[_0x0ff9('0x26')]=function(_0x5e861f,_0x29accd){if(_0x5e861f[_0x0ff9('0x4b')]['id']){delete _0x5e861f[_0x0ff9('0x4b')]['id'];}return db[_0x0ff9('0x2f')][_0x0ff9('0x4c')]({'where':{'id':_0x5e861f[_0x0ff9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29accd,null))[_0x0ff9('0x27')](saveUpdates(_0x5e861f['body'],null))['then'](respondWithResult(_0x29accd,null))[_0x0ff9('0x48')](handleError(_0x29accd,null));};exports['destroy']=function(_0x4810bc,_0x9fd2c0){return db[_0x0ff9('0x2f')][_0x0ff9('0x4c')]({'where':{'id':_0x4810bc[_0x0ff9('0x4d')]['id']}})[_0x0ff9('0x27')](handleEntityNotFound(_0x9fd2c0,null))[_0x0ff9('0x27')](removeEntity(_0x9fd2c0,null))[_0x0ff9('0x48')](handleError(_0x9fd2c0,null));};exports[_0x0ff9('0x4e')]=function(_0x31c2c4,_0x347a0f){return db['IntegrationReport'][_0x0ff9('0x4e')]()[_0x0ff9('0x27')](respondWithResult(_0x347a0f,null))[_0x0ff9('0x48')](handleError(_0x347a0f,null));}; \ No newline at end of file +var _0x9936=['includeAll','include','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','rimraf','request-promise','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','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0xa38cf2,_0x13e769){var _0x1c9a57=function(_0x3fdbd5){while(--_0x3fdbd5){_0xa38cf2['push'](_0xa38cf2['shift']());}};_0x1c9a57(++_0x13e769);}(_0x9936,0x1cd));var _0x6993=function(_0x29e3e4,_0x370df9){_0x29e3e4=_0x29e3e4-0x0;var _0x4f98e7=_0x9936[_0x29e3e4];return _0x4f98e7;};'use strict';var emlformat=require(_0x6993('0x0'));var rimraf=require(_0x6993('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6993('0x2'));var moment=require(_0x6993('0x3'));var BPromise=require(_0x6993('0x4'));var Mustache=require(_0x6993('0x5'));var util=require(_0x6993('0x6'));var path=require(_0x6993('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6993('0x8'));var fs=require('fs');var fs_extra=require(_0x6993('0x9'));var _=require(_0x6993('0xa'));var squel=require('squel');var crypto=require(_0x6993('0xb'));var jsforce=require(_0x6993('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6993('0xd'));var querystring=require(_0x6993('0xe'));var Papa=require(_0x6993('0xf'));var Redis=require(_0x6993('0x10'));var authService=require(_0x6993('0x11'));var qs=require(_0x6993('0x12'));var as=require(_0x6993('0x13'));var hardwareService=require(_0x6993('0x14'));var logger=require(_0x6993('0x15'))(_0x6993('0x16'));var utils=require('../../config/utils');var config=require(_0x6993('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x292a0e,_0x4deddc){_0x4deddc=_0x4deddc||0xcc;return function(_0x6c3db4){if(_0x6c3db4){return _0x292a0e[_0x6993('0x18')](_0x4deddc);}return _0x292a0e[_0x6993('0x19')](_0x4deddc)[_0x6993('0x1a')]();};}function respondWithResult(_0x563dc8,_0x44384c){_0x44384c=_0x44384c||0xc8;return function(_0x368517){if(_0x368517){return _0x563dc8['status'](_0x44384c)[_0x6993('0x1b')](_0x368517);}};}function respondWithFilteredResult(_0x13917a,_0x53d910){return function(_0x5f4587){if(_0x5f4587){var _0x14c18f=typeof _0x53d910[_0x6993('0x1c')]===_0x6993('0x1d')&&typeof _0x53d910[_0x6993('0x1e')]===_0x6993('0x1d');var _0x58f935=_0x5f4587['count'];var _0x1c2c0f=_0x14c18f?0x0:_0x53d910[_0x6993('0x1c')];var _0x53b6de=_0x14c18f?_0x5f4587[_0x6993('0x1f')]:_0x53d910[_0x6993('0x1c')]+_0x53d910[_0x6993('0x1e')];var _0x2eed7f;if(_0x53b6de>=_0x58f935){_0x53b6de=_0x58f935;_0x2eed7f=0xc8;}else{_0x2eed7f=0xce;}_0x13917a[_0x6993('0x19')](_0x2eed7f);return _0x13917a['set'](_0x6993('0x20'),_0x1c2c0f+'-'+_0x53b6de+'/'+_0x58f935)[_0x6993('0x1b')](_0x5f4587);}return null;};}function patchUpdates(_0x45f035){return function(_0x54ab5b){try{jsonpatch[_0x6993('0x21')](_0x54ab5b,_0x45f035,!![]);}catch(_0x4f6494){return BPromise[_0x6993('0x22')](_0x4f6494);}return _0x54ab5b['save']();};}function saveUpdates(_0x365c0d,_0x16d537){return function(_0x370bd4){if(_0x370bd4){return _0x370bd4[_0x6993('0x23')](_0x365c0d)[_0x6993('0x24')](function(_0x250f13){return _0x250f13;});}return null;};}function removeEntity(_0x2901ba,_0xc2ecb2){return function(_0x2f33e4){if(_0x2f33e4){return _0x2f33e4['destroy']()['then'](function(){_0x2901ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20d195,_0x3e9385){return function(_0x2fd9ea){if(!_0x2fd9ea){_0x20d195[_0x6993('0x18')](0x194);}return _0x2fd9ea;};}function handleError(_0x215a3f,_0x39180e){_0x39180e=_0x39180e||0x1f4;return function(_0x28dddf){logger[_0x6993('0x25')](_0x28dddf[_0x6993('0x26')]);if(_0x28dddf['name']){delete _0x28dddf['name'];}_0x215a3f[_0x6993('0x19')](_0x39180e)[_0x6993('0x27')](_0x28dddf);};}exports[_0x6993('0x28')]=function(_0x44cf19,_0x2cfd3f){var _0x196176={},_0x406149={},_0x1ffd93={'count':0x0,'rows':[]};var _0x478bfd=_[_0x6993('0x29')](db[_0x6993('0x2a')][_0x6993('0x2b')],function(_0x5148a3){return{'name':_0x5148a3[_0x6993('0x2c')],'type':_0x5148a3[_0x6993('0x2d')][_0x6993('0x2e')]};});_0x406149['model']=_[_0x6993('0x29')](_0x478bfd,_0x6993('0x2f'));_0x406149[_0x6993('0x30')]=_['keys'](_0x44cf19[_0x6993('0x30')]);_0x406149[_0x6993('0x31')]=_[_0x6993('0x32')](_0x406149[_0x6993('0x33')],_0x406149['query']);_0x196176[_0x6993('0x34')]=_[_0x6993('0x32')](_0x406149[_0x6993('0x33')],qs[_0x6993('0x35')](_0x44cf19[_0x6993('0x30')]['fields']));_0x196176[_0x6993('0x34')]=_0x196176[_0x6993('0x34')][_0x6993('0x36')]?_0x196176[_0x6993('0x34')]:_0x406149[_0x6993('0x33')];if(!_0x44cf19[_0x6993('0x30')][_0x6993('0x37')]('nolimit')){_0x196176[_0x6993('0x1e')]=qs[_0x6993('0x1e')](_0x44cf19['query']['limit']);_0x196176[_0x6993('0x1c')]=qs[_0x6993('0x1c')](_0x44cf19['query'][_0x6993('0x1c')]);}_0x196176[_0x6993('0x38')]=qs[_0x6993('0x39')](_0x44cf19[_0x6993('0x30')][_0x6993('0x39')]);_0x196176[_0x6993('0x3a')]=qs[_0x6993('0x31')](_[_0x6993('0x3b')](_0x44cf19[_0x6993('0x30')],_0x406149['filters']),_0x478bfd);if(_0x44cf19['query'][_0x6993('0x3c')]){_0x196176[_0x6993('0x3a')]=_[_0x6993('0x3d')](_0x196176[_0x6993('0x3a')],{'$or':_[_0x6993('0x29')](_0x478bfd,function(_0x161b75){if(_0x161b75[_0x6993('0x2d')]!==_0x6993('0x3e')){var _0x1df7f8={};_0x1df7f8[_0x161b75['name']]={'$like':'%'+_0x44cf19[_0x6993('0x30')][_0x6993('0x3c')]+'%'};return _0x1df7f8;}})});}_0x196176=_[_0x6993('0x3d')]({},_0x196176,_0x44cf19[_0x6993('0x3f')]);var _0x31fc8c={'where':_0x196176['where']};return db[_0x6993('0x2a')][_0x6993('0x1f')](_0x31fc8c)[_0x6993('0x24')](function(_0x296dd4){_0x1ffd93[_0x6993('0x1f')]=_0x296dd4;if(_0x44cf19['query'][_0x6993('0x40')]){_0x196176[_0x6993('0x41')]=[{'all':!![]}];}return db[_0x6993('0x2a')]['findAll'](_0x196176);})[_0x6993('0x24')](function(_0x1d4590){_0x1ffd93[_0x6993('0x42')]=_0x1d4590;return _0x1ffd93;})[_0x6993('0x24')](respondWithFilteredResult(_0x2cfd3f,_0x196176))[_0x6993('0x43')](handleError(_0x2cfd3f,null));};exports['show']=function(_0x1e3185,_0x4db646){var _0x867cb9={'raw':![],'where':{'id':_0x1e3185['params']['id']}},_0x394a96={};_0x394a96[_0x6993('0x33')]=_['keys'](db[_0x6993('0x2a')]['rawAttributes']);_0x394a96['query']=_[_0x6993('0x44')](_0x1e3185[_0x6993('0x30')]);_0x394a96[_0x6993('0x31')]=_['intersection'](_0x394a96[_0x6993('0x33')],_0x394a96[_0x6993('0x30')]);_0x867cb9[_0x6993('0x34')]=_[_0x6993('0x32')](_0x394a96[_0x6993('0x33')],qs[_0x6993('0x35')](_0x1e3185[_0x6993('0x30')][_0x6993('0x35')]));_0x867cb9[_0x6993('0x34')]=_0x867cb9[_0x6993('0x34')][_0x6993('0x36')]?_0x867cb9['attributes']:_0x394a96[_0x6993('0x33')];if(_0x1e3185['query']['includeAll']){_0x867cb9[_0x6993('0x41')]=[{'all':!![]}];}_0x867cb9=_[_0x6993('0x3d')]({},_0x867cb9,_0x1e3185[_0x6993('0x3f')]);return db[_0x6993('0x2a')][_0x6993('0x45')](_0x867cb9)['then'](handleEntityNotFound(_0x4db646,null))[_0x6993('0x24')](respondWithResult(_0x4db646,null))[_0x6993('0x43')](handleError(_0x4db646,null));};exports[_0x6993('0x46')]=function(_0xefa85c,_0x215c74){return db[_0x6993('0x2a')][_0x6993('0x46')](_0xefa85c[_0x6993('0x47')],{})['then'](respondWithResult(_0x215c74,0xc9))[_0x6993('0x43')](handleError(_0x215c74,null));};exports[_0x6993('0x23')]=function(_0x44fbee,_0x370134){if(_0x44fbee[_0x6993('0x47')]['id']){delete _0x44fbee[_0x6993('0x47')]['id'];}return db[_0x6993('0x2a')][_0x6993('0x45')]({'where':{'id':_0x44fbee[_0x6993('0x48')]['id']}})['then'](handleEntityNotFound(_0x370134,null))[_0x6993('0x24')](saveUpdates(_0x44fbee[_0x6993('0x47')],null))[_0x6993('0x24')](respondWithResult(_0x370134,null))[_0x6993('0x43')](handleError(_0x370134,null));};exports[_0x6993('0x49')]=function(_0x219bb1,_0x524982){return db[_0x6993('0x2a')][_0x6993('0x45')]({'where':{'id':_0x219bb1[_0x6993('0x48')]['id']}})[_0x6993('0x24')](handleEntityNotFound(_0x524982,null))[_0x6993('0x24')](removeEntity(_0x524982,null))['catch'](handleError(_0x524982,null));};exports[_0x6993('0x4a')]=function(_0x47e583,_0x5698aa){return db[_0x6993('0x2a')][_0x6993('0x4a')]()[_0x6993('0x24')](respondWithResult(_0x5698aa,null))['catch'](handleError(_0x5698aa,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index ccf5982..6ce6744 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 _0x9626=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','../../config/logger','moment'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x9626,0x1c0));var _0x6962=function(_0x5f4856,_0x2b0ef4){_0x5f4856=_0x5f4856-0x0;var _0x14bde0=_0x9626[_0x5f4856];return _0x14bde0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6962('0x0'))('api');var moment=require(_0x6962('0x1'));var BPromise=require('bluebird');var rp=require(_0x6962('0x2'));var fs=require('fs');var path=require(_0x6962('0x3'));var rimraf=require(_0x6962('0x4'));var config=require(_0x6962('0x5'));var attributes=require(_0x6962('0x6'));module[_0x6962('0x7')]=function(_0x20d88b,_0x2620ff){return _0x20d88b[_0x6962('0x8')](_0x6962('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc782=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','exports','IntegrationReport','report_integration'];(function(_0xbacbce,_0x5a00d2){var _0x1d6985=function(_0x2d3793){while(--_0x2d3793){_0xbacbce['push'](_0xbacbce['shift']());}};_0x1d6985(++_0x5a00d2);}(_0xc782,0x78));var _0x2c78=function(_0x32bce8,_0x54f965){_0x32bce8=_0x32bce8-0x0;var _0x38badc=_0xc782[_0x32bce8];return _0x38badc;};'use strict';var _=require(_0x2c78('0x0'));var util=require('util');var logger=require(_0x2c78('0x1'))(_0x2c78('0x2'));var moment=require(_0x2c78('0x3'));var BPromise=require(_0x2c78('0x4'));var rp=require(_0x2c78('0x5'));var fs=require('fs');var path=require(_0x2c78('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x2c78('0x7')]=function(_0x4663d0,_0x150bd7){return _0x4663d0['define'](_0x2c78('0x8'),attributes,{'tableName':_0x2c78('0x9'),'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 2ba38e8..932d8c5 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x276f9c,_0xff5f95){var _0x1a0ed0=function(_0x36c993){while(--_0x36c993){_0x276f9c['push'](_0x276f9c['shift']());}};_0x1a0ed0(++_0xff5f95);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var 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')]('IntegrationReport,\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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x53ec,0x192));var _0xc53e=function(_0xe1b2a8,_0x38f786){_0xe1b2a8=_0xe1b2a8-0x0;var _0x554804=_0x53ec[_0xe1b2a8];return _0x554804;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index dad51e8..b0dc93a 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 _0xcbe7=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete'];(function(_0x4f9179,_0x37e883){var _0x19b688=function(_0x5ae252){while(--_0x5ae252){_0x4f9179['push'](_0x4f9179['shift']());}};_0x19b688(++_0x37e883);}(_0xcbe7,0x152));var _0x7cbe=function(_0x482a05,_0x26587c){_0x482a05=_0x482a05-0x0;var _0x301672=_0xcbe7[_0x482a05];return _0x301672;};'use strict';var multer=require('multer');var util=require(_0x7cbe('0x0'));var path=require(_0x7cbe('0x1'));var timeout=require(_0x7cbe('0x2'));var express=require(_0x7cbe('0x3'));var router=express[_0x7cbe('0x4')]();var fs_extra=require(_0x7cbe('0x5'));var auth=require(_0x7cbe('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7cbe('0x7'));var controller=require('./interval.controller');router['get']('/',auth[_0x7cbe('0x8')](),controller[_0x7cbe('0x9')]);router[_0x7cbe('0xa')](_0x7cbe('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7cbe('0xa')](_0x7cbe('0xc'),auth[_0x7cbe('0x8')](),controller[_0x7cbe('0xd')]);router[_0x7cbe('0xe')]('/',auth['isAuthenticated'](),controller[_0x7cbe('0xf')]);router['post'](_0x7cbe('0xc'),auth[_0x7cbe('0x8')](),controller[_0x7cbe('0x10')]);router['post'](_0x7cbe('0x11'),auth[_0x7cbe('0x8')](),controller[_0x7cbe('0x12')]);router[_0x7cbe('0x13')](_0x7cbe('0xb'),auth[_0x7cbe('0x8')](),controller[_0x7cbe('0x14')]);router[_0x7cbe('0x15')]('/:id',auth[_0x7cbe('0x8')](),controller[_0x7cbe('0x16')]);module[_0x7cbe('0x17')]=router; \ No newline at end of file +var _0xbc61=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update'];(function(_0x40ed25,_0x98647b){var _0x2ab31f=function(_0x1dc3b9){while(--_0x1dc3b9){_0x40ed25['push'](_0x40ed25['shift']());}};_0x2ab31f(++_0x98647b);}(_0xbc61,0x1b2));var _0x1bc6=function(_0x485c7e,_0x5aff76){_0x485c7e=_0x485c7e-0x0;var _0x3808f7=_0xbc61[_0x485c7e];return _0x3808f7;};'use strict';var multer=require(_0x1bc6('0x0'));var util=require(_0x1bc6('0x1'));var path=require(_0x1bc6('0x2'));var timeout=require(_0x1bc6('0x3'));var express=require('express');var router=express[_0x1bc6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1bc6('0x5'));var interaction=require(_0x1bc6('0x6'));var config=require('../../config/environment');var controller=require(_0x1bc6('0x7'));router[_0x1bc6('0x8')]('/',auth[_0x1bc6('0x9')](),controller[_0x1bc6('0xa')]);router['get'](_0x1bc6('0xb'),auth[_0x1bc6('0x9')](),controller[_0x1bc6('0xc')]);router[_0x1bc6('0x8')](_0x1bc6('0xd'),auth[_0x1bc6('0x9')](),controller[_0x1bc6('0xe')]);router['post']('/',auth[_0x1bc6('0x9')](),controller[_0x1bc6('0xf')]);router[_0x1bc6('0x10')](_0x1bc6('0xd'),auth[_0x1bc6('0x9')](),controller[_0x1bc6('0x11')]);router[_0x1bc6('0x10')](_0x1bc6('0x12'),auth[_0x1bc6('0x9')](),controller[_0x1bc6('0x13')]);router[_0x1bc6('0x14')](_0x1bc6('0xb'),auth['isAuthenticated'](),controller[_0x1bc6('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1bc6('0x16')]);module[_0x1bc6('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 21a19fc..cb37082 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 _0x497b=['sequelize','exports','STRING'];(function(_0x13b77e,_0x2c6842){var _0x31adf3=function(_0x3601f4){while(--_0x3601f4){_0x13b77e['push'](_0x13b77e['shift']());}};_0x31adf3(++_0x2c6842);}(_0x497b,0xe1));var _0xb497=function(_0x58365f,_0x26f02b){_0x58365f=_0x58365f-0x0;var _0x295b3c=_0x497b[_0x58365f];return _0x295b3c;};'use strict';var Sequelize=require(_0xb497('0x0'));module[_0xb497('0x1')]={'name':{'type':Sequelize[_0xb497('0x2')]},'description':{'type':Sequelize[_0xb497('0x2')]},'interval':{'type':Sequelize[_0xb497('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xfcd8=['sequelize','exports','STRING'];(function(_0x5977f2,_0x1a8641){var _0x2ac84f=function(_0x32274c){while(--_0x32274c){_0x5977f2['push'](_0x5977f2['shift']());}};_0x2ac84f(++_0x1a8641);}(_0xfcd8,0xa5));var _0x8fcd=function(_0x592f7d,_0x51b79a){_0x592f7d=_0x592f7d-0x0;var _0x3f9008=_0xfcd8[_0x592f7d];return _0x3f9008;};'use strict';var Sequelize=require(_0x8fcd('0x0'));module[_0x8fcd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8fcd('0x2')]},'interval':{'type':Sequelize[_0x8fcd('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 6d0b11c..8c35d19 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 _0x0314=['count','limit','set','apply','reject','save','then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','Interval','findAll','rows','show','params','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','IntervalId','getIntervals','findOne','rawAttributes','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined'];(function(_0x17f9c5,_0x328935){var _0x311969=function(_0x4c1ecf){while(--_0x4c1ecf){_0x17f9c5['push'](_0x17f9c5['shift']());}};_0x311969(++_0x328935);}(_0x0314,0x152));var _0x4031=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0314[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4031('0x0'));var zipdir=require(_0x4031('0x1'));var jsonpatch=require(_0x4031('0x2'));var rp=require(_0x4031('0x3'));var moment=require(_0x4031('0x4'));var BPromise=require(_0x4031('0x5'));var Mustache=require(_0x4031('0x6'));var util=require(_0x4031('0x7'));var path=require('path');var sox=require(_0x4031('0x8'));var csv=require(_0x4031('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4031('0xa'));var _=require(_0x4031('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4031('0xc'));var deskjs=require(_0x4031('0xd'));var toCsv=require(_0x4031('0x9'));var querystring=require(_0x4031('0xe'));var Papa=require(_0x4031('0xf'));var Redis=require(_0x4031('0x10'));var authService=require(_0x4031('0x11'));var qs=require(_0x4031('0x12'));var as=require(_0x4031('0x13'));var hardwareService=require(_0x4031('0x14'));var logger=require(_0x4031('0x15'))(_0x4031('0x16'));var utils=require(_0x4031('0x17'));var config=require(_0x4031('0x18'));var licenseUtil=require(_0x4031('0x19'));var db=require(_0x4031('0x1a'))['db'];var extensions=require(_0x4031('0x1b'));function respondWithStatusCode(_0x4d6f19,_0x424e3a){_0x424e3a=_0x424e3a||0xcc;return function(_0x2e8170){if(_0x2e8170){return _0x4d6f19[_0x4031('0x1c')](_0x424e3a);}return _0x4d6f19[_0x4031('0x1d')](_0x424e3a)[_0x4031('0x1e')]();};}function respondWithResult(_0x45eefc,_0xf5f7d4){_0xf5f7d4=_0xf5f7d4||0xc8;return function(_0x354435){if(_0x354435){return _0x45eefc[_0x4031('0x1d')](_0xf5f7d4)[_0x4031('0x1f')](_0x354435);}};}function respondWithFilteredResult(_0x37fee0,_0x411dd0){return function(_0x5c0262){if(_0x5c0262){var _0x3e1401=typeof _0x411dd0[_0x4031('0x20')]===_0x4031('0x21')&&typeof _0x411dd0['limit']===_0x4031('0x21');var _0x57a5f0=_0x5c0262['count'];var _0x577d7b=_0x3e1401?0x0:_0x411dd0[_0x4031('0x20')];var _0x1e8056=_0x3e1401?_0x5c0262[_0x4031('0x22')]:_0x411dd0['offset']+_0x411dd0[_0x4031('0x23')];var _0x57c977;if(_0x1e8056>=_0x57a5f0){_0x1e8056=_0x57a5f0;_0x57c977=0xc8;}else{_0x57c977=0xce;}_0x37fee0[_0x4031('0x1d')](_0x57c977);return _0x37fee0[_0x4031('0x24')]('Content-Range',_0x577d7b+'-'+_0x1e8056+'/'+_0x57a5f0)[_0x4031('0x1f')](_0x5c0262);}return null;};}function patchUpdates(_0x3fe5bf){return function(_0x4aba99){try{jsonpatch[_0x4031('0x25')](_0x4aba99,_0x3fe5bf,!![]);}catch(_0x449fb0){return BPromise[_0x4031('0x26')](_0x449fb0);}return _0x4aba99[_0x4031('0x27')]();};}function saveUpdates(_0x516a87,_0x27d1fd){return function(_0x4a0031){if(_0x4a0031){return _0x4a0031['update'](_0x516a87)[_0x4031('0x28')](function(_0x24ae9d){return _0x24ae9d;});}return null;};}function removeEntity(_0x561495,_0x4a67d0){return function(_0x274450){if(_0x274450){return _0x274450[_0x4031('0x29')]()[_0x4031('0x28')](function(){var _0x316236=_0x274450[_0x4031('0x2a')]({'plain':!![]});var _0x4f6a2b=_0x4031('0x2b');return db[_0x4031('0x2c')]['destroy']({'where':{'type':_0x4f6a2b,'resourceId':_0x316236['id']}})['then'](function(){return _0x274450;});})[_0x4031('0x28')](function(){_0x561495[_0x4031('0x1d')](0xcc)[_0x4031('0x1e')]();});}};}function handleEntityNotFound(_0x5581ef,_0x355bc1){return function(_0x5e05f5){if(!_0x5e05f5){_0x5581ef['sendStatus'](0x194);}return _0x5e05f5;};}function handleError(_0x5f3fac,_0x52860e){_0x52860e=_0x52860e||0x1f4;return function(_0xe2bbe){logger['error'](_0xe2bbe[_0x4031('0x2d')]);if(_0xe2bbe[_0x4031('0x2e')]){delete _0xe2bbe['name'];}_0x5f3fac['status'](_0x52860e)[_0x4031('0x2f')](_0xe2bbe);};}exports[_0x4031('0x30')]=function(_0x4b9855,_0x287051){var _0x2201af={},_0x5400b7={},_0x1cadd9={'count':0x0,'rows':[]};var _0x14cdc2=_[_0x4031('0x31')](db['Interval']['rawAttributes'],function(_0x769328){return{'name':_0x769328['fieldName'],'type':_0x769328[_0x4031('0x32')][_0x4031('0x33')]};});_0x5400b7[_0x4031('0x34')]=_['map'](_0x14cdc2,_0x4031('0x2e'));_0x5400b7[_0x4031('0x35')]=_[_0x4031('0x36')](_0x4b9855[_0x4031('0x35')]);_0x5400b7[_0x4031('0x37')]=_[_0x4031('0x38')](_0x5400b7['model'],_0x5400b7[_0x4031('0x35')]);_0x2201af[_0x4031('0x39')]=_['intersection'](_0x5400b7[_0x4031('0x34')],qs[_0x4031('0x3a')](_0x4b9855[_0x4031('0x35')][_0x4031('0x3a')]));_0x2201af[_0x4031('0x39')]=_0x2201af['attributes'][_0x4031('0x3b')]?_0x2201af[_0x4031('0x39')]:_0x5400b7[_0x4031('0x34')];if(!_0x4b9855[_0x4031('0x35')][_0x4031('0x3c')](_0x4031('0x3d'))){_0x2201af[_0x4031('0x23')]=qs[_0x4031('0x23')](_0x4b9855[_0x4031('0x35')][_0x4031('0x23')]);_0x2201af[_0x4031('0x20')]=qs[_0x4031('0x20')](_0x4b9855[_0x4031('0x35')][_0x4031('0x20')]);}_0x2201af[_0x4031('0x3e')]=qs[_0x4031('0x3f')](_0x4b9855[_0x4031('0x35')][_0x4031('0x3f')]);_0x2201af[_0x4031('0x40')]=qs[_0x4031('0x37')](_['pick'](_0x4b9855[_0x4031('0x35')],_0x5400b7[_0x4031('0x37')]),_0x14cdc2);if(_0x4b9855[_0x4031('0x35')][_0x4031('0x41')]){_0x2201af[_0x4031('0x40')]=_[_0x4031('0x42')](_0x2201af[_0x4031('0x40')],{'$or':_[_0x4031('0x31')](_0x14cdc2,function(_0xe5f358){if(_0xe5f358['type']!==_0x4031('0x43')){var _0x2bf86c={};_0x2bf86c[_0xe5f358['name']]={'$like':'%'+_0x4b9855[_0x4031('0x35')][_0x4031('0x41')]+'%'};return _0x2bf86c;}})});}_0x2201af=_[_0x4031('0x42')]({},_0x2201af,_0x4b9855['options']);var _0x2f8022={'where':_0x2201af[_0x4031('0x40')]};return db['Interval'][_0x4031('0x22')](_0x2f8022)['then'](function(_0x52e206){_0x1cadd9[_0x4031('0x22')]=_0x52e206;if(_0x4b9855[_0x4031('0x35')]['includeAll']){_0x2201af[_0x4031('0x44')]=[{'all':!![]}];}return db[_0x4031('0x45')][_0x4031('0x46')](_0x2201af);})['then'](function(_0x1c4572){_0x1cadd9[_0x4031('0x47')]=_0x1c4572;return _0x1cadd9;})[_0x4031('0x28')](respondWithFilteredResult(_0x287051,_0x2201af))['catch'](handleError(_0x287051,null));};exports[_0x4031('0x48')]=function(_0x3f5c10,_0x19e4be){var _0x3bd5f5={'raw':!![],'where':{'id':_0x3f5c10[_0x4031('0x49')]['id']}},_0x566514={};_0x566514[_0x4031('0x34')]=_[_0x4031('0x36')](db[_0x4031('0x45')]['rawAttributes']);_0x566514[_0x4031('0x35')]=_[_0x4031('0x36')](_0x3f5c10[_0x4031('0x35')]);_0x566514[_0x4031('0x37')]=_[_0x4031('0x38')](_0x566514['model'],_0x566514[_0x4031('0x35')]);_0x3bd5f5[_0x4031('0x39')]=_[_0x4031('0x38')](_0x566514[_0x4031('0x34')],qs[_0x4031('0x3a')](_0x3f5c10[_0x4031('0x35')][_0x4031('0x3a')]));_0x3bd5f5[_0x4031('0x39')]=_0x3bd5f5[_0x4031('0x39')]['length']?_0x3bd5f5['attributes']:_0x566514[_0x4031('0x34')];if(_0x3f5c10[_0x4031('0x35')][_0x4031('0x4a')]){_0x3bd5f5[_0x4031('0x44')]=[{'all':!![]}];}_0x3bd5f5=_['merge']({},_0x3bd5f5,_0x3f5c10[_0x4031('0x4b')]);return db[_0x4031('0x45')][_0x4031('0x4c')](_0x3bd5f5)[_0x4031('0x28')](handleEntityNotFound(_0x19e4be,null))[_0x4031('0x28')](respondWithResult(_0x19e4be,null))[_0x4031('0x4d')](handleError(_0x19e4be,null));};exports[_0x4031('0x4e')]=function(_0x3dbd8c,_0x4c1014){return db[_0x4031('0x45')][_0x4031('0x4e')](_0x3dbd8c[_0x4031('0x4f')],{})[_0x4031('0x28')](function(_0x53b0bb){var _0x47d378=_0x3dbd8c[_0x4031('0x50')]['get']({'plain':!![]});if(!_0x47d378)throw new Error(_0x4031('0x51'));if(_0x47d378['role']===_0x4031('0x50')){var _0x2a3a16=_0x53b0bb[_0x4031('0x2a')]({'plain':!![]});var _0x1d4aec=_0x4031('0x2b');return db[_0x4031('0x52')][_0x4031('0x4c')]({'where':{'name':_0x1d4aec,'userProfileId':_0x47d378[_0x4031('0x53')]},'raw':!![]})[_0x4031('0x28')](function(_0x45a240){if(_0x45a240&&_0x45a240[_0x4031('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x2a3a16[_0x4031('0x2e')],'resourceId':_0x2a3a16['id'],'type':_0x45a240[_0x4031('0x2e')],'sectionId':_0x45a240['id']},{})[_0x4031('0x28')](function(){return _0x53b0bb;});}else{return _0x53b0bb;}})[_0x4031('0x4d')](function(_0x6b8aa3){logger['error'](_0x4031('0x55'),_0x6b8aa3);throw _0x6b8aa3;});}return _0x53b0bb;})[_0x4031('0x28')](respondWithResult(_0x4c1014,0xc9))[_0x4031('0x4d')](handleError(_0x4c1014,null));};exports[_0x4031('0x56')]=function(_0x558a37,_0x1c9fc4){if(_0x558a37[_0x4031('0x4f')]['id']){delete _0x558a37['body']['id'];}return db['Interval'][_0x4031('0x4c')]({'where':{'id':_0x558a37[_0x4031('0x49')]['id']}})[_0x4031('0x28')](handleEntityNotFound(_0x1c9fc4,null))[_0x4031('0x28')](saveUpdates(_0x558a37[_0x4031('0x4f')],null))[_0x4031('0x28')](respondWithResult(_0x1c9fc4,null))[_0x4031('0x4d')](handleError(_0x1c9fc4,null));};exports['destroy']=function(_0xc5d41e,_0x470eaa){return db[_0x4031('0x45')][_0x4031('0x4c')]({'where':{'id':_0xc5d41e[_0x4031('0x49')]['id']}})[_0x4031('0x28')](handleEntityNotFound(_0x470eaa,null))['then'](removeEntity(_0x470eaa,null))[_0x4031('0x4d')](handleError(_0x470eaa,null));};exports['addInterval']=function(_0x53ab95,_0x2afd8a,_0x15db8c){if(_0x53ab95[_0x4031('0x4f')]['id']){delete _0x53ab95['body']['id'];}return db[_0x4031('0x45')][_0x4031('0x4c')]({'where':{'id':_0x53ab95[_0x4031('0x49')]['id']}})[_0x4031('0x28')](handleEntityNotFound(_0x2afd8a,null))[_0x4031('0x28')](function(_0x536aff){if(_0x536aff){_0x53ab95['body'][_0x4031('0x57')]=_0x536aff['id'];return db[_0x4031('0x45')][_0x4031('0x4e')](_0x53ab95[_0x4031('0x4f')]);}})[_0x4031('0x28')](respondWithResult(_0x2afd8a,null))[_0x4031('0x4d')](handleError(_0x2afd8a,null));};exports[_0x4031('0x58')]=function(_0x1161b6,_0x3e62af,_0x273f0b){var _0x4a36d2={};var _0x27cc8b={};var _0x50354d;var _0x3fdadc;return db[_0x4031('0x45')][_0x4031('0x59')]({'where':{'id':_0x1161b6[_0x4031('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e62af,null))['then'](function(_0x10fe78){if(_0x10fe78){_0x50354d=_0x10fe78;_0x27cc8b[_0x4031('0x34')]=_[_0x4031('0x36')](db[_0x4031('0x45')][_0x4031('0x5a')]);_0x27cc8b[_0x4031('0x35')]=_[_0x4031('0x36')](_0x1161b6[_0x4031('0x35')]);_0x27cc8b['filters']=_[_0x4031('0x38')](_0x27cc8b[_0x4031('0x34')],_0x27cc8b[_0x4031('0x35')]);_0x4a36d2[_0x4031('0x39')]=_[_0x4031('0x38')](_0x27cc8b[_0x4031('0x34')],qs[_0x4031('0x3a')](_0x1161b6[_0x4031('0x35')][_0x4031('0x3a')]));_0x4a36d2[_0x4031('0x39')]=_0x4a36d2[_0x4031('0x39')][_0x4031('0x3b')]?_0x4a36d2[_0x4031('0x39')]:_0x27cc8b[_0x4031('0x34')];_0x4a36d2[_0x4031('0x3e')]=qs['sort'](_0x1161b6[_0x4031('0x35')][_0x4031('0x3f')]);_0x4a36d2[_0x4031('0x40')]=qs[_0x4031('0x37')](_['pick'](_0x1161b6[_0x4031('0x35')],_0x27cc8b[_0x4031('0x37')]));if(_0x1161b6[_0x4031('0x35')]['filter']){_0x4a36d2[_0x4031('0x40')]=_[_0x4031('0x42')](_0x4a36d2['where'],{'$or':_[_0x4031('0x31')](_0x4a36d2[_0x4031('0x39')],function(_0x2ec26c){var _0x5b3c25={};_0x5b3c25[_0x2ec26c]={'$like':'%'+_0x1161b6[_0x4031('0x35')]['filter']+'%'};return _0x5b3c25;})});}_0x4a36d2=_[_0x4031('0x42')]({},_0x4a36d2,_0x1161b6[_0x4031('0x4b')]);return _0x50354d[_0x4031('0x58')](_0x4a36d2);}})['then'](function(_0x3f6405){if(_0x3f6405){_0x3fdadc=_0x3f6405['length'];if(!_0x1161b6[_0x4031('0x35')][_0x4031('0x3c')](_0x4031('0x3d'))){_0x4a36d2[_0x4031('0x23')]=qs[_0x4031('0x23')](_0x1161b6['query']['limit']);_0x4a36d2['offset']=qs[_0x4031('0x20')](_0x1161b6['query']['offset']);}return _0x50354d['getIntervals'](_0x4a36d2);}})[_0x4031('0x28')](function(_0x41fa1d){if(_0x41fa1d){return _0x41fa1d?{'count':_0x3fdadc,'rows':_0x41fa1d}:null;}})[_0x4031('0x28')](respondWithResult(_0x3e62af,null))[_0x4031('0x4d')](handleError(_0x3e62af,null));};exports['addIntervals']=function(_0x306de7,_0x396f95,_0x285323){return db[_0x4031('0x45')][_0x4031('0x59')]({'where':{'id':_0x306de7[_0x4031('0x49')]['id']}})[_0x4031('0x28')](handleEntityNotFound(_0x396f95,null))[_0x4031('0x28')](function(_0x47025d){if(_0x47025d){return db[_0x4031('0x5b')][_0x4031('0x5c')](function(_0x2542d0){return db[_0x4031('0x45')]['destroy']({'where':{'IntervalId':_0x306de7[_0x4031('0x49')]['id']},'transaction':_0x2542d0})['then'](function(_0x181de2){var _0x1acc60=_[_0x4031('0x31')](_0x306de7[_0x4031('0x4f')],function(_0x3b9d9d){delete _0x3b9d9d['id'];_0x3b9d9d[_0x4031('0x57')]=_0x306de7[_0x4031('0x49')]['id'];return _0x3b9d9d;});return db['Interval']['bulkCreate'](_0x1acc60,{'transaction':_0x2542d0});});})[_0x4031('0x28')](function(){return db[_0x4031('0x45')]['findAll']({'where':{'IntervalId':_0x306de7['params']['id']}});});}})[_0x4031('0x28')](respondWithResult(_0x396f95,null))[_0x4031('0x4d')](handleError(_0x396f95,null));}; \ No newline at end of file +var _0xaead=['addInterval','getIntervals','findOne','length','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xaead,0x66));var _0xdaea=function(_0x4a74b8,_0x1ed4a2){_0x4a74b8=_0x4a74b8-0x0;var _0x252dab=_0xaead[_0x4a74b8];return _0x252dab;};'use strict';var emlformat=require(_0xdaea('0x0'));var rimraf=require(_0xdaea('0x1'));var zipdir=require(_0xdaea('0x2'));var jsonpatch=require(_0xdaea('0x3'));var rp=require(_0xdaea('0x4'));var moment=require('moment');var BPromise=require(_0xdaea('0x5'));var Mustache=require('mustache');var util=require(_0xdaea('0x6'));var path=require(_0xdaea('0x7'));var sox=require(_0xdaea('0x8'));var csv=require(_0xdaea('0x9'));var ejs=require(_0xdaea('0xa'));var fs=require('fs');var fs_extra=require(_0xdaea('0xb'));var _=require('lodash');var squel=require(_0xdaea('0xc'));var crypto=require('crypto');var jsforce=require(_0xdaea('0xd'));var deskjs=require(_0xdaea('0xe'));var toCsv=require(_0xdaea('0x9'));var querystring=require(_0xdaea('0xf'));var Papa=require(_0xdaea('0x10'));var Redis=require('ioredis');var authService=require(_0xdaea('0x11'));var qs=require(_0xdaea('0x12'));var as=require(_0xdaea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdaea('0x14'))(_0xdaea('0x15'));var utils=require('../../config/utils');var config=require(_0xdaea('0x16'));var licenseUtil=require(_0xdaea('0x17'));var db=require(_0xdaea('0x18'))['db'];var extensions=require(_0xdaea('0x19'));function respondWithStatusCode(_0x6fa2a5,_0x3309ab){_0x3309ab=_0x3309ab||0xcc;return function(_0x24ad6e){if(_0x24ad6e){return _0x6fa2a5[_0xdaea('0x1a')](_0x3309ab);}return _0x6fa2a5[_0xdaea('0x1b')](_0x3309ab)[_0xdaea('0x1c')]();};}function respondWithResult(_0x3471de,_0x5e6d30){_0x5e6d30=_0x5e6d30||0xc8;return function(_0xb0b05b){if(_0xb0b05b){return _0x3471de[_0xdaea('0x1b')](_0x5e6d30)[_0xdaea('0x1d')](_0xb0b05b);}};}function respondWithFilteredResult(_0x5c791d,_0x2f4af8){return function(_0x1f9101){if(_0x1f9101){var _0x26a6dc=typeof _0x2f4af8['offset']===_0xdaea('0x1e')&&typeof _0x2f4af8[_0xdaea('0x1f')]===_0xdaea('0x1e');var _0x3f63e1=_0x1f9101[_0xdaea('0x20')];var _0x1bd719=_0x26a6dc?0x0:_0x2f4af8['offset'];var _0x394bd0=_0x26a6dc?_0x1f9101[_0xdaea('0x20')]:_0x2f4af8[_0xdaea('0x21')]+_0x2f4af8[_0xdaea('0x1f')];var _0x41795a;if(_0x394bd0>=_0x3f63e1){_0x394bd0=_0x3f63e1;_0x41795a=0xc8;}else{_0x41795a=0xce;}_0x5c791d[_0xdaea('0x1b')](_0x41795a);return _0x5c791d[_0xdaea('0x22')](_0xdaea('0x23'),_0x1bd719+'-'+_0x394bd0+'/'+_0x3f63e1)[_0xdaea('0x1d')](_0x1f9101);}return null;};}function patchUpdates(_0x30e51f){return function(_0xf584f6){try{jsonpatch[_0xdaea('0x24')](_0xf584f6,_0x30e51f,!![]);}catch(_0x440fc5){return BPromise[_0xdaea('0x25')](_0x440fc5);}return _0xf584f6[_0xdaea('0x26')]();};}function saveUpdates(_0x5a252c,_0x43bf05){return function(_0x34daaa){if(_0x34daaa){return _0x34daaa[_0xdaea('0x27')](_0x5a252c)[_0xdaea('0x28')](function(_0x3d9da0){return _0x3d9da0;});}return null;};}function removeEntity(_0x56f030,_0x54aefe){return function(_0x3c020d){if(_0x3c020d){return _0x3c020d[_0xdaea('0x29')]()['then'](function(){var _0x590289=_0x3c020d[_0xdaea('0x2a')]({'plain':!![]});var _0x4160b0='Intervals';return db['UserProfileResource'][_0xdaea('0x29')]({'where':{'type':_0x4160b0,'resourceId':_0x590289['id']}})[_0xdaea('0x28')](function(){return _0x3c020d;});})['then'](function(){_0x56f030[_0xdaea('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x578a02,_0x2faf93){return function(_0x27b27e){if(!_0x27b27e){_0x578a02['sendStatus'](0x194);}return _0x27b27e;};}function handleError(_0xd7d476,_0x3ec795){_0x3ec795=_0x3ec795||0x1f4;return function(_0x571c96){logger[_0xdaea('0x2b')](_0x571c96[_0xdaea('0x2c')]);if(_0x571c96[_0xdaea('0x2d')]){delete _0x571c96[_0xdaea('0x2d')];}_0xd7d476[_0xdaea('0x1b')](_0x3ec795)[_0xdaea('0x2e')](_0x571c96);};}exports[_0xdaea('0x2f')]=function(_0x38da76,_0x5d7f24){var _0x1d93ff={},_0x4b7bdf={},_0x3ca463={'count':0x0,'rows':[]};var _0x1acef2=_[_0xdaea('0x30')](db[_0xdaea('0x31')][_0xdaea('0x32')],function(_0x381f91){return{'name':_0x381f91[_0xdaea('0x33')],'type':_0x381f91[_0xdaea('0x34')][_0xdaea('0x35')]};});_0x4b7bdf['model']=_[_0xdaea('0x30')](_0x1acef2,_0xdaea('0x2d'));_0x4b7bdf[_0xdaea('0x36')]=_[_0xdaea('0x37')](_0x38da76[_0xdaea('0x36')]);_0x4b7bdf[_0xdaea('0x38')]=_[_0xdaea('0x39')](_0x4b7bdf[_0xdaea('0x3a')],_0x4b7bdf[_0xdaea('0x36')]);_0x1d93ff[_0xdaea('0x3b')]=_[_0xdaea('0x39')](_0x4b7bdf[_0xdaea('0x3a')],qs[_0xdaea('0x3c')](_0x38da76[_0xdaea('0x36')][_0xdaea('0x3c')]));_0x1d93ff['attributes']=_0x1d93ff[_0xdaea('0x3b')]['length']?_0x1d93ff['attributes']:_0x4b7bdf[_0xdaea('0x3a')];if(!_0x38da76[_0xdaea('0x36')][_0xdaea('0x3d')]('nolimit')){_0x1d93ff[_0xdaea('0x1f')]=qs[_0xdaea('0x1f')](_0x38da76[_0xdaea('0x36')][_0xdaea('0x1f')]);_0x1d93ff[_0xdaea('0x21')]=qs['offset'](_0x38da76[_0xdaea('0x36')]['offset']);}_0x1d93ff[_0xdaea('0x3e')]=qs['sort'](_0x38da76[_0xdaea('0x36')][_0xdaea('0x3f')]);_0x1d93ff[_0xdaea('0x40')]=qs[_0xdaea('0x38')](_[_0xdaea('0x41')](_0x38da76[_0xdaea('0x36')],_0x4b7bdf[_0xdaea('0x38')]),_0x1acef2);if(_0x38da76['query'][_0xdaea('0x42')]){_0x1d93ff[_0xdaea('0x40')]=_[_0xdaea('0x43')](_0x1d93ff[_0xdaea('0x40')],{'$or':_[_0xdaea('0x30')](_0x1acef2,function(_0x3d7d74){if(_0x3d7d74['type']!=='VIRTUAL'){var _0x21a88c={};_0x21a88c[_0x3d7d74[_0xdaea('0x2d')]]={'$like':'%'+_0x38da76[_0xdaea('0x36')][_0xdaea('0x42')]+'%'};return _0x21a88c;}})});}_0x1d93ff=_[_0xdaea('0x43')]({},_0x1d93ff,_0x38da76[_0xdaea('0x44')]);var _0x54e331={'where':_0x1d93ff[_0xdaea('0x40')]};return db[_0xdaea('0x31')]['count'](_0x54e331)[_0xdaea('0x28')](function(_0x2eb352){_0x3ca463[_0xdaea('0x20')]=_0x2eb352;if(_0x38da76['query'][_0xdaea('0x45')]){_0x1d93ff[_0xdaea('0x46')]=[{'all':!![]}];}return db[_0xdaea('0x31')][_0xdaea('0x47')](_0x1d93ff);})[_0xdaea('0x28')](function(_0x40323f){_0x3ca463[_0xdaea('0x48')]=_0x40323f;return _0x3ca463;})[_0xdaea('0x28')](respondWithFilteredResult(_0x5d7f24,_0x1d93ff))[_0xdaea('0x49')](handleError(_0x5d7f24,null));};exports[_0xdaea('0x4a')]=function(_0x10d721,_0x439b36){var _0x39770f={'raw':!![],'where':{'id':_0x10d721[_0xdaea('0x4b')]['id']}},_0x4a1a0b={};_0x4a1a0b[_0xdaea('0x3a')]=_[_0xdaea('0x37')](db['Interval'][_0xdaea('0x32')]);_0x4a1a0b[_0xdaea('0x36')]=_[_0xdaea('0x37')](_0x10d721[_0xdaea('0x36')]);_0x4a1a0b[_0xdaea('0x38')]=_['intersection'](_0x4a1a0b[_0xdaea('0x3a')],_0x4a1a0b[_0xdaea('0x36')]);_0x39770f[_0xdaea('0x3b')]=_[_0xdaea('0x39')](_0x4a1a0b[_0xdaea('0x3a')],qs['fields'](_0x10d721[_0xdaea('0x36')][_0xdaea('0x3c')]));_0x39770f[_0xdaea('0x3b')]=_0x39770f[_0xdaea('0x3b')]['length']?_0x39770f['attributes']:_0x4a1a0b[_0xdaea('0x3a')];if(_0x10d721[_0xdaea('0x36')][_0xdaea('0x45')]){_0x39770f[_0xdaea('0x46')]=[{'all':!![]}];}_0x39770f=_[_0xdaea('0x43')]({},_0x39770f,_0x10d721[_0xdaea('0x44')]);return db[_0xdaea('0x31')][_0xdaea('0x4c')](_0x39770f)[_0xdaea('0x28')](handleEntityNotFound(_0x439b36,null))[_0xdaea('0x28')](respondWithResult(_0x439b36,null))[_0xdaea('0x49')](handleError(_0x439b36,null));};exports[_0xdaea('0x4d')]=function(_0xe66707,_0x38a7dd){return db[_0xdaea('0x31')]['create'](_0xe66707[_0xdaea('0x4e')],{})[_0xdaea('0x28')](function(_0x514030){var _0x39ead7=_0xe66707[_0xdaea('0x4f')][_0xdaea('0x2a')]({'plain':!![]});if(!_0x39ead7)throw new Error(_0xdaea('0x50'));if(_0x39ead7['role']===_0xdaea('0x4f')){var _0x43f31c=_0x514030['get']({'plain':!![]});var _0x2ae8a5=_0xdaea('0x51');return db[_0xdaea('0x52')][_0xdaea('0x4c')]({'where':{'name':_0x2ae8a5,'userProfileId':_0x39ead7[_0xdaea('0x53')]},'raw':!![]})[_0xdaea('0x28')](function(_0x14b333){if(_0x14b333&&_0x14b333[_0xdaea('0x54')]===0x0){return db[_0xdaea('0x55')][_0xdaea('0x4d')]({'name':_0x43f31c['name'],'resourceId':_0x43f31c['id'],'type':_0x14b333[_0xdaea('0x2d')],'sectionId':_0x14b333['id']},{})['then'](function(){return _0x514030;});}else{return _0x514030;}})[_0xdaea('0x49')](function(_0x8a83e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8a83e7);throw _0x8a83e7;});}return _0x514030;})[_0xdaea('0x28')](respondWithResult(_0x38a7dd,0xc9))[_0xdaea('0x49')](handleError(_0x38a7dd,null));};exports[_0xdaea('0x27')]=function(_0x2b4a27,_0x31579c){if(_0x2b4a27['body']['id']){delete _0x2b4a27[_0xdaea('0x4e')]['id'];}return db[_0xdaea('0x31')][_0xdaea('0x4c')]({'where':{'id':_0x2b4a27['params']['id']}})[_0xdaea('0x28')](handleEntityNotFound(_0x31579c,null))['then'](saveUpdates(_0x2b4a27['body'],null))['then'](respondWithResult(_0x31579c,null))[_0xdaea('0x49')](handleError(_0x31579c,null));};exports[_0xdaea('0x29')]=function(_0x322016,_0x268f2d){return db[_0xdaea('0x31')]['find']({'where':{'id':_0x322016[_0xdaea('0x4b')]['id']}})['then'](handleEntityNotFound(_0x268f2d,null))['then'](removeEntity(_0x268f2d,null))['catch'](handleError(_0x268f2d,null));};exports[_0xdaea('0x56')]=function(_0x5491e6,_0x2457f1,_0x346895){if(_0x5491e6[_0xdaea('0x4e')]['id']){delete _0x5491e6[_0xdaea('0x4e')]['id'];}return db['Interval'][_0xdaea('0x4c')]({'where':{'id':_0x5491e6[_0xdaea('0x4b')]['id']}})[_0xdaea('0x28')](handleEntityNotFound(_0x2457f1,null))[_0xdaea('0x28')](function(_0x5ddd7d){if(_0x5ddd7d){_0x5491e6['body']['IntervalId']=_0x5ddd7d['id'];return db['Interval'][_0xdaea('0x4d')](_0x5491e6[_0xdaea('0x4e')]);}})[_0xdaea('0x28')](respondWithResult(_0x2457f1,null))['catch'](handleError(_0x2457f1,null));};exports[_0xdaea('0x57')]=function(_0x38a786,_0x128bfc,_0x2c6189){var _0x20b837={};var _0x971be8={};var _0x5d302a;var _0x4a8d1d;return db[_0xdaea('0x31')][_0xdaea('0x58')]({'where':{'id':_0x38a786[_0xdaea('0x4b')]['id']}})[_0xdaea('0x28')](handleEntityNotFound(_0x128bfc,null))[_0xdaea('0x28')](function(_0x3e3744){if(_0x3e3744){_0x5d302a=_0x3e3744;_0x971be8[_0xdaea('0x3a')]=_['keys'](db[_0xdaea('0x31')]['rawAttributes']);_0x971be8['query']=_[_0xdaea('0x37')](_0x38a786[_0xdaea('0x36')]);_0x971be8['filters']=_[_0xdaea('0x39')](_0x971be8[_0xdaea('0x3a')],_0x971be8['query']);_0x20b837['attributes']=_[_0xdaea('0x39')](_0x971be8[_0xdaea('0x3a')],qs[_0xdaea('0x3c')](_0x38a786['query'][_0xdaea('0x3c')]));_0x20b837[_0xdaea('0x3b')]=_0x20b837[_0xdaea('0x3b')]['length']?_0x20b837[_0xdaea('0x3b')]:_0x971be8[_0xdaea('0x3a')];_0x20b837[_0xdaea('0x3e')]=qs['sort'](_0x38a786[_0xdaea('0x36')][_0xdaea('0x3f')]);_0x20b837[_0xdaea('0x40')]=qs['filters'](_['pick'](_0x38a786[_0xdaea('0x36')],_0x971be8[_0xdaea('0x38')]));if(_0x38a786[_0xdaea('0x36')]['filter']){_0x20b837[_0xdaea('0x40')]=_['merge'](_0x20b837[_0xdaea('0x40')],{'$or':_[_0xdaea('0x30')](_0x20b837[_0xdaea('0x3b')],function(_0x2cf254){var _0x1e9f7d={};_0x1e9f7d[_0x2cf254]={'$like':'%'+_0x38a786[_0xdaea('0x36')][_0xdaea('0x42')]+'%'};return _0x1e9f7d;})});}_0x20b837=_[_0xdaea('0x43')]({},_0x20b837,_0x38a786[_0xdaea('0x44')]);return _0x5d302a[_0xdaea('0x57')](_0x20b837);}})['then'](function(_0x59353b){if(_0x59353b){_0x4a8d1d=_0x59353b[_0xdaea('0x59')];if(!_0x38a786['query'][_0xdaea('0x3d')]('nolimit')){_0x20b837[_0xdaea('0x1f')]=qs['limit'](_0x38a786[_0xdaea('0x36')][_0xdaea('0x1f')]);_0x20b837[_0xdaea('0x21')]=qs[_0xdaea('0x21')](_0x38a786[_0xdaea('0x36')][_0xdaea('0x21')]);}return _0x5d302a[_0xdaea('0x57')](_0x20b837);}})[_0xdaea('0x28')](function(_0x2fca53){if(_0x2fca53){return _0x2fca53?{'count':_0x4a8d1d,'rows':_0x2fca53}:null;}})['then'](respondWithResult(_0x128bfc,null))['catch'](handleError(_0x128bfc,null));};exports['addIntervals']=function(_0x4a6b31,_0xce07ca,_0x3d398d){return db['Interval'][_0xdaea('0x58')]({'where':{'id':_0x4a6b31[_0xdaea('0x4b')]['id']}})[_0xdaea('0x28')](handleEntityNotFound(_0xce07ca,null))[_0xdaea('0x28')](function(_0x5e7d8d){if(_0x5e7d8d){return db[_0xdaea('0x5a')][_0xdaea('0x5b')](function(_0x595567){return db[_0xdaea('0x31')][_0xdaea('0x29')]({'where':{'IntervalId':_0x4a6b31[_0xdaea('0x4b')]['id']},'transaction':_0x595567})[_0xdaea('0x28')](function(_0x291de3){var _0x1d5743=_[_0xdaea('0x30')](_0x4a6b31[_0xdaea('0x4e')],function(_0x37749f){delete _0x37749f['id'];_0x37749f[_0xdaea('0x5c')]=_0x4a6b31[_0xdaea('0x4b')]['id'];return _0x37749f;});return db[_0xdaea('0x31')][_0xdaea('0x5d')](_0x1d5743,{'transaction':_0x595567});});})[_0xdaea('0x28')](function(){return db['Interval'][_0xdaea('0x47')]({'where':{'IntervalId':_0x4a6b31[_0xdaea('0x4b')]['id']}});});}})[_0xdaea('0x28')](respondWithResult(_0xce07ca,null))['catch'](handleError(_0xce07ca,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 9d9e083..b082381 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 _0x5993=['../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x107d38,_0x12fc9e){var _0x51397c=function(_0x29b0dc){while(--_0x29b0dc){_0x107d38['push'](_0x107d38['shift']());}};_0x51397c(++_0x12fc9e);}(_0x5993,0x1ab));var _0x3599=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x5993[_0x3e0763];return _0x351ca2;};'use strict';var _=require(_0x3599('0x0'));var util=require(_0x3599('0x1'));var logger=require(_0x3599('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3599('0x3'));var rp=require(_0x3599('0x4'));var fs=require('fs');var path=require(_0x3599('0x5'));var rimraf=require(_0x3599('0x6'));var config=require(_0x3599('0x7'));var attributes=require(_0x3599('0x8'));var extensions=require(_0x3599('0x9'));module[_0x3599('0xa')]=function(_0x5aed45,_0x5ba144){return _0x5aed45[_0x3599('0xb')]('Interval',attributes,{'tableName':_0x3599('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x195e42,_0xfb16e9){extensions[_0x3599('0xd')](_0x5aed45,_0x195e42);},'afterBulkCreate':function(_0xb3189e,_0x153270,_0x58f85e){_0x58f85e();extensions[_0x3599('0xd')](_0x5aed45,_0xb3189e[0x0]);},'afterUpdate':function(_0x5e0447,_0x23a735){extensions['rewrite'](_0x5aed45,_0x5e0447);},'afterDestroy':function(_0x461dd5,_0x280324){extensions['rewrite'](_0x5aed45,_0x461dd5);}}});}; \ No newline at end of file +var _0x2ba0=['path','rimraf','./interval.attributes','define','Interval','tools_intervals','rewrite','util','../../config/logger','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ba0,0x1dd));var _0x02ba=function(_0x446341,_0xae27c6){_0x446341=_0x446341-0x0;var _0x195911=_0x2ba0[_0x446341];return _0x195911;};'use strict';var _=require('lodash');var util=require(_0x02ba('0x0'));var logger=require(_0x02ba('0x1'))('api');var moment=require('moment');var BPromise=require(_0x02ba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02ba('0x3'));var rimraf=require(_0x02ba('0x4'));var config=require('../../config/environment');var attributes=require(_0x02ba('0x5'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x3a924d,_0x4e1bfc){return _0x3a924d[_0x02ba('0x6')](_0x02ba('0x7'),attributes,{'tableName':_0x02ba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5817f9,_0x392ea0){extensions[_0x02ba('0x9')](_0x3a924d,_0x5817f9);},'afterBulkCreate':function(_0x2c1c72,_0x574a41,_0x45c487){_0x45c487();extensions[_0x02ba('0x9')](_0x3a924d,_0x2c1c72[0x0]);},'afterUpdate':function(_0x4635bb,_0x396b32){extensions[_0x02ba('0x9')](_0x3a924d,_0x4635bb);},'afterDestroy':function(_0x5eff87,_0x3f7478){extensions[_0x02ba('0x9')](_0x3a924d,_0x5eff87);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f6462c6..9c9f812 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ffbb3f0..4576753 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x1d5682,_0x53f2ee){var _0x3fa122=function(_0x54e713){while(--_0x54e713){_0x1d5682['push'](_0x1d5682['shift']());}};_0x3fa122(++_0x53f2ee);}(_0x2ef3,0xba));var _0x32ef=function(_0x51c4f9,_0x627aa3){_0x51c4f9=_0x51c4f9-0x0;var _0x2a8681=_0x2ef3[_0x51c4f9];return _0x2a8681;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x3cccf3,_0x372fc9){var _0xecac1c=function(_0xbe2a05){while(--_0xbe2a05){_0x3cccf3['push'](_0x3cccf3['shift']());}};_0xecac1c(++_0x372fc9);}(_0xadb5,0xad));var _0x5adb=function(_0x442f74,_0x1486cc){_0x442f74=_0x442f74-0x0;var _0x342d70=_0xadb5[_0x442f74];return _0x342d70;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 1da5460..34e1137 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 _0x90b0=['issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','data','end','status','statusCode','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','MOTGUI','summary','Report','\x20from\x20','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x90b0,0x7a));var _0x090b=function(_0x334b4a,_0x534c79){_0x334b4a=_0x334b4a-0x0;var _0x5d06c3=_0x90b0[_0x334b4a];return _0x5d06c3;};'use strict';var BPromise=require(_0x090b('0x0'));var https=require(_0x090b('0x1'));var logger=require(_0x090b('0x2'))(_0x090b('0x3'));var USERNAME=_0x090b('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x89b25a,_0x5469a3){var _0x39e8ee={'fields':{'project':{'key':_0x89b25a['key']||_0x090b('0x5')},'summary':(_0x89b25a[_0x090b('0x6')]||_0x090b('0x7'))+_0x090b('0x8')+_0x89b25a['ip'],'description':_0x89b25a['description']||JSON[_0x090b('0x9')](_0x89b25a),'issuetype':{'name':_0x89b25a[_0x090b('0xa')]||_0x090b('0xb')}}};_0x39e8ee[_0x090b('0xc')][_0x090b('0xd')]=_0x89b25a['email'];_0x39e8ee[_0x090b('0xc')][_0x090b('0xe')]=_0x89b25a[_0x090b('0xf')];_0x39e8ee[_0x090b('0xc')][_0x090b('0x10')]=_0x89b25a[_0x090b('0x11')];_0x39e8ee[_0x090b('0xc')]['customfield_11503']=_0x89b25a[_0x090b('0x12')];_0x39e8ee[_0x090b('0xc')][_0x090b('0x13')]=_0x89b25a[_0x090b('0x14')];_0x39e8ee['fields']['customfield_10102']=_0x89b25a['ip'];var _0x6357c1={'host':_0x090b('0x15'),'port':0x1bb,'path':_0x090b('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x090b('0x17'),'Authorization':_0x090b('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x090b('0x19')](_0x090b('0x1a'))}};var _0x3617ea=JSON['stringify'](_0x39e8ee);var _0x4d6b7e=https[_0x090b('0x1b')](_0x6357c1,function(_0x96a73){_0x96a73[_0x090b('0x1c')]('utf8');var _0x470cb7='';_0x96a73['on'](_0x090b('0x1d'),function(_0x35ae6c){_0x470cb7+=_0x35ae6c;});_0x96a73['on'](_0x090b('0x1e'),function(){if(_0x5469a3){return _0x5469a3[_0x090b('0x1f')](_0x96a73[_0x090b('0x20')])['json'](JSON[_0x090b('0x21')](_0x470cb7));}});});_0x4d6b7e['on'](_0x090b('0x22'),function(_0x3a8bf3){if(_0x5469a3){return _0x5469a3[_0x090b('0x1f')](0x1f4)['json']({'errors':[{'message':_0x090b('0x23'),'type':_0x090b('0x24')}]});}});_0x4d6b7e['write'](_0x3617ea);_0x4d6b7e['end']();}exports[_0x090b('0x25')]=openIssue;exports[_0x090b('0x26')]=function(_0xe4536e,_0x2259a8){_0xe4536e[_0x090b('0x27')]['ip']=_0xe4536e['headers'][_0x090b('0x28')]||_0xe4536e[_0x090b('0x29')][_0x090b('0x2a')]||_0xe4536e['socket'][_0x090b('0x2a')]||_0xe4536e[_0x090b('0x29')][_0x090b('0x2b')][_0x090b('0x2a')];return openIssue(_0xe4536e[_0x090b('0x27')],_0x2259a8);}; \ No newline at end of file +var _0x9e6d=['3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','POST','application/json','toString','base64','setEncoding','utf8','data','end','status','statusCode','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','connection','remoteAddress','socket','https','../../config/logger','api','support'];(function(_0x1222a6,_0x2a692d){var _0x46cca5=function(_0x1883a1){while(--_0x1883a1){_0x1222a6['push'](_0x1222a6['shift']());}};_0x46cca5(++_0x2a692d);}(_0x9e6d,0x1aa));var _0xd9e6=function(_0x36c128,_0x32fed3){_0x36c128=_0x36c128-0x0;var _0x40ef4c=_0x9e6d[_0x36c128];return _0x40ef4c;};'use strict';var BPromise=require('bluebird');var https=require(_0xd9e6('0x0'));var logger=require(_0xd9e6('0x1'))(_0xd9e6('0x2'));var USERNAME=_0xd9e6('0x3');var PASSWORD=_0xd9e6('0x4');function openIssue(_0x2ca0b3,_0x451f98){var _0x354752={'fields':{'project':{'key':_0x2ca0b3[_0xd9e6('0x5')]||_0xd9e6('0x6')},'summary':(_0x2ca0b3[_0xd9e6('0x7')]||_0xd9e6('0x8'))+_0xd9e6('0x9')+_0x2ca0b3['ip'],'description':_0x2ca0b3[_0xd9e6('0xa')]||JSON[_0xd9e6('0xb')](_0x2ca0b3),'issuetype':{'name':_0x2ca0b3[_0xd9e6('0xc')]||_0xd9e6('0xd')}}};_0x354752[_0xd9e6('0xe')][_0xd9e6('0xf')]=_0x2ca0b3[_0xd9e6('0x10')];_0x354752[_0xd9e6('0xe')][_0xd9e6('0x11')]=_0x2ca0b3[_0xd9e6('0x12')];_0x354752[_0xd9e6('0xe')][_0xd9e6('0x13')]=_0x2ca0b3['newToken'];_0x354752[_0xd9e6('0xe')][_0xd9e6('0x14')]=_0x2ca0b3[_0xd9e6('0x15')];_0x354752[_0xd9e6('0xe')][_0xd9e6('0x16')]=_0x2ca0b3[_0xd9e6('0x17')];_0x354752[_0xd9e6('0xe')]['customfield_10102']=_0x2ca0b3['ip'];var _0x1a2da4={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0xd9e6('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xd9e6('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xd9e6('0x1a')](_0xd9e6('0x1b'))}};var _0x3524b8=JSON['stringify'](_0x354752);var _0x4bfb11=https['request'](_0x1a2da4,function(_0x185e2a){_0x185e2a[_0xd9e6('0x1c')](_0xd9e6('0x1d'));var _0x57af9f='';_0x185e2a['on'](_0xd9e6('0x1e'),function(_0xbafd77){_0x57af9f+=_0xbafd77;});_0x185e2a['on'](_0xd9e6('0x1f'),function(){if(_0x451f98){return _0x451f98[_0xd9e6('0x20')](_0x185e2a[_0xd9e6('0x21')])['json'](JSON['parse'](_0x57af9f));}});});_0x4bfb11['on'](_0xd9e6('0x22'),function(_0x4ce5ea){if(_0x451f98){return _0x451f98[_0xd9e6('0x20')](0x1f4)[_0xd9e6('0x23')]({'errors':[{'message':_0xd9e6('0x24'),'type':'api.jira'}]});}});_0x4bfb11[_0xd9e6('0x25')](_0x3524b8);_0x4bfb11['end']();}exports[_0xd9e6('0x26')]=openIssue;exports[_0xd9e6('0x27')]=function(_0x1feeac,_0x2c20a8){_0x1feeac['body']['ip']=_0x1feeac['headers']['x-forwarded-for']||_0x1feeac[_0xd9e6('0x28')][_0xd9e6('0x29')]||_0x1feeac[_0xd9e6('0x2a')][_0xd9e6('0x29')]||_0x1feeac[_0xd9e6('0x28')][_0xd9e6('0x2a')][_0xd9e6('0x29')];return openIssue(_0x1feeac['body'],_0x2c20a8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6b14b34..2b03484 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 _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x117994,_0x46bbbb){var _0x40814a=function(_0x5e88ca){while(--_0x5e88ca){_0x117994['push'](_0x117994['shift']());}};_0x40814a(++_0x46bbbb);}(_0x878f,0x173));var _0xf878=function(_0x50eaa6,_0x257ed9){_0x50eaa6=_0x50eaa6-0x0;var _0xc781f1=_0x878f[_0x50eaa6];return _0xc781f1;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router; \ No newline at end of file +var _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a2299,_0x3e2922){var _0xedff0f=function(_0x1624cb){while(--_0x1624cb){_0x5a2299['push'](_0x5a2299['shift']());}};_0xedff0f(++_0x3e2922);}(_0x878f,0x173));var _0xf878=function(_0x40c36e,_0x1c07e0){_0x40c36e=_0x40c36e-0x0;var _0x48fe55=_0x878f[_0x40c36e];return _0x48fe55;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 10c2085..f5c1b0e 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(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x5649dd,_0x4b9f12){_0x5649dd=_0x5649dd-0x0;var _0x4b9a5c=_0x7a54[_0x5649dd];return _0x4b9a5c;};'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(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x245d29,_0x3ecd24){_0x245d29=_0x245d29-0x0;var _0x588850=_0x7a54[_0x245d29];return _0x588850;};'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 46197ab..a978cd3 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 _0x56a4=['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','status','end','json','undefined','limit','offset','Content-Range','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','JscriptyAnswerReport','then','count','includeAll','findAll','rows','catch','show','keys','length','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js'];(function(_0x4ad21e,_0x1afa62){var _0x508842=function(_0x5145a1){while(--_0x5145a1){_0x4ad21e['push'](_0x4ad21e['shift']());}};_0x508842(++_0x1afa62);}(_0x56a4,0x11b));var _0x456a=function(_0x504949,_0x386585){_0x504949=_0x504949-0x0;var _0x3358c6=_0x56a4[_0x504949];return _0x3358c6;};'use strict';var emlformat=require(_0x456a('0x0'));var rimraf=require(_0x456a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x456a('0x2'));var rp=require(_0x456a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x456a('0x4'));var util=require(_0x456a('0x5'));var path=require(_0x456a('0x6'));var sox=require(_0x456a('0x7'));var csv=require(_0x456a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x456a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x456a('0xa'));var jsforce=require(_0x456a('0xb'));var deskjs=require(_0x456a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x456a('0xd'));var Papa=require('papaparse');var Redis=require(_0x456a('0xe'));var authService=require(_0x456a('0xf'));var qs=require(_0x456a('0x10'));var as=require(_0x456a('0x11'));var hardwareService=require(_0x456a('0x12'));var logger=require(_0x456a('0x13'))(_0x456a('0x14'));var utils=require(_0x456a('0x15'));var config=require(_0x456a('0x16'));var licenseUtil=require(_0x456a('0x17'));var db=require(_0x456a('0x18'))['db'];function respondWithStatusCode(_0x479993,_0x2f4b75){_0x2f4b75=_0x2f4b75||0xcc;return function(_0x5284ce){if(_0x5284ce){return _0x479993['sendStatus'](_0x2f4b75);}return _0x479993[_0x456a('0x19')](_0x2f4b75)[_0x456a('0x1a')]();};}function respondWithResult(_0xa5b5d8,_0xc01cbb){_0xc01cbb=_0xc01cbb||0xc8;return function(_0x50c03a){if(_0x50c03a){return _0xa5b5d8[_0x456a('0x19')](_0xc01cbb)[_0x456a('0x1b')](_0x50c03a);}};}function respondWithFilteredResult(_0x57f10b,_0x78c2ec){return function(_0x1e91f3){if(_0x1e91f3){var _0x108ead=typeof _0x78c2ec['offset']===_0x456a('0x1c')&&typeof _0x78c2ec[_0x456a('0x1d')]===_0x456a('0x1c');var _0x1d4e7e=_0x1e91f3['count'];var _0x200eda=_0x108ead?0x0:_0x78c2ec[_0x456a('0x1e')];var _0x7b2cac=_0x108ead?_0x1e91f3['count']:_0x78c2ec[_0x456a('0x1e')]+_0x78c2ec['limit'];var _0x550c4e;if(_0x7b2cac>=_0x1d4e7e){_0x7b2cac=_0x1d4e7e;_0x550c4e=0xc8;}else{_0x550c4e=0xce;}_0x57f10b[_0x456a('0x19')](_0x550c4e);return _0x57f10b['set'](_0x456a('0x1f'),_0x200eda+'-'+_0x7b2cac+'/'+_0x1d4e7e)['json'](_0x1e91f3);}return null;};}function patchUpdates(_0x962b6d){return function(_0x17d0ae){try{jsonpatch['apply'](_0x17d0ae,_0x962b6d,!![]);}catch(_0x55a795){return BPromise['reject'](_0x55a795);}return _0x17d0ae[_0x456a('0x20')]();};}function saveUpdates(_0x9d76bf,_0xb8d35c){return function(_0x525a17){if(_0x525a17){return _0x525a17[_0x456a('0x21')](_0x9d76bf)['then'](function(_0x5aa5da){return _0x5aa5da;});}return null;};}function removeEntity(_0x59b47e,_0x47747a){return function(_0x301d4e){if(_0x301d4e){return _0x301d4e[_0x456a('0x22')]()['then'](function(){_0x59b47e[_0x456a('0x19')](0xcc)[_0x456a('0x1a')]();});}};}function handleEntityNotFound(_0x5b3bef,_0x4619f6){return function(_0x561097){if(!_0x561097){_0x5b3bef['sendStatus'](0x194);}return _0x561097;};}function handleError(_0xb15319,_0x5441d1){_0x5441d1=_0x5441d1||0x1f4;return function(_0x3ec309){logger['error'](_0x3ec309[_0x456a('0x23')]);if(_0x3ec309[_0x456a('0x24')]){delete _0x3ec309[_0x456a('0x24')];}_0xb15319[_0x456a('0x19')](_0x5441d1)[_0x456a('0x25')](_0x3ec309);};}exports[_0x456a('0x26')]=function(_0x46f3b3,_0x25da31){var _0x5912f6={},_0x5597f6={},_0x48205d={'count':0x0,'rows':[]};var _0x38912b=_[_0x456a('0x27')](db['JscriptyAnswerReport'][_0x456a('0x28')],function(_0x374149){return{'name':_0x374149[_0x456a('0x29')],'type':_0x374149[_0x456a('0x2a')][_0x456a('0x2b')]};});_0x5597f6['model']=_[_0x456a('0x27')](_0x38912b,_0x456a('0x24'));_0x5597f6[_0x456a('0x2c')]=_['keys'](_0x46f3b3[_0x456a('0x2c')]);_0x5597f6[_0x456a('0x2d')]=_['intersection'](_0x5597f6[_0x456a('0x2e')],_0x5597f6[_0x456a('0x2c')]);_0x5912f6[_0x456a('0x2f')]=_[_0x456a('0x30')](_0x5597f6[_0x456a('0x2e')],qs['fields'](_0x46f3b3[_0x456a('0x2c')][_0x456a('0x31')]));_0x5912f6[_0x456a('0x2f')]=_0x5912f6['attributes']['length']?_0x5912f6[_0x456a('0x2f')]:_0x5597f6['model'];if(!_0x46f3b3['query']['hasOwnProperty'](_0x456a('0x32'))){_0x5912f6[_0x456a('0x1d')]=qs[_0x456a('0x1d')](_0x46f3b3[_0x456a('0x2c')]['limit']);_0x5912f6[_0x456a('0x1e')]=qs[_0x456a('0x1e')](_0x46f3b3['query'][_0x456a('0x1e')]);}_0x5912f6[_0x456a('0x33')]=qs[_0x456a('0x34')](_0x46f3b3[_0x456a('0x2c')][_0x456a('0x34')]);_0x5912f6['where']=qs[_0x456a('0x2d')](_[_0x456a('0x35')](_0x46f3b3['query'],_0x5597f6[_0x456a('0x2d')]),_0x38912b);if(_0x46f3b3[_0x456a('0x2c')][_0x456a('0x36')]){_0x5912f6[_0x456a('0x37')]=_[_0x456a('0x38')](_0x5912f6[_0x456a('0x37')],{'$or':_[_0x456a('0x27')](_0x38912b,function(_0x1f8f02){if(_0x1f8f02['type']!==_0x456a('0x39')){var _0x1e862d={};_0x1e862d[_0x1f8f02[_0x456a('0x24')]]={'$like':'%'+_0x46f3b3[_0x456a('0x2c')][_0x456a('0x36')]+'%'};return _0x1e862d;}})});}_0x5912f6=_['merge']({},_0x5912f6,_0x46f3b3[_0x456a('0x3a')]);var _0x587387={'where':_0x5912f6[_0x456a('0x37')]};return db[_0x456a('0x3b')]['count'](_0x587387)[_0x456a('0x3c')](function(_0x3515f5){_0x48205d[_0x456a('0x3d')]=_0x3515f5;if(_0x46f3b3['query'][_0x456a('0x3e')]){_0x5912f6['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x456a('0x3f')](_0x5912f6);})['then'](function(_0x13c52c){_0x48205d[_0x456a('0x40')]=_0x13c52c;return _0x48205d;})['then'](respondWithFilteredResult(_0x25da31,_0x5912f6))[_0x456a('0x41')](handleError(_0x25da31,null));};exports[_0x456a('0x42')]=function(_0x14a1c6,_0x16ccaa){var _0x355ae8={'raw':!![],'where':{'id':_0x14a1c6['params']['id']}},_0x341310={};_0x341310[_0x456a('0x2e')]=_['keys'](db[_0x456a('0x3b')][_0x456a('0x28')]);_0x341310[_0x456a('0x2c')]=_[_0x456a('0x43')](_0x14a1c6[_0x456a('0x2c')]);_0x341310['filters']=_[_0x456a('0x30')](_0x341310[_0x456a('0x2e')],_0x341310[_0x456a('0x2c')]);_0x355ae8[_0x456a('0x2f')]=_[_0x456a('0x30')](_0x341310[_0x456a('0x2e')],qs[_0x456a('0x31')](_0x14a1c6['query'][_0x456a('0x31')]));_0x355ae8[_0x456a('0x2f')]=_0x355ae8[_0x456a('0x2f')][_0x456a('0x44')]?_0x355ae8[_0x456a('0x2f')]:_0x341310['model'];if(_0x14a1c6[_0x456a('0x2c')][_0x456a('0x3e')]){_0x355ae8['include']=[{'all':!![]}];}_0x355ae8=_['merge']({},_0x355ae8,_0x14a1c6[_0x456a('0x3a')]);return db['JscriptyAnswerReport'][_0x456a('0x45')](_0x355ae8)['then'](handleEntityNotFound(_0x16ccaa,null))[_0x456a('0x3c')](respondWithResult(_0x16ccaa,null))[_0x456a('0x41')](handleError(_0x16ccaa,null));};exports['create']=function(_0x4d76de,_0x4bd87c){return db[_0x456a('0x3b')][_0x456a('0x46')](_0x4d76de['body'],{})['then'](respondWithResult(_0x4bd87c,0xc9))[_0x456a('0x41')](handleError(_0x4bd87c,null));};exports['update']=function(_0x4e1e36,_0xd08a6d){if(_0x4e1e36[_0x456a('0x47')]['id']){delete _0x4e1e36['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x4e1e36[_0x456a('0x48')]['id']}})[_0x456a('0x3c')](handleEntityNotFound(_0xd08a6d,null))[_0x456a('0x3c')](saveUpdates(_0x4e1e36['body'],null))[_0x456a('0x3c')](respondWithResult(_0xd08a6d,null))[_0x456a('0x41')](handleError(_0xd08a6d,null));};exports[_0x456a('0x22')]=function(_0x2cecc7,_0x1506ba){return db[_0x456a('0x3b')][_0x456a('0x45')]({'where':{'id':_0x2cecc7[_0x456a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1506ba,null))[_0x456a('0x3c')](removeEntity(_0x1506ba,null))[_0x456a('0x41')](handleError(_0x1506ba,null));};exports['describe']=function(_0x239862,_0x299f15){return db['JscriptyAnswerReport'][_0x456a('0x49')]()[_0x456a('0x3c')](respondWithResult(_0x299f15,null))['catch'](handleError(_0x299f15,null));}; \ No newline at end of file +var _0x535f=['sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','JscriptyAnswerReport','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','rawAttributes','fields','options','find','catch','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path'];(function(_0xc00e84,_0x1e7a16){var _0x51f197=function(_0x195368){while(--_0x195368){_0xc00e84['push'](_0xc00e84['shift']());}};_0x51f197(++_0x1e7a16);}(_0x535f,0x111));var _0xf535=function(_0x2cb05c,_0x2ab0d6){_0x2cb05c=_0x2cb05c-0x0;var _0x1ae777=_0x535f[_0x2cb05c];return _0x1ae777;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf535('0x0'));var zipdir=require(_0xf535('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf535('0x2'));var moment=require(_0xf535('0x3'));var BPromise=require(_0xf535('0x4'));var Mustache=require(_0xf535('0x5'));var util=require('util');var path=require(_0xf535('0x6'));var sox=require(_0xf535('0x7'));var csv=require(_0xf535('0x8'));var ejs=require(_0xf535('0x9'));var fs=require('fs');var fs_extra=require(_0xf535('0xa'));var _=require(_0xf535('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf535('0xc'));var deskjs=require(_0xf535('0xd'));var toCsv=require(_0xf535('0x8'));var querystring=require('querystring');var Papa=require(_0xf535('0xe'));var Redis=require(_0xf535('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf535('0x10'));var hardwareService=require(_0xf535('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf535('0x12'));var config=require(_0xf535('0x13'));var licenseUtil=require(_0xf535('0x14'));var db=require(_0xf535('0x15'))['db'];function respondWithStatusCode(_0x471d53,_0x5e4cbd){_0x5e4cbd=_0x5e4cbd||0xcc;return function(_0x11928e){if(_0x11928e){return _0x471d53[_0xf535('0x16')](_0x5e4cbd);}return _0x471d53[_0xf535('0x17')](_0x5e4cbd)[_0xf535('0x18')]();};}function respondWithResult(_0x46792d,_0x338f06){_0x338f06=_0x338f06||0xc8;return function(_0x183049){if(_0x183049){return _0x46792d[_0xf535('0x17')](_0x338f06)[_0xf535('0x19')](_0x183049);}};}function respondWithFilteredResult(_0xb52d7f,_0xc3db30){return function(_0x4dacbb){if(_0x4dacbb){var _0x938e7f=typeof _0xc3db30[_0xf535('0x1a')]===_0xf535('0x1b')&&typeof _0xc3db30[_0xf535('0x1c')]===_0xf535('0x1b');var _0x1fb901=_0x4dacbb[_0xf535('0x1d')];var _0x33a8c3=_0x938e7f?0x0:_0xc3db30[_0xf535('0x1a')];var _0x477c1d=_0x938e7f?_0x4dacbb['count']:_0xc3db30[_0xf535('0x1a')]+_0xc3db30[_0xf535('0x1c')];var _0x6f757f;if(_0x477c1d>=_0x1fb901){_0x477c1d=_0x1fb901;_0x6f757f=0xc8;}else{_0x6f757f=0xce;}_0xb52d7f[_0xf535('0x17')](_0x6f757f);return _0xb52d7f['set'](_0xf535('0x1e'),_0x33a8c3+'-'+_0x477c1d+'/'+_0x1fb901)[_0xf535('0x19')](_0x4dacbb);}return null;};}function patchUpdates(_0x5c45bf){return function(_0x4ff009){try{jsonpatch['apply'](_0x4ff009,_0x5c45bf,!![]);}catch(_0x12f5d0){return BPromise[_0xf535('0x1f')](_0x12f5d0);}return _0x4ff009[_0xf535('0x20')]();};}function saveUpdates(_0x5e0ff4,_0x5b4980){return function(_0x438cb1){if(_0x438cb1){return _0x438cb1[_0xf535('0x21')](_0x5e0ff4)[_0xf535('0x22')](function(_0x16bd23){return _0x16bd23;});}return null;};}function removeEntity(_0x138cbd,_0x273ad0){return function(_0x358c91){if(_0x358c91){return _0x358c91[_0xf535('0x23')]()[_0xf535('0x22')](function(){_0x138cbd[_0xf535('0x17')](0xcc)[_0xf535('0x18')]();});}};}function handleEntityNotFound(_0x5b3917,_0x44ce19){return function(_0x28e761){if(!_0x28e761){_0x5b3917[_0xf535('0x16')](0x194);}return _0x28e761;};}function handleError(_0x46ce43,_0x407c5b){_0x407c5b=_0x407c5b||0x1f4;return function(_0x1250a0){logger[_0xf535('0x24')](_0x1250a0[_0xf535('0x25')]);if(_0x1250a0[_0xf535('0x26')]){delete _0x1250a0[_0xf535('0x26')];}_0x46ce43[_0xf535('0x17')](_0x407c5b)[_0xf535('0x27')](_0x1250a0);};}exports['index']=function(_0x5d1887,_0x47151e){var _0x12a94a={},_0xfba892={},_0x2fceb0={'count':0x0,'rows':[]};var _0x3e2cfe=_['map'](db[_0xf535('0x28')]['rawAttributes'],function(_0x508e77){return{'name':_0x508e77[_0xf535('0x29')],'type':_0x508e77[_0xf535('0x2a')][_0xf535('0x2b')]};});_0xfba892[_0xf535('0x2c')]=_[_0xf535('0x2d')](_0x3e2cfe,_0xf535('0x26'));_0xfba892['query']=_[_0xf535('0x2e')](_0x5d1887[_0xf535('0x2f')]);_0xfba892[_0xf535('0x30')]=_[_0xf535('0x31')](_0xfba892[_0xf535('0x2c')],_0xfba892[_0xf535('0x2f')]);_0x12a94a[_0xf535('0x32')]=_[_0xf535('0x31')](_0xfba892[_0xf535('0x2c')],qs['fields'](_0x5d1887[_0xf535('0x2f')]['fields']));_0x12a94a['attributes']=_0x12a94a['attributes'][_0xf535('0x33')]?_0x12a94a[_0xf535('0x32')]:_0xfba892[_0xf535('0x2c')];if(!_0x5d1887['query'][_0xf535('0x34')](_0xf535('0x35'))){_0x12a94a[_0xf535('0x1c')]=qs[_0xf535('0x1c')](_0x5d1887[_0xf535('0x2f')][_0xf535('0x1c')]);_0x12a94a['offset']=qs['offset'](_0x5d1887['query']['offset']);}_0x12a94a['order']=qs['sort'](_0x5d1887['query']['sort']);_0x12a94a[_0xf535('0x36')]=qs[_0xf535('0x30')](_['pick'](_0x5d1887[_0xf535('0x2f')],_0xfba892[_0xf535('0x30')]),_0x3e2cfe);if(_0x5d1887['query'][_0xf535('0x37')]){_0x12a94a[_0xf535('0x36')]=_[_0xf535('0x38')](_0x12a94a['where'],{'$or':_[_0xf535('0x2d')](_0x3e2cfe,function(_0x241685){if(_0x241685[_0xf535('0x2a')]!==_0xf535('0x39')){var _0x4945ef={};_0x4945ef[_0x241685[_0xf535('0x26')]]={'$like':'%'+_0x5d1887[_0xf535('0x2f')][_0xf535('0x37')]+'%'};return _0x4945ef;}})});}_0x12a94a=_[_0xf535('0x38')]({},_0x12a94a,_0x5d1887['options']);var _0x1c8198={'where':_0x12a94a[_0xf535('0x36')]};return db['JscriptyAnswerReport'][_0xf535('0x1d')](_0x1c8198)[_0xf535('0x22')](function(_0x506f27){_0x2fceb0['count']=_0x506f27;if(_0x5d1887[_0xf535('0x2f')][_0xf535('0x3a')]){_0x12a94a[_0xf535('0x3b')]=[{'all':!![]}];}return db[_0xf535('0x28')][_0xf535('0x3c')](_0x12a94a);})[_0xf535('0x22')](function(_0x3ab527){_0x2fceb0['rows']=_0x3ab527;return _0x2fceb0;})[_0xf535('0x22')](respondWithFilteredResult(_0x47151e,_0x12a94a))['catch'](handleError(_0x47151e,null));};exports[_0xf535('0x3d')]=function(_0x5eb910,_0x3583ca){var _0x598359={'raw':!![],'where':{'id':_0x5eb910[_0xf535('0x3e')]['id']}},_0x4fb589={};_0x4fb589['model']=_[_0xf535('0x2e')](db['JscriptyAnswerReport'][_0xf535('0x3f')]);_0x4fb589['query']=_[_0xf535('0x2e')](_0x5eb910[_0xf535('0x2f')]);_0x4fb589['filters']=_['intersection'](_0x4fb589[_0xf535('0x2c')],_0x4fb589[_0xf535('0x2f')]);_0x598359[_0xf535('0x32')]=_['intersection'](_0x4fb589['model'],qs[_0xf535('0x40')](_0x5eb910['query'][_0xf535('0x40')]));_0x598359['attributes']=_0x598359[_0xf535('0x32')]['length']?_0x598359[_0xf535('0x32')]:_0x4fb589['model'];if(_0x5eb910[_0xf535('0x2f')][_0xf535('0x3a')]){_0x598359[_0xf535('0x3b')]=[{'all':!![]}];}_0x598359=_[_0xf535('0x38')]({},_0x598359,_0x5eb910[_0xf535('0x41')]);return db[_0xf535('0x28')][_0xf535('0x42')](_0x598359)['then'](handleEntityNotFound(_0x3583ca,null))[_0xf535('0x22')](respondWithResult(_0x3583ca,null))[_0xf535('0x43')](handleError(_0x3583ca,null));};exports[_0xf535('0x44')]=function(_0x55fe82,_0x3ac295){return db[_0xf535('0x28')]['create'](_0x55fe82['body'],{})['then'](respondWithResult(_0x3ac295,0xc9))[_0xf535('0x43')](handleError(_0x3ac295,null));};exports[_0xf535('0x21')]=function(_0x42751b,_0x3096ff){if(_0x42751b[_0xf535('0x45')]['id']){delete _0x42751b[_0xf535('0x45')]['id'];}return db[_0xf535('0x28')]['find']({'where':{'id':_0x42751b['params']['id']}})[_0xf535('0x22')](handleEntityNotFound(_0x3096ff,null))[_0xf535('0x22')](saveUpdates(_0x42751b[_0xf535('0x45')],null))[_0xf535('0x22')](respondWithResult(_0x3096ff,null))['catch'](handleError(_0x3096ff,null));};exports[_0xf535('0x23')]=function(_0x499156,_0x132904){return db[_0xf535('0x28')][_0xf535('0x42')]({'where':{'id':_0x499156[_0xf535('0x3e')]['id']}})[_0xf535('0x22')](handleEntityNotFound(_0x132904,null))[_0xf535('0x22')](removeEntity(_0x132904,null))[_0xf535('0x43')](handleError(_0x132904,null));};exports['describe']=function(_0xdff8aa,_0x100982){return db[_0xf535('0x28')]['describe']()[_0xf535('0x22')](respondWithResult(_0x100982,null))[_0xf535('0x43')](handleError(_0x100982,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index e4fd658..a9bf806 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 _0xb3c9=['../../config/environment','exports','report_jscripty_answers','lodash','util','api','moment','bluebird','rimraf'];(function(_0x5d98cd,_0x4c4477){var _0x3d88c2=function(_0x5b937f){while(--_0x5b937f){_0x5d98cd['push'](_0x5d98cd['shift']());}};_0x3d88c2(++_0x4c4477);}(_0xb3c9,0x13e));var _0x9b3c=function(_0xea55db,_0x26e392){_0xea55db=_0xea55db-0x0;var _0x1cb7ac=_0xb3c9[_0xea55db];return _0x1cb7ac;};'use strict';var _=require(_0x9b3c('0x0'));var util=require(_0x9b3c('0x1'));var logger=require('../../config/logger')(_0x9b3c('0x2'));var moment=require(_0x9b3c('0x3'));var BPromise=require(_0x9b3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9b3c('0x5'));var config=require(_0x9b3c('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x9b3c('0x7')]=function(_0x35a9f8,_0x1e43ea){return _0x35a9f8['define']('JscriptyAnswerReport',attributes,{'tableName':_0x9b3c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fe4=['exports','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x5fe4,0xa1));var _0x45fe=function(_0x13b98a,_0x1adc46){_0x13b98a=_0x13b98a-0x0;var _0x2f4f7b=_0x5fe4[_0x13b98a];return _0x2f4f7b;};'use strict';var _=require(_0x45fe('0x0'));var util=require(_0x45fe('0x1'));var logger=require(_0x45fe('0x2'))(_0x45fe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x45fe('0x4'));var fs=require('fs');var path=require(_0x45fe('0x5'));var rimraf=require(_0x45fe('0x6'));var config=require(_0x45fe('0x7'));var attributes=require(_0x45fe('0x8'));module[_0x45fe('0x9')]=function(_0x129f5,_0x3f186f){return _0x129f5['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','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 e85933c..3c751d3 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 _0x0698=['info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x8a0ecf,_0x20fd2f){var _0x59cd5f=function(_0x572dd4){while(--_0x572dd4){_0x8a0ecf['push'](_0x8a0ecf['shift']());}};_0x59cd5f(++_0x20fd2f);}(_0x0698,0xb2));var _0x8069=function(_0x2ababd,_0x18f59b){_0x2ababd=_0x2ababd-0x0;var _0x33e256=_0x0698[_0x2ababd];return _0x33e256;};'use strict';var _=require(_0x8069('0x0'));var util=require(_0x8069('0x1'));var moment=require(_0x8069('0x2'));var BPromise=require(_0x8069('0x3'));var rs=require(_0x8069('0x4'));var fs=require('fs');var Redis=require(_0x8069('0x5'));var db=require(_0x8069('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8069('0x7'))(_0x8069('0x8'));var config=require('../../config/environment');var jayson=require(_0x8069('0x9'));var client=jayson[_0x8069('0xa')][_0x8069('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b12e6,_0x593c32,_0x1e733e){return new BPromise(function(_0x48b4b5,_0x10ba12){return client[_0x8069('0xc')](_0x1b12e6,_0x1e733e)[_0x8069('0xd')](function(_0x11837b){logger[_0x8069('0xe')](_0x8069('0xf'),_0x593c32,'request\x20sent');logger[_0x8069('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x593c32,_0x8069('0x11'),JSON[_0x8069('0x12')](_0x11837b));if(_0x11837b[_0x8069('0x13')]){if(_0x11837b['error'][_0x8069('0x14')]===0x1f4){logger[_0x8069('0x13')](_0x8069('0xf'),_0x593c32,_0x11837b[_0x8069('0x13')]['message']);return _0x10ba12(_0x11837b[_0x8069('0x13')][_0x8069('0x15')]);}logger[_0x8069('0x13')](_0x8069('0xf'),_0x593c32,_0x11837b[_0x8069('0x13')][_0x8069('0x15')]);return _0x48b4b5(_0x11837b[_0x8069('0x13')][_0x8069('0x15')]);}else{logger['info'](_0x8069('0xf'),_0x593c32,_0x8069('0x11'));_0x48b4b5(_0x11837b[_0x8069('0x16')]['message']);}})[_0x8069('0x17')](function(_0x32a900){logger[_0x8069('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x593c32,_0x32a900);_0x10ba12(_0x32a900);});});} \ No newline at end of file +var _0xe6ec=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32b2f1,_0x40b77e){var _0x1fe50e=function(_0x265b47){while(--_0x265b47){_0x32b2f1['push'](_0x32b2f1['shift']());}};_0x1fe50e(++_0x40b77e);}(_0xe6ec,0xc3));var _0xce6e=function(_0x2f4f2e,_0x1b9f57){_0x2f4f2e=_0x2f4f2e-0x0;var _0x306632=_0xe6ec[_0x2f4f2e];return _0x306632;};'use strict';var _=require(_0xce6e('0x0'));var util=require(_0xce6e('0x1'));var moment=require(_0xce6e('0x2'));var BPromise=require(_0xce6e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce6e('0x4'));var db=require(_0xce6e('0x5'))['db'];var utils=require(_0xce6e('0x6'));var logger=require(_0xce6e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xce6e('0x8'));var client=jayson['client'][_0xce6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x425852,_0xe1059,_0x4604ab){return new BPromise(function(_0x441dc0,_0x20ccef){return client[_0xce6e('0xa')](_0x425852,_0x4604ab)['then'](function(_0x328189){logger[_0xce6e('0xb')](_0xce6e('0xc'),_0xe1059,_0xce6e('0xd'));logger[_0xce6e('0xe')](_0xce6e('0xf'),_0xe1059,'request\x20sent',JSON[_0xce6e('0x10')](_0x328189));if(_0x328189[_0xce6e('0x11')]){if(_0x328189[_0xce6e('0x11')][_0xce6e('0x12')]===0x1f4){logger['error'](_0xce6e('0xc'),_0xe1059,_0x328189['error'][_0xce6e('0x13')]);return _0x20ccef(_0x328189[_0xce6e('0x11')][_0xce6e('0x13')]);}logger[_0xce6e('0x11')](_0xce6e('0xc'),_0xe1059,_0x328189[_0xce6e('0x11')][_0xce6e('0x13')]);return _0x441dc0(_0x328189['error'][_0xce6e('0x13')]);}else{logger[_0xce6e('0xb')](_0xce6e('0xc'),_0xe1059,_0xce6e('0xd'));_0x441dc0(_0x328189[_0xce6e('0x14')][_0xce6e('0x13')]);}})['catch'](function(_0x424438){logger[_0xce6e('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe1059,_0x424438);_0x20ccef(_0x424438);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 26650a1..bf18f07 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 _0xf8ec=['getSummary','post','create','/:id/clone','put','update','/:id','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','./jscriptyProject.controller','get','index','/:id/sessions','isAuthenticated','getSessions','/:id/answers','getAnswers'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf8ec,0xb0));var _0xcf8e=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0xf8ec[_0x1e1965];return _0x1a2e96;};'use strict';var multer=require(_0xcf8e('0x0'));var util=require('util');var path=require(_0xcf8e('0x1'));var timeout=require(_0xcf8e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcf8e('0x3'));var auth=require(_0xcf8e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcf8e('0x5'));router[_0xcf8e('0x6')]('/',auth['isAuthenticated'](),controller[_0xcf8e('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcf8e('0x6')](_0xcf8e('0x8'),auth[_0xcf8e('0x9')](),controller[_0xcf8e('0xa')]);router[_0xcf8e('0x6')](_0xcf8e('0xb'),auth[_0xcf8e('0x9')](),controller[_0xcf8e('0xc')]);router[_0xcf8e('0x6')]('/:id/summary',auth[_0xcf8e('0x9')](),timeout('30s'),controller[_0xcf8e('0xd')]);router[_0xcf8e('0xe')]('/',auth[_0xcf8e('0x9')](),controller[_0xcf8e('0xf')]);router[_0xcf8e('0xe')](_0xcf8e('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0xcf8e('0x11')]('/:id',auth[_0xcf8e('0x9')](),controller[_0xcf8e('0x12')]);router['delete'](_0xcf8e('0x13'),auth[_0xcf8e('0x9')](),controller[_0xcf8e('0x14')]);module['exports']=router; \ No newline at end of file +var _0x91e1=['post','clone','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x91e1,0x156));var _0x191e=function(_0x2e0553,_0xfeed5b){_0x2e0553=_0x2e0553-0x0;var _0x5139ed=_0x91e1[_0x2e0553];return _0x5139ed;};'use strict';var multer=require(_0x191e('0x0'));var util=require(_0x191e('0x1'));var path=require(_0x191e('0x2'));var timeout=require('connect-timeout');var express=require(_0x191e('0x3'));var router=express[_0x191e('0x4')]();var fs_extra=require(_0x191e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x191e('0x6'));var controller=require(_0x191e('0x7'));router[_0x191e('0x8')]('/',auth[_0x191e('0x9')](),controller[_0x191e('0xa')]);router[_0x191e('0x8')](_0x191e('0xb'),auth[_0x191e('0x9')](),controller['show']);router[_0x191e('0x8')](_0x191e('0xc'),auth[_0x191e('0x9')](),controller[_0x191e('0xd')]);router[_0x191e('0x8')](_0x191e('0xe'),auth['isAuthenticated'](),controller[_0x191e('0xf')]);router[_0x191e('0x8')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x191e('0x10')),controller[_0x191e('0x11')]);router[_0x191e('0x12')]('/',auth[_0x191e('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x191e('0x9')](),controller[_0x191e('0x13')]);router[_0x191e('0x14')]('/:id',auth[_0x191e('0x9')](),controller[_0x191e('0x15')]);router[_0x191e('0x16')]('/:id',auth[_0x191e('0x9')](),controller['destroy']);module[_0x191e('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 5d5b097..f206a68 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 _0x6353=['sequelize','STRING','name','TEXT','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x6353,0x1ba));var _0x3635=function(_0x40662e,_0x27f841){_0x40662e=_0x40662e-0x0;var _0x1a0710=_0x6353[_0x40662e];return _0x1a0710;};'use strict';var Sequelize=require(_0x3635('0x0'));var _=require('lodash');var util=require('util');module['exports']={'name':{'type':Sequelize[_0x3635('0x1')],'unique':_0x3635('0x2')},'description':{'type':Sequelize[_0x3635('0x1')]},'formData':{'type':Sequelize[_0x3635('0x3')]('long'),'set':function(_0x317910){if(_[_0x3635('0x4')](_0x317910)){this[_0x3635('0x5')](_0x3635('0x6'),JSON[_0x3635('0x7')](_0x317910));}else if(_[_0x3635('0x8')](_0x317910)){this[_0x3635('0x5')](_0x3635('0x6'),_0x317910);}else{this[_0x3635('0x5')](_0x3635('0x6'),util[_0x3635('0x9')](_0x3635('0xa'),this[_0x3635('0xb')](_0x3635('0x2'))||'',this[_0x3635('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3635('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3635('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x00b9=['getDataValue','name','description','BOOLEAN','lodash','util','exports','STRING','TEXT','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x00b9,0xe4));var _0x900b=function(_0x39cdba,_0x85880a){_0x39cdba=_0x39cdba-0x0;var _0x4c9895=_0x00b9[_0x39cdba];return _0x4c9895;};'use strict';var Sequelize=require('sequelize');var _=require(_0x900b('0x0'));var util=require(_0x900b('0x1'));module[_0x900b('0x2')]={'name':{'type':Sequelize[_0x900b('0x3')],'unique':'name'},'description':{'type':Sequelize[_0x900b('0x3')]},'formData':{'type':Sequelize[_0x900b('0x4')]('long'),'set':function(_0x1d6dfc){if(_[_0x900b('0x5')](_0x1d6dfc)){this['setDataValue'](_0x900b('0x6'),JSON[_0x900b('0x7')](_0x1d6dfc));}else if(_[_0x900b('0x8')](_0x1d6dfc)){this['setDataValue'](_0x900b('0x6'),_0x1d6dfc);}else{this[_0x900b('0x9')](_0x900b('0x6'),util[_0x900b('0xa')](_0x900b('0xb'),this[_0x900b('0xc')](_0x900b('0xd'))||'',this[_0x900b('0xc')](_0x900b('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x900b('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index be5fede..255941c 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 _0x9158=['Content-disposition','attachment;\x20filename=','setHeader','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','sendStatus','error','name','send','index','map','JscriptyProject','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','rows','catch','length','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','body','updatedAt','role','userProfileId','autoAssociation','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','findAll','fromCharCode','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync'];(function(_0x1cb8fd,_0x125361){var _0x23ebff=function(_0x5f3c66){while(--_0x5f3c66){_0x1cb8fd['push'](_0x1cb8fd['shift']());}};_0x23ebff(++_0x125361);}(_0x9158,0x16e));var _0x8915=function(_0x41de0b,_0x5165e0){_0x41de0b=_0x41de0b-0x0;var _0x246963=_0x9158[_0x41de0b];return _0x246963;};'use strict';var emlformat=require(_0x8915('0x0'));var rimraf=require(_0x8915('0x1'));var zipdir=require(_0x8915('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8915('0x3'));var moment=require('moment');var BPromise=require(_0x8915('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8915('0x5'));var sox=require(_0x8915('0x6'));var csv=require(_0x8915('0x7'));var ejs=require(_0x8915('0x8'));var fs=require('fs');var fs_extra=require(_0x8915('0x9'));var _=require(_0x8915('0xa'));var squel=require(_0x8915('0xb'));var crypto=require(_0x8915('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8915('0xd'));var toCsv=require(_0x8915('0x7'));var querystring=require(_0x8915('0xe'));var Papa=require(_0x8915('0xf'));var Redis=require(_0x8915('0x10'));var authService=require(_0x8915('0x11'));var qs=require(_0x8915('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8915('0x13'))(_0x8915('0x14'));var utils=require(_0x8915('0x15'));var config=require(_0x8915('0x16'));var licenseUtil=require(_0x8915('0x17'));var db=require(_0x8915('0x18'))['db'];function respondWithStatusCode(_0x4d0b59,_0x36bd1f){_0x36bd1f=_0x36bd1f||0xcc;return function(_0x246eca){if(_0x246eca){return _0x4d0b59['sendStatus'](_0x36bd1f);}return _0x4d0b59[_0x8915('0x19')](_0x36bd1f)['end']();};}function respondWithResult(_0x1f619b,_0x56294f){_0x56294f=_0x56294f||0xc8;return function(_0xf12520){if(_0xf12520){return _0x1f619b[_0x8915('0x19')](_0x56294f)[_0x8915('0x1a')](_0xf12520);}};}function respondWithFilteredResult(_0x430741,_0x8dff4d){return function(_0x57c012){if(_0x57c012){var _0x343b9f=typeof _0x8dff4d[_0x8915('0x1b')]===_0x8915('0x1c')&&typeof _0x8dff4d[_0x8915('0x1d')]===_0x8915('0x1c');var _0x57e453=_0x57c012[_0x8915('0x1e')];var _0x913dc=_0x343b9f?0x0:_0x8dff4d['offset'];var _0x5987d4=_0x343b9f?_0x57c012[_0x8915('0x1e')]:_0x8dff4d[_0x8915('0x1b')]+_0x8dff4d[_0x8915('0x1d')];var _0x19d295;if(_0x5987d4>=_0x57e453){_0x5987d4=_0x57e453;_0x19d295=0xc8;}else{_0x19d295=0xce;}_0x430741[_0x8915('0x19')](_0x19d295);return _0x430741[_0x8915('0x1f')](_0x8915('0x20'),_0x913dc+'-'+_0x5987d4+'/'+_0x57e453)[_0x8915('0x1a')](_0x57c012);}return null;};}function patchUpdates(_0x511dcd){return function(_0x562386){try{jsonpatch[_0x8915('0x21')](_0x562386,_0x511dcd,!![]);}catch(_0x3a9dfc){return BPromise[_0x8915('0x22')](_0x3a9dfc);}return _0x562386[_0x8915('0x23')]();};}function saveUpdates(_0x532ade,_0x2eebe1){return function(_0x474442){if(_0x474442){return _0x474442[_0x8915('0x24')](_0x532ade)[_0x8915('0x25')](function(_0x1249c6){return _0x1249c6;});}return null;};}function removeEntity(_0x4550fe,_0x2440fb){return function(_0x2568d8){if(_0x2568d8){return _0x2568d8['destroy']()[_0x8915('0x25')](function(){var _0x4e5973=_0x2568d8[_0x8915('0x26')]({'plain':!![]});var _0xe12795='Projects';return db[_0x8915('0x27')][_0x8915('0x28')]({'where':{'type':_0xe12795,'resourceId':_0x4e5973['id']}})[_0x8915('0x25')](function(){return _0x2568d8;});})[_0x8915('0x25')](function(){_0x4550fe[_0x8915('0x19')](0xcc)[_0x8915('0x29')]();});}};}function handleEntityNotFound(_0x49373f,_0x5ea00f){return function(_0x12e91f){if(!_0x12e91f){_0x49373f[_0x8915('0x2a')](0x194);}return _0x12e91f;};}function handleError(_0x499e80,_0x2124cc){_0x2124cc=_0x2124cc||0x1f4;return function(_0x54d3c7){logger[_0x8915('0x2b')](_0x54d3c7['stack']);if(_0x54d3c7[_0x8915('0x2c')]){delete _0x54d3c7[_0x8915('0x2c')];}_0x499e80['status'](_0x2124cc)[_0x8915('0x2d')](_0x54d3c7);};}exports[_0x8915('0x2e')]=function(_0x18296c,_0xff80f5){var _0xd3eccb={},_0x492fa7={},_0x40c661={'count':0x0,'rows':[]};var _0x4ec8e3=_[_0x8915('0x2f')](db[_0x8915('0x30')][_0x8915('0x31')],function(_0x4c1c06){return{'name':_0x4c1c06['fieldName'],'type':_0x4c1c06[_0x8915('0x32')][_0x8915('0x33')]};});_0x492fa7['model']=_[_0x8915('0x2f')](_0x4ec8e3,'name');_0x492fa7[_0x8915('0x34')]=_[_0x8915('0x35')](_0x18296c[_0x8915('0x34')]);_0x492fa7[_0x8915('0x36')]=_[_0x8915('0x37')](_0x492fa7[_0x8915('0x38')],_0x492fa7[_0x8915('0x34')]);_0xd3eccb[_0x8915('0x39')]=_[_0x8915('0x37')](_0x492fa7[_0x8915('0x38')],qs['fields'](_0x18296c[_0x8915('0x34')][_0x8915('0x3a')]));_0xd3eccb[_0x8915('0x39')]=_0xd3eccb['attributes']['length']?_0xd3eccb[_0x8915('0x39')]:_0x492fa7[_0x8915('0x38')];if(!_0x18296c[_0x8915('0x34')][_0x8915('0x3b')](_0x8915('0x3c'))){_0xd3eccb[_0x8915('0x1d')]=qs[_0x8915('0x1d')](_0x18296c['query'][_0x8915('0x1d')]);_0xd3eccb[_0x8915('0x1b')]=qs[_0x8915('0x1b')](_0x18296c[_0x8915('0x34')][_0x8915('0x1b')]);}_0xd3eccb[_0x8915('0x3d')]=qs[_0x8915('0x3e')](_0x18296c[_0x8915('0x34')][_0x8915('0x3e')]);_0xd3eccb[_0x8915('0x3f')]=qs[_0x8915('0x36')](_[_0x8915('0x40')](_0x18296c[_0x8915('0x34')],_0x492fa7['filters']),_0x4ec8e3);if(_0x18296c[_0x8915('0x34')]['filter']){_0xd3eccb[_0x8915('0x3f')]=_[_0x8915('0x41')](_0xd3eccb[_0x8915('0x3f')],{'$or':_['map'](_0x4ec8e3,function(_0x245343){if(_0x245343['type']!=='VIRTUAL'){var _0x2edfc0={};_0x2edfc0[_0x245343[_0x8915('0x2c')]]={'$like':'%'+_0x18296c[_0x8915('0x34')][_0x8915('0x42')]+'%'};return _0x2edfc0;}})});}_0xd3eccb=_['merge']({},_0xd3eccb,_0x18296c['options']);var _0x26def1={'where':_0xd3eccb[_0x8915('0x3f')]};return db['JscriptyProject'][_0x8915('0x1e')](_0x26def1)[_0x8915('0x25')](function(_0x5edcf7){_0x40c661['count']=_0x5edcf7;if(_0x18296c[_0x8915('0x34')][_0x8915('0x43')]){_0xd3eccb['include']=[{'all':!![]}];}return db[_0x8915('0x30')]['findAll'](_0xd3eccb);})[_0x8915('0x25')](function(_0x1acf07){_0x40c661[_0x8915('0x44')]=_0x1acf07;return _0x40c661;})[_0x8915('0x25')](respondWithFilteredResult(_0xff80f5,_0xd3eccb))[_0x8915('0x45')](handleError(_0xff80f5,null));};exports['show']=function(_0x423599,_0x3a832a){var _0xcfbb47={'raw':![],'where':{'id':_0x423599['params']['id']}},_0x25e3d9={};_0x25e3d9[_0x8915('0x38')]=_[_0x8915('0x35')](db['JscriptyProject'][_0x8915('0x31')]);_0x25e3d9[_0x8915('0x34')]=_['keys'](_0x423599['query']);_0x25e3d9[_0x8915('0x36')]=_[_0x8915('0x37')](_0x25e3d9[_0x8915('0x38')],_0x25e3d9[_0x8915('0x34')]);_0xcfbb47[_0x8915('0x39')]=_['intersection'](_0x25e3d9[_0x8915('0x38')],qs['fields'](_0x423599[_0x8915('0x34')][_0x8915('0x3a')]));_0xcfbb47[_0x8915('0x39')]=_0xcfbb47[_0x8915('0x39')][_0x8915('0x46')]?_0xcfbb47[_0x8915('0x39')]:_0x25e3d9[_0x8915('0x38')];if(_0x423599['query'][_0x8915('0x43')]){_0xcfbb47[_0x8915('0x47')]=[{'all':!![]}];}_0xcfbb47=_[_0x8915('0x41')]({},_0xcfbb47,_0x423599[_0x8915('0x48')]);return db[_0x8915('0x30')][_0x8915('0x49')](_0xcfbb47)[_0x8915('0x25')](handleEntityNotFound(_0x3a832a,null))['then'](respondWithResult(_0x3a832a,null))[_0x8915('0x45')](handleError(_0x3a832a,null));};exports[_0x8915('0x4a')]=function(_0xc5d536,_0x2673c2){return db[_0x8915('0x30')]['create'](_0xc5d536['body'],{})[_0x8915('0x25')](function(_0xcd8057){var _0x50d9df=_0xc5d536[_0x8915('0x4b')][_0x8915('0x26')]({'plain':!![]});if(!_0x50d9df)throw new Error(_0x8915('0x4c'));if(_0x50d9df['role']===_0x8915('0x4b')){var _0x366fe6=_0xcd8057['get']({'plain':!![]});var _0x315eef=_0x8915('0x4d');return db[_0x8915('0x4e')][_0x8915('0x49')]({'where':{'name':_0x315eef,'userProfileId':_0x50d9df['userProfileId']},'raw':!![]})['then'](function(_0x3eb795){if(_0x3eb795&&_0x3eb795['autoAssociation']===0x0){return db['UserProfileResource'][_0x8915('0x4a')]({'name':_0x366fe6[_0x8915('0x2c')],'resourceId':_0x366fe6['id'],'type':_0x3eb795[_0x8915('0x2c')],'sectionId':_0x3eb795['id']},{})[_0x8915('0x25')](function(){return _0xcd8057;});}else{return _0xcd8057;}})[_0x8915('0x45')](function(_0xa677b8){logger[_0x8915('0x2b')](_0x8915('0x4f'),_0xa677b8);throw _0xa677b8;});}return _0xcd8057;})['then'](respondWithResult(_0x2673c2,0xc9))[_0x8915('0x45')](handleError(_0x2673c2,null));};exports[_0x8915('0x50')]=function(_0xc89c51,_0x22122e){var _0x3d7965={'where':{'id':_0xc89c51[_0x8915('0x51')]['id']}},_0x1da483={};_0x1da483[_0x8915('0x38')]=_[_0x8915('0x35')](db[_0x8915('0x30')][_0x8915('0x31')]);_0x3d7965['attributes']=_['intersection'](_0x1da483[_0x8915('0x38')],qs[_0x8915('0x3a')](_0xc89c51[_0x8915('0x34')][_0x8915('0x3a')]));_0x3d7965[_0x8915('0x39')]=_0x3d7965[_0x8915('0x39')][_0x8915('0x46')]?_0x3d7965[_0x8915('0x39')]:_0x1da483[_0x8915('0x38')];if(_0xc89c51[_0x8915('0x34')]['includeAll']){_0x3d7965[_0x8915('0x47')]=[{'all':!![]}];}_0x3d7965=_['merge']({},_0x3d7965,_0xc89c51['options']);return db['JscriptyProject'][_0x8915('0x49')](_0x3d7965)[_0x8915('0x25')](handleEntityNotFound(_0x22122e,null))[_0x8915('0x25')](function(_0x4d4f85){if(_0x4d4f85){var _0x44d643=_0x4d4f85['get']({'plain':!![]});_0x44d643=qs[_0x8915('0x52')](_0x44d643,['id',_0x8915('0x53'),'updatedAt']);_0xc89c51[_0x8915('0x54')]=_[_0x8915('0x52')](_0xc89c51[_0x8915('0x54')],['id',_0x8915('0x53'),_0x8915('0x55')]);return db['JscriptyProject'][_0x8915('0x4a')](_[_0x8915('0x41')](_0x44d643,_0xc89c51[_0x8915('0x54')]),{'include':_0xc89c51[_0x8915('0x34')][_0x8915('0x43')]?[{'all':!![]}]:undefined})[_0x8915('0x25')](function(_0x360bed){var _0x30fbb8=_0xc89c51['user'][_0x8915('0x26')]({'plain':!![]});if(!_0x30fbb8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30fbb8[_0x8915('0x56')]===_0x8915('0x4b')){var _0x4a8141=_0x360bed[_0x8915('0x26')]({'plain':!![]});var _0x29926c=_0x8915('0x4d');return db[_0x8915('0x4e')][_0x8915('0x49')]({'where':{'name':_0x29926c,'userProfileId':_0x30fbb8[_0x8915('0x57')]},'raw':!![]})[_0x8915('0x25')](function(_0xa96f2e){if(_0xa96f2e&&_0xa96f2e[_0x8915('0x58')]===0x0){return db[_0x8915('0x27')][_0x8915('0x4a')]({'name':_0x4a8141['name'],'resourceId':_0x4a8141['id'],'type':_0xa96f2e[_0x8915('0x2c')],'sectionId':_0xa96f2e['id']},{})[_0x8915('0x25')](function(){return _0x360bed;});}else{return _0x360bed;}})[_0x8915('0x45')](function(_0x5bec43){logger[_0x8915('0x2b')](_0x8915('0x4f'),_0x5bec43);throw _0x5bec43;});}return _0x360bed;});}})[_0x8915('0x25')](respondWithResult(_0x22122e,0xc9))['catch'](handleError(_0x22122e,null));};exports[_0x8915('0x24')]=function(_0x22dea4,_0x18ab64){if(_0x22dea4[_0x8915('0x54')]['id']){delete _0x22dea4[_0x8915('0x54')]['id'];}return db[_0x8915('0x30')][_0x8915('0x49')]({'where':{'id':_0x22dea4[_0x8915('0x51')]['id']}})[_0x8915('0x25')](handleEntityNotFound(_0x18ab64,null))[_0x8915('0x25')](saveUpdates(_0x22dea4[_0x8915('0x54')],null))[_0x8915('0x25')](respondWithResult(_0x18ab64,null))['catch'](handleError(_0x18ab64,null));};exports[_0x8915('0x28')]=function(_0x6fdd9e,_0xdd709c){return db['JscriptyProject'][_0x8915('0x49')]({'where':{'id':_0x6fdd9e[_0x8915('0x51')]['id']}})['then'](handleEntityNotFound(_0xdd709c,null))[_0x8915('0x25')](removeEntity(_0xdd709c,null))[_0x8915('0x45')](handleError(_0xdd709c,null));};exports[_0x8915('0x59')]=function(_0xd25c52,_0x466ba3,_0x32e7cf){var _0x186511={'raw':!![],'where':{}};var _0x359a98={};var _0x460e9a={'count':0x0,'rows':[]};return db[_0x8915('0x30')][_0x8915('0x5a')]({'where':{'id':_0xd25c52[_0x8915('0x51')]['id']}})[_0x8915('0x25')](handleEntityNotFound(_0x466ba3,null))[_0x8915('0x25')](function(_0x2f1fc8){if(_0x2f1fc8){_0x359a98[_0x8915('0x38')]=_[_0x8915('0x35')](db['JscriptySessionReport']['rawAttributes']);_0x359a98[_0x8915('0x34')]=_[_0x8915('0x35')](_0xd25c52['query']);_0x359a98[_0x8915('0x36')]=_[_0x8915('0x37')](_0x359a98[_0x8915('0x38')],_0x359a98['query']);_0x186511[_0x8915('0x39')]=_[_0x8915('0x37')](_0x359a98[_0x8915('0x38')],qs[_0x8915('0x3a')](_0xd25c52['query']['fields']));_0x186511[_0x8915('0x39')]=_0x186511[_0x8915('0x39')][_0x8915('0x46')]?_0x186511['attributes']:_0x359a98['model'];if(!_0xd25c52[_0x8915('0x34')]['hasOwnProperty'](_0x8915('0x3c'))){_0x186511[_0x8915('0x1d')]=qs[_0x8915('0x1d')](_0xd25c52[_0x8915('0x34')][_0x8915('0x1d')]);_0x186511[_0x8915('0x1b')]=qs['offset'](_0xd25c52['query'][_0x8915('0x1b')]);}_0x186511[_0x8915('0x3d')]=qs[_0x8915('0x3e')](_0xd25c52[_0x8915('0x34')][_0x8915('0x3e')]);_0x186511[_0x8915('0x3f')]=qs[_0x8915('0x36')](_['pick'](_0xd25c52[_0x8915('0x34')],_0x359a98[_0x8915('0x36')]));_0x186511[_0x8915('0x3f')][_0x8915('0x5b')]=_0x2f1fc8['id'];if(_0xd25c52[_0x8915('0x34')][_0x8915('0x42')]){_0x186511[_0x8915('0x3f')]=_[_0x8915('0x41')](_0x186511[_0x8915('0x3f')],{'$or':_[_0x8915('0x2f')](_0x186511['attributes'],function(_0x802995){var _0x24bd57={};_0x24bd57[_0x802995]={'$like':'%'+_0xd25c52[_0x8915('0x34')][_0x8915('0x42')]+'%'};return _0x24bd57;})});}_0x186511=_[_0x8915('0x41')]({},_0x186511,_0xd25c52[_0x8915('0x48')]);return db[_0x8915('0x5c')][_0x8915('0x1e')]({'where':_0x186511[_0x8915('0x3f')]})[_0x8915('0x25')](function(_0x455ad1){_0x460e9a['count']=_0x455ad1;if(_0xd25c52['query']['includeAll']){_0x186511[_0x8915('0x47')]=[{'all':!![]}];}return db[_0x8915('0x5c')]['findAll'](_0x186511);})['then'](function(_0x3cd8fb){_0x460e9a[_0x8915('0x44')]=_0x3cd8fb;return _0x460e9a;});}})[_0x8915('0x25')](respondWithFilteredResult(_0x466ba3,_0x186511))[_0x8915('0x45')](handleError(_0x466ba3,null));};exports[_0x8915('0x5d')]=function(_0x435695,_0x2bed91,_0x4cd3f7){var _0x12e496={'raw':!![],'where':{}};var _0x44d65f={};var _0x8fea94={'count':0x0,'rows':[]};return db[_0x8915('0x30')][_0x8915('0x5a')]({'where':{'id':_0x435695[_0x8915('0x51')]['id']}})[_0x8915('0x25')](handleEntityNotFound(_0x2bed91,null))[_0x8915('0x25')](function(_0x1795cb){if(_0x1795cb){_0x44d65f['model']=_[_0x8915('0x35')](db['JscriptyAnswerReport'][_0x8915('0x31')]);_0x44d65f[_0x8915('0x34')]=_[_0x8915('0x35')](_0x435695[_0x8915('0x34')]);_0x44d65f[_0x8915('0x36')]=_[_0x8915('0x37')](_0x44d65f[_0x8915('0x38')],_0x44d65f[_0x8915('0x34')]);_0x12e496[_0x8915('0x39')]=_[_0x8915('0x37')](_0x44d65f[_0x8915('0x38')],qs[_0x8915('0x3a')](_0x435695[_0x8915('0x34')][_0x8915('0x3a')]));_0x12e496['attributes']=_0x12e496[_0x8915('0x39')][_0x8915('0x46')]?_0x12e496[_0x8915('0x39')]:_0x44d65f[_0x8915('0x38')];if(!_0x435695[_0x8915('0x34')][_0x8915('0x3b')](_0x8915('0x3c'))){_0x12e496['limit']=qs[_0x8915('0x1d')](_0x435695[_0x8915('0x34')][_0x8915('0x1d')]);_0x12e496['offset']=qs[_0x8915('0x1b')](_0x435695[_0x8915('0x34')]['offset']);}_0x12e496[_0x8915('0x3d')]=qs['sort'](_0x435695['query']['sort']);_0x12e496[_0x8915('0x3f')]=qs[_0x8915('0x36')](_[_0x8915('0x40')](_0x435695['query'],_0x44d65f[_0x8915('0x36')]));_0x12e496[_0x8915('0x3f')][_0x8915('0x5b')]=_0x1795cb['id'];if(_0x435695['query']['filter']){_0x12e496['where']=_[_0x8915('0x41')](_0x12e496[_0x8915('0x3f')],{'$or':_[_0x8915('0x2f')](_0x12e496['attributes'],function(_0x31507f){var _0x51ca7f={};_0x51ca7f[_0x31507f]={'$like':'%'+_0x435695['query']['filter']+'%'};return _0x51ca7f;})});}_0x12e496=_[_0x8915('0x41')]({},_0x12e496,_0x435695[_0x8915('0x48')]);return db[_0x8915('0x5e')][_0x8915('0x1e')]({'where':_0x12e496[_0x8915('0x3f')]})[_0x8915('0x25')](function(_0x234792){_0x8fea94[_0x8915('0x1e')]=_0x234792;if(_0x435695[_0x8915('0x34')][_0x8915('0x43')]){_0x12e496['include']=[{'all':!![]}];}return db[_0x8915('0x5e')][_0x8915('0x5f')](_0x12e496);})[_0x8915('0x25')](function(_0x35e114){_0x8fea94[_0x8915('0x44')]=_0x35e114;return _0x8fea94;});}})[_0x8915('0x25')](respondWithFilteredResult(_0x2bed91,_0x12e496))[_0x8915('0x45')](handleError(_0x2bed91,null));};function char(_0x4b7971){return'number'===typeof _0x4b7971?String[_0x8915('0x60')][_0x8915('0x21')](null,arguments):_0x4b7971;}function needsEncapsulation(_0x5d7721){return!!_0x5d7721&&(_0x5d7721[_0x8915('0x61')]()[_0x8915('0x62')](char(0xd))>=0x0||_0x5d7721[_0x8915('0x61')]()[_0x8915('0x62')](char(0xa))>=0x0||_0x5d7721[_0x8915('0x61')]()[_0x8915('0x62')](char(0x2c))>=0x0||_0x5d7721[_0x8915('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x57996b){var _0xfeb69c=char(0x22),_0x32ac49='\x5c'+char(0x22),_0x2fbb5f=_0x57996b[_0x8915('0x61')]()['replace'](new RegExp(_0xfeb69c,'g'),_0x32ac49);return _0xfeb69c+_0x2fbb5f+_0xfeb69c;}exports[_0x8915('0x63')]=function(_0x1139a4,_0x38fa7f,_0x209799){var _0x482a2b,_0x3136f0;var _0x3fec0a={'where':{'ProjectId':_0x1139a4[_0x8915('0x51')]['id']}};if(_0x1139a4['query'][_0x8915('0x64')]){_0x3fec0a[_0x8915('0x3f')][_0x8915('0x65')]=JSON[_0x8915('0x66')](_0x1139a4[_0x8915('0x34')][_0x8915('0x64')]);}return db[_0x8915('0x5c')][_0x8915('0x5f')](_0x3fec0a)['then'](handleEntityNotFound(_0x38fa7f,null))[_0x8915('0x25')](function(_0x3c169b){if(_0x3c169b){_0x482a2b=_0x3c169b;return db[_0x8915('0x67')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x482a2b,'id')},'ProjectId':_0x1139a4['params']['id']},'order':_0x8915('0x68')});}})[_0x8915('0x25')](handleEntityNotFound(_0x38fa7f,null))[_0x8915('0x25')](function(_0x3573ed){if(_0x3573ed){_0x3136f0=_0x3573ed;var _0x35cd03={};for(var _0x2e5b2e=0x0,_0x346309=_0x3136f0['length'];_0x2e5b2e<_0x346309;_0x2e5b2e++){if(!_0x35cd03[_0x8915('0x3b')](_0x3136f0[_0x2e5b2e][_0x8915('0x69')])){_0x35cd03[_0x3136f0[_0x2e5b2e][_0x8915('0x69')]]=needsEncapsulation(_0x3136f0[_0x2e5b2e][_0x8915('0x6a')])?encapsulate(_0x3136f0[_0x2e5b2e][_0x8915('0x6a')]):_0x3136f0[_0x2e5b2e][_0x8915('0x6a')];}}var _0x5db805=[],_0x2d0471={};for(var _0x5194f2=0x0,_0x2d3e5e=_0x482a2b[_0x8915('0x46')];_0x5194f2<_0x2d3e5e;_0x5194f2++){_0x2d0471={'ProjectId':_0x1139a4[_0x8915('0x51')]['id'],'SessionId':_0x482a2b[_0x5194f2]['id'],'StartTime':moment(_0x482a2b[_0x5194f2][_0x8915('0x65')])[_0x8915('0x6b')](_0x8915('0x6c'))};for(var _0x25056f=0x0,_0x495d71=_0x3136f0[_0x8915('0x46')];_0x25056f<_0x495d71;_0x25056f++){if(_0x3136f0[_0x25056f]['SessionId']==_0x482a2b[_0x5194f2]['id']&&_0x35cd03[_0x8915('0x3b')](_0x3136f0[_0x25056f][_0x8915('0x69')])){_0x2d0471[_0x35cd03[_0x3136f0[_0x25056f][_0x8915('0x69')]]]=_0x3136f0[_0x25056f][_0x8915('0x6d')];}}for(var _0x3ba5e8 in _0x35cd03){if(!_0x2d0471[_0x8915('0x3b')](_0x35cd03[_0x3ba5e8])){_0x2d0471[_0x35cd03[_0x3ba5e8]]=null;}}_0x5db805[_0x8915('0x6e')](_0x2d0471);}return _0x5db805;}})[_0x8915('0x25')](function(_0x470b48){if(!_[_0x8915('0x6f')](_0x470b48)){var _0x69a218=toCsv(_0x470b48);var _0x30008d=Date[_0x8915('0x70')]();fs[_0x8915('0x71')](util[_0x8915('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1139a4[_0x8915('0x51')]['id'],_0x30008d),_0x69a218);_0x38fa7f['setHeader'](_0x8915('0x72'),_0x8915('0x73')+util[_0x8915('0x6b')]('Jscripty_Project_%d_Summary_%s.csv',_0x1139a4['params']['id'],_0x30008d));_0x38fa7f[_0x8915('0x74')]('Content-type',_0x8915('0x75'));return _0x38fa7f[_0x8915('0x76')](util['format'](_0x8915('0x77'),_0x1139a4[_0x8915('0x51')]['id'],_0x30008d));}else{return _0x38fa7f[_0x8915('0x2a')](0xcc);}})['catch'](handleError(_0x38fa7f,null));}; \ No newline at end of file +var _0x08ca=['fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','Projects','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','toString','indexOf','replace','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','model','query','keys','intersection','attributes'];(function(_0x361d9b,_0x30e890){var _0x2934a6=function(_0x2bcab4){while(--_0x2bcab4){_0x361d9b['push'](_0x361d9b['shift']());}};_0x2934a6(++_0x30e890);}(_0x08ca,0xb2));var _0xa08c=function(_0x5a1150,_0x1f14bd){_0x5a1150=_0x5a1150-0x0;var _0x228910=_0x08ca[_0x5a1150];return _0x228910;};'use strict';var emlformat=require(_0xa08c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa08c('0x1'));var jsonpatch=require(_0xa08c('0x2'));var rp=require(_0xa08c('0x3'));var moment=require(_0xa08c('0x4'));var BPromise=require(_0xa08c('0x5'));var Mustache=require(_0xa08c('0x6'));var util=require(_0xa08c('0x7'));var path=require(_0xa08c('0x8'));var sox=require(_0xa08c('0x9'));var csv=require(_0xa08c('0xa'));var ejs=require(_0xa08c('0xb'));var fs=require('fs');var fs_extra=require(_0xa08c('0xc'));var _=require('lodash');var squel=require(_0xa08c('0xd'));var crypto=require(_0xa08c('0xe'));var jsforce=require(_0xa08c('0xf'));var deskjs=require(_0xa08c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa08c('0x11'));var Papa=require('papaparse');var Redis=require(_0xa08c('0x12'));var authService=require(_0xa08c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa08c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa08c('0x15'));var utils=require(_0xa08c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa08c('0x17'));var db=require(_0xa08c('0x18'))['db'];function respondWithStatusCode(_0x441998,_0x4ed55f){_0x4ed55f=_0x4ed55f||0xcc;return function(_0x1fda54){if(_0x1fda54){return _0x441998[_0xa08c('0x19')](_0x4ed55f);}return _0x441998['status'](_0x4ed55f)[_0xa08c('0x1a')]();};}function respondWithResult(_0x2e5629,_0x15186a){_0x15186a=_0x15186a||0xc8;return function(_0x306435){if(_0x306435){return _0x2e5629[_0xa08c('0x1b')](_0x15186a)[_0xa08c('0x1c')](_0x306435);}};}function respondWithFilteredResult(_0xff73e7,_0x26e44e){return function(_0x1a2d32){if(_0x1a2d32){var _0x41d1f0=typeof _0x26e44e['offset']===_0xa08c('0x1d')&&typeof _0x26e44e[_0xa08c('0x1e')]===_0xa08c('0x1d');var _0x42c5ea=_0x1a2d32[_0xa08c('0x1f')];var _0x1b2097=_0x41d1f0?0x0:_0x26e44e[_0xa08c('0x20')];var _0x3ea4f3=_0x41d1f0?_0x1a2d32[_0xa08c('0x1f')]:_0x26e44e[_0xa08c('0x20')]+_0x26e44e[_0xa08c('0x1e')];var _0x294a75;if(_0x3ea4f3>=_0x42c5ea){_0x3ea4f3=_0x42c5ea;_0x294a75=0xc8;}else{_0x294a75=0xce;}_0xff73e7['status'](_0x294a75);return _0xff73e7[_0xa08c('0x21')]('Content-Range',_0x1b2097+'-'+_0x3ea4f3+'/'+_0x42c5ea)[_0xa08c('0x1c')](_0x1a2d32);}return null;};}function patchUpdates(_0x43236b){return function(_0x153b1a){try{jsonpatch[_0xa08c('0x22')](_0x153b1a,_0x43236b,!![]);}catch(_0x5dac00){return BPromise[_0xa08c('0x23')](_0x5dac00);}return _0x153b1a[_0xa08c('0x24')]();};}function saveUpdates(_0x500bd4,_0x456d45){return function(_0x22ed38){if(_0x22ed38){return _0x22ed38[_0xa08c('0x25')](_0x500bd4)['then'](function(_0x34fa7b){return _0x34fa7b;});}return null;};}function removeEntity(_0x5473b8,_0x561b0c){return function(_0x3c46fc){if(_0x3c46fc){return _0x3c46fc[_0xa08c('0x26')]()['then'](function(){var _0x381821=_0x3c46fc[_0xa08c('0x27')]({'plain':!![]});var _0x491cb0='Projects';return db[_0xa08c('0x28')][_0xa08c('0x26')]({'where':{'type':_0x491cb0,'resourceId':_0x381821['id']}})[_0xa08c('0x29')](function(){return _0x3c46fc;});})['then'](function(){_0x5473b8[_0xa08c('0x1b')](0xcc)[_0xa08c('0x1a')]();});}};}function handleEntityNotFound(_0x22dc7c,_0x415291){return function(_0x2dbd27){if(!_0x2dbd27){_0x22dc7c[_0xa08c('0x19')](0x194);}return _0x2dbd27;};}function handleError(_0x494823,_0x5bb673){_0x5bb673=_0x5bb673||0x1f4;return function(_0x22260e){logger['error'](_0x22260e[_0xa08c('0x2a')]);if(_0x22260e[_0xa08c('0x2b')]){delete _0x22260e[_0xa08c('0x2b')];}_0x494823[_0xa08c('0x1b')](_0x5bb673)[_0xa08c('0x2c')](_0x22260e);};}exports[_0xa08c('0x2d')]=function(_0x3e8d8d,_0x9eaddd){var _0x35d3bc={},_0x56c0ca={},_0x300430={'count':0x0,'rows':[]};var _0x4ea6fb=_[_0xa08c('0x2e')](db[_0xa08c('0x2f')][_0xa08c('0x30')],function(_0x5780de){return{'name':_0x5780de['fieldName'],'type':_0x5780de[_0xa08c('0x31')][_0xa08c('0x32')]};});_0x56c0ca[_0xa08c('0x33')]=_[_0xa08c('0x2e')](_0x4ea6fb,_0xa08c('0x2b'));_0x56c0ca[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3e8d8d[_0xa08c('0x34')]);_0x56c0ca['filters']=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],_0x56c0ca['query']);_0x35d3bc[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x3e8d8d[_0xa08c('0x34')]['fields']));_0x35d3bc[_0xa08c('0x37')]=_0x35d3bc[_0xa08c('0x37')][_0xa08c('0x39')]?_0x35d3bc[_0xa08c('0x37')]:_0x56c0ca[_0xa08c('0x33')];if(!_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x35d3bc[_0xa08c('0x1e')]=qs['limit'](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x35d3bc[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x35d3bc['order']=qs[_0xa08c('0x3c')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x35d3bc['where']=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x3e8d8d[_0xa08c('0x34')],_0x56c0ca[_0xa08c('0x3d')]),_0x4ea6fb);if(_0x3e8d8d['query'][_0xa08c('0x3f')]){_0x35d3bc['where']=_[_0xa08c('0x40')](_0x35d3bc[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4ea6fb,function(_0x58a43b){if(_0x58a43b[_0xa08c('0x31')]!==_0xa08c('0x42')){var _0x12e787={};_0x12e787[_0x58a43b[_0xa08c('0x2b')]]={'$like':'%'+_0x3e8d8d['query'][_0xa08c('0x3f')]+'%'};return _0x12e787;}})});}_0x35d3bc=_[_0xa08c('0x40')]({},_0x35d3bc,_0x3e8d8d[_0xa08c('0x43')]);var _0x19cf46={'where':_0x35d3bc['where']};return db[_0xa08c('0x2f')][_0xa08c('0x1f')](_0x19cf46)[_0xa08c('0x29')](function(_0x39b313){_0x300430[_0xa08c('0x1f')]=_0x39b313;if(_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x44')]){_0x35d3bc[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyProject'][_0xa08c('0x46')](_0x35d3bc);})['then'](function(_0x250cea){_0x300430[_0xa08c('0x47')]=_0x250cea;return _0x300430;})[_0xa08c('0x29')](respondWithFilteredResult(_0x9eaddd,_0x35d3bc))[_0xa08c('0x48')](handleError(_0x9eaddd,null));};exports['show']=function(_0x3b7e00,_0x37d10b){var _0x4ca408={'raw':![],'where':{'id':_0x3b7e00['params']['id']}},_0x5111d6={};_0x5111d6[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')][_0xa08c('0x30')]);_0x5111d6[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3b7e00[_0xa08c('0x34')]);_0x5111d6['filters']=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],_0x5111d6[_0xa08c('0x34')]);_0x4ca408[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],qs['fields'](_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x38')]));_0x4ca408[_0xa08c('0x37')]=_0x4ca408[_0xa08c('0x37')][_0xa08c('0x39')]?_0x4ca408[_0xa08c('0x37')]:_0x5111d6[_0xa08c('0x33')];if(_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4ca408[_0xa08c('0x45')]=[{'all':!![]}];}_0x4ca408=_[_0xa08c('0x40')]({},_0x4ca408,_0x3b7e00[_0xa08c('0x43')]);return db['JscriptyProject'][_0xa08c('0x49')](_0x4ca408)[_0xa08c('0x29')](handleEntityNotFound(_0x37d10b,null))[_0xa08c('0x29')](respondWithResult(_0x37d10b,null))['catch'](handleError(_0x37d10b,null));};exports[_0xa08c('0x4a')]=function(_0x186fce,_0x1c8234){return db['JscriptyProject'][_0xa08c('0x4a')](_0x186fce[_0xa08c('0x4b')],{})[_0xa08c('0x29')](function(_0x160b22){var _0x225e28=_0x186fce[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x225e28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x225e28[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0x303396=_0x160b22['get']({'plain':!![]});var _0x586885='Projects';return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x586885,'userProfileId':_0x225e28[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x39f70f){if(_0x39f70f&&_0x39f70f[_0xa08c('0x50')]===0x0){return db['UserProfileResource'][_0xa08c('0x4a')]({'name':_0x303396[_0xa08c('0x2b')],'resourceId':_0x303396['id'],'type':_0x39f70f['name'],'sectionId':_0x39f70f['id']},{})['then'](function(){return _0x160b22;});}else{return _0x160b22;}})[_0xa08c('0x48')](function(_0x4544d6){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x4544d6);throw _0x4544d6;});}return _0x160b22;})[_0xa08c('0x29')](respondWithResult(_0x1c8234,0xc9))[_0xa08c('0x48')](handleError(_0x1c8234,null));};exports[_0xa08c('0x53')]=function(_0x437e35,_0x1acc1e){var _0xde5fe8={'where':{'id':_0x437e35[_0xa08c('0x54')]['id']}},_0x59a387={};_0x59a387[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')]['rawAttributes']);_0xde5fe8['attributes']=_[_0xa08c('0x36')](_0x59a387[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x437e35[_0xa08c('0x34')][_0xa08c('0x38')]));_0xde5fe8[_0xa08c('0x37')]=_0xde5fe8[_0xa08c('0x37')][_0xa08c('0x39')]?_0xde5fe8['attributes']:_0x59a387[_0xa08c('0x33')];if(_0x437e35[_0xa08c('0x34')][_0xa08c('0x44')]){_0xde5fe8[_0xa08c('0x45')]=[{'all':!![]}];}_0xde5fe8=_[_0xa08c('0x40')]({},_0xde5fe8,_0x437e35[_0xa08c('0x43')]);return db[_0xa08c('0x2f')][_0xa08c('0x49')](_0xde5fe8)[_0xa08c('0x29')](handleEntityNotFound(_0x1acc1e,null))[_0xa08c('0x29')](function(_0x1271a4){if(_0x1271a4){var _0x492ff1=_0x1271a4[_0xa08c('0x27')]({'plain':!![]});_0x492ff1=qs['omit'](_0x492ff1,['id',_0xa08c('0x55'),_0xa08c('0x56')]);_0x437e35[_0xa08c('0x4b')]=_[_0xa08c('0x57')](_0x437e35['body'],['id',_0xa08c('0x55'),'updatedAt']);return db['JscriptyProject'][_0xa08c('0x4a')](_['merge'](_0x492ff1,_0x437e35[_0xa08c('0x4b')]),{'include':_0x437e35[_0xa08c('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xa08c('0x29')](function(_0x544745){var _0x85a661=_0x437e35[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x85a661)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x85a661[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0xed8059=_0x544745[_0xa08c('0x27')]({'plain':!![]});var _0x1029f7=_0xa08c('0x58');return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x1029f7,'userProfileId':_0x85a661[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x184506){if(_0x184506&&_0x184506['autoAssociation']===0x0){return db[_0xa08c('0x28')][_0xa08c('0x4a')]({'name':_0xed8059[_0xa08c('0x2b')],'resourceId':_0xed8059['id'],'type':_0x184506[_0xa08c('0x2b')],'sectionId':_0x184506['id']},{})[_0xa08c('0x29')](function(){return _0x544745;});}else{return _0x544745;}})['catch'](function(_0x49d5ef){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x49d5ef);throw _0x49d5ef;});}return _0x544745;});}})['then'](respondWithResult(_0x1acc1e,0xc9))['catch'](handleError(_0x1acc1e,null));};exports[_0xa08c('0x25')]=function(_0x25248d,_0x2f296a){if(_0x25248d[_0xa08c('0x4b')]['id']){delete _0x25248d[_0xa08c('0x4b')]['id'];}return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x25248d[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2f296a,null))[_0xa08c('0x29')](saveUpdates(_0x25248d[_0xa08c('0x4b')],null))[_0xa08c('0x29')](respondWithResult(_0x2f296a,null))[_0xa08c('0x48')](handleError(_0x2f296a,null));};exports['destroy']=function(_0x565b71,_0x3d9715){return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x565b71[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x3d9715,null))['then'](removeEntity(_0x3d9715,null))[_0xa08c('0x48')](handleError(_0x3d9715,null));};exports[_0xa08c('0x59')]=function(_0x98a2f0,_0x1207bb,_0x102c39){var _0x4c14a0={'raw':!![],'where':{}};var _0x358104={};var _0x42d715={'count':0x0,'rows':[]};return db[_0xa08c('0x2f')][_0xa08c('0x5a')]({'where':{'id':_0x98a2f0[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x1207bb,null))['then'](function(_0x18473f){if(_0x18473f){_0x358104[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5b')][_0xa08c('0x30')]);_0x358104[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x98a2f0[_0xa08c('0x34')]);_0x358104[_0xa08c('0x3d')]=_['intersection'](_0x358104[_0xa08c('0x33')],_0x358104[_0xa08c('0x34')]);_0x4c14a0[_0xa08c('0x37')]=_['intersection'](_0x358104['model'],qs[_0xa08c('0x38')](_0x98a2f0['query'][_0xa08c('0x38')]));_0x4c14a0[_0xa08c('0x37')]=_0x4c14a0['attributes'][_0xa08c('0x39')]?_0x4c14a0[_0xa08c('0x37')]:_0x358104[_0xa08c('0x33')];if(!_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x4c14a0[_0xa08c('0x1e')]=qs[_0xa08c('0x1e')](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x4c14a0[_0xa08c('0x20')]=qs['offset'](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x4c14a0[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x98a2f0[_0xa08c('0x34')]['sort']);_0x4c14a0[_0xa08c('0x41')]=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x98a2f0[_0xa08c('0x34')],_0x358104[_0xa08c('0x3d')]));_0x4c14a0[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x18473f['id'];if(_0x98a2f0['query'][_0xa08c('0x3f')]){_0x4c14a0[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x4c14a0[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4c14a0['attributes'],function(_0x3d14d8){var _0x2e563a={};_0x2e563a[_0x3d14d8]={'$like':'%'+_0x98a2f0['query'][_0xa08c('0x3f')]+'%'};return _0x2e563a;})});}_0x4c14a0=_[_0xa08c('0x40')]({},_0x4c14a0,_0x98a2f0[_0xa08c('0x43')]);return db[_0xa08c('0x5b')][_0xa08c('0x1f')]({'where':_0x4c14a0[_0xa08c('0x41')]})['then'](function(_0x48009a){_0x42d715[_0xa08c('0x1f')]=_0x48009a;if(_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4c14a0[_0xa08c('0x45')]=[{'all':!![]}];}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x4c14a0);})[_0xa08c('0x29')](function(_0x4b6116){_0x42d715[_0xa08c('0x47')]=_0x4b6116;return _0x42d715;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x1207bb,_0x4c14a0))['catch'](handleError(_0x1207bb,null));};exports['getAnswers']=function(_0x2949de,_0x2dd1fa,_0x128ba1){var _0x1e5491={'raw':!![],'where':{}};var _0x107c27={};var _0x23ec21={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2949de[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2dd1fa,null))[_0xa08c('0x29')](function(_0x4fbffa){if(_0x4fbffa){_0x107c27[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5e')][_0xa08c('0x30')]);_0x107c27[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x2949de[_0xa08c('0x34')]);_0x107c27[_0xa08c('0x3d')]=_[_0xa08c('0x36')](_0x107c27[_0xa08c('0x33')],_0x107c27['query']);_0x1e5491[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x107c27['model'],qs[_0xa08c('0x38')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x38')]));_0x1e5491[_0xa08c('0x37')]=_0x1e5491[_0xa08c('0x37')][_0xa08c('0x39')]?_0x1e5491[_0xa08c('0x37')]:_0x107c27[_0xa08c('0x33')];if(!_0x2949de[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x1e5491['limit']=qs['limit'](_0x2949de[_0xa08c('0x34')]['limit']);_0x1e5491[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x1e5491[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x1e5491[_0xa08c('0x41')]=qs['filters'](_[_0xa08c('0x3e')](_0x2949de[_0xa08c('0x34')],_0x107c27[_0xa08c('0x3d')]));_0x1e5491[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x4fbffa['id'];if(_0x2949de[_0xa08c('0x34')][_0xa08c('0x3f')]){_0x1e5491[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x1e5491[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x1e5491[_0xa08c('0x37')],function(_0x442ce7){var _0x13ab6a={};_0x13ab6a[_0x442ce7]={'$like':'%'+_0x2949de['query']['filter']+'%'};return _0x13ab6a;})});}_0x1e5491=_['merge']({},_0x1e5491,_0x2949de[_0xa08c('0x43')]);return db[_0xa08c('0x5e')]['count']({'where':_0x1e5491['where']})['then'](function(_0x3309f0){_0x23ec21[_0xa08c('0x1f')]=_0x3309f0;if(_0x2949de[_0xa08c('0x34')]['includeAll']){_0x1e5491[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa08c('0x46')](_0x1e5491);})[_0xa08c('0x29')](function(_0x4a015f){_0x23ec21['rows']=_0x4a015f;return _0x23ec21;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x2dd1fa,_0x1e5491))[_0xa08c('0x48')](handleError(_0x2dd1fa,null));};function char(_0x252d4c){return'number'===typeof _0x252d4c?String['fromCharCode'][_0xa08c('0x22')](null,arguments):_0x252d4c;}function needsEncapsulation(_0x4a1f5c){return!!_0x4a1f5c&&(_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xd))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xa))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x4a1f5c['toString']()[_0xa08c('0x60')](char(0x22))>=0x0);}function encapsulate(_0x53c520){var _0x3b808d=char(0x22),_0x50a1da='\x5c'+char(0x22),_0x5b9ed5=_0x53c520[_0xa08c('0x5f')]()[_0xa08c('0x61')](new RegExp(_0x3b808d,'g'),_0x50a1da);return _0x3b808d+_0x5b9ed5+_0x3b808d;}exports['getSummary']=function(_0x2ef363,_0x412a10,_0x4b7038){var _0x3c1a39,_0x244f3f;var _0x44ebbb={'where':{'ProjectId':_0x2ef363[_0xa08c('0x54')]['id']}};if(_0x2ef363['query']['startTime']){_0x44ebbb[_0xa08c('0x41')]['starttime']=JSON[_0xa08c('0x62')](_0x2ef363['query'][_0xa08c('0x63')]);}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x44ebbb)[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x1374bc){if(_0x1374bc){_0x3c1a39=_0x1374bc;return db[_0xa08c('0x64')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x3c1a39,'id')},'ProjectId':_0x2ef363['params']['id']},'order':_0xa08c('0x65')});}})[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x10058a){if(_0x10058a){_0x244f3f=_0x10058a;var _0x55a278={};for(var _0x5559b6=0x0,_0x37e501=_0x244f3f[_0xa08c('0x39')];_0x5559b6<_0x37e501;_0x5559b6++){if(!_0x55a278['hasOwnProperty'](_0x244f3f[_0x5559b6][_0xa08c('0x66')])){_0x55a278[_0x244f3f[_0x5559b6][_0xa08c('0x66')]]=needsEncapsulation(_0x244f3f[_0x5559b6][_0xa08c('0x67')])?encapsulate(_0x244f3f[_0x5559b6][_0xa08c('0x67')]):_0x244f3f[_0x5559b6][_0xa08c('0x67')];}}var _0x5a208e=[],_0x479f6a={};for(var _0x23a17a=0x0,_0x5c7843=_0x3c1a39[_0xa08c('0x39')];_0x23a17a<_0x5c7843;_0x23a17a++){_0x479f6a={'ProjectId':_0x2ef363['params']['id'],'SessionId':_0x3c1a39[_0x23a17a]['id'],'StartTime':moment(_0x3c1a39[_0x23a17a][_0xa08c('0x68')])[_0xa08c('0x69')](_0xa08c('0x6a'))};for(var _0x419595=0x0,_0x2602a3=_0x244f3f[_0xa08c('0x39')];_0x419595<_0x2602a3;_0x419595++){if(_0x244f3f[_0x419595][_0xa08c('0x6b')]==_0x3c1a39[_0x23a17a]['id']&&_0x55a278[_0xa08c('0x3a')](_0x244f3f[_0x419595][_0xa08c('0x66')])){_0x479f6a[_0x55a278[_0x244f3f[_0x419595]['questionId']]]=_0x244f3f[_0x419595][_0xa08c('0x6c')];}}for(var _0x3ae665 in _0x55a278){if(!_0x479f6a[_0xa08c('0x3a')](_0x55a278[_0x3ae665])){_0x479f6a[_0x55a278[_0x3ae665]]=null;}}_0x5a208e[_0xa08c('0x6d')](_0x479f6a);}return _0x5a208e;}})['then'](function(_0x10c02b){if(!_['isEmpty'](_0x10c02b)){var _0x3d5c77=toCsv(_0x10c02b);var _0x2ae318=Date[_0xa08c('0x6e')]();fs['writeFileSync'](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318),_0x3d5c77);_0x412a10[_0xa08c('0x70')]('Content-disposition','attachment;\x20filename='+util[_0xa08c('0x69')](_0xa08c('0x71'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));_0x412a10[_0xa08c('0x70')](_0xa08c('0x72'),_0xa08c('0x73'));return _0x412a10[_0xa08c('0x74')](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));}else{return _0x412a10[_0xa08c('0x19')](0xcc);}})['catch'](handleError(_0x412a10,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index b204496..787a5bd 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 _0x1cb9=['./jscriptyProject.attributes','exports','define','JscriptyProject','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3a7b04,_0x44e465){var _0x2b3ecb=function(_0x1b6183){while(--_0x1b6183){_0x3a7b04['push'](_0x3a7b04['shift']());}};_0x2b3ecb(++_0x44e465);}(_0x1cb9,0x14e));var _0x91cb=function(_0x55b0b4,_0x4b41a7){_0x55b0b4=_0x55b0b4-0x0;var _0x2bff6c=_0x1cb9[_0x55b0b4];return _0x2bff6c;};'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':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89c3=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3a6aa2,_0x5e8f53){var _0x3b111e=function(_0x3367f0){while(--_0x3367f0){_0x3a6aa2['push'](_0x3a6aa2['shift']());}};_0x3b111e(++_0x5e8f53);}(_0x89c3,0xff));var _0x389c=function(_0x75d99b,_0x4e7cd5){_0x75d99b=_0x75d99b-0x0;var _0x50a448=_0x89c3[_0x75d99b];return _0x50a448;};'use strict';var _=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var logger=require(_0x389c('0x2'))(_0x389c('0x3'));var moment=require(_0x389c('0x4'));var BPromise=require(_0x389c('0x5'));var rp=require(_0x389c('0x6'));var fs=require('fs');var path=require(_0x389c('0x7'));var rimraf=require('rimraf');var config=require(_0x389c('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x389c('0x9')]=function(_0x4bece6,_0x51f5f5){return _0x4bece6[_0x389c('0xa')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 7b3813b..29591ac 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x40507b,_0x277df6){var _0x44372c=function(_0x154815){while(--_0x154815){_0x40507b['push'](_0x40507b['shift']());}};_0x44372c(++_0x277df6);}(_0x70e0,0x17b));var _0x070e=function(_0x5ad3fb,_0x2459e1){_0x5ad3fb=_0x5ad3fb-0x0;var _0x522512=_0x70e0[_0x5ad3fb];return _0x522512;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x206b07,_0x30ee32){var _0x55de27=function(_0x82ff93){while(--_0x82ff93){_0x206b07['push'](_0x206b07['shift']());}};_0x55de27(++_0x30ee32);}(_0xaa88,0x137));var _0x8aa8=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xaa88[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 8b09758..73f429a 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 _0x395f=['./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3841ba,_0x3c523c){var _0x2de277=function(_0x2dc0e8){while(--_0x2dc0e8){_0x3841ba['push'](_0x3841ba['shift']());}};_0x2de277(++_0x3c523c);}(_0x395f,0x124));var _0xf395=function(_0x2b48c7,_0x7638d8){_0x2b48c7=_0x2b48c7-0x0;var _0x14f7ec=_0x395f[_0x2b48c7];return _0x14f7ec;};'use strict';var multer=require(_0xf395('0x0'));var util=require('util');var path=require(_0xf395('0x1'));var timeout=require(_0xf395('0x2'));var express=require(_0xf395('0x3'));var router=express[_0xf395('0x4')]();var fs_extra=require(_0xf395('0x5'));var auth=require(_0xf395('0x6'));var interaction=require(_0xf395('0x7'));var config=require('../../config/environment');var controller=require(_0xf395('0x8'));router[_0xf395('0x9')]('/',auth[_0xf395('0xa')](),controller[_0xf395('0xb')]);router[_0xf395('0x9')](_0xf395('0xc'),auth['isAuthenticated'](),controller[_0xf395('0xd')]);router[_0xf395('0x9')](_0xf395('0xe'),auth[_0xf395('0xa')](),controller[_0xf395('0xf')]);router['post']('/',auth[_0xf395('0xa')](),controller['create']);router[_0xf395('0x10')](_0xf395('0xe'),auth[_0xf395('0xa')](),controller['update']);router[_0xf395('0x11')](_0xf395('0xe'),auth[_0xf395('0xa')](),controller[_0xf395('0x12')]);module[_0xf395('0x13')]=router; \ No newline at end of file +var _0xed67=['index','/describe','describe','/:id','create','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x5cf3c0,_0x4363c1){var _0x39a680=function(_0x2a10f1){while(--_0x2a10f1){_0x5cf3c0['push'](_0x5cf3c0['shift']());}};_0x39a680(++_0x4363c1);}(_0xed67,0xe0));var _0x7ed6=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0xed67[_0x3b632f];return _0x10e788;};'use strict';var multer=require(_0x7ed6('0x0'));var util=require('util');var path=require(_0x7ed6('0x1'));var timeout=require(_0x7ed6('0x2'));var express=require(_0x7ed6('0x3'));var router=express[_0x7ed6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7ed6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7ed6('0x6'));var controller=require(_0x7ed6('0x7'));router[_0x7ed6('0x8')]('/',auth[_0x7ed6('0x9')](),controller[_0x7ed6('0xa')]);router[_0x7ed6('0x8')](_0x7ed6('0xb'),auth[_0x7ed6('0x9')](),controller[_0x7ed6('0xc')]);router[_0x7ed6('0x8')](_0x7ed6('0xd'),auth[_0x7ed6('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7ed6('0xe')]);router['put'](_0x7ed6('0xd'),auth['isAuthenticated'](),controller[_0x7ed6('0xf')]);router['delete']('/:id',auth[_0x7ed6('0x9')](),controller[_0x7ed6('0x10')]);module[_0x7ed6('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 3d72247..59e7b6e 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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x525259,_0xd3597d){_0x525259=_0x525259-0x0;var _0xf63ccd=_0x7a54[_0x525259];return _0xf63ccd;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x50075c,_0x2d3610){_0x50075c=_0x50075c-0x0;var _0x3d83b1=_0x7a54[_0x50075c];return _0x3d83b1;};'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 bc4ebdd..7fe4333 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 _0xf8f8=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0xb82ee7,_0x5286f7){var _0x4bdcb2=function(_0x1461d1){while(--_0x1461d1){_0xb82ee7['push'](_0xb82ee7['shift']());}};_0x4bdcb2(++_0x5286f7);}(_0xf8f8,0x95));var _0x8f8f=function(_0x3f198e,_0x50d717){_0x3f198e=_0x3f198e-0x0;var _0x785108=_0xf8f8[_0x3f198e];return _0x785108;};'use strict';var emlformat=require(_0x8f8f('0x0'));var rimraf=require(_0x8f8f('0x1'));var zipdir=require(_0x8f8f('0x2'));var jsonpatch=require(_0x8f8f('0x3'));var rp=require(_0x8f8f('0x4'));var moment=require('moment');var BPromise=require(_0x8f8f('0x5'));var Mustache=require('mustache');var util=require(_0x8f8f('0x6'));var path=require('path');var sox=require(_0x8f8f('0x7'));var csv=require(_0x8f8f('0x8'));var ejs=require(_0x8f8f('0x9'));var fs=require('fs');var fs_extra=require(_0x8f8f('0xa'));var _=require(_0x8f8f('0xb'));var squel=require('squel');var crypto=require(_0x8f8f('0xc'));var jsforce=require(_0x8f8f('0xd'));var deskjs=require(_0x8f8f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8f8f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8f8f('0x10'));var qs=require(_0x8f8f('0x11'));var as=require(_0x8f8f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f8f('0x13'))('api');var utils=require(_0x8f8f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8f8f('0x15'));var db=require(_0x8f8f('0x16'))['db'];function respondWithStatusCode(_0x3a9ed3,_0x785ac5){_0x785ac5=_0x785ac5||0xcc;return function(_0x5f26c7){if(_0x5f26c7){return _0x3a9ed3[_0x8f8f('0x17')](_0x785ac5);}return _0x3a9ed3[_0x8f8f('0x18')](_0x785ac5)['end']();};}function respondWithResult(_0x37835d,_0x334add){_0x334add=_0x334add||0xc8;return function(_0x1adfd7){if(_0x1adfd7){return _0x37835d[_0x8f8f('0x18')](_0x334add)[_0x8f8f('0x19')](_0x1adfd7);}};}function respondWithFilteredResult(_0x1aacc5,_0xd95a13){return function(_0x377bd4){if(_0x377bd4){var _0x2b3d7a=typeof _0xd95a13[_0x8f8f('0x1a')]===_0x8f8f('0x1b')&&typeof _0xd95a13[_0x8f8f('0x1c')]===_0x8f8f('0x1b');var _0x1f96a6=_0x377bd4[_0x8f8f('0x1d')];var _0x2535b1=_0x2b3d7a?0x0:_0xd95a13[_0x8f8f('0x1a')];var _0x1c10f0=_0x2b3d7a?_0x377bd4['count']:_0xd95a13['offset']+_0xd95a13[_0x8f8f('0x1c')];var _0x3c40c4;if(_0x1c10f0>=_0x1f96a6){_0x1c10f0=_0x1f96a6;_0x3c40c4=0xc8;}else{_0x3c40c4=0xce;}_0x1aacc5['status'](_0x3c40c4);return _0x1aacc5[_0x8f8f('0x1e')]('Content-Range',_0x2535b1+'-'+_0x1c10f0+'/'+_0x1f96a6)[_0x8f8f('0x19')](_0x377bd4);}return null;};}function patchUpdates(_0xb79ccf){return function(_0x1e999e){try{jsonpatch[_0x8f8f('0x1f')](_0x1e999e,_0xb79ccf,!![]);}catch(_0x3fc0db){return BPromise[_0x8f8f('0x20')](_0x3fc0db);}return _0x1e999e[_0x8f8f('0x21')]();};}function saveUpdates(_0x420f16,_0x1796ab){return function(_0x13ad90){if(_0x13ad90){return _0x13ad90[_0x8f8f('0x22')](_0x420f16)['then'](function(_0x59f6b7){return _0x59f6b7;});}return null;};}function removeEntity(_0x15ff3f,_0x18868f){return function(_0x43ec98){if(_0x43ec98){return _0x43ec98[_0x8f8f('0x23')]()[_0x8f8f('0x24')](function(){_0x15ff3f['status'](0xcc)[_0x8f8f('0x25')]();});}};}function handleEntityNotFound(_0x3a49ad,_0x4d9b27){return function(_0x2c3962){if(!_0x2c3962){_0x3a49ad['sendStatus'](0x194);}return _0x2c3962;};}function handleError(_0x1aca01,_0x3ffe76){_0x3ffe76=_0x3ffe76||0x1f4;return function(_0x5d6220){logger[_0x8f8f('0x26')](_0x5d6220[_0x8f8f('0x27')]);if(_0x5d6220[_0x8f8f('0x28')]){delete _0x5d6220['name'];}_0x1aca01[_0x8f8f('0x18')](_0x3ffe76)[_0x8f8f('0x29')](_0x5d6220);};}exports[_0x8f8f('0x2a')]=function(_0x738934,_0x29e7a5){var _0x42f09f={},_0x83324d={},_0x2546ae={'count':0x0,'rows':[]};var _0x1466a9=_[_0x8f8f('0x2b')](db[_0x8f8f('0x2c')][_0x8f8f('0x2d')],function(_0x3f776f){return{'name':_0x3f776f[_0x8f8f('0x2e')],'type':_0x3f776f[_0x8f8f('0x2f')][_0x8f8f('0x30')]};});_0x83324d['model']=_[_0x8f8f('0x2b')](_0x1466a9,_0x8f8f('0x28'));_0x83324d[_0x8f8f('0x31')]=_[_0x8f8f('0x32')](_0x738934[_0x8f8f('0x31')]);_0x83324d[_0x8f8f('0x33')]=_[_0x8f8f('0x34')](_0x83324d[_0x8f8f('0x35')],_0x83324d[_0x8f8f('0x31')]);_0x42f09f['attributes']=_[_0x8f8f('0x34')](_0x83324d[_0x8f8f('0x35')],qs[_0x8f8f('0x36')](_0x738934[_0x8f8f('0x31')][_0x8f8f('0x36')]));_0x42f09f[_0x8f8f('0x37')]=_0x42f09f['attributes'][_0x8f8f('0x38')]?_0x42f09f[_0x8f8f('0x37')]:_0x83324d[_0x8f8f('0x35')];if(!_0x738934[_0x8f8f('0x31')]['hasOwnProperty'](_0x8f8f('0x39'))){_0x42f09f[_0x8f8f('0x1c')]=qs['limit'](_0x738934[_0x8f8f('0x31')][_0x8f8f('0x1c')]);_0x42f09f[_0x8f8f('0x1a')]=qs[_0x8f8f('0x1a')](_0x738934[_0x8f8f('0x31')][_0x8f8f('0x1a')]);}_0x42f09f[_0x8f8f('0x3a')]=qs['sort'](_0x738934[_0x8f8f('0x31')]['sort']);_0x42f09f[_0x8f8f('0x3b')]=qs[_0x8f8f('0x33')](_['pick'](_0x738934[_0x8f8f('0x31')],_0x83324d[_0x8f8f('0x33')]),_0x1466a9);if(_0x738934[_0x8f8f('0x31')][_0x8f8f('0x3c')]){_0x42f09f['where']=_[_0x8f8f('0x3d')](_0x42f09f[_0x8f8f('0x3b')],{'$or':_[_0x8f8f('0x2b')](_0x1466a9,function(_0x4c7fc5){if(_0x4c7fc5[_0x8f8f('0x2f')]!=='VIRTUAL'){var _0x49c01f={};_0x49c01f[_0x4c7fc5['name']]={'$like':'%'+_0x738934[_0x8f8f('0x31')]['filter']+'%'};return _0x49c01f;}})});}_0x42f09f=_['merge']({},_0x42f09f,_0x738934[_0x8f8f('0x3e')]);var _0x4f5739={'where':_0x42f09f[_0x8f8f('0x3b')]};return db[_0x8f8f('0x2c')][_0x8f8f('0x1d')](_0x4f5739)[_0x8f8f('0x24')](function(_0x34f616){_0x2546ae[_0x8f8f('0x1d')]=_0x34f616;if(_0x738934[_0x8f8f('0x31')][_0x8f8f('0x3f')]){_0x42f09f[_0x8f8f('0x40')]=[{'all':!![]}];}return db[_0x8f8f('0x2c')][_0x8f8f('0x41')](_0x42f09f);})[_0x8f8f('0x24')](function(_0x5dac6f){_0x2546ae[_0x8f8f('0x42')]=_0x5dac6f;return _0x2546ae;})[_0x8f8f('0x24')](respondWithFilteredResult(_0x29e7a5,_0x42f09f))[_0x8f8f('0x43')](handleError(_0x29e7a5,null));};exports[_0x8f8f('0x44')]=function(_0x1bd0f1,_0x5a3356){var _0x2cc965={'raw':!![],'where':{'id':_0x1bd0f1[_0x8f8f('0x45')]['id']}},_0xad6795={};_0xad6795['model']=_[_0x8f8f('0x32')](db['JscriptyQuestionReport'][_0x8f8f('0x2d')]);_0xad6795[_0x8f8f('0x31')]=_[_0x8f8f('0x32')](_0x1bd0f1['query']);_0xad6795[_0x8f8f('0x33')]=_[_0x8f8f('0x34')](_0xad6795[_0x8f8f('0x35')],_0xad6795[_0x8f8f('0x31')]);_0x2cc965['attributes']=_[_0x8f8f('0x34')](_0xad6795[_0x8f8f('0x35')],qs['fields'](_0x1bd0f1['query']['fields']));_0x2cc965[_0x8f8f('0x37')]=_0x2cc965[_0x8f8f('0x37')][_0x8f8f('0x38')]?_0x2cc965[_0x8f8f('0x37')]:_0xad6795[_0x8f8f('0x35')];if(_0x1bd0f1[_0x8f8f('0x31')][_0x8f8f('0x3f')]){_0x2cc965[_0x8f8f('0x40')]=[{'all':!![]}];}_0x2cc965=_[_0x8f8f('0x3d')]({},_0x2cc965,_0x1bd0f1['options']);return db[_0x8f8f('0x2c')][_0x8f8f('0x46')](_0x2cc965)['then'](handleEntityNotFound(_0x5a3356,null))[_0x8f8f('0x24')](respondWithResult(_0x5a3356,null))[_0x8f8f('0x43')](handleError(_0x5a3356,null));};exports[_0x8f8f('0x47')]=function(_0x567db4,_0x27b2ee){return db[_0x8f8f('0x2c')][_0x8f8f('0x47')](_0x567db4['body'],{})['then'](respondWithResult(_0x27b2ee,0xc9))[_0x8f8f('0x43')](handleError(_0x27b2ee,null));};exports[_0x8f8f('0x22')]=function(_0x1feee9,_0x5ea5ba){if(_0x1feee9[_0x8f8f('0x48')]['id']){delete _0x1feee9[_0x8f8f('0x48')]['id'];}return db[_0x8f8f('0x2c')]['find']({'where':{'id':_0x1feee9[_0x8f8f('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ea5ba,null))['then'](saveUpdates(_0x1feee9[_0x8f8f('0x48')],null))[_0x8f8f('0x24')](respondWithResult(_0x5ea5ba,null))[_0x8f8f('0x43')](handleError(_0x5ea5ba,null));};exports[_0x8f8f('0x23')]=function(_0x4d1399,_0x3005ef){return db[_0x8f8f('0x2c')][_0x8f8f('0x46')]({'where':{'id':_0x4d1399[_0x8f8f('0x45')]['id']}})[_0x8f8f('0x24')](handleEntityNotFound(_0x3005ef,null))['then'](removeEntity(_0x3005ef,null))[_0x8f8f('0x43')](handleError(_0x3005ef,null));};exports[_0x8f8f('0x49')]=function(_0x5119ca,_0x5e912b){return db[_0x8f8f('0x2c')]['describe']()['then'](respondWithResult(_0x5e912b,null))[_0x8f8f('0x43')](handleError(_0x5e912b,null));}; \ No newline at end of file +var _0xea92=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyQuestionReport','count','includeAll','rows','catch','show','params','include','find','body'];(function(_0x4d53ed,_0x2ec650){var _0x18637b=function(_0x2230e9){while(--_0x2230e9){_0x4d53ed['push'](_0x4d53ed['shift']());}};_0x18637b(++_0x2ec650);}(_0xea92,0x95));var _0x2ea9=function(_0x420575,_0x24b7a0){_0x420575=_0x420575-0x0;var _0x514503=_0xea92[_0x420575];return _0x514503;};'use strict';var emlformat=require(_0x2ea9('0x0'));var rimraf=require(_0x2ea9('0x1'));var zipdir=require(_0x2ea9('0x2'));var jsonpatch=require(_0x2ea9('0x3'));var rp=require(_0x2ea9('0x4'));var moment=require('moment');var BPromise=require(_0x2ea9('0x5'));var Mustache=require(_0x2ea9('0x6'));var util=require(_0x2ea9('0x7'));var path=require('path');var sox=require(_0x2ea9('0x8'));var csv=require('to-csv');var ejs=require(_0x2ea9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ea9('0xa'));var squel=require(_0x2ea9('0xb'));var crypto=require(_0x2ea9('0xc'));var jsforce=require(_0x2ea9('0xd'));var deskjs=require(_0x2ea9('0xe'));var toCsv=require(_0x2ea9('0xf'));var querystring=require(_0x2ea9('0x10'));var Papa=require(_0x2ea9('0x11'));var Redis=require(_0x2ea9('0x12'));var authService=require(_0x2ea9('0x13'));var qs=require(_0x2ea9('0x14'));var as=require(_0x2ea9('0x15'));var hardwareService=require(_0x2ea9('0x16'));var logger=require(_0x2ea9('0x17'))(_0x2ea9('0x18'));var utils=require('../../config/utils');var config=require(_0x2ea9('0x19'));var licenseUtil=require(_0x2ea9('0x1a'));var db=require(_0x2ea9('0x1b'))['db'];function respondWithStatusCode(_0x138937,_0x1d381b){_0x1d381b=_0x1d381b||0xcc;return function(_0x35af3a){if(_0x35af3a){return _0x138937['sendStatus'](_0x1d381b);}return _0x138937[_0x2ea9('0x1c')](_0x1d381b)[_0x2ea9('0x1d')]();};}function respondWithResult(_0x85fc40,_0x577113){_0x577113=_0x577113||0xc8;return function(_0x3aa750){if(_0x3aa750){return _0x85fc40[_0x2ea9('0x1c')](_0x577113)[_0x2ea9('0x1e')](_0x3aa750);}};}function respondWithFilteredResult(_0x56a1f8,_0x2be79c){return function(_0x893978){if(_0x893978){var _0x22f222=typeof _0x2be79c[_0x2ea9('0x1f')]===_0x2ea9('0x20')&&typeof _0x2be79c[_0x2ea9('0x21')]==='undefined';var _0x1d512e=_0x893978['count'];var _0x4daa23=_0x22f222?0x0:_0x2be79c['offset'];var _0x4c254b=_0x22f222?_0x893978['count']:_0x2be79c[_0x2ea9('0x1f')]+_0x2be79c[_0x2ea9('0x21')];var _0x4cec1f;if(_0x4c254b>=_0x1d512e){_0x4c254b=_0x1d512e;_0x4cec1f=0xc8;}else{_0x4cec1f=0xce;}_0x56a1f8[_0x2ea9('0x1c')](_0x4cec1f);return _0x56a1f8['set']('Content-Range',_0x4daa23+'-'+_0x4c254b+'/'+_0x1d512e)[_0x2ea9('0x1e')](_0x893978);}return null;};}function patchUpdates(_0x46c4e7){return function(_0x49b898){try{jsonpatch['apply'](_0x49b898,_0x46c4e7,!![]);}catch(_0x6e1e07){return BPromise['reject'](_0x6e1e07);}return _0x49b898[_0x2ea9('0x22')]();};}function saveUpdates(_0x9682ec,_0x88aa58){return function(_0x46f0d0){if(_0x46f0d0){return _0x46f0d0[_0x2ea9('0x23')](_0x9682ec)[_0x2ea9('0x24')](function(_0x3b19c6){return _0x3b19c6;});}return null;};}function removeEntity(_0xfa67ae,_0x2fdda4){return function(_0x5e13dd){if(_0x5e13dd){return _0x5e13dd[_0x2ea9('0x25')]()[_0x2ea9('0x24')](function(){_0xfa67ae[_0x2ea9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa9cc47,_0x56e1c0){return function(_0x295d9c){if(!_0x295d9c){_0xa9cc47['sendStatus'](0x194);}return _0x295d9c;};}function handleError(_0x160f94,_0x266ce4){_0x266ce4=_0x266ce4||0x1f4;return function(_0x5b4cb3){logger[_0x2ea9('0x26')](_0x5b4cb3[_0x2ea9('0x27')]);if(_0x5b4cb3[_0x2ea9('0x28')]){delete _0x5b4cb3['name'];}_0x160f94[_0x2ea9('0x1c')](_0x266ce4)['send'](_0x5b4cb3);};}exports[_0x2ea9('0x29')]=function(_0x587fc6,_0x12dbd6){var _0x5df3ab={},_0xb67aa2={},_0x3549b9={'count':0x0,'rows':[]};var _0x534e00=_[_0x2ea9('0x2a')](db['JscriptyQuestionReport'][_0x2ea9('0x2b')],function(_0x429adf){return{'name':_0x429adf[_0x2ea9('0x2c')],'type':_0x429adf[_0x2ea9('0x2d')]['key']};});_0xb67aa2[_0x2ea9('0x2e')]=_['map'](_0x534e00,_0x2ea9('0x28'));_0xb67aa2['query']=_[_0x2ea9('0x2f')](_0x587fc6[_0x2ea9('0x30')]);_0xb67aa2[_0x2ea9('0x31')]=_[_0x2ea9('0x32')](_0xb67aa2[_0x2ea9('0x2e')],_0xb67aa2['query']);_0x5df3ab[_0x2ea9('0x33')]=_[_0x2ea9('0x32')](_0xb67aa2[_0x2ea9('0x2e')],qs[_0x2ea9('0x34')](_0x587fc6[_0x2ea9('0x30')]['fields']));_0x5df3ab[_0x2ea9('0x33')]=_0x5df3ab[_0x2ea9('0x33')][_0x2ea9('0x35')]?_0x5df3ab[_0x2ea9('0x33')]:_0xb67aa2[_0x2ea9('0x2e')];if(!_0x587fc6[_0x2ea9('0x30')]['hasOwnProperty'](_0x2ea9('0x36'))){_0x5df3ab[_0x2ea9('0x21')]=qs[_0x2ea9('0x21')](_0x587fc6[_0x2ea9('0x30')][_0x2ea9('0x21')]);_0x5df3ab['offset']=qs[_0x2ea9('0x1f')](_0x587fc6['query'][_0x2ea9('0x1f')]);}_0x5df3ab[_0x2ea9('0x37')]=qs[_0x2ea9('0x38')](_0x587fc6['query'][_0x2ea9('0x38')]);_0x5df3ab[_0x2ea9('0x39')]=qs[_0x2ea9('0x31')](_[_0x2ea9('0x3a')](_0x587fc6[_0x2ea9('0x30')],_0xb67aa2[_0x2ea9('0x31')]),_0x534e00);if(_0x587fc6[_0x2ea9('0x30')][_0x2ea9('0x3b')]){_0x5df3ab[_0x2ea9('0x39')]=_[_0x2ea9('0x3c')](_0x5df3ab[_0x2ea9('0x39')],{'$or':_['map'](_0x534e00,function(_0x4176b5){if(_0x4176b5[_0x2ea9('0x2d')]!==_0x2ea9('0x3d')){var _0x29515c={};_0x29515c[_0x4176b5[_0x2ea9('0x28')]]={'$like':'%'+_0x587fc6[_0x2ea9('0x30')][_0x2ea9('0x3b')]+'%'};return _0x29515c;}})});}_0x5df3ab=_[_0x2ea9('0x3c')]({},_0x5df3ab,_0x587fc6[_0x2ea9('0x3e')]);var _0x5c98b0={'where':_0x5df3ab['where']};return db[_0x2ea9('0x3f')][_0x2ea9('0x40')](_0x5c98b0)[_0x2ea9('0x24')](function(_0x3ee390){_0x3549b9[_0x2ea9('0x40')]=_0x3ee390;if(_0x587fc6[_0x2ea9('0x30')][_0x2ea9('0x41')]){_0x5df3ab['include']=[{'all':!![]}];}return db[_0x2ea9('0x3f')]['findAll'](_0x5df3ab);})['then'](function(_0x543777){_0x3549b9[_0x2ea9('0x42')]=_0x543777;return _0x3549b9;})[_0x2ea9('0x24')](respondWithFilteredResult(_0x12dbd6,_0x5df3ab))[_0x2ea9('0x43')](handleError(_0x12dbd6,null));};exports[_0x2ea9('0x44')]=function(_0x1ecbcd,_0x506ded){var _0x2a2ebf={'raw':!![],'where':{'id':_0x1ecbcd[_0x2ea9('0x45')]['id']}},_0x21db20={};_0x21db20[_0x2ea9('0x2e')]=_['keys'](db[_0x2ea9('0x3f')][_0x2ea9('0x2b')]);_0x21db20['query']=_['keys'](_0x1ecbcd[_0x2ea9('0x30')]);_0x21db20[_0x2ea9('0x31')]=_[_0x2ea9('0x32')](_0x21db20[_0x2ea9('0x2e')],_0x21db20['query']);_0x2a2ebf['attributes']=_['intersection'](_0x21db20[_0x2ea9('0x2e')],qs[_0x2ea9('0x34')](_0x1ecbcd[_0x2ea9('0x30')][_0x2ea9('0x34')]));_0x2a2ebf[_0x2ea9('0x33')]=_0x2a2ebf['attributes'][_0x2ea9('0x35')]?_0x2a2ebf[_0x2ea9('0x33')]:_0x21db20[_0x2ea9('0x2e')];if(_0x1ecbcd[_0x2ea9('0x30')][_0x2ea9('0x41')]){_0x2a2ebf[_0x2ea9('0x46')]=[{'all':!![]}];}_0x2a2ebf=_[_0x2ea9('0x3c')]({},_0x2a2ebf,_0x1ecbcd['options']);return db[_0x2ea9('0x3f')][_0x2ea9('0x47')](_0x2a2ebf)[_0x2ea9('0x24')](handleEntityNotFound(_0x506ded,null))['then'](respondWithResult(_0x506ded,null))[_0x2ea9('0x43')](handleError(_0x506ded,null));};exports['create']=function(_0x5009b6,_0x3ef473){return db[_0x2ea9('0x3f')]['create'](_0x5009b6[_0x2ea9('0x48')],{})[_0x2ea9('0x24')](respondWithResult(_0x3ef473,0xc9))[_0x2ea9('0x43')](handleError(_0x3ef473,null));};exports[_0x2ea9('0x23')]=function(_0x4cdc3a,_0x54c2e8){if(_0x4cdc3a[_0x2ea9('0x48')]['id']){delete _0x4cdc3a[_0x2ea9('0x48')]['id'];}return db[_0x2ea9('0x3f')]['find']({'where':{'id':_0x4cdc3a[_0x2ea9('0x45')]['id']}})[_0x2ea9('0x24')](handleEntityNotFound(_0x54c2e8,null))[_0x2ea9('0x24')](saveUpdates(_0x4cdc3a[_0x2ea9('0x48')],null))['then'](respondWithResult(_0x54c2e8,null))[_0x2ea9('0x43')](handleError(_0x54c2e8,null));};exports[_0x2ea9('0x25')]=function(_0x5229a1,_0x5bb5c9){return db[_0x2ea9('0x3f')]['find']({'where':{'id':_0x5229a1['params']['id']}})[_0x2ea9('0x24')](handleEntityNotFound(_0x5bb5c9,null))['then'](removeEntity(_0x5bb5c9,null))[_0x2ea9('0x43')](handleError(_0x5bb5c9,null));};exports[_0x2ea9('0x49')]=function(_0x3a3ffb,_0x23e5ad){return db['JscriptyQuestionReport'][_0x2ea9('0x49')]()[_0x2ea9('0x24')](respondWithResult(_0x23e5ad,null))[_0x2ea9('0x43')](handleError(_0x23e5ad,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 631e3b2..629c4d5 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 _0xe577=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe577,0x16e));var _0x7e57=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe577[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require(_0x7e57('0x0'));var logger=require(_0x7e57('0x1'))(_0x7e57('0x2'));var moment=require(_0x7e57('0x3'));var BPromise=require(_0x7e57('0x4'));var rp=require(_0x7e57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e57('0x6'));var config=require(_0x7e57('0x7'));var attributes=require(_0x7e57('0x8'));module['exports']=function(_0x570cf3,_0x51dd07){return _0x570cf3[_0x7e57('0x9')](_0x7e57('0xa'),attributes,{'tableName':_0x7e57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50bf=['exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','moment','path','./jscriptyQuestionReport.attributes'];(function(_0x316aa0,_0x1b2366){var _0x58f76b=function(_0x4a7270){while(--_0x4a7270){_0x316aa0['push'](_0x316aa0['shift']());}};_0x58f76b(++_0x1b2366);}(_0x50bf,0xe5));var _0xf50b=function(_0x58e8c9,_0x158e0e){_0x58e8c9=_0x58e8c9-0x0;var _0x5d905a=_0x50bf[_0x58e8c9];return _0x5d905a;};'use strict';var _=require(_0xf50b('0x0'));var util=require('util');var logger=require(_0xf50b('0x1'))('api');var moment=require(_0xf50b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf50b('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf50b('0x4'));module[_0xf50b('0x5')]=function(_0x8b15c6,_0x3fd70d){return _0x8b15c6[_0xf50b('0x6')](_0xf50b('0x7'),attributes,{'tableName':_0xf50b('0x8'),'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 9e9cfd4..be5be0a 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 _0xc9bd=['http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9bd,0x1db));var _0xdc9b=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xc9bd[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc9b('0x0'));var fs=require('fs');var Redis=require(_0xdc9b('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc9b('0x2'));var logger=require(_0xdc9b('0x3'))(_0xdc9b('0x4'));var config=require(_0xdc9b('0x5'));var jayson=require(_0xdc9b('0x6'));var client=jayson[_0xdc9b('0x7')][_0xdc9b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1395fd,_0x2389b9,_0x260ff7){return new BPromise(function(_0x138f70,_0x5a2125){return client[_0xdc9b('0x9')](_0x1395fd,_0x260ff7)[_0xdc9b('0xa')](function(_0x4aa5bc){logger[_0xdc9b('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2389b9,_0xdc9b('0xc'));logger[_0xdc9b('0xd')](_0xdc9b('0xe'),_0x2389b9,_0xdc9b('0xc'),JSON[_0xdc9b('0xf')](_0x4aa5bc));if(_0x4aa5bc['error']){if(_0x4aa5bc[_0xdc9b('0x10')][_0xdc9b('0x11')]===0x1f4){logger[_0xdc9b('0x10')](_0xdc9b('0x12'),_0x2389b9,_0x4aa5bc[_0xdc9b('0x10')][_0xdc9b('0x13')]);return _0x5a2125(_0x4aa5bc['error'][_0xdc9b('0x13')]);}logger[_0xdc9b('0x10')](_0xdc9b('0x12'),_0x2389b9,_0x4aa5bc[_0xdc9b('0x10')][_0xdc9b('0x13')]);return _0x138f70(_0x4aa5bc[_0xdc9b('0x10')][_0xdc9b('0x13')]);}else{logger[_0xdc9b('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2389b9,_0xdc9b('0xc'));_0x138f70(_0x4aa5bc['result'][_0xdc9b('0x13')]);}})[_0xdc9b('0x14')](function(_0x4690d1){logger[_0xdc9b('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2389b9,_0x4690d1);_0x5a2125(_0x4690d1);});});} \ No newline at end of file +var _0xf1c5=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x5626da,_0x163f7f){var _0x448fd7=function(_0x2c5956){while(--_0x2c5956){_0x5626da['push'](_0x5626da['shift']());}};_0x448fd7(++_0x163f7f);}(_0xf1c5,0x10a));var _0x5f1c=function(_0x18b447,_0x5d0ed9){_0x18b447=_0x18b447-0x0;var _0x132815=_0xf1c5[_0x18b447];return _0x132815;};'use strict';var _=require(_0x5f1c('0x0'));var util=require(_0x5f1c('0x1'));var moment=require(_0x5f1c('0x2'));var BPromise=require(_0x5f1c('0x3'));var rs=require(_0x5f1c('0x4'));var fs=require('fs');var Redis=require(_0x5f1c('0x5'));var db=require(_0x5f1c('0x6'))['db'];var utils=require(_0x5f1c('0x7'));var logger=require('../../config/logger')(_0x5f1c('0x8'));var config=require('../../config/environment');var jayson=require(_0x5f1c('0x9'));var client=jayson[_0x5f1c('0xa')][_0x5f1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc71279,_0x11293d,_0x16ec58){return new BPromise(function(_0x3275e6,_0x409488){return client['request'](_0xc71279,_0x16ec58)[_0x5f1c('0xc')](function(_0x4cf70a){logger[_0x5f1c('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x11293d,'request\x20sent');logger[_0x5f1c('0xe')](_0x5f1c('0xf'),_0x11293d,_0x5f1c('0x10'),JSON['stringify'](_0x4cf70a));if(_0x4cf70a[_0x5f1c('0x11')]){if(_0x4cf70a[_0x5f1c('0x11')][_0x5f1c('0x12')]===0x1f4){logger[_0x5f1c('0x11')](_0x5f1c('0x13'),_0x11293d,_0x4cf70a[_0x5f1c('0x11')][_0x5f1c('0x14')]);return _0x409488(_0x4cf70a[_0x5f1c('0x11')]['message']);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x11293d,_0x4cf70a[_0x5f1c('0x11')][_0x5f1c('0x14')]);return _0x3275e6(_0x4cf70a[_0x5f1c('0x11')][_0x5f1c('0x14')]);}else{logger[_0x5f1c('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x11293d,_0x5f1c('0x10'));_0x3275e6(_0x4cf70a[_0x5f1c('0x15')][_0x5f1c('0x14')]);}})['catch'](function(_0x47869e){logger[_0x5f1c('0x11')](_0x5f1c('0x13'),_0x11293d,_0x47869e);_0x409488(_0x47869e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 31b0118..b085f91 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 _0xd306=['/:id','/:id/questions','getQuestions','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x5dddd1,_0x1ab113){var _0x868624=function(_0x466356){while(--_0x466356){_0x5dddd1['push'](_0x5dddd1['shift']());}};_0x868624(++_0x1ab113);}(_0xd306,0x72));var _0x6d30=function(_0x1c859f,_0x2eb4f8){_0x1c859f=_0x1c859f-0x0;var _0x24b738=_0xd306[_0x1c859f];return _0x24b738;};'use strict';var multer=require('multer');var util=require(_0x6d30('0x0'));var path=require(_0x6d30('0x1'));var timeout=require(_0x6d30('0x2'));var express=require(_0x6d30('0x3'));var router=express[_0x6d30('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d30('0x5'));var interaction=require(_0x6d30('0x6'));var config=require(_0x6d30('0x7'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x6d30('0x8')](),controller[_0x6d30('0x9')]);router[_0x6d30('0xa')](_0x6d30('0xb'),auth[_0x6d30('0x8')](),controller['describe']);router['get'](_0x6d30('0xc'),auth[_0x6d30('0x8')](),controller['show']);router[_0x6d30('0xa')](_0x6d30('0xd'),auth[_0x6d30('0x8')](),controller[_0x6d30('0xe')]);router[_0x6d30('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6d30('0x10')]('/:id',auth[_0x6d30('0x8')](),controller[_0x6d30('0x11')]);router[_0x6d30('0x12')]('/:id',auth[_0x6d30('0x8')](),controller[_0x6d30('0x13')]);module[_0x6d30('0x14')]=router; \ No newline at end of file +var _0xcdb5=['get','isAuthenticated','index','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','./jscriptySessionReport.controller'];(function(_0x141fe1,_0x2b7d8f){var _0x4df046=function(_0xf14552){while(--_0xf14552){_0x141fe1['push'](_0x141fe1['shift']());}};_0x4df046(++_0x2b7d8f);}(_0xcdb5,0x173));var _0x5cdb=function(_0x34e5ef,_0x2df43f){_0x34e5ef=_0x34e5ef-0x0;var _0xa28403=_0xcdb5[_0x34e5ef];return _0xa28403;};'use strict';var multer=require(_0x5cdb('0x0'));var util=require(_0x5cdb('0x1'));var path=require(_0x5cdb('0x2'));var timeout=require('connect-timeout');var express=require(_0x5cdb('0x3'));var router=express['Router']();var fs_extra=require(_0x5cdb('0x4'));var auth=require(_0x5cdb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5cdb('0x6'));router[_0x5cdb('0x7')]('/',auth[_0x5cdb('0x8')](),controller[_0x5cdb('0x9')]);router[_0x5cdb('0x7')]('/describe',auth[_0x5cdb('0x8')](),controller[_0x5cdb('0xa')]);router[_0x5cdb('0x7')](_0x5cdb('0xb'),auth[_0x5cdb('0x8')](),controller[_0x5cdb('0xc')]);router[_0x5cdb('0x7')](_0x5cdb('0xd'),auth[_0x5cdb('0x8')](),controller[_0x5cdb('0xe')]);router[_0x5cdb('0xf')]('/',auth['isAuthenticated'](),controller[_0x5cdb('0x10')]);router[_0x5cdb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5cdb('0x12')]);router[_0x5cdb('0x13')]('/:id',auth[_0x5cdb('0x8')](),controller['destroy']);module[_0x5cdb('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index af85ab2..9906dc2 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 _0xc3b7=['setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x51c0dd,_0xe0e285){var _0x70c3a5=function(_0x45c100){while(--_0x45c100){_0x51c0dd['push'](_0x51c0dd['shift']());}};_0x70c3a5(++_0xe0e285);}(_0xc3b7,0xa7));var _0x7c3b=function(_0x1a26de,_0x230cbf){_0x1a26de=_0x1a26de-0x0;var _0x4cf25d=_0xc3b7[_0x1a26de];return _0x4cf25d;};'use strict';var moment=require(_0x7c3b('0x0'));var Sequelize=require(_0x7c3b('0x1'));module[_0x7c3b('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x55cb64){this[_0x7c3b('0x3')](_0x7c3b('0x4'),_0x55cb64);this['setDataValue'](_0x7c3b('0x5'),moment()['format'](_0x7c3b('0x6')));}},'endtime':{'type':Sequelize[_0x7c3b('0x7')]},'membername':{'type':Sequelize[_0x7c3b('0x8')]},'projectname':{'type':Sequelize[_0x7c3b('0x8')]},'queue':{'type':Sequelize[_0x7c3b('0x8')]},'uniqueid':{'type':Sequelize[_0x7c3b('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7c3b('0x8')]},'completed':{'type':Sequelize[_0x7c3b('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xc586=['STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc586,0x1b0));var _0x6c58=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc586[_0x1928c9];return _0x51b5fb;};'use strict';var moment=require(_0x6c58('0x0'));var Sequelize=require(_0x6c58('0x1'));module[_0x6c58('0x2')]={'starttime':{'type':Sequelize[_0x6c58('0x3')],'set':function(_0x2978e5){this[_0x6c58('0x4')](_0x6c58('0x5'),_0x2978e5);this['setDataValue'](_0x6c58('0x6'),moment()['format'](_0x6c58('0x7')));}},'endtime':{'type':Sequelize[_0x6c58('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6c58('0x8')]},'uniqueid':{'type':Sequelize[_0x6c58('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x6c58('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 98dee63..02097db 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 _0xa194=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','then','findAll','params','includeAll','options','create','body','find','catch','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','SessionId','rows','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x41cc2b,_0x468463){var _0x2cb248=function(_0x4bf11e){while(--_0x4bf11e){_0x41cc2b['push'](_0x41cc2b['shift']());}};_0x2cb248(++_0x468463);}(_0xa194,0x1e2));var _0x4a19=function(_0x4af3b7,_0x30c116){_0x4af3b7=_0x4af3b7-0x0;var _0x24727c=_0xa194[_0x4af3b7];return _0x24727c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4a19('0x0'));var jsonpatch=require(_0x4a19('0x1'));var rp=require(_0x4a19('0x2'));var moment=require('moment');var BPromise=require(_0x4a19('0x3'));var Mustache=require(_0x4a19('0x4'));var util=require(_0x4a19('0x5'));var path=require(_0x4a19('0x6'));var sox=require(_0x4a19('0x7'));var csv=require(_0x4a19('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a19('0x9'));var _=require('lodash');var squel=require(_0x4a19('0xa'));var crypto=require(_0x4a19('0xb'));var jsforce=require(_0x4a19('0xc'));var deskjs=require(_0x4a19('0xd'));var toCsv=require(_0x4a19('0x8'));var querystring=require(_0x4a19('0xe'));var Papa=require(_0x4a19('0xf'));var Redis=require(_0x4a19('0x10'));var authService=require(_0x4a19('0x11'));var qs=require(_0x4a19('0x12'));var as=require(_0x4a19('0x13'));var hardwareService=require(_0x4a19('0x14'));var logger=require(_0x4a19('0x15'))(_0x4a19('0x16'));var utils=require(_0x4a19('0x17'));var config=require(_0x4a19('0x18'));var licenseUtil=require(_0x4a19('0x19'));var db=require(_0x4a19('0x1a'))['db'];function respondWithStatusCode(_0x3b7f77,_0x2c398e){_0x2c398e=_0x2c398e||0xcc;return function(_0x133298){if(_0x133298){return _0x3b7f77[_0x4a19('0x1b')](_0x2c398e);}return _0x3b7f77[_0x4a19('0x1c')](_0x2c398e)[_0x4a19('0x1d')]();};}function respondWithResult(_0x575773,_0x1fabc4){_0x1fabc4=_0x1fabc4||0xc8;return function(_0x2af091){if(_0x2af091){return _0x575773[_0x4a19('0x1c')](_0x1fabc4)['json'](_0x2af091);}};}function respondWithFilteredResult(_0x5d054b,_0x508769){return function(_0x4d4217){if(_0x4d4217){var _0x44af95=typeof _0x508769[_0x4a19('0x1e')]===_0x4a19('0x1f')&&typeof _0x508769[_0x4a19('0x20')]===_0x4a19('0x1f');var _0x1e6c42=_0x4d4217[_0x4a19('0x21')];var _0x4431fc=_0x44af95?0x0:_0x508769[_0x4a19('0x1e')];var _0x56abc=_0x44af95?_0x4d4217['count']:_0x508769[_0x4a19('0x1e')]+_0x508769[_0x4a19('0x20')];var _0x206964;if(_0x56abc>=_0x1e6c42){_0x56abc=_0x1e6c42;_0x206964=0xc8;}else{_0x206964=0xce;}_0x5d054b[_0x4a19('0x1c')](_0x206964);return _0x5d054b[_0x4a19('0x22')](_0x4a19('0x23'),_0x4431fc+'-'+_0x56abc+'/'+_0x1e6c42)[_0x4a19('0x24')](_0x4d4217);}return null;};}function patchUpdates(_0x206650){return function(_0x13396f){try{jsonpatch[_0x4a19('0x25')](_0x13396f,_0x206650,!![]);}catch(_0x39a221){return BPromise[_0x4a19('0x26')](_0x39a221);}return _0x13396f[_0x4a19('0x27')]();};}function saveUpdates(_0x4113d5,_0x44c650){return function(_0x493cef){if(_0x493cef){return _0x493cef[_0x4a19('0x28')](_0x4113d5)['then'](function(_0x2ab08f){return _0x2ab08f;});}return null;};}function removeEntity(_0x536ec1,_0x42f266){return function(_0x1e33b2){if(_0x1e33b2){return _0x1e33b2[_0x4a19('0x29')]()['then'](function(){_0x536ec1[_0x4a19('0x1c')](0xcc)[_0x4a19('0x1d')]();});}};}function handleEntityNotFound(_0x354f51,_0x4ea55e){return function(_0x342394){if(!_0x342394){_0x354f51[_0x4a19('0x1b')](0x194);}return _0x342394;};}function handleError(_0x5e90fc,_0x33a2ab){_0x33a2ab=_0x33a2ab||0x1f4;return function(_0x4054f7){logger[_0x4a19('0x2a')](_0x4054f7['stack']);if(_0x4054f7['name']){delete _0x4054f7[_0x4a19('0x2b')];}_0x5e90fc['status'](_0x33a2ab)[_0x4a19('0x2c')](_0x4054f7);};}exports[_0x4a19('0x2d')]=function(_0x4720c4,_0x3a9880){var _0x128df2={},_0x280fbc={},_0x3896db={'count':0x0,'rows':[]};var _0x3c6ec5=_[_0x4a19('0x2e')](db[_0x4a19('0x2f')][_0x4a19('0x30')],function(_0x1ea32d){return{'name':_0x1ea32d[_0x4a19('0x31')],'type':_0x1ea32d['type']['key']};});_0x280fbc[_0x4a19('0x32')]=_[_0x4a19('0x2e')](_0x3c6ec5,'name');_0x280fbc[_0x4a19('0x33')]=_[_0x4a19('0x34')](_0x4720c4[_0x4a19('0x33')]);_0x280fbc['filters']=_['intersection'](_0x280fbc['model'],_0x280fbc[_0x4a19('0x33')]);_0x128df2[_0x4a19('0x35')]=_[_0x4a19('0x36')](_0x280fbc[_0x4a19('0x32')],qs['fields'](_0x4720c4[_0x4a19('0x33')][_0x4a19('0x37')]));_0x128df2['attributes']=_0x128df2[_0x4a19('0x35')][_0x4a19('0x38')]?_0x128df2[_0x4a19('0x35')]:_0x280fbc[_0x4a19('0x32')];if(!_0x4720c4['query'][_0x4a19('0x39')]('nolimit')){_0x128df2[_0x4a19('0x20')]=qs[_0x4a19('0x20')](_0x4720c4['query'][_0x4a19('0x20')]);_0x128df2[_0x4a19('0x1e')]=qs['offset'](_0x4720c4['query'][_0x4a19('0x1e')]);}_0x128df2[_0x4a19('0x3a')]=qs['sort'](_0x4720c4[_0x4a19('0x33')][_0x4a19('0x3b')]);_0x128df2[_0x4a19('0x3c')]=qs[_0x4a19('0x3d')](_['pick'](_0x4720c4['query'],_0x280fbc['filters']),_0x3c6ec5);if(_0x4720c4[_0x4a19('0x33')][_0x4a19('0x3e')]){_0x128df2[_0x4a19('0x3c')]=_[_0x4a19('0x3f')](_0x128df2[_0x4a19('0x3c')],{'$or':_[_0x4a19('0x2e')](_0x3c6ec5,function(_0x5bd1a1){if(_0x5bd1a1[_0x4a19('0x40')]!==_0x4a19('0x41')){var _0x2d9969={};_0x2d9969[_0x5bd1a1['name']]={'$like':'%'+_0x4720c4[_0x4a19('0x33')][_0x4a19('0x3e')]+'%'};return _0x2d9969;}})});}_0x128df2=_[_0x4a19('0x3f')]({},_0x128df2,_0x4720c4['options']);var _0x234eba={'where':_0x128df2[_0x4a19('0x3c')]};return db['JscriptySessionReport'][_0x4a19('0x21')](_0x234eba)[_0x4a19('0x42')](function(_0x5e0a96){_0x3896db['count']=_0x5e0a96;if(_0x4720c4[_0x4a19('0x33')]['includeAll']){_0x128df2['include']=[{'all':!![]}];}return db[_0x4a19('0x2f')][_0x4a19('0x43')](_0x128df2);})[_0x4a19('0x42')](function(_0x22f6ae){_0x3896db['rows']=_0x22f6ae;return _0x3896db;})[_0x4a19('0x42')](respondWithFilteredResult(_0x3a9880,_0x128df2))['catch'](handleError(_0x3a9880,null));};exports['show']=function(_0x543c8e,_0x35a16a){var _0x568396={'raw':!![],'where':{'id':_0x543c8e[_0x4a19('0x44')]['id']}},_0xe00e1c={};_0xe00e1c['model']=_[_0x4a19('0x34')](db['JscriptySessionReport'][_0x4a19('0x30')]);_0xe00e1c[_0x4a19('0x33')]=_[_0x4a19('0x34')](_0x543c8e[_0x4a19('0x33')]);_0xe00e1c[_0x4a19('0x3d')]=_[_0x4a19('0x36')](_0xe00e1c[_0x4a19('0x32')],_0xe00e1c['query']);_0x568396[_0x4a19('0x35')]=_[_0x4a19('0x36')](_0xe00e1c[_0x4a19('0x32')],qs['fields'](_0x543c8e[_0x4a19('0x33')][_0x4a19('0x37')]));_0x568396['attributes']=_0x568396['attributes'][_0x4a19('0x38')]?_0x568396[_0x4a19('0x35')]:_0xe00e1c['model'];if(_0x543c8e[_0x4a19('0x33')][_0x4a19('0x45')]){_0x568396['include']=[{'all':!![]}];}_0x568396=_['merge']({},_0x568396,_0x543c8e[_0x4a19('0x46')]);return db[_0x4a19('0x2f')]['find'](_0x568396)[_0x4a19('0x42')](handleEntityNotFound(_0x35a16a,null))[_0x4a19('0x42')](respondWithResult(_0x35a16a,null))['catch'](handleError(_0x35a16a,null));};exports[_0x4a19('0x47')]=function(_0x5ce6ce,_0x442ffa){return db[_0x4a19('0x2f')]['create'](_0x5ce6ce[_0x4a19('0x48')],{})[_0x4a19('0x42')](respondWithResult(_0x442ffa,0xc9))['catch'](handleError(_0x442ffa,null));};exports[_0x4a19('0x28')]=function(_0x55c17c,_0x990dd3){if(_0x55c17c[_0x4a19('0x48')]['id']){delete _0x55c17c['body']['id'];}return db[_0x4a19('0x2f')][_0x4a19('0x49')]({'where':{'id':_0x55c17c[_0x4a19('0x44')]['id']}})[_0x4a19('0x42')](handleEntityNotFound(_0x990dd3,null))['then'](saveUpdates(_0x55c17c[_0x4a19('0x48')],null))['then'](respondWithResult(_0x990dd3,null))[_0x4a19('0x4a')](handleError(_0x990dd3,null));};exports[_0x4a19('0x29')]=function(_0x2774ca,_0x1b26d0){return db[_0x4a19('0x2f')][_0x4a19('0x49')]({'where':{'id':_0x2774ca[_0x4a19('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b26d0,null))[_0x4a19('0x42')](removeEntity(_0x1b26d0,null))[_0x4a19('0x4a')](handleError(_0x1b26d0,null));};exports[_0x4a19('0x4b')]=function(_0x41c80e,_0x5a997e){return db[_0x4a19('0x2f')][_0x4a19('0x4b')]()[_0x4a19('0x42')](respondWithResult(_0x5a997e,null))['catch'](handleError(_0x5a997e,null));};exports[_0x4a19('0x4c')]=function(_0x155b8d,_0x21760b,_0x50f3d1){var _0x26844b={'raw':!![],'where':{}};var _0x91ce87={};var _0x49d226={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4a19('0x4d')]({'where':{'id':_0x155b8d[_0x4a19('0x44')]['id']}})[_0x4a19('0x42')](handleEntityNotFound(_0x21760b,null))[_0x4a19('0x42')](function(_0x2f0a95){if(_0x2f0a95){_0x91ce87[_0x4a19('0x32')]=_[_0x4a19('0x34')](db[_0x4a19('0x4e')][_0x4a19('0x30')]);_0x91ce87['query']=_[_0x4a19('0x34')](_0x155b8d[_0x4a19('0x33')]);_0x91ce87[_0x4a19('0x3d')]=_['intersection'](_0x91ce87[_0x4a19('0x32')],_0x91ce87[_0x4a19('0x33')]);_0x26844b[_0x4a19('0x35')]=_[_0x4a19('0x36')](_0x91ce87[_0x4a19('0x32')],qs[_0x4a19('0x37')](_0x155b8d[_0x4a19('0x33')][_0x4a19('0x37')]));_0x26844b[_0x4a19('0x35')]=_0x26844b[_0x4a19('0x35')][_0x4a19('0x38')]?_0x26844b[_0x4a19('0x35')]:_0x91ce87[_0x4a19('0x32')];if(!_0x155b8d[_0x4a19('0x33')]['hasOwnProperty'](_0x4a19('0x4f'))){_0x26844b[_0x4a19('0x20')]=qs[_0x4a19('0x20')](_0x155b8d['query']['limit']);_0x26844b[_0x4a19('0x1e')]=qs[_0x4a19('0x1e')](_0x155b8d[_0x4a19('0x33')][_0x4a19('0x1e')]);}_0x26844b['order']=qs[_0x4a19('0x3b')](_0x155b8d[_0x4a19('0x33')][_0x4a19('0x3b')]);_0x26844b[_0x4a19('0x3c')]=qs['filters'](_[_0x4a19('0x50')](_0x155b8d[_0x4a19('0x33')],_0x91ce87[_0x4a19('0x3d')]));_0x26844b[_0x4a19('0x3c')][_0x4a19('0x51')]=_0x2f0a95['id'];if(_0x155b8d[_0x4a19('0x33')]['filter']){_0x26844b[_0x4a19('0x3c')]=_[_0x4a19('0x3f')](_0x26844b[_0x4a19('0x3c')],{'$or':_['map'](_0x26844b['attributes'],function(_0x2e457b){var _0x469b82={};_0x469b82[_0x2e457b]={'$like':'%'+_0x155b8d[_0x4a19('0x33')][_0x4a19('0x3e')]+'%'};return _0x469b82;})});}_0x26844b=_['merge']({},_0x26844b,_0x155b8d[_0x4a19('0x46')]);return db[_0x4a19('0x4e')][_0x4a19('0x21')]({'where':_0x26844b[_0x4a19('0x3c')]})[_0x4a19('0x42')](function(_0x2e0052){_0x49d226[_0x4a19('0x21')]=_0x2e0052;if(_0x155b8d[_0x4a19('0x33')][_0x4a19('0x45')]){_0x26844b['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x26844b);})['then'](function(_0x4d5837){_0x49d226[_0x4a19('0x52')]=_0x4d5837;return _0x49d226;});}})[_0x4a19('0x42')](respondWithFilteredResult(_0x21760b,_0x26844b))[_0x4a19('0x4a')](handleError(_0x21760b,null));}; \ No newline at end of file +var _0xfe7e=['squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','JscriptySessionReport','count','includeAll','include','findAll','rows','show','options','find','create','body','params','catch','describe','getQuestions','JscriptyQuestionReport','order','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xfe7e,0x96));var _0xefe7=function(_0x7b6010,_0xecd819){_0x7b6010=_0x7b6010-0x0;var _0x253940=_0xfe7e[_0x7b6010];return _0x253940;};'use strict';var emlformat=require(_0xefe7('0x0'));var rimraf=require(_0xefe7('0x1'));var zipdir=require(_0xefe7('0x2'));var jsonpatch=require(_0xefe7('0x3'));var rp=require('request-promise');var moment=require(_0xefe7('0x4'));var BPromise=require(_0xefe7('0x5'));var Mustache=require(_0xefe7('0x6'));var util=require(_0xefe7('0x7'));var path=require(_0xefe7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xefe7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xefe7('0xa'));var crypto=require('crypto');var jsforce=require(_0xefe7('0xb'));var deskjs=require(_0xefe7('0xc'));var toCsv=require(_0xefe7('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xefe7('0xe'));var authService=require(_0xefe7('0xf'));var qs=require(_0xefe7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefe7('0x11'));var logger=require(_0xefe7('0x12'))(_0xefe7('0x13'));var utils=require(_0xefe7('0x14'));var config=require(_0xefe7('0x15'));var licenseUtil=require(_0xefe7('0x16'));var db=require(_0xefe7('0x17'))['db'];function respondWithStatusCode(_0x3b7a1a,_0x464d47){_0x464d47=_0x464d47||0xcc;return function(_0x1122f1){if(_0x1122f1){return _0x3b7a1a['sendStatus'](_0x464d47);}return _0x3b7a1a[_0xefe7('0x18')](_0x464d47)[_0xefe7('0x19')]();};}function respondWithResult(_0x2811ca,_0x5d716b){_0x5d716b=_0x5d716b||0xc8;return function(_0x4139da){if(_0x4139da){return _0x2811ca[_0xefe7('0x18')](_0x5d716b)[_0xefe7('0x1a')](_0x4139da);}};}function respondWithFilteredResult(_0x5da530,_0x37808b){return function(_0x4dd86d){if(_0x4dd86d){var _0x759cbe=typeof _0x37808b[_0xefe7('0x1b')]==='undefined'&&typeof _0x37808b['limit']==='undefined';var _0x41f77c=_0x4dd86d['count'];var _0x15ee5c=_0x759cbe?0x0:_0x37808b[_0xefe7('0x1b')];var _0x4c0610=_0x759cbe?_0x4dd86d['count']:_0x37808b[_0xefe7('0x1b')]+_0x37808b[_0xefe7('0x1c')];var _0x499ee5;if(_0x4c0610>=_0x41f77c){_0x4c0610=_0x41f77c;_0x499ee5=0xc8;}else{_0x499ee5=0xce;}_0x5da530['status'](_0x499ee5);return _0x5da530[_0xefe7('0x1d')]('Content-Range',_0x15ee5c+'-'+_0x4c0610+'/'+_0x41f77c)[_0xefe7('0x1a')](_0x4dd86d);}return null;};}function patchUpdates(_0x3a0c85){return function(_0x4d0ef7){try{jsonpatch[_0xefe7('0x1e')](_0x4d0ef7,_0x3a0c85,!![]);}catch(_0x16622e){return BPromise['reject'](_0x16622e);}return _0x4d0ef7[_0xefe7('0x1f')]();};}function saveUpdates(_0x4fb652,_0x537ab1){return function(_0x5b3dc0){if(_0x5b3dc0){return _0x5b3dc0[_0xefe7('0x20')](_0x4fb652)['then'](function(_0x5c78c5){return _0x5c78c5;});}return null;};}function removeEntity(_0x183cc2,_0x38407b){return function(_0x4e82d1){if(_0x4e82d1){return _0x4e82d1[_0xefe7('0x21')]()[_0xefe7('0x22')](function(){_0x183cc2['status'](0xcc)[_0xefe7('0x19')]();});}};}function handleEntityNotFound(_0x52d8aa,_0x1a788c){return function(_0x4724cd){if(!_0x4724cd){_0x52d8aa[_0xefe7('0x23')](0x194);}return _0x4724cd;};}function handleError(_0x57650f,_0x47109d){_0x47109d=_0x47109d||0x1f4;return function(_0x4433b8){logger[_0xefe7('0x24')](_0x4433b8[_0xefe7('0x25')]);if(_0x4433b8['name']){delete _0x4433b8[_0xefe7('0x26')];}_0x57650f[_0xefe7('0x18')](_0x47109d)[_0xefe7('0x27')](_0x4433b8);};}exports[_0xefe7('0x28')]=function(_0x3eff0c,_0x4187d7){var _0x281816={},_0x268aa0={},_0x19b890={'count':0x0,'rows':[]};var _0x1f74f3=_[_0xefe7('0x29')](db['JscriptySessionReport'][_0xefe7('0x2a')],function(_0xe7b542){return{'name':_0xe7b542[_0xefe7('0x2b')],'type':_0xe7b542['type'][_0xefe7('0x2c')]};});_0x268aa0[_0xefe7('0x2d')]=_['map'](_0x1f74f3,_0xefe7('0x26'));_0x268aa0[_0xefe7('0x2e')]=_[_0xefe7('0x2f')](_0x3eff0c[_0xefe7('0x2e')]);_0x268aa0[_0xefe7('0x30')]=_[_0xefe7('0x31')](_0x268aa0[_0xefe7('0x2d')],_0x268aa0[_0xefe7('0x2e')]);_0x281816[_0xefe7('0x32')]=_['intersection'](_0x268aa0[_0xefe7('0x2d')],qs['fields'](_0x3eff0c[_0xefe7('0x2e')][_0xefe7('0x33')]));_0x281816['attributes']=_0x281816[_0xefe7('0x32')][_0xefe7('0x34')]?_0x281816[_0xefe7('0x32')]:_0x268aa0[_0xefe7('0x2d')];if(!_0x3eff0c[_0xefe7('0x2e')][_0xefe7('0x35')](_0xefe7('0x36'))){_0x281816['limit']=qs[_0xefe7('0x1c')](_0x3eff0c[_0xefe7('0x2e')][_0xefe7('0x1c')]);_0x281816[_0xefe7('0x1b')]=qs[_0xefe7('0x1b')](_0x3eff0c[_0xefe7('0x2e')]['offset']);}_0x281816['order']=qs['sort'](_0x3eff0c[_0xefe7('0x2e')][_0xefe7('0x37')]);_0x281816[_0xefe7('0x38')]=qs[_0xefe7('0x30')](_[_0xefe7('0x39')](_0x3eff0c['query'],_0x268aa0['filters']),_0x1f74f3);if(_0x3eff0c[_0xefe7('0x2e')]['filter']){_0x281816['where']=_[_0xefe7('0x3a')](_0x281816[_0xefe7('0x38')],{'$or':_['map'](_0x1f74f3,function(_0x315e3d){if(_0x315e3d[_0xefe7('0x3b')]!==_0xefe7('0x3c')){var _0x31a665={};_0x31a665[_0x315e3d[_0xefe7('0x26')]]={'$like':'%'+_0x3eff0c[_0xefe7('0x2e')][_0xefe7('0x3d')]+'%'};return _0x31a665;}})});}_0x281816=_[_0xefe7('0x3a')]({},_0x281816,_0x3eff0c['options']);var _0x1ab8d7={'where':_0x281816[_0xefe7('0x38')]};return db[_0xefe7('0x3e')][_0xefe7('0x3f')](_0x1ab8d7)['then'](function(_0x43f094){_0x19b890[_0xefe7('0x3f')]=_0x43f094;if(_0x3eff0c[_0xefe7('0x2e')][_0xefe7('0x40')]){_0x281816[_0xefe7('0x41')]=[{'all':!![]}];}return db[_0xefe7('0x3e')][_0xefe7('0x42')](_0x281816);})[_0xefe7('0x22')](function(_0x567861){_0x19b890[_0xefe7('0x43')]=_0x567861;return _0x19b890;})[_0xefe7('0x22')](respondWithFilteredResult(_0x4187d7,_0x281816))['catch'](handleError(_0x4187d7,null));};exports[_0xefe7('0x44')]=function(_0x47b832,_0x152e3a){var _0x5b6256={'raw':!![],'where':{'id':_0x47b832['params']['id']}},_0x1bc02c={};_0x1bc02c['model']=_[_0xefe7('0x2f')](db['JscriptySessionReport']['rawAttributes']);_0x1bc02c[_0xefe7('0x2e')]=_[_0xefe7('0x2f')](_0x47b832['query']);_0x1bc02c['filters']=_[_0xefe7('0x31')](_0x1bc02c[_0xefe7('0x2d')],_0x1bc02c[_0xefe7('0x2e')]);_0x5b6256[_0xefe7('0x32')]=_[_0xefe7('0x31')](_0x1bc02c[_0xefe7('0x2d')],qs[_0xefe7('0x33')](_0x47b832[_0xefe7('0x2e')][_0xefe7('0x33')]));_0x5b6256['attributes']=_0x5b6256[_0xefe7('0x32')]['length']?_0x5b6256[_0xefe7('0x32')]:_0x1bc02c[_0xefe7('0x2d')];if(_0x47b832[_0xefe7('0x2e')]['includeAll']){_0x5b6256[_0xefe7('0x41')]=[{'all':!![]}];}_0x5b6256=_[_0xefe7('0x3a')]({},_0x5b6256,_0x47b832[_0xefe7('0x45')]);return db[_0xefe7('0x3e')][_0xefe7('0x46')](_0x5b6256)[_0xefe7('0x22')](handleEntityNotFound(_0x152e3a,null))['then'](respondWithResult(_0x152e3a,null))['catch'](handleError(_0x152e3a,null));};exports[_0xefe7('0x47')]=function(_0x252cee,_0x21c9f1){return db[_0xefe7('0x3e')][_0xefe7('0x47')](_0x252cee[_0xefe7('0x48')],{})[_0xefe7('0x22')](respondWithResult(_0x21c9f1,0xc9))['catch'](handleError(_0x21c9f1,null));};exports[_0xefe7('0x20')]=function(_0x339efb,_0x44f92c){if(_0x339efb[_0xefe7('0x48')]['id']){delete _0x339efb['body']['id'];}return db[_0xefe7('0x3e')][_0xefe7('0x46')]({'where':{'id':_0x339efb[_0xefe7('0x49')]['id']}})[_0xefe7('0x22')](handleEntityNotFound(_0x44f92c,null))['then'](saveUpdates(_0x339efb[_0xefe7('0x48')],null))['then'](respondWithResult(_0x44f92c,null))[_0xefe7('0x4a')](handleError(_0x44f92c,null));};exports[_0xefe7('0x21')]=function(_0x5d6dad,_0x29dec6){return db[_0xefe7('0x3e')][_0xefe7('0x46')]({'where':{'id':_0x5d6dad[_0xefe7('0x49')]['id']}})[_0xefe7('0x22')](handleEntityNotFound(_0x29dec6,null))[_0xefe7('0x22')](removeEntity(_0x29dec6,null))[_0xefe7('0x4a')](handleError(_0x29dec6,null));};exports[_0xefe7('0x4b')]=function(_0x42bd3b,_0x22b3fd){return db[_0xefe7('0x3e')][_0xefe7('0x4b')]()['then'](respondWithResult(_0x22b3fd,null))['catch'](handleError(_0x22b3fd,null));};exports[_0xefe7('0x4c')]=function(_0x10a342,_0x4125ee,_0x212c6c){var _0x59a856={'raw':!![],'where':{}};var _0x45b94a={};var _0x2b11aa={'count':0x0,'rows':[]};return db[_0xefe7('0x3e')]['findOne']({'where':{'id':_0x10a342[_0xefe7('0x49')]['id']}})[_0xefe7('0x22')](handleEntityNotFound(_0x4125ee,null))[_0xefe7('0x22')](function(_0x5c4c38){if(_0x5c4c38){_0x45b94a[_0xefe7('0x2d')]=_['keys'](db[_0xefe7('0x4d')][_0xefe7('0x2a')]);_0x45b94a[_0xefe7('0x2e')]=_[_0xefe7('0x2f')](_0x10a342[_0xefe7('0x2e')]);_0x45b94a[_0xefe7('0x30')]=_[_0xefe7('0x31')](_0x45b94a['model'],_0x45b94a[_0xefe7('0x2e')]);_0x59a856[_0xefe7('0x32')]=_[_0xefe7('0x31')](_0x45b94a['model'],qs[_0xefe7('0x33')](_0x10a342['query']['fields']));_0x59a856[_0xefe7('0x32')]=_0x59a856[_0xefe7('0x32')][_0xefe7('0x34')]?_0x59a856['attributes']:_0x45b94a['model'];if(!_0x10a342[_0xefe7('0x2e')][_0xefe7('0x35')](_0xefe7('0x36'))){_0x59a856[_0xefe7('0x1c')]=qs[_0xefe7('0x1c')](_0x10a342[_0xefe7('0x2e')][_0xefe7('0x1c')]);_0x59a856['offset']=qs[_0xefe7('0x1b')](_0x10a342[_0xefe7('0x2e')]['offset']);}_0x59a856[_0xefe7('0x4e')]=qs[_0xefe7('0x37')](_0x10a342[_0xefe7('0x2e')][_0xefe7('0x37')]);_0x59a856[_0xefe7('0x38')]=qs[_0xefe7('0x30')](_[_0xefe7('0x39')](_0x10a342['query'],_0x45b94a[_0xefe7('0x30')]));_0x59a856[_0xefe7('0x38')][_0xefe7('0x4f')]=_0x5c4c38['id'];if(_0x10a342[_0xefe7('0x2e')][_0xefe7('0x3d')]){_0x59a856[_0xefe7('0x38')]=_[_0xefe7('0x3a')](_0x59a856[_0xefe7('0x38')],{'$or':_[_0xefe7('0x29')](_0x59a856[_0xefe7('0x32')],function(_0x3e92f2){var _0x9a4f92={};_0x9a4f92[_0x3e92f2]={'$like':'%'+_0x10a342[_0xefe7('0x2e')][_0xefe7('0x3d')]+'%'};return _0x9a4f92;})});}_0x59a856=_[_0xefe7('0x3a')]({},_0x59a856,_0x10a342[_0xefe7('0x45')]);return db['JscriptyQuestionReport'][_0xefe7('0x3f')]({'where':_0x59a856['where']})[_0xefe7('0x22')](function(_0x5607f0){_0x2b11aa['count']=_0x5607f0;if(_0x10a342[_0xefe7('0x2e')]['includeAll']){_0x59a856[_0xefe7('0x41')]=[{'all':!![]}];}return db[_0xefe7('0x4d')][_0xefe7('0x42')](_0x59a856);})[_0xefe7('0x22')](function(_0x2b7d3c){_0x2b11aa[_0xefe7('0x43')]=_0x2b7d3c;return _0x2b11aa;});}})['then'](respondWithFilteredResult(_0x4125ee,_0x59a856))['catch'](handleError(_0x4125ee,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index f4d3392..831634b 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 _0x1b20=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1617e1,_0x47a5a5){var _0x3c2295=function(_0x847eb5){while(--_0x847eb5){_0x1617e1['push'](_0x1617e1['shift']());}};_0x3c2295(++_0x47a5a5);}(_0x1b20,0x66));var _0x01b2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b20[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var logger=require(_0x01b2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x01b2('0x2'));var rp=require(_0x01b2('0x3'));var fs=require('fs');var path=require(_0x01b2('0x4'));var rimraf=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var attributes=require(_0x01b2('0x7'));module[_0x01b2('0x8')]=function(_0x28de4a,_0x46e745){return _0x28de4a[_0x01b2('0x9')](_0x01b2('0xa'),attributes,{'tableName':_0x01b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11e5=['path','../../config/environment','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x5536fa,_0x3e0200){var _0x6f03b5=function(_0x8c1e66){while(--_0x8c1e66){_0x5536fa['push'](_0x5536fa['shift']());}};_0x6f03b5(++_0x3e0200);}(_0x11e5,0x8b));var _0x511e=function(_0xa0be1c,_0x152d5d){_0xa0be1c=_0xa0be1c-0x0;var _0x546eec=_0x11e5[_0xa0be1c];return _0x546eec;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 1d3ff91..4f5431a 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 _0x77e6=['client','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x453517,_0x5eff78){var _0x573754=function(_0xdffc3c){while(--_0xdffc3c){_0x453517['push'](_0x453517['shift']());}};_0x573754(++_0x5eff78);}(_0x77e6,0x1a6));var _0x677e=function(_0x2cd7a7,_0x86bc8e){_0x2cd7a7=_0x2cd7a7-0x0;var _0x160210=_0x77e6[_0x2cd7a7];return _0x160210;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});} \ No newline at end of file +var _0xd943=['info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x252749,_0x3c1691){var _0x411ea0=function(_0x3c3795){while(--_0x3c3795){_0x252749['push'](_0x252749['shift']());}};_0x411ea0(++_0x3c1691);}(_0xd943,0x15d));var _0x3d94=function(_0x537cc5,_0x2a0984){_0x537cc5=_0x537cc5-0x0;var _0x449139=_0xd943[_0x537cc5];return _0x449139;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 51adff7..2bd0ff0 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 _0x68ec=['Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express'];(function(_0x1c0a1b,_0x1689db){var _0x3aef17=function(_0x2288a4){while(--_0x2288a4){_0x1c0a1b['push'](_0x1c0a1b['shift']());}};_0x3aef17(++_0x1689db);}(_0x68ec,0xe6));var _0xc68e=function(_0x1bc148,_0x23471c){_0x1bc148=_0x1bc148-0x0;var _0x38f977=_0x68ec[_0x1bc148];return _0x38f977;};'use strict';var multer=require('multer');var util=require(_0xc68e('0x0'));var path=require(_0xc68e('0x1'));var timeout=require(_0xc68e('0x2'));var express=require(_0xc68e('0x3'));var router=express[_0xc68e('0x4')]();var fs_extra=require(_0xc68e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc68e('0x6'));var config=require(_0xc68e('0x7'));var controller=require(_0xc68e('0x8'));router[_0xc68e('0x9')]('/',controller[_0xc68e('0xa')]);router[_0xc68e('0xb')](_0xc68e('0xc'),auth[_0xc68e('0xd')](),controller[_0xc68e('0xe')]);router[_0xc68e('0x9')](_0xc68e('0xf'),auth[_0xc68e('0xd')](),controller[_0xc68e('0x10')]);module[_0xc68e('0x11')]=router; \ No newline at end of file +var _0x2fe3=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','put','update','get','isAuthenticated','exports','multer','util'];(function(_0x16cf82,_0x483dde){var _0x85bf86=function(_0x4b5bca){while(--_0x4b5bca){_0x16cf82['push'](_0x16cf82['shift']());}};_0x85bf86(++_0x483dde);}(_0x2fe3,0x1be));var _0x32fe=function(_0xe1f087,_0x19f979){_0xe1f087=_0xe1f087-0x0;var _0x2ddb79=_0x2fe3[_0xe1f087];return _0x2ddb79;};'use strict';var multer=require(_0x32fe('0x0'));var util=require(_0x32fe('0x1'));var path=require(_0x32fe('0x2'));var timeout=require(_0x32fe('0x3'));var express=require(_0x32fe('0x4'));var router=express[_0x32fe('0x5')]();var fs_extra=require(_0x32fe('0x6'));var auth=require(_0x32fe('0x7'));var interaction=require(_0x32fe('0x8'));var config=require(_0x32fe('0x9'));var controller=require(_0x32fe('0xa'));router['get']('/',controller['index']);router[_0x32fe('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x32fe('0xc')]);router[_0x32fe('0xd')]('/download_log_file',auth[_0x32fe('0xe')](),controller['downloadLogFile']);module[_0x32fe('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 5e7be46..ae62d76 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 _0xa580=['STRING','sequelize','TEXT'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa580,0x85));var _0x0a58=function(_0x2779d5,_0x3f5f09){_0x2779d5=_0x2779d5-0x0;var _0x50644b=_0xa580[_0x2779d5];return _0x50644b;};'use strict';var Sequelize=require(_0x0a58('0x0'));module['exports']={'license':{'type':Sequelize[_0x0a58('0x1')]},'data1':{'type':Sequelize[_0x0a58('0x2')]},'data2':{'type':Sequelize[_0x0a58('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x14e8=['exports','STRING','sequelize'];(function(_0x30e941,_0x24a9ef){var _0x45f43f=function(_0x22aba1){while(--_0x22aba1){_0x30e941['push'](_0x30e941['shift']());}};_0x45f43f(++_0x24a9ef);}(_0x14e8,0x1b8));var _0x814e=function(_0x51abbb,_0x17b74b){_0x51abbb=_0x51abbb-0x0;var _0x520cf9=_0x14e8[_0x51abbb];return _0x520cf9;};'use strict';var Sequelize=require(_0x814e('0x0'));module[_0x814e('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x814e('0x2')]},'data2':{'type':Sequelize[_0x814e('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index b4f6124..d337108 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 _0x94f3=['request-promise','bluebird','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','then','destroy','error','stack','model','keys','query','filters','attributes','intersection','fields','merge','options','getLicense','catch','body','License','find','params','get','key','demo','/var','log','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x94f3,0xb7));var _0x394f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94f3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x394f('0x0'));var rimraf=require(_0x394f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x394f('0x2'));var rp=require(_0x394f('0x3'));var moment=require('moment');var BPromise=require(_0x394f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x394f('0x5'));var sox=require(_0x394f('0x6'));var csv=require('to-csv');var ejs=require(_0x394f('0x7'));var fs=require('fs');var fs_extra=require(_0x394f('0x8'));var _=require(_0x394f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x394f('0xa'));var deskjs=require(_0x394f('0xb'));var toCsv=require(_0x394f('0xc'));var querystring=require(_0x394f('0xd'));var Papa=require(_0x394f('0xe'));var Redis=require(_0x394f('0xf'));var authService=require(_0x394f('0x10'));var qs=require(_0x394f('0x11'));var as=require(_0x394f('0x12'));var hardwareService=require(_0x394f('0x13'));var logger=require('../../config/logger')(_0x394f('0x14'));var utils=require('../../config/utils');var config=require(_0x394f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x394f('0x16'))['db'];function respondWithStatusCode(_0x461073,_0x8e2502){_0x8e2502=_0x8e2502||0xcc;return function(_0x431e34){if(_0x431e34){return _0x461073[_0x394f('0x17')](_0x8e2502);}return _0x461073[_0x394f('0x18')](_0x8e2502)[_0x394f('0x19')]();};}function respondWithResult(_0x5e17d9,_0x5ad093){_0x5ad093=_0x5ad093||0xc8;return function(_0x1236b1){if(_0x1236b1){return _0x5e17d9[_0x394f('0x18')](_0x5ad093)['json'](_0x1236b1);}};}function respondWithFilteredResult(_0x25883a,_0x1f4f46){return function(_0x34d245){if(_0x34d245){var _0x4ea2fa=typeof _0x1f4f46[_0x394f('0x1a')]===_0x394f('0x1b')&&typeof _0x1f4f46[_0x394f('0x1c')]==='undefined';var _0x52ee5f=_0x34d245[_0x394f('0x1d')];var _0x34c7a5=_0x4ea2fa?0x0:_0x1f4f46['offset'];var _0x3fbc79=_0x4ea2fa?_0x34d245[_0x394f('0x1d')]:_0x1f4f46[_0x394f('0x1a')]+_0x1f4f46['limit'];var _0x41dd00;if(_0x3fbc79>=_0x52ee5f){_0x3fbc79=_0x52ee5f;_0x41dd00=0xc8;}else{_0x41dd00=0xce;}_0x25883a['status'](_0x41dd00);return _0x25883a['set'](_0x394f('0x1e'),_0x34c7a5+'-'+_0x3fbc79+'/'+_0x52ee5f)[_0x394f('0x1f')](_0x34d245);}return null;};}function patchUpdates(_0x4772b0){return function(_0x578b31){try{jsonpatch['apply'](_0x578b31,_0x4772b0,!![]);}catch(_0x170f1e){return BPromise[_0x394f('0x20')](_0x170f1e);}return _0x578b31['save']();};}function saveUpdates(_0x5c1b8a,_0x2d8c3e){return function(_0x1b1bb2){if(_0x1b1bb2){return _0x1b1bb2['update'](_0x5c1b8a)[_0x394f('0x21')](function(_0x20de0c){return _0x20de0c;});}return null;};}function removeEntity(_0x4e03ce,_0x88acf1){return function(_0x556147){if(_0x556147){return _0x556147[_0x394f('0x22')]()[_0x394f('0x21')](function(){_0x4e03ce[_0x394f('0x18')](0xcc)[_0x394f('0x19')]();});}};}function handleEntityNotFound(_0x2b9e55,_0x2fcb54){return function(_0x1698bd){if(!_0x1698bd){_0x2b9e55[_0x394f('0x17')](0x194);}return _0x1698bd;};}function handleError(_0x5e130e,_0x14491e){_0x14491e=_0x14491e||0x1f4;return function(_0x516432){logger[_0x394f('0x23')](_0x516432[_0x394f('0x24')]);if(_0x516432['name']){delete _0x516432['name'];}_0x5e130e[_0x394f('0x18')](_0x14491e)['send'](_0x516432);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x1c440f,_0x3c4019){var _0x4efa92={'raw':!![],'where':{'id':0x1}},_0x3c34a7={};_0x3c34a7[_0x394f('0x25')]=_[_0x394f('0x26')](db['License']['rawAttributes']);_0x3c34a7[_0x394f('0x27')]=_[_0x394f('0x26')](_0x1c440f[_0x394f('0x27')]);_0x3c34a7[_0x394f('0x28')]=_['intersection'](_0x3c34a7[_0x394f('0x25')],_0x3c34a7[_0x394f('0x27')]);_0x4efa92[_0x394f('0x29')]=_[_0x394f('0x2a')](_0x3c34a7['model'],qs['fields'](_0x1c440f[_0x394f('0x27')][_0x394f('0x2b')]));_0x4efa92[_0x394f('0x29')]=_0x4efa92[_0x394f('0x29')]['length']?_0x4efa92[_0x394f('0x29')]:_0x3c34a7['model'];_0x4efa92=_[_0x394f('0x2c')]({},_0x4efa92,_0x1c440f[_0x394f('0x2d')]);return utilLicense[_0x394f('0x2e')](_0x4efa92)[_0x394f('0x21')](respondWithResult(_0x3c4019,null))[_0x394f('0x2f')](handleError(_0x3c4019,null));};exports['update']=function(_0x108757,_0x13e158){if(_0x108757[_0x394f('0x30')]['id']){delete _0x108757[_0x394f('0x30')]['id'];}return db[_0x394f('0x31')][_0x394f('0x32')]({'where':{'id':_0x108757[_0x394f('0x33')]['id']}})['then'](handleEntityNotFound(_0x13e158,null))[_0x394f('0x21')](function(_0x37874b){var _0x9d8799=_0x37874b[_0x394f('0x34')]({'plain':!![]});return utilLicense['checkLicense'](_0x9d8799,_0x108757[_0x394f('0x30')][_0x394f('0x35')]);})[_0x394f('0x21')](function(_0x1dc595){if(!_0x1dc595[_0x394f('0x36')]){return saveUpdates(_0x108757[_0x394f('0x30')],null);}return _0x1dc595;})[_0x394f('0x21')](respondWithResult(_0x13e158,null))[_0x394f('0x2f')](handleError(_0x13e158,null));};exports['downloadLogFile']=function(_0x2fc967,_0x499449){var _0xff30a='license-info.log';var _0x4ec650=path['join'](_0x394f('0x37'),_0x394f('0x38'),'xcally',_0xff30a);_0x499449['setHeader'](_0x394f('0x39'),_0x394f('0x3a')+_0xff30a);_0x499449['set'](_0x394f('0x3b'),_0x394f('0x3c'));_0x499449[_0x394f('0x3d')](_0x4ec650);}; \ No newline at end of file +var _0xb85d=['body','find','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','model','keys','License','rawAttributes','query','filters','attributes','fields','length','getLicense','catch'];(function(_0x5639ef,_0x1176fe){var _0x5a4b8e=function(_0x5332d0){while(--_0x5332d0){_0x5639ef['push'](_0x5639ef['shift']());}};_0x5a4b8e(++_0x1176fe);}(_0xb85d,0xa0));var _0xdb85=function(_0x15bd6b,_0x3edd5d){_0x15bd6b=_0x15bd6b-0x0;var _0x187319=_0xb85d[_0x15bd6b];return _0x187319;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb85('0x0'));var zipdir=require(_0xdb85('0x1'));var jsonpatch=require(_0xdb85('0x2'));var rp=require(_0xdb85('0x3'));var moment=require('moment');var BPromise=require(_0xdb85('0x4'));var Mustache=require('mustache');var util=require(_0xdb85('0x5'));var path=require(_0xdb85('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb85('0x7'));var _=require(_0xdb85('0x8'));var squel=require(_0xdb85('0x9'));var crypto=require(_0xdb85('0xa'));var jsforce=require(_0xdb85('0xb'));var deskjs=require(_0xdb85('0xc'));var toCsv=require(_0xdb85('0xd'));var querystring=require(_0xdb85('0xe'));var Papa=require(_0xdb85('0xf'));var Redis=require(_0xdb85('0x10'));var authService=require(_0xdb85('0x11'));var qs=require(_0xdb85('0x12'));var as=require(_0xdb85('0x13'));var hardwareService=require(_0xdb85('0x14'));var logger=require(_0xdb85('0x15'))(_0xdb85('0x16'));var utils=require(_0xdb85('0x17'));var config=require(_0xdb85('0x18'));var licenseUtil=require(_0xdb85('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x372073,_0x4f6a6e){_0x4f6a6e=_0x4f6a6e||0xcc;return function(_0x50c15b){if(_0x50c15b){return _0x372073['sendStatus'](_0x4f6a6e);}return _0x372073['status'](_0x4f6a6e)['end']();};}function respondWithResult(_0x5aa063,_0x170635){_0x170635=_0x170635||0xc8;return function(_0x5efbd1){if(_0x5efbd1){return _0x5aa063[_0xdb85('0x1a')](_0x170635)[_0xdb85('0x1b')](_0x5efbd1);}};}function respondWithFilteredResult(_0x2434dc,_0x4ea21a){return function(_0x444918){if(_0x444918){var _0x317565=typeof _0x4ea21a[_0xdb85('0x1c')]===_0xdb85('0x1d')&&typeof _0x4ea21a[_0xdb85('0x1e')]==='undefined';var _0x247a29=_0x444918[_0xdb85('0x1f')];var _0x378681=_0x317565?0x0:_0x4ea21a['offset'];var _0x442fab=_0x317565?_0x444918[_0xdb85('0x1f')]:_0x4ea21a['offset']+_0x4ea21a['limit'];var _0x516e27;if(_0x442fab>=_0x247a29){_0x442fab=_0x247a29;_0x516e27=0xc8;}else{_0x516e27=0xce;}_0x2434dc[_0xdb85('0x1a')](_0x516e27);return _0x2434dc[_0xdb85('0x20')](_0xdb85('0x21'),_0x378681+'-'+_0x442fab+'/'+_0x247a29)[_0xdb85('0x1b')](_0x444918);}return null;};}function patchUpdates(_0x5e9828){return function(_0x11105e){try{jsonpatch[_0xdb85('0x22')](_0x11105e,_0x5e9828,!![]);}catch(_0x5be710){return BPromise['reject'](_0x5be710);}return _0x11105e[_0xdb85('0x23')]();};}function saveUpdates(_0x4af9f2,_0x33cbc0){return function(_0x2f7238){if(_0x2f7238){return _0x2f7238[_0xdb85('0x24')](_0x4af9f2)[_0xdb85('0x25')](function(_0x313bc6){return _0x313bc6;});}return null;};}function removeEntity(_0x984f37,_0xc86eb4){return function(_0x18bef7){if(_0x18bef7){return _0x18bef7[_0xdb85('0x26')]()[_0xdb85('0x25')](function(){_0x984f37[_0xdb85('0x1a')](0xcc)[_0xdb85('0x27')]();});}};}function handleEntityNotFound(_0x302966,_0x30737a){return function(_0x56d98e){if(!_0x56d98e){_0x302966[_0xdb85('0x28')](0x194);}return _0x56d98e;};}function handleError(_0x120546,_0x56284c){_0x56284c=_0x56284c||0x1f4;return function(_0xc6d67b){logger[_0xdb85('0x29')](_0xc6d67b[_0xdb85('0x2a')]);if(_0xc6d67b[_0xdb85('0x2b')]){delete _0xc6d67b[_0xdb85('0x2b')];}_0x120546['status'](_0x56284c)[_0xdb85('0x2c')](_0xc6d67b);};}var utilLicense=require(_0xdb85('0x19'));exports['index']=function(_0x360491,_0x5f1d56){var _0x38efbc={'raw':!![],'where':{'id':0x1}},_0x2c5645={};_0x2c5645[_0xdb85('0x2d')]=_[_0xdb85('0x2e')](db[_0xdb85('0x2f')][_0xdb85('0x30')]);_0x2c5645[_0xdb85('0x31')]=_[_0xdb85('0x2e')](_0x360491['query']);_0x2c5645[_0xdb85('0x32')]=_['intersection'](_0x2c5645[_0xdb85('0x2d')],_0x2c5645[_0xdb85('0x31')]);_0x38efbc[_0xdb85('0x33')]=_['intersection'](_0x2c5645[_0xdb85('0x2d')],qs[_0xdb85('0x34')](_0x360491['query']['fields']));_0x38efbc['attributes']=_0x38efbc['attributes'][_0xdb85('0x35')]?_0x38efbc['attributes']:_0x2c5645[_0xdb85('0x2d')];_0x38efbc=_['merge']({},_0x38efbc,_0x360491['options']);return utilLicense[_0xdb85('0x36')](_0x38efbc)[_0xdb85('0x25')](respondWithResult(_0x5f1d56,null))[_0xdb85('0x37')](handleError(_0x5f1d56,null));};exports['update']=function(_0x2422f7,_0x2ce542){if(_0x2422f7[_0xdb85('0x38')]['id']){delete _0x2422f7[_0xdb85('0x38')]['id'];}return db['License'][_0xdb85('0x39')]({'where':{'id':_0x2422f7['params']['id']}})[_0xdb85('0x25')](handleEntityNotFound(_0x2ce542,null))[_0xdb85('0x25')](function(_0x29168e){var _0xe42bef=_0x29168e['get']({'plain':!![]});return utilLicense[_0xdb85('0x3a')](_0xe42bef,_0x2422f7[_0xdb85('0x38')][_0xdb85('0x3b')]);})[_0xdb85('0x25')](function(_0x18d996){if(!_0x18d996[_0xdb85('0x3c')]){return saveUpdates(_0x2422f7[_0xdb85('0x38')],null);}return _0x18d996;})['then'](respondWithResult(_0x2ce542,null))[_0xdb85('0x37')](handleError(_0x2ce542,null));};exports[_0xdb85('0x3d')]=function(_0x814e87,_0xee64b4){var _0x157320=_0xdb85('0x3e');var _0x5124b0=path[_0xdb85('0x3f')](_0xdb85('0x40'),_0xdb85('0x41'),'xcally',_0x157320);_0xee64b4[_0xdb85('0x42')](_0xdb85('0x43'),_0xdb85('0x44')+_0x157320);_0xee64b4[_0xdb85('0x20')](_0xdb85('0x45'),_0xdb85('0x46'));_0xee64b4[_0xdb85('0x47')](_0x5124b0);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 978ea2a..d209137 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 _0xa0fe=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','License','license'];(function(_0x2edeed,_0x3c442b){var _0x4246af=function(_0x3370b0){while(--_0x3370b0){_0x2edeed['push'](_0x2edeed['shift']());}};_0x4246af(++_0x3c442b);}(_0xa0fe,0xd8));var _0xea0f=function(_0x55bc01,_0x1218f3){_0x55bc01=_0x55bc01-0x0;var _0x45dcc3=_0xa0fe[_0x55bc01];return _0x45dcc3;};'use strict';var _=require(_0xea0f('0x0'));var util=require(_0xea0f('0x1'));var logger=require(_0xea0f('0x2'))('api');var moment=require(_0xea0f('0x3'));var BPromise=require(_0xea0f('0x4'));var rp=require(_0xea0f('0x5'));var fs=require('fs');var path=require(_0xea0f('0x6'));var rimraf=require(_0xea0f('0x7'));var config=require(_0xea0f('0x8'));var attributes=require('./license.attributes');module['exports']=function(_0x107407,_0x39fee3){return _0x107407[_0xea0f('0x9')](_0xea0f('0xa'),attributes,{'tableName':_0xea0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cad=['../../config/environment','./license.attributes','exports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xac4f65,_0x41a048){var _0x42a67d=function(_0x399646){while(--_0x399646){_0xac4f65['push'](_0xac4f65['shift']());}};_0x42a67d(++_0x41a048);}(_0x4cad,0x179));var _0xd4ca=function(_0x5e3107,_0x4cc707){_0x5e3107=_0x5e3107-0x0;var _0x193cb4=_0x4cad[_0x5e3107];return _0x193cb4;};'use strict';var _=require(_0xd4ca('0x0'));var util=require(_0xd4ca('0x1'));var logger=require(_0xd4ca('0x2'))(_0xd4ca('0x3'));var moment=require(_0xd4ca('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4ca('0x5'));var fs=require('fs');var path=require(_0xd4ca('0x6'));var rimraf=require(_0xd4ca('0x7'));var config=require(_0xd4ca('0x8'));var attributes=require(_0xd4ca('0x9'));module[_0xd4ca('0xa')]=function(_0x501c28,_0x4d0d8d){return _0x501c28['define']('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 74dfa59..17d6b35 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 _0x83ef=['request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x511994,_0x28da70){var _0x295dae=function(_0x280025){while(--_0x280025){_0x511994['push'](_0x511994['shift']());}};_0x295dae(++_0x28da70);}(_0x83ef,0xa7));var _0xf83e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x83ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf83e('0x0'));var util=require(_0xf83e('0x1'));var moment=require(_0xf83e('0x2'));var BPromise=require(_0xf83e('0x3'));var rs=require(_0xf83e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf83e('0x5'))['db'];var utils=require(_0xf83e('0x6'));var logger=require(_0xf83e('0x7'))(_0xf83e('0x8'));var config=require(_0xf83e('0x9'));var jayson=require(_0xf83e('0xa'));var client=jayson['client'][_0xf83e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd0d3de,_0x39a4bb,_0x55b43f){return new BPromise(function(_0x548f9e,_0x2d2fe7){return client['request'](_0xd0d3de,_0x55b43f)[_0xf83e('0xc')](function(_0x515e06){logger[_0xf83e('0xd')](_0xf83e('0xe'),_0x39a4bb,'request\x20sent');logger[_0xf83e('0xf')](_0xf83e('0x10'),_0x39a4bb,_0xf83e('0x11'),JSON['stringify'](_0x515e06));if(_0x515e06[_0xf83e('0x12')]){if(_0x515e06[_0xf83e('0x12')][_0xf83e('0x13')]===0x1f4){logger[_0xf83e('0x12')](_0xf83e('0xe'),_0x39a4bb,_0x515e06[_0xf83e('0x12')][_0xf83e('0x14')]);return _0x2d2fe7(_0x515e06[_0xf83e('0x12')]['message']);}logger['error'](_0xf83e('0xe'),_0x39a4bb,_0x515e06[_0xf83e('0x12')]['message']);return _0x548f9e(_0x515e06[_0xf83e('0x12')][_0xf83e('0x14')]);}else{logger['info'](_0xf83e('0xe'),_0x39a4bb,_0xf83e('0x11'));_0x548f9e(_0x515e06[_0xf83e('0x15')][_0xf83e('0x14')]);}})[_0xf83e('0x16')](function(_0xf2d8d5){logger[_0xf83e('0x12')](_0xf83e('0xe'),_0x39a4bb,_0xf2d8d5);_0x2d2fe7(_0xf2d8d5);});});} \ No newline at end of file +var _0xe628=['jayson/promise','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','License,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xe628,0x16e));var _0x8e62=function(_0x233d57,_0x284678){_0x233d57=_0x233d57-0x0;var _0x3eec8c=_0xe628[_0x233d57];return _0x3eec8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8e62('0x0'));var BPromise=require(_0x8e62('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e62('0x2'));var db=require(_0x8e62('0x3'))['db'];var utils=require(_0x8e62('0x4'));var logger=require(_0x8e62('0x5'))(_0x8e62('0x6'));var config=require(_0x8e62('0x7'));var jayson=require(_0x8e62('0x8'));var client=jayson['client'][_0x8e62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36a30a,_0x52a401,_0x2b6569){return new BPromise(function(_0x1a89a1,_0x4054dd){return client[_0x8e62('0xa')](_0x36a30a,_0x2b6569)[_0x8e62('0xb')](function(_0x1eff88){logger[_0x8e62('0xc')]('License,\x20%s,\x20%s',_0x52a401,_0x8e62('0xd'));logger['debug'](_0x8e62('0xe'),_0x52a401,_0x8e62('0xd'),JSON[_0x8e62('0xf')](_0x1eff88));if(_0x1eff88['error']){if(_0x1eff88[_0x8e62('0x10')][_0x8e62('0x11')]===0x1f4){logger[_0x8e62('0x10')]('License,\x20%s,\x20%s',_0x52a401,_0x1eff88[_0x8e62('0x10')]['message']);return _0x4054dd(_0x1eff88['error'][_0x8e62('0x12')]);}logger[_0x8e62('0x10')](_0x8e62('0x13'),_0x52a401,_0x1eff88[_0x8e62('0x10')][_0x8e62('0x12')]);return _0x1a89a1(_0x1eff88[_0x8e62('0x10')][_0x8e62('0x12')]);}else{logger[_0x8e62('0xc')](_0x8e62('0x13'),_0x52a401,_0x8e62('0xd'));_0x1a89a1(_0x1eff88[_0x8e62('0x14')][_0x8e62('0x12')]);}})[_0x8e62('0x15')](function(_0x30d787){logger[_0x8e62('0x10')](_0x8e62('0x13'),_0x52a401,_0x30d787);_0x4054dd(_0x30d787);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 77d458a..13a66cc 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 _0x9392=['/:id','show','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeImap','removeSmtp','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe'];(function(_0x4c9fb0,_0x391302){var _0x1fd634=function(_0x548305){while(--_0x548305){_0x4c9fb0['push'](_0x4c9fb0['shift']());}};_0x1fd634(++_0x391302);}(_0x9392,0x150));var _0x2939=function(_0xf326ad,_0x45273d){_0xf326ad=_0xf326ad-0x0;var _0xd046bc=_0x9392[_0xf326ad];return _0xd046bc;};'use strict';var multer=require(_0x2939('0x0'));var util=require(_0x2939('0x1'));var path=require(_0x2939('0x2'));var timeout=require(_0x2939('0x3'));var express=require(_0x2939('0x4'));var router=express[_0x2939('0x5')]();var fs_extra=require(_0x2939('0x6'));var auth=require(_0x2939('0x7'));var interaction=require(_0x2939('0x8'));var config=require(_0x2939('0x9'));var controller=require(_0x2939('0xa'));router[_0x2939('0xb')]('/',auth[_0x2939('0xc')](),controller['index']);router[_0x2939('0xb')](_0x2939('0xd'),auth[_0x2939('0xc')](),controller['describe']);router[_0x2939('0xb')](_0x2939('0xe'),auth[_0x2939('0xc')](),controller[_0x2939('0xf')]);router['get'](_0x2939('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x2939('0x11'),auth[_0x2939('0xc')](),controller['getAnswers']);router['get'](_0x2939('0x12'),auth[_0x2939('0xc')](),controller[_0x2939('0x13')]);router[_0x2939('0xb')](_0x2939('0x14'),auth[_0x2939('0xc')](),controller[_0x2939('0x15')]);router[_0x2939('0xb')]('/:id/interactions',auth[_0x2939('0xc')](),controller[_0x2939('0x16')]);router['get'](_0x2939('0x17'),auth[_0x2939('0xc')](),controller[_0x2939('0x18')]);router[_0x2939('0xb')](_0x2939('0x19'),auth[_0x2939('0xc')](),controller[_0x2939('0x1a')]);router[_0x2939('0xb')](_0x2939('0x1b'),auth[_0x2939('0xc')](),controller[_0x2939('0x1c')]);router[_0x2939('0xb')](_0x2939('0x1d'),auth[_0x2939('0xc')](),controller[_0x2939('0x1e')]);router['post'](_0x2939('0x10'),auth[_0x2939('0xc')](),controller[_0x2939('0x1f')]);router[_0x2939('0x20')](_0x2939('0x11'),auth[_0x2939('0xc')](),controller[_0x2939('0x21')]);router['post']('/',auth[_0x2939('0xc')](),controller[_0x2939('0x22')]);router['post'](_0x2939('0x12'),auth[_0x2939('0xc')](),controller[_0x2939('0x23')]);router[_0x2939('0x20')](_0x2939('0x14'),auth[_0x2939('0xc')](),controller[_0x2939('0x24')]);router['post'](_0x2939('0x25'),auth[_0x2939('0xc')](),controller[_0x2939('0x26')]);router[_0x2939('0x20')](_0x2939('0x17'),auth[_0x2939('0xc')](),controller[_0x2939('0x27')]);router[_0x2939('0x20')](_0x2939('0x28'),auth[_0x2939('0xc')](),controller[_0x2939('0x29')]);router[_0x2939('0x20')](_0x2939('0x1d'),auth[_0x2939('0xc')](),controller[_0x2939('0x2a')]);router[_0x2939('0x2b')](_0x2939('0xe'),auth[_0x2939('0xc')](),controller[_0x2939('0x2c')]);router[_0x2939('0x2d')](_0x2939('0x10'),auth['isAuthenticated'](),controller[_0x2939('0x2e')]);router['delete'](_0x2939('0x11'),auth[_0x2939('0xc')](),controller['removeAnswers']);router[_0x2939('0x2d')](_0x2939('0x12'),auth[_0x2939('0xc')](),controller[_0x2939('0x2f')]);router['delete'](_0x2939('0x14'),auth[_0x2939('0xc')](),controller[_0x2939('0x30')]);router[_0x2939('0x2d')](_0x2939('0xe'),auth[_0x2939('0xc')](),controller['destroy']);router['delete'](_0x2939('0x1d'),auth['isAuthenticated'](),controller[_0x2939('0x31')]);module['exports']=router; \ No newline at end of file +var _0x0cd5=['/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addInteraction','addApplications','send','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeAgents','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe'];(function(_0x5d491a,_0x46fe1b){var _0x31b402=function(_0x14854e){while(--_0x14854e){_0x5d491a['push'](_0x5d491a['shift']());}};_0x31b402(++_0x46fe1b);}(_0x0cd5,0x13c));var _0x50cd=function(_0x1a58d1,_0xa90685){_0x1a58d1=_0x1a58d1-0x0;var _0x101adc=_0x0cd5[_0x1a58d1];return _0x101adc;};'use strict';var multer=require('multer');var util=require(_0x50cd('0x0'));var path=require(_0x50cd('0x1'));var timeout=require(_0x50cd('0x2'));var express=require(_0x50cd('0x3'));var router=express['Router']();var fs_extra=require(_0x50cd('0x4'));var auth=require(_0x50cd('0x5'));var interaction=require(_0x50cd('0x6'));var config=require(_0x50cd('0x7'));var controller=require(_0x50cd('0x8'));router[_0x50cd('0x9')]('/',auth[_0x50cd('0xa')](),controller[_0x50cd('0xb')]);router[_0x50cd('0x9')]('/describe',auth[_0x50cd('0xa')](),controller[_0x50cd('0xc')]);router[_0x50cd('0x9')](_0x50cd('0xd'),auth['isAuthenticated'](),controller[_0x50cd('0xe')]);router['get'](_0x50cd('0xf'),auth['isAuthenticated'](),controller[_0x50cd('0x10')]);router[_0x50cd('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x50cd('0x11')]);router['get'](_0x50cd('0x12'),auth[_0x50cd('0xa')](),controller['getImap']);router[_0x50cd('0x9')](_0x50cd('0x13'),auth[_0x50cd('0xa')](),controller['getSmtp']);router['get'](_0x50cd('0x14'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x15')]);router[_0x50cd('0x9')](_0x50cd('0x16'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x17')]);router[_0x50cd('0x9')](_0x50cd('0x18'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x19')]);router['get'](_0x50cd('0x1a'),auth['isAuthenticated'](),controller[_0x50cd('0x1b')]);router[_0x50cd('0x9')]('/:id/users',auth[_0x50cd('0xa')](),controller[_0x50cd('0x1c')]);router[_0x50cd('0x1d')]('/:id/dispositions',auth[_0x50cd('0xa')](),controller[_0x50cd('0x1e')]);router[_0x50cd('0x1d')](_0x50cd('0x1f'),auth['isAuthenticated'](),controller[_0x50cd('0x20')]);router['post']('/',auth['isAuthenticated'](),controller[_0x50cd('0x21')]);router[_0x50cd('0x1d')](_0x50cd('0x12'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x22')]);router[_0x50cd('0x1d')](_0x50cd('0x13'),auth[_0x50cd('0xa')](),controller['addSmtp']);router[_0x50cd('0x1d')](_0x50cd('0x14'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x23')]);router[_0x50cd('0x1d')](_0x50cd('0x16'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x24')]);router[_0x50cd('0x1d')]('/:id/send',auth[_0x50cd('0xa')](),controller[_0x50cd('0x25')]);router[_0x50cd('0x1d')](_0x50cd('0x26'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x27')]);router[_0x50cd('0x28')](_0x50cd('0xd'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x29')]);router[_0x50cd('0x2a')](_0x50cd('0xf'),auth[_0x50cd('0xa')](),controller[_0x50cd('0x2b')]);router[_0x50cd('0x2a')](_0x50cd('0x1f'),auth['isAuthenticated'](),controller[_0x50cd('0x2c')]);router['delete'](_0x50cd('0x12'),auth['isAuthenticated'](),controller[_0x50cd('0x2d')]);router['delete'](_0x50cd('0x13'),auth[_0x50cd('0xa')](),controller['removeSmtp']);router['delete']('/:id',auth[_0x50cd('0xa')](),controller['destroy']);router[_0x50cd('0x2a')](_0x50cd('0x26'),auth['isAuthenticated'](),controller[_0x50cd('0x2e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index f74f327..b74ea2d 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 _0x3025=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','outlook365','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x3025,0xd4));var _0x5302=function(_0x26b522,_0x4aba19){_0x26b522=_0x26b522-0x0;var _0x32e2d3=_0x3025[_0x26b522];return _0x32e2d3;};'use strict';var Sequelize=require(_0x5302('0x0'));module['exports']={'description':{'type':Sequelize[_0x5302('0x1')]},'name':{'type':Sequelize[_0x5302('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x5302('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5302('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x5302('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x5302('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5302('0x1')],'allowNull':![],'defaultValue':_0x5302('0x3')},'fontSize':{'type':Sequelize[_0x5302('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5302('0x5')],'defaultValue':function(){return _0x5302('0x6');}},'notificationSound':{'type':Sequelize[_0x5302('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5302('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5302('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5302('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5302('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5302('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5302('0x8'),'set':function(_0x555fd8){if(!_0x555fd8)this[_0x5302('0x9')](_0x5302('0xa'),null);this['setDataValue'](_0x5302('0xb'),_0x555fd8);}},'provider':{'type':Sequelize['ENUM'](_0x5302('0xc'),'hotmail','yahoo',_0x5302('0xd')),'defaultValue':null,'get':function(){if(!this[_0x5302('0xe')](_0x5302('0xf')))return _0x5302('0x10');return this[_0x5302('0xe')](_0x5302('0xf'));},'set':function(_0x538b6c){if(_0x538b6c===_0x5302('0x10'))_0x538b6c=null;return this['setDataValue']('provider',_0x538b6c);}}}; \ No newline at end of file +var _0x15bb=['TEXT','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','hotmail','yahoo','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x32908c,_0x3eabbd){var _0x469b9a=function(_0x14fb0f){while(--_0x14fb0f){_0x32908c['push'](_0x32908c['shift']());}};_0x469b9a(++_0x3eabbd);}(_0x15bb,0x8a));var _0xb15b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x15bb[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require('sequelize');module[_0xb15b('0x0')]={'description':{'type':Sequelize[_0xb15b('0x1')]},'name':{'type':Sequelize[_0xb15b('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xb15b('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb15b('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb15b('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb15b('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb15b('0x1')],'allowNull':![],'defaultValue':_0xb15b('0x3')},'fontSize':{'type':Sequelize[_0xb15b('0x4')](0x2)[_0xb15b('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb15b('0x6')],'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[_0xb15b('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb15b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb15b('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb15b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb15b('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb15b('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb15b('0x2')],'defaultValue':![],'comment':_0xb15b('0x7'),'set':function(_0x16122d){if(!_0x16122d)this['setDataValue'](_0xb15b('0x8'),null);this[_0xb15b('0x9')](_0xb15b('0xa'),_0x16122d);}},'provider':{'type':Sequelize[_0xb15b('0xb')]('gmail',_0xb15b('0xc'),_0xb15b('0xd'),_0xb15b('0xe')),'defaultValue':null,'get':function(){if(!this[_0xb15b('0xf')](_0xb15b('0x10')))return'custom';return this['getDataValue'](_0xb15b('0x10'));},'set':function(_0x44eb88){if(_0x44eb88===_0xb15b('0x11'))_0x44eb88=null;return this[_0xb15b('0x9')](_0xb15b('0x10'),_0x44eb88);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 597f0dd..fe84ab5 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 _0xad24=['MailMessage','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','CmContact','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','service','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','bluebird','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','pass','password','modernAuthentication','CloudProviderId','host','port','secure','authentication','username','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','params','include','options','body','custom','provider','mandatoryDispositionPause','Mail\x20Account\x20not\x20found','describe','addDisposition','find','MailAccountId','Disposition','create','getDispositions','findOne','length','removeDispositions','CannedAnswer','getAnswers','pick','removeAnswers','ids','email','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','MailInteraction','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','send','getApplications','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x11107d,_0x5aa336){var _0x1844a5=function(_0x5b8c4d){while(--_0x5b8c4d){_0x11107d['push'](_0x11107d['shift']());}};_0x1844a5(++_0x5aa336);}(_0xad24,0xed));var _0x4ad2=function(_0x1d8b52,_0x230cdc){_0x1d8b52=_0x1d8b52-0x0;var _0x13d6e3=_0xad24[_0x1d8b52];return _0x13d6e3;};'use strict';var moment=require('moment');var BPromise=require(_0x4ad2('0x0'));var util=require(_0x4ad2('0x1'));var path=require('path');var _=require(_0x4ad2('0x2'));var juice=require(_0x4ad2('0x3'));var Redis=require(_0x4ad2('0x4'));var qs=require(_0x4ad2('0x5'));var logger=require(_0x4ad2('0x6'))(_0x4ad2('0x7'));var config=require(_0x4ad2('0x8'));var db=require(_0x4ad2('0x9'))['db'];config[_0x4ad2('0xa')]=_['defaults'](config[_0x4ad2('0xa')],{'host':_0x4ad2('0xb'),'port':0x18eb});var socket=require(_0x4ad2('0xc'))(new Redis(config[_0x4ad2('0xa')]));require(_0x4ad2('0xd'))[_0x4ad2('0xe')](socket);var jayson=require(_0x4ad2('0xf'));var client=jayson[_0x4ad2('0x10')][_0x4ad2('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x1a6687,_0xd332b5,_0x47bebd,_0x84b372){return new BPromise(function(_0x558466,_0x493ed4){var _0x47acfe=_0x84b372||client;return _0x47acfe['request'](_0x1a6687,_0x47bebd)['then'](function(_0x5caa38){logger[_0x4ad2('0x12')](_0x4ad2('0x13'),_0xd332b5,_0x4ad2('0x14'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0xd332b5,_0x4ad2('0x14'),JSON['stringify'](_0x5caa38));if(_0x5caa38[_0x4ad2('0x15')]){if(_0x5caa38['error'][_0x4ad2('0x16')]===0x1f4){logger[_0x4ad2('0x15')](_0x4ad2('0x13'),_0xd332b5,_0x5caa38[_0x4ad2('0x15')][_0x4ad2('0x17')]);return _0x493ed4(_0x5caa38[_0x4ad2('0x15')][_0x4ad2('0x17')]);}logger['error'](_0x4ad2('0x13'),_0xd332b5,_0x5caa38[_0x4ad2('0x15')][_0x4ad2('0x17')]);return _0x558466(_0x5caa38[_0x4ad2('0x15')]['message']);}else{logger[_0x4ad2('0x12')](_0x4ad2('0x13'),_0xd332b5,'request\x20sent');_0x558466(_0x5caa38[_0x4ad2('0x18')]['message']);}})[_0x4ad2('0x19')](function(_0x5b3631){logger[_0x4ad2('0x15')]('MailAccount,\x20%s,\x20%s',_0xd332b5,_0x5b3631);_0x493ed4(_0x5b3631);});});}function respondWithStatusCode(_0x9bf7cc,_0x14f693){_0x14f693=_0x14f693||0xcc;return function(_0x3986d3){if(_0x3986d3){return _0x9bf7cc[_0x4ad2('0x1a')](_0x14f693);}return _0x9bf7cc[_0x4ad2('0x1b')](_0x14f693)[_0x4ad2('0x1c')]();};}function respondWithResult(_0x3e35ca,_0x4a02cb){_0x4a02cb=_0x4a02cb||0xc8;return function(_0x5ab5b4){if(_0x5ab5b4){return _0x3e35ca['status'](_0x4a02cb)[_0x4ad2('0x1d')](_0x5ab5b4);}};}function respondWithFilteredResult(_0x471cae,_0x4a2804){return function(_0x5c2ffe){if(_0x5c2ffe){var _0x3e98d1=typeof _0x4a2804[_0x4ad2('0x1e')]===_0x4ad2('0x1f')&&typeof _0x4a2804['limit']===_0x4ad2('0x1f');var _0x37eb66=_0x5c2ffe[_0x4ad2('0x20')];var _0x2cc6f1=_0x3e98d1?0x0:_0x4a2804[_0x4ad2('0x1e')];var _0x18ad84=_0x3e98d1?_0x5c2ffe[_0x4ad2('0x20')]:_0x4a2804[_0x4ad2('0x1e')]+_0x4a2804[_0x4ad2('0x21')];var _0x2f146d;if(_0x18ad84>=_0x37eb66){_0x18ad84=_0x37eb66;_0x2f146d=0xc8;}else{_0x2f146d=0xce;}_0x471cae[_0x4ad2('0x1b')](_0x2f146d);return _0x471cae['set'](_0x4ad2('0x22'),_0x2cc6f1+'-'+_0x18ad84+'/'+_0x37eb66)[_0x4ad2('0x1d')](_0x5c2ffe);}return null;};}function saveUpdates(_0x5b53e8){return function(_0x294474){if(_0x294474){return _0x294474[_0x4ad2('0x23')](_0x5b53e8)[_0x4ad2('0x24')](function(_0x4b2125){return _0x4b2125;});}return null;};}function removeEntity(_0x4aa2c8){return function(_0x29382c){if(_0x29382c){return _0x29382c[_0x4ad2('0x25')]()['then'](function(){var _0x5c5ad9=_0x29382c[_0x4ad2('0x26')]({'plain':!![]});var _0x400a64=_0x4ad2('0x27');return db[_0x4ad2('0x28')][_0x4ad2('0x25')]({'where':{'type':_0x400a64,'resourceId':_0x5c5ad9['id']}})[_0x4ad2('0x24')](function(){return _0x29382c;});})[_0x4ad2('0x24')](function(){_0x4aa2c8[_0x4ad2('0x1b')](0xcc)[_0x4ad2('0x1c')]();});}};}function handleEntityNotFound(_0x18cf0e){return function(_0x2ad2e0){if(!_0x2ad2e0){_0x18cf0e[_0x4ad2('0x1a')](0x194);}return _0x2ad2e0;};}function handleError(_0x5220ae,_0x5dabf3){_0x5dabf3=_0x5dabf3||0x1f4;return function(_0x62d49e){logger[_0x4ad2('0x15')](_0x62d49e[_0x4ad2('0x29')]);if(_0x62d49e[_0x4ad2('0x2a')]){delete _0x62d49e[_0x4ad2('0x2a')];}_0x5220ae[_0x4ad2('0x1b')](_0x5dabf3)['send'](_0x62d49e);};}function getImapHost(_0x33364b){switch(_0x33364b){case'gmail':return _0x4ad2('0x2b');case _0x4ad2('0x2c'):return _0x4ad2('0x2d');case _0x4ad2('0x2e'):return'imap-mail.outlook.com';case _0x4ad2('0x2f'):return _0x4ad2('0x30');}throw new Error(_0x4ad2('0x31'),_0x33364b);}function getSmtpHost(_0x43cd91){switch(_0x43cd91){case _0x4ad2('0x32'):return _0x4ad2('0x33');case _0x4ad2('0x2c'):return _0x4ad2('0x34');case'hotmail':return _0x4ad2('0x35');case _0x4ad2('0x2f'):return _0x4ad2('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x43cd91);}function getAuthenticationOptions(_0x33cf51,_0x49e46a){var _0x4028f4={};var _0x3dd5e5={};if(_0x33cf51){_0x4028f4[_0x4ad2('0x37')]=_0x3dd5e5[_0x4ad2('0x37')]=_0x49e46a['username'];_0x4028f4['password']=_0x3dd5e5[_0x4ad2('0x38')]=_0x49e46a[_0x4ad2('0x39')];if(_0x49e46a['modernAuthentication']){_0x4028f4[_0x4ad2('0x3a')]=_0x3dd5e5['modernAuthentication']=!![];_0x4028f4[_0x4ad2('0x3b')]=_0x3dd5e5[_0x4ad2('0x3b')]=_0x49e46a[_0x4ad2('0x3b')];_0x4028f4[_0x4ad2('0x39')]=_0x3dd5e5[_0x4ad2('0x38')]=null;}else{_0x4028f4[_0x4ad2('0x3b')]=_0x3dd5e5[_0x4ad2('0x3b')]=null;}_0x4028f4[_0x4ad2('0x3c')]=getImapHost(_0x33cf51);_0x4028f4[_0x4ad2('0x3d')]=0x3e1;_0x3dd5e5['host']=getSmtpHost(_0x33cf51);_0x3dd5e5[_0x4ad2('0x3d')]=0x24b;_0x3dd5e5[_0x4ad2('0x3e')]=![];_0x4028f4['service']=_0x3dd5e5['service']=null;}else{if(_0x49e46a[_0x4ad2('0x3f')]){_0x4028f4[_0x4ad2('0x37')]=_0x3dd5e5['user']=_0x49e46a[_0x4ad2('0x40')];_0x4028f4['password']=_0x3dd5e5['pass']=_0x49e46a[_0x4ad2('0x39')];}else{_0x4028f4['authentication']=_0x3dd5e5['authentication']=![];_0x4028f4[_0x4ad2('0x37')]=_0x3dd5e5['user']=null;_0x4028f4[_0x4ad2('0x39')]=_0x3dd5e5[_0x4ad2('0x38')]=null;}_0x4028f4[_0x4ad2('0x3c')]=_0x49e46a[_0x4ad2('0x41')][_0x4ad2('0x3c')];_0x4028f4[_0x4ad2('0x3d')]=_0x49e46a['Imap'][_0x4ad2('0x3d')];_0x3dd5e5[_0x4ad2('0x3c')]=_0x49e46a[_0x4ad2('0x42')][_0x4ad2('0x3c')];_0x3dd5e5[_0x4ad2('0x3d')]=_0x49e46a['Smtp'][_0x4ad2('0x3d')];}return{'Imap':_0x4028f4,'Smtp':_0x3dd5e5};}exports[_0x4ad2('0x43')]=function(_0x1266ae,_0x5c73a0){var _0x538b2d={'include':[{'model':db[_0x4ad2('0x44')],'as':_0x4ad2('0x41')},{'model':db[_0x4ad2('0x45')],'as':_0x4ad2('0x42')},{'model':db[_0x4ad2('0x46')],'as':'mandatoryDispositionPause'}]},_0x51661f={},_0x19f767={'count':0x0,'rows':[]};var _0x5426f8=_[_0x4ad2('0x47')](db[_0x4ad2('0x48')][_0x4ad2('0x49')],function(_0x1f1f7e){return{'name':_0x1f1f7e[_0x4ad2('0x4a')],'type':_0x1f1f7e[_0x4ad2('0x4b')][_0x4ad2('0x4c')]};});_0x51661f[_0x4ad2('0x4d')]=_[_0x4ad2('0x47')](_0x5426f8,_0x4ad2('0x2a'));_0x51661f[_0x4ad2('0x4e')]=_[_0x4ad2('0x4f')](_0x1266ae[_0x4ad2('0x4e')]);_0x51661f[_0x4ad2('0x50')]=_[_0x4ad2('0x51')](_0x51661f[_0x4ad2('0x4d')],_0x51661f[_0x4ad2('0x4e')]);_0x538b2d[_0x4ad2('0x52')]=_[_0x4ad2('0x51')](_0x51661f[_0x4ad2('0x4d')],qs['fields'](_0x1266ae['query'][_0x4ad2('0x53')]));_0x538b2d[_0x4ad2('0x52')]=_0x538b2d[_0x4ad2('0x52')]['length']?_0x538b2d[_0x4ad2('0x52')]:_0x51661f[_0x4ad2('0x4d')];if(!_0x1266ae[_0x4ad2('0x4e')][_0x4ad2('0x54')](_0x4ad2('0x55'))){_0x538b2d['limit']=qs[_0x4ad2('0x21')](_0x1266ae[_0x4ad2('0x4e')][_0x4ad2('0x21')]);_0x538b2d[_0x4ad2('0x1e')]=qs[_0x4ad2('0x1e')](_0x1266ae['query'][_0x4ad2('0x1e')]);}_0x538b2d[_0x4ad2('0x56')]=qs[_0x4ad2('0x57')](_0x1266ae[_0x4ad2('0x4e')][_0x4ad2('0x57')]);_0x538b2d[_0x4ad2('0x58')]=qs[_0x4ad2('0x50')](_['pick'](_0x1266ae[_0x4ad2('0x4e')],_0x51661f[_0x4ad2('0x50')]),_0x5426f8);if(_0x1266ae[_0x4ad2('0x4e')]['filter']){_0x538b2d[_0x4ad2('0x58')]=_[_0x4ad2('0x59')](_0x538b2d[_0x4ad2('0x58')],{'$or':_['map'](_0x5426f8,function(_0x19eddb){if(_0x19eddb[_0x4ad2('0x4b')]!==_0x4ad2('0x5a')){var _0x5dbaa3={};_0x5dbaa3[_0x19eddb[_0x4ad2('0x2a')]]={'$like':'%'+_0x1266ae['query'][_0x4ad2('0x5b')]+'%'};return _0x5dbaa3;}})});}_0x538b2d=_[_0x4ad2('0x59')]({},_0x538b2d,_0x1266ae['options']);var _0xc7b168={'where':_0x538b2d[_0x4ad2('0x58')]};return db[_0x4ad2('0x48')][_0x4ad2('0x20')](_0xc7b168)[_0x4ad2('0x24')](function(_0x1ebc87){_0x19f767[_0x4ad2('0x20')]=_0x1ebc87;if(_0x1266ae[_0x4ad2('0x4e')][_0x4ad2('0x5c')]){_0x538b2d['include']=[{'all':!![]}];}return db[_0x4ad2('0x48')][_0x4ad2('0x5d')](_0x538b2d);})[_0x4ad2('0x24')](function(_0x1351f8){_0x19f767[_0x4ad2('0x5e')]=_0x1351f8;return _0x19f767;})['then'](respondWithFilteredResult(_0x5c73a0,_0x538b2d))[_0x4ad2('0x19')](handleError(_0x5c73a0,null));};exports['show']=function(_0xd84397,_0x3879e9){var _0x253875={'raw':![],'where':{'id':_0xd84397[_0x4ad2('0x5f')]['id']},'include':[{'model':db[_0x4ad2('0x44')],'as':_0x4ad2('0x41')},{'model':db[_0x4ad2('0x45')],'as':_0x4ad2('0x42')},{'model':db[_0x4ad2('0x46')],'as':'mandatoryDispositionPause'}]},_0x1f093f={};_0x1f093f['model']=_[_0x4ad2('0x4f')](db[_0x4ad2('0x48')][_0x4ad2('0x49')]);_0x1f093f[_0x4ad2('0x4e')]=_['keys'](_0xd84397[_0x4ad2('0x4e')]);_0x1f093f[_0x4ad2('0x50')]=_[_0x4ad2('0x51')](_0x1f093f[_0x4ad2('0x4d')],_0x1f093f[_0x4ad2('0x4e')]);_0x253875[_0x4ad2('0x52')]=_[_0x4ad2('0x51')](_0x1f093f[_0x4ad2('0x4d')],qs[_0x4ad2('0x53')](_0xd84397[_0x4ad2('0x4e')][_0x4ad2('0x53')]));_0x253875[_0x4ad2('0x52')]=_0x253875[_0x4ad2('0x52')]['length']?_0x253875['attributes']:_0x1f093f['model'];if(_0xd84397[_0x4ad2('0x4e')][_0x4ad2('0x5c')]){_0x253875[_0x4ad2('0x60')]=[{'all':!![]}];}_0x253875=_[_0x4ad2('0x59')]({},_0x253875,_0xd84397[_0x4ad2('0x61')]);return db[_0x4ad2('0x48')]['find'](_0x253875)[_0x4ad2('0x24')](handleEntityNotFound(_0x3879e9,null))[_0x4ad2('0x24')](respondWithResult(_0x3879e9,null))['catch'](handleError(_0x3879e9,null));};exports[_0x4ad2('0x23')]=function(_0x5d29c1,_0x532df2){if(_0x5d29c1[_0x4ad2('0x62')]['id']){delete _0x5d29c1[_0x4ad2('0x62')]['id'];}var _0x3c8338=_0x5d29c1[_0x4ad2('0x62')]['provider']===_0x4ad2('0x63')?null:_0x5d29c1[_0x4ad2('0x62')][_0x4ad2('0x64')];var _0x2dd5c5=_0x5d29c1[_0x4ad2('0x62')][_0x4ad2('0x41')]||{};var _0x46ac2f=_0x5d29c1[_0x4ad2('0x62')][_0x4ad2('0x42')]||{};if(_0x3c8338){_0x2dd5c5['host']=getImapHost(_0x3c8338);_0x2dd5c5['port']=0x3e1;_0x46ac2f[_0x4ad2('0x3c')]=getSmtpHost(_0x3c8338);_0x46ac2f[_0x4ad2('0x3d')]=0x24b;_0x46ac2f[_0x4ad2('0x3e')]=![];}if(_0x46ac2f[_0x4ad2('0x3a')]){_0x46ac2f[_0x4ad2('0x3e')]=![];}else{_0x46ac2f[_0x4ad2('0x3b')]=null;}if(!_0x2dd5c5[_0x4ad2('0x3a')])_0x2dd5c5[_0x4ad2('0x3b')]=null;_0x5d29c1[_0x4ad2('0x62')][_0x4ad2('0x41')]=_0x2dd5c5;_0x5d29c1[_0x4ad2('0x62')][_0x4ad2('0x42')]=_0x46ac2f;return db[_0x4ad2('0x48')]['find']({'where':{'id':_0x5d29c1[_0x4ad2('0x5f')]['id']},'include':[{'model':db[_0x4ad2('0x44')],'as':'Imap'},{'model':db[_0x4ad2('0x45')],'as':_0x4ad2('0x42')},{'model':db[_0x4ad2('0x46')],'as':_0x4ad2('0x65')}]})[_0x4ad2('0x24')](handleEntityNotFound(_0x532df2,null))['then'](function(_0x6871db){if(!_0x6871db)throw new Error(_0x4ad2('0x66'));if(_0x6871db['service'])delete _0x5d29c1[_0x4ad2('0x62')][_0x4ad2('0x41')];return _0x6871db;})['then'](saveUpdates(_0x5d29c1[_0x4ad2('0x62')],null))[_0x4ad2('0x24')](function(_0x45999d){if(!_0x5d29c1['body'][_0x4ad2('0x41')])return _0x45999d;return db[_0x4ad2('0x44')][_0x4ad2('0x23')](_0x5d29c1[_0x4ad2('0x62')]['Imap'],{'where':{'MailAccountId':_0x45999d['id']}})[_0x4ad2('0x24')](function(){return _0x45999d;});})[_0x4ad2('0x24')](function(_0x2a608f){if(!_0x5d29c1['body'][_0x4ad2('0x42')])return _0x2a608f;return db['MailServerOut'][_0x4ad2('0x23')](_0x5d29c1[_0x4ad2('0x62')][_0x4ad2('0x42')],{'where':{'MailAccountId':_0x2a608f['id']}})[_0x4ad2('0x24')](function(){return _0x2a608f;});})[_0x4ad2('0x24')](respondWithResult(_0x532df2,null))['catch'](handleError(_0x532df2,null));};exports['describe']=function(_0x3c3e3f,_0x1979d8){return db['MailAccount'][_0x4ad2('0x67')]()[_0x4ad2('0x24')](respondWithResult(_0x1979d8,null))['catch'](handleError(_0x1979d8,null));};exports[_0x4ad2('0x68')]=function(_0x10f8b5,_0x18f239){if(_0x10f8b5[_0x4ad2('0x62')]['id']){delete _0x10f8b5['body']['id'];}return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0x10f8b5[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x18f239,null))[_0x4ad2('0x24')](function(_0x2f50bc){if(_0x2f50bc){_0x10f8b5[_0x4ad2('0x62')][_0x4ad2('0x6a')]=_0x2f50bc['id'];return db[_0x4ad2('0x6b')][_0x4ad2('0x6c')](_0x10f8b5[_0x4ad2('0x62')]);}})['then'](respondWithResult(_0x18f239,null))[_0x4ad2('0x19')](handleError(_0x18f239,null));};exports[_0x4ad2('0x6d')]=function(_0x5ddd66,_0x578574){var _0x135be9={'raw':![],'where':{}};var _0x307d69={};var _0x2a279d={'count':0x0,'rows':[]};return db['MailAccount'][_0x4ad2('0x6e')]({'where':{'id':_0x5ddd66[_0x4ad2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x578574,null))[_0x4ad2('0x24')](function(_0x129eae){if(_0x129eae){_0x307d69[_0x4ad2('0x4d')]=_[_0x4ad2('0x4f')](db['Disposition'][_0x4ad2('0x49')]);_0x307d69[_0x4ad2('0x4e')]=_[_0x4ad2('0x4f')](_0x5ddd66[_0x4ad2('0x4e')]);_0x307d69[_0x4ad2('0x50')]=_[_0x4ad2('0x51')](_0x307d69[_0x4ad2('0x4d')],_0x307d69['query']);_0x135be9[_0x4ad2('0x52')]=_['intersection'](_0x307d69[_0x4ad2('0x4d')],qs[_0x4ad2('0x53')](_0x5ddd66[_0x4ad2('0x4e')][_0x4ad2('0x53')]));_0x135be9[_0x4ad2('0x52')]=_0x135be9[_0x4ad2('0x52')][_0x4ad2('0x6f')]?_0x135be9[_0x4ad2('0x52')]:_0x307d69[_0x4ad2('0x4d')];if(!_0x5ddd66[_0x4ad2('0x4e')]['hasOwnProperty'](_0x4ad2('0x55'))){_0x135be9[_0x4ad2('0x21')]=qs[_0x4ad2('0x21')](_0x5ddd66['query'][_0x4ad2('0x21')]);_0x135be9[_0x4ad2('0x1e')]=qs[_0x4ad2('0x1e')](_0x5ddd66[_0x4ad2('0x4e')][_0x4ad2('0x1e')]);}_0x135be9['order']=qs[_0x4ad2('0x57')](_0x5ddd66[_0x4ad2('0x4e')][_0x4ad2('0x57')]);_0x135be9[_0x4ad2('0x58')]=qs[_0x4ad2('0x50')](_['pick'](_0x5ddd66[_0x4ad2('0x4e')],_0x307d69[_0x4ad2('0x50')]));_0x135be9[_0x4ad2('0x58')][_0x4ad2('0x6a')]=_0x129eae['id'];if(_0x5ddd66[_0x4ad2('0x4e')][_0x4ad2('0x5b')]){_0x135be9[_0x4ad2('0x58')]=_[_0x4ad2('0x59')](_0x135be9[_0x4ad2('0x58')],{'$or':_['map'](_0x135be9['attributes'],function(_0x162780){var _0x30ca78={};_0x30ca78[_0x162780]={'$like':'%'+_0x5ddd66[_0x4ad2('0x4e')]['filter']+'%'};return _0x30ca78;})});}_0x135be9=_['merge']({},_0x135be9,_0x5ddd66[_0x4ad2('0x61')]);return db[_0x4ad2('0x6b')][_0x4ad2('0x20')]({'where':_0x135be9[_0x4ad2('0x58')]})[_0x4ad2('0x24')](function(_0x2a50d6){_0x2a279d['count']=_0x2a50d6;if(_0x5ddd66[_0x4ad2('0x4e')][_0x4ad2('0x5c')]){_0x135be9[_0x4ad2('0x60')]=[{'all':!![]}];}return db['Disposition'][_0x4ad2('0x5d')](_0x135be9);})['then'](function(_0x5ab8e5){_0x2a279d[_0x4ad2('0x5e')]=_0x5ab8e5;return _0x2a279d;});}})[_0x4ad2('0x24')](respondWithFilteredResult(_0x578574,_0x135be9))[_0x4ad2('0x19')](handleError(_0x578574,null));};exports[_0x4ad2('0x70')]=function(_0x4e9660,_0x11c042){return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0x4e9660[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x11c042,null))[_0x4ad2('0x24')](function(_0x5021cb){if(_0x5021cb){return _0x5021cb[_0x4ad2('0x70')](_0x4e9660['query']['ids']);}})[_0x4ad2('0x24')](respondWithStatusCode(_0x11c042,null))['catch'](handleError(_0x11c042,null));};exports['addAnswer']=function(_0x52bb93,_0x1f383c){if(_0x52bb93[_0x4ad2('0x62')]['id']){delete _0x52bb93[_0x4ad2('0x62')]['id'];}return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0x52bb93['params']['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x1f383c,null))['then'](function(_0x2278a5){if(_0x2278a5){_0x52bb93[_0x4ad2('0x62')][_0x4ad2('0x6a')]=_0x2278a5['id'];return db[_0x4ad2('0x71')]['create'](_0x52bb93[_0x4ad2('0x62')]);}})[_0x4ad2('0x24')](respondWithResult(_0x1f383c,null))[_0x4ad2('0x19')](handleError(_0x1f383c,null));};exports[_0x4ad2('0x72')]=function(_0x3c16f3,_0x3286ad){var _0x230233={'raw':![],'where':{}};var _0x1a5e1a={};var _0x5592f0={'count':0x0,'rows':[]};return db[_0x4ad2('0x48')][_0x4ad2('0x6e')]({'where':{'id':_0x3c16f3[_0x4ad2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3286ad,null))[_0x4ad2('0x24')](function(_0x128a53){if(_0x128a53){_0x1a5e1a[_0x4ad2('0x4d')]=_['keys'](db[_0x4ad2('0x71')][_0x4ad2('0x49')]);_0x1a5e1a[_0x4ad2('0x4e')]=_[_0x4ad2('0x4f')](_0x3c16f3[_0x4ad2('0x4e')]);_0x1a5e1a[_0x4ad2('0x50')]=_[_0x4ad2('0x51')](_0x1a5e1a['model'],_0x1a5e1a[_0x4ad2('0x4e')]);_0x230233['attributes']=_[_0x4ad2('0x51')](_0x1a5e1a[_0x4ad2('0x4d')],qs[_0x4ad2('0x53')](_0x3c16f3[_0x4ad2('0x4e')][_0x4ad2('0x53')]));_0x230233['attributes']=_0x230233['attributes'][_0x4ad2('0x6f')]?_0x230233[_0x4ad2('0x52')]:_0x1a5e1a[_0x4ad2('0x4d')];if(!_0x3c16f3[_0x4ad2('0x4e')]['hasOwnProperty'](_0x4ad2('0x55'))){_0x230233[_0x4ad2('0x21')]=qs['limit'](_0x3c16f3[_0x4ad2('0x4e')][_0x4ad2('0x21')]);_0x230233[_0x4ad2('0x1e')]=qs[_0x4ad2('0x1e')](_0x3c16f3[_0x4ad2('0x4e')][_0x4ad2('0x1e')]);}_0x230233['order']=qs[_0x4ad2('0x57')](_0x3c16f3['query'][_0x4ad2('0x57')]);_0x230233[_0x4ad2('0x58')]=qs[_0x4ad2('0x50')](_[_0x4ad2('0x73')](_0x3c16f3[_0x4ad2('0x4e')],_0x1a5e1a[_0x4ad2('0x50')]));_0x230233[_0x4ad2('0x58')][_0x4ad2('0x6a')]=_0x128a53['id'];if(_0x3c16f3[_0x4ad2('0x4e')]['filter']){_0x230233[_0x4ad2('0x58')]=_[_0x4ad2('0x59')](_0x230233[_0x4ad2('0x58')],{'$or':_[_0x4ad2('0x47')](_0x230233['attributes'],function(_0x5c6997){var _0x23da37={};_0x23da37[_0x5c6997]={'$like':'%'+_0x3c16f3['query'][_0x4ad2('0x5b')]+'%'};return _0x23da37;})});}_0x230233=_[_0x4ad2('0x59')]({},_0x230233,_0x3c16f3['options']);return db[_0x4ad2('0x71')][_0x4ad2('0x20')]({'where':_0x230233[_0x4ad2('0x58')]})['then'](function(_0x59bdb1){_0x5592f0[_0x4ad2('0x20')]=_0x59bdb1;if(_0x3c16f3[_0x4ad2('0x4e')]['includeAll']){_0x230233[_0x4ad2('0x60')]=[{'all':!![]}];}return db[_0x4ad2('0x71')]['findAll'](_0x230233);})[_0x4ad2('0x24')](function(_0x5924ff){_0x5592f0[_0x4ad2('0x5e')]=_0x5924ff;return _0x5592f0;});}})['then'](respondWithFilteredResult(_0x3286ad,_0x230233))['catch'](handleError(_0x3286ad,null));};exports[_0x4ad2('0x74')]=function(_0x2f0912,_0x269045){return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0x2f0912[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x269045,null))[_0x4ad2('0x24')](function(_0x53fb45){if(_0x53fb45){return _0x53fb45[_0x4ad2('0x74')](_0x2f0912[_0x4ad2('0x4e')][_0x4ad2('0x75')]);}})[_0x4ad2('0x24')](respondWithStatusCode(_0x269045,null))[_0x4ad2('0x19')](handleError(_0x269045,null));};exports[_0x4ad2('0x6c')]=function(_0x459318,_0x89bba0){var _0x5f1f4c={'name':_0x459318[_0x4ad2('0x62')][_0x4ad2('0x2a')],'key':_0x459318['body'][_0x4ad2('0x4c')],'provider':_0x459318[_0x4ad2('0x62')][_0x4ad2('0x64')]===_0x4ad2('0x63')?null:_0x459318[_0x4ad2('0x62')][_0x4ad2('0x64')],'email':_0x459318[_0x4ad2('0x62')][_0x4ad2('0x76')],'ListId':_0x459318[_0x4ad2('0x62')]['ListId'],'active':!_['isNil'](_0x459318[_0x4ad2('0x62')][_0x4ad2('0x77')])?_0x459318[_0x4ad2('0x62')][_0x4ad2('0x77')]:!![],'description':_0x459318[_0x4ad2('0x62')][_0x4ad2('0x78')]||null};var _0x462b21=getAuthenticationOptions(_0x5f1f4c[_0x4ad2('0x64')],_0x459318[_0x4ad2('0x62')]);_0x5f1f4c['Imap']=_0x462b21[_0x4ad2('0x41')];_0x5f1f4c['Smtp']=_0x462b21[_0x4ad2('0x42')];return db[_0x4ad2('0x48')]['create'](_0x5f1f4c,{'include':[{'model':db[_0x4ad2('0x45')],'as':_0x4ad2('0x42')},{'model':db[_0x4ad2('0x44')],'as':'Imap'}]})[_0x4ad2('0x24')](function(_0x3c5b91){var _0x984bef=_0x459318['user']['get']({'plain':!![]});if(!_0x984bef)throw new Error(_0x4ad2('0x79'));if(_0x984bef[_0x4ad2('0x7a')]==='user'){var _0x5a1515=_0x3c5b91['get']({'plain':!![]});return db[_0x4ad2('0x7b')]['find']({'where':{'name':_0x4ad2('0x27'),'userProfileId':_0x984bef['userProfileId']},'raw':!![]})[_0x4ad2('0x24')](function(_0x17d8f7){if(_0x17d8f7&&_0x17d8f7[_0x4ad2('0x7c')]===0x0){return db[_0x4ad2('0x28')][_0x4ad2('0x6c')]({'name':_0x5a1515[_0x4ad2('0x2a')],'resourceId':_0x5a1515['id'],'type':_0x17d8f7[_0x4ad2('0x2a')],'sectionId':_0x17d8f7['id']},{})[_0x4ad2('0x24')](function(){return _0x3c5b91;});}else{return _0x3c5b91;}})[_0x4ad2('0x19')](function(_0xf9bb3d){logger[_0x4ad2('0x15')](_0x4ad2('0x7d'),_0xf9bb3d);throw _0xf9bb3d;});}return _0x3c5b91;})[_0x4ad2('0x24')](respondWithResult(_0x89bba0,0xc9))[_0x4ad2('0x19')](handleError(_0x89bba0,null));};exports[_0x4ad2('0x7e')]=function(_0x40c4a6,_0x855b4a){return db['MailAccount'][_0x4ad2('0x6e')]({'where':{'id':_0x40c4a6[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x855b4a,null))[_0x4ad2('0x24')](function(_0x349568){if(_0x349568){return _0x349568['getImap']();}return null;})[_0x4ad2('0x24')](respondWithResult(_0x855b4a,null))['catch'](handleError(_0x855b4a,null));};exports[_0x4ad2('0x7f')]=function(_0x3e9416,_0x338fd5){if(_0x3e9416[_0x4ad2('0x62')]['id']){delete _0x3e9416[_0x4ad2('0x62')]['id'];}return db['MailAccount'][_0x4ad2('0x69')]({'where':{'id':_0x3e9416[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x338fd5,null))['then'](function(_0x5685a8){if(_0x5685a8){_0x3e9416['body'][_0x4ad2('0x6a')]=_0x5685a8['id'];return db['MailServerIn']['create'](_0x3e9416[_0x4ad2('0x62')]);}})['then'](respondWithResult(_0x338fd5,null))[_0x4ad2('0x19')](handleError(_0x338fd5,null));};exports[_0x4ad2('0x80')]=function(_0x408f66,_0xc36f1e){return db[_0x4ad2('0x48')]['findOne']({'where':{'id':_0x408f66[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0xc36f1e,null))[_0x4ad2('0x24')](function(_0x24cad5){if(_0x24cad5){return _0x24cad5['setImap'](null);}return null;})[_0x4ad2('0x24')](respondWithStatusCode(_0xc36f1e,null))['catch'](handleError(_0xc36f1e,null));};exports[_0x4ad2('0x81')]=function(_0x446c13,_0x53ed3f){return db['MailAccount']['findOne']({'where':{'id':_0x446c13[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x53ed3f,null))[_0x4ad2('0x24')](function(_0x4ad5dc){if(_0x4ad5dc){return _0x4ad5dc['getSmtp']();}return null;})[_0x4ad2('0x24')](respondWithResult(_0x53ed3f,null))[_0x4ad2('0x19')](handleError(_0x53ed3f,null));};exports[_0x4ad2('0x82')]=function(_0x472433,_0x167723){if(_0x472433[_0x4ad2('0x62')]['id']){delete _0x472433[_0x4ad2('0x62')]['id'];}return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0x472433[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x167723,null))[_0x4ad2('0x24')](function(_0x5aef08){if(_0x5aef08){_0x472433[_0x4ad2('0x62')]['MailAccountId']=_0x5aef08['id'];return db[_0x4ad2('0x45')][_0x4ad2('0x6c')](_0x472433[_0x4ad2('0x62')]);}})[_0x4ad2('0x24')](respondWithResult(_0x167723,null))[_0x4ad2('0x19')](handleError(_0x167723,null));};exports[_0x4ad2('0x83')]=function(_0x3d27e3,_0x4632fa){return db[_0x4ad2('0x48')][_0x4ad2('0x6e')]({'where':{'id':_0x3d27e3[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x4632fa,null))[_0x4ad2('0x24')](function(_0x1f6eed){if(_0x1f6eed){return _0x1f6eed[_0x4ad2('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x4632fa,null))[_0x4ad2('0x19')](handleError(_0x4632fa,null));};exports[_0x4ad2('0x85')]=function(_0x5483da,_0x579055){return db['MailInteraction'][_0x4ad2('0x69')]({'where':{'id':_0x5483da[_0x4ad2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x579055,null))[_0x4ad2('0x24')](function(_0x28bfd8){if(_0x28bfd8){return _0x28bfd8[_0x4ad2('0x85')](_0x5483da['body'][_0x4ad2('0x75')],_[_0x4ad2('0x86')](_0x5483da['body'],[_0x4ad2('0x75'),'id'])||{});}})['then'](respondWithResult(_0x579055,null))[_0x4ad2('0x19')](handleError(_0x579055,null));};exports['getInteractions']=function(_0x130ee4,_0x3b6554){var _0x404ac1={'raw':![],'where':{}};var _0x505d90={};var _0x463390={'count':0x0,'rows':[]};return db[_0x4ad2('0x48')][_0x4ad2('0x6e')]({'where':{'id':_0x130ee4[_0x4ad2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3b6554,null))['then'](function(_0xe45d1b){if(_0xe45d1b){_0x505d90[_0x4ad2('0x4d')]=_[_0x4ad2('0x4f')](db['MailInteraction']['rawAttributes']);_0x505d90[_0x4ad2('0x4e')]=_[_0x4ad2('0x4f')](_0x130ee4[_0x4ad2('0x4e')]);_0x505d90['filters']=_[_0x4ad2('0x51')](_0x505d90[_0x4ad2('0x4d')],_0x505d90[_0x4ad2('0x4e')]);_0x404ac1[_0x4ad2('0x52')]=_[_0x4ad2('0x51')](_0x505d90[_0x4ad2('0x4d')],qs[_0x4ad2('0x53')](_0x130ee4['query'][_0x4ad2('0x53')]));_0x404ac1[_0x4ad2('0x52')]=_0x404ac1['attributes']['length']?_0x404ac1[_0x4ad2('0x52')]:_0x505d90[_0x4ad2('0x4d')];if(!_0x130ee4[_0x4ad2('0x4e')][_0x4ad2('0x54')](_0x4ad2('0x55'))){_0x404ac1[_0x4ad2('0x21')]=qs['limit'](_0x130ee4['query'][_0x4ad2('0x21')]);_0x404ac1[_0x4ad2('0x1e')]=qs[_0x4ad2('0x1e')](_0x130ee4[_0x4ad2('0x4e')][_0x4ad2('0x1e')]);}_0x404ac1[_0x4ad2('0x56')]=qs['sort'](_0x130ee4[_0x4ad2('0x4e')][_0x4ad2('0x57')]);_0x404ac1[_0x4ad2('0x58')]=qs[_0x4ad2('0x50')](_['pick'](_0x130ee4[_0x4ad2('0x4e')],_0x505d90[_0x4ad2('0x50')]));_0x404ac1['where'][_0x4ad2('0x6a')]=_0xe45d1b['id'];if(_0x130ee4[_0x4ad2('0x4e')]['filter']){_0x404ac1[_0x4ad2('0x58')]=_['merge'](_0x404ac1[_0x4ad2('0x58')],{'$or':_[_0x4ad2('0x47')](_0x404ac1[_0x4ad2('0x52')],function(_0x1b9d95){var _0x41355d={};_0x41355d[_0x1b9d95]={'$like':'%'+_0x130ee4[_0x4ad2('0x4e')][_0x4ad2('0x5b')]+'%'};return _0x41355d;})});}_0x404ac1=_[_0x4ad2('0x59')]({},_0x404ac1,_0x130ee4[_0x4ad2('0x61')]);return db[_0x4ad2('0x87')][_0x4ad2('0x20')]({'where':_0x404ac1[_0x4ad2('0x58')]})[_0x4ad2('0x24')](function(_0x380457){_0x463390[_0x4ad2('0x20')]=_0x380457;if(_0x130ee4['query'][_0x4ad2('0x5c')]){_0x404ac1[_0x4ad2('0x60')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4ad2('0x88')],'as':_0x4ad2('0x89'),'attributes':['name',_0x4ad2('0x8a'),'internal'],'required':![]},{'model':db[_0x4ad2('0x8b')],'as':_0x4ad2('0x8c'),'attributes':['id',_0x4ad2('0x2a'),_0x4ad2('0x8d')],'where':_0x130ee4['query'][_0x4ad2('0x8e')]?{'id':_0x130ee4[_0x4ad2('0x4e')][_0x4ad2('0x8e')]}:undefined,'required':_0x130ee4[_0x4ad2('0x4e')][_0x4ad2('0x8e')]?!![]:![]}];}return db[_0x4ad2('0x87')][_0x4ad2('0x5d')](_0x404ac1);})[_0x4ad2('0x24')](function(_0x575c2d){_0x463390[_0x4ad2('0x5e')]=_0x575c2d;return _0x463390;});}})[_0x4ad2('0x24')](respondWithFilteredResult(_0x3b6554,_0x404ac1))['catch'](handleError(_0x3b6554,null));};exports[_0x4ad2('0x8f')]=function addApplications(_0x49ac3d,_0x3d5cac){var _0x26b32d=_0x49ac3d[_0x4ad2('0x5f')]['id'];var _0x592e64=_0x49ac3d['body'];var _0x15f5d3=0xc8;var _0x7db34d=null;return db[_0x4ad2('0x90')][_0x4ad2('0x91')]({'isolationLevel':db[_0x4ad2('0x90')][_0x4ad2('0x92')][_0x4ad2('0x93')][_0x4ad2('0x94')]},function(_0x45025e){return db[_0x4ad2('0x48')][_0x4ad2('0x6e')]({'where':{'id':_0x26b32d},'transaction':_0x45025e})[_0x4ad2('0x24')](function(_0x239007){if(_0x239007){return db[_0x4ad2('0x95')][_0x4ad2('0x25')]({'where':{'MailAccountId':_0x26b32d},'transaction':_0x45025e})['then'](function(){var _0x64a8bb=_[_0x4ad2('0x47')](_0x592e64,function(_0x4531a1){_0x4531a1[_0x4ad2('0x6a')]=_0x26b32d;return _0x4531a1;});return db['MailApplication'][_0x4ad2('0x96')](_0x64a8bb,{'transaction':_0x45025e});});}else{_0x15f5d3=0x194;_0x7db34d=[];}});})[_0x4ad2('0x24')](function(){if(_0x15f5d3!==0x194){return db['MailApplication'][_0x4ad2('0x97')]({'where':{'MailAccountId':_0x26b32d},'order':_0x4ad2('0x98')})[_0x4ad2('0x24')](function(_0x234c1d){_0x7db34d=_0x234c1d;});}})[_0x4ad2('0x19')](function(_0x28e3ed){_0x15f5d3=0x1f4;logger[_0x4ad2('0x15')](_0x28e3ed['stack']);if(_0x28e3ed[_0x4ad2('0x2a')]){delete _0x28e3ed[_0x4ad2('0x2a')];}_0x7db34d=_0x28e3ed;})['finally'](function(){if(_0x7db34d===null){_0x3d5cac[_0x4ad2('0x1a')](_0x15f5d3);}else{if(_0x15f5d3===0x1f4){_0x3d5cac['status'](_0x15f5d3)[_0x4ad2('0x99')](_0x7db34d);}else{_0x3d5cac[_0x4ad2('0x1b')](_0x15f5d3)['json'](_0x7db34d);}}});};exports['getApplications']=function(_0x3d92f8,_0x1f351c){var _0x509105={};var _0x48ce1c={};var _0x55f797;var _0x39cf63;return db['MailAccount'][_0x4ad2('0x6e')]({'where':{'id':_0x3d92f8[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x1f351c,null))[_0x4ad2('0x24')](function(_0x179ec8){if(_0x179ec8){_0x55f797=_0x179ec8;_0x48ce1c[_0x4ad2('0x4d')]=_[_0x4ad2('0x4f')](db[_0x4ad2('0x95')]['rawAttributes']);_0x48ce1c['query']=_[_0x4ad2('0x4f')](_0x3d92f8[_0x4ad2('0x4e')]);_0x48ce1c[_0x4ad2('0x50')]=_['intersection'](_0x48ce1c['model'],_0x48ce1c[_0x4ad2('0x4e')]);_0x509105['attributes']=_[_0x4ad2('0x51')](_0x48ce1c['model'],qs[_0x4ad2('0x53')](_0x3d92f8['query'][_0x4ad2('0x53')]));_0x509105[_0x4ad2('0x52')]=_0x509105[_0x4ad2('0x52')][_0x4ad2('0x6f')]?_0x509105[_0x4ad2('0x52')]:_0x48ce1c[_0x4ad2('0x4d')];_0x509105[_0x4ad2('0x56')]=qs['sort'](_0x3d92f8[_0x4ad2('0x4e')][_0x4ad2('0x57')]);_0x509105[_0x4ad2('0x58')]=qs[_0x4ad2('0x50')](_['pick'](_0x3d92f8[_0x4ad2('0x4e')],_0x48ce1c[_0x4ad2('0x50')]));if(_0x3d92f8[_0x4ad2('0x4e')][_0x4ad2('0x5b')]){_0x509105['where']=_['merge'](_0x509105[_0x4ad2('0x58')],{'$or':_[_0x4ad2('0x47')](_0x509105['attributes'],function(_0x50fe2c){var _0x15b8af={};_0x15b8af[_0x50fe2c]={'$like':'%'+_0x3d92f8[_0x4ad2('0x4e')][_0x4ad2('0x5b')]+'%'};return _0x15b8af;})});}_0x509105=_['merge']({},_0x509105,_0x3d92f8[_0x4ad2('0x61')]);return _0x55f797[_0x4ad2('0x9a')](_0x509105);}})['then'](function(_0x53eed0){if(_0x53eed0){_0x39cf63=_0x53eed0[_0x4ad2('0x6f')];if(!_0x3d92f8[_0x4ad2('0x4e')][_0x4ad2('0x54')]('nolimit')){_0x509105[_0x4ad2('0x21')]=qs['limit'](_0x3d92f8[_0x4ad2('0x4e')][_0x4ad2('0x21')]);_0x509105['offset']=qs[_0x4ad2('0x1e')](_0x3d92f8[_0x4ad2('0x4e')][_0x4ad2('0x1e')]);}return _0x55f797[_0x4ad2('0x9a')](_0x509105);}})['then'](function(_0x16d5b3){if(_0x16d5b3){return _0x16d5b3?{'count':_0x39cf63,'rows':_0x16d5b3}:null;}})[_0x4ad2('0x24')](respondWithResult(_0x1f351c,null))['catch'](handleError(_0x1f351c,null));};exports['getMessages']=function(_0x376625,_0x33e335){var _0xe66669={'raw':!![],'where':{}};var _0x59b420={};var _0x3ea641={'count':0x0,'rows':[]};return db[_0x4ad2('0x48')][_0x4ad2('0x6e')]({'where':{'id':_0x376625[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x33e335,null))[_0x4ad2('0x24')](function(_0x4acd33){if(_0x4acd33){_0x59b420[_0x4ad2('0x4d')]=_[_0x4ad2('0x4f')](db['MailMessage'][_0x4ad2('0x49')]);_0x59b420[_0x4ad2('0x4e')]=_[_0x4ad2('0x4f')](_0x376625[_0x4ad2('0x4e')]);_0x59b420[_0x4ad2('0x50')]=_[_0x4ad2('0x51')](_0x59b420['model'],_0x59b420['query']);_0xe66669[_0x4ad2('0x52')]=_[_0x4ad2('0x51')](_0x59b420[_0x4ad2('0x4d')],qs[_0x4ad2('0x53')](_0x376625['query'][_0x4ad2('0x53')]));_0xe66669[_0x4ad2('0x52')]=_0xe66669[_0x4ad2('0x52')][_0x4ad2('0x6f')]?_0xe66669[_0x4ad2('0x52')]:_0x59b420[_0x4ad2('0x4d')];if(!_0x376625['query'][_0x4ad2('0x54')](_0x4ad2('0x55'))){_0xe66669[_0x4ad2('0x21')]=qs['limit'](_0x376625[_0x4ad2('0x4e')][_0x4ad2('0x21')]);_0xe66669[_0x4ad2('0x1e')]=qs[_0x4ad2('0x1e')](_0x376625[_0x4ad2('0x4e')][_0x4ad2('0x1e')]);}_0xe66669[_0x4ad2('0x56')]=qs[_0x4ad2('0x57')](_0x376625[_0x4ad2('0x4e')][_0x4ad2('0x57')]);_0xe66669[_0x4ad2('0x58')]=qs[_0x4ad2('0x50')](_[_0x4ad2('0x73')](_0x376625[_0x4ad2('0x4e')],_0x59b420[_0x4ad2('0x50')]));_0xe66669[_0x4ad2('0x58')][_0x4ad2('0x6a')]=_0x4acd33['id'];if(_0x376625['query'][_0x4ad2('0x5b')]){_0xe66669[_0x4ad2('0x58')]=_['merge'](_0xe66669[_0x4ad2('0x58')],{'$or':_[_0x4ad2('0x47')](_0xe66669[_0x4ad2('0x52')],function(_0x4addd0){var _0x4015ae={};_0x4015ae[_0x4addd0]={'$like':'%'+_0x376625['query']['filter']+'%'};return _0x4015ae;})});}if(_0x376625['query'][_0x4ad2('0x9b')]){var _0x296641=_0x376625[_0x4ad2('0x4e')][_0x4ad2('0x9b')][_0x4ad2('0x9c')](',');var _0x309aff={};_0x309aff[_0x296641[0x0]]={'$gte':moment(_0x296641[0x1])[_0x4ad2('0x9d')](_0x4ad2('0x9e'))};_0xe66669[_0x4ad2('0x58')]=_[_0x4ad2('0x59')](_0xe66669[_0x4ad2('0x58')],_0x309aff);}_0xe66669=_[_0x4ad2('0x59')]({},_0xe66669,_0x376625['options']);return db[_0x4ad2('0x9f')][_0x4ad2('0x20')]({'where':_0xe66669[_0x4ad2('0x58')]})[_0x4ad2('0x24')](function(_0xf2079b){_0x3ea641[_0x4ad2('0x20')]=_0xf2079b;if(_0x376625[_0x4ad2('0x4e')][_0x4ad2('0x5c')]){_0xe66669[_0x4ad2('0x60')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0xe66669);})[_0x4ad2('0x24')](function(_0x34cb5d){if(_0x376625[_0x4ad2('0x4e')][_0x4ad2('0xa0')]===_0x4ad2('0xa1')){for(var _0x30b20a=0x0;_0x30b20a<_0x34cb5d[_0x4ad2('0x6f')];_0x30b20a++){_0x34cb5d[_0x30b20a]['body']=juice(_0x34cb5d[_0x30b20a]['body']);}}_0x3ea641[_0x4ad2('0x5e')]=_0x34cb5d;return _0x3ea641;});}})['then'](respondWithFilteredResult(_0x33e335,_0xe66669))[_0x4ad2('0x19')](handleError(_0x33e335,null));};exports[_0x4ad2('0x99')]=function(_0x42bd65,_0x346d72){var _0xf97256,_0x294ce0={},_0x5d9266;if(_0x42bd65[_0x4ad2('0x62')]['to']){_0x5d9266=_0x42bd65[_0x4ad2('0x62')]['to']['split'](',')[0x0];}return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0x42bd65[_0x4ad2('0x5f')]['id']},'include':[{'model':db[_0x4ad2('0xa2')],'as':_0x4ad2('0xa3'),'include':[{'model':db['CmContact'],'as':_0x4ad2('0xa4'),'where':{'email':_0x5d9266},'limit':0x1,'order':[[_0x4ad2('0xa5'),_0x4ad2('0xa6')]]}]},{'model':db[_0x4ad2('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4ad2('0xa7')],'as':_0x4ad2('0xa7'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x346d72,null))[_0x4ad2('0x24')](function(_0x2f4acc){if(!_0x2f4acc)return;_0xf97256=_0x2f4acc;if(!_0x2f4acc['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x42bd65[_0x4ad2('0x62')][_0x4ad2('0xa8')])){_0x42bd65[_0x4ad2('0x62')][_0x4ad2('0xa8')]=util[_0x4ad2('0x9d')](_0x4ad2('0xa9'),_0x2f4acc[_0x4ad2('0x2a')],_0x2f4acc[_0x4ad2('0x76')]||_0x2f4acc['Smtp'][_0x4ad2('0x37')]);}if(_0x42bd65[_0x4ad2('0x62')][_0x4ad2('0xaa')]&&_0x42bd65[_0x4ad2('0x62')][_0x4ad2('0xaa')][_0x4ad2('0x6f')]){for(var _0x4f705a=0x0;_0x4f705a<_0x42bd65['body'][_0x4ad2('0xaa')][_0x4ad2('0x6f')];_0x4f705a+=0x1){_0x42bd65[_0x4ad2('0x62')]['attachments'][_0x4f705a]={'filename':_0x42bd65[_0x4ad2('0x62')]['attachments'][_0x4f705a][_0x4ad2('0x2a')],'path':path[_0x4ad2('0xab')](config['root'],_0x4ad2('0xac'),_0x42bd65[_0x4ad2('0x62')]['attachments'][_0x4f705a][_0x4ad2('0xad')])};}}var _0x99be59=_0x2f4acc[_0x4ad2('0xae')]();return respondWithRpcPromise(_0x4ad2('0xaf'),_0x4ad2('0xb0'),{'account':_0x99be59,'message':_0x42bd65['body']});})[_0x4ad2('0x24')](function(_0x5e1f07){if(!_0x5e1f07)return;_0x294ce0=_0x5e1f07;if(!_0xf97256[_0x4ad2('0xa3')])throw new Error(_0x4ad2('0xb1'));if(_0xf97256[_0x4ad2('0xa3')][_0x4ad2('0xa4')][_0x4ad2('0x6f')])return _0xf97256['List'][_0x4ad2('0xa4')][0x0];return db[_0x4ad2('0xb2')][_0x4ad2('0x6c')](_['defaults'](_0x42bd65['body'],{'firstName':_0x42bd65['body']['to'],'email':_0x42bd65[_0x4ad2('0x62')]['to'],'phone':_0x42bd65['body']['to'],'ListId':_0xf97256[_0x4ad2('0xb3')]}));})['then'](function(_0x1ea7c3){if(!_0x1ea7c3)return;var _0x17d0e3={'UserId':_0x42bd65[_0x4ad2('0x37')]['id'],'ContactId':_0x1ea7c3['id'],'MailAccountId':_0xf97256['id'],'inReplyTo':_0x294ce0[_0x4ad2('0xb4')],'to':_0x42bd65['body'][_0x4ad2('0xa8')],'cc':_0x42bd65['body']['cc'],'subject':_0x42bd65[_0x4ad2('0x62')][_0x4ad2('0xb5')],'attach':_0x42bd65[_0x4ad2('0x62')][_0x4ad2('0xb6')],'firstMsgDirection':_0x4ad2('0xb7'),'lastMsgAt':moment()[_0x4ad2('0x9d')](_0x4ad2('0x9e')),'lastMsgDirection':_0x4ad2('0xb7'),'Messages':[_[_0x4ad2('0x59')](_0x42bd65['body'],{'messageId':_0x294ce0[_0x4ad2('0xb4')],'sentAt':moment()[_0x4ad2('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xf97256['id'],'UserId':_0x42bd65[_0x4ad2('0x37')]['id'],'ContactId':_0x1ea7c3['id']})]};if(_0x42bd65[_0x4ad2('0x62')][_0x4ad2('0xb8')]){_0x17d0e3=_['merge'](_0x17d0e3,_0x42bd65['body'][_0x4ad2('0xb8')]);}return db[_0x4ad2('0x87')]['create'](_0x17d0e3,{'include':[{'model':db[_0x4ad2('0x9f')],'as':_0x4ad2('0xb9')}]});})[_0x4ad2('0x24')](respondWithResult(_0x346d72,null))['catch'](handleError(_0x346d72,null));};exports[_0x4ad2('0xba')]=function(_0xa8feac,_0x105201){return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0xa8feac[_0x4ad2('0x5f')]['id']},'include':[{'model':db[_0x4ad2('0x45')],'as':_0x4ad2('0x42'),'raw':!![],'include':[{'model':db[_0x4ad2('0xa7')],'as':_0x4ad2('0xa7'),'raw':!![]}]}]})[_0x4ad2('0x24')](handleEntityNotFound(_0x105201,null))[_0x4ad2('0x24')](function(_0x2fbccd){if(!_0x2fbccd['Smtp'])return;var _0x2c0874=_0x2fbccd[_0x4ad2('0xae')]();return respondWithRpcPromise('VerifySmtp',_0x4ad2('0xba'),{'account':_0x2c0874});})['then'](respondWithResult(_0x105201,null))['catch'](handleError(_0x105201,null));};exports[_0x4ad2('0x25')]=function(_0xe9dcd,_0x372a28){return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0xe9dcd[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x372a28,null))[_0x4ad2('0x24')](function(_0xf025c4){if(_0xf025c4&&_0xf025c4[_0x4ad2('0xbb')]){throw new db[(_0x4ad2('0xbc'))][(_0x4ad2('0xbd'))](_0x4ad2('0xbe'));}return _0xf025c4;})[_0x4ad2('0x24')](removeEntity(_0x372a28,null))[_0x4ad2('0x19')](handleError(_0x372a28,null));};exports[_0x4ad2('0xbf')]=function(_0x1c3c45,_0x1afea9){return db[_0x4ad2('0x48')][_0x4ad2('0x69')]({'where':{'id':_0x1c3c45[_0x4ad2('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1afea9,null))[_0x4ad2('0x24')](function(_0x10881c){if(_0x10881c){return _0x10881c[_0x4ad2('0xbf')](_0x1c3c45[_0x4ad2('0x62')][_0x4ad2('0x75')],_[_0x4ad2('0x86')](_0x1c3c45[_0x4ad2('0x62')],[_0x4ad2('0x75'),'id'])||{})[_0x4ad2('0xc0')](function(_0x2254e0){for(var _0x2d4d4f=0x0;_0x2d4d4f<_0x1c3c45[_0x4ad2('0x62')][_0x4ad2('0x75')][_0x4ad2('0x6f')];_0x2d4d4f+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x1c3c45[_0x4ad2('0x62')][_0x4ad2('0x75')][_0x2d4d4f]),'MailAccountId':Number(_0x1c3c45[_0x4ad2('0x5f')]['id'])});}return _0x2254e0;});}})[_0x4ad2('0x24')](respondWithResult(_0x1afea9,null))[_0x4ad2('0x19')](handleError(_0x1afea9,null));};exports['removeAgents']=function(_0x5ab40d,_0x198125){return db['MailAccount'][_0x4ad2('0x69')]({'where':{'id':_0x5ab40d[_0x4ad2('0x5f')]['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0x198125,null))[_0x4ad2('0x24')](function(_0x1eedf9){if(_0x1eedf9){return _0x1eedf9[_0x4ad2('0xc1')](_0x5ab40d[_0x4ad2('0x4e')]['ids'])[_0x4ad2('0x24')](function(){if(_[_0x4ad2('0xc2')](_0x5ab40d[_0x4ad2('0x4e')]['ids'])){for(var _0x1b8f33=0x0;_0x1b8f33<_0x5ab40d[_0x4ad2('0x4e')][_0x4ad2('0x75')][_0x4ad2('0x6f')];_0x1b8f33+=0x1){socket[_0x4ad2('0xc3')]('userMailAccount:remove',{'UserId':Number(_0x5ab40d[_0x4ad2('0x4e')]['ids'][_0x1b8f33]),'MailAccountId':Number(_0x5ab40d[_0x4ad2('0x5f')]['id'])});}}else{socket[_0x4ad2('0xc3')](_0x4ad2('0xc4'),{'UserId':Number(_0x5ab40d['query'][_0x4ad2('0x75')]),'MailAccountId':Number(_0x5ab40d[_0x4ad2('0x5f')]['id'])});}});}})[_0x4ad2('0x24')](respondWithStatusCode(_0x198125,null))['catch'](handleError(_0x198125,null));};exports[_0x4ad2('0xc5')]=function(_0x47eaeb,_0xe137e8){var _0x59b8a8={};var _0x380330={};var _0x2cc8ca;var _0x449bff;return db[_0x4ad2('0x48')][_0x4ad2('0x6e')]({'where':{'id':_0x47eaeb['params']['id']}})[_0x4ad2('0x24')](handleEntityNotFound(_0xe137e8,null))['then'](function(_0x3e21fc){if(_0x3e21fc){_0x2cc8ca=_0x3e21fc;_0x380330[_0x4ad2('0x4d')]=_[_0x4ad2('0x4f')](db[_0x4ad2('0x88')][_0x4ad2('0x49')]);_0x380330[_0x4ad2('0x4e')]=_[_0x4ad2('0x4f')](_0x47eaeb[_0x4ad2('0x4e')]);_0x380330['filters']=_[_0x4ad2('0x51')](_0x380330[_0x4ad2('0x4d')],_0x380330['query']);_0x59b8a8[_0x4ad2('0x52')]=_[_0x4ad2('0x51')](_0x380330[_0x4ad2('0x4d')],qs[_0x4ad2('0x53')](_0x47eaeb[_0x4ad2('0x4e')][_0x4ad2('0x53')]));_0x59b8a8[_0x4ad2('0x52')]=_0x59b8a8[_0x4ad2('0x52')]['length']?_0x59b8a8[_0x4ad2('0x52')]:_0x380330[_0x4ad2('0x4d')];_0x59b8a8[_0x4ad2('0x56')]=qs[_0x4ad2('0x57')](_0x47eaeb['query'][_0x4ad2('0x57')]);_0x59b8a8['where']=qs[_0x4ad2('0x50')](_[_0x4ad2('0x73')](_0x47eaeb[_0x4ad2('0x4e')],_0x380330[_0x4ad2('0x50')]));if(_0x47eaeb[_0x4ad2('0x4e')][_0x4ad2('0x5b')]){_0x59b8a8['where']=_[_0x4ad2('0x59')](_0x59b8a8[_0x4ad2('0x58')],{'$or':_[_0x4ad2('0x47')](_0x59b8a8[_0x4ad2('0x52')],function(_0x4d45fd){var _0x58328b={};_0x58328b[_0x4d45fd]={'$like':'%'+_0x47eaeb[_0x4ad2('0x4e')][_0x4ad2('0x5b')]+'%'};return _0x58328b;})});}_0x59b8a8=_[_0x4ad2('0x59')]({},_0x59b8a8,_0x47eaeb['options']);return _0x2cc8ca[_0x4ad2('0xc5')](_0x59b8a8);}})[_0x4ad2('0x24')](function(_0x4d1964){if(_0x4d1964){_0x449bff=_0x4d1964[_0x4ad2('0x6f')];if(!_0x47eaeb[_0x4ad2('0x4e')][_0x4ad2('0x54')](_0x4ad2('0x55'))){_0x59b8a8[_0x4ad2('0x21')]=qs[_0x4ad2('0x21')](_0x47eaeb['query']['limit']);_0x59b8a8[_0x4ad2('0x1e')]=qs[_0x4ad2('0x1e')](_0x47eaeb['query'][_0x4ad2('0x1e')]);}return _0x2cc8ca[_0x4ad2('0xc5')](_0x59b8a8);}})['then'](function(_0x4c2955){if(_0x4c2955){return _0x4c2955?{'count':_0x449bff,'rows':_0x4c2955}:null;}})[_0x4ad2('0x24')](respondWithResult(_0xe137e8,null))[_0x4ad2('0x19')](handleError(_0xe137e8,null));}; \ No newline at end of file +var _0x9c15=['findOne','Disposition','length','pick','MailAccountId','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','email','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','format','true','split','CmList','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','messageId','subject','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','client','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','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','password','modernAuthentication','CloudProviderId','pass','host','port','service','authentication','username','Imap','Smtp','MailServerIn','MailServerOut','Pause','map','MailAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','body','provider','custom','secure','find','mandatoryDispositionPause','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions'];(function(_0x312ed3,_0x1066fe){var _0xcdea8a=function(_0x1c9b84){while(--_0x1c9b84){_0x312ed3['push'](_0x312ed3['shift']());}};_0xcdea8a(++_0x1066fe);}(_0x9c15,0x1e5));var _0x59c1=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9c15[_0x138adb];return _0x1b27f2;};'use strict';var moment=require('moment');var BPromise=require(_0x59c1('0x0'));var util=require(_0x59c1('0x1'));var path=require(_0x59c1('0x2'));var _=require(_0x59c1('0x3'));var juice=require(_0x59c1('0x4'));var Redis=require(_0x59c1('0x5'));var qs=require(_0x59c1('0x6'));var logger=require('../../config/logger')(_0x59c1('0x7'));var config=require(_0x59c1('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x59c1('0x9')](config[_0x59c1('0xa')],{'host':_0x59c1('0xb'),'port':0x18eb});var socket=require(_0x59c1('0xc'))(new Redis(config[_0x59c1('0xa')]));require(_0x59c1('0xd'))[_0x59c1('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x59c1('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x4b8c15,_0x310259,_0x5b3265,_0x51cd5c){return new BPromise(function(_0x77b746,_0x334d5a){var _0x1eda2a=_0x51cd5c||client;return _0x1eda2a['request'](_0x4b8c15,_0x5b3265)[_0x59c1('0x10')](function(_0x5b957d){logger['info'](_0x59c1('0x11'),_0x310259,_0x59c1('0x12'));logger['debug'](_0x59c1('0x13'),_0x310259,'request\x20sent',JSON['stringify'](_0x5b957d));if(_0x5b957d['error']){if(_0x5b957d['error']['code']===0x1f4){logger[_0x59c1('0x14')](_0x59c1('0x11'),_0x310259,_0x5b957d[_0x59c1('0x14')][_0x59c1('0x15')]);return _0x334d5a(_0x5b957d[_0x59c1('0x14')][_0x59c1('0x15')]);}logger[_0x59c1('0x14')](_0x59c1('0x11'),_0x310259,_0x5b957d['error'][_0x59c1('0x15')]);return _0x77b746(_0x5b957d[_0x59c1('0x14')][_0x59c1('0x15')]);}else{logger[_0x59c1('0x16')](_0x59c1('0x11'),_0x310259,_0x59c1('0x12'));_0x77b746(_0x5b957d[_0x59c1('0x17')][_0x59c1('0x15')]);}})[_0x59c1('0x18')](function(_0x59f0ee){logger['error'](_0x59c1('0x11'),_0x310259,_0x59f0ee);_0x334d5a(_0x59f0ee);});});}function respondWithStatusCode(_0x65e9e1,_0xcf8307){_0xcf8307=_0xcf8307||0xcc;return function(_0x39a2fb){if(_0x39a2fb){return _0x65e9e1[_0x59c1('0x19')](_0xcf8307);}return _0x65e9e1[_0x59c1('0x1a')](_0xcf8307)[_0x59c1('0x1b')]();};}function respondWithResult(_0xe04c35,_0x4fce3c){_0x4fce3c=_0x4fce3c||0xc8;return function(_0x11b46f){if(_0x11b46f){return _0xe04c35[_0x59c1('0x1a')](_0x4fce3c)[_0x59c1('0x1c')](_0x11b46f);}};}function respondWithFilteredResult(_0x10ed7f,_0x51e1c5){return function(_0x47fdd6){if(_0x47fdd6){var _0x3143ad=typeof _0x51e1c5[_0x59c1('0x1d')]==='undefined'&&typeof _0x51e1c5[_0x59c1('0x1e')]===_0x59c1('0x1f');var _0xc84d06=_0x47fdd6['count'];var _0x2cc563=_0x3143ad?0x0:_0x51e1c5[_0x59c1('0x1d')];var _0x3cdd3e=_0x3143ad?_0x47fdd6[_0x59c1('0x20')]:_0x51e1c5[_0x59c1('0x1d')]+_0x51e1c5['limit'];var _0x5049f5;if(_0x3cdd3e>=_0xc84d06){_0x3cdd3e=_0xc84d06;_0x5049f5=0xc8;}else{_0x5049f5=0xce;}_0x10ed7f[_0x59c1('0x1a')](_0x5049f5);return _0x10ed7f[_0x59c1('0x21')](_0x59c1('0x22'),_0x2cc563+'-'+_0x3cdd3e+'/'+_0xc84d06)[_0x59c1('0x1c')](_0x47fdd6);}return null;};}function saveUpdates(_0x3ff547){return function(_0x503ebe){if(_0x503ebe){return _0x503ebe[_0x59c1('0x23')](_0x3ff547)['then'](function(_0x1835da){return _0x1835da;});}return null;};}function removeEntity(_0x9392ac){return function(_0x55d6f6){if(_0x55d6f6){return _0x55d6f6[_0x59c1('0x24')]()['then'](function(){var _0x40b9ff=_0x55d6f6[_0x59c1('0x25')]({'plain':!![]});var _0x2eaad1=_0x59c1('0x26');return db[_0x59c1('0x27')][_0x59c1('0x24')]({'where':{'type':_0x2eaad1,'resourceId':_0x40b9ff['id']}})[_0x59c1('0x10')](function(){return _0x55d6f6;});})[_0x59c1('0x10')](function(){_0x9392ac[_0x59c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11d484){return function(_0x4a7681){if(!_0x4a7681){_0x11d484[_0x59c1('0x19')](0x194);}return _0x4a7681;};}function handleError(_0x326de0,_0x3b5804){_0x3b5804=_0x3b5804||0x1f4;return function(_0x5becd8){logger['error'](_0x5becd8[_0x59c1('0x28')]);if(_0x5becd8[_0x59c1('0x29')]){delete _0x5becd8[_0x59c1('0x29')];}_0x326de0[_0x59c1('0x1a')](_0x3b5804)[_0x59c1('0x2a')](_0x5becd8);};}function getImapHost(_0x24aac3){switch(_0x24aac3){case _0x59c1('0x2b'):return _0x59c1('0x2c');case _0x59c1('0x2d'):return _0x59c1('0x2e');case _0x59c1('0x2f'):return _0x59c1('0x30');case _0x59c1('0x31'):return _0x59c1('0x32');}throw new Error('Unknown\x20email\x20service\x20provider',_0x24aac3);}function getSmtpHost(_0x250c25){switch(_0x250c25){case _0x59c1('0x2b'):return _0x59c1('0x33');case _0x59c1('0x2d'):return _0x59c1('0x34');case'hotmail':return _0x59c1('0x35');case _0x59c1('0x31'):return'smtp.office365.com';}throw new Error(_0x59c1('0x36'),_0x250c25);}function getAuthenticationOptions(_0x3f9cf8,_0x211cd6){var _0x50bb9e={};var _0x401606={};if(_0x3f9cf8){_0x50bb9e['user']=_0x401606[_0x59c1('0x37')]=_0x211cd6['username'];_0x50bb9e[_0x59c1('0x38')]=_0x401606['pass']=_0x211cd6[_0x59c1('0x38')];if(_0x211cd6['modernAuthentication']){_0x50bb9e[_0x59c1('0x39')]=_0x401606[_0x59c1('0x39')]=!![];_0x50bb9e[_0x59c1('0x3a')]=_0x401606[_0x59c1('0x3a')]=_0x211cd6[_0x59c1('0x3a')];_0x50bb9e['password']=_0x401606[_0x59c1('0x3b')]=null;}else{_0x50bb9e[_0x59c1('0x3a')]=_0x401606[_0x59c1('0x3a')]=null;}_0x50bb9e[_0x59c1('0x3c')]=getImapHost(_0x3f9cf8);_0x50bb9e[_0x59c1('0x3d')]=0x3e1;_0x401606[_0x59c1('0x3c')]=getSmtpHost(_0x3f9cf8);_0x401606[_0x59c1('0x3d')]=0x24b;_0x401606['secure']=![];_0x50bb9e[_0x59c1('0x3e')]=_0x401606[_0x59c1('0x3e')]=null;}else{if(_0x211cd6[_0x59c1('0x3f')]){_0x50bb9e['user']=_0x401606[_0x59c1('0x37')]=_0x211cd6[_0x59c1('0x40')];_0x50bb9e[_0x59c1('0x38')]=_0x401606[_0x59c1('0x3b')]=_0x211cd6['password'];}else{_0x50bb9e[_0x59c1('0x3f')]=_0x401606[_0x59c1('0x3f')]=![];_0x50bb9e[_0x59c1('0x37')]=_0x401606[_0x59c1('0x37')]=null;_0x50bb9e[_0x59c1('0x38')]=_0x401606[_0x59c1('0x3b')]=null;}_0x50bb9e[_0x59c1('0x3c')]=_0x211cd6['Imap'][_0x59c1('0x3c')];_0x50bb9e[_0x59c1('0x3d')]=_0x211cd6[_0x59c1('0x41')][_0x59c1('0x3d')];_0x401606[_0x59c1('0x3c')]=_0x211cd6[_0x59c1('0x42')]['host'];_0x401606[_0x59c1('0x3d')]=_0x211cd6['Smtp'][_0x59c1('0x3d')];}return{'Imap':_0x50bb9e,'Smtp':_0x401606};}exports['index']=function(_0xd14660,_0x460b27){var _0x316559={'include':[{'model':db[_0x59c1('0x43')],'as':_0x59c1('0x41')},{'model':db[_0x59c1('0x44')],'as':_0x59c1('0x42')},{'model':db[_0x59c1('0x45')],'as':'mandatoryDispositionPause'}]},_0xcb56d5={},_0x49e8c1={'count':0x0,'rows':[]};var _0x420de6=_[_0x59c1('0x46')](db[_0x59c1('0x47')][_0x59c1('0x48')],function(_0x2e1620){return{'name':_0x2e1620[_0x59c1('0x49')],'type':_0x2e1620['type'][_0x59c1('0x4a')]};});_0xcb56d5[_0x59c1('0x4b')]=_['map'](_0x420de6,_0x59c1('0x29'));_0xcb56d5[_0x59c1('0x4c')]=_['keys'](_0xd14660[_0x59c1('0x4c')]);_0xcb56d5[_0x59c1('0x4d')]=_[_0x59c1('0x4e')](_0xcb56d5['model'],_0xcb56d5[_0x59c1('0x4c')]);_0x316559[_0x59c1('0x4f')]=_['intersection'](_0xcb56d5[_0x59c1('0x4b')],qs[_0x59c1('0x50')](_0xd14660[_0x59c1('0x4c')][_0x59c1('0x50')]));_0x316559['attributes']=_0x316559['attributes']['length']?_0x316559[_0x59c1('0x4f')]:_0xcb56d5[_0x59c1('0x4b')];if(!_0xd14660[_0x59c1('0x4c')][_0x59c1('0x51')](_0x59c1('0x52'))){_0x316559[_0x59c1('0x1e')]=qs[_0x59c1('0x1e')](_0xd14660['query'][_0x59c1('0x1e')]);_0x316559[_0x59c1('0x1d')]=qs[_0x59c1('0x1d')](_0xd14660[_0x59c1('0x4c')][_0x59c1('0x1d')]);}_0x316559[_0x59c1('0x53')]=qs[_0x59c1('0x54')](_0xd14660[_0x59c1('0x4c')][_0x59c1('0x54')]);_0x316559['where']=qs['filters'](_['pick'](_0xd14660[_0x59c1('0x4c')],_0xcb56d5[_0x59c1('0x4d')]),_0x420de6);if(_0xd14660[_0x59c1('0x4c')][_0x59c1('0x55')]){_0x316559[_0x59c1('0x56')]=_[_0x59c1('0x57')](_0x316559[_0x59c1('0x56')],{'$or':_[_0x59c1('0x46')](_0x420de6,function(_0x1dfe22){if(_0x1dfe22[_0x59c1('0x58')]!==_0x59c1('0x59')){var _0x37427e={};_0x37427e[_0x1dfe22[_0x59c1('0x29')]]={'$like':'%'+_0xd14660['query']['filter']+'%'};return _0x37427e;}})});}_0x316559=_[_0x59c1('0x57')]({},_0x316559,_0xd14660[_0x59c1('0x5a')]);var _0x1e1ca9={'where':_0x316559[_0x59c1('0x56')]};return db['MailAccount']['count'](_0x1e1ca9)[_0x59c1('0x10')](function(_0x47d752){_0x49e8c1[_0x59c1('0x20')]=_0x47d752;if(_0xd14660['query'][_0x59c1('0x5b')]){_0x316559[_0x59c1('0x5c')]=[{'all':!![]}];}return db[_0x59c1('0x47')][_0x59c1('0x5d')](_0x316559);})[_0x59c1('0x10')](function(_0x11daae){_0x49e8c1[_0x59c1('0x5e')]=_0x11daae;return _0x49e8c1;})[_0x59c1('0x10')](respondWithFilteredResult(_0x460b27,_0x316559))[_0x59c1('0x18')](handleError(_0x460b27,null));};exports[_0x59c1('0x5f')]=function(_0x475c67,_0xc6046f){var _0x11eeec={'raw':![],'where':{'id':_0x475c67[_0x59c1('0x60')]['id']},'include':[{'model':db[_0x59c1('0x43')],'as':_0x59c1('0x41')},{'model':db[_0x59c1('0x44')],'as':'Smtp'},{'model':db[_0x59c1('0x45')],'as':'mandatoryDispositionPause'}]},_0x464be6={};_0x464be6[_0x59c1('0x4b')]=_[_0x59c1('0x61')](db[_0x59c1('0x47')][_0x59c1('0x48')]);_0x464be6[_0x59c1('0x4c')]=_[_0x59c1('0x61')](_0x475c67[_0x59c1('0x4c')]);_0x464be6[_0x59c1('0x4d')]=_[_0x59c1('0x4e')](_0x464be6[_0x59c1('0x4b')],_0x464be6[_0x59c1('0x4c')]);_0x11eeec[_0x59c1('0x4f')]=_[_0x59c1('0x4e')](_0x464be6[_0x59c1('0x4b')],qs[_0x59c1('0x50')](_0x475c67['query'][_0x59c1('0x50')]));_0x11eeec[_0x59c1('0x4f')]=_0x11eeec[_0x59c1('0x4f')]['length']?_0x11eeec['attributes']:_0x464be6[_0x59c1('0x4b')];if(_0x475c67[_0x59c1('0x4c')]['includeAll']){_0x11eeec['include']=[{'all':!![]}];}_0x11eeec=_[_0x59c1('0x57')]({},_0x11eeec,_0x475c67[_0x59c1('0x5a')]);return db[_0x59c1('0x47')]['find'](_0x11eeec)['then'](handleEntityNotFound(_0xc6046f,null))['then'](respondWithResult(_0xc6046f,null))[_0x59c1('0x18')](handleError(_0xc6046f,null));};exports[_0x59c1('0x23')]=function(_0x17f506,_0x380141){if(_0x17f506[_0x59c1('0x62')]['id']){delete _0x17f506[_0x59c1('0x62')]['id'];}var _0x361b2d=_0x17f506[_0x59c1('0x62')][_0x59c1('0x63')]===_0x59c1('0x64')?null:_0x17f506['body'][_0x59c1('0x63')];var _0x5a273d=_0x17f506['body']['Imap']||{};var _0x55be0c=_0x17f506['body']['Smtp']||{};if(_0x361b2d){_0x5a273d[_0x59c1('0x3c')]=getImapHost(_0x361b2d);_0x5a273d[_0x59c1('0x3d')]=0x3e1;_0x55be0c[_0x59c1('0x3c')]=getSmtpHost(_0x361b2d);_0x55be0c[_0x59c1('0x3d')]=0x24b;_0x55be0c[_0x59c1('0x65')]=![];}if(_0x55be0c[_0x59c1('0x39')]){_0x55be0c[_0x59c1('0x65')]=![];}else{_0x55be0c[_0x59c1('0x3a')]=null;}if(!_0x5a273d['modernAuthentication'])_0x5a273d[_0x59c1('0x3a')]=null;_0x17f506[_0x59c1('0x62')][_0x59c1('0x41')]=_0x5a273d;_0x17f506['body'][_0x59c1('0x42')]=_0x55be0c;return db['MailAccount'][_0x59c1('0x66')]({'where':{'id':_0x17f506['params']['id']},'include':[{'model':db[_0x59c1('0x43')],'as':'Imap'},{'model':db[_0x59c1('0x44')],'as':_0x59c1('0x42')},{'model':db['Pause'],'as':_0x59c1('0x67')}]})[_0x59c1('0x10')](handleEntityNotFound(_0x380141,null))[_0x59c1('0x10')](function(_0x197257){if(!_0x197257)throw new Error(_0x59c1('0x68'));if(_0x197257[_0x59c1('0x3e')])delete _0x17f506[_0x59c1('0x62')]['Imap'];return _0x197257;})[_0x59c1('0x10')](saveUpdates(_0x17f506['body'],null))['then'](function(_0x4edd3a){if(!_0x17f506['body']['Imap'])return _0x4edd3a;return db['MailServerIn'][_0x59c1('0x23')](_0x17f506[_0x59c1('0x62')][_0x59c1('0x41')],{'where':{'MailAccountId':_0x4edd3a['id']}})[_0x59c1('0x10')](function(){return _0x4edd3a;});})[_0x59c1('0x10')](function(_0xb188f3){if(!_0x17f506[_0x59c1('0x62')]['Smtp'])return _0xb188f3;return db[_0x59c1('0x44')][_0x59c1('0x23')](_0x17f506[_0x59c1('0x62')]['Smtp'],{'where':{'MailAccountId':_0xb188f3['id']}})[_0x59c1('0x10')](function(){return _0xb188f3;});})[_0x59c1('0x10')](respondWithResult(_0x380141,null))[_0x59c1('0x18')](handleError(_0x380141,null));};exports[_0x59c1('0x69')]=function(_0x1482d2,_0x3804aa){return db[_0x59c1('0x47')]['describe']()[_0x59c1('0x10')](respondWithResult(_0x3804aa,null))[_0x59c1('0x18')](handleError(_0x3804aa,null));};exports[_0x59c1('0x6a')]=function(_0x3083c6,_0x2ab1d4){if(_0x3083c6[_0x59c1('0x62')]['id']){delete _0x3083c6['body']['id'];}return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x3083c6[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x2ab1d4,null))[_0x59c1('0x10')](function(_0x54fd20){if(_0x54fd20){_0x3083c6[_0x59c1('0x62')]['MailAccountId']=_0x54fd20['id'];return db['Disposition'][_0x59c1('0x6b')](_0x3083c6['body']);}})[_0x59c1('0x10')](respondWithResult(_0x2ab1d4,null))[_0x59c1('0x18')](handleError(_0x2ab1d4,null));};exports[_0x59c1('0x6c')]=function(_0x852686,_0xe4a9b7){var _0x4be867={'raw':![],'where':{}};var _0x751b58={};var _0xc580c1={'count':0x0,'rows':[]};return db[_0x59c1('0x47')][_0x59c1('0x6d')]({'where':{'id':_0x852686['params']['id']}})['then'](handleEntityNotFound(_0xe4a9b7,null))[_0x59c1('0x10')](function(_0x263510){if(_0x263510){_0x751b58[_0x59c1('0x4b')]=_[_0x59c1('0x61')](db[_0x59c1('0x6e')]['rawAttributes']);_0x751b58[_0x59c1('0x4c')]=_[_0x59c1('0x61')](_0x852686[_0x59c1('0x4c')]);_0x751b58[_0x59c1('0x4d')]=_[_0x59c1('0x4e')](_0x751b58[_0x59c1('0x4b')],_0x751b58[_0x59c1('0x4c')]);_0x4be867[_0x59c1('0x4f')]=_['intersection'](_0x751b58[_0x59c1('0x4b')],qs[_0x59c1('0x50')](_0x852686['query'][_0x59c1('0x50')]));_0x4be867['attributes']=_0x4be867['attributes'][_0x59c1('0x6f')]?_0x4be867[_0x59c1('0x4f')]:_0x751b58[_0x59c1('0x4b')];if(!_0x852686[_0x59c1('0x4c')][_0x59c1('0x51')](_0x59c1('0x52'))){_0x4be867[_0x59c1('0x1e')]=qs['limit'](_0x852686['query'][_0x59c1('0x1e')]);_0x4be867[_0x59c1('0x1d')]=qs[_0x59c1('0x1d')](_0x852686[_0x59c1('0x4c')][_0x59c1('0x1d')]);}_0x4be867[_0x59c1('0x53')]=qs[_0x59c1('0x54')](_0x852686[_0x59c1('0x4c')][_0x59c1('0x54')]);_0x4be867['where']=qs[_0x59c1('0x4d')](_[_0x59c1('0x70')](_0x852686['query'],_0x751b58['filters']));_0x4be867['where'][_0x59c1('0x71')]=_0x263510['id'];if(_0x852686[_0x59c1('0x4c')][_0x59c1('0x55')]){_0x4be867[_0x59c1('0x56')]=_[_0x59c1('0x57')](_0x4be867[_0x59c1('0x56')],{'$or':_[_0x59c1('0x46')](_0x4be867[_0x59c1('0x4f')],function(_0x5760b1){var _0x517588={};_0x517588[_0x5760b1]={'$like':'%'+_0x852686[_0x59c1('0x4c')]['filter']+'%'};return _0x517588;})});}_0x4be867=_[_0x59c1('0x57')]({},_0x4be867,_0x852686[_0x59c1('0x5a')]);return db[_0x59c1('0x6e')]['count']({'where':_0x4be867['where']})['then'](function(_0x310d32){_0xc580c1[_0x59c1('0x20')]=_0x310d32;if(_0x852686['query']['includeAll']){_0x4be867['include']=[{'all':!![]}];}return db[_0x59c1('0x6e')][_0x59c1('0x5d')](_0x4be867);})[_0x59c1('0x10')](function(_0x50f3c5){_0xc580c1['rows']=_0x50f3c5;return _0xc580c1;});}})[_0x59c1('0x10')](respondWithFilteredResult(_0xe4a9b7,_0x4be867))[_0x59c1('0x18')](handleError(_0xe4a9b7,null));};exports[_0x59c1('0x72')]=function(_0x131797,_0x237807){return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x131797[_0x59c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x237807,null))[_0x59c1('0x10')](function(_0x699335){if(_0x699335){return _0x699335[_0x59c1('0x72')](_0x131797[_0x59c1('0x4c')]['ids']);}})[_0x59c1('0x10')](respondWithStatusCode(_0x237807,null))['catch'](handleError(_0x237807,null));};exports[_0x59c1('0x73')]=function(_0x12936a,_0x15a2d1){if(_0x12936a[_0x59c1('0x62')]['id']){delete _0x12936a[_0x59c1('0x62')]['id'];}return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x12936a[_0x59c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x15a2d1,null))['then'](function(_0x15bf6c){if(_0x15bf6c){_0x12936a[_0x59c1('0x62')]['MailAccountId']=_0x15bf6c['id'];return db['CannedAnswer'][_0x59c1('0x6b')](_0x12936a[_0x59c1('0x62')]);}})[_0x59c1('0x10')](respondWithResult(_0x15a2d1,null))['catch'](handleError(_0x15a2d1,null));};exports[_0x59c1('0x74')]=function(_0x2645cc,_0x4b3ebd){var _0x1be7fe={'raw':![],'where':{}};var _0x4893d8={};var _0x169910={'count':0x0,'rows':[]};return db[_0x59c1('0x47')][_0x59c1('0x6d')]({'where':{'id':_0x2645cc['params']['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x4b3ebd,null))['then'](function(_0xd7f49d){if(_0xd7f49d){_0x4893d8[_0x59c1('0x4b')]=_[_0x59c1('0x61')](db[_0x59c1('0x75')][_0x59c1('0x48')]);_0x4893d8['query']=_['keys'](_0x2645cc[_0x59c1('0x4c')]);_0x4893d8['filters']=_[_0x59c1('0x4e')](_0x4893d8[_0x59c1('0x4b')],_0x4893d8['query']);_0x1be7fe[_0x59c1('0x4f')]=_[_0x59c1('0x4e')](_0x4893d8['model'],qs[_0x59c1('0x50')](_0x2645cc[_0x59c1('0x4c')]['fields']));_0x1be7fe['attributes']=_0x1be7fe[_0x59c1('0x4f')]['length']?_0x1be7fe[_0x59c1('0x4f')]:_0x4893d8[_0x59c1('0x4b')];if(!_0x2645cc[_0x59c1('0x4c')]['hasOwnProperty'](_0x59c1('0x52'))){_0x1be7fe['limit']=qs['limit'](_0x2645cc['query'][_0x59c1('0x1e')]);_0x1be7fe[_0x59c1('0x1d')]=qs[_0x59c1('0x1d')](_0x2645cc[_0x59c1('0x4c')][_0x59c1('0x1d')]);}_0x1be7fe[_0x59c1('0x53')]=qs[_0x59c1('0x54')](_0x2645cc['query'][_0x59c1('0x54')]);_0x1be7fe[_0x59c1('0x56')]=qs['filters'](_[_0x59c1('0x70')](_0x2645cc[_0x59c1('0x4c')],_0x4893d8['filters']));_0x1be7fe[_0x59c1('0x56')][_0x59c1('0x71')]=_0xd7f49d['id'];if(_0x2645cc[_0x59c1('0x4c')][_0x59c1('0x55')]){_0x1be7fe[_0x59c1('0x56')]=_[_0x59c1('0x57')](_0x1be7fe[_0x59c1('0x56')],{'$or':_[_0x59c1('0x46')](_0x1be7fe[_0x59c1('0x4f')],function(_0x24093d){var _0x32077a={};_0x32077a[_0x24093d]={'$like':'%'+_0x2645cc['query'][_0x59c1('0x55')]+'%'};return _0x32077a;})});}_0x1be7fe=_[_0x59c1('0x57')]({},_0x1be7fe,_0x2645cc['options']);return db['CannedAnswer'][_0x59c1('0x20')]({'where':_0x1be7fe[_0x59c1('0x56')]})[_0x59c1('0x10')](function(_0x2bba8f){_0x169910[_0x59c1('0x20')]=_0x2bba8f;if(_0x2645cc[_0x59c1('0x4c')][_0x59c1('0x5b')]){_0x1be7fe[_0x59c1('0x5c')]=[{'all':!![]}];}return db[_0x59c1('0x75')][_0x59c1('0x5d')](_0x1be7fe);})['then'](function(_0x2ed44b){_0x169910[_0x59c1('0x5e')]=_0x2ed44b;return _0x169910;});}})[_0x59c1('0x10')](respondWithFilteredResult(_0x4b3ebd,_0x1be7fe))[_0x59c1('0x18')](handleError(_0x4b3ebd,null));};exports['removeAnswers']=function(_0x2908bc,_0x206cd5){return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x2908bc[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x206cd5,null))['then'](function(_0x3f484d){if(_0x3f484d){return _0x3f484d[_0x59c1('0x76')](_0x2908bc[_0x59c1('0x4c')][_0x59c1('0x77')]);}})[_0x59c1('0x10')](respondWithStatusCode(_0x206cd5,null))[_0x59c1('0x18')](handleError(_0x206cd5,null));};exports[_0x59c1('0x6b')]=function(_0x2b36dc,_0x195ff9){var _0x32b484={'name':_0x2b36dc['body'][_0x59c1('0x29')],'key':_0x2b36dc[_0x59c1('0x62')][_0x59c1('0x4a')],'provider':_0x2b36dc[_0x59c1('0x62')][_0x59c1('0x63')]===_0x59c1('0x64')?null:_0x2b36dc[_0x59c1('0x62')][_0x59c1('0x63')],'email':_0x2b36dc['body'][_0x59c1('0x78')],'ListId':_0x2b36dc[_0x59c1('0x62')][_0x59c1('0x79')],'active':!_[_0x59c1('0x7a')](_0x2b36dc['body'][_0x59c1('0x7b')])?_0x2b36dc['body'][_0x59c1('0x7b')]:!![],'description':_0x2b36dc[_0x59c1('0x62')]['description']||null};var _0x5deec9=getAuthenticationOptions(_0x32b484[_0x59c1('0x63')],_0x2b36dc[_0x59c1('0x62')]);_0x32b484['Imap']=_0x5deec9[_0x59c1('0x41')];_0x32b484[_0x59c1('0x42')]=_0x5deec9[_0x59c1('0x42')];return db[_0x59c1('0x47')][_0x59c1('0x6b')](_0x32b484,{'include':[{'model':db[_0x59c1('0x44')],'as':_0x59c1('0x42')},{'model':db[_0x59c1('0x43')],'as':_0x59c1('0x41')}]})['then'](function(_0x545307){var _0x47c0c3=_0x2b36dc['user'][_0x59c1('0x25')]({'plain':!![]});if(!_0x47c0c3)throw new Error(_0x59c1('0x7c'));if(_0x47c0c3[_0x59c1('0x7d')]===_0x59c1('0x37')){var _0x2e2a59=_0x545307[_0x59c1('0x25')]({'plain':!![]});return db[_0x59c1('0x7e')][_0x59c1('0x66')]({'where':{'name':'MailAccounts','userProfileId':_0x47c0c3[_0x59c1('0x7f')]},'raw':!![]})[_0x59c1('0x10')](function(_0x114f86){if(_0x114f86&&_0x114f86[_0x59c1('0x80')]===0x0){return db[_0x59c1('0x27')][_0x59c1('0x6b')]({'name':_0x2e2a59['name'],'resourceId':_0x2e2a59['id'],'type':_0x114f86['name'],'sectionId':_0x114f86['id']},{})[_0x59c1('0x10')](function(){return _0x545307;});}else{return _0x545307;}})[_0x59c1('0x18')](function(_0x5378ba){logger[_0x59c1('0x14')](_0x59c1('0x81'),_0x5378ba);throw _0x5378ba;});}return _0x545307;})[_0x59c1('0x10')](respondWithResult(_0x195ff9,0xc9))[_0x59c1('0x18')](handleError(_0x195ff9,null));};exports[_0x59c1('0x82')]=function(_0x110267,_0x242517){return db[_0x59c1('0x47')]['findOne']({'where':{'id':_0x110267[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x242517,null))[_0x59c1('0x10')](function(_0x34fcd6){if(_0x34fcd6){return _0x34fcd6[_0x59c1('0x82')]();}return null;})[_0x59c1('0x10')](respondWithResult(_0x242517,null))[_0x59c1('0x18')](handleError(_0x242517,null));};exports[_0x59c1('0x83')]=function(_0x312975,_0x4a3224){if(_0x312975[_0x59c1('0x62')]['id']){delete _0x312975[_0x59c1('0x62')]['id'];}return db['MailAccount'][_0x59c1('0x66')]({'where':{'id':_0x312975[_0x59c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x4a3224,null))[_0x59c1('0x10')](function(_0x5aa63d){if(_0x5aa63d){_0x312975['body'][_0x59c1('0x71')]=_0x5aa63d['id'];return db['MailServerIn'][_0x59c1('0x6b')](_0x312975[_0x59c1('0x62')]);}})[_0x59c1('0x10')](respondWithResult(_0x4a3224,null))[_0x59c1('0x18')](handleError(_0x4a3224,null));};exports[_0x59c1('0x84')]=function(_0x317fa2,_0x18e462){return db[_0x59c1('0x47')][_0x59c1('0x6d')]({'where':{'id':_0x317fa2[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x18e462,null))['then'](function(_0x1a6df8){if(_0x1a6df8){return _0x1a6df8['setImap'](null);}return null;})[_0x59c1('0x10')](respondWithStatusCode(_0x18e462,null))[_0x59c1('0x18')](handleError(_0x18e462,null));};exports[_0x59c1('0x85')]=function(_0x56dfe7,_0x1c536d){return db[_0x59c1('0x47')][_0x59c1('0x6d')]({'where':{'id':_0x56dfe7[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x1c536d,null))['then'](function(_0x378fa9){if(_0x378fa9){return _0x378fa9['getSmtp']();}return null;})[_0x59c1('0x10')](respondWithResult(_0x1c536d,null))[_0x59c1('0x18')](handleError(_0x1c536d,null));};exports[_0x59c1('0x86')]=function(_0x1e51ab,_0x248e44){if(_0x1e51ab[_0x59c1('0x62')]['id']){delete _0x1e51ab[_0x59c1('0x62')]['id'];}return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x1e51ab[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x248e44,null))[_0x59c1('0x10')](function(_0x13b6a6){if(_0x13b6a6){_0x1e51ab['body'][_0x59c1('0x71')]=_0x13b6a6['id'];return db[_0x59c1('0x44')][_0x59c1('0x6b')](_0x1e51ab[_0x59c1('0x62')]);}})[_0x59c1('0x10')](respondWithResult(_0x248e44,null))[_0x59c1('0x18')](handleError(_0x248e44,null));};exports[_0x59c1('0x87')]=function(_0x3df8fc,_0x1c9ca3){return db[_0x59c1('0x47')][_0x59c1('0x6d')]({'where':{'id':_0x3df8fc['params']['id']}})['then'](handleEntityNotFound(_0x1c9ca3,null))['then'](function(_0x44b6f5){if(_0x44b6f5){return _0x44b6f5[_0x59c1('0x88')](null);}return null;})[_0x59c1('0x10')](respondWithStatusCode(_0x1c9ca3,null))[_0x59c1('0x18')](handleError(_0x1c9ca3,null));};exports['addInteraction']=function(_0x5a87ee,_0x3bf02a){return db[_0x59c1('0x89')][_0x59c1('0x66')]({'where':{'id':_0x5a87ee[_0x59c1('0x60')]['id']}})['then'](handleEntityNotFound(_0x3bf02a,null))[_0x59c1('0x10')](function(_0x46be0f){if(_0x46be0f){return _0x46be0f[_0x59c1('0x8a')](_0x5a87ee[_0x59c1('0x62')]['ids'],_[_0x59c1('0x8b')](_0x5a87ee[_0x59c1('0x62')],[_0x59c1('0x77'),'id'])||{});}})[_0x59c1('0x10')](respondWithResult(_0x3bf02a,null))[_0x59c1('0x18')](handleError(_0x3bf02a,null));};exports['getInteractions']=function(_0x1db861,_0x5b4a7a){var _0xeb1059={'raw':![],'where':{}};var _0x247316={};var _0x46d70f={'count':0x0,'rows':[]};return db['MailAccount'][_0x59c1('0x6d')]({'where':{'id':_0x1db861[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x5b4a7a,null))[_0x59c1('0x10')](function(_0x5a58b3){if(_0x5a58b3){_0x247316[_0x59c1('0x4b')]=_['keys'](db[_0x59c1('0x89')][_0x59c1('0x48')]);_0x247316[_0x59c1('0x4c')]=_['keys'](_0x1db861[_0x59c1('0x4c')]);_0x247316[_0x59c1('0x4d')]=_[_0x59c1('0x4e')](_0x247316[_0x59c1('0x4b')],_0x247316[_0x59c1('0x4c')]);_0xeb1059[_0x59c1('0x4f')]=_[_0x59c1('0x4e')](_0x247316[_0x59c1('0x4b')],qs[_0x59c1('0x50')](_0x1db861['query']['fields']));_0xeb1059[_0x59c1('0x4f')]=_0xeb1059[_0x59c1('0x4f')][_0x59c1('0x6f')]?_0xeb1059[_0x59c1('0x4f')]:_0x247316['model'];if(!_0x1db861[_0x59c1('0x4c')][_0x59c1('0x51')](_0x59c1('0x52'))){_0xeb1059[_0x59c1('0x1e')]=qs[_0x59c1('0x1e')](_0x1db861[_0x59c1('0x4c')][_0x59c1('0x1e')]);_0xeb1059['offset']=qs['offset'](_0x1db861[_0x59c1('0x4c')][_0x59c1('0x1d')]);}_0xeb1059[_0x59c1('0x53')]=qs['sort'](_0x1db861[_0x59c1('0x4c')]['sort']);_0xeb1059[_0x59c1('0x56')]=qs[_0x59c1('0x4d')](_[_0x59c1('0x70')](_0x1db861[_0x59c1('0x4c')],_0x247316[_0x59c1('0x4d')]));_0xeb1059[_0x59c1('0x56')][_0x59c1('0x71')]=_0x5a58b3['id'];if(_0x1db861[_0x59c1('0x4c')][_0x59c1('0x55')]){_0xeb1059[_0x59c1('0x56')]=_['merge'](_0xeb1059[_0x59c1('0x56')],{'$or':_['map'](_0xeb1059[_0x59c1('0x4f')],function(_0x2b69db){var _0x3a7feb={};_0x3a7feb[_0x2b69db]={'$like':'%'+_0x1db861[_0x59c1('0x4c')][_0x59c1('0x55')]+'%'};return _0x3a7feb;})});}_0xeb1059=_[_0x59c1('0x57')]({},_0xeb1059,_0x1db861['options']);return db['MailInteraction']['count']({'where':_0xeb1059['where']})[_0x59c1('0x10')](function(_0x2f6372){_0x46d70f[_0x59c1('0x20')]=_0x2f6372;if(_0x1db861[_0x59c1('0x4c')]['includeAll']){_0xeb1059[_0x59c1('0x5c')]=[{'model':db[_0x59c1('0x8c')],'as':_0x59c1('0x8d'),'required':![]},{'model':db[_0x59c1('0x8e')],'as':_0x59c1('0x8f'),'attributes':['name','fullname',_0x59c1('0x90')],'required':![]},{'model':db[_0x59c1('0x91')],'as':_0x59c1('0x92'),'attributes':['id',_0x59c1('0x29'),_0x59c1('0x93')],'where':_0x1db861[_0x59c1('0x4c')][_0x59c1('0x94')]?{'id':_0x1db861['query'][_0x59c1('0x94')]}:undefined,'required':_0x1db861[_0x59c1('0x4c')][_0x59c1('0x94')]?!![]:![]}];}return db[_0x59c1('0x89')]['findAll'](_0xeb1059);})['then'](function(_0x21b939){_0x46d70f[_0x59c1('0x5e')]=_0x21b939;return _0x46d70f;});}})[_0x59c1('0x10')](respondWithFilteredResult(_0x5b4a7a,_0xeb1059))['catch'](handleError(_0x5b4a7a,null));};exports[_0x59c1('0x95')]=function addApplications(_0x14d2b4,_0x11688f){var _0x251163=_0x14d2b4[_0x59c1('0x60')]['id'];var _0x2aaafa=_0x14d2b4['body'];var _0x164305=0xc8;var _0x3106f7=null;return db[_0x59c1('0x96')]['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x59c1('0x97')][_0x59c1('0x98')]},function(_0xc65d24){return db[_0x59c1('0x47')]['findOne']({'where':{'id':_0x251163},'transaction':_0xc65d24})[_0x59c1('0x10')](function(_0x38b029){if(_0x38b029){return db[_0x59c1('0x99')][_0x59c1('0x24')]({'where':{'MailAccountId':_0x251163},'transaction':_0xc65d24})[_0x59c1('0x10')](function(){var _0x59f21e=_[_0x59c1('0x46')](_0x2aaafa,function(_0x2c60bc){_0x2c60bc[_0x59c1('0x71')]=_0x251163;return _0x2c60bc;});return db[_0x59c1('0x99')][_0x59c1('0x9a')](_0x59f21e,{'transaction':_0xc65d24});});}else{_0x164305=0x194;_0x3106f7=[];}});})[_0x59c1('0x10')](function(){if(_0x164305!==0x194){return db[_0x59c1('0x99')][_0x59c1('0x9b')]({'where':{'MailAccountId':_0x251163},'order':_0x59c1('0x9c')})['then'](function(_0x5eaf12){_0x3106f7=_0x5eaf12;});}})[_0x59c1('0x18')](function(_0x45a97f){_0x164305=0x1f4;logger[_0x59c1('0x14')](_0x45a97f['stack']);if(_0x45a97f[_0x59c1('0x29')]){delete _0x45a97f['name'];}_0x3106f7=_0x45a97f;})[_0x59c1('0x9d')](function(){if(_0x3106f7===null){_0x11688f[_0x59c1('0x19')](_0x164305);}else{if(_0x164305===0x1f4){_0x11688f[_0x59c1('0x1a')](_0x164305)['send'](_0x3106f7);}else{_0x11688f[_0x59c1('0x1a')](_0x164305)['json'](_0x3106f7);}}});};exports['getApplications']=function(_0x5b5c12,_0x11eaad){var _0x298e16={};var _0x23cd42={};var _0x5d4d0c;var _0x52fd59;return db[_0x59c1('0x47')][_0x59c1('0x6d')]({'where':{'id':_0x5b5c12[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x11eaad,null))[_0x59c1('0x10')](function(_0x37f2fb){if(_0x37f2fb){_0x5d4d0c=_0x37f2fb;_0x23cd42['model']=_['keys'](db[_0x59c1('0x99')][_0x59c1('0x48')]);_0x23cd42['query']=_[_0x59c1('0x61')](_0x5b5c12[_0x59c1('0x4c')]);_0x23cd42[_0x59c1('0x4d')]=_[_0x59c1('0x4e')](_0x23cd42[_0x59c1('0x4b')],_0x23cd42[_0x59c1('0x4c')]);_0x298e16[_0x59c1('0x4f')]=_[_0x59c1('0x4e')](_0x23cd42['model'],qs[_0x59c1('0x50')](_0x5b5c12[_0x59c1('0x4c')][_0x59c1('0x50')]));_0x298e16[_0x59c1('0x4f')]=_0x298e16['attributes'][_0x59c1('0x6f')]?_0x298e16[_0x59c1('0x4f')]:_0x23cd42[_0x59c1('0x4b')];_0x298e16['order']=qs[_0x59c1('0x54')](_0x5b5c12[_0x59c1('0x4c')]['sort']);_0x298e16['where']=qs[_0x59c1('0x4d')](_[_0x59c1('0x70')](_0x5b5c12[_0x59c1('0x4c')],_0x23cd42['filters']));if(_0x5b5c12['query'][_0x59c1('0x55')]){_0x298e16[_0x59c1('0x56')]=_['merge'](_0x298e16[_0x59c1('0x56')],{'$or':_[_0x59c1('0x46')](_0x298e16['attributes'],function(_0x29e7c4){var _0x597e9b={};_0x597e9b[_0x29e7c4]={'$like':'%'+_0x5b5c12[_0x59c1('0x4c')][_0x59c1('0x55')]+'%'};return _0x597e9b;})});}_0x298e16=_['merge']({},_0x298e16,_0x5b5c12[_0x59c1('0x5a')]);return _0x5d4d0c[_0x59c1('0x9e')](_0x298e16);}})[_0x59c1('0x10')](function(_0x4c0980){if(_0x4c0980){_0x52fd59=_0x4c0980[_0x59c1('0x6f')];if(!_0x5b5c12[_0x59c1('0x4c')]['hasOwnProperty'](_0x59c1('0x52'))){_0x298e16[_0x59c1('0x1e')]=qs[_0x59c1('0x1e')](_0x5b5c12[_0x59c1('0x4c')][_0x59c1('0x1e')]);_0x298e16['offset']=qs[_0x59c1('0x1d')](_0x5b5c12[_0x59c1('0x4c')][_0x59c1('0x1d')]);}return _0x5d4d0c['getApplications'](_0x298e16);}})[_0x59c1('0x10')](function(_0x106ccd){if(_0x106ccd){return _0x106ccd?{'count':_0x52fd59,'rows':_0x106ccd}:null;}})[_0x59c1('0x10')](respondWithResult(_0x11eaad,null))[_0x59c1('0x18')](handleError(_0x11eaad,null));};exports[_0x59c1('0x9f')]=function(_0x2dd26f,_0x1f2a36){var _0x1e588f={'raw':!![],'where':{}};var _0x263f58={};var _0x38ce6a={'count':0x0,'rows':[]};return db[_0x59c1('0x47')][_0x59c1('0x6d')]({'where':{'id':_0x2dd26f[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x1f2a36,null))[_0x59c1('0x10')](function(_0x447343){if(_0x447343){_0x263f58['model']=_[_0x59c1('0x61')](db[_0x59c1('0xa0')][_0x59c1('0x48')]);_0x263f58[_0x59c1('0x4c')]=_[_0x59c1('0x61')](_0x2dd26f[_0x59c1('0x4c')]);_0x263f58[_0x59c1('0x4d')]=_[_0x59c1('0x4e')](_0x263f58[_0x59c1('0x4b')],_0x263f58[_0x59c1('0x4c')]);_0x1e588f[_0x59c1('0x4f')]=_[_0x59c1('0x4e')](_0x263f58[_0x59c1('0x4b')],qs[_0x59c1('0x50')](_0x2dd26f[_0x59c1('0x4c')][_0x59c1('0x50')]));_0x1e588f[_0x59c1('0x4f')]=_0x1e588f[_0x59c1('0x4f')][_0x59c1('0x6f')]?_0x1e588f[_0x59c1('0x4f')]:_0x263f58[_0x59c1('0x4b')];if(!_0x2dd26f[_0x59c1('0x4c')]['hasOwnProperty'](_0x59c1('0x52'))){_0x1e588f[_0x59c1('0x1e')]=qs['limit'](_0x2dd26f[_0x59c1('0x4c')][_0x59c1('0x1e')]);_0x1e588f[_0x59c1('0x1d')]=qs[_0x59c1('0x1d')](_0x2dd26f['query'][_0x59c1('0x1d')]);}_0x1e588f[_0x59c1('0x53')]=qs[_0x59c1('0x54')](_0x2dd26f[_0x59c1('0x4c')][_0x59c1('0x54')]);_0x1e588f[_0x59c1('0x56')]=qs[_0x59c1('0x4d')](_[_0x59c1('0x70')](_0x2dd26f[_0x59c1('0x4c')],_0x263f58[_0x59c1('0x4d')]));_0x1e588f[_0x59c1('0x56')][_0x59c1('0x71')]=_0x447343['id'];if(_0x2dd26f[_0x59c1('0x4c')]['filter']){_0x1e588f[_0x59c1('0x56')]=_[_0x59c1('0x57')](_0x1e588f[_0x59c1('0x56')],{'$or':_['map'](_0x1e588f[_0x59c1('0x4f')],function(_0xc18ed5){var _0x33c67e={};_0x33c67e[_0xc18ed5]={'$like':'%'+_0x2dd26f[_0x59c1('0x4c')][_0x59c1('0x55')]+'%'};return _0x33c67e;})});}if(_0x2dd26f[_0x59c1('0x4c')][_0x59c1('0xa1')]){var _0x16957e=_0x2dd26f[_0x59c1('0x4c')][_0x59c1('0xa1')]['split'](',');var _0x5bd176={};_0x5bd176[_0x16957e[0x0]]={'$gte':moment(_0x16957e[0x1])[_0x59c1('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1e588f[_0x59c1('0x56')]=_[_0x59c1('0x57')](_0x1e588f[_0x59c1('0x56')],_0x5bd176);}_0x1e588f=_[_0x59c1('0x57')]({},_0x1e588f,_0x2dd26f[_0x59c1('0x5a')]);return db[_0x59c1('0xa0')][_0x59c1('0x20')]({'where':_0x1e588f[_0x59c1('0x56')]})[_0x59c1('0x10')](function(_0x506ad7){_0x38ce6a[_0x59c1('0x20')]=_0x506ad7;if(_0x2dd26f[_0x59c1('0x4c')]['includeAll']){_0x1e588f[_0x59c1('0x5c')]=[{'all':!![]}];}return db[_0x59c1('0xa0')]['findAll'](_0x1e588f);})[_0x59c1('0x10')](function(_0x2f74cd){if(_0x2dd26f[_0x59c1('0x4c')]['inlineCss']===_0x59c1('0xa3')){for(var _0x25daa0=0x0;_0x25daa0<_0x2f74cd[_0x59c1('0x6f')];_0x25daa0++){_0x2f74cd[_0x25daa0]['body']=juice(_0x2f74cd[_0x25daa0][_0x59c1('0x62')]);}}_0x38ce6a[_0x59c1('0x5e')]=_0x2f74cd;return _0x38ce6a;});}})['then'](respondWithFilteredResult(_0x1f2a36,_0x1e588f))[_0x59c1('0x18')](handleError(_0x1f2a36,null));};exports[_0x59c1('0x2a')]=function(_0x15df5e,_0x203de8){var _0x442f62,_0x261d83={},_0x3974b8;if(_0x15df5e[_0x59c1('0x62')]['to']){_0x3974b8=_0x15df5e[_0x59c1('0x62')]['to'][_0x59c1('0xa4')](',')[0x0];}return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x15df5e[_0x59c1('0x60')]['id']},'include':[{'model':db[_0x59c1('0xa5')],'as':'List','include':[{'model':db['CmContact'],'as':_0x59c1('0xa6'),'where':{'email':_0x3974b8},'limit':0x1,'order':[[_0x59c1('0xa7'),_0x59c1('0xa8')]]}]},{'model':db[_0x59c1('0x44')],'as':_0x59c1('0x42'),'raw':!![],'include':[{'model':db[_0x59c1('0xa9')],'as':_0x59c1('0xa9'),'raw':!![]}]}]})[_0x59c1('0x10')](handleEntityNotFound(_0x203de8,null))[_0x59c1('0x10')](function(_0x11df91){if(!_0x11df91)return;_0x442f62=_0x11df91;if(!_0x11df91[_0x59c1('0x42')])throw new Error(_0x59c1('0xaa'));if(_[_0x59c1('0x7a')](_0x15df5e[_0x59c1('0x62')][_0x59c1('0xab')])){_0x15df5e[_0x59c1('0x62')][_0x59c1('0xab')]=util[_0x59c1('0xa2')](_0x59c1('0xac'),_0x11df91[_0x59c1('0x29')],_0x11df91[_0x59c1('0x78')]||_0x11df91[_0x59c1('0x42')][_0x59c1('0x37')]);}if(_0x15df5e['body'][_0x59c1('0xad')]&&_0x15df5e[_0x59c1('0x62')]['attachments'][_0x59c1('0x6f')]){for(var _0x183123=0x0;_0x183123<_0x15df5e[_0x59c1('0x62')][_0x59c1('0xad')][_0x59c1('0x6f')];_0x183123+=0x1){_0x15df5e[_0x59c1('0x62')][_0x59c1('0xad')][_0x183123]={'filename':_0x15df5e[_0x59c1('0x62')][_0x59c1('0xad')][_0x183123][_0x59c1('0x29')],'path':path[_0x59c1('0xae')](config[_0x59c1('0xaf')],_0x59c1('0xb0'),_0x15df5e[_0x59c1('0x62')]['attachments'][_0x183123][_0x59c1('0xb1')])};}}var _0x5ac9e0=_0x11df91[_0x59c1('0xb2')]();return respondWithRpcPromise(_0x59c1('0xb3'),_0x59c1('0xb4'),{'account':_0x5ac9e0,'message':_0x15df5e[_0x59c1('0x62')]});})[_0x59c1('0x10')](function(_0x239eb5){if(!_0x239eb5)return;_0x261d83=_0x239eb5;if(!_0x442f62[_0x59c1('0xb5')])throw new Error(_0x59c1('0xb6'));if(_0x442f62['List'][_0x59c1('0xa6')][_0x59c1('0x6f')])return _0x442f62['List'][_0x59c1('0xa6')][0x0];return db[_0x59c1('0x8c')][_0x59c1('0x6b')](_['defaults'](_0x15df5e['body'],{'firstName':_0x15df5e[_0x59c1('0x62')]['to'],'email':_0x15df5e['body']['to'],'phone':_0x15df5e[_0x59c1('0x62')]['to'],'ListId':_0x442f62[_0x59c1('0x79')]}));})[_0x59c1('0x10')](function(_0x555f2f){if(!_0x555f2f)return;var _0x262436={'UserId':_0x15df5e[_0x59c1('0x37')]['id'],'ContactId':_0x555f2f['id'],'MailAccountId':_0x442f62['id'],'inReplyTo':_0x261d83[_0x59c1('0xb7')],'to':_0x15df5e['body']['from'],'cc':_0x15df5e['body']['cc'],'subject':_0x15df5e[_0x59c1('0x62')][_0x59c1('0xb8')],'attach':_0x15df5e[_0x59c1('0x62')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x59c1('0xa2')](_0x59c1('0xb9')),'lastMsgDirection':_0x59c1('0xba'),'Messages':[_[_0x59c1('0x57')](_0x15df5e[_0x59c1('0x62')],{'messageId':_0x261d83[_0x59c1('0xb7')],'sentAt':moment()[_0x59c1('0xa2')](_0x59c1('0xb9')),'read':!![],'MailAccountId':_0x442f62['id'],'UserId':_0x15df5e['user']['id'],'ContactId':_0x555f2f['id']})]};if(_0x15df5e[_0x59c1('0x62')][_0x59c1('0xbb')]){_0x262436=_[_0x59c1('0x57')](_0x262436,_0x15df5e[_0x59c1('0x62')]['Interaction']);}return db[_0x59c1('0x89')][_0x59c1('0x6b')](_0x262436,{'include':[{'model':db[_0x59c1('0xa0')],'as':_0x59c1('0xbc')}]});})[_0x59c1('0x10')](respondWithResult(_0x203de8,null))[_0x59c1('0x18')](handleError(_0x203de8,null));};exports[_0x59c1('0xbd')]=function(_0x224b9c,_0x174dd5){return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x224b9c['params']['id']},'include':[{'model':db[_0x59c1('0x44')],'as':_0x59c1('0x42'),'raw':!![],'include':[{'model':db[_0x59c1('0xa9')],'as':_0x59c1('0xa9'),'raw':!![]}]}]})[_0x59c1('0x10')](handleEntityNotFound(_0x174dd5,null))[_0x59c1('0x10')](function(_0x278a69){if(!_0x278a69[_0x59c1('0x42')])return;var _0x4878f7=_0x278a69['getSmtpOptions']();return respondWithRpcPromise(_0x59c1('0xbe'),_0x59c1('0xbd'),{'account':_0x4878f7});})[_0x59c1('0x10')](respondWithResult(_0x174dd5,null))[_0x59c1('0x18')](handleError(_0x174dd5,null));};exports[_0x59c1('0x24')]=function(_0x1c48a1,_0x1669ce){return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x1c48a1['params']['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x1669ce,null))['then'](function(_0x1e0e0a){if(_0x1e0e0a&&_0x1e0e0a[_0x59c1('0x3e')]){throw new db[(_0x59c1('0xbf'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1e0e0a;})[_0x59c1('0x10')](removeEntity(_0x1669ce,null))[_0x59c1('0x18')](handleError(_0x1669ce,null));};exports['addAgents']=function(_0x42bcd9,_0x1e3064){return db[_0x59c1('0x47')][_0x59c1('0x66')]({'where':{'id':_0x42bcd9['params']['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x1e3064,null))[_0x59c1('0x10')](function(_0x31f071){if(_0x31f071){return _0x31f071['addAgents'](_0x42bcd9[_0x59c1('0x62')][_0x59c1('0x77')],_[_0x59c1('0x8b')](_0x42bcd9[_0x59c1('0x62')],[_0x59c1('0x77'),'id'])||{})['spread'](function(_0x2a9c6b){for(var _0x3d7216=0x0;_0x3d7216<_0x42bcd9[_0x59c1('0x62')][_0x59c1('0x77')][_0x59c1('0x6f')];_0x3d7216+=0x1){socket[_0x59c1('0xc0')](_0x59c1('0xc1'),{'UserId':Number(_0x42bcd9[_0x59c1('0x62')][_0x59c1('0x77')][_0x3d7216]),'MailAccountId':Number(_0x42bcd9['params']['id'])});}return _0x2a9c6b;});}})['then'](respondWithResult(_0x1e3064,null))[_0x59c1('0x18')](handleError(_0x1e3064,null));};exports['removeAgents']=function(_0x46ec90,_0x5cfd1f){return db['MailAccount'][_0x59c1('0x66')]({'where':{'id':_0x46ec90[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x5cfd1f,null))['then'](function(_0x312fd4){if(_0x312fd4){return _0x312fd4[_0x59c1('0xc2')](_0x46ec90[_0x59c1('0x4c')][_0x59c1('0x77')])[_0x59c1('0x10')](function(){if(_[_0x59c1('0xc3')](_0x46ec90[_0x59c1('0x4c')][_0x59c1('0x77')])){for(var _0x515e98=0x0;_0x515e98<_0x46ec90[_0x59c1('0x4c')][_0x59c1('0x77')]['length'];_0x515e98+=0x1){socket[_0x59c1('0xc0')](_0x59c1('0xc4'),{'UserId':Number(_0x46ec90[_0x59c1('0x4c')][_0x59c1('0x77')][_0x515e98]),'MailAccountId':Number(_0x46ec90[_0x59c1('0x60')]['id'])});}}else{socket[_0x59c1('0xc0')]('userMailAccount:remove',{'UserId':Number(_0x46ec90[_0x59c1('0x4c')]['ids']),'MailAccountId':Number(_0x46ec90[_0x59c1('0x60')]['id'])});}});}})[_0x59c1('0x10')](respondWithStatusCode(_0x5cfd1f,null))[_0x59c1('0x18')](handleError(_0x5cfd1f,null));};exports['getAgents']=function(_0x31f5f9,_0x40b1c8){var _0x549767={};var _0x3a85f5={};var _0x96f0eb;var _0x540c7d;return db[_0x59c1('0x47')]['findOne']({'where':{'id':_0x31f5f9[_0x59c1('0x60')]['id']}})[_0x59c1('0x10')](handleEntityNotFound(_0x40b1c8,null))[_0x59c1('0x10')](function(_0x449d60){if(_0x449d60){_0x96f0eb=_0x449d60;_0x3a85f5[_0x59c1('0x4b')]=_[_0x59c1('0x61')](db['User'][_0x59c1('0x48')]);_0x3a85f5[_0x59c1('0x4c')]=_[_0x59c1('0x61')](_0x31f5f9['query']);_0x3a85f5[_0x59c1('0x4d')]=_[_0x59c1('0x4e')](_0x3a85f5[_0x59c1('0x4b')],_0x3a85f5['query']);_0x549767['attributes']=_['intersection'](_0x3a85f5['model'],qs[_0x59c1('0x50')](_0x31f5f9[_0x59c1('0x4c')]['fields']));_0x549767[_0x59c1('0x4f')]=_0x549767['attributes']['length']?_0x549767[_0x59c1('0x4f')]:_0x3a85f5['model'];_0x549767[_0x59c1('0x53')]=qs[_0x59c1('0x54')](_0x31f5f9[_0x59c1('0x4c')]['sort']);_0x549767[_0x59c1('0x56')]=qs[_0x59c1('0x4d')](_[_0x59c1('0x70')](_0x31f5f9[_0x59c1('0x4c')],_0x3a85f5[_0x59c1('0x4d')]));if(_0x31f5f9['query'][_0x59c1('0x55')]){_0x549767[_0x59c1('0x56')]=_[_0x59c1('0x57')](_0x549767[_0x59c1('0x56')],{'$or':_['map'](_0x549767[_0x59c1('0x4f')],function(_0x23926e){var _0x44ecf4={};_0x44ecf4[_0x23926e]={'$like':'%'+_0x31f5f9[_0x59c1('0x4c')][_0x59c1('0x55')]+'%'};return _0x44ecf4;})});}_0x549767=_[_0x59c1('0x57')]({},_0x549767,_0x31f5f9[_0x59c1('0x5a')]);return _0x96f0eb[_0x59c1('0xc5')](_0x549767);}})[_0x59c1('0x10')](function(_0x36e233){if(_0x36e233){_0x540c7d=_0x36e233[_0x59c1('0x6f')];if(!_0x31f5f9[_0x59c1('0x4c')][_0x59c1('0x51')](_0x59c1('0x52'))){_0x549767['limit']=qs[_0x59c1('0x1e')](_0x31f5f9[_0x59c1('0x4c')]['limit']);_0x549767[_0x59c1('0x1d')]=qs['offset'](_0x31f5f9[_0x59c1('0x4c')][_0x59c1('0x1d')]);}return _0x96f0eb[_0x59c1('0xc5')](_0x549767);}})['then'](function(_0x3b4125){if(_0x3b4125){return _0x3b4125?{'count':_0x540c7d,'rows':_0x3b4125}:null;}})[_0x59c1('0x10')](respondWithResult(_0x40b1c8,null))['catch'](handleError(_0x40b1c8,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9413b38..eaef583 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 _0xfbff=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xfbff,0x156));var _0xffbf=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0xfbff[_0x200aa5];return _0x458200;};'use strict';var EventEmitter=require(_0xffbf('0x0'));var MailAccount=require(_0xffbf('0x1'))['db'][_0xffbf('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xffbf('0x3')](0x0);var events={'afterCreate':_0xffbf('0x4'),'afterUpdate':_0xffbf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5d1d71){return function(_0x3cf000,_0x3cd997,_0x2105ec){MailAccountEvents[_0xffbf('0x6')](_0x5d1d71+':'+_0x3cf000['id'],_0x3cf000);MailAccountEvents[_0xffbf('0x6')](_0x5d1d71,_0x3cf000);_0x2105ec(null);};}for(var e in events){if(events[_0xffbf('0x7')](e)){var event=events[e];MailAccount[_0xffbf('0x8')](e,emitEvent(event));}}module[_0xffbf('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x00b3=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x00b3,0x157));var _0x300b=function(_0x4fcb47,_0x33bc86){_0x4fcb47=_0x4fcb47-0x0;var _0x379527=_0x00b3[_0x4fcb47];return _0x379527;};'use strict';var EventEmitter=require(_0x300b('0x0'));var MailAccount=require(_0x300b('0x1'))['db'][_0x300b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x300b('0x3')](0x0);var events={'afterCreate':_0x300b('0x4'),'afterUpdate':_0x300b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x968375){return function(_0x204f71,_0x494436,_0x2f3a41){MailAccountEvents['emit'](_0x968375+':'+_0x204f71['id'],_0x204f71);MailAccountEvents[_0x300b('0x6')](_0x968375,_0x204f71);_0x2f3a41(null);};}for(var e in events){if(events[_0x300b('0x7')](e)){var event=events[e];MailAccount[_0x300b('0x8')](e,emitEvent(event));}}module[_0x300b('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 24b6c78..605776e 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 _0x1849=['service','host','Smtp','port','secure','authentication','modernAuthentication','auth','user','data5','pass','exports','define','MailAccount','mail_accounts','provider','custom'];(function(_0x16adf1,_0x1273a5){var _0xc13362=function(_0x35e767){while(--_0x35e767){_0x16adf1['push'](_0x16adf1['shift']());}};_0xc13362(++_0x1273a5);}(_0x1849,0x13d));var _0x9184=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1849[_0x5b644e];return _0x49c6bf;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x9184('0x0')]=function(_0x5529da){return _0x5529da[_0x9184('0x1')](_0x9184('0x2'),attributes,{'tableName':_0x9184('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3d2aef=this;var _0x11c2e7={'id':_0x3d2aef['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3d2aef[_0x9184('0x4')]!==_0x9184('0x5')){_0x11c2e7[_0x9184('0x6')]=_0x3d2aef['provider'];}else{_0x11c2e7[_0x9184('0x7')]=_0x3d2aef[_0x9184('0x8')][_0x9184('0x7')];_0x11c2e7['port']=_0x3d2aef[_0x9184('0x8')][_0x9184('0x9')];_0x11c2e7['secure']=_0x3d2aef[_0x9184('0x8')][_0x9184('0xa')];}if(_0x3d2aef['Smtp'][_0x9184('0xb')]){if(_0x3d2aef[_0x9184('0x8')][_0x9184('0xc')]){if(!_0x3d2aef[_0x9184('0x8')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x11c2e7[_0x9184('0xd')]={'type':'OAuth2','user':_0x3d2aef[_0x9184('0x8')][_0x9184('0xe')],'accessToken':_0x3d2aef[_0x9184('0x8')]['CloudProvider'][_0x9184('0xf')]};}else{_0x11c2e7['auth']={'user':_0x3d2aef[_0x9184('0x8')][_0x9184('0xe')],'pass':_0x3d2aef['Smtp'][_0x9184('0x10')]};}}return _0x11c2e7;}}});}; \ No newline at end of file +var _0x3938=['port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','exports','define','MailAccount','custom','service','Smtp','host'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x3938,0x1c9));var _0x8393=function(_0x2c2317,_0x193b09){_0x2c2317=_0x2c2317-0x0;var _0x23209b=_0x3938[_0x2c2317];return _0x23209b;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x8393('0x0')]=function(_0x569626){return _0x569626[_0x8393('0x1')](_0x8393('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x9c4739=this;var _0x5c8680={'id':_0x9c4739['id'],'tls':{'rejectUnauthorized':![]}};if(_0x9c4739['provider']!==_0x8393('0x3')){_0x5c8680[_0x8393('0x4')]=_0x9c4739['provider'];}else{_0x5c8680['host']=_0x9c4739[_0x8393('0x5')][_0x8393('0x6')];_0x5c8680[_0x8393('0x7')]=_0x9c4739[_0x8393('0x5')][_0x8393('0x7')];_0x5c8680[_0x8393('0x8')]=_0x9c4739[_0x8393('0x5')][_0x8393('0x8')];}if(_0x9c4739['Smtp'][_0x8393('0x9')]){if(_0x9c4739['Smtp']['modernAuthentication']){if(!_0x9c4739[_0x8393('0x5')][_0x8393('0xa')])throw new Error(_0x8393('0xb'));_0x5c8680[_0x8393('0xc')]={'type':'OAuth2','user':_0x9c4739['Smtp'][_0x8393('0xd')],'accessToken':_0x9c4739[_0x8393('0x5')][_0x8393('0xa')][_0x8393('0xe')]};}else{_0x5c8680[_0x8393('0xc')]={'user':_0x9c4739['Smtp'][_0x8393('0xd')],'pass':_0x9c4739['Smtp'][_0x8393('0xf')]};}}return _0x5c8680;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 68a4f0c..e6d9d32 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 _0x5f2f=['Attachments','UserId','User','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailAccount','options','where','limit','include','model','attributes','map','MailAccount','find','raw','then','smtp','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','applications','Applications','priority','asc','autoclose','push','close','Contacts','length','create','messageId','subject','format','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originCc','originChannel','Email','ChatOfflineMessageId','Attachment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x392750,_0x547723){_0x392750=_0x392750-0x0;var _0x1e2e84=_0x5f2f[_0x392750];return _0x1e2e84;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5f2('0x8')][_0xf5f2('0x9')]({'port':0x232c});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':_0xf5f2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x56a69f,_0x375da4,_0x15dd7c){return new BPromise(function(_0x218ae3,_0x4e0e6b){return client[_0xf5f2('0xf')](_0x56a69f,_0x15dd7c)['then'](function(_0x53fb33){logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,'request\x20sent');logger[_0xf5f2('0x12')](_0xf5f2('0x13'),_0x375da4,_0xf5f2('0x14'),JSON[_0xf5f2('0x15')](_0x53fb33));if(_0x53fb33[_0xf5f2('0x16')]){if(_0x53fb33[_0xf5f2('0x16')]['code']===0x1f4){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x4e0e6b(_0x53fb33[_0xf5f2('0x16')]['message']);}logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x218ae3(_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);}else{logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,_0xf5f2('0x14'));_0x218ae3(_0x53fb33[_0xf5f2('0x18')][_0xf5f2('0x17')]);}})[_0xf5f2('0x19')](function(_0x4ff59b){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x4ff59b);_0x4e0e6b(_0x4ff59b);});});}exports[_0xf5f2('0x1a')]=function(_0x1bf655){var _0x56acc5=this;return new Promise(function(_0x34706d,_0x47101e){return db['MailAccount']['findAll']({'raw':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1c')]||null:null,'attributes':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['attributes']||null:null,'limit':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1d')]||null:null,'include':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['include']?_['map'](_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')],'include':_0x294414[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x294414[_0xf5f2('0x1e')],function(_0x198c73){return{'model':db[_0x198c73[_0xf5f2('0x1f')]],'as':_0x198c73['as'],'attributes':_0x198c73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22c826){logger[_0xf5f2('0x10')](_0xf5f2('0x1a'),_0x1bf655);logger['debug']('GetMailAccount',_0x1bf655,JSON[_0xf5f2('0x15')](_0x22c826));_0x34706d(_0x22c826);})[_0xf5f2('0x19')](function(_0x17394a){logger[_0xf5f2('0x16')](_0xf5f2('0x1a'),_0x17394a['message'],_0x1bf655);_0x47101e(_0x56acc5['error'](0x1f4,_0x17394a[_0xf5f2('0x17')]));});});};exports['ShowMailAccount']=function(_0xb744b9){var _0x58a4df=this;return new Promise(function(_0x45b643,_0x31087c){return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'raw':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x24')]===undefined?!![]:![]:!![],'where':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9['options'][_0xf5f2('0x1c')]||null:null,'attributes':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null,'include':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')]?_['map'](_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes'],'include':_0x2e3cca[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x2e3cca[_0xf5f2('0x1e')],function(_0x4ec8fb){return{'model':db[_0x4ec8fb[_0xf5f2('0x1f')]],'as':_0x4ec8fb['as'],'attributes':_0x4ec8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x25')](function(_0x566c47){if(_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x26')]===!![])_0x566c47['setDataValue'](_0xf5f2('0x27'),_0x566c47[_0xf5f2('0x28')]());logger[_0xf5f2('0x10')](_0xf5f2('0x29'),_0xb744b9);logger['debug']('ShowMailAccount',_0xb744b9,JSON[_0xf5f2('0x15')](_0x566c47));_0x45b643(_0x566c47);})[_0xf5f2('0x19')](function(_0x22b20c){logger[_0xf5f2('0x16')](_0xf5f2('0x29'),_0x22b20c[_0xf5f2('0x17')],_0xb744b9);_0x31087c(_0x58a4df[_0xf5f2('0x16')](0x1f4,_0x22b20c['message']));});});};exports[_0xf5f2('0x2a')]=function(_0x3b4ea6){var _0x536501=this;return new Promise(function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'body':_0x3b4ea6[_0xf5f2('0x2b')],'channel':_0xf5f2('0x2c')};var _0x3b6372=_[_0xf5f2('0x2d')](_[_0xf5f2('0x2e')](db['CmContact'][_0xf5f2('0x2f')]),[_0xf5f2('0x30'),_0xf5f2('0x31'),'CompanyId','ListId']);var _0x59eb00=![];if(_0x3b4ea6[_0xf5f2('0x2b')]['id']){delete _0x3b4ea6[_0xf5f2('0x2b')]['id'];}if(_['isNil'](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x33')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')])||_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')]===''){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x35')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501['error'](0x1f4,_0xf5f2('0x37')+_0x3b6372));}if(!_['includes'](_0x3b6372,_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x38')+_0x3b6372));}var _0x31bf0e={};_0x31bf0e[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'where':{'id':_0x3b4ea6[_0xf5f2('0x39')]['id']},'include':[{'model':db[_0xf5f2('0x3a')],'as':_0xf5f2('0x3b'),'include':[{'model':db[_0xf5f2('0x3c')],'as':'Contacts','where':_0x31bf0e,'limit':0x1,'order':[[_0xf5f2('0x31'),_0xf5f2('0x3d')]]}]},{'model':db[_0xf5f2('0x3e')],'as':'Applications'},{'model':db[_0xf5f2('0x3f')],'as':_0xf5f2('0x40'),'include':[{'model':db[_0xf5f2('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x7bb942){if(_0x7bb942&&_0x7bb942[_0xf5f2('0x3b')]){var _0x5db519=_0x7bb942[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7['account']=_[_0xf5f2('0x43')](_0x5db519,['Applications',_0xf5f2('0x3b')]);_0x71b0e7['account'][_0xf5f2('0x27')]=_0x7bb942[_0xf5f2('0x28')]();_0x71b0e7[_0xf5f2('0x44')]=_0x5db519[_0xf5f2('0x45')];_0x71b0e7['list']=_0x5db519[_0xf5f2('0x3b')];_0x71b0e7[_0xf5f2('0x44')]=_['orderBy'](_0x71b0e7['applications'],[_0xf5f2('0x46')],[_0xf5f2('0x47')]);if(_0x71b0e7['account']&&_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x48')]){_0x71b0e7[_0xf5f2('0x44')][_0xf5f2('0x49')]({'id':0x0,'priority':_0x71b0e7['applications']['length']+0x1,'app':_0xf5f2('0x4a'),'appdata':_0xf5f2('0x48'),'interval':'*,*,*,*'});}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')]){delete _0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')];}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x3b')]){delete _0x71b0e7[_0xf5f2('0x39')]['List'];}if(_0x5db519['List'][_0xf5f2('0x4b')][_0xf5f2('0x4c')]){return _0x5db519[_0xf5f2('0x3b')][_0xf5f2('0x4b')][0x0];}var _0x21b0d3=_['defaults'](_0x3b4ea6[_0xf5f2('0x2b')],{'firstName':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')],'ListId':_0x5db519['ListId']});_0x21b0d3[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x3c')][_0xf5f2('0x4d')](_0x21b0d3);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x756f1f){_0x71b0e7['contact']=_0x756f1f;if(_0x756f1f){if(!_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['messageId']){_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4e')]=rs['generate']()+'\x20'+_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')];}var _0x4579f4={'ContactId':_0x756f1f['id'],'MailAccountId':_0x3b4ea6['account']['id'],'inReplyTo':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'cc':_0x3b4ea6[_0xf5f2('0x2b')]['message']['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['attach'],'lastMsgAt':moment()[_0xf5f2('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xf5f2('0x23')]({'where':{'closed':![],'MailAccountId':_0x3b4ea6['account']['id']},'include':[{'model':db[_0xf5f2('0x51')],'as':_0xf5f2('0x52'),'attributes':[_0xf5f2('0x4e')],'where':{'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x53')]}}]})[_0xf5f2('0x25')](function(_0x1ec682){if(_0x1ec682){return[_0x1ec682,![]];}return db[_0xf5f2('0x54')][_0xf5f2('0x4d')](_0x4579f4)[_0xf5f2('0x25')](function(_0x158768){return[_0x158768,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf5f2('0x55')](function(_0x2d171d,_0xb39a6e){if(_0x2d171d){_0x59eb00=_0xb39a6e;if(!_0xb39a6e){return _0x2d171d[_0xf5f2('0x56')]({'inReplyTo':_0x3b4ea6['body'][_0xf5f2('0x17')]['messageId'],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['from'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x2d171d['attach']?_0x2d171d[_0xf5f2('0x57')]:_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x57')],'substatus':null,'substatusAt':moment()[_0xf5f2('0x50')](_0xf5f2('0x58')),'lastMsgAt':moment()['format'](_0xf5f2('0x58')),'lastMsgDirection':'in'});}else{return _0x2d171d;}}})[_0xf5f2('0x25')](function(_0x4800fe){_0x71b0e7[_0xf5f2('0x59')]=_0x4800fe[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7[_0xf5f2('0x59')]['created']=_0x59eb00;return db['MailMessage']['create']({'body':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')],'MailAccountId':_0x3b4ea6[_0xf5f2('0x39')]['id'],'MailInteractionId':_0x4800fe['id'],'direction':'in','ContactId':_0x71b0e7[_0xf5f2('0x5a')]['id'],'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'from':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['to'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6['body']['message']['attach'],'Attachments':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5b')],'originTo':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['originTo'],'originCc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5c')],'bcc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['bcc'],'ChatWebsiteId':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['ChatWebsiteId']||null,'originChannel':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5d')]||_0xf5f2('0x5e'),'ChatOfflineMessageId':_0x3b4ea6['body'][_0xf5f2('0x17')][_0xf5f2('0x5f')]||null},{'include':[{'model':db[_0xf5f2('0x60')],'as':_0xf5f2('0x61')}]});})[_0xf5f2('0x25')](function(_0x4f47e1){_0x71b0e7['message']=_0x4f47e1;if(_0x71b0e7[_0xf5f2('0x59')][_0xf5f2('0x62')]){return db[_0xf5f2('0x63')][_0xf5f2('0x23')]({'attributes':['id','name'],'where':{'id':_0x71b0e7['interaction'][_0xf5f2('0x62')]}})['then'](function(_0x4c4420){if(_0x4c4420){_0x71b0e7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf5f2('0x64'),'appdata':_0x4c4420[_0xf5f2('0x65')]+','+(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x66')]||0xa),'interval':_0xf5f2('0x67')});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);})[_0xf5f2('0x25')](function(_0x9afb3c){_0xc6a1ae(_0x9afb3c);})[_0xf5f2('0x19')](function(_0x1ba503){_0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0x1ba503[_0xf5f2('0x17')]));});});}; \ No newline at end of file +var _0x5f2f=['Attachments','UserId','User','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailAccount','options','where','limit','include','model','attributes','map','MailAccount','find','raw','then','smtp','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','applications','Applications','priority','asc','autoclose','push','close','Contacts','length','create','messageId','subject','format','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originCc','originChannel','Email','ChatOfflineMessageId','Attachment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5f2f,0x73));var _0xf5f2=function(_0x557178,_0x249c2e){_0x557178=_0x557178-0x0;var _0x5aefb4=_0x5f2f[_0x557178];return _0x5aefb4;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5f2('0x8')][_0xf5f2('0x9')]({'port':0x232c});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':_0xf5f2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x56a69f,_0x375da4,_0x15dd7c){return new BPromise(function(_0x218ae3,_0x4e0e6b){return client[_0xf5f2('0xf')](_0x56a69f,_0x15dd7c)['then'](function(_0x53fb33){logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,'request\x20sent');logger[_0xf5f2('0x12')](_0xf5f2('0x13'),_0x375da4,_0xf5f2('0x14'),JSON[_0xf5f2('0x15')](_0x53fb33));if(_0x53fb33[_0xf5f2('0x16')]){if(_0x53fb33[_0xf5f2('0x16')]['code']===0x1f4){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x4e0e6b(_0x53fb33[_0xf5f2('0x16')]['message']);}logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x218ae3(_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);}else{logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,_0xf5f2('0x14'));_0x218ae3(_0x53fb33[_0xf5f2('0x18')][_0xf5f2('0x17')]);}})[_0xf5f2('0x19')](function(_0x4ff59b){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x4ff59b);_0x4e0e6b(_0x4ff59b);});});}exports[_0xf5f2('0x1a')]=function(_0x1bf655){var _0x56acc5=this;return new Promise(function(_0x34706d,_0x47101e){return db['MailAccount']['findAll']({'raw':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1c')]||null:null,'attributes':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['attributes']||null:null,'limit':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1d')]||null:null,'include':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['include']?_['map'](_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')],'include':_0x294414[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x294414[_0xf5f2('0x1e')],function(_0x198c73){return{'model':db[_0x198c73[_0xf5f2('0x1f')]],'as':_0x198c73['as'],'attributes':_0x198c73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22c826){logger[_0xf5f2('0x10')](_0xf5f2('0x1a'),_0x1bf655);logger['debug']('GetMailAccount',_0x1bf655,JSON[_0xf5f2('0x15')](_0x22c826));_0x34706d(_0x22c826);})[_0xf5f2('0x19')](function(_0x17394a){logger[_0xf5f2('0x16')](_0xf5f2('0x1a'),_0x17394a['message'],_0x1bf655);_0x47101e(_0x56acc5['error'](0x1f4,_0x17394a[_0xf5f2('0x17')]));});});};exports['ShowMailAccount']=function(_0xb744b9){var _0x58a4df=this;return new Promise(function(_0x45b643,_0x31087c){return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'raw':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x24')]===undefined?!![]:![]:!![],'where':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9['options'][_0xf5f2('0x1c')]||null:null,'attributes':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null,'include':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')]?_['map'](_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes'],'include':_0x2e3cca[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x2e3cca[_0xf5f2('0x1e')],function(_0x4ec8fb){return{'model':db[_0x4ec8fb[_0xf5f2('0x1f')]],'as':_0x4ec8fb['as'],'attributes':_0x4ec8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x25')](function(_0x566c47){if(_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x26')]===!![])_0x566c47['setDataValue'](_0xf5f2('0x27'),_0x566c47[_0xf5f2('0x28')]());logger[_0xf5f2('0x10')](_0xf5f2('0x29'),_0xb744b9);logger['debug']('ShowMailAccount',_0xb744b9,JSON[_0xf5f2('0x15')](_0x566c47));_0x45b643(_0x566c47);})[_0xf5f2('0x19')](function(_0x22b20c){logger[_0xf5f2('0x16')](_0xf5f2('0x29'),_0x22b20c[_0xf5f2('0x17')],_0xb744b9);_0x31087c(_0x58a4df[_0xf5f2('0x16')](0x1f4,_0x22b20c['message']));});});};exports[_0xf5f2('0x2a')]=function(_0x3b4ea6){var _0x536501=this;return new Promise(function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'body':_0x3b4ea6[_0xf5f2('0x2b')],'channel':_0xf5f2('0x2c')};var _0x3b6372=_[_0xf5f2('0x2d')](_[_0xf5f2('0x2e')](db['CmContact'][_0xf5f2('0x2f')]),[_0xf5f2('0x30'),_0xf5f2('0x31'),'CompanyId','ListId']);var _0x59eb00=![];if(_0x3b4ea6[_0xf5f2('0x2b')]['id']){delete _0x3b4ea6[_0xf5f2('0x2b')]['id'];}if(_['isNil'](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x33')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')])||_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')]===''){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x35')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501['error'](0x1f4,_0xf5f2('0x37')+_0x3b6372));}if(!_['includes'](_0x3b6372,_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x38')+_0x3b6372));}var _0x31bf0e={};_0x31bf0e[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'where':{'id':_0x3b4ea6[_0xf5f2('0x39')]['id']},'include':[{'model':db[_0xf5f2('0x3a')],'as':_0xf5f2('0x3b'),'include':[{'model':db[_0xf5f2('0x3c')],'as':'Contacts','where':_0x31bf0e,'limit':0x1,'order':[[_0xf5f2('0x31'),_0xf5f2('0x3d')]]}]},{'model':db[_0xf5f2('0x3e')],'as':'Applications'},{'model':db[_0xf5f2('0x3f')],'as':_0xf5f2('0x40'),'include':[{'model':db[_0xf5f2('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x7bb942){if(_0x7bb942&&_0x7bb942[_0xf5f2('0x3b')]){var _0x5db519=_0x7bb942[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7['account']=_[_0xf5f2('0x43')](_0x5db519,['Applications',_0xf5f2('0x3b')]);_0x71b0e7['account'][_0xf5f2('0x27')]=_0x7bb942[_0xf5f2('0x28')]();_0x71b0e7[_0xf5f2('0x44')]=_0x5db519[_0xf5f2('0x45')];_0x71b0e7['list']=_0x5db519[_0xf5f2('0x3b')];_0x71b0e7[_0xf5f2('0x44')]=_['orderBy'](_0x71b0e7['applications'],[_0xf5f2('0x46')],[_0xf5f2('0x47')]);if(_0x71b0e7['account']&&_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x48')]){_0x71b0e7[_0xf5f2('0x44')][_0xf5f2('0x49')]({'id':0x0,'priority':_0x71b0e7['applications']['length']+0x1,'app':_0xf5f2('0x4a'),'appdata':_0xf5f2('0x48'),'interval':'*,*,*,*'});}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')]){delete _0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')];}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x3b')]){delete _0x71b0e7[_0xf5f2('0x39')]['List'];}if(_0x5db519['List'][_0xf5f2('0x4b')][_0xf5f2('0x4c')]){return _0x5db519[_0xf5f2('0x3b')][_0xf5f2('0x4b')][0x0];}var _0x21b0d3=_['defaults'](_0x3b4ea6[_0xf5f2('0x2b')],{'firstName':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')],'ListId':_0x5db519['ListId']});_0x21b0d3[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x3c')][_0xf5f2('0x4d')](_0x21b0d3);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x756f1f){_0x71b0e7['contact']=_0x756f1f;if(_0x756f1f){if(!_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['messageId']){_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4e')]=rs['generate']()+'\x20'+_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')];}var _0x4579f4={'ContactId':_0x756f1f['id'],'MailAccountId':_0x3b4ea6['account']['id'],'inReplyTo':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'cc':_0x3b4ea6[_0xf5f2('0x2b')]['message']['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['attach'],'lastMsgAt':moment()[_0xf5f2('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xf5f2('0x23')]({'where':{'closed':![],'MailAccountId':_0x3b4ea6['account']['id']},'include':[{'model':db[_0xf5f2('0x51')],'as':_0xf5f2('0x52'),'attributes':[_0xf5f2('0x4e')],'where':{'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x53')]}}]})[_0xf5f2('0x25')](function(_0x1ec682){if(_0x1ec682){return[_0x1ec682,![]];}return db[_0xf5f2('0x54')][_0xf5f2('0x4d')](_0x4579f4)[_0xf5f2('0x25')](function(_0x158768){return[_0x158768,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf5f2('0x55')](function(_0x2d171d,_0xb39a6e){if(_0x2d171d){_0x59eb00=_0xb39a6e;if(!_0xb39a6e){return _0x2d171d[_0xf5f2('0x56')]({'inReplyTo':_0x3b4ea6['body'][_0xf5f2('0x17')]['messageId'],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['from'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x2d171d['attach']?_0x2d171d[_0xf5f2('0x57')]:_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x57')],'substatus':null,'substatusAt':moment()[_0xf5f2('0x50')](_0xf5f2('0x58')),'lastMsgAt':moment()['format'](_0xf5f2('0x58')),'lastMsgDirection':'in'});}else{return _0x2d171d;}}})[_0xf5f2('0x25')](function(_0x4800fe){_0x71b0e7[_0xf5f2('0x59')]=_0x4800fe[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7[_0xf5f2('0x59')]['created']=_0x59eb00;return db['MailMessage']['create']({'body':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')],'MailAccountId':_0x3b4ea6[_0xf5f2('0x39')]['id'],'MailInteractionId':_0x4800fe['id'],'direction':'in','ContactId':_0x71b0e7[_0xf5f2('0x5a')]['id'],'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'from':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['to'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6['body']['message']['attach'],'Attachments':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5b')],'originTo':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['originTo'],'originCc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5c')],'bcc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['bcc'],'ChatWebsiteId':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['ChatWebsiteId']||null,'originChannel':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5d')]||_0xf5f2('0x5e'),'ChatOfflineMessageId':_0x3b4ea6['body'][_0xf5f2('0x17')][_0xf5f2('0x5f')]||null},{'include':[{'model':db[_0xf5f2('0x60')],'as':_0xf5f2('0x61')}]});})[_0xf5f2('0x25')](function(_0x4f47e1){_0x71b0e7['message']=_0x4f47e1;if(_0x71b0e7[_0xf5f2('0x59')][_0xf5f2('0x62')]){return db[_0xf5f2('0x63')][_0xf5f2('0x23')]({'attributes':['id','name'],'where':{'id':_0x71b0e7['interaction'][_0xf5f2('0x62')]}})['then'](function(_0x4c4420){if(_0x4c4420){_0x71b0e7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf5f2('0x64'),'appdata':_0x4c4420[_0xf5f2('0x65')]+','+(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x66')]||0xa),'interval':_0xf5f2('0x67')});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);})[_0xf5f2('0x25')](function(_0x9afb3c){_0xc6a1ae(_0x9afb3c);})[_0xf5f2('0x19')](function(_0x1ba503){_0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0x1ba503[_0xf5f2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index a9d6688..a98136e 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 _0x6b75=['update','emit','removeListener','register','length','mailAccount:','save'];(function(_0xd88f90,_0x4b319d){var _0x481626=function(_0x8553ed){while(--_0x8553ed){_0xd88f90['push'](_0xd88f90['shift']());}};_0x481626(++_0x4b319d);}(_0x6b75,0xe6));var _0x56b7=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x6b75[_0x1c8c28];return _0x1f59b4;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x56b7('0x0'),'remove',_0x56b7('0x1')];function createListener(_0x3af0f8,_0x9ebe24){return function(_0x5b8d7c){_0x9ebe24[_0x56b7('0x2')](_0x3af0f8,_0x5b8d7c);};}function removeListener(_0x4ff995,_0x6d965b){return function(){MailAccountEvents[_0x56b7('0x3')](_0x4ff995,_0x6d965b);};}exports[_0x56b7('0x4')]=function(_0x496da3){for(var _0x16d1e8=0x0,_0x1babad=events[_0x56b7('0x5')];_0x16d1e8<_0x1babad;_0x16d1e8++){var _0x46d8a8=events[_0x16d1e8];var _0x74a37b=createListener(_0x56b7('0x6')+_0x46d8a8,_0x496da3);MailAccountEvents['on'](_0x46d8a8,_0x74a37b);}}; \ No newline at end of file +var _0x0805=['length','mailAccount:','./mailAccount.events','save','remove','update','register'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x0805,0x1c9));var _0x5080=function(_0x4fe36e,_0x52b659){_0x4fe36e=_0x4fe36e-0x0;var _0x3160d7=_0x0805[_0x4fe36e];return _0x3160d7;};'use strict';var MailAccountEvents=require(_0x5080('0x0'));var events=[_0x5080('0x1'),_0x5080('0x2'),_0x5080('0x3')];function createListener(_0x3bb211,_0x1cab64){return function(_0x385a6e){_0x1cab64['emit'](_0x3bb211,_0x385a6e);};}function removeListener(_0x226c2b,_0x1c2e95){return function(){MailAccountEvents['removeListener'](_0x226c2b,_0x1c2e95);};}exports[_0x5080('0x4')]=function(_0x4a6c8b){for(var _0x1aaff8=0x0,_0x51526e=events[_0x5080('0x5')];_0x1aaff8<_0x51526e;_0x1aaff8++){var _0x2b5ded=events[_0x1aaff8];var _0x50d5ec=createListener(_0x5080('0x6')+_0x2b5ded,_0x4a6c8b);MailAccountEvents['on'](_0x2b5ded,_0x50d5ec);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index ac4051c..3be4cb3 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 _0x3f06=['../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x3f06,0x108));var _0x63f0=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x3f06[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x63f0('0x0'));var util=require(_0x63f0('0x1'));var path=require(_0x63f0('0x2'));var timeout=require(_0x63f0('0x3'));var express=require(_0x63f0('0x4'));var router=express[_0x63f0('0x5')]();var fs_extra=require(_0x63f0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x63f0('0x7'));var config=require(_0x63f0('0x8'));var controller=require(_0x63f0('0x9'));router['get'](_0x63f0('0xa'),auth[_0x63f0('0xb')](),controller[_0x63f0('0xc')]);router[_0x63f0('0xd')](_0x63f0('0xa'),auth[_0x63f0('0xb')](),controller[_0x63f0('0xe')]);router['delete'](_0x63f0('0xa'),auth[_0x63f0('0xb')](),controller[_0x63f0('0xf')]);module[_0x63f0('0x10')]=router; \ No newline at end of file +var _0x1f5f=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0x278e8d,_0x1dc1ec){var _0x2c2ad7=function(_0x11ecec){while(--_0x11ecec){_0x278e8d['push'](_0x278e8d['shift']());}};_0x2c2ad7(++_0x1dc1ec);}(_0x1f5f,0x128));var _0xf1f5=function(_0x2af2b2,_0x552de4){_0x2af2b2=_0x2af2b2-0x0;var _0x54d6fd=_0x1f5f[_0x2af2b2];return _0x54d6fd;};'use strict';var multer=require('multer');var util=require(_0xf1f5('0x0'));var path=require(_0xf1f5('0x1'));var timeout=require(_0xf1f5('0x2'));var express=require(_0xf1f5('0x3'));var router=express[_0xf1f5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf1f5('0x5'));var interaction=require(_0xf1f5('0x6'));var config=require(_0xf1f5('0x7'));var controller=require(_0xf1f5('0x8'));router[_0xf1f5('0x9')](_0xf1f5('0xa'),auth[_0xf1f5('0xb')](),controller[_0xf1f5('0xc')]);router[_0xf1f5('0xd')](_0xf1f5('0xa'),auth[_0xf1f5('0xb')](),controller[_0xf1f5('0xe')]);router[_0xf1f5('0xf')](_0xf1f5('0xa'),auth[_0xf1f5('0xb')](),controller[_0xf1f5('0x10')]);module[_0xf1f5('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 2e01b8c..ad40f9f 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 _0x6d68=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x1e170d,_0x4ba3c3){var _0x2d7f52=function(_0x138fb3){while(--_0x138fb3){_0x1e170d['push'](_0x1e170d['shift']());}};_0x2d7f52(++_0x4ba3c3);}(_0x6d68,0x104));var _0x86d6=function(_0x19b8dd,_0x407c82){_0x19b8dd=_0x19b8dd-0x0;var _0x37cee3=_0x6d68[_0x19b8dd];return _0x37cee3;};'use strict';var Sequelize=require(_0x86d6('0x0'));module[_0x86d6('0x1')]={'priority':{'type':Sequelize[_0x86d6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x86d6('0x3')],'allowNull':![],'defaultValue':_0x86d6('0x4')},'appdata':{'type':Sequelize[_0x86d6('0x5')]()},'description':{'type':Sequelize[_0x86d6('0x3')]},'interval':{'type':Sequelize[_0x86d6('0x3')],'defaultValue':_0x86d6('0x6')}}; \ No newline at end of file +var _0xdde5=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdde5,0x87));var _0x5dde=function(_0x4e0863,_0x1ec822){_0x4e0863=_0x4e0863-0x0;var _0x3133d7=_0xdde5[_0x4e0863];return _0x3133d7;};'use strict';var Sequelize=require(_0x5dde('0x0'));module[_0x5dde('0x1')]={'priority':{'type':Sequelize[_0x5dde('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5dde('0x3')},'appdata':{'type':Sequelize[_0x5dde('0x4')]()},'description':{'type':Sequelize[_0x5dde('0x5')]},'interval':{'type':Sequelize[_0x5dde('0x5')],'defaultValue':_0x5dde('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 4be6e00..4913721 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 _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x187045,_0x27442a){_0x187045=_0x187045-0x0;var _0x228241=_0xbdb7[_0x187045];return _0x228241;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file +var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x416fab,_0x147ad9){var _0x13f8a0=function(_0x3282d7){while(--_0x3282d7){_0x416fab['push'](_0x416fab['shift']());}};_0x13f8a0(++_0x147ad9);}(_0xb43b,0x1b2));var _0xbb43=function(_0xaeff09,_0x4396a4){_0xaeff09=_0xaeff09-0x0;var _0x27a1bd=_0xb43b[_0xaeff09];return _0x27a1bd;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index e0397fa..b32f54e 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 _0x166a=['./mailApplication.attributes','exports','MailApplication','lodash','api','moment','path','rimraf','../../config/environment'];(function(_0x404611,_0xa8fe59){var _0x1531ad=function(_0x1c642c){while(--_0x1c642c){_0x404611['push'](_0x404611['shift']());}};_0x1531ad(++_0xa8fe59);}(_0x166a,0x78));var _0xa166=function(_0x3ba22a,_0x21b867){_0x3ba22a=_0x3ba22a-0x0;var _0x5969fc=_0x166a[_0x3ba22a];return _0x5969fc;};'use strict';var _=require(_0xa166('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa166('0x1'));var moment=require(_0xa166('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa166('0x3'));var rimraf=require(_0xa166('0x4'));var config=require(_0xa166('0x5'));var attributes=require(_0xa166('0x6'));module[_0xa166('0x7')]=function(_0x9428b4,_0x16af71){return _0x9428b4['define'](_0xa166('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xeea8=['rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xeea8,0x17a));var _0x8eea=function(_0xdd76e8,_0x2691f0){_0xdd76e8=_0xdd76e8-0x0;var _0x36747e=_0xeea8[_0xdd76e8];return _0x36747e;};'use strict';var _=require(_0x8eea('0x0'));var util=require(_0x8eea('0x1'));var logger=require(_0x8eea('0x2'))('api');var moment=require(_0x8eea('0x3'));var BPromise=require('bluebird');var rp=require(_0x8eea('0x4'));var fs=require('fs');var path=require(_0x8eea('0x5'));var rimraf=require(_0x8eea('0x6'));var config=require(_0x8eea('0x7'));var attributes=require(_0x8eea('0x8'));module[_0x8eea('0x9')]=function(_0x2dcff2,_0x3b2d68){return _0x2dcff2['define']('MailApplication',attributes,{'tableName':_0x8eea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8eea('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index e15e2ba..dfca49b 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 _0xe3b9=['body','options','where','attributes','limit','UpdateMailApplication','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','update'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xe3b9,0x1b9));var _0x9e3b=function(_0x4fb201,_0x423e8d){_0x4fb201=_0x4fb201-0x0;var _0x2afef1=_0xe3b9[_0x4fb201];return _0x2afef1;};'use strict';var _=require(_0x9e3b('0x0'));var util=require(_0x9e3b('0x1'));var moment=require('moment');var BPromise=require(_0x9e3b('0x2'));var rs=require(_0x9e3b('0x3'));var fs=require('fs');var Redis=require(_0x9e3b('0x4'));var db=require(_0x9e3b('0x5'))['db'];var utils=require(_0x9e3b('0x6'));var logger=require('../../config/logger')(_0x9e3b('0x7'));var config=require(_0x9e3b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e3b('0x9')][_0x9e3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fd6e4,_0x450cbd,_0x1716ac){return new BPromise(function(_0xd8381e,_0x2b34d6){return client[_0x9e3b('0xb')](_0x4fd6e4,_0x1716ac)[_0x9e3b('0xc')](function(_0x52dcad){logger[_0x9e3b('0xd')]('MailApplication,\x20%s,\x20%s',_0x450cbd,_0x9e3b('0xe'));logger[_0x9e3b('0xf')](_0x9e3b('0x10'),_0x450cbd,_0x9e3b('0xe'),JSON['stringify'](_0x52dcad));if(_0x52dcad[_0x9e3b('0x11')]){if(_0x52dcad[_0x9e3b('0x11')][_0x9e3b('0x12')]===0x1f4){logger['error'](_0x9e3b('0x13'),_0x450cbd,_0x52dcad[_0x9e3b('0x11')]['message']);return _0x2b34d6(_0x52dcad[_0x9e3b('0x11')][_0x9e3b('0x14')]);}logger['error'](_0x9e3b('0x13'),_0x450cbd,_0x52dcad[_0x9e3b('0x11')]['message']);return _0xd8381e(_0x52dcad[_0x9e3b('0x11')][_0x9e3b('0x14')]);}else{logger['info'](_0x9e3b('0x13'),_0x450cbd,_0x9e3b('0xe'));_0xd8381e(_0x52dcad[_0x9e3b('0x15')][_0x9e3b('0x14')]);}})[_0x9e3b('0x16')](function(_0x15a1bc){logger[_0x9e3b('0x11')](_0x9e3b('0x13'),_0x450cbd,_0x15a1bc);_0x2b34d6(_0x15a1bc);});});}exports['UpdateMailApplication']=function(_0x4f1fa3){var _0x531144=this;return new Promise(function(_0xb440f,_0x1aea79){return db['MailApplication'][_0x9e3b('0x17')](_0x4f1fa3[_0x9e3b('0x18')],{'raw':_0x4f1fa3[_0x9e3b('0x19')]?_0x4f1fa3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f1fa3[_0x9e3b('0x19')]?_0x4f1fa3[_0x9e3b('0x19')][_0x9e3b('0x1a')]||null:null,'attributes':_0x4f1fa3[_0x9e3b('0x19')]?_0x4f1fa3[_0x9e3b('0x19')][_0x9e3b('0x1b')]||null:null,'limit':_0x4f1fa3[_0x9e3b('0x19')]?_0x4f1fa3[_0x9e3b('0x19')][_0x9e3b('0x1c')]||null:null})[_0x9e3b('0xc')](function(_0x3cfba8){logger[_0x9e3b('0xd')](_0x9e3b('0x1d'),_0x4f1fa3);logger[_0x9e3b('0xf')](_0x9e3b('0x1d'),_0x4f1fa3,JSON[_0x9e3b('0x1e')](_0x3cfba8));_0xb440f(_0x3cfba8);})[_0x9e3b('0x16')](function(_0x351bda){logger[_0x9e3b('0x11')](_0x9e3b('0x1d'),_0x351bda[_0x9e3b('0x14')],_0x4f1fa3);_0x1aea79(_0x531144[_0x9e3b('0x11')](0x1f4,_0x351bda[_0x9e3b('0x14')]));});});}; \ No newline at end of file +var _0x484c=['code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2cc3a9,_0x52b696){var _0x3ab208=function(_0x14a9aa){while(--_0x14a9aa){_0x2cc3a9['push'](_0x2cc3a9['shift']());}};_0x3ab208(++_0x52b696);}(_0x484c,0x198));var _0xc484=function(_0x5a735f,_0x2e5b5e){_0x5a735f=_0x5a735f-0x0;var _0x1635c0=_0x484c[_0x5a735f];return _0x1635c0;};'use strict';var _=require(_0xc484('0x0'));var util=require(_0xc484('0x1'));var moment=require(_0xc484('0x2'));var BPromise=require(_0xc484('0x3'));var rs=require(_0xc484('0x4'));var fs=require('fs');var Redis=require(_0xc484('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc484('0x6'))(_0xc484('0x7'));var config=require(_0xc484('0x8'));var jayson=require(_0xc484('0x9'));var client=jayson[_0xc484('0xa')][_0xc484('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43c525,_0x526cef,_0x594a2d){return new BPromise(function(_0x57ec67,_0x3b366c){return client[_0xc484('0xc')](_0x43c525,_0x594a2d)[_0xc484('0xd')](function(_0x542d73){logger[_0xc484('0xe')](_0xc484('0xf'),_0x526cef,'request\x20sent');logger[_0xc484('0x10')](_0xc484('0x11'),_0x526cef,_0xc484('0x12'),JSON[_0xc484('0x13')](_0x542d73));if(_0x542d73[_0xc484('0x14')]){if(_0x542d73['error'][_0xc484('0x15')]===0x1f4){logger[_0xc484('0x14')](_0xc484('0xf'),_0x526cef,_0x542d73[_0xc484('0x14')][_0xc484('0x16')]);return _0x3b366c(_0x542d73[_0xc484('0x14')][_0xc484('0x16')]);}logger[_0xc484('0x14')](_0xc484('0xf'),_0x526cef,_0x542d73['error'][_0xc484('0x16')]);return _0x57ec67(_0x542d73[_0xc484('0x14')][_0xc484('0x16')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x526cef,_0xc484('0x12'));_0x57ec67(_0x542d73[_0xc484('0x17')][_0xc484('0x16')]);}})[_0xc484('0x18')](function(_0x4891d1){logger['error'](_0xc484('0xf'),_0x526cef,_0x4891d1);_0x3b366c(_0x4891d1);});});}exports[_0xc484('0x19')]=function(_0xdab6e5){var _0x3991a9=this;return new Promise(function(_0x471ec4,_0x187808){return db[_0xc484('0x1a')][_0xc484('0x1b')](_0xdab6e5[_0xc484('0x1c')],{'raw':_0xdab6e5[_0xc484('0x1d')]?_0xdab6e5[_0xc484('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdab6e5['options']?_0xdab6e5[_0xc484('0x1d')][_0xc484('0x1e')]||null:null,'attributes':_0xdab6e5[_0xc484('0x1d')]?_0xdab6e5['options'][_0xc484('0x1f')]||null:null,'limit':_0xdab6e5[_0xc484('0x1d')]?_0xdab6e5[_0xc484('0x1d')][_0xc484('0x20')]||null:null})['then'](function(_0x2d7931){logger[_0xc484('0xe')](_0xc484('0x19'),_0xdab6e5);logger[_0xc484('0x10')](_0xc484('0x19'),_0xdab6e5,JSON['stringify'](_0x2d7931));_0x471ec4(_0x2d7931);})[_0xc484('0x18')](function(_0x36de31){logger['error'](_0xc484('0x19'),_0x36de31[_0xc484('0x16')],_0xdab6e5);_0x187808(_0x3991a9[_0xc484('0x14')](0x1f4,_0x36de31[_0xc484('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 788ea5b..384e40e 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 _0xbb22=['show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','delete','mailinteraction:destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xd8c91e,_0x3739ff){var _0x1d48b1=function(_0x1e4993){while(--_0x1e4993){_0xd8c91e['push'](_0xd8c91e['shift']());}};_0x1d48b1(++_0x3739ff);}(_0xbb22,0x152));var _0x2bb2=function(_0x409493,_0xda6fed){_0x409493=_0x409493-0x0;var _0xc6c58=_0xbb22[_0x409493];return _0xc6c58;};'use strict';var express=require('express');var router=express[_0x2bb2('0x0')]();var auth=require(_0x2bb2('0x1'));var interaction=require(_0x2bb2('0x2'));var controller=require(_0x2bb2('0x3'));router[_0x2bb2('0x4')]('/',auth[_0x2bb2('0x5')](),controller[_0x2bb2('0x6')]);router['get'](_0x2bb2('0x7'),auth['isAuthenticated'](),controller[_0x2bb2('0x8')]);router[_0x2bb2('0x4')](_0x2bb2('0x9'),auth[_0x2bb2('0x5')](),controller[_0x2bb2('0xa')]);router[_0x2bb2('0x4')](_0x2bb2('0xb'),auth[_0x2bb2('0x5')](),controller[_0x2bb2('0xc')]);router['get'](_0x2bb2('0xd'),auth[_0x2bb2('0x5')](),controller[_0x2bb2('0xe')]);router['post']('/',auth[_0x2bb2('0x5')](),controller[_0x2bb2('0xf')]);router[_0x2bb2('0x10')](_0x2bb2('0xb'),auth[_0x2bb2('0x5')](),controller[_0x2bb2('0x11')]);router[_0x2bb2('0x10')](_0x2bb2('0x12'),auth[_0x2bb2('0x5')](),interaction[_0x2bb2('0x13')]('mail',_0x2bb2('0x14')),controller[_0x2bb2('0x15')]);router[_0x2bb2('0x16')](_0x2bb2('0x9'),auth[_0x2bb2('0x5')](),interaction[_0x2bb2('0x13')](_0x2bb2('0x17'),_0x2bb2('0x18')),controller['update']);router[_0x2bb2('0x19')](_0x2bb2('0x9'),auth[_0x2bb2('0x5')](),interaction[_0x2bb2('0x13')](_0x2bb2('0x17'),_0x2bb2('0x1a')),controller['destroy']);router['delete'](_0x2bb2('0x12'),auth[_0x2bb2('0x5')](),controller[_0x2bb2('0x1b')]);module[_0x2bb2('0x1c')]=router; \ No newline at end of file +var _0xf7d7=['delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','/describe','describe','/:id','isAuthenticated','/:id/messages','/:id/download','post','addMessage','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update'];(function(_0x50d7b4,_0x140e59){var _0x3a1cab=function(_0x4f6461){while(--_0x4f6461){_0x50d7b4['push'](_0x50d7b4['shift']());}};_0x3a1cab(++_0x140e59);}(_0xf7d7,0xa2));var _0x7f7d=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xf7d7[_0x2fc012];return _0x2891f9;};'use strict';var express=require(_0x7f7d('0x0'));var router=express[_0x7f7d('0x1')]();var auth=require(_0x7f7d('0x2'));var interaction=require(_0x7f7d('0x3'));var controller=require(_0x7f7d('0x4'));router[_0x7f7d('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7f7d('0x5')](_0x7f7d('0x6'),auth['isAuthenticated'](),controller[_0x7f7d('0x7')]);router['get'](_0x7f7d('0x8'),auth[_0x7f7d('0x9')](),controller['show']);router[_0x7f7d('0x5')](_0x7f7d('0xa'),auth[_0x7f7d('0x9')](),controller['getMessages']);router['get'](_0x7f7d('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x7f7d('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7f7d('0xa'),auth[_0x7f7d('0x9')](),controller[_0x7f7d('0xd')]);router[_0x7f7d('0xc')]('/:id/tags',auth[_0x7f7d('0x9')](),interaction[_0x7f7d('0xe')](_0x7f7d('0xf'),_0x7f7d('0x10')),controller['addTags']);router[_0x7f7d('0x11')](_0x7f7d('0x8'),auth[_0x7f7d('0x9')](),interaction[_0x7f7d('0xe')]('mail',_0x7f7d('0x12')),controller[_0x7f7d('0x13')]);router[_0x7f7d('0x14')](_0x7f7d('0x8'),auth[_0x7f7d('0x9')](),interaction[_0x7f7d('0xe')](_0x7f7d('0xf'),_0x7f7d('0x15')),controller[_0x7f7d('0x16')]);router['delete'](_0x7f7d('0x17'),auth[_0x7f7d('0x9')](),controller[_0x7f7d('0x18')]);module[_0x7f7d('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 7c9bf98..77b6559 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 _0xc7d6=['long','DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING','TEXT'];(function(_0x140dcd,_0xe99058){var _0x346705=function(_0x38a521){while(--_0x38a521){_0x140dcd['push'](_0x140dcd['shift']());}};_0x346705(++_0xe99058);}(_0xc7d6,0x1e1));var _0x6c7d=function(_0x805ba6,_0xe9940){_0x805ba6=_0x805ba6-0x0;var _0x4c87b7=_0xc7d6[_0x805ba6];return _0x4c87b7;};'use strict';var Sequelize=require(_0x6c7d('0x0'));var iconv=require('iconv');module[_0x6c7d('0x1')]={'closed':{'type':Sequelize[_0x6c7d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6c7d('0x3')]},'secondDisposition':{'type':Sequelize[_0x6c7d('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6c7d('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x6c7d('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6c7d('0x4')](_0x6c7d('0x5'))},'subject':{'type':Sequelize[_0x6c7d('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6c7d('0x6')]},'substatus':{'type':Sequelize[_0x6c7d('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x6c7d('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x6c7d('0x7')]('in',_0x6c7d('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6c7d('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6c7d('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x53cc=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','out','ENUM'];(function(_0x114dbf,_0x3dd101){var _0x5953c9=function(_0x39aeb0){while(--_0x39aeb0){_0x114dbf['push'](_0x114dbf['shift']());}};_0x5953c9(++_0x3dd101);}(_0x53cc,0x178));var _0xc53c=function(_0x10b2d5,_0x5a7743){_0x10b2d5=_0x10b2d5-0x0;var _0x14b8d1=_0x53cc[_0x10b2d5];return _0x14b8d1;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xc53c('0x0'));module[_0xc53c('0x1')]={'closed':{'type':Sequelize[_0xc53c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc53c('0x3')]},'disposition':{'type':Sequelize[_0xc53c('0x4')]},'secondDisposition':{'type':Sequelize[_0xc53c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc53c('0x4')]},'note':{'type':Sequelize[_0xc53c('0x4')]},'inReplyTo':{'type':Sequelize[_0xc53c('0x4')](0x1fe)},'to':{'type':Sequelize[_0xc53c('0x4')]},'cc':{'type':Sequelize[_0xc53c('0x5')]('long')},'subject':{'type':Sequelize[_0xc53c('0x5')]()},'attach':{'type':Sequelize[_0xc53c('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xc53c('0x3')]},'substatus':{'type':Sequelize[_0xc53c('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xc53c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc53c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc53c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc53c('0x7')]('in',_0xc53c('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 96e1cde..08c7224 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 _0x635c=['describe','addMessage','MailMessage','ids','getMessages','nolimit','order','sort','where','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','addTags','spread','color','emit','mailInteractionTags:save','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','type','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','stack','name','send','index','fieldName','key','getOptions','findAll','mail','user','catch','params','model','keys','MailInteraction','query','filters','intersection','attributes','fields','length','include','merge','options','find','create','body'];(function(_0x2d1840,_0x5dc27e){var _0xd06a88=function(_0x4770c9){while(--_0x4770c9){_0x2d1840['push'](_0x2d1840['shift']());}};_0xd06a88(++_0x5dc27e);}(_0x635c,0xa1));var _0xc635=function(_0xaed07c,_0x396cdf){_0xaed07c=_0xaed07c-0x0;var _0xdaaa02=_0x635c[_0xaed07c];return _0xdaaa02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc635('0x0'));var zipdir=require(_0xc635('0x1'));var moment=require(_0xc635('0x2'));var BPromise=require(_0xc635('0x3'));var util=require('util');var path=require(_0xc635('0x4'));var fs=require('fs');var _=require(_0xc635('0x5'));var juice=require(_0xc635('0x6'));var Redis=require(_0xc635('0x7'));var interaction=require(_0xc635('0x8'));var qs=require(_0xc635('0x9'));var logger=require(_0xc635('0xa'))('api');var config=require(_0xc635('0xb'));var db=require(_0xc635('0xc'))['db'];var htmlEntities=require(_0xc635('0xd'));config['redis']=_[_0xc635('0xe')](config[_0xc635('0xf')],{'host':_0xc635('0x10'),'port':0x18eb});var socket=require(_0xc635('0x11'))(new Redis(config[_0xc635('0xf')]));require(_0xc635('0x12'))[_0xc635('0x13')](socket);function respondWithStatusCode(_0x1bee53,_0x2e501b){_0x2e501b=_0x2e501b||0xcc;return function(_0x2356de){if(_0x2356de){return _0x1bee53['sendStatus'](_0x2e501b);}return _0x1bee53[_0xc635('0x14')](_0x2e501b)[_0xc635('0x15')]();};}function respondWithResult(_0x248562,_0x368b37){_0x368b37=_0x368b37||0xc8;return function(_0x5ca94e){if(_0x5ca94e){return _0x248562[_0xc635('0x14')](_0x368b37)[_0xc635('0x16')](_0x5ca94e);}};}function respondWithFilteredResult(_0xaaab30,_0x4c5e93){return function(_0x5ccddc){if(_0x5ccddc){var _0x13e97f=typeof _0x4c5e93[_0xc635('0x17')]===_0xc635('0x18')&&typeof _0x4c5e93[_0xc635('0x19')]===_0xc635('0x18');var _0x2fd23b=_0x5ccddc[_0xc635('0x1a')];var _0x44a81d=_0x13e97f?0x0:_0x4c5e93[_0xc635('0x17')];var _0x14d0de=_0x13e97f?_0x5ccddc['count']:_0x4c5e93[_0xc635('0x17')]+_0x4c5e93[_0xc635('0x19')];var _0x560148;if(_0x14d0de>=_0x2fd23b){_0x14d0de=_0x2fd23b;_0x560148=0xc8;}else{_0x560148=0xce;}_0xaaab30[_0xc635('0x14')](_0x560148);return _0xaaab30[_0xc635('0x1b')](_0xc635('0x1c'),_0x44a81d+'-'+_0x14d0de+'/'+_0x2fd23b)[_0xc635('0x16')](_0x5ccddc);}return null;};}function saveUpdates(_0x5e0775){return function(_0x5d62df){if(_0x5d62df){return _0x5d62df[_0xc635('0x1d')](_0x5e0775)[_0xc635('0x1e')](function(_0x3c06f1){return _0x3c06f1;});}return null;};}function removeEntity(_0x1b9ed9){return function(_0x2bd8d5){if(_0x2bd8d5){return _0x2bd8d5['destroy']()[_0xc635('0x1e')](function(){_0x1b9ed9[_0xc635('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34765a){return function(_0x378e8e){if(!_0x378e8e){_0x34765a[_0xc635('0x1f')](0x194);}return _0x378e8e;};}function handleError(_0xa5efec,_0x22f968){_0x22f968=_0x22f968||0x1f4;return function(_0x181f31){logger['error'](_0x181f31[_0xc635('0x20')]);if(_0x181f31['name']){delete _0x181f31[_0xc635('0x21')];}_0xa5efec['status'](_0x22f968)[_0xc635('0x22')](_0x181f31);};}exports[_0xc635('0x23')]=function(_0x88f3b9,_0x19884d){var _0x579a12={};var _0x3da99d=_['map'](db['MailInteraction']['rawAttributes'],function(_0xe00c8a){return{'name':_0xe00c8a[_0xc635('0x24')],'type':_0xe00c8a['type'][_0xc635('0x25')]};});_0x579a12=qs[_0xc635('0x26')](_0x3da99d,_0x88f3b9);return interaction[_0xc635('0x27')](_0xc635('0x28'),_0x88f3b9['query'],_0x88f3b9[_0xc635('0x29')],_0x579a12,_0x3da99d)[_0xc635('0x1e')](respondWithFilteredResult(_0x19884d,_0x579a12))[_0xc635('0x2a')](handleError(_0x19884d,null));};exports['show']=function(_0x42e45f,_0x3f6d47){var _0x430d09={'raw':![],'where':{'id':_0x42e45f[_0xc635('0x2b')]['id']}},_0x46547e={};_0x46547e[_0xc635('0x2c')]=_[_0xc635('0x2d')](db[_0xc635('0x2e')]['rawAttributes']);_0x46547e[_0xc635('0x2f')]=_[_0xc635('0x2d')](_0x42e45f[_0xc635('0x2f')]);_0x46547e[_0xc635('0x30')]=_[_0xc635('0x31')](_0x46547e['model'],_0x46547e['query']);_0x430d09[_0xc635('0x32')]=_['intersection'](_0x46547e[_0xc635('0x2c')],qs[_0xc635('0x33')](_0x42e45f['query'][_0xc635('0x33')]));_0x430d09[_0xc635('0x32')]=_0x430d09['attributes'][_0xc635('0x34')]?_0x430d09['attributes']:_0x46547e[_0xc635('0x2c')];if(_0x42e45f['query']['includeAll']){_0x430d09[_0xc635('0x35')]=[{'all':!![]}];}_0x430d09=_[_0xc635('0x36')]({},_0x430d09,_0x42e45f[_0xc635('0x37')]);return db[_0xc635('0x2e')][_0xc635('0x38')](_0x430d09)[_0xc635('0x1e')](handleEntityNotFound(_0x3f6d47,null))[_0xc635('0x1e')](respondWithResult(_0x3f6d47,null))[_0xc635('0x2a')](handleError(_0x3f6d47,null));};exports['create']=function(_0x2e8729,_0x218e80){return db[_0xc635('0x2e')][_0xc635('0x39')](_0x2e8729[_0xc635('0x3a')],{})[_0xc635('0x1e')](respondWithResult(_0x218e80,0xc9))[_0xc635('0x2a')](handleError(_0x218e80,null));};exports[_0xc635('0x1d')]=function(_0xb918a0,_0x6d38c2){if(_0xb918a0[_0xc635('0x3a')]['id']){delete _0xb918a0['body']['id'];}return db['MailInteraction'][_0xc635('0x38')]({'where':{'id':_0xb918a0['params']['id']}})[_0xc635('0x1e')](handleEntityNotFound(_0x6d38c2,null))[_0xc635('0x1e')](saveUpdates(_0xb918a0[_0xc635('0x3a')],null))['then'](respondWithResult(_0x6d38c2,null))['catch'](handleError(_0x6d38c2,null));};exports['destroy']=function(_0x59965c,_0x170a8c){return db[_0xc635('0x2e')]['find']({'where':{'id':_0x59965c[_0xc635('0x2b')]['id']}})[_0xc635('0x1e')](handleEntityNotFound(_0x170a8c,null))['then'](removeEntity(_0x170a8c,null))[_0xc635('0x2a')](handleError(_0x170a8c,null));};exports[_0xc635('0x3b')]=function(_0x3b8db6,_0x5a360c){return db[_0xc635('0x2e')]['describe']()[_0xc635('0x1e')](respondWithResult(_0x5a360c,null))[_0xc635('0x2a')](handleError(_0x5a360c,null));};exports[_0xc635('0x3c')]=function(_0x1f7716,_0x57005c){return db[_0xc635('0x3d')]['find']({'where':{'id':_0x1f7716[_0xc635('0x2b')]['id']}})[_0xc635('0x1e')](handleEntityNotFound(_0x57005c,null))[_0xc635('0x1e')](function(_0xdd4945){if(_0xdd4945){return _0xdd4945[_0xc635('0x3c')](_0x1f7716[_0xc635('0x3a')][_0xc635('0x3e')],_['omit'](_0x1f7716[_0xc635('0x3a')],[_0xc635('0x3e'),'id'])||{});}})[_0xc635('0x1e')](respondWithResult(_0x57005c,null))[_0xc635('0x2a')](handleError(_0x57005c,null));};exports[_0xc635('0x3f')]=function(_0x936069,_0x58de99){var _0x43681f={'raw':![],'where':{}};var _0xf109ae={};var _0x529889={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x936069['params']['id']}})['then'](handleEntityNotFound(_0x58de99,null))[_0xc635('0x1e')](function(_0x4e7725){if(_0x4e7725){_0xf109ae[_0xc635('0x2c')]=_[_0xc635('0x2d')](db[_0xc635('0x3d')]['rawAttributes']);_0xf109ae[_0xc635('0x2f')]=_[_0xc635('0x2d')](_0x936069[_0xc635('0x2f')]);_0xf109ae[_0xc635('0x30')]=_[_0xc635('0x31')](_0xf109ae[_0xc635('0x2c')],_0xf109ae[_0xc635('0x2f')]);_0x43681f[_0xc635('0x32')]=_[_0xc635('0x31')](_0xf109ae[_0xc635('0x2c')],qs[_0xc635('0x33')](_0x936069['query'][_0xc635('0x33')]));_0x43681f[_0xc635('0x32')]=_0x43681f[_0xc635('0x32')]['length']?_0x43681f['attributes']:_0xf109ae['model'];if(!_0x936069[_0xc635('0x2f')]['hasOwnProperty'](_0xc635('0x40'))){_0x43681f['limit']=qs[_0xc635('0x19')](_0x936069[_0xc635('0x2f')][_0xc635('0x19')]);_0x43681f[_0xc635('0x17')]=qs[_0xc635('0x17')](_0x936069[_0xc635('0x2f')][_0xc635('0x17')]);}_0x43681f[_0xc635('0x41')]=qs[_0xc635('0x42')](_0x936069[_0xc635('0x2f')][_0xc635('0x42')]);_0x43681f[_0xc635('0x43')]=qs[_0xc635('0x30')](_['pick'](_0x936069[_0xc635('0x2f')],_0xf109ae[_0xc635('0x30')]));_0x43681f['where']['MailInteractionId']=_0x4e7725['id'];if(_0x936069['query']['filter']){_0x43681f['where']=_[_0xc635('0x36')](_0x43681f[_0xc635('0x43')],{'$or':_['map'](_0x43681f[_0xc635('0x32')],function(_0xaa7893){var _0x28916d={};_0x28916d[_0xaa7893]={'$like':'%'+_0x936069[_0xc635('0x2f')][_0xc635('0x44')]+'%'};return _0x28916d;})});}if(_0x936069[_0xc635('0x2f')]['$gte']){var _0x9facc4=_0x936069[_0xc635('0x2f')][_0xc635('0x45')]['split'](',');var _0x561dc9={};_0x561dc9[_0x9facc4[0x0]]={'$gte':moment(_0x9facc4[0x1])[_0xc635('0x46')](_0xc635('0x47'))};_0x43681f[_0xc635('0x43')]=_[_0xc635('0x36')](_0x43681f[_0xc635('0x43')],_0x561dc9);}_0x43681f=_[_0xc635('0x36')]({},_0x43681f,_0x936069['options']);return db[_0xc635('0x3d')]['count']({'where':_0x43681f[_0xc635('0x43')]})[_0xc635('0x1e')](function(_0x4d0700){_0x529889[_0xc635('0x1a')]=_0x4d0700;if(_0x936069['query'][_0xc635('0x48')]){_0x43681f[_0xc635('0x35')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x43681f);})[_0xc635('0x1e')](function(_0x1014be){if(_0x936069[_0xc635('0x2f')][_0xc635('0x49')]===_0xc635('0x4a')){for(var _0x3a563b=0x0;_0x3a563b<_0x1014be[_0xc635('0x34')];_0x3a563b++){_0x1014be[_0x3a563b][_0xc635('0x3a')]=juice(_0x1014be[_0x3a563b][_0xc635('0x3a')]);}}_0x529889['rows']=_0x1014be;return _0x529889;});}})['then'](respondWithFilteredResult(_0x58de99,_0x43681f))[_0xc635('0x2a')](handleError(_0x58de99,null));};exports[_0xc635('0x4b')]=function(_0x307aeb,_0x3aead0){return db[_0xc635('0x2e')][_0xc635('0x38')]({'where':{'id':_0x307aeb['params']['id']}})[_0xc635('0x1e')](handleEntityNotFound(_0x3aead0,null))['then'](function(_0x482c9b){if(_0x482c9b){return _0x482c9b['setTags'](_0x307aeb[_0xc635('0x3a')]['ids'],_['omit'](_0x307aeb[_0xc635('0x3a')],[_0xc635('0x3e'),'id'])||{})[_0xc635('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id',_0xc635('0x21'),_0xc635('0x4d')],'where':{'id':_0x307aeb['body']['ids']}});})[_0xc635('0x1e')](function(_0x288288){socket[_0xc635('0x4e')](_0xc635('0x4f'),{'id':Number(_0x307aeb[_0xc635('0x2b')]['id']),'tags':_0x288288||[]});return{'id':Number(_0x307aeb[_0xc635('0x2b')]['id']),'tags':_0x288288||[]};});}})[_0xc635('0x1e')](respondWithResult(_0x3aead0,null))[_0xc635('0x2a')](handleError(_0x3aead0,null));};exports['removeTags']=function(_0x54b6b2,_0x1e0ef1){return db[_0xc635('0x2e')][_0xc635('0x38')]({'where':{'id':_0x54b6b2[_0xc635('0x2b')]['id']}})[_0xc635('0x1e')](handleEntityNotFound(_0x1e0ef1,null))['then'](function(_0x561c25){if(_0x561c25){return _0x561c25['removeTags'](_0x54b6b2[_0xc635('0x2f')][_0xc635('0x3e')]);}})[_0xc635('0x1e')](respondWithStatusCode(_0x1e0ef1,null))[_0xc635('0x2a')](handleError(_0x1e0ef1,null));};exports['download']=function(_0x185835,_0x1ea415){var _0x3e2703=moment()[_0xc635('0x50')]()['toString']();var _0x573b2d=path[_0xc635('0x51')](config[_0xc635('0x52')],_0xc635('0x53'),_0xc635('0x54'),_0xc635('0x55'));var _0x4e184b=path[_0xc635('0x51')](config['root'],'server',_0xc635('0x54'),_0xc635('0x56'));var _0x45c1b9=path[_0xc635('0x51')](_0x573b2d,_0x3e2703);var _0x479f81=util[_0xc635('0x46')](_0xc635('0x57'),_0x185835[_0xc635('0x2b')]['id'],_0x3e2703);var _0x477b2c=path[_0xc635('0x51')](_0x573b2d,_0x479f81);var _0x4a2e9d=[];if(_0x185835[_0xc635('0x2f')][_0xc635('0x56')]){_0x4a2e9d[_0xc635('0x58')]({'model':db[_0xc635('0x59')],'as':_0xc635('0x5a'),'raw':!![]});}var _0x4012c0=[{'model':db[_0xc635('0x3d')],'as':_0xc635('0x5b'),'attributes':['id',_0xc635('0x3a'),_0xc635('0x5c'),'to','cc',_0xc635('0x5d'),'subject',_0xc635('0x5e')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x4a2e9d}];return db[_0xc635('0x2e')][_0xc635('0x38')]({'where':{'id':_0x185835[_0xc635('0x2b')]['id']},'include':_0x4012c0})[_0xc635('0x1e')](handleEntityNotFound(_0x1ea415,null))['then'](function(_0x30ca4b){if(_0x30ca4b&&_0x30ca4b[_0xc635('0x5b')]){var _0xc90750=_0x30ca4b[_0xc635('0x5f')]({'plain':!![]});fs[_0xc635('0x60')](_0x45c1b9);return BPromise[_0xc635('0x61')](_0xc90750['Messages'],function(_0x5f4ae0,_0xbe0157){var _0xef29b={'from':_0x5f4ae0['from'],'to':_0x5f4ae0['to'],'subject':_0x5f4ae0[_0xc635('0x62')],'html':htmlEntities[_0xc635('0x63')](_0x5f4ae0[_0xc635('0x3a')]),'headers':{'Date':moment(_0x5f4ae0[_0xc635('0x5e')])[_0xc635('0x46')](_0xc635('0x64'))},'attachments':[]};if(_0x5f4ae0['cc']){_0xef29b[_0xc635('0x65')]['Cc']=_0x5f4ae0['cc'];}if(_0x5f4ae0['bcc']){_0xef29b[_0xc635('0x65')]['Bcc']=_0x5f4ae0[_0xc635('0x5d')];}return new BPromise(function(_0x3daedb,_0x434e3f){if(_0x5f4ae0[_0xc635('0x5a')]){for(var _0x5cd31a=0x0;_0x5cd31a<_0x5f4ae0[_0xc635('0x5a')][_0xc635('0x34')];_0x5cd31a++){var _0x39fc12=_0x5f4ae0[_0xc635('0x5a')][_0x5cd31a];var _0xaa243a=path[_0xc635('0x51')](_0x4e184b,_0x39fc12['basename']);if(fs[_0xc635('0x66')](_0xaa243a)){_0xef29b[_0xc635('0x56')][_0xc635('0x58')]({'name':_0x39fc12[_0xc635('0x21')],'contentType':_0x39fc12[_0xc635('0x67')],'data':fs[_0xc635('0x68')](_0xaa243a)});}}}emlformat[_0xc635('0x69')](_0xef29b,function(_0x202c9a,_0x43edb5){if(_0x202c9a)return _0x434e3f(_0x202c9a);fs[_0xc635('0x6a')](path['join'](_0x45c1b9,util[_0xc635('0x46')](_0xc635('0x6b'),_0xbe0157)),_0x43edb5);return _0x3daedb(_0x43edb5);});});})[_0xc635('0x1e')](function(){return new BPromise(function(_0x24b7be,_0x5e212b){zipdir(_0x45c1b9,{'saveTo':_0x477b2c},function(_0x4c8f4c,_0x173074){if(_0x4c8f4c)return _0x5e212b(_0x4c8f4c);return _0x24b7be(_0x173074);});})[_0xc635('0x1e')](function(){return new BPromise(function(_0x3decac,_0x2afd53){rimraf(_0x45c1b9,function(_0x373bd7){if(_0x373bd7)_0x2afd53(_0x373bd7);return _0x3decac();});});})[_0xc635('0x1e')](function(){return _0x1ea415[_0xc635('0x6c')](_0x477b2c,_0x479f81,function(_0x36323a){if(!_0x36323a)fs[_0xc635('0x6d')](_0x477b2c);});});});}else{return _0x1ea415['sendStatus'](0xc8);}})[_0xc635('0x2a')](handleError(_0x1ea415,null));}; \ No newline at end of file +var _0x0aee=['MailInteraction','rawAttributes','type','findAll','mail','user','catch','show','keys','query','intersection','model','attributes','fields','includeAll','merge','options','find','create','body','update','destroy','params','describe','addMessage','MailMessage','ids','getMessages','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','rows','addTags','setTags','omit','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','bluebird','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','error','name','send','index','map'];(function(_0x3ce9a6,_0x24ac73){var _0x1720db=function(_0x92bfcb){while(--_0x92bfcb){_0x3ce9a6['push'](_0x3ce9a6['shift']());}};_0x1720db(++_0x24ac73);}(_0x0aee,0x1a3));var _0xe0ae=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x0aee[_0x4c9f6a];return _0x5df5b9;};'use strict';var emlformat=require(_0xe0ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0ae('0x1'));var moment=require('moment');var BPromise=require(_0xe0ae('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xe0ae('0x3'));var juice=require(_0xe0ae('0x4'));var Redis=require(_0xe0ae('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xe0ae('0x6'));var logger=require(_0xe0ae('0x7'))(_0xe0ae('0x8'));var config=require(_0xe0ae('0x9'));var db=require(_0xe0ae('0xa'))['db'];var htmlEntities=require(_0xe0ae('0xb'));config[_0xe0ae('0xc')]=_[_0xe0ae('0xd')](config[_0xe0ae('0xc')],{'host':_0xe0ae('0xe'),'port':0x18eb});var socket=require(_0xe0ae('0xf'))(new Redis(config[_0xe0ae('0xc')]));require('./mailInteraction.socket')[_0xe0ae('0x10')](socket);function respondWithStatusCode(_0x1ecdb0,_0x308eaf){_0x308eaf=_0x308eaf||0xcc;return function(_0x2fdb28){if(_0x2fdb28){return _0x1ecdb0[_0xe0ae('0x11')](_0x308eaf);}return _0x1ecdb0[_0xe0ae('0x12')](_0x308eaf)[_0xe0ae('0x13')]();};}function respondWithResult(_0x2b61b3,_0x3da8ac){_0x3da8ac=_0x3da8ac||0xc8;return function(_0x35c2c4){if(_0x35c2c4){return _0x2b61b3[_0xe0ae('0x12')](_0x3da8ac)[_0xe0ae('0x14')](_0x35c2c4);}};}function respondWithFilteredResult(_0xd6e08f,_0x36125f){return function(_0x2434fa){if(_0x2434fa){var _0x41f551=typeof _0x36125f[_0xe0ae('0x15')]===_0xe0ae('0x16')&&typeof _0x36125f[_0xe0ae('0x17')]===_0xe0ae('0x16');var _0x460b37=_0x2434fa[_0xe0ae('0x18')];var _0x374d63=_0x41f551?0x0:_0x36125f[_0xe0ae('0x15')];var _0x1e85e3=_0x41f551?_0x2434fa[_0xe0ae('0x18')]:_0x36125f[_0xe0ae('0x15')]+_0x36125f[_0xe0ae('0x17')];var _0x389c27;if(_0x1e85e3>=_0x460b37){_0x1e85e3=_0x460b37;_0x389c27=0xc8;}else{_0x389c27=0xce;}_0xd6e08f['status'](_0x389c27);return _0xd6e08f[_0xe0ae('0x19')](_0xe0ae('0x1a'),_0x374d63+'-'+_0x1e85e3+'/'+_0x460b37)[_0xe0ae('0x14')](_0x2434fa);}return null;};}function saveUpdates(_0x529404){return function(_0x38054b){if(_0x38054b){return _0x38054b['update'](_0x529404)['then'](function(_0x4aa9da){return _0x4aa9da;});}return null;};}function removeEntity(_0x5761bc){return function(_0x4fa7cb){if(_0x4fa7cb){return _0x4fa7cb['destroy']()[_0xe0ae('0x1b')](function(){_0x5761bc[_0xe0ae('0x12')](0xcc)[_0xe0ae('0x13')]();});}};}function handleEntityNotFound(_0x33ce62){return function(_0x5765f6){if(!_0x5765f6){_0x33ce62[_0xe0ae('0x11')](0x194);}return _0x5765f6;};}function handleError(_0x35dd73,_0x49c632){_0x49c632=_0x49c632||0x1f4;return function(_0x310060){logger[_0xe0ae('0x1c')](_0x310060['stack']);if(_0x310060[_0xe0ae('0x1d')]){delete _0x310060['name'];}_0x35dd73[_0xe0ae('0x12')](_0x49c632)[_0xe0ae('0x1e')](_0x310060);};}exports[_0xe0ae('0x1f')]=function(_0x27479e,_0x21bd46){var _0x5dfa79={};var _0x363614=_[_0xe0ae('0x20')](db[_0xe0ae('0x21')][_0xe0ae('0x22')],function(_0x5cfa33){return{'name':_0x5cfa33['fieldName'],'type':_0x5cfa33[_0xe0ae('0x23')]['key']};});_0x5dfa79=qs['getOptions'](_0x363614,_0x27479e);return interaction[_0xe0ae('0x24')](_0xe0ae('0x25'),_0x27479e['query'],_0x27479e[_0xe0ae('0x26')],_0x5dfa79,_0x363614)['then'](respondWithFilteredResult(_0x21bd46,_0x5dfa79))[_0xe0ae('0x27')](handleError(_0x21bd46,null));};exports[_0xe0ae('0x28')]=function(_0x2e9b62,_0x249afa){var _0x18d0d2={'raw':![],'where':{'id':_0x2e9b62['params']['id']}},_0x575d5e={};_0x575d5e['model']=_[_0xe0ae('0x29')](db['MailInteraction'][_0xe0ae('0x22')]);_0x575d5e['query']=_['keys'](_0x2e9b62[_0xe0ae('0x2a')]);_0x575d5e['filters']=_[_0xe0ae('0x2b')](_0x575d5e[_0xe0ae('0x2c')],_0x575d5e[_0xe0ae('0x2a')]);_0x18d0d2[_0xe0ae('0x2d')]=_[_0xe0ae('0x2b')](_0x575d5e[_0xe0ae('0x2c')],qs[_0xe0ae('0x2e')](_0x2e9b62[_0xe0ae('0x2a')][_0xe0ae('0x2e')]));_0x18d0d2[_0xe0ae('0x2d')]=_0x18d0d2[_0xe0ae('0x2d')]['length']?_0x18d0d2['attributes']:_0x575d5e['model'];if(_0x2e9b62[_0xe0ae('0x2a')][_0xe0ae('0x2f')]){_0x18d0d2['include']=[{'all':!![]}];}_0x18d0d2=_[_0xe0ae('0x30')]({},_0x18d0d2,_0x2e9b62[_0xe0ae('0x31')]);return db['MailInteraction'][_0xe0ae('0x32')](_0x18d0d2)[_0xe0ae('0x1b')](handleEntityNotFound(_0x249afa,null))[_0xe0ae('0x1b')](respondWithResult(_0x249afa,null))[_0xe0ae('0x27')](handleError(_0x249afa,null));};exports[_0xe0ae('0x33')]=function(_0x5610d9,_0x4a02ed){return db['MailInteraction'][_0xe0ae('0x33')](_0x5610d9[_0xe0ae('0x34')],{})[_0xe0ae('0x1b')](respondWithResult(_0x4a02ed,0xc9))['catch'](handleError(_0x4a02ed,null));};exports[_0xe0ae('0x35')]=function(_0x3ac826,_0x3d8db7){if(_0x3ac826[_0xe0ae('0x34')]['id']){delete _0x3ac826['body']['id'];}return db[_0xe0ae('0x21')]['find']({'where':{'id':_0x3ac826['params']['id']}})[_0xe0ae('0x1b')](handleEntityNotFound(_0x3d8db7,null))['then'](saveUpdates(_0x3ac826[_0xe0ae('0x34')],null))[_0xe0ae('0x1b')](respondWithResult(_0x3d8db7,null))[_0xe0ae('0x27')](handleError(_0x3d8db7,null));};exports[_0xe0ae('0x36')]=function(_0x20606d,_0x45cdf8){return db[_0xe0ae('0x21')][_0xe0ae('0x32')]({'where':{'id':_0x20606d[_0xe0ae('0x37')]['id']}})['then'](handleEntityNotFound(_0x45cdf8,null))['then'](removeEntity(_0x45cdf8,null))[_0xe0ae('0x27')](handleError(_0x45cdf8,null));};exports[_0xe0ae('0x38')]=function(_0x529742,_0x391e6e){return db[_0xe0ae('0x21')][_0xe0ae('0x38')]()[_0xe0ae('0x1b')](respondWithResult(_0x391e6e,null))[_0xe0ae('0x27')](handleError(_0x391e6e,null));};exports[_0xe0ae('0x39')]=function(_0x2e2632,_0x4becc5){return db[_0xe0ae('0x3a')][_0xe0ae('0x32')]({'where':{'id':_0x2e2632['params']['id']}})[_0xe0ae('0x1b')](handleEntityNotFound(_0x4becc5,null))['then'](function(_0xe817b5){if(_0xe817b5){return _0xe817b5['addMessage'](_0x2e2632['body'][_0xe0ae('0x3b')],_['omit'](_0x2e2632[_0xe0ae('0x34')],['ids','id'])||{});}})[_0xe0ae('0x1b')](respondWithResult(_0x4becc5,null))[_0xe0ae('0x27')](handleError(_0x4becc5,null));};exports[_0xe0ae('0x3c')]=function(_0x2d6ed0,_0x458ac0){var _0x3b9659={'raw':![],'where':{}};var _0x1ad510={};var _0x4527fa={'count':0x0,'rows':[]};return db[_0xe0ae('0x21')]['findOne']({'where':{'id':_0x2d6ed0['params']['id']}})['then'](handleEntityNotFound(_0x458ac0,null))['then'](function(_0x29eca2){if(_0x29eca2){_0x1ad510[_0xe0ae('0x2c')]=_[_0xe0ae('0x29')](db[_0xe0ae('0x3a')][_0xe0ae('0x22')]);_0x1ad510['query']=_[_0xe0ae('0x29')](_0x2d6ed0[_0xe0ae('0x2a')]);_0x1ad510['filters']=_['intersection'](_0x1ad510[_0xe0ae('0x2c')],_0x1ad510[_0xe0ae('0x2a')]);_0x3b9659[_0xe0ae('0x2d')]=_[_0xe0ae('0x2b')](_0x1ad510[_0xe0ae('0x2c')],qs[_0xe0ae('0x2e')](_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x2e')]));_0x3b9659[_0xe0ae('0x2d')]=_0x3b9659[_0xe0ae('0x2d')][_0xe0ae('0x3d')]?_0x3b9659[_0xe0ae('0x2d')]:_0x1ad510[_0xe0ae('0x2c')];if(!_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x3e')](_0xe0ae('0x3f'))){_0x3b9659['limit']=qs[_0xe0ae('0x17')](_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x17')]);_0x3b9659[_0xe0ae('0x15')]=qs[_0xe0ae('0x15')](_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x15')]);}_0x3b9659[_0xe0ae('0x40')]=qs[_0xe0ae('0x41')](_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x41')]);_0x3b9659[_0xe0ae('0x42')]=qs[_0xe0ae('0x43')](_[_0xe0ae('0x44')](_0x2d6ed0['query'],_0x1ad510['filters']));_0x3b9659['where'][_0xe0ae('0x45')]=_0x29eca2['id'];if(_0x2d6ed0['query'][_0xe0ae('0x46')]){_0x3b9659[_0xe0ae('0x42')]=_[_0xe0ae('0x30')](_0x3b9659[_0xe0ae('0x42')],{'$or':_[_0xe0ae('0x20')](_0x3b9659['attributes'],function(_0x5018c7){var _0x463925={};_0x463925[_0x5018c7]={'$like':'%'+_0x2d6ed0['query'][_0xe0ae('0x46')]+'%'};return _0x463925;})});}if(_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x47')]){var _0x26469e=_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x47')][_0xe0ae('0x48')](',');var _0x56f46c={};_0x56f46c[_0x26469e[0x0]]={'$gte':moment(_0x26469e[0x1])['format'](_0xe0ae('0x49'))};_0x3b9659['where']=_[_0xe0ae('0x30')](_0x3b9659[_0xe0ae('0x42')],_0x56f46c);}_0x3b9659=_[_0xe0ae('0x30')]({},_0x3b9659,_0x2d6ed0[_0xe0ae('0x31')]);return db[_0xe0ae('0x3a')]['count']({'where':_0x3b9659[_0xe0ae('0x42')]})['then'](function(_0x3eb9db){_0x4527fa['count']=_0x3eb9db;if(_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x2f')]){_0x3b9659[_0xe0ae('0x4a')]=[{'all':!![]}];}return db[_0xe0ae('0x3a')]['findAll'](_0x3b9659);})[_0xe0ae('0x1b')](function(_0x58377e){if(_0x2d6ed0[_0xe0ae('0x2a')][_0xe0ae('0x4b')]==='true'){for(var _0x4ec366=0x0;_0x4ec366<_0x58377e[_0xe0ae('0x3d')];_0x4ec366++){_0x58377e[_0x4ec366][_0xe0ae('0x34')]=juice(_0x58377e[_0x4ec366][_0xe0ae('0x34')]);}}_0x4527fa[_0xe0ae('0x4c')]=_0x58377e;return _0x4527fa;});}})[_0xe0ae('0x1b')](respondWithFilteredResult(_0x458ac0,_0x3b9659))[_0xe0ae('0x27')](handleError(_0x458ac0,null));};exports[_0xe0ae('0x4d')]=function(_0x21921c,_0x5e964a){return db['MailInteraction'][_0xe0ae('0x32')]({'where':{'id':_0x21921c[_0xe0ae('0x37')]['id']}})[_0xe0ae('0x1b')](handleEntityNotFound(_0x5e964a,null))[_0xe0ae('0x1b')](function(_0xbb3bb7){if(_0xbb3bb7){return _0xbb3bb7[_0xe0ae('0x4e')](_0x21921c[_0xe0ae('0x34')][_0xe0ae('0x3b')],_[_0xe0ae('0x4f')](_0x21921c[_0xe0ae('0x34')],[_0xe0ae('0x3b'),'id'])||{})[_0xe0ae('0x50')](function(){return db[_0xe0ae('0x51')]['findAll']({'attributes':['id',_0xe0ae('0x1d'),_0xe0ae('0x52')],'where':{'id':_0x21921c['body'][_0xe0ae('0x3b')]}});})[_0xe0ae('0x1b')](function(_0xde499c){socket[_0xe0ae('0x53')](_0xe0ae('0x54'),{'id':Number(_0x21921c[_0xe0ae('0x37')]['id']),'tags':_0xde499c||[]});return{'id':Number(_0x21921c['params']['id']),'tags':_0xde499c||[]};});}})[_0xe0ae('0x1b')](respondWithResult(_0x5e964a,null))[_0xe0ae('0x27')](handleError(_0x5e964a,null));};exports[_0xe0ae('0x55')]=function(_0x2c4a69,_0x41d394){return db[_0xe0ae('0x21')][_0xe0ae('0x32')]({'where':{'id':_0x2c4a69['params']['id']}})[_0xe0ae('0x1b')](handleEntityNotFound(_0x41d394,null))[_0xe0ae('0x1b')](function(_0x341efc){if(_0x341efc){return _0x341efc[_0xe0ae('0x55')](_0x2c4a69['query']['ids']);}})[_0xe0ae('0x1b')](respondWithStatusCode(_0x41d394,null))['catch'](handleError(_0x41d394,null));};exports[_0xe0ae('0x56')]=function(_0x3f4bc5,_0xbe5a99){var _0x477cf9=moment()['unix']()['toString']();var _0x179258=path[_0xe0ae('0x57')](config[_0xe0ae('0x58')],_0xe0ae('0x59'),_0xe0ae('0x5a'),_0xe0ae('0x5b'));var _0x432070=path[_0xe0ae('0x57')](config['root'],_0xe0ae('0x59'),_0xe0ae('0x5a'),_0xe0ae('0x5c'));var _0x15554c=path['join'](_0x179258,_0x477cf9);var _0x205495=util[_0xe0ae('0x5d')](_0xe0ae('0x5e'),_0x3f4bc5['params']['id'],_0x477cf9);var _0x22cb55=path['join'](_0x179258,_0x205495);var _0x1cbe00=[];if(_0x3f4bc5[_0xe0ae('0x2a')][_0xe0ae('0x5c')]){_0x1cbe00[_0xe0ae('0x5f')]({'model':db[_0xe0ae('0x60')],'as':_0xe0ae('0x61'),'raw':!![]});}var _0xf1ae29=[{'model':db['MailMessage'],'as':_0xe0ae('0x62'),'attributes':['id',_0xe0ae('0x34'),_0xe0ae('0x63'),'to','cc',_0xe0ae('0x64'),_0xe0ae('0x65'),_0xe0ae('0x66')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x1cbe00}];return db[_0xe0ae('0x21')][_0xe0ae('0x32')]({'where':{'id':_0x3f4bc5[_0xe0ae('0x37')]['id']},'include':_0xf1ae29})[_0xe0ae('0x1b')](handleEntityNotFound(_0xbe5a99,null))[_0xe0ae('0x1b')](function(_0xa04da){if(_0xa04da&&_0xa04da[_0xe0ae('0x62')]){var _0x4e73e2=_0xa04da[_0xe0ae('0x67')]({'plain':!![]});fs[_0xe0ae('0x68')](_0x15554c);return BPromise[_0xe0ae('0x69')](_0x4e73e2[_0xe0ae('0x62')],function(_0x2dc5ca,_0x2c6929){var _0x18ba65={'from':_0x2dc5ca[_0xe0ae('0x63')],'to':_0x2dc5ca['to'],'subject':_0x2dc5ca[_0xe0ae('0x65')],'html':htmlEntities['decode'](_0x2dc5ca[_0xe0ae('0x34')]),'headers':{'Date':moment(_0x2dc5ca[_0xe0ae('0x66')])[_0xe0ae('0x5d')](_0xe0ae('0x6a'))},'attachments':[]};if(_0x2dc5ca['cc']){_0x18ba65[_0xe0ae('0x6b')]['Cc']=_0x2dc5ca['cc'];}if(_0x2dc5ca[_0xe0ae('0x64')]){_0x18ba65[_0xe0ae('0x6b')][_0xe0ae('0x6c')]=_0x2dc5ca[_0xe0ae('0x64')];}return new BPromise(function(_0x24ed91,_0x2efb02){if(_0x2dc5ca[_0xe0ae('0x61')]){for(var _0x3109eb=0x0;_0x3109eb<_0x2dc5ca[_0xe0ae('0x61')][_0xe0ae('0x3d')];_0x3109eb++){var _0x1ea555=_0x2dc5ca[_0xe0ae('0x61')][_0x3109eb];var _0x4a1b59=path['join'](_0x432070,_0x1ea555['basename']);if(fs[_0xe0ae('0x6d')](_0x4a1b59)){_0x18ba65['attachments'][_0xe0ae('0x5f')]({'name':_0x1ea555[_0xe0ae('0x1d')],'contentType':_0x1ea555['type'],'data':fs['readFileSync'](_0x4a1b59)});}}}emlformat[_0xe0ae('0x6e')](_0x18ba65,function(_0x236891,_0x2f4705){if(_0x236891)return _0x2efb02(_0x236891);fs['writeFileSync'](path['join'](_0x15554c,util[_0xe0ae('0x5d')](_0xe0ae('0x6f'),_0x2c6929)),_0x2f4705);return _0x24ed91(_0x2f4705);});});})[_0xe0ae('0x1b')](function(){return new BPromise(function(_0x18faed,_0x2c48a4){zipdir(_0x15554c,{'saveTo':_0x22cb55},function(_0x3fd499,_0x48452a){if(_0x3fd499)return _0x2c48a4(_0x3fd499);return _0x18faed(_0x48452a);});})[_0xe0ae('0x1b')](function(){return new BPromise(function(_0x441450,_0x1fddf5){rimraf(_0x15554c,function(_0x8e9ded){if(_0x8e9ded)_0x1fddf5(_0x8e9ded);return _0x441450();});});})[_0xe0ae('0x1b')](function(){return _0xbe5a99[_0xe0ae('0x56')](_0x22cb55,_0x205495,function(_0x148580){if(!_0x148580)fs[_0xe0ae('0x70')](_0x22cb55);});});});}else{return _0xbe5a99['sendStatus'](0xc8);}})[_0xe0ae('0x27')](handleError(_0xbe5a99,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index f075715..1bd1946 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 _0x6760=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x6760,0x109));var _0x0676=function(_0x7ff1d6,_0x45727d){_0x7ff1d6=_0x7ff1d6-0x0;var _0x1dc752=_0x6760[_0x7ff1d6];return _0x1dc752;};'use strict';var EventEmitter=require(_0x0676('0x0'));var MailInteraction=require(_0x0676('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x0676('0x1'))['db'][_0x0676('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0676('0x3')](0x0);var events={'afterCreate':_0x0676('0x4'),'afterUpdate':_0x0676('0x5'),'afterDestroy':_0x0676('0x6')};function emitEvent(_0x28c575){return function(_0x4d6fc4,_0x2ce40a,_0x50dae4){_0x4d6fc4[_0x0676('0x7')]({'attributes':['id'],'raw':!![]})[_0x0676('0x8')](function(_0x753ec){_0x4d6fc4[_0x0676('0x9')](_0x0676('0xa'),_0x753ec[_0x0676('0xb')](function(_0x341d7a){return{'id':_0x341d7a['id']};}));return MailMessage[_0x0676('0xc')]({'where':{'MailInteractionId':_0x4d6fc4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0676('0x8')](function(_0x2a9809){_0x4d6fc4[_0x0676('0x9')](_0x0676('0xd'),_0x2a9809[_0x0676('0xe')]);MailInteractionEvents[_0x0676('0xf')](_0x28c575+':'+_0x4d6fc4['id'],_0x4d6fc4);MailInteractionEvents[_0x0676('0xf')](_0x28c575,_0x4d6fc4);_0x50dae4(null);})[_0x0676('0x10')](_0x50dae4(null));};}for(var e in events){if(events[_0x0676('0x11')](e)){var event=events[e];MailInteraction[_0x0676('0x12')](e,emitEvent(event));}}module[_0x0676('0x13')]=MailInteractionEvents; \ No newline at end of file +var _0x8834=['setMaxListeners','save','update','remove','getUsers','Users','findAll','then','length','emit','catch','hasOwnProperty','exports','MailInteraction','../../mysqldb'];(function(_0x4d7c8c,_0x4e9006){var _0x2f42a3=function(_0x521f4c){while(--_0x521f4c){_0x4d7c8c['push'](_0x4d7c8c['shift']());}};_0x2f42a3(++_0x4e9006);}(_0x8834,0x148));var _0x4883=function(_0x5addd5,_0x42cccb){_0x5addd5=_0x5addd5-0x0;var _0x1d3d93=_0x8834[_0x5addd5];return _0x1d3d93;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x4883('0x0')];var MailMessage=require(_0x4883('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4883('0x2')](0x0);var events={'afterCreate':_0x4883('0x3'),'afterUpdate':_0x4883('0x4'),'afterDestroy':_0x4883('0x5')};function emitEvent(_0x171e87){return function(_0x228847,_0x4c7866,_0x5667d6){_0x228847[_0x4883('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x375182){_0x228847['setDataValue'](_0x4883('0x7'),_0x375182['map'](function(_0x223ffb){return{'id':_0x223ffb['id']};}));return MailMessage[_0x4883('0x8')]({'where':{'MailInteractionId':_0x228847['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4883('0x9')](function(_0x323bdd){_0x228847['setDataValue']('unreadMessages',_0x323bdd[_0x4883('0xa')]);MailInteractionEvents[_0x4883('0xb')](_0x171e87+':'+_0x228847['id'],_0x228847);MailInteractionEvents[_0x4883('0xb')](_0x171e87,_0x228847);_0x5667d6(null);})[_0x4883('0xc')](_0x5667d6(null));};}for(var e in events){if(events[_0x4883('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x4883('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b8c69c5..d62e64e 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 _0xc32e=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','update'];(function(_0x278113,_0x85c78f){var _0x559e2c=function(_0x53a9d3){while(--_0x53a9d3){_0x278113['push'](_0x278113['shift']());}};_0x559e2c(++_0x85c78f);}(_0xc32e,0x1bb));var _0xec32=function(_0x325a79,_0x4e74b3){_0x325a79=_0x325a79-0x0;var _0x2ebb10=_0xc32e[_0x325a79];return _0x2ebb10;};'use strict';var _=require(_0xec32('0x0'));var util=require(_0xec32('0x1'));var logger=require(_0xec32('0x2'))(_0xec32('0x3'));var moment=require(_0xec32('0x4'));var BPromise=require(_0xec32('0x5'));var rp=require(_0xec32('0x6'));var fs=require('fs');var path=require(_0xec32('0x7'));var rimraf=require(_0xec32('0x8'));var config=require(_0xec32('0x9'));var attributes=require('./mailInteraction.attributes');module[_0xec32('0xa')]=function(_0x55962d,_0x256194){return _0x55962d[_0xec32('0xb')](_0xec32('0xc'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xec32('0xd'),'fields':[_0xec32('0xe'),'to'],'type':_0xec32('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2149d2,_0x4f105a,_0x4ac33e){if(_0x2149d2[_0xec32('0x10')]){_0x2149d2[_0xec32('0x11')]=moment()[_0xec32('0x12')](_0xec32('0x13'));}if(_0x2149d2[_0xec32('0x14')]){_0x2149d2[_0xec32('0x15')]=moment()[_0xec32('0x12')](_0xec32('0x13'));}_0x4ac33e(null,_0x4f105a);},'beforeUpdate':function(_0x47fbde,_0x30b149,_0x3bdf4d){if(_0x47fbde[_0xec32('0x16')]('substatus')){_0x47fbde[_0xec32('0x11')]=_0x47fbde[_0xec32('0x10')]?moment()[_0xec32('0x12')](_0xec32('0x13')):null;}if(_0x47fbde['changed']('closed')){_0x47fbde[_0xec32('0x15')]=moment()[_0xec32('0x12')](_0xec32('0x13'));_0x47fbde['substatus']=null;_0x47fbde[_0xec32('0x11')]=null;}_0x3bdf4d(null,_0x47fbde);},'afterUpdate':function(_0x4a59a3,_0x5b6a12,_0x30b33d){var _0x5b7072=_0x55962d['models'];var _0x215015=_0x4a59a3[_0xec32('0x17')]({'plain':!![]});if(_0x215015[_0xec32('0x14')]){return _0x5b7072['MailMessage'][_0xec32('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x215015['id']}})['then'](function(){_0x30b33d();})['catch'](function(_0xb18c72){_0x30b33d(_0xb18c72);});}else{_0x30b33d();}}},'charset':_0xec32('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x75e8=['subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','models','get','MailMessage','update','then','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','MailInteraction','fti_mail_interactions'];(function(_0x233404,_0x33e3ab){var _0x5787ba=function(_0xe86ec0){while(--_0xe86ec0){_0x233404['push'](_0x233404['shift']());}};_0x5787ba(++_0x33e3ab);}(_0x75e8,0x1a6));var _0x875e=function(_0x1d1402,_0x5a048f){_0x1d1402=_0x1d1402-0x0;var _0x1bdc2d=_0x75e8[_0x1d1402];return _0x1bdc2d;};'use strict';var _=require(_0x875e('0x0'));var util=require('util');var logger=require(_0x875e('0x1'))(_0x875e('0x2'));var moment=require('moment');var BPromise=require(_0x875e('0x3'));var rp=require(_0x875e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x875e('0x5'));var config=require(_0x875e('0x6'));var attributes=require('./mailInteraction.attributes');module[_0x875e('0x7')]=function(_0x50ab7d,_0x10ddb6){return _0x50ab7d['define'](_0x875e('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x875e('0x9'),'fields':[_0x875e('0xa'),'to'],'type':_0x875e('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x160eae,_0x1cb8e2,_0x38b307){if(_0x160eae[_0x875e('0xc')]){_0x160eae[_0x875e('0xd')]=moment()[_0x875e('0xe')](_0x875e('0xf'));}if(_0x160eae[_0x875e('0x10')]){_0x160eae['closedAt']=moment()[_0x875e('0xe')](_0x875e('0xf'));}_0x38b307(null,_0x1cb8e2);},'beforeUpdate':function(_0x9a9e31,_0x4a14d0,_0x59ba0c){if(_0x9a9e31[_0x875e('0x11')]('substatus')){_0x9a9e31[_0x875e('0xd')]=_0x9a9e31[_0x875e('0xc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x9a9e31['changed'](_0x875e('0x10'))){_0x9a9e31['closedAt']=moment()[_0x875e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x9a9e31[_0x875e('0xc')]=null;_0x9a9e31[_0x875e('0xd')]=null;}_0x59ba0c(null,_0x9a9e31);},'afterUpdate':function(_0x35a786,_0xf1f9e9,_0x5cb202){var _0x588272=_0x50ab7d[_0x875e('0x12')];var _0x487e46=_0x35a786[_0x875e('0x13')]({'plain':!![]});if(_0x487e46[_0x875e('0x10')]){return _0x588272[_0x875e('0x14')][_0x875e('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x487e46['id']}})[_0x875e('0x16')](function(){_0x5cb202();})['catch'](function(_0x17c080){_0x5cb202(_0x17c080);});}else{_0x5cb202();}}},'charset':_0x875e('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index c338157..17e51cc 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 _0x2b0c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','options','where','limit','UpdateMailInteraction','AddTagsToMailInteraction','addTags','ids','body','spread','AddTags'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b0c,0xc3));var _0xc2b0=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0x2b0c[_0x36d203];return _0x2f9e62;};'use strict';var _=require(_0xc2b0('0x0'));var util=require(_0xc2b0('0x1'));var moment=require(_0xc2b0('0x2'));var BPromise=require(_0xc2b0('0x3'));var rs=require(_0xc2b0('0x4'));var fs=require('fs');var Redis=require(_0xc2b0('0x5'));var db=require(_0xc2b0('0x6'))['db'];var utils=require(_0xc2b0('0x7'));var logger=require(_0xc2b0('0x8'))(_0xc2b0('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc2b0('0xa')][_0xc2b0('0xb')]({'port':0x232a});config[_0xc2b0('0xc')]=_[_0xc2b0('0xd')](config[_0xc2b0('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc2b0('0xe'))(new Redis(config[_0xc2b0('0xc')]));require(_0xc2b0('0xf'))[_0xc2b0('0x10')](socket);function respondWithRpcPromise(_0x25ab7d,_0x21191a,_0x2e997a){return new BPromise(function(_0x1649c6,_0x11ad1a){return client['request'](_0x25ab7d,_0x2e997a)[_0xc2b0('0x11')](function(_0x58be0f){logger[_0xc2b0('0x12')](_0xc2b0('0x13'),_0x21191a,_0xc2b0('0x14'));logger[_0xc2b0('0x15')](_0xc2b0('0x16'),_0x21191a,_0xc2b0('0x14'),JSON[_0xc2b0('0x17')](_0x58be0f));if(_0x58be0f[_0xc2b0('0x18')]){if(_0x58be0f[_0xc2b0('0x18')]['code']===0x1f4){logger[_0xc2b0('0x18')]('MailInteraction,\x20%s,\x20%s',_0x21191a,_0x58be0f[_0xc2b0('0x18')][_0xc2b0('0x19')]);return _0x11ad1a(_0x58be0f[_0xc2b0('0x18')][_0xc2b0('0x19')]);}logger[_0xc2b0('0x18')](_0xc2b0('0x13'),_0x21191a,_0x58be0f['error'][_0xc2b0('0x19')]);return _0x1649c6(_0x58be0f[_0xc2b0('0x18')][_0xc2b0('0x19')]);}else{logger[_0xc2b0('0x12')](_0xc2b0('0x13'),_0x21191a,'request\x20sent');_0x1649c6(_0x58be0f[_0xc2b0('0x1a')]['message']);}})[_0xc2b0('0x1b')](function(_0x5f1191){logger[_0xc2b0('0x18')](_0xc2b0('0x13'),_0x21191a,_0x5f1191);_0x11ad1a(_0x5f1191);});});}exports['UpdateMailInteraction']=function(_0x48b4eb){var _0xac832=this;return new Promise(function(_0x151c26,_0x479900){return db['MailInteraction'][_0xc2b0('0x1c')](_0x48b4eb['body'],{'raw':_0x48b4eb[_0xc2b0('0x1d')]?_0x48b4eb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48b4eb[_0xc2b0('0x1d')]?_0x48b4eb[_0xc2b0('0x1d')][_0xc2b0('0x1e')]||null:null,'attributes':_0x48b4eb['options']?_0x48b4eb['options']['attributes']||null:null,'limit':_0x48b4eb['options']?_0x48b4eb['options'][_0xc2b0('0x1f')]||null:null})[_0xc2b0('0x11')](function(_0x6eba77){logger[_0xc2b0('0x12')]('UpdateMailInteraction',_0x48b4eb);logger['debug']('UpdateMailInteraction',_0x48b4eb,JSON[_0xc2b0('0x17')](_0x6eba77));_0x151c26(_0x6eba77);})[_0xc2b0('0x1b')](function(_0x2ca66f){logger[_0xc2b0('0x18')](_0xc2b0('0x20'),_0x2ca66f[_0xc2b0('0x19')],_0x48b4eb);_0x479900(_0xac832[_0xc2b0('0x18')](0x1f4,_0x2ca66f[_0xc2b0('0x19')]));});});};exports[_0xc2b0('0x21')]=function(_0x284807){return new Promise(function(_0x5f2d78,_0x52b391){return db['MailInteraction']['find']({'where':_0x284807[_0xc2b0('0x1d')]?_0x284807[_0xc2b0('0x1d')][_0xc2b0('0x1e')]||null:null})[_0xc2b0('0x11')](function(_0x569970){if(_0x569970){return _0x569970[_0xc2b0('0x22')](_0x284807['body'][_0xc2b0('0x23')],_['omit'](_0x284807[_0xc2b0('0x24')],[_0xc2b0('0x23'),'id'])||{});}})[_0xc2b0('0x25')](function(_0x4692f2){logger[_0xc2b0('0x12')](_0xc2b0('0x26'),_0x284807);logger[_0xc2b0('0x15')](_0xc2b0('0x26'),_0x284807,JSON['stringify'](_0x4692f2));_0x5f2d78(_0x4692f2);})[_0xc2b0('0x1b')](function(_0x120230){logger[_0xc2b0('0x18')](_0xc2b0('0x26'),_0x120230['message'],_0x284807);_0x52b391(_this['error'](0x1f4,_0x120230[_0xc2b0('0x19')]));});});}; \ No newline at end of file +var _0xcc80=['omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags'];(function(_0x1d9cb8,_0x50100b){var _0x3db3de=function(_0x155e74){while(--_0x155e74){_0x1d9cb8['push'](_0x1d9cb8['shift']());}};_0x3db3de(++_0x50100b);}(_0xcc80,0xb7));var _0x0cc8=function(_0x3befa4,_0x299da7){_0x3befa4=_0x3befa4-0x0;var _0xaabb80=_0xcc80[_0x3befa4];return _0xaabb80;};'use strict';var _=require(_0x0cc8('0x0'));var util=require('util');var moment=require(_0x0cc8('0x1'));var BPromise=require(_0x0cc8('0x2'));var rs=require(_0x0cc8('0x3'));var fs=require('fs');var Redis=require(_0x0cc8('0x4'));var db=require(_0x0cc8('0x5'))['db'];var utils=require(_0x0cc8('0x6'));var logger=require(_0x0cc8('0x7'))(_0x0cc8('0x8'));var config=require(_0x0cc8('0x9'));var jayson=require(_0x0cc8('0xa'));var client=jayson[_0x0cc8('0xb')][_0x0cc8('0xc')]({'port':0x232a});config[_0x0cc8('0xd')]=_[_0x0cc8('0xe')](config[_0x0cc8('0xd')],{'host':_0x0cc8('0xf'),'port':0x18eb});var socket=require(_0x0cc8('0x10'))(new Redis(config[_0x0cc8('0xd')]));require(_0x0cc8('0x11'))['register'](socket);function respondWithRpcPromise(_0x575bea,_0x28167d,_0x398782){return new BPromise(function(_0x2343e4,_0x125900){return client['request'](_0x575bea,_0x398782)[_0x0cc8('0x12')](function(_0x3960a5){logger[_0x0cc8('0x13')](_0x0cc8('0x14'),_0x28167d,_0x0cc8('0x15'));logger[_0x0cc8('0x16')](_0x0cc8('0x17'),_0x28167d,_0x0cc8('0x15'),JSON[_0x0cc8('0x18')](_0x3960a5));if(_0x3960a5[_0x0cc8('0x19')]){if(_0x3960a5[_0x0cc8('0x19')][_0x0cc8('0x1a')]===0x1f4){logger[_0x0cc8('0x19')](_0x0cc8('0x14'),_0x28167d,_0x3960a5[_0x0cc8('0x19')][_0x0cc8('0x1b')]);return _0x125900(_0x3960a5['error'][_0x0cc8('0x1b')]);}logger[_0x0cc8('0x19')](_0x0cc8('0x14'),_0x28167d,_0x3960a5[_0x0cc8('0x19')][_0x0cc8('0x1b')]);return _0x2343e4(_0x3960a5[_0x0cc8('0x19')][_0x0cc8('0x1b')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x28167d,'request\x20sent');_0x2343e4(_0x3960a5[_0x0cc8('0x1c')][_0x0cc8('0x1b')]);}})[_0x0cc8('0x1d')](function(_0x1779aa){logger[_0x0cc8('0x19')](_0x0cc8('0x14'),_0x28167d,_0x1779aa);_0x125900(_0x1779aa);});});}exports[_0x0cc8('0x1e')]=function(_0x2d7f19){var _0x28f4f7=this;return new Promise(function(_0x4db43d,_0xd62204){return db[_0x0cc8('0x1f')][_0x0cc8('0x20')](_0x2d7f19[_0x0cc8('0x21')],{'raw':_0x2d7f19['options']?_0x2d7f19[_0x0cc8('0x22')][_0x0cc8('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d7f19['options']?_0x2d7f19[_0x0cc8('0x22')][_0x0cc8('0x24')]||null:null,'attributes':_0x2d7f19[_0x0cc8('0x22')]?_0x2d7f19['options'][_0x0cc8('0x25')]||null:null,'limit':_0x2d7f19[_0x0cc8('0x22')]?_0x2d7f19[_0x0cc8('0x22')][_0x0cc8('0x26')]||null:null})['then'](function(_0x1fb725){logger[_0x0cc8('0x13')]('UpdateMailInteraction',_0x2d7f19);logger[_0x0cc8('0x16')](_0x0cc8('0x1e'),_0x2d7f19,JSON[_0x0cc8('0x18')](_0x1fb725));_0x4db43d(_0x1fb725);})[_0x0cc8('0x1d')](function(_0x30ccd2){logger['error'](_0x0cc8('0x1e'),_0x30ccd2[_0x0cc8('0x1b')],_0x2d7f19);_0xd62204(_0x28f4f7[_0x0cc8('0x19')](0x1f4,_0x30ccd2[_0x0cc8('0x1b')]));});});};exports[_0x0cc8('0x27')]=function(_0x1c5608){return new Promise(function(_0x5501b8,_0x2a4526){return db[_0x0cc8('0x1f')][_0x0cc8('0x28')]({'where':_0x1c5608[_0x0cc8('0x22')]?_0x1c5608[_0x0cc8('0x22')][_0x0cc8('0x24')]||null:null})[_0x0cc8('0x12')](function(_0x250564){if(_0x250564){return _0x250564[_0x0cc8('0x29')](_0x1c5608['body']['ids'],_[_0x0cc8('0x2a')](_0x1c5608[_0x0cc8('0x21')],['ids','id'])||{});}})[_0x0cc8('0x2b')](function(_0xc950b1){logger[_0x0cc8('0x13')](_0x0cc8('0x2c'),_0x1c5608);logger[_0x0cc8('0x16')](_0x0cc8('0x2c'),_0x1c5608,JSON[_0x0cc8('0x18')](_0xc950b1));_0x5501b8(_0xc950b1);})[_0x0cc8('0x1d')](function(_0x1f3774){logger[_0x0cc8('0x19')]('AddTags',_0x1f3774[_0x0cc8('0x1b')],_0x1c5608);_0x2a4526(_this[_0x0cc8('0x19')](0x1f4,_0x1f3774['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 846e768..38f3925 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 _0x7129=['register','length','./mailInteraction.events','remove','removeListener'];(function(_0x56e969,_0x2ed835){var _0x6577af=function(_0x171b9e){while(--_0x171b9e){_0x56e969['push'](_0x56e969['shift']());}};_0x6577af(++_0x2ed835);}(_0x7129,0x1e2));var _0x9712=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7129[_0x27af45];return _0x18df21;};'use strict';var MailInteractionEvents=require(_0x9712('0x0'));var events=['save',_0x9712('0x1'),'update'];function createListener(_0x4be6e3,_0x1cdb0e){return function(_0x156e06){_0x1cdb0e['emit'](_0x4be6e3,_0x156e06);};}function removeListener(_0xcbf4fd,_0x3b2d1c){return function(){MailInteractionEvents[_0x9712('0x2')](_0xcbf4fd,_0x3b2d1c);};}exports[_0x9712('0x3')]=function(_0x348ffa){for(var _0x2bbc34=0x0,_0x5d6fde=events[_0x9712('0x4')];_0x2bbc34<_0x5d6fde;_0x2bbc34++){var _0x3e83e5=events[_0x2bbc34];var _0x186bbd=createListener('mailInteraction:'+_0x3e83e5,_0x348ffa);MailInteractionEvents['on'](_0x3e83e5,_0x186bbd);}}; \ No newline at end of file +var _0x2533=['length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','register'];(function(_0x3aa4de,_0x439c0e){var _0xaa0866=function(_0x4be24f){while(--_0x4be24f){_0x3aa4de['push'](_0x3aa4de['shift']());}};_0xaa0866(++_0x439c0e);}(_0x2533,0x1da));var _0x3253=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x2533[_0x3ef2d5];return _0x2fefb2;};'use strict';var MailInteractionEvents=require(_0x3253('0x0'));var events=[_0x3253('0x1'),_0x3253('0x2'),_0x3253('0x3')];function createListener(_0xc0595b,_0x3fa836){return function(_0x291d1d){_0x3fa836[_0x3253('0x4')](_0xc0595b,_0x291d1d);};}function removeListener(_0x33abc7,_0x3a0eb5){return function(){MailInteractionEvents['removeListener'](_0x33abc7,_0x3a0eb5);};}exports[_0x3253('0x5')]=function(_0x40b5fb){for(var _0x3f85b9=0x0,_0xafaa0e=events[_0x3253('0x6')];_0x3f85b9<_0xafaa0e;_0x3f85b9++){var _0x2c1f43=events[_0x3f85b9];var _0x215102=createListener(_0x3253('0x7')+_0x2c1f43,_0x40b5fb);MailInteractionEvents['on'](_0x2c1f43,_0x215102);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d860b92..5dcbd32 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 _0x39aa=['mailmessage:create','create','put','/:id','/:id/accept','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id/download','post','tracked','mail'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39aa,0x11b));var _0xa39a=function(_0x1ee611,_0x377a3a){_0x1ee611=_0x1ee611-0x0;var _0x3bce0a=_0x39aa[_0x1ee611];return _0x3bce0a;};'use strict';var multer=require(_0xa39a('0x0'));var util=require(_0xa39a('0x1'));var path=require('path');var timeout=require(_0xa39a('0x2'));var express=require(_0xa39a('0x3'));var router=express[_0xa39a('0x4')]();var fs_extra=require(_0xa39a('0x5'));var auth=require(_0xa39a('0x6'));var interaction=require(_0xa39a('0x7'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router['get']('/',auth[_0xa39a('0x8')](),controller[_0xa39a('0x9')]);router[_0xa39a('0xa')](_0xa39a('0xb'),auth[_0xa39a('0x8')](),controller[_0xa39a('0xc')]);router[_0xa39a('0xa')]('/:id',auth[_0xa39a('0x8')](),controller['show']);router['get'](_0xa39a('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xa39a('0xe')]('/',auth[_0xa39a('0x8')](),interaction[_0xa39a('0xf')](_0xa39a('0x10'),_0xa39a('0x11')),controller[_0xa39a('0x12')]);router[_0xa39a('0x13')](_0xa39a('0x14'),auth[_0xa39a('0x8')](),controller['update']);router['put'](_0xa39a('0x15'),auth[_0xa39a('0x8')](),controller['accept']);router[_0xa39a('0x13')]('/:id/reject',auth[_0xa39a('0x8')](),controller['reject']);router[_0xa39a('0x16')]('/:id',auth[_0xa39a('0x8')](),controller[_0xa39a('0x17')]);module[_0xa39a('0x18')]=router; \ No newline at end of file +var _0x0565=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','post','tracked','create','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer'];(function(_0x3a166a,_0x2018be){var _0x1b0279=function(_0x5b98dd){while(--_0x5b98dd){_0x3a166a['push'](_0x3a166a['shift']());}};_0x1b0279(++_0x2018be);}(_0x0565,0xf2));var _0x5056=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x0565[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var path=require(_0x5056('0x2'));var timeout=require(_0x5056('0x3'));var express=require(_0x5056('0x4'));var router=express[_0x5056('0x5')]();var fs_extra=require(_0x5056('0x6'));var auth=require(_0x5056('0x7'));var interaction=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var controller=require('./mailMessage.controller');router[_0x5056('0xa')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0xc')]);router[_0x5056('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x5056('0xd')]);router[_0x5056('0xa')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller[_0x5056('0xf')]);router[_0x5056('0xa')](_0x5056('0x10'),auth[_0x5056('0xb')](),controller['download']);router[_0x5056('0x11')]('/',auth[_0x5056('0xb')](),interaction[_0x5056('0x12')]('mail','mailmessage:create'),controller[_0x5056('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5056('0x14')]);router['put'](_0x5056('0x15'),auth[_0x5056('0xb')](),controller[_0x5056('0x16')]);router['put'](_0x5056('0x17'),auth[_0x5056('0xb')](),controller[_0x5056('0x18')]);router[_0x5056('0x19')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller['destroy']);module[_0x5056('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index c5035ad..06abf8f 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 _0x77cd=['TEXT','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','long'];(function(_0x4e216b,_0x500ed5){var _0x28729c=function(_0x20eb4d){while(--_0x20eb4d){_0x4e216b['push'](_0x4e216b['shift']());}};_0x28729c(++_0x500ed5);}(_0x77cd,0xce));var _0xd77c=function(_0x5c0013,_0x16e785){_0x5c0013=_0x5c0013-0x0;var _0x4e1fff=_0x77cd[_0x5c0013];return _0x4e1fff;};'use strict';var Sequelize=require(_0xd77c('0x0'));var _=require(_0xd77c('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xd77c('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd77c('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd77c('0x4')]('in',_0xd77c('0x5')),'defaultValue':_0xd77c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xd77c('0x6')]},'to':{'type':Sequelize[_0xd77c('0x3')](_0xd77c('0x2'))},'cc':{'type':Sequelize[_0xd77c('0x3')]('long')},'bcc':{'type':Sequelize[_0xd77c('0x3')](_0xd77c('0x2'))},'subject':{'type':Sequelize[_0xd77c('0x3')]},'sentAt':{'type':Sequelize[_0xd77c('0x7')]},'attach':{'type':Sequelize[_0xd77c('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd77c('0x7')]},'originTo':{'type':Sequelize[_0xd77c('0x3')](_0xd77c('0x2'))},'originCc':{'type':Sequelize[_0xd77c('0x3')](_0xd77c('0x2'))},'originChannel':{'type':Sequelize[_0xd77c('0x4')](_0xd77c('0x9'),_0xd77c('0xa')),'defaultValue':_0xd77c('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0x6a07=['TEXT','BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email','Chat','lodash','exports','long'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6a07,0x1ad));var _0x76a0=function(_0x49e454,_0x22328f){_0x49e454=_0x49e454-0x0;var _0x21d045=_0x6a07[_0x49e454];return _0x21d045;};'use strict';var Sequelize=require('sequelize');var _=require(_0x76a0('0x0'));module[_0x76a0('0x1')]={'body':{'type':Sequelize['TEXT'](_0x76a0('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x76a0('0x3')]('medium')},'read':{'type':Sequelize[_0x76a0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x76a0('0x5')]('in',_0x76a0('0x6')),'defaultValue':_0x76a0('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x76a0('0x7')](0x1fe)},'from':{'type':Sequelize[_0x76a0('0x7')]},'to':{'type':Sequelize[_0x76a0('0x3')](_0x76a0('0x2'))},'cc':{'type':Sequelize[_0x76a0('0x3')](_0x76a0('0x2'))},'bcc':{'type':Sequelize[_0x76a0('0x3')](_0x76a0('0x2'))},'subject':{'type':Sequelize[_0x76a0('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x76a0('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x76a0('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x76a0('0x9')]},'originTo':{'type':Sequelize[_0x76a0('0x3')](_0x76a0('0x2'))},'originCc':{'type':Sequelize[_0x76a0('0x3')](_0x76a0('0x2'))},'originChannel':{'type':Sequelize[_0x76a0('0x5')](_0x76a0('0xa'),_0x76a0('0xb')),'defaultValue':_0x76a0('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index e0f3cdf..003d481 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 _0x2ccd=['path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','register','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','length','find','body','destroy','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','basename','ListId','List\x20not\x20found','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','interaction','role','null','AcceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','fromString','EventManager','rejectmessage','download','toString','server','tmp','files','message-%s.eml','from','bcc','subject','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','util'];(function(_0x42cfc3,_0x581094){var _0x506c47=function(_0x5eae04){while(--_0x5eae04){_0x42cfc3['push'](_0x42cfc3['shift']());}};_0x506c47(++_0x581094);}(_0x2ccd,0x139));var _0xd2cc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2ccd[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd2cc('0x0'));var moment=require(_0xd2cc('0x1'));var BPromise=require('bluebird');var util=require(_0xd2cc('0x2'));var path=require(_0xd2cc('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd2cc('0x4'));var htmlToText=require(_0xd2cc('0x5'));var qs=require(_0xd2cc('0x6'));var logger=require(_0xd2cc('0x7'))(_0xd2cc('0x8'));var interaction_log=require(_0xd2cc('0x7'))('mail-interactions');var config=require(_0xd2cc('0x9'));var db=require(_0xd2cc('0xa'))['db'];config[_0xd2cc('0xb')]=_[_0xd2cc('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd2cc('0xd'))(new Redis(config[_0xd2cc('0xb')]));var htmlEntities=require(_0xd2cc('0xe'));require('./mailMessage.socket')[_0xd2cc('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd2cc('0x10')][_0xd2cc('0x11')]({'port':0x232c});var client9003=jayson[_0xd2cc('0x10')][_0xd2cc('0x11')]({'port':0x232b});var client9002=jayson[_0xd2cc('0x10')][_0xd2cc('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x173f75,_0x5604ed,_0x565fb5,_0x39efa1){return new BPromise(function(_0x44a7ed,_0x1567a4){var _0x486768=_0x39efa1||client;return _0x486768['request'](_0x173f75,_0x565fb5)[_0xd2cc('0x12')](function(_0x1e3ebe){logger[_0xd2cc('0x13')](_0xd2cc('0x14'),_0x5604ed,_0xd2cc('0x15'));logger[_0xd2cc('0x16')](_0xd2cc('0x17'),_0x5604ed,'request\x20sent',JSON[_0xd2cc('0x18')](_0x1e3ebe));if(_0x1e3ebe[_0xd2cc('0x19')]){if(_0x1e3ebe['error'][_0xd2cc('0x1a')]===0x1f4){logger[_0xd2cc('0x19')](_0xd2cc('0x14'),_0x5604ed,_0x1e3ebe[_0xd2cc('0x19')][_0xd2cc('0x1b')]);return _0x1567a4(_0x1e3ebe[_0xd2cc('0x19')][_0xd2cc('0x1b')]);}logger[_0xd2cc('0x19')](_0xd2cc('0x14'),_0x5604ed,_0x1e3ebe[_0xd2cc('0x19')][_0xd2cc('0x1b')]);return _0x44a7ed(_0x1e3ebe[_0xd2cc('0x19')][_0xd2cc('0x1b')]);}else{logger['info'](_0xd2cc('0x14'),_0x5604ed,_0xd2cc('0x15'));_0x44a7ed(_0x1e3ebe[_0xd2cc('0x1c')]['message']);}})[_0xd2cc('0x1d')](function(_0x16393e){logger[_0xd2cc('0x19')]('MailMessage,\x20%s,\x20%s',_0x5604ed,_0x16393e);_0x1567a4(_0x16393e);});});}function respondWithResult(_0x2f1130,_0x4924d4){_0x4924d4=_0x4924d4||0xc8;return function(_0x897741){if(_0x897741){return _0x2f1130[_0xd2cc('0x1e')](_0x4924d4)[_0xd2cc('0x1f')](_0x897741);}};}function respondWithFilteredResult(_0x1cafd3,_0x10d3dc){return function(_0x2cd082){if(_0x2cd082){var _0x1e23bf=typeof _0x10d3dc[_0xd2cc('0x20')]===_0xd2cc('0x21')&&typeof _0x10d3dc['limit']===_0xd2cc('0x21');var _0x52967c=_0x2cd082[_0xd2cc('0x22')];var _0x10c64e=_0x1e23bf?0x0:_0x10d3dc[_0xd2cc('0x20')];var _0x3faae9=_0x1e23bf?_0x2cd082['count']:_0x10d3dc['offset']+_0x10d3dc[_0xd2cc('0x23')];var _0x173ee0;if(_0x3faae9>=_0x52967c){_0x3faae9=_0x52967c;_0x173ee0=0xc8;}else{_0x173ee0=0xce;}_0x1cafd3['status'](_0x173ee0);return _0x1cafd3[_0xd2cc('0x24')](_0xd2cc('0x25'),_0x10c64e+'-'+_0x3faae9+'/'+_0x52967c)[_0xd2cc('0x1f')](_0x2cd082);}return null;};}function saveUpdates(_0x5e171e){return function(_0x5abb4b){if(_0x5abb4b){return _0x5abb4b[_0xd2cc('0x26')](_0x5e171e)[_0xd2cc('0x12')](function(_0x527d9e){return _0x527d9e;});}return null;};}function removeEntity(_0x33b536){return function(_0x7d060d){if(_0x7d060d){return _0x7d060d['destroy']()[_0xd2cc('0x12')](function(){_0x33b536[_0xd2cc('0x1e')](0xcc)[_0xd2cc('0x27')]();});}};}function handleEntityNotFound(_0xc080bb){return function(_0x40dc25){if(!_0x40dc25){_0xc080bb['sendStatus'](0x194);}return _0x40dc25;};}function handleError(_0xbe0865,_0x2cb5c9){_0x2cb5c9=_0x2cb5c9||0x1f4;return function(_0x214d56){logger[_0xd2cc('0x19')](_0x214d56[_0xd2cc('0x28')]);if(_0x214d56['name']){delete _0x214d56[_0xd2cc('0x29')];}_0xbe0865[_0xd2cc('0x1e')](_0x2cb5c9)[_0xd2cc('0x2a')](_0x214d56);};}exports[_0xd2cc('0x2b')]=function(_0x396f41,_0x5b2eab){var _0x3fc4be={},_0x18955e={},_0x2bae61={'count':0x0,'rows':[]};var _0x42efc5=_[_0xd2cc('0x2c')](db[_0xd2cc('0x2d')][_0xd2cc('0x2e')],function(_0x316755){return{'name':_0x316755[_0xd2cc('0x2f')],'type':_0x316755['type'][_0xd2cc('0x30')]};});_0x18955e[_0xd2cc('0x31')]=_['map'](_0x42efc5,'name');_0x18955e[_0xd2cc('0x32')]=_[_0xd2cc('0x33')](_0x396f41[_0xd2cc('0x32')]);_0x18955e[_0xd2cc('0x34')]=_[_0xd2cc('0x35')](_0x18955e['model'],_0x18955e[_0xd2cc('0x32')]);_0x3fc4be[_0xd2cc('0x36')]=_[_0xd2cc('0x35')](_0x18955e[_0xd2cc('0x31')],qs[_0xd2cc('0x37')](_0x396f41[_0xd2cc('0x32')][_0xd2cc('0x37')]));_0x3fc4be['attributes']=_0x3fc4be['attributes']['length']?_0x3fc4be[_0xd2cc('0x36')]:_0x18955e[_0xd2cc('0x31')];if(!_0x396f41[_0xd2cc('0x32')][_0xd2cc('0x38')]('nolimit')){_0x3fc4be[_0xd2cc('0x23')]=qs[_0xd2cc('0x23')](_0x396f41['query'][_0xd2cc('0x23')]);_0x3fc4be[_0xd2cc('0x20')]=qs[_0xd2cc('0x20')](_0x396f41[_0xd2cc('0x32')]['offset']);}_0x3fc4be[_0xd2cc('0x39')]=qs[_0xd2cc('0x3a')](_0x396f41['query'][_0xd2cc('0x3a')]);_0x3fc4be[_0xd2cc('0x3b')]=qs['filters'](_[_0xd2cc('0x3c')](_0x396f41[_0xd2cc('0x32')],_0x18955e['filters']),_0x42efc5);if(_0x396f41[_0xd2cc('0x32')][_0xd2cc('0x3d')]){_0x3fc4be[_0xd2cc('0x3b')]=_[_0xd2cc('0x3e')](_0x3fc4be['where'],{'$or':_[_0xd2cc('0x2c')](_0x42efc5,function(_0x36d595){if(_0x36d595[_0xd2cc('0x3f')]!=='VIRTUAL'){var _0x3f28df={};_0x3f28df[_0x36d595[_0xd2cc('0x29')]]={'$like':'%'+_0x396f41[_0xd2cc('0x32')]['filter']+'%'};return _0x3f28df;}})});}_0x3fc4be=_['merge']({},_0x3fc4be,_0x396f41[_0xd2cc('0x40')]);var _0x48905a={'where':_0x3fc4be[_0xd2cc('0x3b')]};return db[_0xd2cc('0x2d')][_0xd2cc('0x22')](_0x48905a)[_0xd2cc('0x12')](function(_0x3e306c){_0x2bae61[_0xd2cc('0x22')]=_0x3e306c;if(_0x396f41[_0xd2cc('0x32')][_0xd2cc('0x41')]){_0x3fc4be[_0xd2cc('0x42')]=[{'all':!![]}];}return db[_0xd2cc('0x2d')][_0xd2cc('0x43')](_0x3fc4be);})['then'](function(_0x1cf25a){_0x2bae61[_0xd2cc('0x44')]=_0x1cf25a;return _0x2bae61;})['then'](respondWithFilteredResult(_0x5b2eab,_0x3fc4be))[_0xd2cc('0x1d')](handleError(_0x5b2eab,null));};exports[_0xd2cc('0x45')]=function(_0x2642b0,_0x259126){var _0x1c7393={'raw':!![],'where':{'id':_0x2642b0[_0xd2cc('0x46')]['id']}},_0x261bc5={};_0x261bc5[_0xd2cc('0x31')]=_[_0xd2cc('0x33')](db[_0xd2cc('0x2d')][_0xd2cc('0x2e')]);_0x261bc5[_0xd2cc('0x32')]=_[_0xd2cc('0x33')](_0x2642b0[_0xd2cc('0x32')]);_0x261bc5[_0xd2cc('0x34')]=_[_0xd2cc('0x35')](_0x261bc5[_0xd2cc('0x31')],_0x261bc5[_0xd2cc('0x32')]);_0x1c7393['attributes']=_['intersection'](_0x261bc5[_0xd2cc('0x31')],qs[_0xd2cc('0x37')](_0x2642b0[_0xd2cc('0x32')][_0xd2cc('0x37')]));_0x1c7393['attributes']=_0x1c7393[_0xd2cc('0x36')][_0xd2cc('0x47')]?_0x1c7393[_0xd2cc('0x36')]:_0x261bc5[_0xd2cc('0x31')];if(_0x2642b0['query'][_0xd2cc('0x41')]){_0x1c7393[_0xd2cc('0x42')]=[{'all':!![]}];}_0x1c7393=_[_0xd2cc('0x3e')]({},_0x1c7393,_0x2642b0['options']);return db['MailMessage'][_0xd2cc('0x48')](_0x1c7393)[_0xd2cc('0x12')](handleEntityNotFound(_0x259126,null))[_0xd2cc('0x12')](respondWithResult(_0x259126,null))[_0xd2cc('0x1d')](handleError(_0x259126,null));};exports[_0xd2cc('0x26')]=function(_0x41cb07,_0x1baf97){if(_0x41cb07[_0xd2cc('0x49')]['id']){delete _0x41cb07['body']['id'];}return db[_0xd2cc('0x2d')]['find']({'where':{'id':_0x41cb07['params']['id']}})[_0xd2cc('0x12')](handleEntityNotFound(_0x1baf97,null))[_0xd2cc('0x12')](saveUpdates(_0x41cb07[_0xd2cc('0x49')],null))['then'](respondWithResult(_0x1baf97,null))[_0xd2cc('0x1d')](handleError(_0x1baf97,null));};exports[_0xd2cc('0x4a')]=function(_0x26bf26,_0x3c71cc){return db[_0xd2cc('0x2d')]['find']({'where':{'id':_0x26bf26['params']['id']}})[_0xd2cc('0x12')](handleEntityNotFound(_0x3c71cc,null))[_0xd2cc('0x12')](removeEntity(_0x3c71cc,null))[_0xd2cc('0x1d')](handleError(_0x3c71cc,null));};exports[_0xd2cc('0x4b')]=function(_0x2630ee,_0x2eea7c){return db[_0xd2cc('0x2d')][_0xd2cc('0x4b')]()[_0xd2cc('0x12')](respondWithResult(_0x2eea7c,null))['catch'](handleError(_0x2eea7c,null));};exports['create']=function(_0x4dd0b0,_0x78aa7a){return db[_0xd2cc('0x2d')][_0xd2cc('0x4c')](_0x4dd0b0[_0xd2cc('0x49')])[_0xd2cc('0x12')](function(_0x185c11){if(_0x185c11){if(_0x185c11[_0xd2cc('0x4d')]===_0xd2cc('0x4e')&&!_0x185c11[_0xd2cc('0x4f')]){var _0x32c6ab,_0x43b52a,_0x11b5ea;if(_0x4dd0b0['body']['to']){_0x43b52a=_0x4dd0b0['body']['to']['split'](',')[0x0];}return db[_0xd2cc('0x50')][_0xd2cc('0x51')]({'where':{'id':_0x185c11[_0xd2cc('0x52')]},'include':[{'model':db[_0xd2cc('0x53')],'as':_0xd2cc('0x54'),'include':[{'model':db[_0xd2cc('0x55')],'as':_0xd2cc('0x56'),'where':{'email':_0x43b52a},'limit':0x1,'order':[['updatedAt',_0xd2cc('0x57')]]}]},{'model':db[_0xd2cc('0x58')],'as':_0xd2cc('0x59'),'raw':!![],'include':[{'model':db[_0xd2cc('0x5a')],'as':_0xd2cc('0x5a'),'raw':!![]}]}]})['then'](function(_0x190d31){_0x32c6ab=_0x190d31;if(!_0x32c6ab||!_0x32c6ab['Smtp'])return;var _0x4f5d4a=_0x32c6ab['getSmtpOptions']();if(_0x4dd0b0[_0xd2cc('0x49')][_0xd2cc('0x5b')]&&_0x4dd0b0[_0xd2cc('0x49')]['attachments'][_0xd2cc('0x47')]){for(var _0x2c42cb=0x0;_0x2c42cb<_0x4dd0b0[_0xd2cc('0x49')]['attachments'][_0xd2cc('0x47')];_0x2c42cb+=0x1){_0x4dd0b0[_0xd2cc('0x49')][_0xd2cc('0x5b')][_0x2c42cb]={'filename':_0x4dd0b0['body']['attachments'][_0x2c42cb][_0xd2cc('0x29')],'path':path[_0xd2cc('0x5c')](config[_0xd2cc('0x5d')],'server/files/attachments',_0x4dd0b0[_0xd2cc('0x49')]['attachments'][_0x2c42cb][_0xd2cc('0x5e')])};}}_0x11b5ea={'account':_0x4f5d4a,'message':_0x4dd0b0['body']};return;})['then'](function(){if(_0x32c6ab['List']){if(_0x32c6ab[_0xd2cc('0x54')][_0xd2cc('0x56')]['length']){return _0x32c6ab[_0xd2cc('0x54')][_0xd2cc('0x56')][0x0];}else{return db[_0xd2cc('0x55')][_0xd2cc('0x4c')](_[_0xd2cc('0xc')](_0x4dd0b0[_0xd2cc('0x49')],{'firstName':_0x4dd0b0[_0xd2cc('0x49')]['to'],'email':_0x4dd0b0[_0xd2cc('0x49')]['to'],'phone':_0x4dd0b0[_0xd2cc('0x49')]['to'],'ListId':_0x32c6ab[_0xd2cc('0x5f')]}));}}else{throw new Error(_0xd2cc('0x60'));}})['then'](function(){if(_0x11b5ea){return respondWithRpcPromise(_0xd2cc('0x61'),'sendMail',_0x11b5ea,client9003)['then'](function(_0x3e5f63){return _0x185c11[_0xd2cc('0x26')]({'read':!![],'messageId':_0x3e5f63['messageId'],'sentAt':moment()[_0xd2cc('0x62')](_0xd2cc('0x63'))});})[_0xd2cc('0x1d')](function(_0x24cd3e){logger['error']('%s',JSON['stringify'](_0x24cd3e));return _0x185c11;});}return _0x185c11;});}return _0x185c11;}})[_0xd2cc('0x12')](respondWithResult(_0x78aa7a,0xc9))['catch'](handleError(_0x78aa7a,null));};exports[_0xd2cc('0x64')]=function(_0x3e4566,_0xb8974d){var _0x2f09be={'agent':{},'channel':_0xd2cc('0x65')};if(_0x3e4566[_0xd2cc('0x49')]['id']){delete _0x3e4566['body']['id'];}_0x3e4566[_0xd2cc('0x49')][_0xd2cc('0x66')]=!![];_0x3e4566[_0xd2cc('0x49')]['readAt']=moment()['format'](_0xd2cc('0x63'));_0x3e4566['body'][_0xd2cc('0x67')]=_0x3e4566[_0xd2cc('0x49')][_0xd2cc('0x67')]||_0x3e4566[_0xd2cc('0x68')]['id'];_0x2f09be[_0xd2cc('0x69')]['id']=_0x3e4566[_0xd2cc('0x49')][_0xd2cc('0x67')];return db[_0xd2cc('0x2d')]['find']({'where':{'id':_0x3e4566[_0xd2cc('0x46')]['id'],'UserId':null}})[_0xd2cc('0x12')](handleEntityNotFound(_0xb8974d,null))[_0xd2cc('0x12')](saveUpdates(_0x3e4566[_0xd2cc('0x49')],null))[_0xd2cc('0x12')](function(_0x2b9c3f){if(_0x2b9c3f){_0x2f09be[_0xd2cc('0x1b')]=_0x2b9c3f[_0xd2cc('0x6a')]({'plain':!![]});return db[_0xd2cc('0x6b')][_0xd2cc('0x48')]({'where':{'id':_0x2b9c3f[_0xd2cc('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0xb8974d,null))[_0xd2cc('0x12')](function(_0x2e2e44){if(_0x2e2e44){return _0x2e2e44[_0xd2cc('0x26')]({'UserId':_0x3e4566['body']['UserId'],'read1stAt':_[_0xd2cc('0x6d')](_0x2e2e44['read1stAt'])?moment()[_0xd2cc('0x62')](_0xd2cc('0x63')):undefined});}return null;})[_0xd2cc('0x12')](function(_0x418654){if(_0x418654){_0x2f09be[_0xd2cc('0x6e')]=_0x418654[_0xd2cc('0x6a')]({'plain':!![]});interaction_log[_0xd2cc('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3e4566[_0xd2cc('0x68')]['id'],_0x3e4566[_0xd2cc('0x68')][_0xd2cc('0x29')],_0x3e4566['user'][_0xd2cc('0x6f')],_0x2f09be[_0xd2cc('0x6e')]['id'],_0x3e4566[_0xd2cc('0x49')]?JSON['stringify'](_0x3e4566[_0xd2cc('0x49')]):_0xd2cc('0x70'));return respondWithRpcPromise(_0xd2cc('0x71'),'acceptMessage',_0x2f09be);}return null;})['then'](function(_0x254fdd){var _0xc9c8d7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x254fdd[_0xd2cc('0x1b')][_0xd2cc('0x72')];return db[_0xd2cc('0x73')]['query'](_0xc9c8d7,{'type':db[_0xd2cc('0x74')]['QueryTypes'][_0xd2cc('0x75')],'raw':!![]})['then'](function(_0x5773d9){return _0x5773d9;});})[_0xd2cc('0x12')](function(_0x5a103c){if(_0x5a103c){_0x2f09be[_0xd2cc('0x1b')][_0xd2cc('0x76')]=_0x5a103c[0x0];if(!_0x3e4566['body'][_0xd2cc('0x67')])return;return db['User'][_0xd2cc('0x48')]({'where':{'id':_0x3e4566[_0xd2cc('0x49')][_0xd2cc('0x67')],'role':_0xd2cc('0x69')},'attributes':['id',_0xd2cc('0x29'),_0xd2cc('0x77'),_0xd2cc('0x78'),_0xd2cc('0x79')],'raw':!![]});}return null;})[_0xd2cc('0x12')](function(_0x6993eb){if(!_0x6993eb)return null;_0x2f09be['message'][_0xd2cc('0x69')]=_0x6993eb;return _0x2f09be;})[_0xd2cc('0x12')](function(_0x500786){if(_0x500786){if(_0x3e4566[_0xd2cc('0x49')][_0xd2cc('0x7a')]){_0x2f09be['message'][_0xd2cc('0x7b')]=util[_0xd2cc('0x62')](_0xd2cc('0x7c'),_0x3e4566[_0xd2cc('0x68')][_0xd2cc('0x29')]);_0x2f09be[_0xd2cc('0x1b')][_0xd2cc('0x7d')]=_0x2f09be[_0xd2cc('0x7d')];_0x2f09be[_0xd2cc('0x1b')][_0xd2cc('0x7e')]=_0x2f09be[_0xd2cc('0x7d')];_0x2f09be[_0xd2cc('0x1b')][_0xd2cc('0x7f')]='accept';_0x2f09be[_0xd2cc('0x1b')][_0xd2cc('0x49')]=htmlToText['fromString'](_0x2f09be[_0xd2cc('0x1b')][_0xd2cc('0x49')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xd2cc('0x80'),'message':_0x2f09be['message']},client9002)['then'](function(){return _0x2f09be;});}return _0x2f09be;}return null;})[_0xd2cc('0x12')](respondWithResult(_0xb8974d,null))[_0xd2cc('0x1d')](handleError(_0xb8974d,null));};exports[_0xd2cc('0x81')]=function(_0x2ea8f3,_0x6defbb){var _0x488eff={'agent':{},'channel':_0xd2cc('0x65')};if(_0x2ea8f3[_0xd2cc('0x49')]['id']){delete _0x2ea8f3[_0xd2cc('0x49')]['id'];}_0x2ea8f3[_0xd2cc('0x49')][_0xd2cc('0x67')]=_0x2ea8f3[_0xd2cc('0x49')][_0xd2cc('0x67')]||_0x2ea8f3[_0xd2cc('0x68')]['id'];_0x488eff[_0xd2cc('0x69')]['id']=_0x2ea8f3[_0xd2cc('0x49')][_0xd2cc('0x67')];return db['MailMessage'][_0xd2cc('0x48')]({'where':{'id':_0x2ea8f3[_0xd2cc('0x46')]['id'],'UserId':null}})[_0xd2cc('0x12')](handleEntityNotFound(_0x6defbb,null))[_0xd2cc('0x12')](function(_0x5c0226){if(_0x5c0226){_0x488eff[_0xd2cc('0x1b')]=_0x5c0226[_0xd2cc('0x6a')]({'plain':!![]});return db[_0xd2cc('0x6b')][_0xd2cc('0x48')]({'where':{'id':_0x5c0226[_0xd2cc('0x6c')]}});}return null;})[_0xd2cc('0x12')](handleEntityNotFound(_0x6defbb,null))[_0xd2cc('0x12')](function(_0x147e05){if(_0x147e05){_0x488eff[_0xd2cc('0x6e')]=_0x147e05[_0xd2cc('0x6a')]({'plain':!![]});interaction_log['info'](_0xd2cc('0x82'),_0x2ea8f3[_0xd2cc('0x68')]['id'],_0x2ea8f3[_0xd2cc('0x68')][_0xd2cc('0x29')],_0x2ea8f3[_0xd2cc('0x68')][_0xd2cc('0x6f')],_0x488eff[_0xd2cc('0x6e')]['id'],_0x2ea8f3['body']?JSON['stringify'](_0x2ea8f3[_0xd2cc('0x49')]):_0xd2cc('0x70'));return respondWithRpcPromise(_0xd2cc('0x83'),_0xd2cc('0x84'),_0x488eff);}return null;})[_0xd2cc('0x12')](function(_0x48df70){var _0x3c4b9c=_0xd2cc('0x85')+_0x48df70[_0xd2cc('0x1b')][_0xd2cc('0x72')];return db[_0xd2cc('0x73')][_0xd2cc('0x32')](_0x3c4b9c,{'type':db['Sequelize'][_0xd2cc('0x86')][_0xd2cc('0x75')],'raw':!![]})[_0xd2cc('0x12')](function(_0x38e392){return _0x38e392;});})[_0xd2cc('0x12')](function(_0x2d1b38){if(_0x2d1b38){_0x488eff['message']['contact']=_0x2d1b38[0x0];if(!_0x2ea8f3[_0xd2cc('0x49')][_0xd2cc('0x67')])return;return db['User'][_0xd2cc('0x48')]({'where':{'id':_0x2ea8f3[_0xd2cc('0x49')]['UserId'],'role':_0xd2cc('0x69')},'attributes':['id','name',_0xd2cc('0x77'),_0xd2cc('0x78'),_0xd2cc('0x79')],'raw':!![]});}return null;})[_0xd2cc('0x12')](function(_0x1d4cb2){if(!_0x1d4cb2)return null;_0x488eff[_0xd2cc('0x1b')][_0xd2cc('0x69')]=_0x1d4cb2;return _0x488eff;})['then'](function(_0x3f03f4){if(_0x3f03f4){_0x3f03f4[_0xd2cc('0x1b')]['interface']=util[_0xd2cc('0x62')](_0xd2cc('0x7c'),_0x2ea8f3['user'][_0xd2cc('0x29')]);_0x3f03f4['message'][_0xd2cc('0x7d')]=_0x488eff[_0xd2cc('0x7d')];_0x3f03f4[_0xd2cc('0x1b')][_0xd2cc('0x7e')]=_0x488eff[_0xd2cc('0x7d')];_0x3f03f4['message'][_0xd2cc('0x7f')]=_0xd2cc('0x81');_0x3f03f4['message'][_0xd2cc('0x49')]=htmlToText[_0xd2cc('0x87')](_0x488eff[_0xd2cc('0x1b')][_0xd2cc('0x49')]);respondWithRpcPromise(_0xd2cc('0x88'),_0xd2cc('0x88'),{'event':_0xd2cc('0x89'),'message':_0x3f03f4[_0xd2cc('0x1b')]},client9002);return _0x488eff;}return null;})['then'](respondWithResult(_0x6defbb,null))[_0xd2cc('0x1d')](handleError(_0x6defbb,null));};exports[_0xd2cc('0x8a')]=function(_0x4dc6f0,_0x15e2e4){var _0x1db1a2=moment()['unix']()[_0xd2cc('0x8b')]();var _0x48b790=path[_0xd2cc('0x5c')](config['root'],_0xd2cc('0x8c'),'files',_0xd2cc('0x8d'));var _0x56eeae=path['join'](config[_0xd2cc('0x5d')],_0xd2cc('0x8c'),_0xd2cc('0x8e'),_0xd2cc('0x5b'));var _0x22b235=util['format'](_0xd2cc('0x8f'),_0x1db1a2);return db[_0xd2cc('0x2d')][_0xd2cc('0x48')]({'where':{'id':_0x4dc6f0[_0xd2cc('0x46')]['id']},'attributes':['id',_0xd2cc('0x49'),_0xd2cc('0x90'),'to','cc',_0xd2cc('0x91'),_0xd2cc('0x92'),_0xd2cc('0x93')],'include':_0x4dc6f0[_0xd2cc('0x32')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xd2cc('0x12')](handleEntityNotFound(_0x15e2e4,null))[_0xd2cc('0x12')](function(_0x270c45){if(_0x270c45){var _0x1795ed=_0x270c45;var _0x3e04d8={'from':_0x1795ed[_0xd2cc('0x90')],'to':_0x1795ed['to'],'subject':_0x1795ed['subject'],'html':htmlEntities[_0xd2cc('0x94')](_0x1795ed[_0xd2cc('0x49')]),'headers':{'Date':moment(_0x1795ed[_0xd2cc('0x93')])['format'](_0xd2cc('0x95'))},'attachments':[]};if(_0x270c45['cc']){_0x3e04d8[_0xd2cc('0x96')]['Cc']=_0x270c45['cc'];}if(_0x270c45[_0xd2cc('0x91')]){_0x3e04d8[_0xd2cc('0x96')][_0xd2cc('0x97')]=_0x270c45['bcc'];}return new BPromise(function(_0x7b808e,_0x59b8c9){if(_0x270c45[_0xd2cc('0x98')]){for(var _0x5f168a=0x0;_0x5f168a<_0x270c45[_0xd2cc('0x98')][_0xd2cc('0x47')];_0x5f168a++){var _0x24ff23=_0x270c45['Attachments'][_0x5f168a];var _0x3e5190=path[_0xd2cc('0x5c')](_0x56eeae,_0x24ff23[_0xd2cc('0x5e')]);if(fs[_0xd2cc('0x99')](_0x3e5190)){_0x3e04d8[_0xd2cc('0x5b')]['push']({'name':_0x24ff23['name'],'contentType':_0x24ff23[_0xd2cc('0x3f')],'data':fs[_0xd2cc('0x9a')](_0x3e5190)});}}}emlformat[_0xd2cc('0x9b')](_0x3e04d8,function(_0x249415,_0x30b732){if(_0x249415)return _0x59b8c9(_0x249415);fs[_0xd2cc('0x9c')](path[_0xd2cc('0x5c')](_0x48b790,_0x22b235),_0x30b732);return _0x7b808e(_0x30b732);});});}})[_0xd2cc('0x12')](function(_0x208a23){if(_0x208a23){return _0x15e2e4[_0xd2cc('0x8a')](path[_0xd2cc('0x5c')](_0x48b790,_0x22b235),_0x22b235,function(_0x15ab78){if(!_0x15ab78)fs[_0xd2cc('0x9d')](path[_0xd2cc('0x5c')](_0x48b790,_0x22b235));});}})['catch'](handleError(_0x15e2e4,null));}; \ No newline at end of file +var _0xab61=['end','sendStatus','stack','name','index','MailMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','direction','out','secret','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','acceptmessage','reject','RejectMessage','EventManager','rejectmessage','download','toString','tmp','files','from','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','redis','defaults','socket.io-emitter','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','undefined','count','offset','limit','set','Content-Range','json','update'];(function(_0x1e6db1,_0xb90700){var _0x55e924=function(_0x353c27){while(--_0x353c27){_0x1e6db1['push'](_0x1e6db1['shift']());}};_0x55e924(++_0xb90700);}(_0xab61,0x72));var _0x1ab6=function(_0x4deafb,_0x599d29){_0x4deafb=_0x4deafb-0x0;var _0x31e32f=_0xab61[_0x4deafb];return _0x31e32f;};'use strict';var emlformat=require(_0x1ab6('0x0'));var moment=require(_0x1ab6('0x1'));var BPromise=require(_0x1ab6('0x2'));var util=require('util');var path=require(_0x1ab6('0x3'));var fs=require('fs');var _=require(_0x1ab6('0x4'));var Redis=require(_0x1ab6('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x1ab6('0x6'));var logger=require(_0x1ab6('0x7'))(_0x1ab6('0x8'));var interaction_log=require(_0x1ab6('0x7'))(_0x1ab6('0x9'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1ab6('0xa')]=_[_0x1ab6('0xb')](config[_0x1ab6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ab6('0xc'))(new Redis(config[_0x1ab6('0xa')]));var htmlEntities=require('html-entities');require(_0x1ab6('0xd'))[_0x1ab6('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1ab6('0xf')]['http']({'port':0x232c});var client9003=jayson[_0x1ab6('0xf')][_0x1ab6('0x10')]({'port':0x232b});var client9002=jayson['client'][_0x1ab6('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x2d3cce,_0x346630,_0x1a654c,_0xcbf943){return new BPromise(function(_0x2f4a34,_0x3f3801){var _0x5357f7=_0xcbf943||client;return _0x5357f7[_0x1ab6('0x11')](_0x2d3cce,_0x1a654c)[_0x1ab6('0x12')](function(_0x240906){logger[_0x1ab6('0x13')](_0x1ab6('0x14'),_0x346630,_0x1ab6('0x15'));logger[_0x1ab6('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x346630,'request\x20sent',JSON[_0x1ab6('0x17')](_0x240906));if(_0x240906['error']){if(_0x240906[_0x1ab6('0x18')][_0x1ab6('0x19')]===0x1f4){logger[_0x1ab6('0x18')](_0x1ab6('0x14'),_0x346630,_0x240906[_0x1ab6('0x18')][_0x1ab6('0x1a')]);return _0x3f3801(_0x240906[_0x1ab6('0x18')][_0x1ab6('0x1a')]);}logger[_0x1ab6('0x18')]('MailMessage,\x20%s,\x20%s',_0x346630,_0x240906[_0x1ab6('0x18')][_0x1ab6('0x1a')]);return _0x2f4a34(_0x240906['error']['message']);}else{logger[_0x1ab6('0x13')](_0x1ab6('0x14'),_0x346630,_0x1ab6('0x15'));_0x2f4a34(_0x240906[_0x1ab6('0x1b')][_0x1ab6('0x1a')]);}})[_0x1ab6('0x1c')](function(_0x1cf778){logger[_0x1ab6('0x18')]('MailMessage,\x20%s,\x20%s',_0x346630,_0x1cf778);_0x3f3801(_0x1cf778);});});}function respondWithResult(_0x23192f,_0xb07517){_0xb07517=_0xb07517||0xc8;return function(_0x1278c5){if(_0x1278c5){return _0x23192f[_0x1ab6('0x1d')](_0xb07517)['json'](_0x1278c5);}};}function respondWithFilteredResult(_0x3127b4,_0x5bb60e){return function(_0x169ebe){if(_0x169ebe){var _0x432692=typeof _0x5bb60e['offset']===_0x1ab6('0x1e')&&typeof _0x5bb60e['limit']===_0x1ab6('0x1e');var _0x4238b6=_0x169ebe[_0x1ab6('0x1f')];var _0x2db8e8=_0x432692?0x0:_0x5bb60e[_0x1ab6('0x20')];var _0xd3a4b2=_0x432692?_0x169ebe[_0x1ab6('0x1f')]:_0x5bb60e[_0x1ab6('0x20')]+_0x5bb60e[_0x1ab6('0x21')];var _0x3804e9;if(_0xd3a4b2>=_0x4238b6){_0xd3a4b2=_0x4238b6;_0x3804e9=0xc8;}else{_0x3804e9=0xce;}_0x3127b4[_0x1ab6('0x1d')](_0x3804e9);return _0x3127b4[_0x1ab6('0x22')](_0x1ab6('0x23'),_0x2db8e8+'-'+_0xd3a4b2+'/'+_0x4238b6)[_0x1ab6('0x24')](_0x169ebe);}return null;};}function saveUpdates(_0x14f685){return function(_0x2e3091){if(_0x2e3091){return _0x2e3091[_0x1ab6('0x25')](_0x14f685)[_0x1ab6('0x12')](function(_0x1c5714){return _0x1c5714;});}return null;};}function removeEntity(_0x113606){return function(_0x3120dc){if(_0x3120dc){return _0x3120dc['destroy']()[_0x1ab6('0x12')](function(){_0x113606[_0x1ab6('0x1d')](0xcc)[_0x1ab6('0x26')]();});}};}function handleEntityNotFound(_0x42c50f){return function(_0x1ab130){if(!_0x1ab130){_0x42c50f[_0x1ab6('0x27')](0x194);}return _0x1ab130;};}function handleError(_0x3087cc,_0x47c9e6){_0x47c9e6=_0x47c9e6||0x1f4;return function(_0x265a66){logger[_0x1ab6('0x18')](_0x265a66[_0x1ab6('0x28')]);if(_0x265a66[_0x1ab6('0x29')]){delete _0x265a66[_0x1ab6('0x29')];}_0x3087cc[_0x1ab6('0x1d')](_0x47c9e6)['send'](_0x265a66);};}exports[_0x1ab6('0x2a')]=function(_0x55702c,_0x2358ad){var _0x456b85={},_0x4b146a={},_0x1d8221={'count':0x0,'rows':[]};var _0x54f179=_['map'](db[_0x1ab6('0x2b')][_0x1ab6('0x2c')],function(_0x2b6e76){return{'name':_0x2b6e76['fieldName'],'type':_0x2b6e76[_0x1ab6('0x2d')][_0x1ab6('0x2e')]};});_0x4b146a[_0x1ab6('0x2f')]=_[_0x1ab6('0x30')](_0x54f179,'name');_0x4b146a[_0x1ab6('0x31')]=_[_0x1ab6('0x32')](_0x55702c[_0x1ab6('0x31')]);_0x4b146a[_0x1ab6('0x33')]=_[_0x1ab6('0x34')](_0x4b146a['model'],_0x4b146a[_0x1ab6('0x31')]);_0x456b85['attributes']=_['intersection'](_0x4b146a['model'],qs['fields'](_0x55702c[_0x1ab6('0x31')][_0x1ab6('0x35')]));_0x456b85['attributes']=_0x456b85['attributes'][_0x1ab6('0x36')]?_0x456b85[_0x1ab6('0x37')]:_0x4b146a[_0x1ab6('0x2f')];if(!_0x55702c['query'][_0x1ab6('0x38')](_0x1ab6('0x39'))){_0x456b85[_0x1ab6('0x21')]=qs[_0x1ab6('0x21')](_0x55702c[_0x1ab6('0x31')]['limit']);_0x456b85['offset']=qs[_0x1ab6('0x20')](_0x55702c[_0x1ab6('0x31')][_0x1ab6('0x20')]);}_0x456b85[_0x1ab6('0x3a')]=qs[_0x1ab6('0x3b')](_0x55702c['query']['sort']);_0x456b85[_0x1ab6('0x3c')]=qs[_0x1ab6('0x33')](_[_0x1ab6('0x3d')](_0x55702c[_0x1ab6('0x31')],_0x4b146a['filters']),_0x54f179);if(_0x55702c[_0x1ab6('0x31')][_0x1ab6('0x3e')]){_0x456b85[_0x1ab6('0x3c')]=_[_0x1ab6('0x3f')](_0x456b85['where'],{'$or':_['map'](_0x54f179,function(_0x3d5fbf){if(_0x3d5fbf[_0x1ab6('0x2d')]!==_0x1ab6('0x40')){var _0x210e21={};_0x210e21[_0x3d5fbf['name']]={'$like':'%'+_0x55702c[_0x1ab6('0x31')][_0x1ab6('0x3e')]+'%'};return _0x210e21;}})});}_0x456b85=_[_0x1ab6('0x3f')]({},_0x456b85,_0x55702c[_0x1ab6('0x41')]);var _0x1c94b6={'where':_0x456b85[_0x1ab6('0x3c')]};return db['MailMessage'][_0x1ab6('0x1f')](_0x1c94b6)[_0x1ab6('0x12')](function(_0x266e73){_0x1d8221[_0x1ab6('0x1f')]=_0x266e73;if(_0x55702c[_0x1ab6('0x31')][_0x1ab6('0x42')]){_0x456b85[_0x1ab6('0x43')]=[{'all':!![]}];}return db[_0x1ab6('0x2b')][_0x1ab6('0x44')](_0x456b85);})[_0x1ab6('0x12')](function(_0x3010d5){_0x1d8221[_0x1ab6('0x45')]=_0x3010d5;return _0x1d8221;})[_0x1ab6('0x12')](respondWithFilteredResult(_0x2358ad,_0x456b85))[_0x1ab6('0x1c')](handleError(_0x2358ad,null));};exports[_0x1ab6('0x46')]=function(_0x355ab7,_0xef5946){var _0x2df090={'raw':!![],'where':{'id':_0x355ab7[_0x1ab6('0x47')]['id']}},_0x3d49a8={};_0x3d49a8[_0x1ab6('0x2f')]=_[_0x1ab6('0x32')](db[_0x1ab6('0x2b')][_0x1ab6('0x2c')]);_0x3d49a8['query']=_['keys'](_0x355ab7['query']);_0x3d49a8[_0x1ab6('0x33')]=_['intersection'](_0x3d49a8[_0x1ab6('0x2f')],_0x3d49a8[_0x1ab6('0x31')]);_0x2df090['attributes']=_[_0x1ab6('0x34')](_0x3d49a8['model'],qs[_0x1ab6('0x35')](_0x355ab7[_0x1ab6('0x31')][_0x1ab6('0x35')]));_0x2df090[_0x1ab6('0x37')]=_0x2df090[_0x1ab6('0x37')][_0x1ab6('0x36')]?_0x2df090[_0x1ab6('0x37')]:_0x3d49a8[_0x1ab6('0x2f')];if(_0x355ab7[_0x1ab6('0x31')][_0x1ab6('0x42')]){_0x2df090[_0x1ab6('0x43')]=[{'all':!![]}];}_0x2df090=_[_0x1ab6('0x3f')]({},_0x2df090,_0x355ab7['options']);return db[_0x1ab6('0x2b')][_0x1ab6('0x48')](_0x2df090)[_0x1ab6('0x12')](handleEntityNotFound(_0xef5946,null))[_0x1ab6('0x12')](respondWithResult(_0xef5946,null))[_0x1ab6('0x1c')](handleError(_0xef5946,null));};exports[_0x1ab6('0x25')]=function(_0x36ce9e,_0xbcd62){if(_0x36ce9e[_0x1ab6('0x49')]['id']){delete _0x36ce9e[_0x1ab6('0x49')]['id'];}return db[_0x1ab6('0x2b')]['find']({'where':{'id':_0x36ce9e[_0x1ab6('0x47')]['id']}})['then'](handleEntityNotFound(_0xbcd62,null))[_0x1ab6('0x12')](saveUpdates(_0x36ce9e[_0x1ab6('0x49')],null))['then'](respondWithResult(_0xbcd62,null))['catch'](handleError(_0xbcd62,null));};exports['destroy']=function(_0x1fa3bb,_0x723e81){return db['MailMessage'][_0x1ab6('0x48')]({'where':{'id':_0x1fa3bb[_0x1ab6('0x47')]['id']}})[_0x1ab6('0x12')](handleEntityNotFound(_0x723e81,null))[_0x1ab6('0x12')](removeEntity(_0x723e81,null))[_0x1ab6('0x1c')](handleError(_0x723e81,null));};exports[_0x1ab6('0x4a')]=function(_0x8b4cd5,_0xbca1e8){return db[_0x1ab6('0x2b')]['describe']()[_0x1ab6('0x12')](respondWithResult(_0xbca1e8,null))[_0x1ab6('0x1c')](handleError(_0xbca1e8,null));};exports[_0x1ab6('0x4b')]=function(_0x1d16aa,_0x42fe93){return db[_0x1ab6('0x2b')][_0x1ab6('0x4b')](_0x1d16aa[_0x1ab6('0x49')])['then'](function(_0x2d0193){if(_0x2d0193){if(_0x2d0193[_0x1ab6('0x4c')]===_0x1ab6('0x4d')&&!_0x2d0193[_0x1ab6('0x4e')]){var _0x4dc2af,_0x388adb,_0xb7758e;if(_0x1d16aa['body']['to']){_0x388adb=_0x1d16aa['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0x1ab6('0x4f')]({'where':{'id':_0x2d0193[_0x1ab6('0x50')]},'include':[{'model':db[_0x1ab6('0x51')],'as':_0x1ab6('0x52'),'include':[{'model':db[_0x1ab6('0x53')],'as':_0x1ab6('0x54'),'where':{'email':_0x388adb},'limit':0x1,'order':[['updatedAt',_0x1ab6('0x55')]]}]},{'model':db['MailServerOut'],'as':_0x1ab6('0x56'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1ab6('0x57'),'raw':!![]}]}]})[_0x1ab6('0x12')](function(_0x3de0b1){_0x4dc2af=_0x3de0b1;if(!_0x4dc2af||!_0x4dc2af[_0x1ab6('0x56')])return;var _0x18e833=_0x4dc2af[_0x1ab6('0x58')]();if(_0x1d16aa[_0x1ab6('0x49')][_0x1ab6('0x59')]&&_0x1d16aa['body'][_0x1ab6('0x59')]['length']){for(var _0xb56df9=0x0;_0xb56df9<_0x1d16aa[_0x1ab6('0x49')][_0x1ab6('0x59')]['length'];_0xb56df9+=0x1){_0x1d16aa['body'][_0x1ab6('0x59')][_0xb56df9]={'filename':_0x1d16aa[_0x1ab6('0x49')]['attachments'][_0xb56df9]['name'],'path':path[_0x1ab6('0x5a')](config[_0x1ab6('0x5b')],_0x1ab6('0x5c'),_0x1d16aa[_0x1ab6('0x49')][_0x1ab6('0x59')][_0xb56df9][_0x1ab6('0x5d')])};}}_0xb7758e={'account':_0x18e833,'message':_0x1d16aa[_0x1ab6('0x49')]};return;})[_0x1ab6('0x12')](function(){if(_0x4dc2af[_0x1ab6('0x52')]){if(_0x4dc2af['List'][_0x1ab6('0x54')][_0x1ab6('0x36')]){return _0x4dc2af[_0x1ab6('0x52')][_0x1ab6('0x54')][0x0];}else{return db[_0x1ab6('0x53')][_0x1ab6('0x4b')](_[_0x1ab6('0xb')](_0x1d16aa[_0x1ab6('0x49')],{'firstName':_0x1d16aa[_0x1ab6('0x49')]['to'],'email':_0x1d16aa[_0x1ab6('0x49')]['to'],'phone':_0x1d16aa['body']['to'],'ListId':_0x4dc2af['ListId']}));}}else{throw new Error(_0x1ab6('0x5e'));}})[_0x1ab6('0x12')](function(){if(_0xb7758e){return respondWithRpcPromise(_0x1ab6('0x5f'),_0x1ab6('0x60'),_0xb7758e,client9003)[_0x1ab6('0x12')](function(_0x3b76dd){return _0x2d0193['update']({'read':!![],'messageId':_0x3b76dd['messageId'],'sentAt':moment()[_0x1ab6('0x61')](_0x1ab6('0x62'))});})[_0x1ab6('0x1c')](function(_0x39cf3c){logger[_0x1ab6('0x18')]('%s',JSON[_0x1ab6('0x17')](_0x39cf3c));return _0x2d0193;});}return _0x2d0193;});}return _0x2d0193;}})[_0x1ab6('0x12')](respondWithResult(_0x42fe93,0xc9))[_0x1ab6('0x1c')](handleError(_0x42fe93,null));};exports[_0x1ab6('0x63')]=function(_0x52797a,_0xb7f7ea){var _0x4c61ea={'agent':{},'channel':_0x1ab6('0x64')};if(_0x52797a[_0x1ab6('0x49')]['id']){delete _0x52797a['body']['id'];}_0x52797a[_0x1ab6('0x49')][_0x1ab6('0x65')]=!![];_0x52797a[_0x1ab6('0x49')][_0x1ab6('0x66')]=moment()['format'](_0x1ab6('0x62'));_0x52797a[_0x1ab6('0x49')][_0x1ab6('0x67')]=_0x52797a[_0x1ab6('0x49')][_0x1ab6('0x67')]||_0x52797a['user']['id'];_0x4c61ea[_0x1ab6('0x68')]['id']=_0x52797a[_0x1ab6('0x49')][_0x1ab6('0x67')];return db[_0x1ab6('0x2b')]['find']({'where':{'id':_0x52797a[_0x1ab6('0x47')]['id'],'UserId':null}})[_0x1ab6('0x12')](handleEntityNotFound(_0xb7f7ea,null))['then'](saveUpdates(_0x52797a['body'],null))[_0x1ab6('0x12')](function(_0x219ba9){if(_0x219ba9){_0x4c61ea[_0x1ab6('0x1a')]=_0x219ba9[_0x1ab6('0x69')]({'plain':!![]});return db[_0x1ab6('0x6a')][_0x1ab6('0x48')]({'where':{'id':_0x219ba9[_0x1ab6('0x6b')]}});}return null;})[_0x1ab6('0x12')](handleEntityNotFound(_0xb7f7ea,null))['then'](function(_0x2dc863){if(_0x2dc863){return _0x2dc863[_0x1ab6('0x25')]({'UserId':_0x52797a[_0x1ab6('0x49')][_0x1ab6('0x67')],'read1stAt':_['isNil'](_0x2dc863['read1stAt'])?moment()[_0x1ab6('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1ab6('0x12')](function(_0x51ae2f){if(_0x51ae2f){_0x4c61ea[_0x1ab6('0x6c')]=_0x51ae2f[_0x1ab6('0x69')]({'plain':!![]});interaction_log[_0x1ab6('0x13')](_0x1ab6('0x6d'),_0x52797a['user']['id'],_0x52797a[_0x1ab6('0x6e')][_0x1ab6('0x29')],_0x52797a[_0x1ab6('0x6e')][_0x1ab6('0x6f')],_0x4c61ea[_0x1ab6('0x6c')]['id'],_0x52797a['body']?JSON[_0x1ab6('0x17')](_0x52797a[_0x1ab6('0x49')]):_0x1ab6('0x70'));return respondWithRpcPromise(_0x1ab6('0x71'),'acceptMessage',_0x4c61ea);}return null;})['then'](function(_0x265805){var _0x2f167f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x265805[_0x1ab6('0x1a')][_0x1ab6('0x72')];return db[_0x1ab6('0x73')][_0x1ab6('0x31')](_0x2f167f,{'type':db[_0x1ab6('0x74')][_0x1ab6('0x75')][_0x1ab6('0x76')],'raw':!![]})[_0x1ab6('0x12')](function(_0x4393f1){return _0x4393f1;});})[_0x1ab6('0x12')](function(_0xee9654){if(_0xee9654){_0x4c61ea[_0x1ab6('0x1a')][_0x1ab6('0x77')]=_0xee9654[0x0];if(!_0x52797a[_0x1ab6('0x49')][_0x1ab6('0x67')])return;return db[_0x1ab6('0x78')][_0x1ab6('0x48')]({'where':{'id':_0x52797a[_0x1ab6('0x49')]['UserId'],'role':_0x1ab6('0x68')},'attributes':['id',_0x1ab6('0x29'),_0x1ab6('0x79'),_0x1ab6('0x7a'),_0x1ab6('0x7b')],'raw':!![]});}return null;})[_0x1ab6('0x12')](function(_0x540ef9){if(!_0x540ef9)return null;_0x4c61ea[_0x1ab6('0x1a')][_0x1ab6('0x68')]=_0x540ef9;return _0x4c61ea;})['then'](function(_0x4a7935){if(_0x4a7935){if(_0x52797a[_0x1ab6('0x49')]['manual']){_0x4c61ea[_0x1ab6('0x1a')][_0x1ab6('0x7c')]=util[_0x1ab6('0x61')](_0x1ab6('0x7d'),_0x52797a[_0x1ab6('0x6e')][_0x1ab6('0x29')]);_0x4c61ea[_0x1ab6('0x1a')][_0x1ab6('0x7e')]=_0x4c61ea['channel'];_0x4c61ea[_0x1ab6('0x1a')][_0x1ab6('0x7f')]=_0x4c61ea['channel'];_0x4c61ea['message'][_0x1ab6('0x80')]=_0x1ab6('0x63');_0x4c61ea[_0x1ab6('0x1a')][_0x1ab6('0x49')]=htmlToText[_0x1ab6('0x81')](_0x4c61ea['message']['body']);return respondWithRpcPromise('EventManager','EventManager',{'event':_0x1ab6('0x82'),'message':_0x4c61ea[_0x1ab6('0x1a')]},client9002)[_0x1ab6('0x12')](function(){return _0x4c61ea;});}return _0x4c61ea;}return null;})[_0x1ab6('0x12')](respondWithResult(_0xb7f7ea,null))[_0x1ab6('0x1c')](handleError(_0xb7f7ea,null));};exports[_0x1ab6('0x83')]=function(_0x48d105,_0x5e6b4a){var _0x2cb233={'agent':{},'channel':_0x1ab6('0x64')};if(_0x48d105['body']['id']){delete _0x48d105[_0x1ab6('0x49')]['id'];}_0x48d105[_0x1ab6('0x49')][_0x1ab6('0x67')]=_0x48d105[_0x1ab6('0x49')][_0x1ab6('0x67')]||_0x48d105[_0x1ab6('0x6e')]['id'];_0x2cb233[_0x1ab6('0x68')]['id']=_0x48d105[_0x1ab6('0x49')][_0x1ab6('0x67')];return db[_0x1ab6('0x2b')][_0x1ab6('0x48')]({'where':{'id':_0x48d105[_0x1ab6('0x47')]['id'],'UserId':null}})[_0x1ab6('0x12')](handleEntityNotFound(_0x5e6b4a,null))[_0x1ab6('0x12')](function(_0x3065f1){if(_0x3065f1){_0x2cb233[_0x1ab6('0x1a')]=_0x3065f1[_0x1ab6('0x69')]({'plain':!![]});return db['MailInteraction'][_0x1ab6('0x48')]({'where':{'id':_0x3065f1[_0x1ab6('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x5e6b4a,null))[_0x1ab6('0x12')](function(_0x429513){if(_0x429513){_0x2cb233[_0x1ab6('0x6c')]=_0x429513[_0x1ab6('0x69')]({'plain':!![]});interaction_log[_0x1ab6('0x13')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48d105['user']['id'],_0x48d105[_0x1ab6('0x6e')][_0x1ab6('0x29')],_0x48d105[_0x1ab6('0x6e')][_0x1ab6('0x6f')],_0x2cb233['interaction']['id'],_0x48d105[_0x1ab6('0x49')]?JSON[_0x1ab6('0x17')](_0x48d105[_0x1ab6('0x49')]):_0x1ab6('0x70'));return respondWithRpcPromise(_0x1ab6('0x84'),'rejectMessage',_0x2cb233);}return null;})[_0x1ab6('0x12')](function(_0x219585){var _0x90f2c5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x219585[_0x1ab6('0x1a')][_0x1ab6('0x72')];return db[_0x1ab6('0x73')][_0x1ab6('0x31')](_0x90f2c5,{'type':db['Sequelize'][_0x1ab6('0x75')][_0x1ab6('0x76')],'raw':!![]})[_0x1ab6('0x12')](function(_0x5bf6ac){return _0x5bf6ac;});})['then'](function(_0x34aa03){if(_0x34aa03){_0x2cb233[_0x1ab6('0x1a')][_0x1ab6('0x77')]=_0x34aa03[0x0];if(!_0x48d105[_0x1ab6('0x49')][_0x1ab6('0x67')])return;return db[_0x1ab6('0x78')][_0x1ab6('0x48')]({'where':{'id':_0x48d105[_0x1ab6('0x49')]['UserId'],'role':'agent'},'attributes':['id',_0x1ab6('0x29'),_0x1ab6('0x79'),_0x1ab6('0x7a'),_0x1ab6('0x7b')],'raw':!![]});}return null;})[_0x1ab6('0x12')](function(_0x40b24c){if(!_0x40b24c)return null;_0x2cb233['message'][_0x1ab6('0x68')]=_0x40b24c;return _0x2cb233;})[_0x1ab6('0x12')](function(_0x5288d6){if(_0x5288d6){_0x5288d6[_0x1ab6('0x1a')]['interface']=util['format'](_0x1ab6('0x7d'),_0x48d105[_0x1ab6('0x6e')][_0x1ab6('0x29')]);_0x5288d6[_0x1ab6('0x1a')]['channel']=_0x2cb233[_0x1ab6('0x7e')];_0x5288d6[_0x1ab6('0x1a')][_0x1ab6('0x7f')]=_0x2cb233[_0x1ab6('0x7e')];_0x5288d6[_0x1ab6('0x1a')][_0x1ab6('0x80')]='reject';_0x5288d6[_0x1ab6('0x1a')][_0x1ab6('0x49')]=htmlToText['fromString'](_0x2cb233[_0x1ab6('0x1a')][_0x1ab6('0x49')]);respondWithRpcPromise(_0x1ab6('0x85'),_0x1ab6('0x85'),{'event':_0x1ab6('0x86'),'message':_0x5288d6[_0x1ab6('0x1a')]},client9002);return _0x2cb233;}return null;})[_0x1ab6('0x12')](respondWithResult(_0x5e6b4a,null))[_0x1ab6('0x1c')](handleError(_0x5e6b4a,null));};exports[_0x1ab6('0x87')]=function(_0x7a66af,_0x23f556){var _0x561abb=moment()['unix']()[_0x1ab6('0x88')]();var _0x257be8=path[_0x1ab6('0x5a')](config[_0x1ab6('0x5b')],'server','files',_0x1ab6('0x89'));var _0x53f8a3=path[_0x1ab6('0x5a')](config[_0x1ab6('0x5b')],'server',_0x1ab6('0x8a'),_0x1ab6('0x59'));var _0x49352e=util[_0x1ab6('0x61')]('message-%s.eml',_0x561abb);return db[_0x1ab6('0x2b')][_0x1ab6('0x48')]({'where':{'id':_0x7a66af[_0x1ab6('0x47')]['id']},'attributes':['id',_0x1ab6('0x49'),_0x1ab6('0x8b'),'to','cc','bcc',_0x1ab6('0x8c'),_0x1ab6('0x8d')],'include':_0x7a66af['query'][_0x1ab6('0x59')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x23f556,null))['then'](function(_0x3147c9){if(_0x3147c9){var _0x4c4735=_0x3147c9;var _0x4309a4={'from':_0x4c4735[_0x1ab6('0x8b')],'to':_0x4c4735['to'],'subject':_0x4c4735[_0x1ab6('0x8c')],'html':htmlEntities['decode'](_0x4c4735[_0x1ab6('0x49')]),'headers':{'Date':moment(_0x4c4735[_0x1ab6('0x8d')])[_0x1ab6('0x61')](_0x1ab6('0x8e'))},'attachments':[]};if(_0x3147c9['cc']){_0x4309a4[_0x1ab6('0x8f')]['Cc']=_0x3147c9['cc'];}if(_0x3147c9[_0x1ab6('0x90')]){_0x4309a4[_0x1ab6('0x8f')]['Bcc']=_0x3147c9['bcc'];}return new BPromise(function(_0x2a307c,_0x2c0f73){if(_0x3147c9[_0x1ab6('0x91')]){for(var _0x37a02a=0x0;_0x37a02a<_0x3147c9[_0x1ab6('0x91')][_0x1ab6('0x36')];_0x37a02a++){var _0x485d7c=_0x3147c9['Attachments'][_0x37a02a];var _0x42630f=path[_0x1ab6('0x5a')](_0x53f8a3,_0x485d7c[_0x1ab6('0x5d')]);if(fs[_0x1ab6('0x92')](_0x42630f)){_0x4309a4[_0x1ab6('0x59')][_0x1ab6('0x93')]({'name':_0x485d7c[_0x1ab6('0x29')],'contentType':_0x485d7c[_0x1ab6('0x2d')],'data':fs[_0x1ab6('0x94')](_0x42630f)});}}}emlformat[_0x1ab6('0x95')](_0x4309a4,function(_0x320d13,_0x4b47b4){if(_0x320d13)return _0x2c0f73(_0x320d13);fs[_0x1ab6('0x96')](path[_0x1ab6('0x5a')](_0x257be8,_0x49352e),_0x4b47b4);return _0x2a307c(_0x4b47b4);});});}})[_0x1ab6('0x12')](function(_0xa272f2){if(_0xa272f2){return _0x23f556[_0x1ab6('0x87')](path[_0x1ab6('0x5a')](_0x257be8,_0x49352e),_0x49352e,function(_0x6c38ea){if(!_0x6c38ea)fs[_0x1ab6('0x97')](path[_0x1ab6('0x5a')](_0x257be8,_0x49352e));});}})[_0x1ab6('0x1c')](handleError(_0x23f556,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1356f41..c259dd5 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 _0xe92c=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','save'];(function(_0x51a58c,_0x5b0474){var _0x513149=function(_0x5e374f){while(--_0x5e374f){_0x51a58c['push'](_0x51a58c['shift']());}};_0x513149(++_0x5b0474);}(_0xe92c,0x65));var _0xce92=function(_0x2011a3,_0x1e91e9){_0x2011a3=_0x2011a3-0x0;var _0x5766a8=_0xe92c[_0x2011a3];return _0x5766a8;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xce92('0x0'))['db'][_0xce92('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce92('0x2'),'afterUpdate':'update','afterDestroy':_0xce92('0x3')};function emitEvent(_0x2023d3){return function(_0x3a7ff3,_0x5a9667,_0x282c29){MailMessageEvents[_0xce92('0x4')](_0x2023d3+':'+_0x3a7ff3['id'],_0x3a7ff3);MailMessageEvents['emit'](_0x2023d3,_0x3a7ff3);_0x282c29(null);};}for(var e in events){if(events[_0xce92('0x5')](e)){var event=events[e];MailMessage[_0xce92('0x6')](e,emitEvent(event));}}module[_0xce92('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x64b2=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x64b2,0x13b));var _0x264b=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x64b2[_0x2aec52];return _0x3b8835;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x264b('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x264b('0x1'),'afterDestroy':_0x264b('0x2')};function emitEvent(_0x4a1f3d){return function(_0x5d0e09,_0x4a69c4,_0x84aaca){MailMessageEvents[_0x264b('0x3')](_0x4a1f3d+':'+_0x5d0e09['id'],_0x5d0e09);MailMessageEvents[_0x264b('0x3')](_0x4a1f3d,_0x5d0e09);_0x84aaca(null);};}for(var e in events){if(events[_0x264b('0x4')](e)){var event=events[e];MailMessage[_0x264b('0x5')](e,emitEvent(event));}}module[_0x264b('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 7c161c4..33207d3 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 _0xa28e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','utf8mb4'];(function(_0x3aeb13,_0x24ccc1){var _0x229b4e=function(_0x80307f){while(--_0x80307f){_0x3aeb13['push'](_0x3aeb13['shift']());}};_0x229b4e(++_0x24ccc1);}(_0xa28e,0x16c));var _0xea28=function(_0x78bd8e,_0x4ac14c){_0x78bd8e=_0x78bd8e-0x0;var _0x1f307d=_0xa28e[_0x78bd8e];return _0x1f307d;};'use strict';var _=require(_0xea28('0x0'));var util=require('util');var logger=require(_0xea28('0x1'))(_0xea28('0x2'));var moment=require(_0xea28('0x3'));var BPromise=require(_0xea28('0x4'));var rp=require(_0xea28('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xea28('0x6'));var rimraf=require('rimraf');var config=require(_0xea28('0x7'));var attributes=require('./mailMessage.attributes');module[_0xea28('0x8')]=function(_0x5a8097,_0x330ac8){return _0x5a8097[_0xea28('0x9')]('MailMessage',attributes,{'tableName':_0xea28('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xea28('0xb')]},{'name':_0xea28('0xc'),'fields':[_0xea28('0xd'),_0xea28('0xe')],'type':_0xea28('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5f4028,_0x9ebacb,_0x399b99){if(_0x5f4028[_0xea28('0x10')]){_0x5f4028[_0xea28('0xd')]=htmlToText['fromString'](_0x5f4028['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x399b99(null,_0x9ebacb);},'afterCreate':function(_0x1cc4cc,_0x4fc844,_0x248aca){var _0x49509d=_0x5a8097['models'];var _0x498358=_0x1cc4cc[_0xea28('0x11')]({'plain':!![]});if(_0x498358[_0xea28('0x12')][_0xea28('0x13')]()==='in'||_0x498358[_0xea28('0x12')][_0xea28('0x13')]()==='out'&&!_0x498358[_0xea28('0x14')]&&!_[_0xea28('0x15')](_0x498358[_0xea28('0x16')])){_0x49509d[_0xea28('0x17')][_0xea28('0x18')]({'where':{'id':_0x498358[_0xea28('0x19')]}})['then'](function(_0x202a08){if(_0x202a08){_0x202a08[_0xea28('0x1a')]({'lastMsgAt':_0x498358['createdAt'],'lastMsgDirection':_0x498358[_0xea28('0x12')][_0xea28('0x13')]()});}})['catch'](function(_0x122c33){console['error'](_0x122c33);});}_0x248aca();}},'charset':_0xea28('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1678=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','secret','UserId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x2e373c,_0x119253){var _0x281c3e=function(_0x2ee547){while(--_0x2ee547){_0x2e373c['push'](_0x2e373c['shift']());}};_0x281c3e(++_0x119253);}(_0x1678,0x133));var _0x8167=function(_0x4d687f,_0x330781){_0x4d687f=_0x4d687f-0x0;var _0x24b077=_0x1678[_0x4d687f];return _0x24b077;};'use strict';var _=require('lodash');var util=require(_0x8167('0x0'));var logger=require(_0x8167('0x1'))(_0x8167('0x2'));var moment=require(_0x8167('0x3'));var BPromise=require(_0x8167('0x4'));var rp=require(_0x8167('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x8167('0x6'));var rimraf=require(_0x8167('0x7'));var config=require(_0x8167('0x8'));var attributes=require(_0x8167('0x9'));module[_0x8167('0xa')]=function(_0x462b5c,_0x4482f1){return _0x462b5c[_0x8167('0xb')](_0x8167('0xc'),attributes,{'tableName':_0x8167('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8167('0xe')]},{'name':_0x8167('0xf'),'fields':[_0x8167('0x10'),'subject'],'type':_0x8167('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x12c2f9,_0x15bf91,_0x279d99){if(_0x12c2f9[_0x8167('0x12')]){_0x12c2f9[_0x8167('0x10')]=htmlToText['fromString'](_0x12c2f9[_0x8167('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x279d99(null,_0x15bf91);},'afterCreate':function(_0x38cd34,_0x1091e1,_0x485e1a){var _0x3303f1=_0x462b5c[_0x8167('0x13')];var _0x59e4bb=_0x38cd34[_0x8167('0x14')]({'plain':!![]});if(_0x59e4bb[_0x8167('0x15')]['toLowerCase']()==='in'||_0x59e4bb[_0x8167('0x15')][_0x8167('0x16')]()==='out'&&!_0x59e4bb[_0x8167('0x17')]&&!_['isNil'](_0x59e4bb[_0x8167('0x18')])){_0x3303f1['MailInteraction']['findOne']({'where':{'id':_0x59e4bb['MailInteractionId']}})['then'](function(_0x4aa1f6){if(_0x4aa1f6){_0x4aa1f6[_0x8167('0x19')]({'lastMsgAt':_0x59e4bb[_0x8167('0x1a')],'lastMsgDirection':_0x59e4bb['direction']['toLowerCase']()});}})[_0x8167('0x1b')](function(_0x1cc9c8){console[_0x8167('0x1c')](_0x1cc9c8);});}_0x485e1a();}},'charset':_0x8167('0x1d'),'collate':_0x8167('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 6000ed2..e948301 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 _0x80ed=['create','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateMailMessage','MailMessage'];(function(_0x4ed538,_0x5e9753){var _0x32b76c=function(_0x197a01){while(--_0x197a01){_0x4ed538['push'](_0x4ed538['shift']());}};_0x32b76c(++_0x5e9753);}(_0x80ed,0x11c));var _0xd80e=function(_0x16a71f,_0x1bde9c){_0x16a71f=_0x16a71f-0x0;var _0x2b6920=_0x80ed[_0x16a71f];return _0x2b6920;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});config['redis']=_[_0xd80e('0xb')](config[_0xd80e('0xc')],{'host':_0xd80e('0xd'),'port':0x18eb});var socket=require(_0xd80e('0xe'))(new Redis(config[_0xd80e('0xc')]));require(_0xd80e('0xf'))[_0xd80e('0x10')](socket);function respondWithRpcPromise(_0x2457f5,_0x68625,_0x7f93b4){return new BPromise(function(_0x4eee08,_0x450b44){return client[_0xd80e('0x11')](_0x2457f5,_0x7f93b4)[_0xd80e('0x12')](function(_0x30c9d0){logger[_0xd80e('0x13')](_0xd80e('0x14'),_0x68625,_0xd80e('0x15'));logger[_0xd80e('0x16')](_0xd80e('0x17'),_0x68625,'request\x20sent',JSON['stringify'](_0x30c9d0));if(_0x30c9d0['error']){if(_0x30c9d0['error'][_0xd80e('0x18')]===0x1f4){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x450b44(_0x30c9d0['error'][_0xd80e('0x1a')]);}logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x4eee08(_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);}else{logger[_0xd80e('0x13')]('MailMessage,\x20%s,\x20%s',_0x68625,_0xd80e('0x15'));_0x4eee08(_0x30c9d0[_0xd80e('0x1b')][_0xd80e('0x1a')]);}})[_0xd80e('0x1c')](function(_0x593af6){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x593af6);_0x450b44(_0x593af6);});});}exports[_0xd80e('0x1d')]=function(_0x527237){var _0x41417d=this;return new Promise(function(_0x2ef8a1,_0x2765ea){return db[_0xd80e('0x1e')][_0xd80e('0x1f')](_0x527237['body'],{'raw':_0x527237['options']?_0x527237[_0xd80e('0x20')][_0xd80e('0x21')]===undefined?!![]:![]:!![]})[_0xd80e('0x12')](function(_0x2d46e7){logger[_0xd80e('0x13')](_0xd80e('0x1d'),_0x527237);logger[_0xd80e('0x16')]('CreateMailMessage',_0x527237,JSON[_0xd80e('0x22')](_0x2d46e7));_0x2ef8a1(_0x2d46e7);})[_0xd80e('0x1c')](function(_0x170109){logger['error'](_0xd80e('0x1d'),_0x170109[_0xd80e('0x1a')],_0x527237);_0x2765ea(_0x41417d[_0xd80e('0x19')](0x1f4,_0x170109['message']));});});}; \ No newline at end of file +var _0x7334=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','create','body','options','raw','CreateMailMessage','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3634fb,_0x1fe5cf){var _0x18e34b=function(_0xdc32fc){while(--_0xdc32fc){_0x3634fb['push'](_0x3634fb['shift']());}};_0x18e34b(++_0x1fe5cf);}(_0x7334,0x184));var _0x4733=function(_0xde4964,_0x3e025b){_0xde4964=_0xde4964-0x0;var _0x3c6053=_0x7334[_0xde4964];return _0x3c6053;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});config[_0x4733('0xb')]=_[_0x4733('0xc')](config[_0x4733('0xb')],{'host':_0x4733('0xd'),'port':0x18eb});var socket=require(_0x4733('0xe'))(new Redis(config[_0x4733('0xb')]));require(_0x4733('0xf'))[_0x4733('0x10')](socket);function respondWithRpcPromise(_0x1bc511,_0x2bafad,_0x49032d){return new BPromise(function(_0x42b97f,_0x1e6fcf){return client['request'](_0x1bc511,_0x49032d)[_0x4733('0x11')](function(_0x5240a4){logger[_0x4733('0x12')](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));logger[_0x4733('0x15')](_0x4733('0x16'),_0x2bafad,_0x4733('0x14'),JSON[_0x4733('0x17')](_0x5240a4));if(_0x5240a4['error']){if(_0x5240a4[_0x4733('0x18')]['code']===0x1f4){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);return _0x1e6fcf(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')]['message']);return _0x42b97f(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}else{logger['info'](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));_0x42b97f(_0x5240a4[_0x4733('0x1a')][_0x4733('0x19')]);}})['catch'](function(_0x517fbc){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x517fbc);_0x1e6fcf(_0x517fbc);});});}exports['CreateMailMessage']=function(_0x32f166){var _0x1943bc=this;return new Promise(function(_0x15339c,_0x7a4e0){return db['MailMessage'][_0x4733('0x1b')](_0x32f166[_0x4733('0x1c')],{'raw':_0x32f166['options']?_0x32f166[_0x4733('0x1d')][_0x4733('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x15a291){logger[_0x4733('0x12')](_0x4733('0x1f'),_0x32f166);logger[_0x4733('0x15')](_0x4733('0x1f'),_0x32f166,JSON[_0x4733('0x17')](_0x15a291));_0x15339c(_0x15a291);})[_0x4733('0x20')](function(_0x2bb78f){logger['error'](_0x4733('0x1f'),_0x2bb78f[_0x4733('0x19')],_0x32f166);_0x7a4e0(_0x1943bc[_0x4733('0x18')](0x1f4,_0x2bb78f[_0x4733('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index a8154a7..55ae691 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 _0x611b=['remove','update','emit','removeListener','length','mailMessage:','save'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x611b,0xca));var _0xb611=function(_0x547816,_0x103adb){_0x547816=_0x547816-0x0;var _0x573a12=_0x611b[_0x547816];return _0x573a12;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xb611('0x0'),_0xb611('0x1'),_0xb611('0x2')];function createListener(_0x52642a,_0x24d827){return function(_0x333c6a){_0x24d827[_0xb611('0x3')](_0x52642a,_0x333c6a);};}function removeListener(_0x5d19bd,_0x31b27e){return function(){MailMessageEvents[_0xb611('0x4')](_0x5d19bd,_0x31b27e);};}exports['register']=function(_0x4dc387){for(var _0x5aaac4=0x0,_0x296dd7=events[_0xb611('0x5')];_0x5aaac4<_0x296dd7;_0x5aaac4++){var _0x4768fa=events[_0x5aaac4];var _0x4c39a8=createListener(_0xb611('0x6')+_0x4768fa,_0x4dc387);MailMessageEvents['on'](_0x4768fa,_0x4c39a8);}}; \ No newline at end of file +var _0x0af9=['mailMessage:','./mailMessage.events','save','remove','update','removeListener','register','length'];(function(_0x1dff39,_0x1cf83c){var _0x18bc86=function(_0x4971cb){while(--_0x4971cb){_0x1dff39['push'](_0x1dff39['shift']());}};_0x18bc86(++_0x1cf83c);}(_0x0af9,0xb9));var _0x90af=function(_0x40f5fe,_0x208007){_0x40f5fe=_0x40f5fe-0x0;var _0x4a21ae=_0x0af9[_0x40f5fe];return _0x4a21ae;};'use strict';var MailMessageEvents=require(_0x90af('0x0'));var events=[_0x90af('0x1'),_0x90af('0x2'),_0x90af('0x3')];function createListener(_0x5c72cf,_0x2d477d){return function(_0xa1c2cd){_0x2d477d['emit'](_0x5c72cf,_0xa1c2cd);};}function removeListener(_0x98917b,_0x1eb5f4){return function(){MailMessageEvents[_0x90af('0x4')](_0x98917b,_0x1eb5f4);};}exports[_0x90af('0x5')]=function(_0x2ddc2a){for(var _0x29a4c7=0x0,_0xec8217=events[_0x90af('0x6')];_0x29a4c7<_0xec8217;_0x29a4c7++){var _0x5431bc=events[_0x29a4c7];var _0x3569f4=createListener(_0x90af('0x7')+_0x5431bc,_0x2ddc2a);MailMessageEvents['on'](_0x5431bc,_0x3569f4);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b1aaa89..bf25bc4 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 _0x029b=['removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','index','/describe','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete'];(function(_0x5a3932,_0x2ceafa){var _0x4f188e=function(_0x228d25){while(--_0x228d25){_0x5a3932['push'](_0x5a3932['shift']());}};_0x4f188e(++_0x2ceafa);}(_0x029b,0x1e1));var _0xb029=function(_0x18db71,_0x5abf55){_0x18db71=_0x18db71-0x0;var _0x3c3692=_0x029b[_0x18db71];return _0x3c3692;};'use strict';var multer=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var path=require(_0xb029('0x2'));var timeout=require(_0xb029('0x3'));var express=require(_0xb029('0x4'));var router=express[_0xb029('0x5')]();var fs_extra=require(_0xb029('0x6'));var auth=require(_0xb029('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb029('0x8'));var controller=require(_0xb029('0x9'));router[_0xb029('0xa')]('/',auth['isAuthenticated'](),controller[_0xb029('0xb')]);router[_0xb029('0xa')](_0xb029('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xb029('0xa')](_0xb029('0xd'),auth[_0xb029('0xe')](),controller['show']);router['get'](_0xb029('0xf'),auth[_0xb029('0xe')](),controller[_0xb029('0x10')]);router[_0xb029('0xa')](_0xb029('0x11'),auth['isAuthenticated'](),controller[_0xb029('0x12')]);router[_0xb029('0xa')](_0xb029('0x13'),auth[_0xb029('0xe')](),controller[_0xb029('0x14')]);router[_0xb029('0x15')]('/',auth['isAuthenticated'](),controller[_0xb029('0x16')]);router[_0xb029('0x15')](_0xb029('0x11'),auth[_0xb029('0xe')](),controller[_0xb029('0x17')]);router[_0xb029('0x15')](_0xb029('0x13'),auth['isAuthenticated'](),controller[_0xb029('0x18')]);router[_0xb029('0x19')](_0xb029('0xd'),auth['isAuthenticated'](),controller[_0xb029('0x1a')]);router['delete'](_0xb029('0xd'),auth[_0xb029('0xe')](),controller[_0xb029('0x1b')]);router[_0xb029('0x1c')](_0xb029('0x11'),auth[_0xb029('0xe')](),controller[_0xb029('0x1d')]);router[_0xb029('0x1c')]('/:id/users',auth[_0xb029('0xe')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf6e3=['post','create','put','update','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf6e3,0x11f));var _0x3f6e=function(_0xcce4c6,_0x1a37c8){_0xcce4c6=_0xcce4c6-0x0;var _0x560f1d=_0xf6e3[_0xcce4c6];return _0x560f1d;};'use strict';var multer=require(_0x3f6e('0x0'));var util=require('util');var path=require(_0x3f6e('0x1'));var timeout=require(_0x3f6e('0x2'));var express=require(_0x3f6e('0x3'));var router=express[_0x3f6e('0x4')]();var fs_extra=require(_0x3f6e('0x5'));var auth=require(_0x3f6e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3f6e('0x7'));var controller=require('./mailQueue.controller');router[_0x3f6e('0x8')]('/',auth[_0x3f6e('0x9')](),controller[_0x3f6e('0xa')]);router[_0x3f6e('0x8')](_0x3f6e('0xb'),auth[_0x3f6e('0x9')](),controller[_0x3f6e('0xc')]);router[_0x3f6e('0x8')](_0x3f6e('0xd'),auth[_0x3f6e('0x9')](),controller[_0x3f6e('0xe')]);router[_0x3f6e('0x8')](_0x3f6e('0xf'),auth['isAuthenticated'](),controller[_0x3f6e('0x10')]);router[_0x3f6e('0x8')](_0x3f6e('0x11'),auth[_0x3f6e('0x9')](),controller[_0x3f6e('0x12')]);router[_0x3f6e('0x8')](_0x3f6e('0x13'),auth[_0x3f6e('0x9')](),controller[_0x3f6e('0x14')]);router[_0x3f6e('0x15')]('/',auth[_0x3f6e('0x9')](),controller[_0x3f6e('0x16')]);router['post'](_0x3f6e('0x11'),auth[_0x3f6e('0x9')](),controller['addTeams']);router[_0x3f6e('0x15')](_0x3f6e('0x13'),auth[_0x3f6e('0x9')](),controller['addAgents']);router[_0x3f6e('0x17')](_0x3f6e('0xd'),auth[_0x3f6e('0x9')](),controller[_0x3f6e('0x18')]);router[_0x3f6e('0x19')]('/:id',auth[_0x3f6e('0x9')](),controller['destroy']);router[_0x3f6e('0x19')](_0x3f6e('0x11'),auth[_0x3f6e('0x9')](),controller[_0x3f6e('0x1a')]);router[_0x3f6e('0x19')](_0x3f6e('0x13'),auth[_0x3f6e('0x9')](),controller[_0x3f6e('0x1b')]);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 41e52e6..2df3848 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 _0x8a83=['name','STRING','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x2037e8,_0x3f4195){var _0xe6e348=function(_0x27d548){while(--_0x27d548){_0x2037e8['push'](_0x2037e8['shift']());}};_0xe6e348(++_0x3f4195);}(_0x8a83,0x133));var _0x38a8=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x8a83[_0x496333];return _0x44256e;};'use strict';var Sequelize=require('sequelize');module[_0x38a8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x38a8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x38a8('0x2')]},'timeout':{'type':Sequelize[_0x38a8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x38a8('0x4')]('rrmemory',_0x38a8('0x5'),_0x38a8('0x6'))}}; \ No newline at end of file +var _0x8701=['ENUM','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x1f8e3a,_0x53db7f){var _0x43e2b0=function(_0x12e883){while(--_0x12e883){_0x1f8e3a['push'](_0x1f8e3a['shift']());}};_0x43e2b0(++_0x53db7f);}(_0x8701,0x14c));var _0x1870=function(_0x54867e,_0x36fefa){_0x54867e=_0x54867e-0x0;var _0x48a4f1=_0x8701[_0x54867e];return _0x48a4f1;};'use strict';var Sequelize=require('sequelize');module[_0x1870('0x0')]={'name':{'type':Sequelize[_0x1870('0x1')],'unique':_0x1870('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1870('0x1')]},'timeout':{'type':Sequelize[_0x1870('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1870('0x4')]('rrmemory',_0x1870('0x5'),_0x1870('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 24b3973..afd04de 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 _0xbe27=['isEmpty','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','MailQueue','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','nolimit','MailQueueId','filter','UserMailQueue','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','User','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','transaction'];(function(_0x39ddb1,_0xdefa39){var _0x1adb58=function(_0x1512f1){while(--_0x1512f1){_0x39ddb1['push'](_0x39ddb1['shift']());}};_0x1adb58(++_0xdefa39);}(_0xbe27,0x12d));var _0x7be2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbe27[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7be2('0x0'));var zipdir=require(_0x7be2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7be2('0x2'));var moment=require(_0x7be2('0x3'));var BPromise=require(_0x7be2('0x4'));var Mustache=require(_0x7be2('0x5'));var util=require(_0x7be2('0x6'));var path=require(_0x7be2('0x7'));var sox=require(_0x7be2('0x8'));var csv=require('to-csv');var ejs=require(_0x7be2('0x9'));var fs=require('fs');var fs_extra=require(_0x7be2('0xa'));var _=require(_0x7be2('0xb'));var squel=require('squel');var crypto=require(_0x7be2('0xc'));var jsforce=require(_0x7be2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7be2('0xe'));var querystring=require(_0x7be2('0xf'));var Papa=require(_0x7be2('0x10'));var Redis=require(_0x7be2('0x11'));var authService=require(_0x7be2('0x12'));var qs=require(_0x7be2('0x13'));var as=require(_0x7be2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7be2('0x15'));var config=require(_0x7be2('0x16'));var licenseUtil=require(_0x7be2('0x17'));var db=require(_0x7be2('0x18'))['db'];config['redis']=_[_0x7be2('0x19')](config['redis'],{'host':_0x7be2('0x1a'),'port':0x18eb});var socket=require(_0x7be2('0x1b'))(new Redis(config[_0x7be2('0x1c')]));require(_0x7be2('0x1d'))[_0x7be2('0x1e')](socket);function respondWithStatusCode(_0x370895,_0x1f1572){_0x1f1572=_0x1f1572||0xcc;return function(_0x4c5736){if(_0x4c5736){return _0x370895[_0x7be2('0x1f')](_0x1f1572);}return _0x370895[_0x7be2('0x20')](_0x1f1572)[_0x7be2('0x21')]();};}function respondWithResult(_0x4ea583,_0xfc337){_0xfc337=_0xfc337||0xc8;return function(_0x5c1ae4){if(_0x5c1ae4){return _0x4ea583['status'](_0xfc337)[_0x7be2('0x22')](_0x5c1ae4);}};}function respondWithFilteredResult(_0x28a4af,_0x23c64d){return function(_0x2b0b90){if(_0x2b0b90){var _0x56f0f6=typeof _0x23c64d[_0x7be2('0x23')]===_0x7be2('0x24')&&typeof _0x23c64d['limit']===_0x7be2('0x24');var _0x41f19c=_0x2b0b90[_0x7be2('0x25')];var _0x12064a=_0x56f0f6?0x0:_0x23c64d['offset'];var _0x883292=_0x56f0f6?_0x2b0b90[_0x7be2('0x25')]:_0x23c64d[_0x7be2('0x23')]+_0x23c64d[_0x7be2('0x26')];var _0x188d8a;if(_0x883292>=_0x41f19c){_0x883292=_0x41f19c;_0x188d8a=0xc8;}else{_0x188d8a=0xce;}_0x28a4af[_0x7be2('0x20')](_0x188d8a);return _0x28a4af[_0x7be2('0x27')](_0x7be2('0x28'),_0x12064a+'-'+_0x883292+'/'+_0x41f19c)[_0x7be2('0x22')](_0x2b0b90);}return null;};}function patchUpdates(_0x34fa24){return function(_0x130e28){try{jsonpatch[_0x7be2('0x29')](_0x130e28,_0x34fa24,!![]);}catch(_0x329492){return BPromise[_0x7be2('0x2a')](_0x329492);}return _0x130e28[_0x7be2('0x2b')]();};}function saveUpdates(_0x4350f0,_0x3bd15c){return function(_0x3cd0a9){if(_0x3cd0a9){return _0x3cd0a9[_0x7be2('0x2c')](_0x4350f0)[_0x7be2('0x2d')](function(_0x5d2bf5){return _0x5d2bf5;});}return null;};}function removeEntity(_0x1dcb4b,_0x215f44){return function(_0x247c9c){if(_0x247c9c){return _0x247c9c[_0x7be2('0x2e')]()['then'](function(){var _0x484aee=_0x247c9c[_0x7be2('0x2f')]({'plain':!![]});var _0x5e3764=_0x7be2('0x30');return db[_0x7be2('0x31')][_0x7be2('0x2e')]({'where':{'type':_0x5e3764,'resourceId':_0x484aee['id']}})['then'](function(){return _0x247c9c;});})[_0x7be2('0x2d')](function(){_0x1dcb4b[_0x7be2('0x20')](0xcc)[_0x7be2('0x21')]();});}};}function handleEntityNotFound(_0x34f497,_0x2b2e22){return function(_0xc1fc28){if(!_0xc1fc28){_0x34f497['sendStatus'](0x194);}return _0xc1fc28;};}function handleError(_0x3bd283,_0x49d255){_0x49d255=_0x49d255||0x1f4;return function(_0x2dd1f8){logger[_0x7be2('0x32')](_0x2dd1f8[_0x7be2('0x33')]);if(_0x2dd1f8['name']){delete _0x2dd1f8[_0x7be2('0x34')];}_0x3bd283[_0x7be2('0x20')](_0x49d255)[_0x7be2('0x35')](_0x2dd1f8);};}exports[_0x7be2('0x36')]=function(_0x4fc9a0,_0x478d56){var _0x541312={},_0xe3362a={},_0x1921c0={'count':0x0,'rows':[]};var _0x3a2b65=_['map'](db[_0x7be2('0x37')]['rawAttributes'],function(_0x2e213d){return{'name':_0x2e213d[_0x7be2('0x38')],'type':_0x2e213d[_0x7be2('0x39')][_0x7be2('0x3a')]};});_0xe3362a['model']=_['map'](_0x3a2b65,'name');_0xe3362a[_0x7be2('0x3b')]=_['keys'](_0x4fc9a0[_0x7be2('0x3b')]);_0xe3362a[_0x7be2('0x3c')]=_[_0x7be2('0x3d')](_0xe3362a[_0x7be2('0x3e')],_0xe3362a[_0x7be2('0x3b')]);_0x541312[_0x7be2('0x3f')]=_[_0x7be2('0x3d')](_0xe3362a['model'],qs[_0x7be2('0x40')](_0x4fc9a0[_0x7be2('0x3b')][_0x7be2('0x40')]));_0x541312['attributes']=_0x541312[_0x7be2('0x3f')][_0x7be2('0x41')]?_0x541312['attributes']:_0xe3362a[_0x7be2('0x3e')];if(!_0x4fc9a0[_0x7be2('0x3b')][_0x7be2('0x42')]('nolimit')){_0x541312[_0x7be2('0x26')]=qs[_0x7be2('0x26')](_0x4fc9a0[_0x7be2('0x3b')][_0x7be2('0x26')]);_0x541312[_0x7be2('0x23')]=qs[_0x7be2('0x23')](_0x4fc9a0['query'][_0x7be2('0x23')]);}_0x541312[_0x7be2('0x43')]=qs[_0x7be2('0x44')](_0x4fc9a0[_0x7be2('0x3b')][_0x7be2('0x44')]);_0x541312[_0x7be2('0x45')]=qs[_0x7be2('0x3c')](_[_0x7be2('0x46')](_0x4fc9a0['query'],_0xe3362a[_0x7be2('0x3c')]),_0x3a2b65);if(_0x4fc9a0['query']['filter']){_0x541312[_0x7be2('0x45')]=_[_0x7be2('0x47')](_0x541312[_0x7be2('0x45')],{'$or':_[_0x7be2('0x48')](_0x3a2b65,function(_0x8603a9){if(_0x8603a9[_0x7be2('0x39')]!==_0x7be2('0x49')){var _0x48e697={};_0x48e697[_0x8603a9[_0x7be2('0x34')]]={'$like':'%'+_0x4fc9a0[_0x7be2('0x3b')]['filter']+'%'};return _0x48e697;}})});}_0x541312=_[_0x7be2('0x47')]({},_0x541312,_0x4fc9a0[_0x7be2('0x4a')]);var _0x1846e3={'where':_0x541312[_0x7be2('0x45')]};return db['MailQueue'][_0x7be2('0x25')](_0x1846e3)[_0x7be2('0x2d')](function(_0x12619d){_0x1921c0[_0x7be2('0x25')]=_0x12619d;if(_0x4fc9a0[_0x7be2('0x3b')][_0x7be2('0x4b')]){_0x541312[_0x7be2('0x4c')]=[{'all':!![]}];}return db[_0x7be2('0x37')][_0x7be2('0x4d')](_0x541312);})[_0x7be2('0x2d')](function(_0x5bd9ff){_0x1921c0[_0x7be2('0x4e')]=_0x5bd9ff;return _0x1921c0;})[_0x7be2('0x2d')](respondWithFilteredResult(_0x478d56,_0x541312))[_0x7be2('0x4f')](handleError(_0x478d56,null));};exports[_0x7be2('0x50')]=function(_0x4ede84,_0x404e77){var _0x2fff84={'raw':!![],'where':{'id':_0x4ede84['params']['id']}},_0xb7a49c={};_0xb7a49c[_0x7be2('0x3e')]=_['keys'](db[_0x7be2('0x37')][_0x7be2('0x51')]);_0xb7a49c[_0x7be2('0x3b')]=_[_0x7be2('0x52')](_0x4ede84[_0x7be2('0x3b')]);_0xb7a49c[_0x7be2('0x3c')]=_['intersection'](_0xb7a49c[_0x7be2('0x3e')],_0xb7a49c['query']);_0x2fff84[_0x7be2('0x3f')]=_[_0x7be2('0x3d')](_0xb7a49c[_0x7be2('0x3e')],qs['fields'](_0x4ede84[_0x7be2('0x3b')][_0x7be2('0x40')]));_0x2fff84[_0x7be2('0x3f')]=_0x2fff84['attributes'][_0x7be2('0x41')]?_0x2fff84[_0x7be2('0x3f')]:_0xb7a49c['model'];if(_0x4ede84[_0x7be2('0x3b')]['includeAll']){_0x2fff84['include']=[{'all':!![]}];}_0x2fff84=_[_0x7be2('0x47')]({},_0x2fff84,_0x4ede84[_0x7be2('0x4a')]);return db[_0x7be2('0x37')][_0x7be2('0x53')](_0x2fff84)[_0x7be2('0x2d')](handleEntityNotFound(_0x404e77,null))[_0x7be2('0x2d')](respondWithResult(_0x404e77,null))['catch'](handleError(_0x404e77,null));};exports['create']=function(_0x2519a5,_0x23ffae){return db[_0x7be2('0x37')][_0x7be2('0x54')](_0x2519a5[_0x7be2('0x55')],{})['then'](function(_0x102038){var _0x4f1762=_0x2519a5[_0x7be2('0x56')][_0x7be2('0x2f')]({'plain':!![]});if(!_0x4f1762)throw new Error(_0x7be2('0x57'));if(_0x4f1762['role']===_0x7be2('0x56')){var _0x3d0850=_0x102038['get']({'plain':!![]});var _0x5e13e0=_0x7be2('0x30');return db[_0x7be2('0x58')]['find']({'where':{'name':_0x5e13e0,'userProfileId':_0x4f1762[_0x7be2('0x59')]},'raw':!![]})[_0x7be2('0x2d')](function(_0x5b9f10){if(_0x5b9f10&&_0x5b9f10['autoAssociation']===0x0){return db[_0x7be2('0x31')][_0x7be2('0x54')]({'name':_0x3d0850[_0x7be2('0x34')],'resourceId':_0x3d0850['id'],'type':_0x5b9f10[_0x7be2('0x34')],'sectionId':_0x5b9f10['id']},{})[_0x7be2('0x2d')](function(){return _0x102038;});}else{return _0x102038;}})[_0x7be2('0x4f')](function(_0x16677a){logger['error'](_0x7be2('0x5a'),_0x16677a);throw _0x16677a;});}return _0x102038;})[_0x7be2('0x2d')](respondWithResult(_0x23ffae,0xc9))[_0x7be2('0x4f')](handleError(_0x23ffae,null));};exports[_0x7be2('0x2c')]=function(_0x59c930,_0x512df3){if(_0x59c930['body']['id']){delete _0x59c930['body']['id'];}return db['MailQueue'][_0x7be2('0x53')]({'where':{'id':_0x59c930['params']['id']}})[_0x7be2('0x2d')](handleEntityNotFound(_0x512df3,null))[_0x7be2('0x2d')](saveUpdates(_0x59c930[_0x7be2('0x55')],null))[_0x7be2('0x2d')](respondWithResult(_0x512df3,null))['catch'](handleError(_0x512df3,null));};exports[_0x7be2('0x2e')]=function(_0x3fbd88,_0x5e20a2){return db[_0x7be2('0x37')][_0x7be2('0x53')]({'where':{'id':_0x3fbd88[_0x7be2('0x5b')]['id']}})[_0x7be2('0x2d')](handleEntityNotFound(_0x5e20a2,null))[_0x7be2('0x2d')](removeEntity(_0x5e20a2,null))[_0x7be2('0x4f')](handleError(_0x5e20a2,null));};exports[_0x7be2('0x5c')]=function(_0x3b4ce7,_0xa3de0f){return db[_0x7be2('0x37')]['describe']()[_0x7be2('0x2d')](respondWithResult(_0xa3de0f,null))[_0x7be2('0x4f')](handleError(_0xa3de0f,null));};exports[_0x7be2('0x5d')]=function(_0xc4b5a8,_0x58a70a,_0x5774df){var _0x4a212f={'raw':!![],'where':{}},_0x346406={},_0x5623ab;return db[_0x7be2('0x37')][_0x7be2('0x5e')]({'where':{'id':_0xc4b5a8['params']['id']}})[_0x7be2('0x2d')](handleEntityNotFound(_0x58a70a,null))['then'](function(_0x57cbac){if(_0x57cbac){_0x5623ab=_0x57cbac[_0x7be2('0x2f')]({'plain':!![]});_0x346406[_0x7be2('0x3e')]=_[_0x7be2('0x52')](db['UserMailQueue'][_0x7be2('0x51')]);_0x346406['query']=_[_0x7be2('0x52')](_0xc4b5a8[_0x7be2('0x3b')]);_0x346406['filters']=_[_0x7be2('0x3d')](_0x346406[_0x7be2('0x3e')],_0x346406[_0x7be2('0x3b')]);_0x4a212f[_0x7be2('0x3f')]=_[_0x7be2('0x3d')](_0x346406[_0x7be2('0x3e')],qs['fields'](_0xc4b5a8[_0x7be2('0x3b')]['fields']));_0x4a212f[_0x7be2('0x3f')]=_0x4a212f[_0x7be2('0x3f')][_0x7be2('0x41')]?_0x4a212f[_0x7be2('0x3f')]:_0x346406['model'];if(!_0xc4b5a8[_0x7be2('0x3b')]['hasOwnProperty'](_0x7be2('0x5f'))){_0x4a212f[_0x7be2('0x26')]=qs[_0x7be2('0x26')](_0xc4b5a8[_0x7be2('0x3b')]['limit']);_0x4a212f['offset']=qs['offset'](_0xc4b5a8[_0x7be2('0x3b')][_0x7be2('0x23')]);}_0x4a212f['order']=qs['sort'](_0xc4b5a8[_0x7be2('0x3b')]['sort']);_0x4a212f[_0x7be2('0x45')]=qs[_0x7be2('0x3c')](_['pick'](_0xc4b5a8['query'],_0x346406[_0x7be2('0x3c')]));_0x4a212f['where'][_0x7be2('0x60')]=_0x57cbac['id'];if(_0xc4b5a8['query'][_0x7be2('0x61')]){_0x4a212f[_0x7be2('0x45')]=_['merge'](_0x4a212f[_0x7be2('0x45')],{'$or':_[_0x7be2('0x48')](_0x4a212f['attributes'],function(_0x215944){var _0x504640={};_0x504640[_0x215944]={'$like':'%'+_0xc4b5a8[_0x7be2('0x3b')][_0x7be2('0x61')]+'%'};return _0x504640;})});}_0x4a212f=_['merge']({},_0x4a212f,_0xc4b5a8['options']);return db[_0x7be2('0x62')]['findAll'](_0x4a212f);}})['then'](function(_0x115bf5){if(_0x115bf5){return db['User'][_0x7be2('0x63')]({'where':{'id':_[_0x7be2('0x48')](_0x115bf5,_0x7be2('0x64')),'role':_0x7be2('0x65')},'attributes':['id',_0x7be2('0x34'),_0x7be2('0x66'),_0x7be2('0x67'),_0x7be2('0x68')]});}})['then'](function(_0x22d7b2){if(_0x22d7b2){return{'count':_0x22d7b2[_0x7be2('0x25')],'rows':_[_0x7be2('0x48')](_0x22d7b2[_0x7be2('0x4e')],function(_0x225792){return{'membername':_0x225792[_0x7be2('0x34')],'UserId':_0x225792['id'],'queue_name':_0x5623ab['name'],'MailQueueId':_0x5623ab['id'],'interface':util['format']('%s/%s',_0x7be2('0x69'),_0x225792[_0x7be2('0x34')]),'penalty':0x0,'paused':_0x225792[_0x7be2('0x66')],'createdAt':_0x225792[_0x7be2('0x68')],'updatedAt':_0x225792[_0x7be2('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x58a70a,_0x4a212f))[_0x7be2('0x4f')](handleError(_0x58a70a,null));};exports[_0x7be2('0x6a')]=function(_0x52ee3b,_0x5a7055,_0x2af553){var _0x4d7549={};var _0x1a151a={};var _0x2b4455;var _0x8395f1;return db[_0x7be2('0x37')]['findOne']({'where':{'id':_0x52ee3b[_0x7be2('0x5b')]['id']}})[_0x7be2('0x2d')](handleEntityNotFound(_0x5a7055,null))['then'](function(_0x245c7b){if(_0x245c7b){_0x2b4455=_0x245c7b;_0x1a151a[_0x7be2('0x3e')]=_[_0x7be2('0x52')](db['Team']['rawAttributes']);_0x1a151a[_0x7be2('0x3b')]=_[_0x7be2('0x52')](_0x52ee3b[_0x7be2('0x3b')]);_0x1a151a[_0x7be2('0x3c')]=_['intersection'](_0x1a151a[_0x7be2('0x3e')],_0x1a151a[_0x7be2('0x3b')]);_0x4d7549[_0x7be2('0x3f')]=_[_0x7be2('0x3d')](_0x1a151a['model'],qs['fields'](_0x52ee3b[_0x7be2('0x3b')]['fields']));_0x4d7549[_0x7be2('0x3f')]=_0x4d7549[_0x7be2('0x3f')][_0x7be2('0x41')]?_0x4d7549[_0x7be2('0x3f')]:_0x1a151a['model'];_0x4d7549[_0x7be2('0x43')]=qs['sort'](_0x52ee3b[_0x7be2('0x3b')]['sort']);_0x4d7549[_0x7be2('0x45')]=qs[_0x7be2('0x3c')](_[_0x7be2('0x46')](_0x52ee3b[_0x7be2('0x3b')],_0x1a151a[_0x7be2('0x3c')]));if(_0x52ee3b['query'][_0x7be2('0x61')]){_0x4d7549[_0x7be2('0x45')]=_[_0x7be2('0x47')](_0x4d7549['where'],{'$or':_['map'](_0x4d7549[_0x7be2('0x3f')],function(_0xd2a80f){var _0x183fb5={};_0x183fb5[_0xd2a80f]={'$like':'%'+_0x52ee3b['query']['filter']+'%'};return _0x183fb5;})});}_0x4d7549=_[_0x7be2('0x47')]({},_0x4d7549,_0x52ee3b[_0x7be2('0x4a')]);return _0x2b4455[_0x7be2('0x6a')](_0x4d7549);}})[_0x7be2('0x2d')](function(_0x7854dd){if(_0x7854dd){_0x8395f1=_0x7854dd[_0x7be2('0x41')];if(!_0x52ee3b[_0x7be2('0x3b')][_0x7be2('0x42')](_0x7be2('0x5f'))){_0x4d7549[_0x7be2('0x26')]=qs[_0x7be2('0x26')](_0x52ee3b[_0x7be2('0x3b')][_0x7be2('0x26')]);_0x4d7549[_0x7be2('0x23')]=qs[_0x7be2('0x23')](_0x52ee3b[_0x7be2('0x3b')][_0x7be2('0x23')]);}return _0x2b4455[_0x7be2('0x6a')](_0x4d7549);}})['then'](function(_0x4b6853){if(_0x4b6853){return _0x4b6853?{'count':_0x8395f1,'rows':_0x4b6853}:null;}})[_0x7be2('0x2d')](respondWithResult(_0x5a7055,null))[_0x7be2('0x4f')](handleError(_0x5a7055,null));};exports[_0x7be2('0x6b')]=function(_0x439957,_0xb4ef22,_0x22ead5){var _0x156689=_0x439957[_0x7be2('0x55')][_0x7be2('0x6c')];return db[_0x7be2('0x6d')]['findAll']({'where':{'id':_0x156689},'attributes':['id'],'include':[{'model':db[_0x7be2('0x6e')],'as':'Agents','attributes':['id',_0x7be2('0x34'),'online','voicePause',_0x7be2('0x6f')],'raw':!![]}]})[_0x7be2('0x2d')](function(_0x53ebfa){if(_0x53ebfa){var _0x36acac=_[_0x7be2('0x70')](_0x53ebfa,function(_0x161e07){var _0x1ca090=_0x161e07[_0x7be2('0x2f')]({'plain':!![]});return _0x1ca090[_0x7be2('0x71')];});return db['MailQueue'][_0x7be2('0x53')]({'where':{'id':_0x439957['params']['id']}})[_0x7be2('0x2d')](function(_0x14fbdc){return db[_0x7be2('0x72')]['transaction'](function(_0x516110){return _0x14fbdc[_0x7be2('0x6b')](_0x156689,{'transaction':_0x516110})[_0x7be2('0x2d')](function(){return BPromise[_0x7be2('0x73')](_0x36acac,function(_0x159ad0){return db['UserMailQueue'][_0x7be2('0x74')]({'where':{'UserId':_0x159ad0['id'],'MailQueueId':_0x439957[_0x7be2('0x5b')]['id']},'transaction':_0x516110});});})[_0x7be2('0x2d')](function(){_0x36acac[_0x7be2('0x75')](function(_0x441548){socket[_0x7be2('0x76')](_0x7be2('0x77'),{'UserId':_0x441548['id'],'MailQueueId':_0x14fbdc['id']});});});});});}})['then'](respondWithStatusCode(_0xb4ef22,null))[_0x7be2('0x4f')](handleError(_0xb4ef22,null));};exports[_0x7be2('0x78')]=function(_0x41c486,_0x54a756,_0x40f65e){return db[_0x7be2('0x6d')][_0x7be2('0x4d')]({'where':{'id':_0x41c486['query'][_0x7be2('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x7be2('0x6e')],'as':_0x7be2('0x71'),'attributes':['id'],'raw':!![]}]})[_0x7be2('0x2d')](handleEntityNotFound(_0x54a756,null))[_0x7be2('0x2d')](function(_0x393607){var _0x35191b=_[_0x7be2('0x48')](_0x393607,'id');var _0x450ad7=[];var _0x9acc0d=[];var _0x4a6b98=squel[_0x7be2('0x79')]();_0x4a6b98['field'](_0x7be2('0x7a'))['from'](_0x7be2('0x7b'),'tq')['join'](_0x7be2('0x7c'),'ut',_0x7be2('0x7d'))['where'](_0x7be2('0x7e'),_0x41c486[_0x7be2('0x5b')]['id']);for(var _0x40de3b=0x0;_0x40de3b<_0x393607['length'];_0x40de3b+=0x1){let _0x588cb2=_0x393607[_0x40de3b];for(var _0xd0c42=0x0;_0xd0c42<_0x588cb2[_0x7be2('0x71')]['length'];_0xd0c42+=0x1){let _0x1385ed=_0x588cb2[_0x7be2('0x71')][_0xd0c42];var _0x350984=_0x4a6b98[_0x7be2('0x7f')]();_0x350984[_0x7be2('0x45')](_0x7be2('0x80'),_0x1385ed['id']);_0x9acc0d[_0x7be2('0x81')](db[_0x7be2('0x72')][_0x7be2('0x3b')](_0x350984[_0x7be2('0x82')](),{'type':db[_0x7be2('0x72')][_0x7be2('0x83')][_0x7be2('0x84')]})['then'](function(_0x312f26){if(_0x312f26[_0x7be2('0x41')]===0x1){return _0x1385ed['id'];}else{var _0x5ec6ea=_[_0x7be2('0x85')](_[_0x7be2('0x48')](_0x312f26,_0x7be2('0x86')),function(_0x38c5b4){return _[_0x7be2('0x87')](_0x35191b,_0x38c5b4);});if(_0x5ec6ea){return _0x1385ed['id'];}}}));}}return BPromise[_0x7be2('0x88')](_0x9acc0d)['then'](function(_0x44eab1){_0x450ad7=_(_0x450ad7)[_0x7be2('0x89')](_0x44eab1)['compact']()[_0x7be2('0x8a')]();return db[_0x7be2('0x37')]['find']({'where':{'id':_0x41c486[_0x7be2('0x5b')]['id']}})[_0x7be2('0x2d')](function(_0x17ea4c){return db['sequelize'][_0x7be2('0x8b')](function(_0x5387f6){return _0x17ea4c[_0x7be2('0x78')](_0x41c486[_0x7be2('0x3b')][_0x7be2('0x6c')],{'transaction':_0x5387f6})['then'](function(){if(!_[_0x7be2('0x8c')](_0x450ad7)){return _0x17ea4c['removeAgents'](_0x450ad7,{'transaction':_0x5387f6});}})[_0x7be2('0x2d')](function(){_0x450ad7['forEach'](function(_0x3dd834){socket[_0x7be2('0x76')](_0x7be2('0x8d'),{'UserId':_0x3dd834,'MailQueueId':_0x17ea4c['id']});});});});});});})['then'](respondWithStatusCode(_0x54a756,null))[_0x7be2('0x4f')](handleError(_0x54a756,null));};exports[_0x7be2('0x8e')]=function(_0x5495c1,_0x433010,_0x54c910){return db[_0x7be2('0x37')][_0x7be2('0x53')]({'where':{'id':_0x5495c1['params']['id']}})[_0x7be2('0x2d')](handleEntityNotFound(_0x433010,null))[_0x7be2('0x2d')](function(_0x1ebb07){if(_0x1ebb07){return _0x1ebb07[_0x7be2('0x8e')](_0x5495c1[_0x7be2('0x55')][_0x7be2('0x6c')],_['omit'](_0x5495c1[_0x7be2('0x55')],['ids','id'])||{})[_0x7be2('0x8f')](function(_0x392eb8){for(var _0x16090a=0x0;_0x16090a<_0x5495c1[_0x7be2('0x55')][_0x7be2('0x6c')][_0x7be2('0x41')];_0x16090a+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x5495c1[_0x7be2('0x55')]['ids'][_0x16090a]),'MailQueueId':Number(_0x5495c1[_0x7be2('0x5b')]['id'])});}return _0x392eb8;});}})[_0x7be2('0x2d')](respondWithResult(_0x433010,null))[_0x7be2('0x4f')](handleError(_0x433010,null));};exports['removeAgents']=function(_0x4994a1,_0x2e86fd,_0x32e7b0){return db['MailQueue'][_0x7be2('0x53')]({'where':{'id':_0x4994a1[_0x7be2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2e86fd,null))[_0x7be2('0x2d')](function(_0x2bc656){if(_0x2bc656){return _0x2bc656[_0x7be2('0x90')](_0x4994a1['query'][_0x7be2('0x6c')])[_0x7be2('0x2d')](function(){if(_[_0x7be2('0x91')](_0x4994a1['query'][_0x7be2('0x6c')])){for(var _0x28fe1c=0x0;_0x28fe1c<_0x4994a1[_0x7be2('0x3b')][_0x7be2('0x6c')]['length'];_0x28fe1c+=0x1){socket[_0x7be2('0x76')]('userMailQueue:remove',{'UserId':Number(_0x4994a1['query'][_0x7be2('0x6c')][_0x28fe1c]),'MailQueueId':Number(_0x4994a1[_0x7be2('0x5b')]['id'])});}}else{socket[_0x7be2('0x76')]('userMailQueue:remove',{'UserId':Number(_0x4994a1[_0x7be2('0x3b')][_0x7be2('0x6c')]),'MailQueueId':Number(_0x4994a1[_0x7be2('0x5b')]['id'])});}});}})[_0x7be2('0x2d')](respondWithStatusCode(_0x2e86fd,null))['catch'](handleError(_0x2e86fd,null));};exports[_0x7be2('0x92')]=function(_0x5d82d4,_0x9b8111,_0x3b3b6b){var _0x24fa0d={};var _0xfa42a8={};var _0x4e32be;var _0x2a8aaa;return db[_0x7be2('0x37')][_0x7be2('0x5e')]({'where':{'id':_0x5d82d4[_0x7be2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x9b8111,null))[_0x7be2('0x2d')](function(_0x46b983){if(_0x46b983){_0x4e32be=_0x46b983;_0xfa42a8[_0x7be2('0x3e')]=_[_0x7be2('0x52')](db[_0x7be2('0x6e')][_0x7be2('0x51')]);_0xfa42a8[_0x7be2('0x3b')]=_[_0x7be2('0x52')](_0x5d82d4[_0x7be2('0x3b')]);_0xfa42a8['filters']=_[_0x7be2('0x3d')](_0xfa42a8[_0x7be2('0x3e')],_0xfa42a8[_0x7be2('0x3b')]);_0x24fa0d[_0x7be2('0x3f')]=_[_0x7be2('0x3d')](_0xfa42a8[_0x7be2('0x3e')],qs['fields'](_0x5d82d4[_0x7be2('0x3b')][_0x7be2('0x40')]));_0x24fa0d[_0x7be2('0x3f')]=_0x24fa0d[_0x7be2('0x3f')]['length']?_0x24fa0d[_0x7be2('0x3f')]:_0xfa42a8['model'];_0x24fa0d[_0x7be2('0x43')]=qs['sort'](_0x5d82d4['query'][_0x7be2('0x44')]);_0x24fa0d[_0x7be2('0x45')]=qs[_0x7be2('0x3c')](_['pick'](_0x5d82d4[_0x7be2('0x3b')],_0xfa42a8[_0x7be2('0x3c')]));if(_0x5d82d4[_0x7be2('0x3b')][_0x7be2('0x61')]){_0x24fa0d[_0x7be2('0x45')]=_[_0x7be2('0x47')](_0x24fa0d[_0x7be2('0x45')],{'$or':_['map'](_0x24fa0d[_0x7be2('0x3f')],function(_0x2bfda9){var _0x3358f9={};_0x3358f9[_0x2bfda9]={'$like':'%'+_0x5d82d4['query']['filter']+'%'};return _0x3358f9;})});}_0x24fa0d=_['merge']({},_0x24fa0d,_0x5d82d4[_0x7be2('0x4a')]);return _0x4e32be[_0x7be2('0x92')](_0x24fa0d);}})['then'](function(_0x484ec8){if(_0x484ec8){_0x2a8aaa=_0x484ec8['length'];if(!_0x5d82d4[_0x7be2('0x3b')][_0x7be2('0x42')](_0x7be2('0x5f'))){_0x24fa0d[_0x7be2('0x26')]=qs[_0x7be2('0x26')](_0x5d82d4[_0x7be2('0x3b')]['limit']);_0x24fa0d['offset']=qs[_0x7be2('0x23')](_0x5d82d4[_0x7be2('0x3b')][_0x7be2('0x23')]);}return _0x4e32be[_0x7be2('0x92')](_0x24fa0d);}})[_0x7be2('0x2d')](function(_0x454095){if(_0x454095){return _0x454095?{'count':_0x2a8aaa,'rows':_0x454095}:null;}})['then'](respondWithResult(_0x9b8111,null))['catch'](handleError(_0x9b8111,null));}; \ No newline at end of file +var _0x5b45=['QueryTypes','includes','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userMailQueue:save','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','MailQueues','UserProfileResource','then','error','name','send','index','map','MailQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','MailQueueId','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString'];(function(_0xd3b0ac,_0x2f5065){var _0x3d773e=function(_0x2e10d1){while(--_0x2e10d1){_0xd3b0ac['push'](_0xd3b0ac['shift']());}};_0x3d773e(++_0x2f5065);}(_0x5b45,0x1d0));var _0x55b4=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0x5b45[_0x1ee62e];return _0x27c6c8;};'use strict';var emlformat=require(_0x55b4('0x0'));var rimraf=require(_0x55b4('0x1'));var zipdir=require(_0x55b4('0x2'));var jsonpatch=require(_0x55b4('0x3'));var rp=require(_0x55b4('0x4'));var moment=require(_0x55b4('0x5'));var BPromise=require(_0x55b4('0x6'));var Mustache=require(_0x55b4('0x7'));var util=require(_0x55b4('0x8'));var path=require(_0x55b4('0x9'));var sox=require(_0x55b4('0xa'));var csv=require(_0x55b4('0xb'));var ejs=require(_0x55b4('0xc'));var fs=require('fs');var fs_extra=require(_0x55b4('0xd'));var _=require(_0x55b4('0xe'));var squel=require(_0x55b4('0xf'));var crypto=require(_0x55b4('0x10'));var jsforce=require(_0x55b4('0x11'));var deskjs=require(_0x55b4('0x12'));var toCsv=require(_0x55b4('0xb'));var querystring=require(_0x55b4('0x13'));var Papa=require(_0x55b4('0x14'));var Redis=require('ioredis');var authService=require(_0x55b4('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x55b4('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55b4('0x17'))(_0x55b4('0x18'));var utils=require(_0x55b4('0x19'));var config=require(_0x55b4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x55b4('0x1b'))['db'];config[_0x55b4('0x1c')]=_[_0x55b4('0x1d')](config[_0x55b4('0x1c')],{'host':_0x55b4('0x1e'),'port':0x18eb});var socket=require(_0x55b4('0x1f'))(new Redis(config[_0x55b4('0x1c')]));require(_0x55b4('0x20'))[_0x55b4('0x21')](socket);function respondWithStatusCode(_0x202b28,_0x2ae9fc){_0x2ae9fc=_0x2ae9fc||0xcc;return function(_0x2db230){if(_0x2db230){return _0x202b28[_0x55b4('0x22')](_0x2ae9fc);}return _0x202b28[_0x55b4('0x23')](_0x2ae9fc)[_0x55b4('0x24')]();};}function respondWithResult(_0x329f51,_0x52d727){_0x52d727=_0x52d727||0xc8;return function(_0x102d32){if(_0x102d32){return _0x329f51[_0x55b4('0x23')](_0x52d727)[_0x55b4('0x25')](_0x102d32);}};}function respondWithFilteredResult(_0x3f5bab,_0x69faba){return function(_0xb61776){if(_0xb61776){var _0x3346de=typeof _0x69faba[_0x55b4('0x26')]===_0x55b4('0x27')&&typeof _0x69faba[_0x55b4('0x28')]==='undefined';var _0x2be68a=_0xb61776['count'];var _0x2b0a81=_0x3346de?0x0:_0x69faba['offset'];var _0x38c1ab=_0x3346de?_0xb61776[_0x55b4('0x29')]:_0x69faba['offset']+_0x69faba[_0x55b4('0x28')];var _0x166c6c;if(_0x38c1ab>=_0x2be68a){_0x38c1ab=_0x2be68a;_0x166c6c=0xc8;}else{_0x166c6c=0xce;}_0x3f5bab[_0x55b4('0x23')](_0x166c6c);return _0x3f5bab[_0x55b4('0x2a')](_0x55b4('0x2b'),_0x2b0a81+'-'+_0x38c1ab+'/'+_0x2be68a)[_0x55b4('0x25')](_0xb61776);}return null;};}function patchUpdates(_0x4400cd){return function(_0x364a0e){try{jsonpatch['apply'](_0x364a0e,_0x4400cd,!![]);}catch(_0x528dd2){return BPromise[_0x55b4('0x2c')](_0x528dd2);}return _0x364a0e[_0x55b4('0x2d')]();};}function saveUpdates(_0x3ff8d2,_0x235c36){return function(_0x59d5b7){if(_0x59d5b7){return _0x59d5b7[_0x55b4('0x2e')](_0x3ff8d2)['then'](function(_0x1146d0){return _0x1146d0;});}return null;};}function removeEntity(_0x25a5b9,_0x679f96){return function(_0x10e0e4){if(_0x10e0e4){return _0x10e0e4[_0x55b4('0x2f')]()['then'](function(){var _0x448104=_0x10e0e4[_0x55b4('0x30')]({'plain':!![]});var _0x3ae300=_0x55b4('0x31');return db[_0x55b4('0x32')]['destroy']({'where':{'type':_0x3ae300,'resourceId':_0x448104['id']}})[_0x55b4('0x33')](function(){return _0x10e0e4;});})['then'](function(){_0x25a5b9[_0x55b4('0x23')](0xcc)[_0x55b4('0x24')]();});}};}function handleEntityNotFound(_0x22e05f,_0x1f3706){return function(_0x184cc1){if(!_0x184cc1){_0x22e05f['sendStatus'](0x194);}return _0x184cc1;};}function handleError(_0x1b76a9,_0xee71f8){_0xee71f8=_0xee71f8||0x1f4;return function(_0x6891bd){logger[_0x55b4('0x34')](_0x6891bd['stack']);if(_0x6891bd[_0x55b4('0x35')]){delete _0x6891bd[_0x55b4('0x35')];}_0x1b76a9[_0x55b4('0x23')](_0xee71f8)[_0x55b4('0x36')](_0x6891bd);};}exports[_0x55b4('0x37')]=function(_0x3f01c0,_0x12ac33){var _0x51e309={},_0x7d7c82={},_0x25d533={'count':0x0,'rows':[]};var _0x53e2d5=_[_0x55b4('0x38')](db[_0x55b4('0x39')]['rawAttributes'],function(_0x2ec315){return{'name':_0x2ec315[_0x55b4('0x3a')],'type':_0x2ec315['type'][_0x55b4('0x3b')]};});_0x7d7c82[_0x55b4('0x3c')]=_['map'](_0x53e2d5,'name');_0x7d7c82[_0x55b4('0x3d')]=_[_0x55b4('0x3e')](_0x3f01c0[_0x55b4('0x3d')]);_0x7d7c82[_0x55b4('0x3f')]=_[_0x55b4('0x40')](_0x7d7c82[_0x55b4('0x3c')],_0x7d7c82[_0x55b4('0x3d')]);_0x51e309[_0x55b4('0x41')]=_[_0x55b4('0x40')](_0x7d7c82[_0x55b4('0x3c')],qs[_0x55b4('0x42')](_0x3f01c0[_0x55b4('0x3d')][_0x55b4('0x42')]));_0x51e309[_0x55b4('0x41')]=_0x51e309['attributes'][_0x55b4('0x43')]?_0x51e309[_0x55b4('0x41')]:_0x7d7c82[_0x55b4('0x3c')];if(!_0x3f01c0['query']['hasOwnProperty'](_0x55b4('0x44'))){_0x51e309['limit']=qs[_0x55b4('0x28')](_0x3f01c0[_0x55b4('0x3d')]['limit']);_0x51e309[_0x55b4('0x26')]=qs['offset'](_0x3f01c0[_0x55b4('0x3d')]['offset']);}_0x51e309[_0x55b4('0x45')]=qs['sort'](_0x3f01c0['query'][_0x55b4('0x46')]);_0x51e309[_0x55b4('0x47')]=qs[_0x55b4('0x3f')](_[_0x55b4('0x48')](_0x3f01c0['query'],_0x7d7c82['filters']),_0x53e2d5);if(_0x3f01c0['query'][_0x55b4('0x49')]){_0x51e309[_0x55b4('0x47')]=_[_0x55b4('0x4a')](_0x51e309['where'],{'$or':_['map'](_0x53e2d5,function(_0x44f545){if(_0x44f545[_0x55b4('0x4b')]!=='VIRTUAL'){var _0x404234={};_0x404234[_0x44f545[_0x55b4('0x35')]]={'$like':'%'+_0x3f01c0['query'][_0x55b4('0x49')]+'%'};return _0x404234;}})});}_0x51e309=_[_0x55b4('0x4a')]({},_0x51e309,_0x3f01c0[_0x55b4('0x4c')]);var _0x4ab14b={'where':_0x51e309[_0x55b4('0x47')]};return db[_0x55b4('0x39')][_0x55b4('0x29')](_0x4ab14b)[_0x55b4('0x33')](function(_0x57b5b2){_0x25d533[_0x55b4('0x29')]=_0x57b5b2;if(_0x3f01c0[_0x55b4('0x3d')][_0x55b4('0x4d')]){_0x51e309[_0x55b4('0x4e')]=[{'all':!![]}];}return db[_0x55b4('0x39')][_0x55b4('0x4f')](_0x51e309);})['then'](function(_0x17de9b){_0x25d533[_0x55b4('0x50')]=_0x17de9b;return _0x25d533;})[_0x55b4('0x33')](respondWithFilteredResult(_0x12ac33,_0x51e309))[_0x55b4('0x51')](handleError(_0x12ac33,null));};exports['show']=function(_0x333010,_0x3d7bc9){var _0x5696c1={'raw':!![],'where':{'id':_0x333010[_0x55b4('0x52')]['id']}},_0xe3de14={};_0xe3de14[_0x55b4('0x3c')]=_[_0x55b4('0x3e')](db[_0x55b4('0x39')][_0x55b4('0x53')]);_0xe3de14[_0x55b4('0x3d')]=_['keys'](_0x333010[_0x55b4('0x3d')]);_0xe3de14[_0x55b4('0x3f')]=_[_0x55b4('0x40')](_0xe3de14[_0x55b4('0x3c')],_0xe3de14['query']);_0x5696c1[_0x55b4('0x41')]=_[_0x55b4('0x40')](_0xe3de14[_0x55b4('0x3c')],qs[_0x55b4('0x42')](_0x333010[_0x55b4('0x3d')]['fields']));_0x5696c1['attributes']=_0x5696c1[_0x55b4('0x41')][_0x55b4('0x43')]?_0x5696c1[_0x55b4('0x41')]:_0xe3de14[_0x55b4('0x3c')];if(_0x333010[_0x55b4('0x3d')][_0x55b4('0x4d')]){_0x5696c1['include']=[{'all':!![]}];}_0x5696c1=_[_0x55b4('0x4a')]({},_0x5696c1,_0x333010['options']);return db[_0x55b4('0x39')][_0x55b4('0x54')](_0x5696c1)['then'](handleEntityNotFound(_0x3d7bc9,null))['then'](respondWithResult(_0x3d7bc9,null))[_0x55b4('0x51')](handleError(_0x3d7bc9,null));};exports[_0x55b4('0x55')]=function(_0xb21791,_0x359e4b){return db[_0x55b4('0x39')][_0x55b4('0x55')](_0xb21791[_0x55b4('0x56')],{})[_0x55b4('0x33')](function(_0x134e1c){var _0x187e97=_0xb21791[_0x55b4('0x57')]['get']({'plain':!![]});if(!_0x187e97)throw new Error(_0x55b4('0x58'));if(_0x187e97[_0x55b4('0x59')]===_0x55b4('0x57')){var _0x3a9f6a=_0x134e1c[_0x55b4('0x30')]({'plain':!![]});var _0x319efb=_0x55b4('0x31');return db[_0x55b4('0x5a')][_0x55b4('0x54')]({'where':{'name':_0x319efb,'userProfileId':_0x187e97[_0x55b4('0x5b')]},'raw':!![]})[_0x55b4('0x33')](function(_0x3b2d8c){if(_0x3b2d8c&&_0x3b2d8c[_0x55b4('0x5c')]===0x0){return db[_0x55b4('0x32')][_0x55b4('0x55')]({'name':_0x3a9f6a[_0x55b4('0x35')],'resourceId':_0x3a9f6a['id'],'type':_0x3b2d8c[_0x55b4('0x35')],'sectionId':_0x3b2d8c['id']},{})[_0x55b4('0x33')](function(){return _0x134e1c;});}else{return _0x134e1c;}})[_0x55b4('0x51')](function(_0x116edb){logger['error'](_0x55b4('0x5d'),_0x116edb);throw _0x116edb;});}return _0x134e1c;})['then'](respondWithResult(_0x359e4b,0xc9))[_0x55b4('0x51')](handleError(_0x359e4b,null));};exports[_0x55b4('0x2e')]=function(_0x4b56a0,_0xb9a678){if(_0x4b56a0[_0x55b4('0x56')]['id']){delete _0x4b56a0[_0x55b4('0x56')]['id'];}return db['MailQueue'][_0x55b4('0x54')]({'where':{'id':_0x4b56a0[_0x55b4('0x52')]['id']}})['then'](handleEntityNotFound(_0xb9a678,null))[_0x55b4('0x33')](saveUpdates(_0x4b56a0[_0x55b4('0x56')],null))[_0x55b4('0x33')](respondWithResult(_0xb9a678,null))['catch'](handleError(_0xb9a678,null));};exports[_0x55b4('0x2f')]=function(_0x17aaa5,_0x4adf09){return db[_0x55b4('0x39')][_0x55b4('0x54')]({'where':{'id':_0x17aaa5[_0x55b4('0x52')]['id']}})[_0x55b4('0x33')](handleEntityNotFound(_0x4adf09,null))['then'](removeEntity(_0x4adf09,null))[_0x55b4('0x51')](handleError(_0x4adf09,null));};exports[_0x55b4('0x5e')]=function(_0x5adeb3,_0x32eebf){return db[_0x55b4('0x39')][_0x55b4('0x5e')]()[_0x55b4('0x33')](respondWithResult(_0x32eebf,null))['catch'](handleError(_0x32eebf,null));};exports[_0x55b4('0x5f')]=function(_0xdc589f,_0xc75c71,_0x1001f5){var _0x316cc3={'raw':!![],'where':{}},_0x5bc5e6={},_0x386a3e;return db[_0x55b4('0x39')][_0x55b4('0x60')]({'where':{'id':_0xdc589f[_0x55b4('0x52')]['id']}})[_0x55b4('0x33')](handleEntityNotFound(_0xc75c71,null))[_0x55b4('0x33')](function(_0xea04aa){if(_0xea04aa){_0x386a3e=_0xea04aa[_0x55b4('0x30')]({'plain':!![]});_0x5bc5e6[_0x55b4('0x3c')]=_[_0x55b4('0x3e')](db[_0x55b4('0x61')][_0x55b4('0x53')]);_0x5bc5e6[_0x55b4('0x3d')]=_[_0x55b4('0x3e')](_0xdc589f['query']);_0x5bc5e6[_0x55b4('0x3f')]=_['intersection'](_0x5bc5e6[_0x55b4('0x3c')],_0x5bc5e6['query']);_0x316cc3['attributes']=_[_0x55b4('0x40')](_0x5bc5e6['model'],qs['fields'](_0xdc589f[_0x55b4('0x3d')][_0x55b4('0x42')]));_0x316cc3[_0x55b4('0x41')]=_0x316cc3[_0x55b4('0x41')][_0x55b4('0x43')]?_0x316cc3[_0x55b4('0x41')]:_0x5bc5e6['model'];if(!_0xdc589f[_0x55b4('0x3d')][_0x55b4('0x62')](_0x55b4('0x44'))){_0x316cc3[_0x55b4('0x28')]=qs[_0x55b4('0x28')](_0xdc589f[_0x55b4('0x3d')][_0x55b4('0x28')]);_0x316cc3['offset']=qs[_0x55b4('0x26')](_0xdc589f['query'][_0x55b4('0x26')]);}_0x316cc3['order']=qs['sort'](_0xdc589f[_0x55b4('0x3d')]['sort']);_0x316cc3[_0x55b4('0x47')]=qs[_0x55b4('0x3f')](_[_0x55b4('0x48')](_0xdc589f[_0x55b4('0x3d')],_0x5bc5e6[_0x55b4('0x3f')]));_0x316cc3[_0x55b4('0x47')][_0x55b4('0x63')]=_0xea04aa['id'];if(_0xdc589f[_0x55b4('0x3d')]['filter']){_0x316cc3[_0x55b4('0x47')]=_[_0x55b4('0x4a')](_0x316cc3[_0x55b4('0x47')],{'$or':_[_0x55b4('0x38')](_0x316cc3[_0x55b4('0x41')],function(_0x577bed){var _0x299251={};_0x299251[_0x577bed]={'$like':'%'+_0xdc589f[_0x55b4('0x3d')]['filter']+'%'};return _0x299251;})});}_0x316cc3=_[_0x55b4('0x4a')]({},_0x316cc3,_0xdc589f[_0x55b4('0x4c')]);return db[_0x55b4('0x61')][_0x55b4('0x4f')](_0x316cc3);}})[_0x55b4('0x33')](function(_0x2c29d4){if(_0x2c29d4){return db['User'][_0x55b4('0x64')]({'where':{'id':_[_0x55b4('0x38')](_0x2c29d4,_0x55b4('0x65')),'role':_0x55b4('0x66')},'attributes':['id',_0x55b4('0x35'),_0x55b4('0x67'),'updatedAt',_0x55b4('0x68')]});}})[_0x55b4('0x33')](function(_0x3bff01){if(_0x3bff01){return{'count':_0x3bff01[_0x55b4('0x29')],'rows':_[_0x55b4('0x38')](_0x3bff01['rows'],function(_0x5e2335){return{'membername':_0x5e2335[_0x55b4('0x35')],'UserId':_0x5e2335['id'],'queue_name':_0x386a3e['name'],'MailQueueId':_0x386a3e['id'],'interface':util[_0x55b4('0x69')](_0x55b4('0x6a'),_0x55b4('0x6b'),_0x5e2335['name']),'penalty':0x0,'paused':_0x5e2335[_0x55b4('0x67')],'createdAt':_0x5e2335['createdAt'],'updatedAt':_0x5e2335[_0x55b4('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x55b4('0x33')](respondWithFilteredResult(_0xc75c71,_0x316cc3))[_0x55b4('0x51')](handleError(_0xc75c71,null));};exports[_0x55b4('0x6d')]=function(_0x4b5894,_0x2850a2,_0x63f273){var _0x48505f={};var _0x17add5={};var _0x5d9e00;var _0x1c784c;return db[_0x55b4('0x39')][_0x55b4('0x60')]({'where':{'id':_0x4b5894['params']['id']}})[_0x55b4('0x33')](handleEntityNotFound(_0x2850a2,null))[_0x55b4('0x33')](function(_0x582c09){if(_0x582c09){_0x5d9e00=_0x582c09;_0x17add5[_0x55b4('0x3c')]=_[_0x55b4('0x3e')](db[_0x55b4('0x6e')]['rawAttributes']);_0x17add5[_0x55b4('0x3d')]=_[_0x55b4('0x3e')](_0x4b5894[_0x55b4('0x3d')]);_0x17add5[_0x55b4('0x3f')]=_[_0x55b4('0x40')](_0x17add5[_0x55b4('0x3c')],_0x17add5[_0x55b4('0x3d')]);_0x48505f[_0x55b4('0x41')]=_[_0x55b4('0x40')](_0x17add5[_0x55b4('0x3c')],qs['fields'](_0x4b5894[_0x55b4('0x3d')]['fields']));_0x48505f[_0x55b4('0x41')]=_0x48505f[_0x55b4('0x41')][_0x55b4('0x43')]?_0x48505f[_0x55b4('0x41')]:_0x17add5[_0x55b4('0x3c')];_0x48505f[_0x55b4('0x45')]=qs[_0x55b4('0x46')](_0x4b5894['query'][_0x55b4('0x46')]);_0x48505f[_0x55b4('0x47')]=qs[_0x55b4('0x3f')](_[_0x55b4('0x48')](_0x4b5894[_0x55b4('0x3d')],_0x17add5['filters']));if(_0x4b5894['query']['filter']){_0x48505f[_0x55b4('0x47')]=_[_0x55b4('0x4a')](_0x48505f[_0x55b4('0x47')],{'$or':_[_0x55b4('0x38')](_0x48505f[_0x55b4('0x41')],function(_0x2c1527){var _0x2ec006={};_0x2ec006[_0x2c1527]={'$like':'%'+_0x4b5894['query'][_0x55b4('0x49')]+'%'};return _0x2ec006;})});}_0x48505f=_[_0x55b4('0x4a')]({},_0x48505f,_0x4b5894[_0x55b4('0x4c')]);return _0x5d9e00[_0x55b4('0x6d')](_0x48505f);}})[_0x55b4('0x33')](function(_0x226744){if(_0x226744){_0x1c784c=_0x226744[_0x55b4('0x43')];if(!_0x4b5894[_0x55b4('0x3d')]['hasOwnProperty']('nolimit')){_0x48505f[_0x55b4('0x28')]=qs[_0x55b4('0x28')](_0x4b5894['query'][_0x55b4('0x28')]);_0x48505f[_0x55b4('0x26')]=qs[_0x55b4('0x26')](_0x4b5894['query'][_0x55b4('0x26')]);}return _0x5d9e00[_0x55b4('0x6d')](_0x48505f);}})[_0x55b4('0x33')](function(_0x3c026c){if(_0x3c026c){return _0x3c026c?{'count':_0x1c784c,'rows':_0x3c026c}:null;}})[_0x55b4('0x33')](respondWithResult(_0x2850a2,null))['catch'](handleError(_0x2850a2,null));};exports[_0x55b4('0x6f')]=function(_0xff46fd,_0x2f9827,_0x591fc3){var _0x4b34f8=_0xff46fd[_0x55b4('0x56')]['ids'];return db[_0x55b4('0x6e')][_0x55b4('0x4f')]({'where':{'id':_0x4b34f8},'attributes':['id'],'include':[{'model':db[_0x55b4('0x70')],'as':_0x55b4('0x71'),'attributes':['id',_0x55b4('0x35'),_0x55b4('0x72'),_0x55b4('0x73'),_0x55b4('0x74')],'raw':!![]}]})['then'](function(_0x3c02a2){if(_0x3c02a2){var _0x2c1cac=_['flatMap'](_0x3c02a2,function(_0x4407da){var _0x5d308f=_0x4407da[_0x55b4('0x30')]({'plain':!![]});return _0x5d308f[_0x55b4('0x71')];});return db[_0x55b4('0x39')][_0x55b4('0x54')]({'where':{'id':_0xff46fd[_0x55b4('0x52')]['id']}})['then'](function(_0x339535){return db['sequelize'][_0x55b4('0x75')](function(_0x37b87f){return _0x339535[_0x55b4('0x6f')](_0x4b34f8,{'transaction':_0x37b87f})['then'](function(){return BPromise[_0x55b4('0x76')](_0x2c1cac,function(_0x339977){return db[_0x55b4('0x61')][_0x55b4('0x77')]({'where':{'UserId':_0x339977['id'],'MailQueueId':_0xff46fd[_0x55b4('0x52')]['id']},'transaction':_0x37b87f});});})[_0x55b4('0x33')](function(){_0x2c1cac[_0x55b4('0x78')](function(_0x2ce72f){socket[_0x55b4('0x79')]('userMailQueue:save',{'UserId':_0x2ce72f['id'],'MailQueueId':_0x339535['id']});});});});});}})[_0x55b4('0x33')](respondWithStatusCode(_0x2f9827,null))[_0x55b4('0x51')](handleError(_0x2f9827,null));};exports[_0x55b4('0x7a')]=function(_0x3a128c,_0x436cb,_0x3572c1){return db['Team'][_0x55b4('0x4f')]({'where':{'id':_0x3a128c[_0x55b4('0x3d')][_0x55b4('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x55b4('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x436cb,null))['then'](function(_0x366371){var _0x5d6b87=_[_0x55b4('0x38')](_0x366371,'id');var _0x175c48=[];var _0x36fcfb=[];var _0x19863d=squel[_0x55b4('0x7c')]();_0x19863d[_0x55b4('0x7d')](_0x55b4('0x7e'))['from'](_0x55b4('0x7f'),'tq')[_0x55b4('0x80')](_0x55b4('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x55b4('0x47')](_0x55b4('0x82'),_0x3a128c['params']['id']);for(var _0xa65010=0x0;_0xa65010<_0x366371[_0x55b4('0x43')];_0xa65010+=0x1){let _0x57a22d=_0x366371[_0xa65010];for(var _0x53282f=0x0;_0x53282f<_0x57a22d[_0x55b4('0x71')][_0x55b4('0x43')];_0x53282f+=0x1){let _0x9bbeec=_0x57a22d[_0x55b4('0x71')][_0x53282f];var _0x3dd6eb=_0x19863d[_0x55b4('0x83')]();_0x3dd6eb[_0x55b4('0x47')](_0x55b4('0x84'),_0x9bbeec['id']);_0x36fcfb[_0x55b4('0x85')](db[_0x55b4('0x86')][_0x55b4('0x3d')](_0x3dd6eb[_0x55b4('0x87')](),{'type':db[_0x55b4('0x86')][_0x55b4('0x88')]['SELECT']})['then'](function(_0x392806){if(_0x392806[_0x55b4('0x43')]===0x1){return _0x9bbeec['id'];}else{var _0x5157a5=_['every'](_['map'](_0x392806,'TeamId'),function(_0x442d2f){return _[_0x55b4('0x89')](_0x5d6b87,_0x442d2f);});if(_0x5157a5){return _0x9bbeec['id'];}}}));}}return BPromise['all'](_0x36fcfb)[_0x55b4('0x33')](function(_0x207daa){_0x175c48=_(_0x175c48)[_0x55b4('0x8a')](_0x207daa)[_0x55b4('0x8b')]()[_0x55b4('0x8c')]();return db[_0x55b4('0x39')][_0x55b4('0x54')]({'where':{'id':_0x3a128c[_0x55b4('0x52')]['id']}})[_0x55b4('0x33')](function(_0x434129){return db['sequelize'][_0x55b4('0x75')](function(_0x5e0c37){return _0x434129['removeTeams'](_0x3a128c[_0x55b4('0x3d')][_0x55b4('0x7b')],{'transaction':_0x5e0c37})[_0x55b4('0x33')](function(){if(!_[_0x55b4('0x8d')](_0x175c48)){return _0x434129[_0x55b4('0x8e')](_0x175c48,{'transaction':_0x5e0c37});}})['then'](function(){_0x175c48['forEach'](function(_0x452535){socket[_0x55b4('0x79')]('userMailQueue:remove',{'UserId':_0x452535,'MailQueueId':_0x434129['id']});});});});});});})[_0x55b4('0x33')](respondWithStatusCode(_0x436cb,null))[_0x55b4('0x51')](handleError(_0x436cb,null));};exports[_0x55b4('0x8f')]=function(_0x10c5e8,_0x3aa04c,_0x157ea7){return db[_0x55b4('0x39')]['find']({'where':{'id':_0x10c5e8[_0x55b4('0x52')]['id']}})[_0x55b4('0x33')](handleEntityNotFound(_0x3aa04c,null))['then'](function(_0x88013){if(_0x88013){return _0x88013['addAgents'](_0x10c5e8[_0x55b4('0x56')][_0x55b4('0x7b')],_[_0x55b4('0x90')](_0x10c5e8[_0x55b4('0x56')],[_0x55b4('0x7b'),'id'])||{})[_0x55b4('0x91')](function(_0x539fd7){for(var _0x11ef44=0x0;_0x11ef44<_0x10c5e8['body'][_0x55b4('0x7b')][_0x55b4('0x43')];_0x11ef44+=0x1){socket['emit'](_0x55b4('0x92'),{'UserId':Number(_0x10c5e8[_0x55b4('0x56')][_0x55b4('0x7b')][_0x11ef44]),'MailQueueId':Number(_0x10c5e8[_0x55b4('0x52')]['id'])});}return _0x539fd7;});}})[_0x55b4('0x33')](respondWithResult(_0x3aa04c,null))[_0x55b4('0x51')](handleError(_0x3aa04c,null));};exports[_0x55b4('0x8e')]=function(_0x5c14f9,_0x32eaae,_0x3bf8c8){return db[_0x55b4('0x39')]['find']({'where':{'id':_0x5c14f9[_0x55b4('0x52')]['id']}})[_0x55b4('0x33')](handleEntityNotFound(_0x32eaae,null))[_0x55b4('0x33')](function(_0x5a60f2){if(_0x5a60f2){return _0x5a60f2['removeAgents'](_0x5c14f9[_0x55b4('0x3d')][_0x55b4('0x7b')])[_0x55b4('0x33')](function(){if(_[_0x55b4('0x93')](_0x5c14f9['query']['ids'])){for(var _0x4027e9=0x0;_0x4027e9<_0x5c14f9[_0x55b4('0x3d')][_0x55b4('0x7b')]['length'];_0x4027e9+=0x1){socket['emit'](_0x55b4('0x94'),{'UserId':Number(_0x5c14f9['query'][_0x55b4('0x7b')][_0x4027e9]),'MailQueueId':Number(_0x5c14f9[_0x55b4('0x52')]['id'])});}}else{socket[_0x55b4('0x79')](_0x55b4('0x94'),{'UserId':Number(_0x5c14f9[_0x55b4('0x3d')][_0x55b4('0x7b')]),'MailQueueId':Number(_0x5c14f9[_0x55b4('0x52')]['id'])});}});}})[_0x55b4('0x33')](respondWithStatusCode(_0x32eaae,null))['catch'](handleError(_0x32eaae,null));};exports[_0x55b4('0x95')]=function(_0xf9b169,_0x355eba,_0x253208){var _0xf0633d={};var _0x43668e={};var _0x29c899;var _0x235557;return db[_0x55b4('0x39')]['findOne']({'where':{'id':_0xf9b169[_0x55b4('0x52')]['id']}})[_0x55b4('0x33')](handleEntityNotFound(_0x355eba,null))[_0x55b4('0x33')](function(_0x346044){if(_0x346044){_0x29c899=_0x346044;_0x43668e['model']=_[_0x55b4('0x3e')](db[_0x55b4('0x70')]['rawAttributes']);_0x43668e['query']=_['keys'](_0xf9b169[_0x55b4('0x3d')]);_0x43668e['filters']=_[_0x55b4('0x40')](_0x43668e[_0x55b4('0x3c')],_0x43668e['query']);_0xf0633d['attributes']=_[_0x55b4('0x40')](_0x43668e[_0x55b4('0x3c')],qs['fields'](_0xf9b169['query'][_0x55b4('0x42')]));_0xf0633d[_0x55b4('0x41')]=_0xf0633d[_0x55b4('0x41')]['length']?_0xf0633d[_0x55b4('0x41')]:_0x43668e['model'];_0xf0633d['order']=qs['sort'](_0xf9b169[_0x55b4('0x3d')][_0x55b4('0x46')]);_0xf0633d[_0x55b4('0x47')]=qs[_0x55b4('0x3f')](_[_0x55b4('0x48')](_0xf9b169[_0x55b4('0x3d')],_0x43668e[_0x55b4('0x3f')]));if(_0xf9b169[_0x55b4('0x3d')]['filter']){_0xf0633d[_0x55b4('0x47')]=_[_0x55b4('0x4a')](_0xf0633d[_0x55b4('0x47')],{'$or':_['map'](_0xf0633d[_0x55b4('0x41')],function(_0x3b7ea6){var _0x29a7cb={};_0x29a7cb[_0x3b7ea6]={'$like':'%'+_0xf9b169[_0x55b4('0x3d')][_0x55b4('0x49')]+'%'};return _0x29a7cb;})});}_0xf0633d=_[_0x55b4('0x4a')]({},_0xf0633d,_0xf9b169[_0x55b4('0x4c')]);return _0x29c899[_0x55b4('0x95')](_0xf0633d);}})[_0x55b4('0x33')](function(_0x15317c){if(_0x15317c){_0x235557=_0x15317c['length'];if(!_0xf9b169[_0x55b4('0x3d')][_0x55b4('0x62')](_0x55b4('0x44'))){_0xf0633d[_0x55b4('0x28')]=qs['limit'](_0xf9b169[_0x55b4('0x3d')][_0x55b4('0x28')]);_0xf0633d[_0x55b4('0x26')]=qs[_0x55b4('0x26')](_0xf9b169['query'][_0x55b4('0x26')]);}return _0x29c899[_0x55b4('0x95')](_0xf0633d);}})[_0x55b4('0x33')](function(_0x17fecd){if(_0x17fecd){return _0x17fecd?{'count':_0x235557,'rows':_0x17fecd}:null;}})[_0x55b4('0x33')](respondWithResult(_0x355eba,null))[_0x55b4('0x51')](handleError(_0x355eba,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 1522ca9..358e5c5 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 _0x18ed=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x565475,_0x5182a4){var _0x3412b0=function(_0x3285e0){while(--_0x3285e0){_0x565475['push'](_0x565475['shift']());}};_0x3412b0(++_0x5182a4);}(_0x18ed,0x8d));var _0xd18e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x18ed[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xd18e('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd18e('0x1')](0x0);var events={'afterCreate':_0xd18e('0x2'),'afterUpdate':_0xd18e('0x3'),'afterDestroy':_0xd18e('0x4')};function emitEvent(_0x31bbf7){return function(_0x17fd42,_0x40153e,_0x284a63){MailQueueEvents[_0xd18e('0x5')](_0x31bbf7+':'+_0x17fd42['id'],_0x17fd42);MailQueueEvents[_0xd18e('0x5')](_0x31bbf7,_0x17fd42);_0x284a63(null);};}for(var e in events){if(events[_0xd18e('0x6')](e)){var event=events[e];MailQueue[_0xd18e('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x3bcd=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x139b41,_0x2e1943){var _0x34101e=function(_0x55d838){while(--_0x55d838){_0x139b41['push'](_0x139b41['shift']());}};_0x34101e(++_0x2e1943);}(_0x3bcd,0x66));var _0xd3bc=function(_0x7a242a,_0x423353){_0x7a242a=_0x7a242a-0x0;var _0x3b20c3=_0x3bcd[_0x7a242a];return _0x3b20c3;};'use strict';var EventEmitter=require(_0xd3bc('0x0'));var MailQueue=require(_0xd3bc('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd3bc('0x2')](0x0);var events={'afterCreate':_0xd3bc('0x3'),'afterUpdate':_0xd3bc('0x4'),'afterDestroy':_0xd3bc('0x5')};function emitEvent(_0x590fe0){return function(_0x3c2543,_0x5dc94d,_0x3f97be){MailQueueEvents[_0xd3bc('0x6')](_0x590fe0+':'+_0x3c2543['id'],_0x3c2543);MailQueueEvents[_0xd3bc('0x6')](_0x590fe0,_0x3c2543);_0x3f97be(null);};}for(var e in events){if(events[_0xd3bc('0x7')](e)){var event=events[e];MailQueue[_0xd3bc('0x8')](e,emitEvent(event));}}module[_0xd3bc('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 94a09b7..31af21f 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 _0xc7fb=['define','MailQueue','mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0xc7fb,0xe0));var _0xbc7f=function(_0x40d27d,_0x477a94){_0x40d27d=_0x40d27d-0x0;var _0x5da54d=_0xc7fb[_0x40d27d];return _0x5da54d;};'use strict';var _=require('lodash');var util=require(_0xbc7f('0x0'));var logger=require(_0xbc7f('0x1'))(_0xbc7f('0x2'));var moment=require(_0xbc7f('0x3'));var BPromise=require(_0xbc7f('0x4'));var rp=require(_0xbc7f('0x5'));var fs=require('fs');var path=require(_0xbc7f('0x6'));var rimraf=require('rimraf');var config=require(_0xbc7f('0x7'));var attributes=require(_0xbc7f('0x8'));module[_0xbc7f('0x9')]=function(_0xda642b,_0x192cd2){return _0xda642b[_0xbc7f('0xa')](_0xbc7f('0xb'),attributes,{'tableName':_0xbc7f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab46=['./mailQueue.attributes','exports','define','MailQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3a3d83,_0x419a5a){var _0x2b9c43=function(_0xf5df50){while(--_0xf5df50){_0x3a3d83['push'](_0x3a3d83['shift']());}};_0x2b9c43(++_0x419a5a);}(_0xab46,0x10c));var _0x6ab4=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0xab46[_0xd299c3];return _0x376574;};'use strict';var _=require(_0x6ab4('0x0'));var util=require('util');var logger=require(_0x6ab4('0x1'))(_0x6ab4('0x2'));var moment=require(_0x6ab4('0x3'));var BPromise=require(_0x6ab4('0x4'));var rp=require(_0x6ab4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ab4('0x6'));var config=require(_0x6ab4('0x7'));var attributes=require(_0x6ab4('0x8'));module[_0x6ab4('0x9')]=function(_0x2355bf,_0x5dc95e){return _0x2355bf[_0x6ab4('0xa')](_0x6ab4('0xb'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 9030dda..24be6f3 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 _0x86be=['localhost','socket.io-emitter','./mailQueue.socket','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','MailQueue,\x20%s,\x20%s','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','map','include','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x4f8d23,_0x5e79fb){var _0x396ebb=function(_0x7a00cc){while(--_0x7a00cc){_0x4f8d23['push'](_0x4f8d23['shift']());}};_0x396ebb(++_0x5e79fb);}(_0x86be,0x1b5));var _0xe86b=function(_0x199594,_0x135dc6){_0x199594=_0x199594-0x0;var _0x20f574=_0x86be[_0x199594];return _0x20f574;};'use strict';var _=require(_0xe86b('0x0'));var util=require(_0xe86b('0x1'));var moment=require(_0xe86b('0x2'));var BPromise=require(_0xe86b('0x3'));var rs=require(_0xe86b('0x4'));var fs=require('fs');var Redis=require(_0xe86b('0x5'));var db=require(_0xe86b('0x6'))['db'];var utils=require(_0xe86b('0x7'));var logger=require(_0xe86b('0x8'))(_0xe86b('0x9'));var config=require(_0xe86b('0xa'));var jayson=require(_0xe86b('0xb'));var client=jayson['client'][_0xe86b('0xc')]({'port':0x232a});config['redis']=_[_0xe86b('0xd')](config['redis'],{'host':_0xe86b('0xe'),'port':0x18eb});var socket=require(_0xe86b('0xf'))(new Redis(config['redis']));require(_0xe86b('0x10'))['register'](socket);function respondWithRpcPromise(_0x3eae65,_0x3efcc1,_0x172487){return new BPromise(function(_0x1ccc46,_0x5834e9){return client[_0xe86b('0x11')](_0x3eae65,_0x172487)[_0xe86b('0x12')](function(_0x3d0571){logger[_0xe86b('0x13')]('MailQueue,\x20%s,\x20%s',_0x3efcc1,_0xe86b('0x14'));logger[_0xe86b('0x15')](_0xe86b('0x16'),_0x3efcc1,_0xe86b('0x14'),JSON[_0xe86b('0x17')](_0x3d0571));if(_0x3d0571['error']){if(_0x3d0571['error'][_0xe86b('0x18')]===0x1f4){logger[_0xe86b('0x19')](_0xe86b('0x1a'),_0x3efcc1,_0x3d0571[_0xe86b('0x19')][_0xe86b('0x1b')]);return _0x5834e9(_0x3d0571['error']['message']);}logger[_0xe86b('0x19')]('MailQueue,\x20%s,\x20%s',_0x3efcc1,_0x3d0571[_0xe86b('0x19')][_0xe86b('0x1b')]);return _0x1ccc46(_0x3d0571['error'][_0xe86b('0x1b')]);}else{logger['info'](_0xe86b('0x1a'),_0x3efcc1,_0xe86b('0x14'));_0x1ccc46(_0x3d0571['result'][_0xe86b('0x1b')]);}})[_0xe86b('0x1c')](function(_0x51a65d){logger[_0xe86b('0x19')](_0xe86b('0x1a'),_0x3efcc1,_0x51a65d);_0x5834e9(_0x51a65d);});});}exports[_0xe86b('0x1d')]=function(_0x241141){var _0x3d0ddb=this;return new Promise(function(_0x587d22,_0x58f491){return db[_0xe86b('0x1e')][_0xe86b('0x1f')]({'raw':_0x241141[_0xe86b('0x20')]?_0x241141[_0xe86b('0x20')][_0xe86b('0x21')]===undefined?!![]:![]:!![],'where':_0x241141[_0xe86b('0x20')]?_0x241141[_0xe86b('0x20')][_0xe86b('0x22')]||null:null,'attributes':_0x241141[_0xe86b('0x20')]?_0x241141[_0xe86b('0x20')][_0xe86b('0x23')]||null:null,'limit':_0x241141[_0xe86b('0x20')]?_0x241141['options']['limit']||null:null,'include':_0x241141[_0xe86b('0x20')]?_0x241141[_0xe86b('0x20')]['include']?_[_0xe86b('0x24')](_0x241141['options'][_0xe86b('0x25')],function(_0x4c7a4e){return{'model':db[_0x4c7a4e[_0xe86b('0x26')]],'as':_0x4c7a4e['as'],'attributes':_0x4c7a4e[_0xe86b('0x23')],'include':_0x4c7a4e['include']?_[_0xe86b('0x24')](_0x4c7a4e['include'],function(_0x447f13){return{'model':db[_0x447f13[_0xe86b('0x26')]],'as':_0x447f13['as'],'attributes':_0x447f13['attributes'],'include':_0x447f13[_0xe86b('0x25')]?_[_0xe86b('0x24')](_0x447f13[_0xe86b('0x25')],function(_0x41e2d5){return{'model':db[_0x41e2d5['model']],'as':_0x41e2d5['as'],'attributes':_0x41e2d5['attributes']};}):[]};}):[]};}):[]:[]})[_0xe86b('0x12')](function(_0x29f799){logger[_0xe86b('0x13')](_0xe86b('0x1d'),_0x241141);logger[_0xe86b('0x15')](_0xe86b('0x1d'),_0x241141,JSON['stringify'](_0x29f799));_0x587d22(_0x29f799);})[_0xe86b('0x1c')](function(_0x1d3833){logger[_0xe86b('0x19')](_0xe86b('0x1d'),_0x1d3833[_0xe86b('0x1b')],_0x241141);_0x58f491(_0x3d0ddb[_0xe86b('0x19')](0x1f4,_0x1d3833[_0xe86b('0x1b')]));});});};exports[_0xe86b('0x27')]=function(_0x2250f3){var _0x67a385=this;return new Promise(function(_0x3193b3,_0x5a801d){return db[_0xe86b('0x1e')][_0xe86b('0x28')]({'raw':_0x2250f3[_0xe86b('0x20')]?_0x2250f3[_0xe86b('0x20')][_0xe86b('0x21')]===undefined?!![]:![]:!![],'where':_0x2250f3[_0xe86b('0x20')]?_0x2250f3[_0xe86b('0x20')]['where']||null:null,'attributes':_0x2250f3[_0xe86b('0x20')]?_0x2250f3[_0xe86b('0x20')]['attributes']||null:null,'include':_0x2250f3[_0xe86b('0x20')]?_0x2250f3['options'][_0xe86b('0x25')]?_[_0xe86b('0x24')](_0x2250f3[_0xe86b('0x20')]['include'],function(_0x4dc4bc){return{'model':db[_0x4dc4bc[_0xe86b('0x26')]],'as':_0x4dc4bc['as'],'attributes':_0x4dc4bc[_0xe86b('0x23')],'include':_0x4dc4bc[_0xe86b('0x25')]?_['map'](_0x4dc4bc[_0xe86b('0x25')],function(_0x1c18e6){return{'model':db[_0x1c18e6[_0xe86b('0x26')]],'as':_0x1c18e6['as'],'attributes':_0x1c18e6[_0xe86b('0x23')],'include':_0x1c18e6['include']?_[_0xe86b('0x24')](_0x1c18e6[_0xe86b('0x25')],function(_0x478e4c){return{'model':db[_0x478e4c[_0xe86b('0x26')]],'as':_0x478e4c['as'],'attributes':_0x478e4c[_0xe86b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c27de){logger[_0xe86b('0x13')]('ShowMailQueue',_0x2250f3);logger[_0xe86b('0x15')]('ShowMailQueue',_0x2250f3,JSON['stringify'](_0x2c27de));_0x3193b3(_0x2c27de);})[_0xe86b('0x1c')](function(_0x51ba68){logger['error'](_0xe86b('0x27'),_0x51ba68[_0xe86b('0x1b')],_0x2250f3);_0x5a801d(_0x67a385[_0xe86b('0x19')](0x1f4,_0x51ba68[_0xe86b('0x1b')]));});});}; \ No newline at end of file +var _0xb93f=['defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','MailQueue,\x20%s,\x20%s','result','catch','MailQueue','findAll','options','raw','attributes','include','map','model','GetMailQueue','ShowMailQueue','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0xad5ac0,_0x45df5a){var _0x544129=function(_0x4db235){while(--_0x4db235){_0xad5ac0['push'](_0xad5ac0['shift']());}};_0x544129(++_0x45df5a);}(_0xb93f,0x67));var _0xfb93=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0xb93f[_0x42c118];return _0x112ebd;};'use strict';var _=require(_0xfb93('0x0'));var util=require(_0xfb93('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb93('0x2'));var db=require(_0xfb93('0x3'))['db'];var utils=require(_0xfb93('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb93('0x5'));var jayson=require(_0xfb93('0x6'));var client=jayson['client'][_0xfb93('0x7')]({'port':0x232a});config['redis']=_[_0xfb93('0x8')](config[_0xfb93('0x9')],{'host':_0xfb93('0xa'),'port':0x18eb});var socket=require(_0xfb93('0xb'))(new Redis(config['redis']));require(_0xfb93('0xc'))[_0xfb93('0xd')](socket);function respondWithRpcPromise(_0x576fee,_0x3230b2,_0x37d100){return new BPromise(function(_0x2559f0,_0x49cd44){return client[_0xfb93('0xe')](_0x576fee,_0x37d100)[_0xfb93('0xf')](function(_0x66365d){logger[_0xfb93('0x10')]('MailQueue,\x20%s,\x20%s',_0x3230b2,_0xfb93('0x11'));logger[_0xfb93('0x12')](_0xfb93('0x13'),_0x3230b2,_0xfb93('0x11'),JSON[_0xfb93('0x14')](_0x66365d));if(_0x66365d[_0xfb93('0x15')]){if(_0x66365d[_0xfb93('0x15')]['code']===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x3230b2,_0x66365d[_0xfb93('0x15')][_0xfb93('0x16')]);return _0x49cd44(_0x66365d['error'][_0xfb93('0x16')]);}logger['error'](_0xfb93('0x17'),_0x3230b2,_0x66365d[_0xfb93('0x15')][_0xfb93('0x16')]);return _0x2559f0(_0x66365d['error']['message']);}else{logger[_0xfb93('0x10')]('MailQueue,\x20%s,\x20%s',_0x3230b2,_0xfb93('0x11'));_0x2559f0(_0x66365d[_0xfb93('0x18')][_0xfb93('0x16')]);}})[_0xfb93('0x19')](function(_0x42778f){logger[_0xfb93('0x15')]('MailQueue,\x20%s,\x20%s',_0x3230b2,_0x42778f);_0x49cd44(_0x42778f);});});}exports['GetMailQueue']=function(_0x1299aa){var _0x416ecf=this;return new Promise(function(_0x2d309c,_0x39fdbc){return db[_0xfb93('0x1a')][_0xfb93('0x1b')]({'raw':_0x1299aa[_0xfb93('0x1c')]?_0x1299aa[_0xfb93('0x1c')][_0xfb93('0x1d')]===undefined?!![]:![]:!![],'where':_0x1299aa[_0xfb93('0x1c')]?_0x1299aa[_0xfb93('0x1c')]['where']||null:null,'attributes':_0x1299aa['options']?_0x1299aa[_0xfb93('0x1c')][_0xfb93('0x1e')]||null:null,'limit':_0x1299aa[_0xfb93('0x1c')]?_0x1299aa[_0xfb93('0x1c')]['limit']||null:null,'include':_0x1299aa[_0xfb93('0x1c')]?_0x1299aa[_0xfb93('0x1c')][_0xfb93('0x1f')]?_[_0xfb93('0x20')](_0x1299aa[_0xfb93('0x1c')]['include'],function(_0x545620){return{'model':db[_0x545620['model']],'as':_0x545620['as'],'attributes':_0x545620['attributes'],'include':_0x545620[_0xfb93('0x1f')]?_[_0xfb93('0x20')](_0x545620['include'],function(_0x5a1b6f){return{'model':db[_0x5a1b6f['model']],'as':_0x5a1b6f['as'],'attributes':_0x5a1b6f[_0xfb93('0x1e')],'include':_0x5a1b6f[_0xfb93('0x1f')]?_[_0xfb93('0x20')](_0x5a1b6f[_0xfb93('0x1f')],function(_0x36313e){return{'model':db[_0x36313e[_0xfb93('0x21')]],'as':_0x36313e['as'],'attributes':_0x36313e[_0xfb93('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfb93('0xf')](function(_0x4ab89b){logger['info'](_0xfb93('0x22'),_0x1299aa);logger[_0xfb93('0x12')](_0xfb93('0x22'),_0x1299aa,JSON[_0xfb93('0x14')](_0x4ab89b));_0x2d309c(_0x4ab89b);})[_0xfb93('0x19')](function(_0x3b77d2){logger[_0xfb93('0x15')]('GetMailQueue',_0x3b77d2[_0xfb93('0x16')],_0x1299aa);_0x39fdbc(_0x416ecf[_0xfb93('0x15')](0x1f4,_0x3b77d2[_0xfb93('0x16')]));});});};exports[_0xfb93('0x23')]=function(_0x4bcdd7){var _0x250f64=this;return new Promise(function(_0x5f250e,_0x2b4139){return db[_0xfb93('0x1a')][_0xfb93('0x24')]({'raw':_0x4bcdd7['options']?_0x4bcdd7[_0xfb93('0x1c')][_0xfb93('0x1d')]===undefined?!![]:![]:!![],'where':_0x4bcdd7[_0xfb93('0x1c')]?_0x4bcdd7[_0xfb93('0x1c')]['where']||null:null,'attributes':_0x4bcdd7['options']?_0x4bcdd7[_0xfb93('0x1c')][_0xfb93('0x1e')]||null:null,'include':_0x4bcdd7[_0xfb93('0x1c')]?_0x4bcdd7[_0xfb93('0x1c')]['include']?_['map'](_0x4bcdd7[_0xfb93('0x1c')][_0xfb93('0x1f')],function(_0x3920cd){return{'model':db[_0x3920cd[_0xfb93('0x21')]],'as':_0x3920cd['as'],'attributes':_0x3920cd[_0xfb93('0x1e')],'include':_0x3920cd[_0xfb93('0x1f')]?_[_0xfb93('0x20')](_0x3920cd[_0xfb93('0x1f')],function(_0x232875){return{'model':db[_0x232875[_0xfb93('0x21')]],'as':_0x232875['as'],'attributes':_0x232875[_0xfb93('0x1e')],'include':_0x232875['include']?_[_0xfb93('0x20')](_0x232875[_0xfb93('0x1f')],function(_0x3ede71){return{'model':db[_0x3ede71[_0xfb93('0x21')]],'as':_0x3ede71['as'],'attributes':_0x3ede71[_0xfb93('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfb93('0xf')](function(_0xd379e){logger['info'](_0xfb93('0x23'),_0x4bcdd7);logger[_0xfb93('0x12')](_0xfb93('0x23'),_0x4bcdd7,JSON[_0xfb93('0x14')](_0xd379e));_0x5f250e(_0xd379e);})[_0xfb93('0x19')](function(_0x8505f){logger[_0xfb93('0x15')](_0xfb93('0x23'),_0x8505f[_0xfb93('0x16')],_0x4bcdd7);_0x2b4139(_0x250f64[_0xfb93('0x15')](0x1f4,_0x8505f['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index bad4bbd..9ddc08c 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 _0x48ae=['length','mailQueue:','./mailQueue.events','emit','register'];(function(_0x5b78e2,_0x782ff1){var _0x4edce2=function(_0x318321){while(--_0x318321){_0x5b78e2['push'](_0x5b78e2['shift']());}};_0x4edce2(++_0x782ff1);}(_0x48ae,0x142));var _0xe48a=function(_0x1fe7eb,_0x1ce297){_0x1fe7eb=_0x1fe7eb-0x0;var _0x58d309=_0x48ae[_0x1fe7eb];return _0x58d309;};'use strict';var MailQueueEvents=require(_0xe48a('0x0'));var events=['save','remove','update'];function createListener(_0x3ad5b,_0x483680){return function(_0x204122){_0x483680[_0xe48a('0x1')](_0x3ad5b,_0x204122);};}function removeListener(_0x5a0e7e,_0x4eb603){return function(){MailQueueEvents['removeListener'](_0x5a0e7e,_0x4eb603);};}exports[_0xe48a('0x2')]=function(_0x568219){for(var _0x45b6b7=0x0,_0x286193=events[_0xe48a('0x3')];_0x45b6b7<_0x286193;_0x45b6b7++){var _0x5ac7ef=events[_0x45b6b7];var _0xcb9cb0=createListener(_0xe48a('0x4')+_0x5ac7ef,_0x568219);MailQueueEvents['on'](_0x5ac7ef,_0xcb9cb0);}}; \ No newline at end of file +var _0xe1e3=['length','mailQueue:','./mailQueue.events','save','update','removeListener','register'];(function(_0x5ca53f,_0x147621){var _0x3c3255=function(_0x143a89){while(--_0x143a89){_0x5ca53f['push'](_0x5ca53f['shift']());}};_0x3c3255(++_0x147621);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5c4fb6,_0x43254f){_0x5c4fb6=_0x5c4fb6-0x0;var _0x308c89=_0xe1e3[_0x5c4fb6];return _0x308c89;};'use strict';var MailQueueEvents=require(_0x3e1e('0x0'));var events=[_0x3e1e('0x1'),'remove',_0x3e1e('0x2')];function createListener(_0x5e9f9a,_0x498811){return function(_0x90cbb5){_0x498811['emit'](_0x5e9f9a,_0x90cbb5);};}function removeListener(_0x3bacc,_0x5a11ef){return function(){MailQueueEvents[_0x3e1e('0x3')](_0x3bacc,_0x5a11ef);};}exports[_0x3e1e('0x4')]=function(_0x40d6d8){for(var _0x25701f=0x0,_0x55cfba=events[_0x3e1e('0x5')];_0x25701f<_0x55cfba;_0x25701f++){var _0x13926d=events[_0x25701f];var _0x2f0e12=createListener(_0x3e1e('0x6')+_0x13926d,_0x40d6d8);MailQueueEvents['on'](_0x13926d,_0x2f0e12);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 64d843a..0939fa7 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 _0x6ab8=['index','describe','post','create','/:id','update','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x28ac06,_0x1f3433){var _0x1765de=function(_0x1430d8){while(--_0x1430d8){_0x28ac06['push'](_0x28ac06['shift']());}};_0x1765de(++_0x1f3433);}(_0x6ab8,0xd4));var _0x86ab=function(_0x31b6fd,_0x2127d9){_0x31b6fd=_0x31b6fd-0x0;var _0x2608c6=_0x6ab8[_0x31b6fd];return _0x2608c6;};'use strict';var multer=require(_0x86ab('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x86ab('0x1')]();var fs_extra=require(_0x86ab('0x2'));var auth=require(_0x86ab('0x3'));var interaction=require(_0x86ab('0x4'));var config=require(_0x86ab('0x5'));var controller=require(_0x86ab('0x6'));router[_0x86ab('0x7')]('/',auth[_0x86ab('0x8')](),controller[_0x86ab('0x9')]);router[_0x86ab('0x7')]('/describe',auth[_0x86ab('0x8')](),controller[_0x86ab('0xa')]);router[_0x86ab('0x7')]('/:id',auth[_0x86ab('0x8')](),controller['show']);router[_0x86ab('0xb')]('/',auth[_0x86ab('0x8')](),controller[_0x86ab('0xc')]);router['put'](_0x86ab('0xd'),auth[_0x86ab('0x8')](),controller[_0x86ab('0xe')]);router['delete'](_0x86ab('0xd'),auth['isAuthenticated'](),controller[_0x86ab('0xf')]);module[_0x86ab('0x10')]=router; \ No newline at end of file +var _0xa749=['put','delete','/:id','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa749,0x1d0));var _0x9a74=function(_0x58a078,_0x9e575f){_0x58a078=_0x58a078-0x0;var _0x8c143e=_0xa749[_0x58a078];return _0x8c143e;};'use strict';var multer=require('multer');var util=require(_0x9a74('0x0'));var path=require(_0x9a74('0x1'));var timeout=require(_0x9a74('0x2'));var express=require(_0x9a74('0x3'));var router=express['Router']();var fs_extra=require(_0x9a74('0x4'));var auth=require(_0x9a74('0x5'));var interaction=require(_0x9a74('0x6'));var config=require(_0x9a74('0x7'));var controller=require('./mailQueueReport.controller');router[_0x9a74('0x8')]('/',auth[_0x9a74('0x9')](),controller[_0x9a74('0xa')]);router[_0x9a74('0x8')](_0x9a74('0xb'),auth[_0x9a74('0x9')](),controller[_0x9a74('0xc')]);router[_0x9a74('0x8')]('/:id',auth[_0x9a74('0x9')](),controller[_0x9a74('0xd')]);router[_0x9a74('0xe')]('/',auth['isAuthenticated'](),controller[_0x9a74('0xf')]);router[_0x9a74('0x10')]('/:id',auth[_0x9a74('0x9')](),controller['update']);router[_0x9a74('0x11')](_0x9a74('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a74('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 08c98fb..42cfb63 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 _0x2d97=['STRING','DATE','sequelize'];(function(_0x33d9ef,_0x24a016){var _0xb1e04d=function(_0x421128){while(--_0x421128){_0x33d9ef['push'](_0x33d9ef['shift']());}};_0xb1e04d(++_0x24a016);}(_0x2d97,0x1f1));var _0x72d9=function(_0x1a023c,_0x39ada1){_0x1a023c=_0x1a023c-0x0;var _0x27e79d=_0x2d97[_0x1a023c];return _0x27e79d;};'use strict';var moment=require('moment');var Sequelize=require(_0x72d9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x72d9('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x72d9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x72d9('0x2')]},'acceptAt':{'type':Sequelize[_0x72d9('0x2')]},'exitAt':{'type':Sequelize[_0x72d9('0x2')]},'reason':{'type':Sequelize[_0x72d9('0x1')]}}; \ No newline at end of file +var _0x30eb=['STRING','DATE','moment','sequelize','exports'];(function(_0x22285b,_0x11c6cd){var _0x1f436f=function(_0x4006da){while(--_0x4006da){_0x22285b['push'](_0x22285b['shift']());}};_0x1f436f(++_0x11c6cd);}(_0x30eb,0x7f));var _0xb30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30eb[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xb30e('0x0'));var Sequelize=require(_0xb30e('0x1'));module[_0xb30e('0x2')]={'uniqueid':{'type':Sequelize[_0xb30e('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb30e('0x4')]},'leaveAt':{'type':Sequelize[_0xb30e('0x4')]},'acceptAt':{'type':Sequelize[_0xb30e('0x4')]},'exitAt':{'type':Sequelize[_0xb30e('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 8e2de10..f7ee865 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 _0xdf55=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x1e0215,_0x4d76ef){var _0x3ab636=function(_0x3e3d1a){while(--_0x3e3d1a){_0x1e0215['push'](_0x1e0215['shift']());}};_0x3ab636(++_0x4d76ef);}(_0xdf55,0x83));var _0x5df5=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0xdf55[_0x47e7dd];return _0x38501f;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];function respondWithStatusCode(_0x4c3d6f,_0xe8bcd8){_0xe8bcd8=_0xe8bcd8||0xcc;return function(_0xb4a4fe){if(_0xb4a4fe){return _0x4c3d6f[_0x5df5('0x17')](_0xe8bcd8);}return _0x4c3d6f[_0x5df5('0x18')](_0xe8bcd8)[_0x5df5('0x19')]();};}function respondWithResult(_0x956317,_0x555d3f){_0x555d3f=_0x555d3f||0xc8;return function(_0x30fd32){if(_0x30fd32){return _0x956317['status'](_0x555d3f)[_0x5df5('0x1a')](_0x30fd32);}};}function respondWithFilteredResult(_0x33f818,_0x5b0ad9){return function(_0x3657c8){if(_0x3657c8){var _0x282d53=typeof _0x5b0ad9['offset']===_0x5df5('0x1b')&&typeof _0x5b0ad9[_0x5df5('0x1c')]==='undefined';var _0x9a52c9=_0x3657c8[_0x5df5('0x1d')];var _0xb7e1c2=_0x282d53?0x0:_0x5b0ad9[_0x5df5('0x1e')];var _0x215d59=_0x282d53?_0x3657c8['count']:_0x5b0ad9['offset']+_0x5b0ad9[_0x5df5('0x1c')];var _0x5d8dfd;if(_0x215d59>=_0x9a52c9){_0x215d59=_0x9a52c9;_0x5d8dfd=0xc8;}else{_0x5d8dfd=0xce;}_0x33f818[_0x5df5('0x18')](_0x5d8dfd);return _0x33f818[_0x5df5('0x1f')](_0x5df5('0x20'),_0xb7e1c2+'-'+_0x215d59+'/'+_0x9a52c9)[_0x5df5('0x1a')](_0x3657c8);}return null;};}function patchUpdates(_0x1deae7){return function(_0x4b4b57){try{jsonpatch[_0x5df5('0x21')](_0x4b4b57,_0x1deae7,!![]);}catch(_0x39d8a1){return BPromise[_0x5df5('0x22')](_0x39d8a1);}return _0x4b4b57[_0x5df5('0x23')]();};}function saveUpdates(_0x28efc8,_0x382999){return function(_0x59ff67){if(_0x59ff67){return _0x59ff67[_0x5df5('0x24')](_0x28efc8)[_0x5df5('0x25')](function(_0x8742a7){return _0x8742a7;});}return null;};}function removeEntity(_0x446bba,_0x5ca542){return function(_0x4358ba){if(_0x4358ba){return _0x4358ba[_0x5df5('0x26')]()[_0x5df5('0x25')](function(){_0x446bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532923,_0x357fb0){return function(_0x3ff82e){if(!_0x3ff82e){_0x532923[_0x5df5('0x17')](0x194);}return _0x3ff82e;};}function handleError(_0xa7f4b3,_0x1baf52){_0x1baf52=_0x1baf52||0x1f4;return function(_0x1fd83c){logger[_0x5df5('0x27')](_0x1fd83c[_0x5df5('0x28')]);if(_0x1fd83c['name']){delete _0x1fd83c[_0x5df5('0x29')];}_0xa7f4b3['status'](_0x1baf52)[_0x5df5('0x2a')](_0x1fd83c);};}exports[_0x5df5('0x2b')]=function(_0x5bc181,_0x3854d0){var _0x4945c6={},_0xd2b213={},_0x4cccf1={'count':0x0,'rows':[]};var _0x2e1885=_['map'](db[_0x5df5('0x2c')]['rawAttributes'],function(_0x2f91e3){return{'name':_0x2f91e3[_0x5df5('0x2d')],'type':_0x2f91e3[_0x5df5('0x2e')]['key']};});_0xd2b213[_0x5df5('0x2f')]=_[_0x5df5('0x30')](_0x2e1885,_0x5df5('0x29'));_0xd2b213[_0x5df5('0x31')]=_[_0x5df5('0x32')](_0x5bc181[_0x5df5('0x31')]);_0xd2b213[_0x5df5('0x33')]=_['intersection'](_0xd2b213['model'],_0xd2b213[_0x5df5('0x31')]);_0x4945c6[_0x5df5('0x34')]=_[_0x5df5('0x35')](_0xd2b213[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x5bc181[_0x5df5('0x31')]['fields']));_0x4945c6[_0x5df5('0x34')]=_0x4945c6[_0x5df5('0x34')][_0x5df5('0x37')]?_0x4945c6[_0x5df5('0x34')]:_0xd2b213['model'];if(!_0x5bc181[_0x5df5('0x31')]['hasOwnProperty'](_0x5df5('0x38'))){_0x4945c6[_0x5df5('0x1c')]=qs['limit'](_0x5bc181[_0x5df5('0x31')]['limit']);_0x4945c6[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x1e')]);}_0x4945c6['order']=qs[_0x5df5('0x39')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x39')]);_0x4945c6[_0x5df5('0x3a')]=qs['filters'](_[_0x5df5('0x3b')](_0x5bc181[_0x5df5('0x31')],_0xd2b213[_0x5df5('0x33')]),_0x2e1885);if(_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x4945c6[_0x5df5('0x3a')]=_[_0x5df5('0x3d')](_0x4945c6['where'],{'$or':_[_0x5df5('0x30')](_0x2e1885,function(_0x3102c7){if(_0x3102c7['type']!==_0x5df5('0x3e')){var _0x217844={};_0x217844[_0x3102c7['name']]={'$like':'%'+_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]+'%'};return _0x217844;}})});}_0x4945c6=_[_0x5df5('0x3d')]({},_0x4945c6,_0x5bc181[_0x5df5('0x3f')]);var _0x235f3e={'where':_0x4945c6[_0x5df5('0x3a')]};return db[_0x5df5('0x2c')][_0x5df5('0x1d')](_0x235f3e)['then'](function(_0x5e6c93){_0x4cccf1[_0x5df5('0x1d')]=_0x5e6c93;if(_0x5bc181['query'][_0x5df5('0x40')]){_0x4945c6[_0x5df5('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x5df5('0x42')](_0x4945c6);})[_0x5df5('0x25')](function(_0x23e592){_0x4cccf1[_0x5df5('0x43')]=_0x23e592;return _0x4cccf1;})[_0x5df5('0x25')](respondWithFilteredResult(_0x3854d0,_0x4945c6))[_0x5df5('0x44')](handleError(_0x3854d0,null));};exports[_0x5df5('0x45')]=function(_0x3902a1,_0x5824c3){var _0x42b562={'raw':!![],'where':{'id':_0x3902a1[_0x5df5('0x46')]['id']}},_0x4a4057={};_0x4a4057[_0x5df5('0x2f')]=_[_0x5df5('0x32')](db[_0x5df5('0x2c')][_0x5df5('0x47')]);_0x4a4057['query']=_[_0x5df5('0x32')](_0x3902a1[_0x5df5('0x31')]);_0x4a4057[_0x5df5('0x33')]=_['intersection'](_0x4a4057[_0x5df5('0x2f')],_0x4a4057[_0x5df5('0x31')]);_0x42b562['attributes']=_[_0x5df5('0x35')](_0x4a4057[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x3902a1[_0x5df5('0x31')]['fields']));_0x42b562[_0x5df5('0x34')]=_0x42b562[_0x5df5('0x34')]['length']?_0x42b562[_0x5df5('0x34')]:_0x4a4057[_0x5df5('0x2f')];if(_0x3902a1[_0x5df5('0x31')]['includeAll']){_0x42b562[_0x5df5('0x41')]=[{'all':!![]}];}_0x42b562=_[_0x5df5('0x3d')]({},_0x42b562,_0x3902a1[_0x5df5('0x3f')]);return db[_0x5df5('0x2c')]['find'](_0x42b562)[_0x5df5('0x25')](handleEntityNotFound(_0x5824c3,null))[_0x5df5('0x25')](respondWithResult(_0x5824c3,null))[_0x5df5('0x44')](handleError(_0x5824c3,null));};exports[_0x5df5('0x48')]=function(_0x14f9ca,_0x5f44cb){return db['MailQueueReport'][_0x5df5('0x48')](_0x14f9ca['body'],{})[_0x5df5('0x25')](respondWithResult(_0x5f44cb,0xc9))[_0x5df5('0x44')](handleError(_0x5f44cb,null));};exports[_0x5df5('0x24')]=function(_0x28108e,_0x48462e){if(_0x28108e[_0x5df5('0x49')]['id']){delete _0x28108e[_0x5df5('0x49')]['id'];}return db[_0x5df5('0x2c')][_0x5df5('0x4a')]({'where':{'id':_0x28108e[_0x5df5('0x46')]['id']}})[_0x5df5('0x25')](handleEntityNotFound(_0x48462e,null))['then'](saveUpdates(_0x28108e[_0x5df5('0x49')],null))['then'](respondWithResult(_0x48462e,null))[_0x5df5('0x44')](handleError(_0x48462e,null));};exports[_0x5df5('0x26')]=function(_0x17288f,_0x4d1ebd){return db[_0x5df5('0x2c')]['find']({'where':{'id':_0x17288f[_0x5df5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1ebd,null))[_0x5df5('0x25')](removeEntity(_0x4d1ebd,null))[_0x5df5('0x44')](handleError(_0x4d1ebd,null));};exports[_0x5df5('0x4b')]=function(_0x5997c1,_0x3d92a3){return db[_0x5df5('0x2c')]['describe']()[_0x5df5('0x25')](respondWithResult(_0x3d92a3,null))[_0x5df5('0x44')](handleError(_0x3d92a3,null));}; \ No newline at end of file +var _0xd943=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto'];(function(_0x4fb59d,_0x207ff9){var _0x52bf46=function(_0x503018){while(--_0x503018){_0x4fb59d['push'](_0x4fb59d['shift']());}};_0x52bf46(++_0x207ff9);}(_0xd943,0x15d));var _0x3d94=function(_0x1a09a2,_0x5ef211){_0x1a09a2=_0x1a09a2-0x0;var _0x17821a=_0xd943[_0x1a09a2];return _0x17821a;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':!![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));};exports[_0x3d94('0x47')]=function(_0x4af4c2,_0x255630){return db['MailQueueReport']['describe']()[_0x3d94('0x22')](respondWithResult(_0x255630,null))['catch'](handleError(_0x255630,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 90a6a02..b9d69d3 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 _0xbfd3=['../../config/environment','define','MailQueueReport','report_mail_queue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4e839f,_0x1f4c6b){var _0x1d1f19=function(_0x3578fe){while(--_0x3578fe){_0x4e839f['push'](_0x4e839f['shift']());}};_0x1d1f19(++_0x1f4c6b);}(_0xbfd3,0x144));var _0x3bfd=function(_0x50f81b,_0x797f65){_0x50f81b=_0x50f81b-0x0;var _0x3f0b45=_0xbfd3[_0x50f81b];return _0x3f0b45;};'use strict';var _=require(_0x3bfd('0x0'));var util=require(_0x3bfd('0x1'));var logger=require(_0x3bfd('0x2'))(_0x3bfd('0x3'));var moment=require(_0x3bfd('0x4'));var BPromise=require('bluebird');var rp=require(_0x3bfd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3bfd('0x6'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x46228a,_0x1939a3){return _0x46228a[_0x3bfd('0x7')](_0x3bfd('0x8'),attributes,{'tableName':_0x3bfd('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x06f8=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x4c6dcc,_0x209083){var _0x3f4783=function(_0x1a626b){while(--_0x1a626b){_0x4c6dcc['push'](_0x4c6dcc['shift']());}};_0x3f4783(++_0x209083);}(_0x06f8,0x178));var _0x806f=function(_0x392a06,_0x233e23){_0x392a06=_0x392a06-0x0;var _0x42fb44=_0x06f8[_0x392a06];return _0x42fb44;};'use strict';var _=require(_0x806f('0x0'));var util=require('util');var logger=require(_0x806f('0x1'))(_0x806f('0x2'));var moment=require(_0x806f('0x3'));var BPromise=require(_0x806f('0x4'));var rp=require(_0x806f('0x5'));var fs=require('fs');var path=require(_0x806f('0x6'));var rimraf=require(_0x806f('0x7'));var config=require(_0x806f('0x8'));var attributes=require(_0x806f('0x9'));module[_0x806f('0xa')]=function(_0x1456e5,_0x2a9212){return _0x1456e5[_0x806f('0xb')](_0x806f('0xc'),attributes,{'tableName':_0x806f('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x806f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index baa90e8..906ee2b 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3783a9,_0x4688d9){var _0x17450e=function(_0x53ca8f){while(--_0x53ca8f){_0x3783a9['push'](_0x3783a9['shift']());}};_0x17450e(++_0x4688d9);}(_0xadb5,0xad));var _0x5adb=function(_0x54ecb2,_0x218b05){_0x54ecb2=_0x54ecb2-0x0;var _0x442378=_0xadb5[_0x54ecb2];return _0x442378;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x284331,_0x302be9){var _0x365f8a=function(_0x49bee7){while(--_0x49bee7){_0x284331['push'](_0x284331['shift']());}};_0x365f8a(++_0x302be9);}(_0x7a54,0x106));var _0x47a5=function(_0x167681,_0xb105e){_0x167681=_0x167681-0x0;var _0x2cb530=_0x7a54[_0x167681];return _0x2cb530;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index bb61b2c..97c3c82 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4b03a1,_0x58b207){var _0x499044=function(_0x576cab){while(--_0x576cab){_0x4b03a1['push'](_0x4b03a1['shift']());}};_0x499044(++_0x58b207);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1567cf,_0x23af83){var _0x48bc34=function(_0x415c8c){while(--_0x415c8c){_0x1567cf['push'](_0x1567cf['shift']());}};_0x48bc34(++_0x23af83);}(_0xedd9,0xfc));var _0x9edd=function(_0x51ff86,_0x54da33){_0x51ff86=_0x51ff86-0x0;var _0x1abbd9=_0xedd9[_0x51ff86];return _0x1abbd9;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index d6de1fe..92dcd43 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 _0x5e8e=['BOOLEAN','INTEGER','INBOX','exports','STRING'];(function(_0x5edce1,_0x297b8f){var _0x524089=function(_0x108d72){while(--_0x108d72){_0x5edce1['push'](_0x5edce1['shift']());}};_0x524089(++_0x297b8f);}(_0x5e8e,0x1d4));var _0xe5e8=function(_0x40cd61,_0x36162c){_0x40cd61=_0x40cd61-0x0;var _0x120ce8=_0x5e8e[_0x40cd61];return _0x120ce8;};'use strict';var Sequelize=require('sequelize');module[_0xe5e8('0x0')]={'description':{'type':Sequelize[_0xe5e8('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xe5e8('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xe5e8('0x1')]},'password':{'type':Sequelize[_0xe5e8('0x1')]},'port':{'type':Sequelize[_0xe5e8('0x3')]},'tls':{'type':Sequelize[_0xe5e8('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xe5e8('0x1')],'defaultValue':_0xe5e8('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe5e8('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe5e8('0x1')]},'modernAuthentication':{'type':Sequelize[_0xe5e8('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xeb03=['INTEGER','INBOX','sequelize','STRING','BOOLEAN'];(function(_0xd9d333,_0x5d32e5){var _0x6c53d1=function(_0x1d09ae){while(--_0x1d09ae){_0xd9d333['push'](_0xd9d333['shift']());}};_0x6c53d1(++_0x5d32e5);}(_0xeb03,0xf7));var _0x3eb0=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xeb03[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0x3eb0('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3eb0('0x1')]},'authentication':{'type':Sequelize[_0x3eb0('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3eb0('0x1')]},'password':{'type':Sequelize[_0x3eb0('0x1')]},'port':{'type':Sequelize[_0x3eb0('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3eb0('0x1')],'defaultValue':_0x3eb0('0x4')},'connTimeout':{'type':Sequelize[_0x3eb0('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3eb0('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x3eb0('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 68409b6..0ee42f5 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 _0x58df=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x58df,0xb5));var _0xf58d=function(_0x4d26c5,_0x118a8e){_0x4d26c5=_0x4d26c5-0x0;var _0x3ea6cb=_0x58df[_0x4d26c5];return _0x3ea6cb;};'use strict';var _=require(_0xf58d('0x0'));var util=require(_0xf58d('0x1'));var logger=require(_0xf58d('0x2'))(_0xf58d('0x3'));var moment=require(_0xf58d('0x4'));var BPromise=require(_0xf58d('0x5'));var rp=require(_0xf58d('0x6'));var fs=require('fs');var path=require(_0xf58d('0x7'));var rimraf=require(_0xf58d('0x8'));var config=require(_0xf58d('0x9'));var attributes=require(_0xf58d('0xa'));module[_0xf58d('0xb')]=function(_0x21e38f,_0x222471){return _0x21e38f['define'](_0xf58d('0xc'),attributes,{'tableName':_0xf58d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0038=['define','MailServerIn','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports'];(function(_0x17e652,_0x16a06e){var _0x48bcf2=function(_0x1d2c18){while(--_0x1d2c18){_0x17e652['push'](_0x17e652['shift']());}};_0x48bcf2(++_0x16a06e);}(_0x0038,0x154));var _0x8003=function(_0x243bac,_0x274ba3){_0x243bac=_0x243bac-0x0;var _0x3636dc=_0x0038[_0x243bac];return _0x3636dc;};'use strict';var _=require(_0x8003('0x0'));var util=require(_0x8003('0x1'));var logger=require(_0x8003('0x2'))(_0x8003('0x3'));var moment=require(_0x8003('0x4'));var BPromise=require(_0x8003('0x5'));var rp=require(_0x8003('0x6'));var fs=require('fs');var path=require(_0x8003('0x7'));var rimraf=require(_0x8003('0x8'));var config=require('../../config/environment');var attributes=require(_0x8003('0x9'));module[_0x8003('0xa')]=function(_0x26051a,_0x3c14b9){return _0x26051a[_0x8003('0xb')](_0x8003('0xc'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 1a4ba82..5a27bb6 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 _0x1ea1=['MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info'];(function(_0xee8438,_0x261ac6){var _0x251ee8=function(_0x1ea637){while(--_0x1ea637){_0xee8438['push'](_0xee8438['shift']());}};_0x251ee8(++_0x261ac6);}(_0x1ea1,0xce));var _0x11ea=function(_0x21ef1d,_0xbfa6e){_0x21ef1d=_0x21ef1d-0x0;var _0x2dcdf0=_0x1ea1[_0x21ef1d];return _0x2dcdf0;};'use strict';var _=require(_0x11ea('0x0'));var util=require(_0x11ea('0x1'));var moment=require('moment');var BPromise=require(_0x11ea('0x2'));var rs=require(_0x11ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11ea('0x4'))['db'];var utils=require(_0x11ea('0x5'));var logger=require(_0x11ea('0x6'))(_0x11ea('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x11ea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4939eb,_0x3ef54d,_0x260d15){return new BPromise(function(_0x4c97c4,_0x390ec3){return client['request'](_0x4939eb,_0x260d15)[_0x11ea('0x9')](function(_0x5903dc){logger[_0x11ea('0xa')](_0x11ea('0xb'),_0x3ef54d,_0x11ea('0xc'));logger[_0x11ea('0xd')](_0x11ea('0xe'),_0x3ef54d,_0x11ea('0xc'),JSON[_0x11ea('0xf')](_0x5903dc));if(_0x5903dc['error']){if(_0x5903dc[_0x11ea('0x10')][_0x11ea('0x11')]===0x1f4){logger[_0x11ea('0x10')](_0x11ea('0xb'),_0x3ef54d,_0x5903dc[_0x11ea('0x10')][_0x11ea('0x12')]);return _0x390ec3(_0x5903dc['error']['message']);}logger['error'](_0x11ea('0xb'),_0x3ef54d,_0x5903dc[_0x11ea('0x10')]['message']);return _0x4c97c4(_0x5903dc[_0x11ea('0x10')][_0x11ea('0x12')]);}else{logger[_0x11ea('0xa')](_0x11ea('0xb'),_0x3ef54d,_0x11ea('0xc'));_0x4c97c4(_0x5903dc[_0x11ea('0x13')][_0x11ea('0x12')]);}})['catch'](function(_0xb3c2c4){logger[_0x11ea('0x10')](_0x11ea('0xb'),_0x3ef54d,_0xb3c2c4);_0x390ec3(_0xb3c2c4);});});}exports[_0x11ea('0x14')]=function(_0x32e928){var _0x778d63=this;return new Promise(function(_0x2ce09a,_0x507f45){return db[_0x11ea('0x15')][_0x11ea('0x16')]({'raw':_0x32e928['options']?_0x32e928[_0x11ea('0x17')][_0x11ea('0x18')]===undefined?!![]:![]:!![],'where':_0x32e928[_0x11ea('0x17')]?_0x32e928[_0x11ea('0x17')][_0x11ea('0x19')]||null:null,'attributes':_0x32e928[_0x11ea('0x17')]?_0x32e928[_0x11ea('0x17')][_0x11ea('0x1a')]||null:null,'limit':_0x32e928[_0x11ea('0x17')]?_0x32e928[_0x11ea('0x17')][_0x11ea('0x1b')]||null:null,'include':_0x32e928[_0x11ea('0x17')]?_0x32e928[_0x11ea('0x17')][_0x11ea('0x1c')]?_[_0x11ea('0x1d')](_0x32e928[_0x11ea('0x17')][_0x11ea('0x1c')],function(_0x11ac9b){return{'model':db[_0x11ac9b[_0x11ea('0x1e')]],'as':_0x11ac9b['as'],'attributes':_0x11ac9b[_0x11ea('0x1a')],'include':_0x11ac9b[_0x11ea('0x1c')]?_['map'](_0x11ac9b[_0x11ea('0x1c')],function(_0xf6b093){return{'model':db[_0xf6b093['model']],'as':_0xf6b093['as'],'attributes':_0xf6b093['attributes'],'include':_0xf6b093[_0x11ea('0x1c')]?_[_0x11ea('0x1d')](_0xf6b093[_0x11ea('0x1c')],function(_0xe0802d){return{'model':db[_0xe0802d[_0x11ea('0x1e')]],'as':_0xe0802d['as'],'attributes':_0xe0802d[_0x11ea('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x11ea('0x9')](function(_0x2902cb){logger[_0x11ea('0xa')](_0x11ea('0x14'),_0x32e928);logger[_0x11ea('0xd')](_0x11ea('0x14'),_0x32e928,JSON['stringify'](_0x2902cb));_0x2ce09a(_0x2902cb);})['catch'](function(_0x81eb50){logger[_0x11ea('0x10')](_0x11ea('0x14'),_0x81eb50['message'],_0x32e928);_0x507f45(_0x778d63['error'](0x1f4,_0x81eb50[_0x11ea('0x12')]));});});}; \ No newline at end of file +var _0x6d2e=['stringify','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x51bd41,_0x46d277){var _0x2b0082=function(_0x4d458f){while(--_0x4d458f){_0x51bd41['push'](_0x51bd41['shift']());}};_0x2b0082(++_0x46d277);}(_0x6d2e,0x97));var _0xe6d2=function(_0x4ca536,_0x57c8de){_0x4ca536=_0x4ca536-0x0;var _0x3bd35f=_0x6d2e[_0x4ca536];return _0x3bd35f;};'use strict';var _=require('lodash');var util=require(_0xe6d2('0x0'));var moment=require(_0xe6d2('0x1'));var BPromise=require(_0xe6d2('0x2'));var rs=require(_0xe6d2('0x3'));var fs=require('fs');var Redis=require(_0xe6d2('0x4'));var db=require(_0xe6d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6d2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe6d2('0x7'));var client=jayson[_0xe6d2('0x8')][_0xe6d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d9c9f,_0x36d6ad,_0x53906e){return new BPromise(function(_0x2e227e,_0x2ce8cb){return client['request'](_0x4d9c9f,_0x53906e)[_0xe6d2('0xa')](function(_0xa7d0e1){logger['info'](_0xe6d2('0xb'),_0x36d6ad,_0xe6d2('0xc'));logger['debug'](_0xe6d2('0xd'),_0x36d6ad,_0xe6d2('0xc'),JSON[_0xe6d2('0xe')](_0xa7d0e1));if(_0xa7d0e1[_0xe6d2('0xf')]){if(_0xa7d0e1['error'][_0xe6d2('0x10')]===0x1f4){logger[_0xe6d2('0xf')]('MailServerIn,\x20%s,\x20%s',_0x36d6ad,_0xa7d0e1[_0xe6d2('0xf')][_0xe6d2('0x11')]);return _0x2ce8cb(_0xa7d0e1['error'][_0xe6d2('0x11')]);}logger[_0xe6d2('0xf')](_0xe6d2('0xb'),_0x36d6ad,_0xa7d0e1[_0xe6d2('0xf')][_0xe6d2('0x11')]);return _0x2e227e(_0xa7d0e1[_0xe6d2('0xf')][_0xe6d2('0x11')]);}else{logger[_0xe6d2('0x12')](_0xe6d2('0xb'),_0x36d6ad,_0xe6d2('0xc'));_0x2e227e(_0xa7d0e1[_0xe6d2('0x13')][_0xe6d2('0x11')]);}})[_0xe6d2('0x14')](function(_0x2ad072){logger[_0xe6d2('0xf')]('MailServerIn,\x20%s,\x20%s',_0x36d6ad,_0x2ad072);_0x2ce8cb(_0x2ad072);});});}exports[_0xe6d2('0x15')]=function(_0x35cc9c){var _0x38410a=this;return new Promise(function(_0x242bcb,_0x31b572){return db[_0xe6d2('0x16')][_0xe6d2('0x17')]({'raw':_0x35cc9c[_0xe6d2('0x18')]?_0x35cc9c['options'][_0xe6d2('0x19')]===undefined?!![]:![]:!![],'where':_0x35cc9c[_0xe6d2('0x18')]?_0x35cc9c['options'][_0xe6d2('0x1a')]||null:null,'attributes':_0x35cc9c[_0xe6d2('0x18')]?_0x35cc9c[_0xe6d2('0x18')]['attributes']||null:null,'limit':_0x35cc9c[_0xe6d2('0x18')]?_0x35cc9c['options'][_0xe6d2('0x1b')]||null:null,'include':_0x35cc9c[_0xe6d2('0x18')]?_0x35cc9c[_0xe6d2('0x18')][_0xe6d2('0x1c')]?_[_0xe6d2('0x1d')](_0x35cc9c[_0xe6d2('0x18')][_0xe6d2('0x1c')],function(_0x3f5fc1){return{'model':db[_0x3f5fc1[_0xe6d2('0x1e')]],'as':_0x3f5fc1['as'],'attributes':_0x3f5fc1['attributes'],'include':_0x3f5fc1[_0xe6d2('0x1c')]?_[_0xe6d2('0x1d')](_0x3f5fc1[_0xe6d2('0x1c')],function(_0x1de5b3){return{'model':db[_0x1de5b3[_0xe6d2('0x1e')]],'as':_0x1de5b3['as'],'attributes':_0x1de5b3['attributes'],'include':_0x1de5b3['include']?_['map'](_0x1de5b3[_0xe6d2('0x1c')],function(_0x4700b5){return{'model':db[_0x4700b5[_0xe6d2('0x1e')]],'as':_0x4700b5['as'],'attributes':_0x4700b5[_0xe6d2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe6d2('0xa')](function(_0x223992){logger[_0xe6d2('0x12')]('GetMailServerIn',_0x35cc9c);logger[_0xe6d2('0x20')]('GetMailServerIn',_0x35cc9c,JSON[_0xe6d2('0xe')](_0x223992));_0x242bcb(_0x223992);})[_0xe6d2('0x14')](function(_0x15b607){logger[_0xe6d2('0xf')](_0xe6d2('0x15'),_0x15b607[_0xe6d2('0x11')],_0x35cc9c);_0x31b572(_0x38410a[_0xe6d2('0xf')](0x1f4,_0x15b607[_0xe6d2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index b9c3978..ec0fea6 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7a54,0x106));var _0x47a5=function(_0x28dc7b,_0x3316b7){_0x28dc7b=_0x28dc7b-0x0;var _0x55faa6=_0x7a54[_0x28dc7b];return _0x55faa6;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _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(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 2d9e457..94e393e 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 _0xd914=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0xecb87c,_0x87ad1b){var _0x3f47bc=function(_0x495fa3){while(--_0x495fa3){_0xecb87c['push'](_0xecb87c['shift']());}};_0x3f47bc(++_0x87ad1b);}(_0xd914,0x17f));var _0x4d91=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0xd914[_0xe8129c];return _0x709fc5;};'use strict';var Sequelize=require(_0x4d91('0x0'));module[_0x4d91('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4d91('0x2')]},'user':{'type':Sequelize[_0x4d91('0x2')]},'pass':{'type':Sequelize[_0x4d91('0x2')]},'port':{'type':Sequelize[_0x4d91('0x3')]},'secure':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x4d91('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xb78e=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb78e,0x1c9));var _0xeb78=function(_0x45923f,_0xaa32da){_0x45923f=_0x45923f-0x0;var _0x3072f4=_0xb78e[_0x45923f];return _0x3072f4;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xeb78('0x2')]},'user':{'type':Sequelize[_0xeb78('0x2')]},'pass':{'type':Sequelize[_0xeb78('0x2')]},'port':{'type':Sequelize[_0xeb78('0x3')]},'secure':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xeb78('0x2')]},'authentication':{'type':Sequelize[_0xeb78('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xeb78('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 f937cce..c8566fe 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 _0x4430=['nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','fields','length','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty'];(function(_0x34c4fe,_0x22a148){var _0x18e196=function(_0x480eda){while(--_0x480eda){_0x34c4fe['push'](_0x34c4fe['shift']());}};_0x18e196(++_0x22a148);}(_0x4430,0x1b1));var _0x0443=function(_0x5c049a,_0x2c1263){_0x5c049a=_0x5c049a-0x0;var _0x168e70=_0x4430[_0x5c049a];return _0x168e70;};'use strict';var emlformat=require(_0x0443('0x0'));var rimraf=require(_0x0443('0x1'));var zipdir=require(_0x0443('0x2'));var jsonpatch=require(_0x0443('0x3'));var rp=require('request-promise');var moment=require(_0x0443('0x4'));var BPromise=require(_0x0443('0x5'));var Mustache=require(_0x0443('0x6'));var util=require(_0x0443('0x7'));var path=require(_0x0443('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0443('0x9'));var _=require(_0x0443('0xa'));var squel=require('squel');var crypto=require(_0x0443('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0443('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0443('0xd'));var Papa=require(_0x0443('0xe'));var Redis=require(_0x0443('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0443('0x10'));var as=require(_0x0443('0x11'));var hardwareService=require(_0x0443('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0443('0x13'));var config=require(_0x0443('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0443('0x15'))['db'];function respondWithStatusCode(_0x35fb25,_0x556fb8){_0x556fb8=_0x556fb8||0xcc;return function(_0x20ebd6){if(_0x20ebd6){return _0x35fb25['sendStatus'](_0x556fb8);}return _0x35fb25[_0x0443('0x16')](_0x556fb8)[_0x0443('0x17')]();};}function respondWithResult(_0x485ae5,_0x4baa97){_0x4baa97=_0x4baa97||0xc8;return function(_0x455ef5){if(_0x455ef5){return _0x485ae5[_0x0443('0x16')](_0x4baa97)[_0x0443('0x18')](_0x455ef5);}};}function respondWithFilteredResult(_0xdc7312,_0x26d4a0){return function(_0x3e1135){if(_0x3e1135){var _0x9bcf02=typeof _0x26d4a0[_0x0443('0x19')]===_0x0443('0x1a')&&typeof _0x26d4a0[_0x0443('0x1b')]===_0x0443('0x1a');var _0x4e63f5=_0x3e1135[_0x0443('0x1c')];var _0x3a8afb=_0x9bcf02?0x0:_0x26d4a0[_0x0443('0x19')];var _0x1a938a=_0x9bcf02?_0x3e1135[_0x0443('0x1c')]:_0x26d4a0['offset']+_0x26d4a0['limit'];var _0x496602;if(_0x1a938a>=_0x4e63f5){_0x1a938a=_0x4e63f5;_0x496602=0xc8;}else{_0x496602=0xce;}_0xdc7312['status'](_0x496602);return _0xdc7312[_0x0443('0x1d')](_0x0443('0x1e'),_0x3a8afb+'-'+_0x1a938a+'/'+_0x4e63f5)['json'](_0x3e1135);}return null;};}function patchUpdates(_0x2d1fd0){return function(_0x261d77){try{jsonpatch[_0x0443('0x1f')](_0x261d77,_0x2d1fd0,!![]);}catch(_0x26249c){return BPromise[_0x0443('0x20')](_0x26249c);}return _0x261d77['save']();};}function saveUpdates(_0x1bee79,_0x1fd8a1){return function(_0xb106ef){if(_0xb106ef){return _0xb106ef['update'](_0x1bee79)[_0x0443('0x21')](function(_0x136f99){return _0x136f99;});}return null;};}function removeEntity(_0x16a6d5,_0x4bebf7){return function(_0x5f3e1a){if(_0x5f3e1a){return _0x5f3e1a[_0x0443('0x22')]()[_0x0443('0x21')](function(){_0x16a6d5[_0x0443('0x16')](0xcc)[_0x0443('0x17')]();});}};}function handleEntityNotFound(_0x12eb56,_0x1ea7df){return function(_0x302e52){if(!_0x302e52){_0x12eb56['sendStatus'](0x194);}return _0x302e52;};}function handleError(_0x695e42,_0x5674c4){_0x5674c4=_0x5674c4||0x1f4;return function(_0x5bbae6){logger[_0x0443('0x23')](_0x5bbae6['stack']);if(_0x5bbae6[_0x0443('0x24')]){delete _0x5bbae6['name'];}_0x695e42[_0x0443('0x16')](_0x5674c4)[_0x0443('0x25')](_0x5bbae6);};}exports['index']=function(_0x2a67c9,_0x426d52){var _0x394a63={},_0x32aec7={},_0x35b2f7={'count':0x0,'rows':[]};var _0x58559b=_[_0x0443('0x26')](db[_0x0443('0x27')][_0x0443('0x28')],function(_0x1f817a){return{'name':_0x1f817a[_0x0443('0x29')],'type':_0x1f817a['type'][_0x0443('0x2a')]};});_0x32aec7[_0x0443('0x2b')]=_[_0x0443('0x26')](_0x58559b,_0x0443('0x24'));_0x32aec7[_0x0443('0x2c')]=_[_0x0443('0x2d')](_0x2a67c9[_0x0443('0x2c')]);_0x32aec7[_0x0443('0x2e')]=_['intersection'](_0x32aec7['model'],_0x32aec7['query']);_0x394a63['attributes']=_[_0x0443('0x2f')](_0x32aec7[_0x0443('0x2b')],qs['fields'](_0x2a67c9[_0x0443('0x2c')]['fields']));_0x394a63[_0x0443('0x30')]=_0x394a63[_0x0443('0x30')]['length']?_0x394a63['attributes']:_0x32aec7[_0x0443('0x2b')];if(!_0x2a67c9[_0x0443('0x2c')][_0x0443('0x31')](_0x0443('0x32'))){_0x394a63[_0x0443('0x1b')]=qs[_0x0443('0x1b')](_0x2a67c9['query']['limit']);_0x394a63[_0x0443('0x19')]=qs[_0x0443('0x19')](_0x2a67c9['query'][_0x0443('0x19')]);}_0x394a63['order']=qs['sort'](_0x2a67c9[_0x0443('0x2c')][_0x0443('0x33')]);_0x394a63[_0x0443('0x34')]=qs[_0x0443('0x2e')](_[_0x0443('0x35')](_0x2a67c9[_0x0443('0x2c')],_0x32aec7[_0x0443('0x2e')]),_0x58559b);if(_0x2a67c9['query'][_0x0443('0x36')]){_0x394a63['where']=_[_0x0443('0x37')](_0x394a63['where'],{'$or':_[_0x0443('0x26')](_0x58559b,function(_0xe8075d){if(_0xe8075d[_0x0443('0x38')]!=='VIRTUAL'){var _0xafbfd2={};_0xafbfd2[_0xe8075d['name']]={'$like':'%'+_0x2a67c9[_0x0443('0x2c')]['filter']+'%'};return _0xafbfd2;}})});}_0x394a63=_[_0x0443('0x37')]({},_0x394a63,_0x2a67c9[_0x0443('0x39')]);var _0x285f8f={'where':_0x394a63[_0x0443('0x34')]};return db[_0x0443('0x27')][_0x0443('0x1c')](_0x285f8f)[_0x0443('0x21')](function(_0x4a0cf9){_0x35b2f7[_0x0443('0x1c')]=_0x4a0cf9;if(_0x2a67c9[_0x0443('0x2c')][_0x0443('0x3a')]){_0x394a63[_0x0443('0x3b')]=[{'all':!![]}];}return db[_0x0443('0x27')][_0x0443('0x3c')](_0x394a63);})[_0x0443('0x21')](function(_0x182ff8){_0x35b2f7[_0x0443('0x3d')]=_0x182ff8;return _0x35b2f7;})[_0x0443('0x21')](respondWithFilteredResult(_0x426d52,_0x394a63))[_0x0443('0x3e')](handleError(_0x426d52,null));};exports[_0x0443('0x3f')]=function(_0x3f0656,_0x48e913){var _0x22058c={'raw':!![],'where':{'id':_0x3f0656[_0x0443('0x40')]['id']}},_0x1e0847={};_0x1e0847[_0x0443('0x2b')]=_[_0x0443('0x2d')](db[_0x0443('0x27')][_0x0443('0x28')]);_0x1e0847['query']=_['keys'](_0x3f0656[_0x0443('0x2c')]);_0x1e0847[_0x0443('0x2e')]=_[_0x0443('0x2f')](_0x1e0847[_0x0443('0x2b')],_0x1e0847[_0x0443('0x2c')]);_0x22058c['attributes']=_[_0x0443('0x2f')](_0x1e0847[_0x0443('0x2b')],qs[_0x0443('0x41')](_0x3f0656[_0x0443('0x2c')]['fields']));_0x22058c[_0x0443('0x30')]=_0x22058c['attributes'][_0x0443('0x42')]?_0x22058c[_0x0443('0x30')]:_0x1e0847[_0x0443('0x2b')];if(_0x3f0656[_0x0443('0x2c')][_0x0443('0x3a')]){_0x22058c[_0x0443('0x3b')]=[{'all':!![]}];}_0x22058c=_[_0x0443('0x37')]({},_0x22058c,_0x3f0656['options']);return db[_0x0443('0x27')]['find'](_0x22058c)[_0x0443('0x21')](handleEntityNotFound(_0x48e913,null))[_0x0443('0x21')](respondWithResult(_0x48e913,null))['catch'](handleError(_0x48e913,null));};exports['create']=function(_0x11936d,_0x132108){return db['MailServerOut']['create'](_0x11936d[_0x0443('0x43')],{})['then'](respondWithResult(_0x132108,0xc9))[_0x0443('0x3e')](handleError(_0x132108,null));};exports['update']=function(_0x48e41a,_0x46e819){if(_0x48e41a[_0x0443('0x43')]['id']){delete _0x48e41a[_0x0443('0x43')]['id'];}return db[_0x0443('0x27')][_0x0443('0x44')]({'where':{'id':_0x48e41a[_0x0443('0x40')]['id']}})[_0x0443('0x21')](handleEntityNotFound(_0x46e819,null))['then'](saveUpdates(_0x48e41a['body'],null))['then'](respondWithResult(_0x46e819,null))[_0x0443('0x3e')](handleError(_0x46e819,null));};exports['destroy']=function(_0x4d491a,_0x1af59e){return db[_0x0443('0x27')][_0x0443('0x44')]({'where':{'id':_0x4d491a[_0x0443('0x40')]['id']}})[_0x0443('0x21')](handleEntityNotFound(_0x1af59e,null))[_0x0443('0x21')](removeEntity(_0x1af59e,null))[_0x0443('0x3e')](handleError(_0x1af59e,null));}; \ No newline at end of file +var _0x6282=['type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','MailServerOut','includeAll','include','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x4b38a,_0x45fdf7){var _0xf0592b=function(_0x400581){while(--_0x400581){_0x4b38a['push'](_0x4b38a['shift']());}};_0xf0592b(++_0x45fdf7);}(_0x6282,0x1cd));var _0x2628=function(_0x11d5a6,_0x3e9648){_0x11d5a6=_0x11d5a6-0x0;var _0x23cabc=_0x6282[_0x11d5a6];return _0x23cabc;};'use strict';var emlformat=require(_0x2628('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2628('0x1'));var jsonpatch=require(_0x2628('0x2'));var rp=require(_0x2628('0x3'));var moment=require(_0x2628('0x4'));var BPromise=require(_0x2628('0x5'));var Mustache=require('mustache');var util=require(_0x2628('0x6'));var path=require('path');var sox=require(_0x2628('0x7'));var csv=require('to-csv');var ejs=require(_0x2628('0x8'));var fs=require('fs');var fs_extra=require(_0x2628('0x9'));var _=require(_0x2628('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2628('0xb'));var deskjs=require(_0x2628('0xc'));var toCsv=require(_0x2628('0xd'));var querystring=require(_0x2628('0xe'));var Papa=require(_0x2628('0xf'));var Redis=require(_0x2628('0x10'));var authService=require(_0x2628('0x11'));var qs=require(_0x2628('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2628('0x13'));var utils=require(_0x2628('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2628('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d89b4,_0x27a4a9){_0x27a4a9=_0x27a4a9||0xcc;return function(_0x155641){if(_0x155641){return _0x5d89b4['sendStatus'](_0x27a4a9);}return _0x5d89b4[_0x2628('0x16')](_0x27a4a9)[_0x2628('0x17')]();};}function respondWithResult(_0xff38b1,_0x186f81){_0x186f81=_0x186f81||0xc8;return function(_0x11f78c){if(_0x11f78c){return _0xff38b1[_0x2628('0x16')](_0x186f81)['json'](_0x11f78c);}};}function respondWithFilteredResult(_0x35732c,_0x163f45){return function(_0x5503f9){if(_0x5503f9){var _0x457ca7=typeof _0x163f45[_0x2628('0x18')]===_0x2628('0x19')&&typeof _0x163f45[_0x2628('0x1a')]==='undefined';var _0x186362=_0x5503f9[_0x2628('0x1b')];var _0x1dcb16=_0x457ca7?0x0:_0x163f45['offset'];var _0x42e890=_0x457ca7?_0x5503f9['count']:_0x163f45[_0x2628('0x18')]+_0x163f45[_0x2628('0x1a')];var _0x4a4883;if(_0x42e890>=_0x186362){_0x42e890=_0x186362;_0x4a4883=0xc8;}else{_0x4a4883=0xce;}_0x35732c['status'](_0x4a4883);return _0x35732c[_0x2628('0x1c')]('Content-Range',_0x1dcb16+'-'+_0x42e890+'/'+_0x186362)['json'](_0x5503f9);}return null;};}function patchUpdates(_0x3d4f15){return function(_0x2a30ec){try{jsonpatch['apply'](_0x2a30ec,_0x3d4f15,!![]);}catch(_0x3bf700){return BPromise[_0x2628('0x1d')](_0x3bf700);}return _0x2a30ec[_0x2628('0x1e')]();};}function saveUpdates(_0x190652,_0x2ba006){return function(_0x3321e8){if(_0x3321e8){return _0x3321e8[_0x2628('0x1f')](_0x190652)[_0x2628('0x20')](function(_0x1e6cd9){return _0x1e6cd9;});}return null;};}function removeEntity(_0x399942,_0x46636d){return function(_0x44cef9){if(_0x44cef9){return _0x44cef9[_0x2628('0x21')]()[_0x2628('0x20')](function(){_0x399942['status'](0xcc)[_0x2628('0x17')]();});}};}function handleEntityNotFound(_0x425320,_0x4a0fe1){return function(_0x133e0c){if(!_0x133e0c){_0x425320[_0x2628('0x22')](0x194);}return _0x133e0c;};}function handleError(_0x17749c,_0x407962){_0x407962=_0x407962||0x1f4;return function(_0x2f5c39){logger[_0x2628('0x23')](_0x2f5c39[_0x2628('0x24')]);if(_0x2f5c39['name']){delete _0x2f5c39[_0x2628('0x25')];}_0x17749c[_0x2628('0x16')](_0x407962)[_0x2628('0x26')](_0x2f5c39);};}exports[_0x2628('0x27')]=function(_0x37044b,_0x2b168b){var _0x52155e={},_0x191a58={},_0x23d385={'count':0x0,'rows':[]};var _0x2cbb8f=_[_0x2628('0x28')](db['MailServerOut'][_0x2628('0x29')],function(_0x5a2545){return{'name':_0x5a2545[_0x2628('0x2a')],'type':_0x5a2545[_0x2628('0x2b')][_0x2628('0x2c')]};});_0x191a58['model']=_['map'](_0x2cbb8f,_0x2628('0x25'));_0x191a58[_0x2628('0x2d')]=_[_0x2628('0x2e')](_0x37044b[_0x2628('0x2d')]);_0x191a58['filters']=_[_0x2628('0x2f')](_0x191a58[_0x2628('0x30')],_0x191a58[_0x2628('0x2d')]);_0x52155e[_0x2628('0x31')]=_['intersection'](_0x191a58[_0x2628('0x30')],qs[_0x2628('0x32')](_0x37044b[_0x2628('0x2d')]['fields']));_0x52155e['attributes']=_0x52155e['attributes'][_0x2628('0x33')]?_0x52155e['attributes']:_0x191a58[_0x2628('0x30')];if(!_0x37044b[_0x2628('0x2d')][_0x2628('0x34')](_0x2628('0x35'))){_0x52155e[_0x2628('0x1a')]=qs['limit'](_0x37044b[_0x2628('0x2d')][_0x2628('0x1a')]);_0x52155e[_0x2628('0x18')]=qs[_0x2628('0x18')](_0x37044b[_0x2628('0x2d')][_0x2628('0x18')]);}_0x52155e['order']=qs[_0x2628('0x36')](_0x37044b[_0x2628('0x2d')][_0x2628('0x36')]);_0x52155e[_0x2628('0x37')]=qs[_0x2628('0x38')](_[_0x2628('0x39')](_0x37044b['query'],_0x191a58[_0x2628('0x38')]),_0x2cbb8f);if(_0x37044b[_0x2628('0x2d')][_0x2628('0x3a')]){_0x52155e[_0x2628('0x37')]=_[_0x2628('0x3b')](_0x52155e[_0x2628('0x37')],{'$or':_[_0x2628('0x28')](_0x2cbb8f,function(_0x588cd8){if(_0x588cd8[_0x2628('0x2b')]!==_0x2628('0x3c')){var _0xd2d9a1={};_0xd2d9a1[_0x588cd8[_0x2628('0x25')]]={'$like':'%'+_0x37044b[_0x2628('0x2d')][_0x2628('0x3a')]+'%'};return _0xd2d9a1;}})});}_0x52155e=_[_0x2628('0x3b')]({},_0x52155e,_0x37044b[_0x2628('0x3d')]);var _0x1b133f={'where':_0x52155e[_0x2628('0x37')]};return db[_0x2628('0x3e')][_0x2628('0x1b')](_0x1b133f)['then'](function(_0xf37db8){_0x23d385['count']=_0xf37db8;if(_0x37044b['query'][_0x2628('0x3f')]){_0x52155e[_0x2628('0x40')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x52155e);})[_0x2628('0x20')](function(_0x4d8d2d){_0x23d385[_0x2628('0x41')]=_0x4d8d2d;return _0x23d385;})[_0x2628('0x20')](respondWithFilteredResult(_0x2b168b,_0x52155e))[_0x2628('0x42')](handleError(_0x2b168b,null));};exports[_0x2628('0x43')]=function(_0xc39de5,_0x2a7a82){var _0x18dbdb={'raw':!![],'where':{'id':_0xc39de5[_0x2628('0x44')]['id']}},_0x4b46e5={};_0x4b46e5['model']=_[_0x2628('0x2e')](db['MailServerOut'][_0x2628('0x29')]);_0x4b46e5[_0x2628('0x2d')]=_['keys'](_0xc39de5['query']);_0x4b46e5[_0x2628('0x38')]=_[_0x2628('0x2f')](_0x4b46e5[_0x2628('0x30')],_0x4b46e5[_0x2628('0x2d')]);_0x18dbdb[_0x2628('0x31')]=_[_0x2628('0x2f')](_0x4b46e5[_0x2628('0x30')],qs[_0x2628('0x32')](_0xc39de5[_0x2628('0x2d')][_0x2628('0x32')]));_0x18dbdb['attributes']=_0x18dbdb[_0x2628('0x31')][_0x2628('0x33')]?_0x18dbdb[_0x2628('0x31')]:_0x4b46e5[_0x2628('0x30')];if(_0xc39de5[_0x2628('0x2d')][_0x2628('0x3f')]){_0x18dbdb['include']=[{'all':!![]}];}_0x18dbdb=_['merge']({},_0x18dbdb,_0xc39de5['options']);return db[_0x2628('0x3e')][_0x2628('0x45')](_0x18dbdb)['then'](handleEntityNotFound(_0x2a7a82,null))[_0x2628('0x20')](respondWithResult(_0x2a7a82,null))[_0x2628('0x42')](handleError(_0x2a7a82,null));};exports[_0x2628('0x46')]=function(_0x22a417,_0x5df008){return db[_0x2628('0x3e')][_0x2628('0x46')](_0x22a417[_0x2628('0x47')],{})[_0x2628('0x20')](respondWithResult(_0x5df008,0xc9))[_0x2628('0x42')](handleError(_0x5df008,null));};exports[_0x2628('0x1f')]=function(_0x3cc93a,_0x2e1a8a){if(_0x3cc93a[_0x2628('0x47')]['id']){delete _0x3cc93a['body']['id'];}return db[_0x2628('0x3e')][_0x2628('0x45')]({'where':{'id':_0x3cc93a[_0x2628('0x44')]['id']}})[_0x2628('0x20')](handleEntityNotFound(_0x2e1a8a,null))['then'](saveUpdates(_0x3cc93a[_0x2628('0x47')],null))['then'](respondWithResult(_0x2e1a8a,null))[_0x2628('0x42')](handleError(_0x2e1a8a,null));};exports[_0x2628('0x21')]=function(_0x5dd82b,_0x20e97b){return db[_0x2628('0x3e')][_0x2628('0x45')]({'where':{'id':_0x5dd82b[_0x2628('0x44')]['id']}})[_0x2628('0x20')](handleEntityNotFound(_0x20e97b,null))[_0x2628('0x20')](removeEntity(_0x20e97b,null))[_0x2628('0x42')](handleError(_0x20e97b,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 85b0711..57561a3 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 _0xdbcb=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','util'];(function(_0x1a7f30,_0xba5349){var _0xd817e=function(_0x329d6d){while(--_0x329d6d){_0x1a7f30['push'](_0x1a7f30['shift']());}};_0xd817e(++_0xba5349);}(_0xdbcb,0x15b));var _0xbdbc=function(_0x19fc64,_0x3cc450){_0x19fc64=_0x19fc64-0x0;var _0x5b2a74=_0xdbcb[_0x19fc64];return _0x5b2a74;};'use strict';var _=require('lodash');var util=require(_0xbdbc('0x0'));var logger=require(_0xbdbc('0x1'))('api');var moment=require(_0xbdbc('0x2'));var BPromise=require(_0xbdbc('0x3'));var rp=require(_0xbdbc('0x4'));var fs=require('fs');var path=require(_0xbdbc('0x5'));var rimraf=require(_0xbdbc('0x6'));var config=require('../../config/environment');var attributes=require(_0xbdbc('0x7'));module[_0xbdbc('0x8')]=function(_0x3ab235,_0x8301cb){return _0x3ab235[_0xbdbc('0x9')](_0xbdbc('0xa'),attributes,{'tableName':_0xbdbc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49c5=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','api','moment','request-promise','path'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x49c5,0x132));var _0x549c=function(_0x2043d2,_0x4c39bf){_0x2043d2=_0x2043d2-0x0;var _0x26e4af=_0x49c5[_0x2043d2];return _0x26e4af;};'use strict';var _=require(_0x549c('0x0'));var util=require(_0x549c('0x1'));var logger=require('../../config/logger')(_0x549c('0x2'));var moment=require(_0x549c('0x3'));var BPromise=require('bluebird');var rp=require(_0x549c('0x4'));var fs=require('fs');var path=require(_0x549c('0x5'));var rimraf=require(_0x549c('0x6'));var config=require(_0x549c('0x7'));var attributes=require(_0x549c('0x8'));module[_0x549c('0x9')]=function(_0x415e96,_0x1b95fc){return _0x415e96[_0x549c('0xa')](_0x549c('0xb'),attributes,{'tableName':_0x549c('0xc'),'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 ff1cd93..908ca7a 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x15aa4b,_0x2cfb1c){var _0x519cff=function(_0x40142a){while(--_0x40142a){_0x15aa4b['push'](_0x15aa4b['shift']());}};_0x519cff(++_0x2cfb1c);}(_0x1261,0x144));var _0x1126=function(_0x4459b8,_0x3271b8){_0x4459b8=_0x4459b8-0x0;var _0x4a4b07=_0x1261[_0x4459b8];return _0x4a4b07;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x57810d,_0x3bb181){var _0x272f76=function(_0x73a492){while(--_0x73a492){_0x57810d['push'](_0x57810d['shift']());}};_0x272f76(++_0x3bb181);}(_0xdb28,0x106));var _0x8db2=function(_0x56cc50,_0x34f09c){_0x56cc50=_0x56cc50-0x0;var _0x37ce83=_0xdb28[_0x56cc50];return _0x37ce83;};'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')]('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 0057e0b..0e27656 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 _0x753c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x4362cc,_0xf8b89b){var _0x224bf6=function(_0x3e5089){while(--_0x3e5089){_0x4362cc['push'](_0x4362cc['shift']());}};_0x224bf6(++_0xf8b89b);}(_0x753c,0x96));var _0xc753=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x753c[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0xc753('0x0'));var path=require('path');var timeout=require(_0xc753('0x1'));var express=require(_0xc753('0x2'));var router=express[_0xc753('0x3')]();var fs_extra=require(_0xc753('0x4'));var auth=require(_0xc753('0x5'));var interaction=require(_0xc753('0x6'));var config=require(_0xc753('0x7'));var controller=require(_0xc753('0x8'));router[_0xc753('0x9')]('/',auth[_0xc753('0xa')](),controller[_0xc753('0xb')]);router[_0xc753('0x9')](_0xc753('0xc'),auth[_0xc753('0xa')](),controller[_0xc753('0xd')]);router[_0xc753('0x9')](_0xc753('0xe'),auth[_0xc753('0xa')](),controller[_0xc753('0xf')]);router[_0xc753('0x10')]('/',auth[_0xc753('0xa')](),controller[_0xc753('0x11')]);router[_0xc753('0x12')](_0xc753('0xe'),auth['isAuthenticated'](),controller[_0xc753('0x13')]);router[_0xc753('0x14')]('/:id',auth[_0xc753('0xa')](),controller['destroy']);module[_0xc753('0x15')]=router; \ No newline at end of file +var _0x748f=['put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x4d7769,_0x12ec53){var _0x30b5ac=function(_0x4bb27d){while(--_0x4bb27d){_0x4d7769['push'](_0x4d7769['shift']());}};_0x30b5ac(++_0x12ec53);}(_0x748f,0x194));var _0xf748=function(_0x3018cb,_0x5cece4){_0x3018cb=_0x3018cb-0x0;var _0x91249=_0x748f[_0x3018cb];return _0x91249;};'use strict';var multer=require(_0xf748('0x0'));var util=require('util');var path=require(_0xf748('0x1'));var timeout=require(_0xf748('0x2'));var express=require('express');var router=express[_0xf748('0x3')]();var fs_extra=require(_0xf748('0x4'));var auth=require(_0xf748('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf748('0x6'));var controller=require(_0xf748('0x7'));router[_0xf748('0x8')]('/',auth[_0xf748('0x9')](),controller['index']);router['get'](_0xf748('0xa'),auth[_0xf748('0x9')](),controller[_0xf748('0xb')]);router['get'](_0xf748('0xc'),auth['isAuthenticated'](),controller[_0xf748('0xd')]);router[_0xf748('0xe')]('/',auth['isAuthenticated'](),controller[_0xf748('0xf')]);router[_0xf748('0x10')](_0xf748('0xc'),auth[_0xf748('0x9')](),controller[_0xf748('0x11')]);router['delete']('/:id',auth[_0xf748('0x9')](),controller[_0xf748('0x12')]);module[_0xf748('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 ed15e51..43c4383 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 _0x741c=['STRING','name','sequelize','exports'];(function(_0x44579b,_0x173fe2){var _0x1f1008=function(_0xcb7244){while(--_0xcb7244){_0x44579b['push'](_0x44579b['shift']());}};_0x1f1008(++_0x173fe2);}(_0x741c,0x196));var _0xc741=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x741c[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xc741('0x0'));module[_0xc741('0x1')]={'name':{'type':Sequelize[_0xc741('0x2')],'unique':_0xc741('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc741('0x2')]}}; \ No newline at end of file +var _0xdfa0=['sequelize','STRING','name'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xdfa0,0x69));var _0x0dfa=function(_0x50a790,_0x2704b4){_0x50a790=_0x50a790-0x0;var _0x35f775=_0xdfa0[_0x50a790];return _0x35f775;};'use strict';var Sequelize=require(_0x0dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfa('0x1')],'unique':_0x0dfa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1cfc59c..0921c2e 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 _0x0cd9=['rawAttributes','find','create','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','MailSubstatus'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x0cd9,0x125));var _0x90cd=function(_0x15138e,_0x2ebb6){_0x15138e=_0x15138e-0x0;var _0x22c82f=_0x0cd9[_0x15138e];return _0x22c82f;};'use strict';var emlformat=require(_0x90cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x90cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x90cd('0x2'));var BPromise=require(_0x90cd('0x3'));var Mustache=require(_0x90cd('0x4'));var util=require(_0x90cd('0x5'));var path=require(_0x90cd('0x6'));var sox=require(_0x90cd('0x7'));var csv=require(_0x90cd('0x8'));var ejs=require(_0x90cd('0x9'));var fs=require('fs');var fs_extra=require(_0x90cd('0xa'));var _=require(_0x90cd('0xb'));var squel=require(_0x90cd('0xc'));var crypto=require('crypto');var jsforce=require(_0x90cd('0xd'));var deskjs=require(_0x90cd('0xe'));var toCsv=require(_0x90cd('0x8'));var querystring=require(_0x90cd('0xf'));var Papa=require('papaparse');var Redis=require(_0x90cd('0x10'));var authService=require(_0x90cd('0x11'));var qs=require(_0x90cd('0x12'));var as=require(_0x90cd('0x13'));var hardwareService=require(_0x90cd('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x90cd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x90cd('0x16'))['db'];function respondWithStatusCode(_0x38a218,_0xc79ca2){_0xc79ca2=_0xc79ca2||0xcc;return function(_0x245c53){if(_0x245c53){return _0x38a218['sendStatus'](_0xc79ca2);}return _0x38a218[_0x90cd('0x17')](_0xc79ca2)[_0x90cd('0x18')]();};}function respondWithResult(_0x358239,_0x4ad630){_0x4ad630=_0x4ad630||0xc8;return function(_0x571320){if(_0x571320){return _0x358239[_0x90cd('0x17')](_0x4ad630)['json'](_0x571320);}};}function respondWithFilteredResult(_0x5bd288,_0x9dc841){return function(_0x20ea2d){if(_0x20ea2d){var _0x194f4e=typeof _0x9dc841[_0x90cd('0x19')]===_0x90cd('0x1a')&&typeof _0x9dc841[_0x90cd('0x1b')]==='undefined';var _0x1dbfe4=_0x20ea2d[_0x90cd('0x1c')];var _0x22d683=_0x194f4e?0x0:_0x9dc841['offset'];var _0x414a33=_0x194f4e?_0x20ea2d[_0x90cd('0x1c')]:_0x9dc841[_0x90cd('0x19')]+_0x9dc841[_0x90cd('0x1b')];var _0x4bc046;if(_0x414a33>=_0x1dbfe4){_0x414a33=_0x1dbfe4;_0x4bc046=0xc8;}else{_0x4bc046=0xce;}_0x5bd288['status'](_0x4bc046);return _0x5bd288['set'](_0x90cd('0x1d'),_0x22d683+'-'+_0x414a33+'/'+_0x1dbfe4)['json'](_0x20ea2d);}return null;};}function patchUpdates(_0x267d1b){return function(_0x29c3be){try{jsonpatch['apply'](_0x29c3be,_0x267d1b,!![]);}catch(_0x5475ad){return BPromise[_0x90cd('0x1e')](_0x5475ad);}return _0x29c3be[_0x90cd('0x1f')]();};}function saveUpdates(_0x13c912,_0x32640a){return function(_0x586eeb){if(_0x586eeb){return _0x586eeb[_0x90cd('0x20')](_0x13c912)[_0x90cd('0x21')](function(_0x18f4e6){return _0x18f4e6;});}return null;};}function removeEntity(_0x109c54,_0x53421a){return function(_0x319f9c){if(_0x319f9c){return _0x319f9c[_0x90cd('0x22')]()[_0x90cd('0x21')](function(){_0x109c54[_0x90cd('0x17')](0xcc)[_0x90cd('0x18')]();});}};}function handleEntityNotFound(_0x50dd76,_0x4b7ec2){return function(_0x4713bf){if(!_0x4713bf){_0x50dd76[_0x90cd('0x23')](0x194);}return _0x4713bf;};}function handleError(_0x46465f,_0x161744){_0x161744=_0x161744||0x1f4;return function(_0x1d7fe0){logger[_0x90cd('0x24')](_0x1d7fe0[_0x90cd('0x25')]);if(_0x1d7fe0[_0x90cd('0x26')]){delete _0x1d7fe0[_0x90cd('0x26')];}_0x46465f[_0x90cd('0x17')](_0x161744)[_0x90cd('0x27')](_0x1d7fe0);};}exports['index']=function(_0x5da2b5,_0x47bf5e){var _0x3d2bd9={},_0x35d0c9={},_0x20468e={'count':0x0,'rows':[]};var _0x3ac27a=_[_0x90cd('0x28')](db['MailSubstatus']['rawAttributes'],function(_0x816978){return{'name':_0x816978['fieldName'],'type':_0x816978[_0x90cd('0x29')][_0x90cd('0x2a')]};});_0x35d0c9[_0x90cd('0x2b')]=_[_0x90cd('0x28')](_0x3ac27a,'name');_0x35d0c9[_0x90cd('0x2c')]=_[_0x90cd('0x2d')](_0x5da2b5[_0x90cd('0x2c')]);_0x35d0c9['filters']=_[_0x90cd('0x2e')](_0x35d0c9['model'],_0x35d0c9[_0x90cd('0x2c')]);_0x3d2bd9[_0x90cd('0x2f')]=_['intersection'](_0x35d0c9['model'],qs[_0x90cd('0x30')](_0x5da2b5[_0x90cd('0x2c')][_0x90cd('0x30')]));_0x3d2bd9[_0x90cd('0x2f')]=_0x3d2bd9[_0x90cd('0x2f')][_0x90cd('0x31')]?_0x3d2bd9[_0x90cd('0x2f')]:_0x35d0c9[_0x90cd('0x2b')];if(!_0x5da2b5[_0x90cd('0x2c')][_0x90cd('0x32')]('nolimit')){_0x3d2bd9['limit']=qs[_0x90cd('0x1b')](_0x5da2b5[_0x90cd('0x2c')][_0x90cd('0x1b')]);_0x3d2bd9[_0x90cd('0x19')]=qs[_0x90cd('0x19')](_0x5da2b5[_0x90cd('0x2c')][_0x90cd('0x19')]);}_0x3d2bd9[_0x90cd('0x33')]=qs[_0x90cd('0x34')](_0x5da2b5[_0x90cd('0x2c')][_0x90cd('0x34')]);_0x3d2bd9[_0x90cd('0x35')]=qs['filters'](_[_0x90cd('0x36')](_0x5da2b5[_0x90cd('0x2c')],_0x35d0c9[_0x90cd('0x37')]),_0x3ac27a);if(_0x5da2b5[_0x90cd('0x2c')]['filter']){_0x3d2bd9[_0x90cd('0x35')]=_[_0x90cd('0x38')](_0x3d2bd9['where'],{'$or':_[_0x90cd('0x28')](_0x3ac27a,function(_0x2c97cd){if(_0x2c97cd[_0x90cd('0x29')]!==_0x90cd('0x39')){var _0x5e45fd={};_0x5e45fd[_0x2c97cd['name']]={'$like':'%'+_0x5da2b5[_0x90cd('0x2c')]['filter']+'%'};return _0x5e45fd;}})});}_0x3d2bd9=_[_0x90cd('0x38')]({},_0x3d2bd9,_0x5da2b5[_0x90cd('0x3a')]);var _0x24a1e3={'where':_0x3d2bd9[_0x90cd('0x35')]};return db['MailSubstatus'][_0x90cd('0x1c')](_0x24a1e3)[_0x90cd('0x21')](function(_0x3d101a){_0x20468e['count']=_0x3d101a;if(_0x5da2b5[_0x90cd('0x2c')][_0x90cd('0x3b')]){_0x3d2bd9[_0x90cd('0x3c')]=[{'all':!![]}];}return db['MailSubstatus'][_0x90cd('0x3d')](_0x3d2bd9);})[_0x90cd('0x21')](function(_0x2499f1){_0x20468e[_0x90cd('0x3e')]=_0x2499f1;return _0x20468e;})[_0x90cd('0x21')](respondWithFilteredResult(_0x47bf5e,_0x3d2bd9))[_0x90cd('0x3f')](handleError(_0x47bf5e,null));};exports[_0x90cd('0x40')]=function(_0x21e8d0,_0x2f6f14){var _0x547c69={'raw':!![],'where':{'id':_0x21e8d0[_0x90cd('0x41')]['id']}},_0x489761={};_0x489761['model']=_['keys'](db[_0x90cd('0x42')][_0x90cd('0x43')]);_0x489761[_0x90cd('0x2c')]=_['keys'](_0x21e8d0[_0x90cd('0x2c')]);_0x489761[_0x90cd('0x37')]=_[_0x90cd('0x2e')](_0x489761[_0x90cd('0x2b')],_0x489761[_0x90cd('0x2c')]);_0x547c69[_0x90cd('0x2f')]=_[_0x90cd('0x2e')](_0x489761[_0x90cd('0x2b')],qs[_0x90cd('0x30')](_0x21e8d0[_0x90cd('0x2c')][_0x90cd('0x30')]));_0x547c69[_0x90cd('0x2f')]=_0x547c69[_0x90cd('0x2f')][_0x90cd('0x31')]?_0x547c69[_0x90cd('0x2f')]:_0x489761['model'];if(_0x21e8d0[_0x90cd('0x2c')][_0x90cd('0x3b')]){_0x547c69[_0x90cd('0x3c')]=[{'all':!![]}];}_0x547c69=_[_0x90cd('0x38')]({},_0x547c69,_0x21e8d0[_0x90cd('0x3a')]);return db[_0x90cd('0x42')][_0x90cd('0x44')](_0x547c69)[_0x90cd('0x21')](handleEntityNotFound(_0x2f6f14,null))['then'](respondWithResult(_0x2f6f14,null))['catch'](handleError(_0x2f6f14,null));};exports[_0x90cd('0x45')]=function(_0x4db36f,_0x4ff724){return db[_0x90cd('0x42')][_0x90cd('0x45')](_0x4db36f['body'],{})[_0x90cd('0x21')](respondWithResult(_0x4ff724,0xc9))[_0x90cd('0x3f')](handleError(_0x4ff724,null));};exports[_0x90cd('0x20')]=function(_0x176d9e,_0x4116e7){if(_0x176d9e['body']['id']){delete _0x176d9e[_0x90cd('0x46')]['id'];}return db[_0x90cd('0x42')][_0x90cd('0x44')]({'where':{'id':_0x176d9e[_0x90cd('0x41')]['id']}})[_0x90cd('0x21')](handleEntityNotFound(_0x4116e7,null))[_0x90cd('0x21')](saveUpdates(_0x176d9e[_0x90cd('0x46')],null))[_0x90cd('0x21')](respondWithResult(_0x4116e7,null))[_0x90cd('0x3f')](handleError(_0x4116e7,null));};exports[_0x90cd('0x22')]=function(_0x30da27,_0x580b1b){return db[_0x90cd('0x42')][_0x90cd('0x44')]({'where':{'id':_0x30da27[_0x90cd('0x41')]['id']}})[_0x90cd('0x21')](handleEntityNotFound(_0x580b1b,null))['then'](removeEntity(_0x580b1b,null))[_0x90cd('0x3f')](handleError(_0x580b1b,null));};exports[_0x90cd('0x47')]=function(_0x2d003e,_0x11eb13){return db[_0x90cd('0x42')][_0x90cd('0x47')]()[_0x90cd('0x21')](respondWithResult(_0x11eb13,null))[_0x90cd('0x3f')](handleError(_0x11eb13,null));}; \ No newline at end of file +var _0xd5f5=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0xfa751f,_0xa94e0e){var _0x42e833=function(_0x239272){while(--_0x239272){_0xfa751f['push'](_0xfa751f['shift']());}};_0x42e833(++_0xa94e0e);}(_0xd5f5,0x103));var _0x5d5f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd5f5[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x5d5f('0x0'));var rimraf=require(_0x5d5f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d5f('0x2'));var rp=require(_0x5d5f('0x3'));var moment=require(_0x5d5f('0x4'));var BPromise=require(_0x5d5f('0x5'));var Mustache=require(_0x5d5f('0x6'));var util=require(_0x5d5f('0x7'));var path=require(_0x5d5f('0x8'));var sox=require(_0x5d5f('0x9'));var csv=require('to-csv');var ejs=require(_0x5d5f('0xa'));var fs=require('fs');var fs_extra=require(_0x5d5f('0xb'));var _=require(_0x5d5f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5d5f('0xd'));var deskjs=require(_0x5d5f('0xe'));var toCsv=require(_0x5d5f('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5d5f('0x10'));var authService=require(_0x5d5f('0x11'));var qs=require(_0x5d5f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d5f('0x13'));var logger=require(_0x5d5f('0x14'))(_0x5d5f('0x15'));var utils=require(_0x5d5f('0x16'));var config=require(_0x5d5f('0x17'));var licenseUtil=require(_0x5d5f('0x18'));var db=require(_0x5d5f('0x19'))['db'];function respondWithStatusCode(_0x286784,_0x3e73be){_0x3e73be=_0x3e73be||0xcc;return function(_0x40fb5){if(_0x40fb5){return _0x286784[_0x5d5f('0x1a')](_0x3e73be);}return _0x286784[_0x5d5f('0x1b')](_0x3e73be)[_0x5d5f('0x1c')]();};}function respondWithResult(_0x188d8f,_0x2962){_0x2962=_0x2962||0xc8;return function(_0x30175d){if(_0x30175d){return _0x188d8f[_0x5d5f('0x1b')](_0x2962)[_0x5d5f('0x1d')](_0x30175d);}};}function respondWithFilteredResult(_0x413b1d,_0x5ab9ab){return function(_0x135a7f){if(_0x135a7f){var _0x2a5217=typeof _0x5ab9ab[_0x5d5f('0x1e')]===_0x5d5f('0x1f')&&typeof _0x5ab9ab[_0x5d5f('0x20')]==='undefined';var _0x529e6c=_0x135a7f['count'];var _0x398f34=_0x2a5217?0x0:_0x5ab9ab[_0x5d5f('0x1e')];var _0x2f504e=_0x2a5217?_0x135a7f[_0x5d5f('0x21')]:_0x5ab9ab[_0x5d5f('0x1e')]+_0x5ab9ab[_0x5d5f('0x20')];var _0x1418ab;if(_0x2f504e>=_0x529e6c){_0x2f504e=_0x529e6c;_0x1418ab=0xc8;}else{_0x1418ab=0xce;}_0x413b1d[_0x5d5f('0x1b')](_0x1418ab);return _0x413b1d[_0x5d5f('0x22')](_0x5d5f('0x23'),_0x398f34+'-'+_0x2f504e+'/'+_0x529e6c)[_0x5d5f('0x1d')](_0x135a7f);}return null;};}function patchUpdates(_0x56b950){return function(_0xb0f4fd){try{jsonpatch[_0x5d5f('0x24')](_0xb0f4fd,_0x56b950,!![]);}catch(_0x3b0b69){return BPromise[_0x5d5f('0x25')](_0x3b0b69);}return _0xb0f4fd['save']();};}function saveUpdates(_0x304047,_0x24f9db){return function(_0x2ab30a){if(_0x2ab30a){return _0x2ab30a['update'](_0x304047)['then'](function(_0x114633){return _0x114633;});}return null;};}function removeEntity(_0x2a208f,_0x3d5ce2){return function(_0x2c2e10){if(_0x2c2e10){return _0x2c2e10[_0x5d5f('0x26')]()['then'](function(){_0x2a208f[_0x5d5f('0x1b')](0xcc)[_0x5d5f('0x1c')]();});}};}function handleEntityNotFound(_0x5eb656,_0x44af96){return function(_0x3c1eea){if(!_0x3c1eea){_0x5eb656[_0x5d5f('0x1a')](0x194);}return _0x3c1eea;};}function handleError(_0x3d0a31,_0x2cc774){_0x2cc774=_0x2cc774||0x1f4;return function(_0x144696){logger[_0x5d5f('0x27')](_0x144696[_0x5d5f('0x28')]);if(_0x144696[_0x5d5f('0x29')]){delete _0x144696[_0x5d5f('0x29')];}_0x3d0a31[_0x5d5f('0x1b')](_0x2cc774)[_0x5d5f('0x2a')](_0x144696);};}exports['index']=function(_0x13fd4b,_0x4468d0){var _0x1ce2b2={},_0x501bf7={},_0x4445a8={'count':0x0,'rows':[]};var _0x32c266=_[_0x5d5f('0x2b')](db[_0x5d5f('0x2c')][_0x5d5f('0x2d')],function(_0x376eb8){return{'name':_0x376eb8[_0x5d5f('0x2e')],'type':_0x376eb8[_0x5d5f('0x2f')]['key']};});_0x501bf7[_0x5d5f('0x30')]=_[_0x5d5f('0x2b')](_0x32c266,_0x5d5f('0x29'));_0x501bf7[_0x5d5f('0x31')]=_[_0x5d5f('0x32')](_0x13fd4b[_0x5d5f('0x31')]);_0x501bf7[_0x5d5f('0x33')]=_[_0x5d5f('0x34')](_0x501bf7[_0x5d5f('0x30')],_0x501bf7[_0x5d5f('0x31')]);_0x1ce2b2[_0x5d5f('0x35')]=_[_0x5d5f('0x34')](_0x501bf7[_0x5d5f('0x30')],qs['fields'](_0x13fd4b['query'][_0x5d5f('0x36')]));_0x1ce2b2[_0x5d5f('0x35')]=_0x1ce2b2['attributes']['length']?_0x1ce2b2[_0x5d5f('0x35')]:_0x501bf7[_0x5d5f('0x30')];if(!_0x13fd4b['query'][_0x5d5f('0x37')](_0x5d5f('0x38'))){_0x1ce2b2[_0x5d5f('0x20')]=qs[_0x5d5f('0x20')](_0x13fd4b['query'][_0x5d5f('0x20')]);_0x1ce2b2['offset']=qs['offset'](_0x13fd4b[_0x5d5f('0x31')][_0x5d5f('0x1e')]);}_0x1ce2b2[_0x5d5f('0x39')]=qs[_0x5d5f('0x3a')](_0x13fd4b[_0x5d5f('0x31')]['sort']);_0x1ce2b2[_0x5d5f('0x3b')]=qs[_0x5d5f('0x33')](_[_0x5d5f('0x3c')](_0x13fd4b[_0x5d5f('0x31')],_0x501bf7[_0x5d5f('0x33')]),_0x32c266);if(_0x13fd4b[_0x5d5f('0x31')][_0x5d5f('0x3d')]){_0x1ce2b2[_0x5d5f('0x3b')]=_[_0x5d5f('0x3e')](_0x1ce2b2['where'],{'$or':_[_0x5d5f('0x2b')](_0x32c266,function(_0x1255ac){if(_0x1255ac['type']!==_0x5d5f('0x3f')){var _0x347cc6={};_0x347cc6[_0x1255ac['name']]={'$like':'%'+_0x13fd4b[_0x5d5f('0x31')][_0x5d5f('0x3d')]+'%'};return _0x347cc6;}})});}_0x1ce2b2=_[_0x5d5f('0x3e')]({},_0x1ce2b2,_0x13fd4b[_0x5d5f('0x40')]);var _0xb6aff2={'where':_0x1ce2b2[_0x5d5f('0x3b')]};return db[_0x5d5f('0x2c')]['count'](_0xb6aff2)[_0x5d5f('0x41')](function(_0x132126){_0x4445a8[_0x5d5f('0x21')]=_0x132126;if(_0x13fd4b[_0x5d5f('0x31')][_0x5d5f('0x42')]){_0x1ce2b2[_0x5d5f('0x43')]=[{'all':!![]}];}return db[_0x5d5f('0x2c')][_0x5d5f('0x44')](_0x1ce2b2);})[_0x5d5f('0x41')](function(_0x7a87bd){_0x4445a8[_0x5d5f('0x45')]=_0x7a87bd;return _0x4445a8;})[_0x5d5f('0x41')](respondWithFilteredResult(_0x4468d0,_0x1ce2b2))[_0x5d5f('0x46')](handleError(_0x4468d0,null));};exports[_0x5d5f('0x47')]=function(_0x3d64b5,_0x33d305){var _0x2b2be8={'raw':!![],'where':{'id':_0x3d64b5[_0x5d5f('0x48')]['id']}},_0x199d85={};_0x199d85[_0x5d5f('0x30')]=_['keys'](db[_0x5d5f('0x2c')][_0x5d5f('0x2d')]);_0x199d85[_0x5d5f('0x31')]=_[_0x5d5f('0x32')](_0x3d64b5[_0x5d5f('0x31')]);_0x199d85['filters']=_[_0x5d5f('0x34')](_0x199d85[_0x5d5f('0x30')],_0x199d85[_0x5d5f('0x31')]);_0x2b2be8[_0x5d5f('0x35')]=_[_0x5d5f('0x34')](_0x199d85['model'],qs['fields'](_0x3d64b5[_0x5d5f('0x31')][_0x5d5f('0x36')]));_0x2b2be8['attributes']=_0x2b2be8[_0x5d5f('0x35')][_0x5d5f('0x49')]?_0x2b2be8['attributes']:_0x199d85['model'];if(_0x3d64b5[_0x5d5f('0x31')][_0x5d5f('0x42')]){_0x2b2be8[_0x5d5f('0x43')]=[{'all':!![]}];}_0x2b2be8=_['merge']({},_0x2b2be8,_0x3d64b5[_0x5d5f('0x40')]);return db[_0x5d5f('0x2c')][_0x5d5f('0x4a')](_0x2b2be8)[_0x5d5f('0x41')](handleEntityNotFound(_0x33d305,null))[_0x5d5f('0x41')](respondWithResult(_0x33d305,null))[_0x5d5f('0x46')](handleError(_0x33d305,null));};exports[_0x5d5f('0x4b')]=function(_0x5f4025,_0x8ca033){return db[_0x5d5f('0x2c')][_0x5d5f('0x4b')](_0x5f4025[_0x5d5f('0x4c')],{})['then'](respondWithResult(_0x8ca033,0xc9))[_0x5d5f('0x46')](handleError(_0x8ca033,null));};exports['update']=function(_0x7683e3,_0x2ee74c){if(_0x7683e3[_0x5d5f('0x4c')]['id']){delete _0x7683e3['body']['id'];}return db['MailSubstatus'][_0x5d5f('0x4a')]({'where':{'id':_0x7683e3[_0x5d5f('0x48')]['id']}})[_0x5d5f('0x41')](handleEntityNotFound(_0x2ee74c,null))[_0x5d5f('0x41')](saveUpdates(_0x7683e3['body'],null))['then'](respondWithResult(_0x2ee74c,null))[_0x5d5f('0x46')](handleError(_0x2ee74c,null));};exports[_0x5d5f('0x26')]=function(_0xc96e89,_0x37c7ac){return db[_0x5d5f('0x2c')]['find']({'where':{'id':_0xc96e89[_0x5d5f('0x48')]['id']}})[_0x5d5f('0x41')](handleEntityNotFound(_0x37c7ac,null))[_0x5d5f('0x41')](removeEntity(_0x37c7ac,null))['catch'](handleError(_0x37c7ac,null));};exports[_0x5d5f('0x4d')]=function(_0x370b37,_0xdaf9fb){return db[_0x5d5f('0x2c')][_0x5d5f('0x4d')]()[_0x5d5f('0x41')](respondWithResult(_0xdaf9fb,null))[_0x5d5f('0x46')](handleError(_0xdaf9fb,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index d046a6a..81455b6 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 _0xc843=['events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x15b9ec,_0x4c3ead){var _0x38babe=function(_0x47d37b){while(--_0x47d37b){_0x15b9ec['push'](_0x15b9ec['shift']());}};_0x38babe(++_0x4c3ead);}(_0xc843,0x1bc));var _0x3c84=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0xc843[_0x13ac10];return _0x28eda2;};'use strict';var EventEmitter=require(_0x3c84('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x3c84('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3c84('0x2')](0x0);var events={'afterUpdate':_0x3c84('0x3')};function emitEvent(_0x2028ea){return function(_0x25ef8a,_0x280a22,_0x1dd03d){MailSubstatusEvents[_0x3c84('0x4')](_0x2028ea+':'+_0x25ef8a['id'],_0x25ef8a);MailSubstatusEvents[_0x3c84('0x4')](_0x2028ea,_0x25ef8a);_0x1dd03d(null);};}for(var e in events){if(events[_0x3c84('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x14d2=['exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x239e89,_0x523aab){var _0x4b5cb7=function(_0x17af4a){while(--_0x17af4a){_0x239e89['push'](_0x239e89['shift']());}};_0x4b5cb7(++_0x523aab);}(_0x14d2,0xa2));var _0x214d=function(_0x3c82b3,_0x5ed781){_0x3c82b3=_0x3c82b3-0x0;var _0x2591bd=_0x14d2[_0x3c82b3];return _0x2591bd;};'use strict';var EventEmitter=require(_0x214d('0x0'));var MailSubstatus=require(_0x214d('0x1'))['db'][_0x214d('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x214d('0x3')](0x0);var events={'afterUpdate':_0x214d('0x4')};function emitEvent(_0x578595){return function(_0x3a4761,_0x5b95b1,_0x139596){MailSubstatusEvents['emit'](_0x578595+':'+_0x3a4761['id'],_0x3a4761);MailSubstatusEvents[_0x214d('0x5')](_0x578595,_0x3a4761);_0x139596(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x214d('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4569f06..7f6dfae 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 _0x8281=['define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports'];(function(_0x32480f,_0x3553f7){var _0x4e5485=function(_0x5418d5){while(--_0x5418d5){_0x32480f['push'](_0x32480f['shift']());}};_0x4e5485(++_0x3553f7);}(_0x8281,0xa3));var _0x1828=function(_0x24f715,_0x298586){_0x24f715=_0x24f715-0x0;var _0x47c8e3=_0x8281[_0x24f715];return _0x47c8e3;};'use strict';var attributes=require(_0x1828('0x0'));module[_0x1828('0x1')]=function(_0x22eafe){var _0x3af82e=_0x22eafe['models'];return _0x22eafe[_0x1828('0x2')](_0x1828('0x3'),attributes,{'tableName':_0x1828('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1ce363,_0x4c7673,_0x47d9fc){return _0x3af82e[_0x1828('0x5')][_0x1828('0x6')]({'value':_0x1ce363[_0x1828('0x7')]},{'where':{'field':_0x1828('0x8'),'value':_0x1ce363['_previousDataValues'][_0x1828('0x7')]}})[_0x1828('0x9')](function(){_0x47d9fc();})[_0x1828('0xa')](function(_0x214482){_0x47d9fc(_0x214482);});}}});}; \ No newline at end of file +var _0x41f2=['mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','define','MailSubstatus','Condition','name'];(function(_0x47e8ba,_0x568e04){var _0x54763c=function(_0x178cb7){while(--_0x178cb7){_0x47e8ba['push'](_0x47e8ba['shift']());}};_0x54763c(++_0x568e04);}(_0x41f2,0x17b));var _0x241f=function(_0x362212,_0x392d3e){_0x362212=_0x362212-0x0;var _0x4a46e0=_0x41f2[_0x362212];return _0x4a46e0;};'use strict';var attributes=require(_0x241f('0x0'));module['exports']=function(_0x439ea1){var _0x476fd4=_0x439ea1['models'];return _0x439ea1[_0x241f('0x1')](_0x241f('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2526ba,_0x3b549e,_0x6fa8fb){return _0x476fd4[_0x241f('0x3')]['update']({'value':_0x2526ba[_0x241f('0x4')]},{'where':{'field':_0x241f('0x5'),'value':_0x2526ba[_0x241f('0x6')]['name']}})[_0x241f('0x7')](function(){_0x6fa8fb();})['catch'](function(_0x548b36){_0x6fa8fb(_0x548b36);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 2f7fbed..7e4ce0d 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 _0xd087=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd087,0x6f));var _0x7d08=function(_0x247b0b,_0x3df01f){_0x247b0b=_0x247b0b-0x0;var _0x44dfde=_0xd087[_0x247b0b];return _0x44dfde;};'use strict';var _=require(_0x7d08('0x0'));var util=require(_0x7d08('0x1'));var moment=require(_0x7d08('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d08('0x3'));var fs=require('fs');var Redis=require(_0x7d08('0x4'));var db=require(_0x7d08('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d08('0x6'))(_0x7d08('0x7'));var config=require(_0x7d08('0x8'));var jayson=require(_0x7d08('0x9'));var client=jayson['client'][_0x7d08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fb708,_0x378e97,_0x28973){return new BPromise(function(_0x931d19,_0xc17a){return client['request'](_0x3fb708,_0x28973)[_0x7d08('0xb')](function(_0x200266){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x378e97,_0x7d08('0xc'));logger[_0x7d08('0xd')](_0x7d08('0xe'),_0x378e97,_0x7d08('0xc'),JSON[_0x7d08('0xf')](_0x200266));if(_0x200266['error']){if(_0x200266[_0x7d08('0x10')][_0x7d08('0x11')]===0x1f4){logger[_0x7d08('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x378e97,_0x200266[_0x7d08('0x10')][_0x7d08('0x12')]);return _0xc17a(_0x200266[_0x7d08('0x10')][_0x7d08('0x12')]);}logger[_0x7d08('0x10')](_0x7d08('0x13'),_0x378e97,_0x200266[_0x7d08('0x10')][_0x7d08('0x12')]);return _0x931d19(_0x200266[_0x7d08('0x10')][_0x7d08('0x12')]);}else{logger[_0x7d08('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x378e97,_0x7d08('0xc'));_0x931d19(_0x200266[_0x7d08('0x15')][_0x7d08('0x12')]);}})[_0x7d08('0x16')](function(_0x532871){logger[_0x7d08('0x10')](_0x7d08('0x13'),_0x378e97,_0x532871);_0xc17a(_0x532871);});});} \ No newline at end of file +var _0x741c=['jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x337d94,_0x50b66f){var _0x4dbf4f=function(_0x42d79f){while(--_0x42d79f){_0x337d94['push'](_0x337d94['shift']());}};_0x4dbf4f(++_0x50b66f);}(_0x741c,0x98));var _0xc741=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x741c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var moment=require(_0xc741('0x2'));var BPromise=require(_0xc741('0x3'));var rs=require(_0xc741('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc741('0x5'))['db'];var utils=require(_0xc741('0x6'));var logger=require(_0xc741('0x7'))(_0xc741('0x8'));var config=require('../../config/environment');var jayson=require(_0xc741('0x9'));var client=jayson[_0xc741('0xa')][_0xc741('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49e447,_0x5a69e2,_0x5cff27){return new BPromise(function(_0x4300ef,_0x30fba2){return client['request'](_0x49e447,_0x5cff27)['then'](function(_0x3a0b90){logger[_0xc741('0xc')](_0xc741('0xd'),_0x5a69e2,_0xc741('0xe'));logger[_0xc741('0xf')](_0xc741('0x10'),_0x5a69e2,'request\x20sent',JSON[_0xc741('0x11')](_0x3a0b90));if(_0x3a0b90[_0xc741('0x12')]){if(_0x3a0b90[_0xc741('0x12')][_0xc741('0x13')]===0x1f4){logger['error'](_0xc741('0xd'),_0x5a69e2,_0x3a0b90[_0xc741('0x12')][_0xc741('0x14')]);return _0x30fba2(_0x3a0b90[_0xc741('0x12')][_0xc741('0x14')]);}logger[_0xc741('0x12')](_0xc741('0xd'),_0x5a69e2,_0x3a0b90[_0xc741('0x12')][_0xc741('0x14')]);return _0x4300ef(_0x3a0b90[_0xc741('0x12')][_0xc741('0x14')]);}else{logger[_0xc741('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x5a69e2,_0xc741('0xe'));_0x4300ef(_0x3a0b90[_0xc741('0x15')][_0xc741('0x14')]);}})[_0xc741('0x16')](function(_0x374b90){logger[_0xc741('0x12')](_0xc741('0xd'),_0x5a69e2,_0x374b90);_0x30fba2(_0x374b90);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9ff1306..aeb672d 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 _0x0847=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','show','post','create','put'];(function(_0x4ccbe2,_0x11eacf){var _0x134525=function(_0x5c9da9){while(--_0x5c9da9){_0x4ccbe2['push'](_0x4ccbe2['shift']());}};_0x134525(++_0x11eacf);}(_0x0847,0x165));var _0x7084=function(_0xd3a823,_0x4ad32e){_0xd3a823=_0xd3a823-0x0;var _0x54b98a=_0x0847[_0xd3a823];return _0x54b98a;};'use strict';var multer=require('multer');var util=require(_0x7084('0x0'));var path=require(_0x7084('0x1'));var timeout=require(_0x7084('0x2'));var express=require(_0x7084('0x3'));var router=express[_0x7084('0x4')]();var fs_extra=require(_0x7084('0x5'));var auth=require(_0x7084('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7084('0x7'));var controller=require(_0x7084('0x8'));router[_0x7084('0x9')]('/',auth[_0x7084('0xa')](),controller[_0x7084('0xb')]);router[_0x7084('0x9')]('/describe',auth[_0x7084('0xa')](),controller[_0x7084('0xc')]);router[_0x7084('0x9')]('/:id',auth[_0x7084('0xa')](),controller[_0x7084('0xd')]);router[_0x7084('0xe')]('/',auth[_0x7084('0xa')](),controller[_0x7084('0xf')]);router[_0x7084('0x10')](_0x7084('0x11'),auth[_0x7084('0xa')](),controller[_0x7084('0x12')]);router[_0x7084('0x13')](_0x7084('0x11'),auth['isAuthenticated'](),controller[_0x7084('0x14')]);module[_0x7084('0x15')]=router; \ No newline at end of file +var _0x24b2=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x119e3f,_0x24e162){var _0x453d58=function(_0x34ffdb){while(--_0x34ffdb){_0x119e3f['push'](_0x119e3f['shift']());}};_0x453d58(++_0x24e162);}(_0x24b2,0x172));var _0x224b=function(_0x4c39f5,_0x109684){_0x4c39f5=_0x4c39f5-0x0;var _0x1db24f=_0x24b2[_0x4c39f5];return _0x1db24f;};'use strict';var multer=require(_0x224b('0x0'));var util=require(_0x224b('0x1'));var path=require(_0x224b('0x2'));var timeout=require(_0x224b('0x3'));var express=require(_0x224b('0x4'));var router=express['Router']();var fs_extra=require(_0x224b('0x5'));var auth=require(_0x224b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x224b('0x7'));var controller=require(_0x224b('0x8'));router[_0x224b('0x9')]('/',auth[_0x224b('0xa')](),controller[_0x224b('0xb')]);router[_0x224b('0x9')](_0x224b('0xc'),auth['isAuthenticated'](),controller[_0x224b('0xd')]);router['get'](_0x224b('0xe'),auth[_0x224b('0xa')](),controller[_0x224b('0xf')]);router[_0x224b('0x10')]('/',auth['isAuthenticated'](),controller[_0x224b('0x11')]);router[_0x224b('0x12')](_0x224b('0xe'),auth[_0x224b('0xa')](),controller[_0x224b('0x13')]);router[_0x224b('0x14')](_0x224b('0xe'),auth[_0x224b('0xa')](),controller[_0x224b('0x15')]);module[_0x224b('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 269eee4..d0e5233 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x46149a,_0x4ee4fc){var _0x2e01a3=function(_0x184ba3){while(--_0x184ba3){_0x46149a['push'](_0x46149a['shift']());}};_0x2e01a3(++_0x4ee4fc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xcb91[_0x256b72];return _0x2183e3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xb43b,0x1b2));var _0xbb43=function(_0xa5b1ab,_0x6a691e){_0xa5b1ab=_0xa5b1ab-0x0;var _0x5a942b=_0xb43b[_0xa5b1ab];return _0x5a942b;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 450e454..ed49940 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 _0xfa9e=['save','update','then','sendStatus','name','map','MailTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','filter','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','keys','merge','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x58c302,_0x2685ef){var _0x7a28c7=function(_0x4e2149){while(--_0x4e2149){_0x58c302['push'](_0x58c302['shift']());}};_0x7a28c7(++_0x2685ef);}(_0xfa9e,0x1c7));var _0xefa9=function(_0x5373d7,_0x48e798){_0x5373d7=_0x5373d7-0x0;var _0x47b769=_0xfa9e[_0x5373d7];return _0x47b769;};'use strict';var emlformat=require(_0xefa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefa9('0x1'));var jsonpatch=require(_0xefa9('0x2'));var rp=require(_0xefa9('0x3'));var moment=require(_0xefa9('0x4'));var BPromise=require(_0xefa9('0x5'));var Mustache=require(_0xefa9('0x6'));var util=require(_0xefa9('0x7'));var path=require(_0xefa9('0x8'));var sox=require(_0xefa9('0x9'));var csv=require(_0xefa9('0xa'));var ejs=require(_0xefa9('0xb'));var fs=require('fs');var fs_extra=require(_0xefa9('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xefa9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xefa9('0xe'));var toCsv=require(_0xefa9('0xa'));var querystring=require(_0xefa9('0xf'));var Papa=require(_0xefa9('0x10'));var Redis=require(_0xefa9('0x11'));var authService=require(_0xefa9('0x12'));var qs=require(_0xefa9('0x13'));var as=require(_0xefa9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefa9('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xefa9('0x16'));var licenseUtil=require(_0xefa9('0x17'));var db=require(_0xefa9('0x18'))['db'];function respondWithStatusCode(_0x5bc0cd,_0x31f78b){_0x31f78b=_0x31f78b||0xcc;return function(_0x31f8c7){if(_0x31f8c7){return _0x5bc0cd['sendStatus'](_0x31f78b);}return _0x5bc0cd[_0xefa9('0x19')](_0x31f78b)[_0xefa9('0x1a')]();};}function respondWithResult(_0x593650,_0x4e643b){_0x4e643b=_0x4e643b||0xc8;return function(_0x22f023){if(_0x22f023){return _0x593650['status'](_0x4e643b)['json'](_0x22f023);}};}function respondWithFilteredResult(_0x3a386d,_0x29bdd9){return function(_0x55efac){if(_0x55efac){var _0x3e7b3a=typeof _0x29bdd9[_0xefa9('0x1b')]===_0xefa9('0x1c')&&typeof _0x29bdd9[_0xefa9('0x1d')]===_0xefa9('0x1c');var _0x3b8e70=_0x55efac[_0xefa9('0x1e')];var _0x1db648=_0x3e7b3a?0x0:_0x29bdd9['offset'];var _0x187f44=_0x3e7b3a?_0x55efac[_0xefa9('0x1e')]:_0x29bdd9[_0xefa9('0x1b')]+_0x29bdd9[_0xefa9('0x1d')];var _0x13248d;if(_0x187f44>=_0x3b8e70){_0x187f44=_0x3b8e70;_0x13248d=0xc8;}else{_0x13248d=0xce;}_0x3a386d['status'](_0x13248d);return _0x3a386d[_0xefa9('0x1f')]('Content-Range',_0x1db648+'-'+_0x187f44+'/'+_0x3b8e70)[_0xefa9('0x20')](_0x55efac);}return null;};}function patchUpdates(_0x5fdb13){return function(_0x5d1d2a){try{jsonpatch[_0xefa9('0x21')](_0x5d1d2a,_0x5fdb13,!![]);}catch(_0x8beb83){return BPromise[_0xefa9('0x22')](_0x8beb83);}return _0x5d1d2a[_0xefa9('0x23')]();};}function saveUpdates(_0x551d22,_0xd121a5){return function(_0x323d68){if(_0x323d68){return _0x323d68[_0xefa9('0x24')](_0x551d22)[_0xefa9('0x25')](function(_0x128161){return _0x128161;});}return null;};}function removeEntity(_0xdb2145,_0xc12e16){return function(_0x3688ca){if(_0x3688ca){return _0x3688ca['destroy']()['then'](function(){_0xdb2145[_0xefa9('0x19')](0xcc)[_0xefa9('0x1a')]();});}};}function handleEntityNotFound(_0x3cd473,_0x1f9799){return function(_0xda9517){if(!_0xda9517){_0x3cd473[_0xefa9('0x26')](0x194);}return _0xda9517;};}function handleError(_0x47c590,_0x53231a){_0x53231a=_0x53231a||0x1f4;return function(_0x10b1c6){logger['error'](_0x10b1c6['stack']);if(_0x10b1c6[_0xefa9('0x27')]){delete _0x10b1c6['name'];}_0x47c590[_0xefa9('0x19')](_0x53231a)['send'](_0x10b1c6);};}exports['index']=function(_0x5f2d14,_0x4fd607){var _0x462172={},_0x5bd031={},_0x544497={'count':0x0,'rows':[]};var _0x26e164=_[_0xefa9('0x28')](db[_0xefa9('0x29')]['rawAttributes'],function(_0x5cc6c7){return{'name':_0x5cc6c7[_0xefa9('0x2a')],'type':_0x5cc6c7[_0xefa9('0x2b')][_0xefa9('0x2c')]};});_0x5bd031[_0xefa9('0x2d')]=_[_0xefa9('0x28')](_0x26e164,_0xefa9('0x27'));_0x5bd031['query']=_['keys'](_0x5f2d14[_0xefa9('0x2e')]);_0x5bd031[_0xefa9('0x2f')]=_['intersection'](_0x5bd031['model'],_0x5bd031[_0xefa9('0x2e')]);_0x462172[_0xefa9('0x30')]=_[_0xefa9('0x31')](_0x5bd031[_0xefa9('0x2d')],qs[_0xefa9('0x32')](_0x5f2d14['query'][_0xefa9('0x32')]));_0x462172[_0xefa9('0x30')]=_0x462172[_0xefa9('0x30')][_0xefa9('0x33')]?_0x462172[_0xefa9('0x30')]:_0x5bd031[_0xefa9('0x2d')];if(!_0x5f2d14['query']['hasOwnProperty']('nolimit')){_0x462172['limit']=qs[_0xefa9('0x1d')](_0x5f2d14[_0xefa9('0x2e')][_0xefa9('0x1d')]);_0x462172[_0xefa9('0x1b')]=qs['offset'](_0x5f2d14['query'][_0xefa9('0x1b')]);}_0x462172[_0xefa9('0x34')]=qs['sort'](_0x5f2d14[_0xefa9('0x2e')][_0xefa9('0x35')]);_0x462172[_0xefa9('0x36')]=qs['filters'](_['pick'](_0x5f2d14['query'],_0x5bd031['filters']),_0x26e164);if(_0x5f2d14[_0xefa9('0x2e')][_0xefa9('0x37')]){_0x462172[_0xefa9('0x36')]=_['merge'](_0x462172['where'],{'$or':_[_0xefa9('0x28')](_0x26e164,function(_0x334dc5){if(_0x334dc5[_0xefa9('0x2b')]!==_0xefa9('0x38')){var _0x4607c8={};_0x4607c8[_0x334dc5[_0xefa9('0x27')]]={'$like':'%'+_0x5f2d14[_0xefa9('0x2e')][_0xefa9('0x37')]+'%'};return _0x4607c8;}})});}_0x462172=_['merge']({},_0x462172,_0x5f2d14[_0xefa9('0x39')]);var _0x4698b7={'where':_0x462172[_0xefa9('0x36')]};return db[_0xefa9('0x29')][_0xefa9('0x1e')](_0x4698b7)['then'](function(_0x593aad){_0x544497[_0xefa9('0x1e')]=_0x593aad;if(_0x5f2d14['query'][_0xefa9('0x3a')]){_0x462172[_0xefa9('0x3b')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x462172);})[_0xefa9('0x25')](function(_0x1b1be3){_0x544497['rows']=_0x1b1be3;return _0x544497;})['then'](respondWithFilteredResult(_0x4fd607,_0x462172))[_0xefa9('0x3c')](handleError(_0x4fd607,null));};exports[_0xefa9('0x3d')]=function(_0x183111,_0x22a5bc){var _0x5b49e1={'raw':!![],'where':{'id':_0x183111['params']['id']}},_0x1336c7={};_0x1336c7[_0xefa9('0x2d')]=_['keys'](db[_0xefa9('0x29')][_0xefa9('0x3e')]);_0x1336c7[_0xefa9('0x2e')]=_[_0xefa9('0x3f')](_0x183111[_0xefa9('0x2e')]);_0x1336c7['filters']=_[_0xefa9('0x31')](_0x1336c7[_0xefa9('0x2d')],_0x1336c7[_0xefa9('0x2e')]);_0x5b49e1[_0xefa9('0x30')]=_[_0xefa9('0x31')](_0x1336c7['model'],qs[_0xefa9('0x32')](_0x183111[_0xefa9('0x2e')][_0xefa9('0x32')]));_0x5b49e1[_0xefa9('0x30')]=_0x5b49e1[_0xefa9('0x30')][_0xefa9('0x33')]?_0x5b49e1[_0xefa9('0x30')]:_0x1336c7[_0xefa9('0x2d')];if(_0x183111[_0xefa9('0x2e')]['includeAll']){_0x5b49e1[_0xefa9('0x3b')]=[{'all':!![]}];}_0x5b49e1=_[_0xefa9('0x40')]({},_0x5b49e1,_0x183111[_0xefa9('0x39')]);return db[_0xefa9('0x29')][_0xefa9('0x41')](_0x5b49e1)[_0xefa9('0x25')](handleEntityNotFound(_0x22a5bc,null))['then'](respondWithResult(_0x22a5bc,null))[_0xefa9('0x3c')](handleError(_0x22a5bc,null));};exports[_0xefa9('0x42')]=function(_0x8ffb02,_0x9a19fd){return db[_0xefa9('0x29')][_0xefa9('0x42')](_0x8ffb02[_0xefa9('0x43')],{})[_0xefa9('0x25')](respondWithResult(_0x9a19fd,0xc9))['catch'](handleError(_0x9a19fd,null));};exports['update']=function(_0x49bc80,_0x1fef83){if(_0x49bc80[_0xefa9('0x43')]['id']){delete _0x49bc80[_0xefa9('0x43')]['id'];}return db[_0xefa9('0x29')]['find']({'where':{'id':_0x49bc80[_0xefa9('0x44')]['id']}})[_0xefa9('0x25')](handleEntityNotFound(_0x1fef83,null))[_0xefa9('0x25')](saveUpdates(_0x49bc80['body'],null))[_0xefa9('0x25')](respondWithResult(_0x1fef83,null))[_0xefa9('0x3c')](handleError(_0x1fef83,null));};exports['destroy']=function(_0x5e1198,_0xdacdda){return db[_0xefa9('0x29')]['find']({'where':{'id':_0x5e1198[_0xefa9('0x44')]['id']}})[_0xefa9('0x25')](handleEntityNotFound(_0xdacdda,null))['then'](removeEntity(_0xdacdda,null))[_0xefa9('0x3c')](handleError(_0xdacdda,null));};exports[_0xefa9('0x45')]=function(_0x3da867,_0x4731c1){return db[_0xefa9('0x29')][_0xefa9('0x45')]()['then'](respondWithResult(_0x4731c1,null))['catch'](handleError(_0x4731c1,null));}; \ No newline at end of file +var _0xe54c=['query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','MailTransferReport','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','apply','save','update','destroy','then','end','error','stack','name','send','index','map','fieldName','type','model','keys','filters'];(function(_0x15f8ad,_0x5275c3){var _0xc0238a=function(_0x5550c8){while(--_0x5550c8){_0x15f8ad['push'](_0x15f8ad['shift']());}};_0xc0238a(++_0x5275c3);}(_0xe54c,0x1cf));var _0xce54=function(_0x3376bd,_0x4fdb2a){_0x3376bd=_0x3376bd-0x0;var _0x587b0b=_0xe54c[_0x3376bd];return _0x587b0b;};'use strict';var emlformat=require(_0xce54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce54('0x1'));var jsonpatch=require(_0xce54('0x2'));var rp=require(_0xce54('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xce54('0x4'));var util=require(_0xce54('0x5'));var path=require(_0xce54('0x6'));var sox=require('sox');var csv=require(_0xce54('0x7'));var ejs=require(_0xce54('0x8'));var fs=require('fs');var fs_extra=require(_0xce54('0x9'));var _=require(_0xce54('0xa'));var squel=require(_0xce54('0xb'));var crypto=require('crypto');var jsforce=require(_0xce54('0xc'));var deskjs=require(_0xce54('0xd'));var toCsv=require(_0xce54('0x7'));var querystring=require(_0xce54('0xe'));var Papa=require('papaparse');var Redis=require(_0xce54('0xf'));var authService=require(_0xce54('0x10'));var qs=require(_0xce54('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce54('0x12'));var logger=require(_0xce54('0x13'))(_0xce54('0x14'));var utils=require(_0xce54('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xce54('0x16'));var db=require(_0xce54('0x17'))['db'];function respondWithStatusCode(_0x3535ef,_0x47041e){_0x47041e=_0x47041e||0xcc;return function(_0x22bf58){if(_0x22bf58){return _0x3535ef[_0xce54('0x18')](_0x47041e);}return _0x3535ef[_0xce54('0x19')](_0x47041e)['end']();};}function respondWithResult(_0x4a61f4,_0x1b935d){_0x1b935d=_0x1b935d||0xc8;return function(_0x2577a0){if(_0x2577a0){return _0x4a61f4[_0xce54('0x19')](_0x1b935d)[_0xce54('0x1a')](_0x2577a0);}};}function respondWithFilteredResult(_0x463313,_0x3a6e6c){return function(_0x50962b){if(_0x50962b){var _0x390b69=typeof _0x3a6e6c['offset']===_0xce54('0x1b')&&typeof _0x3a6e6c[_0xce54('0x1c')]===_0xce54('0x1b');var _0x5a2888=_0x50962b['count'];var _0x11f3dc=_0x390b69?0x0:_0x3a6e6c['offset'];var _0x1092a3=_0x390b69?_0x50962b[_0xce54('0x1d')]:_0x3a6e6c[_0xce54('0x1e')]+_0x3a6e6c[_0xce54('0x1c')];var _0x23e00e;if(_0x1092a3>=_0x5a2888){_0x1092a3=_0x5a2888;_0x23e00e=0xc8;}else{_0x23e00e=0xce;}_0x463313[_0xce54('0x19')](_0x23e00e);return _0x463313['set']('Content-Range',_0x11f3dc+'-'+_0x1092a3+'/'+_0x5a2888)[_0xce54('0x1a')](_0x50962b);}return null;};}function patchUpdates(_0x51e9f3){return function(_0x759a71){try{jsonpatch[_0xce54('0x1f')](_0x759a71,_0x51e9f3,!![]);}catch(_0x937fbe){return BPromise['reject'](_0x937fbe);}return _0x759a71[_0xce54('0x20')]();};}function saveUpdates(_0x3b53a0,_0x95e745){return function(_0xdca7dc){if(_0xdca7dc){return _0xdca7dc[_0xce54('0x21')](_0x3b53a0)['then'](function(_0x81fdc){return _0x81fdc;});}return null;};}function removeEntity(_0x154670,_0x53edd3){return function(_0x2c3e96){if(_0x2c3e96){return _0x2c3e96[_0xce54('0x22')]()[_0xce54('0x23')](function(){_0x154670[_0xce54('0x19')](0xcc)[_0xce54('0x24')]();});}};}function handleEntityNotFound(_0x27c354,_0x19c35b){return function(_0x1a642e){if(!_0x1a642e){_0x27c354[_0xce54('0x18')](0x194);}return _0x1a642e;};}function handleError(_0x47e376,_0x4e909b){_0x4e909b=_0x4e909b||0x1f4;return function(_0xe49e09){logger[_0xce54('0x25')](_0xe49e09[_0xce54('0x26')]);if(_0xe49e09['name']){delete _0xe49e09[_0xce54('0x27')];}_0x47e376[_0xce54('0x19')](_0x4e909b)[_0xce54('0x28')](_0xe49e09);};}exports[_0xce54('0x29')]=function(_0xcb6b7d,_0x3e7cff){var _0x1adbc6={},_0x5c49bb={},_0x26eeff={'count':0x0,'rows':[]};var _0x5b9644=_[_0xce54('0x2a')](db['MailTransferReport']['rawAttributes'],function(_0x52785b){return{'name':_0x52785b[_0xce54('0x2b')],'type':_0x52785b[_0xce54('0x2c')]['key']};});_0x5c49bb[_0xce54('0x2d')]=_[_0xce54('0x2a')](_0x5b9644,_0xce54('0x27'));_0x5c49bb['query']=_[_0xce54('0x2e')](_0xcb6b7d['query']);_0x5c49bb[_0xce54('0x2f')]=_['intersection'](_0x5c49bb['model'],_0x5c49bb[_0xce54('0x30')]);_0x1adbc6[_0xce54('0x31')]=_[_0xce54('0x32')](_0x5c49bb[_0xce54('0x2d')],qs[_0xce54('0x33')](_0xcb6b7d[_0xce54('0x30')][_0xce54('0x33')]));_0x1adbc6['attributes']=_0x1adbc6['attributes'][_0xce54('0x34')]?_0x1adbc6[_0xce54('0x31')]:_0x5c49bb[_0xce54('0x2d')];if(!_0xcb6b7d[_0xce54('0x30')][_0xce54('0x35')](_0xce54('0x36'))){_0x1adbc6[_0xce54('0x1c')]=qs[_0xce54('0x1c')](_0xcb6b7d[_0xce54('0x30')][_0xce54('0x1c')]);_0x1adbc6[_0xce54('0x1e')]=qs['offset'](_0xcb6b7d[_0xce54('0x30')]['offset']);}_0x1adbc6[_0xce54('0x37')]=qs[_0xce54('0x38')](_0xcb6b7d[_0xce54('0x30')][_0xce54('0x38')]);_0x1adbc6[_0xce54('0x39')]=qs[_0xce54('0x2f')](_['pick'](_0xcb6b7d['query'],_0x5c49bb['filters']),_0x5b9644);if(_0xcb6b7d['query'][_0xce54('0x3a')]){_0x1adbc6[_0xce54('0x39')]=_[_0xce54('0x3b')](_0x1adbc6[_0xce54('0x39')],{'$or':_[_0xce54('0x2a')](_0x5b9644,function(_0x3d42f4){if(_0x3d42f4[_0xce54('0x2c')]!=='VIRTUAL'){var _0x499453={};_0x499453[_0x3d42f4[_0xce54('0x27')]]={'$like':'%'+_0xcb6b7d[_0xce54('0x30')][_0xce54('0x3a')]+'%'};return _0x499453;}})});}_0x1adbc6=_['merge']({},_0x1adbc6,_0xcb6b7d[_0xce54('0x3c')]);var _0x3c23cb={'where':_0x1adbc6[_0xce54('0x39')]};return db['MailTransferReport'][_0xce54('0x1d')](_0x3c23cb)[_0xce54('0x23')](function(_0x3c2cdb){_0x26eeff[_0xce54('0x1d')]=_0x3c2cdb;if(_0xcb6b7d[_0xce54('0x30')][_0xce54('0x3d')]){_0x1adbc6[_0xce54('0x3e')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x1adbc6);})['then'](function(_0x443da7){_0x26eeff[_0xce54('0x3f')]=_0x443da7;return _0x26eeff;})['then'](respondWithFilteredResult(_0x3e7cff,_0x1adbc6))[_0xce54('0x40')](handleError(_0x3e7cff,null));};exports[_0xce54('0x41')]=function(_0x563026,_0x2528ca){var _0x13358b={'raw':!![],'where':{'id':_0x563026[_0xce54('0x42')]['id']}},_0x508f53={};_0x508f53[_0xce54('0x2d')]=_['keys'](db[_0xce54('0x43')][_0xce54('0x44')]);_0x508f53['query']=_[_0xce54('0x2e')](_0x563026[_0xce54('0x30')]);_0x508f53['filters']=_['intersection'](_0x508f53['model'],_0x508f53['query']);_0x13358b[_0xce54('0x31')]=_[_0xce54('0x32')](_0x508f53['model'],qs[_0xce54('0x33')](_0x563026[_0xce54('0x30')][_0xce54('0x33')]));_0x13358b[_0xce54('0x31')]=_0x13358b[_0xce54('0x31')][_0xce54('0x34')]?_0x13358b[_0xce54('0x31')]:_0x508f53['model'];if(_0x563026['query']['includeAll']){_0x13358b[_0xce54('0x3e')]=[{'all':!![]}];}_0x13358b=_[_0xce54('0x3b')]({},_0x13358b,_0x563026[_0xce54('0x3c')]);return db[_0xce54('0x43')][_0xce54('0x45')](_0x13358b)[_0xce54('0x23')](handleEntityNotFound(_0x2528ca,null))[_0xce54('0x23')](respondWithResult(_0x2528ca,null))['catch'](handleError(_0x2528ca,null));};exports[_0xce54('0x46')]=function(_0x18c362,_0x2871e1){return db[_0xce54('0x43')][_0xce54('0x46')](_0x18c362[_0xce54('0x47')],{})[_0xce54('0x23')](respondWithResult(_0x2871e1,0xc9))[_0xce54('0x40')](handleError(_0x2871e1,null));};exports[_0xce54('0x21')]=function(_0x4f9052,_0x10e02f){if(_0x4f9052[_0xce54('0x47')]['id']){delete _0x4f9052[_0xce54('0x47')]['id'];}return db[_0xce54('0x43')][_0xce54('0x45')]({'where':{'id':_0x4f9052[_0xce54('0x42')]['id']}})[_0xce54('0x23')](handleEntityNotFound(_0x10e02f,null))[_0xce54('0x23')](saveUpdates(_0x4f9052['body'],null))['then'](respondWithResult(_0x10e02f,null))[_0xce54('0x40')](handleError(_0x10e02f,null));};exports[_0xce54('0x22')]=function(_0xd8589a,_0xf4f6d3){return db['MailTransferReport'][_0xce54('0x45')]({'where':{'id':_0xd8589a[_0xce54('0x42')]['id']}})[_0xce54('0x23')](handleEntityNotFound(_0xf4f6d3,null))['then'](removeEntity(_0xf4f6d3,null))[_0xce54('0x40')](handleError(_0xf4f6d3,null));};exports[_0xce54('0x48')]=function(_0x3d48f3,_0x35dc65){return db[_0xce54('0x43')][_0xce54('0x48')]()[_0xce54('0x23')](respondWithResult(_0x35dc65,null))[_0xce54('0x40')](handleError(_0x35dc65,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 784518c..4116443 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 _0xcba7=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0xa0d20,_0x2428af){var _0x16f9d1=function(_0x48ea19){while(--_0x48ea19){_0xa0d20['push'](_0xa0d20['shift']());}};_0x16f9d1(++_0x2428af);}(_0xcba7,0x199));var _0x7cba=function(_0x324e58,_0x5667bf){_0x324e58=_0x324e58-0x0;var _0x41bda1=_0xcba7[_0x324e58];return _0x41bda1;};'use strict';var _=require(_0x7cba('0x0'));var util=require(_0x7cba('0x1'));var logger=require(_0x7cba('0x2'))(_0x7cba('0x3'));var moment=require('moment');var BPromise=require(_0x7cba('0x4'));var rp=require(_0x7cba('0x5'));var fs=require('fs');var path=require(_0x7cba('0x6'));var rimraf=require('rimraf');var config=require(_0x7cba('0x7'));var attributes=require(_0x7cba('0x8'));module[_0x7cba('0x9')]=function(_0x2b0112,_0x285928){return _0x2b0112[_0x7cba('0xa')](_0x7cba('0xb'),attributes,{'tableName':_0x7cba('0xc'),'paranoid':![],'indexes':[{'name':_0x7cba('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2056=['MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define'];(function(_0x311cfe,_0x42e904){var _0x40ce33=function(_0x29b0f4){while(--_0x29b0f4){_0x311cfe['push'](_0x311cfe['shift']());}};_0x40ce33(++_0x42e904);}(_0x2056,0x107));var _0x6205=function(_0xeb6b36,_0x159863){_0xeb6b36=_0xeb6b36-0x0;var _0xbac1b2=_0x2056[_0xeb6b36];return _0xbac1b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6205('0x0'))(_0x6205('0x1'));var moment=require(_0x6205('0x2'));var BPromise=require(_0x6205('0x3'));var rp=require(_0x6205('0x4'));var fs=require('fs');var path=require(_0x6205('0x5'));var rimraf=require(_0x6205('0x6'));var config=require(_0x6205('0x7'));var attributes=require(_0x6205('0x8'));module['exports']=function(_0x45afa8,_0x2c555d){return _0x45afa8[_0x6205('0x9')](_0x6205('0xa'),attributes,{'tableName':_0x6205('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6205('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 218f320..4ae3f90 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 _0xe517=['request','info','request\x20sent','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4856fa,_0x3aac40){var _0x57196d=function(_0x1239a6){while(--_0x1239a6){_0x4856fa['push'](_0x4856fa['shift']());}};_0x57196d(++_0x3aac40);}(_0xe517,0xa1));var _0x7e51=function(_0x1239bc,_0x248454){_0x1239bc=_0x1239bc-0x0;var _0x5e6089=_0xe517[_0x1239bc];return _0x5e6089;};'use strict';var _=require(_0x7e51('0x0'));var util=require('util');var moment=require(_0x7e51('0x1'));var BPromise=require(_0x7e51('0x2'));var rs=require(_0x7e51('0x3'));var fs=require('fs');var Redis=require(_0x7e51('0x4'));var db=require(_0x7e51('0x5'))['db'];var utils=require(_0x7e51('0x6'));var logger=require(_0x7e51('0x7'))(_0x7e51('0x8'));var config=require(_0x7e51('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37a8c8,_0x1dc21d,_0x3b5ed9){return new BPromise(function(_0x3e4e81,_0x5417f7){return client[_0x7e51('0xa')](_0x37a8c8,_0x3b5ed9)['then'](function(_0xa93438){logger[_0x7e51('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x1dc21d,_0x7e51('0xc'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1dc21d,'request\x20sent',JSON[_0x7e51('0xd')](_0xa93438));if(_0xa93438[_0x7e51('0xe')]){if(_0xa93438[_0x7e51('0xe')][_0x7e51('0xf')]===0x1f4){logger[_0x7e51('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x1dc21d,_0xa93438[_0x7e51('0xe')][_0x7e51('0x10')]);return _0x5417f7(_0xa93438[_0x7e51('0xe')][_0x7e51('0x10')]);}logger[_0x7e51('0xe')](_0x7e51('0x11'),_0x1dc21d,_0xa93438[_0x7e51('0xe')]['message']);return _0x3e4e81(_0xa93438[_0x7e51('0xe')][_0x7e51('0x10')]);}else{logger[_0x7e51('0xb')](_0x7e51('0x11'),_0x1dc21d,_0x7e51('0xc'));_0x3e4e81(_0xa93438[_0x7e51('0x12')][_0x7e51('0x10')]);}})['catch'](function(_0x43402a){logger[_0x7e51('0xe')](_0x7e51('0x11'),_0x1dc21d,_0x43402a);_0x5417f7(_0x43402a);});});} \ No newline at end of file +var _0xa2d2=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2d2,0x16e));var _0x2a2d=function(_0x36427f,_0xe96ae7){_0x36427f=_0x36427f-0x0;var _0x63526e=_0xa2d2[_0x36427f];return _0x63526e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2a2d('0x0'));var BPromise=require(_0x2a2d('0x1'));var rs=require(_0x2a2d('0x2'));var fs=require('fs');var Redis=require(_0x2a2d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a2d('0x4'));var logger=require(_0x2a2d('0x5'))(_0x2a2d('0x6'));var config=require(_0x2a2d('0x7'));var jayson=require(_0x2a2d('0x8'));var client=jayson[_0x2a2d('0x9')][_0x2a2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dd538,_0x3143c6,_0x5e2c0c){return new BPromise(function(_0x14832e,_0x17a318){return client[_0x2a2d('0xb')](_0x1dd538,_0x5e2c0c)[_0x2a2d('0xc')](function(_0x4b1a1b){logger[_0x2a2d('0xd')](_0x2a2d('0xe'),_0x3143c6,_0x2a2d('0xf'));logger[_0x2a2d('0x10')](_0x2a2d('0x11'),_0x3143c6,'request\x20sent',JSON[_0x2a2d('0x12')](_0x4b1a1b));if(_0x4b1a1b['error']){if(_0x4b1a1b[_0x2a2d('0x13')][_0x2a2d('0x14')]===0x1f4){logger['error'](_0x2a2d('0xe'),_0x3143c6,_0x4b1a1b[_0x2a2d('0x13')]['message']);return _0x17a318(_0x4b1a1b[_0x2a2d('0x13')][_0x2a2d('0x15')]);}logger[_0x2a2d('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x3143c6,_0x4b1a1b['error'][_0x2a2d('0x15')]);return _0x14832e(_0x4b1a1b['error'][_0x2a2d('0x15')]);}else{logger[_0x2a2d('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x3143c6,'request\x20sent');_0x14832e(_0x4b1a1b['result'][_0x2a2d('0x15')]);}})[_0x2a2d('0x16')](function(_0x5de925){logger[_0x2a2d('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x3143c6,_0x5de925);_0x17a318(_0x5de925);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 28f7e41..97bbf8a 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 _0x81f8=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x81f8,0xa5));var _0x881f=function(_0x5917da,_0xc89962){_0x5917da=_0x5917da-0x0;var _0x23400f=_0x81f8[_0x5917da];return _0x23400f;};'use strict';var multer=require(_0x881f('0x0'));var util=require(_0x881f('0x1'));var path=require(_0x881f('0x2'));var timeout=require(_0x881f('0x3'));var express=require('express');var router=express[_0x881f('0x4')]();var fs_extra=require(_0x881f('0x5'));var auth=require(_0x881f('0x6'));var interaction=require(_0x881f('0x7'));var config=require(_0x881f('0x8'));var controller=require('./memberReport.controller');router[_0x881f('0x9')]('/',auth[_0x881f('0xa')](),controller[_0x881f('0xb')]);router[_0x881f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x881f('0xc')]);router['get'](_0x881f('0xd'),auth['isAuthenticated'](),controller[_0x881f('0xe')]);router[_0x881f('0xf')]('/',auth[_0x881f('0xa')](),controller[_0x881f('0x10')]);router[_0x881f('0x11')](_0x881f('0xd'),auth['isAuthenticated'](),controller[_0x881f('0x12')]);router[_0x881f('0x13')]('/:id',auth[_0x881f('0xa')](),controller['destroy']);module[_0x881f('0x14')]=router; \ No newline at end of file +var _0x5656=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id','show','post','create','put','delete','exports','multer'];(function(_0x37c1fe,_0x2c8f88){var _0x11a353=function(_0x18f3e1){while(--_0x18f3e1){_0x37c1fe['push'](_0x37c1fe['shift']());}};_0x11a353(++_0x2c8f88);}(_0x5656,0x76));var _0x6565=function(_0x117d15,_0x4d4ef6){_0x117d15=_0x117d15-0x0;var _0x43459d=_0x5656[_0x117d15];return _0x43459d;};'use strict';var multer=require(_0x6565('0x0'));var util=require(_0x6565('0x1'));var path=require('path');var timeout=require(_0x6565('0x2'));var express=require('express');var router=express[_0x6565('0x3')]();var fs_extra=require(_0x6565('0x4'));var auth=require(_0x6565('0x5'));var interaction=require(_0x6565('0x6'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x6565('0x7')]('/',auth['isAuthenticated'](),controller[_0x6565('0x8')]);router[_0x6565('0x7')]('/describe',auth[_0x6565('0x9')](),controller['describe']);router['get'](_0x6565('0xa'),auth[_0x6565('0x9')](),controller[_0x6565('0xb')]);router[_0x6565('0xc')]('/',auth[_0x6565('0x9')](),controller[_0x6565('0xd')]);router[_0x6565('0xe')](_0x6565('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6565('0xf')](_0x6565('0xa'),auth[_0x6565('0x9')](),controller['destroy']);module[_0x6565('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index b233aaf..04ed0fc 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 _0xc243=['talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0xa381d7,_0x46f231){var _0x46cc2f=function(_0x4b0c83){while(--_0x4b0c83){_0xa381d7['push'](_0xa381d7['shift']());}};_0x46cc2f(++_0x46f231);}(_0xc243,0xd2));var _0x3c24=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0xc243[_0x2f6541];return _0x4d76d8;};'use strict';var Sequelize=require(_0x3c24('0x0'));var moment=require(_0x3c24('0x1'));module[_0x3c24('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3c24('0x3')]},'interface':{'type':Sequelize[_0x3c24('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x3c24('0x4')},'duration':{'type':Sequelize[_0x3c24('0x5')]},'enterAt':{'type':Sequelize[_0x3c24('0x6')]},'exitAt':{'type':Sequelize[_0x3c24('0x6')],'set':function(_0x53a15a){var _0x21e995=moment(_0x53a15a);var _0x538e5f=moment(this[_0x3c24('0x7')]('enterAt'));var _0x551b7e=_0x21e995[_0x3c24('0x8')](_0x538e5f,'seconds');this['setDataValue'](_0x3c24('0x9'),_0x53a15a);this[_0x3c24('0xa')](_0x3c24('0xb'),_0x551b7e>=0x0?_0x551b7e:null);}},'data1':{'type':Sequelize[_0x3c24('0x3')],'comment':_0x3c24('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x3c24('0xd')},'data3':{'type':Sequelize[_0x3c24('0x3')],'comment':_0x3c24('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0x3c24('0xf')},'data5':{'type':Sequelize[_0x3c24('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x3c24('0x5')]},'uniqueid':{'type':Sequelize[_0x3c24('0x3')]}}; \ No newline at end of file +var _0xe37c=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration'];(function(_0x65981a,_0x39c0b5){var _0x46f8e5=function(_0x369239){while(--_0x369239){_0x65981a['push'](_0x65981a['shift']());}};_0x46f8e5(++_0x39c0b5);}(_0xe37c,0x164));var _0xce37=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0xe37c[_0x5eb22e];return _0x27fed5;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xce37('0x0')]={'channel':{'type':Sequelize[_0xce37('0x1')]},'membername':{'type':Sequelize[_0xce37('0x1')]},'interface':{'type':Sequelize[_0xce37('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xce37('0x2'),'comment':_0xce37('0x3')},'duration':{'type':Sequelize[_0xce37('0x4')]},'enterAt':{'type':Sequelize[_0xce37('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x1f84ad){var _0x149e23=moment(_0x1f84ad);var _0x5f58ba=moment(this[_0xce37('0x6')](_0xce37('0x7')));var _0x48a8e2=_0x149e23['diff'](_0x5f58ba,_0xce37('0x8'));this[_0xce37('0x9')](_0xce37('0xa'),_0x1f84ad);this[_0xce37('0x9')](_0xce37('0xb'),_0x48a8e2>=0x0?_0x48a8e2:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xce37('0xc')},'data2':{'type':Sequelize[_0xce37('0x1')],'comment':_0xce37('0xd')},'data3':{'type':Sequelize[_0xce37('0x1')],'comment':_0xce37('0xe')},'data4':{'type':Sequelize[_0xce37('0x1')],'comment':_0xce37('0xf')},'data5':{'type':Sequelize[_0xce37('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xce37('0x1')]},'internal':{'type':Sequelize[_0xce37('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 60c8548..f5fff03 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x114b20,_0x55cedd){var _0x3d1edf=function(_0x5d2bd1){while(--_0x5d2bd1){_0x114b20['push'](_0x114b20['shift']());}};_0x3d1edf(++_0x55cedd);}(_0x008c,0x188));var _0xc008=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x008c[_0x298ed3];return _0x5aad28;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +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(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0x55ca[_0x1d1963];return _0x3f58bb;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 9cc74e5..029de96 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 _0x4089=['define','report_member','membername_interface','membername','interface','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./memberReport.attributes','exports'];(function(_0x479d75,_0x4cb85b){var _0x2bcfaa=function(_0x72c13d){while(--_0x72c13d){_0x479d75['push'](_0x479d75['shift']());}};_0x2bcfaa(++_0x4cb85b);}(_0x4089,0x1bf));var _0x9408=function(_0xb68cee,_0x4956f7){_0xb68cee=_0xb68cee-0x0;var _0x47cdb3=_0x4089[_0xb68cee];return _0x47cdb3;};'use strict';var _=require(_0x9408('0x0'));var util=require('util');var logger=require(_0x9408('0x1'))(_0x9408('0x2'));var moment=require('moment');var BPromise=require(_0x9408('0x3'));var rp=require(_0x9408('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9408('0x5'));var attributes=require(_0x9408('0x6'));module[_0x9408('0x7')]=function(_0x49ff2f,_0x42d2c5){return _0x49ff2f[_0x9408('0x8')]('MemberReport',attributes,{'tableName':_0x9408('0x9'),'paranoid':![],'indexes':[{'name':_0x9408('0xa'),'fields':[_0x9408('0xb'),_0x9408('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x07f7=['./memberReport.attributes','exports','define','report_member','membername_interface','interface','lodash','util','api','bluebird','request-promise','../../config/environment'];(function(_0x2f479d,_0x1d6836){var _0x300d48=function(_0x338a74){while(--_0x338a74){_0x2f479d['push'](_0x2f479d['shift']());}};_0x300d48(++_0x1d6836);}(_0x07f7,0x7e));var _0x707f=function(_0x5e5c4c,_0x21abba){_0x5e5c4c=_0x5e5c4c-0x0;var _0x176148=_0x07f7[_0x5e5c4c];return _0x176148;};'use strict';var _=require(_0x707f('0x0'));var util=require(_0x707f('0x1'));var logger=require('../../config/logger')(_0x707f('0x2'));var moment=require('moment');var BPromise=require(_0x707f('0x3'));var rp=require(_0x707f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x707f('0x5'));var attributes=require(_0x707f('0x6'));module[_0x707f('0x7')]=function(_0x12bab1,_0x70cf99){return _0x12bab1[_0x707f('0x8')]('MemberReport',attributes,{'tableName':_0x707f('0x9'),'paranoid':![],'indexes':[{'name':_0x707f('0xa'),'fields':['membername',_0x707f('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 9b59c38..ddc2ef4 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 _0x37c5=['include','map','model','then','catch','create','body','raw','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','MemberReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','GetMemberReport','MemberReport','options','where','attributes','limit'];(function(_0xf9a5d7,_0x146e9c){var _0x559bdb=function(_0x459acd){while(--_0x459acd){_0xf9a5d7['push'](_0xf9a5d7['shift']());}};_0x559bdb(++_0x146e9c);}(_0x37c5,0xa7));var _0x537c=function(_0x23dbae,_0x3d9027){_0x23dbae=_0x23dbae-0x0;var _0x28da18=_0x37c5[_0x23dbae];return _0x28da18;};'use strict';var _=require('lodash');var util=require(_0x537c('0x0'));var moment=require(_0x537c('0x1'));var BPromise=require(_0x537c('0x2'));var rs=require(_0x537c('0x3'));var fs=require('fs');var Redis=require(_0x537c('0x4'));var db=require(_0x537c('0x5'))['db'];var utils=require(_0x537c('0x6'));var logger=require(_0x537c('0x7'))(_0x537c('0x8'));var config=require(_0x537c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x537c('0xa')][_0x537c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x336920,_0x57666f,_0x36bf4a){return new BPromise(function(_0x67f986,_0x32b9c7){return client[_0x537c('0xc')](_0x336920,_0x36bf4a)['then'](function(_0x2c2f06){logger[_0x537c('0xd')](_0x537c('0xe'),_0x57666f,'request\x20sent');logger[_0x537c('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x57666f,'request\x20sent',JSON[_0x537c('0x10')](_0x2c2f06));if(_0x2c2f06['error']){if(_0x2c2f06[_0x537c('0x11')][_0x537c('0x12')]===0x1f4){logger[_0x537c('0x11')](_0x537c('0xe'),_0x57666f,_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);return _0x32b9c7(_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);}logger[_0x537c('0x11')]('MemberReport,\x20%s,\x20%s',_0x57666f,_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);return _0x67f986(_0x2c2f06[_0x537c('0x11')][_0x537c('0x13')]);}else{logger[_0x537c('0xd')](_0x537c('0xe'),_0x57666f,_0x537c('0x14'));_0x67f986(_0x2c2f06[_0x537c('0x15')][_0x537c('0x13')]);}})['catch'](function(_0x3ae729){logger['error']('MemberReport,\x20%s,\x20%s',_0x57666f,_0x3ae729);_0x32b9c7(_0x3ae729);});});}exports[_0x537c('0x16')]=function(_0x237be8){var _0x2a890e=this;return new Promise(function(_0x5f3776,_0x28b410){return db[_0x537c('0x17')]['findAll']({'raw':_0x237be8['options']?_0x237be8[_0x537c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x237be8['options']?_0x237be8[_0x537c('0x18')][_0x537c('0x19')]||null:null,'attributes':_0x237be8['options']?_0x237be8[_0x537c('0x18')][_0x537c('0x1a')]||null:null,'limit':_0x237be8['options']?_0x237be8['options'][_0x537c('0x1b')]||null:null,'include':_0x237be8['options']?_0x237be8['options'][_0x537c('0x1c')]?_[_0x537c('0x1d')](_0x237be8[_0x537c('0x18')][_0x537c('0x1c')],function(_0x3698bc){return{'model':db[_0x3698bc[_0x537c('0x1e')]],'as':_0x3698bc['as'],'attributes':_0x3698bc['attributes'],'include':_0x3698bc[_0x537c('0x1c')]?_[_0x537c('0x1d')](_0x3698bc[_0x537c('0x1c')],function(_0xcd7d47){return{'model':db[_0xcd7d47[_0x537c('0x1e')]],'as':_0xcd7d47['as'],'attributes':_0xcd7d47['attributes'],'include':_0xcd7d47['include']?_['map'](_0xcd7d47[_0x537c('0x1c')],function(_0x1fa0ca){return{'model':db[_0x1fa0ca['model']],'as':_0x1fa0ca['as'],'attributes':_0x1fa0ca[_0x537c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x537c('0x1f')](function(_0x1b9ff2){logger['info']('GetMemberReport',_0x237be8);logger[_0x537c('0xf')](_0x537c('0x16'),_0x237be8,JSON[_0x537c('0x10')](_0x1b9ff2));_0x5f3776(_0x1b9ff2);})[_0x537c('0x20')](function(_0x49d60b){logger['error'](_0x537c('0x16'),_0x49d60b[_0x537c('0x13')],_0x237be8);_0x28b410(_0x2a890e['error'](0x1f4,_0x49d60b['message']));});});};exports['CreateMemberReport']=function(_0x49138c){var _0x254996=this;return new Promise(function(_0x433968,_0x3aa9d6){return db['MemberReport'][_0x537c('0x21')](_0x49138c[_0x537c('0x22')],{'raw':_0x49138c[_0x537c('0x18')]?_0x49138c['options'][_0x537c('0x23')]===undefined?!![]:![]:!![]})[_0x537c('0x1f')](function(_0x2aa360){logger['info']('CreateMemberReport',_0x49138c);logger[_0x537c('0xf')](_0x537c('0x24'),_0x49138c,JSON[_0x537c('0x10')](_0x2aa360));_0x433968(_0x2aa360);})[_0x537c('0x20')](function(_0x3e599f){logger[_0x537c('0x11')](_0x537c('0x24'),_0x3e599f[_0x537c('0x13')],_0x49138c);_0x3aa9d6(_0x254996['error'](0x1f4,_0x3e599f['message']));});});};exports[_0x537c('0x25')]=function(_0x46263d){var _0x4c8233=this;return new Promise(function(_0x36d769,_0xf7a818){return db[_0x537c('0x17')][_0x537c('0x26')](_0x46263d[_0x537c('0x22')],{'raw':_0x46263d['options']?_0x46263d[_0x537c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46263d['options']?_0x46263d['options']['where']||null:null,'attributes':_0x46263d[_0x537c('0x18')]?_0x46263d[_0x537c('0x18')][_0x537c('0x1a')]||null:null,'limit':_0x46263d[_0x537c('0x18')]?_0x46263d[_0x537c('0x18')][_0x537c('0x1b')]||null:null})[_0x537c('0x1f')](function(_0xcbc993){logger[_0x537c('0xd')](_0x537c('0x25'),_0x46263d);logger[_0x537c('0xf')](_0x537c('0x25'),_0x46263d,JSON[_0x537c('0x10')](_0xcbc993));_0x36d769(_0xcbc993);})[_0x537c('0x20')](function(_0x5494d3){logger[_0x537c('0x11')]('UpdateMemberReport',_0x5494d3[_0x537c('0x13')],_0x46263d);_0xf7a818(_0x4c8233[_0x537c('0x11')](0x1f4,_0x5494d3['message']));});});}; \ No newline at end of file +var _0x3d49=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetMemberReport','MemberReport','findAll','options','where','limit','include','attributes','map','model','catch','CreateMemberReport','create','body','raw','UpdateMemberReport','update','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x333ff4,_0x1e8738){var _0x3442d7=function(_0x252a1d){while(--_0x252a1d){_0x333ff4['push'](_0x333ff4['shift']());}};_0x3442d7(++_0x1e8738);}(_0x3d49,0x151));var _0x93d4=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0x3d49[_0xf6aec0];return _0x59a51b;};'use strict';var _=require('lodash');var util=require(_0x93d4('0x0'));var moment=require(_0x93d4('0x1'));var BPromise=require(_0x93d4('0x2'));var rs=require(_0x93d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93d4('0x4'))['db'];var utils=require(_0x93d4('0x5'));var logger=require(_0x93d4('0x6'))(_0x93d4('0x7'));var config=require(_0x93d4('0x8'));var jayson=require(_0x93d4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bee9d,_0x5e2fd9,_0x50c533){return new BPromise(function(_0x4c96b7,_0x1eaf9f){return client[_0x93d4('0xa')](_0x4bee9d,_0x50c533)[_0x93d4('0xb')](function(_0x11bc7a){logger[_0x93d4('0xc')](_0x93d4('0xd'),_0x5e2fd9,_0x93d4('0xe'));logger[_0x93d4('0xf')](_0x93d4('0x10'),_0x5e2fd9,_0x93d4('0xe'),JSON[_0x93d4('0x11')](_0x11bc7a));if(_0x11bc7a[_0x93d4('0x12')]){if(_0x11bc7a['error'][_0x93d4('0x13')]===0x1f4){logger['error'](_0x93d4('0xd'),_0x5e2fd9,_0x11bc7a[_0x93d4('0x12')][_0x93d4('0x14')]);return _0x1eaf9f(_0x11bc7a[_0x93d4('0x12')]['message']);}logger[_0x93d4('0x12')](_0x93d4('0xd'),_0x5e2fd9,_0x11bc7a['error'][_0x93d4('0x14')]);return _0x4c96b7(_0x11bc7a[_0x93d4('0x12')][_0x93d4('0x14')]);}else{logger[_0x93d4('0xc')](_0x93d4('0xd'),_0x5e2fd9,'request\x20sent');_0x4c96b7(_0x11bc7a['result'][_0x93d4('0x14')]);}})['catch'](function(_0x1ffdc5){logger[_0x93d4('0x12')](_0x93d4('0xd'),_0x5e2fd9,_0x1ffdc5);_0x1eaf9f(_0x1ffdc5);});});}exports[_0x93d4('0x15')]=function(_0x19ede1){var _0x266e0a=this;return new Promise(function(_0x56c054,_0x452e98){return db[_0x93d4('0x16')][_0x93d4('0x17')]({'raw':_0x19ede1['options']?_0x19ede1[_0x93d4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x19ede1[_0x93d4('0x18')]?_0x19ede1[_0x93d4('0x18')][_0x93d4('0x19')]||null:null,'attributes':_0x19ede1[_0x93d4('0x18')]?_0x19ede1[_0x93d4('0x18')]['attributes']||null:null,'limit':_0x19ede1[_0x93d4('0x18')]?_0x19ede1[_0x93d4('0x18')][_0x93d4('0x1a')]||null:null,'include':_0x19ede1[_0x93d4('0x18')]?_0x19ede1[_0x93d4('0x18')][_0x93d4('0x1b')]?_['map'](_0x19ede1[_0x93d4('0x18')][_0x93d4('0x1b')],function(_0x26528e){return{'model':db[_0x26528e['model']],'as':_0x26528e['as'],'attributes':_0x26528e[_0x93d4('0x1c')],'include':_0x26528e['include']?_[_0x93d4('0x1d')](_0x26528e[_0x93d4('0x1b')],function(_0x57989a){return{'model':db[_0x57989a[_0x93d4('0x1e')]],'as':_0x57989a['as'],'attributes':_0x57989a[_0x93d4('0x1c')],'include':_0x57989a[_0x93d4('0x1b')]?_['map'](_0x57989a['include'],function(_0x3cf57f){return{'model':db[_0x3cf57f['model']],'as':_0x3cf57f['as'],'attributes':_0x3cf57f[_0x93d4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x93d4('0xb')](function(_0x4dd4d0){logger['info'](_0x93d4('0x15'),_0x19ede1);logger[_0x93d4('0xf')](_0x93d4('0x15'),_0x19ede1,JSON[_0x93d4('0x11')](_0x4dd4d0));_0x56c054(_0x4dd4d0);})[_0x93d4('0x1f')](function(_0x2cfe55){logger[_0x93d4('0x12')](_0x93d4('0x15'),_0x2cfe55[_0x93d4('0x14')],_0x19ede1);_0x452e98(_0x266e0a['error'](0x1f4,_0x2cfe55[_0x93d4('0x14')]));});});};exports[_0x93d4('0x20')]=function(_0x3d5536){var _0x592876=this;return new Promise(function(_0x1baaac,_0x393b63){return db[_0x93d4('0x16')][_0x93d4('0x21')](_0x3d5536[_0x93d4('0x22')],{'raw':_0x3d5536['options']?_0x3d5536[_0x93d4('0x18')][_0x93d4('0x23')]===undefined?!![]:![]:!![]})[_0x93d4('0xb')](function(_0x543d5e){logger[_0x93d4('0xc')](_0x93d4('0x20'),_0x3d5536);logger[_0x93d4('0xf')](_0x93d4('0x20'),_0x3d5536,JSON[_0x93d4('0x11')](_0x543d5e));_0x1baaac(_0x543d5e);})['catch'](function(_0x2cce08){logger[_0x93d4('0x12')](_0x93d4('0x20'),_0x2cce08[_0x93d4('0x14')],_0x3d5536);_0x393b63(_0x592876[_0x93d4('0x12')](0x1f4,_0x2cce08[_0x93d4('0x14')]));});});};exports[_0x93d4('0x24')]=function(_0x23d3aa){var _0x10daa6=this;return new Promise(function(_0x3efdc3,_0x1c3019){return db['MemberReport'][_0x93d4('0x25')](_0x23d3aa['body'],{'raw':_0x23d3aa['options']?_0x23d3aa['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d3aa[_0x93d4('0x18')]?_0x23d3aa[_0x93d4('0x18')][_0x93d4('0x19')]||null:null,'attributes':_0x23d3aa[_0x93d4('0x18')]?_0x23d3aa[_0x93d4('0x18')][_0x93d4('0x1c')]||null:null,'limit':_0x23d3aa[_0x93d4('0x18')]?_0x23d3aa[_0x93d4('0x18')]['limit']||null:null})[_0x93d4('0xb')](function(_0x2db0c1){logger[_0x93d4('0xc')](_0x93d4('0x24'),_0x23d3aa);logger[_0x93d4('0xf')](_0x93d4('0x24'),_0x23d3aa,JSON[_0x93d4('0x11')](_0x2db0c1));_0x3efdc3(_0x2db0c1);})[_0x93d4('0x1f')](function(_0xeaca44){logger[_0x93d4('0x12')]('UpdateMemberReport',_0xeaca44['message'],_0x23d3aa);_0x1c3019(_0x10daa6[_0x93d4('0x12')](0x1f4,_0xeaca44[_0x93d4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4524e74..4a4cb99 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 _0x50f0=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','exports','multer','util','path'];(function(_0x3fc1c6,_0x482992){var _0x510ffa=function(_0x549fc4){while(--_0x549fc4){_0x3fc1c6['push'](_0x3fc1c6['shift']());}};_0x510ffa(++_0x482992);}(_0x50f0,0x6b));var _0x050f=function(_0x30e004,_0x46f8c2){_0x30e004=_0x30e004-0x0;var _0x5ca247=_0x50f0[_0x30e004];return _0x5ca247;};'use strict';var multer=require(_0x050f('0x0'));var util=require(_0x050f('0x1'));var path=require(_0x050f('0x2'));var timeout=require(_0x050f('0x3'));var express=require('express');var router=express[_0x050f('0x4')]();var fs_extra=require(_0x050f('0x5'));var auth=require(_0x050f('0x6'));var interaction=require(_0x050f('0x7'));var config=require(_0x050f('0x8'));var controller=require('./migration.controller');router[_0x050f('0x9')]('/',controller['index']);module[_0x050f('0xa')]=router; \ No newline at end of file +var _0x793d=['express','Router','../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports','multer','util','path'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x793d,0x15d));var _0xd793=function(_0x3a4155,_0x1788ee){_0x3a4155=_0x3a4155-0x0;var _0x32bb99=_0x793d[_0x3a4155];return _0x32bb99;};'use strict';var multer=require(_0xd793('0x0'));var util=require(_0xd793('0x1'));var path=require(_0xd793('0x2'));var timeout=require('connect-timeout');var express=require(_0xd793('0x3'));var router=express[_0xd793('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd793('0x5'));var interaction=require(_0xd793('0x6'));var config=require('../../config/environment');var controller=require(_0xd793('0x7'));router[_0xd793('0x8')]('/',controller[_0xd793('0x9')]);module[_0xd793('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 48ba79f..f082ccc 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 _0x4291=['sequelize','exports','STRING'];(function(_0x5b502b,_0x3c68fc){var _0x423d16=function(_0x312ae7){while(--_0x312ae7){_0x5b502b['push'](_0x5b502b['shift']());}};_0x423d16(++_0x3c68fc);}(_0x4291,0x66));var _0x1429=function(_0x3c65d8,_0x2ca73e){_0x3c65d8=_0x3c65d8-0x0;var _0x558687=_0x4291[_0x3c65d8];return _0x558687;};'use strict';var Sequelize=require(_0x1429('0x0'));module[_0x1429('0x1')]={'version':{'type':Sequelize[_0x1429('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x63a1=['exports','version','sequelize'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x63a1,0xf8));var _0x163a=function(_0x2bb040,_0xfde227){_0x2bb040=_0x2bb040-0x0;var _0x128691=_0x63a1[_0x2bb040];return _0x128691;};'use strict';var Sequelize=require(_0x163a('0x0'));module[_0x163a('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x163a('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index be1949d..43987d1 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 _0x912e=['index','Migration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x1122b0,_0x287aa0){var _0x510a16=function(_0x56ae18){while(--_0x56ae18){_0x1122b0['push'](_0x1122b0['shift']());}};_0x510a16(++_0x287aa0);}(_0x912e,0xe5));var _0xe912=function(_0x2a4f6b,_0x5c3d64){_0x2a4f6b=_0x2a4f6b-0x0;var _0x415f07=_0x912e[_0x2a4f6b];return _0x415f07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe912('0x0'));var jsonpatch=require(_0xe912('0x1'));var rp=require(_0xe912('0x2'));var moment=require(_0xe912('0x3'));var BPromise=require(_0xe912('0x4'));var Mustache=require(_0xe912('0x5'));var util=require(_0xe912('0x6'));var path=require(_0xe912('0x7'));var sox=require('sox');var csv=require(_0xe912('0x8'));var ejs=require(_0xe912('0x9'));var fs=require('fs');var fs_extra=require(_0xe912('0xa'));var _=require(_0xe912('0xb'));var squel=require(_0xe912('0xc'));var crypto=require(_0xe912('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe912('0xe'));var toCsv=require(_0xe912('0x8'));var querystring=require(_0xe912('0xf'));var Papa=require(_0xe912('0x10'));var Redis=require('ioredis');var authService=require(_0xe912('0x11'));var qs=require(_0xe912('0x12'));var as=require(_0xe912('0x13'));var hardwareService=require(_0xe912('0x14'));var logger=require(_0xe912('0x15'))(_0xe912('0x16'));var utils=require(_0xe912('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe912('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x571880,_0x484b0f){_0x484b0f=_0x484b0f||0xcc;return function(_0x4d5438){if(_0x4d5438){return _0x571880[_0xe912('0x19')](_0x484b0f);}return _0x571880[_0xe912('0x1a')](_0x484b0f)[_0xe912('0x1b')]();};}function respondWithResult(_0x2dff60,_0x596245){_0x596245=_0x596245||0xc8;return function(_0x185736){if(_0x185736){return _0x2dff60[_0xe912('0x1a')](_0x596245)['json'](_0x185736);}};}function respondWithFilteredResult(_0x35b381,_0x278d66){return function(_0x101764){if(_0x101764){var _0x50c365=typeof _0x278d66[_0xe912('0x1c')]===_0xe912('0x1d')&&typeof _0x278d66[_0xe912('0x1e')]===_0xe912('0x1d');var _0x242a58=_0x101764['count'];var _0x47272c=_0x50c365?0x0:_0x278d66['offset'];var _0x5c9aa1=_0x50c365?_0x101764['count']:_0x278d66[_0xe912('0x1c')]+_0x278d66[_0xe912('0x1e')];var _0x51b8d7;if(_0x5c9aa1>=_0x242a58){_0x5c9aa1=_0x242a58;_0x51b8d7=0xc8;}else{_0x51b8d7=0xce;}_0x35b381['status'](_0x51b8d7);return _0x35b381[_0xe912('0x1f')](_0xe912('0x20'),_0x47272c+'-'+_0x5c9aa1+'/'+_0x242a58)[_0xe912('0x21')](_0x101764);}return null;};}function patchUpdates(_0x40f95b){return function(_0x279e57){try{jsonpatch[_0xe912('0x22')](_0x279e57,_0x40f95b,!![]);}catch(_0x3805f0){return BPromise[_0xe912('0x23')](_0x3805f0);}return _0x279e57['save']();};}function saveUpdates(_0x428634,_0x4fa163){return function(_0x57ffc7){if(_0x57ffc7){return _0x57ffc7[_0xe912('0x24')](_0x428634)[_0xe912('0x25')](function(_0xa7c937){return _0xa7c937;});}return null;};}function removeEntity(_0x3769e3,_0x280e15){return function(_0x12b0a1){if(_0x12b0a1){return _0x12b0a1[_0xe912('0x26')]()['then'](function(){_0x3769e3[_0xe912('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3499aa,_0x25e944){return function(_0x1954f3){if(!_0x1954f3){_0x3499aa[_0xe912('0x19')](0x194);}return _0x1954f3;};}function handleError(_0x20f8a4,_0x3c47ee){_0x3c47ee=_0x3c47ee||0x1f4;return function(_0x4e6e49){logger[_0xe912('0x27')](_0x4e6e49[_0xe912('0x28')]);if(_0x4e6e49[_0xe912('0x29')]){delete _0x4e6e49[_0xe912('0x29')];}_0x20f8a4['status'](_0x3c47ee)[_0xe912('0x2a')](_0x4e6e49);};}exports[_0xe912('0x2b')]=function(_0x15ee73,_0x7d131a){var _0x539209={},_0x1d9264={},_0xc3b62={'count':0x0,'rows':[]};var _0x4a9c83=_['map'](db[_0xe912('0x2c')]['rawAttributes'],function(_0x311db3){return{'name':_0x311db3[_0xe912('0x2d')],'type':_0x311db3[_0xe912('0x2e')][_0xe912('0x2f')]};});_0x1d9264['model']=_['map'](_0x4a9c83,_0xe912('0x29'));_0x1d9264[_0xe912('0x30')]=_[_0xe912('0x31')](_0x15ee73['query']);_0x1d9264[_0xe912('0x32')]=_[_0xe912('0x33')](_0x1d9264[_0xe912('0x34')],_0x1d9264[_0xe912('0x30')]);_0x539209[_0xe912('0x35')]=_['intersection'](_0x1d9264[_0xe912('0x34')],qs[_0xe912('0x36')](_0x15ee73['query'][_0xe912('0x36')]));_0x539209[_0xe912('0x35')]=_0x539209[_0xe912('0x35')]['length']?_0x539209['attributes']:_0x1d9264[_0xe912('0x34')];if(!_0x15ee73['query'][_0xe912('0x37')](_0xe912('0x38'))){_0x539209[_0xe912('0x1e')]=qs[_0xe912('0x1e')](_0x15ee73[_0xe912('0x30')][_0xe912('0x1e')]);_0x539209[_0xe912('0x1c')]=qs[_0xe912('0x1c')](_0x15ee73[_0xe912('0x30')]['offset']);}_0x539209[_0xe912('0x39')]=qs[_0xe912('0x3a')](_0x15ee73[_0xe912('0x30')][_0xe912('0x3a')]);_0x539209['where']=qs[_0xe912('0x32')](_[_0xe912('0x3b')](_0x15ee73[_0xe912('0x30')],_0x1d9264[_0xe912('0x32')]),_0x4a9c83);if(_0x15ee73['query'][_0xe912('0x3c')]){_0x539209[_0xe912('0x3d')]=_[_0xe912('0x3e')](_0x539209['where'],{'$or':_['map'](_0x4a9c83,function(_0xf81a31){if(_0xf81a31[_0xe912('0x2e')]!==_0xe912('0x3f')){var _0x3c0f92={};_0x3c0f92[_0xf81a31['name']]={'$like':'%'+_0x15ee73['query'][_0xe912('0x3c')]+'%'};return _0x3c0f92;}})});}_0x539209=_['merge']({},_0x539209,_0x15ee73[_0xe912('0x40')]);var _0x53980d={'where':_0x539209[_0xe912('0x3d')]};return db[_0xe912('0x2c')]['count'](_0x53980d)['then'](function(_0x332cf7){_0xc3b62['count']=_0x332cf7;if(_0x15ee73[_0xe912('0x30')][_0xe912('0x41')]){_0x539209['include']=[{'all':!![]}];}return db[_0xe912('0x2c')]['findAll'](_0x539209);})[_0xe912('0x25')](function(_0x262a7c){_0xc3b62[_0xe912('0x42')]=_0x262a7c;return _0xc3b62;})['then'](respondWithFilteredResult(_0x7d131a,_0x539209))[_0xe912('0x43')](handleError(_0x7d131a,null));}; \ No newline at end of file +var _0xb5be=['sort','pick','merge','where','type','VIRTUAL','options','includeAll','include','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','Migration','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','nolimit'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xb5be,0x116));var _0xeb5b=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xb5be[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0xeb5b('0x0'));var rimraf=require(_0xeb5b('0x1'));var zipdir=require(_0xeb5b('0x2'));var jsonpatch=require(_0xeb5b('0x3'));var rp=require(_0xeb5b('0x4'));var moment=require(_0xeb5b('0x5'));var BPromise=require(_0xeb5b('0x6'));var Mustache=require(_0xeb5b('0x7'));var util=require(_0xeb5b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb5b('0x9'));var ejs=require(_0xeb5b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb5b('0xb'));var _=require(_0xeb5b('0xc'));var squel=require(_0xeb5b('0xd'));var crypto=require(_0xeb5b('0xe'));var jsforce=require(_0xeb5b('0xf'));var deskjs=require(_0xeb5b('0x10'));var toCsv=require(_0xeb5b('0x9'));var querystring=require(_0xeb5b('0x11'));var Papa=require(_0xeb5b('0x12'));var Redis=require(_0xeb5b('0x13'));var authService=require(_0xeb5b('0x14'));var qs=require(_0xeb5b('0x15'));var as=require(_0xeb5b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb5b('0x17'));var utils=require(_0xeb5b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeb5b('0x19'))['db'];function respondWithStatusCode(_0x38f17e,_0x23601d){_0x23601d=_0x23601d||0xcc;return function(_0x1a9554){if(_0x1a9554){return _0x38f17e[_0xeb5b('0x1a')](_0x23601d);}return _0x38f17e[_0xeb5b('0x1b')](_0x23601d)[_0xeb5b('0x1c')]();};}function respondWithResult(_0x245444,_0x5b1978){_0x5b1978=_0x5b1978||0xc8;return function(_0x50815f){if(_0x50815f){return _0x245444['status'](_0x5b1978)[_0xeb5b('0x1d')](_0x50815f);}};}function respondWithFilteredResult(_0xea7345,_0x44ffc5){return function(_0x5a2a8c){if(_0x5a2a8c){var _0x30dea4=typeof _0x44ffc5['offset']===_0xeb5b('0x1e')&&typeof _0x44ffc5['limit']===_0xeb5b('0x1e');var _0x54f48a=_0x5a2a8c[_0xeb5b('0x1f')];var _0x38c129=_0x30dea4?0x0:_0x44ffc5[_0xeb5b('0x20')];var _0x49050a=_0x30dea4?_0x5a2a8c[_0xeb5b('0x1f')]:_0x44ffc5['offset']+_0x44ffc5[_0xeb5b('0x21')];var _0x54722d;if(_0x49050a>=_0x54f48a){_0x49050a=_0x54f48a;_0x54722d=0xc8;}else{_0x54722d=0xce;}_0xea7345[_0xeb5b('0x1b')](_0x54722d);return _0xea7345['set'](_0xeb5b('0x22'),_0x38c129+'-'+_0x49050a+'/'+_0x54f48a)[_0xeb5b('0x1d')](_0x5a2a8c);}return null;};}function patchUpdates(_0x5c7bb4){return function(_0x25f5c7){try{jsonpatch[_0xeb5b('0x23')](_0x25f5c7,_0x5c7bb4,!![]);}catch(_0x8aa5c9){return BPromise[_0xeb5b('0x24')](_0x8aa5c9);}return _0x25f5c7[_0xeb5b('0x25')]();};}function saveUpdates(_0x35f633,_0x563b01){return function(_0x313b5e){if(_0x313b5e){return _0x313b5e[_0xeb5b('0x26')](_0x35f633)[_0xeb5b('0x27')](function(_0x167382){return _0x167382;});}return null;};}function removeEntity(_0xf023bc,_0x3a0cf3){return function(_0x7c3bf4){if(_0x7c3bf4){return _0x7c3bf4['destroy']()['then'](function(){_0xf023bc['status'](0xcc)[_0xeb5b('0x1c')]();});}};}function handleEntityNotFound(_0x4c52e6,_0x4e64ae){return function(_0x2f938e){if(!_0x2f938e){_0x4c52e6['sendStatus'](0x194);}return _0x2f938e;};}function handleError(_0x185616,_0x5e1b7d){_0x5e1b7d=_0x5e1b7d||0x1f4;return function(_0x53fc9b){logger[_0xeb5b('0x28')](_0x53fc9b['stack']);if(_0x53fc9b['name']){delete _0x53fc9b[_0xeb5b('0x29')];}_0x185616[_0xeb5b('0x1b')](_0x5e1b7d)[_0xeb5b('0x2a')](_0x53fc9b);};}exports[_0xeb5b('0x2b')]=function(_0x1c3621,_0x355d14){var _0xe408e7={},_0x9b04c1={},_0xfb8f8={'count':0x0,'rows':[]};var _0x5b82cb=_['map'](db[_0xeb5b('0x2c')][_0xeb5b('0x2d')],function(_0x1a6a9b){return{'name':_0x1a6a9b[_0xeb5b('0x2e')],'type':_0x1a6a9b['type'][_0xeb5b('0x2f')]};});_0x9b04c1[_0xeb5b('0x30')]=_[_0xeb5b('0x31')](_0x5b82cb,_0xeb5b('0x29'));_0x9b04c1[_0xeb5b('0x32')]=_['keys'](_0x1c3621['query']);_0x9b04c1[_0xeb5b('0x33')]=_[_0xeb5b('0x34')](_0x9b04c1[_0xeb5b('0x30')],_0x9b04c1[_0xeb5b('0x32')]);_0xe408e7[_0xeb5b('0x35')]=_['intersection'](_0x9b04c1['model'],qs[_0xeb5b('0x36')](_0x1c3621[_0xeb5b('0x32')][_0xeb5b('0x36')]));_0xe408e7['attributes']=_0xe408e7[_0xeb5b('0x35')][_0xeb5b('0x37')]?_0xe408e7[_0xeb5b('0x35')]:_0x9b04c1['model'];if(!_0x1c3621[_0xeb5b('0x32')]['hasOwnProperty'](_0xeb5b('0x38'))){_0xe408e7[_0xeb5b('0x21')]=qs['limit'](_0x1c3621[_0xeb5b('0x32')][_0xeb5b('0x21')]);_0xe408e7[_0xeb5b('0x20')]=qs['offset'](_0x1c3621[_0xeb5b('0x32')][_0xeb5b('0x20')]);}_0xe408e7['order']=qs[_0xeb5b('0x39')](_0x1c3621[_0xeb5b('0x32')]['sort']);_0xe408e7['where']=qs['filters'](_[_0xeb5b('0x3a')](_0x1c3621['query'],_0x9b04c1[_0xeb5b('0x33')]),_0x5b82cb);if(_0x1c3621[_0xeb5b('0x32')]['filter']){_0xe408e7['where']=_[_0xeb5b('0x3b')](_0xe408e7[_0xeb5b('0x3c')],{'$or':_[_0xeb5b('0x31')](_0x5b82cb,function(_0x5c2258){if(_0x5c2258[_0xeb5b('0x3d')]!==_0xeb5b('0x3e')){var _0x588a2a={};_0x588a2a[_0x5c2258['name']]={'$like':'%'+_0x1c3621[_0xeb5b('0x32')]['filter']+'%'};return _0x588a2a;}})});}_0xe408e7=_[_0xeb5b('0x3b')]({},_0xe408e7,_0x1c3621[_0xeb5b('0x3f')]);var _0x214506={'where':_0xe408e7[_0xeb5b('0x3c')]};return db['Migration'][_0xeb5b('0x1f')](_0x214506)[_0xeb5b('0x27')](function(_0x1c856d){_0xfb8f8[_0xeb5b('0x1f')]=_0x1c856d;if(_0x1c3621[_0xeb5b('0x32')][_0xeb5b('0x40')]){_0xe408e7[_0xeb5b('0x41')]=[{'all':!![]}];}return db['Migration']['findAll'](_0xe408e7);})['then'](function(_0x57ca92){_0xfb8f8['rows']=_0x57ca92;return _0xfb8f8;})[_0xeb5b('0x27')](respondWithFilteredResult(_0x355d14,_0xe408e7))[_0xeb5b('0x42')](handleError(_0x355d14,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 2e8094f..b478e5a 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 _0x2c12=['../../config/logger','api','bluebird','request-promise','rimraf','./migration.attributes','migrations','lodash','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2c12,0x154));var _0x22c1=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x2c12[_0x5c2e5e];return _0x46a5da;};'use strict';var _=require(_0x22c1('0x0'));var util=require(_0x22c1('0x1'));var logger=require(_0x22c1('0x2'))(_0x22c1('0x3'));var moment=require('moment');var BPromise=require(_0x22c1('0x4'));var rp=require(_0x22c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22c1('0x6'));var config=require('../../config/environment');var attributes=require(_0x22c1('0x7'));module['exports']=function(_0x93bb1f,_0x7bdb02){return _0x93bb1f['define']('Migration',attributes,{'tableName':_0x22c1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d64=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','lodash','../../config/logger'];(function(_0x3895d3,_0x2273d8){var _0x2610af=function(_0x1d6dfa){while(--_0x1d6dfa){_0x3895d3['push'](_0x3895d3['shift']());}};_0x2610af(++_0x2273d8);}(_0x9d64,0x13d));var _0x49d6=function(_0x1a0632,_0x5e9263){_0x1a0632=_0x1a0632-0x0;var _0x72a142=_0x9d64[_0x1a0632];return _0x72a142;};'use strict';var _=require(_0x49d6('0x0'));var util=require('util');var logger=require(_0x49d6('0x1'))('api');var moment=require('moment');var BPromise=require(_0x49d6('0x2'));var rp=require(_0x49d6('0x3'));var fs=require('fs');var path=require(_0x49d6('0x4'));var rimraf=require(_0x49d6('0x5'));var config=require(_0x49d6('0x6'));var attributes=require(_0x49d6('0x7'));module[_0x49d6('0x8')]=function(_0x499138,_0x50183b){return _0x499138[_0x49d6('0x9')]('Migration',attributes,{'tableName':_0x49d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 26c5950..e9a6f47 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 _0x9993=['error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1eec50,_0x5765da){var _0x15524c=function(_0x2d2502){while(--_0x2d2502){_0x1eec50['push'](_0x1eec50['shift']());}};_0x15524c(++_0x5765da);}(_0x9993,0x109));var _0x3999=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x9993[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x3999('0x0'));var util=require('util');var moment=require(_0x3999('0x1'));var BPromise=require(_0x3999('0x2'));var rs=require(_0x3999('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3999('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3999('0x5'))(_0x3999('0x6'));var config=require(_0x3999('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3999('0x8')][_0x3999('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x536de7,_0xc27316,_0x85b5af){return new BPromise(function(_0x4c1a49,_0x77282){return client[_0x3999('0xa')](_0x536de7,_0x85b5af)['then'](function(_0x3dd61){logger['info'](_0x3999('0xb'),_0xc27316,_0x3999('0xc'));logger['debug'](_0x3999('0xd'),_0xc27316,_0x3999('0xc'),JSON[_0x3999('0xe')](_0x3dd61));if(_0x3dd61[_0x3999('0xf')]){if(_0x3dd61[_0x3999('0xf')][_0x3999('0x10')]===0x1f4){logger[_0x3999('0xf')]('Migration,\x20%s,\x20%s',_0xc27316,_0x3dd61[_0x3999('0xf')][_0x3999('0x11')]);return _0x77282(_0x3dd61['error'][_0x3999('0x11')]);}logger[_0x3999('0xf')](_0x3999('0xb'),_0xc27316,_0x3dd61[_0x3999('0xf')]['message']);return _0x4c1a49(_0x3dd61[_0x3999('0xf')]['message']);}else{logger[_0x3999('0x12')]('Migration,\x20%s,\x20%s',_0xc27316,_0x3999('0xc'));_0x4c1a49(_0x3dd61['result'][_0x3999('0x11')]);}})[_0x3999('0x13')](function(_0x27a62b){logger[_0x3999('0xf')]('Migration,\x20%s,\x20%s',_0xc27316,_0x27a62b);_0x77282(_0x27a62b);});});} \ No newline at end of file +var _0x8ec7=['error','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x8ec7[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x78ec('0x0'));var util=require(_0x78ec('0x1'));var moment=require('moment');var BPromise=require(_0x78ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78ec('0x3'))['db'];var utils=require(_0x78ec('0x4'));var logger=require('../../config/logger')(_0x78ec('0x5'));var config=require(_0x78ec('0x6'));var jayson=require(_0x78ec('0x7'));var client=jayson[_0x78ec('0x8')][_0x78ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d2780,_0x21e3f7,_0x4ca55e){return new BPromise(function(_0x372108,_0x268c50){return client[_0x78ec('0xa')](_0x5d2780,_0x4ca55e)['then'](function(_0x367c80){logger[_0x78ec('0xb')](_0x78ec('0xc'),_0x21e3f7,_0x78ec('0xd'));logger[_0x78ec('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x21e3f7,'request\x20sent',JSON[_0x78ec('0xf')](_0x367c80));if(_0x367c80[_0x78ec('0x10')]){if(_0x367c80[_0x78ec('0x10')]['code']===0x1f4){logger[_0x78ec('0x10')](_0x78ec('0xc'),_0x21e3f7,_0x367c80[_0x78ec('0x10')][_0x78ec('0x11')]);return _0x268c50(_0x367c80[_0x78ec('0x10')][_0x78ec('0x11')]);}logger[_0x78ec('0x10')](_0x78ec('0xc'),_0x21e3f7,_0x367c80[_0x78ec('0x10')][_0x78ec('0x11')]);return _0x372108(_0x367c80[_0x78ec('0x10')]['message']);}else{logger[_0x78ec('0xb')](_0x78ec('0xc'),_0x21e3f7,_0x78ec('0xd'));_0x372108(_0x367c80[_0x78ec('0x12')][_0x78ec('0x11')]);}})['catch'](function(_0x4f9ffd){logger['error']('Migration,\x20%s,\x20%s',_0x21e3f7,_0x4f9ffd);_0x268c50(_0x4f9ffd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 15a2094..011c596 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 _0x3024=['connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0xdc8acf,_0x3a7b6f){var _0x166811=function(_0x3c2773){while(--_0x3c2773){_0xdc8acf['push'](_0xdc8acf['shift']());}};_0x166811(++_0x3a7b6f);}(_0x3024,0x64));var _0x4302=function(_0x54d636,_0x4d6117){_0x54d636=_0x54d636-0x0;var _0xe13e25=_0x3024[_0x54d636];return _0xe13e25;};'use strict';var multer=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var path=require('path');var timeout=require(_0x4302('0x2'));var express=require(_0x4302('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4302('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4302('0x5'));var controller=require(_0x4302('0x6'));router['get']('/',auth[_0x4302('0x7')](),controller[_0x4302('0x8')]);router['get'](_0x4302('0x9'),auth[_0x4302('0x7')](),controller[_0x4302('0xa')]);router[_0x4302('0xb')]('/',auth[_0x4302('0x7')](),controller[_0x4302('0xc')]);router[_0x4302('0xd')]('/:id',auth[_0x4302('0x7')](),controller[_0x4302('0xe')]);router[_0x4302('0xf')]('/:id',auth[_0x4302('0x7')](),controller[_0x4302('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8be3=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','create','put','update'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x8be3,0xd1));var _0x38be=function(_0x4d9d1a,_0xf2b6ce){_0x4d9d1a=_0x4d9d1a-0x0;var _0x116fa3=_0x8be3[_0x4d9d1a];return _0x116fa3;};'use strict';var multer=require('multer');var util=require(_0x38be('0x0'));var path=require(_0x38be('0x1'));var timeout=require(_0x38be('0x2'));var express=require('express');var router=express[_0x38be('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x38be('0x4'));var interaction=require(_0x38be('0x5'));var config=require(_0x38be('0x6'));var controller=require(_0x38be('0x7'));router[_0x38be('0x8')]('/',auth['isAuthenticated'](),controller[_0x38be('0x9')]);router[_0x38be('0x8')](_0x38be('0xa'),auth[_0x38be('0xb')](),controller['show']);router['post']('/',auth[_0x38be('0xb')](),controller[_0x38be('0xc')]);router[_0x38be('0xd')](_0x38be('0xa'),auth[_0x38be('0xb')](),controller[_0x38be('0xe')]);router['delete'](_0x38be('0xa'),auth[_0x38be('0xb')](),controller['destroy']);module[_0x38be('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 309eb3c..c8777fa 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 _0x9bcd=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0xfc1c93,_0x37823b){var _0x5333a3=function(_0x521e2a){while(--_0x521e2a){_0xfc1c93['push'](_0xfc1c93['shift']());}};_0x5333a3(++_0x37823b);}(_0x9bcd,0x64));var _0xd9bc=function(_0x175879,_0x41db8d){_0x175879=_0x175879-0x0;var _0x3cff9b=_0x9bcd[_0x175879];return _0x3cff9b;};'use strict';var Sequelize=require(_0xd9bc('0x0'));module[_0xd9bc('0x1')]={'type':{'type':Sequelize[_0xd9bc('0x2')](_0xd9bc('0x3'),_0xd9bc('0x4'),_0xd9bc('0x5'),_0xd9bc('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd9bc('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5d3d=['externip','stun','turn','STRING','sequelize','exports'];(function(_0x43464b,_0x2d3f14){var _0x4de9b8=function(_0x3e8e50){while(--_0x3e8e50){_0x43464b['push'](_0x43464b['shift']());}};_0x4de9b8(++_0x2d3f14);}(_0x5d3d,0x1c0));var _0xd5d3=function(_0x5ee410,_0x2a6a05){_0x5ee410=_0x5ee410-0x0;var _0x26f01c=_0x5d3d[_0x5ee410];return _0x26f01c;};'use strict';var Sequelize=require(_0xd5d3('0x0'));module[_0xd5d3('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0xd5d3('0x2'),_0xd5d3('0x3'),_0xd5d3('0x4'))},'value':{'type':Sequelize[_0xd5d3('0x5')]},'username':{'type':Sequelize[_0xd5d3('0x5')]},'password':{'type':Sequelize[_0xd5d3('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 18bd2b7..e1b70a6 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 _0xb0fa=['rows','catch','show','keys','include','find','create','body','toUpperCase','STUN','readFileSync','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','util','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','filter','includeAll','findAll'];(function(_0x1b5d52,_0xdf15d){var _0x2fe398=function(_0x27a8d2){while(--_0x27a8d2){_0x1b5d52['push'](_0x1b5d52['shift']());}};_0x2fe398(++_0xdf15d);}(_0xb0fa,0x1c6));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xab0f('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xab0f('0x1'));var qs=require(_0xab0f('0x2'));var logger=require(_0xab0f('0x3'))(_0xab0f('0x4'));var config=require(_0xab0f('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xab0f('0x6'));var client=jayson[_0xab0f('0x7')][_0xab0f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f738f,_0x470a7d,_0x3400ac,_0x338f99){return new Promise(function(_0x1427de,_0x529f8b){var _0xdaa14c=_0x338f99||client;return _0xdaa14c['request'](_0x3f738f,_0x3400ac)[_0xab0f('0x9')](function(_0x3207d5){logger[_0xab0f('0xa')]('Network,\x20%s,\x20%s',_0x470a7d,_0xab0f('0xb'));logger[_0xab0f('0xc')](_0xab0f('0xd'),_0x470a7d,'request\x20sent',JSON[_0xab0f('0xe')](_0x3207d5));if(_0x3207d5[_0xab0f('0xf')]){if(_0x3207d5[_0xab0f('0xf')][_0xab0f('0x10')]===0x1f4){logger[_0xab0f('0xf')](_0xab0f('0x11'),_0x470a7d,_0x3207d5[_0xab0f('0xf')][_0xab0f('0x12')]);return _0x529f8b(_0x3207d5[_0xab0f('0xf')][_0xab0f('0x12')]);}logger[_0xab0f('0xf')](_0xab0f('0x11'),_0x470a7d,_0x3207d5['error'][_0xab0f('0x12')]);return _0x1427de(_0x3207d5['error'][_0xab0f('0x12')]);}else{logger[_0xab0f('0xa')](_0xab0f('0x11'),_0x470a7d,_0xab0f('0xb'));_0x1427de(_0x3207d5['result'][_0xab0f('0x12')]);}})['catch'](function(_0xb7e42e){logger[_0xab0f('0xf')](_0xab0f('0x11'),_0x470a7d,_0xb7e42e);_0x529f8b(_0xb7e42e);});});}function respondWithResult(_0x4c5eb9,_0x39323c){_0x39323c=_0x39323c||0xc8;return function(_0x3f1061){if(_0x3f1061){return _0x4c5eb9[_0xab0f('0x13')](_0x39323c)['json'](_0x3f1061);}};}function respondWithFilteredResult(_0x5ebcd1,_0x4f5528){return function(_0x6be2f3){if(_0x6be2f3){var _0x16fe67=typeof _0x4f5528[_0xab0f('0x14')]===_0xab0f('0x15')&&typeof _0x4f5528['limit']===_0xab0f('0x15');var _0x550b67=_0x6be2f3['count'];var _0x3a70cd=_0x16fe67?0x0:_0x4f5528[_0xab0f('0x14')];var _0x20bb20=_0x16fe67?_0x6be2f3[_0xab0f('0x16')]:_0x4f5528[_0xab0f('0x14')]+_0x4f5528[_0xab0f('0x17')];var _0x134bf3;if(_0x20bb20>=_0x550b67){_0x20bb20=_0x550b67;_0x134bf3=0xc8;}else{_0x134bf3=0xce;}_0x5ebcd1[_0xab0f('0x13')](_0x134bf3);return _0x5ebcd1[_0xab0f('0x18')](_0xab0f('0x19'),_0x3a70cd+'-'+_0x20bb20+'/'+_0x550b67)[_0xab0f('0x1a')](_0x6be2f3);}return null;};}function saveUpdates(_0x9fc775){return function(_0xe8ab24){if(_0xe8ab24){return _0xe8ab24[_0xab0f('0x1b')](_0x9fc775)['then'](function(_0x2b5deb){return _0x2b5deb;});}return null;};}function removeEntity(_0x1bf119){return function(_0x21c81f){if(_0x21c81f){return _0x21c81f[_0xab0f('0x1c')]()[_0xab0f('0x9')](function(){_0x1bf119['status'](0xcc)[_0xab0f('0x1d')]();});}};}function handleEntityNotFound(_0x1ec967){return function(_0xb54dc3){if(!_0xb54dc3){_0x1ec967[_0xab0f('0x1e')](0x194);}return _0xb54dc3;};}function handleError(_0x17dfe0,_0x4875f2){_0x4875f2=_0x4875f2||0x1f4;return function(_0x36024e){logger['error'](_0x36024e[_0xab0f('0x1f')]);if(_0x36024e['name']){delete _0x36024e[_0xab0f('0x20')];}_0x17dfe0[_0xab0f('0x13')](_0x4875f2)[_0xab0f('0x21')](_0x36024e);};}exports[_0xab0f('0x22')]=function(_0x526b6c,_0x454186){var _0x1f1870={},_0x5d4891={},_0x124304={'count':0x0,'rows':[]};var _0x5c7db7=_[_0xab0f('0x23')](db[_0xab0f('0x24')][_0xab0f('0x25')],function(_0x510f24){return{'name':_0x510f24[_0xab0f('0x26')],'type':_0x510f24['type'][_0xab0f('0x27')]};});_0x5d4891[_0xab0f('0x28')]=_[_0xab0f('0x23')](_0x5c7db7,'name');_0x5d4891[_0xab0f('0x29')]=_['keys'](_0x526b6c[_0xab0f('0x29')]);_0x5d4891[_0xab0f('0x2a')]=_[_0xab0f('0x2b')](_0x5d4891[_0xab0f('0x28')],_0x5d4891[_0xab0f('0x29')]);_0x1f1870[_0xab0f('0x2c')]=_['intersection'](_0x5d4891[_0xab0f('0x28')],qs[_0xab0f('0x2d')](_0x526b6c[_0xab0f('0x29')][_0xab0f('0x2d')]));_0x1f1870[_0xab0f('0x2c')]=_0x1f1870[_0xab0f('0x2c')][_0xab0f('0x2e')]?_0x1f1870[_0xab0f('0x2c')]:_0x5d4891[_0xab0f('0x28')];if(!_0x526b6c[_0xab0f('0x29')]['hasOwnProperty'](_0xab0f('0x2f'))){_0x1f1870[_0xab0f('0x17')]=qs[_0xab0f('0x17')](_0x526b6c[_0xab0f('0x29')][_0xab0f('0x17')]);_0x1f1870[_0xab0f('0x14')]=qs[_0xab0f('0x14')](_0x526b6c[_0xab0f('0x29')][_0xab0f('0x14')]);}_0x1f1870[_0xab0f('0x30')]=qs[_0xab0f('0x31')](_0x526b6c[_0xab0f('0x29')][_0xab0f('0x31')]);_0x1f1870['where']=qs[_0xab0f('0x2a')](_['pick'](_0x526b6c[_0xab0f('0x29')],_0x5d4891[_0xab0f('0x2a')]),_0x5c7db7);if(_0x526b6c[_0xab0f('0x29')]['filter']){_0x1f1870[_0xab0f('0x32')]=_[_0xab0f('0x33')](_0x1f1870[_0xab0f('0x32')],{'$or':_[_0xab0f('0x23')](_0x5c7db7,function(_0x3d9db0){if(_0x3d9db0[_0xab0f('0x34')]!=='VIRTUAL'){var _0x39b0e2={};_0x39b0e2[_0x3d9db0['name']]={'$like':'%'+_0x526b6c[_0xab0f('0x29')][_0xab0f('0x35')]+'%'};return _0x39b0e2;}})});}_0x1f1870=_[_0xab0f('0x33')]({},_0x1f1870,_0x526b6c['options']);var _0xca28de={'where':_0x1f1870['where']};return db[_0xab0f('0x24')][_0xab0f('0x16')](_0xca28de)[_0xab0f('0x9')](function(_0x599660){_0x124304[_0xab0f('0x16')]=_0x599660;if(_0x526b6c[_0xab0f('0x29')][_0xab0f('0x36')]){_0x1f1870['include']=[{'all':!![]}];}return db['Network'][_0xab0f('0x37')](_0x1f1870);})[_0xab0f('0x9')](function(_0x43ce65){_0x124304[_0xab0f('0x38')]=_0x43ce65;return _0x124304;})[_0xab0f('0x9')](respondWithFilteredResult(_0x454186,_0x1f1870))[_0xab0f('0x39')](handleError(_0x454186,null));};exports[_0xab0f('0x3a')]=function(_0x55b49d,_0x4103fd){var _0x583c55={'raw':!![],'where':{'id':_0x55b49d['params']['id']}},_0x8bb779={};_0x8bb779['model']=_[_0xab0f('0x3b')](db[_0xab0f('0x24')][_0xab0f('0x25')]);_0x8bb779['query']=_[_0xab0f('0x3b')](_0x55b49d[_0xab0f('0x29')]);_0x8bb779[_0xab0f('0x2a')]=_[_0xab0f('0x2b')](_0x8bb779[_0xab0f('0x28')],_0x8bb779[_0xab0f('0x29')]);_0x583c55['attributes']=_[_0xab0f('0x2b')](_0x8bb779[_0xab0f('0x28')],qs[_0xab0f('0x2d')](_0x55b49d[_0xab0f('0x29')][_0xab0f('0x2d')]));_0x583c55[_0xab0f('0x2c')]=_0x583c55[_0xab0f('0x2c')][_0xab0f('0x2e')]?_0x583c55[_0xab0f('0x2c')]:_0x8bb779['model'];if(_0x55b49d[_0xab0f('0x29')][_0xab0f('0x36')]){_0x583c55[_0xab0f('0x3c')]=[{'all':!![]}];}_0x583c55=_[_0xab0f('0x33')]({},_0x583c55,_0x55b49d['options']);return db['Network'][_0xab0f('0x3d')](_0x583c55)[_0xab0f('0x9')](handleEntityNotFound(_0x4103fd,null))[_0xab0f('0x9')](respondWithResult(_0x4103fd,null))[_0xab0f('0x39')](handleError(_0x4103fd,null));};exports[_0xab0f('0x3e')]=function(_0x500080,_0x1a83c6){var _0x5e6c68;return db['Network'][_0xab0f('0x3e')](_0x500080[_0xab0f('0x3f')],{'raw':!![]})['then'](function(_0xa1172){_0x5e6c68=_0xa1172;return db[_0xab0f('0x24')][_0xab0f('0x37')]({'where':{'type':_0x500080['body'][_0xab0f('0x34')]},'raw':!![]});})['then'](function(_0x8d33dd){if(_0x5e6c68['type'][_0xab0f('0x40')]()==_0xab0f('0x41')){var _0x3d1d7e=fs[_0xab0f('0x42')](path['join'](config[_0xab0f('0x43')],'server/files/templates/stun_multiple.ejs'),_0xab0f('0x44'));var _0x5cf474=ejs[_0xab0f('0x45')](_0x3d1d7e,{'networks':_0x8d33dd||[]});fs[_0xab0f('0x46')](_0xab0f('0x47'),_0x5cf474);return respondWithRpcPromise(_0xab0f('0x48'),'create',{'module':_0xab0f('0x49')});}else if(_0x5e6c68[_0xab0f('0x34')]['toUpperCase']()==_0xab0f('0x4a')){var _0x428a45=fs[_0xab0f('0x42')](path[_0xab0f('0x4b')](config[_0xab0f('0x43')],'server/files/templates/turn_multiple.ejs'),_0xab0f('0x44'));var _0x216401=ejs['render'](_0x428a45,{'networks':_0x8d33dd||[]});fs[_0xab0f('0x46')]('/etc/asterisk/turn_xcally.conf',_0x216401);return respondWithRpcPromise(_0xab0f('0x48'),'create',{'module':_0xab0f('0x49')});}else{var _0x5d38a4=fs['readFileSync'](path[_0xab0f('0x4b')](config[_0xab0f('0x43')],'server/files/templates/network.ejs'),'utf8');var _0x5c90a1=ejs['render'](_0x5d38a4,{'networks':_0x8d33dd||[]});fs[_0xab0f('0x46')](util['format'](_0xab0f('0x4c'),_0x500080[_0xab0f('0x3f')][_0xab0f('0x34')][_0xab0f('0x4d')]()),_0x5c90a1);return respondWithRpcPromise(_0xab0f('0x48'),_0xab0f('0x3e'),{'module':_0xab0f('0x4e')});}})[_0xab0f('0x9')](function(){return _0x5e6c68;})['then'](respondWithResult(_0x1a83c6,0xc9))[_0xab0f('0x39')](handleError(_0x1a83c6,null));};exports['update']=function(_0x8a077a,_0x108021){var _0x382503;return db[_0xab0f('0x24')][_0xab0f('0x3d')]({'where':{'id':_0x8a077a[_0xab0f('0x4f')]['id']}})[_0xab0f('0x9')](handleEntityNotFound(_0x108021,null))[_0xab0f('0x9')](saveUpdates(_0x8a077a[_0xab0f('0x3f')],null))['then'](function(_0x174243){if(_0x174243){_0x382503=_0x174243;return db[_0xab0f('0x24')][_0xab0f('0x37')]({'where':{'type':_0x382503[_0xab0f('0x34')]},'raw':!![]});}return null;})[_0xab0f('0x9')](function(_0x16df80){if(_0x382503[_0xab0f('0x34')][_0xab0f('0x40')]()==_0xab0f('0x41')){var _0x270fe2=fs[_0xab0f('0x42')](path['join'](config[_0xab0f('0x43')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x3687c1=ejs[_0xab0f('0x45')](_0x270fe2,{'networks':_0x16df80||[]});fs[_0xab0f('0x46')]('/etc/asterisk/stun_xcally.conf',_0x3687c1);return respondWithRpcPromise('Reload',_0xab0f('0x1b'),{'module':_0xab0f('0x49')});}else if(_0x382503[_0xab0f('0x34')]['toUpperCase']()==_0xab0f('0x4a')){var _0x4a01e3=fs[_0xab0f('0x42')](path[_0xab0f('0x4b')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x25ed03=ejs[_0xab0f('0x45')](_0x4a01e3,{'networks':_0x16df80||[]});fs[_0xab0f('0x46')](_0xab0f('0x50'),_0x25ed03);return respondWithRpcPromise('Reload',_0xab0f('0x1b'),{'module':_0xab0f('0x49')});}else{var _0xf025ce=fs[_0xab0f('0x42')](path[_0xab0f('0x4b')](config[_0xab0f('0x43')],_0xab0f('0x51')),_0xab0f('0x44'));var _0xb77263=ejs[_0xab0f('0x45')](_0xf025ce,{'networks':_0x16df80||[]});fs[_0xab0f('0x46')](util[_0xab0f('0x52')](_0xab0f('0x4c'),_0x8a077a[_0xab0f('0x3f')][_0xab0f('0x34')][_0xab0f('0x4d')]()),_0xb77263);return respondWithRpcPromise(_0xab0f('0x48'),'update',{'module':_0xab0f('0x4e')});}})[_0xab0f('0x9')](function(_0xb3db39){if(_0xb3db39){return _0x382503;}return null;})[_0xab0f('0x9')](respondWithResult(_0x108021,null))[_0xab0f('0x39')](handleError(_0x108021,null));};exports[_0xab0f('0x1c')]=function(_0x1ba435,_0x349a73){var _0x21e9e8;return db[_0xab0f('0x24')][_0xab0f('0x3d')]({'where':{'id':_0x1ba435[_0xab0f('0x4f')]['id']}})[_0xab0f('0x9')](function(_0x5b67cb){_0x21e9e8=_0x5b67cb;return _0x5b67cb;})[_0xab0f('0x9')](handleEntityNotFound(_0x349a73,null))[_0xab0f('0x9')](removeEntity(_0x349a73,null))[_0xab0f('0x9')](function(){if(_0x21e9e8){return db[_0xab0f('0x24')][_0xab0f('0x37')]({'where':{'type':_0x21e9e8[_0xab0f('0x34')]},'raw':!![]});}})['then'](function(_0x2f07c9){if(_0x21e9e8['type']['toUpperCase']()=='STUN'){var _0x332d5e=fs[_0xab0f('0x42')](path[_0xab0f('0x4b')](config['root'],_0xab0f('0x53')),_0xab0f('0x44'));var _0x4a875b=ejs[_0xab0f('0x45')](_0x332d5e,{'networks':_0x2f07c9||[]});fs[_0xab0f('0x46')](_0xab0f('0x47'),_0x4a875b);return respondWithRpcPromise(_0xab0f('0x48'),_0xab0f('0x1c'),{'module':'res_stun_monitor.so'});}else if(_0x21e9e8[_0xab0f('0x34')]['toUpperCase']()==_0xab0f('0x4a')){var _0x31bc5a=fs[_0xab0f('0x42')](path[_0xab0f('0x4b')](config[_0xab0f('0x43')],_0xab0f('0x54')),_0xab0f('0x44'));var _0x6c550b=ejs[_0xab0f('0x45')](_0x31bc5a,{'networks':_0x2f07c9||[]});fs[_0xab0f('0x46')](_0xab0f('0x50'),_0x6c550b);return respondWithRpcPromise('Reload',_0xab0f('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x4b369c=fs[_0xab0f('0x42')](path[_0xab0f('0x4b')](config['root'],_0xab0f('0x51')),_0xab0f('0x44'));var _0x892a5b=ejs[_0xab0f('0x45')](_0x4b369c,{'networks':_0x2f07c9||[]});fs[_0xab0f('0x46')](util[_0xab0f('0x52')](_0xab0f('0x4c'),_0x21e9e8[_0xab0f('0x34')][_0xab0f('0x4d')]()),_0x892a5b);return respondWithRpcPromise(_0xab0f('0x48'),_0xab0f('0x1c'),{'module':_0xab0f('0x4e')});}})[_0xab0f('0x39')](handleError(_0x349a73,null));}; \ No newline at end of file +var _0x0d59=['type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','toUpperCase','root','server/files/templates/stun_multiple.ejs','utf8','Reload','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','readFileSync','server/files/templates/network.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','TURN','format','STUN','path','lodash','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','update','destroy','end','sendStatus','stack','name','send','map','Network','rawAttributes','fieldName'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0d59,0xdc));var _0x90d5=function(_0x53a7af,_0x1408a5){_0x53a7af=_0x53a7af-0x0;var _0x3cc7f6=_0x0d59[_0x53a7af];return _0x3cc7f6;};'use strict';var util=require('util');var path=require(_0x90d5('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x90d5('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x90d5('0x2'))(_0x90d5('0x3'));var config=require(_0x90d5('0x4'));var db=require(_0x90d5('0x5'))['db'];var jayson=require(_0x90d5('0x6'));var client=jayson['client'][_0x90d5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x25e925,_0x4b39b4,_0xaf8ee2,_0x495375){return new Promise(function(_0x1ba8fb,_0x9eed81){var _0x13e2c3=_0x495375||client;return _0x13e2c3[_0x90d5('0x8')](_0x25e925,_0xaf8ee2)[_0x90d5('0x9')](function(_0x26c563){logger[_0x90d5('0xa')]('Network,\x20%s,\x20%s',_0x4b39b4,_0x90d5('0xb'));logger['debug'](_0x90d5('0xc'),_0x4b39b4,'request\x20sent',JSON[_0x90d5('0xd')](_0x26c563));if(_0x26c563[_0x90d5('0xe')]){if(_0x26c563[_0x90d5('0xe')][_0x90d5('0xf')]===0x1f4){logger[_0x90d5('0xe')](_0x90d5('0x10'),_0x4b39b4,_0x26c563[_0x90d5('0xe')][_0x90d5('0x11')]);return _0x9eed81(_0x26c563[_0x90d5('0xe')][_0x90d5('0x11')]);}logger[_0x90d5('0xe')]('Network,\x20%s,\x20%s',_0x4b39b4,_0x26c563[_0x90d5('0xe')][_0x90d5('0x11')]);return _0x1ba8fb(_0x26c563[_0x90d5('0xe')][_0x90d5('0x11')]);}else{logger[_0x90d5('0xa')](_0x90d5('0x10'),_0x4b39b4,_0x90d5('0xb'));_0x1ba8fb(_0x26c563[_0x90d5('0x12')][_0x90d5('0x11')]);}})[_0x90d5('0x13')](function(_0x200827){logger[_0x90d5('0xe')](_0x90d5('0x10'),_0x4b39b4,_0x200827);_0x9eed81(_0x200827);});});}function respondWithResult(_0x1107d9,_0x274b21){_0x274b21=_0x274b21||0xc8;return function(_0x16e243){if(_0x16e243){return _0x1107d9[_0x90d5('0x14')](_0x274b21)[_0x90d5('0x15')](_0x16e243);}};}function respondWithFilteredResult(_0x5c2ce8,_0xf49a8d){return function(_0x5e0bf5){if(_0x5e0bf5){var _0x1c1717=typeof _0xf49a8d[_0x90d5('0x16')]===_0x90d5('0x17')&&typeof _0xf49a8d[_0x90d5('0x18')]===_0x90d5('0x17');var _0x3cf42e=_0x5e0bf5[_0x90d5('0x19')];var _0x21097f=_0x1c1717?0x0:_0xf49a8d[_0x90d5('0x16')];var _0xdf0483=_0x1c1717?_0x5e0bf5[_0x90d5('0x19')]:_0xf49a8d[_0x90d5('0x16')]+_0xf49a8d[_0x90d5('0x18')];var _0x1eec8f;if(_0xdf0483>=_0x3cf42e){_0xdf0483=_0x3cf42e;_0x1eec8f=0xc8;}else{_0x1eec8f=0xce;}_0x5c2ce8[_0x90d5('0x14')](_0x1eec8f);return _0x5c2ce8[_0x90d5('0x1a')]('Content-Range',_0x21097f+'-'+_0xdf0483+'/'+_0x3cf42e)[_0x90d5('0x15')](_0x5e0bf5);}return null;};}function saveUpdates(_0x47ddae){return function(_0x5b8123){if(_0x5b8123){return _0x5b8123[_0x90d5('0x1b')](_0x47ddae)[_0x90d5('0x9')](function(_0x676b46){return _0x676b46;});}return null;};}function removeEntity(_0x556e16){return function(_0x3c1599){if(_0x3c1599){return _0x3c1599[_0x90d5('0x1c')]()[_0x90d5('0x9')](function(){_0x556e16[_0x90d5('0x14')](0xcc)[_0x90d5('0x1d')]();});}};}function handleEntityNotFound(_0x29f08a){return function(_0x4ab6fc){if(!_0x4ab6fc){_0x29f08a[_0x90d5('0x1e')](0x194);}return _0x4ab6fc;};}function handleError(_0x486dca,_0x5214eb){_0x5214eb=_0x5214eb||0x1f4;return function(_0x27c22a){logger[_0x90d5('0xe')](_0x27c22a[_0x90d5('0x1f')]);if(_0x27c22a[_0x90d5('0x20')]){delete _0x27c22a[_0x90d5('0x20')];}_0x486dca[_0x90d5('0x14')](_0x5214eb)[_0x90d5('0x21')](_0x27c22a);};}exports['index']=function(_0x13ca13,_0x3c2432){var _0x29d8b1={},_0x4bad02={},_0x169dd3={'count':0x0,'rows':[]};var _0x5e05a7=_[_0x90d5('0x22')](db[_0x90d5('0x23')][_0x90d5('0x24')],function(_0x181d4c){return{'name':_0x181d4c[_0x90d5('0x25')],'type':_0x181d4c[_0x90d5('0x26')]['key']};});_0x4bad02[_0x90d5('0x27')]=_[_0x90d5('0x22')](_0x5e05a7,_0x90d5('0x20'));_0x4bad02['query']=_[_0x90d5('0x28')](_0x13ca13[_0x90d5('0x29')]);_0x4bad02[_0x90d5('0x2a')]=_[_0x90d5('0x2b')](_0x4bad02[_0x90d5('0x27')],_0x4bad02[_0x90d5('0x29')]);_0x29d8b1['attributes']=_['intersection'](_0x4bad02[_0x90d5('0x27')],qs[_0x90d5('0x2c')](_0x13ca13[_0x90d5('0x29')][_0x90d5('0x2c')]));_0x29d8b1[_0x90d5('0x2d')]=_0x29d8b1['attributes'][_0x90d5('0x2e')]?_0x29d8b1[_0x90d5('0x2d')]:_0x4bad02[_0x90d5('0x27')];if(!_0x13ca13['query'][_0x90d5('0x2f')](_0x90d5('0x30'))){_0x29d8b1[_0x90d5('0x18')]=qs[_0x90d5('0x18')](_0x13ca13[_0x90d5('0x29')][_0x90d5('0x18')]);_0x29d8b1[_0x90d5('0x16')]=qs['offset'](_0x13ca13[_0x90d5('0x29')][_0x90d5('0x16')]);}_0x29d8b1[_0x90d5('0x31')]=qs['sort'](_0x13ca13[_0x90d5('0x29')][_0x90d5('0x32')]);_0x29d8b1[_0x90d5('0x33')]=qs[_0x90d5('0x2a')](_[_0x90d5('0x34')](_0x13ca13['query'],_0x4bad02[_0x90d5('0x2a')]),_0x5e05a7);if(_0x13ca13['query']['filter']){_0x29d8b1[_0x90d5('0x33')]=_[_0x90d5('0x35')](_0x29d8b1['where'],{'$or':_[_0x90d5('0x22')](_0x5e05a7,function(_0x218102){if(_0x218102[_0x90d5('0x26')]!==_0x90d5('0x36')){var _0x3c91bc={};_0x3c91bc[_0x218102[_0x90d5('0x20')]]={'$like':'%'+_0x13ca13[_0x90d5('0x29')][_0x90d5('0x37')]+'%'};return _0x3c91bc;}})});}_0x29d8b1=_['merge']({},_0x29d8b1,_0x13ca13[_0x90d5('0x38')]);var _0x2163be={'where':_0x29d8b1['where']};return db[_0x90d5('0x23')][_0x90d5('0x19')](_0x2163be)[_0x90d5('0x9')](function(_0x4e2774){_0x169dd3[_0x90d5('0x19')]=_0x4e2774;if(_0x13ca13[_0x90d5('0x29')][_0x90d5('0x39')]){_0x29d8b1[_0x90d5('0x3a')]=[{'all':!![]}];}return db[_0x90d5('0x23')][_0x90d5('0x3b')](_0x29d8b1);})[_0x90d5('0x9')](function(_0x58aa8a){_0x169dd3[_0x90d5('0x3c')]=_0x58aa8a;return _0x169dd3;})[_0x90d5('0x9')](respondWithFilteredResult(_0x3c2432,_0x29d8b1))[_0x90d5('0x13')](handleError(_0x3c2432,null));};exports[_0x90d5('0x3d')]=function(_0x474175,_0x2dc318){var _0x540ce6={'raw':!![],'where':{'id':_0x474175[_0x90d5('0x3e')]['id']}},_0x3be2a9={};_0x3be2a9['model']=_[_0x90d5('0x28')](db['Network'][_0x90d5('0x24')]);_0x3be2a9[_0x90d5('0x29')]=_['keys'](_0x474175[_0x90d5('0x29')]);_0x3be2a9[_0x90d5('0x2a')]=_[_0x90d5('0x2b')](_0x3be2a9[_0x90d5('0x27')],_0x3be2a9[_0x90d5('0x29')]);_0x540ce6['attributes']=_['intersection'](_0x3be2a9[_0x90d5('0x27')],qs[_0x90d5('0x2c')](_0x474175[_0x90d5('0x29')][_0x90d5('0x2c')]));_0x540ce6['attributes']=_0x540ce6[_0x90d5('0x2d')][_0x90d5('0x2e')]?_0x540ce6[_0x90d5('0x2d')]:_0x3be2a9[_0x90d5('0x27')];if(_0x474175[_0x90d5('0x29')][_0x90d5('0x39')]){_0x540ce6[_0x90d5('0x3a')]=[{'all':!![]}];}_0x540ce6=_['merge']({},_0x540ce6,_0x474175[_0x90d5('0x38')]);return db[_0x90d5('0x23')][_0x90d5('0x3f')](_0x540ce6)['then'](handleEntityNotFound(_0x2dc318,null))[_0x90d5('0x9')](respondWithResult(_0x2dc318,null))['catch'](handleError(_0x2dc318,null));};exports[_0x90d5('0x40')]=function(_0x554e9f,_0x5e9c26){var _0x1c541a;return db[_0x90d5('0x23')][_0x90d5('0x40')](_0x554e9f[_0x90d5('0x41')],{'raw':!![]})[_0x90d5('0x9')](function(_0x3c7f0d){_0x1c541a=_0x3c7f0d;return db[_0x90d5('0x23')]['findAll']({'where':{'type':_0x554e9f['body'][_0x90d5('0x26')]},'raw':!![]});})[_0x90d5('0x9')](function(_0xf7d77a){if(_0x1c541a['type'][_0x90d5('0x42')]()=='STUN'){var _0x50ba91=fs['readFileSync'](path['join'](config[_0x90d5('0x43')],_0x90d5('0x44')),_0x90d5('0x45'));var _0x20ca73=ejs['render'](_0x50ba91,{'networks':_0xf7d77a||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x20ca73);return respondWithRpcPromise(_0x90d5('0x46'),'create',{'module':'res_stun_monitor.so'});}else if(_0x1c541a[_0x90d5('0x26')][_0x90d5('0x42')]()=='TURN'){var _0x44d1c1=fs['readFileSync'](path[_0x90d5('0x47')](config[_0x90d5('0x43')],_0x90d5('0x48')),_0x90d5('0x45'));var _0x2d9364=ejs['render'](_0x44d1c1,{'networks':_0xf7d77a||[]});fs['writeFileSync'](_0x90d5('0x49'),_0x2d9364);return respondWithRpcPromise(_0x90d5('0x46'),_0x90d5('0x40'),{'module':_0x90d5('0x4a')});}else{var _0x64b4ea=fs[_0x90d5('0x4b')](path[_0x90d5('0x47')](config['root'],_0x90d5('0x4c')),_0x90d5('0x45'));var _0x4cf2ec=ejs[_0x90d5('0x4d')](_0x64b4ea,{'networks':_0xf7d77a||[]});fs[_0x90d5('0x4e')](util['format'](_0x90d5('0x4f'),_0x554e9f['body'][_0x90d5('0x26')][_0x90d5('0x50')]()),_0x4cf2ec);return respondWithRpcPromise(_0x90d5('0x46'),'create',{'module':_0x90d5('0x51')});}})[_0x90d5('0x9')](function(){return _0x1c541a;})['then'](respondWithResult(_0x5e9c26,0xc9))[_0x90d5('0x13')](handleError(_0x5e9c26,null));};exports['update']=function(_0x50d2b5,_0x3e9e92){var _0x208a36;return db[_0x90d5('0x23')][_0x90d5('0x3f')]({'where':{'id':_0x50d2b5[_0x90d5('0x3e')]['id']}})[_0x90d5('0x9')](handleEntityNotFound(_0x3e9e92,null))['then'](saveUpdates(_0x50d2b5[_0x90d5('0x41')],null))[_0x90d5('0x9')](function(_0x175325){if(_0x175325){_0x208a36=_0x175325;return db[_0x90d5('0x23')][_0x90d5('0x3b')]({'where':{'type':_0x208a36[_0x90d5('0x26')]},'raw':!![]});}return null;})[_0x90d5('0x9')](function(_0x43686c){if(_0x208a36[_0x90d5('0x26')][_0x90d5('0x42')]()=='STUN'){var _0x34a2e8=fs['readFileSync'](path[_0x90d5('0x47')](config[_0x90d5('0x43')],_0x90d5('0x44')),_0x90d5('0x45'));var _0x1f4385=ejs['render'](_0x34a2e8,{'networks':_0x43686c||[]});fs[_0x90d5('0x4e')](_0x90d5('0x52'),_0x1f4385);return respondWithRpcPromise(_0x90d5('0x46'),'update',{'module':_0x90d5('0x4a')});}else if(_0x208a36[_0x90d5('0x26')][_0x90d5('0x42')]()==_0x90d5('0x53')){var _0x591adf=fs['readFileSync'](path[_0x90d5('0x47')](config[_0x90d5('0x43')],_0x90d5('0x48')),_0x90d5('0x45'));var _0x2a11e9=ejs[_0x90d5('0x4d')](_0x591adf,{'networks':_0x43686c||[]});fs['writeFileSync'](_0x90d5('0x49'),_0x2a11e9);return respondWithRpcPromise('Reload',_0x90d5('0x1b'),{'module':_0x90d5('0x4a')});}else{var _0x3788af=fs[_0x90d5('0x4b')](path[_0x90d5('0x47')](config[_0x90d5('0x43')],'server/files/templates/network.ejs'),_0x90d5('0x45'));var _0x25b071=ejs[_0x90d5('0x4d')](_0x3788af,{'networks':_0x43686c||[]});fs[_0x90d5('0x4e')](util[_0x90d5('0x54')](_0x90d5('0x4f'),_0x50d2b5[_0x90d5('0x41')][_0x90d5('0x26')][_0x90d5('0x50')]()),_0x25b071);return respondWithRpcPromise(_0x90d5('0x46'),_0x90d5('0x1b'),{'module':_0x90d5('0x51')});}})[_0x90d5('0x9')](function(_0x2de0bb){if(_0x2de0bb){return _0x208a36;}return null;})[_0x90d5('0x9')](respondWithResult(_0x3e9e92,null))[_0x90d5('0x13')](handleError(_0x3e9e92,null));};exports['destroy']=function(_0x466865,_0x1fc1c6){var _0x14a17d;return db[_0x90d5('0x23')][_0x90d5('0x3f')]({'where':{'id':_0x466865['params']['id']}})[_0x90d5('0x9')](function(_0x2f7307){_0x14a17d=_0x2f7307;return _0x2f7307;})['then'](handleEntityNotFound(_0x1fc1c6,null))[_0x90d5('0x9')](removeEntity(_0x1fc1c6,null))[_0x90d5('0x9')](function(){if(_0x14a17d){return db[_0x90d5('0x23')][_0x90d5('0x3b')]({'where':{'type':_0x14a17d[_0x90d5('0x26')]},'raw':!![]});}})[_0x90d5('0x9')](function(_0x93f085){if(_0x14a17d[_0x90d5('0x26')][_0x90d5('0x42')]()==_0x90d5('0x55')){var _0x1abf46=fs['readFileSync'](path[_0x90d5('0x47')](config[_0x90d5('0x43')],_0x90d5('0x44')),_0x90d5('0x45'));var _0x3abf44=ejs[_0x90d5('0x4d')](_0x1abf46,{'networks':_0x93f085||[]});fs[_0x90d5('0x4e')](_0x90d5('0x52'),_0x3abf44);return respondWithRpcPromise(_0x90d5('0x46'),_0x90d5('0x1c'),{'module':_0x90d5('0x4a')});}else if(_0x14a17d[_0x90d5('0x26')][_0x90d5('0x42')]()==_0x90d5('0x53')){var _0x3ab395=fs[_0x90d5('0x4b')](path[_0x90d5('0x47')](config[_0x90d5('0x43')],_0x90d5('0x48')),_0x90d5('0x45'));var _0x53d9aa=ejs[_0x90d5('0x4d')](_0x3ab395,{'networks':_0x93f085||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x53d9aa);return respondWithRpcPromise(_0x90d5('0x46'),_0x90d5('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x36297c=fs['readFileSync'](path['join'](config[_0x90d5('0x43')],_0x90d5('0x4c')),'utf8');var _0x48fb84=ejs[_0x90d5('0x4d')](_0x36297c,{'networks':_0x93f085||[]});fs['writeFileSync'](util[_0x90d5('0x54')](_0x90d5('0x4f'),_0x14a17d[_0x90d5('0x26')]['toLowerCase']()),_0x48fb84);return respondWithRpcPromise(_0x90d5('0x46'),'destroy',{'module':_0x90d5('0x51')});}})[_0x90d5('0x13')](handleError(_0x1fc1c6,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 6a8d9d3..eb0ca1a 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 _0xb688=['exports','Network','network','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes'];(function(_0x52d371,_0x9a1a0e){var _0x5b3c1f=function(_0x173153){while(--_0x173153){_0x52d371['push'](_0x52d371['shift']());}};_0x5b3c1f(++_0x9a1a0e);}(_0xb688,0xcf));var _0x8b68=function(_0xeadb5,_0x315c77){_0xeadb5=_0xeadb5-0x0;var _0x48b21d=_0xb688[_0xeadb5];return _0x48b21d;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Network','network','../../config/logger','api'];(function(_0x286467,_0x59dd6a){var _0x19a6b1=function(_0x29e40e){while(--_0x29e40e){_0x286467['push'](_0x286467['shift']());}};_0x19a6b1(++_0x59dd6a);}(_0x1339,0x1ed));var _0x9133=function(_0x50229a,_0x20cb46){_0x50229a=_0x50229a-0x0;var _0x56599c=_0x1339[_0x50229a];return _0x56599c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./network.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'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 3a4bfca..808974f 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x496863,_0x5663f7){var _0x53c774=function(_0x1f5449){while(--_0x1f5449){_0x496863['push'](_0x496863['shift']());}};_0x53c774(++_0x5663f7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x152748,_0x32a79f){var _0x2f825c=function(_0x567be1){while(--_0x567be1){_0x152748['push'](_0x152748['shift']());}};_0x2f825c(++_0x32a79f);}(_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 a08137a..ed51328 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 _0x14d0=['/:id/interactions','getInteractions','/:id/users','getAgents','create','/:id/dispositions','addDisposition','post','notify','addAgents','/:id/send','send','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','describe','isAuthenticated','show','getDispositions','/:id/canned_answers','/:id/applications','getApplications'];(function(_0x51ff5d,_0x3ee9e5){var _0x3a16f5=function(_0x3f65a2){while(--_0x3f65a2){_0x51ff5d['push'](_0x51ff5d['shift']());}};_0x3a16f5(++_0x3ee9e5);}(_0x14d0,0xab));var _0x014d=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0x14d0[_0x43aee5];return _0x76d1d0;};'use strict';var multer=require('multer');var util=require(_0x014d('0x0'));var path=require(_0x014d('0x1'));var timeout=require(_0x014d('0x2'));var express=require(_0x014d('0x3'));var router=express[_0x014d('0x4')]();var fs_extra=require(_0x014d('0x5'));var auth=require(_0x014d('0x6'));var interaction=require(_0x014d('0x7'));var config=require(_0x014d('0x8'));var controller=require(_0x014d('0x9'));router[_0x014d('0xa')]('/',auth['isAuthenticated'](),controller[_0x014d('0xb')]);router[_0x014d('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x014d('0xc')]);router['get']('/:id',auth[_0x014d('0xd')](),controller[_0x014d('0xe')]);router['get']('/:id/dispositions',auth[_0x014d('0xd')](),controller[_0x014d('0xf')]);router[_0x014d('0xa')](_0x014d('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x014d('0xa')](_0x014d('0x11'),auth[_0x014d('0xd')](),controller[_0x014d('0x12')]);router[_0x014d('0xa')](_0x014d('0x13'),auth[_0x014d('0xd')](),controller[_0x014d('0x14')]);router[_0x014d('0xa')](_0x014d('0x15'),auth[_0x014d('0xd')](),controller[_0x014d('0x16')]);router['post']('/',auth[_0x014d('0xd')](),controller[_0x014d('0x17')]);router['post'](_0x014d('0x18'),auth['isAuthenticated'](),controller[_0x014d('0x19')]);router[_0x014d('0x1a')](_0x014d('0x10'),auth[_0x014d('0xd')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x014d('0x1b')]);router[_0x014d('0x1a')](_0x014d('0x11'),auth[_0x014d('0xd')](),controller['addApplications']);router['post'](_0x014d('0x15'),auth[_0x014d('0xd')](),controller[_0x014d('0x1c')]);router[_0x014d('0x1a')](_0x014d('0x1d'),auth['isAuthenticated'](),controller[_0x014d('0x1e')]);router['put']('/:id',auth[_0x014d('0xd')](),controller[_0x014d('0x1f')]);router[_0x014d('0x20')](_0x014d('0x21'),auth[_0x014d('0xd')](),controller[_0x014d('0x22')]);router['delete'](_0x014d('0x18'),auth['isAuthenticated'](),controller[_0x014d('0x23')]);router[_0x014d('0x20')](_0x014d('0x10'),auth[_0x014d('0xd')](),controller[_0x014d('0x24')]);router[_0x014d('0x20')](_0x014d('0x15'),auth[_0x014d('0xd')](),controller[_0x014d('0x25')]);module['exports']=router; \ No newline at end of file +var _0xbd92=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x34ce1a,_0x331198){var _0x654759=function(_0x5771d4){while(--_0x5771d4){_0x34ce1a['push'](_0x34ce1a['shift']());}};_0x654759(++_0x331198);}(_0xbd92,0x1ec));var _0x2bd9=function(_0x13eca4,_0x1f693b){_0x13eca4=_0x13eca4-0x0;var _0x5bd965=_0xbd92[_0x13eca4];return _0x5bd965;};'use strict';var multer=require(_0x2bd9('0x0'));var util=require(_0x2bd9('0x1'));var path=require(_0x2bd9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2bd9('0x3')]();var fs_extra=require(_0x2bd9('0x4'));var auth=require(_0x2bd9('0x5'));var interaction=require(_0x2bd9('0x6'));var config=require(_0x2bd9('0x7'));var controller=require(_0x2bd9('0x8'));router[_0x2bd9('0x9')]('/',auth['isAuthenticated'](),controller[_0x2bd9('0xa')]);router[_0x2bd9('0x9')]('/describe',auth[_0x2bd9('0xb')](),controller[_0x2bd9('0xc')]);router[_0x2bd9('0x9')]('/:id',auth[_0x2bd9('0xb')](),controller[_0x2bd9('0xd')]);router[_0x2bd9('0x9')]('/:id/dispositions',auth[_0x2bd9('0xb')](),controller[_0x2bd9('0xe')]);router['get'](_0x2bd9('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x2bd9('0x9')](_0x2bd9('0x10'),auth['isAuthenticated'](),controller[_0x2bd9('0x11')]);router[_0x2bd9('0x9')]('/:id/interactions',auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x12')]);router[_0x2bd9('0x9')]('/:id/users',auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x13')]);router[_0x2bd9('0x14')]('/',auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x15')]);router['post'](_0x2bd9('0x16'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x17')]);router[_0x2bd9('0x14')](_0x2bd9('0xf'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x18')]);router[_0x2bd9('0x14')](_0x2bd9('0x19'),controller[_0x2bd9('0x1a')]);router[_0x2bd9('0x14')](_0x2bd9('0x10'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x1b')]);router['post'](_0x2bd9('0x1c'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x1d')]);router['post'](_0x2bd9('0x1e'),auth['isAuthenticated'](),controller[_0x2bd9('0x1f')]);router[_0x2bd9('0x20')](_0x2bd9('0x21'),auth['isAuthenticated'](),controller[_0x2bd9('0x22')]);router['delete'](_0x2bd9('0x21'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x23')]);router[_0x2bd9('0x24')](_0x2bd9('0x16'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x25')]);router['delete'](_0x2bd9('0xf'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x26')]);router[_0x2bd9('0x24')](_0x2bd9('0x1c'),auth[_0x2bd9('0xb')](),controller[_0x2bd9('0x27')]);module[_0x2bd9('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 9099f32..c042fd2 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 _0xcca0=['mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xcca0,0x16a));var _0x0cca=function(_0x38da9f,_0xe3d9bb){_0x38da9f=_0x38da9f-0x0;var _0x384494=_0xcca0[_0x38da9f];return _0x384494;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0cca('0x0'));module[_0x0cca('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0cca('0x2')],'defaultValue':function(){return rs[_0x0cca('0x3')]();}},'replyUri':{'type':Sequelize[_0x0cca('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0cca('0x4');}},'notificationSound':{'type':Sequelize[_0x0cca('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0cca('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x0cca('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0cca('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0cca('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0cca('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x0cca('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0cca('0x8'),'set':function(_0x10ecb4){if(!_0x10ecb4)this[_0x0cca('0x9')](_0x0cca('0xa'),null);this[_0x0cca('0x9')](_0x0cca('0xb'),_0x10ecb4);}}}; \ No newline at end of file +var _0x0e86=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x74c6c6,_0x54d54e){var _0x56ba8b=function(_0x2c885f){while(--_0x2c885f){_0x74c6c6['push'](_0x74c6c6['shift']());}};_0x56ba8b(++_0x54d54e);}(_0x0e86,0x1ee));var _0x60e8=function(_0x22c169,_0x3298a6){_0x22c169=_0x22c169-0x0;var _0x30cc6f=_0x0e86[_0x22c169];return _0x30cc6f;};'use strict';var Sequelize=require(_0x60e8('0x0'));var rs=require(_0x60e8('0x1'));module[_0x60e8('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x60e8('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x60e8('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x60e8('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x60e8('0x5')],'defaultValue':function(){return _0x60e8('0x6');}},'notificationSound':{'type':Sequelize[_0x60e8('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x60e8('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x60e8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x60e8('0x3')]},'queueTransfer':{'type':Sequelize[_0x60e8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x60e8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x60e8('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x60e8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60e8('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x60e8('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x60e8('0x7')],'defaultValue':![],'comment':_0x60e8('0xa'),'set':function(_0x358c67){if(!_0x358c67)this[_0x60e8('0xb')](_0x60e8('0xc'),null);this[_0x60e8('0xb')](_0x60e8('0xd'),_0x358c67);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8acbe46..ebefe71 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 _0xa952=['info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','type','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','order','removeDispositions','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','priority','finally','getApplications','pick','getInteractions','Contact','Owner','fullname','Tags','color','tag','addAgents','ids','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','client','http','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x26dae3,_0x3a9815){var _0x853f07=function(_0x1b0faa){while(--_0x1b0faa){_0x26dae3['push'](_0x26dae3['shift']());}};_0x853f07(++_0x3a9815);}(_0xa952,0x98));var _0x2a95=function(_0x1ba7dc,_0x1091de){_0x1ba7dc=_0x1ba7dc-0x0;var _0x539c47=_0xa952[_0x1ba7dc];return _0x539c47;};'use strict';var emlformat=require(_0x2a95('0x0'));var rimraf=require(_0x2a95('0x1'));var zipdir=require(_0x2a95('0x2'));var jsonpatch=require(_0x2a95('0x3'));var rp=require(_0x2a95('0x4'));var moment=require('moment');var BPromise=require(_0x2a95('0x5'));var Mustache=require('mustache');var util=require(_0x2a95('0x6'));var path=require(_0x2a95('0x7'));var sox=require(_0x2a95('0x8'));var csv=require(_0x2a95('0x9'));var ejs=require(_0x2a95('0xa'));var fs=require('fs');var fs_extra=require(_0x2a95('0xb'));var _=require(_0x2a95('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2a95('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a95('0x9'));var querystring=require(_0x2a95('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2a95('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2a95('0x10'));var hardwareService=require(_0x2a95('0x11'));var logger=require(_0x2a95('0x12'))('api');var utils=require(_0x2a95('0x13'));var config=require(_0x2a95('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2a95('0x15')](config['redis'],{'host':_0x2a95('0x16'),'port':0x18eb});var socket=require(_0x2a95('0x17'))(new Redis(config[_0x2a95('0x18')]));require(_0x2a95('0x19'))[_0x2a95('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2a95('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x2a95('0x1b')][_0x2a95('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x691a1,_0x101150,_0xfef268,_0x16a8d3){return new BPromise(function(_0x1c3e8a,_0x1d8eb1){var _0x45f70e=_0x16a8d3||client;return _0x45f70e[_0x2a95('0x1d')](_0x691a1,_0xfef268)['then'](function(_0x33cb10){logger['info'](_0x2a95('0x1e'),_0x101150,_0x2a95('0x1f'));logger[_0x2a95('0x20')](_0x2a95('0x21'),_0x101150,_0x2a95('0x1f'),JSON[_0x2a95('0x22')](_0x33cb10));if(_0x33cb10[_0x2a95('0x23')]){if(_0x33cb10['error']['code']===0x1f4){logger['error'](_0x2a95('0x1e'),_0x101150,_0x33cb10[_0x2a95('0x23')]['message']);return _0x1d8eb1(_0x33cb10[_0x2a95('0x23')]['message']);}logger[_0x2a95('0x23')](_0x2a95('0x1e'),_0x101150,_0x33cb10[_0x2a95('0x23')][_0x2a95('0x24')]);return _0x1c3e8a(_0x33cb10[_0x2a95('0x23')]['message']);}else{logger[_0x2a95('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x101150,_0x2a95('0x1f'));_0x1c3e8a(_0x33cb10[_0x2a95('0x26')][_0x2a95('0x24')]);}})[_0x2a95('0x27')](function(_0x2f6044){logger['error'](_0x2a95('0x1e'),_0x101150,_0x2f6044);_0x1d8eb1(_0x2f6044);});});}function respondWithStatusCode(_0x335f52,_0x3bec5f){_0x3bec5f=_0x3bec5f||0xcc;return function(_0x232ab0){if(_0x232ab0){return _0x335f52[_0x2a95('0x28')](_0x3bec5f);}return _0x335f52[_0x2a95('0x29')](_0x3bec5f)[_0x2a95('0x2a')]();};}function respondWithResult(_0x4c85d0,_0x2119eb){_0x2119eb=_0x2119eb||0xc8;return function(_0x7957be){if(_0x7957be){return _0x4c85d0[_0x2a95('0x29')](_0x2119eb)[_0x2a95('0x2b')](_0x7957be);}};}function respondWithFilteredResult(_0x3659e4,_0x119bd9){return function(_0x4dd4f0){if(_0x4dd4f0){var _0x928139=typeof _0x119bd9[_0x2a95('0x2c')]===_0x2a95('0x2d')&&typeof _0x119bd9[_0x2a95('0x2e')]===_0x2a95('0x2d');var _0x2023eb=_0x4dd4f0[_0x2a95('0x2f')];var _0xd4347f=_0x928139?0x0:_0x119bd9['offset'];var _0x2221c9=_0x928139?_0x4dd4f0[_0x2a95('0x2f')]:_0x119bd9[_0x2a95('0x2c')]+_0x119bd9['limit'];var _0x56ca87;if(_0x2221c9>=_0x2023eb){_0x2221c9=_0x2023eb;_0x56ca87=0xc8;}else{_0x56ca87=0xce;}_0x3659e4[_0x2a95('0x29')](_0x56ca87);return _0x3659e4['set'](_0x2a95('0x30'),_0xd4347f+'-'+_0x2221c9+'/'+_0x2023eb)[_0x2a95('0x2b')](_0x4dd4f0);}return null;};}function patchUpdates(_0x5dc199){return function(_0x508443){try{jsonpatch[_0x2a95('0x31')](_0x508443,_0x5dc199,!![]);}catch(_0x3f1c5d){return BPromise[_0x2a95('0x32')](_0x3f1c5d);}return _0x508443['save']();};}function saveUpdates(_0x14cea9,_0x225980){return function(_0x3d422a){if(_0x3d422a){return _0x3d422a[_0x2a95('0x33')](_0x14cea9)['then'](function(_0x27cdd4){return _0x27cdd4;});}return null;};}function removeEntity(_0x549c0b,_0x5c94ba){return function(_0x478a8e){if(_0x478a8e){return _0x478a8e[_0x2a95('0x34')]()[_0x2a95('0x35')](function(){var _0x360e1d=_0x478a8e[_0x2a95('0x36')]({'plain':!![]});var _0x37bae7='OpenchannelAccounts';return db[_0x2a95('0x37')][_0x2a95('0x34')]({'where':{'type':_0x37bae7,'resourceId':_0x360e1d['id']}})[_0x2a95('0x35')](function(){return _0x478a8e;});})[_0x2a95('0x35')](function(){_0x549c0b[_0x2a95('0x29')](0xcc)[_0x2a95('0x2a')]();});}};}function handleEntityNotFound(_0xf48ba1,_0x459c13){return function(_0x4eedc7){if(!_0x4eedc7){_0xf48ba1[_0x2a95('0x28')](0x194);}return _0x4eedc7;};}function handleError(_0x1c0965,_0x35f21e){_0x35f21e=_0x35f21e||0x1f4;return function(_0x5e639f){logger[_0x2a95('0x23')](_0x5e639f[_0x2a95('0x38')]);if(_0x5e639f[_0x2a95('0x39')]){delete _0x5e639f['name'];}_0x1c0965['status'](_0x35f21e)[_0x2a95('0x3a')](_0x5e639f);};}exports[_0x2a95('0x3b')]=function(_0x470bcb,_0x4e6065){var _0x2ec9ab={'include':[{'model':db[_0x2a95('0x3c')],'as':_0x2a95('0x3d')}]},_0x49118e={},_0x1f7ab3={'count':0x0,'rows':[]};var _0x2f06b5=_[_0x2a95('0x3e')](db['OpenchannelAccount'][_0x2a95('0x3f')],function(_0x1e772d){return{'name':_0x1e772d[_0x2a95('0x40')],'type':_0x1e772d['type'][_0x2a95('0x41')]};});_0x49118e[_0x2a95('0x42')]=_[_0x2a95('0x3e')](_0x2f06b5,_0x2a95('0x39'));_0x49118e[_0x2a95('0x43')]=_[_0x2a95('0x44')](_0x470bcb[_0x2a95('0x43')]);_0x49118e[_0x2a95('0x45')]=_[_0x2a95('0x46')](_0x49118e[_0x2a95('0x42')],_0x49118e[_0x2a95('0x43')]);_0x2ec9ab[_0x2a95('0x47')]=_[_0x2a95('0x46')](_0x49118e[_0x2a95('0x42')],qs[_0x2a95('0x48')](_0x470bcb[_0x2a95('0x43')][_0x2a95('0x48')]));_0x2ec9ab[_0x2a95('0x47')]=_0x2ec9ab[_0x2a95('0x47')][_0x2a95('0x49')]?_0x2ec9ab[_0x2a95('0x47')]:_0x49118e['model'];if(!_0x470bcb[_0x2a95('0x43')]['hasOwnProperty'](_0x2a95('0x4a'))){_0x2ec9ab[_0x2a95('0x2e')]=qs['limit'](_0x470bcb[_0x2a95('0x43')]['limit']);_0x2ec9ab['offset']=qs[_0x2a95('0x2c')](_0x470bcb['query']['offset']);}_0x2ec9ab['order']=qs[_0x2a95('0x4b')](_0x470bcb['query'][_0x2a95('0x4b')]);_0x2ec9ab['where']=qs[_0x2a95('0x45')](_['pick'](_0x470bcb['query'],_0x49118e[_0x2a95('0x45')]),_0x2f06b5);if(_0x470bcb[_0x2a95('0x43')]['filter']){_0x2ec9ab[_0x2a95('0x4c')]=_[_0x2a95('0x4d')](_0x2ec9ab[_0x2a95('0x4c')],{'$or':_['map'](_0x2f06b5,function(_0x2c96bd){if(_0x2c96bd[_0x2a95('0x4e')]!=='VIRTUAL'){var _0xd581e2={};_0xd581e2[_0x2c96bd[_0x2a95('0x39')]]={'$like':'%'+_0x470bcb[_0x2a95('0x43')][_0x2a95('0x4f')]+'%'};return _0xd581e2;}})});}_0x2ec9ab=_['merge']({},_0x2ec9ab,_0x470bcb[_0x2a95('0x50')]);var _0x55f899={'where':_0x2ec9ab['where']};return db[_0x2a95('0x51')]['count'](_0x55f899)['then'](function(_0xdf4e09){_0x1f7ab3[_0x2a95('0x2f')]=_0xdf4e09;if(_0x470bcb['query'][_0x2a95('0x52')]){_0x2ec9ab[_0x2a95('0x53')]=[{'all':!![]}];}return db[_0x2a95('0x51')][_0x2a95('0x54')](_0x2ec9ab);})[_0x2a95('0x35')](function(_0x4e56cd){_0x1f7ab3[_0x2a95('0x55')]=_0x4e56cd;return _0x1f7ab3;})['then'](respondWithFilteredResult(_0x4e6065,_0x2ec9ab))[_0x2a95('0x27')](handleError(_0x4e6065,null));};exports[_0x2a95('0x56')]=function(_0xe5fbb5,_0x3a8560){var _0x3e61a7={'raw':![],'where':{'id':_0xe5fbb5[_0x2a95('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x2a95('0x3d')}]},_0x3bcbd9={};_0x3bcbd9[_0x2a95('0x42')]=_[_0x2a95('0x44')](db['OpenchannelAccount'][_0x2a95('0x3f')]);_0x3bcbd9[_0x2a95('0x43')]=_[_0x2a95('0x44')](_0xe5fbb5[_0x2a95('0x43')]);_0x3bcbd9[_0x2a95('0x45')]=_[_0x2a95('0x46')](_0x3bcbd9['model'],_0x3bcbd9['query']);_0x3e61a7[_0x2a95('0x47')]=_['intersection'](_0x3bcbd9[_0x2a95('0x42')],qs[_0x2a95('0x48')](_0xe5fbb5[_0x2a95('0x43')][_0x2a95('0x48')]));_0x3e61a7[_0x2a95('0x47')]=_0x3e61a7[_0x2a95('0x47')]['length']?_0x3e61a7[_0x2a95('0x47')]:_0x3bcbd9[_0x2a95('0x42')];if(_0xe5fbb5[_0x2a95('0x43')]['includeAll']){_0x3e61a7[_0x2a95('0x53')]=[{'all':!![]}];}_0x3e61a7=_['merge']({},_0x3e61a7,_0xe5fbb5[_0x2a95('0x50')]);return db[_0x2a95('0x51')][_0x2a95('0x58')](_0x3e61a7)[_0x2a95('0x35')](handleEntityNotFound(_0x3a8560,null))[_0x2a95('0x35')](respondWithResult(_0x3a8560,null))[_0x2a95('0x27')](handleError(_0x3a8560,null));};exports['create']=function(_0x3e2d1e,_0x374d63){return db[_0x2a95('0x51')]['create'](_0x3e2d1e[_0x2a95('0x59')],{})[_0x2a95('0x35')](function(_0x5cc721){var _0x5a8fb7=_0x3e2d1e[_0x2a95('0x5a')][_0x2a95('0x36')]({'plain':!![]});if(!_0x5a8fb7)throw new Error(_0x2a95('0x5b'));if(_0x5a8fb7['role']===_0x2a95('0x5a')){var _0x486eca=_0x5cc721[_0x2a95('0x36')]({'plain':!![]});var _0x42fc38=_0x2a95('0x5c');return db['UserProfileSection'][_0x2a95('0x58')]({'where':{'name':_0x42fc38,'userProfileId':_0x5a8fb7[_0x2a95('0x5d')]},'raw':!![]})[_0x2a95('0x35')](function(_0x2c13ab){if(_0x2c13ab&&_0x2c13ab['autoAssociation']===0x0){return db[_0x2a95('0x37')][_0x2a95('0x5e')]({'name':_0x486eca[_0x2a95('0x39')],'resourceId':_0x486eca['id'],'type':_0x2c13ab[_0x2a95('0x39')],'sectionId':_0x2c13ab['id']},{})['then'](function(){return _0x5cc721;});}else{return _0x5cc721;}})[_0x2a95('0x27')](function(_0x938d2e){logger[_0x2a95('0x23')](_0x2a95('0x5f'),_0x938d2e);throw _0x938d2e;});}return _0x5cc721;})[_0x2a95('0x35')](respondWithResult(_0x374d63,0xc9))[_0x2a95('0x27')](handleError(_0x374d63,null));};exports['update']=function(_0x4a415f,_0x313cb8){if(_0x4a415f[_0x2a95('0x59')]['id']){delete _0x4a415f['body']['id'];}return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x4a415f[_0x2a95('0x57')]['id']},'include':[{'model':db[_0x2a95('0x3c')],'as':_0x2a95('0x3d')}]})[_0x2a95('0x35')](handleEntityNotFound(_0x313cb8,null))[_0x2a95('0x35')](saveUpdates(_0x4a415f[_0x2a95('0x59')],null))[_0x2a95('0x35')](respondWithResult(_0x313cb8,null))['catch'](handleError(_0x313cb8,null));};exports[_0x2a95('0x34')]=function(_0x53bf68,_0x1d1101){return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x53bf68[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x1d1101,null))[_0x2a95('0x35')](removeEntity(_0x1d1101,null))[_0x2a95('0x27')](handleError(_0x1d1101,null));};exports[_0x2a95('0x60')]=function(_0x43ce87,_0x526025){return db[_0x2a95('0x51')][_0x2a95('0x60')]()[_0x2a95('0x35')](respondWithResult(_0x526025,null))[_0x2a95('0x27')](handleError(_0x526025,null));};exports[_0x2a95('0x61')]=function(_0x9ec544,_0x4bb121,_0x27cfe5){if(_0x9ec544[_0x2a95('0x59')]['id']){delete _0x9ec544[_0x2a95('0x59')]['id'];}return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x9ec544[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x4bb121,null))[_0x2a95('0x35')](function(_0x319856){if(_0x319856){_0x9ec544[_0x2a95('0x59')][_0x2a95('0x62')]=_0x319856['id'];return db['Disposition'][_0x2a95('0x5e')](_0x9ec544[_0x2a95('0x59')]);}})['then'](respondWithResult(_0x4bb121,null))['catch'](handleError(_0x4bb121,null));};exports[_0x2a95('0x63')]=function(_0x5cbdfb,_0x28a0f0,_0x349bf2){var _0x110dc2={'raw':![],'where':{}};var _0x2b631e={};var _0xbb88d7={'count':0x0,'rows':[]};return db[_0x2a95('0x51')][_0x2a95('0x64')]({'where':{'id':_0x5cbdfb[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x28a0f0,null))[_0x2a95('0x35')](function(_0x3ed164){if(_0x3ed164){_0x2b631e[_0x2a95('0x42')]=_['keys'](db[_0x2a95('0x65')][_0x2a95('0x3f')]);_0x2b631e[_0x2a95('0x43')]=_[_0x2a95('0x44')](_0x5cbdfb[_0x2a95('0x43')]);_0x2b631e[_0x2a95('0x45')]=_[_0x2a95('0x46')](_0x2b631e[_0x2a95('0x42')],_0x2b631e[_0x2a95('0x43')]);_0x110dc2[_0x2a95('0x47')]=_['intersection'](_0x2b631e[_0x2a95('0x42')],qs[_0x2a95('0x48')](_0x5cbdfb[_0x2a95('0x43')][_0x2a95('0x48')]));_0x110dc2[_0x2a95('0x47')]=_0x110dc2['attributes'][_0x2a95('0x49')]?_0x110dc2[_0x2a95('0x47')]:_0x2b631e['model'];if(!_0x5cbdfb[_0x2a95('0x43')][_0x2a95('0x66')](_0x2a95('0x4a'))){_0x110dc2[_0x2a95('0x2e')]=qs['limit'](_0x5cbdfb[_0x2a95('0x43')][_0x2a95('0x2e')]);_0x110dc2[_0x2a95('0x2c')]=qs[_0x2a95('0x2c')](_0x5cbdfb[_0x2a95('0x43')][_0x2a95('0x2c')]);}_0x110dc2[_0x2a95('0x67')]=qs[_0x2a95('0x4b')](_0x5cbdfb[_0x2a95('0x43')]['sort']);_0x110dc2[_0x2a95('0x4c')]=qs[_0x2a95('0x45')](_['pick'](_0x5cbdfb[_0x2a95('0x43')],_0x2b631e[_0x2a95('0x45')]));_0x110dc2[_0x2a95('0x4c')]['OpenchannelAccountId']=_0x3ed164['id'];if(_0x5cbdfb[_0x2a95('0x43')][_0x2a95('0x4f')]){_0x110dc2[_0x2a95('0x4c')]=_[_0x2a95('0x4d')](_0x110dc2[_0x2a95('0x4c')],{'$or':_['map'](_0x110dc2['attributes'],function(_0x4da06c){var _0x515e6f={};_0x515e6f[_0x4da06c]={'$like':'%'+_0x5cbdfb['query']['filter']+'%'};return _0x515e6f;})});}_0x110dc2=_['merge']({},_0x110dc2,_0x5cbdfb['options']);return db['Disposition'][_0x2a95('0x2f')]({'where':_0x110dc2[_0x2a95('0x4c')]})[_0x2a95('0x35')](function(_0x45f654){_0xbb88d7[_0x2a95('0x2f')]=_0x45f654;if(_0x5cbdfb[_0x2a95('0x43')]['includeAll']){_0x110dc2['include']=[{'all':!![]}];}return db[_0x2a95('0x65')][_0x2a95('0x54')](_0x110dc2);})['then'](function(_0x308b40){_0xbb88d7['rows']=_0x308b40;return _0xbb88d7;});}})[_0x2a95('0x35')](respondWithFilteredResult(_0x28a0f0,_0x110dc2))[_0x2a95('0x27')](handleError(_0x28a0f0,null));};exports['removeDispositions']=function(_0x3811e6,_0x8e16e2,_0x2a830a){return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x3811e6[_0x2a95('0x57')]['id']}})['then'](handleEntityNotFound(_0x8e16e2,null))[_0x2a95('0x35')](function(_0x2548fc){if(_0x2548fc){return _0x2548fc[_0x2a95('0x68')](_0x3811e6[_0x2a95('0x43')]['ids']);}})[_0x2a95('0x35')](respondWithStatusCode(_0x8e16e2,null))[_0x2a95('0x27')](handleError(_0x8e16e2,null));};exports['addAnswer']=function(_0x297610,_0x31ee33,_0x1f3508){if(_0x297610['body']['id']){delete _0x297610[_0x2a95('0x59')]['id'];}return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x297610[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x31ee33,null))['then'](function(_0x14fa78){if(_0x14fa78){_0x297610['body']['OpenchannelAccountId']=_0x14fa78['id'];return db[_0x2a95('0x69')]['create'](_0x297610['body']);}})[_0x2a95('0x35')](respondWithResult(_0x31ee33,null))[_0x2a95('0x27')](handleError(_0x31ee33,null));};exports['getAnswers']=function(_0x1689c2,_0x1b176e,_0x4b2c42){var _0x372ba5={'raw':![],'where':{}};var _0x4905b6={};var _0x5004b8={'count':0x0,'rows':[]};return db[_0x2a95('0x51')][_0x2a95('0x64')]({'where':{'id':_0x1689c2[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x1b176e,null))[_0x2a95('0x35')](function(_0x2e06c6){if(_0x2e06c6){_0x4905b6[_0x2a95('0x42')]=_[_0x2a95('0x44')](db[_0x2a95('0x69')][_0x2a95('0x3f')]);_0x4905b6[_0x2a95('0x43')]=_['keys'](_0x1689c2[_0x2a95('0x43')]);_0x4905b6[_0x2a95('0x45')]=_['intersection'](_0x4905b6[_0x2a95('0x42')],_0x4905b6['query']);_0x372ba5[_0x2a95('0x47')]=_[_0x2a95('0x46')](_0x4905b6[_0x2a95('0x42')],qs[_0x2a95('0x48')](_0x1689c2[_0x2a95('0x43')][_0x2a95('0x48')]));_0x372ba5[_0x2a95('0x47')]=_0x372ba5[_0x2a95('0x47')][_0x2a95('0x49')]?_0x372ba5[_0x2a95('0x47')]:_0x4905b6[_0x2a95('0x42')];if(!_0x1689c2[_0x2a95('0x43')][_0x2a95('0x66')](_0x2a95('0x4a'))){_0x372ba5[_0x2a95('0x2e')]=qs[_0x2a95('0x2e')](_0x1689c2[_0x2a95('0x43')][_0x2a95('0x2e')]);_0x372ba5['offset']=qs[_0x2a95('0x2c')](_0x1689c2[_0x2a95('0x43')][_0x2a95('0x2c')]);}_0x372ba5['order']=qs[_0x2a95('0x4b')](_0x1689c2[_0x2a95('0x43')][_0x2a95('0x4b')]);_0x372ba5[_0x2a95('0x4c')]=qs[_0x2a95('0x45')](_['pick'](_0x1689c2['query'],_0x4905b6[_0x2a95('0x45')]));_0x372ba5[_0x2a95('0x4c')][_0x2a95('0x62')]=_0x2e06c6['id'];if(_0x1689c2['query'][_0x2a95('0x4f')]){_0x372ba5[_0x2a95('0x4c')]=_['merge'](_0x372ba5[_0x2a95('0x4c')],{'$or':_[_0x2a95('0x3e')](_0x372ba5[_0x2a95('0x47')],function(_0x27eb04){var _0x3427c9={};_0x3427c9[_0x27eb04]={'$like':'%'+_0x1689c2[_0x2a95('0x43')]['filter']+'%'};return _0x3427c9;})});}_0x372ba5=_['merge']({},_0x372ba5,_0x1689c2[_0x2a95('0x50')]);return db['CannedAnswer'][_0x2a95('0x2f')]({'where':_0x372ba5[_0x2a95('0x4c')]})['then'](function(_0x16c853){_0x5004b8['count']=_0x16c853;if(_0x1689c2[_0x2a95('0x43')][_0x2a95('0x52')]){_0x372ba5['include']=[{'all':!![]}];}return db[_0x2a95('0x69')][_0x2a95('0x54')](_0x372ba5);})[_0x2a95('0x35')](function(_0xbf47b9){_0x5004b8['rows']=_0xbf47b9;return _0x5004b8;});}})['then'](respondWithFilteredResult(_0x1b176e,_0x372ba5))['catch'](handleError(_0x1b176e,null));};exports[_0x2a95('0x6a')]=function(_0x1638dd,_0x4b5fed,_0x5eaa47){return db[_0x2a95('0x51')]['find']({'where':{'id':_0x1638dd['params']['id']}})['then'](handleEntityNotFound(_0x4b5fed,null))[_0x2a95('0x35')](function(_0x3fba39){if(_0x3fba39){return _0x3fba39[_0x2a95('0x6a')](_0x1638dd[_0x2a95('0x43')]['ids']);}})[_0x2a95('0x35')](respondWithStatusCode(_0x4b5fed,null))[_0x2a95('0x27')](handleError(_0x4b5fed,null));};exports[_0x2a95('0x6b')]=function(_0x39d41c,_0x1a89ac,_0x5b8a28){var _0x47c2d2={'body':_0x39d41c[_0x2a95('0x59')],'channel':_0x2a95('0x6c')};var _0x11ba49=[];var _0x4b84e9=[];var _0x1fa146={};var _0x522485=![];return db[_0x2a95('0x6d')][_0x2a95('0x60')]()[_0x2a95('0x35')](function(_0x4c272e){if(!_0x4c272e){throw new db[(_0x2a95('0x6e'))][(_0x2a95('0x6f'))]('no\x20available\x20attributes');}_0x11ba49=_[_0x2a95('0x70')](_[_0x2a95('0x44')](_0x4c272e),[_0x2a95('0x71'),_0x2a95('0x72')]);_0x4b84e9=_[_0x2a95('0x70')](_[_0x2a95('0x44')](_0x4c272e),['createdAt',_0x2a95('0x72'),_0x2a95('0x73'),_0x2a95('0x74')]);if(_0x39d41c[_0x2a95('0x59')]['id']){delete _0x39d41c[_0x2a95('0x59')]['id'];}if(_['isNil'](_0x39d41c[_0x2a95('0x59')][_0x2a95('0x75')])){throw new db[(_0x2a95('0x6e'))][(_0x2a95('0x6f'))](_0x2a95('0x76'));}if(_[_0x2a95('0x77')](_0x39d41c[_0x2a95('0x59')][_0x2a95('0x59')])||_0x39d41c['body'][_0x2a95('0x59')]===''){throw new db['Sequelize'][(_0x2a95('0x6f'))](_0x2a95('0x78'));}if(_[_0x2a95('0x77')](_0x39d41c[_0x2a95('0x59')][_0x2a95('0x79')])){throw new db[(_0x2a95('0x6e'))][(_0x2a95('0x6f'))](_0x2a95('0x7a')+_0x4b84e9);}if(!_[_0x2a95('0x7b')](_0x4b84e9,_0x39d41c[_0x2a95('0x59')][_0x2a95('0x79')])){throw new db[(_0x2a95('0x6e'))]['ValidationError'](_0x2a95('0x7c')+_0x4b84e9);}_0x1fa146[_0x39d41c[_0x2a95('0x59')][_0x2a95('0x79')]]=_0x39d41c[_0x2a95('0x59')][_0x2a95('0x75')];})['then'](function(){return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x39d41c[_0x2a95('0x57')]['id']},'include':[{'model':db[_0x2a95('0x7d')],'as':_0x2a95('0x7e'),'include':[{'model':db[_0x2a95('0x6d')],'as':_0x2a95('0x7f'),'where':_0x1fa146,'limit':0x1,'order':[['updatedAt',_0x2a95('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':_0x2a95('0x81')}]});})[_0x2a95('0x35')](handleEntityNotFound(_0x1a89ac,null))[_0x2a95('0x35')](function(_0x32ac8c){if(_0x32ac8c&&_0x32ac8c[_0x2a95('0x7e')]){_0x47c2d2[_0x2a95('0x82')]=_0x32ac8c;_0x47c2d2[_0x2a95('0x83')]=_0x32ac8c[_0x2a95('0x81')];_0x47c2d2[_0x2a95('0x84')]=_0x32ac8c[_0x2a95('0x7e')];_0x47c2d2[_0x2a95('0x83')]=_[_0x2a95('0x85')](_0x47c2d2[_0x2a95('0x83')],['priority'],['asc']);if(_0x47c2d2[_0x2a95('0x82')][_0x2a95('0x81')]){delete _0x47c2d2[_0x2a95('0x82')][_0x2a95('0x81')];}if(_0x47c2d2[_0x2a95('0x82')][_0x2a95('0x7e')]&&_0x47c2d2[_0x2a95('0x82')]['List'][_0x2a95('0x7f')]['length']){return _0x47c2d2['account']['List'][_0x2a95('0x7f')][0x0];}var _0x218629=_['defaults'](_0x39d41c[_0x2a95('0x59')],{'firstName':_0x39d41c[_0x2a95('0x59')][_0x2a95('0x75')],'ListId':_0x32ac8c[_0x2a95('0x74')]});_0x218629[_0x39d41c[_0x2a95('0x59')][_0x2a95('0x79')]]=_0x39d41c[_0x2a95('0x59')][_0x2a95('0x75')];return db[_0x2a95('0x6d')][_0x2a95('0x5e')](_0x218629,{'fields':_0x11ba49,'raw':!![]});}})[_0x2a95('0x35')](handleEntityNotFound(_0x1a89ac,null))['then'](function(_0x492283){_0x47c2d2[_0x2a95('0x86')]=_0x492283;if(_0x492283){var _0x2df9f3={'ContactId':_0x492283['id'],'OpenchannelAccountId':_0x39d41c[_0x2a95('0x57')]['id'],'from':(_0x492283[_0x2a95('0x87')]||'')+'\x20'+(_0x492283[_0x2a95('0x88')]||'')};var _0x3e5788={'OpenchannelAccountId':_0x39d41c[_0x2a95('0x57')]['id'],'closed':![]};if(_0x39d41c[_0x2a95('0x59')][_0x2a95('0x89')]){_0x3e5788[_0x2a95('0x89')]=_0x39d41c['body'][_0x2a95('0x89')];return db[_0x2a95('0x8a')][_0x2a95('0x58')]({'where':_0x3e5788})[_0x2a95('0x35')](function(_0xfad9f4){if(_0xfad9f4){return[_0xfad9f4,![]];}_0x2df9f3[_0x2a95('0x89')]=_0x39d41c['body'][_0x2a95('0x89')];_0x2df9f3[_0x2a95('0x8b')]=_0x39d41c[_0x2a95('0x59')][_0x2a95('0x8b')];return db['OpenchannelInteraction'][_0x2a95('0x5e')](_0x2df9f3)[_0x2a95('0x35')](function(_0x9d2153){return[_0x9d2153,!![]];});});}else{_0x3e5788[_0x2a95('0x89')]=null;}_0x3e5788[_0x2a95('0x8c')]=_0x492283['id'];return db[_0x2a95('0x8a')][_0x2a95('0x58')]({'where':_0x3e5788})[_0x2a95('0x35')](function(_0x41fde6){if(_0x41fde6){return[_0x41fde6,![]];}return db['OpenchannelInteraction']['create'](_0x2df9f3)[_0x2a95('0x35')](function(_0x4ce7dc){return[_0x4ce7dc,!![]];});});}})['spread'](function(_0x28c532,_0x5a2744){if(_0x28c532){_0x522485=_0x5a2744;if(!_0x5a2744){var _0xdd5baa={'from':(_0x47c2d2[_0x2a95('0x86')]['firstName']||'')+'\x20'+(_0x47c2d2[_0x2a95('0x86')][_0x2a95('0x88')]||'')};if(_0x39d41c[_0x2a95('0x59')]['threadId']&&_0x39d41c[_0x2a95('0x59')][_0x2a95('0x8d')]&&_0x39d41c[_0x2a95('0x59')][_0x2a95('0x89')]!=_0x39d41c[_0x2a95('0x59')][_0x2a95('0x8d')]){_0xdd5baa[_0x2a95('0x89')]=_0x39d41c[_0x2a95('0x59')][_0x2a95('0x8d')];}return _0x28c532[_0x2a95('0x33')](_0xdd5baa);}else{return _0x28c532;}}})['then'](function(_0x33fc50){_0x47c2d2['interaction']=_0x33fc50[_0x2a95('0x36')]({'plain':!![]});_0x47c2d2[_0x2a95('0x8e')][_0x2a95('0x8f')]=_0x522485;if(_0x47c2d2[_0x2a95('0x8e')]['created']){if(_0x47c2d2[_0x2a95('0x82')][_0x2a95('0x90')]){_0x47c2d2['applications'][_0x2a95('0x91')]({'id':0x0,'priority':_0x47c2d2[_0x2a95('0x83')][_0x2a95('0x49')]+0x1,'app':_0x2a95('0x92'),'appdata':_0x2a95('0x93'),'interval':_0x2a95('0x94')});}}return db['OpenchannelMessage'][_0x2a95('0x5e')]({'body':_0x39d41c[_0x2a95('0x59')][_0x2a95('0x59')],'OpenchannelAccountId':_0x39d41c[_0x2a95('0x57')]['id'],'OpenchannelInteractionId':_0x33fc50['id'],'direction':'in','ContactId':_0x47c2d2[_0x2a95('0x86')]['id'],'AttachmentId':_0x39d41c[_0x2a95('0x59')][_0x2a95('0x95')]});})[_0x2a95('0x35')](function(_0x442d28){_0x47c2d2['message']=_0x442d28;if(_0x47c2d2[_0x2a95('0x8e')]['UserId']){return db['User'][_0x2a95('0x58')]({'attributes':['id',_0x2a95('0x39')],'where':{'id':_0x47c2d2[_0x2a95('0x8e')][_0x2a95('0x96')]}})['then'](function(_0x39d935){if(_0x39d935){_0x47c2d2[_0x2a95('0x83')][_0x2a95('0x97')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x39d935[_0x2a95('0x39')]+','+(_0x47c2d2[_0x2a95('0x82')][_0x2a95('0x98')]||0xa),'interval':'*,*,*,*'});_0x47c2d2[_0x2a95('0x99')]=![];}return respondWithRpcPromise('Start',_0x2a95('0x9a'),_0x47c2d2);});}return respondWithRpcPromise(_0x2a95('0x9b'),'startRouting',_0x47c2d2);})[_0x2a95('0x35')](function(_0x34d08a){respondWithRpcPromise(_0x2a95('0x9c'),_0x2a95('0x9c'),{'event':'notify','message':_0x34d08a},client9002);return _0x34d08a;})['then'](respondWithResult(_0x1a89ac,null))[_0x2a95('0x27')](handleError(_0x1a89ac,null));};exports[_0x2a95('0x9d')]=function(_0x28c465,_0x2f01fe){var _0x5542ab=_0x28c465[_0x2a95('0x57')]['id'];var _0x5c580c=_0x28c465['body'];var _0xed058f=0xc8;var _0x4059c9=null;return db['sequelize'][_0x2a95('0x9e')]({'isolationLevel':db['sequelize'][_0x2a95('0x9f')][_0x2a95('0xa0')][_0x2a95('0xa1')]},function(_0x1d4fd8){return db[_0x2a95('0x51')][_0x2a95('0x64')]({'where':{'id':_0x5542ab},'transaction':_0x1d4fd8})[_0x2a95('0x35')](function(_0x51dc3f){if(_0x51dc3f){return db[_0x2a95('0xa2')][_0x2a95('0x34')]({'where':{'OpenchannelAccountId':_0x5542ab},'transaction':_0x1d4fd8})['then'](function(){var _0x3fabcd=_[_0x2a95('0x3e')](_0x5c580c,function(_0x1ebd5d){_0x1ebd5d['OpenchannelAccountId']=_0x5542ab;return _0x1ebd5d;});return db[_0x2a95('0xa2')][_0x2a95('0xa3')](_0x3fabcd,{'transaction':_0x1d4fd8});});}else{_0xed058f=0x194;_0x4059c9=[];}});})[_0x2a95('0x35')](function(){if(_0xed058f!==0x194){return db[_0x2a95('0xa2')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x5542ab},'order':_0x2a95('0xa4')})['then'](function(_0x513b73){_0x4059c9=_0x513b73;});}})['catch'](function(_0x2f61bc){_0xed058f=0x1f4;logger['error'](_0x2f61bc['stack']);if(_0x2f61bc[_0x2a95('0x39')]){delete _0x2f61bc[_0x2a95('0x39')];}_0x4059c9=_0x2f61bc;})[_0x2a95('0xa5')](function(){if(_0x4059c9===null){_0x2f01fe[_0x2a95('0x28')](_0xed058f);}else{if(_0xed058f===0x1f4){_0x2f01fe[_0x2a95('0x29')](_0xed058f)['send'](_0x4059c9);}else{_0x2f01fe[_0x2a95('0x29')](_0xed058f)[_0x2a95('0x2b')](_0x4059c9);}}});};exports[_0x2a95('0xa6')]=function(_0x28491f,_0x116d36,_0x548ca2){var _0x3e54f6={};var _0xaa60f9={};var _0x1fc21c;var _0x31d336;return db[_0x2a95('0x51')][_0x2a95('0x64')]({'where':{'id':_0x28491f['params']['id']}})['then'](handleEntityNotFound(_0x116d36,null))[_0x2a95('0x35')](function(_0x1f0954){if(_0x1f0954){_0x1fc21c=_0x1f0954;_0xaa60f9[_0x2a95('0x42')]=_[_0x2a95('0x44')](db[_0x2a95('0xa2')][_0x2a95('0x3f')]);_0xaa60f9[_0x2a95('0x43')]=_[_0x2a95('0x44')](_0x28491f[_0x2a95('0x43')]);_0xaa60f9[_0x2a95('0x45')]=_[_0x2a95('0x46')](_0xaa60f9['model'],_0xaa60f9[_0x2a95('0x43')]);_0x3e54f6[_0x2a95('0x47')]=_[_0x2a95('0x46')](_0xaa60f9[_0x2a95('0x42')],qs[_0x2a95('0x48')](_0x28491f['query']['fields']));_0x3e54f6['attributes']=_0x3e54f6[_0x2a95('0x47')][_0x2a95('0x49')]?_0x3e54f6[_0x2a95('0x47')]:_0xaa60f9['model'];_0x3e54f6['order']=qs[_0x2a95('0x4b')](_0x28491f[_0x2a95('0x43')]['sort']);_0x3e54f6['where']=qs['filters'](_[_0x2a95('0xa7')](_0x28491f[_0x2a95('0x43')],_0xaa60f9['filters']));if(_0x28491f[_0x2a95('0x43')][_0x2a95('0x4f')]){_0x3e54f6['where']=_[_0x2a95('0x4d')](_0x3e54f6[_0x2a95('0x4c')],{'$or':_['map'](_0x3e54f6[_0x2a95('0x47')],function(_0x2fe5b5){var _0x4dfefe={};_0x4dfefe[_0x2fe5b5]={'$like':'%'+_0x28491f['query'][_0x2a95('0x4f')]+'%'};return _0x4dfefe;})});}_0x3e54f6=_['merge']({},_0x3e54f6,_0x28491f[_0x2a95('0x50')]);return _0x1fc21c[_0x2a95('0xa6')](_0x3e54f6);}})[_0x2a95('0x35')](function(_0x5d6e41){if(_0x5d6e41){_0x31d336=_0x5d6e41['length'];if(!_0x28491f[_0x2a95('0x43')][_0x2a95('0x66')](_0x2a95('0x4a'))){_0x3e54f6[_0x2a95('0x2e')]=qs[_0x2a95('0x2e')](_0x28491f[_0x2a95('0x43')][_0x2a95('0x2e')]);_0x3e54f6[_0x2a95('0x2c')]=qs[_0x2a95('0x2c')](_0x28491f[_0x2a95('0x43')][_0x2a95('0x2c')]);}return _0x1fc21c[_0x2a95('0xa6')](_0x3e54f6);}})[_0x2a95('0x35')](function(_0x577e1e){if(_0x577e1e){return _0x577e1e?{'count':_0x31d336,'rows':_0x577e1e}:null;}})[_0x2a95('0x35')](respondWithResult(_0x116d36,null))[_0x2a95('0x27')](handleError(_0x116d36,null));};exports[_0x2a95('0xa8')]=function(_0x31a082,_0x6d5789,_0x405c54){var _0x3ff4c6={'raw':![],'where':{}};var _0x4ba718={};var _0x5aec0c={'count':0x0,'rows':[]};return db[_0x2a95('0x51')][_0x2a95('0x64')]({'where':{'id':_0x31a082[_0x2a95('0x57')]['id']}})['then'](handleEntityNotFound(_0x6d5789,null))[_0x2a95('0x35')](function(_0x3a14e8){if(_0x3a14e8){_0x4ba718[_0x2a95('0x42')]=_[_0x2a95('0x44')](db[_0x2a95('0x8a')][_0x2a95('0x3f')]);_0x4ba718[_0x2a95('0x43')]=_[_0x2a95('0x44')](_0x31a082[_0x2a95('0x43')]);_0x4ba718[_0x2a95('0x45')]=_[_0x2a95('0x46')](_0x4ba718[_0x2a95('0x42')],_0x4ba718['query']);_0x3ff4c6[_0x2a95('0x47')]=_[_0x2a95('0x46')](_0x4ba718['model'],qs['fields'](_0x31a082[_0x2a95('0x43')][_0x2a95('0x48')]));_0x3ff4c6['attributes']=_0x3ff4c6[_0x2a95('0x47')][_0x2a95('0x49')]?_0x3ff4c6[_0x2a95('0x47')]:_0x4ba718[_0x2a95('0x42')];if(!_0x31a082[_0x2a95('0x43')][_0x2a95('0x66')](_0x2a95('0x4a'))){_0x3ff4c6[_0x2a95('0x2e')]=qs[_0x2a95('0x2e')](_0x31a082[_0x2a95('0x43')][_0x2a95('0x2e')]);_0x3ff4c6['offset']=qs[_0x2a95('0x2c')](_0x31a082[_0x2a95('0x43')][_0x2a95('0x2c')]);}_0x3ff4c6[_0x2a95('0x67')]=qs[_0x2a95('0x4b')](_0x31a082[_0x2a95('0x43')][_0x2a95('0x4b')]);_0x3ff4c6[_0x2a95('0x4c')]=qs[_0x2a95('0x45')](_[_0x2a95('0xa7')](_0x31a082[_0x2a95('0x43')],_0x4ba718[_0x2a95('0x45')]));_0x3ff4c6[_0x2a95('0x4c')][_0x2a95('0x62')]=_0x3a14e8['id'];if(_0x31a082[_0x2a95('0x43')]['filter']){_0x3ff4c6[_0x2a95('0x4c')]=_[_0x2a95('0x4d')](_0x3ff4c6[_0x2a95('0x4c')],{'$or':_[_0x2a95('0x3e')](_0x3ff4c6[_0x2a95('0x47')],function(_0x293aa9){var _0x5475dd={};_0x5475dd[_0x293aa9]={'$like':'%'+_0x31a082[_0x2a95('0x43')]['filter']+'%'};return _0x5475dd;})});}_0x3ff4c6=_[_0x2a95('0x4d')]({},_0x3ff4c6,_0x31a082[_0x2a95('0x50')]);return db[_0x2a95('0x8a')]['count']({'where':_0x3ff4c6[_0x2a95('0x4c')]})[_0x2a95('0x35')](function(_0x364ed2){_0x5aec0c[_0x2a95('0x2f')]=_0x364ed2;if(_0x31a082[_0x2a95('0x43')][_0x2a95('0x52')]){_0x3ff4c6[_0x2a95('0x53')]=[{'model':db[_0x2a95('0x6d')],'as':_0x2a95('0xa9'),'required':![]},{'model':db['User'],'as':_0x2a95('0xaa'),'attributes':[_0x2a95('0x39'),_0x2a95('0xab'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x2a95('0xac'),'attributes':['id',_0x2a95('0x39'),_0x2a95('0xad')],'where':_0x31a082[_0x2a95('0x43')][_0x2a95('0xae')]?{'id':_0x31a082['query'][_0x2a95('0xae')]}:undefined,'required':_0x31a082['query'][_0x2a95('0xae')]?!![]:![]}];}return db[_0x2a95('0x8a')][_0x2a95('0x54')](_0x3ff4c6);})[_0x2a95('0x35')](function(_0x424803){_0x5aec0c[_0x2a95('0x55')]=_0x424803;return _0x5aec0c;});}})['then'](respondWithFilteredResult(_0x6d5789,_0x3ff4c6))['catch'](handleError(_0x6d5789,null));};exports[_0x2a95('0xaf')]=function(_0x2aab56,_0x686d27,_0x270e86){return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x2aab56[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x686d27,null))[_0x2a95('0x35')](function(_0x5eed24){if(_0x5eed24){return _0x5eed24[_0x2a95('0xaf')](_0x2aab56[_0x2a95('0x59')][_0x2a95('0xb0')],_[_0x2a95('0xb1')](_0x2aab56[_0x2a95('0x59')],[_0x2a95('0xb0'),'id'])||{})[_0x2a95('0xb2')](function(_0x50a81a){for(var _0x3fa1d1=0x0;_0x3fa1d1<_0x2aab56[_0x2a95('0x59')][_0x2a95('0xb0')][_0x2a95('0x49')];_0x3fa1d1+=0x1){socket[_0x2a95('0xb3')](_0x2a95('0xb4'),{'UserId':Number(_0x2aab56[_0x2a95('0x59')][_0x2a95('0xb0')][_0x3fa1d1]),'OpenchannelAccountId':Number(_0x2aab56['params']['id'])});}return _0x50a81a;});}})[_0x2a95('0x35')](respondWithResult(_0x686d27,null))[_0x2a95('0x27')](handleError(_0x686d27,null));};exports[_0x2a95('0xb5')]=function(_0x4966e9,_0x4dbe81,_0x22199a){return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x4966e9[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x4dbe81,null))[_0x2a95('0x35')](function(_0x9a41df){if(_0x9a41df){return _0x9a41df[_0x2a95('0xb5')](_0x4966e9[_0x2a95('0x43')][_0x2a95('0xb0')])[_0x2a95('0x35')](function(){if(_[_0x2a95('0xb6')](_0x4966e9[_0x2a95('0x43')]['ids'])){for(var _0x4a689e=0x0;_0x4a689e<_0x4966e9[_0x2a95('0x43')][_0x2a95('0xb0')][_0x2a95('0x49')];_0x4a689e+=0x1){socket[_0x2a95('0xb3')](_0x2a95('0xb7'),{'UserId':Number(_0x4966e9[_0x2a95('0x43')][_0x2a95('0xb0')][_0x4a689e]),'OpenchannelAccountId':Number(_0x4966e9['params']['id'])});}}else{socket[_0x2a95('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4966e9[_0x2a95('0x43')][_0x2a95('0xb0')]),'OpenchannelAccountId':Number(_0x4966e9[_0x2a95('0x57')]['id'])});}});}})[_0x2a95('0x35')](respondWithStatusCode(_0x4dbe81,null))[_0x2a95('0x27')](handleError(_0x4dbe81,null));};exports[_0x2a95('0xb8')]=function(_0x20e951,_0x560dc3,_0x3e2181){var _0xa6f365={};var _0x2fa8ec={};var _0x26da01;var _0x36936f;return db[_0x2a95('0x51')][_0x2a95('0x64')]({'where':{'id':_0x20e951[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x560dc3,null))[_0x2a95('0x35')](function(_0x1582be){if(_0x1582be){_0x26da01=_0x1582be;_0x2fa8ec[_0x2a95('0x42')]=_[_0x2a95('0x44')](db['User'][_0x2a95('0x3f')]);_0x2fa8ec[_0x2a95('0x43')]=_[_0x2a95('0x44')](_0x20e951[_0x2a95('0x43')]);_0x2fa8ec[_0x2a95('0x45')]=_[_0x2a95('0x46')](_0x2fa8ec['model'],_0x2fa8ec[_0x2a95('0x43')]);_0xa6f365['attributes']=_[_0x2a95('0x46')](_0x2fa8ec['model'],qs[_0x2a95('0x48')](_0x20e951[_0x2a95('0x43')]['fields']));_0xa6f365[_0x2a95('0x47')]=_0xa6f365[_0x2a95('0x47')]['length']?_0xa6f365[_0x2a95('0x47')]:_0x2fa8ec[_0x2a95('0x42')];_0xa6f365['order']=qs[_0x2a95('0x4b')](_0x20e951[_0x2a95('0x43')][_0x2a95('0x4b')]);_0xa6f365[_0x2a95('0x4c')]=qs[_0x2a95('0x45')](_['pick'](_0x20e951[_0x2a95('0x43')],_0x2fa8ec[_0x2a95('0x45')]));if(_0x20e951[_0x2a95('0x43')][_0x2a95('0x4f')]){_0xa6f365[_0x2a95('0x4c')]=_['merge'](_0xa6f365[_0x2a95('0x4c')],{'$or':_[_0x2a95('0x3e')](_0xa6f365[_0x2a95('0x47')],function(_0x2264c7){var _0x33ac1a={};_0x33ac1a[_0x2264c7]={'$like':'%'+_0x20e951[_0x2a95('0x43')]['filter']+'%'};return _0x33ac1a;})});}_0xa6f365=_[_0x2a95('0x4d')]({},_0xa6f365,_0x20e951['options']);return _0x26da01[_0x2a95('0xb8')](_0xa6f365);}})['then'](function(_0x38e2b5){if(_0x38e2b5){_0x36936f=_0x38e2b5[_0x2a95('0x49')];if(!_0x20e951[_0x2a95('0x43')][_0x2a95('0x66')]('nolimit')){_0xa6f365[_0x2a95('0x2e')]=qs[_0x2a95('0x2e')](_0x20e951['query']['limit']);_0xa6f365[_0x2a95('0x2c')]=qs[_0x2a95('0x2c')](_0x20e951[_0x2a95('0x43')][_0x2a95('0x2c')]);}return _0x26da01[_0x2a95('0xb8')](_0xa6f365);}})[_0x2a95('0x35')](function(_0x3a7ee7){if(_0x3a7ee7){return _0x3a7ee7?{'count':_0x36936f,'rows':_0x3a7ee7}:null;}})[_0x2a95('0x35')](respondWithResult(_0x560dc3,null))[_0x2a95('0x27')](handleError(_0x560dc3,null));};exports[_0x2a95('0x3a')]=function(_0x26809d,_0x29bc5c,_0x93ce05){var _0x5daf0e,_0x48a969,_0x3ae72d;if(_[_0x2a95('0x77')](_0x26809d['body'][_0x2a95('0x59')])||_0x26809d[_0x2a95('0x59')][_0x2a95('0x59')]===''){throw new db[(_0x2a95('0x6e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x26809d[_0x2a95('0x59')]['to'])){}_0x5daf0e=_0x26809d[_0x2a95('0x59')]['to'];return db[_0x2a95('0x51')][_0x2a95('0x64')]({'where':{'id':_0x26809d[_0x2a95('0x57')]['id']}})[_0x2a95('0x35')](handleEntityNotFound(_0x29bc5c,null))['then'](function(_0x3e19d6){if(_0x3e19d6){return db[_0x2a95('0x51')][_0x2a95('0x58')]({'where':{'id':_0x3e19d6['id']},'include':[{'model':db[_0x2a95('0x7d')],'as':_0x2a95('0x7e'),'include':[{'model':db['CmContact'],'as':_0x2a95('0x7f'),'where':{[_0x3e19d6[_0x2a95('0x79')]]:_0x5daf0e},'limit':0x1,'order':[[_0x2a95('0x72'),_0x2a95('0x80')]]}]}]})['then'](handleEntityNotFound(_0x29bc5c,null))[_0x2a95('0x35')](function(_0x325cd0){if(_0x325cd0&&_0x325cd0['List']){_0x48a969=_0x325cd0[_0x2a95('0x36')]({'plain':!![]});if(_0x48a969[_0x2a95('0x7e')]&&_0x48a969[_0x2a95('0x7e')][_0x2a95('0x7f')][_0x2a95('0x49')]){return _0x48a969[_0x2a95('0x7e')][_0x2a95('0x7f')][0x0];}return db[_0x2a95('0x6d')][_0x2a95('0x5e')](_[_0x2a95('0x15')](_0x26809d[_0x2a95('0x59')],{'firstName':_0x5daf0e,[_0x325cd0[_0x2a95('0x79')]]:_0x5daf0e,'phone':_0x5daf0e,'ListId':_0x48a969['ListId']}));}})['then'](handleEntityNotFound(_0x29bc5c,null))['then'](function(_0x2fa554){if(_0x2fa554){_0x3ae72d=_0x2fa554;return db[_0x2a95('0x8a')][_0x2a95('0x58')]({'where':{'ContactId':_0x3ae72d['id'],'closed':![],'OpenchannelAccountId':_0x48a969['id']}})[_0x2a95('0x35')](function(_0x121c6e){if(_0x121c6e){return[_0x121c6e,![]];}return db['OpenchannelInteraction'][_0x2a95('0x5e')]({'UserId':_0x26809d[_0x2a95('0x5a')]['id'],'ContactId':_0x3ae72d['id'],'OpenchannelAccountId':_0x48a969['id'],'lastMsgDirection':'out','firstMsgDirection':_0x2a95('0xb9'),'Messages':[_[_0x2a95('0x4d')](_0x26809d[_0x2a95('0x59')],{'read':![],'body':_0x26809d[_0x2a95('0x59')][_0x2a95('0x59')],'OpenchannelAccountId':_0x48a969['id'],'UserId':_0x26809d['user']['id'],'ContactId':_0x3ae72d['id']})]},{'include':[{'model':db[_0x2a95('0xba')],'as':_0x2a95('0xbb')}]})[_0x2a95('0x35')](function(_0xf52eb3){return[_0xf52eb3,!![]];});});}})[_0x2a95('0xb2')](function(_0x2d5fa2,_0x470617){if(_0x470617){return _0x2d5fa2;}return db['OpenchannelMessage'][_0x2a95('0x5e')](_[_0x2a95('0x4d')](_0x26809d[_0x2a95('0x59')],{'read':![],'body':_0x26809d['body'][_0x2a95('0x59')],'OpenchannelAccountId':_0x48a969['id'],'OpenchannelInteractionId':_0x2d5fa2['id'],'UserId':_0x26809d['user']['id'],'ContactId':_0x3ae72d['id']}))['then'](function(_0x1f8679){_0x2d5fa2[_0x2a95('0xbc')][_0x2a95('0xbb')]=[];_0x2d5fa2[_0x2a95('0xbc')][_0x2a95('0xbb')][_0x2a95('0x91')](_0x1f8679[_0x2a95('0xbc')]);return _0x2d5fa2;});});}})['then'](respondWithResult(_0x29bc5c,null))['catch'](handleError(_0x29bc5c,null));}; \ No newline at end of file +var _0x4322=['emit','getAgents','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','register','jayson/promise','http','client','request','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','include','findAll','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','account','Applications','list','applications','priority','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','OpenchannelMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray'];(function(_0x245d76,_0x1c2c6f){var _0x4516f7=function(_0x5e7c49){while(--_0x5e7c49){_0x245d76['push'](_0x245d76['shift']());}};_0x4516f7(++_0x1c2c6f);}(_0x4322,0x174));var _0x2432=function(_0x6ca1db,_0x569d05){_0x6ca1db=_0x6ca1db-0x0;var _0x5bcc1b=_0x4322[_0x6ca1db];return _0x5bcc1b;};'use strict';var emlformat=require(_0x2432('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2432('0x1'));var jsonpatch=require(_0x2432('0x2'));var rp=require(_0x2432('0x3'));var moment=require(_0x2432('0x4'));var BPromise=require(_0x2432('0x5'));var Mustache=require(_0x2432('0x6'));var util=require(_0x2432('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2432('0x8'));var fs=require('fs');var fs_extra=require(_0x2432('0x9'));var _=require('lodash');var squel=require(_0x2432('0xa'));var crypto=require(_0x2432('0xb'));var jsforce=require(_0x2432('0xc'));var deskjs=require(_0x2432('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2432('0xe'));var Redis=require('ioredis');var authService=require(_0x2432('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2432('0x10'));var hardwareService=require(_0x2432('0x11'));var logger=require(_0x2432('0x12'))(_0x2432('0x13'));var utils=require('../../config/utils');var config=require(_0x2432('0x14'));var licenseUtil=require(_0x2432('0x15'));var db=require('../../mysqldb')['db'];config[_0x2432('0x16')]=_[_0x2432('0x17')](config[_0x2432('0x16')],{'host':_0x2432('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2432('0x16')]));require('./openchannelAccount.socket')[_0x2432('0x19')](socket);var jayson=require(_0x2432('0x1a'));var client=jayson['client'][_0x2432('0x1b')]({'port':0x232c});var client9002=jayson[_0x2432('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab8e2,_0x49fbd,_0x354665,_0x335191){return new BPromise(function(_0x372f84,_0x5e0ffc){var _0x1e65ea=_0x335191||client;return _0x1e65ea[_0x2432('0x1d')](_0x3ab8e2,_0x354665)[_0x2432('0x1e')](function(_0x3fade9){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x49fbd,_0x2432('0x1f'));logger['debug'](_0x2432('0x20'),_0x49fbd,_0x2432('0x1f'),JSON[_0x2432('0x21')](_0x3fade9));if(_0x3fade9['error']){if(_0x3fade9['error'][_0x2432('0x22')]===0x1f4){logger[_0x2432('0x23')](_0x2432('0x24'),_0x49fbd,_0x3fade9['error'][_0x2432('0x25')]);return _0x5e0ffc(_0x3fade9[_0x2432('0x23')][_0x2432('0x25')]);}logger[_0x2432('0x23')](_0x2432('0x24'),_0x49fbd,_0x3fade9[_0x2432('0x23')][_0x2432('0x25')]);return _0x372f84(_0x3fade9[_0x2432('0x23')][_0x2432('0x25')]);}else{logger[_0x2432('0x26')](_0x2432('0x24'),_0x49fbd,'request\x20sent');_0x372f84(_0x3fade9[_0x2432('0x27')][_0x2432('0x25')]);}})[_0x2432('0x28')](function(_0x573f53){logger[_0x2432('0x23')](_0x2432('0x24'),_0x49fbd,_0x573f53);_0x5e0ffc(_0x573f53);});});}function respondWithStatusCode(_0xd7102b,_0x483f88){_0x483f88=_0x483f88||0xcc;return function(_0x50b559){if(_0x50b559){return _0xd7102b['sendStatus'](_0x483f88);}return _0xd7102b['status'](_0x483f88)['end']();};}function respondWithResult(_0x5913ee,_0x4270df){_0x4270df=_0x4270df||0xc8;return function(_0x1596ed){if(_0x1596ed){return _0x5913ee[_0x2432('0x29')](_0x4270df)['json'](_0x1596ed);}};}function respondWithFilteredResult(_0x5ae44a,_0x474ec8){return function(_0x533511){if(_0x533511){var _0x3e19be=typeof _0x474ec8[_0x2432('0x2a')]===_0x2432('0x2b')&&typeof _0x474ec8[_0x2432('0x2c')]==='undefined';var _0x309310=_0x533511[_0x2432('0x2d')];var _0x53eda4=_0x3e19be?0x0:_0x474ec8[_0x2432('0x2a')];var _0x141f44=_0x3e19be?_0x533511[_0x2432('0x2d')]:_0x474ec8[_0x2432('0x2a')]+_0x474ec8[_0x2432('0x2c')];var _0xd47467;if(_0x141f44>=_0x309310){_0x141f44=_0x309310;_0xd47467=0xc8;}else{_0xd47467=0xce;}_0x5ae44a[_0x2432('0x29')](_0xd47467);return _0x5ae44a[_0x2432('0x2e')](_0x2432('0x2f'),_0x53eda4+'-'+_0x141f44+'/'+_0x309310)[_0x2432('0x30')](_0x533511);}return null;};}function patchUpdates(_0x27c4f6){return function(_0x3c3a15){try{jsonpatch[_0x2432('0x31')](_0x3c3a15,_0x27c4f6,!![]);}catch(_0x3bdd4f){return BPromise[_0x2432('0x32')](_0x3bdd4f);}return _0x3c3a15[_0x2432('0x33')]();};}function saveUpdates(_0x3c3988,_0x17454b){return function(_0x3689dd){if(_0x3689dd){return _0x3689dd[_0x2432('0x34')](_0x3c3988)[_0x2432('0x1e')](function(_0x15e8d5){return _0x15e8d5;});}return null;};}function removeEntity(_0x1bd3a8,_0x2b1d54){return function(_0x48f790){if(_0x48f790){return _0x48f790[_0x2432('0x35')]()[_0x2432('0x1e')](function(){var _0x47b937=_0x48f790[_0x2432('0x36')]({'plain':!![]});var _0xe198d6=_0x2432('0x37');return db[_0x2432('0x38')][_0x2432('0x35')]({'where':{'type':_0xe198d6,'resourceId':_0x47b937['id']}})['then'](function(){return _0x48f790;});})[_0x2432('0x1e')](function(){_0x1bd3a8['status'](0xcc)[_0x2432('0x39')]();});}};}function handleEntityNotFound(_0x28f36d,_0xe19318){return function(_0x4a1125){if(!_0x4a1125){_0x28f36d[_0x2432('0x3a')](0x194);}return _0x4a1125;};}function handleError(_0x7c121,_0x53f63d){_0x53f63d=_0x53f63d||0x1f4;return function(_0x4fea89){logger[_0x2432('0x23')](_0x4fea89[_0x2432('0x3b')]);if(_0x4fea89[_0x2432('0x3c')]){delete _0x4fea89[_0x2432('0x3c')];}_0x7c121['status'](_0x53f63d)[_0x2432('0x3d')](_0x4fea89);};}exports[_0x2432('0x3e')]=function(_0x1c53ee,_0x890548){var _0x48ee56={'include':[{'model':db[_0x2432('0x3f')],'as':_0x2432('0x40')}]},_0x2a7ac1={},_0x1719f3={'count':0x0,'rows':[]};var _0x3b67d4=_['map'](db[_0x2432('0x41')]['rawAttributes'],function(_0x588a73){return{'name':_0x588a73['fieldName'],'type':_0x588a73[_0x2432('0x42')][_0x2432('0x43')]};});_0x2a7ac1[_0x2432('0x44')]=_[_0x2432('0x45')](_0x3b67d4,_0x2432('0x3c'));_0x2a7ac1[_0x2432('0x46')]=_[_0x2432('0x47')](_0x1c53ee[_0x2432('0x46')]);_0x2a7ac1[_0x2432('0x48')]=_[_0x2432('0x49')](_0x2a7ac1[_0x2432('0x44')],_0x2a7ac1['query']);_0x48ee56[_0x2432('0x4a')]=_['intersection'](_0x2a7ac1['model'],qs['fields'](_0x1c53ee['query'][_0x2432('0x4b')]));_0x48ee56[_0x2432('0x4a')]=_0x48ee56[_0x2432('0x4a')][_0x2432('0x4c')]?_0x48ee56[_0x2432('0x4a')]:_0x2a7ac1['model'];if(!_0x1c53ee[_0x2432('0x46')]['hasOwnProperty'](_0x2432('0x4d'))){_0x48ee56[_0x2432('0x2c')]=qs[_0x2432('0x2c')](_0x1c53ee['query'][_0x2432('0x2c')]);_0x48ee56[_0x2432('0x2a')]=qs[_0x2432('0x2a')](_0x1c53ee[_0x2432('0x46')][_0x2432('0x2a')]);}_0x48ee56[_0x2432('0x4e')]=qs[_0x2432('0x4f')](_0x1c53ee[_0x2432('0x46')][_0x2432('0x4f')]);_0x48ee56[_0x2432('0x50')]=qs['filters'](_[_0x2432('0x51')](_0x1c53ee['query'],_0x2a7ac1['filters']),_0x3b67d4);if(_0x1c53ee[_0x2432('0x46')][_0x2432('0x52')]){_0x48ee56[_0x2432('0x50')]=_[_0x2432('0x53')](_0x48ee56[_0x2432('0x50')],{'$or':_[_0x2432('0x45')](_0x3b67d4,function(_0x5cfb9a){if(_0x5cfb9a[_0x2432('0x42')]!==_0x2432('0x54')){var _0x29f99f={};_0x29f99f[_0x5cfb9a[_0x2432('0x3c')]]={'$like':'%'+_0x1c53ee[_0x2432('0x46')][_0x2432('0x52')]+'%'};return _0x29f99f;}})});}_0x48ee56=_['merge']({},_0x48ee56,_0x1c53ee[_0x2432('0x55')]);var _0x2432e3={'where':_0x48ee56[_0x2432('0x50')]};return db['OpenchannelAccount'][_0x2432('0x2d')](_0x2432e3)[_0x2432('0x1e')](function(_0x34803e){_0x1719f3[_0x2432('0x2d')]=_0x34803e;if(_0x1c53ee[_0x2432('0x46')][_0x2432('0x56')]){_0x48ee56['include']=[{'all':!![]}];}return db[_0x2432('0x41')]['findAll'](_0x48ee56);})[_0x2432('0x1e')](function(_0x38bb21){_0x1719f3[_0x2432('0x57')]=_0x38bb21;return _0x1719f3;})['then'](respondWithFilteredResult(_0x890548,_0x48ee56))[_0x2432('0x28')](handleError(_0x890548,null));};exports['show']=function(_0x29f732,_0x203d88){var _0x589afe={'raw':![],'where':{'id':_0x29f732[_0x2432('0x58')]['id']},'include':[{'model':db[_0x2432('0x3f')],'as':'mandatoryDispositionPause'}]},_0x105203={};_0x105203[_0x2432('0x44')]=_['keys'](db['OpenchannelAccount'][_0x2432('0x59')]);_0x105203['query']=_[_0x2432('0x47')](_0x29f732[_0x2432('0x46')]);_0x105203[_0x2432('0x48')]=_[_0x2432('0x49')](_0x105203[_0x2432('0x44')],_0x105203[_0x2432('0x46')]);_0x589afe['attributes']=_[_0x2432('0x49')](_0x105203['model'],qs[_0x2432('0x4b')](_0x29f732['query'][_0x2432('0x4b')]));_0x589afe['attributes']=_0x589afe[_0x2432('0x4a')][_0x2432('0x4c')]?_0x589afe[_0x2432('0x4a')]:_0x105203[_0x2432('0x44')];if(_0x29f732[_0x2432('0x46')][_0x2432('0x56')]){_0x589afe['include']=[{'all':!![]}];}_0x589afe=_[_0x2432('0x53')]({},_0x589afe,_0x29f732[_0x2432('0x55')]);return db[_0x2432('0x41')][_0x2432('0x5a')](_0x589afe)[_0x2432('0x1e')](handleEntityNotFound(_0x203d88,null))['then'](respondWithResult(_0x203d88,null))[_0x2432('0x28')](handleError(_0x203d88,null));};exports[_0x2432('0x5b')]=function(_0x1af8ad,_0x30db77){return db[_0x2432('0x41')][_0x2432('0x5b')](_0x1af8ad[_0x2432('0x5c')],{})['then'](function(_0x829f88){var _0x2b218e=_0x1af8ad[_0x2432('0x5d')][_0x2432('0x36')]({'plain':!![]});if(!_0x2b218e)throw new Error(_0x2432('0x5e'));if(_0x2b218e[_0x2432('0x5f')]===_0x2432('0x5d')){var _0x57cb0a=_0x829f88[_0x2432('0x36')]({'plain':!![]});var _0x29628f=_0x2432('0x37');return db['UserProfileSection'][_0x2432('0x5a')]({'where':{'name':_0x29628f,'userProfileId':_0x2b218e['userProfileId']},'raw':!![]})['then'](function(_0xfd1cb3){if(_0xfd1cb3&&_0xfd1cb3[_0x2432('0x60')]===0x0){return db[_0x2432('0x38')][_0x2432('0x5b')]({'name':_0x57cb0a['name'],'resourceId':_0x57cb0a['id'],'type':_0xfd1cb3[_0x2432('0x3c')],'sectionId':_0xfd1cb3['id']},{})[_0x2432('0x1e')](function(){return _0x829f88;});}else{return _0x829f88;}})[_0x2432('0x28')](function(_0x1f6d55){logger[_0x2432('0x23')](_0x2432('0x61'),_0x1f6d55);throw _0x1f6d55;});}return _0x829f88;})[_0x2432('0x1e')](respondWithResult(_0x30db77,0xc9))[_0x2432('0x28')](handleError(_0x30db77,null));};exports['update']=function(_0x94f16c,_0xf579a0){if(_0x94f16c[_0x2432('0x5c')]['id']){delete _0x94f16c[_0x2432('0x5c')]['id'];}return db[_0x2432('0x41')][_0x2432('0x5a')]({'where':{'id':_0x94f16c['params']['id']},'include':[{'model':db[_0x2432('0x3f')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xf579a0,null))[_0x2432('0x1e')](saveUpdates(_0x94f16c[_0x2432('0x5c')],null))[_0x2432('0x1e')](respondWithResult(_0xf579a0,null))['catch'](handleError(_0xf579a0,null));};exports[_0x2432('0x35')]=function(_0x26544f,_0x583896){return db[_0x2432('0x41')][_0x2432('0x5a')]({'where':{'id':_0x26544f[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x583896,null))[_0x2432('0x1e')](removeEntity(_0x583896,null))['catch'](handleError(_0x583896,null));};exports['describe']=function(_0x32a7f5,_0x1acd67){return db[_0x2432('0x41')][_0x2432('0x62')]()[_0x2432('0x1e')](respondWithResult(_0x1acd67,null))[_0x2432('0x28')](handleError(_0x1acd67,null));};exports[_0x2432('0x63')]=function(_0x52c15,_0x91d85,_0xd84b7a){if(_0x52c15['body']['id']){delete _0x52c15[_0x2432('0x5c')]['id'];}return db[_0x2432('0x41')][_0x2432('0x5a')]({'where':{'id':_0x52c15['params']['id']}})['then'](handleEntityNotFound(_0x91d85,null))[_0x2432('0x1e')](function(_0x504434){if(_0x504434){_0x52c15[_0x2432('0x5c')][_0x2432('0x64')]=_0x504434['id'];return db[_0x2432('0x65')][_0x2432('0x5b')](_0x52c15['body']);}})[_0x2432('0x1e')](respondWithResult(_0x91d85,null))['catch'](handleError(_0x91d85,null));};exports[_0x2432('0x66')]=function(_0x5bcc7d,_0xdc8bde,_0x38d7d1){var _0x4a7787={'raw':![],'where':{}};var _0x1570e9={};var _0x227bb4={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2432('0x67')]({'where':{'id':_0x5bcc7d['params']['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0xdc8bde,null))[_0x2432('0x1e')](function(_0x30a3eb){if(_0x30a3eb){_0x1570e9[_0x2432('0x44')]=_[_0x2432('0x47')](db[_0x2432('0x65')][_0x2432('0x59')]);_0x1570e9[_0x2432('0x46')]=_[_0x2432('0x47')](_0x5bcc7d[_0x2432('0x46')]);_0x1570e9[_0x2432('0x48')]=_[_0x2432('0x49')](_0x1570e9['model'],_0x1570e9[_0x2432('0x46')]);_0x4a7787[_0x2432('0x4a')]=_['intersection'](_0x1570e9[_0x2432('0x44')],qs['fields'](_0x5bcc7d['query']['fields']));_0x4a7787[_0x2432('0x4a')]=_0x4a7787['attributes'][_0x2432('0x4c')]?_0x4a7787[_0x2432('0x4a')]:_0x1570e9[_0x2432('0x44')];if(!_0x5bcc7d[_0x2432('0x46')][_0x2432('0x68')](_0x2432('0x4d'))){_0x4a7787[_0x2432('0x2c')]=qs['limit'](_0x5bcc7d[_0x2432('0x46')][_0x2432('0x2c')]);_0x4a7787[_0x2432('0x2a')]=qs['offset'](_0x5bcc7d['query']['offset']);}_0x4a7787[_0x2432('0x4e')]=qs[_0x2432('0x4f')](_0x5bcc7d[_0x2432('0x46')][_0x2432('0x4f')]);_0x4a7787[_0x2432('0x50')]=qs[_0x2432('0x48')](_[_0x2432('0x51')](_0x5bcc7d['query'],_0x1570e9['filters']));_0x4a7787[_0x2432('0x50')][_0x2432('0x64')]=_0x30a3eb['id'];if(_0x5bcc7d['query'][_0x2432('0x52')]){_0x4a7787['where']=_[_0x2432('0x53')](_0x4a7787[_0x2432('0x50')],{'$or':_[_0x2432('0x45')](_0x4a7787[_0x2432('0x4a')],function(_0xe2d2c2){var _0x44c946={};_0x44c946[_0xe2d2c2]={'$like':'%'+_0x5bcc7d['query'][_0x2432('0x52')]+'%'};return _0x44c946;})});}_0x4a7787=_[_0x2432('0x53')]({},_0x4a7787,_0x5bcc7d['options']);return db[_0x2432('0x65')]['count']({'where':_0x4a7787[_0x2432('0x50')]})[_0x2432('0x1e')](function(_0x186d7d){_0x227bb4[_0x2432('0x2d')]=_0x186d7d;if(_0x5bcc7d[_0x2432('0x46')][_0x2432('0x56')]){_0x4a7787[_0x2432('0x69')]=[{'all':!![]}];}return db['Disposition'][_0x2432('0x6a')](_0x4a7787);})['then'](function(_0x1f4ddb){_0x227bb4[_0x2432('0x57')]=_0x1f4ddb;return _0x227bb4;});}})['then'](respondWithFilteredResult(_0xdc8bde,_0x4a7787))['catch'](handleError(_0xdc8bde,null));};exports[_0x2432('0x6b')]=function(_0xce4439,_0x294db0,_0x439944){return db[_0x2432('0x41')][_0x2432('0x5a')]({'where':{'id':_0xce4439[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x294db0,null))[_0x2432('0x1e')](function(_0x5a4d3e){if(_0x5a4d3e){return _0x5a4d3e['removeDispositions'](_0xce4439['query']['ids']);}})[_0x2432('0x1e')](respondWithStatusCode(_0x294db0,null))[_0x2432('0x28')](handleError(_0x294db0,null));};exports['addAnswer']=function(_0x30a7e3,_0x54e41c,_0x584898){if(_0x30a7e3[_0x2432('0x5c')]['id']){delete _0x30a7e3[_0x2432('0x5c')]['id'];}return db['OpenchannelAccount'][_0x2432('0x5a')]({'where':{'id':_0x30a7e3[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x54e41c,null))['then'](function(_0x344759){if(_0x344759){_0x30a7e3['body'][_0x2432('0x64')]=_0x344759['id'];return db['CannedAnswer'][_0x2432('0x5b')](_0x30a7e3['body']);}})[_0x2432('0x1e')](respondWithResult(_0x54e41c,null))[_0x2432('0x28')](handleError(_0x54e41c,null));};exports[_0x2432('0x6c')]=function(_0x3eed07,_0x1d9876,_0x298b8a){var _0x5c3215={'raw':![],'where':{}};var _0x163966={};var _0x584514={'count':0x0,'rows':[]};return db[_0x2432('0x41')][_0x2432('0x67')]({'where':{'id':_0x3eed07[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x1d9876,null))['then'](function(_0x1b6523){if(_0x1b6523){_0x163966[_0x2432('0x44')]=_[_0x2432('0x47')](db[_0x2432('0x6d')]['rawAttributes']);_0x163966['query']=_[_0x2432('0x47')](_0x3eed07[_0x2432('0x46')]);_0x163966['filters']=_[_0x2432('0x49')](_0x163966[_0x2432('0x44')],_0x163966[_0x2432('0x46')]);_0x5c3215[_0x2432('0x4a')]=_[_0x2432('0x49')](_0x163966[_0x2432('0x44')],qs[_0x2432('0x4b')](_0x3eed07['query'][_0x2432('0x4b')]));_0x5c3215['attributes']=_0x5c3215['attributes'][_0x2432('0x4c')]?_0x5c3215[_0x2432('0x4a')]:_0x163966[_0x2432('0x44')];if(!_0x3eed07[_0x2432('0x46')]['hasOwnProperty'](_0x2432('0x4d'))){_0x5c3215[_0x2432('0x2c')]=qs[_0x2432('0x2c')](_0x3eed07[_0x2432('0x46')]['limit']);_0x5c3215[_0x2432('0x2a')]=qs[_0x2432('0x2a')](_0x3eed07[_0x2432('0x46')][_0x2432('0x2a')]);}_0x5c3215['order']=qs[_0x2432('0x4f')](_0x3eed07[_0x2432('0x46')][_0x2432('0x4f')]);_0x5c3215[_0x2432('0x50')]=qs['filters'](_[_0x2432('0x51')](_0x3eed07['query'],_0x163966['filters']));_0x5c3215[_0x2432('0x50')][_0x2432('0x64')]=_0x1b6523['id'];if(_0x3eed07[_0x2432('0x46')]['filter']){_0x5c3215[_0x2432('0x50')]=_[_0x2432('0x53')](_0x5c3215[_0x2432('0x50')],{'$or':_[_0x2432('0x45')](_0x5c3215['attributes'],function(_0x38403b){var _0x5d9039={};_0x5d9039[_0x38403b]={'$like':'%'+_0x3eed07['query']['filter']+'%'};return _0x5d9039;})});}_0x5c3215=_[_0x2432('0x53')]({},_0x5c3215,_0x3eed07[_0x2432('0x55')]);return db[_0x2432('0x6d')][_0x2432('0x2d')]({'where':_0x5c3215[_0x2432('0x50')]})['then'](function(_0x575961){_0x584514[_0x2432('0x2d')]=_0x575961;if(_0x3eed07['query'][_0x2432('0x56')]){_0x5c3215[_0x2432('0x69')]=[{'all':!![]}];}return db[_0x2432('0x6d')][_0x2432('0x6a')](_0x5c3215);})[_0x2432('0x1e')](function(_0x15daff){_0x584514[_0x2432('0x57')]=_0x15daff;return _0x584514;});}})[_0x2432('0x1e')](respondWithFilteredResult(_0x1d9876,_0x5c3215))[_0x2432('0x28')](handleError(_0x1d9876,null));};exports[_0x2432('0x6e')]=function(_0x3da787,_0x3f60e6,_0x509f1f){return db[_0x2432('0x41')]['find']({'where':{'id':_0x3da787[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x3f60e6,null))[_0x2432('0x1e')](function(_0xd480cb){if(_0xd480cb){return _0xd480cb[_0x2432('0x6e')](_0x3da787['query'][_0x2432('0x6f')]);}})['then'](respondWithStatusCode(_0x3f60e6,null))[_0x2432('0x28')](handleError(_0x3f60e6,null));};exports[_0x2432('0x70')]=function(_0x2fdc0b,_0x67bc0,_0x33750a){var _0x23749b={'body':_0x2fdc0b['body'],'channel':_0x2432('0x71')};var _0x37aa7f=[];var _0x1f2228=[];var _0x13d1c1={};var _0x4dc9ee=![];return db[_0x2432('0x72')][_0x2432('0x62')]()[_0x2432('0x1e')](function(_0x57ac8a){if(!_0x57ac8a){throw new db['Sequelize'][(_0x2432('0x73'))](_0x2432('0x74'));}_0x37aa7f=_[_0x2432('0x75')](_[_0x2432('0x47')](_0x57ac8a),[_0x2432('0x76'),_0x2432('0x77')]);_0x1f2228=_['difference'](_[_0x2432('0x47')](_0x57ac8a),['createdAt','updatedAt','CompanyId',_0x2432('0x78')]);if(_0x2fdc0b['body']['id']){delete _0x2fdc0b[_0x2432('0x5c')]['id'];}if(_[_0x2432('0x79')](_0x2fdc0b[_0x2432('0x5c')]['from'])){throw new db['Sequelize'][(_0x2432('0x73'))](_0x2432('0x7a'));}if(_[_0x2432('0x79')](_0x2fdc0b[_0x2432('0x5c')]['body'])||_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x5c')]===''){throw new db[(_0x2432('0x7b'))][(_0x2432('0x73'))](_0x2432('0x7c'));}if(_[_0x2432('0x79')](_0x2fdc0b['body']['mapKey'])){throw new db['Sequelize'][(_0x2432('0x73'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f2228);}if(!_['includes'](_0x1f2228,_0x2fdc0b['body'][_0x2432('0x7d')])){throw new db[(_0x2432('0x7b'))][(_0x2432('0x73'))](_0x2432('0x7e')+_0x1f2228);}_0x13d1c1[_0x2fdc0b[_0x2432('0x5c')]['mapKey']]=_0x2fdc0b['body'][_0x2432('0x7f')];})['then'](function(){return db[_0x2432('0x41')][_0x2432('0x5a')]({'where':{'id':_0x2fdc0b[_0x2432('0x58')]['id']},'include':[{'model':db[_0x2432('0x80')],'as':_0x2432('0x81'),'include':[{'model':db[_0x2432('0x72')],'as':_0x2432('0x82'),'where':_0x13d1c1,'limit':0x1,'order':[[_0x2432('0x77'),_0x2432('0x83')]]}]},{'model':db[_0x2432('0x84')],'as':'Applications'}]});})[_0x2432('0x1e')](handleEntityNotFound(_0x67bc0,null))[_0x2432('0x1e')](function(_0x13f591){if(_0x13f591&&_0x13f591['List']){_0x23749b[_0x2432('0x85')]=_0x13f591;_0x23749b['applications']=_0x13f591[_0x2432('0x86')];_0x23749b[_0x2432('0x87')]=_0x13f591[_0x2432('0x81')];_0x23749b[_0x2432('0x88')]=_['orderBy'](_0x23749b['applications'],[_0x2432('0x89')],['asc']);if(_0x23749b['account']['Applications']){delete _0x23749b[_0x2432('0x85')]['Applications'];}if(_0x23749b[_0x2432('0x85')][_0x2432('0x81')]&&_0x23749b[_0x2432('0x85')][_0x2432('0x81')][_0x2432('0x82')][_0x2432('0x4c')]){return _0x23749b[_0x2432('0x85')]['List'][_0x2432('0x82')][0x0];}var _0xda5ebd=_['defaults'](_0x2fdc0b[_0x2432('0x5c')],{'firstName':_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x7f')],'ListId':_0x13f591[_0x2432('0x78')]});_0xda5ebd[_0x2fdc0b['body'][_0x2432('0x7d')]]=_0x2fdc0b[_0x2432('0x5c')]['from'];return db[_0x2432('0x72')][_0x2432('0x5b')](_0xda5ebd,{'fields':_0x37aa7f,'raw':!![]});}})[_0x2432('0x1e')](handleEntityNotFound(_0x67bc0,null))['then'](function(_0x4009b8){_0x23749b[_0x2432('0x8a')]=_0x4009b8;if(_0x4009b8){var _0xa94d92={'ContactId':_0x4009b8['id'],'OpenchannelAccountId':_0x2fdc0b[_0x2432('0x58')]['id'],'from':(_0x4009b8[_0x2432('0x8b')]||'')+'\x20'+(_0x4009b8[_0x2432('0x8c')]||'')};var _0x2563aa={'OpenchannelAccountId':_0x2fdc0b[_0x2432('0x58')]['id'],'closed':![]};if(_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x8d')]){_0x2563aa[_0x2432('0x8d')]=_0x2fdc0b[_0x2432('0x5c')]['threadId'];return db[_0x2432('0x8e')][_0x2432('0x5a')]({'where':_0x2563aa})[_0x2432('0x1e')](function(_0x1c7d3d){if(_0x1c7d3d){return[_0x1c7d3d,![]];}_0xa94d92[_0x2432('0x8d')]=_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x8d')];_0xa94d92[_0x2432('0x8f')]=_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x8f')];return db[_0x2432('0x8e')][_0x2432('0x5b')](_0xa94d92)[_0x2432('0x1e')](function(_0x188e29){return[_0x188e29,!![]];});});}else{_0x2563aa['threadId']=null;}_0x2563aa[_0x2432('0x90')]=_0x4009b8['id'];return db[_0x2432('0x8e')][_0x2432('0x5a')]({'where':_0x2563aa})[_0x2432('0x1e')](function(_0x48d511){if(_0x48d511){return[_0x48d511,![]];}return db['OpenchannelInteraction'][_0x2432('0x5b')](_0xa94d92)[_0x2432('0x1e')](function(_0x32a38c){return[_0x32a38c,!![]];});});}})[_0x2432('0x91')](function(_0x54af52,_0x14c60d){if(_0x54af52){_0x4dc9ee=_0x14c60d;if(!_0x14c60d){var _0x2ce1d8={'from':(_0x23749b[_0x2432('0x8a')]['firstName']||'')+'\x20'+(_0x23749b['contact'][_0x2432('0x8c')]||'')};if(_0x2fdc0b[_0x2432('0x5c')]['threadId']&&_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x92')]&&_0x2fdc0b[_0x2432('0x5c')]['threadId']!=_0x2fdc0b['body'][_0x2432('0x92')]){_0x2ce1d8[_0x2432('0x8d')]=_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x92')];}return _0x54af52[_0x2432('0x34')](_0x2ce1d8);}else{return _0x54af52;}}})[_0x2432('0x1e')](function(_0x145eae){_0x23749b[_0x2432('0x93')]=_0x145eae['get']({'plain':!![]});_0x23749b[_0x2432('0x93')][_0x2432('0x94')]=_0x4dc9ee;if(_0x23749b[_0x2432('0x93')][_0x2432('0x94')]){if(_0x23749b[_0x2432('0x85')][_0x2432('0x95')]){_0x23749b['applications'][_0x2432('0x96')]({'id':0x0,'priority':_0x23749b[_0x2432('0x88')][_0x2432('0x4c')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x2432('0x97')][_0x2432('0x5b')]({'body':_0x2fdc0b[_0x2432('0x5c')][_0x2432('0x5c')],'OpenchannelAccountId':_0x2fdc0b[_0x2432('0x58')]['id'],'OpenchannelInteractionId':_0x145eae['id'],'direction':'in','ContactId':_0x23749b[_0x2432('0x8a')]['id'],'AttachmentId':_0x2fdc0b['body'][_0x2432('0x98')]});})[_0x2432('0x1e')](function(_0xd4ab9c){_0x23749b[_0x2432('0x25')]=_0xd4ab9c;if(_0x23749b[_0x2432('0x93')][_0x2432('0x99')]){return db[_0x2432('0x9a')][_0x2432('0x5a')]({'attributes':['id',_0x2432('0x3c')],'where':{'id':_0x23749b[_0x2432('0x93')][_0x2432('0x99')]}})[_0x2432('0x1e')](function(_0x1104cf){if(_0x1104cf){_0x23749b[_0x2432('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1104cf[_0x2432('0x3c')]+','+(_0x23749b[_0x2432('0x85')][_0x2432('0x9b')]||0xa),'interval':'*,*,*,*'});_0x23749b[_0x2432('0x9c')]=![];}return respondWithRpcPromise(_0x2432('0x9d'),'startRouting',_0x23749b);});}return respondWithRpcPromise(_0x2432('0x9d'),_0x2432('0x9e'),_0x23749b);})[_0x2432('0x1e')](function(_0x536c3b){respondWithRpcPromise(_0x2432('0x9f'),_0x2432('0x9f'),{'event':_0x2432('0x70'),'message':_0x536c3b},client9002);return _0x536c3b;})[_0x2432('0x1e')](respondWithResult(_0x67bc0,null))[_0x2432('0x28')](handleError(_0x67bc0,null));};exports['addApplications']=function(_0x36bac6,_0x54cd80){var _0x58441f=_0x36bac6['params']['id'];var _0x357f07=_0x36bac6[_0x2432('0x5c')];var _0x5f43b0=0xc8;var _0x40004d=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2432('0xa0')][_0x2432('0xa1')][_0x2432('0xa2')]['READ_COMMITTED']},function(_0x2b33c2){return db[_0x2432('0x41')][_0x2432('0x67')]({'where':{'id':_0x58441f},'transaction':_0x2b33c2})[_0x2432('0x1e')](function(_0x505eba){if(_0x505eba){return db[_0x2432('0x84')][_0x2432('0x35')]({'where':{'OpenchannelAccountId':_0x58441f},'transaction':_0x2b33c2})[_0x2432('0x1e')](function(){var _0xa1d787=_['map'](_0x357f07,function(_0x55dac4){_0x55dac4['OpenchannelAccountId']=_0x58441f;return _0x55dac4;});return db[_0x2432('0x84')][_0x2432('0xa3')](_0xa1d787,{'transaction':_0x2b33c2});});}else{_0x5f43b0=0x194;_0x40004d=[];}});})['then'](function(){if(_0x5f43b0!==0x194){return db[_0x2432('0x84')][_0x2432('0xa4')]({'where':{'OpenchannelAccountId':_0x58441f},'order':_0x2432('0x89')})['then'](function(_0x16c101){_0x40004d=_0x16c101;});}})['catch'](function(_0x50420f){_0x5f43b0=0x1f4;logger[_0x2432('0x23')](_0x50420f[_0x2432('0x3b')]);if(_0x50420f[_0x2432('0x3c')]){delete _0x50420f[_0x2432('0x3c')];}_0x40004d=_0x50420f;})[_0x2432('0xa5')](function(){if(_0x40004d===null){_0x54cd80[_0x2432('0x3a')](_0x5f43b0);}else{if(_0x5f43b0===0x1f4){_0x54cd80[_0x2432('0x29')](_0x5f43b0)[_0x2432('0x3d')](_0x40004d);}else{_0x54cd80[_0x2432('0x29')](_0x5f43b0)['json'](_0x40004d);}}});};exports[_0x2432('0xa6')]=function(_0x22c7c2,_0x2d5e26,_0x527e83){var _0x55cf9a={};var _0x43de73={};var _0x2d8664;var _0xb53834;return db[_0x2432('0x41')]['findOne']({'where':{'id':_0x22c7c2[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x2d5e26,null))[_0x2432('0x1e')](function(_0x1bb41f){if(_0x1bb41f){_0x2d8664=_0x1bb41f;_0x43de73[_0x2432('0x44')]=_[_0x2432('0x47')](db[_0x2432('0x84')][_0x2432('0x59')]);_0x43de73[_0x2432('0x46')]=_[_0x2432('0x47')](_0x22c7c2[_0x2432('0x46')]);_0x43de73['filters']=_[_0x2432('0x49')](_0x43de73[_0x2432('0x44')],_0x43de73['query']);_0x55cf9a[_0x2432('0x4a')]=_[_0x2432('0x49')](_0x43de73[_0x2432('0x44')],qs[_0x2432('0x4b')](_0x22c7c2[_0x2432('0x46')][_0x2432('0x4b')]));_0x55cf9a[_0x2432('0x4a')]=_0x55cf9a['attributes'][_0x2432('0x4c')]?_0x55cf9a[_0x2432('0x4a')]:_0x43de73[_0x2432('0x44')];_0x55cf9a['order']=qs['sort'](_0x22c7c2[_0x2432('0x46')][_0x2432('0x4f')]);_0x55cf9a[_0x2432('0x50')]=qs['filters'](_[_0x2432('0x51')](_0x22c7c2[_0x2432('0x46')],_0x43de73[_0x2432('0x48')]));if(_0x22c7c2[_0x2432('0x46')][_0x2432('0x52')]){_0x55cf9a[_0x2432('0x50')]=_['merge'](_0x55cf9a['where'],{'$or':_[_0x2432('0x45')](_0x55cf9a['attributes'],function(_0x3d8d60){var _0x333d4a={};_0x333d4a[_0x3d8d60]={'$like':'%'+_0x22c7c2[_0x2432('0x46')][_0x2432('0x52')]+'%'};return _0x333d4a;})});}_0x55cf9a=_[_0x2432('0x53')]({},_0x55cf9a,_0x22c7c2[_0x2432('0x55')]);return _0x2d8664[_0x2432('0xa6')](_0x55cf9a);}})[_0x2432('0x1e')](function(_0xc1c7e){if(_0xc1c7e){_0xb53834=_0xc1c7e[_0x2432('0x4c')];if(!_0x22c7c2[_0x2432('0x46')][_0x2432('0x68')](_0x2432('0x4d'))){_0x55cf9a['limit']=qs[_0x2432('0x2c')](_0x22c7c2['query'][_0x2432('0x2c')]);_0x55cf9a[_0x2432('0x2a')]=qs[_0x2432('0x2a')](_0x22c7c2['query'][_0x2432('0x2a')]);}return _0x2d8664[_0x2432('0xa6')](_0x55cf9a);}})[_0x2432('0x1e')](function(_0x1db49f){if(_0x1db49f){return _0x1db49f?{'count':_0xb53834,'rows':_0x1db49f}:null;}})[_0x2432('0x1e')](respondWithResult(_0x2d5e26,null))['catch'](handleError(_0x2d5e26,null));};exports[_0x2432('0xa7')]=function(_0x1f71aa,_0x230ada,_0x36413f){var _0x571ffb={'raw':![],'where':{}};var _0x39a82d={};var _0x33bbe3={'count':0x0,'rows':[]};return db[_0x2432('0x41')]['findOne']({'where':{'id':_0x1f71aa[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x230ada,null))[_0x2432('0x1e')](function(_0x5cf9ad){if(_0x5cf9ad){_0x39a82d['model']=_[_0x2432('0x47')](db['OpenchannelInteraction']['rawAttributes']);_0x39a82d[_0x2432('0x46')]=_[_0x2432('0x47')](_0x1f71aa[_0x2432('0x46')]);_0x39a82d[_0x2432('0x48')]=_['intersection'](_0x39a82d[_0x2432('0x44')],_0x39a82d[_0x2432('0x46')]);_0x571ffb[_0x2432('0x4a')]=_[_0x2432('0x49')](_0x39a82d[_0x2432('0x44')],qs[_0x2432('0x4b')](_0x1f71aa[_0x2432('0x46')][_0x2432('0x4b')]));_0x571ffb[_0x2432('0x4a')]=_0x571ffb['attributes'][_0x2432('0x4c')]?_0x571ffb[_0x2432('0x4a')]:_0x39a82d['model'];if(!_0x1f71aa[_0x2432('0x46')]['hasOwnProperty'](_0x2432('0x4d'))){_0x571ffb[_0x2432('0x2c')]=qs[_0x2432('0x2c')](_0x1f71aa[_0x2432('0x46')]['limit']);_0x571ffb[_0x2432('0x2a')]=qs[_0x2432('0x2a')](_0x1f71aa['query']['offset']);}_0x571ffb['order']=qs[_0x2432('0x4f')](_0x1f71aa[_0x2432('0x46')][_0x2432('0x4f')]);_0x571ffb[_0x2432('0x50')]=qs['filters'](_[_0x2432('0x51')](_0x1f71aa[_0x2432('0x46')],_0x39a82d[_0x2432('0x48')]));_0x571ffb[_0x2432('0x50')]['OpenchannelAccountId']=_0x5cf9ad['id'];if(_0x1f71aa['query'][_0x2432('0x52')]){_0x571ffb[_0x2432('0x50')]=_[_0x2432('0x53')](_0x571ffb[_0x2432('0x50')],{'$or':_[_0x2432('0x45')](_0x571ffb['attributes'],function(_0x590d83){var _0x39f8c2={};_0x39f8c2[_0x590d83]={'$like':'%'+_0x1f71aa[_0x2432('0x46')]['filter']+'%'};return _0x39f8c2;})});}_0x571ffb=_[_0x2432('0x53')]({},_0x571ffb,_0x1f71aa[_0x2432('0x55')]);return db[_0x2432('0x8e')]['count']({'where':_0x571ffb[_0x2432('0x50')]})[_0x2432('0x1e')](function(_0x5cd216){_0x33bbe3[_0x2432('0x2d')]=_0x5cd216;if(_0x1f71aa['query'][_0x2432('0x56')]){_0x571ffb[_0x2432('0x69')]=[{'model':db[_0x2432('0x72')],'as':_0x2432('0xa8'),'required':![]},{'model':db[_0x2432('0x9a')],'as':_0x2432('0xa9'),'attributes':[_0x2432('0x3c'),_0x2432('0xaa'),_0x2432('0xab')],'required':![]},{'model':db['Tag'],'as':_0x2432('0xac'),'attributes':['id','name',_0x2432('0xad')],'where':_0x1f71aa[_0x2432('0x46')]['tag']?{'id':_0x1f71aa[_0x2432('0x46')][_0x2432('0xae')]}:undefined,'required':_0x1f71aa[_0x2432('0x46')]['tag']?!![]:![]}];}return db[_0x2432('0x8e')][_0x2432('0x6a')](_0x571ffb);})[_0x2432('0x1e')](function(_0x2242cf){_0x33bbe3[_0x2432('0x57')]=_0x2242cf;return _0x33bbe3;});}})[_0x2432('0x1e')](respondWithFilteredResult(_0x230ada,_0x571ffb))[_0x2432('0x28')](handleError(_0x230ada,null));};exports[_0x2432('0xaf')]=function(_0x56d11c,_0x2f3b4e,_0x463cda){return db[_0x2432('0x41')][_0x2432('0x5a')]({'where':{'id':_0x56d11c[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x2f3b4e,null))[_0x2432('0x1e')](function(_0x553ad1){if(_0x553ad1){return _0x553ad1['addAgents'](_0x56d11c['body']['ids'],_[_0x2432('0xb0')](_0x56d11c['body'],[_0x2432('0x6f'),'id'])||{})['spread'](function(_0x2f1b66){for(var _0x4c34d7=0x0;_0x4c34d7<_0x56d11c['body']['ids'][_0x2432('0x4c')];_0x4c34d7+=0x1){socket['emit'](_0x2432('0xb1'),{'UserId':Number(_0x56d11c[_0x2432('0x5c')][_0x2432('0x6f')][_0x4c34d7]),'OpenchannelAccountId':Number(_0x56d11c['params']['id'])});}return _0x2f1b66;});}})['then'](respondWithResult(_0x2f3b4e,null))['catch'](handleError(_0x2f3b4e,null));};exports['removeAgents']=function(_0x4e2708,_0x436a1f,_0x3db44f){return db[_0x2432('0x41')]['find']({'where':{'id':_0x4e2708[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x436a1f,null))['then'](function(_0x14960e){if(_0x14960e){return _0x14960e[_0x2432('0xb2')](_0x4e2708[_0x2432('0x46')][_0x2432('0x6f')])[_0x2432('0x1e')](function(){if(_[_0x2432('0xb3')](_0x4e2708[_0x2432('0x46')][_0x2432('0x6f')])){for(var _0x41fbef=0x0;_0x41fbef<_0x4e2708[_0x2432('0x46')][_0x2432('0x6f')][_0x2432('0x4c')];_0x41fbef+=0x1){socket[_0x2432('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4e2708['query'][_0x2432('0x6f')][_0x41fbef]),'OpenchannelAccountId':Number(_0x4e2708[_0x2432('0x58')]['id'])});}}else{socket[_0x2432('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4e2708[_0x2432('0x46')][_0x2432('0x6f')]),'OpenchannelAccountId':Number(_0x4e2708[_0x2432('0x58')]['id'])});}});}})[_0x2432('0x1e')](respondWithStatusCode(_0x436a1f,null))[_0x2432('0x28')](handleError(_0x436a1f,null));};exports[_0x2432('0xb5')]=function(_0x46b69a,_0x4d3c85,_0x1c6dcb){var _0x566afa={};var _0x116bbb={};var _0x221b33;var _0x244131;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x46b69a[_0x2432('0x58')]['id']}})['then'](handleEntityNotFound(_0x4d3c85,null))['then'](function(_0x16b7b7){if(_0x16b7b7){_0x221b33=_0x16b7b7;_0x116bbb[_0x2432('0x44')]=_['keys'](db[_0x2432('0x9a')][_0x2432('0x59')]);_0x116bbb[_0x2432('0x46')]=_[_0x2432('0x47')](_0x46b69a['query']);_0x116bbb[_0x2432('0x48')]=_[_0x2432('0x49')](_0x116bbb[_0x2432('0x44')],_0x116bbb[_0x2432('0x46')]);_0x566afa['attributes']=_[_0x2432('0x49')](_0x116bbb['model'],qs[_0x2432('0x4b')](_0x46b69a[_0x2432('0x46')][_0x2432('0x4b')]));_0x566afa[_0x2432('0x4a')]=_0x566afa[_0x2432('0x4a')][_0x2432('0x4c')]?_0x566afa[_0x2432('0x4a')]:_0x116bbb[_0x2432('0x44')];_0x566afa['order']=qs[_0x2432('0x4f')](_0x46b69a['query'][_0x2432('0x4f')]);_0x566afa['where']=qs[_0x2432('0x48')](_[_0x2432('0x51')](_0x46b69a[_0x2432('0x46')],_0x116bbb[_0x2432('0x48')]));if(_0x46b69a[_0x2432('0x46')][_0x2432('0x52')]){_0x566afa[_0x2432('0x50')]=_['merge'](_0x566afa[_0x2432('0x50')],{'$or':_[_0x2432('0x45')](_0x566afa[_0x2432('0x4a')],function(_0x4276b8){var _0x119b1b={};_0x119b1b[_0x4276b8]={'$like':'%'+_0x46b69a[_0x2432('0x46')][_0x2432('0x52')]+'%'};return _0x119b1b;})});}_0x566afa=_[_0x2432('0x53')]({},_0x566afa,_0x46b69a[_0x2432('0x55')]);return _0x221b33[_0x2432('0xb5')](_0x566afa);}})[_0x2432('0x1e')](function(_0x98ab8f){if(_0x98ab8f){_0x244131=_0x98ab8f['length'];if(!_0x46b69a[_0x2432('0x46')][_0x2432('0x68')](_0x2432('0x4d'))){_0x566afa[_0x2432('0x2c')]=qs[_0x2432('0x2c')](_0x46b69a[_0x2432('0x46')]['limit']);_0x566afa['offset']=qs['offset'](_0x46b69a[_0x2432('0x46')][_0x2432('0x2a')]);}return _0x221b33[_0x2432('0xb5')](_0x566afa);}})[_0x2432('0x1e')](function(_0x1da955){if(_0x1da955){return _0x1da955?{'count':_0x244131,'rows':_0x1da955}:null;}})[_0x2432('0x1e')](respondWithResult(_0x4d3c85,null))['catch'](handleError(_0x4d3c85,null));};exports[_0x2432('0x3d')]=function(_0x18ceb5,_0x1d9346,_0x113c7c){var _0x50b2fe,_0x4cac2f,_0xcc1ab5;if(_[_0x2432('0x79')](_0x18ceb5[_0x2432('0x5c')]['body'])||_0x18ceb5[_0x2432('0x5c')][_0x2432('0x5c')]===''){throw new db[(_0x2432('0x7b'))][(_0x2432('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2432('0x79')](_0x18ceb5['body']['to'])){}_0x50b2fe=_0x18ceb5[_0x2432('0x5c')]['to'];return db[_0x2432('0x41')][_0x2432('0x67')]({'where':{'id':_0x18ceb5[_0x2432('0x58')]['id']}})[_0x2432('0x1e')](handleEntityNotFound(_0x1d9346,null))[_0x2432('0x1e')](function(_0x270173){if(_0x270173){return db[_0x2432('0x41')][_0x2432('0x5a')]({'where':{'id':_0x270173['id']},'include':[{'model':db[_0x2432('0x80')],'as':_0x2432('0x81'),'include':[{'model':db[_0x2432('0x72')],'as':'Contacts','where':{[_0x270173[_0x2432('0x7d')]]:_0x50b2fe},'limit':0x1,'order':[[_0x2432('0x77'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1d9346,null))[_0x2432('0x1e')](function(_0x2e9db3){if(_0x2e9db3&&_0x2e9db3[_0x2432('0x81')]){_0x4cac2f=_0x2e9db3['get']({'plain':!![]});if(_0x4cac2f[_0x2432('0x81')]&&_0x4cac2f[_0x2432('0x81')]['Contacts']['length']){return _0x4cac2f['List'][_0x2432('0x82')][0x0];}return db[_0x2432('0x72')][_0x2432('0x5b')](_[_0x2432('0x17')](_0x18ceb5['body'],{'firstName':_0x50b2fe,[_0x2e9db3[_0x2432('0x7d')]]:_0x50b2fe,'phone':_0x50b2fe,'ListId':_0x4cac2f[_0x2432('0x78')]}));}})[_0x2432('0x1e')](handleEntityNotFound(_0x1d9346,null))[_0x2432('0x1e')](function(_0x4100ba){if(_0x4100ba){_0xcc1ab5=_0x4100ba;return db[_0x2432('0x8e')][_0x2432('0x5a')]({'where':{'ContactId':_0xcc1ab5['id'],'closed':![],'OpenchannelAccountId':_0x4cac2f['id']}})[_0x2432('0x1e')](function(_0xd7acbb){if(_0xd7acbb){return[_0xd7acbb,![]];}return db[_0x2432('0x8e')][_0x2432('0x5b')]({'UserId':_0x18ceb5['user']['id'],'ContactId':_0xcc1ab5['id'],'OpenchannelAccountId':_0x4cac2f['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_[_0x2432('0x53')](_0x18ceb5['body'],{'read':![],'body':_0x18ceb5[_0x2432('0x5c')][_0x2432('0x5c')],'OpenchannelAccountId':_0x4cac2f['id'],'UserId':_0x18ceb5['user']['id'],'ContactId':_0xcc1ab5['id']})]},{'include':[{'model':db[_0x2432('0x97')],'as':_0x2432('0xb6')}]})[_0x2432('0x1e')](function(_0x4add6f){return[_0x4add6f,!![]];});});}})[_0x2432('0x91')](function(_0x33528f,_0x42aadb){if(_0x42aadb){return _0x33528f;}return db['OpenchannelMessage'][_0x2432('0x5b')](_['merge'](_0x18ceb5['body'],{'read':![],'body':_0x18ceb5[_0x2432('0x5c')][_0x2432('0x5c')],'OpenchannelAccountId':_0x4cac2f['id'],'OpenchannelInteractionId':_0x33528f['id'],'UserId':_0x18ceb5[_0x2432('0x5d')]['id'],'ContactId':_0xcc1ab5['id']}))[_0x2432('0x1e')](function(_0x5120fc){_0x33528f[_0x2432('0xb7')][_0x2432('0xb6')]=[];_0x33528f[_0x2432('0xb7')]['Messages'][_0x2432('0x96')](_0x5120fc[_0x2432('0xb7')]);return _0x33528f;});});}})[_0x2432('0x1e')](respondWithResult(_0x1d9346,null))[_0x2432('0x28')](handleError(_0x1d9346,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 2eb7f2f..4afa199 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 _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x668b,0x140));var _0xb668=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x668b[_0x5e6bec];return _0x5dc5cf;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x54ef=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update'];(function(_0x51ceb9,_0x121770){var _0x500977=function(_0x229d5f){while(--_0x229d5f){_0x51ceb9['push'](_0x51ceb9['shift']());}};_0x500977(++_0x121770);}(_0x54ef,0x112));var _0xf54e=function(_0x4e76e7,_0x31117c){_0x4e76e7=_0x4e76e7-0x0;var _0x49958f=_0x54ef[_0x4e76e7];return _0x49958f;};'use strict';var EventEmitter=require(_0xf54e('0x0'));var OpenchannelAccount=require(_0xf54e('0x1'))['db'][_0xf54e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf54e('0x3'),'afterUpdate':_0xf54e('0x4'),'afterDestroy':_0xf54e('0x5')};function emitEvent(_0x42b9b2){return function(_0x8b6bb6,_0x431e36,_0x12d43f){OpenchannelAccountEvents['emit'](_0x42b9b2+':'+_0x8b6bb6['id'],_0x8b6bb6);OpenchannelAccountEvents['emit'](_0x42b9b2,_0x8b6bb6);_0x12d43f(null);};}for(var e in events){if(events[_0xf54e('0x6')](e)){var event=events[e];OpenchannelAccount[_0xf54e('0x7')](e,emitEvent(event));}}module[_0xf54e('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b91f724..aaadf38 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(_0x338461,_0x51c4e4){var _0x383a8e=function(_0x37d74c){while(--_0x37d74c){_0x338461['push'](_0x338461['shift']());}};_0x383a8e(++_0x51c4e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0xe21e56,_0x3b9948){var _0x5e1e13=function(_0x1166bc){while(--_0x1166bc){_0xe21e56['push'](_0xe21e56['shift']());}};_0x5e1e13(++_0x3b9948);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 48c9440..9fd8eeb 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 _0xe511=['jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe511,0x16f));var _0x1e51=function(_0x37fead,_0x178c7d){_0x37fead=_0x37fead-0x0;var _0x211a4c=_0xe511[_0x37fead];return _0x211a4c;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});config[_0x1e51('0xa')]=_['defaults'](config['redis'],{'host':_0x1e51('0xb'),'port':0x18eb});var socket=require(_0x1e51('0xc'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x1e51('0xd')](socket);function respondWithRpcPromise(_0x2712e0,_0x29da1f,_0x706e60){return new BPromise(function(_0x4241a6,_0x141e2e){return client['request'](_0x2712e0,_0x706e60)[_0x1e51('0xe')](function(_0xcdfa5d){logger[_0x1e51('0xf')](_0x1e51('0x10'),_0x29da1f,_0x1e51('0x11'));logger[_0x1e51('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x29da1f,_0x1e51('0x11'),JSON[_0x1e51('0x13')](_0xcdfa5d));if(_0xcdfa5d[_0x1e51('0x14')]){if(_0xcdfa5d[_0x1e51('0x14')][_0x1e51('0x15')]===0x1f4){logger[_0x1e51('0x14')](_0x1e51('0x10'),_0x29da1f,_0xcdfa5d[_0x1e51('0x14')][_0x1e51('0x16')]);return _0x141e2e(_0xcdfa5d[_0x1e51('0x14')]['message']);}logger[_0x1e51('0x14')](_0x1e51('0x10'),_0x29da1f,_0xcdfa5d[_0x1e51('0x14')]['message']);return _0x4241a6(_0xcdfa5d[_0x1e51('0x14')]['message']);}else{logger['info'](_0x1e51('0x10'),_0x29da1f,_0x1e51('0x11'));_0x4241a6(_0xcdfa5d[_0x1e51('0x17')][_0x1e51('0x16')]);}})[_0x1e51('0x18')](function(_0x3e4234){logger['error'](_0x1e51('0x10'),_0x29da1f,_0x3e4234);_0x141e2e(_0x3e4234);});});} \ No newline at end of file +var _0x2f3a=['http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x4f518d,_0x311497){var _0x3d47fd=function(_0x5677bf){while(--_0x5677bf){_0x4f518d['push'](_0x4f518d['shift']());}};_0x3d47fd(++_0x311497);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x295bc8,_0x5e8b6e){_0x295bc8=_0x295bc8-0x0;var _0x55ecd1=_0x2f3a[_0x295bc8];return _0x55ecd1;};'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});config['redis']=_['defaults'](config[_0xa2f3('0xa')],{'host':_0xa2f3('0xb'),'port':0x18eb});var socket=require(_0xa2f3('0xc'))(new Redis(config[_0xa2f3('0xa')]));require('./openchannelAccount.socket')[_0xa2f3('0xd')](socket);function respondWithRpcPromise(_0x6373f7,_0x1fce68,_0x41a90c){return new BPromise(function(_0x214f68,_0x55ff83){return client[_0xa2f3('0xe')](_0x6373f7,_0x41a90c)[_0xa2f3('0xf')](function(_0x52aabd){logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));logger['debug'](_0xa2f3('0x13'),_0x1fce68,_0xa2f3('0x12'),JSON[_0xa2f3('0x14')](_0x52aabd));if(_0x52aabd[_0xa2f3('0x15')]){if(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x16')]===0x1f4){logger[_0xa2f3('0x15')](_0xa2f3('0x11'),_0x1fce68,_0x52aabd[_0xa2f3('0x15')]['message']);return _0x55ff83(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);}logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);return _0x214f68(_0x52aabd['error']['message']);}else{logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));_0x214f68(_0x52aabd[_0xa2f3('0x18')][_0xa2f3('0x17')]);}})[_0xa2f3('0x19')](function(_0x30be69){logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x30be69);_0x55ff83(_0x30be69);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c485a49..4154b13 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 _0x8c38=['save','update','removeListener','register','length','./openchannelAccount.events'];(function(_0x1df41c,_0x25a31f){var _0x337753=function(_0x477622){while(--_0x477622){_0x1df41c['push'](_0x1df41c['shift']());}};_0x337753(++_0x25a31f);}(_0x8c38,0x83));var _0x88c3=function(_0x3647a5,_0x22f1cd){_0x3647a5=_0x3647a5-0x0;var _0x2493dd=_0x8c38[_0x3647a5];return _0x2493dd;};'use strict';var OpenchannelAccountEvents=require(_0x88c3('0x0'));var events=[_0x88c3('0x1'),'remove',_0x88c3('0x2')];function createListener(_0x3c7e76,_0x2fd347){return function(_0x2ac453){_0x2fd347['emit'](_0x3c7e76,_0x2ac453);};}function removeListener(_0x147c39,_0x268d5c){return function(){OpenchannelAccountEvents[_0x88c3('0x3')](_0x147c39,_0x268d5c);};}exports[_0x88c3('0x4')]=function(_0x2c413c){for(var _0x6b76d7=0x0,_0xcdbc28=events[_0x88c3('0x5')];_0x6b76d7<_0xcdbc28;_0x6b76d7++){var _0x5020c9=events[_0x6b76d7];var _0x350a11=createListener('openchannelAccount:'+_0x5020c9,_0x2c413c);OpenchannelAccountEvents['on'](_0x5020c9,_0x350a11);}}; \ No newline at end of file +var _0x3ae9=['register','length','openchannelAccount:','remove','update','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3ae9,0xdb));var _0x93ae=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3ae9[_0x432682];return _0x463d05;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x93ae('0x0'),_0x93ae('0x1')];function createListener(_0x189f64,_0x4a724f){return function(_0x946abf){_0x4a724f[_0x93ae('0x2')](_0x189f64,_0x946abf);};}function removeListener(_0x2dc540,_0x2af5aa){return function(){OpenchannelAccountEvents['removeListener'](_0x2dc540,_0x2af5aa);};}exports[_0x93ae('0x3')]=function(_0x51e450){for(var _0x3a9a9c=0x0,_0x32564c=events[_0x93ae('0x4')];_0x3a9a9c<_0x32564c;_0x3a9a9c++){var _0x36e141=events[_0x3a9a9c];var _0x22761c=createListener(_0x93ae('0x5')+_0x36e141,_0x51e450);OpenchannelAccountEvents['on'](_0x36e141,_0x22761c);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 5da9d21..0d08c97 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 _0x5030=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','put','update','delete','util'];(function(_0x5ecb31,_0x1b2f70){var _0xb6753b=function(_0x2cdc6d){while(--_0x2cdc6d){_0x5ecb31['push'](_0x5ecb31['shift']());}};_0xb6753b(++_0x1b2f70);}(_0x5030,0xfe));var _0x0503=function(_0x2934fb,_0x1c4dbf){_0x2934fb=_0x2934fb-0x0;var _0x13dc11=_0x5030[_0x2934fb];return _0x13dc11;};'use strict';var multer=require('multer');var util=require(_0x0503('0x0'));var path=require(_0x0503('0x1'));var timeout=require(_0x0503('0x2'));var express=require(_0x0503('0x3'));var router=express['Router']();var fs_extra=require(_0x0503('0x4'));var auth=require(_0x0503('0x5'));var interaction=require(_0x0503('0x6'));var config=require(_0x0503('0x7'));var controller=require(_0x0503('0x8'));router[_0x0503('0x9')]('/',auth[_0x0503('0xa')](),controller['index']);router[_0x0503('0x9')](_0x0503('0xb'),auth[_0x0503('0xa')](),controller[_0x0503('0xc')]);router[_0x0503('0xd')]('/',auth[_0x0503('0xa')](),controller['create']);router[_0x0503('0xe')](_0x0503('0xb'),auth[_0x0503('0xa')](),controller[_0x0503('0xf')]);router[_0x0503('0x10')](_0x0503('0xb'),auth[_0x0503('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6b61=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','put','destroy','exports','multer','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6b61,0xce));var _0x16b6=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0x6b61[_0x37a9d7];return _0x1343d3;};'use strict';var multer=require(_0x16b6('0x0'));var util=require('util');var path=require(_0x16b6('0x1'));var timeout=require(_0x16b6('0x2'));var express=require(_0x16b6('0x3'));var router=express[_0x16b6('0x4')]();var fs_extra=require(_0x16b6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x16b6('0x6'));var config=require(_0x16b6('0x7'));var controller=require('./openchannelApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x16b6('0x8')]);router['get'](_0x16b6('0x9'),auth[_0x16b6('0xa')](),controller[_0x16b6('0xb')]);router[_0x16b6('0xc')]('/',auth[_0x16b6('0xa')](),controller['create']);router[_0x16b6('0xd')](_0x16b6('0x9'),auth[_0x16b6('0xa')](),controller['update']);router['delete'](_0x16b6('0x9'),auth['isAuthenticated'](),controller[_0x16b6('0xe')]);module[_0x16b6('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6996914..ff2bf53 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 _0xf2ff=['INTEGER','noop','sequelize','exports'];(function(_0x40b7ec,_0x307707){var _0x72b976=function(_0x5bfcc3){while(--_0x5bfcc3){_0x40b7ec['push'](_0x40b7ec['shift']());}};_0x72b976(++_0x307707);}(_0xf2ff,0x18a));var _0xff2f=function(_0x926c4f,_0x11a2d7){_0x926c4f=_0x926c4f-0x0;var _0x4f5d68=_0xf2ff[_0x926c4f];return _0x4f5d68;};'use strict';var Sequelize=require(_0xff2f('0x0'));module[_0xff2f('0x1')]={'priority':{'type':Sequelize[_0xff2f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xff2f('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd3c5=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd3c5,0x1a1));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5d3c('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5d3c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5d3c('0x2')],'allowNull':![],'defaultValue':_0x5d3c('0x3')},'appdata':{'type':Sequelize[_0x5d3c('0x4')]()},'description':{'type':Sequelize[_0x5d3c('0x2')]},'interval':{'type':Sequelize[_0x5d3c('0x2')],'defaultValue':_0x5d3c('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 02e04b9..6bfad69 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 _0xeeab=['apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','OpenchannelApplication','findAll','rows','catch','show','params','rawAttributes','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','undefined','limit','offset','set','Content-Range','json'];(function(_0x20b9a8,_0x5cd626){var _0x1469c7=function(_0x291aa2){while(--_0x291aa2){_0x20b9a8['push'](_0x20b9a8['shift']());}};_0x1469c7(++_0x5cd626);}(_0xeeab,0x18d));var _0xbeea=function(_0x5c0f55,_0x31ce84){_0x5c0f55=_0x5c0f55-0x0;var _0x5f2aed=_0xeeab[_0x5c0f55];return _0x5f2aed;};'use strict';var emlformat=require(_0xbeea('0x0'));var rimraf=require(_0xbeea('0x1'));var zipdir=require(_0xbeea('0x2'));var jsonpatch=require(_0xbeea('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbeea('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbeea('0x5'));var sox=require(_0xbeea('0x6'));var csv=require(_0xbeea('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbeea('0x8'));var _=require(_0xbeea('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbeea('0xa'));var deskjs=require(_0xbeea('0xb'));var toCsv=require(_0xbeea('0x7'));var querystring=require('querystring');var Papa=require(_0xbeea('0xc'));var Redis=require(_0xbeea('0xd'));var authService=require(_0xbeea('0xe'));var qs=require(_0xbeea('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeea('0x10'));var logger=require(_0xbeea('0x11'))(_0xbeea('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbeea('0x13'))['db'];function respondWithStatusCode(_0xb1b7d0,_0x304c2b){_0x304c2b=_0x304c2b||0xcc;return function(_0x269fb8){if(_0x269fb8){return _0xb1b7d0[_0xbeea('0x14')](_0x304c2b);}return _0xb1b7d0['status'](_0x304c2b)[_0xbeea('0x15')]();};}function respondWithResult(_0xc7da5,_0x39b81f){_0x39b81f=_0x39b81f||0xc8;return function(_0x35004b){if(_0x35004b){return _0xc7da5[_0xbeea('0x16')](_0x39b81f)['json'](_0x35004b);}};}function respondWithFilteredResult(_0x4a712f,_0x3277ad){return function(_0x41b93b){if(_0x41b93b){var _0xbecfa0=typeof _0x3277ad['offset']===_0xbeea('0x17')&&typeof _0x3277ad[_0xbeea('0x18')]==='undefined';var _0x1a63d3=_0x41b93b['count'];var _0x1b45f9=_0xbecfa0?0x0:_0x3277ad[_0xbeea('0x19')];var _0x4c4cfd=_0xbecfa0?_0x41b93b['count']:_0x3277ad['offset']+_0x3277ad[_0xbeea('0x18')];var _0x1bd9b7;if(_0x4c4cfd>=_0x1a63d3){_0x4c4cfd=_0x1a63d3;_0x1bd9b7=0xc8;}else{_0x1bd9b7=0xce;}_0x4a712f[_0xbeea('0x16')](_0x1bd9b7);return _0x4a712f[_0xbeea('0x1a')](_0xbeea('0x1b'),_0x1b45f9+'-'+_0x4c4cfd+'/'+_0x1a63d3)[_0xbeea('0x1c')](_0x41b93b);}return null;};}function patchUpdates(_0x2aaae8){return function(_0x1c3d81){try{jsonpatch[_0xbeea('0x1d')](_0x1c3d81,_0x2aaae8,!![]);}catch(_0x5f5b14){return BPromise[_0xbeea('0x1e')](_0x5f5b14);}return _0x1c3d81[_0xbeea('0x1f')]();};}function saveUpdates(_0x2b2d65,_0x1280bc){return function(_0x2e8d1a){if(_0x2e8d1a){return _0x2e8d1a[_0xbeea('0x20')](_0x2b2d65)[_0xbeea('0x21')](function(_0x529f83){return _0x529f83;});}return null;};}function removeEntity(_0x211879,_0x49125b){return function(_0x17c0c2){if(_0x17c0c2){return _0x17c0c2[_0xbeea('0x22')]()[_0xbeea('0x21')](function(){_0x211879[_0xbeea('0x16')](0xcc)[_0xbeea('0x15')]();});}};}function handleEntityNotFound(_0x5ae0f2,_0x5edaa7){return function(_0x2c21b2){if(!_0x2c21b2){_0x5ae0f2[_0xbeea('0x14')](0x194);}return _0x2c21b2;};}function handleError(_0x5e1112,_0x9dd00){_0x9dd00=_0x9dd00||0x1f4;return function(_0x5687c4){logger[_0xbeea('0x23')](_0x5687c4[_0xbeea('0x24')]);if(_0x5687c4['name']){delete _0x5687c4[_0xbeea('0x25')];}_0x5e1112['status'](_0x9dd00)[_0xbeea('0x26')](_0x5687c4);};}exports['index']=function(_0xc6594e,_0x597886){var _0x3b6b74={},_0x1f006b={},_0x39c16f={'count':0x0,'rows':[]};var _0x1efe05=_[_0xbeea('0x27')](db['OpenchannelApplication']['rawAttributes'],function(_0x4a3aee){return{'name':_0x4a3aee[_0xbeea('0x28')],'type':_0x4a3aee[_0xbeea('0x29')][_0xbeea('0x2a')]};});_0x1f006b[_0xbeea('0x2b')]=_[_0xbeea('0x27')](_0x1efe05,_0xbeea('0x25'));_0x1f006b[_0xbeea('0x2c')]=_[_0xbeea('0x2d')](_0xc6594e['query']);_0x1f006b['filters']=_[_0xbeea('0x2e')](_0x1f006b[_0xbeea('0x2b')],_0x1f006b[_0xbeea('0x2c')]);_0x3b6b74['attributes']=_[_0xbeea('0x2e')](_0x1f006b['model'],qs[_0xbeea('0x2f')](_0xc6594e[_0xbeea('0x2c')]['fields']));_0x3b6b74[_0xbeea('0x30')]=_0x3b6b74[_0xbeea('0x30')]['length']?_0x3b6b74['attributes']:_0x1f006b[_0xbeea('0x2b')];if(!_0xc6594e[_0xbeea('0x2c')][_0xbeea('0x31')]('nolimit')){_0x3b6b74[_0xbeea('0x18')]=qs[_0xbeea('0x18')](_0xc6594e['query'][_0xbeea('0x18')]);_0x3b6b74['offset']=qs[_0xbeea('0x19')](_0xc6594e['query'][_0xbeea('0x19')]);}_0x3b6b74[_0xbeea('0x32')]=qs[_0xbeea('0x33')](_0xc6594e[_0xbeea('0x2c')][_0xbeea('0x33')]);_0x3b6b74[_0xbeea('0x34')]=qs[_0xbeea('0x35')](_[_0xbeea('0x36')](_0xc6594e[_0xbeea('0x2c')],_0x1f006b[_0xbeea('0x35')]),_0x1efe05);if(_0xc6594e[_0xbeea('0x2c')][_0xbeea('0x37')]){_0x3b6b74[_0xbeea('0x34')]=_[_0xbeea('0x38')](_0x3b6b74['where'],{'$or':_[_0xbeea('0x27')](_0x1efe05,function(_0x27f654){if(_0x27f654['type']!==_0xbeea('0x39')){var _0x2279df={};_0x2279df[_0x27f654['name']]={'$like':'%'+_0xc6594e['query'][_0xbeea('0x37')]+'%'};return _0x2279df;}})});}_0x3b6b74=_[_0xbeea('0x38')]({},_0x3b6b74,_0xc6594e[_0xbeea('0x3a')]);var _0x20e2fc={'where':_0x3b6b74[_0xbeea('0x34')]};return db['OpenchannelApplication'][_0xbeea('0x3b')](_0x20e2fc)[_0xbeea('0x21')](function(_0x251676){_0x39c16f[_0xbeea('0x3b')]=_0x251676;if(_0xc6594e[_0xbeea('0x2c')][_0xbeea('0x3c')]){_0x3b6b74[_0xbeea('0x3d')]=[{'all':!![]}];}return db[_0xbeea('0x3e')][_0xbeea('0x3f')](_0x3b6b74);})[_0xbeea('0x21')](function(_0x29a5af){_0x39c16f[_0xbeea('0x40')]=_0x29a5af;return _0x39c16f;})[_0xbeea('0x21')](respondWithFilteredResult(_0x597886,_0x3b6b74))[_0xbeea('0x41')](handleError(_0x597886,null));};exports[_0xbeea('0x42')]=function(_0x59fef2,_0x31b798){var _0x2004e3={'raw':!![],'where':{'id':_0x59fef2[_0xbeea('0x43')]['id']}},_0x11e6a5={};_0x11e6a5[_0xbeea('0x2b')]=_[_0xbeea('0x2d')](db[_0xbeea('0x3e')][_0xbeea('0x44')]);_0x11e6a5[_0xbeea('0x2c')]=_[_0xbeea('0x2d')](_0x59fef2[_0xbeea('0x2c')]);_0x11e6a5[_0xbeea('0x35')]=_[_0xbeea('0x2e')](_0x11e6a5[_0xbeea('0x2b')],_0x11e6a5[_0xbeea('0x2c')]);_0x2004e3['attributes']=_[_0xbeea('0x2e')](_0x11e6a5[_0xbeea('0x2b')],qs[_0xbeea('0x2f')](_0x59fef2[_0xbeea('0x2c')][_0xbeea('0x2f')]));_0x2004e3['attributes']=_0x2004e3[_0xbeea('0x30')]['length']?_0x2004e3[_0xbeea('0x30')]:_0x11e6a5[_0xbeea('0x2b')];if(_0x59fef2[_0xbeea('0x2c')][_0xbeea('0x3c')]){_0x2004e3[_0xbeea('0x3d')]=[{'all':!![]}];}_0x2004e3=_['merge']({},_0x2004e3,_0x59fef2[_0xbeea('0x3a')]);return db['OpenchannelApplication']['find'](_0x2004e3)[_0xbeea('0x21')](handleEntityNotFound(_0x31b798,null))[_0xbeea('0x21')](respondWithResult(_0x31b798,null))['catch'](handleError(_0x31b798,null));};exports['create']=function(_0x5676ec,_0x32ac64){return db['OpenchannelApplication']['create'](_0x5676ec[_0xbeea('0x45')],{})[_0xbeea('0x21')](respondWithResult(_0x32ac64,0xc9))[_0xbeea('0x41')](handleError(_0x32ac64,null));};exports['update']=function(_0x3101e2,_0x38daf3){if(_0x3101e2['body']['id']){delete _0x3101e2[_0xbeea('0x45')]['id'];}return db[_0xbeea('0x3e')][_0xbeea('0x46')]({'where':{'id':_0x3101e2[_0xbeea('0x43')]['id']}})[_0xbeea('0x21')](handleEntityNotFound(_0x38daf3,null))['then'](saveUpdates(_0x3101e2[_0xbeea('0x45')],null))['then'](respondWithResult(_0x38daf3,null))[_0xbeea('0x41')](handleError(_0x38daf3,null));};exports[_0xbeea('0x22')]=function(_0x5c9479,_0x19be24){return db[_0xbeea('0x3e')][_0xbeea('0x46')]({'where':{'id':_0x5c9479[_0xbeea('0x43')]['id']}})[_0xbeea('0x21')](handleEntityNotFound(_0x19be24,null))[_0xbeea('0x21')](removeEntity(_0x19be24,null))[_0xbeea('0x41')](handleError(_0x19be24,null));}; \ No newline at end of file +var _0xed5b=['moment','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','create','body','update','params','find','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xed5b,0x15a));var _0xbed5=function(_0x12ad5d,_0x2e63ed){_0x12ad5d=_0x12ad5d-0x0;var _0x45a98b=_0xed5b[_0x12ad5d];return _0x45a98b;};'use strict';var emlformat=require(_0xbed5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbed5('0x1'));var jsonpatch=require(_0xbed5('0x2'));var rp=require(_0xbed5('0x3'));var moment=require(_0xbed5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbed5('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbed5('0x6'));var _=require(_0xbed5('0x7'));var squel=require(_0xbed5('0x8'));var crypto=require(_0xbed5('0x9'));var jsforce=require(_0xbed5('0xa'));var deskjs=require(_0xbed5('0xb'));var toCsv=require(_0xbed5('0xc'));var querystring=require('querystring');var Papa=require(_0xbed5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbed5('0xe'));var logger=require(_0xbed5('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xbed5('0x10'));var licenseUtil=require(_0xbed5('0x11'));var db=require(_0xbed5('0x12'))['db'];function respondWithStatusCode(_0x1eb061,_0x5f1e22){_0x5f1e22=_0x5f1e22||0xcc;return function(_0x5983b6){if(_0x5983b6){return _0x1eb061[_0xbed5('0x13')](_0x5f1e22);}return _0x1eb061['status'](_0x5f1e22)[_0xbed5('0x14')]();};}function respondWithResult(_0x11284e,_0x48fb3d){_0x48fb3d=_0x48fb3d||0xc8;return function(_0x27ce86){if(_0x27ce86){return _0x11284e[_0xbed5('0x15')](_0x48fb3d)[_0xbed5('0x16')](_0x27ce86);}};}function respondWithFilteredResult(_0x112f89,_0x4f7995){return function(_0x5ee4dd){if(_0x5ee4dd){var _0x490cfa=typeof _0x4f7995[_0xbed5('0x17')]==='undefined'&&typeof _0x4f7995[_0xbed5('0x18')]===_0xbed5('0x19');var _0x44e748=_0x5ee4dd['count'];var _0xb51373=_0x490cfa?0x0:_0x4f7995['offset'];var _0xba8993=_0x490cfa?_0x5ee4dd[_0xbed5('0x1a')]:_0x4f7995[_0xbed5('0x17')]+_0x4f7995[_0xbed5('0x18')];var _0x19e3f3;if(_0xba8993>=_0x44e748){_0xba8993=_0x44e748;_0x19e3f3=0xc8;}else{_0x19e3f3=0xce;}_0x112f89[_0xbed5('0x15')](_0x19e3f3);return _0x112f89[_0xbed5('0x1b')](_0xbed5('0x1c'),_0xb51373+'-'+_0xba8993+'/'+_0x44e748)['json'](_0x5ee4dd);}return null;};}function patchUpdates(_0x5275c9){return function(_0x39ca70){try{jsonpatch['apply'](_0x39ca70,_0x5275c9,!![]);}catch(_0x13e6ea){return BPromise[_0xbed5('0x1d')](_0x13e6ea);}return _0x39ca70[_0xbed5('0x1e')]();};}function saveUpdates(_0x30164a,_0x379db){return function(_0x4d97b6){if(_0x4d97b6){return _0x4d97b6['update'](_0x30164a)[_0xbed5('0x1f')](function(_0xfc1683){return _0xfc1683;});}return null;};}function removeEntity(_0x5141e4,_0x5acb53){return function(_0x5604ba){if(_0x5604ba){return _0x5604ba[_0xbed5('0x20')]()['then'](function(){_0x5141e4[_0xbed5('0x15')](0xcc)[_0xbed5('0x14')]();});}};}function handleEntityNotFound(_0xa85f86,_0xee8fa5){return function(_0x4b14da){if(!_0x4b14da){_0xa85f86[_0xbed5('0x13')](0x194);}return _0x4b14da;};}function handleError(_0x5d55d8,_0x3f38b8){_0x3f38b8=_0x3f38b8||0x1f4;return function(_0x250533){logger[_0xbed5('0x21')](_0x250533[_0xbed5('0x22')]);if(_0x250533[_0xbed5('0x23')]){delete _0x250533[_0xbed5('0x23')];}_0x5d55d8[_0xbed5('0x15')](_0x3f38b8)[_0xbed5('0x24')](_0x250533);};}exports[_0xbed5('0x25')]=function(_0xe080b4,_0x20f77a){var _0x52ab0f={},_0x25fa68={},_0x3c5a6b={'count':0x0,'rows':[]};var _0x3348cf=_[_0xbed5('0x26')](db[_0xbed5('0x27')][_0xbed5('0x28')],function(_0x2accea){return{'name':_0x2accea[_0xbed5('0x29')],'type':_0x2accea[_0xbed5('0x2a')][_0xbed5('0x2b')]};});_0x25fa68[_0xbed5('0x2c')]=_[_0xbed5('0x26')](_0x3348cf,_0xbed5('0x23'));_0x25fa68['query']=_[_0xbed5('0x2d')](_0xe080b4[_0xbed5('0x2e')]);_0x25fa68['filters']=_[_0xbed5('0x2f')](_0x25fa68['model'],_0x25fa68['query']);_0x52ab0f['attributes']=_[_0xbed5('0x2f')](_0x25fa68[_0xbed5('0x2c')],qs[_0xbed5('0x30')](_0xe080b4[_0xbed5('0x2e')][_0xbed5('0x30')]));_0x52ab0f[_0xbed5('0x31')]=_0x52ab0f[_0xbed5('0x31')][_0xbed5('0x32')]?_0x52ab0f[_0xbed5('0x31')]:_0x25fa68['model'];if(!_0xe080b4[_0xbed5('0x2e')][_0xbed5('0x33')]('nolimit')){_0x52ab0f[_0xbed5('0x18')]=qs[_0xbed5('0x18')](_0xe080b4[_0xbed5('0x2e')][_0xbed5('0x18')]);_0x52ab0f['offset']=qs[_0xbed5('0x17')](_0xe080b4[_0xbed5('0x2e')][_0xbed5('0x17')]);}_0x52ab0f[_0xbed5('0x34')]=qs['sort'](_0xe080b4[_0xbed5('0x2e')][_0xbed5('0x35')]);_0x52ab0f[_0xbed5('0x36')]=qs[_0xbed5('0x37')](_[_0xbed5('0x38')](_0xe080b4[_0xbed5('0x2e')],_0x25fa68[_0xbed5('0x37')]),_0x3348cf);if(_0xe080b4[_0xbed5('0x2e')][_0xbed5('0x39')]){_0x52ab0f[_0xbed5('0x36')]=_['merge'](_0x52ab0f[_0xbed5('0x36')],{'$or':_[_0xbed5('0x26')](_0x3348cf,function(_0x5351d3){if(_0x5351d3[_0xbed5('0x2a')]!==_0xbed5('0x3a')){var _0x1f84a8={};_0x1f84a8[_0x5351d3['name']]={'$like':'%'+_0xe080b4['query']['filter']+'%'};return _0x1f84a8;}})});}_0x52ab0f=_[_0xbed5('0x3b')]({},_0x52ab0f,_0xe080b4[_0xbed5('0x3c')]);var _0x5c9aa3={'where':_0x52ab0f['where']};return db['OpenchannelApplication'][_0xbed5('0x1a')](_0x5c9aa3)[_0xbed5('0x1f')](function(_0xbc0198){_0x3c5a6b['count']=_0xbc0198;if(_0xe080b4[_0xbed5('0x2e')][_0xbed5('0x3d')]){_0x52ab0f['include']=[{'all':!![]}];}return db[_0xbed5('0x27')][_0xbed5('0x3e')](_0x52ab0f);})[_0xbed5('0x1f')](function(_0x39fde1){_0x3c5a6b[_0xbed5('0x3f')]=_0x39fde1;return _0x3c5a6b;})['then'](respondWithFilteredResult(_0x20f77a,_0x52ab0f))[_0xbed5('0x40')](handleError(_0x20f77a,null));};exports['show']=function(_0x246ff3,_0x321d1a){var _0x4a0afd={'raw':!![],'where':{'id':_0x246ff3['params']['id']}},_0x459610={};_0x459610[_0xbed5('0x2c')]=_[_0xbed5('0x2d')](db[_0xbed5('0x27')][_0xbed5('0x28')]);_0x459610[_0xbed5('0x2e')]=_[_0xbed5('0x2d')](_0x246ff3[_0xbed5('0x2e')]);_0x459610[_0xbed5('0x37')]=_['intersection'](_0x459610[_0xbed5('0x2c')],_0x459610['query']);_0x4a0afd[_0xbed5('0x31')]=_['intersection'](_0x459610[_0xbed5('0x2c')],qs[_0xbed5('0x30')](_0x246ff3[_0xbed5('0x2e')]['fields']));_0x4a0afd['attributes']=_0x4a0afd[_0xbed5('0x31')]['length']?_0x4a0afd[_0xbed5('0x31')]:_0x459610[_0xbed5('0x2c')];if(_0x246ff3[_0xbed5('0x2e')][_0xbed5('0x3d')]){_0x4a0afd['include']=[{'all':!![]}];}_0x4a0afd=_[_0xbed5('0x3b')]({},_0x4a0afd,_0x246ff3[_0xbed5('0x3c')]);return db[_0xbed5('0x27')]['find'](_0x4a0afd)[_0xbed5('0x1f')](handleEntityNotFound(_0x321d1a,null))[_0xbed5('0x1f')](respondWithResult(_0x321d1a,null))[_0xbed5('0x40')](handleError(_0x321d1a,null));};exports[_0xbed5('0x41')]=function(_0x30720a,_0x3132af){return db[_0xbed5('0x27')][_0xbed5('0x41')](_0x30720a[_0xbed5('0x42')],{})[_0xbed5('0x1f')](respondWithResult(_0x3132af,0xc9))[_0xbed5('0x40')](handleError(_0x3132af,null));};exports[_0xbed5('0x43')]=function(_0x255cfc,_0x3f72a){if(_0x255cfc[_0xbed5('0x42')]['id']){delete _0x255cfc[_0xbed5('0x42')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x255cfc[_0xbed5('0x44')]['id']}})[_0xbed5('0x1f')](handleEntityNotFound(_0x3f72a,null))[_0xbed5('0x1f')](saveUpdates(_0x255cfc['body'],null))[_0xbed5('0x1f')](respondWithResult(_0x3f72a,null))['catch'](handleError(_0x3f72a,null));};exports[_0xbed5('0x20')]=function(_0x17776f,_0x4aef3c){return db[_0xbed5('0x27')][_0xbed5('0x45')]({'where':{'id':_0x17776f[_0xbed5('0x44')]['id']}})[_0xbed5('0x1f')](handleEntityNotFound(_0x4aef3c,null))[_0xbed5('0x1f')](removeEntity(_0x4aef3c,null))[_0xbed5('0x40')](handleError(_0x4aef3c,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 768facf..82cf91b 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 _0xaa9c=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xaa9c,0x147));var _0xcaa9=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xaa9c[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xcaa9('0x0'));var util=require(_0xcaa9('0x1'));var logger=require(_0xcaa9('0x2'))(_0xcaa9('0x3'));var moment=require(_0xcaa9('0x4'));var BPromise=require(_0xcaa9('0x5'));var rp=require(_0xcaa9('0x6'));var fs=require('fs');var path=require(_0xcaa9('0x7'));var rimraf=require(_0xcaa9('0x8'));var config=require(_0xcaa9('0x9'));var attributes=require(_0xcaa9('0xa'));module[_0xcaa9('0xb')]=function(_0x1360f8,_0x3db728){return _0x1360f8[_0xcaa9('0xc')](_0xcaa9('0xd'),attributes,{'tableName':_0xcaa9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcaa9('0xf'),'collate':_0xcaa9('0x10')});}; \ No newline at end of file +var _0xba0d=['util','api','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x377996,_0x40a743){var _0x5cd9de=function(_0x4de56f){while(--_0x4de56f){_0x377996['push'](_0x377996['shift']());}};_0x5cd9de(++_0x40a743);}(_0xba0d,0x15d));var _0xdba0=function(_0x3ba5db,_0x25b506){_0x3ba5db=_0x3ba5db-0x0;var _0x49977c=_0xba0d[_0x3ba5db];return _0x49977c;};'use strict';var _=require(_0xdba0('0x0'));var util=require(_0xdba0('0x1'));var logger=require('../../config/logger')(_0xdba0('0x2'));var moment=require(_0xdba0('0x3'));var BPromise=require(_0xdba0('0x4'));var rp=require(_0xdba0('0x5'));var fs=require('fs');var path=require(_0xdba0('0x6'));var rimraf=require(_0xdba0('0x7'));var config=require('../../config/environment');var attributes=require(_0xdba0('0x8'));module['exports']=function(_0xce1aca,_0x27662b){return _0xce1aca[_0xdba0('0x9')](_0xdba0('0xa'),attributes,{'tableName':_0xdba0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdba0('0xc'),'collate':_0xdba0('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index b9789f1..1c3a716 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 _0xaa6f=['error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','raw','options','attributes','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5b9029,_0x2f77f5){var _0x518754=function(_0x10acf5){while(--_0x10acf5){_0x5b9029['push'](_0x5b9029['shift']());}};_0x518754(++_0x2f77f5);}(_0xaa6f,0x6a));var _0xfaa6=function(_0x3d4948,_0x3567fc){_0x3d4948=_0x3d4948-0x0;var _0x36d5d=_0xaa6f[_0x3d4948];return _0x36d5d;};'use strict';var _=require(_0xfaa6('0x0'));var util=require(_0xfaa6('0x1'));var moment=require('moment');var BPromise=require(_0xfaa6('0x2'));var rs=require(_0xfaa6('0x3'));var fs=require('fs');var Redis=require(_0xfaa6('0x4'));var db=require(_0xfaa6('0x5'))['db'];var utils=require(_0xfaa6('0x6'));var logger=require(_0xfaa6('0x7'))(_0xfaa6('0x8'));var config=require(_0xfaa6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfaa6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b558c,_0x55fa06,_0xa219c3){return new BPromise(function(_0x3b984f,_0x57db74){return client[_0xfaa6('0xb')](_0x5b558c,_0xa219c3)[_0xfaa6('0xc')](function(_0x297f65){logger[_0xfaa6('0xd')](_0xfaa6('0xe'),_0x55fa06,_0xfaa6('0xf'));logger[_0xfaa6('0x10')](_0xfaa6('0x11'),_0x55fa06,_0xfaa6('0xf'),JSON['stringify'](_0x297f65));if(_0x297f65[_0xfaa6('0x12')]){if(_0x297f65[_0xfaa6('0x12')][_0xfaa6('0x13')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x55fa06,_0x297f65[_0xfaa6('0x12')][_0xfaa6('0x14')]);return _0x57db74(_0x297f65[_0xfaa6('0x12')]['message']);}logger[_0xfaa6('0x12')](_0xfaa6('0xe'),_0x55fa06,_0x297f65[_0xfaa6('0x12')][_0xfaa6('0x14')]);return _0x3b984f(_0x297f65['error'][_0xfaa6('0x14')]);}else{logger['info'](_0xfaa6('0xe'),_0x55fa06,_0xfaa6('0xf'));_0x3b984f(_0x297f65[_0xfaa6('0x15')][_0xfaa6('0x14')]);}})['catch'](function(_0x1c3ba2){logger['error'](_0xfaa6('0xe'),_0x55fa06,_0x1c3ba2);_0x57db74(_0x1c3ba2);});});}exports[_0xfaa6('0x16')]=function(_0x5e1c20){var _0x2008ed=this;return new Promise(function(_0x1b8f39,_0x1df746){return db[_0xfaa6('0x17')][_0xfaa6('0x18')](_0x5e1c20[_0xfaa6('0x19')],{'raw':_0x5e1c20['options']?_0x5e1c20['options'][_0xfaa6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e1c20[_0xfaa6('0x1b')]?_0x5e1c20[_0xfaa6('0x1b')]['where']||null:null,'attributes':_0x5e1c20[_0xfaa6('0x1b')]?_0x5e1c20[_0xfaa6('0x1b')][_0xfaa6('0x1c')]||null:null,'limit':_0x5e1c20['options']?_0x5e1c20[_0xfaa6('0x1b')]['limit']||null:null})[_0xfaa6('0xc')](function(_0x33ccc1){logger[_0xfaa6('0xd')](_0xfaa6('0x16'),_0x5e1c20);logger['debug'](_0xfaa6('0x16'),_0x5e1c20,JSON[_0xfaa6('0x1d')](_0x33ccc1));_0x1b8f39(_0x33ccc1);})[_0xfaa6('0x1e')](function(_0x4f1765){logger['error'](_0xfaa6('0x16'),_0x4f1765[_0xfaa6('0x14')],_0x5e1c20);_0x1df746(_0x2008ed['error'](0x1f4,_0x4f1765[_0xfaa6('0x14')]));});});}; \ No newline at end of file +var _0x0c3e=['stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','debug','lodash','util','ioredis','../../config/utils','rpc','jayson/promise','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1d7b57,_0x57d302){var _0x135faa=function(_0x43c50d){while(--_0x43c50d){_0x1d7b57['push'](_0x1d7b57['shift']());}};_0x135faa(++_0x57d302);}(_0x0c3e,0x1ae));var _0xe0c3=function(_0x4e82c8,_0x563887){_0x4e82c8=_0x4e82c8-0x0;var _0x4b9718=_0x0c3e[_0x4e82c8];return _0x4b9718;};'use strict';var _=require(_0xe0c3('0x0'));var util=require(_0xe0c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0c3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0c3('0x3'));var logger=require('../../config/logger')(_0xe0c3('0x4'));var config=require('../../config/environment');var jayson=require(_0xe0c3('0x5'));var client=jayson['client'][_0xe0c3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x29705d,_0x41f674,_0x2f6afa){return new BPromise(function(_0x5349ef,_0x39e166){return client[_0xe0c3('0x7')](_0x29705d,_0x2f6afa)['then'](function(_0x13261b){logger[_0xe0c3('0x8')](_0xe0c3('0x9'),_0x41f674,_0xe0c3('0xa'));logger['debug'](_0xe0c3('0xb'),_0x41f674,_0xe0c3('0xa'),JSON[_0xe0c3('0xc')](_0x13261b));if(_0x13261b[_0xe0c3('0xd')]){if(_0x13261b[_0xe0c3('0xd')][_0xe0c3('0xe')]===0x1f4){logger[_0xe0c3('0xd')](_0xe0c3('0x9'),_0x41f674,_0x13261b['error'][_0xe0c3('0xf')]);return _0x39e166(_0x13261b['error'][_0xe0c3('0xf')]);}logger[_0xe0c3('0xd')](_0xe0c3('0x9'),_0x41f674,_0x13261b['error'][_0xe0c3('0xf')]);return _0x5349ef(_0x13261b[_0xe0c3('0xd')]['message']);}else{logger[_0xe0c3('0x8')](_0xe0c3('0x9'),_0x41f674,'request\x20sent');_0x5349ef(_0x13261b[_0xe0c3('0x10')]['message']);}})[_0xe0c3('0x11')](function(_0x7b820b){logger['error'](_0xe0c3('0x9'),_0x41f674,_0x7b820b);_0x39e166(_0x7b820b);});});}exports[_0xe0c3('0x12')]=function(_0x5cd8a8){var _0x66046a=this;return new Promise(function(_0x4a47e5,_0x34e2b7){return db[_0xe0c3('0x13')][_0xe0c3('0x14')](_0x5cd8a8['body'],{'raw':_0x5cd8a8[_0xe0c3('0x15')]?_0x5cd8a8['options'][_0xe0c3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd8a8[_0xe0c3('0x15')]?_0x5cd8a8[_0xe0c3('0x15')][_0xe0c3('0x17')]||null:null,'attributes':_0x5cd8a8[_0xe0c3('0x15')]?_0x5cd8a8[_0xe0c3('0x15')][_0xe0c3('0x18')]||null:null,'limit':_0x5cd8a8[_0xe0c3('0x15')]?_0x5cd8a8[_0xe0c3('0x15')]['limit']||null:null})['then'](function(_0x36ee88){logger['info'](_0xe0c3('0x12'),_0x5cd8a8);logger[_0xe0c3('0x19')](_0xe0c3('0x12'),_0x5cd8a8,JSON[_0xe0c3('0xc')](_0x36ee88));_0x4a47e5(_0x36ee88);})[_0xe0c3('0x11')](function(_0x1d8fc7){logger['error'](_0xe0c3('0x12'),_0x1d8fc7[_0xe0c3('0xf')],_0x5cd8a8);_0x34e2b7(_0x66046a['error'](0x1f4,_0x1d8fc7['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index e6292c4..17947da 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 _0xecea=['./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','show','/:id/messages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x19aa0f,_0x4dd97e){var _0x4702e0=function(_0x39066b){while(--_0x39066b){_0x19aa0f['push'](_0x19aa0f['shift']());}};_0x4702e0(++_0x4dd97e);}(_0xecea,0x10f));var _0xaece=function(_0x441a68,_0x1bf01d){_0x441a68=_0x441a68-0x0;var _0x2feac7=_0xecea[_0x441a68];return _0x2feac7;};'use strict';var multer=require(_0xaece('0x0'));var util=require(_0xaece('0x1'));var path=require('path');var timeout=require(_0xaece('0x2'));var express=require(_0xaece('0x3'));var router=express[_0xaece('0x4')]();var fs_extra=require(_0xaece('0x5'));var auth=require(_0xaece('0x6'));var interaction=require(_0xaece('0x7'));var config=require(_0xaece('0x8'));var controller=require(_0xaece('0x9'));router[_0xaece('0xa')]('/',auth['isAuthenticated'](),controller[_0xaece('0xb')]);router['get'](_0xaece('0xc'),auth[_0xaece('0xd')](),controller[_0xaece('0xe')]);router[_0xaece('0xa')]('/:id',auth[_0xaece('0xd')](),controller[_0xaece('0xf')]);router[_0xaece('0xa')](_0xaece('0x10'),auth[_0xaece('0xd')](),controller['getMessages']);router['get'](_0xaece('0x11'),auth[_0xaece('0xd')](),controller[_0xaece('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaece('0x13')]);router[_0xaece('0x14')]('/:id/messages',auth['isAuthenticated'](),controller[_0xaece('0x15')]);router[_0xaece('0x14')](_0xaece('0x16'),auth[_0xaece('0xd')](),interaction[_0xaece('0x17')](_0xaece('0x18'),_0xaece('0x19')),controller[_0xaece('0x1a')]);router[_0xaece('0x1b')](_0xaece('0x1c'),auth[_0xaece('0xd')](),interaction[_0xaece('0x17')](_0xaece('0x18'),_0xaece('0x1d')),controller[_0xaece('0x1e')]);router[_0xaece('0x1f')](_0xaece('0x1c'),auth[_0xaece('0xd')](),interaction[_0xaece('0x17')]('openchannel',_0xaece('0x20')),controller['destroy']);router[_0xaece('0x1f')]('/:id/tags',auth[_0xaece('0xd')](),controller[_0xaece('0x21')]);module[_0xaece('0x22')]=router; \ No newline at end of file +var _0xe2ad=['connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannel','openchannelinteraction:destroy','removeTags','exports','multer','util','path'];(function(_0x4782b9,_0x11caf1){var _0x33abe5=function(_0x1b3cd0){while(--_0x1b3cd0){_0x4782b9['push'](_0x4782b9['shift']());}};_0x33abe5(++_0x11caf1);}(_0xe2ad,0x93));var _0xde2a=function(_0x2fe7b9,_0x1bcf21){_0x2fe7b9=_0x2fe7b9-0x0;var _0x1836e1=_0xe2ad[_0x2fe7b9];return _0x1836e1;};'use strict';var multer=require(_0xde2a('0x0'));var util=require(_0xde2a('0x1'));var path=require(_0xde2a('0x2'));var timeout=require(_0xde2a('0x3'));var express=require('express');var router=express[_0xde2a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xde2a('0x5'));var config=require(_0xde2a('0x6'));var controller=require('./openchannelInteraction.controller');router[_0xde2a('0x7')]('/',auth[_0xde2a('0x8')](),controller['index']);router['get'](_0xde2a('0x9'),auth[_0xde2a('0x8')](),controller[_0xde2a('0xa')]);router[_0xde2a('0x7')](_0xde2a('0xb'),auth[_0xde2a('0x8')](),controller[_0xde2a('0xc')]);router['get'](_0xde2a('0xd'),auth['isAuthenticated'](),controller[_0xde2a('0xe')]);router['get'](_0xde2a('0xf'),auth['isAuthenticated'](),controller[_0xde2a('0x10')]);router['post']('/',auth[_0xde2a('0x8')](),controller['create']);router[_0xde2a('0x11')](_0xde2a('0xd'),auth[_0xde2a('0x8')](),controller[_0xde2a('0x12')]);router['post'](_0xde2a('0x13'),auth[_0xde2a('0x8')](),interaction[_0xde2a('0x14')]('openchannel',_0xde2a('0x15')),controller['addTags']);router[_0xde2a('0x16')](_0xde2a('0xb'),auth[_0xde2a('0x8')](),interaction[_0xde2a('0x14')]('openchannel',_0xde2a('0x17')),controller[_0xde2a('0x18')]);router[_0xde2a('0x19')](_0xde2a('0xb'),auth[_0xde2a('0x8')](),interaction['tracked'](_0xde2a('0x1a'),_0xde2a('0x1b')),controller['destroy']);router['delete'](_0xde2a('0x13'),auth[_0xde2a('0x8')](),controller[_0xde2a('0x1c')]);module[_0xde2a('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 3b6c4c9..0250088 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 _0x26bc=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x40ea93,_0x564b75){var _0xc52069=function(_0x4899bf){while(--_0x4899bf){_0x40ea93['push'](_0x40ea93['shift']());}};_0xc52069(++_0x564b75);}(_0x26bc,0x162));var _0xc26b=function(_0x25a90a,_0x182517){_0x25a90a=_0x25a90a-0x0;var _0xb9fb8a=_0x26bc[_0x25a90a];return _0xb9fb8a;};'use strict';var Sequelize=require(_0xc26b('0x0'));module[_0xc26b('0x1')]={'closed':{'type':Sequelize[_0xc26b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc26b('0x3')]},'disposition':{'type':Sequelize[_0xc26b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc26b('0x4')]},'note':{'type':Sequelize[_0xc26b('0x4')]},'read1stAt':{'type':Sequelize[_0xc26b('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc26b('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xc26b('0x5')]('in',_0xc26b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xc26b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc26b('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xc26b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x12cc=['out','ENUM','exports','BOOLEAN','DATE','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x12cc,0xc2));var _0xc12c=function(_0x1468b3,_0xb14791){_0x1468b3=_0x1468b3-0x0;var _0x41ddb8=_0x12cc[_0x1468b3];return _0x41ddb8;};'use strict';var Sequelize=require('sequelize');module[_0xc12c('0x0')]={'closed':{'type':Sequelize[_0xc12c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc12c('0x2')]},'disposition':{'type':Sequelize[_0xc12c('0x3')]},'secondDisposition':{'type':Sequelize[_0xc12c('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc12c('0x2')]},'threadId':{'type':Sequelize[_0xc12c('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc12c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xc12c('0x5')]('in',_0xc12c('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 34f503b..f3e4f33 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 _0x21b8=['value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','name','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','OpenchannelInteraction','keys','intersection','model','attributes','fields','length','include','merge','options','create','body','find','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','omit','spread','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','User','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','read','Account','Owner','fullname','get','Openchannel','closed','closedAt','toString','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','direction','out','Contact'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x21b8,0x107));var _0x821b=function(_0xc5c551,_0x438145){_0xc5c551=_0xc5c551-0x0;var _0x5f5312=_0x21b8[_0xc5c551];return _0x5f5312;};'use strict';var rimraf=require(_0x821b('0x0'));var zipdir=require(_0x821b('0x1'));var moment=require('moment');var util=require(_0x821b('0x2'));var path=require(_0x821b('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x821b('0x4'));var interaction=require(_0x821b('0x5'));var qs=require(_0x821b('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x821b('0x7'))(_0x821b('0x8'));var config=require(_0x821b('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x821b('0xa')](config[_0x821b('0xb')],{'host':_0x821b('0xc'),'port':0x18eb});var socket=require(_0x821b('0xd'))(new Redis(config[_0x821b('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x206938,_0x441fd1){_0x441fd1=_0x441fd1||0xcc;return function(_0x54dced){if(_0x54dced){return _0x206938[_0x821b('0xe')](_0x441fd1);}return _0x206938[_0x821b('0xf')](_0x441fd1)[_0x821b('0x10')]();};}function respondWithResult(_0x239317,_0x1d0b9d){_0x1d0b9d=_0x1d0b9d||0xc8;return function(_0x52f8f5){if(_0x52f8f5){return _0x239317[_0x821b('0xf')](_0x1d0b9d)[_0x821b('0x11')](_0x52f8f5);}};}function respondWithFilteredResult(_0x2cf193,_0x3a39fc){return function(_0xe570a6){if(_0xe570a6){var _0x4bf6c6=typeof _0x3a39fc[_0x821b('0x12')]===_0x821b('0x13')&&typeof _0x3a39fc[_0x821b('0x14')]==='undefined';var _0x12e68f=_0xe570a6['count'];var _0x205a49=_0x4bf6c6?0x0:_0x3a39fc['offset'];var _0x2116a2=_0x4bf6c6?_0xe570a6[_0x821b('0x15')]:_0x3a39fc[_0x821b('0x12')]+_0x3a39fc[_0x821b('0x14')];var _0x32b2ed;if(_0x2116a2>=_0x12e68f){_0x2116a2=_0x12e68f;_0x32b2ed=0xc8;}else{_0x32b2ed=0xce;}_0x2cf193[_0x821b('0xf')](_0x32b2ed);return _0x2cf193[_0x821b('0x16')](_0x821b('0x17'),_0x205a49+'-'+_0x2116a2+'/'+_0x12e68f)[_0x821b('0x11')](_0xe570a6);}return null;};}function saveUpdates(_0x429738){return function(_0x455f0e){if(_0x455f0e){return _0x455f0e[_0x821b('0x18')](_0x429738)[_0x821b('0x19')](function(_0x516684){return _0x516684;});}return null;};}function removeEntity(_0x22b3be){return function(_0x4e6c45){if(_0x4e6c45){return _0x4e6c45['destroy']()[_0x821b('0x19')](function(){_0x22b3be[_0x821b('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35b341){return function(_0x568a74){if(!_0x568a74){_0x35b341[_0x821b('0xe')](0x194);}return _0x568a74;};}function handleError(_0x51120b,_0x54e8f1){_0x54e8f1=_0x54e8f1||0x1f4;return function(_0x188f0d){logger['error'](_0x188f0d['stack']);if(_0x188f0d[_0x821b('0x1a')]){delete _0x188f0d['name'];}_0x51120b['status'](_0x54e8f1)['send'](_0x188f0d);};}exports[_0x821b('0x1b')]=function(_0x50a91a,_0x4d9466){var _0x1a5590={};var _0x4832ea=_[_0x821b('0x1c')](db['OpenchannelInteraction'][_0x821b('0x1d')],function(_0xeafe4){return{'name':_0xeafe4[_0x821b('0x1e')],'type':_0xeafe4[_0x821b('0x1f')][_0x821b('0x20')]};});_0x1a5590=qs[_0x821b('0x21')](_0x4832ea,_0x50a91a);return interaction[_0x821b('0x22')](_0x821b('0x23'),_0x50a91a[_0x821b('0x24')],_0x50a91a[_0x821b('0x25')],_0x1a5590,_0x4832ea)['then'](respondWithFilteredResult(_0x4d9466,_0x1a5590))[_0x821b('0x26')](handleError(_0x4d9466,null));};exports[_0x821b('0x27')]=function(_0xf0b0f1,_0x31dc29){var _0xa12d31={};if(_0xf0b0f1[_0x821b('0x24')][_0x821b('0x1f')]&&_0xf0b0f1['query'][_0x821b('0x1f')]===_0x821b('0x28')){_0xa12d31[_0x821b('0x28')]=_0xf0b0f1[_0x821b('0x29')]['id'];}else{_0xa12d31['id']=_0xf0b0f1[_0x821b('0x29')]['id'];}var _0xf44c5e={'raw':![],'where':_0xa12d31},_0x397066={};_0x397066['model']=_['keys'](db[_0x821b('0x2a')][_0x821b('0x1d')]);_0x397066[_0x821b('0x24')]=_[_0x821b('0x2b')](_0xf0b0f1['query']);_0x397066['filters']=_[_0x821b('0x2c')](_0x397066[_0x821b('0x2d')],_0x397066[_0x821b('0x24')]);_0xf44c5e[_0x821b('0x2e')]=_['intersection'](_0x397066[_0x821b('0x2d')],qs[_0x821b('0x2f')](_0xf0b0f1[_0x821b('0x24')][_0x821b('0x2f')]));_0xf44c5e[_0x821b('0x2e')]=_0xf44c5e['attributes'][_0x821b('0x30')]?_0xf44c5e[_0x821b('0x2e')]:_0x397066['model'];if(_0xf0b0f1['query']['includeAll']){_0xf44c5e[_0x821b('0x31')]=[{'all':!![]}];}_0xf44c5e=_[_0x821b('0x32')]({},_0xf44c5e,_0xf0b0f1[_0x821b('0x33')]);return db[_0x821b('0x2a')]['find'](_0xf44c5e)['then'](handleEntityNotFound(_0x31dc29,null))['then'](respondWithResult(_0x31dc29,null))[_0x821b('0x26')](handleError(_0x31dc29,null));};exports[_0x821b('0x34')]=function(_0x4ee0ea,_0x3939ef){return db[_0x821b('0x2a')]['create'](_0x4ee0ea[_0x821b('0x35')],{})[_0x821b('0x19')](respondWithResult(_0x3939ef,0xc9))[_0x821b('0x26')](handleError(_0x3939ef,null));};exports[_0x821b('0x18')]=function(_0x46ff3a,_0x4c8170){if(_0x46ff3a[_0x821b('0x35')]['id']){delete _0x46ff3a[_0x821b('0x35')]['id'];}return db[_0x821b('0x2a')][_0x821b('0x36')]({'where':{'id':_0x46ff3a[_0x821b('0x29')]['id']}})['then'](handleEntityNotFound(_0x4c8170,null))[_0x821b('0x19')](saveUpdates(_0x46ff3a[_0x821b('0x35')],null))[_0x821b('0x19')](respondWithResult(_0x4c8170,null))[_0x821b('0x26')](handleError(_0x4c8170,null));};exports[_0x821b('0x37')]=function(_0x4d67af,_0xdd34cb){return db[_0x821b('0x2a')][_0x821b('0x36')]({'where':{'id':_0x4d67af['params']['id']}})['then'](handleEntityNotFound(_0xdd34cb,null))['then'](removeEntity(_0xdd34cb,null))['catch'](handleError(_0xdd34cb,null));};exports[_0x821b('0x38')]=function(_0x5608e8,_0x389c3b){return db[_0x821b('0x2a')]['describe']()[_0x821b('0x19')](respondWithResult(_0x389c3b,null))[_0x821b('0x26')](handleError(_0x389c3b,null));};exports[_0x821b('0x39')]=function(_0x253726,_0x24cb7f){return db[_0x821b('0x3a')][_0x821b('0x36')]({'where':{'id':_0x253726['params']['id']}})[_0x821b('0x19')](handleEntityNotFound(_0x24cb7f,null))[_0x821b('0x19')](function(_0x2feabd){if(_0x2feabd){return _0x2feabd['addMessage'](_0x253726[_0x821b('0x35')][_0x821b('0x3b')],_['omit'](_0x253726[_0x821b('0x35')],[_0x821b('0x3b'),'id'])||{});}})[_0x821b('0x19')](respondWithResult(_0x24cb7f,null))[_0x821b('0x26')](handleError(_0x24cb7f,null));};exports[_0x821b('0x3c')]=function(_0x20f3eb,_0x34f49e){var _0x2e9adc={'raw':![],'where':{}};var _0x274223={};var _0x5515c5={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x20f3eb['params']['id']}})[_0x821b('0x19')](handleEntityNotFound(_0x34f49e,null))[_0x821b('0x19')](function(_0x59368e){if(_0x59368e){_0x274223[_0x821b('0x2d')]=_[_0x821b('0x2b')](db['OpenchannelMessage'][_0x821b('0x1d')]);_0x274223[_0x821b('0x24')]=_[_0x821b('0x2b')](_0x20f3eb[_0x821b('0x24')]);_0x274223[_0x821b('0x3d')]=_[_0x821b('0x2c')](_0x274223[_0x821b('0x2d')],_0x274223[_0x821b('0x24')]);_0x2e9adc[_0x821b('0x2e')]=_[_0x821b('0x2c')](_0x274223['model'],qs[_0x821b('0x2f')](_0x20f3eb[_0x821b('0x24')][_0x821b('0x2f')]));_0x2e9adc[_0x821b('0x2e')]=_0x2e9adc[_0x821b('0x2e')][_0x821b('0x30')]?_0x2e9adc[_0x821b('0x2e')]:_0x274223['model'];if(!_0x20f3eb['query'][_0x821b('0x3e')](_0x821b('0x3f'))){_0x2e9adc[_0x821b('0x14')]=qs[_0x821b('0x14')](_0x20f3eb[_0x821b('0x24')]['limit']);_0x2e9adc[_0x821b('0x12')]=qs[_0x821b('0x12')](_0x20f3eb['query'][_0x821b('0x12')]);}_0x2e9adc[_0x821b('0x40')]=qs[_0x821b('0x41')](_0x20f3eb[_0x821b('0x24')][_0x821b('0x41')]);_0x2e9adc[_0x821b('0x42')]=qs[_0x821b('0x3d')](_[_0x821b('0x43')](_0x20f3eb['query'],_0x274223['filters']));_0x2e9adc['where'][_0x821b('0x44')]=_0x59368e['id'];if(_0x20f3eb[_0x821b('0x24')][_0x821b('0x45')]){_0x2e9adc[_0x821b('0x42')]=_[_0x821b('0x32')](_0x2e9adc['where'],{'$or':_[_0x821b('0x1c')](_0x2e9adc[_0x821b('0x2e')],function(_0x5054e9){var _0x5527ce={};_0x5527ce[_0x5054e9]={'$like':'%'+_0x20f3eb[_0x821b('0x24')]['filter']+'%'};return _0x5527ce;})});}if(_0x20f3eb['query']['$gte']){var _0x43743f=_0x20f3eb['query'][_0x821b('0x46')][_0x821b('0x47')](',');var _0x4cf8fa={};_0x4cf8fa[_0x43743f[0x0]]={'$gte':moment(_0x43743f[0x1])['format'](_0x821b('0x48'))};_0x2e9adc['where']=_['merge'](_0x2e9adc['where'],_0x4cf8fa);}_0x2e9adc=_[_0x821b('0x32')]({},_0x2e9adc,_0x20f3eb['options']);return db[_0x821b('0x3a')]['count']({'where':_0x2e9adc[_0x821b('0x42')]})['then'](function(_0x55cc8e){_0x5515c5[_0x821b('0x15')]=_0x55cc8e;if(_0x20f3eb[_0x821b('0x24')]['includeAll']){_0x2e9adc[_0x821b('0x31')]=[{'all':!![]}];}return db[_0x821b('0x3a')][_0x821b('0x22')](_0x2e9adc);})[_0x821b('0x19')](function(_0x2902f8){_0x5515c5[_0x821b('0x49')]=_0x2902f8;return _0x5515c5;});}})[_0x821b('0x19')](respondWithFilteredResult(_0x34f49e,_0x2e9adc))[_0x821b('0x26')](handleError(_0x34f49e,null));};exports['addTags']=function(_0x220d45,_0x37fefa){return db[_0x821b('0x2a')]['find']({'where':{'id':_0x220d45[_0x821b('0x29')]['id']}})[_0x821b('0x19')](handleEntityNotFound(_0x37fefa,null))['then'](function(_0x584a2a){if(_0x584a2a){return _0x584a2a[_0x821b('0x4a')](_0x220d45[_0x821b('0x35')][_0x821b('0x3b')],_[_0x821b('0x4b')](_0x220d45[_0x821b('0x35')],[_0x821b('0x3b'),'id'])||{})[_0x821b('0x4c')](function(){return db[_0x821b('0x4d')][_0x821b('0x22')]({'attributes':['id',_0x821b('0x1a'),_0x821b('0x4e')],'where':{'id':_0x220d45[_0x821b('0x35')][_0x821b('0x3b')]}});})[_0x821b('0x19')](function(_0x1a27f4){socket['emit'](_0x821b('0x4f'),{'id':Number(_0x220d45['params']['id']),'tags':_0x1a27f4||[]});return{'id':Number(_0x220d45['params']['id']),'tags':_0x1a27f4||[]};});}})[_0x821b('0x19')](respondWithResult(_0x37fefa,null))[_0x821b('0x26')](handleError(_0x37fefa,null));};exports[_0x821b('0x50')]=function(_0x45ba57,_0x3ae422){return db[_0x821b('0x2a')][_0x821b('0x36')]({'where':{'id':_0x45ba57['params']['id']}})[_0x821b('0x19')](handleEntityNotFound(_0x3ae422,null))[_0x821b('0x19')](function(_0x38593b){if(_0x38593b){return _0x38593b[_0x821b('0x50')](_0x45ba57[_0x821b('0x24')][_0x821b('0x3b')]);}})['then'](respondWithStatusCode(_0x3ae422,null))[_0x821b('0x26')](handleError(_0x3ae422,null));};exports[_0x821b('0x51')]=function(_0x2225bd,_0x5dbcf6){var _0x95bbde=moment()[_0x821b('0x52')]()['toString']();var _0x28fe0e=path[_0x821b('0x53')](config[_0x821b('0x54')],_0x821b('0x55'),_0x821b('0x56'),'tmp');var _0x2b0459=path['join'](config[_0x821b('0x54')],'server',_0x821b('0x56'),_0x821b('0x57'));var _0x11590d=path[_0x821b('0x53')](_0x28fe0e,_0x95bbde);var _0x301abd=util[_0x821b('0x58')](_0x821b('0x59'),_0x2225bd[_0x821b('0x29')]['id'],_0x95bbde);var _0x5edbff=path[_0x821b('0x53')](_0x28fe0e,_0x301abd);var _0x206802=[];_0x206802[_0x821b('0x5a')]({'model':db[_0x821b('0x5b')],'as':_0x821b('0x5b'),'attributes':['id','fullname'],'raw':!![]});_0x206802[_0x821b('0x5a')]({'model':db[_0x821b('0x5c')],'as':'Contact','attributes':['id',_0x821b('0x5d'),_0x821b('0x5e')],'raw':!![]});if(_0x2225bd['query']['attachments']){_0x206802[_0x821b('0x5a')]({'model':db[_0x821b('0x5f')],'as':_0x821b('0x5f'),'raw':!![]});}var _0x5e408d=[{'model':db[_0x821b('0x3a')],'as':_0x821b('0x60'),'attributes':['id',_0x821b('0x35'),_0x821b('0x61'),'direction',_0x821b('0x62'),_0x821b('0x63')],'include':_0x206802}];_0x5e408d[_0x821b('0x5a')]({'model':db['OpenchannelAccount'],'as':_0x821b('0x64'),'attributes':['id',_0x821b('0x1a')]});_0x5e408d['push']({'model':db['User'],'as':_0x821b('0x65'),'attributes':['id',_0x821b('0x66')]});return db['OpenchannelInteraction'][_0x821b('0x36')]({'where':{'id':_0x2225bd['params']['id']},'include':_0x5e408d})[_0x821b('0x19')](handleEntityNotFound(_0x5dbcf6,null))[_0x821b('0x19')](function(_0x1ce459){if(_0x1ce459){var _0x11657e=_0x1ce459[_0x821b('0x67')]({'plain':!![]});fs['mkdirSync'](_0x11590d);var _0x34f3d9={'channel':_0x821b('0x68'),'account':_0x11657e[_0x821b('0x64')][_0x821b('0x1a')],'agent':_0x11657e[_0x821b('0x65')]?_0x11657e[_0x821b('0x65')][_0x821b('0x66')]:'N.A.','createdAt':moment(_0x11657e[_0x821b('0x61')])[_0x821b('0x58')](_0x821b('0x48'))['toString'](),'closedAt':_0x11657e[_0x821b('0x69')]?moment(_0x11657e[_0x821b('0x6a')])[_0x821b('0x58')]('YYYY-MM-DD\x20HH:mm:ss')[_0x821b('0x6b')]():'','disposition':_0x11657e['disposition'],'visibility':_0x11657e[_0x821b('0x6c')]?_0x821b('0x6d'):_0x821b('0x6e'),'messages':_(_0x11657e[_0x821b('0x60')])['filter']({'secret':![]})[_0x821b('0x1c')](function(_0x363db6){if(_0x363db6['Attachment']){var _0x2ff4f9=path[_0x821b('0x53')](_0x2b0459,_0x363db6[_0x821b('0x5f')][_0x821b('0x6f')]);if(fs[_0x821b('0x70')](_0x2ff4f9)){fs[_0x821b('0x71')](_0x2ff4f9)['pipe'](fs[_0x821b('0x72')](path['join'](_0x11590d,_0x363db6['Attachment']['basename'])));}}return{'date':moment(_0x363db6[_0x821b('0x61')])[_0x821b('0x58')](_0x821b('0x48'))[_0x821b('0x6b')](),'sender':_0x363db6[_0x821b('0x73')]===_0x821b('0x74')?_0x363db6[_0x821b('0x5b')]?_0x363db6[_0x821b('0x5b')]['fullname']:'System':_0x363db6[_0x821b('0x75')][_0x821b('0x5d')]+(_0x363db6[_0x821b('0x75')][_0x821b('0x5e')]?'\x20'+_0x363db6[_0x821b('0x75')][_0x821b('0x5e')]:''),'body':_0x363db6[_0x821b('0x5f')]?_0x363db6[_0x821b('0x5f')][_0x821b('0x6f')]:_0x363db6['body'],'direction':_0x363db6['direction']===_0x821b('0x74')?'A':'C','secret':_0x363db6[_0x821b('0x62')],'read':_0x363db6[_0x821b('0x63')],'attachment':_0x363db6[_0x821b('0x5f')]};})[_0x821b('0x76')]()};return ejs['renderFile'](path[_0x821b('0x53')](config['root'],_0x821b('0x55'),_0x821b('0x77'),_0x821b('0x78')),{'interaction':_0x34f3d9})[_0x821b('0x19')](function(_0x5e69b8){var _0x5c3221=path[_0x821b('0x53')](_0x11590d,_0x821b('0x79')+_0x11657e['id']+'-'+_0x95bbde+_0x821b('0x7a'));var _0x5042c0={'path':_0x5c3221,'channel':_0x821b('0x68'),'interactionId':_0x11657e['id']};return pdf[_0x821b('0x7b')](_0x5e69b8,_0x5042c0);})['then'](function(){return new Promise(function(_0x4b2759,_0x333d6b){zipdir(_0x11590d,{'saveTo':_0x5edbff},function(_0x4daf4d,_0x31bc53){if(_0x4daf4d)return _0x333d6b(_0x4daf4d);return _0x4b2759(_0x31bc53);});})[_0x821b('0x19')](function(){return new Promise(function(_0x119609,_0x152ab4){rimraf(_0x11590d,function(_0xdd68ad){if(_0xdd68ad)_0x152ab4(_0xdd68ad);return _0x119609();});});})[_0x821b('0x19')](function(){return _0x5dbcf6['download'](_0x5edbff,_0x301abd,function(_0x1ddccc){if(_0x1ddccc){logger[_0x821b('0x7c')](_0x821b('0x7d'),_0x1ddccc);}else{fs[_0x821b('0x7e')](_0x5edbff);}});});});}else{return _0x5dbcf6['sendStatus'](0xc8);}})[_0x821b('0x26')](handleError(_0x5dbcf6,null));}; \ No newline at end of file +var _0xe72a=['Account','get','mkdirSync','Openchannel','closed','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','pipe','createWriteStream','out','System','read','value','renderFile','views','createPdfFromHTML','rimraf','zip-dir','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','user','catch','from','params','keys','OpenchannelInteraction','filters','model','attributes','fields','length','includeAll','include','options','find','create','body','update','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','intersection','hasOwnProperty','nolimit','order','sort','where','OpenchannelInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','findAll','rows','setTags','Tag','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','push','User','fullname','Contact','firstName','lastName','attachments','Attachment','createdAt','direction','secret','OpenchannelAccount'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0xe72a,0x17b));var _0xae72=function(_0x3b8c5a,_0x5ecc86){_0x3b8c5a=_0x3b8c5a-0x0;var _0x3e0e23=_0xe72a[_0x3b8c5a];return _0x3e0e23;};'use strict';var rimraf=require(_0xae72('0x0'));var zipdir=require(_0xae72('0x1'));var moment=require('moment');var util=require(_0xae72('0x2'));var path=require(_0xae72('0x3'));var ejs=require(_0xae72('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xae72('0x5'));var qs=require(_0xae72('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xae72('0x7'));var config=require('../../config/environment');var db=require(_0xae72('0x8'))['db'];config['redis']=_[_0xae72('0x9')](config['redis'],{'host':_0xae72('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xae72('0xb'))[_0xae72('0xc')](socket);function respondWithStatusCode(_0x2af5a3,_0x2f8a1e){_0x2f8a1e=_0x2f8a1e||0xcc;return function(_0x95b8ef){if(_0x95b8ef){return _0x2af5a3[_0xae72('0xd')](_0x2f8a1e);}return _0x2af5a3[_0xae72('0xe')](_0x2f8a1e)[_0xae72('0xf')]();};}function respondWithResult(_0x79ecac,_0x7ed035){_0x7ed035=_0x7ed035||0xc8;return function(_0x53a3b8){if(_0x53a3b8){return _0x79ecac['status'](_0x7ed035)[_0xae72('0x10')](_0x53a3b8);}};}function respondWithFilteredResult(_0x321026,_0x58636a){return function(_0x31a267){if(_0x31a267){var _0x55fdc4=typeof _0x58636a['offset']===_0xae72('0x11')&&typeof _0x58636a['limit']==='undefined';var _0x20c1a6=_0x31a267['count'];var _0x13940e=_0x55fdc4?0x0:_0x58636a[_0xae72('0x12')];var _0x2bcbbd=_0x55fdc4?_0x31a267['count']:_0x58636a[_0xae72('0x12')]+_0x58636a[_0xae72('0x13')];var _0x550184;if(_0x2bcbbd>=_0x20c1a6){_0x2bcbbd=_0x20c1a6;_0x550184=0xc8;}else{_0x550184=0xce;}_0x321026[_0xae72('0xe')](_0x550184);return _0x321026[_0xae72('0x14')](_0xae72('0x15'),_0x13940e+'-'+_0x2bcbbd+'/'+_0x20c1a6)[_0xae72('0x10')](_0x31a267);}return null;};}function saveUpdates(_0x39bef3){return function(_0x3f0bb0){if(_0x3f0bb0){return _0x3f0bb0['update'](_0x39bef3)[_0xae72('0x16')](function(_0x22ed0d){return _0x22ed0d;});}return null;};}function removeEntity(_0x31e4b6){return function(_0x4b4b20){if(_0x4b4b20){return _0x4b4b20['destroy']()['then'](function(){_0x31e4b6[_0xae72('0xe')](0xcc)[_0xae72('0xf')]();});}};}function handleEntityNotFound(_0x42ba7e){return function(_0x3db6c6){if(!_0x3db6c6){_0x42ba7e[_0xae72('0xd')](0x194);}return _0x3db6c6;};}function handleError(_0x2dd155,_0x369650){_0x369650=_0x369650||0x1f4;return function(_0x5bb93f){logger[_0xae72('0x17')](_0x5bb93f[_0xae72('0x18')]);if(_0x5bb93f[_0xae72('0x19')]){delete _0x5bb93f[_0xae72('0x19')];}_0x2dd155[_0xae72('0xe')](_0x369650)[_0xae72('0x1a')](_0x5bb93f);};}exports[_0xae72('0x1b')]=function(_0x21170a,_0x239c6a){var _0x4c3a39={};var _0x21b777=_[_0xae72('0x1c')](db['OpenchannelInteraction'][_0xae72('0x1d')],function(_0x278638){return{'name':_0x278638[_0xae72('0x1e')],'type':_0x278638[_0xae72('0x1f')]['key']};});_0x4c3a39=qs['getOptions'](_0x21b777,_0x21170a);return interaction['findAll']('openchannel',_0x21170a[_0xae72('0x20')],_0x21170a[_0xae72('0x21')],_0x4c3a39,_0x21b777)[_0xae72('0x16')](respondWithFilteredResult(_0x239c6a,_0x4c3a39))[_0xae72('0x22')](handleError(_0x239c6a,null));};exports['show']=function(_0xdb36c0,_0x4298c0){var _0x38987c={};if(_0xdb36c0[_0xae72('0x20')][_0xae72('0x1f')]&&_0xdb36c0[_0xae72('0x20')][_0xae72('0x1f')]==='from'){_0x38987c[_0xae72('0x23')]=_0xdb36c0[_0xae72('0x24')]['id'];}else{_0x38987c['id']=_0xdb36c0[_0xae72('0x24')]['id'];}var _0xf86a6b={'raw':![],'where':_0x38987c},_0x3a5033={};_0x3a5033['model']=_[_0xae72('0x25')](db[_0xae72('0x26')][_0xae72('0x1d')]);_0x3a5033[_0xae72('0x20')]=_[_0xae72('0x25')](_0xdb36c0['query']);_0x3a5033[_0xae72('0x27')]=_['intersection'](_0x3a5033[_0xae72('0x28')],_0x3a5033['query']);_0xf86a6b[_0xae72('0x29')]=_['intersection'](_0x3a5033['model'],qs[_0xae72('0x2a')](_0xdb36c0[_0xae72('0x20')][_0xae72('0x2a')]));_0xf86a6b[_0xae72('0x29')]=_0xf86a6b[_0xae72('0x29')][_0xae72('0x2b')]?_0xf86a6b[_0xae72('0x29')]:_0x3a5033[_0xae72('0x28')];if(_0xdb36c0[_0xae72('0x20')][_0xae72('0x2c')]){_0xf86a6b[_0xae72('0x2d')]=[{'all':!![]}];}_0xf86a6b=_['merge']({},_0xf86a6b,_0xdb36c0[_0xae72('0x2e')]);return db[_0xae72('0x26')][_0xae72('0x2f')](_0xf86a6b)[_0xae72('0x16')](handleEntityNotFound(_0x4298c0,null))['then'](respondWithResult(_0x4298c0,null))[_0xae72('0x22')](handleError(_0x4298c0,null));};exports[_0xae72('0x30')]=function(_0x4a9321,_0x465a32){return db['OpenchannelInteraction'][_0xae72('0x30')](_0x4a9321[_0xae72('0x31')],{})[_0xae72('0x16')](respondWithResult(_0x465a32,0xc9))[_0xae72('0x22')](handleError(_0x465a32,null));};exports[_0xae72('0x32')]=function(_0x3990a2,_0x189a06){if(_0x3990a2[_0xae72('0x31')]['id']){delete _0x3990a2['body']['id'];}return db['OpenchannelInteraction'][_0xae72('0x2f')]({'where':{'id':_0x3990a2[_0xae72('0x24')]['id']}})[_0xae72('0x16')](handleEntityNotFound(_0x189a06,null))[_0xae72('0x16')](saveUpdates(_0x3990a2[_0xae72('0x31')],null))['then'](respondWithResult(_0x189a06,null))[_0xae72('0x22')](handleError(_0x189a06,null));};exports['destroy']=function(_0x57d596,_0x40c799){return db['OpenchannelInteraction'][_0xae72('0x2f')]({'where':{'id':_0x57d596[_0xae72('0x24')]['id']}})[_0xae72('0x16')](handleEntityNotFound(_0x40c799,null))[_0xae72('0x16')](removeEntity(_0x40c799,null))['catch'](handleError(_0x40c799,null));};exports[_0xae72('0x33')]=function(_0x11d45b,_0xfb8971){return db[_0xae72('0x26')][_0xae72('0x33')]()[_0xae72('0x16')](respondWithResult(_0xfb8971,null))[_0xae72('0x22')](handleError(_0xfb8971,null));};exports[_0xae72('0x34')]=function(_0x9ba40f,_0x5cb841){return db['OpenchannelMessage'][_0xae72('0x2f')]({'where':{'id':_0x9ba40f[_0xae72('0x24')]['id']}})[_0xae72('0x16')](handleEntityNotFound(_0x5cb841,null))[_0xae72('0x16')](function(_0x24b377){if(_0x24b377){return _0x24b377[_0xae72('0x34')](_0x9ba40f[_0xae72('0x31')][_0xae72('0x35')],_[_0xae72('0x36')](_0x9ba40f['body'],[_0xae72('0x35'),'id'])||{});}})[_0xae72('0x16')](respondWithResult(_0x5cb841,null))[_0xae72('0x22')](handleError(_0x5cb841,null));};exports[_0xae72('0x37')]=function(_0x51633b,_0x78f92e){var _0x2c05cd={'raw':![],'where':{}};var _0x34bbb2={};var _0x2b49d9={'count':0x0,'rows':[]};return db[_0xae72('0x26')][_0xae72('0x38')]({'where':{'id':_0x51633b['params']['id']}})[_0xae72('0x16')](handleEntityNotFound(_0x78f92e,null))[_0xae72('0x16')](function(_0x346174){if(_0x346174){_0x34bbb2[_0xae72('0x28')]=_['keys'](db[_0xae72('0x39')]['rawAttributes']);_0x34bbb2['query']=_[_0xae72('0x25')](_0x51633b[_0xae72('0x20')]);_0x34bbb2[_0xae72('0x27')]=_['intersection'](_0x34bbb2[_0xae72('0x28')],_0x34bbb2[_0xae72('0x20')]);_0x2c05cd[_0xae72('0x29')]=_[_0xae72('0x3a')](_0x34bbb2['model'],qs[_0xae72('0x2a')](_0x51633b[_0xae72('0x20')][_0xae72('0x2a')]));_0x2c05cd[_0xae72('0x29')]=_0x2c05cd[_0xae72('0x29')]['length']?_0x2c05cd['attributes']:_0x34bbb2[_0xae72('0x28')];if(!_0x51633b[_0xae72('0x20')][_0xae72('0x3b')](_0xae72('0x3c'))){_0x2c05cd['limit']=qs[_0xae72('0x13')](_0x51633b[_0xae72('0x20')][_0xae72('0x13')]);_0x2c05cd['offset']=qs[_0xae72('0x12')](_0x51633b[_0xae72('0x20')][_0xae72('0x12')]);}_0x2c05cd[_0xae72('0x3d')]=qs[_0xae72('0x3e')](_0x51633b['query'][_0xae72('0x3e')]);_0x2c05cd[_0xae72('0x3f')]=qs[_0xae72('0x27')](_['pick'](_0x51633b[_0xae72('0x20')],_0x34bbb2[_0xae72('0x27')]));_0x2c05cd['where'][_0xae72('0x40')]=_0x346174['id'];if(_0x51633b[_0xae72('0x20')][_0xae72('0x41')]){_0x2c05cd[_0xae72('0x3f')]=_[_0xae72('0x42')](_0x2c05cd[_0xae72('0x3f')],{'$or':_[_0xae72('0x1c')](_0x2c05cd[_0xae72('0x29')],function(_0x537b16){var _0x24e330={};_0x24e330[_0x537b16]={'$like':'%'+_0x51633b['query']['filter']+'%'};return _0x24e330;})});}if(_0x51633b['query'][_0xae72('0x43')]){var _0x4c4c44=_0x51633b['query']['$gte'][_0xae72('0x44')](',');var _0x4b1871={};_0x4b1871[_0x4c4c44[0x0]]={'$gte':moment(_0x4c4c44[0x1])[_0xae72('0x45')](_0xae72('0x46'))};_0x2c05cd[_0xae72('0x3f')]=_['merge'](_0x2c05cd[_0xae72('0x3f')],_0x4b1871);}_0x2c05cd=_[_0xae72('0x42')]({},_0x2c05cd,_0x51633b['options']);return db['OpenchannelMessage'][_0xae72('0x47')]({'where':_0x2c05cd['where']})[_0xae72('0x16')](function(_0x517c7c){_0x2b49d9[_0xae72('0x47')]=_0x517c7c;if(_0x51633b[_0xae72('0x20')][_0xae72('0x2c')]){_0x2c05cd[_0xae72('0x2d')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xae72('0x48')](_0x2c05cd);})['then'](function(_0x31bd0a){_0x2b49d9[_0xae72('0x49')]=_0x31bd0a;return _0x2b49d9;});}})[_0xae72('0x16')](respondWithFilteredResult(_0x78f92e,_0x2c05cd))[_0xae72('0x22')](handleError(_0x78f92e,null));};exports['addTags']=function(_0x591525,_0xe70674){return db[_0xae72('0x26')][_0xae72('0x2f')]({'where':{'id':_0x591525[_0xae72('0x24')]['id']}})[_0xae72('0x16')](handleEntityNotFound(_0xe70674,null))[_0xae72('0x16')](function(_0x3256dd){if(_0x3256dd){return _0x3256dd[_0xae72('0x4a')](_0x591525[_0xae72('0x31')][_0xae72('0x35')],_[_0xae72('0x36')](_0x591525[_0xae72('0x31')],['ids','id'])||{})['spread'](function(){return db[_0xae72('0x4b')][_0xae72('0x48')]({'attributes':['id',_0xae72('0x19'),'color'],'where':{'id':_0x591525['body'][_0xae72('0x35')]}});})[_0xae72('0x16')](function(_0xc721d2){socket['emit'](_0xae72('0x4c'),{'id':Number(_0x591525[_0xae72('0x24')]['id']),'tags':_0xc721d2||[]});return{'id':Number(_0x591525['params']['id']),'tags':_0xc721d2||[]};});}})[_0xae72('0x16')](respondWithResult(_0xe70674,null))[_0xae72('0x22')](handleError(_0xe70674,null));};exports[_0xae72('0x4d')]=function(_0x2c9cb8,_0x429e55){return db[_0xae72('0x26')][_0xae72('0x2f')]({'where':{'id':_0x2c9cb8[_0xae72('0x24')]['id']}})[_0xae72('0x16')](handleEntityNotFound(_0x429e55,null))['then'](function(_0x296377){if(_0x296377){return _0x296377[_0xae72('0x4d')](_0x2c9cb8[_0xae72('0x20')][_0xae72('0x35')]);}})[_0xae72('0x16')](respondWithStatusCode(_0x429e55,null))[_0xae72('0x22')](handleError(_0x429e55,null));};exports[_0xae72('0x4e')]=function(_0x331de3,_0x55e8b7){var _0xe33086=moment()[_0xae72('0x4f')]()[_0xae72('0x50')]();var _0x4a0f69=path[_0xae72('0x51')](config[_0xae72('0x52')],_0xae72('0x53'),_0xae72('0x54'),'tmp');var _0x5c639b=path[_0xae72('0x51')](config[_0xae72('0x52')],'server','files','attachments');var _0x3cea96=path[_0xae72('0x51')](_0x4a0f69,_0xe33086);var _0x25b308=util[_0xae72('0x45')]('transcript-%d-%s.zip',_0x331de3[_0xae72('0x24')]['id'],_0xe33086);var _0x34f0a2=path['join'](_0x4a0f69,_0x25b308);var _0x1a19d3=[];_0x1a19d3[_0xae72('0x55')]({'model':db[_0xae72('0x56')],'as':_0xae72('0x56'),'attributes':['id',_0xae72('0x57')],'raw':!![]});_0x1a19d3[_0xae72('0x55')]({'model':db['CmContact'],'as':_0xae72('0x58'),'attributes':['id',_0xae72('0x59'),_0xae72('0x5a')],'raw':!![]});if(_0x331de3[_0xae72('0x20')][_0xae72('0x5b')]){_0x1a19d3['push']({'model':db[_0xae72('0x5c')],'as':'Attachment','raw':!![]});}var _0x4145d5=[{'model':db[_0xae72('0x39')],'as':'Messages','attributes':['id',_0xae72('0x31'),_0xae72('0x5d'),_0xae72('0x5e'),_0xae72('0x5f'),'read'],'include':_0x1a19d3}];_0x4145d5[_0xae72('0x55')]({'model':db[_0xae72('0x60')],'as':_0xae72('0x61'),'attributes':['id',_0xae72('0x19')]});_0x4145d5['push']({'model':db[_0xae72('0x56')],'as':'Owner','attributes':['id',_0xae72('0x57')]});return db[_0xae72('0x26')]['find']({'where':{'id':_0x331de3['params']['id']},'include':_0x4145d5})['then'](handleEntityNotFound(_0x55e8b7,null))['then'](function(_0x367a43){if(_0x367a43){var _0x4cce9c=_0x367a43[_0xae72('0x62')]({'plain':!![]});fs[_0xae72('0x63')](_0x3cea96);var _0x2ea618={'channel':_0xae72('0x64'),'account':_0x4cce9c[_0xae72('0x61')][_0xae72('0x19')],'agent':_0x4cce9c['Owner']?_0x4cce9c['Owner'][_0xae72('0x57')]:'N.A.','createdAt':moment(_0x4cce9c[_0xae72('0x5d')])[_0xae72('0x45')](_0xae72('0x46'))[_0xae72('0x50')](),'closedAt':_0x4cce9c[_0xae72('0x65')]?moment(_0x4cce9c[_0xae72('0x66')])[_0xae72('0x45')](_0xae72('0x46'))[_0xae72('0x50')]():'','disposition':_0x4cce9c[_0xae72('0x67')],'visibility':_0x4cce9c[_0xae72('0x68')]?_0xae72('0x69'):_0xae72('0x6a'),'messages':_(_0x4cce9c[_0xae72('0x6b')])[_0xae72('0x41')]({'secret':![]})[_0xae72('0x1c')](function(_0x1eeef4){if(_0x1eeef4[_0xae72('0x5c')]){var _0x1a7fca=path[_0xae72('0x51')](_0x5c639b,_0x1eeef4['Attachment'][_0xae72('0x6c')]);if(fs[_0xae72('0x6d')](_0x1a7fca)){fs['createReadStream'](_0x1a7fca)[_0xae72('0x6e')](fs[_0xae72('0x6f')](path[_0xae72('0x51')](_0x3cea96,_0x1eeef4[_0xae72('0x5c')][_0xae72('0x6c')])));}}return{'date':moment(_0x1eeef4['createdAt'])[_0xae72('0x45')](_0xae72('0x46'))[_0xae72('0x50')](),'sender':_0x1eeef4[_0xae72('0x5e')]===_0xae72('0x70')?_0x1eeef4[_0xae72('0x56')]?_0x1eeef4['User']['fullname']:_0xae72('0x71'):_0x1eeef4[_0xae72('0x58')][_0xae72('0x59')]+(_0x1eeef4['Contact'][_0xae72('0x5a')]?'\x20'+_0x1eeef4[_0xae72('0x58')]['lastName']:''),'body':_0x1eeef4['Attachment']?_0x1eeef4['Attachment'][_0xae72('0x6c')]:_0x1eeef4[_0xae72('0x31')],'direction':_0x1eeef4['direction']===_0xae72('0x70')?'A':'C','secret':_0x1eeef4[_0xae72('0x5f')],'read':_0x1eeef4[_0xae72('0x72')],'attachment':_0x1eeef4['Attachment']};})[_0xae72('0x73')]()};return ejs[_0xae72('0x74')](path[_0xae72('0x51')](config['root'],_0xae72('0x53'),_0xae72('0x75'),'downloadInteraction.ejs'),{'interaction':_0x2ea618})[_0xae72('0x16')](function(_0x5b7599){var _0x5a0614=path[_0xae72('0x51')](_0x3cea96,'transcript-'+_0x4cce9c['id']+'-'+_0xe33086+'.pdf');var _0x28da1e={'path':_0x5a0614,'channel':_0xae72('0x64'),'interactionId':_0x4cce9c['id']};return pdf[_0xae72('0x76')](_0x5b7599,_0x28da1e);})['then'](function(){return new Promise(function(_0x2e0f52,_0x4e9e94){zipdir(_0x3cea96,{'saveTo':_0x34f0a2},function(_0x37f005,_0x307463){if(_0x37f005)return _0x4e9e94(_0x37f005);return _0x2e0f52(_0x307463);});})[_0xae72('0x16')](function(){return new Promise(function(_0x2c5957,_0x4c8f99){rimraf(_0x3cea96,function(_0x38934e){if(_0x38934e)_0x4c8f99(_0x38934e);return _0x2c5957();});});})[_0xae72('0x16')](function(){return _0x55e8b7[_0xae72('0x4e')](_0x34f0a2,_0x25b308,function(_0x18c6b5){if(_0x18c6b5){logger[_0xae72('0x17')]('Unable\x20to\x20delete\x20zip\x20file',_0x18c6b5);}else{fs['unlinkSync'](_0x34f0a2);}});});});}else{return _0x55e8b7['sendStatus'](0xc8);}})[_0xae72('0x22')](handleError(_0x55e8b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 88c099f..d9e8846 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 _0x9dc7=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','then','setDataValue','Users','map','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9dc7,0x1de));var _0x79dc=function(_0x3a1715,_0x78965a){_0x3a1715=_0x3a1715-0x0;var _0xceb678=_0x9dc7[_0x3a1715];return _0xceb678;};'use strict';var EventEmitter=require(_0x79dc('0x0'));var OpenchannelInteraction=require(_0x79dc('0x1'))['db'][_0x79dc('0x2')];var OpenchannelMessage=require(_0x79dc('0x1'))['db'][_0x79dc('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x79dc('0x4')](0x0);var events={'afterCreate':_0x79dc('0x5'),'afterUpdate':'update','afterDestroy':_0x79dc('0x6')};function emitEvent(_0x5200bb){return function(_0x843b53,_0x159108,_0x3b19d7){_0x843b53['getUsers']({'attributes':['id'],'raw':!![]})[_0x79dc('0x7')](function(_0x18e9dd){_0x843b53[_0x79dc('0x8')](_0x79dc('0x9'),_0x18e9dd[_0x79dc('0xa')](function(_0x42c284){return{'id':_0x42c284['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x843b53['id'],'direction':'in','read':![]},'raw':!![]});})[_0x79dc('0x7')](function(_0xc54157){_0x843b53[_0x79dc('0x8')]('unreadMessages',_0xc54157[_0x79dc('0xb')]);OpenchannelInteractionEvents[_0x79dc('0xc')](_0x5200bb+':'+_0x843b53['id'],_0x843b53);OpenchannelInteractionEvents[_0x79dc('0xc')](_0x5200bb,_0x843b53);_0x3b19d7(null);})[_0x79dc('0xd')](_0x3b19d7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x79dc('0xe')](e,emitEvent(event));}}module[_0x79dc('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xf5c8=['exports','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5c8,0x1d2));var _0x8f5c=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0xf5c8[_0x2a8c21];return _0x5f3061;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x8f5c('0x0')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x8f5c('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8f5c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f5c('0x3'),'afterDestroy':_0x8f5c('0x4')};function emitEvent(_0x4a7f46){return function(_0x51ba35,_0x31b3af,_0x58718b){_0x51ba35['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x43414c){_0x51ba35['setDataValue'](_0x8f5c('0x5'),_0x43414c['map'](function(_0x5e4179){return{'id':_0x5e4179['id']};}));return OpenchannelMessage[_0x8f5c('0x6')]({'where':{'OpenchannelInteractionId':_0x51ba35['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8f5c('0x7')](function(_0x54c156){_0x51ba35['setDataValue'](_0x8f5c('0x8'),_0x54c156[_0x8f5c('0x9')]);OpenchannelInteractionEvents[_0x8f5c('0xa')](_0x4a7f46+':'+_0x51ba35['id'],_0x51ba35);OpenchannelInteractionEvents['emit'](_0x4a7f46,_0x51ba35);_0x58718b(null);})[_0x8f5c('0xb')](_0x58718b(null));};}for(var e in events){if(events[_0x8f5c('0xc')](e)){var event=events[e];OpenchannelInteraction[_0x8f5c('0xd')](e,emitEvent(event));}}module[_0x8f5c('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 ebf863c..6f9c64b 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 _0xd706=['request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xd706,0x1db));var _0x6d70=function(_0x20aa78,_0x34247b){_0x20aa78=_0x20aa78-0x0;var _0x1cd4e1=_0xd706[_0x20aa78];return _0x1cd4e1;};'use strict';var _=require(_0x6d70('0x0'));var util=require(_0x6d70('0x1'));var logger=require('../../config/logger')(_0x6d70('0x2'));var moment=require(_0x6d70('0x3'));var BPromise=require(_0x6d70('0x4'));var rp=require(_0x6d70('0x5'));var fs=require('fs');var path=require(_0x6d70('0x6'));var rimraf=require(_0x6d70('0x7'));var config=require(_0x6d70('0x8'));var attributes=require(_0x6d70('0x9'));module[_0x6d70('0xa')]=function(_0x12be6e,_0x19d23c){return _0x12be6e['define'](_0x6d70('0xb'),attributes,{'tableName':_0x6d70('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d70('0xd'),'collate':_0x6d70('0xe'),'hooks':{'beforeUpdate':function(_0x13f01e,_0x2083e9,_0x1b5314){if(_0x13f01e[_0x6d70('0xf')](_0x6d70('0x10'))){_0x13f01e[_0x6d70('0x11')]=moment()[_0x6d70('0x12')](_0x6d70('0x13'));}_0x1b5314(null,_0x13f01e);}}});}; \ No newline at end of file +var _0x27fa=['bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','lodash','util','../../config/logger','api','moment'];(function(_0x4bc67b,_0x51449f){var _0x2f4288=function(_0x26752a){while(--_0x26752a){_0x4bc67b['push'](_0x4bc67b['shift']());}};_0x2f4288(++_0x51449f);}(_0x27fa,0x1c3));var _0xa27f=function(_0x195907,_0x5ed072){_0x195907=_0x195907-0x0;var _0x1820f2=_0x27fa[_0x195907];return _0x1820f2;};'use strict';var _=require(_0xa27f('0x0'));var util=require(_0xa27f('0x1'));var logger=require(_0xa27f('0x2'))(_0xa27f('0x3'));var moment=require(_0xa27f('0x4'));var BPromise=require(_0xa27f('0x5'));var rp=require(_0xa27f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa27f('0x7'));var config=require(_0xa27f('0x8'));var attributes=require(_0xa27f('0x9'));module[_0xa27f('0xa')]=function(_0x8d23f8,_0x4c369a){return _0x8d23f8[_0xa27f('0xb')](_0xa27f('0xc'),attributes,{'tableName':_0xa27f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa27f('0xe'),'collate':_0xa27f('0xf'),'hooks':{'beforeUpdate':function(_0x53b310,_0x428cd6,_0x79db41){if(_0x53b310[_0xa27f('0x10')]('closed')){_0x53b310[_0xa27f('0x11')]=moment()[_0xa27f('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x79db41(null,_0x53b310);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index a05fe32..6c0afda 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 _0x2a01=['./openchannelInteraction.socket','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','addTags','body','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter'];(function(_0x4b3479,_0x187c0a){var _0x1d7df6=function(_0x277507){while(--_0x277507){_0x4b3479['push'](_0x4b3479['shift']());}};_0x1d7df6(++_0x187c0a);}(_0x2a01,0x15b));var _0x12a0=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x2a01[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x12a0('0x0'));var util=require('util');var moment=require(_0x12a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x12a0('0x2'));var fs=require('fs');var Redis=require(_0x12a0('0x3'));var db=require(_0x12a0('0x4'))['db'];var utils=require(_0x12a0('0x5'));var logger=require(_0x12a0('0x6'))(_0x12a0('0x7'));var config=require(_0x12a0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x12a0('0x9')](config[_0x12a0('0xa')],{'host':_0x12a0('0xb'),'port':0x18eb});var socket=require(_0x12a0('0xc'))(new Redis(config['redis']));require(_0x12a0('0xd'))['register'](socket);function respondWithRpcPromise(_0x23b9d5,_0x32c4b4,_0x1d8fbb){return new BPromise(function(_0x1bf4f0,_0x26a76b){return client['request'](_0x23b9d5,_0x1d8fbb)[_0x12a0('0xe')](function(_0x41e96b){logger[_0x12a0('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x32c4b4,_0x12a0('0x10'));logger['debug'](_0x12a0('0x11'),_0x32c4b4,_0x12a0('0x10'),JSON[_0x12a0('0x12')](_0x41e96b));if(_0x41e96b['error']){if(_0x41e96b[_0x12a0('0x13')][_0x12a0('0x14')]===0x1f4){logger['error'](_0x12a0('0x15'),_0x32c4b4,_0x41e96b['error'][_0x12a0('0x16')]);return _0x26a76b(_0x41e96b['error'][_0x12a0('0x16')]);}logger['error'](_0x12a0('0x15'),_0x32c4b4,_0x41e96b[_0x12a0('0x13')][_0x12a0('0x16')]);return _0x1bf4f0(_0x41e96b[_0x12a0('0x13')][_0x12a0('0x16')]);}else{logger[_0x12a0('0xf')](_0x12a0('0x15'),_0x32c4b4,'request\x20sent');_0x1bf4f0(_0x41e96b['result'][_0x12a0('0x16')]);}})[_0x12a0('0x17')](function(_0x2c163d){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x32c4b4,_0x2c163d);_0x26a76b(_0x2c163d);});});}exports[_0x12a0('0x18')]=function(_0x5a075b){var _0x563e95=this;return new Promise(function(_0x528bd4,_0x5a15b0){return db[_0x12a0('0x19')][_0x12a0('0x1a')](_0x5a075b['body'],{'raw':_0x5a075b[_0x12a0('0x1b')]?_0x5a075b[_0x12a0('0x1b')][_0x12a0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a075b[_0x12a0('0x1b')]?_0x5a075b[_0x12a0('0x1b')][_0x12a0('0x1d')]||null:null,'attributes':_0x5a075b['options']?_0x5a075b[_0x12a0('0x1b')][_0x12a0('0x1e')]||null:null,'limit':_0x5a075b['options']?_0x5a075b['options'][_0x12a0('0x1f')]||null:null})[_0x12a0('0xe')](function(_0x2bb5dd){logger[_0x12a0('0xf')]('UpdateOpenchannelInteraction',_0x5a075b);logger[_0x12a0('0x20')]('UpdateOpenchannelInteraction',_0x5a075b,JSON[_0x12a0('0x12')](_0x2bb5dd));_0x528bd4(_0x2bb5dd);})[_0x12a0('0x17')](function(_0x347f6f){logger['error'](_0x12a0('0x18'),_0x347f6f[_0x12a0('0x16')],_0x5a075b);_0x5a15b0(_0x563e95[_0x12a0('0x13')](0x1f4,_0x347f6f[_0x12a0('0x16')]));});});};exports[_0x12a0('0x21')]=function(_0x1eea8c){return new Promise(function(_0x224e1f,_0x26cdf0){return db[_0x12a0('0x19')][_0x12a0('0x22')]({'where':_0x1eea8c[_0x12a0('0x1b')]?_0x1eea8c['options'][_0x12a0('0x1d')]||null:null})[_0x12a0('0xe')](function(_0x169e22){if(_0x169e22){return _0x169e22[_0x12a0('0x23')](_0x1eea8c[_0x12a0('0x24')]['ids'],_['omit'](_0x1eea8c['body'],[_0x12a0('0x25'),'id'])||{});}})[_0x12a0('0x26')](function(_0x54ee9e){logger[_0x12a0('0xf')](_0x12a0('0x27'),_0x1eea8c);logger[_0x12a0('0x20')](_0x12a0('0x27'),_0x1eea8c,JSON[_0x12a0('0x12')](_0x54ee9e));_0x224e1f(_0x54ee9e);})['catch'](function(_0x51d42f){logger[_0x12a0('0x13')](_0x12a0('0x27'),_0x51d42f[_0x12a0('0x16')],_0x1eea8c);_0x26cdf0(_this[_0x12a0('0x13')](0x1f4,_0x51d42f[_0x12a0('0x16')]));});});}; \ No newline at end of file +var _0xc233=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc233,0x1ec));var _0x3c23=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0xc233[_0x1305e3];return _0x1068e9;};'use strict';var _=require(_0x3c23('0x0'));var util=require(_0x3c23('0x1'));var moment=require(_0x3c23('0x2'));var BPromise=require(_0x3c23('0x3'));var rs=require(_0x3c23('0x4'));var fs=require('fs');var Redis=require(_0x3c23('0x5'));var db=require(_0x3c23('0x6'))['db'];var utils=require(_0x3c23('0x7'));var logger=require(_0x3c23('0x8'))(_0x3c23('0x9'));var config=require(_0x3c23('0xa'));var jayson=require(_0x3c23('0xb'));var client=jayson[_0x3c23('0xc')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3c23('0xd')],{'host':_0x3c23('0xe'),'port':0x18eb});var socket=require(_0x3c23('0xf'))(new Redis(config['redis']));require(_0x3c23('0x10'))[_0x3c23('0x11')](socket);function respondWithRpcPromise(_0x8ff751,_0x3de2d1,_0x4281cc){return new BPromise(function(_0x4dd5d0,_0x3fd2fe){return client[_0x3c23('0x12')](_0x8ff751,_0x4281cc)[_0x3c23('0x13')](function(_0x1475b5){logger[_0x3c23('0x14')](_0x3c23('0x15'),_0x3de2d1,'request\x20sent');logger[_0x3c23('0x16')](_0x3c23('0x17'),_0x3de2d1,_0x3c23('0x18'),JSON[_0x3c23('0x19')](_0x1475b5));if(_0x1475b5['error']){if(_0x1475b5[_0x3c23('0x1a')][_0x3c23('0x1b')]===0x1f4){logger[_0x3c23('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3de2d1,_0x1475b5[_0x3c23('0x1a')]['message']);return _0x3fd2fe(_0x1475b5[_0x3c23('0x1a')][_0x3c23('0x1c')]);}logger[_0x3c23('0x1a')](_0x3c23('0x15'),_0x3de2d1,_0x1475b5[_0x3c23('0x1a')][_0x3c23('0x1c')]);return _0x4dd5d0(_0x1475b5[_0x3c23('0x1a')]['message']);}else{logger[_0x3c23('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3de2d1,_0x3c23('0x18'));_0x4dd5d0(_0x1475b5['result'][_0x3c23('0x1c')]);}})[_0x3c23('0x1d')](function(_0x296a1c){logger[_0x3c23('0x1a')](_0x3c23('0x15'),_0x3de2d1,_0x296a1c);_0x3fd2fe(_0x296a1c);});});}exports[_0x3c23('0x1e')]=function(_0x3ee09e){var _0x580a4e=this;return new Promise(function(_0x3ee1e8,_0xdebada){return db[_0x3c23('0x1f')][_0x3c23('0x20')](_0x3ee09e[_0x3c23('0x21')],{'raw':_0x3ee09e[_0x3c23('0x22')]?_0x3ee09e[_0x3c23('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ee09e[_0x3c23('0x22')]?_0x3ee09e[_0x3c23('0x22')][_0x3c23('0x23')]||null:null,'attributes':_0x3ee09e[_0x3c23('0x22')]?_0x3ee09e[_0x3c23('0x22')][_0x3c23('0x24')]||null:null,'limit':_0x3ee09e[_0x3c23('0x22')]?_0x3ee09e[_0x3c23('0x22')][_0x3c23('0x25')]||null:null})[_0x3c23('0x13')](function(_0x1ccf06){logger[_0x3c23('0x14')](_0x3c23('0x1e'),_0x3ee09e);logger['debug'](_0x3c23('0x1e'),_0x3ee09e,JSON[_0x3c23('0x19')](_0x1ccf06));_0x3ee1e8(_0x1ccf06);})['catch'](function(_0x227841){logger[_0x3c23('0x1a')](_0x3c23('0x1e'),_0x227841[_0x3c23('0x1c')],_0x3ee09e);_0xdebada(_0x580a4e[_0x3c23('0x1a')](0x1f4,_0x227841['message']));});});};exports[_0x3c23('0x26')]=function(_0x3654af){return new Promise(function(_0x37808a,_0x4afe5c){return db[_0x3c23('0x1f')][_0x3c23('0x27')]({'where':_0x3654af[_0x3c23('0x22')]?_0x3654af[_0x3c23('0x22')]['where']||null:null})['then'](function(_0x2462b9){if(_0x2462b9){return _0x2462b9[_0x3c23('0x28')](_0x3654af[_0x3c23('0x21')][_0x3c23('0x29')],_[_0x3c23('0x2a')](_0x3654af[_0x3c23('0x21')],['ids','id'])||{});}})[_0x3c23('0x2b')](function(_0x266e13){logger[_0x3c23('0x14')](_0x3c23('0x2c'),_0x3654af);logger[_0x3c23('0x16')](_0x3c23('0x2c'),_0x3654af,JSON['stringify'](_0x266e13));_0x37808a(_0x266e13);})['catch'](function(_0x77f6f5){logger[_0x3c23('0x1a')](_0x3c23('0x2c'),_0x77f6f5[_0x3c23('0x1c')],_0x3654af);_0x4afe5c(_this[_0x3c23('0x1a')](0x1f4,_0x77f6f5[_0x3c23('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 94a9cfb..b352469 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 _0x5a86=['register','length','openchannelInteraction:','save','remove','update','removeListener'];(function(_0x53c2a9,_0x591554){var _0x3030a3=function(_0x120763){while(--_0x120763){_0x53c2a9['push'](_0x53c2a9['shift']());}};_0x3030a3(++_0x591554);}(_0x5a86,0xc7));var _0x65a8=function(_0x1e3a81,_0x4a9788){_0x1e3a81=_0x1e3a81-0x0;var _0x56a929=_0x5a86[_0x1e3a81];return _0x56a929;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x65a8('0x0'),_0x65a8('0x1'),_0x65a8('0x2')];function createListener(_0x321fbe,_0x11f700){return function(_0x3c9201){_0x11f700['emit'](_0x321fbe,_0x3c9201);};}function removeListener(_0x519836,_0x5310e5){return function(){OpenchannelInteractionEvents[_0x65a8('0x3')](_0x519836,_0x5310e5);};}exports[_0x65a8('0x4')]=function(_0x3b709e){for(var _0x59e56c=0x0,_0x2a77e3=events[_0x65a8('0x5')];_0x59e56c<_0x2a77e3;_0x59e56c++){var _0x33fca3=events[_0x59e56c];var _0x45d0fc=createListener(_0x65a8('0x6')+_0x33fca3,_0x3b709e);OpenchannelInteractionEvents['on'](_0x33fca3,_0x45d0fc);}}; \ No newline at end of file +var _0x5239=['emit','register','length','./openchannelInteraction.events','save','update'];(function(_0x52f1cb,_0x1f5a5f){var _0x285deb=function(_0x322f88){while(--_0x322f88){_0x52f1cb['push'](_0x52f1cb['shift']());}};_0x285deb(++_0x1f5a5f);}(_0x5239,0x19b));var _0x9523=function(_0x49d4c7,_0x1c4305){_0x49d4c7=_0x49d4c7-0x0;var _0x36bee4=_0x5239[_0x49d4c7];return _0x36bee4;};'use strict';var OpenchannelInteractionEvents=require(_0x9523('0x0'));var events=[_0x9523('0x1'),'remove',_0x9523('0x2')];function createListener(_0x41168a,_0x291bb9){return function(_0x212460){_0x291bb9[_0x9523('0x3')](_0x41168a,_0x212460);};}function removeListener(_0x44a48d,_0xa507eb){return function(){OpenchannelInteractionEvents['removeListener'](_0x44a48d,_0xa507eb);};}exports[_0x9523('0x4')]=function(_0x521a6e){for(var _0x113484=0x0,_0x36f2c2=events[_0x9523('0x5')];_0x113484<_0x36f2c2;_0x113484++){var _0x5dc891=events[_0x113484];var _0x59a9b7=createListener('openchannelInteraction:'+_0x5dc891,_0x521a6e);OpenchannelInteractionEvents['on'](_0x5dc891,_0x59a9b7);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 184e0b6..d3becdd 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x1d9d4f,_0x504219){var _0x3577cf=function(_0x3f90c8){while(--_0x3f90c8){_0x1d9d4f['push'](_0x1d9d4f['shift']());}};_0x3577cf(++_0x504219);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0xcb91[_0xdd2bfa];return _0x55397e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x53c68b,_0x465db7){_0x53c68b=_0x53c68b-0x0;var _0xdfd4b=_0x70e0[_0x53c68b];return _0xdfd4b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 4918647..9caccb7 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 _0xda2d=['exports','TEXT','medium','BOOLEAN','DATE','STRING'];(function(_0x34916a,_0xad448f){var _0x5dd8ff=function(_0x598977){while(--_0x598977){_0x34916a['push'](_0x34916a['shift']());}};_0x5dd8ff(++_0xad448f);}(_0xda2d,0x102));var _0xdda2=function(_0x2883b2,_0x53f38b){_0x2883b2=_0x2883b2-0x0;var _0x1cc145=_0xda2d[_0x2883b2];return _0x1cc145;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdda2('0x4')]},'providerName':{'type':Sequelize[_0xdda2('0x5')]},'providerResponse':{'type':Sequelize[_0xdda2('0x1')]}}; \ No newline at end of file +var _0x0901=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x0901,0x134));var _0x1090=function(_0x168fd1,_0x1c1aad){_0x168fd1=_0x168fd1-0x0;var _0x3b7a89=_0x0901[_0x168fd1];return _0x3b7a89;};'use strict';var Sequelize=require(_0x1090('0x0'));module[_0x1090('0x1')]={'body':{'type':Sequelize[_0x1090('0x2')](_0x1090('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1090('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1090('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x1090('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1090('0x6')]},'providerName':{'type':Sequelize[_0x1090('0x7')]},'providerResponse':{'type':Sequelize[_0x1090('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index eea516f..8a8016c 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 _0x757a=['YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','User','email','manual','interface','SIP/%s','motionChannel','event','accept','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','fullname','internal','format','channel','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','info','catch','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','OpenchannelMessage','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','merge','includeAll','findAll','rows','show','params','rawAttributes','length','include','find','create','body','describe','../../config/logger','openchannel-interactions','openchannel','read','UserId','user','agent','get','isNil'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x757a,0x1af));var _0xa757=function(_0x8ffb0b,_0x34fd20){_0x8ffb0b=_0x8ffb0b-0x0;var _0x413514=_0x757a[_0x8ffb0b];return _0x413514;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa757('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require('to-csv');var ejs=require(_0xa757('0x7'));var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require(_0xa757('0xa'));var crypto=require(_0xa757('0xb'));var jsforce=require(_0xa757('0xc'));var deskjs=require(_0xa757('0xd'));var toCsv=require(_0xa757('0xe'));var querystring=require(_0xa757('0xf'));var Papa=require(_0xa757('0x10'));var Redis=require(_0xa757('0x11'));var authService=require(_0xa757('0x12'));var qs=require(_0xa757('0x13'));var as=require(_0xa757('0x14'));var hardwareService=require(_0xa757('0x15'));var logger=require('../../config/logger')(_0xa757('0x16'));var utils=require('../../config/utils');var config=require(_0xa757('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa757('0x18'))['db'];config[_0xa757('0x19')]=_[_0xa757('0x1a')](config['redis'],{'host':_0xa757('0x1b'),'port':0x18eb});var socket=require(_0xa757('0x1c'))(new Redis(config[_0xa757('0x19')]));require(_0xa757('0x1d'))[_0xa757('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa757('0x1f')][_0xa757('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xa757('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x10de98,_0x3e13f9,_0x1ba737,_0x10d9ac){return new BPromise(function(_0x4a1037,_0x244e00){var _0x26727d=_0x10d9ac||client;return _0x26727d[_0xa757('0x21')](_0x10de98,_0x1ba737)['then'](function(_0x80031d){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3e13f9,_0xa757('0x22'));logger['debug'](_0xa757('0x23'),_0x3e13f9,_0xa757('0x22'),JSON[_0xa757('0x24')](_0x80031d));if(_0x80031d[_0xa757('0x25')]){if(_0x80031d[_0xa757('0x25')][_0xa757('0x26')]===0x1f4){logger[_0xa757('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e13f9,_0x80031d[_0xa757('0x25')][_0xa757('0x27')]);return _0x244e00(_0x80031d[_0xa757('0x25')]['message']);}logger['error'](_0xa757('0x28'),_0x3e13f9,_0x80031d[_0xa757('0x25')][_0xa757('0x27')]);return _0x4a1037(_0x80031d[_0xa757('0x25')]['message']);}else{logger[_0xa757('0x29')](_0xa757('0x28'),_0x3e13f9,'request\x20sent');_0x4a1037(_0x80031d['result'][_0xa757('0x27')]);}})[_0xa757('0x2a')](function(_0x3a461d){logger[_0xa757('0x25')](_0xa757('0x28'),_0x3e13f9,_0x3a461d);_0x244e00(_0x3a461d);});});}function respondWithStatusCode(_0xd9e255,_0x27f599){_0x27f599=_0x27f599||0xcc;return function(_0x13d792){if(_0x13d792){return _0xd9e255[_0xa757('0x2b')](_0x27f599);}return _0xd9e255[_0xa757('0x2c')](_0x27f599)[_0xa757('0x2d')]();};}function respondWithResult(_0x5354f7,_0x578224){_0x578224=_0x578224||0xc8;return function(_0x177a4e){if(_0x177a4e){return _0x5354f7[_0xa757('0x2c')](_0x578224)[_0xa757('0x2e')](_0x177a4e);}};}function respondWithFilteredResult(_0x4c4aaf,_0x45e399){return function(_0x1eeed8){if(_0x1eeed8){var _0x13970d=typeof _0x45e399['offset']===_0xa757('0x2f')&&typeof _0x45e399[_0xa757('0x30')]===_0xa757('0x2f');var _0x2e41ab=_0x1eeed8['count'];var _0x4bc30f=_0x13970d?0x0:_0x45e399[_0xa757('0x31')];var _0x23bc6f=_0x13970d?_0x1eeed8[_0xa757('0x32')]:_0x45e399[_0xa757('0x31')]+_0x45e399['limit'];var _0x22726e;if(_0x23bc6f>=_0x2e41ab){_0x23bc6f=_0x2e41ab;_0x22726e=0xc8;}else{_0x22726e=0xce;}_0x4c4aaf[_0xa757('0x2c')](_0x22726e);return _0x4c4aaf['set'](_0xa757('0x33'),_0x4bc30f+'-'+_0x23bc6f+'/'+_0x2e41ab)[_0xa757('0x2e')](_0x1eeed8);}return null;};}function patchUpdates(_0x34473d){return function(_0x33ddbd){try{jsonpatch['apply'](_0x33ddbd,_0x34473d,!![]);}catch(_0x2bdd92){return BPromise[_0xa757('0x34')](_0x2bdd92);}return _0x33ddbd[_0xa757('0x35')]();};}function saveUpdates(_0x533dab,_0x714fb2){return function(_0x3186df){if(_0x3186df){return _0x3186df[_0xa757('0x36')](_0x533dab)[_0xa757('0x37')](function(_0x22ec5a){return _0x22ec5a;});}return null;};}function removeEntity(_0x341c58,_0xcf491f){return function(_0x3cab8f){if(_0x3cab8f){return _0x3cab8f[_0xa757('0x38')]()['then'](function(){_0x341c58[_0xa757('0x2c')](0xcc)[_0xa757('0x2d')]();});}};}function handleEntityNotFound(_0x55175d,_0x442232){return function(_0x392580){if(!_0x392580){_0x55175d['sendStatus'](0x194);}return _0x392580;};}function handleError(_0x1e9bd4,_0x16631d){_0x16631d=_0x16631d||0x1f4;return function(_0x1324a8){logger[_0xa757('0x25')](_0x1324a8[_0xa757('0x39')]);if(_0x1324a8[_0xa757('0x3a')]){delete _0x1324a8[_0xa757('0x3a')];}_0x1e9bd4[_0xa757('0x2c')](_0x16631d)[_0xa757('0x3b')](_0x1324a8);};}exports[_0xa757('0x3c')]=function(_0x55172b,_0x5821b4){var _0x3ee2b4={},_0x4d34ce={},_0x19ad9d={'count':0x0,'rows':[]};var _0xb5bf46=_['map'](db[_0xa757('0x3d')]['rawAttributes'],function(_0x52a96e){return{'name':_0x52a96e['fieldName'],'type':_0x52a96e['type'][_0xa757('0x3e')]};});_0x4d34ce[_0xa757('0x3f')]=_['map'](_0xb5bf46,_0xa757('0x3a'));_0x4d34ce[_0xa757('0x40')]=_[_0xa757('0x41')](_0x55172b[_0xa757('0x40')]);_0x4d34ce[_0xa757('0x42')]=_[_0xa757('0x43')](_0x4d34ce[_0xa757('0x3f')],_0x4d34ce[_0xa757('0x40')]);_0x3ee2b4['attributes']=_['intersection'](_0x4d34ce[_0xa757('0x3f')],qs[_0xa757('0x44')](_0x55172b[_0xa757('0x40')]['fields']));_0x3ee2b4[_0xa757('0x45')]=_0x3ee2b4['attributes']['length']?_0x3ee2b4['attributes']:_0x4d34ce[_0xa757('0x3f')];if(!_0x55172b[_0xa757('0x40')][_0xa757('0x46')](_0xa757('0x47'))){_0x3ee2b4[_0xa757('0x30')]=qs[_0xa757('0x30')](_0x55172b[_0xa757('0x40')][_0xa757('0x30')]);_0x3ee2b4[_0xa757('0x31')]=qs['offset'](_0x55172b['query'][_0xa757('0x31')]);}_0x3ee2b4[_0xa757('0x48')]=qs[_0xa757('0x49')](_0x55172b[_0xa757('0x40')]['sort']);_0x3ee2b4[_0xa757('0x4a')]=qs['filters'](_[_0xa757('0x4b')](_0x55172b['query'],_0x4d34ce[_0xa757('0x42')]),_0xb5bf46);if(_0x55172b[_0xa757('0x40')][_0xa757('0x4c')]){_0x3ee2b4[_0xa757('0x4a')]=_['merge'](_0x3ee2b4[_0xa757('0x4a')],{'$or':_[_0xa757('0x4d')](_0xb5bf46,function(_0x3601e3){if(_0x3601e3[_0xa757('0x4e')]!=='VIRTUAL'){var _0x359c13={};_0x359c13[_0x3601e3[_0xa757('0x3a')]]={'$like':'%'+_0x55172b[_0xa757('0x40')][_0xa757('0x4c')]+'%'};return _0x359c13;}})});}_0x3ee2b4=_[_0xa757('0x4f')]({},_0x3ee2b4,_0x55172b['options']);var _0x530755={'where':_0x3ee2b4['where']};return db['OpenchannelMessage'][_0xa757('0x32')](_0x530755)[_0xa757('0x37')](function(_0x4f689d){_0x19ad9d['count']=_0x4f689d;if(_0x55172b['query'][_0xa757('0x50')]){_0x3ee2b4['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xa757('0x51')](_0x3ee2b4);})['then'](function(_0x45389a){_0x19ad9d[_0xa757('0x52')]=_0x45389a;return _0x19ad9d;})[_0xa757('0x37')](respondWithFilteredResult(_0x5821b4,_0x3ee2b4))[_0xa757('0x2a')](handleError(_0x5821b4,null));};exports[_0xa757('0x53')]=function(_0x431c6f,_0x207c59){var _0x298e03={'raw':!![],'where':{'id':_0x431c6f[_0xa757('0x54')]['id']}},_0x34df7a={};_0x34df7a[_0xa757('0x3f')]=_['keys'](db['OpenchannelMessage'][_0xa757('0x55')]);_0x34df7a[_0xa757('0x40')]=_[_0xa757('0x41')](_0x431c6f[_0xa757('0x40')]);_0x34df7a[_0xa757('0x42')]=_[_0xa757('0x43')](_0x34df7a[_0xa757('0x3f')],_0x34df7a[_0xa757('0x40')]);_0x298e03[_0xa757('0x45')]=_[_0xa757('0x43')](_0x34df7a[_0xa757('0x3f')],qs['fields'](_0x431c6f['query'][_0xa757('0x44')]));_0x298e03[_0xa757('0x45')]=_0x298e03[_0xa757('0x45')][_0xa757('0x56')]?_0x298e03['attributes']:_0x34df7a[_0xa757('0x3f')];if(_0x431c6f['query'][_0xa757('0x50')]){_0x298e03[_0xa757('0x57')]=[{'all':!![]}];}_0x298e03=_[_0xa757('0x4f')]({},_0x298e03,_0x431c6f['options']);return db[_0xa757('0x3d')][_0xa757('0x58')](_0x298e03)[_0xa757('0x37')](handleEntityNotFound(_0x207c59,null))[_0xa757('0x37')](respondWithResult(_0x207c59,null))[_0xa757('0x2a')](handleError(_0x207c59,null));};exports[_0xa757('0x59')]=function(_0xa487ff,_0x398917){return db[_0xa757('0x3d')][_0xa757('0x59')](_0xa487ff[_0xa757('0x5a')],{})[_0xa757('0x37')](respondWithResult(_0x398917,0xc9))['catch'](handleError(_0x398917,null));};exports[_0xa757('0x36')]=function(_0x29bc83,_0x2a8ed6){if(_0x29bc83[_0xa757('0x5a')]['id']){delete _0x29bc83[_0xa757('0x5a')]['id'];}return db[_0xa757('0x3d')]['find']({'where':{'id':_0x29bc83['params']['id']}})[_0xa757('0x37')](handleEntityNotFound(_0x2a8ed6,null))[_0xa757('0x37')](saveUpdates(_0x29bc83['body'],null))[_0xa757('0x37')](respondWithResult(_0x2a8ed6,null))[_0xa757('0x2a')](handleError(_0x2a8ed6,null));};exports[_0xa757('0x38')]=function(_0x390202,_0x41ecf0){return db[_0xa757('0x3d')][_0xa757('0x58')]({'where':{'id':_0x390202[_0xa757('0x54')]['id']}})[_0xa757('0x37')](handleEntityNotFound(_0x41ecf0,null))['then'](removeEntity(_0x41ecf0,null))['catch'](handleError(_0x41ecf0,null));};exports[_0xa757('0x5b')]=function(_0x5008f9,_0x272afe){return db[_0xa757('0x3d')]['describe']()[_0xa757('0x37')](respondWithResult(_0x272afe,null))[_0xa757('0x2a')](handleError(_0x272afe,null));};var interaction_log=require(_0xa757('0x5c'))(_0xa757('0x5d'));exports['accept']=function(_0x37946c,_0x1e7cca,_0x21b864){var _0x310057={'agent':{},'channel':_0xa757('0x5e')};if(_0x37946c[_0xa757('0x5a')]['id']){delete _0x37946c['body']['id'];}_0x37946c[_0xa757('0x5a')][_0xa757('0x5f')]=!![];_0x37946c[_0xa757('0x5a')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37946c[_0xa757('0x5a')][_0xa757('0x60')]=_0x37946c[_0xa757('0x5a')]['UserId']||_0x37946c[_0xa757('0x61')]['id'];_0x310057[_0xa757('0x62')]['id']=_0x37946c[_0xa757('0x5a')]['UserId'];return db[_0xa757('0x3d')][_0xa757('0x58')]({'where':{'id':_0x37946c['params']['id'],'UserId':null}})[_0xa757('0x37')](handleEntityNotFound(_0x1e7cca,null))[_0xa757('0x37')](saveUpdates(_0x37946c['body'],null))['then'](function(_0x2a0c06){if(_0x2a0c06){_0x310057[_0xa757('0x27')]=_0x2a0c06[_0xa757('0x63')]({'plain':!![]});return db['OpenchannelInteraction'][_0xa757('0x58')]({'where':{'id':_0x2a0c06['OpenchannelInteractionId']}});}return null;})[_0xa757('0x37')](handleEntityNotFound(_0x1e7cca,null))[_0xa757('0x37')](function(_0x2013b7){if(_0x2013b7){return _0x2013b7[_0xa757('0x36')]({'UserId':_0x37946c[_0xa757('0x5a')]['UserId'],'read1stAt':_[_0xa757('0x64')](_0x2013b7['read1stAt'])?moment()['format'](_0xa757('0x65')):undefined});}return null;})['then'](function(_0xbfa43d){if(_0xbfa43d){_0x310057[_0xa757('0x66')]=_0xbfa43d['get']({'plain':!![]});interaction_log['info'](_0xa757('0x67'),_0x37946c[_0xa757('0x61')]['id'],_0x37946c[_0xa757('0x61')]['name'],_0x37946c[_0xa757('0x61')][_0xa757('0x68')],_0x310057['interaction']['id'],_0x37946c[_0xa757('0x5a')]?JSON[_0xa757('0x24')](_0x37946c[_0xa757('0x5a')]):_0xa757('0x69'));return respondWithRpcPromise(_0xa757('0x6a'),_0xa757('0x6b'),_0x310057);}return null;})['then'](function(_0x57efc9){var _0x113904='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x57efc9[_0xa757('0x27')][_0xa757('0x6c')];return db[_0xa757('0x6d')][_0xa757('0x40')](_0x113904,{'type':db[_0xa757('0x6e')]['QueryTypes'][_0xa757('0x6f')],'raw':!![]})['then'](function(_0x2979db){return _0x2979db;});})[_0xa757('0x37')](function(_0x51707d){if(_0x51707d){_0x310057[_0xa757('0x27')]['contact']=_0x51707d[0x0];if(!_0x37946c[_0xa757('0x5a')][_0xa757('0x60')])return;return db[_0xa757('0x70')]['find']({'where':{'id':_0x37946c[_0xa757('0x5a')][_0xa757('0x60')],'role':'agent'},'attributes':['id','name','fullname',_0xa757('0x71'),'internal'],'raw':!![]});}return null;})[_0xa757('0x37')](function(_0x3d9135){if(!_0x3d9135)return null;_0x310057['message'][_0xa757('0x62')]=_0x3d9135;return _0x310057;})[_0xa757('0x37')](function(_0x40973e){if(_0x40973e){if(_0x37946c['body'][_0xa757('0x72')]){_0x310057[_0xa757('0x27')][_0xa757('0x73')]=util['format'](_0xa757('0x74'),_0x37946c['user'][_0xa757('0x3a')]);_0x310057[_0xa757('0x27')]['channel']=_0x310057['channel'];_0x310057[_0xa757('0x27')][_0xa757('0x75')]=_0x310057['channel'];_0x310057[_0xa757('0x27')][_0xa757('0x76')]=_0xa757('0x77');return respondWithRpcPromise('EventManager',_0xa757('0x78'),{'event':_0xa757('0x79'),'message':_0x310057[_0xa757('0x27')]},client9002)[_0xa757('0x37')](function(){return _0x310057;});}return _0x310057;}return null;})[_0xa757('0x37')](respondWithResult(_0x1e7cca,null))['catch'](handleError(_0x1e7cca,null));};var interaction_log=require('../../config/logger')(_0xa757('0x5d'));exports[_0xa757('0x34')]=function(_0x5a6049,_0x21e3fa,_0x2f0d2d){var _0x151b5a={'agent':{},'channel':_0xa757('0x5e')};if(_0x5a6049[_0xa757('0x5a')]['id']){delete _0x5a6049[_0xa757('0x5a')]['id'];}_0x5a6049[_0xa757('0x5a')][_0xa757('0x60')]=_0x5a6049[_0xa757('0x5a')]['UserId']||_0x5a6049[_0xa757('0x61')]['id'];_0x151b5a[_0xa757('0x62')]['id']=_0x5a6049['body']['UserId'];return db[_0xa757('0x3d')][_0xa757('0x58')]({'where':{'id':_0x5a6049['params']['id'],'UserId':null}})[_0xa757('0x37')](handleEntityNotFound(_0x21e3fa,null))[_0xa757('0x37')](function(_0x257216){if(_0x257216){_0x151b5a[_0xa757('0x27')]=_0x257216[_0xa757('0x63')]({'plain':!![]});return db[_0xa757('0x7a')]['find']({'where':{'id':_0x257216[_0xa757('0x7b')]}});}return null;})[_0xa757('0x37')](handleEntityNotFound(_0x21e3fa,null))[_0xa757('0x37')](function(_0x26e77a){if(_0x26e77a){_0x151b5a['interaction']=_0x26e77a[_0xa757('0x63')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5a6049[_0xa757('0x61')]['id'],_0x5a6049[_0xa757('0x61')]['name'],_0x5a6049['user']['role'],_0x151b5a['interaction']['id'],_0x5a6049[_0xa757('0x5a')]?JSON[_0xa757('0x24')](_0x5a6049['body']):_0xa757('0x69'));return respondWithRpcPromise(_0xa757('0x7c'),_0xa757('0x7d'),_0x151b5a);}return null;})['then'](function(_0x16e136){var _0x48cd03=_0xa757('0x7e')+_0x16e136[_0xa757('0x27')][_0xa757('0x6c')];return db[_0xa757('0x6d')][_0xa757('0x40')](_0x48cd03,{'type':db['Sequelize'][_0xa757('0x7f')][_0xa757('0x6f')],'raw':!![]})[_0xa757('0x37')](function(_0x30b2ac){return _0x30b2ac;});})[_0xa757('0x37')](function(_0x190a82){if(_0x190a82){_0x151b5a[_0xa757('0x27')][_0xa757('0x80')]=_0x190a82[0x0];if(!_0x5a6049['body']['UserId'])return;return db['User'][_0xa757('0x58')]({'where':{'id':_0x5a6049[_0xa757('0x5a')]['UserId'],'role':_0xa757('0x62')},'attributes':['id',_0xa757('0x3a'),_0xa757('0x81'),_0xa757('0x71'),_0xa757('0x82')],'raw':!![]});}return null;})[_0xa757('0x37')](function(_0x5e3e25){if(!_0x5e3e25)return null;_0x151b5a[_0xa757('0x27')][_0xa757('0x62')]=_0x5e3e25;return _0x151b5a;})[_0xa757('0x37')](function(_0x5396a2){if(_0x5396a2){_0x5396a2[_0xa757('0x27')][_0xa757('0x73')]=util[_0xa757('0x83')](_0xa757('0x74'),_0x5a6049[_0xa757('0x61')][_0xa757('0x3a')]);_0x5396a2[_0xa757('0x27')]['channel']=_0x151b5a[_0xa757('0x84')];_0x5396a2[_0xa757('0x27')][_0xa757('0x75')]=_0x151b5a[_0xa757('0x84')];_0x5396a2['message']['event']='reject';respondWithRpcPromise(_0xa757('0x78'),_0xa757('0x78'),{'event':'rejectmessage','message':_0x5396a2[_0xa757('0x27')]},client9002);return _0x151b5a;}return null;})['then'](respondWithResult(_0x21e3fa,null))[_0xa757('0x2a')](handleError(_0x21e3fa,null));}; \ No newline at end of file +var _0x1b20=['localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','update','stack','name','send','map','OpenchannelMessage','rawAttributes','key','query','keys','intersection','model','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','show','options','find','create','body','params','describe','openchannel-interactions','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','sequelize','User','internal','interface','rejectmessage','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','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','../../config/utils','../../config/license/util','redis','defaults'];(function(_0x3bab7d,_0x1f711b){var _0x22bbb1=function(_0x147a48){while(--_0x147a48){_0x3bab7d['push'](_0x3bab7d['shift']());}};_0x22bbb1(++_0x1f711b);}(_0x1b20,0x66));var _0x01b2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b20[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01b2('0x0'));var zipdir=require(_0x01b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01b2('0x2'));var BPromise=require(_0x01b2('0x3'));var Mustache=require(_0x01b2('0x4'));var util=require(_0x01b2('0x5'));var path=require(_0x01b2('0x6'));var sox=require(_0x01b2('0x7'));var csv=require(_0x01b2('0x8'));var ejs=require(_0x01b2('0x9'));var fs=require('fs');var fs_extra=require(_0x01b2('0xa'));var _=require(_0x01b2('0xb'));var squel=require(_0x01b2('0xc'));var crypto=require(_0x01b2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x01b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x01b2('0xf'));var Papa=require(_0x01b2('0x10'));var Redis=require(_0x01b2('0x11'));var authService=require(_0x01b2('0x12'));var qs=require(_0x01b2('0x13'));var as=require(_0x01b2('0x14'));var hardwareService=require(_0x01b2('0x15'));var logger=require(_0x01b2('0x16'))('api');var utils=require(_0x01b2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x01b2('0x18'));var db=require('../../mysqldb')['db'];config[_0x01b2('0x19')]=_[_0x01b2('0x1a')](config[_0x01b2('0x19')],{'host':_0x01b2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01b2('0x19')]));require(_0x01b2('0x1c'))[_0x01b2('0x1d')](socket);var jayson=require(_0x01b2('0x1e'));var client=jayson[_0x01b2('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x01b2('0x1f')][_0x01b2('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1a9734,_0x3f68a8,_0x50eb39,_0x523b80){return new BPromise(function(_0x2a8458,_0x3c0e03){var _0x588dbe=_0x523b80||client;return _0x588dbe[_0x01b2('0x21')](_0x1a9734,_0x50eb39)[_0x01b2('0x22')](function(_0x27a0bc){logger['info'](_0x01b2('0x23'),_0x3f68a8,_0x01b2('0x24'));logger[_0x01b2('0x25')](_0x01b2('0x26'),_0x3f68a8,_0x01b2('0x24'),JSON['stringify'](_0x27a0bc));if(_0x27a0bc[_0x01b2('0x27')]){if(_0x27a0bc['error'][_0x01b2('0x28')]===0x1f4){logger['error'](_0x01b2('0x23'),_0x3f68a8,_0x27a0bc[_0x01b2('0x27')][_0x01b2('0x29')]);return _0x3c0e03(_0x27a0bc['error'][_0x01b2('0x29')]);}logger[_0x01b2('0x27')](_0x01b2('0x23'),_0x3f68a8,_0x27a0bc[_0x01b2('0x27')][_0x01b2('0x29')]);return _0x2a8458(_0x27a0bc['error'][_0x01b2('0x29')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3f68a8,_0x01b2('0x24'));_0x2a8458(_0x27a0bc[_0x01b2('0x2a')][_0x01b2('0x29')]);}})[_0x01b2('0x2b')](function(_0x2e32c1){logger[_0x01b2('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x3f68a8,_0x2e32c1);_0x3c0e03(_0x2e32c1);});});}function respondWithStatusCode(_0x2cb5f1,_0x239543){_0x239543=_0x239543||0xcc;return function(_0x424cfd){if(_0x424cfd){return _0x2cb5f1[_0x01b2('0x2c')](_0x239543);}return _0x2cb5f1['status'](_0x239543)[_0x01b2('0x2d')]();};}function respondWithResult(_0x586814,_0x122925){_0x122925=_0x122925||0xc8;return function(_0x1e6ac2){if(_0x1e6ac2){return _0x586814['status'](_0x122925)[_0x01b2('0x2e')](_0x1e6ac2);}};}function respondWithFilteredResult(_0x5efdda,_0x487c49){return function(_0x291d56){if(_0x291d56){var _0x4363ec=typeof _0x487c49['offset']===_0x01b2('0x2f')&&typeof _0x487c49[_0x01b2('0x30')]===_0x01b2('0x2f');var _0x2cf50f=_0x291d56[_0x01b2('0x31')];var _0xd7ad6b=_0x4363ec?0x0:_0x487c49[_0x01b2('0x32')];var _0x3169f5=_0x4363ec?_0x291d56[_0x01b2('0x31')]:_0x487c49[_0x01b2('0x32')]+_0x487c49[_0x01b2('0x30')];var _0x5e6981;if(_0x3169f5>=_0x2cf50f){_0x3169f5=_0x2cf50f;_0x5e6981=0xc8;}else{_0x5e6981=0xce;}_0x5efdda[_0x01b2('0x33')](_0x5e6981);return _0x5efdda[_0x01b2('0x34')](_0x01b2('0x35'),_0xd7ad6b+'-'+_0x3169f5+'/'+_0x2cf50f)[_0x01b2('0x2e')](_0x291d56);}return null;};}function patchUpdates(_0x306666){return function(_0x11dd4e){try{jsonpatch['apply'](_0x11dd4e,_0x306666,!![]);}catch(_0x480fa7){return BPromise[_0x01b2('0x36')](_0x480fa7);}return _0x11dd4e['save']();};}function saveUpdates(_0x50ec09,_0x2c2d51){return function(_0x176849){if(_0x176849){return _0x176849[_0x01b2('0x37')](_0x50ec09)[_0x01b2('0x22')](function(_0x520b4c){return _0x520b4c;});}return null;};}function removeEntity(_0x42c3f8,_0x5a954a){return function(_0xcd6801){if(_0xcd6801){return _0xcd6801['destroy']()['then'](function(){_0x42c3f8['status'](0xcc)[_0x01b2('0x2d')]();});}};}function handleEntityNotFound(_0x29532e,_0x8f8433){return function(_0x12725b){if(!_0x12725b){_0x29532e['sendStatus'](0x194);}return _0x12725b;};}function handleError(_0x11504a,_0x2bd252){_0x2bd252=_0x2bd252||0x1f4;return function(_0x5865a3){logger[_0x01b2('0x27')](_0x5865a3[_0x01b2('0x38')]);if(_0x5865a3[_0x01b2('0x39')]){delete _0x5865a3[_0x01b2('0x39')];}_0x11504a[_0x01b2('0x33')](_0x2bd252)[_0x01b2('0x3a')](_0x5865a3);};}exports['index']=function(_0x2fb530,_0x2258ed){var _0x51f947={},_0x5576d8={},_0x44e338={'count':0x0,'rows':[]};var _0x3d7e77=_[_0x01b2('0x3b')](db[_0x01b2('0x3c')][_0x01b2('0x3d')],function(_0x3b0cc7){return{'name':_0x3b0cc7['fieldName'],'type':_0x3b0cc7['type'][_0x01b2('0x3e')]};});_0x5576d8['model']=_[_0x01b2('0x3b')](_0x3d7e77,_0x01b2('0x39'));_0x5576d8[_0x01b2('0x3f')]=_[_0x01b2('0x40')](_0x2fb530[_0x01b2('0x3f')]);_0x5576d8['filters']=_[_0x01b2('0x41')](_0x5576d8[_0x01b2('0x42')],_0x5576d8[_0x01b2('0x3f')]);_0x51f947['attributes']=_[_0x01b2('0x41')](_0x5576d8[_0x01b2('0x42')],qs[_0x01b2('0x43')](_0x2fb530['query'][_0x01b2('0x43')]));_0x51f947['attributes']=_0x51f947[_0x01b2('0x44')][_0x01b2('0x45')]?_0x51f947['attributes']:_0x5576d8[_0x01b2('0x42')];if(!_0x2fb530[_0x01b2('0x3f')]['hasOwnProperty'](_0x01b2('0x46'))){_0x51f947[_0x01b2('0x30')]=qs[_0x01b2('0x30')](_0x2fb530[_0x01b2('0x3f')][_0x01b2('0x30')]);_0x51f947['offset']=qs[_0x01b2('0x32')](_0x2fb530[_0x01b2('0x3f')][_0x01b2('0x32')]);}_0x51f947['order']=qs[_0x01b2('0x47')](_0x2fb530[_0x01b2('0x3f')][_0x01b2('0x47')]);_0x51f947[_0x01b2('0x48')]=qs[_0x01b2('0x49')](_[_0x01b2('0x4a')](_0x2fb530[_0x01b2('0x3f')],_0x5576d8[_0x01b2('0x49')]),_0x3d7e77);if(_0x2fb530['query'][_0x01b2('0x4b')]){_0x51f947[_0x01b2('0x48')]=_[_0x01b2('0x4c')](_0x51f947[_0x01b2('0x48')],{'$or':_[_0x01b2('0x3b')](_0x3d7e77,function(_0x3469b3){if(_0x3469b3[_0x01b2('0x4d')]!=='VIRTUAL'){var _0x1e9c10={};_0x1e9c10[_0x3469b3[_0x01b2('0x39')]]={'$like':'%'+_0x2fb530[_0x01b2('0x3f')][_0x01b2('0x4b')]+'%'};return _0x1e9c10;}})});}_0x51f947=_['merge']({},_0x51f947,_0x2fb530['options']);var _0x241bd0={'where':_0x51f947[_0x01b2('0x48')]};return db[_0x01b2('0x3c')]['count'](_0x241bd0)[_0x01b2('0x22')](function(_0x17a8fe){_0x44e338[_0x01b2('0x31')]=_0x17a8fe;if(_0x2fb530[_0x01b2('0x3f')][_0x01b2('0x4e')]){_0x51f947[_0x01b2('0x4f')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x01b2('0x50')](_0x51f947);})['then'](function(_0x272d0d){_0x44e338['rows']=_0x272d0d;return _0x44e338;})['then'](respondWithFilteredResult(_0x2258ed,_0x51f947))[_0x01b2('0x2b')](handleError(_0x2258ed,null));};exports[_0x01b2('0x51')]=function(_0x3dda96,_0x25d72e){var _0x20cc59={'raw':!![],'where':{'id':_0x3dda96['params']['id']}},_0x496dd3={};_0x496dd3[_0x01b2('0x42')]=_[_0x01b2('0x40')](db[_0x01b2('0x3c')][_0x01b2('0x3d')]);_0x496dd3[_0x01b2('0x3f')]=_[_0x01b2('0x40')](_0x3dda96['query']);_0x496dd3[_0x01b2('0x49')]=_[_0x01b2('0x41')](_0x496dd3[_0x01b2('0x42')],_0x496dd3[_0x01b2('0x3f')]);_0x20cc59[_0x01b2('0x44')]=_[_0x01b2('0x41')](_0x496dd3[_0x01b2('0x42')],qs['fields'](_0x3dda96[_0x01b2('0x3f')][_0x01b2('0x43')]));_0x20cc59[_0x01b2('0x44')]=_0x20cc59[_0x01b2('0x44')][_0x01b2('0x45')]?_0x20cc59[_0x01b2('0x44')]:_0x496dd3['model'];if(_0x3dda96[_0x01b2('0x3f')][_0x01b2('0x4e')]){_0x20cc59[_0x01b2('0x4f')]=[{'all':!![]}];}_0x20cc59=_[_0x01b2('0x4c')]({},_0x20cc59,_0x3dda96[_0x01b2('0x52')]);return db[_0x01b2('0x3c')][_0x01b2('0x53')](_0x20cc59)[_0x01b2('0x22')](handleEntityNotFound(_0x25d72e,null))[_0x01b2('0x22')](respondWithResult(_0x25d72e,null))[_0x01b2('0x2b')](handleError(_0x25d72e,null));};exports[_0x01b2('0x54')]=function(_0x43f453,_0x11a8a0){return db[_0x01b2('0x3c')]['create'](_0x43f453['body'],{})['then'](respondWithResult(_0x11a8a0,0xc9))['catch'](handleError(_0x11a8a0,null));};exports[_0x01b2('0x37')]=function(_0x36ab3b,_0x9daac7){if(_0x36ab3b['body']['id']){delete _0x36ab3b[_0x01b2('0x55')]['id'];}return db['OpenchannelMessage'][_0x01b2('0x53')]({'where':{'id':_0x36ab3b[_0x01b2('0x56')]['id']}})[_0x01b2('0x22')](handleEntityNotFound(_0x9daac7,null))[_0x01b2('0x22')](saveUpdates(_0x36ab3b[_0x01b2('0x55')],null))['then'](respondWithResult(_0x9daac7,null))[_0x01b2('0x2b')](handleError(_0x9daac7,null));};exports['destroy']=function(_0x469a08,_0x7533be){return db['OpenchannelMessage'][_0x01b2('0x53')]({'where':{'id':_0x469a08['params']['id']}})[_0x01b2('0x22')](handleEntityNotFound(_0x7533be,null))[_0x01b2('0x22')](removeEntity(_0x7533be,null))[_0x01b2('0x2b')](handleError(_0x7533be,null));};exports[_0x01b2('0x57')]=function(_0x6b1e60,_0x422b20){return db[_0x01b2('0x3c')][_0x01b2('0x57')]()[_0x01b2('0x22')](respondWithResult(_0x422b20,null))[_0x01b2('0x2b')](handleError(_0x422b20,null));};var interaction_log=require('../../config/logger')(_0x01b2('0x58'));exports['accept']=function(_0x3039a1,_0x3c0f66,_0xf66ade){var _0x58c8de={'agent':{},'channel':_0x01b2('0x59')};if(_0x3039a1['body']['id']){delete _0x3039a1['body']['id'];}_0x3039a1[_0x01b2('0x55')][_0x01b2('0x5a')]=!![];_0x3039a1[_0x01b2('0x55')]['readAt']=moment()[_0x01b2('0x5b')](_0x01b2('0x5c'));_0x3039a1[_0x01b2('0x55')]['UserId']=_0x3039a1[_0x01b2('0x55')][_0x01b2('0x5d')]||_0x3039a1[_0x01b2('0x5e')]['id'];_0x58c8de[_0x01b2('0x5f')]['id']=_0x3039a1[_0x01b2('0x55')][_0x01b2('0x5d')];return db[_0x01b2('0x3c')]['find']({'where':{'id':_0x3039a1['params']['id'],'UserId':null}})[_0x01b2('0x22')](handleEntityNotFound(_0x3c0f66,null))['then'](saveUpdates(_0x3039a1['body'],null))[_0x01b2('0x22')](function(_0x4ca277){if(_0x4ca277){_0x58c8de[_0x01b2('0x29')]=_0x4ca277['get']({'plain':!![]});return db[_0x01b2('0x60')][_0x01b2('0x53')]({'where':{'id':_0x4ca277[_0x01b2('0x61')]}});}return null;})[_0x01b2('0x22')](handleEntityNotFound(_0x3c0f66,null))['then'](function(_0x2d6d43){if(_0x2d6d43){return _0x2d6d43['update']({'UserId':_0x3039a1[_0x01b2('0x55')]['UserId'],'read1stAt':_[_0x01b2('0x62')](_0x2d6d43['read1stAt'])?moment()[_0x01b2('0x5b')](_0x01b2('0x5c')):undefined});}return null;})['then'](function(_0x2446f4){if(_0x2446f4){_0x58c8de[_0x01b2('0x63')]=_0x2446f4[_0x01b2('0x64')]({'plain':!![]});interaction_log[_0x01b2('0x65')](_0x01b2('0x66'),_0x3039a1[_0x01b2('0x5e')]['id'],_0x3039a1[_0x01b2('0x5e')][_0x01b2('0x39')],_0x3039a1[_0x01b2('0x5e')][_0x01b2('0x67')],_0x58c8de[_0x01b2('0x63')]['id'],_0x3039a1[_0x01b2('0x55')]?JSON[_0x01b2('0x68')](_0x3039a1['body']):'null');return respondWithRpcPromise(_0x01b2('0x69'),_0x01b2('0x6a'),_0x58c8de);}return null;})[_0x01b2('0x22')](function(_0x427358){var _0x21cecf=_0x01b2('0x6b')+_0x427358[_0x01b2('0x29')][_0x01b2('0x6c')];return db['sequelize'][_0x01b2('0x3f')](_0x21cecf,{'type':db[_0x01b2('0x6d')][_0x01b2('0x6e')][_0x01b2('0x6f')],'raw':!![]})[_0x01b2('0x22')](function(_0x32f099){return _0x32f099;});})[_0x01b2('0x22')](function(_0x502f28){if(_0x502f28){_0x58c8de['message'][_0x01b2('0x70')]=_0x502f28[0x0];if(!_0x3039a1[_0x01b2('0x55')][_0x01b2('0x5d')])return;return db['User'][_0x01b2('0x53')]({'where':{'id':_0x3039a1[_0x01b2('0x55')][_0x01b2('0x5d')],'role':'agent'},'attributes':['id',_0x01b2('0x39'),_0x01b2('0x71'),_0x01b2('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2a820d){if(!_0x2a820d)return null;_0x58c8de['message'][_0x01b2('0x5f')]=_0x2a820d;return _0x58c8de;})[_0x01b2('0x22')](function(_0x2f41b6){if(_0x2f41b6){if(_0x3039a1[_0x01b2('0x55')][_0x01b2('0x73')]){_0x58c8de[_0x01b2('0x29')]['interface']=util[_0x01b2('0x5b')](_0x01b2('0x74'),_0x3039a1[_0x01b2('0x5e')][_0x01b2('0x39')]);_0x58c8de[_0x01b2('0x29')][_0x01b2('0x75')]=_0x58c8de['channel'];_0x58c8de[_0x01b2('0x29')][_0x01b2('0x76')]=_0x58c8de[_0x01b2('0x75')];_0x58c8de[_0x01b2('0x29')][_0x01b2('0x77')]=_0x01b2('0x78');return respondWithRpcPromise('EventManager',_0x01b2('0x79'),{'event':'acceptmessage','message':_0x58c8de[_0x01b2('0x29')]},client9002)['then'](function(){return _0x58c8de;});}return _0x58c8de;}return null;})['then'](respondWithResult(_0x3c0f66,null))[_0x01b2('0x2b')](handleError(_0x3c0f66,null));};var interaction_log=require(_0x01b2('0x16'))('openchannel-interactions');exports[_0x01b2('0x36')]=function(_0x4015e2,_0x288e34,_0x270479){var _0x59b6a0={'agent':{},'channel':_0x01b2('0x59')};if(_0x4015e2[_0x01b2('0x55')]['id']){delete _0x4015e2[_0x01b2('0x55')]['id'];}_0x4015e2[_0x01b2('0x55')][_0x01b2('0x5d')]=_0x4015e2[_0x01b2('0x55')][_0x01b2('0x5d')]||_0x4015e2[_0x01b2('0x5e')]['id'];_0x59b6a0[_0x01b2('0x5f')]['id']=_0x4015e2[_0x01b2('0x55')][_0x01b2('0x5d')];return db['OpenchannelMessage'][_0x01b2('0x53')]({'where':{'id':_0x4015e2[_0x01b2('0x56')]['id'],'UserId':null}})[_0x01b2('0x22')](handleEntityNotFound(_0x288e34,null))[_0x01b2('0x22')](function(_0x903a9f){if(_0x903a9f){_0x59b6a0[_0x01b2('0x29')]=_0x903a9f[_0x01b2('0x64')]({'plain':!![]});return db[_0x01b2('0x60')]['find']({'where':{'id':_0x903a9f['OpenchannelInteractionId']}});}return null;})[_0x01b2('0x22')](handleEntityNotFound(_0x288e34,null))[_0x01b2('0x22')](function(_0x455c73){if(_0x455c73){_0x59b6a0[_0x01b2('0x63')]=_0x455c73[_0x01b2('0x64')]({'plain':!![]});interaction_log[_0x01b2('0x65')](_0x01b2('0x7a'),_0x4015e2[_0x01b2('0x5e')]['id'],_0x4015e2['user'][_0x01b2('0x39')],_0x4015e2[_0x01b2('0x5e')][_0x01b2('0x67')],_0x59b6a0['interaction']['id'],_0x4015e2[_0x01b2('0x55')]?JSON[_0x01b2('0x68')](_0x4015e2[_0x01b2('0x55')]):_0x01b2('0x7b'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x59b6a0);}return null;})['then'](function(_0x2cee2e){var _0x511fdc=_0x01b2('0x6b')+_0x2cee2e[_0x01b2('0x29')][_0x01b2('0x6c')];return db[_0x01b2('0x7c')][_0x01b2('0x3f')](_0x511fdc,{'type':db[_0x01b2('0x6d')][_0x01b2('0x6e')][_0x01b2('0x6f')],'raw':!![]})[_0x01b2('0x22')](function(_0x1f5244){return _0x1f5244;});})['then'](function(_0x1d48f2){if(_0x1d48f2){_0x59b6a0[_0x01b2('0x29')][_0x01b2('0x70')]=_0x1d48f2[0x0];if(!_0x4015e2[_0x01b2('0x55')][_0x01b2('0x5d')])return;return db[_0x01b2('0x7d')][_0x01b2('0x53')]({'where':{'id':_0x4015e2[_0x01b2('0x55')][_0x01b2('0x5d')],'role':'agent'},'attributes':['id','name',_0x01b2('0x71'),_0x01b2('0x72'),_0x01b2('0x7e')],'raw':!![]});}return null;})['then'](function(_0xf36eb0){if(!_0xf36eb0)return null;_0x59b6a0[_0x01b2('0x29')][_0x01b2('0x5f')]=_0xf36eb0;return _0x59b6a0;})[_0x01b2('0x22')](function(_0x2fd064){if(_0x2fd064){_0x2fd064[_0x01b2('0x29')][_0x01b2('0x7f')]=util[_0x01b2('0x5b')](_0x01b2('0x74'),_0x4015e2[_0x01b2('0x5e')][_0x01b2('0x39')]);_0x2fd064['message'][_0x01b2('0x75')]=_0x59b6a0[_0x01b2('0x75')];_0x2fd064[_0x01b2('0x29')][_0x01b2('0x76')]=_0x59b6a0[_0x01b2('0x75')];_0x2fd064[_0x01b2('0x29')][_0x01b2('0x77')]=_0x01b2('0x36');respondWithRpcPromise(_0x01b2('0x79'),'EventManager',{'event':_0x01b2('0x80'),'message':_0x2fd064[_0x01b2('0x29')]},client9002);return _0x59b6a0;}return null;})[_0x01b2('0x22')](respondWithResult(_0x288e34,null))[_0x01b2('0x2b')](handleError(_0x288e34,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index b166b27..eaed58a 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 _0xa9f9=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xa9f9,0x6b));var _0x9a9f=function(_0x2f9dc7,_0x535e2e){_0x2f9dc7=_0x2f9dc7-0x0;var _0x279973=_0xa9f9[_0x2f9dc7];return _0x279973;};'use strict';var EventEmitter=require(_0x9a9f('0x0'));var OpenchannelMessage=require(_0x9a9f('0x1'))['db'][_0x9a9f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9a9f('0x3')](0x0);var events={'afterCreate':_0x9a9f('0x4'),'afterUpdate':_0x9a9f('0x5'),'afterDestroy':_0x9a9f('0x6')};function emitEvent(_0x2e9b50){return function(_0x55e8e7,_0x492cc0,_0x2cd73d){OpenchannelMessageEvents[_0x9a9f('0x7')](_0x2e9b50+':'+_0x55e8e7['id'],_0x55e8e7);OpenchannelMessageEvents[_0x9a9f('0x7')](_0x2e9b50,_0x55e8e7);_0x2cd73d(null);};}for(var e in events){if(events[_0x9a9f('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x9a9f('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xee5f=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0xee5f,0xbe));var _0xfee5=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0xee5f[_0x2605dc];return _0x4568c9;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xfee5('0x0'))['db'][_0xfee5('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xfee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfee5('0x3'),'afterDestroy':_0xfee5('0x4')};function emitEvent(_0xc7254e){return function(_0x3babfa,_0x41f841,_0xc5681e){OpenchannelMessageEvents[_0xfee5('0x5')](_0xc7254e+':'+_0x3babfa['id'],_0x3babfa);OpenchannelMessageEvents[_0xfee5('0x5')](_0xc7254e,_0x3babfa);_0xc5681e(null);};}for(var e in events){if(events[_0xfee5('0x6')](e)){var event=events[e];OpenchannelMessage[_0xfee5('0x7')](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 ee898e9..809556f 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 _0x9ad3=['Contact','POST','GET','info','body','threadId','Interaction','update','inspect','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','./openchannelMessage.attributes','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','catch','error','CmContact','OpenchannelAccount','find','Interactions','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length'];(function(_0x59ae3f,_0x59a63f){var _0x1bcc15=function(_0xacd4c4){while(--_0xacd4c4){_0x59ae3f['push'](_0x59ae3f['shift']());}};_0x1bcc15(++_0x59a63f);}(_0x9ad3,0x172));var _0x39ad=function(_0x27d0af,_0x435a4a){_0x27d0af=_0x27d0af-0x0;var _0x16e0a3=_0x9ad3[_0x27d0af];return _0x16e0a3;};'use strict';var _=require(_0x39ad('0x0'));var util=require(_0x39ad('0x1'));var logger=require(_0x39ad('0x2'))(_0x39ad('0x3'));var moment=require(_0x39ad('0x4'));var BPromise=require(_0x39ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39ad('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x39ad('0x7'));module['exports']=function(_0xea165d,_0xb6b77b){return _0xea165d[_0x39ad('0x8')](_0x39ad('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x39ad('0xa'),'fields':['body'],'type':_0x39ad('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ceeb0,_0x2bdfa0,_0xfaf8d6){var _0x4b4390=_0xea165d[_0x39ad('0xc')];var _0x5109fa=_0x1ceeb0[_0x39ad('0xd')]({'plain':!![]});if(_0x5109fa[_0x39ad('0xe')][_0x39ad('0xf')]()==='in'||_0x5109fa[_0x39ad('0xe')]['toLowerCase']()===_0x39ad('0x10')&&!_0x5109fa['secret']&&!_['isNil'](_0x5109fa[_0x39ad('0x11')])){_0x4b4390[_0x39ad('0x12')][_0x39ad('0x13')]({'where':{'id':_0x5109fa[_0x39ad('0x14')]}})[_0x39ad('0x15')](function(_0x32a0b0){if(_0x32a0b0){_0x32a0b0['update']({'lastMsgAt':_0x5109fa['createdAt'],'lastMsgDirection':_0x5109fa[_0x39ad('0xe')]['toLowerCase']()});}})[_0x39ad('0x16')](function(_0x19fc04){console[_0x39ad('0x17')](_0x19fc04);});}if(_0x5109fa['direction']===_0x39ad('0x10')&&!_0x5109fa['secret']){var _0x4965ba;_0x4b4390[_0x39ad('0x18')]['describe']()[_0x39ad('0x15')](function(_0x55ef8c){return _0x4b4390[_0x39ad('0x19')][_0x39ad('0x1a')]({'where':{'id':_0x5109fa['OpenchannelAccountId']},'include':[{'model':_0x4b4390[_0x39ad('0x12')],'as':_0x39ad('0x1b'),'where':{'id':_0x5109fa[_0x39ad('0x14')]},'limit':0x1,'include':[{'model':_0x4b4390[_0x39ad('0x18')],'as':'Contact','attributes':_[_0x39ad('0x1c')](_0x55ef8c)}]}]});})['then'](function(_0x27c12d){_0x4965ba=_0x27c12d[_0x39ad('0xd')]({'plain':!![]});if(_0x4965ba&&_0x4965ba['replyUri']){logger['info'](_0x39ad('0x1d'),_0x39ad('0x1e'),util[_0x39ad('0x1f')](_0x39ad('0x20'),_0x5109fa['id'],_0x4965ba[_0x39ad('0x21')]));if(_0x4965ba[_0x39ad('0x1b')]&&_0x4965ba[_0x39ad('0x1b')][_0x39ad('0x22')]){_0x5109fa['Interaction']=_['omit'](_0x4965ba[_0x39ad('0x1b')][0x0],_0x39ad('0x23'));_0x5109fa[_0x39ad('0x23')]=_0x4965ba[_0x39ad('0x1b')][0x0][_0x39ad('0x23')];}var _0x2bdfa0={'method':_0x39ad('0x24'),'uri':encodeURI(_0x4965ba['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2bdfa0['method']){case _0x39ad('0x25'):_0x2bdfa0['qs']=_0x5109fa;break;case'POST':_0x2bdfa0['body']=_0x5109fa;break;}return rp(_0x2bdfa0)['then'](function(_0x31abc0){logger[_0x39ad('0x26')](_0x39ad('0x1d'),_0x39ad('0x1e'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x5109fa['id'],_0x4965ba[_0x39ad('0x21')]));if(_0x31abc0[_0x39ad('0x27')][_0x39ad('0x28')]&&_0x31abc0[_0x39ad('0x27')][_0x39ad('0x28')]!=_0x5109fa[_0x39ad('0x29')][_0x39ad('0x28')]){return _0x4b4390[_0x39ad('0x12')]['update']({'threadId':_0x31abc0[_0x39ad('0x27')][_0x39ad('0x28')]},{'where':{'id':_0x5109fa[_0x39ad('0x29')]['id']}});}else{return;}})[_0x39ad('0x15')](function(){return _0x1ceeb0[_0x39ad('0x2a')]({'read':!![]});})[_0x39ad('0x16')](function(_0x45e552){logger[_0x39ad('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x39ad('0x1e'),util[_0x39ad('0x2b')](_0x45e552,{'showHidden':![],'depth':null}));_0xfaf8d6();});}else{_0xfaf8d6();}})['finally'](function(){_0xfaf8d6();});}else{_0xfaf8d6();}}},'charset':_0x39ad('0x2c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x71c2=['toLowerCase','secret','isNil','findOne','OpenchannelInteractionId','update','createdAt','catch','error','out','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','inspect','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','direction'];(function(_0x484d85,_0x198155){var _0x1af0f5=function(_0x43d5fe){while(--_0x43d5fe){_0x484d85['push'](_0x484d85['shift']());}};_0x1af0f5(++_0x198155);}(_0x71c2,0x1d4));var _0x271c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x271c('0x0'));var util=require('util');var logger=require(_0x271c('0x1'))(_0x271c('0x2'));var moment=require(_0x271c('0x3'));var BPromise=require(_0x271c('0x4'));var rp=require(_0x271c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x271c('0x6'));var config=require(_0x271c('0x7'));var attributes=require(_0x271c('0x8'));module[_0x271c('0x9')]=function(_0x318a6c,_0x3372d7){return _0x318a6c[_0x271c('0xa')](_0x271c('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x271c('0xc'),'fields':[_0x271c('0xd')],'type':_0x271c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2de1ec,_0x592c74,_0x2d8402){var _0x27ea84=_0x318a6c[_0x271c('0xf')];var _0x331910=_0x2de1ec[_0x271c('0x10')]({'plain':!![]});if(_0x331910[_0x271c('0x11')][_0x271c('0x12')]()==='in'||_0x331910['direction'][_0x271c('0x12')]()==='out'&&!_0x331910[_0x271c('0x13')]&&!_[_0x271c('0x14')](_0x331910['UserId'])){_0x27ea84['OpenchannelInteraction'][_0x271c('0x15')]({'where':{'id':_0x331910[_0x271c('0x16')]}})['then'](function(_0x430bc0){if(_0x430bc0){_0x430bc0[_0x271c('0x17')]({'lastMsgAt':_0x331910[_0x271c('0x18')],'lastMsgDirection':_0x331910[_0x271c('0x11')][_0x271c('0x12')]()});}})[_0x271c('0x19')](function(_0x32cc8d){console[_0x271c('0x1a')](_0x32cc8d);});}if(_0x331910[_0x271c('0x11')]===_0x271c('0x1b')&&!_0x331910[_0x271c('0x13')]){var _0x57392e;_0x27ea84[_0x271c('0x1c')][_0x271c('0x1d')]()[_0x271c('0x1e')](function(_0x43c2e3){return _0x27ea84[_0x271c('0x1f')][_0x271c('0x20')]({'where':{'id':_0x331910[_0x271c('0x21')]},'include':[{'model':_0x27ea84['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x331910[_0x271c('0x16')]},'limit':0x1,'include':[{'model':_0x27ea84['CmContact'],'as':_0x271c('0x22'),'attributes':_[_0x271c('0x23')](_0x43c2e3)}]}]});})['then'](function(_0x29f8b1){_0x57392e=_0x29f8b1[_0x271c('0x10')]({'plain':!![]});if(_0x57392e&&_0x57392e[_0x271c('0x24')]){logger[_0x271c('0x25')](_0x271c('0x26'),_0x271c('0x27'),util['format'](_0x271c('0x28'),_0x331910['id'],_0x57392e['replyUri']));if(_0x57392e['Interactions']&&_0x57392e[_0x271c('0x29')][_0x271c('0x2a')]){_0x331910[_0x271c('0x2b')]=_[_0x271c('0x2c')](_0x57392e[_0x271c('0x29')][0x0],_0x271c('0x22'));_0x331910[_0x271c('0x22')]=_0x57392e[_0x271c('0x29')][0x0]['Contact'];}var _0x592c74={'method':_0x271c('0x2d'),'uri':encodeURI(_0x57392e['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x592c74['method']){case _0x271c('0x2e'):_0x592c74['qs']=_0x331910;break;case _0x271c('0x2d'):_0x592c74[_0x271c('0xd')]=_0x331910;break;}return rp(_0x592c74)['then'](function(_0x1ff601){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x271c('0x27'),util[_0x271c('0x2f')](_0x271c('0x30'),_0x331910['id'],_0x57392e[_0x271c('0x24')]));if(_0x1ff601[_0x271c('0xd')]['threadId']&&_0x1ff601[_0x271c('0xd')][_0x271c('0x31')]!=_0x331910[_0x271c('0x2b')][_0x271c('0x31')]){return _0x27ea84[_0x271c('0x32')][_0x271c('0x17')]({'threadId':_0x1ff601[_0x271c('0xd')][_0x271c('0x31')]},{'where':{'id':_0x331910['Interaction']['id']}});}else{return;}})[_0x271c('0x1e')](function(){return _0x2de1ec[_0x271c('0x17')]({'read':!![]});})[_0x271c('0x19')](function(_0x3a8275){logger['error'](_0x271c('0x26'),'afterCreate',util[_0x271c('0x33')](_0x3a8275,{'showHidden':![],'depth':null}));_0x2d8402();});}else{_0x2d8402();}})[_0x271c('0x34')](function(){_0x2d8402();});}else{_0x2d8402();}}},'charset':_0x271c('0x35'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index d56b07a..1167f27 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x526860,_0x20d5a3){var _0x150edf=function(_0x52880e){while(--_0x52880e){_0x526860['push'](_0x526860['shift']());}};_0x150edf(++_0x20d5a3);}(_0x7a54,0x106));var _0x47a5=function(_0xa555e5,_0x3ee092){_0xa555e5=_0xa555e5-0x0;var _0xe58a0e=_0x7a54[_0xa555e5];return _0xe58a0e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x79c9cd,_0x38bda){var _0x1db6d6=function(_0x537cd5){while(--_0x537cd5){_0x79c9cd['push'](_0x79c9cd['shift']());}};_0x1db6d6(++_0x38bda);}(_0x0b0e,0x187));var _0xe0b0=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0x0b0e[_0x176d14];return _0x89522c;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 44589f4..49cbad0 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 _0x3ec7=['update','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x39fcd5,_0x474d5a){var _0xeb5477=function(_0x1623e6){while(--_0x1623e6){_0x39fcd5['push'](_0x39fcd5['shift']());}};_0xeb5477(++_0x474d5a);}(_0x3ec7,0xd5));var _0x73ec=function(_0x4428b1,_0x19e639){_0x4428b1=_0x4428b1-0x0;var _0x30c2cc=_0x3ec7[_0x4428b1];return _0x30c2cc;};'use strict';var OpenchannelMessageEvents=require(_0x73ec('0x0'));var events=[_0x73ec('0x1'),_0x73ec('0x2'),_0x73ec('0x3')];function createListener(_0x2933cc,_0x26d37a){return function(_0x249da6){_0x26d37a[_0x73ec('0x4')](_0x2933cc,_0x249da6);};}function removeListener(_0x16f7d9,_0xd22f9f){return function(){OpenchannelMessageEvents[_0x73ec('0x5')](_0x16f7d9,_0xd22f9f);};}exports[_0x73ec('0x6')]=function(_0x2e2fbe){for(var _0x219b55=0x0,_0x208fa2=events['length'];_0x219b55<_0x208fa2;_0x219b55++){var _0x3a96db=events[_0x219b55];var _0x519e58=createListener(_0x73ec('0x7')+_0x3a96db,_0x2e2fbe);OpenchannelMessageEvents['on'](_0x3a96db,_0x519e58);}}; \ No newline at end of file +var _0x8cb8=['save','update','emit','register','length','openchannelMessage:'];(function(_0x13b2cb,_0x5bbcbd){var _0x25679d=function(_0xf2b294){while(--_0xf2b294){_0x13b2cb['push'](_0x13b2cb['shift']());}};_0x25679d(++_0x5bbcbd);}(_0x8cb8,0x1da));var _0x88cb=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0x8cb8[_0x546aaf];return _0x1cbf6d;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x88cb('0x0'),'remove',_0x88cb('0x1')];function createListener(_0x5dcdbe,_0x5937da){return function(_0x310721){_0x5937da[_0x88cb('0x2')](_0x5dcdbe,_0x310721);};}function removeListener(_0x3d0714,_0x535248){return function(){OpenchannelMessageEvents['removeListener'](_0x3d0714,_0x535248);};}exports[_0x88cb('0x3')]=function(_0x31cbd9){for(var _0x5bd916=0x0,_0x47a263=events[_0x88cb('0x4')];_0x5bd916<_0x47a263;_0x5bd916++){var _0x5e23e1=events[_0x5bd916];var _0x549b92=createListener(_0x88cb('0x5')+_0x5e23e1,_0x31cbd9);OpenchannelMessageEvents['on'](_0x5e23e1,_0x549b92);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9fd1867..8f335cc 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 _0x02b8=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','describe','/:id','show','getMembers','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeAgents','multer','connect-timeout','Router','fs-extra'];(function(_0xf62585,_0x418395){var _0x4da19f=function(_0x599893){while(--_0x599893){_0xf62585['push'](_0xf62585['shift']());}};_0x4da19f(++_0x418395);}(_0x02b8,0x79));var _0x802b=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x02b8[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x802b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x802b('0x1'));var express=require('express');var router=express[_0x802b('0x2')]();var fs_extra=require(_0x802b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x802b('0x4'));var config=require(_0x802b('0x5'));var controller=require(_0x802b('0x6'));router['get']('/',auth[_0x802b('0x7')](),controller[_0x802b('0x8')]);router[_0x802b('0x9')]('/describe',auth[_0x802b('0x7')](),controller[_0x802b('0xa')]);router[_0x802b('0x9')](_0x802b('0xb'),auth[_0x802b('0x7')](),controller[_0x802b('0xc')]);router[_0x802b('0x9')]('/:id/members',auth[_0x802b('0x7')](),controller[_0x802b('0xd')]);router[_0x802b('0x9')]('/:id/teams',auth[_0x802b('0x7')](),controller['getTeams']);router['get'](_0x802b('0xe'),auth[_0x802b('0x7')](),controller['getAgents']);router[_0x802b('0xf')]('/',auth[_0x802b('0x7')](),controller[_0x802b('0x10')]);router[_0x802b('0xf')](_0x802b('0x11'),auth[_0x802b('0x7')](),controller[_0x802b('0x12')]);router[_0x802b('0xf')]('/:id/users',auth[_0x802b('0x7')](),controller[_0x802b('0x13')]);router[_0x802b('0x14')](_0x802b('0xb'),auth[_0x802b('0x7')](),controller[_0x802b('0x15')]);router[_0x802b('0x16')]('/:id',auth[_0x802b('0x7')](),controller[_0x802b('0x17')]);router[_0x802b('0x16')](_0x802b('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x802b('0x16')](_0x802b('0xe'),auth['isAuthenticated'](),controller[_0x802b('0x18')]);module['exports']=router; \ No newline at end of file +var _0xe1e8=['Router','fs-extra','../../config/environment','./openchannelQueue.controller','isAuthenticated','describe','get','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express'];(function(_0x14d39d,_0x585cdc){var _0x3218ba=function(_0x3b7ace){while(--_0x3b7ace){_0x14d39d['push'](_0x14d39d['shift']());}};_0x3218ba(++_0x585cdc);}(_0xe1e8,0x10f));var _0x8e1e=function(_0x197bb4,_0x7848f4){_0x197bb4=_0x197bb4-0x0;var _0xc56627=_0xe1e8[_0x197bb4];return _0xc56627;};'use strict';var multer=require(_0x8e1e('0x0'));var util=require('util');var path=require(_0x8e1e('0x1'));var timeout=require(_0x8e1e('0x2'));var express=require(_0x8e1e('0x3'));var router=express[_0x8e1e('0x4')]();var fs_extra=require(_0x8e1e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e1e('0x6'));var controller=require(_0x8e1e('0x7'));router['get']('/',auth[_0x8e1e('0x8')](),controller['index']);router['get']('/describe',auth[_0x8e1e('0x8')](),controller[_0x8e1e('0x9')]);router[_0x8e1e('0xa')](_0x8e1e('0xb'),auth[_0x8e1e('0x8')](),controller[_0x8e1e('0xc')]);router[_0x8e1e('0xa')]('/:id/members',auth[_0x8e1e('0x8')](),controller[_0x8e1e('0xd')]);router[_0x8e1e('0xa')](_0x8e1e('0xe'),auth[_0x8e1e('0x8')](),controller['getTeams']);router[_0x8e1e('0xa')](_0x8e1e('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8e1e('0x10')]('/',auth[_0x8e1e('0x8')](),controller[_0x8e1e('0x11')]);router['post'](_0x8e1e('0xe'),auth[_0x8e1e('0x8')](),controller[_0x8e1e('0x12')]);router['post'](_0x8e1e('0xf'),auth['isAuthenticated'](),controller[_0x8e1e('0x13')]);router['put'](_0x8e1e('0xb'),auth[_0x8e1e('0x8')](),controller['update']);router[_0x8e1e('0x14')](_0x8e1e('0xb'),auth[_0x8e1e('0x8')](),controller[_0x8e1e('0x15')]);router[_0x8e1e('0x14')](_0x8e1e('0xe'),auth[_0x8e1e('0x8')](),controller[_0x8e1e('0x16')]);router['delete'](_0x8e1e('0xf'),auth[_0x8e1e('0x8')](),controller[_0x8e1e('0x17')]);module[_0x8e1e('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index ef8664b..10fa0c0 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 _0xbdc8=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xbdc8,0x81));var _0x8bdc=function(_0x9472e5,_0x29ff1b){_0x9472e5=_0x9472e5-0x0;var _0x220a01=_0xbdc8[_0x9472e5];return _0x220a01;};'use strict';var Sequelize=require('sequelize');module[_0x8bdc('0x0')]={'name':{'type':Sequelize[_0x8bdc('0x1')],'unique':_0x8bdc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8bdc('0x1')]},'timeout':{'type':Sequelize[_0x8bdc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8bdc('0x4'),_0x8bdc('0x5'),_0x8bdc('0x6'))}}; \ No newline at end of file +var _0x77f0=['STRING','name','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x1098ff,_0x352a6e){var _0x331233=function(_0x420ea5){while(--_0x420ea5){_0x1098ff['push'](_0x1098ff['shift']());}};_0x331233(++_0x352a6e);}(_0x77f0,0x19b));var _0x077f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x77f0[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x077f('0x0'));module[_0x077f('0x1')]={'name':{'type':Sequelize[_0x077f('0x2')],'unique':_0x077f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x077f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x077f('0x4')](_0x077f('0x5'),'beepall',_0x077f('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 65350f6..f62f97d 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 _0x7693=['includes','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','then','destroy','get','UserProfileResource','error','stack','name','map','OpenchannelQueue','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','nolimit','addTeams','ids','Agents','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT'];(function(_0x4cd0b1,_0x4f3578){var _0x480f3a=function(_0x4c79fd){while(--_0x4c79fd){_0x4cd0b1['push'](_0x4cd0b1['shift']());}};_0x480f3a(++_0x4f3578);}(_0x7693,0x12f));var _0x3769=function(_0x7cc230,_0xc0ddc7){_0x7cc230=_0x7cc230-0x0;var _0x54a7ed=_0x7693[_0x7cc230];return _0x54a7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3769('0x0'));var jsonpatch=require(_0x3769('0x1'));var rp=require(_0x3769('0x2'));var moment=require(_0x3769('0x3'));var BPromise=require(_0x3769('0x4'));var Mustache=require(_0x3769('0x5'));var util=require(_0x3769('0x6'));var path=require(_0x3769('0x7'));var sox=require(_0x3769('0x8'));var csv=require(_0x3769('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3769('0xa'));var _=require('lodash');var squel=require(_0x3769('0xb'));var crypto=require(_0x3769('0xc'));var jsforce=require(_0x3769('0xd'));var deskjs=require(_0x3769('0xe'));var toCsv=require(_0x3769('0x9'));var querystring=require(_0x3769('0xf'));var Papa=require(_0x3769('0x10'));var Redis=require(_0x3769('0x11'));var authService=require(_0x3769('0x12'));var qs=require(_0x3769('0x13'));var as=require(_0x3769('0x14'));var hardwareService=require(_0x3769('0x15'));var logger=require(_0x3769('0x16'))(_0x3769('0x17'));var utils=require(_0x3769('0x18'));var config=require(_0x3769('0x19'));var licenseUtil=require(_0x3769('0x1a'));var db=require(_0x3769('0x1b'))['db'];config['redis']=_[_0x3769('0x1c')](config['redis'],{'host':_0x3769('0x1d'),'port':0x18eb});var socket=require(_0x3769('0x1e'))(new Redis(config[_0x3769('0x1f')]));require(_0x3769('0x20'))[_0x3769('0x21')](socket);function respondWithStatusCode(_0x4f6916,_0x36c807){_0x36c807=_0x36c807||0xcc;return function(_0x120eb1){if(_0x120eb1){return _0x4f6916[_0x3769('0x22')](_0x36c807);}return _0x4f6916[_0x3769('0x23')](_0x36c807)[_0x3769('0x24')]();};}function respondWithResult(_0x153bf9,_0x1772c2){_0x1772c2=_0x1772c2||0xc8;return function(_0x56910e){if(_0x56910e){return _0x153bf9[_0x3769('0x23')](_0x1772c2)[_0x3769('0x25')](_0x56910e);}};}function respondWithFilteredResult(_0x5c4a5e,_0x2e8f61){return function(_0x230ecb){if(_0x230ecb){var _0x35a674=typeof _0x2e8f61['offset']==='undefined'&&typeof _0x2e8f61[_0x3769('0x26')]===_0x3769('0x27');var _0xe6f94d=_0x230ecb[_0x3769('0x28')];var _0x1ef3ef=_0x35a674?0x0:_0x2e8f61[_0x3769('0x29')];var _0x387662=_0x35a674?_0x230ecb['count']:_0x2e8f61[_0x3769('0x29')]+_0x2e8f61['limit'];var _0x4fef88;if(_0x387662>=_0xe6f94d){_0x387662=_0xe6f94d;_0x4fef88=0xc8;}else{_0x4fef88=0xce;}_0x5c4a5e[_0x3769('0x23')](_0x4fef88);return _0x5c4a5e[_0x3769('0x2a')](_0x3769('0x2b'),_0x1ef3ef+'-'+_0x387662+'/'+_0xe6f94d)[_0x3769('0x25')](_0x230ecb);}return null;};}function patchUpdates(_0x5b1ffc){return function(_0x12ebbb){try{jsonpatch[_0x3769('0x2c')](_0x12ebbb,_0x5b1ffc,!![]);}catch(_0x2996a2){return BPromise['reject'](_0x2996a2);}return _0x12ebbb['save']();};}function saveUpdates(_0x3b3779,_0x55985d){return function(_0x505e13){if(_0x505e13){return _0x505e13['update'](_0x3b3779)[_0x3769('0x2d')](function(_0x216535){return _0x216535;});}return null;};}function removeEntity(_0x4cef03,_0x4d6d03){return function(_0x966cdd){if(_0x966cdd){return _0x966cdd[_0x3769('0x2e')]()['then'](function(){var _0x15e12f=_0x966cdd[_0x3769('0x2f')]({'plain':!![]});var _0x45f1b8='OpenchannelQueues';return db[_0x3769('0x30')][_0x3769('0x2e')]({'where':{'type':_0x45f1b8,'resourceId':_0x15e12f['id']}})['then'](function(){return _0x966cdd;});})[_0x3769('0x2d')](function(){_0x4cef03['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54cd65,_0x547980){return function(_0x235973){if(!_0x235973){_0x54cd65['sendStatus'](0x194);}return _0x235973;};}function handleError(_0x510db1,_0x29e147){_0x29e147=_0x29e147||0x1f4;return function(_0x10f5fa){logger[_0x3769('0x31')](_0x10f5fa[_0x3769('0x32')]);if(_0x10f5fa[_0x3769('0x33')]){delete _0x10f5fa[_0x3769('0x33')];}_0x510db1['status'](_0x29e147)['send'](_0x10f5fa);};}exports['index']=function(_0x203f43,_0x2fc1d2){var _0xf4d80e={},_0x4f1397={},_0x2cc8a7={'count':0x0,'rows':[]};var _0x17d8b7=_[_0x3769('0x34')](db[_0x3769('0x35')]['rawAttributes'],function(_0x24589a){return{'name':_0x24589a[_0x3769('0x36')],'type':_0x24589a[_0x3769('0x37')][_0x3769('0x38')]};});_0x4f1397[_0x3769('0x39')]=_[_0x3769('0x34')](_0x17d8b7,_0x3769('0x33'));_0x4f1397[_0x3769('0x3a')]=_[_0x3769('0x3b')](_0x203f43[_0x3769('0x3a')]);_0x4f1397[_0x3769('0x3c')]=_[_0x3769('0x3d')](_0x4f1397[_0x3769('0x39')],_0x4f1397['query']);_0xf4d80e['attributes']=_[_0x3769('0x3d')](_0x4f1397[_0x3769('0x39')],qs[_0x3769('0x3e')](_0x203f43['query'][_0x3769('0x3e')]));_0xf4d80e[_0x3769('0x3f')]=_0xf4d80e[_0x3769('0x3f')][_0x3769('0x40')]?_0xf4d80e[_0x3769('0x3f')]:_0x4f1397[_0x3769('0x39')];if(!_0x203f43['query'][_0x3769('0x41')]('nolimit')){_0xf4d80e[_0x3769('0x26')]=qs[_0x3769('0x26')](_0x203f43[_0x3769('0x3a')][_0x3769('0x26')]);_0xf4d80e[_0x3769('0x29')]=qs[_0x3769('0x29')](_0x203f43[_0x3769('0x3a')][_0x3769('0x29')]);}_0xf4d80e[_0x3769('0x42')]=qs[_0x3769('0x43')](_0x203f43[_0x3769('0x3a')][_0x3769('0x43')]);_0xf4d80e[_0x3769('0x44')]=qs['filters'](_['pick'](_0x203f43['query'],_0x4f1397[_0x3769('0x3c')]),_0x17d8b7);if(_0x203f43[_0x3769('0x3a')][_0x3769('0x45')]){_0xf4d80e[_0x3769('0x44')]=_[_0x3769('0x46')](_0xf4d80e[_0x3769('0x44')],{'$or':_[_0x3769('0x34')](_0x17d8b7,function(_0x1385a0){if(_0x1385a0[_0x3769('0x37')]!==_0x3769('0x47')){var _0x1affd1={};_0x1affd1[_0x1385a0[_0x3769('0x33')]]={'$like':'%'+_0x203f43[_0x3769('0x3a')][_0x3769('0x45')]+'%'};return _0x1affd1;}})});}_0xf4d80e=_[_0x3769('0x46')]({},_0xf4d80e,_0x203f43['options']);var _0x5d46aa={'where':_0xf4d80e[_0x3769('0x44')]};return db[_0x3769('0x35')][_0x3769('0x28')](_0x5d46aa)[_0x3769('0x2d')](function(_0x15aba6){_0x2cc8a7[_0x3769('0x28')]=_0x15aba6;if(_0x203f43[_0x3769('0x3a')][_0x3769('0x48')]){_0xf4d80e[_0x3769('0x49')]=[{'all':!![]}];}return db[_0x3769('0x35')][_0x3769('0x4a')](_0xf4d80e);})[_0x3769('0x2d')](function(_0x350331){_0x2cc8a7[_0x3769('0x4b')]=_0x350331;return _0x2cc8a7;})[_0x3769('0x2d')](respondWithFilteredResult(_0x2fc1d2,_0xf4d80e))['catch'](handleError(_0x2fc1d2,null));};exports[_0x3769('0x4c')]=function(_0x3842e7,_0x1d80a3){var _0x426818={'raw':!![],'where':{'id':_0x3842e7[_0x3769('0x4d')]['id']}},_0x16f1a7={};_0x16f1a7[_0x3769('0x39')]=_[_0x3769('0x3b')](db[_0x3769('0x35')][_0x3769('0x4e')]);_0x16f1a7[_0x3769('0x3a')]=_[_0x3769('0x3b')](_0x3842e7[_0x3769('0x3a')]);_0x16f1a7['filters']=_[_0x3769('0x3d')](_0x16f1a7[_0x3769('0x39')],_0x16f1a7['query']);_0x426818[_0x3769('0x3f')]=_[_0x3769('0x3d')](_0x16f1a7['model'],qs['fields'](_0x3842e7[_0x3769('0x3a')][_0x3769('0x3e')]));_0x426818[_0x3769('0x3f')]=_0x426818['attributes'][_0x3769('0x40')]?_0x426818['attributes']:_0x16f1a7['model'];if(_0x3842e7[_0x3769('0x3a')][_0x3769('0x48')]){_0x426818[_0x3769('0x49')]=[{'all':!![]}];}_0x426818=_['merge']({},_0x426818,_0x3842e7[_0x3769('0x4f')]);return db['OpenchannelQueue']['find'](_0x426818)['then'](handleEntityNotFound(_0x1d80a3,null))[_0x3769('0x2d')](respondWithResult(_0x1d80a3,null))[_0x3769('0x50')](handleError(_0x1d80a3,null));};exports[_0x3769('0x51')]=function(_0x3d3a12,_0x526bce){return db['OpenchannelQueue'][_0x3769('0x51')](_0x3d3a12['body'],{})[_0x3769('0x2d')](function(_0x5eda20){var _0x46daac=_0x3d3a12['user'][_0x3769('0x2f')]({'plain':!![]});if(!_0x46daac)throw new Error(_0x3769('0x52'));if(_0x46daac[_0x3769('0x53')]==='user'){var _0x2b2672=_0x5eda20[_0x3769('0x2f')]({'plain':!![]});var _0x556351=_0x3769('0x54');return db[_0x3769('0x55')][_0x3769('0x56')]({'where':{'name':_0x556351,'userProfileId':_0x46daac[_0x3769('0x57')]},'raw':!![]})[_0x3769('0x2d')](function(_0x2b77ff){if(_0x2b77ff&&_0x2b77ff[_0x3769('0x58')]===0x0){return db[_0x3769('0x30')][_0x3769('0x51')]({'name':_0x2b2672[_0x3769('0x33')],'resourceId':_0x2b2672['id'],'type':_0x2b77ff[_0x3769('0x33')],'sectionId':_0x2b77ff['id']},{})['then'](function(){return _0x5eda20;});}else{return _0x5eda20;}})[_0x3769('0x50')](function(_0x445c91){logger['error'](_0x3769('0x59'),_0x445c91);throw _0x445c91;});}return _0x5eda20;})[_0x3769('0x2d')](respondWithResult(_0x526bce,0xc9))[_0x3769('0x50')](handleError(_0x526bce,null));};exports['update']=function(_0x1c063a,_0x5eaf1b){if(_0x1c063a[_0x3769('0x5a')]['id']){delete _0x1c063a[_0x3769('0x5a')]['id'];}return db[_0x3769('0x35')][_0x3769('0x56')]({'where':{'id':_0x1c063a[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](handleEntityNotFound(_0x5eaf1b,null))[_0x3769('0x2d')](saveUpdates(_0x1c063a[_0x3769('0x5a')],null))[_0x3769('0x2d')](respondWithResult(_0x5eaf1b,null))[_0x3769('0x50')](handleError(_0x5eaf1b,null));};exports[_0x3769('0x2e')]=function(_0x43d5d5,_0x1170b1){return db[_0x3769('0x35')][_0x3769('0x56')]({'where':{'id':_0x43d5d5[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](handleEntityNotFound(_0x1170b1,null))[_0x3769('0x2d')](removeEntity(_0x1170b1,null))[_0x3769('0x50')](handleError(_0x1170b1,null));};exports['describe']=function(_0x453560,_0x3779d8){return db['OpenchannelQueue']['describe']()[_0x3769('0x2d')](respondWithResult(_0x3779d8,null))[_0x3769('0x50')](handleError(_0x3779d8,null));};exports[_0x3769('0x5b')]=function(_0x522507,_0x1f5b12,_0x3758f6){var _0x4c8b27={'raw':!![],'where':{}},_0x13c4f5={},_0x471c56;return db[_0x3769('0x35')][_0x3769('0x5c')]({'where':{'id':_0x522507[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](handleEntityNotFound(_0x1f5b12,null))[_0x3769('0x2d')](function(_0x31bd0c){if(_0x31bd0c){_0x471c56=_0x31bd0c[_0x3769('0x2f')]({'plain':!![]});_0x13c4f5['model']=_['keys'](db[_0x3769('0x5d')][_0x3769('0x4e')]);_0x13c4f5[_0x3769('0x3a')]=_[_0x3769('0x3b')](_0x522507[_0x3769('0x3a')]);_0x13c4f5['filters']=_['intersection'](_0x13c4f5['model'],_0x13c4f5[_0x3769('0x3a')]);_0x4c8b27['attributes']=_[_0x3769('0x3d')](_0x13c4f5[_0x3769('0x39')],qs['fields'](_0x522507['query'][_0x3769('0x3e')]));_0x4c8b27[_0x3769('0x3f')]=_0x4c8b27['attributes'][_0x3769('0x40')]?_0x4c8b27[_0x3769('0x3f')]:_0x13c4f5[_0x3769('0x39')];if(!_0x522507[_0x3769('0x3a')]['hasOwnProperty']('nolimit')){_0x4c8b27[_0x3769('0x26')]=qs[_0x3769('0x26')](_0x522507['query']['limit']);_0x4c8b27[_0x3769('0x29')]=qs[_0x3769('0x29')](_0x522507[_0x3769('0x3a')][_0x3769('0x29')]);}_0x4c8b27[_0x3769('0x42')]=qs[_0x3769('0x43')](_0x522507[_0x3769('0x3a')][_0x3769('0x43')]);_0x4c8b27[_0x3769('0x44')]=qs[_0x3769('0x3c')](_['pick'](_0x522507[_0x3769('0x3a')],_0x13c4f5[_0x3769('0x3c')]));_0x4c8b27[_0x3769('0x44')][_0x3769('0x5e')]=_0x31bd0c['id'];if(_0x522507[_0x3769('0x3a')][_0x3769('0x45')]){_0x4c8b27[_0x3769('0x44')]=_[_0x3769('0x46')](_0x4c8b27[_0x3769('0x44')],{'$or':_[_0x3769('0x34')](_0x4c8b27[_0x3769('0x3f')],function(_0x21ef46){var _0x38ae4f={};_0x38ae4f[_0x21ef46]={'$like':'%'+_0x522507[_0x3769('0x3a')][_0x3769('0x45')]+'%'};return _0x38ae4f;})});}_0x4c8b27=_[_0x3769('0x46')]({},_0x4c8b27,_0x522507['options']);return db[_0x3769('0x5d')][_0x3769('0x4a')](_0x4c8b27);}})[_0x3769('0x2d')](function(_0x66da5e){if(_0x66da5e){return db[_0x3769('0x5f')][_0x3769('0x60')]({'where':{'id':_[_0x3769('0x34')](_0x66da5e,_0x3769('0x61')),'role':'agent'},'attributes':['id',_0x3769('0x33'),_0x3769('0x62'),_0x3769('0x63'),_0x3769('0x64')]});}})[_0x3769('0x2d')](function(_0x359a95){if(_0x359a95){return{'count':_0x359a95[_0x3769('0x28')],'rows':_[_0x3769('0x34')](_0x359a95[_0x3769('0x4b')],function(_0x44f676){return{'membername':_0x44f676[_0x3769('0x33')],'UserId':_0x44f676['id'],'queue_name':_0x471c56[_0x3769('0x33')],'OpenchannelQueueId':_0x471c56['id'],'interface':util[_0x3769('0x65')](_0x3769('0x66'),_0x3769('0x67'),_0x44f676['name']),'penalty':0x0,'paused':_0x44f676[_0x3769('0x62')],'createdAt':_0x44f676[_0x3769('0x64')],'updatedAt':_0x44f676[_0x3769('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3769('0x2d')](respondWithFilteredResult(_0x1f5b12,_0x4c8b27))[_0x3769('0x50')](handleError(_0x1f5b12,null));};exports[_0x3769('0x68')]=function(_0x2e356d,_0x125897,_0x2e4074){var _0x332c7c={};var _0x22a9fb={};var _0x343e62;var _0x1ae0c2;return db[_0x3769('0x35')][_0x3769('0x5c')]({'where':{'id':_0x2e356d[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](handleEntityNotFound(_0x125897,null))[_0x3769('0x2d')](function(_0x536927){if(_0x536927){_0x343e62=_0x536927;_0x22a9fb[_0x3769('0x39')]=_[_0x3769('0x3b')](db[_0x3769('0x69')][_0x3769('0x4e')]);_0x22a9fb[_0x3769('0x3a')]=_[_0x3769('0x3b')](_0x2e356d[_0x3769('0x3a')]);_0x22a9fb[_0x3769('0x3c')]=_[_0x3769('0x3d')](_0x22a9fb[_0x3769('0x39')],_0x22a9fb[_0x3769('0x3a')]);_0x332c7c['attributes']=_[_0x3769('0x3d')](_0x22a9fb['model'],qs[_0x3769('0x3e')](_0x2e356d[_0x3769('0x3a')][_0x3769('0x3e')]));_0x332c7c[_0x3769('0x3f')]=_0x332c7c[_0x3769('0x3f')][_0x3769('0x40')]?_0x332c7c['attributes']:_0x22a9fb['model'];_0x332c7c[_0x3769('0x42')]=qs[_0x3769('0x43')](_0x2e356d[_0x3769('0x3a')][_0x3769('0x43')]);_0x332c7c[_0x3769('0x44')]=qs[_0x3769('0x3c')](_[_0x3769('0x6a')](_0x2e356d[_0x3769('0x3a')],_0x22a9fb['filters']));if(_0x2e356d['query'][_0x3769('0x45')]){_0x332c7c[_0x3769('0x44')]=_[_0x3769('0x46')](_0x332c7c[_0x3769('0x44')],{'$or':_['map'](_0x332c7c['attributes'],function(_0x546f31){var _0x1c7fb3={};_0x1c7fb3[_0x546f31]={'$like':'%'+_0x2e356d['query'][_0x3769('0x45')]+'%'};return _0x1c7fb3;})});}_0x332c7c=_[_0x3769('0x46')]({},_0x332c7c,_0x2e356d[_0x3769('0x4f')]);return _0x343e62[_0x3769('0x68')](_0x332c7c);}})[_0x3769('0x2d')](function(_0x31a7e0){if(_0x31a7e0){_0x1ae0c2=_0x31a7e0['length'];if(!_0x2e356d[_0x3769('0x3a')]['hasOwnProperty'](_0x3769('0x6b'))){_0x332c7c[_0x3769('0x26')]=qs[_0x3769('0x26')](_0x2e356d['query']['limit']);_0x332c7c['offset']=qs[_0x3769('0x29')](_0x2e356d['query'][_0x3769('0x29')]);}return _0x343e62[_0x3769('0x68')](_0x332c7c);}})[_0x3769('0x2d')](function(_0x9b3e20){if(_0x9b3e20){return _0x9b3e20?{'count':_0x1ae0c2,'rows':_0x9b3e20}:null;}})[_0x3769('0x2d')](respondWithResult(_0x125897,null))[_0x3769('0x50')](handleError(_0x125897,null));};exports[_0x3769('0x6c')]=function(_0x50ff09,_0x3287db,_0xef17f3){var _0x533f08=_0x50ff09[_0x3769('0x5a')][_0x3769('0x6d')];return db['Team'][_0x3769('0x4a')]({'where':{'id':_0x533f08},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3769('0x6e'),'attributes':['id',_0x3769('0x33'),'online',_0x3769('0x6f'),'interface'],'raw':!![]}]})[_0x3769('0x2d')](function(_0xb485){if(_0xb485){var _0x281099=_[_0x3769('0x70')](_0xb485,function(_0xda70e){var _0x590c23=_0xda70e['get']({'plain':!![]});return _0x590c23[_0x3769('0x6e')];});return db[_0x3769('0x35')][_0x3769('0x56')]({'where':{'id':_0x50ff09[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](function(_0x15cb41){return db[_0x3769('0x71')]['transaction'](function(_0x4e8ad8){return _0x15cb41[_0x3769('0x6c')](_0x533f08,{'transaction':_0x4e8ad8})[_0x3769('0x2d')](function(){return BPromise[_0x3769('0x72')](_0x281099,function(_0x4116e8){return db[_0x3769('0x5d')][_0x3769('0x73')]({'where':{'UserId':_0x4116e8['id'],'OpenchannelQueueId':_0x50ff09['params']['id']},'transaction':_0x4e8ad8});});})['then'](function(){_0x281099[_0x3769('0x74')](function(_0xdce863){socket[_0x3769('0x75')](_0x3769('0x76'),{'UserId':_0xdce863['id'],'OpenchannelQueueId':_0x15cb41['id']});});});});});}})[_0x3769('0x2d')](respondWithStatusCode(_0x3287db,null))[_0x3769('0x50')](handleError(_0x3287db,null));};exports[_0x3769('0x77')]=function(_0x1fd97a,_0x42d68f,_0x2d8232){return db['Team'][_0x3769('0x4a')]({'where':{'id':_0x1fd97a[_0x3769('0x3a')][_0x3769('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x3769('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3769('0x2d')](handleEntityNotFound(_0x42d68f,null))[_0x3769('0x2d')](function(_0x1eea98){var _0x267f2f=_[_0x3769('0x34')](_0x1eea98,'id');var _0x22c4d3=[];var _0x38ae1a=[];var _0x210371=squel[_0x3769('0x78')]();_0x210371[_0x3769('0x79')](_0x3769('0x7a'))[_0x3769('0x7b')]('team_has_openchannel_queues','tq')[_0x3769('0x7c')](_0x3769('0x7d'),'ut',_0x3769('0x7e'))[_0x3769('0x44')](_0x3769('0x7f'),_0x1fd97a['params']['id']);for(var _0x180396=0x0;_0x180396<_0x1eea98[_0x3769('0x40')];_0x180396+=0x1){let _0x39ca8b=_0x1eea98[_0x180396];for(var _0x2cba50=0x0;_0x2cba50<_0x39ca8b[_0x3769('0x6e')][_0x3769('0x40')];_0x2cba50+=0x1){let _0x18ce4f=_0x39ca8b[_0x3769('0x6e')][_0x2cba50];var _0x411579=_0x210371[_0x3769('0x80')]();_0x411579[_0x3769('0x44')](_0x3769('0x81'),_0x18ce4f['id']);_0x38ae1a['push'](db['sequelize'][_0x3769('0x3a')](_0x411579[_0x3769('0x82')](),{'type':db[_0x3769('0x71')]['QueryTypes'][_0x3769('0x83')]})[_0x3769('0x2d')](function(_0x4a9c2f){if(_0x4a9c2f[_0x3769('0x40')]===0x1){return _0x18ce4f['id'];}else{var _0x16e8e7=_['every'](_[_0x3769('0x34')](_0x4a9c2f,'TeamId'),function(_0x5f2052){return _[_0x3769('0x84')](_0x267f2f,_0x5f2052);});if(_0x16e8e7){return _0x18ce4f['id'];}}}));}}return BPromise['all'](_0x38ae1a)[_0x3769('0x2d')](function(_0x2c6978){_0x22c4d3=_(_0x22c4d3)[_0x3769('0x85')](_0x2c6978)[_0x3769('0x86')]()[_0x3769('0x87')]();return db[_0x3769('0x35')]['find']({'where':{'id':_0x1fd97a[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](function(_0x275240){return db['sequelize'][_0x3769('0x88')](function(_0x127f82){return _0x275240[_0x3769('0x77')](_0x1fd97a[_0x3769('0x3a')][_0x3769('0x6d')],{'transaction':_0x127f82})['then'](function(){if(!_[_0x3769('0x89')](_0x22c4d3)){return _0x275240[_0x3769('0x8a')](_0x22c4d3,{'transaction':_0x127f82});}})[_0x3769('0x2d')](function(){_0x22c4d3[_0x3769('0x74')](function(_0x9b8bfa){socket[_0x3769('0x75')](_0x3769('0x8b'),{'UserId':_0x9b8bfa,'OpenchannelQueueId':_0x275240['id']});});});});});});})[_0x3769('0x2d')](respondWithStatusCode(_0x42d68f,null))[_0x3769('0x50')](handleError(_0x42d68f,null));};exports[_0x3769('0x8c')]=function(_0x2bf315,_0x2b67b0,_0x2a660d){return db[_0x3769('0x35')][_0x3769('0x56')]({'where':{'id':_0x2bf315[_0x3769('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2b67b0,null))[_0x3769('0x2d')](function(_0x551f95){if(_0x551f95){return _0x551f95[_0x3769('0x8c')](_0x2bf315[_0x3769('0x5a')][_0x3769('0x6d')],_[_0x3769('0x8d')](_0x2bf315[_0x3769('0x5a')],[_0x3769('0x6d'),'id'])||{})[_0x3769('0x8e')](function(_0x19b243){for(var _0x3c723f=0x0;_0x3c723f<_0x2bf315[_0x3769('0x5a')][_0x3769('0x6d')][_0x3769('0x40')];_0x3c723f+=0x1){socket[_0x3769('0x75')](_0x3769('0x76'),{'UserId':Number(_0x2bf315['body'][_0x3769('0x6d')][_0x3c723f]),'OpenchannelQueueId':Number(_0x2bf315[_0x3769('0x4d')]['id'])});}return _0x19b243;});}})[_0x3769('0x2d')](respondWithResult(_0x2b67b0,null))[_0x3769('0x50')](handleError(_0x2b67b0,null));};exports['removeAgents']=function(_0xf81ac1,_0x35bfca,_0xdde566){return db['OpenchannelQueue'][_0x3769('0x56')]({'where':{'id':_0xf81ac1[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](handleEntityNotFound(_0x35bfca,null))[_0x3769('0x2d')](function(_0x4549b8){if(_0x4549b8){return _0x4549b8['removeAgents'](_0xf81ac1[_0x3769('0x3a')][_0x3769('0x6d')])[_0x3769('0x2d')](function(){if(_[_0x3769('0x8f')](_0xf81ac1[_0x3769('0x3a')][_0x3769('0x6d')])){for(var _0x40bcd1=0x0;_0x40bcd1<_0xf81ac1[_0x3769('0x3a')]['ids'][_0x3769('0x40')];_0x40bcd1+=0x1){socket[_0x3769('0x75')](_0x3769('0x8b'),{'UserId':Number(_0xf81ac1['query'][_0x3769('0x6d')][_0x40bcd1]),'OpenchannelQueueId':Number(_0xf81ac1[_0x3769('0x4d')]['id'])});}}else{socket[_0x3769('0x75')](_0x3769('0x8b'),{'UserId':Number(_0xf81ac1[_0x3769('0x3a')][_0x3769('0x6d')]),'OpenchannelQueueId':Number(_0xf81ac1[_0x3769('0x4d')]['id'])});}});}})[_0x3769('0x2d')](respondWithStatusCode(_0x35bfca,null))['catch'](handleError(_0x35bfca,null));};exports['getAgents']=function(_0x5b3c87,_0x5acdf8,_0x561ac6){var _0x262e96={};var _0x30c19a={};var _0x426f1f;var _0x1136ea;return db[_0x3769('0x35')]['findOne']({'where':{'id':_0x5b3c87[_0x3769('0x4d')]['id']}})[_0x3769('0x2d')](handleEntityNotFound(_0x5acdf8,null))[_0x3769('0x2d')](function(_0x364b4b){if(_0x364b4b){_0x426f1f=_0x364b4b;_0x30c19a[_0x3769('0x39')]=_[_0x3769('0x3b')](db[_0x3769('0x5f')]['rawAttributes']);_0x30c19a['query']=_[_0x3769('0x3b')](_0x5b3c87[_0x3769('0x3a')]);_0x30c19a[_0x3769('0x3c')]=_[_0x3769('0x3d')](_0x30c19a['model'],_0x30c19a[_0x3769('0x3a')]);_0x262e96[_0x3769('0x3f')]=_[_0x3769('0x3d')](_0x30c19a[_0x3769('0x39')],qs[_0x3769('0x3e')](_0x5b3c87[_0x3769('0x3a')][_0x3769('0x3e')]));_0x262e96[_0x3769('0x3f')]=_0x262e96[_0x3769('0x3f')]['length']?_0x262e96['attributes']:_0x30c19a[_0x3769('0x39')];_0x262e96[_0x3769('0x42')]=qs[_0x3769('0x43')](_0x5b3c87['query'][_0x3769('0x43')]);_0x262e96['where']=qs[_0x3769('0x3c')](_[_0x3769('0x6a')](_0x5b3c87[_0x3769('0x3a')],_0x30c19a[_0x3769('0x3c')]));if(_0x5b3c87[_0x3769('0x3a')][_0x3769('0x45')]){_0x262e96[_0x3769('0x44')]=_[_0x3769('0x46')](_0x262e96['where'],{'$or':_['map'](_0x262e96['attributes'],function(_0x30df28){var _0x291e88={};_0x291e88[_0x30df28]={'$like':'%'+_0x5b3c87[_0x3769('0x3a')][_0x3769('0x45')]+'%'};return _0x291e88;})});}_0x262e96=_[_0x3769('0x46')]({},_0x262e96,_0x5b3c87[_0x3769('0x4f')]);return _0x426f1f['getAgents'](_0x262e96);}})[_0x3769('0x2d')](function(_0x245c00){if(_0x245c00){_0x1136ea=_0x245c00[_0x3769('0x40')];if(!_0x5b3c87['query']['hasOwnProperty'](_0x3769('0x6b'))){_0x262e96[_0x3769('0x26')]=qs[_0x3769('0x26')](_0x5b3c87[_0x3769('0x3a')]['limit']);_0x262e96[_0x3769('0x29')]=qs[_0x3769('0x29')](_0x5b3c87[_0x3769('0x3a')][_0x3769('0x29')]);}return _0x426f1f[_0x3769('0x90')](_0x262e96);}})[_0x3769('0x2d')](function(_0x5cd430){if(_0x5cd430){return _0x5cd430?{'count':_0x1136ea,'rows':_0x5cd430}:null;}})['then'](respondWithResult(_0x5acdf8,null))[_0x3769('0x50')](handleError(_0x5acdf8,null));}; \ No newline at end of file +var _0xa83f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','role','user','get','UserProfileSection','body','params','describe','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','online','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','addAgents','spread','emit','isArray','userOpenchannelQueue:remove','getAgents','nolimit'];(function(_0x51d23a,_0x44a681){var _0x45245e=function(_0x125e29){while(--_0x125e29){_0x51d23a['push'](_0x51d23a['shift']());}};_0x45245e(++_0x44a681);}(_0xa83f,0x85));var _0xfa83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa83f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfa83('0x0'));var rimraf=require(_0xfa83('0x1'));var zipdir=require(_0xfa83('0x2'));var jsonpatch=require(_0xfa83('0x3'));var rp=require(_0xfa83('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa83('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa83('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfa83('0x7'));var deskjs=require(_0xfa83('0x8'));var toCsv=require(_0xfa83('0x9'));var querystring=require(_0xfa83('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfa83('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0xfa83('0xc'));var hardwareService=require(_0xfa83('0xd'));var logger=require('../../config/logger')(_0xfa83('0xe'));var utils=require(_0xfa83('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xfa83('0x10'));var db=require('../../mysqldb')['db'];config[_0xfa83('0x11')]=_['defaults'](config[_0xfa83('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa83('0x12'))(new Redis(config[_0xfa83('0x11')]));require(_0xfa83('0x13'))[_0xfa83('0x14')](socket);function respondWithStatusCode(_0x2d54ed,_0x12867c){_0x12867c=_0x12867c||0xcc;return function(_0x33ac42){if(_0x33ac42){return _0x2d54ed[_0xfa83('0x15')](_0x12867c);}return _0x2d54ed['status'](_0x12867c)[_0xfa83('0x16')]();};}function respondWithResult(_0x4b2e8e,_0x2cab3a){_0x2cab3a=_0x2cab3a||0xc8;return function(_0x5c43c2){if(_0x5c43c2){return _0x4b2e8e[_0xfa83('0x17')](_0x2cab3a)[_0xfa83('0x18')](_0x5c43c2);}};}function respondWithFilteredResult(_0x2c2a57,_0x8a644b){return function(_0x34f342){if(_0x34f342){var _0x51f3e1=typeof _0x8a644b[_0xfa83('0x19')]==='undefined'&&typeof _0x8a644b['limit']===_0xfa83('0x1a');var _0xc41992=_0x34f342[_0xfa83('0x1b')];var _0x2f5d0b=_0x51f3e1?0x0:_0x8a644b[_0xfa83('0x19')];var _0x5ecfc6=_0x51f3e1?_0x34f342['count']:_0x8a644b[_0xfa83('0x19')]+_0x8a644b[_0xfa83('0x1c')];var _0x289018;if(_0x5ecfc6>=_0xc41992){_0x5ecfc6=_0xc41992;_0x289018=0xc8;}else{_0x289018=0xce;}_0x2c2a57[_0xfa83('0x17')](_0x289018);return _0x2c2a57[_0xfa83('0x1d')](_0xfa83('0x1e'),_0x2f5d0b+'-'+_0x5ecfc6+'/'+_0xc41992)[_0xfa83('0x18')](_0x34f342);}return null;};}function patchUpdates(_0x5c3c4d){return function(_0x1bdec9){try{jsonpatch[_0xfa83('0x1f')](_0x1bdec9,_0x5c3c4d,!![]);}catch(_0x35db82){return BPromise['reject'](_0x35db82);}return _0x1bdec9[_0xfa83('0x20')]();};}function saveUpdates(_0x541489,_0x38af32){return function(_0xaa402e){if(_0xaa402e){return _0xaa402e[_0xfa83('0x21')](_0x541489)[_0xfa83('0x22')](function(_0xe3d6a1){return _0xe3d6a1;});}return null;};}function removeEntity(_0x538458,_0x5a073d){return function(_0x57b959){if(_0x57b959){return _0x57b959[_0xfa83('0x23')]()[_0xfa83('0x22')](function(){var _0x239508=_0x57b959['get']({'plain':!![]});var _0x3aa314='OpenchannelQueues';return db[_0xfa83('0x24')]['destroy']({'where':{'type':_0x3aa314,'resourceId':_0x239508['id']}})['then'](function(){return _0x57b959;});})[_0xfa83('0x22')](function(){_0x538458[_0xfa83('0x17')](0xcc)[_0xfa83('0x16')]();});}};}function handleEntityNotFound(_0x117280,_0x1b140d){return function(_0x39c08b){if(!_0x39c08b){_0x117280['sendStatus'](0x194);}return _0x39c08b;};}function handleError(_0x19bf7a,_0x1c4e1e){_0x1c4e1e=_0x1c4e1e||0x1f4;return function(_0x1410a1){logger[_0xfa83('0x25')](_0x1410a1[_0xfa83('0x26')]);if(_0x1410a1[_0xfa83('0x27')]){delete _0x1410a1[_0xfa83('0x27')];}_0x19bf7a['status'](_0x1c4e1e)[_0xfa83('0x28')](_0x1410a1);};}exports[_0xfa83('0x29')]=function(_0x2a7119,_0x9641d){var _0x206f5c={},_0x4c2882={},_0x432509={'count':0x0,'rows':[]};var _0x5a2e6d=_['map'](db[_0xfa83('0x2a')][_0xfa83('0x2b')],function(_0x37b0f1){return{'name':_0x37b0f1[_0xfa83('0x2c')],'type':_0x37b0f1[_0xfa83('0x2d')][_0xfa83('0x2e')]};});_0x4c2882[_0xfa83('0x2f')]=_[_0xfa83('0x30')](_0x5a2e6d,_0xfa83('0x27'));_0x4c2882['query']=_[_0xfa83('0x31')](_0x2a7119[_0xfa83('0x32')]);_0x4c2882[_0xfa83('0x33')]=_[_0xfa83('0x34')](_0x4c2882['model'],_0x4c2882[_0xfa83('0x32')]);_0x206f5c[_0xfa83('0x35')]=_['intersection'](_0x4c2882[_0xfa83('0x2f')],qs[_0xfa83('0x36')](_0x2a7119['query']['fields']));_0x206f5c['attributes']=_0x206f5c['attributes'][_0xfa83('0x37')]?_0x206f5c[_0xfa83('0x35')]:_0x4c2882['model'];if(!_0x2a7119[_0xfa83('0x32')][_0xfa83('0x38')]('nolimit')){_0x206f5c[_0xfa83('0x1c')]=qs[_0xfa83('0x1c')](_0x2a7119[_0xfa83('0x32')]['limit']);_0x206f5c['offset']=qs[_0xfa83('0x19')](_0x2a7119[_0xfa83('0x32')]['offset']);}_0x206f5c[_0xfa83('0x39')]=qs[_0xfa83('0x3a')](_0x2a7119[_0xfa83('0x32')][_0xfa83('0x3a')]);_0x206f5c[_0xfa83('0x3b')]=qs[_0xfa83('0x33')](_['pick'](_0x2a7119[_0xfa83('0x32')],_0x4c2882[_0xfa83('0x33')]),_0x5a2e6d);if(_0x2a7119[_0xfa83('0x32')][_0xfa83('0x3c')]){_0x206f5c[_0xfa83('0x3b')]=_['merge'](_0x206f5c[_0xfa83('0x3b')],{'$or':_[_0xfa83('0x30')](_0x5a2e6d,function(_0x197f3c){if(_0x197f3c[_0xfa83('0x2d')]!=='VIRTUAL'){var _0x49fc3d={};_0x49fc3d[_0x197f3c['name']]={'$like':'%'+_0x2a7119['query'][_0xfa83('0x3c')]+'%'};return _0x49fc3d;}})});}_0x206f5c=_[_0xfa83('0x3d')]({},_0x206f5c,_0x2a7119[_0xfa83('0x3e')]);var _0x3ab0b2={'where':_0x206f5c[_0xfa83('0x3b')]};return db[_0xfa83('0x2a')]['count'](_0x3ab0b2)['then'](function(_0x31699d){_0x432509[_0xfa83('0x1b')]=_0x31699d;if(_0x2a7119[_0xfa83('0x32')][_0xfa83('0x3f')]){_0x206f5c[_0xfa83('0x40')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xfa83('0x41')](_0x206f5c);})[_0xfa83('0x22')](function(_0x144a5a){_0x432509[_0xfa83('0x42')]=_0x144a5a;return _0x432509;})[_0xfa83('0x22')](respondWithFilteredResult(_0x9641d,_0x206f5c))['catch'](handleError(_0x9641d,null));};exports[_0xfa83('0x43')]=function(_0x93025e,_0x474c84){var _0x466600={'raw':!![],'where':{'id':_0x93025e['params']['id']}},_0x56b417={};_0x56b417[_0xfa83('0x2f')]=_[_0xfa83('0x31')](db[_0xfa83('0x2a')]['rawAttributes']);_0x56b417[_0xfa83('0x32')]=_['keys'](_0x93025e['query']);_0x56b417[_0xfa83('0x33')]=_[_0xfa83('0x34')](_0x56b417[_0xfa83('0x2f')],_0x56b417[_0xfa83('0x32')]);_0x466600[_0xfa83('0x35')]=_[_0xfa83('0x34')](_0x56b417[_0xfa83('0x2f')],qs[_0xfa83('0x36')](_0x93025e[_0xfa83('0x32')][_0xfa83('0x36')]));_0x466600['attributes']=_0x466600[_0xfa83('0x35')][_0xfa83('0x37')]?_0x466600['attributes']:_0x56b417[_0xfa83('0x2f')];if(_0x93025e['query'][_0xfa83('0x3f')]){_0x466600[_0xfa83('0x40')]=[{'all':!![]}];}_0x466600=_['merge']({},_0x466600,_0x93025e[_0xfa83('0x3e')]);return db[_0xfa83('0x2a')][_0xfa83('0x44')](_0x466600)[_0xfa83('0x22')](handleEntityNotFound(_0x474c84,null))[_0xfa83('0x22')](respondWithResult(_0x474c84,null))[_0xfa83('0x45')](handleError(_0x474c84,null));};exports[_0xfa83('0x46')]=function(_0x4dfa55,_0x1389f3){return db[_0xfa83('0x2a')]['create'](_0x4dfa55['body'],{})[_0xfa83('0x22')](function(_0x5e6c38){var _0x4d97ec=_0x4dfa55['user']['get']({'plain':!![]});if(!_0x4d97ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d97ec[_0xfa83('0x47')]===_0xfa83('0x48')){var _0x3dc018=_0x5e6c38[_0xfa83('0x49')]({'plain':!![]});var _0x13af6d='OpenchannelQueues';return db[_0xfa83('0x4a')][_0xfa83('0x44')]({'where':{'name':_0x13af6d,'userProfileId':_0x4d97ec['userProfileId']},'raw':!![]})[_0xfa83('0x22')](function(_0x144e7c){if(_0x144e7c&&_0x144e7c['autoAssociation']===0x0){return db[_0xfa83('0x24')]['create']({'name':_0x3dc018[_0xfa83('0x27')],'resourceId':_0x3dc018['id'],'type':_0x144e7c[_0xfa83('0x27')],'sectionId':_0x144e7c['id']},{})[_0xfa83('0x22')](function(){return _0x5e6c38;});}else{return _0x5e6c38;}})[_0xfa83('0x45')](function(_0x539238){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x539238);throw _0x539238;});}return _0x5e6c38;})[_0xfa83('0x22')](respondWithResult(_0x1389f3,0xc9))[_0xfa83('0x45')](handleError(_0x1389f3,null));};exports[_0xfa83('0x21')]=function(_0x2abb87,_0x57539c){if(_0x2abb87['body']['id']){delete _0x2abb87[_0xfa83('0x4b')]['id'];}return db['OpenchannelQueue'][_0xfa83('0x44')]({'where':{'id':_0x2abb87[_0xfa83('0x4c')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x57539c,null))[_0xfa83('0x22')](saveUpdates(_0x2abb87[_0xfa83('0x4b')],null))[_0xfa83('0x22')](respondWithResult(_0x57539c,null))[_0xfa83('0x45')](handleError(_0x57539c,null));};exports[_0xfa83('0x23')]=function(_0x5800d3,_0x409b5f){return db['OpenchannelQueue'][_0xfa83('0x44')]({'where':{'id':_0x5800d3['params']['id']}})['then'](handleEntityNotFound(_0x409b5f,null))[_0xfa83('0x22')](removeEntity(_0x409b5f,null))[_0xfa83('0x45')](handleError(_0x409b5f,null));};exports[_0xfa83('0x4d')]=function(_0x1ab822,_0x4283a3){return db[_0xfa83('0x2a')][_0xfa83('0x4d')]()[_0xfa83('0x22')](respondWithResult(_0x4283a3,null))[_0xfa83('0x45')](handleError(_0x4283a3,null));};exports['getMembers']=function(_0x2672f0,_0x418523,_0x20416e){var _0x675e1c={'raw':!![],'where':{}},_0x5d5b22={},_0x20ef6a;return db[_0xfa83('0x2a')][_0xfa83('0x4e')]({'where':{'id':_0x2672f0[_0xfa83('0x4c')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x418523,null))[_0xfa83('0x22')](function(_0x2aa8ca){if(_0x2aa8ca){_0x20ef6a=_0x2aa8ca[_0xfa83('0x49')]({'plain':!![]});_0x5d5b22['model']=_[_0xfa83('0x31')](db[_0xfa83('0x4f')]['rawAttributes']);_0x5d5b22['query']=_['keys'](_0x2672f0[_0xfa83('0x32')]);_0x5d5b22[_0xfa83('0x33')]=_[_0xfa83('0x34')](_0x5d5b22[_0xfa83('0x2f')],_0x5d5b22[_0xfa83('0x32')]);_0x675e1c[_0xfa83('0x35')]=_[_0xfa83('0x34')](_0x5d5b22[_0xfa83('0x2f')],qs[_0xfa83('0x36')](_0x2672f0[_0xfa83('0x32')]['fields']));_0x675e1c['attributes']=_0x675e1c[_0xfa83('0x35')][_0xfa83('0x37')]?_0x675e1c['attributes']:_0x5d5b22['model'];if(!_0x2672f0[_0xfa83('0x32')]['hasOwnProperty']('nolimit')){_0x675e1c[_0xfa83('0x1c')]=qs['limit'](_0x2672f0[_0xfa83('0x32')][_0xfa83('0x1c')]);_0x675e1c[_0xfa83('0x19')]=qs[_0xfa83('0x19')](_0x2672f0[_0xfa83('0x32')][_0xfa83('0x19')]);}_0x675e1c['order']=qs['sort'](_0x2672f0[_0xfa83('0x32')][_0xfa83('0x3a')]);_0x675e1c[_0xfa83('0x3b')]=qs['filters'](_[_0xfa83('0x50')](_0x2672f0['query'],_0x5d5b22[_0xfa83('0x33')]));_0x675e1c[_0xfa83('0x3b')][_0xfa83('0x51')]=_0x2aa8ca['id'];if(_0x2672f0[_0xfa83('0x32')][_0xfa83('0x3c')]){_0x675e1c['where']=_[_0xfa83('0x3d')](_0x675e1c[_0xfa83('0x3b')],{'$or':_[_0xfa83('0x30')](_0x675e1c[_0xfa83('0x35')],function(_0xc3dedc){var _0x4dab47={};_0x4dab47[_0xc3dedc]={'$like':'%'+_0x2672f0[_0xfa83('0x32')][_0xfa83('0x3c')]+'%'};return _0x4dab47;})});}_0x675e1c=_[_0xfa83('0x3d')]({},_0x675e1c,_0x2672f0[_0xfa83('0x3e')]);return db['UserOpenchannelQueue'][_0xfa83('0x41')](_0x675e1c);}})[_0xfa83('0x22')](function(_0x5eac82){if(_0x5eac82){return db[_0xfa83('0x52')][_0xfa83('0x53')]({'where':{'id':_[_0xfa83('0x30')](_0x5eac82,_0xfa83('0x54')),'role':'agent'},'attributes':['id','name',_0xfa83('0x55'),_0xfa83('0x56'),_0xfa83('0x57')]});}})[_0xfa83('0x22')](function(_0x20f40d){if(_0x20f40d){return{'count':_0x20f40d[_0xfa83('0x1b')],'rows':_[_0xfa83('0x30')](_0x20f40d[_0xfa83('0x42')],function(_0x2720c8){return{'membername':_0x2720c8['name'],'UserId':_0x2720c8['id'],'queue_name':_0x20ef6a['name'],'OpenchannelQueueId':_0x20ef6a['id'],'interface':util[_0xfa83('0x58')](_0xfa83('0x59'),_0xfa83('0x5a'),_0x2720c8['name']),'penalty':0x0,'paused':_0x2720c8['openchannelPause'],'createdAt':_0x2720c8[_0xfa83('0x57')],'updatedAt':_0x2720c8[_0xfa83('0x56')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfa83('0x22')](respondWithFilteredResult(_0x418523,_0x675e1c))[_0xfa83('0x45')](handleError(_0x418523,null));};exports[_0xfa83('0x5b')]=function(_0x3c7aed,_0x1f6608,_0x54e185){var _0x47e22d={};var _0x3d9f15={};var _0x30c64f;var _0x3625fd;return db[_0xfa83('0x2a')][_0xfa83('0x4e')]({'where':{'id':_0x3c7aed[_0xfa83('0x4c')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x1f6608,null))[_0xfa83('0x22')](function(_0x28e252){if(_0x28e252){_0x30c64f=_0x28e252;_0x3d9f15[_0xfa83('0x2f')]=_[_0xfa83('0x31')](db[_0xfa83('0x5c')][_0xfa83('0x2b')]);_0x3d9f15[_0xfa83('0x32')]=_[_0xfa83('0x31')](_0x3c7aed[_0xfa83('0x32')]);_0x3d9f15['filters']=_[_0xfa83('0x34')](_0x3d9f15['model'],_0x3d9f15[_0xfa83('0x32')]);_0x47e22d[_0xfa83('0x35')]=_[_0xfa83('0x34')](_0x3d9f15['model'],qs['fields'](_0x3c7aed[_0xfa83('0x32')][_0xfa83('0x36')]));_0x47e22d[_0xfa83('0x35')]=_0x47e22d[_0xfa83('0x35')][_0xfa83('0x37')]?_0x47e22d[_0xfa83('0x35')]:_0x3d9f15[_0xfa83('0x2f')];_0x47e22d[_0xfa83('0x39')]=qs[_0xfa83('0x3a')](_0x3c7aed[_0xfa83('0x32')]['sort']);_0x47e22d['where']=qs[_0xfa83('0x33')](_[_0xfa83('0x50')](_0x3c7aed[_0xfa83('0x32')],_0x3d9f15[_0xfa83('0x33')]));if(_0x3c7aed['query'][_0xfa83('0x3c')]){_0x47e22d[_0xfa83('0x3b')]=_[_0xfa83('0x3d')](_0x47e22d[_0xfa83('0x3b')],{'$or':_[_0xfa83('0x30')](_0x47e22d[_0xfa83('0x35')],function(_0x3c845f){var _0x1b7624={};_0x1b7624[_0x3c845f]={'$like':'%'+_0x3c7aed[_0xfa83('0x32')][_0xfa83('0x3c')]+'%'};return _0x1b7624;})});}_0x47e22d=_[_0xfa83('0x3d')]({},_0x47e22d,_0x3c7aed[_0xfa83('0x3e')]);return _0x30c64f['getTeams'](_0x47e22d);}})[_0xfa83('0x22')](function(_0x42b91c){if(_0x42b91c){_0x3625fd=_0x42b91c[_0xfa83('0x37')];if(!_0x3c7aed[_0xfa83('0x32')][_0xfa83('0x38')]('nolimit')){_0x47e22d[_0xfa83('0x1c')]=qs[_0xfa83('0x1c')](_0x3c7aed['query'][_0xfa83('0x1c')]);_0x47e22d['offset']=qs[_0xfa83('0x19')](_0x3c7aed[_0xfa83('0x32')][_0xfa83('0x19')]);}return _0x30c64f[_0xfa83('0x5b')](_0x47e22d);}})[_0xfa83('0x22')](function(_0x4bc214){if(_0x4bc214){return _0x4bc214?{'count':_0x3625fd,'rows':_0x4bc214}:null;}})['then'](respondWithResult(_0x1f6608,null))[_0xfa83('0x45')](handleError(_0x1f6608,null));};exports['addTeams']=function(_0x351771,_0x22c82f,_0x216b87){var _0x5beab1=_0x351771[_0xfa83('0x4b')][_0xfa83('0x5d')];return db[_0xfa83('0x5c')][_0xfa83('0x41')]({'where':{'id':_0x5beab1},'attributes':['id'],'include':[{'model':db[_0xfa83('0x52')],'as':'Agents','attributes':['id',_0xfa83('0x27'),_0xfa83('0x5e'),'voicePause',_0xfa83('0x5f')],'raw':!![]}]})[_0xfa83('0x22')](function(_0x5a8522){if(_0x5a8522){var _0x1fe128=_[_0xfa83('0x60')](_0x5a8522,function(_0x3282ce){var _0x217921=_0x3282ce['get']({'plain':!![]});return _0x217921[_0xfa83('0x61')];});return db[_0xfa83('0x2a')]['find']({'where':{'id':_0x351771[_0xfa83('0x4c')]['id']}})['then'](function(_0xa380af){return db[_0xfa83('0x62')][_0xfa83('0x63')](function(_0x158c9a){return _0xa380af[_0xfa83('0x64')](_0x5beab1,{'transaction':_0x158c9a})[_0xfa83('0x22')](function(){return BPromise[_0xfa83('0x65')](_0x1fe128,function(_0x21cc02){return db[_0xfa83('0x4f')][_0xfa83('0x66')]({'where':{'UserId':_0x21cc02['id'],'OpenchannelQueueId':_0x351771[_0xfa83('0x4c')]['id']},'transaction':_0x158c9a});});})['then'](function(){_0x1fe128[_0xfa83('0x67')](function(_0x4950ff){socket['emit'](_0xfa83('0x68'),{'UserId':_0x4950ff['id'],'OpenchannelQueueId':_0xa380af['id']});});});});});}})[_0xfa83('0x22')](respondWithStatusCode(_0x22c82f,null))[_0xfa83('0x45')](handleError(_0x22c82f,null));};exports[_0xfa83('0x69')]=function(_0xecc498,_0x45423c,_0x147083){return db[_0xfa83('0x5c')][_0xfa83('0x41')]({'where':{'id':_0xecc498[_0xfa83('0x32')][_0xfa83('0x5d')]},'attributes':['id'],'include':[{'model':db[_0xfa83('0x52')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfa83('0x22')](handleEntityNotFound(_0x45423c,null))[_0xfa83('0x22')](function(_0x5143fe){var _0x551506=_[_0xfa83('0x30')](_0x5143fe,'id');var _0x28bc68=[];var _0x6169c2=[];var _0x1b1a98=squel[_0xfa83('0x6a')]();_0x1b1a98[_0xfa83('0x6b')](_0xfa83('0x6c'))['from'](_0xfa83('0x6d'),'tq')[_0xfa83('0x6e')](_0xfa83('0x6f'),'ut',_0xfa83('0x70'))[_0xfa83('0x3b')](_0xfa83('0x71'),_0xecc498[_0xfa83('0x4c')]['id']);for(var _0x308e96=0x0;_0x308e96<_0x5143fe[_0xfa83('0x37')];_0x308e96+=0x1){let _0x116a58=_0x5143fe[_0x308e96];for(var _0x5758eb=0x0;_0x5758eb<_0x116a58[_0xfa83('0x61')][_0xfa83('0x37')];_0x5758eb+=0x1){let _0x25dfa1=_0x116a58[_0xfa83('0x61')][_0x5758eb];var _0x2edc35=_0x1b1a98['clone']();_0x2edc35[_0xfa83('0x3b')](_0xfa83('0x72'),_0x25dfa1['id']);_0x6169c2['push'](db[_0xfa83('0x62')][_0xfa83('0x32')](_0x2edc35[_0xfa83('0x73')](),{'type':db[_0xfa83('0x62')][_0xfa83('0x74')][_0xfa83('0x75')]})[_0xfa83('0x22')](function(_0x23b1e3){if(_0x23b1e3['length']===0x1){return _0x25dfa1['id'];}else{var _0x6ea4ce=_[_0xfa83('0x76')](_[_0xfa83('0x30')](_0x23b1e3,_0xfa83('0x77')),function(_0x3b76be){return _[_0xfa83('0x78')](_0x551506,_0x3b76be);});if(_0x6ea4ce){return _0x25dfa1['id'];}}}));}}return BPromise[_0xfa83('0x79')](_0x6169c2)[_0xfa83('0x22')](function(_0x286976){_0x28bc68=_(_0x28bc68)[_0xfa83('0x7a')](_0x286976)['compact']()[_0xfa83('0x7b')]();return db[_0xfa83('0x2a')]['find']({'where':{'id':_0xecc498[_0xfa83('0x4c')]['id']}})[_0xfa83('0x22')](function(_0x49d1f3){return db['sequelize'][_0xfa83('0x63')](function(_0x59981e){return _0x49d1f3[_0xfa83('0x69')](_0xecc498[_0xfa83('0x32')]['ids'],{'transaction':_0x59981e})[_0xfa83('0x22')](function(){if(!_[_0xfa83('0x7c')](_0x28bc68)){return _0x49d1f3[_0xfa83('0x7d')](_0x28bc68,{'transaction':_0x59981e});}})[_0xfa83('0x22')](function(){_0x28bc68['forEach'](function(_0x9acc81){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x9acc81,'OpenchannelQueueId':_0x49d1f3['id']});});});});});});})['then'](respondWithStatusCode(_0x45423c,null))[_0xfa83('0x45')](handleError(_0x45423c,null));};exports[_0xfa83('0x7e')]=function(_0x35b83b,_0x4eeb29,_0x1bb04f){return db[_0xfa83('0x2a')][_0xfa83('0x44')]({'where':{'id':_0x35b83b[_0xfa83('0x4c')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x4eeb29,null))[_0xfa83('0x22')](function(_0x31cfe8){if(_0x31cfe8){return _0x31cfe8[_0xfa83('0x7e')](_0x35b83b[_0xfa83('0x4b')][_0xfa83('0x5d')],_['omit'](_0x35b83b[_0xfa83('0x4b')],[_0xfa83('0x5d'),'id'])||{})[_0xfa83('0x7f')](function(_0x47b8e3){for(var _0x18b719=0x0;_0x18b719<_0x35b83b['body'][_0xfa83('0x5d')][_0xfa83('0x37')];_0x18b719+=0x1){socket[_0xfa83('0x80')]('userOpenchannelQueue:save',{'UserId':Number(_0x35b83b[_0xfa83('0x4b')][_0xfa83('0x5d')][_0x18b719]),'OpenchannelQueueId':Number(_0x35b83b[_0xfa83('0x4c')]['id'])});}return _0x47b8e3;});}})[_0xfa83('0x22')](respondWithResult(_0x4eeb29,null))[_0xfa83('0x45')](handleError(_0x4eeb29,null));};exports[_0xfa83('0x7d')]=function(_0x1c5e2f,_0x3031e1,_0xa479d9){return db[_0xfa83('0x2a')][_0xfa83('0x44')]({'where':{'id':_0x1c5e2f[_0xfa83('0x4c')]['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0x3031e1,null))[_0xfa83('0x22')](function(_0x5e13bd){if(_0x5e13bd){return _0x5e13bd['removeAgents'](_0x1c5e2f[_0xfa83('0x32')][_0xfa83('0x5d')])[_0xfa83('0x22')](function(){if(_[_0xfa83('0x81')](_0x1c5e2f[_0xfa83('0x32')]['ids'])){for(var _0x4d4413=0x0;_0x4d4413<_0x1c5e2f[_0xfa83('0x32')][_0xfa83('0x5d')]['length'];_0x4d4413+=0x1){socket['emit'](_0xfa83('0x82'),{'UserId':Number(_0x1c5e2f[_0xfa83('0x32')]['ids'][_0x4d4413]),'OpenchannelQueueId':Number(_0x1c5e2f[_0xfa83('0x4c')]['id'])});}}else{socket[_0xfa83('0x80')](_0xfa83('0x82'),{'UserId':Number(_0x1c5e2f[_0xfa83('0x32')][_0xfa83('0x5d')]),'OpenchannelQueueId':Number(_0x1c5e2f[_0xfa83('0x4c')]['id'])});}});}})[_0xfa83('0x22')](respondWithStatusCode(_0x3031e1,null))[_0xfa83('0x45')](handleError(_0x3031e1,null));};exports[_0xfa83('0x83')]=function(_0x379128,_0xc89db0,_0x2e77e3){var _0x5bb4d1={};var _0x5207f8={};var _0x674e34;var _0x104033;return db['OpenchannelQueue'][_0xfa83('0x4e')]({'where':{'id':_0x379128['params']['id']}})[_0xfa83('0x22')](handleEntityNotFound(_0xc89db0,null))[_0xfa83('0x22')](function(_0x360a5c){if(_0x360a5c){_0x674e34=_0x360a5c;_0x5207f8['model']=_['keys'](db[_0xfa83('0x52')][_0xfa83('0x2b')]);_0x5207f8[_0xfa83('0x32')]=_[_0xfa83('0x31')](_0x379128['query']);_0x5207f8[_0xfa83('0x33')]=_[_0xfa83('0x34')](_0x5207f8[_0xfa83('0x2f')],_0x5207f8['query']);_0x5bb4d1[_0xfa83('0x35')]=_[_0xfa83('0x34')](_0x5207f8['model'],qs[_0xfa83('0x36')](_0x379128[_0xfa83('0x32')]['fields']));_0x5bb4d1[_0xfa83('0x35')]=_0x5bb4d1[_0xfa83('0x35')]['length']?_0x5bb4d1[_0xfa83('0x35')]:_0x5207f8[_0xfa83('0x2f')];_0x5bb4d1['order']=qs[_0xfa83('0x3a')](_0x379128[_0xfa83('0x32')]['sort']);_0x5bb4d1[_0xfa83('0x3b')]=qs[_0xfa83('0x33')](_[_0xfa83('0x50')](_0x379128[_0xfa83('0x32')],_0x5207f8[_0xfa83('0x33')]));if(_0x379128[_0xfa83('0x32')][_0xfa83('0x3c')]){_0x5bb4d1['where']=_[_0xfa83('0x3d')](_0x5bb4d1[_0xfa83('0x3b')],{'$or':_[_0xfa83('0x30')](_0x5bb4d1[_0xfa83('0x35')],function(_0x271131){var _0x1beb1c={};_0x1beb1c[_0x271131]={'$like':'%'+_0x379128['query']['filter']+'%'};return _0x1beb1c;})});}_0x5bb4d1=_[_0xfa83('0x3d')]({},_0x5bb4d1,_0x379128[_0xfa83('0x3e')]);return _0x674e34['getAgents'](_0x5bb4d1);}})[_0xfa83('0x22')](function(_0x264496){if(_0x264496){_0x104033=_0x264496[_0xfa83('0x37')];if(!_0x379128[_0xfa83('0x32')][_0xfa83('0x38')](_0xfa83('0x84'))){_0x5bb4d1[_0xfa83('0x1c')]=qs['limit'](_0x379128[_0xfa83('0x32')][_0xfa83('0x1c')]);_0x5bb4d1[_0xfa83('0x19')]=qs['offset'](_0x379128[_0xfa83('0x32')][_0xfa83('0x19')]);}return _0x674e34[_0xfa83('0x83')](_0x5bb4d1);}})[_0xfa83('0x22')](function(_0x1db90f){if(_0x1db90f){return _0x1db90f?{'count':_0x104033,'rows':_0x1db90f}:null;}})['then'](respondWithResult(_0xc89db0,null))[_0xfa83('0x45')](handleError(_0xc89db0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 64324d5..103e889 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 _0xcba0=['OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x4abd4f,_0x23ce2c){var _0x2001ec=function(_0x3d6368){while(--_0x3d6368){_0x4abd4f['push'](_0x4abd4f['shift']());}};_0x2001ec(++_0x23ce2c);}(_0xcba0,0x177));var _0x0cba=function(_0x327494,_0x2bc54a){_0x327494=_0x327494-0x0;var _0x23ce4d=_0xcba0[_0x327494];return _0x23ce4d;};'use strict';var EventEmitter=require(_0x0cba('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x0cba('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0cba('0x2')](0x0);var events={'afterCreate':_0x0cba('0x3'),'afterUpdate':'update','afterDestroy':_0x0cba('0x4')};function emitEvent(_0x1350d7){return function(_0x53cd82,_0x247439,_0xdf270e){OpenchannelQueueEvents['emit'](_0x1350d7+':'+_0x53cd82['id'],_0x53cd82);OpenchannelQueueEvents[_0x0cba('0x5')](_0x1350d7,_0x53cd82);_0xdf270e(null);};}for(var e in events){if(events[_0x0cba('0x6')](e)){var event=events[e];OpenchannelQueue[_0x0cba('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xc6d2=['remove','emit','hook','events','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x5be962,_0x4d5331){var _0x4641b8=function(_0x1c8425){while(--_0x1c8425){_0x5be962['push'](_0x5be962['shift']());}};_0x4641b8(++_0x4d5331);}(_0xc6d2,0x17b));var _0x2c6d=function(_0x4dbf04,_0x58a20){_0x4dbf04=_0x4dbf04-0x0;var _0x4e878d=_0xc6d2[_0x4dbf04];return _0x4e878d;};'use strict';var EventEmitter=require(_0x2c6d('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x2c6d('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2c6d('0x2')](0x0);var events={'afterCreate':_0x2c6d('0x3'),'afterUpdate':_0x2c6d('0x4'),'afterDestroy':_0x2c6d('0x5')};function emitEvent(_0x1f9c3b){return function(_0x2773ca,_0x5543f7,_0x320ac2){OpenchannelQueueEvents[_0x2c6d('0x6')](_0x1f9c3b+':'+_0x2773ca['id'],_0x2773ca);OpenchannelQueueEvents[_0x2c6d('0x6')](_0x1f9c3b,_0x2773ca);_0x320ac2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x2c6d('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index d0e3f3f..c61151e 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 _0xb448=['OpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','path','./openchannelQueue.attributes','exports'];(function(_0x36126e,_0x5b66ae){var _0x5d6426=function(_0x11de3e){while(--_0x11de3e){_0x36126e['push'](_0x36126e['shift']());}};_0x5d6426(++_0x5b66ae);}(_0xb448,0x105));var _0x8b44=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb448[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x8b44('0x0'));var util=require(_0x8b44('0x1'));var logger=require(_0x8b44('0x2'))(_0x8b44('0x3'));var moment=require(_0x8b44('0x4'));var BPromise=require(_0x8b44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b44('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8b44('0x7'));module[_0x8b44('0x8')]=function(_0x443de3,_0x393dec){return _0x443de3['define'](_0x8b44('0x9'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d03=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x2cb893,_0x3a6b2c){var _0x2474a9=function(_0x508ba0){while(--_0x508ba0){_0x2cb893['push'](_0x2cb893['shift']());}};_0x2474a9(++_0x3a6b2c);}(_0x8d03,0xed));var _0x38d0=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8d03[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x38d0('0x0'));var util=require('util');var logger=require(_0x38d0('0x1'))(_0x38d0('0x2'));var moment=require(_0x38d0('0x3'));var BPromise=require(_0x38d0('0x4'));var rp=require(_0x38d0('0x5'));var fs=require('fs');var path=require(_0x38d0('0x6'));var rimraf=require(_0x38d0('0x7'));var config=require(_0x38d0('0x8'));var attributes=require(_0x38d0('0x9'));module[_0x38d0('0xa')]=function(_0x1c6141,_0x3a1c0e){return _0x1c6141[_0x38d0('0xb')](_0x38d0('0xc'),attributes,{'tableName':_0x38d0('0xd'),'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 573fee3..6bed086 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 _0xddc7=['options','where','attributes','limit','model','include','map','then','stringify','ShowOpenchannelQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','request\x20sent','debug','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue'];(function(_0x5e52ea,_0x469055){var _0x4ddd39=function(_0x53c68b){while(--_0x53c68b){_0x5e52ea['push'](_0x5e52ea['shift']());}};_0x4ddd39(++_0x469055);}(_0xddc7,0x124));var _0x7ddc=function(_0x586319,_0xf3ac9a){_0x586319=_0x586319-0x0;var _0x2127d2=_0xddc7[_0x586319];return _0x2127d2;};'use strict';var _=require(_0x7ddc('0x0'));var util=require(_0x7ddc('0x1'));var moment=require(_0x7ddc('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ddc('0x3'));var fs=require('fs');var Redis=require(_0x7ddc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ddc('0x5'));var logger=require(_0x7ddc('0x6'))(_0x7ddc('0x7'));var config=require('../../config/environment');var jayson=require(_0x7ddc('0x8'));var client=jayson[_0x7ddc('0x9')][_0x7ddc('0xa')]({'port':0x232a});config['redis']=_[_0x7ddc('0xb')](config[_0x7ddc('0xc')],{'host':_0x7ddc('0xd'),'port':0x18eb});var socket=require(_0x7ddc('0xe'))(new Redis(config[_0x7ddc('0xc')]));require(_0x7ddc('0xf'))[_0x7ddc('0x10')](socket);function respondWithRpcPromise(_0x368b39,_0x351c7d,_0x2e5566){return new BPromise(function(_0x1ee3c7,_0x50997e){return client[_0x7ddc('0x11')](_0x368b39,_0x2e5566)['then'](function(_0x17a58f){logger[_0x7ddc('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x351c7d,_0x7ddc('0x13'));logger[_0x7ddc('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x351c7d,'request\x20sent',JSON['stringify'](_0x17a58f));if(_0x17a58f[_0x7ddc('0x15')]){if(_0x17a58f[_0x7ddc('0x15')]['code']===0x1f4){logger[_0x7ddc('0x15')](_0x7ddc('0x16'),_0x351c7d,_0x17a58f[_0x7ddc('0x15')][_0x7ddc('0x17')]);return _0x50997e(_0x17a58f['error'][_0x7ddc('0x17')]);}logger[_0x7ddc('0x15')](_0x7ddc('0x16'),_0x351c7d,_0x17a58f['error'][_0x7ddc('0x17')]);return _0x1ee3c7(_0x17a58f['error'][_0x7ddc('0x17')]);}else{logger[_0x7ddc('0x12')](_0x7ddc('0x16'),_0x351c7d,'request\x20sent');_0x1ee3c7(_0x17a58f[_0x7ddc('0x18')][_0x7ddc('0x17')]);}})[_0x7ddc('0x19')](function(_0x381bb3){logger[_0x7ddc('0x15')](_0x7ddc('0x16'),_0x351c7d,_0x381bb3);_0x50997e(_0x381bb3);});});}exports[_0x7ddc('0x1a')]=function(_0x862cca){var _0x2a5736=this;return new Promise(function(_0x79cc19,_0x1cf8d4){return db[_0x7ddc('0x1b')]['findAll']({'raw':_0x862cca[_0x7ddc('0x1c')]?_0x862cca[_0x7ddc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x862cca[_0x7ddc('0x1c')]?_0x862cca[_0x7ddc('0x1c')][_0x7ddc('0x1d')]||null:null,'attributes':_0x862cca[_0x7ddc('0x1c')]?_0x862cca[_0x7ddc('0x1c')][_0x7ddc('0x1e')]||null:null,'limit':_0x862cca[_0x7ddc('0x1c')]?_0x862cca[_0x7ddc('0x1c')][_0x7ddc('0x1f')]||null:null,'include':_0x862cca[_0x7ddc('0x1c')]?_0x862cca[_0x7ddc('0x1c')]['include']?_['map'](_0x862cca[_0x7ddc('0x1c')]['include'],function(_0x4e8d42){return{'model':db[_0x4e8d42[_0x7ddc('0x20')]],'as':_0x4e8d42['as'],'attributes':_0x4e8d42[_0x7ddc('0x1e')],'include':_0x4e8d42[_0x7ddc('0x21')]?_[_0x7ddc('0x22')](_0x4e8d42[_0x7ddc('0x21')],function(_0x1d60f9){return{'model':db[_0x1d60f9[_0x7ddc('0x20')]],'as':_0x1d60f9['as'],'attributes':_0x1d60f9['attributes'],'include':_0x1d60f9[_0x7ddc('0x21')]?_[_0x7ddc('0x22')](_0x1d60f9[_0x7ddc('0x21')],function(_0x25abf6){return{'model':db[_0x25abf6[_0x7ddc('0x20')]],'as':_0x25abf6['as'],'attributes':_0x25abf6['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ddc('0x23')](function(_0x3a91e0){logger[_0x7ddc('0x12')](_0x7ddc('0x1a'),_0x862cca);logger['debug'](_0x7ddc('0x1a'),_0x862cca,JSON[_0x7ddc('0x24')](_0x3a91e0));_0x79cc19(_0x3a91e0);})[_0x7ddc('0x19')](function(_0x24b52a){logger[_0x7ddc('0x15')](_0x7ddc('0x1a'),_0x24b52a[_0x7ddc('0x17')],_0x862cca);_0x1cf8d4(_0x2a5736[_0x7ddc('0x15')](0x1f4,_0x24b52a[_0x7ddc('0x17')]));});});};exports[_0x7ddc('0x25')]=function(_0x4dd4b2){var _0x42fc0c=this;return new Promise(function(_0xf63ec8,_0x23d3b3){return db[_0x7ddc('0x1b')][_0x7ddc('0x26')]({'raw':_0x4dd4b2[_0x7ddc('0x1c')]?_0x4dd4b2[_0x7ddc('0x1c')][_0x7ddc('0x27')]===undefined?!![]:![]:!![],'where':_0x4dd4b2['options']?_0x4dd4b2[_0x7ddc('0x1c')][_0x7ddc('0x1d')]||null:null,'attributes':_0x4dd4b2['options']?_0x4dd4b2[_0x7ddc('0x1c')][_0x7ddc('0x1e')]||null:null,'include':_0x4dd4b2[_0x7ddc('0x1c')]?_0x4dd4b2[_0x7ddc('0x1c')][_0x7ddc('0x21')]?_[_0x7ddc('0x22')](_0x4dd4b2[_0x7ddc('0x1c')][_0x7ddc('0x21')],function(_0x47b7c6){return{'model':db[_0x47b7c6['model']],'as':_0x47b7c6['as'],'attributes':_0x47b7c6['attributes'],'include':_0x47b7c6['include']?_[_0x7ddc('0x22')](_0x47b7c6[_0x7ddc('0x21')],function(_0x5741e0){return{'model':db[_0x5741e0['model']],'as':_0x5741e0['as'],'attributes':_0x5741e0[_0x7ddc('0x1e')],'include':_0x5741e0[_0x7ddc('0x21')]?_[_0x7ddc('0x22')](_0x5741e0[_0x7ddc('0x21')],function(_0x2d030e){return{'model':db[_0x2d030e[_0x7ddc('0x20')]],'as':_0x2d030e['as'],'attributes':_0x2d030e[_0x7ddc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7ddc('0x23')](function(_0x44b4f8){logger['info'](_0x7ddc('0x25'),_0x4dd4b2);logger[_0x7ddc('0x14')](_0x7ddc('0x25'),_0x4dd4b2,JSON[_0x7ddc('0x24')](_0x44b4f8));_0xf63ec8(_0x44b4f8);})['catch'](function(_0x3e9122){logger['error'](_0x7ddc('0x25'),_0x3e9122[_0x7ddc('0x17')],_0x4dd4b2);_0x23d3b3(_0x42fc0c['error'](0x1f4,_0x3e9122['message']));});});}; \ No newline at end of file +var _0x62f0=['./openchannelQueue.socket','then','info','request\x20sent','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','GetOpenchannelQueue','OpenchannelQueue','options','where','attributes','limit','include','map','model','debug','ShowOpenchannelQueue','find','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0x34a077,_0x253591){var _0x3b70b8=function(_0x42db5a){while(--_0x42db5a){_0x34a077['push'](_0x34a077['shift']());}};_0x3b70b8(++_0x253591);}(_0x62f0,0x1ba));var _0x062f=function(_0x5e34a4,_0x2e63ed){_0x5e34a4=_0x5e34a4-0x0;var _0x8d41d7=_0x62f0[_0x5e34a4];return _0x8d41d7;};'use strict';var _=require('lodash');var util=require(_0x062f('0x0'));var moment=require(_0x062f('0x1'));var BPromise=require('bluebird');var rs=require(_0x062f('0x2'));var fs=require('fs');var Redis=require(_0x062f('0x3'));var db=require(_0x062f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x062f('0x5'))(_0x062f('0x6'));var config=require(_0x062f('0x7'));var jayson=require(_0x062f('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x062f('0x9')]=_[_0x062f('0xa')](config[_0x062f('0x9')],{'host':_0x062f('0xb'),'port':0x18eb});var socket=require(_0x062f('0xc'))(new Redis(config[_0x062f('0x9')]));require(_0x062f('0xd'))['register'](socket);function respondWithRpcPromise(_0x12237c,_0x13be30,_0x7b3ac6){return new BPromise(function(_0x23a5dd,_0xbdc36a){return client['request'](_0x12237c,_0x7b3ac6)[_0x062f('0xe')](function(_0x25b00b){logger[_0x062f('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x13be30,_0x062f('0x10'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x13be30,'request\x20sent',JSON['stringify'](_0x25b00b));if(_0x25b00b[_0x062f('0x11')]){if(_0x25b00b[_0x062f('0x11')][_0x062f('0x12')]===0x1f4){logger['error'](_0x062f('0x13'),_0x13be30,_0x25b00b[_0x062f('0x11')]['message']);return _0xbdc36a(_0x25b00b[_0x062f('0x11')]['message']);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x13be30,_0x25b00b['error'][_0x062f('0x14')]);return _0x23a5dd(_0x25b00b[_0x062f('0x11')][_0x062f('0x14')]);}else{logger[_0x062f('0xf')](_0x062f('0x13'),_0x13be30,_0x062f('0x10'));_0x23a5dd(_0x25b00b['result'][_0x062f('0x14')]);}})[_0x062f('0x15')](function(_0x48714d){logger[_0x062f('0x11')](_0x062f('0x13'),_0x13be30,_0x48714d);_0xbdc36a(_0x48714d);});});}exports[_0x062f('0x16')]=function(_0x5405cf){var _0x838e8d=this;return new Promise(function(_0x151784,_0x19f278){return db[_0x062f('0x17')]['findAll']({'raw':_0x5405cf['options']?_0x5405cf[_0x062f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5405cf[_0x062f('0x18')]?_0x5405cf[_0x062f('0x18')][_0x062f('0x19')]||null:null,'attributes':_0x5405cf[_0x062f('0x18')]?_0x5405cf[_0x062f('0x18')][_0x062f('0x1a')]||null:null,'limit':_0x5405cf[_0x062f('0x18')]?_0x5405cf[_0x062f('0x18')][_0x062f('0x1b')]||null:null,'include':_0x5405cf[_0x062f('0x18')]?_0x5405cf[_0x062f('0x18')][_0x062f('0x1c')]?_[_0x062f('0x1d')](_0x5405cf['options'][_0x062f('0x1c')],function(_0xf37fea){return{'model':db[_0xf37fea[_0x062f('0x1e')]],'as':_0xf37fea['as'],'attributes':_0xf37fea[_0x062f('0x1a')],'include':_0xf37fea['include']?_[_0x062f('0x1d')](_0xf37fea[_0x062f('0x1c')],function(_0x37824c){return{'model':db[_0x37824c[_0x062f('0x1e')]],'as':_0x37824c['as'],'attributes':_0x37824c[_0x062f('0x1a')],'include':_0x37824c['include']?_[_0x062f('0x1d')](_0x37824c[_0x062f('0x1c')],function(_0x57caa5){return{'model':db[_0x57caa5[_0x062f('0x1e')]],'as':_0x57caa5['as'],'attributes':_0x57caa5[_0x062f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x062f('0xe')](function(_0x8cc103){logger[_0x062f('0xf')](_0x062f('0x16'),_0x5405cf);logger[_0x062f('0x1f')]('GetOpenchannelQueue',_0x5405cf,JSON['stringify'](_0x8cc103));_0x151784(_0x8cc103);})[_0x062f('0x15')](function(_0x3af8e2){logger['error'](_0x062f('0x16'),_0x3af8e2[_0x062f('0x14')],_0x5405cf);_0x19f278(_0x838e8d['error'](0x1f4,_0x3af8e2[_0x062f('0x14')]));});});};exports[_0x062f('0x20')]=function(_0xc368c1){var _0x2f9b1e=this;return new Promise(function(_0x1342ae,_0x217179){return db[_0x062f('0x17')][_0x062f('0x21')]({'raw':_0xc368c1['options']?_0xc368c1[_0x062f('0x18')][_0x062f('0x22')]===undefined?!![]:![]:!![],'where':_0xc368c1[_0x062f('0x18')]?_0xc368c1[_0x062f('0x18')][_0x062f('0x19')]||null:null,'attributes':_0xc368c1['options']?_0xc368c1[_0x062f('0x18')][_0x062f('0x1a')]||null:null,'include':_0xc368c1[_0x062f('0x18')]?_0xc368c1[_0x062f('0x18')][_0x062f('0x1c')]?_[_0x062f('0x1d')](_0xc368c1[_0x062f('0x18')][_0x062f('0x1c')],function(_0x226329){return{'model':db[_0x226329[_0x062f('0x1e')]],'as':_0x226329['as'],'attributes':_0x226329[_0x062f('0x1a')],'include':_0x226329[_0x062f('0x1c')]?_['map'](_0x226329[_0x062f('0x1c')],function(_0x3196e8){return{'model':db[_0x3196e8[_0x062f('0x1e')]],'as':_0x3196e8['as'],'attributes':_0x3196e8[_0x062f('0x1a')],'include':_0x3196e8['include']?_[_0x062f('0x1d')](_0x3196e8[_0x062f('0x1c')],function(_0x3ad0b2){return{'model':db[_0x3ad0b2[_0x062f('0x1e')]],'as':_0x3ad0b2['as'],'attributes':_0x3ad0b2[_0x062f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dcc99){logger['info'](_0x062f('0x20'),_0xc368c1);logger[_0x062f('0x1f')]('ShowOpenchannelQueue',_0xc368c1,JSON['stringify'](_0x4dcc99));_0x1342ae(_0x4dcc99);})[_0x062f('0x15')](function(_0xa64839){logger[_0x062f('0x11')](_0x062f('0x20'),_0xa64839[_0x062f('0x14')],_0xc368c1);_0x217179(_0x2f9b1e[_0x062f('0x11')](0x1f4,_0xa64839[_0x062f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 81c0e34..720083f 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 _0x9d31=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','update'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x9d31,0x14d));var _0x19d3=function(_0x3227a6,_0x4b3c0c){_0x3227a6=_0x3227a6-0x0;var _0x165d7c=_0x9d31[_0x3227a6];return _0x165d7c;};'use strict';var OpenchannelQueueEvents=require(_0x19d3('0x0'));var events=[_0x19d3('0x1'),'remove',_0x19d3('0x2')];function createListener(_0x985648,_0x10ccc5){return function(_0x143846){_0x10ccc5['emit'](_0x985648,_0x143846);};}function removeListener(_0x42a1a9,_0x2b365b){return function(){OpenchannelQueueEvents[_0x19d3('0x3')](_0x42a1a9,_0x2b365b);};}exports[_0x19d3('0x4')]=function(_0x2f0235){for(var _0x30bc02=0x0,_0x1327ab=events[_0x19d3('0x5')];_0x30bc02<_0x1327ab;_0x30bc02++){var _0x4cf26c=events[_0x30bc02];var _0x50c036=createListener(_0x19d3('0x6')+_0x4cf26c,_0x2f0235);OpenchannelQueueEvents['on'](_0x4cf26c,_0x50c036);}}; \ No newline at end of file +var _0x4df5=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x3aa12b,_0x1cea89){var _0x1acb6f=function(_0x9dce11){while(--_0x9dce11){_0x3aa12b['push'](_0x3aa12b['shift']());}};_0x1acb6f(++_0x1cea89);}(_0x4df5,0x17a));var _0x54df=function(_0x305df4,_0x1e8a53){_0x305df4=_0x305df4-0x0;var _0x135f1b=_0x4df5[_0x305df4];return _0x135f1b;};'use strict';var OpenchannelQueueEvents=require(_0x54df('0x0'));var events=[_0x54df('0x1'),_0x54df('0x2'),_0x54df('0x3')];function createListener(_0x272db0,_0x259a07){return function(_0x57cd38){_0x259a07[_0x54df('0x4')](_0x272db0,_0x57cd38);};}function removeListener(_0x248fc4,_0xe519cc){return function(){OpenchannelQueueEvents[_0x54df('0x5')](_0x248fc4,_0xe519cc);};}exports['register']=function(_0x496a6d){for(var _0x308a51=0x0,_0x3ba856=events[_0x54df('0x6')];_0x308a51<_0x3ba856;_0x308a51++){var _0x540df3=events[_0x308a51];var _0x12cac2=createListener(_0x54df('0x7')+_0x540df3,_0x496a6d);OpenchannelQueueEvents['on'](_0x540df3,_0x12cac2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ebc640b..b562f5d 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 _0xbaec=['show','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','get','index','isAuthenticated','/:id'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbaec,0xf0));var _0xcbae=function(_0x3d61fe,_0x3d2c36){_0x3d61fe=_0x3d61fe-0x0;var _0x457e37=_0xbaec[_0x3d61fe];return _0x457e37;};'use strict';var multer=require(_0xcbae('0x0'));var util=require(_0xcbae('0x1'));var path=require(_0xcbae('0x2'));var timeout=require(_0xcbae('0x3'));var express=require('express');var router=express[_0xcbae('0x4')]();var fs_extra=require(_0xcbae('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcbae('0x6'));var config=require('../../config/environment');var controller=require(_0xcbae('0x7'));router[_0xcbae('0x8')]('/',auth['isAuthenticated'](),controller[_0xcbae('0x9')]);router[_0xcbae('0x8')]('/describe',auth[_0xcbae('0xa')](),controller['describe']);router[_0xcbae('0x8')](_0xcbae('0xb'),auth[_0xcbae('0xa')](),controller[_0xcbae('0xc')]);router['post']('/',auth[_0xcbae('0xa')](),controller[_0xcbae('0xd')]);router[_0xcbae('0xe')]('/:id',auth[_0xcbae('0xa')](),controller[_0xcbae('0xf')]);router['delete']('/:id',auth[_0xcbae('0xa')](),controller[_0xcbae('0x10')]);module[_0xcbae('0x11')]=router; \ No newline at end of file +var _0x1ffc=['/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index','get'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x1ffc,0xfd));var _0xc1ff=function(_0x12678e,_0x5772b0){_0x12678e=_0x12678e-0x0;var _0x5183cc=_0x1ffc[_0x12678e];return _0x5183cc;};'use strict';var multer=require('multer');var util=require(_0xc1ff('0x0'));var path=require(_0xc1ff('0x1'));var timeout=require(_0xc1ff('0x2'));var express=require('express');var router=express[_0xc1ff('0x3')]();var fs_extra=require(_0xc1ff('0x4'));var auth=require(_0xc1ff('0x5'));var interaction=require(_0xc1ff('0x6'));var config=require(_0xc1ff('0x7'));var controller=require(_0xc1ff('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc1ff('0x9')]);router[_0xc1ff('0xa')](_0xc1ff('0xb'),auth[_0xc1ff('0xc')](),controller[_0xc1ff('0xd')]);router[_0xc1ff('0xa')](_0xc1ff('0xe'),auth[_0xc1ff('0xc')](),controller[_0xc1ff('0xf')]);router[_0xc1ff('0x10')]('/',auth['isAuthenticated'](),controller[_0xc1ff('0x11')]);router[_0xc1ff('0x12')](_0xc1ff('0xe'),auth[_0xc1ff('0xc')](),controller['update']);router[_0xc1ff('0x13')](_0xc1ff('0xe'),auth['isAuthenticated'](),controller[_0xc1ff('0x14')]);module[_0xc1ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index af8a3d7..23b06bd 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 _0xa87e=['moment','sequelize','exports','STRING','DATE'];(function(_0xa0d7ba,_0x303316){var _0x58fa94=function(_0x35d056){while(--_0x35d056){_0xa0d7ba['push'](_0xa0d7ba['shift']());}};_0x58fa94(++_0x303316);}(_0xa87e,0x1c2));var _0xea87=function(_0x4bb384,_0x4296d2){_0x4bb384=_0x4bb384-0x0;var _0x177e04=_0xa87e[_0x4bb384];return _0x177e04;};'use strict';var moment=require(_0xea87('0x0'));var Sequelize=require(_0xea87('0x1'));module[_0xea87('0x2')]={'uniqueid':{'type':Sequelize[_0xea87('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xea87('0x4')]},'leaveAt':{'type':Sequelize[_0xea87('0x4')]},'acceptAt':{'type':Sequelize[_0xea87('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xea87('0x3')]}}; \ No newline at end of file +var _0x8fdd=['exports','STRING','DATE','sequelize'];(function(_0x23dbf3,_0x3eb1f9){var _0x3d49ee=function(_0x118b5c){while(--_0x118b5c){_0x23dbf3['push'](_0x23dbf3['shift']());}};_0x3d49ee(++_0x3eb1f9);}(_0x8fdd,0x1ab));var _0xd8fd=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0x8fdd[_0x6d6a66];return _0x11eb6e;};'use strict';var moment=require('moment');var Sequelize=require(_0xd8fd('0x0'));module[_0xd8fd('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd8fd('0x2')]},'joinAt':{'type':Sequelize[_0xd8fd('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd8fd('0x3')]},'reason':{'type':Sequelize[_0xd8fd('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 24a9b94..21bf15d 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 _0x869e=['name','send','index','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','rows','show','params','includeAll','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error'];(function(_0x5106aa,_0x21c013){var _0x17fe52=function(_0x1c5695){while(--_0x1c5695){_0x5106aa['push'](_0x5106aa['shift']());}};_0x17fe52(++_0x21c013);}(_0x869e,0x18b));var _0xe869=function(_0x4aa201,_0x28d81c){_0x4aa201=_0x4aa201-0x0;var _0x6a91b1=_0x869e[_0x4aa201];return _0x6a91b1;};'use strict';var emlformat=require(_0xe869('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe869('0x1'));var jsonpatch=require(_0xe869('0x2'));var rp=require(_0xe869('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe869('0x4'));var path=require(_0xe869('0x5'));var sox=require(_0xe869('0x6'));var csv=require('to-csv');var ejs=require(_0xe869('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe869('0x8'));var squel=require(_0xe869('0x9'));var crypto=require('crypto');var jsforce=require(_0xe869('0xa'));var deskjs=require(_0xe869('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe869('0xc'));var Papa=require(_0xe869('0xd'));var Redis=require(_0xe869('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe869('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe869('0x10'));var logger=require('../../config/logger')(_0xe869('0x11'));var utils=require('../../config/utils');var config=require(_0xe869('0x12'));var licenseUtil=require(_0xe869('0x13'));var db=require(_0xe869('0x14'))['db'];function respondWithStatusCode(_0x283d85,_0x1339e1){_0x1339e1=_0x1339e1||0xcc;return function(_0x64ee42){if(_0x64ee42){return _0x283d85[_0xe869('0x15')](_0x1339e1);}return _0x283d85[_0xe869('0x16')](_0x1339e1)['end']();};}function respondWithResult(_0xfab49b,_0x2a5fe4){_0x2a5fe4=_0x2a5fe4||0xc8;return function(_0x571c74){if(_0x571c74){return _0xfab49b[_0xe869('0x16')](_0x2a5fe4)['json'](_0x571c74);}};}function respondWithFilteredResult(_0x4b61a2,_0x3505be){return function(_0x749442){if(_0x749442){var _0x1e2d7f=typeof _0x3505be[_0xe869('0x17')]===_0xe869('0x18')&&typeof _0x3505be['limit']===_0xe869('0x18');var _0x1d219c=_0x749442[_0xe869('0x19')];var _0x5390d4=_0x1e2d7f?0x0:_0x3505be[_0xe869('0x17')];var _0x3bca23=_0x1e2d7f?_0x749442[_0xe869('0x19')]:_0x3505be['offset']+_0x3505be[_0xe869('0x1a')];var _0x19619c;if(_0x3bca23>=_0x1d219c){_0x3bca23=_0x1d219c;_0x19619c=0xc8;}else{_0x19619c=0xce;}_0x4b61a2[_0xe869('0x16')](_0x19619c);return _0x4b61a2[_0xe869('0x1b')](_0xe869('0x1c'),_0x5390d4+'-'+_0x3bca23+'/'+_0x1d219c)['json'](_0x749442);}return null;};}function patchUpdates(_0x15fe88){return function(_0x300946){try{jsonpatch[_0xe869('0x1d')](_0x300946,_0x15fe88,!![]);}catch(_0x4c0447){return BPromise[_0xe869('0x1e')](_0x4c0447);}return _0x300946[_0xe869('0x1f')]();};}function saveUpdates(_0x1c0699,_0x5d929c){return function(_0xf433fd){if(_0xf433fd){return _0xf433fd[_0xe869('0x20')](_0x1c0699)[_0xe869('0x21')](function(_0xc6f1d0){return _0xc6f1d0;});}return null;};}function removeEntity(_0x42621e,_0x1f5227){return function(_0xc06caf){if(_0xc06caf){return _0xc06caf[_0xe869('0x22')]()[_0xe869('0x21')](function(){_0x42621e['status'](0xcc)[_0xe869('0x23')]();});}};}function handleEntityNotFound(_0x38e6a7,_0x33822b){return function(_0x34ff4c){if(!_0x34ff4c){_0x38e6a7[_0xe869('0x15')](0x194);}return _0x34ff4c;};}function handleError(_0x551c94,_0x3f91ad){_0x3f91ad=_0x3f91ad||0x1f4;return function(_0x551569){logger[_0xe869('0x24')](_0x551569['stack']);if(_0x551569[_0xe869('0x25')]){delete _0x551569[_0xe869('0x25')];}_0x551c94['status'](_0x3f91ad)[_0xe869('0x26')](_0x551569);};}exports[_0xe869('0x27')]=function(_0x2a98ff,_0x418aa2){var _0x49bd87={},_0x3cf946={},_0xcc531a={'count':0x0,'rows':[]};var _0x242e90=_['map'](db[_0xe869('0x28')][_0xe869('0x29')],function(_0x2b3e64){return{'name':_0x2b3e64[_0xe869('0x2a')],'type':_0x2b3e64[_0xe869('0x2b')][_0xe869('0x2c')]};});_0x3cf946['model']=_['map'](_0x242e90,_0xe869('0x25'));_0x3cf946[_0xe869('0x2d')]=_[_0xe869('0x2e')](_0x2a98ff['query']);_0x3cf946[_0xe869('0x2f')]=_[_0xe869('0x30')](_0x3cf946['model'],_0x3cf946[_0xe869('0x2d')]);_0x49bd87[_0xe869('0x31')]=_['intersection'](_0x3cf946[_0xe869('0x32')],qs[_0xe869('0x33')](_0x2a98ff[_0xe869('0x2d')]['fields']));_0x49bd87[_0xe869('0x31')]=_0x49bd87[_0xe869('0x31')][_0xe869('0x34')]?_0x49bd87[_0xe869('0x31')]:_0x3cf946[_0xe869('0x32')];if(!_0x2a98ff[_0xe869('0x2d')]['hasOwnProperty'](_0xe869('0x35'))){_0x49bd87['limit']=qs[_0xe869('0x1a')](_0x2a98ff[_0xe869('0x2d')][_0xe869('0x1a')]);_0x49bd87[_0xe869('0x17')]=qs['offset'](_0x2a98ff['query'][_0xe869('0x17')]);}_0x49bd87[_0xe869('0x36')]=qs[_0xe869('0x37')](_0x2a98ff[_0xe869('0x2d')][_0xe869('0x37')]);_0x49bd87[_0xe869('0x38')]=qs[_0xe869('0x2f')](_[_0xe869('0x39')](_0x2a98ff['query'],_0x3cf946[_0xe869('0x2f')]),_0x242e90);if(_0x2a98ff[_0xe869('0x2d')][_0xe869('0x3a')]){_0x49bd87['where']=_[_0xe869('0x3b')](_0x49bd87[_0xe869('0x38')],{'$or':_[_0xe869('0x3c')](_0x242e90,function(_0x4b7bd3){if(_0x4b7bd3[_0xe869('0x2b')]!==_0xe869('0x3d')){var _0x33a881={};_0x33a881[_0x4b7bd3[_0xe869('0x25')]]={'$like':'%'+_0x2a98ff[_0xe869('0x2d')][_0xe869('0x3a')]+'%'};return _0x33a881;}})});}_0x49bd87=_[_0xe869('0x3b')]({},_0x49bd87,_0x2a98ff['options']);var _0x5abbf2={'where':_0x49bd87[_0xe869('0x38')]};return db[_0xe869('0x28')][_0xe869('0x19')](_0x5abbf2)['then'](function(_0x319159){_0xcc531a[_0xe869('0x19')]=_0x319159;if(_0x2a98ff[_0xe869('0x2d')]['includeAll']){_0x49bd87['include']=[{'all':!![]}];}return db[_0xe869('0x28')]['findAll'](_0x49bd87);})[_0xe869('0x21')](function(_0x48aeca){_0xcc531a[_0xe869('0x3e')]=_0x48aeca;return _0xcc531a;})[_0xe869('0x21')](respondWithFilteredResult(_0x418aa2,_0x49bd87))['catch'](handleError(_0x418aa2,null));};exports[_0xe869('0x3f')]=function(_0x2077d4,_0x2bfe08){var _0x417a34={'raw':!![],'where':{'id':_0x2077d4[_0xe869('0x40')]['id']}},_0x59a2bb={};_0x59a2bb['model']=_['keys'](db['OpenchannelQueueReport']['rawAttributes']);_0x59a2bb[_0xe869('0x2d')]=_[_0xe869('0x2e')](_0x2077d4[_0xe869('0x2d')]);_0x59a2bb[_0xe869('0x2f')]=_[_0xe869('0x30')](_0x59a2bb[_0xe869('0x32')],_0x59a2bb[_0xe869('0x2d')]);_0x417a34['attributes']=_[_0xe869('0x30')](_0x59a2bb['model'],qs[_0xe869('0x33')](_0x2077d4['query'][_0xe869('0x33')]));_0x417a34[_0xe869('0x31')]=_0x417a34['attributes'][_0xe869('0x34')]?_0x417a34[_0xe869('0x31')]:_0x59a2bb[_0xe869('0x32')];if(_0x2077d4[_0xe869('0x2d')][_0xe869('0x41')]){_0x417a34['include']=[{'all':!![]}];}_0x417a34=_[_0xe869('0x3b')]({},_0x417a34,_0x2077d4[_0xe869('0x42')]);return db['OpenchannelQueueReport'][_0xe869('0x43')](_0x417a34)[_0xe869('0x21')](handleEntityNotFound(_0x2bfe08,null))[_0xe869('0x21')](respondWithResult(_0x2bfe08,null))[_0xe869('0x44')](handleError(_0x2bfe08,null));};exports['create']=function(_0x1d762c,_0x6e8135){return db['OpenchannelQueueReport'][_0xe869('0x45')](_0x1d762c[_0xe869('0x46')],{})['then'](respondWithResult(_0x6e8135,0xc9))[_0xe869('0x44')](handleError(_0x6e8135,null));};exports['update']=function(_0x529f85,_0xcdb43f){if(_0x529f85['body']['id']){delete _0x529f85[_0xe869('0x46')]['id'];}return db[_0xe869('0x28')]['find']({'where':{'id':_0x529f85[_0xe869('0x40')]['id']}})[_0xe869('0x21')](handleEntityNotFound(_0xcdb43f,null))[_0xe869('0x21')](saveUpdates(_0x529f85[_0xe869('0x46')],null))[_0xe869('0x21')](respondWithResult(_0xcdb43f,null))['catch'](handleError(_0xcdb43f,null));};exports[_0xe869('0x22')]=function(_0x114f47,_0x5d3bf7){return db[_0xe869('0x28')]['find']({'where':{'id':_0x114f47[_0xe869('0x40')]['id']}})[_0xe869('0x21')](handleEntityNotFound(_0x5d3bf7,null))[_0xe869('0x21')](removeEntity(_0x5d3bf7,null))[_0xe869('0x44')](handleError(_0x5d3bf7,null));};exports[_0xe869('0x47')]=function(_0x3fd012,_0x2b7c51){return db[_0xe869('0x28')][_0xe869('0x47')]()[_0xe869('0x21')](respondWithResult(_0x2b7c51,null))['catch'](handleError(_0x2b7c51,null));}; \ No newline at end of file +var _0x2083=['ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x581c15,_0x1db063){var _0x1fab5f=function(_0x4bea6a){while(--_0x4bea6a){_0x581c15['push'](_0x581c15['shift']());}};_0x1fab5f(++_0x1db063);}(_0x2083,0x1e8));var _0x3208=function(_0x136408,_0x56a4ae){_0x136408=_0x136408-0x0;var _0x3b93f9=_0x2083[_0x136408];return _0x3b93f9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3208('0x0'));var jsonpatch=require(_0x3208('0x1'));var rp=require(_0x3208('0x2'));var moment=require(_0x3208('0x3'));var BPromise=require(_0x3208('0x4'));var Mustache=require(_0x3208('0x5'));var util=require(_0x3208('0x6'));var path=require('path');var sox=require(_0x3208('0x7'));var csv=require(_0x3208('0x8'));var ejs=require(_0x3208('0x9'));var fs=require('fs');var fs_extra=require(_0x3208('0xa'));var _=require('lodash');var squel=require(_0x3208('0xb'));var crypto=require(_0x3208('0xc'));var jsforce=require(_0x3208('0xd'));var deskjs=require(_0x3208('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3208('0xf'));var Redis=require(_0x3208('0x10'));var authService=require(_0x3208('0x11'));var qs=require(_0x3208('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3208('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3208('0x14'));var config=require(_0x3208('0x15'));var licenseUtil=require(_0x3208('0x16'));var db=require(_0x3208('0x17'))['db'];function respondWithStatusCode(_0x503a73,_0x398e42){_0x398e42=_0x398e42||0xcc;return function(_0x3aabfb){if(_0x3aabfb){return _0x503a73['sendStatus'](_0x398e42);}return _0x503a73[_0x3208('0x18')](_0x398e42)['end']();};}function respondWithResult(_0x57fba7,_0x195093){_0x195093=_0x195093||0xc8;return function(_0x23bc28){if(_0x23bc28){return _0x57fba7[_0x3208('0x18')](_0x195093)['json'](_0x23bc28);}};}function respondWithFilteredResult(_0x40b215,_0x3b74d4){return function(_0x273bc3){if(_0x273bc3){var _0x56f2cc=typeof _0x3b74d4[_0x3208('0x19')]===_0x3208('0x1a')&&typeof _0x3b74d4[_0x3208('0x1b')]===_0x3208('0x1a');var _0x482bd4=_0x273bc3[_0x3208('0x1c')];var _0x53ea3b=_0x56f2cc?0x0:_0x3b74d4['offset'];var _0x32e84e=_0x56f2cc?_0x273bc3[_0x3208('0x1c')]:_0x3b74d4[_0x3208('0x19')]+_0x3b74d4[_0x3208('0x1b')];var _0x2f8ec3;if(_0x32e84e>=_0x482bd4){_0x32e84e=_0x482bd4;_0x2f8ec3=0xc8;}else{_0x2f8ec3=0xce;}_0x40b215[_0x3208('0x18')](_0x2f8ec3);return _0x40b215[_0x3208('0x1d')](_0x3208('0x1e'),_0x53ea3b+'-'+_0x32e84e+'/'+_0x482bd4)[_0x3208('0x1f')](_0x273bc3);}return null;};}function patchUpdates(_0x2d4855){return function(_0x2d8321){try{jsonpatch[_0x3208('0x20')](_0x2d8321,_0x2d4855,!![]);}catch(_0x4de657){return BPromise[_0x3208('0x21')](_0x4de657);}return _0x2d8321[_0x3208('0x22')]();};}function saveUpdates(_0x43a80f,_0x42b483){return function(_0xc61b1){if(_0xc61b1){return _0xc61b1[_0x3208('0x23')](_0x43a80f)['then'](function(_0x3d51ba){return _0x3d51ba;});}return null;};}function removeEntity(_0x4aac63,_0x112777){return function(_0x49f9c7){if(_0x49f9c7){return _0x49f9c7['destroy']()[_0x3208('0x24')](function(){_0x4aac63[_0x3208('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e4f49,_0x5e1ed2){return function(_0x1bbe9d){if(!_0x1bbe9d){_0x3e4f49['sendStatus'](0x194);}return _0x1bbe9d;};}function handleError(_0x1513dd,_0x50285f){_0x50285f=_0x50285f||0x1f4;return function(_0x2682df){logger[_0x3208('0x25')](_0x2682df[_0x3208('0x26')]);if(_0x2682df['name']){delete _0x2682df['name'];}_0x1513dd[_0x3208('0x18')](_0x50285f)['send'](_0x2682df);};}exports['index']=function(_0x2f033c,_0x3df1fb){var _0x164ed2={},_0x437010={},_0x322530={'count':0x0,'rows':[]};var _0x348e86=_[_0x3208('0x27')](db[_0x3208('0x28')][_0x3208('0x29')],function(_0x8e261b){return{'name':_0x8e261b['fieldName'],'type':_0x8e261b[_0x3208('0x2a')][_0x3208('0x2b')]};});_0x437010[_0x3208('0x2c')]=_['map'](_0x348e86,'name');_0x437010[_0x3208('0x2d')]=_[_0x3208('0x2e')](_0x2f033c[_0x3208('0x2d')]);_0x437010[_0x3208('0x2f')]=_['intersection'](_0x437010['model'],_0x437010[_0x3208('0x2d')]);_0x164ed2['attributes']=_[_0x3208('0x30')](_0x437010[_0x3208('0x2c')],qs[_0x3208('0x31')](_0x2f033c[_0x3208('0x2d')][_0x3208('0x31')]));_0x164ed2[_0x3208('0x32')]=_0x164ed2[_0x3208('0x32')][_0x3208('0x33')]?_0x164ed2[_0x3208('0x32')]:_0x437010['model'];if(!_0x2f033c['query'][_0x3208('0x34')]('nolimit')){_0x164ed2[_0x3208('0x1b')]=qs['limit'](_0x2f033c[_0x3208('0x2d')]['limit']);_0x164ed2[_0x3208('0x19')]=qs[_0x3208('0x19')](_0x2f033c[_0x3208('0x2d')][_0x3208('0x19')]);}_0x164ed2[_0x3208('0x35')]=qs[_0x3208('0x36')](_0x2f033c[_0x3208('0x2d')][_0x3208('0x36')]);_0x164ed2[_0x3208('0x37')]=qs['filters'](_[_0x3208('0x38')](_0x2f033c['query'],_0x437010['filters']),_0x348e86);if(_0x2f033c[_0x3208('0x2d')][_0x3208('0x39')]){_0x164ed2[_0x3208('0x37')]=_[_0x3208('0x3a')](_0x164ed2['where'],{'$or':_[_0x3208('0x27')](_0x348e86,function(_0x468d2d){if(_0x468d2d[_0x3208('0x2a')]!==_0x3208('0x3b')){var _0x168249={};_0x168249[_0x468d2d[_0x3208('0x3c')]]={'$like':'%'+_0x2f033c[_0x3208('0x2d')]['filter']+'%'};return _0x168249;}})});}_0x164ed2=_[_0x3208('0x3a')]({},_0x164ed2,_0x2f033c[_0x3208('0x3d')]);var _0x3d61e4={'where':_0x164ed2['where']};return db['OpenchannelQueueReport']['count'](_0x3d61e4)['then'](function(_0x340d25){_0x322530[_0x3208('0x1c')]=_0x340d25;if(_0x2f033c['query']['includeAll']){_0x164ed2[_0x3208('0x3e')]=[{'all':!![]}];}return db[_0x3208('0x28')][_0x3208('0x3f')](_0x164ed2);})[_0x3208('0x24')](function(_0x1a63ef){_0x322530[_0x3208('0x40')]=_0x1a63ef;return _0x322530;})[_0x3208('0x24')](respondWithFilteredResult(_0x3df1fb,_0x164ed2))[_0x3208('0x41')](handleError(_0x3df1fb,null));};exports[_0x3208('0x42')]=function(_0x3c72e7,_0x41a07c){var _0x283970={'raw':!![],'where':{'id':_0x3c72e7[_0x3208('0x43')]['id']}},_0x37034a={};_0x37034a[_0x3208('0x2c')]=_[_0x3208('0x2e')](db['OpenchannelQueueReport'][_0x3208('0x29')]);_0x37034a[_0x3208('0x2d')]=_[_0x3208('0x2e')](_0x3c72e7[_0x3208('0x2d')]);_0x37034a['filters']=_[_0x3208('0x30')](_0x37034a['model'],_0x37034a[_0x3208('0x2d')]);_0x283970[_0x3208('0x32')]=_['intersection'](_0x37034a[_0x3208('0x2c')],qs['fields'](_0x3c72e7[_0x3208('0x2d')][_0x3208('0x31')]));_0x283970['attributes']=_0x283970['attributes'][_0x3208('0x33')]?_0x283970['attributes']:_0x37034a[_0x3208('0x2c')];if(_0x3c72e7['query']['includeAll']){_0x283970[_0x3208('0x3e')]=[{'all':!![]}];}_0x283970=_[_0x3208('0x3a')]({},_0x283970,_0x3c72e7[_0x3208('0x3d')]);return db[_0x3208('0x28')][_0x3208('0x44')](_0x283970)[_0x3208('0x24')](handleEntityNotFound(_0x41a07c,null))[_0x3208('0x24')](respondWithResult(_0x41a07c,null))[_0x3208('0x41')](handleError(_0x41a07c,null));};exports[_0x3208('0x45')]=function(_0x5e00a3,_0x4597c2){return db['OpenchannelQueueReport'][_0x3208('0x45')](_0x5e00a3[_0x3208('0x46')],{})[_0x3208('0x24')](respondWithResult(_0x4597c2,0xc9))[_0x3208('0x41')](handleError(_0x4597c2,null));};exports[_0x3208('0x23')]=function(_0x340732,_0x3f3180){if(_0x340732['body']['id']){delete _0x340732[_0x3208('0x46')]['id'];}return db['OpenchannelQueueReport'][_0x3208('0x44')]({'where':{'id':_0x340732['params']['id']}})[_0x3208('0x24')](handleEntityNotFound(_0x3f3180,null))['then'](saveUpdates(_0x340732['body'],null))[_0x3208('0x24')](respondWithResult(_0x3f3180,null))['catch'](handleError(_0x3f3180,null));};exports['destroy']=function(_0x1a8267,_0x223bf9){return db[_0x3208('0x28')]['find']({'where':{'id':_0x1a8267[_0x3208('0x43')]['id']}})[_0x3208('0x24')](handleEntityNotFound(_0x223bf9,null))[_0x3208('0x24')](removeEntity(_0x223bf9,null))[_0x3208('0x41')](handleError(_0x223bf9,null));};exports['describe']=function(_0x4c90a2,_0x3631b0){return db[_0x3208('0x28')]['describe']()[_0x3208('0x24')](respondWithResult(_0x3631b0,null))[_0x3208('0x41')](handleError(_0x3631b0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index b4c388b..d46d9cd 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x4b4986,_0x23e235){var _0x182430=function(_0x1eb0ab){while(--_0x1eb0ab){_0x4b4986['push'](_0x4b4986['shift']());}};_0x182430(++_0x23e235);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x24d5d9,_0x426993){var _0x1f8e14=function(_0x4f4264){while(--_0x4f4264){_0x24d5d9['push'](_0x24d5d9['shift']());}};_0x1f8e14(++_0x426993);}(_0x1261,0x144));var _0x1126=function(_0x323bf6,_0x19aed6){_0x323bf6=_0x323bf6-0x0;var _0x18da88=_0x1261[_0x323bf6];return _0x18da88;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 3808140..bd7ced5 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 _0x0b7f=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','stringify','catch','UpdateOpenchannelQueueReport','update','body','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x567ef4,_0x10a870){var _0x481cd6=function(_0x1c8cf8){while(--_0x1c8cf8){_0x567ef4['push'](_0x567ef4['shift']());}};_0x481cd6(++_0x10a870);}(_0x0b7f,0x115));var _0xf0b7=function(_0x471aa1,_0x3ce017){_0x471aa1=_0x471aa1-0x0;var _0x1a6437=_0x0b7f[_0x471aa1];return _0x1a6437;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var moment=require('moment');var BPromise=require(_0xf0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0b7('0x3'));var db=require(_0xf0b7('0x4'))['db'];var utils=require(_0xf0b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0b7('0x6'));var jayson=require(_0xf0b7('0x7'));var client=jayson[_0xf0b7('0x8')][_0xf0b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2de8,_0x5e449a,_0x1408ee){return new BPromise(function(_0x276f09,_0x275a13){return client[_0xf0b7('0xa')](_0x2b2de8,_0x1408ee)[_0xf0b7('0xb')](function(_0x588b46){logger[_0xf0b7('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5e449a,'request\x20sent');logger['debug'](_0xf0b7('0xd'),_0x5e449a,'request\x20sent',JSON['stringify'](_0x588b46));if(_0x588b46[_0xf0b7('0xe')]){if(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0xf')]===0x1f4){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x275a13(_0x588b46[_0xf0b7('0xe')]['message']);}logger['error'](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x276f09(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);}else{logger['info'](_0xf0b7('0x10'),_0x5e449a,_0xf0b7('0x12'));_0x276f09(_0x588b46[_0xf0b7('0x13')][_0xf0b7('0x11')]);}})['catch'](function(_0x303db6){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x303db6);_0x275a13(_0x303db6);});});}exports[_0xf0b7('0x14')]=function(_0x52b27e){var _0x1e5fc9=this;return new Promise(function(_0x153d23,_0x28fd36){return db[_0xf0b7('0x15')][_0xf0b7('0x16')](_0x52b27e['body'],{'raw':_0x52b27e[_0xf0b7('0x17')]?_0x52b27e['options'][_0xf0b7('0x18')]===undefined?!![]:![]:!![]})[_0xf0b7('0xb')](function(_0x374496){logger['info']('CreateOpenchannelQueueReport',_0x52b27e);logger[_0xf0b7('0x19')](_0xf0b7('0x14'),_0x52b27e,JSON[_0xf0b7('0x1a')](_0x374496));_0x153d23(_0x374496);})[_0xf0b7('0x1b')](function(_0xb90b3c){logger[_0xf0b7('0xe')](_0xf0b7('0x14'),_0xb90b3c[_0xf0b7('0x11')],_0x52b27e);_0x28fd36(_0x1e5fc9[_0xf0b7('0xe')](0x1f4,_0xb90b3c['message']));});});};exports[_0xf0b7('0x1c')]=function(_0x2cfb7b){var _0x14782a=this;return new Promise(function(_0x210afa,_0x2ba0da){return db[_0xf0b7('0x15')][_0xf0b7('0x1d')](_0x2cfb7b[_0xf0b7('0x1e')],{'raw':_0x2cfb7b[_0xf0b7('0x17')]?_0x2cfb7b[_0xf0b7('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cfb7b[_0xf0b7('0x17')]?_0x2cfb7b[_0xf0b7('0x17')]['where']||null:null,'attributes':_0x2cfb7b[_0xf0b7('0x17')]?_0x2cfb7b[_0xf0b7('0x17')][_0xf0b7('0x1f')]||null:null,'limit':_0x2cfb7b['options']?_0x2cfb7b[_0xf0b7('0x17')][_0xf0b7('0x20')]||null:null})[_0xf0b7('0xb')](function(_0x4fda93){logger[_0xf0b7('0xc')](_0xf0b7('0x1c'),_0x2cfb7b);logger[_0xf0b7('0x19')](_0xf0b7('0x1c'),_0x2cfb7b,JSON[_0xf0b7('0x1a')](_0x4fda93));_0x210afa(_0x4fda93);})[_0xf0b7('0x1b')](function(_0x10643f){logger[_0xf0b7('0xe')](_0xf0b7('0x1c'),_0x10643f[_0xf0b7('0x11')],_0x2cfb7b);_0x2ba0da(_0x14782a['error'](0x1f4,_0x10643f[_0xf0b7('0x11')]));});});}; \ No newline at end of file +var _0x5204=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','update','raw','where','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5518d1,_0x44f1f9){var _0x43d39c=function(_0x51c682){while(--_0x51c682){_0x5518d1['push'](_0x5518d1['shift']());}};_0x43d39c(++_0x44f1f9);}(_0x5204,0xdf));var _0x4520=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0x5204[_0x9df3d8];return _0x366da1;};'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);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c46c5){logger[_0x4520('0xc')]('CreateOpenchannelQueueReport',_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x4c46c5));_0x4ba69f(_0x4c46c5);})['catch'](function(_0x3199a9){logger[_0x4520('0x12')](_0x4520('0x17'),_0x3199a9['message'],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x3199a9[_0x4520('0x14')]));});});};exports[_0x4520('0x1c')]=function(_0x3a4680){var _0x2a8528=this;return new Promise(function(_0x552da1,_0x3774bd){return db[_0x4520('0x18')][_0x4520('0x1d')](_0x3a4680[_0x4520('0x1a')],{'raw':_0x3a4680['options']?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1f')]||null:null,'attributes':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x20')]||null:null,'limit':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')]['limit']||null:null})[_0x4520('0x21')](function(_0x5c1a0b){logger[_0x4520('0xc')](_0x4520('0x1c'),_0x3a4680);logger[_0x4520('0xf')](_0x4520('0x1c'),_0x3a4680,JSON[_0x4520('0x11')](_0x5c1a0b));_0x552da1(_0x5c1a0b);})[_0x4520('0x16')](function(_0x5bb163){logger[_0x4520('0x12')]('UpdateOpenchannelQueueReport',_0x5bb163[_0x4520('0x14')],_0x3a4680);_0x3774bd(_0x2a8528['error'](0x1f4,_0x5bb163[_0x4520('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index facdf7b..b9ad1aa 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 _0x90f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3c0053,_0x10e01d){var _0x44d745=function(_0x24ecd0){while(--_0x24ecd0){_0x3c0053['push'](_0x3c0053['shift']());}};_0x44d745(++_0x10e01d);}(_0x90f0,0x1c9));var _0x090f=function(_0x30428f,_0x46de51){_0x30428f=_0x30428f-0x0;var _0x42cf4f=_0x90f0[_0x30428f];return _0x42cf4f;};'use strict';var multer=require(_0x090f('0x0'));var util=require(_0x090f('0x1'));var path=require('path');var timeout=require(_0x090f('0x2'));var express=require(_0x090f('0x3'));var router=express[_0x090f('0x4')]();var fs_extra=require(_0x090f('0x5'));var auth=require(_0x090f('0x6'));var interaction=require(_0x090f('0x7'));var config=require(_0x090f('0x8'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x090f('0x9')](),controller[_0x090f('0xa')]);router[_0x090f('0xb')](_0x090f('0xc'),auth[_0x090f('0x9')](),controller[_0x090f('0xd')]);router['get'](_0x090f('0xe'),auth[_0x090f('0x9')](),controller['show']);router[_0x090f('0xf')]('/',auth[_0x090f('0x9')](),controller[_0x090f('0x10')]);router[_0x090f('0x11')]('/:id',auth[_0x090f('0x9')](),controller['update']);router[_0x090f('0x12')](_0x090f('0xe'),auth['isAuthenticated'](),controller[_0x090f('0x13')]);module[_0x090f('0x14')]=router; \ No newline at end of file +var _0xf266=['post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','describe','/:id','show'];(function(_0x41b7e3,_0x410de1){var _0x14e372=function(_0x1cfbad){while(--_0x1cfbad){_0x41b7e3['push'](_0x41b7e3['shift']());}};_0x14e372(++_0x410de1);}(_0xf266,0xed));var _0x6f26=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xf266[_0x10004e];return _0x5af990;};'use strict';var multer=require(_0x6f26('0x0'));var util=require('util');var path=require(_0x6f26('0x1'));var timeout=require(_0x6f26('0x2'));var express=require(_0x6f26('0x3'));var router=express[_0x6f26('0x4')]();var fs_extra=require(_0x6f26('0x5'));var auth=require(_0x6f26('0x6'));var interaction=require(_0x6f26('0x7'));var config=require(_0x6f26('0x8'));var controller=require(_0x6f26('0x9'));router[_0x6f26('0xa')]('/',auth['isAuthenticated'](),controller[_0x6f26('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6f26('0xc')]);router[_0x6f26('0xa')](_0x6f26('0xd'),auth['isAuthenticated'](),controller[_0x6f26('0xe')]);router[_0x6f26('0xf')]('/',auth[_0x6f26('0x10')](),controller['create']);router[_0x6f26('0x11')](_0x6f26('0xd'),auth[_0x6f26('0x10')](),controller['update']);router[_0x6f26('0x12')](_0x6f26('0xd'),auth[_0x6f26('0x10')](),controller[_0x6f26('0x13')]);module[_0x6f26('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 5333f58..4919b7e 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x35f1de,_0x4dda19){var _0x4b66d6=function(_0x4ff6c5){while(--_0x4ff6c5){_0x35f1de['push'](_0x35f1de['shift']());}};_0x4b66d6(++_0x4dda19);}(_0x54ef,0x112));var _0xf54e=function(_0xa2d910,_0x40f3f9){_0xa2d910=_0xa2d910-0x0;var _0x5b09c3=_0x54ef[_0xa2d910];return _0x5b09c3;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index a3f067e..1fade90 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 _0x27c9=['merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x27c9,0x1e7));var _0x927c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x27c9[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x927c('0x0'));var rimraf=require(_0x927c('0x1'));var zipdir=require(_0x927c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x927c('0x3'));var moment=require(_0x927c('0x4'));var BPromise=require(_0x927c('0x5'));var Mustache=require(_0x927c('0x6'));var util=require(_0x927c('0x7'));var path=require(_0x927c('0x8'));var sox=require(_0x927c('0x9'));var csv=require(_0x927c('0xa'));var ejs=require(_0x927c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x927c('0xc'));var squel=require(_0x927c('0xd'));var crypto=require(_0x927c('0xe'));var jsforce=require(_0x927c('0xf'));var deskjs=require(_0x927c('0x10'));var toCsv=require(_0x927c('0xa'));var querystring=require(_0x927c('0x11'));var Papa=require('papaparse');var Redis=require(_0x927c('0x12'));var authService=require(_0x927c('0x13'));var qs=require(_0x927c('0x14'));var as=require(_0x927c('0x15'));var hardwareService=require(_0x927c('0x16'));var logger=require(_0x927c('0x17'))(_0x927c('0x18'));var utils=require(_0x927c('0x19'));var config=require(_0x927c('0x1a'));var licenseUtil=require(_0x927c('0x1b'));var db=require(_0x927c('0x1c'))['db'];function respondWithStatusCode(_0x322c5d,_0x2bb0ae){_0x2bb0ae=_0x2bb0ae||0xcc;return function(_0x146014){if(_0x146014){return _0x322c5d[_0x927c('0x1d')](_0x2bb0ae);}return _0x322c5d[_0x927c('0x1e')](_0x2bb0ae)[_0x927c('0x1f')]();};}function respondWithResult(_0xda0cc1,_0x3d6a73){_0x3d6a73=_0x3d6a73||0xc8;return function(_0x1af932){if(_0x1af932){return _0xda0cc1[_0x927c('0x1e')](_0x3d6a73)[_0x927c('0x20')](_0x1af932);}};}function respondWithFilteredResult(_0x4b4004,_0x4e60b6){return function(_0x280389){if(_0x280389){var _0x6e2244=typeof _0x4e60b6['offset']===_0x927c('0x21')&&typeof _0x4e60b6[_0x927c('0x22')]===_0x927c('0x21');var _0x2b9008=_0x280389[_0x927c('0x23')];var _0x166e9e=_0x6e2244?0x0:_0x4e60b6[_0x927c('0x24')];var _0x1f9820=_0x6e2244?_0x280389[_0x927c('0x23')]:_0x4e60b6['offset']+_0x4e60b6[_0x927c('0x22')];var _0x33ce40;if(_0x1f9820>=_0x2b9008){_0x1f9820=_0x2b9008;_0x33ce40=0xc8;}else{_0x33ce40=0xce;}_0x4b4004['status'](_0x33ce40);return _0x4b4004[_0x927c('0x25')](_0x927c('0x26'),_0x166e9e+'-'+_0x1f9820+'/'+_0x2b9008)['json'](_0x280389);}return null;};}function patchUpdates(_0x451f05){return function(_0x295fc7){try{jsonpatch[_0x927c('0x27')](_0x295fc7,_0x451f05,!![]);}catch(_0x2e56a9){return BPromise['reject'](_0x2e56a9);}return _0x295fc7[_0x927c('0x28')]();};}function saveUpdates(_0x9b45a,_0x9807e3){return function(_0x13bdde){if(_0x13bdde){return _0x13bdde[_0x927c('0x29')](_0x9b45a)['then'](function(_0x35c249){return _0x35c249;});}return null;};}function removeEntity(_0x11bc90,_0x171bc6){return function(_0x35f9ba){if(_0x35f9ba){return _0x35f9ba[_0x927c('0x2a')]()[_0x927c('0x2b')](function(){_0x11bc90[_0x927c('0x1e')](0xcc)[_0x927c('0x1f')]();});}};}function handleEntityNotFound(_0x3e89a9,_0x5b1a44){return function(_0x5dd7be){if(!_0x5dd7be){_0x3e89a9[_0x927c('0x1d')](0x194);}return _0x5dd7be;};}function handleError(_0x10b11b,_0x5bb058){_0x5bb058=_0x5bb058||0x1f4;return function(_0x37eac7){logger['error'](_0x37eac7['stack']);if(_0x37eac7[_0x927c('0x2c')]){delete _0x37eac7['name'];}_0x10b11b[_0x927c('0x1e')](_0x5bb058)[_0x927c('0x2d')](_0x37eac7);};}exports['index']=function(_0x1f9895,_0x14368c){var _0x16eeec={},_0x367d94={},_0x15985b={'count':0x0,'rows':[]};var _0x1e4c13=_[_0x927c('0x2e')](db[_0x927c('0x2f')][_0x927c('0x30')],function(_0x43a5f6){return{'name':_0x43a5f6[_0x927c('0x31')],'type':_0x43a5f6[_0x927c('0x32')][_0x927c('0x33')]};});_0x367d94[_0x927c('0x34')]=_[_0x927c('0x2e')](_0x1e4c13,_0x927c('0x2c'));_0x367d94[_0x927c('0x35')]=_[_0x927c('0x36')](_0x1f9895[_0x927c('0x35')]);_0x367d94[_0x927c('0x37')]=_[_0x927c('0x38')](_0x367d94[_0x927c('0x34')],_0x367d94[_0x927c('0x35')]);_0x16eeec[_0x927c('0x39')]=_['intersection'](_0x367d94[_0x927c('0x34')],qs['fields'](_0x1f9895[_0x927c('0x35')][_0x927c('0x3a')]));_0x16eeec[_0x927c('0x39')]=_0x16eeec['attributes'][_0x927c('0x3b')]?_0x16eeec[_0x927c('0x39')]:_0x367d94[_0x927c('0x34')];if(!_0x1f9895[_0x927c('0x35')][_0x927c('0x3c')](_0x927c('0x3d'))){_0x16eeec[_0x927c('0x22')]=qs[_0x927c('0x22')](_0x1f9895[_0x927c('0x35')][_0x927c('0x22')]);_0x16eeec[_0x927c('0x24')]=qs[_0x927c('0x24')](_0x1f9895[_0x927c('0x35')][_0x927c('0x24')]);}_0x16eeec['order']=qs[_0x927c('0x3e')](_0x1f9895[_0x927c('0x35')][_0x927c('0x3e')]);_0x16eeec[_0x927c('0x3f')]=qs[_0x927c('0x37')](_[_0x927c('0x40')](_0x1f9895[_0x927c('0x35')],_0x367d94[_0x927c('0x37')]),_0x1e4c13);if(_0x1f9895[_0x927c('0x35')][_0x927c('0x41')]){_0x16eeec[_0x927c('0x3f')]=_[_0x927c('0x42')](_0x16eeec[_0x927c('0x3f')],{'$or':_[_0x927c('0x2e')](_0x1e4c13,function(_0x4341fd){if(_0x4341fd[_0x927c('0x32')]!==_0x927c('0x43')){var _0x5a688e={};_0x5a688e[_0x4341fd[_0x927c('0x2c')]]={'$like':'%'+_0x1f9895[_0x927c('0x35')][_0x927c('0x41')]+'%'};return _0x5a688e;}})});}_0x16eeec=_[_0x927c('0x42')]({},_0x16eeec,_0x1f9895[_0x927c('0x44')]);var _0x53a9bd={'where':_0x16eeec['where']};return db[_0x927c('0x2f')]['count'](_0x53a9bd)['then'](function(_0x179b8d){_0x15985b[_0x927c('0x23')]=_0x179b8d;if(_0x1f9895['query'][_0x927c('0x45')]){_0x16eeec[_0x927c('0x46')]=[{'all':!![]}];}return db[_0x927c('0x2f')][_0x927c('0x47')](_0x16eeec);})['then'](function(_0x1e2e5f){_0x15985b['rows']=_0x1e2e5f;return _0x15985b;})[_0x927c('0x2b')](respondWithFilteredResult(_0x14368c,_0x16eeec))['catch'](handleError(_0x14368c,null));};exports[_0x927c('0x48')]=function(_0x577878,_0x2594e7){var _0x3badd1={'raw':!![],'where':{'id':_0x577878[_0x927c('0x49')]['id']}},_0x5622de={};_0x5622de[_0x927c('0x34')]=_['keys'](db['OpenchannelTransferReport'][_0x927c('0x30')]);_0x5622de[_0x927c('0x35')]=_[_0x927c('0x36')](_0x577878[_0x927c('0x35')]);_0x5622de[_0x927c('0x37')]=_[_0x927c('0x38')](_0x5622de[_0x927c('0x34')],_0x5622de[_0x927c('0x35')]);_0x3badd1[_0x927c('0x39')]=_[_0x927c('0x38')](_0x5622de[_0x927c('0x34')],qs['fields'](_0x577878[_0x927c('0x35')][_0x927c('0x3a')]));_0x3badd1[_0x927c('0x39')]=_0x3badd1[_0x927c('0x39')][_0x927c('0x3b')]?_0x3badd1['attributes']:_0x5622de['model'];if(_0x577878[_0x927c('0x35')]['includeAll']){_0x3badd1[_0x927c('0x46')]=[{'all':!![]}];}_0x3badd1=_['merge']({},_0x3badd1,_0x577878[_0x927c('0x44')]);return db[_0x927c('0x2f')][_0x927c('0x4a')](_0x3badd1)['then'](handleEntityNotFound(_0x2594e7,null))[_0x927c('0x2b')](respondWithResult(_0x2594e7,null))['catch'](handleError(_0x2594e7,null));};exports['create']=function(_0x29c38e,_0x1d2144){return db['OpenchannelTransferReport'][_0x927c('0x4b')](_0x29c38e[_0x927c('0x4c')],{})['then'](respondWithResult(_0x1d2144,0xc9))[_0x927c('0x4d')](handleError(_0x1d2144,null));};exports[_0x927c('0x29')]=function(_0x168add,_0x4506df){if(_0x168add[_0x927c('0x4c')]['id']){delete _0x168add[_0x927c('0x4c')]['id'];}return db['OpenchannelTransferReport'][_0x927c('0x4a')]({'where':{'id':_0x168add[_0x927c('0x49')]['id']}})[_0x927c('0x2b')](handleEntityNotFound(_0x4506df,null))[_0x927c('0x2b')](saveUpdates(_0x168add[_0x927c('0x4c')],null))['then'](respondWithResult(_0x4506df,null))[_0x927c('0x4d')](handleError(_0x4506df,null));};exports[_0x927c('0x2a')]=function(_0x31151b,_0x437b71){return db['OpenchannelTransferReport'][_0x927c('0x4a')]({'where':{'id':_0x31151b[_0x927c('0x49')]['id']}})[_0x927c('0x2b')](handleEntityNotFound(_0x437b71,null))[_0x927c('0x2b')](removeEntity(_0x437b71,null))[_0x927c('0x4d')](handleError(_0x437b71,null));};exports[_0x927c('0x4e')]=function(_0x51471d,_0x2ddc07){return db[_0x927c('0x2f')][_0x927c('0x4e')]()['then'](respondWithResult(_0x2ddc07,null))[_0x927c('0x4d')](handleError(_0x2ddc07,null));}; \ No newline at end of file +var _0x5d15=['attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/logger','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','json','apply','reject','then','destroy','sendStatus','error','name','send','index','map','fieldName','key','query','keys','intersection','model'];(function(_0x21d6fa,_0x5e623a){var _0x405b62=function(_0x54f24a){while(--_0x54f24a){_0x21d6fa['push'](_0x21d6fa['shift']());}};_0x405b62(++_0x5e623a);}(_0x5d15,0xb7));var _0x55d1=function(_0x3fa296,_0x2bd315){_0x3fa296=_0x3fa296-0x0;var _0x10b19f=_0x5d15[_0x3fa296];return _0x10b19f;};'use strict';var emlformat=require(_0x55d1('0x0'));var rimraf=require(_0x55d1('0x1'));var zipdir=require(_0x55d1('0x2'));var jsonpatch=require(_0x55d1('0x3'));var rp=require(_0x55d1('0x4'));var moment=require(_0x55d1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x55d1('0x6'));var util=require(_0x55d1('0x7'));var path=require(_0x55d1('0x8'));var sox=require(_0x55d1('0x9'));var csv=require(_0x55d1('0xa'));var ejs=require(_0x55d1('0xb'));var fs=require('fs');var fs_extra=require(_0x55d1('0xc'));var _=require(_0x55d1('0xd'));var squel=require(_0x55d1('0xe'));var crypto=require(_0x55d1('0xf'));var jsforce=require(_0x55d1('0x10'));var deskjs=require(_0x55d1('0x11'));var toCsv=require(_0x55d1('0xa'));var querystring=require(_0x55d1('0x12'));var Papa=require('papaparse');var Redis=require(_0x55d1('0x13'));var authService=require(_0x55d1('0x14'));var qs=require(_0x55d1('0x15'));var as=require(_0x55d1('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55d1('0x17'))(_0x55d1('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x55d1('0x19'));var db=require(_0x55d1('0x1a'))['db'];function respondWithStatusCode(_0x378c60,_0x340e9b){_0x340e9b=_0x340e9b||0xcc;return function(_0x25c7e4){if(_0x25c7e4){return _0x378c60['sendStatus'](_0x340e9b);}return _0x378c60['status'](_0x340e9b)[_0x55d1('0x1b')]();};}function respondWithResult(_0x23c8b0,_0x5a78bc){_0x5a78bc=_0x5a78bc||0xc8;return function(_0xd8dec2){if(_0xd8dec2){return _0x23c8b0[_0x55d1('0x1c')](_0x5a78bc)['json'](_0xd8dec2);}};}function respondWithFilteredResult(_0x52a7f0,_0xa86de3){return function(_0x45be20){if(_0x45be20){var _0xc81932=typeof _0xa86de3[_0x55d1('0x1d')]===_0x55d1('0x1e')&&typeof _0xa86de3[_0x55d1('0x1f')]==='undefined';var _0x30871e=_0x45be20[_0x55d1('0x20')];var _0x276606=_0xc81932?0x0:_0xa86de3[_0x55d1('0x1d')];var _0x16d0cb=_0xc81932?_0x45be20[_0x55d1('0x20')]:_0xa86de3[_0x55d1('0x1d')]+_0xa86de3['limit'];var _0x1d5e9f;if(_0x16d0cb>=_0x30871e){_0x16d0cb=_0x30871e;_0x1d5e9f=0xc8;}else{_0x1d5e9f=0xce;}_0x52a7f0[_0x55d1('0x1c')](_0x1d5e9f);return _0x52a7f0[_0x55d1('0x21')]('Content-Range',_0x276606+'-'+_0x16d0cb+'/'+_0x30871e)[_0x55d1('0x22')](_0x45be20);}return null;};}function patchUpdates(_0x1f47b){return function(_0x1346ce){try{jsonpatch[_0x55d1('0x23')](_0x1346ce,_0x1f47b,!![]);}catch(_0xf15c00){return BPromise[_0x55d1('0x24')](_0xf15c00);}return _0x1346ce['save']();};}function saveUpdates(_0x54322f,_0x3d535b){return function(_0x2f54e8){if(_0x2f54e8){return _0x2f54e8['update'](_0x54322f)[_0x55d1('0x25')](function(_0x4c2127){return _0x4c2127;});}return null;};}function removeEntity(_0x5149b4,_0x5d0eff){return function(_0x42b87c){if(_0x42b87c){return _0x42b87c[_0x55d1('0x26')]()[_0x55d1('0x25')](function(){_0x5149b4['status'](0xcc)[_0x55d1('0x1b')]();});}};}function handleEntityNotFound(_0x1d69ab,_0x37de2c){return function(_0x59ac7d){if(!_0x59ac7d){_0x1d69ab[_0x55d1('0x27')](0x194);}return _0x59ac7d;};}function handleError(_0xffc25,_0x1b6494){_0x1b6494=_0x1b6494||0x1f4;return function(_0x438ab1){logger[_0x55d1('0x28')](_0x438ab1['stack']);if(_0x438ab1[_0x55d1('0x29')]){delete _0x438ab1[_0x55d1('0x29')];}_0xffc25[_0x55d1('0x1c')](_0x1b6494)[_0x55d1('0x2a')](_0x438ab1);};}exports[_0x55d1('0x2b')]=function(_0x240026,_0x330162){var _0xca2467={},_0x2e043b={},_0x3c550b={'count':0x0,'rows':[]};var _0x126af0=_[_0x55d1('0x2c')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x4f8c12){return{'name':_0x4f8c12[_0x55d1('0x2d')],'type':_0x4f8c12['type'][_0x55d1('0x2e')]};});_0x2e043b['model']=_[_0x55d1('0x2c')](_0x126af0,_0x55d1('0x29'));_0x2e043b[_0x55d1('0x2f')]=_[_0x55d1('0x30')](_0x240026[_0x55d1('0x2f')]);_0x2e043b['filters']=_[_0x55d1('0x31')](_0x2e043b[_0x55d1('0x32')],_0x2e043b[_0x55d1('0x2f')]);_0xca2467[_0x55d1('0x33')]=_[_0x55d1('0x31')](_0x2e043b[_0x55d1('0x32')],qs['fields'](_0x240026['query'][_0x55d1('0x34')]));_0xca2467[_0x55d1('0x33')]=_0xca2467[_0x55d1('0x33')][_0x55d1('0x35')]?_0xca2467['attributes']:_0x2e043b[_0x55d1('0x32')];if(!_0x240026['query']['hasOwnProperty']('nolimit')){_0xca2467[_0x55d1('0x1f')]=qs[_0x55d1('0x1f')](_0x240026[_0x55d1('0x2f')][_0x55d1('0x1f')]);_0xca2467[_0x55d1('0x1d')]=qs['offset'](_0x240026[_0x55d1('0x2f')][_0x55d1('0x1d')]);}_0xca2467[_0x55d1('0x36')]=qs[_0x55d1('0x37')](_0x240026[_0x55d1('0x2f')][_0x55d1('0x37')]);_0xca2467[_0x55d1('0x38')]=qs[_0x55d1('0x39')](_[_0x55d1('0x3a')](_0x240026[_0x55d1('0x2f')],_0x2e043b[_0x55d1('0x39')]),_0x126af0);if(_0x240026['query'][_0x55d1('0x3b')]){_0xca2467[_0x55d1('0x38')]=_[_0x55d1('0x3c')](_0xca2467[_0x55d1('0x38')],{'$or':_['map'](_0x126af0,function(_0x182fa6){if(_0x182fa6[_0x55d1('0x3d')]!==_0x55d1('0x3e')){var _0x1a038f={};_0x1a038f[_0x182fa6[_0x55d1('0x29')]]={'$like':'%'+_0x240026['query'][_0x55d1('0x3b')]+'%'};return _0x1a038f;}})});}_0xca2467=_['merge']({},_0xca2467,_0x240026[_0x55d1('0x3f')]);var _0x4a218a={'where':_0xca2467[_0x55d1('0x38')]};return db[_0x55d1('0x40')][_0x55d1('0x20')](_0x4a218a)[_0x55d1('0x25')](function(_0x29dd89){_0x3c550b[_0x55d1('0x20')]=_0x29dd89;if(_0x240026['query'][_0x55d1('0x41')]){_0xca2467[_0x55d1('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x55d1('0x43')](_0xca2467);})[_0x55d1('0x25')](function(_0x3dfb64){_0x3c550b[_0x55d1('0x44')]=_0x3dfb64;return _0x3c550b;})[_0x55d1('0x25')](respondWithFilteredResult(_0x330162,_0xca2467))[_0x55d1('0x45')](handleError(_0x330162,null));};exports[_0x55d1('0x46')]=function(_0x3fa5df,_0x4480a1){var _0x5209ec={'raw':!![],'where':{'id':_0x3fa5df[_0x55d1('0x47')]['id']}},_0x2c1857={};_0x2c1857[_0x55d1('0x32')]=_['keys'](db['OpenchannelTransferReport'][_0x55d1('0x48')]);_0x2c1857[_0x55d1('0x2f')]=_[_0x55d1('0x30')](_0x3fa5df[_0x55d1('0x2f')]);_0x2c1857['filters']=_[_0x55d1('0x31')](_0x2c1857[_0x55d1('0x32')],_0x2c1857[_0x55d1('0x2f')]);_0x5209ec[_0x55d1('0x33')]=_[_0x55d1('0x31')](_0x2c1857[_0x55d1('0x32')],qs['fields'](_0x3fa5df[_0x55d1('0x2f')][_0x55d1('0x34')]));_0x5209ec[_0x55d1('0x33')]=_0x5209ec[_0x55d1('0x33')][_0x55d1('0x35')]?_0x5209ec[_0x55d1('0x33')]:_0x2c1857[_0x55d1('0x32')];if(_0x3fa5df[_0x55d1('0x2f')][_0x55d1('0x41')]){_0x5209ec[_0x55d1('0x42')]=[{'all':!![]}];}_0x5209ec=_['merge']({},_0x5209ec,_0x3fa5df[_0x55d1('0x3f')]);return db[_0x55d1('0x40')]['find'](_0x5209ec)[_0x55d1('0x25')](handleEntityNotFound(_0x4480a1,null))[_0x55d1('0x25')](respondWithResult(_0x4480a1,null))[_0x55d1('0x45')](handleError(_0x4480a1,null));};exports[_0x55d1('0x49')]=function(_0x4d1f5b,_0x19e508){return db[_0x55d1('0x40')][_0x55d1('0x49')](_0x4d1f5b[_0x55d1('0x4a')],{})[_0x55d1('0x25')](respondWithResult(_0x19e508,0xc9))[_0x55d1('0x45')](handleError(_0x19e508,null));};exports[_0x55d1('0x4b')]=function(_0x1c52dc,_0x4057ac){if(_0x1c52dc[_0x55d1('0x4a')]['id']){delete _0x1c52dc['body']['id'];}return db[_0x55d1('0x40')][_0x55d1('0x4c')]({'where':{'id':_0x1c52dc['params']['id']}})[_0x55d1('0x25')](handleEntityNotFound(_0x4057ac,null))[_0x55d1('0x25')](saveUpdates(_0x1c52dc[_0x55d1('0x4a')],null))['then'](respondWithResult(_0x4057ac,null))[_0x55d1('0x45')](handleError(_0x4057ac,null));};exports[_0x55d1('0x26')]=function(_0x524a42,_0x141799){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x524a42[_0x55d1('0x47')]['id']}})[_0x55d1('0x25')](handleEntityNotFound(_0x141799,null))[_0x55d1('0x25')](removeEntity(_0x141799,null))[_0x55d1('0x45')](handleError(_0x141799,null));};exports[_0x55d1('0x4d')]=function(_0x5030ce,_0x12e3f4){return db[_0x55d1('0x40')][_0x55d1('0x4d')]()['then'](respondWithResult(_0x12e3f4,null))[_0x55d1('0x45')](handleError(_0x12e3f4,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 51266a1..f4254d1 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 _0x60db=['exports','define','report_openchannel_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x2f4e27,_0x4df9e2){var _0xc36999=function(_0x223a74){while(--_0x223a74){_0x2f4e27['push'](_0x2f4e27['shift']());}};_0xc36999(++_0x4df9e2);}(_0x60db,0x1e5));var _0xb60d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x60db[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0xb60d('0x0'));var logger=require(_0xb60d('0x1'))('api');var moment=require(_0xb60d('0x2'));var BPromise=require(_0xb60d('0x3'));var rp=require(_0xb60d('0x4'));var fs=require('fs');var path=require(_0xb60d('0x5'));var rimraf=require(_0xb60d('0x6'));var config=require(_0xb60d('0x7'));var attributes=require(_0xb60d('0x8'));module[_0xb60d('0x9')]=function(_0x1c7ef8,_0x54e442){return _0x1c7ef8[_0xb60d('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0xb60d('0xb'),'paranoid':![],'indexes':[{'name':_0xb60d('0xc'),'fields':[_0xb60d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1877=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x11fd7b,_0x416d45){var _0x26bb3b=function(_0x34fd23){while(--_0x34fd23){_0x11fd7b['push'](_0x11fd7b['shift']());}};_0x26bb3b(++_0x416d45);}(_0x1877,0x1cc));var _0x7187=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x1877[_0x2bddf9];return _0x3f3ae9;};'use strict';var _=require(_0x7187('0x0'));var util=require(_0x7187('0x1'));var logger=require('../../config/logger')(_0x7187('0x2'));var moment=require(_0x7187('0x3'));var BPromise=require(_0x7187('0x4'));var rp=require(_0x7187('0x5'));var fs=require('fs');var path=require(_0x7187('0x6'));var rimraf=require(_0x7187('0x7'));var config=require(_0x7187('0x8'));var attributes=require(_0x7187('0x9'));module[_0x7187('0xa')]=function(_0x337224,_0x4acc4f){return _0x337224['define'](_0x7187('0xb'),attributes,{'tableName':_0x7187('0xc'),'paranoid':![],'indexes':[{'name':_0x7187('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 8b2dd15..d0698b9 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 _0x47c7=['request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x2a5381,_0x1a959a){var _0xf1953f=function(_0x289b53){while(--_0x289b53){_0x2a5381['push'](_0x2a5381['shift']());}};_0xf1953f(++_0x1a959a);}(_0x47c7,0x1ab));var _0x747c=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x47c7[_0x30bd4d];return _0x306915;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var moment=require(_0x747c('0x1'));var BPromise=require(_0x747c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x747c('0x3'));var db=require(_0x747c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x747c('0x5'))(_0x747c('0x6'));var config=require(_0x747c('0x7'));var jayson=require(_0x747c('0x8'));var client=jayson['client'][_0x747c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eb6bc,_0xfc4504,_0x24206f){return new BPromise(function(_0x10b9f0,_0x21e0f1){return client[_0x747c('0xa')](_0x4eb6bc,_0x24206f)['then'](function(_0x47eac8){logger[_0x747c('0xb')](_0x747c('0xc'),_0xfc4504,_0x747c('0xd'));logger['debug'](_0x747c('0xe'),_0xfc4504,_0x747c('0xd'),JSON[_0x747c('0xf')](_0x47eac8));if(_0x47eac8['error']){if(_0x47eac8[_0x747c('0x10')]['code']===0x1f4){logger['error'](_0x747c('0xc'),_0xfc4504,_0x47eac8[_0x747c('0x10')][_0x747c('0x11')]);return _0x21e0f1(_0x47eac8[_0x747c('0x10')][_0x747c('0x11')]);}logger[_0x747c('0x10')](_0x747c('0xc'),_0xfc4504,_0x47eac8[_0x747c('0x10')][_0x747c('0x11')]);return _0x10b9f0(_0x47eac8[_0x747c('0x10')]['message']);}else{logger['info'](_0x747c('0xc'),_0xfc4504,_0x747c('0xd'));_0x10b9f0(_0x47eac8[_0x747c('0x12')]['message']);}})[_0x747c('0x13')](function(_0x1887d6){logger[_0x747c('0x10')](_0x747c('0xc'),_0xfc4504,_0x1887d6);_0x21e0f1(_0x1887d6);});});} \ No newline at end of file +var _0x31f0=['../../config/environment','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5f4777,_0x1df9ba){var _0x187998=function(_0x1458f7){while(--_0x1458f7){_0x5f4777['push'](_0x5f4777['shift']());}};_0x187998(++_0x1df9ba);}(_0x31f0,0xb7));var _0x031f=function(_0x28a36b,_0x5f3a09){_0x28a36b=_0x28a36b-0x0;var _0x41da91=_0x31f0[_0x28a36b];return _0x41da91;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 7f74e28..49dd4d0 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 _0xca6c=['index','get','show','post','isAuthenticated','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./pause.controller'];(function(_0x479341,_0x91784){var _0x42e88d=function(_0x43e2bd){while(--_0x43e2bd){_0x479341['push'](_0x479341['shift']());}};_0x42e88d(++_0x91784);}(_0xca6c,0xa1));var _0xcca6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xca6c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xcca6('0x0'));var util=require(_0xcca6('0x1'));var path=require(_0xcca6('0x2'));var timeout=require(_0xcca6('0x3'));var express=require(_0xcca6('0x4'));var router=express[_0xcca6('0x5')]();var fs_extra=require(_0xcca6('0x6'));var auth=require(_0xcca6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcca6('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xcca6('0x9')]);router[_0xcca6('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xcca6('0xb')]);router[_0xcca6('0xc')]('/',auth[_0xcca6('0xd')](),controller['create']);router[_0xcca6('0xe')](_0xcca6('0xf'),auth[_0xcca6('0xd')](),controller['update']);router['delete'](_0xcca6('0xf'),auth[_0xcca6('0xd')](),controller[_0xcca6('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf08f=['exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','create','/:id','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf08f,0x1c3));var _0xff08=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0xf08f[_0x2f2360];return _0x1cc8d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xff08('0x0'));var timeout=require(_0xff08('0x1'));var express=require(_0xff08('0x2'));var router=express[_0xff08('0x3')]();var fs_extra=require(_0xff08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xff08('0x5'));var config=require(_0xff08('0x6'));var controller=require('./pause.controller');router['get']('/',auth[_0xff08('0x7')](),controller[_0xff08('0x8')]);router[_0xff08('0x9')]('/:id',auth[_0xff08('0x7')](),controller['show']);router['post']('/',auth[_0xff08('0x7')](),controller[_0xff08('0xa')]);router['put'](_0xff08('0xb'),auth[_0xff08('0x7')](),controller[_0xff08('0xc')]);router['delete'](_0xff08('0xb'),auth['isAuthenticated'](),controller[_0xff08('0xd')]);module[_0xff08('0xe')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d9d5f85..f049b3b 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 _0x9e27=['sequelize','STRING','name'];(function(_0x4a0cd0,_0x89aec3){var _0xb27465=function(_0x307e2a){while(--_0x307e2a){_0x4a0cd0['push'](_0x4a0cd0['shift']());}};_0xb27465(++_0x89aec3);}(_0x9e27,0xa5));var _0x79e2=function(_0x36f984,_0x19826d){_0x36f984=_0x36f984-0x0;var _0x4f81ff=_0x9e27[_0x36f984];return _0x4f81ff;};'use strict';var Sequelize=require(_0x79e2('0x0'));module['exports']={'name':{'type':Sequelize[_0x79e2('0x1')],'unique':_0x79e2('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x79e2('0x1')]}}; \ No newline at end of file +var _0xd45a=['exports','STRING','name'];(function(_0x3b69e3,_0x40bb88){var _0x1f5b5e=function(_0x4fdd01){while(--_0x4fdd01){_0x3b69e3['push'](_0x3b69e3['shift']());}};_0x1f5b5e(++_0x40bb88);}(_0xd45a,0x1ef));var _0xad45=function(_0x27fbe0,_0x20f158){_0x27fbe0=_0x27fbe0-0x0;var _0x38ee34=_0xd45a[_0x27fbe0];return _0x38ee34;};'use strict';var Sequelize=require('sequelize');module[_0xad45('0x0')]={'name':{'type':Sequelize[_0xad45('0x1')],'unique':_0xad45('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xad45('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 22050c2..5458dc5 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 _0x7099=['destroy','sendStatus','error','stack','name','send','index','Pause','rawAttributes','fieldName','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','include','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','then','Pauses','UserProfileResource'];(function(_0x17e134,_0xab4565){var _0x30741f=function(_0x11c105){while(--_0x11c105){_0x17e134['push'](_0x17e134['shift']());}};_0x30741f(++_0xab4565);}(_0x7099,0x17f));var _0x9709=function(_0x47a196,_0x49d8f6){_0x47a196=_0x47a196-0x0;var _0x12406d=_0x7099[_0x47a196];return _0x12406d;};'use strict';var emlformat=require(_0x9709('0x0'));var rimraf=require(_0x9709('0x1'));var zipdir=require(_0x9709('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9709('0x3'));var moment=require(_0x9709('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9709('0x5'));var util=require(_0x9709('0x6'));var path=require(_0x9709('0x7'));var sox=require(_0x9709('0x8'));var csv=require('to-csv');var ejs=require(_0x9709('0x9'));var fs=require('fs');var fs_extra=require(_0x9709('0xa'));var _=require('lodash');var squel=require(_0x9709('0xb'));var crypto=require(_0x9709('0xc'));var jsforce=require(_0x9709('0xd'));var deskjs=require(_0x9709('0xe'));var toCsv=require(_0x9709('0xf'));var querystring=require(_0x9709('0x10'));var Papa=require('papaparse');var Redis=require(_0x9709('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9709('0x12'));var hardwareService=require(_0x9709('0x13'));var logger=require(_0x9709('0x14'))(_0x9709('0x15'));var utils=require(_0x9709('0x16'));var config=require(_0x9709('0x17'));var licenseUtil=require(_0x9709('0x18'));var db=require(_0x9709('0x19'))['db'];function respondWithStatusCode(_0x40a953,_0x1bcdc4){_0x1bcdc4=_0x1bcdc4||0xcc;return function(_0x65ce7c){if(_0x65ce7c){return _0x40a953['sendStatus'](_0x1bcdc4);}return _0x40a953['status'](_0x1bcdc4)[_0x9709('0x1a')]();};}function respondWithResult(_0x3b0add,_0x24388c){_0x24388c=_0x24388c||0xc8;return function(_0x32299c){if(_0x32299c){return _0x3b0add['status'](_0x24388c)[_0x9709('0x1b')](_0x32299c);}};}function respondWithFilteredResult(_0x44d9d8,_0x4b2e07){return function(_0x1a4fa8){if(_0x1a4fa8){var _0x49d909=typeof _0x4b2e07[_0x9709('0x1c')]===_0x9709('0x1d')&&typeof _0x4b2e07['limit']===_0x9709('0x1d');var _0xbc5c65=_0x1a4fa8[_0x9709('0x1e')];var _0x5a064d=_0x49d909?0x0:_0x4b2e07[_0x9709('0x1c')];var _0x13cf98=_0x49d909?_0x1a4fa8['count']:_0x4b2e07[_0x9709('0x1c')]+_0x4b2e07[_0x9709('0x1f')];var _0x51f7b6;if(_0x13cf98>=_0xbc5c65){_0x13cf98=_0xbc5c65;_0x51f7b6=0xc8;}else{_0x51f7b6=0xce;}_0x44d9d8[_0x9709('0x20')](_0x51f7b6);return _0x44d9d8[_0x9709('0x21')]('Content-Range',_0x5a064d+'-'+_0x13cf98+'/'+_0xbc5c65)[_0x9709('0x1b')](_0x1a4fa8);}return null;};}function patchUpdates(_0xbc2330){return function(_0x20cacf){try{jsonpatch['apply'](_0x20cacf,_0xbc2330,!![]);}catch(_0x364f28){return BPromise['reject'](_0x364f28);}return _0x20cacf['save']();};}function saveUpdates(_0x38988e,_0x3b8fbf){return function(_0x21eda3){if(_0x21eda3){return _0x21eda3['update'](_0x38988e)[_0x9709('0x22')](function(_0x1c39cb){return _0x1c39cb;});}return null;};}function removeEntity(_0x5f0744,_0x47c224){return function(_0x25ce01){if(_0x25ce01){return _0x25ce01['destroy']()[_0x9709('0x22')](function(){var _0x36223a=_0x25ce01['get']({'plain':!![]});var _0x1b11a5=_0x9709('0x23');return db[_0x9709('0x24')][_0x9709('0x25')]({'where':{'type':_0x1b11a5,'resourceId':_0x36223a['id']}})[_0x9709('0x22')](function(){return _0x25ce01;});})[_0x9709('0x22')](function(){_0x5f0744[_0x9709('0x20')](0xcc)[_0x9709('0x1a')]();});}};}function handleEntityNotFound(_0x1259db,_0x2ef55c){return function(_0x27be1b){if(!_0x27be1b){_0x1259db[_0x9709('0x26')](0x194);}return _0x27be1b;};}function handleError(_0x53076a,_0x255fc0){_0x255fc0=_0x255fc0||0x1f4;return function(_0x3cb9fe){logger[_0x9709('0x27')](_0x3cb9fe[_0x9709('0x28')]);if(_0x3cb9fe[_0x9709('0x29')]){delete _0x3cb9fe['name'];}_0x53076a[_0x9709('0x20')](_0x255fc0)[_0x9709('0x2a')](_0x3cb9fe);};}exports[_0x9709('0x2b')]=function(_0xcfdafb,_0x32ff3d){var _0x1f4c07={},_0xf7be91={},_0x2db2f8={'count':0x0,'rows':[]};var _0xde2cca=_['map'](db[_0x9709('0x2c')][_0x9709('0x2d')],function(_0xf83bcb){return{'name':_0xf83bcb[_0x9709('0x2e')],'type':_0xf83bcb['type']['key']};});_0xf7be91[_0x9709('0x2f')]=_[_0x9709('0x30')](_0xde2cca,_0x9709('0x29'));_0xf7be91[_0x9709('0x31')]=_[_0x9709('0x32')](_0xcfdafb[_0x9709('0x31')]);_0xf7be91['filters']=_[_0x9709('0x33')](_0xf7be91[_0x9709('0x2f')],_0xf7be91['query']);_0x1f4c07['attributes']=_[_0x9709('0x33')](_0xf7be91[_0x9709('0x2f')],qs[_0x9709('0x34')](_0xcfdafb['query'][_0x9709('0x34')]));_0x1f4c07[_0x9709('0x35')]=_0x1f4c07[_0x9709('0x35')][_0x9709('0x36')]?_0x1f4c07[_0x9709('0x35')]:_0xf7be91['model'];if(!_0xcfdafb[_0x9709('0x31')][_0x9709('0x37')](_0x9709('0x38'))){_0x1f4c07[_0x9709('0x1f')]=qs[_0x9709('0x1f')](_0xcfdafb[_0x9709('0x31')][_0x9709('0x1f')]);_0x1f4c07['offset']=qs[_0x9709('0x1c')](_0xcfdafb[_0x9709('0x31')][_0x9709('0x1c')]);}_0x1f4c07[_0x9709('0x39')]=qs[_0x9709('0x3a')](_0xcfdafb[_0x9709('0x31')][_0x9709('0x3a')]);_0x1f4c07[_0x9709('0x3b')]=qs[_0x9709('0x3c')](_[_0x9709('0x3d')](_0xcfdafb[_0x9709('0x31')],_0xf7be91['filters']),_0xde2cca);if(_0xcfdafb[_0x9709('0x31')][_0x9709('0x3e')]){_0x1f4c07['where']=_[_0x9709('0x3f')](_0x1f4c07[_0x9709('0x3b')],{'$or':_[_0x9709('0x30')](_0xde2cca,function(_0x2d62ce){if(_0x2d62ce[_0x9709('0x40')]!=='VIRTUAL'){var _0x3c42d3={};_0x3c42d3[_0x2d62ce[_0x9709('0x29')]]={'$like':'%'+_0xcfdafb[_0x9709('0x31')][_0x9709('0x3e')]+'%'};return _0x3c42d3;}})});}_0x1f4c07=_[_0x9709('0x3f')]({},_0x1f4c07,_0xcfdafb[_0x9709('0x41')]);var _0x3b97ed={'where':_0x1f4c07[_0x9709('0x3b')]};return db[_0x9709('0x2c')][_0x9709('0x1e')](_0x3b97ed)[_0x9709('0x22')](function(_0x45ddd3){_0x2db2f8[_0x9709('0x1e')]=_0x45ddd3;if(_0xcfdafb[_0x9709('0x31')]['includeAll']){_0x1f4c07[_0x9709('0x42')]=[{'all':!![]}];}return db[_0x9709('0x2c')]['findAll'](_0x1f4c07);})[_0x9709('0x22')](function(_0x25d477){_0x2db2f8[_0x9709('0x43')]=_0x25d477;return _0x2db2f8;})[_0x9709('0x22')](respondWithFilteredResult(_0x32ff3d,_0x1f4c07))[_0x9709('0x44')](handleError(_0x32ff3d,null));};exports[_0x9709('0x45')]=function(_0x2e694f,_0x3a105f){var _0x79c01d={'raw':!![],'where':{'id':_0x2e694f[_0x9709('0x46')]['id']}},_0x504fc5={};_0x504fc5[_0x9709('0x2f')]=_['keys'](db['Pause']['rawAttributes']);_0x504fc5[_0x9709('0x31')]=_[_0x9709('0x32')](_0x2e694f[_0x9709('0x31')]);_0x504fc5[_0x9709('0x3c')]=_[_0x9709('0x33')](_0x504fc5[_0x9709('0x2f')],_0x504fc5[_0x9709('0x31')]);_0x79c01d[_0x9709('0x35')]=_[_0x9709('0x33')](_0x504fc5['model'],qs['fields'](_0x2e694f[_0x9709('0x31')]['fields']));_0x79c01d[_0x9709('0x35')]=_0x79c01d[_0x9709('0x35')][_0x9709('0x36')]?_0x79c01d[_0x9709('0x35')]:_0x504fc5[_0x9709('0x2f')];if(_0x2e694f[_0x9709('0x31')][_0x9709('0x47')]){_0x79c01d['include']=[{'all':!![]}];}_0x79c01d=_[_0x9709('0x3f')]({},_0x79c01d,_0x2e694f['options']);return db[_0x9709('0x2c')][_0x9709('0x48')](_0x79c01d)[_0x9709('0x22')](handleEntityNotFound(_0x3a105f,null))[_0x9709('0x22')](respondWithResult(_0x3a105f,null))[_0x9709('0x44')](handleError(_0x3a105f,null));};exports[_0x9709('0x49')]=function(_0x101c6b,_0x384d9d){return db[_0x9709('0x2c')][_0x9709('0x49')](_0x101c6b[_0x9709('0x4a')],{})[_0x9709('0x22')](function(_0xd2993a){var _0x38764a=_0x101c6b[_0x9709('0x4b')][_0x9709('0x4c')]({'plain':!![]});if(!_0x38764a)throw new Error(_0x9709('0x4d'));if(_0x38764a[_0x9709('0x4e')]===_0x9709('0x4b')){var _0x245a45=_0xd2993a[_0x9709('0x4c')]({'plain':!![]});var _0x1368ae='Pauses';return db[_0x9709('0x4f')]['find']({'where':{'name':_0x1368ae,'userProfileId':_0x38764a[_0x9709('0x50')]},'raw':!![]})[_0x9709('0x22')](function(_0x3df237){if(_0x3df237&&_0x3df237[_0x9709('0x51')]===0x0){return db[_0x9709('0x24')][_0x9709('0x49')]({'name':_0x245a45[_0x9709('0x29')],'resourceId':_0x245a45['id'],'type':_0x3df237[_0x9709('0x29')],'sectionId':_0x3df237['id']},{})[_0x9709('0x22')](function(){return _0xd2993a;});}else{return _0xd2993a;}})[_0x9709('0x44')](function(_0x52fdf3){logger[_0x9709('0x27')](_0x9709('0x52'),_0x52fdf3);throw _0x52fdf3;});}return _0xd2993a;})[_0x9709('0x22')](respondWithResult(_0x384d9d,0xc9))[_0x9709('0x44')](handleError(_0x384d9d,null));};exports[_0x9709('0x53')]=function(_0x2fd5ef,_0x105029){if(_0x2fd5ef[_0x9709('0x4a')]['id']){delete _0x2fd5ef[_0x9709('0x4a')]['id'];}return db[_0x9709('0x2c')][_0x9709('0x48')]({'where':{'id':_0x2fd5ef[_0x9709('0x46')]['id']}})[_0x9709('0x22')](handleEntityNotFound(_0x105029,null))[_0x9709('0x22')](saveUpdates(_0x2fd5ef['body'],null))['then'](respondWithResult(_0x105029,null))[_0x9709('0x44')](handleError(_0x105029,null));};exports[_0x9709('0x25')]=function(_0xd19e59,_0x2a616d){return db[_0x9709('0x2c')]['find']({'where':{'id':_0xd19e59[_0x9709('0x46')]['id']}})[_0x9709('0x22')](handleEntityNotFound(_0x2a616d,null))[_0x9709('0x22')](removeEntity(_0x2a616d,null))['catch'](handleError(_0x2a616d,null));}; \ No newline at end of file +var _0x5d1b=['save','then','get','UserProfileResource','name','send','map','Pause','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply'];(function(_0x29ca3a,_0x118266){var _0x45371e=function(_0x3fe942){while(--_0x3fe942){_0x29ca3a['push'](_0x29ca3a['shift']());}};_0x45371e(++_0x118266);}(_0x5d1b,0x118));var _0xb5d1=function(_0x5f4699,_0x5d9944){_0x5f4699=_0x5f4699-0x0;var _0x4f0548=_0x5d1b[_0x5f4699];return _0x4f0548;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb5d1('0x0'));var jsonpatch=require(_0xb5d1('0x1'));var rp=require(_0xb5d1('0x2'));var moment=require(_0xb5d1('0x3'));var BPromise=require(_0xb5d1('0x4'));var Mustache=require('mustache');var util=require(_0xb5d1('0x5'));var path=require('path');var sox=require(_0xb5d1('0x6'));var csv=require(_0xb5d1('0x7'));var ejs=require(_0xb5d1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5d1('0x9'));var squel=require(_0xb5d1('0xa'));var crypto=require(_0xb5d1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb5d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb5d1('0xd'));var Papa=require(_0xb5d1('0xe'));var Redis=require(_0xb5d1('0xf'));var authService=require(_0xb5d1('0x10'));var qs=require(_0xb5d1('0x11'));var as=require(_0xb5d1('0x12'));var hardwareService=require(_0xb5d1('0x13'));var logger=require(_0xb5d1('0x14'))(_0xb5d1('0x15'));var utils=require(_0xb5d1('0x16'));var config=require(_0xb5d1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5d1('0x18'))['db'];function respondWithStatusCode(_0x16456b,_0x194b17){_0x194b17=_0x194b17||0xcc;return function(_0x43dfab){if(_0x43dfab){return _0x16456b[_0xb5d1('0x19')](_0x194b17);}return _0x16456b[_0xb5d1('0x1a')](_0x194b17)[_0xb5d1('0x1b')]();};}function respondWithResult(_0x1ffd22,_0x1d4194){_0x1d4194=_0x1d4194||0xc8;return function(_0x20e842){if(_0x20e842){return _0x1ffd22[_0xb5d1('0x1a')](_0x1d4194)['json'](_0x20e842);}};}function respondWithFilteredResult(_0x310cf7,_0xee5dba){return function(_0x4ad0d3){if(_0x4ad0d3){var _0x1f2c64=typeof _0xee5dba[_0xb5d1('0x1c')]===_0xb5d1('0x1d')&&typeof _0xee5dba['limit']===_0xb5d1('0x1d');var _0x1240eb=_0x4ad0d3['count'];var _0x1730e1=_0x1f2c64?0x0:_0xee5dba[_0xb5d1('0x1c')];var _0x3d3073=_0x1f2c64?_0x4ad0d3[_0xb5d1('0x1e')]:_0xee5dba[_0xb5d1('0x1c')]+_0xee5dba[_0xb5d1('0x1f')];var _0x2f07a1;if(_0x3d3073>=_0x1240eb){_0x3d3073=_0x1240eb;_0x2f07a1=0xc8;}else{_0x2f07a1=0xce;}_0x310cf7[_0xb5d1('0x1a')](_0x2f07a1);return _0x310cf7[_0xb5d1('0x20')](_0xb5d1('0x21'),_0x1730e1+'-'+_0x3d3073+'/'+_0x1240eb)[_0xb5d1('0x22')](_0x4ad0d3);}return null;};}function patchUpdates(_0x44dc03){return function(_0x56894e){try{jsonpatch[_0xb5d1('0x23')](_0x56894e,_0x44dc03,!![]);}catch(_0x4e6c08){return BPromise['reject'](_0x4e6c08);}return _0x56894e[_0xb5d1('0x24')]();};}function saveUpdates(_0x2380d2,_0x1850c1){return function(_0x41ef94){if(_0x41ef94){return _0x41ef94['update'](_0x2380d2)[_0xb5d1('0x25')](function(_0x25716a){return _0x25716a;});}return null;};}function removeEntity(_0x131833,_0x5a50a8){return function(_0x30f2d7){if(_0x30f2d7){return _0x30f2d7['destroy']()[_0xb5d1('0x25')](function(){var _0x2f0418=_0x30f2d7[_0xb5d1('0x26')]({'plain':!![]});var _0x308e1d='Pauses';return db[_0xb5d1('0x27')]['destroy']({'where':{'type':_0x308e1d,'resourceId':_0x2f0418['id']}})[_0xb5d1('0x25')](function(){return _0x30f2d7;});})[_0xb5d1('0x25')](function(){_0x131833[_0xb5d1('0x1a')](0xcc)[_0xb5d1('0x1b')]();});}};}function handleEntityNotFound(_0x2dd489,_0x2da4d4){return function(_0x1de91a){if(!_0x1de91a){_0x2dd489['sendStatus'](0x194);}return _0x1de91a;};}function handleError(_0x156b1d,_0x13345d){_0x13345d=_0x13345d||0x1f4;return function(_0x34aead){logger['error'](_0x34aead['stack']);if(_0x34aead[_0xb5d1('0x28')]){delete _0x34aead['name'];}_0x156b1d['status'](_0x13345d)[_0xb5d1('0x29')](_0x34aead);};}exports['index']=function(_0x3391ad,_0x3ff8e5){var _0x4fc619={},_0x14ad0c={},_0x3e2044={'count':0x0,'rows':[]};var _0x57c8a6=_[_0xb5d1('0x2a')](db[_0xb5d1('0x2b')][_0xb5d1('0x2c')],function(_0x2f5a43){return{'name':_0x2f5a43[_0xb5d1('0x2d')],'type':_0x2f5a43['type']['key']};});_0x14ad0c[_0xb5d1('0x2e')]=_[_0xb5d1('0x2a')](_0x57c8a6,_0xb5d1('0x28'));_0x14ad0c[_0xb5d1('0x2f')]=_[_0xb5d1('0x30')](_0x3391ad[_0xb5d1('0x2f')]);_0x14ad0c[_0xb5d1('0x31')]=_[_0xb5d1('0x32')](_0x14ad0c[_0xb5d1('0x2e')],_0x14ad0c['query']);_0x4fc619[_0xb5d1('0x33')]=_['intersection'](_0x14ad0c['model'],qs['fields'](_0x3391ad[_0xb5d1('0x2f')][_0xb5d1('0x34')]));_0x4fc619['attributes']=_0x4fc619['attributes'][_0xb5d1('0x35')]?_0x4fc619[_0xb5d1('0x33')]:_0x14ad0c['model'];if(!_0x3391ad['query'][_0xb5d1('0x36')](_0xb5d1('0x37'))){_0x4fc619[_0xb5d1('0x1f')]=qs[_0xb5d1('0x1f')](_0x3391ad[_0xb5d1('0x2f')][_0xb5d1('0x1f')]);_0x4fc619['offset']=qs[_0xb5d1('0x1c')](_0x3391ad[_0xb5d1('0x2f')][_0xb5d1('0x1c')]);}_0x4fc619[_0xb5d1('0x38')]=qs['sort'](_0x3391ad[_0xb5d1('0x2f')][_0xb5d1('0x39')]);_0x4fc619['where']=qs['filters'](_['pick'](_0x3391ad[_0xb5d1('0x2f')],_0x14ad0c[_0xb5d1('0x31')]),_0x57c8a6);if(_0x3391ad[_0xb5d1('0x2f')][_0xb5d1('0x3a')]){_0x4fc619[_0xb5d1('0x3b')]=_[_0xb5d1('0x3c')](_0x4fc619[_0xb5d1('0x3b')],{'$or':_[_0xb5d1('0x2a')](_0x57c8a6,function(_0xbc045c){if(_0xbc045c['type']!=='VIRTUAL'){var _0xdabc40={};_0xdabc40[_0xbc045c[_0xb5d1('0x28')]]={'$like':'%'+_0x3391ad[_0xb5d1('0x2f')][_0xb5d1('0x3a')]+'%'};return _0xdabc40;}})});}_0x4fc619=_[_0xb5d1('0x3c')]({},_0x4fc619,_0x3391ad[_0xb5d1('0x3d')]);var _0x818d81={'where':_0x4fc619[_0xb5d1('0x3b')]};return db[_0xb5d1('0x2b')][_0xb5d1('0x1e')](_0x818d81)[_0xb5d1('0x25')](function(_0xe8744d){_0x3e2044['count']=_0xe8744d;if(_0x3391ad[_0xb5d1('0x2f')][_0xb5d1('0x3e')]){_0x4fc619[_0xb5d1('0x3f')]=[{'all':!![]}];}return db[_0xb5d1('0x2b')][_0xb5d1('0x40')](_0x4fc619);})[_0xb5d1('0x25')](function(_0x4885e0){_0x3e2044[_0xb5d1('0x41')]=_0x4885e0;return _0x3e2044;})['then'](respondWithFilteredResult(_0x3ff8e5,_0x4fc619))[_0xb5d1('0x42')](handleError(_0x3ff8e5,null));};exports[_0xb5d1('0x43')]=function(_0x27c2c8,_0x3117ab){var _0x30339f={'raw':!![],'where':{'id':_0x27c2c8['params']['id']}},_0x2ea1c8={};_0x2ea1c8['model']=_['keys'](db[_0xb5d1('0x2b')][_0xb5d1('0x2c')]);_0x2ea1c8[_0xb5d1('0x2f')]=_[_0xb5d1('0x30')](_0x27c2c8['query']);_0x2ea1c8[_0xb5d1('0x31')]=_[_0xb5d1('0x32')](_0x2ea1c8[_0xb5d1('0x2e')],_0x2ea1c8[_0xb5d1('0x2f')]);_0x30339f[_0xb5d1('0x33')]=_['intersection'](_0x2ea1c8[_0xb5d1('0x2e')],qs[_0xb5d1('0x34')](_0x27c2c8[_0xb5d1('0x2f')][_0xb5d1('0x34')]));_0x30339f[_0xb5d1('0x33')]=_0x30339f[_0xb5d1('0x33')][_0xb5d1('0x35')]?_0x30339f[_0xb5d1('0x33')]:_0x2ea1c8[_0xb5d1('0x2e')];if(_0x27c2c8[_0xb5d1('0x2f')][_0xb5d1('0x3e')]){_0x30339f[_0xb5d1('0x3f')]=[{'all':!![]}];}_0x30339f=_[_0xb5d1('0x3c')]({},_0x30339f,_0x27c2c8[_0xb5d1('0x3d')]);return db[_0xb5d1('0x2b')][_0xb5d1('0x44')](_0x30339f)['then'](handleEntityNotFound(_0x3117ab,null))[_0xb5d1('0x25')](respondWithResult(_0x3117ab,null))[_0xb5d1('0x42')](handleError(_0x3117ab,null));};exports['create']=function(_0x112c80,_0x248de2){return db['Pause']['create'](_0x112c80[_0xb5d1('0x45')],{})[_0xb5d1('0x25')](function(_0x5b5cbc){var _0x275ad3=_0x112c80['user'][_0xb5d1('0x26')]({'plain':!![]});if(!_0x275ad3)throw new Error(_0xb5d1('0x46'));if(_0x275ad3[_0xb5d1('0x47')]===_0xb5d1('0x48')){var _0x733c8f=_0x5b5cbc[_0xb5d1('0x26')]({'plain':!![]});var _0x369595='Pauses';return db[_0xb5d1('0x49')]['find']({'where':{'name':_0x369595,'userProfileId':_0x275ad3['userProfileId']},'raw':!![]})[_0xb5d1('0x25')](function(_0x4526b9){if(_0x4526b9&&_0x4526b9[_0xb5d1('0x4a')]===0x0){return db[_0xb5d1('0x27')]['create']({'name':_0x733c8f['name'],'resourceId':_0x733c8f['id'],'type':_0x4526b9['name'],'sectionId':_0x4526b9['id']},{})[_0xb5d1('0x25')](function(){return _0x5b5cbc;});}else{return _0x5b5cbc;}})['catch'](function(_0x3a8e1a){logger[_0xb5d1('0x4b')](_0xb5d1('0x4c'),_0x3a8e1a);throw _0x3a8e1a;});}return _0x5b5cbc;})[_0xb5d1('0x25')](respondWithResult(_0x248de2,0xc9))[_0xb5d1('0x42')](handleError(_0x248de2,null));};exports[_0xb5d1('0x4d')]=function(_0x4fabcb,_0x52a548){if(_0x4fabcb[_0xb5d1('0x45')]['id']){delete _0x4fabcb[_0xb5d1('0x45')]['id'];}return db[_0xb5d1('0x2b')][_0xb5d1('0x44')]({'where':{'id':_0x4fabcb[_0xb5d1('0x4e')]['id']}})[_0xb5d1('0x25')](handleEntityNotFound(_0x52a548,null))[_0xb5d1('0x25')](saveUpdates(_0x4fabcb[_0xb5d1('0x45')],null))[_0xb5d1('0x25')](respondWithResult(_0x52a548,null))[_0xb5d1('0x42')](handleError(_0x52a548,null));};exports['destroy']=function(_0x4d952b,_0x569d70){return db['Pause'][_0xb5d1('0x44')]({'where':{'id':_0x4d952b[_0xb5d1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x569d70,null))[_0xb5d1('0x25')](removeEntity(_0x569d70,null))[_0xb5d1('0x42')](handleError(_0x569d70,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 7589a6c..006c593 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x3f3a6c,_0x56d73d){var _0x401fe2=function(_0xdbf940){while(--_0xdbf940){_0x3f3a6c['push'](_0x3f3a6c['shift']());}};_0x401fe2(++_0x56d73d);}(_0xabce,0x103));var _0xeabc=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xabce[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6aa7,0x178));var _0x76aa=function(_0x44aa14,_0x3c46fb){_0x44aa14=_0x44aa14-0x0;var _0x1bb303=_0x6aa7[_0x44aa14];return _0x1bb303;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 27b90e0..751b886 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(_0x495bf3,_0xc507b7){var _0x2f5977=function(_0x118ad3){while(--_0x118ad3){_0x495bf3['push'](_0x495bf3['shift']());}};_0x2f5977(++_0xc507b7);}(_0x7a54,0x106));var _0x47a5=function(_0x181800,_0x4a85b2){_0x181800=_0x181800-0x0;var _0x329076=_0x7a54[_0x181800];return _0x329076;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x32182c,_0x139684){var _0x5f46fd=function(_0x2bbfce){while(--_0x2bbfce){_0x32182c['push'](_0x32182c['shift']());}};_0x5f46fd(++_0x139684);}(_0x7a54,0x106));var _0x47a5=function(_0x8c7d72,_0x137949){_0x8c7d72=_0x8c7d72-0x0;var _0x5c0355=_0x7a54[_0x8c7d72];return _0x5c0355;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 78af6e9..5c0fab7 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 _0xb332=['server/files/plugins','originalname','replace','format','basename','extname','now','post','single','file','upload','/:id','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','root'];(function(_0x5af526,_0x4a1182){var _0x1c2809=function(_0x187bd2){while(--_0x187bd2){_0x5af526['push'](_0x5af526['shift']());}};_0x1c2809(++_0x4a1182);}(_0xb332,0xd9));var _0x2b33=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0xb332[_0x401676];return _0x4f13fe;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var timeout=require(_0x2b33('0x2'));var express=require('express');var router=express[_0x2b33('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b33('0x5'));var controller=require('./plugin.controller');router[_0x2b33('0x6')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0x8')]);router[_0x2b33('0x6')]('/webhook',controller['webhookGet']);router[_0x2b33('0x6')]('/:id',auth[_0x2b33('0x7')](),controller[_0x2b33('0x9')]);router[_0x2b33('0x6')](_0x2b33('0xa'),auth['isAuthenticated'](),controller[_0x2b33('0xb')]);var upload=multer({'storage':multer[_0x2b33('0xc')]({'destination':function(_0x1be19d,_0x1d83a6,_0x1989f3){_0x1989f3(null,path[_0x2b33('0xd')](config[_0x2b33('0xe')],_0x2b33('0xf')));},'filename':function(_0x1e0d36,_0x3969cb,_0xca2248){_0x3969cb['originalname']=_0x3969cb[_0x2b33('0x10')][_0x2b33('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xca2248(null,util[_0x2b33('0x12')]('%s-%s%s',path[_0x2b33('0x13')](_0x3969cb['originalname'],path[_0x2b33('0x14')](_0x3969cb[_0x2b33('0x10')])),Date[_0x2b33('0x15')](),path['extname'](_0x3969cb['originalname'])));}})});router[_0x2b33('0x16')]('/',upload[_0x2b33('0x17')](_0x2b33('0x18')),controller[_0x2b33('0x19')]);router[_0x2b33('0x16')]('/webhook',controller['webhookPost']);router['put'](_0x2b33('0x1a'),auth['isAuthenticated'](),controller['update']);router[_0x2b33('0x1b')](_0x2b33('0x1a'),auth[_0x2b33('0x7')](),controller['delete']);module[_0x2b33('0x1c')]=router; \ No newline at end of file +var _0xe14d=['isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','file','upload','/webhook','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x1ef9d,_0x24333e){var _0x2a374b=function(_0x3edbeb){while(--_0x3edbeb){_0x1ef9d['push'](_0x1ef9d['shift']());}};_0x2a374b(++_0x24333e);}(_0xe14d,0x1ee));var _0xde14=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe14d[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/webhook',controller[_0xde14('0xc')]);router[_0xde14('0x9')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0x9')](_0xde14('0xf'),auth[_0xde14('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xde14('0x10')]({'destination':function(_0xe785fb,_0x417269,_0x4357c7){_0x4357c7(null,path[_0xde14('0x11')](config[_0xde14('0x12')],_0xde14('0x13')));},'filename':function(_0x3d5a29,_0x34e28f,_0x29e3ca){_0x34e28f[_0xde14('0x14')]=_0x34e28f[_0xde14('0x14')][_0xde14('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29e3ca(null,util[_0xde14('0x16')](_0xde14('0x17'),path['basename'](_0x34e28f['originalname'],path[_0xde14('0x18')](_0x34e28f[_0xde14('0x14')])),Date[_0xde14('0x19')](),path['extname'](_0x34e28f[_0xde14('0x14')])));}})});router[_0xde14('0x1a')]('/',upload[_0xde14('0x1b')](_0xde14('0x1c')),controller[_0xde14('0x1d')]);router[_0xde14('0x1a')](_0xde14('0x1e'),controller[_0xde14('0x1f')]);router[_0xde14('0x20')](_0xde14('0xd'),auth['isAuthenticated'](),controller[_0xde14('0x21')]);router[_0xde14('0x22')](_0xde14('0xd'),auth[_0xde14('0xa')](),controller['delete']);module[_0xde14('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 13dcf94..89eda2e 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 _0x284b=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x4e3537,_0x3714dc){var _0x5763d9=function(_0x170ade){while(--_0x170ade){_0x4e3537['push'](_0x4e3537['shift']());}};_0x5763d9(++_0x3714dc);}(_0x284b,0x164));var _0xb284=function(_0x17cac3,_0xf8b34e){_0x17cac3=_0x17cac3-0x0;var _0x3704b8=_0x284b[_0x17cac3];return _0x3704b8;};'use strict';var Sequelize=require(_0xb284('0x0'));module[_0xb284('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb284('0x2')](_0xb284('0x3'),'script')},'description':{'type':Sequelize[_0xb284('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xb284('0x5')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xb284('0x6')],'defaultValue':0x0,'comment':_0xb284('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0xb284('0x8'),_0xb284('0x9'),_0xb284('0xa'),_0xb284('0xb')),'defaultValue':_0xb284('0xa'),'comment':_0xb284('0xc')},'icon':{'type':Sequelize[_0xb284('0x5')]},'adminUrl':{'type':Sequelize[_0xb284('0x5')]},'agentUrl':{'type':Sequelize[_0xb284('0x5')]},'scriptName':{'type':Sequelize[_0xb284('0x5')]},'scriptPath':{'type':Sequelize[_0xb284('0x5')]}}; \ No newline at end of file +var _0x1003=['ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','script','TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1003,0x84));var _0x3100=function(_0x4176df,_0x2f0e73){_0x4176df=_0x4176df-0x0;var _0x331bfe=_0x1003[_0x4176df];return _0x331bfe;};'use strict';var Sequelize=require(_0x3100('0x0'));module[_0x3100('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x3100('0x2'),_0x3100('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x3100('0x4')]},'path':{'type':Sequelize[_0x3100('0x5')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x3100('0x6')],'defaultValue':0x0,'comment':_0x3100('0x7')},'sidebar':{'type':Sequelize[_0x3100('0x8')](_0x3100('0x9'),_0x3100('0xa'),_0x3100('0xb'),_0x3100('0xc')),'defaultValue':_0x3100('0xb'),'comment':_0x3100('0xd')},'icon':{'type':Sequelize[_0x3100('0x5')]},'adminUrl':{'type':Sequelize[_0x3100('0x5')]},'agentUrl':{'type':Sequelize[_0x3100('0x5')]},'scriptName':{'type':Sequelize[_0x3100('0x5')]},'scriptPath':{'type':Sequelize[_0x3100('0x5')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 328262f..a34048f 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 _0x68f4=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','options','find','download','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','Plugins','UserProfileResource','destroy','end','error','name','send','index','map','Plugin','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x39928c,_0x5cd489){var _0x4a02ad=function(_0xeb8793){while(--_0xeb8793){_0x39928c['push'](_0x39928c['shift']());}};_0x4a02ad(++_0x5cd489);}(_0x68f4,0x6c));var _0x468f=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x68f4[_0x1147ab];return _0x55cb5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x468f('0x0'));var zipdir=require(_0x468f('0x1'));var jsonpatch=require(_0x468f('0x2'));var rp=require('request-promise');var moment=require(_0x468f('0x3'));var BPromise=require(_0x468f('0x4'));var Mustache=require(_0x468f('0x5'));var util=require(_0x468f('0x6'));var path=require('path');var sox=require(_0x468f('0x7'));var csv=require(_0x468f('0x8'));var ejs=require(_0x468f('0x9'));var fs=require('fs');var fs_extra=require(_0x468f('0xa'));var _=require(_0x468f('0xb'));var squel=require(_0x468f('0xc'));var crypto=require(_0x468f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x468f('0xe'));var toCsv=require(_0x468f('0x8'));var querystring=require(_0x468f('0xf'));var Papa=require(_0x468f('0x10'));var extract=require(_0x468f('0x11'));var rimraf=require(_0x468f('0x0'));var archiver=require(_0x468f('0x12'));var Redis=require(_0x468f('0x13'));var authService=require(_0x468f('0x14'));var qs=require(_0x468f('0x15'));var as=require(_0x468f('0x16'));var hardwareService=require(_0x468f('0x17'));var logger=require(_0x468f('0x18'))(_0x468f('0x19'));var utils=require(_0x468f('0x1a'));var config=require(_0x468f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x468f('0x1c'))['db'];config[_0x468f('0x1d')]=_[_0x468f('0x1e')](config[_0x468f('0x1d')],{'host':_0x468f('0x1f'),'port':0x18eb});var socket=require(_0x468f('0x20'))(new Redis(config['redis']));require(_0x468f('0x21'))['register'](socket);function respondWithStatusCode(_0x4f45d8,_0xd71b38){_0xd71b38=_0xd71b38||0xcc;return function(_0x2d5fdc){if(_0x2d5fdc){return _0x4f45d8[_0x468f('0x22')](_0xd71b38);}return _0x4f45d8[_0x468f('0x23')](_0xd71b38)['end']();};}function respondWithResult(_0x3b65c6,_0x3e16fd){_0x3e16fd=_0x3e16fd||0xc8;return function(_0x291957){if(_0x291957){return _0x3b65c6[_0x468f('0x23')](_0x3e16fd)[_0x468f('0x24')](_0x291957);}};}function respondWithFilteredResult(_0x542cef,_0x4034ce){return function(_0x4345d8){if(_0x4345d8){var _0x2a7489=typeof _0x4034ce[_0x468f('0x25')]===_0x468f('0x26')&&typeof _0x4034ce['limit']==='undefined';var _0x274d0a=_0x4345d8[_0x468f('0x27')];var _0x4a493f=_0x2a7489?0x0:_0x4034ce[_0x468f('0x25')];var _0x10fe30=_0x2a7489?_0x4345d8['count']:_0x4034ce['offset']+_0x4034ce[_0x468f('0x28')];var _0x4ab277;if(_0x10fe30>=_0x274d0a){_0x10fe30=_0x274d0a;_0x4ab277=0xc8;}else{_0x4ab277=0xce;}_0x542cef[_0x468f('0x23')](_0x4ab277);return _0x542cef[_0x468f('0x29')](_0x468f('0x2a'),_0x4a493f+'-'+_0x10fe30+'/'+_0x274d0a)[_0x468f('0x24')](_0x4345d8);}return null;};}function patchUpdates(_0x2fb43d){return function(_0x595383){try{jsonpatch[_0x468f('0x2b')](_0x595383,_0x2fb43d,!![]);}catch(_0x355c67){return BPromise['reject'](_0x355c67);}return _0x595383[_0x468f('0x2c')]();};}function saveUpdates(_0x422071,_0x5972fb){return function(_0x5bef30){if(_0x5bef30){return _0x5bef30[_0x468f('0x2d')](_0x422071)['then'](function(_0x2456c0){return _0x2456c0;});}return null;};}function removeEntity(_0x132244,_0x3a5a6b){return function(_0x207cd7){if(_0x207cd7){return _0x207cd7['destroy']()[_0x468f('0x2e')](function(){var _0x354a67=_0x207cd7[_0x468f('0x2f')]({'plain':!![]});var _0x28f36a=_0x468f('0x30');return db[_0x468f('0x31')][_0x468f('0x32')]({'where':{'type':_0x28f36a,'resourceId':_0x354a67['id']}})[_0x468f('0x2e')](function(){return _0x207cd7;});})[_0x468f('0x2e')](function(){_0x132244[_0x468f('0x23')](0xcc)[_0x468f('0x33')]();});}};}function handleEntityNotFound(_0x147d06,_0xad1b07){return function(_0x3bb5d4){if(!_0x3bb5d4){_0x147d06[_0x468f('0x22')](0x194);}return _0x3bb5d4;};}function handleError(_0x3c58ba,_0x2d89e8){_0x2d89e8=_0x2d89e8||0x1f4;return function(_0xb95228){logger[_0x468f('0x34')](_0xb95228['stack']);if(_0xb95228[_0x468f('0x35')]){delete _0xb95228[_0x468f('0x35')];}_0x3c58ba[_0x468f('0x23')](_0x2d89e8)[_0x468f('0x36')](_0xb95228);};}exports[_0x468f('0x37')]=function(_0x1dc87f,_0x2d5229){var _0x3b0d5c={},_0x5af3aa={},_0x4397b7={'count':0x0,'rows':[]};var _0x27640f=_[_0x468f('0x38')](db[_0x468f('0x39')]['rawAttributes'],function(_0x1c9c37){return{'name':_0x1c9c37['fieldName'],'type':_0x1c9c37[_0x468f('0x3a')][_0x468f('0x3b')]};});_0x5af3aa['model']=_[_0x468f('0x38')](_0x27640f,'name');_0x5af3aa[_0x468f('0x3c')]=_[_0x468f('0x3d')](_0x1dc87f[_0x468f('0x3c')]);_0x5af3aa[_0x468f('0x3e')]=_[_0x468f('0x3f')](_0x5af3aa['model'],_0x5af3aa['query']);_0x3b0d5c[_0x468f('0x40')]=_['intersection'](_0x5af3aa[_0x468f('0x41')],qs[_0x468f('0x42')](_0x1dc87f[_0x468f('0x3c')][_0x468f('0x42')]));_0x3b0d5c['attributes']=_0x3b0d5c['attributes'][_0x468f('0x43')]?_0x3b0d5c[_0x468f('0x40')]:_0x5af3aa['model'];if(!_0x1dc87f['query'][_0x468f('0x44')](_0x468f('0x45'))){_0x3b0d5c[_0x468f('0x28')]=qs[_0x468f('0x28')](_0x1dc87f[_0x468f('0x3c')][_0x468f('0x28')]);_0x3b0d5c[_0x468f('0x25')]=qs[_0x468f('0x25')](_0x1dc87f[_0x468f('0x3c')][_0x468f('0x25')]);}_0x3b0d5c[_0x468f('0x46')]=qs[_0x468f('0x47')](_0x1dc87f[_0x468f('0x3c')][_0x468f('0x47')]);_0x3b0d5c[_0x468f('0x48')]=qs['filters'](_[_0x468f('0x49')](_0x1dc87f[_0x468f('0x3c')],_0x5af3aa[_0x468f('0x3e')]),_0x27640f);if(_0x1dc87f[_0x468f('0x3c')][_0x468f('0x4a')]){_0x3b0d5c[_0x468f('0x48')]=_[_0x468f('0x4b')](_0x3b0d5c[_0x468f('0x48')],{'$or':_[_0x468f('0x38')](_0x27640f,function(_0x2c057b){if(_0x2c057b[_0x468f('0x3a')]!==_0x468f('0x4c')){var _0x51e5be={};_0x51e5be[_0x2c057b[_0x468f('0x35')]]={'$like':'%'+_0x1dc87f['query'][_0x468f('0x4a')]+'%'};return _0x51e5be;}})});}_0x3b0d5c=_[_0x468f('0x4b')]({},_0x3b0d5c,_0x1dc87f['options']);var _0x183523={'where':_0x3b0d5c[_0x468f('0x48')]};return db[_0x468f('0x39')]['count'](_0x183523)['then'](function(_0x39d1b0){_0x4397b7[_0x468f('0x27')]=_0x39d1b0;if(_0x1dc87f[_0x468f('0x3c')][_0x468f('0x4d')]){_0x3b0d5c[_0x468f('0x4e')]=[{'all':!![]}];}return db['Plugin'][_0x468f('0x4f')](_0x3b0d5c);})[_0x468f('0x2e')](function(_0x25951d){_0x4397b7['rows']=_0x25951d;return _0x4397b7;})['then'](respondWithFilteredResult(_0x2d5229,_0x3b0d5c))[_0x468f('0x50')](handleError(_0x2d5229,null));};exports['show']=function(_0x568c25,_0x143d7c){var _0x2b72bd={'raw':!![],'where':{'id':_0x568c25[_0x468f('0x51')]['id']}},_0x1f1cd7={};_0x1f1cd7[_0x468f('0x41')]=_['keys'](db[_0x468f('0x39')][_0x468f('0x52')]);_0x1f1cd7[_0x468f('0x3c')]=_[_0x468f('0x3d')](_0x568c25[_0x468f('0x3c')]);_0x1f1cd7[_0x468f('0x3e')]=_[_0x468f('0x3f')](_0x1f1cd7['model'],_0x1f1cd7[_0x468f('0x3c')]);_0x2b72bd[_0x468f('0x40')]=_[_0x468f('0x3f')](_0x1f1cd7[_0x468f('0x41')],qs[_0x468f('0x42')](_0x568c25[_0x468f('0x3c')][_0x468f('0x42')]));_0x2b72bd['attributes']=_0x2b72bd[_0x468f('0x40')][_0x468f('0x43')]?_0x2b72bd[_0x468f('0x40')]:_0x1f1cd7[_0x468f('0x41')];if(_0x568c25[_0x468f('0x3c')][_0x468f('0x4d')]){_0x2b72bd[_0x468f('0x4e')]=[{'all':!![]}];}_0x2b72bd=_[_0x468f('0x4b')]({},_0x2b72bd,_0x568c25[_0x468f('0x53')]);return db['Plugin'][_0x468f('0x54')](_0x2b72bd)[_0x468f('0x2e')](handleEntityNotFound(_0x143d7c,null))['then'](respondWithResult(_0x143d7c,null))[_0x468f('0x50')](handleError(_0x143d7c,null));};exports[_0x468f('0x55')]=function(_0x4f0707,_0x93618e,_0xc2edc6){return db[_0x468f('0x39')][_0x468f('0x54')]({'where':{'id':_0x4f0707[_0x468f('0x51')]['id']},'attributes':['name',_0x468f('0x56')],'raw':!![]})[_0x468f('0x2e')](handleEntityNotFound(_0x93618e,null))[_0x468f('0x2e')](function(_0x22a719){if(_0x22a719){var _0x47fe9e=path[_0x468f('0x57')](config[_0x468f('0x58')],_0x468f('0x59'),util[_0x468f('0x5a')](_0x468f('0x5b'),path[_0x468f('0x5c')](_0x22a719[_0x468f('0x56')])));var _0x490d92=fs[_0x468f('0x5d')](_0x47fe9e);var _0x1866cd=archiver(_0x468f('0x5e'),{'zlib':{'level':0x9}});_0x1866cd['on'](_0x468f('0x5f'),function(_0x56ecd8){if(_0x56ecd8[_0x468f('0x60')]===_0x468f('0x61')){logger[_0x468f('0x34')](_0x56ecd8);}else{throw new db['Sequelize'][(_0x468f('0x62'))](_0x468f('0x63'));}});_0x1866cd['on'](_0x468f('0x34'),function(_0x20f56e){throw new db[(_0x468f('0x64'))]['Error'](_0x468f('0x63'));});_0x1866cd['pipe'](_0x490d92);_0x1866cd[_0x468f('0x65')](_0x468f('0x66'),{'cwd':path[_0x468f('0x57')](config[_0x468f('0x58')],_0x468f('0x59'),path['dirname'](_0x22a719[_0x468f('0x56')])),'ignore':[path[_0x468f('0x57')](path[_0x468f('0x5c')](_0x22a719[_0x468f('0x56')]),'node_modules/**/*'),path[_0x468f('0x57')](path['basename'](_0x22a719[_0x468f('0x56')]),'attachments/**/*')],'nodir':!![]})[_0x468f('0x67')]();_0x490d92['on'](_0x468f('0x68'),function(){if(!fs[_0x468f('0x69')](_0x47fe9e)){throw new db[(_0x468f('0x64'))][(_0x468f('0x62'))](_0x468f('0x6a'));}return _0x93618e[_0x468f('0x55')](_0x47fe9e,util[_0x468f('0x5a')](_0x468f('0x5b'),path[_0x468f('0x5c')](_0x22a719[_0x468f('0x56')])),function(_0x5816e3){if(_0x5816e3){throw new db[(_0x468f('0x64'))][(_0x468f('0x62'))](_0x468f('0x6b'));}fs[_0x468f('0x6c')](_0x47fe9e);logger[_0x468f('0x6d')](_0x468f('0x6e'));logger[_0x468f('0x6d')](_0x468f('0x6f'));});});}return null;})['catch'](handleError(_0x93618e,null));};exports[_0x468f('0x70')]=function(_0x2203f9,_0x2e003b,_0x190fca){var _0x47d38e=path[_0x468f('0x5c')](_0x2203f9[_0x468f('0x71')][_0x468f('0x72')],path[_0x468f('0x73')](_0x2203f9[_0x468f('0x71')][_0x468f('0x72')]));var _0x258ebf=path['join'](config['root'],_0x468f('0x59'),_0x2203f9[_0x468f('0x71')]['filename']);var _0x183e10=path[_0x468f('0x57')](config[_0x468f('0x58')],_0x468f('0x59'),_0x47d38e);logger['info'](_0x468f('0x74'),_0x258ebf);logger['info'](_0x468f('0x75'),_0x183e10);try{fs[_0x468f('0x76')](_0x258ebf,parseInt(_0x468f('0x77'),0x8));extract(_0x258ebf,{'dir':_0x183e10},function(_0x53cc33){if(_0x53cc33){logger['error'](_0x53cc33);handleError(_0x53cc33,!![]);};var _0x4911f9=fs['readdirSync'](_0x183e10);if(_0x4911f9[_0x468f('0x43')]>0x1){removeReferences(_0x258ebf,_0x183e10);logger[_0x468f('0x34')]('Invalid\x20plugin\x20structure');return _0x190fca(new Error(_0x468f('0x78')));}var _0x3cb71d=fs[_0x468f('0x79')](path[_0x468f('0x57')](_0x183e10,_0x4911f9[0x0]));if(_0x3cb71d[_0x468f('0x7a')]()){removeReferences(_0x258ebf,_0x183e10);logger[_0x468f('0x34')](_0x468f('0x78'));return _0x190fca(new Error(_0x468f('0x78')));}if(_0x3cb71d[_0x468f('0x7b')]()){var _0x5e0b64=fs[_0x468f('0x7c')](path[_0x468f('0x57')](_0x183e10,_0x4911f9[0x0]));if(_0x5e0b64[_0x468f('0x43')]===0x0){removeReferences(_0x258ebf,_0x183e10);logger[_0x468f('0x34')](_0x468f('0x78'));return _0x190fca(new Error(_0x468f('0x78')));}var _0x6aede4=_0x5e0b64[_0x468f('0x7d')](function(_0x263f2a){return _0x263f2a==='manifest.json';});if(!_0x6aede4){return _0x190fca(new Error('Plugin\x20manifest\x20missing'));}var _0x5094c9=fs[_0x468f('0x7e')](path['join'](_0x183e10,_0x4911f9[0x0],_0x468f('0x7f')));var _0x55170a=JSON['parse'](_0x5094c9);if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x35')]){return _0x190fca(new Error(_0x468f('0x80')));}if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x3a')]){return _0x190fca(new Error(_0x468f('0x81')));}if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x82')]){return _0x190fca(new Error(_0x468f('0x83')));}if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x84')]){return _0x190fca(new Error(_0x468f('0x85')));}if(_0x55170a[_0x468f('0x3a')]===_0x468f('0x86')){if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x84')][_0x468f('0x87')]){return _0x190fca(new Error(_0x468f('0x88')));}if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x84')][_0x468f('0x87')][_0x468f('0x89')]&&_0x468f('0x26')==typeof _0x55170a['parameters'][_0x468f('0x87')][_0x468f('0x8a')]){return _0x190fca(new Error(_0x468f('0x8b')));}}else if(_0x55170a[_0x468f('0x3a')]===_0x468f('0x8c')){if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x84')][_0x468f('0x8d')]){return _0x190fca(new Error(_0x468f('0x8e')));}if(_0x468f('0x26')==typeof _0x55170a[_0x468f('0x84')]['scriptPath']){return _0x190fca(new Error(_0x468f('0x8f')));}}else{return _0x190fca(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x4d1557=_0x55170a[_0x468f('0x35')];var _0xe820ee=_0x55170a[_0x468f('0x90')];var _0x32cd44=_0x55170a[_0x468f('0x3a')];var _0x2bf5b0=_0x55170a[_0x468f('0x91')]?_0x55170a[_0x468f('0x91')]:_0x468f('0x92');var _0xae41e6=_0x55170a['icon']?_0x55170a[_0x468f('0x93')]:_0x468f('0x94');var _0x45d8b2='';var _0x763444='';var _0x156c90='';var _0x4a7a46='';var _0x221dc8=_0x55170a[_0x468f('0x82')];if(_0x32cd44===_0x468f('0x86')){if(_0x468f('0x26')!=typeof _0x55170a[_0x468f('0x84')][_0x468f('0x87')][_0x468f('0x89')]){var _0x5a402b=_0x55170a['parameters'][_0x468f('0x87')][_0x468f('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x468f('0x95')](_0x5a402b)){_0x45d8b2=path['join'](_0x468f('0x96'),_0x47d38e,_0x4911f9[0x0],_0x5a402b);}else{_0x45d8b2=_0x5a402b;}}else{logger[_0x468f('0x6d')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x468f('0x26')!=typeof _0x55170a['parameters'][_0x468f('0x87')][_0x468f('0x8a')]){var _0x1dc961=_0x55170a['parameters'][_0x468f('0x87')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1dc961)){_0x763444=path[_0x468f('0x57')](_0x468f('0x96'),_0x47d38e,_0x4911f9[0x0],_0x1dc961);}else{_0x763444=_0x1dc961;}}else{logger[_0x468f('0x6d')](_0x468f('0x97'));}}else if(_0x32cd44===_0x468f('0x8c')){_0x156c90=_0x55170a[_0x468f('0x84')]['scriptName'];_0x4a7a46=_0x55170a['parameters'][_0x468f('0x98')];if(_0x468f('0x26')!=typeof _0x55170a['parameters'][_0x468f('0x87')]){if('undefined'!=typeof _0x55170a[_0x468f('0x84')][_0x468f('0x87')][_0x468f('0x89')]){var _0x5a402b=_0x55170a['parameters'][_0x468f('0x87')][_0x468f('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x468f('0x95')](_0x5a402b)){_0x45d8b2=path[_0x468f('0x57')](_0x468f('0x96'),_0x47d38e,_0x4911f9[0x0],_0x5a402b);}else{_0x45d8b2=_0x5a402b;}}if(_0x468f('0x26')!=typeof _0x55170a[_0x468f('0x84')][_0x468f('0x87')][_0x468f('0x8a')]){var _0x1dc961=_0x55170a[_0x468f('0x84')]['views'][_0x468f('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x468f('0x95')](_0x1dc961)){_0x763444=path['join'](_0x468f('0x96'),_0x47d38e,_0x4911f9[0x0],_0x1dc961);}else{_0x763444=_0x1dc961;}}}}var _0x4c1027={'name':_0x4d1557,'description':_0xe820ee,'path':path[_0x468f('0x57')](_0x47d38e,_0x4911f9[0x0]),'type':_0x32cd44,'sidebar':_0x2bf5b0,'icon':_0xae41e6,'adminUrl':_0x45d8b2,'agentUrl':_0x763444,'scriptName':_0x156c90,'scriptPath':_0x4a7a46,'version':_0x221dc8};removeReferences(_0x258ebf,null);return db[_0x468f('0x39')][_0x468f('0x99')](_0x4c1027)[_0x468f('0x2e')](function(_0x381193){var _0x41c4f0={'role':_0x2203f9[_0x468f('0x9a')][_0x468f('0x9b')],'userProfileId':_0x2203f9[_0x468f('0x9a')]['userProfileId']};if(!_0x41c4f0)throw new Error(_0x468f('0x9c'));if(_0x41c4f0[_0x468f('0x9b')]===_0x468f('0x9d')){var _0x37f263=_0x381193['get']({'plain':!![]});return db[_0x468f('0x9e')][_0x468f('0x54')]({'where':{'name':_0x468f('0x30'),'userProfileId':_0x41c4f0[_0x468f('0x9f')]},'raw':!![]})[_0x468f('0x2e')](function(_0x9d37b0){if(_0x9d37b0&&_0x9d37b0[_0x468f('0xa0')]===0x0){return db[_0x468f('0x31')][_0x468f('0x99')]({'name':_0x37f263[_0x468f('0x35')],'resourceId':_0x37f263['id'],'type':_0x9d37b0[_0x468f('0x35')],'sectionId':_0x9d37b0['id']},{})['then'](function(){return _0x381193;});}else{return _0x381193;}})[_0x468f('0x50')](function(_0x1a50f0){logger[_0x468f('0x34')](_0x468f('0xa1'),_0x1a50f0);throw _0x1a50f0;});}return _0x381193;})[_0x468f('0x2e')](respondWithResult(_0x2e003b,null))[_0x468f('0x50')](handleError(_0x2e003b,null));}});}catch(_0x2cc49c){_0x2e003b['status'](0x1f4)[_0x468f('0x36')](_0x2cc49c);}};function removeReferences(_0x550697,_0x520f53){try{if(_0x550697){fs[_0x468f('0x6c')](_0x550697);logger[_0x468f('0x6d')]('Zip\x20archive\x20removed');}if(_0x520f53){rimraf(_0x520f53,function(){});logger[_0x468f('0x6d')](_0x468f('0xa2'));}}catch(_0x4bd24f){logger[_0x468f('0x34')](_0x4bd24f);}}exports[_0x468f('0x2d')]=function(_0x4a9519,_0x3f07de,_0x5efd4b){return db[_0x468f('0x39')]['find']({'where':{'id':_0x4a9519[_0x468f('0x51')]['id']}})[_0x468f('0x2e')](handleEntityNotFound(_0x3f07de,null))[_0x468f('0x2e')](saveUpdates(_0x4a9519[_0x468f('0x9a')],null))[_0x468f('0x2e')](respondWithResult(_0x3f07de,null))[_0x468f('0x50')](handleError(_0x3f07de,null));};exports[_0x468f('0xa3')]=function(_0x19ad10,_0x15202b,_0x6a17d3){return db[_0x468f('0x39')][_0x468f('0x54')]({'where':{'id':_0x19ad10[_0x468f('0x51')]['id']}})[_0x468f('0x2e')](function(_0x3b7822){if(_0x3b7822){return _0x3b7822[_0x468f('0x32')]();}})[_0x468f('0x2e')](function(_0x860fbf){rimraf(path[_0x468f('0x57')](config[_0x468f('0x58')],'server/files/plugins',path[_0x468f('0xa4')](_0x860fbf[_0x468f('0x56')])),function(){});return _0x860fbf;})[_0x468f('0x2e')](handleEntityNotFound(_0x15202b,null))['then'](respondWithStatusCode(_0x15202b,null))[_0x468f('0x50')](handleError(_0x15202b,null));};exports[_0x468f('0xa5')]=function(_0x4a02f5,_0x2db1fb,_0x1b583c){return BPromise[_0x468f('0xa6')]()[_0x468f('0x2e')](function(){if(!_0x4a02f5[_0x468f('0x3c')][_0x468f('0x56')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4a02f5[_0x468f('0x3c')]['port']){throw new Error(_0x468f('0xa7'));}var _0x45b5b8=_0x4a02f5[_0x468f('0x3c')][_0x468f('0xa8')]?_0x4a02f5[_0x468f('0x3c')][_0x468f('0xa8')]+':'+_0x4a02f5[_0x468f('0x3c')][_0x468f('0xa9')]:_0x468f('0xaa')+_0x4a02f5[_0x468f('0x3c')][_0x468f('0xa9')];var _0x39fcca=_0x4a02f5[_0x468f('0x3c')][_0x468f('0x24')]?_0x4a02f5[_0x468f('0x3c')][_0x468f('0x24')]:!![];var _0xe8321a=_0x4a02f5[_0x468f('0x3c')][_0x468f('0xab')]?_0x4a02f5[_0x468f('0x3c')]['encoding']:null;var _0x4604e9={'method':_0x4a02f5[_0x468f('0xac')],'uri':util[_0x468f('0x5a')](_0x468f('0xad'),_0x45b5b8,_0x4a02f5['query'][_0x468f('0x56')]),'json':_0x39fcca,'resolveWithFullResponse':!![],'encoding':_0xe8321a,'qs':_0x4a02f5[_0x468f('0x3c')]};if(_0x4a02f5['headers']){_0x4604e9[_0x468f('0xae')]=_0x4a02f5[_0x468f('0xae')];if(_0x4604e9[_0x468f('0xae')][_0x468f('0xaf')]){delete _0x4604e9['headers'][_0x468f('0xaf')];}}if(_0x4604e9[_0x468f('0xae')][_0x468f('0xb0')]){delete _0x4604e9[_0x468f('0xae')][_0x468f('0xb0')];}return rp(_0x4604e9);})[_0x468f('0x2e')](function(_0x2d6891){if(_0x2d6891){_0x2db1fb['set'](_0x2d6891['headers']);logger[_0x468f('0x6d')](_0x2d6891[_0x468f('0x9a')]);if(_[_0x468f('0xb1')](_0x4a02f5[_0x468f('0x3c')][_0x468f('0x56')],_0x468f('0x55'))&&_0x2d6891[_0x468f('0xb2')]==0x1f4){return _0x2db1fb[_0x468f('0x22')](_0x2d6891[_0x468f('0xb2')]);}else{return _0x2db1fb[_0x468f('0x23')](_0x2d6891[_0x468f('0xb2')])[_0x468f('0x36')](_0x2d6891[_0x468f('0x9a')]);}}else{return _0x2db1fb[_0x468f('0x22')](0xc8);}})[_0x468f('0x50')](handleError(_0x2db1fb,null));};exports[_0x468f('0xb3')]=function(_0x59313d,_0x10de4d,_0xab3061){return BPromise[_0x468f('0xa6')]()['then'](function(){if(!_0x59313d['query']['path']){throw new Error(_0x468f('0xb4'));}if(!_0x59313d[_0x468f('0x3c')]['port']){throw new Error(_0x468f('0xa7'));}var _0x58e4eb=_0x59313d[_0x468f('0x3c')]['hostname']?_0x59313d[_0x468f('0x3c')]['hostname']+':'+_0x59313d[_0x468f('0x3c')][_0x468f('0xa9')]:'http://localhost:'+_0x59313d['query']['port'];var _0x34230b=_0x59313d[_0x468f('0x3c')]['json']?_0x59313d[_0x468f('0x3c')][_0x468f('0x24')]:!![];var _0x140a7f=_0x59313d[_0x468f('0x3c')][_0x468f('0xab')]?_0x59313d[_0x468f('0x3c')][_0x468f('0xab')]:null;var _0xa44551={'method':_0x59313d[_0x468f('0xac')],'uri':util[_0x468f('0x5a')](_0x468f('0xad'),_0x58e4eb,_0x59313d[_0x468f('0x3c')]['path']),'json':_0x34230b,'resolveWithFullResponse':!![],'encoding':_0x140a7f,'body':_0x59313d[_0x468f('0x9a')]};if(_0x59313d[_0x468f('0xae')]){_0xa44551[_0x468f('0xae')]=_0x59313d[_0x468f('0xae')];if(_0xa44551[_0x468f('0xae')][_0x468f('0xaf')]){delete _0xa44551[_0x468f('0xae')][_0x468f('0xaf')];}}if(_0xa44551['headers'][_0x468f('0xb0')]){delete _0xa44551[_0x468f('0xae')][_0x468f('0xb0')];}return rp(_0xa44551);})[_0x468f('0x2e')](function(_0x13e3eb){if(_0x13e3eb){_0x10de4d[_0x468f('0x29')](_0x13e3eb[_0x468f('0xae')]);logger[_0x468f('0x6d')](_0x13e3eb[_0x468f('0x9a')]);return _0x10de4d[_0x468f('0x23')](_0x13e3eb[_0x468f('0xb2')])[_0x468f('0x36')](_0x13e3eb[_0x468f('0x9a')]);}else{return _0x10de4d[_0x468f('0x22')](0xc8);}})[_0x468f('0x50')](handleError(_0x10de4d,null));}; \ No newline at end of file +var _0xcfbc=['Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','type','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\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','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','content-type','set','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','Plugins','UserProfileResource','error','stack','name','index','map','Plugin','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','options','find','catch','download','params','server/files/plugins','format','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','root','join','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','readdirSync','manifest.json'];(function(_0x567312,_0x33020e){var _0xea4df1=function(_0x4a9ada){while(--_0x4a9ada){_0x567312['push'](_0x567312['shift']());}};_0xea4df1(++_0x33020e);}(_0xcfbc,0x1a0));var _0xccfb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfbc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xccfb('0x0'));var jsonpatch=require(_0xccfb('0x1'));var rp=require(_0xccfb('0x2'));var moment=require(_0xccfb('0x3'));var BPromise=require(_0xccfb('0x4'));var Mustache=require('mustache');var util=require(_0xccfb('0x5'));var path=require(_0xccfb('0x6'));var sox=require('sox');var csv=require(_0xccfb('0x7'));var ejs=require(_0xccfb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xccfb('0x9'));var squel=require(_0xccfb('0xa'));var crypto=require(_0xccfb('0xb'));var jsforce=require(_0xccfb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xccfb('0x7'));var querystring=require(_0xccfb('0xd'));var Papa=require(_0xccfb('0xe'));var extract=require('extract-zip');var rimraf=require(_0xccfb('0xf'));var archiver=require(_0xccfb('0x10'));var Redis=require(_0xccfb('0x11'));var authService=require(_0xccfb('0x12'));var qs=require(_0xccfb('0x13'));var as=require(_0xccfb('0x14'));var hardwareService=require(_0xccfb('0x15'));var logger=require('../../config/logger')(_0xccfb('0x16'));var utils=require(_0xccfb('0x17'));var config=require(_0xccfb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xccfb('0x19'))['db'];config[_0xccfb('0x1a')]=_['defaults'](config[_0xccfb('0x1a')],{'host':_0xccfb('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xccfb('0x1a')]));require(_0xccfb('0x1c'))[_0xccfb('0x1d')](socket);function respondWithStatusCode(_0x2dfec7,_0x367405){_0x367405=_0x367405||0xcc;return function(_0x2ee4d9){if(_0x2ee4d9){return _0x2dfec7[_0xccfb('0x1e')](_0x367405);}return _0x2dfec7[_0xccfb('0x1f')](_0x367405)[_0xccfb('0x20')]();};}function respondWithResult(_0x4cf4b7,_0x3bf90f){_0x3bf90f=_0x3bf90f||0xc8;return function(_0x28df4c){if(_0x28df4c){return _0x4cf4b7['status'](_0x3bf90f)[_0xccfb('0x21')](_0x28df4c);}};}function respondWithFilteredResult(_0x1323d7,_0x38e852){return function(_0x596a39){if(_0x596a39){var _0x3bb643=typeof _0x38e852[_0xccfb('0x22')]==='undefined'&&typeof _0x38e852[_0xccfb('0x23')]==='undefined';var _0x423554=_0x596a39['count'];var _0x39df4b=_0x3bb643?0x0:_0x38e852[_0xccfb('0x22')];var _0x5caf34=_0x3bb643?_0x596a39[_0xccfb('0x24')]:_0x38e852[_0xccfb('0x22')]+_0x38e852['limit'];var _0x289349;if(_0x5caf34>=_0x423554){_0x5caf34=_0x423554;_0x289349=0xc8;}else{_0x289349=0xce;}_0x1323d7['status'](_0x289349);return _0x1323d7['set'](_0xccfb('0x25'),_0x39df4b+'-'+_0x5caf34+'/'+_0x423554)[_0xccfb('0x21')](_0x596a39);}return null;};}function patchUpdates(_0x2c00bc){return function(_0x3c2bd3){try{jsonpatch['apply'](_0x3c2bd3,_0x2c00bc,!![]);}catch(_0x588c22){return BPromise[_0xccfb('0x26')](_0x588c22);}return _0x3c2bd3[_0xccfb('0x27')]();};}function saveUpdates(_0x4a67a9,_0x59ecf5){return function(_0x567b9b){if(_0x567b9b){return _0x567b9b[_0xccfb('0x28')](_0x4a67a9)[_0xccfb('0x29')](function(_0x9c65c8){return _0x9c65c8;});}return null;};}function removeEntity(_0x3a901a,_0xe3a759){return function(_0x4f8a8d){if(_0x4f8a8d){return _0x4f8a8d[_0xccfb('0x2a')]()[_0xccfb('0x29')](function(){var _0x313e04=_0x4f8a8d['get']({'plain':!![]});var _0x1ab9e6=_0xccfb('0x2b');return db[_0xccfb('0x2c')][_0xccfb('0x2a')]({'where':{'type':_0x1ab9e6,'resourceId':_0x313e04['id']}})['then'](function(){return _0x4f8a8d;});})['then'](function(){_0x3a901a[_0xccfb('0x1f')](0xcc)[_0xccfb('0x20')]();});}};}function handleEntityNotFound(_0x357ca1,_0x1d098d){return function(_0xe7a9bf){if(!_0xe7a9bf){_0x357ca1['sendStatus'](0x194);}return _0xe7a9bf;};}function handleError(_0x4d2786,_0x5585b1){_0x5585b1=_0x5585b1||0x1f4;return function(_0x4cf8ca){logger[_0xccfb('0x2d')](_0x4cf8ca[_0xccfb('0x2e')]);if(_0x4cf8ca[_0xccfb('0x2f')]){delete _0x4cf8ca['name'];}_0x4d2786['status'](_0x5585b1)['send'](_0x4cf8ca);};}exports[_0xccfb('0x30')]=function(_0x56938a,_0x3085a8){var _0x479579={},_0x28cd4b={},_0x398612={'count':0x0,'rows':[]};var _0x56e20b=_[_0xccfb('0x31')](db[_0xccfb('0x32')][_0xccfb('0x33')],function(_0x79df6c){return{'name':_0x79df6c[_0xccfb('0x34')],'type':_0x79df6c['type'][_0xccfb('0x35')]};});_0x28cd4b[_0xccfb('0x36')]=_['map'](_0x56e20b,_0xccfb('0x2f'));_0x28cd4b[_0xccfb('0x37')]=_[_0xccfb('0x38')](_0x56938a['query']);_0x28cd4b['filters']=_[_0xccfb('0x39')](_0x28cd4b[_0xccfb('0x36')],_0x28cd4b[_0xccfb('0x37')]);_0x479579[_0xccfb('0x3a')]=_[_0xccfb('0x39')](_0x28cd4b['model'],qs[_0xccfb('0x3b')](_0x56938a[_0xccfb('0x37')][_0xccfb('0x3b')]));_0x479579[_0xccfb('0x3a')]=_0x479579[_0xccfb('0x3a')][_0xccfb('0x3c')]?_0x479579[_0xccfb('0x3a')]:_0x28cd4b[_0xccfb('0x36')];if(!_0x56938a[_0xccfb('0x37')][_0xccfb('0x3d')]('nolimit')){_0x479579[_0xccfb('0x23')]=qs['limit'](_0x56938a[_0xccfb('0x37')]['limit']);_0x479579[_0xccfb('0x22')]=qs[_0xccfb('0x22')](_0x56938a[_0xccfb('0x37')][_0xccfb('0x22')]);}_0x479579['order']=qs[_0xccfb('0x3e')](_0x56938a[_0xccfb('0x37')][_0xccfb('0x3e')]);_0x479579[_0xccfb('0x3f')]=qs[_0xccfb('0x40')](_['pick'](_0x56938a[_0xccfb('0x37')],_0x28cd4b['filters']),_0x56e20b);if(_0x56938a[_0xccfb('0x37')][_0xccfb('0x41')]){_0x479579[_0xccfb('0x3f')]=_[_0xccfb('0x42')](_0x479579['where'],{'$or':_['map'](_0x56e20b,function(_0x40b0b8){if(_0x40b0b8['type']!==_0xccfb('0x43')){var _0xf4cee7={};_0xf4cee7[_0x40b0b8[_0xccfb('0x2f')]]={'$like':'%'+_0x56938a[_0xccfb('0x37')][_0xccfb('0x41')]+'%'};return _0xf4cee7;}})});}_0x479579=_['merge']({},_0x479579,_0x56938a['options']);var _0x376ae6={'where':_0x479579['where']};return db[_0xccfb('0x32')]['count'](_0x376ae6)['then'](function(_0x78e28){_0x398612['count']=_0x78e28;if(_0x56938a[_0xccfb('0x37')][_0xccfb('0x44')]){_0x479579['include']=[{'all':!![]}];}return db['Plugin'][_0xccfb('0x45')](_0x479579);})[_0xccfb('0x29')](function(_0x4edac2){_0x398612[_0xccfb('0x46')]=_0x4edac2;return _0x398612;})['then'](respondWithFilteredResult(_0x3085a8,_0x479579))['catch'](handleError(_0x3085a8,null));};exports[_0xccfb('0x47')]=function(_0x35a54d,_0x1612fa){var _0x19d46d={'raw':!![],'where':{'id':_0x35a54d['params']['id']}},_0x40bb28={};_0x40bb28[_0xccfb('0x36')]=_[_0xccfb('0x38')](db[_0xccfb('0x32')][_0xccfb('0x33')]);_0x40bb28[_0xccfb('0x37')]=_['keys'](_0x35a54d[_0xccfb('0x37')]);_0x40bb28[_0xccfb('0x40')]=_['intersection'](_0x40bb28['model'],_0x40bb28['query']);_0x19d46d[_0xccfb('0x3a')]=_[_0xccfb('0x39')](_0x40bb28['model'],qs[_0xccfb('0x3b')](_0x35a54d[_0xccfb('0x37')][_0xccfb('0x3b')]));_0x19d46d[_0xccfb('0x3a')]=_0x19d46d[_0xccfb('0x3a')][_0xccfb('0x3c')]?_0x19d46d[_0xccfb('0x3a')]:_0x40bb28[_0xccfb('0x36')];if(_0x35a54d[_0xccfb('0x37')]['includeAll']){_0x19d46d[_0xccfb('0x48')]=[{'all':!![]}];}_0x19d46d=_[_0xccfb('0x42')]({},_0x19d46d,_0x35a54d[_0xccfb('0x49')]);return db[_0xccfb('0x32')][_0xccfb('0x4a')](_0x19d46d)['then'](handleEntityNotFound(_0x1612fa,null))[_0xccfb('0x29')](respondWithResult(_0x1612fa,null))[_0xccfb('0x4b')](handleError(_0x1612fa,null));};exports[_0xccfb('0x4c')]=function(_0x5ca39b,_0x26666d,_0x38d74e){return db[_0xccfb('0x32')][_0xccfb('0x4a')]({'where':{'id':_0x5ca39b[_0xccfb('0x4d')]['id']},'attributes':[_0xccfb('0x2f'),'path'],'raw':!![]})[_0xccfb('0x29')](handleEntityNotFound(_0x26666d,null))[_0xccfb('0x29')](function(_0x480e6c){if(_0x480e6c){var _0x45ef83=path['join'](config['root'],_0xccfb('0x4e'),util[_0xccfb('0x4f')]('%s.zip',path['basename'](_0x480e6c['path'])));var _0x15c4a0=fs[_0xccfb('0x50')](_0x45ef83);var _0x5504cd=archiver(_0xccfb('0x51'),{'zlib':{'level':0x9}});_0x5504cd['on'](_0xccfb('0x52'),function(_0x1825c5){if(_0x1825c5[_0xccfb('0x53')]===_0xccfb('0x54')){logger['error'](_0x1825c5);}else{throw new db[(_0xccfb('0x55'))]['Error'](_0xccfb('0x56'));}});_0x5504cd['on'](_0xccfb('0x2d'),function(_0x5c48fc){throw new db[(_0xccfb('0x55'))][(_0xccfb('0x57'))](_0xccfb('0x56'));});_0x5504cd['pipe'](_0x15c4a0);_0x5504cd[_0xccfb('0x58')](_0xccfb('0x59'),{'cwd':path['join'](config[_0xccfb('0x5a')],_0xccfb('0x4e'),path['dirname'](_0x480e6c[_0xccfb('0x6')])),'ignore':[path[_0xccfb('0x5b')](path['basename'](_0x480e6c[_0xccfb('0x6')]),_0xccfb('0x5c')),path['join'](path['basename'](_0x480e6c[_0xccfb('0x6')]),_0xccfb('0x5d'))],'nodir':!![]})[_0xccfb('0x5e')]();_0x15c4a0['on']('close',function(){if(!fs[_0xccfb('0x5f')](_0x45ef83)){throw new db[(_0xccfb('0x55'))]['Error'](_0xccfb('0x60'));}return _0x26666d[_0xccfb('0x4c')](_0x45ef83,util['format'](_0xccfb('0x61'),path[_0xccfb('0x62')](_0x480e6c['path'])),function(_0x2819ef){if(_0x2819ef){throw new db['Sequelize'][(_0xccfb('0x57'))](_0xccfb('0x63'));}fs[_0xccfb('0x64')](_0x45ef83);logger[_0xccfb('0x65')](_0xccfb('0x66'));logger[_0xccfb('0x65')](_0xccfb('0x67'));});});}return null;})[_0xccfb('0x4b')](handleError(_0x26666d,null));};exports[_0xccfb('0x68')]=function(_0x2fc1d6,_0x546d10,_0x176848){var _0x29102d=path[_0xccfb('0x62')](_0x2fc1d6['file']['filename'],path['extname'](_0x2fc1d6[_0xccfb('0x69')][_0xccfb('0x6a')]));var _0x967d9b=path[_0xccfb('0x5b')](config[_0xccfb('0x5a')],_0xccfb('0x4e'),_0x2fc1d6[_0xccfb('0x69')][_0xccfb('0x6a')]);var _0x12e9d9=path[_0xccfb('0x5b')](config['root'],_0xccfb('0x4e'),_0x29102d);logger[_0xccfb('0x65')](_0xccfb('0x6b'),_0x967d9b);logger[_0xccfb('0x65')]('Plugin\x20upload\x20destination:\x20%s',_0x12e9d9);try{fs[_0xccfb('0x6c')](_0x967d9b,parseInt(_0xccfb('0x6d'),0x8));extract(_0x967d9b,{'dir':_0x12e9d9},function(_0x43569d){if(_0x43569d){logger[_0xccfb('0x2d')](_0x43569d);handleError(_0x43569d,!![]);};var _0x2ad0e4=fs['readdirSync'](_0x12e9d9);if(_0x2ad0e4['length']>0x1){removeReferences(_0x967d9b,_0x12e9d9);logger[_0xccfb('0x2d')]('Invalid\x20plugin\x20structure');return _0x176848(new Error(_0xccfb('0x6e')));}var _0x1aefca=fs[_0xccfb('0x6f')](path['join'](_0x12e9d9,_0x2ad0e4[0x0]));if(_0x1aefca[_0xccfb('0x70')]()){removeReferences(_0x967d9b,_0x12e9d9);logger[_0xccfb('0x2d')]('Invalid\x20plugin\x20structure');return _0x176848(new Error('Invalid\x20plugin\x20structure'));}if(_0x1aefca['isDirectory']()){var _0x25d589=fs[_0xccfb('0x71')](path[_0xccfb('0x5b')](_0x12e9d9,_0x2ad0e4[0x0]));if(_0x25d589[_0xccfb('0x3c')]===0x0){removeReferences(_0x967d9b,_0x12e9d9);logger[_0xccfb('0x2d')](_0xccfb('0x6e'));return _0x176848(new Error('Invalid\x20plugin\x20structure'));}var _0xc5ba07=_0x25d589['some'](function(_0x29f3e8){return _0x29f3e8===_0xccfb('0x72');});if(!_0xc5ba07){return _0x176848(new Error(_0xccfb('0x73')));}var _0x12602d=fs[_0xccfb('0x74')](path[_0xccfb('0x5b')](_0x12e9d9,_0x2ad0e4[0x0],'manifest.json'));var _0x54f03d=JSON[_0xccfb('0x75')](_0x12602d);if(_0xccfb('0x76')==typeof _0x54f03d[_0xccfb('0x2f')]){return _0x176848(new Error(_0xccfb('0x77')));}if('undefined'==typeof _0x54f03d[_0xccfb('0x78')]){return _0x176848(new Error(_0xccfb('0x79')));}if(_0xccfb('0x76')==typeof _0x54f03d['version']){return _0x176848(new Error(_0xccfb('0x7a')));}if('undefined'==typeof _0x54f03d[_0xccfb('0x7b')]){return _0x176848(new Error(_0xccfb('0x7c')));}if(_0x54f03d[_0xccfb('0x78')]===_0xccfb('0x7d')){if(_0xccfb('0x76')==typeof _0x54f03d[_0xccfb('0x7b')]['views']){return _0x176848(new Error(_0xccfb('0x7e')));}if('undefined'==typeof _0x54f03d['parameters'][_0xccfb('0x7f')][_0xccfb('0x80')]&&'undefined'==typeof _0x54f03d[_0xccfb('0x7b')][_0xccfb('0x7f')][_0xccfb('0x81')]){return _0x176848(new Error(_0xccfb('0x82')));}}else if(_0x54f03d[_0xccfb('0x78')]===_0xccfb('0x83')){if(_0xccfb('0x76')==typeof _0x54f03d[_0xccfb('0x7b')][_0xccfb('0x84')]){return _0x176848(new Error(_0xccfb('0x85')));}if(_0xccfb('0x76')==typeof _0x54f03d[_0xccfb('0x7b')][_0xccfb('0x86')]){return _0x176848(new Error(_0xccfb('0x87')));}}else{return _0x176848(new Error(_0xccfb('0x88')));}var _0x27f75b=_0x54f03d[_0xccfb('0x2f')];var _0x2f1baf=_0x54f03d[_0xccfb('0x89')];var _0x19058a=_0x54f03d[_0xccfb('0x78')];var _0xe1a649=_0x54f03d[_0xccfb('0x8a')]?_0x54f03d[_0xccfb('0x8a')]:_0xccfb('0x8b');var _0x1996de=_0x54f03d[_0xccfb('0x8c')]?_0x54f03d[_0xccfb('0x8c')]:'icon-apps';var _0x4ec4ec='';var _0x531afc='';var _0x486c45='';var _0x376923='';var _0x4788be=_0x54f03d[_0xccfb('0x8d')];if(_0x19058a==='html'){if('undefined'!=typeof _0x54f03d[_0xccfb('0x7b')][_0xccfb('0x7f')][_0xccfb('0x80')]){var _0x187838=_0x54f03d[_0xccfb('0x7b')]['views'][_0xccfb('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xccfb('0x8e')](_0x187838)){_0x4ec4ec=path['join'](_0xccfb('0x8f'),_0x29102d,_0x2ad0e4[0x0],_0x187838);}else{_0x4ec4ec=_0x187838;}}else{logger[_0xccfb('0x65')](_0xccfb('0x90'));}if(_0xccfb('0x76')!=typeof _0x54f03d[_0xccfb('0x7b')]['views'][_0xccfb('0x81')]){var _0xc3fe68=_0x54f03d[_0xccfb('0x7b')][_0xccfb('0x7f')][_0xccfb('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xccfb('0x8e')](_0xc3fe68)){_0x531afc=path['join'](_0xccfb('0x8f'),_0x29102d,_0x2ad0e4[0x0],_0xc3fe68);}else{_0x531afc=_0xc3fe68;}}else{logger[_0xccfb('0x65')](_0xccfb('0x91'));}}else if(_0x19058a==='script'){_0x486c45=_0x54f03d['parameters']['scriptName'];_0x376923=_0x54f03d[_0xccfb('0x7b')][_0xccfb('0x86')];if('undefined'!=typeof _0x54f03d[_0xccfb('0x7b')][_0xccfb('0x7f')]){if(_0xccfb('0x76')!=typeof _0x54f03d[_0xccfb('0x7b')]['views'][_0xccfb('0x80')]){var _0x187838=_0x54f03d['parameters'][_0xccfb('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xccfb('0x8e')](_0x187838)){_0x4ec4ec=path['join'](_0xccfb('0x8f'),_0x29102d,_0x2ad0e4[0x0],_0x187838);}else{_0x4ec4ec=_0x187838;}}if(_0xccfb('0x76')!=typeof _0x54f03d['parameters'][_0xccfb('0x7f')]['agent']){var _0xc3fe68=_0x54f03d['parameters'][_0xccfb('0x7f')][_0xccfb('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0xc3fe68)){_0x531afc=path[_0xccfb('0x5b')](_0xccfb('0x8f'),_0x29102d,_0x2ad0e4[0x0],_0xc3fe68);}else{_0x531afc=_0xc3fe68;}}}}var _0x547c2b={'name':_0x27f75b,'description':_0x2f1baf,'path':path['join'](_0x29102d,_0x2ad0e4[0x0]),'type':_0x19058a,'sidebar':_0xe1a649,'icon':_0x1996de,'adminUrl':_0x4ec4ec,'agentUrl':_0x531afc,'scriptName':_0x486c45,'scriptPath':_0x376923,'version':_0x4788be};removeReferences(_0x967d9b,null);return db[_0xccfb('0x32')][_0xccfb('0x92')](_0x547c2b)['then'](function(_0x19b0b0){var _0x4ec2d7={'role':_0x2fc1d6[_0xccfb('0x93')][_0xccfb('0x94')],'userProfileId':_0x2fc1d6[_0xccfb('0x93')][_0xccfb('0x95')]};if(!_0x4ec2d7)throw new Error(_0xccfb('0x96'));if(_0x4ec2d7['role']===_0xccfb('0x97')){var _0x8abc50=_0x19b0b0['get']({'plain':!![]});return db[_0xccfb('0x98')]['find']({'where':{'name':_0xccfb('0x2b'),'userProfileId':_0x4ec2d7['userProfileId']},'raw':!![]})[_0xccfb('0x29')](function(_0xdb4c82){if(_0xdb4c82&&_0xdb4c82[_0xccfb('0x99')]===0x0){return db[_0xccfb('0x2c')][_0xccfb('0x92')]({'name':_0x8abc50['name'],'resourceId':_0x8abc50['id'],'type':_0xdb4c82[_0xccfb('0x2f')],'sectionId':_0xdb4c82['id']},{})[_0xccfb('0x29')](function(){return _0x19b0b0;});}else{return _0x19b0b0;}})[_0xccfb('0x4b')](function(_0x454cc7){logger[_0xccfb('0x2d')](_0xccfb('0x9a'),_0x454cc7);throw _0x454cc7;});}return _0x19b0b0;})[_0xccfb('0x29')](respondWithResult(_0x546d10,null))[_0xccfb('0x4b')](handleError(_0x546d10,null));}});}catch(_0xfbc67b){_0x546d10['status'](0x1f4)[_0xccfb('0x9b')](_0xfbc67b);}};function removeReferences(_0x55599d,_0x2aaa97){try{if(_0x55599d){fs['unlinkSync'](_0x55599d);logger[_0xccfb('0x65')](_0xccfb('0x9c'));}if(_0x2aaa97){rimraf(_0x2aaa97,function(){});logger['info'](_0xccfb('0x9d'));}}catch(_0x5b58cf){logger[_0xccfb('0x2d')](_0x5b58cf);}}exports[_0xccfb('0x28')]=function(_0x361199,_0x25dcc7,_0x4f587a){return db[_0xccfb('0x32')]['find']({'where':{'id':_0x361199[_0xccfb('0x4d')]['id']}})[_0xccfb('0x29')](handleEntityNotFound(_0x25dcc7,null))[_0xccfb('0x29')](saveUpdates(_0x361199[_0xccfb('0x93')],null))[_0xccfb('0x29')](respondWithResult(_0x25dcc7,null))['catch'](handleError(_0x25dcc7,null));};exports[_0xccfb('0x9e')]=function(_0x22f48e,_0x3382f9,_0x34265b){return db['Plugin']['find']({'where':{'id':_0x22f48e[_0xccfb('0x4d')]['id']}})[_0xccfb('0x29')](function(_0x5c2235){if(_0x5c2235){return _0x5c2235[_0xccfb('0x2a')]();}})[_0xccfb('0x29')](function(_0x3c85a9){rimraf(path[_0xccfb('0x5b')](config[_0xccfb('0x5a')],_0xccfb('0x4e'),path[_0xccfb('0x9f')](_0x3c85a9[_0xccfb('0x6')])),function(){});return _0x3c85a9;})[_0xccfb('0x29')](handleEntityNotFound(_0x3382f9,null))[_0xccfb('0x29')](respondWithStatusCode(_0x3382f9,null))[_0xccfb('0x4b')](handleError(_0x3382f9,null));};exports[_0xccfb('0xa0')]=function(_0x2c941f,_0x533301,_0x4279bb){return BPromise[_0xccfb('0xa1')]()['then'](function(){if(!_0x2c941f['query'][_0xccfb('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2c941f[_0xccfb('0x37')][_0xccfb('0xa2')]){throw new Error(_0xccfb('0xa3'));}var _0x21b6b8=_0x2c941f['query']['hostname']?_0x2c941f[_0xccfb('0x37')][_0xccfb('0xa4')]+':'+_0x2c941f[_0xccfb('0x37')][_0xccfb('0xa2')]:_0xccfb('0xa5')+_0x2c941f[_0xccfb('0x37')][_0xccfb('0xa2')];var _0x332b4d=_0x2c941f[_0xccfb('0x37')][_0xccfb('0x21')]?_0x2c941f[_0xccfb('0x37')][_0xccfb('0x21')]:!![];var _0x2f35ed=_0x2c941f[_0xccfb('0x37')][_0xccfb('0xa6')]?_0x2c941f['query'][_0xccfb('0xa6')]:null;var _0x228291={'method':_0x2c941f['method'],'uri':util[_0xccfb('0x4f')](_0xccfb('0xa7'),_0x21b6b8,_0x2c941f[_0xccfb('0x37')][_0xccfb('0x6')]),'json':_0x332b4d,'resolveWithFullResponse':!![],'encoding':_0x2f35ed,'qs':_0x2c941f[_0xccfb('0x37')]};if(_0x2c941f[_0xccfb('0xa8')]){_0x228291[_0xccfb('0xa8')]=_0x2c941f['headers'];if(_0x228291[_0xccfb('0xa8')][_0xccfb('0xa9')]){delete _0x228291[_0xccfb('0xa8')][_0xccfb('0xa9')];}}if(_0x228291[_0xccfb('0xa8')]['content-type']){delete _0x228291[_0xccfb('0xa8')]['content-type'];}return rp(_0x228291);})['then'](function(_0x4a245b){if(_0x4a245b){_0x533301['set'](_0x4a245b[_0xccfb('0xa8')]);logger[_0xccfb('0x65')](_0x4a245b[_0xccfb('0x93')]);if(_[_0xccfb('0xaa')](_0x2c941f[_0xccfb('0x37')]['path'],'download')&&_0x4a245b['statusCode']==0x1f4){return _0x533301[_0xccfb('0x1e')](_0x4a245b[_0xccfb('0xab')]);}else{return _0x533301[_0xccfb('0x1f')](_0x4a245b[_0xccfb('0xab')])[_0xccfb('0x9b')](_0x4a245b[_0xccfb('0x93')]);}}else{return _0x533301[_0xccfb('0x1e')](0xc8);}})[_0xccfb('0x4b')](handleError(_0x533301,null));};exports[_0xccfb('0xac')]=function(_0x5a14d2,_0x2c1c9b,_0x50136c){return BPromise['resolve']()['then'](function(){if(!_0x5a14d2[_0xccfb('0x37')]['path']){throw new Error(_0xccfb('0xad'));}if(!_0x5a14d2['query'][_0xccfb('0xa2')]){throw new Error(_0xccfb('0xa3'));}var _0x48963f=_0x5a14d2['query']['hostname']?_0x5a14d2[_0xccfb('0x37')][_0xccfb('0xa4')]+':'+_0x5a14d2[_0xccfb('0x37')][_0xccfb('0xa2')]:_0xccfb('0xa5')+_0x5a14d2[_0xccfb('0x37')][_0xccfb('0xa2')];var _0x374502=_0x5a14d2[_0xccfb('0x37')][_0xccfb('0x21')]?_0x5a14d2[_0xccfb('0x37')][_0xccfb('0x21')]:!![];var _0x57e4f6=_0x5a14d2[_0xccfb('0x37')][_0xccfb('0xa6')]?_0x5a14d2[_0xccfb('0x37')][_0xccfb('0xa6')]:null;var _0x2a8fcf={'method':_0x5a14d2[_0xccfb('0xae')],'uri':util[_0xccfb('0x4f')](_0xccfb('0xa7'),_0x48963f,_0x5a14d2[_0xccfb('0x37')]['path']),'json':_0x374502,'resolveWithFullResponse':!![],'encoding':_0x57e4f6,'body':_0x5a14d2[_0xccfb('0x93')]};if(_0x5a14d2['headers']){_0x2a8fcf[_0xccfb('0xa8')]=_0x5a14d2[_0xccfb('0xa8')];if(_0x2a8fcf['headers'][_0xccfb('0xa9')]){delete _0x2a8fcf[_0xccfb('0xa8')][_0xccfb('0xa9')];}}if(_0x2a8fcf['headers']['content-type']){delete _0x2a8fcf[_0xccfb('0xa8')][_0xccfb('0xaf')];}return rp(_0x2a8fcf);})[_0xccfb('0x29')](function(_0xac7728){if(_0xac7728){_0x2c1c9b[_0xccfb('0xb0')](_0xac7728['headers']);logger[_0xccfb('0x65')](_0xac7728['body']);return _0x2c1c9b[_0xccfb('0x1f')](_0xac7728['statusCode'])[_0xccfb('0x9b')](_0xac7728['body']);}else{return _0x2c1c9b[_0xccfb('0x1e')](0xc8);}})[_0xccfb('0x4b')](handleError(_0x2c1c9b,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 012374f..b591590 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 _0x4d87=['../../mysqldb','Plugin','setMaxListeners','update','remove','emit'];(function(_0x3e2300,_0x562761){var _0x164a5b=function(_0x551480){while(--_0x551480){_0x3e2300['push'](_0x3e2300['shift']());}};_0x164a5b(++_0x562761);}(_0x4d87,0xf0));var _0x74d8=function(_0x3a9697,_0x3256cb){_0x3a9697=_0x3a9697-0x0;var _0x140d6d=_0x4d87[_0x3a9697];return _0x140d6d;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x74d8('0x0'))['db'][_0x74d8('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x74d8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74d8('0x3'),'afterDestroy':_0x74d8('0x4')};function emitEvent(_0x586bed){return function(_0x58792b,_0x391023,_0x1ec453){PluginEvents[_0x74d8('0x5')](_0x586bed+':'+_0x58792b['id'],_0x58792b);PluginEvents[_0x74d8('0x5')](_0x586bed,_0x58792b);_0x1ec453(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x7919=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7919,0xeb));var _0x9791=function(_0x1bf841,_0x3f90f8){_0x1bf841=_0x1bf841-0x0;var _0x5123ae=_0x7919[_0x1bf841];return _0x5123ae;};'use strict';var EventEmitter=require(_0x9791('0x0'));var Plugin=require(_0x9791('0x1'))['db'][_0x9791('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x9791('0x3')](0x0);var events={'afterCreate':_0x9791('0x4'),'afterUpdate':_0x9791('0x5'),'afterDestroy':_0x9791('0x6')};function emitEvent(_0x54b9c0){return function(_0x13a1a5,_0x193919,_0x4b484f){PluginEvents[_0x9791('0x7')](_0x54b9c0+':'+_0x13a1a5['id'],_0x13a1a5);PluginEvents[_0x9791('0x7')](_0x54b9c0,_0x13a1a5);_0x4b484f(null);};}for(var e in events){if(events[_0x9791('0x8')](e)){var event=events[e];Plugin[_0x9791('0x9')](e,emitEvent(event));}}module[_0x9791('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 3c9d861..9fd97c6 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 _0x8b97=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','Plugin','plugins'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8b97,0x1d9));var _0x78b9=function(_0x5096d7,_0x382185){_0x5096d7=_0x5096d7-0x0;var _0xbee07c=_0x8b97[_0x5096d7];return _0xbee07c;};'use strict';var _=require(_0x78b9('0x0'));var util=require('util');var logger=require(_0x78b9('0x1'))(_0x78b9('0x2'));var moment=require(_0x78b9('0x3'));var BPromise=require(_0x78b9('0x4'));var rp=require(_0x78b9('0x5'));var fs=require('fs');var path=require(_0x78b9('0x6'));var rimraf=require('rimraf');var config=require(_0x78b9('0x7'));var attributes=require(_0x78b9('0x8'));module['exports']=function(_0x194bb3,_0x1de137){return _0x194bb3['define'](_0x78b9('0x9'),attributes,{'tableName':_0x78b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceb1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xceb1,0x10a));var _0x1ceb=function(_0x579ce2,_0x1d01bc){_0x579ce2=_0x579ce2-0x0;var _0x32df33=_0xceb1[_0x579ce2];return _0x32df33;};'use strict';var _=require(_0x1ceb('0x0'));var util=require(_0x1ceb('0x1'));var logger=require(_0x1ceb('0x2'))(_0x1ceb('0x3'));var moment=require(_0x1ceb('0x4'));var BPromise=require(_0x1ceb('0x5'));var rp=require(_0x1ceb('0x6'));var fs=require('fs');var path=require(_0x1ceb('0x7'));var rimraf=require(_0x1ceb('0x8'));var config=require(_0x1ceb('0x9'));var attributes=require(_0x1ceb('0xa'));module[_0x1ceb('0xb')]=function(_0x3e49e3,_0x1c0515){return _0x3e49e3[_0x1ceb('0xc')](_0x1ceb('0xd'),attributes,{'tableName':_0x1ceb('0xe'),'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 3f675cc..482f82a 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 _0x8a85=['catch','CreatePlugin','Plugin','create','body','options','raw','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x1b501f,_0x13dc4b){var _0x5f2d7c=function(_0x3eca74){while(--_0x3eca74){_0x1b501f['push'](_0x1b501f['shift']());}};_0x5f2d7c(++_0x13dc4b);}(_0x8a85,0x64));var _0x58a8=function(_0x39975f,_0x3efd06){_0x39975f=_0x39975f-0x0;var _0x5e182f=_0x8a85[_0x39975f];return _0x5e182f;};'use strict';var _=require('lodash');var util=require(_0x58a8('0x0'));var moment=require('moment');var BPromise=require(_0x58a8('0x1'));var rs=require(_0x58a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x58a8('0x3'));var logger=require(_0x58a8('0x4'))(_0x58a8('0x5'));var config=require(_0x58a8('0x6'));var jayson=require(_0x58a8('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x58a8('0x8')]=_[_0x58a8('0x9')](config[_0x58a8('0x8')],{'host':_0x58a8('0xa'),'port':0x18eb});var socket=require(_0x58a8('0xb'))(new Redis(config['redis']));require(_0x58a8('0xc'))[_0x58a8('0xd')](socket);function respondWithRpcPromise(_0x8d980c,_0x562560,_0x4c6acf){return new BPromise(function(_0x478821,_0x87b49c){return client[_0x58a8('0xe')](_0x8d980c,_0x4c6acf)[_0x58a8('0xf')](function(_0x2dac73){logger[_0x58a8('0x10')](_0x58a8('0x11'),_0x562560,_0x58a8('0x12'));logger[_0x58a8('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x562560,_0x58a8('0x12'),JSON[_0x58a8('0x14')](_0x2dac73));if(_0x2dac73[_0x58a8('0x15')]){if(_0x2dac73[_0x58a8('0x15')]['code']===0x1f4){logger[_0x58a8('0x15')](_0x58a8('0x11'),_0x562560,_0x2dac73[_0x58a8('0x15')]['message']);return _0x87b49c(_0x2dac73[_0x58a8('0x15')][_0x58a8('0x16')]);}logger[_0x58a8('0x15')](_0x58a8('0x11'),_0x562560,_0x2dac73[_0x58a8('0x15')]['message']);return _0x478821(_0x2dac73[_0x58a8('0x15')]['message']);}else{logger[_0x58a8('0x10')](_0x58a8('0x11'),_0x562560,_0x58a8('0x12'));_0x478821(_0x2dac73[_0x58a8('0x17')][_0x58a8('0x16')]);}})[_0x58a8('0x18')](function(_0x5aabf6){logger['error'](_0x58a8('0x11'),_0x562560,_0x5aabf6);_0x87b49c(_0x5aabf6);});});}exports[_0x58a8('0x19')]=function(_0x3271ae){var _0x8781b3=this;return new Promise(function(_0x3fb74b,_0x1b54d5){return db[_0x58a8('0x1a')][_0x58a8('0x1b')](_0x3271ae[_0x58a8('0x1c')],{'raw':_0x3271ae[_0x58a8('0x1d')]?_0x3271ae['options'][_0x58a8('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x473dc3){logger['info'](_0x58a8('0x19'),_0x3271ae);logger[_0x58a8('0x13')](_0x58a8('0x19'),_0x3271ae,JSON[_0x58a8('0x14')](_0x473dc3));_0x3fb74b(_0x473dc3);})[_0x58a8('0x18')](function(_0x5f4ac3){logger[_0x58a8('0x15')](_0x58a8('0x19'),_0x5f4ac3[_0x58a8('0x16')],_0x3271ae);_0x1b54d5(_0x8781b3[_0x58a8('0x15')](0x1f4,_0x5f4ac3['message']));});});}; \ No newline at end of file +var _0x9813=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','Plugin','create','body','options','raw','CreatePlugin','lodash','util','moment','bluebird','randomstring'];(function(_0x43018e,_0x19e301){var _0x3be1af=function(_0x3df6ce){while(--_0x3df6ce){_0x43018e['push'](_0x43018e['shift']());}};_0x3be1af(++_0x19e301);}(_0x9813,0x112));var _0x3981=function(_0x4a77e4,_0x556f71){_0x4a77e4=_0x4a77e4-0x0;var _0x1c68d8=_0x9813[_0x4a77e4];return _0x1c68d8;};'use strict';var _=require(_0x3981('0x0'));var util=require(_0x3981('0x1'));var moment=require(_0x3981('0x2'));var BPromise=require(_0x3981('0x3'));var rs=require(_0x3981('0x4'));var fs=require('fs');var Redis=require(_0x3981('0x5'));var db=require(_0x3981('0x6'))['db'];var utils=require(_0x3981('0x7'));var logger=require('../../config/logger')(_0x3981('0x8'));var config=require(_0x3981('0x9'));var jayson=require(_0x3981('0xa'));var client=jayson[_0x3981('0xb')]['http']({'port':0x232a});config[_0x3981('0xc')]=_['defaults'](config[_0x3981('0xc')],{'host':_0x3981('0xd'),'port':0x18eb});var socket=require(_0x3981('0xe'))(new Redis(config[_0x3981('0xc')]));require(_0x3981('0xf'))[_0x3981('0x10')](socket);function respondWithRpcPromise(_0x39c4e1,_0x1dbb62,_0x3eaea3){return new BPromise(function(_0x36e4f9,_0x2199d8){return client['request'](_0x39c4e1,_0x3eaea3)[_0x3981('0x11')](function(_0x479ef9){logger[_0x3981('0x12')](_0x3981('0x13'),_0x1dbb62,_0x3981('0x14'));logger[_0x3981('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1dbb62,_0x3981('0x14'),JSON[_0x3981('0x16')](_0x479ef9));if(_0x479ef9[_0x3981('0x17')]){if(_0x479ef9[_0x3981('0x17')]['code']===0x1f4){logger[_0x3981('0x17')](_0x3981('0x13'),_0x1dbb62,_0x479ef9['error'][_0x3981('0x18')]);return _0x2199d8(_0x479ef9[_0x3981('0x17')][_0x3981('0x18')]);}logger[_0x3981('0x17')](_0x3981('0x13'),_0x1dbb62,_0x479ef9[_0x3981('0x17')][_0x3981('0x18')]);return _0x36e4f9(_0x479ef9[_0x3981('0x17')]['message']);}else{logger[_0x3981('0x12')]('Plugin,\x20%s,\x20%s',_0x1dbb62,'request\x20sent');_0x36e4f9(_0x479ef9['result'][_0x3981('0x18')]);}})['catch'](function(_0x5b7350){logger[_0x3981('0x17')](_0x3981('0x13'),_0x1dbb62,_0x5b7350);_0x2199d8(_0x5b7350);});});}exports['CreatePlugin']=function(_0x13a57e){var _0x119419=this;return new Promise(function(_0x2305f6,_0x4fd294){return db[_0x3981('0x19')][_0x3981('0x1a')](_0x13a57e[_0x3981('0x1b')],{'raw':_0x13a57e['options']?_0x13a57e[_0x3981('0x1c')][_0x3981('0x1d')]===undefined?!![]:![]:!![]})[_0x3981('0x11')](function(_0x4e5d5d){logger['info'](_0x3981('0x1e'),_0x13a57e);logger[_0x3981('0x15')](_0x3981('0x1e'),_0x13a57e,JSON['stringify'](_0x4e5d5d));_0x2305f6(_0x4e5d5d);})['catch'](function(_0x5e0707){logger[_0x3981('0x17')](_0x3981('0x1e'),_0x5e0707[_0x3981('0x18')],_0x13a57e);_0x4fd294(_0x119419[_0x3981('0x17')](0x1f4,_0x5e0707['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index ec9eadd..2ed00c1 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 _0x32b6=['length','plugin:','./plugin.events','save','update','emit','removeListener','register'];(function(_0x4bf8c2,_0x17f83){var _0xf2ecfe=function(_0x2a9da5){while(--_0x2a9da5){_0x4bf8c2['push'](_0x4bf8c2['shift']());}};_0xf2ecfe(++_0x17f83);}(_0x32b6,0xca));var _0x632b=function(_0x1106fc,_0x26c937){_0x1106fc=_0x1106fc-0x0;var _0x1cfb83=_0x32b6[_0x1106fc];return _0x1cfb83;};'use strict';var PluginEvents=require(_0x632b('0x0'));var events=[_0x632b('0x1'),'remove',_0x632b('0x2')];function createListener(_0x3d476f,_0xab4d12){return function(_0x337a1e){_0xab4d12[_0x632b('0x3')](_0x3d476f,_0x337a1e);};}function removeListener(_0x76583f,_0xb60ae9){return function(){PluginEvents[_0x632b('0x4')](_0x76583f,_0xb60ae9);};}exports[_0x632b('0x5')]=function(_0x57966b){for(var _0x231ca=0x0,_0x3aef00=events[_0x632b('0x6')];_0x231ca<_0x3aef00;_0x231ca++){var _0x41d7d5=events[_0x231ca];var _0x7e4b7a=createListener(_0x632b('0x7')+_0x41d7d5,_0x57966b);PluginEvents['on'](_0x41d7d5,_0x7e4b7a);}}; \ No newline at end of file +var _0x1d34=['save','remove','removeListener','register','plugin:','./plugin.events'];(function(_0x8b9662,_0x5137e3){var _0xab92ed=function(_0x13fc7f){while(--_0x13fc7f){_0x8b9662['push'](_0x8b9662['shift']());}};_0xab92ed(++_0x5137e3);}(_0x1d34,0x7d));var _0x41d3=function(_0x30fff6,_0xaa8715){_0x30fff6=_0x30fff6-0x0;var _0x5c147b=_0x1d34[_0x30fff6];return _0x5c147b;};'use strict';var PluginEvents=require(_0x41d3('0x0'));var events=[_0x41d3('0x1'),_0x41d3('0x2'),'update'];function createListener(_0x3a6faa,_0x216d4c){return function(_0x2098bf){_0x216d4c['emit'](_0x3a6faa,_0x2098bf);};}function removeListener(_0x59037c,_0x46ce24){return function(){PluginEvents[_0x41d3('0x3')](_0x59037c,_0x46ce24);};}exports[_0x41d3('0x4')]=function(_0xb199cd){for(var _0x54bd24=0x0,_0x24f9be=events['length'];_0x54bd24<_0x24f9be;_0x54bd24++){var _0x186da3=events[_0x54bd24];var _0x16c187=createListener(_0x41d3('0x5')+_0x186da3,_0xb199cd);PluginEvents['on'](_0x186da3,_0x16c187);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index af3da2c..b1eba5f 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(_0xf60ce3,_0x2ed4f5){var _0x1b40b5=function(_0x52f3b6){while(--_0x52f3b6){_0xf60ce3['push'](_0xf60ce3['shift']());}};_0x1b40b5(++_0x2ed4f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x165055,_0x25440a){var _0x285076=function(_0xb87790){while(--_0xb87790){_0x165055['push'](_0x165055['shift']());}};_0x285076(++_0x25440a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 3571615..9a43753 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 _0xb58b=['Unknown\x20status','destroy','params','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','child_process','exec','sendStatus','status','json','error','stack','name','npm\x20install','info','list','then','reject','motion2','length','describe','catch','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x22f0d8,_0x4992e4){var _0x492c1f=function(_0x375b28){while(--_0x375b28){_0x22f0d8['push'](_0x22f0d8['shift']());}};_0x492c1f(++_0x4992e4);}(_0xb58b,0x1f1));var _0xbb58=function(_0x3c4583,_0x2d3552){_0x3c4583=_0x3c4583-0x0;var _0x46934d=_0xb58b[_0x3c4583];return _0x46934d;};'use strict';var _=require('lodash');var pm2=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var path=require('path');var exec=require(_0xbb58('0x3'))[_0xbb58('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x226363,_0x546510){return function(_0x2edb10){if(!_0x2edb10){_0x226363[_0xbb58('0x5')](0x194);;}return _0x2edb10;};}function respondWithResult(_0x33fe85,_0x5cf8b1){_0x5cf8b1=_0x5cf8b1||0xc8;return function(_0x27cbda){if(_0x27cbda){return _0x33fe85[_0xbb58('0x6')](_0x5cf8b1)[_0xbb58('0x7')](_0x27cbda);}return null;};}function handleError(_0x5d7fe8,_0xd94f1){_0xd94f1=_0xd94f1||0x1f4;return function(_0x3e3144){logger[_0xbb58('0x8')](_0x3e3144[_0xbb58('0x9')]);if(_0x3e3144[_0xbb58('0xa')]){delete _0x3e3144[_0xbb58('0xa')];}_0x5d7fe8[_0xbb58('0x6')](_0xd94f1)['send'](_0x3e3144);};}function execChildProcess(){return new BPromise(function(_0x80ab3a,_0x5c3bf7){exec(_0xbb58('0xb'),function(_0x440392,_0x26d8e6,_0x19d185){logger['info'](_0x26d8e6);logger[_0xbb58('0xc')](_0x19d185);if(_0x440392){logger[_0xbb58('0x8')](_0x440392);return _0x5c3bf7(_0x440392);}return _0x80ab3a(_0x26d8e6);});});}exports['index']=function(_0x132511,_0xdc68b9){return pm2[_0xbb58('0xd')]()[_0xbb58('0xe')](function(_0x19ceda){if(_0x19ceda){var _0x58245f=_[_0xbb58('0xf')](_0x19ceda,function(_0x23fd15){return _0x23fd15['name']==='express'||_0x23fd15[_0xbb58('0xa')]===_0xbb58('0x10');});return{'rows':_0x58245f,'count':_0x58245f[_0xbb58('0x11')]};}return null;})['then'](respondWithResult(_0xdc68b9,null))['catch'](handleError(_0xdc68b9,null));};exports['show']=function(_0x55156e,_0x28637b){return pm2[_0xbb58('0x12')](_0x55156e['params']['id'])[_0xbb58('0xe')](respondWithResult(_0x28637b,null))['then'](handleEntityNotFound(_0x28637b,null))[_0xbb58('0x13')](handleError(_0x28637b,null));};exports[_0xbb58('0x14')]=function(_0x3c33d9,_0xb8f982){if(_0x3c33d9[_0xbb58('0x15')][_0xbb58('0xa')]&&_0x3c33d9[_0xbb58('0x15')]['script']){var _0x84f34=path[_0xbb58('0x16')](__dirname,_0xbb58('0x17'),_0x3c33d9[_0xbb58('0x15')][_0xbb58('0x18')]);var _0x5d4a91=process[_0xbb58('0x19')]();process[_0xbb58('0x1a')](path[_0xbb58('0x1b')](_0x84f34));return execChildProcess()['then'](function(_0x27806d){process['chdir'](_0x5d4a91);return pm2[_0xbb58('0x1c')]({'name':_0x3c33d9[_0xbb58('0x15')][_0xbb58('0xa')],'script':_0x84f34});})[_0xbb58('0xe')](function(_0x2d111c){pm2[_0xbb58('0x1d')]();return _0x2d111c[0x0];})[_0xbb58('0xe')](respondWithResult(_0xb8f982,0xc9))[_0xbb58('0x13')](handleError(_0xb8f982,null));}else{return _0xb8f982['status'](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x1f')});}};exports[_0xbb58('0x20')]=function(_0x129094,_0x8e9ed9){if(_0x129094[_0xbb58('0x15')]['id']){delete _0x129094[_0xbb58('0x15')]['id'];}var _0x2ce7c3={'online':_0xbb58('0x21'),'stopped':_0xbb58('0x22')};if(_0x2ce7c3[_0xbb58('0x23')](_0x129094[_0xbb58('0x15')][_0xbb58('0x6')])){return pm2[_0x2ce7c3[_0x129094[_0xbb58('0x15')][_0xbb58('0x6')]]](_0x129094['params']['id'])[_0xbb58('0xe')](respondWithResult(_0x8e9ed9,0xc8))[_0xbb58('0x13')](handleError(_0x8e9ed9,null));}else{return _0x8e9ed9[_0xbb58('0x6')](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x24')});}};exports[_0xbb58('0x25')]=function(_0x1ba526,_0x643e0e){if(_0x1ba526[_0xbb58('0x15')]['id']){delete _0x1ba526['body']['id'];}if(_0x1ba526[_0xbb58('0x26')]['id']){return pm2[_0xbb58('0x27')](_0x1ba526[_0xbb58('0x26')]['id'])[_0xbb58('0xe')](function(_0xdbbe7b){pm2[_0xbb58('0x1d')]();return _0xdbbe7b[0x0];})[_0xbb58('0xe')](respondWithResult(_0x643e0e,null))[_0xbb58('0x13')](handleError(_0x643e0e,null));}else{return _0x643e0e[_0xbb58('0x6')](0x1f4)[_0xbb58('0x1e')]({'message':_0xbb58('0x28')});}}; \ No newline at end of file +var _0x5ff3=['Unknown\x20id','../../config/pm2','api','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','delete'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x5ff3,0x17d));var _0x35ff=function(_0x20f111,_0x2624bb){_0x20f111=_0x20f111-0x0;var _0x54c06e=_0x5ff3[_0x20f111];return _0x54c06e;};'use strict';var _=require('lodash');var pm2=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var path=require('path');var exec=require(_0x35ff('0x2'))[_0x35ff('0x3')];var BPromise=require(_0x35ff('0x4'));function handleEntityNotFound(_0xd0846d,_0x551514){return function(_0x2fcb74){if(!_0x2fcb74){_0xd0846d[_0x35ff('0x5')](0x194);;}return _0x2fcb74;};}function respondWithResult(_0x2e9873,_0x11e738){_0x11e738=_0x11e738||0xc8;return function(_0x30c3ff){if(_0x30c3ff){return _0x2e9873['status'](_0x11e738)[_0x35ff('0x6')](_0x30c3ff);}return null;};}function handleError(_0x4c9fab,_0x2e7470){_0x2e7470=_0x2e7470||0x1f4;return function(_0xfcec34){logger[_0x35ff('0x7')](_0xfcec34['stack']);if(_0xfcec34[_0x35ff('0x8')]){delete _0xfcec34['name'];}_0x4c9fab[_0x35ff('0x9')](_0x2e7470)[_0x35ff('0xa')](_0xfcec34);};}function execChildProcess(){return new BPromise(function(_0x57ad20,_0x5c3131){exec(_0x35ff('0xb'),function(_0x574c81,_0x592295,_0x567080){logger[_0x35ff('0xc')](_0x592295);logger[_0x35ff('0xc')](_0x567080);if(_0x574c81){logger[_0x35ff('0x7')](_0x574c81);return _0x5c3131(_0x574c81);}return _0x57ad20(_0x592295);});});}exports[_0x35ff('0xd')]=function(_0x559e33,_0x33154f){return pm2[_0x35ff('0xe')]()[_0x35ff('0xf')](function(_0x4d1d41){if(_0x4d1d41){var _0xff8ac=_[_0x35ff('0x10')](_0x4d1d41,function(_0x254975){return _0x254975[_0x35ff('0x8')]===_0x35ff('0x11')||_0x254975[_0x35ff('0x8')]===_0x35ff('0x12');});return{'rows':_0xff8ac,'count':_0xff8ac[_0x35ff('0x13')]};}return null;})[_0x35ff('0xf')](respondWithResult(_0x33154f,null))[_0x35ff('0x14')](handleError(_0x33154f,null));};exports[_0x35ff('0x15')]=function(_0x3430e2,_0x37ea06){return pm2[_0x35ff('0x16')](_0x3430e2[_0x35ff('0x17')]['id'])['then'](respondWithResult(_0x37ea06,null))[_0x35ff('0xf')](handleEntityNotFound(_0x37ea06,null))[_0x35ff('0x14')](handleError(_0x37ea06,null));};exports[_0x35ff('0x18')]=function(_0x1c0d8c,_0x567bcb){if(_0x1c0d8c['body'][_0x35ff('0x8')]&&_0x1c0d8c[_0x35ff('0x19')]['script']){var _0x238f65=path[_0x35ff('0x1a')](__dirname,_0x35ff('0x1b'),_0x1c0d8c[_0x35ff('0x19')]['script']);var _0x3d60b4=process['cwd']();process[_0x35ff('0x1c')](path[_0x35ff('0x1d')](_0x238f65));return execChildProcess()[_0x35ff('0xf')](function(_0x16a5a0){process[_0x35ff('0x1c')](_0x3d60b4);return pm2[_0x35ff('0x1e')]({'name':_0x1c0d8c[_0x35ff('0x19')]['name'],'script':_0x238f65});})[_0x35ff('0xf')](function(_0x2ffcb){pm2['dump']();return _0x2ffcb[0x0];})[_0x35ff('0xf')](respondWithResult(_0x567bcb,0xc9))['catch'](handleError(_0x567bcb,null));}else{return _0x567bcb['status'](0x1f4)[_0x35ff('0xa')]({'message':_0x35ff('0x1f')});}};exports[_0x35ff('0x20')]=function(_0x11a5eb,_0x302d5a){if(_0x11a5eb['body']['id']){delete _0x11a5eb[_0x35ff('0x19')]['id'];}var _0x412873={'online':_0x35ff('0x21'),'stopped':'stop'};if(_0x412873[_0x35ff('0x22')](_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')])){return pm2[_0x412873[_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')]]](_0x11a5eb[_0x35ff('0x17')]['id'])[_0x35ff('0xf')](respondWithResult(_0x302d5a,0xc8))[_0x35ff('0x14')](handleError(_0x302d5a,null));}else{return _0x302d5a[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x23')});}};exports['destroy']=function(_0x1cb370,_0x257501){if(_0x1cb370[_0x35ff('0x19')]['id']){delete _0x1cb370[_0x35ff('0x19')]['id'];}if(_0x1cb370['params']['id']){return pm2[_0x35ff('0x24')](_0x1cb370['params']['id'])[_0x35ff('0xf')](function(_0xf88865){pm2['dump']();return _0xf88865[0x0];})['then'](respondWithResult(_0x257501,null))[_0x35ff('0x14')](handleError(_0x257501,null));}else{return _0x257501[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 632c823..e728c70 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 _0x8b71=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','exports','Router'];(function(_0x48cd16,_0x280088){var _0x2e4b90=function(_0x15baed){while(--_0x15baed){_0x48cd16['push'](_0x48cd16['shift']());}};_0x2e4b90(++_0x280088);}(_0x8b71,0x1b8));var _0x18b7=function(_0x1b5184,_0x5061bc){_0x1b5184=_0x1b5184-0x0;var _0x25f159=_0x8b71[_0x1b5184];return _0x25f159;};'use strict';var express=require('express');var router=express[_0x18b7('0x0')]();var auth=require(_0x18b7('0x1'));var controller=require(_0x18b7('0x2'));router[_0x18b7('0x3')](_0x18b7('0x4'),auth[_0x18b7('0x5')](),controller[_0x18b7('0x6')]);router[_0x18b7('0x3')](_0x18b7('0x7'),auth['isAuthenticated'](),controller['getQueues']);module[_0x18b7('0x8')]=router; \ No newline at end of file +var _0x0358=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues','express','Router'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0x0358,0x184));var _0x8035=function(_0x5eb625,_0xc09dbf){_0x5eb625=_0x5eb625-0x0;var _0x4e9462=_0x0358[_0x5eb625];return _0x4e9462;};'use strict';var express=require(_0x8035('0x0'));var router=express[_0x8035('0x1')]();var auth=require(_0x8035('0x2'));var controller=require(_0x8035('0x3'));router[_0x8035('0x4')](_0x8035('0x5'),auth[_0x8035('0x6')](),controller[_0x8035('0x7')]);router[_0x8035('0x4')](_0x8035('0x8'),auth['isAuthenticated'](),controller[_0x8035('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 76f2145..213ad9b 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 _0x9da7=['startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','agents','loggedInDb','busy','outbound','originated','find','merge','filter','queue','some','connectedlinenum','internal','toString','getMembers','length','UserId','online','voiceStatus','User','Pause','findAll','QueueId','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','pauseTypeFilter','pause','*pause','resolve','channel','sort','globalStatus','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','type','role','agent','getOptions','sequelize','literal','FIELD(id,','forEach','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','map','filterAgentAttributes','sortAgentsByStatus','fieldName','QueueCampaigns','getRealtimeAgents','all','lodash','../../config/utils','../../config/logger','../../mysqldb','client','http','undefined','limit','count','offset','set','Content-Range','error','stack','name','voice','request','startCase','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','loggedIn','available','waiting','talking','paused','push','pTalking','message','dialActive','dialMethod','startPredictive'];(function(_0x5e8e16,_0x261f40){var _0x2e3fa8=function(_0x184e45){while(--_0x184e45){_0x5e8e16['push'](_0x5e8e16['shift']());}};_0x2e3fa8(++_0x261f40);}(_0x9da7,0x13b));var _0x79da=function(_0x21e79a,_0x5a7990){_0x21e79a=_0x21e79a-0x0;var _0x506c02=_0x9da7[_0x21e79a];return _0x506c02;};'use strict';var util=require('util');var _=require(_0x79da('0x0'));var jayson=require('jayson/promise');var rta=require('../../components/realtime/agents');var qs=require('../../components/parsers/qs');var utils=require(_0x79da('0x1'));var logger=require(_0x79da('0x2'))('api');var db=require(_0x79da('0x3'))['db'];var amiClient=jayson[_0x79da('0x4')][_0x79da('0x5')]({'port':0x232a});var routingClient=jayson[_0x79da('0x4')][_0x79da('0x5')]({'port':0x232c});function respondWithFilteredResult(_0xee69c9,_0xfcc12c){return function(_0xaca5b){if(_0xaca5b){var _0x4b1563=typeof _0xfcc12c['offset']===_0x79da('0x6')&&typeof _0xfcc12c[_0x79da('0x7')]==='undefined';var _0x3f373a=_0xaca5b[_0x79da('0x8')];var _0x440fac=_0x4b1563?0x0:_0xfcc12c[_0x79da('0x9')];var _0x5dbe18=_0x4b1563?_0xaca5b['count']:_0xfcc12c[_0x79da('0x9')]+_0xfcc12c['limit'];var _0x32b16e;if(_0x5dbe18>=_0x3f373a){_0x5dbe18=_0x3f373a;_0x32b16e=0xc8;}else{_0x32b16e=0xce;}_0xee69c9['status'](_0x32b16e);return _0xee69c9[_0x79da('0xa')](_0x79da('0xb'),_0x440fac+'-'+_0x5dbe18+'/'+_0x3f373a)['json'](_0xaca5b);}return null;};}function handleError(_0x4b85a7,_0x9a6544){_0x9a6544=_0x9a6544||0x1f4;return function(_0x4409ed){logger[_0x79da('0xc')](_0x4409ed[_0x79da('0xd')]);if(_0x4409ed['name']){delete _0x4409ed[_0x79da('0xe')];}_0x4b85a7['status'](_0x9a6544)['send'](_0x4409ed);};}function getRealtimeQueues(_0x441e75,_0x4b94db){return new Promise(function(_0x2102cf,_0x15993e){var _0xe426fe=_0x4b94db===_0x79da('0xf')?amiClient:routingClient;return _0xe426fe[_0x79da('0x10')](_[_0x79da('0x11')](_0x4b94db)+'Queues',_0x441e75)[_0x79da('0x12')](function(_0x2dcb66){if(_0x2dcb66[_0x79da('0xc')])throw new Error(util[_0x79da('0x13')](_0x79da('0x14'),_0x4b94db));return _0x2102cf(_0x2dcb66[_0x79da('0x15')]);})['catch'](function(_0x41a358){_0x15993e(_0x41a358);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1725ca,_0x47091a){return amiClient[_0x79da('0x10')](_0x79da('0x16'),{})[_0x79da('0x12')](function(_0x5d07c2){if(_0x5d07c2[_0x79da('0xc')])throw new Error(_0x79da('0x17'));return _0x1725ca(_0x5d07c2[_0x79da('0x15')]);})[_0x79da('0x18')](function(_0x283f99){_0x47091a(_0x283f99);});});}function initializeQueues(_0x29f982,_0x146231,_0xaac2f5,_0x195a30){var _0xcef4ab=[_0x79da('0x19'),_0x79da('0x1a'),_0x79da('0x1b'),_0x79da('0x1c'),_0x79da('0x1d')];if(_0xaac2f5===_0x79da('0xf')&&_0x195a30==='outbound'){_0xcef4ab[_0x79da('0x1e')](_0x79da('0x1f'),'originated',_0x79da('0x20'),_0x79da('0x21'),_0x79da('0x22'),'Trunk',_0x79da('0x23'),_0x79da('0x24'),_0x79da('0x25'),_0x79da('0x26'),_0x79da('0x27'),'erlangBusyFactor','dialPredictiveInterval',_0x79da('0x28'),_0x79da('0x29'),_0x79da('0x2a'),_0x79da('0x2b'),_0x79da('0x2c'),'predictiveIntervalDroppedCallsTimeout',_0x79da('0x2d'),_0x79da('0x2e'),_0x79da('0x2f'));}return _0x29f982['map'](function(_0x5dbc87){var _0x33b021=_0x5dbc87[_0x79da('0x30')]({'plain':!![]});_0x33b021[_0x79da('0x31')]=[];_0x33b021[_0x79da('0x1d')]=0x0;_0x33b021[_0x79da('0x32')]=0x0;_0x33b021[_0x79da('0x19')]=0x0;_0x33b021['available']=0x0;_0x33b021[_0x79da('0x1b')]=0x0;if(_0xaac2f5===_0x79da('0xf')){_0x33b021[_0x79da('0x1c')]=0x0;_0x33b021[_0x79da('0x33')]=0x0;if(_0x195a30===_0x79da('0x34')){_0x33b021[_0x79da('0x1f')]=0x0;_0x33b021[_0x79da('0x35')]=0x0;}}var _0x50552c=_[_0x79da('0x36')](_0x146231,['id',_0x33b021['id']]);if(_0x50552c)_[_0x79da('0x37')](_0x33b021,_['pick'](_0x50552c,_0xcef4ab));return _0x33b021;});}function updateAgentVoiceStatus(_0x24679e,_0x27fd23,_0x2170e4){var _0x10f25c=_[_0x79da('0x38')](_0x2170e4,[_0x79da('0x39'),_0x27fd23[_0x79da('0xe')]]);if(_0x10f25c['length']===0x0)return _0x24679e[_0x79da('0x33')]=!![];if(_[_0x79da('0x3a')](_0x10f25c,[_0x79da('0x3b'),_0x24679e[_0x79da('0x3c')][_0x79da('0x3d')]()]))return _0x24679e[_0x79da('0x1c')]=!![];if(!_0x24679e[_0x79da('0x1c')])return _0x24679e[_0x79da('0x33')]=!![];}function getVoiceQueueAgents(_0x18af79,_0x112f2f,_0x350762,_0x325e3e){var _0x121dbe=_[_0x79da('0x36')](_0x112f2f,['id',_0x18af79['id']]);if(!_0x121dbe)return _0x18af79;return _0x121dbe[_0x79da('0x3e')]({'raw':!![]})[_0x79da('0x12')](function(_0x104ad1){for(var _0x149f70=0x0;_0x149f70<_0x104ad1[_0x79da('0x3f')];_0x149f70++){var _0x4874ca=_['find'](_0x350762,['id',_0x104ad1[_0x149f70][_0x79da('0x40')]]);if(!_0x4874ca){_0x4874ca={'id':_0x104ad1[_0x149f70][_0x79da('0x40')],'name':_0x104ad1[_0x149f70][_0x79da('0x40')],'accountcode':'','online':![]};}var _0x4b8891={'id':_0x4874ca['id'],'name':_0x4874ca[_0x79da('0xe')],'internal':_0x4874ca['accountcode'],'online':Boolean(_0x4874ca[_0x79da('0x41')]),'paused':Boolean(_0x104ad1[_0x149f70][_0x79da('0x1d')])};if(_0x4874ca[_0x79da('0x42')]===_0x79da('0x1c'))updateAgentVoiceStatus(_0x4b8891,_0x18af79,_0x325e3e);if(_0x4b8891[_0x79da('0x41')])_0x18af79[_0x79da('0x32')]++;if(_0x4b8891[_0x79da('0x33')])_0x18af79[_0x79da('0x33')]++;if(_0x4b8891[_0x79da('0x1d')]&&!_0x4b8891[_0x79da('0x33')]&&!_0x4b8891[_0x79da('0x1c')])_0x18af79[_0x79da('0x1d')]++;_0x18af79[_0x79da('0x31')][_0x79da('0x1e')](_0x4b8891);}return _0x18af79;});}function getQueueAgents(_0x289191,_0x104c78,_0x32b989){var _0x2de347=_0x79da('0x43')+_[_0x79da('0x11')](_0x32b989)+'Queue';var _0x549a0f=_0x32b989+_0x79da('0x44');return db[_0x2de347][_0x79da('0x45')]({'where':{[_[_0x79da('0x11')](_0x32b989)+_0x79da('0x46')]:_0x289191['id']},'raw':!![]})['then'](function(_0x5b6716){for(var _0x1eb8a8=0x0;_0x1eb8a8<_0x5b6716[_0x79da('0x3f')];_0x1eb8a8++){var _0x3a427d=_['find'](_0x104c78,['id',_0x5b6716[_0x1eb8a8][_0x79da('0x40')]]);if(!_0x3a427d){_0x3a427d={'id':_0x5b6716[_0x1eb8a8][_0x79da('0x40')],'name':_0x5b6716[_0x1eb8a8]['UserId'],'online':![],['pauseField']:![]};}var _0x7b9f3b={'id':_0x3a427d['id'],'name':_0x3a427d[_0x79da('0xe')],'online':Boolean(_0x3a427d[_0x79da('0x41')]),'paused':Boolean(_0x3a427d[_0x549a0f])};if(_0x7b9f3b[_0x79da('0x41')])_0x289191[_0x79da('0x32')]++;_0x289191[_0x79da('0x31')]['push'](_0x7b9f3b);}return _0x289191;});}function validateChannel(_0x182362){var _0x54a608=utils[_0x79da('0x47')]();if(!_[_0x79da('0x48')](_0x54a608,_0x182362[_0x79da('0x49')]()))throw new Error(_0x79da('0x4a'));return _0x182362[_0x79da('0x49')]();}exports[_0x79da('0x4b')]=function(_0x4de514,_0x3848e5){var _0x2ebd43={'count':0x0,'rows':[]};var _0xee5387={};var _0x34f834;var _0xe83c97;var _0xca21f1;var _0x42eb1f;var _0x269ed9=utils[_0x79da('0x47')]();var _0x21efb5=_0x4de514[_0x79da('0x4c')][_0x79da('0x4d')];var _0x12b182=_0x4de514[_0x79da('0x4c')]['globalStatusFilter'];var _0x351cd1=_0x4de514['query'][_0x79da('0x4e')];var _0x50c22d=_0x12b182===_0x79da('0x4f')||_0x12b182===_0x79da('0x50')?!![]:![];var _0x406c80=[];var _0x1ba7c3;Promise[_0x79da('0x51')]()[_0x79da('0x12')](function(){if(_0x4de514['query'][_0x79da('0x52')]){_0x34f834=validateChannel(_0x4de514[_0x79da('0x4c')]['channel']);}if(!_0x4de514[_0x79da('0x4c')]['sort']||!_0x4de514['query'][_0x79da('0x53')][_0x79da('0x48')](_0x79da('0x54'))){_0x4de514[_0x79da('0x4c')]['sort']=rta['validateSortParameter'](_0x4de514[_0x79da('0x4c')]['sort']);return;}var _0x24bd59=rta[_0x79da('0x55')](_0x4de514[_0x79da('0x4c')]['sort']);_0x4de514['query'][_0x79da('0x53')]=_0x24bd59[_0x79da('0x56')][_0x79da('0x57')](',');_0xe83c97=_0x24bd59[_0x79da('0x58')];})[_0x79da('0x12')](function(){if(!_0x21efb5){return[];}return rta[_0x79da('0x59')](_0x21efb5,_0x34f834);})[_0x79da('0x12')](function(_0x13f483){_0x406c80=_0x13f483;return rta['getRealtimeAgents']();})[_0x79da('0x12')](function(_0x4b37df){_0x42eb1f=_0x4b37df[_0x79da('0x5a')];if((!_0x12b182||_0x50c22d)&&!_0xe83c97){return _0x406c80;}if(_0xe83c97&&!_0x12b182){return rta[_0x79da('0x5b')](_0x42eb1f,_0x406c80,_0xe83c97);}else{return rta[_0x79da('0x5c')](_0x42eb1f,_0x406c80,_0x12b182);}})[_0x79da('0x12')](function(_0x3cbbfa){_0x406c80=_0x3cbbfa;var _0x4dc4df=![];if(_0x406c80[_0x79da('0x3f')]===0x0){if(_0x21efb5||_0x12b182){_0x4dc4df=!![];}if(_0x50c22d){_0x4dc4df=![];}}if(_0x4dc4df){return _0x2ebd43;}var _0x59476a=_['map'](db['User']['rawAttributes'],function(_0x3a4d42){return{'name':_0x3a4d42['fieldName'],'type':_0x3a4d42[_0x79da('0x5d')]['key']};});_0x4de514['query'][_0x79da('0x5e')]=_0x79da('0x5f');_0x4de514[_0x79da('0x4c')]['online']=!![];_0xee5387=qs[_0x79da('0x60')](_0x59476a,_0x4de514);_0xee5387['raw']=!![];var _0xd0b2a6=[];if(_0x406c80[_0x79da('0x3f')]>0x0){_0xd0b2a6[_0x79da('0x1e')]({'id':{'$in':_0x406c80}});if(_0xe83c97&&!_0x12b182){_0x1ba7c3=[db[_0x79da('0x61')][_0x79da('0x62')](_0x79da('0x63')+_0x406c80+')')];_0xee5387[_0x79da('0x58')]=_0x1ba7c3;}}if(_0x50c22d){_0x269ed9[_0x79da('0x64')](function(_0x466031){var _0x63613a=!![];if(_0x12b182==='*pause'&&_0x34f834!==_0x466031){_0x63613a=![];}_0xd0b2a6[_0x79da('0x1e')]({[_0x466031+_0x79da('0x44')]:_0x63613a});});if(_0x351cd1){_0xd0b2a6['push']({'pauseType':_0x351cd1});}}else if(_0x12b182){_0x269ed9[_0x79da('0x64')](function(_0x3b8370){_0xd0b2a6['push']({[_0x3b8370+_0x79da('0x44')]:![]});});}_0xee5387['where']=_['merge'](_0xee5387[_0x79da('0x65')],{'$and':_0xd0b2a6});if(_0x4de514[_0x79da('0x66')][_0x79da('0x5e')]===_0x79da('0x66')){var _0x5e1d2f={'params':{'id':_0x4de514[_0x79da('0x66')][_0x79da('0x67')]},'query':{'section':_0x79da('0x68'),'role':_0x79da('0x5f'),'online':!![],'raw':!![],'ids':_0x406c80,'customSorting':_0x1ba7c3}};if(_0x50c22d){_0x5e1d2f['query'][_0x79da('0x69')]=_0xd0b2a6;}_0x5e1d2f[_0x79da('0x4c')]=Object[_0x79da('0x6a')](_0x5e1d2f['query'],_0x4de514[_0x79da('0x4c')]);delete _0x5e1d2f[_0x79da('0x4c')]['id'];return db[_0x79da('0x6b')][_0x79da('0x6c')](_0x5e1d2f);}return db['User'][_0x79da('0x6d')](_0xee5387);})[_0x79da('0x12')](function(_0x4ff2e2){_0x2ebd43['count']=_0x4ff2e2[_0x79da('0x8')];_0xca21f1=_0x4ff2e2[_0x79da('0x5a')];return _0xca21f1[_0x79da('0x6e')](function(_0x26f58b){var _0x503e7b=_[_0x79da('0x36')](_0x42eb1f,['id',_0x26f58b['id']]);if(_0x503e7b){var _0x2a8153=rta[_0x79da('0x6f')](_0x503e7b);_['merge'](_0x26f58b,_0x2a8153);}_0x26f58b[_0x79da('0x54')]=rta['getAgentStatus'](_0x26f58b);if(_0x26f58b['globalStatus'][_0x79da('0x48')](_0x79da('0x4f'))){_0x269ed9['forEach'](function(_0x1bb6b5){if(_0x26f58b[_0x1bb6b5+_0x79da('0x44')]){_0x26f58b[_0x1bb6b5+'Status']=_0x79da('0x4f');}});}return _0x26f58b;});})[_0x79da('0x12')](function(_0x43884c){if(!_0xe83c97||_0x1ba7c3){return _0x43884c;}return rta[_0x79da('0x70')](_0x43884c,_0xe83c97);})[_0x79da('0x12')](function(_0x3293bb){_0x2ebd43[_0x79da('0x5a')]=_0x3293bb;return _0x2ebd43;})[_0x79da('0x12')](respondWithFilteredResult(_0x3848e5,_0xee5387))['catch'](handleError(_0x3848e5,null));};exports['getQueues']=function(_0x4c7d02,_0x544f1c){var _0x3d8147={'count':0x0,'rows':[]},_0x170350={},_0xdecfbf,_0x2e2cda,_0x2f818a,_0x4fcc7d,_0x50c455;Promise[_0x79da('0x51')]()['then'](function(){if(_0x4c7d02[_0x79da('0x4c')][_0x79da('0x52')])_0xdecfbf=validateChannel(_0x4c7d02[_0x79da('0x4c')][_0x79da('0x52')]);var _0xfd13d7=_[_0x79da('0x11')](_0xdecfbf)+'Queue';var _0x3aad27=_[_0x79da('0x6e')](db[_0xfd13d7]['rawAttributes'],function(_0x1f20a6){return{'name':_0x1f20a6[_0x79da('0x71')],'type':_0x1f20a6['type']['key']};});_0x170350=qs[_0x79da('0x60')](_0x3aad27,_0x4c7d02);if(_0x4c7d02[_0x79da('0x66')]['role']==='user'){var _0x51644a={'params':{'id':_0x4c7d02['user']['userProfileId']},'query':{'section':_0xdecfbf===_0x79da('0xf')&&_0x4c7d02[_0x79da('0x4c')][_0x79da('0x5d')]===_0x79da('0x34')?_0x79da('0x72'):_[_0x79da('0x11')](_0xdecfbf)+'Queues','type':_0x4c7d02[_0x79da('0x4c')][_0x79da('0x5d')],'nolimit':!![],'sort':'name','filter':_0x4c7d02[_0x79da('0x4c')]['filter']}};return db[_0x79da('0x6b')][_0x79da('0x6c')](_0x51644a);}return db[_0xfd13d7][_0x79da('0x6d')](_0x170350);})[_0x79da('0x12')](function(_0x7eff0e){_0x3d8147['count']=_0x7eff0e[_0x79da('0x8')];_0x2e2cda=_0x7eff0e[_0x79da('0x5a')];return getRealtimeQueues(_0x4c7d02,_0xdecfbf);})['then'](function(_0x75f6b5){_0x4fcc7d=_0x75f6b5['rows'];return rta[_0x79da('0x73')]();})[_0x79da('0x12')](function(_0x55d23c){_0x2f818a=_0x55d23c[_0x79da('0x5a')];if(_0xdecfbf!=_0x79da('0xf'))return;return getRealtimeVoiceQueueChannels();})[_0x79da('0x12')](function(_0x8a0b29){_0x50c455=_0x8a0b29?_0x8a0b29[_0x79da('0x5a')]:[];return initializeQueues(_0x2e2cda,_0x4fcc7d,_0xdecfbf,_0x4c7d02[_0x79da('0x4c')]['type']);})[_0x79da('0x12')](function(_0x3fa142){var _0x64d05=_0x3fa142[_0x79da('0x6e')](function(_0x58efd4){if(_0xdecfbf===_0x79da('0xf'))return getVoiceQueueAgents(_0x58efd4,_0x2e2cda,_0x2f818a,_0x50c455);else return getQueueAgents(_0x58efd4,_0x2f818a,_0xdecfbf);});return Promise[_0x79da('0x74')](_0x64d05);})[_0x79da('0x12')](function(_0x30b9cf){_0x3d8147[_0x79da('0x5a')]=_0x30b9cf;return _0x3d8147;})[_0x79da('0x12')](respondWithFilteredResult(_0x544f1c,_0x170350))[_0x79da('0x18')](handleError(_0x544f1c,null));}; \ No newline at end of file +var _0x48b0=['getChannels','includes','Invalid\x20channel','toLowerCase','getAgents','globalQueueFilter','globalStatusFilter','query','pauseTypeFilter','*pause','resolve','channel','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','rawAttributes','fieldName','key','role','agent','raw','literal','forEach','user','userProfileId','Agents','assign','getResources','rows','filterAgentAttributes','getAgentStatus','pause','Status','sortAgentsByStatus','Queue','getOptions','type','QueueCampaigns','findAndCountAll','all','util','lodash','../../components/realtime/agents','../../config/utils','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','Content-Range','json','error','name','status','send','request','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','then','result','loggedIn','available','waiting','talking','paused','voice','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','loggedInDb','find','merge','pick','filter','queue','busy','getMembers','UserId','accountcode','online','voiceStatus','User','Pause','findAll','QueueId','length'];(function(_0xbb47ab,_0x489a9a){var _0x2a2e48=function(_0x4ea51e){while(--_0x4ea51e){_0xbb47ab['push'](_0xbb47ab['shift']());}};_0x2a2e48(++_0x489a9a);}(_0x48b0,0x187));var _0x048b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x48b0[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x048b('0x0'));var _=require(_0x048b('0x1'));var jayson=require('jayson/promise');var rta=require(_0x048b('0x2'));var qs=require('../../components/parsers/qs');var utils=require(_0x048b('0x3'));var logger=require(_0x048b('0x4'))('api');var db=require(_0x048b('0x5'))['db'];var amiClient=jayson[_0x048b('0x6')][_0x048b('0x7')]({'port':0x232a});var routingClient=jayson[_0x048b('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x2f9a37,_0x10c207){return function(_0x41ff08){if(_0x41ff08){var _0x172236=typeof _0x10c207[_0x048b('0x8')]===_0x048b('0x9')&&typeof _0x10c207[_0x048b('0xa')]===_0x048b('0x9');var _0x19d63e=_0x41ff08[_0x048b('0xb')];var _0x14ac18=_0x172236?0x0:_0x10c207['offset'];var _0x5d448a=_0x172236?_0x41ff08[_0x048b('0xb')]:_0x10c207[_0x048b('0x8')]+_0x10c207['limit'];var _0x4c2920;if(_0x5d448a>=_0x19d63e){_0x5d448a=_0x19d63e;_0x4c2920=0xc8;}else{_0x4c2920=0xce;}_0x2f9a37['status'](_0x4c2920);return _0x2f9a37['set'](_0x048b('0xc'),_0x14ac18+'-'+_0x5d448a+'/'+_0x19d63e)[_0x048b('0xd')](_0x41ff08);}return null;};}function handleError(_0x47741a,_0x398ce6){_0x398ce6=_0x398ce6||0x1f4;return function(_0x51cde6){logger[_0x048b('0xe')](_0x51cde6['stack']);if(_0x51cde6[_0x048b('0xf')]){delete _0x51cde6[_0x048b('0xf')];}_0x47741a[_0x048b('0x10')](_0x398ce6)[_0x048b('0x11')](_0x51cde6);};}function getRealtimeQueues(_0x2b169f,_0x186292){return new Promise(function(_0x344197,_0x674356){var _0x2d0797=_0x186292==='voice'?amiClient:routingClient;return _0x2d0797[_0x048b('0x12')](_[_0x048b('0x13')](_0x186292)+_0x048b('0x14'),_0x2b169f)['then'](function(_0x47094d){if(_0x47094d[_0x048b('0xe')])throw new Error(util[_0x048b('0x15')](_0x048b('0x16'),_0x186292));return _0x344197(_0x47094d['result']);})[_0x048b('0x17')](function(_0x203a7f){_0x674356(_0x203a7f);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1d3b3d,_0x433b32){return amiClient[_0x048b('0x12')](_0x048b('0x18'),{})[_0x048b('0x19')](function(_0x70d62a){if(_0x70d62a[_0x048b('0xe')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x1d3b3d(_0x70d62a[_0x048b('0x1a')]);})['catch'](function(_0x122a25){_0x433b32(_0x122a25);});});}function initializeQueues(_0x518735,_0x42cd75,_0x5527fb,_0x46f09d){var _0xe7ea6d=[_0x048b('0x1b'),_0x048b('0x1c'),_0x048b('0x1d'),_0x048b('0x1e'),_0x048b('0x1f')];if(_0x5527fb===_0x048b('0x20')&&_0x46f09d===_0x048b('0x21')){_0xe7ea6d[_0x048b('0x22')](_0x048b('0x23'),_0x048b('0x24'),_0x048b('0x25'),_0x048b('0x26'),_0x048b('0x27'),_0x048b('0x28'),'startPredictive',_0x048b('0x29'),_0x048b('0x2a'),_0x048b('0x2b'),'erlangAbandonmentRate',_0x048b('0x2c'),_0x048b('0x2d'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x048b('0x2e'),'predictiveIntervalTotalCalls',_0x048b('0x2f'),'predictiveIntervalDroppedCallsTimeout',_0x048b('0x30'),'predictiveIntervalAvgHoldtime',_0x048b('0x31'));}return _0x518735[_0x048b('0x32')](function(_0x15168d){var _0x19d2b4=_0x15168d['get']({'plain':!![]});_0x19d2b4[_0x048b('0x33')]=[];_0x19d2b4[_0x048b('0x1f')]=0x0;_0x19d2b4[_0x048b('0x34')]=0x0;_0x19d2b4[_0x048b('0x1b')]=0x0;_0x19d2b4['available']=0x0;_0x19d2b4[_0x048b('0x1d')]=0x0;if(_0x5527fb===_0x048b('0x20')){_0x19d2b4['talking']=0x0;_0x19d2b4['busy']=0x0;if(_0x46f09d===_0x048b('0x21')){_0x19d2b4[_0x048b('0x23')]=0x0;_0x19d2b4[_0x048b('0x24')]=0x0;}}var _0x4f964c=_[_0x048b('0x35')](_0x42cd75,['id',_0x19d2b4['id']]);if(_0x4f964c)_[_0x048b('0x36')](_0x19d2b4,_[_0x048b('0x37')](_0x4f964c,_0xe7ea6d));return _0x19d2b4;});}function updateAgentVoiceStatus(_0x24126f,_0x5caa3d,_0x1179b8){var _0x3ad204=_[_0x048b('0x38')](_0x1179b8,[_0x048b('0x39'),_0x5caa3d['name']]);if(_0x3ad204['length']===0x0)return _0x24126f[_0x048b('0x3a')]=!![];if(_['some'](_0x3ad204,['connectedlinenum',_0x24126f['internal']['toString']()]))return _0x24126f['talking']=!![];if(!_0x24126f['talking'])return _0x24126f[_0x048b('0x3a')]=!![];}function getVoiceQueueAgents(_0x483370,_0x2bf81a,_0x31bd73,_0x3c923f){var _0x269645=_[_0x048b('0x35')](_0x2bf81a,['id',_0x483370['id']]);if(!_0x269645)return _0x483370;return _0x269645[_0x048b('0x3b')]({'raw':!![]})[_0x048b('0x19')](function(_0x1ee228){for(var _0x58e779=0x0;_0x58e779<_0x1ee228['length'];_0x58e779++){var _0x45bb71=_[_0x048b('0x35')](_0x31bd73,['id',_0x1ee228[_0x58e779][_0x048b('0x3c')]]);if(!_0x45bb71){_0x45bb71={'id':_0x1ee228[_0x58e779][_0x048b('0x3c')],'name':_0x1ee228[_0x58e779][_0x048b('0x3c')],'accountcode':'','online':![]};}var _0x27c1f6={'id':_0x45bb71['id'],'name':_0x45bb71[_0x048b('0xf')],'internal':_0x45bb71[_0x048b('0x3d')],'online':Boolean(_0x45bb71[_0x048b('0x3e')]),'paused':Boolean(_0x1ee228[_0x58e779][_0x048b('0x1f')])};if(_0x45bb71[_0x048b('0x3f')]===_0x048b('0x1e'))updateAgentVoiceStatus(_0x27c1f6,_0x483370,_0x3c923f);if(_0x27c1f6[_0x048b('0x3e')])_0x483370['loggedInDb']++;if(_0x27c1f6[_0x048b('0x3a')])_0x483370[_0x048b('0x3a')]++;if(_0x27c1f6[_0x048b('0x1f')]&&!_0x27c1f6[_0x048b('0x3a')]&&!_0x27c1f6[_0x048b('0x1e')])_0x483370[_0x048b('0x1f')]++;_0x483370[_0x048b('0x33')]['push'](_0x27c1f6);}return _0x483370;});}function getQueueAgents(_0x4f800a,_0x978ecd,_0x57a6f5){var _0x2d2718=_0x048b('0x40')+_[_0x048b('0x13')](_0x57a6f5)+'Queue';var _0x53e185=_0x57a6f5+_0x048b('0x41');return db[_0x2d2718][_0x048b('0x42')]({'where':{[_[_0x048b('0x13')](_0x57a6f5)+_0x048b('0x43')]:_0x4f800a['id']},'raw':!![]})[_0x048b('0x19')](function(_0x93b49e){for(var _0x4709f1=0x0;_0x4709f1<_0x93b49e[_0x048b('0x44')];_0x4709f1++){var _0x23a7b0=_[_0x048b('0x35')](_0x978ecd,['id',_0x93b49e[_0x4709f1][_0x048b('0x3c')]]);if(!_0x23a7b0){_0x23a7b0={'id':_0x93b49e[_0x4709f1][_0x048b('0x3c')],'name':_0x93b49e[_0x4709f1][_0x048b('0x3c')],'online':![],['pauseField']:![]};}var _0x96338={'id':_0x23a7b0['id'],'name':_0x23a7b0['name'],'online':Boolean(_0x23a7b0[_0x048b('0x3e')]),'paused':Boolean(_0x23a7b0[_0x53e185])};if(_0x96338['online'])_0x4f800a[_0x048b('0x34')]++;_0x4f800a[_0x048b('0x33')]['push'](_0x96338);}return _0x4f800a;});}function validateChannel(_0x5efbd8){var _0x58c34e=utils[_0x048b('0x45')]();if(!_[_0x048b('0x46')](_0x58c34e,_0x5efbd8['toLowerCase']()))throw new Error(_0x048b('0x47'));return _0x5efbd8[_0x048b('0x48')]();}exports[_0x048b('0x49')]=function(_0x4fbe47,_0x1a4aff){var _0x240deb={'count':0x0,'rows':[]};var _0x596803={};var _0x320ce2;var _0x292184;var _0x502a0f;var _0x44defd;var _0x69388b=utils[_0x048b('0x45')]();var _0x3e8f6e=_0x4fbe47['query'][_0x048b('0x4a')];var _0x18c618=_0x4fbe47['query'][_0x048b('0x4b')];var _0x1f774a=_0x4fbe47[_0x048b('0x4c')][_0x048b('0x4d')];var _0x52d52d=_0x18c618==='pause'||_0x18c618===_0x048b('0x4e')?!![]:![];var _0xa5881=[];var _0x19ddde;Promise[_0x048b('0x4f')]()['then'](function(){if(_0x4fbe47[_0x048b('0x4c')][_0x048b('0x50')]){_0x320ce2=validateChannel(_0x4fbe47[_0x048b('0x4c')]['channel']);}if(!_0x4fbe47['query'][_0x048b('0x51')]||!_0x4fbe47[_0x048b('0x4c')]['sort'][_0x048b('0x46')](_0x048b('0x52'))){_0x4fbe47[_0x048b('0x4c')]['sort']=rta[_0x048b('0x53')](_0x4fbe47['query'][_0x048b('0x51')]);return;}var _0x46b2d3=rta[_0x048b('0x54')](_0x4fbe47[_0x048b('0x4c')]['sort']);_0x4fbe47['query'][_0x048b('0x51')]=_0x46b2d3[_0x048b('0x55')]['join'](',');_0x292184=_0x46b2d3[_0x048b('0x56')];})['then'](function(){if(!_0x3e8f6e){return[];}return rta[_0x048b('0x57')](_0x3e8f6e,_0x320ce2);})['then'](function(_0x584212){_0xa5881=_0x584212;return rta[_0x048b('0x58')]();})[_0x048b('0x19')](function(_0x4dae93){_0x44defd=_0x4dae93['rows'];if((!_0x18c618||_0x52d52d)&&!_0x292184){return _0xa5881;}if(_0x292184&&!_0x18c618){return rta[_0x048b('0x59')](_0x44defd,_0xa5881,_0x292184);}else{return rta['getAgentIdsByStatus'](_0x44defd,_0xa5881,_0x18c618);}})[_0x048b('0x19')](function(_0x1416ef){_0xa5881=_0x1416ef;var _0x188598=![];if(_0xa5881['length']===0x0){if(_0x3e8f6e||_0x18c618){_0x188598=!![];}if(_0x52d52d){_0x188598=![];}}if(_0x188598){return _0x240deb;}var _0x354463=_['map'](db[_0x048b('0x40')][_0x048b('0x5a')],function(_0x4c0645){return{'name':_0x4c0645[_0x048b('0x5b')],'type':_0x4c0645['type'][_0x048b('0x5c')]};});_0x4fbe47['query'][_0x048b('0x5d')]=_0x048b('0x5e');_0x4fbe47[_0x048b('0x4c')][_0x048b('0x3e')]=!![];_0x596803=qs['getOptions'](_0x354463,_0x4fbe47);_0x596803[_0x048b('0x5f')]=!![];var _0x3518f7=[];if(_0xa5881[_0x048b('0x44')]>0x0){_0x3518f7[_0x048b('0x22')]({'id':{'$in':_0xa5881}});if(_0x292184&&!_0x18c618){_0x19ddde=[db['sequelize'][_0x048b('0x60')]('FIELD(id,'+_0xa5881+')')];_0x596803['order']=_0x19ddde;}}if(_0x52d52d){_0x69388b[_0x048b('0x61')](function(_0x426d1f){var _0x4247d6=!![];if(_0x18c618===_0x048b('0x4e')&&_0x320ce2!==_0x426d1f){_0x4247d6=![];}_0x3518f7['push']({[_0x426d1f+_0x048b('0x41')]:_0x4247d6});});if(_0x1f774a){_0x3518f7[_0x048b('0x22')]({'pauseType':_0x1f774a});}}else if(_0x18c618){_0x69388b[_0x048b('0x61')](function(_0x44e167){_0x3518f7[_0x048b('0x22')]({[_0x44e167+_0x048b('0x41')]:![]});});}_0x596803['where']=_[_0x048b('0x36')](_0x596803['where'],{'$and':_0x3518f7});if(_0x4fbe47[_0x048b('0x62')]['role']===_0x048b('0x62')){var _0x2c9324={'params':{'id':_0x4fbe47['user'][_0x048b('0x63')]},'query':{'section':_0x048b('0x64'),'role':'agent','online':!![],'raw':!![],'ids':_0xa5881,'customSorting':_0x19ddde}};if(_0x52d52d){_0x2c9324[_0x048b('0x4c')]['extraQueryConditions']=_0x3518f7;}_0x2c9324[_0x048b('0x4c')]=Object[_0x048b('0x65')](_0x2c9324[_0x048b('0x4c')],_0x4fbe47[_0x048b('0x4c')]);delete _0x2c9324[_0x048b('0x4c')]['id'];return db['UserProfile'][_0x048b('0x66')](_0x2c9324);}return db['User']['findAndCountAll'](_0x596803);})[_0x048b('0x19')](function(_0x42b753){_0x240deb[_0x048b('0xb')]=_0x42b753[_0x048b('0xb')];_0x502a0f=_0x42b753[_0x048b('0x67')];return _0x502a0f[_0x048b('0x32')](function(_0x426fa9){var _0x26ab07=_['find'](_0x44defd,['id',_0x426fa9['id']]);if(_0x26ab07){var _0x15d0e5=rta[_0x048b('0x68')](_0x26ab07);_['merge'](_0x426fa9,_0x15d0e5);}_0x426fa9['globalStatus']=rta[_0x048b('0x69')](_0x426fa9);if(_0x426fa9[_0x048b('0x52')][_0x048b('0x46')](_0x048b('0x6a'))){_0x69388b[_0x048b('0x61')](function(_0x430959){if(_0x426fa9[_0x430959+_0x048b('0x41')]){_0x426fa9[_0x430959+_0x048b('0x6b')]=_0x048b('0x6a');}});}return _0x426fa9;});})[_0x048b('0x19')](function(_0x2410ea){if(!_0x292184||_0x19ddde){return _0x2410ea;}return rta[_0x048b('0x6c')](_0x2410ea,_0x292184);})['then'](function(_0x10e60f){_0x240deb[_0x048b('0x67')]=_0x10e60f;return _0x240deb;})[_0x048b('0x19')](respondWithFilteredResult(_0x1a4aff,_0x596803))[_0x048b('0x17')](handleError(_0x1a4aff,null));};exports['getQueues']=function(_0x2c518a,_0x3b49eb){var _0xf58686={'count':0x0,'rows':[]},_0x17db63={},_0xc35b03,_0x10b01b,_0x4a023a,_0x49ef41,_0x42db41;Promise['resolve']()['then'](function(){if(_0x2c518a[_0x048b('0x4c')][_0x048b('0x50')])_0xc35b03=validateChannel(_0x2c518a[_0x048b('0x4c')][_0x048b('0x50')]);var _0x4700bf=_[_0x048b('0x13')](_0xc35b03)+_0x048b('0x6d');var _0x343120=_['map'](db[_0x4700bf][_0x048b('0x5a')],function(_0x48474c){return{'name':_0x48474c[_0x048b('0x5b')],'type':_0x48474c['type'][_0x048b('0x5c')]};});_0x17db63=qs[_0x048b('0x6e')](_0x343120,_0x2c518a);if(_0x2c518a[_0x048b('0x62')]['role']===_0x048b('0x62')){var _0x5165ea={'params':{'id':_0x2c518a[_0x048b('0x62')][_0x048b('0x63')]},'query':{'section':_0xc35b03===_0x048b('0x20')&&_0x2c518a[_0x048b('0x4c')][_0x048b('0x6f')]===_0x048b('0x21')?_0x048b('0x70'):_['startCase'](_0xc35b03)+'Queues','type':_0x2c518a[_0x048b('0x4c')][_0x048b('0x6f')],'nolimit':!![],'sort':_0x048b('0xf'),'filter':_0x2c518a['query']['filter']}};return db['UserProfile'][_0x048b('0x66')](_0x5165ea);}return db[_0x4700bf][_0x048b('0x71')](_0x17db63);})[_0x048b('0x19')](function(_0x55c470){_0xf58686[_0x048b('0xb')]=_0x55c470[_0x048b('0xb')];_0x10b01b=_0x55c470[_0x048b('0x67')];return getRealtimeQueues(_0x2c518a,_0xc35b03);})[_0x048b('0x19')](function(_0x2048a0){_0x49ef41=_0x2048a0['rows'];return rta[_0x048b('0x58')]();})[_0x048b('0x19')](function(_0x17a1e5){_0x4a023a=_0x17a1e5['rows'];if(_0xc35b03!=_0x048b('0x20'))return;return getRealtimeVoiceQueueChannels();})[_0x048b('0x19')](function(_0x165f5d){_0x42db41=_0x165f5d?_0x165f5d[_0x048b('0x67')]:[];return initializeQueues(_0x10b01b,_0x49ef41,_0xc35b03,_0x2c518a[_0x048b('0x4c')]['type']);})[_0x048b('0x19')](function(_0x2eebd7){var _0xf2e038=_0x2eebd7[_0x048b('0x32')](function(_0x3d01da){if(_0xc35b03===_0x048b('0x20'))return getVoiceQueueAgents(_0x3d01da,_0x10b01b,_0x4a023a,_0x42db41);else return getQueueAgents(_0x3d01da,_0x4a023a,_0xc35b03);});return Promise[_0x048b('0x72')](_0xf2e038);})[_0x048b('0x19')](function(_0x1df6bb){_0xf58686[_0x048b('0x67')]=_0x1df6bb;return _0xf58686;})[_0x048b('0x19')](respondWithFilteredResult(_0x3b49eb,_0x17db63))[_0x048b('0x17')](handleError(_0x3b49eb,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index ac7d315..0556da2 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(_0x3c29e5,_0x32eefb){var _0x53f102=function(_0x1b3a37){while(--_0x1b3a37){_0x3c29e5['push'](_0x3c29e5['shift']());}};_0x53f102(++_0x32eefb);}(_0x70e0,0x17b));var _0x070e=function(_0x4b93c0,_0x14324a){_0x4b93c0=_0x4b93c0-0x0;var _0x19eac7=_0x70e0[_0x4b93c0];return _0x19eac7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x59e21c,_0x4d77b9){var _0x199b4c=function(_0x3034f0){while(--_0x3034f0){_0x59e21c['push'](_0x59e21c['shift']());}};_0x199b4c(++_0x4d77b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 4817f6d..3f285a3 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 _0xd8a7=['DATE','STRING','INTEGER','sequelize'];(function(_0x4c9200,_0x370a82){var _0x116b46=function(_0x16c197){while(--_0x16c197){_0x4c9200['push'](_0x4c9200['shift']());}};_0x116b46(++_0x370a82);}(_0xd8a7,0xdf));var _0x7d8a=function(_0xbfa1ed,_0x449f82){_0xbfa1ed=_0xbfa1ed-0x0;var _0x10457c=_0xd8a7[_0xbfa1ed];return _0x10457c;};'use strict';var Sequelize=require(_0x7d8a('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7d8a('0x1')]},'uniqueid':{'type':Sequelize[_0x7d8a('0x2')]},'starttime':{'type':Sequelize[_0x7d8a('0x1')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x7d8a('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x7d8a('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x02ca=['INTEGER','STRING','DATE','sequelize'];(function(_0x4183f2,_0x361455){var _0x28def4=function(_0x54ad9a){while(--_0x54ad9a){_0x4183f2['push'](_0x4183f2['shift']());}};_0x28def4(++_0x361455);}(_0x02ca,0x97));var _0xa02c=function(_0x3ca9ff,_0x416bb1){_0x3ca9ff=_0x3ca9ff-0x0;var _0x5cd656=_0x02ca[_0x3ca9ff];return _0x5cd656;};'use strict';var Sequelize=require(_0xa02c('0x0'));module['exports']={'state':{'type':Sequelize[_0xa02c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa02c('0x2')]},'scheduledat':{'type':Sequelize[_0xa02c('0x3')]},'uniqueid':{'type':Sequelize[_0xa02c('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa02c('0x3')]},'ringtime':{'type':Sequelize[_0xa02c('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa02c('0x2')]},'campaigntype':{'type':Sequelize[_0xa02c('0x2')]},'membername':{'type':Sequelize[_0xa02c('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index edb6a40..ba45e6b 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 _0x4107=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x23f63d,_0x5d4f92){var _0x5eea4c=function(_0x4e7aa8){while(--_0x4e7aa8){_0x23f63d['push'](_0x23f63d['shift']());}};_0x5eea4c(++_0x5d4f92);}(_0x4107,0x71));var _0x7410=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x4107[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x7410('0x0'));var util=require(_0x7410('0x1'));var logger=require(_0x7410('0x2'))(_0x7410('0x3'));var moment=require(_0x7410('0x4'));var BPromise=require(_0x7410('0x5'));var rp=require(_0x7410('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7410('0x7'));var config=require(_0x7410('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x7410('0x9')]=function(_0x24ff9f,_0xb3d141){return _0x24ff9f[_0x7410('0xa')](_0x7410('0xb'),attributes,{'tableName':_0x7410('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b39=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x55c428,_0x50fc79){var _0x2d3846=function(_0x467356){while(--_0x467356){_0x55c428['push'](_0x55c428['shift']());}};_0x2d3846(++_0x50fc79);}(_0x9b39,0x125));var _0x99b3=function(_0x302aea,_0x16e445){_0x302aea=_0x302aea-0x0;var _0x3112be=_0x9b39[_0x302aea];return _0x3112be;};'use strict';var _=require('lodash');var util=require(_0x99b3('0x0'));var logger=require(_0x99b3('0x1'))('api');var moment=require(_0x99b3('0x2'));var BPromise=require('bluebird');var rp=require(_0x99b3('0x3'));var fs=require('fs');var path=require(_0x99b3('0x4'));var rimraf=require(_0x99b3('0x5'));var config=require(_0x99b3('0x6'));var attributes=require(_0x99b3('0x7'));module[_0x99b3('0x8')]=function(_0x5a9674,_0x3ae759){return _0x5a9674[_0x99b3('0x9')](_0x99b3('0xa'),attributes,{'tableName':_0x99b3('0xb'),'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 a5aaaaa..7b2f232 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 _0xb019=['bluebird','randomstring','../../config/environment','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','ReportAgentPreview','create','body','options','raw','util'];(function(_0x975237,_0x347cbe){var _0x99e9e=function(_0x37c262){while(--_0x37c262){_0x975237['push'](_0x975237['shift']());}};_0x99e9e(++_0x347cbe);}(_0xb019,0x7c));var _0x9b01=function(_0xfefb7f,_0xf83407){_0xfefb7f=_0xfefb7f-0x0;var _0x111404=_0xb019[_0xfefb7f];return _0x111404;};'use strict';var _=require('lodash');var util=require(_0x9b01('0x0'));var moment=require('moment');var BPromise=require(_0x9b01('0x1'));var rs=require(_0x9b01('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(_0x9b01('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x9b01('0x4')][_0x9b01('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2e9d2c,_0x248fd0,_0x36e516){return new BPromise(function(_0x1356fb,_0x3f1d3d){return client[_0x9b01('0x6')](_0x2e9d2c,_0x36e516)[_0x9b01('0x7')](function(_0x332852){logger[_0x9b01('0x8')](_0x9b01('0x9'),_0x248fd0,_0x9b01('0xa'));logger[_0x9b01('0xb')](_0x9b01('0xc'),_0x248fd0,'request\x20sent',JSON[_0x9b01('0xd')](_0x332852));if(_0x332852[_0x9b01('0xe')]){if(_0x332852[_0x9b01('0xe')][_0x9b01('0xf')]===0x1f4){logger[_0x9b01('0xe')](_0x9b01('0x9'),_0x248fd0,_0x332852[_0x9b01('0xe')][_0x9b01('0x10')]);return _0x3f1d3d(_0x332852[_0x9b01('0xe')]['message']);}logger[_0x9b01('0xe')](_0x9b01('0x9'),_0x248fd0,_0x332852[_0x9b01('0xe')][_0x9b01('0x10')]);return _0x1356fb(_0x332852['error']['message']);}else{logger[_0x9b01('0x8')](_0x9b01('0x9'),_0x248fd0,'request\x20sent');_0x1356fb(_0x332852[_0x9b01('0x11')]['message']);}})[_0x9b01('0x12')](function(_0x5dc8b4){logger[_0x9b01('0xe')](_0x9b01('0x9'),_0x248fd0,_0x5dc8b4);_0x3f1d3d(_0x5dc8b4);});});}exports[_0x9b01('0x13')]=function(_0x50a26c){var _0x2ce847=this;return new Promise(function(_0x152026,_0x1784e1){return db[_0x9b01('0x14')][_0x9b01('0x15')](_0x50a26c[_0x9b01('0x16')],{'raw':_0x50a26c[_0x9b01('0x17')]?_0x50a26c[_0x9b01('0x17')][_0x9b01('0x18')]===undefined?!![]:![]:!![]})[_0x9b01('0x7')](function(_0xd8ac0b){logger[_0x9b01('0x8')]('CreateReportAgentPreview',_0x50a26c);logger['debug']('CreateReportAgentPreview',_0x50a26c,JSON[_0x9b01('0xd')](_0xd8ac0b));_0x152026(_0xd8ac0b);})['catch'](function(_0x295f13){logger[_0x9b01('0xe')]('CreateReportAgentPreview',_0x295f13[_0x9b01('0x10')],_0x50a26c);_0x1784e1(_0x2ce847[_0x9b01('0xe')](0x1f4,_0x295f13[_0x9b01('0x10')]));});});}; \ No newline at end of file +var _0x4a73=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','debug','util'];(function(_0x53c371,_0x55a560){var _0x5b5bbb=function(_0x58c754){while(--_0x58c754){_0x53c371['push'](_0x53c371['shift']());}};_0x5b5bbb(++_0x55a560);}(_0x4a73,0x103));var _0x34a7=function(_0x48c97e,_0x5d8172){_0x48c97e=_0x48c97e-0x0;var _0x4cddda=_0x4a73[_0x48c97e];return _0x4cddda;};'use strict';var _=require('lodash');var util=require(_0x34a7('0x0'));var moment=require(_0x34a7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34a7('0x2'));var db=require(_0x34a7('0x3'))['db'];var utils=require(_0x34a7('0x4'));var logger=require(_0x34a7('0x5'))('rpc');var config=require(_0x34a7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x34a7('0x7')][_0x34a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c0091,_0x50088a,_0x2582ae){return new BPromise(function(_0x32c9bb,_0x428e5f){return client[_0x34a7('0x9')](_0x5c0091,_0x2582ae)[_0x34a7('0xa')](function(_0x7da44d){logger[_0x34a7('0xb')](_0x34a7('0xc'),_0x50088a,'request\x20sent');logger['debug'](_0x34a7('0xd'),_0x50088a,_0x34a7('0xe'),JSON[_0x34a7('0xf')](_0x7da44d));if(_0x7da44d[_0x34a7('0x10')]){if(_0x7da44d['error'][_0x34a7('0x11')]===0x1f4){logger['error'](_0x34a7('0xc'),_0x50088a,_0x7da44d[_0x34a7('0x10')][_0x34a7('0x12')]);return _0x428e5f(_0x7da44d['error'][_0x34a7('0x12')]);}logger['error'](_0x34a7('0xc'),_0x50088a,_0x7da44d[_0x34a7('0x10')][_0x34a7('0x12')]);return _0x32c9bb(_0x7da44d[_0x34a7('0x10')][_0x34a7('0x12')]);}else{logger['info'](_0x34a7('0xc'),_0x50088a,_0x34a7('0xe'));_0x32c9bb(_0x7da44d['result'][_0x34a7('0x12')]);}})[_0x34a7('0x13')](function(_0x261e64){logger[_0x34a7('0x10')](_0x34a7('0xc'),_0x50088a,_0x261e64);_0x428e5f(_0x261e64);});});}exports[_0x34a7('0x14')]=function(_0x1fc433){var _0x57d25a=this;return new Promise(function(_0x1c0532,_0x204ac9){return db[_0x34a7('0x15')][_0x34a7('0x16')](_0x1fc433['body'],{'raw':_0x1fc433['options']?_0x1fc433[_0x34a7('0x17')][_0x34a7('0x18')]===undefined?!![]:![]:!![]})[_0x34a7('0xa')](function(_0xae0cde){logger[_0x34a7('0xb')](_0x34a7('0x14'),_0x1fc433);logger[_0x34a7('0x19')]('CreateReportAgentPreview',_0x1fc433,JSON[_0x34a7('0xf')](_0xae0cde));_0x1c0532(_0xae0cde);})[_0x34a7('0x13')](function(_0x4278e2){logger[_0x34a7('0x10')]('CreateReportAgentPreview',_0x4278e2[_0x34a7('0x12')],_0x1fc433);_0x204ac9(_0x57d25a[_0x34a7('0x10')](0x1f4,_0x4278e2[_0x34a7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 453cbdb..1c0d9ec 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 _0x952f=['/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks'];(function(_0x62a56f,_0x4cedeb){var _0x156be0=function(_0x1bd40f){while(--_0x1bd40f){_0x62a56f['push'](_0x62a56f['shift']());}};_0x156be0(++_0x4cedeb);}(_0x952f,0x7a));var _0xf952=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x952f[_0x1bb47b];return _0x566418;};'use strict';var multer=require(_0xf952('0x0'));var util=require(_0xf952('0x1'));var path=require(_0xf952('0x2'));var express=require(_0xf952('0x3'));var router=express[_0xf952('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xf952('0x5'));router[_0xf952('0x6')]('/voice/channels',auth[_0xf952('0x7')](),controller[_0xf952('0x8')]);router[_0xf952('0x6')](_0xf952('0x9'),auth[_0xf952('0x7')](),controller[_0xf952('0xa')]);router[_0xf952('0x6')](_0xf952('0xb'),auth[_0xf952('0x7')](),controller[_0xf952('0xc')]);router[_0xf952('0x6')](_0xf952('0xd'),auth['isAuthenticated'](),controller[_0xf952('0xe')]);router[_0xf952('0x6')](_0xf952('0xf'),auth[_0xf952('0x7')](),controller[_0xf952('0x10')]);router[_0xf952('0x6')](_0xf952('0x11'),auth[_0xf952('0x7')](),controller[_0xf952('0x12')]);router[_0xf952('0x6')](_0xf952('0x13'),auth[_0xf952('0x7')](),controller[_0xf952('0x14')]);router[_0xf952('0x6')](_0xf952('0x15'),auth[_0xf952('0x7')](),controller[_0xf952('0x16')]);router[_0xf952('0x6')](_0xf952('0x17'),auth[_0xf952('0x7')](),controller[_0xf952('0x18')]);router[_0xf952('0x6')]('/whatsapp/queues',auth['isAuthenticated'](),controller['whatsappQueues']);router[_0xf952('0x6')](_0xf952('0x19'),auth[_0xf952('0x7')](),controller[_0xf952('0x1a')]);router[_0xf952('0x6')](_0xf952('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router['get'](_0xf952('0x1c'),auth[_0xf952('0x7')](),controller[_0xf952('0x1d')]);router[_0xf952('0x6')](_0xf952('0x1e'),auth['isAuthenticated'](),controller[_0xf952('0x1f')]);router[_0xf952('0x6')](_0xf952('0x20'),auth[_0xf952('0x7')](),controller[_0xf952('0x21')]);router[_0xf952('0x6')](_0xf952('0x22'),auth['isAuthenticated'](),controller[_0xf952('0x23')]);router[_0xf952('0x6')](_0xf952('0x24'),auth[_0xf952('0x7')](),controller[_0xf952('0x25')]);router[_0xf952('0x26')](_0xf952('0x24'),auth[_0xf952('0x7')](),controller['updateVoiceQueue']);router[_0xf952('0x6')]('/outbound',auth[_0xf952('0x7')](),controller[_0xf952('0x27')]);router[_0xf952('0x6')](_0xf952('0x28'),auth[_0xf952('0x7')](),controller[_0xf952('0x29')]);router[_0xf952('0x6')](_0xf952('0x2a'),auth[_0xf952('0x7')](),controller[_0xf952('0x2b')]);router[_0xf952('0x26')](_0xf952('0x2c'),auth[_0xf952('0x7')](),controller['agentCapacity']);router[_0xf952('0x6')](_0xf952('0x2d'),auth[_0xf952('0x7')](),controller[_0xf952('0x2e')]);router['get'](_0xf952('0x2f'),auth[_0xf952('0x7')](),controller['trunks']);router[_0xf952('0x6')](_0xf952('0x30'),auth[_0xf952('0x7')](),controller[_0xf952('0x31')]);router[_0xf952('0x6')](_0xf952('0x32'),auth[_0xf952('0x7')](),controller[_0xf952('0x33')]);router[_0xf952('0x6')](_0xf952('0x34'),auth[_0xf952('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xf952('0x6')]('/mail/queues/waitinginteractions',auth[_0xf952('0x7')](),controller[_0xf952('0x35')]);router[_0xf952('0x6')](_0xf952('0x36'),auth[_0xf952('0x7')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0xf952('0x37'),auth[_0xf952('0x7')](),controller[_0xf952('0x38')]);router[_0xf952('0x6')](_0xf952('0x39'),auth['isAuthenticated'](),controller[_0xf952('0x3a')]);router['get'](_0xf952('0x3b'),auth[_0xf952('0x7')](),controller[_0xf952('0x3c')]);router[_0xf952('0x6')](_0xf952('0x3d'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xf952('0x3e')]('/mail/queues/:id/notify',auth[_0xf952('0x7')](),controller['queueNotify']('mail'));router[_0xf952('0x6')](_0xf952('0x3f'),auth[_0xf952('0x7')](),controller[_0xf952('0x40')]);router['post'](_0xf952('0x41'),auth[_0xf952('0x7')](),controller[_0xf952('0x42')]('chat'));router['get'](_0xf952('0x43'),auth['isAuthenticated'](),controller[_0xf952('0x44')]);router[_0xf952('0x3e')](_0xf952('0x45'),auth[_0xf952('0x7')](),controller[_0xf952('0x42')](_0xf952('0x46')));router[_0xf952('0x6')](_0xf952('0x47'),auth['isAuthenticated'](),controller['showFaxQueues']);router['post'](_0xf952('0x48'),auth[_0xf952('0x7')](),controller['queueNotify'](_0xf952('0x49')));router['get']('/openchannel/queues/:id',auth[_0xf952('0x7')](),controller[_0xf952('0x4a')]);router[_0xf952('0x3e')](_0xf952('0x4b'),auth[_0xf952('0x7')](),controller[_0xf952('0x42')](_0xf952('0x4c')));router[_0xf952('0x3e')](_0xf952('0x4d'),auth[_0xf952('0x7')](),controller['queueNotify'](_0xf952('0x4e')));router[_0xf952('0x6')](_0xf952('0x4f'),auth[_0xf952('0x7')](),controller[_0xf952('0x50')]);router['get']('/whatsapp/queues/:id',auth[_0xf952('0x7')](),controller[_0xf952('0x51')]);router[_0xf952('0x3e')](_0xf952('0x52'),auth['isAuthenticated'](),controller[_0xf952('0x53')]);module[_0xf952('0x54')]=router; \ No newline at end of file +var _0xb4b4=['showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','showVoiceQueues','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xb4b4,0xb1));var _0x4b4b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xb4b4[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x4b4b('0x0'));var util=require(_0x4b4b('0x1'));var path=require(_0x4b4b('0x2'));var express=require('express');var router=express[_0x4b4b('0x3')]();var auth=require(_0x4b4b('0x4'));var controller=require(_0x4b4b('0x5'));router[_0x4b4b('0x6')]('/voice/channels',auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x8')]);router[_0x4b4b('0x6')](_0x4b4b('0x9'),auth['isAuthenticated'](),controller[_0x4b4b('0xa')]);router[_0x4b4b('0x6')](_0x4b4b('0xb'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0xc')]);router[_0x4b4b('0x6')]('/voice/queues',auth[_0x4b4b('0x7')](),controller[_0x4b4b('0xd')]);router[_0x4b4b('0x6')](_0x4b4b('0xe'),auth['isAuthenticated'](),controller[_0x4b4b('0xf')]);router['get']('/mail/queues',auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x10')]);router[_0x4b4b('0x6')](_0x4b4b('0x11'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x12')]);router['get'](_0x4b4b('0x13'),auth['isAuthenticated'](),controller[_0x4b4b('0x14')]);router[_0x4b4b('0x6')]('/sms/queues',auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x15')]);router[_0x4b4b('0x6')](_0x4b4b('0x16'),auth[_0x4b4b('0x7')](),controller['whatsappQueues']);router[_0x4b4b('0x6')](_0x4b4b('0x17'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x18')]);router['get'](_0x4b4b('0x19'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x1a')]);router[_0x4b4b('0x6')](_0x4b4b('0x1b'),auth['isAuthenticated'](),controller[_0x4b4b('0x1c')]);router['get'](_0x4b4b('0x1d'),auth[_0x4b4b('0x7')](),controller['voiceQueuesChannel']);router['get'](_0x4b4b('0x1e'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x1f')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x4b4b('0x6')]('/voice/queues/:id',auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x20')]);router[_0x4b4b('0x21')](_0x4b4b('0x22'),auth[_0x4b4b('0x7')](),controller['updateVoiceQueue']);router[_0x4b4b('0x6')](_0x4b4b('0x23'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x24')]);router[_0x4b4b('0x6')](_0x4b4b('0x25'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x26')]);router['get'](_0x4b4b('0x27'),auth['isAuthenticated'](),controller['agents']);router[_0x4b4b('0x21')](_0x4b4b('0x28'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x29')]);router[_0x4b4b('0x6')](_0x4b4b('0x2a'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x2b')]);router['get'](_0x4b4b('0x2c'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x2d')]);router['get'](_0x4b4b('0x2e'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x2f')]);router[_0x4b4b('0x6')](_0x4b4b('0x30'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x4b4b('0x6')]('/chat/queues/waitinginteractions',auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x31')]);router[_0x4b4b('0x6')](_0x4b4b('0x32'),auth[_0x4b4b('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x4b4b('0x6')](_0x4b4b('0x33'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x34')]);router[_0x4b4b('0x6')](_0x4b4b('0x35'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x36')]);router[_0x4b4b('0x6')](_0x4b4b('0x37'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x38')]);router[_0x4b4b('0x6')](_0x4b4b('0x39'),auth['isAuthenticated'](),controller[_0x4b4b('0x3a')]);router[_0x4b4b('0x6')](_0x4b4b('0x3b'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x4b4b('0x3c')](_0x4b4b('0x3d'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x3e')](_0x4b4b('0x3f')));router[_0x4b4b('0x6')](_0x4b4b('0x40'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x41')]);router[_0x4b4b('0x3c')](_0x4b4b('0x42'),auth['isAuthenticated'](),controller[_0x4b4b('0x3e')](_0x4b4b('0x43')));router[_0x4b4b('0x6')](_0x4b4b('0x44'),auth[_0x4b4b('0x7')](),controller['showChatQueues']);router[_0x4b4b('0x3c')](_0x4b4b('0x45'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x3e')](_0x4b4b('0x46')));router[_0x4b4b('0x6')](_0x4b4b('0x47'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x48')]);router['post'](_0x4b4b('0x49'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x3e')](_0x4b4b('0x4a')));router[_0x4b4b('0x6')](_0x4b4b('0x4b'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x4c')]);router[_0x4b4b('0x3c')]('/sms/queues/:id/notify',auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x3e')](_0x4b4b('0x4d')));router['post'](_0x4b4b('0x4e'),auth[_0x4b4b('0x7')](),controller['queueNotify'](_0x4b4b('0x4f')));router[_0x4b4b('0x6')](_0x4b4b('0x50'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x51')]);router[_0x4b4b('0x6')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x4b4b('0x52')]);router['post'](_0x4b4b('0x53'),auth[_0x4b4b('0x7')](),controller[_0x4b4b('0x54')]);module[_0x4b4b('0x55')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 46f182b..9641df5 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 _0xeff8=['error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','format','length','updateAttributes','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','Interaction','\x20Message\x20not\x20found','MessageId','From','QueueId','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','messageId','update','InteractionId','create','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xeff8,0x186));var _0x8eff=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xeff8[_0x424a9a];return _0xa7831c;};'use strict';var BPromise=require(_0x8eff('0x0'));var moment=require(_0x8eff('0x1'));var _=require('lodash');var util=require(_0x8eff('0x2'));var db=require(_0x8eff('0x3'))['db'];var logger=require(_0x8eff('0x4'))('api');var jayson=require(_0x8eff('0x5'));var amiClient=jayson[_0x8eff('0x6')][_0x8eff('0x7')]({'port':0x232a});var mailClient=jayson[_0x8eff('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x8eff('0x6')][_0x8eff('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){var _0x17f22b=_0x491f01?_0x491f01:amiClient;return _0x17f22b[_0x8eff('0x8')](_0x3409bc,_0x323b2)['then'](function(_0x56f120){if(_0x56f120[_0x8eff('0x9')]){if(_0x56f120[_0x8eff('0x9')][_0x8eff('0xa')]===0x1f4){return _0x19557f(_0x56f120['error'][_0x8eff('0xb')]);}return _0x3fb9ee(_0x56f120[_0x8eff('0x9')]['message']);}else{_0x3fb9ee(_0x56f120[_0x8eff('0xc')]);}})[_0x8eff('0xd')](function(_0x559143){_0x19557f(_0x559143);});});}function respondWithResult(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xc8;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0xe')](_0x45f280)[_0x8eff('0xf')](_0x43c914);}return _0x4a399e[_0x8eff('0x10')](0x194);};}function handleError(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0x1f4;return function(_0x212a2e){logger[_0x8eff('0x9')](_0x212a2e[_0x8eff('0x11')]);if(_0x212a2e[_0x8eff('0x12')]){delete _0x212a2e[_0x8eff('0x12')];}_0x56efdf[_0x8eff('0xe')](_0x3e7c01)[_0x8eff('0x13')](_0x212a2e);};}function findById(_0x16a4eb){return function(_0x427902){if(!_[_0x8eff('0x14')](_0x16a4eb)&&!_['isNil'](_0x427902)&&!_[_0x8eff('0x14')](_0x427902[_0x8eff('0x15')])){return _[_0x8eff('0x16')](_0x427902[_0x8eff('0x15')],function(_0x2cd7c5){return _0x2cd7c5['id']==_0x16a4eb;});}return null;};}exports[_0x8eff('0x17')]=function(_0x38f5ee,_0x399d96){return respondWithRpcPromise(_0x8eff('0x18'),_0x38f5ee[_0x8eff('0x19')])[_0x8eff('0x1a')](respondWithResult(_0x399d96,null))[_0x8eff('0xd')](handleError(_0x399d96,null));};exports[_0x8eff('0x1b')]=function(_0x2a7337,_0xdbb7b5){return respondWithRpcPromise(_0x8eff('0x1c'),_['merge'](_0x2a7337[_0x8eff('0x19')],_0x2a7337[_0x8eff('0x1d')]))['then'](respondWithResult(_0xdbb7b5,null))[_0x8eff('0xd')](handleError(_0xdbb7b5,null));};exports['voiceChannelStopMixMonitor']=function(_0x2fe360,_0x23c030){return respondWithRpcPromise(_0x8eff('0x1e'),_[_0x8eff('0x1f')](_0x2fe360[_0x8eff('0x19')],_0x2fe360['params']))[_0x8eff('0x1a')](respondWithResult(_0x23c030,null))[_0x8eff('0xd')](handleError(_0x23c030,null));};exports['voiceQueues']=function(_0x15b66f,_0x5ec3d7){return respondWithRpcPromise(_0x8eff('0x20'),_0x15b66f[_0x8eff('0x19')])[_0x8eff('0x1a')](respondWithResult(_0x5ec3d7,null))[_0x8eff('0xd')](handleError(_0x5ec3d7,null));};exports[_0x8eff('0x21')]=function(_0x2e8067,_0x516173){return respondWithRpcPromise(_0x8eff('0x20'),_0x2e8067[_0x8eff('0x19')])[_0x8eff('0x1a')](findById(_0x2e8067[_0x8eff('0x1d')]['id']))[_0x8eff('0x1a')](respondWithResult(_0x516173,null))[_0x8eff('0xd')](handleError(_0x516173,null));};exports['updateVoiceQueue']=function(_0x4ed3b8,_0x44dcdb){return respondWithRpcPromise(_0x8eff('0x22'),_[_0x8eff('0x1f')](_0x4ed3b8['body'],_0x4ed3b8[_0x8eff('0x1d')]))[_0x8eff('0x1a')](respondWithResult(_0x44dcdb,null))[_0x8eff('0xd')](handleError(_0x44dcdb,null));};exports[_0x8eff('0x23')]=function(_0x25b98e,_0x2c5727){return respondWithRpcPromise(_0x8eff('0x24'),_[_0x8eff('0x1f')](_0x25b98e[_0x8eff('0x19')],_0x25b98e[_0x8eff('0x1d')]))[_0x8eff('0x1a')](respondWithResult(_0x2c5727,null))[_0x8eff('0xd')](handleError(_0x2c5727,null));};exports['voiceQueuesChannels']=function(_0x2ad4b7,_0x165f8e){return respondWithRpcPromise(_0x8eff('0x25'),_0x2ad4b7[_0x8eff('0x19')])['then'](respondWithResult(_0x165f8e,null))[_0x8eff('0xd')](handleError(_0x165f8e,null));};exports[_0x8eff('0x26')]=function(_0x4c4220,_0x4e1256){return respondWithRpcPromise(_0x8eff('0x27'),_[_0x8eff('0x1f')](_0x4c4220['query'],_0x4c4220['params']))['then'](respondWithResult(_0x4e1256,null))[_0x8eff('0xd')](handleError(_0x4e1256,null));};exports['voiceQueuesChannelHangup']=function(_0x45d9d4,_0x59c9cc){return respondWithRpcPromise(_0x8eff('0x28'),_[_0x8eff('0x1f')](_0x45d9d4[_0x8eff('0x19')],_0x45d9d4[_0x8eff('0x1d')]))[_0x8eff('0x1a')](respondWithResult(_0x59c9cc,null))[_0x8eff('0xd')](handleError(_0x59c9cc,null));};exports['voiceQueuesChannelRedirect']=function(_0xd95908,_0x5907e0){return respondWithRpcPromise(_0x8eff('0x29'),_['merge'](_0xd95908[_0x8eff('0x19')],_0xd95908[_0x8eff('0x1d')]))[_0x8eff('0x1a')](respondWithResult(_0x5907e0,null))[_0x8eff('0xd')](handleError(_0x5907e0,null));};exports['outbound']=function(_0x2eb4bb,_0x170a33){return respondWithRpcPromise(_0x8eff('0x2a'),_0x2eb4bb['query'])[_0x8eff('0x1a')](respondWithResult(_0x170a33,null))[_0x8eff('0xd')](handleError(_0x170a33,null));};exports[_0x8eff('0x2b')]=function(_0x345bc7,_0x721c71){return respondWithRpcPromise(_0x8eff('0x2c'),_0x345bc7[_0x8eff('0x19')])[_0x8eff('0x1a')](respondWithResult(_0x721c71,null))[_0x8eff('0xd')](handleError(_0x721c71,null));};exports['agents']=function(_0x54a2d9,_0xf67cf3){var _0x114f8e;return respondWithRpcPromise(_0x8eff('0x2d'),_0x54a2d9[_0x8eff('0x19')])[_0x8eff('0x1a')](function(_0x1ba78a){_0x114f8e=_0x1ba78a;return respondWithRpcPromise(_0x8eff('0x2d'),_0x54a2d9['query'],routingClient);})[_0x8eff('0x1a')](function(_0x1c7332){return _['merge']({},_0x1c7332,_0x114f8e);})[_0x8eff('0x1a')](respondWithResult(_0xf67cf3,null))[_0x8eff('0xd')](handleError(_0xf67cf3,null));};exports[_0x8eff('0x2e')]=function(_0x18309b,_0xdc5e2f){if(_0x18309b[_0x8eff('0x2f')]&&_0x18309b[_0x8eff('0x2f')][_0x8eff('0x30')]&&_0x18309b[_0x8eff('0x31')]&&_0x18309b['user'][_0x8eff('0x12')]){for(var _0x27a8c9 in _0x18309b[_0x8eff('0x2f')][_0x8eff('0x30')]){if(_0x18309b[_0x8eff('0x2f')]['interaction'][_0x8eff('0x32')](_0x27a8c9)){db['MemberReport'][_0x8eff('0x33')]({'where':{'channel':_0x27a8c9,'membername':_0x18309b[_0x8eff('0x31')][_0x8eff('0x12')],'type':_0x8eff('0x34'),'exitAt':null,'uniqueid':_0x18309b['body'][_0x8eff('0x30')][_0x27a8c9]&&_0x18309b[_0x8eff('0x2f')][_0x8eff('0x30')][_0x27a8c9]['length']?{'$notIn':_0x18309b['body'][_0x8eff('0x30')][_0x27a8c9]}:{'$ne':null}}})[_0x8eff('0x1a')](function(_0x3bf913){var _0x22f173=moment()[_0x8eff('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x28cb8e=0x0,_0x51aa5d=_0x3bf913[_0x8eff('0x36')];_0x28cb8e<_0x51aa5d;_0x28cb8e+=0x1){_0x3bf913[_0x28cb8e][_0x8eff('0x37')]({'exitAt':_0x22f173});}});for(var _0x577a2b=0x0;_0x577a2b<_0x18309b['body']['interaction'][_0x27a8c9]['length'];_0x577a2b+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x27a8c9,'membername':_0x18309b[_0x8eff('0x31')][_0x8eff('0x12')],'type':_0x8eff('0x34'),'uniqueid':_0x18309b[_0x8eff('0x2f')][_0x8eff('0x30')][_0x27a8c9][_0x577a2b],'exitAt':null},'defaults':{'channel':_0x27a8c9,'membername':_0x18309b[_0x8eff('0x31')][_0x8eff('0x12')],'interface':_[_0x8eff('0x14')](_0x18309b[_0x8eff('0x31')][_0x8eff('0x38')])?util['format'](_0x8eff('0x39'),_0x18309b['user'][_0x8eff('0x12')]):_0x18309b[_0x8eff('0x31')][_0x8eff('0x38')],'type':_0x8eff('0x34'),'enterAt':moment()[_0x8eff('0x35')](_0x8eff('0x3a')),'role':_0x8eff('0x3b'),'internal':_0x18309b[_0x8eff('0x31')][_0x8eff('0x3c')],'uniqueid':_0x18309b[_0x8eff('0x2f')][_0x8eff('0x30')][_0x27a8c9][_0x577a2b]}});}}}}return respondWithRpcPromise(_0x8eff('0x3d'),{'id':_0x18309b['params']['id'],'capacity':_0x18309b[_0x8eff('0x2f')][_0x8eff('0x3e')]},routingClient)[_0x8eff('0x1a')](respondWithResult(_0xdc5e2f,null))[_0x8eff('0xd')](handleError(_0xdc5e2f,null));};exports[_0x8eff('0x3f')]=function(_0x2de7fd,_0x16473d){return respondWithRpcPromise(_0x8eff('0x40'),_0x2de7fd[_0x8eff('0x19')])['then'](respondWithResult(_0x16473d,null))['catch'](handleError(_0x16473d,null));};exports[_0x8eff('0x41')]=function(_0x36e2fd,_0x430f5e){return respondWithRpcPromise(_0x8eff('0x42'),_0x36e2fd[_0x8eff('0x19')])[_0x8eff('0x1a')](respondWithResult(_0x430f5e,null))['catch'](handleError(_0x430f5e,null));};exports[_0x8eff('0x43')]=function(_0x1ca203,_0x1d0a8e){return respondWithRpcPromise('Campaigns',_0x1ca203[_0x8eff('0x19')])[_0x8eff('0x1a')](respondWithResult(_0x1d0a8e,null))[_0x8eff('0xd')](handleError(_0x1d0a8e,null));};exports[_0x8eff('0x44')]=function(_0x549e88,_0x40de1d){return respondWithRpcPromise(_0x8eff('0x45'),_0x549e88[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x40de1d,null))[_0x8eff('0xd')](handleError(_0x40de1d,null));};exports[_0x8eff('0x46')]=function(_0x3f646d,_0x575b0e){return respondWithRpcPromise(_0x8eff('0x45'),_0x3f646d[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](findById(_0x3f646d[_0x8eff('0x1d')]['id']))[_0x8eff('0x1a')](respondWithResult(_0x575b0e,null))['catch'](handleError(_0x575b0e,null));};exports[_0x8eff('0x47')]=function(_0x16b968,_0x5d79b){return respondWithRpcPromise('MailQueues',_0x16b968[_0x8eff('0x19')],routingClient)['then'](respondWithResult(_0x5d79b,null))[_0x8eff('0xd')](handleError(_0x5d79b,null));};exports[_0x8eff('0x48')]=function(_0x23ed92,_0xfecdd8){return respondWithRpcPromise(_0x8eff('0x49'),_0x23ed92[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](findById(_0x23ed92['params']['id']))['then'](respondWithResult(_0xfecdd8,null))[_0x8eff('0xd')](handleError(_0xfecdd8,null));};exports['mailAccounts']=function(_0x3bfeac,_0x375ed3){return respondWithRpcPromise(_0x8eff('0x4a'),_0x3bfeac[_0x8eff('0x19')],mailClient)[_0x8eff('0x1a')](respondWithResult(_0x375ed3,null))['catch'](handleError(_0x375ed3,null));};exports[_0x8eff('0x4b')]=function(_0x36afc3,_0x1813df){return respondWithRpcPromise(_0x8eff('0x4c'),_0x36afc3[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x1813df,null))['catch'](handleError(_0x1813df,null));};exports[_0x8eff('0x4d')]=function(_0x5c0ea3,_0x2e45c2){return respondWithRpcPromise(_0x8eff('0x4c'),_0x5c0ea3['query'],routingClient)[_0x8eff('0x1a')](findById(_0x5c0ea3[_0x8eff('0x1d')]['id']))[_0x8eff('0x1a')](respondWithResult(_0x2e45c2,null))[_0x8eff('0xd')](handleError(_0x2e45c2,null));};exports[_0x8eff('0x4e')]=function(_0x35467c,_0xabdd84){return respondWithRpcPromise(_0x8eff('0x4f'),_0x35467c['query'],routingClient)[_0x8eff('0x1a')](respondWithResult(_0xabdd84,null))['catch'](handleError(_0xabdd84,null));};exports['showSmsQueues']=function(_0x1a748f,_0x47626e){return respondWithRpcPromise('SmsQueues',_0x1a748f[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](findById(_0x1a748f['params']['id']))[_0x8eff('0x1a')](respondWithResult(_0x47626e,null))[_0x8eff('0xd')](handleError(_0x47626e,null));};exports['whatsappQueues']=function(_0xc70ecc,_0x1c6ee1){return respondWithRpcPromise(_0x8eff('0x50'),_0xc70ecc[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x1c6ee1,null))[_0x8eff('0xd')](handleError(_0x1c6ee1,null));};exports[_0x8eff('0x51')]=function(_0x58c9e6,_0x479a4b){return respondWithRpcPromise(_0x8eff('0x50'),_0x58c9e6[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](findById(_0x58c9e6[_0x8eff('0x1d')]['id']))[_0x8eff('0x1a')](respondWithResult(_0x479a4b,null))[_0x8eff('0xd')](handleError(_0x479a4b,null));};exports[_0x8eff('0x52')]=function(_0x4f1c54,_0x593a18){return respondWithRpcPromise(_0x8eff('0x53'),_0x4f1c54['query'],routingClient)['then'](respondWithResult(_0x593a18,null))['catch'](handleError(_0x593a18,null));};exports[_0x8eff('0x54')]=function(_0x436db2,_0x461026){return respondWithRpcPromise(_0x8eff('0x53'),_0x436db2[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](findById(_0x436db2[_0x8eff('0x1d')]['id']))[_0x8eff('0x1a')](respondWithResult(_0x461026,null))['catch'](handleError(_0x461026,null));};exports[_0x8eff('0x55')]=function(_0x5492df,_0x42efc6){return respondWithRpcPromise(_0x8eff('0x56'),_0x5492df[_0x8eff('0x19')])[_0x8eff('0x1a')](respondWithResult(_0x42efc6,null))[_0x8eff('0xd')](handleError(_0x42efc6,null));};exports[_0x8eff('0x57')]=function(_0x570728,_0x3db0d8){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x570728[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x3db0d8,null))[_0x8eff('0xd')](handleError(_0x3db0d8,null));};exports[_0x8eff('0x58')]=function(_0x41d7e2,_0x2f30cb){return respondWithRpcPromise(_0x8eff('0x59'),_0x41d7e2[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x2f30cb,null))['catch'](handleError(_0x2f30cb,null));};exports[_0x8eff('0x5a')]=function(_0x73b49f,_0x1299b5){return respondWithRpcPromise(_0x8eff('0x5b'),_0x73b49f[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x1299b5,null))[_0x8eff('0xd')](handleError(_0x1299b5,null));};exports[_0x8eff('0x5c')]=function(_0x3350b8,_0x123673){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3350b8['query'],routingClient)['then'](function(_0x5f3443){if(_0x3350b8[_0x8eff('0x19')][_0x8eff('0x5d')]!==undefined){var _0x2a15ba=_(_0x5f3443[_0x8eff('0x15')])[_0x8eff('0x5e')]([_0x3350b8[_0x8eff('0x19')][_0x8eff('0x5d')],_0x3350b8['params']['id']])[_0x8eff('0x5f')](_0x8eff('0x60'))[_0x8eff('0x61')]()[_0x8eff('0x62')]();return _0x5f3443['rows'][_0x8eff('0x5e')](function(_0x34ca22){return _0x2a15ba['indexOf'](_0x34ca22[_0x8eff('0x60')])>-0x1;});}else{return _0x5f3443[_0x8eff('0x15')][_0x8eff('0x5e')](function(_0x47e24f){return _0x47e24f['queue_id']===parseInt(_0x3350b8['params']['id']);});}})[_0x8eff('0x1a')](respondWithResult(_0x123673,null))[_0x8eff('0xd')](handleError(_0x123673,null));};exports[_0x8eff('0x63')]=function(_0x168465,_0xaca1b5){return respondWithRpcPromise(_0x8eff('0x64'),_0x168465[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0xaca1b5,null))[_0x8eff('0xd')](handleError(_0xaca1b5,null));};exports[_0x8eff('0x65')]=function(_0x4272e8,_0x5c8a83){return respondWithRpcPromise(_0x8eff('0x66'),_0x4272e8['query'],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x5c8a83,null))[_0x8eff('0xd')](handleError(_0x5c8a83,null));};exports['faxQueuesWaitingInteractions']=function(_0x9c448b,_0x536b6f){return respondWithRpcPromise(_0x8eff('0x67'),_0x9c448b[_0x8eff('0x19')],routingClient)[_0x8eff('0x1a')](respondWithResult(_0x536b6f,null))[_0x8eff('0xd')](handleError(_0x536b6f,null));};exports[_0x8eff('0x68')]=function(_0x4a4603){return function(_0x842ad7,_0x56fd7d){var _0xd5edc5,_0x19768b;var _0x30c321=_[_0x8eff('0x69')](_0x4a4603);var _0x52be06=_0x4a4603===_0x8eff('0x6a')?_0x8eff('0x6b'):_0x8eff('0x6c');return db[_0x30c321+_0x8eff('0x6d')]['findOne']({'raw':!![],'where':{'id':_0x842ad7[_0x8eff('0x1d')]['id']}})[_0x8eff('0x1a')](function(_0x10e26f){if(_[_0x8eff('0x14')](_0x10e26f)){throw new Error(_0x30c321+_0x8eff('0x6e'));}_0xd5edc5=_0x10e26f;return db[_0x30c321+'Message'][_0x8eff('0x6f')]({'where':{'id':_0x842ad7[_0x8eff('0x2f')]['messageId']},'include':[{'model':db[_0x30c321+'Interaction'],'as':_0x8eff('0x70')},{'model':db[_0x30c321+_0x52be06],'as':_0x8eff('0x6c')}]});})[_0x8eff('0x1a')](function(_0xe31924){if(_[_0x8eff('0x14')](_0xe31924)){throw new Error(_0x30c321+_0x8eff('0x71'));}_0x19768b=_0xe31924;return _0xe31924['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x8eff('0x1a')](function(){var _0x522e5f={'uniqueid':_0x4a4603+'.'+_0x19768b['id']+'.'+_0x19768b[_0x8eff('0x70')]['id'],'FromUserId':_0x842ad7[_0x8eff('0x31')]['id'],'type':'queue'};_0x522e5f[_0x30c321+_0x8eff('0x72')]=_0x19768b['id'];_0x522e5f[_0x30c321+'InteractionId']=_0x19768b['Interaction']['id'];_0x522e5f[_0x8eff('0x73')+_0x30c321+_0x52be06+'Id']=_0x19768b['Account']['id'];_0x522e5f['To'+_0x30c321+_0x8eff('0x74')]=_0xd5edc5['id'];return db[_0x30c321+_0x8eff('0x75')]['create'](_0x522e5f);})[_0x8eff('0x1a')](function(){return respondWithRpcPromise(_0x8eff('0x76'),{'channel':_0x4a4603,'interaction':_0x19768b['Interaction'],'message':_0x19768b,'account':_0x19768b[_0x8eff('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8eff('0x77'),'appdata':_0xd5edc5[_0x8eff('0x12')]+','+(_0x19768b[_0x8eff('0x6c')][_0x8eff('0x78')]||0x12c),'interval':_0x8eff('0x79')}]},routingClient);})[_0x8eff('0x1a')](respondWithResult(_0x56fd7d,null))[_0x8eff('0xd')](handleError(_0x56fd7d,null));};};exports[_0x8eff('0x7a')]=function(_0x4aa16e,_0x4f7209){var _0x4c9436,_0x338269;if(_[_0x8eff('0x14')](_0x4aa16e[_0x8eff('0x2f')]['channel'])){throw new Error(_0x8eff('0x7b'));}var _0x35cf4c=_0x4aa16e[_0x8eff('0x2f')][_0x8eff('0x7c')];var _0x2c9646=_[_0x8eff('0x69')](_0x35cf4c);var _0x5ee248=_0x35cf4c===_0x8eff('0x6a')?'Website':_0x8eff('0x6c');return db[_0x8eff('0x7d')][_0x8eff('0x6f')]({'raw':!![],'where':{'id':_0x4aa16e[_0x8eff('0x1d')]['id'],'role':_0x8eff('0x3b')}})[_0x8eff('0x1a')](function(_0x476701){if(_['isNil'](_0x476701)){throw new Error(_0x8eff('0x7e'));}_0x4c9436=_0x476701;return db[_0x2c9646+_0x8eff('0x7f')][_0x8eff('0x6f')]({'where':{'id':_0x4aa16e[_0x8eff('0x2f')][_0x8eff('0x80')]},'include':[{'model':db[_0x2c9646+'Interaction'],'as':_0x8eff('0x70')},{'model':db[_0x2c9646+_0x5ee248],'as':_0x8eff('0x6c')}]});})[_0x8eff('0x1a')](function(_0x488a69){if(_['isNil'](_0x488a69)){throw new Error(_0x2c9646+_0x8eff('0x71'));}_0x338269=_0x488a69;return _0x488a69[_0x8eff('0x81')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8eff('0x1a')](function(){var _0x58db46={'uniqueid':_0x35cf4c+'.'+_0x338269['id']+'.'+_0x338269[_0x8eff('0x70')]['id'],'FromUserId':_0x4aa16e['user']['id'],'type':'queue','ToUserId':_0x4c9436['id']};_0x58db46[_0x2c9646+_0x8eff('0x72')]=_0x338269['id'];_0x58db46[_0x2c9646+_0x8eff('0x82')]=_0x338269[_0x8eff('0x70')]['id'];_0x58db46[_0x8eff('0x73')+_0x2c9646+_0x5ee248+'Id']=_0x338269[_0x8eff('0x6c')]['id'];return db[_0x2c9646+_0x8eff('0x75')][_0x8eff('0x83')](_0x58db46);})[_0x8eff('0x1a')](function(){return respondWithRpcPromise(_0x8eff('0x76'),{'channel':_0x35cf4c,'interaction':_0x338269[_0x8eff('0x70')],'message':_0x338269,'account':_0x338269[_0x8eff('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8eff('0x3b'),'appdata':_0x4c9436['name']+','+(_0x338269[_0x8eff('0x6c')][_0x8eff('0x84')]||0x12c),'interval':_0x8eff('0x79')}]},routingClient);})[_0x8eff('0x1a')](respondWithResult(_0x4f7209,null))[_0x8eff('0xd')](handleError(_0x4f7209,null));}; \ No newline at end of file +var _0x7217=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','map','value','filter','indexOf','queue_id','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','Message','findOne','messageId','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','channel','Channel\x20field\x20is\x20mandatory','\x20Message\x20not\x20found','update','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','http','client','request','then','error','code','message','result','catch','json','sendStatus','stack','send','isNil','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','SIP/%s','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7217,0x19e));var _0x7721=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7217[_0x45e98e];return _0x374dba;};'use strict';var BPromise=require(_0x7721('0x0'));var moment=require('moment');var _=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var db=require(_0x7721('0x3'))['db'];var logger=require(_0x7721('0x4'))(_0x7721('0x5'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x7721('0x6')]({'port':0x232a});var mailClient=jayson[_0x7721('0x7')][_0x7721('0x6')]({'port':0x232b});var routingClient=jayson[_0x7721('0x7')][_0x7721('0x6')]({'port':0x232c});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){var _0x3e6368=_0x21f680?_0x21f680:amiClient;return _0x3e6368[_0x7721('0x8')](_0xf7ff37,_0x18ab6b)[_0x7721('0x9')](function(_0x138740){if(_0x138740[_0x7721('0xa')]){if(_0x138740['error'][_0x7721('0xb')]===0x1f4){return _0x2f99ed(_0x138740[_0x7721('0xa')][_0x7721('0xc')]);}return _0x225610(_0x138740[_0x7721('0xa')][_0x7721('0xc')]);}else{_0x225610(_0x138740[_0x7721('0xd')]);}})[_0x7721('0xe')](function(_0x27b36b){_0x2f99ed(_0x27b36b);});});}function respondWithResult(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xc8;return function(_0x199930){if(_0x199930){return _0x55b4ca['status'](_0x2911ec)[_0x7721('0xf')](_0x199930);}return _0x55b4ca[_0x7721('0x10')](0x194);};}function handleError(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0x1f4;return function(_0x5069da){logger[_0x7721('0xa')](_0x5069da[_0x7721('0x11')]);if(_0x5069da['name']){delete _0x5069da['name'];}_0x3f01c5['status'](_0x2e9752)[_0x7721('0x12')](_0x5069da);};}function findById(_0x25a628){return function(_0x3cc909){if(!_[_0x7721('0x13')](_0x25a628)&&!_['isNil'](_0x3cc909)&&!_[_0x7721('0x13')](_0x3cc909['rows'])){return _[_0x7721('0x14')](_0x3cc909['rows'],function(_0xfec626){return _0xfec626['id']==_0x25a628;});}return null;};}exports[_0x7721('0x15')]=function(_0x3ab5a5,_0x3e140d){return respondWithRpcPromise(_0x7721('0x16'),_0x3ab5a5[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x3e140d,null))[_0x7721('0xe')](handleError(_0x3e140d,null));};exports[_0x7721('0x18')]=function(_0xaeccc4,_0x4ce1db){return respondWithRpcPromise(_0x7721('0x19'),_[_0x7721('0x1a')](_0xaeccc4[_0x7721('0x17')],_0xaeccc4[_0x7721('0x1b')]))['then'](respondWithResult(_0x4ce1db,null))[_0x7721('0xe')](handleError(_0x4ce1db,null));};exports['voiceChannelStopMixMonitor']=function(_0xb9e9dd,_0x288e3a){return respondWithRpcPromise(_0x7721('0x1c'),_[_0x7721('0x1a')](_0xb9e9dd[_0x7721('0x17')],_0xb9e9dd[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x288e3a,null))['catch'](handleError(_0x288e3a,null));};exports[_0x7721('0x1d')]=function(_0x1abedb,_0x125564){return respondWithRpcPromise(_0x7721('0x1e'),_0x1abedb[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x125564,null))[_0x7721('0xe')](handleError(_0x125564,null));};exports[_0x7721('0x1f')]=function(_0x40f367,_0x52316e){return respondWithRpcPromise(_0x7721('0x1e'),_0x40f367['query'])['then'](findById(_0x40f367[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x52316e,null))[_0x7721('0xe')](handleError(_0x52316e,null));};exports[_0x7721('0x20')]=function(_0x1ea4d,_0x37b9f0){return respondWithRpcPromise(_0x7721('0x21'),_[_0x7721('0x1a')](_0x1ea4d['body'],_0x1ea4d[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x37b9f0,null))['catch'](handleError(_0x37b9f0,null));};exports['voiceQueuesPreview']=function(_0xfde9ec,_0x220bbf){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x7721('0x1a')](_0xfde9ec[_0x7721('0x17')],_0xfde9ec[_0x7721('0x1b')]))['then'](respondWithResult(_0x220bbf,null))[_0x7721('0xe')](handleError(_0x220bbf,null));};exports[_0x7721('0x22')]=function(_0x1492d4,_0x3f15e2){return respondWithRpcPromise(_0x7721('0x23'),_0x1492d4['query'])[_0x7721('0x9')](respondWithResult(_0x3f15e2,null))[_0x7721('0xe')](handleError(_0x3f15e2,null));};exports[_0x7721('0x24')]=function(_0x5c5b33,_0x35de7a){return respondWithRpcPromise(_0x7721('0x25'),_['merge'](_0x5c5b33[_0x7721('0x17')],_0x5c5b33['params']))[_0x7721('0x9')](respondWithResult(_0x35de7a,null))[_0x7721('0xe')](handleError(_0x35de7a,null));};exports[_0x7721('0x26')]=function(_0x1d894b,_0x1c84c0){return respondWithRpcPromise(_0x7721('0x27'),_[_0x7721('0x1a')](_0x1d894b[_0x7721('0x17')],_0x1d894b[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x1c84c0,null))[_0x7721('0xe')](handleError(_0x1c84c0,null));};exports['voiceQueuesChannelRedirect']=function(_0xd1df68,_0x5e6663){return respondWithRpcPromise(_0x7721('0x28'),_[_0x7721('0x1a')](_0xd1df68[_0x7721('0x17')],_0xd1df68[_0x7721('0x1b')]))[_0x7721('0x9')](respondWithResult(_0x5e6663,null))[_0x7721('0xe')](handleError(_0x5e6663,null));};exports['outbound']=function(_0x557c34,_0x4cadef){return respondWithRpcPromise('Outbound',_0x557c34[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x4cadef,null))[_0x7721('0xe')](handleError(_0x4cadef,null));};exports[_0x7721('0x29')]=function(_0x4a90ce,_0xa389fa){return respondWithRpcPromise('OutboundChannels',_0x4a90ce[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0xa389fa,null))['catch'](handleError(_0xa389fa,null));};exports[_0x7721('0x2a')]=function(_0x3a47c8,_0x4e77ff){var _0x4d0111;return respondWithRpcPromise(_0x7721('0x2b'),_0x3a47c8[_0x7721('0x17')])[_0x7721('0x9')](function(_0x15e34d){_0x4d0111=_0x15e34d;return respondWithRpcPromise('Agents',_0x3a47c8[_0x7721('0x17')],routingClient);})[_0x7721('0x9')](function(_0x40ce8c){return _[_0x7721('0x1a')]({},_0x40ce8c,_0x4d0111);})[_0x7721('0x9')](respondWithResult(_0x4e77ff,null))['catch'](handleError(_0x4e77ff,null));};exports[_0x7721('0x2c')]=function(_0x4a2c28,_0xaa3216){if(_0x4a2c28['body']&&_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')]&&_0x4a2c28[_0x7721('0x2f')]&&_0x4a2c28['user'][_0x7721('0x30')]){for(var _0x11d853 in _0x4a2c28[_0x7721('0x2d')]['interaction']){if(_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x7721('0x31')](_0x11d853)){db[_0x7721('0x32')][_0x7721('0x33')]({'where':{'channel':_0x11d853,'membername':_0x4a2c28[_0x7721('0x2f')][_0x7721('0x30')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4a2c28['body'][_0x7721('0x2e')][_0x11d853]&&_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x7721('0x34')]?{'$notIn':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853]}:{'$ne':null}}})[_0x7721('0x9')](function(_0x2966fe){var _0xa601bc=moment()[_0x7721('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x578867=0x0,_0x5ed70d=_0x2966fe[_0x7721('0x34')];_0x578867<_0x5ed70d;_0x578867+=0x1){_0x2966fe[_0x578867][_0x7721('0x36')]({'exitAt':_0xa601bc});}});for(var _0x219c9f=0x0;_0x219c9f<_0x4a2c28['body'][_0x7721('0x2e')][_0x11d853][_0x7721('0x34')];_0x219c9f+=0x1){db['MemberReport'][_0x7721('0x37')]({'where':{'channel':_0x11d853,'membername':_0x4a2c28['user'][_0x7721('0x30')],'type':'INTERACTION','uniqueid':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x219c9f],'exitAt':null},'defaults':{'channel':_0x11d853,'membername':_0x4a2c28[_0x7721('0x2f')]['name'],'interface':_[_0x7721('0x13')](_0x4a2c28[_0x7721('0x2f')]['interface'])?util[_0x7721('0x35')](_0x7721('0x38'),_0x4a2c28[_0x7721('0x2f')]['name']):_0x4a2c28[_0x7721('0x2f')]['interface'],'type':_0x7721('0x39'),'enterAt':moment()[_0x7721('0x35')](_0x7721('0x3a')),'role':_0x7721('0x3b'),'internal':_0x4a2c28[_0x7721('0x2f')][_0x7721('0x3c')],'uniqueid':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x2e')][_0x11d853][_0x219c9f]}});}}}}return respondWithRpcPromise(_0x7721('0x3d'),{'id':_0x4a2c28[_0x7721('0x1b')]['id'],'capacity':_0x4a2c28[_0x7721('0x2d')][_0x7721('0x3e')]},routingClient)[_0x7721('0x9')](respondWithResult(_0xaa3216,null))[_0x7721('0xe')](handleError(_0xaa3216,null));};exports[_0x7721('0x3f')]=function(_0x5b741d,_0x474f32){return respondWithRpcPromise(_0x7721('0x40'),_0x5b741d[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x474f32,null))[_0x7721('0xe')](handleError(_0x474f32,null));};exports[_0x7721('0x41')]=function(_0x267f5e,_0x57484c){return respondWithRpcPromise(_0x7721('0x42'),_0x267f5e[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x57484c,null))[_0x7721('0xe')](handleError(_0x57484c,null));};exports[_0x7721('0x43')]=function(_0x9c0d4,_0x7fbd6c){return respondWithRpcPromise(_0x7721('0x44'),_0x9c0d4[_0x7721('0x17')])[_0x7721('0x9')](respondWithResult(_0x7fbd6c,null))[_0x7721('0xe')](handleError(_0x7fbd6c,null));};exports['chatQueues']=function(_0x421c27,_0xadb365){return respondWithRpcPromise(_0x7721('0x45'),_0x421c27[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0xadb365,null))[_0x7721('0xe')](handleError(_0xadb365,null));};exports[_0x7721('0x46')]=function(_0x36fe6f,_0x360882){return respondWithRpcPromise(_0x7721('0x45'),_0x36fe6f[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x36fe6f[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x360882,null))[_0x7721('0xe')](handleError(_0x360882,null));};exports['mailQueues']=function(_0x50e9e9,_0x4e112e){return respondWithRpcPromise(_0x7721('0x47'),_0x50e9e9['query'],routingClient)['then'](respondWithResult(_0x4e112e,null))['catch'](handleError(_0x4e112e,null));};exports['showMailQueues']=function(_0x47925a,_0x219181){return respondWithRpcPromise(_0x7721('0x47'),_0x47925a['query'],routingClient)[_0x7721('0x9')](findById(_0x47925a['params']['id']))['then'](respondWithResult(_0x219181,null))['catch'](handleError(_0x219181,null));};exports[_0x7721('0x48')]=function(_0x4f0d38,_0x48e7e3){return respondWithRpcPromise('MailAccounts',_0x4f0d38[_0x7721('0x17')],mailClient)[_0x7721('0x9')](respondWithResult(_0x48e7e3,null))[_0x7721('0xe')](handleError(_0x48e7e3,null));};exports['openchannelQueues']=function(_0x2a025c,_0x1f1890){return respondWithRpcPromise(_0x7721('0x49'),_0x2a025c[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x1f1890,null))[_0x7721('0xe')](handleError(_0x1f1890,null));};exports[_0x7721('0x4a')]=function(_0x3e3301,_0x127f46){return respondWithRpcPromise(_0x7721('0x49'),_0x3e3301[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x3e3301[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x127f46,null))[_0x7721('0xe')](handleError(_0x127f46,null));};exports['smsQueues']=function(_0x233e5d,_0x2c93b0){return respondWithRpcPromise(_0x7721('0x4b'),_0x233e5d[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x2c93b0,null))[_0x7721('0xe')](handleError(_0x2c93b0,null));};exports[_0x7721('0x4c')]=function(_0x4c8284,_0x3e7df3){return respondWithRpcPromise('SmsQueues',_0x4c8284[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x4c8284[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x3e7df3,null))[_0x7721('0xe')](handleError(_0x3e7df3,null));};exports[_0x7721('0x4d')]=function(_0x3121e0,_0x167ce7){return respondWithRpcPromise(_0x7721('0x4e'),_0x3121e0['query'],routingClient)[_0x7721('0x9')](respondWithResult(_0x167ce7,null))[_0x7721('0xe')](handleError(_0x167ce7,null));};exports[_0x7721('0x4f')]=function(_0x3a11e2,_0x56a988){return respondWithRpcPromise(_0x7721('0x4e'),_0x3a11e2[_0x7721('0x17')],routingClient)['then'](findById(_0x3a11e2[_0x7721('0x1b')]['id']))[_0x7721('0x9')](respondWithResult(_0x56a988,null))['catch'](handleError(_0x56a988,null));};exports[_0x7721('0x50')]=function(_0x565c49,_0x14b543){return respondWithRpcPromise(_0x7721('0x51'),_0x565c49[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x14b543,null))[_0x7721('0xe')](handleError(_0x14b543,null));};exports[_0x7721('0x52')]=function(_0x258c57,_0x5dca04){return respondWithRpcPromise(_0x7721('0x51'),_0x258c57[_0x7721('0x17')],routingClient)[_0x7721('0x9')](findById(_0x258c57['params']['id']))['then'](respondWithResult(_0x5dca04,null))['catch'](handleError(_0x5dca04,null));};exports['faxAccounts']=function(_0x5e966f,_0x1fc5f7){return respondWithRpcPromise(_0x7721('0x53'),_0x5e966f['query'])[_0x7721('0x9')](respondWithResult(_0x1fc5f7,null))[_0x7721('0xe')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x54')]=function(_0x4593e1,_0x53ebb1){return respondWithRpcPromise(_0x7721('0x55'),_0x4593e1[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x53ebb1,null))[_0x7721('0xe')](handleError(_0x53ebb1,null));};exports[_0x7721('0x56')]=function(_0x53adb1,_0x29ac64){return respondWithRpcPromise(_0x7721('0x57'),_0x53adb1[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x29ac64,null))['catch'](handleError(_0x29ac64,null));};exports[_0x7721('0x58')]=function(_0x752564,_0x423040){return respondWithRpcPromise(_0x7721('0x59'),_0x752564[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x423040,null))['catch'](handleError(_0x423040,null));};exports[_0x7721('0x5a')]=function(_0x1bd97e,_0x68de4){return respondWithRpcPromise(_0x7721('0x59'),_0x1bd97e[_0x7721('0x17')],routingClient)[_0x7721('0x9')](function(_0x34187f){if(_0x1bd97e['query'][_0x7721('0x5b')]!==undefined){var _0x413185=_(_0x34187f[_0x7721('0x5c')])['filter']([_0x1bd97e[_0x7721('0x17')][_0x7721('0x5b')],_0x1bd97e[_0x7721('0x1b')]['id']])[_0x7721('0x5d')]('queue_id')['uniq']()[_0x7721('0x5e')]();return _0x34187f[_0x7721('0x5c')][_0x7721('0x5f')](function(_0x42c849){return _0x413185[_0x7721('0x60')](_0x42c849[_0x7721('0x61')])>-0x1;});}else{return _0x34187f['rows'][_0x7721('0x5f')](function(_0x42bb5a){return _0x42bb5a[_0x7721('0x61')]===parseInt(_0x1bd97e['params']['id']);});}})[_0x7721('0x9')](respondWithResult(_0x68de4,null))[_0x7721('0xe')](handleError(_0x68de4,null));};exports[_0x7721('0x62')]=function(_0xc20188,_0x457d7f){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0xc20188[_0x7721('0x17')],routingClient)['then'](respondWithResult(_0x457d7f,null))[_0x7721('0xe')](handleError(_0x457d7f,null));};exports[_0x7721('0x63')]=function(_0x2d5433,_0x7f0598){return respondWithRpcPromise(_0x7721('0x64'),_0x2d5433[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x7f0598,null))[_0x7721('0xe')](handleError(_0x7f0598,null));};exports[_0x7721('0x65')]=function(_0x3b78f5,_0x2c74d8){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x3b78f5[_0x7721('0x17')],routingClient)[_0x7721('0x9')](respondWithResult(_0x2c74d8,null))[_0x7721('0xe')](handleError(_0x2c74d8,null));};exports['queueNotify']=function(_0x94af20){return function(_0x26b2cc,_0x139517){var _0xc9761e,_0xcd9f0d;var _0x594059=_[_0x7721('0x66')](_0x94af20);var _0x22f15a=_0x94af20===_0x7721('0x67')?_0x7721('0x68'):_0x7721('0x69');return db[_0x594059+_0x7721('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x26b2cc[_0x7721('0x1b')]['id']}})[_0x7721('0x9')](function(_0x480a03){if(_[_0x7721('0x13')](_0x480a03)){throw new Error(_0x594059+'\x20Queue\x20not\x20found');}_0xc9761e=_0x480a03;return db[_0x594059+_0x7721('0x6b')][_0x7721('0x6c')]({'where':{'id':_0x26b2cc['body'][_0x7721('0x6d')]},'include':[{'model':db[_0x594059+'Interaction'],'as':'Interaction'},{'model':db[_0x594059+_0x22f15a],'as':'Account'}]});})[_0x7721('0x9')](function(_0x20f12e){if(_[_0x7721('0x13')](_0x20f12e)){throw new Error(_0x594059+'\x20Message\x20not\x20found');}_0xcd9f0d=_0x20f12e;return _0x20f12e['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x355aa8={'uniqueid':_0x94af20+'.'+_0xcd9f0d['id']+'.'+_0xcd9f0d[_0x7721('0x6e')]['id'],'FromUserId':_0x26b2cc[_0x7721('0x2f')]['id'],'type':_0x7721('0x6f')};_0x355aa8[_0x594059+_0x7721('0x70')]=_0xcd9f0d['id'];_0x355aa8[_0x594059+_0x7721('0x71')]=_0xcd9f0d['Interaction']['id'];_0x355aa8[_0x7721('0x72')+_0x594059+_0x22f15a+'Id']=_0xcd9f0d[_0x7721('0x69')]['id'];_0x355aa8['To'+_0x594059+_0x7721('0x73')]=_0xc9761e['id'];return db[_0x594059+_0x7721('0x74')][_0x7721('0x75')](_0x355aa8);})[_0x7721('0x9')](function(){return respondWithRpcPromise(_0x7721('0x76'),{'channel':_0x94af20,'interaction':_0xcd9f0d[_0x7721('0x6e')],'message':_0xcd9f0d,'account':_0xcd9f0d[_0x7721('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7721('0x6f'),'appdata':_0xc9761e[_0x7721('0x30')]+','+(_0xcd9f0d[_0x7721('0x69')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x7721('0x9')](respondWithResult(_0x139517,null))[_0x7721('0xe')](handleError(_0x139517,null));};};exports['agentNotify']=function(_0x167e05,_0x570cf4){var _0x4e3c93,_0x154b4b;if(_['isNil'](_0x167e05['body'][_0x7721('0x77')])){throw new Error(_0x7721('0x78'));}var _0x28e123=_0x167e05[_0x7721('0x2d')][_0x7721('0x77')];var _0x494c5e=_[_0x7721('0x66')](_0x28e123);var _0xcf2c06=_0x28e123===_0x7721('0x67')?_0x7721('0x68'):'Account';return db['User'][_0x7721('0x6c')]({'raw':!![],'where':{'id':_0x167e05[_0x7721('0x1b')]['id'],'role':'agent'}})[_0x7721('0x9')](function(_0x13dc8a){if(_['isNil'](_0x13dc8a)){throw new Error('Agent\x20not\x20found');}_0x4e3c93=_0x13dc8a;return db[_0x494c5e+_0x7721('0x6b')][_0x7721('0x6c')]({'where':{'id':_0x167e05[_0x7721('0x2d')][_0x7721('0x6d')]},'include':[{'model':db[_0x494c5e+_0x7721('0x6e')],'as':_0x7721('0x6e')},{'model':db[_0x494c5e+_0xcf2c06],'as':_0x7721('0x69')}]});})[_0x7721('0x9')](function(_0x59de30){if(_[_0x7721('0x13')](_0x59de30)){throw new Error(_0x494c5e+_0x7721('0x79'));}_0x154b4b=_0x59de30;return _0x59de30[_0x7721('0x7a')]({'read':0x0,'readAt':null,'UserId':null});})[_0x7721('0x9')](function(){var _0xe1c795={'uniqueid':_0x28e123+'.'+_0x154b4b['id']+'.'+_0x154b4b[_0x7721('0x6e')]['id'],'FromUserId':_0x167e05[_0x7721('0x2f')]['id'],'type':'queue','ToUserId':_0x4e3c93['id']};_0xe1c795[_0x494c5e+_0x7721('0x70')]=_0x154b4b['id'];_0xe1c795[_0x494c5e+_0x7721('0x71')]=_0x154b4b['Interaction']['id'];_0xe1c795[_0x7721('0x72')+_0x494c5e+_0xcf2c06+'Id']=_0x154b4b[_0x7721('0x69')]['id'];return db[_0x494c5e+_0x7721('0x74')][_0x7721('0x75')](_0xe1c795);})[_0x7721('0x9')](function(){return respondWithRpcPromise(_0x7721('0x76'),{'channel':_0x28e123,'interaction':_0x154b4b[_0x7721('0x6e')],'message':_0x154b4b,'account':_0x154b4b[_0x7721('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7721('0x3b'),'appdata':_0x4e3c93[_0x7721('0x30')]+','+(_0x154b4b['Account'][_0x7721('0x7b')]||0x12c),'interval':_0x7721('0x7c')}]},routingClient);})[_0x7721('0x9')](respondWithResult(_0x570cf4,null))[_0x7721('0xe')](handleError(_0x570cf4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index e94d215..030af31 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 _0x3cdc=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','destroy','exports','multer'];(function(_0x1d7966,_0x359208){var _0x27bbf7=function(_0x4ea9dc){while(--_0x4ea9dc){_0x1d7966['push'](_0x1d7966['shift']());}};_0x27bbf7(++_0x359208);}(_0x3cdc,0xe6));var _0xc3cd=function(_0x79d5d0,_0x3dc9ef){_0x79d5d0=_0x79d5d0-0x0;var _0xfb3597=_0x3cdc[_0x79d5d0];return _0xfb3597;};'use strict';var multer=require(_0xc3cd('0x0'));var util=require(_0xc3cd('0x1'));var path=require(_0xc3cd('0x2'));var timeout=require(_0xc3cd('0x3'));var express=require(_0xc3cd('0x4'));var router=express['Router']();var fs_extra=require(_0xc3cd('0x5'));var auth=require(_0xc3cd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc3cd('0x7'));var controller=require(_0xc3cd('0x8'));router[_0xc3cd('0x9')]('/',auth[_0xc3cd('0xa')](),controller[_0xc3cd('0xb')]);router[_0xc3cd('0x9')](_0xc3cd('0xc'),auth['isAuthenticated'](),controller[_0xc3cd('0xd')]);router[_0xc3cd('0x9')](_0xc3cd('0xe'),auth['isAuthenticated'](),controller[_0xc3cd('0xf')]);router[_0xc3cd('0x10')]('/',auth[_0xc3cd('0xa')](),controller[_0xc3cd('0x11')]);router[_0xc3cd('0x12')]('/:id',auth[_0xc3cd('0xa')](),controller['update']);router['delete'](_0xc3cd('0xc'),auth['isAuthenticated'](),controller[_0xc3cd('0x13')]);module[_0xc3cd('0x14')]=router; \ No newline at end of file +var _0x8c98=['update','delete','destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','/:id','show','get','/:id/run','run','post','create','put'];(function(_0x2958f8,_0x1b8fda){var _0x1a02c0=function(_0x47642c){while(--_0x47642c){_0x2958f8['push'](_0x2958f8['shift']());}};_0x1a02c0(++_0x1b8fda);}(_0x8c98,0x16b));var _0x88c9=function(_0x4fd5d3,_0x214090){_0x4fd5d3=_0x4fd5d3-0x0;var _0xf62a8b=_0x8c98[_0x4fd5d3];return _0xf62a8b;};'use strict';var multer=require(_0x88c9('0x0'));var util=require('util');var path=require(_0x88c9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x88c9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x88c9('0x3'));var interaction=require(_0x88c9('0x4'));var config=require(_0x88c9('0x5'));var controller=require(_0x88c9('0x6'));router['get']('/',auth[_0x88c9('0x7')](),controller[_0x88c9('0x8')]);router['get'](_0x88c9('0x9'),auth[_0x88c9('0x7')](),controller[_0x88c9('0xa')]);router[_0x88c9('0xb')](_0x88c9('0xc'),auth[_0x88c9('0x7')](),controller[_0x88c9('0xd')]);router[_0x88c9('0xe')]('/',auth[_0x88c9('0x7')](),controller[_0x88c9('0xf')]);router[_0x88c9('0x10')](_0x88c9('0x9'),auth[_0x88c9('0x7')](),controller[_0x88c9('0x11')]);router[_0x88c9('0x12')](_0x88c9('0x9'),auth[_0x88c9('0x7')](),controller[_0x88c9('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index e94dbdd..77252ce 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 _0x75aa=['days','hours','minutes','pdf','xlsx','csv','default','custom','BOOLEAN','TEXT','sequelize','STRING','DATE','INTEGER','ENUM','years','quarters','weeks'];(function(_0x491c79,_0x22824c){var _0x5ec644=function(_0x1af5ba){while(--_0x1af5ba){_0x491c79['push'](_0x491c79['shift']());}};_0x5ec644(++_0x22824c);}(_0x75aa,0x172));var _0xa75a=function(_0x4a7119,_0x314cc4){_0x4a7119=_0x4a7119-0x0;var _0x225599=_0x75aa[_0x4a7119];return _0x225599;};'use strict';var Sequelize=require(_0xa75a('0x0'));module['exports']={'name':{'type':Sequelize[_0xa75a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa75a('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xa75a('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xa75a('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xa75a('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa75a('0x4')](_0xa75a('0x5'),_0xa75a('0x6'),'months',_0xa75a('0x7'),_0xa75a('0x8'),_0xa75a('0x9'),_0xa75a('0xa')),'allowNull':![],'defaultValue':_0xa75a('0x8')},'output':{'type':Sequelize[_0xa75a('0x4')]('csv',_0xa75a('0xb'),_0xa75a('0xc')),'allowNull':![],'defaultValue':_0xa75a('0xd')},'type':{'type':Sequelize[_0xa75a('0x4')]('custom',_0xa75a('0xe')),'allowNull':![],'defaultValue':_0xa75a('0xf')},'sendMail':{'type':Sequelize[_0xa75a('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0xa75a('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xa75a('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xa75a('0x10')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8ec2=['BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','custom','default','TEXT','sequelize','exports','STRING'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8ec2,0xf4));var _0x28ec=function(_0x11f8bb,_0x5cc37f){_0x11f8bb=_0x11f8bb-0x0;var _0x2f6f88=_0x8ec2[_0x11f8bb];return _0x2f6f88;};'use strict';var Sequelize=require(_0x28ec('0x0'));module[_0x28ec('0x1')]={'name':{'type':Sequelize[_0x28ec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x28ec('0x2')]},'active':{'type':Sequelize[_0x28ec('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x28ec('0x2')],'allowNull':![],'defaultValue':_0x28ec('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x28ec('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x28ec('0x6')](_0x28ec('0x7'),_0x28ec('0x8'),_0x28ec('0x9'),_0x28ec('0xa'),'days',_0x28ec('0xb'),_0x28ec('0xc')),'allowNull':![],'defaultValue':_0x28ec('0xd')},'output':{'type':Sequelize['ENUM'](_0x28ec('0xe'),_0x28ec('0xf'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x28ec('0x6')](_0x28ec('0x10'),_0x28ec('0x11')),'allowNull':![],'defaultValue':_0x28ec('0x10')},'sendMail':{'type':Sequelize[_0x28ec('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x28ec('0x2')]},'cc':{'type':Sequelize[_0x28ec('0x12')]},'bcc':{'type':Sequelize[_0x28ec('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x28ec('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 0735767..32bd63c 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 _0x112b=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','Scheduler','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','attributes','length','hasOwnProperty','query','order','sort','where','pick','filter','merge','options','Schedule','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x112b,0x95));var _0xb112=function(_0x1f4b18,_0x4e777c){_0x1f4b18=_0x1f4b18-0x0;var _0xde3957=_0x112b[_0x1f4b18];return _0xde3957;};'use strict';var emlformat=require(_0xb112('0x0'));var rimraf=require(_0xb112('0x1'));var zipdir=require(_0xb112('0x2'));var jsonpatch=require(_0xb112('0x3'));var rp=require(_0xb112('0x4'));var moment=require(_0xb112('0x5'));var BPromise=require(_0xb112('0x6'));var Mustache=require(_0xb112('0x7'));var util=require(_0xb112('0x8'));var path=require('path');var sox=require(_0xb112('0x9'));var csv=require(_0xb112('0xa'));var ejs=require(_0xb112('0xb'));var fs=require('fs');var fs_extra=require(_0xb112('0xc'));var _=require(_0xb112('0xd'));var squel=require('squel');var crypto=require(_0xb112('0xe'));var jsforce=require(_0xb112('0xf'));var deskjs=require(_0xb112('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb112('0x11'));var Papa=require(_0xb112('0x12'));var Redis=require(_0xb112('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb112('0x14'));var as=require(_0xb112('0x15'));var hardwareService=require(_0xb112('0x16'));var logger=require(_0xb112('0x17'))(_0xb112('0x18'));var utils=require(_0xb112('0x19'));var config=require(_0xb112('0x1a'));var licenseUtil=require(_0xb112('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x351b63,_0x4f42bd){_0x4f42bd=_0x4f42bd||0xcc;return function(_0x27d62a){if(_0x27d62a){return _0x351b63['sendStatus'](_0x4f42bd);}return _0x351b63[_0xb112('0x1c')](_0x4f42bd)[_0xb112('0x1d')]();};}function respondWithResult(_0x1e2af3,_0x2ada16){_0x2ada16=_0x2ada16||0xc8;return function(_0x5bcca7){if(_0x5bcca7){return _0x1e2af3[_0xb112('0x1c')](_0x2ada16)[_0xb112('0x1e')](_0x5bcca7);}};}function respondWithFilteredResult(_0x4628d8,_0x185ea5){return function(_0x5f549d){if(_0x5f549d){var _0x15fddf=typeof _0x185ea5[_0xb112('0x1f')]===_0xb112('0x20')&&typeof _0x185ea5['limit']===_0xb112('0x20');var _0xbd8f59=_0x5f549d[_0xb112('0x21')];var _0x2374a5=_0x15fddf?0x0:_0x185ea5[_0xb112('0x1f')];var _0x241aba=_0x15fddf?_0x5f549d[_0xb112('0x21')]:_0x185ea5[_0xb112('0x1f')]+_0x185ea5[_0xb112('0x22')];var _0xf5cc99;if(_0x241aba>=_0xbd8f59){_0x241aba=_0xbd8f59;_0xf5cc99=0xc8;}else{_0xf5cc99=0xce;}_0x4628d8['status'](_0xf5cc99);return _0x4628d8['set'](_0xb112('0x23'),_0x2374a5+'-'+_0x241aba+'/'+_0xbd8f59)[_0xb112('0x1e')](_0x5f549d);}return null;};}function patchUpdates(_0x6ff05b){return function(_0x23ecdd){try{jsonpatch[_0xb112('0x24')](_0x23ecdd,_0x6ff05b,!![]);}catch(_0xd24b15){return BPromise[_0xb112('0x25')](_0xd24b15);}return _0x23ecdd['save']();};}function saveUpdates(_0x15d8b6,_0x42a878){return function(_0x37c8ed){if(_0x37c8ed){return _0x37c8ed[_0xb112('0x26')](_0x15d8b6)[_0xb112('0x27')](function(_0x4905d5){return _0x4905d5;});}return null;};}function removeEntity(_0x4f695a,_0x1c7bce){return function(_0x1d4f4c){if(_0x1d4f4c){return _0x1d4f4c['destroy']()[_0xb112('0x27')](function(){var _0x3410b2=_0x1d4f4c['get']({'plain':!![]});var _0x42f9b5=_0xb112('0x28');return db[_0xb112('0x29')]['destroy']({'where':{'type':_0x42f9b5,'resourceId':_0x3410b2['id']}})['then'](function(){return _0x1d4f4c;});})[_0xb112('0x27')](function(){_0x4f695a['status'](0xcc)[_0xb112('0x1d')]();});}};}function handleEntityNotFound(_0xc94284,_0x512857){return function(_0x595e29){if(!_0x595e29){_0xc94284['sendStatus'](0x194);}return _0x595e29;};}function handleError(_0x58d60c,_0x1460db){_0x1460db=_0x1460db||0x1f4;return function(_0x407aa0){logger['error'](_0x407aa0['stack']);if(_0x407aa0[_0xb112('0x2a')]){delete _0x407aa0['name'];}_0x58d60c[_0xb112('0x1c')](_0x1460db)['send'](_0x407aa0);};}exports['index']=function(_0x40137c,_0x51f554){var _0x26bf86={},_0xa1d1d3={},_0x424262={'count':0x0,'rows':[]};var _0x430095=_[_0xb112('0x2b')](db['Schedule'][_0xb112('0x2c')],function(_0x137309){return{'name':_0x137309[_0xb112('0x2d')],'type':_0x137309[_0xb112('0x2e')][_0xb112('0x2f')]};});_0xa1d1d3[_0xb112('0x30')]=_[_0xb112('0x2b')](_0x430095,_0xb112('0x2a'));_0xa1d1d3['query']=_[_0xb112('0x31')](_0x40137c['query']);_0xa1d1d3[_0xb112('0x32')]=_[_0xb112('0x33')](_0xa1d1d3[_0xb112('0x30')],_0xa1d1d3['query']);_0x26bf86['attributes']=_[_0xb112('0x33')](_0xa1d1d3[_0xb112('0x30')],qs[_0xb112('0x34')](_0x40137c['query'][_0xb112('0x34')]));_0x26bf86[_0xb112('0x35')]=_0x26bf86[_0xb112('0x35')][_0xb112('0x36')]?_0x26bf86[_0xb112('0x35')]:_0xa1d1d3[_0xb112('0x30')];if(!_0x40137c['query'][_0xb112('0x37')]('nolimit')){_0x26bf86['limit']=qs[_0xb112('0x22')](_0x40137c[_0xb112('0x38')][_0xb112('0x22')]);_0x26bf86[_0xb112('0x1f')]=qs['offset'](_0x40137c['query'][_0xb112('0x1f')]);}_0x26bf86[_0xb112('0x39')]=qs[_0xb112('0x3a')](_0x40137c[_0xb112('0x38')][_0xb112('0x3a')]);_0x26bf86[_0xb112('0x3b')]=qs['filters'](_[_0xb112('0x3c')](_0x40137c['query'],_0xa1d1d3['filters']),_0x430095);if(_0x40137c[_0xb112('0x38')][_0xb112('0x3d')]){_0x26bf86['where']=_[_0xb112('0x3e')](_0x26bf86[_0xb112('0x3b')],{'$or':_[_0xb112('0x2b')](_0x430095,function(_0x471448){if(_0x471448[_0xb112('0x2e')]!=='VIRTUAL'){var _0x5cd826={};_0x5cd826[_0x471448['name']]={'$like':'%'+_0x40137c[_0xb112('0x38')][_0xb112('0x3d')]+'%'};return _0x5cd826;}})});}_0x26bf86=_[_0xb112('0x3e')]({},_0x26bf86,_0x40137c[_0xb112('0x3f')]);var _0x2023a5={'where':_0x26bf86[_0xb112('0x3b')]};return db[_0xb112('0x40')][_0xb112('0x21')](_0x2023a5)[_0xb112('0x27')](function(_0x56eb60){_0x424262[_0xb112('0x21')]=_0x56eb60;if(_0x40137c[_0xb112('0x38')][_0xb112('0x41')]){_0x26bf86['include']=[{'all':!![]}];}return db[_0xb112('0x40')][_0xb112('0x42')](_0x26bf86);})[_0xb112('0x27')](function(_0x28db75){_0x424262[_0xb112('0x43')]=_0x28db75;return _0x424262;})[_0xb112('0x27')](respondWithFilteredResult(_0x51f554,_0x26bf86))[_0xb112('0x44')](handleError(_0x51f554,null));};exports[_0xb112('0x45')]=function(_0x3eb12e,_0x3cfdb3){var _0x277b38={'raw':![],'where':{'id':_0x3eb12e[_0xb112('0x46')]['id']}},_0x4834a0={};_0x4834a0[_0xb112('0x30')]=_[_0xb112('0x31')](db['Schedule'][_0xb112('0x2c')]);_0x4834a0[_0xb112('0x38')]=_['keys'](_0x3eb12e[_0xb112('0x38')]);_0x4834a0[_0xb112('0x32')]=_[_0xb112('0x33')](_0x4834a0[_0xb112('0x30')],_0x4834a0[_0xb112('0x38')]);_0x277b38[_0xb112('0x35')]=_[_0xb112('0x33')](_0x4834a0[_0xb112('0x30')],qs[_0xb112('0x34')](_0x3eb12e[_0xb112('0x38')][_0xb112('0x34')]));_0x277b38['attributes']=_0x277b38[_0xb112('0x35')][_0xb112('0x36')]?_0x277b38['attributes']:_0x4834a0[_0xb112('0x30')];if(_0x3eb12e[_0xb112('0x38')][_0xb112('0x41')]){_0x277b38[_0xb112('0x47')]=[{'all':!![]}];}_0x277b38=_[_0xb112('0x3e')]({},_0x277b38,_0x3eb12e[_0xb112('0x3f')]);return db['Schedule']['find'](_0x277b38)[_0xb112('0x27')](handleEntityNotFound(_0x3cfdb3,null))['then'](respondWithResult(_0x3cfdb3,null))['catch'](handleError(_0x3cfdb3,null));};exports[_0xb112('0x48')]=function(_0x4c914b,_0x486a7d){return db[_0xb112('0x40')][_0xb112('0x48')](_0x4c914b[_0xb112('0x49')],{})[_0xb112('0x27')](function(_0x4feb71){var _0x135124=_0x4c914b[_0xb112('0x4a')]['get']({'plain':!![]});if(!_0x135124)throw new Error(_0xb112('0x4b'));if(_0x135124[_0xb112('0x4c')]===_0xb112('0x4a')){var _0x508a82=_0x4feb71[_0xb112('0x4d')]({'plain':!![]});var _0x3ebc3d='Scheduler';return db['UserProfileSection'][_0xb112('0x4e')]({'where':{'name':_0x3ebc3d,'userProfileId':_0x135124[_0xb112('0x4f')]},'raw':!![]})[_0xb112('0x27')](function(_0x1c843f){if(_0x1c843f&&_0x1c843f[_0xb112('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x508a82[_0xb112('0x2a')],'resourceId':_0x508a82['id'],'type':_0x1c843f[_0xb112('0x2a')],'sectionId':_0x1c843f['id']},{})['then'](function(){return _0x4feb71;});}else{return _0x4feb71;}})['catch'](function(_0x58571a){logger[_0xb112('0x51')](_0xb112('0x52'),_0x58571a);throw _0x58571a;});}return _0x4feb71;})[_0xb112('0x27')](respondWithResult(_0x486a7d,0xc9))[_0xb112('0x44')](handleError(_0x486a7d,null));};exports[_0xb112('0x26')]=function(_0x5516fd,_0x3d2911){if(_0x5516fd['body']['id']){delete _0x5516fd['body']['id'];}return db['Schedule'][_0xb112('0x4e')]({'where':{'id':_0x5516fd[_0xb112('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d2911,null))[_0xb112('0x27')](saveUpdates(_0x5516fd[_0xb112('0x49')],null))['then'](respondWithResult(_0x3d2911,null))[_0xb112('0x44')](handleError(_0x3d2911,null));};exports[_0xb112('0x53')]=function(_0x204c50,_0x5b2aef){return db['Schedule'][_0xb112('0x4e')]({'where':{'id':_0x204c50[_0xb112('0x46')]['id']}})[_0xb112('0x27')](handleEntityNotFound(_0x5b2aef,null))['then'](removeEntity(_0x5b2aef,null))[_0xb112('0x44')](handleError(_0x5b2aef,null));};exports[_0xb112('0x54')]=function(_0x1ae419,_0x583d5b,_0x1d6af0){var _0x5c7695=require(_0xb112('0x55'));return db['Schedule'][_0xb112('0x4e')]({'where':{'id':_0x1ae419[_0xb112('0x46')]['id']},'raw':!![]})[_0xb112('0x27')](handleEntityNotFound(_0x583d5b,null))[_0xb112('0x27')](function(){_0x5c7695[_0xb112('0x54')](_0x1ae419[_0xb112('0x46')]['id']);})[_0xb112('0x27')](respondWithStatusCode(_0x583d5b,null))[_0xb112('0x44')](handleError(_0x583d5b,null));}; \ No newline at end of file +var _0x2d9a=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','error','stack','name','Schedule','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x486ab6,_0x257c0a){var _0x1ce5ea=function(_0x1443a5){while(--_0x1443a5){_0x486ab6['push'](_0x486ab6['shift']());}};_0x1ce5ea(++_0x257c0a);}(_0x2d9a,0x1b7));var _0xa2d9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2d9a[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xa2d9('0x0'));var rimraf=require(_0xa2d9('0x1'));var zipdir=require(_0xa2d9('0x2'));var jsonpatch=require(_0xa2d9('0x3'));var rp=require(_0xa2d9('0x4'));var moment=require(_0xa2d9('0x5'));var BPromise=require(_0xa2d9('0x6'));var Mustache=require(_0xa2d9('0x7'));var util=require(_0xa2d9('0x8'));var path=require(_0xa2d9('0x9'));var sox=require(_0xa2d9('0xa'));var csv=require('to-csv');var ejs=require(_0xa2d9('0xb'));var fs=require('fs');var fs_extra=require(_0xa2d9('0xc'));var _=require(_0xa2d9('0xd'));var squel=require(_0xa2d9('0xe'));var crypto=require(_0xa2d9('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa2d9('0x10'));var toCsv=require(_0xa2d9('0x11'));var querystring=require(_0xa2d9('0x12'));var Papa=require(_0xa2d9('0x13'));var Redis=require(_0xa2d9('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xa2d9('0x15'));var as=require(_0xa2d9('0x16'));var hardwareService=require(_0xa2d9('0x17'));var logger=require(_0xa2d9('0x18'))(_0xa2d9('0x19'));var utils=require(_0xa2d9('0x1a'));var config=require(_0xa2d9('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2d9('0x1c'))['db'];function respondWithStatusCode(_0x5c8e17,_0x2a7c68){_0x2a7c68=_0x2a7c68||0xcc;return function(_0x26c5e2){if(_0x26c5e2){return _0x5c8e17[_0xa2d9('0x1d')](_0x2a7c68);}return _0x5c8e17[_0xa2d9('0x1e')](_0x2a7c68)[_0xa2d9('0x1f')]();};}function respondWithResult(_0x3202d1,_0xee77d5){_0xee77d5=_0xee77d5||0xc8;return function(_0x16b9f6){if(_0x16b9f6){return _0x3202d1[_0xa2d9('0x1e')](_0xee77d5)[_0xa2d9('0x20')](_0x16b9f6);}};}function respondWithFilteredResult(_0x1cb849,_0x277034){return function(_0x52a53e){if(_0x52a53e){var _0x29b516=typeof _0x277034[_0xa2d9('0x21')]===_0xa2d9('0x22')&&typeof _0x277034[_0xa2d9('0x23')]==='undefined';var _0xd59a77=_0x52a53e[_0xa2d9('0x24')];var _0x1bcaf1=_0x29b516?0x0:_0x277034[_0xa2d9('0x21')];var _0x16c4bb=_0x29b516?_0x52a53e[_0xa2d9('0x24')]:_0x277034[_0xa2d9('0x21')]+_0x277034[_0xa2d9('0x23')];var _0x53d2b2;if(_0x16c4bb>=_0xd59a77){_0x16c4bb=_0xd59a77;_0x53d2b2=0xc8;}else{_0x53d2b2=0xce;}_0x1cb849[_0xa2d9('0x1e')](_0x53d2b2);return _0x1cb849[_0xa2d9('0x25')](_0xa2d9('0x26'),_0x1bcaf1+'-'+_0x16c4bb+'/'+_0xd59a77)[_0xa2d9('0x20')](_0x52a53e);}return null;};}function patchUpdates(_0x5ec324){return function(_0x4f8e9b){try{jsonpatch[_0xa2d9('0x27')](_0x4f8e9b,_0x5ec324,!![]);}catch(_0x58e60c){return BPromise[_0xa2d9('0x28')](_0x58e60c);}return _0x4f8e9b[_0xa2d9('0x29')]();};}function saveUpdates(_0x160cdb,_0x3247dd){return function(_0x4b47ae){if(_0x4b47ae){return _0x4b47ae[_0xa2d9('0x2a')](_0x160cdb)[_0xa2d9('0x2b')](function(_0x5751ef){return _0x5751ef;});}return null;};}function removeEntity(_0x5858e3,_0x8df4a0){return function(_0x547a8e){if(_0x547a8e){return _0x547a8e['destroy']()[_0xa2d9('0x2b')](function(){var _0x148c91=_0x547a8e[_0xa2d9('0x2c')]({'plain':!![]});var _0x57a4b1=_0xa2d9('0x2d');return db[_0xa2d9('0x2e')]['destroy']({'where':{'type':_0x57a4b1,'resourceId':_0x148c91['id']}})[_0xa2d9('0x2b')](function(){return _0x547a8e;});})[_0xa2d9('0x2b')](function(){_0x5858e3[_0xa2d9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46eec3,_0x1ac77b){return function(_0x53582b){if(!_0x53582b){_0x46eec3[_0xa2d9('0x1d')](0x194);}return _0x53582b;};}function handleError(_0xc805ef,_0x28c14a){_0x28c14a=_0x28c14a||0x1f4;return function(_0x4d28a7){logger[_0xa2d9('0x2f')](_0x4d28a7[_0xa2d9('0x30')]);if(_0x4d28a7[_0xa2d9('0x31')]){delete _0x4d28a7[_0xa2d9('0x31')];}_0xc805ef[_0xa2d9('0x1e')](_0x28c14a)['send'](_0x4d28a7);};}exports['index']=function(_0x23fee5,_0xe80144){var _0x32b639={},_0x2be41e={},_0x20b63d={'count':0x0,'rows':[]};var _0x2667db=_['map'](db[_0xa2d9('0x32')][_0xa2d9('0x33')],function(_0x461af3){return{'name':_0x461af3[_0xa2d9('0x34')],'type':_0x461af3[_0xa2d9('0x35')][_0xa2d9('0x36')]};});_0x2be41e[_0xa2d9('0x37')]=_[_0xa2d9('0x38')](_0x2667db,_0xa2d9('0x31'));_0x2be41e[_0xa2d9('0x39')]=_[_0xa2d9('0x3a')](_0x23fee5['query']);_0x2be41e[_0xa2d9('0x3b')]=_[_0xa2d9('0x3c')](_0x2be41e[_0xa2d9('0x37')],_0x2be41e[_0xa2d9('0x39')]);_0x32b639[_0xa2d9('0x3d')]=_[_0xa2d9('0x3c')](_0x2be41e[_0xa2d9('0x37')],qs[_0xa2d9('0x3e')](_0x23fee5[_0xa2d9('0x39')][_0xa2d9('0x3e')]));_0x32b639[_0xa2d9('0x3d')]=_0x32b639[_0xa2d9('0x3d')][_0xa2d9('0x3f')]?_0x32b639[_0xa2d9('0x3d')]:_0x2be41e[_0xa2d9('0x37')];if(!_0x23fee5['query'][_0xa2d9('0x40')](_0xa2d9('0x41'))){_0x32b639[_0xa2d9('0x23')]=qs['limit'](_0x23fee5[_0xa2d9('0x39')][_0xa2d9('0x23')]);_0x32b639[_0xa2d9('0x21')]=qs[_0xa2d9('0x21')](_0x23fee5[_0xa2d9('0x39')][_0xa2d9('0x21')]);}_0x32b639['order']=qs[_0xa2d9('0x42')](_0x23fee5['query']['sort']);_0x32b639[_0xa2d9('0x43')]=qs['filters'](_[_0xa2d9('0x44')](_0x23fee5['query'],_0x2be41e['filters']),_0x2667db);if(_0x23fee5[_0xa2d9('0x39')]['filter']){_0x32b639[_0xa2d9('0x43')]=_[_0xa2d9('0x45')](_0x32b639[_0xa2d9('0x43')],{'$or':_[_0xa2d9('0x38')](_0x2667db,function(_0x42629c){if(_0x42629c[_0xa2d9('0x35')]!==_0xa2d9('0x46')){var _0x496476={};_0x496476[_0x42629c[_0xa2d9('0x31')]]={'$like':'%'+_0x23fee5[_0xa2d9('0x39')][_0xa2d9('0x47')]+'%'};return _0x496476;}})});}_0x32b639=_[_0xa2d9('0x45')]({},_0x32b639,_0x23fee5[_0xa2d9('0x48')]);var _0x30f701={'where':_0x32b639[_0xa2d9('0x43')]};return db[_0xa2d9('0x32')][_0xa2d9('0x24')](_0x30f701)[_0xa2d9('0x2b')](function(_0x45b0c0){_0x20b63d['count']=_0x45b0c0;if(_0x23fee5[_0xa2d9('0x39')][_0xa2d9('0x49')]){_0x32b639['include']=[{'all':!![]}];}return db[_0xa2d9('0x32')][_0xa2d9('0x4a')](_0x32b639);})[_0xa2d9('0x2b')](function(_0x1a9242){_0x20b63d[_0xa2d9('0x4b')]=_0x1a9242;return _0x20b63d;})[_0xa2d9('0x2b')](respondWithFilteredResult(_0xe80144,_0x32b639))[_0xa2d9('0x4c')](handleError(_0xe80144,null));};exports[_0xa2d9('0x4d')]=function(_0x2cd49d,_0x34634a){var _0x1a6479={'raw':![],'where':{'id':_0x2cd49d[_0xa2d9('0x4e')]['id']}},_0x157546={};_0x157546[_0xa2d9('0x37')]=_['keys'](db[_0xa2d9('0x32')][_0xa2d9('0x33')]);_0x157546[_0xa2d9('0x39')]=_[_0xa2d9('0x3a')](_0x2cd49d['query']);_0x157546[_0xa2d9('0x3b')]=_[_0xa2d9('0x3c')](_0x157546['model'],_0x157546['query']);_0x1a6479[_0xa2d9('0x3d')]=_[_0xa2d9('0x3c')](_0x157546[_0xa2d9('0x37')],qs['fields'](_0x2cd49d['query'][_0xa2d9('0x3e')]));_0x1a6479[_0xa2d9('0x3d')]=_0x1a6479['attributes'][_0xa2d9('0x3f')]?_0x1a6479['attributes']:_0x157546[_0xa2d9('0x37')];if(_0x2cd49d[_0xa2d9('0x39')][_0xa2d9('0x49')]){_0x1a6479['include']=[{'all':!![]}];}_0x1a6479=_['merge']({},_0x1a6479,_0x2cd49d['options']);return db['Schedule'][_0xa2d9('0x4f')](_0x1a6479)['then'](handleEntityNotFound(_0x34634a,null))[_0xa2d9('0x2b')](respondWithResult(_0x34634a,null))['catch'](handleError(_0x34634a,null));};exports['create']=function(_0x24d7aa,_0x36b79e){return db[_0xa2d9('0x32')][_0xa2d9('0x50')](_0x24d7aa['body'],{})['then'](function(_0x16ac4f){var _0x20f55e=_0x24d7aa[_0xa2d9('0x51')][_0xa2d9('0x2c')]({'plain':!![]});if(!_0x20f55e)throw new Error(_0xa2d9('0x52'));if(_0x20f55e['role']===_0xa2d9('0x51')){var _0x5b8f17=_0x16ac4f['get']({'plain':!![]});var _0x3318de=_0xa2d9('0x2d');return db[_0xa2d9('0x53')][_0xa2d9('0x4f')]({'where':{'name':_0x3318de,'userProfileId':_0x20f55e[_0xa2d9('0x54')]},'raw':!![]})[_0xa2d9('0x2b')](function(_0x4b9f7d){if(_0x4b9f7d&&_0x4b9f7d[_0xa2d9('0x55')]===0x0){return db[_0xa2d9('0x2e')][_0xa2d9('0x50')]({'name':_0x5b8f17[_0xa2d9('0x31')],'resourceId':_0x5b8f17['id'],'type':_0x4b9f7d[_0xa2d9('0x31')],'sectionId':_0x4b9f7d['id']},{})[_0xa2d9('0x2b')](function(){return _0x16ac4f;});}else{return _0x16ac4f;}})[_0xa2d9('0x4c')](function(_0x54a9c2){logger['error'](_0xa2d9('0x56'),_0x54a9c2);throw _0x54a9c2;});}return _0x16ac4f;})[_0xa2d9('0x2b')](respondWithResult(_0x36b79e,0xc9))[_0xa2d9('0x4c')](handleError(_0x36b79e,null));};exports['update']=function(_0x662cbc,_0x3d8ac5){if(_0x662cbc['body']['id']){delete _0x662cbc['body']['id'];}return db[_0xa2d9('0x32')][_0xa2d9('0x4f')]({'where':{'id':_0x662cbc[_0xa2d9('0x4e')]['id']}})[_0xa2d9('0x2b')](handleEntityNotFound(_0x3d8ac5,null))[_0xa2d9('0x2b')](saveUpdates(_0x662cbc[_0xa2d9('0x57')],null))[_0xa2d9('0x2b')](respondWithResult(_0x3d8ac5,null))[_0xa2d9('0x4c')](handleError(_0x3d8ac5,null));};exports['destroy']=function(_0x95c31c,_0x792adb){return db[_0xa2d9('0x32')][_0xa2d9('0x4f')]({'where':{'id':_0x95c31c[_0xa2d9('0x4e')]['id']}})[_0xa2d9('0x2b')](handleEntityNotFound(_0x792adb,null))['then'](removeEntity(_0x792adb,null))[_0xa2d9('0x4c')](handleError(_0x792adb,null));};exports[_0xa2d9('0x58')]=function(_0x279a1a,_0x2cb121,_0x41f4a9){var _0x1e3ce1=require('../../config/schedule');return db['Schedule']['find']({'where':{'id':_0x279a1a['params']['id']},'raw':!![]})[_0xa2d9('0x2b')](handleEntityNotFound(_0x2cb121,null))['then'](function(){_0x1e3ce1['run'](_0x279a1a[_0xa2d9('0x4e')]['id']);})['then'](respondWithStatusCode(_0x2cb121,null))[_0xa2d9('0x4c')](handleError(_0x2cb121,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 88f97aa..8916649 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 _0x4472=['api','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0x4472,0x1ea));var _0x2447=function(_0x50fed7,_0x4ee456){_0x50fed7=_0x50fed7-0x0;var _0x2ab6df=_0x4472[_0x50fed7];return _0x2ab6df;};'use strict';var _=require(_0x2447('0x0'));var util=require(_0x2447('0x1'));var logger=require('../../config/logger')(_0x2447('0x2'));var moment=require('moment');var BPromise=require(_0x2447('0x3'));var rp=require(_0x2447('0x4'));var fs=require('fs');var path=require(_0x2447('0x5'));var rimraf=require(_0x2447('0x6'));var config=require('../../config/environment');var attributes=require(_0x2447('0x7'));module[_0x2447('0x8')]=function(_0x15c3fa,_0x54ca65){return _0x15c3fa[_0x2447('0x9')](_0x2447('0xa'),attributes,{'tableName':_0x2447('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fb0=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x4fb0,0xb2));var _0x04fb=function(_0x34b453,_0x45779b){_0x34b453=_0x34b453-0x0;var _0x280913=_0x4fb0[_0x34b453];return _0x280913;};'use strict';var _=require(_0x04fb('0x0'));var util=require(_0x04fb('0x1'));var logger=require(_0x04fb('0x2'))(_0x04fb('0x3'));var moment=require(_0x04fb('0x4'));var BPromise=require(_0x04fb('0x5'));var rp=require(_0x04fb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x04fb('0x7'));var attributes=require(_0x04fb('0x8'));module[_0x04fb('0x9')]=function(_0x305d0c,_0xa6bb54){return _0x305d0c[_0x04fb('0xa')](_0x04fb('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index be6a77d..383d2f4 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 _0x4b27=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x520b0d,_0x32d10d){var _0x1a6850=function(_0xf54da4){while(--_0xf54da4){_0x520b0d['push'](_0x520b0d['shift']());}};_0x1a6850(++_0x32d10d);}(_0x4b27,0x182));var _0x74b2=function(_0x3fa42f,_0x3ea16e){_0x3fa42f=_0x3fa42f-0x0;var _0x9b990b=_0x4b27[_0x3fa42f];return _0x9b990b;};'use strict';var _=require('lodash');var util=require(_0x74b2('0x0'));var moment=require('moment');var BPromise=require(_0x74b2('0x1'));var rs=require(_0x74b2('0x2'));var fs=require('fs');var Redis=require(_0x74b2('0x3'));var db=require(_0x74b2('0x4'))['db'];var utils=require(_0x74b2('0x5'));var logger=require(_0x74b2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x74b2('0x7'));var client=jayson[_0x74b2('0x8')][_0x74b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x295a35,_0x1e6115,_0xe5d891){return new BPromise(function(_0x3c6689,_0x2c162a){return client['request'](_0x295a35,_0xe5d891)[_0x74b2('0xa')](function(_0x5d8c04){logger[_0x74b2('0xb')](_0x74b2('0xc'),_0x1e6115,_0x74b2('0xd'));logger['debug'](_0x74b2('0xe'),_0x1e6115,_0x74b2('0xd'),JSON[_0x74b2('0xf')](_0x5d8c04));if(_0x5d8c04[_0x74b2('0x10')]){if(_0x5d8c04[_0x74b2('0x10')]['code']===0x1f4){logger['error'](_0x74b2('0xc'),_0x1e6115,_0x5d8c04[_0x74b2('0x10')][_0x74b2('0x11')]);return _0x2c162a(_0x5d8c04[_0x74b2('0x10')][_0x74b2('0x11')]);}logger[_0x74b2('0x10')]('Schedule,\x20%s,\x20%s',_0x1e6115,_0x5d8c04[_0x74b2('0x10')]['message']);return _0x3c6689(_0x5d8c04[_0x74b2('0x10')][_0x74b2('0x11')]);}else{logger[_0x74b2('0xb')](_0x74b2('0xc'),_0x1e6115,_0x74b2('0xd'));_0x3c6689(_0x5d8c04[_0x74b2('0x12')][_0x74b2('0x11')]);}})[_0x74b2('0x13')](function(_0x25874b){logger[_0x74b2('0x10')](_0x74b2('0xc'),_0x1e6115,_0x25874b);_0x2c162a(_0x25874b);});});} \ No newline at end of file +var _0x4135=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4135,0x74));var _0x5413=function(_0x17c2c1,_0x134ca3){_0x17c2c1=_0x17c2c1-0x0;var _0x2f5830=_0x4135[_0x17c2c1];return _0x2f5830;};'use strict';var _=require(_0x5413('0x0'));var util=require(_0x5413('0x1'));var moment=require(_0x5413('0x2'));var BPromise=require(_0x5413('0x3'));var rs=require(_0x5413('0x4'));var fs=require('fs');var Redis=require(_0x5413('0x5'));var db=require(_0x5413('0x6'))['db'];var utils=require(_0x5413('0x7'));var logger=require(_0x5413('0x8'))(_0x5413('0x9'));var config=require(_0x5413('0xa'));var jayson=require(_0x5413('0xb'));var client=jayson[_0x5413('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x537595,_0x292121,_0x4fdd2e){return new BPromise(function(_0x259279,_0x4c2c4b){return client[_0x5413('0xd')](_0x537595,_0x4fdd2e)[_0x5413('0xe')](function(_0x23e53a){logger[_0x5413('0xf')](_0x5413('0x10'),_0x292121,_0x5413('0x11'));logger[_0x5413('0x12')](_0x5413('0x13'),_0x292121,_0x5413('0x11'),JSON['stringify'](_0x23e53a));if(_0x23e53a[_0x5413('0x14')]){if(_0x23e53a['error'][_0x5413('0x15')]===0x1f4){logger['error'](_0x5413('0x10'),_0x292121,_0x23e53a[_0x5413('0x14')]['message']);return _0x4c2c4b(_0x23e53a[_0x5413('0x14')][_0x5413('0x16')]);}logger['error'](_0x5413('0x10'),_0x292121,_0x23e53a['error'][_0x5413('0x16')]);return _0x259279(_0x23e53a[_0x5413('0x14')]['message']);}else{logger['info'](_0x5413('0x10'),_0x292121,'request\x20sent');_0x259279(_0x23e53a[_0x5413('0x17')]['message']);}})['catch'](function(_0x3b5886){logger[_0x5413('0x14')](_0x5413('0x10'),_0x292121,_0x3b5886);_0x4c2c4b(_0x3b5886);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index a30838d..e91a018 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 _0x7d6a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','create','update','delete','destroy','exports'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x7d6a,0x168));var _0xa7d6=function(_0x337712,_0x5c5978){_0x337712=_0x337712-0x0;var _0xe492de=_0x7d6a[_0x337712];return _0xe492de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa7d6('0x0'));var timeout=require(_0xa7d6('0x1'));var express=require(_0xa7d6('0x2'));var router=express[_0xa7d6('0x3')]();var fs_extra=require(_0xa7d6('0x4'));var auth=require(_0xa7d6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa7d6('0x6'));router[_0xa7d6('0x7')]('/',auth[_0xa7d6('0x8')](),controller[_0xa7d6('0x9')]);router[_0xa7d6('0x7')](_0xa7d6('0xa'),auth['isAuthenticated'](),controller[_0xa7d6('0xb')]);router[_0xa7d6('0x7')](_0xa7d6('0xc'),auth[_0xa7d6('0x8')](),controller[_0xa7d6('0xd')]);router[_0xa7d6('0x7')]('/:id/download',auth[_0xa7d6('0x8')](),controller[_0xa7d6('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa7d6('0xf')]);router['put']('/:id',auth[_0xa7d6('0x8')](),controller[_0xa7d6('0x10')]);router[_0xa7d6('0x11')](_0xa7d6('0xc'),auth[_0xa7d6('0x8')](),controller[_0xa7d6('0x12')]);module[_0xa7d6('0x13')]=router; \ No newline at end of file +var _0xf106=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','delete','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf106,0x7c));var _0x6f10=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0xf106[_0x500c0];return _0xdd146f;};'use strict';var multer=require(_0x6f10('0x0'));var util=require(_0x6f10('0x1'));var path=require(_0x6f10('0x2'));var timeout=require(_0x6f10('0x3'));var express=require(_0x6f10('0x4'));var router=express[_0x6f10('0x5')]();var fs_extra=require(_0x6f10('0x6'));var auth=require(_0x6f10('0x7'));var interaction=require(_0x6f10('0x8'));var config=require(_0x6f10('0x9'));var controller=require(_0x6f10('0xa'));router[_0x6f10('0xb')]('/',auth[_0x6f10('0xc')](),controller[_0x6f10('0xd')]);router[_0x6f10('0xb')](_0x6f10('0xe'),auth['isAuthenticated'](),controller[_0x6f10('0xf')]);router[_0x6f10('0xb')](_0x6f10('0x10'),auth[_0x6f10('0xc')](),controller[_0x6f10('0x11')]);router['get'](_0x6f10('0x12'),auth['isAuthenticated'](),controller[_0x6f10('0x13')]);router[_0x6f10('0x14')]('/',auth['isAuthenticated'](),controller[_0x6f10('0x15')]);router['put'](_0x6f10('0x10'),auth[_0x6f10('0xc')](),controller['update']);router[_0x6f10('0x16')](_0x6f10('0x10'),auth[_0x6f10('0xc')](),controller[_0x6f10('0x17')]);module[_0x6f10('0x18')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index f8a163c..7047e57 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 _0xd0da=['extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','format','sequelize','moment','path','../../config/environment','exports','getDataValue','value'];(function(_0x3437a2,_0x4aa5ec){var _0x38ec72=function(_0x39009b){while(--_0x39009b){_0x3437a2['push'](_0x3437a2['shift']());}};_0x38ec72(++_0x4aa5ec);}(_0xd0da,0x1b1));var _0xad0d=function(_0x323c7e,_0x3d16ec){_0x323c7e=_0x323c7e-0x0;var _0x2b0f72=_0xd0da[_0x323c7e];return _0x2b0f72;};'use strict';var Sequelize=require(_0xad0d('0x0'));var moment=require(_0xad0d('0x1'));var path=require(_0xad0d('0x2'));var config=require(_0xad0d('0x3'));module[_0xad0d('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xad0d('0x5')](_0xad0d('0x6'))?path[_0xad0d('0x7')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0xad0d('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0xc14f42){var _0xa95863=_0xc14f42[_0xad0d('0x9')](/\\/g,'/');this[_0xad0d('0xa')]('value',_0xa95863);}},'rating':{'type':Sequelize[_0xad0d('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xad0d('0xb')],'set':function(_0x40e717){this[_0xad0d('0xa')](_0xad0d('0xc'),moment()[_0xad0d('0xd')](_0x40e717,'ms'));this[_0xad0d('0xa')](_0xad0d('0xe'),moment());this[_0xad0d('0xa')](_0xad0d('0xf'),_0x40e717);}},'startedAt':{'type':Sequelize[_0xad0d('0x10')],'get':function(){return moment(this[_0xad0d('0x5')](_0xad0d('0xc')))['format'](_0xad0d('0x11'))[_0xad0d('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xad0d('0x5')](_0xad0d('0xe')))['format'](_0xad0d('0x11'))[_0xad0d('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xad0d('0x5')](_0xad0d('0x13')))['format'](_0xad0d('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xad0d('0x5')](_0xad0d('0x14')))[_0xad0d('0x15')]('MM-DD-YYYY\x20HH:mm')[_0xad0d('0x12')]();}}}; \ No newline at end of file +var _0x79d7=['VIRTUAL','getDataValue','value','STRING','replace','setDataValue','startedAt','subtract','closedAt','duration','format','toString','DATE','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','path','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79d7,0x9c));var _0x779d=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x79d7[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0x779d('0x0'));var moment=require('moment');var path=require(_0x779d('0x1'));var config=require(_0x779d('0x2'));module[_0x779d('0x3')]={'format':{'type':Sequelize[_0x779d('0x4')],'get':function(){return this[_0x779d('0x5')](_0x779d('0x6'))?path['extname'](this[_0x779d('0x5')](_0x779d('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x779d('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x227c87){var _0x4c7fb4=_0x227c87[_0x779d('0x8')](/\\/g,'/');this[_0x779d('0x9')]('value',_0x4c7fb4);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5b4ef2){this[_0x779d('0x9')](_0x779d('0xa'),moment()[_0x779d('0xb')](_0x5b4ef2,'ms'));this['setDataValue'](_0x779d('0xc'),moment());this['setDataValue'](_0x779d('0xd'),_0x5b4ef2);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x779d('0x5')](_0x779d('0xa')))[_0x779d('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x779d('0xf')]();}},'closedAt':{'type':Sequelize[_0x779d('0x10')],'get':function(){return moment(this[_0x779d('0x5')](_0x779d('0xc')))[_0x779d('0xe')](_0x779d('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x779d('0x10')],'get':function(){return moment(this[_0x779d('0x5')](_0x779d('0x12')))[_0x779d('0xe')](_0x779d('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x779d('0x10')],'get':function(){return moment(this[_0x779d('0x5')](_0x779d('0x13')))['format'](_0x779d('0x11'))[_0x779d('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 93d9a5d..77eb0d7 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 _0x24ca=['server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','ScreenRecording','include','findAll','rows','catch','show','model','includeAll','find','create','body','duration','createdAt','closedAt','params','describe','download','uniqueid','value','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','join'];(function(_0x4a92a0,_0x4818a7){var _0x3f8a41=function(_0x578f41){while(--_0x578f41){_0x4a92a0['push'](_0x4a92a0['shift']());}};_0x3f8a41(++_0x4818a7);}(_0x24ca,0x1bc));var _0xa24c=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0x24ca[_0x409deb];return _0x15a4f7;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['ScreenRecording'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x32')](_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c')),['format']);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x28675f[_0xa24c('0x33')]);_0x5e491e['filters']=_[_0xa24c('0x35')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x33')]);_0x12dbdc[_0xa24c('0x36')]=_['intersection'](_0x5e491e['model'],qs[_0xa24c('0x37')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x37')]));_0x12dbdc[_0xa24c('0x36')]=_0x12dbdc[_0xa24c('0x36')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x36')]:_0x5e491e['model'];if(!_0x28675f[_0xa24c('0x33')][_0xa24c('0x39')](_0xa24c('0x3a'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x33')]['offset']);}_0x12dbdc[_0xa24c('0x3b')]=qs[_0xa24c('0x3c')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x3c')]);_0x12dbdc['where']=qs['filters'](_[_0xa24c('0x3d')](_0x28675f['query'],_0x5e491e[_0xa24c('0x3e')]),_0xc96ce7);if(_0x28675f[_0xa24c('0x33')][_0xa24c('0x3f')]){_0x12dbdc[_0xa24c('0x40')]=_[_0xa24c('0x41')](_0x12dbdc['where'],{'$or':_['map'](_0xc96ce7,function(_0x3121e){if(_0x3121e[_0xa24c('0x42')]!==_0xa24c('0x43')){var _0x213dc3={};_0x213dc3[_0x3121e[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x33')]['filter']+'%'};return _0x213dc3;}})});}_0x12dbdc=_['merge']({},_0x12dbdc,_0x28675f[_0xa24c('0x44')]);var _0x1ce83e={'where':_0x12dbdc[_0xa24c('0x40')]};return db[_0xa24c('0x45')][_0xa24c('0x20')](_0x1ce83e)['then'](function(_0x171c51){_0x21d2a8[_0xa24c('0x20')]=_0x171c51;if(_0x28675f['query']['includeAll']){_0x12dbdc[_0xa24c('0x46')]=[{'all':!![]}];}return db[_0xa24c('0x45')][_0xa24c('0x47')](_0x12dbdc);})['then'](function(_0x58ac8b){_0x21d2a8[_0xa24c('0x48')]=_0x58ac8b;return _0x21d2a8;})[_0xa24c('0x27')](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x49')](handleError(_0x152120,null));};exports[_0xa24c('0x4a')]=function(_0x3f640e,_0x1b7faf){var _0x23d1e0={'raw':![],'where':{'id':_0x3f640e['params']['id']}},_0x394d19={};_0x394d19['model']=_[_0xa24c('0x34')](db[_0xa24c('0x45')][_0xa24c('0x2f')]);_0x394d19['query']=_[_0xa24c('0x34')](_0x3f640e[_0xa24c('0x33')]);_0x394d19[_0xa24c('0x3e')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],_0x394d19[_0xa24c('0x33')]);_0x23d1e0[_0xa24c('0x36')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],qs[_0xa24c('0x37')](_0x3f640e['query'][_0xa24c('0x37')]));_0x23d1e0[_0xa24c('0x36')]=_0x23d1e0[_0xa24c('0x36')]['length']?_0x23d1e0[_0xa24c('0x36')]:_0x394d19[_0xa24c('0x4b')];if(_0x3f640e[_0xa24c('0x33')][_0xa24c('0x4c')]){_0x23d1e0[_0xa24c('0x46')]=[{'all':!![]}];}_0x23d1e0=_[_0xa24c('0x41')]({},_0x23d1e0,_0x3f640e[_0xa24c('0x44')]);return db[_0xa24c('0x45')][_0xa24c('0x4d')](_0x23d1e0)[_0xa24c('0x27')](handleEntityNotFound(_0x1b7faf,null))[_0xa24c('0x27')](respondWithResult(_0x1b7faf,null))['catch'](handleError(_0x1b7faf,null));};exports[_0xa24c('0x4e')]=function(_0x96b977,_0x42028b){return db[_0xa24c('0x45')][_0xa24c('0x4e')](_0x96b977[_0xa24c('0x4f')],{})[_0xa24c('0x27')](respondWithResult(_0x42028b,0xc9))[_0xa24c('0x49')](handleError(_0x42028b,null));};exports[_0xa24c('0x26')]=function(_0x4f56ae,_0x540da8){if(_0x4f56ae[_0xa24c('0x4f')]['id']){delete _0x4f56ae['body']['id'];}delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x50')];delete _0x4f56ae['body'][_0xa24c('0x51')];delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x52')];delete _0x4f56ae['body']['value'];return db[_0xa24c('0x45')]['find']({'where':{'id':_0x4f56ae[_0xa24c('0x53')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x540da8,null))[_0xa24c('0x27')](saveUpdates(_0x4f56ae[_0xa24c('0x4f')],null))[_0xa24c('0x27')](respondWithResult(_0x540da8,null))[_0xa24c('0x49')](handleError(_0x540da8,null));};exports[_0xa24c('0x54')]=function(_0x286d57,_0x22a0db){return db[_0xa24c('0x45')]['describe']()[_0xa24c('0x27')](respondWithResult(_0x22a0db,null))[_0xa24c('0x49')](handleError(_0x22a0db,null));};exports[_0xa24c('0x55')]=function(_0x513271,_0x5bde94,_0x487cc9){var _0x2da4f0=require('../../components/encryptor');var _0x4757ff=![];var _0x21d0fc={};if(_0x513271['query'][_0xa24c('0x42')]&&_0x513271[_0xa24c('0x33')][_0xa24c('0x42')]===_0xa24c('0x56')){_0x21d0fc[_0xa24c('0x56')]=_0x513271[_0xa24c('0x53')]['id'];}else{_0x21d0fc['id']=_0x513271[_0xa24c('0x53')]['id'];}return db[_0xa24c('0x45')]['find']({'where':_0x21d0fc,'attributes':['id',_0xa24c('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x5bde94,null))['then'](function(_0x565f0a){if(_0x565f0a){var _0x5bd2af=path['join'](config[_0xa24c('0x58')],'server/files/screen_recordings',_0x565f0a[_0xa24c('0x57')]);var _0x3fd3f9=util[_0xa24c('0x59')](_0xa24c('0x5a'),_0x5bd2af);if(fs[_0xa24c('0x5b')](_0x3fd3f9)){_0x4757ff=!![];return _0x2da4f0[_0xa24c('0x5c')](_0x3fd3f9,_0x5bd2af,config[_0xa24c('0x5d')][_0xa24c('0x5e')])[_0xa24c('0x27')](function(){return _0x565f0a;});}return _0x565f0a;}})[_0xa24c('0x27')](function(_0x303b7d){if(_0x303b7d){var _0x37dbbd=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x303b7d['value']);if(!fs[_0xa24c('0x5b')](_0x37dbbd)){throw new db[(_0xa24c('0x61'))]['ValidationError'](_0xa24c('0x62'));}if(_0x303b7d[_0xa24c('0x63')]){return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,_0x303b7d[_0xa24c('0x63')]+path['extname'](_0x37dbbd),function(){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}else{return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,function(_0x5e9631){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}}})[_0xa24c('0x49')](function(_0x2515b1){if(_0x2515b1[_0xa24c('0x64')]===_0xa24c('0x62')){_0x5bde94['status'](0x194)['send'](_0xa24c('0x65'));}else{return handleError(_0x5bde94,null);}});};exports['destroy']=function(_0x52a895,_0xfcc193){return db[_0xa24c('0x45')][_0xa24c('0x4d')]({'where':{'id':_0x52a895['params']['id']}})[_0xa24c('0x27')](function(_0x128e5b){if(_['isNil'](_0x128e5b)){throw new ReferenceError(_0xa24c('0x66'));}return _0x128e5b;})[_0xa24c('0x27')](function(_0x3096bf){var _0x4bee5c=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x3096bf[_0xa24c('0x57')]);logger[_0xa24c('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x4bee5c);if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs[_0xa24c('0x5b')](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}_0x4bee5c=_0x4bee5c+'.cypher';if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs['existsSync'](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}return _0x3096bf;})[_0xa24c('0x27')](function(_0x3a241a){if(!_0x3a241a)throw new InternalError();return _0x3a241a[_0xa24c('0x28')]();})[_0xa24c('0x27')](function(){_0xfcc193[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();})['catch'](handleError(_0xfcc193,null));}; \ No newline at end of file +var _0x8d0e=['name','send','map','fieldName','type','key','format','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','show','includeAll','include','ScreenRecording','find','create','body','duration','value','params','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','filename','unlink','ScreenRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','stack'];(function(_0x31980e,_0x2bb678){var _0x106113=function(_0x441575){while(--_0x441575){_0x31980e['push'](_0x31980e['shift']());}};_0x106113(++_0x2bb678);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3f9330,_0x3d5531){_0x3f9330=_0x3f9330-0x0;var _0x397364=_0x8d0e[_0x3f9330];return _0x397364;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){_0x9f747[_0xe8d0('0x1b')](0xcc)[_0xe8d0('0x28')]();});}};}function handleEntityNotFound(_0x149dfd,_0x31519b){return function(_0x32f0c1){if(!_0x32f0c1){_0x149dfd[_0xe8d0('0x29')](0x194);}return _0x32f0c1;};}function handleError(_0x2dee67,_0x264de4){_0x264de4=_0x264de4||0x1f4;return function(_0x539548){logger[_0xe8d0('0x2a')](_0x539548[_0xe8d0('0x2b')]);if(_0x539548[_0xe8d0('0x2c')]){delete _0x539548['name'];}_0x2dee67[_0xe8d0('0x1b')](_0x264de4)[_0xe8d0('0x2d')](_0x539548);};}exports['index']=function(_0x1519e2,_0x3ffcb7){var _0x11fcf2={},_0x9eec0e={},_0x3cf3d6={'count':0x0,'rows':[]};var _0x495064=_[_0xe8d0('0x2e')](db['ScreenRecording']['rawAttributes'],function(_0x50ad3c){return{'name':_0x50ad3c[_0xe8d0('0x2f')],'type':_0x50ad3c[_0xe8d0('0x30')][_0xe8d0('0x31')]};});_0x9eec0e['model']=_['differenceBy'](_[_0xe8d0('0x2e')](_0x495064,'name'),[_0xe8d0('0x32')]);_0x9eec0e[_0xe8d0('0x33')]=_[_0xe8d0('0x34')](_0x1519e2[_0xe8d0('0x33')]);_0x9eec0e[_0xe8d0('0x35')]=_['intersection'](_0x9eec0e[_0xe8d0('0x36')],_0x9eec0e[_0xe8d0('0x33')]);_0x11fcf2[_0xe8d0('0x37')]=_[_0xe8d0('0x38')](_0x9eec0e['model'],qs[_0xe8d0('0x39')](_0x1519e2[_0xe8d0('0x33')]['fields']));_0x11fcf2[_0xe8d0('0x37')]=_0x11fcf2['attributes'][_0xe8d0('0x3a')]?_0x11fcf2['attributes']:_0x9eec0e[_0xe8d0('0x36')];if(!_0x1519e2['query'][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x11fcf2[_0xe8d0('0x1e')]=qs[_0xe8d0('0x1e')](_0x1519e2['query'][_0xe8d0('0x1e')]);_0x11fcf2[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x1519e2['query'][_0xe8d0('0x1f')]);}_0x11fcf2[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x3e')]);_0x11fcf2['where']=qs[_0xe8d0('0x35')](_[_0xe8d0('0x3f')](_0x1519e2[_0xe8d0('0x33')],_0x9eec0e[_0xe8d0('0x35')]),_0x495064);if(_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x40')]){_0x11fcf2[_0xe8d0('0x41')]=_[_0xe8d0('0x42')](_0x11fcf2['where'],{'$or':_['map'](_0x495064,function(_0xdca203){if(_0xdca203[_0xe8d0('0x30')]!==_0xe8d0('0x43')){var _0x377dc1={};_0x377dc1[_0xdca203[_0xe8d0('0x2c')]]={'$like':'%'+_0x1519e2['query'][_0xe8d0('0x40')]+'%'};return _0x377dc1;}})});}_0x11fcf2=_['merge']({},_0x11fcf2,_0x1519e2[_0xe8d0('0x44')]);var _0x458294={'where':_0x11fcf2[_0xe8d0('0x41')]};return db['ScreenRecording'][_0xe8d0('0x20')](_0x458294)[_0xe8d0('0x27')](function(_0x731382){_0x3cf3d6[_0xe8d0('0x20')]=_0x731382;if(_0x1519e2[_0xe8d0('0x33')]['includeAll']){_0x11fcf2['include']=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x11fcf2);})[_0xe8d0('0x27')](function(_0x52f288){_0x3cf3d6[_0xe8d0('0x45')]=_0x52f288;return _0x3cf3d6;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x3ffcb7,_0x11fcf2))[_0xe8d0('0x46')](handleError(_0x3ffcb7,null));};exports[_0xe8d0('0x47')]=function(_0x2fd21e,_0x1156da){var _0x1b41c7={'raw':![],'where':{'id':_0x2fd21e['params']['id']}},_0x3cbca5={};_0x3cbca5[_0xe8d0('0x36')]=_[_0xe8d0('0x34')](db['ScreenRecording']['rawAttributes']);_0x3cbca5[_0xe8d0('0x33')]=_[_0xe8d0('0x34')](_0x2fd21e[_0xe8d0('0x33')]);_0x3cbca5['filters']=_[_0xe8d0('0x38')](_0x3cbca5[_0xe8d0('0x36')],_0x3cbca5['query']);_0x1b41c7[_0xe8d0('0x37')]=_[_0xe8d0('0x38')](_0x3cbca5['model'],qs[_0xe8d0('0x39')](_0x2fd21e[_0xe8d0('0x33')][_0xe8d0('0x39')]));_0x1b41c7[_0xe8d0('0x37')]=_0x1b41c7[_0xe8d0('0x37')][_0xe8d0('0x3a')]?_0x1b41c7[_0xe8d0('0x37')]:_0x3cbca5[_0xe8d0('0x36')];if(_0x2fd21e['query'][_0xe8d0('0x48')]){_0x1b41c7[_0xe8d0('0x49')]=[{'all':!![]}];}_0x1b41c7=_[_0xe8d0('0x42')]({},_0x1b41c7,_0x2fd21e[_0xe8d0('0x44')]);return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')](_0x1b41c7)[_0xe8d0('0x27')](handleEntityNotFound(_0x1156da,null))[_0xe8d0('0x27')](respondWithResult(_0x1156da,null))[_0xe8d0('0x46')](handleError(_0x1156da,null));};exports[_0xe8d0('0x4c')]=function(_0x361e3d,_0x3a5987){return db['ScreenRecording'][_0xe8d0('0x4c')](_0x361e3d[_0xe8d0('0x4d')],{})[_0xe8d0('0x27')](respondWithResult(_0x3a5987,0xc9))[_0xe8d0('0x46')](handleError(_0x3a5987,null));};exports[_0xe8d0('0x25')]=function(_0x2e4caf,_0x5a0c7e){if(_0x2e4caf['body']['id']){delete _0x2e4caf[_0xe8d0('0x4d')]['id'];}delete _0x2e4caf[_0xe8d0('0x4d')][_0xe8d0('0x4e')];delete _0x2e4caf[_0xe8d0('0x4d')]['createdAt'];delete _0x2e4caf[_0xe8d0('0x4d')]['closedAt'];delete _0x2e4caf[_0xe8d0('0x4d')][_0xe8d0('0x4f')];return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')]({'where':{'id':_0x2e4caf[_0xe8d0('0x50')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x5a0c7e,null))[_0xe8d0('0x27')](saveUpdates(_0x2e4caf['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x5a0c7e,null))['catch'](handleError(_0x5a0c7e,null));};exports['describe']=function(_0x35138a,_0x5516ad){return db[_0xe8d0('0x4a')]['describe']()[_0xe8d0('0x27')](respondWithResult(_0x5516ad,null))[_0xe8d0('0x46')](handleError(_0x5516ad,null));};exports[_0xe8d0('0x51')]=function(_0xcf4642,_0x555a56,_0x3088b1){var _0xbd55db=require(_0xe8d0('0x52'));var _0x2e3f1d=![];var _0x18cc14={};if(_0xcf4642['query'][_0xe8d0('0x30')]&&_0xcf4642[_0xe8d0('0x33')][_0xe8d0('0x30')]==='uniqueid'){_0x18cc14[_0xe8d0('0x53')]=_0xcf4642['params']['id'];}else{_0x18cc14['id']=_0xcf4642['params']['id'];}return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')]({'where':_0x18cc14,'attributes':['id','value'],'raw':!![]})[_0xe8d0('0x27')](handleEntityNotFound(_0x555a56,null))[_0xe8d0('0x27')](function(_0x47893d){if(_0x47893d){var _0x2a54c1=path[_0xe8d0('0x54')](config[_0xe8d0('0x55')],_0xe8d0('0x56'),_0x47893d['value']);var _0x20f6c2=util[_0xe8d0('0x32')](_0xe8d0('0x57'),_0x2a54c1);if(fs[_0xe8d0('0x58')](_0x20f6c2)){_0x2e3f1d=!![];return _0xbd55db['decryptFile'](_0x20f6c2,_0x2a54c1,config[_0xe8d0('0x59')][_0xe8d0('0x5a')])[_0xe8d0('0x27')](function(){return _0x47893d;});}return _0x47893d;}})[_0xe8d0('0x27')](function(_0x1a74d0){if(_0x1a74d0){var _0x29667c=path['join'](config['root'],_0xe8d0('0x56'),_0x1a74d0['value']);if(!fs[_0xe8d0('0x58')](_0x29667c)){throw new db[(_0xe8d0('0x5b'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x1a74d0[_0xe8d0('0x5c')]){return _0x555a56['download'](_0x29667c,_0x1a74d0[_0xe8d0('0x5c')]+path['extname'](_0x29667c),function(){if(_0x2e3f1d){fs[_0xe8d0('0x5d')](_0x29667c);}});}else{return _0x555a56[_0xe8d0('0x51')](_0x29667c,function(_0x13b9f0){if(_0x2e3f1d){fs['unlink'](_0x29667c);}});}}})[_0xe8d0('0x46')](function(_0x3cbc9f){if(_0x3cbc9f['message']===_0xe8d0('0x5e')){_0x555a56['status'](0x194)[_0xe8d0('0x2d')]('Not\x20found');}else{return handleError(_0x555a56,null);}});};exports[_0xe8d0('0x26')]=function(_0x17afc2,_0x29467d){return db[_0xe8d0('0x4a')][_0xe8d0('0x4b')]({'where':{'id':_0x17afc2['params']['id']}})['then'](function(_0xd7d433){if(_['isNil'](_0xd7d433)){throw new ReferenceError(_0xe8d0('0x5f'));}return _0xd7d433;})[_0xe8d0('0x27')](function(_0xbbe457){var _0x95565d=path[_0xe8d0('0x54')](config[_0xe8d0('0x55')],_0xe8d0('0x56'),_0xbbe457[_0xe8d0('0x4f')]);logger[_0xe8d0('0x60')](_0xe8d0('0x61'),_0x95565d);if(!_[_0xe8d0('0x62')](_0xbbe457[_0xe8d0('0x4f')])&&fs[_0xe8d0('0x58')](_0x95565d)){logger[_0xe8d0('0x60')](_0xe8d0('0x63')+_0x95565d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe8d0('0x64')](_0x95565d);}_0x95565d=_0x95565d+_0xe8d0('0x65');if(!_[_0xe8d0('0x62')](_0xbbe457[_0xe8d0('0x4f')])&&fs[_0xe8d0('0x58')](_0x95565d)){logger['info'](_0xe8d0('0x63')+_0x95565d+_0xe8d0('0x66'));fs[_0xe8d0('0x64')](_0x95565d);}return _0xbbe457;})[_0xe8d0('0x27')](function(_0x360633){if(!_0x360633)throw new InternalError();return _0x360633[_0xe8d0('0x26')]();})[_0xe8d0('0x27')](function(){_0x29467d[_0xe8d0('0x1b')](0xcc)[_0xe8d0('0x28')]();})[_0xe8d0('0x46')](handleError(_0x29467d,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 35bf9bd..4a5e8e0 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 _0x9e7c=['util','api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x9e7c,0x19f));var _0xc9e7=function(_0x21d535,_0x9d3bf4){_0x21d535=_0x21d535-0x0;var _0x1194c2=_0x9e7c[_0x21d535];return _0x1194c2;};'use strict';var _=require(_0xc9e7('0x0'));var util=require(_0xc9e7('0x1'));var logger=require('../../config/logger')(_0xc9e7('0x2'));var moment=require(_0xc9e7('0x3'));var BPromise=require('bluebird');var rp=require(_0xc9e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9e7('0x5'));var config=require(_0xc9e7('0x6'));var attributes=require(_0xc9e7('0x7'));module[_0xc9e7('0x8')]=function(_0x307034,_0x35e244){return _0x307034[_0xc9e7('0x9')](_0xc9e7('0xa'),attributes,{'tableName':_0xc9e7('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xc9e7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb683=['exports','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x51ce61,_0x404d33){var _0x242cad=function(_0xb47c9e){while(--_0xb47c9e){_0x51ce61['push'](_0x51ce61['shift']());}};_0x242cad(++_0x404d33);}(_0xb683,0x197));var _0x3b68=function(_0x355543,_0x2338dd){_0x355543=_0x355543-0x0;var _0x468604=_0xb683[_0x355543];return _0x468604;};'use strict';var _=require('lodash');var util=require(_0x3b68('0x0'));var logger=require(_0x3b68('0x1'))('api');var moment=require(_0x3b68('0x2'));var BPromise=require(_0x3b68('0x3'));var rp=require(_0x3b68('0x4'));var fs=require('fs');var path=require(_0x3b68('0x5'));var rimraf=require(_0x3b68('0x6'));var config=require(_0x3b68('0x7'));var attributes=require(_0x3b68('0x8'));module[_0x3b68('0x9')]=function(_0x3cac5c,_0x2e8b25){return _0x3cac5c['define'](_0x3b68('0xa'),attributes,{'tableName':_0x3b68('0xb'),'paranoid':![],'indexes':[{'name':_0x3b68('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 23474bd..10c0ced 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 _0x001b=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x001b,0x8a));var _0xb001=function(_0x5e156b,_0x3c6264){_0x5e156b=_0x5e156b-0x0;var _0x74404d=_0x001b[_0x5e156b];return _0x74404d;};'use strict';var _=require(_0xb001('0x0'));var util=require(_0xb001('0x1'));var moment=require(_0xb001('0x2'));var BPromise=require('bluebird');var rs=require(_0xb001('0x3'));var fs=require('fs');var Redis=require(_0xb001('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb001('0x5'));var logger=require(_0xb001('0x6'))(_0xb001('0x7'));var config=require(_0xb001('0x8'));var jayson=require(_0xb001('0x9'));var client=jayson['client'][_0xb001('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b115d,_0x278200,_0x49bbbc){return new BPromise(function(_0x4ab341,_0x52533c){return client['request'](_0x4b115d,_0x49bbbc)['then'](function(_0x3d4945){logger[_0xb001('0xb')](_0xb001('0xc'),_0x278200,_0xb001('0xd'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x278200,_0xb001('0xd'),JSON[_0xb001('0xe')](_0x3d4945));if(_0x3d4945[_0xb001('0xf')]){if(_0x3d4945[_0xb001('0xf')][_0xb001('0x10')]===0x1f4){logger[_0xb001('0xf')](_0xb001('0xc'),_0x278200,_0x3d4945[_0xb001('0xf')][_0xb001('0x11')]);return _0x52533c(_0x3d4945[_0xb001('0xf')][_0xb001('0x11')]);}logger[_0xb001('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x278200,_0x3d4945[_0xb001('0xf')]['message']);return _0x4ab341(_0x3d4945[_0xb001('0xf')][_0xb001('0x11')]);}else{logger[_0xb001('0xb')](_0xb001('0xc'),_0x278200,_0xb001('0xd'));_0x4ab341(_0x3d4945[_0xb001('0x12')][_0xb001('0x11')]);}})[_0xb001('0x13')](function(_0x361dd0){logger[_0xb001('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x278200,_0x361dd0);_0x52533c(_0x361dd0);});});} \ No newline at end of file +var _0x3db7=['info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0x3db7,0x198));var _0x73db=function(_0x1d3d58,_0x13bc04){_0x1d3d58=_0x1d3d58-0x0;var _0x3cce7a=_0x3db7[_0x1d3d58];return _0x3cce7a;};'use strict';var _=require(_0x73db('0x0'));var util=require(_0x73db('0x1'));var moment=require('moment');var BPromise=require(_0x73db('0x2'));var rs=require(_0x73db('0x3'));var fs=require('fs');var Redis=require(_0x73db('0x4'));var db=require(_0x73db('0x5'))['db'];var utils=require(_0x73db('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x73db('0x7'));var jayson=require(_0x73db('0x8'));var client=jayson['client'][_0x73db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8516,_0x4421ac,_0x16d4d0){return new BPromise(function(_0x34a5ed,_0xe7e0f8){return client[_0x73db('0xa')](_0x2c8516,_0x16d4d0)[_0x73db('0xb')](function(_0x50cf14){logger[_0x73db('0xc')](_0x73db('0xd'),_0x4421ac,_0x73db('0xe'));logger[_0x73db('0xf')](_0x73db('0x10'),_0x4421ac,_0x73db('0xe'),JSON['stringify'](_0x50cf14));if(_0x50cf14[_0x73db('0x11')]){if(_0x50cf14[_0x73db('0x11')]['code']===0x1f4){logger['error'](_0x73db('0xd'),_0x4421ac,_0x50cf14[_0x73db('0x11')]['message']);return _0xe7e0f8(_0x50cf14[_0x73db('0x11')][_0x73db('0x12')]);}logger['error'](_0x73db('0xd'),_0x4421ac,_0x50cf14[_0x73db('0x11')][_0x73db('0x12')]);return _0x34a5ed(_0x50cf14['error'][_0x73db('0x12')]);}else{logger[_0x73db('0xc')](_0x73db('0xd'),_0x4421ac,'request\x20sent');_0x34a5ed(_0x50cf14['result'][_0x73db('0x12')]);}})[_0x73db('0x13')](function(_0xc26c80){logger[_0x73db('0x11')](_0x73db('0xd'),_0x4421ac,_0xc26c80);_0xe7e0f8(_0xc26c80);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 94612b9..6b32f3d 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 _0x92c3=['/:id/preferred','addPreferred','favicon','addFavicon','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','index','getDate','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','addLogo','diskStorage','logologin','single','file','addLogoLogin','preferred'];(function(_0x44d40e,_0x385d76){var _0x49fa79=function(_0x4325c4){while(--_0x4325c4){_0x44d40e['push'](_0x44d40e['shift']());}};_0x49fa79(++_0x385d76);}(_0x92c3,0x13a));var _0x392c=function(_0x2604e9,_0x4512a6){_0x2604e9=_0x2604e9-0x0;var _0x344d7f=_0x92c3[_0x2604e9];return _0x344d7f;};'use strict';var multer=require('multer');var util=require(_0x392c('0x0'));var path=require(_0x392c('0x1'));var timeout=require(_0x392c('0x2'));var express=require(_0x392c('0x3'));var router=express[_0x392c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x392c('0x5'));var interaction=require(_0x392c('0x6'));var config=require(_0x392c('0x7'));var controller=require(_0x392c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x392c('0x9')]);router['get']('/now',controller[_0x392c('0xa')]);router[_0x392c('0xb')](_0x392c('0xc'),controller[_0x392c('0xd')]);router[_0x392c('0xb')](_0x392c('0xe'),controller[_0x392c('0xf')]);router[_0x392c('0xb')](_0x392c('0x10'),controller[_0x392c('0x11')]);router[_0x392c('0xb')](_0x392c('0x12'),controller[_0x392c('0x13')]);router['get']('/:id/preferred',controller[_0x392c('0x14')]);router[_0x392c('0xb')](_0x392c('0x15'),controller[_0x392c('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x523d04,_0x16163d,_0xd65f92){_0xd65f92(null,path[_0x392c('0x17')](config[_0x392c('0x18')],_0x392c('0x19')));},'filename':function(_0x277af8,_0x3af603,_0x29a16b){_0x29a16b(null,util[_0x392c('0x1a')](_0x392c('0x1b'),'logo',path[_0x392c('0x1c')](_0x3af603[_0x392c('0x1d')])));}})});router[_0x392c('0x1e')](_0x392c('0xe'),upload['single']('file'),controller[_0x392c('0x1f')]);var upload=multer({'storage':multer[_0x392c('0x20')]({'destination':function(_0x1e7040,_0x4e0803,_0x158db6){_0x158db6(null,path[_0x392c('0x17')](config[_0x392c('0x18')],_0x392c('0x19')));},'filename':function(_0x7f38ae,_0x2961bf,_0x47a0c0){_0x47a0c0(null,util['format'](_0x392c('0x1b'),_0x392c('0x21'),path['extname'](_0x2961bf[_0x392c('0x1d')])));}})});router[_0x392c('0x1e')](_0x392c('0x10'),upload[_0x392c('0x22')](_0x392c('0x23')),controller[_0x392c('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x290380,_0x496762,_0x3d5994){_0x3d5994(null,path[_0x392c('0x17')](config[_0x392c('0x18')],_0x392c('0x19')));},'filename':function(_0x2b6629,_0x2ba284,_0x2aca16){_0x2aca16(null,util[_0x392c('0x1a')](_0x392c('0x1b'),_0x392c('0x25'),path[_0x392c('0x1c')](_0x2ba284[_0x392c('0x1d')])));}})});router[_0x392c('0x1e')](_0x392c('0x26'),upload[_0x392c('0x22')]('file'),controller[_0x392c('0x27')]);var upload=multer({'storage':multer[_0x392c('0x20')]({'destination':function(_0x525245,_0x4985f8,_0x88c5d0){_0x88c5d0(null,path[_0x392c('0x17')](config[_0x392c('0x18')],_0x392c('0x19')));},'filename':function(_0x5f3eb2,_0x39f288,_0x5dbaa7){_0x5dbaa7(null,util['format'](_0x392c('0x1b'),_0x392c('0x28'),path['extname'](_0x39f288['originalname'])));}})});router['post'](_0x392c('0x15'),upload[_0x392c('0x22')](_0x392c('0x23')),controller[_0x392c('0x29')]);router[_0x392c('0x2a')](_0x392c('0xc'),auth['isAuthenticated'](),controller['update']);module[_0x392c('0x2b')]=router; \ No newline at end of file +var _0x4f0a=['/:id/favicon','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','single','file','addLogo','diskStorage','logologin','extname','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred'];(function(_0x317d4c,_0x391e9d){var _0x433884=function(_0x366dd4){while(--_0x366dd4){_0x317d4c['push'](_0x317d4c['shift']());}};_0x433884(++_0x391e9d);}(_0x4f0a,0x159));var _0xa4f0=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0x4f0a[_0x3db122];return _0x325b67;};'use strict';var multer=require(_0xa4f0('0x0'));var util=require('util');var path=require(_0xa4f0('0x1'));var timeout=require(_0xa4f0('0x2'));var express=require(_0xa4f0('0x3'));var router=express[_0xa4f0('0x4')]();var fs_extra=require(_0xa4f0('0x5'));var auth=require(_0xa4f0('0x6'));var interaction=require(_0xa4f0('0x7'));var config=require(_0xa4f0('0x8'));var controller=require(_0xa4f0('0x9'));router[_0xa4f0('0xa')]('/',auth[_0xa4f0('0xb')](),controller['index']);router['get'](_0xa4f0('0xc'),controller[_0xa4f0('0xd')]);router['get']('/:id',controller[_0xa4f0('0xe')]);router[_0xa4f0('0xa')](_0xa4f0('0xf'),controller[_0xa4f0('0x10')]);router['get'](_0xa4f0('0x11'),controller[_0xa4f0('0x12')]);router[_0xa4f0('0xa')](_0xa4f0('0x13'),controller[_0xa4f0('0x14')]);router[_0xa4f0('0xa')](_0xa4f0('0x15'),controller[_0xa4f0('0x16')]);router['get'](_0xa4f0('0x17'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4026ad,_0x571a38,_0x334e27){_0x334e27(null,path[_0xa4f0('0x18')](config[_0xa4f0('0x19')],_0xa4f0('0x1a')));},'filename':function(_0x4bc826,_0x1a1a63,_0x5304a8){_0x5304a8(null,util[_0xa4f0('0x1b')](_0xa4f0('0x1c'),_0xa4f0('0x1d'),path['extname'](_0x1a1a63[_0xa4f0('0x1e')])));}})});router[_0xa4f0('0x1f')]('/:id/logo',upload[_0xa4f0('0x20')](_0xa4f0('0x21')),controller[_0xa4f0('0x22')]);var upload=multer({'storage':multer[_0xa4f0('0x23')]({'destination':function(_0x2e69f2,_0x90896d,_0x6dd1d4){_0x6dd1d4(null,path[_0xa4f0('0x18')](config[_0xa4f0('0x19')],_0xa4f0('0x1a')));},'filename':function(_0x5af9d9,_0x2cc49b,_0x195937){_0x195937(null,util['format'](_0xa4f0('0x1c'),_0xa4f0('0x24'),path[_0xa4f0('0x25')](_0x2cc49b[_0xa4f0('0x1e')])));}})});router['post'](_0xa4f0('0x11'),upload[_0xa4f0('0x20')](_0xa4f0('0x21')),controller[_0xa4f0('0x26')]);var upload=multer({'storage':multer[_0xa4f0('0x23')]({'destination':function(_0x1986fa,_0x2a4a87,_0xa30dc7){_0xa30dc7(null,path[_0xa4f0('0x18')](config[_0xa4f0('0x19')],_0xa4f0('0x1a')));},'filename':function(_0x5a697d,_0x498519,_0x4a88d8){_0x4a88d8(null,util[_0xa4f0('0x1b')]('%s%s',_0xa4f0('0x27'),path[_0xa4f0('0x25')](_0x498519['originalname'])));}})});router[_0xa4f0('0x1f')](_0xa4f0('0x15'),upload[_0xa4f0('0x20')](_0xa4f0('0x21')),controller[_0xa4f0('0x28')]);var upload=multer({'storage':multer[_0xa4f0('0x23')]({'destination':function(_0xb0adb2,_0x1cc91d,_0x2118b7){_0x2118b7(null,path['join'](config[_0xa4f0('0x19')],_0xa4f0('0x1a')));},'filename':function(_0x3615fa,_0x151582,_0xa03284){_0xa03284(null,util['format']('%s%s',_0xa4f0('0x29'),path['extname'](_0x151582[_0xa4f0('0x1e')])));}})});router[_0xa4f0('0x1f')]('/:id/favicon',upload['single'](_0xa4f0('0x21')),controller[_0xa4f0('0x2a')]);router[_0xa4f0('0x2b')]('/:id',auth[_0xa4f0('0xb')](),controller[_0xa4f0('0x2c')]);module[_0xa4f0('0x2d')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 8ca8cfb..04e8830 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(_0x5d7c4b,_0x558832){var _0x2ee2da=function(_0x293b97){while(--_0x293b97){_0x5d7c4b['push'](_0x5d7c4b['shift']());}};_0x2ee2da(++_0x558832);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x46d74d,_0x2ac23b){var _0xe05d6c=function(_0x308ff1){while(--_0x308ff1){_0x46d74d['push'](_0x46d74d['shift']());}};_0xe05d6c(++_0x2ac23b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 445c5a3..6785b4e 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 _0x1e19=['end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','body','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','toLower','root','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','getLicense','loginLogo','defaultPreferred','default_loginLogo.svg','default','gdpr','securePassword','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x4a811a,_0x194fc6){var _0xde29e8=function(_0x3cfa3d){while(--_0x3cfa3d){_0x4a811a['push'](_0x4a811a['shift']());}};_0xde29e8(++_0x194fc6);}(_0x1e19,0x1c9));var _0x91e1=function(_0x3d69f5,_0xb99af3){_0x3d69f5=_0x3d69f5-0x0;var _0xfc942a=_0x1e19[_0x3d69f5];return _0xfc942a;};'use strict';var emlformat=require(_0x91e1('0x0'));var rimraf=require(_0x91e1('0x1'));var zipdir=require(_0x91e1('0x2'));var jsonpatch=require(_0x91e1('0x3'));var rp=require(_0x91e1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x91e1('0x5'));var sox=require(_0x91e1('0x6'));var csv=require(_0x91e1('0x7'));var ejs=require(_0x91e1('0x8'));var fs=require('fs');var fs_extra=require(_0x91e1('0x9'));var _=require('lodash');var squel=require(_0x91e1('0xa'));var crypto=require('crypto');var jsforce=require(_0x91e1('0xb'));var deskjs=require(_0x91e1('0xc'));var toCsv=require(_0x91e1('0x7'));var querystring=require(_0x91e1('0xd'));var Papa=require(_0x91e1('0xe'));var Redis=require('ioredis');var authService=require(_0x91e1('0xf'));var qs=require(_0x91e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91e1('0x11'));var logger=require(_0x91e1('0x12'))(_0x91e1('0x13'));var utils=require(_0x91e1('0x14'));var config=require(_0x91e1('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x91e1('0x16'));var client=jayson[_0x91e1('0x17')][_0x91e1('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xc8b555,_0xb0f9e0,_0x8e8cf7,_0x23da39){return new BPromise(function(_0x3fb2e4,_0x511333){var _0x16119d=_0x23da39||client;return _0x16119d[_0x91e1('0x19')](_0xc8b555,_0x8e8cf7)[_0x91e1('0x1a')](function(_0x1d0bca){logger[_0x91e1('0x1b')](_0x91e1('0x1c'),_0xb0f9e0,'request\x20sent');logger[_0x91e1('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0xb0f9e0,_0x91e1('0x1e'),JSON[_0x91e1('0x1f')](_0x1d0bca));if(_0x1d0bca['error']){if(_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x21')]===0x1f4){logger[_0x91e1('0x20')]('Setting,\x20%s,\x20%s',_0xb0f9e0,_0x1d0bca['error'][_0x91e1('0x22')]);return _0x511333(_0x1d0bca['error'][_0x91e1('0x22')]);}logger[_0x91e1('0x20')](_0x91e1('0x1c'),_0xb0f9e0,_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x22')]);return _0x3fb2e4(_0x1d0bca[_0x91e1('0x20')][_0x91e1('0x22')]);}else{logger[_0x91e1('0x1b')](_0x91e1('0x1c'),_0xb0f9e0,_0x91e1('0x1e'));_0x3fb2e4(_0x1d0bca[_0x91e1('0x23')]['message']);}})[_0x91e1('0x24')](function(_0x3e39e3){logger[_0x91e1('0x20')]('Setting,\x20%s,\x20%s',_0xb0f9e0,_0x3e39e3);_0x511333(_0x3e39e3);});});}function respondWithStatusCode(_0x477d6c,_0xccc5ad){_0xccc5ad=_0xccc5ad||0xcc;return function(_0x3c7631){if(_0x3c7631){return _0x477d6c[_0x91e1('0x25')](_0xccc5ad);}return _0x477d6c[_0x91e1('0x26')](_0xccc5ad)[_0x91e1('0x27')]();};}function respondWithResult(_0x24a885,_0xe97618){_0xe97618=_0xe97618||0xc8;return function(_0xca52f1){if(_0xca52f1){return _0x24a885[_0x91e1('0x26')](_0xe97618)[_0x91e1('0x28')](_0xca52f1);}};}function respondWithFilteredResult(_0xaacfcd,_0x3dbb13){return function(_0xf3bbb8){if(_0xf3bbb8){var _0x17bebd=typeof _0x3dbb13[_0x91e1('0x29')]===_0x91e1('0x2a')&&typeof _0x3dbb13[_0x91e1('0x2b')]===_0x91e1('0x2a');var _0x178e6b=_0xf3bbb8['count'];var _0x19f84d=_0x17bebd?0x0:_0x3dbb13[_0x91e1('0x29')];var _0x5bae2b=_0x17bebd?_0xf3bbb8[_0x91e1('0x2c')]:_0x3dbb13['offset']+_0x3dbb13['limit'];var _0xb08207;if(_0x5bae2b>=_0x178e6b){_0x5bae2b=_0x178e6b;_0xb08207=0xc8;}else{_0xb08207=0xce;}_0xaacfcd[_0x91e1('0x26')](_0xb08207);return _0xaacfcd[_0x91e1('0x2d')]('Content-Range',_0x19f84d+'-'+_0x5bae2b+'/'+_0x178e6b)[_0x91e1('0x28')](_0xf3bbb8);}return null;};}function patchUpdates(_0xad968d){return function(_0x1237ab){try{jsonpatch[_0x91e1('0x2e')](_0x1237ab,_0xad968d,!![]);}catch(_0x1fe96a){return BPromise[_0x91e1('0x2f')](_0x1fe96a);}return _0x1237ab['save']();};}function saveUpdates(_0x598b6b,_0x8328d6){return function(_0x131a47){if(_0x131a47){return _0x131a47[_0x91e1('0x30')](_0x598b6b)[_0x91e1('0x1a')](function(_0x164312){return _0x164312;});}return null;};}function removeEntity(_0x545c94,_0x12e26f){return function(_0xdf6718){if(_0xdf6718){return _0xdf6718[_0x91e1('0x31')]()[_0x91e1('0x1a')](function(){_0x545c94[_0x91e1('0x26')](0xcc)[_0x91e1('0x27')]();});}};}function handleEntityNotFound(_0x7eb2cc,_0x3f969c){return function(_0x449df1){if(!_0x449df1){_0x7eb2cc[_0x91e1('0x25')](0x194);}return _0x449df1;};}function handleError(_0x10bd07,_0x48a6e0){_0x48a6e0=_0x48a6e0||0x1f4;return function(_0x1247c1){logger[_0x91e1('0x20')](_0x1247c1[_0x91e1('0x32')]);if(_0x1247c1[_0x91e1('0x33')]){delete _0x1247c1[_0x91e1('0x33')];}_0x10bd07['status'](_0x48a6e0)['send'](_0x1247c1);};}exports['index']=function(_0x294016,_0x1905e0){var _0x605a81={},_0x4eaa5c={},_0x5bfa14={'count':0x0,'rows':[]};var _0x2e3335=_[_0x91e1('0x34')](db[_0x91e1('0x35')][_0x91e1('0x36')],function(_0x389def){return{'name':_0x389def[_0x91e1('0x37')],'type':_0x389def[_0x91e1('0x38')][_0x91e1('0x39')]};});_0x4eaa5c[_0x91e1('0x3a')]=_['map'](_0x2e3335,_0x91e1('0x33'));_0x4eaa5c['query']=_[_0x91e1('0x3b')](_0x294016[_0x91e1('0x3c')]);_0x4eaa5c['filters']=_[_0x91e1('0x3d')](_0x4eaa5c[_0x91e1('0x3a')],_0x4eaa5c[_0x91e1('0x3c')]);_0x605a81['attributes']=_['intersection'](_0x4eaa5c[_0x91e1('0x3a')],qs['fields'](_0x294016[_0x91e1('0x3c')][_0x91e1('0x3e')]));_0x605a81[_0x91e1('0x3f')]=_0x605a81[_0x91e1('0x3f')][_0x91e1('0x40')]?_0x605a81[_0x91e1('0x3f')]:_0x4eaa5c['model'];if(!_0x294016[_0x91e1('0x3c')][_0x91e1('0x41')]('nolimit')){_0x605a81[_0x91e1('0x2b')]=qs[_0x91e1('0x2b')](_0x294016[_0x91e1('0x3c')]['limit']);_0x605a81[_0x91e1('0x29')]=qs['offset'](_0x294016[_0x91e1('0x3c')]['offset']);}_0x605a81['order']=qs[_0x91e1('0x42')](_0x294016[_0x91e1('0x3c')][_0x91e1('0x42')]);_0x605a81[_0x91e1('0x43')]=qs['filters'](_[_0x91e1('0x44')](_0x294016[_0x91e1('0x3c')],_0x4eaa5c[_0x91e1('0x45')]),_0x2e3335);if(_0x294016['query']['filter']){_0x605a81[_0x91e1('0x43')]=_[_0x91e1('0x46')](_0x605a81[_0x91e1('0x43')],{'$or':_['map'](_0x2e3335,function(_0x523662){if(_0x523662[_0x91e1('0x38')]!==_0x91e1('0x47')){var _0x3ff621={};_0x3ff621[_0x523662[_0x91e1('0x33')]]={'$like':'%'+_0x294016['query']['filter']+'%'};return _0x3ff621;}})});}_0x605a81=_[_0x91e1('0x46')]({},_0x605a81,_0x294016[_0x91e1('0x48')]);var _0x55eba5={'where':_0x605a81['where']};return db[_0x91e1('0x35')][_0x91e1('0x2c')](_0x55eba5)[_0x91e1('0x1a')](function(_0xcd2870){_0x5bfa14[_0x91e1('0x2c')]=_0xcd2870;if(_0x294016['query']['includeAll']){_0x605a81[_0x91e1('0x49')]=[{'all':!![]}];}return db[_0x91e1('0x35')][_0x91e1('0x4a')](_0x605a81);})[_0x91e1('0x1a')](function(_0x1a928b){_0x5bfa14[_0x91e1('0x4b')]=_0x1a928b;return _0x5bfa14;})[_0x91e1('0x1a')](respondWithFilteredResult(_0x1905e0,_0x605a81))['catch'](handleError(_0x1905e0,null));};exports[_0x91e1('0x4c')]=function(_0x287665,_0x1e252e){var _0x117d9f={'raw':![],'where':{'id':_0x287665[_0x91e1('0x4d')]['id']}},_0x481598={};_0x481598['model']=_[_0x91e1('0x3b')](db['Setting'][_0x91e1('0x36')]);_0x481598[_0x91e1('0x3c')]=_[_0x91e1('0x3b')](_0x287665[_0x91e1('0x3c')]);_0x481598[_0x91e1('0x45')]=_[_0x91e1('0x3d')](_0x481598[_0x91e1('0x3a')],_0x481598[_0x91e1('0x3c')]);_0x117d9f[_0x91e1('0x3f')]=_[_0x91e1('0x3d')](_0x481598[_0x91e1('0x3a')],qs['fields'](_0x287665[_0x91e1('0x3c')]['fields']));_0x117d9f['attributes']=_0x117d9f[_0x91e1('0x3f')][_0x91e1('0x40')]?_0x117d9f[_0x91e1('0x3f')]:_0x481598[_0x91e1('0x3a')];if(_0x287665['query'][_0x91e1('0x4e')]){_0x117d9f[_0x91e1('0x49')]=[{'all':!![]}];}_0x117d9f=_['merge']({},_0x117d9f,_0x287665[_0x91e1('0x48')]);return db[_0x91e1('0x35')][_0x91e1('0x4f')](_0x117d9f)[_0x91e1('0x1a')](handleEntityNotFound(_0x1e252e,null))[_0x91e1('0x1a')](respondWithResult(_0x1e252e,null))[_0x91e1('0x24')](handleError(_0x1e252e,null));};exports['update']=function(_0x60527d,_0x2e9417){if(_0x60527d['body']['id']){delete _0x60527d[_0x91e1('0x50')]['id'];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x60527d[_0x91e1('0x4d')]['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x2e9417,null))['then'](saveUpdates(_0x60527d[_0x91e1('0x50')],null))['then'](respondWithResult(_0x2e9417,null))[_0x91e1('0x24')](handleError(_0x2e9417,null));};exports['addLogo']=function(_0xf578bb,_0x2eb5fe,_0x394571){if(_0xf578bb[_0x91e1('0x51')]&&_0xf578bb['file'][_0x91e1('0x52')]){_0xf578bb['body'][_0x91e1('0x53')]=_0xf578bb[_0x91e1('0x51')][_0x91e1('0x52')];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0xf578bb[_0x91e1('0x4d')]['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x2eb5fe,null))['then'](saveUpdates(_0xf578bb[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x2eb5fe,null))[_0x91e1('0x24')](handleError(_0x2eb5fe,null));};exports[_0x91e1('0x54')]=function(_0x465909,_0x107cc6,_0x50acbb){if(_0x465909[_0x91e1('0x51')]&&_0x465909[_0x91e1('0x51')][_0x91e1('0x52')]){_0x465909[_0x91e1('0x50')]['loginLogo']=_0x465909[_0x91e1('0x51')]['filename'];}return db[_0x91e1('0x35')]['find']({'where':{'id':_0x465909['params']['id']}})['then'](handleEntityNotFound(_0x107cc6,null))[_0x91e1('0x1a')](saveUpdates(_0x465909[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x107cc6,null))[_0x91e1('0x24')](handleError(_0x107cc6,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x56')]=function(_0xdead19,_0x212203,_0x59e001){var _0x5b5352='server/files/images/logos';var _0x573bb2={'custom':![]};return utilLicense['getLicense']()[_0x91e1('0x1a')](function(_0xfc923f){if(_0xfc923f){_0x573bb2=_0xfc923f;}return db['Setting'][_0x91e1('0x4f')]({'where':{'id':_0xdead19[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),'loginLogo',_0x91e1('0x57'),_0x91e1('0x58'),_0x91e1('0x59'),'defaultLoginLogo','defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x212203,null))['then'](function(_0x2c088c){if(_0x2c088c){var _0x4c93cb=_0x2c088c['logo']&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config['root'],_0x5b5352,_[_0x91e1('0x5d')](_0x2c088c['logo'])))?path['join'](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')](_0x2c088c[_0x91e1('0x53')])):path['join'](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')]('default_logo.svg'));var _0xe7ba4f='default'+_[_0x91e1('0x5f')](_0x91e1('0x53'));if(_0x2c088c[_0xe7ba4f]||!_0x573bb2[_0x91e1('0x60')]){_0x4c93cb=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x5b5352,_[_0x91e1('0x5d')](_0x91e1('0x61')));}if(!fs[_0x91e1('0x5b')](_0x4c93cb)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_['upperFirst'](_0x91e1('0x53'))+_0x91e1('0x64'));}return _0x212203[_0x91e1('0x65')](_0x4c93cb);}})['catch'](handleError(_0x212203,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x66')]=function(_0x3f0444,_0x15cfea,_0x21b04b){var _0x4d1299=_0x91e1('0x67');var _0x598882={'custom':![]};return utilLicense[_0x91e1('0x68')]()[_0x91e1('0x1a')](function(_0x3e0fc7){if(_0x3e0fc7){_0x598882=_0x3e0fc7;}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x3f0444['params']['id']},'attributes':[_0x91e1('0x53'),_0x91e1('0x69'),'preferred',_0x91e1('0x58'),'defaultLogo','defaultLoginLogo',_0x91e1('0x6a'),_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x15cfea,null))[_0x91e1('0x1a')](function(_0x4aadb5){if(_0x4aadb5){var _0x590890=_0x4aadb5['loginLogo']&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_[_0x91e1('0x5d')](_0x4aadb5[_0x91e1('0x69')])))?path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_['toLower'](_0x4aadb5[_0x91e1('0x69')])):path[_0x91e1('0x5c')](config['root'],_0x4d1299,_['toLower'](_0x91e1('0x6b')));var _0x475a89=_0x91e1('0x6c')+_[_0x91e1('0x5f')](_0x91e1('0x69'));if(_0x4aadb5[_0x475a89]||!_0x598882[_0x91e1('0x60')]){_0x590890=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x4d1299,_[_0x91e1('0x5d')](_0x91e1('0x6b')));}if(!fs[_0x91e1('0x5b')](_0x590890)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x69'))+_0x91e1('0x64'));}return _0x15cfea[_0x91e1('0x65')](_0x590890);}})[_0x91e1('0x24')](handleError(_0x15cfea,null));};exports[_0x91e1('0x6d')]=function(_0x1c0080,_0x4802f9){return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x1c0080[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x6e')]})['then'](respondWithResult(_0x4802f9,null))['catch'](handleError(_0x4802f9,null));};exports[_0x91e1('0x6f')]=function(_0x5b29bc,_0x1dcb76,_0x118e4b){if(_0x5b29bc[_0x91e1('0x51')]&&_0x5b29bc[_0x91e1('0x51')][_0x91e1('0x52')]){_0x5b29bc['body'][_0x91e1('0x57')]=_0x5b29bc['file']['filename'];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x5b29bc[_0x91e1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1dcb76,null))['then'](saveUpdates(_0x5b29bc['body'],null))[_0x91e1('0x1a')](respondWithResult(_0x1dcb76,null))[_0x91e1('0x24')](handleError(_0x1dcb76,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x70')]=function(_0x1317f1,_0x55956a,_0xb1189e){var _0x5a9dc6=_0x91e1('0x67');var _0x17cb45={'custom':![]};return utilLicense[_0x91e1('0x68')]()['then'](function(_0xf84b46){if(_0xf84b46){_0x17cb45=_0xf84b46;}return db[_0x91e1('0x35')]['find']({'where':{'id':_0x1317f1[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),'loginLogo',_0x91e1('0x57'),_0x91e1('0x58'),_0x91e1('0x59'),_0x91e1('0x71'),'defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x55956a,null))['then'](function(_0x330a9c){if(_0x330a9c){var _0x38203c=_0x330a9c[_0x91e1('0x57')]&&fs[_0x91e1('0x5b')](path['join'](config['root'],_0x5a9dc6,_[_0x91e1('0x5d')](_0x330a9c[_0x91e1('0x57')])))?path['join'](config[_0x91e1('0x5e')],_0x5a9dc6,_['toLower'](_0x330a9c[_0x91e1('0x57')])):path[_0x91e1('0x5c')](config['root'],_0x5a9dc6,_['toLower'](_0x91e1('0x72')));var _0x53e133=_0x91e1('0x6c')+_[_0x91e1('0x5f')](_0x91e1('0x57'));if(_0x330a9c[_0x53e133]||!_0x17cb45[_0x91e1('0x60')]||!_0x17cb45['preferred']){_0x38203c=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x5a9dc6,_[_0x91e1('0x5d')]('default_preferred.png'));}if(!fs['existsSync'](_0x38203c)){throw new db[(_0x91e1('0x62'))][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x57'))+_0x91e1('0x64'));}return _0x55956a[_0x91e1('0x65')](_0x38203c);}})[_0x91e1('0x24')](handleError(_0x55956a,null));};exports[_0x91e1('0x73')]=function(_0x513711,_0x26afbd,_0x1d69ab){if(_0x513711[_0x91e1('0x51')]&&_0x513711[_0x91e1('0x51')][_0x91e1('0x52')]){_0x513711[_0x91e1('0x50')][_0x91e1('0x58')]=_0x513711[_0x91e1('0x51')][_0x91e1('0x52')];}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x513711['params']['id']}})[_0x91e1('0x1a')](handleEntityNotFound(_0x26afbd,null))[_0x91e1('0x1a')](saveUpdates(_0x513711[_0x91e1('0x50')],null))[_0x91e1('0x1a')](respondWithResult(_0x26afbd,null))[_0x91e1('0x24')](handleError(_0x26afbd,null));};var utilLicense=require(_0x91e1('0x55'));exports[_0x91e1('0x74')]=function(_0x4d15b7,_0x8c6f86,_0x23852a){var _0x1ef985='server/files/images/logos';var _0x256a3b={'custom':![]};return utilLicense['getLicense']()[_0x91e1('0x1a')](function(_0x37578b){if(_0x37578b){_0x256a3b=_0x37578b;}return db[_0x91e1('0x35')][_0x91e1('0x4f')]({'where':{'id':_0x4d15b7[_0x91e1('0x4d')]['id']},'attributes':[_0x91e1('0x53'),_0x91e1('0x69'),_0x91e1('0x57'),'favicon',_0x91e1('0x59'),_0x91e1('0x71'),'defaultPreferred',_0x91e1('0x5a')],'raw':!![]});})[_0x91e1('0x1a')](handleEntityNotFound(_0x8c6f86,null))[_0x91e1('0x1a')](function(_0x130e4a){if(_0x130e4a){var _0x37d0c2=_0x130e4a[_0x91e1('0x58')]&&fs[_0x91e1('0x5b')](path[_0x91e1('0x5c')](config['root'],_0x1ef985,_[_0x91e1('0x5d')](_0x130e4a['favicon'])))?path['join'](config[_0x91e1('0x5e')],_0x1ef985,_['toLower'](_0x130e4a[_0x91e1('0x58')])):path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x1ef985,_[_0x91e1('0x5d')](_0x91e1('0x75')));var _0x18118e='default'+_[_0x91e1('0x5f')](_0x91e1('0x58'));if(_0x130e4a[_0x18118e]||!_0x256a3b[_0x91e1('0x60')]){_0x37d0c2=path[_0x91e1('0x5c')](config[_0x91e1('0x5e')],_0x1ef985,_['toLower'](_0x91e1('0x75')));}if(!fs[_0x91e1('0x5b')](_0x37d0c2)){throw new db['Sequelize'][(_0x91e1('0x63'))](_[_0x91e1('0x5f')](_0x91e1('0x58'))+_0x91e1('0x64'));}return _0x8c6f86[_0x91e1('0x65')](_0x37d0c2);}})['catch'](handleError(_0x8c6f86,null));};exports[_0x91e1('0x76')]=function(_0x2d5d4e,_0x13cf54){var _0xb4cdc4={'offset':moment()[_0x91e1('0x77')]()};_0xb4cdc4[_0x91e1('0x78')]=moment()[_0x91e1('0x77')](_0xb4cdc4[_0x91e1('0x29')])[_0x91e1('0x79')](_0x91e1('0x7a'));return _0x13cf54[_0x91e1('0x26')](0xc8)[_0x91e1('0x7b')](_0xb4cdc4);}; \ No newline at end of file +var _0xf352=['keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','Setting','includeAll','include','rows','catch','show','find','body','params','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','download','getLogoLogin','preferred','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','name','send','map','rawAttributes','fieldName','type','model'];(function(_0x15442a,_0x3e90d7){var _0x1f1c08=function(_0x4b6604){while(--_0x4b6604){_0x15442a['push'](_0x15442a['shift']());}};_0x1f1c08(++_0x3e90d7);}(_0xf352,0x1ac));var _0x2f35=function(_0x49ab88,_0xcdfc80){_0x49ab88=_0x49ab88-0x0;var _0x5509bc=_0xf352[_0x49ab88];return _0x5509bc;};'use strict';var emlformat=require(_0x2f35('0x0'));var rimraf=require(_0x2f35('0x1'));var zipdir=require(_0x2f35('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2f35('0x3'));var BPromise=require(_0x2f35('0x4'));var Mustache=require(_0x2f35('0x5'));var util=require(_0x2f35('0x6'));var path=require(_0x2f35('0x7'));var sox=require(_0x2f35('0x8'));var csv=require(_0x2f35('0x9'));var ejs=require(_0x2f35('0xa'));var fs=require('fs');var fs_extra=require(_0x2f35('0xb'));var _=require(_0x2f35('0xc'));var squel=require(_0x2f35('0xd'));var crypto=require(_0x2f35('0xe'));var jsforce=require(_0x2f35('0xf'));var deskjs=require(_0x2f35('0x10'));var toCsv=require(_0x2f35('0x9'));var querystring=require(_0x2f35('0x11'));var Papa=require('papaparse');var Redis=require(_0x2f35('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2f35('0x13'));var as=require(_0x2f35('0x14'));var hardwareService=require(_0x2f35('0x15'));var logger=require(_0x2f35('0x16'))('api');var utils=require(_0x2f35('0x17'));var config=require(_0x2f35('0x18'));var licenseUtil=require(_0x2f35('0x19'));var db=require(_0x2f35('0x1a'))['db'];var jayson=require(_0x2f35('0x1b'));var client=jayson[_0x2f35('0x1c')][_0x2f35('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x9744c1,_0x3a154,_0x3ad5db,_0x11a433){return new BPromise(function(_0x100f13,_0x3f7bcb){var _0x3282ce=_0x11a433||client;return _0x3282ce[_0x2f35('0x1e')](_0x9744c1,_0x3ad5db)[_0x2f35('0x1f')](function(_0x55f85c){logger[_0x2f35('0x20')](_0x2f35('0x21'),_0x3a154,_0x2f35('0x22'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x3a154,_0x2f35('0x22'),JSON[_0x2f35('0x23')](_0x55f85c));if(_0x55f85c[_0x2f35('0x24')]){if(_0x55f85c[_0x2f35('0x24')]['code']===0x1f4){logger[_0x2f35('0x24')]('Setting,\x20%s,\x20%s',_0x3a154,_0x55f85c[_0x2f35('0x24')][_0x2f35('0x25')]);return _0x3f7bcb(_0x55f85c[_0x2f35('0x24')][_0x2f35('0x25')]);}logger[_0x2f35('0x24')](_0x2f35('0x21'),_0x3a154,_0x55f85c[_0x2f35('0x24')][_0x2f35('0x25')]);return _0x100f13(_0x55f85c['error'][_0x2f35('0x25')]);}else{logger[_0x2f35('0x20')](_0x2f35('0x21'),_0x3a154,_0x2f35('0x22'));_0x100f13(_0x55f85c[_0x2f35('0x26')][_0x2f35('0x25')]);}})['catch'](function(_0x55cbf8){logger[_0x2f35('0x24')](_0x2f35('0x21'),_0x3a154,_0x55cbf8);_0x3f7bcb(_0x55cbf8);});});}function respondWithStatusCode(_0x4e603a,_0x49347c){_0x49347c=_0x49347c||0xcc;return function(_0x49bd2b){if(_0x49bd2b){return _0x4e603a[_0x2f35('0x27')](_0x49347c);}return _0x4e603a['status'](_0x49347c)[_0x2f35('0x28')]();};}function respondWithResult(_0x4fb387,_0x292f05){_0x292f05=_0x292f05||0xc8;return function(_0x4d5987){if(_0x4d5987){return _0x4fb387[_0x2f35('0x29')](_0x292f05)[_0x2f35('0x2a')](_0x4d5987);}};}function respondWithFilteredResult(_0xdc5bdf,_0x44a693){return function(_0x3198f8){if(_0x3198f8){var _0x29cee2=typeof _0x44a693[_0x2f35('0x2b')]===_0x2f35('0x2c')&&typeof _0x44a693[_0x2f35('0x2d')]===_0x2f35('0x2c');var _0x47ca75=_0x3198f8[_0x2f35('0x2e')];var _0x2d765c=_0x29cee2?0x0:_0x44a693[_0x2f35('0x2b')];var _0x71001b=_0x29cee2?_0x3198f8[_0x2f35('0x2e')]:_0x44a693[_0x2f35('0x2b')]+_0x44a693['limit'];var _0x120f30;if(_0x71001b>=_0x47ca75){_0x71001b=_0x47ca75;_0x120f30=0xc8;}else{_0x120f30=0xce;}_0xdc5bdf[_0x2f35('0x29')](_0x120f30);return _0xdc5bdf[_0x2f35('0x2f')](_0x2f35('0x30'),_0x2d765c+'-'+_0x71001b+'/'+_0x47ca75)[_0x2f35('0x2a')](_0x3198f8);}return null;};}function patchUpdates(_0x1a1bf4){return function(_0x21531b){try{jsonpatch[_0x2f35('0x31')](_0x21531b,_0x1a1bf4,!![]);}catch(_0x142013){return BPromise[_0x2f35('0x32')](_0x142013);}return _0x21531b[_0x2f35('0x33')]();};}function saveUpdates(_0x5d2bd5,_0x12bd5e){return function(_0x481628){if(_0x481628){return _0x481628[_0x2f35('0x34')](_0x5d2bd5)['then'](function(_0x51256e){return _0x51256e;});}return null;};}function removeEntity(_0x1f0b94,_0x2bbb53){return function(_0x1550a7){if(_0x1550a7){return _0x1550a7['destroy']()[_0x2f35('0x1f')](function(){_0x1f0b94[_0x2f35('0x29')](0xcc)[_0x2f35('0x28')]();});}};}function handleEntityNotFound(_0x2a912d,_0x57c471){return function(_0x14e9aa){if(!_0x14e9aa){_0x2a912d[_0x2f35('0x27')](0x194);}return _0x14e9aa;};}function handleError(_0x4d4989,_0x6a87c5){_0x6a87c5=_0x6a87c5||0x1f4;return function(_0x58a1ff){logger[_0x2f35('0x24')](_0x58a1ff['stack']);if(_0x58a1ff[_0x2f35('0x35')]){delete _0x58a1ff['name'];}_0x4d4989[_0x2f35('0x29')](_0x6a87c5)[_0x2f35('0x36')](_0x58a1ff);};}exports['index']=function(_0xa5a3a3,_0x1d48ba){var _0x1910aa={},_0x2333d5={},_0x3a022a={'count':0x0,'rows':[]};var _0x9a3dae=_[_0x2f35('0x37')](db['Setting'][_0x2f35('0x38')],function(_0x318b6f){return{'name':_0x318b6f[_0x2f35('0x39')],'type':_0x318b6f[_0x2f35('0x3a')]['key']};});_0x2333d5[_0x2f35('0x3b')]=_[_0x2f35('0x37')](_0x9a3dae,_0x2f35('0x35'));_0x2333d5['query']=_[_0x2f35('0x3c')](_0xa5a3a3[_0x2f35('0x3d')]);_0x2333d5[_0x2f35('0x3e')]=_[_0x2f35('0x3f')](_0x2333d5[_0x2f35('0x3b')],_0x2333d5['query']);_0x1910aa[_0x2f35('0x40')]=_[_0x2f35('0x3f')](_0x2333d5[_0x2f35('0x3b')],qs[_0x2f35('0x41')](_0xa5a3a3[_0x2f35('0x3d')][_0x2f35('0x41')]));_0x1910aa[_0x2f35('0x40')]=_0x1910aa[_0x2f35('0x40')][_0x2f35('0x42')]?_0x1910aa[_0x2f35('0x40')]:_0x2333d5[_0x2f35('0x3b')];if(!_0xa5a3a3[_0x2f35('0x3d')]['hasOwnProperty']('nolimit')){_0x1910aa['limit']=qs[_0x2f35('0x2d')](_0xa5a3a3[_0x2f35('0x3d')][_0x2f35('0x2d')]);_0x1910aa[_0x2f35('0x2b')]=qs[_0x2f35('0x2b')](_0xa5a3a3[_0x2f35('0x3d')][_0x2f35('0x2b')]);}_0x1910aa[_0x2f35('0x43')]=qs[_0x2f35('0x44')](_0xa5a3a3[_0x2f35('0x3d')][_0x2f35('0x44')]);_0x1910aa[_0x2f35('0x45')]=qs[_0x2f35('0x3e')](_[_0x2f35('0x46')](_0xa5a3a3[_0x2f35('0x3d')],_0x2333d5[_0x2f35('0x3e')]),_0x9a3dae);if(_0xa5a3a3[_0x2f35('0x3d')][_0x2f35('0x47')]){_0x1910aa[_0x2f35('0x45')]=_['merge'](_0x1910aa[_0x2f35('0x45')],{'$or':_[_0x2f35('0x37')](_0x9a3dae,function(_0x3209fe){if(_0x3209fe[_0x2f35('0x3a')]!==_0x2f35('0x48')){var _0x297efc={};_0x297efc[_0x3209fe[_0x2f35('0x35')]]={'$like':'%'+_0xa5a3a3[_0x2f35('0x3d')]['filter']+'%'};return _0x297efc;}})});}_0x1910aa=_[_0x2f35('0x49')]({},_0x1910aa,_0xa5a3a3['options']);var _0x4fe554={'where':_0x1910aa[_0x2f35('0x45')]};return db[_0x2f35('0x4a')][_0x2f35('0x2e')](_0x4fe554)[_0x2f35('0x1f')](function(_0x37bd6a){_0x3a022a[_0x2f35('0x2e')]=_0x37bd6a;if(_0xa5a3a3[_0x2f35('0x3d')][_0x2f35('0x4b')]){_0x1910aa[_0x2f35('0x4c')]=[{'all':!![]}];}return db[_0x2f35('0x4a')]['findAll'](_0x1910aa);})[_0x2f35('0x1f')](function(_0x1d047e){_0x3a022a[_0x2f35('0x4d')]=_0x1d047e;return _0x3a022a;})[_0x2f35('0x1f')](respondWithFilteredResult(_0x1d48ba,_0x1910aa))[_0x2f35('0x4e')](handleError(_0x1d48ba,null));};exports[_0x2f35('0x4f')]=function(_0x5b22de,_0x37d9f6){var _0x1f5140={'raw':![],'where':{'id':_0x5b22de['params']['id']}},_0x2c5327={};_0x2c5327[_0x2f35('0x3b')]=_[_0x2f35('0x3c')](db[_0x2f35('0x4a')][_0x2f35('0x38')]);_0x2c5327['query']=_['keys'](_0x5b22de[_0x2f35('0x3d')]);_0x2c5327[_0x2f35('0x3e')]=_['intersection'](_0x2c5327[_0x2f35('0x3b')],_0x2c5327[_0x2f35('0x3d')]);_0x1f5140[_0x2f35('0x40')]=_[_0x2f35('0x3f')](_0x2c5327[_0x2f35('0x3b')],qs[_0x2f35('0x41')](_0x5b22de['query'][_0x2f35('0x41')]));_0x1f5140[_0x2f35('0x40')]=_0x1f5140[_0x2f35('0x40')]['length']?_0x1f5140['attributes']:_0x2c5327['model'];if(_0x5b22de[_0x2f35('0x3d')][_0x2f35('0x4b')]){_0x1f5140[_0x2f35('0x4c')]=[{'all':!![]}];}_0x1f5140=_[_0x2f35('0x49')]({},_0x1f5140,_0x5b22de['options']);return db[_0x2f35('0x4a')][_0x2f35('0x50')](_0x1f5140)['then'](handleEntityNotFound(_0x37d9f6,null))[_0x2f35('0x1f')](respondWithResult(_0x37d9f6,null))[_0x2f35('0x4e')](handleError(_0x37d9f6,null));};exports['update']=function(_0xe727b,_0x1c38e2){if(_0xe727b[_0x2f35('0x51')]['id']){delete _0xe727b['body']['id'];}return db[_0x2f35('0x4a')]['find']({'where':{'id':_0xe727b[_0x2f35('0x52')]['id']}})['then'](handleEntityNotFound(_0x1c38e2,null))[_0x2f35('0x1f')](saveUpdates(_0xe727b[_0x2f35('0x51')],null))['then'](respondWithResult(_0x1c38e2,null))[_0x2f35('0x4e')](handleError(_0x1c38e2,null));};exports['addLogo']=function(_0x34741f,_0x34c383,_0x2728a1){if(_0x34741f['file']&&_0x34741f[_0x2f35('0x53')][_0x2f35('0x54')]){_0x34741f[_0x2f35('0x51')]['logo']=_0x34741f['file'][_0x2f35('0x54')];}return db[_0x2f35('0x4a')]['find']({'where':{'id':_0x34741f[_0x2f35('0x52')]['id']}})['then'](handleEntityNotFound(_0x34c383,null))[_0x2f35('0x1f')](saveUpdates(_0x34741f[_0x2f35('0x51')],null))[_0x2f35('0x1f')](respondWithResult(_0x34c383,null))[_0x2f35('0x4e')](handleError(_0x34c383,null));};exports[_0x2f35('0x55')]=function(_0x38a079,_0x33a3d3,_0x49480c){if(_0x38a079['file']&&_0x38a079[_0x2f35('0x53')][_0x2f35('0x54')]){_0x38a079[_0x2f35('0x51')][_0x2f35('0x56')]=_0x38a079['file']['filename'];}return db[_0x2f35('0x4a')][_0x2f35('0x50')]({'where':{'id':_0x38a079['params']['id']}})[_0x2f35('0x1f')](handleEntityNotFound(_0x33a3d3,null))[_0x2f35('0x1f')](saveUpdates(_0x38a079[_0x2f35('0x51')],null))[_0x2f35('0x1f')](respondWithResult(_0x33a3d3,null))['catch'](handleError(_0x33a3d3,null));};var utilLicense=require('../../config/license/util');exports[_0x2f35('0x57')]=function(_0x28a3e3,_0x137635,_0x3bbdf7){var _0x5ce73d=_0x2f35('0x58');var _0x41e69e={'custom':![]};return utilLicense[_0x2f35('0x59')]()[_0x2f35('0x1f')](function(_0x333f74){if(_0x333f74){_0x41e69e=_0x333f74;}return db[_0x2f35('0x4a')][_0x2f35('0x50')]({'where':{'id':_0x28a3e3[_0x2f35('0x52')]['id']},'attributes':[_0x2f35('0x5a'),_0x2f35('0x56'),'preferred',_0x2f35('0x5b'),_0x2f35('0x5c'),_0x2f35('0x5d'),_0x2f35('0x5e'),_0x2f35('0x5f')],'raw':!![]});})[_0x2f35('0x1f')](handleEntityNotFound(_0x137635,null))[_0x2f35('0x1f')](function(_0x3abeaa){if(_0x3abeaa){var _0x1ec987=_0x3abeaa[_0x2f35('0x5a')]&&fs[_0x2f35('0x60')](path[_0x2f35('0x61')](config['root'],_0x5ce73d,_[_0x2f35('0x62')](_0x3abeaa[_0x2f35('0x5a')])))?path[_0x2f35('0x61')](config[_0x2f35('0x63')],_0x5ce73d,_[_0x2f35('0x62')](_0x3abeaa['logo'])):path[_0x2f35('0x61')](config[_0x2f35('0x63')],_0x5ce73d,_[_0x2f35('0x62')](_0x2f35('0x64')));var _0x49ae87=_0x2f35('0x65')+_[_0x2f35('0x66')](_0x2f35('0x5a'));if(_0x3abeaa[_0x49ae87]||!_0x41e69e[_0x2f35('0x67')]){_0x1ec987=path['join'](config[_0x2f35('0x63')],_0x5ce73d,_['toLower']('default_logo.svg'));}if(!fs[_0x2f35('0x60')](_0x1ec987)){throw new db[(_0x2f35('0x68'))]['ValidationError'](_[_0x2f35('0x66')](_0x2f35('0x5a'))+'\x20not\x20found');}return _0x137635[_0x2f35('0x69')](_0x1ec987);}})[_0x2f35('0x4e')](handleError(_0x137635,null));};var utilLicense=require(_0x2f35('0x19'));exports[_0x2f35('0x6a')]=function(_0x57c4f5,_0x50ca4f,_0x51e594){var _0x4877df=_0x2f35('0x58');var _0x434371={'custom':![]};return utilLicense[_0x2f35('0x59')]()[_0x2f35('0x1f')](function(_0x2a8b52){if(_0x2a8b52){_0x434371=_0x2a8b52;}return db[_0x2f35('0x4a')][_0x2f35('0x50')]({'where':{'id':_0x57c4f5[_0x2f35('0x52')]['id']},'attributes':['logo',_0x2f35('0x56'),_0x2f35('0x6b'),_0x2f35('0x5b'),_0x2f35('0x5c'),'defaultLoginLogo',_0x2f35('0x5e'),_0x2f35('0x5f')],'raw':!![]});})[_0x2f35('0x1f')](handleEntityNotFound(_0x50ca4f,null))[_0x2f35('0x1f')](function(_0x1269f9){if(_0x1269f9){var _0x500a63=_0x1269f9[_0x2f35('0x56')]&&fs[_0x2f35('0x60')](path[_0x2f35('0x61')](config[_0x2f35('0x63')],_0x4877df,_[_0x2f35('0x62')](_0x1269f9[_0x2f35('0x56')])))?path[_0x2f35('0x61')](config['root'],_0x4877df,_['toLower'](_0x1269f9[_0x2f35('0x56')])):path[_0x2f35('0x61')](config['root'],_0x4877df,_['toLower'](_0x2f35('0x6c')));var _0x43c651=_0x2f35('0x65')+_['upperFirst'](_0x2f35('0x56'));if(_0x1269f9[_0x43c651]||!_0x434371['custom']){_0x500a63=path[_0x2f35('0x61')](config['root'],_0x4877df,_[_0x2f35('0x62')](_0x2f35('0x6c')));}if(!fs['existsSync'](_0x500a63)){throw new db[(_0x2f35('0x68'))][(_0x2f35('0x6d'))](_['upperFirst']('loginLogo')+_0x2f35('0x6e'));}return _0x50ca4f[_0x2f35('0x69')](_0x500a63);}})[_0x2f35('0x4e')](handleError(_0x50ca4f,null));};exports[_0x2f35('0x6f')]=function(_0x187787,_0x264ed4){return db[_0x2f35('0x4a')]['find']({'where':{'id':_0x187787['params']['id']},'attributes':[_0x2f35('0x70')]})[_0x2f35('0x1f')](respondWithResult(_0x264ed4,null))[_0x2f35('0x4e')](handleError(_0x264ed4,null));};exports[_0x2f35('0x71')]=function(_0x3a3663,_0x3d0515,_0x37c48e){if(_0x3a3663[_0x2f35('0x53')]&&_0x3a3663[_0x2f35('0x53')]['filename']){_0x3a3663[_0x2f35('0x51')][_0x2f35('0x6b')]=_0x3a3663[_0x2f35('0x53')]['filename'];}return db[_0x2f35('0x4a')]['find']({'where':{'id':_0x3a3663['params']['id']}})[_0x2f35('0x1f')](handleEntityNotFound(_0x3d0515,null))['then'](saveUpdates(_0x3a3663[_0x2f35('0x51')],null))[_0x2f35('0x1f')](respondWithResult(_0x3d0515,null))[_0x2f35('0x4e')](handleError(_0x3d0515,null));};var utilLicense=require(_0x2f35('0x19'));exports['getPreferred']=function(_0x4eccf0,_0x56ac24,_0x2a9811){var _0x11afb0=_0x2f35('0x58');var _0x426e02={'custom':![]};return utilLicense[_0x2f35('0x59')]()['then'](function(_0x60c2d4){if(_0x60c2d4){_0x426e02=_0x60c2d4;}return db[_0x2f35('0x4a')][_0x2f35('0x50')]({'where':{'id':_0x4eccf0[_0x2f35('0x52')]['id']},'attributes':[_0x2f35('0x5a'),_0x2f35('0x56'),'preferred','favicon',_0x2f35('0x5c'),_0x2f35('0x5d'),'defaultPreferred',_0x2f35('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x56ac24,null))['then'](function(_0x23e174){if(_0x23e174){var _0x1ac12c=_0x23e174[_0x2f35('0x6b')]&&fs[_0x2f35('0x60')](path['join'](config[_0x2f35('0x63')],_0x11afb0,_[_0x2f35('0x62')](_0x23e174[_0x2f35('0x6b')])))?path[_0x2f35('0x61')](config[_0x2f35('0x63')],_0x11afb0,_[_0x2f35('0x62')](_0x23e174['preferred'])):path[_0x2f35('0x61')](config[_0x2f35('0x63')],_0x11afb0,_[_0x2f35('0x62')](_0x2f35('0x72')));var _0x4e2b1f='default'+_['upperFirst'](_0x2f35('0x6b'));if(_0x23e174[_0x4e2b1f]||!_0x426e02[_0x2f35('0x67')]||!_0x426e02[_0x2f35('0x6b')]){_0x1ac12c=path[_0x2f35('0x61')](config['root'],_0x11afb0,_[_0x2f35('0x62')](_0x2f35('0x72')));}if(!fs['existsSync'](_0x1ac12c)){throw new db[(_0x2f35('0x68'))][(_0x2f35('0x6d'))](_['upperFirst'](_0x2f35('0x6b'))+_0x2f35('0x6e'));}return _0x56ac24[_0x2f35('0x69')](_0x1ac12c);}})[_0x2f35('0x4e')](handleError(_0x56ac24,null));};exports[_0x2f35('0x73')]=function(_0x329c6c,_0x15bae3,_0x571186){if(_0x329c6c[_0x2f35('0x53')]&&_0x329c6c[_0x2f35('0x53')][_0x2f35('0x54')]){_0x329c6c[_0x2f35('0x51')][_0x2f35('0x5b')]=_0x329c6c['file'][_0x2f35('0x54')];}return db[_0x2f35('0x4a')][_0x2f35('0x50')]({'where':{'id':_0x329c6c[_0x2f35('0x52')]['id']}})[_0x2f35('0x1f')](handleEntityNotFound(_0x15bae3,null))[_0x2f35('0x1f')](saveUpdates(_0x329c6c[_0x2f35('0x51')],null))['then'](respondWithResult(_0x15bae3,null))[_0x2f35('0x4e')](handleError(_0x15bae3,null));};var utilLicense=require(_0x2f35('0x19'));exports[_0x2f35('0x74')]=function(_0x1b8bea,_0x4860cb,_0x20de71){var _0x592501=_0x2f35('0x58');var _0x8639a1={'custom':![]};return utilLicense[_0x2f35('0x59')]()['then'](function(_0x53d488){if(_0x53d488){_0x8639a1=_0x53d488;}return db[_0x2f35('0x4a')]['find']({'where':{'id':_0x1b8bea[_0x2f35('0x52')]['id']},'attributes':[_0x2f35('0x5a'),_0x2f35('0x56'),_0x2f35('0x6b'),_0x2f35('0x5b'),_0x2f35('0x5c'),'defaultLoginLogo','defaultPreferred',_0x2f35('0x5f')],'raw':!![]});})[_0x2f35('0x1f')](handleEntityNotFound(_0x4860cb,null))[_0x2f35('0x1f')](function(_0x587361){if(_0x587361){var _0x4dc6a8=_0x587361[_0x2f35('0x5b')]&&fs[_0x2f35('0x60')](path[_0x2f35('0x61')](config[_0x2f35('0x63')],_0x592501,_[_0x2f35('0x62')](_0x587361['favicon'])))?path['join'](config['root'],_0x592501,_['toLower'](_0x587361[_0x2f35('0x5b')])):path['join'](config['root'],_0x592501,_['toLower'](_0x2f35('0x75')));var _0x39a1d8=_0x2f35('0x65')+_['upperFirst'](_0x2f35('0x5b'));if(_0x587361[_0x39a1d8]||!_0x8639a1[_0x2f35('0x67')]){_0x4dc6a8=path[_0x2f35('0x61')](config[_0x2f35('0x63')],_0x592501,_[_0x2f35('0x62')]('default_favicon.ico'));}if(!fs[_0x2f35('0x60')](_0x4dc6a8)){throw new db[(_0x2f35('0x68'))]['ValidationError'](_[_0x2f35('0x66')](_0x2f35('0x5b'))+_0x2f35('0x6e'));}return _0x4860cb[_0x2f35('0x69')](_0x4dc6a8);}})[_0x2f35('0x4e')](handleError(_0x4860cb,null));};exports[_0x2f35('0x76')]=function(_0x5b41ab,_0x493d05){var _0x4baa40={'offset':moment()[_0x2f35('0x77')]()};_0x4baa40['now']=moment()[_0x2f35('0x77')](_0x4baa40[_0x2f35('0x2b')])[_0x2f35('0x78')](_0x2f35('0x79'));return _0x493d05[_0x2f35('0x29')](0xc8)[_0x2f35('0x36')](_0x4baa40);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 4eff18d..40b14ad 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0xfa4f19,_0x3a12b3){var _0x2bca7e=function(_0x2ecda7){while(--_0x2ecda7){_0xfa4f19['push'](_0xfa4f19['shift']());}};_0x2bca7e(++_0x3a12b3);}(_0xe14b,0x93));var _0xbe14=function(_0x3c7e99,_0x177ea1){_0x3c7e99=_0x3c7e99-0x0;var _0x3654be=_0xe14b[_0x3c7e99];return _0x3654be;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x008c,0x188));var _0xc008=function(_0x411dc3,_0x47a8e4){_0x411dc3=_0x411dc3-0x0;var _0x5b870b=_0x008c[_0x411dc3];return _0x5b870b;};'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 b9e524a..60b7a02 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 _0x8f3d=['message','result','catch','ShowSetting','Setting','options','raw','where','attributes','include','map','model','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4836b2,_0x5cc750){var _0x2c466b=function(_0x331766){while(--_0x331766){_0x4836b2['push'](_0x4836b2['shift']());}};_0x2c466b(++_0x5cc750);}(_0x8f3d,0x80));var _0xd8f3=function(_0xb1a71c,_0x4205f1){_0xb1a71c=_0xb1a71c-0x0;var _0x55d4c2=_0x8f3d[_0xb1a71c];return _0x55d4c2;};'use strict';var _=require(_0xd8f3('0x0'));var util=require(_0xd8f3('0x1'));var moment=require(_0xd8f3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8f3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd8f3('0x4'))(_0xd8f3('0x5'));var config=require(_0xd8f3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd8f3('0x7')][_0xd8f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59042b,_0x2f2ee0,_0x55c2dd){return new BPromise(function(_0x2e9b63,_0x4d85cb){return client['request'](_0x59042b,_0x55c2dd)[_0xd8f3('0x9')](function(_0x292e92){logger[_0xd8f3('0xa')](_0xd8f3('0xb'),_0x2f2ee0,_0xd8f3('0xc'));logger[_0xd8f3('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x2f2ee0,_0xd8f3('0xc'),JSON[_0xd8f3('0xe')](_0x292e92));if(_0x292e92['error']){if(_0x292e92[_0xd8f3('0xf')][_0xd8f3('0x10')]===0x1f4){logger[_0xd8f3('0xf')](_0xd8f3('0xb'),_0x2f2ee0,_0x292e92[_0xd8f3('0xf')]['message']);return _0x4d85cb(_0x292e92['error'][_0xd8f3('0x11')]);}logger[_0xd8f3('0xf')](_0xd8f3('0xb'),_0x2f2ee0,_0x292e92[_0xd8f3('0xf')][_0xd8f3('0x11')]);return _0x2e9b63(_0x292e92['error'][_0xd8f3('0x11')]);}else{logger[_0xd8f3('0xa')](_0xd8f3('0xb'),_0x2f2ee0,'request\x20sent');_0x2e9b63(_0x292e92[_0xd8f3('0x12')][_0xd8f3('0x11')]);}})[_0xd8f3('0x13')](function(_0x5344b2){logger[_0xd8f3('0xf')](_0xd8f3('0xb'),_0x2f2ee0,_0x5344b2);_0x4d85cb(_0x5344b2);});});}exports[_0xd8f3('0x14')]=function(_0x3db01f){var _0x2add92=this;return new Promise(function(_0x50b830,_0x5abc8e){return db[_0xd8f3('0x15')]['find']({'raw':_0x3db01f['options']?_0x3db01f[_0xd8f3('0x16')][_0xd8f3('0x17')]===undefined?!![]:![]:!![],'where':_0x3db01f[_0xd8f3('0x16')]?_0x3db01f[_0xd8f3('0x16')][_0xd8f3('0x18')]||null:null,'attributes':_0x3db01f[_0xd8f3('0x16')]?_0x3db01f[_0xd8f3('0x16')][_0xd8f3('0x19')]||null:null,'include':_0x3db01f[_0xd8f3('0x16')]?_0x3db01f[_0xd8f3('0x16')][_0xd8f3('0x1a')]?_[_0xd8f3('0x1b')](_0x3db01f[_0xd8f3('0x16')][_0xd8f3('0x1a')],function(_0x485b94){return{'model':db[_0x485b94[_0xd8f3('0x1c')]],'as':_0x485b94['as'],'attributes':_0x485b94[_0xd8f3('0x19')],'include':_0x485b94['include']?_[_0xd8f3('0x1b')](_0x485b94['include'],function(_0xeb2d00){return{'model':db[_0xeb2d00[_0xd8f3('0x1c')]],'as':_0xeb2d00['as'],'attributes':_0xeb2d00['attributes'],'include':_0xeb2d00[_0xd8f3('0x1a')]?_[_0xd8f3('0x1b')](_0xeb2d00[_0xd8f3('0x1a')],function(_0x5703b7){return{'model':db[_0x5703b7['model']],'as':_0x5703b7['as'],'attributes':_0x5703b7[_0xd8f3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd8f3('0x9')](function(_0x26e022){logger[_0xd8f3('0xa')](_0xd8f3('0x14'),_0x3db01f);logger[_0xd8f3('0xd')](_0xd8f3('0x14'),_0x3db01f,JSON[_0xd8f3('0xe')](_0x26e022));_0x50b830(_0x26e022);})[_0xd8f3('0x13')](function(_0x40c14c){logger[_0xd8f3('0xf')](_0xd8f3('0x14'),_0x40c14c['message'],_0x3db01f);_0x5abc8e(_0x2add92['error'](0x1f4,_0x40c14c['message']));});});}; \ No newline at end of file +var _0x041f=['Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','Setting','find','options','raw','where','attributes','include','model','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug'];(function(_0x5c26dd,_0x3920e2){var _0x448e82=function(_0x482f0c){while(--_0x482f0c){_0x5c26dd['push'](_0x5c26dd['shift']());}};_0x448e82(++_0x3920e2);}(_0x041f,0x1e0));var _0xf041=function(_0x3c98f1,_0x4d71d3){_0x3c98f1=_0x3c98f1-0x0;var _0x542bf5=_0x041f[_0x3c98f1];return _0x542bf5;};'use strict';var _=require(_0xf041('0x0'));var util=require(_0xf041('0x1'));var moment=require(_0xf041('0x2'));var BPromise=require('bluebird');var rs=require(_0xf041('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf041('0x4'))(_0xf041('0x5'));var config=require(_0xf041('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf041('0x7')][_0xf041('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b0154,_0x2d6e2b,_0x418502){return new BPromise(function(_0x5f5cc8,_0x4187b1){return client['request'](_0x4b0154,_0x418502)[_0xf041('0x9')](function(_0x4960ed){logger[_0xf041('0xa')]('Setting,\x20%s,\x20%s',_0x2d6e2b,_0xf041('0xb'));logger[_0xf041('0xc')](_0xf041('0xd'),_0x2d6e2b,_0xf041('0xb'),JSON[_0xf041('0xe')](_0x4960ed));if(_0x4960ed[_0xf041('0xf')]){if(_0x4960ed[_0xf041('0xf')][_0xf041('0x10')]===0x1f4){logger[_0xf041('0xf')](_0xf041('0x11'),_0x2d6e2b,_0x4960ed[_0xf041('0xf')][_0xf041('0x12')]);return _0x4187b1(_0x4960ed['error'][_0xf041('0x12')]);}logger[_0xf041('0xf')](_0xf041('0x11'),_0x2d6e2b,_0x4960ed[_0xf041('0xf')][_0xf041('0x12')]);return _0x5f5cc8(_0x4960ed[_0xf041('0xf')][_0xf041('0x12')]);}else{logger[_0xf041('0xa')](_0xf041('0x11'),_0x2d6e2b,_0xf041('0xb'));_0x5f5cc8(_0x4960ed[_0xf041('0x13')]['message']);}})['catch'](function(_0x442730){logger[_0xf041('0xf')](_0xf041('0x11'),_0x2d6e2b,_0x442730);_0x4187b1(_0x442730);});});}exports[_0xf041('0x14')]=function(_0xf673d7){var _0x50ac04=this;return new Promise(function(_0x1af594,_0x193c91){return db[_0xf041('0x15')][_0xf041('0x16')]({'raw':_0xf673d7[_0xf041('0x17')]?_0xf673d7[_0xf041('0x17')][_0xf041('0x18')]===undefined?!![]:![]:!![],'where':_0xf673d7[_0xf041('0x17')]?_0xf673d7['options'][_0xf041('0x19')]||null:null,'attributes':_0xf673d7[_0xf041('0x17')]?_0xf673d7[_0xf041('0x17')][_0xf041('0x1a')]||null:null,'include':_0xf673d7[_0xf041('0x17')]?_0xf673d7[_0xf041('0x17')][_0xf041('0x1b')]?_['map'](_0xf673d7[_0xf041('0x17')][_0xf041('0x1b')],function(_0x37809e){return{'model':db[_0x37809e[_0xf041('0x1c')]],'as':_0x37809e['as'],'attributes':_0x37809e[_0xf041('0x1a')],'include':_0x37809e[_0xf041('0x1b')]?_['map'](_0x37809e[_0xf041('0x1b')],function(_0x31c514){return{'model':db[_0x31c514[_0xf041('0x1c')]],'as':_0x31c514['as'],'attributes':_0x31c514[_0xf041('0x1a')],'include':_0x31c514[_0xf041('0x1b')]?_['map'](_0x31c514[_0xf041('0x1b')],function(_0x2e5026){return{'model':db[_0x2e5026['model']],'as':_0x2e5026['as'],'attributes':_0x2e5026[_0xf041('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf041('0x9')](function(_0x3c64c){logger[_0xf041('0xa')](_0xf041('0x14'),_0xf673d7);logger[_0xf041('0xc')]('ShowSetting',_0xf673d7,JSON[_0xf041('0xe')](_0x3c64c));_0x1af594(_0x3c64c);})['catch'](function(_0x3a915b){logger[_0xf041('0xf')]('ShowSetting',_0x3a915b[_0xf041('0x12')],_0xf673d7);_0x193c91(_0x50ac04['error'](0x1f4,_0x3a915b[_0xf041('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9dd0c84..961f2cf 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 _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x2e1d3d,_0x719bf0){var _0x3d81df=function(_0x3ddfa3){while(--_0x3ddfa3){_0x2e1d3d['push'](_0x2e1d3d['shift']());}};_0x3d81df(++_0x719bf0);}(_0x326f,0xd1));var _0xf326=function(_0x49d2fb,_0x2aa289){_0x49d2fb=_0x49d2fb-0x0;var _0x178ff4=_0x326f[_0x49d2fb];return _0x178ff4;};'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',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file +var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x1f94ac,_0x1b880c){var _0x5b0e9d=function(_0x22a14e){while(--_0x22a14e){_0x1f94ac['push'](_0x1f94ac['shift']());}};_0x5b0e9d(++_0x1b880c);}(_0x6aa7,0x178));var _0x76aa=function(_0x575536,_0x9ec086){_0x575536=_0x575536-0x0;var _0x5d762c=_0x6aa7[_0x575536];return _0x5d762c;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ad98e37..7bc887c 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 _0xd160=['plivo','clickatell','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','generate','ENUM','twilio','skebby','clicksend'];(function(_0x37547d,_0xe26ed5){var _0x815fd7=function(_0x2671f5){while(--_0x2671f5){_0x37547d['push'](_0x37547d['shift']());}};_0x815fd7(++_0xe26ed5);}(_0xd160,0x173));var _0x0d16=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xd160[_0x277721];return _0x286051;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x0d16('0x0')],'unique':_0x0d16('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x0d16('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0x0d16('0x0')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0d16('0x2')]();}},'phone':{'type':Sequelize[_0x0d16('0x0')]},'type':{'type':Sequelize[_0x0d16('0x3')](_0x0d16('0x4'),_0x0d16('0x5'),'connectel',_0x0d16('0x6'),_0x0d16('0x7'),_0x0d16('0x8'),_0x0d16('0x9'),_0x0d16('0xa'),_0x0d16('0xb'),_0x0d16('0xc'))},'accountSid':{'type':Sequelize[_0x0d16('0x0')]},'authId':{'type':Sequelize[_0x0d16('0x0')]},'authToken':{'type':Sequelize[_0x0d16('0x0')]},'smsMethod':{'type':Sequelize[_0x0d16('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0d16('0x0')]},'password':{'type':Sequelize[_0x0d16('0x0')]},'apiKey':{'type':Sequelize[_0x0d16('0x0')]},'applicationId':{'type':Sequelize[_0x0d16('0x0')]},'accountId':{'type':Sequelize[_0x0d16('0x0')]},'senderString':{'type':Sequelize[_0x0d16('0x0')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0d16('0x0')]},'notificationTemplate':{'type':Sequelize[_0x0d16('0xd')],'defaultValue':function(){return _0x0d16('0xe');}},'notificationSound':{'type':Sequelize[_0x0d16('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0d16('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0d16('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0d16('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0d16('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0d16('0x0')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0d16('0x10')],'comment':_0x0d16('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3b6aff){if(!_0x3b6aff)this[_0x0d16('0x12')](_0x0d16('0x13'),null);this[_0x0d16('0x12')](_0x0d16('0x14'),_0x3b6aff);}}}; \ No newline at end of file +var _0x0bfd=['connectel','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','twilio'];(function(_0x5d29c0,_0x1a25bb){var _0x40c899=function(_0x2fb6b0){while(--_0x2fb6b0){_0x5d29c0['push'](_0x5d29c0['shift']());}};_0x40c899(++_0x1a25bb);}(_0x0bfd,0x1a5));var _0xd0bf=function(_0x2b69b3,_0x8f67e4){_0x2b69b3=_0x2b69b3-0x0;var _0x628801=_0x0bfd[_0x2b69b3];return _0x628801;};'use strict';var Sequelize=require(_0xd0bf('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xd0bf('0x1')],'unique':_0xd0bf('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd0bf('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xd0bf('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xd0bf('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd0bf('0x1')]},'type':{'type':Sequelize['ENUM'](_0xd0bf('0x3'),'skebby',_0xd0bf('0x4'),'clicksend','plivo',_0xd0bf('0x5'),_0xd0bf('0x6'),_0xd0bf('0x7'),_0xd0bf('0x8'),_0xd0bf('0x9'))},'accountSid':{'type':Sequelize[_0xd0bf('0x1')]},'authId':{'type':Sequelize[_0xd0bf('0x1')]},'authToken':{'type':Sequelize[_0xd0bf('0x1')]},'smsMethod':{'type':Sequelize[_0xd0bf('0xa')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd0bf('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xd0bf('0x1')]},'applicationId':{'type':Sequelize[_0xd0bf('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xd0bf('0x1')]},'deliveryReport':{'type':Sequelize[_0xd0bf('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd0bf('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0bf('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0bf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd0bf('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd0bf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd0bf('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd0bf('0xc')],'comment':_0xd0bf('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xd0bf('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x355e66){if(!_0x355e66)this[_0xd0bf('0xe')](_0xd0bf('0xf'),null);this[_0xd0bf('0xe')](_0xd0bf('0x10'),_0x355e66);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ca5a4b7..cd675f9 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 _0xf90d=['fs-extra','lodash','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','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','get','UserProfileResource','stack','name','map','SmsAccount','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','Pause','mandatoryDispositionPause','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','describe','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','results','csc','originatingAddress','segmentedMessage','fromNumber','intelepeer','refid','Sequelize','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','\x0a','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','SmsAccountId','priority','finally','getApplications','getInteractions','Contact','fullname','Tag','Tags','color','tag','send','to\x20is\x20mandatory','List','CmContact','out','Messages','dataValues','debug','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','clickatell','bandwidth','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','received\x20delivery\x20report\x20from','state','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','ejs'];(function(_0x11f3cd,_0x760e17){var _0x236985=function(_0x520290){while(--_0x520290){_0x11f3cd['push'](_0x11f3cd['shift']());}};_0x236985(++_0x760e17);}(_0xf90d,0xd9));var _0xdf90=function(_0x10ea65,_0x30df53){_0x10ea65=_0x10ea65-0x0;var _0x15f59d=_0xf90d[_0x10ea65];return _0x15f59d;};'use strict';var emlformat=require(_0xdf90('0x0'));var rimraf=require(_0xdf90('0x1'));var zipdir=require(_0xdf90('0x2'));var jsonpatch=require(_0xdf90('0x3'));var rp=require(_0xdf90('0x4'));var moment=require(_0xdf90('0x5'));var BPromise=require(_0xdf90('0x6'));var Mustache=require('mustache');var util=require(_0xdf90('0x7'));var path=require(_0xdf90('0x8'));var sox=require(_0xdf90('0x9'));var csv=require(_0xdf90('0xa'));var ejs=require(_0xdf90('0xb'));var fs=require('fs');var fs_extra=require(_0xdf90('0xc'));var _=require(_0xdf90('0xd'));var squel=require('squel');var crypto=require(_0xdf90('0xe'));var jsforce=require(_0xdf90('0xf'));var deskjs=require(_0xdf90('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf90('0x11'));var Redis=require(_0xdf90('0x12'));var authService=require(_0xdf90('0x13'));var qs=require(_0xdf90('0x14'));var as=require(_0xdf90('0x15'));var hardwareService=require(_0xdf90('0x16'));var logger=require(_0xdf90('0x17'))(_0xdf90('0x18'));var utils=require(_0xdf90('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xdf90('0x1a'));var db=require(_0xdf90('0x1b'))['db'];config[_0xdf90('0x1c')]=_[_0xdf90('0x1d')](config[_0xdf90('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf90('0x1e'))(new Redis(config['redis']));require(_0xdf90('0x1f'))[_0xdf90('0x20')](socket);var jayson=require(_0xdf90('0x21'));var client=jayson[_0xdf90('0x22')][_0xdf90('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x199a29,_0x104635,_0x2866a6,_0x1f708c){return new BPromise(function(_0x3d8fdc,_0x51b282){var _0x52bc5c=_0x1f708c||client;return _0x52bc5c[_0xdf90('0x24')](_0x199a29,_0x2866a6)['then'](function(_0x1338a7){logger[_0xdf90('0x25')]('SmsAccount,\x20%s,\x20%s',_0x104635,_0xdf90('0x26'));logger['debug'](_0xdf90('0x27'),_0x104635,_0xdf90('0x26'),JSON[_0xdf90('0x28')](_0x1338a7));if(_0x1338a7[_0xdf90('0x29')]){if(_0x1338a7[_0xdf90('0x29')][_0xdf90('0x2a')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x104635,_0x1338a7['error'][_0xdf90('0x2b')]);return _0x51b282(_0x1338a7['error']['message']);}logger[_0xdf90('0x29')](_0xdf90('0x2c'),_0x104635,_0x1338a7['error']['message']);return _0x3d8fdc(_0x1338a7[_0xdf90('0x29')][_0xdf90('0x2b')]);}else{logger[_0xdf90('0x25')](_0xdf90('0x2c'),_0x104635,_0xdf90('0x26'));_0x3d8fdc(_0x1338a7[_0xdf90('0x2d')][_0xdf90('0x2b')]);}})['catch'](function(_0x3b7a14){logger[_0xdf90('0x29')](_0xdf90('0x2c'),_0x104635,_0x3b7a14);_0x51b282(_0x3b7a14);});});}function respondWithStatusCode(_0x50760b,_0x2f4dbb){_0x2f4dbb=_0x2f4dbb||0xcc;return function(_0x3739d2){if(_0x3739d2){return _0x50760b[_0xdf90('0x2e')](_0x2f4dbb);}return _0x50760b[_0xdf90('0x2f')](_0x2f4dbb)[_0xdf90('0x30')]();};}function respondWithResult(_0x168ca0,_0xafe240){_0xafe240=_0xafe240||0xc8;return function(_0x2a1c6b){if(_0x2a1c6b){return _0x168ca0[_0xdf90('0x2f')](_0xafe240)['json'](_0x2a1c6b);}};}function respondWithFilteredResult(_0x3a479c,_0x205751){return function(_0x575b76){if(_0x575b76){var _0x3963d9=typeof _0x205751[_0xdf90('0x31')]===_0xdf90('0x32')&&typeof _0x205751[_0xdf90('0x33')]===_0xdf90('0x32');var _0x3fca80=_0x575b76['count'];var _0x375344=_0x3963d9?0x0:_0x205751[_0xdf90('0x31')];var _0x1aae5e=_0x3963d9?_0x575b76[_0xdf90('0x34')]:_0x205751[_0xdf90('0x31')]+_0x205751[_0xdf90('0x33')];var _0x127d33;if(_0x1aae5e>=_0x3fca80){_0x1aae5e=_0x3fca80;_0x127d33=0xc8;}else{_0x127d33=0xce;}_0x3a479c[_0xdf90('0x2f')](_0x127d33);return _0x3a479c[_0xdf90('0x35')](_0xdf90('0x36'),_0x375344+'-'+_0x1aae5e+'/'+_0x3fca80)[_0xdf90('0x37')](_0x575b76);}return null;};}function patchUpdates(_0x3d9c7d){return function(_0x2f51a7){try{jsonpatch['apply'](_0x2f51a7,_0x3d9c7d,!![]);}catch(_0x3645ab){return BPromise[_0xdf90('0x38')](_0x3645ab);}return _0x2f51a7['save']();};}function saveUpdates(_0x2d3ee2,_0x8be242){return function(_0x1cbeeb){if(_0x1cbeeb){return _0x1cbeeb[_0xdf90('0x39')](_0x2d3ee2)[_0xdf90('0x3a')](function(_0x4ac086){return _0x4ac086;});}return null;};}function removeEntity(_0x4f6732,_0x4208c0){return function(_0x5c2274){if(_0x5c2274){return _0x5c2274[_0xdf90('0x3b')]()['then'](function(){var _0x27e573=_0x5c2274[_0xdf90('0x3c')]({'plain':!![]});var _0x2b0652='SmsAccounts';return db[_0xdf90('0x3d')]['destroy']({'where':{'type':_0x2b0652,'resourceId':_0x27e573['id']}})[_0xdf90('0x3a')](function(){return _0x5c2274;});})[_0xdf90('0x3a')](function(){_0x4f6732[_0xdf90('0x2f')](0xcc)[_0xdf90('0x30')]();});}};}function handleEntityNotFound(_0x3951e0,_0xf26b8d){return function(_0x1358c2){if(!_0x1358c2){_0x3951e0[_0xdf90('0x2e')](0x194);}return _0x1358c2;};}function handleError(_0x11cc10,_0x2c7fa2){_0x2c7fa2=_0x2c7fa2||0x1f4;return function(_0x4ddcd3){logger['error'](_0x4ddcd3[_0xdf90('0x3e')]);if(_0x4ddcd3['name']){delete _0x4ddcd3[_0xdf90('0x3f')];}_0x11cc10[_0xdf90('0x2f')](_0x2c7fa2)['send'](_0x4ddcd3);};}exports['index']=function(_0x2fe28d,_0xec1f1a){var _0x1f5cdd={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2554c1={},_0x3c4671={'count':0x0,'rows':[]};var _0x19a929=_[_0xdf90('0x40')](db[_0xdf90('0x41')]['rawAttributes'],function(_0x4d0c55){return{'name':_0x4d0c55['fieldName'],'type':_0x4d0c55['type']['key']};});_0x2554c1[_0xdf90('0x42')]=_[_0xdf90('0x40')](_0x19a929,_0xdf90('0x3f'));_0x2554c1[_0xdf90('0x43')]=_['keys'](_0x2fe28d[_0xdf90('0x43')]);_0x2554c1[_0xdf90('0x44')]=_[_0xdf90('0x45')](_0x2554c1['model'],_0x2554c1[_0xdf90('0x43')]);_0x1f5cdd['attributes']=_[_0xdf90('0x45')](_0x2554c1['model'],qs[_0xdf90('0x46')](_0x2fe28d[_0xdf90('0x43')][_0xdf90('0x46')]));_0x1f5cdd[_0xdf90('0x47')]=_0x1f5cdd[_0xdf90('0x47')][_0xdf90('0x48')]?_0x1f5cdd[_0xdf90('0x47')]:_0x2554c1[_0xdf90('0x42')];if(!_0x2fe28d[_0xdf90('0x43')][_0xdf90('0x49')](_0xdf90('0x4a'))){_0x1f5cdd[_0xdf90('0x33')]=qs[_0xdf90('0x33')](_0x2fe28d[_0xdf90('0x43')][_0xdf90('0x33')]);_0x1f5cdd[_0xdf90('0x31')]=qs[_0xdf90('0x31')](_0x2fe28d[_0xdf90('0x43')]['offset']);}_0x1f5cdd[_0xdf90('0x4b')]=qs['sort'](_0x2fe28d[_0xdf90('0x43')][_0xdf90('0x4c')]);_0x1f5cdd[_0xdf90('0x4d')]=qs[_0xdf90('0x44')](_[_0xdf90('0x4e')](_0x2fe28d[_0xdf90('0x43')],_0x2554c1[_0xdf90('0x44')]),_0x19a929);if(_0x2fe28d[_0xdf90('0x43')][_0xdf90('0x4f')]){_0x1f5cdd['where']=_[_0xdf90('0x50')](_0x1f5cdd[_0xdf90('0x4d')],{'$or':_['map'](_0x19a929,function(_0x5d86c8){if(_0x5d86c8[_0xdf90('0x51')]!==_0xdf90('0x52')){var _0x1204b6={};_0x1204b6[_0x5d86c8[_0xdf90('0x3f')]]={'$like':'%'+_0x2fe28d[_0xdf90('0x43')]['filter']+'%'};return _0x1204b6;}})});}_0x1f5cdd=_[_0xdf90('0x50')]({},_0x1f5cdd,_0x2fe28d['options']);var _0x47d4bd={'where':_0x1f5cdd[_0xdf90('0x4d')]};return db[_0xdf90('0x41')][_0xdf90('0x34')](_0x47d4bd)[_0xdf90('0x3a')](function(_0x494bc1){_0x3c4671[_0xdf90('0x34')]=_0x494bc1;if(_0x2fe28d[_0xdf90('0x43')][_0xdf90('0x53')]){_0x1f5cdd[_0xdf90('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0xdf90('0x55')](_0x1f5cdd);})[_0xdf90('0x3a')](function(_0x4c6609){_0x3c4671[_0xdf90('0x56')]=_0x4c6609;return _0x3c4671;})[_0xdf90('0x3a')](respondWithFilteredResult(_0xec1f1a,_0x1f5cdd))[_0xdf90('0x57')](handleError(_0xec1f1a,null));};exports[_0xdf90('0x58')]=function(_0x5acd84,_0x272fd3){var _0x49e76f={'raw':![],'where':{'id':_0x5acd84[_0xdf90('0x59')]['id']},'include':[{'model':db[_0xdf90('0x5a')],'as':_0xdf90('0x5b')}]},_0x48f2c0={};_0x48f2c0[_0xdf90('0x42')]=_['keys'](db[_0xdf90('0x41')]['rawAttributes']);_0x48f2c0[_0xdf90('0x43')]=_[_0xdf90('0x5c')](_0x5acd84['query']);_0x48f2c0[_0xdf90('0x44')]=_[_0xdf90('0x45')](_0x48f2c0[_0xdf90('0x42')],_0x48f2c0[_0xdf90('0x43')]);_0x49e76f[_0xdf90('0x47')]=_[_0xdf90('0x45')](_0x48f2c0[_0xdf90('0x42')],qs['fields'](_0x5acd84['query'][_0xdf90('0x46')]));_0x49e76f['attributes']=_0x49e76f[_0xdf90('0x47')]['length']?_0x49e76f[_0xdf90('0x47')]:_0x48f2c0[_0xdf90('0x42')];if(_0x5acd84[_0xdf90('0x43')][_0xdf90('0x53')]){_0x49e76f[_0xdf90('0x54')]=[{'all':!![]}];}_0x49e76f=_[_0xdf90('0x50')]({},_0x49e76f,_0x5acd84[_0xdf90('0x5d')]);return db[_0xdf90('0x41')][_0xdf90('0x5e')](_0x49e76f)[_0xdf90('0x3a')](handleEntityNotFound(_0x272fd3,null))[_0xdf90('0x3a')](respondWithResult(_0x272fd3,null))['catch'](handleError(_0x272fd3,null));};exports[_0xdf90('0x5f')]=function(_0xde5a62,_0x19abff){return db[_0xdf90('0x41')][_0xdf90('0x5f')](_0xde5a62[_0xdf90('0x60')],{})[_0xdf90('0x3a')](function(_0x2400f6){var _0x42d6b1=_0xde5a62[_0xdf90('0x61')][_0xdf90('0x3c')]({'plain':!![]});if(!_0x42d6b1)throw new Error(_0xdf90('0x62'));if(_0x42d6b1[_0xdf90('0x63')]===_0xdf90('0x61')){var _0x42cbae=_0x2400f6[_0xdf90('0x3c')]({'plain':!![]});var _0xc5322b=_0xdf90('0x64');return db[_0xdf90('0x65')][_0xdf90('0x5e')]({'where':{'name':_0xc5322b,'userProfileId':_0x42d6b1[_0xdf90('0x66')]},'raw':!![]})[_0xdf90('0x3a')](function(_0x51bbf6){if(_0x51bbf6&&_0x51bbf6[_0xdf90('0x67')]===0x0){return db[_0xdf90('0x3d')][_0xdf90('0x5f')]({'name':_0x42cbae[_0xdf90('0x3f')],'resourceId':_0x42cbae['id'],'type':_0x51bbf6[_0xdf90('0x3f')],'sectionId':_0x51bbf6['id']},{})[_0xdf90('0x3a')](function(){return _0x2400f6;});}else{return _0x2400f6;}})['catch'](function(_0x2c7fb3){logger[_0xdf90('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7fb3);throw _0x2c7fb3;});}return _0x2400f6;})[_0xdf90('0x3a')](respondWithResult(_0x19abff,0xc9))['catch'](handleError(_0x19abff,null));};exports[_0xdf90('0x39')]=function(_0x3f1979,_0x125160){if(_0x3f1979[_0xdf90('0x60')]['id']){delete _0x3f1979[_0xdf90('0x60')]['id'];}return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x3f1979[_0xdf90('0x59')]['id']},'include':[{'model':db[_0xdf90('0x5a')],'as':_0xdf90('0x5b')}]})[_0xdf90('0x3a')](handleEntityNotFound(_0x125160,null))[_0xdf90('0x3a')](saveUpdates(_0x3f1979[_0xdf90('0x60')],null))['then'](respondWithResult(_0x125160,null))['catch'](handleError(_0x125160,null));};exports[_0xdf90('0x3b')]=function(_0x257d38,_0x3d4faa){return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x257d38[_0xdf90('0x59')]['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x3d4faa,null))[_0xdf90('0x3a')](removeEntity(_0x3d4faa,null))[_0xdf90('0x57')](handleError(_0x3d4faa,null));};exports[_0xdf90('0x68')]=function(_0xa1cbcf,_0x158ea3){return db[_0xdf90('0x41')]['describe']()[_0xdf90('0x3a')](respondWithResult(_0x158ea3,null))['catch'](handleError(_0x158ea3,null));};exports['addDisposition']=function(_0x1186a4,_0x5d3cca,_0x4a49a3){if(_0x1186a4[_0xdf90('0x60')]['id']){delete _0x1186a4['body']['id'];}return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x1186a4[_0xdf90('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d3cca,null))['then'](function(_0x589070){if(_0x589070){_0x1186a4[_0xdf90('0x60')]['SmsAccountId']=_0x589070['id'];return db[_0xdf90('0x69')][_0xdf90('0x5f')](_0x1186a4[_0xdf90('0x60')]);}})['then'](respondWithResult(_0x5d3cca,null))[_0xdf90('0x57')](handleError(_0x5d3cca,null));};exports[_0xdf90('0x6a')]=function(_0x3aafad,_0x13fabe,_0x5a743b){var _0x1b3102={'raw':![],'where':{}};var _0x3232b5={};var _0x3a8195={'count':0x0,'rows':[]};return db[_0xdf90('0x41')][_0xdf90('0x6b')]({'where':{'id':_0x3aafad[_0xdf90('0x59')]['id']}})['then'](handleEntityNotFound(_0x13fabe,null))[_0xdf90('0x3a')](function(_0x46641b){if(_0x46641b){_0x3232b5[_0xdf90('0x42')]=_['keys'](db[_0xdf90('0x69')]['rawAttributes']);_0x3232b5[_0xdf90('0x43')]=_[_0xdf90('0x5c')](_0x3aafad[_0xdf90('0x43')]);_0x3232b5[_0xdf90('0x44')]=_[_0xdf90('0x45')](_0x3232b5[_0xdf90('0x42')],_0x3232b5[_0xdf90('0x43')]);_0x1b3102[_0xdf90('0x47')]=_[_0xdf90('0x45')](_0x3232b5[_0xdf90('0x42')],qs['fields'](_0x3aafad[_0xdf90('0x43')][_0xdf90('0x46')]));_0x1b3102[_0xdf90('0x47')]=_0x1b3102['attributes'][_0xdf90('0x48')]?_0x1b3102[_0xdf90('0x47')]:_0x3232b5['model'];if(!_0x3aafad[_0xdf90('0x43')][_0xdf90('0x49')]('nolimit')){_0x1b3102['limit']=qs[_0xdf90('0x33')](_0x3aafad[_0xdf90('0x43')][_0xdf90('0x33')]);_0x1b3102[_0xdf90('0x31')]=qs[_0xdf90('0x31')](_0x3aafad[_0xdf90('0x43')][_0xdf90('0x31')]);}_0x1b3102['order']=qs['sort'](_0x3aafad[_0xdf90('0x43')]['sort']);_0x1b3102[_0xdf90('0x4d')]=qs[_0xdf90('0x44')](_[_0xdf90('0x4e')](_0x3aafad[_0xdf90('0x43')],_0x3232b5['filters']));_0x1b3102[_0xdf90('0x4d')]['SmsAccountId']=_0x46641b['id'];if(_0x3aafad[_0xdf90('0x43')][_0xdf90('0x4f')]){_0x1b3102[_0xdf90('0x4d')]=_['merge'](_0x1b3102[_0xdf90('0x4d')],{'$or':_[_0xdf90('0x40')](_0x1b3102[_0xdf90('0x47')],function(_0x2fc13f){var _0x1c6b0d={};_0x1c6b0d[_0x2fc13f]={'$like':'%'+_0x3aafad[_0xdf90('0x43')]['filter']+'%'};return _0x1c6b0d;})});}_0x1b3102=_['merge']({},_0x1b3102,_0x3aafad[_0xdf90('0x5d')]);return db[_0xdf90('0x69')][_0xdf90('0x34')]({'where':_0x1b3102[_0xdf90('0x4d')]})['then'](function(_0x268344){_0x3a8195[_0xdf90('0x34')]=_0x268344;if(_0x3aafad[_0xdf90('0x43')][_0xdf90('0x53')]){_0x1b3102[_0xdf90('0x54')]=[{'all':!![]}];}return db[_0xdf90('0x69')][_0xdf90('0x55')](_0x1b3102);})[_0xdf90('0x3a')](function(_0x38e7c7){_0x3a8195['rows']=_0x38e7c7;return _0x3a8195;});}})['then'](respondWithFilteredResult(_0x13fabe,_0x1b3102))['catch'](handleError(_0x13fabe,null));};exports[_0xdf90('0x6c')]=function(_0x873ba1,_0x5519ea,_0x4ae021){return db[_0xdf90('0x41')]['find']({'where':{'id':_0x873ba1[_0xdf90('0x59')]['id']}})['then'](handleEntityNotFound(_0x5519ea,null))[_0xdf90('0x3a')](function(_0x415748){if(_0x415748){return _0x415748[_0xdf90('0x6c')](_0x873ba1['query'][_0xdf90('0x6d')]);}})[_0xdf90('0x3a')](respondWithStatusCode(_0x5519ea,null))[_0xdf90('0x57')](handleError(_0x5519ea,null));};exports[_0xdf90('0x6e')]=function(_0x217d51,_0x2c4549,_0x467378){if(_0x217d51[_0xdf90('0x60')]['id']){delete _0x217d51[_0xdf90('0x60')]['id'];}return db['SmsAccount'][_0xdf90('0x5e')]({'where':{'id':_0x217d51['params']['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x2c4549,null))[_0xdf90('0x3a')](function(_0x57f6f5){if(_0x57f6f5){_0x217d51['body']['SmsAccountId']=_0x57f6f5['id'];return db[_0xdf90('0x6f')]['create'](_0x217d51[_0xdf90('0x60')]);}})[_0xdf90('0x3a')](respondWithResult(_0x2c4549,null))[_0xdf90('0x57')](handleError(_0x2c4549,null));};exports[_0xdf90('0x70')]=function(_0x3fc083,_0x8abd7d,_0x2cac61){var _0xa51c53={'raw':![],'where':{}};var _0x4099f4={};var _0x5e1868={'count':0x0,'rows':[]};return db[_0xdf90('0x41')]['findOne']({'where':{'id':_0x3fc083[_0xdf90('0x59')]['id']}})['then'](handleEntityNotFound(_0x8abd7d,null))[_0xdf90('0x3a')](function(_0x922eb7){if(_0x922eb7){_0x4099f4[_0xdf90('0x42')]=_[_0xdf90('0x5c')](db[_0xdf90('0x6f')][_0xdf90('0x71')]);_0x4099f4['query']=_[_0xdf90('0x5c')](_0x3fc083[_0xdf90('0x43')]);_0x4099f4['filters']=_[_0xdf90('0x45')](_0x4099f4[_0xdf90('0x42')],_0x4099f4[_0xdf90('0x43')]);_0xa51c53[_0xdf90('0x47')]=_['intersection'](_0x4099f4['model'],qs[_0xdf90('0x46')](_0x3fc083[_0xdf90('0x43')][_0xdf90('0x46')]));_0xa51c53[_0xdf90('0x47')]=_0xa51c53[_0xdf90('0x47')][_0xdf90('0x48')]?_0xa51c53[_0xdf90('0x47')]:_0x4099f4[_0xdf90('0x42')];if(!_0x3fc083[_0xdf90('0x43')][_0xdf90('0x49')](_0xdf90('0x4a'))){_0xa51c53[_0xdf90('0x33')]=qs[_0xdf90('0x33')](_0x3fc083['query'][_0xdf90('0x33')]);_0xa51c53[_0xdf90('0x31')]=qs[_0xdf90('0x31')](_0x3fc083[_0xdf90('0x43')][_0xdf90('0x31')]);}_0xa51c53[_0xdf90('0x4b')]=qs[_0xdf90('0x4c')](_0x3fc083[_0xdf90('0x43')]['sort']);_0xa51c53['where']=qs[_0xdf90('0x44')](_['pick'](_0x3fc083[_0xdf90('0x43')],_0x4099f4[_0xdf90('0x44')]));_0xa51c53[_0xdf90('0x4d')]['SmsAccountId']=_0x922eb7['id'];if(_0x3fc083['query'][_0xdf90('0x4f')]){_0xa51c53['where']=_['merge'](_0xa51c53[_0xdf90('0x4d')],{'$or':_[_0xdf90('0x40')](_0xa51c53[_0xdf90('0x47')],function(_0x202dbd){var _0x5bd241={};_0x5bd241[_0x202dbd]={'$like':'%'+_0x3fc083[_0xdf90('0x43')][_0xdf90('0x4f')]+'%'};return _0x5bd241;})});}_0xa51c53=_['merge']({},_0xa51c53,_0x3fc083[_0xdf90('0x5d')]);return db[_0xdf90('0x6f')][_0xdf90('0x34')]({'where':_0xa51c53['where']})[_0xdf90('0x3a')](function(_0x57d4ea){_0x5e1868['count']=_0x57d4ea;if(_0x3fc083['query'][_0xdf90('0x53')]){_0xa51c53[_0xdf90('0x54')]=[{'all':!![]}];}return db[_0xdf90('0x6f')]['findAll'](_0xa51c53);})[_0xdf90('0x3a')](function(_0x4ce7aa){_0x5e1868[_0xdf90('0x56')]=_0x4ce7aa;return _0x5e1868;});}})[_0xdf90('0x3a')](respondWithFilteredResult(_0x8abd7d,_0xa51c53))[_0xdf90('0x57')](handleError(_0x8abd7d,null));};exports['removeAnswers']=function(_0xaa0f03,_0x161577,_0x1cacae){return db['SmsAccount']['find']({'where':{'id':_0xaa0f03[_0xdf90('0x59')]['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x161577,null))[_0xdf90('0x3a')](function(_0x28ba1d){if(_0x28ba1d){return _0x28ba1d[_0xdf90('0x72')](_0xaa0f03[_0xdf90('0x43')][_0xdf90('0x6d')]);}})[_0xdf90('0x3a')](respondWithStatusCode(_0x161577,null))[_0xdf90('0x57')](handleError(_0x161577,null));};exports[_0xdf90('0x73')]=function(_0x257d37,_0x39e19e,_0x502f4c){var _0xe7659b={'channel':_0xdf90('0x74')};var _0x36e3f8=[];var _0x1a3b21=[];var _0x375209={};return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x257d37[_0xdf90('0x59')]['id']},'include':[{'model':db[_0xdf90('0x75')],'as':_0xdf90('0x76')}]})['then'](handleEntityNotFound(_0x39e19e,null))[_0xdf90('0x3a')](function(_0x19fc82){_0xe7659b[_0xdf90('0x77')]=_0x19fc82;_0xe7659b[_0xdf90('0x78')]=_['orderBy'](_0x19fc82[_0xdf90('0x76')],['priority'],[_0xdf90('0x79')]);if(_0xe7659b[_0xdf90('0x77')][_0xdf90('0x76')]){delete _0xe7659b[_0xdf90('0x77')][_0xdf90('0x76')];}return db['CmContact'][_0xdf90('0x68')]();})[_0xdf90('0x3a')](function(_0x4215ef){if(!_0x4215ef){throw new db['Sequelize'][(_0xdf90('0x7a'))](_0xdf90('0x7b'));}_0x36e3f8=_[_0xdf90('0x7c')](_[_0xdf90('0x5c')](_0x4215ef),[_0xdf90('0x7d'),_0xdf90('0x7e')]);_0x1a3b21=_[_0xdf90('0x7c')](_['keys'](_0x4215ef),[_0xdf90('0x7d'),_0xdf90('0x7e'),'CompanyId','ListId']);_0xe7659b[_0xdf90('0x60')]={'mapKey':_0xdf90('0x7f')};if(_0xe7659b[_0xdf90('0x77')][_0xdf90('0x51')]){switch(_0xe7659b['account'][_0xdf90('0x51')]){case'twilio':_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')]=_0x257d37[_0xdf90('0x60')][_0xdf90('0x81')];_0xe7659b[_0xdf90('0x60')][_0xdf90('0x60')]=_0x257d37['body']['Body'];_0xe7659b[_0xdf90('0x60')][_0xdf90('0x82')]=_0x257d37['body'][_0xdf90('0x83')];break;case _0xdf90('0x84'):_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')]='+'+_0x257d37[_0xdf90('0x60')][_0xdf90('0x85')];_0xe7659b[_0xdf90('0x60')]['body']=_0x257d37[_0xdf90('0x60')][_0xdf90('0x86')];break;case _0xdf90('0x87'):_0xe7659b['body'][_0xdf90('0x80')]=_0x257d37['body']['from'];_0xe7659b['body'][_0xdf90('0x60')]=_0x257d37[_0xdf90('0x60')][_0xdf90('0x2b')];break;case _0xdf90('0x88'):_0xe7659b[_0xdf90('0x60')]['from']=_0x257d37[_0xdf90('0x60')][_0xdf90('0x80')];_0xe7659b['body']['body']=_0x257d37[_0xdf90('0x60')][_0xdf90('0x60')];_0xe7659b['body'][_0xdf90('0x82')]=_0x257d37[_0xdf90('0x60')][_0xdf90('0x89')];break;case _0xdf90('0x8a'):_0xe7659b['body']['from']=_0x257d37[_0xdf90('0x60')][_0xdf90('0x81')];_0xe7659b[_0xdf90('0x60')]['body']=_0x257d37['body'][_0xdf90('0x8b')];_0xe7659b[_0xdf90('0x60')][_0xdf90('0x82')]=_0x257d37['body']['MessageUUID'];break;case'infobip':_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')]='+'+_0x257d37[_0xdf90('0x60')][_0xdf90('0x8c')][0x0][_0xdf90('0x80')];_0xe7659b[_0xdf90('0x60')][_0xdf90('0x60')]=_0x257d37['body'][_0xdf90('0x8c')][0x0][_0xdf90('0x86')];_0xe7659b['body'][_0xdf90('0x82')]=_0x257d37[_0xdf90('0x60')][_0xdf90('0x8c')][0x0]['messageId'];break;case _0xdf90('0x8d'):_0xe7659b[_0xdf90('0x60')]['from']=_0x257d37[_0xdf90('0x60')][_0xdf90('0x8e')];_0xe7659b[_0xdf90('0x60')]['body']=_0x257d37['body'][_0xdf90('0x8f')][_0xdf90('0x2b')];break;case'clickatell':_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')]=_0x257d37['body'][_0xdf90('0x90')];_0xe7659b['body'][_0xdf90('0x60')]=_0x257d37['body'][_0xdf90('0x86')];_0xe7659b[_0xdf90('0x60')][_0xdf90('0x82')]=_0x257d37['body']['replyMessageId'];break;case'bandwidth':_0xe7659b[_0xdf90('0x60')][_0xdf90('0x82')]=_0x257d37[_0xdf90('0x60')][0x0]['message']['id'];_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')]=_0x257d37['body'][0x0][_0xdf90('0x2b')][_0xdf90('0x80')];_0xe7659b[_0xdf90('0x60')]['body']=_0x257d37['body'][0x0][_0xdf90('0x2b')]['text'];break;case _0xdf90('0x91'):_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')]=_0x257d37[_0xdf90('0x60')][_0xdf90('0x80')];_0xe7659b['body'][_0xdf90('0x60')]=_0x257d37[_0xdf90('0x60')][_0xdf90('0x2b')];_0xe7659b[_0xdf90('0x60')]['messageId']=_0x257d37['body'][_0xdf90('0x92')];break;}}if(_0xe7659b[_0xdf90('0x60')]['id']){delete _0xe7659b[_0xdf90('0x60')]['id'];}if(_['isNil'](_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')])){throw new db[(_0xdf90('0x93'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xdf90('0x94')](_0xe7659b[_0xdf90('0x60')]['body'])||_0xe7659b[_0xdf90('0x60')][_0xdf90('0x60')]===''){throw new db[(_0xdf90('0x93'))][(_0xdf90('0x7a'))](_0xdf90('0x95'));}if(_[_0xdf90('0x94')](_0xe7659b[_0xdf90('0x60')][_0xdf90('0x96')])){throw new db[(_0xdf90('0x93'))][(_0xdf90('0x7a'))](_0xdf90('0x97')+_0x1a3b21);}if(!_[_0xdf90('0x98')](_0x1a3b21,_0xe7659b[_0xdf90('0x60')][_0xdf90('0x96')])){throw new db[(_0xdf90('0x93'))][(_0xdf90('0x7a'))](_0xdf90('0x99')+_0x1a3b21);}_0x375209[_0xe7659b[_0xdf90('0x60')][_0xdf90('0x96')]]=_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')];return db[_0xdf90('0x9a')][_0xdf90('0x5e')]({'where':{'id':_0xe7659b[_0xdf90('0x77')]['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x375209,'limit':0x1,'order':[[_0xdf90('0x7e'),_0xdf90('0x9b')]]}]});})[_0xdf90('0x3a')](handleEntityNotFound(_0x39e19e,null))[_0xdf90('0x3a')](function(_0x2375e7){if(_0x2375e7){_0xe7659b[_0xdf90('0x9c')]=_[_0xdf90('0x9d')](_0x2375e7,['Contacts']);if(_0x2375e7['Contacts']['length']){return _0x2375e7[_0xdf90('0x9e')][0x0];}var _0x458ae1=_['defaults'](_0xe7659b[_0xdf90('0x60')],{'firstName':_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')],'ListId':_0x2375e7['id']});_0x458ae1[_0xe7659b[_0xdf90('0x60')][_0xdf90('0x96')]]=_0xe7659b[_0xdf90('0x60')][_0xdf90('0x80')];return db['CmContact'][_0xdf90('0x5f')](_0x458ae1,{'fields':_0x36e3f8,'raw':!![]});}})[_0xdf90('0x3a')](handleEntityNotFound(_0x39e19e,null))[_0xdf90('0x3a')](function(_0xf66149){if(_0xf66149){_0xe7659b[_0xdf90('0x9f')]=_0xf66149;var _0xa3007c={'ContactId':_0xf66149['id'],'phone':_0xe7659b[_0xdf90('0x60')]['from'],'SmsAccountId':_0x257d37['params']['id']};var _0x17116d={'ContactId':_0xf66149['id'],'SmsAccountId':_0x257d37[_0xdf90('0x59')]['id'],'closed':![]};return db[_0xdf90('0xa0')]['find']({'where':_0x17116d})[_0xdf90('0x3a')](function(_0x283272){if(_0x283272){return[_0x283272,![]];}return db[_0xdf90('0xa0')][_0xdf90('0x5f')](_0xa3007c)[_0xdf90('0x3a')](function(_0x5bb38d){return[_0x5bb38d,!![]];});});}})[_0xdf90('0xa1')](function(_0x6be454,_0x34034c){_0xe7659b[_0xdf90('0xa2')]=_0x6be454[_0xdf90('0x3c')]({'plain':!![]});_0xe7659b[_0xdf90('0xa2')][_0xdf90('0xa3')]=![];if(_0x34034c){if(_0xe7659b[_0xdf90('0x77')][_0xdf90('0xa4')]){_0xe7659b['applications'][_0xdf90('0xa5')]({'id':0x0,'priority':_0xe7659b[_0xdf90('0x78')][_0xdf90('0x48')]+0x1,'app':_0xdf90('0xa6'),'appdata':'unmanaged','interval':_0xdf90('0xa7')});}_0xe7659b['interaction'][_0xdf90('0xa3')]=!![];}return db[_0xdf90('0xa8')]['create']({'phone':_0xe7659b[_0xdf90('0x60')]['from'],'messageId':_0xe7659b[_0xdf90('0x60')][_0xdf90('0x82')],'body':_0xe7659b[_0xdf90('0x60')][_0xdf90('0x60')],'SmsAccountId':_0x257d37['params']['id'],'SmsInteractionId':_0x6be454['id'],'direction':'in','ContactId':_0x6be454['ContactId'],'AttachmentId':_0xe7659b[_0xdf90('0x60')]['AttachmentId']});})[_0xdf90('0x3a')](function(_0x10a9a2){_0xe7659b[_0xdf90('0x2b')]=_0x10a9a2;if(_0xe7659b['interaction'][_0xdf90('0xa9')]){return db[_0xdf90('0xaa')][_0xdf90('0x5e')]({'attributes':['id',_0xdf90('0x3f')],'where':{'id':_0xe7659b['interaction'][_0xdf90('0xa9')]}})[_0xdf90('0x3a')](function(_0x4d0704){if(_0x4d0704){_0xe7659b['applications'][_0xdf90('0xab')]({'id':0x0,'priority':0x0,'app':_0xdf90('0xac'),'appdata':_0x4d0704[_0xdf90('0x3f')]+','+(_0xe7659b['account']['waitForTheAssignedAgent']||0xa),'interval':_0xdf90('0xa7')});}return respondWithRpcPromise(_0xdf90('0xad'),_0xdf90('0xae'),_0xe7659b);});}return respondWithRpcPromise(_0xdf90('0xad'),_0xdf90('0xae'),_0xe7659b);})['then'](function(_0x289238){if(_0x289238){var _0x919ad4=0xc8;var _0xc6b209=_0xdf90('0xaf');logger[_0xdf90('0x25')](_0xdf90('0x27'),_0xc6b209,_0x919ad4,_0xdf90('0xb0'));logger['debug'](_0xdf90('0xb1'),_0xc6b209,_0x919ad4,'entity\x20found',JSON[_0xdf90('0x28')](_0x289238));if(_0xe7659b[_0xdf90('0x77')][_0xdf90('0x51')]===_0xdf90('0xb2')){return _0x39e19e[_0xdf90('0x2f')](_0x919ad4)[_0xdf90('0x35')](_0xdf90('0xb3'),'text/xml')['send'](_0xdf90('0xb4'));}else{return _0x39e19e[_0xdf90('0x2f')](_0x919ad4)[_0xdf90('0x37')](_0x289238);}}})['catch'](handleError(_0x39e19e,null));};exports[_0xdf90('0xb5')]=function(_0x1b9a02,_0x483f26){var _0x3937ef=_0x1b9a02[_0xdf90('0x59')]['id'];var _0x53c53f=_0x1b9a02[_0xdf90('0x60')];var _0x1419e2=0xc8;var _0x4b9c90=null;return db[_0xdf90('0xb6')]['transaction']({'isolationLevel':db[_0xdf90('0xb6')]['Transaction'][_0xdf90('0xb7')][_0xdf90('0xb8')]},function(_0x3cdb2d){return db[_0xdf90('0x41')]['findOne']({'where':{'id':_0x3937ef},'transaction':_0x3cdb2d})['then'](function(_0x3c89db){if(_0x3c89db){return db[_0xdf90('0x75')][_0xdf90('0x3b')]({'where':{'SmsAccountId':_0x3937ef},'transaction':_0x3cdb2d})[_0xdf90('0x3a')](function(){var _0x204bde=_[_0xdf90('0x40')](_0x53c53f,function(_0x4487b2){_0x4487b2[_0xdf90('0xb9')]=_0x3937ef;return _0x4487b2;});return db[_0xdf90('0x75')]['bulkCreate'](_0x204bde,{'transaction':_0x3cdb2d});});}else{_0x1419e2=0x194;_0x4b9c90=[];}});})['then'](function(){if(_0x1419e2!==0x194){return db[_0xdf90('0x75')]['findAndCountAll']({'where':{'SmsAccountId':_0x3937ef},'order':_0xdf90('0xba')})[_0xdf90('0x3a')](function(_0x249336){_0x4b9c90=_0x249336;});}})['catch'](function(_0x523660){_0x1419e2=0x1f4;logger[_0xdf90('0x29')](_0x523660[_0xdf90('0x3e')]);if(_0x523660[_0xdf90('0x3f')]){delete _0x523660[_0xdf90('0x3f')];}_0x4b9c90=_0x523660;})[_0xdf90('0xbb')](function(){if(_0x4b9c90===null){_0x483f26[_0xdf90('0x2e')](_0x1419e2);}else{if(_0x1419e2===0x1f4){_0x483f26[_0xdf90('0x2f')](_0x1419e2)['send'](_0x4b9c90);}else{_0x483f26[_0xdf90('0x2f')](_0x1419e2)['json'](_0x4b9c90);}}});};exports[_0xdf90('0xbc')]=function(_0x441144,_0x25f775,_0x5cd4cb){var _0x133119={};var _0x17ba00={};var _0x1cae3d;var _0x592fae;return db[_0xdf90('0x41')]['findOne']({'where':{'id':_0x441144[_0xdf90('0x59')]['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x25f775,null))[_0xdf90('0x3a')](function(_0x2084b9){if(_0x2084b9){_0x1cae3d=_0x2084b9;_0x17ba00['model']=_[_0xdf90('0x5c')](db[_0xdf90('0x75')][_0xdf90('0x71')]);_0x17ba00[_0xdf90('0x43')]=_[_0xdf90('0x5c')](_0x441144[_0xdf90('0x43')]);_0x17ba00[_0xdf90('0x44')]=_[_0xdf90('0x45')](_0x17ba00['model'],_0x17ba00['query']);_0x133119[_0xdf90('0x47')]=_[_0xdf90('0x45')](_0x17ba00[_0xdf90('0x42')],qs['fields'](_0x441144[_0xdf90('0x43')][_0xdf90('0x46')]));_0x133119[_0xdf90('0x47')]=_0x133119[_0xdf90('0x47')][_0xdf90('0x48')]?_0x133119[_0xdf90('0x47')]:_0x17ba00[_0xdf90('0x42')];_0x133119[_0xdf90('0x4b')]=qs[_0xdf90('0x4c')](_0x441144[_0xdf90('0x43')]['sort']);_0x133119['where']=qs[_0xdf90('0x44')](_['pick'](_0x441144['query'],_0x17ba00['filters']));if(_0x441144[_0xdf90('0x43')][_0xdf90('0x4f')]){_0x133119['where']=_[_0xdf90('0x50')](_0x133119[_0xdf90('0x4d')],{'$or':_[_0xdf90('0x40')](_0x133119[_0xdf90('0x47')],function(_0x45b7cb){var _0x102a9d={};_0x102a9d[_0x45b7cb]={'$like':'%'+_0x441144['query'][_0xdf90('0x4f')]+'%'};return _0x102a9d;})});}_0x133119=_[_0xdf90('0x50')]({},_0x133119,_0x441144[_0xdf90('0x5d')]);return _0x1cae3d['getApplications'](_0x133119);}})[_0xdf90('0x3a')](function(_0x44c69d){if(_0x44c69d){_0x592fae=_0x44c69d['length'];if(!_0x441144['query'][_0xdf90('0x49')](_0xdf90('0x4a'))){_0x133119[_0xdf90('0x33')]=qs[_0xdf90('0x33')](_0x441144[_0xdf90('0x43')]['limit']);_0x133119[_0xdf90('0x31')]=qs[_0xdf90('0x31')](_0x441144['query'][_0xdf90('0x31')]);}return _0x1cae3d['getApplications'](_0x133119);}})['then'](function(_0xa0f982){if(_0xa0f982){return _0xa0f982?{'count':_0x592fae,'rows':_0xa0f982}:null;}})[_0xdf90('0x3a')](respondWithResult(_0x25f775,null))[_0xdf90('0x57')](handleError(_0x25f775,null));};exports[_0xdf90('0xbd')]=function(_0x1f409f,_0x13fddf,_0x16b349){var _0x4da917={'raw':![],'where':{}};var _0x371d4d={};var _0x2677f5={'count':0x0,'rows':[]};return db['SmsAccount'][_0xdf90('0x6b')]({'where':{'id':_0x1f409f[_0xdf90('0x59')]['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x13fddf,null))[_0xdf90('0x3a')](function(_0x19bb15){if(_0x19bb15){_0x371d4d[_0xdf90('0x42')]=_[_0xdf90('0x5c')](db[_0xdf90('0xa0')][_0xdf90('0x71')]);_0x371d4d[_0xdf90('0x43')]=_[_0xdf90('0x5c')](_0x1f409f[_0xdf90('0x43')]);_0x371d4d['filters']=_['intersection'](_0x371d4d[_0xdf90('0x42')],_0x371d4d['query']);_0x4da917[_0xdf90('0x47')]=_[_0xdf90('0x45')](_0x371d4d[_0xdf90('0x42')],qs[_0xdf90('0x46')](_0x1f409f[_0xdf90('0x43')][_0xdf90('0x46')]));_0x4da917['attributes']=_0x4da917['attributes'][_0xdf90('0x48')]?_0x4da917[_0xdf90('0x47')]:_0x371d4d['model'];if(!_0x1f409f[_0xdf90('0x43')][_0xdf90('0x49')](_0xdf90('0x4a'))){_0x4da917['limit']=qs[_0xdf90('0x33')](_0x1f409f[_0xdf90('0x43')][_0xdf90('0x33')]);_0x4da917['offset']=qs[_0xdf90('0x31')](_0x1f409f[_0xdf90('0x43')][_0xdf90('0x31')]);}_0x4da917['order']=qs[_0xdf90('0x4c')](_0x1f409f[_0xdf90('0x43')][_0xdf90('0x4c')]);_0x4da917[_0xdf90('0x4d')]=qs[_0xdf90('0x44')](_['pick'](_0x1f409f[_0xdf90('0x43')],_0x371d4d[_0xdf90('0x44')]));_0x4da917[_0xdf90('0x4d')][_0xdf90('0xb9')]=_0x19bb15['id'];if(_0x1f409f[_0xdf90('0x43')][_0xdf90('0x4f')]){_0x4da917['where']=_[_0xdf90('0x50')](_0x4da917['where'],{'$or':_['map'](_0x4da917[_0xdf90('0x47')],function(_0x5c0dab){var _0x3ee043={};_0x3ee043[_0x5c0dab]={'$like':'%'+_0x1f409f[_0xdf90('0x43')]['filter']+'%'};return _0x3ee043;})});}_0x4da917=_['merge']({},_0x4da917,_0x1f409f[_0xdf90('0x5d')]);return db[_0xdf90('0xa0')][_0xdf90('0x34')]({'where':_0x4da917['where']})[_0xdf90('0x3a')](function(_0x453b1a){_0x2677f5['count']=_0x453b1a;if(_0x1f409f[_0xdf90('0x43')][_0xdf90('0x53')]){_0x4da917[_0xdf90('0x54')]=[{'model':db['CmContact'],'as':_0xdf90('0xbe'),'required':![]},{'model':db[_0xdf90('0xaa')],'as':'Owner','attributes':['name',_0xdf90('0xbf'),'internal'],'required':![]},{'model':db[_0xdf90('0xc0')],'as':_0xdf90('0xc1'),'attributes':['id',_0xdf90('0x3f'),_0xdf90('0xc2')],'where':_0x1f409f[_0xdf90('0x43')]['tag']?{'id':_0x1f409f[_0xdf90('0x43')][_0xdf90('0xc3')]}:undefined,'required':_0x1f409f['query'][_0xdf90('0xc3')]?!![]:![]}];}return db['SmsInteraction'][_0xdf90('0x55')](_0x4da917);})['then'](function(_0x5ef9c6){_0x2677f5[_0xdf90('0x56')]=_0x5ef9c6;return _0x2677f5;});}})['then'](respondWithFilteredResult(_0x13fddf,_0x4da917))['catch'](handleError(_0x13fddf,null));};exports[_0xdf90('0xc4')]=function(_0x5db07e,_0x4d4740,_0x1b0487){var _0x50a3a5,_0x11fa2b,_0x2c3a12;if(_[_0xdf90('0x94')](_0x5db07e[_0xdf90('0x60')][_0xdf90('0x60')])||_0x5db07e[_0xdf90('0x60')]['body']===''){throw new db[(_0xdf90('0x93'))][(_0xdf90('0x7a'))](_0xdf90('0x95'));}if(_[_0xdf90('0x94')](_0x5db07e['body']['to'])){throw new db[(_0xdf90('0x93'))]['ValidationError'](_0xdf90('0xc5'));}_0x50a3a5=_0x5db07e[_0xdf90('0x60')]['to'];return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x5db07e[_0xdf90('0x59')]['id']},'include':[{'model':db[_0xdf90('0x9a')],'as':_0xdf90('0xc6'),'include':[{'model':db[_0xdf90('0xc7')],'as':_0xdf90('0x9e'),'where':{'mobile':_0x50a3a5},'limit':0x1,'order':[[_0xdf90('0x7e'),_0xdf90('0x9b')]]}]}]})[_0xdf90('0x3a')](handleEntityNotFound(_0x4d4740,null))[_0xdf90('0x3a')](function(_0x156f84){if(_0x156f84&&_0x156f84[_0xdf90('0xc6')]){_0x11fa2b=_0x156f84[_0xdf90('0x3c')]({'plain':!![]});if(_0x11fa2b['List']&&_0x11fa2b[_0xdf90('0xc6')][_0xdf90('0x9e')][_0xdf90('0x48')]){return _0x11fa2b['List'][_0xdf90('0x9e')][0x0];}return db[_0xdf90('0xc7')][_0xdf90('0x5f')](_[_0xdf90('0x1d')](_0x5db07e[_0xdf90('0x60')],{'firstName':_0x50a3a5,'mobile':_0x50a3a5,'phone':_0x50a3a5,'ListId':_0x11fa2b['ListId']}));}})['then'](handleEntityNotFound(_0x4d4740,null))[_0xdf90('0x3a')](function(_0x26f707){if(_0x26f707){_0x2c3a12=_0x26f707;return db['SmsInteraction']['find']({'where':{'ContactId':_0x2c3a12['id'],'closed':![],'SmsAccountId':_0x11fa2b['id']}})[_0xdf90('0x3a')](function(_0x3cf33c){if(_0x3cf33c){return[_0x3cf33c,![]];}return db[_0xdf90('0xa0')][_0xdf90('0x5f')]({'UserId':_0x5db07e['user']['id'],'ContactId':_0x2c3a12['id'],'SmsAccountId':_0x11fa2b['id'],'phone':_0x50a3a5,'firstMsgDirection':_0xdf90('0xc8'),'Messages':[_['merge'](_0x5db07e[_0xdf90('0x60')],{'read':![],'body':_0x5db07e[_0xdf90('0x60')][_0xdf90('0x60')],'phone':_0x50a3a5,'SmsAccountId':_0x11fa2b['id'],'UserId':_0x5db07e[_0xdf90('0x61')]['id'],'ContactId':_0x2c3a12['id']})]},{'include':[{'model':db[_0xdf90('0xa8')],'as':_0xdf90('0xc9')}]})[_0xdf90('0x3a')](function(_0x1aea26){return[_0x1aea26,!![]];});});}})[_0xdf90('0xa1')](function(_0x4349c7,_0x38b8dd){if(_0x38b8dd){return _0x4349c7;}return db['SmsMessage'][_0xdf90('0x5f')](_[_0xdf90('0x50')](_0x5db07e['body'],{'read':![],'body':_0x5db07e['body'][_0xdf90('0x60')],'phone':_0x50a3a5,'SmsAccountId':_0x11fa2b['id'],'SmsInteractionId':_0x4349c7['id'],'UserId':_0x5db07e[_0xdf90('0x61')]['id'],'ContactId':_0x2c3a12['id']}))['then'](function(_0x5e343a){_0x4349c7[_0xdf90('0xca')]['Messages']=[];_0x4349c7[_0xdf90('0xca')][_0xdf90('0xc9')]['push'](_0x5e343a['dataValues']);return _0x4349c7;});})[_0xdf90('0x3a')](respondWithResult(_0x4d4740,null))[_0xdf90('0x57')](handleError(_0x4d4740,null));};exports[_0xdf90('0x2f')]=function(_0x2b19d6,_0x256e6b,_0x46ef93){if(_0x2b19d6[_0xdf90('0x60')]['id']){delete _0x2b19d6[_0xdf90('0x60')]['id'];}var _0x1228b0,_0x1963d4,_0x483cfa;return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x2b19d6['params']['id']}})['then'](handleEntityNotFound(_0x256e6b,null))['then'](function(_0x15c2ac){if(_0x15c2ac){_0x483cfa=_0x15c2ac;logger[_0xdf90('0xcb')](_0xdf90('0x27'),_0xdf90('0x2f'),'received\x20delivery\x20report\x20from',_0x15c2ac['type'],util[_0xdf90('0xcc')](_0x2b19d6[_0xdf90('0x60')],{'showHidden':![],'depth':null}));switch(_0x15c2ac[_0xdf90('0x51')]){case _0xdf90('0x84'):if(_0x2b19d6[_0xdf90('0x60')][_0xdf90('0xcd')]&&_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x2f')]){_0x1963d4=_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x2f')];return db['SmsMessage'][_0xdf90('0x5e')]({'where':{'messageId':_0x2b19d6[_0xdf90('0x60')][_0xdf90('0xcd')]}});}break;case _0xdf90('0x87'):if(_0x2b19d6[_0xdf90('0x60')][_0xdf90('0xce')]&&_0x2b19d6[_0xdf90('0x60')][_0xdf90('0xcf')]){_0x1963d4=_0x2b19d6[_0xdf90('0x60')]['statusInt'];return db[_0xdf90('0xa8')][_0xdf90('0x5e')]({'where':{'messageId':_0x2b19d6['body'][_0xdf90('0xce')]}});}break;case _0xdf90('0x88'):if(_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x89')]&&_0x2b19d6['body']['status_code']){_0x1963d4=_0x2b19d6['body'][_0xdf90('0xd0')];return db[_0xdf90('0xa8')]['find']({'where':{'messageId':_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x89')]}});}break;case _0xdf90('0xd1'):var _0x1ddd3e=_0x2b19d6['body'][_0xdf90('0x8c')][0x0];if(_0x1ddd3e[_0xdf90('0x82')]&&_0x1ddd3e['status'][_0xdf90('0xd2')]===_0xdf90('0xd3')){_0x1963d4=_0x1ddd3e[_0xdf90('0x2f')]['groupName'];return db[_0xdf90('0xa8')][_0xdf90('0x5e')]({'where':{'messageId':_0x1ddd3e[_0xdf90('0x82')]}});}break;case _0xdf90('0xd4'):if(_0x2b19d6[_0xdf90('0x60')]['messageId']&&_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x2f')]){_0x1963d4=_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x2f')];return db['SmsMessage'][_0xdf90('0x5e')]({'where':{'messageId':_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x82')]}});}break;case _0xdf90('0xd5'):if(_0x2b19d6['body'][0x0][_0xdf90('0x2b')]['id']){_0x1963d4=_0x2b19d6[_0xdf90('0x60')][0x0][_0xdf90('0x51')];return db[_0xdf90('0xa8')][_0xdf90('0x5e')]({'where':{'messageId':_0x2b19d6[_0xdf90('0x60')][0x0]['message']['id']}});}break;case _0xdf90('0x91'):if(_0x2b19d6[_0xdf90('0x60')]['redif']&&_0x2b19d6[_0xdf90('0x60')]['status']){_0x1963d4=_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x2f')];return db[_0xdf90('0xa8')][_0xdf90('0x5e')]({'where':{'messageId':_0x2b19d6[_0xdf90('0x60')][_0xdf90('0xd6')]}});}break;}}})[_0xdf90('0x3a')](handleEntityNotFound(_0x256e6b,null))[_0xdf90('0x3a')](function(_0x50498e){if(_0x50498e){_0x1228b0=_0x50498e;switch(_0x483cfa[_0xdf90('0x51')]){case _0xdf90('0x84'):if(_0x1963d4===_0xdf90('0xd3')){return _0x1228b0[_0xdf90('0x39')]({'read':!![]});}else{logger['error'](_0xdf90('0x27'),'status',_0xdf90('0x84'),util[_0xdf90('0xcc')](_0x2b19d6[_0xdf90('0x60')],{'showHidden':![],'depth':null}));}break;case _0xdf90('0x87'):if(_0x1963d4==='1'){return _0x1228b0[_0xdf90('0x39')]({'read':!![]});}else{logger[_0xdf90('0x29')](_0xdf90('0x27'),'status','skebby',util[_0xdf90('0xcc')](_0x2b19d6[_0xdf90('0x60')],{'showHidden':![],'depth':null}));}break;case _0xdf90('0x88'):if(!_0x2b19d6[_0xdf90('0x60')][_0xdf90('0xd7')]&&_0x1963d4>=0xc8&&_0x1963d4<=0xce){return _0x1228b0[_0xdf90('0x39')]({'read':!![]});}else{logger[_0xdf90('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdf90('0x2f'),'clicksend',util[_0xdf90('0xcc')](_0x2b19d6[_0xdf90('0x60')],{'showHidden':![],'depth':null}));}break;case _0xdf90('0xd1'):var _0x935b92=_0x2b19d6[_0xdf90('0x60')][_0xdf90('0x8c')][0x0];if(_0x935b92[_0xdf90('0x2f')][_0xdf90('0xd2')]===_0xdf90('0xd3')){return _0x1228b0[_0xdf90('0x39')]({'read':!![]});}else{logger[_0xdf90('0x29')](_0xdf90('0x27'),'status',_0xdf90('0xd1'),util[_0xdf90('0xcc')](_0x2b19d6[_0xdf90('0x60')],{'showHidden':![],'depth':null}));}break;case _0xdf90('0xd4'):if(_0x1963d4==_0xdf90('0xd8')||_0x1963d4=='RECEIVED_BY_RECIPIENT'){return _0x1228b0['update']({'read':!![]});}else{logger['error'](_0xdf90('0x27'),_0xdf90('0x2f'),_0xdf90('0xd4'),util[_0xdf90('0xcc')](_0x2b19d6['body'],{'showHidden':![],'depth':null}));}break;case _0xdf90('0xd5'):if(_0x1963d4==_0xdf90('0xd9')){return _0x1228b0['update']({'read':!![]});}else{logger[_0xdf90('0x29')](_0xdf90('0x27'),_0xdf90('0x2f'),'bandwidth',util[_0xdf90('0xcc')](_0x2b19d6['body'],{'showHidden':![],'depth':null}));}break;case _0xdf90('0x91'):if(_0x1963d4==='DELIVRD'||_0x1963d4===_0xdf90('0xda')){return _0x1228b0['update']({'read':!![]});}else{logger[_0xdf90('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdf90('0x2f'),_0xdf90('0x91'),util[_0xdf90('0xcc')](_0x2b19d6['body'],{'showHidden':![],'depth':null}));}break;}return _0x1228b0;}})[_0xdf90('0x3a')](respondWithResult(_0x256e6b,null))[_0xdf90('0x57')](handleError(_0x256e6b,null));};exports['statusGet']=function(_0x3826e7,_0x1405e0,_0x1e8d84){var _0x194aec,_0x22227a,_0x23168a;return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x3826e7[_0xdf90('0x59')]['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x1405e0,null))[_0xdf90('0x3a')](function(_0x3faa9c){if(_0x3faa9c){_0x23168a=_0x3faa9c;logger[_0xdf90('0xcb')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xdf90('0xdb'),_0x3faa9c[_0xdf90('0x51')],util['inspect'](_0x3826e7[_0xdf90('0x43')],{'showHidden':![],'depth':null}));switch(_0x3faa9c[_0xdf90('0x51')]){case'csc':if(_0x3826e7[_0xdf90('0x43')]['message-id']&&_0x3826e7[_0xdf90('0x43')][_0xdf90('0xdc')]){_0x22227a=_0x3826e7['query'][_0xdf90('0xdc')];return db[_0xdf90('0xa8')][_0xdf90('0x5e')]({'where':{'messageId':_0x3826e7[_0xdf90('0x43')][_0xdf90('0xdd')]}});}break;}}})[_0xdf90('0x3a')](handleEntityNotFound(_0x1405e0,null))[_0xdf90('0x3a')](function(_0x45a94d){if(_0x45a94d){_0x194aec=_0x45a94d;switch(_0x23168a[_0xdf90('0x51')]){case _0xdf90('0x8d'):if(_0x22227a==='2'||_0x22227a==='6'){return _0x194aec[_0xdf90('0x39')]({'read':!![]});}else{logger[_0xdf90('0x29')](_0xdf90('0x27'),_0xdf90('0x2f'),_0xdf90('0x8d'),util[_0xdf90('0xcc')](_0x3826e7[_0xdf90('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x194aec;}})[_0xdf90('0x3a')](respondWithResult(_0x1405e0,null))[_0xdf90('0x57')](handleError(_0x1405e0,null));};exports[_0xdf90('0xde')]=function(_0x335dfa,_0x4cb30e,_0x365927){return db[_0xdf90('0x41')][_0xdf90('0x5e')]({'where':{'id':_0x335dfa['params']['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x4cb30e,null))[_0xdf90('0x3a')](function(_0x254840){if(_0x254840){return _0x254840[_0xdf90('0xde')](_0x335dfa[_0xdf90('0x60')][_0xdf90('0x6d')],_[_0xdf90('0x9d')](_0x335dfa[_0xdf90('0x60')],[_0xdf90('0x6d'),'id'])||{})[_0xdf90('0xa1')](function(_0x2fafbc){for(var _0x4f3ebd=0x0;_0x4f3ebd<_0x335dfa[_0xdf90('0x60')][_0xdf90('0x6d')]['length'];_0x4f3ebd+=0x1){socket[_0xdf90('0xdf')](_0xdf90('0xe0'),{'UserId':Number(_0x335dfa[_0xdf90('0x60')][_0xdf90('0x6d')][_0x4f3ebd]),'SmsAccountId':Number(_0x335dfa[_0xdf90('0x59')]['id'])});}return _0x2fafbc;});}})[_0xdf90('0x3a')](respondWithResult(_0x4cb30e,null))['catch'](handleError(_0x4cb30e,null));};exports['removeAgents']=function(_0x3fd8bf,_0x38e439,_0x50254c){return db['SmsAccount'][_0xdf90('0x5e')]({'where':{'id':_0x3fd8bf[_0xdf90('0x59')]['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x38e439,null))[_0xdf90('0x3a')](function(_0x3f887d){if(_0x3f887d){return _0x3f887d[_0xdf90('0xe1')](_0x3fd8bf[_0xdf90('0x43')]['ids'])[_0xdf90('0x3a')](function(){if(_[_0xdf90('0xe2')](_0x3fd8bf['query'][_0xdf90('0x6d')])){for(var _0x38e156=0x0;_0x38e156<_0x3fd8bf[_0xdf90('0x43')]['ids'][_0xdf90('0x48')];_0x38e156+=0x1){socket[_0xdf90('0xdf')](_0xdf90('0xe3'),{'UserId':Number(_0x3fd8bf[_0xdf90('0x43')][_0xdf90('0x6d')][_0x38e156]),'SmsAccountId':Number(_0x3fd8bf['params']['id'])});}}else{socket[_0xdf90('0xdf')](_0xdf90('0xe3'),{'UserId':Number(_0x3fd8bf[_0xdf90('0x43')][_0xdf90('0x6d')]),'SmsAccountId':Number(_0x3fd8bf[_0xdf90('0x59')]['id'])});}});}})[_0xdf90('0x3a')](respondWithStatusCode(_0x38e439,null))[_0xdf90('0x57')](handleError(_0x38e439,null));};exports[_0xdf90('0xe4')]=function(_0xcad5ad,_0x1f1cde,_0x1a14c8){var _0x4e4462={};var _0x4fcc3e={};var _0x1bb723;var _0x166f44;return db[_0xdf90('0x41')]['findOne']({'where':{'id':_0xcad5ad[_0xdf90('0x59')]['id']}})[_0xdf90('0x3a')](handleEntityNotFound(_0x1f1cde,null))[_0xdf90('0x3a')](function(_0x53706c){if(_0x53706c){_0x1bb723=_0x53706c;_0x4fcc3e[_0xdf90('0x42')]=_['keys'](db['User']['rawAttributes']);_0x4fcc3e[_0xdf90('0x43')]=_[_0xdf90('0x5c')](_0xcad5ad[_0xdf90('0x43')]);_0x4fcc3e[_0xdf90('0x44')]=_[_0xdf90('0x45')](_0x4fcc3e[_0xdf90('0x42')],_0x4fcc3e[_0xdf90('0x43')]);_0x4e4462[_0xdf90('0x47')]=_[_0xdf90('0x45')](_0x4fcc3e['model'],qs[_0xdf90('0x46')](_0xcad5ad['query'][_0xdf90('0x46')]));_0x4e4462[_0xdf90('0x47')]=_0x4e4462[_0xdf90('0x47')][_0xdf90('0x48')]?_0x4e4462[_0xdf90('0x47')]:_0x4fcc3e[_0xdf90('0x42')];_0x4e4462[_0xdf90('0x4b')]=qs[_0xdf90('0x4c')](_0xcad5ad[_0xdf90('0x43')][_0xdf90('0x4c')]);_0x4e4462[_0xdf90('0x4d')]=qs['filters'](_[_0xdf90('0x4e')](_0xcad5ad[_0xdf90('0x43')],_0x4fcc3e[_0xdf90('0x44')]));if(_0xcad5ad[_0xdf90('0x43')][_0xdf90('0x4f')]){_0x4e4462[_0xdf90('0x4d')]=_[_0xdf90('0x50')](_0x4e4462[_0xdf90('0x4d')],{'$or':_[_0xdf90('0x40')](_0x4e4462['attributes'],function(_0x273f57){var _0x1d252c={};_0x1d252c[_0x273f57]={'$like':'%'+_0xcad5ad[_0xdf90('0x43')][_0xdf90('0x4f')]+'%'};return _0x1d252c;})});}_0x4e4462=_[_0xdf90('0x50')]({},_0x4e4462,_0xcad5ad[_0xdf90('0x5d')]);return _0x1bb723[_0xdf90('0xe4')](_0x4e4462);}})['then'](function(_0x5ed04a){if(_0x5ed04a){_0x166f44=_0x5ed04a['length'];if(!_0xcad5ad['query'][_0xdf90('0x49')]('nolimit')){_0x4e4462[_0xdf90('0x33')]=qs[_0xdf90('0x33')](_0xcad5ad[_0xdf90('0x43')]['limit']);_0x4e4462['offset']=qs[_0xdf90('0x31')](_0xcad5ad[_0xdf90('0x43')][_0xdf90('0x31')]);}return _0x1bb723[_0xdf90('0xe4')](_0x4e4462);}})['then'](function(_0x4d1cb6){if(_0x4d1cb6){return _0x4d1cb6?{'count':_0x166f44,'rows':_0x4d1cb6}:null;}})[_0xdf90('0x3a')](respondWithResult(_0x1f1cde,null))['catch'](handleError(_0x1f1cde,null));}; \ No newline at end of file +var _0xc2fd=['Body','MessageSid','skebby','sender','text','connectel','from','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','refid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','spread','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','interaction','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','\x0a','addApplications','sequelize','transaction','Transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','intelepeer','redif','DELIVERED','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','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','defaults','localhost','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','offset','count','limit','set','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','SmsAccount','includeAll','include','findAll','rows','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','account','orderBy','priority','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','type','From'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc2fd,0x69));var _0xdc2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc2fd[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xdc2f('0x0'));var rimraf=require(_0xdc2f('0x1'));var zipdir=require(_0xdc2f('0x2'));var jsonpatch=require(_0xdc2f('0x3'));var rp=require(_0xdc2f('0x4'));var moment=require(_0xdc2f('0x5'));var BPromise=require(_0xdc2f('0x6'));var Mustache=require(_0xdc2f('0x7'));var util=require(_0xdc2f('0x8'));var path=require(_0xdc2f('0x9'));var sox=require('sox');var csv=require(_0xdc2f('0xa'));var ejs=require(_0xdc2f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdc2f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdc2f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdc2f('0xe'));var Papa=require(_0xdc2f('0xf'));var Redis=require(_0xdc2f('0x10'));var authService=require(_0xdc2f('0x11'));var qs=require(_0xdc2f('0x12'));var as=require(_0xdc2f('0x13'));var hardwareService=require(_0xdc2f('0x14'));var logger=require('../../config/logger')(_0xdc2f('0x15'));var utils=require(_0xdc2f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdc2f('0x17'));var db=require(_0xdc2f('0x18'))['db'];config[_0xdc2f('0x19')]=_[_0xdc2f('0x1a')](config['redis'],{'host':_0xdc2f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc2f('0x19')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xdc2f('0x1c'));var client=jayson[_0xdc2f('0x1d')][_0xdc2f('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x553650,_0x4e42d6,_0x276ba5,_0x538fba){return new BPromise(function(_0x40b016,_0x462237){var _0x8bdbb3=_0x538fba||client;return _0x8bdbb3['request'](_0x553650,_0x276ba5)[_0xdc2f('0x1f')](function(_0xae8852){logger[_0xdc2f('0x20')](_0xdc2f('0x21'),_0x4e42d6,'request\x20sent');logger[_0xdc2f('0x22')](_0xdc2f('0x23'),_0x4e42d6,_0xdc2f('0x24'),JSON[_0xdc2f('0x25')](_0xae8852));if(_0xae8852[_0xdc2f('0x26')]){if(_0xae8852[_0xdc2f('0x26')][_0xdc2f('0x27')]===0x1f4){logger[_0xdc2f('0x26')]('SmsAccount,\x20%s,\x20%s',_0x4e42d6,_0xae8852['error'][_0xdc2f('0x28')]);return _0x462237(_0xae8852[_0xdc2f('0x26')]['message']);}logger[_0xdc2f('0x26')](_0xdc2f('0x21'),_0x4e42d6,_0xae8852[_0xdc2f('0x26')][_0xdc2f('0x28')]);return _0x40b016(_0xae8852[_0xdc2f('0x26')][_0xdc2f('0x28')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x4e42d6,_0xdc2f('0x24'));_0x40b016(_0xae8852[_0xdc2f('0x29')][_0xdc2f('0x28')]);}})[_0xdc2f('0x2a')](function(_0x135752){logger[_0xdc2f('0x26')](_0xdc2f('0x21'),_0x4e42d6,_0x135752);_0x462237(_0x135752);});});}function respondWithStatusCode(_0xb51155,_0x3df284){_0x3df284=_0x3df284||0xcc;return function(_0x3bee89){if(_0x3bee89){return _0xb51155[_0xdc2f('0x2b')](_0x3df284);}return _0xb51155['status'](_0x3df284)[_0xdc2f('0x2c')]();};}function respondWithResult(_0x15c5ae,_0x323190){_0x323190=_0x323190||0xc8;return function(_0x277680){if(_0x277680){return _0x15c5ae[_0xdc2f('0x2d')](_0x323190)[_0xdc2f('0x2e')](_0x277680);}};}function respondWithFilteredResult(_0x1ac18c,_0x10dc78){return function(_0x496ba6){if(_0x496ba6){var _0x1d659d=typeof _0x10dc78['offset']===_0xdc2f('0x2f')&&typeof _0x10dc78['limit']===_0xdc2f('0x2f');var _0x3d48b6=_0x496ba6['count'];var _0xace61b=_0x1d659d?0x0:_0x10dc78[_0xdc2f('0x30')];var _0x4c8eb3=_0x1d659d?_0x496ba6[_0xdc2f('0x31')]:_0x10dc78['offset']+_0x10dc78[_0xdc2f('0x32')];var _0x5216ca;if(_0x4c8eb3>=_0x3d48b6){_0x4c8eb3=_0x3d48b6;_0x5216ca=0xc8;}else{_0x5216ca=0xce;}_0x1ac18c[_0xdc2f('0x2d')](_0x5216ca);return _0x1ac18c[_0xdc2f('0x33')]('Content-Range',_0xace61b+'-'+_0x4c8eb3+'/'+_0x3d48b6)[_0xdc2f('0x2e')](_0x496ba6);}return null;};}function patchUpdates(_0x3bc6e7){return function(_0x5b905d){try{jsonpatch[_0xdc2f('0x34')](_0x5b905d,_0x3bc6e7,!![]);}catch(_0x30aa88){return BPromise[_0xdc2f('0x35')](_0x30aa88);}return _0x5b905d['save']();};}function saveUpdates(_0xd508a6,_0x4991e9){return function(_0x446954){if(_0x446954){return _0x446954[_0xdc2f('0x36')](_0xd508a6)[_0xdc2f('0x1f')](function(_0x55c920){return _0x55c920;});}return null;};}function removeEntity(_0xfb4990,_0x46a6e7){return function(_0x31e388){if(_0x31e388){return _0x31e388[_0xdc2f('0x37')]()[_0xdc2f('0x1f')](function(){var _0x441b25=_0x31e388[_0xdc2f('0x38')]({'plain':!![]});var _0x10b426=_0xdc2f('0x39');return db[_0xdc2f('0x3a')][_0xdc2f('0x37')]({'where':{'type':_0x10b426,'resourceId':_0x441b25['id']}})[_0xdc2f('0x1f')](function(){return _0x31e388;});})[_0xdc2f('0x1f')](function(){_0xfb4990['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4005,_0x3b4643){return function(_0x31aba9){if(!_0x31aba9){_0x4a4005[_0xdc2f('0x2b')](0x194);}return _0x31aba9;};}function handleError(_0x1f3eb6,_0x4a3351){_0x4a3351=_0x4a3351||0x1f4;return function(_0x32f07f){logger[_0xdc2f('0x26')](_0x32f07f['stack']);if(_0x32f07f['name']){delete _0x32f07f[_0xdc2f('0x3b')];}_0x1f3eb6[_0xdc2f('0x2d')](_0x4a3351)[_0xdc2f('0x3c')](_0x32f07f);};}exports['index']=function(_0x2b0d01,_0xe717b0){var _0x1f413a={'include':[{'model':db[_0xdc2f('0x3d')],'as':_0xdc2f('0x3e')}]},_0xc3f93b={},_0x49c0a5={'count':0x0,'rows':[]};var _0x23e5a3=_[_0xdc2f('0x3f')](db['SmsAccount'][_0xdc2f('0x40')],function(_0x4bd18d){return{'name':_0x4bd18d[_0xdc2f('0x41')],'type':_0x4bd18d['type'][_0xdc2f('0x42')]};});_0xc3f93b['model']=_[_0xdc2f('0x3f')](_0x23e5a3,_0xdc2f('0x3b'));_0xc3f93b[_0xdc2f('0x43')]=_['keys'](_0x2b0d01[_0xdc2f('0x43')]);_0xc3f93b[_0xdc2f('0x44')]=_['intersection'](_0xc3f93b['model'],_0xc3f93b['query']);_0x1f413a[_0xdc2f('0x45')]=_[_0xdc2f('0x46')](_0xc3f93b[_0xdc2f('0x47')],qs[_0xdc2f('0x48')](_0x2b0d01[_0xdc2f('0x43')]['fields']));_0x1f413a[_0xdc2f('0x45')]=_0x1f413a[_0xdc2f('0x45')][_0xdc2f('0x49')]?_0x1f413a[_0xdc2f('0x45')]:_0xc3f93b[_0xdc2f('0x47')];if(!_0x2b0d01[_0xdc2f('0x43')]['hasOwnProperty'](_0xdc2f('0x4a'))){_0x1f413a[_0xdc2f('0x32')]=qs[_0xdc2f('0x32')](_0x2b0d01[_0xdc2f('0x43')][_0xdc2f('0x32')]);_0x1f413a[_0xdc2f('0x30')]=qs['offset'](_0x2b0d01[_0xdc2f('0x43')][_0xdc2f('0x30')]);}_0x1f413a[_0xdc2f('0x4b')]=qs[_0xdc2f('0x4c')](_0x2b0d01[_0xdc2f('0x43')][_0xdc2f('0x4c')]);_0x1f413a[_0xdc2f('0x4d')]=qs['filters'](_[_0xdc2f('0x4e')](_0x2b0d01['query'],_0xc3f93b['filters']),_0x23e5a3);if(_0x2b0d01[_0xdc2f('0x43')][_0xdc2f('0x4f')]){_0x1f413a[_0xdc2f('0x4d')]=_[_0xdc2f('0x50')](_0x1f413a[_0xdc2f('0x4d')],{'$or':_[_0xdc2f('0x3f')](_0x23e5a3,function(_0x4dc76e){if(_0x4dc76e['type']!=='VIRTUAL'){var _0x2848a0={};_0x2848a0[_0x4dc76e[_0xdc2f('0x3b')]]={'$like':'%'+_0x2b0d01[_0xdc2f('0x43')]['filter']+'%'};return _0x2848a0;}})});}_0x1f413a=_[_0xdc2f('0x50')]({},_0x1f413a,_0x2b0d01[_0xdc2f('0x51')]);var _0x1219ee={'where':_0x1f413a[_0xdc2f('0x4d')]};return db[_0xdc2f('0x52')][_0xdc2f('0x31')](_0x1219ee)['then'](function(_0x3c0387){_0x49c0a5[_0xdc2f('0x31')]=_0x3c0387;if(_0x2b0d01['query'][_0xdc2f('0x53')]){_0x1f413a[_0xdc2f('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0xdc2f('0x55')](_0x1f413a);})[_0xdc2f('0x1f')](function(_0xb7907c){_0x49c0a5[_0xdc2f('0x56')]=_0xb7907c;return _0x49c0a5;})[_0xdc2f('0x1f')](respondWithFilteredResult(_0xe717b0,_0x1f413a))['catch'](handleError(_0xe717b0,null));};exports['show']=function(_0x4c630d,_0xbe291d){var _0x4eeb88={'raw':![],'where':{'id':_0x4c630d[_0xdc2f('0x57')]['id']},'include':[{'model':db[_0xdc2f('0x3d')],'as':_0xdc2f('0x3e')}]},_0x34f783={};_0x34f783[_0xdc2f('0x47')]=_['keys'](db[_0xdc2f('0x52')]['rawAttributes']);_0x34f783[_0xdc2f('0x43')]=_[_0xdc2f('0x58')](_0x4c630d['query']);_0x34f783[_0xdc2f('0x44')]=_[_0xdc2f('0x46')](_0x34f783[_0xdc2f('0x47')],_0x34f783[_0xdc2f('0x43')]);_0x4eeb88[_0xdc2f('0x45')]=_['intersection'](_0x34f783[_0xdc2f('0x47')],qs['fields'](_0x4c630d[_0xdc2f('0x43')][_0xdc2f('0x48')]));_0x4eeb88[_0xdc2f('0x45')]=_0x4eeb88['attributes'][_0xdc2f('0x49')]?_0x4eeb88[_0xdc2f('0x45')]:_0x34f783['model'];if(_0x4c630d[_0xdc2f('0x43')][_0xdc2f('0x53')]){_0x4eeb88['include']=[{'all':!![]}];}_0x4eeb88=_['merge']({},_0x4eeb88,_0x4c630d[_0xdc2f('0x51')]);return db[_0xdc2f('0x52')]['find'](_0x4eeb88)[_0xdc2f('0x1f')](handleEntityNotFound(_0xbe291d,null))['then'](respondWithResult(_0xbe291d,null))['catch'](handleError(_0xbe291d,null));};exports[_0xdc2f('0x59')]=function(_0x56c8d9,_0x386075){return db['SmsAccount'][_0xdc2f('0x59')](_0x56c8d9[_0xdc2f('0x5a')],{})[_0xdc2f('0x1f')](function(_0x152ab7){var _0x3e939c=_0x56c8d9[_0xdc2f('0x5b')][_0xdc2f('0x38')]({'plain':!![]});if(!_0x3e939c)throw new Error(_0xdc2f('0x5c'));if(_0x3e939c['role']===_0xdc2f('0x5b')){var _0x1761a2=_0x152ab7['get']({'plain':!![]});var _0x7625e3=_0xdc2f('0x39');return db[_0xdc2f('0x5d')]['find']({'where':{'name':_0x7625e3,'userProfileId':_0x3e939c[_0xdc2f('0x5e')]},'raw':!![]})[_0xdc2f('0x1f')](function(_0x2d1cbb){if(_0x2d1cbb&&_0x2d1cbb[_0xdc2f('0x5f')]===0x0){return db[_0xdc2f('0x3a')][_0xdc2f('0x59')]({'name':_0x1761a2[_0xdc2f('0x3b')],'resourceId':_0x1761a2['id'],'type':_0x2d1cbb['name'],'sectionId':_0x2d1cbb['id']},{})[_0xdc2f('0x1f')](function(){return _0x152ab7;});}else{return _0x152ab7;}})[_0xdc2f('0x2a')](function(_0x2ab92f){logger[_0xdc2f('0x26')](_0xdc2f('0x60'),_0x2ab92f);throw _0x2ab92f;});}return _0x152ab7;})[_0xdc2f('0x1f')](respondWithResult(_0x386075,0xc9))['catch'](handleError(_0x386075,null));};exports[_0xdc2f('0x36')]=function(_0xff3ad2,_0x5c8c61){if(_0xff3ad2[_0xdc2f('0x5a')]['id']){delete _0xff3ad2['body']['id'];}return db[_0xdc2f('0x52')][_0xdc2f('0x61')]({'where':{'id':_0xff3ad2[_0xdc2f('0x57')]['id']},'include':[{'model':db[_0xdc2f('0x3d')],'as':_0xdc2f('0x3e')}]})[_0xdc2f('0x1f')](handleEntityNotFound(_0x5c8c61,null))[_0xdc2f('0x1f')](saveUpdates(_0xff3ad2[_0xdc2f('0x5a')],null))[_0xdc2f('0x1f')](respondWithResult(_0x5c8c61,null))[_0xdc2f('0x2a')](handleError(_0x5c8c61,null));};exports[_0xdc2f('0x37')]=function(_0x462c3b,_0x21d950){return db[_0xdc2f('0x52')][_0xdc2f('0x61')]({'where':{'id':_0x462c3b[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x21d950,null))['then'](removeEntity(_0x21d950,null))[_0xdc2f('0x2a')](handleError(_0x21d950,null));};exports[_0xdc2f('0x62')]=function(_0x1a9868,_0x58ded8){return db[_0xdc2f('0x52')][_0xdc2f('0x62')]()[_0xdc2f('0x1f')](respondWithResult(_0x58ded8,null))['catch'](handleError(_0x58ded8,null));};exports['addDisposition']=function(_0x18878e,_0x547682,_0x26ecc9){if(_0x18878e['body']['id']){delete _0x18878e[_0xdc2f('0x5a')]['id'];}return db['SmsAccount'][_0xdc2f('0x61')]({'where':{'id':_0x18878e[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x547682,null))['then'](function(_0x301df1){if(_0x301df1){_0x18878e[_0xdc2f('0x5a')][_0xdc2f('0x63')]=_0x301df1['id'];return db[_0xdc2f('0x64')][_0xdc2f('0x59')](_0x18878e['body']);}})[_0xdc2f('0x1f')](respondWithResult(_0x547682,null))[_0xdc2f('0x2a')](handleError(_0x547682,null));};exports[_0xdc2f('0x65')]=function(_0x5f5be4,_0x523c65,_0x270330){var _0x312a9e={'raw':![],'where':{}};var _0x5636b3={};var _0x4c8b2e={'count':0x0,'rows':[]};return db[_0xdc2f('0x52')][_0xdc2f('0x66')]({'where':{'id':_0x5f5be4[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x523c65,null))['then'](function(_0x25671e){if(_0x25671e){_0x5636b3[_0xdc2f('0x47')]=_[_0xdc2f('0x58')](db[_0xdc2f('0x64')][_0xdc2f('0x40')]);_0x5636b3[_0xdc2f('0x43')]=_[_0xdc2f('0x58')](_0x5f5be4[_0xdc2f('0x43')]);_0x5636b3[_0xdc2f('0x44')]=_['intersection'](_0x5636b3[_0xdc2f('0x47')],_0x5636b3[_0xdc2f('0x43')]);_0x312a9e[_0xdc2f('0x45')]=_[_0xdc2f('0x46')](_0x5636b3[_0xdc2f('0x47')],qs['fields'](_0x5f5be4[_0xdc2f('0x43')]['fields']));_0x312a9e[_0xdc2f('0x45')]=_0x312a9e[_0xdc2f('0x45')][_0xdc2f('0x49')]?_0x312a9e[_0xdc2f('0x45')]:_0x5636b3[_0xdc2f('0x47')];if(!_0x5f5be4[_0xdc2f('0x43')][_0xdc2f('0x67')](_0xdc2f('0x4a'))){_0x312a9e[_0xdc2f('0x32')]=qs[_0xdc2f('0x32')](_0x5f5be4['query'][_0xdc2f('0x32')]);_0x312a9e[_0xdc2f('0x30')]=qs[_0xdc2f('0x30')](_0x5f5be4['query'][_0xdc2f('0x30')]);}_0x312a9e[_0xdc2f('0x4b')]=qs[_0xdc2f('0x4c')](_0x5f5be4['query'][_0xdc2f('0x4c')]);_0x312a9e[_0xdc2f('0x4d')]=qs[_0xdc2f('0x44')](_[_0xdc2f('0x4e')](_0x5f5be4[_0xdc2f('0x43')],_0x5636b3['filters']));_0x312a9e[_0xdc2f('0x4d')][_0xdc2f('0x63')]=_0x25671e['id'];if(_0x5f5be4[_0xdc2f('0x43')][_0xdc2f('0x4f')]){_0x312a9e[_0xdc2f('0x4d')]=_['merge'](_0x312a9e[_0xdc2f('0x4d')],{'$or':_[_0xdc2f('0x3f')](_0x312a9e[_0xdc2f('0x45')],function(_0x161cd9){var _0x21e1f1={};_0x21e1f1[_0x161cd9]={'$like':'%'+_0x5f5be4['query'][_0xdc2f('0x4f')]+'%'};return _0x21e1f1;})});}_0x312a9e=_['merge']({},_0x312a9e,_0x5f5be4[_0xdc2f('0x51')]);return db[_0xdc2f('0x64')]['count']({'where':_0x312a9e[_0xdc2f('0x4d')]})[_0xdc2f('0x1f')](function(_0x1d79e8){_0x4c8b2e[_0xdc2f('0x31')]=_0x1d79e8;if(_0x5f5be4[_0xdc2f('0x43')]['includeAll']){_0x312a9e[_0xdc2f('0x54')]=[{'all':!![]}];}return db[_0xdc2f('0x64')][_0xdc2f('0x55')](_0x312a9e);})[_0xdc2f('0x1f')](function(_0x1fa669){_0x4c8b2e[_0xdc2f('0x56')]=_0x1fa669;return _0x4c8b2e;});}})[_0xdc2f('0x1f')](respondWithFilteredResult(_0x523c65,_0x312a9e))['catch'](handleError(_0x523c65,null));};exports[_0xdc2f('0x68')]=function(_0x3a04fa,_0x46ea5f,_0x392707){return db[_0xdc2f('0x52')]['find']({'where':{'id':_0x3a04fa['params']['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x46ea5f,null))[_0xdc2f('0x1f')](function(_0x8958b7){if(_0x8958b7){return _0x8958b7[_0xdc2f('0x68')](_0x3a04fa[_0xdc2f('0x43')][_0xdc2f('0x69')]);}})['then'](respondWithStatusCode(_0x46ea5f,null))[_0xdc2f('0x2a')](handleError(_0x46ea5f,null));};exports[_0xdc2f('0x6a')]=function(_0xb9b59c,_0x5349b1,_0x43a544){if(_0xb9b59c['body']['id']){delete _0xb9b59c['body']['id'];}return db[_0xdc2f('0x52')][_0xdc2f('0x61')]({'where':{'id':_0xb9b59c[_0xdc2f('0x57')]['id']}})['then'](handleEntityNotFound(_0x5349b1,null))[_0xdc2f('0x1f')](function(_0x505577){if(_0x505577){_0xb9b59c['body'][_0xdc2f('0x63')]=_0x505577['id'];return db['CannedAnswer'][_0xdc2f('0x59')](_0xb9b59c[_0xdc2f('0x5a')]);}})[_0xdc2f('0x1f')](respondWithResult(_0x5349b1,null))['catch'](handleError(_0x5349b1,null));};exports[_0xdc2f('0x6b')]=function(_0x2b15fd,_0x48467f,_0x2270ea){var _0x6878c6={'raw':![],'where':{}};var _0x15590c={};var _0x419ab7={'count':0x0,'rows':[]};return db['SmsAccount'][_0xdc2f('0x66')]({'where':{'id':_0x2b15fd[_0xdc2f('0x57')]['id']}})['then'](handleEntityNotFound(_0x48467f,null))['then'](function(_0x4f5f9a){if(_0x4f5f9a){_0x15590c[_0xdc2f('0x47')]=_[_0xdc2f('0x58')](db[_0xdc2f('0x6c')]['rawAttributes']);_0x15590c[_0xdc2f('0x43')]=_[_0xdc2f('0x58')](_0x2b15fd[_0xdc2f('0x43')]);_0x15590c[_0xdc2f('0x44')]=_[_0xdc2f('0x46')](_0x15590c[_0xdc2f('0x47')],_0x15590c[_0xdc2f('0x43')]);_0x6878c6[_0xdc2f('0x45')]=_[_0xdc2f('0x46')](_0x15590c[_0xdc2f('0x47')],qs[_0xdc2f('0x48')](_0x2b15fd[_0xdc2f('0x43')]['fields']));_0x6878c6[_0xdc2f('0x45')]=_0x6878c6[_0xdc2f('0x45')][_0xdc2f('0x49')]?_0x6878c6[_0xdc2f('0x45')]:_0x15590c[_0xdc2f('0x47')];if(!_0x2b15fd[_0xdc2f('0x43')][_0xdc2f('0x67')]('nolimit')){_0x6878c6['limit']=qs[_0xdc2f('0x32')](_0x2b15fd[_0xdc2f('0x43')][_0xdc2f('0x32')]);_0x6878c6[_0xdc2f('0x30')]=qs[_0xdc2f('0x30')](_0x2b15fd[_0xdc2f('0x43')][_0xdc2f('0x30')]);}_0x6878c6[_0xdc2f('0x4b')]=qs[_0xdc2f('0x4c')](_0x2b15fd[_0xdc2f('0x43')][_0xdc2f('0x4c')]);_0x6878c6['where']=qs[_0xdc2f('0x44')](_[_0xdc2f('0x4e')](_0x2b15fd[_0xdc2f('0x43')],_0x15590c[_0xdc2f('0x44')]));_0x6878c6['where'][_0xdc2f('0x63')]=_0x4f5f9a['id'];if(_0x2b15fd[_0xdc2f('0x43')][_0xdc2f('0x4f')]){_0x6878c6[_0xdc2f('0x4d')]=_[_0xdc2f('0x50')](_0x6878c6[_0xdc2f('0x4d')],{'$or':_[_0xdc2f('0x3f')](_0x6878c6[_0xdc2f('0x45')],function(_0x470705){var _0x568b83={};_0x568b83[_0x470705]={'$like':'%'+_0x2b15fd['query'][_0xdc2f('0x4f')]+'%'};return _0x568b83;})});}_0x6878c6=_['merge']({},_0x6878c6,_0x2b15fd[_0xdc2f('0x51')]);return db[_0xdc2f('0x6c')][_0xdc2f('0x31')]({'where':_0x6878c6[_0xdc2f('0x4d')]})[_0xdc2f('0x1f')](function(_0xa7167e){_0x419ab7[_0xdc2f('0x31')]=_0xa7167e;if(_0x2b15fd[_0xdc2f('0x43')][_0xdc2f('0x53')]){_0x6878c6['include']=[{'all':!![]}];}return db[_0xdc2f('0x6c')][_0xdc2f('0x55')](_0x6878c6);})['then'](function(_0xb2b0ea){_0x419ab7['rows']=_0xb2b0ea;return _0x419ab7;});}})[_0xdc2f('0x1f')](respondWithFilteredResult(_0x48467f,_0x6878c6))[_0xdc2f('0x2a')](handleError(_0x48467f,null));};exports[_0xdc2f('0x6d')]=function(_0x2bede4,_0x26f2db,_0x3c24fc){return db[_0xdc2f('0x52')]['find']({'where':{'id':_0x2bede4[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x26f2db,null))[_0xdc2f('0x1f')](function(_0x2fe365){if(_0x2fe365){return _0x2fe365['removeAnswers'](_0x2bede4[_0xdc2f('0x43')][_0xdc2f('0x69')]);}})['then'](respondWithStatusCode(_0x26f2db,null))[_0xdc2f('0x2a')](handleError(_0x26f2db,null));};exports[_0xdc2f('0x6e')]=function(_0x2e0cf0,_0xb5c51c,_0x3209d7){var _0x4f1e3e={'channel':'sms'};var _0x12a0a8=[];var _0x4fdce5=[];var _0x24d07e={};return db['SmsAccount'][_0xdc2f('0x61')]({'where':{'id':_0x2e0cf0['params']['id']},'include':[{'model':db[_0xdc2f('0x6f')],'as':_0xdc2f('0x70')}]})['then'](handleEntityNotFound(_0xb5c51c,null))[_0xdc2f('0x1f')](function(_0x14ea76){_0x4f1e3e[_0xdc2f('0x71')]=_0x14ea76;_0x4f1e3e['applications']=_[_0xdc2f('0x72')](_0x14ea76[_0xdc2f('0x70')],[_0xdc2f('0x73')],[_0xdc2f('0x74')]);if(_0x4f1e3e[_0xdc2f('0x71')][_0xdc2f('0x70')]){delete _0x4f1e3e[_0xdc2f('0x71')][_0xdc2f('0x70')];}return db['CmContact']['describe']();})['then'](function(_0x484d73){if(!_0x484d73){throw new db['Sequelize'][(_0xdc2f('0x75'))](_0xdc2f('0x76'));}_0x12a0a8=_[_0xdc2f('0x77')](_[_0xdc2f('0x58')](_0x484d73),[_0xdc2f('0x78'),_0xdc2f('0x79')]);_0x4fdce5=_[_0xdc2f('0x77')](_['keys'](_0x484d73),[_0xdc2f('0x78'),_0xdc2f('0x79'),'CompanyId',_0xdc2f('0x7a')]);_0x4f1e3e[_0xdc2f('0x5a')]={'mapKey':_0xdc2f('0x7b')};if(_0x4f1e3e[_0xdc2f('0x71')][_0xdc2f('0x7c')]){switch(_0x4f1e3e[_0xdc2f('0x71')][_0xdc2f('0x7c')]){case'twilio':_0x4f1e3e['body']['from']=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x7d')];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x7e')];_0x4f1e3e['body']['messageId']=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x7f')];break;case _0xdc2f('0x80'):_0x4f1e3e[_0xdc2f('0x5a')]['from']='+'+_0x2e0cf0['body'][_0xdc2f('0x81')];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x82')];break;case _0xdc2f('0x83'):_0x4f1e3e[_0xdc2f('0x5a')]['from']=_0x2e0cf0['body']['from'];_0x4f1e3e['body'][_0xdc2f('0x5a')]=_0x2e0cf0['body'][_0xdc2f('0x28')];break;case'clicksend':_0x4f1e3e['body'][_0xdc2f('0x84')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x84')];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')]=_0x2e0cf0['body']['body'];_0x4f1e3e['body'][_0xdc2f('0x85')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x86')];break;case _0xdc2f('0x87'):_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x84')]=_0x2e0cf0['body'][_0xdc2f('0x7d')];_0x4f1e3e['body'][_0xdc2f('0x5a')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x88')];_0x4f1e3e['body'][_0xdc2f('0x85')]=_0x2e0cf0['body'][_0xdc2f('0x89')];break;case _0xdc2f('0x8a'):_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x84')]='+'+_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x8b')][0x0]['from'];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x8b')][0x0]['text'];_0x4f1e3e['body']['messageId']=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x8b')][0x0][_0xdc2f('0x85')];break;case _0xdc2f('0x8c'):_0x4f1e3e['body'][_0xdc2f('0x84')]=_0x2e0cf0['body'][_0xdc2f('0x8d')];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')]=_0x2e0cf0['body'][_0xdc2f('0x8e')]['message'];break;case _0xdc2f('0x8f'):_0x4f1e3e[_0xdc2f('0x5a')]['from']=_0x2e0cf0[_0xdc2f('0x5a')]['fromNumber'];_0x4f1e3e['body'][_0xdc2f('0x5a')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x82')];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x85')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x90')];break;case _0xdc2f('0x91'):_0x4f1e3e[_0xdc2f('0x5a')]['messageId']=_0x2e0cf0[_0xdc2f('0x5a')][0x0][_0xdc2f('0x28')]['id'];_0x4f1e3e[_0xdc2f('0x5a')]['from']=_0x2e0cf0['body'][0x0]['message']['from'];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')]=_0x2e0cf0[_0xdc2f('0x5a')][0x0][_0xdc2f('0x28')][_0xdc2f('0x82')];break;case'intelepeer':_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x84')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x84')];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x28')];_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x85')]=_0x2e0cf0[_0xdc2f('0x5a')][_0xdc2f('0x92')];break;}}if(_0x4f1e3e['body']['id']){delete _0x4f1e3e[_0xdc2f('0x5a')]['id'];}if(_['isNil'](_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x84')])){throw new db['Sequelize'][(_0xdc2f('0x75'))]('from\x20is\x20mandatory');}if(_[_0xdc2f('0x93')](_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x5a')])||_0x4f1e3e[_0xdc2f('0x5a')]['body']===''){throw new db[(_0xdc2f('0x94'))]['ValidationError'](_0xdc2f('0x95'));}if(_['isNil'](_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x96')])){throw new db['Sequelize'][(_0xdc2f('0x75'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4fdce5);}if(!_[_0xdc2f('0x97')](_0x4fdce5,_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x96')])){throw new db[(_0xdc2f('0x94'))]['ValidationError'](_0xdc2f('0x98')+_0x4fdce5);}_0x24d07e[_0x4f1e3e['body'][_0xdc2f('0x96')]]=_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x84')];return db[_0xdc2f('0x99')][_0xdc2f('0x61')]({'where':{'id':_0x4f1e3e['account'][_0xdc2f('0x7a')]},'include':[{'model':db[_0xdc2f('0x9a')],'as':_0xdc2f('0x9b'),'where':_0x24d07e,'limit':0x1,'order':[[_0xdc2f('0x79'),_0xdc2f('0x9c')]]}]});})[_0xdc2f('0x1f')](handleEntityNotFound(_0xb5c51c,null))[_0xdc2f('0x1f')](function(_0x2b4261){if(_0x2b4261){_0x4f1e3e[_0xdc2f('0x9d')]=_[_0xdc2f('0x9e')](_0x2b4261,['Contacts']);if(_0x2b4261['Contacts'][_0xdc2f('0x49')]){return _0x2b4261[_0xdc2f('0x9b')][0x0];}var _0x3829f1=_[_0xdc2f('0x1a')](_0x4f1e3e[_0xdc2f('0x5a')],{'firstName':_0x4f1e3e[_0xdc2f('0x5a')]['from'],'ListId':_0x2b4261['id']});_0x3829f1[_0x4f1e3e['body']['mapKey']]=_0x4f1e3e['body'][_0xdc2f('0x84')];return db['CmContact'][_0xdc2f('0x59')](_0x3829f1,{'fields':_0x12a0a8,'raw':!![]});}})['then'](handleEntityNotFound(_0xb5c51c,null))[_0xdc2f('0x1f')](function(_0x4b3694){if(_0x4b3694){_0x4f1e3e[_0xdc2f('0x9f')]=_0x4b3694;var _0x297af9={'ContactId':_0x4b3694['id'],'phone':_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x84')],'SmsAccountId':_0x2e0cf0[_0xdc2f('0x57')]['id']};var _0x445413={'ContactId':_0x4b3694['id'],'SmsAccountId':_0x2e0cf0['params']['id'],'closed':![]};return db[_0xdc2f('0xa0')]['find']({'where':_0x445413})[_0xdc2f('0x1f')](function(_0x5304bc){if(_0x5304bc){return[_0x5304bc,![]];}return db[_0xdc2f('0xa0')]['create'](_0x297af9)[_0xdc2f('0x1f')](function(_0x319bfb){return[_0x319bfb,!![]];});});}})[_0xdc2f('0xa1')](function(_0x177b54,_0x1dfcce){_0x4f1e3e['interaction']=_0x177b54[_0xdc2f('0x38')]({'plain':!![]});_0x4f1e3e['interaction'][_0xdc2f('0xa2')]=![];if(_0x1dfcce){if(_0x4f1e3e[_0xdc2f('0x71')][_0xdc2f('0xa3')]){_0x4f1e3e[_0xdc2f('0xa4')][_0xdc2f('0xa5')]({'id':0x0,'priority':_0x4f1e3e['applications']['length']+0x1,'app':_0xdc2f('0xa6'),'appdata':_0xdc2f('0xa7'),'interval':_0xdc2f('0xa8')});}_0x4f1e3e['interaction'][_0xdc2f('0xa2')]=!![];}return db[_0xdc2f('0xa9')][_0xdc2f('0x59')]({'phone':_0x4f1e3e[_0xdc2f('0x5a')][_0xdc2f('0x84')],'messageId':_0x4f1e3e['body'][_0xdc2f('0x85')],'body':_0x4f1e3e['body'][_0xdc2f('0x5a')],'SmsAccountId':_0x2e0cf0[_0xdc2f('0x57')]['id'],'SmsInteractionId':_0x177b54['id'],'direction':'in','ContactId':_0x177b54[_0xdc2f('0xaa')],'AttachmentId':_0x4f1e3e['body'][_0xdc2f('0xab')]});})[_0xdc2f('0x1f')](function(_0x5d3065){_0x4f1e3e[_0xdc2f('0x28')]=_0x5d3065;if(_0x4f1e3e[_0xdc2f('0xac')][_0xdc2f('0xad')]){return db[_0xdc2f('0xae')][_0xdc2f('0x61')]({'attributes':['id',_0xdc2f('0x3b')],'where':{'id':_0x4f1e3e[_0xdc2f('0xac')][_0xdc2f('0xad')]}})[_0xdc2f('0x1f')](function(_0x4e31ca){if(_0x4e31ca){_0x4f1e3e[_0xdc2f('0xa4')][_0xdc2f('0xaf')]({'id':0x0,'priority':0x0,'app':_0xdc2f('0xb0'),'appdata':_0x4e31ca['name']+','+(_0x4f1e3e['account'][_0xdc2f('0xb1')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xdc2f('0xb2'),_0x4f1e3e);});}return respondWithRpcPromise(_0xdc2f('0xb3'),_0xdc2f('0xb2'),_0x4f1e3e);})['then'](function(_0x2cf4a3){if(_0x2cf4a3){var _0x2d4e42=0xc8;var _0x41072c='receiveMessage';logger['info'](_0xdc2f('0x23'),_0x41072c,_0x2d4e42,'entity\x20found');logger[_0xdc2f('0x22')](_0xdc2f('0xb4'),_0x41072c,_0x2d4e42,_0xdc2f('0xb5'),JSON[_0xdc2f('0x25')](_0x2cf4a3));if(_0x4f1e3e[_0xdc2f('0x71')][_0xdc2f('0x7c')]===_0xdc2f('0xb6')){return _0xb5c51c[_0xdc2f('0x2d')](_0x2d4e42)[_0xdc2f('0x33')]('Content-Type','text/xml')[_0xdc2f('0x3c')](_0xdc2f('0xb7'));}else{return _0xb5c51c[_0xdc2f('0x2d')](_0x2d4e42)['json'](_0x2cf4a3);}}})[_0xdc2f('0x2a')](handleError(_0xb5c51c,null));};exports[_0xdc2f('0xb8')]=function(_0x27150c,_0x2a4719){var _0x5c7623=_0x27150c['params']['id'];var _0x45ad92=_0x27150c[_0xdc2f('0x5a')];var _0x22f35c=0xc8;var _0x18712f=null;return db[_0xdc2f('0xb9')][_0xdc2f('0xba')]({'isolationLevel':db[_0xdc2f('0xb9')][_0xdc2f('0xbb')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3e1f27){return db['SmsAccount'][_0xdc2f('0x66')]({'where':{'id':_0x5c7623},'transaction':_0x3e1f27})[_0xdc2f('0x1f')](function(_0x21493f){if(_0x21493f){return db[_0xdc2f('0x6f')][_0xdc2f('0x37')]({'where':{'SmsAccountId':_0x5c7623},'transaction':_0x3e1f27})[_0xdc2f('0x1f')](function(){var _0x20439c=_['map'](_0x45ad92,function(_0x151a3d){_0x151a3d[_0xdc2f('0x63')]=_0x5c7623;return _0x151a3d;});return db[_0xdc2f('0x6f')][_0xdc2f('0xbc')](_0x20439c,{'transaction':_0x3e1f27});});}else{_0x22f35c=0x194;_0x18712f=[];}});})[_0xdc2f('0x1f')](function(){if(_0x22f35c!==0x194){return db[_0xdc2f('0x6f')][_0xdc2f('0xbd')]({'where':{'SmsAccountId':_0x5c7623},'order':'priority'})['then'](function(_0x319b01){_0x18712f=_0x319b01;});}})[_0xdc2f('0x2a')](function(_0xc5c172){_0x22f35c=0x1f4;logger['error'](_0xc5c172['stack']);if(_0xc5c172['name']){delete _0xc5c172[_0xdc2f('0x3b')];}_0x18712f=_0xc5c172;})['finally'](function(){if(_0x18712f===null){_0x2a4719[_0xdc2f('0x2b')](_0x22f35c);}else{if(_0x22f35c===0x1f4){_0x2a4719['status'](_0x22f35c)[_0xdc2f('0x3c')](_0x18712f);}else{_0x2a4719[_0xdc2f('0x2d')](_0x22f35c)[_0xdc2f('0x2e')](_0x18712f);}}});};exports['getApplications']=function(_0x4534a6,_0x5d20a8,_0x32f46c){var _0x464eff={};var _0x469184={};var _0x46ab11;var _0x4370e4;return db[_0xdc2f('0x52')][_0xdc2f('0x66')]({'where':{'id':_0x4534a6[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x5d20a8,null))[_0xdc2f('0x1f')](function(_0x259cbc){if(_0x259cbc){_0x46ab11=_0x259cbc;_0x469184['model']=_[_0xdc2f('0x58')](db['SmsApplication']['rawAttributes']);_0x469184[_0xdc2f('0x43')]=_[_0xdc2f('0x58')](_0x4534a6['query']);_0x469184['filters']=_['intersection'](_0x469184['model'],_0x469184[_0xdc2f('0x43')]);_0x464eff[_0xdc2f('0x45')]=_['intersection'](_0x469184['model'],qs['fields'](_0x4534a6['query']['fields']));_0x464eff['attributes']=_0x464eff[_0xdc2f('0x45')][_0xdc2f('0x49')]?_0x464eff[_0xdc2f('0x45')]:_0x469184[_0xdc2f('0x47')];_0x464eff[_0xdc2f('0x4b')]=qs['sort'](_0x4534a6[_0xdc2f('0x43')][_0xdc2f('0x4c')]);_0x464eff['where']=qs[_0xdc2f('0x44')](_['pick'](_0x4534a6[_0xdc2f('0x43')],_0x469184['filters']));if(_0x4534a6[_0xdc2f('0x43')]['filter']){_0x464eff[_0xdc2f('0x4d')]=_[_0xdc2f('0x50')](_0x464eff[_0xdc2f('0x4d')],{'$or':_[_0xdc2f('0x3f')](_0x464eff['attributes'],function(_0x1f6eab){var _0x5f150f={};_0x5f150f[_0x1f6eab]={'$like':'%'+_0x4534a6[_0xdc2f('0x43')]['filter']+'%'};return _0x5f150f;})});}_0x464eff=_[_0xdc2f('0x50')]({},_0x464eff,_0x4534a6[_0xdc2f('0x51')]);return _0x46ab11['getApplications'](_0x464eff);}})['then'](function(_0x48904c){if(_0x48904c){_0x4370e4=_0x48904c[_0xdc2f('0x49')];if(!_0x4534a6[_0xdc2f('0x43')][_0xdc2f('0x67')](_0xdc2f('0x4a'))){_0x464eff[_0xdc2f('0x32')]=qs[_0xdc2f('0x32')](_0x4534a6[_0xdc2f('0x43')]['limit']);_0x464eff[_0xdc2f('0x30')]=qs['offset'](_0x4534a6[_0xdc2f('0x43')][_0xdc2f('0x30')]);}return _0x46ab11[_0xdc2f('0xbe')](_0x464eff);}})['then'](function(_0x5b2c3f){if(_0x5b2c3f){return _0x5b2c3f?{'count':_0x4370e4,'rows':_0x5b2c3f}:null;}})[_0xdc2f('0x1f')](respondWithResult(_0x5d20a8,null))[_0xdc2f('0x2a')](handleError(_0x5d20a8,null));};exports[_0xdc2f('0xbf')]=function(_0x15875a,_0x4fe67c,_0x3179b9){var _0x27bb73={'raw':![],'where':{}};var _0x406ee2={};var _0x92d631={'count':0x0,'rows':[]};return db[_0xdc2f('0x52')]['findOne']({'where':{'id':_0x15875a[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x4fe67c,null))[_0xdc2f('0x1f')](function(_0x352a36){if(_0x352a36){_0x406ee2[_0xdc2f('0x47')]=_[_0xdc2f('0x58')](db['SmsInteraction'][_0xdc2f('0x40')]);_0x406ee2[_0xdc2f('0x43')]=_[_0xdc2f('0x58')](_0x15875a[_0xdc2f('0x43')]);_0x406ee2['filters']=_[_0xdc2f('0x46')](_0x406ee2[_0xdc2f('0x47')],_0x406ee2[_0xdc2f('0x43')]);_0x27bb73[_0xdc2f('0x45')]=_[_0xdc2f('0x46')](_0x406ee2['model'],qs[_0xdc2f('0x48')](_0x15875a['query']['fields']));_0x27bb73[_0xdc2f('0x45')]=_0x27bb73['attributes'][_0xdc2f('0x49')]?_0x27bb73[_0xdc2f('0x45')]:_0x406ee2[_0xdc2f('0x47')];if(!_0x15875a[_0xdc2f('0x43')]['hasOwnProperty']('nolimit')){_0x27bb73[_0xdc2f('0x32')]=qs['limit'](_0x15875a['query'][_0xdc2f('0x32')]);_0x27bb73[_0xdc2f('0x30')]=qs[_0xdc2f('0x30')](_0x15875a[_0xdc2f('0x43')][_0xdc2f('0x30')]);}_0x27bb73[_0xdc2f('0x4b')]=qs[_0xdc2f('0x4c')](_0x15875a[_0xdc2f('0x43')][_0xdc2f('0x4c')]);_0x27bb73[_0xdc2f('0x4d')]=qs[_0xdc2f('0x44')](_['pick'](_0x15875a['query'],_0x406ee2['filters']));_0x27bb73[_0xdc2f('0x4d')][_0xdc2f('0x63')]=_0x352a36['id'];if(_0x15875a[_0xdc2f('0x43')][_0xdc2f('0x4f')]){_0x27bb73[_0xdc2f('0x4d')]=_[_0xdc2f('0x50')](_0x27bb73[_0xdc2f('0x4d')],{'$or':_['map'](_0x27bb73[_0xdc2f('0x45')],function(_0x217917){var _0x53c01c={};_0x53c01c[_0x217917]={'$like':'%'+_0x15875a[_0xdc2f('0x43')][_0xdc2f('0x4f')]+'%'};return _0x53c01c;})});}_0x27bb73=_[_0xdc2f('0x50')]({},_0x27bb73,_0x15875a[_0xdc2f('0x51')]);return db[_0xdc2f('0xa0')][_0xdc2f('0x31')]({'where':_0x27bb73[_0xdc2f('0x4d')]})[_0xdc2f('0x1f')](function(_0xbc66d5){_0x92d631[_0xdc2f('0x31')]=_0xbc66d5;if(_0x15875a[_0xdc2f('0x43')][_0xdc2f('0x53')]){_0x27bb73[_0xdc2f('0x54')]=[{'model':db['CmContact'],'as':_0xdc2f('0xc0'),'required':![]},{'model':db[_0xdc2f('0xae')],'as':_0xdc2f('0xc1'),'attributes':[_0xdc2f('0x3b'),_0xdc2f('0xc2'),_0xdc2f('0xc3')],'required':![]},{'model':db[_0xdc2f('0xc4')],'as':_0xdc2f('0xc5'),'attributes':['id',_0xdc2f('0x3b'),_0xdc2f('0xc6')],'where':_0x15875a['query']['tag']?{'id':_0x15875a['query']['tag']}:undefined,'required':_0x15875a['query'][_0xdc2f('0xc7')]?!![]:![]}];}return db[_0xdc2f('0xa0')][_0xdc2f('0x55')](_0x27bb73);})[_0xdc2f('0x1f')](function(_0x3d7e34){_0x92d631[_0xdc2f('0x56')]=_0x3d7e34;return _0x92d631;});}})[_0xdc2f('0x1f')](respondWithFilteredResult(_0x4fe67c,_0x27bb73))[_0xdc2f('0x2a')](handleError(_0x4fe67c,null));};exports[_0xdc2f('0x3c')]=function(_0x1d9eb5,_0x45d7ff,_0x55c0b7){var _0x461003,_0x21821f,_0x509f76;if(_[_0xdc2f('0x93')](_0x1d9eb5[_0xdc2f('0x5a')][_0xdc2f('0x5a')])||_0x1d9eb5[_0xdc2f('0x5a')][_0xdc2f('0x5a')]===''){throw new db['Sequelize']['ValidationError'](_0xdc2f('0x95'));}if(_[_0xdc2f('0x93')](_0x1d9eb5['body']['to'])){throw new db[(_0xdc2f('0x94'))][(_0xdc2f('0x75'))](_0xdc2f('0xc8'));}_0x461003=_0x1d9eb5[_0xdc2f('0x5a')]['to'];return db['SmsAccount'][_0xdc2f('0x61')]({'where':{'id':_0x1d9eb5['params']['id']},'include':[{'model':db[_0xdc2f('0x99')],'as':_0xdc2f('0xc9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x461003},'limit':0x1,'order':[[_0xdc2f('0x79'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x45d7ff,null))[_0xdc2f('0x1f')](function(_0x1022a0){if(_0x1022a0&&_0x1022a0[_0xdc2f('0xc9')]){_0x21821f=_0x1022a0[_0xdc2f('0x38')]({'plain':!![]});if(_0x21821f[_0xdc2f('0xc9')]&&_0x21821f[_0xdc2f('0xc9')][_0xdc2f('0x9b')][_0xdc2f('0x49')]){return _0x21821f[_0xdc2f('0xc9')][_0xdc2f('0x9b')][0x0];}return db[_0xdc2f('0x9a')][_0xdc2f('0x59')](_[_0xdc2f('0x1a')](_0x1d9eb5[_0xdc2f('0x5a')],{'firstName':_0x461003,'mobile':_0x461003,'phone':_0x461003,'ListId':_0x21821f[_0xdc2f('0x7a')]}));}})['then'](handleEntityNotFound(_0x45d7ff,null))[_0xdc2f('0x1f')](function(_0x1d40d6){if(_0x1d40d6){_0x509f76=_0x1d40d6;return db[_0xdc2f('0xa0')][_0xdc2f('0x61')]({'where':{'ContactId':_0x509f76['id'],'closed':![],'SmsAccountId':_0x21821f['id']}})[_0xdc2f('0x1f')](function(_0x5a4cda){if(_0x5a4cda){return[_0x5a4cda,![]];}return db[_0xdc2f('0xa0')]['create']({'UserId':_0x1d9eb5[_0xdc2f('0x5b')]['id'],'ContactId':_0x509f76['id'],'SmsAccountId':_0x21821f['id'],'phone':_0x461003,'firstMsgDirection':_0xdc2f('0xca'),'Messages':[_[_0xdc2f('0x50')](_0x1d9eb5[_0xdc2f('0x5a')],{'read':![],'body':_0x1d9eb5['body']['body'],'phone':_0x461003,'SmsAccountId':_0x21821f['id'],'UserId':_0x1d9eb5['user']['id'],'ContactId':_0x509f76['id']})]},{'include':[{'model':db[_0xdc2f('0xa9')],'as':_0xdc2f('0xcb')}]})[_0xdc2f('0x1f')](function(_0x548607){return[_0x548607,!![]];});});}})[_0xdc2f('0xa1')](function(_0xda6928,_0x272b54){if(_0x272b54){return _0xda6928;}return db[_0xdc2f('0xa9')][_0xdc2f('0x59')](_[_0xdc2f('0x50')](_0x1d9eb5[_0xdc2f('0x5a')],{'read':![],'body':_0x1d9eb5[_0xdc2f('0x5a')][_0xdc2f('0x5a')],'phone':_0x461003,'SmsAccountId':_0x21821f['id'],'SmsInteractionId':_0xda6928['id'],'UserId':_0x1d9eb5[_0xdc2f('0x5b')]['id'],'ContactId':_0x509f76['id']}))[_0xdc2f('0x1f')](function(_0x5cf975){_0xda6928['dataValues'][_0xdc2f('0xcb')]=[];_0xda6928[_0xdc2f('0xcc')][_0xdc2f('0xcb')]['push'](_0x5cf975[_0xdc2f('0xcc')]);return _0xda6928;});})[_0xdc2f('0x1f')](respondWithResult(_0x45d7ff,null))[_0xdc2f('0x2a')](handleError(_0x45d7ff,null));};exports[_0xdc2f('0x2d')]=function(_0x42cb2b,_0x21f4b6,_0x3933a6){if(_0x42cb2b['body']['id']){delete _0x42cb2b[_0xdc2f('0x5a')]['id'];}var _0x2d4007,_0x25b151,_0x5645e1;return db[_0xdc2f('0x52')]['find']({'where':{'id':_0x42cb2b[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x21f4b6,null))[_0xdc2f('0x1f')](function(_0x10088e){if(_0x10088e){_0x5645e1=_0x10088e;logger[_0xdc2f('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdc2f('0x2d'),'received\x20delivery\x20report\x20from',_0x10088e['type'],util['inspect'](_0x42cb2b[_0xdc2f('0x5a')],{'showHidden':![],'depth':null}));switch(_0x10088e[_0xdc2f('0x7c')]){case _0xdc2f('0x80'):if(_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0xcd')]&&_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x2d')]){_0x25b151=_0x42cb2b[_0xdc2f('0x5a')]['status'];return db['SmsMessage'][_0xdc2f('0x61')]({'where':{'messageId':_0x42cb2b[_0xdc2f('0x5a')]['skebby_dispatch_id']}});}break;case _0xdc2f('0x83'):if(_0x42cb2b['body'][_0xdc2f('0xce')]&&_0x42cb2b[_0xdc2f('0x5a')]['statusInt']){_0x25b151=_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0xcf')];return db[_0xdc2f('0xa9')][_0xdc2f('0x61')]({'where':{'messageId':_0x42cb2b['body'][_0xdc2f('0xce')]}});}break;case _0xdc2f('0xd0'):if(_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x86')]&&_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0xd1')]){_0x25b151=_0x42cb2b['body'][_0xdc2f('0xd1')];return db[_0xdc2f('0xa9')][_0xdc2f('0x61')]({'where':{'messageId':_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x86')]}});}break;case'infobip':var _0x2f4d0a=_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x8b')][0x0];if(_0x2f4d0a[_0xdc2f('0x85')]&&_0x2f4d0a[_0xdc2f('0x2d')][_0xdc2f('0xd2')]==='DELIVERED'){_0x25b151=_0x2f4d0a[_0xdc2f('0x2d')]['groupName'];return db[_0xdc2f('0xa9')][_0xdc2f('0x61')]({'where':{'messageId':_0x2f4d0a[_0xdc2f('0x85')]}});}break;case _0xdc2f('0x8f'):if(_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x85')]&&_0x42cb2b['body']['status']){_0x25b151=_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x2d')];return db[_0xdc2f('0xa9')][_0xdc2f('0x61')]({'where':{'messageId':_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x85')]}});}break;case _0xdc2f('0x91'):if(_0x42cb2b[_0xdc2f('0x5a')][0x0][_0xdc2f('0x28')]['id']){_0x25b151=_0x42cb2b[_0xdc2f('0x5a')][0x0][_0xdc2f('0x7c')];return db[_0xdc2f('0xa9')][_0xdc2f('0x61')]({'where':{'messageId':_0x42cb2b[_0xdc2f('0x5a')][0x0][_0xdc2f('0x28')]['id']}});}break;case _0xdc2f('0xd3'):if(_0x42cb2b[_0xdc2f('0x5a')]['redif']&&_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0x2d')]){_0x25b151=_0x42cb2b['body'][_0xdc2f('0x2d')];return db[_0xdc2f('0xa9')][_0xdc2f('0x61')]({'where':{'messageId':_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0xd4')]}});}break;}}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x21f4b6,null))[_0xdc2f('0x1f')](function(_0x517501){if(_0x517501){_0x2d4007=_0x517501;switch(_0x5645e1[_0xdc2f('0x7c')]){case'skebby':if(_0x25b151===_0xdc2f('0xd5')){return _0x2d4007['update']({'read':!![]});}else{logger[_0xdc2f('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdc2f('0x2d'),_0xdc2f('0x80'),util[_0xdc2f('0xd6')](_0x42cb2b['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x25b151==='1'){return _0x2d4007[_0xdc2f('0x36')]({'read':!![]});}else{logger[_0xdc2f('0x26')](_0xdc2f('0x23'),_0xdc2f('0x2d'),_0xdc2f('0x80'),util[_0xdc2f('0xd6')](_0x42cb2b[_0xdc2f('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdc2f('0xd0'):if(!_0x42cb2b[_0xdc2f('0x5a')][_0xdc2f('0xd7')]&&_0x25b151>=0xc8&&_0x25b151<=0xce){return _0x2d4007[_0xdc2f('0x36')]({'read':!![]});}else{logger[_0xdc2f('0x26')](_0xdc2f('0x23'),_0xdc2f('0x2d'),_0xdc2f('0xd0'),util[_0xdc2f('0xd6')](_0x42cb2b[_0xdc2f('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x278469=_0x42cb2b['body'][_0xdc2f('0x8b')][0x0];if(_0x278469[_0xdc2f('0x2d')][_0xdc2f('0xd2')]===_0xdc2f('0xd5')){return _0x2d4007[_0xdc2f('0x36')]({'read':!![]});}else{logger[_0xdc2f('0x26')](_0xdc2f('0x23'),_0xdc2f('0x2d'),_0xdc2f('0x8a'),util[_0xdc2f('0xd6')](_0x42cb2b[_0xdc2f('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdc2f('0x8f'):if(_0x25b151==_0xdc2f('0xd8')||_0x25b151==_0xdc2f('0xd9')){return _0x2d4007['update']({'read':!![]});}else{logger['error'](_0xdc2f('0x23'),_0xdc2f('0x2d'),_0xdc2f('0x8f'),util[_0xdc2f('0xd6')](_0x42cb2b[_0xdc2f('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdc2f('0x91'):if(_0x25b151=='message-delivered'){return _0x2d4007['update']({'read':!![]});}else{logger['error'](_0xdc2f('0x23'),_0xdc2f('0x2d'),_0xdc2f('0x91'),util['inspect'](_0x42cb2b[_0xdc2f('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xdc2f('0xd3'):if(_0x25b151===_0xdc2f('0xda')||_0x25b151===_0xdc2f('0xdb')){return _0x2d4007[_0xdc2f('0x36')]({'read':!![]});}else{logger['error'](_0xdc2f('0x23'),_0xdc2f('0x2d'),_0xdc2f('0xd3'),util[_0xdc2f('0xd6')](_0x42cb2b[_0xdc2f('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x2d4007;}})[_0xdc2f('0x1f')](respondWithResult(_0x21f4b6,null))[_0xdc2f('0x2a')](handleError(_0x21f4b6,null));};exports[_0xdc2f('0xdc')]=function(_0x59a2b6,_0x1b2145,_0x2cc6e9){var _0x4df5a0,_0x24f2a3,_0x3f66e5;return db[_0xdc2f('0x52')][_0xdc2f('0x61')]({'where':{'id':_0x59a2b6[_0xdc2f('0x57')]['id']}})['then'](handleEntityNotFound(_0x1b2145,null))[_0xdc2f('0x1f')](function(_0x23f84a){if(_0x23f84a){_0x3f66e5=_0x23f84a;logger['debug'](_0xdc2f('0x23'),'status',_0xdc2f('0xdd'),_0x23f84a[_0xdc2f('0x7c')],util[_0xdc2f('0xd6')](_0x59a2b6[_0xdc2f('0x43')],{'showHidden':![],'depth':null}));switch(_0x23f84a[_0xdc2f('0x7c')]){case _0xdc2f('0x8c'):if(_0x59a2b6[_0xdc2f('0x43')][_0xdc2f('0xde')]&&_0x59a2b6['query']['state']){_0x24f2a3=_0x59a2b6[_0xdc2f('0x43')][_0xdc2f('0xdf')];return db[_0xdc2f('0xa9')][_0xdc2f('0x61')]({'where':{'messageId':_0x59a2b6[_0xdc2f('0x43')]['message-id']}});}break;}}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x1b2145,null))[_0xdc2f('0x1f')](function(_0xfc8a97){if(_0xfc8a97){_0x4df5a0=_0xfc8a97;switch(_0x3f66e5['type']){case _0xdc2f('0x8c'):if(_0x24f2a3==='2'||_0x24f2a3==='6'){return _0x4df5a0['update']({'read':!![]});}else{logger[_0xdc2f('0x26')](_0xdc2f('0x23'),_0xdc2f('0x2d'),'csc',util[_0xdc2f('0xd6')](_0x59a2b6[_0xdc2f('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x4df5a0;}})[_0xdc2f('0x1f')](respondWithResult(_0x1b2145,null))[_0xdc2f('0x2a')](handleError(_0x1b2145,null));};exports[_0xdc2f('0xe0')]=function(_0x57bc93,_0x2cf147,_0x4b69eb){return db['SmsAccount']['find']({'where':{'id':_0x57bc93[_0xdc2f('0x57')]['id']}})['then'](handleEntityNotFound(_0x2cf147,null))[_0xdc2f('0x1f')](function(_0x19966f){if(_0x19966f){return _0x19966f[_0xdc2f('0xe0')](_0x57bc93[_0xdc2f('0x5a')][_0xdc2f('0x69')],_['omit'](_0x57bc93[_0xdc2f('0x5a')],[_0xdc2f('0x69'),'id'])||{})[_0xdc2f('0xa1')](function(_0x1cdddd){for(var _0x5b048f=0x0;_0x5b048f<_0x57bc93['body'][_0xdc2f('0x69')]['length'];_0x5b048f+=0x1){socket[_0xdc2f('0xe1')](_0xdc2f('0xe2'),{'UserId':Number(_0x57bc93[_0xdc2f('0x5a')]['ids'][_0x5b048f]),'SmsAccountId':Number(_0x57bc93[_0xdc2f('0x57')]['id'])});}return _0x1cdddd;});}})[_0xdc2f('0x1f')](respondWithResult(_0x2cf147,null))[_0xdc2f('0x2a')](handleError(_0x2cf147,null));};exports['removeAgents']=function(_0x5eebd9,_0x4299a4,_0x2cc303){return db[_0xdc2f('0x52')]['find']({'where':{'id':_0x5eebd9[_0xdc2f('0x57')]['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x4299a4,null))[_0xdc2f('0x1f')](function(_0x214cd3){if(_0x214cd3){return _0x214cd3[_0xdc2f('0xe3')](_0x5eebd9['query'][_0xdc2f('0x69')])[_0xdc2f('0x1f')](function(){if(_[_0xdc2f('0xe4')](_0x5eebd9[_0xdc2f('0x43')][_0xdc2f('0x69')])){for(var _0x5c9358=0x0;_0x5c9358<_0x5eebd9[_0xdc2f('0x43')][_0xdc2f('0x69')][_0xdc2f('0x49')];_0x5c9358+=0x1){socket[_0xdc2f('0xe1')](_0xdc2f('0xe5'),{'UserId':Number(_0x5eebd9[_0xdc2f('0x43')]['ids'][_0x5c9358]),'SmsAccountId':Number(_0x5eebd9[_0xdc2f('0x57')]['id'])});}}else{socket[_0xdc2f('0xe1')](_0xdc2f('0xe5'),{'UserId':Number(_0x5eebd9[_0xdc2f('0x43')]['ids']),'SmsAccountId':Number(_0x5eebd9['params']['id'])});}});}})[_0xdc2f('0x1f')](respondWithStatusCode(_0x4299a4,null))[_0xdc2f('0x2a')](handleError(_0x4299a4,null));};exports[_0xdc2f('0xe6')]=function(_0x1702f8,_0x375ed7,_0x4001b7){var _0x510923={};var _0x4a932c={};var _0x11881e;var _0x3cd843;return db[_0xdc2f('0x52')][_0xdc2f('0x66')]({'where':{'id':_0x1702f8['params']['id']}})[_0xdc2f('0x1f')](handleEntityNotFound(_0x375ed7,null))[_0xdc2f('0x1f')](function(_0x25e0f6){if(_0x25e0f6){_0x11881e=_0x25e0f6;_0x4a932c[_0xdc2f('0x47')]=_[_0xdc2f('0x58')](db['User']['rawAttributes']);_0x4a932c[_0xdc2f('0x43')]=_[_0xdc2f('0x58')](_0x1702f8['query']);_0x4a932c[_0xdc2f('0x44')]=_[_0xdc2f('0x46')](_0x4a932c[_0xdc2f('0x47')],_0x4a932c['query']);_0x510923[_0xdc2f('0x45')]=_[_0xdc2f('0x46')](_0x4a932c[_0xdc2f('0x47')],qs[_0xdc2f('0x48')](_0x1702f8[_0xdc2f('0x43')][_0xdc2f('0x48')]));_0x510923[_0xdc2f('0x45')]=_0x510923[_0xdc2f('0x45')][_0xdc2f('0x49')]?_0x510923['attributes']:_0x4a932c[_0xdc2f('0x47')];_0x510923[_0xdc2f('0x4b')]=qs[_0xdc2f('0x4c')](_0x1702f8[_0xdc2f('0x43')][_0xdc2f('0x4c')]);_0x510923[_0xdc2f('0x4d')]=qs[_0xdc2f('0x44')](_[_0xdc2f('0x4e')](_0x1702f8[_0xdc2f('0x43')],_0x4a932c[_0xdc2f('0x44')]));if(_0x1702f8['query']['filter']){_0x510923['where']=_[_0xdc2f('0x50')](_0x510923[_0xdc2f('0x4d')],{'$or':_['map'](_0x510923[_0xdc2f('0x45')],function(_0xb0b9f9){var _0x1b70f8={};_0x1b70f8[_0xb0b9f9]={'$like':'%'+_0x1702f8[_0xdc2f('0x43')]['filter']+'%'};return _0x1b70f8;})});}_0x510923=_['merge']({},_0x510923,_0x1702f8['options']);return _0x11881e[_0xdc2f('0xe6')](_0x510923);}})[_0xdc2f('0x1f')](function(_0x57fbee){if(_0x57fbee){_0x3cd843=_0x57fbee[_0xdc2f('0x49')];if(!_0x1702f8['query']['hasOwnProperty'](_0xdc2f('0x4a'))){_0x510923[_0xdc2f('0x32')]=qs['limit'](_0x1702f8['query'][_0xdc2f('0x32')]);_0x510923['offset']=qs['offset'](_0x1702f8['query'][_0xdc2f('0x30')]);}return _0x11881e[_0xdc2f('0xe6')](_0x510923);}})[_0xdc2f('0x1f')](function(_0x110596){if(_0x110596){return _0x110596?{'count':_0x3cd843,'rows':_0x110596}:null;}})[_0xdc2f('0x1f')](respondWithResult(_0x375ed7,null))['catch'](handleError(_0x375ed7,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 0c1469a..8636a5e 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 _0x9a56=['hasOwnProperty','exports','events','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x1d50a3,_0x3213ff){var _0x4d8902=function(_0x79d1ba){while(--_0x79d1ba){_0x1d50a3['push'](_0x1d50a3['shift']());}};_0x4d8902(++_0x3213ff);}(_0x9a56,0x1df));var _0x69a5=function(_0x33ff2a,_0x2a475a){_0x33ff2a=_0x33ff2a-0x0;var _0x5781c1=_0x9a56[_0x33ff2a];return _0x5781c1;};'use strict';var EventEmitter=require(_0x69a5('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x69a5('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x69a5('0x2')](0x0);var events={'afterCreate':_0x69a5('0x3'),'afterUpdate':_0x69a5('0x4'),'afterDestroy':_0x69a5('0x5')};function emitEvent(_0x58915e){return function(_0x3a8859,_0x3f913c,_0xeff13c){SmsAccountEvents[_0x69a5('0x6')](_0x58915e+':'+_0x3a8859['id'],_0x3a8859);SmsAccountEvents['emit'](_0x58915e,_0x3a8859);_0xeff13c(null);};}for(var e in events){if(events[_0x69a5('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x69a5('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x6896=['emit','hasOwnProperty','hook','SmsAccount','setMaxListeners','save','update','remove'];(function(_0xa4938d,_0x56b190){var _0x27c150=function(_0x1ddc13){while(--_0x1ddc13){_0xa4938d['push'](_0xa4938d['shift']());}};_0x27c150(++_0x56b190);}(_0x6896,0x17b));var _0x6689=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6896[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0x6689('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6689('0x1')](0x0);var events={'afterCreate':_0x6689('0x2'),'afterUpdate':_0x6689('0x3'),'afterDestroy':_0x6689('0x4')};function emitEvent(_0x8c470c){return function(_0x5f26fc,_0x20987c,_0x216a81){SmsAccountEvents[_0x6689('0x5')](_0x8c470c+':'+_0x5f26fc['id'],_0x5f26fc);SmsAccountEvents[_0x6689('0x5')](_0x8c470c,_0x5f26fc);_0x216a81(null);};}for(var e in events){if(events[_0x6689('0x6')](e)){var event=events[e];SmsAccount[_0x6689('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 74ac799..f2392bf 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 _0x371f=['sms_accounts','lodash','util','api','moment','path','rimraf','exports'];(function(_0x17e759,_0x277900){var _0x241b54=function(_0x32e18e){while(--_0x32e18e){_0x17e759['push'](_0x17e759['shift']());}};_0x241b54(++_0x277900);}(_0x371f,0x169));var _0xf371=function(_0x28db56,_0x3c49b0){_0x28db56=_0x28db56-0x0;var _0x2a5e97=_0x371f[_0x28db56];return _0x2a5e97;};'use strict';var _=require(_0xf371('0x0'));var util=require(_0xf371('0x1'));var logger=require('../../config/logger')(_0xf371('0x2'));var moment=require(_0xf371('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf371('0x4'));var rimraf=require(_0xf371('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0xf371('0x6')]=function(_0x5cbff5,_0x17c944){return _0x5cbff5['define']('SmsAccount',attributes,{'tableName':_0xf371('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a30=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x2be64a,_0x59cefb){var _0x47bcac=function(_0x4ba950){while(--_0x4ba950){_0x2be64a['push'](_0x2be64a['shift']());}};_0x47bcac(++_0x59cefb);}(_0x8a30,0x15c));var _0x08a3=function(_0x5d2e00,_0x1bf91e){_0x5d2e00=_0x5d2e00-0x0;var _0x2fd804=_0x8a30[_0x5d2e00];return _0x2fd804;};'use strict';var _=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var logger=require(_0x08a3('0x2'))('api');var moment=require(_0x08a3('0x3'));var BPromise=require(_0x08a3('0x4'));var rp=require(_0x08a3('0x5'));var fs=require('fs');var path=require(_0x08a3('0x6'));var rimraf=require(_0x08a3('0x7'));var config=require(_0x08a3('0x8'));var attributes=require(_0x08a3('0x9'));module[_0x08a3('0xa')]=function(_0x5832d8,_0x3ebd3f){return _0x5832d8['define'](_0x08a3('0xb'),attributes,{'tableName':_0x08a3('0xc'),'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 d1392d9..7c65a40 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 _0x4532=['register','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2cbf3f,_0x1dd8dd){var _0x4afb10=function(_0x31382b){while(--_0x31382b){_0x2cbf3f['push'](_0x2cbf3f['shift']());}};_0x4afb10(++_0x1dd8dd);}(_0x4532,0x1ad));var _0x2453=function(_0x34fe58,_0x31ffe6){_0x34fe58=_0x34fe58-0x0;var _0x33be63=_0x4532[_0x34fe58];return _0x33be63;};'use strict';var _=require(_0x2453('0x0'));var util=require(_0x2453('0x1'));var moment=require(_0x2453('0x2'));var BPromise=require('bluebird');var rs=require(_0x2453('0x3'));var fs=require('fs');var Redis=require(_0x2453('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2453('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2453('0x6'));var jayson=require(_0x2453('0x7'));var client=jayson[_0x2453('0x8')][_0x2453('0x9')]({'port':0x232a});config[_0x2453('0xa')]=_[_0x2453('0xb')](config[_0x2453('0xa')],{'host':_0x2453('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2453('0xa')]));require('./smsAccount.socket')[_0x2453('0xd')](socket);function respondWithRpcPromise(_0x4a9cb5,_0x1f83d6,_0xbbe375){return new BPromise(function(_0x58a028,_0x68beac){return client['request'](_0x4a9cb5,_0xbbe375)['then'](function(_0x129dce){logger[_0x2453('0xe')](_0x2453('0xf'),_0x1f83d6,_0x2453('0x10'));logger[_0x2453('0x11')](_0x2453('0x12'),_0x1f83d6,_0x2453('0x10'),JSON[_0x2453('0x13')](_0x129dce));if(_0x129dce[_0x2453('0x14')]){if(_0x129dce[_0x2453('0x14')][_0x2453('0x15')]===0x1f4){logger[_0x2453('0x14')]('SmsAccount,\x20%s,\x20%s',_0x1f83d6,_0x129dce[_0x2453('0x14')][_0x2453('0x16')]);return _0x68beac(_0x129dce[_0x2453('0x14')][_0x2453('0x16')]);}logger[_0x2453('0x14')](_0x2453('0xf'),_0x1f83d6,_0x129dce['error'][_0x2453('0x16')]);return _0x58a028(_0x129dce[_0x2453('0x14')][_0x2453('0x16')]);}else{logger[_0x2453('0xe')](_0x2453('0xf'),_0x1f83d6,_0x2453('0x10'));_0x58a028(_0x129dce[_0x2453('0x17')][_0x2453('0x16')]);}})[_0x2453('0x18')](function(_0x2455e4){logger[_0x2453('0x14')](_0x2453('0xf'),_0x1f83d6,_0x2455e4);_0x68beac(_0x2455e4);});});}exports[_0x2453('0x19')]=function(_0x2129ce){var _0x51acf9=this;return new Promise(function(_0x5b4aa2,_0xa1b351){return db[_0x2453('0x1a')]['find']({'raw':_0x2129ce[_0x2453('0x1b')]?_0x2129ce[_0x2453('0x1b')][_0x2453('0x1c')]===undefined?!![]:![]:!![],'where':_0x2129ce[_0x2453('0x1b')]?_0x2129ce[_0x2453('0x1b')][_0x2453('0x1d')]||null:null,'attributes':_0x2129ce[_0x2453('0x1b')]?_0x2129ce[_0x2453('0x1b')][_0x2453('0x1e')]||null:null,'include':_0x2129ce[_0x2453('0x1b')]?_0x2129ce[_0x2453('0x1b')][_0x2453('0x1f')]?_[_0x2453('0x20')](_0x2129ce['options']['include'],function(_0x55b383){return{'model':db[_0x55b383[_0x2453('0x21')]],'as':_0x55b383['as'],'attributes':_0x55b383[_0x2453('0x1e')],'include':_0x55b383[_0x2453('0x1f')]?_[_0x2453('0x20')](_0x55b383[_0x2453('0x1f')],function(_0x5b2511){return{'model':db[_0x5b2511[_0x2453('0x21')]],'as':_0x5b2511['as'],'attributes':_0x5b2511[_0x2453('0x1e')],'include':_0x5b2511[_0x2453('0x1f')]?_['map'](_0x5b2511[_0x2453('0x1f')],function(_0x284907){return{'model':db[_0x284907[_0x2453('0x21')]],'as':_0x284907['as'],'attributes':_0x284907['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bc229){logger[_0x2453('0xe')](_0x2453('0x19'),_0x2129ce);logger[_0x2453('0x11')](_0x2453('0x19'),_0x2129ce,JSON[_0x2453('0x13')](_0x2bc229));_0x5b4aa2(_0x2bc229);})[_0x2453('0x18')](function(_0x4ac77e){logger[_0x2453('0x14')](_0x2453('0x19'),_0x4ac77e['message'],_0x2129ce);_0xa1b351(_0x51acf9[_0x2453('0x14')](0x1f4,_0x4ac77e['message']));});});}; \ No newline at end of file +var _0x2dae=['map','model','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include'];(function(_0x5500b2,_0xc9a0a5){var _0x580f8e=function(_0x9cd8ad){while(--_0x9cd8ad){_0x5500b2['push'](_0x5500b2['shift']());}};_0x580f8e(++_0xc9a0a5);}(_0x2dae,0x13c));var _0xe2da=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x2dae[_0x133277];return _0x5b4a22;};'use strict';var _=require('lodash');var util=require(_0xe2da('0x0'));var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require(_0xe2da('0x6'));var logger=require(_0xe2da('0x7'))('rpc');var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson[_0xe2da('0xa')][_0xe2da('0xb')]({'port':0x232a});config['redis']=_[_0xe2da('0xc')](config[_0xe2da('0xd')],{'host':_0xe2da('0xe'),'port':0x18eb});var socket=require(_0xe2da('0xf'))(new Redis(config['redis']));require(_0xe2da('0x10'))[_0xe2da('0x11')](socket);function respondWithRpcPromise(_0x3564a2,_0xfe4ae4,_0x705d4e){return new BPromise(function(_0x17610a,_0x2e658a){return client[_0xe2da('0x12')](_0x3564a2,_0x705d4e)['then'](function(_0x54f8fa){logger[_0xe2da('0x13')](_0xe2da('0x14'),_0xfe4ae4,_0xe2da('0x15'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe4ae4,_0xe2da('0x15'),JSON[_0xe2da('0x16')](_0x54f8fa));if(_0x54f8fa[_0xe2da('0x17')]){if(_0x54f8fa[_0xe2da('0x17')]['code']===0x1f4){logger[_0xe2da('0x17')]('SmsAccount,\x20%s,\x20%s',_0xfe4ae4,_0x54f8fa['error'][_0xe2da('0x18')]);return _0x2e658a(_0x54f8fa[_0xe2da('0x17')][_0xe2da('0x18')]);}logger['error'](_0xe2da('0x14'),_0xfe4ae4,_0x54f8fa[_0xe2da('0x17')][_0xe2da('0x18')]);return _0x17610a(_0x54f8fa[_0xe2da('0x17')][_0xe2da('0x18')]);}else{logger['info'](_0xe2da('0x14'),_0xfe4ae4,_0xe2da('0x15'));_0x17610a(_0x54f8fa[_0xe2da('0x19')][_0xe2da('0x18')]);}})[_0xe2da('0x1a')](function(_0x366451){logger[_0xe2da('0x17')]('SmsAccount,\x20%s,\x20%s',_0xfe4ae4,_0x366451);_0x2e658a(_0x366451);});});}exports[_0xe2da('0x1b')]=function(_0x4ac8f5){var _0x124caa=this;return new Promise(function(_0x4b1546,_0x511d24){return db[_0xe2da('0x1c')][_0xe2da('0x1d')]({'raw':_0x4ac8f5[_0xe2da('0x1e')]?_0x4ac8f5[_0xe2da('0x1e')][_0xe2da('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ac8f5[_0xe2da('0x1e')]?_0x4ac8f5['options'][_0xe2da('0x20')]||null:null,'attributes':_0x4ac8f5[_0xe2da('0x1e')]?_0x4ac8f5['options'][_0xe2da('0x21')]||null:null,'include':_0x4ac8f5[_0xe2da('0x1e')]?_0x4ac8f5[_0xe2da('0x1e')][_0xe2da('0x22')]?_[_0xe2da('0x23')](_0x4ac8f5[_0xe2da('0x1e')][_0xe2da('0x22')],function(_0x1b5dcd){return{'model':db[_0x1b5dcd['model']],'as':_0x1b5dcd['as'],'attributes':_0x1b5dcd[_0xe2da('0x21')],'include':_0x1b5dcd[_0xe2da('0x22')]?_[_0xe2da('0x23')](_0x1b5dcd[_0xe2da('0x22')],function(_0x3ce2e8){return{'model':db[_0x3ce2e8[_0xe2da('0x24')]],'as':_0x3ce2e8['as'],'attributes':_0x3ce2e8[_0xe2da('0x21')],'include':_0x3ce2e8['include']?_[_0xe2da('0x23')](_0x3ce2e8[_0xe2da('0x22')],function(_0x373b2c){return{'model':db[_0x373b2c[_0xe2da('0x24')]],'as':_0x373b2c['as'],'attributes':_0x373b2c[_0xe2da('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe2da('0x25')](function(_0x5660e9){logger[_0xe2da('0x13')]('ShowSmsAccount',_0x4ac8f5);logger[_0xe2da('0x26')]('ShowSmsAccount',_0x4ac8f5,JSON[_0xe2da('0x16')](_0x5660e9));_0x4b1546(_0x5660e9);})[_0xe2da('0x1a')](function(_0x18f080){logger['error'](_0xe2da('0x1b'),_0x18f080[_0xe2da('0x18')],_0x4ac8f5);_0x511d24(_0x124caa['error'](0x1f4,_0x18f080[_0xe2da('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index db7b79a..6ef2be1 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 d1b9bca..f811e4c 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x18870a,_0x295a40){var _0x4ca1c1=function(_0x27f06b){while(--_0x27f06b){_0x18870a['push'](_0x18870a['shift']());}};_0x4ca1c1(++_0x295a40);}(_0xedd9,0xfc));var _0x9edd=function(_0xc1c0a,_0x32cee7){_0xc1c0a=_0xc1c0a-0x0;var _0xae4d95=_0xedd9[_0xc1c0a];return _0xae4d95;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x5a0349,_0xaa3aac){var _0x2b3020=function(_0x3fd692){while(--_0x3fd692){_0x5a0349['push'](_0x5a0349['shift']());}};_0x2b3020(++_0xaa3aac);}(_0x3e74,0x175));var _0x43e7=function(_0xd2b5d5,_0x433198){_0xd2b5d5=_0xd2b5d5-0x0;var _0x164fbc=_0x3e74[_0xd2b5d5];return _0x164fbc;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index d5cc8aa..eb23913 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 _0xb56e=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xa1b74d,_0x614e6f){var _0x56bad4=function(_0x29795c){while(--_0x29795c){_0xa1b74d['push'](_0xa1b74d['shift']());}};_0x56bad4(++_0x614e6f);}(_0xb56e,0xa4));var _0xeb56=function(_0x177c55,_0x148cf2){_0x177c55=_0x177c55-0x0;var _0x42f0f6=_0xb56e[_0x177c55];return _0x42f0f6;};'use strict';var Sequelize=require(_0xeb56('0x0'));module[_0xeb56('0x1')]={'priority':{'type':Sequelize[_0xeb56('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xeb56('0x3')],'allowNull':![],'defaultValue':_0xeb56('0x4')},'appdata':{'type':Sequelize[_0xeb56('0x5')]()},'description':{'type':Sequelize[_0xeb56('0x3')]},'interval':{'type':Sequelize[_0xeb56('0x3')],'defaultValue':_0xeb56('0x6')}}; \ No newline at end of file +var _0x4c77=['INTEGER','noop','STRING','*,*,*,*','exports'];(function(_0x5d6193,_0x13e0be){var _0x238207=function(_0x533d1a){while(--_0x533d1a){_0x5d6193['push'](_0x5d6193['shift']());}};_0x238207(++_0x13e0be);}(_0x4c77,0x1cb));var _0x74c7=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4c77[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0x74c7('0x0')]={'priority':{'type':Sequelize[_0x74c7('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x74c7('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x74c7('0x3')]},'interval':{'type':Sequelize[_0x74c7('0x3')],'defaultValue':_0x74c7('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 8bec7a8..e3a4fd3 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 _0x0d47=['SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','pick','filter','where','merge','type','VIRTUAL','options','then','includeAll','findAll','show','params','length','include','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','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','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','error','name','send','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d47,0x1f4));var _0x70d4=function(_0x3a0d51,_0x207da6){_0x3a0d51=_0x3a0d51-0x0;var _0x46c7d0=_0x0d47[_0x3a0d51];return _0x46c7d0;};'use strict';var emlformat=require(_0x70d4('0x0'));var rimraf=require(_0x70d4('0x1'));var zipdir=require(_0x70d4('0x2'));var jsonpatch=require(_0x70d4('0x3'));var rp=require(_0x70d4('0x4'));var moment=require(_0x70d4('0x5'));var BPromise=require(_0x70d4('0x6'));var Mustache=require(_0x70d4('0x7'));var util=require(_0x70d4('0x8'));var path=require(_0x70d4('0x9'));var sox=require(_0x70d4('0xa'));var csv=require('to-csv');var ejs=require(_0x70d4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70d4('0xc'));var squel=require(_0x70d4('0xd'));var crypto=require(_0x70d4('0xe'));var jsforce=require(_0x70d4('0xf'));var deskjs=require(_0x70d4('0x10'));var toCsv=require(_0x70d4('0x11'));var querystring=require(_0x70d4('0x12'));var Papa=require(_0x70d4('0x13'));var Redis=require(_0x70d4('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x70d4('0x15'));var hardwareService=require(_0x70d4('0x16'));var logger=require(_0x70d4('0x17'))(_0x70d4('0x18'));var utils=require(_0x70d4('0x19'));var config=require(_0x70d4('0x1a'));var licenseUtil=require(_0x70d4('0x1b'));var db=require(_0x70d4('0x1c'))['db'];function respondWithStatusCode(_0x3f03d6,_0x260ea3){_0x260ea3=_0x260ea3||0xcc;return function(_0x55b73d){if(_0x55b73d){return _0x3f03d6['sendStatus'](_0x260ea3);}return _0x3f03d6[_0x70d4('0x1d')](_0x260ea3)[_0x70d4('0x1e')]();};}function respondWithResult(_0x3345ca,_0x9c8407){_0x9c8407=_0x9c8407||0xc8;return function(_0x130390){if(_0x130390){return _0x3345ca['status'](_0x9c8407)[_0x70d4('0x1f')](_0x130390);}};}function respondWithFilteredResult(_0x27841d,_0xa9b8fb){return function(_0x490f9f){if(_0x490f9f){var _0x4ba888=typeof _0xa9b8fb[_0x70d4('0x20')]===_0x70d4('0x21')&&typeof _0xa9b8fb['limit']==='undefined';var _0x183248=_0x490f9f[_0x70d4('0x22')];var _0x32bcaf=_0x4ba888?0x0:_0xa9b8fb[_0x70d4('0x20')];var _0x429016=_0x4ba888?_0x490f9f['count']:_0xa9b8fb['offset']+_0xa9b8fb['limit'];var _0x2f6404;if(_0x429016>=_0x183248){_0x429016=_0x183248;_0x2f6404=0xc8;}else{_0x2f6404=0xce;}_0x27841d[_0x70d4('0x1d')](_0x2f6404);return _0x27841d[_0x70d4('0x23')](_0x70d4('0x24'),_0x32bcaf+'-'+_0x429016+'/'+_0x183248)[_0x70d4('0x1f')](_0x490f9f);}return null;};}function patchUpdates(_0x5da02b){return function(_0x16d6f2){try{jsonpatch['apply'](_0x16d6f2,_0x5da02b,!![]);}catch(_0x215d59){return BPromise[_0x70d4('0x25')](_0x215d59);}return _0x16d6f2[_0x70d4('0x26')]();};}function saveUpdates(_0x1057a8,_0x4f0963){return function(_0x1fbe7c){if(_0x1fbe7c){return _0x1fbe7c[_0x70d4('0x27')](_0x1057a8)['then'](function(_0x1d49b1){return _0x1d49b1;});}return null;};}function removeEntity(_0x272ff3,_0x48f542){return function(_0x3d30dc){if(_0x3d30dc){return _0x3d30dc[_0x70d4('0x28')]()['then'](function(){_0x272ff3['status'](0xcc)[_0x70d4('0x1e')]();});}};}function handleEntityNotFound(_0xfbf70a,_0x2a20f5){return function(_0xd3fba1){if(!_0xd3fba1){_0xfbf70a['sendStatus'](0x194);}return _0xd3fba1;};}function handleError(_0x380db1,_0x4fae8e){_0x4fae8e=_0x4fae8e||0x1f4;return function(_0xd1315c){logger[_0x70d4('0x29')](_0xd1315c['stack']);if(_0xd1315c[_0x70d4('0x2a')]){delete _0xd1315c[_0x70d4('0x2a')];}_0x380db1[_0x70d4('0x1d')](_0x4fae8e)[_0x70d4('0x2b')](_0xd1315c);};}exports[_0x70d4('0x2c')]=function(_0x3d304b,_0x242225){var _0x53703f={},_0x4b7e11={},_0x3f8c6e={'count':0x0,'rows':[]};var _0x46231b=_[_0x70d4('0x2d')](db[_0x70d4('0x2e')][_0x70d4('0x2f')],function(_0x52f2c9){return{'name':_0x52f2c9[_0x70d4('0x30')],'type':_0x52f2c9['type'][_0x70d4('0x31')]};});_0x4b7e11[_0x70d4('0x32')]=_['map'](_0x46231b,'name');_0x4b7e11[_0x70d4('0x33')]=_[_0x70d4('0x34')](_0x3d304b['query']);_0x4b7e11[_0x70d4('0x35')]=_[_0x70d4('0x36')](_0x4b7e11[_0x70d4('0x32')],_0x4b7e11[_0x70d4('0x33')]);_0x53703f[_0x70d4('0x37')]=_[_0x70d4('0x36')](_0x4b7e11['model'],qs[_0x70d4('0x38')](_0x3d304b[_0x70d4('0x33')][_0x70d4('0x38')]));_0x53703f[_0x70d4('0x37')]=_0x53703f[_0x70d4('0x37')]['length']?_0x53703f[_0x70d4('0x37')]:_0x4b7e11[_0x70d4('0x32')];if(!_0x3d304b['query'][_0x70d4('0x39')]('nolimit')){_0x53703f['limit']=qs[_0x70d4('0x3a')](_0x3d304b['query']['limit']);_0x53703f[_0x70d4('0x20')]=qs[_0x70d4('0x20')](_0x3d304b[_0x70d4('0x33')]['offset']);}_0x53703f['order']=qs[_0x70d4('0x3b')](_0x3d304b[_0x70d4('0x33')][_0x70d4('0x3b')]);_0x53703f['where']=qs[_0x70d4('0x35')](_[_0x70d4('0x3c')](_0x3d304b[_0x70d4('0x33')],_0x4b7e11[_0x70d4('0x35')]),_0x46231b);if(_0x3d304b[_0x70d4('0x33')][_0x70d4('0x3d')]){_0x53703f[_0x70d4('0x3e')]=_[_0x70d4('0x3f')](_0x53703f[_0x70d4('0x3e')],{'$or':_[_0x70d4('0x2d')](_0x46231b,function(_0x3726c9){if(_0x3726c9[_0x70d4('0x40')]!==_0x70d4('0x41')){var _0x4432de={};_0x4432de[_0x3726c9[_0x70d4('0x2a')]]={'$like':'%'+_0x3d304b[_0x70d4('0x33')]['filter']+'%'};return _0x4432de;}})});}_0x53703f=_['merge']({},_0x53703f,_0x3d304b[_0x70d4('0x42')]);var _0x4685e8={'where':_0x53703f[_0x70d4('0x3e')]};return db[_0x70d4('0x2e')][_0x70d4('0x22')](_0x4685e8)[_0x70d4('0x43')](function(_0x11d819){_0x3f8c6e[_0x70d4('0x22')]=_0x11d819;if(_0x3d304b[_0x70d4('0x33')][_0x70d4('0x44')]){_0x53703f['include']=[{'all':!![]}];}return db[_0x70d4('0x2e')][_0x70d4('0x45')](_0x53703f);})[_0x70d4('0x43')](function(_0x512a6d){_0x3f8c6e['rows']=_0x512a6d;return _0x3f8c6e;})['then'](respondWithFilteredResult(_0x242225,_0x53703f))['catch'](handleError(_0x242225,null));};exports[_0x70d4('0x46')]=function(_0x4aa6a8,_0x2e6d11){var _0xda1c94={'raw':!![],'where':{'id':_0x4aa6a8[_0x70d4('0x47')]['id']}},_0x1b5177={};_0x1b5177[_0x70d4('0x32')]=_[_0x70d4('0x34')](db[_0x70d4('0x2e')]['rawAttributes']);_0x1b5177[_0x70d4('0x33')]=_[_0x70d4('0x34')](_0x4aa6a8[_0x70d4('0x33')]);_0x1b5177[_0x70d4('0x35')]=_[_0x70d4('0x36')](_0x1b5177[_0x70d4('0x32')],_0x1b5177[_0x70d4('0x33')]);_0xda1c94[_0x70d4('0x37')]=_[_0x70d4('0x36')](_0x1b5177[_0x70d4('0x32')],qs[_0x70d4('0x38')](_0x4aa6a8[_0x70d4('0x33')][_0x70d4('0x38')]));_0xda1c94[_0x70d4('0x37')]=_0xda1c94[_0x70d4('0x37')][_0x70d4('0x48')]?_0xda1c94['attributes']:_0x1b5177['model'];if(_0x4aa6a8[_0x70d4('0x33')]['includeAll']){_0xda1c94[_0x70d4('0x49')]=[{'all':!![]}];}_0xda1c94=_['merge']({},_0xda1c94,_0x4aa6a8[_0x70d4('0x42')]);return db['SmsApplication'][_0x70d4('0x4a')](_0xda1c94)[_0x70d4('0x43')](handleEntityNotFound(_0x2e6d11,null))[_0x70d4('0x43')](respondWithResult(_0x2e6d11,null))['catch'](handleError(_0x2e6d11,null));};exports['create']=function(_0x36eb8a,_0x3dcb47){return db[_0x70d4('0x2e')][_0x70d4('0x4b')](_0x36eb8a[_0x70d4('0x4c')],{})[_0x70d4('0x43')](respondWithResult(_0x3dcb47,0xc9))[_0x70d4('0x4d')](handleError(_0x3dcb47,null));};exports['update']=function(_0x1ff424,_0x17bc5b){if(_0x1ff424['body']['id']){delete _0x1ff424[_0x70d4('0x4c')]['id'];}return db[_0x70d4('0x2e')][_0x70d4('0x4a')]({'where':{'id':_0x1ff424['params']['id']}})[_0x70d4('0x43')](handleEntityNotFound(_0x17bc5b,null))[_0x70d4('0x43')](saveUpdates(_0x1ff424[_0x70d4('0x4c')],null))[_0x70d4('0x43')](respondWithResult(_0x17bc5b,null))[_0x70d4('0x4d')](handleError(_0x17bc5b,null));};exports['destroy']=function(_0x26892a,_0x31a088){return db['SmsApplication']['find']({'where':{'id':_0x26892a['params']['id']}})[_0x70d4('0x43')](handleEntityNotFound(_0x31a088,null))[_0x70d4('0x43')](removeEntity(_0x31a088,null))['catch'](handleError(_0x31a088,null));}; \ No newline at end of file +var _0xde35=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','find','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x503226,_0x17b9c1){var _0x339b76=function(_0x257714){while(--_0x257714){_0x503226['push'](_0x503226['shift']());}};_0x339b76(++_0x17b9c1);}(_0xde35,0x170));var _0x5de3=function(_0x4a188d,_0x403e5b){_0x4a188d=_0x4a188d-0x0;var _0x3f216d=_0xde35[_0x4a188d];return _0x3f216d;};'use strict';var emlformat=require(_0x5de3('0x0'));var rimraf=require(_0x5de3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5de3('0x2'));var moment=require('moment');var BPromise=require(_0x5de3('0x3'));var Mustache=require('mustache');var util=require(_0x5de3('0x4'));var path=require(_0x5de3('0x5'));var sox=require(_0x5de3('0x6'));var csv=require(_0x5de3('0x7'));var ejs=require(_0x5de3('0x8'));var fs=require('fs');var fs_extra=require(_0x5de3('0x9'));var _=require(_0x5de3('0xa'));var squel=require(_0x5de3('0xb'));var crypto=require(_0x5de3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5de3('0xd'));var toCsv=require(_0x5de3('0x7'));var querystring=require(_0x5de3('0xe'));var Papa=require(_0x5de3('0xf'));var Redis=require('ioredis');var authService=require(_0x5de3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5de3('0x11'));var logger=require(_0x5de3('0x12'))(_0x5de3('0x13'));var utils=require(_0x5de3('0x14'));var config=require(_0x5de3('0x15'));var licenseUtil=require(_0x5de3('0x16'));var db=require(_0x5de3('0x17'))['db'];function respondWithStatusCode(_0x12deb2,_0x3e3b0f){_0x3e3b0f=_0x3e3b0f||0xcc;return function(_0x4cfb9d){if(_0x4cfb9d){return _0x12deb2['sendStatus'](_0x3e3b0f);}return _0x12deb2['status'](_0x3e3b0f)['end']();};}function respondWithResult(_0x501b8a,_0x5ee20f){_0x5ee20f=_0x5ee20f||0xc8;return function(_0x1db207){if(_0x1db207){return _0x501b8a[_0x5de3('0x18')](_0x5ee20f)[_0x5de3('0x19')](_0x1db207);}};}function respondWithFilteredResult(_0x49d289,_0x20da25){return function(_0x1367b5){if(_0x1367b5){var _0x4229b9=typeof _0x20da25[_0x5de3('0x1a')]===_0x5de3('0x1b')&&typeof _0x20da25[_0x5de3('0x1c')]==='undefined';var _0x128038=_0x1367b5['count'];var _0x487c69=_0x4229b9?0x0:_0x20da25['offset'];var _0x3924a3=_0x4229b9?_0x1367b5[_0x5de3('0x1d')]:_0x20da25[_0x5de3('0x1a')]+_0x20da25[_0x5de3('0x1c')];var _0x449e32;if(_0x3924a3>=_0x128038){_0x3924a3=_0x128038;_0x449e32=0xc8;}else{_0x449e32=0xce;}_0x49d289[_0x5de3('0x18')](_0x449e32);return _0x49d289[_0x5de3('0x1e')](_0x5de3('0x1f'),_0x487c69+'-'+_0x3924a3+'/'+_0x128038)[_0x5de3('0x19')](_0x1367b5);}return null;};}function patchUpdates(_0x30d8c0){return function(_0x5862f2){try{jsonpatch['apply'](_0x5862f2,_0x30d8c0,!![]);}catch(_0x25d8ed){return BPromise[_0x5de3('0x20')](_0x25d8ed);}return _0x5862f2[_0x5de3('0x21')]();};}function saveUpdates(_0x278eb9,_0x32c463){return function(_0x1dbb4b){if(_0x1dbb4b){return _0x1dbb4b[_0x5de3('0x22')](_0x278eb9)[_0x5de3('0x23')](function(_0x424c0c){return _0x424c0c;});}return null;};}function removeEntity(_0x4a3e1a,_0x36b197){return function(_0x2fb4ab){if(_0x2fb4ab){return _0x2fb4ab[_0x5de3('0x24')]()[_0x5de3('0x23')](function(){_0x4a3e1a[_0x5de3('0x18')](0xcc)[_0x5de3('0x25')]();});}};}function handleEntityNotFound(_0x57026b,_0x4567cc){return function(_0x5a3067){if(!_0x5a3067){_0x57026b[_0x5de3('0x26')](0x194);}return _0x5a3067;};}function handleError(_0x2a8bf0,_0x59d642){_0x59d642=_0x59d642||0x1f4;return function(_0xa794f2){logger[_0x5de3('0x27')](_0xa794f2[_0x5de3('0x28')]);if(_0xa794f2[_0x5de3('0x29')]){delete _0xa794f2['name'];}_0x2a8bf0[_0x5de3('0x18')](_0x59d642)[_0x5de3('0x2a')](_0xa794f2);};}exports['index']=function(_0x34c0e1,_0x240854){var _0x51de9e={},_0x5046af={},_0x370ae1={'count':0x0,'rows':[]};var _0x1ad99d=_[_0x5de3('0x2b')](db[_0x5de3('0x2c')][_0x5de3('0x2d')],function(_0x20751a){return{'name':_0x20751a[_0x5de3('0x2e')],'type':_0x20751a[_0x5de3('0x2f')][_0x5de3('0x30')]};});_0x5046af[_0x5de3('0x31')]=_[_0x5de3('0x2b')](_0x1ad99d,_0x5de3('0x29'));_0x5046af[_0x5de3('0x32')]=_[_0x5de3('0x33')](_0x34c0e1[_0x5de3('0x32')]);_0x5046af[_0x5de3('0x34')]=_['intersection'](_0x5046af[_0x5de3('0x31')],_0x5046af['query']);_0x51de9e[_0x5de3('0x35')]=_[_0x5de3('0x36')](_0x5046af[_0x5de3('0x31')],qs[_0x5de3('0x37')](_0x34c0e1['query'][_0x5de3('0x37')]));_0x51de9e[_0x5de3('0x35')]=_0x51de9e[_0x5de3('0x35')][_0x5de3('0x38')]?_0x51de9e[_0x5de3('0x35')]:_0x5046af[_0x5de3('0x31')];if(!_0x34c0e1['query'][_0x5de3('0x39')](_0x5de3('0x3a'))){_0x51de9e['limit']=qs[_0x5de3('0x1c')](_0x34c0e1[_0x5de3('0x32')][_0x5de3('0x1c')]);_0x51de9e['offset']=qs[_0x5de3('0x1a')](_0x34c0e1['query']['offset']);}_0x51de9e[_0x5de3('0x3b')]=qs['sort'](_0x34c0e1[_0x5de3('0x32')][_0x5de3('0x3c')]);_0x51de9e[_0x5de3('0x3d')]=qs[_0x5de3('0x34')](_[_0x5de3('0x3e')](_0x34c0e1['query'],_0x5046af['filters']),_0x1ad99d);if(_0x34c0e1[_0x5de3('0x32')][_0x5de3('0x3f')]){_0x51de9e[_0x5de3('0x3d')]=_[_0x5de3('0x40')](_0x51de9e[_0x5de3('0x3d')],{'$or':_[_0x5de3('0x2b')](_0x1ad99d,function(_0x286972){if(_0x286972[_0x5de3('0x2f')]!==_0x5de3('0x41')){var _0x3a3286={};_0x3a3286[_0x286972[_0x5de3('0x29')]]={'$like':'%'+_0x34c0e1[_0x5de3('0x32')][_0x5de3('0x3f')]+'%'};return _0x3a3286;}})});}_0x51de9e=_['merge']({},_0x51de9e,_0x34c0e1[_0x5de3('0x42')]);var _0x2802a9={'where':_0x51de9e[_0x5de3('0x3d')]};return db['SmsApplication'][_0x5de3('0x1d')](_0x2802a9)[_0x5de3('0x23')](function(_0x541aa6){_0x370ae1[_0x5de3('0x1d')]=_0x541aa6;if(_0x34c0e1['query']['includeAll']){_0x51de9e[_0x5de3('0x43')]=[{'all':!![]}];}return db[_0x5de3('0x2c')]['findAll'](_0x51de9e);})['then'](function(_0x407f38){_0x370ae1[_0x5de3('0x44')]=_0x407f38;return _0x370ae1;})[_0x5de3('0x23')](respondWithFilteredResult(_0x240854,_0x51de9e))[_0x5de3('0x45')](handleError(_0x240854,null));};exports[_0x5de3('0x46')]=function(_0x2933ef,_0x1adc20){var _0x3b38b4={'raw':!![],'where':{'id':_0x2933ef[_0x5de3('0x47')]['id']}},_0x163a28={};_0x163a28[_0x5de3('0x31')]=_[_0x5de3('0x33')](db[_0x5de3('0x2c')][_0x5de3('0x2d')]);_0x163a28[_0x5de3('0x32')]=_['keys'](_0x2933ef['query']);_0x163a28[_0x5de3('0x34')]=_[_0x5de3('0x36')](_0x163a28[_0x5de3('0x31')],_0x163a28[_0x5de3('0x32')]);_0x3b38b4[_0x5de3('0x35')]=_[_0x5de3('0x36')](_0x163a28['model'],qs[_0x5de3('0x37')](_0x2933ef[_0x5de3('0x32')][_0x5de3('0x37')]));_0x3b38b4[_0x5de3('0x35')]=_0x3b38b4[_0x5de3('0x35')][_0x5de3('0x38')]?_0x3b38b4['attributes']:_0x163a28[_0x5de3('0x31')];if(_0x2933ef['query'][_0x5de3('0x48')]){_0x3b38b4[_0x5de3('0x43')]=[{'all':!![]}];}_0x3b38b4=_[_0x5de3('0x40')]({},_0x3b38b4,_0x2933ef['options']);return db[_0x5de3('0x2c')]['find'](_0x3b38b4)[_0x5de3('0x23')](handleEntityNotFound(_0x1adc20,null))['then'](respondWithResult(_0x1adc20,null))[_0x5de3('0x45')](handleError(_0x1adc20,null));};exports[_0x5de3('0x49')]=function(_0x527290,_0x1ff2b6){return db['SmsApplication'][_0x5de3('0x49')](_0x527290[_0x5de3('0x4a')],{})[_0x5de3('0x23')](respondWithResult(_0x1ff2b6,0xc9))[_0x5de3('0x45')](handleError(_0x1ff2b6,null));};exports['update']=function(_0x52ed9e,_0x204771){if(_0x52ed9e['body']['id']){delete _0x52ed9e['body']['id'];}return db[_0x5de3('0x2c')][_0x5de3('0x4b')]({'where':{'id':_0x52ed9e['params']['id']}})[_0x5de3('0x23')](handleEntityNotFound(_0x204771,null))['then'](saveUpdates(_0x52ed9e[_0x5de3('0x4a')],null))['then'](respondWithResult(_0x204771,null))[_0x5de3('0x45')](handleError(_0x204771,null));};exports[_0x5de3('0x24')]=function(_0xbd0f2d,_0x3ef8f3){return db[_0x5de3('0x2c')][_0x5de3('0x4b')]({'where':{'id':_0xbd0f2d[_0x5de3('0x47')]['id']}})[_0x5de3('0x23')](handleEntityNotFound(_0x3ef8f3,null))[_0x5de3('0x23')](removeEntity(_0x3ef8f3,null))[_0x5de3('0x45')](handleError(_0x3ef8f3,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 8e172ff..95ba847 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 _0xe3aa=['SmsApplication','sms_applications','utf8mb4','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x55b8da,_0x3ae4db){var _0x4c64e0=function(_0x2bb5b7){while(--_0x2bb5b7){_0x55b8da['push'](_0x55b8da['shift']());}};_0x4c64e0(++_0x3ae4db);}(_0xe3aa,0x1e3));var _0xae3a=function(_0x5e8ad5,_0x22fe56){_0x5e8ad5=_0x5e8ad5-0x0;var _0x79ec0b=_0xe3aa[_0x5e8ad5];return _0x79ec0b;};'use strict';var _=require(_0xae3a('0x0'));var util=require('util');var logger=require(_0xae3a('0x1'))(_0xae3a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xae3a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae3a('0x4'));var config=require(_0xae3a('0x5'));var attributes=require(_0xae3a('0x6'));module[_0xae3a('0x7')]=function(_0x4f754b,_0x2505a5){return _0x4f754b[_0xae3a('0x8')](_0xae3a('0x9'),attributes,{'tableName':_0xae3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae3a('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4bc6=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4_unicode_ci','util'];(function(_0x43db53,_0x34cd0c){var _0x5a9872=function(_0x3c84b2){while(--_0x3c84b2){_0x43db53['push'](_0x43db53['shift']());}};_0x5a9872(++_0x34cd0c);}(_0x4bc6,0xd0));var _0x64bc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4bc6[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x64bc('0x0'));var logger=require(_0x64bc('0x1'))('api');var moment=require(_0x64bc('0x2'));var BPromise=require('bluebird');var rp=require(_0x64bc('0x3'));var fs=require('fs');var path=require(_0x64bc('0x4'));var rimraf=require(_0x64bc('0x5'));var config=require(_0x64bc('0x6'));var attributes=require(_0x64bc('0x7'));module[_0x64bc('0x8')]=function(_0x1e5c2b,_0x2443d7){return _0x1e5c2b[_0x64bc('0x9')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x64bc('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index db2ddcf..cdc0c2c 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 _0xf777=['http','request','then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xb2be74,_0x24cf89){var _0x21844c=function(_0x293c3b){while(--_0x293c3b){_0xb2be74['push'](_0xb2be74['shift']());}};_0x21844c(++_0x24cf89);}(_0xf777,0x1e9));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7f77('0x0'));var util=require(_0x7f77('0x1'));var moment=require(_0x7f77('0x2'));var BPromise=require(_0x7f77('0x3'));var rs=require(_0x7f77('0x4'));var fs=require('fs');var Redis=require(_0x7f77('0x5'));var db=require(_0x7f77('0x6'))['db'];var utils=require(_0x7f77('0x7'));var logger=require(_0x7f77('0x8'))('rpc');var config=require(_0x7f77('0x9'));var jayson=require(_0x7f77('0xa'));var client=jayson['client'][_0x7f77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53df7d,_0x7bfea,_0x598934){return new BPromise(function(_0x87bd54,_0x322466){return client[_0x7f77('0xc')](_0x53df7d,_0x598934)[_0x7f77('0xd')](function(_0xc8bbae){logger['info']('SmsApplication,\x20%s,\x20%s',_0x7bfea,_0x7f77('0xe'));logger[_0x7f77('0xf')](_0x7f77('0x10'),_0x7bfea,_0x7f77('0xe'),JSON[_0x7f77('0x11')](_0xc8bbae));if(_0xc8bbae['error']){if(_0xc8bbae[_0x7f77('0x12')][_0x7f77('0x13')]===0x1f4){logger[_0x7f77('0x12')](_0x7f77('0x14'),_0x7bfea,_0xc8bbae[_0x7f77('0x12')]['message']);return _0x322466(_0xc8bbae['error'][_0x7f77('0x15')]);}logger[_0x7f77('0x12')](_0x7f77('0x14'),_0x7bfea,_0xc8bbae[_0x7f77('0x12')][_0x7f77('0x15')]);return _0x87bd54(_0xc8bbae[_0x7f77('0x12')][_0x7f77('0x15')]);}else{logger[_0x7f77('0x16')](_0x7f77('0x14'),_0x7bfea,_0x7f77('0xe'));_0x87bd54(_0xc8bbae[_0x7f77('0x17')][_0x7f77('0x15')]);}})[_0x7f77('0x18')](function(_0x3f96e9){logger[_0x7f77('0x12')](_0x7f77('0x14'),_0x7bfea,_0x3f96e9);_0x322466(_0x3f96e9);});});} \ No newline at end of file +var _0x639a=['debug','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent'];(function(_0x1fd44c,_0x3e60d1){var _0x5ed0a2=function(_0x2bc4ed){while(--_0x2bc4ed){_0x1fd44c['push'](_0x1fd44c['shift']());}};_0x5ed0a2(++_0x3e60d1);}(_0x639a,0x1e8));var _0xa639=function(_0x234eb0,_0x544f22){_0x234eb0=_0x234eb0-0x0;var _0x819faa=_0x639a[_0x234eb0];return _0x819faa;};'use strict';var _=require(_0xa639('0x0'));var util=require(_0xa639('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa639('0x2'));var fs=require('fs');var Redis=require(_0xa639('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa639('0x4'));var logger=require(_0xa639('0x5'))(_0xa639('0x6'));var config=require(_0xa639('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa639('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x276815,_0x38b779,_0x277b76){return new BPromise(function(_0x2f4bce,_0x41a185){return client['request'](_0x276815,_0x277b76)[_0xa639('0x9')](function(_0x16d090){logger[_0xa639('0xa')]('SmsApplication,\x20%s,\x20%s',_0x38b779,_0xa639('0xb'));logger[_0xa639('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x38b779,_0xa639('0xb'),JSON[_0xa639('0xd')](_0x16d090));if(_0x16d090['error']){if(_0x16d090[_0xa639('0xe')][_0xa639('0xf')]===0x1f4){logger['error'](_0xa639('0x10'),_0x38b779,_0x16d090[_0xa639('0xe')][_0xa639('0x11')]);return _0x41a185(_0x16d090[_0xa639('0xe')][_0xa639('0x11')]);}logger[_0xa639('0xe')](_0xa639('0x10'),_0x38b779,_0x16d090['error'][_0xa639('0x11')]);return _0x2f4bce(_0x16d090[_0xa639('0xe')][_0xa639('0x11')]);}else{logger[_0xa639('0xa')](_0xa639('0x10'),_0x38b779,_0xa639('0xb'));_0x2f4bce(_0x16d090[_0xa639('0x12')][_0xa639('0x11')]);}})[_0xa639('0x13')](function(_0x58eded){logger[_0xa639('0xe')](_0xa639('0x10'),_0x38b779,_0x58eded);_0x41a185(_0x58eded);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5ee05a2..67d9d1f 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 _0xbaf0=['sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0x304d76,_0x1ba686){var _0x18899c=function(_0x344827){while(--_0x344827){_0x304d76['push'](_0x304d76['shift']());}};_0x18899c(++_0x1ba686);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0baf('0x12')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x13')]);router['post'](_0x0baf('0x14'),auth['isAuthenticated'](),interaction[_0x0baf('0x15')](_0x0baf('0x16'),_0x0baf('0x17')),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')](_0x0baf('0x1a'),auth['isAuthenticated'](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1b')),controller[_0x0baf('0x1c')]);router[_0x0baf('0x1d')](_0x0baf('0x1a'),auth[_0x0baf('0xa')](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1e')),controller[_0x0baf('0x1f')]);router[_0x0baf('0x1d')](_0x0baf('0x14'),auth[_0x0baf('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xe511=['addTags','put','update','smsinteraction:destroy','destroy','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','describe','show','/:id/messages','isAuthenticated','getMessages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xe511,0x16f));var _0x1e51=function(_0xe1c87f,_0x35000d){_0xe1c87f=_0xe1c87f-0x0;var _0x2960ae=_0xe511[_0xe1c87f];return _0x2960ae;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0x8')]('/:id/download',auth[_0x1e51('0xd')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')]('/',auth[_0x1e51('0xd')](),controller[_0x1e51('0x11')]);router[_0x1e51('0x10')]('/:id/messages',auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x10')](_0x1e51('0x13'),auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),_0x1e51('0x16')),controller[_0x1e51('0x17')]);router[_0x1e51('0x18')]('/:id',auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),'smsinteraction:update'),controller[_0x1e51('0x19')]);router['delete']('/:id',auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),_0x1e51('0x1a')),controller[_0x1e51('0x1b')]);router[_0x1e51('0x1c')]('/:id/tags',auth[_0x1e51('0xd')](),controller['removeTags']);module[_0x1e51('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 e5ff709..a6615eb 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 _0x04f9=['STRING','DATE','out','ENUM','moment','exports','BOOLEAN'];(function(_0x4f780d,_0xb28eaa){var _0x4f05d6=function(_0x262997){while(--_0x262997){_0x4f780d['push'](_0x4f780d['shift']());}};_0x4f05d6(++_0xb28eaa);}(_0x04f9,0xb3));var _0x904f=function(_0x269908,_0x23eafd){_0x269908=_0x269908-0x0;var _0x40cbf2=_0x04f9[_0x269908];return _0x40cbf2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x904f('0x0'));module[_0x904f('0x1')]={'closed':{'type':Sequelize[_0x904f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x904f('0x3')]},'secondDisposition':{'type':Sequelize[_0x904f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x904f('0x3')]},'note':{'type':Sequelize[_0x904f('0x3')]},'phone':{'type':Sequelize[_0x904f('0x3')]},'read1stAt':{'type':Sequelize[_0x904f('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x904f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x904f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x904f('0x6')]('in',_0x904f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x904f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x22e3=['ENUM','out','BOOLEAN','sequelize','moment','exports','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22e3,0xf3));var _0x322e=function(_0x186f8f,_0x1a0ebd){_0x186f8f=_0x186f8f-0x0;var _0x1af754=_0x22e3[_0x186f8f];return _0x1af754;};'use strict';var Sequelize=require(_0x322e('0x0'));var moment=require(_0x322e('0x1'));module[_0x322e('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x322e('0x3')]},'disposition':{'type':Sequelize[_0x322e('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x322e('0x4')]},'note':{'type':Sequelize[_0x322e('0x4')]},'phone':{'type':Sequelize[_0x322e('0x4')]},'read1stAt':{'type':Sequelize[_0x322e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x322e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x322e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x322e('0x5')]('in',_0x322e('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x322e('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b5f6ad8..e83f01f 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 _0xf723=['push','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','User','get','mkdirSync','Sms','Account','Owner','N.A.','disposition','out','System','value','views','createPdfFromHTML','log','err','rimraf','zip-dir','bluebird','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','SmsInteraction','fieldName','type','key','getOptions','sms','query','user','catch','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','describe','addMessage','SmsMessage','getMessages','findOne','hasOwnProperty','nolimit','order','where','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','ids','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','format','transcript-%d-%s.zip'];(function(_0x500a1f,_0x14745f){var _0x2f5bd7=function(_0x2d7ca7){while(--_0x2d7ca7){_0x500a1f['push'](_0x500a1f['shift']());}};_0x2f5bd7(++_0x14745f);}(_0xf723,0x183));var _0x3f72=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0xf723[_0x35bd6c];return _0x2f421d;};'use strict';var rimraf=require(_0x3f72('0x0'));var zipdir=require(_0x3f72('0x1'));var moment=require('moment');var BPromise=require(_0x3f72('0x2'));var util=require(_0x3f72('0x3'));var path=require(_0x3f72('0x4'));var ejs=require(_0x3f72('0x5'));var fs=require('fs');var _=require(_0x3f72('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x3f72('0x7'));var pdf=require(_0x3f72('0x8'));var logger=require(_0x3f72('0x9'))(_0x3f72('0xa'));var config=require(_0x3f72('0xb'));var db=require(_0x3f72('0xc'))['db'];config[_0x3f72('0xd')]=_[_0x3f72('0xe')](config[_0x3f72('0xd')],{'host':_0x3f72('0xf'),'port':0x18eb});var socket=require(_0x3f72('0x10'))(new Redis(config[_0x3f72('0xd')]));require(_0x3f72('0x11'))['register'](socket);function respondWithStatusCode(_0x3aa81a,_0x2c30be){_0x2c30be=_0x2c30be||0xcc;return function(_0x52afbd){if(_0x52afbd){return _0x3aa81a[_0x3f72('0x12')](_0x2c30be);}return _0x3aa81a[_0x3f72('0x13')](_0x2c30be)['end']();};}function respondWithResult(_0x21ebc3,_0x50b24d){_0x50b24d=_0x50b24d||0xc8;return function(_0x3452af){if(_0x3452af){return _0x21ebc3[_0x3f72('0x13')](_0x50b24d)[_0x3f72('0x14')](_0x3452af);}};}function respondWithFilteredResult(_0x5a82b2,_0x4d8a04){return function(_0x40487f){if(_0x40487f){var _0x11ebb3=typeof _0x4d8a04[_0x3f72('0x15')]===_0x3f72('0x16')&&typeof _0x4d8a04['limit']===_0x3f72('0x16');var _0x59229b=_0x40487f['count'];var _0xa21f39=_0x11ebb3?0x0:_0x4d8a04[_0x3f72('0x15')];var _0x3ea6e9=_0x11ebb3?_0x40487f[_0x3f72('0x17')]:_0x4d8a04[_0x3f72('0x15')]+_0x4d8a04[_0x3f72('0x18')];var _0x536bdd;if(_0x3ea6e9>=_0x59229b){_0x3ea6e9=_0x59229b;_0x536bdd=0xc8;}else{_0x536bdd=0xce;}_0x5a82b2[_0x3f72('0x13')](_0x536bdd);return _0x5a82b2[_0x3f72('0x19')](_0x3f72('0x1a'),_0xa21f39+'-'+_0x3ea6e9+'/'+_0x59229b)[_0x3f72('0x14')](_0x40487f);}return null;};}function saveUpdates(_0x44b1c0){return function(_0x4047d4){if(_0x4047d4){return _0x4047d4[_0x3f72('0x1b')](_0x44b1c0)[_0x3f72('0x1c')](function(_0x5a0693){return _0x5a0693;});}return null;};}function removeEntity(_0x12dcda){return function(_0x2d377f){if(_0x2d377f){return _0x2d377f[_0x3f72('0x1d')]()[_0x3f72('0x1c')](function(){_0x12dcda[_0x3f72('0x13')](0xcc)[_0x3f72('0x1e')]();});}};}function handleEntityNotFound(_0x2eb678){return function(_0x23bbac){if(!_0x23bbac){_0x2eb678[_0x3f72('0x12')](0x194);}return _0x23bbac;};}function handleError(_0x5e2518,_0x508e4b){_0x508e4b=_0x508e4b||0x1f4;return function(_0x479707){logger[_0x3f72('0x1f')](_0x479707[_0x3f72('0x20')]);if(_0x479707['name']){delete _0x479707[_0x3f72('0x21')];}_0x5e2518[_0x3f72('0x13')](_0x508e4b)[_0x3f72('0x22')](_0x479707);};}exports[_0x3f72('0x23')]=function(_0xe128f1,_0x489093){var _0x453108={};var _0x17f89b=_['map'](db[_0x3f72('0x24')]['rawAttributes'],function(_0x513c7f){return{'name':_0x513c7f[_0x3f72('0x25')],'type':_0x513c7f[_0x3f72('0x26')][_0x3f72('0x27')]};});_0x453108=qs[_0x3f72('0x28')](_0x17f89b,_0xe128f1);return interaction['findAll'](_0x3f72('0x29'),_0xe128f1[_0x3f72('0x2a')],_0xe128f1[_0x3f72('0x2b')],_0x453108,_0x17f89b)[_0x3f72('0x1c')](respondWithFilteredResult(_0x489093,_0x453108))[_0x3f72('0x2c')](handleError(_0x489093,null));};exports['show']=function(_0x4a5c4d,_0x305efe){var _0x3c6f11={'raw':![],'where':{'id':_0x4a5c4d[_0x3f72('0x2d')]['id']}},_0x10dd63={};_0x10dd63[_0x3f72('0x2e')]=_[_0x3f72('0x2f')](db[_0x3f72('0x24')]['rawAttributes']);_0x10dd63[_0x3f72('0x2a')]=_[_0x3f72('0x2f')](_0x4a5c4d[_0x3f72('0x2a')]);_0x10dd63[_0x3f72('0x30')]=_[_0x3f72('0x31')](_0x10dd63[_0x3f72('0x2e')],_0x10dd63[_0x3f72('0x2a')]);_0x3c6f11['attributes']=_[_0x3f72('0x31')](_0x10dd63['model'],qs['fields'](_0x4a5c4d[_0x3f72('0x2a')][_0x3f72('0x32')]));_0x3c6f11[_0x3f72('0x33')]=_0x3c6f11[_0x3f72('0x33')][_0x3f72('0x34')]?_0x3c6f11[_0x3f72('0x33')]:_0x10dd63[_0x3f72('0x2e')];if(_0x4a5c4d[_0x3f72('0x2a')][_0x3f72('0x35')]){_0x3c6f11[_0x3f72('0x36')]=[{'all':!![]}];}_0x3c6f11=_[_0x3f72('0x37')]({},_0x3c6f11,_0x4a5c4d[_0x3f72('0x38')]);return db[_0x3f72('0x24')][_0x3f72('0x39')](_0x3c6f11)['then'](handleEntityNotFound(_0x305efe,null))[_0x3f72('0x1c')](respondWithResult(_0x305efe,null))[_0x3f72('0x2c')](handleError(_0x305efe,null));};exports[_0x3f72('0x3a')]=function(_0x348781,_0x3be4b7){return db[_0x3f72('0x24')][_0x3f72('0x3a')](_0x348781[_0x3f72('0x3b')],{})[_0x3f72('0x1c')](respondWithResult(_0x3be4b7,0xc9))[_0x3f72('0x2c')](handleError(_0x3be4b7,null));};exports[_0x3f72('0x1b')]=function(_0x911663,_0x16378b){if(_0x911663[_0x3f72('0x3b')]['id']){delete _0x911663[_0x3f72('0x3b')]['id'];}return db['SmsInteraction'][_0x3f72('0x39')]({'where':{'id':_0x911663['params']['id']}})[_0x3f72('0x1c')](handleEntityNotFound(_0x16378b,null))[_0x3f72('0x1c')](saveUpdates(_0x911663['body'],null))[_0x3f72('0x1c')](respondWithResult(_0x16378b,null))[_0x3f72('0x2c')](handleError(_0x16378b,null));};exports[_0x3f72('0x1d')]=function(_0x48a237,_0x3767d2){return db[_0x3f72('0x24')][_0x3f72('0x39')]({'where':{'id':_0x48a237[_0x3f72('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3767d2,null))[_0x3f72('0x1c')](removeEntity(_0x3767d2,null))[_0x3f72('0x2c')](handleError(_0x3767d2,null));};exports['describe']=function(_0x33bf0f,_0x2f5c15){return db[_0x3f72('0x24')][_0x3f72('0x3c')]()[_0x3f72('0x1c')](respondWithResult(_0x2f5c15,null))[_0x3f72('0x2c')](handleError(_0x2f5c15,null));};exports[_0x3f72('0x3d')]=function(_0xe176cb,_0x4cc5e9){return db[_0x3f72('0x3e')][_0x3f72('0x39')]({'where':{'id':_0xe176cb[_0x3f72('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4cc5e9,null))[_0x3f72('0x1c')](function(_0x1bae6b){if(_0x1bae6b){return _0x1bae6b[_0x3f72('0x3d')](_0xe176cb[_0x3f72('0x3b')]['ids'],_['omit'](_0xe176cb[_0x3f72('0x3b')],['ids','id'])||{});}})[_0x3f72('0x1c')](respondWithResult(_0x4cc5e9,null))[_0x3f72('0x2c')](handleError(_0x4cc5e9,null));};exports[_0x3f72('0x3f')]=function(_0x523a45,_0x14caaa){var _0x1b57ff={'raw':![],'where':{}};var _0x3479ef={};var _0x1e1aef={'count':0x0,'rows':[]};return db[_0x3f72('0x24')][_0x3f72('0x40')]({'where':{'id':_0x523a45['params']['id']}})[_0x3f72('0x1c')](handleEntityNotFound(_0x14caaa,null))[_0x3f72('0x1c')](function(_0x248b91){if(_0x248b91){_0x3479ef[_0x3f72('0x2e')]=_[_0x3f72('0x2f')](db[_0x3f72('0x3e')]['rawAttributes']);_0x3479ef['query']=_['keys'](_0x523a45[_0x3f72('0x2a')]);_0x3479ef['filters']=_[_0x3f72('0x31')](_0x3479ef['model'],_0x3479ef[_0x3f72('0x2a')]);_0x1b57ff[_0x3f72('0x33')]=_['intersection'](_0x3479ef[_0x3f72('0x2e')],qs[_0x3f72('0x32')](_0x523a45[_0x3f72('0x2a')][_0x3f72('0x32')]));_0x1b57ff[_0x3f72('0x33')]=_0x1b57ff[_0x3f72('0x33')]['length']?_0x1b57ff['attributes']:_0x3479ef[_0x3f72('0x2e')];if(!_0x523a45[_0x3f72('0x2a')][_0x3f72('0x41')](_0x3f72('0x42'))){_0x1b57ff[_0x3f72('0x18')]=qs[_0x3f72('0x18')](_0x523a45[_0x3f72('0x2a')]['limit']);_0x1b57ff[_0x3f72('0x15')]=qs[_0x3f72('0x15')](_0x523a45['query'][_0x3f72('0x15')]);}_0x1b57ff[_0x3f72('0x43')]=qs['sort'](_0x523a45[_0x3f72('0x2a')]['sort']);_0x1b57ff[_0x3f72('0x44')]=qs[_0x3f72('0x30')](_['pick'](_0x523a45['query'],_0x3479ef[_0x3f72('0x30')]));_0x1b57ff[_0x3f72('0x44')]['SmsInteractionId']=_0x248b91['id'];if(_0x523a45['query'][_0x3f72('0x45')]){_0x1b57ff[_0x3f72('0x44')]=_[_0x3f72('0x37')](_0x1b57ff[_0x3f72('0x44')],{'$or':_[_0x3f72('0x46')](_0x1b57ff[_0x3f72('0x33')],function(_0xaeb2c4){var _0x539f1c={};_0x539f1c[_0xaeb2c4]={'$like':'%'+_0x523a45['query'][_0x3f72('0x45')]+'%'};return _0x539f1c;})});}if(_0x523a45['query'][_0x3f72('0x47')]){var _0x4f77c7=_0x523a45[_0x3f72('0x2a')][_0x3f72('0x47')][_0x3f72('0x48')](',');var _0x1dbb62={};_0x1dbb62[_0x4f77c7[0x0]]={'$gte':moment(_0x4f77c7[0x1])['format'](_0x3f72('0x49'))};_0x1b57ff[_0x3f72('0x44')]=_[_0x3f72('0x37')](_0x1b57ff[_0x3f72('0x44')],_0x1dbb62);}_0x1b57ff=_[_0x3f72('0x37')]({},_0x1b57ff,_0x523a45[_0x3f72('0x38')]);return db['SmsMessage'][_0x3f72('0x17')]({'where':_0x1b57ff[_0x3f72('0x44')]})[_0x3f72('0x1c')](function(_0x5a4111){_0x1e1aef[_0x3f72('0x17')]=_0x5a4111;if(_0x523a45[_0x3f72('0x2a')]['includeAll']){_0x1b57ff[_0x3f72('0x36')]=[{'all':!![]}];}return db['SmsMessage'][_0x3f72('0x4a')](_0x1b57ff);})[_0x3f72('0x1c')](function(_0x55ff66){_0x1e1aef[_0x3f72('0x4b')]=_0x55ff66;return _0x1e1aef;});}})[_0x3f72('0x1c')](respondWithFilteredResult(_0x14caaa,_0x1b57ff))[_0x3f72('0x2c')](handleError(_0x14caaa,null));};exports[_0x3f72('0x4c')]=function(_0x3ef386,_0x5694cd){return db[_0x3f72('0x24')]['find']({'where':{'id':_0x3ef386[_0x3f72('0x2d')]['id']}})[_0x3f72('0x1c')](handleEntityNotFound(_0x5694cd,null))['then'](function(_0x1982cb){if(_0x1982cb){return _0x1982cb[_0x3f72('0x4d')](_0x3ef386[_0x3f72('0x3b')][_0x3f72('0x4e')],_[_0x3f72('0x4f')](_0x3ef386[_0x3f72('0x3b')],['ids','id'])||{})[_0x3f72('0x50')](function(){return db[_0x3f72('0x51')][_0x3f72('0x4a')]({'attributes':['id',_0x3f72('0x21'),'color'],'where':{'id':_0x3ef386[_0x3f72('0x3b')]['ids']}});})[_0x3f72('0x1c')](function(_0x43edb4){socket[_0x3f72('0x52')](_0x3f72('0x53'),{'id':Number(_0x3ef386[_0x3f72('0x2d')]['id']),'tags':_0x43edb4||[]});return{'id':Number(_0x3ef386[_0x3f72('0x2d')]['id']),'tags':_0x43edb4||[]};});}})[_0x3f72('0x1c')](respondWithResult(_0x5694cd,null))['catch'](handleError(_0x5694cd,null));};exports[_0x3f72('0x54')]=function(_0x453f15,_0x4723e1){return db[_0x3f72('0x24')]['find']({'where':{'id':_0x453f15['params']['id']}})[_0x3f72('0x1c')](handleEntityNotFound(_0x4723e1,null))[_0x3f72('0x1c')](function(_0x452369){if(_0x452369){return _0x452369['removeTags'](_0x453f15['query'][_0x3f72('0x4e')]);}})['then'](respondWithStatusCode(_0x4723e1,null))[_0x3f72('0x2c')](handleError(_0x4723e1,null));};exports[_0x3f72('0x55')]=function(_0x1f659c,_0x307cfc){var _0x56c3cc=moment()[_0x3f72('0x56')]()[_0x3f72('0x57')]();var _0xb77ccc=path[_0x3f72('0x58')](config[_0x3f72('0x59')],_0x3f72('0x5a'),'files','tmp');var _0x2433ee=path[_0x3f72('0x58')](_0xb77ccc,_0x56c3cc);var _0x3430d1=util[_0x3f72('0x5b')](_0x3f72('0x5c'),_0x1f659c[_0x3f72('0x2d')]['id'],_0x56c3cc);var _0x198104=path[_0x3f72('0x58')](_0xb77ccc,_0x3430d1);var _0x37b0cc=[];_0x37b0cc[_0x3f72('0x5d')]({'model':db['User'],'as':'User','attributes':['id',_0x3f72('0x5e')],'raw':!![]});_0x37b0cc[_0x3f72('0x5d')]({'model':db[_0x3f72('0x5f')],'as':_0x3f72('0x60'),'attributes':['id',_0x3f72('0x61'),_0x3f72('0x62')],'raw':!![]});var _0x4e0b47=[{'model':db['SmsMessage'],'as':_0x3f72('0x63'),'attributes':['id','body',_0x3f72('0x64'),_0x3f72('0x65'),_0x3f72('0x66'),_0x3f72('0x67')],'include':_0x37b0cc}];_0x4e0b47[_0x3f72('0x5d')]({'model':db[_0x3f72('0x68')],'as':'Account','attributes':['id',_0x3f72('0x21')]});_0x4e0b47[_0x3f72('0x5d')]({'model':db[_0x3f72('0x69')],'as':'Owner','attributes':['id',_0x3f72('0x5e')]});return db['SmsInteraction'][_0x3f72('0x39')]({'where':{'id':_0x1f659c['params']['id']},'include':_0x4e0b47})[_0x3f72('0x1c')](handleEntityNotFound(_0x307cfc,null))[_0x3f72('0x1c')](function(_0x361201){if(_0x361201){var _0x5605f5=_0x361201[_0x3f72('0x6a')]({'plain':!![]});fs[_0x3f72('0x6b')](_0x2433ee);var _0x242d45={'channel':_0x3f72('0x6c'),'account':_0x5605f5[_0x3f72('0x6d')]['name'],'agent':_0x5605f5[_0x3f72('0x6e')]?_0x5605f5[_0x3f72('0x6e')]['fullname']:_0x3f72('0x6f'),'createdAt':moment(_0x5605f5[_0x3f72('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x5605f5['closed']?moment(_0x5605f5['closedAt'])[_0x3f72('0x5b')](_0x3f72('0x49'))[_0x3f72('0x57')]():'','disposition':_0x5605f5[_0x3f72('0x70')],'messages':_(_0x5605f5[_0x3f72('0x63')])[_0x3f72('0x45')]({'secret':![]})[_0x3f72('0x46')](function(_0x11578e){return{'date':moment(_0x11578e[_0x3f72('0x64')])[_0x3f72('0x5b')](_0x3f72('0x49'))[_0x3f72('0x57')](),'sender':_0x11578e[_0x3f72('0x65')]===_0x3f72('0x71')?_0x11578e[_0x3f72('0x69')]?_0x11578e['User'][_0x3f72('0x5e')]:_0x3f72('0x72'):_0x11578e['Contact'][_0x3f72('0x61')]+(_0x11578e[_0x3f72('0x60')][_0x3f72('0x62')]?'\x20'+_0x11578e[_0x3f72('0x60')]['lastName']:''),'body':_0x11578e[_0x3f72('0x3b')],'direction':_0x11578e[_0x3f72('0x65')]===_0x3f72('0x71')?'A':'C','secret':_0x11578e['secret'],'read':_0x11578e['read']};})[_0x3f72('0x73')]()};return ejs['renderFile'](path['join'](config['root'],_0x3f72('0x5a'),_0x3f72('0x74'),'downloadInteraction.ejs'),{'interaction':_0x242d45})[_0x3f72('0x1c')](function(_0x5f81fd){var _0x59d181=path[_0x3f72('0x58')](_0x2433ee,'transcript-'+_0x5605f5['id']+'-'+_0x56c3cc+'.pdf');var _0x1c07bc={'path':_0x59d181,'channel':'Sms','interactionId':_0x5605f5['id']};return pdf[_0x3f72('0x75')](_0x5f81fd,_0x1c07bc);})[_0x3f72('0x1c')](function(){return new BPromise(function(_0x40a844,_0x1cf5ef){zipdir(_0x2433ee,{'saveTo':_0x198104},function(_0x39cc7a,_0x29fb7c){if(_0x39cc7a)return _0x1cf5ef(_0x39cc7a);return _0x40a844(_0x29fb7c);});})[_0x3f72('0x1c')](function(){return new BPromise(function(_0x5f99b7,_0x547bfe){rimraf(_0x2433ee,function(_0x637fa1){if(_0x637fa1)_0x547bfe(_0x637fa1);return _0x5f99b7();});});})[_0x3f72('0x1c')](function(){return _0x307cfc['download'](_0x198104,_0x3430d1,function(_0x592219){if(_0x592219){console[_0x3f72('0x76')](_0x3f72('0x77'),_0x592219);}else{fs['unlinkSync'](_0x198104);}});});});}else{return _0x307cfc[_0x3f72('0x12')](0xc8);}})[_0x3f72('0x2c')](handleError(_0x307cfc,null));}; \ No newline at end of file +var _0x33ba=['./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','type','getOptions','findAll','query','user','params','model','keys','SmsInteraction','filters','intersection','fields','attributes','length','includeAll','options','catch','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','rows','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','format','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Messages','createdAt','direction','secret','read','SmsAccount','Owner','get','mkdirSync','Account','N.A.','closedAt','disposition','out','fullname','System','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','Sms','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','localhost'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x33ba,0x164));var _0xa33b=function(_0x3b5db5,_0x2ec255){_0x3b5db5=_0x3b5db5-0x0;var _0x227c97=_0x33ba[_0x3b5db5];return _0x227c97;};'use strict';var rimraf=require(_0xa33b('0x0'));var zipdir=require(_0xa33b('0x1'));var moment=require('moment');var BPromise=require(_0xa33b('0x2'));var util=require(_0xa33b('0x3'));var path=require(_0xa33b('0x4'));var ejs=require(_0xa33b('0x5'));var fs=require('fs');var _=require(_0xa33b('0x6'));var Redis=require(_0xa33b('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xa33b('0x8'));var pdf=require(_0xa33b('0x9'));var logger=require(_0xa33b('0xa'))(_0xa33b('0xb'));var config=require('../../config/environment');var db=require(_0xa33b('0xc'))['db'];config['redis']=_[_0xa33b('0xd')](config[_0xa33b('0xe')],{'host':_0xa33b('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa33b('0xe')]));require(_0xa33b('0x10'))[_0xa33b('0x11')](socket);function respondWithStatusCode(_0x160d8a,_0x2b85bc){_0x2b85bc=_0x2b85bc||0xcc;return function(_0x2e5b6d){if(_0x2e5b6d){return _0x160d8a[_0xa33b('0x12')](_0x2b85bc);}return _0x160d8a[_0xa33b('0x13')](_0x2b85bc)['end']();};}function respondWithResult(_0x28f8b6,_0x28f53d){_0x28f53d=_0x28f53d||0xc8;return function(_0x301727){if(_0x301727){return _0x28f8b6[_0xa33b('0x13')](_0x28f53d)[_0xa33b('0x14')](_0x301727);}};}function respondWithFilteredResult(_0x12f298,_0x53dd2c){return function(_0x569e52){if(_0x569e52){var _0x3a3e5c=typeof _0x53dd2c[_0xa33b('0x15')]===_0xa33b('0x16')&&typeof _0x53dd2c[_0xa33b('0x17')]==='undefined';var _0x598820=_0x569e52['count'];var _0x4dc849=_0x3a3e5c?0x0:_0x53dd2c[_0xa33b('0x15')];var _0x1a3858=_0x3a3e5c?_0x569e52[_0xa33b('0x18')]:_0x53dd2c[_0xa33b('0x15')]+_0x53dd2c['limit'];var _0x54627a;if(_0x1a3858>=_0x598820){_0x1a3858=_0x598820;_0x54627a=0xc8;}else{_0x54627a=0xce;}_0x12f298['status'](_0x54627a);return _0x12f298[_0xa33b('0x19')]('Content-Range',_0x4dc849+'-'+_0x1a3858+'/'+_0x598820)[_0xa33b('0x14')](_0x569e52);}return null;};}function saveUpdates(_0x243e4f){return function(_0x48892a){if(_0x48892a){return _0x48892a[_0xa33b('0x1a')](_0x243e4f)[_0xa33b('0x1b')](function(_0x15ace4){return _0x15ace4;});}return null;};}function removeEntity(_0x1db7c3){return function(_0x1e0049){if(_0x1e0049){return _0x1e0049[_0xa33b('0x1c')]()[_0xa33b('0x1b')](function(){_0x1db7c3[_0xa33b('0x13')](0xcc)[_0xa33b('0x1d')]();});}};}function handleEntityNotFound(_0x113c89){return function(_0x25b7bf){if(!_0x25b7bf){_0x113c89[_0xa33b('0x12')](0x194);}return _0x25b7bf;};}function handleError(_0x592636,_0x4c2599){_0x4c2599=_0x4c2599||0x1f4;return function(_0x13533d){logger[_0xa33b('0x1e')](_0x13533d[_0xa33b('0x1f')]);if(_0x13533d[_0xa33b('0x20')]){delete _0x13533d[_0xa33b('0x20')];}_0x592636[_0xa33b('0x13')](_0x4c2599)['send'](_0x13533d);};}exports['index']=function(_0x21c86b,_0x193fef){var _0x56aff1={};var _0x5dcdf8=_[_0xa33b('0x21')](db['SmsInteraction'][_0xa33b('0x22')],function(_0x185d71){return{'name':_0x185d71[_0xa33b('0x23')],'type':_0x185d71[_0xa33b('0x24')]['key']};});_0x56aff1=qs[_0xa33b('0x25')](_0x5dcdf8,_0x21c86b);return interaction[_0xa33b('0x26')]('sms',_0x21c86b[_0xa33b('0x27')],_0x21c86b[_0xa33b('0x28')],_0x56aff1,_0x5dcdf8)['then'](respondWithFilteredResult(_0x193fef,_0x56aff1))['catch'](handleError(_0x193fef,null));};exports['show']=function(_0x367a1e,_0x4a4f92){var _0x1ef714={'raw':![],'where':{'id':_0x367a1e[_0xa33b('0x29')]['id']}},_0x35a512={};_0x35a512[_0xa33b('0x2a')]=_[_0xa33b('0x2b')](db[_0xa33b('0x2c')][_0xa33b('0x22')]);_0x35a512['query']=_[_0xa33b('0x2b')](_0x367a1e[_0xa33b('0x27')]);_0x35a512[_0xa33b('0x2d')]=_[_0xa33b('0x2e')](_0x35a512[_0xa33b('0x2a')],_0x35a512[_0xa33b('0x27')]);_0x1ef714['attributes']=_[_0xa33b('0x2e')](_0x35a512[_0xa33b('0x2a')],qs['fields'](_0x367a1e['query'][_0xa33b('0x2f')]));_0x1ef714[_0xa33b('0x30')]=_0x1ef714['attributes'][_0xa33b('0x31')]?_0x1ef714['attributes']:_0x35a512[_0xa33b('0x2a')];if(_0x367a1e[_0xa33b('0x27')][_0xa33b('0x32')]){_0x1ef714['include']=[{'all':!![]}];}_0x1ef714=_['merge']({},_0x1ef714,_0x367a1e[_0xa33b('0x33')]);return db['SmsInteraction']['find'](_0x1ef714)['then'](handleEntityNotFound(_0x4a4f92,null))[_0xa33b('0x1b')](respondWithResult(_0x4a4f92,null))[_0xa33b('0x34')](handleError(_0x4a4f92,null));};exports['create']=function(_0x12897c,_0x3c56d2){return db['SmsInteraction'][_0xa33b('0x35')](_0x12897c[_0xa33b('0x36')],{})['then'](respondWithResult(_0x3c56d2,0xc9))[_0xa33b('0x34')](handleError(_0x3c56d2,null));};exports[_0xa33b('0x1a')]=function(_0x4efe27,_0x458f3c){if(_0x4efe27[_0xa33b('0x36')]['id']){delete _0x4efe27[_0xa33b('0x36')]['id'];}return db[_0xa33b('0x2c')][_0xa33b('0x37')]({'where':{'id':_0x4efe27['params']['id']}})[_0xa33b('0x1b')](handleEntityNotFound(_0x458f3c,null))[_0xa33b('0x1b')](saveUpdates(_0x4efe27[_0xa33b('0x36')],null))[_0xa33b('0x1b')](respondWithResult(_0x458f3c,null))['catch'](handleError(_0x458f3c,null));};exports['destroy']=function(_0x334a15,_0x4e828e){return db[_0xa33b('0x2c')][_0xa33b('0x37')]({'where':{'id':_0x334a15['params']['id']}})[_0xa33b('0x1b')](handleEntityNotFound(_0x4e828e,null))[_0xa33b('0x1b')](removeEntity(_0x4e828e,null))['catch'](handleError(_0x4e828e,null));};exports[_0xa33b('0x38')]=function(_0x196d1d,_0x5ab87a){return db[_0xa33b('0x2c')]['describe']()[_0xa33b('0x1b')](respondWithResult(_0x5ab87a,null))['catch'](handleError(_0x5ab87a,null));};exports[_0xa33b('0x39')]=function(_0x1dc91e,_0x192f87){return db['SmsMessage'][_0xa33b('0x37')]({'where':{'id':_0x1dc91e[_0xa33b('0x29')]['id']}})[_0xa33b('0x1b')](handleEntityNotFound(_0x192f87,null))[_0xa33b('0x1b')](function(_0x529b05){if(_0x529b05){return _0x529b05[_0xa33b('0x39')](_0x1dc91e[_0xa33b('0x36')][_0xa33b('0x3a')],_[_0xa33b('0x3b')](_0x1dc91e[_0xa33b('0x36')],[_0xa33b('0x3a'),'id'])||{});}})[_0xa33b('0x1b')](respondWithResult(_0x192f87,null))[_0xa33b('0x34')](handleError(_0x192f87,null));};exports[_0xa33b('0x3c')]=function(_0x292a80,_0x42b03f){var _0x6d5ff4={'raw':![],'where':{}};var _0x141654={};var _0x5daf38={'count':0x0,'rows':[]};return db[_0xa33b('0x2c')][_0xa33b('0x3d')]({'where':{'id':_0x292a80['params']['id']}})[_0xa33b('0x1b')](handleEntityNotFound(_0x42b03f,null))[_0xa33b('0x1b')](function(_0x16736b){if(_0x16736b){_0x141654['model']=_[_0xa33b('0x2b')](db[_0xa33b('0x3e')][_0xa33b('0x22')]);_0x141654[_0xa33b('0x27')]=_[_0xa33b('0x2b')](_0x292a80['query']);_0x141654[_0xa33b('0x2d')]=_[_0xa33b('0x2e')](_0x141654['model'],_0x141654[_0xa33b('0x27')]);_0x6d5ff4[_0xa33b('0x30')]=_[_0xa33b('0x2e')](_0x141654['model'],qs['fields'](_0x292a80[_0xa33b('0x27')]['fields']));_0x6d5ff4[_0xa33b('0x30')]=_0x6d5ff4[_0xa33b('0x30')][_0xa33b('0x31')]?_0x6d5ff4[_0xa33b('0x30')]:_0x141654[_0xa33b('0x2a')];if(!_0x292a80[_0xa33b('0x27')][_0xa33b('0x3f')](_0xa33b('0x40'))){_0x6d5ff4[_0xa33b('0x17')]=qs['limit'](_0x292a80['query'][_0xa33b('0x17')]);_0x6d5ff4[_0xa33b('0x15')]=qs['offset'](_0x292a80[_0xa33b('0x27')][_0xa33b('0x15')]);}_0x6d5ff4[_0xa33b('0x41')]=qs[_0xa33b('0x42')](_0x292a80[_0xa33b('0x27')][_0xa33b('0x42')]);_0x6d5ff4['where']=qs['filters'](_[_0xa33b('0x43')](_0x292a80['query'],_0x141654['filters']));_0x6d5ff4[_0xa33b('0x44')]['SmsInteractionId']=_0x16736b['id'];if(_0x292a80[_0xa33b('0x27')][_0xa33b('0x45')]){_0x6d5ff4[_0xa33b('0x44')]=_['merge'](_0x6d5ff4[_0xa33b('0x44')],{'$or':_[_0xa33b('0x21')](_0x6d5ff4['attributes'],function(_0x3ba97e){var _0x3da55e={};_0x3da55e[_0x3ba97e]={'$like':'%'+_0x292a80[_0xa33b('0x27')][_0xa33b('0x45')]+'%'};return _0x3da55e;})});}if(_0x292a80[_0xa33b('0x27')][_0xa33b('0x46')]){var _0x246d83=_0x292a80['query'][_0xa33b('0x46')][_0xa33b('0x47')](',');var _0x36eb86={};_0x36eb86[_0x246d83[0x0]]={'$gte':moment(_0x246d83[0x1])['format'](_0xa33b('0x48'))};_0x6d5ff4[_0xa33b('0x44')]=_[_0xa33b('0x49')](_0x6d5ff4[_0xa33b('0x44')],_0x36eb86);}_0x6d5ff4=_[_0xa33b('0x49')]({},_0x6d5ff4,_0x292a80[_0xa33b('0x33')]);return db['SmsMessage'][_0xa33b('0x18')]({'where':_0x6d5ff4[_0xa33b('0x44')]})['then'](function(_0x36a140){_0x5daf38['count']=_0x36a140;if(_0x292a80['query']['includeAll']){_0x6d5ff4['include']=[{'all':!![]}];}return db['SmsMessage'][_0xa33b('0x26')](_0x6d5ff4);})[_0xa33b('0x1b')](function(_0x5ca3af){_0x5daf38[_0xa33b('0x4a')]=_0x5ca3af;return _0x5daf38;});}})['then'](respondWithFilteredResult(_0x42b03f,_0x6d5ff4))[_0xa33b('0x34')](handleError(_0x42b03f,null));};exports[_0xa33b('0x4b')]=function(_0x579e8f,_0x33c9a8){return db[_0xa33b('0x2c')][_0xa33b('0x37')]({'where':{'id':_0x579e8f[_0xa33b('0x29')]['id']}})[_0xa33b('0x1b')](handleEntityNotFound(_0x33c9a8,null))['then'](function(_0x790d81){if(_0x790d81){return _0x790d81[_0xa33b('0x4c')](_0x579e8f['body'][_0xa33b('0x3a')],_['omit'](_0x579e8f['body'],[_0xa33b('0x3a'),'id'])||{})[_0xa33b('0x4d')](function(){return db[_0xa33b('0x4e')][_0xa33b('0x26')]({'attributes':['id',_0xa33b('0x20'),'color'],'where':{'id':_0x579e8f['body'][_0xa33b('0x3a')]}});})[_0xa33b('0x1b')](function(_0x48ffb1){socket[_0xa33b('0x4f')](_0xa33b('0x50'),{'id':Number(_0x579e8f[_0xa33b('0x29')]['id']),'tags':_0x48ffb1||[]});return{'id':Number(_0x579e8f[_0xa33b('0x29')]['id']),'tags':_0x48ffb1||[]};});}})[_0xa33b('0x1b')](respondWithResult(_0x33c9a8,null))[_0xa33b('0x34')](handleError(_0x33c9a8,null));};exports['removeTags']=function(_0xe20693,_0x198977){return db[_0xa33b('0x2c')]['find']({'where':{'id':_0xe20693[_0xa33b('0x29')]['id']}})[_0xa33b('0x1b')](handleEntityNotFound(_0x198977,null))[_0xa33b('0x1b')](function(_0x4fe900){if(_0x4fe900){return _0x4fe900[_0xa33b('0x51')](_0xe20693[_0xa33b('0x27')][_0xa33b('0x3a')]);}})[_0xa33b('0x1b')](respondWithStatusCode(_0x198977,null))[_0xa33b('0x34')](handleError(_0x198977,null));};exports[_0xa33b('0x52')]=function(_0x2966f1,_0xfa5e98){var _0x40fd39=moment()[_0xa33b('0x53')]()[_0xa33b('0x54')]();var _0x29bc59=path[_0xa33b('0x55')](config[_0xa33b('0x56')],_0xa33b('0x57'),_0xa33b('0x58'),_0xa33b('0x59'));var _0x216904=path[_0xa33b('0x55')](_0x29bc59,_0x40fd39);var _0x8bb3a3=util[_0xa33b('0x5a')](_0xa33b('0x5b'),_0x2966f1['params']['id'],_0x40fd39);var _0x310ab9=path['join'](_0x29bc59,_0x8bb3a3);var _0x2a8b5=[];_0x2a8b5[_0xa33b('0x5c')]({'model':db[_0xa33b('0x5d')],'as':_0xa33b('0x5d'),'attributes':['id','fullname'],'raw':!![]});_0x2a8b5['push']({'model':db[_0xa33b('0x5e')],'as':_0xa33b('0x5f'),'attributes':['id',_0xa33b('0x60'),'lastName'],'raw':!![]});var _0x367886=[{'model':db[_0xa33b('0x3e')],'as':_0xa33b('0x61'),'attributes':['id',_0xa33b('0x36'),_0xa33b('0x62'),_0xa33b('0x63'),_0xa33b('0x64'),_0xa33b('0x65')],'include':_0x2a8b5}];_0x367886[_0xa33b('0x5c')]({'model':db[_0xa33b('0x66')],'as':'Account','attributes':['id',_0xa33b('0x20')]});_0x367886[_0xa33b('0x5c')]({'model':db['User'],'as':_0xa33b('0x67'),'attributes':['id','fullname']});return db[_0xa33b('0x2c')][_0xa33b('0x37')]({'where':{'id':_0x2966f1['params']['id']},'include':_0x367886})[_0xa33b('0x1b')](handleEntityNotFound(_0xfa5e98,null))['then'](function(_0xdb059d){if(_0xdb059d){var _0x57072e=_0xdb059d[_0xa33b('0x68')]({'plain':!![]});fs[_0xa33b('0x69')](_0x216904);var _0x3b3657={'channel':'Sms','account':_0x57072e[_0xa33b('0x6a')]['name'],'agent':_0x57072e[_0xa33b('0x67')]?_0x57072e[_0xa33b('0x67')]['fullname']:_0xa33b('0x6b'),'createdAt':moment(_0x57072e[_0xa33b('0x62')])[_0xa33b('0x5a')](_0xa33b('0x48'))[_0xa33b('0x54')](),'closedAt':_0x57072e['closed']?moment(_0x57072e[_0xa33b('0x6c')])['format'](_0xa33b('0x48'))[_0xa33b('0x54')]():'','disposition':_0x57072e[_0xa33b('0x6d')],'messages':_(_0x57072e[_0xa33b('0x61')])[_0xa33b('0x45')]({'secret':![]})[_0xa33b('0x21')](function(_0x42539d){return{'date':moment(_0x42539d[_0xa33b('0x62')])[_0xa33b('0x5a')](_0xa33b('0x48'))[_0xa33b('0x54')](),'sender':_0x42539d[_0xa33b('0x63')]===_0xa33b('0x6e')?_0x42539d[_0xa33b('0x5d')]?_0x42539d[_0xa33b('0x5d')][_0xa33b('0x6f')]:_0xa33b('0x70'):_0x42539d[_0xa33b('0x5f')]['firstName']+(_0x42539d[_0xa33b('0x5f')][_0xa33b('0x71')]?'\x20'+_0x42539d[_0xa33b('0x5f')]['lastName']:''),'body':_0x42539d[_0xa33b('0x36')],'direction':_0x42539d[_0xa33b('0x63')]===_0xa33b('0x6e')?'A':'C','secret':_0x42539d['secret'],'read':_0x42539d[_0xa33b('0x65')]};})[_0xa33b('0x72')]()};return ejs[_0xa33b('0x73')](path[_0xa33b('0x55')](config['root'],'server',_0xa33b('0x74'),_0xa33b('0x75')),{'interaction':_0x3b3657})[_0xa33b('0x1b')](function(_0x1bf7c7){var _0x10130d=path[_0xa33b('0x55')](_0x216904,_0xa33b('0x76')+_0x57072e['id']+'-'+_0x40fd39+'.pdf');var _0x5bc9c4={'path':_0x10130d,'channel':_0xa33b('0x77'),'interactionId':_0x57072e['id']};return pdf[_0xa33b('0x78')](_0x1bf7c7,_0x5bc9c4);})[_0xa33b('0x1b')](function(){return new BPromise(function(_0x5e0f91,_0x4ac971){zipdir(_0x216904,{'saveTo':_0x310ab9},function(_0x1a1388,_0x4838fa){if(_0x1a1388)return _0x4ac971(_0x1a1388);return _0x5e0f91(_0x4838fa);});})[_0xa33b('0x1b')](function(){return new BPromise(function(_0x42d5db,_0x367407){rimraf(_0x216904,function(_0x28b298){if(_0x28b298)_0x367407(_0x28b298);return _0x42d5db();});});})['then'](function(){return _0xfa5e98[_0xa33b('0x52')](_0x310ab9,_0x8bb3a3,function(_0x5bbfe4){if(_0x5bbfe4){console[_0xa33b('0x79')](_0xa33b('0x7a'),_0x5bbfe4);}else{fs[_0xa33b('0x7b')](_0x310ab9);}});});});}else{return _0xfa5e98[_0xa33b('0x12')](0xc8);}})['catch'](handleError(_0xfa5e98,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 6f01d63..72483e8 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 _0x32f4=['remove','setDataValue','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0x1c3f46,_0x35baec){var _0x1563f8=function(_0x46d075){while(--_0x46d075){_0x1c3f46['push'](_0x1c3f46['shift']());}};_0x1563f8(++_0x35baec);}(_0x32f4,0x154));var _0x432f=function(_0x2ac7a8,_0x3d83f0){_0x2ac7a8=_0x2ac7a8-0x0;var _0x2d4509=_0x32f4[_0x2ac7a8];return _0x2d4509;};'use strict';var EventEmitter=require(_0x432f('0x0'));var SmsInteraction=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var SmsMessage=require(_0x432f('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x432f('0x3')](0x0);var events={'afterCreate':_0x432f('0x4'),'afterUpdate':'update','afterDestroy':_0x432f('0x5')};function emitEvent(_0x1eabac){return function(_0x344a29,_0x355b02,_0x2f5f03){_0x344a29['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2f66fd){_0x344a29[_0x432f('0x6')]('Users',_0x2f66fd[_0x432f('0x7')](function(_0x5aaf1a){return{'id':_0x5aaf1a['id']};}));return SmsMessage[_0x432f('0x8')]({'where':{'SmsInteractionId':_0x344a29['id'],'direction':'in','read':![]},'raw':!![]});})[_0x432f('0x9')](function(_0x3a0d4b){_0x344a29[_0x432f('0x6')](_0x432f('0xa'),_0x3a0d4b['length']);SmsInteractionEvents[_0x432f('0xb')](_0x1eabac+':'+_0x344a29['id'],_0x344a29);SmsInteractionEvents['emit'](_0x1eabac,_0x344a29);_0x2f5f03(null);})[_0x432f('0xc')](_0x2f5f03(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x432f('0xd')](e,emitEvent(event));}}module[_0x432f('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0x0598=['catch','hasOwnProperty','events','../../mysqldb','save','update','setDataValue','Users','map','then','unreadMessages','length'];(function(_0x39f3ed,_0x48bc5e){var _0x3b1802=function(_0x3ca4aa){while(--_0x3ca4aa){_0x39f3ed['push'](_0x39f3ed['shift']());}};_0x3b1802(++_0x48bc5e);}(_0x0598,0x92));var _0x8059=function(_0x4f9124,_0x3ef0f7){_0x4f9124=_0x4f9124-0x0;var _0x518f7c=_0x0598[_0x4f9124];return _0x518f7c;};'use strict';var EventEmitter=require(_0x8059('0x0'));var SmsInteraction=require(_0x8059('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8059('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8059('0x2'),'afterUpdate':_0x8059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54f42f){return function(_0x555fb5,_0x467206,_0xa7d7c1){_0x555fb5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x248273){_0x555fb5[_0x8059('0x4')](_0x8059('0x5'),_0x248273[_0x8059('0x6')](function(_0x5df268){return{'id':_0x5df268['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x555fb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8059('0x7')](function(_0x1bf5fd){_0x555fb5[_0x8059('0x4')](_0x8059('0x8'),_0x1bf5fd[_0x8059('0x9')]);SmsInteractionEvents['emit'](_0x54f42f+':'+_0x555fb5['id'],_0x555fb5);SmsInteractionEvents['emit'](_0x54f42f,_0x555fb5);_0xa7d7c1(null);})[_0x8059('0xa')](_0xa7d7c1(null));};}for(var e in events){if(events[_0x8059('0xb')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index e360c5b..e491ccf 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 _0xb00e=['api','moment','bluebird','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','closed','closedAt','format','lodash','util','../../config/logger'];(function(_0x1692de,_0x13c1a9){var _0x12d03b=function(_0x390af1){while(--_0x390af1){_0x1692de['push'](_0x1692de['shift']());}};_0x12d03b(++_0x13c1a9);}(_0xb00e,0x165));var _0xeb00=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xb00e[_0x500419];return _0x241c1a;};'use strict';var _=require(_0xeb00('0x0'));var util=require(_0xeb00('0x1'));var logger=require(_0xeb00('0x2'))(_0xeb00('0x3'));var moment=require(_0xeb00('0x4'));var BPromise=require(_0xeb00('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb00('0x6'));var config=require(_0xeb00('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xeb00('0x8')]=function(_0x9d7c79,_0x579bc3){return _0x9d7c79[_0xeb00('0x9')](_0xeb00('0xa'),attributes,{'tableName':_0xeb00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54fd64,_0x4bec18,_0x4bc4ab){if(_0x54fd64['changed'](_0xeb00('0xc'))){_0x54fd64[_0xeb00('0xd')]=moment()[_0xeb00('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4bc4ab(null,_0x54fd64);}}});}; \ No newline at end of file +var _0x3f0d=['request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1838e1,_0x791615){var _0x49a5bb=function(_0x27a669){while(--_0x27a669){_0x1838e1['push'](_0x1838e1['shift']());}};_0x49a5bb(++_0x791615);}(_0x3f0d,0xe8));var _0xd3f0=function(_0x3613d5,_0x3dd247){_0x3613d5=_0x3613d5-0x0;var _0x2d9874=_0x3f0d[_0x3613d5];return _0x2d9874;};'use strict';var _=require(_0xd3f0('0x0'));var util=require(_0xd3f0('0x1'));var logger=require(_0xd3f0('0x2'))(_0xd3f0('0x3'));var moment=require(_0xd3f0('0x4'));var BPromise=require(_0xd3f0('0x5'));var rp=require(_0xd3f0('0x6'));var fs=require('fs');var path=require(_0xd3f0('0x7'));var rimraf=require('rimraf');var config=require(_0xd3f0('0x8'));var attributes=require(_0xd3f0('0x9'));module[_0xd3f0('0xa')]=function(_0x5c4eaf,_0x4de23e){return _0x5c4eaf[_0xd3f0('0xb')](_0xd3f0('0xc'),attributes,{'tableName':_0xd3f0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fc653,_0x586989,_0xd0e1b5){if(_0x2fc653[_0xd3f0('0xe')]('closed')){_0x2fc653[_0xd3f0('0xf')]=moment()[_0xd3f0('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0xd0e1b5(null,_0x2fc653);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 88ba083..0b5dd32 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 _0xe827=['spread','AddTags','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateSmsInteraction','body','options','raw','where','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit'];(function(_0x5a5aca,_0x368fbb){var _0x1cb523=function(_0x43f690){while(--_0x43f690){_0x5a5aca['push'](_0x5a5aca['shift']());}};_0x1cb523(++_0x368fbb);}(_0xe827,0x188));var _0x7e82=function(_0x669db3,_0x3ee8ab){_0x669db3=_0x669db3-0x0;var _0x5b3ddc=_0xe827[_0x669db3];return _0x5b3ddc;};'use strict';var _=require('lodash');var util=require(_0x7e82('0x0'));var moment=require('moment');var BPromise=require(_0x7e82('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e82('0x2'))['db'];var utils=require(_0x7e82('0x3'));var logger=require(_0x7e82('0x4'))(_0x7e82('0x5'));var config=require(_0x7e82('0x6'));var jayson=require(_0x7e82('0x7'));var client=jayson['client'][_0x7e82('0x8')]({'port':0x232a});config[_0x7e82('0x9')]=_[_0x7e82('0xa')](config['redis'],{'host':_0x7e82('0xb'),'port':0x18eb});var socket=require(_0x7e82('0xc'))(new Redis(config[_0x7e82('0x9')]));require(_0x7e82('0xd'))[_0x7e82('0xe')](socket);function respondWithRpcPromise(_0x246a82,_0xafab97,_0xf6a3df){return new BPromise(function(_0x45f3e4,_0x4a6027){return client[_0x7e82('0xf')](_0x246a82,_0xf6a3df)[_0x7e82('0x10')](function(_0x5d212c){logger[_0x7e82('0x11')](_0x7e82('0x12'),_0xafab97,_0x7e82('0x13'));logger[_0x7e82('0x14')](_0x7e82('0x15'),_0xafab97,_0x7e82('0x13'),JSON['stringify'](_0x5d212c));if(_0x5d212c[_0x7e82('0x16')]){if(_0x5d212c['error'][_0x7e82('0x17')]===0x1f4){logger['error'](_0x7e82('0x12'),_0xafab97,_0x5d212c['error'][_0x7e82('0x18')]);return _0x4a6027(_0x5d212c[_0x7e82('0x16')][_0x7e82('0x18')]);}logger[_0x7e82('0x16')]('SmsInteraction,\x20%s,\x20%s',_0xafab97,_0x5d212c['error'][_0x7e82('0x18')]);return _0x45f3e4(_0x5d212c[_0x7e82('0x16')]['message']);}else{logger[_0x7e82('0x11')](_0x7e82('0x12'),_0xafab97,_0x7e82('0x13'));_0x45f3e4(_0x5d212c['result'][_0x7e82('0x18')]);}})[_0x7e82('0x19')](function(_0x5bf97a){logger[_0x7e82('0x16')](_0x7e82('0x12'),_0xafab97,_0x5bf97a);_0x4a6027(_0x5bf97a);});});}exports[_0x7e82('0x1a')]=function(_0x464c31){var _0x386384=this;return new Promise(function(_0x339f56,_0x4c3bd8){return db['SmsInteraction']['update'](_0x464c31[_0x7e82('0x1b')],{'raw':_0x464c31[_0x7e82('0x1c')]?_0x464c31[_0x7e82('0x1c')][_0x7e82('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x464c31[_0x7e82('0x1c')]?_0x464c31[_0x7e82('0x1c')][_0x7e82('0x1e')]||null:null,'attributes':_0x464c31['options']?_0x464c31['options']['attributes']||null:null,'limit':_0x464c31['options']?_0x464c31['options']['limit']||null:null})[_0x7e82('0x10')](function(_0x2ebfe4){logger[_0x7e82('0x11')](_0x7e82('0x1a'),_0x464c31);logger[_0x7e82('0x14')]('UpdateSmsInteraction',_0x464c31,JSON[_0x7e82('0x1f')](_0x2ebfe4));_0x339f56(_0x2ebfe4);})[_0x7e82('0x19')](function(_0xd1a6b3){logger[_0x7e82('0x16')](_0x7e82('0x1a'),_0xd1a6b3['message'],_0x464c31);_0x4c3bd8(_0x386384[_0x7e82('0x16')](0x1f4,_0xd1a6b3['message']));});});};exports[_0x7e82('0x20')]=function(_0x58d428){return new Promise(function(_0x6a3bd4,_0x591d18){return db['SmsInteraction'][_0x7e82('0x21')]({'where':_0x58d428[_0x7e82('0x1c')]?_0x58d428['options'][_0x7e82('0x1e')]||null:null})[_0x7e82('0x10')](function(_0x9ed8c2){if(_0x9ed8c2){return _0x9ed8c2[_0x7e82('0x22')](_0x58d428[_0x7e82('0x1b')][_0x7e82('0x23')],_[_0x7e82('0x24')](_0x58d428[_0x7e82('0x1b')],[_0x7e82('0x23'),'id'])||{});}})[_0x7e82('0x25')](function(_0x27ab06){logger['info'](_0x7e82('0x26'),_0x58d428);logger[_0x7e82('0x14')](_0x7e82('0x26'),_0x58d428,JSON[_0x7e82('0x1f')](_0x27ab06));_0x6a3bd4(_0x27ab06);})[_0x7e82('0x19')](function(_0x4612b){logger[_0x7e82('0x16')](_0x7e82('0x26'),_0x4612b[_0x7e82('0x18')],_0x58d428);_0x591d18(_this[_0x7e82('0x16')](0x1f4,_0x4612b['message']));});});}; \ No newline at end of file +var _0xd805=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','SmsInteraction','update','options','raw','attributes','limit','UpdateSmsInteraction','debug','find','where','body','ids','spread','AddTags','util'];(function(_0x5b3518,_0x3b6617){var _0xf53d53=function(_0x52877e){while(--_0x52877e){_0x5b3518['push'](_0x5b3518['shift']());}};_0xf53d53(++_0x3b6617);}(_0xd805,0x77));var _0x5d80=function(_0x263f81,_0x490cad){_0x263f81=_0x263f81-0x0;var _0xf2563=_0xd805[_0x263f81];return _0xf2563;};'use strict';var _=require('lodash');var util=require(_0x5d80('0x0'));var moment=require(_0x5d80('0x1'));var BPromise=require(_0x5d80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d80('0x3'));var db=require(_0x5d80('0x4'))['db'];var utils=require(_0x5d80('0x5'));var logger=require('../../config/logger')(_0x5d80('0x6'));var config=require(_0x5d80('0x7'));var jayson=require(_0x5d80('0x8'));var client=jayson[_0x5d80('0x9')][_0x5d80('0xa')]({'port':0x232a});config[_0x5d80('0xb')]=_['defaults'](config[_0x5d80('0xb')],{'host':_0x5d80('0xc'),'port':0x18eb});var socket=require(_0x5d80('0xd'))(new Redis(config[_0x5d80('0xb')]));require(_0x5d80('0xe'))['register'](socket);function respondWithRpcPromise(_0x4e4636,_0x49abb4,_0x4e690d){return new BPromise(function(_0x1969f4,_0x3e6472){return client[_0x5d80('0xf')](_0x4e4636,_0x4e690d)[_0x5d80('0x10')](function(_0x1988f6){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x49abb4,_0x5d80('0x11'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x49abb4,_0x5d80('0x11'),JSON[_0x5d80('0x12')](_0x1988f6));if(_0x1988f6['error']){if(_0x1988f6[_0x5d80('0x13')][_0x5d80('0x14')]===0x1f4){logger[_0x5d80('0x13')](_0x5d80('0x15'),_0x49abb4,_0x1988f6['error'][_0x5d80('0x16')]);return _0x3e6472(_0x1988f6[_0x5d80('0x13')][_0x5d80('0x16')]);}logger[_0x5d80('0x13')](_0x5d80('0x15'),_0x49abb4,_0x1988f6[_0x5d80('0x13')][_0x5d80('0x16')]);return _0x1969f4(_0x1988f6[_0x5d80('0x13')]['message']);}else{logger[_0x5d80('0x17')](_0x5d80('0x15'),_0x49abb4,_0x5d80('0x11'));_0x1969f4(_0x1988f6[_0x5d80('0x18')][_0x5d80('0x16')]);}})[_0x5d80('0x19')](function(_0xd09c4f){logger[_0x5d80('0x13')](_0x5d80('0x15'),_0x49abb4,_0xd09c4f);_0x3e6472(_0xd09c4f);});});}exports['UpdateSmsInteraction']=function(_0x437b3e){var _0x41e530=this;return new Promise(function(_0x49384a,_0x39e86a){return db[_0x5d80('0x1a')][_0x5d80('0x1b')](_0x437b3e['body'],{'raw':_0x437b3e[_0x5d80('0x1c')]?_0x437b3e[_0x5d80('0x1c')][_0x5d80('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x437b3e[_0x5d80('0x1c')]?_0x437b3e[_0x5d80('0x1c')]['where']||null:null,'attributes':_0x437b3e['options']?_0x437b3e['options'][_0x5d80('0x1e')]||null:null,'limit':_0x437b3e[_0x5d80('0x1c')]?_0x437b3e[_0x5d80('0x1c')][_0x5d80('0x1f')]||null:null})[_0x5d80('0x10')](function(_0x39afd8){logger[_0x5d80('0x17')](_0x5d80('0x20'),_0x437b3e);logger[_0x5d80('0x21')]('UpdateSmsInteraction',_0x437b3e,JSON['stringify'](_0x39afd8));_0x49384a(_0x39afd8);})[_0x5d80('0x19')](function(_0x2d7b01){logger[_0x5d80('0x13')]('UpdateSmsInteraction',_0x2d7b01['message'],_0x437b3e);_0x39e86a(_0x41e530[_0x5d80('0x13')](0x1f4,_0x2d7b01[_0x5d80('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0xad7c11){return new Promise(function(_0xb0fbd8,_0x5f0239){return db[_0x5d80('0x1a')][_0x5d80('0x22')]({'where':_0xad7c11['options']?_0xad7c11[_0x5d80('0x1c')][_0x5d80('0x23')]||null:null})[_0x5d80('0x10')](function(_0x26f6c9){if(_0x26f6c9){return _0x26f6c9['addTags'](_0xad7c11[_0x5d80('0x24')][_0x5d80('0x25')],_['omit'](_0xad7c11[_0x5d80('0x24')],[_0x5d80('0x25'),'id'])||{});}})[_0x5d80('0x26')](function(_0x51dd22){logger[_0x5d80('0x17')](_0x5d80('0x27'),_0xad7c11);logger[_0x5d80('0x21')](_0x5d80('0x27'),_0xad7c11,JSON['stringify'](_0x51dd22));_0xb0fbd8(_0x51dd22);})[_0x5d80('0x19')](function(_0x367d59){logger[_0x5d80('0x13')](_0x5d80('0x27'),_0x367d59['message'],_0xad7c11);_0x5f0239(_this[_0x5d80('0x13')](0x1f4,_0x367d59[_0x5d80('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a7fb403..e408e4e 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 _0x736c=['removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x5897e2,_0x1be15f){var _0x44db2a=function(_0x5733f6){while(--_0x5733f6){_0x5897e2['push'](_0x5897e2['shift']());}};_0x44db2a(++_0x1be15f);}(_0x736c,0x1bd));var _0xc736=function(_0x1f0d91,_0x24b032){_0x1f0d91=_0x1f0d91-0x0;var _0xafee7a=_0x736c[_0x1f0d91];return _0xafee7a;};'use strict';var SmsInteractionEvents=require(_0xc736('0x0'));var events=[_0xc736('0x1'),_0xc736('0x2'),'update'];function createListener(_0x3bcb9e,_0x326d25){return function(_0x1b2a3d){_0x326d25['emit'](_0x3bcb9e,_0x1b2a3d);};}function removeListener(_0x223993,_0x36fe6a){return function(){SmsInteractionEvents[_0xc736('0x3')](_0x223993,_0x36fe6a);};}exports[_0xc736('0x4')]=function(_0x53ccc5){for(var _0x5ca3a3=0x0,_0xc8d8e1=events[_0xc736('0x5')];_0x5ca3a3<_0xc8d8e1;_0x5ca3a3++){var _0x1e1181=events[_0x5ca3a3];var _0x1e1817=createListener(_0xc736('0x6')+_0x1e1181,_0x53ccc5);SmsInteractionEvents['on'](_0x1e1181,_0x1e1817);}}; \ No newline at end of file +var _0x3882=['save','update','emit','register','length','smsInteraction:'];(function(_0x1602da,_0x1525c7){var _0x3c079c=function(_0x4588c5){while(--_0x4588c5){_0x1602da['push'](_0x1602da['shift']());}};_0x3c079c(++_0x1525c7);}(_0x3882,0x114));var _0x2388=function(_0x930896,_0x15eed1){_0x930896=_0x930896-0x0;var _0x4a29f7=_0x3882[_0x930896];return _0x4a29f7;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2388('0x0'),'remove',_0x2388('0x1')];function createListener(_0x239b5b,_0x2f6a4e){return function(_0x5926a0){_0x2f6a4e[_0x2388('0x2')](_0x239b5b,_0x5926a0);};}function removeListener(_0x441bd4,_0x155d86){return function(){SmsInteractionEvents['removeListener'](_0x441bd4,_0x155d86);};}exports[_0x2388('0x3')]=function(_0x8ff721){for(var _0x18eaaa=0x0,_0x2f9c62=events[_0x2388('0x4')];_0x18eaaa<_0x2f9c62;_0x18eaaa++){var _0x27fcab=events[_0x18eaaa];var _0x1971f2=createListener(_0x2388('0x5')+_0x27fcab,_0x8ff721);SmsInteractionEvents['on'](_0x27fcab,_0x1971f2);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9afa9c4..bee5bfd 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 _0xe139=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/reject','reject','delete','destroy','exports','multer','path'];(function(_0xfa8977,_0x5d806e){var _0x6b64a2=function(_0x17daca){while(--_0x17daca){_0xfa8977['push'](_0xfa8977['shift']());}};_0x6b64a2(++_0x5d806e);}(_0xe139,0x1eb));var _0x9e13=function(_0x23e65b,_0x552a3e){_0x23e65b=_0x23e65b-0x0;var _0x173a8e=_0xe139[_0x23e65b];return _0x173a8e;};'use strict';var multer=require(_0x9e13('0x0'));var util=require('util');var path=require(_0x9e13('0x1'));var timeout=require(_0x9e13('0x2'));var express=require(_0x9e13('0x3'));var router=express['Router']();var fs_extra=require(_0x9e13('0x4'));var auth=require(_0x9e13('0x5'));var interaction=require(_0x9e13('0x6'));var config=require(_0x9e13('0x7'));var controller=require(_0x9e13('0x8'));router['get']('/',auth[_0x9e13('0x9')](),controller[_0x9e13('0xa')]);router[_0x9e13('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x9e13('0xc')]);router[_0x9e13('0xb')](_0x9e13('0xd'),auth[_0x9e13('0x9')](),controller[_0x9e13('0xe')]);router[_0x9e13('0xf')]('/',auth[_0x9e13('0x9')](),interaction[_0x9e13('0x10')](_0x9e13('0x11'),_0x9e13('0x12')),controller[_0x9e13('0x13')]);router[_0x9e13('0xf')](_0x9e13('0x14'),controller[_0x9e13('0x15')]);router[_0x9e13('0x16')]('/:id',auth[_0x9e13('0x9')](),controller[_0x9e13('0x17')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x9e13('0x16')](_0x9e13('0x18'),auth['isAuthenticated'](),controller[_0x9e13('0x19')]);router[_0x9e13('0x1a')](_0x9e13('0xd'),auth[_0x9e13('0x9')](),controller[_0x9e13('0x1b')]);module[_0x9e13('0x1c')]=router; \ No newline at end of file +var _0x707b=['update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','show','sms','create','post','/:id/status','status','put','/:id'];(function(_0x4344a7,_0x157f6d){var _0x1a8b6d=function(_0x5141d2){while(--_0x5141d2){_0x4344a7['push'](_0x4344a7['shift']());}};_0x1a8b6d(++_0x157f6d);}(_0x707b,0xdf));var _0xb707=function(_0x50bca7,_0xb23979){_0x50bca7=_0x50bca7-0x0;var _0x40e5ee=_0x707b[_0x50bca7];return _0x40e5ee;};'use strict';var multer=require(_0xb707('0x0'));var util=require(_0xb707('0x1'));var path=require(_0xb707('0x2'));var timeout=require('connect-timeout');var express=require(_0xb707('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb707('0x4'));var interaction=require(_0xb707('0x5'));var config=require(_0xb707('0x6'));var controller=require(_0xb707('0x7'));router[_0xb707('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb707('0x9'),auth[_0xb707('0xa')](),controller[_0xb707('0xb')]);router[_0xb707('0x8')]('/:id',auth[_0xb707('0xa')](),controller[_0xb707('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xb707('0xd'),'smsmessage:create'),controller[_0xb707('0xe')]);router[_0xb707('0xf')](_0xb707('0x10'),controller[_0xb707('0x11')]);router[_0xb707('0x12')](_0xb707('0x13'),auth[_0xb707('0xa')](),controller[_0xb707('0x14')]);router['put'](_0xb707('0x15'),auth[_0xb707('0xa')](),controller[_0xb707('0x16')]);router['put'](_0xb707('0x17'),auth['isAuthenticated'](),controller[_0xb707('0x18')]);router[_0xb707('0x19')](_0xb707('0x13'),auth[_0xb707('0xa')](),controller[_0xb707('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 7e8a4ee..2b7dbf4 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 _0xc815=['out','DATE','TEXT','sequelize','exports','BOOLEAN','ENUM'];(function(_0x4193c8,_0x4c0936){var _0x1b7a11=function(_0x424cb8){while(--_0x424cb8){_0x4193c8['push'](_0x4193c8['shift']());}};_0x1b7a11(++_0x4c0936);}(_0xc815,0x15a));var _0x5c81=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc815[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require(_0x5c81('0x0'));module[_0x5c81('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5c81('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c81('0x3')]('in','out'),'defaultValue':_0x5c81('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x5c81('0x5')]},'secret':{'type':Sequelize[_0x5c81('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x5c81('0x6')]}}; \ No newline at end of file +var _0xdf32=['exports','TEXT','ENUM','out','STRING','DATE'];(function(_0x203670,_0x52d68c){var _0x41042a=function(_0x5dbd39){while(--_0x5dbd39){_0x203670['push'](_0x203670['shift']());}};_0x41042a(++_0x52d68c);}(_0xdf32,0x1bc));var _0x2df3=function(_0x1d6449,_0x16cbb3){_0x1d6449=_0x1d6449-0x0;var _0x4072a8=_0xdf32[_0x1d6449];return _0x4072a8;};'use strict';var Sequelize=require('sequelize');module[_0x2df3('0x0')]={'body':{'type':Sequelize[_0x2df3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2df3('0x2')]('in',_0x2df3('0x3')),'defaultValue':_0x2df3('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x2df3('0x4')]},'readAt':{'type':Sequelize[_0x2df3('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x2df3('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index d52be80..56761e5 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 _0x68ee=['keys','rawAttributes','catch','create','body','update','destroy','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','indexOf','sent','delivered','Status','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','end','stack','name','send','index','SmsMessage','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params'];(function(_0x5f114c,_0x11bd95){var _0x49f31c=function(_0x3cbe8b){while(--_0x3cbe8b){_0x5f114c['push'](_0x5f114c['shift']());}};_0x49f31c(++_0x11bd95);}(_0x68ee,0xd3));var _0xe68e=function(_0x558684,_0x28f449){_0x558684=_0x558684-0x0;var _0x13859b=_0x68ee[_0x558684];return _0x13859b;};'use strict';var emlformat=require(_0xe68e('0x0'));var rimraf=require(_0xe68e('0x1'));var zipdir=require(_0xe68e('0x2'));var jsonpatch=require(_0xe68e('0x3'));var rp=require(_0xe68e('0x4'));var moment=require(_0xe68e('0x5'));var BPromise=require(_0xe68e('0x6'));var Mustache=require(_0xe68e('0x7'));var util=require('util');var path=require(_0xe68e('0x8'));var sox=require('sox');var csv=require(_0xe68e('0x9'));var ejs=require(_0xe68e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe68e('0xb'));var squel=require(_0xe68e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe68e('0xd'));var deskjs=require(_0xe68e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe68e('0xf'));var Papa=require(_0xe68e('0x10'));var Redis=require('ioredis');var authService=require(_0xe68e('0x11'));var qs=require(_0xe68e('0x12'));var as=require(_0xe68e('0x13'));var hardwareService=require(_0xe68e('0x14'));var logger=require(_0xe68e('0x15'))(_0xe68e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe68e('0x17'));var db=require(_0xe68e('0x18'))['db'];config[_0xe68e('0x19')]=_[_0xe68e('0x1a')](config[_0xe68e('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe68e('0x1b'))(new Redis(config['redis']));require(_0xe68e('0x1c'))[_0xe68e('0x1d')](socket);var jayson=require(_0xe68e('0x1e'));var client=jayson[_0xe68e('0x1f')][_0xe68e('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xe68e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x215a9e,_0x14a53c,_0x25cc4f,_0x504645){return new BPromise(function(_0x18ed40,_0x57aee8){var _0xa263af=_0x504645||client;return _0xa263af[_0xe68e('0x21')](_0x215a9e,_0x25cc4f)[_0xe68e('0x22')](function(_0x329044){logger[_0xe68e('0x23')](_0xe68e('0x24'),_0x14a53c,_0xe68e('0x25'));logger[_0xe68e('0x26')](_0xe68e('0x27'),_0x14a53c,_0xe68e('0x25'),JSON[_0xe68e('0x28')](_0x329044));if(_0x329044[_0xe68e('0x29')]){if(_0x329044[_0xe68e('0x29')][_0xe68e('0x2a')]===0x1f4){logger['error'](_0xe68e('0x24'),_0x14a53c,_0x329044[_0xe68e('0x29')][_0xe68e('0x2b')]);return _0x57aee8(_0x329044[_0xe68e('0x29')][_0xe68e('0x2b')]);}logger[_0xe68e('0x29')](_0xe68e('0x24'),_0x14a53c,_0x329044[_0xe68e('0x29')][_0xe68e('0x2b')]);return _0x18ed40(_0x329044['error'][_0xe68e('0x2b')]);}else{logger['info'](_0xe68e('0x24'),_0x14a53c,_0xe68e('0x25'));_0x18ed40(_0x329044[_0xe68e('0x2c')][_0xe68e('0x2b')]);}})['catch'](function(_0x343cd7){logger[_0xe68e('0x29')](_0xe68e('0x24'),_0x14a53c,_0x343cd7);_0x57aee8(_0x343cd7);});});}function respondWithStatusCode(_0x5c5a6f,_0x5dea74){_0x5dea74=_0x5dea74||0xcc;return function(_0x1a72aa){if(_0x1a72aa){return _0x5c5a6f[_0xe68e('0x2d')](_0x5dea74);}return _0x5c5a6f[_0xe68e('0x2e')](_0x5dea74)['end']();};}function respondWithResult(_0x20bfdf,_0x183de9){_0x183de9=_0x183de9||0xc8;return function(_0x35895d){if(_0x35895d){return _0x20bfdf['status'](_0x183de9)['json'](_0x35895d);}};}function respondWithFilteredResult(_0x2429cc,_0x5510b3){return function(_0x3a78b7){if(_0x3a78b7){var _0x34938e=typeof _0x5510b3[_0xe68e('0x2f')]===_0xe68e('0x30')&&typeof _0x5510b3[_0xe68e('0x31')]===_0xe68e('0x30');var _0x468a24=_0x3a78b7['count'];var _0x38c6eb=_0x34938e?0x0:_0x5510b3[_0xe68e('0x2f')];var _0x563a10=_0x34938e?_0x3a78b7[_0xe68e('0x32')]:_0x5510b3['offset']+_0x5510b3[_0xe68e('0x31')];var _0x23cdcd;if(_0x563a10>=_0x468a24){_0x563a10=_0x468a24;_0x23cdcd=0xc8;}else{_0x23cdcd=0xce;}_0x2429cc[_0xe68e('0x2e')](_0x23cdcd);return _0x2429cc['set'](_0xe68e('0x33'),_0x38c6eb+'-'+_0x563a10+'/'+_0x468a24)['json'](_0x3a78b7);}return null;};}function patchUpdates(_0x249ab2){return function(_0x4e6a27){try{jsonpatch[_0xe68e('0x34')](_0x4e6a27,_0x249ab2,!![]);}catch(_0x5d3531){return BPromise[_0xe68e('0x35')](_0x5d3531);}return _0x4e6a27[_0xe68e('0x36')]();};}function saveUpdates(_0x58e558,_0x178ab8){return function(_0x42cc0b){if(_0x42cc0b){return _0x42cc0b['update'](_0x58e558)[_0xe68e('0x22')](function(_0x3dfabd){return _0x3dfabd;});}return null;};}function removeEntity(_0x26a80b,_0x4ba3bc){return function(_0x27d414){if(_0x27d414){return _0x27d414['destroy']()[_0xe68e('0x22')](function(){_0x26a80b[_0xe68e('0x2e')](0xcc)[_0xe68e('0x37')]();});}};}function handleEntityNotFound(_0x292acf,_0x1da1d7){return function(_0x4689d8){if(!_0x4689d8){_0x292acf['sendStatus'](0x194);}return _0x4689d8;};}function handleError(_0x4a7b7c,_0xe57ec0){_0xe57ec0=_0xe57ec0||0x1f4;return function(_0x2fc403){logger[_0xe68e('0x29')](_0x2fc403[_0xe68e('0x38')]);if(_0x2fc403[_0xe68e('0x39')]){delete _0x2fc403[_0xe68e('0x39')];}_0x4a7b7c[_0xe68e('0x2e')](_0xe57ec0)[_0xe68e('0x3a')](_0x2fc403);};}exports[_0xe68e('0x3b')]=function(_0xd96811,_0x1a3aa9){var _0x1aacb1={},_0xa6387c={},_0x5a6b7d={'count':0x0,'rows':[]};var _0x548ed4=_['map'](db[_0xe68e('0x3c')]['rawAttributes'],function(_0x15e60b){return{'name':_0x15e60b[_0xe68e('0x3d')],'type':_0x15e60b[_0xe68e('0x3e')][_0xe68e('0x3f')]};});_0xa6387c['model']=_[_0xe68e('0x40')](_0x548ed4,_0xe68e('0x39'));_0xa6387c[_0xe68e('0x41')]=_['keys'](_0xd96811[_0xe68e('0x41')]);_0xa6387c[_0xe68e('0x42')]=_[_0xe68e('0x43')](_0xa6387c[_0xe68e('0x44')],_0xa6387c[_0xe68e('0x41')]);_0x1aacb1['attributes']=_[_0xe68e('0x43')](_0xa6387c['model'],qs[_0xe68e('0x45')](_0xd96811[_0xe68e('0x41')][_0xe68e('0x45')]));_0x1aacb1['attributes']=_0x1aacb1[_0xe68e('0x46')][_0xe68e('0x47')]?_0x1aacb1[_0xe68e('0x46')]:_0xa6387c[_0xe68e('0x44')];if(!_0xd96811[_0xe68e('0x41')][_0xe68e('0x48')]('nolimit')){_0x1aacb1[_0xe68e('0x31')]=qs[_0xe68e('0x31')](_0xd96811['query'][_0xe68e('0x31')]);_0x1aacb1[_0xe68e('0x2f')]=qs[_0xe68e('0x2f')](_0xd96811[_0xe68e('0x41')]['offset']);}_0x1aacb1[_0xe68e('0x49')]=qs[_0xe68e('0x4a')](_0xd96811[_0xe68e('0x41')]['sort']);_0x1aacb1[_0xe68e('0x4b')]=qs[_0xe68e('0x42')](_[_0xe68e('0x4c')](_0xd96811[_0xe68e('0x41')],_0xa6387c[_0xe68e('0x42')]),_0x548ed4);if(_0xd96811[_0xe68e('0x41')][_0xe68e('0x4d')]){_0x1aacb1[_0xe68e('0x4b')]=_[_0xe68e('0x4e')](_0x1aacb1['where'],{'$or':_[_0xe68e('0x40')](_0x548ed4,function(_0x51ac19){if(_0x51ac19[_0xe68e('0x3e')]!==_0xe68e('0x4f')){var _0x43a728={};_0x43a728[_0x51ac19['name']]={'$like':'%'+_0xd96811['query'][_0xe68e('0x4d')]+'%'};return _0x43a728;}})});}_0x1aacb1=_[_0xe68e('0x4e')]({},_0x1aacb1,_0xd96811[_0xe68e('0x50')]);var _0x688d6d={'where':_0x1aacb1[_0xe68e('0x4b')]};return db[_0xe68e('0x3c')][_0xe68e('0x32')](_0x688d6d)['then'](function(_0x5e3cd1){_0x5a6b7d[_0xe68e('0x32')]=_0x5e3cd1;if(_0xd96811[_0xe68e('0x41')][_0xe68e('0x51')]){_0x1aacb1[_0xe68e('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0xe68e('0x53')](_0x1aacb1);})['then'](function(_0xec34a6){_0x5a6b7d[_0xe68e('0x54')]=_0xec34a6;return _0x5a6b7d;})['then'](respondWithFilteredResult(_0x1a3aa9,_0x1aacb1))['catch'](handleError(_0x1a3aa9,null));};exports[_0xe68e('0x55')]=function(_0x31a119,_0x47d049){var _0x5ac6d0={'raw':!![],'where':{'id':_0x31a119[_0xe68e('0x56')]['id']}},_0x283d93={};_0x283d93[_0xe68e('0x44')]=_[_0xe68e('0x57')](db['SmsMessage'][_0xe68e('0x58')]);_0x283d93[_0xe68e('0x41')]=_[_0xe68e('0x57')](_0x31a119[_0xe68e('0x41')]);_0x283d93[_0xe68e('0x42')]=_['intersection'](_0x283d93['model'],_0x283d93[_0xe68e('0x41')]);_0x5ac6d0['attributes']=_[_0xe68e('0x43')](_0x283d93[_0xe68e('0x44')],qs[_0xe68e('0x45')](_0x31a119[_0xe68e('0x41')][_0xe68e('0x45')]));_0x5ac6d0[_0xe68e('0x46')]=_0x5ac6d0['attributes'][_0xe68e('0x47')]?_0x5ac6d0[_0xe68e('0x46')]:_0x283d93[_0xe68e('0x44')];if(_0x31a119[_0xe68e('0x41')]['includeAll']){_0x5ac6d0[_0xe68e('0x52')]=[{'all':!![]}];}_0x5ac6d0=_[_0xe68e('0x4e')]({},_0x5ac6d0,_0x31a119[_0xe68e('0x50')]);return db['SmsMessage']['find'](_0x5ac6d0)['then'](handleEntityNotFound(_0x47d049,null))[_0xe68e('0x22')](respondWithResult(_0x47d049,null))[_0xe68e('0x59')](handleError(_0x47d049,null));};exports[_0xe68e('0x5a')]=function(_0x32d3ab,_0x45d1ba){return db[_0xe68e('0x3c')][_0xe68e('0x5a')](_0x32d3ab[_0xe68e('0x5b')],{})[_0xe68e('0x22')](respondWithResult(_0x45d1ba,0xc9))[_0xe68e('0x59')](handleError(_0x45d1ba,null));};exports[_0xe68e('0x5c')]=function(_0x1cecb9,_0x4c3a7e){if(_0x1cecb9[_0xe68e('0x5b')]['id']){delete _0x1cecb9[_0xe68e('0x5b')]['id'];}return db[_0xe68e('0x3c')]['find']({'where':{'id':_0x1cecb9[_0xe68e('0x56')]['id']}})[_0xe68e('0x22')](handleEntityNotFound(_0x4c3a7e,null))[_0xe68e('0x22')](saveUpdates(_0x1cecb9[_0xe68e('0x5b')],null))['then'](respondWithResult(_0x4c3a7e,null))[_0xe68e('0x59')](handleError(_0x4c3a7e,null));};exports[_0xe68e('0x5d')]=function(_0x3fb561,_0x7334f5){return db['SmsMessage']['find']({'where':{'id':_0x3fb561[_0xe68e('0x56')]['id']}})[_0xe68e('0x22')](handleEntityNotFound(_0x7334f5,null))[_0xe68e('0x22')](removeEntity(_0x7334f5,null))['catch'](handleError(_0x7334f5,null));};exports[_0xe68e('0x5e')]=function(_0x89ab9f,_0x440742){return db[_0xe68e('0x3c')][_0xe68e('0x5e')]()[_0xe68e('0x22')](respondWithResult(_0x440742,null))[_0xe68e('0x59')](handleError(_0x440742,null));};var interaction_log=require(_0xe68e('0x15'))(_0xe68e('0x5f'));exports[_0xe68e('0x60')]=function(_0x48ee0d,_0x5e9a03,_0x1aa421){var _0x392cef={'agent':{},'channel':'sms'};if(_0x48ee0d['body']['id']){delete _0x48ee0d[_0xe68e('0x5b')]['id'];}_0x48ee0d['body'][_0xe68e('0x61')]=!![];_0x48ee0d[_0xe68e('0x5b')]['readAt']=moment()[_0xe68e('0x62')](_0xe68e('0x63'));_0x48ee0d[_0xe68e('0x5b')][_0xe68e('0x64')]=_0x48ee0d[_0xe68e('0x5b')][_0xe68e('0x64')]||_0x48ee0d[_0xe68e('0x65')]['id'];_0x392cef['agent']['id']=_0x48ee0d['body'][_0xe68e('0x64')];return db['SmsMessage'][_0xe68e('0x66')]({'where':{'id':_0x48ee0d[_0xe68e('0x56')]['id'],'UserId':null}})[_0xe68e('0x22')](handleEntityNotFound(_0x5e9a03,null))['then'](saveUpdates(_0x48ee0d['body'],null))[_0xe68e('0x22')](function(_0x1ffcfb){if(_0x1ffcfb){_0x392cef[_0xe68e('0x2b')]=_0x1ffcfb['get']({'plain':!![]});return db[_0xe68e('0x67')]['find']({'where':{'id':_0x1ffcfb[_0xe68e('0x68')]}});}return null;})[_0xe68e('0x22')](handleEntityNotFound(_0x5e9a03,null))[_0xe68e('0x22')](function(_0x287ce3){if(_0x287ce3){return _0x287ce3[_0xe68e('0x5c')]({'UserId':_0x48ee0d[_0xe68e('0x5b')][_0xe68e('0x64')],'read1stAt':_[_0xe68e('0x69')](_0x287ce3[_0xe68e('0x6a')])?moment()[_0xe68e('0x62')](_0xe68e('0x63')):undefined});}return null;})[_0xe68e('0x22')](function(_0x5581cd){if(_0x5581cd){_0x392cef[_0xe68e('0x6b')]=_0x5581cd['get']({'plain':!![]});interaction_log[_0xe68e('0x23')](_0xe68e('0x6c'),_0x48ee0d[_0xe68e('0x65')]['id'],_0x48ee0d['user'][_0xe68e('0x39')],_0x48ee0d[_0xe68e('0x65')][_0xe68e('0x6d')],_0x392cef[_0xe68e('0x6b')]['id'],_0x48ee0d[_0xe68e('0x5b')]?JSON[_0xe68e('0x28')](_0x48ee0d[_0xe68e('0x5b')]):_0xe68e('0x6e'));return respondWithRpcPromise(_0xe68e('0x6f'),_0xe68e('0x70'),_0x392cef);}return null;})[_0xe68e('0x22')](function(_0x33d2ff){var _0x1bcaa7=_0xe68e('0x71')+_0x33d2ff[_0xe68e('0x2b')]['ContactId'];return db[_0xe68e('0x72')][_0xe68e('0x41')](_0x1bcaa7,{'type':db['Sequelize'][_0xe68e('0x73')]['SELECT'],'raw':!![]})['then'](function(_0x137193){return _0x137193;});})[_0xe68e('0x22')](function(_0x4607db){if(_0x4607db){_0x392cef['message'][_0xe68e('0x74')]=_0x4607db[0x0];if(!_0x48ee0d[_0xe68e('0x5b')][_0xe68e('0x64')])return;return db['User']['find']({'where':{'id':_0x48ee0d['body']['UserId'],'role':_0xe68e('0x75')},'attributes':['id',_0xe68e('0x39'),_0xe68e('0x76'),_0xe68e('0x77'),_0xe68e('0x78')],'raw':!![]});}return null;})[_0xe68e('0x22')](function(_0x18453b){if(!_0x18453b)return null;_0x392cef[_0xe68e('0x2b')][_0xe68e('0x75')]=_0x18453b;return _0x392cef;})[_0xe68e('0x22')](function(_0x2c371c){if(_0x2c371c){if(_0x48ee0d[_0xe68e('0x5b')][_0xe68e('0x79')]){_0x392cef['message'][_0xe68e('0x7a')]=util[_0xe68e('0x62')](_0xe68e('0x7b'),_0x48ee0d[_0xe68e('0x65')][_0xe68e('0x39')]);_0x392cef[_0xe68e('0x2b')][_0xe68e('0x7c')]=_0x392cef['channel'];_0x392cef[_0xe68e('0x2b')][_0xe68e('0x7d')]=_0x392cef[_0xe68e('0x7c')];_0x392cef[_0xe68e('0x2b')][_0xe68e('0x7e')]=_0xe68e('0x60');return respondWithRpcPromise('EventManager',_0xe68e('0x7f'),{'event':_0xe68e('0x80'),'message':_0x392cef['message']},client9002)[_0xe68e('0x22')](function(){return _0x392cef;});}return _0x392cef;}return null;})[_0xe68e('0x22')](respondWithResult(_0x5e9a03,null))['catch'](handleError(_0x5e9a03,null));};var interaction_log=require(_0xe68e('0x15'))(_0xe68e('0x5f'));exports[_0xe68e('0x35')]=function(_0x28e793,_0x5338c2,_0x548a10){var _0x22ba77={'agent':{},'channel':'sms'};if(_0x28e793[_0xe68e('0x5b')]['id']){delete _0x28e793[_0xe68e('0x5b')]['id'];}_0x28e793[_0xe68e('0x5b')][_0xe68e('0x64')]=_0x28e793['body'][_0xe68e('0x64')]||_0x28e793[_0xe68e('0x65')]['id'];_0x22ba77['agent']['id']=_0x28e793[_0xe68e('0x5b')][_0xe68e('0x64')];return db[_0xe68e('0x3c')][_0xe68e('0x66')]({'where':{'id':_0x28e793[_0xe68e('0x56')]['id'],'UserId':null}})[_0xe68e('0x22')](handleEntityNotFound(_0x5338c2,null))['then'](function(_0x2f0799){if(_0x2f0799){_0x22ba77[_0xe68e('0x2b')]=_0x2f0799[_0xe68e('0x81')]({'plain':!![]});return db[_0xe68e('0x67')]['find']({'where':{'id':_0x2f0799[_0xe68e('0x68')]}});}return null;})[_0xe68e('0x22')](handleEntityNotFound(_0x5338c2,null))[_0xe68e('0x22')](function(_0x471070){if(_0x471070){_0x22ba77[_0xe68e('0x6b')]=_0x471070[_0xe68e('0x81')]({'plain':!![]});interaction_log[_0xe68e('0x23')](_0xe68e('0x82'),_0x28e793[_0xe68e('0x65')]['id'],_0x28e793[_0xe68e('0x65')]['name'],_0x28e793[_0xe68e('0x65')][_0xe68e('0x6d')],_0x22ba77[_0xe68e('0x6b')]['id'],_0x28e793[_0xe68e('0x5b')]?JSON[_0xe68e('0x28')](_0x28e793[_0xe68e('0x5b')]):_0xe68e('0x6e'));return respondWithRpcPromise(_0xe68e('0x83'),_0xe68e('0x84'),_0x22ba77);}return null;})['then'](function(_0x25787e){var _0x4a8db2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25787e[_0xe68e('0x2b')][_0xe68e('0x85')];return db[_0xe68e('0x72')][_0xe68e('0x41')](_0x4a8db2,{'type':db[_0xe68e('0x86')][_0xe68e('0x73')]['SELECT'],'raw':!![]})[_0xe68e('0x22')](function(_0x173d08){return _0x173d08;});})[_0xe68e('0x22')](function(_0x5efc8d){if(_0x5efc8d){_0x22ba77[_0xe68e('0x2b')][_0xe68e('0x74')]=_0x5efc8d[0x0];if(!_0x28e793['body']['UserId'])return;return db['User'][_0xe68e('0x66')]({'where':{'id':_0x28e793['body'][_0xe68e('0x64')],'role':_0xe68e('0x75')},'attributes':['id',_0xe68e('0x39'),_0xe68e('0x76'),_0xe68e('0x77'),_0xe68e('0x78')],'raw':!![]});}return null;})['then'](function(_0x444a6b){if(!_0x444a6b)return null;_0x22ba77['message'][_0xe68e('0x75')]=_0x444a6b;return _0x22ba77;})['then'](function(_0x42ee75){if(_0x42ee75){_0x42ee75['message']['interface']=util['format'](_0xe68e('0x7b'),_0x28e793[_0xe68e('0x65')][_0xe68e('0x39')]);_0x42ee75[_0xe68e('0x2b')][_0xe68e('0x7c')]=_0x22ba77[_0xe68e('0x7c')];_0x42ee75[_0xe68e('0x2b')][_0xe68e('0x7d')]=_0x22ba77[_0xe68e('0x7c')];_0x42ee75[_0xe68e('0x2b')][_0xe68e('0x7e')]=_0xe68e('0x35');respondWithRpcPromise(_0xe68e('0x7f'),_0xe68e('0x7f'),{'event':'rejectmessage','message':_0x42ee75[_0xe68e('0x2b')]},client9002);return _0x22ba77;}return null;})['then'](respondWithResult(_0x5338c2,null))[_0xe68e('0x59')](handleError(_0x5338c2,null));};exports['status']=function(_0x2213cf,_0x55a0fa,_0x4e3f58){if(_0x2213cf[_0xe68e('0x5b')]['id']){delete _0x2213cf[_0xe68e('0x5b')]['id'];}var _0x1e0d54;return db[_0xe68e('0x3c')][_0xe68e('0x66')]({'where':{'id':_0x2213cf[_0xe68e('0x56')]['id']}})[_0xe68e('0x22')](handleEntityNotFound(_0x55a0fa,null))[_0xe68e('0x22')](function(_0x19b3fc){if(_0x19b3fc){_0x1e0d54=_0x19b3fc;return db[_0xe68e('0x87')][_0xe68e('0x66')]({'where':{'id':_0x19b3fc['SmsAccountId']}});}})[_0xe68e('0x22')](handleEntityNotFound(_0x55a0fa,null))['then'](function(_0x42e687){if(_0x42e687){logger[_0xe68e('0x26')](_0xe68e('0x27'),_0xe68e('0x2e'),_0xe68e('0x88'),_0x42e687[_0xe68e('0x3e')],util[_0xe68e('0x89')](_0x2213cf[_0xe68e('0x5b')],{'showHidden':![],'depth':null}));switch(_0x42e687['type']){case _0xe68e('0x8a'):if(_0x2213cf[_0xe68e('0x5b')]['MessageSid']&&_0x2213cf[_0xe68e('0x5b')][_0xe68e('0x8b')]===_0x1e0d54[_0xe68e('0x8c')]){return _0x1e0d54[_0xe68e('0x5c')]({'read':!![]});}else{logger[_0xe68e('0x29')](_0xe68e('0x8d'),_0xe68e('0x2e'),_0xe68e('0x8a'),util[_0xe68e('0x89')](_0x2213cf['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2213cf[_0xe68e('0x5b')]['MessageUUID']&&_0x2213cf[_0xe68e('0x5b')]['MessageUUID']===_0x1e0d54[_0xe68e('0x8c')]&&_[_0xe68e('0x8e')]([_0xe68e('0x8f'),_0xe68e('0x90')],_0x2213cf['body'][_0xe68e('0x91')])>=0x0){return _0x1e0d54['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe68e('0x2e'),'plivio',util[_0xe68e('0x89')](_0x2213cf[_0xe68e('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xe68e('0x92'):var _0x1ecb9d=_0x2213cf['body'][_0xe68e('0x93')][0x0];if(_0x1ecb9d[_0xe68e('0x2e')][_0xe68e('0x94')]==='DELIVERED'){return _0x1e0d54[_0xe68e('0x5c')]({'read':!![]});}else{logger[_0xe68e('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe68e('0x92'),util[_0xe68e('0x89')](_0x2213cf[_0xe68e('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x1e0d54;}})[_0xe68e('0x22')](respondWithResult(_0x55a0fa,null))[_0xe68e('0x59')](handleError(_0x55a0fa,null));}; \ No newline at end of file +var _0x0936=['rawAttributes','include','find','create','body','update','params','describe','../../config/logger','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','agent','fullname','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','Sequelize','QueryTypes','email','motionChannel','rejectmessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','name','send','index','SmsMessage','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x0936,0xde));var _0x6093=function(_0x2b065c,_0x1ca369){_0x2b065c=_0x2b065c-0x0;var _0x42ef61=_0x0936[_0x2b065c];return _0x42ef61;};'use strict';var emlformat=require(_0x6093('0x0'));var rimraf=require(_0x6093('0x1'));var zipdir=require(_0x6093('0x2'));var jsonpatch=require(_0x6093('0x3'));var rp=require(_0x6093('0x4'));var moment=require(_0x6093('0x5'));var BPromise=require(_0x6093('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6093('0x7'));var sox=require(_0x6093('0x8'));var csv=require(_0x6093('0x9'));var ejs=require(_0x6093('0xa'));var fs=require('fs');var fs_extra=require(_0x6093('0xb'));var _=require(_0x6093('0xc'));var squel=require(_0x6093('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6093('0xe'));var toCsv=require(_0x6093('0x9'));var querystring=require(_0x6093('0xf'));var Papa=require(_0x6093('0x10'));var Redis=require(_0x6093('0x11'));var authService=require(_0x6093('0x12'));var qs=require(_0x6093('0x13'));var as=require(_0x6093('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6093('0x15'));var utils=require(_0x6093('0x16'));var config=require(_0x6093('0x17'));var licenseUtil=require(_0x6093('0x18'));var db=require(_0x6093('0x19'))['db'];config[_0x6093('0x1a')]=_[_0x6093('0x1b')](config[_0x6093('0x1a')],{'host':_0x6093('0x1c'),'port':0x18eb});var socket=require(_0x6093('0x1d'))(new Redis(config[_0x6093('0x1a')]));require(_0x6093('0x1e'))[_0x6093('0x1f')](socket);var jayson=require(_0x6093('0x20'));var client=jayson[_0x6093('0x21')][_0x6093('0x22')]({'port':0x232c});var client9002=jayson[_0x6093('0x21')][_0x6093('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1205e2,_0x214118,_0xb8c9c5,_0x396c2c){return new BPromise(function(_0x5c8f2a,_0x5f2f3b){var _0x141516=_0x396c2c||client;return _0x141516[_0x6093('0x23')](_0x1205e2,_0xb8c9c5)[_0x6093('0x24')](function(_0x13afe7){logger[_0x6093('0x25')](_0x6093('0x26'),_0x214118,'request\x20sent');logger[_0x6093('0x27')](_0x6093('0x28'),_0x214118,_0x6093('0x29'),JSON[_0x6093('0x2a')](_0x13afe7));if(_0x13afe7['error']){if(_0x13afe7[_0x6093('0x2b')][_0x6093('0x2c')]===0x1f4){logger['error'](_0x6093('0x26'),_0x214118,_0x13afe7[_0x6093('0x2b')][_0x6093('0x2d')]);return _0x5f2f3b(_0x13afe7[_0x6093('0x2b')][_0x6093('0x2d')]);}logger['error'](_0x6093('0x26'),_0x214118,_0x13afe7[_0x6093('0x2b')]['message']);return _0x5c8f2a(_0x13afe7[_0x6093('0x2b')][_0x6093('0x2d')]);}else{logger['info'](_0x6093('0x26'),_0x214118,'request\x20sent');_0x5c8f2a(_0x13afe7['result'][_0x6093('0x2d')]);}})[_0x6093('0x2e')](function(_0x543aed){logger[_0x6093('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x214118,_0x543aed);_0x5f2f3b(_0x543aed);});});}function respondWithStatusCode(_0x15f926,_0x68ba4){_0x68ba4=_0x68ba4||0xcc;return function(_0x62278e){if(_0x62278e){return _0x15f926[_0x6093('0x2f')](_0x68ba4);}return _0x15f926[_0x6093('0x30')](_0x68ba4)[_0x6093('0x31')]();};}function respondWithResult(_0x412409,_0x36cc99){_0x36cc99=_0x36cc99||0xc8;return function(_0x6e837c){if(_0x6e837c){return _0x412409['status'](_0x36cc99)[_0x6093('0x32')](_0x6e837c);}};}function respondWithFilteredResult(_0x605f57,_0x4e582e){return function(_0x3a86ad){if(_0x3a86ad){var _0x44e657=typeof _0x4e582e[_0x6093('0x33')]===_0x6093('0x34')&&typeof _0x4e582e[_0x6093('0x35')]===_0x6093('0x34');var _0x44b238=_0x3a86ad[_0x6093('0x36')];var _0x49cd16=_0x44e657?0x0:_0x4e582e[_0x6093('0x33')];var _0x426e81=_0x44e657?_0x3a86ad[_0x6093('0x36')]:_0x4e582e[_0x6093('0x33')]+_0x4e582e[_0x6093('0x35')];var _0x55f5f2;if(_0x426e81>=_0x44b238){_0x426e81=_0x44b238;_0x55f5f2=0xc8;}else{_0x55f5f2=0xce;}_0x605f57[_0x6093('0x30')](_0x55f5f2);return _0x605f57[_0x6093('0x37')](_0x6093('0x38'),_0x49cd16+'-'+_0x426e81+'/'+_0x44b238)['json'](_0x3a86ad);}return null;};}function patchUpdates(_0xcf71df){return function(_0x4a7b79){try{jsonpatch['apply'](_0x4a7b79,_0xcf71df,!![]);}catch(_0x115f56){return BPromise[_0x6093('0x39')](_0x115f56);}return _0x4a7b79[_0x6093('0x3a')]();};}function saveUpdates(_0x3ba5f9,_0x2168bd){return function(_0x5602f8){if(_0x5602f8){return _0x5602f8['update'](_0x3ba5f9)[_0x6093('0x24')](function(_0x1fd4c9){return _0x1fd4c9;});}return null;};}function removeEntity(_0x1b6ae0,_0xc9ba11){return function(_0xa5a8ba){if(_0xa5a8ba){return _0xa5a8ba[_0x6093('0x3b')]()[_0x6093('0x24')](function(){_0x1b6ae0['status'](0xcc)[_0x6093('0x31')]();});}};}function handleEntityNotFound(_0x307439,_0x38e616){return function(_0x22262b){if(!_0x22262b){_0x307439[_0x6093('0x2f')](0x194);}return _0x22262b;};}function handleError(_0x547320,_0x3c849d){_0x3c849d=_0x3c849d||0x1f4;return function(_0x4572bb){logger[_0x6093('0x2b')](_0x4572bb['stack']);if(_0x4572bb[_0x6093('0x3c')]){delete _0x4572bb[_0x6093('0x3c')];}_0x547320[_0x6093('0x30')](_0x3c849d)[_0x6093('0x3d')](_0x4572bb);};}exports[_0x6093('0x3e')]=function(_0xbce376,_0x3e4f2b){var _0x401b0c={},_0x48a159={},_0x28116c={'count':0x0,'rows':[]};var _0x4a9b0b=_['map'](db[_0x6093('0x3f')]['rawAttributes'],function(_0x5df9c7){return{'name':_0x5df9c7['fieldName'],'type':_0x5df9c7['type'][_0x6093('0x40')]};});_0x48a159[_0x6093('0x41')]=_[_0x6093('0x42')](_0x4a9b0b,_0x6093('0x3c'));_0x48a159['query']=_[_0x6093('0x43')](_0xbce376[_0x6093('0x44')]);_0x48a159['filters']=_['intersection'](_0x48a159[_0x6093('0x41')],_0x48a159[_0x6093('0x44')]);_0x401b0c['attributes']=_[_0x6093('0x45')](_0x48a159[_0x6093('0x41')],qs['fields'](_0xbce376[_0x6093('0x44')][_0x6093('0x46')]));_0x401b0c['attributes']=_0x401b0c[_0x6093('0x47')][_0x6093('0x48')]?_0x401b0c['attributes']:_0x48a159[_0x6093('0x41')];if(!_0xbce376[_0x6093('0x44')][_0x6093('0x49')]('nolimit')){_0x401b0c['limit']=qs[_0x6093('0x35')](_0xbce376[_0x6093('0x44')][_0x6093('0x35')]);_0x401b0c['offset']=qs[_0x6093('0x33')](_0xbce376[_0x6093('0x44')]['offset']);}_0x401b0c[_0x6093('0x4a')]=qs[_0x6093('0x4b')](_0xbce376[_0x6093('0x44')]['sort']);_0x401b0c[_0x6093('0x4c')]=qs[_0x6093('0x4d')](_[_0x6093('0x4e')](_0xbce376[_0x6093('0x44')],_0x48a159[_0x6093('0x4d')]),_0x4a9b0b);if(_0xbce376['query'][_0x6093('0x4f')]){_0x401b0c[_0x6093('0x4c')]=_[_0x6093('0x50')](_0x401b0c['where'],{'$or':_[_0x6093('0x42')](_0x4a9b0b,function(_0x9edaad){if(_0x9edaad[_0x6093('0x51')]!==_0x6093('0x52')){var _0x32786c={};_0x32786c[_0x9edaad['name']]={'$like':'%'+_0xbce376[_0x6093('0x44')][_0x6093('0x4f')]+'%'};return _0x32786c;}})});}_0x401b0c=_[_0x6093('0x50')]({},_0x401b0c,_0xbce376[_0x6093('0x53')]);var _0x2e0548={'where':_0x401b0c[_0x6093('0x4c')]};return db[_0x6093('0x3f')][_0x6093('0x36')](_0x2e0548)[_0x6093('0x24')](function(_0x26d9d6){_0x28116c[_0x6093('0x36')]=_0x26d9d6;if(_0xbce376['query'][_0x6093('0x54')]){_0x401b0c['include']=[{'all':!![]}];}return db['SmsMessage'][_0x6093('0x55')](_0x401b0c);})[_0x6093('0x24')](function(_0xe6f33f){_0x28116c[_0x6093('0x56')]=_0xe6f33f;return _0x28116c;})[_0x6093('0x24')](respondWithFilteredResult(_0x3e4f2b,_0x401b0c))[_0x6093('0x2e')](handleError(_0x3e4f2b,null));};exports[_0x6093('0x57')]=function(_0x468250,_0x293d63){var _0x214034={'raw':!![],'where':{'id':_0x468250['params']['id']}},_0x1ac324={};_0x1ac324[_0x6093('0x41')]=_[_0x6093('0x43')](db['SmsMessage'][_0x6093('0x58')]);_0x1ac324['query']=_['keys'](_0x468250[_0x6093('0x44')]);_0x1ac324[_0x6093('0x4d')]=_[_0x6093('0x45')](_0x1ac324[_0x6093('0x41')],_0x1ac324[_0x6093('0x44')]);_0x214034['attributes']=_[_0x6093('0x45')](_0x1ac324[_0x6093('0x41')],qs[_0x6093('0x46')](_0x468250['query'][_0x6093('0x46')]));_0x214034[_0x6093('0x47')]=_0x214034[_0x6093('0x47')][_0x6093('0x48')]?_0x214034[_0x6093('0x47')]:_0x1ac324[_0x6093('0x41')];if(_0x468250[_0x6093('0x44')][_0x6093('0x54')]){_0x214034[_0x6093('0x59')]=[{'all':!![]}];}_0x214034=_[_0x6093('0x50')]({},_0x214034,_0x468250[_0x6093('0x53')]);return db[_0x6093('0x3f')][_0x6093('0x5a')](_0x214034)[_0x6093('0x24')](handleEntityNotFound(_0x293d63,null))[_0x6093('0x24')](respondWithResult(_0x293d63,null))[_0x6093('0x2e')](handleError(_0x293d63,null));};exports[_0x6093('0x5b')]=function(_0x21b936,_0x470023){return db[_0x6093('0x3f')][_0x6093('0x5b')](_0x21b936[_0x6093('0x5c')],{})[_0x6093('0x24')](respondWithResult(_0x470023,0xc9))['catch'](handleError(_0x470023,null));};exports[_0x6093('0x5d')]=function(_0x4dee18,_0xd24aa2){if(_0x4dee18[_0x6093('0x5c')]['id']){delete _0x4dee18[_0x6093('0x5c')]['id'];}return db[_0x6093('0x3f')][_0x6093('0x5a')]({'where':{'id':_0x4dee18['params']['id']}})[_0x6093('0x24')](handleEntityNotFound(_0xd24aa2,null))['then'](saveUpdates(_0x4dee18[_0x6093('0x5c')],null))['then'](respondWithResult(_0xd24aa2,null))[_0x6093('0x2e')](handleError(_0xd24aa2,null));};exports[_0x6093('0x3b')]=function(_0x1abe6e,_0x3310b9){return db[_0x6093('0x3f')][_0x6093('0x5a')]({'where':{'id':_0x1abe6e[_0x6093('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3310b9,null))[_0x6093('0x24')](removeEntity(_0x3310b9,null))[_0x6093('0x2e')](handleError(_0x3310b9,null));};exports[_0x6093('0x5f')]=function(_0x5ba62e,_0x596042){return db[_0x6093('0x3f')][_0x6093('0x5f')]()[_0x6093('0x24')](respondWithResult(_0x596042,null))[_0x6093('0x2e')](handleError(_0x596042,null));};var interaction_log=require(_0x6093('0x60'))(_0x6093('0x61'));exports[_0x6093('0x62')]=function(_0x13c5ad,_0x206c86,_0x33418d){var _0x12f6a3={'agent':{},'channel':_0x6093('0x63')};if(_0x13c5ad[_0x6093('0x5c')]['id']){delete _0x13c5ad[_0x6093('0x5c')]['id'];}_0x13c5ad['body'][_0x6093('0x64')]=!![];_0x13c5ad[_0x6093('0x5c')]['readAt']=moment()[_0x6093('0x65')](_0x6093('0x66'));_0x13c5ad[_0x6093('0x5c')][_0x6093('0x67')]=_0x13c5ad[_0x6093('0x5c')][_0x6093('0x67')]||_0x13c5ad[_0x6093('0x68')]['id'];_0x12f6a3['agent']['id']=_0x13c5ad[_0x6093('0x5c')][_0x6093('0x67')];return db[_0x6093('0x3f')][_0x6093('0x5a')]({'where':{'id':_0x13c5ad[_0x6093('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x206c86,null))[_0x6093('0x24')](saveUpdates(_0x13c5ad[_0x6093('0x5c')],null))['then'](function(_0x17da2b){if(_0x17da2b){_0x12f6a3['message']=_0x17da2b['get']({'plain':!![]});return db[_0x6093('0x69')]['find']({'where':{'id':_0x17da2b[_0x6093('0x6a')]}});}return null;})[_0x6093('0x24')](handleEntityNotFound(_0x206c86,null))[_0x6093('0x24')](function(_0x3abfda){if(_0x3abfda){return _0x3abfda[_0x6093('0x5d')]({'UserId':_0x13c5ad[_0x6093('0x5c')][_0x6093('0x67')],'read1stAt':_[_0x6093('0x6b')](_0x3abfda[_0x6093('0x6c')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6093('0x24')](function(_0x3b02a2){if(_0x3b02a2){_0x12f6a3[_0x6093('0x6d')]=_0x3b02a2[_0x6093('0x6e')]({'plain':!![]});interaction_log[_0x6093('0x25')](_0x6093('0x6f'),_0x13c5ad[_0x6093('0x68')]['id'],_0x13c5ad['user'][_0x6093('0x3c')],_0x13c5ad[_0x6093('0x68')][_0x6093('0x70')],_0x12f6a3[_0x6093('0x6d')]['id'],_0x13c5ad['body']?JSON[_0x6093('0x2a')](_0x13c5ad['body']):_0x6093('0x71'));return respondWithRpcPromise(_0x6093('0x72'),_0x6093('0x73'),_0x12f6a3);}return null;})[_0x6093('0x24')](function(_0x3cd210){var _0x2001cc=_0x6093('0x74')+_0x3cd210[_0x6093('0x2d')]['ContactId'];return db[_0x6093('0x75')][_0x6093('0x44')](_0x2001cc,{'type':db['Sequelize']['QueryTypes'][_0x6093('0x76')],'raw':!![]})[_0x6093('0x24')](function(_0x17ff51){return _0x17ff51;});})['then'](function(_0x47dd34){if(_0x47dd34){_0x12f6a3[_0x6093('0x2d')][_0x6093('0x77')]=_0x47dd34[0x0];if(!_0x13c5ad[_0x6093('0x5c')][_0x6093('0x67')])return;return db[_0x6093('0x78')]['find']({'where':{'id':_0x13c5ad[_0x6093('0x5c')]['UserId'],'role':_0x6093('0x79')},'attributes':['id',_0x6093('0x3c'),_0x6093('0x7a'),'email',_0x6093('0x7b')],'raw':!![]});}return null;})[_0x6093('0x24')](function(_0x3ac058){if(!_0x3ac058)return null;_0x12f6a3[_0x6093('0x2d')][_0x6093('0x79')]=_0x3ac058;return _0x12f6a3;})[_0x6093('0x24')](function(_0x4bce7a){if(_0x4bce7a){if(_0x13c5ad[_0x6093('0x5c')]['manual']){_0x12f6a3[_0x6093('0x2d')][_0x6093('0x7c')]=util[_0x6093('0x65')](_0x6093('0x7d'),_0x13c5ad[_0x6093('0x68')][_0x6093('0x3c')]);_0x12f6a3[_0x6093('0x2d')][_0x6093('0x7e')]=_0x12f6a3['channel'];_0x12f6a3[_0x6093('0x2d')]['motionChannel']=_0x12f6a3[_0x6093('0x7e')];_0x12f6a3[_0x6093('0x2d')][_0x6093('0x7f')]=_0x6093('0x62');return respondWithRpcPromise(_0x6093('0x80'),_0x6093('0x80'),{'event':_0x6093('0x81'),'message':_0x12f6a3['message']},client9002)['then'](function(){return _0x12f6a3;});}return _0x12f6a3;}return null;})[_0x6093('0x24')](respondWithResult(_0x206c86,null))[_0x6093('0x2e')](handleError(_0x206c86,null));};var interaction_log=require(_0x6093('0x60'))(_0x6093('0x61'));exports['reject']=function(_0x2368de,_0x9bd84a,_0x210f25){var _0x327fdd={'agent':{},'channel':_0x6093('0x63')};if(_0x2368de[_0x6093('0x5c')]['id']){delete _0x2368de[_0x6093('0x5c')]['id'];}_0x2368de[_0x6093('0x5c')][_0x6093('0x67')]=_0x2368de[_0x6093('0x5c')][_0x6093('0x67')]||_0x2368de[_0x6093('0x68')]['id'];_0x327fdd['agent']['id']=_0x2368de[_0x6093('0x5c')][_0x6093('0x67')];return db['SmsMessage'][_0x6093('0x5a')]({'where':{'id':_0x2368de[_0x6093('0x5e')]['id'],'UserId':null}})[_0x6093('0x24')](handleEntityNotFound(_0x9bd84a,null))[_0x6093('0x24')](function(_0x526bb9){if(_0x526bb9){_0x327fdd['message']=_0x526bb9[_0x6093('0x6e')]({'plain':!![]});return db[_0x6093('0x69')][_0x6093('0x5a')]({'where':{'id':_0x526bb9[_0x6093('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x9bd84a,null))['then'](function(_0x58e523){if(_0x58e523){_0x327fdd[_0x6093('0x6d')]=_0x58e523[_0x6093('0x6e')]({'plain':!![]});interaction_log[_0x6093('0x25')](_0x6093('0x82'),_0x2368de['user']['id'],_0x2368de[_0x6093('0x68')]['name'],_0x2368de[_0x6093('0x68')][_0x6093('0x70')],_0x327fdd[_0x6093('0x6d')]['id'],_0x2368de[_0x6093('0x5c')]?JSON['stringify'](_0x2368de[_0x6093('0x5c')]):_0x6093('0x71'));return respondWithRpcPromise('RejectMessage',_0x6093('0x83'),_0x327fdd);}return null;})[_0x6093('0x24')](function(_0x412f04){var _0x2384b3=_0x6093('0x74')+_0x412f04[_0x6093('0x2d')][_0x6093('0x84')];return db[_0x6093('0x75')][_0x6093('0x44')](_0x2384b3,{'type':db[_0x6093('0x85')][_0x6093('0x86')][_0x6093('0x76')],'raw':!![]})['then'](function(_0x1503f1){return _0x1503f1;});})['then'](function(_0x4c645f){if(_0x4c645f){_0x327fdd[_0x6093('0x2d')][_0x6093('0x77')]=_0x4c645f[0x0];if(!_0x2368de[_0x6093('0x5c')]['UserId'])return;return db[_0x6093('0x78')]['find']({'where':{'id':_0x2368de[_0x6093('0x5c')][_0x6093('0x67')],'role':_0x6093('0x79')},'attributes':['id',_0x6093('0x3c'),'fullname',_0x6093('0x87'),_0x6093('0x7b')],'raw':!![]});}return null;})[_0x6093('0x24')](function(_0x29e191){if(!_0x29e191)return null;_0x327fdd[_0x6093('0x2d')][_0x6093('0x79')]=_0x29e191;return _0x327fdd;})[_0x6093('0x24')](function(_0x5dd6d4){if(_0x5dd6d4){_0x5dd6d4[_0x6093('0x2d')][_0x6093('0x7c')]=util[_0x6093('0x65')](_0x6093('0x7d'),_0x2368de[_0x6093('0x68')][_0x6093('0x3c')]);_0x5dd6d4[_0x6093('0x2d')]['channel']=_0x327fdd[_0x6093('0x7e')];_0x5dd6d4[_0x6093('0x2d')][_0x6093('0x88')]=_0x327fdd[_0x6093('0x7e')];_0x5dd6d4['message'][_0x6093('0x7f')]=_0x6093('0x39');respondWithRpcPromise(_0x6093('0x80'),'EventManager',{'event':_0x6093('0x89'),'message':_0x5dd6d4[_0x6093('0x2d')]},client9002);return _0x327fdd;}return null;})['then'](respondWithResult(_0x9bd84a,null))['catch'](handleError(_0x9bd84a,null));};exports['status']=function(_0x4e9bf2,_0x20ada3,_0x5a0166){if(_0x4e9bf2[_0x6093('0x5c')]['id']){delete _0x4e9bf2[_0x6093('0x5c')]['id'];}var _0x36ad28;return db[_0x6093('0x3f')][_0x6093('0x5a')]({'where':{'id':_0x4e9bf2[_0x6093('0x5e')]['id']}})[_0x6093('0x24')](handleEntityNotFound(_0x20ada3,null))[_0x6093('0x24')](function(_0x42b281){if(_0x42b281){_0x36ad28=_0x42b281;return db[_0x6093('0x8a')]['find']({'where':{'id':_0x42b281[_0x6093('0x8b')]}});}})['then'](handleEntityNotFound(_0x20ada3,null))[_0x6093('0x24')](function(_0x14cffb){if(_0x14cffb){logger[_0x6093('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6093('0x30'),'received\x20delivery\x20report\x20from',_0x14cffb[_0x6093('0x51')],util[_0x6093('0x8c')](_0x4e9bf2['body'],{'showHidden':![],'depth':null}));switch(_0x14cffb['type']){case'twilio':if(_0x4e9bf2['body'][_0x6093('0x8d')]&&_0x4e9bf2[_0x6093('0x5c')]['MessageSid']===_0x36ad28[_0x6093('0x8e')]){return _0x36ad28[_0x6093('0x5d')]({'read':!![]});}else{logger['error'](_0x6093('0x8f'),_0x6093('0x30'),_0x6093('0x90'),util[_0x6093('0x8c')](_0x4e9bf2[_0x6093('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6093('0x91'):if(_0x4e9bf2[_0x6093('0x5c')][_0x6093('0x92')]&&_0x4e9bf2['body']['MessageUUID']===_0x36ad28[_0x6093('0x8e')]&&_[_0x6093('0x93')]([_0x6093('0x94'),_0x6093('0x95')],_0x4e9bf2[_0x6093('0x5c')][_0x6093('0x96')])>=0x0){return _0x36ad28[_0x6093('0x5d')]({'read':!![]});}else{logger[_0x6093('0x2b')](_0x6093('0x8f'),_0x6093('0x30'),_0x6093('0x97'),util[_0x6093('0x8c')](_0x4e9bf2[_0x6093('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6093('0x98'):var _0x3f1ec8=_0x4e9bf2['body']['results'][0x0];if(_0x3f1ec8[_0x6093('0x30')][_0x6093('0x99')]===_0x6093('0x9a')){return _0x36ad28[_0x6093('0x5d')]({'read':!![]});}else{logger[_0x6093('0x2b')](_0x6093('0x8f'),'status','infobip',util[_0x6093('0x8c')](_0x4e9bf2['body'],{'showHidden':![],'depth':null}));}break;}return _0x36ad28;}})[_0x6093('0x24')](respondWithResult(_0x20ada3,null))['catch'](handleError(_0x20ada3,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8deefaf..ab3c18b 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 _0xeefa=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x7a6e0,_0x35f1d3){var _0x2ef4a7=function(_0x43cc67){while(--_0x43cc67){_0x7a6e0['push'](_0x7a6e0['shift']());}};_0x2ef4a7(++_0x35f1d3);}(_0xeefa,0x118));var _0xaeef=function(_0x43a5f6,_0x109266){_0x43a5f6=_0x43a5f6-0x0;var _0x1f4696=_0xeefa[_0x43a5f6];return _0x1f4696;};'use strict';var EventEmitter=require(_0xaeef('0x0'));var SmsMessage=require(_0xaeef('0x1'))['db'][_0xaeef('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xaeef('0x3')](0x0);var events={'afterCreate':_0xaeef('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x226f1f){return function(_0x574c99,_0x46bcd3,_0x420f6f){SmsMessageEvents[_0xaeef('0x5')](_0x226f1f+':'+_0x574c99['id'],_0x574c99);SmsMessageEvents[_0xaeef('0x5')](_0x226f1f,_0x574c99);_0x420f6f(null);};}for(var e in events){if(events[_0xaeef('0x6')](e)){var event=events[e];SmsMessage[_0xaeef('0x7')](e,emitEvent(event));}}module[_0xaeef('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xd4c0=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd4c0,0x1e6));var _0x0d4c=function(_0x15c8ec,_0x86c823){_0x15c8ec=_0x15c8ec-0x0;var _0x2cfefc=_0xd4c0[_0x15c8ec];return _0x2cfefc;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x0d4c('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0d4c('0x1')](0x0);var events={'afterCreate':_0x0d4c('0x2'),'afterUpdate':_0x0d4c('0x3'),'afterDestroy':_0x0d4c('0x4')};function emitEvent(_0x404252){return function(_0x27753d,_0xc028ab,_0x50e7fb){SmsMessageEvents[_0x0d4c('0x5')](_0x404252+':'+_0x27753d['id'],_0x27753d);SmsMessageEvents[_0x0d4c('0x5')](_0x404252,_0x27753d);_0x50e7fb(null);};}for(var e in events){if(events[_0x0d4c('0x6')](e)){var event=events[e];SmsMessage[_0x0d4c('0x7')](e,emitEvent(event));}}module[_0x0d4c('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 563da7c..2e3e0a8 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 _0x2d95=['https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','toString','http_code','data','queued_count','message_id','clickSend','plivo','authId','remote','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','base64','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','IBSSO\x20','infobip','apiKey','timestamp','keys','sort','length','createHash','digest','hex','signature=','/external/get/send.php?','id_sms','csc','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','applicationId','Basic\x20%s','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','SmsInteraction','findOne','then','createdAt','catch','error','SmsAccount','find','type','twilio','accountSid','authToken','messages','create','phone','/api/sms/messages/','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby'];(function(_0x8af3c4,_0x24d051){var _0x177e08=function(_0x5a27ce){while(--_0x5a27ce){_0x8af3c4['push'](_0x8af3c4['shift']());}};_0x177e08(++_0x24d051);}(_0x2d95,0xbb));var _0x52d9=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x2d95[_0x53b133];return _0x5647e0;};'use strict';var _=require(_0x52d9('0x0'));var util=require(_0x52d9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x52d9('0x2'));var rp=require(_0x52d9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52d9('0x4'));var config=require(_0x52d9('0x5'));var attributes=require(_0x52d9('0x6'));module[_0x52d9('0x7')]=function(_0x64ebbc,_0xe591a6){return _0x64ebbc[_0x52d9('0x8')](_0x52d9('0x9'),attributes,{'tableName':_0x52d9('0xa'),'paranoid':![],'indexes':[{'name':_0x52d9('0xb'),'fields':[_0x52d9('0xb')]},{'name':'fti_sms_messages','fields':[_0x52d9('0xc')],'type':_0x52d9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x16c73b,_0x5285d6,_0x433d74){var _0x143858=_0x64ebbc['models'];var _0x43bdf1=_0x16c73b[_0x52d9('0xe')]({'plain':!![]});if(_0x43bdf1[_0x52d9('0xf')]['toLowerCase']()==='in'||_0x43bdf1[_0x52d9('0xf')][_0x52d9('0x10')]()===_0x52d9('0x11')&&!_0x43bdf1[_0x52d9('0x12')]&&!_[_0x52d9('0x13')](_0x43bdf1['UserId'])&&!_[_0x52d9('0x13')](_0x43bdf1['SmsInteractionId'])){_0x143858[_0x52d9('0x14')][_0x52d9('0x15')]({'where':{'id':_0x43bdf1['SmsInteractionId']}})[_0x52d9('0x16')](function(_0xe60e1c){if(_0xe60e1c){_0xe60e1c['update']({'lastMsgAt':_0x43bdf1[_0x52d9('0x17')],'lastMsgDirection':_0x43bdf1['direction'][_0x52d9('0x10')]()});}})[_0x52d9('0x18')](function(_0x4201d4){console[_0x52d9('0x19')](_0x4201d4);});}if(_0x43bdf1[_0x52d9('0xf')]==='out'&&!_0x43bdf1['secret']){var _0x555ae2;_0x143858[_0x52d9('0x1a')][_0x52d9('0x1b')]({'where':{'id':_0x43bdf1['SmsAccountId']},'raw':!![]})['then'](function(_0x2d75f0){_0x555ae2=_0x2d75f0;if(_0x555ae2&&_0x555ae2[_0x52d9('0x1c')]){switch(_0x555ae2[_0x52d9('0x1c')]){case'twilio':var _0x3aac5d=require(_0x52d9('0x1d'));if(_0x555ae2[_0x52d9('0x1e')]&&_0x555ae2['authToken']&&_0x555ae2['phone']){var _0x4917fc=new _0x3aac5d(_0x555ae2[_0x52d9('0x1e')],_0x555ae2[_0x52d9('0x1f')]);_0x4917fc[_0x52d9('0x20')][_0x52d9('0x21')]({'body':_0x43bdf1[_0x52d9('0xc')],'to':_0x43bdf1[_0x52d9('0x22')],'from':_0x555ae2[_0x52d9('0x22')],'statusCallback':_0x555ae2['remote']+_0x52d9('0x23')+_0x43bdf1['id']+'/status?token='+_0x555ae2[_0x52d9('0x24')]})[_0x52d9('0x16')](function(_0x506cc2){if(_0x506cc2[_0x52d9('0x25')]){return _0x16c73b[_0x52d9('0x26')]({'messageId':_0x506cc2['sid']});}})['catch'](function(_0x10f1ef){logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x1d'),util[_0x52d9('0x29')](_0x10f1ef,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x52d9('0x27'),_0x52d9('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x52d9('0x2a'):var _0xcfd5e3=_0x52d9('0x2b');if(_0x555ae2[_0x52d9('0x2c')]&&_0x555ae2['password']){var _0x8bf25f={'recipient':[_0x43bdf1[_0x52d9('0x22')]],'message':_0x43bdf1[_0x52d9('0xc')],'message_type':_0x555ae2[_0x52d9('0x2d')]};if(_0x555ae2[_0x52d9('0x2d')]&&_0x555ae2[_0x52d9('0x2d')]!=='SI'){_0x8bf25f[_0x52d9('0x2e')]=_0x555ae2['phone'];}var _0x5214df={'url':_0xcfd5e3+_0x52d9('0x2f')+_0x555ae2[_0x52d9('0x2c')]+_0x52d9('0x30')+_0x555ae2[_0x52d9('0x31')],'method':_0x52d9('0x32')};rp(_0x5214df)[_0x52d9('0x16')](function(_0x25ac31){var _0x45233d=_0x25ac31[_0x52d9('0x33')](';');var _0x669c44={'user_key':_0x45233d[0x0],'session_key':_0x45233d[0x1]};_0x5214df={'url':_0xcfd5e3+_0x52d9('0x34'),'method':_0x52d9('0x35'),'headers':{'user_key':_0x669c44[_0x52d9('0x36')],'Session_key':_0x669c44['session_key']},'json':!![],'body':_0x8bf25f};return rp(_0x5214df);})['then'](function(_0x1327d3){if(_0x1327d3[_0x52d9('0x37')]>=0x1){var _0x856374={'messageId':_0x1327d3[_0x52d9('0x38')]};if(_0x555ae2[_0x52d9('0x2d')]!=='GP'||!_0x555ae2[_0x52d9('0x39')]){_0x856374['read']=!![];}return _0x16c73b[_0x52d9('0x26')](_0x856374);}else{return logger['error'](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x2a'),util['inspect'](_0x1327d3,{'showHidden':![],'depth':null}));}})[_0x52d9('0x18')](function(_0x2cfa41){return logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),'skebby',util[_0x52d9('0x29')](_0x2cfa41,{'showHidden':![],'depth':null}));});}else{logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x2a'),_0x52d9('0x3a'));}break;case _0x52d9('0x3b'):if(_0x555ae2['authToken']){var _0x4fadae={'recipient':_0x43bdf1[_0x52d9('0x22')],'message':_0x43bdf1['body'],'sender':_0x555ae2[_0x52d9('0x3c')]||_0x555ae2[_0x52d9('0x22')],'authorization':_0x555ae2[_0x52d9('0x1f')]};var _0x5285d6={'method':_0x52d9('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x4fadae,'json':!![]};rp(_0x5285d6)[_0x52d9('0x16')](function(_0xe255b6){var _0x1fe1f9={'messageId':_0xe255b6['requestid']};if(!_0x555ae2[_0x52d9('0x39')]){_0x1fe1f9[_0x52d9('0x3d')]=!![];}return _0x16c73b[_0x52d9('0x26')](_0x1fe1f9);})[_0x52d9('0x18')](function(_0x2637c3){logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x3b'),util[_0x52d9('0x29')](_0x2637c3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x3b'),_0x52d9('0x3e'));}break;case _0x52d9('0x3f'):if(_0x555ae2[_0x52d9('0x2c')]&&_0x555ae2['password']){var _0x4fadae={'messages':[{'source':_0x52d9('0x40'),'to':_0x43bdf1[_0x52d9('0x22')],'body':_0x43bdf1[_0x52d9('0xc')],'from':_0x555ae2[_0x52d9('0x3c')]||_0x555ae2[_0x52d9('0x22')]}]};var _0x5ef95e=util[_0x52d9('0x41')](_0x52d9('0x42'),_0x555ae2['username'],_0x555ae2[_0x52d9('0x31')]);var _0x5285d6={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4fadae,'headers':{'Authorization':util[_0x52d9('0x41')]('Basic\x20%s',new Buffer(_0x5ef95e)[_0x52d9('0x43')]('base64'))},'json':!![]};rp(_0x5285d6)[_0x52d9('0x16')](function(_0x449fdc){if(_0x449fdc['http_code']>=0xc8&&_0x449fdc[_0x52d9('0x44')]<=0xce){if(_0x449fdc[_0x52d9('0x45')]&&_0x449fdc['data'][_0x52d9('0x46')]>0x0){var _0x1345f6=_['head'](_0x449fdc[_0x52d9('0x45')]['messages']);var _0x8227a2={'messageId':_0x1345f6[_0x52d9('0x47')]};if(!_0x555ae2[_0x52d9('0x39')]){_0x8227a2[_0x52d9('0x3d')]=!![];}return _0x16c73b[_0x52d9('0x26')](_0x8227a2);}else{logger[_0x52d9('0x19')](_0x52d9('0x27'),'afterCreate',_0x52d9('0x48'),util[_0x52d9('0x29')](_0x449fdc,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x52d9('0x27'),'afterCreate',_0x52d9('0x48'),util[_0x52d9('0x29')](_0x449fdc,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3f74fa){logger[_0x52d9('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x52d9('0x28'),_0x52d9('0x48'),util[_0x52d9('0x29')](_0x3f74fa,{'showHidden':![],'depth':null}));});}else{logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x52d9('0x49'):if(_0x555ae2[_0x52d9('0x4a')]&&_0x555ae2[_0x52d9('0x1f')]){var _0x4fadae={'dst':_0x43bdf1[_0x52d9('0x22')],'text':_0x43bdf1[_0x52d9('0xc')],'src':_0x555ae2[_0x52d9('0x3c')]||_0x555ae2[_0x52d9('0x22')],'url':_0x555ae2[_0x52d9('0x4b')]+_0x52d9('0x23')+_0x43bdf1['id']+_0x52d9('0x4c')+_0x555ae2[_0x52d9('0x24')]};var _0x5ef95e=util['format']('%s:%s',_0x555ae2[_0x52d9('0x4a')],_0x555ae2['authToken']);var _0x5285d6={'method':_0x52d9('0x35'),'uri':util[_0x52d9('0x41')](_0x52d9('0x4d'),_0x555ae2[_0x52d9('0x4a')]),'body':_0x4fadae,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5ef95e)[_0x52d9('0x43')](_0x52d9('0x4e')))},'json':!![]};rp(_0x5285d6)[_0x52d9('0x16')](function(_0x3f4bbc){var _0x1cedbb={'messageId':_0x3f4bbc['message_uuid'][0x0]};return _0x16c73b['update'](_0x1cedbb);})[_0x52d9('0x18')](function(_0x511bbb){logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),'plivo',util[_0x52d9('0x29')](_0x511bbb,{'showHidden':![],'depth':null}));});}else{logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x49'),_0x52d9('0x4f'));}break;case'infobip':if(_0x555ae2[_0x52d9('0x2c')]&&_0x555ae2[_0x52d9('0x31')]){if(_0x555ae2[_0x52d9('0x50')]){var _0x392326={'method':_0x52d9('0x35'),'uri':_0x555ae2[_0x52d9('0x50')]+'/auth/1/session','body':{'username':_0x555ae2['username'],'password':_0x555ae2['password']},'json':!![]};return rp(_0x392326)[_0x52d9('0x16')](function(_0x16b74d){var _0x1e85e8={'method':_0x52d9('0x35'),'uri':_0x555ae2[_0x52d9('0x50')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x555ae2['phone'],'destinations':[{'to':_0x43bdf1[_0x52d9('0x22')]}],'text':_0x43bdf1['body'],'notifyUrl':_0x555ae2['remote']+_0x52d9('0x23')+_0x43bdf1['id']+'/status?token='+_0x555ae2[_0x52d9('0x24')],'notifyContentType':'application/json','callbackData':_0x555ae2['phone']+';'+_0x43bdf1[_0x52d9('0xc')]}]},'headers':{'Authorization':_0x52d9('0x51')+_0x16b74d['token']},'json':!![]};return rp(_0x1e85e8)[_0x52d9('0x16')](function(_0x13c516){if(_0x13c516[_0x52d9('0x20')]){var _0x1ceb48={'messageId':_0x13c516[_0x52d9('0x20')][0x0][_0x52d9('0xb')]};if(!_0x555ae2[_0x52d9('0x39')]){_0x1ceb48['read']=!![];}return _0x16c73b[_0x52d9('0x26')](_0x1ceb48);}else{return logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x52'),util[_0x52d9('0x29')](_0x13c516,{'showHidden':![],'depth':null}));}});})[_0x52d9('0x18')](function(_0x537c54){return logger[_0x52d9('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x52d9('0x28'),'infobip',util[_0x52d9('0x29')](_0x537c54,{'showHidden':![],'depth':null}));});}else{logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x52d9('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x52d9('0x52'),_0x52d9('0x3a'));}break;case'csc':var _0x2338eb=require('crypto');if(_0x555ae2[_0x52d9('0x53')]){var _0x8584fd={};_0x8584fd['login']=_0x555ae2[_0x52d9('0x2c')];_0x8584fd[_0x52d9('0x22')]=_0x43bdf1[_0x52d9('0x22')];_0x8584fd['sender']=_0x555ae2[_0x52d9('0x22')];_0x8584fd['text']=_0x43bdf1['body'];_0x8584fd[_0x52d9('0x54')]=+new Date();var _0x23988a='';var _0x52618b='';var _0x131de8=Object[_0x52d9('0x55')](_0x8584fd);_0x131de8[_0x52d9('0x56')]();for(var _0x1cd8e7=0x0;_0x1cd8e7<_0x131de8[_0x52d9('0x57')];_0x1cd8e7++){if(_0x23988a!=''){_0x23988a+='&';}_0x23988a+=_0x131de8[_0x1cd8e7]+'='+encodeURIComponent(_0x8584fd[_0x131de8[_0x1cd8e7]]);_0x52618b+=_0x8584fd[_0x131de8[_0x1cd8e7]];}_0x52618b+=_0x555ae2[_0x52d9('0x53')];_0x52618b=_0x2338eb[_0x52d9('0x58')]('md5')[_0x52d9('0x26')](_0x52618b)[_0x52d9('0x59')](_0x52d9('0x5a'));if(_0x23988a!==''){_0x23988a+='&';}_0x23988a+=_0x52d9('0x5b')+_0x52618b;var _0x5214df={'method':'GET','uri':_0x555ae2[_0x52d9('0x50')]+_0x52d9('0x5c')+_0x23988a,'json':!![]};return rp(_0x5214df)[_0x52d9('0x16')](function(_0x1cab43){var _0x4d83bd=Object[_0x52d9('0x55')](_0x1cab43);if(_0x1cab43[_0x4d83bd[0x0]][_0x52d9('0x19')]&&parseInt(_0x1cab43[_0x4d83bd[0x0]][_0x52d9('0x19')])===0x0){var _0x110be9={'messageId':_0x1cab43[_0x4d83bd[0x0]][_0x52d9('0x5d')]};if(!_0x555ae2[_0x52d9('0x39')]){_0x110be9[_0x52d9('0x3d')]=!![];}return _0x16c73b['update'](_0x110be9);}else{return logger[_0x52d9('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x52d9('0x28'),_0x52d9('0x5e'),util['inspect'](_0x1cab43[_0x52d9('0x19')],{'showHidden':![],'depth':null}));}})[_0x52d9('0x18')](function(_0x11f7cd){return logger[_0x52d9('0x19')](_0x52d9('0x27'),'afterCreate',_0x52d9('0x5e'),util[_0x52d9('0x29')](_0x11f7cd,{'showHidden':![],'depth':null}));});}else{logger[_0x52d9('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x52d9('0x28'),_0x52d9('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x555ae2[_0x52d9('0x53')]){var _0x131eaf={'method':_0x52d9('0x35'),'uri':_0x52d9('0x5f'),'headers':{'Authorization':_0x555ae2['apiKey']},'body':{'content':_0x43bdf1[_0x52d9('0xc')],'to':[_0x43bdf1[_0x52d9('0x22')]],'from':_0x555ae2['phone'],'binary':![],'clientMessageId':_0x52d9('0x60'),'charset':_0x52d9('0x61')},'json':!![]};rp(_0x131eaf)[_0x52d9('0x16')](function(_0x47c4e0){if(!_0x47c4e0['error']){var _0x4cc2d2={'messageId':_0x47c4e0['messages'][0x0]['apiMessageId']};if(!_0x555ae2[_0x52d9('0x39')]){_0x4cc2d2[_0x52d9('0x3d')]=!![];}return _0x16c73b[_0x52d9('0x26')](_0x4cc2d2);}else{return logger[_0x52d9('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x52d9('0x28'),_0x52d9('0x62'),util[_0x52d9('0x29')](_0x47c4e0[_0x52d9('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x8b0ecd){return logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x62'),util[_0x52d9('0x29')](_0x8b0ecd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x52d9('0x27'),_0x52d9('0x28'),'clickatell',_0x52d9('0x63'));}break;case _0x52d9('0x64'):if(_0x555ae2['username']&&_0x555ae2[_0x52d9('0x31')]){var _0x5ef95e=util[_0x52d9('0x41')](_0x52d9('0x42'),_0x555ae2[_0x52d9('0x2c')],_0x555ae2[_0x52d9('0x31')]);var _0x5285d6={'method':_0x52d9('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x555ae2[_0x52d9('0x65')]+_0x52d9('0x66'),'body':{'to':[_0x43bdf1[_0x52d9('0x22')]],'text':_0x43bdf1[_0x52d9('0xc')],'from':_0x555ae2[_0x52d9('0x22')],'applicationId':_0x555ae2[_0x52d9('0x67')]},'headers':{'Authorization':util[_0x52d9('0x41')](_0x52d9('0x68'),new Buffer(_0x5ef95e)[_0x52d9('0x43')]('base64'))},'json':!![]};rp(_0x5285d6)['then'](function(_0x5e5d19){if(_0x5e5d19['id']){var _0x41d663={'messageId':_0x5e5d19['id']};return _0x16c73b[_0x52d9('0x26')](_0x41d663);}else{logger[_0x52d9('0x19')](_0x52d9('0x27'),'afterCreate','bandwidth',util[_0x52d9('0x29')](_0x5e5d19,{'showHidden':![],'depth':null}));}})[_0x52d9('0x18')](function(_0x498b1e){logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x64'),util[_0x52d9('0x29')](_0x498b1e,{'showHidden':![],'depth':null}));});}else{logger[_0x52d9('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x52d9('0x28'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0x52d9('0x69'):if(_0x555ae2['apiKey']){var _0x401716={};var _0x5214df={'method':_0x52d9('0x35'),'uri':_0x52d9('0x6a'),'headers':{'Authorization':_0x52d9('0x6b')+_0x555ae2[_0x52d9('0x53')],'Content-Type':'application/json'},'body':{'from':_0x555ae2[_0x52d9('0x22')],'to':_0x43bdf1['phone'],'text':_0x43bdf1[_0x52d9('0xc')]},'json':!![]};return rp(_0x5214df)[_0x52d9('0x16')](function(_0x36bb4d){if(_0x36bb4d['code']==0xca){_0x401716[_0x52d9('0x6c')]=_0x36bb4d;var _0xc4e9b3={'method':_0x52d9('0x35'),'uri':_0x52d9('0x6d'),'headers':{'Authorization':_0x52d9('0x6b')+_0x555ae2['apiKey'],'Content-Type':_0x52d9('0x6e')},'body':{'refid':_0x401716['message'][_0x52d9('0x6f')]},'json':!![]};return rp(_0xc4e9b3)[_0x52d9('0x16')](function(_0x1cb44b){_0x401716['status']=_0x1cb44b;var _0x312c08={'messageId':_0x401716[_0x52d9('0x6c')][_0x52d9('0x6f')],'read':!![]};return _0x16c73b['update'](_0x312c08);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x52d9('0x69'),util['inspect'](_0x36bb4d,{'showHidden':![],'depth':null}));}})[_0x52d9('0x18')](function(_0x3ddc05){return logger['error'](_0x52d9('0x27'),_0x52d9('0x28'),_0x52d9('0x69'),util[_0x52d9('0x29')](_0x3ddc05,{'showHidden':![],'depth':null}));});}else{return logger[_0x52d9('0x19')](_0x52d9('0x27'),_0x52d9('0x28'),'intelepeer',_0x52d9('0x70'));}break;}}})[_0x52d9('0x71')](function(){_0x433d74();});}else{_0x433d74();}}},'charset':'utf8mb4','collate':_0x52d9('0x72')});}; \ No newline at end of file +var _0x1285=['uuid','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','toLowerCase','direction','secret','isNil','findOne','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','login?username=','username','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','senderString','%s:%s','https://rest.clicksend.com/v3/sms/send','format','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','createHash','digest','hex','signature=','/external/get/send.php?','https://platform.clickatell.com/messages'];(function(_0x27d460,_0x3656d0){var _0x1ec9b0=function(_0x3a95c4){while(--_0x3a95c4){_0x27d460['push'](_0x27d460['shift']());}};_0x1ec9b0(++_0x3656d0);}(_0x1285,0x8c));var _0x5128=function(_0x6fe240,_0x1827a6){_0x6fe240=_0x6fe240-0x0;var _0x2fc18b=_0x1285[_0x6fe240];return _0x2fc18b;};'use strict';var _=require(_0x5128('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5128('0x1'));var moment=require(_0x5128('0x2'));var BPromise=require(_0x5128('0x3'));var rp=require(_0x5128('0x4'));var fs=require('fs');var path=require(_0x5128('0x5'));var rimraf=require(_0x5128('0x6'));var config=require('../../config/environment');var attributes=require(_0x5128('0x7'));module[_0x5128('0x8')]=function(_0x4cae8b,_0x2ad52a){return _0x4cae8b[_0x5128('0x9')]('SmsMessage',attributes,{'tableName':_0x5128('0xa'),'paranoid':![],'indexes':[{'name':_0x5128('0xb'),'fields':['messageId']},{'name':_0x5128('0xc'),'fields':[_0x5128('0xd')],'type':_0x5128('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41bb8a,_0x49da18,_0x1a4084){var _0x5c56fd=_0x4cae8b['models'];var _0x478d72=_0x41bb8a[_0x5128('0xf')]({'plain':!![]});if(_0x478d72['direction'][_0x5128('0x10')]()==='in'||_0x478d72[_0x5128('0x11')][_0x5128('0x10')]()==='out'&&!_0x478d72[_0x5128('0x12')]&&!_[_0x5128('0x13')](_0x478d72['UserId'])&&!_[_0x5128('0x13')](_0x478d72['SmsInteractionId'])){_0x5c56fd['SmsInteraction'][_0x5128('0x14')]({'where':{'id':_0x478d72[_0x5128('0x15')]}})['then'](function(_0x1629e3){if(_0x1629e3){_0x1629e3[_0x5128('0x16')]({'lastMsgAt':_0x478d72[_0x5128('0x17')],'lastMsgDirection':_0x478d72['direction'][_0x5128('0x10')]()});}})[_0x5128('0x18')](function(_0x16322f){console[_0x5128('0x19')](_0x16322f);});}if(_0x478d72[_0x5128('0x11')]==='out'&&!_0x478d72[_0x5128('0x12')]){var _0x4cfa99;_0x5c56fd[_0x5128('0x1a')][_0x5128('0x1b')]({'where':{'id':_0x478d72[_0x5128('0x1c')]},'raw':!![]})['then'](function(_0x1bd2a3){_0x4cfa99=_0x1bd2a3;if(_0x4cfa99&&_0x4cfa99[_0x5128('0x1d')]){switch(_0x4cfa99[_0x5128('0x1d')]){case _0x5128('0x1e'):var _0x431cd1=require(_0x5128('0x1e'));if(_0x4cfa99[_0x5128('0x1f')]&&_0x4cfa99['authToken']&&_0x4cfa99[_0x5128('0x20')]){var _0x512ad9=new _0x431cd1(_0x4cfa99['accountSid'],_0x4cfa99[_0x5128('0x21')]);_0x512ad9[_0x5128('0x22')][_0x5128('0x23')]({'body':_0x478d72[_0x5128('0xd')],'to':_0x478d72[_0x5128('0x20')],'from':_0x4cfa99[_0x5128('0x20')],'statusCallback':_0x4cfa99[_0x5128('0x24')]+_0x5128('0x25')+_0x478d72['id']+_0x5128('0x26')+_0x4cfa99['token']})[_0x5128('0x27')](function(_0x201843){if(_0x201843[_0x5128('0x28')]){return _0x41bb8a[_0x5128('0x16')]({'messageId':_0x201843[_0x5128('0x28')]});}})[_0x5128('0x18')](function(_0x8905fb){logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x1e'),util[_0x5128('0x2b')](_0x8905fb,{'showHidden':![],'depth':null}));});}else{logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),'twilio',_0x5128('0x2c'));}break;case _0x5128('0x2d'):var _0x4b92d6='https://api.skebby.it/API/v1.0/REST/';if(_0x4cfa99['username']&&_0x4cfa99[_0x5128('0x2e')]){var _0x28140e={'recipient':[_0x478d72['phone']],'message':_0x478d72[_0x5128('0xd')],'message_type':_0x4cfa99[_0x5128('0x2f')]};if(_0x4cfa99['smsMethod']&&_0x4cfa99['smsMethod']!=='SI'){_0x28140e['sender']=_0x4cfa99[_0x5128('0x20')];}var _0x185bf1={'url':_0x4b92d6+_0x5128('0x30')+_0x4cfa99[_0x5128('0x31')]+_0x5128('0x32')+_0x4cfa99[_0x5128('0x2e')],'method':_0x5128('0x33')};rp(_0x185bf1)[_0x5128('0x27')](function(_0x467055){var _0x36cbb0=_0x467055[_0x5128('0x34')](';');var _0x6a7463={'user_key':_0x36cbb0[0x0],'session_key':_0x36cbb0[0x1]};_0x185bf1={'url':_0x4b92d6+_0x5128('0x35'),'method':_0x5128('0x36'),'headers':{'user_key':_0x6a7463[_0x5128('0x37')],'Session_key':_0x6a7463['session_key']},'json':!![],'body':_0x28140e};return rp(_0x185bf1);})[_0x5128('0x27')](function(_0x136fc4){if(_0x136fc4[_0x5128('0x38')]>=0x1){var _0x2545f3={'messageId':_0x136fc4[_0x5128('0x39')]};if(_0x4cfa99[_0x5128('0x2f')]!=='GP'||!_0x4cfa99[_0x5128('0x3a')]){_0x2545f3[_0x5128('0x3b')]=!![];}return _0x41bb8a[_0x5128('0x16')](_0x2545f3);}else{return logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x2d'),util[_0x5128('0x2b')](_0x136fc4,{'showHidden':![],'depth':null}));}})[_0x5128('0x18')](function(_0x1850a1){return logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),'skebby',util['inspect'](_0x1850a1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5128('0x2a'),_0x5128('0x2d'),_0x5128('0x3c'));}break;case _0x5128('0x3d'):if(_0x4cfa99[_0x5128('0x21')]){var _0x3dac11={'recipient':_0x478d72[_0x5128('0x20')],'message':_0x478d72[_0x5128('0xd')],'sender':_0x4cfa99['senderString']||_0x4cfa99[_0x5128('0x20')],'authorization':_0x4cfa99[_0x5128('0x21')]};var _0x49da18={'method':'POST','uri':_0x5128('0x3e'),'body':_0x3dac11,'json':!![]};rp(_0x49da18)['then'](function(_0xe497c4){var _0x237f11={'messageId':_0xe497c4[_0x5128('0x3f')]};if(!_0x4cfa99['deliveryReport']){_0x237f11[_0x5128('0x3b')]=!![];}return _0x41bb8a[_0x5128('0x16')](_0x237f11);})[_0x5128('0x18')](function(_0x491bcd){logger['error'](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x3d'),util[_0x5128('0x2b')](_0x491bcd,{'showHidden':![],'depth':null}));});}else{logger[_0x5128('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5128('0x2a'),_0x5128('0x3d'),'Missing\x20parameters:\x20authToken');}break;case _0x5128('0x40'):if(_0x4cfa99[_0x5128('0x31')]&&_0x4cfa99[_0x5128('0x2e')]){var _0x3dac11={'messages':[{'source':'xCALLY\x20Motion','to':_0x478d72[_0x5128('0x20')],'body':_0x478d72[_0x5128('0xd')],'from':_0x4cfa99[_0x5128('0x41')]||_0x4cfa99['phone']}]};var _0x5eefd8=util['format'](_0x5128('0x42'),_0x4cfa99['username'],_0x4cfa99[_0x5128('0x2e')]);var _0x49da18={'method':_0x5128('0x36'),'uri':_0x5128('0x43'),'body':_0x3dac11,'headers':{'Authorization':util[_0x5128('0x44')]('Basic\x20%s',new Buffer(_0x5eefd8)[_0x5128('0x45')](_0x5128('0x46')))},'json':!![]};rp(_0x49da18)['then'](function(_0x43e93b){if(_0x43e93b['http_code']>=0xc8&&_0x43e93b[_0x5128('0x47')]<=0xce){if(_0x43e93b[_0x5128('0x48')]&&_0x43e93b[_0x5128('0x48')][_0x5128('0x49')]>0x0){var _0x2c7a26=_[_0x5128('0x4a')](_0x43e93b[_0x5128('0x48')][_0x5128('0x22')]);var _0x43b445={'messageId':_0x2c7a26[_0x5128('0x4b')]};if(!_0x4cfa99[_0x5128('0x3a')]){_0x43b445['read']=!![];}return _0x41bb8a[_0x5128('0x16')](_0x43b445);}else{logger[_0x5128('0x19')](_0x5128('0x29'),'afterCreate',_0x5128('0x4c'),util[_0x5128('0x2b')](_0x43e93b,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0x5128('0x2b')](_0x43e93b,{'showHidden':![],'depth':null}));}})[_0x5128('0x18')](function(_0x12f107){logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),'clickSend',util['inspect'](_0x12f107,{'showHidden':![],'depth':null}));});}else{logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),'clickSend',_0x5128('0x3c'));}break;case _0x5128('0x4d'):if(_0x4cfa99[_0x5128('0x4e')]&&_0x4cfa99[_0x5128('0x21')]){var _0x3dac11={'dst':_0x478d72[_0x5128('0x20')],'text':_0x478d72['body'],'src':_0x4cfa99[_0x5128('0x41')]||_0x4cfa99[_0x5128('0x20')],'url':_0x4cfa99[_0x5128('0x24')]+'/api/sms/messages/'+_0x478d72['id']+_0x5128('0x26')+_0x4cfa99[_0x5128('0x4f')]};var _0x5eefd8=util[_0x5128('0x44')](_0x5128('0x42'),_0x4cfa99[_0x5128('0x4e')],_0x4cfa99[_0x5128('0x21')]);var _0x49da18={'method':_0x5128('0x36'),'uri':util[_0x5128('0x44')](_0x5128('0x50'),_0x4cfa99['authId']),'body':_0x3dac11,'headers':{'Authorization':util[_0x5128('0x44')](_0x5128('0x51'),new Buffer(_0x5eefd8)[_0x5128('0x45')](_0x5128('0x46')))},'json':!![]};rp(_0x49da18)['then'](function(_0x4da188){var _0x151478={'messageId':_0x4da188[_0x5128('0x52')][0x0]};return _0x41bb8a[_0x5128('0x16')](_0x151478);})[_0x5128('0x18')](function(_0x17e2b4){logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x4d'),util[_0x5128('0x2b')](_0x17e2b4,{'showHidden':![],'depth':null}));});}else{logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x5128('0x53'):if(_0x4cfa99['username']&&_0x4cfa99[_0x5128('0x2e')]){if(_0x4cfa99['baseUrl']){var _0x14e51c={'method':'POST','uri':_0x4cfa99[_0x5128('0x54')]+_0x5128('0x55'),'body':{'username':_0x4cfa99[_0x5128('0x31')],'password':_0x4cfa99[_0x5128('0x2e')]},'json':!![]};return rp(_0x14e51c)[_0x5128('0x27')](function(_0x59a37c){var _0x1b0079={'method':_0x5128('0x36'),'uri':_0x4cfa99['baseUrl']+_0x5128('0x56'),'body':{'messages':[{'from':_0x4cfa99[_0x5128('0x20')],'destinations':[{'to':_0x478d72[_0x5128('0x20')]}],'text':_0x478d72[_0x5128('0xd')],'notifyUrl':_0x4cfa99[_0x5128('0x24')]+_0x5128('0x25')+_0x478d72['id']+_0x5128('0x26')+_0x4cfa99[_0x5128('0x4f')],'notifyContentType':_0x5128('0x57'),'callbackData':_0x4cfa99[_0x5128('0x20')]+';'+_0x478d72['body']}]},'headers':{'Authorization':_0x5128('0x58')+_0x59a37c[_0x5128('0x4f')]},'json':!![]};return rp(_0x1b0079)['then'](function(_0x481dd2){if(_0x481dd2[_0x5128('0x22')]){var _0xf8dfdb={'messageId':_0x481dd2[_0x5128('0x22')][0x0][_0x5128('0xb')]};if(!_0x4cfa99[_0x5128('0x3a')]){_0xf8dfdb[_0x5128('0x3b')]=!![];}return _0x41bb8a[_0x5128('0x16')](_0xf8dfdb);}else{return logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x53'),util[_0x5128('0x2b')](_0x481dd2,{'showHidden':![],'depth':null}));}});})[_0x5128('0x18')](function(_0x41a686){return logger['error'](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x53'),util[_0x5128('0x2b')](_0x41a686,{'showHidden':![],'depth':null}));});}else{logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x53'),_0x5128('0x59'));}}else{logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x53'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x5128('0x5a'):var _0x1db36b=require(_0x5128('0x5b'));if(_0x4cfa99[_0x5128('0x5c')]){var _0x1768e3={};_0x1768e3[_0x5128('0x5d')]=_0x4cfa99['username'];_0x1768e3[_0x5128('0x20')]=_0x478d72[_0x5128('0x20')];_0x1768e3[_0x5128('0x5e')]=_0x4cfa99[_0x5128('0x20')];_0x1768e3[_0x5128('0x5f')]=_0x478d72[_0x5128('0xd')];_0x1768e3[_0x5128('0x60')]=+new Date();var _0x28bd04='';var _0x138719='';var _0x8be9e2=Object[_0x5128('0x61')](_0x1768e3);_0x8be9e2['sort']();for(var _0x3ab586=0x0;_0x3ab586<_0x8be9e2['length'];_0x3ab586++){if(_0x28bd04!=''){_0x28bd04+='&';}_0x28bd04+=_0x8be9e2[_0x3ab586]+'='+encodeURIComponent(_0x1768e3[_0x8be9e2[_0x3ab586]]);_0x138719+=_0x1768e3[_0x8be9e2[_0x3ab586]];}_0x138719+=_0x4cfa99[_0x5128('0x5c')];_0x138719=_0x1db36b[_0x5128('0x62')]('md5')[_0x5128('0x16')](_0x138719)[_0x5128('0x63')](_0x5128('0x64'));if(_0x28bd04!==''){_0x28bd04+='&';}_0x28bd04+=_0x5128('0x65')+_0x138719;var _0x185bf1={'method':_0x5128('0x33'),'uri':_0x4cfa99['baseUrl']+_0x5128('0x66')+_0x28bd04,'json':!![]};return rp(_0x185bf1)[_0x5128('0x27')](function(_0x50f693){var _0x535782=Object[_0x5128('0x61')](_0x50f693);if(_0x50f693[_0x535782[0x0]][_0x5128('0x19')]&&parseInt(_0x50f693[_0x535782[0x0]]['error'])===0x0){var _0x41f19f={'messageId':_0x50f693[_0x535782[0x0]]['id_sms']};if(!_0x4cfa99[_0x5128('0x3a')]){_0x41f19f[_0x5128('0x3b')]=!![];}return _0x41bb8a[_0x5128('0x16')](_0x41f19f);}else{return logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x5a'),util[_0x5128('0x2b')](_0x50f693[_0x5128('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x49a762){return logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x5a'),util[_0x5128('0x2b')](_0x49a762,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5128('0x2a'),_0x5128('0x5a'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x4cfa99[_0x5128('0x5c')]){var _0xedefa1={'method':_0x5128('0x36'),'uri':_0x5128('0x67'),'headers':{'Authorization':_0x4cfa99[_0x5128('0x5c')]},'body':{'content':_0x478d72[_0x5128('0xd')],'to':[_0x478d72[_0x5128('0x20')]],'from':_0x4cfa99[_0x5128('0x20')],'binary':![],'clientMessageId':_0x5128('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0xedefa1)[_0x5128('0x27')](function(_0x3c73fd){if(!_0x3c73fd[_0x5128('0x19')]){var _0x260161={'messageId':_0x3c73fd[_0x5128('0x22')][0x0][_0x5128('0x69')]};if(!_0x4cfa99[_0x5128('0x3a')]){_0x260161[_0x5128('0x3b')]=!![];}return _0x41bb8a[_0x5128('0x16')](_0x260161);}else{return logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x6a'),util['inspect'](_0x3c73fd['error'],{'showHidden':![],'depth':null}));}})[_0x5128('0x18')](function(_0x46958f){return logger['error'](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x6a'),util[_0x5128('0x2b')](_0x46958f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5128('0x2a'),_0x5128('0x6a'),_0x5128('0x6b'));}break;case'bandwidth':if(_0x4cfa99[_0x5128('0x31')]&&_0x4cfa99[_0x5128('0x2e')]){var _0x5eefd8=util[_0x5128('0x44')](_0x5128('0x42'),_0x4cfa99[_0x5128('0x31')],_0x4cfa99[_0x5128('0x2e')]);var _0x49da18={'method':_0x5128('0x36'),'uri':_0x5128('0x6c')+_0x4cfa99['accountId']+_0x5128('0x6d'),'body':{'to':[_0x478d72[_0x5128('0x20')]],'text':_0x478d72[_0x5128('0xd')],'from':_0x4cfa99[_0x5128('0x20')],'applicationId':_0x4cfa99[_0x5128('0x6e')]},'headers':{'Authorization':util[_0x5128('0x44')](_0x5128('0x51'),new Buffer(_0x5eefd8)[_0x5128('0x45')](_0x5128('0x46')))},'json':!![]};rp(_0x49da18)['then'](function(_0x1a2fe1){if(_0x1a2fe1['id']){var _0x194833={'messageId':_0x1a2fe1['id']};return _0x41bb8a['update'](_0x194833);}else{logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x6f'),util[_0x5128('0x2b')](_0x1a2fe1,{'showHidden':![],'depth':null}));}})[_0x5128('0x18')](function(_0x4c42e1){logger['error'](_0x5128('0x29'),'afterCreate',_0x5128('0x6f'),util['inspect'](_0x4c42e1,{'showHidden':![],'depth':null}));});}else{logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),'bandwidth',_0x5128('0x3c'));}break;case _0x5128('0x70'):if(_0x4cfa99[_0x5128('0x5c')]){var _0x56e191={};var _0x185bf1={'method':'POST','uri':_0x5128('0x71'),'headers':{'Authorization':_0x5128('0x72')+_0x4cfa99[_0x5128('0x5c')],'Content-Type':'application/json'},'body':{'from':_0x4cfa99[_0x5128('0x20')],'to':_0x478d72[_0x5128('0x20')],'text':_0x478d72['body']},'json':!![]};return rp(_0x185bf1)[_0x5128('0x27')](function(_0x1bedfc){if(_0x1bedfc[_0x5128('0x73')]==0xca){_0x56e191[_0x5128('0x74')]=_0x1bedfc;var _0x109bb0={'method':_0x5128('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x5128('0x72')+_0x4cfa99[_0x5128('0x5c')],'Content-Type':_0x5128('0x57')},'body':{'refid':_0x56e191[_0x5128('0x74')][_0x5128('0x75')]},'json':!![]};return rp(_0x109bb0)[_0x5128('0x27')](function(_0x374d85){_0x56e191[_0x5128('0x76')]=_0x374d85;var _0x3ca792={'messageId':_0x56e191[_0x5128('0x74')][_0x5128('0x75')],'read':!![]};return _0x41bb8a[_0x5128('0x16')](_0x3ca792);});}else{return logger[_0x5128('0x19')](_0x5128('0x29'),_0x5128('0x2a'),_0x5128('0x70'),util[_0x5128('0x2b')](_0x1bedfc,{'showHidden':![],'depth':null}));}})[_0x5128('0x18')](function(_0x4c76cd){return logger[_0x5128('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5128('0x2a'),_0x5128('0x70'),util[_0x5128('0x2b')](_0x4c76cd,{'showHidden':![],'depth':null}));});}else{return logger[_0x5128('0x19')](_0x5128('0x29'),'afterCreate',_0x5128('0x70'),_0x5128('0x77'));}break;}}})[_0x5128('0x78')](function(){_0x1a4084();});}else{_0x1a4084();}}},'charset':'utf8mb4','collate':_0x5128('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 714aee9..8783fe0 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 _0xdc3c=['catch','SmsMessage','create','body','options','raw','CreateSmsMessage','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xdc3c,0x1a9));var _0xcdc3=function(_0x803ce0,_0x2d77a4){_0x803ce0=_0x803ce0-0x0;var _0x13d2ee=_0xdc3c[_0x803ce0];return _0x13d2ee;};'use strict';var _=require(_0xcdc3('0x0'));var util=require(_0xcdc3('0x1'));var moment=require(_0xcdc3('0x2'));var BPromise=require(_0xcdc3('0x3'));var rs=require(_0xcdc3('0x4'));var fs=require('fs');var Redis=require(_0xcdc3('0x5'));var db=require(_0xcdc3('0x6'))['db'];var utils=require(_0xcdc3('0x7'));var logger=require(_0xcdc3('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcdc3('0x9'));var client=jayson[_0xcdc3('0xa')]['http']({'port':0x232a});config[_0xcdc3('0xb')]=_[_0xcdc3('0xc')](config['redis'],{'host':_0xcdc3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcdc3('0xb')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4a20b3,_0x1a6f68,_0x23446e){return new BPromise(function(_0x418650,_0x5a76a8){return client[_0xcdc3('0xe')](_0x4a20b3,_0x23446e)[_0xcdc3('0xf')](function(_0x1521d9){logger[_0xcdc3('0x10')](_0xcdc3('0x11'),_0x1a6f68,_0xcdc3('0x12'));logger['debug'](_0xcdc3('0x13'),_0x1a6f68,'request\x20sent',JSON['stringify'](_0x1521d9));if(_0x1521d9[_0xcdc3('0x14')]){if(_0x1521d9['error'][_0xcdc3('0x15')]===0x1f4){logger[_0xcdc3('0x14')](_0xcdc3('0x11'),_0x1a6f68,_0x1521d9[_0xcdc3('0x14')][_0xcdc3('0x16')]);return _0x5a76a8(_0x1521d9[_0xcdc3('0x14')][_0xcdc3('0x16')]);}logger[_0xcdc3('0x14')](_0xcdc3('0x11'),_0x1a6f68,_0x1521d9[_0xcdc3('0x14')]['message']);return _0x418650(_0x1521d9[_0xcdc3('0x14')][_0xcdc3('0x16')]);}else{logger[_0xcdc3('0x10')](_0xcdc3('0x11'),_0x1a6f68,_0xcdc3('0x12'));_0x418650(_0x1521d9['result'][_0xcdc3('0x16')]);}})[_0xcdc3('0x17')](function(_0x503dcc){logger[_0xcdc3('0x14')](_0xcdc3('0x11'),_0x1a6f68,_0x503dcc);_0x5a76a8(_0x503dcc);});});}exports['CreateSmsMessage']=function(_0x11bd85){var _0x336522=this;return new Promise(function(_0x28ac4e,_0x2a4e63){return db[_0xcdc3('0x18')][_0xcdc3('0x19')](_0x11bd85[_0xcdc3('0x1a')],{'raw':_0x11bd85['options']?_0x11bd85[_0xcdc3('0x1b')][_0xcdc3('0x1c')]===undefined?!![]:![]:!![]})[_0xcdc3('0xf')](function(_0x35ebaf){logger[_0xcdc3('0x10')](_0xcdc3('0x1d'),_0x11bd85);logger[_0xcdc3('0x1e')]('CreateSmsMessage',_0x11bd85,JSON[_0xcdc3('0x1f')](_0x35ebaf));_0x28ac4e(_0x35ebaf);})['catch'](function(_0x201eba){logger[_0xcdc3('0x14')](_0xcdc3('0x1d'),_0x201eba[_0xcdc3('0x16')],_0x11bd85);_0x2a4e63(_0x336522[_0xcdc3('0x14')](0x1f4,_0x201eba['message']));});});}; \ No newline at end of file +var _0x1a27=['message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x371ecd,_0x143709){var _0x879e1c=function(_0x3ec06a){while(--_0x3ec06a){_0x371ecd['push'](_0x371ecd['shift']());}};_0x879e1c(++_0x143709);}(_0x1a27,0x69));var _0x71a2=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x1a27[_0xbb091];return _0x467a04;};'use strict';var _=require('lodash');var util=require(_0x71a2('0x0'));var moment=require(_0x71a2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71a2('0x2'));var db=require(_0x71a2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x71a2('0x4'))(_0x71a2('0x5'));var config=require(_0x71a2('0x6'));var jayson=require(_0x71a2('0x7'));var client=jayson[_0x71a2('0x8')][_0x71a2('0x9')]({'port':0x232a});config[_0x71a2('0xa')]=_[_0x71a2('0xb')](config[_0x71a2('0xa')],{'host':_0x71a2('0xc'),'port':0x18eb});var socket=require(_0x71a2('0xd'))(new Redis(config[_0x71a2('0xa')]));require(_0x71a2('0xe'))['register'](socket);function respondWithRpcPromise(_0x4b76df,_0x5275c0,_0x444a13){return new BPromise(function(_0x137594,_0xdd86ca){return client['request'](_0x4b76df,_0x444a13)[_0x71a2('0xf')](function(_0x72c90){logger[_0x71a2('0x10')](_0x71a2('0x11'),_0x5275c0,_0x71a2('0x12'));logger[_0x71a2('0x13')](_0x71a2('0x14'),_0x5275c0,_0x71a2('0x12'),JSON[_0x71a2('0x15')](_0x72c90));if(_0x72c90['error']){if(_0x72c90['error']['code']===0x1f4){logger[_0x71a2('0x16')](_0x71a2('0x11'),_0x5275c0,_0x72c90['error'][_0x71a2('0x17')]);return _0xdd86ca(_0x72c90[_0x71a2('0x16')]['message']);}logger[_0x71a2('0x16')]('SmsMessage,\x20%s,\x20%s',_0x5275c0,_0x72c90[_0x71a2('0x16')][_0x71a2('0x17')]);return _0x137594(_0x72c90[_0x71a2('0x16')][_0x71a2('0x17')]);}else{logger[_0x71a2('0x10')](_0x71a2('0x11'),_0x5275c0,_0x71a2('0x12'));_0x137594(_0x72c90[_0x71a2('0x18')][_0x71a2('0x17')]);}})[_0x71a2('0x19')](function(_0x18d2ef){logger['error']('SmsMessage,\x20%s,\x20%s',_0x5275c0,_0x18d2ef);_0xdd86ca(_0x18d2ef);});});}exports[_0x71a2('0x1a')]=function(_0x121689){var _0x328857=this;return new Promise(function(_0x4ca9f1,_0x16db12){return db[_0x71a2('0x1b')][_0x71a2('0x1c')](_0x121689[_0x71a2('0x1d')],{'raw':_0x121689['options']?_0x121689[_0x71a2('0x1e')][_0x71a2('0x1f')]===undefined?!![]:![]:!![]})[_0x71a2('0xf')](function(_0xb63c0){logger['info']('CreateSmsMessage',_0x121689);logger[_0x71a2('0x13')](_0x71a2('0x1a'),_0x121689,JSON[_0x71a2('0x15')](_0xb63c0));_0x4ca9f1(_0xb63c0);})[_0x71a2('0x19')](function(_0x7d357){logger[_0x71a2('0x16')](_0x71a2('0x1a'),_0x7d357[_0x71a2('0x17')],_0x121689);_0x16db12(_0x328857[_0x71a2('0x16')](0x1f4,_0x7d357[_0x71a2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 181f45e..f7e5b0d 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 _0x8454=['./smsMessage.events','save','remove','emit','length'];(function(_0x4fb2a8,_0x29c316){var _0x51d2a3=function(_0x326bac){while(--_0x326bac){_0x4fb2a8['push'](_0x4fb2a8['shift']());}};_0x51d2a3(++_0x29c316);}(_0x8454,0x136));var _0x4845=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8454[_0x19e35c];return _0x3e1fe8;};'use strict';var SmsMessageEvents=require(_0x4845('0x0'));var events=[_0x4845('0x1'),_0x4845('0x2'),'update'];function createListener(_0x1d31eb,_0x425d79){return function(_0xf8df79){_0x425d79[_0x4845('0x3')](_0x1d31eb,_0xf8df79);};}function removeListener(_0x4c01ac,_0x26def2){return function(){SmsMessageEvents['removeListener'](_0x4c01ac,_0x26def2);};}exports['register']=function(_0x590076){for(var _0x38fbd8=0x0,_0x5a6ca8=events[_0x4845('0x4')];_0x38fbd8<_0x5a6ca8;_0x38fbd8++){var _0xb4d759=events[_0x38fbd8];var _0x500988=createListener('smsMessage:'+_0xb4d759,_0x590076);SmsMessageEvents['on'](_0xb4d759,_0x500988);}}; \ No newline at end of file +var _0xb7f9=['remove','update','emit','removeListener','register','length','smsMessage:','save'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0xb7f9,0x147));var _0x9b7f=function(_0x4e4e83,_0x2f29a7){_0x4e4e83=_0x4e4e83-0x0;var _0x4cbeb6=_0xb7f9[_0x4e4e83];return _0x4cbeb6;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x9b7f('0x0'),_0x9b7f('0x1'),_0x9b7f('0x2')];function createListener(_0x2784af,_0x4117d4){return function(_0x73a253){_0x4117d4[_0x9b7f('0x3')](_0x2784af,_0x73a253);};}function removeListener(_0x3a689e,_0x103a28){return function(){SmsMessageEvents[_0x9b7f('0x4')](_0x3a689e,_0x103a28);};}exports[_0x9b7f('0x5')]=function(_0x4e2ec2){for(var _0x39bef7=0x0,_0x431899=events[_0x9b7f('0x6')];_0x39bef7<_0x431899;_0x39bef7++){var _0x12389a=events[_0x39bef7];var _0x233328=createListener(_0x9b7f('0x7')+_0x12389a,_0x4e2ec2);SmsMessageEvents['on'](_0x12389a,_0x233328);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index a36cd28..b48aba9 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 _0xd7e9=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x44b827,_0x1bb1aa){var _0x527342=function(_0x481338){while(--_0x481338){_0x44b827['push'](_0x44b827['shift']());}};_0x527342(++_0x1bb1aa);}(_0xd7e9,0x187));var _0x9d7e=function(_0x4919ba,_0xc801f6){_0x4919ba=_0x4919ba-0x0;var _0x5ae917=_0xd7e9[_0x4919ba];return _0x5ae917;};'use strict';var multer=require('multer');var util=require(_0x9d7e('0x0'));var path=require('path');var timeout=require(_0x9d7e('0x1'));var express=require(_0x9d7e('0x2'));var router=express[_0x9d7e('0x3')]();var fs_extra=require(_0x9d7e('0x4'));var auth=require(_0x9d7e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x9d7e('0x6')]('/',auth['isAuthenticated'](),controller[_0x9d7e('0x7')]);router[_0x9d7e('0x6')]('/describe',auth[_0x9d7e('0x8')](),controller[_0x9d7e('0x9')]);router[_0x9d7e('0x6')](_0x9d7e('0xa'),auth[_0x9d7e('0x8')](),controller[_0x9d7e('0xb')]);router[_0x9d7e('0x6')](_0x9d7e('0xc'),auth[_0x9d7e('0x8')](),controller[_0x9d7e('0xd')]);router[_0x9d7e('0x6')](_0x9d7e('0xe'),auth['isAuthenticated'](),controller[_0x9d7e('0xf')]);router[_0x9d7e('0x6')](_0x9d7e('0x10'),auth[_0x9d7e('0x8')](),controller[_0x9d7e('0x11')]);router[_0x9d7e('0x12')]('/',auth[_0x9d7e('0x8')](),controller[_0x9d7e('0x13')]);router['post'](_0x9d7e('0xe'),auth[_0x9d7e('0x8')](),controller[_0x9d7e('0x14')]);router[_0x9d7e('0x12')](_0x9d7e('0x10'),auth['isAuthenticated'](),controller[_0x9d7e('0x15')]);router[_0x9d7e('0x16')](_0x9d7e('0xa'),auth['isAuthenticated'](),controller[_0x9d7e('0x17')]);router[_0x9d7e('0x18')](_0x9d7e('0xa'),auth[_0x9d7e('0x8')](),controller[_0x9d7e('0x19')]);router[_0x9d7e('0x18')](_0x9d7e('0xe'),auth[_0x9d7e('0x8')](),controller[_0x9d7e('0x1a')]);router[_0x9d7e('0x18')]('/:id/users',auth[_0x9d7e('0x8')](),controller[_0x9d7e('0x1b')]);module[_0x9d7e('0x1c')]=router; \ No newline at end of file +var _0xd022=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','index','get','/describe','isAuthenticated','describe','show','getMembers','getTeams','post','create','/:id/teams','addAgents','/:id','update','delete','destroy','removeTeams','/:id/users','removeAgents','multer','util','path'];(function(_0x18879e,_0x278693){var _0x113cce=function(_0x48cf96){while(--_0x48cf96){_0x18879e['push'](_0x18879e['shift']());}};_0x113cce(++_0x278693);}(_0xd022,0x1b0));var _0x2d02=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xd022[_0x21549c];return _0x426cbd;};'use strict';var multer=require(_0x2d02('0x0'));var util=require(_0x2d02('0x1'));var path=require(_0x2d02('0x2'));var timeout=require(_0x2d02('0x3'));var express=require(_0x2d02('0x4'));var router=express[_0x2d02('0x5')]();var fs_extra=require(_0x2d02('0x6'));var auth=require(_0x2d02('0x7'));var interaction=require(_0x2d02('0x8'));var config=require('../../config/environment');var controller=require(_0x2d02('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2d02('0xa')]);router[_0x2d02('0xb')](_0x2d02('0xc'),auth[_0x2d02('0xd')](),controller[_0x2d02('0xe')]);router['get']('/:id',auth[_0x2d02('0xd')](),controller[_0x2d02('0xf')]);router[_0x2d02('0xb')]('/:id/members',auth[_0x2d02('0xd')](),controller[_0x2d02('0x10')]);router[_0x2d02('0xb')]('/:id/teams',auth[_0x2d02('0xd')](),controller[_0x2d02('0x11')]);router[_0x2d02('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x2d02('0x12')]('/',auth[_0x2d02('0xd')](),controller[_0x2d02('0x13')]);router[_0x2d02('0x12')](_0x2d02('0x14'),auth[_0x2d02('0xd')](),controller['addTeams']);router[_0x2d02('0x12')]('/:id/users',auth[_0x2d02('0xd')](),controller[_0x2d02('0x15')]);router['put'](_0x2d02('0x16'),auth[_0x2d02('0xd')](),controller[_0x2d02('0x17')]);router[_0x2d02('0x18')](_0x2d02('0x16'),auth[_0x2d02('0xd')](),controller[_0x2d02('0x19')]);router['delete']('/:id/teams',auth[_0x2d02('0xd')](),controller[_0x2d02('0x1a')]);router[_0x2d02('0x18')](_0x2d02('0x1b'),auth[_0x2d02('0xd')](),controller[_0x2d02('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 993c181..d997146 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 _0xd5d7=['roundrobin','sequelize','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xd5d7,0x143));var _0x7d5d=function(_0x51772f,_0x41b0d6){_0x51772f=_0x51772f-0x0;var _0x49da3f=_0xd5d7[_0x51772f];return _0x49da3f;};'use strict';var Sequelize=require(_0x7d5d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d5d('0x1')],'unique':_0x7d5d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7d5d('0x1')]},'timeout':{'type':Sequelize[_0x7d5d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7d5d('0x4'),_0x7d5d('0x5'),_0x7d5d('0x6'))}}; \ No newline at end of file +var _0x3b77=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x29068e,_0x599ac0){var _0x1cda11=function(_0x338042){while(--_0x338042){_0x29068e['push'](_0x29068e['shift']());}};_0x1cda11(++_0x599ac0);}(_0x3b77,0x112));var _0x73b7=function(_0x4282ff,_0x970096){_0x4282ff=_0x4282ff-0x0;var _0x14c25a=_0x3b77[_0x4282ff];return _0x14c25a;};'use strict';var Sequelize=require(_0x73b7('0x0'));module[_0x73b7('0x1')]={'name':{'type':Sequelize[_0x73b7('0x2')],'unique':_0x73b7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x73b7('0x2')]},'timeout':{'type':Sequelize[_0x73b7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x73b7('0x5')](_0x73b7('0x6'),_0x73b7('0x7'),_0x73b7('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index e6f39db..59398df 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 _0x31b5=['pick','filter','merge','options','includeAll','include','findAll','rows','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','update','params','describe','findOne','UserSmsQueue','nolimit','order','SmsQueueId','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','ids','User','Agents','online','interface','flatMap','addTeams','each','forEach','field','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','sequelize','transaction','removeTeams','isEmpty','removeAgents','addAgents','omit','userSmsQueue:save','isArray','emit','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','SmsQueues','UserProfileResource','name','send','index','map','SmsQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where'];(function(_0x369d71,_0x1e1e62){var _0x2370c0=function(_0x24a95e){while(--_0x24a95e){_0x369d71['push'](_0x369d71['shift']());}};_0x2370c0(++_0x1e1e62);}(_0x31b5,0x159));var _0x531b=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x31b5[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x531b('0x0'));var rimraf=require(_0x531b('0x1'));var zipdir=require(_0x531b('0x2'));var jsonpatch=require(_0x531b('0x3'));var rp=require(_0x531b('0x4'));var moment=require(_0x531b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x531b('0x6'));var util=require(_0x531b('0x7'));var path=require(_0x531b('0x8'));var sox=require(_0x531b('0x9'));var csv=require(_0x531b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x531b('0xb'));var _=require('lodash');var squel=require(_0x531b('0xc'));var crypto=require('crypto');var jsforce=require(_0x531b('0xd'));var deskjs=require(_0x531b('0xe'));var toCsv=require(_0x531b('0xa'));var querystring=require(_0x531b('0xf'));var Papa=require(_0x531b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x531b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x531b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x531b('0x13'));var config=require(_0x531b('0x14'));var licenseUtil=require(_0x531b('0x15'));var db=require(_0x531b('0x16'))['db'];config[_0x531b('0x17')]=_[_0x531b('0x18')](config[_0x531b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x531b('0x19'))(new Redis(config['redis']));require(_0x531b('0x1a'))[_0x531b('0x1b')](socket);function respondWithStatusCode(_0x55129f,_0x184149){_0x184149=_0x184149||0xcc;return function(_0x1f63b3){if(_0x1f63b3){return _0x55129f[_0x531b('0x1c')](_0x184149);}return _0x55129f['status'](_0x184149)['end']();};}function respondWithResult(_0x2c8924,_0x3b56eb){_0x3b56eb=_0x3b56eb||0xc8;return function(_0x467c70){if(_0x467c70){return _0x2c8924[_0x531b('0x1d')](_0x3b56eb)['json'](_0x467c70);}};}function respondWithFilteredResult(_0x555783,_0x561f6a){return function(_0x3e9e0f){if(_0x3e9e0f){var _0x1c1165=typeof _0x561f6a[_0x531b('0x1e')]===_0x531b('0x1f')&&typeof _0x561f6a['limit']===_0x531b('0x1f');var _0x5fba3c=_0x3e9e0f[_0x531b('0x20')];var _0x4d9d5d=_0x1c1165?0x0:_0x561f6a[_0x531b('0x1e')];var _0x70174a=_0x1c1165?_0x3e9e0f[_0x531b('0x20')]:_0x561f6a[_0x531b('0x1e')]+_0x561f6a[_0x531b('0x21')];var _0x48ebe0;if(_0x70174a>=_0x5fba3c){_0x70174a=_0x5fba3c;_0x48ebe0=0xc8;}else{_0x48ebe0=0xce;}_0x555783['status'](_0x48ebe0);return _0x555783[_0x531b('0x22')](_0x531b('0x23'),_0x4d9d5d+'-'+_0x70174a+'/'+_0x5fba3c)['json'](_0x3e9e0f);}return null;};}function patchUpdates(_0x24f438){return function(_0x2d9a6d){try{jsonpatch[_0x531b('0x24')](_0x2d9a6d,_0x24f438,!![]);}catch(_0x32bcf9){return BPromise['reject'](_0x32bcf9);}return _0x2d9a6d[_0x531b('0x25')]();};}function saveUpdates(_0x2e4096,_0x4493b7){return function(_0x197487){if(_0x197487){return _0x197487['update'](_0x2e4096)[_0x531b('0x26')](function(_0x13455){return _0x13455;});}return null;};}function removeEntity(_0x99287f,_0xc4bd59){return function(_0x437fd9){if(_0x437fd9){return _0x437fd9[_0x531b('0x27')]()[_0x531b('0x26')](function(){var _0x3c9b6a=_0x437fd9['get']({'plain':!![]});var _0x3df286=_0x531b('0x28');return db[_0x531b('0x29')][_0x531b('0x27')]({'where':{'type':_0x3df286,'resourceId':_0x3c9b6a['id']}})[_0x531b('0x26')](function(){return _0x437fd9;});})[_0x531b('0x26')](function(){_0x99287f[_0x531b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34f33d,_0x7cc6ff){return function(_0x3d1068){if(!_0x3d1068){_0x34f33d['sendStatus'](0x194);}return _0x3d1068;};}function handleError(_0x55a437,_0x4a672d){_0x4a672d=_0x4a672d||0x1f4;return function(_0x52c517){logger['error'](_0x52c517['stack']);if(_0x52c517[_0x531b('0x2a')]){delete _0x52c517[_0x531b('0x2a')];}_0x55a437['status'](_0x4a672d)[_0x531b('0x2b')](_0x52c517);};}exports[_0x531b('0x2c')]=function(_0x241833,_0x4b8a7e){var _0x453db2={},_0x58b52b={},_0x5d73a7={'count':0x0,'rows':[]};var _0xc9c061=_[_0x531b('0x2d')](db[_0x531b('0x2e')][_0x531b('0x2f')],function(_0x554c1c){return{'name':_0x554c1c['fieldName'],'type':_0x554c1c[_0x531b('0x30')]['key']};});_0x58b52b[_0x531b('0x31')]=_[_0x531b('0x2d')](_0xc9c061,_0x531b('0x2a'));_0x58b52b[_0x531b('0x32')]=_[_0x531b('0x33')](_0x241833[_0x531b('0x32')]);_0x58b52b[_0x531b('0x34')]=_[_0x531b('0x35')](_0x58b52b[_0x531b('0x31')],_0x58b52b['query']);_0x453db2[_0x531b('0x36')]=_[_0x531b('0x35')](_0x58b52b[_0x531b('0x31')],qs[_0x531b('0x37')](_0x241833[_0x531b('0x32')][_0x531b('0x37')]));_0x453db2['attributes']=_0x453db2['attributes'][_0x531b('0x38')]?_0x453db2[_0x531b('0x36')]:_0x58b52b[_0x531b('0x31')];if(!_0x241833['query'][_0x531b('0x39')]('nolimit')){_0x453db2[_0x531b('0x21')]=qs[_0x531b('0x21')](_0x241833[_0x531b('0x32')][_0x531b('0x21')]);_0x453db2[_0x531b('0x1e')]=qs[_0x531b('0x1e')](_0x241833[_0x531b('0x32')][_0x531b('0x1e')]);}_0x453db2['order']=qs[_0x531b('0x3a')](_0x241833['query'][_0x531b('0x3a')]);_0x453db2[_0x531b('0x3b')]=qs[_0x531b('0x34')](_[_0x531b('0x3c')](_0x241833['query'],_0x58b52b[_0x531b('0x34')]),_0xc9c061);if(_0x241833[_0x531b('0x32')][_0x531b('0x3d')]){_0x453db2[_0x531b('0x3b')]=_['merge'](_0x453db2[_0x531b('0x3b')],{'$or':_['map'](_0xc9c061,function(_0x11a749){if(_0x11a749[_0x531b('0x30')]!=='VIRTUAL'){var _0x403499={};_0x403499[_0x11a749[_0x531b('0x2a')]]={'$like':'%'+_0x241833[_0x531b('0x32')][_0x531b('0x3d')]+'%'};return _0x403499;}})});}_0x453db2=_[_0x531b('0x3e')]({},_0x453db2,_0x241833[_0x531b('0x3f')]);var _0x270f75={'where':_0x453db2[_0x531b('0x3b')]};return db[_0x531b('0x2e')][_0x531b('0x20')](_0x270f75)[_0x531b('0x26')](function(_0x5ab46f){_0x5d73a7[_0x531b('0x20')]=_0x5ab46f;if(_0x241833['query'][_0x531b('0x40')]){_0x453db2[_0x531b('0x41')]=[{'all':!![]}];}return db['SmsQueue'][_0x531b('0x42')](_0x453db2);})[_0x531b('0x26')](function(_0x24db38){_0x5d73a7[_0x531b('0x43')]=_0x24db38;return _0x5d73a7;})[_0x531b('0x26')](respondWithFilteredResult(_0x4b8a7e,_0x453db2))['catch'](handleError(_0x4b8a7e,null));};exports[_0x531b('0x44')]=function(_0x4e6da6,_0x28d245){var _0x52236f={'raw':!![],'where':{'id':_0x4e6da6['params']['id']}},_0x1ee77e={};_0x1ee77e[_0x531b('0x31')]=_[_0x531b('0x33')](db['SmsQueue']['rawAttributes']);_0x1ee77e[_0x531b('0x32')]=_[_0x531b('0x33')](_0x4e6da6['query']);_0x1ee77e[_0x531b('0x34')]=_[_0x531b('0x35')](_0x1ee77e[_0x531b('0x31')],_0x1ee77e[_0x531b('0x32')]);_0x52236f[_0x531b('0x36')]=_[_0x531b('0x35')](_0x1ee77e[_0x531b('0x31')],qs['fields'](_0x4e6da6[_0x531b('0x32')]['fields']));_0x52236f[_0x531b('0x36')]=_0x52236f[_0x531b('0x36')][_0x531b('0x38')]?_0x52236f['attributes']:_0x1ee77e[_0x531b('0x31')];if(_0x4e6da6['query']['includeAll']){_0x52236f['include']=[{'all':!![]}];}_0x52236f=_[_0x531b('0x3e')]({},_0x52236f,_0x4e6da6[_0x531b('0x3f')]);return db[_0x531b('0x2e')][_0x531b('0x45')](_0x52236f)['then'](handleEntityNotFound(_0x28d245,null))['then'](respondWithResult(_0x28d245,null))['catch'](handleError(_0x28d245,null));};exports[_0x531b('0x46')]=function(_0xbeeff6,_0x5ddf7d){return db[_0x531b('0x2e')]['create'](_0xbeeff6[_0x531b('0x47')],{})[_0x531b('0x26')](function(_0x1d1475){var _0xb1e819=_0xbeeff6[_0x531b('0x48')][_0x531b('0x49')]({'plain':!![]});if(!_0xb1e819)throw new Error(_0x531b('0x4a'));if(_0xb1e819[_0x531b('0x4b')]===_0x531b('0x48')){var _0x1b4cbb=_0x1d1475[_0x531b('0x49')]({'plain':!![]});var _0x3ba0dc=_0x531b('0x28');return db[_0x531b('0x4c')][_0x531b('0x45')]({'where':{'name':_0x3ba0dc,'userProfileId':_0xb1e819['userProfileId']},'raw':!![]})[_0x531b('0x26')](function(_0x1ce738){if(_0x1ce738&&_0x1ce738['autoAssociation']===0x0){return db[_0x531b('0x29')][_0x531b('0x46')]({'name':_0x1b4cbb['name'],'resourceId':_0x1b4cbb['id'],'type':_0x1ce738[_0x531b('0x2a')],'sectionId':_0x1ce738['id']},{})['then'](function(){return _0x1d1475;});}else{return _0x1d1475;}})[_0x531b('0x4d')](function(_0x58f7ff){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58f7ff);throw _0x58f7ff;});}return _0x1d1475;})[_0x531b('0x26')](respondWithResult(_0x5ddf7d,0xc9))[_0x531b('0x4d')](handleError(_0x5ddf7d,null));};exports[_0x531b('0x4e')]=function(_0x13b508,_0x9e6b5a){if(_0x13b508['body']['id']){delete _0x13b508[_0x531b('0x47')]['id'];}return db[_0x531b('0x2e')]['find']({'where':{'id':_0x13b508[_0x531b('0x4f')]['id']}})[_0x531b('0x26')](handleEntityNotFound(_0x9e6b5a,null))['then'](saveUpdates(_0x13b508[_0x531b('0x47')],null))[_0x531b('0x26')](respondWithResult(_0x9e6b5a,null))[_0x531b('0x4d')](handleError(_0x9e6b5a,null));};exports[_0x531b('0x27')]=function(_0x1b0d03,_0x6e220e){return db[_0x531b('0x2e')][_0x531b('0x45')]({'where':{'id':_0x1b0d03[_0x531b('0x4f')]['id']}})[_0x531b('0x26')](handleEntityNotFound(_0x6e220e,null))[_0x531b('0x26')](removeEntity(_0x6e220e,null))[_0x531b('0x4d')](handleError(_0x6e220e,null));};exports[_0x531b('0x50')]=function(_0x4c2eac,_0x174f1a){return db['SmsQueue']['describe']()[_0x531b('0x26')](respondWithResult(_0x174f1a,null))[_0x531b('0x4d')](handleError(_0x174f1a,null));};exports['getMembers']=function(_0x121ceb,_0x29dbce,_0x566674){var _0x2d0d4c={'raw':!![],'where':{}},_0x436193={},_0x34fb3f;return db[_0x531b('0x2e')][_0x531b('0x51')]({'where':{'id':_0x121ceb[_0x531b('0x4f')]['id']}})[_0x531b('0x26')](handleEntityNotFound(_0x29dbce,null))['then'](function(_0x37446c){if(_0x37446c){_0x34fb3f=_0x37446c[_0x531b('0x49')]({'plain':!![]});_0x436193['model']=_[_0x531b('0x33')](db[_0x531b('0x52')]['rawAttributes']);_0x436193[_0x531b('0x32')]=_['keys'](_0x121ceb[_0x531b('0x32')]);_0x436193[_0x531b('0x34')]=_[_0x531b('0x35')](_0x436193[_0x531b('0x31')],_0x436193['query']);_0x2d0d4c[_0x531b('0x36')]=_[_0x531b('0x35')](_0x436193['model'],qs['fields'](_0x121ceb[_0x531b('0x32')]['fields']));_0x2d0d4c[_0x531b('0x36')]=_0x2d0d4c['attributes'][_0x531b('0x38')]?_0x2d0d4c[_0x531b('0x36')]:_0x436193[_0x531b('0x31')];if(!_0x121ceb[_0x531b('0x32')][_0x531b('0x39')](_0x531b('0x53'))){_0x2d0d4c[_0x531b('0x21')]=qs[_0x531b('0x21')](_0x121ceb[_0x531b('0x32')]['limit']);_0x2d0d4c[_0x531b('0x1e')]=qs[_0x531b('0x1e')](_0x121ceb[_0x531b('0x32')]['offset']);}_0x2d0d4c[_0x531b('0x54')]=qs[_0x531b('0x3a')](_0x121ceb['query'][_0x531b('0x3a')]);_0x2d0d4c[_0x531b('0x3b')]=qs[_0x531b('0x34')](_[_0x531b('0x3c')](_0x121ceb[_0x531b('0x32')],_0x436193['filters']));_0x2d0d4c[_0x531b('0x3b')][_0x531b('0x55')]=_0x37446c['id'];if(_0x121ceb['query'][_0x531b('0x3d')]){_0x2d0d4c['where']=_[_0x531b('0x3e')](_0x2d0d4c[_0x531b('0x3b')],{'$or':_[_0x531b('0x2d')](_0x2d0d4c[_0x531b('0x36')],function(_0x4a6366){var _0xc15b5c={};_0xc15b5c[_0x4a6366]={'$like':'%'+_0x121ceb[_0x531b('0x32')]['filter']+'%'};return _0xc15b5c;})});}_0x2d0d4c=_[_0x531b('0x3e')]({},_0x2d0d4c,_0x121ceb[_0x531b('0x3f')]);return db['UserSmsQueue'][_0x531b('0x42')](_0x2d0d4c);}})[_0x531b('0x26')](function(_0x5191cd){if(_0x5191cd){return db['User'][_0x531b('0x56')]({'where':{'id':_[_0x531b('0x2d')](_0x5191cd,_0x531b('0x57')),'role':_0x531b('0x58')},'attributes':['id',_0x531b('0x2a'),_0x531b('0x59'),'updatedAt',_0x531b('0x5a')]});}})['then'](function(_0x1ebde4){if(_0x1ebde4){return{'count':_0x1ebde4[_0x531b('0x20')],'rows':_['map'](_0x1ebde4[_0x531b('0x43')],function(_0xd03ea9){return{'membername':_0xd03ea9[_0x531b('0x2a')],'UserId':_0xd03ea9['id'],'queue_name':_0x34fb3f[_0x531b('0x2a')],'SmsQueueId':_0x34fb3f['id'],'interface':util[_0x531b('0x5b')](_0x531b('0x5c'),_0x531b('0x5d'),_0xd03ea9['name']),'penalty':0x0,'paused':_0xd03ea9[_0x531b('0x59')],'createdAt':_0xd03ea9[_0x531b('0x5a')],'updatedAt':_0xd03ea9[_0x531b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x531b('0x26')](respondWithFilteredResult(_0x29dbce,_0x2d0d4c))['catch'](handleError(_0x29dbce,null));};exports['getTeams']=function(_0x1e8144,_0x128248,_0x8bb542){var _0x84a1ee={};var _0x30f782={};var _0x5c7ac6;var _0x1395eb;return db[_0x531b('0x2e')]['findOne']({'where':{'id':_0x1e8144[_0x531b('0x4f')]['id']}})[_0x531b('0x26')](handleEntityNotFound(_0x128248,null))[_0x531b('0x26')](function(_0x3ee736){if(_0x3ee736){_0x5c7ac6=_0x3ee736;_0x30f782[_0x531b('0x31')]=_[_0x531b('0x33')](db[_0x531b('0x5f')][_0x531b('0x2f')]);_0x30f782['query']=_['keys'](_0x1e8144[_0x531b('0x32')]);_0x30f782['filters']=_[_0x531b('0x35')](_0x30f782[_0x531b('0x31')],_0x30f782[_0x531b('0x32')]);_0x84a1ee[_0x531b('0x36')]=_[_0x531b('0x35')](_0x30f782[_0x531b('0x31')],qs[_0x531b('0x37')](_0x1e8144[_0x531b('0x32')][_0x531b('0x37')]));_0x84a1ee['attributes']=_0x84a1ee['attributes'][_0x531b('0x38')]?_0x84a1ee[_0x531b('0x36')]:_0x30f782[_0x531b('0x31')];_0x84a1ee[_0x531b('0x54')]=qs[_0x531b('0x3a')](_0x1e8144['query'][_0x531b('0x3a')]);_0x84a1ee[_0x531b('0x3b')]=qs[_0x531b('0x34')](_[_0x531b('0x3c')](_0x1e8144[_0x531b('0x32')],_0x30f782[_0x531b('0x34')]));if(_0x1e8144[_0x531b('0x32')]['filter']){_0x84a1ee[_0x531b('0x3b')]=_[_0x531b('0x3e')](_0x84a1ee[_0x531b('0x3b')],{'$or':_[_0x531b('0x2d')](_0x84a1ee['attributes'],function(_0x53065a){var _0xfcf642={};_0xfcf642[_0x53065a]={'$like':'%'+_0x1e8144[_0x531b('0x32')][_0x531b('0x3d')]+'%'};return _0xfcf642;})});}_0x84a1ee=_['merge']({},_0x84a1ee,_0x1e8144[_0x531b('0x3f')]);return _0x5c7ac6[_0x531b('0x60')](_0x84a1ee);}})[_0x531b('0x26')](function(_0x13b1a5){if(_0x13b1a5){_0x1395eb=_0x13b1a5[_0x531b('0x38')];if(!_0x1e8144[_0x531b('0x32')][_0x531b('0x39')]('nolimit')){_0x84a1ee[_0x531b('0x21')]=qs[_0x531b('0x21')](_0x1e8144['query']['limit']);_0x84a1ee[_0x531b('0x1e')]=qs[_0x531b('0x1e')](_0x1e8144[_0x531b('0x32')][_0x531b('0x1e')]);}return _0x5c7ac6[_0x531b('0x60')](_0x84a1ee);}})['then'](function(_0x1fc32e){if(_0x1fc32e){return _0x1fc32e?{'count':_0x1395eb,'rows':_0x1fc32e}:null;}})['then'](respondWithResult(_0x128248,null))[_0x531b('0x4d')](handleError(_0x128248,null));};exports['addTeams']=function(_0x334e3d,_0x35628a,_0x54c0f6){var _0x2cc7de=_0x334e3d[_0x531b('0x47')][_0x531b('0x61')];return db[_0x531b('0x5f')]['findAll']({'where':{'id':_0x2cc7de},'attributes':['id'],'include':[{'model':db[_0x531b('0x62')],'as':_0x531b('0x63'),'attributes':['id',_0x531b('0x2a'),_0x531b('0x64'),'voicePause',_0x531b('0x65')],'raw':!![]}]})['then'](function(_0x1e70cf){if(_0x1e70cf){var _0xf5e65d=_[_0x531b('0x66')](_0x1e70cf,function(_0xbc046f){var _0x938c87=_0xbc046f[_0x531b('0x49')]({'plain':!![]});return _0x938c87[_0x531b('0x63')];});return db[_0x531b('0x2e')][_0x531b('0x45')]({'where':{'id':_0x334e3d[_0x531b('0x4f')]['id']}})[_0x531b('0x26')](function(_0x154f7a){return db['sequelize']['transaction'](function(_0x50dfac){return _0x154f7a[_0x531b('0x67')](_0x2cc7de,{'transaction':_0x50dfac})['then'](function(){return BPromise[_0x531b('0x68')](_0xf5e65d,function(_0x11b723){return db[_0x531b('0x52')]['findOrCreate']({'where':{'UserId':_0x11b723['id'],'SmsQueueId':_0x334e3d[_0x531b('0x4f')]['id']},'transaction':_0x50dfac});});})[_0x531b('0x26')](function(){_0xf5e65d[_0x531b('0x69')](function(_0x5c7346){socket['emit']('userSmsQueue:save',{'UserId':_0x5c7346['id'],'SmsQueueId':_0x154f7a['id']});});});});});}})[_0x531b('0x26')](respondWithStatusCode(_0x35628a,null))[_0x531b('0x4d')](handleError(_0x35628a,null));};exports['removeTeams']=function(_0x5b4981,_0x2d5946,_0x592338){return db[_0x531b('0x5f')][_0x531b('0x42')]({'where':{'id':_0x5b4981[_0x531b('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x531b('0x62')],'as':_0x531b('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d5946,null))[_0x531b('0x26')](function(_0x21fd06){var _0x32939c=_[_0x531b('0x2d')](_0x21fd06,'id');var _0x9741e5=[];var _0x3bf03=[];var _0x2e9e76=squel['select']();_0x2e9e76[_0x531b('0x6a')]('tq.TeamId')['from'](_0x531b('0x6b'),'tq')[_0x531b('0x6c')](_0x531b('0x6d'),'ut',_0x531b('0x6e'))[_0x531b('0x3b')](_0x531b('0x6f'),_0x5b4981[_0x531b('0x4f')]['id']);for(var _0x52507c=0x0;_0x52507c<_0x21fd06[_0x531b('0x38')];_0x52507c+=0x1){let _0x57b232=_0x21fd06[_0x52507c];for(var _0x21f7dc=0x0;_0x21f7dc<_0x57b232[_0x531b('0x63')][_0x531b('0x38')];_0x21f7dc+=0x1){let _0x19f516=_0x57b232[_0x531b('0x63')][_0x21f7dc];var _0xbaf639=_0x2e9e76[_0x531b('0x70')]();_0xbaf639[_0x531b('0x3b')](_0x531b('0x71'),_0x19f516['id']);_0x3bf03[_0x531b('0x72')](db['sequelize']['query'](_0xbaf639[_0x531b('0x73')](),{'type':db['sequelize'][_0x531b('0x74')]['SELECT']})['then'](function(_0x473a49){if(_0x473a49[_0x531b('0x38')]===0x1){return _0x19f516['id'];}else{var _0x46c03e=_[_0x531b('0x75')](_[_0x531b('0x2d')](_0x473a49,_0x531b('0x76')),function(_0x5bc74c){return _['includes'](_0x32939c,_0x5bc74c);});if(_0x46c03e){return _0x19f516['id'];}}}));}}return BPromise[_0x531b('0x77')](_0x3bf03)[_0x531b('0x26')](function(_0x4ad809){_0x9741e5=_(_0x9741e5)[_0x531b('0x78')](_0x4ad809)[_0x531b('0x79')]()[_0x531b('0x7a')]();return db[_0x531b('0x2e')][_0x531b('0x45')]({'where':{'id':_0x5b4981[_0x531b('0x4f')]['id']}})['then'](function(_0x54e17c){return db[_0x531b('0x7b')][_0x531b('0x7c')](function(_0xc1f970){return _0x54e17c[_0x531b('0x7d')](_0x5b4981[_0x531b('0x32')][_0x531b('0x61')],{'transaction':_0xc1f970})[_0x531b('0x26')](function(){if(!_[_0x531b('0x7e')](_0x9741e5)){return _0x54e17c[_0x531b('0x7f')](_0x9741e5,{'transaction':_0xc1f970});}})[_0x531b('0x26')](function(){_0x9741e5['forEach'](function(_0x52eb73){socket['emit']('userSmsQueue:remove',{'UserId':_0x52eb73,'SmsQueueId':_0x54e17c['id']});});});});});});})[_0x531b('0x26')](respondWithStatusCode(_0x2d5946,null))[_0x531b('0x4d')](handleError(_0x2d5946,null));};exports[_0x531b('0x80')]=function(_0x2893f3,_0x28de43,_0x58c6bf){return db[_0x531b('0x2e')]['find']({'where':{'id':_0x2893f3[_0x531b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x28de43,null))[_0x531b('0x26')](function(_0x35e297){if(_0x35e297){return _0x35e297[_0x531b('0x80')](_0x2893f3[_0x531b('0x47')][_0x531b('0x61')],_[_0x531b('0x81')](_0x2893f3[_0x531b('0x47')],[_0x531b('0x61'),'id'])||{})['spread'](function(_0x32ae53){for(var _0x271e24=0x0;_0x271e24<_0x2893f3[_0x531b('0x47')][_0x531b('0x61')][_0x531b('0x38')];_0x271e24+=0x1){socket['emit'](_0x531b('0x82'),{'UserId':Number(_0x2893f3[_0x531b('0x47')][_0x531b('0x61')][_0x271e24]),'SmsQueueId':Number(_0x2893f3[_0x531b('0x4f')]['id'])});}return _0x32ae53;});}})['then'](respondWithResult(_0x28de43,null))[_0x531b('0x4d')](handleError(_0x28de43,null));};exports[_0x531b('0x7f')]=function(_0x34f984,_0x29509f,_0x47434b){return db[_0x531b('0x2e')][_0x531b('0x45')]({'where':{'id':_0x34f984[_0x531b('0x4f')]['id']}})[_0x531b('0x26')](handleEntityNotFound(_0x29509f,null))[_0x531b('0x26')](function(_0x342303){if(_0x342303){return _0x342303[_0x531b('0x7f')](_0x34f984['query']['ids'])['then'](function(){if(_[_0x531b('0x83')](_0x34f984[_0x531b('0x32')]['ids'])){for(var _0x5d688a=0x0;_0x5d688a<_0x34f984[_0x531b('0x32')]['ids']['length'];_0x5d688a+=0x1){socket[_0x531b('0x84')](_0x531b('0x85'),{'UserId':Number(_0x34f984['query'][_0x531b('0x61')][_0x5d688a]),'SmsQueueId':Number(_0x34f984[_0x531b('0x4f')]['id'])});}}else{socket[_0x531b('0x84')](_0x531b('0x85'),{'UserId':Number(_0x34f984[_0x531b('0x32')][_0x531b('0x61')]),'SmsQueueId':Number(_0x34f984[_0x531b('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x29509f,null))[_0x531b('0x4d')](handleError(_0x29509f,null));};exports[_0x531b('0x86')]=function(_0x1258e0,_0x49cb7e,_0x4e7faf){var _0x140594={};var _0x1b4cb6={};var _0x198d66;var _0x3b3435;return db[_0x531b('0x2e')][_0x531b('0x51')]({'where':{'id':_0x1258e0['params']['id']}})[_0x531b('0x26')](handleEntityNotFound(_0x49cb7e,null))[_0x531b('0x26')](function(_0x5d7623){if(_0x5d7623){_0x198d66=_0x5d7623;_0x1b4cb6['model']=_[_0x531b('0x33')](db[_0x531b('0x62')][_0x531b('0x2f')]);_0x1b4cb6['query']=_['keys'](_0x1258e0[_0x531b('0x32')]);_0x1b4cb6[_0x531b('0x34')]=_[_0x531b('0x35')](_0x1b4cb6[_0x531b('0x31')],_0x1b4cb6[_0x531b('0x32')]);_0x140594[_0x531b('0x36')]=_[_0x531b('0x35')](_0x1b4cb6[_0x531b('0x31')],qs[_0x531b('0x37')](_0x1258e0[_0x531b('0x32')]['fields']));_0x140594[_0x531b('0x36')]=_0x140594[_0x531b('0x36')][_0x531b('0x38')]?_0x140594['attributes']:_0x1b4cb6['model'];_0x140594['order']=qs[_0x531b('0x3a')](_0x1258e0[_0x531b('0x32')]['sort']);_0x140594[_0x531b('0x3b')]=qs[_0x531b('0x34')](_[_0x531b('0x3c')](_0x1258e0[_0x531b('0x32')],_0x1b4cb6[_0x531b('0x34')]));if(_0x1258e0[_0x531b('0x32')]['filter']){_0x140594['where']=_['merge'](_0x140594['where'],{'$or':_[_0x531b('0x2d')](_0x140594[_0x531b('0x36')],function(_0x442816){var _0x44995d={};_0x44995d[_0x442816]={'$like':'%'+_0x1258e0[_0x531b('0x32')]['filter']+'%'};return _0x44995d;})});}_0x140594=_['merge']({},_0x140594,_0x1258e0[_0x531b('0x3f')]);return _0x198d66[_0x531b('0x86')](_0x140594);}})[_0x531b('0x26')](function(_0x4b04cf){if(_0x4b04cf){_0x3b3435=_0x4b04cf[_0x531b('0x38')];if(!_0x1258e0[_0x531b('0x32')][_0x531b('0x39')](_0x531b('0x53'))){_0x140594['limit']=qs[_0x531b('0x21')](_0x1258e0[_0x531b('0x32')][_0x531b('0x21')]);_0x140594['offset']=qs[_0x531b('0x1e')](_0x1258e0['query']['offset']);}return _0x198d66['getAgents'](_0x140594);}})[_0x531b('0x26')](function(_0x3fe613){if(_0x3fe613){return _0x3fe613?{'count':_0x3b3435,'rows':_0x3fe613}:null;}})['then'](respondWithResult(_0x49cb7e,null))[_0x531b('0x4d')](handleError(_0x49cb7e,null));}; \ No newline at end of file +var _0xe306=['filter','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','pick','SmsQueueId','findAndCountAll','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','options','ids','User','online','voicePause','interface','flatMap','transaction','each','userSmsQueue:save','removeTeams','Agents','tq.TeamId','from','team_has_sms_queues','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','removeAgents','userSmsQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./smsQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','destroy','SmsQueues','UserProfileResource','stack','name','index','map','SmsQueue','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe306,0x149));var _0x6e30=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xe306[_0x139a3c];return _0x2b375b;};'use strict';var emlformat=require(_0x6e30('0x0'));var rimraf=require(_0x6e30('0x1'));var zipdir=require(_0x6e30('0x2'));var jsonpatch=require(_0x6e30('0x3'));var rp=require(_0x6e30('0x4'));var moment=require(_0x6e30('0x5'));var BPromise=require(_0x6e30('0x6'));var Mustache=require(_0x6e30('0x7'));var util=require(_0x6e30('0x8'));var path=require(_0x6e30('0x9'));var sox=require(_0x6e30('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e30('0xb'));var _=require(_0x6e30('0xc'));var squel=require(_0x6e30('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6e30('0xe'));var toCsv=require(_0x6e30('0xf'));var querystring=require('querystring');var Papa=require(_0x6e30('0x10'));var Redis=require('ioredis');var authService=require(_0x6e30('0x11'));var qs=require(_0x6e30('0x12'));var as=require(_0x6e30('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e30('0x14'))('api');var utils=require(_0x6e30('0x15'));var config=require(_0x6e30('0x16'));var licenseUtil=require(_0x6e30('0x17'));var db=require(_0x6e30('0x18'))['db'];config[_0x6e30('0x19')]=_['defaults'](config[_0x6e30('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6e30('0x1a'))['register'](socket);function respondWithStatusCode(_0x47ef00,_0x103801){_0x103801=_0x103801||0xcc;return function(_0x471e64){if(_0x471e64){return _0x47ef00[_0x6e30('0x1b')](_0x103801);}return _0x47ef00['status'](_0x103801)[_0x6e30('0x1c')]();};}function respondWithResult(_0x32464f,_0x87f8fd){_0x87f8fd=_0x87f8fd||0xc8;return function(_0x4a44dc){if(_0x4a44dc){return _0x32464f[_0x6e30('0x1d')](_0x87f8fd)[_0x6e30('0x1e')](_0x4a44dc);}};}function respondWithFilteredResult(_0x5c9424,_0x2abf99){return function(_0x54dec4){if(_0x54dec4){var _0x478514=typeof _0x2abf99[_0x6e30('0x1f')]===_0x6e30('0x20')&&typeof _0x2abf99[_0x6e30('0x21')]===_0x6e30('0x20');var _0x5c8424=_0x54dec4['count'];var _0x4eb109=_0x478514?0x0:_0x2abf99['offset'];var _0x36c6e5=_0x478514?_0x54dec4[_0x6e30('0x22')]:_0x2abf99[_0x6e30('0x1f')]+_0x2abf99[_0x6e30('0x21')];var _0x5847ad;if(_0x36c6e5>=_0x5c8424){_0x36c6e5=_0x5c8424;_0x5847ad=0xc8;}else{_0x5847ad=0xce;}_0x5c9424['status'](_0x5847ad);return _0x5c9424['set']('Content-Range',_0x4eb109+'-'+_0x36c6e5+'/'+_0x5c8424)[_0x6e30('0x1e')](_0x54dec4);}return null;};}function patchUpdates(_0x1d4de3){return function(_0x265bdc){try{jsonpatch['apply'](_0x265bdc,_0x1d4de3,!![]);}catch(_0x23e399){return BPromise[_0x6e30('0x23')](_0x23e399);}return _0x265bdc[_0x6e30('0x24')]();};}function saveUpdates(_0x456f33,_0x4ded2a){return function(_0x3fa2fb){if(_0x3fa2fb){return _0x3fa2fb[_0x6e30('0x25')](_0x456f33)[_0x6e30('0x26')](function(_0x3a1be2){return _0x3a1be2;});}return null;};}function removeEntity(_0x667028,_0x50569e){return function(_0x21af0c){if(_0x21af0c){return _0x21af0c[_0x6e30('0x27')]()[_0x6e30('0x26')](function(){var _0x10e9b2=_0x21af0c['get']({'plain':!![]});var _0x1686e4=_0x6e30('0x28');return db[_0x6e30('0x29')][_0x6e30('0x27')]({'where':{'type':_0x1686e4,'resourceId':_0x10e9b2['id']}})[_0x6e30('0x26')](function(){return _0x21af0c;});})[_0x6e30('0x26')](function(){_0x667028[_0x6e30('0x1d')](0xcc)[_0x6e30('0x1c')]();});}};}function handleEntityNotFound(_0xabeadd,_0x20a269){return function(_0xfb4a1d){if(!_0xfb4a1d){_0xabeadd[_0x6e30('0x1b')](0x194);}return _0xfb4a1d;};}function handleError(_0x46b50c,_0x32f75d){_0x32f75d=_0x32f75d||0x1f4;return function(_0x50bca4){logger['error'](_0x50bca4[_0x6e30('0x2a')]);if(_0x50bca4[_0x6e30('0x2b')]){delete _0x50bca4[_0x6e30('0x2b')];}_0x46b50c[_0x6e30('0x1d')](_0x32f75d)['send'](_0x50bca4);};}exports[_0x6e30('0x2c')]=function(_0x5612ec,_0x2317dc){var _0x2682b5={},_0x19a73d={},_0x4eb795={'count':0x0,'rows':[]};var _0x21ca3e=_[_0x6e30('0x2d')](db[_0x6e30('0x2e')][_0x6e30('0x2f')],function(_0x282013){return{'name':_0x282013['fieldName'],'type':_0x282013[_0x6e30('0x30')]['key']};});_0x19a73d[_0x6e30('0x31')]=_['map'](_0x21ca3e,'name');_0x19a73d['query']=_[_0x6e30('0x32')](_0x5612ec[_0x6e30('0x33')]);_0x19a73d['filters']=_[_0x6e30('0x34')](_0x19a73d[_0x6e30('0x31')],_0x19a73d[_0x6e30('0x33')]);_0x2682b5[_0x6e30('0x35')]=_[_0x6e30('0x34')](_0x19a73d[_0x6e30('0x31')],qs[_0x6e30('0x36')](_0x5612ec[_0x6e30('0x33')][_0x6e30('0x36')]));_0x2682b5[_0x6e30('0x35')]=_0x2682b5['attributes'][_0x6e30('0x37')]?_0x2682b5[_0x6e30('0x35')]:_0x19a73d[_0x6e30('0x31')];if(!_0x5612ec[_0x6e30('0x33')][_0x6e30('0x38')](_0x6e30('0x39'))){_0x2682b5['limit']=qs['limit'](_0x5612ec[_0x6e30('0x33')][_0x6e30('0x21')]);_0x2682b5['offset']=qs[_0x6e30('0x1f')](_0x5612ec[_0x6e30('0x33')][_0x6e30('0x1f')]);}_0x2682b5[_0x6e30('0x3a')]=qs[_0x6e30('0x3b')](_0x5612ec[_0x6e30('0x33')]['sort']);_0x2682b5[_0x6e30('0x3c')]=qs[_0x6e30('0x3d')](_['pick'](_0x5612ec['query'],_0x19a73d['filters']),_0x21ca3e);if(_0x5612ec[_0x6e30('0x33')]['filter']){_0x2682b5[_0x6e30('0x3c')]=_[_0x6e30('0x3e')](_0x2682b5[_0x6e30('0x3c')],{'$or':_['map'](_0x21ca3e,function(_0x1f904d){if(_0x1f904d['type']!==_0x6e30('0x3f')){var _0x48606c={};_0x48606c[_0x1f904d[_0x6e30('0x2b')]]={'$like':'%'+_0x5612ec[_0x6e30('0x33')][_0x6e30('0x40')]+'%'};return _0x48606c;}})});}_0x2682b5=_[_0x6e30('0x3e')]({},_0x2682b5,_0x5612ec['options']);var _0x17763e={'where':_0x2682b5[_0x6e30('0x3c')]};return db[_0x6e30('0x2e')][_0x6e30('0x22')](_0x17763e)[_0x6e30('0x26')](function(_0x49ff89){_0x4eb795[_0x6e30('0x22')]=_0x49ff89;if(_0x5612ec[_0x6e30('0x33')][_0x6e30('0x41')]){_0x2682b5[_0x6e30('0x42')]=[{'all':!![]}];}return db['SmsQueue'][_0x6e30('0x43')](_0x2682b5);})['then'](function(_0x38ee16){_0x4eb795[_0x6e30('0x44')]=_0x38ee16;return _0x4eb795;})[_0x6e30('0x26')](respondWithFilteredResult(_0x2317dc,_0x2682b5))[_0x6e30('0x45')](handleError(_0x2317dc,null));};exports[_0x6e30('0x46')]=function(_0x13d470,_0x5f2b3d){var _0x33ccf4={'raw':!![],'where':{'id':_0x13d470[_0x6e30('0x47')]['id']}},_0x354e78={};_0x354e78['model']=_['keys'](db[_0x6e30('0x2e')]['rawAttributes']);_0x354e78['query']=_[_0x6e30('0x32')](_0x13d470[_0x6e30('0x33')]);_0x354e78[_0x6e30('0x3d')]=_[_0x6e30('0x34')](_0x354e78[_0x6e30('0x31')],_0x354e78[_0x6e30('0x33')]);_0x33ccf4[_0x6e30('0x35')]=_[_0x6e30('0x34')](_0x354e78[_0x6e30('0x31')],qs['fields'](_0x13d470[_0x6e30('0x33')][_0x6e30('0x36')]));_0x33ccf4[_0x6e30('0x35')]=_0x33ccf4['attributes'][_0x6e30('0x37')]?_0x33ccf4[_0x6e30('0x35')]:_0x354e78[_0x6e30('0x31')];if(_0x13d470[_0x6e30('0x33')][_0x6e30('0x41')]){_0x33ccf4[_0x6e30('0x42')]=[{'all':!![]}];}_0x33ccf4=_[_0x6e30('0x3e')]({},_0x33ccf4,_0x13d470['options']);return db[_0x6e30('0x2e')][_0x6e30('0x48')](_0x33ccf4)[_0x6e30('0x26')](handleEntityNotFound(_0x5f2b3d,null))['then'](respondWithResult(_0x5f2b3d,null))['catch'](handleError(_0x5f2b3d,null));};exports[_0x6e30('0x49')]=function(_0xbc4de2,_0x518567){return db[_0x6e30('0x2e')][_0x6e30('0x49')](_0xbc4de2[_0x6e30('0x4a')],{})[_0x6e30('0x26')](function(_0x2ded57){var _0x3aa097=_0xbc4de2[_0x6e30('0x4b')][_0x6e30('0x4c')]({'plain':!![]});if(!_0x3aa097)throw new Error(_0x6e30('0x4d'));if(_0x3aa097['role']==='user'){var _0x4695c9=_0x2ded57[_0x6e30('0x4c')]({'plain':!![]});var _0x3ad21a=_0x6e30('0x28');return db[_0x6e30('0x4e')][_0x6e30('0x48')]({'where':{'name':_0x3ad21a,'userProfileId':_0x3aa097['userProfileId']},'raw':!![]})['then'](function(_0x5f0331){if(_0x5f0331&&_0x5f0331['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4695c9[_0x6e30('0x2b')],'resourceId':_0x4695c9['id'],'type':_0x5f0331[_0x6e30('0x2b')],'sectionId':_0x5f0331['id']},{})[_0x6e30('0x26')](function(){return _0x2ded57;});}else{return _0x2ded57;}})[_0x6e30('0x45')](function(_0x387b06){logger[_0x6e30('0x4f')](_0x6e30('0x50'),_0x387b06);throw _0x387b06;});}return _0x2ded57;})[_0x6e30('0x26')](respondWithResult(_0x518567,0xc9))[_0x6e30('0x45')](handleError(_0x518567,null));};exports['update']=function(_0x377db4,_0x56c74e){if(_0x377db4['body']['id']){delete _0x377db4[_0x6e30('0x4a')]['id'];}return db['SmsQueue'][_0x6e30('0x48')]({'where':{'id':_0x377db4[_0x6e30('0x47')]['id']}})[_0x6e30('0x26')](handleEntityNotFound(_0x56c74e,null))[_0x6e30('0x26')](saveUpdates(_0x377db4[_0x6e30('0x4a')],null))[_0x6e30('0x26')](respondWithResult(_0x56c74e,null))['catch'](handleError(_0x56c74e,null));};exports[_0x6e30('0x27')]=function(_0x520c66,_0x28ee7d){return db[_0x6e30('0x2e')][_0x6e30('0x48')]({'where':{'id':_0x520c66[_0x6e30('0x47')]['id']}})[_0x6e30('0x26')](handleEntityNotFound(_0x28ee7d,null))['then'](removeEntity(_0x28ee7d,null))[_0x6e30('0x45')](handleError(_0x28ee7d,null));};exports[_0x6e30('0x51')]=function(_0x4a5a46,_0xa37dec){return db[_0x6e30('0x2e')]['describe']()[_0x6e30('0x26')](respondWithResult(_0xa37dec,null))[_0x6e30('0x45')](handleError(_0xa37dec,null));};exports[_0x6e30('0x52')]=function(_0x49de4f,_0x198b45,_0x548acd){var _0x2f1d3e={'raw':!![],'where':{}},_0x163d58={},_0x264686;return db['SmsQueue'][_0x6e30('0x53')]({'where':{'id':_0x49de4f['params']['id']}})[_0x6e30('0x26')](handleEntityNotFound(_0x198b45,null))[_0x6e30('0x26')](function(_0x3be426){if(_0x3be426){_0x264686=_0x3be426[_0x6e30('0x4c')]({'plain':!![]});_0x163d58[_0x6e30('0x31')]=_[_0x6e30('0x32')](db['UserSmsQueue']['rawAttributes']);_0x163d58[_0x6e30('0x33')]=_[_0x6e30('0x32')](_0x49de4f[_0x6e30('0x33')]);_0x163d58['filters']=_[_0x6e30('0x34')](_0x163d58[_0x6e30('0x31')],_0x163d58[_0x6e30('0x33')]);_0x2f1d3e['attributes']=_['intersection'](_0x163d58[_0x6e30('0x31')],qs['fields'](_0x49de4f['query'][_0x6e30('0x36')]));_0x2f1d3e['attributes']=_0x2f1d3e[_0x6e30('0x35')][_0x6e30('0x37')]?_0x2f1d3e[_0x6e30('0x35')]:_0x163d58[_0x6e30('0x31')];if(!_0x49de4f[_0x6e30('0x33')][_0x6e30('0x38')]('nolimit')){_0x2f1d3e['limit']=qs['limit'](_0x49de4f[_0x6e30('0x33')][_0x6e30('0x21')]);_0x2f1d3e[_0x6e30('0x1f')]=qs[_0x6e30('0x1f')](_0x49de4f[_0x6e30('0x33')]['offset']);}_0x2f1d3e[_0x6e30('0x3a')]=qs[_0x6e30('0x3b')](_0x49de4f[_0x6e30('0x33')][_0x6e30('0x3b')]);_0x2f1d3e[_0x6e30('0x3c')]=qs[_0x6e30('0x3d')](_[_0x6e30('0x54')](_0x49de4f['query'],_0x163d58['filters']));_0x2f1d3e[_0x6e30('0x3c')][_0x6e30('0x55')]=_0x3be426['id'];if(_0x49de4f[_0x6e30('0x33')][_0x6e30('0x40')]){_0x2f1d3e['where']=_['merge'](_0x2f1d3e[_0x6e30('0x3c')],{'$or':_['map'](_0x2f1d3e[_0x6e30('0x35')],function(_0x3c60e7){var _0x3e393f={};_0x3e393f[_0x3c60e7]={'$like':'%'+_0x49de4f[_0x6e30('0x33')]['filter']+'%'};return _0x3e393f;})});}_0x2f1d3e=_['merge']({},_0x2f1d3e,_0x49de4f['options']);return db['UserSmsQueue']['findAll'](_0x2f1d3e);}})['then'](function(_0x2eb93b){if(_0x2eb93b){return db['User'][_0x6e30('0x56')]({'where':{'id':_[_0x6e30('0x2d')](_0x2eb93b,'UserId'),'role':_0x6e30('0x57')},'attributes':['id','name',_0x6e30('0x58'),_0x6e30('0x59'),_0x6e30('0x5a')]});}})['then'](function(_0x1b45ec){if(_0x1b45ec){return{'count':_0x1b45ec[_0x6e30('0x22')],'rows':_[_0x6e30('0x2d')](_0x1b45ec['rows'],function(_0x585b45){return{'membername':_0x585b45[_0x6e30('0x2b')],'UserId':_0x585b45['id'],'queue_name':_0x264686[_0x6e30('0x2b')],'SmsQueueId':_0x264686['id'],'interface':util[_0x6e30('0x5b')](_0x6e30('0x5c'),_0x6e30('0x5d'),_0x585b45[_0x6e30('0x2b')]),'penalty':0x0,'paused':_0x585b45[_0x6e30('0x58')],'createdAt':_0x585b45['createdAt'],'updatedAt':_0x585b45[_0x6e30('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x198b45,_0x2f1d3e))[_0x6e30('0x45')](handleError(_0x198b45,null));};exports[_0x6e30('0x5e')]=function(_0x48f2ba,_0x396004,_0x563c89){var _0x543268={};var _0x4f82c8={};var _0x25e2f4;var _0x48d58b;return db[_0x6e30('0x2e')][_0x6e30('0x53')]({'where':{'id':_0x48f2ba[_0x6e30('0x47')]['id']}})[_0x6e30('0x26')](handleEntityNotFound(_0x396004,null))[_0x6e30('0x26')](function(_0x5f1ee8){if(_0x5f1ee8){_0x25e2f4=_0x5f1ee8;_0x4f82c8['model']=_[_0x6e30('0x32')](db[_0x6e30('0x5f')][_0x6e30('0x2f')]);_0x4f82c8[_0x6e30('0x33')]=_[_0x6e30('0x32')](_0x48f2ba[_0x6e30('0x33')]);_0x4f82c8[_0x6e30('0x3d')]=_[_0x6e30('0x34')](_0x4f82c8[_0x6e30('0x31')],_0x4f82c8['query']);_0x543268[_0x6e30('0x35')]=_[_0x6e30('0x34')](_0x4f82c8['model'],qs[_0x6e30('0x36')](_0x48f2ba[_0x6e30('0x33')]['fields']));_0x543268[_0x6e30('0x35')]=_0x543268[_0x6e30('0x35')][_0x6e30('0x37')]?_0x543268[_0x6e30('0x35')]:_0x4f82c8[_0x6e30('0x31')];_0x543268['order']=qs[_0x6e30('0x3b')](_0x48f2ba[_0x6e30('0x33')]['sort']);_0x543268['where']=qs['filters'](_[_0x6e30('0x54')](_0x48f2ba[_0x6e30('0x33')],_0x4f82c8['filters']));if(_0x48f2ba[_0x6e30('0x33')][_0x6e30('0x40')]){_0x543268[_0x6e30('0x3c')]=_[_0x6e30('0x3e')](_0x543268[_0x6e30('0x3c')],{'$or':_[_0x6e30('0x2d')](_0x543268[_0x6e30('0x35')],function(_0x1013bb){var _0x30214b={};_0x30214b[_0x1013bb]={'$like':'%'+_0x48f2ba[_0x6e30('0x33')][_0x6e30('0x40')]+'%'};return _0x30214b;})});}_0x543268=_['merge']({},_0x543268,_0x48f2ba[_0x6e30('0x60')]);return _0x25e2f4[_0x6e30('0x5e')](_0x543268);}})['then'](function(_0x48d7c6){if(_0x48d7c6){_0x48d58b=_0x48d7c6['length'];if(!_0x48f2ba['query'][_0x6e30('0x38')](_0x6e30('0x39'))){_0x543268[_0x6e30('0x21')]=qs['limit'](_0x48f2ba[_0x6e30('0x33')][_0x6e30('0x21')]);_0x543268[_0x6e30('0x1f')]=qs[_0x6e30('0x1f')](_0x48f2ba[_0x6e30('0x33')][_0x6e30('0x1f')]);}return _0x25e2f4['getTeams'](_0x543268);}})[_0x6e30('0x26')](function(_0x2096a9){if(_0x2096a9){return _0x2096a9?{'count':_0x48d58b,'rows':_0x2096a9}:null;}})[_0x6e30('0x26')](respondWithResult(_0x396004,null))[_0x6e30('0x45')](handleError(_0x396004,null));};exports['addTeams']=function(_0x43b84b,_0x30b050,_0x2faa79){var _0x21f1ae=_0x43b84b[_0x6e30('0x4a')][_0x6e30('0x61')];return db[_0x6e30('0x5f')]['findAll']({'where':{'id':_0x21f1ae},'attributes':['id'],'include':[{'model':db[_0x6e30('0x62')],'as':'Agents','attributes':['id',_0x6e30('0x2b'),_0x6e30('0x63'),_0x6e30('0x64'),_0x6e30('0x65')],'raw':!![]}]})[_0x6e30('0x26')](function(_0x34f747){if(_0x34f747){var _0x3fcdaf=_[_0x6e30('0x66')](_0x34f747,function(_0x105cc3){var _0x333262=_0x105cc3[_0x6e30('0x4c')]({'plain':!![]});return _0x333262['Agents'];});return db[_0x6e30('0x2e')][_0x6e30('0x48')]({'where':{'id':_0x43b84b['params']['id']}})[_0x6e30('0x26')](function(_0xd52645){return db['sequelize'][_0x6e30('0x67')](function(_0x4bfe13){return _0xd52645['addTeams'](_0x21f1ae,{'transaction':_0x4bfe13})[_0x6e30('0x26')](function(){return BPromise[_0x6e30('0x68')](_0x3fcdaf,function(_0x497634){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x497634['id'],'SmsQueueId':_0x43b84b[_0x6e30('0x47')]['id']},'transaction':_0x4bfe13});});})[_0x6e30('0x26')](function(){_0x3fcdaf['forEach'](function(_0x2ec9c9){socket['emit'](_0x6e30('0x69'),{'UserId':_0x2ec9c9['id'],'SmsQueueId':_0xd52645['id']});});});});});}})['then'](respondWithStatusCode(_0x30b050,null))[_0x6e30('0x45')](handleError(_0x30b050,null));};exports[_0x6e30('0x6a')]=function(_0x948866,_0x45694c,_0x4bb923){return db[_0x6e30('0x5f')][_0x6e30('0x43')]({'where':{'id':_0x948866[_0x6e30('0x33')][_0x6e30('0x61')]},'attributes':['id'],'include':[{'model':db[_0x6e30('0x62')],'as':_0x6e30('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x45694c,null))[_0x6e30('0x26')](function(_0x2cbbbe){var _0x344bf5=_[_0x6e30('0x2d')](_0x2cbbbe,'id');var _0x49dafc=[];var _0x54a3c8=[];var _0x16a710=squel['select']();_0x16a710['field'](_0x6e30('0x6c'))[_0x6e30('0x6d')](_0x6e30('0x6e'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948866['params']['id']);for(var _0x51387e=0x0;_0x51387e<_0x2cbbbe[_0x6e30('0x37')];_0x51387e+=0x1){let _0x25084e=_0x2cbbbe[_0x51387e];for(var _0x3204b6=0x0;_0x3204b6<_0x25084e[_0x6e30('0x6b')][_0x6e30('0x37')];_0x3204b6+=0x1){let _0x30f8f8=_0x25084e['Agents'][_0x3204b6];var _0x266f9a=_0x16a710[_0x6e30('0x6f')]();_0x266f9a['where'](_0x6e30('0x70'),_0x30f8f8['id']);_0x54a3c8[_0x6e30('0x71')](db['sequelize'][_0x6e30('0x33')](_0x266f9a[_0x6e30('0x72')](),{'type':db[_0x6e30('0x73')][_0x6e30('0x74')][_0x6e30('0x75')]})[_0x6e30('0x26')](function(_0x2b2e30){if(_0x2b2e30[_0x6e30('0x37')]===0x1){return _0x30f8f8['id'];}else{var _0x336bb2=_['every'](_['map'](_0x2b2e30,_0x6e30('0x76')),function(_0x4eff69){return _[_0x6e30('0x77')](_0x344bf5,_0x4eff69);});if(_0x336bb2){return _0x30f8f8['id'];}}}));}}return BPromise[_0x6e30('0x78')](_0x54a3c8)[_0x6e30('0x26')](function(_0x1830ce){_0x49dafc=_(_0x49dafc)[_0x6e30('0x79')](_0x1830ce)[_0x6e30('0x7a')]()['value']();return db['SmsQueue']['find']({'where':{'id':_0x948866[_0x6e30('0x47')]['id']}})[_0x6e30('0x26')](function(_0x5f1ed9){return db[_0x6e30('0x73')][_0x6e30('0x67')](function(_0x10f3ca){return _0x5f1ed9[_0x6e30('0x6a')](_0x948866[_0x6e30('0x33')][_0x6e30('0x61')],{'transaction':_0x10f3ca})[_0x6e30('0x26')](function(){if(!_['isEmpty'](_0x49dafc)){return _0x5f1ed9[_0x6e30('0x7b')](_0x49dafc,{'transaction':_0x10f3ca});}})[_0x6e30('0x26')](function(){_0x49dafc['forEach'](function(_0x5c2b3b){socket['emit'](_0x6e30('0x7c'),{'UserId':_0x5c2b3b,'SmsQueueId':_0x5f1ed9['id']});});});});});});})[_0x6e30('0x26')](respondWithStatusCode(_0x45694c,null))['catch'](handleError(_0x45694c,null));};exports[_0x6e30('0x7d')]=function(_0xef7847,_0x426652,_0x3f836c){return db[_0x6e30('0x2e')][_0x6e30('0x48')]({'where':{'id':_0xef7847[_0x6e30('0x47')]['id']}})[_0x6e30('0x26')](handleEntityNotFound(_0x426652,null))[_0x6e30('0x26')](function(_0x18a72a){if(_0x18a72a){return _0x18a72a[_0x6e30('0x7d')](_0xef7847['body'][_0x6e30('0x61')],_[_0x6e30('0x7e')](_0xef7847[_0x6e30('0x4a')],[_0x6e30('0x61'),'id'])||{})[_0x6e30('0x7f')](function(_0x4e94da){for(var _0x24e3bf=0x0;_0x24e3bf<_0xef7847['body'][_0x6e30('0x61')]['length'];_0x24e3bf+=0x1){socket[_0x6e30('0x80')](_0x6e30('0x69'),{'UserId':Number(_0xef7847[_0x6e30('0x4a')]['ids'][_0x24e3bf]),'SmsQueueId':Number(_0xef7847[_0x6e30('0x47')]['id'])});}return _0x4e94da;});}})[_0x6e30('0x26')](respondWithResult(_0x426652,null))['catch'](handleError(_0x426652,null));};exports[_0x6e30('0x7b')]=function(_0x541104,_0x228fe4,_0x275ce4){return db[_0x6e30('0x2e')]['find']({'where':{'id':_0x541104[_0x6e30('0x47')]['id']}})[_0x6e30('0x26')](handleEntityNotFound(_0x228fe4,null))[_0x6e30('0x26')](function(_0x30f75f){if(_0x30f75f){return _0x30f75f[_0x6e30('0x7b')](_0x541104[_0x6e30('0x33')][_0x6e30('0x61')])['then'](function(){if(_[_0x6e30('0x81')](_0x541104[_0x6e30('0x33')][_0x6e30('0x61')])){for(var _0x1be5e3=0x0;_0x1be5e3<_0x541104[_0x6e30('0x33')][_0x6e30('0x61')]['length'];_0x1be5e3+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x541104[_0x6e30('0x33')][_0x6e30('0x61')][_0x1be5e3]),'SmsQueueId':Number(_0x541104['params']['id'])});}}else{socket[_0x6e30('0x80')]('userSmsQueue:remove',{'UserId':Number(_0x541104[_0x6e30('0x33')][_0x6e30('0x61')]),'SmsQueueId':Number(_0x541104[_0x6e30('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x228fe4,null))['catch'](handleError(_0x228fe4,null));};exports[_0x6e30('0x82')]=function(_0x56fcb9,_0x1c63b1,_0x2071b0){var _0x1637ea={};var _0xb5d1c7={};var _0x3d646d;var _0x3a23b2;return db['SmsQueue'][_0x6e30('0x53')]({'where':{'id':_0x56fcb9[_0x6e30('0x47')]['id']}})[_0x6e30('0x26')](handleEntityNotFound(_0x1c63b1,null))[_0x6e30('0x26')](function(_0x2cd46e){if(_0x2cd46e){_0x3d646d=_0x2cd46e;_0xb5d1c7[_0x6e30('0x31')]=_[_0x6e30('0x32')](db[_0x6e30('0x62')][_0x6e30('0x2f')]);_0xb5d1c7[_0x6e30('0x33')]=_[_0x6e30('0x32')](_0x56fcb9[_0x6e30('0x33')]);_0xb5d1c7[_0x6e30('0x3d')]=_[_0x6e30('0x34')](_0xb5d1c7['model'],_0xb5d1c7[_0x6e30('0x33')]);_0x1637ea['attributes']=_['intersection'](_0xb5d1c7[_0x6e30('0x31')],qs[_0x6e30('0x36')](_0x56fcb9[_0x6e30('0x33')][_0x6e30('0x36')]));_0x1637ea[_0x6e30('0x35')]=_0x1637ea['attributes'][_0x6e30('0x37')]?_0x1637ea[_0x6e30('0x35')]:_0xb5d1c7['model'];_0x1637ea['order']=qs[_0x6e30('0x3b')](_0x56fcb9[_0x6e30('0x33')][_0x6e30('0x3b')]);_0x1637ea['where']=qs[_0x6e30('0x3d')](_[_0x6e30('0x54')](_0x56fcb9[_0x6e30('0x33')],_0xb5d1c7[_0x6e30('0x3d')]));if(_0x56fcb9['query'][_0x6e30('0x40')]){_0x1637ea[_0x6e30('0x3c')]=_[_0x6e30('0x3e')](_0x1637ea[_0x6e30('0x3c')],{'$or':_['map'](_0x1637ea[_0x6e30('0x35')],function(_0x621911){var _0x5c69e9={};_0x5c69e9[_0x621911]={'$like':'%'+_0x56fcb9[_0x6e30('0x33')]['filter']+'%'};return _0x5c69e9;})});}_0x1637ea=_[_0x6e30('0x3e')]({},_0x1637ea,_0x56fcb9[_0x6e30('0x60')]);return _0x3d646d[_0x6e30('0x82')](_0x1637ea);}})['then'](function(_0x4ff1fc){if(_0x4ff1fc){_0x3a23b2=_0x4ff1fc[_0x6e30('0x37')];if(!_0x56fcb9['query']['hasOwnProperty'](_0x6e30('0x39'))){_0x1637ea[_0x6e30('0x21')]=qs[_0x6e30('0x21')](_0x56fcb9[_0x6e30('0x33')][_0x6e30('0x21')]);_0x1637ea['offset']=qs[_0x6e30('0x1f')](_0x56fcb9[_0x6e30('0x33')][_0x6e30('0x1f')]);}return _0x3d646d[_0x6e30('0x82')](_0x1637ea);}})[_0x6e30('0x26')](function(_0x364f30){if(_0x364f30){return _0x364f30?{'count':_0x3a23b2,'rows':_0x364f30}:null;}})[_0x6e30('0x26')](respondWithResult(_0x1c63b1,null))['catch'](handleError(_0x1c63b1,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e1682e6..d9baa66 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 _0x78c9=['remove','emit','hasOwnProperty','hook','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x15f2ef,_0x995b88){var _0x29a6e0=function(_0x2b9ffb){while(--_0x2b9ffb){_0x15f2ef['push'](_0x15f2ef['shift']());}};_0x29a6e0(++_0x995b88);}(_0x78c9,0x184));var _0x978c=function(_0x1ec723,_0x248b75){_0x1ec723=_0x1ec723-0x0;var _0x32ad2d=_0x78c9[_0x1ec723];return _0x32ad2d;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x978c('0x0'))['db'][_0x978c('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x978c('0x2')](0x0);var events={'afterCreate':_0x978c('0x3'),'afterUpdate':'update','afterDestroy':_0x978c('0x4')};function emitEvent(_0x2b1336){return function(_0x3ac224,_0x5d97d8,_0x1a30d2){SmsQueueEvents[_0x978c('0x5')](_0x2b1336+':'+_0x3ac224['id'],_0x3ac224);SmsQueueEvents[_0x978c('0x5')](_0x2b1336,_0x3ac224);_0x1a30d2(null);};}for(var e in events){if(events[_0x978c('0x6')](e)){var event=events[e];SmsQueue[_0x978c('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x1033=['update','remove','emit','hasOwnProperty','hook','exports','SmsQueue','setMaxListeners','save'];(function(_0x71a7e7,_0x505d3f){var _0x5dfb36=function(_0x495031){while(--_0x495031){_0x71a7e7['push'](_0x71a7e7['shift']());}};_0x5dfb36(++_0x505d3f);}(_0x1033,0x11d));var _0x3103=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x1033[_0x11005e];return _0x29338f;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x3103('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3103('0x1')](0x0);var events={'afterCreate':_0x3103('0x2'),'afterUpdate':_0x3103('0x3'),'afterDestroy':_0x3103('0x4')};function emitEvent(_0x4b7881){return function(_0x592134,_0x431007,_0x5b10c1){SmsQueueEvents['emit'](_0x4b7881+':'+_0x592134['id'],_0x592134);SmsQueueEvents[_0x3103('0x5')](_0x4b7881,_0x592134);_0x5b10c1(null);};}for(var e in events){if(events[_0x3103('0x6')](e)){var event=events[e];SmsQueue[_0x3103('0x7')](e,emitEvent(event));}}module[_0x3103('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 000370e..cf8d11c 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 _0x657c=['exports','define','SmsQueue','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x239875,_0x52a793){var _0x55a8d6=function(_0x1c48db){while(--_0x1c48db){_0x239875['push'](_0x239875['shift']());}};_0x55a8d6(++_0x52a793);}(_0x657c,0xcf));var _0xc657=function(_0x42f00e,_0x51060a){_0x42f00e=_0x42f00e-0x0;var _0xb0ca09=_0x657c[_0x42f00e];return _0xb0ca09;};'use strict';var _=require(_0xc657('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc657('0x1'));var moment=require(_0xc657('0x2'));var BPromise=require(_0xc657('0x3'));var rp=require(_0xc657('0x4'));var fs=require('fs');var path=require(_0xc657('0x5'));var rimraf=require(_0xc657('0x6'));var config=require(_0xc657('0x7'));var attributes=require(_0xc657('0x8'));module[_0xc657('0x9')]=function(_0x596ced,_0x1a5840){return _0x596ced[_0xc657('0xa')](_0xc657('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcfd=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x38825d,_0x2fbc52){var _0x5aff0e=function(_0x18ac13){while(--_0x18ac13){_0x38825d['push'](_0x38825d['shift']());}};_0x5aff0e(++_0x2fbc52);}(_0xdcfd,0x186));var _0xddcf=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0xdcfd[_0x545b71];return _0x26e587;};'use strict';var _=require(_0xddcf('0x0'));var util=require(_0xddcf('0x1'));var logger=require(_0xddcf('0x2'))(_0xddcf('0x3'));var moment=require(_0xddcf('0x4'));var BPromise=require('bluebird');var rp=require(_0xddcf('0x5'));var fs=require('fs');var path=require(_0xddcf('0x6'));var rimraf=require(_0xddcf('0x7'));var config=require(_0xddcf('0x8'));var attributes=require(_0xddcf('0x9'));module[_0xddcf('0xa')]=function(_0x1f5f17,_0x37e76e){return _0x1f5f17[_0xddcf('0xb')](_0xddcf('0xc'),attributes,{'tableName':_0xddcf('0xd'),'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 acc7c22..abfbdcc 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 _0x7f09=['model','attributes','info','ShowSmsQueue','SmsQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','options','raw','where','include','map'];(function(_0x59bfbd,_0x3d67b0){var _0x1a50bc=function(_0x3f6bb3){while(--_0x3f6bb3){_0x59bfbd['push'](_0x59bfbd['shift']());}};_0x1a50bc(++_0x3d67b0);}(_0x7f09,0x1c2));var _0x97f0=function(_0x4d2c04,_0x556005){_0x4d2c04=_0x4d2c04-0x0;var _0xe5e6f2=_0x7f09[_0x4d2c04];return _0xe5e6f2;};'use strict';var _=require(_0x97f0('0x0'));var util=require(_0x97f0('0x1'));var moment=require(_0x97f0('0x2'));var BPromise=require('bluebird');var rs=require(_0x97f0('0x3'));var fs=require('fs');var Redis=require(_0x97f0('0x4'));var db=require(_0x97f0('0x5'))['db'];var utils=require(_0x97f0('0x6'));var logger=require(_0x97f0('0x7'))('rpc');var config=require(_0x97f0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x97f0('0x9')]({'port':0x232a});config[_0x97f0('0xa')]=_[_0x97f0('0xb')](config[_0x97f0('0xa')],{'host':_0x97f0('0xc'),'port':0x18eb});var socket=require(_0x97f0('0xd'))(new Redis(config[_0x97f0('0xa')]));require(_0x97f0('0xe'))['register'](socket);function respondWithRpcPromise(_0x4b32c7,_0x3a5854,_0x3998cb){return new BPromise(function(_0x5a3b5d,_0x5125e7){return client['request'](_0x4b32c7,_0x3998cb)[_0x97f0('0xf')](function(_0x3f96f3){logger['info']('SmsQueue,\x20%s,\x20%s',_0x3a5854,'request\x20sent');logger[_0x97f0('0x10')](_0x97f0('0x11'),_0x3a5854,_0x97f0('0x12'),JSON[_0x97f0('0x13')](_0x3f96f3));if(_0x3f96f3[_0x97f0('0x14')]){if(_0x3f96f3[_0x97f0('0x14')]['code']===0x1f4){logger[_0x97f0('0x14')](_0x97f0('0x15'),_0x3a5854,_0x3f96f3[_0x97f0('0x14')][_0x97f0('0x16')]);return _0x5125e7(_0x3f96f3['error']['message']);}logger[_0x97f0('0x14')]('SmsQueue,\x20%s,\x20%s',_0x3a5854,_0x3f96f3[_0x97f0('0x14')][_0x97f0('0x16')]);return _0x5a3b5d(_0x3f96f3[_0x97f0('0x14')][_0x97f0('0x16')]);}else{logger['info'](_0x97f0('0x15'),_0x3a5854,_0x97f0('0x12'));_0x5a3b5d(_0x3f96f3[_0x97f0('0x17')][_0x97f0('0x16')]);}})[_0x97f0('0x18')](function(_0x6c65a4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x3a5854,_0x6c65a4);_0x5125e7(_0x6c65a4);});});}exports[_0x97f0('0x19')]=function(_0x12e6be){var _0x4ed468=this;return new Promise(function(_0x103a20,_0xf8fe4c){return db['SmsQueue']['findAll']({'raw':_0x12e6be[_0x97f0('0x1a')]?_0x12e6be[_0x97f0('0x1a')][_0x97f0('0x1b')]===undefined?!![]:![]:!![],'where':_0x12e6be[_0x97f0('0x1a')]?_0x12e6be[_0x97f0('0x1a')][_0x97f0('0x1c')]||null:null,'attributes':_0x12e6be[_0x97f0('0x1a')]?_0x12e6be[_0x97f0('0x1a')]['attributes']||null:null,'limit':_0x12e6be[_0x97f0('0x1a')]?_0x12e6be[_0x97f0('0x1a')]['limit']||null:null,'include':_0x12e6be['options']?_0x12e6be[_0x97f0('0x1a')][_0x97f0('0x1d')]?_[_0x97f0('0x1e')](_0x12e6be[_0x97f0('0x1a')][_0x97f0('0x1d')],function(_0x4fadab){return{'model':db[_0x4fadab[_0x97f0('0x1f')]],'as':_0x4fadab['as'],'attributes':_0x4fadab['attributes'],'include':_0x4fadab[_0x97f0('0x1d')]?_[_0x97f0('0x1e')](_0x4fadab['include'],function(_0x12a7fe){return{'model':db[_0x12a7fe[_0x97f0('0x1f')]],'as':_0x12a7fe['as'],'attributes':_0x12a7fe[_0x97f0('0x20')],'include':_0x12a7fe[_0x97f0('0x1d')]?_[_0x97f0('0x1e')](_0x12a7fe[_0x97f0('0x1d')],function(_0x45689b){return{'model':db[_0x45689b[_0x97f0('0x1f')]],'as':_0x45689b['as'],'attributes':_0x45689b[_0x97f0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x97f0('0xf')](function(_0xbe08bc){logger[_0x97f0('0x21')](_0x97f0('0x19'),_0x12e6be);logger['debug'](_0x97f0('0x19'),_0x12e6be,JSON[_0x97f0('0x13')](_0xbe08bc));_0x103a20(_0xbe08bc);})[_0x97f0('0x18')](function(_0x59134a){logger[_0x97f0('0x14')]('GetSmsQueue',_0x59134a[_0x97f0('0x16')],_0x12e6be);_0xf8fe4c(_0x4ed468[_0x97f0('0x14')](0x1f4,_0x59134a[_0x97f0('0x16')]));});});};exports[_0x97f0('0x22')]=function(_0x282b4b){var _0x338de0=this;return new Promise(function(_0x19ed8b,_0x2de34a){return db[_0x97f0('0x23')][_0x97f0('0x24')]({'raw':_0x282b4b['options']?_0x282b4b['options'][_0x97f0('0x1b')]===undefined?!![]:![]:!![],'where':_0x282b4b['options']?_0x282b4b[_0x97f0('0x1a')][_0x97f0('0x1c')]||null:null,'attributes':_0x282b4b[_0x97f0('0x1a')]?_0x282b4b[_0x97f0('0x1a')][_0x97f0('0x20')]||null:null,'include':_0x282b4b['options']?_0x282b4b[_0x97f0('0x1a')][_0x97f0('0x1d')]?_[_0x97f0('0x1e')](_0x282b4b[_0x97f0('0x1a')]['include'],function(_0x3f0289){return{'model':db[_0x3f0289[_0x97f0('0x1f')]],'as':_0x3f0289['as'],'attributes':_0x3f0289['attributes'],'include':_0x3f0289['include']?_[_0x97f0('0x1e')](_0x3f0289[_0x97f0('0x1d')],function(_0x185f93){return{'model':db[_0x185f93[_0x97f0('0x1f')]],'as':_0x185f93['as'],'attributes':_0x185f93[_0x97f0('0x20')],'include':_0x185f93[_0x97f0('0x1d')]?_[_0x97f0('0x1e')](_0x185f93['include'],function(_0x41beff){return{'model':db[_0x41beff[_0x97f0('0x1f')]],'as':_0x41beff['as'],'attributes':_0x41beff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cf061){logger[_0x97f0('0x21')]('ShowSmsQueue',_0x282b4b);logger[_0x97f0('0x10')](_0x97f0('0x22'),_0x282b4b,JSON[_0x97f0('0x13')](_0x1cf061));_0x19ed8b(_0x1cf061);})['catch'](function(_0x188305){logger['error'](_0x97f0('0x22'),_0x188305['message'],_0x282b4b);_0x2de34a(_0x338de0[_0x97f0('0x14')](0x1f4,_0x188305['message']));});});}; \ No newline at end of file +var _0x7fba=['raw','where','attributes','include','map','model','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options'];(function(_0x290c34,_0x3758e6){var _0x383db3=function(_0x504c74){while(--_0x504c74){_0x290c34['push'](_0x290c34['shift']());}};_0x383db3(++_0x3758e6);}(_0x7fba,0x137));var _0xa7fb=function(_0x278380,_0x42ffbb){_0x278380=_0x278380-0x0;var _0x145f90=_0x7fba[_0x278380];return _0x145f90;};'use strict';var _=require(_0xa7fb('0x0'));var util=require(_0xa7fb('0x1'));var moment=require(_0xa7fb('0x2'));var BPromise=require(_0xa7fb('0x3'));var rs=require(_0xa7fb('0x4'));var fs=require('fs');var Redis=require(_0xa7fb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7fb('0x6'));var logger=require(_0xa7fb('0x7'))('rpc');var config=require(_0xa7fb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa7fb('0x9')][_0xa7fb('0xa')]({'port':0x232a});config['redis']=_[_0xa7fb('0xb')](config[_0xa7fb('0xc')],{'host':_0xa7fb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7fb('0xc')]));require(_0xa7fb('0xe'))[_0xa7fb('0xf')](socket);function respondWithRpcPromise(_0x5001d0,_0x4206d8,_0x4b5723){return new BPromise(function(_0x76fe1e,_0x309e81){return client[_0xa7fb('0x10')](_0x5001d0,_0x4b5723)[_0xa7fb('0x11')](function(_0x173f26){logger[_0xa7fb('0x12')](_0xa7fb('0x13'),_0x4206d8,'request\x20sent');logger[_0xa7fb('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x4206d8,_0xa7fb('0x15'),JSON[_0xa7fb('0x16')](_0x173f26));if(_0x173f26[_0xa7fb('0x17')]){if(_0x173f26[_0xa7fb('0x17')]['code']===0x1f4){logger['error'](_0xa7fb('0x13'),_0x4206d8,_0x173f26[_0xa7fb('0x17')][_0xa7fb('0x18')]);return _0x309e81(_0x173f26[_0xa7fb('0x17')][_0xa7fb('0x18')]);}logger[_0xa7fb('0x17')](_0xa7fb('0x13'),_0x4206d8,_0x173f26[_0xa7fb('0x17')]['message']);return _0x76fe1e(_0x173f26[_0xa7fb('0x17')][_0xa7fb('0x18')]);}else{logger[_0xa7fb('0x12')](_0xa7fb('0x13'),_0x4206d8,_0xa7fb('0x15'));_0x76fe1e(_0x173f26[_0xa7fb('0x19')][_0xa7fb('0x18')]);}})[_0xa7fb('0x1a')](function(_0x74efb2){logger[_0xa7fb('0x17')]('SmsQueue,\x20%s,\x20%s',_0x4206d8,_0x74efb2);_0x309e81(_0x74efb2);});});}exports[_0xa7fb('0x1b')]=function(_0x11b336){var _0x454023=this;return new Promise(function(_0x5def8a,_0x54d17d){return db[_0xa7fb('0x1c')][_0xa7fb('0x1d')]({'raw':_0x11b336[_0xa7fb('0x1e')]?_0x11b336['options'][_0xa7fb('0x1f')]===undefined?!![]:![]:!![],'where':_0x11b336['options']?_0x11b336[_0xa7fb('0x1e')][_0xa7fb('0x20')]||null:null,'attributes':_0x11b336[_0xa7fb('0x1e')]?_0x11b336['options'][_0xa7fb('0x21')]||null:null,'limit':_0x11b336[_0xa7fb('0x1e')]?_0x11b336[_0xa7fb('0x1e')]['limit']||null:null,'include':_0x11b336['options']?_0x11b336['options'][_0xa7fb('0x22')]?_[_0xa7fb('0x23')](_0x11b336[_0xa7fb('0x1e')][_0xa7fb('0x22')],function(_0x1a7f3c){return{'model':db[_0x1a7f3c[_0xa7fb('0x24')]],'as':_0x1a7f3c['as'],'attributes':_0x1a7f3c[_0xa7fb('0x21')],'include':_0x1a7f3c[_0xa7fb('0x22')]?_['map'](_0x1a7f3c[_0xa7fb('0x22')],function(_0x249285){return{'model':db[_0x249285[_0xa7fb('0x24')]],'as':_0x249285['as'],'attributes':_0x249285['attributes'],'include':_0x249285[_0xa7fb('0x22')]?_[_0xa7fb('0x23')](_0x249285[_0xa7fb('0x22')],function(_0x347463){return{'model':db[_0x347463[_0xa7fb('0x24')]],'as':_0x347463['as'],'attributes':_0x347463['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a4fa1){logger[_0xa7fb('0x12')](_0xa7fb('0x1b'),_0x11b336);logger['debug']('GetSmsQueue',_0x11b336,JSON[_0xa7fb('0x16')](_0x4a4fa1));_0x5def8a(_0x4a4fa1);})[_0xa7fb('0x1a')](function(_0xc0d362){logger['error']('GetSmsQueue',_0xc0d362[_0xa7fb('0x18')],_0x11b336);_0x54d17d(_0x454023['error'](0x1f4,_0xc0d362['message']));});});};exports[_0xa7fb('0x25')]=function(_0x4c3863){var _0x5d8176=this;return new Promise(function(_0x2522de,_0x1780a8){return db[_0xa7fb('0x1c')]['find']({'raw':_0x4c3863['options']?_0x4c3863['options'][_0xa7fb('0x1f')]===undefined?!![]:![]:!![],'where':_0x4c3863[_0xa7fb('0x1e')]?_0x4c3863[_0xa7fb('0x1e')]['where']||null:null,'attributes':_0x4c3863[_0xa7fb('0x1e')]?_0x4c3863[_0xa7fb('0x1e')][_0xa7fb('0x21')]||null:null,'include':_0x4c3863[_0xa7fb('0x1e')]?_0x4c3863['options'][_0xa7fb('0x22')]?_[_0xa7fb('0x23')](_0x4c3863[_0xa7fb('0x1e')][_0xa7fb('0x22')],function(_0x2557c0){return{'model':db[_0x2557c0[_0xa7fb('0x24')]],'as':_0x2557c0['as'],'attributes':_0x2557c0['attributes'],'include':_0x2557c0['include']?_['map'](_0x2557c0[_0xa7fb('0x22')],function(_0x346dc4){return{'model':db[_0x346dc4['model']],'as':_0x346dc4['as'],'attributes':_0x346dc4[_0xa7fb('0x21')],'include':_0x346dc4[_0xa7fb('0x22')]?_[_0xa7fb('0x23')](_0x346dc4[_0xa7fb('0x22')],function(_0x2fd439){return{'model':db[_0x2fd439[_0xa7fb('0x24')]],'as':_0x2fd439['as'],'attributes':_0x2fd439[_0xa7fb('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa7fb('0x11')](function(_0x209960){logger[_0xa7fb('0x12')]('ShowSmsQueue',_0x4c3863);logger[_0xa7fb('0x14')]('ShowSmsQueue',_0x4c3863,JSON[_0xa7fb('0x16')](_0x209960));_0x2522de(_0x209960);})[_0xa7fb('0x1a')](function(_0x2ee10d){logger[_0xa7fb('0x17')](_0xa7fb('0x25'),_0x2ee10d[_0xa7fb('0x18')],_0x4c3863);_0x1780a8(_0x5d8176['error'](0x1f4,_0x2ee10d[_0xa7fb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index fbfe12d..ed51019 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 _0xaa0b=['length','smsQueue:','./smsQueue.events','remove','update','removeListener','register'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0xaa0b,0x1c9));var _0xbaa0=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xaa0b[_0x178e48];return _0x440d7e;};'use strict';var SmsQueueEvents=require(_0xbaa0('0x0'));var events=['save',_0xbaa0('0x1'),_0xbaa0('0x2')];function createListener(_0x3ef8a1,_0x8ca3d4){return function(_0x4a557f){_0x8ca3d4['emit'](_0x3ef8a1,_0x4a557f);};}function removeListener(_0x1e6a21,_0x43b0a0){return function(){SmsQueueEvents[_0xbaa0('0x3')](_0x1e6a21,_0x43b0a0);};}exports[_0xbaa0('0x4')]=function(_0x234c86){for(var _0x399250=0x0,_0x6dc6d1=events[_0xbaa0('0x5')];_0x399250<_0x6dc6d1;_0x399250++){var _0x5a2771=events[_0x399250];var _0x55cdc0=createListener(_0xbaa0('0x6')+_0x5a2771,_0x234c86);SmsQueueEvents['on'](_0x5a2771,_0x55cdc0);}}; \ No newline at end of file +var _0xb5d4=['./smsQueue.events','save','remove','update','removeListener','length','smsQueue:'];(function(_0x43505f,_0x21a118){var _0x271c6b=function(_0x3bd654){while(--_0x3bd654){_0x43505f['push'](_0x43505f['shift']());}};_0x271c6b(++_0x21a118);}(_0xb5d4,0xd2));var _0x4b5d=function(_0x40392b,_0x2f310f){_0x40392b=_0x40392b-0x0;var _0x2dbb59=_0xb5d4[_0x40392b];return _0x2dbb59;};'use strict';var SmsQueueEvents=require(_0x4b5d('0x0'));var events=[_0x4b5d('0x1'),_0x4b5d('0x2'),_0x4b5d('0x3')];function createListener(_0x3a8615,_0x47735b){return function(_0x20d443){_0x47735b['emit'](_0x3a8615,_0x20d443);};}function removeListener(_0x1b4e7c,_0x52c975){return function(){SmsQueueEvents[_0x4b5d('0x4')](_0x1b4e7c,_0x52c975);};}exports['register']=function(_0x81d9b){for(var _0x1c7733=0x0,_0x30d96e=events[_0x4b5d('0x5')];_0x1c7733<_0x30d96e;_0x1c7733++){var _0x30ff78=events[_0x1c7733];var _0x12db34=createListener(_0x4b5d('0x6')+_0x30ff78,_0x81d9b);SmsQueueEvents['on'](_0x30ff78,_0x12db34);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f08839d..51166a5 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 _0x859b=['destroy','multer','util','path','connect-timeout','express','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x952a2f,_0x26024c){var _0x3c6c08=function(_0x32ba1f){while(--_0x32ba1f){_0x952a2f['push'](_0x952a2f['shift']());}};_0x3c6c08(++_0x26024c);}(_0x859b,0xf8));var _0xb859=function(_0xa22410,_0xec9b93){_0xa22410=_0xa22410-0x0;var _0x4bd1fc=_0x859b[_0xa22410];return _0x4bd1fc;};'use strict';var multer=require(_0xb859('0x0'));var util=require(_0xb859('0x1'));var path=require(_0xb859('0x2'));var timeout=require(_0xb859('0x3'));var express=require(_0xb859('0x4'));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(_0xb859('0x5'));var controller=require(_0xb859('0x6'));router[_0xb859('0x7')]('/',auth[_0xb859('0x8')](),controller['index']);router[_0xb859('0x7')](_0xb859('0x9'),auth[_0xb859('0x8')](),controller[_0xb859('0xa')]);router['get']('/:id',auth[_0xb859('0x8')](),controller[_0xb859('0xb')]);router[_0xb859('0xc')]('/',auth[_0xb859('0x8')](),controller[_0xb859('0xd')]);router[_0xb859('0xe')](_0xb859('0xf'),auth['isAuthenticated'](),controller[_0xb859('0x10')]);router[_0xb859('0x11')](_0xb859('0xf'),auth['isAuthenticated'](),controller[_0xb859('0x12')]);module['exports']=router; \ No newline at end of file +var _0x053b=['show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','index','get','/describe','isAuthenticated'];(function(_0x3be43b,_0x3c10b3){var _0x2dc567=function(_0x2c33e8){while(--_0x2c33e8){_0x3be43b['push'](_0x3be43b['shift']());}};_0x2dc567(++_0x3c10b3);}(_0x053b,0x120));var _0xb053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb053('0x0'));var path=require(_0xb053('0x1'));var timeout=require(_0xb053('0x2'));var express=require(_0xb053('0x3'));var router=express['Router']();var fs_extra=require(_0xb053('0x4'));var auth=require(_0xb053('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb053('0x6'));var controller=require(_0xb053('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb053('0x8')]);router[_0xb053('0x9')](_0xb053('0xa'),auth[_0xb053('0xb')](),controller['describe']);router[_0xb053('0x9')]('/:id',auth[_0xb053('0xb')](),controller[_0xb053('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb053('0xd')]);router[_0xb053('0xe')](_0xb053('0xf'),auth[_0xb053('0xb')](),controller[_0xb053('0x10')]);router[_0xb053('0x11')](_0xb053('0xf'),auth[_0xb053('0xb')](),controller[_0xb053('0x12')]);module[_0xb053('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index f7b0ee8..d8ececc 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 _0x46d2=['exports','STRING','moment','sequelize'];(function(_0x3d131a,_0x2ee691){var _0x44c22d=function(_0xa7a9fe){while(--_0xa7a9fe){_0x3d131a['push'](_0x3d131a['shift']());}};_0x44c22d(++_0x2ee691);}(_0x46d2,0x19e));var _0x246d=function(_0x332f30,_0x1e1e52){_0x332f30=_0x332f30-0x0;var _0x268b85=_0x46d2[_0x332f30];return _0x268b85;};'use strict';var moment=require(_0x246d('0x0'));var Sequelize=require(_0x246d('0x1'));module[_0x246d('0x2')]={'uniqueid':{'type':Sequelize[_0x246d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x246d('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x246d('0x3')]}}; \ No newline at end of file +var _0xd729=['sequelize','exports','STRING','DATE','moment'];(function(_0x1e6db1,_0xb90700){var _0x55e924=function(_0x353c27){while(--_0x353c27){_0x1e6db1['push'](_0x1e6db1['shift']());}};_0x55e924(++_0xb90700);}(_0xd729,0x1bc));var _0x9d72=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xd729[_0x4b2436];return _0x4f5ab2;};'use strict';var moment=require(_0x9d72('0x0'));var Sequelize=require(_0x9d72('0x1'));module[_0x9d72('0x2')]={'uniqueid':{'type':Sequelize[_0x9d72('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9d72('0x3')]},'joinAt':{'type':Sequelize[_0x9d72('0x4')]},'leaveAt':{'type':Sequelize[_0x9d72('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9d72('0x4')]},'reason':{'type':Sequelize[_0x9d72('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 247f52c..6193b08 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 _0x9bab=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','stack','name','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0xaf06ee,_0x139d54){var _0x5e463e=function(_0x4338f5){while(--_0x4338f5){_0xaf06ee['push'](_0xaf06ee['shift']());}};_0x5e463e(++_0x139d54);}(_0x9bab,0x1ae));var _0xb9ba=function(_0x32b15e,_0x3df48c){_0x32b15e=_0x32b15e-0x0;var _0x57b593=_0x9bab[_0x32b15e];return _0x57b593;};'use strict';var emlformat=require(_0xb9ba('0x0'));var rimraf=require(_0xb9ba('0x1'));var zipdir=require(_0xb9ba('0x2'));var jsonpatch=require(_0xb9ba('0x3'));var rp=require(_0xb9ba('0x4'));var moment=require(_0xb9ba('0x5'));var BPromise=require(_0xb9ba('0x6'));var Mustache=require(_0xb9ba('0x7'));var util=require(_0xb9ba('0x8'));var path=require(_0xb9ba('0x9'));var sox=require(_0xb9ba('0xa'));var csv=require(_0xb9ba('0xb'));var ejs=require(_0xb9ba('0xc'));var fs=require('fs');var fs_extra=require(_0xb9ba('0xd'));var _=require(_0xb9ba('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb9ba('0xf'));var deskjs=require(_0xb9ba('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb9ba('0x11'));var Redis=require(_0xb9ba('0x12'));var authService=require(_0xb9ba('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9ba('0x14'));var logger=require(_0xb9ba('0x15'))(_0xb9ba('0x16'));var utils=require(_0xb9ba('0x17'));var config=require(_0xb9ba('0x18'));var licenseUtil=require(_0xb9ba('0x19'));var db=require(_0xb9ba('0x1a'))['db'];function respondWithStatusCode(_0x22fc4e,_0x108c03){_0x108c03=_0x108c03||0xcc;return function(_0x3be939){if(_0x3be939){return _0x22fc4e[_0xb9ba('0x1b')](_0x108c03);}return _0x22fc4e[_0xb9ba('0x1c')](_0x108c03)[_0xb9ba('0x1d')]();};}function respondWithResult(_0x23b6e5,_0x550c86){_0x550c86=_0x550c86||0xc8;return function(_0x299bca){if(_0x299bca){return _0x23b6e5[_0xb9ba('0x1c')](_0x550c86)[_0xb9ba('0x1e')](_0x299bca);}};}function respondWithFilteredResult(_0x180670,_0x10db97){return function(_0x5ef109){if(_0x5ef109){var _0x36e02c=typeof _0x10db97[_0xb9ba('0x1f')]===_0xb9ba('0x20')&&typeof _0x10db97[_0xb9ba('0x21')]==='undefined';var _0x558c94=_0x5ef109[_0xb9ba('0x22')];var _0x295104=_0x36e02c?0x0:_0x10db97['offset'];var _0x279c97=_0x36e02c?_0x5ef109[_0xb9ba('0x22')]:_0x10db97[_0xb9ba('0x1f')]+_0x10db97[_0xb9ba('0x21')];var _0x3bf33f;if(_0x279c97>=_0x558c94){_0x279c97=_0x558c94;_0x3bf33f=0xc8;}else{_0x3bf33f=0xce;}_0x180670[_0xb9ba('0x1c')](_0x3bf33f);return _0x180670['set'](_0xb9ba('0x23'),_0x295104+'-'+_0x279c97+'/'+_0x558c94)[_0xb9ba('0x1e')](_0x5ef109);}return null;};}function patchUpdates(_0x58a589){return function(_0x2ea10a){try{jsonpatch['apply'](_0x2ea10a,_0x58a589,!![]);}catch(_0xb910d9){return BPromise[_0xb9ba('0x24')](_0xb910d9);}return _0x2ea10a['save']();};}function saveUpdates(_0x20b631,_0x36a2a0){return function(_0x5779e8){if(_0x5779e8){return _0x5779e8[_0xb9ba('0x25')](_0x20b631)[_0xb9ba('0x26')](function(_0x2686c5){return _0x2686c5;});}return null;};}function removeEntity(_0x2897a5,_0x2d8fbf){return function(_0x54c448){if(_0x54c448){return _0x54c448[_0xb9ba('0x27')]()['then'](function(){_0x2897a5[_0xb9ba('0x1c')](0xcc)[_0xb9ba('0x1d')]();});}};}function handleEntityNotFound(_0x49ed03,_0x4eabbe){return function(_0x4f40ab){if(!_0x4f40ab){_0x49ed03[_0xb9ba('0x1b')](0x194);}return _0x4f40ab;};}function handleError(_0xd21ea5,_0x463a71){_0x463a71=_0x463a71||0x1f4;return function(_0x4e3e1f){logger['error'](_0x4e3e1f[_0xb9ba('0x28')]);if(_0x4e3e1f[_0xb9ba('0x29')]){delete _0x4e3e1f[_0xb9ba('0x29')];}_0xd21ea5[_0xb9ba('0x1c')](_0x463a71)['send'](_0x4e3e1f);};}exports[_0xb9ba('0x2a')]=function(_0x452fcc,_0x387867){var _0x751525={},_0x501c2e={},_0x42fe3b={'count':0x0,'rows':[]};var _0x52ce80=_[_0xb9ba('0x2b')](db[_0xb9ba('0x2c')][_0xb9ba('0x2d')],function(_0x27b619){return{'name':_0x27b619['fieldName'],'type':_0x27b619[_0xb9ba('0x2e')][_0xb9ba('0x2f')]};});_0x501c2e[_0xb9ba('0x30')]=_[_0xb9ba('0x2b')](_0x52ce80,_0xb9ba('0x29'));_0x501c2e[_0xb9ba('0x31')]=_[_0xb9ba('0x32')](_0x452fcc['query']);_0x501c2e['filters']=_[_0xb9ba('0x33')](_0x501c2e[_0xb9ba('0x30')],_0x501c2e[_0xb9ba('0x31')]);_0x751525[_0xb9ba('0x34')]=_[_0xb9ba('0x33')](_0x501c2e[_0xb9ba('0x30')],qs['fields'](_0x452fcc[_0xb9ba('0x31')][_0xb9ba('0x35')]));_0x751525[_0xb9ba('0x34')]=_0x751525[_0xb9ba('0x34')][_0xb9ba('0x36')]?_0x751525[_0xb9ba('0x34')]:_0x501c2e[_0xb9ba('0x30')];if(!_0x452fcc[_0xb9ba('0x31')][_0xb9ba('0x37')]('nolimit')){_0x751525[_0xb9ba('0x21')]=qs['limit'](_0x452fcc['query'][_0xb9ba('0x21')]);_0x751525[_0xb9ba('0x1f')]=qs['offset'](_0x452fcc[_0xb9ba('0x31')]['offset']);}_0x751525[_0xb9ba('0x38')]=qs[_0xb9ba('0x39')](_0x452fcc[_0xb9ba('0x31')]['sort']);_0x751525[_0xb9ba('0x3a')]=qs[_0xb9ba('0x3b')](_['pick'](_0x452fcc[_0xb9ba('0x31')],_0x501c2e[_0xb9ba('0x3b')]),_0x52ce80);if(_0x452fcc[_0xb9ba('0x31')]['filter']){_0x751525[_0xb9ba('0x3a')]=_[_0xb9ba('0x3c')](_0x751525[_0xb9ba('0x3a')],{'$or':_['map'](_0x52ce80,function(_0x2ad91e){if(_0x2ad91e[_0xb9ba('0x2e')]!==_0xb9ba('0x3d')){var _0x1036bd={};_0x1036bd[_0x2ad91e[_0xb9ba('0x29')]]={'$like':'%'+_0x452fcc[_0xb9ba('0x31')][_0xb9ba('0x3e')]+'%'};return _0x1036bd;}})});}_0x751525=_[_0xb9ba('0x3c')]({},_0x751525,_0x452fcc[_0xb9ba('0x3f')]);var _0x16831c={'where':_0x751525[_0xb9ba('0x3a')]};return db[_0xb9ba('0x2c')][_0xb9ba('0x22')](_0x16831c)['then'](function(_0x2043c1){_0x42fe3b[_0xb9ba('0x22')]=_0x2043c1;if(_0x452fcc[_0xb9ba('0x31')][_0xb9ba('0x40')]){_0x751525['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xb9ba('0x41')](_0x751525);})[_0xb9ba('0x26')](function(_0x497290){_0x42fe3b[_0xb9ba('0x42')]=_0x497290;return _0x42fe3b;})['then'](respondWithFilteredResult(_0x387867,_0x751525))[_0xb9ba('0x43')](handleError(_0x387867,null));};exports[_0xb9ba('0x44')]=function(_0x4e7d21,_0x179cd1){var _0x4d5de3={'raw':!![],'where':{'id':_0x4e7d21[_0xb9ba('0x45')]['id']}},_0x1f673d={};_0x1f673d[_0xb9ba('0x30')]=_[_0xb9ba('0x32')](db[_0xb9ba('0x2c')]['rawAttributes']);_0x1f673d[_0xb9ba('0x31')]=_[_0xb9ba('0x32')](_0x4e7d21['query']);_0x1f673d[_0xb9ba('0x3b')]=_[_0xb9ba('0x33')](_0x1f673d[_0xb9ba('0x30')],_0x1f673d['query']);_0x4d5de3[_0xb9ba('0x34')]=_[_0xb9ba('0x33')](_0x1f673d[_0xb9ba('0x30')],qs['fields'](_0x4e7d21[_0xb9ba('0x31')][_0xb9ba('0x35')]));_0x4d5de3[_0xb9ba('0x34')]=_0x4d5de3[_0xb9ba('0x34')][_0xb9ba('0x36')]?_0x4d5de3[_0xb9ba('0x34')]:_0x1f673d['model'];if(_0x4e7d21[_0xb9ba('0x31')][_0xb9ba('0x40')]){_0x4d5de3[_0xb9ba('0x46')]=[{'all':!![]}];}_0x4d5de3=_[_0xb9ba('0x3c')]({},_0x4d5de3,_0x4e7d21[_0xb9ba('0x3f')]);return db['SmsQueueReport'][_0xb9ba('0x47')](_0x4d5de3)[_0xb9ba('0x26')](handleEntityNotFound(_0x179cd1,null))[_0xb9ba('0x26')](respondWithResult(_0x179cd1,null))[_0xb9ba('0x43')](handleError(_0x179cd1,null));};exports[_0xb9ba('0x48')]=function(_0x5e97a5,_0x26369){return db[_0xb9ba('0x2c')][_0xb9ba('0x48')](_0x5e97a5[_0xb9ba('0x49')],{})['then'](respondWithResult(_0x26369,0xc9))[_0xb9ba('0x43')](handleError(_0x26369,null));};exports[_0xb9ba('0x25')]=function(_0x240290,_0x3acdff){if(_0x240290[_0xb9ba('0x49')]['id']){delete _0x240290[_0xb9ba('0x49')]['id'];}return db[_0xb9ba('0x2c')][_0xb9ba('0x47')]({'where':{'id':_0x240290[_0xb9ba('0x45')]['id']}})[_0xb9ba('0x26')](handleEntityNotFound(_0x3acdff,null))[_0xb9ba('0x26')](saveUpdates(_0x240290['body'],null))[_0xb9ba('0x26')](respondWithResult(_0x3acdff,null))[_0xb9ba('0x43')](handleError(_0x3acdff,null));};exports[_0xb9ba('0x27')]=function(_0x1a94c1,_0x4126d7){return db[_0xb9ba('0x2c')][_0xb9ba('0x47')]({'where':{'id':_0x1a94c1[_0xb9ba('0x45')]['id']}})[_0xb9ba('0x26')](handleEntityNotFound(_0x4126d7,null))[_0xb9ba('0x26')](removeEntity(_0x4126d7,null))[_0xb9ba('0x43')](handleError(_0x4126d7,null));};exports[_0xb9ba('0x4a')]=function(_0x103ba8,_0x2c87aa){return db[_0xb9ba('0x2c')][_0xb9ba('0x4a')]()[_0xb9ba('0x26')](respondWithResult(_0x2c87aa,null))[_0xb9ba('0x43')](handleError(_0x2c87aa,null));}; \ No newline at end of file +var _0x7392=['limit','count','set','Content-Range','reject','save','update','then','destroy','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x409251,_0x40f525){var _0x216f47=function(_0x517895){while(--_0x517895){_0x409251['push'](_0x409251['shift']());}};_0x216f47(++_0x40f525);}(_0x7392,0x1e8));var _0x2739=function(_0x1bded3,_0x15cd8c){_0x1bded3=_0x1bded3-0x0;var _0x337564=_0x7392[_0x1bded3];return _0x337564;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2739('0x0'));var zipdir=require(_0x2739('0x1'));var jsonpatch=require(_0x2739('0x2'));var rp=require(_0x2739('0x3'));var moment=require(_0x2739('0x4'));var BPromise=require(_0x2739('0x5'));var Mustache=require(_0x2739('0x6'));var util=require(_0x2739('0x7'));var path=require(_0x2739('0x8'));var sox=require(_0x2739('0x9'));var csv=require(_0x2739('0xa'));var ejs=require(_0x2739('0xb'));var fs=require('fs');var fs_extra=require(_0x2739('0xc'));var _=require(_0x2739('0xd'));var squel=require('squel');var crypto=require(_0x2739('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2739('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2739('0x10'));var Redis=require(_0x2739('0x11'));var authService=require(_0x2739('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2739('0x13'));var logger=require('../../config/logger')(_0x2739('0x14'));var utils=require('../../config/utils');var config=require(_0x2739('0x15'));var licenseUtil=require(_0x2739('0x16'));var db=require(_0x2739('0x17'))['db'];function respondWithStatusCode(_0x5a11a6,_0x139a89){_0x139a89=_0x139a89||0xcc;return function(_0x34e8b9){if(_0x34e8b9){return _0x5a11a6[_0x2739('0x18')](_0x139a89);}return _0x5a11a6[_0x2739('0x19')](_0x139a89)[_0x2739('0x1a')]();};}function respondWithResult(_0x4791f0,_0x1e14fb){_0x1e14fb=_0x1e14fb||0xc8;return function(_0x206505){if(_0x206505){return _0x4791f0[_0x2739('0x19')](_0x1e14fb)[_0x2739('0x1b')](_0x206505);}};}function respondWithFilteredResult(_0x59935d,_0x489633){return function(_0x39b675){if(_0x39b675){var _0x3abc1e=typeof _0x489633[_0x2739('0x1c')]===_0x2739('0x1d')&&typeof _0x489633[_0x2739('0x1e')]===_0x2739('0x1d');var _0x2b68f0=_0x39b675[_0x2739('0x1f')];var _0x2b8d12=_0x3abc1e?0x0:_0x489633[_0x2739('0x1c')];var _0x67873c=_0x3abc1e?_0x39b675[_0x2739('0x1f')]:_0x489633[_0x2739('0x1c')]+_0x489633[_0x2739('0x1e')];var _0x1d12cf;if(_0x67873c>=_0x2b68f0){_0x67873c=_0x2b68f0;_0x1d12cf=0xc8;}else{_0x1d12cf=0xce;}_0x59935d[_0x2739('0x19')](_0x1d12cf);return _0x59935d[_0x2739('0x20')](_0x2739('0x21'),_0x2b8d12+'-'+_0x67873c+'/'+_0x2b68f0)['json'](_0x39b675);}return null;};}function patchUpdates(_0x5a1d82){return function(_0x44476e){try{jsonpatch['apply'](_0x44476e,_0x5a1d82,!![]);}catch(_0x55a5ea){return BPromise[_0x2739('0x22')](_0x55a5ea);}return _0x44476e[_0x2739('0x23')]();};}function saveUpdates(_0x5a023c,_0x5ef27d){return function(_0x3cb3ba){if(_0x3cb3ba){return _0x3cb3ba[_0x2739('0x24')](_0x5a023c)[_0x2739('0x25')](function(_0x180ed9){return _0x180ed9;});}return null;};}function removeEntity(_0x2c129f,_0x1632f7){return function(_0x391704){if(_0x391704){return _0x391704[_0x2739('0x26')]()[_0x2739('0x25')](function(){_0x2c129f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed9400,_0x539841){return function(_0x203924){if(!_0x203924){_0xed9400['sendStatus'](0x194);}return _0x203924;};}function handleError(_0x4b0f74,_0x180782){_0x180782=_0x180782||0x1f4;return function(_0x2f58bc){logger['error'](_0x2f58bc['stack']);if(_0x2f58bc['name']){delete _0x2f58bc['name'];}_0x4b0f74[_0x2739('0x19')](_0x180782)[_0x2739('0x27')](_0x2f58bc);};}exports[_0x2739('0x28')]=function(_0x505e7e,_0x1ce7b0){var _0x44bc9d={},_0x566203={},_0x781337={'count':0x0,'rows':[]};var _0x412b3b=_[_0x2739('0x29')](db[_0x2739('0x2a')][_0x2739('0x2b')],function(_0x3a78e0){return{'name':_0x3a78e0[_0x2739('0x2c')],'type':_0x3a78e0['type'][_0x2739('0x2d')]};});_0x566203[_0x2739('0x2e')]=_[_0x2739('0x29')](_0x412b3b,_0x2739('0x2f'));_0x566203[_0x2739('0x30')]=_[_0x2739('0x31')](_0x505e7e['query']);_0x566203['filters']=_['intersection'](_0x566203[_0x2739('0x2e')],_0x566203[_0x2739('0x30')]);_0x44bc9d[_0x2739('0x32')]=_[_0x2739('0x33')](_0x566203[_0x2739('0x2e')],qs[_0x2739('0x34')](_0x505e7e['query'][_0x2739('0x34')]));_0x44bc9d[_0x2739('0x32')]=_0x44bc9d[_0x2739('0x32')][_0x2739('0x35')]?_0x44bc9d['attributes']:_0x566203[_0x2739('0x2e')];if(!_0x505e7e[_0x2739('0x30')][_0x2739('0x36')]('nolimit')){_0x44bc9d['limit']=qs[_0x2739('0x1e')](_0x505e7e[_0x2739('0x30')][_0x2739('0x1e')]);_0x44bc9d[_0x2739('0x1c')]=qs['offset'](_0x505e7e[_0x2739('0x30')]['offset']);}_0x44bc9d[_0x2739('0x37')]=qs[_0x2739('0x38')](_0x505e7e[_0x2739('0x30')][_0x2739('0x38')]);_0x44bc9d['where']=qs[_0x2739('0x39')](_['pick'](_0x505e7e[_0x2739('0x30')],_0x566203[_0x2739('0x39')]),_0x412b3b);if(_0x505e7e[_0x2739('0x30')][_0x2739('0x3a')]){_0x44bc9d[_0x2739('0x3b')]=_[_0x2739('0x3c')](_0x44bc9d['where'],{'$or':_[_0x2739('0x29')](_0x412b3b,function(_0x21561c){if(_0x21561c[_0x2739('0x3d')]!==_0x2739('0x3e')){var _0x1d033a={};_0x1d033a[_0x21561c[_0x2739('0x2f')]]={'$like':'%'+_0x505e7e[_0x2739('0x30')][_0x2739('0x3a')]+'%'};return _0x1d033a;}})});}_0x44bc9d=_[_0x2739('0x3c')]({},_0x44bc9d,_0x505e7e[_0x2739('0x3f')]);var _0x4dc044={'where':_0x44bc9d[_0x2739('0x3b')]};return db[_0x2739('0x2a')][_0x2739('0x1f')](_0x4dc044)[_0x2739('0x25')](function(_0x260dd2){_0x781337[_0x2739('0x1f')]=_0x260dd2;if(_0x505e7e[_0x2739('0x30')][_0x2739('0x40')]){_0x44bc9d[_0x2739('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x2739('0x42')](_0x44bc9d);})['then'](function(_0x29cc1f){_0x781337[_0x2739('0x43')]=_0x29cc1f;return _0x781337;})[_0x2739('0x25')](respondWithFilteredResult(_0x1ce7b0,_0x44bc9d))[_0x2739('0x44')](handleError(_0x1ce7b0,null));};exports[_0x2739('0x45')]=function(_0x2cc8d5,_0x413af4){var _0x10d751={'raw':!![],'where':{'id':_0x2cc8d5[_0x2739('0x46')]['id']}},_0x52f46a={};_0x52f46a[_0x2739('0x2e')]=_[_0x2739('0x31')](db['SmsQueueReport'][_0x2739('0x2b')]);_0x52f46a[_0x2739('0x30')]=_[_0x2739('0x31')](_0x2cc8d5['query']);_0x52f46a[_0x2739('0x39')]=_[_0x2739('0x33')](_0x52f46a['model'],_0x52f46a[_0x2739('0x30')]);_0x10d751[_0x2739('0x32')]=_[_0x2739('0x33')](_0x52f46a['model'],qs['fields'](_0x2cc8d5[_0x2739('0x30')][_0x2739('0x34')]));_0x10d751[_0x2739('0x32')]=_0x10d751[_0x2739('0x32')][_0x2739('0x35')]?_0x10d751[_0x2739('0x32')]:_0x52f46a[_0x2739('0x2e')];if(_0x2cc8d5['query'][_0x2739('0x40')]){_0x10d751[_0x2739('0x41')]=[{'all':!![]}];}_0x10d751=_[_0x2739('0x3c')]({},_0x10d751,_0x2cc8d5[_0x2739('0x3f')]);return db[_0x2739('0x2a')][_0x2739('0x47')](_0x10d751)[_0x2739('0x25')](handleEntityNotFound(_0x413af4,null))[_0x2739('0x25')](respondWithResult(_0x413af4,null))['catch'](handleError(_0x413af4,null));};exports['create']=function(_0x34a39f,_0x1aec37){return db[_0x2739('0x2a')]['create'](_0x34a39f[_0x2739('0x48')],{})[_0x2739('0x25')](respondWithResult(_0x1aec37,0xc9))[_0x2739('0x44')](handleError(_0x1aec37,null));};exports[_0x2739('0x24')]=function(_0x3e34ce,_0x2a5e13){if(_0x3e34ce[_0x2739('0x48')]['id']){delete _0x3e34ce[_0x2739('0x48')]['id'];}return db[_0x2739('0x2a')][_0x2739('0x47')]({'where':{'id':_0x3e34ce[_0x2739('0x46')]['id']}})[_0x2739('0x25')](handleEntityNotFound(_0x2a5e13,null))[_0x2739('0x25')](saveUpdates(_0x3e34ce[_0x2739('0x48')],null))[_0x2739('0x25')](respondWithResult(_0x2a5e13,null))['catch'](handleError(_0x2a5e13,null));};exports['destroy']=function(_0x1bf6c8,_0xa12a23){return db[_0x2739('0x2a')][_0x2739('0x47')]({'where':{'id':_0x1bf6c8[_0x2739('0x46')]['id']}})[_0x2739('0x25')](handleEntityNotFound(_0xa12a23,null))['then'](removeEntity(_0xa12a23,null))[_0x2739('0x44')](handleError(_0xa12a23,null));};exports['describe']=function(_0x302793,_0x11d20d){return db['SmsQueueReport'][_0x2739('0x49')]()[_0x2739('0x25')](respondWithResult(_0x11d20d,null))[_0x2739('0x44')](handleError(_0x11d20d,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0e4265e..4bb1174 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_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':'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 f70550a..96d36c4 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 _0x0388=['info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSmsQueueReport','SmsQueueReport','create','body','options','catch','UpdateSmsQueueReport','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0388,0x1a0));var _0x8038=function(_0x55af21,_0x5ad23b){_0x55af21=_0x55af21-0x0;var _0x5bcc19=_0x0388[_0x55af21];return _0x5bcc19;};'use strict';var _=require('lodash');var util=require(_0x8038('0x0'));var moment=require(_0x8038('0x1'));var BPromise=require(_0x8038('0x2'));var rs=require(_0x8038('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8038('0x4'))['db'];var utils=require(_0x8038('0x5'));var logger=require(_0x8038('0x6'))(_0x8038('0x7'));var config=require(_0x8038('0x8'));var jayson=require(_0x8038('0x9'));var client=jayson['client'][_0x8038('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x295401,_0x48c9b1,_0x536202){return new BPromise(function(_0x310b42,_0x461686){return client[_0x8038('0xb')](_0x295401,_0x536202)[_0x8038('0xc')](function(_0x3b0cfb){logger[_0x8038('0xd')](_0x8038('0xe'),_0x48c9b1,_0x8038('0xf'));logger[_0x8038('0x10')](_0x8038('0x11'),_0x48c9b1,_0x8038('0xf'),JSON[_0x8038('0x12')](_0x3b0cfb));if(_0x3b0cfb[_0x8038('0x13')]){if(_0x3b0cfb['error'][_0x8038('0x14')]===0x1f4){logger[_0x8038('0x13')](_0x8038('0xe'),_0x48c9b1,_0x3b0cfb[_0x8038('0x13')][_0x8038('0x15')]);return _0x461686(_0x3b0cfb['error'][_0x8038('0x15')]);}logger['error'](_0x8038('0xe'),_0x48c9b1,_0x3b0cfb[_0x8038('0x13')][_0x8038('0x15')]);return _0x310b42(_0x3b0cfb[_0x8038('0x13')][_0x8038('0x15')]);}else{logger[_0x8038('0xd')](_0x8038('0xe'),_0x48c9b1,'request\x20sent');_0x310b42(_0x3b0cfb['result'][_0x8038('0x15')]);}})['catch'](function(_0x3b5015){logger[_0x8038('0x13')](_0x8038('0xe'),_0x48c9b1,_0x3b5015);_0x461686(_0x3b5015);});});}exports[_0x8038('0x16')]=function(_0x1906f2){var _0x313ce8=this;return new Promise(function(_0x2a9723,_0xefbecf){return db[_0x8038('0x17')][_0x8038('0x18')](_0x1906f2[_0x8038('0x19')],{'raw':_0x1906f2['options']?_0x1906f2[_0x8038('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8038('0xc')](function(_0xb87207){logger[_0x8038('0xd')](_0x8038('0x16'),_0x1906f2);logger[_0x8038('0x10')](_0x8038('0x16'),_0x1906f2,JSON[_0x8038('0x12')](_0xb87207));_0x2a9723(_0xb87207);})[_0x8038('0x1b')](function(_0x3ddf0f){logger[_0x8038('0x13')](_0x8038('0x16'),_0x3ddf0f['message'],_0x1906f2);_0xefbecf(_0x313ce8['error'](0x1f4,_0x3ddf0f[_0x8038('0x15')]));});});};exports[_0x8038('0x1c')]=function(_0x2e4594){var _0x110d16=this;return new Promise(function(_0xbd5ab0,_0x4b9867){return db[_0x8038('0x17')]['update'](_0x2e4594[_0x8038('0x19')],{'raw':_0x2e4594['options']?_0x2e4594['options'][_0x8038('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e4594['options']?_0x2e4594[_0x8038('0x1a')][_0x8038('0x1e')]||null:null,'attributes':_0x2e4594[_0x8038('0x1a')]?_0x2e4594[_0x8038('0x1a')][_0x8038('0x1f')]||null:null,'limit':_0x2e4594['options']?_0x2e4594[_0x8038('0x1a')][_0x8038('0x20')]||null:null})[_0x8038('0xc')](function(_0x4a176b){logger['info'](_0x8038('0x1c'),_0x2e4594);logger[_0x8038('0x10')]('UpdateSmsQueueReport',_0x2e4594,JSON['stringify'](_0x4a176b));_0xbd5ab0(_0x4a176b);})[_0x8038('0x1b')](function(_0x12e220){logger[_0x8038('0x13')]('UpdateSmsQueueReport',_0x12e220[_0x8038('0x15')],_0x2e4594);_0x4b9867(_0x110d16['error'](0x1f4,_0x12e220[_0x8038('0x15')]));});});}; \ No newline at end of file +var _0xa643=['request\x20sent','debug','stringify','error','code','message','info','SmsQueueReport','create','body','options','raw','then','CreateSmsQueueReport','catch','UpdateSmsQueueReport','update','where','attributes','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','SmsQueueReport,\x20%s,\x20%s'];(function(_0x2c0beb,_0x5d4ee1){var _0x279fee=function(_0x158e58){while(--_0x158e58){_0x2c0beb['push'](_0x2c0beb['shift']());}};_0x279fee(++_0x5d4ee1);}(_0xa643,0x12b));var _0x3a64=function(_0x3f0e5a,_0x52391a){_0x3f0e5a=_0x3f0e5a-0x0;var _0x1cbecb=_0xa643[_0x3f0e5a];return _0x1cbecb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3a64('0x0'));var rs=require(_0x3a64('0x1'));var fs=require('fs');var Redis=require(_0x3a64('0x2'));var db=require(_0x3a64('0x3'))['db'];var utils=require(_0x3a64('0x4'));var logger=require(_0x3a64('0x5'))('rpc');var config=require(_0x3a64('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3a64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x355a30,_0x24b126,_0xabc231){return new BPromise(function(_0xcf22,_0x2672e3){return client['request'](_0x355a30,_0xabc231)['then'](function(_0x1aabe2){logger['info'](_0x3a64('0x8'),_0x24b126,_0x3a64('0x9'));logger[_0x3a64('0xa')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x24b126,_0x3a64('0x9'),JSON[_0x3a64('0xb')](_0x1aabe2));if(_0x1aabe2[_0x3a64('0xc')]){if(_0x1aabe2[_0x3a64('0xc')][_0x3a64('0xd')]===0x1f4){logger[_0x3a64('0xc')](_0x3a64('0x8'),_0x24b126,_0x1aabe2[_0x3a64('0xc')]['message']);return _0x2672e3(_0x1aabe2[_0x3a64('0xc')]['message']);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x24b126,_0x1aabe2[_0x3a64('0xc')]['message']);return _0xcf22(_0x1aabe2[_0x3a64('0xc')][_0x3a64('0xe')]);}else{logger[_0x3a64('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x24b126,_0x3a64('0x9'));_0xcf22(_0x1aabe2['result'][_0x3a64('0xe')]);}})['catch'](function(_0x1e8c76){logger[_0x3a64('0xc')](_0x3a64('0x8'),_0x24b126,_0x1e8c76);_0x2672e3(_0x1e8c76);});});}exports['CreateSmsQueueReport']=function(_0x18e3c7){var _0x59da32=this;return new Promise(function(_0x511d26,_0x39ff22){return db[_0x3a64('0x10')][_0x3a64('0x11')](_0x18e3c7[_0x3a64('0x12')],{'raw':_0x18e3c7[_0x3a64('0x13')]?_0x18e3c7[_0x3a64('0x13')][_0x3a64('0x14')]===undefined?!![]:![]:!![]})[_0x3a64('0x15')](function(_0x1ed50f){logger['info']('CreateSmsQueueReport',_0x18e3c7);logger[_0x3a64('0xa')](_0x3a64('0x16'),_0x18e3c7,JSON['stringify'](_0x1ed50f));_0x511d26(_0x1ed50f);})[_0x3a64('0x17')](function(_0x2fa151){logger[_0x3a64('0xc')](_0x3a64('0x16'),_0x2fa151[_0x3a64('0xe')],_0x18e3c7);_0x39ff22(_0x59da32[_0x3a64('0xc')](0x1f4,_0x2fa151[_0x3a64('0xe')]));});});};exports[_0x3a64('0x18')]=function(_0x23438c){var _0x820356=this;return new Promise(function(_0x103a06,_0x25269e){return db['SmsQueueReport'][_0x3a64('0x19')](_0x23438c[_0x3a64('0x12')],{'raw':_0x23438c[_0x3a64('0x13')]?_0x23438c[_0x3a64('0x13')][_0x3a64('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23438c[_0x3a64('0x13')]?_0x23438c[_0x3a64('0x13')][_0x3a64('0x1a')]||null:null,'attributes':_0x23438c['options']?_0x23438c[_0x3a64('0x13')][_0x3a64('0x1b')]||null:null,'limit':_0x23438c['options']?_0x23438c[_0x3a64('0x13')]['limit']||null:null})['then'](function(_0x568652){logger[_0x3a64('0xf')](_0x3a64('0x18'),_0x23438c);logger[_0x3a64('0xa')](_0x3a64('0x18'),_0x23438c,JSON[_0x3a64('0xb')](_0x568652));_0x103a06(_0x568652);})[_0x3a64('0x17')](function(_0x418865){logger[_0x3a64('0xc')](_0x3a64('0x18'),_0x418865[_0x3a64('0xe')],_0x23438c);_0x25269e(_0x820356[_0x3a64('0xc')](0x1f4,_0x418865['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index a761815..23a5383 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 _0x4944=['fs-extra','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4944,0x6d));var _0x4494=function(_0x5f487c,_0x12c2cc){_0x5f487c=_0x5f487c-0x0;var _0x3d5ae2=_0x4944[_0x5f487c];return _0x3d5ae2;};'use strict';var multer=require(_0x4494('0x0'));var util=require('util');var path=require(_0x4494('0x1'));var timeout=require(_0x4494('0x2'));var express=require(_0x4494('0x3'));var router=express[_0x4494('0x4')]();var fs_extra=require(_0x4494('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4494('0x6'));var config=require('../../config/environment');var controller=require(_0x4494('0x7'));router[_0x4494('0x8')]('/',auth[_0x4494('0x9')](),controller[_0x4494('0xa')]);router[_0x4494('0x8')](_0x4494('0xb'),auth[_0x4494('0x9')](),controller[_0x4494('0xc')]);router[_0x4494('0x8')]('/:id',auth[_0x4494('0x9')](),controller[_0x4494('0xd')]);router[_0x4494('0xe')]('/',auth[_0x4494('0x9')](),controller['create']);router['put'](_0x4494('0xf'),auth[_0x4494('0x9')](),controller[_0x4494('0x10')]);router['delete']('/:id',auth[_0x4494('0x9')](),controller[_0x4494('0x11')]);module[_0x4494('0x12')]=router; \ No newline at end of file +var _0x2494=['express','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0xc2f22b,_0x246ce9){var _0x46fcf4=function(_0x2b6351){while(--_0x2b6351){_0xc2f22b['push'](_0xc2f22b['shift']());}};_0x46fcf4(++_0x246ce9);}(_0x2494,0x82));var _0x4249=function(_0xb0dd48,_0x52d10d){_0xb0dd48=_0xb0dd48-0x0;var _0x1ca339=_0x2494[_0xb0dd48];return _0x1ca339;};'use strict';var multer=require(_0x4249('0x0'));var util=require('util');var path=require(_0x4249('0x1'));var timeout=require(_0x4249('0x2'));var express=require(_0x4249('0x3'));var router=express[_0x4249('0x4')]();var fs_extra=require(_0x4249('0x5'));var auth=require(_0x4249('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4249('0x7'));router['get']('/',auth[_0x4249('0x8')](),controller[_0x4249('0x9')]);router[_0x4249('0xa')]('/describe',auth[_0x4249('0x8')](),controller[_0x4249('0xb')]);router[_0x4249('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4249('0xc')]);router[_0x4249('0xd')]('/',auth[_0x4249('0x8')](),controller[_0x4249('0xe')]);router[_0x4249('0xf')](_0x4249('0x10'),auth[_0x4249('0x8')](),controller['update']);router['delete'](_0x4249('0x10'),auth['isAuthenticated'](),controller[_0x4249('0x11')]);module[_0x4249('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 774bd05..b6b10dd 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x1b596f,_0x1d0814){var _0x48c840=function(_0x257118){while(--_0x257118){_0x1b596f['push'](_0x1b596f['shift']());}};_0x48c840(++_0x1d0814);}(_0x54ef,0x112));var _0xf54e=function(_0x4be765,_0x23c011){_0x4be765=_0x4be765-0x0;var _0x180456=_0x54ef[_0x4be765];return _0x180456;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x420aa4,_0x3f83fe){var _0x17d6e4=function(_0x2583af){while(--_0x2583af){_0x420aa4['push'](_0x420aa4['shift']());}};_0x17d6e4(++_0x3f83fe);}(_0x70e0,0x17b));var _0x070e=function(_0x1d0e98,_0x53a125){_0x1d0e98=_0x1d0e98-0x0;var _0xc90e77=_0x70e0[_0x1d0e98];return _0xc90e77;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7d9a8a9..97d2264 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 _0x30d5=['key','model','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','options','SmsTransferReport','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','error','name','send','map','fieldName','type'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x30d5,0xef));var _0x530d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x30d5[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x530d('0x0'));var rimraf=require(_0x530d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x530d('0x2'));var rp=require(_0x530d('0x3'));var moment=require('moment');var BPromise=require(_0x530d('0x4'));var Mustache=require('mustache');var util=require(_0x530d('0x5'));var path=require(_0x530d('0x6'));var sox=require(_0x530d('0x7'));var csv=require(_0x530d('0x8'));var ejs=require(_0x530d('0x9'));var fs=require('fs');var fs_extra=require(_0x530d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x530d('0xb'));var jsforce=require(_0x530d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x530d('0x8'));var querystring=require(_0x530d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x530d('0xe'));var qs=require(_0x530d('0xf'));var as=require(_0x530d('0x10'));var hardwareService=require(_0x530d('0x11'));var logger=require(_0x530d('0x12'))('api');var utils=require(_0x530d('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x530d('0x14'))['db'];function respondWithStatusCode(_0xcf2d1b,_0x290d6e){_0x290d6e=_0x290d6e||0xcc;return function(_0x1a674b){if(_0x1a674b){return _0xcf2d1b[_0x530d('0x15')](_0x290d6e);}return _0xcf2d1b[_0x530d('0x16')](_0x290d6e)[_0x530d('0x17')]();};}function respondWithResult(_0x26632e,_0x51bf95){_0x51bf95=_0x51bf95||0xc8;return function(_0xa41ccd){if(_0xa41ccd){return _0x26632e['status'](_0x51bf95)['json'](_0xa41ccd);}};}function respondWithFilteredResult(_0x488222,_0x3f3e2d){return function(_0x32ce5a){if(_0x32ce5a){var _0x2d037b=typeof _0x3f3e2d[_0x530d('0x18')]===_0x530d('0x19')&&typeof _0x3f3e2d['limit']===_0x530d('0x19');var _0xe3d191=_0x32ce5a[_0x530d('0x1a')];var _0x4dba36=_0x2d037b?0x0:_0x3f3e2d[_0x530d('0x18')];var _0x454494=_0x2d037b?_0x32ce5a[_0x530d('0x1a')]:_0x3f3e2d[_0x530d('0x18')]+_0x3f3e2d[_0x530d('0x1b')];var _0x1f4cc8;if(_0x454494>=_0xe3d191){_0x454494=_0xe3d191;_0x1f4cc8=0xc8;}else{_0x1f4cc8=0xce;}_0x488222['status'](_0x1f4cc8);return _0x488222[_0x530d('0x1c')](_0x530d('0x1d'),_0x4dba36+'-'+_0x454494+'/'+_0xe3d191)[_0x530d('0x1e')](_0x32ce5a);}return null;};}function patchUpdates(_0x27a3c8){return function(_0x55c10e){try{jsonpatch[_0x530d('0x1f')](_0x55c10e,_0x27a3c8,!![]);}catch(_0x329967){return BPromise[_0x530d('0x20')](_0x329967);}return _0x55c10e['save']();};}function saveUpdates(_0x2552fc,_0x39c7d4){return function(_0x13c08f){if(_0x13c08f){return _0x13c08f['update'](_0x2552fc)[_0x530d('0x21')](function(_0x5962a7){return _0x5962a7;});}return null;};}function removeEntity(_0x1811cc,_0x3d27de){return function(_0x4fbbb0){if(_0x4fbbb0){return _0x4fbbb0[_0x530d('0x22')]()[_0x530d('0x21')](function(){_0x1811cc['status'](0xcc)[_0x530d('0x17')]();});}};}function handleEntityNotFound(_0x3ad997,_0x374df5){return function(_0x152cac){if(!_0x152cac){_0x3ad997[_0x530d('0x15')](0x194);}return _0x152cac;};}function handleError(_0x5a88b6,_0x4528c7){_0x4528c7=_0x4528c7||0x1f4;return function(_0x5a7d2f){logger[_0x530d('0x23')](_0x5a7d2f['stack']);if(_0x5a7d2f[_0x530d('0x24')]){delete _0x5a7d2f['name'];}_0x5a88b6['status'](_0x4528c7)[_0x530d('0x25')](_0x5a7d2f);};}exports['index']=function(_0x503237,_0x3c7366){var _0x541a19={},_0x55711a={},_0x5ecac3={'count':0x0,'rows':[]};var _0x13f9ee=_[_0x530d('0x26')](db['SmsTransferReport']['rawAttributes'],function(_0x171d2e){return{'name':_0x171d2e[_0x530d('0x27')],'type':_0x171d2e[_0x530d('0x28')][_0x530d('0x29')]};});_0x55711a[_0x530d('0x2a')]=_[_0x530d('0x26')](_0x13f9ee,_0x530d('0x24'));_0x55711a[_0x530d('0x2b')]=_[_0x530d('0x2c')](_0x503237[_0x530d('0x2b')]);_0x55711a['filters']=_[_0x530d('0x2d')](_0x55711a['model'],_0x55711a[_0x530d('0x2b')]);_0x541a19[_0x530d('0x2e')]=_[_0x530d('0x2d')](_0x55711a[_0x530d('0x2a')],qs['fields'](_0x503237[_0x530d('0x2b')][_0x530d('0x2f')]));_0x541a19[_0x530d('0x2e')]=_0x541a19[_0x530d('0x2e')][_0x530d('0x30')]?_0x541a19['attributes']:_0x55711a[_0x530d('0x2a')];if(!_0x503237['query']['hasOwnProperty']('nolimit')){_0x541a19[_0x530d('0x1b')]=qs[_0x530d('0x1b')](_0x503237[_0x530d('0x2b')][_0x530d('0x1b')]);_0x541a19[_0x530d('0x18')]=qs[_0x530d('0x18')](_0x503237['query'][_0x530d('0x18')]);}_0x541a19['order']=qs[_0x530d('0x31')](_0x503237[_0x530d('0x2b')][_0x530d('0x31')]);_0x541a19[_0x530d('0x32')]=qs[_0x530d('0x33')](_[_0x530d('0x34')](_0x503237[_0x530d('0x2b')],_0x55711a[_0x530d('0x33')]),_0x13f9ee);if(_0x503237[_0x530d('0x2b')]['filter']){_0x541a19[_0x530d('0x32')]=_['merge'](_0x541a19[_0x530d('0x32')],{'$or':_[_0x530d('0x26')](_0x13f9ee,function(_0x302098){if(_0x302098['type']!=='VIRTUAL'){var _0x3f9d51={};_0x3f9d51[_0x302098[_0x530d('0x24')]]={'$like':'%'+_0x503237['query'][_0x530d('0x35')]+'%'};return _0x3f9d51;}})});}_0x541a19=_[_0x530d('0x36')]({},_0x541a19,_0x503237[_0x530d('0x37')]);var _0x3462d4={'where':_0x541a19[_0x530d('0x32')]};return db[_0x530d('0x38')][_0x530d('0x1a')](_0x3462d4)[_0x530d('0x21')](function(_0x183721){_0x5ecac3[_0x530d('0x1a')]=_0x183721;if(_0x503237[_0x530d('0x2b')][_0x530d('0x39')]){_0x541a19['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x530d('0x3a')](_0x541a19);})[_0x530d('0x21')](function(_0x37632b){_0x5ecac3[_0x530d('0x3b')]=_0x37632b;return _0x5ecac3;})[_0x530d('0x21')](respondWithFilteredResult(_0x3c7366,_0x541a19))[_0x530d('0x3c')](handleError(_0x3c7366,null));};exports[_0x530d('0x3d')]=function(_0x2fe401,_0x37f7ae){var _0x131d0d={'raw':!![],'where':{'id':_0x2fe401['params']['id']}},_0x39ca24={};_0x39ca24[_0x530d('0x2a')]=_[_0x530d('0x2c')](db[_0x530d('0x38')][_0x530d('0x3e')]);_0x39ca24[_0x530d('0x2b')]=_[_0x530d('0x2c')](_0x2fe401['query']);_0x39ca24[_0x530d('0x33')]=_[_0x530d('0x2d')](_0x39ca24[_0x530d('0x2a')],_0x39ca24['query']);_0x131d0d[_0x530d('0x2e')]=_['intersection'](_0x39ca24[_0x530d('0x2a')],qs[_0x530d('0x2f')](_0x2fe401[_0x530d('0x2b')][_0x530d('0x2f')]));_0x131d0d[_0x530d('0x2e')]=_0x131d0d['attributes'][_0x530d('0x30')]?_0x131d0d[_0x530d('0x2e')]:_0x39ca24[_0x530d('0x2a')];if(_0x2fe401[_0x530d('0x2b')][_0x530d('0x39')]){_0x131d0d[_0x530d('0x3f')]=[{'all':!![]}];}_0x131d0d=_[_0x530d('0x36')]({},_0x131d0d,_0x2fe401[_0x530d('0x37')]);return db[_0x530d('0x38')]['find'](_0x131d0d)[_0x530d('0x21')](handleEntityNotFound(_0x37f7ae,null))['then'](respondWithResult(_0x37f7ae,null))[_0x530d('0x3c')](handleError(_0x37f7ae,null));};exports[_0x530d('0x40')]=function(_0x36dfba,_0x11c10b){return db[_0x530d('0x38')][_0x530d('0x40')](_0x36dfba[_0x530d('0x41')],{})[_0x530d('0x21')](respondWithResult(_0x11c10b,0xc9))[_0x530d('0x3c')](handleError(_0x11c10b,null));};exports[_0x530d('0x42')]=function(_0x1bf54d,_0x25a6cc){if(_0x1bf54d['body']['id']){delete _0x1bf54d[_0x530d('0x41')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x1bf54d['params']['id']}})[_0x530d('0x21')](handleEntityNotFound(_0x25a6cc,null))[_0x530d('0x21')](saveUpdates(_0x1bf54d[_0x530d('0x41')],null))[_0x530d('0x21')](respondWithResult(_0x25a6cc,null))[_0x530d('0x3c')](handleError(_0x25a6cc,null));};exports[_0x530d('0x22')]=function(_0x399085,_0x2b9a42){return db[_0x530d('0x38')][_0x530d('0x43')]({'where':{'id':_0x399085[_0x530d('0x44')]['id']}})[_0x530d('0x21')](handleEntityNotFound(_0x2b9a42,null))['then'](removeEntity(_0x2b9a42,null))[_0x530d('0x3c')](handleError(_0x2b9a42,null));};exports['describe']=function(_0x3af8d8,_0x285a7a){return db['SmsTransferReport'][_0x530d('0x45')]()[_0x530d('0x21')](respondWithResult(_0x285a7a,null))[_0x530d('0x3c')](handleError(_0x285a7a,null));}; \ No newline at end of file +var _0xfef4=['count','Content-Range','save','update','then','destroy','end','stack','name','index','map','SmsTransferReport','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','rawAttributes','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','status','json','offset','undefined','limit'];(function(_0x2ba8cc,_0x2ccb6d){var _0x53b54c=function(_0x37042a){while(--_0x37042a){_0x2ba8cc['push'](_0x2ba8cc['shift']());}};_0x53b54c(++_0x2ccb6d);}(_0xfef4,0x141));var _0x4fef=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0xfef4[_0x173113];return _0x3bea89;};'use strict';var emlformat=require(_0x4fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4fef('0x1'));var jsonpatch=require(_0x4fef('0x2'));var rp=require('request-promise');var moment=require(_0x4fef('0x3'));var BPromise=require(_0x4fef('0x4'));var Mustache=require(_0x4fef('0x5'));var util=require(_0x4fef('0x6'));var path=require(_0x4fef('0x7'));var sox=require('sox');var csv=require(_0x4fef('0x8'));var ejs=require(_0x4fef('0x9'));var fs=require('fs');var fs_extra=require(_0x4fef('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4fef('0xb'));var deskjs=require(_0x4fef('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4fef('0xd'));var Papa=require(_0x4fef('0xe'));var Redis=require(_0x4fef('0xf'));var authService=require(_0x4fef('0x10'));var qs=require(_0x4fef('0x11'));var as=require(_0x4fef('0x12'));var hardwareService=require(_0x4fef('0x13'));var logger=require(_0x4fef('0x14'))(_0x4fef('0x15'));var utils=require('../../config/utils');var config=require(_0x4fef('0x16'));var licenseUtil=require(_0x4fef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbc3f2e,_0x50cb46){_0x50cb46=_0x50cb46||0xcc;return function(_0x78ed3d){if(_0x78ed3d){return _0xbc3f2e['sendStatus'](_0x50cb46);}return _0xbc3f2e[_0x4fef('0x18')](_0x50cb46)['end']();};}function respondWithResult(_0x1a6621,_0x4a4fdf){_0x4a4fdf=_0x4a4fdf||0xc8;return function(_0x484c7f){if(_0x484c7f){return _0x1a6621[_0x4fef('0x18')](_0x4a4fdf)[_0x4fef('0x19')](_0x484c7f);}};}function respondWithFilteredResult(_0xaa1f14,_0x38159c){return function(_0x5c66e9){if(_0x5c66e9){var _0x2b68df=typeof _0x38159c[_0x4fef('0x1a')]===_0x4fef('0x1b')&&typeof _0x38159c[_0x4fef('0x1c')]==='undefined';var _0x34ce55=_0x5c66e9[_0x4fef('0x1d')];var _0x2daaed=_0x2b68df?0x0:_0x38159c['offset'];var _0x84a584=_0x2b68df?_0x5c66e9[_0x4fef('0x1d')]:_0x38159c['offset']+_0x38159c[_0x4fef('0x1c')];var _0x43014c;if(_0x84a584>=_0x34ce55){_0x84a584=_0x34ce55;_0x43014c=0xc8;}else{_0x43014c=0xce;}_0xaa1f14[_0x4fef('0x18')](_0x43014c);return _0xaa1f14['set'](_0x4fef('0x1e'),_0x2daaed+'-'+_0x84a584+'/'+_0x34ce55)[_0x4fef('0x19')](_0x5c66e9);}return null;};}function patchUpdates(_0x17f49d){return function(_0x623f02){try{jsonpatch['apply'](_0x623f02,_0x17f49d,!![]);}catch(_0x1b951c){return BPromise['reject'](_0x1b951c);}return _0x623f02[_0x4fef('0x1f')]();};}function saveUpdates(_0x2d927e,_0x496370){return function(_0x1d5429){if(_0x1d5429){return _0x1d5429[_0x4fef('0x20')](_0x2d927e)[_0x4fef('0x21')](function(_0x4e483d){return _0x4e483d;});}return null;};}function removeEntity(_0x17c12e,_0x330e2d){return function(_0x51351f){if(_0x51351f){return _0x51351f[_0x4fef('0x22')]()[_0x4fef('0x21')](function(){_0x17c12e['status'](0xcc)[_0x4fef('0x23')]();});}};}function handleEntityNotFound(_0x4d6782,_0x2b7d36){return function(_0xb5edc8){if(!_0xb5edc8){_0x4d6782['sendStatus'](0x194);}return _0xb5edc8;};}function handleError(_0x474726,_0x27bfd7){_0x27bfd7=_0x27bfd7||0x1f4;return function(_0x290b62){logger['error'](_0x290b62[_0x4fef('0x24')]);if(_0x290b62['name']){delete _0x290b62[_0x4fef('0x25')];}_0x474726[_0x4fef('0x18')](_0x27bfd7)['send'](_0x290b62);};}exports[_0x4fef('0x26')]=function(_0x392bb4,_0x2202a8){var _0x3625ee={},_0x47643f={},_0x9e4404={'count':0x0,'rows':[]};var _0x596217=_[_0x4fef('0x27')](db[_0x4fef('0x28')]['rawAttributes'],function(_0x1f21d2){return{'name':_0x1f21d2[_0x4fef('0x29')],'type':_0x1f21d2['type'][_0x4fef('0x2a')]};});_0x47643f[_0x4fef('0x2b')]=_[_0x4fef('0x27')](_0x596217,_0x4fef('0x25'));_0x47643f[_0x4fef('0x2c')]=_[_0x4fef('0x2d')](_0x392bb4[_0x4fef('0x2c')]);_0x47643f['filters']=_['intersection'](_0x47643f[_0x4fef('0x2b')],_0x47643f[_0x4fef('0x2c')]);_0x3625ee[_0x4fef('0x2e')]=_[_0x4fef('0x2f')](_0x47643f[_0x4fef('0x2b')],qs['fields'](_0x392bb4[_0x4fef('0x2c')][_0x4fef('0x30')]));_0x3625ee['attributes']=_0x3625ee[_0x4fef('0x2e')][_0x4fef('0x31')]?_0x3625ee[_0x4fef('0x2e')]:_0x47643f[_0x4fef('0x2b')];if(!_0x392bb4[_0x4fef('0x2c')]['hasOwnProperty'](_0x4fef('0x32'))){_0x3625ee[_0x4fef('0x1c')]=qs['limit'](_0x392bb4[_0x4fef('0x2c')]['limit']);_0x3625ee[_0x4fef('0x1a')]=qs['offset'](_0x392bb4[_0x4fef('0x2c')][_0x4fef('0x1a')]);}_0x3625ee['order']=qs[_0x4fef('0x33')](_0x392bb4[_0x4fef('0x2c')][_0x4fef('0x33')]);_0x3625ee[_0x4fef('0x34')]=qs[_0x4fef('0x35')](_[_0x4fef('0x36')](_0x392bb4[_0x4fef('0x2c')],_0x47643f[_0x4fef('0x35')]),_0x596217);if(_0x392bb4[_0x4fef('0x2c')][_0x4fef('0x37')]){_0x3625ee['where']=_[_0x4fef('0x38')](_0x3625ee['where'],{'$or':_['map'](_0x596217,function(_0x41276a){if(_0x41276a[_0x4fef('0x39')]!==_0x4fef('0x3a')){var _0x30a60b={};_0x30a60b[_0x41276a['name']]={'$like':'%'+_0x392bb4[_0x4fef('0x2c')]['filter']+'%'};return _0x30a60b;}})});}_0x3625ee=_[_0x4fef('0x38')]({},_0x3625ee,_0x392bb4[_0x4fef('0x3b')]);var _0x1a7041={'where':_0x3625ee[_0x4fef('0x34')]};return db[_0x4fef('0x28')]['count'](_0x1a7041)[_0x4fef('0x21')](function(_0x42dce9){_0x9e4404['count']=_0x42dce9;if(_0x392bb4[_0x4fef('0x2c')][_0x4fef('0x3c')]){_0x3625ee['include']=[{'all':!![]}];}return db[_0x4fef('0x28')][_0x4fef('0x3d')](_0x3625ee);})[_0x4fef('0x21')](function(_0x46ea08){_0x9e4404['rows']=_0x46ea08;return _0x9e4404;})['then'](respondWithFilteredResult(_0x2202a8,_0x3625ee))[_0x4fef('0x3e')](handleError(_0x2202a8,null));};exports['show']=function(_0x3a54f8,_0x11275b){var _0x28e087={'raw':!![],'where':{'id':_0x3a54f8['params']['id']}},_0x454ffb={};_0x454ffb[_0x4fef('0x2b')]=_[_0x4fef('0x2d')](db[_0x4fef('0x28')][_0x4fef('0x3f')]);_0x454ffb[_0x4fef('0x2c')]=_['keys'](_0x3a54f8[_0x4fef('0x2c')]);_0x454ffb[_0x4fef('0x35')]=_['intersection'](_0x454ffb[_0x4fef('0x2b')],_0x454ffb[_0x4fef('0x2c')]);_0x28e087[_0x4fef('0x2e')]=_[_0x4fef('0x2f')](_0x454ffb['model'],qs[_0x4fef('0x30')](_0x3a54f8[_0x4fef('0x2c')][_0x4fef('0x30')]));_0x28e087[_0x4fef('0x2e')]=_0x28e087[_0x4fef('0x2e')][_0x4fef('0x31')]?_0x28e087['attributes']:_0x454ffb['model'];if(_0x3a54f8['query'][_0x4fef('0x3c')]){_0x28e087[_0x4fef('0x40')]=[{'all':!![]}];}_0x28e087=_[_0x4fef('0x38')]({},_0x28e087,_0x3a54f8[_0x4fef('0x3b')]);return db[_0x4fef('0x28')][_0x4fef('0x41')](_0x28e087)['then'](handleEntityNotFound(_0x11275b,null))[_0x4fef('0x21')](respondWithResult(_0x11275b,null))[_0x4fef('0x3e')](handleError(_0x11275b,null));};exports[_0x4fef('0x42')]=function(_0x1530ab,_0x378f0a){return db[_0x4fef('0x28')][_0x4fef('0x42')](_0x1530ab[_0x4fef('0x43')],{})[_0x4fef('0x21')](respondWithResult(_0x378f0a,0xc9))[_0x4fef('0x3e')](handleError(_0x378f0a,null));};exports['update']=function(_0x59b157,_0x4c1d85){if(_0x59b157[_0x4fef('0x43')]['id']){delete _0x59b157['body']['id'];}return db[_0x4fef('0x28')][_0x4fef('0x41')]({'where':{'id':_0x59b157[_0x4fef('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c1d85,null))[_0x4fef('0x21')](saveUpdates(_0x59b157[_0x4fef('0x43')],null))[_0x4fef('0x21')](respondWithResult(_0x4c1d85,null))[_0x4fef('0x3e')](handleError(_0x4c1d85,null));};exports[_0x4fef('0x22')]=function(_0x45e5a6,_0x87caf9){return db[_0x4fef('0x28')][_0x4fef('0x41')]({'where':{'id':_0x45e5a6[_0x4fef('0x44')]['id']}})[_0x4fef('0x21')](handleEntityNotFound(_0x87caf9,null))[_0x4fef('0x21')](removeEntity(_0x87caf9,null))[_0x4fef('0x3e')](handleError(_0x87caf9,null));};exports[_0x4fef('0x45')]=function(_0x5d95ec,_0x2f331d){return db[_0x4fef('0x28')]['describe']()['then'](respondWithResult(_0x2f331d,null))[_0x4fef('0x3e')](handleError(_0x2f331d,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 42a2959..94fd110 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 _0xa37e=['uniqueid','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsTransferReport.attributes','exports','define'];(function(_0x431364,_0x285a11){var _0x4d25d3=function(_0x31b293){while(--_0x31b293){_0x431364['push'](_0x431364['shift']());}};_0x4d25d3(++_0x285a11);}(_0xa37e,0x97));var _0xea37=function(_0x4a6ad0,_0x464794){_0x4a6ad0=_0x4a6ad0-0x0;var _0x37cc89=_0xa37e[_0x4a6ad0];return _0x37cc89;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea37('0x0'))(_0xea37('0x1'));var moment=require(_0xea37('0x2'));var BPromise=require(_0xea37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea37('0x4'));var rimraf=require('rimraf');var config=require(_0xea37('0x5'));var attributes=require(_0xea37('0x6'));module[_0xea37('0x7')]=function(_0x4d380b,_0x57135b){return _0x4d380b[_0xea37('0x8')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xea37('0x9'),'fields':[_0xea37('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f50=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','lodash','util','../../config/logger'];(function(_0x224b36,_0x23d709){var _0x56a569=function(_0x3e55e8){while(--_0x3e55e8){_0x224b36['push'](_0x224b36['shift']());}};_0x56a569(++_0x23d709);}(_0x0f50,0x1ce));var _0x00f5=function(_0x54c06a,_0x443b29){_0x54c06a=_0x54c06a-0x0;var _0x27d653=_0x0f50[_0x54c06a];return _0x27d653;};'use strict';var _=require(_0x00f5('0x0'));var util=require(_0x00f5('0x1'));var logger=require(_0x00f5('0x2'))(_0x00f5('0x3'));var moment=require(_0x00f5('0x4'));var BPromise=require(_0x00f5('0x5'));var rp=require(_0x00f5('0x6'));var fs=require('fs');var path=require(_0x00f5('0x7'));var rimraf=require(_0x00f5('0x8'));var config=require(_0x00f5('0x9'));var attributes=require(_0x00f5('0xa'));module[_0x00f5('0xb')]=function(_0x5427a1,_0x3d8c10){return _0x5427a1[_0x00f5('0xc')](_0x00f5('0xd'),attributes,{'tableName':_0x00f5('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b99561f..69b66a3 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 _0x7d9f=['../../config/environment','http','request','info','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x22d72b,_0x112e6d){var _0x35f65f=function(_0x23d67f){while(--_0x23d67f){_0x22d72b['push'](_0x22d72b['shift']());}};_0x35f65f(++_0x112e6d);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x141c05,_0x319076){_0x141c05=_0x141c05-0x0;var _0x25fa28=_0x7d9f[_0x141c05];return _0x25fa28;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var moment=require(_0xf7d9('0x2'));var BPromise=require(_0xf7d9('0x3'));var rs=require(_0xf7d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7d9('0x5'))['db'];var utils=require(_0xf7d9('0x6'));var logger=require(_0xf7d9('0x7'))(_0xf7d9('0x8'));var config=require(_0xf7d9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x250675,_0x5772b4,_0x21c654){return new BPromise(function(_0x1685a6,_0x5e4087){return client[_0xf7d9('0xb')](_0x250675,_0x21c654)['then'](function(_0x265548){logger[_0xf7d9('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x5772b4,'request\x20sent');logger[_0xf7d9('0xd')](_0xf7d9('0xe'),_0x5772b4,_0xf7d9('0xf'),JSON['stringify'](_0x265548));if(_0x265548['error']){if(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x11')]===0x1f4){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x265548['error'][_0xf7d9('0x13')]);return _0x5e4087(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}logger[_0xf7d9('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x5772b4,_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);return _0x1685a6(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}else{logger['info'](_0xf7d9('0x12'),_0x5772b4,_0xf7d9('0xf'));_0x1685a6(_0x265548[_0xf7d9('0x14')]['message']);}})['catch'](function(_0x35751e){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x35751e);_0x5e4087(_0x35751e);});});} \ No newline at end of file +var _0x943c=['stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0xf46f31,_0x4785da){var _0x49f7b9=function(_0x498c53){while(--_0x498c53){_0xf46f31['push'](_0xf46f31['shift']());}};_0x49f7b9(++_0x4785da);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc943('0x0'));var util=require(_0xc943('0x1'));var moment=require(_0xc943('0x2'));var BPromise=require(_0xc943('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc943('0x4'))['db'];var utils=require(_0xc943('0x5'));var logger=require(_0xc943('0x6'))('rpc');var config=require(_0xc943('0x7'));var jayson=require(_0xc943('0x8'));var client=jayson[_0xc943('0x9')][_0xc943('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b73ad,_0x4091fd,_0x3f718f){return new BPromise(function(_0x56e665,_0x3ec7da){return client[_0xc943('0xb')](_0x1b73ad,_0x3f718f)[_0xc943('0xc')](function(_0x455eed){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x4091fd,_0xc943('0xd'));logger[_0xc943('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x4091fd,'request\x20sent',JSON[_0xc943('0xf')](_0x455eed));if(_0x455eed[_0xc943('0x10')]){if(_0x455eed[_0xc943('0x10')][_0xc943('0x11')]===0x1f4){logger[_0xc943('0x10')](_0xc943('0x12'),_0x4091fd,_0x455eed['error'][_0xc943('0x13')]);return _0x3ec7da(_0x455eed[_0xc943('0x10')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4091fd,_0x455eed[_0xc943('0x10')][_0xc943('0x13')]);return _0x56e665(_0x455eed['error'][_0xc943('0x13')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x4091fd,_0xc943('0xd'));_0x56e665(_0x455eed['result'][_0xc943('0x13')]);}})[_0xc943('0x14')](function(_0x1eb50a){logger[_0xc943('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x4091fd,_0x1eb50a);_0x3ec7da(_0x1eb50a);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 6161699..90eb7ff 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 _0x963e=['fs-extra','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','download','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','single','file','create','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x4eaf7e,_0x2afb74){var _0x31cb6a=function(_0x1c4708){while(--_0x1c4708){_0x4eaf7e['push'](_0x4eaf7e['shift']());}};_0x31cb6a(++_0x2afb74);}(_0x963e,0x1ca));var _0xe963=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x963e[_0x4cd21c];return _0x5d8e5e;};'use strict';var multer=require(_0xe963('0x0'));var util=require(_0xe963('0x1'));var path=require(_0xe963('0x2'));var timeout=require(_0xe963('0x3'));var express=require(_0xe963('0x4'));var router=express[_0xe963('0x5')]();var fs_extra=require(_0xe963('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe963('0x7'));var controller=require(_0xe963('0x8'));router['get']('/',auth[_0xe963('0x9')](),controller[_0xe963('0xa')]);router[_0xe963('0xb')](_0xe963('0xc'),auth[_0xe963('0x9')](),controller[_0xe963('0xd')]);router['get']('/:id/download',auth[_0xe963('0x9')](),controller[_0xe963('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f4569,_0x161180,_0x5191d5){_0x5191d5(null,path['join'](config[_0xe963('0xf')],_0xe963('0x10')));},'filename':function(_0x27d4f2,_0xc2facf,_0x11d5e8){_0xc2facf[_0xe963('0x11')]=_0xc2facf[_0xe963('0x11')][_0xe963('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11d5e8(null,util[_0xe963('0x13')]('%s-%s%s',path[_0xe963('0x14')](_0xc2facf['originalname'],path[_0xe963('0x15')](_0xc2facf[_0xe963('0x11')])),Date[_0xe963('0x16')](),path['extname'](_0xc2facf['originalname'])));}})});router[_0xe963('0x17')]('/',upload[_0xe963('0x18')](_0xe963('0x19')),controller[_0xe963('0x1a')]);router['put'](_0xe963('0xc'),auth['isAuthenticated'](),controller[_0xe963('0x1b')]);router[_0xe963('0x1c')](_0xe963('0xc'),auth[_0xe963('0x9')](),controller[_0xe963('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x005c=['extname','now','post','file','create','put','update','/:id','delete','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/download','download','join','server/files/sounds/original/','originalname','replace','format','basename'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x005c,0x175));var _0xc005=function(_0x50c8d0,_0x2bd38e){_0x50c8d0=_0x50c8d0-0x0;var _0x3bddfc=_0x005c[_0x50c8d0];return _0x3bddfc;};'use strict';var multer=require(_0xc005('0x0'));var util=require('util');var path=require(_0xc005('0x1'));var timeout=require(_0xc005('0x2'));var express=require(_0xc005('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc005('0x4'));var interaction=require(_0xc005('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xc005('0x6')]('/',auth[_0xc005('0x7')](),controller[_0xc005('0x8')]);router[_0xc005('0x6')]('/:id',auth[_0xc005('0x7')](),controller['show']);router[_0xc005('0x6')](_0xc005('0x9'),auth[_0xc005('0x7')](),controller[_0xc005('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34752e,_0xbcb504,_0x593fdf){_0x593fdf(null,path[_0xc005('0xb')](config['root'],_0xc005('0xc')));},'filename':function(_0x391605,_0x28ee30,_0x23b615){_0x28ee30[_0xc005('0xd')]=_0x28ee30[_0xc005('0xd')][_0xc005('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23b615(null,util[_0xc005('0xf')]('%s-%s%s',path[_0xc005('0x10')](_0x28ee30[_0xc005('0xd')],path[_0xc005('0x11')](_0x28ee30['originalname'])),Date[_0xc005('0x12')](),path[_0xc005('0x11')](_0x28ee30['originalname'])));}})});router[_0xc005('0x13')]('/',upload['single'](_0xc005('0x14')),controller[_0xc005('0x15')]);router[_0xc005('0x16')]('/:id',auth[_0xc005('0x7')](),controller[_0xc005('0x17')]);router['delete'](_0xc005('0x18'),auth[_0xc005('0x7')](),controller[_0xc005('0x19')]);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 78be98a..5f17058 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 _0x1833=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x413208,_0x4c734d){var _0x360b0c=function(_0x4b78d5){while(--_0x4b78d5){_0x413208['push'](_0x413208['shift']());}};_0x360b0c(++_0x4c734d);}(_0x1833,0xed));var _0x3183=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x1833[_0x1f7201];return _0x289fd2;};'use strict';var Sequelize=require(_0x3183('0x0'));module[_0x3183('0x1')]={'name':{'type':Sequelize[_0x3183('0x2')],'unique':_0x3183('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x3183('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x3183('0x2')]},'original_duration':{'type':Sequelize[_0x3183('0x4')]},'original_sampleCount':{'type':Sequelize[_0x3183('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x3183('0x5')]},'original_sampleRate':{'type':Sequelize[_0x3183('0x6')]},'converted_format':{'type':Sequelize[_0x3183('0x2')]},'converted_duration':{'type':Sequelize[_0x3183('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x3183('0x5')]},'converted_channelCount':{'type':Sequelize[_0x3183('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3183('0x6')]}}; \ No newline at end of file +var _0x89ac=['FLOAT','INTEGER','BIGINT','name','STRING'];(function(_0x14289f,_0xc0b72b){var _0x52bb8f=function(_0xfa1ea2){while(--_0xfa1ea2){_0x14289f['push'](_0x14289f['shift']());}};_0x52bb8f(++_0xc0b72b);}(_0x89ac,0x111));var _0xc89a=function(_0x1623a3,_0xd41524){_0x1623a3=_0x1623a3-0x0;var _0x41ed31=_0x89ac[_0x1623a3];return _0x41ed31;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc89a('0x0'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xc89a('0x1')]},'original_format':{'type':Sequelize[_0xc89a('0x1')]},'original_duration':{'type':Sequelize[_0xc89a('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xc89a('0x3')]},'original_bitRate':{'type':Sequelize[_0xc89a('0x4')]},'original_sampleRate':{'type':Sequelize[_0xc89a('0x3')]},'converted_format':{'type':Sequelize[_0xc89a('0x1')]},'converted_duration':{'type':Sequelize[_0xc89a('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xc89a('0x4')]},'converted_channelCount':{'type':Sequelize[_0xc89a('0x3')]},'converted_bitRate':{'type':Sequelize[_0xc89a('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xc89a('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 98f8349..fa0bd7e 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 _0x18f3=['params','save_name','existsSync','root','server/files/sounds/converted','converted_format','ValidationError','download','join','format','%s.%s','basename','file','extname','filename','substring','info','Sound\x20upload\x20destination:\x20%s','wav','error','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','0777','create','body','role','userProfileId','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x4dd5c5,_0xcaa61e){var _0x516b90=function(_0x1d7238){while(--_0x1d7238){_0x4dd5c5['push'](_0x4dd5c5['shift']());}};_0x516b90(++_0xcaa61e);}(_0x18f3,0xac));var _0x318f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x18f3[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0x318f('0x0'));var rimraf=require(_0x318f('0x1'));var zipdir=require(_0x318f('0x2'));var jsonpatch=require(_0x318f('0x3'));var rp=require(_0x318f('0x4'));var moment=require(_0x318f('0x5'));var BPromise=require(_0x318f('0x6'));var Mustache=require('mustache');var util=require(_0x318f('0x7'));var path=require(_0x318f('0x8'));var sox=require(_0x318f('0x9'));var csv=require('to-csv');var ejs=require(_0x318f('0xa'));var fs=require('fs');var fs_extra=require(_0x318f('0xb'));var _=require(_0x318f('0xc'));var squel=require(_0x318f('0xd'));var crypto=require('crypto');var jsforce=require(_0x318f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x318f('0xf'));var querystring=require(_0x318f('0x10'));var Papa=require(_0x318f('0x11'));var Redis=require(_0x318f('0x12'));var authService=require(_0x318f('0x13'));var qs=require(_0x318f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x318f('0x15'));var logger=require(_0x318f('0x16'))(_0x318f('0x17'));var utils=require(_0x318f('0x18'));var config=require(_0x318f('0x19'));var licenseUtil=require(_0x318f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24e0e5,_0x35b849){_0x35b849=_0x35b849||0xcc;return function(_0x5aa8dc){if(_0x5aa8dc){return _0x24e0e5[_0x318f('0x1b')](_0x35b849);}return _0x24e0e5[_0x318f('0x1c')](_0x35b849)[_0x318f('0x1d')]();};}function respondWithResult(_0x12f70c,_0x19b571){_0x19b571=_0x19b571||0xc8;return function(_0x1901d9){if(_0x1901d9){return _0x12f70c['status'](_0x19b571)['json'](_0x1901d9);}};}function respondWithFilteredResult(_0xe25ad3,_0x57f404){return function(_0x440160){if(_0x440160){var _0x1a1b7a=typeof _0x57f404[_0x318f('0x1e')]==='undefined'&&typeof _0x57f404[_0x318f('0x1f')]==='undefined';var _0x13245d=_0x440160[_0x318f('0x20')];var _0x1c0041=_0x1a1b7a?0x0:_0x57f404[_0x318f('0x1e')];var _0x29eec5=_0x1a1b7a?_0x440160[_0x318f('0x20')]:_0x57f404['offset']+_0x57f404[_0x318f('0x1f')];var _0x5b40e2;if(_0x29eec5>=_0x13245d){_0x29eec5=_0x13245d;_0x5b40e2=0xc8;}else{_0x5b40e2=0xce;}_0xe25ad3['status'](_0x5b40e2);return _0xe25ad3[_0x318f('0x21')](_0x318f('0x22'),_0x1c0041+'-'+_0x29eec5+'/'+_0x13245d)['json'](_0x440160);}return null;};}function patchUpdates(_0x246a1e){return function(_0x2e25da){try{jsonpatch['apply'](_0x2e25da,_0x246a1e,!![]);}catch(_0x2c3c63){return BPromise[_0x318f('0x23')](_0x2c3c63);}return _0x2e25da[_0x318f('0x24')]();};}function saveUpdates(_0x583406,_0x27d4dd){return function(_0x407a81){if(_0x407a81){return _0x407a81[_0x318f('0x25')](_0x583406)[_0x318f('0x26')](function(_0x1435e4){return _0x1435e4;});}return null;};}function removeEntity(_0x2598ce,_0x1602bc){return function(_0x50c907){if(_0x50c907){return _0x50c907[_0x318f('0x27')]()[_0x318f('0x26')](function(){var _0x3cb53c=_0x50c907[_0x318f('0x28')]({'plain':!![]});var _0x159131=_0x318f('0x29');return db[_0x318f('0x2a')][_0x318f('0x27')]({'where':{'type':_0x159131,'resourceId':_0x3cb53c['id']}})[_0x318f('0x26')](function(){return _0x50c907;});})[_0x318f('0x26')](function(){_0x2598ce[_0x318f('0x1c')](0xcc)[_0x318f('0x1d')]();});}};}function handleEntityNotFound(_0x578fb5,_0x56efac){return function(_0x44419f){if(!_0x44419f){_0x578fb5['sendStatus'](0x194);}return _0x44419f;};}function handleError(_0xe757b9,_0x172fb3){_0x172fb3=_0x172fb3||0x1f4;return function(_0x2f8392){logger['error'](_0x2f8392[_0x318f('0x2b')]);if(_0x2f8392['name']){delete _0x2f8392[_0x318f('0x2c')];}_0xe757b9[_0x318f('0x1c')](_0x172fb3)[_0x318f('0x2d')](_0x2f8392);};}exports[_0x318f('0x2e')]=function(_0x29abc1,_0x514c50){var _0x3c4e60={},_0x1c14d3={},_0x12220a={'count':0x0,'rows':[]};var _0x1d5ca8=_[_0x318f('0x2f')](db[_0x318f('0x30')][_0x318f('0x31')],function(_0x3dde84){return{'name':_0x3dde84[_0x318f('0x32')],'type':_0x3dde84['type'][_0x318f('0x33')]};});_0x1c14d3['model']=_[_0x318f('0x2f')](_0x1d5ca8,'name');_0x1c14d3[_0x318f('0x34')]=_[_0x318f('0x35')](_0x29abc1[_0x318f('0x34')]);_0x1c14d3['filters']=_[_0x318f('0x36')](_0x1c14d3[_0x318f('0x37')],_0x1c14d3[_0x318f('0x34')]);_0x3c4e60[_0x318f('0x38')]=_[_0x318f('0x36')](_0x1c14d3[_0x318f('0x37')],qs['fields'](_0x29abc1['query'][_0x318f('0x39')]));_0x3c4e60['attributes']=_0x3c4e60[_0x318f('0x38')][_0x318f('0x3a')]?_0x3c4e60[_0x318f('0x38')]:_0x1c14d3[_0x318f('0x37')];if(!_0x29abc1[_0x318f('0x34')][_0x318f('0x3b')]('nolimit')){_0x3c4e60[_0x318f('0x1f')]=qs[_0x318f('0x1f')](_0x29abc1[_0x318f('0x34')]['limit']);_0x3c4e60[_0x318f('0x1e')]=qs[_0x318f('0x1e')](_0x29abc1[_0x318f('0x34')]['offset']);}_0x3c4e60[_0x318f('0x3c')]=qs[_0x318f('0x3d')](_0x29abc1[_0x318f('0x34')][_0x318f('0x3d')]);_0x3c4e60[_0x318f('0x3e')]=qs[_0x318f('0x3f')](_[_0x318f('0x40')](_0x29abc1[_0x318f('0x34')],_0x1c14d3['filters']),_0x1d5ca8);if(_0x29abc1['query']['filter']){_0x3c4e60[_0x318f('0x3e')]=_[_0x318f('0x41')](_0x3c4e60[_0x318f('0x3e')],{'$or':_[_0x318f('0x2f')](_0x1d5ca8,function(_0xd26519){if(_0xd26519[_0x318f('0x42')]!=='VIRTUAL'){var _0x59b67d={};_0x59b67d[_0xd26519[_0x318f('0x2c')]]={'$like':'%'+_0x29abc1[_0x318f('0x34')][_0x318f('0x43')]+'%'};return _0x59b67d;}})});}_0x3c4e60=_[_0x318f('0x41')]({},_0x3c4e60,_0x29abc1[_0x318f('0x44')]);var _0x43f024={'where':_0x3c4e60[_0x318f('0x3e')]};return db[_0x318f('0x30')][_0x318f('0x20')](_0x43f024)[_0x318f('0x26')](function(_0x42bd21){_0x12220a[_0x318f('0x20')]=_0x42bd21;if(_0x29abc1[_0x318f('0x34')][_0x318f('0x45')]){_0x3c4e60[_0x318f('0x46')]=[{'all':!![]}];}return db['Sound'][_0x318f('0x47')](_0x3c4e60);})[_0x318f('0x26')](function(_0x5ccc78){_0x12220a[_0x318f('0x48')]=_0x5ccc78;return _0x12220a;})[_0x318f('0x26')](respondWithFilteredResult(_0x514c50,_0x3c4e60))[_0x318f('0x49')](handleError(_0x514c50,null));};exports[_0x318f('0x4a')]=function(_0x1472c0,_0x458af3){var _0x107312={'raw':!![],'where':{'id':_0x1472c0['params']['id']}},_0x486960={};_0x486960[_0x318f('0x37')]=_[_0x318f('0x35')](db['Sound']['rawAttributes']);_0x486960['query']=_['keys'](_0x1472c0[_0x318f('0x34')]);_0x486960[_0x318f('0x3f')]=_['intersection'](_0x486960[_0x318f('0x37')],_0x486960[_0x318f('0x34')]);_0x107312[_0x318f('0x38')]=_[_0x318f('0x36')](_0x486960[_0x318f('0x37')],qs['fields'](_0x1472c0[_0x318f('0x34')][_0x318f('0x39')]));_0x107312['attributes']=_0x107312[_0x318f('0x38')]['length']?_0x107312['attributes']:_0x486960[_0x318f('0x37')];if(_0x1472c0['query']['includeAll']){_0x107312[_0x318f('0x46')]=[{'all':!![]}];}_0x107312=_[_0x318f('0x41')]({},_0x107312,_0x1472c0[_0x318f('0x44')]);return db[_0x318f('0x30')][_0x318f('0x4b')](_0x107312)[_0x318f('0x26')](handleEntityNotFound(_0x458af3,null))['then'](respondWithResult(_0x458af3,null))['catch'](handleError(_0x458af3,null));};exports['download']=function(_0x46a143,_0x10364c,_0x3e146b){return db[_0x318f('0x30')][_0x318f('0x4b')]({'where':{'id':_0x46a143[_0x318f('0x4c')]['id']},'attributes':[_0x318f('0x2c'),_0x318f('0x4d'),'converted_format'],'raw':!![]})[_0x318f('0x26')](handleEntityNotFound(_0x10364c,null))[_0x318f('0x26')](function(_0x24e856){if(_0x24e856){if(!fs[_0x318f('0x4e')](path['join'](config[_0x318f('0x4f')],_0x318f('0x50'),_0x24e856['save_name']+'.'+_0x24e856[_0x318f('0x51')]))){throw new db['Sequelize'][(_0x318f('0x52'))]('Sound\x20not\x20found');}return _0x10364c[_0x318f('0x53')](path[_0x318f('0x54')](config[_0x318f('0x4f')],_0x318f('0x50'),util[_0x318f('0x55')]('%s.%s',_0x24e856['save_name'],_0x24e856[_0x318f('0x51')])),util[_0x318f('0x55')](_0x318f('0x56'),_0x24e856[_0x318f('0x2c')],_0x24e856[_0x318f('0x51')]));}return null;})[_0x318f('0x49')](handleError(_0x10364c,null));};exports['create']=function(_0x37eab4,_0xa9541d,_0x5d3631){var _0x410bfa={'name':path[_0x318f('0x57')](_0x37eab4[_0x318f('0x58')]['originalname'],path[_0x318f('0x59')](_0x37eab4['file']['originalname'])),'save_name':path[_0x318f('0x57')](_0x37eab4['file'][_0x318f('0x5a')],path[_0x318f('0x59')](_0x37eab4[_0x318f('0x58')][_0x318f('0x5a')])),'original_format':path[_0x318f('0x59')](_0x37eab4[_0x318f('0x58')]['originalname'])[_0x318f('0x5b')](0x1),'converted_format':'wav'};var _0x5e47df=path[_0x318f('0x54')](config[_0x318f('0x4f')],'server/files/sounds/original',_0x37eab4['file'][_0x318f('0x5a')]);var _0x1dd885=path[_0x318f('0x54')](config[_0x318f('0x4f')],_0x318f('0x50'),util[_0x318f('0x55')](_0x318f('0x56'),path[_0x318f('0x57')](_0x37eab4[_0x318f('0x58')][_0x318f('0x5a')],path[_0x318f('0x59')](_0x37eab4[_0x318f('0x58')][_0x318f('0x5a')])),_0x410bfa['converted_format']));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x5e47df);logger[_0x318f('0x5c')](_0x318f('0x5d'),_0x1dd885);try{fs['chmodSync'](_0x5e47df,parseInt('0777',0x8));var _0xab01b1=sox['transcode'](_0x5e47df,_0x1dd885,{'sampleRate':0x1f40,'format':_0x318f('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xab01b1['on'](_0x318f('0x5f'),function(_0x3fd873){fs[_0x318f('0x60')](_0x5e47df);_0xa9541d[_0x318f('0x1c')](0x1f4)[_0x318f('0x2d')](_0x3fd873);});_0xab01b1['on'](_0x318f('0x61'),function(_0x549daa){_0x410bfa['original_duration']=isNaN(_0x549daa[_0x318f('0x62')])?null:_0x549daa[_0x318f('0x62')]*0x3e8;_0x410bfa[_0x318f('0x63')]=isNaN(_0x549daa[_0x318f('0x64')])?null:_0x549daa[_0x318f('0x64')];_0x410bfa[_0x318f('0x65')]=isNaN(_0x549daa['channelCount'])?null:_0x549daa[_0x318f('0x66')];_0x410bfa[_0x318f('0x67')]=isNaN(_0x549daa[_0x318f('0x68')])?null:_0x549daa[_0x318f('0x68')];_0x410bfa[_0x318f('0x69')]=isNaN(_0x549daa['sampleRate'])?null:_0x549daa[_0x318f('0x6a')];});_0xab01b1['on'](_0x318f('0x6b'),function(_0x59f580){_0x410bfa[_0x318f('0x6c')]=isNaN(_0x59f580[_0x318f('0x62')])?null:_0x59f580[_0x318f('0x62')]*0x3e8;_0x410bfa[_0x318f('0x6d')]=isNaN(_0x59f580['sampleCount'])?null:_0x59f580['sampleCount'];_0x410bfa[_0x318f('0x6e')]=isNaN(_0x59f580[_0x318f('0x66')])?null:_0x59f580[_0x318f('0x66')];_0x410bfa[_0x318f('0x6f')]=isNaN(_0x59f580[_0x318f('0x68')])?null:_0x59f580[_0x318f('0x68')];_0x410bfa['converted_sampleRate']=isNaN(_0x59f580[_0x318f('0x6a')])?null:_0x59f580[_0x318f('0x6a')];});_0xab01b1['on'](_0x318f('0x1d'),function(){fs[_0x318f('0x70')](_0x1dd885,parseInt(_0x318f('0x71'),0x8));return db[_0x318f('0x30')][_0x318f('0x72')](_0x410bfa)[_0x318f('0x26')](function(_0x13d24b){var _0xe6519={'role':_0x37eab4[_0x318f('0x73')][_0x318f('0x74')],'userProfileId':_0x37eab4[_0x318f('0x73')][_0x318f('0x75')]};if(!_0xe6519)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe6519[_0x318f('0x74')]===_0x318f('0x76')){var _0x59da05=_0x13d24b[_0x318f('0x28')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Sounds','userProfileId':_0xe6519[_0x318f('0x75')]},'raw':!![]})[_0x318f('0x26')](function(_0x2d8562){if(_0x2d8562&&_0x2d8562[_0x318f('0x77')]===0x0){return db['UserProfileResource'][_0x318f('0x72')]({'name':_0x59da05[_0x318f('0x2c')],'resourceId':_0x59da05['id'],'type':_0x2d8562['name'],'sectionId':_0x2d8562['id']},{})[_0x318f('0x26')](function(){return _0x13d24b;});}else{return _0x13d24b;}})[_0x318f('0x49')](function(_0x44500e){logger[_0x318f('0x5f')](_0x318f('0x78'),_0x44500e);throw _0x44500e;});}return _0x13d24b;})[_0x318f('0x26')](respondWithResult(_0xa9541d,null))[_0x318f('0x49')](handleError(_0xa9541d,null));});_0xab01b1[_0x318f('0x79')]();}catch(_0x1f79ec){_0xa9541d[_0x318f('0x1c')](0x1f4)[_0x318f('0x2d')](_0x1f79ec);}};exports['update']=function(_0x3449de,_0x22095c,_0x4d6026){return db[_0x318f('0x30')]['find']({'where':{'id':_0x3449de[_0x318f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x22095c,null))[_0x318f('0x26')](saveUpdates(_[_0x318f('0x40')](_0x3449de[_0x318f('0x73')],['name','description']),null))[_0x318f('0x26')](respondWithResult(_0x22095c,null))[_0x318f('0x49')](handleError(_0x22095c,null));};exports[_0x318f('0x7a')]=function(_0x3c4ade,_0x2e81ea,_0x39bbd8){return db['Sound'][_0x318f('0x4b')]({'where':{'id':_0x3c4ade[_0x318f('0x4c')]['id']}})[_0x318f('0x26')](function(_0x4a5161){if(_0x4a5161){return _0x4a5161[_0x318f('0x27')]();}})[_0x318f('0x26')](function(_0x2232d9){var _0x5ab5bb=path[_0x318f('0x54')](config['root'],'server/files/sounds/original',util['format'](_0x318f('0x56'),_0x2232d9['save_name'],_0x2232d9[_0x318f('0x7b')]));var _0x19468f=path['join'](config['root'],_0x318f('0x50'),util[_0x318f('0x55')]('%s.%s',_0x2232d9[_0x318f('0x4d')],_0x2232d9[_0x318f('0x51')]));fs[_0x318f('0x60')](_0x5ab5bb);fs[_0x318f('0x60')](_0x19468f);return _0x2232d9;})[_0x318f('0x26')](function(_0x4f9906){if(_0x4f9906){return _0x2e81ea[_0x318f('0x1c')](0xcc)[_0x318f('0x1d')]();}})[_0x318f('0x26')](handleEntityNotFound(_0x2e81ea,null))['catch'](handleError(_0x2e81ea,null));}; \ No newline at end of file +var _0x99a7=['info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','format','original_format','save_name','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','limit','undefined','status','json','apply','reject','save','then','destroy','get','Sounds','sendStatus','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Sound','count','includeAll','include','rows','catch','show','params','download','find','existsSync','root','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','%s.%s','create','basename','extname','file','filename','substring','wav','server/files/sounds/original','join'];(function(_0x5a433c,_0x423be6){var _0x310003=function(_0x293dc2){while(--_0x293dc2){_0x5a433c['push'](_0x5a433c['shift']());}};_0x310003(++_0x423be6);}(_0x99a7,0xa0));var _0x799a=function(_0x5df061,_0x400a05){_0x5df061=_0x5df061-0x0;var _0x5a4ef6=_0x99a7[_0x5df061];return _0x5a4ef6;};'use strict';var emlformat=require(_0x799a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x799a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x799a('0x2'));var moment=require(_0x799a('0x3'));var BPromise=require(_0x799a('0x4'));var Mustache=require(_0x799a('0x5'));var util=require('util');var path=require(_0x799a('0x6'));var sox=require(_0x799a('0x7'));var csv=require(_0x799a('0x8'));var ejs=require(_0x799a('0x9'));var fs=require('fs');var fs_extra=require(_0x799a('0xa'));var _=require(_0x799a('0xb'));var squel=require(_0x799a('0xc'));var crypto=require(_0x799a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x799a('0xe'));var toCsv=require(_0x799a('0x8'));var querystring=require(_0x799a('0xf'));var Papa=require('papaparse');var Redis=require(_0x799a('0x10'));var authService=require(_0x799a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x799a('0x12'));var hardwareService=require(_0x799a('0x13'));var logger=require('../../config/logger')(_0x799a('0x14'));var utils=require(_0x799a('0x15'));var config=require(_0x799a('0x16'));var licenseUtil=require(_0x799a('0x17'));var db=require(_0x799a('0x18'))['db'];function respondWithStatusCode(_0xeaa722,_0x37cf6e){_0x37cf6e=_0x37cf6e||0xcc;return function(_0xad009c){if(_0xad009c){return _0xeaa722['sendStatus'](_0x37cf6e);}return _0xeaa722['status'](_0x37cf6e)[_0x799a('0x19')]();};}function respondWithResult(_0x34e61f,_0x4569a3){_0x4569a3=_0x4569a3||0xc8;return function(_0x3b8739){if(_0x3b8739){return _0x34e61f['status'](_0x4569a3)['json'](_0x3b8739);}};}function respondWithFilteredResult(_0x4ae711,_0x1917d5){return function(_0x159516){if(_0x159516){var _0x56560b=typeof _0x1917d5[_0x799a('0x1a')]==='undefined'&&typeof _0x1917d5[_0x799a('0x1b')]===_0x799a('0x1c');var _0x4ed3bb=_0x159516['count'];var _0x4748df=_0x56560b?0x0:_0x1917d5['offset'];var _0x5e063a=_0x56560b?_0x159516['count']:_0x1917d5[_0x799a('0x1a')]+_0x1917d5[_0x799a('0x1b')];var _0xdac7e3;if(_0x5e063a>=_0x4ed3bb){_0x5e063a=_0x4ed3bb;_0xdac7e3=0xc8;}else{_0xdac7e3=0xce;}_0x4ae711[_0x799a('0x1d')](_0xdac7e3);return _0x4ae711['set']('Content-Range',_0x4748df+'-'+_0x5e063a+'/'+_0x4ed3bb)[_0x799a('0x1e')](_0x159516);}return null;};}function patchUpdates(_0x3c911b){return function(_0x360291){try{jsonpatch[_0x799a('0x1f')](_0x360291,_0x3c911b,!![]);}catch(_0x2f8c7a){return BPromise[_0x799a('0x20')](_0x2f8c7a);}return _0x360291[_0x799a('0x21')]();};}function saveUpdates(_0x916c6,_0x52cf73){return function(_0x481a2e){if(_0x481a2e){return _0x481a2e['update'](_0x916c6)[_0x799a('0x22')](function(_0x32013b){return _0x32013b;});}return null;};}function removeEntity(_0x41c48c,_0x302a13){return function(_0x5981e3){if(_0x5981e3){return _0x5981e3[_0x799a('0x23')]()[_0x799a('0x22')](function(){var _0x48df04=_0x5981e3[_0x799a('0x24')]({'plain':!![]});var _0x1756a1=_0x799a('0x25');return db['UserProfileResource'][_0x799a('0x23')]({'where':{'type':_0x1756a1,'resourceId':_0x48df04['id']}})[_0x799a('0x22')](function(){return _0x5981e3;});})[_0x799a('0x22')](function(){_0x41c48c['status'](0xcc)[_0x799a('0x19')]();});}};}function handleEntityNotFound(_0x2caf68,_0x249e7e){return function(_0x1bd71b){if(!_0x1bd71b){_0x2caf68[_0x799a('0x26')](0x194);}return _0x1bd71b;};}function handleError(_0xecedf8,_0x12948e){_0x12948e=_0x12948e||0x1f4;return function(_0x4ef259){logger[_0x799a('0x27')](_0x4ef259['stack']);if(_0x4ef259[_0x799a('0x28')]){delete _0x4ef259[_0x799a('0x28')];}_0xecedf8[_0x799a('0x1d')](_0x12948e)[_0x799a('0x29')](_0x4ef259);};}exports[_0x799a('0x2a')]=function(_0x84e899,_0x5ecfcc){var _0x1dd2ca={},_0x3c8316={},_0x2ef95a={'count':0x0,'rows':[]};var _0x21fedf=_[_0x799a('0x2b')](db['Sound']['rawAttributes'],function(_0x4f6417){return{'name':_0x4f6417[_0x799a('0x2c')],'type':_0x4f6417[_0x799a('0x2d')][_0x799a('0x2e')]};});_0x3c8316['model']=_[_0x799a('0x2b')](_0x21fedf,_0x799a('0x28'));_0x3c8316[_0x799a('0x2f')]=_[_0x799a('0x30')](_0x84e899[_0x799a('0x2f')]);_0x3c8316[_0x799a('0x31')]=_[_0x799a('0x32')](_0x3c8316[_0x799a('0x33')],_0x3c8316[_0x799a('0x2f')]);_0x1dd2ca['attributes']=_['intersection'](_0x3c8316[_0x799a('0x33')],qs['fields'](_0x84e899['query'][_0x799a('0x34')]));_0x1dd2ca[_0x799a('0x35')]=_0x1dd2ca['attributes'][_0x799a('0x36')]?_0x1dd2ca[_0x799a('0x35')]:_0x3c8316[_0x799a('0x33')];if(!_0x84e899[_0x799a('0x2f')]['hasOwnProperty'](_0x799a('0x37'))){_0x1dd2ca[_0x799a('0x1b')]=qs[_0x799a('0x1b')](_0x84e899[_0x799a('0x2f')][_0x799a('0x1b')]);_0x1dd2ca['offset']=qs[_0x799a('0x1a')](_0x84e899['query']['offset']);}_0x1dd2ca['order']=qs[_0x799a('0x38')](_0x84e899['query'][_0x799a('0x38')]);_0x1dd2ca[_0x799a('0x39')]=qs[_0x799a('0x31')](_[_0x799a('0x3a')](_0x84e899[_0x799a('0x2f')],_0x3c8316['filters']),_0x21fedf);if(_0x84e899['query'][_0x799a('0x3b')]){_0x1dd2ca[_0x799a('0x39')]=_['merge'](_0x1dd2ca[_0x799a('0x39')],{'$or':_[_0x799a('0x2b')](_0x21fedf,function(_0x3cf171){if(_0x3cf171[_0x799a('0x2d')]!==_0x799a('0x3c')){var _0x3df801={};_0x3df801[_0x3cf171[_0x799a('0x28')]]={'$like':'%'+_0x84e899[_0x799a('0x2f')][_0x799a('0x3b')]+'%'};return _0x3df801;}})});}_0x1dd2ca=_[_0x799a('0x3d')]({},_0x1dd2ca,_0x84e899[_0x799a('0x3e')]);var _0xf36227={'where':_0x1dd2ca[_0x799a('0x39')]};return db[_0x799a('0x3f')][_0x799a('0x40')](_0xf36227)[_0x799a('0x22')](function(_0x174921){_0x2ef95a[_0x799a('0x40')]=_0x174921;if(_0x84e899[_0x799a('0x2f')][_0x799a('0x41')]){_0x1dd2ca[_0x799a('0x42')]=[{'all':!![]}];}return db[_0x799a('0x3f')]['findAll'](_0x1dd2ca);})[_0x799a('0x22')](function(_0x35df0b){_0x2ef95a[_0x799a('0x43')]=_0x35df0b;return _0x2ef95a;})[_0x799a('0x22')](respondWithFilteredResult(_0x5ecfcc,_0x1dd2ca))[_0x799a('0x44')](handleError(_0x5ecfcc,null));};exports[_0x799a('0x45')]=function(_0x246f87,_0x4f5f7a){var _0x1f38ee={'raw':!![],'where':{'id':_0x246f87[_0x799a('0x46')]['id']}},_0x2345d8={};_0x2345d8['model']=_['keys'](db[_0x799a('0x3f')]['rawAttributes']);_0x2345d8[_0x799a('0x2f')]=_[_0x799a('0x30')](_0x246f87['query']);_0x2345d8[_0x799a('0x31')]=_['intersection'](_0x2345d8[_0x799a('0x33')],_0x2345d8[_0x799a('0x2f')]);_0x1f38ee['attributes']=_[_0x799a('0x32')](_0x2345d8[_0x799a('0x33')],qs[_0x799a('0x34')](_0x246f87['query'][_0x799a('0x34')]));_0x1f38ee[_0x799a('0x35')]=_0x1f38ee[_0x799a('0x35')][_0x799a('0x36')]?_0x1f38ee[_0x799a('0x35')]:_0x2345d8[_0x799a('0x33')];if(_0x246f87[_0x799a('0x2f')][_0x799a('0x41')]){_0x1f38ee['include']=[{'all':!![]}];}_0x1f38ee=_[_0x799a('0x3d')]({},_0x1f38ee,_0x246f87[_0x799a('0x3e')]);return db[_0x799a('0x3f')]['find'](_0x1f38ee)[_0x799a('0x22')](handleEntityNotFound(_0x4f5f7a,null))[_0x799a('0x22')](respondWithResult(_0x4f5f7a,null))['catch'](handleError(_0x4f5f7a,null));};exports[_0x799a('0x47')]=function(_0x40f2a0,_0xcbebcb,_0x74a132){return db[_0x799a('0x3f')][_0x799a('0x48')]({'where':{'id':_0x40f2a0['params']['id']},'attributes':['name','save_name','converted_format'],'raw':!![]})[_0x799a('0x22')](handleEntityNotFound(_0xcbebcb,null))[_0x799a('0x22')](function(_0x4bf83a){if(_0x4bf83a){if(!fs[_0x799a('0x49')](path['join'](config[_0x799a('0x4a')],'server/files/sounds/converted',_0x4bf83a['save_name']+'.'+_0x4bf83a[_0x799a('0x4b')]))){throw new db[(_0x799a('0x4c'))][(_0x799a('0x4d'))](_0x799a('0x4e'));}return _0xcbebcb[_0x799a('0x47')](path['join'](config[_0x799a('0x4a')],_0x799a('0x4f'),util['format'](_0x799a('0x50'),_0x4bf83a['save_name'],_0x4bf83a[_0x799a('0x4b')])),util['format'](_0x799a('0x50'),_0x4bf83a[_0x799a('0x28')],_0x4bf83a['converted_format']));}return null;})['catch'](handleError(_0xcbebcb,null));};exports[_0x799a('0x51')]=function(_0x42eb7f,_0x25d7e2,_0x5f40b3){var _0x36fcc={'name':path[_0x799a('0x52')](_0x42eb7f['file']['originalname'],path[_0x799a('0x53')](_0x42eb7f['file']['originalname'])),'save_name':path['basename'](_0x42eb7f[_0x799a('0x54')][_0x799a('0x55')],path['extname'](_0x42eb7f[_0x799a('0x54')]['filename'])),'original_format':path['extname'](_0x42eb7f[_0x799a('0x54')]['originalname'])[_0x799a('0x56')](0x1),'converted_format':_0x799a('0x57')};var _0x2d7861=path['join'](config[_0x799a('0x4a')],_0x799a('0x58'),_0x42eb7f[_0x799a('0x54')]['filename']);var _0x53c5b5=path[_0x799a('0x59')](config[_0x799a('0x4a')],_0x799a('0x4f'),util['format']('%s.%s',path[_0x799a('0x52')](_0x42eb7f[_0x799a('0x54')][_0x799a('0x55')],path['extname'](_0x42eb7f[_0x799a('0x54')][_0x799a('0x55')])),_0x36fcc['converted_format']));logger[_0x799a('0x5a')](_0x799a('0x5b'),_0x2d7861);logger[_0x799a('0x5a')]('Sound\x20upload\x20destination:\x20%s',_0x53c5b5);try{fs[_0x799a('0x5c')](_0x2d7861,parseInt(_0x799a('0x5d'),0x8));var _0x1b2e4a=sox[_0x799a('0x5e')](_0x2d7861,_0x53c5b5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b2e4a['on'](_0x799a('0x27'),function(_0x481ed3){fs[_0x799a('0x5f')](_0x2d7861);_0x25d7e2[_0x799a('0x1d')](0x1f4)['send'](_0x481ed3);});_0x1b2e4a['on']('src',function(_0xaad5cc){_0x36fcc[_0x799a('0x60')]=isNaN(_0xaad5cc[_0x799a('0x61')])?null:_0xaad5cc[_0x799a('0x61')]*0x3e8;_0x36fcc[_0x799a('0x62')]=isNaN(_0xaad5cc[_0x799a('0x63')])?null:_0xaad5cc['sampleCount'];_0x36fcc['original_channelCount']=isNaN(_0xaad5cc[_0x799a('0x64')])?null:_0xaad5cc['channelCount'];_0x36fcc[_0x799a('0x65')]=isNaN(_0xaad5cc[_0x799a('0x66')])?null:_0xaad5cc['bitRate'];_0x36fcc[_0x799a('0x67')]=isNaN(_0xaad5cc['sampleRate'])?null:_0xaad5cc['sampleRate'];});_0x1b2e4a['on']('dest',function(_0x6f2488){_0x36fcc['converted_duration']=isNaN(_0x6f2488[_0x799a('0x61')])?null:_0x6f2488['duration']*0x3e8;_0x36fcc[_0x799a('0x68')]=isNaN(_0x6f2488['sampleCount'])?null:_0x6f2488['sampleCount'];_0x36fcc[_0x799a('0x69')]=isNaN(_0x6f2488[_0x799a('0x64')])?null:_0x6f2488[_0x799a('0x64')];_0x36fcc[_0x799a('0x6a')]=isNaN(_0x6f2488[_0x799a('0x66')])?null:_0x6f2488['bitRate'];_0x36fcc[_0x799a('0x6b')]=isNaN(_0x6f2488[_0x799a('0x6c')])?null:_0x6f2488[_0x799a('0x6c')];});_0x1b2e4a['on'](_0x799a('0x19'),function(){fs[_0x799a('0x5c')](_0x53c5b5,parseInt(_0x799a('0x5d'),0x8));return db[_0x799a('0x3f')][_0x799a('0x51')](_0x36fcc)['then'](function(_0x1a813d){var _0x22575d={'role':_0x42eb7f['body'][_0x799a('0x6d')],'userProfileId':_0x42eb7f[_0x799a('0x6e')][_0x799a('0x6f')]};if(!_0x22575d)throw new Error(_0x799a('0x70'));if(_0x22575d[_0x799a('0x6d')]===_0x799a('0x71')){var _0x4f7324=_0x1a813d[_0x799a('0x24')]({'plain':!![]});return db[_0x799a('0x72')][_0x799a('0x48')]({'where':{'name':_0x799a('0x25'),'userProfileId':_0x22575d[_0x799a('0x6f')]},'raw':!![]})['then'](function(_0x594db8){if(_0x594db8&&_0x594db8[_0x799a('0x73')]===0x0){return db[_0x799a('0x74')]['create']({'name':_0x4f7324[_0x799a('0x28')],'resourceId':_0x4f7324['id'],'type':_0x594db8[_0x799a('0x28')],'sectionId':_0x594db8['id']},{})[_0x799a('0x22')](function(){return _0x1a813d;});}else{return _0x1a813d;}})[_0x799a('0x44')](function(_0x47fa5a){logger[_0x799a('0x27')](_0x799a('0x75'),_0x47fa5a);throw _0x47fa5a;});}return _0x1a813d;})['then'](respondWithResult(_0x25d7e2,null))['catch'](handleError(_0x25d7e2,null));});_0x1b2e4a[_0x799a('0x76')]();}catch(_0x4afaa6){_0x25d7e2[_0x799a('0x1d')](0x1f4)[_0x799a('0x29')](_0x4afaa6);}};exports[_0x799a('0x77')]=function(_0x5e58ee,_0x2aec2a,_0x252ca9){return db['Sound'][_0x799a('0x48')]({'where':{'id':_0x5e58ee[_0x799a('0x46')]['id']}})[_0x799a('0x22')](handleEntityNotFound(_0x2aec2a,null))['then'](saveUpdates(_[_0x799a('0x3a')](_0x5e58ee[_0x799a('0x6e')],[_0x799a('0x28'),_0x799a('0x78')]),null))[_0x799a('0x22')](respondWithResult(_0x2aec2a,null))[_0x799a('0x44')](handleError(_0x2aec2a,null));};exports[_0x799a('0x79')]=function(_0x5eca53,_0x33061d,_0x25e164){return db['Sound'][_0x799a('0x48')]({'where':{'id':_0x5eca53[_0x799a('0x46')]['id']}})[_0x799a('0x22')](function(_0x2e5a2a){if(_0x2e5a2a){return _0x2e5a2a[_0x799a('0x23')]();}})['then'](function(_0x108a30){var _0x2507cd=path[_0x799a('0x59')](config[_0x799a('0x4a')],_0x799a('0x58'),util[_0x799a('0x7a')](_0x799a('0x50'),_0x108a30['save_name'],_0x108a30[_0x799a('0x7b')]));var _0x4a97f2=path['join'](config[_0x799a('0x4a')],_0x799a('0x4f'),util[_0x799a('0x7a')](_0x799a('0x50'),_0x108a30[_0x799a('0x7c')],_0x108a30[_0x799a('0x4b')]));fs[_0x799a('0x5f')](_0x2507cd);fs[_0x799a('0x5f')](_0x4a97f2);return _0x108a30;})[_0x799a('0x22')](function(_0x4bea82){if(_0x4bea82){return _0x33061d['status'](0xcc)['end']();}})[_0x799a('0x22')](handleEntityNotFound(_0x33061d,null))[_0x799a('0x44')](handleError(_0x33061d,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 4a25411..41dbc9e 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 _0x272c=['define','Sound','tools_sounds','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x3ee760,_0x43e0bd){var _0x3c3092=function(_0x1e9bd9){while(--_0x1e9bd9){_0x3ee760['push'](_0x3ee760['shift']());}};_0x3c3092(++_0x43e0bd);}(_0x272c,0x162));var _0xc272=function(_0x1068a9,_0x1b4c7a){_0x1068a9=_0x1068a9-0x0;var _0x295055=_0x272c[_0x1068a9];return _0x295055;};'use strict';var _=require('lodash');var util=require(_0xc272('0x0'));var logger=require(_0xc272('0x1'))(_0xc272('0x2'));var moment=require('moment');var BPromise=require(_0xc272('0x3'));var rp=require(_0xc272('0x4'));var fs=require('fs');var path=require(_0xc272('0x5'));var rimraf=require(_0xc272('0x6'));var config=require(_0xc272('0x7'));var attributes=require(_0xc272('0x8'));module[_0xc272('0x9')]=function(_0x4660ed,_0x53a3af){return _0x4660ed[_0xc272('0xa')](_0xc272('0xb'),attributes,{'tableName':_0xc272('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf967=['moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','lodash','util','api'];(function(_0x5c5931,_0x209e4a){var _0x2c6a5b=function(_0x55ab55){while(--_0x55ab55){_0x5c5931['push'](_0x5c5931['shift']());}};_0x2c6a5b(++_0x209e4a);}(_0xf967,0xd9));var _0x7f96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf967[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7f96('0x0'));var util=require(_0x7f96('0x1'));var logger=require('../../config/logger')(_0x7f96('0x2'));var moment=require(_0x7f96('0x3'));var BPromise=require(_0x7f96('0x4'));var rp=require(_0x7f96('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f96('0x6'));var config=require(_0x7f96('0x7'));var attributes=require(_0x7f96('0x8'));module[_0x7f96('0x9')]=function(_0x38f072,_0x52525c){return _0x38f072[_0x7f96('0xa')]('Sound',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 90400eb..015bea8 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 _0xf23a=['Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSound','Sound','options','where','attributes','include','map','model','then','stringify','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x50e44a,_0x5adf44){var _0x54c674=function(_0x3b576b){while(--_0x3b576b){_0x50e44a['push'](_0x50e44a['shift']());}};_0x54c674(++_0x5adf44);}(_0xf23a,0xdc));var _0xaf23=function(_0x1b8729,_0x745e00){_0x1b8729=_0x1b8729-0x0;var _0x4a48f3=_0xf23a[_0x1b8729];return _0x4a48f3;};'use strict';var _=require(_0xaf23('0x0'));var util=require(_0xaf23('0x1'));var moment=require('moment');var BPromise=require(_0xaf23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf23('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf23('0x4'))(_0xaf23('0x5'));var config=require(_0xaf23('0x6'));var jayson=require(_0xaf23('0x7'));var client=jayson[_0xaf23('0x8')][_0xaf23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ab695,_0x4d112d,_0x53a009){return new BPromise(function(_0x2b7c3a,_0x40f54f){return client[_0xaf23('0xa')](_0x1ab695,_0x53a009)['then'](function(_0xb4ef3c){logger[_0xaf23('0xb')](_0xaf23('0xc'),_0x4d112d,_0xaf23('0xd'));logger['debug'](_0xaf23('0xe'),_0x4d112d,_0xaf23('0xd'),JSON['stringify'](_0xb4ef3c));if(_0xb4ef3c[_0xaf23('0xf')]){if(_0xb4ef3c[_0xaf23('0xf')]['code']===0x1f4){logger[_0xaf23('0xf')]('Sound,\x20%s,\x20%s',_0x4d112d,_0xb4ef3c[_0xaf23('0xf')][_0xaf23('0x10')]);return _0x40f54f(_0xb4ef3c['error'][_0xaf23('0x10')]);}logger[_0xaf23('0xf')](_0xaf23('0xc'),_0x4d112d,_0xb4ef3c[_0xaf23('0xf')][_0xaf23('0x10')]);return _0x2b7c3a(_0xb4ef3c[_0xaf23('0xf')][_0xaf23('0x10')]);}else{logger[_0xaf23('0xb')](_0xaf23('0xc'),_0x4d112d,'request\x20sent');_0x2b7c3a(_0xb4ef3c[_0xaf23('0x11')]['message']);}})[_0xaf23('0x12')](function(_0x23f96d){logger[_0xaf23('0xf')](_0xaf23('0xc'),_0x4d112d,_0x23f96d);_0x40f54f(_0x23f96d);});});}exports[_0xaf23('0x13')]=function(_0x110959){var _0x54b7f6=this;return new Promise(function(_0x46940c,_0x223fd8){return db[_0xaf23('0x14')]['find']({'raw':_0x110959[_0xaf23('0x15')]?_0x110959[_0xaf23('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x110959[_0xaf23('0x15')]?_0x110959[_0xaf23('0x15')][_0xaf23('0x16')]||null:null,'attributes':_0x110959[_0xaf23('0x15')]?_0x110959[_0xaf23('0x15')][_0xaf23('0x17')]||null:null,'include':_0x110959[_0xaf23('0x15')]?_0x110959[_0xaf23('0x15')][_0xaf23('0x18')]?_[_0xaf23('0x19')](_0x110959[_0xaf23('0x15')][_0xaf23('0x18')],function(_0x5ab2a9){return{'model':db[_0x5ab2a9[_0xaf23('0x1a')]],'as':_0x5ab2a9['as'],'attributes':_0x5ab2a9[_0xaf23('0x17')],'include':_0x5ab2a9[_0xaf23('0x18')]?_[_0xaf23('0x19')](_0x5ab2a9['include'],function(_0x327d8c){return{'model':db[_0x327d8c['model']],'as':_0x327d8c['as'],'attributes':_0x327d8c[_0xaf23('0x17')],'include':_0x327d8c[_0xaf23('0x18')]?_[_0xaf23('0x19')](_0x327d8c['include'],function(_0x4074f5){return{'model':db[_0x4074f5[_0xaf23('0x1a')]],'as':_0x4074f5['as'],'attributes':_0x4074f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf23('0x1b')](function(_0xa2ec80){logger[_0xaf23('0xb')](_0xaf23('0x13'),_0x110959);logger['debug'](_0xaf23('0x13'),_0x110959,JSON[_0xaf23('0x1c')](_0xa2ec80));_0x46940c(_0xa2ec80);})[_0xaf23('0x12')](function(_0x3f35e3){logger[_0xaf23('0xf')](_0xaf23('0x13'),_0x3f35e3[_0xaf23('0x10')],_0x110959);_0x223fd8(_0x54b7f6['error'](0x1f4,_0x3f35e3[_0xaf23('0x10')]));});});}; \ No newline at end of file +var _0xd877=['info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','ShowSound','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x596981,_0x57742a){var _0x5ef6d0=function(_0x294ced){while(--_0x294ced){_0x596981['push'](_0x596981['shift']());}};_0x5ef6d0(++_0x57742a);}(_0xd877,0x13e));var _0x7d87=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd877[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7d87('0x0'));var util=require(_0x7d87('0x1'));var moment=require(_0x7d87('0x2'));var BPromise=require(_0x7d87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d87('0x4'));var db=require(_0x7d87('0x5'))['db'];var utils=require(_0x7d87('0x6'));var logger=require(_0x7d87('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7d87('0x8'));var client=jayson[_0x7d87('0x9')][_0x7d87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a76c0,_0x11d70e,_0xc9510d){return new BPromise(function(_0x131d8a,_0x232a93){return client[_0x7d87('0xb')](_0x4a76c0,_0xc9510d)['then'](function(_0x4232ca){logger[_0x7d87('0xc')](_0x7d87('0xd'),_0x11d70e,'request\x20sent');logger[_0x7d87('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x11d70e,_0x7d87('0xf'),JSON[_0x7d87('0x10')](_0x4232ca));if(_0x4232ca['error']){if(_0x4232ca[_0x7d87('0x11')]['code']===0x1f4){logger['error'](_0x7d87('0xd'),_0x11d70e,_0x4232ca[_0x7d87('0x11')][_0x7d87('0x12')]);return _0x232a93(_0x4232ca[_0x7d87('0x11')][_0x7d87('0x12')]);}logger[_0x7d87('0x11')](_0x7d87('0xd'),_0x11d70e,_0x4232ca['error'][_0x7d87('0x12')]);return _0x131d8a(_0x4232ca['error'][_0x7d87('0x12')]);}else{logger['info'](_0x7d87('0xd'),_0x11d70e,'request\x20sent');_0x131d8a(_0x4232ca['result']['message']);}})[_0x7d87('0x13')](function(_0x165dad){logger['error'](_0x7d87('0xd'),_0x11d70e,_0x165dad);_0x232a93(_0x165dad);});});}exports[_0x7d87('0x14')]=function(_0x4ff148){var _0x588d4d=this;return new Promise(function(_0x2b0c72,_0x2d5549){return db['Sound'][_0x7d87('0x15')]({'raw':_0x4ff148[_0x7d87('0x16')]?_0x4ff148[_0x7d87('0x16')][_0x7d87('0x17')]===undefined?!![]:![]:!![],'where':_0x4ff148[_0x7d87('0x16')]?_0x4ff148[_0x7d87('0x16')][_0x7d87('0x18')]||null:null,'attributes':_0x4ff148['options']?_0x4ff148[_0x7d87('0x16')][_0x7d87('0x19')]||null:null,'include':_0x4ff148[_0x7d87('0x16')]?_0x4ff148[_0x7d87('0x16')][_0x7d87('0x1a')]?_[_0x7d87('0x1b')](_0x4ff148[_0x7d87('0x16')][_0x7d87('0x1a')],function(_0x33a9e1){return{'model':db[_0x33a9e1[_0x7d87('0x1c')]],'as':_0x33a9e1['as'],'attributes':_0x33a9e1[_0x7d87('0x19')],'include':_0x33a9e1[_0x7d87('0x1a')]?_[_0x7d87('0x1b')](_0x33a9e1[_0x7d87('0x1a')],function(_0xd182d5){return{'model':db[_0xd182d5['model']],'as':_0xd182d5['as'],'attributes':_0xd182d5[_0x7d87('0x19')],'include':_0xd182d5[_0x7d87('0x1a')]?_['map'](_0xd182d5[_0x7d87('0x1a')],function(_0x15917d){return{'model':db[_0x15917d[_0x7d87('0x1c')]],'as':_0x15917d['as'],'attributes':_0x15917d[_0x7d87('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7d87('0x1d')](function(_0x49b080){logger[_0x7d87('0xc')](_0x7d87('0x14'),_0x4ff148);logger[_0x7d87('0xe')]('ShowSound',_0x4ff148,JSON[_0x7d87('0x10')](_0x49b080));_0x2b0c72(_0x49b080);})['catch'](function(_0x40001d){logger[_0x7d87('0x11')]('ShowSound',_0x40001d[_0x7d87('0x12')],_0x4ff148);_0x2d5549(_0x588d4d[_0x7d87('0x11')](0x1f4,_0x40001d[_0x7d87('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0fdc28c..4cb6edf 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x509dad,_0x1f995f){var _0x21e122=function(_0x2a9b90){while(--_0x2a9b90){_0x509dad['push'](_0x509dad['shift']());}};_0x21e122(++_0x1f995f);}(_0x4fc2,0x111));var _0x24fc=function(_0x11dcf0,_0x4eb137){_0x11dcf0=_0x11dcf0-0x0;var _0x4f9831=_0x4fc2[_0x11dcf0];return _0x4f9831;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x22ab82,_0x2e11f4){var _0x4234bd=function(_0x525797){while(--_0x525797){_0x22ab82['push'](_0x22ab82['shift']());}};_0x4234bd(++_0x2e11f4);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index d25e0d3..5f129e6 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 _0x5169=['out','STRING','TEXT','medium','ENUM'];(function(_0x257a01,_0x143777){var _0xc2cd98=function(_0x3d1842){while(--_0x3d1842){_0x257a01['push'](_0x257a01['shift']());}};_0xc2cd98(++_0x143777);}(_0x5169,0xe7));var _0x9516=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x5169[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9516('0x0')]},'body':{'type':Sequelize[_0x9516('0x1')](_0x9516('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x9516('0x3')]('in',_0x9516('0x4')),'defaultValue':_0x9516('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9516('0x0')]},'providerResponse':{'type':Sequelize[_0x9516('0x1')]}}; \ No newline at end of file +var _0xf664=['TEXT','STRING','medium','out'];(function(_0x12609e,_0x4a34d1){var _0x3faa1a=function(_0x4ae9aa){while(--_0x4ae9aa){_0x12609e['push'](_0x12609e['shift']());}};_0x3faa1a(++_0x4a34d1);}(_0xf664,0x12d));var _0x4f66=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0xf664[_0x74892f];return _0x10ee61;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4f66('0x0')]},'body':{'type':Sequelize['TEXT'](_0x4f66('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4f66('0x2')),'defaultValue':_0x4f66('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0x4f66('0x0')]},'providerResponse':{'type':Sequelize[_0x4f66('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 3759bea..5948cc8 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 _0xf2a0=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','map','SquareMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','find','create','body','params','rimraf','zip-dir'];(function(_0x558555,_0x2deb17){var _0x1922f4=function(_0x4b7d5a){while(--_0x4b7d5a){_0x558555['push'](_0x558555['shift']());}};_0x1922f4(++_0x2deb17);}(_0xf2a0,0x88));var _0x0f2a=function(_0x4cdc7c,_0x522a62){_0x4cdc7c=_0x4cdc7c-0x0;var _0x54d7f6=_0xf2a0[_0x4cdc7c];return _0x54d7f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f2a('0x0'));var zipdir=require(_0x0f2a('0x1'));var jsonpatch=require(_0x0f2a('0x2'));var rp=require(_0x0f2a('0x3'));var moment=require(_0x0f2a('0x4'));var BPromise=require(_0x0f2a('0x5'));var Mustache=require(_0x0f2a('0x6'));var util=require(_0x0f2a('0x7'));var path=require(_0x0f2a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0f2a('0x9'));var fs=require('fs');var fs_extra=require(_0x0f2a('0xa'));var _=require('lodash');var squel=require(_0x0f2a('0xb'));var crypto=require(_0x0f2a('0xc'));var jsforce=require(_0x0f2a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0f2a('0xe'));var Papa=require(_0x0f2a('0xf'));var Redis=require(_0x0f2a('0x10'));var authService=require(_0x0f2a('0x11'));var qs=require(_0x0f2a('0x12'));var as=require(_0x0f2a('0x13'));var hardwareService=require(_0x0f2a('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0f2a('0x15'));var licenseUtil=require(_0x0f2a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43cf09,_0x289bdf){_0x289bdf=_0x289bdf||0xcc;return function(_0x377f9e){if(_0x377f9e){return _0x43cf09[_0x0f2a('0x17')](_0x289bdf);}return _0x43cf09['status'](_0x289bdf)[_0x0f2a('0x18')]();};}function respondWithResult(_0x2905d1,_0x3eb5e8){_0x3eb5e8=_0x3eb5e8||0xc8;return function(_0x5c7ae1){if(_0x5c7ae1){return _0x2905d1[_0x0f2a('0x19')](_0x3eb5e8)[_0x0f2a('0x1a')](_0x5c7ae1);}};}function respondWithFilteredResult(_0xe6870d,_0x28114c){return function(_0x2a3fc5){if(_0x2a3fc5){var _0x4ba06f=typeof _0x28114c[_0x0f2a('0x1b')]===_0x0f2a('0x1c')&&typeof _0x28114c[_0x0f2a('0x1d')]===_0x0f2a('0x1c');var _0x2b65d0=_0x2a3fc5[_0x0f2a('0x1e')];var _0x326c9a=_0x4ba06f?0x0:_0x28114c['offset'];var _0x3920ae=_0x4ba06f?_0x2a3fc5[_0x0f2a('0x1e')]:_0x28114c[_0x0f2a('0x1b')]+_0x28114c[_0x0f2a('0x1d')];var _0x314cc5;if(_0x3920ae>=_0x2b65d0){_0x3920ae=_0x2b65d0;_0x314cc5=0xc8;}else{_0x314cc5=0xce;}_0xe6870d[_0x0f2a('0x19')](_0x314cc5);return _0xe6870d[_0x0f2a('0x1f')]('Content-Range',_0x326c9a+'-'+_0x3920ae+'/'+_0x2b65d0)['json'](_0x2a3fc5);}return null;};}function patchUpdates(_0x19ef09){return function(_0x7cdc4a){try{jsonpatch['apply'](_0x7cdc4a,_0x19ef09,!![]);}catch(_0x2003cd){return BPromise[_0x0f2a('0x20')](_0x2003cd);}return _0x7cdc4a[_0x0f2a('0x21')]();};}function saveUpdates(_0x40e066,_0x527a58){return function(_0xd94aeb){if(_0xd94aeb){return _0xd94aeb[_0x0f2a('0x22')](_0x40e066)[_0x0f2a('0x23')](function(_0x41f6a9){return _0x41f6a9;});}return null;};}function removeEntity(_0x216ed3,_0xf2f553){return function(_0x2f8308){if(_0x2f8308){return _0x2f8308[_0x0f2a('0x24')]()['then'](function(){_0x216ed3[_0x0f2a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x392c4b,_0x7c93ef){return function(_0x3ea2ba){if(!_0x3ea2ba){_0x392c4b[_0x0f2a('0x17')](0x194);}return _0x3ea2ba;};}function handleError(_0x532865,_0x390af6){_0x390af6=_0x390af6||0x1f4;return function(_0x417874){logger[_0x0f2a('0x25')](_0x417874[_0x0f2a('0x26')]);if(_0x417874[_0x0f2a('0x27')]){delete _0x417874[_0x0f2a('0x27')];}_0x532865[_0x0f2a('0x19')](_0x390af6)['send'](_0x417874);};}exports['index']=function(_0x367bca,_0x25a915){var _0x45c936={},_0x398912={},_0x483e65={'count':0x0,'rows':[]};var _0x210fd4=_[_0x0f2a('0x28')](db[_0x0f2a('0x29')][_0x0f2a('0x2a')],function(_0x24b480){return{'name':_0x24b480[_0x0f2a('0x2b')],'type':_0x24b480['type'][_0x0f2a('0x2c')]};});_0x398912[_0x0f2a('0x2d')]=_['map'](_0x210fd4,'name');_0x398912['query']=_[_0x0f2a('0x2e')](_0x367bca[_0x0f2a('0x2f')]);_0x398912[_0x0f2a('0x30')]=_[_0x0f2a('0x31')](_0x398912[_0x0f2a('0x2d')],_0x398912[_0x0f2a('0x2f')]);_0x45c936[_0x0f2a('0x32')]=_[_0x0f2a('0x31')](_0x398912[_0x0f2a('0x2d')],qs[_0x0f2a('0x33')](_0x367bca[_0x0f2a('0x2f')][_0x0f2a('0x33')]));_0x45c936[_0x0f2a('0x32')]=_0x45c936[_0x0f2a('0x32')]['length']?_0x45c936['attributes']:_0x398912[_0x0f2a('0x2d')];if(!_0x367bca[_0x0f2a('0x2f')][_0x0f2a('0x34')](_0x0f2a('0x35'))){_0x45c936[_0x0f2a('0x1d')]=qs[_0x0f2a('0x1d')](_0x367bca[_0x0f2a('0x2f')]['limit']);_0x45c936['offset']=qs['offset'](_0x367bca[_0x0f2a('0x2f')][_0x0f2a('0x1b')]);}_0x45c936[_0x0f2a('0x36')]=qs[_0x0f2a('0x37')](_0x367bca['query'][_0x0f2a('0x37')]);_0x45c936[_0x0f2a('0x38')]=qs[_0x0f2a('0x30')](_[_0x0f2a('0x39')](_0x367bca[_0x0f2a('0x2f')],_0x398912['filters']),_0x210fd4);if(_0x367bca[_0x0f2a('0x2f')]['filter']){_0x45c936['where']=_['merge'](_0x45c936[_0x0f2a('0x38')],{'$or':_[_0x0f2a('0x28')](_0x210fd4,function(_0x22b528){if(_0x22b528['type']!=='VIRTUAL'){var _0x3025e1={};_0x3025e1[_0x22b528['name']]={'$like':'%'+_0x367bca['query'][_0x0f2a('0x3a')]+'%'};return _0x3025e1;}})});}_0x45c936=_[_0x0f2a('0x3b')]({},_0x45c936,_0x367bca[_0x0f2a('0x3c')]);var _0x28ca18={'where':_0x45c936[_0x0f2a('0x38')]};return db[_0x0f2a('0x29')][_0x0f2a('0x1e')](_0x28ca18)[_0x0f2a('0x23')](function(_0x35abdb){_0x483e65[_0x0f2a('0x1e')]=_0x35abdb;if(_0x367bca['query']['includeAll']){_0x45c936[_0x0f2a('0x3d')]=[{'all':!![]}];}return db[_0x0f2a('0x29')][_0x0f2a('0x3e')](_0x45c936);})[_0x0f2a('0x23')](function(_0x525207){_0x483e65[_0x0f2a('0x3f')]=_0x525207;return _0x483e65;})['then'](respondWithFilteredResult(_0x25a915,_0x45c936))[_0x0f2a('0x40')](handleError(_0x25a915,null));};exports['show']=function(_0x401aa7,_0x12de9f){var _0x327be9={'raw':!![],'where':{'id':_0x401aa7['params']['id']}},_0x38fd1e={};_0x38fd1e[_0x0f2a('0x2d')]=_[_0x0f2a('0x2e')](db[_0x0f2a('0x29')][_0x0f2a('0x2a')]);_0x38fd1e[_0x0f2a('0x2f')]=_[_0x0f2a('0x2e')](_0x401aa7[_0x0f2a('0x2f')]);_0x38fd1e[_0x0f2a('0x30')]=_['intersection'](_0x38fd1e[_0x0f2a('0x2d')],_0x38fd1e[_0x0f2a('0x2f')]);_0x327be9[_0x0f2a('0x32')]=_[_0x0f2a('0x31')](_0x38fd1e[_0x0f2a('0x2d')],qs[_0x0f2a('0x33')](_0x401aa7[_0x0f2a('0x2f')][_0x0f2a('0x33')]));_0x327be9[_0x0f2a('0x32')]=_0x327be9[_0x0f2a('0x32')]['length']?_0x327be9['attributes']:_0x38fd1e[_0x0f2a('0x2d')];if(_0x401aa7[_0x0f2a('0x2f')]['includeAll']){_0x327be9[_0x0f2a('0x3d')]=[{'all':!![]}];}_0x327be9=_[_0x0f2a('0x3b')]({},_0x327be9,_0x401aa7[_0x0f2a('0x3c')]);return db['SquareMessage'][_0x0f2a('0x41')](_0x327be9)[_0x0f2a('0x23')](handleEntityNotFound(_0x12de9f,null))['then'](respondWithResult(_0x12de9f,null))[_0x0f2a('0x40')](handleError(_0x12de9f,null));};exports[_0x0f2a('0x42')]=function(_0x44057c,_0x3f03e4){return db[_0x0f2a('0x29')][_0x0f2a('0x42')](_0x44057c[_0x0f2a('0x43')],{})['then'](respondWithResult(_0x3f03e4,0xc9))[_0x0f2a('0x40')](handleError(_0x3f03e4,null));};exports[_0x0f2a('0x22')]=function(_0x36cba1,_0x5b7bca){if(_0x36cba1['body']['id']){delete _0x36cba1[_0x0f2a('0x43')]['id'];}return db['SquareMessage'][_0x0f2a('0x41')]({'where':{'id':_0x36cba1[_0x0f2a('0x44')]['id']}})[_0x0f2a('0x23')](handleEntityNotFound(_0x5b7bca,null))[_0x0f2a('0x23')](saveUpdates(_0x36cba1['body'],null))['then'](respondWithResult(_0x5b7bca,null))[_0x0f2a('0x40')](handleError(_0x5b7bca,null));};exports[_0x0f2a('0x24')]=function(_0x3200f2,_0x336005){return db[_0x0f2a('0x29')]['find']({'where':{'id':_0x3200f2['params']['id']}})[_0x0f2a('0x23')](handleEntityNotFound(_0x336005,null))[_0x0f2a('0x23')](removeEntity(_0x336005,null))[_0x0f2a('0x40')](handleError(_0x336005,null));}; \ No newline at end of file +var _0x1fed=['stack','index','SquareMessage','fieldName','type','key','model','map','name','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','rawAttributes','length','create','body','catch','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1fed,0x1d3));var _0xd1fe=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x1fed[_0x1347f8];return _0x218368;};'use strict';var emlformat=require(_0xd1fe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1fe('0x1'));var jsonpatch=require(_0xd1fe('0x2'));var rp=require(_0xd1fe('0x3'));var moment=require(_0xd1fe('0x4'));var BPromise=require(_0xd1fe('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1fe('0x6'));var sox=require('sox');var csv=require(_0xd1fe('0x7'));var ejs=require(_0xd1fe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd1fe('0x9'));var deskjs=require(_0xd1fe('0xa'));var toCsv=require(_0xd1fe('0x7'));var querystring=require(_0xd1fe('0xb'));var Papa=require(_0xd1fe('0xc'));var Redis=require('ioredis');var authService=require(_0xd1fe('0xd'));var qs=require(_0xd1fe('0xe'));var as=require(_0xd1fe('0xf'));var hardwareService=require(_0xd1fe('0x10'));var logger=require(_0xd1fe('0x11'))('api');var utils=require(_0xd1fe('0x12'));var config=require(_0xd1fe('0x13'));var licenseUtil=require(_0xd1fe('0x14'));var db=require(_0xd1fe('0x15'))['db'];function respondWithStatusCode(_0x2225bb,_0x50a4de){_0x50a4de=_0x50a4de||0xcc;return function(_0x380a81){if(_0x380a81){return _0x2225bb[_0xd1fe('0x16')](_0x50a4de);}return _0x2225bb['status'](_0x50a4de)[_0xd1fe('0x17')]();};}function respondWithResult(_0x597075,_0x7b3411){_0x7b3411=_0x7b3411||0xc8;return function(_0x2f0796){if(_0x2f0796){return _0x597075[_0xd1fe('0x18')](_0x7b3411)[_0xd1fe('0x19')](_0x2f0796);}};}function respondWithFilteredResult(_0x1d14d3,_0x5c08a2){return function(_0x402b55){if(_0x402b55){var _0x3036cc=typeof _0x5c08a2['offset']==='undefined'&&typeof _0x5c08a2[_0xd1fe('0x1a')]==='undefined';var _0x2f44a1=_0x402b55[_0xd1fe('0x1b')];var _0x22ae0b=_0x3036cc?0x0:_0x5c08a2[_0xd1fe('0x1c')];var _0x1155bb=_0x3036cc?_0x402b55[_0xd1fe('0x1b')]:_0x5c08a2[_0xd1fe('0x1c')]+_0x5c08a2[_0xd1fe('0x1a')];var _0x5ce356;if(_0x1155bb>=_0x2f44a1){_0x1155bb=_0x2f44a1;_0x5ce356=0xc8;}else{_0x5ce356=0xce;}_0x1d14d3['status'](_0x5ce356);return _0x1d14d3['set'](_0xd1fe('0x1d'),_0x22ae0b+'-'+_0x1155bb+'/'+_0x2f44a1)[_0xd1fe('0x19')](_0x402b55);}return null;};}function patchUpdates(_0x108ef3){return function(_0xb69c7f){try{jsonpatch[_0xd1fe('0x1e')](_0xb69c7f,_0x108ef3,!![]);}catch(_0x415352){return BPromise[_0xd1fe('0x1f')](_0x415352);}return _0xb69c7f[_0xd1fe('0x20')]();};}function saveUpdates(_0x18d109,_0x34ebab){return function(_0x4ac933){if(_0x4ac933){return _0x4ac933[_0xd1fe('0x21')](_0x18d109)['then'](function(_0x5cd548){return _0x5cd548;});}return null;};}function removeEntity(_0x6caff0,_0x1c5e78){return function(_0x109c4d){if(_0x109c4d){return _0x109c4d[_0xd1fe('0x22')]()[_0xd1fe('0x23')](function(){_0x6caff0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb57e72,_0xe77dfa){return function(_0x4a2c8f){if(!_0x4a2c8f){_0xb57e72[_0xd1fe('0x16')](0x194);}return _0x4a2c8f;};}function handleError(_0x364413,_0x3a0610){_0x3a0610=_0x3a0610||0x1f4;return function(_0x5c5782){logger[_0xd1fe('0x24')](_0x5c5782[_0xd1fe('0x25')]);if(_0x5c5782['name']){delete _0x5c5782['name'];}_0x364413['status'](_0x3a0610)['send'](_0x5c5782);};}exports[_0xd1fe('0x26')]=function(_0x55138d,_0x2858ea){var _0x56510c={},_0x4f366d={},_0x577a30={'count':0x0,'rows':[]};var _0x890b58=_['map'](db[_0xd1fe('0x27')]['rawAttributes'],function(_0x30460c){return{'name':_0x30460c[_0xd1fe('0x28')],'type':_0x30460c[_0xd1fe('0x29')][_0xd1fe('0x2a')]};});_0x4f366d[_0xd1fe('0x2b')]=_[_0xd1fe('0x2c')](_0x890b58,_0xd1fe('0x2d'));_0x4f366d[_0xd1fe('0x2e')]=_['keys'](_0x55138d[_0xd1fe('0x2e')]);_0x4f366d[_0xd1fe('0x2f')]=_[_0xd1fe('0x30')](_0x4f366d[_0xd1fe('0x2b')],_0x4f366d[_0xd1fe('0x2e')]);_0x56510c['attributes']=_['intersection'](_0x4f366d[_0xd1fe('0x2b')],qs[_0xd1fe('0x31')](_0x55138d[_0xd1fe('0x2e')]['fields']));_0x56510c[_0xd1fe('0x32')]=_0x56510c['attributes']['length']?_0x56510c[_0xd1fe('0x32')]:_0x4f366d[_0xd1fe('0x2b')];if(!_0x55138d['query']['hasOwnProperty'](_0xd1fe('0x33'))){_0x56510c['limit']=qs['limit'](_0x55138d['query'][_0xd1fe('0x1a')]);_0x56510c[_0xd1fe('0x1c')]=qs[_0xd1fe('0x1c')](_0x55138d['query'][_0xd1fe('0x1c')]);}_0x56510c[_0xd1fe('0x34')]=qs[_0xd1fe('0x35')](_0x55138d[_0xd1fe('0x2e')][_0xd1fe('0x35')]);_0x56510c[_0xd1fe('0x36')]=qs['filters'](_[_0xd1fe('0x37')](_0x55138d[_0xd1fe('0x2e')],_0x4f366d['filters']),_0x890b58);if(_0x55138d['query'][_0xd1fe('0x38')]){_0x56510c[_0xd1fe('0x36')]=_[_0xd1fe('0x39')](_0x56510c[_0xd1fe('0x36')],{'$or':_[_0xd1fe('0x2c')](_0x890b58,function(_0x394858){if(_0x394858[_0xd1fe('0x29')]!==_0xd1fe('0x3a')){var _0x3b7e73={};_0x3b7e73[_0x394858[_0xd1fe('0x2d')]]={'$like':'%'+_0x55138d[_0xd1fe('0x2e')][_0xd1fe('0x38')]+'%'};return _0x3b7e73;}})});}_0x56510c=_['merge']({},_0x56510c,_0x55138d[_0xd1fe('0x3b')]);var _0x1c7cca={'where':_0x56510c[_0xd1fe('0x36')]};return db['SquareMessage'][_0xd1fe('0x1b')](_0x1c7cca)[_0xd1fe('0x23')](function(_0x5c8466){_0x577a30[_0xd1fe('0x1b')]=_0x5c8466;if(_0x55138d[_0xd1fe('0x2e')][_0xd1fe('0x3c')]){_0x56510c[_0xd1fe('0x3d')]=[{'all':!![]}];}return db[_0xd1fe('0x27')][_0xd1fe('0x3e')](_0x56510c);})[_0xd1fe('0x23')](function(_0x24021e){_0x577a30['rows']=_0x24021e;return _0x577a30;})[_0xd1fe('0x23')](respondWithFilteredResult(_0x2858ea,_0x56510c))['catch'](handleError(_0x2858ea,null));};exports[_0xd1fe('0x3f')]=function(_0x24cc00,_0x358414){var _0x2dbf99={'raw':!![],'where':{'id':_0x24cc00[_0xd1fe('0x40')]['id']}},_0x31e97a={};_0x31e97a['model']=_[_0xd1fe('0x41')](db[_0xd1fe('0x27')][_0xd1fe('0x42')]);_0x31e97a[_0xd1fe('0x2e')]=_[_0xd1fe('0x41')](_0x24cc00[_0xd1fe('0x2e')]);_0x31e97a[_0xd1fe('0x2f')]=_[_0xd1fe('0x30')](_0x31e97a[_0xd1fe('0x2b')],_0x31e97a[_0xd1fe('0x2e')]);_0x2dbf99[_0xd1fe('0x32')]=_[_0xd1fe('0x30')](_0x31e97a['model'],qs[_0xd1fe('0x31')](_0x24cc00[_0xd1fe('0x2e')]['fields']));_0x2dbf99[_0xd1fe('0x32')]=_0x2dbf99['attributes'][_0xd1fe('0x43')]?_0x2dbf99[_0xd1fe('0x32')]:_0x31e97a['model'];if(_0x24cc00['query']['includeAll']){_0x2dbf99[_0xd1fe('0x3d')]=[{'all':!![]}];}_0x2dbf99=_[_0xd1fe('0x39')]({},_0x2dbf99,_0x24cc00[_0xd1fe('0x3b')]);return db['SquareMessage']['find'](_0x2dbf99)['then'](handleEntityNotFound(_0x358414,null))[_0xd1fe('0x23')](respondWithResult(_0x358414,null))['catch'](handleError(_0x358414,null));};exports[_0xd1fe('0x44')]=function(_0x481378,_0xe86918){return db[_0xd1fe('0x27')][_0xd1fe('0x44')](_0x481378[_0xd1fe('0x45')],{})[_0xd1fe('0x23')](respondWithResult(_0xe86918,0xc9))[_0xd1fe('0x46')](handleError(_0xe86918,null));};exports['update']=function(_0x29a45,_0x5dee55){if(_0x29a45[_0xd1fe('0x45')]['id']){delete _0x29a45['body']['id'];}return db[_0xd1fe('0x27')][_0xd1fe('0x47')]({'where':{'id':_0x29a45[_0xd1fe('0x40')]['id']}})[_0xd1fe('0x23')](handleEntityNotFound(_0x5dee55,null))[_0xd1fe('0x23')](saveUpdates(_0x29a45['body'],null))[_0xd1fe('0x23')](respondWithResult(_0x5dee55,null))[_0xd1fe('0x46')](handleError(_0x5dee55,null));};exports[_0xd1fe('0x22')]=function(_0xadc85,_0x31f64b){return db['SquareMessage'][_0xd1fe('0x47')]({'where':{'id':_0xadc85['params']['id']}})['then'](handleEntityNotFound(_0x31f64b,null))[_0xd1fe('0x23')](removeEntity(_0x31f64b,null))[_0xd1fe('0x46')](handleError(_0x31f64b,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 59e11a6..f02572d 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 _0x9614=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','util','api','moment','bluebird','request-promise'];(function(_0x4e2118,_0x3ddb37){var _0x1fd5d1=function(_0x3bebb5){while(--_0x3bebb5){_0x4e2118['push'](_0x4e2118['shift']());}};_0x1fd5d1(++_0x3ddb37);}(_0x9614,0x15a));var _0x4961=function(_0x552dee,_0x1e45b0){_0x552dee=_0x552dee-0x0;var _0x30072e=_0x9614[_0x552dee];return _0x30072e;};'use strict';var _=require('lodash');var util=require(_0x4961('0x0'));var logger=require('../../config/logger')(_0x4961('0x1'));var moment=require(_0x4961('0x2'));var BPromise=require(_0x4961('0x3'));var rp=require(_0x4961('0x4'));var fs=require('fs');var path=require(_0x4961('0x5'));var rimraf=require(_0x4961('0x6'));var config=require(_0x4961('0x7'));var attributes=require(_0x4961('0x8'));module[_0x4961('0x9')]=function(_0x2de484,_0x285f0b){return _0x2de484[_0x4961('0xa')](_0x4961('0xb'),attributes,{'tableName':_0x4961('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4f0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xc4f0,0x1b1));var _0x0c4f=function(_0x4c2d9b,_0x21f0de){_0x4c2d9b=_0x4c2d9b-0x0;var _0x11346b=_0xc4f0[_0x4c2d9b];return _0x11346b;};'use strict';var _=require(_0x0c4f('0x0'));var util=require(_0x0c4f('0x1'));var logger=require(_0x0c4f('0x2'))(_0x0c4f('0x3'));var moment=require(_0x0c4f('0x4'));var BPromise=require(_0x0c4f('0x5'));var rp=require(_0x0c4f('0x6'));var fs=require('fs');var path=require(_0x0c4f('0x7'));var rimraf=require(_0x0c4f('0x8'));var config=require(_0x0c4f('0x9'));var attributes=require(_0x0c4f('0xa'));module[_0x0c4f('0xb')]=function(_0x937d74,_0xf38974){return _0x937d74[_0x0c4f('0xc')](_0x0c4f('0xd'),attributes,{'tableName':_0x0c4f('0xe'),'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 79b5226..79d899a 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 _0x120e=['message','CreateSquareMessage','SquareMessage','create','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x317621,_0x2a382b){var _0x1779a9=function(_0x5704b6){while(--_0x5704b6){_0x317621['push'](_0x317621['shift']());}};_0x1779a9(++_0x2a382b);}(_0x120e,0x1c8));var _0xe120=function(_0x4acf87,_0x2b5c2d){_0x4acf87=_0x4acf87-0x0;var _0x360dbf=_0x120e[_0x4acf87];return _0x360dbf;};'use strict';var _=require(_0xe120('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe120('0x1'));var rs=require(_0xe120('0x2'));var fs=require('fs');var Redis=require(_0xe120('0x3'));var db=require(_0xe120('0x4'))['db'];var utils=require(_0xe120('0x5'));var logger=require(_0xe120('0x6'))('rpc');var config=require(_0xe120('0x7'));var jayson=require(_0xe120('0x8'));var client=jayson[_0xe120('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229528,_0x3e7abe,_0x558dde){return new BPromise(function(_0x33b7c2,_0x1c714c){return client[_0xe120('0xa')](_0x229528,_0x558dde)[_0xe120('0xb')](function(_0x3dc334){logger[_0xe120('0xc')](_0xe120('0xd'),_0x3e7abe,_0xe120('0xe'));logger['debug'](_0xe120('0xf'),_0x3e7abe,_0xe120('0xe'),JSON[_0xe120('0x10')](_0x3dc334));if(_0x3dc334['error']){if(_0x3dc334[_0xe120('0x11')][_0xe120('0x12')]===0x1f4){logger['error'](_0xe120('0xd'),_0x3e7abe,_0x3dc334['error']['message']);return _0x1c714c(_0x3dc334['error'][_0xe120('0x13')]);}logger[_0xe120('0x11')](_0xe120('0xd'),_0x3e7abe,_0x3dc334[_0xe120('0x11')][_0xe120('0x13')]);return _0x33b7c2(_0x3dc334['error'][_0xe120('0x13')]);}else{logger[_0xe120('0xc')](_0xe120('0xd'),_0x3e7abe,_0xe120('0xe'));_0x33b7c2(_0x3dc334['result'][_0xe120('0x13')]);}})['catch'](function(_0xe0c686){logger[_0xe120('0x11')]('SquareMessage,\x20%s,\x20%s',_0x3e7abe,_0xe0c686);_0x1c714c(_0xe0c686);});});}exports[_0xe120('0x14')]=function(_0x278062){var _0x2b4055=this;return new Promise(function(_0x20081f,_0x218240){return db[_0xe120('0x15')][_0xe120('0x16')](_0x278062['body'],{'raw':_0x278062[_0xe120('0x17')]?_0x278062[_0xe120('0x17')][_0xe120('0x18')]===undefined?!![]:![]:!![]})[_0xe120('0xb')](function(_0x5f4a74){logger[_0xe120('0xc')](_0xe120('0x14'),_0x278062);logger['debug'](_0xe120('0x14'),_0x278062,JSON['stringify'](_0x5f4a74));_0x20081f(_0x5f4a74);})['catch'](function(_0x179ad8){logger[_0xe120('0x11')](_0xe120('0x14'),_0x179ad8[_0xe120('0x13')],_0x278062);_0x218240(_0x2b4055[_0xe120('0x11')](0x1f4,_0x179ad8[_0xe120('0x13')]));});});}; \ No newline at end of file +var _0x6ebe=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','error','code','message','result','catch','SquareMessage,\x20%s,\x20%s','SquareMessage','create','options','then','CreateSquareMessage','stringify','lodash','util'];(function(_0x1ee293,_0x465cda){var _0x161342=function(_0xf08e2f){while(--_0xf08e2f){_0x1ee293['push'](_0x1ee293['shift']());}};_0x161342(++_0x465cda);}(_0x6ebe,0x1ec));var _0xe6eb=function(_0x4df62f,_0x25445b){_0x4df62f=_0x4df62f-0x0;var _0x316c7c=_0x6ebe[_0x4df62f];return _0x316c7c;};'use strict';var _=require(_0xe6eb('0x0'));var util=require(_0xe6eb('0x1'));var moment=require(_0xe6eb('0x2'));var BPromise=require(_0xe6eb('0x3'));var rs=require(_0xe6eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6eb('0x5'));var logger=require(_0xe6eb('0x6'))(_0xe6eb('0x7'));var config=require('../../config/environment');var jayson=require(_0xe6eb('0x8'));var client=jayson[_0xe6eb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52c5d6,_0x441277,_0x2dd869){return new BPromise(function(_0x3adeaf,_0x309662){return client[_0xe6eb('0xa')](_0x52c5d6,_0x2dd869)['then'](function(_0x16eb81){logger[_0xe6eb('0xb')]('SquareMessage,\x20%s,\x20%s',_0x441277,_0xe6eb('0xc'));logger[_0xe6eb('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x441277,_0xe6eb('0xc'),JSON['stringify'](_0x16eb81));if(_0x16eb81[_0xe6eb('0xe')]){if(_0x16eb81['error'][_0xe6eb('0xf')]===0x1f4){logger[_0xe6eb('0xe')]('SquareMessage,\x20%s,\x20%s',_0x441277,_0x16eb81[_0xe6eb('0xe')][_0xe6eb('0x10')]);return _0x309662(_0x16eb81[_0xe6eb('0xe')][_0xe6eb('0x10')]);}logger[_0xe6eb('0xe')]('SquareMessage,\x20%s,\x20%s',_0x441277,_0x16eb81[_0xe6eb('0xe')][_0xe6eb('0x10')]);return _0x3adeaf(_0x16eb81[_0xe6eb('0xe')][_0xe6eb('0x10')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x441277,'request\x20sent');_0x3adeaf(_0x16eb81[_0xe6eb('0x11')]['message']);}})[_0xe6eb('0x12')](function(_0x125cfe){logger[_0xe6eb('0xe')](_0xe6eb('0x13'),_0x441277,_0x125cfe);_0x309662(_0x125cfe);});});}exports['CreateSquareMessage']=function(_0x187abf){var _0x26d1e0=this;return new Promise(function(_0x233b04,_0x1745b8){return db[_0xe6eb('0x14')][_0xe6eb('0x15')](_0x187abf['body'],{'raw':_0x187abf[_0xe6eb('0x16')]?_0x187abf[_0xe6eb('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xe6eb('0x17')](function(_0x4a67b2){logger[_0xe6eb('0xb')](_0xe6eb('0x18'),_0x187abf);logger[_0xe6eb('0xd')](_0xe6eb('0x18'),_0x187abf,JSON[_0xe6eb('0x19')](_0x4a67b2));_0x233b04(_0x4a67b2);})[_0xe6eb('0x12')](function(_0x40db22){logger['error'](_0xe6eb('0x18'),_0x40db22[_0xe6eb('0x10')],_0x187abf);_0x1745b8(_0x26d1e0[_0xe6eb('0xe')](0x1f4,_0x40db22[_0xe6eb('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9e03e06..9b7d4cb 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 _0x1d7d=['create','put','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','/:id','get','/:id/test','15s'];(function(_0x13ec2c,_0x1f18a5){var _0x12c92b=function(_0x1ba84c){while(--_0x1ba84c){_0x13ec2c['push'](_0x13ec2c['shift']());}};_0x12c92b(++_0x1f18a5);}(_0x1d7d,0xc9));var _0xd1d7=function(_0x2bb51f,_0x198486){_0x2bb51f=_0x2bb51f-0x0;var _0x4768e7=_0x1d7d[_0x2bb51f];return _0x4768e7;};'use strict';var multer=require(_0xd1d7('0x0'));var util=require(_0xd1d7('0x1'));var path=require(_0xd1d7('0x2'));var timeout=require('connect-timeout');var express=require(_0xd1d7('0x3'));var router=express[_0xd1d7('0x4')]();var fs_extra=require(_0xd1d7('0x5'));var auth=require(_0xd1d7('0x6'));var interaction=require(_0xd1d7('0x7'));var config=require(_0xd1d7('0x8'));var controller=require(_0xd1d7('0x9'));router['get']('/',auth[_0xd1d7('0xa')](),controller['index']);router['get'](_0xd1d7('0xb'),auth[_0xd1d7('0xa')](),controller['show']);router[_0xd1d7('0xc')](_0xd1d7('0xd'),auth[_0xd1d7('0xa')](),timeout(_0xd1d7('0xe')),controller['test']);router['post']('/',auth[_0xd1d7('0xa')](),controller[_0xd1d7('0xf')]);router[_0xd1d7('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd1d7('0x11')](_0xd1d7('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa2b1=['test','create','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xa2b1,0x1e6));var _0x1a2b=function(_0x419fac,_0x2f2409){_0x419fac=_0x419fac-0x0;var _0x5b598b=_0xa2b1[_0x419fac];return _0x5b598b;};'use strict';var multer=require('multer');var util=require(_0x1a2b('0x0'));var path=require(_0x1a2b('0x1'));var timeout=require(_0x1a2b('0x2'));var express=require(_0x1a2b('0x3'));var router=express['Router']();var fs_extra=require(_0x1a2b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1a2b('0x5'));var config=require(_0x1a2b('0x6'));var controller=require(_0x1a2b('0x7'));router[_0x1a2b('0x8')]('/',auth[_0x1a2b('0x9')](),controller[_0x1a2b('0xa')]);router[_0x1a2b('0x8')](_0x1a2b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1a2b('0x8')](_0x1a2b('0xc'),auth[_0x1a2b('0x9')](),timeout(_0x1a2b('0xd')),controller[_0x1a2b('0xe')]);router['post']('/',auth[_0x1a2b('0x9')](),controller[_0x1a2b('0xf')]);router[_0x1a2b('0x10')](_0x1a2b('0xb'),auth['isAuthenticated'](),controller[_0x1a2b('0x11')]);router['delete'](_0x1a2b('0xb'),auth[_0x1a2b('0x9')](),controller[_0x1a2b('0x12')]);module[_0x1a2b('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 1ef9743..bf2387d 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 _0x0a53=['exports','STRING','name','sequelize'];(function(_0x539c63,_0x461d2d){var _0x33c0b2=function(_0x4fa880){while(--_0x4fa880){_0x539c63['push'](_0x539c63['shift']());}};_0x33c0b2(++_0x461d2d);}(_0x0a53,0x183));var _0x30a5=function(_0x323021,_0x30f030){_0x323021=_0x323021-0x0;var _0x52cb3e=_0x0a53[_0x323021];return _0x52cb3e;};'use strict';var Sequelize=require(_0x30a5('0x0'));module[_0x30a5('0x1')]={'name':{'type':Sequelize[_0x30a5('0x2')],'unique':_0x30a5('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x30a5('0x2')]},'description':{'type':Sequelize[_0x30a5('0x2')]}}; \ No newline at end of file +var _0x8a13=['exports','STRING','name','sequelize'];(function(_0x2662e1,_0x3b84b1){var _0x11d068=function(_0x20e0f6){while(--_0x20e0f6){_0x2662e1['push'](_0x2662e1['shift']());}};_0x11d068(++_0x3b84b1);}(_0x8a13,0xd7));var _0x38a1=function(_0x1f34d3,_0x3e2bb7){_0x1f34d3=_0x1f34d3-0x0;var _0x42313a=_0x8a13[_0x1f34d3];return _0x42313a;};'use strict';var Sequelize=require(_0x38a1('0x0'));module[_0x38a1('0x1')]={'name':{'type':Sequelize[_0x38a1('0x2')],'unique':_0x38a1('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x38a1('0x2')]},'description':{'type':Sequelize[_0x38a1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 8ca1a8c..a51cf9e 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 _0x68f3=['keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','ODBC','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','odbc','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','Content-Range','json','destroy','then','UserProfileResource','error','name','index','SquareOdbc','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params'];(function(_0x3ce9a6,_0x4621fe){var _0x3d14c1=function(_0x20908d){while(--_0x20908d){_0x3ce9a6['push'](_0x3ce9a6['shift']());}};_0x3d14c1(++_0x4621fe);}(_0x68f3,0x69));var _0x368f=function(_0x27e4f6,_0x39abf5){_0x27e4f6=_0x27e4f6-0x0;var _0x398c9d=_0x68f3[_0x27e4f6];return _0x398c9d;};'use strict';var emlformat=require(_0x368f('0x0'));var rimraf=require(_0x368f('0x1'));var zipdir=require(_0x368f('0x2'));var jsonpatch=require(_0x368f('0x3'));var rp=require('request-promise');var moment=require(_0x368f('0x4'));var BPromise=require(_0x368f('0x5'));var Mustache=require(_0x368f('0x6'));var util=require('util');var path=require(_0x368f('0x7'));var sox=require(_0x368f('0x8'));var csv=require('to-csv');var ejs=require(_0x368f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x368f('0xa'));var squel=require(_0x368f('0xb'));var crypto=require(_0x368f('0xc'));var jsforce=require(_0x368f('0xd'));var deskjs=require(_0x368f('0xe'));var toCsv=require(_0x368f('0xf'));var querystring=require(_0x368f('0x10'));var Papa=require('papaparse');var Redis=require(_0x368f('0x11'));var authService=require(_0x368f('0x12'));var qs=require(_0x368f('0x13'));var as=require(_0x368f('0x14'));var hardwareService=require(_0x368f('0x15'));var logger=require(_0x368f('0x16'))('api');var utils=require(_0x368f('0x17'));var config=require(_0x368f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x368f('0x19'))['db'];function respondWithStatusCode(_0x28450,_0x230dd8){_0x230dd8=_0x230dd8||0xcc;return function(_0x212d9b){if(_0x212d9b){return _0x28450[_0x368f('0x1a')](_0x230dd8);}return _0x28450['status'](_0x230dd8)[_0x368f('0x1b')]();};}function respondWithResult(_0x312fe7,_0x24ee3f){_0x24ee3f=_0x24ee3f||0xc8;return function(_0x447520){if(_0x447520){return _0x312fe7[_0x368f('0x1c')](_0x24ee3f)['json'](_0x447520);}};}function respondWithFilteredResult(_0x1d02e8,_0x40f2d2){return function(_0xf0341){if(_0xf0341){var _0x443435=typeof _0x40f2d2[_0x368f('0x1d')]===_0x368f('0x1e')&&typeof _0x40f2d2[_0x368f('0x1f')]===_0x368f('0x1e');var _0x25dbfa=_0xf0341['count'];var _0x1f28c9=_0x443435?0x0:_0x40f2d2[_0x368f('0x1d')];var _0x1d6691=_0x443435?_0xf0341['count']:_0x40f2d2[_0x368f('0x1d')]+_0x40f2d2[_0x368f('0x1f')];var _0xbcc702;if(_0x1d6691>=_0x25dbfa){_0x1d6691=_0x25dbfa;_0xbcc702=0xc8;}else{_0xbcc702=0xce;}_0x1d02e8['status'](_0xbcc702);return _0x1d02e8['set'](_0x368f('0x20'),_0x1f28c9+'-'+_0x1d6691+'/'+_0x25dbfa)[_0x368f('0x21')](_0xf0341);}return null;};}function patchUpdates(_0x24ffe7){return function(_0x13ec5c){try{jsonpatch['apply'](_0x13ec5c,_0x24ffe7,!![]);}catch(_0x3caed7){return BPromise['reject'](_0x3caed7);}return _0x13ec5c['save']();};}function saveUpdates(_0x2c11d4,_0x406284){return function(_0x145c84){if(_0x145c84){return _0x145c84['update'](_0x2c11d4)['then'](function(_0x266a08){return _0x266a08;});}return null;};}function removeEntity(_0x22b7b7,_0x48b58f){return function(_0x156b29){if(_0x156b29){return _0x156b29[_0x368f('0x22')]()[_0x368f('0x23')](function(){var _0x5aea37=_0x156b29['get']({'plain':!![]});var _0x1230f1='ODBC';return db[_0x368f('0x24')][_0x368f('0x22')]({'where':{'type':_0x1230f1,'resourceId':_0x5aea37['id']}})[_0x368f('0x23')](function(){return _0x156b29;});})[_0x368f('0x23')](function(){_0x22b7b7[_0x368f('0x1c')](0xcc)[_0x368f('0x1b')]();});}};}function handleEntityNotFound(_0x5892e7,_0x7a9257){return function(_0x57a18f){if(!_0x57a18f){_0x5892e7[_0x368f('0x1a')](0x194);}return _0x57a18f;};}function handleError(_0x5c1002,_0x5e8f61){_0x5e8f61=_0x5e8f61||0x1f4;return function(_0x385c32){logger[_0x368f('0x25')](_0x385c32['stack']);if(_0x385c32[_0x368f('0x26')]){delete _0x385c32[_0x368f('0x26')];}_0x5c1002[_0x368f('0x1c')](_0x5e8f61)['send'](_0x385c32);};}exports[_0x368f('0x27')]=function(_0x14cca7,_0x4bba7d){var _0x5bbecf={},_0x56fc7b={},_0x496cca={'count':0x0,'rows':[]};var _0x184d70=_['map'](db[_0x368f('0x28')][_0x368f('0x29')],function(_0x43049a){return{'name':_0x43049a[_0x368f('0x2a')],'type':_0x43049a[_0x368f('0x2b')][_0x368f('0x2c')]};});_0x56fc7b[_0x368f('0x2d')]=_[_0x368f('0x2e')](_0x184d70,_0x368f('0x26'));_0x56fc7b[_0x368f('0x2f')]=_['keys'](_0x14cca7[_0x368f('0x2f')]);_0x56fc7b['filters']=_[_0x368f('0x30')](_0x56fc7b[_0x368f('0x2d')],_0x56fc7b[_0x368f('0x2f')]);_0x5bbecf[_0x368f('0x31')]=_['intersection'](_0x56fc7b['model'],qs[_0x368f('0x32')](_0x14cca7[_0x368f('0x2f')][_0x368f('0x32')]));_0x5bbecf[_0x368f('0x31')]=_0x5bbecf[_0x368f('0x31')]['length']?_0x5bbecf[_0x368f('0x31')]:_0x56fc7b[_0x368f('0x2d')];if(!_0x14cca7[_0x368f('0x2f')][_0x368f('0x33')](_0x368f('0x34'))){_0x5bbecf[_0x368f('0x1f')]=qs['limit'](_0x14cca7[_0x368f('0x2f')][_0x368f('0x1f')]);_0x5bbecf[_0x368f('0x1d')]=qs[_0x368f('0x1d')](_0x14cca7[_0x368f('0x2f')][_0x368f('0x1d')]);}_0x5bbecf[_0x368f('0x35')]=qs[_0x368f('0x36')](_0x14cca7[_0x368f('0x2f')]['sort']);_0x5bbecf['where']=qs[_0x368f('0x37')](_[_0x368f('0x38')](_0x14cca7[_0x368f('0x2f')],_0x56fc7b[_0x368f('0x37')]),_0x184d70);if(_0x14cca7[_0x368f('0x2f')][_0x368f('0x39')]){_0x5bbecf[_0x368f('0x3a')]=_[_0x368f('0x3b')](_0x5bbecf[_0x368f('0x3a')],{'$or':_[_0x368f('0x2e')](_0x184d70,function(_0x5e6528){if(_0x5e6528[_0x368f('0x2b')]!==_0x368f('0x3c')){var _0x4d0da4={};_0x4d0da4[_0x5e6528[_0x368f('0x26')]]={'$like':'%'+_0x14cca7[_0x368f('0x2f')][_0x368f('0x39')]+'%'};return _0x4d0da4;}})});}_0x5bbecf=_[_0x368f('0x3b')]({},_0x5bbecf,_0x14cca7[_0x368f('0x3d')]);var _0x3283fd={'where':_0x5bbecf[_0x368f('0x3a')]};return db[_0x368f('0x28')][_0x368f('0x3e')](_0x3283fd)['then'](function(_0x4e4df6){_0x496cca[_0x368f('0x3e')]=_0x4e4df6;if(_0x14cca7[_0x368f('0x2f')][_0x368f('0x3f')]){_0x5bbecf[_0x368f('0x40')]=[{'all':!![]}];}return db[_0x368f('0x28')][_0x368f('0x41')](_0x5bbecf);})[_0x368f('0x23')](function(_0x11f26a){_0x496cca['rows']=_0x11f26a;return _0x496cca;})[_0x368f('0x23')](respondWithFilteredResult(_0x4bba7d,_0x5bbecf))[_0x368f('0x42')](handleError(_0x4bba7d,null));};exports[_0x368f('0x43')]=function(_0x52ef10,_0x3bb19b){var _0x1d7e98={'raw':!![],'where':{'id':_0x52ef10[_0x368f('0x44')]['id']}},_0x4edc38={};_0x4edc38[_0x368f('0x2d')]=_[_0x368f('0x45')](db['SquareOdbc'][_0x368f('0x29')]);_0x4edc38['query']=_[_0x368f('0x45')](_0x52ef10[_0x368f('0x2f')]);_0x4edc38[_0x368f('0x37')]=_['intersection'](_0x4edc38[_0x368f('0x2d')],_0x4edc38[_0x368f('0x2f')]);_0x1d7e98[_0x368f('0x31')]=_[_0x368f('0x30')](_0x4edc38[_0x368f('0x2d')],qs['fields'](_0x52ef10['query'][_0x368f('0x32')]));_0x1d7e98['attributes']=_0x1d7e98['attributes']['length']?_0x1d7e98[_0x368f('0x31')]:_0x4edc38[_0x368f('0x2d')];if(_0x52ef10['query'][_0x368f('0x3f')]){_0x1d7e98[_0x368f('0x40')]=[{'all':!![]}];}_0x1d7e98=_[_0x368f('0x3b')]({},_0x1d7e98,_0x52ef10['options']);return db[_0x368f('0x28')][_0x368f('0x46')](_0x1d7e98)[_0x368f('0x23')](handleEntityNotFound(_0x3bb19b,null))[_0x368f('0x23')](respondWithResult(_0x3bb19b,null))['catch'](handleError(_0x3bb19b,null));};exports[_0x368f('0x47')]=function(_0x8846,_0x169a33){return db[_0x368f('0x28')]['create'](_0x8846['body'],{})[_0x368f('0x23')](function(_0x155f8b){var _0x1a6c93=_0x8846[_0x368f('0x48')]['get']({'plain':!![]});if(!_0x1a6c93)throw new Error(_0x368f('0x49'));if(_0x1a6c93['role']===_0x368f('0x48')){var _0x3f6cfc=_0x155f8b[_0x368f('0x4a')]({'plain':!![]});var _0x21729f=_0x368f('0x4b');return db[_0x368f('0x4c')][_0x368f('0x46')]({'where':{'name':_0x21729f,'userProfileId':_0x1a6c93[_0x368f('0x4d')]},'raw':!![]})[_0x368f('0x23')](function(_0x20572c){if(_0x20572c&&_0x20572c[_0x368f('0x4e')]===0x0){return db[_0x368f('0x24')][_0x368f('0x47')]({'name':_0x3f6cfc[_0x368f('0x26')],'resourceId':_0x3f6cfc['id'],'type':_0x20572c[_0x368f('0x26')],'sectionId':_0x20572c['id']},{})[_0x368f('0x23')](function(){return _0x155f8b;});}else{return _0x155f8b;}})['catch'](function(_0x5142b8){logger[_0x368f('0x25')](_0x368f('0x4f'),_0x5142b8);throw _0x5142b8;});}return _0x155f8b;})[_0x368f('0x23')](respondWithResult(_0x169a33,0xc9))[_0x368f('0x42')](handleError(_0x169a33,null));};exports[_0x368f('0x50')]=function(_0x243e19,_0xa8923f){if(_0x243e19[_0x368f('0x51')]['id']){delete _0x243e19['body']['id'];}return db[_0x368f('0x28')][_0x368f('0x46')]({'where':{'id':_0x243e19[_0x368f('0x44')]['id']}})['then'](handleEntityNotFound(_0xa8923f,null))[_0x368f('0x23')](saveUpdates(_0x243e19[_0x368f('0x51')],null))[_0x368f('0x23')](respondWithResult(_0xa8923f,null))[_0x368f('0x42')](handleError(_0xa8923f,null));};exports[_0x368f('0x22')]=function(_0x1e62ac,_0x5dfd35){return db[_0x368f('0x28')][_0x368f('0x46')]({'where':{'id':_0x1e62ac[_0x368f('0x44')]['id']}})['then'](handleEntityNotFound(_0x5dfd35,null))[_0x368f('0x23')](removeEntity(_0x5dfd35,null))[_0x368f('0x42')](handleError(_0x5dfd35,null));};exports[_0x368f('0x52')]=function(_0x59e4d9,_0x4126ca,_0x27b867){var _0x38bfe3;return db[_0x368f('0x28')][_0x368f('0x46')]({'where':{'id':_0x59e4d9[_0x368f('0x44')]['id']},'attributes':['id','dsn']})[_0x368f('0x23')](handleEntityNotFound(_0x4126ca,null))['then'](function(_0x29e354){if(_0x29e354){var _0xc3b5e4=require(_0x368f('0x53'))();_0xc3b5e4[_0x368f('0x54')](_0x29e354[_0x368f('0x55')]);_0xc3b5e4[_0x368f('0x56')]();return _0x29e354;}})[_0x368f('0x23')](respondWithResult(_0x4126ca,null))[_0x368f('0x42')](handleError(_0x4126ca,null));}; \ No newline at end of file +var _0xe801=['stack','name','map','SquareOdbc','rawAttributes','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','dsn','closeSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xe801,0x1ec));var _0x1e80=function(_0x2d9df5,_0x1f717b){_0x2d9df5=_0x2d9df5-0x0;var _0x520b1d=_0xe801[_0x2d9df5];return _0x520b1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e80('0x0'));var zipdir=require(_0x1e80('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e80('0x2'));var moment=require(_0x1e80('0x3'));var BPromise=require(_0x1e80('0x4'));var Mustache=require(_0x1e80('0x5'));var util=require(_0x1e80('0x6'));var path=require(_0x1e80('0x7'));var sox=require(_0x1e80('0x8'));var csv=require('to-csv');var ejs=require(_0x1e80('0x9'));var fs=require('fs');var fs_extra=require(_0x1e80('0xa'));var _=require(_0x1e80('0xb'));var squel=require(_0x1e80('0xc'));var crypto=require('crypto');var jsforce=require(_0x1e80('0xd'));var deskjs=require(_0x1e80('0xe'));var toCsv=require(_0x1e80('0xf'));var querystring=require('querystring');var Papa=require(_0x1e80('0x10'));var Redis=require('ioredis');var authService=require(_0x1e80('0x11'));var qs=require(_0x1e80('0x12'));var as=require(_0x1e80('0x13'));var hardwareService=require(_0x1e80('0x14'));var logger=require(_0x1e80('0x15'))('api');var utils=require(_0x1e80('0x16'));var config=require(_0x1e80('0x17'));var licenseUtil=require(_0x1e80('0x18'));var db=require(_0x1e80('0x19'))['db'];function respondWithStatusCode(_0x4cf60d,_0x4d40d0){_0x4d40d0=_0x4d40d0||0xcc;return function(_0x368faa){if(_0x368faa){return _0x4cf60d[_0x1e80('0x1a')](_0x4d40d0);}return _0x4cf60d[_0x1e80('0x1b')](_0x4d40d0)[_0x1e80('0x1c')]();};}function respondWithResult(_0xaeb985,_0x55d903){_0x55d903=_0x55d903||0xc8;return function(_0x31c1a0){if(_0x31c1a0){return _0xaeb985[_0x1e80('0x1b')](_0x55d903)[_0x1e80('0x1d')](_0x31c1a0);}};}function respondWithFilteredResult(_0x504ccb,_0x187518){return function(_0x1f63e4){if(_0x1f63e4){var _0x3fedfb=typeof _0x187518[_0x1e80('0x1e')]==='undefined'&&typeof _0x187518[_0x1e80('0x1f')]===_0x1e80('0x20');var _0x45ec8d=_0x1f63e4['count'];var _0x5ad3a1=_0x3fedfb?0x0:_0x187518[_0x1e80('0x1e')];var _0x1d1484=_0x3fedfb?_0x1f63e4[_0x1e80('0x21')]:_0x187518[_0x1e80('0x1e')]+_0x187518[_0x1e80('0x1f')];var _0x3d39b5;if(_0x1d1484>=_0x45ec8d){_0x1d1484=_0x45ec8d;_0x3d39b5=0xc8;}else{_0x3d39b5=0xce;}_0x504ccb[_0x1e80('0x1b')](_0x3d39b5);return _0x504ccb['set'](_0x1e80('0x22'),_0x5ad3a1+'-'+_0x1d1484+'/'+_0x45ec8d)[_0x1e80('0x1d')](_0x1f63e4);}return null;};}function patchUpdates(_0x377759){return function(_0x12bbe7){try{jsonpatch[_0x1e80('0x23')](_0x12bbe7,_0x377759,!![]);}catch(_0x55e98f){return BPromise[_0x1e80('0x24')](_0x55e98f);}return _0x12bbe7[_0x1e80('0x25')]();};}function saveUpdates(_0x8686b8,_0xc70477){return function(_0x2ffcc0){if(_0x2ffcc0){return _0x2ffcc0[_0x1e80('0x26')](_0x8686b8)[_0x1e80('0x27')](function(_0x5f98f9){return _0x5f98f9;});}return null;};}function removeEntity(_0x328096,_0x494d7a){return function(_0x43a4b5){if(_0x43a4b5){return _0x43a4b5[_0x1e80('0x28')]()[_0x1e80('0x27')](function(){var _0x34d14c=_0x43a4b5['get']({'plain':!![]});var _0x767ea2='ODBC';return db[_0x1e80('0x29')]['destroy']({'where':{'type':_0x767ea2,'resourceId':_0x34d14c['id']}})[_0x1e80('0x27')](function(){return _0x43a4b5;});})[_0x1e80('0x27')](function(){_0x328096[_0x1e80('0x1b')](0xcc)[_0x1e80('0x1c')]();});}};}function handleEntityNotFound(_0x190767,_0x2fe0f9){return function(_0x3b23fe){if(!_0x3b23fe){_0x190767[_0x1e80('0x1a')](0x194);}return _0x3b23fe;};}function handleError(_0x23043c,_0x486fe7){_0x486fe7=_0x486fe7||0x1f4;return function(_0x30de21){logger['error'](_0x30de21[_0x1e80('0x2a')]);if(_0x30de21[_0x1e80('0x2b')]){delete _0x30de21[_0x1e80('0x2b')];}_0x23043c[_0x1e80('0x1b')](_0x486fe7)['send'](_0x30de21);};}exports['index']=function(_0x132722,_0x1c622e){var _0xfb1fc1={},_0x59f806={},_0x4eef5c={'count':0x0,'rows':[]};var _0x308c76=_[_0x1e80('0x2c')](db[_0x1e80('0x2d')][_0x1e80('0x2e')],function(_0x321e2){return{'name':_0x321e2['fieldName'],'type':_0x321e2[_0x1e80('0x2f')][_0x1e80('0x30')]};});_0x59f806['model']=_[_0x1e80('0x2c')](_0x308c76,_0x1e80('0x2b'));_0x59f806[_0x1e80('0x31')]=_[_0x1e80('0x32')](_0x132722[_0x1e80('0x31')]);_0x59f806['filters']=_[_0x1e80('0x33')](_0x59f806['model'],_0x59f806[_0x1e80('0x31')]);_0xfb1fc1[_0x1e80('0x34')]=_[_0x1e80('0x33')](_0x59f806['model'],qs[_0x1e80('0x35')](_0x132722['query'][_0x1e80('0x35')]));_0xfb1fc1[_0x1e80('0x34')]=_0xfb1fc1[_0x1e80('0x34')][_0x1e80('0x36')]?_0xfb1fc1[_0x1e80('0x34')]:_0x59f806[_0x1e80('0x37')];if(!_0x132722[_0x1e80('0x31')][_0x1e80('0x38')](_0x1e80('0x39'))){_0xfb1fc1[_0x1e80('0x1f')]=qs[_0x1e80('0x1f')](_0x132722[_0x1e80('0x31')][_0x1e80('0x1f')]);_0xfb1fc1[_0x1e80('0x1e')]=qs[_0x1e80('0x1e')](_0x132722[_0x1e80('0x31')]['offset']);}_0xfb1fc1[_0x1e80('0x3a')]=qs[_0x1e80('0x3b')](_0x132722[_0x1e80('0x31')]['sort']);_0xfb1fc1[_0x1e80('0x3c')]=qs[_0x1e80('0x3d')](_[_0x1e80('0x3e')](_0x132722[_0x1e80('0x31')],_0x59f806['filters']),_0x308c76);if(_0x132722[_0x1e80('0x31')][_0x1e80('0x3f')]){_0xfb1fc1[_0x1e80('0x3c')]=_['merge'](_0xfb1fc1[_0x1e80('0x3c')],{'$or':_[_0x1e80('0x2c')](_0x308c76,function(_0x3d309e){if(_0x3d309e[_0x1e80('0x2f')]!==_0x1e80('0x40')){var _0xb7da1b={};_0xb7da1b[_0x3d309e[_0x1e80('0x2b')]]={'$like':'%'+_0x132722[_0x1e80('0x31')][_0x1e80('0x3f')]+'%'};return _0xb7da1b;}})});}_0xfb1fc1=_[_0x1e80('0x41')]({},_0xfb1fc1,_0x132722[_0x1e80('0x42')]);var _0x364406={'where':_0xfb1fc1[_0x1e80('0x3c')]};return db['SquareOdbc'][_0x1e80('0x21')](_0x364406)['then'](function(_0x13e0a9){_0x4eef5c[_0x1e80('0x21')]=_0x13e0a9;if(_0x132722[_0x1e80('0x31')][_0x1e80('0x43')]){_0xfb1fc1[_0x1e80('0x44')]=[{'all':!![]}];}return db['SquareOdbc'][_0x1e80('0x45')](_0xfb1fc1);})['then'](function(_0x5e8584){_0x4eef5c['rows']=_0x5e8584;return _0x4eef5c;})[_0x1e80('0x27')](respondWithFilteredResult(_0x1c622e,_0xfb1fc1))['catch'](handleError(_0x1c622e,null));};exports[_0x1e80('0x46')]=function(_0x9b831,_0x4a0086){var _0x4b256={'raw':!![],'where':{'id':_0x9b831[_0x1e80('0x47')]['id']}},_0x24f320={};_0x24f320[_0x1e80('0x37')]=_[_0x1e80('0x32')](db[_0x1e80('0x2d')]['rawAttributes']);_0x24f320[_0x1e80('0x31')]=_[_0x1e80('0x32')](_0x9b831['query']);_0x24f320[_0x1e80('0x3d')]=_['intersection'](_0x24f320['model'],_0x24f320[_0x1e80('0x31')]);_0x4b256[_0x1e80('0x34')]=_[_0x1e80('0x33')](_0x24f320['model'],qs['fields'](_0x9b831[_0x1e80('0x31')][_0x1e80('0x35')]));_0x4b256[_0x1e80('0x34')]=_0x4b256[_0x1e80('0x34')][_0x1e80('0x36')]?_0x4b256['attributes']:_0x24f320[_0x1e80('0x37')];if(_0x9b831[_0x1e80('0x31')][_0x1e80('0x43')]){_0x4b256[_0x1e80('0x44')]=[{'all':!![]}];}_0x4b256=_['merge']({},_0x4b256,_0x9b831[_0x1e80('0x42')]);return db[_0x1e80('0x2d')]['find'](_0x4b256)['then'](handleEntityNotFound(_0x4a0086,null))[_0x1e80('0x27')](respondWithResult(_0x4a0086,null))[_0x1e80('0x48')](handleError(_0x4a0086,null));};exports['create']=function(_0x48c8e7,_0xc85a78){return db[_0x1e80('0x2d')][_0x1e80('0x49')](_0x48c8e7['body'],{})[_0x1e80('0x27')](function(_0x45c90c){var _0x183a11=_0x48c8e7[_0x1e80('0x4a')][_0x1e80('0x4b')]({'plain':!![]});if(!_0x183a11)throw new Error(_0x1e80('0x4c'));if(_0x183a11['role']===_0x1e80('0x4a')){var _0x308d41=_0x45c90c[_0x1e80('0x4b')]({'plain':!![]});var _0x4e471c=_0x1e80('0x4d');return db[_0x1e80('0x4e')][_0x1e80('0x4f')]({'where':{'name':_0x4e471c,'userProfileId':_0x183a11[_0x1e80('0x50')]},'raw':!![]})[_0x1e80('0x27')](function(_0x3f0f0b){if(_0x3f0f0b&&_0x3f0f0b[_0x1e80('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x308d41[_0x1e80('0x2b')],'resourceId':_0x308d41['id'],'type':_0x3f0f0b['name'],'sectionId':_0x3f0f0b['id']},{})['then'](function(){return _0x45c90c;});}else{return _0x45c90c;}})[_0x1e80('0x48')](function(_0x3ec521){logger[_0x1e80('0x52')](_0x1e80('0x53'),_0x3ec521);throw _0x3ec521;});}return _0x45c90c;})[_0x1e80('0x27')](respondWithResult(_0xc85a78,0xc9))[_0x1e80('0x48')](handleError(_0xc85a78,null));};exports[_0x1e80('0x26')]=function(_0x38420d,_0x1a4248){if(_0x38420d['body']['id']){delete _0x38420d['body']['id'];}return db[_0x1e80('0x2d')]['find']({'where':{'id':_0x38420d[_0x1e80('0x47')]['id']}})[_0x1e80('0x27')](handleEntityNotFound(_0x1a4248,null))[_0x1e80('0x27')](saveUpdates(_0x38420d['body'],null))[_0x1e80('0x27')](respondWithResult(_0x1a4248,null))[_0x1e80('0x48')](handleError(_0x1a4248,null));};exports[_0x1e80('0x28')]=function(_0x3671ef,_0xae7d6f){return db[_0x1e80('0x2d')][_0x1e80('0x4f')]({'where':{'id':_0x3671ef[_0x1e80('0x47')]['id']}})['then'](handleEntityNotFound(_0xae7d6f,null))[_0x1e80('0x27')](removeEntity(_0xae7d6f,null))['catch'](handleError(_0xae7d6f,null));};exports[_0x1e80('0x54')]=function(_0x47d276,_0x1df1ab,_0x1188cc){var _0x25fd85;return db['SquareOdbc']['find']({'where':{'id':_0x47d276[_0x1e80('0x47')]['id']},'attributes':['id','dsn']})[_0x1e80('0x27')](handleEntityNotFound(_0x1df1ab,null))[_0x1e80('0x27')](function(_0x50bb88){if(_0x50bb88){var _0x1898e2=require(_0x1e80('0x55'))();_0x1898e2[_0x1e80('0x56')](_0x50bb88[_0x1e80('0x57')]);_0x1898e2[_0x1e80('0x58')]();return _0x50bb88;}})['then'](respondWithResult(_0x1df1ab,null))[_0x1e80('0x48')](handleError(_0x1df1ab,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 474a4a0..0dabac1 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 _0x3938=['rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','moment','request-promise','path'];(function(_0x3bde6e,_0x34d97a){var _0x88968b=function(_0x1821e4){while(--_0x1821e4){_0x3bde6e['push'](_0x3bde6e['shift']());}};_0x88968b(++_0x34d97a);}(_0x3938,0x162));var _0x8393=function(_0x205e7b,_0x4b7686){_0x205e7b=_0x205e7b-0x0;var _0x3e0a15=_0x3938[_0x205e7b];return _0x3e0a15;};'use strict';var _=require(_0x8393('0x0'));var util=require(_0x8393('0x1'));var logger=require('../../config/logger')(_0x8393('0x2'));var moment=require(_0x8393('0x3'));var BPromise=require('bluebird');var rp=require(_0x8393('0x4'));var fs=require('fs');var path=require(_0x8393('0x5'));var rimraf=require(_0x8393('0x6'));var config=require('../../config/environment');var attributes=require(_0x8393('0x7'));module[_0x8393('0x8')]=function(_0x3cceb4,_0x56e49b){return _0x3cceb4[_0x8393('0x9')](_0x8393('0xa'),attributes,{'tableName':_0x8393('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4343=['square_odbc','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4343,0x1ae));var _0x3434=function(_0x450289,_0xa76428){_0x450289=_0x450289-0x0;var _0x41ff32=_0x4343[_0x450289];return _0x41ff32;};'use strict';var _=require(_0x3434('0x0'));var util=require('util');var logger=require(_0x3434('0x1'))('api');var moment=require(_0x3434('0x2'));var BPromise=require(_0x3434('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3434('0x4'));var rimraf=require('rimraf');var config=require(_0x3434('0x5'));var attributes=require(_0x3434('0x6'));module[_0x3434('0x7')]=function(_0x4193e9,_0x25dc89){return _0x4193e9[_0x3434('0x8')](_0x3434('0x9'),attributes,{'tableName':_0x3434('0xa'),'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 60eaae9..6a3710c 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 _0x901c=['SquareOdbc','options','raw','include','map','attributes','model','catch','lodash','util','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','ShowSquareOdbc'];(function(_0x5922cb,_0x5682cc){var _0x322011=function(_0x34a550){while(--_0x34a550){_0x5922cb['push'](_0x5922cb['shift']());}};_0x322011(++_0x5682cc);}(_0x901c,0x12a));var _0xc901=function(_0x26f30f,_0x21661d){_0x26f30f=_0x26f30f-0x0;var _0x33ff03=_0x901c[_0x26f30f];return _0x33ff03;};'use strict';var _=require(_0xc901('0x0'));var util=require(_0xc901('0x1'));var moment=require(_0xc901('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc901('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc901('0x4'))(_0xc901('0x5'));var config=require('../../config/environment');var jayson=require(_0xc901('0x6'));var client=jayson[_0xc901('0x7')][_0xc901('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x131894,_0x19b9de,_0x4c3ec5){return new BPromise(function(_0x52adfd,_0x1742b9){return client[_0xc901('0x9')](_0x131894,_0x4c3ec5)[_0xc901('0xa')](function(_0x299bad){logger['info'](_0xc901('0xb'),_0x19b9de,'request\x20sent');logger[_0xc901('0xc')](_0xc901('0xd'),_0x19b9de,_0xc901('0xe'),JSON[_0xc901('0xf')](_0x299bad));if(_0x299bad[_0xc901('0x10')]){if(_0x299bad[_0xc901('0x10')][_0xc901('0x11')]===0x1f4){logger[_0xc901('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x19b9de,_0x299bad[_0xc901('0x10')]['message']);return _0x1742b9(_0x299bad[_0xc901('0x10')][_0xc901('0x12')]);}logger['error'](_0xc901('0xb'),_0x19b9de,_0x299bad[_0xc901('0x10')]['message']);return _0x52adfd(_0x299bad[_0xc901('0x10')][_0xc901('0x12')]);}else{logger[_0xc901('0x13')](_0xc901('0xb'),_0x19b9de,_0xc901('0xe'));_0x52adfd(_0x299bad['result']['message']);}})['catch'](function(_0x1ce83e){logger[_0xc901('0x10')](_0xc901('0xb'),_0x19b9de,_0x1ce83e);_0x1742b9(_0x1ce83e);});});}exports[_0xc901('0x14')]=function(_0x219d64){var _0x2e42ba=this;return new Promise(function(_0x21ad51,_0x1f15c5){return db[_0xc901('0x15')]['find']({'raw':_0x219d64[_0xc901('0x16')]?_0x219d64[_0xc901('0x16')][_0xc901('0x17')]===undefined?!![]:![]:!![],'where':_0x219d64['options']?_0x219d64['options']['where']||null:null,'attributes':_0x219d64['options']?_0x219d64[_0xc901('0x16')]['attributes']||null:null,'include':_0x219d64[_0xc901('0x16')]?_0x219d64[_0xc901('0x16')][_0xc901('0x18')]?_[_0xc901('0x19')](_0x219d64[_0xc901('0x16')][_0xc901('0x18')],function(_0x402861){return{'model':db[_0x402861['model']],'as':_0x402861['as'],'attributes':_0x402861[_0xc901('0x1a')],'include':_0x402861['include']?_[_0xc901('0x19')](_0x402861[_0xc901('0x18')],function(_0x141610){return{'model':db[_0x141610[_0xc901('0x1b')]],'as':_0x141610['as'],'attributes':_0x141610[_0xc901('0x1a')],'include':_0x141610[_0xc901('0x18')]?_[_0xc901('0x19')](_0x141610['include'],function(_0x21ac75){return{'model':db[_0x21ac75[_0xc901('0x1b')]],'as':_0x21ac75['as'],'attributes':_0x21ac75['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x156194){logger['info'](_0xc901('0x14'),_0x219d64);logger[_0xc901('0xc')](_0xc901('0x14'),_0x219d64,JSON[_0xc901('0xf')](_0x156194));_0x21ad51(_0x156194);})[_0xc901('0x1c')](function(_0xecdf5f){logger['error'](_0xc901('0x14'),_0xecdf5f[_0xc901('0x12')],_0x219d64);_0x1f15c5(_0x2e42ba[_0xc901('0x10')](0x1f4,_0xecdf5f['message']));});});}; \ No newline at end of file +var _0x1d00=['request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','map','model','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SquareOdbc,\x20%s,\x20%s'];(function(_0x3efcd0,_0x4181d6){var _0x341b6d=function(_0x26fa22){while(--_0x26fa22){_0x3efcd0['push'](_0x3efcd0['shift']());}};_0x341b6d(++_0x4181d6);}(_0x1d00,0x1b6));var _0x01d0=function(_0x4065fe,_0x416e26){_0x4065fe=_0x4065fe-0x0;var _0xe882ce=_0x1d00[_0x4065fe];return _0xe882ce;};'use strict';var _=require(_0x01d0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x01d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01d0('0x2'));var db=require(_0x01d0('0x3'))['db'];var utils=require(_0x01d0('0x4'));var logger=require('../../config/logger')(_0x01d0('0x5'));var config=require(_0x01d0('0x6'));var jayson=require(_0x01d0('0x7'));var client=jayson[_0x01d0('0x8')][_0x01d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32df49,_0x1a5523,_0x60ebe2){return new BPromise(function(_0x40ea56,_0x2abebc){return client['request'](_0x32df49,_0x60ebe2)[_0x01d0('0xa')](function(_0x4888f4){logger['info'](_0x01d0('0xb'),_0x1a5523,_0x01d0('0xc'));logger['debug'](_0x01d0('0xd'),_0x1a5523,'request\x20sent',JSON[_0x01d0('0xe')](_0x4888f4));if(_0x4888f4[_0x01d0('0xf')]){if(_0x4888f4[_0x01d0('0xf')][_0x01d0('0x10')]===0x1f4){logger['error'](_0x01d0('0xb'),_0x1a5523,_0x4888f4[_0x01d0('0xf')][_0x01d0('0x11')]);return _0x2abebc(_0x4888f4['error']['message']);}logger[_0x01d0('0xf')](_0x01d0('0xb'),_0x1a5523,_0x4888f4[_0x01d0('0xf')][_0x01d0('0x11')]);return _0x40ea56(_0x4888f4['error']['message']);}else{logger[_0x01d0('0x12')](_0x01d0('0xb'),_0x1a5523,_0x01d0('0xc'));_0x40ea56(_0x4888f4['result']['message']);}})[_0x01d0('0x13')](function(_0x7a7db7){logger['error'](_0x01d0('0xb'),_0x1a5523,_0x7a7db7);_0x2abebc(_0x7a7db7);});});}exports[_0x01d0('0x14')]=function(_0x1f5931){var _0x2a17b5=this;return new Promise(function(_0xb52c86,_0x5bb719){return db[_0x01d0('0x15')]['find']({'raw':_0x1f5931[_0x01d0('0x16')]?_0x1f5931[_0x01d0('0x16')][_0x01d0('0x17')]===undefined?!![]:![]:!![],'where':_0x1f5931['options']?_0x1f5931[_0x01d0('0x16')][_0x01d0('0x18')]||null:null,'attributes':_0x1f5931['options']?_0x1f5931[_0x01d0('0x16')][_0x01d0('0x19')]||null:null,'include':_0x1f5931[_0x01d0('0x16')]?_0x1f5931[_0x01d0('0x16')][_0x01d0('0x1a')]?_[_0x01d0('0x1b')](_0x1f5931[_0x01d0('0x16')]['include'],function(_0x3f753d){return{'model':db[_0x3f753d[_0x01d0('0x1c')]],'as':_0x3f753d['as'],'attributes':_0x3f753d[_0x01d0('0x19')],'include':_0x3f753d[_0x01d0('0x1a')]?_['map'](_0x3f753d[_0x01d0('0x1a')],function(_0x4e5e2){return{'model':db[_0x4e5e2[_0x01d0('0x1c')]],'as':_0x4e5e2['as'],'attributes':_0x4e5e2[_0x01d0('0x19')],'include':_0x4e5e2[_0x01d0('0x1a')]?_[_0x01d0('0x1b')](_0x4e5e2[_0x01d0('0x1a')],function(_0x12ab3c){return{'model':db[_0x12ab3c[_0x01d0('0x1c')]],'as':_0x12ab3c['as'],'attributes':_0x12ab3c[_0x01d0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x01d0('0xa')](function(_0x3242e1){logger[_0x01d0('0x12')](_0x01d0('0x14'),_0x1f5931);logger[_0x01d0('0x1d')](_0x01d0('0x14'),_0x1f5931,JSON['stringify'](_0x3242e1));_0xb52c86(_0x3242e1);})[_0x01d0('0x13')](function(_0x36e559){logger[_0x01d0('0xf')](_0x01d0('0x14'),_0x36e559['message'],_0x1f5931);_0x5bb719(_0x2a17b5[_0x01d0('0xf')](0x1f4,_0x36e559[_0x01d0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index bca4adf..64d6d0e 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 _0x7f48=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','/:id','show','/:id/users','isAuthenticated','getUsers','post','create','addUsers','put','delete'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x7f48,0xac));var _0x87f4=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x7f48[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x87f4('0x0'));var util=require(_0x87f4('0x1'));var path=require('path');var timeout=require(_0x87f4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x87f4('0x3'));var auth=require(_0x87f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x87f4('0x5'));var controller=require(_0x87f4('0x6'));router[_0x87f4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x87f4('0x7')](_0x87f4('0x8'),auth['isAuthenticated'](),controller[_0x87f4('0x9')]);router[_0x87f4('0x7')](_0x87f4('0xa'),auth[_0x87f4('0xb')](),controller[_0x87f4('0xc')]);router[_0x87f4('0xd')]('/',auth[_0x87f4('0xb')](),controller[_0x87f4('0xe')]);router[_0x87f4('0xd')](_0x87f4('0xa'),auth['isAuthenticated'](),controller[_0x87f4('0xf')]);router[_0x87f4('0x10')]('/:id',auth[_0x87f4('0xb')](),controller['update']);router[_0x87f4('0x11')](_0x87f4('0x8'),auth[_0x87f4('0xb')](),controller['destroy']);router[_0x87f4('0x11')](_0x87f4('0xa'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x87f4('0x12')]=router; \ No newline at end of file +var _0xd3c8=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/users','create','post','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1c17fb,_0x17a1c9){var _0x9977f3=function(_0x5eac87){while(--_0x5eac87){_0x1c17fb['push'](_0x1c17fb['shift']());}};_0x9977f3(++_0x17a1c9);}(_0xd3c8,0x161));var _0x8d3c=function(_0x2b6e5c,_0x588da6){_0x2b6e5c=_0x2b6e5c-0x0;var _0x54b491=_0xd3c8[_0x2b6e5c];return _0x54b491;};'use strict';var multer=require(_0x8d3c('0x0'));var util=require(_0x8d3c('0x1'));var path=require(_0x8d3c('0x2'));var timeout=require(_0x8d3c('0x3'));var express=require(_0x8d3c('0x4'));var router=express['Router']();var fs_extra=require(_0x8d3c('0x5'));var auth=require(_0x8d3c('0x6'));var interaction=require(_0x8d3c('0x7'));var config=require(_0x8d3c('0x8'));var controller=require('./squareProject.controller');router[_0x8d3c('0x9')]('/',auth[_0x8d3c('0xa')](),controller[_0x8d3c('0xb')]);router[_0x8d3c('0x9')](_0x8d3c('0xc'),auth[_0x8d3c('0xa')](),controller[_0x8d3c('0xd')]);router[_0x8d3c('0x9')](_0x8d3c('0xe'),auth[_0x8d3c('0xa')](),controller['getUsers']);router['post']('/',auth['isAuthenticated'](),controller[_0x8d3c('0xf')]);router[_0x8d3c('0x10')](_0x8d3c('0xe'),auth[_0x8d3c('0xa')](),controller[_0x8d3c('0x11')]);router[_0x8d3c('0x12')](_0x8d3c('0xc'),auth[_0x8d3c('0xa')](),controller[_0x8d3c('0x13')]);router[_0x8d3c('0x14')](_0x8d3c('0xc'),auth[_0x8d3c('0xa')](),controller[_0x8d3c('0x15')]);router[_0x8d3c('0x14')](_0x8d3c('0xe'),auth[_0x8d3c('0xa')](),controller[_0x8d3c('0x16')]);module[_0x8d3c('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index db9f16d..9488b19 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 _0x3ef8=['exports','STRING','TEXT','long','preproduction','getDataValue','toString','utf8','BLOB','production','DATE'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x3ef8,0xc6));var _0x83ef=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3ef8[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x83ef('0x0')]={'name':{'type':Sequelize[_0x83ef('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x83ef('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0x83ef('0x3')),'get':function(){if(this['getDataValue'](_0x83ef('0x4'))){return this[_0x83ef('0x5')]('preproduction')[_0x83ef('0x6')](_0x83ef('0x7'));}}},'production':{'type':Sequelize[_0x83ef('0x8')](_0x83ef('0x3')),'get':function(){if(this['getDataValue']('production')){return this[_0x83ef('0x5')](_0x83ef('0x9'))[_0x83ef('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0x83ef('0xa')]},'publishedAt':{'type':Sequelize[_0x83ef('0xa')]}}; \ No newline at end of file +var _0x62b8=['production','utf8','DATE','sequelize','exports','name','long','getDataValue','preproduction','toString','BLOB'];(function(_0x1a0571,_0x10200b){var _0x4c7572=function(_0x19ece3){while(--_0x19ece3){_0x1a0571['push'](_0x1a0571['shift']());}};_0x4c7572(++_0x10200b);}(_0x62b8,0x142));var _0x862b=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x62b8[_0x54defc];return _0x1955d3;};'use strict';var Sequelize=require(_0x862b('0x0'));module[_0x862b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x862b('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x862b('0x3')),'get':function(){if(this[_0x862b('0x4')](_0x862b('0x5'))){return this['getDataValue'](_0x862b('0x5'))[_0x862b('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x862b('0x7')](_0x862b('0x3')),'get':function(){if(this[_0x862b('0x4')](_0x862b('0x8'))){return this[_0x862b('0x4')](_0x862b('0x8'))['toString'](_0x862b('0x9'));}}},'savedAt':{'type':Sequelize[_0x862b('0xa')]},'publishedAt':{'type':Sequelize[_0x862b('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 8f215d4..db6e189 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 _0x5496=['end','status','json','offset','undefined','limit','count','update','then','SquareProjects','UserProfileResource','destroy','agi','stringify','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','filter','options','includeAll','include','rows','catch','keys','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','params','publish','pick','production','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','order','getUsers','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','./squareProject.socket','register','sendStatus'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5496,0x175));var _0x6549=function(_0x41e7e2,_0x5cef0c){_0x41e7e2=_0x41e7e2-0x0;var _0x22fec7=_0x5496[_0x41e7e2];return _0x22fec7;};'use strict';var _=require(_0x6549('0x0'));var Redis=require(_0x6549('0x1'));var qs=require(_0x6549('0x2'));var logger=require(_0x6549('0x3'))(_0x6549('0x4'));var config=require('../../config/environment');var db=require(_0x6549('0x5'))['db'];config['redis']=_[_0x6549('0x6')](config[_0x6549('0x7')],{'host':_0x6549('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6549('0x9'))[_0x6549('0xa')](socket);function respondWithStatusCode(_0x4fcffd,_0x1ca8fc){_0x1ca8fc=_0x1ca8fc||0xcc;return function(_0x3442c3){if(_0x3442c3){return _0x4fcffd[_0x6549('0xb')](_0x1ca8fc);}return _0x4fcffd['status'](_0x1ca8fc)[_0x6549('0xc')]();};}function respondWithResult(_0x35d008,_0x2ecce2){_0x2ecce2=_0x2ecce2||0xc8;return function(_0x135c2c){if(_0x135c2c){return _0x35d008[_0x6549('0xd')](_0x2ecce2)[_0x6549('0xe')](_0x135c2c);}};}function respondWithFilteredResult(_0x50fa35,_0x551133){return function(_0x1e27d4){if(_0x1e27d4){var _0xac828c=typeof _0x551133[_0x6549('0xf')]===_0x6549('0x10')&&typeof _0x551133[_0x6549('0x11')]==='undefined';var _0x4dfb06=_0x1e27d4[_0x6549('0x12')];var _0x39d78c=_0xac828c?0x0:_0x551133['offset'];var _0x200ff1=_0xac828c?_0x1e27d4[_0x6549('0x12')]:_0x551133[_0x6549('0xf')]+_0x551133[_0x6549('0x11')];var _0xc0e859;if(_0x200ff1>=_0x4dfb06){_0x200ff1=_0x4dfb06;_0xc0e859=0xc8;}else{_0xc0e859=0xce;}_0x50fa35[_0x6549('0xd')](_0xc0e859);return _0x50fa35['set']('Content-Range',_0x39d78c+'-'+_0x200ff1+'/'+_0x4dfb06)[_0x6549('0xe')](_0x1e27d4);}return null;};}function saveUpdates(_0x25da29){return function(_0x47a81a){if(_0x47a81a){return _0x47a81a[_0x6549('0x13')](_0x25da29)[_0x6549('0x14')](function(_0x4608fb){return _0x4608fb;});}return null;};}function removeEntity(_0x387e60){return function(_0xffc8b9){if(_0xffc8b9){return _0xffc8b9['destroy']()['then'](function(){var _0x26a212=_0xffc8b9['get']({'plain':!![]});var _0x56c15b=_0x6549('0x15');return db[_0x6549('0x16')][_0x6549('0x17')]({'where':{'type':_0x56c15b,'resourceId':_0x26a212['id']}})[_0x6549('0x14')](function(){return _0xffc8b9;});})[_0x6549('0x14')](function(){var _0x5ce3aa=new Redis(config[_0x6549('0x7')]);_0x5ce3aa['publish'](_0x6549('0x18'),JSON[_0x6549('0x19')]({'id':_0xffc8b9['id'],'deleted':!![]}));})[_0x6549('0x14')](function(){_0x387e60[_0x6549('0xd')](0xcc)[_0x6549('0xc')]();});}};}function handleEntityNotFound(_0x12d547){return function(_0x427b47){if(!_0x427b47){_0x12d547[_0x6549('0xb')](0x194);}return _0x427b47;};}function handleError(_0x2be467,_0x6ae00c){_0x6ae00c=_0x6ae00c||0x1f4;return function(_0x40d3f9){logger[_0x6549('0x1a')](_0x40d3f9[_0x6549('0x1b')]);if(_0x40d3f9['name']){delete _0x40d3f9[_0x6549('0x1c')];}_0x2be467[_0x6549('0xd')](_0x6ae00c)['send'](_0x40d3f9);};}exports[_0x6549('0x1d')]=function(_0x29f89e,_0x3768cb){var _0x583c7d={},_0x31a95={},_0xfb51a1={'count':0x0,'rows':[]};var _0x14de1f=_[_0x6549('0x1e')](db[_0x6549('0x1f')][_0x6549('0x20')],function(_0x2f58f7){return{'name':_0x2f58f7[_0x6549('0x21')],'type':_0x2f58f7['type'][_0x6549('0x22')]};});_0x31a95[_0x6549('0x23')]=_[_0x6549('0x1e')](_0x14de1f,'name');_0x31a95[_0x6549('0x24')]=_['keys'](_0x29f89e['query']);_0x31a95['filters']=_[_0x6549('0x25')](_0x31a95[_0x6549('0x23')],_0x31a95['query']);_0x583c7d[_0x6549('0x26')]=_[_0x6549('0x25')](_0x31a95[_0x6549('0x23')],qs[_0x6549('0x27')](_0x29f89e[_0x6549('0x24')][_0x6549('0x27')]));_0x583c7d[_0x6549('0x26')]=_0x583c7d['attributes'][_0x6549('0x28')]?_0x583c7d[_0x6549('0x26')]:_0x31a95[_0x6549('0x23')];if(!_0x29f89e[_0x6549('0x24')][_0x6549('0x29')](_0x6549('0x2a'))){_0x583c7d['limit']=qs[_0x6549('0x11')](_0x29f89e['query'][_0x6549('0x11')]);_0x583c7d['offset']=qs[_0x6549('0xf')](_0x29f89e[_0x6549('0x24')][_0x6549('0xf')]);}_0x583c7d['order']=qs[_0x6549('0x2b')](_0x29f89e[_0x6549('0x24')][_0x6549('0x2b')]);_0x583c7d[_0x6549('0x2c')]=qs['filters'](_['pick'](_0x29f89e['query'],_0x31a95[_0x6549('0x2d')]),_0x14de1f);if(_0x29f89e[_0x6549('0x24')]['filter']){_0x583c7d[_0x6549('0x2c')]=_[_0x6549('0x2e')](_0x583c7d[_0x6549('0x2c')],{'$or':_[_0x6549('0x1e')](_0x14de1f,function(_0x3741f5){if(_0x3741f5['type']!=='VIRTUAL'){var _0x1fcacf={};_0x1fcacf[_0x3741f5[_0x6549('0x1c')]]={'$like':'%'+_0x29f89e[_0x6549('0x24')][_0x6549('0x2f')]+'%'};return _0x1fcacf;}})});}_0x583c7d=_[_0x6549('0x2e')]({},_0x583c7d,_0x29f89e[_0x6549('0x30')]);var _0x1c6b46={'where':_0x583c7d[_0x6549('0x2c')]};return db[_0x6549('0x1f')][_0x6549('0x12')](_0x1c6b46)['then'](function(_0x3ecf9a){_0xfb51a1[_0x6549('0x12')]=_0x3ecf9a;if(_0x29f89e[_0x6549('0x24')][_0x6549('0x31')]){_0x583c7d[_0x6549('0x32')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x583c7d);})['then'](function(_0x22b919){_0xfb51a1[_0x6549('0x33')]=_0x22b919;return _0xfb51a1;})[_0x6549('0x14')](respondWithFilteredResult(_0x3768cb,_0x583c7d))[_0x6549('0x34')](handleError(_0x3768cb,null));};exports['show']=function(_0x56ce9f,_0x438f0b){var _0x1e719a={'raw':![],'where':{'id':_0x56ce9f['params']['id']}},_0x252d20={};_0x252d20[_0x6549('0x23')]=_['keys'](db[_0x6549('0x1f')][_0x6549('0x20')]);_0x252d20[_0x6549('0x24')]=_[_0x6549('0x35')](_0x56ce9f[_0x6549('0x24')]);_0x252d20[_0x6549('0x2d')]=_[_0x6549('0x25')](_0x252d20['model'],_0x252d20[_0x6549('0x24')]);_0x1e719a[_0x6549('0x26')]=_[_0x6549('0x25')](_0x252d20[_0x6549('0x23')],qs[_0x6549('0x27')](_0x56ce9f[_0x6549('0x24')][_0x6549('0x27')]));_0x1e719a[_0x6549('0x26')]=_0x1e719a[_0x6549('0x26')][_0x6549('0x28')]?_0x1e719a[_0x6549('0x26')]:_0x252d20[_0x6549('0x23')];if(_0x56ce9f[_0x6549('0x24')][_0x6549('0x31')]){_0x1e719a[_0x6549('0x32')]=[{'all':!![]}];}_0x1e719a=_[_0x6549('0x2e')]({},_0x1e719a,_0x56ce9f['options']);return db[_0x6549('0x1f')][_0x6549('0x36')](_0x1e719a)[_0x6549('0x14')](handleEntityNotFound(_0x438f0b,null))[_0x6549('0x14')](respondWithResult(_0x438f0b,null))['catch'](handleError(_0x438f0b,null));};exports[_0x6549('0x37')]=function(_0x483727,_0x14c90a){return db[_0x6549('0x1f')]['create'](_0x483727[_0x6549('0x38')],{})[_0x6549('0x14')](function(_0x44e608){var _0x18a751=_0x483727[_0x6549('0x39')]['get']({'plain':!![]});if(!_0x18a751)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18a751[_0x6549('0x3a')]===_0x6549('0x39')){var _0x41d675=_0x44e608[_0x6549('0x3b')]({'plain':!![]});var _0x1e562b='SquareProjects';return db[_0x6549('0x3c')][_0x6549('0x36')]({'where':{'name':_0x1e562b,'userProfileId':_0x18a751[_0x6549('0x3d')]},'raw':!![]})[_0x6549('0x14')](function(_0xa4c650){if(_0xa4c650&&_0xa4c650[_0x6549('0x3e')]===0x0){return db[_0x6549('0x16')][_0x6549('0x37')]({'name':_0x41d675['name'],'resourceId':_0x41d675['id'],'type':_0xa4c650[_0x6549('0x1c')],'sectionId':_0xa4c650['id']},{})['then'](function(){return _0x44e608;});}else{return _0x44e608;}})[_0x6549('0x34')](function(_0x1e09e1){logger[_0x6549('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e09e1);throw _0x1e09e1;});}return _0x44e608;})[_0x6549('0x14')](respondWithResult(_0x14c90a,0xc9))[_0x6549('0x34')](handleError(_0x14c90a,null));};exports[_0x6549('0x13')]=function(_0x5300c8,_0x19ac50){if(_0x5300c8[_0x6549('0x38')]['id']){delete _0x5300c8[_0x6549('0x38')]['id'];}return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x5300c8[_0x6549('0x3f')]['id']}})['then'](handleEntityNotFound(_0x19ac50,null))[_0x6549('0x14')](saveUpdates(_0x5300c8['body'],null))[_0x6549('0x14')](function(_0x9bad8f){if(!_0x9bad8f)return;var _0x1640aa=_0x9bad8f[_0x6549('0x3b')]({'plain':!![]});return _0x1640aa;})[_0x6549('0x14')](function(_0x21d2fb){var _0x292b52=new Redis(config[_0x6549('0x7')]);_0x292b52[_0x6549('0x40')](_0x6549('0x18'),JSON[_0x6549('0x19')](_[_0x6549('0x41')](_0x21d2fb,['id','name',_0x6549('0x42')])));return _0x21d2fb;})[_0x6549('0x14')](respondWithResult(_0x19ac50,null))[_0x6549('0x34')](handleError(_0x19ac50,null));};exports[_0x6549('0x17')]=function(_0x260097,_0x1ffa23){return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x260097['params']['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x1ffa23,null))[_0x6549('0x14')](removeEntity(_0x1ffa23,null))[_0x6549('0x34')](handleError(_0x1ffa23,null));};exports[_0x6549('0x43')]=function(_0x2b0ba8,_0x8bbdf4){return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x2b0ba8['params']['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x8bbdf4,null))[_0x6549('0x14')](function(_0x32b336){if(_0x32b336){return _0x32b336[_0x6549('0x43')](_0x2b0ba8[_0x6549('0x38')][_0x6549('0x44')],_['omit'](_0x2b0ba8[_0x6549('0x38')],[_0x6549('0x44'),'id'])||{});}})['then'](respondWithResult(_0x8bbdf4,null))[_0x6549('0x34')](handleError(_0x8bbdf4,null));};exports[_0x6549('0x45')]=function(_0x2efad1,_0x557b52){return db[_0x6549('0x1f')][_0x6549('0x36')]({'where':{'id':_0x2efad1['params']['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x557b52,null))['then'](function(_0x3dc12c){if(_0x3dc12c){return _0x3dc12c['removeUsers'](_0x2efad1[_0x6549('0x24')][_0x6549('0x44')])[_0x6549('0x14')](function(){if(_[_0x6549('0x46')](_0x2efad1[_0x6549('0x24')][_0x6549('0x44')])){for(var _0x3b01d9=0x0;_0x3b01d9<_0x2efad1[_0x6549('0x24')][_0x6549('0x44')][_0x6549('0x28')];_0x3b01d9+=0x1){socket[_0x6549('0x47')](_0x6549('0x48'),{'UserId':Number(_0x2efad1[_0x6549('0x24')][_0x6549('0x44')][_0x3b01d9]),'SquareProjectId':Number(_0x2efad1['params']['id'])});}}else{socket[_0x6549('0x47')](_0x6549('0x48'),{'UserId':Number(_0x2efad1['query'][_0x6549('0x44')]),'SquareProjectId':Number(_0x2efad1[_0x6549('0x3f')]['id'])});}});}})[_0x6549('0x14')](respondWithStatusCode(_0x557b52,null))[_0x6549('0x34')](handleError(_0x557b52,null));};exports['getUsers']=function(_0x6ff64d,_0x28ff2e){var _0x19c9bd={};var _0x20e39b={};var _0x53d016;var _0x395039;return db['SquareProject'][_0x6549('0x49')]({'where':{'id':_0x6ff64d[_0x6549('0x3f')]['id']}})[_0x6549('0x14')](handleEntityNotFound(_0x28ff2e,null))[_0x6549('0x14')](function(_0x179dd7){if(_0x179dd7){_0x53d016=_0x179dd7;_0x20e39b[_0x6549('0x23')]=_[_0x6549('0x35')](db[_0x6549('0x4a')][_0x6549('0x20')]);_0x20e39b[_0x6549('0x24')]=_['keys'](_0x6ff64d[_0x6549('0x24')]);_0x20e39b[_0x6549('0x2d')]=_[_0x6549('0x25')](_0x20e39b[_0x6549('0x23')],_0x20e39b[_0x6549('0x24')]);_0x19c9bd[_0x6549('0x26')]=_['intersection'](_0x20e39b['model'],qs[_0x6549('0x27')](_0x6ff64d[_0x6549('0x24')][_0x6549('0x27')]));_0x19c9bd['attributes']=_0x19c9bd[_0x6549('0x26')][_0x6549('0x28')]?_0x19c9bd['attributes']:_0x20e39b[_0x6549('0x23')];_0x19c9bd[_0x6549('0x4b')]=qs[_0x6549('0x2b')](_0x6ff64d[_0x6549('0x24')][_0x6549('0x2b')]);_0x19c9bd[_0x6549('0x2c')]=qs[_0x6549('0x2d')](_[_0x6549('0x41')](_0x6ff64d['query'],_0x20e39b[_0x6549('0x2d')]));if(_0x6ff64d['query'][_0x6549('0x2f')]){_0x19c9bd[_0x6549('0x2c')]=_['merge'](_0x19c9bd[_0x6549('0x2c')],{'$or':_[_0x6549('0x1e')](_0x19c9bd[_0x6549('0x26')],function(_0x5f3873){var _0xaf4ef3={};_0xaf4ef3[_0x5f3873]={'$like':'%'+_0x6ff64d[_0x6549('0x24')][_0x6549('0x2f')]+'%'};return _0xaf4ef3;})});}_0x19c9bd=_[_0x6549('0x2e')]({},_0x19c9bd,_0x6ff64d[_0x6549('0x30')]);return _0x53d016[_0x6549('0x4c')](_0x19c9bd);}})['then'](function(_0x384237){if(_0x384237){_0x395039=_0x384237[_0x6549('0x28')];if(!_0x6ff64d[_0x6549('0x24')]['hasOwnProperty']('nolimit')){_0x19c9bd['limit']=qs[_0x6549('0x11')](_0x6ff64d[_0x6549('0x24')][_0x6549('0x11')]);_0x19c9bd['offset']=qs['offset'](_0x6ff64d[_0x6549('0x24')]['offset']);}return _0x53d016[_0x6549('0x4c')](_0x19c9bd);}})[_0x6549('0x14')](function(_0xcba9e1){if(_0xcba9e1){return _0xcba9e1?{'count':_0x395039,'rows':_0xcba9e1}:null;}})[_0x6549('0x14')](respondWithResult(_0x28ff2e,null))[_0x6549('0x34')](handleError(_0x28ff2e,null));}; \ No newline at end of file +var _0x6d38=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','production','addUsers','ids','removeUsers','isArray','userSquareProject:remove','getUsers','findOne','User','rawAttributes','filter','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','redis','localhost','./squareProject.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','then','destroy','get','UserProfileResource','publish','agi','stringify','error','name','send','index','SquareProject','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SquareProjects','userProfileId'];(function(_0x472516,_0x507cad){var _0x3819c0=function(_0x6482e5){while(--_0x6482e5){_0x472516['push'](_0x472516['shift']());}};_0x3819c0(++_0x507cad);}(_0x6d38,0x1ef));var _0x86d3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6d38[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var Redis=require(_0x86d3('0x0'));var qs=require(_0x86d3('0x1'));var logger=require(_0x86d3('0x2'))('api');var config=require('../../config/environment');var db=require(_0x86d3('0x3'))['db'];config['redis']=_[_0x86d3('0x4')](config[_0x86d3('0x5')],{'host':_0x86d3('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86d3('0x5')]));require(_0x86d3('0x7'))[_0x86d3('0x8')](socket);function respondWithStatusCode(_0x2eaa15,_0x47e654){_0x47e654=_0x47e654||0xcc;return function(_0x552b07){if(_0x552b07){return _0x2eaa15[_0x86d3('0x9')](_0x47e654);}return _0x2eaa15[_0x86d3('0xa')](_0x47e654)[_0x86d3('0xb')]();};}function respondWithResult(_0x499640,_0x4a277e){_0x4a277e=_0x4a277e||0xc8;return function(_0x3ed317){if(_0x3ed317){return _0x499640[_0x86d3('0xa')](_0x4a277e)['json'](_0x3ed317);}};}function respondWithFilteredResult(_0x5606eb,_0x4300e2){return function(_0x4dc834){if(_0x4dc834){var _0x4f216c=typeof _0x4300e2[_0x86d3('0xc')]==='undefined'&&typeof _0x4300e2[_0x86d3('0xd')]===_0x86d3('0xe');var _0x440a55=_0x4dc834[_0x86d3('0xf')];var _0xe1b3d7=_0x4f216c?0x0:_0x4300e2[_0x86d3('0xc')];var _0xbbca86=_0x4f216c?_0x4dc834[_0x86d3('0xf')]:_0x4300e2['offset']+_0x4300e2[_0x86d3('0xd')];var _0x1f35cf;if(_0xbbca86>=_0x440a55){_0xbbca86=_0x440a55;_0x1f35cf=0xc8;}else{_0x1f35cf=0xce;}_0x5606eb[_0x86d3('0xa')](_0x1f35cf);return _0x5606eb[_0x86d3('0x10')](_0x86d3('0x11'),_0xe1b3d7+'-'+_0xbbca86+'/'+_0x440a55)[_0x86d3('0x12')](_0x4dc834);}return null;};}function saveUpdates(_0x1ff008){return function(_0x44436d){if(_0x44436d){return _0x44436d['update'](_0x1ff008)[_0x86d3('0x13')](function(_0x281da0){return _0x281da0;});}return null;};}function removeEntity(_0x431b3f){return function(_0xa26ea2){if(_0xa26ea2){return _0xa26ea2[_0x86d3('0x14')]()[_0x86d3('0x13')](function(){var _0x33e459=_0xa26ea2[_0x86d3('0x15')]({'plain':!![]});var _0x9b76f2='SquareProjects';return db[_0x86d3('0x16')]['destroy']({'where':{'type':_0x9b76f2,'resourceId':_0x33e459['id']}})[_0x86d3('0x13')](function(){return _0xa26ea2;});})['then'](function(){var _0x52293e=new Redis(config[_0x86d3('0x5')]);_0x52293e[_0x86d3('0x17')](_0x86d3('0x18'),JSON[_0x86d3('0x19')]({'id':_0xa26ea2['id'],'deleted':!![]}));})['then'](function(){_0x431b3f[_0x86d3('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e0fa){return function(_0x3fdf67){if(!_0x3fdf67){_0x36e0fa[_0x86d3('0x9')](0x194);}return _0x3fdf67;};}function handleError(_0x5b990d,_0x39d819){_0x39d819=_0x39d819||0x1f4;return function(_0x72b3d4){logger[_0x86d3('0x1a')](_0x72b3d4['stack']);if(_0x72b3d4['name']){delete _0x72b3d4[_0x86d3('0x1b')];}_0x5b990d['status'](_0x39d819)[_0x86d3('0x1c')](_0x72b3d4);};}exports[_0x86d3('0x1d')]=function(_0x3dfecd,_0x3c5fe4){var _0x48b3ff={},_0x481077={},_0x3359e4={'count':0x0,'rows':[]};var _0x611764=_['map'](db[_0x86d3('0x1e')]['rawAttributes'],function(_0x42413c){return{'name':_0x42413c[_0x86d3('0x1f')],'type':_0x42413c[_0x86d3('0x20')][_0x86d3('0x21')]};});_0x481077[_0x86d3('0x22')]=_[_0x86d3('0x23')](_0x611764,_0x86d3('0x1b'));_0x481077[_0x86d3('0x24')]=_[_0x86d3('0x25')](_0x3dfecd[_0x86d3('0x24')]);_0x481077[_0x86d3('0x26')]=_[_0x86d3('0x27')](_0x481077[_0x86d3('0x22')],_0x481077[_0x86d3('0x24')]);_0x48b3ff['attributes']=_[_0x86d3('0x27')](_0x481077[_0x86d3('0x22')],qs[_0x86d3('0x28')](_0x3dfecd[_0x86d3('0x24')][_0x86d3('0x28')]));_0x48b3ff[_0x86d3('0x29')]=_0x48b3ff['attributes'][_0x86d3('0x2a')]?_0x48b3ff['attributes']:_0x481077['model'];if(!_0x3dfecd[_0x86d3('0x24')][_0x86d3('0x2b')](_0x86d3('0x2c'))){_0x48b3ff['limit']=qs[_0x86d3('0xd')](_0x3dfecd[_0x86d3('0x24')]['limit']);_0x48b3ff[_0x86d3('0xc')]=qs[_0x86d3('0xc')](_0x3dfecd[_0x86d3('0x24')][_0x86d3('0xc')]);}_0x48b3ff[_0x86d3('0x2d')]=qs[_0x86d3('0x2e')](_0x3dfecd[_0x86d3('0x24')][_0x86d3('0x2e')]);_0x48b3ff['where']=qs['filters'](_['pick'](_0x3dfecd[_0x86d3('0x24')],_0x481077['filters']),_0x611764);if(_0x3dfecd[_0x86d3('0x24')]['filter']){_0x48b3ff[_0x86d3('0x2f')]=_[_0x86d3('0x30')](_0x48b3ff[_0x86d3('0x2f')],{'$or':_[_0x86d3('0x23')](_0x611764,function(_0x1e22c2){if(_0x1e22c2[_0x86d3('0x20')]!==_0x86d3('0x31')){var _0x4f5875={};_0x4f5875[_0x1e22c2[_0x86d3('0x1b')]]={'$like':'%'+_0x3dfecd[_0x86d3('0x24')]['filter']+'%'};return _0x4f5875;}})});}_0x48b3ff=_[_0x86d3('0x30')]({},_0x48b3ff,_0x3dfecd[_0x86d3('0x32')]);var _0x3ff0fd={'where':_0x48b3ff[_0x86d3('0x2f')]};return db['SquareProject'][_0x86d3('0xf')](_0x3ff0fd)[_0x86d3('0x13')](function(_0x2e01ff){_0x3359e4['count']=_0x2e01ff;if(_0x3dfecd[_0x86d3('0x24')][_0x86d3('0x33')]){_0x48b3ff[_0x86d3('0x34')]=[{'all':!![]}];}return db[_0x86d3('0x1e')][_0x86d3('0x35')](_0x48b3ff);})[_0x86d3('0x13')](function(_0x3666fc){_0x3359e4[_0x86d3('0x36')]=_0x3666fc;return _0x3359e4;})['then'](respondWithFilteredResult(_0x3c5fe4,_0x48b3ff))[_0x86d3('0x37')](handleError(_0x3c5fe4,null));};exports[_0x86d3('0x38')]=function(_0x2bdc67,_0x461052){var _0x5ebb4d={'raw':![],'where':{'id':_0x2bdc67[_0x86d3('0x39')]['id']}},_0x1231ee={};_0x1231ee[_0x86d3('0x22')]=_[_0x86d3('0x25')](db['SquareProject']['rawAttributes']);_0x1231ee[_0x86d3('0x24')]=_['keys'](_0x2bdc67['query']);_0x1231ee[_0x86d3('0x26')]=_[_0x86d3('0x27')](_0x1231ee[_0x86d3('0x22')],_0x1231ee[_0x86d3('0x24')]);_0x5ebb4d[_0x86d3('0x29')]=_['intersection'](_0x1231ee[_0x86d3('0x22')],qs[_0x86d3('0x28')](_0x2bdc67[_0x86d3('0x24')]['fields']));_0x5ebb4d[_0x86d3('0x29')]=_0x5ebb4d[_0x86d3('0x29')]['length']?_0x5ebb4d[_0x86d3('0x29')]:_0x1231ee[_0x86d3('0x22')];if(_0x2bdc67['query']['includeAll']){_0x5ebb4d['include']=[{'all':!![]}];}_0x5ebb4d=_[_0x86d3('0x30')]({},_0x5ebb4d,_0x2bdc67[_0x86d3('0x32')]);return db[_0x86d3('0x1e')][_0x86d3('0x3a')](_0x5ebb4d)[_0x86d3('0x13')](handleEntityNotFound(_0x461052,null))[_0x86d3('0x13')](respondWithResult(_0x461052,null))['catch'](handleError(_0x461052,null));};exports[_0x86d3('0x3b')]=function(_0x879842,_0x5d9dad){return db[_0x86d3('0x1e')][_0x86d3('0x3b')](_0x879842[_0x86d3('0x3c')],{})[_0x86d3('0x13')](function(_0x45db98){var _0x25c253=_0x879842['user'][_0x86d3('0x15')]({'plain':!![]});if(!_0x25c253)throw new Error(_0x86d3('0x3d'));if(_0x25c253['role']===_0x86d3('0x3e')){var _0x412d0e=_0x45db98[_0x86d3('0x15')]({'plain':!![]});var _0x390f23=_0x86d3('0x3f');return db['UserProfileSection'][_0x86d3('0x3a')]({'where':{'name':_0x390f23,'userProfileId':_0x25c253[_0x86d3('0x40')]},'raw':!![]})[_0x86d3('0x13')](function(_0x14fa58){if(_0x14fa58&&_0x14fa58[_0x86d3('0x41')]===0x0){return db[_0x86d3('0x16')][_0x86d3('0x3b')]({'name':_0x412d0e[_0x86d3('0x1b')],'resourceId':_0x412d0e['id'],'type':_0x14fa58[_0x86d3('0x1b')],'sectionId':_0x14fa58['id']},{})[_0x86d3('0x13')](function(){return _0x45db98;});}else{return _0x45db98;}})[_0x86d3('0x37')](function(_0x1236ea){logger['error'](_0x86d3('0x42'),_0x1236ea);throw _0x1236ea;});}return _0x45db98;})[_0x86d3('0x13')](respondWithResult(_0x5d9dad,0xc9))['catch'](handleError(_0x5d9dad,null));};exports[_0x86d3('0x43')]=function(_0x23a6ee,_0x197047){if(_0x23a6ee[_0x86d3('0x3c')]['id']){delete _0x23a6ee[_0x86d3('0x3c')]['id'];}return db[_0x86d3('0x1e')]['find']({'where':{'id':_0x23a6ee['params']['id']}})['then'](handleEntityNotFound(_0x197047,null))['then'](saveUpdates(_0x23a6ee[_0x86d3('0x3c')],null))[_0x86d3('0x13')](function(_0x2ca2a4){if(!_0x2ca2a4)return;var _0x123a8e=_0x2ca2a4[_0x86d3('0x15')]({'plain':!![]});return _0x123a8e;})[_0x86d3('0x13')](function(_0x24d59e){var _0x4c0509=new Redis(config[_0x86d3('0x5')]);_0x4c0509[_0x86d3('0x17')](_0x86d3('0x18'),JSON[_0x86d3('0x19')](_[_0x86d3('0x44')](_0x24d59e,['id',_0x86d3('0x1b'),_0x86d3('0x45')])));return _0x24d59e;})['then'](respondWithResult(_0x197047,null))[_0x86d3('0x37')](handleError(_0x197047,null));};exports['destroy']=function(_0x1f3c25,_0x43dc47){return db[_0x86d3('0x1e')][_0x86d3('0x3a')]({'where':{'id':_0x1f3c25[_0x86d3('0x39')]['id']}})['then'](handleEntityNotFound(_0x43dc47,null))[_0x86d3('0x13')](removeEntity(_0x43dc47,null))[_0x86d3('0x37')](handleError(_0x43dc47,null));};exports[_0x86d3('0x46')]=function(_0x4e10d9,_0x4ad164){return db['SquareProject'][_0x86d3('0x3a')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x13')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x13')](function(_0x1fbd25){if(_0x1fbd25){return _0x1fbd25[_0x86d3('0x46')](_0x4e10d9['body']['ids'],_['omit'](_0x4e10d9[_0x86d3('0x3c')],[_0x86d3('0x47'),'id'])||{});}})['then'](respondWithResult(_0x4ad164,null))[_0x86d3('0x37')](handleError(_0x4ad164,null));};exports[_0x86d3('0x48')]=function(_0xa085b2,_0x4584e5){return db[_0x86d3('0x1e')]['find']({'where':{'id':_0xa085b2[_0x86d3('0x39')]['id']}})[_0x86d3('0x13')](handleEntityNotFound(_0x4584e5,null))[_0x86d3('0x13')](function(_0x3c038b){if(_0x3c038b){return _0x3c038b['removeUsers'](_0xa085b2[_0x86d3('0x24')][_0x86d3('0x47')])['then'](function(){if(_[_0x86d3('0x49')](_0xa085b2[_0x86d3('0x24')][_0x86d3('0x47')])){for(var _0x29bdee=0x0;_0x29bdee<_0xa085b2[_0x86d3('0x24')][_0x86d3('0x47')][_0x86d3('0x2a')];_0x29bdee+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0xa085b2[_0x86d3('0x24')]['ids'][_0x29bdee]),'SquareProjectId':Number(_0xa085b2['params']['id'])});}}else{socket['emit'](_0x86d3('0x4a'),{'UserId':Number(_0xa085b2['query'][_0x86d3('0x47')]),'SquareProjectId':Number(_0xa085b2['params']['id'])});}});}})[_0x86d3('0x13')](respondWithStatusCode(_0x4584e5,null))[_0x86d3('0x37')](handleError(_0x4584e5,null));};exports[_0x86d3('0x4b')]=function(_0x4797b5,_0x4c3e66){var _0x4639bb={};var _0xf2c179={};var _0x1864bd;var _0x202c2a;return db[_0x86d3('0x1e')][_0x86d3('0x4c')]({'where':{'id':_0x4797b5[_0x86d3('0x39')]['id']}})[_0x86d3('0x13')](handleEntityNotFound(_0x4c3e66,null))[_0x86d3('0x13')](function(_0x1285a4){if(_0x1285a4){_0x1864bd=_0x1285a4;_0xf2c179[_0x86d3('0x22')]=_[_0x86d3('0x25')](db[_0x86d3('0x4d')][_0x86d3('0x4e')]);_0xf2c179[_0x86d3('0x24')]=_[_0x86d3('0x25')](_0x4797b5[_0x86d3('0x24')]);_0xf2c179[_0x86d3('0x26')]=_['intersection'](_0xf2c179[_0x86d3('0x22')],_0xf2c179[_0x86d3('0x24')]);_0x4639bb[_0x86d3('0x29')]=_['intersection'](_0xf2c179[_0x86d3('0x22')],qs[_0x86d3('0x28')](_0x4797b5[_0x86d3('0x24')][_0x86d3('0x28')]));_0x4639bb['attributes']=_0x4639bb[_0x86d3('0x29')]['length']?_0x4639bb[_0x86d3('0x29')]:_0xf2c179[_0x86d3('0x22')];_0x4639bb[_0x86d3('0x2d')]=qs[_0x86d3('0x2e')](_0x4797b5[_0x86d3('0x24')]['sort']);_0x4639bb[_0x86d3('0x2f')]=qs['filters'](_[_0x86d3('0x44')](_0x4797b5[_0x86d3('0x24')],_0xf2c179['filters']));if(_0x4797b5[_0x86d3('0x24')][_0x86d3('0x4f')]){_0x4639bb[_0x86d3('0x2f')]=_[_0x86d3('0x30')](_0x4639bb[_0x86d3('0x2f')],{'$or':_[_0x86d3('0x23')](_0x4639bb[_0x86d3('0x29')],function(_0x5ee4a3){var _0x19f9e1={};_0x19f9e1[_0x5ee4a3]={'$like':'%'+_0x4797b5[_0x86d3('0x24')][_0x86d3('0x4f')]+'%'};return _0x19f9e1;})});}_0x4639bb=_[_0x86d3('0x30')]({},_0x4639bb,_0x4797b5[_0x86d3('0x32')]);return _0x1864bd['getUsers'](_0x4639bb);}})[_0x86d3('0x13')](function(_0x9444e5){if(_0x9444e5){_0x202c2a=_0x9444e5['length'];if(!_0x4797b5[_0x86d3('0x24')][_0x86d3('0x2b')](_0x86d3('0x2c'))){_0x4639bb[_0x86d3('0xd')]=qs[_0x86d3('0xd')](_0x4797b5[_0x86d3('0x24')][_0x86d3('0xd')]);_0x4639bb[_0x86d3('0xc')]=qs[_0x86d3('0xc')](_0x4797b5[_0x86d3('0x24')][_0x86d3('0xc')]);}return _0x1864bd[_0x86d3('0x4b')](_0x4639bb);}})[_0x86d3('0x13')](function(_0xab8a80){if(_0xab8a80){return _0xab8a80?{'count':_0x202c2a,'rows':_0xab8a80}:null;}})['then'](respondWithResult(_0x4c3e66,null))[_0x86d3('0x37')](handleError(_0x4c3e66,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 406b4ae..5532f2f 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 _0xd17f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject'];(function(_0x4dd3f5,_0x79130){var _0x2757f1=function(_0x74170c){while(--_0x74170c){_0x4dd3f5['push'](_0x4dd3f5['shift']());}};_0x2757f1(++_0x79130);}(_0xd17f,0x129));var _0xfd17=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd17f[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0xfd17('0x0'));var SquareProject=require(_0xfd17('0x1'))['db'][_0xfd17('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xfd17('0x3')](0x0);var events={'afterCreate':_0xfd17('0x4'),'afterUpdate':_0xfd17('0x5'),'afterDestroy':_0xfd17('0x6')};function emitEvent(_0x5ec7b6){return function(_0x47381a,_0x517386,_0x300704){SquareProjectEvents[_0xfd17('0x7')](_0x5ec7b6+':'+_0x47381a['id'],_0x47381a);SquareProjectEvents[_0xfd17('0x7')](_0x5ec7b6,_0x47381a);_0x300704(null);};}for(var e in events){if(events[_0xfd17('0x8')](e)){var event=events[e];SquareProject[_0xfd17('0x9')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x176e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x6646f8,_0x4cddb3){var _0x9973c8=function(_0x3f5c16){while(--_0x3f5c16){_0x6646f8['push'](_0x6646f8['shift']());}};_0x9973c8(++_0x4cddb3);}(_0x176e,0x8f));var _0xe176=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x176e[_0x2b10c6];return _0x3789d2;};'use strict';var EventEmitter=require(_0xe176('0x0'));var SquareProject=require(_0xe176('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe176('0x2')](0x0);var events={'afterCreate':_0xe176('0x3'),'afterUpdate':_0xe176('0x4'),'afterDestroy':_0xe176('0x5')};function emitEvent(_0x36f6d5){return function(_0x2e5c2a,_0x483f4d,_0x416222){SquareProjectEvents[_0xe176('0x6')](_0x36f6d5+':'+_0x2e5c2a['id'],_0x2e5c2a);SquareProjectEvents[_0xe176('0x6')](_0x36f6d5,_0x2e5c2a);_0x416222(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xe176('0x7')](e,emitEvent(event));}}module[_0xe176('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 44d919b..7c9cdab 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 _0xb9cf=['publishedAt','lodash','util','../../config/logger','moment','path','rimraf','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x3405ba,_0x10b568){var _0x3c4ce4=function(_0x37a551){while(--_0x37a551){_0x3405ba['push'](_0x3405ba['shift']());}};_0x3c4ce4(++_0x10b568);}(_0xb9cf,0x89));var _0xfb9c=function(_0x5cf5c2,_0x4fa1c7){_0x5cf5c2=_0x5cf5c2-0x0;var _0x1713fe=_0xb9cf[_0x5cf5c2];return _0x1713fe;};'use strict';var _=require(_0xfb9c('0x0'));var util=require(_0xfb9c('0x1'));var logger=require(_0xfb9c('0x2'))('api');var moment=require(_0xfb9c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb9c('0x4'));var rimraf=require(_0xfb9c('0x5'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xfb9c('0x6')]=function(_0x4a6ab4,_0x1f7ad7){return _0x4a6ab4[_0xfb9c('0x7')](_0xfb9c('0x8'),attributes,{'tableName':_0xfb9c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42ed38,_0x587ea9,_0x551d02){if(_0x42ed38[_0xfb9c('0xa')](_0xfb9c('0xb'))){_0x42ed38[_0xfb9c('0xc')]=moment()[_0xfb9c('0xd')](_0xfb9c('0xe'));}if(_0x42ed38[_0xfb9c('0xa')](_0xfb9c('0xf'))){_0x42ed38[_0xfb9c('0x10')]=moment()[_0xfb9c('0xd')](_0xfb9c('0xe'));}_0x551d02(null,_0x42ed38);}}});}; \ No newline at end of file +var _0x90bf=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash'];(function(_0x29c8db,_0x530f96){var _0x47a251=function(_0x2825a5){while(--_0x2825a5){_0x29c8db['push'](_0x29c8db['shift']());}};_0x47a251(++_0x530f96);}(_0x90bf,0x153));var _0xf90b=function(_0x5d0031,_0x3314fa){_0x5d0031=_0x5d0031-0x0;var _0x5c5468=_0x90bf[_0x5d0031];return _0x5c5468;};'use strict';var _=require(_0xf90b('0x0'));var util=require('util');var logger=require(_0xf90b('0x1'))(_0xf90b('0x2'));var moment=require(_0xf90b('0x3'));var BPromise=require(_0xf90b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf90b('0x5'));var config=require(_0xf90b('0x6'));var attributes=require(_0xf90b('0x7'));module[_0xf90b('0x8')]=function(_0x237004,_0x47e33e){return _0x237004['define']('SquareProject',attributes,{'tableName':_0xf90b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x548951,_0x366f42,_0x2353a6){if(_0x548951[_0xf90b('0xa')](_0xf90b('0xb'))){_0x548951[_0xf90b('0xc')]=moment()[_0xf90b('0xd')](_0xf90b('0xe'));}if(_0x548951[_0xf90b('0xa')](_0xf90b('0xf'))){_0x548951[_0xf90b('0x10')]=moment()[_0xf90b('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2353a6(null,_0x548951);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index fa2dedb..c98b67d 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 _0xb1a3=['rpc','../../config/environment','redis','localhost','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','include','map','model','then','debug','catch','error','message','info','ShowSquareProject','stringify','lodash'];(function(_0x5ddbc1,_0x426789){var _0x285f68=function(_0x4ef410){while(--_0x4ef410){_0x5ddbc1['push'](_0x5ddbc1['shift']());}};_0x285f68(++_0x426789);}(_0xb1a3,0x1cb));var _0x3b1a=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb1a3[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x3b1a('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x3b1a('0x1'));var config=require(_0x3b1a('0x2'));config[_0x3b1a('0x3')]=_['defaults'](config[_0x3b1a('0x3')],{'host':_0x3b1a('0x4'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b1a('0x3')]));require('./squareProject.socket')['register'](socket);exports[_0x3b1a('0x5')]=function(_0x5c7e9d){var _0x1997bf=this;return new Promise(function(_0x2a7a43,_0x476ff0){return db[_0x3b1a('0x6')][_0x3b1a('0x7')]({'raw':_0x5c7e9d[_0x3b1a('0x8')]?_0x5c7e9d[_0x3b1a('0x8')][_0x3b1a('0x9')]===undefined?!![]:![]:!![],'where':_0x5c7e9d[_0x3b1a('0x8')]?_0x5c7e9d[_0x3b1a('0x8')][_0x3b1a('0xa')]||null:null,'attributes':_0x5c7e9d[_0x3b1a('0x8')]?_0x5c7e9d['options'][_0x3b1a('0xb')]||null:null,'limit':_0x5c7e9d['options']?_0x5c7e9d[_0x3b1a('0x8')]['limit']||null:null,'include':_0x5c7e9d['options']?_0x5c7e9d[_0x3b1a('0x8')][_0x3b1a('0xc')]?_[_0x3b1a('0xd')](_0x5c7e9d[_0x3b1a('0x8')][_0x3b1a('0xc')],function(_0x3722a0){return{'model':db[_0x3722a0['model']],'as':_0x3722a0['as'],'attributes':_0x3722a0[_0x3b1a('0xb')],'include':_0x3722a0[_0x3b1a('0xc')]?_[_0x3b1a('0xd')](_0x3722a0[_0x3b1a('0xc')],function(_0x4ad23e){return{'model':db[_0x4ad23e[_0x3b1a('0xe')]],'as':_0x4ad23e['as'],'attributes':_0x4ad23e['attributes'],'include':_0x4ad23e[_0x3b1a('0xc')]?_[_0x3b1a('0xd')](_0x4ad23e['include'],function(_0x510c6f){return{'model':db[_0x510c6f[_0x3b1a('0xe')]],'as':_0x510c6f['as'],'attributes':_0x510c6f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b1a('0xf')](function(_0x13e1b1){logger['info'](_0x3b1a('0x5'),_0x5c7e9d);logger[_0x3b1a('0x10')](_0x3b1a('0x5'),_0x5c7e9d,JSON['stringify'](_0x13e1b1));_0x2a7a43(_0x13e1b1);})[_0x3b1a('0x11')](function(_0x1e477f){logger[_0x3b1a('0x12')](_0x3b1a('0x5'),_0x1e477f[_0x3b1a('0x13')],_0x5c7e9d);_0x476ff0(_0x1997bf[_0x3b1a('0x12')](0x1f4,_0x1e477f[_0x3b1a('0x13')]));});});};exports['ShowSquareProject']=function(_0x37d01e){var _0x4cee2e=this;return new Promise(function(_0x5cef2e,_0x4fa08b){return db['SquareProject']['find']({'raw':_0x37d01e[_0x3b1a('0x8')]?_0x37d01e[_0x3b1a('0x8')][_0x3b1a('0x9')]===undefined?!![]:![]:!![],'where':_0x37d01e[_0x3b1a('0x8')]?_0x37d01e[_0x3b1a('0x8')]['where']||null:null,'attributes':_0x37d01e[_0x3b1a('0x8')]?_0x37d01e[_0x3b1a('0x8')][_0x3b1a('0xb')]||null:null,'include':_0x37d01e[_0x3b1a('0x8')]?_0x37d01e['options'][_0x3b1a('0xc')]?_[_0x3b1a('0xd')](_0x37d01e[_0x3b1a('0x8')][_0x3b1a('0xc')],function(_0x540b2d){return{'model':db[_0x540b2d[_0x3b1a('0xe')]],'as':_0x540b2d['as'],'attributes':_0x540b2d[_0x3b1a('0xb')],'include':_0x540b2d[_0x3b1a('0xc')]?_[_0x3b1a('0xd')](_0x540b2d['include'],function(_0x1bdf76){return{'model':db[_0x1bdf76[_0x3b1a('0xe')]],'as':_0x1bdf76['as'],'attributes':_0x1bdf76[_0x3b1a('0xb')],'include':_0x1bdf76[_0x3b1a('0xc')]?_[_0x3b1a('0xd')](_0x1bdf76['include'],function(_0xe56f32){return{'model':db[_0xe56f32[_0x3b1a('0xe')]],'as':_0xe56f32['as'],'attributes':_0xe56f32[_0x3b1a('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x426619){logger[_0x3b1a('0x14')](_0x3b1a('0x15'),_0x37d01e);logger[_0x3b1a('0x10')]('ShowSquareProject',_0x37d01e,JSON[_0x3b1a('0x16')](_0x426619));_0x5cef2e(_0x426619);})['catch'](function(_0x39d199){logger[_0x3b1a('0x12')](_0x3b1a('0x15'),_0x39d199[_0x3b1a('0x13')],_0x37d01e);_0x4fa08b(_0x4cee2e[_0x3b1a('0x12')](0x1f4,_0x39d199[_0x3b1a('0x13')]));});});}; \ No newline at end of file +var _0xa2cf=['stringify','catch','message','error','find','then','ShowSquareProject','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model','info','GetSquareProjects','debug'];(function(_0x32a9a2,_0x2ad91e){var _0x4140de=function(_0x224f55){while(--_0x224f55){_0x32a9a2['push'](_0x32a9a2['shift']());}};_0x4140de(++_0x2ad91e);}(_0xa2cf,0x7b));var _0xfa2c=function(_0x5d444c,_0x3470f1){_0x5d444c=_0x5d444c-0x0;var _0x1d3899=_0xa2cf[_0x5d444c];return _0x1d3899;};'use strict';var _=require('lodash');var Redis=require(_0xfa2c('0x0'));var db=require(_0xfa2c('0x1'))['db'];var logger=require(_0xfa2c('0x2'))(_0xfa2c('0x3'));var config=require(_0xfa2c('0x4'));config[_0xfa2c('0x5')]=_['defaults'](config[_0xfa2c('0x5')],{'host':_0xfa2c('0x6'),'port':0x18eb});var socket=require(_0xfa2c('0x7'))(new Redis(config['redis']));require(_0xfa2c('0x8'))['register'](socket);exports['GetSquareProjects']=function(_0x557818){var _0x1f1c6d=this;return new Promise(function(_0x3ee4c5,_0xd8f300){return db[_0xfa2c('0x9')][_0xfa2c('0xa')]({'raw':_0x557818[_0xfa2c('0xb')]?_0x557818[_0xfa2c('0xb')][_0xfa2c('0xc')]===undefined?!![]:![]:!![],'where':_0x557818[_0xfa2c('0xb')]?_0x557818['options'][_0xfa2c('0xd')]||null:null,'attributes':_0x557818[_0xfa2c('0xb')]?_0x557818[_0xfa2c('0xb')][_0xfa2c('0xe')]||null:null,'limit':_0x557818['options']?_0x557818[_0xfa2c('0xb')][_0xfa2c('0xf')]||null:null,'include':_0x557818[_0xfa2c('0xb')]?_0x557818[_0xfa2c('0xb')][_0xfa2c('0x10')]?_[_0xfa2c('0x11')](_0x557818[_0xfa2c('0xb')][_0xfa2c('0x10')],function(_0x57544f){return{'model':db[_0x57544f['model']],'as':_0x57544f['as'],'attributes':_0x57544f[_0xfa2c('0xe')],'include':_0x57544f['include']?_[_0xfa2c('0x11')](_0x57544f[_0xfa2c('0x10')],function(_0x4fce5c){return{'model':db[_0x4fce5c[_0xfa2c('0x12')]],'as':_0x4fce5c['as'],'attributes':_0x4fce5c['attributes'],'include':_0x4fce5c[_0xfa2c('0x10')]?_[_0xfa2c('0x11')](_0x4fce5c[_0xfa2c('0x10')],function(_0x336e93){return{'model':db[_0x336e93[_0xfa2c('0x12')]],'as':_0x336e93['as'],'attributes':_0x336e93[_0xfa2c('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14f617){logger[_0xfa2c('0x13')](_0xfa2c('0x14'),_0x557818);logger[_0xfa2c('0x15')](_0xfa2c('0x14'),_0x557818,JSON[_0xfa2c('0x16')](_0x14f617));_0x3ee4c5(_0x14f617);})[_0xfa2c('0x17')](function(_0x4d8337){logger['error'](_0xfa2c('0x14'),_0x4d8337[_0xfa2c('0x18')],_0x557818);_0xd8f300(_0x1f1c6d[_0xfa2c('0x19')](0x1f4,_0x4d8337[_0xfa2c('0x18')]));});});};exports['ShowSquareProject']=function(_0x2ab409){var _0x2530bd=this;return new Promise(function(_0x578d37,_0x7ee1cf){return db[_0xfa2c('0x9')][_0xfa2c('0x1a')]({'raw':_0x2ab409['options']?_0x2ab409['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ab409[_0xfa2c('0xb')]?_0x2ab409['options'][_0xfa2c('0xd')]||null:null,'attributes':_0x2ab409['options']?_0x2ab409[_0xfa2c('0xb')]['attributes']||null:null,'include':_0x2ab409[_0xfa2c('0xb')]?_0x2ab409['options'][_0xfa2c('0x10')]?_[_0xfa2c('0x11')](_0x2ab409[_0xfa2c('0xb')]['include'],function(_0x3b8723){return{'model':db[_0x3b8723['model']],'as':_0x3b8723['as'],'attributes':_0x3b8723['attributes'],'include':_0x3b8723['include']?_[_0xfa2c('0x11')](_0x3b8723[_0xfa2c('0x10')],function(_0x24f987){return{'model':db[_0x24f987[_0xfa2c('0x12')]],'as':_0x24f987['as'],'attributes':_0x24f987[_0xfa2c('0xe')],'include':_0x24f987[_0xfa2c('0x10')]?_[_0xfa2c('0x11')](_0x24f987[_0xfa2c('0x10')],function(_0x3b96ab){return{'model':db[_0x3b96ab[_0xfa2c('0x12')]],'as':_0x3b96ab['as'],'attributes':_0x3b96ab[_0xfa2c('0xe')]};}):[]};}):[]};}):[]:[]})[_0xfa2c('0x1b')](function(_0x548be9){logger[_0xfa2c('0x13')](_0xfa2c('0x1c'),_0x2ab409);logger[_0xfa2c('0x15')](_0xfa2c('0x1c'),_0x2ab409,JSON[_0xfa2c('0x16')](_0x548be9));_0x578d37(_0x548be9);})[_0xfa2c('0x17')](function(_0xc246a){logger[_0xfa2c('0x19')](_0xfa2c('0x1c'),_0xc246a[_0xfa2c('0x18')],_0x2ab409);_0x7ee1cf(_0x2530bd[_0xfa2c('0x19')](0x1f4,_0xc246a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 72e78ca..0389c66 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 _0x5515=['register','./squareProject.events','save','remove','update','emit'];(function(_0x3ef952,_0x1e8528){var _0x27d013=function(_0x3a15ac){while(--_0x3a15ac){_0x3ef952['push'](_0x3ef952['shift']());}};_0x27d013(++_0x1e8528);}(_0x5515,0x175));var _0x5551=function(_0x14348b,_0x103289){_0x14348b=_0x14348b-0x0;var _0x2fa6ff=_0x5515[_0x14348b];return _0x2fa6ff;};'use strict';var SquareProjectEvents=require(_0x5551('0x0'));var events=[_0x5551('0x1'),_0x5551('0x2'),_0x5551('0x3')];function createListener(_0x34a970,_0x2bb36c){return function(_0x5d47b9){_0x2bb36c[_0x5551('0x4')](_0x34a970,_0x5d47b9);};}function removeListener(_0x26d14a,_0x338069){return function(){SquareProjectEvents['removeListener'](_0x26d14a,_0x338069);};}exports[_0x5551('0x5')]=function(_0x358982){for(var _0x1bfaa4=0x0,_0x2fa9db=events['length'];_0x1bfaa4<_0x2fa9db;_0x1bfaa4++){var _0x4cdf69=events[_0x1bfaa4];var _0x4bbe0d=createListener('squareProject:'+_0x4cdf69,_0x358982);SquareProjectEvents['on'](_0x4cdf69,_0x4bbe0d);}}; \ No newline at end of file +var _0xda61=['emit','removeListener','register','squareProject:','./squareProject.events','save','remove','update'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xda61,0x1d4));var _0x1da6=function(_0x26427c,_0x385f09){_0x26427c=_0x26427c-0x0;var _0x40e152=_0xda61[_0x26427c];return _0x40e152;};'use strict';var SquareProjectEvents=require(_0x1da6('0x0'));var events=[_0x1da6('0x1'),_0x1da6('0x2'),_0x1da6('0x3')];function createListener(_0x1b9f74,_0x5f1a53){return function(_0x2ead00){_0x5f1a53[_0x1da6('0x4')](_0x1b9f74,_0x2ead00);};}function removeListener(_0x5ea635,_0x26e16c){return function(){SquareProjectEvents[_0x1da6('0x5')](_0x5ea635,_0x26e16c);};}exports[_0x1da6('0x6')]=function(_0x2a1669){for(var _0x4d83dd=0x0,_0x3c00b6=events['length'];_0x4d83dd<_0x3c00b6;_0x4d83dd++){var _0x3c5d56=events[_0x4d83dd];var _0xbc104a=createListener(_0x1da6('0x7')+_0x3c5d56,_0x2a1669);SquareProjectEvents['on'](_0x3c5d56,_0xbc104a);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 241a4ea..162daeb 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 _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x1d226d,_0x2ccd60){var _0x1b5140=function(_0x6c7c29){while(--_0x6c7c29){_0x1d226d['push'](_0x1d226d['shift']());}};_0x1b5140(++_0x2ccd60);}(_0x1261,0x144));var _0x1126=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x1261[_0x218ca4];return _0x1b3ff9;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=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(_0x4071ac,_0x576967){var _0x5a4ae8=function(_0x6e9d72){while(--_0x6e9d72){_0x4071ac['push'](_0x4071ac['shift']());}};_0x5a4ae8(++_0x576967);}(_0x326f,0xd1));var _0xf326=function(_0x40b62c,_0x5d5a2e){_0x40b62c=_0x40b62c-0x0;var _0x5c138a=_0x326f[_0x40b62c];return _0x5c138a;};'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 6356614..8b82dda 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x2bab95,_0x15f1a8){var _0x5b31cd=function(_0x1fc7ea){while(--_0x1fc7ea){_0x2bab95['push'](_0x2bab95['shift']());}};_0x5b31cd(++_0x15f1a8);}(_0x55ca,0x126));var _0xa55c=function(_0x54a8d3,_0x12b8b7){_0x54a8d3=_0x54a8d3-0x0;var _0x5eec0e=_0x55ca[_0x54a8d3];return _0x5eec0e;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa55c('0x2')]},'extension':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'dnid':{'type':Sequelize[_0xa55c('0x2')]},'projectName':{'type':Sequelize[_0xa55c('0x2')]},'saveName':{'type':Sequelize[_0xa55c('0x2')]},'filename':{'type':Sequelize[_0xa55c('0x2')]},'savePath':{'type':Sequelize[_0xa55c('0x2')]},'format':{'type':Sequelize[_0xa55c('0x3')],'get':function(){var _0x4d0624='';var _0x2121fd=this[_0xa55c('0x4')]('savePath');if(_0x2121fd){_0x4d0624=_0x2121fd[_0xa55c('0x5')](_0x2121fd[_0xa55c('0x6')]('.'));}return _0x4d0624;}}}; \ No newline at end of file +var _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xabce,0x103));var _0xeabc=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xabce[_0x257642];return _0x3d813b;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'uniqueid':{'type':Sequelize[_0xeabc('0x2')]},'callerid':{'type':Sequelize[_0xeabc('0x2')]},'calleridname':{'type':Sequelize[_0xeabc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xeabc('0x2')]},'accountcode':{'type':Sequelize[_0xeabc('0x2')]},'dnid':{'type':Sequelize[_0xeabc('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xeabc('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xeabc('0x3')],'get':function(){var _0x52ede8='';var _0x3bdc29=this[_0xeabc('0x4')](_0xeabc('0x5'));if(_0x3bdc29){_0x52ede8=_0x3bdc29['substring'](_0x3bdc29[_0xeabc('0x6')]('.'));}return _0x52ede8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 770a708..a6c82e5 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 _0x774b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','then','destroy','sendStatus','error','name','send','SquareRecording','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','params','include','find','catch','create','body','update','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','request-promise','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x57d7f7,_0x335c81){var _0x1a6800=function(_0x251345){while(--_0x251345){_0x57d7f7['push'](_0x57d7f7['shift']());}};_0x1a6800(++_0x335c81);}(_0x774b,0x10d));var _0xb774=function(_0x65fe34,_0x21cbe5){_0x65fe34=_0x65fe34-0x0;var _0x249c22=_0x774b[_0x65fe34];return _0x249c22;};'use strict';var emlformat=require(_0xb774('0x0'));var rimraf=require(_0xb774('0x1'));var zipdir=require(_0xb774('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb774('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb774('0x4'));var path=require(_0xb774('0x5'));var sox=require('sox');var csv=require(_0xb774('0x6'));var ejs=require(_0xb774('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb774('0x8'));var squel=require('squel');var crypto=require(_0xb774('0x9'));var jsforce=require(_0xb774('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb774('0x6'));var querystring=require(_0xb774('0xb'));var Papa=require(_0xb774('0xc'));var Redis=require(_0xb774('0xd'));var authService=require(_0xb774('0xe'));var qs=require(_0xb774('0xf'));var as=require(_0xb774('0x10'));var hardwareService=require(_0xb774('0x11'));var logger=require(_0xb774('0x12'))('api');var utils=require(_0xb774('0x13'));var config=require(_0xb774('0x14'));var licenseUtil=require(_0xb774('0x15'));var db=require(_0xb774('0x16'))['db'];function respondWithStatusCode(_0x10c53d,_0x43feb6){_0x43feb6=_0x43feb6||0xcc;return function(_0x2aae0b){if(_0x2aae0b){return _0x10c53d['sendStatus'](_0x43feb6);}return _0x10c53d[_0xb774('0x17')](_0x43feb6)[_0xb774('0x18')]();};}function respondWithResult(_0x53f07b,_0x274c5b){_0x274c5b=_0x274c5b||0xc8;return function(_0x9417ea){if(_0x9417ea){return _0x53f07b['status'](_0x274c5b)['json'](_0x9417ea);}};}function respondWithFilteredResult(_0x286214,_0x155489){return function(_0x11325f){if(_0x11325f){var _0x2edcd4=typeof _0x155489[_0xb774('0x19')]===_0xb774('0x1a')&&typeof _0x155489[_0xb774('0x1b')]===_0xb774('0x1a');var _0x537f04=_0x11325f[_0xb774('0x1c')];var _0x2531f=_0x2edcd4?0x0:_0x155489[_0xb774('0x19')];var _0x4228c4=_0x2edcd4?_0x11325f[_0xb774('0x1c')]:_0x155489[_0xb774('0x19')]+_0x155489['limit'];var _0x2946f8;if(_0x4228c4>=_0x537f04){_0x4228c4=_0x537f04;_0x2946f8=0xc8;}else{_0x2946f8=0xce;}_0x286214[_0xb774('0x17')](_0x2946f8);return _0x286214[_0xb774('0x1d')]('Content-Range',_0x2531f+'-'+_0x4228c4+'/'+_0x537f04)[_0xb774('0x1e')](_0x11325f);}return null;};}function patchUpdates(_0x55f67a){return function(_0x28d6e2){try{jsonpatch[_0xb774('0x1f')](_0x28d6e2,_0x55f67a,!![]);}catch(_0x42154e){return BPromise['reject'](_0x42154e);}return _0x28d6e2['save']();};}function saveUpdates(_0x127cef,_0x1c9f1a){return function(_0x8812ca){if(_0x8812ca){return _0x8812ca['update'](_0x127cef)[_0xb774('0x20')](function(_0x10e530){return _0x10e530;});}return null;};}function removeEntity(_0x18297a,_0x3ff23d){return function(_0x584df6){if(_0x584df6){return _0x584df6[_0xb774('0x21')]()[_0xb774('0x20')](function(){_0x18297a[_0xb774('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eea96,_0x568b60){return function(_0x35d24f){if(!_0x35d24f){_0x2eea96[_0xb774('0x22')](0x194);}return _0x35d24f;};}function handleError(_0x124d1b,_0x420678){_0x420678=_0x420678||0x1f4;return function(_0xd4a60){logger[_0xb774('0x23')](_0xd4a60['stack']);if(_0xd4a60[_0xb774('0x24')]){delete _0xd4a60[_0xb774('0x24')];}_0x124d1b[_0xb774('0x17')](_0x420678)[_0xb774('0x25')](_0xd4a60);};}exports['index']=function(_0x1160b4,_0x42290b){var _0x5bd592={},_0x18161e={},_0x47bfac={'count':0x0,'rows':[]};var _0x510029=_['map'](db[_0xb774('0x26')][_0xb774('0x27')],function(_0x3bb6f6){return{'name':_0x3bb6f6[_0xb774('0x28')],'type':_0x3bb6f6[_0xb774('0x29')][_0xb774('0x2a')]};});_0x18161e[_0xb774('0x2b')]=_[_0xb774('0x2c')](_0x510029,_0xb774('0x24'));_0x18161e['query']=_[_0xb774('0x2d')](_0x1160b4[_0xb774('0x2e')]);_0x18161e['filters']=_[_0xb774('0x2f')](_0x18161e[_0xb774('0x2b')],_0x18161e[_0xb774('0x2e')]);_0x5bd592[_0xb774('0x30')]=_[_0xb774('0x2f')](_0x18161e[_0xb774('0x2b')],qs['fields'](_0x1160b4[_0xb774('0x2e')][_0xb774('0x31')]));_0x5bd592[_0xb774('0x30')]=_0x5bd592[_0xb774('0x30')][_0xb774('0x32')]?_0x5bd592[_0xb774('0x30')]:_0x18161e[_0xb774('0x2b')];if(!_0x1160b4[_0xb774('0x2e')][_0xb774('0x33')](_0xb774('0x34'))){_0x5bd592[_0xb774('0x1b')]=qs[_0xb774('0x1b')](_0x1160b4[_0xb774('0x2e')][_0xb774('0x1b')]);_0x5bd592['offset']=qs[_0xb774('0x19')](_0x1160b4[_0xb774('0x2e')][_0xb774('0x19')]);}_0x5bd592[_0xb774('0x35')]=qs[_0xb774('0x36')](_0x1160b4['query']['sort']);_0x5bd592[_0xb774('0x37')]=qs[_0xb774('0x38')](_[_0xb774('0x39')](_0x1160b4[_0xb774('0x2e')],_0x18161e[_0xb774('0x38')]),_0x510029);if(_0x1160b4[_0xb774('0x2e')][_0xb774('0x3a')]){_0x5bd592[_0xb774('0x37')]=_['merge'](_0x5bd592[_0xb774('0x37')],{'$or':_['map'](_0x510029,function(_0x2bacd5){if(_0x2bacd5['type']!==_0xb774('0x3b')){var _0x516ee5={};_0x516ee5[_0x2bacd5[_0xb774('0x24')]]={'$like':'%'+_0x1160b4[_0xb774('0x2e')][_0xb774('0x3a')]+'%'};return _0x516ee5;}})});}_0x5bd592=_[_0xb774('0x3c')]({},_0x5bd592,_0x1160b4[_0xb774('0x3d')]);var _0x4f268d={'where':_0x5bd592['where']};return db['SquareRecording'][_0xb774('0x1c')](_0x4f268d)['then'](function(_0x5acd2e){_0x47bfac[_0xb774('0x1c')]=_0x5acd2e;if(_0x1160b4['query'][_0xb774('0x3e')]){_0x5bd592['include']=[{'all':!![]}];}return db['SquareRecording'][_0xb774('0x3f')](_0x5bd592);})[_0xb774('0x20')](function(_0xb537bb){_0x47bfac['rows']=_0xb537bb;return _0x47bfac;})[_0xb774('0x20')](respondWithFilteredResult(_0x42290b,_0x5bd592))['catch'](handleError(_0x42290b,null));};exports['show']=function(_0x53c0bb,_0x4516ad){var _0x568d7f={'raw':!![],'where':{'id':_0x53c0bb[_0xb774('0x40')]['id']}},_0x7c3aaa={};_0x7c3aaa[_0xb774('0x2b')]=_[_0xb774('0x2d')](db[_0xb774('0x26')]['rawAttributes']);_0x7c3aaa[_0xb774('0x2e')]=_[_0xb774('0x2d')](_0x53c0bb['query']);_0x7c3aaa[_0xb774('0x38')]=_[_0xb774('0x2f')](_0x7c3aaa[_0xb774('0x2b')],_0x7c3aaa[_0xb774('0x2e')]);_0x568d7f[_0xb774('0x30')]=_['intersection'](_0x7c3aaa[_0xb774('0x2b')],qs[_0xb774('0x31')](_0x53c0bb[_0xb774('0x2e')][_0xb774('0x31')]));_0x568d7f[_0xb774('0x30')]=_0x568d7f['attributes'][_0xb774('0x32')]?_0x568d7f['attributes']:_0x7c3aaa['model'];if(_0x53c0bb['query']['includeAll']){_0x568d7f[_0xb774('0x41')]=[{'all':!![]}];}_0x568d7f=_[_0xb774('0x3c')]({},_0x568d7f,_0x53c0bb['options']);return db[_0xb774('0x26')][_0xb774('0x42')](_0x568d7f)[_0xb774('0x20')](handleEntityNotFound(_0x4516ad,null))[_0xb774('0x20')](respondWithResult(_0x4516ad,null))[_0xb774('0x43')](handleError(_0x4516ad,null));};exports[_0xb774('0x44')]=function(_0x3462a8,_0x4d7cbd){return db['SquareRecording'][_0xb774('0x44')](_0x3462a8[_0xb774('0x45')],{})[_0xb774('0x20')](respondWithResult(_0x4d7cbd,0xc9))['catch'](handleError(_0x4d7cbd,null));};exports[_0xb774('0x46')]=function(_0x10eeb9,_0x1dae6e){if(_0x10eeb9['body']['id']){delete _0x10eeb9['body']['id'];}return db['SquareRecording'][_0xb774('0x42')]({'where':{'id':_0x10eeb9[_0xb774('0x40')]['id']}})[_0xb774('0x20')](handleEntityNotFound(_0x1dae6e,null))[_0xb774('0x20')](saveUpdates(_0x10eeb9['body'],null))['then'](respondWithResult(_0x1dae6e,null))['catch'](handleError(_0x1dae6e,null));};exports['download']=function(_0x37447d,_0x4ef988,_0x3089db){var _0x27c941=require(_0xb774('0x47'));var _0x22e352=![];var _0x18701e={};if(_0x37447d[_0xb774('0x2e')][_0xb774('0x29')]&&_0x37447d[_0xb774('0x2e')][_0xb774('0x29')]===_0xb774('0x48')){_0x18701e['uniqueid']=_0x37447d[_0xb774('0x40')]['id'];}else{_0x18701e['id']=_0x37447d[_0xb774('0x40')]['id'];}return db[_0xb774('0x26')]['find']({'where':_0x18701e,'attributes':['id',_0xb774('0x49'),_0xb774('0x4a')],'raw':!![]})[_0xb774('0x20')](handleEntityNotFound(_0x4ef988,null))['then'](function(_0x23f012){if(_0x23f012){var _0x33f2d7=_0x23f012[_0xb774('0x49')];var _0xd9a0e8=util['format'](_0xb774('0x4b'),_0x33f2d7);if(fs[_0xb774('0x4c')](_0xd9a0e8)){_0x22e352=!![];return _0x27c941['decryptFile'](_0xd9a0e8,_0x33f2d7,config[_0xb774('0x4d')][_0xb774('0x4e')])[_0xb774('0x20')](function(){return _0x23f012;});}return _0x23f012;}})[_0xb774('0x20')](function(_0x56c5a1){if(_0x56c5a1){var _0x2dc0d4=_0x56c5a1[_0xb774('0x49')];if(!fs[_0xb774('0x4c')](_0x2dc0d4)){throw new db[(_0xb774('0x4f'))][(_0xb774('0x50'))](_0xb774('0x51'));}if(_0x56c5a1[_0xb774('0x4a')]){return _0x4ef988[_0xb774('0x52')](_0x2dc0d4,_0x56c5a1[_0xb774('0x4a')]+path[_0xb774('0x53')](_0x2dc0d4),function(){if(_0x22e352){fs[_0xb774('0x54')](_0x2dc0d4);}});}else{return _0x4ef988['download'](_0x2dc0d4,function(_0x24b6d6){if(_0x22e352){fs[_0xb774('0x54')](_0x2dc0d4);}});}}})['catch'](function(_0xcbdd1a){if(_0xcbdd1a[_0xb774('0x55')]===_0xb774('0x51')){_0x4ef988[_0xb774('0x17')](0x194)['send'](_0xb774('0x56'));}else{return handleError(_0x4ef988,null);}});};exports[_0xb774('0x21')]=function(_0x420e21,_0x3ddfe1){return db[_0xb774('0x26')]['find']({'where':{'id':_0x420e21['params']['id']}})['then'](function(_0x1836cb){if(_[_0xb774('0x57')](_0x1836cb)){throw new ReferenceError(_0xb774('0x58'));}return _0x1836cb;})[_0xb774('0x20')](function(_0x3e04d3){var _0x3b7eb5=_0x3e04d3[_0xb774('0x49')];logger[_0xb774('0x59')](_0xb774('0x5a'),_0x3b7eb5);if(!_[_0xb774('0x57')](_0x3e04d3[_0xb774('0x49')])&&fs[_0xb774('0x4c')](_0x3b7eb5)){logger['info'](_0xb774('0x5b')+_0x3b7eb5+_0xb774('0x5c'));fs['unlinkSync'](_0x3b7eb5);}_0x3b7eb5=_0x3b7eb5+_0xb774('0x5d');if(!_[_0xb774('0x57')](_0x3e04d3[_0xb774('0x49')])&&fs[_0xb774('0x4c')](_0x3b7eb5)){logger[_0xb774('0x59')](_0xb774('0x5b')+_0x3b7eb5+_0xb774('0x5c'));fs[_0xb774('0x5e')](_0x3b7eb5);}return _0x3e04d3;})[_0xb774('0x20')](function(_0x1da8d9){if(!_0x1da8d9)throw new InternalError();return _0x1da8d9[_0xb774('0x21')]();})[_0xb774('0x20')](function(){_0x3ddfe1['status'](0xcc)[_0xb774('0x18')]();})[_0xb774('0x43')](handleError(_0x3ddfe1,null));}; \ No newline at end of file +var _0x16db=['unlink','message','Not\x20found','Entity\x20not\x20found','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','isNil','info','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','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','undefined','offset','limit','set','apply','save','update','then','destroy','error','stack','send','index','SquareRecording','rawAttributes','type','key','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x16db,0x12d));var _0xb16d=function(_0x1c6476,_0x438e0e){_0x1c6476=_0x1c6476-0x0;var _0x9b7648=_0x16db[_0x1c6476];return _0x9b7648;};'use strict';var emlformat=require(_0xb16d('0x0'));var rimraf=require(_0xb16d('0x1'));var zipdir=require(_0xb16d('0x2'));var jsonpatch=require(_0xb16d('0x3'));var rp=require('request-promise');var moment=require(_0xb16d('0x4'));var BPromise=require(_0xb16d('0x5'));var Mustache=require('mustache');var util=require(_0xb16d('0x6'));var path=require(_0xb16d('0x7'));var sox=require(_0xb16d('0x8'));var csv=require(_0xb16d('0x9'));var ejs=require(_0xb16d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb16d('0xb'));var squel=require(_0xb16d('0xc'));var crypto=require('crypto');var jsforce=require(_0xb16d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb16d('0xe'));var Papa=require(_0xb16d('0xf'));var Redis=require(_0xb16d('0x10'));var authService=require(_0xb16d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb16d('0x12'));var hardwareService=require(_0xb16d('0x13'));var logger=require('../../config/logger')(_0xb16d('0x14'));var utils=require(_0xb16d('0x15'));var config=require(_0xb16d('0x16'));var licenseUtil=require(_0xb16d('0x17'));var db=require(_0xb16d('0x18'))['db'];function respondWithStatusCode(_0x129226,_0x1e0488){_0x1e0488=_0x1e0488||0xcc;return function(_0x43800d){if(_0x43800d){return _0x129226[_0xb16d('0x19')](_0x1e0488);}return _0x129226[_0xb16d('0x1a')](_0x1e0488)[_0xb16d('0x1b')]();};}function respondWithResult(_0x413843,_0x16207e){_0x16207e=_0x16207e||0xc8;return function(_0x22524d){if(_0x22524d){return _0x413843[_0xb16d('0x1a')](_0x16207e)[_0xb16d('0x1c')](_0x22524d);}};}function respondWithFilteredResult(_0x4ec8a0,_0x15eeb2){return function(_0x49d02a){if(_0x49d02a){var _0x11e634=typeof _0x15eeb2['offset']===_0xb16d('0x1d')&&typeof _0x15eeb2['limit']===_0xb16d('0x1d');var _0x369ed5=_0x49d02a['count'];var _0x1285a2=_0x11e634?0x0:_0x15eeb2[_0xb16d('0x1e')];var _0x271205=_0x11e634?_0x49d02a['count']:_0x15eeb2['offset']+_0x15eeb2[_0xb16d('0x1f')];var _0x1a1429;if(_0x271205>=_0x369ed5){_0x271205=_0x369ed5;_0x1a1429=0xc8;}else{_0x1a1429=0xce;}_0x4ec8a0[_0xb16d('0x1a')](_0x1a1429);return _0x4ec8a0[_0xb16d('0x20')]('Content-Range',_0x1285a2+'-'+_0x271205+'/'+_0x369ed5)['json'](_0x49d02a);}return null;};}function patchUpdates(_0x5c24b8){return function(_0xb80434){try{jsonpatch[_0xb16d('0x21')](_0xb80434,_0x5c24b8,!![]);}catch(_0x3cc65c){return BPromise['reject'](_0x3cc65c);}return _0xb80434[_0xb16d('0x22')]();};}function saveUpdates(_0x11fd69,_0x7b6a1a){return function(_0x3b595d){if(_0x3b595d){return _0x3b595d[_0xb16d('0x23')](_0x11fd69)[_0xb16d('0x24')](function(_0x4a6292){return _0x4a6292;});}return null;};}function removeEntity(_0x54474f,_0x5a581f){return function(_0x1eae0b){if(_0x1eae0b){return _0x1eae0b[_0xb16d('0x25')]()[_0xb16d('0x24')](function(){_0x54474f[_0xb16d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x227ace,_0x3c44f1){return function(_0x227ff4){if(!_0x227ff4){_0x227ace[_0xb16d('0x19')](0x194);}return _0x227ff4;};}function handleError(_0x3ed795,_0x19e13a){_0x19e13a=_0x19e13a||0x1f4;return function(_0x40575c){logger[_0xb16d('0x26')](_0x40575c[_0xb16d('0x27')]);if(_0x40575c['name']){delete _0x40575c['name'];}_0x3ed795[_0xb16d('0x1a')](_0x19e13a)[_0xb16d('0x28')](_0x40575c);};}exports[_0xb16d('0x29')]=function(_0x5c5a92,_0x299773){var _0x4fe304={},_0xa25c84={},_0x2a20fc={'count':0x0,'rows':[]};var _0x571504=_['map'](db[_0xb16d('0x2a')][_0xb16d('0x2b')],function(_0x492305){return{'name':_0x492305['fieldName'],'type':_0x492305[_0xb16d('0x2c')][_0xb16d('0x2d')]};});_0xa25c84[_0xb16d('0x2e')]=_[_0xb16d('0x2f')](_0x571504,_0xb16d('0x30'));_0xa25c84['query']=_[_0xb16d('0x31')](_0x5c5a92[_0xb16d('0x32')]);_0xa25c84['filters']=_[_0xb16d('0x33')](_0xa25c84[_0xb16d('0x2e')],_0xa25c84[_0xb16d('0x32')]);_0x4fe304[_0xb16d('0x34')]=_[_0xb16d('0x33')](_0xa25c84['model'],qs[_0xb16d('0x35')](_0x5c5a92[_0xb16d('0x32')][_0xb16d('0x35')]));_0x4fe304[_0xb16d('0x34')]=_0x4fe304['attributes'][_0xb16d('0x36')]?_0x4fe304[_0xb16d('0x34')]:_0xa25c84[_0xb16d('0x2e')];if(!_0x5c5a92['query'][_0xb16d('0x37')](_0xb16d('0x38'))){_0x4fe304[_0xb16d('0x1f')]=qs['limit'](_0x5c5a92[_0xb16d('0x32')][_0xb16d('0x1f')]);_0x4fe304[_0xb16d('0x1e')]=qs['offset'](_0x5c5a92[_0xb16d('0x32')]['offset']);}_0x4fe304[_0xb16d('0x39')]=qs['sort'](_0x5c5a92['query'][_0xb16d('0x3a')]);_0x4fe304[_0xb16d('0x3b')]=qs[_0xb16d('0x3c')](_['pick'](_0x5c5a92[_0xb16d('0x32')],_0xa25c84[_0xb16d('0x3c')]),_0x571504);if(_0x5c5a92[_0xb16d('0x32')]['filter']){_0x4fe304[_0xb16d('0x3b')]=_[_0xb16d('0x3d')](_0x4fe304[_0xb16d('0x3b')],{'$or':_[_0xb16d('0x2f')](_0x571504,function(_0x6da568){if(_0x6da568[_0xb16d('0x2c')]!==_0xb16d('0x3e')){var _0x447c8f={};_0x447c8f[_0x6da568['name']]={'$like':'%'+_0x5c5a92['query'][_0xb16d('0x3f')]+'%'};return _0x447c8f;}})});}_0x4fe304=_['merge']({},_0x4fe304,_0x5c5a92[_0xb16d('0x40')]);var _0x3852cc={'where':_0x4fe304['where']};return db[_0xb16d('0x2a')][_0xb16d('0x41')](_0x3852cc)['then'](function(_0x39fad0){_0x2a20fc[_0xb16d('0x41')]=_0x39fad0;if(_0x5c5a92['query'][_0xb16d('0x42')]){_0x4fe304[_0xb16d('0x43')]=[{'all':!![]}];}return db[_0xb16d('0x2a')][_0xb16d('0x44')](_0x4fe304);})[_0xb16d('0x24')](function(_0x45aad2){_0x2a20fc[_0xb16d('0x45')]=_0x45aad2;return _0x2a20fc;})[_0xb16d('0x24')](respondWithFilteredResult(_0x299773,_0x4fe304))['catch'](handleError(_0x299773,null));};exports[_0xb16d('0x46')]=function(_0x4b3040,_0x577d9e){var _0x25db8f={'raw':!![],'where':{'id':_0x4b3040['params']['id']}},_0x516f8f={};_0x516f8f['model']=_['keys'](db[_0xb16d('0x2a')][_0xb16d('0x2b')]);_0x516f8f[_0xb16d('0x32')]=_[_0xb16d('0x31')](_0x4b3040[_0xb16d('0x32')]);_0x516f8f[_0xb16d('0x3c')]=_[_0xb16d('0x33')](_0x516f8f[_0xb16d('0x2e')],_0x516f8f[_0xb16d('0x32')]);_0x25db8f['attributes']=_['intersection'](_0x516f8f[_0xb16d('0x2e')],qs[_0xb16d('0x35')](_0x4b3040[_0xb16d('0x32')][_0xb16d('0x35')]));_0x25db8f['attributes']=_0x25db8f[_0xb16d('0x34')][_0xb16d('0x36')]?_0x25db8f['attributes']:_0x516f8f['model'];if(_0x4b3040[_0xb16d('0x32')][_0xb16d('0x42')]){_0x25db8f[_0xb16d('0x43')]=[{'all':!![]}];}_0x25db8f=_['merge']({},_0x25db8f,_0x4b3040[_0xb16d('0x40')]);return db['SquareRecording'][_0xb16d('0x47')](_0x25db8f)[_0xb16d('0x24')](handleEntityNotFound(_0x577d9e,null))[_0xb16d('0x24')](respondWithResult(_0x577d9e,null))[_0xb16d('0x48')](handleError(_0x577d9e,null));};exports[_0xb16d('0x49')]=function(_0x3c8bab,_0x330807){return db[_0xb16d('0x2a')][_0xb16d('0x49')](_0x3c8bab[_0xb16d('0x4a')],{})['then'](respondWithResult(_0x330807,0xc9))[_0xb16d('0x48')](handleError(_0x330807,null));};exports[_0xb16d('0x23')]=function(_0x1533f8,_0x42c35c){if(_0x1533f8[_0xb16d('0x4a')]['id']){delete _0x1533f8[_0xb16d('0x4a')]['id'];}return db['SquareRecording'][_0xb16d('0x47')]({'where':{'id':_0x1533f8[_0xb16d('0x4b')]['id']}})[_0xb16d('0x24')](handleEntityNotFound(_0x42c35c,null))['then'](saveUpdates(_0x1533f8['body'],null))['then'](respondWithResult(_0x42c35c,null))[_0xb16d('0x48')](handleError(_0x42c35c,null));};exports['download']=function(_0x3b2811,_0x22e05d,_0x4749f9){var _0x481872=require(_0xb16d('0x4c'));var _0x4038d6=![];var _0x299097={};if(_0x3b2811[_0xb16d('0x32')][_0xb16d('0x2c')]&&_0x3b2811[_0xb16d('0x32')][_0xb16d('0x2c')]===_0xb16d('0x4d')){_0x299097['uniqueid']=_0x3b2811[_0xb16d('0x4b')]['id'];}else{_0x299097['id']=_0x3b2811[_0xb16d('0x4b')]['id'];}return db['SquareRecording'][_0xb16d('0x47')]({'where':_0x299097,'attributes':['id',_0xb16d('0x4e'),_0xb16d('0x4f')],'raw':!![]})[_0xb16d('0x24')](handleEntityNotFound(_0x22e05d,null))[_0xb16d('0x24')](function(_0x42f588){if(_0x42f588){var _0x2e1ea8=_0x42f588[_0xb16d('0x4e')];var _0x39bed8=util[_0xb16d('0x50')](_0xb16d('0x51'),_0x2e1ea8);if(fs[_0xb16d('0x52')](_0x39bed8)){_0x4038d6=!![];return _0x481872['decryptFile'](_0x39bed8,_0x2e1ea8,config['secrets']['recording'])[_0xb16d('0x24')](function(){return _0x42f588;});}return _0x42f588;}})[_0xb16d('0x24')](function(_0x2d2c31){if(_0x2d2c31){var _0x2bfc96=_0x2d2c31['savePath'];if(!fs[_0xb16d('0x52')](_0x2bfc96)){throw new db[(_0xb16d('0x53'))][(_0xb16d('0x54'))](_0xb16d('0x55'));}if(_0x2d2c31[_0xb16d('0x4f')]){return _0x22e05d['download'](_0x2bfc96,_0x2d2c31[_0xb16d('0x4f')]+path[_0xb16d('0x56')](_0x2bfc96),function(){if(_0x4038d6){fs[_0xb16d('0x57')](_0x2bfc96);}});}else{return _0x22e05d['download'](_0x2bfc96,function(_0x2c0dcf){if(_0x4038d6){fs[_0xb16d('0x57')](_0x2bfc96);}});}}})[_0xb16d('0x48')](function(_0x28304f){if(_0x28304f[_0xb16d('0x58')]===_0xb16d('0x55')){_0x22e05d[_0xb16d('0x1a')](0x194)['send'](_0xb16d('0x59'));}else{return handleError(_0x22e05d,null);}});};exports[_0xb16d('0x25')]=function(_0xda6897,_0x595064){return db[_0xb16d('0x2a')][_0xb16d('0x47')]({'where':{'id':_0xda6897[_0xb16d('0x4b')]['id']}})['then'](function(_0x2e9633){if(_['isNil'](_0x2e9633)){throw new ReferenceError(_0xb16d('0x5a'));}return _0x2e9633;})[_0xb16d('0x24')](function(_0x1fcf2f){var _0x3aae22=_0x1fcf2f['savePath'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3aae22);if(!_['isNil'](_0x1fcf2f['savePath'])&&fs[_0xb16d('0x52')](_0x3aae22)){logger['info'](_0xb16d('0x5b')+_0x3aae22+_0xb16d('0x5c'));fs['unlinkSync'](_0x3aae22);}_0x3aae22=_0x3aae22+_0xb16d('0x5d');if(!_[_0xb16d('0x5e')](_0x1fcf2f[_0xb16d('0x4e')])&&fs['existsSync'](_0x3aae22)){logger[_0xb16d('0x5f')]('File:\x20\x22'+_0x3aae22+_0xb16d('0x5c'));fs[_0xb16d('0x60')](_0x3aae22);}return _0x1fcf2f;})[_0xb16d('0x24')](function(_0xe7384a){if(!_0xe7384a)throw new InternalError();return _0xe7384a['destroy']();})[_0xb16d('0x24')](function(){_0x595064[_0xb16d('0x1a')](0xcc)[_0xb16d('0x1b')]();})['catch'](handleError(_0x595064,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index ae6eb82..1f2a84d 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 _0x6faf=['bluebird','request-promise','rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','util','../../config/logger','api','moment'];(function(_0x4ae23e,_0x1c89c9){var _0x5ed571=function(_0x51660f){while(--_0x51660f){_0x4ae23e['push'](_0x4ae23e['shift']());}};_0x5ed571(++_0x1c89c9);}(_0x6faf,0xf9));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xf6fa('0x0'));var logger=require(_0xf6fa('0x1'))(_0xf6fa('0x2'));var moment=require(_0xf6fa('0x3'));var BPromise=require(_0xf6fa('0x4'));var rp=require(_0xf6fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6fa('0x6'));var config=require('../../config/environment');var attributes=require(_0xf6fa('0x7'));module['exports']=function(_0xe883dd,_0x3c91fc){return _0xe883dd[_0xf6fa('0x8')](_0xf6fa('0x9'),attributes,{'tableName':_0xf6fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cad=['SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x1a8572,_0x24b459){var _0x5888ee=function(_0x96aa8){while(--_0x96aa8){_0x1a8572['push'](_0x1a8572['shift']());}};_0x5888ee(++_0x24b459);}(_0x8cad,0xfe));var _0xd8ca=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x8cad[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var logger=require(_0xd8ca('0x2'))(_0xd8ca('0x3'));var moment=require(_0xd8ca('0x4'));var BPromise=require(_0xd8ca('0x5'));var rp=require(_0xd8ca('0x6'));var fs=require('fs');var path=require(_0xd8ca('0x7'));var rimraf=require(_0xd8ca('0x8'));var config=require(_0xd8ca('0x9'));var attributes=require(_0xd8ca('0xa'));module[_0xd8ca('0xb')]=function(_0x14c73e,_0x6d5070){return _0x14c73e['define'](_0xd8ca('0xc'),attributes,{'tableName':_0xd8ca('0xd'),'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 c8a18e6..ee1a5a8 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 _0x9b5a=['raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareRecording','create','body','options'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9b5a,0x1b1));var _0xa9b5=function(_0x2036f4,_0x47c08b){_0x2036f4=_0x2036f4-0x0;var _0x3e9045=_0x9b5a[_0x2036f4];return _0x3e9045;};'use strict';var _=require(_0xa9b5('0x0'));var util=require(_0xa9b5('0x1'));var moment=require('moment');var BPromise=require(_0xa9b5('0x2'));var rs=require(_0xa9b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9b5('0x4'))['db'];var utils=require(_0xa9b5('0x5'));var logger=require(_0xa9b5('0x6'))(_0xa9b5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa9b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d6b5e,_0x59ca76,_0x491315){return new BPromise(function(_0xc7e123,_0x30d3c1){return client[_0xa9b5('0x9')](_0x3d6b5e,_0x491315)[_0xa9b5('0xa')](function(_0x259a08){logger['info'](_0xa9b5('0xb'),_0x59ca76,_0xa9b5('0xc'));logger[_0xa9b5('0xd')](_0xa9b5('0xe'),_0x59ca76,_0xa9b5('0xc'),JSON[_0xa9b5('0xf')](_0x259a08));if(_0x259a08['error']){if(_0x259a08[_0xa9b5('0x10')][_0xa9b5('0x11')]===0x1f4){logger['error'](_0xa9b5('0xb'),_0x59ca76,_0x259a08['error'][_0xa9b5('0x12')]);return _0x30d3c1(_0x259a08[_0xa9b5('0x10')][_0xa9b5('0x12')]);}logger['error'](_0xa9b5('0xb'),_0x59ca76,_0x259a08[_0xa9b5('0x10')][_0xa9b5('0x12')]);return _0xc7e123(_0x259a08[_0xa9b5('0x10')]['message']);}else{logger[_0xa9b5('0x13')](_0xa9b5('0xb'),_0x59ca76,_0xa9b5('0xc'));_0xc7e123(_0x259a08[_0xa9b5('0x14')][_0xa9b5('0x12')]);}})[_0xa9b5('0x15')](function(_0xea0fc2){logger[_0xa9b5('0x10')](_0xa9b5('0xb'),_0x59ca76,_0xea0fc2);_0x30d3c1(_0xea0fc2);});});}exports[_0xa9b5('0x16')]=function(_0x442cda){var _0x5e2236=this;return new Promise(function(_0x398c7f,_0x58d6b3){return db['SquareRecording'][_0xa9b5('0x17')](_0x442cda[_0xa9b5('0x18')],{'raw':_0x442cda[_0xa9b5('0x19')]?_0x442cda[_0xa9b5('0x19')][_0xa9b5('0x1a')]===undefined?!![]:![]:!![]})[_0xa9b5('0xa')](function(_0x43db82){logger[_0xa9b5('0x13')](_0xa9b5('0x16'),_0x442cda);logger[_0xa9b5('0xd')](_0xa9b5('0x16'),_0x442cda,JSON[_0xa9b5('0xf')](_0x43db82));_0x398c7f(_0x43db82);})['catch'](function(_0x5f5996){logger['error'](_0xa9b5('0x16'),_0x5f5996[_0xa9b5('0x12')],_0x442cda);_0x58d6b3(_0x5e2236['error'](0x1f4,_0x5f5996['message']));});});}; \ No newline at end of file +var _0xb9d2=['options','raw','CreateSquareRecording','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','SquareRecording','body'];(function(_0xe6dd0f,_0x5b731a){var _0x169450=function(_0x3bfe80){while(--_0x3bfe80){_0xe6dd0f['push'](_0xe6dd0f['shift']());}};_0x169450(++_0x5b731a);}(_0xb9d2,0x1d7));var _0x2b9d=function(_0x21fec0,_0x2f9a99){_0x21fec0=_0x21fec0-0x0;var _0xcf272e=_0xb9d2[_0x21fec0];return _0xcf272e;};'use strict';var _=require('lodash');var util=require(_0x2b9d('0x0'));var moment=require(_0x2b9d('0x1'));var BPromise=require(_0x2b9d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b9d('0x3'));var logger=require(_0x2b9d('0x4'))(_0x2b9d('0x5'));var config=require(_0x2b9d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2b9d('0x7')][_0x2b9d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa4dc17,_0x253430,_0x50d5b1){return new BPromise(function(_0xcbffcc,_0x26d3d0){return client[_0x2b9d('0x9')](_0xa4dc17,_0x50d5b1)[_0x2b9d('0xa')](function(_0xe645c6){logger['info'](_0x2b9d('0xb'),_0x253430,_0x2b9d('0xc'));logger[_0x2b9d('0xd')](_0x2b9d('0xe'),_0x253430,_0x2b9d('0xc'),JSON[_0x2b9d('0xf')](_0xe645c6));if(_0xe645c6[_0x2b9d('0x10')]){if(_0xe645c6[_0x2b9d('0x10')]['code']===0x1f4){logger[_0x2b9d('0x10')](_0x2b9d('0xb'),_0x253430,_0xe645c6[_0x2b9d('0x10')][_0x2b9d('0x11')]);return _0x26d3d0(_0xe645c6[_0x2b9d('0x10')][_0x2b9d('0x11')]);}logger[_0x2b9d('0x10')](_0x2b9d('0xb'),_0x253430,_0xe645c6['error']['message']);return _0xcbffcc(_0xe645c6[_0x2b9d('0x10')][_0x2b9d('0x11')]);}else{logger[_0x2b9d('0x12')](_0x2b9d('0xb'),_0x253430,_0x2b9d('0xc'));_0xcbffcc(_0xe645c6[_0x2b9d('0x13')][_0x2b9d('0x11')]);}})[_0x2b9d('0x14')](function(_0x1f2b49){logger[_0x2b9d('0x10')]('SquareRecording,\x20%s,\x20%s',_0x253430,_0x1f2b49);_0x26d3d0(_0x1f2b49);});});}exports['CreateSquareRecording']=function(_0x440576){var _0x4d7242=this;return new Promise(function(_0x6de6c4,_0x458560){return db[_0x2b9d('0x15')]['create'](_0x440576[_0x2b9d('0x16')],{'raw':_0x440576['options']?_0x440576[_0x2b9d('0x17')][_0x2b9d('0x18')]===undefined?!![]:![]:!![]})[_0x2b9d('0xa')](function(_0x6f7428){logger[_0x2b9d('0x12')]('CreateSquareRecording',_0x440576);logger[_0x2b9d('0xd')](_0x2b9d('0x19'),_0x440576,JSON[_0x2b9d('0xf')](_0x6f7428));_0x6de6c4(_0x6f7428);})[_0x2b9d('0x14')](function(_0x140e31){logger[_0x2b9d('0x10')]('CreateSquareRecording',_0x140e31[_0x2b9d('0x11')],_0x440576);_0x458560(_0x4d7242[_0x2b9d('0x10')](0x1f4,_0x140e31[_0x2b9d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 37d808a..c9106cd 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x846ae8,_0x33a70b){var _0x356b00=function(_0xa96f69){while(--_0xa96f69){_0x846ae8['push'](_0x846ae8['shift']());}};_0x356b00(++_0x33a70b);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index cbe4ad7..98382ad 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 _0xda2a=['STRING','BOOLEAN','sequelize'];(function(_0x1e6a22,_0x203deb){var _0x3cc6aa=function(_0x2d5cc9){while(--_0x2d5cc9){_0x1e6a22['push'](_0x1e6a22['shift']());}};_0x3cc6aa(++_0x203deb);}(_0xda2a,0xb9));var _0xada2=function(_0x5c2bdf,_0x3ecd42){_0x5c2bdf=_0x5c2bdf-0x0;var _0x3e35b6=_0xda2a[_0x5c2bdf];return _0x3e35b6;};'use strict';var Sequelize=require(_0xada2('0x0'));module['exports']={'network':{'type':Sequelize[_0xada2('0x1')]},'network_script':{'type':Sequelize[_0xada2('0x1')]},'request':{'type':Sequelize[_0xada2('0x1')]},'channel':{'type':Sequelize[_0xada2('0x1')]},'language':{'type':Sequelize[_0xada2('0x1')]},'type':{'type':Sequelize[_0xada2('0x1')]},'uniqueid':{'type':Sequelize[_0xada2('0x1')]},'version':{'type':Sequelize[_0xada2('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xada2('0x1')]},'callingpres':{'type':Sequelize[_0xada2('0x1')]},'callingani2':{'type':Sequelize[_0xada2('0x1')]},'callington':{'type':Sequelize[_0xada2('0x1')]},'callingtns':{'type':Sequelize[_0xada2('0x1')]},'dnid':{'type':Sequelize[_0xada2('0x1')]},'rdnis':{'type':Sequelize[_0xada2('0x1')]},'context':{'type':Sequelize[_0xada2('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xada2('0x1')]},'enhanced':{'type':Sequelize[_0xada2('0x1')]},'accountcode':{'type':Sequelize[_0xada2('0x1')]},'threadid':{'type':Sequelize[_0xada2('0x1')]},'project_name':{'type':Sequelize[_0xada2('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xada2('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c2b=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x14c0e1,_0x527f6f){var _0x1f9d95=function(_0x568176){while(--_0x568176){_0x14c0e1['push'](_0x14c0e1['shift']());}};_0x1f9d95(++_0x527f6f);}(_0x3c2b,0x117));var _0xb3c2=function(_0x317f16,_0x6eb0f9){_0x317f16=_0x317f16-0x0;var _0x4bb899=_0x3c2b[_0x317f16];return _0x4bb899;};'use strict';var Sequelize=require(_0xb3c2('0x0'));module[_0xb3c2('0x1')]={'network':{'type':Sequelize[_0xb3c2('0x2')]},'network_script':{'type':Sequelize[_0xb3c2('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb3c2('0x2')]},'language':{'type':Sequelize[_0xb3c2('0x2')]},'type':{'type':Sequelize[_0xb3c2('0x2')]},'uniqueid':{'type':Sequelize[_0xb3c2('0x2')]},'version':{'type':Sequelize[_0xb3c2('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb3c2('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xb3c2('0x2')]},'callington':{'type':Sequelize[_0xb3c2('0x2')]},'callingtns':{'type':Sequelize[_0xb3c2('0x2')]},'dnid':{'type':Sequelize[_0xb3c2('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xb3c2('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xb3c2('0x2')]},'accountcode':{'type':Sequelize[_0xb3c2('0x2')]},'threadid':{'type':Sequelize[_0xb3c2('0x2')]},'project_name':{'type':Sequelize[_0xb3c2('0x2')]},'joinAt':{'type':Sequelize[_0xb3c2('0x3')]},'leaveAt':{'type':Sequelize[_0xb3c2('0x3')]},'bot':{'type':Sequelize[_0xb3c2('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1d2a4a0..2278a6b 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 _0xf98b=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SquareReport','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x344680,_0x3841dd){var _0x433695=function(_0x29cda4){while(--_0x29cda4){_0x344680['push'](_0x344680['shift']());}};_0x433695(++_0x3841dd);}(_0xf98b,0x7c));var _0xbf98=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf98b[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0xbf98('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbf98('0x1'));var rp=require(_0xbf98('0x2'));var moment=require(_0xbf98('0x3'));var BPromise=require(_0xbf98('0x4'));var Mustache=require(_0xbf98('0x5'));var util=require(_0xbf98('0x6'));var path=require('path');var sox=require(_0xbf98('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf98('0x8'));var _=require(_0xbf98('0x9'));var squel=require(_0xbf98('0xa'));var crypto=require(_0xbf98('0xb'));var jsforce=require(_0xbf98('0xc'));var deskjs=require(_0xbf98('0xd'));var toCsv=require(_0xbf98('0xe'));var querystring=require(_0xbf98('0xf'));var Papa=require(_0xbf98('0x10'));var Redis=require(_0xbf98('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbf98('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf98('0x13'))(_0xbf98('0x14'));var utils=require(_0xbf98('0x15'));var config=require(_0xbf98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf98('0x17'))['db'];function respondWithStatusCode(_0x1c571d,_0x5b0366){_0x5b0366=_0x5b0366||0xcc;return function(_0x428144){if(_0x428144){return _0x1c571d[_0xbf98('0x18')](_0x5b0366);}return _0x1c571d[_0xbf98('0x19')](_0x5b0366)[_0xbf98('0x1a')]();};}function respondWithResult(_0xa1550d,_0x2ee0ae){_0x2ee0ae=_0x2ee0ae||0xc8;return function(_0x350299){if(_0x350299){return _0xa1550d[_0xbf98('0x19')](_0x2ee0ae)[_0xbf98('0x1b')](_0x350299);}};}function respondWithFilteredResult(_0x344e73,_0x1c5057){return function(_0x566347){if(_0x566347){var _0x323213=typeof _0x1c5057['offset']==='undefined'&&typeof _0x1c5057[_0xbf98('0x1c')]==='undefined';var _0x530933=_0x566347[_0xbf98('0x1d')];var _0x202053=_0x323213?0x0:_0x1c5057['offset'];var _0xd8d177=_0x323213?_0x566347['count']:_0x1c5057['offset']+_0x1c5057[_0xbf98('0x1c')];var _0x71db1;if(_0xd8d177>=_0x530933){_0xd8d177=_0x530933;_0x71db1=0xc8;}else{_0x71db1=0xce;}_0x344e73[_0xbf98('0x19')](_0x71db1);return _0x344e73[_0xbf98('0x1e')](_0xbf98('0x1f'),_0x202053+'-'+_0xd8d177+'/'+_0x530933)[_0xbf98('0x1b')](_0x566347);}return null;};}function patchUpdates(_0xd5852b){return function(_0x21929c){try{jsonpatch[_0xbf98('0x20')](_0x21929c,_0xd5852b,!![]);}catch(_0x4a0112){return BPromise['reject'](_0x4a0112);}return _0x21929c[_0xbf98('0x21')]();};}function saveUpdates(_0xbaa478,_0x3b38cc){return function(_0x19ee88){if(_0x19ee88){return _0x19ee88[_0xbf98('0x22')](_0xbaa478)[_0xbf98('0x23')](function(_0x4ee223){return _0x4ee223;});}return null;};}function removeEntity(_0x260fbb,_0x33c03a){return function(_0x4a244e){if(_0x4a244e){return _0x4a244e[_0xbf98('0x24')]()[_0xbf98('0x23')](function(){_0x260fbb['status'](0xcc)[_0xbf98('0x1a')]();});}};}function handleEntityNotFound(_0x41914f,_0x29604b){return function(_0x54dacd){if(!_0x54dacd){_0x41914f[_0xbf98('0x18')](0x194);}return _0x54dacd;};}function handleError(_0x497ee8,_0x27369f){_0x27369f=_0x27369f||0x1f4;return function(_0x45d25e){logger[_0xbf98('0x25')](_0x45d25e[_0xbf98('0x26')]);if(_0x45d25e[_0xbf98('0x27')]){delete _0x45d25e[_0xbf98('0x27')];}_0x497ee8[_0xbf98('0x19')](_0x27369f)['send'](_0x45d25e);};}exports[_0xbf98('0x28')]=function(_0x236462,_0x57c30c){var _0x530d0e={},_0xbeb8aa={},_0x2bb255={'count':0x0,'rows':[]};var _0x143d04=_[_0xbf98('0x29')](db[_0xbf98('0x2a')]['rawAttributes'],function(_0x4a762a){return{'name':_0x4a762a['fieldName'],'type':_0x4a762a[_0xbf98('0x2b')]['key']};});_0xbeb8aa['model']=_['map'](_0x143d04,_0xbf98('0x27'));_0xbeb8aa['query']=_[_0xbf98('0x2c')](_0x236462[_0xbf98('0x2d')]);_0xbeb8aa[_0xbf98('0x2e')]=_[_0xbf98('0x2f')](_0xbeb8aa[_0xbf98('0x30')],_0xbeb8aa['query']);_0x530d0e[_0xbf98('0x31')]=_[_0xbf98('0x2f')](_0xbeb8aa[_0xbf98('0x30')],qs['fields'](_0x236462[_0xbf98('0x2d')][_0xbf98('0x32')]));_0x530d0e[_0xbf98('0x31')]=_0x530d0e['attributes'][_0xbf98('0x33')]?_0x530d0e['attributes']:_0xbeb8aa[_0xbf98('0x30')];if(!_0x236462[_0xbf98('0x2d')][_0xbf98('0x34')](_0xbf98('0x35'))){_0x530d0e['limit']=qs[_0xbf98('0x1c')](_0x236462[_0xbf98('0x2d')]['limit']);_0x530d0e[_0xbf98('0x36')]=qs[_0xbf98('0x36')](_0x236462['query'][_0xbf98('0x36')]);}_0x530d0e[_0xbf98('0x37')]=qs['sort'](_0x236462[_0xbf98('0x2d')][_0xbf98('0x38')]);_0x530d0e['where']=qs[_0xbf98('0x2e')](_[_0xbf98('0x39')](_0x236462[_0xbf98('0x2d')],_0xbeb8aa[_0xbf98('0x2e')]),_0x143d04);if(_0x236462[_0xbf98('0x2d')][_0xbf98('0x3a')]){_0x530d0e[_0xbf98('0x3b')]=_[_0xbf98('0x3c')](_0x530d0e[_0xbf98('0x3b')],{'$or':_[_0xbf98('0x29')](_0x143d04,function(_0x927aa1){if(_0x927aa1[_0xbf98('0x2b')]!==_0xbf98('0x3d')){var _0x51c265={};_0x51c265[_0x927aa1[_0xbf98('0x27')]]={'$like':'%'+_0x236462['query'][_0xbf98('0x3a')]+'%'};return _0x51c265;}})});}_0x530d0e=_[_0xbf98('0x3c')]({},_0x530d0e,_0x236462[_0xbf98('0x3e')]);var _0x5990b6={'where':_0x530d0e[_0xbf98('0x3b')]};return db[_0xbf98('0x2a')][_0xbf98('0x1d')](_0x5990b6)[_0xbf98('0x23')](function(_0x9c922e){_0x2bb255[_0xbf98('0x1d')]=_0x9c922e;if(_0x236462[_0xbf98('0x2d')][_0xbf98('0x3f')]){_0x530d0e[_0xbf98('0x40')]=[{'all':!![]}];}return db[_0xbf98('0x2a')][_0xbf98('0x41')](_0x530d0e);})[_0xbf98('0x23')](function(_0x3f5dc4){_0x2bb255['rows']=_0x3f5dc4;return _0x2bb255;})[_0xbf98('0x23')](respondWithFilteredResult(_0x57c30c,_0x530d0e))[_0xbf98('0x42')](handleError(_0x57c30c,null));};exports['show']=function(_0x35c1ee,_0x4b90ea){var _0x58b5c9={'raw':!![],'where':{'id':_0x35c1ee[_0xbf98('0x43')]['id']}},_0x5d410b={};_0x5d410b[_0xbf98('0x30')]=_[_0xbf98('0x2c')](db[_0xbf98('0x2a')]['rawAttributes']);_0x5d410b['query']=_['keys'](_0x35c1ee[_0xbf98('0x2d')]);_0x5d410b[_0xbf98('0x2e')]=_['intersection'](_0x5d410b[_0xbf98('0x30')],_0x5d410b[_0xbf98('0x2d')]);_0x58b5c9[_0xbf98('0x31')]=_[_0xbf98('0x2f')](_0x5d410b['model'],qs[_0xbf98('0x32')](_0x35c1ee[_0xbf98('0x2d')][_0xbf98('0x32')]));_0x58b5c9[_0xbf98('0x31')]=_0x58b5c9[_0xbf98('0x31')][_0xbf98('0x33')]?_0x58b5c9[_0xbf98('0x31')]:_0x5d410b[_0xbf98('0x30')];if(_0x35c1ee[_0xbf98('0x2d')][_0xbf98('0x3f')]){_0x58b5c9['include']=[{'all':!![]}];}_0x58b5c9=_[_0xbf98('0x3c')]({},_0x58b5c9,_0x35c1ee[_0xbf98('0x3e')]);return db['SquareReport'][_0xbf98('0x44')](_0x58b5c9)[_0xbf98('0x23')](handleEntityNotFound(_0x4b90ea,null))['then'](respondWithResult(_0x4b90ea,null))['catch'](handleError(_0x4b90ea,null));};exports[_0xbf98('0x45')]=function(_0x2c6344,_0x6def1){return db[_0xbf98('0x2a')][_0xbf98('0x45')](_0x2c6344[_0xbf98('0x46')],{})[_0xbf98('0x23')](respondWithResult(_0x6def1,0xc9))[_0xbf98('0x42')](handleError(_0x6def1,null));};exports['update']=function(_0x25500c,_0x5a34bc){if(_0x25500c[_0xbf98('0x46')]['id']){delete _0x25500c[_0xbf98('0x46')]['id'];}return db[_0xbf98('0x2a')]['find']({'where':{'id':_0x25500c[_0xbf98('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a34bc,null))['then'](saveUpdates(_0x25500c[_0xbf98('0x46')],null))[_0xbf98('0x23')](respondWithResult(_0x5a34bc,null))[_0xbf98('0x42')](handleError(_0x5a34bc,null));};exports[_0xbf98('0x24')]=function(_0x53f15a,_0x4c6052){return db[_0xbf98('0x2a')]['find']({'where':{'id':_0x53f15a[_0xbf98('0x43')]['id']}})[_0xbf98('0x23')](handleEntityNotFound(_0x4c6052,null))[_0xbf98('0x23')](removeEntity(_0x4c6052,null))[_0xbf98('0x42')](handleError(_0x4c6052,null));};exports[_0xbf98('0x47')]=function(_0x146091,_0x6e4e19){return db[_0xbf98('0x2a')][_0xbf98('0x47')]()[_0xbf98('0x23')](respondWithResult(_0x6e4e19,null))[_0xbf98('0x42')](handleError(_0x6e4e19,null));}; \ No newline at end of file +var _0xddb5=['findAll','rows','length','find','catch','create','body','params','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','index','map','SquareReport','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x348a2f,_0x304501){var _0x716d26=function(_0x10dd54){while(--_0x10dd54){_0x348a2f['push'](_0x348a2f['shift']());}};_0x716d26(++_0x304501);}(_0xddb5,0x18a));var _0x5ddb=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xddb5[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x5ddb('0x0'));var rimraf=require(_0x5ddb('0x1'));var zipdir=require(_0x5ddb('0x2'));var jsonpatch=require(_0x5ddb('0x3'));var rp=require('request-promise');var moment=require(_0x5ddb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ddb('0x5'));var util=require(_0x5ddb('0x6'));var path=require(_0x5ddb('0x7'));var sox=require(_0x5ddb('0x8'));var csv=require(_0x5ddb('0x9'));var ejs=require(_0x5ddb('0xa'));var fs=require('fs');var fs_extra=require(_0x5ddb('0xb'));var _=require(_0x5ddb('0xc'));var squel=require(_0x5ddb('0xd'));var crypto=require('crypto');var jsforce=require(_0x5ddb('0xe'));var deskjs=require(_0x5ddb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5ddb('0x10'));var Papa=require(_0x5ddb('0x11'));var Redis=require('ioredis');var authService=require(_0x5ddb('0x12'));var qs=require(_0x5ddb('0x13'));var as=require(_0x5ddb('0x14'));var hardwareService=require(_0x5ddb('0x15'));var logger=require(_0x5ddb('0x16'))(_0x5ddb('0x17'));var utils=require('../../config/utils');var config=require(_0x5ddb('0x18'));var licenseUtil=require(_0x5ddb('0x19'));var db=require(_0x5ddb('0x1a'))['db'];function respondWithStatusCode(_0x5ac23c,_0x5c7678){_0x5c7678=_0x5c7678||0xcc;return function(_0x15b677){if(_0x15b677){return _0x5ac23c[_0x5ddb('0x1b')](_0x5c7678);}return _0x5ac23c['status'](_0x5c7678)[_0x5ddb('0x1c')]();};}function respondWithResult(_0x390a89,_0x30d262){_0x30d262=_0x30d262||0xc8;return function(_0x23a8c3){if(_0x23a8c3){return _0x390a89['status'](_0x30d262)[_0x5ddb('0x1d')](_0x23a8c3);}};}function respondWithFilteredResult(_0x33f4b3,_0x434569){return function(_0x5a6d72){if(_0x5a6d72){var _0x91355a=typeof _0x434569[_0x5ddb('0x1e')]===_0x5ddb('0x1f')&&typeof _0x434569[_0x5ddb('0x20')]===_0x5ddb('0x1f');var _0x2a7f90=_0x5a6d72['count'];var _0x4de881=_0x91355a?0x0:_0x434569['offset'];var _0x23e22c=_0x91355a?_0x5a6d72[_0x5ddb('0x21')]:_0x434569[_0x5ddb('0x1e')]+_0x434569[_0x5ddb('0x20')];var _0x4618e9;if(_0x23e22c>=_0x2a7f90){_0x23e22c=_0x2a7f90;_0x4618e9=0xc8;}else{_0x4618e9=0xce;}_0x33f4b3['status'](_0x4618e9);return _0x33f4b3[_0x5ddb('0x22')](_0x5ddb('0x23'),_0x4de881+'-'+_0x23e22c+'/'+_0x2a7f90)['json'](_0x5a6d72);}return null;};}function patchUpdates(_0x459ec6){return function(_0x341e4b){try{jsonpatch[_0x5ddb('0x24')](_0x341e4b,_0x459ec6,!![]);}catch(_0x27acc0){return BPromise[_0x5ddb('0x25')](_0x27acc0);}return _0x341e4b[_0x5ddb('0x26')]();};}function saveUpdates(_0x2264b4,_0x17ce6d){return function(_0x434060){if(_0x434060){return _0x434060[_0x5ddb('0x27')](_0x2264b4)[_0x5ddb('0x28')](function(_0x148639){return _0x148639;});}return null;};}function removeEntity(_0x359052,_0x48973f){return function(_0x341f96){if(_0x341f96){return _0x341f96[_0x5ddb('0x29')]()[_0x5ddb('0x28')](function(){_0x359052[_0x5ddb('0x2a')](0xcc)[_0x5ddb('0x1c')]();});}};}function handleEntityNotFound(_0x570167,_0x520a38){return function(_0x4d19d6){if(!_0x4d19d6){_0x570167['sendStatus'](0x194);}return _0x4d19d6;};}function handleError(_0x5a5c21,_0x5849e9){_0x5849e9=_0x5849e9||0x1f4;return function(_0x545416){logger[_0x5ddb('0x2b')](_0x545416[_0x5ddb('0x2c')]);if(_0x545416[_0x5ddb('0x2d')]){delete _0x545416[_0x5ddb('0x2d')];}_0x5a5c21[_0x5ddb('0x2a')](_0x5849e9)['send'](_0x545416);};}exports[_0x5ddb('0x2e')]=function(_0x39810b,_0x1c3ec5){var _0x4f62f0={},_0x31f3c1={},_0x14e75f={'count':0x0,'rows':[]};var _0x324d11=_[_0x5ddb('0x2f')](db[_0x5ddb('0x30')]['rawAttributes'],function(_0x17c4f9){return{'name':_0x17c4f9['fieldName'],'type':_0x17c4f9[_0x5ddb('0x31')][_0x5ddb('0x32')]};});_0x31f3c1[_0x5ddb('0x33')]=_[_0x5ddb('0x2f')](_0x324d11,'name');_0x31f3c1['query']=_[_0x5ddb('0x34')](_0x39810b[_0x5ddb('0x35')]);_0x31f3c1[_0x5ddb('0x36')]=_[_0x5ddb('0x37')](_0x31f3c1[_0x5ddb('0x33')],_0x31f3c1[_0x5ddb('0x35')]);_0x4f62f0[_0x5ddb('0x38')]=_['intersection'](_0x31f3c1['model'],qs[_0x5ddb('0x39')](_0x39810b['query'][_0x5ddb('0x39')]));_0x4f62f0['attributes']=_0x4f62f0[_0x5ddb('0x38')]['length']?_0x4f62f0[_0x5ddb('0x38')]:_0x31f3c1[_0x5ddb('0x33')];if(!_0x39810b[_0x5ddb('0x35')]['hasOwnProperty'](_0x5ddb('0x3a'))){_0x4f62f0[_0x5ddb('0x20')]=qs['limit'](_0x39810b[_0x5ddb('0x35')][_0x5ddb('0x20')]);_0x4f62f0[_0x5ddb('0x1e')]=qs['offset'](_0x39810b[_0x5ddb('0x35')][_0x5ddb('0x1e')]);}_0x4f62f0[_0x5ddb('0x3b')]=qs['sort'](_0x39810b[_0x5ddb('0x35')]['sort']);_0x4f62f0[_0x5ddb('0x3c')]=qs[_0x5ddb('0x36')](_[_0x5ddb('0x3d')](_0x39810b[_0x5ddb('0x35')],_0x31f3c1[_0x5ddb('0x36')]),_0x324d11);if(_0x39810b[_0x5ddb('0x35')][_0x5ddb('0x3e')]){_0x4f62f0[_0x5ddb('0x3c')]=_[_0x5ddb('0x3f')](_0x4f62f0[_0x5ddb('0x3c')],{'$or':_[_0x5ddb('0x2f')](_0x324d11,function(_0x5ef3ac){if(_0x5ef3ac[_0x5ddb('0x31')]!==_0x5ddb('0x40')){var _0x49f5c5={};_0x49f5c5[_0x5ef3ac[_0x5ddb('0x2d')]]={'$like':'%'+_0x39810b[_0x5ddb('0x35')][_0x5ddb('0x3e')]+'%'};return _0x49f5c5;}})});}_0x4f62f0=_[_0x5ddb('0x3f')]({},_0x4f62f0,_0x39810b[_0x5ddb('0x41')]);var _0x4de308={'where':_0x4f62f0[_0x5ddb('0x3c')]};return db['SquareReport']['count'](_0x4de308)[_0x5ddb('0x28')](function(_0x39ac93){_0x14e75f[_0x5ddb('0x21')]=_0x39ac93;if(_0x39810b[_0x5ddb('0x35')][_0x5ddb('0x42')]){_0x4f62f0[_0x5ddb('0x43')]=[{'all':!![]}];}return db[_0x5ddb('0x30')][_0x5ddb('0x44')](_0x4f62f0);})[_0x5ddb('0x28')](function(_0xb4e079){_0x14e75f[_0x5ddb('0x45')]=_0xb4e079;return _0x14e75f;})[_0x5ddb('0x28')](respondWithFilteredResult(_0x1c3ec5,_0x4f62f0))['catch'](handleError(_0x1c3ec5,null));};exports['show']=function(_0x181822,_0x5f4bb4){var _0x199e88={'raw':!![],'where':{'id':_0x181822['params']['id']}},_0x2922d4={};_0x2922d4[_0x5ddb('0x33')]=_['keys'](db[_0x5ddb('0x30')]['rawAttributes']);_0x2922d4['query']=_[_0x5ddb('0x34')](_0x181822[_0x5ddb('0x35')]);_0x2922d4[_0x5ddb('0x36')]=_[_0x5ddb('0x37')](_0x2922d4['model'],_0x2922d4['query']);_0x199e88[_0x5ddb('0x38')]=_['intersection'](_0x2922d4[_0x5ddb('0x33')],qs['fields'](_0x181822[_0x5ddb('0x35')][_0x5ddb('0x39')]));_0x199e88[_0x5ddb('0x38')]=_0x199e88[_0x5ddb('0x38')][_0x5ddb('0x46')]?_0x199e88['attributes']:_0x2922d4[_0x5ddb('0x33')];if(_0x181822[_0x5ddb('0x35')][_0x5ddb('0x42')]){_0x199e88[_0x5ddb('0x43')]=[{'all':!![]}];}_0x199e88=_['merge']({},_0x199e88,_0x181822['options']);return db['SquareReport'][_0x5ddb('0x47')](_0x199e88)[_0x5ddb('0x28')](handleEntityNotFound(_0x5f4bb4,null))['then'](respondWithResult(_0x5f4bb4,null))[_0x5ddb('0x48')](handleError(_0x5f4bb4,null));};exports[_0x5ddb('0x49')]=function(_0x4edffd,_0x41126b){return db['SquareReport']['create'](_0x4edffd[_0x5ddb('0x4a')],{})[_0x5ddb('0x28')](respondWithResult(_0x41126b,0xc9))[_0x5ddb('0x48')](handleError(_0x41126b,null));};exports['update']=function(_0x1903e7,_0x342c49){if(_0x1903e7[_0x5ddb('0x4a')]['id']){delete _0x1903e7['body']['id'];}return db['SquareReport'][_0x5ddb('0x47')]({'where':{'id':_0x1903e7[_0x5ddb('0x4b')]['id']}})[_0x5ddb('0x28')](handleEntityNotFound(_0x342c49,null))['then'](saveUpdates(_0x1903e7[_0x5ddb('0x4a')],null))[_0x5ddb('0x28')](respondWithResult(_0x342c49,null))[_0x5ddb('0x48')](handleError(_0x342c49,null));};exports[_0x5ddb('0x29')]=function(_0x5b130b,_0x135332){return db[_0x5ddb('0x30')]['find']({'where':{'id':_0x5b130b['params']['id']}})[_0x5ddb('0x28')](handleEntityNotFound(_0x135332,null))[_0x5ddb('0x28')](removeEntity(_0x135332,null))[_0x5ddb('0x48')](handleError(_0x135332,null));};exports['describe']=function(_0x353f86,_0x4a5c7a){return db[_0x5ddb('0x30')][_0x5ddb('0x4c')]()[_0x5ddb('0x28')](respondWithResult(_0x4a5c7a,null))[_0x5ddb('0x48')](handleError(_0x4a5c7a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index e73f152..b9d6f3a 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 _0x4237=['uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','SquareReport'];(function(_0x312ac8,_0x9b640c){var _0x228770=function(_0x42ff76){while(--_0x42ff76){_0x312ac8['push'](_0x312ac8['shift']());}};_0x228770(++_0x9b640c);}(_0x4237,0x107));var _0x7423=function(_0x229897,_0x49b540){_0x229897=_0x229897-0x0;var _0x5e1946=_0x4237[_0x229897];return _0x5e1946;};'use strict';var _=require(_0x7423('0x0'));var util=require(_0x7423('0x1'));var logger=require(_0x7423('0x2'))(_0x7423('0x3'));var moment=require(_0x7423('0x4'));var BPromise=require(_0x7423('0x5'));var rp=require(_0x7423('0x6'));var fs=require('fs');var path=require(_0x7423('0x7'));var rimraf=require('rimraf');var config=require(_0x7423('0x8'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x32af49,_0x4cd1c8){return _0x32af49['define'](_0x7423('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x7423('0xa'),'fields':[_0x7423('0xb'),'project_name']},{'name':_0x7423('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8810=['project_name','leaveAt','lodash','util','api','bluebird','request-promise','path','../../config/environment','exports','SquareReport','uniqueid'];(function(_0x383fda,_0xe006ad){var _0x30114e=function(_0x24e0b7){while(--_0x24e0b7){_0x383fda['push'](_0x383fda['shift']());}};_0x30114e(++_0xe006ad);}(_0x8810,0x146));var _0x0881=function(_0x38533a,_0x5ee46e){_0x38533a=_0x38533a-0x0;var _0x144025=_0x8810[_0x38533a];return _0x144025;};'use strict';var _=require(_0x0881('0x0'));var util=require(_0x0881('0x1'));var logger=require('../../config/logger')(_0x0881('0x2'));var moment=require('moment');var BPromise=require(_0x0881('0x3'));var rp=require(_0x0881('0x4'));var fs=require('fs');var path=require(_0x0881('0x5'));var rimraf=require('rimraf');var config=require(_0x0881('0x6'));var attributes=require('./squareReport.attributes');module[_0x0881('0x7')]=function(_0x24070a,_0x2aab01){return _0x24070a['define'](_0x0881('0x8'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0881('0x9'),_0x0881('0xa')]},{'name':_0x0881('0xb'),'fields':[_0x0881('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 46db19f..35f4878 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 _0x4cf3=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','SquareReport','body','options','raw','CreateSquareReport','update','where','attributes','UpdateSquareReport','lodash','util','moment','randomstring','ioredis'];(function(_0x3819b9,_0x1ac4e5){var _0x5646f3=function(_0x12d7d2){while(--_0x12d7d2){_0x3819b9['push'](_0x3819b9['shift']());}};_0x5646f3(++_0x1ac4e5);}(_0x4cf3,0x166));var _0x34cf=function(_0xc6e7dc,_0x9ee91d){_0xc6e7dc=_0xc6e7dc-0x0;var _0x36e669=_0x4cf3[_0xc6e7dc];return _0x36e669;};'use strict';var _=require(_0x34cf('0x0'));var util=require(_0x34cf('0x1'));var moment=require(_0x34cf('0x2'));var BPromise=require('bluebird');var rs=require(_0x34cf('0x3'));var fs=require('fs');var Redis=require(_0x34cf('0x4'));var db=require(_0x34cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x34cf('0x6'))(_0x34cf('0x7'));var config=require(_0x34cf('0x8'));var jayson=require(_0x34cf('0x9'));var client=jayson[_0x34cf('0xa')][_0x34cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e14a4,_0x90377,_0x26e9f0){return new BPromise(function(_0x1816a6,_0x34e3a9){return client[_0x34cf('0xc')](_0x4e14a4,_0x26e9f0)[_0x34cf('0xd')](function(_0x3865fc){logger[_0x34cf('0xe')](_0x34cf('0xf'),_0x90377,'request\x20sent');logger[_0x34cf('0x10')](_0x34cf('0x11'),_0x90377,'request\x20sent',JSON[_0x34cf('0x12')](_0x3865fc));if(_0x3865fc[_0x34cf('0x13')]){if(_0x3865fc[_0x34cf('0x13')]['code']===0x1f4){logger[_0x34cf('0x13')](_0x34cf('0xf'),_0x90377,_0x3865fc[_0x34cf('0x13')][_0x34cf('0x14')]);return _0x34e3a9(_0x3865fc[_0x34cf('0x13')][_0x34cf('0x14')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x90377,_0x3865fc[_0x34cf('0x13')][_0x34cf('0x14')]);return _0x1816a6(_0x3865fc[_0x34cf('0x13')]['message']);}else{logger[_0x34cf('0xe')](_0x34cf('0xf'),_0x90377,_0x34cf('0x15'));_0x1816a6(_0x3865fc[_0x34cf('0x16')]['message']);}})[_0x34cf('0x17')](function(_0x3ead21){logger[_0x34cf('0x13')](_0x34cf('0xf'),_0x90377,_0x3ead21);_0x34e3a9(_0x3ead21);});});}exports['CreateSquareReport']=function(_0x1a569f){var _0x1eb37e=this;return new Promise(function(_0x276f4f,_0x223a53){return db[_0x34cf('0x18')]['create'](_0x1a569f[_0x34cf('0x19')],{'raw':_0x1a569f[_0x34cf('0x1a')]?_0x1a569f[_0x34cf('0x1a')][_0x34cf('0x1b')]===undefined?!![]:![]:!![]})[_0x34cf('0xd')](function(_0x21ca57){logger[_0x34cf('0xe')](_0x34cf('0x1c'),_0x1a569f);logger['debug'](_0x34cf('0x1c'),_0x1a569f,JSON[_0x34cf('0x12')](_0x21ca57));_0x276f4f(_0x21ca57);})[_0x34cf('0x17')](function(_0x152cb6){logger['error'](_0x34cf('0x1c'),_0x152cb6[_0x34cf('0x14')],_0x1a569f);_0x223a53(_0x1eb37e[_0x34cf('0x13')](0x1f4,_0x152cb6[_0x34cf('0x14')]));});});};exports['UpdateSquareReport']=function(_0x2afbc4){var _0x512e22=this;return new Promise(function(_0x3245e9,_0x162dc1){return db[_0x34cf('0x18')][_0x34cf('0x1d')](_0x2afbc4[_0x34cf('0x19')],{'raw':_0x2afbc4[_0x34cf('0x1a')]?_0x2afbc4[_0x34cf('0x1a')][_0x34cf('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2afbc4[_0x34cf('0x1a')]?_0x2afbc4[_0x34cf('0x1a')][_0x34cf('0x1e')]||null:null,'attributes':_0x2afbc4['options']?_0x2afbc4[_0x34cf('0x1a')][_0x34cf('0x1f')]||null:null,'limit':_0x2afbc4[_0x34cf('0x1a')]?_0x2afbc4[_0x34cf('0x1a')]['limit']||null:null})[_0x34cf('0xd')](function(_0x47182d){logger['info']('UpdateSquareReport',_0x2afbc4);logger[_0x34cf('0x10')](_0x34cf('0x20'),_0x2afbc4,JSON[_0x34cf('0x12')](_0x47182d));_0x3245e9(_0x47182d);})[_0x34cf('0x17')](function(_0x1ef9e2){logger[_0x34cf('0x13')](_0x34cf('0x20'),_0x1ef9e2[_0x34cf('0x14')],_0x2afbc4);_0x162dc1(_0x512e22[_0x34cf('0x13')](0x1f4,_0x1ef9e2[_0x34cf('0x14')]));});});}; \ No newline at end of file +var _0x414d=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareReport','SquareReport','body','options','raw','then','info','UpdateSquareReport','update','where','attributes','limit','lodash','util','bluebird','ioredis'];(function(_0x84a97e,_0x59f2f2){var _0x3f980b=function(_0x78a15f){while(--_0x78a15f){_0x84a97e['push'](_0x84a97e['shift']());}};_0x3f980b(++_0x59f2f2);}(_0x414d,0x151));var _0xd414=function(_0x2b38a6,_0x4fbc47){_0x2b38a6=_0x2b38a6-0x0;var _0x118544=_0x414d[_0x2b38a6];return _0x118544;};'use strict';var _=require(_0xd414('0x0'));var util=require(_0xd414('0x1'));var moment=require('moment');var BPromise=require(_0xd414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd414('0x3'));var db=require(_0xd414('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd414('0x5'))('rpc');var config=require(_0xd414('0x6'));var jayson=require(_0xd414('0x7'));var client=jayson[_0xd414('0x8')][_0xd414('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33cd9e,_0x57ab2d,_0x4583fd){return new BPromise(function(_0x3edee1,_0x225c7b){return client[_0xd414('0xa')](_0x33cd9e,_0x4583fd)['then'](function(_0x57273e){logger['info'](_0xd414('0xb'),_0x57ab2d,_0xd414('0xc'));logger[_0xd414('0xd')](_0xd414('0xe'),_0x57ab2d,_0xd414('0xc'),JSON[_0xd414('0xf')](_0x57273e));if(_0x57273e[_0xd414('0x10')]){if(_0x57273e['error']['code']===0x1f4){logger[_0xd414('0x10')](_0xd414('0xb'),_0x57ab2d,_0x57273e['error']['message']);return _0x225c7b(_0x57273e['error']['message']);}logger[_0xd414('0x10')](_0xd414('0xb'),_0x57ab2d,_0x57273e['error'][_0xd414('0x11')]);return _0x3edee1(_0x57273e[_0xd414('0x10')][_0xd414('0x11')]);}else{logger['info'](_0xd414('0xb'),_0x57ab2d,'request\x20sent');_0x3edee1(_0x57273e['result'][_0xd414('0x11')]);}})[_0xd414('0x12')](function(_0x119803){logger[_0xd414('0x10')](_0xd414('0xb'),_0x57ab2d,_0x119803);_0x225c7b(_0x119803);});});}exports[_0xd414('0x13')]=function(_0x1c9a0f){var _0x28b6a8=this;return new Promise(function(_0x4e83d2,_0x599d4b){return db[_0xd414('0x14')]['create'](_0x1c9a0f[_0xd414('0x15')],{'raw':_0x1c9a0f[_0xd414('0x16')]?_0x1c9a0f[_0xd414('0x16')][_0xd414('0x17')]===undefined?!![]:![]:!![]})[_0xd414('0x18')](function(_0x10e58b){logger[_0xd414('0x19')](_0xd414('0x13'),_0x1c9a0f);logger[_0xd414('0xd')](_0xd414('0x13'),_0x1c9a0f,JSON[_0xd414('0xf')](_0x10e58b));_0x4e83d2(_0x10e58b);})[_0xd414('0x12')](function(_0x3b29f7){logger[_0xd414('0x10')](_0xd414('0x13'),_0x3b29f7['message'],_0x1c9a0f);_0x599d4b(_0x28b6a8[_0xd414('0x10')](0x1f4,_0x3b29f7[_0xd414('0x11')]));});});};exports[_0xd414('0x1a')]=function(_0x30fb40){var _0x5797f2=this;return new Promise(function(_0x2ef37d,_0x21b5ec){return db[_0xd414('0x14')][_0xd414('0x1b')](_0x30fb40[_0xd414('0x15')],{'raw':_0x30fb40['options']?_0x30fb40[_0xd414('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30fb40['options']?_0x30fb40[_0xd414('0x16')][_0xd414('0x1c')]||null:null,'attributes':_0x30fb40['options']?_0x30fb40[_0xd414('0x16')][_0xd414('0x1d')]||null:null,'limit':_0x30fb40['options']?_0x30fb40[_0xd414('0x16')][_0xd414('0x1e')]||null:null})[_0xd414('0x18')](function(_0x11ebce){logger[_0xd414('0x19')](_0xd414('0x1a'),_0x30fb40);logger['debug']('UpdateSquareReport',_0x30fb40,JSON[_0xd414('0xf')](_0x11ebce));_0x2ef37d(_0x11ebce);})[_0xd414('0x12')](function(_0x4c0fd3){logger[_0xd414('0x10')](_0xd414('0x1a'),_0x4c0fd3[_0xd414('0x11')],_0x30fb40);_0x21b5ec(_0x5797f2[_0xd414('0x10')](0x1f4,_0x4c0fd3[_0xd414('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 26d6421..8e4004f 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 _0xa4f5=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','isAuthenticated','index','describe','get','show','post','create','put','/:id','update','delete'];(function(_0x3909d7,_0x26cb6b){var _0x2a1d8e=function(_0x4cbf92){while(--_0x4cbf92){_0x3909d7['push'](_0x3909d7['shift']());}};_0x2a1d8e(++_0x26cb6b);}(_0xa4f5,0xe8));var _0x5a4f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa4f5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x5a4f('0x0'));var path=require(_0x5a4f('0x1'));var timeout=require(_0x5a4f('0x2'));var express=require(_0x5a4f('0x3'));var router=express[_0x5a4f('0x4')]();var fs_extra=require(_0x5a4f('0x5'));var auth=require(_0x5a4f('0x6'));var interaction=require(_0x5a4f('0x7'));var config=require('../../config/environment');var controller=require(_0x5a4f('0x8'));router['get']('/',auth[_0x5a4f('0x9')](),controller[_0x5a4f('0xa')]);router['get']('/describe',auth[_0x5a4f('0x9')](),controller[_0x5a4f('0xb')]);router[_0x5a4f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x5a4f('0xd')]);router[_0x5a4f('0xe')]('/',auth[_0x5a4f('0x9')](),controller[_0x5a4f('0xf')]);router[_0x5a4f('0x10')](_0x5a4f('0x11'),auth[_0x5a4f('0x9')](),controller[_0x5a4f('0x12')]);router[_0x5a4f('0x13')]('/:id',auth[_0x5a4f('0x9')](),controller['destroy']);module[_0x5a4f('0x14')]=router; \ No newline at end of file +var _0x4f5f=['put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','index','get','isAuthenticated','describe','/:id','show','post'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4f5f,0x8a));var _0xf4f5=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x4f5f[_0x119b3e];return _0x1169ae;};'use strict';var multer=require('multer');var util=require(_0xf4f5('0x0'));var path=require('path');var timeout=require(_0xf4f5('0x1'));var express=require(_0xf4f5('0x2'));var router=express[_0xf4f5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf4f5('0x4'));var interaction=require(_0xf4f5('0x5'));var config=require('../../config/environment');var controller=require(_0xf4f5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xf4f5('0x7')]);router[_0xf4f5('0x8')]('/describe',auth[_0xf4f5('0x9')](),controller[_0xf4f5('0xa')]);router['get'](_0xf4f5('0xb'),auth[_0xf4f5('0x9')](),controller[_0xf4f5('0xc')]);router[_0xf4f5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf4f5('0xe')](_0xf4f5('0xb'),auth[_0xf4f5('0x9')](),controller[_0xf4f5('0xf')]);router[_0xf4f5('0x10')](_0xf4f5('0xb'),auth[_0xf4f5('0x9')](),controller[_0xf4f5('0x11')]);module[_0xf4f5('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index a02bff1..3d8a8a9 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 _0xa9d1=['STRING','TEXT','sequelize','exports'];(function(_0x558e14,_0x4d89c4){var _0x5a0e9b=function(_0x57a93a){while(--_0x57a93a){_0x558e14['push'](_0x558e14['shift']());}};_0x5a0e9b(++_0x4d89c4);}(_0xa9d1,0x17e));var _0x1a9d=function(_0x2749fd,_0xacd88f){_0x2749fd=_0x2749fd-0x0;var _0x258879=_0xa9d1[_0x2749fd];return _0x258879;};'use strict';var Sequelize=require(_0x1a9d('0x0'));module[_0x1a9d('0x1')]={'uniqueid':{'type':Sequelize[_0x1a9d('0x2')]},'node':{'type':Sequelize[_0x1a9d('0x2')]},'application':{'type':Sequelize[_0x1a9d('0x2')]},'data':{'type':Sequelize[_0x1a9d('0x3')]},'project_name':{'type':Sequelize[_0x1a9d('0x2')]},'callerid':{'type':Sequelize[_0x1a9d('0x2')]}}; \ No newline at end of file +var _0xd755=['TEXT','sequelize','STRING'];(function(_0x2f6f3d,_0x642570){var _0x4a284b=function(_0x25cf30){while(--_0x25cf30){_0x2f6f3d['push'](_0x2f6f3d['shift']());}};_0x4a284b(++_0x642570);}(_0xd755,0x1bd));var _0x5d75=function(_0x459847,_0x3d79f4){_0x459847=_0x459847-0x0;var _0x3720fe=_0xd755[_0x459847];return _0x3720fe;};'use strict';var Sequelize=require(_0x5d75('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5d75('0x1')]},'node':{'type':Sequelize[_0x5d75('0x1')]},'application':{'type':Sequelize[_0x5d75('0x1')]},'data':{'type':Sequelize[_0x5d75('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5d75('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 55dee52..4e1ed92 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 _0x2608=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','include','findAll','rows','catch','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x2608,0x1ad));var _0x8260=function(_0x4f69d2,_0x344da8){_0x4f69d2=_0x4f69d2-0x0;var _0x3a36f4=_0x2608[_0x4f69d2];return _0x3a36f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8260('0x0'));var zipdir=require(_0x8260('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8260('0x2'));var moment=require('moment');var BPromise=require(_0x8260('0x3'));var Mustache=require(_0x8260('0x4'));var util=require(_0x8260('0x5'));var path=require(_0x8260('0x6'));var sox=require(_0x8260('0x7'));var csv=require(_0x8260('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8260('0x9'));var _=require(_0x8260('0xa'));var squel=require(_0x8260('0xb'));var crypto=require(_0x8260('0xc'));var jsforce=require(_0x8260('0xd'));var deskjs=require(_0x8260('0xe'));var toCsv=require(_0x8260('0x8'));var querystring=require('querystring');var Papa=require(_0x8260('0xf'));var Redis=require(_0x8260('0x10'));var authService=require(_0x8260('0x11'));var qs=require(_0x8260('0x12'));var as=require(_0x8260('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8260('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8260('0x15'))['db'];function respondWithStatusCode(_0x460913,_0x5041ad){_0x5041ad=_0x5041ad||0xcc;return function(_0x564916){if(_0x564916){return _0x460913[_0x8260('0x16')](_0x5041ad);}return _0x460913[_0x8260('0x17')](_0x5041ad)['end']();};}function respondWithResult(_0x3c3946,_0x4e91e9){_0x4e91e9=_0x4e91e9||0xc8;return function(_0x5beb34){if(_0x5beb34){return _0x3c3946[_0x8260('0x17')](_0x4e91e9)['json'](_0x5beb34);}};}function respondWithFilteredResult(_0x227bf3,_0xc077e){return function(_0x5e9346){if(_0x5e9346){var _0x5db731=typeof _0xc077e[_0x8260('0x18')]===_0x8260('0x19')&&typeof _0xc077e[_0x8260('0x1a')]===_0x8260('0x19');var _0x2dbf3f=_0x5e9346['count'];var _0x29734a=_0x5db731?0x0:_0xc077e[_0x8260('0x18')];var _0x3fab25=_0x5db731?_0x5e9346[_0x8260('0x1b')]:_0xc077e['offset']+_0xc077e['limit'];var _0x453c4a;if(_0x3fab25>=_0x2dbf3f){_0x3fab25=_0x2dbf3f;_0x453c4a=0xc8;}else{_0x453c4a=0xce;}_0x227bf3[_0x8260('0x17')](_0x453c4a);return _0x227bf3[_0x8260('0x1c')](_0x8260('0x1d'),_0x29734a+'-'+_0x3fab25+'/'+_0x2dbf3f)[_0x8260('0x1e')](_0x5e9346);}return null;};}function patchUpdates(_0x20f22c){return function(_0xfa0cb3){try{jsonpatch[_0x8260('0x1f')](_0xfa0cb3,_0x20f22c,!![]);}catch(_0x462b14){return BPromise[_0x8260('0x20')](_0x462b14);}return _0xfa0cb3['save']();};}function saveUpdates(_0x43bf68,_0x38f7f7){return function(_0x276785){if(_0x276785){return _0x276785[_0x8260('0x21')](_0x43bf68)[_0x8260('0x22')](function(_0x2ed1d4){return _0x2ed1d4;});}return null;};}function removeEntity(_0x51d02e,_0x451d46){return function(_0x25fa37){if(_0x25fa37){return _0x25fa37[_0x8260('0x23')]()['then'](function(){_0x51d02e['status'](0xcc)[_0x8260('0x24')]();});}};}function handleEntityNotFound(_0x2da2cb,_0x3be6da){return function(_0x3d06f2){if(!_0x3d06f2){_0x2da2cb['sendStatus'](0x194);}return _0x3d06f2;};}function handleError(_0x482308,_0x18d00c){_0x18d00c=_0x18d00c||0x1f4;return function(_0xbf4c9f){logger[_0x8260('0x25')](_0xbf4c9f[_0x8260('0x26')]);if(_0xbf4c9f['name']){delete _0xbf4c9f[_0x8260('0x27')];}_0x482308[_0x8260('0x17')](_0x18d00c)[_0x8260('0x28')](_0xbf4c9f);};}exports[_0x8260('0x29')]=function(_0x27c5ce,_0x4f3a1e){var _0xa4079f={},_0x572910={},_0x32ba6a={'count':0x0,'rows':[]};var _0x14589d=_[_0x8260('0x2a')](db[_0x8260('0x2b')][_0x8260('0x2c')],function(_0xbc4714){return{'name':_0xbc4714[_0x8260('0x2d')],'type':_0xbc4714[_0x8260('0x2e')][_0x8260('0x2f')]};});_0x572910[_0x8260('0x30')]=_[_0x8260('0x2a')](_0x14589d,_0x8260('0x27'));_0x572910[_0x8260('0x31')]=_[_0x8260('0x32')](_0x27c5ce['query']);_0x572910[_0x8260('0x33')]=_['intersection'](_0x572910[_0x8260('0x30')],_0x572910[_0x8260('0x31')]);_0xa4079f[_0x8260('0x34')]=_[_0x8260('0x35')](_0x572910[_0x8260('0x30')],qs[_0x8260('0x36')](_0x27c5ce[_0x8260('0x31')]['fields']));_0xa4079f[_0x8260('0x34')]=_0xa4079f['attributes'][_0x8260('0x37')]?_0xa4079f['attributes']:_0x572910['model'];if(!_0x27c5ce['query'][_0x8260('0x38')]('nolimit')){_0xa4079f['limit']=qs[_0x8260('0x1a')](_0x27c5ce[_0x8260('0x31')][_0x8260('0x1a')]);_0xa4079f[_0x8260('0x18')]=qs[_0x8260('0x18')](_0x27c5ce['query'][_0x8260('0x18')]);}_0xa4079f['order']=qs[_0x8260('0x39')](_0x27c5ce['query'][_0x8260('0x39')]);_0xa4079f[_0x8260('0x3a')]=qs[_0x8260('0x33')](_[_0x8260('0x3b')](_0x27c5ce[_0x8260('0x31')],_0x572910[_0x8260('0x33')]),_0x14589d);if(_0x27c5ce[_0x8260('0x31')]['filter']){_0xa4079f['where']=_['merge'](_0xa4079f['where'],{'$or':_['map'](_0x14589d,function(_0x16f281){if(_0x16f281[_0x8260('0x2e')]!==_0x8260('0x3c')){var _0x2ea2f4={};_0x2ea2f4[_0x16f281[_0x8260('0x27')]]={'$like':'%'+_0x27c5ce['query'][_0x8260('0x3d')]+'%'};return _0x2ea2f4;}})});}_0xa4079f=_['merge']({},_0xa4079f,_0x27c5ce['options']);var _0x1b546c={'where':_0xa4079f[_0x8260('0x3a')]};return db[_0x8260('0x2b')]['count'](_0x1b546c)['then'](function(_0x590d0d){_0x32ba6a['count']=_0x590d0d;if(_0x27c5ce[_0x8260('0x31')]['includeAll']){_0xa4079f[_0x8260('0x3e')]=[{'all':!![]}];}return db[_0x8260('0x2b')][_0x8260('0x3f')](_0xa4079f);})[_0x8260('0x22')](function(_0x29f7a6){_0x32ba6a[_0x8260('0x40')]=_0x29f7a6;return _0x32ba6a;})[_0x8260('0x22')](respondWithFilteredResult(_0x4f3a1e,_0xa4079f))[_0x8260('0x41')](handleError(_0x4f3a1e,null));};exports['show']=function(_0x326cfa,_0x139462){var _0x27cbf6={'raw':!![],'where':{'id':_0x326cfa[_0x8260('0x42')]['id']}},_0x5e6c56={};_0x5e6c56['model']=_[_0x8260('0x32')](db[_0x8260('0x2b')][_0x8260('0x2c')]);_0x5e6c56[_0x8260('0x31')]=_[_0x8260('0x32')](_0x326cfa[_0x8260('0x31')]);_0x5e6c56[_0x8260('0x33')]=_['intersection'](_0x5e6c56[_0x8260('0x30')],_0x5e6c56[_0x8260('0x31')]);_0x27cbf6[_0x8260('0x34')]=_[_0x8260('0x35')](_0x5e6c56['model'],qs[_0x8260('0x36')](_0x326cfa[_0x8260('0x31')][_0x8260('0x36')]));_0x27cbf6[_0x8260('0x34')]=_0x27cbf6[_0x8260('0x34')][_0x8260('0x37')]?_0x27cbf6[_0x8260('0x34')]:_0x5e6c56[_0x8260('0x30')];if(_0x326cfa[_0x8260('0x31')]['includeAll']){_0x27cbf6[_0x8260('0x3e')]=[{'all':!![]}];}_0x27cbf6=_[_0x8260('0x43')]({},_0x27cbf6,_0x326cfa['options']);return db[_0x8260('0x2b')][_0x8260('0x44')](_0x27cbf6)['then'](handleEntityNotFound(_0x139462,null))['then'](respondWithResult(_0x139462,null))['catch'](handleError(_0x139462,null));};exports[_0x8260('0x45')]=function(_0x157065,_0x2511bd){return db[_0x8260('0x2b')][_0x8260('0x45')](_0x157065[_0x8260('0x46')],{})[_0x8260('0x22')](respondWithResult(_0x2511bd,0xc9))[_0x8260('0x41')](handleError(_0x2511bd,null));};exports['update']=function(_0x32d987,_0x68a0e4){if(_0x32d987[_0x8260('0x46')]['id']){delete _0x32d987['body']['id'];}return db[_0x8260('0x2b')][_0x8260('0x44')]({'where':{'id':_0x32d987['params']['id']}})[_0x8260('0x22')](handleEntityNotFound(_0x68a0e4,null))[_0x8260('0x22')](saveUpdates(_0x32d987[_0x8260('0x46')],null))[_0x8260('0x22')](respondWithResult(_0x68a0e4,null))[_0x8260('0x41')](handleError(_0x68a0e4,null));};exports[_0x8260('0x23')]=function(_0x3d86df,_0x4178fe){return db['SquareDetailsReport'][_0x8260('0x44')]({'where':{'id':_0x3d86df[_0x8260('0x42')]['id']}})['then'](handleEntityNotFound(_0x4178fe,null))[_0x8260('0x22')](removeEntity(_0x4178fe,null))['catch'](handleError(_0x4178fe,null));};exports[_0x8260('0x47')]=function(_0x5278e8,_0x545254){return db[_0x8260('0x2b')][_0x8260('0x47')]()[_0x8260('0x22')](respondWithResult(_0x545254,null))[_0x8260('0x41')](handleError(_0x545254,null));}; \ No newline at end of file +var _0x20a0=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','reject','save','update','then','stack','name','send','SquareDetailsReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','merge','where','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x20a0,0x152));var _0x020a=function(_0x527df7,_0x5e4fc4){_0x527df7=_0x527df7-0x0;var _0x3f4f96=_0x20a0[_0x527df7];return _0x3f4f96;};'use strict';var emlformat=require(_0x020a('0x0'));var rimraf=require(_0x020a('0x1'));var zipdir=require(_0x020a('0x2'));var jsonpatch=require(_0x020a('0x3'));var rp=require(_0x020a('0x4'));var moment=require(_0x020a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x020a('0x6'));var path=require(_0x020a('0x7'));var sox=require('sox');var csv=require(_0x020a('0x8'));var ejs=require(_0x020a('0x9'));var fs=require('fs');var fs_extra=require(_0x020a('0xa'));var _=require(_0x020a('0xb'));var squel=require(_0x020a('0xc'));var crypto=require(_0x020a('0xd'));var jsforce=require(_0x020a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x020a('0xf'));var qs=require(_0x020a('0x10'));var as=require(_0x020a('0x11'));var hardwareService=require(_0x020a('0x12'));var logger=require(_0x020a('0x13'))(_0x020a('0x14'));var utils=require(_0x020a('0x15'));var config=require(_0x020a('0x16'));var licenseUtil=require(_0x020a('0x17'));var db=require(_0x020a('0x18'))['db'];function respondWithStatusCode(_0x292cbd,_0x699b5){_0x699b5=_0x699b5||0xcc;return function(_0x56a6b1){if(_0x56a6b1){return _0x292cbd[_0x020a('0x19')](_0x699b5);}return _0x292cbd['status'](_0x699b5)[_0x020a('0x1a')]();};}function respondWithResult(_0x327b3d,_0x4a01ef){_0x4a01ef=_0x4a01ef||0xc8;return function(_0x22dabf){if(_0x22dabf){return _0x327b3d[_0x020a('0x1b')](_0x4a01ef)['json'](_0x22dabf);}};}function respondWithFilteredResult(_0x2ef60a,_0x17b9e5){return function(_0x29d1a1){if(_0x29d1a1){var _0x387ed9=typeof _0x17b9e5[_0x020a('0x1c')]==='undefined'&&typeof _0x17b9e5['limit']===_0x020a('0x1d');var _0x2b5edc=_0x29d1a1[_0x020a('0x1e')];var _0x195f0f=_0x387ed9?0x0:_0x17b9e5[_0x020a('0x1c')];var _0x5bf501=_0x387ed9?_0x29d1a1[_0x020a('0x1e')]:_0x17b9e5[_0x020a('0x1c')]+_0x17b9e5[_0x020a('0x1f')];var _0x3872fa;if(_0x5bf501>=_0x2b5edc){_0x5bf501=_0x2b5edc;_0x3872fa=0xc8;}else{_0x3872fa=0xce;}_0x2ef60a['status'](_0x3872fa);return _0x2ef60a[_0x020a('0x20')]('Content-Range',_0x195f0f+'-'+_0x5bf501+'/'+_0x2b5edc)['json'](_0x29d1a1);}return null;};}function patchUpdates(_0x5dfa93){return function(_0x15cbaa){try{jsonpatch['apply'](_0x15cbaa,_0x5dfa93,!![]);}catch(_0x2ffb1f){return BPromise[_0x020a('0x21')](_0x2ffb1f);}return _0x15cbaa[_0x020a('0x22')]();};}function saveUpdates(_0x25e2fa,_0xa62cbb){return function(_0x19c2ac){if(_0x19c2ac){return _0x19c2ac[_0x020a('0x23')](_0x25e2fa)[_0x020a('0x24')](function(_0x4a2395){return _0x4a2395;});}return null;};}function removeEntity(_0x9df48,_0x16ed98){return function(_0x3f031d){if(_0x3f031d){return _0x3f031d['destroy']()[_0x020a('0x24')](function(){_0x9df48[_0x020a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16e319,_0x54835e){return function(_0x122303){if(!_0x122303){_0x16e319['sendStatus'](0x194);}return _0x122303;};}function handleError(_0x4fd4ed,_0x191492){_0x191492=_0x191492||0x1f4;return function(_0x15600e){logger['error'](_0x15600e[_0x020a('0x25')]);if(_0x15600e[_0x020a('0x26')]){delete _0x15600e[_0x020a('0x26')];}_0x4fd4ed[_0x020a('0x1b')](_0x191492)[_0x020a('0x27')](_0x15600e);};}exports['index']=function(_0x57adc4,_0x428750){var _0x4d4c62={},_0xa7dae8={},_0x337183={'count':0x0,'rows':[]};var _0x1d18b3=_['map'](db[_0x020a('0x28')][_0x020a('0x29')],function(_0x5b7d76){return{'name':_0x5b7d76['fieldName'],'type':_0x5b7d76[_0x020a('0x2a')][_0x020a('0x2b')]};});_0xa7dae8[_0x020a('0x2c')]=_[_0x020a('0x2d')](_0x1d18b3,_0x020a('0x26'));_0xa7dae8['query']=_[_0x020a('0x2e')](_0x57adc4[_0x020a('0x2f')]);_0xa7dae8[_0x020a('0x30')]=_[_0x020a('0x31')](_0xa7dae8['model'],_0xa7dae8[_0x020a('0x2f')]);_0x4d4c62[_0x020a('0x32')]=_['intersection'](_0xa7dae8[_0x020a('0x2c')],qs['fields'](_0x57adc4[_0x020a('0x2f')][_0x020a('0x33')]));_0x4d4c62['attributes']=_0x4d4c62[_0x020a('0x32')][_0x020a('0x34')]?_0x4d4c62['attributes']:_0xa7dae8[_0x020a('0x2c')];if(!_0x57adc4['query']['hasOwnProperty'](_0x020a('0x35'))){_0x4d4c62[_0x020a('0x1f')]=qs['limit'](_0x57adc4[_0x020a('0x2f')][_0x020a('0x1f')]);_0x4d4c62[_0x020a('0x1c')]=qs[_0x020a('0x1c')](_0x57adc4['query'][_0x020a('0x1c')]);}_0x4d4c62['order']=qs[_0x020a('0x36')](_0x57adc4[_0x020a('0x2f')][_0x020a('0x36')]);_0x4d4c62['where']=qs['filters'](_['pick'](_0x57adc4[_0x020a('0x2f')],_0xa7dae8[_0x020a('0x30')]),_0x1d18b3);if(_0x57adc4['query']['filter']){_0x4d4c62['where']=_[_0x020a('0x37')](_0x4d4c62[_0x020a('0x38')],{'$or':_[_0x020a('0x2d')](_0x1d18b3,function(_0xe6d940){if(_0xe6d940['type']!=='VIRTUAL'){var _0x52f621={};_0x52f621[_0xe6d940[_0x020a('0x26')]]={'$like':'%'+_0x57adc4['query']['filter']+'%'};return _0x52f621;}})});}_0x4d4c62=_[_0x020a('0x37')]({},_0x4d4c62,_0x57adc4[_0x020a('0x39')]);var _0x4d4121={'where':_0x4d4c62['where']};return db[_0x020a('0x28')][_0x020a('0x1e')](_0x4d4121)['then'](function(_0x59dcc5){_0x337183[_0x020a('0x1e')]=_0x59dcc5;if(_0x57adc4['query']['includeAll']){_0x4d4c62[_0x020a('0x3a')]=[{'all':!![]}];}return db[_0x020a('0x28')][_0x020a('0x3b')](_0x4d4c62);})[_0x020a('0x24')](function(_0x5c318a){_0x337183[_0x020a('0x3c')]=_0x5c318a;return _0x337183;})[_0x020a('0x24')](respondWithFilteredResult(_0x428750,_0x4d4c62))[_0x020a('0x3d')](handleError(_0x428750,null));};exports[_0x020a('0x3e')]=function(_0x50b04f,_0x5b22c1){var _0x5b7021={'raw':!![],'where':{'id':_0x50b04f[_0x020a('0x3f')]['id']}},_0x295480={};_0x295480[_0x020a('0x2c')]=_[_0x020a('0x2e')](db[_0x020a('0x28')]['rawAttributes']);_0x295480[_0x020a('0x2f')]=_[_0x020a('0x2e')](_0x50b04f[_0x020a('0x2f')]);_0x295480[_0x020a('0x30')]=_[_0x020a('0x31')](_0x295480[_0x020a('0x2c')],_0x295480[_0x020a('0x2f')]);_0x5b7021[_0x020a('0x32')]=_[_0x020a('0x31')](_0x295480['model'],qs[_0x020a('0x33')](_0x50b04f['query']['fields']));_0x5b7021[_0x020a('0x32')]=_0x5b7021[_0x020a('0x32')]['length']?_0x5b7021[_0x020a('0x32')]:_0x295480[_0x020a('0x2c')];if(_0x50b04f['query'][_0x020a('0x40')]){_0x5b7021[_0x020a('0x3a')]=[{'all':!![]}];}_0x5b7021=_[_0x020a('0x37')]({},_0x5b7021,_0x50b04f[_0x020a('0x39')]);return db[_0x020a('0x28')]['find'](_0x5b7021)[_0x020a('0x24')](handleEntityNotFound(_0x5b22c1,null))[_0x020a('0x24')](respondWithResult(_0x5b22c1,null))[_0x020a('0x3d')](handleError(_0x5b22c1,null));};exports['create']=function(_0x2f2065,_0x480359){return db[_0x020a('0x28')][_0x020a('0x41')](_0x2f2065['body'],{})[_0x020a('0x24')](respondWithResult(_0x480359,0xc9))[_0x020a('0x3d')](handleError(_0x480359,null));};exports[_0x020a('0x23')]=function(_0x2e67d7,_0x5257c2){if(_0x2e67d7['body']['id']){delete _0x2e67d7[_0x020a('0x42')]['id'];}return db[_0x020a('0x28')][_0x020a('0x43')]({'where':{'id':_0x2e67d7[_0x020a('0x3f')]['id']}})[_0x020a('0x24')](handleEntityNotFound(_0x5257c2,null))[_0x020a('0x24')](saveUpdates(_0x2e67d7[_0x020a('0x42')],null))[_0x020a('0x24')](respondWithResult(_0x5257c2,null))[_0x020a('0x3d')](handleError(_0x5257c2,null));};exports['destroy']=function(_0x237f23,_0xab6c2d){return db[_0x020a('0x28')]['find']({'where':{'id':_0x237f23[_0x020a('0x3f')]['id']}})[_0x020a('0x24')](handleEntityNotFound(_0xab6c2d,null))[_0x020a('0x24')](removeEntity(_0xab6c2d,null))[_0x020a('0x3d')](handleError(_0xab6c2d,null));};exports[_0x020a('0x44')]=function(_0x99125c,_0x1cec7e){return db[_0x020a('0x28')]['describe']()[_0x020a('0x24')](respondWithResult(_0x1cec7e,null))[_0x020a('0x3d')](handleError(_0x1cec7e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index bd5486f..f91b76b 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 _0x99be=['../../config/logger','api','moment','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util'];(function(_0x2c1114,_0x2a5c50){var _0x2b877c=function(_0x4f356d){while(--_0x4f356d){_0x2c1114['push'](_0x2c1114['shift']());}};_0x2b877c(++_0x2a5c50);}(_0x99be,0x177));var _0xe99b=function(_0x387778,_0x72f0de){_0x387778=_0x387778-0x0;var _0x3fc2a6=_0x99be[_0x387778];return _0x3fc2a6;};'use strict';var _=require(_0xe99b('0x0'));var util=require(_0xe99b('0x1'));var logger=require(_0xe99b('0x2'))(_0xe99b('0x3'));var moment=require(_0xe99b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe99b('0x5'));var fs=require('fs');var path=require(_0xe99b('0x6'));var rimraf=require(_0xe99b('0x7'));var config=require('../../config/environment');var attributes=require(_0xe99b('0x8'));module[_0xe99b('0x9')]=function(_0x1dbdef,_0x4f1cc1){return _0x1dbdef[_0xe99b('0xa')](_0xe99b('0xb'),attributes,{'tableName':_0xe99b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c0=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','api','bluebird','rimraf'];(function(_0x354d62,_0x4c2044){var _0x4a102c=function(_0x3e4c89){while(--_0x3e4c89){_0x354d62['push'](_0x354d62['shift']());}};_0x4a102c(++_0x4c2044);}(_0xc2c0,0xa7));var _0x0c2c=function(_0x4278e4,_0x179fc5){_0x4278e4=_0x4278e4-0x0;var _0x5668ae=_0xc2c0[_0x4278e4];return _0x5668ae;};'use strict';var _=require(_0x0c2c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c2c('0x1'));var moment=require('moment');var BPromise=require(_0x0c2c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c2c('0x3'));var config=require('../../config/environment');var attributes=require(_0x0c2c('0x4'));module[_0x0c2c('0x5')]=function(_0x4e5547,_0x2cc722){return _0x4e5547[_0x0c2c('0x6')](_0x0c2c('0x7'),attributes,{'tableName':_0x0c2c('0x8'),'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 e598a72..e1a8d77 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 _0x34b7=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x5d8e11,_0x1b2574){var _0x25fa53=function(_0x5376ce){while(--_0x5376ce){_0x5d8e11['push'](_0x5d8e11['shift']());}};_0x25fa53(++_0x1b2574);}(_0x34b7,0x196));var _0x734b=function(_0x4dfce8,_0x2a9880){_0x4dfce8=_0x4dfce8-0x0;var _0x488a8c=_0x34b7[_0x4dfce8];return _0x488a8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')](_0x5edbe9[_0x734b('0x18')],{'raw':_0x5edbe9[_0x734b('0x19')]?_0x5edbe9[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![]})[_0x734b('0x1b')](function(_0x67eed){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x67eed));_0x56a95c(_0x67eed);})['catch'](function(_0x1e4dcc){logger[_0x734b('0xf')]('CreateSquareDetailsReport',_0x1e4dcc[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1e4dcc[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0x0b7f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','SquareDetailsReport,\x20%s,\x20%s','message','request\x20sent','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','stringify','catch','lodash','util','bluebird'];(function(_0x2c46a7,_0x14d549){var _0x59fc85=function(_0x1514a5){while(--_0x1514a5){_0x2c46a7['push'](_0x2c46a7['shift']());}};_0x59fc85(++_0x14d549);}(_0x0b7f,0x115));var _0xf0b7=function(_0x17730a,_0x362127){_0x17730a=_0x17730a-0x0;var _0x485db1=_0x0b7f[_0x17730a];return _0x485db1;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var moment=require('moment');var BPromise=require(_0xf0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0b7('0x3'));var db=require(_0xf0b7('0x4'))['db'];var utils=require(_0xf0b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0b7('0x6'));var jayson=require(_0xf0b7('0x7'));var client=jayson[_0xf0b7('0x8')][_0xf0b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2de8,_0x5e449a,_0x1408ee){return new BPromise(function(_0x276f09,_0x275a13){return client[_0xf0b7('0xa')](_0x2b2de8,_0x1408ee)[_0xf0b7('0xb')](function(_0x588b46){logger[_0xf0b7('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e449a,'request\x20sent');logger['debug'](_0xf0b7('0xd'),_0x5e449a,'request\x20sent',JSON['stringify'](_0x588b46));if(_0x588b46[_0xf0b7('0xe')]){if(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0xf')]===0x1f4){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x275a13(_0x588b46[_0xf0b7('0xe')]['message']);}logger['error'](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x276f09(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);}else{logger['info'](_0xf0b7('0x10'),_0x5e449a,_0xf0b7('0x12'));_0x276f09(_0x588b46[_0xf0b7('0x13')][_0xf0b7('0x11')]);}})['catch'](function(_0x303db6){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x303db6);_0x275a13(_0x303db6);});});}exports[_0xf0b7('0x14')]=function(_0x52b27e){var _0x1e5fc9=this;return new Promise(function(_0x153d23,_0x28fd36){return db[_0xf0b7('0x15')][_0xf0b7('0x16')](_0x52b27e['body'],{'raw':_0x52b27e[_0xf0b7('0x17')]?_0x52b27e['options'][_0xf0b7('0x18')]===undefined?!![]:![]:!![]})[_0xf0b7('0xb')](function(_0x374496){logger['info']('CreateSquareDetailsReport',_0x52b27e);logger[_0xf0b7('0x19')](_0xf0b7('0x14'),_0x52b27e,JSON[_0xf0b7('0x1a')](_0x374496));_0x153d23(_0x374496);})[_0xf0b7('0x1b')](function(_0xb90b3c){logger[_0xf0b7('0xe')](_0xf0b7('0x14'),_0xb90b3c[_0xf0b7('0x11')],_0x52b27e);_0x28fd36(_0x1e5fc9[_0xf0b7('0xe')](0x1f4,_0xb90b3c['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index f837278..9b14f98 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 _0xc616=['exports','express','Router','../../components/auth/service','get','isAuthenticated','killProcess'];(function(_0x42477b,_0x48cffc){var _0x16a075=function(_0x42df8b){while(--_0x42df8b){_0x42477b['push'](_0x42477b['shift']());}};_0x16a075(++_0x48cffc);}(_0xc616,0x12e));var _0x6c61=function(_0x479c68,_0x4f2415){_0x479c68=_0x479c68-0x0;var _0x5215b1=_0xc616[_0x479c68];return _0x5215b1;};'use strict';var express=require(_0x6c61('0x0'));var router=express[_0x6c61('0x1')]();var auth=require(_0x6c61('0x2'));var controller=require('./system.controller');router[_0x6c61('0x3')]('/',auth[_0x6c61('0x4')](),controller['index']);router[_0x6c61('0x3')]('/process/:pid/kill',auth[_0x6c61('0x4')](),controller[_0x6c61('0x5')]);module[_0x6c61('0x6')]=router; \ No newline at end of file +var _0x1d2c=['/process/:pid/kill','isAuthenticated','killProcess','express','Router','./system.controller','get'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1d2c,0x1df));var _0xc1d2=function(_0x43ee73,_0xe2d82a){_0x43ee73=_0x43ee73-0x0;var _0x46c602=_0x1d2c[_0x43ee73];return _0x46c602;};'use strict';var express=require(_0xc1d2('0x0'));var router=express[_0xc1d2('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xc1d2('0x2'));router[_0xc1d2('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc1d2('0x3')](_0xc1d2('0x4'),auth[_0xc1d2('0x5')](),controller[_0xc1d2('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 b5614cf..feb8700 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 _0xd68a=['killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','then','json','catch'];(function(_0x2e0854,_0x52544a){var _0x4d0ff9=function(_0x3647fb){while(--_0x3647fb){_0x2e0854['push'](_0x2e0854['shift']());}};_0x4d0ff9(++_0x52544a);}(_0xd68a,0x78));var _0xad68=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xd68a[_0x37c22c];return _0x119d79;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0xad68('0x0'))('api');var util=require(_0xad68('0x1'));var BPromise=require('bluebird');var _=require(_0xad68('0x2'));function handleError(_0x2929be,_0x33d2f5,_0x54eeca){_0x33d2f5=_0x33d2f5||0x1f4;return function(_0x5be166){logger[_0xad68('0x3')](_0xad68('0x4'),_0x54eeca,_0x33d2f5,util[_0xad68('0x5')](_0x5be166,{'showHidden':![],'depth':null}));delete _0x5be166['name'];_0x2929be[_0xad68('0x6')](_0x33d2f5)[_0xad68('0x7')](_0x5be166);};}exports[_0xad68('0x8')]=function(_0x5c55df,_0x3d32f4){return info['getAllData']()[_0xad68('0x9')](function(_0x4e3e1e){return _0x3d32f4[_0xad68('0x6')](0xc8)[_0xad68('0xa')](_0x4e3e1e);})[_0xad68('0xb')](function(_0xb744ee){return _0x3d32f4[_0xad68('0x6')](0x1f4)[_0xad68('0xa')](_0xb744ee);});};exports[_0xad68('0xc')]=function(_0x34da77,_0x2686ea){var _0x142331=['components/import/cm'];return new BPromise(function(_0x541f95,_0x1cd39d){return exec(util['format'](_0xad68('0xd'),_0x34da77[_0xad68('0xe')][_0xad68('0xf')]),function(_0x3cdc2b,_0x17147f,_0x3bba6a){if(_0x3cdc2b){return _0x1cd39d(_0x3cdc2b);}return _0x541f95(_0x17147f);});})[_0xad68('0x9')](function(_0x2f59de){var _0x58866b=![];var _0x114fad=_0x2f59de[_0xad68('0x10')](/\n/);for(var _0x4e4995=0x0,_0x241eae=_0x142331['length'];_0x4e4995<_0x241eae,_0x58866b===![];_0x4e4995+=0x1){if(_0x2f59de[_0xad68('0x11')](_0x142331[_0x4e4995])>=0x0){_0x58866b=!![];}}if(!_0x58866b){throw new Error(util[_0xad68('0x12')](_0xad68('0x13'),_0x34da77[_0xad68('0xe')][_0xad68('0xf')]));}process[_0xad68('0x14')](_0x34da77[_0xad68('0xe')][_0xad68('0xf')],'SIGINT');return _0x2686ea[_0xad68('0x6')](0xc8)[_0xad68('0xa')]({'message':util[_0xad68('0x12')](_0xad68('0x15'),_0x34da77['params'][_0xad68('0xf')])});})[_0xad68('0xb')](handleError(_0x2686ea,null,_0xad68('0xc')));}; \ No newline at end of file +var _0xdd0d=['exec','api','util','lodash','error','inspect','name','send','index','then','status','catch','json','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!','SIGINT','systeminformation','child_process'];(function(_0x3f2cdb,_0x123c97){var _0xe804ee=function(_0x5b63c8){while(--_0x5b63c8){_0x3f2cdb['push'](_0x3f2cdb['shift']());}};_0xe804ee(++_0x123c97);}(_0xdd0d,0x1c0));var _0xddd0=function(_0x569b58,_0xc01048){_0x569b58=_0x569b58-0x0;var _0x40efd2=_0xdd0d[_0x569b58];return _0x40efd2;};'use strict';var info=require(_0xddd0('0x0'));var exec=require(_0xddd0('0x1'))[_0xddd0('0x2')];var logger=require('../../config/logger')(_0xddd0('0x3'));var util=require(_0xddd0('0x4'));var BPromise=require('bluebird');var _=require(_0xddd0('0x5'));function handleError(_0x518ae7,_0x2f73bf,_0x42180f){_0x2f73bf=_0x2f73bf||0x1f4;return function(_0x4d3b83){logger[_0xddd0('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x42180f,_0x2f73bf,util[_0xddd0('0x7')](_0x4d3b83,{'showHidden':![],'depth':null}));delete _0x4d3b83[_0xddd0('0x8')];_0x518ae7['status'](_0x2f73bf)[_0xddd0('0x9')](_0x4d3b83);};}exports[_0xddd0('0xa')]=function(_0x37026e,_0x3ef490){return info['getAllData']()[_0xddd0('0xb')](function(_0x3d4e12){return _0x3ef490[_0xddd0('0xc')](0xc8)['json'](_0x3d4e12);})[_0xddd0('0xd')](function(_0xc251e5){return _0x3ef490[_0xddd0('0xc')](0x1f4)[_0xddd0('0xe')](_0xc251e5);});};exports[_0xddd0('0xf')]=function(_0x19a0c4,_0x54620b){var _0x219e59=[_0xddd0('0x10')];return new BPromise(function(_0x505054,_0x53e044){return exec(util[_0xddd0('0x11')](_0xddd0('0x12'),_0x19a0c4[_0xddd0('0x13')][_0xddd0('0x14')]),function(_0x295c93,_0x25793d,_0x369ff9){if(_0x295c93){return _0x53e044(_0x295c93);}return _0x505054(_0x25793d);});})[_0xddd0('0xb')](function(_0x403b5a){var _0x5ca68f=![];var _0x1bdb27=_0x403b5a[_0xddd0('0x15')](/\n/);for(var _0x176aaa=0x0,_0x172daf=_0x219e59[_0xddd0('0x16')];_0x176aaa<_0x172daf,_0x5ca68f===![];_0x176aaa+=0x1){if(_0x403b5a['indexOf'](_0x219e59[_0x176aaa])>=0x0){_0x5ca68f=!![];}}if(!_0x5ca68f){throw new Error(util[_0xddd0('0x11')](_0xddd0('0x17'),_0x19a0c4[_0xddd0('0x13')][_0xddd0('0x14')]));}process['kill'](_0x19a0c4[_0xddd0('0x13')]['pid'],_0xddd0('0x18'));return _0x54620b[_0xddd0('0xc')](0xc8)[_0xddd0('0xe')]({'message':util[_0xddd0('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x19a0c4[_0xddd0('0x13')][_0xddd0('0x14')])});})[_0xddd0('0xd')](handleError(_0x54620b,null,_0xddd0('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 3ab8498..6d031ed 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 _0x3adf=['isAuthenticated','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x3adf,0x1a6));var _0xf3ad=function(_0x286819,_0x84199){_0x286819=_0x286819-0x0;var _0x29a0fe=_0x3adf[_0x286819];return _0x29a0fe;};'use strict';var multer=require(_0xf3ad('0x0'));var util=require(_0xf3ad('0x1'));var path=require(_0xf3ad('0x2'));var timeout=require(_0xf3ad('0x3'));var express=require(_0xf3ad('0x4'));var router=express[_0xf3ad('0x5')]();var fs_extra=require(_0xf3ad('0x6'));var auth=require(_0xf3ad('0x7'));var interaction=require(_0xf3ad('0x8'));var config=require('../../config/environment');var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf3ad('0x9')]('/:id',auth[_0xf3ad('0xa')](),controller['show']);router[_0xf3ad('0xb')]('/',auth[_0xf3ad('0xa')](),controller[_0xf3ad('0xc')]);router[_0xf3ad('0xd')](_0xf3ad('0xe'),auth[_0xf3ad('0xa')](),controller[_0xf3ad('0xf')]);router[_0xf3ad('0x10')](_0xf3ad('0xe'),auth[_0xf3ad('0xa')](),controller['destroy']);module[_0xf3ad('0x11')]=router; \ No newline at end of file +var _0xe961=['fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','create','update','delete','exports','connect-timeout','Router'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xe961,0x11b));var _0x1e96=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xe961[_0x110c3d];return _0x226d67;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1e96('0x0'));var express=require('express');var router=express[_0x1e96('0x1')]();var fs_extra=require(_0x1e96('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1e96('0x3'));var config=require(_0x1e96('0x4'));var controller=require(_0x1e96('0x5'));router[_0x1e96('0x6')]('/',auth[_0x1e96('0x7')](),controller[_0x1e96('0x8')]);router[_0x1e96('0x6')](_0x1e96('0x9'),auth['isAuthenticated'](),controller[_0x1e96('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1e96('0xb')]);router['put'](_0x1e96('0x9'),auth[_0x1e96('0x7')](),controller[_0x1e96('0xc')]);router[_0x1e96('0xd')](_0x1e96('0x9'),auth[_0x1e96('0x7')](),controller['destroy']);module[_0x1e96('0xe')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1c0b796..431eeec 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 _0x2868=['#0091EA','sequelize','STRING','name'];(function(_0x520d2b,_0x4a057a){var _0x2104d9=function(_0x3afb8e){while(--_0x3afb8e){_0x520d2b['push'](_0x520d2b['shift']());}};_0x2104d9(++_0x4a057a);}(_0x2868,0x191));var _0x8286=function(_0x163c97,_0xe78347){_0x163c97=_0x163c97-0x0;var _0x504a68=_0x2868[_0x163c97];return _0x504a68;};'use strict';var Sequelize=require(_0x8286('0x0'));module['exports']={'name':{'type':Sequelize[_0x8286('0x1')],'unique':_0x8286('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x8286('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb84e=['STRING','name','exports'];(function(_0x271418,_0xf00f2c){var _0x19bef0=function(_0xc31509){while(--_0xc31509){_0x271418['push'](_0x271418['shift']());}};_0x19bef0(++_0xf00f2c);}(_0xb84e,0xbf));var _0xeb84=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0xb84e[_0x284a61];return _0x220e3c;};'use strict';var Sequelize=require('sequelize');module[_0xeb84('0x0')]={'name':{'type':Sequelize[_0xeb84('0x1')],'unique':_0xeb84('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xeb84('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 3fdd7ac..80863fb 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 _0xd52d=['destroy','get','Tags','UserProfileResource','sendStatus','error','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd52d,0x1c7));var _0xdd52=function(_0x17740b,_0x12e6e1){_0x17740b=_0x17740b-0x0;var _0x2a5e03=_0xd52d[_0x17740b];return _0x2a5e03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd52('0x0'));var zipdir=require(_0xdd52('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd52('0x3'));var util=require(_0xdd52('0x4'));var path=require(_0xdd52('0x5'));var sox=require(_0xdd52('0x6'));var csv=require(_0xdd52('0x7'));var ejs=require(_0xdd52('0x8'));var fs=require('fs');var fs_extra=require(_0xdd52('0x9'));var _=require(_0xdd52('0xa'));var squel=require('squel');var crypto=require(_0xdd52('0xb'));var jsforce=require(_0xdd52('0xc'));var deskjs=require(_0xdd52('0xd'));var toCsv=require(_0xdd52('0x7'));var querystring=require(_0xdd52('0xe'));var Papa=require(_0xdd52('0xf'));var Redis=require(_0xdd52('0x10'));var authService=require(_0xdd52('0x11'));var qs=require(_0xdd52('0x12'));var as=require(_0xdd52('0x13'));var hardwareService=require(_0xdd52('0x14'));var logger=require(_0xdd52('0x15'))(_0xdd52('0x16'));var utils=require('../../config/utils');var config=require(_0xdd52('0x17'));var licenseUtil=require(_0xdd52('0x18'));var db=require(_0xdd52('0x19'))['db'];function respondWithStatusCode(_0x2e940f,_0x19283f){_0x19283f=_0x19283f||0xcc;return function(_0xee8463){if(_0xee8463){return _0x2e940f['sendStatus'](_0x19283f);}return _0x2e940f[_0xdd52('0x1a')](_0x19283f)[_0xdd52('0x1b')]();};}function respondWithResult(_0x2e5642,_0x55b823){_0x55b823=_0x55b823||0xc8;return function(_0x3f6585){if(_0x3f6585){return _0x2e5642[_0xdd52('0x1a')](_0x55b823)[_0xdd52('0x1c')](_0x3f6585);}};}function respondWithFilteredResult(_0x181876,_0x336797){return function(_0x12c6da){if(_0x12c6da){var _0x25a2b7=typeof _0x336797[_0xdd52('0x1d')]==='undefined'&&typeof _0x336797[_0xdd52('0x1e')]==='undefined';var _0x2822be=_0x12c6da[_0xdd52('0x1f')];var _0x4568dc=_0x25a2b7?0x0:_0x336797[_0xdd52('0x1d')];var _0x4dc017=_0x25a2b7?_0x12c6da[_0xdd52('0x1f')]:_0x336797[_0xdd52('0x1d')]+_0x336797[_0xdd52('0x1e')];var _0x13f667;if(_0x4dc017>=_0x2822be){_0x4dc017=_0x2822be;_0x13f667=0xc8;}else{_0x13f667=0xce;}_0x181876['status'](_0x13f667);return _0x181876[_0xdd52('0x20')]('Content-Range',_0x4568dc+'-'+_0x4dc017+'/'+_0x2822be)[_0xdd52('0x1c')](_0x12c6da);}return null;};}function patchUpdates(_0x56e1db){return function(_0x30c411){try{jsonpatch[_0xdd52('0x21')](_0x30c411,_0x56e1db,!![]);}catch(_0x5a671a){return BPromise[_0xdd52('0x22')](_0x5a671a);}return _0x30c411['save']();};}function saveUpdates(_0x38c153,_0x59a041){return function(_0x14cd54){if(_0x14cd54){return _0x14cd54[_0xdd52('0x23')](_0x38c153)[_0xdd52('0x24')](function(_0xfd321){return _0xfd321;});}return null;};}function removeEntity(_0x1e8dbb,_0x455e74){return function(_0x3ce226){if(_0x3ce226){return _0x3ce226[_0xdd52('0x25')]()['then'](function(){var _0x1cedeb=_0x3ce226[_0xdd52('0x26')]({'plain':!![]});var _0x592f15=_0xdd52('0x27');return db[_0xdd52('0x28')][_0xdd52('0x25')]({'where':{'type':_0x592f15,'resourceId':_0x1cedeb['id']}})[_0xdd52('0x24')](function(){return _0x3ce226;});})['then'](function(){_0x1e8dbb[_0xdd52('0x1a')](0xcc)[_0xdd52('0x1b')]();});}};}function handleEntityNotFound(_0x70ed7b,_0x54edf6){return function(_0x515e78){if(!_0x515e78){_0x70ed7b[_0xdd52('0x29')](0x194);}return _0x515e78;};}function handleError(_0x4e8290,_0x38b4ae){_0x38b4ae=_0x38b4ae||0x1f4;return function(_0x3f96bd){logger[_0xdd52('0x2a')](_0x3f96bd['stack']);if(_0x3f96bd['name']){delete _0x3f96bd[_0xdd52('0x2b')];}_0x4e8290[_0xdd52('0x1a')](_0x38b4ae)[_0xdd52('0x2c')](_0x3f96bd);};}exports['index']=function(_0x48548d,_0x9b6070){var _0x566658={},_0x29c940={},_0x271353={'count':0x0,'rows':[]};var _0x1e1b3e=_[_0xdd52('0x2d')](db[_0xdd52('0x2e')][_0xdd52('0x2f')],function(_0x219226){return{'name':_0x219226[_0xdd52('0x30')],'type':_0x219226[_0xdd52('0x31')][_0xdd52('0x32')]};});_0x29c940[_0xdd52('0x33')]=_[_0xdd52('0x2d')](_0x1e1b3e,_0xdd52('0x2b'));_0x29c940[_0xdd52('0x34')]=_[_0xdd52('0x35')](_0x48548d[_0xdd52('0x34')]);_0x29c940[_0xdd52('0x36')]=_[_0xdd52('0x37')](_0x29c940[_0xdd52('0x33')],_0x29c940[_0xdd52('0x34')]);_0x566658[_0xdd52('0x38')]=_['intersection'](_0x29c940[_0xdd52('0x33')],qs[_0xdd52('0x39')](_0x48548d['query']['fields']));_0x566658['attributes']=_0x566658[_0xdd52('0x38')][_0xdd52('0x3a')]?_0x566658[_0xdd52('0x38')]:_0x29c940[_0xdd52('0x33')];if(!_0x48548d[_0xdd52('0x34')][_0xdd52('0x3b')](_0xdd52('0x3c'))){_0x566658[_0xdd52('0x1e')]=qs[_0xdd52('0x1e')](_0x48548d[_0xdd52('0x34')]['limit']);_0x566658[_0xdd52('0x1d')]=qs[_0xdd52('0x1d')](_0x48548d[_0xdd52('0x34')][_0xdd52('0x1d')]);}_0x566658[_0xdd52('0x3d')]=qs[_0xdd52('0x3e')](_0x48548d[_0xdd52('0x34')][_0xdd52('0x3e')]);_0x566658[_0xdd52('0x3f')]=qs[_0xdd52('0x36')](_[_0xdd52('0x40')](_0x48548d[_0xdd52('0x34')],_0x29c940[_0xdd52('0x36')]),_0x1e1b3e);if(_0x48548d[_0xdd52('0x34')][_0xdd52('0x41')]){_0x566658[_0xdd52('0x3f')]=_[_0xdd52('0x42')](_0x566658[_0xdd52('0x3f')],{'$or':_[_0xdd52('0x2d')](_0x1e1b3e,function(_0x2c3f3c){if(_0x2c3f3c[_0xdd52('0x31')]!=='VIRTUAL'){var _0x4c2e3b={};_0x4c2e3b[_0x2c3f3c[_0xdd52('0x2b')]]={'$like':'%'+_0x48548d[_0xdd52('0x34')][_0xdd52('0x41')]+'%'};return _0x4c2e3b;}})});}_0x566658=_[_0xdd52('0x42')]({},_0x566658,_0x48548d[_0xdd52('0x43')]);var _0x136b01={'where':_0x566658[_0xdd52('0x3f')]};return db[_0xdd52('0x2e')][_0xdd52('0x1f')](_0x136b01)[_0xdd52('0x24')](function(_0x4efd40){_0x271353[_0xdd52('0x1f')]=_0x4efd40;if(_0x48548d[_0xdd52('0x34')][_0xdd52('0x44')]){_0x566658['include']=[{'all':!![]}];}return db[_0xdd52('0x2e')][_0xdd52('0x45')](_0x566658);})[_0xdd52('0x24')](function(_0x2968b5){_0x271353[_0xdd52('0x46')]=_0x2968b5;return _0x271353;})[_0xdd52('0x24')](respondWithFilteredResult(_0x9b6070,_0x566658))['catch'](handleError(_0x9b6070,null));};exports[_0xdd52('0x47')]=function(_0x3b79cf,_0x1cd269){var _0x4cac5c={'raw':!![],'where':{'id':_0x3b79cf[_0xdd52('0x48')]['id']}},_0x9fd63f={};_0x9fd63f['model']=_[_0xdd52('0x35')](db['Tag'][_0xdd52('0x2f')]);_0x9fd63f['query']=_['keys'](_0x3b79cf['query']);_0x9fd63f[_0xdd52('0x36')]=_[_0xdd52('0x37')](_0x9fd63f[_0xdd52('0x33')],_0x9fd63f[_0xdd52('0x34')]);_0x4cac5c[_0xdd52('0x38')]=_[_0xdd52('0x37')](_0x9fd63f['model'],qs[_0xdd52('0x39')](_0x3b79cf[_0xdd52('0x34')][_0xdd52('0x39')]));_0x4cac5c['attributes']=_0x4cac5c[_0xdd52('0x38')][_0xdd52('0x3a')]?_0x4cac5c[_0xdd52('0x38')]:_0x9fd63f[_0xdd52('0x33')];if(_0x3b79cf['query'][_0xdd52('0x44')]){_0x4cac5c[_0xdd52('0x49')]=[{'all':!![]}];}_0x4cac5c=_['merge']({},_0x4cac5c,_0x3b79cf[_0xdd52('0x43')]);return db[_0xdd52('0x2e')][_0xdd52('0x4a')](_0x4cac5c)['then'](handleEntityNotFound(_0x1cd269,null))['then'](respondWithResult(_0x1cd269,null))[_0xdd52('0x4b')](handleError(_0x1cd269,null));};exports[_0xdd52('0x4c')]=function(_0x1017d6,_0x5adb59){return db[_0xdd52('0x2e')]['create'](_0x1017d6[_0xdd52('0x4d')],{})[_0xdd52('0x24')](function(_0x29e730){var _0x4d0f37=_0x1017d6['user'][_0xdd52('0x26')]({'plain':!![]});if(!_0x4d0f37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d0f37[_0xdd52('0x4e')]===_0xdd52('0x4f')){var _0x1ff2c3=_0x29e730[_0xdd52('0x26')]({'plain':!![]});var _0x2387ed=_0xdd52('0x27');return db['UserProfileSection'][_0xdd52('0x4a')]({'where':{'name':_0x2387ed,'userProfileId':_0x4d0f37[_0xdd52('0x50')]},'raw':!![]})[_0xdd52('0x24')](function(_0x411a69){if(_0x411a69&&_0x411a69['autoAssociation']===0x0){return db[_0xdd52('0x28')][_0xdd52('0x4c')]({'name':_0x1ff2c3[_0xdd52('0x2b')],'resourceId':_0x1ff2c3['id'],'type':_0x411a69['name'],'sectionId':_0x411a69['id']},{})[_0xdd52('0x24')](function(){return _0x29e730;});}else{return _0x29e730;}})[_0xdd52('0x4b')](function(_0x19bc88){logger[_0xdd52('0x2a')](_0xdd52('0x51'),_0x19bc88);throw _0x19bc88;});}return _0x29e730;})['then'](respondWithResult(_0x5adb59,0xc9))[_0xdd52('0x4b')](handleError(_0x5adb59,null));};exports[_0xdd52('0x23')]=function(_0x26133c,_0x41fcb6){if(_0x26133c[_0xdd52('0x4d')]['id']){delete _0x26133c['body']['id'];}return db[_0xdd52('0x2e')][_0xdd52('0x4a')]({'where':{'id':_0x26133c['params']['id']}})['then'](handleEntityNotFound(_0x41fcb6,null))[_0xdd52('0x24')](saveUpdates(_0x26133c['body'],null))[_0xdd52('0x24')](respondWithResult(_0x41fcb6,null))[_0xdd52('0x4b')](handleError(_0x41fcb6,null));};exports['destroy']=function(_0x1e6f5a,_0x5365ff){return db['Tag']['find']({'where':{'id':_0x1e6f5a[_0xdd52('0x48')]['id']}})[_0xdd52('0x24')](handleEntityNotFound(_0x5365ff,null))[_0xdd52('0x24')](removeEntity(_0x5365ff,null))[_0xdd52('0x4b')](handleError(_0x5365ff,null));}; \ No newline at end of file +var _0xedd9=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','get','Tags','end','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','keys','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x198c58,_0x2ea394){var _0x361ce8=function(_0xe62e2f){while(--_0xe62e2f){_0x198c58['push'](_0x198c58['shift']());}};_0x361ce8(++_0x2ea394);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ed583,_0xa0a388){_0x3ed583=_0x3ed583-0x0;var _0x35c84f=_0xedd9[_0x3ed583];return _0x35c84f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){var _0xeaf55a=_0x339a0d[_0x9edd('0x22')]({'plain':!![]});var _0x2f9f86=_0x9edd('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f9f86,'resourceId':_0xeaf55a['id']}})[_0x9edd('0x21')](function(){return _0x339a0d;});})[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x24')]();});}};}function handleEntityNotFound(_0x3c2227,_0x4fe471){return function(_0x57a2cc){if(!_0x57a2cc){_0x3c2227[_0x9edd('0x18')](0x194);}return _0x57a2cc;};}function handleError(_0x257a26,_0x1c762c){_0x1c762c=_0x1c762c||0x1f4;return function(_0x52746a){logger[_0x9edd('0x25')](_0x52746a[_0x9edd('0x26')]);if(_0x52746a[_0x9edd('0x27')]){delete _0x52746a[_0x9edd('0x27')];}_0x257a26['status'](_0x1c762c)[_0x9edd('0x28')](_0x52746a);};}exports[_0x9edd('0x29')]=function(_0xbe87e1,_0x12c1bc){var _0xbbf08f={},_0x42e664={},_0x209aba={'count':0x0,'rows':[]};var _0x1fba7b=_[_0x9edd('0x2a')](db[_0x9edd('0x2b')][_0x9edd('0x2c')],function(_0x138002){return{'name':_0x138002[_0x9edd('0x2d')],'type':_0x138002[_0x9edd('0x2e')][_0x9edd('0x2f')]};});_0x42e664['model']=_[_0x9edd('0x2a')](_0x1fba7b,_0x9edd('0x27'));_0x42e664[_0x9edd('0x30')]=_['keys'](_0xbe87e1[_0x9edd('0x30')]);_0x42e664[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x42e664[_0x9edd('0x33')],_0x42e664[_0x9edd('0x30')]);_0xbbf08f[_0x9edd('0x34')]=_[_0x9edd('0x32')](_0x42e664[_0x9edd('0x33')],qs[_0x9edd('0x35')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x35')]));_0xbbf08f[_0x9edd('0x34')]=_0xbbf08f[_0x9edd('0x34')][_0x9edd('0x36')]?_0xbbf08f['attributes']:_0x42e664[_0x9edd('0x33')];if(!_0xbe87e1['query'][_0x9edd('0x37')](_0x9edd('0x38'))){_0xbbf08f[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0xbe87e1[_0x9edd('0x30')]['limit']);_0xbbf08f[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x1b')]);}_0xbbf08f[_0x9edd('0x39')]=qs[_0x9edd('0x3a')](_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x3a')]);_0xbbf08f[_0x9edd('0x3b')]=qs[_0x9edd('0x31')](_['pick'](_0xbe87e1[_0x9edd('0x30')],_0x42e664['filters']),_0x1fba7b);if(_0xbe87e1[_0x9edd('0x30')]['filter']){_0xbbf08f[_0x9edd('0x3b')]=_[_0x9edd('0x3c')](_0xbbf08f[_0x9edd('0x3b')],{'$or':_['map'](_0x1fba7b,function(_0x2e85aa){if(_0x2e85aa[_0x9edd('0x2e')]!==_0x9edd('0x3d')){var _0x48958a={};_0x48958a[_0x2e85aa[_0x9edd('0x27')]]={'$like':'%'+_0xbe87e1['query'][_0x9edd('0x3e')]+'%'};return _0x48958a;}})});}_0xbbf08f=_[_0x9edd('0x3c')]({},_0xbbf08f,_0xbe87e1['options']);var _0x315f52={'where':_0xbbf08f[_0x9edd('0x3b')]};return db[_0x9edd('0x2b')][_0x9edd('0x1e')](_0x315f52)['then'](function(_0x449f01){_0x209aba['count']=_0x449f01;if(_0xbe87e1[_0x9edd('0x30')][_0x9edd('0x3f')]){_0xbbf08f['include']=[{'all':!![]}];}return db[_0x9edd('0x2b')]['findAll'](_0xbbf08f);})['then'](function(_0x369b69){_0x209aba[_0x9edd('0x40')]=_0x369b69;return _0x209aba;})[_0x9edd('0x21')](respondWithFilteredResult(_0x12c1bc,_0xbbf08f))[_0x9edd('0x41')](handleError(_0x12c1bc,null));};exports[_0x9edd('0x42')]=function(_0x4737ae,_0x3ff512){var _0x75efbe={'raw':!![],'where':{'id':_0x4737ae[_0x9edd('0x43')]['id']}},_0x18c149={};_0x18c149[_0x9edd('0x33')]=_[_0x9edd('0x44')](db[_0x9edd('0x2b')][_0x9edd('0x2c')]);_0x18c149[_0x9edd('0x30')]=_['keys'](_0x4737ae[_0x9edd('0x30')]);_0x18c149[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x18c149[_0x9edd('0x33')],_0x18c149[_0x9edd('0x30')]);_0x75efbe[_0x9edd('0x34')]=_[_0x9edd('0x32')](_0x18c149['model'],qs['fields'](_0x4737ae['query'][_0x9edd('0x35')]));_0x75efbe['attributes']=_0x75efbe[_0x9edd('0x34')][_0x9edd('0x36')]?_0x75efbe[_0x9edd('0x34')]:_0x18c149[_0x9edd('0x33')];if(_0x4737ae[_0x9edd('0x30')]['includeAll']){_0x75efbe[_0x9edd('0x45')]=[{'all':!![]}];}_0x75efbe=_[_0x9edd('0x3c')]({},_0x75efbe,_0x4737ae[_0x9edd('0x46')]);return db['Tag'][_0x9edd('0x47')](_0x75efbe)[_0x9edd('0x21')](handleEntityNotFound(_0x3ff512,null))[_0x9edd('0x21')](respondWithResult(_0x3ff512,null))[_0x9edd('0x41')](handleError(_0x3ff512,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){return db[_0x9edd('0x2b')][_0x9edd('0x48')](_0x35bdec['body'],{})[_0x9edd('0x21')](function(_0x8d8701){var _0x4bb324=_0x35bdec[_0x9edd('0x49')][_0x9edd('0x22')]({'plain':!![]});if(!_0x4bb324)throw new Error(_0x9edd('0x4a'));if(_0x4bb324['role']===_0x9edd('0x49')){var _0x151157=_0x8d8701[_0x9edd('0x22')]({'plain':!![]});var _0x28c7bd='Tags';return db[_0x9edd('0x4b')][_0x9edd('0x47')]({'where':{'name':_0x28c7bd,'userProfileId':_0x4bb324[_0x9edd('0x4c')]},'raw':!![]})['then'](function(_0x16951a){if(_0x16951a&&_0x16951a[_0x9edd('0x4d')]===0x0){return db['UserProfileResource'][_0x9edd('0x48')]({'name':_0x151157['name'],'resourceId':_0x151157['id'],'type':_0x16951a[_0x9edd('0x27')],'sectionId':_0x16951a['id']},{})[_0x9edd('0x21')](function(){return _0x8d8701;});}else{return _0x8d8701;}})[_0x9edd('0x41')](function(_0x3fcdf5){logger[_0x9edd('0x25')](_0x9edd('0x4e'),_0x3fcdf5);throw _0x3fcdf5;});}return _0x8d8701;})[_0x9edd('0x21')](respondWithResult(_0x4d4f33,0xc9))[_0x9edd('0x41')](handleError(_0x4d4f33,null));};exports[_0x9edd('0x4f')]=function(_0x25d9cc,_0x31272d){if(_0x25d9cc['body']['id']){delete _0x25d9cc[_0x9edd('0x50')]['id'];}return db[_0x9edd('0x2b')][_0x9edd('0x47')]({'where':{'id':_0x25d9cc['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x31272d,null))['then'](saveUpdates(_0x25d9cc['body'],null))['then'](respondWithResult(_0x31272d,null))[_0x9edd('0x41')](handleError(_0x31272d,null));};exports[_0x9edd('0x51')]=function(_0x366316,_0x35ddb3){return db['Tag']['find']({'where':{'id':_0x366316['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x35ddb3,null))[_0x9edd('0x21')](removeEntity(_0x35ddb3,null))[_0x9edd('0x41')](handleError(_0x35ddb3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 627f1cb..27f4aeb 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 _0x24dd=['bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','../../config/logger','moment'];(function(_0x291f8d,_0x5a6a98){var _0x45c151=function(_0x377ad0){while(--_0x377ad0){_0x291f8d['push'](_0x291f8d['shift']());}};_0x45c151(++_0x5a6a98);}(_0x24dd,0x1ab));var _0xd24d=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x24dd[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd24d('0x0'))('api');var moment=require(_0xd24d('0x1'));var BPromise=require(_0xd24d('0x2'));var rp=require(_0xd24d('0x3'));var fs=require('fs');var path=require(_0xd24d('0x4'));var rimraf=require(_0xd24d('0x5'));var config=require(_0xd24d('0x6'));var attributes=require(_0xd24d('0x7'));module[_0xd24d('0x8')]=function(_0x2f818f,_0x4d353e){return _0x2f818f[_0xd24d('0x9')](_0xd24d('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb56b=['../../config/logger','api','moment','bluebird','path','rimraf','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x54c176,_0x1566b2){var _0x3c912=function(_0x26f0b7){while(--_0x26f0b7){_0x54c176['push'](_0x54c176['shift']());}};_0x3c912(++_0x1566b2);}(_0xb56b,0xdc));var _0xbb56=function(_0x2ee01d,_0x48f7a7){_0x2ee01d=_0x2ee01d-0x0;var _0x24bc9f=_0xb56b[_0x2ee01d];return _0x24bc9f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbb56('0x0'))(_0xbb56('0x1'));var moment=require(_0xbb56('0x2'));var BPromise=require(_0xbb56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb56('0x4'));var rimraf=require(_0xbb56('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb56('0x6'));module[_0xbb56('0x7')]=function(_0x414691,_0x3dc5ef){return _0x414691[_0xbb56('0x8')](_0xbb56('0x9'),attributes,{'tableName':_0xbb56('0xa'),'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 1595a4f..651348a 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 _0x7a59=['debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0x7a59,0x16e));var _0x97a5=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7a59[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97a5('0x1'));var rs=require(_0x97a5('0x2'));var fs=require('fs');var Redis=require(_0x97a5('0x3'));var db=require(_0x97a5('0x4'))['db'];var utils=require(_0x97a5('0x5'));var logger=require('../../config/logger')(_0x97a5('0x6'));var config=require(_0x97a5('0x7'));var jayson=require(_0x97a5('0x8'));var client=jayson['client'][_0x97a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d32f,_0x2663b9,_0x2c0efa){return new BPromise(function(_0x27e8a6,_0x156789){return client[_0x97a5('0xa')](_0x52d32f,_0x2c0efa)['then'](function(_0x4f34e8){logger[_0x97a5('0xb')](_0x97a5('0xc'),_0x2663b9,_0x97a5('0xd'));logger[_0x97a5('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x2663b9,'request\x20sent',JSON[_0x97a5('0xf')](_0x4f34e8));if(_0x4f34e8[_0x97a5('0x10')]){if(_0x4f34e8[_0x97a5('0x10')]['code']===0x1f4){logger[_0x97a5('0x10')](_0x97a5('0xc'),_0x2663b9,_0x4f34e8['error']['message']);return _0x156789(_0x4f34e8[_0x97a5('0x10')][_0x97a5('0x11')]);}logger['error']('Tag,\x20%s,\x20%s',_0x2663b9,_0x4f34e8['error']['message']);return _0x27e8a6(_0x4f34e8[_0x97a5('0x10')][_0x97a5('0x11')]);}else{logger[_0x97a5('0xb')]('Tag,\x20%s,\x20%s',_0x2663b9,_0x97a5('0xd'));_0x27e8a6(_0x4f34e8[_0x97a5('0x12')]['message']);}})[_0x97a5('0x13')](function(_0x5ee8ca){logger[_0x97a5('0x10')]('Tag,\x20%s,\x20%s',_0x2663b9,_0x5ee8ca);_0x156789(_0x5ee8ca);});});} \ No newline at end of file +var _0x99c9=['code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a52ed,_0x25b476){var _0x2fa11b=function(_0x7fb989){while(--_0x7fb989){_0x4a52ed['push'](_0x4a52ed['shift']());}};_0x2fa11b(++_0x25b476);}(_0x99c9,0x13c));var _0x999c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x99c9[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var moment=require(_0x999c('0x2'));var BPromise=require(_0x999c('0x3'));var rs=require(_0x999c('0x4'));var fs=require('fs');var Redis=require(_0x999c('0x5'));var db=require(_0x999c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x999c('0x7'))(_0x999c('0x8'));var config=require(_0x999c('0x9'));var jayson=require(_0x999c('0xa'));var client=jayson[_0x999c('0xb')][_0x999c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34f100,_0x651b7e,_0xc8a6b5){return new BPromise(function(_0xb88ec1,_0x329252){return client[_0x999c('0xd')](_0x34f100,_0xc8a6b5)[_0x999c('0xe')](function(_0x395321){logger['info'](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));logger['debug'](_0x999c('0x11'),_0x651b7e,_0x999c('0x10'),JSON[_0x999c('0x12')](_0x395321));if(_0x395321[_0x999c('0x13')]){if(_0x395321[_0x999c('0x13')][_0x999c('0x14')]===0x1f4){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')][_0x999c('0x15')]);return _0x329252(_0x395321[_0x999c('0x13')][_0x999c('0x15')]);}logger['error'](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')]['message']);return _0xb88ec1(_0x395321['error']['message']);}else{logger[_0x999c('0x16')](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));_0xb88ec1(_0x395321[_0x999c('0x17')][_0x999c('0x15')]);}})['catch'](function(_0x226437){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x226437);_0x329252(_0x226437);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index de496db..391a285 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_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['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 bffcbb0..1053ebf 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 _0x0713=['STRING','name'];(function(_0x4739f5,_0x284058){var _0x579c50=function(_0x2e39eb){while(--_0x2e39eb){_0x4739f5['push'](_0x4739f5['shift']());}};_0x579c50(++_0x284058);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x264dab,_0x3438a9){var _0x4ef151=function(_0x2766fd){while(--_0x2766fd){_0x264dab['push'](_0x264dab['shift']());}};_0x4ef151(++_0x3438a9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index beadfd3..b445162 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 _0x27f4=['name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','options','then','includeAll','include','Team','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','sendStatus','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','pick','capitalize','add','ids','removeQueues','findOne','addAgents','isArray','Voice','Sms','Fax','Openchannel','Whatsapp','through','penalty','Queues','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','interface','UserVoiceQueueRt','upsert','isNil','format','all','Chat','Mail','transaction','Queue:remove','removeAgents','TeamVoicePrefix','getAgents','order','filter','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./team.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','error','stack'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x27f4,0x101));var _0x427f=function(_0x7ea1fb,_0x2f0b74){_0x7ea1fb=_0x7ea1fb-0x0;var _0x478241=_0x27f4[_0x7ea1fb];return _0x478241;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x427f('0x0'));var jsonpatch=require(_0x427f('0x1'));var rp=require(_0x427f('0x2'));var moment=require(_0x427f('0x3'));var BPromise=require(_0x427f('0x4'));var Mustache=require(_0x427f('0x5'));var util=require(_0x427f('0x6'));var path=require(_0x427f('0x7'));var sox=require(_0x427f('0x8'));var csv=require(_0x427f('0x9'));var ejs=require(_0x427f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x427f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x427f('0x9'));var querystring=require(_0x427f('0xc'));var Papa=require(_0x427f('0xd'));var Redis=require('ioredis');var authService=require(_0x427f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x427f('0xf'));var logger=require(_0x427f('0x10'))(_0x427f('0x11'));var utils=require(_0x427f('0x12'));var config=require(_0x427f('0x13'));var licenseUtil=require(_0x427f('0x14'));var db=require(_0x427f('0x15'))['db'];config['redis']=_[_0x427f('0x16')](config['redis'],{'host':_0x427f('0x17'),'port':0x18eb});var socket=require(_0x427f('0x18'))(new Redis(config[_0x427f('0x19')]));require(_0x427f('0x1a'))[_0x427f('0x1b')](socket);function respondWithStatusCode(_0x3c33fc,_0x5888a7){_0x5888a7=_0x5888a7||0xcc;return function(_0x531bd6){if(_0x531bd6){return _0x3c33fc['sendStatus'](_0x5888a7);}return _0x3c33fc[_0x427f('0x1c')](_0x5888a7)[_0x427f('0x1d')]();};}function respondWithResult(_0xb29dbf,_0x3721b9){_0x3721b9=_0x3721b9||0xc8;return function(_0xbcd247){if(_0xbcd247){return _0xb29dbf[_0x427f('0x1c')](_0x3721b9)[_0x427f('0x1e')](_0xbcd247);}};}function respondWithFilteredResult(_0x1add96,_0x2d5432){return function(_0x961fd0){if(_0x961fd0){var _0x1dec34=typeof _0x2d5432[_0x427f('0x1f')]==='undefined'&&typeof _0x2d5432['limit']===_0x427f('0x20');var _0x3e509b=_0x961fd0[_0x427f('0x21')];var _0x487b99=_0x1dec34?0x0:_0x2d5432[_0x427f('0x1f')];var _0x1633c6=_0x1dec34?_0x961fd0[_0x427f('0x21')]:_0x2d5432[_0x427f('0x1f')]+_0x2d5432[_0x427f('0x22')];var _0x3f1d86;if(_0x1633c6>=_0x3e509b){_0x1633c6=_0x3e509b;_0x3f1d86=0xc8;}else{_0x3f1d86=0xce;}_0x1add96[_0x427f('0x1c')](_0x3f1d86);return _0x1add96[_0x427f('0x23')](_0x427f('0x24'),_0x487b99+'-'+_0x1633c6+'/'+_0x3e509b)[_0x427f('0x1e')](_0x961fd0);}return null;};}function patchUpdates(_0x1e3875){return function(_0x5c1076){try{jsonpatch['apply'](_0x5c1076,_0x1e3875,!![]);}catch(_0xdcc7cb){return BPromise[_0x427f('0x25')](_0xdcc7cb);}return _0x5c1076[_0x427f('0x26')]();};}function saveUpdates(_0x5ac7ac,_0x443d42){return function(_0x89f22d){if(_0x89f22d){return _0x89f22d['update'](_0x5ac7ac)['then'](function(_0x13ca52){return _0x13ca52;});}return null;};}function handleEntityNotFound(_0x14b09b,_0x102175){return function(_0x456204){if(!_0x456204){_0x14b09b['sendStatus'](0x194);}return _0x456204;};}function handleError(_0x17083e,_0x2bd959){_0x2bd959=_0x2bd959||0x1f4;return function(_0x167c7f){logger[_0x427f('0x27')](_0x167c7f[_0x427f('0x28')]);if(_0x167c7f[_0x427f('0x29')]){delete _0x167c7f[_0x427f('0x29')];}_0x17083e[_0x427f('0x1c')](_0x2bd959)[_0x427f('0x2a')](_0x167c7f);};}exports[_0x427f('0x2b')]=function(_0x10dd03,_0x11ebe7){var _0x94a6ce={},_0x1bd598={},_0x32fd04={'count':0x0,'rows':[]};var _0x2c015d=_[_0x427f('0x2c')](db['Team'][_0x427f('0x2d')],function(_0x97ca8a){return{'name':_0x97ca8a[_0x427f('0x2e')],'type':_0x97ca8a[_0x427f('0x2f')]['key']};});_0x1bd598[_0x427f('0x30')]=_['map'](_0x2c015d,_0x427f('0x29'));_0x1bd598[_0x427f('0x31')]=_[_0x427f('0x32')](_0x10dd03[_0x427f('0x31')]);_0x1bd598['filters']=_[_0x427f('0x33')](_0x1bd598[_0x427f('0x30')],_0x1bd598[_0x427f('0x31')]);_0x94a6ce[_0x427f('0x34')]=_['intersection'](_0x1bd598[_0x427f('0x30')],qs[_0x427f('0x35')](_0x10dd03['query'][_0x427f('0x35')]));_0x94a6ce[_0x427f('0x34')]=_0x94a6ce[_0x427f('0x34')][_0x427f('0x36')]?_0x94a6ce['attributes']:_0x1bd598[_0x427f('0x30')];if(!_0x10dd03[_0x427f('0x31')][_0x427f('0x37')](_0x427f('0x38'))){_0x94a6ce[_0x427f('0x22')]=qs[_0x427f('0x22')](_0x10dd03[_0x427f('0x31')][_0x427f('0x22')]);_0x94a6ce[_0x427f('0x1f')]=qs[_0x427f('0x1f')](_0x10dd03[_0x427f('0x31')][_0x427f('0x1f')]);}_0x94a6ce['order']=qs[_0x427f('0x39')](_0x10dd03[_0x427f('0x31')][_0x427f('0x39')]);_0x94a6ce[_0x427f('0x3a')]=qs[_0x427f('0x3b')](_['pick'](_0x10dd03[_0x427f('0x31')],_0x1bd598['filters']),_0x2c015d);if(_0x10dd03[_0x427f('0x31')]['filter']){_0x94a6ce[_0x427f('0x3a')]=_[_0x427f('0x3c')](_0x94a6ce[_0x427f('0x3a')],{'$or':_[_0x427f('0x2c')](_0x2c015d,function(_0x569963){if(_0x569963[_0x427f('0x2f')]!==_0x427f('0x3d')){var _0x4d32cb={};_0x4d32cb[_0x569963['name']]={'$like':'%'+_0x10dd03[_0x427f('0x31')]['filter']+'%'};return _0x4d32cb;}})});}_0x94a6ce=_[_0x427f('0x3c')]({},_0x94a6ce,_0x10dd03[_0x427f('0x3e')]);var _0x46a629={'where':_0x94a6ce['where']};return db['Team'][_0x427f('0x21')](_0x46a629)[_0x427f('0x3f')](function(_0xe8629c){_0x32fd04['count']=_0xe8629c;if(_0x10dd03[_0x427f('0x31')][_0x427f('0x40')]){_0x94a6ce[_0x427f('0x41')]=[{'all':!![]}];}return db[_0x427f('0x42')]['findAll'](_0x94a6ce);})[_0x427f('0x3f')](function(_0x365098){_0x32fd04[_0x427f('0x43')]=_0x365098;return _0x32fd04;})[_0x427f('0x3f')](respondWithFilteredResult(_0x11ebe7,_0x94a6ce))[_0x427f('0x44')](handleError(_0x11ebe7,null));};exports[_0x427f('0x45')]=function(_0x22acbb,_0x556081){var _0x1d245b={'raw':![],'where':{'id':_0x22acbb[_0x427f('0x46')]['id']}},_0x458bbd={};_0x458bbd[_0x427f('0x30')]=_[_0x427f('0x32')](db[_0x427f('0x42')]['rawAttributes']);_0x458bbd[_0x427f('0x31')]=_['keys'](_0x22acbb[_0x427f('0x31')]);_0x458bbd['filters']=_[_0x427f('0x33')](_0x458bbd[_0x427f('0x30')],_0x458bbd[_0x427f('0x31')]);_0x1d245b[_0x427f('0x34')]=_['intersection'](_0x458bbd[_0x427f('0x30')],qs[_0x427f('0x35')](_0x22acbb['query'][_0x427f('0x35')]));_0x1d245b['attributes']=_0x1d245b[_0x427f('0x34')][_0x427f('0x36')]?_0x1d245b[_0x427f('0x34')]:_0x458bbd['model'];if(_0x22acbb[_0x427f('0x31')][_0x427f('0x40')]){_0x1d245b[_0x427f('0x41')]=[{'all':!![]}];}_0x1d245b=_[_0x427f('0x3c')]({},_0x1d245b,_0x22acbb['options']);return db['Team'][_0x427f('0x47')](_0x1d245b)[_0x427f('0x3f')](handleEntityNotFound(_0x556081,null))[_0x427f('0x3f')](respondWithResult(_0x556081,null))['catch'](handleError(_0x556081,null));};exports['create']=function(_0xa2bb63,_0x72c201){return db[_0x427f('0x42')][_0x427f('0x48')](_0xa2bb63['body'],{})[_0x427f('0x3f')](function(_0x345e63){var _0x5b02a8=_0xa2bb63[_0x427f('0x49')][_0x427f('0x4a')]({'plain':!![]});if(!_0x5b02a8)throw new Error(_0x427f('0x4b'));if(_0x5b02a8[_0x427f('0x4c')]===_0x427f('0x49')){var _0x7e2167=_0x345e63[_0x427f('0x4a')]({'plain':!![]});var _0x6a632=_0x427f('0x4d');return db['UserProfileSection'][_0x427f('0x47')]({'where':{'name':_0x6a632,'userProfileId':_0x5b02a8[_0x427f('0x4e')]},'raw':!![]})[_0x427f('0x3f')](function(_0x460ac5){if(_0x460ac5&&_0x460ac5[_0x427f('0x4f')]===0x0){return db[_0x427f('0x50')][_0x427f('0x48')]({'name':_0x7e2167[_0x427f('0x29')],'resourceId':_0x7e2167['id'],'type':_0x460ac5[_0x427f('0x29')],'sectionId':_0x460ac5['id']},{})['then'](function(){return _0x345e63;});}else{return _0x345e63;}})[_0x427f('0x44')](function(_0x26f5a3){logger[_0x427f('0x27')](_0x427f('0x51'),_0x26f5a3);throw _0x26f5a3;});}return _0x345e63;})[_0x427f('0x3f')](respondWithResult(_0x72c201,0xc9))['catch'](handleError(_0x72c201,null));};exports[_0x427f('0x52')]=function(_0x27911a,_0x334b2a){if(_0x27911a[_0x427f('0x53')]['id']){delete _0x27911a[_0x427f('0x53')]['id'];}return db['Team'][_0x427f('0x47')]({'where':{'id':_0x27911a['params']['id']}})['then'](handleEntityNotFound(_0x334b2a,null))[_0x427f('0x3f')](saveUpdates(_0x27911a[_0x427f('0x53')],null))[_0x427f('0x3f')](respondWithResult(_0x334b2a,null))['catch'](handleError(_0x334b2a,null));};exports[_0x427f('0x54')]=function(_0x14503b,_0x2e5ecc){var _0x2ca169=_0x14503b[_0x427f('0x46')]['id'];var _0x4169f7=[];return db[_0x427f('0x55')]['transaction'](function(_0x2b57fb){var _0x56befd=_0x427f('0x56')+_0x2ca169;return db[_0x427f('0x55')][_0x427f('0x31')](_0x56befd,{'type':db[_0x427f('0x57')][_0x427f('0x58')][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb})['then'](function(_0x2e2961){_0x4169f7=_['map'](_0x2e2961,function(_0x6b7dfb){return Number(_0x6b7dfb[_0x427f('0x5a')]);});})[_0x427f('0x3f')](function(){var _0x4dfd0e='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ca169;return db[_0x427f('0x55')][_0x427f('0x31')](_0x4dfd0e,{'type':db[_0x427f('0x57')][_0x427f('0x58')][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(_0x4def29){var _0x185d91=_[_0x427f('0x2c')](_0x4def29,function(_0x29e11f){return Number(_0x29e11f['VoiceQueueId']);});return db['UserVoiceQueue'][_0x427f('0x54')]({'where':{'UserId':{'$in':_0x4169f7},'VoiceQueueId':{'$in':_0x185d91}},'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(){var _0x55559a='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ca169;return db['sequelize'][_0x427f('0x31')](_0x55559a,{'type':db['Sequelize']['QueryTypes'][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb});})['then'](function(_0x14a376){var _0x289036=_[_0x427f('0x2c')](_0x14a376,function(_0xcf6043){return Number(_0xcf6043['MailQueueId']);});return db[_0x427f('0x5b')]['destroy']({'where':{'UserId':{'$in':_0x4169f7},'MailQueueId':{'$in':_0x289036}},'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(){var _0x34207a=_0x427f('0x5c')+_0x2ca169;return db[_0x427f('0x55')][_0x427f('0x31')](_0x34207a,{'type':db[_0x427f('0x57')]['QueryTypes'][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(_0x294189){var _0x583d1d=_[_0x427f('0x2c')](_0x294189,function(_0x404e3d){return Number(_0x404e3d['SmsQueueId']);});return db[_0x427f('0x5d')][_0x427f('0x54')]({'where':{'UserId':{'$in':_0x4169f7},'SmsQueueId':{'$in':_0x583d1d}},'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(){var _0x17131c=_0x427f('0x5e')+_0x2ca169;return db['sequelize'][_0x427f('0x31')](_0x17131c,{'type':db['Sequelize'][_0x427f('0x58')][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(_0x27da97){var _0x502075=_[_0x427f('0x2c')](_0x27da97,function(_0x4aedb0){return Number(_0x4aedb0['ChatQueueId']);});return db['UserChatQueue'][_0x427f('0x54')]({'where':{'UserId':{'$in':_0x4169f7},'ChatQueueId':{'$in':_0x502075}},'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(){var _0x3b48fd='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2ca169;return db[_0x427f('0x55')][_0x427f('0x31')](_0x3b48fd,{'type':db[_0x427f('0x57')][_0x427f('0x58')][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb});})['then'](function(_0x54d1ec){var _0x14e809=_['map'](_0x54d1ec,function(_0x19f099){return Number(_0x19f099[_0x427f('0x5f')]);});return db[_0x427f('0x60')]['destroy']({'where':{'UserId':{'$in':_0x4169f7},'FaxQueueId':{'$in':_0x14e809}},'transaction':_0x2b57fb});})['then'](function(){var _0x1c286c=_0x427f('0x61')+_0x2ca169;return db[_0x427f('0x55')][_0x427f('0x31')](_0x1c286c,{'type':db['Sequelize']['QueryTypes'][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(_0x480bb3){var _0x32306e=_[_0x427f('0x2c')](_0x480bb3,function(_0x3f3ac0){return Number(_0x3f3ac0[_0x427f('0x62')]);});return db[_0x427f('0x63')]['destroy']({'where':{'UserId':{'$in':_0x4169f7},'OpenchannelQueueId':{'$in':_0x32306e}},'transaction':_0x2b57fb});})['then'](function(){var _0x273c9e=_0x427f('0x64')+_0x2ca169;return db['sequelize'][_0x427f('0x31')](_0x273c9e,{'type':db[_0x427f('0x57')][_0x427f('0x58')][_0x427f('0x59')],'raw':!![],'transaction':_0x2b57fb});})['then'](function(_0xdd30d6){var _0x35c2c3=_[_0x427f('0x2c')](_0xdd30d6,function(_0x524655){return Number(_0x524655[_0x427f('0x65')]);});return db[_0x427f('0x66')][_0x427f('0x54')]({'where':{'UserId':{'$in':_0x4169f7},'WhatsappQueueId':{'$in':_0x35c2c3}},'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(){return db['TeamVoicePrefix'][_0x427f('0x47')]({'where':{'TeamId':_0x2ca169}});})['then'](function(_0x5056f2){if(_0x5056f2===null){return;}return db[_0x427f('0x67')][_0x427f('0x54')]({'where':{'UserId':{'$in':_0x4169f7},'VoicePrefixId':_0x5056f2['VoicePrefixId']},'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(){return db[_0x427f('0x42')][_0x427f('0x54')]({'where':{'id':_0x2ca169},'cascade':!![],'transaction':_0x2b57fb});})[_0x427f('0x3f')](function(_0x5d0d29){if(_0x5d0d29===0x0){_0x2e5ecc[_0x427f('0x68')](0x194);}else{return db[_0x427f('0x50')]['destroy']({'where':{'type':_0x427f('0x4d'),'resourceId':_0x2ca169},'cascade':!![],'transaction':_0x2b57fb})[_0x427f('0x3f')](function(){_0x2e5ecc['status'](0xcc)[_0x427f('0x1d')]();});}})[_0x427f('0x44')](function(_0x5a67cf){_0x2e5ecc[_0x427f('0x1c')](0x1f4)[_0x427f('0x2a')](_0x5a67cf);});});};exports['getQueues']=function(_0x460a18,_0x46e310,_0x59ddd3){return db[_0x427f('0x42')]['findOne']({'where':{'id':_0x460a18[_0x427f('0x46')]['id']}})[_0x427f('0x3f')](handleEntityNotFound(_0x46e310,null))[_0x427f('0x3f')](function(_0x1a6c31){if(!_0x460a18[_0x427f('0x31')]['channel']||!utils[_0x427f('0x69')](_0x460a18['query'][_0x427f('0x6a')])){throw new db[(_0x427f('0x57'))][(_0x427f('0x6b'))](_0x427f('0x6c'));}var _0x36a2d6={};var _0x276b45={};_0x276b45[_0x427f('0x30')]=_[_0x427f('0x32')](db[_['capitalize'](_0x460a18[_0x427f('0x31')][_0x427f('0x6a')][_0x427f('0x6d')]())+_0x427f('0x6e')][_0x427f('0x2d')]);_0x276b45['query']=_['keys'](_0x460a18[_0x427f('0x31')]);_0x276b45[_0x427f('0x3b')]=_[_0x427f('0x33')](_0x276b45['model'],_0x276b45[_0x427f('0x31')]);_0x36a2d6[_0x427f('0x34')]=_[_0x427f('0x33')](_0x276b45[_0x427f('0x30')],qs[_0x427f('0x35')](_0x460a18[_0x427f('0x31')][_0x427f('0x35')]));_0x36a2d6[_0x427f('0x34')]=_0x36a2d6[_0x427f('0x34')][_0x427f('0x36')]?_0x36a2d6[_0x427f('0x34')]:_0x276b45[_0x427f('0x30')];_0x36a2d6[_0x427f('0x22')]=qs[_0x427f('0x22')](_0x460a18[_0x427f('0x31')][_0x427f('0x22')]);_0x36a2d6[_0x427f('0x1f')]=qs['offset'](_0x460a18[_0x427f('0x31')][_0x427f('0x1f')]);_0x36a2d6['order']=qs[_0x427f('0x39')](_0x460a18[_0x427f('0x31')]['sort']);_0x36a2d6[_0x427f('0x3a')]=qs[_0x427f('0x3b')](_[_0x427f('0x6f')](_0x460a18[_0x427f('0x31')],_0x276b45[_0x427f('0x3b')]));_0x36a2d6=_['merge']({},_0x36a2d6,_0x460a18['options']);return _0x1a6c31[_0x427f('0x4a')+_[_0x427f('0x70')](_0x460a18[_0x427f('0x31')]['channel'][_0x427f('0x6d')]())+'Queues'](_0x36a2d6);})[_0x427f('0x3f')](respondWithResult(_0x46e310,null))[_0x427f('0x44')](handleError(_0x46e310,null));};exports['addQueues']=function(_0x3d479c,_0x299b1b,_0x29e550){return db['Team']['findOne']({'where':{'id':_0x3d479c['params']['id']}})['then'](function(_0x2d8a93){if(_0x2d8a93){if(!_0x3d479c[_0x427f('0x53')][_0x427f('0x6a')]||!utils[_0x427f('0x69')](_0x3d479c[_0x427f('0x53')][_0x427f('0x6a')])){throw new db['Sequelize'][(_0x427f('0x6b'))](_0x427f('0x6c'));}return _0x2d8a93[_0x427f('0x71')+_['capitalize'](_0x3d479c['body'][_0x427f('0x6a')]['toLowerCase']())+'Queues'](_0x3d479c[_0x427f('0x53')][_0x427f('0x72')]);}return null;})['then'](handleEntityNotFound(_0x299b1b,null))[_0x427f('0x3f')](respondWithStatusCode(_0x299b1b,null))[_0x427f('0x44')](handleError(_0x299b1b,null));};exports[_0x427f('0x73')]=function(_0x4bec85,_0x43b6d4,_0xd7c958){return db['Team'][_0x427f('0x74')]({'where':{'id':_0x4bec85[_0x427f('0x46')]['id']}})[_0x427f('0x3f')](function(_0x26a1d6){if(_0x26a1d6){if(!_0x4bec85[_0x427f('0x31')][_0x427f('0x6a')]||!utils[_0x427f('0x69')](_0x4bec85[_0x427f('0x31')][_0x427f('0x6a')])){throw new db[(_0x427f('0x57'))]['ValidationError'](_0x427f('0x6c'));}return _0x26a1d6['remove'+_[_0x427f('0x70')](_0x4bec85[_0x427f('0x31')][_0x427f('0x6a')][_0x427f('0x6d')]())+'Queues'](_0x4bec85['query'][_0x427f('0x72')]);}return null;})['then'](handleEntityNotFound(_0x43b6d4,null))[_0x427f('0x3f')](respondWithStatusCode(_0x43b6d4,null))[_0x427f('0x44')](handleError(_0x43b6d4,null));};exports[_0x427f('0x75')]=function(_0x476316,_0x85ea61){var _0x355f5f=_[_0x427f('0x76')](_0x476316[_0x427f('0x53')][_0x427f('0x72')])?_0x476316['body']['ids']:[_0x476316[_0x427f('0x53')][_0x427f('0x72')]];var _0x4a1dd8=_0x476316[_0x427f('0x46')]['id'];return db[_0x427f('0x42')][_0x427f('0x47')]({'where':{'id':_0x4a1dd8}})[_0x427f('0x3f')](handleEntityNotFound(_0x85ea61,null))[_0x427f('0x3f')](function(_0x2768f6){if(_0x2768f6){var _0x18388c=[_0x427f('0x77'),'Chat','Mail',_0x427f('0x78'),_0x427f('0x79'),_0x427f('0x7a'),_0x427f('0x7b')];return db[_0x427f('0x55')]['transaction'](function(_0x4dc060){var _0x250331=_['map'](_0x18388c,function(_0x119be6){var _0x37dda0={'attributes':['id',_0x427f('0x29')]};if(_0x119be6===_0x427f('0x77')){_0x37dda0[_0x427f('0x7c')]={'attributes':[_0x427f('0x7d')]};}return _0x2768f6[_0x427f('0x4a')+_0x119be6+_0x427f('0x7e')](_0x37dda0)[_0x427f('0x3f')](function(_0x5e3c96){var _0x428983=_[_0x427f('0x2c')](_0x5e3c96,function(_0x13933b){var _0x590604=_[_0x427f('0x2c')](_0x355f5f,function(_0x49e7b5){var _0xe7112e={'where':{'UserId':_0x49e7b5,[_0x119be6+_0x427f('0x7f')]:_0x13933b['id']},'transaction':_0x4dc060};if(_0x119be6===_0x427f('0x77')){_0xe7112e[_0x427f('0x16')]={'penalty':_0x13933b[_0x427f('0x80')][_0x427f('0x7d')]};}return db[_0x427f('0x81')+_0x119be6+_0x427f('0x6e')][_0x427f('0x82')](_0xe7112e)[_0x427f('0x3f')](function(){socket[_0x427f('0x83')](_0x427f('0x49')+_0x119be6+_0x427f('0x84'),{'UserId':_0x49e7b5,[_0x119be6+_0x427f('0x7f')]:_0x13933b['id']});if(_0x119be6!==_0x427f('0x77')){return;}return db['User'][_0x427f('0x85')]({'where':{'id':_0x355f5f,'online':0x1},'attributes':['id',_0x427f('0x29'),'online','voicePause',_0x427f('0x86')],'raw':!![]})[_0x427f('0x3f')](function(_0x344c17){var _0x3944ee=_['map'](_0x344c17,function(_0x4b990a){return db[_0x427f('0x87')][_0x427f('0x88')]({'membername':_0x4b990a['name'],'UserId':_0x4b990a['id'],'queue_name':_0x13933b['name'],'VoiceQueueId':_0x13933b['id'],'interface':_[_0x427f('0x89')](_0x4b990a[_0x427f('0x86')])?util[_0x427f('0x8a')]('SIP/%s',_0x4b990a['name']):_0x4b990a[_0x427f('0x86')],'paused':_0x4b990a['voicePause']||![],'penalty':_0x13933b[_0x427f('0x80')][_0x427f('0x7d')]},{'transaction':_0x4dc060});});return Promise[_0x427f('0x8b')](_0x3944ee);});});});return Promise[_0x427f('0x8b')](_0x590604);});return Promise[_0x427f('0x8b')](_0x428983);})[_0x427f('0x3f')](function(){return db['TeamVoicePrefix'][_0x427f('0x74')]({'where':{'teamId':_0x4a1dd8}})[_0x427f('0x3f')](function(_0x5765b7){if(_0x5765b7){var _0x14999b=_[_0x427f('0x2c')](_0x355f5f,function(_0x48163b){db['UserVoicePrefix']['upsert']({'UserId':_0x48163b,'VoicePrefixId':_0x5765b7['VoicePrefixId']});});return Promise[_0x427f('0x8b')](_0x14999b);}});});});return Promise[_0x427f('0x8b')](_0x250331)['then'](function(){return _0x2768f6[_0x427f('0x75')](_0x355f5f,{'transaction':_0x4dc060})['spread'](function(_0x3f19bd){return _0x3f19bd;});});});}})['then'](respondWithResult(_0x85ea61,null))[_0x427f('0x44')](handleError(_0x85ea61,null));};exports['removeAgents']=function(_0x51c75a,_0x2a7f5a){var _0x3e22af=_[_0x427f('0x76')](_0x51c75a[_0x427f('0x31')][_0x427f('0x72')])?_0x51c75a[_0x427f('0x31')][_0x427f('0x72')]:[_0x51c75a[_0x427f('0x31')][_0x427f('0x72')]];var _0x115b76=_0x51c75a[_0x427f('0x46')]['id'];return db[_0x427f('0x42')][_0x427f('0x47')]({'where':{'id':_0x115b76}})[_0x427f('0x3f')](handleEntityNotFound(_0x2a7f5a,null))[_0x427f('0x3f')](function(_0x307677){if(_0x307677){var _0x4ed69e=[_0x427f('0x77'),_0x427f('0x8c'),_0x427f('0x8d'),_0x427f('0x78'),'Fax','Openchannel',_0x427f('0x7b')];return db[_0x427f('0x55')][_0x427f('0x8e')](function(_0x2b5122){var _0xb74f24=_[_0x427f('0x2c')](_0x4ed69e,function(_0xf6c2d5){var _0x44a12c={'attributes':['id','name']};return _0x307677[_0x427f('0x4a')+_0xf6c2d5+'Queues'](_0x44a12c)[_0x427f('0x3f')](function(_0x4bbb6f){var _0x3d0640=_[_0x427f('0x2c')](_0x4bbb6f,function(_0x3f6828){return _0x3f6828['removeAgents'](_0x3e22af,{'transaction':_0x2b5122})[_0x427f('0x3f')](function(){var _0x505d6b=_[_0x427f('0x2c')](_0x3e22af,function(_0x5e80fe){socket[_0x427f('0x83')](_0x427f('0x49')+_0xf6c2d5+_0x427f('0x8f'),{'UserId':Number(_0x5e80fe),[_0xf6c2d5+_0x427f('0x7f')]:_0x3f6828['id']});if(_0xf6c2d5!==_0x427f('0x77')){return;}return db[_0x427f('0x87')][_0x427f('0x54')]({'where':{'VoiceQueueId':_0x3f6828['id'],'UserId':_0x5e80fe},'transaction':_0x2b5122});});return Promise[_0x427f('0x8b')](_0x505d6b);});});return Promise[_0x427f('0x8b')](_0x3d0640);});});return Promise[_0x427f('0x8b')](_0xb74f24)[_0x427f('0x3f')](function(){return _0x307677[_0x427f('0x90')](_0x3e22af,{'transaction':_0x2b5122});})['then'](function(){return db[_0x427f('0x91')]['findOne']({'where':{'teamId':_0x115b76}})[_0x427f('0x3f')](function(_0x501702){if(_0x501702){var _0x2198a5=_[_0x427f('0x2c')](_0x3e22af,function(_0x1a7f11){db[_0x427f('0x67')][_0x427f('0x54')]({'where':{'UserId':_0x1a7f11,'VoicePrefixId':_0x501702['VoicePrefixId']}});});return Promise[_0x427f('0x8b')](_0x2198a5);}});});});}})['then'](respondWithStatusCode(_0x2a7f5a,null))[_0x427f('0x44')](handleError(_0x2a7f5a,null));};exports[_0x427f('0x92')]=function(_0x53944d,_0x418f47,_0x5ded21){var _0x41541e={};var _0x2b6142={};var _0x2259bd;var _0xc0c58c;return db[_0x427f('0x42')][_0x427f('0x74')]({'where':{'id':_0x53944d[_0x427f('0x46')]['id']}})['then'](handleEntityNotFound(_0x418f47,null))[_0x427f('0x3f')](function(_0x44963c){if(_0x44963c){_0x2259bd=_0x44963c;_0x2b6142[_0x427f('0x30')]=_[_0x427f('0x32')](db['User'][_0x427f('0x2d')]);_0x2b6142['query']=_[_0x427f('0x32')](_0x53944d[_0x427f('0x31')]);_0x2b6142['filters']=_[_0x427f('0x33')](_0x2b6142['model'],_0x2b6142['query']);_0x41541e[_0x427f('0x34')]=_[_0x427f('0x33')](_0x2b6142[_0x427f('0x30')],qs[_0x427f('0x35')](_0x53944d[_0x427f('0x31')][_0x427f('0x35')]));_0x41541e[_0x427f('0x34')]=_0x41541e[_0x427f('0x34')][_0x427f('0x36')]?_0x41541e[_0x427f('0x34')]:_0x2b6142[_0x427f('0x30')];_0x41541e[_0x427f('0x93')]=qs['sort'](_0x53944d[_0x427f('0x31')]['sort']);_0x41541e[_0x427f('0x3a')]=qs['filters'](_[_0x427f('0x6f')](_0x53944d[_0x427f('0x31')],_0x2b6142[_0x427f('0x3b')]));if(_0x53944d['query'][_0x427f('0x94')]){_0x41541e[_0x427f('0x3a')]=_[_0x427f('0x3c')](_0x41541e[_0x427f('0x3a')],{'$or':_[_0x427f('0x2c')](_0x41541e['attributes'],function(_0x3dcb5c){var _0x3a7a11={};_0x3a7a11[_0x3dcb5c]={'$like':'%'+_0x53944d[_0x427f('0x31')][_0x427f('0x94')]+'%'};return _0x3a7a11;})});}_0x41541e=_[_0x427f('0x3c')]({},_0x41541e,_0x53944d['options']);return _0x2259bd[_0x427f('0x92')](_0x41541e);}})[_0x427f('0x3f')](function(_0x40d57d){if(_0x40d57d){_0xc0c58c=_0x40d57d[_0x427f('0x36')];if(!_0x53944d[_0x427f('0x31')][_0x427f('0x37')](_0x427f('0x38'))){_0x41541e[_0x427f('0x22')]=qs[_0x427f('0x22')](_0x53944d['query'][_0x427f('0x22')]);_0x41541e[_0x427f('0x1f')]=qs[_0x427f('0x1f')](_0x53944d[_0x427f('0x31')]['offset']);}return _0x2259bd[_0x427f('0x92')](_0x41541e);}})[_0x427f('0x3f')](function(_0xe2fb5a){if(_0xe2fb5a){return _0xe2fb5a?{'count':_0xc0c58c,'rows':_0xe2fb5a}:null;}})[_0x427f('0x3f')](respondWithResult(_0x418f47,null))['catch'](handleError(_0x418f47,null));}; \ No newline at end of file +var _0x4ae7=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','map','Team','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','findAll','catch','show','params','filters','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','MailQueueId','UserMailQueue','SmsQueueId','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','addQueues','add','ids','removeQueues','remove','Queues','addAgents','Chat','Mail','Fax','Openchannel','Voice','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','Queue:save','online','voicePause','isNil','interface','format','SIP/%s','all','TeamVoicePrefix','spread','removeAgents','isArray','Sms','Whatsapp','emit','Queue:remove','UserVoiceQueueRt','filter','nolimit','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register'];(function(_0x202d3d,_0x5beba3){var _0xc28de5=function(_0x5b197d){while(--_0x5b197d){_0x202d3d['push'](_0x202d3d['shift']());}};_0xc28de5(++_0x5beba3);}(_0x4ae7,0x11e));var _0x74ae=function(_0x39322e,_0x234ff5){_0x39322e=_0x39322e-0x0;var _0x412af8=_0x4ae7[_0x39322e];return _0x412af8;};'use strict';var emlformat=require(_0x74ae('0x0'));var rimraf=require(_0x74ae('0x1'));var zipdir=require(_0x74ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74ae('0x3'));var moment=require(_0x74ae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x74ae('0x5'));var util=require(_0x74ae('0x6'));var path=require(_0x74ae('0x7'));var sox=require(_0x74ae('0x8'));var csv=require(_0x74ae('0x9'));var ejs=require(_0x74ae('0xa'));var fs=require('fs');var fs_extra=require(_0x74ae('0xb'));var _=require(_0x74ae('0xc'));var squel=require(_0x74ae('0xd'));var crypto=require(_0x74ae('0xe'));var jsforce=require(_0x74ae('0xf'));var deskjs=require(_0x74ae('0x10'));var toCsv=require(_0x74ae('0x9'));var querystring=require(_0x74ae('0x11'));var Papa=require('papaparse');var Redis=require(_0x74ae('0x12'));var authService=require(_0x74ae('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x74ae('0x14'));var hardwareService=require(_0x74ae('0x15'));var logger=require(_0x74ae('0x16'))('api');var utils=require(_0x74ae('0x17'));var config=require(_0x74ae('0x18'));var licenseUtil=require(_0x74ae('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x74ae('0x1a')](config[_0x74ae('0x1b')],{'host':_0x74ae('0x1c'),'port':0x18eb});var socket=require(_0x74ae('0x1d'))(new Redis(config[_0x74ae('0x1b')]));require(_0x74ae('0x1e'))[_0x74ae('0x1f')](socket);function respondWithStatusCode(_0x259d92,_0x2fc76e){_0x2fc76e=_0x2fc76e||0xcc;return function(_0x350623){if(_0x350623){return _0x259d92[_0x74ae('0x20')](_0x2fc76e);}return _0x259d92[_0x74ae('0x21')](_0x2fc76e)[_0x74ae('0x22')]();};}function respondWithResult(_0x45e86e,_0x43be1d){_0x43be1d=_0x43be1d||0xc8;return function(_0x3f0bc3){if(_0x3f0bc3){return _0x45e86e[_0x74ae('0x21')](_0x43be1d)[_0x74ae('0x23')](_0x3f0bc3);}};}function respondWithFilteredResult(_0x2a144f,_0x497387){return function(_0x404445){if(_0x404445){var _0x240038=typeof _0x497387[_0x74ae('0x24')]===_0x74ae('0x25')&&typeof _0x497387[_0x74ae('0x26')]===_0x74ae('0x25');var _0x55cf04=_0x404445[_0x74ae('0x27')];var _0x23c746=_0x240038?0x0:_0x497387[_0x74ae('0x24')];var _0x3d234b=_0x240038?_0x404445['count']:_0x497387[_0x74ae('0x24')]+_0x497387[_0x74ae('0x26')];var _0x386a2b;if(_0x3d234b>=_0x55cf04){_0x3d234b=_0x55cf04;_0x386a2b=0xc8;}else{_0x386a2b=0xce;}_0x2a144f[_0x74ae('0x21')](_0x386a2b);return _0x2a144f[_0x74ae('0x28')]('Content-Range',_0x23c746+'-'+_0x3d234b+'/'+_0x55cf04)['json'](_0x404445);}return null;};}function patchUpdates(_0x5008d0){return function(_0x32ea00){try{jsonpatch[_0x74ae('0x29')](_0x32ea00,_0x5008d0,!![]);}catch(_0x5e3ab9){return BPromise[_0x74ae('0x2a')](_0x5e3ab9);}return _0x32ea00[_0x74ae('0x2b')]();};}function saveUpdates(_0x9967f5,_0x582fcc){return function(_0x8c95b5){if(_0x8c95b5){return _0x8c95b5['update'](_0x9967f5)[_0x74ae('0x2c')](function(_0x28950){return _0x28950;});}return null;};}function handleEntityNotFound(_0xe5c88,_0x269c0c){return function(_0x4fc85a){if(!_0x4fc85a){_0xe5c88['sendStatus'](0x194);}return _0x4fc85a;};}function handleError(_0x1d664c,_0x1e57bc){_0x1e57bc=_0x1e57bc||0x1f4;return function(_0x5e5ae1){logger[_0x74ae('0x2d')](_0x5e5ae1[_0x74ae('0x2e')]);if(_0x5e5ae1[_0x74ae('0x2f')]){delete _0x5e5ae1[_0x74ae('0x2f')];}_0x1d664c['status'](_0x1e57bc)['send'](_0x5e5ae1);};}exports[_0x74ae('0x30')]=function(_0x2fa8ce,_0x38a0f8){var _0x5b445e={},_0x209d55={},_0xf34132={'count':0x0,'rows':[]};var _0x724bb3=_[_0x74ae('0x31')](db[_0x74ae('0x32')][_0x74ae('0x33')],function(_0x5e6c7e){return{'name':_0x5e6c7e['fieldName'],'type':_0x5e6c7e[_0x74ae('0x34')][_0x74ae('0x35')]};});_0x209d55[_0x74ae('0x36')]=_[_0x74ae('0x31')](_0x724bb3,_0x74ae('0x2f'));_0x209d55['query']=_[_0x74ae('0x37')](_0x2fa8ce[_0x74ae('0x38')]);_0x209d55['filters']=_[_0x74ae('0x39')](_0x209d55[_0x74ae('0x36')],_0x209d55[_0x74ae('0x38')]);_0x5b445e[_0x74ae('0x3a')]=_['intersection'](_0x209d55['model'],qs[_0x74ae('0x3b')](_0x2fa8ce[_0x74ae('0x38')][_0x74ae('0x3b')]));_0x5b445e['attributes']=_0x5b445e[_0x74ae('0x3a')][_0x74ae('0x3c')]?_0x5b445e[_0x74ae('0x3a')]:_0x209d55[_0x74ae('0x36')];if(!_0x2fa8ce[_0x74ae('0x38')][_0x74ae('0x3d')]('nolimit')){_0x5b445e['limit']=qs[_0x74ae('0x26')](_0x2fa8ce[_0x74ae('0x38')][_0x74ae('0x26')]);_0x5b445e[_0x74ae('0x24')]=qs[_0x74ae('0x24')](_0x2fa8ce[_0x74ae('0x38')]['offset']);}_0x5b445e[_0x74ae('0x3e')]=qs['sort'](_0x2fa8ce[_0x74ae('0x38')][_0x74ae('0x3f')]);_0x5b445e[_0x74ae('0x40')]=qs['filters'](_[_0x74ae('0x41')](_0x2fa8ce['query'],_0x209d55['filters']),_0x724bb3);if(_0x2fa8ce[_0x74ae('0x38')]['filter']){_0x5b445e[_0x74ae('0x40')]=_[_0x74ae('0x42')](_0x5b445e['where'],{'$or':_[_0x74ae('0x31')](_0x724bb3,function(_0x28db87){if(_0x28db87[_0x74ae('0x34')]!=='VIRTUAL'){var _0x2f080e={};_0x2f080e[_0x28db87['name']]={'$like':'%'+_0x2fa8ce[_0x74ae('0x38')]['filter']+'%'};return _0x2f080e;}})});}_0x5b445e=_['merge']({},_0x5b445e,_0x2fa8ce['options']);var _0x400330={'where':_0x5b445e[_0x74ae('0x40')]};return db[_0x74ae('0x32')][_0x74ae('0x27')](_0x400330)['then'](function(_0x256df0){_0xf34132[_0x74ae('0x27')]=_0x256df0;if(_0x2fa8ce[_0x74ae('0x38')]['includeAll']){_0x5b445e['include']=[{'all':!![]}];}return db[_0x74ae('0x32')][_0x74ae('0x43')](_0x5b445e);})['then'](function(_0x3e72a1){_0xf34132['rows']=_0x3e72a1;return _0xf34132;})[_0x74ae('0x2c')](respondWithFilteredResult(_0x38a0f8,_0x5b445e))[_0x74ae('0x44')](handleError(_0x38a0f8,null));};exports[_0x74ae('0x45')]=function(_0x2c21fd,_0x2f57d9){var _0x122662={'raw':![],'where':{'id':_0x2c21fd[_0x74ae('0x46')]['id']}},_0x54695f={};_0x54695f[_0x74ae('0x36')]=_['keys'](db[_0x74ae('0x32')]['rawAttributes']);_0x54695f[_0x74ae('0x38')]=_['keys'](_0x2c21fd[_0x74ae('0x38')]);_0x54695f[_0x74ae('0x47')]=_[_0x74ae('0x39')](_0x54695f[_0x74ae('0x36')],_0x54695f['query']);_0x122662[_0x74ae('0x3a')]=_[_0x74ae('0x39')](_0x54695f[_0x74ae('0x36')],qs[_0x74ae('0x3b')](_0x2c21fd[_0x74ae('0x38')]['fields']));_0x122662[_0x74ae('0x3a')]=_0x122662[_0x74ae('0x3a')]['length']?_0x122662[_0x74ae('0x3a')]:_0x54695f[_0x74ae('0x36')];if(_0x2c21fd['query'][_0x74ae('0x48')]){_0x122662[_0x74ae('0x49')]=[{'all':!![]}];}_0x122662=_[_0x74ae('0x42')]({},_0x122662,_0x2c21fd[_0x74ae('0x4a')]);return db[_0x74ae('0x32')][_0x74ae('0x4b')](_0x122662)[_0x74ae('0x2c')](handleEntityNotFound(_0x2f57d9,null))[_0x74ae('0x2c')](respondWithResult(_0x2f57d9,null))['catch'](handleError(_0x2f57d9,null));};exports[_0x74ae('0x4c')]=function(_0x166c51,_0x252fad){return db[_0x74ae('0x32')][_0x74ae('0x4c')](_0x166c51[_0x74ae('0x4d')],{})[_0x74ae('0x2c')](function(_0x51ee15){var _0x4b237f=_0x166c51[_0x74ae('0x4e')][_0x74ae('0x4f')]({'plain':!![]});if(!_0x4b237f)throw new Error(_0x74ae('0x50'));if(_0x4b237f['role']===_0x74ae('0x4e')){var _0x2a091a=_0x51ee15[_0x74ae('0x4f')]({'plain':!![]});var _0x3d0398=_0x74ae('0x51');return db[_0x74ae('0x52')][_0x74ae('0x4b')]({'where':{'name':_0x3d0398,'userProfileId':_0x4b237f[_0x74ae('0x53')]},'raw':!![]})['then'](function(_0x20fe9e){if(_0x20fe9e&&_0x20fe9e[_0x74ae('0x54')]===0x0){return db[_0x74ae('0x55')][_0x74ae('0x4c')]({'name':_0x2a091a[_0x74ae('0x2f')],'resourceId':_0x2a091a['id'],'type':_0x20fe9e[_0x74ae('0x2f')],'sectionId':_0x20fe9e['id']},{})[_0x74ae('0x2c')](function(){return _0x51ee15;});}else{return _0x51ee15;}})[_0x74ae('0x44')](function(_0x1e2b6b){logger[_0x74ae('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e2b6b);throw _0x1e2b6b;});}return _0x51ee15;})[_0x74ae('0x2c')](respondWithResult(_0x252fad,0xc9))[_0x74ae('0x44')](handleError(_0x252fad,null));};exports[_0x74ae('0x56')]=function(_0x2d8fa1,_0x47ae78){if(_0x2d8fa1[_0x74ae('0x4d')]['id']){delete _0x2d8fa1['body']['id'];}return db[_0x74ae('0x32')][_0x74ae('0x4b')]({'where':{'id':_0x2d8fa1[_0x74ae('0x46')]['id']}})[_0x74ae('0x2c')](handleEntityNotFound(_0x47ae78,null))[_0x74ae('0x2c')](saveUpdates(_0x2d8fa1['body'],null))['then'](respondWithResult(_0x47ae78,null))[_0x74ae('0x44')](handleError(_0x47ae78,null));};exports[_0x74ae('0x57')]=function(_0x29d4f8,_0x46a7c7){var _0xa61f=_0x29d4f8[_0x74ae('0x46')]['id'];var _0x285abe=[];return db[_0x74ae('0x58')][_0x74ae('0x59')](function(_0x862267){var _0x2bfefc=_0x74ae('0x5a')+_0xa61f;return db[_0x74ae('0x58')]['query'](_0x2bfefc,{'type':db[_0x74ae('0x5b')]['QueryTypes'][_0x74ae('0x5c')],'raw':!![],'transaction':_0x862267})[_0x74ae('0x2c')](function(_0x104ae1){_0x285abe=_['map'](_0x104ae1,function(_0x5ca6fe){return Number(_0x5ca6fe['UserId']);});})['then'](function(){var _0x2b1509=_0x74ae('0x5d')+_0xa61f;return db[_0x74ae('0x58')][_0x74ae('0x38')](_0x2b1509,{'type':db[_0x74ae('0x5b')][_0x74ae('0x5e')][_0x74ae('0x5c')],'raw':!![],'transaction':_0x862267});})['then'](function(_0x4c428d){var _0x515949=_['map'](_0x4c428d,function(_0x4d65f3){return Number(_0x4d65f3['VoiceQueueId']);});return db[_0x74ae('0x5f')][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'VoiceQueueId':{'$in':_0x515949}},'transaction':_0x862267});})[_0x74ae('0x2c')](function(){var _0x2fb9ac='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0xa61f;return db['sequelize'][_0x74ae('0x38')](_0x2fb9ac,{'type':db[_0x74ae('0x5b')][_0x74ae('0x5e')][_0x74ae('0x5c')],'raw':!![],'transaction':_0x862267});})[_0x74ae('0x2c')](function(_0x568218){var _0x51bb24=_['map'](_0x568218,function(_0xa87d14){return Number(_0xa87d14[_0x74ae('0x60')]);});return db[_0x74ae('0x61')][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'MailQueueId':{'$in':_0x51bb24}},'transaction':_0x862267});})[_0x74ae('0x2c')](function(){var _0x1eb6c7='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0xa61f;return db[_0x74ae('0x58')]['query'](_0x1eb6c7,{'type':db[_0x74ae('0x5b')][_0x74ae('0x5e')][_0x74ae('0x5c')],'raw':!![],'transaction':_0x862267});})['then'](function(_0x25a8a1){var _0x28b9e7=_[_0x74ae('0x31')](_0x25a8a1,function(_0x3249c7){return Number(_0x3249c7[_0x74ae('0x62')]);});return db[_0x74ae('0x63')][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'SmsQueueId':{'$in':_0x28b9e7}},'transaction':_0x862267});})['then'](function(){var _0x1fdf2d=_0x74ae('0x64')+_0xa61f;return db[_0x74ae('0x58')]['query'](_0x1fdf2d,{'type':db[_0x74ae('0x5b')][_0x74ae('0x5e')][_0x74ae('0x5c')],'raw':!![],'transaction':_0x862267});})[_0x74ae('0x2c')](function(_0x329784){var _0x242eb1=_[_0x74ae('0x31')](_0x329784,function(_0xf0720e){return Number(_0xf0720e[_0x74ae('0x65')]);});return db[_0x74ae('0x66')][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'ChatQueueId':{'$in':_0x242eb1}},'transaction':_0x862267});})[_0x74ae('0x2c')](function(){var _0x37010d=_0x74ae('0x67')+_0xa61f;return db['sequelize'][_0x74ae('0x38')](_0x37010d,{'type':db[_0x74ae('0x5b')][_0x74ae('0x5e')][_0x74ae('0x5c')],'raw':!![],'transaction':_0x862267});})[_0x74ae('0x2c')](function(_0x1cd34){var _0x3f886a=_[_0x74ae('0x31')](_0x1cd34,function(_0x42b365){return Number(_0x42b365[_0x74ae('0x68')]);});return db[_0x74ae('0x69')][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'FaxQueueId':{'$in':_0x3f886a}},'transaction':_0x862267});})['then'](function(){var _0x587fff=_0x74ae('0x6a')+_0xa61f;return db[_0x74ae('0x58')][_0x74ae('0x38')](_0x587fff,{'type':db[_0x74ae('0x5b')][_0x74ae('0x5e')][_0x74ae('0x5c')],'raw':!![],'transaction':_0x862267});})[_0x74ae('0x2c')](function(_0x3cf540){var _0x577134=_[_0x74ae('0x31')](_0x3cf540,function(_0x14f478){return Number(_0x14f478['OpenchannelQueueId']);});return db[_0x74ae('0x6b')][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'OpenchannelQueueId':{'$in':_0x577134}},'transaction':_0x862267});})['then'](function(){var _0x4c27ce=_0x74ae('0x6c')+_0xa61f;return db[_0x74ae('0x58')][_0x74ae('0x38')](_0x4c27ce,{'type':db[_0x74ae('0x5b')][_0x74ae('0x5e')]['SELECT'],'raw':!![],'transaction':_0x862267});})[_0x74ae('0x2c')](function(_0x32cff0){var _0x3261d4=_['map'](_0x32cff0,function(_0x41bfec){return Number(_0x41bfec[_0x74ae('0x6d')]);});return db['UserWhatsappQueue'][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'WhatsappQueueId':{'$in':_0x3261d4}},'transaction':_0x862267});})[_0x74ae('0x2c')](function(){return db['TeamVoicePrefix'][_0x74ae('0x4b')]({'where':{'TeamId':_0xa61f}});})['then'](function(_0xf0d856){if(_0xf0d856===null){return;}return db[_0x74ae('0x6e')][_0x74ae('0x57')]({'where':{'UserId':{'$in':_0x285abe},'VoicePrefixId':_0xf0d856[_0x74ae('0x6f')]},'transaction':_0x862267});})[_0x74ae('0x2c')](function(){return db[_0x74ae('0x32')][_0x74ae('0x57')]({'where':{'id':_0xa61f},'cascade':!![],'transaction':_0x862267});})[_0x74ae('0x2c')](function(_0x59b007){if(_0x59b007===0x0){_0x46a7c7['sendStatus'](0x194);}else{return db[_0x74ae('0x55')][_0x74ae('0x57')]({'where':{'type':_0x74ae('0x51'),'resourceId':_0xa61f},'cascade':!![],'transaction':_0x862267})[_0x74ae('0x2c')](function(){_0x46a7c7[_0x74ae('0x21')](0xcc)['end']();});}})[_0x74ae('0x44')](function(_0x1b6d39){_0x46a7c7[_0x74ae('0x21')](0x1f4)['send'](_0x1b6d39);});});};exports[_0x74ae('0x70')]=function(_0x423660,_0x2324a9,_0x2afdbf){return db['Team'][_0x74ae('0x71')]({'where':{'id':_0x423660[_0x74ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x2324a9,null))[_0x74ae('0x2c')](function(_0xbd686c){if(!_0x423660[_0x74ae('0x38')][_0x74ae('0x72')]||!utils[_0x74ae('0x73')](_0x423660[_0x74ae('0x38')][_0x74ae('0x72')])){throw new db['Sequelize'][(_0x74ae('0x74'))](_0x74ae('0x75'));}var _0x48197e={};var _0x3d492f={};_0x3d492f[_0x74ae('0x36')]=_[_0x74ae('0x37')](db[_[_0x74ae('0x76')](_0x423660[_0x74ae('0x38')][_0x74ae('0x72')][_0x74ae('0x77')]())+_0x74ae('0x78')][_0x74ae('0x33')]);_0x3d492f['query']=_[_0x74ae('0x37')](_0x423660[_0x74ae('0x38')]);_0x3d492f[_0x74ae('0x47')]=_['intersection'](_0x3d492f[_0x74ae('0x36')],_0x3d492f[_0x74ae('0x38')]);_0x48197e[_0x74ae('0x3a')]=_[_0x74ae('0x39')](_0x3d492f[_0x74ae('0x36')],qs[_0x74ae('0x3b')](_0x423660[_0x74ae('0x38')][_0x74ae('0x3b')]));_0x48197e[_0x74ae('0x3a')]=_0x48197e['attributes'][_0x74ae('0x3c')]?_0x48197e['attributes']:_0x3d492f['model'];_0x48197e[_0x74ae('0x26')]=qs['limit'](_0x423660[_0x74ae('0x38')][_0x74ae('0x26')]);_0x48197e[_0x74ae('0x24')]=qs[_0x74ae('0x24')](_0x423660['query'][_0x74ae('0x24')]);_0x48197e[_0x74ae('0x3e')]=qs[_0x74ae('0x3f')](_0x423660[_0x74ae('0x38')][_0x74ae('0x3f')]);_0x48197e[_0x74ae('0x40')]=qs[_0x74ae('0x47')](_['pick'](_0x423660[_0x74ae('0x38')],_0x3d492f[_0x74ae('0x47')]));_0x48197e=_['merge']({},_0x48197e,_0x423660[_0x74ae('0x4a')]);return _0xbd686c[_0x74ae('0x4f')+_[_0x74ae('0x76')](_0x423660['query'][_0x74ae('0x72')]['toLowerCase']())+'Queues'](_0x48197e);})['then'](respondWithResult(_0x2324a9,null))[_0x74ae('0x44')](handleError(_0x2324a9,null));};exports[_0x74ae('0x79')]=function(_0x40a277,_0x454a15,_0x57916d){return db[_0x74ae('0x32')][_0x74ae('0x71')]({'where':{'id':_0x40a277[_0x74ae('0x46')]['id']}})[_0x74ae('0x2c')](function(_0x5d5eea){if(_0x5d5eea){if(!_0x40a277[_0x74ae('0x4d')][_0x74ae('0x72')]||!utils['isValidChannel'](_0x40a277[_0x74ae('0x4d')][_0x74ae('0x72')])){throw new db[(_0x74ae('0x5b'))][(_0x74ae('0x74'))]('Unknown\x20channel');}return _0x5d5eea[_0x74ae('0x7a')+_[_0x74ae('0x76')](_0x40a277['body'][_0x74ae('0x72')][_0x74ae('0x77')]())+'Queues'](_0x40a277[_0x74ae('0x4d')][_0x74ae('0x7b')]);}return null;})[_0x74ae('0x2c')](handleEntityNotFound(_0x454a15,null))[_0x74ae('0x2c')](respondWithStatusCode(_0x454a15,null))[_0x74ae('0x44')](handleError(_0x454a15,null));};exports[_0x74ae('0x7c')]=function(_0x2a8252,_0x59348f,_0x297f09){return db['Team'][_0x74ae('0x71')]({'where':{'id':_0x2a8252[_0x74ae('0x46')]['id']}})[_0x74ae('0x2c')](function(_0x4050c5){if(_0x4050c5){if(!_0x2a8252[_0x74ae('0x38')]['channel']||!utils[_0x74ae('0x73')](_0x2a8252[_0x74ae('0x38')][_0x74ae('0x72')])){throw new db[(_0x74ae('0x5b'))][(_0x74ae('0x74'))]('Unknown\x20channel');}return _0x4050c5[_0x74ae('0x7d')+_['capitalize'](_0x2a8252[_0x74ae('0x38')][_0x74ae('0x72')]['toLowerCase']())+_0x74ae('0x7e')](_0x2a8252[_0x74ae('0x38')][_0x74ae('0x7b')]);}return null;})[_0x74ae('0x2c')](handleEntityNotFound(_0x59348f,null))['then'](respondWithStatusCode(_0x59348f,null))[_0x74ae('0x44')](handleError(_0x59348f,null));};exports[_0x74ae('0x7f')]=function(_0x434618,_0x179f27){var _0x3eb4a0=_['isArray'](_0x434618['body'][_0x74ae('0x7b')])?_0x434618[_0x74ae('0x4d')][_0x74ae('0x7b')]:[_0x434618[_0x74ae('0x4d')][_0x74ae('0x7b')]];var _0x231e4c=_0x434618[_0x74ae('0x46')]['id'];return db[_0x74ae('0x32')]['find']({'where':{'id':_0x231e4c}})[_0x74ae('0x2c')](handleEntityNotFound(_0x179f27,null))[_0x74ae('0x2c')](function(_0x4f88d0){if(_0x4f88d0){var _0x511f99=['Voice',_0x74ae('0x80'),_0x74ae('0x81'),'Sms',_0x74ae('0x82'),_0x74ae('0x83'),'Whatsapp'];return db[_0x74ae('0x58')][_0x74ae('0x59')](function(_0x3256fb){var _0x5e73c8=_[_0x74ae('0x31')](_0x511f99,function(_0x32c23a){var _0x92a988={'attributes':['id',_0x74ae('0x2f')]};if(_0x32c23a===_0x74ae('0x84')){_0x92a988[_0x74ae('0x85')]={'attributes':[_0x74ae('0x86')]};}return _0x4f88d0[_0x74ae('0x4f')+_0x32c23a+_0x74ae('0x7e')](_0x92a988)[_0x74ae('0x2c')](function(_0x5618e8){var _0x5b7d09=_[_0x74ae('0x31')](_0x5618e8,function(_0xa92445){var _0x376834=_['map'](_0x3eb4a0,function(_0x1af993){var _0x21c8c9={'where':{'UserId':_0x1af993,[_0x32c23a+_0x74ae('0x87')]:_0xa92445['id']},'transaction':_0x3256fb};if(_0x32c23a==='Voice'){_0x21c8c9[_0x74ae('0x1a')]={'penalty':_0xa92445[_0x74ae('0x88')]['penalty']};}return db[_0x74ae('0x89')+_0x32c23a+_0x74ae('0x78')][_0x74ae('0x8a')](_0x21c8c9)[_0x74ae('0x2c')](function(){socket['emit'](_0x74ae('0x4e')+_0x32c23a+_0x74ae('0x8b'),{'UserId':_0x1af993,[_0x32c23a+_0x74ae('0x87')]:_0xa92445['id']});if(_0x32c23a!==_0x74ae('0x84')){return;}return db[_0x74ae('0x89')][_0x74ae('0x43')]({'where':{'id':_0x3eb4a0,'online':0x1},'attributes':['id',_0x74ae('0x2f'),_0x74ae('0x8c'),_0x74ae('0x8d'),'interface'],'raw':!![]})['then'](function(_0x1ce92d){var _0x4baf4b=_[_0x74ae('0x31')](_0x1ce92d,function(_0x1fd53c){return db['UserVoiceQueueRt']['upsert']({'membername':_0x1fd53c[_0x74ae('0x2f')],'UserId':_0x1fd53c['id'],'queue_name':_0xa92445[_0x74ae('0x2f')],'VoiceQueueId':_0xa92445['id'],'interface':_[_0x74ae('0x8e')](_0x1fd53c[_0x74ae('0x8f')])?util[_0x74ae('0x90')](_0x74ae('0x91'),_0x1fd53c['name']):_0x1fd53c[_0x74ae('0x8f')],'paused':_0x1fd53c[_0x74ae('0x8d')]||![],'penalty':_0xa92445[_0x74ae('0x88')][_0x74ae('0x86')]},{'transaction':_0x3256fb});});return Promise[_0x74ae('0x92')](_0x4baf4b);});});});return Promise[_0x74ae('0x92')](_0x376834);});return Promise[_0x74ae('0x92')](_0x5b7d09);})['then'](function(){return db[_0x74ae('0x93')][_0x74ae('0x71')]({'where':{'teamId':_0x231e4c}})[_0x74ae('0x2c')](function(_0x47e2da){if(_0x47e2da){var _0x40a5dd=_[_0x74ae('0x31')](_0x3eb4a0,function(_0x4d030e){db[_0x74ae('0x6e')]['upsert']({'UserId':_0x4d030e,'VoicePrefixId':_0x47e2da[_0x74ae('0x6f')]});});return Promise[_0x74ae('0x92')](_0x40a5dd);}});});});return Promise[_0x74ae('0x92')](_0x5e73c8)[_0x74ae('0x2c')](function(){return _0x4f88d0[_0x74ae('0x7f')](_0x3eb4a0,{'transaction':_0x3256fb})[_0x74ae('0x94')](function(_0x4e5693){return _0x4e5693;});});});}})[_0x74ae('0x2c')](respondWithResult(_0x179f27,null))[_0x74ae('0x44')](handleError(_0x179f27,null));};exports[_0x74ae('0x95')]=function(_0x1e420e,_0x3cd22b){var _0x3bdfd5=_[_0x74ae('0x96')](_0x1e420e[_0x74ae('0x38')][_0x74ae('0x7b')])?_0x1e420e[_0x74ae('0x38')][_0x74ae('0x7b')]:[_0x1e420e[_0x74ae('0x38')]['ids']];var _0x1176f0=_0x1e420e[_0x74ae('0x46')]['id'];return db[_0x74ae('0x32')][_0x74ae('0x4b')]({'where':{'id':_0x1176f0}})['then'](handleEntityNotFound(_0x3cd22b,null))[_0x74ae('0x2c')](function(_0x159dfd){if(_0x159dfd){var _0x84dc1e=[_0x74ae('0x84'),_0x74ae('0x80'),_0x74ae('0x81'),_0x74ae('0x97'),_0x74ae('0x82'),_0x74ae('0x83'),_0x74ae('0x98')];return db[_0x74ae('0x58')][_0x74ae('0x59')](function(_0x2e4d95){var _0x13821b=_[_0x74ae('0x31')](_0x84dc1e,function(_0x19d416){var _0x4562c4={'attributes':['id','name']};return _0x159dfd[_0x74ae('0x4f')+_0x19d416+_0x74ae('0x7e')](_0x4562c4)[_0x74ae('0x2c')](function(_0x4eb09e){var _0x12e891=_['map'](_0x4eb09e,function(_0x226a07){return _0x226a07['removeAgents'](_0x3bdfd5,{'transaction':_0x2e4d95})[_0x74ae('0x2c')](function(){var _0x60620f=_['map'](_0x3bdfd5,function(_0x5a5d5a){socket[_0x74ae('0x99')]('user'+_0x19d416+_0x74ae('0x9a'),{'UserId':Number(_0x5a5d5a),[_0x19d416+'QueueId']:_0x226a07['id']});if(_0x19d416!=='Voice'){return;}return db[_0x74ae('0x9b')][_0x74ae('0x57')]({'where':{'VoiceQueueId':_0x226a07['id'],'UserId':_0x5a5d5a},'transaction':_0x2e4d95});});return Promise['all'](_0x60620f);});});return Promise[_0x74ae('0x92')](_0x12e891);});});return Promise[_0x74ae('0x92')](_0x13821b)['then'](function(){return _0x159dfd[_0x74ae('0x95')](_0x3bdfd5,{'transaction':_0x2e4d95});})[_0x74ae('0x2c')](function(){return db[_0x74ae('0x93')][_0x74ae('0x71')]({'where':{'teamId':_0x1176f0}})[_0x74ae('0x2c')](function(_0x52a466){if(_0x52a466){var _0x2ef3d6=_[_0x74ae('0x31')](_0x3bdfd5,function(_0x41eb85){db[_0x74ae('0x6e')]['destroy']({'where':{'UserId':_0x41eb85,'VoicePrefixId':_0x52a466[_0x74ae('0x6f')]}});});return Promise[_0x74ae('0x92')](_0x2ef3d6);}});});});}})[_0x74ae('0x2c')](respondWithStatusCode(_0x3cd22b,null))[_0x74ae('0x44')](handleError(_0x3cd22b,null));};exports['getAgents']=function(_0x34e35d,_0x378ae9,_0x413212){var _0x31609d={};var _0x200a84={};var _0xa4c0ae;var _0x358a8a;return db[_0x74ae('0x32')]['findOne']({'where':{'id':_0x34e35d[_0x74ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x378ae9,null))[_0x74ae('0x2c')](function(_0xd6b7fa){if(_0xd6b7fa){_0xa4c0ae=_0xd6b7fa;_0x200a84[_0x74ae('0x36')]=_[_0x74ae('0x37')](db[_0x74ae('0x89')][_0x74ae('0x33')]);_0x200a84[_0x74ae('0x38')]=_[_0x74ae('0x37')](_0x34e35d[_0x74ae('0x38')]);_0x200a84[_0x74ae('0x47')]=_[_0x74ae('0x39')](_0x200a84[_0x74ae('0x36')],_0x200a84[_0x74ae('0x38')]);_0x31609d[_0x74ae('0x3a')]=_[_0x74ae('0x39')](_0x200a84[_0x74ae('0x36')],qs['fields'](_0x34e35d[_0x74ae('0x38')]['fields']));_0x31609d[_0x74ae('0x3a')]=_0x31609d[_0x74ae('0x3a')][_0x74ae('0x3c')]?_0x31609d['attributes']:_0x200a84[_0x74ae('0x36')];_0x31609d['order']=qs[_0x74ae('0x3f')](_0x34e35d[_0x74ae('0x38')][_0x74ae('0x3f')]);_0x31609d[_0x74ae('0x40')]=qs['filters'](_[_0x74ae('0x41')](_0x34e35d[_0x74ae('0x38')],_0x200a84[_0x74ae('0x47')]));if(_0x34e35d[_0x74ae('0x38')][_0x74ae('0x9c')]){_0x31609d[_0x74ae('0x40')]=_[_0x74ae('0x42')](_0x31609d[_0x74ae('0x40')],{'$or':_[_0x74ae('0x31')](_0x31609d[_0x74ae('0x3a')],function(_0x40730c){var _0x1136d0={};_0x1136d0[_0x40730c]={'$like':'%'+_0x34e35d[_0x74ae('0x38')][_0x74ae('0x9c')]+'%'};return _0x1136d0;})});}_0x31609d=_['merge']({},_0x31609d,_0x34e35d[_0x74ae('0x4a')]);return _0xa4c0ae['getAgents'](_0x31609d);}})[_0x74ae('0x2c')](function(_0x299c37){if(_0x299c37){_0x358a8a=_0x299c37[_0x74ae('0x3c')];if(!_0x34e35d[_0x74ae('0x38')]['hasOwnProperty'](_0x74ae('0x9d'))){_0x31609d['limit']=qs[_0x74ae('0x26')](_0x34e35d['query'][_0x74ae('0x26')]);_0x31609d[_0x74ae('0x24')]=qs[_0x74ae('0x24')](_0x34e35d[_0x74ae('0x38')]['offset']);}return _0xa4c0ae[_0x74ae('0x9e')](_0x31609d);}})[_0x74ae('0x2c')](function(_0x505dda){if(_0x505dda){return _0x505dda?{'count':_0x358a8a,'rows':_0x505dda}:null;}})[_0x74ae('0x2c')](respondWithResult(_0x378ae9,null))[_0x74ae('0x44')](handleError(_0x378ae9,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 59919af..7c4de30 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 _0xc2d7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','update','remove'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc2d7,0x1bd));var _0x7c2d=function(_0x66a9d6,_0xc90b14){_0x66a9d6=_0x66a9d6-0x0;var _0x421a2c=_0xc2d7[_0x66a9d6];return _0x421a2c;};'use strict';var EventEmitter=require(_0x7c2d('0x0'));var Team=require(_0x7c2d('0x1'))['db'][_0x7c2d('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c2d('0x3'),'afterDestroy':_0x7c2d('0x4')};function emitEvent(_0x4e5835){return function(_0x392f28,_0x4dc39e,_0x3b9e9f){TeamEvents[_0x7c2d('0x5')](_0x4e5835+':'+_0x392f28['id'],_0x392f28);TeamEvents[_0x7c2d('0x5')](_0x4e5835,_0x392f28);_0x3b9e9f(null);};}for(var e in events){if(events[_0x7c2d('0x6')](e)){var event=events[e];Team[_0x7c2d('0x7')](e,emitEvent(event));}}module[_0x7c2d('0x8')]=TeamEvents; \ No newline at end of file +var _0x9bf5=['../../mysqldb','Team','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x9bf5,0x81));var _0x59bf=function(_0x48f51d,_0x17a6c1){_0x48f51d=_0x48f51d-0x0;var _0x1ab641=_0x9bf5[_0x48f51d];return _0x1ab641;};'use strict';var EventEmitter=require(_0x59bf('0x0'));var Team=require(_0x59bf('0x1'))['db'][_0x59bf('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x59bf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x59bf('0x4'),'afterDestroy':_0x59bf('0x5')};function emitEvent(_0x4e7091){return function(_0x5ecab5,_0x2587c3,_0x15bea9){TeamEvents[_0x59bf('0x6')](_0x4e7091+':'+_0x5ecab5['id'],_0x5ecab5);TeamEvents['emit'](_0x4e7091,_0x5ecab5);_0x15bea9(null);};}for(var e in events){if(events[_0x59bf('0x7')](e)){var event=events[e];Team[_0x59bf('0x8')](e,emitEvent(event));}}module[_0x59bf('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 78fa208..4a68939 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 _0xdd89=['Fax','Mail','Openchannel','Sms','Voice','Whatsapp','then','all','catch','lodash','map','setDataValue','exports','Team','teams','Chat'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0xdd89,0x129));var _0x9dd8=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xdd89[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0x9dd8('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x47d464,_0x1510dc){var _0x2e117d='get'+_0x1510dc+'Queues';return _0x47d464[_0x2e117d]()['then'](function(_0x355d9a){return _[_0x9dd8('0x1')](_0x355d9a,function(_0x652594){_0x652594[_0x9dd8('0x2')]('channel',_0x1510dc);return _0x652594;});})['catch'](function(_0x5b38e4){throw _0x5b38e4;});}module[_0x9dd8('0x3')]=function(_0x353710){return _0x353710['define'](_0x9dd8('0x4'),attributes,{'tableName':_0x9dd8('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2865f0=this;var _0x237eef=[_0x9dd8('0x6'),_0x9dd8('0x7'),_0x9dd8('0x8'),_0x9dd8('0x9'),_0x9dd8('0xa'),_0x9dd8('0xb'),_0x9dd8('0xc')];return Promise['resolve']()[_0x9dd8('0xd')](function(){var _0x8ab483=_[_0x9dd8('0x1')](_0x237eef,function(_0x4c31de){return getQueuesByChannel(_0x2865f0,_0x4c31de);});return Promise[_0x9dd8('0xe')](_0x8ab483);})[_0x9dd8('0xf')](function(_0x9d6287){throw _0x9d6287;});}}});}; \ No newline at end of file +var _0xc099=['./team.attributes','get','exports','define','Team','teams','Chat','Fax','Openchannel','Voice','Whatsapp','then','all','catch','lodash'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0xc099,0x176));var _0x9c09=function(_0x5b0e43,_0x2ceab7){_0x5b0e43=_0x5b0e43-0x0;var _0x9df53f=_0xc099[_0x5b0e43];return _0x9df53f;};'use strict';var _=require(_0x9c09('0x0'));var attributes=require(_0x9c09('0x1'));function getQueuesByChannel(_0x54c2a7,_0x1d5a19){var _0x42ed9b=_0x9c09('0x2')+_0x1d5a19+'Queues';return _0x54c2a7[_0x42ed9b]()['then'](function(_0x5ebc30){return _['map'](_0x5ebc30,function(_0x1dc909){_0x1dc909['setDataValue']('channel',_0x1d5a19);return _0x1dc909;});})['catch'](function(_0x2f5d93){throw _0x2f5d93;});}module[_0x9c09('0x3')]=function(_0x4ab501){return _0x4ab501[_0x9c09('0x4')](_0x9c09('0x5'),attributes,{'tableName':_0x9c09('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4972c9=this;var _0x296524=[_0x9c09('0x7'),_0x9c09('0x8'),'Mail',_0x9c09('0x9'),'Sms',_0x9c09('0xa'),_0x9c09('0xb')];return Promise['resolve']()[_0x9c09('0xc')](function(){var _0x292779=_['map'](_0x296524,function(_0x28878b){return getQueuesByChannel(_0x4972c9,_0x28878b);});return Promise[_0x9c09('0xd')](_0x292779);})[_0x9c09('0xe')](function(_0x576a59){throw _0x576a59;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index e395178..5740998 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 _0xf9ec=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xf9ec,0x1a1));var _0xcf9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9ec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcf9e('0x0'));var util=require(_0xcf9e('0x1'));var moment=require(_0xcf9e('0x2'));var BPromise=require(_0xcf9e('0x3'));var rs=require(_0xcf9e('0x4'));var fs=require('fs');var Redis=require(_0xcf9e('0x5'));var db=require(_0xcf9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf9e('0x7'))(_0xcf9e('0x8'));var config=require(_0xcf9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcf9e('0xa')][_0xcf9e('0xb')]({'port':0x232a});config[_0xcf9e('0xc')]=_[_0xcf9e('0xd')](config[_0xcf9e('0xc')],{'host':_0xcf9e('0xe'),'port':0x18eb});var socket=require(_0xcf9e('0xf'))(new Redis(config[_0xcf9e('0xc')]));require(_0xcf9e('0x10'))[_0xcf9e('0x11')](socket);function respondWithRpcPromise(_0x5017aa,_0xf61a51,_0x4864e1){return new BPromise(function(_0x3cb994,_0x4eed58){return client['request'](_0x5017aa,_0x4864e1)['then'](function(_0x264dd2){logger[_0xcf9e('0x12')](_0xcf9e('0x13'),_0xf61a51,'request\x20sent');logger['debug'](_0xcf9e('0x14'),_0xf61a51,_0xcf9e('0x15'),JSON[_0xcf9e('0x16')](_0x264dd2));if(_0x264dd2[_0xcf9e('0x17')]){if(_0x264dd2['error']['code']===0x1f4){logger[_0xcf9e('0x17')](_0xcf9e('0x13'),_0xf61a51,_0x264dd2['error']['message']);return _0x4eed58(_0x264dd2[_0xcf9e('0x17')]['message']);}logger[_0xcf9e('0x17')](_0xcf9e('0x13'),_0xf61a51,_0x264dd2[_0xcf9e('0x17')][_0xcf9e('0x18')]);return _0x3cb994(_0x264dd2[_0xcf9e('0x17')][_0xcf9e('0x18')]);}else{logger[_0xcf9e('0x12')]('Team,\x20%s,\x20%s',_0xf61a51,_0xcf9e('0x15'));_0x3cb994(_0x264dd2['result'][_0xcf9e('0x18')]);}})[_0xcf9e('0x19')](function(_0x3f4147){logger[_0xcf9e('0x17')](_0xcf9e('0x13'),_0xf61a51,_0x3f4147);_0x4eed58(_0x3f4147);});});} \ No newline at end of file +var _0xa12e=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','moment','randomstring'];(function(_0x3f1c7e,_0x4ee861){var _0x38e4df=function(_0xcb642b){while(--_0xcb642b){_0x3f1c7e['push'](_0x3f1c7e['shift']());}};_0x38e4df(++_0x4ee861);}(_0xa12e,0x7b));var _0xea12=function(_0x26c12e,_0x55ef42){_0x26c12e=_0x26c12e-0x0;var _0xbab0c7=_0xa12e[_0x26c12e];return _0xbab0c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea12('0x0'));var BPromise=require('bluebird');var rs=require(_0xea12('0x1'));var fs=require('fs');var Redis=require(_0xea12('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea12('0x3'));var logger=require(_0xea12('0x4'))('rpc');var config=require(_0xea12('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xea12('0x6')][_0xea12('0x7')]({'port':0x232a});config[_0xea12('0x8')]=_[_0xea12('0x9')](config[_0xea12('0x8')],{'host':_0xea12('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea12('0x8')]));require(_0xea12('0xb'))['register'](socket);function respondWithRpcPromise(_0x3f4491,_0x35ec6a,_0x2bc39e){return new BPromise(function(_0x87b7d4,_0x2e06dd){return client[_0xea12('0xc')](_0x3f4491,_0x2bc39e)[_0xea12('0xd')](function(_0x5cb4ae){logger[_0xea12('0xe')](_0xea12('0xf'),_0x35ec6a,_0xea12('0x10'));logger[_0xea12('0x11')](_0xea12('0x12'),_0x35ec6a,_0xea12('0x10'),JSON[_0xea12('0x13')](_0x5cb4ae));if(_0x5cb4ae['error']){if(_0x5cb4ae[_0xea12('0x14')][_0xea12('0x15')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x35ec6a,_0x5cb4ae[_0xea12('0x14')]['message']);return _0x2e06dd(_0x5cb4ae['error']['message']);}logger['error'](_0xea12('0xf'),_0x35ec6a,_0x5cb4ae[_0xea12('0x14')]['message']);return _0x87b7d4(_0x5cb4ae[_0xea12('0x14')]['message']);}else{logger[_0xea12('0xe')]('Team,\x20%s,\x20%s',_0x35ec6a,_0xea12('0x10'));_0x87b7d4(_0x5cb4ae[_0xea12('0x16')][_0xea12('0x17')]);}})[_0xea12('0x18')](function(_0x557528){logger[_0xea12('0x14')]('Team,\x20%s,\x20%s',_0x35ec6a,_0x557528);_0x2e06dd(_0x557528);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bbb7097..087d64b 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 _0xca0a=['register','team:','./team.events','remove','update','emit','removeListener'];(function(_0x469cfe,_0x1358dd){var _0x216e13=function(_0x141e40){while(--_0x141e40){_0x469cfe['push'](_0x469cfe['shift']());}};_0x216e13(++_0x1358dd);}(_0xca0a,0xb8));var _0xaca0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca0a[_0x502c7d];return _0x30b7ed;};'use strict';var TeamEvents=require(_0xaca0('0x0'));var events=['save',_0xaca0('0x1'),_0xaca0('0x2')];function createListener(_0x118bd6,_0x4f9678){return function(_0x547a5d){_0x4f9678[_0xaca0('0x3')](_0x118bd6,_0x547a5d);};}function removeListener(_0x20b685,_0x538c43){return function(){TeamEvents[_0xaca0('0x4')](_0x20b685,_0x538c43);};}exports[_0xaca0('0x5')]=function(_0x3534d1){for(var _0x345d3f=0x0,_0x26a4dd=events['length'];_0x345d3f<_0x26a4dd;_0x345d3f++){var _0xa8ecf=events[_0x345d3f];var _0x162daa=createListener(_0xaca0('0x6')+_0xa8ecf,_0x3534d1);TeamEvents['on'](_0xa8ecf,_0x162daa);}}; \ No newline at end of file +var _0x7d98=['./team.events','remove','update','emit','removeListener','length','team:'];(function(_0x19ac1e,_0x18c481){var _0x2d0ab4=function(_0x1bffa3){while(--_0x1bffa3){_0x19ac1e['push'](_0x19ac1e['shift']());}};_0x2d0ab4(++_0x18c481);}(_0x7d98,0xe7));var _0x87d9=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x7d98[_0x2d7f0e];return _0x110b07;};'use strict';var TeamEvents=require(_0x87d9('0x0'));var events=['save',_0x87d9('0x1'),_0x87d9('0x2')];function createListener(_0x3fdc56,_0xbee750){return function(_0x47cceb){_0xbee750[_0x87d9('0x3')](_0x3fdc56,_0x47cceb);};}function removeListener(_0x317ba8,_0x4b4f58){return function(){TeamEvents[_0x87d9('0x4')](_0x317ba8,_0x4b4f58);};}exports['register']=function(_0x5ed6d2){for(var _0x510ba4=0x0,_0x3fe56d=events[_0x87d9('0x5')];_0x510ba4<_0x3fe56d;_0x510ba4++){var _0x2dc542=events[_0x510ba4];var _0x5f2693=createListener(_0x87d9('0x6')+_0x2dc542,_0x5ed6d2);TeamEvents['on'](_0x2dc542,_0x5f2693);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index b27013e..393ae44 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 _0xe0b2=['exports','INTEGER'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0xe0b2,0xec));var _0x2e0b=function(_0x2b6a96,_0x5873ae){_0x2b6a96=_0x2b6a96-0x0;var _0xdc5a82=_0xe0b2[_0x2b6a96];return _0xdc5a82;};'use strict';var Sequelize=require('sequelize');module[_0x2e0b('0x0')]={'TeamId':{'type':Sequelize[_0x2e0b('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2e0b('0x1')]}}; \ No newline at end of file +var _0x0e35=['exports','INTEGER','sequelize'];(function(_0x17882e,_0x140c6e){var _0x8d37e8=function(_0x2cee55){while(--_0x2cee55){_0x17882e['push'](_0x17882e['shift']());}};_0x8d37e8(++_0x140c6e);}(_0x0e35,0xc2));var _0x50e3=function(_0x1f1534,_0x329913){_0x1f1534=_0x1f1534-0x0;var _0x24729b=_0x0e35[_0x1f1534];return _0x24729b;};'use strict';var Sequelize=require(_0x50e3('0x0'));module[_0x50e3('0x1')]={'TeamId':{'type':Sequelize[_0x50e3('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x50e3('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index dc688a7..837bf50 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 _0xa664=['request-promise','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','util','../../config/logger','api','moment'];(function(_0x3f17b4,_0x487234){var _0x51f7f3=function(_0x5178ca){while(--_0x5178ca){_0x3f17b4['push'](_0x3f17b4['shift']());}};_0x51f7f3(++_0x487234);}(_0xa664,0x132));var _0x4a66=function(_0x32a43c,_0x18806b){_0x32a43c=_0x32a43c-0x0;var _0xbd8bae=_0xa664[_0x32a43c];return _0xbd8bae;};'use strict';var _=require('lodash');var util=require(_0x4a66('0x0'));var logger=require(_0x4a66('0x1'))(_0x4a66('0x2'));var moment=require(_0x4a66('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4a66('0x5'));var attributes=require(_0x4a66('0x6'));module[_0x4a66('0x7')]=function(_0x2661f8,_0x3dd553){return _0x2661f8[_0x4a66('0x8')](_0x4a66('0x9'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd878=['request-promise','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x543976,_0x2b06c8){var _0x617f0b=function(_0x2b1879){while(--_0x2b1879){_0x543976['push'](_0x543976['shift']());}};_0x617f0b(++_0x2b06c8);}(_0xd878,0x118));var _0x8d87=function(_0x1f2682,_0x1ceb9a){_0x1f2682=_0x1f2682-0x0;var _0x4fe9ca=_0xd878[_0x1f2682];return _0x4fe9ca;};'use strict';var _=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var logger=require(_0x8d87('0x2'))(_0x8d87('0x3'));var moment=require(_0x8d87('0x4'));var BPromise=require(_0x8d87('0x5'));var rp=require(_0x8d87('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8d87('0x7'));module['exports']=function(_0x5f11a6,_0x456998){return _0x5f11a6[_0x8d87('0x8')](_0x8d87('0x9'),attributes,{'tableName':_0x8d87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 07202ca..502243b 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x11a861,_0x13532b){var _0x50d43a=function(_0x12c7a2){while(--_0x12c7a2){_0x11a861['push'](_0x11a861['shift']());}};_0x50d43a(++_0x13532b);}(_0xe706,0xa3));var _0x6e70=function(_0x4b7a20,_0x470a22){_0x4b7a20=_0x4b7a20-0x0;var _0x302aa4=_0xe706[_0x4b7a20];return _0x302aa4;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x57fcdd,_0x28df3c){var _0xecaa62=function(_0x5ae4e5){while(--_0x5ae4e5){_0x57fcdd['push'](_0x57fcdd['shift']());}};_0xecaa62(++_0x28df3c);}(_0x70e0,0x17b));var _0x070e=function(_0x132f72,_0x530509){_0x132f72=_0x132f72-0x0;var _0x4313f9=_0x70e0[_0x132f72];return _0x4313f9;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 28af275..614a39c 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 _0x5379=['INTEGER','sequelize','exports'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x5379,0x1a2));var _0x9537=function(_0x58bf85,_0x171a5f){_0x58bf85=_0x58bf85-0x0;var _0x3498c5=_0x5379[_0x58bf85];return _0x3498c5;};'use strict';var Sequelize=require(_0x9537('0x0'));module[_0x9537('0x1')]={'penalty':{'type':Sequelize[_0x9537('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5336=['INTEGER','exports'];(function(_0x410a1d,_0x369bc8){var _0x28007a=function(_0x2cc888){while(--_0x2cc888){_0x410a1d['push'](_0x410a1d['shift']());}};_0x28007a(++_0x369bc8);}(_0x5336,0xa9));var _0x6533=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x5336[_0x17928f];return _0x500b63;};'use strict';var Sequelize=require('sequelize');module[_0x6533('0x0')]={'penalty':{'type':Sequelize[_0x6533('0x1')],'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 8f7960f..a66ae76 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 _0xcb99=['../../config/logger','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0x3ac492,_0x874029){var _0x5bf2b2=function(_0x159e95){while(--_0x159e95){_0x3ac492['push'](_0x3ac492['shift']());}};_0x5bf2b2(++_0x874029);}(_0xcb99,0x8b));var _0x9cb9=function(_0x3cdbe7,_0x3d6df1){_0x3cdbe7=_0x3cdbe7-0x0;var _0x38886e=_0xcb99[_0x3cdbe7];return _0x38886e;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var logger=require(_0x9cb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cb9('0x2'));var rp=require(_0x9cb9('0x3'));var fs=require('fs');var path=require(_0x9cb9('0x4'));var rimraf=require('rimraf');var config=require(_0x9cb9('0x5'));var attributes=require(_0x9cb9('0x6'));module['exports']=function(_0x214b72,_0x509cfc){return _0x214b72[_0x9cb9('0x7')](_0x9cb9('0x8'),attributes,{'tableName':_0x9cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8664=['moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x19697,_0x633c11){var _0x419edd=function(_0x463d2a){while(--_0x463d2a){_0x19697['push'](_0x19697['shift']());}};_0x419edd(++_0x633c11);}(_0x8664,0x11a));var _0x4866=function(_0x356b65,_0x1d2fca){_0x356b65=_0x356b65-0x0;var _0x1edc06=_0x8664[_0x356b65];return _0x1edc06;};'use strict';var _=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var logger=require(_0x4866('0x2'))(_0x4866('0x3'));var moment=require(_0x4866('0x4'));var BPromise=require(_0x4866('0x5'));var rp=require(_0x4866('0x6'));var fs=require('fs');var path=require(_0x4866('0x7'));var rimraf=require(_0x4866('0x8'));var config=require('../../config/environment');var attributes=require(_0x4866('0x9'));module['exports']=function(_0x66b444,_0x3eb6f9){return _0x66b444[_0x4866('0xa')](_0x4866('0xb'),attributes,{'tableName':_0x4866('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index cd57eb2..67798d9 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 _0x3645=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','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','stringify'];(function(_0x4b90b5,_0x54ed8c){var _0x5c1eab=function(_0x51b3a6){while(--_0x51b3a6){_0x4b90b5['push'](_0x4b90b5['shift']());}};_0x5c1eab(++_0x54ed8c);}(_0x3645,0x154));var _0x5364=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x3645[_0x21de89];return _0x290b7e;};'use strict';var _=require('lodash');var util=require(_0x5364('0x0'));var moment=require(_0x5364('0x1'));var BPromise=require(_0x5364('0x2'));var rs=require(_0x5364('0x3'));var fs=require('fs');var Redis=require(_0x5364('0x4'));var db=require(_0x5364('0x5'))['db'];var utils=require(_0x5364('0x6'));var logger=require('../../config/logger')(_0x5364('0x7'));var config=require(_0x5364('0x8'));var jayson=require(_0x5364('0x9'));var client=jayson[_0x5364('0xa')][_0x5364('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7933a5,_0x195fbe,_0x43fb3f){return new BPromise(function(_0x3c1b21,_0x47e3cf){return client[_0x5364('0xc')](_0x7933a5,_0x43fb3f)[_0x5364('0xd')](function(_0x3e60ea){logger[_0x5364('0xe')](_0x5364('0xf'),_0x195fbe,_0x5364('0x10'));logger[_0x5364('0x11')](_0x5364('0x12'),_0x195fbe,_0x5364('0x10'),JSON[_0x5364('0x13')](_0x3e60ea));if(_0x3e60ea[_0x5364('0x14')]){if(_0x3e60ea[_0x5364('0x14')][_0x5364('0x15')]===0x1f4){logger['error'](_0x5364('0xf'),_0x195fbe,_0x3e60ea[_0x5364('0x14')][_0x5364('0x16')]);return _0x47e3cf(_0x3e60ea[_0x5364('0x14')]['message']);}logger[_0x5364('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x195fbe,_0x3e60ea[_0x5364('0x14')]['message']);return _0x3c1b21(_0x3e60ea[_0x5364('0x14')][_0x5364('0x16')]);}else{logger[_0x5364('0xe')](_0x5364('0xf'),_0x195fbe,_0x5364('0x10'));_0x3c1b21(_0x3e60ea['result']['message']);}})[_0x5364('0x17')](function(_0x66766a){logger[_0x5364('0x14')](_0x5364('0xf'),_0x195fbe,_0x66766a);_0x47e3cf(_0x66766a);});});} \ 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','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1ef69f,_0x44ea11){var _0x175357=function(_0x22c1b6){while(--_0x22c1b6){_0x1ef69f['push'](_0x1ef69f['shift']());}};_0x175357(++_0x44ea11);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xcb91[_0x28a5ad];return _0x176b8a;};'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')]('TeamVoiceQueue,\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/template/index.js b/server/api/template/index.js index 71866fa..579822f 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 _0x4f2f=['isAuthenticated','index','/:id','show','post','create','put','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x2b6473,_0x203d73){var _0x1859ec=function(_0x5cfed7){while(--_0x5cfed7){_0x2b6473['push'](_0x2b6473['shift']());}};_0x1859ec(++_0x203d73);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x4f2f[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf4f2('0x0'));var timeout=require(_0xf4f2('0x1'));var express=require('express');var router=express[_0xf4f2('0x2')]();var fs_extra=require(_0xf4f2('0x3'));var auth=require(_0xf4f2('0x4'));var interaction=require(_0xf4f2('0x5'));var config=require(_0xf4f2('0x6'));var controller=require(_0xf4f2('0x7'));router[_0xf4f2('0x8')]('/',auth[_0xf4f2('0x9')](),controller[_0xf4f2('0xa')]);router[_0xf4f2('0x8')](_0xf4f2('0xb'),auth['isAuthenticated'](),controller[_0xf4f2('0xc')]);router[_0xf4f2('0xd')]('/',auth['isAuthenticated'](),controller[_0xf4f2('0xe')]);router[_0xf4f2('0xf')](_0xf4f2('0xb'),auth[_0xf4f2('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf4f2('0x10')]);module[_0xf4f2('0x11')]=router; \ No newline at end of file +var _0x1267=['isAuthenticated','index','get','/:id','show','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x442ae6,_0x58743b){var _0x581317=function(_0x3accfa){while(--_0x3accfa){_0x442ae6['push'](_0x442ae6['shift']());}};_0x581317(++_0x58743b);}(_0x1267,0xb5));var _0x7126=function(_0xdff12b,_0x31e5e7){_0xdff12b=_0xdff12b-0x0;var _0xc400b7=_0x1267[_0xdff12b];return _0xc400b7;};'use strict';var multer=require(_0x7126('0x0'));var util=require(_0x7126('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7126('0x2'));var router=express[_0x7126('0x3')]();var fs_extra=require(_0x7126('0x4'));var auth=require(_0x7126('0x5'));var interaction=require(_0x7126('0x6'));var config=require(_0x7126('0x7'));var controller=require(_0x7126('0x8'));router['get']('/',auth[_0x7126('0x9')](),controller[_0x7126('0xa')]);router[_0x7126('0xb')](_0x7126('0xc'),auth['isAuthenticated'](),controller[_0x7126('0xd')]);router['post']('/',auth[_0x7126('0x9')](),controller['create']);router[_0x7126('0xe')](_0x7126('0xc'),auth[_0x7126('0x9')](),controller[_0x7126('0xf')]);router[_0x7126('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7126('0x11')]);module[_0x7126('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 69f9090..eefce5b 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 _0xfb6a=['sequelize','exports','STRING'];(function(_0x1e9b4d,_0x1f0e71){var _0x3fe006=function(_0x462eb0){while(--_0x462eb0){_0x1e9b4d['push'](_0x1e9b4d['shift']());}};_0x3fe006(++_0x1f0e71);}(_0xfb6a,0x18f));var _0xafb6=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0xfb6a[_0x413b4d];return _0x8b810a;};'use strict';var Sequelize=require(_0xafb6('0x0'));module[_0xafb6('0x1')]={'name':{'type':Sequelize[_0xafb6('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb293=['exports','STRING','TEXT','sequelize'];(function(_0x18c7f7,_0x4263fc){var _0x5e142a=function(_0x49460e){while(--_0x49460e){_0x18c7f7['push'](_0x18c7f7['shift']());}};_0x5e142a(++_0x4263fc);}(_0xb293,0x12f));var _0x3b29=function(_0x1d1967,_0x52b368){_0x1d1967=_0x1d1967-0x0;var _0x5d6ce0=_0xb293[_0x1d1967];return _0x5d6ce0;};'use strict';var Sequelize=require(_0x3b29('0x0'));module[_0x3b29('0x1')]={'name':{'type':Sequelize[_0x3b29('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x3b29('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 83d3def..baa551c 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 _0x9fab=['../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','index','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','Template','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x9fab,0x12a));var _0xb9fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fab[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb9fa('0x0'));var rimraf=require(_0xb9fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb9fa('0x2'));var moment=require(_0xb9fa('0x3'));var BPromise=require(_0xb9fa('0x4'));var Mustache=require(_0xb9fa('0x5'));var util=require(_0xb9fa('0x6'));var path=require(_0xb9fa('0x7'));var sox=require(_0xb9fa('0x8'));var csv=require(_0xb9fa('0x9'));var ejs=require(_0xb9fa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9fa('0xb'));var squel=require(_0xb9fa('0xc'));var crypto=require(_0xb9fa('0xd'));var jsforce=require(_0xb9fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb9fa('0x9'));var querystring=require(_0xb9fa('0xf'));var Papa=require(_0xb9fa('0x10'));var Redis=require(_0xb9fa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb9fa('0x12'));var as=require(_0xb9fa('0x13'));var hardwareService=require(_0xb9fa('0x14'));var logger=require('../../config/logger')(_0xb9fa('0x15'));var utils=require(_0xb9fa('0x16'));var config=require(_0xb9fa('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x241a10,_0x63a5){_0x63a5=_0x63a5||0xcc;return function(_0x1d275d){if(_0x1d275d){return _0x241a10[_0xb9fa('0x18')](_0x63a5);}return _0x241a10[_0xb9fa('0x19')](_0x63a5)[_0xb9fa('0x1a')]();};}function respondWithResult(_0x2536a0,_0x179069){_0x179069=_0x179069||0xc8;return function(_0x363eaa){if(_0x363eaa){return _0x2536a0[_0xb9fa('0x19')](_0x179069)['json'](_0x363eaa);}};}function respondWithFilteredResult(_0x478081,_0x378b1b){return function(_0x4428af){if(_0x4428af){var _0x3c89f7=typeof _0x378b1b[_0xb9fa('0x1b')]===_0xb9fa('0x1c')&&typeof _0x378b1b[_0xb9fa('0x1d')]===_0xb9fa('0x1c');var _0x3a013c=_0x4428af[_0xb9fa('0x1e')];var _0xcb5819=_0x3c89f7?0x0:_0x378b1b['offset'];var _0x3fc8ca=_0x3c89f7?_0x4428af[_0xb9fa('0x1e')]:_0x378b1b[_0xb9fa('0x1b')]+_0x378b1b[_0xb9fa('0x1d')];var _0x14586e;if(_0x3fc8ca>=_0x3a013c){_0x3fc8ca=_0x3a013c;_0x14586e=0xc8;}else{_0x14586e=0xce;}_0x478081[_0xb9fa('0x19')](_0x14586e);return _0x478081[_0xb9fa('0x1f')](_0xb9fa('0x20'),_0xcb5819+'-'+_0x3fc8ca+'/'+_0x3a013c)['json'](_0x4428af);}return null;};}function patchUpdates(_0x4889f3){return function(_0x21da28){try{jsonpatch[_0xb9fa('0x21')](_0x21da28,_0x4889f3,!![]);}catch(_0x501111){return BPromise[_0xb9fa('0x22')](_0x501111);}return _0x21da28[_0xb9fa('0x23')]();};}function saveUpdates(_0x5853ce,_0x541709){return function(_0x36a30c){if(_0x36a30c){return _0x36a30c[_0xb9fa('0x24')](_0x5853ce)[_0xb9fa('0x25')](function(_0x5a0043){return _0x5a0043;});}return null;};}function removeEntity(_0x2541bc,_0x1e4d2e){return function(_0x1c2f70){if(_0x1c2f70){return _0x1c2f70[_0xb9fa('0x26')]()[_0xb9fa('0x25')](function(){var _0x1763e7=_0x1c2f70[_0xb9fa('0x27')]({'plain':!![]});var _0x1cba6e=_0xb9fa('0x28');return db[_0xb9fa('0x29')][_0xb9fa('0x26')]({'where':{'type':_0x1cba6e,'resourceId':_0x1763e7['id']}})[_0xb9fa('0x25')](function(){return _0x1c2f70;});})['then'](function(){_0x2541bc[_0xb9fa('0x19')](0xcc)[_0xb9fa('0x1a')]();});}};}function handleEntityNotFound(_0x3a3699,_0x58a54a){return function(_0x4c080b){if(!_0x4c080b){_0x3a3699[_0xb9fa('0x18')](0x194);}return _0x4c080b;};}function handleError(_0x515c0e,_0x4b53f3){_0x4b53f3=_0x4b53f3||0x1f4;return function(_0x584dd7){logger[_0xb9fa('0x2a')](_0x584dd7[_0xb9fa('0x2b')]);if(_0x584dd7['name']){delete _0x584dd7[_0xb9fa('0x2c')];}_0x515c0e[_0xb9fa('0x19')](_0x4b53f3)['send'](_0x584dd7);};}exports[_0xb9fa('0x2d')]=function(_0x5a652b,_0x246dca){var _0x57d82f={},_0x494ca0={},_0x3fe40a={'count':0x0,'rows':[]};var _0x322fb1=_[_0xb9fa('0x2e')](db['Template']['rawAttributes'],function(_0x38f63a){return{'name':_0x38f63a[_0xb9fa('0x2f')],'type':_0x38f63a['type'][_0xb9fa('0x30')]};});_0x494ca0[_0xb9fa('0x31')]=_[_0xb9fa('0x2e')](_0x322fb1,_0xb9fa('0x2c'));_0x494ca0[_0xb9fa('0x32')]=_[_0xb9fa('0x33')](_0x5a652b['query']);_0x494ca0[_0xb9fa('0x34')]=_['intersection'](_0x494ca0[_0xb9fa('0x31')],_0x494ca0['query']);_0x57d82f[_0xb9fa('0x35')]=_[_0xb9fa('0x36')](_0x494ca0[_0xb9fa('0x31')],qs[_0xb9fa('0x37')](_0x5a652b[_0xb9fa('0x32')][_0xb9fa('0x37')]));_0x57d82f['attributes']=_0x57d82f[_0xb9fa('0x35')][_0xb9fa('0x38')]?_0x57d82f[_0xb9fa('0x35')]:_0x494ca0[_0xb9fa('0x31')];if(!_0x5a652b[_0xb9fa('0x32')][_0xb9fa('0x39')](_0xb9fa('0x3a'))){_0x57d82f[_0xb9fa('0x1d')]=qs[_0xb9fa('0x1d')](_0x5a652b[_0xb9fa('0x32')][_0xb9fa('0x1d')]);_0x57d82f[_0xb9fa('0x1b')]=qs[_0xb9fa('0x1b')](_0x5a652b['query'][_0xb9fa('0x1b')]);}_0x57d82f[_0xb9fa('0x3b')]=qs['sort'](_0x5a652b[_0xb9fa('0x32')][_0xb9fa('0x3c')]);_0x57d82f[_0xb9fa('0x3d')]=qs[_0xb9fa('0x34')](_['pick'](_0x5a652b['query'],_0x494ca0[_0xb9fa('0x34')]),_0x322fb1);if(_0x5a652b[_0xb9fa('0x32')][_0xb9fa('0x3e')]){_0x57d82f[_0xb9fa('0x3d')]=_[_0xb9fa('0x3f')](_0x57d82f['where'],{'$or':_['map'](_0x322fb1,function(_0x284ddb){if(_0x284ddb[_0xb9fa('0x40')]!==_0xb9fa('0x41')){var _0x46e84b={};_0x46e84b[_0x284ddb['name']]={'$like':'%'+_0x5a652b[_0xb9fa('0x32')]['filter']+'%'};return _0x46e84b;}})});}_0x57d82f=_[_0xb9fa('0x3f')]({},_0x57d82f,_0x5a652b[_0xb9fa('0x42')]);var _0x2f85e={'where':_0x57d82f[_0xb9fa('0x3d')]};return db[_0xb9fa('0x43')]['count'](_0x2f85e)['then'](function(_0x20a674){_0x3fe40a[_0xb9fa('0x1e')]=_0x20a674;if(_0x5a652b['query'][_0xb9fa('0x44')]){_0x57d82f[_0xb9fa('0x45')]=[{'all':!![]}];}return db[_0xb9fa('0x43')][_0xb9fa('0x46')](_0x57d82f);})[_0xb9fa('0x25')](function(_0x2de800){_0x3fe40a['rows']=_0x2de800;return _0x3fe40a;})[_0xb9fa('0x25')](respondWithFilteredResult(_0x246dca,_0x57d82f))['catch'](handleError(_0x246dca,null));};exports[_0xb9fa('0x47')]=function(_0x579be2,_0x24586a){var _0x32ec94={'raw':!![],'where':{'id':_0x579be2[_0xb9fa('0x48')]['id']}},_0x2122f6={};_0x2122f6[_0xb9fa('0x31')]=_[_0xb9fa('0x33')](db[_0xb9fa('0x43')][_0xb9fa('0x49')]);_0x2122f6[_0xb9fa('0x32')]=_[_0xb9fa('0x33')](_0x579be2[_0xb9fa('0x32')]);_0x2122f6[_0xb9fa('0x34')]=_[_0xb9fa('0x36')](_0x2122f6[_0xb9fa('0x31')],_0x2122f6[_0xb9fa('0x32')]);_0x32ec94[_0xb9fa('0x35')]=_[_0xb9fa('0x36')](_0x2122f6[_0xb9fa('0x31')],qs[_0xb9fa('0x37')](_0x579be2[_0xb9fa('0x32')][_0xb9fa('0x37')]));_0x32ec94[_0xb9fa('0x35')]=_0x32ec94['attributes']['length']?_0x32ec94[_0xb9fa('0x35')]:_0x2122f6[_0xb9fa('0x31')];if(_0x579be2[_0xb9fa('0x32')][_0xb9fa('0x44')]){_0x32ec94['include']=[{'all':!![]}];}_0x32ec94=_[_0xb9fa('0x3f')]({},_0x32ec94,_0x579be2[_0xb9fa('0x42')]);return db[_0xb9fa('0x43')][_0xb9fa('0x4a')](_0x32ec94)[_0xb9fa('0x25')](handleEntityNotFound(_0x24586a,null))['then'](respondWithResult(_0x24586a,null))[_0xb9fa('0x4b')](handleError(_0x24586a,null));};exports[_0xb9fa('0x4c')]=function(_0x5c1684,_0x518d2e){return db[_0xb9fa('0x43')]['create'](_0x5c1684[_0xb9fa('0x4d')],{})[_0xb9fa('0x25')](function(_0x41939c){var _0x3b0994=_0x5c1684[_0xb9fa('0x4e')][_0xb9fa('0x27')]({'plain':!![]});if(!_0x3b0994)throw new Error(_0xb9fa('0x4f'));if(_0x3b0994['role']===_0xb9fa('0x4e')){var _0x34d02e=_0x41939c[_0xb9fa('0x27')]({'plain':!![]});var _0x59e7fa=_0xb9fa('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x59e7fa,'userProfileId':_0x3b0994['userProfileId']},'raw':!![]})[_0xb9fa('0x25')](function(_0x47ecef){if(_0x47ecef&&_0x47ecef['autoAssociation']===0x0){return db[_0xb9fa('0x29')][_0xb9fa('0x4c')]({'name':_0x34d02e[_0xb9fa('0x2c')],'resourceId':_0x34d02e['id'],'type':_0x47ecef[_0xb9fa('0x2c')],'sectionId':_0x47ecef['id']},{})[_0xb9fa('0x25')](function(){return _0x41939c;});}else{return _0x41939c;}})[_0xb9fa('0x4b')](function(_0x270f93){logger[_0xb9fa('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x270f93);throw _0x270f93;});}return _0x41939c;})[_0xb9fa('0x25')](respondWithResult(_0x518d2e,0xc9))['catch'](handleError(_0x518d2e,null));};exports[_0xb9fa('0x24')]=function(_0x376606,_0x21bbe9){if(_0x376606[_0xb9fa('0x4d')]['id']){delete _0x376606[_0xb9fa('0x4d')]['id'];}return db[_0xb9fa('0x43')][_0xb9fa('0x4a')]({'where':{'id':_0x376606[_0xb9fa('0x48')]['id']}})[_0xb9fa('0x25')](handleEntityNotFound(_0x21bbe9,null))['then'](saveUpdates(_0x376606[_0xb9fa('0x4d')],null))[_0xb9fa('0x25')](respondWithResult(_0x21bbe9,null))['catch'](handleError(_0x21bbe9,null));};exports[_0xb9fa('0x26')]=function(_0x281d73,_0x188d30){return db[_0xb9fa('0x43')]['find']({'where':{'id':_0x281d73['params']['id']}})[_0xb9fa('0x25')](handleEntityNotFound(_0x188d30,null))[_0xb9fa('0x25')](removeEntity(_0x188d30,null))[_0xb9fa('0x4b')](handleError(_0x188d30,null));}; \ No newline at end of file +var _0x1d64=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','Templates','error','stack','name','index','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','Template','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring'];(function(_0x59a40c,_0x35999f){var _0x3cf340=function(_0x3d2c47){while(--_0x3d2c47){_0x59a40c['push'](_0x59a40c['shift']());}};_0x3cf340(++_0x35999f);}(_0x1d64,0x122));var _0x41d6=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x1d64[_0x5280f4];return _0xba93e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41d6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41d6('0x1'));var rp=require(_0x41d6('0x2'));var moment=require('moment');var BPromise=require(_0x41d6('0x3'));var Mustache=require(_0x41d6('0x4'));var util=require(_0x41d6('0x5'));var path=require(_0x41d6('0x6'));var sox=require(_0x41d6('0x7'));var csv=require('to-csv');var ejs=require(_0x41d6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41d6('0x9'));var squel=require(_0x41d6('0xa'));var crypto=require(_0x41d6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x41d6('0xc'));var querystring=require(_0x41d6('0xd'));var Papa=require(_0x41d6('0xe'));var Redis=require(_0x41d6('0xf'));var authService=require(_0x41d6('0x10'));var qs=require(_0x41d6('0x11'));var as=require(_0x41d6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x41d6('0x13'))(_0x41d6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x41d6('0x15'))['db'];function respondWithStatusCode(_0x56eb11,_0x279b7d){_0x279b7d=_0x279b7d||0xcc;return function(_0x5b2d69){if(_0x5b2d69){return _0x56eb11['sendStatus'](_0x279b7d);}return _0x56eb11[_0x41d6('0x16')](_0x279b7d)[_0x41d6('0x17')]();};}function respondWithResult(_0x649964,_0x318d76){_0x318d76=_0x318d76||0xc8;return function(_0x52e0f2){if(_0x52e0f2){return _0x649964[_0x41d6('0x16')](_0x318d76)['json'](_0x52e0f2);}};}function respondWithFilteredResult(_0xd6953d,_0x51002e){return function(_0x4d8454){if(_0x4d8454){var _0x3d7a6f=typeof _0x51002e[_0x41d6('0x18')]===_0x41d6('0x19')&&typeof _0x51002e[_0x41d6('0x1a')]==='undefined';var _0x2f3e2e=_0x4d8454['count'];var _0x21ec10=_0x3d7a6f?0x0:_0x51002e[_0x41d6('0x18')];var _0x481e23=_0x3d7a6f?_0x4d8454[_0x41d6('0x1b')]:_0x51002e[_0x41d6('0x18')]+_0x51002e[_0x41d6('0x1a')];var _0x3c6660;if(_0x481e23>=_0x2f3e2e){_0x481e23=_0x2f3e2e;_0x3c6660=0xc8;}else{_0x3c6660=0xce;}_0xd6953d[_0x41d6('0x16')](_0x3c6660);return _0xd6953d['set'](_0x41d6('0x1c'),_0x21ec10+'-'+_0x481e23+'/'+_0x2f3e2e)['json'](_0x4d8454);}return null;};}function patchUpdates(_0x1cb8cd){return function(_0x13c70e){try{jsonpatch[_0x41d6('0x1d')](_0x13c70e,_0x1cb8cd,!![]);}catch(_0x3897c7){return BPromise['reject'](_0x3897c7);}return _0x13c70e[_0x41d6('0x1e')]();};}function saveUpdates(_0x107a4a,_0x146dfd){return function(_0x304b53){if(_0x304b53){return _0x304b53[_0x41d6('0x1f')](_0x107a4a)[_0x41d6('0x20')](function(_0x1487fb){return _0x1487fb;});}return null;};}function removeEntity(_0x1f5196,_0x23f1b2){return function(_0x57bc64){if(_0x57bc64){return _0x57bc64[_0x41d6('0x21')]()['then'](function(){var _0x33ee38=_0x57bc64['get']({'plain':!![]});var _0x5a4c33=_0x41d6('0x22');return db['UserProfileResource'][_0x41d6('0x21')]({'where':{'type':_0x5a4c33,'resourceId':_0x33ee38['id']}})[_0x41d6('0x20')](function(){return _0x57bc64;});})[_0x41d6('0x20')](function(){_0x1f5196[_0x41d6('0x16')](0xcc)[_0x41d6('0x17')]();});}};}function handleEntityNotFound(_0x4641da,_0x3ecebd){return function(_0x44da35){if(!_0x44da35){_0x4641da['sendStatus'](0x194);}return _0x44da35;};}function handleError(_0x5ea879,_0x424ecc){_0x424ecc=_0x424ecc||0x1f4;return function(_0x6a1008){logger[_0x41d6('0x23')](_0x6a1008[_0x41d6('0x24')]);if(_0x6a1008[_0x41d6('0x25')]){delete _0x6a1008[_0x41d6('0x25')];}_0x5ea879[_0x41d6('0x16')](_0x424ecc)['send'](_0x6a1008);};}exports[_0x41d6('0x26')]=function(_0x4045c4,_0x5988a4){var _0x420eee={},_0x2edcae={},_0x4f8a74={'count':0x0,'rows':[]};var _0x37daa2=_['map'](db['Template']['rawAttributes'],function(_0x2804e8){return{'name':_0x2804e8[_0x41d6('0x27')],'type':_0x2804e8[_0x41d6('0x28')]['key']};});_0x2edcae['model']=_[_0x41d6('0x29')](_0x37daa2,_0x41d6('0x25'));_0x2edcae[_0x41d6('0x2a')]=_['keys'](_0x4045c4[_0x41d6('0x2a')]);_0x2edcae[_0x41d6('0x2b')]=_[_0x41d6('0x2c')](_0x2edcae[_0x41d6('0x2d')],_0x2edcae[_0x41d6('0x2a')]);_0x420eee[_0x41d6('0x2e')]=_[_0x41d6('0x2c')](_0x2edcae[_0x41d6('0x2d')],qs[_0x41d6('0x2f')](_0x4045c4[_0x41d6('0x2a')]['fields']));_0x420eee[_0x41d6('0x2e')]=_0x420eee[_0x41d6('0x2e')][_0x41d6('0x30')]?_0x420eee[_0x41d6('0x2e')]:_0x2edcae[_0x41d6('0x2d')];if(!_0x4045c4['query'][_0x41d6('0x31')](_0x41d6('0x32'))){_0x420eee[_0x41d6('0x1a')]=qs[_0x41d6('0x1a')](_0x4045c4[_0x41d6('0x2a')][_0x41d6('0x1a')]);_0x420eee[_0x41d6('0x18')]=qs[_0x41d6('0x18')](_0x4045c4['query'][_0x41d6('0x18')]);}_0x420eee[_0x41d6('0x33')]=qs[_0x41d6('0x34')](_0x4045c4[_0x41d6('0x2a')]['sort']);_0x420eee[_0x41d6('0x35')]=qs['filters'](_[_0x41d6('0x36')](_0x4045c4[_0x41d6('0x2a')],_0x2edcae['filters']),_0x37daa2);if(_0x4045c4[_0x41d6('0x2a')]['filter']){_0x420eee[_0x41d6('0x35')]=_['merge'](_0x420eee[_0x41d6('0x35')],{'$or':_[_0x41d6('0x29')](_0x37daa2,function(_0x3d04ce){if(_0x3d04ce[_0x41d6('0x28')]!==_0x41d6('0x37')){var _0x210b7a={};_0x210b7a[_0x3d04ce['name']]={'$like':'%'+_0x4045c4[_0x41d6('0x2a')][_0x41d6('0x38')]+'%'};return _0x210b7a;}})});}_0x420eee=_[_0x41d6('0x39')]({},_0x420eee,_0x4045c4['options']);var _0x305800={'where':_0x420eee['where']};return db[_0x41d6('0x3a')][_0x41d6('0x1b')](_0x305800)[_0x41d6('0x20')](function(_0x20d4c8){_0x4f8a74[_0x41d6('0x1b')]=_0x20d4c8;if(_0x4045c4[_0x41d6('0x2a')]['includeAll']){_0x420eee[_0x41d6('0x3b')]=[{'all':!![]}];}return db[_0x41d6('0x3a')]['findAll'](_0x420eee);})[_0x41d6('0x20')](function(_0x1f0a87){_0x4f8a74[_0x41d6('0x3c')]=_0x1f0a87;return _0x4f8a74;})['then'](respondWithFilteredResult(_0x5988a4,_0x420eee))[_0x41d6('0x3d')](handleError(_0x5988a4,null));};exports[_0x41d6('0x3e')]=function(_0x25e93c,_0x1e4a3a){var _0x388ff2={'raw':!![],'where':{'id':_0x25e93c[_0x41d6('0x3f')]['id']}},_0x2fbc45={};_0x2fbc45[_0x41d6('0x2d')]=_[_0x41d6('0x40')](db['Template'][_0x41d6('0x41')]);_0x2fbc45['query']=_[_0x41d6('0x40')](_0x25e93c[_0x41d6('0x2a')]);_0x2fbc45['filters']=_['intersection'](_0x2fbc45['model'],_0x2fbc45[_0x41d6('0x2a')]);_0x388ff2['attributes']=_[_0x41d6('0x2c')](_0x2fbc45['model'],qs[_0x41d6('0x2f')](_0x25e93c[_0x41d6('0x2a')][_0x41d6('0x2f')]));_0x388ff2['attributes']=_0x388ff2[_0x41d6('0x2e')]['length']?_0x388ff2[_0x41d6('0x2e')]:_0x2fbc45[_0x41d6('0x2d')];if(_0x25e93c[_0x41d6('0x2a')][_0x41d6('0x42')]){_0x388ff2['include']=[{'all':!![]}];}_0x388ff2=_[_0x41d6('0x39')]({},_0x388ff2,_0x25e93c['options']);return db[_0x41d6('0x3a')][_0x41d6('0x43')](_0x388ff2)[_0x41d6('0x20')](handleEntityNotFound(_0x1e4a3a,null))[_0x41d6('0x20')](respondWithResult(_0x1e4a3a,null))['catch'](handleError(_0x1e4a3a,null));};exports['create']=function(_0x839a04,_0x118096){return db['Template']['create'](_0x839a04[_0x41d6('0x44')],{})['then'](function(_0x59d158){var _0xa99ab6=_0x839a04[_0x41d6('0x45')][_0x41d6('0x46')]({'plain':!![]});if(!_0xa99ab6)throw new Error(_0x41d6('0x47'));if(_0xa99ab6[_0x41d6('0x48')]===_0x41d6('0x45')){var _0x37fb49=_0x59d158[_0x41d6('0x46')]({'plain':!![]});var _0x4589ee='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x4589ee,'userProfileId':_0xa99ab6[_0x41d6('0x49')]},'raw':!![]})[_0x41d6('0x20')](function(_0x33f3a3){if(_0x33f3a3&&_0x33f3a3['autoAssociation']===0x0){return db[_0x41d6('0x4a')]['create']({'name':_0x37fb49[_0x41d6('0x25')],'resourceId':_0x37fb49['id'],'type':_0x33f3a3[_0x41d6('0x25')],'sectionId':_0x33f3a3['id']},{})[_0x41d6('0x20')](function(){return _0x59d158;});}else{return _0x59d158;}})[_0x41d6('0x3d')](function(_0x1c1af7){logger['error'](_0x41d6('0x4b'),_0x1c1af7);throw _0x1c1af7;});}return _0x59d158;})[_0x41d6('0x20')](respondWithResult(_0x118096,0xc9))[_0x41d6('0x3d')](handleError(_0x118096,null));};exports[_0x41d6('0x1f')]=function(_0x20c5cb,_0x25444d){if(_0x20c5cb['body']['id']){delete _0x20c5cb[_0x41d6('0x44')]['id'];}return db['Template'][_0x41d6('0x43')]({'where':{'id':_0x20c5cb['params']['id']}})['then'](handleEntityNotFound(_0x25444d,null))[_0x41d6('0x20')](saveUpdates(_0x20c5cb[_0x41d6('0x44')],null))[_0x41d6('0x20')](respondWithResult(_0x25444d,null))[_0x41d6('0x3d')](handleError(_0x25444d,null));};exports['destroy']=function(_0x42551d,_0xc43d30){return db['Template'][_0x41d6('0x43')]({'where':{'id':_0x42551d[_0x41d6('0x3f')]['id']}})[_0x41d6('0x20')](handleEntityNotFound(_0xc43d30,null))[_0x41d6('0x20')](removeEntity(_0xc43d30,null))[_0x41d6('0x3d')](handleError(_0xc43d30,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 6c630e9..ac5171e 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 _0x1f7e=['moment','bluebird','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','api'];(function(_0x4b7e5c,_0x35f913){var _0x1f4939=function(_0x32e58a){while(--_0x32e58a){_0x4b7e5c['push'](_0x4b7e5c['shift']());}};_0x1f4939(++_0x35f913);}(_0x1f7e,0x81));var _0xe1f7=function(_0x479633,_0x19562f){_0x479633=_0x479633-0x0;var _0x50a44b=_0x1f7e[_0x479633];return _0x50a44b;};'use strict';var _=require(_0xe1f7('0x0'));var util=require(_0xe1f7('0x1'));var logger=require('../../config/logger')(_0xe1f7('0x2'));var moment=require(_0xe1f7('0x3'));var BPromise=require(_0xe1f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1f7('0x5'));var config=require(_0xe1f7('0x6'));var attributes=require(_0xe1f7('0x7'));module[_0xe1f7('0x8')]=function(_0x6ee284,_0x2c7b51){return _0x6ee284[_0xe1f7('0x9')](_0xe1f7('0xa'),attributes,{'tableName':_0xe1f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95b8=['rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x12c323,_0x596cd2){var _0x2289ae=function(_0x3e255a){while(--_0x3e255a){_0x12c323['push'](_0x12c323['shift']());}};_0x2289ae(++_0x596cd2);}(_0x95b8,0x192));var _0x895b=function(_0x189a67,_0x374595){_0x189a67=_0x189a67-0x0;var _0x3b9184=_0x95b8[_0x189a67];return _0x3b9184;};'use strict';var _=require(_0x895b('0x0'));var util=require(_0x895b('0x1'));var logger=require(_0x895b('0x2'))('api');var moment=require(_0x895b('0x3'));var BPromise=require(_0x895b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x895b('0x5'));var rimraf=require(_0x895b('0x6'));var config=require(_0x895b('0x7'));var attributes=require(_0x895b('0x8'));module['exports']=function(_0x4fa4f3,_0x4062c0){return _0x4fa4f3[_0x895b('0x9')](_0x895b('0xa'),attributes,{'tableName':_0x895b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 4b5d951..1280ef2 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 _0xa496=['../../config/environment','jayson/promise','request','then','info','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Template,\x20%s,\x20%s','result','catch','GetTemplate','findAll','raw','options','where','attributes','include','map','model','stringify','lodash','util','../../config/utils','rpc'];(function(_0x252328,_0x4c22f0){var _0xaa85b7=function(_0x2623d0){while(--_0x2623d0){_0x252328['push'](_0x252328['shift']());}};_0xaa85b7(++_0x4c22f0);}(_0xa496,0xf8));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6a49('0x0'));var util=require(_0x6a49('0x1'));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(_0x6a49('0x2'));var logger=require('../../config/logger')(_0x6a49('0x3'));var config=require(_0x6a49('0x4'));var jayson=require(_0x6a49('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x183a2a,_0x52506b,_0x4a5aa9){return new BPromise(function(_0x517255,_0xb0775e){return client[_0x6a49('0x6')](_0x183a2a,_0x4a5aa9)[_0x6a49('0x7')](function(_0x45a06a){logger[_0x6a49('0x8')]('Template,\x20%s,\x20%s',_0x52506b,'request\x20sent');logger[_0x6a49('0x9')](_0x6a49('0xa'),_0x52506b,_0x6a49('0xb'),JSON['stringify'](_0x45a06a));if(_0x45a06a[_0x6a49('0xc')]){if(_0x45a06a['error'][_0x6a49('0xd')]===0x1f4){logger[_0x6a49('0xc')]('Template,\x20%s,\x20%s',_0x52506b,_0x45a06a['error']['message']);return _0xb0775e(_0x45a06a['error'][_0x6a49('0xe')]);}logger[_0x6a49('0xc')](_0x6a49('0xf'),_0x52506b,_0x45a06a[_0x6a49('0xc')][_0x6a49('0xe')]);return _0x517255(_0x45a06a[_0x6a49('0xc')][_0x6a49('0xe')]);}else{logger[_0x6a49('0x8')](_0x6a49('0xf'),_0x52506b,_0x6a49('0xb'));_0x517255(_0x45a06a[_0x6a49('0x10')][_0x6a49('0xe')]);}})[_0x6a49('0x11')](function(_0x5cc649){logger[_0x6a49('0xc')](_0x6a49('0xf'),_0x52506b,_0x5cc649);_0xb0775e(_0x5cc649);});});}exports[_0x6a49('0x12')]=function(_0x21f639){var _0x2914e9=this;return new Promise(function(_0x577763,_0x22320e){return db['Template'][_0x6a49('0x13')]({'raw':_0x21f639['options']?_0x21f639['options'][_0x6a49('0x14')]===undefined?!![]:![]:!![],'where':_0x21f639[_0x6a49('0x15')]?_0x21f639[_0x6a49('0x15')][_0x6a49('0x16')]||null:null,'attributes':_0x21f639[_0x6a49('0x15')]?_0x21f639['options'][_0x6a49('0x17')]||null:null,'limit':_0x21f639['options']?_0x21f639['options']['limit']||null:null,'include':_0x21f639['options']?_0x21f639[_0x6a49('0x15')][_0x6a49('0x18')]?_[_0x6a49('0x19')](_0x21f639[_0x6a49('0x15')][_0x6a49('0x18')],function(_0x2757b6){return{'model':db[_0x2757b6[_0x6a49('0x1a')]],'as':_0x2757b6['as'],'attributes':_0x2757b6[_0x6a49('0x17')],'include':_0x2757b6[_0x6a49('0x18')]?_[_0x6a49('0x19')](_0x2757b6[_0x6a49('0x18')],function(_0x22394a){return{'model':db[_0x22394a['model']],'as':_0x22394a['as'],'attributes':_0x22394a[_0x6a49('0x17')],'include':_0x22394a[_0x6a49('0x18')]?_[_0x6a49('0x19')](_0x22394a[_0x6a49('0x18')],function(_0x4b4ec5){return{'model':db[_0x4b4ec5[_0x6a49('0x1a')]],'as':_0x4b4ec5['as'],'attributes':_0x4b4ec5['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a49('0x7')](function(_0x388273){logger[_0x6a49('0x8')](_0x6a49('0x12'),_0x21f639);logger['debug'](_0x6a49('0x12'),_0x21f639,JSON[_0x6a49('0x1b')](_0x388273));_0x577763(_0x388273);})[_0x6a49('0x11')](function(_0x3c58b3){logger['error'](_0x6a49('0x12'),_0x3c58b3['message'],_0x21f639);_0x22320e(_0x2914e9[_0x6a49('0xc')](0x1f4,_0x3c58b3[_0x6a49('0xe')]));});});}; \ No newline at end of file +var _0xe4a3=['../../config/environment','jayson/promise','client','request','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2b271b,_0x47ab63){var _0x464860=function(_0x367fad){while(--_0x367fad){_0x2b271b['push'](_0x2b271b['shift']());}};_0x464860(++_0x47ab63);}(_0xe4a3,0x164));var _0x3e4a=function(_0x1e8f0c,_0x40e34a){_0x1e8f0c=_0x1e8f0c-0x0;var _0x2cdb1e=_0xe4a3[_0x1e8f0c];return _0x2cdb1e;};'use strict';var _=require(_0x3e4a('0x0'));var util=require(_0x3e4a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3e4a('0x2'));var fs=require('fs');var Redis=require(_0x3e4a('0x3'));var db=require(_0x3e4a('0x4'))['db'];var utils=require(_0x3e4a('0x5'));var logger=require(_0x3e4a('0x6'))('rpc');var config=require(_0x3e4a('0x7'));var jayson=require(_0x3e4a('0x8'));var client=jayson[_0x3e4a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433c87,_0x257863,_0x2099ac){return new BPromise(function(_0x3ae2f8,_0x151c4e){return client[_0x3e4a('0xa')](_0x433c87,_0x2099ac)['then'](function(_0x177ade){logger['info'](_0x3e4a('0xb'),_0x257863,_0x3e4a('0xc'));logger[_0x3e4a('0xd')](_0x3e4a('0xe'),_0x257863,_0x3e4a('0xc'),JSON[_0x3e4a('0xf')](_0x177ade));if(_0x177ade[_0x3e4a('0x10')]){if(_0x177ade[_0x3e4a('0x10')][_0x3e4a('0x11')]===0x1f4){logger[_0x3e4a('0x10')](_0x3e4a('0xb'),_0x257863,_0x177ade[_0x3e4a('0x10')]['message']);return _0x151c4e(_0x177ade[_0x3e4a('0x10')][_0x3e4a('0x12')]);}logger[_0x3e4a('0x10')](_0x3e4a('0xb'),_0x257863,_0x177ade[_0x3e4a('0x10')][_0x3e4a('0x12')]);return _0x3ae2f8(_0x177ade[_0x3e4a('0x10')][_0x3e4a('0x12')]);}else{logger[_0x3e4a('0x13')](_0x3e4a('0xb'),_0x257863,_0x3e4a('0xc'));_0x3ae2f8(_0x177ade[_0x3e4a('0x14')][_0x3e4a('0x12')]);}})[_0x3e4a('0x15')](function(_0x2c1ea1){logger[_0x3e4a('0x10')]('Template,\x20%s,\x20%s',_0x257863,_0x2c1ea1);_0x151c4e(_0x2c1ea1);});});}exports[_0x3e4a('0x16')]=function(_0x35c31a){var _0x469df4=this;return new Promise(function(_0xd31d02,_0x32cc1b){return db[_0x3e4a('0x17')]['findAll']({'raw':_0x35c31a['options']?_0x35c31a[_0x3e4a('0x18')][_0x3e4a('0x19')]===undefined?!![]:![]:!![],'where':_0x35c31a[_0x3e4a('0x18')]?_0x35c31a[_0x3e4a('0x18')][_0x3e4a('0x1a')]||null:null,'attributes':_0x35c31a['options']?_0x35c31a[_0x3e4a('0x18')][_0x3e4a('0x1b')]||null:null,'limit':_0x35c31a[_0x3e4a('0x18')]?_0x35c31a[_0x3e4a('0x18')][_0x3e4a('0x1c')]||null:null,'include':_0x35c31a[_0x3e4a('0x18')]?_0x35c31a[_0x3e4a('0x18')][_0x3e4a('0x1d')]?_['map'](_0x35c31a[_0x3e4a('0x18')][_0x3e4a('0x1d')],function(_0x27c488){return{'model':db[_0x27c488['model']],'as':_0x27c488['as'],'attributes':_0x27c488[_0x3e4a('0x1b')],'include':_0x27c488[_0x3e4a('0x1d')]?_['map'](_0x27c488[_0x3e4a('0x1d')],function(_0x244c6a){return{'model':db[_0x244c6a['model']],'as':_0x244c6a['as'],'attributes':_0x244c6a[_0x3e4a('0x1b')],'include':_0x244c6a[_0x3e4a('0x1d')]?_[_0x3e4a('0x1e')](_0x244c6a[_0x3e4a('0x1d')],function(_0x217b8a){return{'model':db[_0x217b8a[_0x3e4a('0x1f')]],'as':_0x217b8a['as'],'attributes':_0x217b8a[_0x3e4a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3e4a('0x20')](function(_0x52d5e6){logger[_0x3e4a('0x13')](_0x3e4a('0x16'),_0x35c31a);logger[_0x3e4a('0xd')](_0x3e4a('0x16'),_0x35c31a,JSON[_0x3e4a('0xf')](_0x52d5e6));_0xd31d02(_0x52d5e6);})[_0x3e4a('0x15')](function(_0x3f3915){logger['error']('GetTemplate',_0x3f3915[_0x3e4a('0x12')],_0x35c31a);_0x32cc1b(_0x469df4[_0x3e4a('0x10')](0x1f4,_0x3f3915[_0x3e4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 10c5218..b8432f9 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 _0x486e=['/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAction','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions'];(function(_0x179025,_0x4abc9e){var _0x36fa58=function(_0x220818){while(--_0x220818){_0x179025['push'](_0x179025['shift']());}};_0x36fa58(++_0x4abc9e);}(_0x486e,0xb2));var _0xe486=function(_0x214403,_0x3e532b){_0x214403=_0x214403-0x0;var _0x387cd5=_0x486e[_0x214403];return _0x387cd5;};'use strict';var multer=require(_0xe486('0x0'));var util=require(_0xe486('0x1'));var path=require('path');var timeout=require(_0xe486('0x2'));var express=require(_0xe486('0x3'));var router=express[_0xe486('0x4')]();var fs_extra=require(_0xe486('0x5'));var auth=require(_0xe486('0x6'));var interaction=require(_0xe486('0x7'));var config=require(_0xe486('0x8'));var controller=require(_0xe486('0x9'));router[_0xe486('0xa')]('/',auth[_0xe486('0xb')](),controller[_0xe486('0xc')]);router['get'](_0xe486('0xd'),auth[_0xe486('0xb')](),controller[_0xe486('0xe')]);router[_0xe486('0xa')](_0xe486('0xf'),auth[_0xe486('0xb')](),controller[_0xe486('0x10')]);router[_0xe486('0xa')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xe486('0x11')]);router[_0xe486('0xa')](_0xe486('0x12'),auth[_0xe486('0xb')](),controller[_0xe486('0x13')]);router[_0xe486('0x14')]('/',auth[_0xe486('0xb')](),controller[_0xe486('0x15')]);router[_0xe486('0x14')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xe486('0x16')]);router[_0xe486('0x14')](_0xe486('0x17'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xe486('0x14')]('/:id/actions',auth[_0xe486('0xb')](),controller[_0xe486('0x18')]);router[_0xe486('0x19')](_0xe486('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe486('0x1a')](_0xe486('0xd'),auth['isAuthenticated'](),controller[_0xe486('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x0f19=['get','isAuthenticated','/:id','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','./trigger.controller'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0x0f19,0xf3));var _0x90f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f19[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x90f1('0x0'));var util=require(_0x90f1('0x1'));var path=require(_0x90f1('0x2'));var timeout=require('connect-timeout');var express=require(_0x90f1('0x3'));var router=express[_0x90f1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x90f1('0x5'));var config=require('../../config/environment');var controller=require(_0x90f1('0x6'));router[_0x90f1('0x7')]('/',auth[_0x90f1('0x8')](),controller['index']);router['get'](_0x90f1('0x9'),auth['isAuthenticated'](),controller[_0x90f1('0xa')]);router['get'](_0x90f1('0xb'),auth[_0x90f1('0x8')](),controller['getAllConditions']);router[_0x90f1('0x7')](_0x90f1('0xc'),auth['isAuthenticated'](),controller[_0x90f1('0xd')]);router[_0x90f1('0x7')](_0x90f1('0xe'),auth[_0x90f1('0x8')](),controller[_0x90f1('0xf')]);router[_0x90f1('0x10')]('/',auth[_0x90f1('0x8')](),controller[_0x90f1('0x11')]);router[_0x90f1('0x10')]('/:id/all_conditions',auth[_0x90f1('0x8')](),controller[_0x90f1('0x12')]);router['post']('/:id/any_conditions',auth[_0x90f1('0x8')](),controller[_0x90f1('0x13')]);router[_0x90f1('0x10')]('/:id/actions',auth[_0x90f1('0x8')](),controller[_0x90f1('0x14')]);router[_0x90f1('0x15')](_0x90f1('0x9'),auth['isAuthenticated'](),controller[_0x90f1('0x16')]);router[_0x90f1('0x17')](_0x90f1('0x9'),auth[_0x90f1('0x8')](),controller['destroy']);module[_0x90f1('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 82cdeca..d5d17ab 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 _0x7473=['STRING','BOOLEAN','exports'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x7473,0x194));var _0x3747=function(_0x5cdb30,_0x1178d7){_0x5cdb30=_0x5cdb30-0x0;var _0x42f6bb=_0x7473[_0x5cdb30];return _0x42f6bb;};'use strict';var Sequelize=require('sequelize');module[_0x3747('0x0')]={'name':{'type':Sequelize[_0x3747('0x1')]},'channel':{'type':Sequelize[_0x3747('0x1')]},'description':{'type':Sequelize[_0x3747('0x1')]},'status':{'type':Sequelize[_0x3747('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfca4=['sequelize','exports','STRING'];(function(_0x5326df,_0x4babd6){var _0x6a86fd=function(_0x53f53c){while(--_0x53f53c){_0x5326df['push'](_0x5326df['shift']());}};_0x6a86fd(++_0x4babd6);}(_0xfca4,0x12c));var _0x4fca=function(_0x489a55,_0x1f5395){_0x489a55=_0x489a55-0x0;var _0x5beb03=_0xfca4[_0x489a55];return _0x5beb03;};'use strict';var Sequelize=require(_0x4fca('0x0'));module[_0x4fca('0x1')]={'name':{'type':Sequelize[_0x4fca('0x2')]},'channel':{'type':Sequelize[_0x4fca('0x2')]},'description':{'type':Sequelize[_0x4fca('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index fc0f2d7..081be44 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 _0xd2d3=['limit','count','set','apply','reject','update','destroy','then','get','Triggers','UserProfileResource','stack','name','Trigger','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4cd4f2,_0x8cc59e){var _0x377e13=function(_0xd223b){while(--_0xd223b){_0x4cd4f2['push'](_0x4cd4f2['shift']());}};_0x377e13(++_0x8cc59e);}(_0xd2d3,0x15d));var _0x3d2d=function(_0xca7446,_0x25f157){_0xca7446=_0xca7446-0x0;var _0x21801b=_0xd2d3[_0xca7446];return _0x21801b;};'use strict';var emlformat=require(_0x3d2d('0x0'));var rimraf=require(_0x3d2d('0x1'));var zipdir=require(_0x3d2d('0x2'));var jsonpatch=require(_0x3d2d('0x3'));var rp=require(_0x3d2d('0x4'));var moment=require(_0x3d2d('0x5'));var BPromise=require(_0x3d2d('0x6'));var Mustache=require('mustache');var util=require(_0x3d2d('0x7'));var path=require('path');var sox=require(_0x3d2d('0x8'));var csv=require(_0x3d2d('0x9'));var ejs=require(_0x3d2d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3d2d('0xb'));var crypto=require('crypto');var jsforce=require(_0x3d2d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3d2d('0x9'));var querystring=require(_0x3d2d('0xd'));var Papa=require(_0x3d2d('0xe'));var Redis=require(_0x3d2d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3d2d('0x10'));var as=require(_0x3d2d('0x11'));var hardwareService=require(_0x3d2d('0x12'));var logger=require(_0x3d2d('0x13'))(_0x3d2d('0x14'));var utils=require(_0x3d2d('0x15'));var config=require(_0x3d2d('0x16'));var licenseUtil=require(_0x3d2d('0x17'));var db=require(_0x3d2d('0x18'))['db'];function respondWithStatusCode(_0x75c2f4,_0x27afa1){_0x27afa1=_0x27afa1||0xcc;return function(_0x26d2dd){if(_0x26d2dd){return _0x75c2f4[_0x3d2d('0x19')](_0x27afa1);}return _0x75c2f4[_0x3d2d('0x1a')](_0x27afa1)[_0x3d2d('0x1b')]();};}function respondWithResult(_0x3116aa,_0x4557a4){_0x4557a4=_0x4557a4||0xc8;return function(_0x2daeaf){if(_0x2daeaf){return _0x3116aa['status'](_0x4557a4)[_0x3d2d('0x1c')](_0x2daeaf);}};}function respondWithFilteredResult(_0x46d47b,_0x368cfd){return function(_0xfaadd6){if(_0xfaadd6){var _0x8fe29c=typeof _0x368cfd[_0x3d2d('0x1d')]===_0x3d2d('0x1e')&&typeof _0x368cfd[_0x3d2d('0x1f')]===_0x3d2d('0x1e');var _0x1ad85e=_0xfaadd6[_0x3d2d('0x20')];var _0x109d8a=_0x8fe29c?0x0:_0x368cfd['offset'];var _0x44d7ec=_0x8fe29c?_0xfaadd6[_0x3d2d('0x20')]:_0x368cfd[_0x3d2d('0x1d')]+_0x368cfd['limit'];var _0x13039f;if(_0x44d7ec>=_0x1ad85e){_0x44d7ec=_0x1ad85e;_0x13039f=0xc8;}else{_0x13039f=0xce;}_0x46d47b[_0x3d2d('0x1a')](_0x13039f);return _0x46d47b[_0x3d2d('0x21')]('Content-Range',_0x109d8a+'-'+_0x44d7ec+'/'+_0x1ad85e)[_0x3d2d('0x1c')](_0xfaadd6);}return null;};}function patchUpdates(_0x2cecf3){return function(_0x2979ea){try{jsonpatch[_0x3d2d('0x22')](_0x2979ea,_0x2cecf3,!![]);}catch(_0x2dc29d){return BPromise[_0x3d2d('0x23')](_0x2dc29d);}return _0x2979ea['save']();};}function saveUpdates(_0xc7c92e,_0x19f916){return function(_0x47b298){if(_0x47b298){return _0x47b298[_0x3d2d('0x24')](_0xc7c92e)['then'](function(_0x4a67af){return _0x4a67af;});}return null;};}function removeEntity(_0x3dd4b3,_0x3acee9){return function(_0x5380bd){if(_0x5380bd){return _0x5380bd[_0x3d2d('0x25')]()[_0x3d2d('0x26')](function(){var _0x21dd48=_0x5380bd[_0x3d2d('0x27')]({'plain':!![]});var _0x53001b=_0x3d2d('0x28');return db[_0x3d2d('0x29')][_0x3d2d('0x25')]({'where':{'type':_0x53001b,'resourceId':_0x21dd48['id']}})[_0x3d2d('0x26')](function(){return _0x5380bd;});})[_0x3d2d('0x26')](function(){_0x3dd4b3['status'](0xcc)[_0x3d2d('0x1b')]();});}};}function handleEntityNotFound(_0x4778bc,_0x2cab28){return function(_0x504cd3){if(!_0x504cd3){_0x4778bc['sendStatus'](0x194);}return _0x504cd3;};}function handleError(_0xfbe181,_0x405876){_0x405876=_0x405876||0x1f4;return function(_0x4926a1){logger['error'](_0x4926a1[_0x3d2d('0x2a')]);if(_0x4926a1[_0x3d2d('0x2b')]){delete _0x4926a1[_0x3d2d('0x2b')];}_0xfbe181[_0x3d2d('0x1a')](_0x405876)['send'](_0x4926a1);};}exports['index']=function(_0x5b427d,_0x3b85ae){var _0x172e13={},_0x397db9={},_0x55b768={'count':0x0,'rows':[]};var _0x1ddb5f=_['map'](db[_0x3d2d('0x2c')][_0x3d2d('0x2d')],function(_0x3bb92f){return{'name':_0x3bb92f[_0x3d2d('0x2e')],'type':_0x3bb92f[_0x3d2d('0x2f')]['key']};});_0x397db9[_0x3d2d('0x30')]=_[_0x3d2d('0x31')](_0x1ddb5f,_0x3d2d('0x2b'));_0x397db9[_0x3d2d('0x32')]=_['keys'](_0x5b427d[_0x3d2d('0x32')]);_0x397db9[_0x3d2d('0x33')]=_[_0x3d2d('0x34')](_0x397db9[_0x3d2d('0x30')],_0x397db9[_0x3d2d('0x32')]);_0x172e13[_0x3d2d('0x35')]=_['intersection'](_0x397db9[_0x3d2d('0x30')],qs[_0x3d2d('0x36')](_0x5b427d[_0x3d2d('0x32')][_0x3d2d('0x36')]));_0x172e13[_0x3d2d('0x35')]=_0x172e13['attributes'][_0x3d2d('0x37')]?_0x172e13[_0x3d2d('0x35')]:_0x397db9['model'];if(!_0x5b427d[_0x3d2d('0x32')]['hasOwnProperty'](_0x3d2d('0x38'))){_0x172e13[_0x3d2d('0x1f')]=qs['limit'](_0x5b427d['query'][_0x3d2d('0x1f')]);_0x172e13[_0x3d2d('0x1d')]=qs[_0x3d2d('0x1d')](_0x5b427d['query'][_0x3d2d('0x1d')]);}_0x172e13[_0x3d2d('0x39')]=qs['sort'](_0x5b427d['query'][_0x3d2d('0x3a')]);_0x172e13[_0x3d2d('0x3b')]=qs[_0x3d2d('0x33')](_[_0x3d2d('0x3c')](_0x5b427d[_0x3d2d('0x32')],_0x397db9[_0x3d2d('0x33')]),_0x1ddb5f);if(_0x5b427d[_0x3d2d('0x32')][_0x3d2d('0x3d')]){_0x172e13[_0x3d2d('0x3b')]=_[_0x3d2d('0x3e')](_0x172e13[_0x3d2d('0x3b')],{'$or':_[_0x3d2d('0x31')](_0x1ddb5f,function(_0x572d8d){if(_0x572d8d[_0x3d2d('0x2f')]!==_0x3d2d('0x3f')){var _0x5a57a3={};_0x5a57a3[_0x572d8d[_0x3d2d('0x2b')]]={'$like':'%'+_0x5b427d['query'][_0x3d2d('0x3d')]+'%'};return _0x5a57a3;}})});}_0x172e13=_[_0x3d2d('0x3e')]({},_0x172e13,_0x5b427d[_0x3d2d('0x40')]);var _0x384ab7={'where':_0x172e13[_0x3d2d('0x3b')]};return db['Trigger']['count'](_0x384ab7)[_0x3d2d('0x26')](function(_0x4f4820){_0x55b768[_0x3d2d('0x20')]=_0x4f4820;if(_0x5b427d[_0x3d2d('0x32')][_0x3d2d('0x41')]){_0x172e13[_0x3d2d('0x42')]=[{'all':!![]}];}return db[_0x3d2d('0x2c')][_0x3d2d('0x43')](_0x172e13);})['then'](function(_0x3807d9){_0x55b768[_0x3d2d('0x44')]=_0x3807d9;return _0x55b768;})[_0x3d2d('0x26')](respondWithFilteredResult(_0x3b85ae,_0x172e13))[_0x3d2d('0x45')](handleError(_0x3b85ae,null));};exports['show']=function(_0x30fe60,_0x39bf99){var _0x21d7af={'raw':![],'where':{'id':_0x30fe60['params']['id']}},_0x198ae3={};_0x198ae3[_0x3d2d('0x30')]=_[_0x3d2d('0x46')](db[_0x3d2d('0x2c')]['rawAttributes']);_0x198ae3[_0x3d2d('0x32')]=_[_0x3d2d('0x46')](_0x30fe60[_0x3d2d('0x32')]);_0x198ae3[_0x3d2d('0x33')]=_['intersection'](_0x198ae3[_0x3d2d('0x30')],_0x198ae3[_0x3d2d('0x32')]);_0x21d7af[_0x3d2d('0x35')]=_['intersection'](_0x198ae3[_0x3d2d('0x30')],qs['fields'](_0x30fe60[_0x3d2d('0x32')][_0x3d2d('0x36')]));_0x21d7af[_0x3d2d('0x35')]=_0x21d7af['attributes'][_0x3d2d('0x37')]?_0x21d7af['attributes']:_0x198ae3['model'];if(_0x30fe60['query']['includeAll']){_0x21d7af[_0x3d2d('0x42')]=[{'all':!![]}];}_0x21d7af=_[_0x3d2d('0x3e')]({},_0x21d7af,_0x30fe60[_0x3d2d('0x40')]);return db[_0x3d2d('0x2c')][_0x3d2d('0x47')](_0x21d7af)[_0x3d2d('0x26')](handleEntityNotFound(_0x39bf99,null))[_0x3d2d('0x26')](respondWithResult(_0x39bf99,null))[_0x3d2d('0x45')](handleError(_0x39bf99,null));};exports['create']=function(_0x9e14c2,_0x40e65e){return db[_0x3d2d('0x2c')][_0x3d2d('0x48')](_0x9e14c2[_0x3d2d('0x49')],{})[_0x3d2d('0x26')](function(_0x7fc499){var _0x21e272=_0x9e14c2['user'][_0x3d2d('0x27')]({'plain':!![]});if(!_0x21e272)throw new Error(_0x3d2d('0x4a'));if(_0x21e272[_0x3d2d('0x4b')]===_0x3d2d('0x4c')){var _0xc0dd8e=_0x7fc499[_0x3d2d('0x27')]({'plain':!![]});var _0x54b7a5='Triggers';return db[_0x3d2d('0x4d')][_0x3d2d('0x47')]({'where':{'name':_0x54b7a5,'userProfileId':_0x21e272[_0x3d2d('0x4e')]},'raw':!![]})[_0x3d2d('0x26')](function(_0x3739e7){if(_0x3739e7&&_0x3739e7[_0x3d2d('0x4f')]===0x0){return db[_0x3d2d('0x29')][_0x3d2d('0x48')]({'name':_0xc0dd8e['name'],'resourceId':_0xc0dd8e['id'],'type':_0x3739e7['name'],'sectionId':_0x3739e7['id']},{})[_0x3d2d('0x26')](function(){return _0x7fc499;});}else{return _0x7fc499;}})['catch'](function(_0x5e75b5){logger[_0x3d2d('0x50')](_0x3d2d('0x51'),_0x5e75b5);throw _0x5e75b5;});}return _0x7fc499;})[_0x3d2d('0x26')](respondWithResult(_0x40e65e,0xc9))['catch'](handleError(_0x40e65e,null));};exports['update']=function(_0x3276d1,_0x3fad31){if(_0x3276d1[_0x3d2d('0x49')]['id']){delete _0x3276d1['body']['id'];}return db[_0x3d2d('0x2c')][_0x3d2d('0x47')]({'where':{'id':_0x3276d1[_0x3d2d('0x52')]['id']}})[_0x3d2d('0x26')](handleEntityNotFound(_0x3fad31,null))[_0x3d2d('0x26')](saveUpdates(_0x3276d1[_0x3d2d('0x49')],null))[_0x3d2d('0x26')](respondWithResult(_0x3fad31,null))['catch'](handleError(_0x3fad31,null));};exports[_0x3d2d('0x25')]=function(_0x515f1c,_0x2c3423){return db[_0x3d2d('0x2c')][_0x3d2d('0x47')]({'where':{'id':_0x515f1c[_0x3d2d('0x52')]['id']}})['then'](handleEntityNotFound(_0x2c3423,null))[_0x3d2d('0x26')](removeEntity(_0x2c3423,null))['catch'](handleError(_0x2c3423,null));};exports[_0x3d2d('0x53')]=function(_0x4d82d1,_0xc59b92,_0x241e2d){if(_0x4d82d1['body']['id']){delete _0x4d82d1[_0x3d2d('0x49')]['id'];}return db[_0x3d2d('0x2c')]['find']({'where':{'id':_0x4d82d1['params']['id']}})[_0x3d2d('0x26')](handleEntityNotFound(_0xc59b92,null))[_0x3d2d('0x26')](function(_0x6d85dc){if(_0x6d85dc){_0x4d82d1[_0x3d2d('0x49')][_0x3d2d('0x54')]=_0x6d85dc['id'];return db[_0x3d2d('0x55')]['create'](_0x4d82d1[_0x3d2d('0x49')]);}})[_0x3d2d('0x26')](respondWithResult(_0xc59b92,null))[_0x3d2d('0x45')](handleError(_0xc59b92,null));};exports[_0x3d2d('0x56')]=function(_0x5da29b,_0x40ac2a,_0x2ae434){if(_0x5da29b[_0x3d2d('0x49')]['id']){delete _0x5da29b['body']['id'];}return db[_0x3d2d('0x2c')][_0x3d2d('0x47')]({'where':{'id':_0x5da29b[_0x3d2d('0x52')]['id']}})[_0x3d2d('0x26')](handleEntityNotFound(_0x40ac2a,null))['then'](function(_0x5f5424){if(_0x5f5424){_0x5da29b[_0x3d2d('0x49')][_0x3d2d('0x57')]=_0x5f5424['id'];return db[_0x3d2d('0x55')]['create'](_0x5da29b[_0x3d2d('0x49')]);}})[_0x3d2d('0x26')](respondWithResult(_0x40ac2a,null))[_0x3d2d('0x45')](handleError(_0x40ac2a,null));};exports['getAllConditions']=function(_0x5ae093,_0x40769d,_0x30585b){var _0x551306={};var _0x35cf3a={};var _0x5d1802;var _0x59c337;return db[_0x3d2d('0x2c')][_0x3d2d('0x58')]({'where':{'id':_0x5ae093[_0x3d2d('0x52')]['id']}})['then'](handleEntityNotFound(_0x40769d,null))[_0x3d2d('0x26')](function(_0x552c7a){if(_0x552c7a){_0x5d1802=_0x552c7a;_0x35cf3a[_0x3d2d('0x30')]=_[_0x3d2d('0x46')](db[_0x3d2d('0x55')][_0x3d2d('0x2d')]);_0x35cf3a[_0x3d2d('0x32')]=_[_0x3d2d('0x46')](_0x5ae093[_0x3d2d('0x32')]);_0x35cf3a[_0x3d2d('0x33')]=_[_0x3d2d('0x34')](_0x35cf3a[_0x3d2d('0x30')],_0x35cf3a[_0x3d2d('0x32')]);_0x551306[_0x3d2d('0x35')]=_['intersection'](_0x35cf3a[_0x3d2d('0x30')],qs[_0x3d2d('0x36')](_0x5ae093['query']['fields']));_0x551306[_0x3d2d('0x35')]=_0x551306[_0x3d2d('0x35')]['length']?_0x551306['attributes']:_0x35cf3a[_0x3d2d('0x30')];_0x551306['order']=qs[_0x3d2d('0x3a')](_0x5ae093[_0x3d2d('0x32')][_0x3d2d('0x3a')]);_0x551306['where']=qs['filters'](_['pick'](_0x5ae093[_0x3d2d('0x32')],_0x35cf3a['filters']));if(_0x5ae093['query'][_0x3d2d('0x3d')]){_0x551306[_0x3d2d('0x3b')]=_['merge'](_0x551306['where'],{'$or':_[_0x3d2d('0x31')](_0x551306['attributes'],function(_0x438b55){var _0x48e654={};_0x48e654[_0x438b55]={'$like':'%'+_0x5ae093[_0x3d2d('0x32')][_0x3d2d('0x3d')]+'%'};return _0x48e654;})});}_0x551306=_[_0x3d2d('0x3e')]({},_0x551306,_0x5ae093[_0x3d2d('0x40')]);return _0x5d1802[_0x3d2d('0x59')](_0x551306);}})['then'](function(_0x4edad4){if(_0x4edad4){_0x59c337=_0x4edad4['length'];if(!_0x5ae093[_0x3d2d('0x32')][_0x3d2d('0x5a')](_0x3d2d('0x38'))){_0x551306[_0x3d2d('0x1f')]=qs[_0x3d2d('0x1f')](_0x5ae093[_0x3d2d('0x32')]['limit']);_0x551306[_0x3d2d('0x1d')]=qs[_0x3d2d('0x1d')](_0x5ae093[_0x3d2d('0x32')][_0x3d2d('0x1d')]);}return _0x5d1802['getAllConditions'](_0x551306);}})[_0x3d2d('0x26')](function(_0x3d995c){if(_0x3d995c){return _0x3d995c?{'count':_0x59c337,'rows':_0x3d995c}:null;}})['then'](respondWithResult(_0x40769d,null))[_0x3d2d('0x45')](handleError(_0x40769d,null));};exports[_0x3d2d('0x5b')]=function(_0x39debb,_0x397efa,_0x160a33){var _0x314916={};var _0x2991f8={};var _0x382987;var _0x5ee49c;return db['Trigger'][_0x3d2d('0x58')]({'where':{'id':_0x39debb['params']['id']}})[_0x3d2d('0x26')](handleEntityNotFound(_0x397efa,null))['then'](function(_0x2af008){if(_0x2af008){_0x382987=_0x2af008;_0x2991f8[_0x3d2d('0x30')]=_[_0x3d2d('0x46')](db['Condition'][_0x3d2d('0x2d')]);_0x2991f8['query']=_[_0x3d2d('0x46')](_0x39debb[_0x3d2d('0x32')]);_0x2991f8[_0x3d2d('0x33')]=_['intersection'](_0x2991f8[_0x3d2d('0x30')],_0x2991f8[_0x3d2d('0x32')]);_0x314916[_0x3d2d('0x35')]=_[_0x3d2d('0x34')](_0x2991f8[_0x3d2d('0x30')],qs[_0x3d2d('0x36')](_0x39debb[_0x3d2d('0x32')][_0x3d2d('0x36')]));_0x314916[_0x3d2d('0x35')]=_0x314916[_0x3d2d('0x35')][_0x3d2d('0x37')]?_0x314916['attributes']:_0x2991f8[_0x3d2d('0x30')];_0x314916[_0x3d2d('0x39')]=qs[_0x3d2d('0x3a')](_0x39debb[_0x3d2d('0x32')][_0x3d2d('0x3a')]);_0x314916[_0x3d2d('0x3b')]=qs[_0x3d2d('0x33')](_[_0x3d2d('0x3c')](_0x39debb[_0x3d2d('0x32')],_0x2991f8[_0x3d2d('0x33')]));if(_0x39debb[_0x3d2d('0x32')]['filter']){_0x314916[_0x3d2d('0x3b')]=_['merge'](_0x314916[_0x3d2d('0x3b')],{'$or':_['map'](_0x314916[_0x3d2d('0x35')],function(_0x1a6702){var _0x3bc9fa={};_0x3bc9fa[_0x1a6702]={'$like':'%'+_0x39debb[_0x3d2d('0x32')][_0x3d2d('0x3d')]+'%'};return _0x3bc9fa;})});}_0x314916=_[_0x3d2d('0x3e')]({},_0x314916,_0x39debb[_0x3d2d('0x40')]);return _0x382987[_0x3d2d('0x5b')](_0x314916);}})['then'](function(_0x2220a5){if(_0x2220a5){_0x5ee49c=_0x2220a5[_0x3d2d('0x37')];if(!_0x39debb[_0x3d2d('0x32')]['hasOwnProperty']('nolimit')){_0x314916[_0x3d2d('0x1f')]=qs[_0x3d2d('0x1f')](_0x39debb['query'][_0x3d2d('0x1f')]);_0x314916[_0x3d2d('0x1d')]=qs[_0x3d2d('0x1d')](_0x39debb[_0x3d2d('0x32')][_0x3d2d('0x1d')]);}return _0x382987[_0x3d2d('0x5b')](_0x314916);}})['then'](function(_0x325ef1){if(_0x325ef1){return _0x325ef1?{'count':_0x5ee49c,'rows':_0x325ef1}:null;}})['then'](respondWithResult(_0x397efa,null))[_0x3d2d('0x45')](handleError(_0x397efa,null));};exports[_0x3d2d('0x5c')]=function(_0x4fb268,_0x1fc2ae,_0x10d959){if(_0x4fb268[_0x3d2d('0x49')]['id']){delete _0x4fb268[_0x3d2d('0x49')]['id'];}return db[_0x3d2d('0x2c')][_0x3d2d('0x47')]({'where':{'id':_0x4fb268[_0x3d2d('0x52')]['id']}})[_0x3d2d('0x26')](handleEntityNotFound(_0x1fc2ae,null))[_0x3d2d('0x26')](function(_0xe92374){if(_0xe92374){_0x4fb268[_0x3d2d('0x49')]['TriggerId']=_0xe92374['id'];return db['Action'][_0x3d2d('0x48')](_0x4fb268[_0x3d2d('0x49')]);}})['then'](respondWithResult(_0x1fc2ae,null))[_0x3d2d('0x45')](handleError(_0x1fc2ae,null));};exports['getActions']=function(_0x2cd018,_0x40fba3,_0xa978ab){var _0x5b858f={};var _0x46864b={};var _0x19cb9d;var _0x3b0688;return db[_0x3d2d('0x2c')][_0x3d2d('0x58')]({'where':{'id':_0x2cd018[_0x3d2d('0x52')]['id']}})['then'](handleEntityNotFound(_0x40fba3,null))[_0x3d2d('0x26')](function(_0x37676c){if(_0x37676c){_0x19cb9d=_0x37676c;_0x46864b[_0x3d2d('0x30')]=_['keys'](db[_0x3d2d('0x5d')]['rawAttributes']);_0x46864b['query']=_[_0x3d2d('0x46')](_0x2cd018[_0x3d2d('0x32')]);_0x46864b[_0x3d2d('0x33')]=_[_0x3d2d('0x34')](_0x46864b['model'],_0x46864b['query']);_0x5b858f[_0x3d2d('0x35')]=_[_0x3d2d('0x34')](_0x46864b[_0x3d2d('0x30')],qs[_0x3d2d('0x36')](_0x2cd018[_0x3d2d('0x32')][_0x3d2d('0x36')]));_0x5b858f['attributes']=_0x5b858f[_0x3d2d('0x35')]['length']?_0x5b858f[_0x3d2d('0x35')]:_0x46864b[_0x3d2d('0x30')];_0x5b858f[_0x3d2d('0x39')]=qs['sort'](_0x2cd018['query'][_0x3d2d('0x3a')]);_0x5b858f[_0x3d2d('0x3b')]=qs[_0x3d2d('0x33')](_[_0x3d2d('0x3c')](_0x2cd018[_0x3d2d('0x32')],_0x46864b[_0x3d2d('0x33')]));if(_0x2cd018[_0x3d2d('0x32')][_0x3d2d('0x3d')]){_0x5b858f['where']=_['merge'](_0x5b858f[_0x3d2d('0x3b')],{'$or':_[_0x3d2d('0x31')](_0x5b858f[_0x3d2d('0x35')],function(_0x35b70b){var _0x476693={};_0x476693[_0x35b70b]={'$like':'%'+_0x2cd018[_0x3d2d('0x32')][_0x3d2d('0x3d')]+'%'};return _0x476693;})});}_0x5b858f=_['merge']({},_0x5b858f,_0x2cd018[_0x3d2d('0x40')]);return _0x19cb9d['getActions'](_0x5b858f);}})[_0x3d2d('0x26')](function(_0x5d4f52){if(_0x5d4f52){_0x3b0688=_0x5d4f52[_0x3d2d('0x37')];if(!_0x2cd018[_0x3d2d('0x32')][_0x3d2d('0x5a')](_0x3d2d('0x38'))){_0x5b858f['limit']=qs[_0x3d2d('0x1f')](_0x2cd018[_0x3d2d('0x32')][_0x3d2d('0x1f')]);_0x5b858f[_0x3d2d('0x1d')]=qs['offset'](_0x2cd018['query'][_0x3d2d('0x1d')]);}return _0x19cb9d[_0x3d2d('0x5e')](_0x5b858f);}})['then'](function(_0x447d52){if(_0x447d52){return _0x447d52?{'count':_0x3b0688,'rows':_0x447d52}:null;}})['then'](respondWithResult(_0x40fba3,null))['catch'](handleError(_0x40fba3,null));}; \ No newline at end of file +var _0x7288=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','rows','show','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0x7288,0x105));var _0x8728=function(_0x4d822b,_0x39bbf8){_0x4d822b=_0x4d822b-0x0;var _0x5aab20=_0x7288[_0x4d822b];return _0x5aab20;};'use strict';var emlformat=require(_0x8728('0x0'));var rimraf=require(_0x8728('0x1'));var zipdir=require(_0x8728('0x2'));var jsonpatch=require(_0x8728('0x3'));var rp=require(_0x8728('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8728('0x5'));var util=require('util');var path=require(_0x8728('0x6'));var sox=require(_0x8728('0x7'));var csv=require('to-csv');var ejs=require(_0x8728('0x8'));var fs=require('fs');var fs_extra=require(_0x8728('0x9'));var _=require(_0x8728('0xa'));var squel=require(_0x8728('0xb'));var crypto=require(_0x8728('0xc'));var jsforce=require(_0x8728('0xd'));var deskjs=require(_0x8728('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8728('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8728('0x10'));var hardwareService=require(_0x8728('0x11'));var logger=require(_0x8728('0x12'))(_0x8728('0x13'));var utils=require(_0x8728('0x14'));var config=require(_0x8728('0x15'));var licenseUtil=require(_0x8728('0x16'));var db=require(_0x8728('0x17'))['db'];function respondWithStatusCode(_0x52b24d,_0x106a18){_0x106a18=_0x106a18||0xcc;return function(_0x4f4c8d){if(_0x4f4c8d){return _0x52b24d[_0x8728('0x18')](_0x106a18);}return _0x52b24d[_0x8728('0x19')](_0x106a18)[_0x8728('0x1a')]();};}function respondWithResult(_0x893e17,_0x24cd6e){_0x24cd6e=_0x24cd6e||0xc8;return function(_0x4d98ee){if(_0x4d98ee){return _0x893e17[_0x8728('0x19')](_0x24cd6e)[_0x8728('0x1b')](_0x4d98ee);}};}function respondWithFilteredResult(_0x591b77,_0x1717a1){return function(_0x28bfc1){if(_0x28bfc1){var _0x52caf3=typeof _0x1717a1['offset']===_0x8728('0x1c')&&typeof _0x1717a1[_0x8728('0x1d')]==='undefined';var _0x313f4e=_0x28bfc1[_0x8728('0x1e')];var _0x2f3793=_0x52caf3?0x0:_0x1717a1[_0x8728('0x1f')];var _0x53eb25=_0x52caf3?_0x28bfc1[_0x8728('0x1e')]:_0x1717a1[_0x8728('0x1f')]+_0x1717a1[_0x8728('0x1d')];var _0x3cbe15;if(_0x53eb25>=_0x313f4e){_0x53eb25=_0x313f4e;_0x3cbe15=0xc8;}else{_0x3cbe15=0xce;}_0x591b77[_0x8728('0x19')](_0x3cbe15);return _0x591b77[_0x8728('0x20')](_0x8728('0x21'),_0x2f3793+'-'+_0x53eb25+'/'+_0x313f4e)[_0x8728('0x1b')](_0x28bfc1);}return null;};}function patchUpdates(_0x1eaf73){return function(_0x475af8){try{jsonpatch[_0x8728('0x22')](_0x475af8,_0x1eaf73,!![]);}catch(_0x4aa0f8){return BPromise[_0x8728('0x23')](_0x4aa0f8);}return _0x475af8[_0x8728('0x24')]();};}function saveUpdates(_0x597260,_0x30e94d){return function(_0x1ed039){if(_0x1ed039){return _0x1ed039[_0x8728('0x25')](_0x597260)['then'](function(_0x25bb06){return _0x25bb06;});}return null;};}function removeEntity(_0x21364a,_0x1c27f3){return function(_0xa22c1e){if(_0xa22c1e){return _0xa22c1e[_0x8728('0x26')]()['then'](function(){var _0x239d13=_0xa22c1e[_0x8728('0x27')]({'plain':!![]});var _0x1b0b61='Triggers';return db[_0x8728('0x28')][_0x8728('0x26')]({'where':{'type':_0x1b0b61,'resourceId':_0x239d13['id']}})['then'](function(){return _0xa22c1e;});})['then'](function(){_0x21364a['status'](0xcc)[_0x8728('0x1a')]();});}};}function handleEntityNotFound(_0x437db7,_0x3133e8){return function(_0xc855a9){if(!_0xc855a9){_0x437db7[_0x8728('0x18')](0x194);}return _0xc855a9;};}function handleError(_0x1924ca,_0x186574){_0x186574=_0x186574||0x1f4;return function(_0x4f0bb8){logger[_0x8728('0x29')](_0x4f0bb8[_0x8728('0x2a')]);if(_0x4f0bb8['name']){delete _0x4f0bb8[_0x8728('0x2b')];}_0x1924ca[_0x8728('0x19')](_0x186574)[_0x8728('0x2c')](_0x4f0bb8);};}exports[_0x8728('0x2d')]=function(_0x542b96,_0x1d4520){var _0x385d4e={},_0x5cb3f7={},_0xa8bd91={'count':0x0,'rows':[]};var _0x4523d5=_[_0x8728('0x2e')](db[_0x8728('0x2f')][_0x8728('0x30')],function(_0x8a6213){return{'name':_0x8a6213[_0x8728('0x31')],'type':_0x8a6213[_0x8728('0x32')][_0x8728('0x33')]};});_0x5cb3f7[_0x8728('0x34')]=_['map'](_0x4523d5,_0x8728('0x2b'));_0x5cb3f7[_0x8728('0x35')]=_[_0x8728('0x36')](_0x542b96[_0x8728('0x35')]);_0x5cb3f7[_0x8728('0x37')]=_[_0x8728('0x38')](_0x5cb3f7[_0x8728('0x34')],_0x5cb3f7[_0x8728('0x35')]);_0x385d4e['attributes']=_[_0x8728('0x38')](_0x5cb3f7[_0x8728('0x34')],qs['fields'](_0x542b96[_0x8728('0x35')][_0x8728('0x39')]));_0x385d4e[_0x8728('0x3a')]=_0x385d4e[_0x8728('0x3a')][_0x8728('0x3b')]?_0x385d4e['attributes']:_0x5cb3f7[_0x8728('0x34')];if(!_0x542b96[_0x8728('0x35')][_0x8728('0x3c')](_0x8728('0x3d'))){_0x385d4e[_0x8728('0x1d')]=qs['limit'](_0x542b96['query'][_0x8728('0x1d')]);_0x385d4e['offset']=qs[_0x8728('0x1f')](_0x542b96[_0x8728('0x35')][_0x8728('0x1f')]);}_0x385d4e[_0x8728('0x3e')]=qs[_0x8728('0x3f')](_0x542b96[_0x8728('0x35')][_0x8728('0x3f')]);_0x385d4e[_0x8728('0x40')]=qs[_0x8728('0x37')](_[_0x8728('0x41')](_0x542b96[_0x8728('0x35')],_0x5cb3f7['filters']),_0x4523d5);if(_0x542b96[_0x8728('0x35')][_0x8728('0x42')]){_0x385d4e[_0x8728('0x40')]=_[_0x8728('0x43')](_0x385d4e[_0x8728('0x40')],{'$or':_['map'](_0x4523d5,function(_0x2334d4){if(_0x2334d4[_0x8728('0x32')]!==_0x8728('0x44')){var _0x2ae2eb={};_0x2ae2eb[_0x2334d4[_0x8728('0x2b')]]={'$like':'%'+_0x542b96[_0x8728('0x35')]['filter']+'%'};return _0x2ae2eb;}})});}_0x385d4e=_[_0x8728('0x43')]({},_0x385d4e,_0x542b96['options']);var _0x2e7ba0={'where':_0x385d4e[_0x8728('0x40')]};return db[_0x8728('0x2f')][_0x8728('0x1e')](_0x2e7ba0)[_0x8728('0x45')](function(_0xc9ec0e){_0xa8bd91['count']=_0xc9ec0e;if(_0x542b96[_0x8728('0x35')][_0x8728('0x46')]){_0x385d4e['include']=[{'all':!![]}];}return db[_0x8728('0x2f')]['findAll'](_0x385d4e);})[_0x8728('0x45')](function(_0x589169){_0xa8bd91[_0x8728('0x47')]=_0x589169;return _0xa8bd91;})[_0x8728('0x45')](respondWithFilteredResult(_0x1d4520,_0x385d4e))['catch'](handleError(_0x1d4520,null));};exports[_0x8728('0x48')]=function(_0x2d829c,_0x1a2a3b){var _0x2de5b2={'raw':![],'where':{'id':_0x2d829c['params']['id']}},_0x236196={};_0x236196[_0x8728('0x34')]=_['keys'](db[_0x8728('0x2f')][_0x8728('0x30')]);_0x236196[_0x8728('0x35')]=_[_0x8728('0x36')](_0x2d829c['query']);_0x236196[_0x8728('0x37')]=_[_0x8728('0x38')](_0x236196[_0x8728('0x34')],_0x236196[_0x8728('0x35')]);_0x2de5b2[_0x8728('0x3a')]=_[_0x8728('0x38')](_0x236196[_0x8728('0x34')],qs[_0x8728('0x39')](_0x2d829c['query'][_0x8728('0x39')]));_0x2de5b2[_0x8728('0x3a')]=_0x2de5b2[_0x8728('0x3a')][_0x8728('0x3b')]?_0x2de5b2[_0x8728('0x3a')]:_0x236196['model'];if(_0x2d829c[_0x8728('0x35')]['includeAll']){_0x2de5b2[_0x8728('0x49')]=[{'all':!![]}];}_0x2de5b2=_['merge']({},_0x2de5b2,_0x2d829c[_0x8728('0x4a')]);return db[_0x8728('0x2f')][_0x8728('0x4b')](_0x2de5b2)[_0x8728('0x45')](handleEntityNotFound(_0x1a2a3b,null))['then'](respondWithResult(_0x1a2a3b,null))['catch'](handleError(_0x1a2a3b,null));};exports[_0x8728('0x4c')]=function(_0x4c8e7e,_0x186135){return db[_0x8728('0x2f')]['create'](_0x4c8e7e[_0x8728('0x4d')],{})[_0x8728('0x45')](function(_0x1a8dce){var _0x5c80d3=_0x4c8e7e[_0x8728('0x4e')][_0x8728('0x27')]({'plain':!![]});if(!_0x5c80d3)throw new Error(_0x8728('0x4f'));if(_0x5c80d3[_0x8728('0x50')]===_0x8728('0x4e')){var _0x4ab0f1=_0x1a8dce[_0x8728('0x27')]({'plain':!![]});var _0x112fd3='Triggers';return db[_0x8728('0x51')]['find']({'where':{'name':_0x112fd3,'userProfileId':_0x5c80d3[_0x8728('0x52')]},'raw':!![]})[_0x8728('0x45')](function(_0x9e384a){if(_0x9e384a&&_0x9e384a[_0x8728('0x53')]===0x0){return db[_0x8728('0x28')][_0x8728('0x4c')]({'name':_0x4ab0f1[_0x8728('0x2b')],'resourceId':_0x4ab0f1['id'],'type':_0x9e384a[_0x8728('0x2b')],'sectionId':_0x9e384a['id']},{})[_0x8728('0x45')](function(){return _0x1a8dce;});}else{return _0x1a8dce;}})[_0x8728('0x54')](function(_0x2c641e){logger[_0x8728('0x29')](_0x8728('0x55'),_0x2c641e);throw _0x2c641e;});}return _0x1a8dce;})['then'](respondWithResult(_0x186135,0xc9))[_0x8728('0x54')](handleError(_0x186135,null));};exports[_0x8728('0x25')]=function(_0x5911d6,_0x1ca1b7){if(_0x5911d6[_0x8728('0x4d')]['id']){delete _0x5911d6[_0x8728('0x4d')]['id'];}return db[_0x8728('0x2f')][_0x8728('0x4b')]({'where':{'id':_0x5911d6[_0x8728('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ca1b7,null))[_0x8728('0x45')](saveUpdates(_0x5911d6['body'],null))['then'](respondWithResult(_0x1ca1b7,null))[_0x8728('0x54')](handleError(_0x1ca1b7,null));};exports[_0x8728('0x26')]=function(_0x478f09,_0x2afc54){return db[_0x8728('0x2f')]['find']({'where':{'id':_0x478f09['params']['id']}})[_0x8728('0x45')](handleEntityNotFound(_0x2afc54,null))[_0x8728('0x45')](removeEntity(_0x2afc54,null))[_0x8728('0x54')](handleError(_0x2afc54,null));};exports[_0x8728('0x57')]=function(_0x1a4656,_0x47bbd7,_0x4b477f){if(_0x1a4656[_0x8728('0x4d')]['id']){delete _0x1a4656[_0x8728('0x4d')]['id'];}return db[_0x8728('0x2f')][_0x8728('0x4b')]({'where':{'id':_0x1a4656[_0x8728('0x56')]['id']}})[_0x8728('0x45')](handleEntityNotFound(_0x47bbd7,null))[_0x8728('0x45')](function(_0xf24876){if(_0xf24876){_0x1a4656[_0x8728('0x4d')]['TriggerAllId']=_0xf24876['id'];return db[_0x8728('0x58')]['create'](_0x1a4656[_0x8728('0x4d')]);}})['then'](respondWithResult(_0x47bbd7,null))[_0x8728('0x54')](handleError(_0x47bbd7,null));};exports[_0x8728('0x59')]=function(_0x1d0736,_0x188c68,_0x5e25e7){if(_0x1d0736[_0x8728('0x4d')]['id']){delete _0x1d0736['body']['id'];}return db[_0x8728('0x2f')][_0x8728('0x4b')]({'where':{'id':_0x1d0736['params']['id']}})[_0x8728('0x45')](handleEntityNotFound(_0x188c68,null))['then'](function(_0xa29696){if(_0xa29696){_0x1d0736[_0x8728('0x4d')][_0x8728('0x5a')]=_0xa29696['id'];return db['Condition']['create'](_0x1d0736['body']);}})[_0x8728('0x45')](respondWithResult(_0x188c68,null))[_0x8728('0x54')](handleError(_0x188c68,null));};exports[_0x8728('0x5b')]=function(_0x345ade,_0x25bb37,_0x6ddb28){var _0x4a4621={};var _0x55a325={};var _0x3af0ea;var _0x30400a;return db[_0x8728('0x2f')]['findOne']({'where':{'id':_0x345ade[_0x8728('0x56')]['id']}})[_0x8728('0x45')](handleEntityNotFound(_0x25bb37,null))[_0x8728('0x45')](function(_0x546cfb){if(_0x546cfb){_0x3af0ea=_0x546cfb;_0x55a325['model']=_[_0x8728('0x36')](db['Condition'][_0x8728('0x30')]);_0x55a325[_0x8728('0x35')]=_[_0x8728('0x36')](_0x345ade[_0x8728('0x35')]);_0x55a325[_0x8728('0x37')]=_['intersection'](_0x55a325[_0x8728('0x34')],_0x55a325[_0x8728('0x35')]);_0x4a4621['attributes']=_[_0x8728('0x38')](_0x55a325['model'],qs[_0x8728('0x39')](_0x345ade[_0x8728('0x35')][_0x8728('0x39')]));_0x4a4621[_0x8728('0x3a')]=_0x4a4621['attributes'][_0x8728('0x3b')]?_0x4a4621[_0x8728('0x3a')]:_0x55a325[_0x8728('0x34')];_0x4a4621[_0x8728('0x3e')]=qs[_0x8728('0x3f')](_0x345ade['query'][_0x8728('0x3f')]);_0x4a4621[_0x8728('0x40')]=qs['filters'](_[_0x8728('0x41')](_0x345ade[_0x8728('0x35')],_0x55a325[_0x8728('0x37')]));if(_0x345ade[_0x8728('0x35')][_0x8728('0x42')]){_0x4a4621[_0x8728('0x40')]=_[_0x8728('0x43')](_0x4a4621[_0x8728('0x40')],{'$or':_[_0x8728('0x2e')](_0x4a4621[_0x8728('0x3a')],function(_0x58b9a7){var _0x27cc9b={};_0x27cc9b[_0x58b9a7]={'$like':'%'+_0x345ade[_0x8728('0x35')][_0x8728('0x42')]+'%'};return _0x27cc9b;})});}_0x4a4621=_[_0x8728('0x43')]({},_0x4a4621,_0x345ade[_0x8728('0x4a')]);return _0x3af0ea['getAllConditions'](_0x4a4621);}})[_0x8728('0x45')](function(_0x3cc8e0){if(_0x3cc8e0){_0x30400a=_0x3cc8e0['length'];if(!_0x345ade[_0x8728('0x35')][_0x8728('0x3c')](_0x8728('0x3d'))){_0x4a4621['limit']=qs['limit'](_0x345ade[_0x8728('0x35')]['limit']);_0x4a4621[_0x8728('0x1f')]=qs[_0x8728('0x1f')](_0x345ade[_0x8728('0x35')][_0x8728('0x1f')]);}return _0x3af0ea[_0x8728('0x5b')](_0x4a4621);}})[_0x8728('0x45')](function(_0x5094e9){if(_0x5094e9){return _0x5094e9?{'count':_0x30400a,'rows':_0x5094e9}:null;}})[_0x8728('0x45')](respondWithResult(_0x25bb37,null))['catch'](handleError(_0x25bb37,null));};exports['getAnyConditions']=function(_0xebbb4e,_0x2aaae9,_0x49902c){var _0x413794={};var _0x56e1b4={};var _0x257304;var _0x136c82;return db[_0x8728('0x2f')][_0x8728('0x5c')]({'where':{'id':_0xebbb4e[_0x8728('0x56')]['id']}})[_0x8728('0x45')](handleEntityNotFound(_0x2aaae9,null))['then'](function(_0x38a11e){if(_0x38a11e){_0x257304=_0x38a11e;_0x56e1b4[_0x8728('0x34')]=_[_0x8728('0x36')](db[_0x8728('0x58')][_0x8728('0x30')]);_0x56e1b4[_0x8728('0x35')]=_[_0x8728('0x36')](_0xebbb4e[_0x8728('0x35')]);_0x56e1b4[_0x8728('0x37')]=_['intersection'](_0x56e1b4['model'],_0x56e1b4[_0x8728('0x35')]);_0x413794['attributes']=_[_0x8728('0x38')](_0x56e1b4[_0x8728('0x34')],qs['fields'](_0xebbb4e[_0x8728('0x35')][_0x8728('0x39')]));_0x413794[_0x8728('0x3a')]=_0x413794[_0x8728('0x3a')][_0x8728('0x3b')]?_0x413794[_0x8728('0x3a')]:_0x56e1b4[_0x8728('0x34')];_0x413794[_0x8728('0x3e')]=qs[_0x8728('0x3f')](_0xebbb4e[_0x8728('0x35')][_0x8728('0x3f')]);_0x413794['where']=qs[_0x8728('0x37')](_[_0x8728('0x41')](_0xebbb4e['query'],_0x56e1b4[_0x8728('0x37')]));if(_0xebbb4e[_0x8728('0x35')][_0x8728('0x42')]){_0x413794[_0x8728('0x40')]=_[_0x8728('0x43')](_0x413794['where'],{'$or':_['map'](_0x413794[_0x8728('0x3a')],function(_0x4c50d4){var _0x4a8b1f={};_0x4a8b1f[_0x4c50d4]={'$like':'%'+_0xebbb4e[_0x8728('0x35')][_0x8728('0x42')]+'%'};return _0x4a8b1f;})});}_0x413794=_['merge']({},_0x413794,_0xebbb4e[_0x8728('0x4a')]);return _0x257304['getAnyConditions'](_0x413794);}})[_0x8728('0x45')](function(_0x3bd947){if(_0x3bd947){_0x136c82=_0x3bd947[_0x8728('0x3b')];if(!_0xebbb4e[_0x8728('0x35')][_0x8728('0x3c')]('nolimit')){_0x413794[_0x8728('0x1d')]=qs[_0x8728('0x1d')](_0xebbb4e[_0x8728('0x35')][_0x8728('0x1d')]);_0x413794[_0x8728('0x1f')]=qs[_0x8728('0x1f')](_0xebbb4e[_0x8728('0x35')][_0x8728('0x1f')]);}return _0x257304['getAnyConditions'](_0x413794);}})['then'](function(_0x4685a1){if(_0x4685a1){return _0x4685a1?{'count':_0x136c82,'rows':_0x4685a1}:null;}})[_0x8728('0x45')](respondWithResult(_0x2aaae9,null))['catch'](handleError(_0x2aaae9,null));};exports['addAction']=function(_0x2e3ccb,_0x23aaa7,_0x142e7e){if(_0x2e3ccb['body']['id']){delete _0x2e3ccb[_0x8728('0x4d')]['id'];}return db[_0x8728('0x2f')][_0x8728('0x4b')]({'where':{'id':_0x2e3ccb['params']['id']}})[_0x8728('0x45')](handleEntityNotFound(_0x23aaa7,null))['then'](function(_0x3a95b9){if(_0x3a95b9){_0x2e3ccb[_0x8728('0x4d')][_0x8728('0x5d')]=_0x3a95b9['id'];return db[_0x8728('0x5e')][_0x8728('0x4c')](_0x2e3ccb['body']);}})[_0x8728('0x45')](respondWithResult(_0x23aaa7,null))[_0x8728('0x54')](handleError(_0x23aaa7,null));};exports[_0x8728('0x5f')]=function(_0x2e7e06,_0x32bea3,_0x1d9553){var _0x57860d={};var _0x114bdc={};var _0x2a70e6;var _0x4f178e;return db[_0x8728('0x2f')]['findOne']({'where':{'id':_0x2e7e06[_0x8728('0x56')]['id']}})['then'](handleEntityNotFound(_0x32bea3,null))[_0x8728('0x45')](function(_0x3aa132){if(_0x3aa132){_0x2a70e6=_0x3aa132;_0x114bdc['model']=_['keys'](db[_0x8728('0x5e')][_0x8728('0x30')]);_0x114bdc[_0x8728('0x35')]=_['keys'](_0x2e7e06['query']);_0x114bdc[_0x8728('0x37')]=_[_0x8728('0x38')](_0x114bdc['model'],_0x114bdc[_0x8728('0x35')]);_0x57860d[_0x8728('0x3a')]=_[_0x8728('0x38')](_0x114bdc['model'],qs['fields'](_0x2e7e06['query']['fields']));_0x57860d[_0x8728('0x3a')]=_0x57860d['attributes']['length']?_0x57860d[_0x8728('0x3a')]:_0x114bdc[_0x8728('0x34')];_0x57860d[_0x8728('0x3e')]=qs[_0x8728('0x3f')](_0x2e7e06[_0x8728('0x35')][_0x8728('0x3f')]);_0x57860d[_0x8728('0x40')]=qs[_0x8728('0x37')](_[_0x8728('0x41')](_0x2e7e06[_0x8728('0x35')],_0x114bdc[_0x8728('0x37')]));if(_0x2e7e06[_0x8728('0x35')][_0x8728('0x42')]){_0x57860d[_0x8728('0x40')]=_[_0x8728('0x43')](_0x57860d[_0x8728('0x40')],{'$or':_[_0x8728('0x2e')](_0x57860d['attributes'],function(_0xd99562){var _0x23fcd9={};_0x23fcd9[_0xd99562]={'$like':'%'+_0x2e7e06[_0x8728('0x35')][_0x8728('0x42')]+'%'};return _0x23fcd9;})});}_0x57860d=_[_0x8728('0x43')]({},_0x57860d,_0x2e7e06[_0x8728('0x4a')]);return _0x2a70e6[_0x8728('0x5f')](_0x57860d);}})[_0x8728('0x45')](function(_0x57c2ed){if(_0x57c2ed){_0x4f178e=_0x57c2ed[_0x8728('0x3b')];if(!_0x2e7e06['query']['hasOwnProperty'](_0x8728('0x3d'))){_0x57860d[_0x8728('0x1d')]=qs[_0x8728('0x1d')](_0x2e7e06[_0x8728('0x35')]['limit']);_0x57860d[_0x8728('0x1f')]=qs[_0x8728('0x1f')](_0x2e7e06[_0x8728('0x35')][_0x8728('0x1f')]);}return _0x2a70e6[_0x8728('0x5f')](_0x57860d);}})[_0x8728('0x45')](function(_0xd4f117){if(_0xd4f117){return _0xd4f117?{'count':_0x4f178e,'rows':_0xd4f117}:null;}})[_0x8728('0x45')](respondWithResult(_0x32bea3,null))[_0x8728('0x54')](handleError(_0x32bea3,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 962aa0a..33d1f4c 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 _0x5c37=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','tools_triggers','lodash','util'];(function(_0x34856a,_0x20a944){var _0x131664=function(_0xc973fe){while(--_0xc973fe){_0x34856a['push'](_0x34856a['shift']());}};_0x131664(++_0x20a944);}(_0x5c37,0x11e));var _0x75c3=function(_0x3ab928,_0x2b990b){_0x3ab928=_0x3ab928-0x0;var _0xf47692=_0x5c37[_0x3ab928];return _0xf47692;};'use strict';var _=require(_0x75c3('0x0'));var util=require(_0x75c3('0x1'));var logger=require(_0x75c3('0x2'))(_0x75c3('0x3'));var moment=require(_0x75c3('0x4'));var BPromise=require(_0x75c3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75c3('0x6'));var rimraf=require(_0x75c3('0x7'));var config=require(_0x75c3('0x8'));var attributes=require('./trigger.attributes');module[_0x75c3('0x9')]=function(_0xbbeb0d,_0x19dc3b){return _0xbbeb0d[_0x75c3('0xa')]('Trigger',attributes,{'tableName':_0x75c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d9e=['lodash','api','bluebird','path','rimraf','./trigger.attributes','exports','define','Trigger'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5452b7,_0x487f12){_0x5452b7=_0x5452b7-0x0;var _0x8b8e33=_0x4d9e[_0x5452b7];return _0x8b8e33;};'use strict';var _=require(_0xe4d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe4d9('0x1'));var moment=require('moment');var BPromise=require(_0xe4d9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4d9('0x3'));var rimraf=require(_0xe4d9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe4d9('0x5'));module[_0xe4d9('0x6')]=function(_0x278035,_0x34c2a2){return _0x278035[_0xe4d9('0x7')](_0xe4d9('0x8'),attributes,{'tableName':'tools_triggers','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 1f53e3f..ba79fd3 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 _0x3044=['GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','ShowTrigger','find','where','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x39979b,_0x2111f9){var _0x560b41=function(_0x859cc0){while(--_0x859cc0){_0x39979b['push'](_0x39979b['shift']());}};_0x560b41(++_0x2111f9);}(_0x3044,0xa6));var _0x4304=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x3044[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x4304('0x0'));var util=require(_0x4304('0x1'));var moment=require(_0x4304('0x2'));var BPromise=require(_0x4304('0x3'));var rs=require(_0x4304('0x4'));var fs=require('fs');var Redis=require(_0x4304('0x5'));var db=require(_0x4304('0x6'))['db'];var utils=require(_0x4304('0x7'));var logger=require(_0x4304('0x8'))(_0x4304('0x9'));var config=require(_0x4304('0xa'));var jayson=require(_0x4304('0xb'));var client=jayson[_0x4304('0xc')][_0x4304('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d15c8,_0x301ac7,_0xe83a4d){return new BPromise(function(_0x552088,_0xa65222){return client[_0x4304('0xe')](_0x4d15c8,_0xe83a4d)[_0x4304('0xf')](function(_0x4fa02d){logger[_0x4304('0x10')](_0x4304('0x11'),_0x301ac7,_0x4304('0x12'));logger[_0x4304('0x13')](_0x4304('0x14'),_0x301ac7,'request\x20sent',JSON[_0x4304('0x15')](_0x4fa02d));if(_0x4fa02d[_0x4304('0x16')]){if(_0x4fa02d[_0x4304('0x16')]['code']===0x1f4){logger[_0x4304('0x16')](_0x4304('0x11'),_0x301ac7,_0x4fa02d[_0x4304('0x16')][_0x4304('0x17')]);return _0xa65222(_0x4fa02d[_0x4304('0x16')][_0x4304('0x17')]);}logger['error'](_0x4304('0x11'),_0x301ac7,_0x4fa02d['error'][_0x4304('0x17')]);return _0x552088(_0x4fa02d['error'][_0x4304('0x17')]);}else{logger[_0x4304('0x10')](_0x4304('0x11'),_0x301ac7,_0x4304('0x12'));_0x552088(_0x4fa02d['result'][_0x4304('0x17')]);}})['catch'](function(_0x1468c8){logger[_0x4304('0x16')]('Trigger,\x20%s,\x20%s',_0x301ac7,_0x1468c8);_0xa65222(_0x1468c8);});});}exports[_0x4304('0x18')]=function(_0x2f1734){var _0x320b2a=this;return new Promise(function(_0xd726d5,_0x5a01ae){return db[_0x4304('0x19')][_0x4304('0x1a')]({'raw':_0x2f1734['options']?_0x2f1734[_0x4304('0x1b')][_0x4304('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f1734['options']?_0x2f1734['options']['where']||null:null,'attributes':_0x2f1734[_0x4304('0x1b')]?_0x2f1734['options'][_0x4304('0x1d')]||null:null,'limit':_0x2f1734[_0x4304('0x1b')]?_0x2f1734[_0x4304('0x1b')][_0x4304('0x1e')]||null:null,'include':_0x2f1734['options']?_0x2f1734[_0x4304('0x1b')][_0x4304('0x1f')]?_[_0x4304('0x20')](_0x2f1734[_0x4304('0x1b')][_0x4304('0x1f')],function(_0x3281b0){return{'model':db[_0x3281b0[_0x4304('0x21')]],'as':_0x3281b0['as'],'attributes':_0x3281b0[_0x4304('0x1d')],'include':_0x3281b0[_0x4304('0x1f')]?_[_0x4304('0x20')](_0x3281b0[_0x4304('0x1f')],function(_0x170b30){return{'model':db[_0x170b30[_0x4304('0x21')]],'as':_0x170b30['as'],'attributes':_0x170b30[_0x4304('0x1d')],'include':_0x170b30['include']?_['map'](_0x170b30[_0x4304('0x1f')],function(_0x545be5){return{'model':db[_0x545be5[_0x4304('0x21')]],'as':_0x545be5['as'],'attributes':_0x545be5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4103f6){logger[_0x4304('0x10')](_0x4304('0x18'),_0x2f1734);logger['debug'](_0x4304('0x18'),_0x2f1734,JSON['stringify'](_0x4103f6));_0xd726d5(_0x4103f6);})['catch'](function(_0x1680da){logger[_0x4304('0x16')](_0x4304('0x18'),_0x1680da[_0x4304('0x17')],_0x2f1734);_0x5a01ae(_0x320b2a[_0x4304('0x16')](0x1f4,_0x1680da[_0x4304('0x17')]));});});};exports[_0x4304('0x22')]=function(_0xe410cc){var _0x1d47bc=this;return new Promise(function(_0xd27653,_0x55e129){return db['Trigger'][_0x4304('0x23')]({'raw':_0xe410cc[_0x4304('0x1b')]?_0xe410cc['options']['raw']===undefined?!![]:![]:!![],'where':_0xe410cc['options']?_0xe410cc[_0x4304('0x1b')][_0x4304('0x24')]||null:null,'attributes':_0xe410cc[_0x4304('0x1b')]?_0xe410cc[_0x4304('0x1b')]['attributes']||null:null,'include':_0xe410cc['options']?_0xe410cc['options'][_0x4304('0x1f')]?_[_0x4304('0x20')](_0xe410cc[_0x4304('0x1b')][_0x4304('0x1f')],function(_0x1be81f){return{'model':db[_0x1be81f[_0x4304('0x21')]],'as':_0x1be81f['as'],'attributes':_0x1be81f[_0x4304('0x1d')],'include':_0x1be81f[_0x4304('0x1f')]?_[_0x4304('0x20')](_0x1be81f[_0x4304('0x1f')],function(_0x55d5ba){return{'model':db[_0x55d5ba['model']],'as':_0x55d5ba['as'],'attributes':_0x55d5ba['attributes'],'include':_0x55d5ba[_0x4304('0x1f')]?_[_0x4304('0x20')](_0x55d5ba[_0x4304('0x1f')],function(_0x1859a6){return{'model':db[_0x1859a6[_0x4304('0x21')]],'as':_0x1859a6['as'],'attributes':_0x1859a6[_0x4304('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4304('0xf')](function(_0x24a990){logger['info'](_0x4304('0x22'),_0xe410cc);logger[_0x4304('0x13')]('ShowTrigger',_0xe410cc,JSON[_0x4304('0x15')](_0x24a990));_0xd27653(_0x24a990);})[_0x4304('0x25')](function(_0x488780){logger[_0x4304('0x16')](_0x4304('0x22'),_0x488780[_0x4304('0x17')],_0xe410cc);_0x55e129(_0x1d47bc['error'](0x1f4,_0x488780[_0x4304('0x17')]));});});}; \ No newline at end of file +var _0x9437=['stringify','error','message','result','catch','Trigger','findAll','options','raw','attributes','limit','include','map','model','info','GetTrigger','find','where','then','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9437,0x80));var _0x7943=function(_0x5c760f,_0x3c4f49){_0x5c760f=_0x5c760f-0x0;var _0x58e4de=_0x9437[_0x5c760f];return _0x58e4de;};'use strict';var _=require(_0x7943('0x0'));var util=require(_0x7943('0x1'));var moment=require(_0x7943('0x2'));var BPromise=require(_0x7943('0x3'));var rs=require(_0x7943('0x4'));var fs=require('fs');var Redis=require(_0x7943('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7943('0x6'));var logger=require(_0x7943('0x7'))('rpc');var config=require(_0x7943('0x8'));var jayson=require(_0x7943('0x9'));var client=jayson['client'][_0x7943('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f70aa,_0xb4f714,_0x5d5d79){return new BPromise(function(_0x5b655b,_0x20432d){return client[_0x7943('0xb')](_0x3f70aa,_0x5d5d79)['then'](function(_0x567c18){logger['info'](_0x7943('0xc'),_0xb4f714,_0x7943('0xd'));logger[_0x7943('0xe')](_0x7943('0xf'),_0xb4f714,_0x7943('0xd'),JSON[_0x7943('0x10')](_0x567c18));if(_0x567c18[_0x7943('0x11')]){if(_0x567c18['error']['code']===0x1f4){logger[_0x7943('0x11')](_0x7943('0xc'),_0xb4f714,_0x567c18[_0x7943('0x11')][_0x7943('0x12')]);return _0x20432d(_0x567c18[_0x7943('0x11')][_0x7943('0x12')]);}logger[_0x7943('0x11')](_0x7943('0xc'),_0xb4f714,_0x567c18[_0x7943('0x11')][_0x7943('0x12')]);return _0x5b655b(_0x567c18[_0x7943('0x11')][_0x7943('0x12')]);}else{logger['info'](_0x7943('0xc'),_0xb4f714,_0x7943('0xd'));_0x5b655b(_0x567c18[_0x7943('0x13')]['message']);}})[_0x7943('0x14')](function(_0x14a6dc){logger[_0x7943('0x11')](_0x7943('0xc'),_0xb4f714,_0x14a6dc);_0x20432d(_0x14a6dc);});});}exports['GetTrigger']=function(_0x46d1dd){var _0x36c091=this;return new Promise(function(_0x2b8c5e,_0x52ecf6){return db[_0x7943('0x15')][_0x7943('0x16')]({'raw':_0x46d1dd[_0x7943('0x17')]?_0x46d1dd[_0x7943('0x17')][_0x7943('0x18')]===undefined?!![]:![]:!![],'where':_0x46d1dd[_0x7943('0x17')]?_0x46d1dd[_0x7943('0x17')]['where']||null:null,'attributes':_0x46d1dd[_0x7943('0x17')]?_0x46d1dd[_0x7943('0x17')][_0x7943('0x19')]||null:null,'limit':_0x46d1dd[_0x7943('0x17')]?_0x46d1dd['options'][_0x7943('0x1a')]||null:null,'include':_0x46d1dd[_0x7943('0x17')]?_0x46d1dd[_0x7943('0x17')][_0x7943('0x1b')]?_[_0x7943('0x1c')](_0x46d1dd[_0x7943('0x17')][_0x7943('0x1b')],function(_0x23b102){return{'model':db[_0x23b102[_0x7943('0x1d')]],'as':_0x23b102['as'],'attributes':_0x23b102[_0x7943('0x19')],'include':_0x23b102[_0x7943('0x1b')]?_[_0x7943('0x1c')](_0x23b102[_0x7943('0x1b')],function(_0x98558a){return{'model':db[_0x98558a[_0x7943('0x1d')]],'as':_0x98558a['as'],'attributes':_0x98558a[_0x7943('0x19')],'include':_0x98558a[_0x7943('0x1b')]?_[_0x7943('0x1c')](_0x98558a['include'],function(_0x92219e){return{'model':db[_0x92219e[_0x7943('0x1d')]],'as':_0x92219e['as'],'attributes':_0x92219e[_0x7943('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x323fa7){logger[_0x7943('0x1e')](_0x7943('0x1f'),_0x46d1dd);logger['debug'](_0x7943('0x1f'),_0x46d1dd,JSON[_0x7943('0x10')](_0x323fa7));_0x2b8c5e(_0x323fa7);})['catch'](function(_0x56a2df){logger[_0x7943('0x11')]('GetTrigger',_0x56a2df[_0x7943('0x12')],_0x46d1dd);_0x52ecf6(_0x36c091[_0x7943('0x11')](0x1f4,_0x56a2df[_0x7943('0x12')]));});});};exports['ShowTrigger']=function(_0x362025){var _0x4551fc=this;return new Promise(function(_0x3304a5,_0x11aa2c){return db['Trigger'][_0x7943('0x20')]({'raw':_0x362025[_0x7943('0x17')]?_0x362025[_0x7943('0x17')][_0x7943('0x18')]===undefined?!![]:![]:!![],'where':_0x362025[_0x7943('0x17')]?_0x362025['options'][_0x7943('0x21')]||null:null,'attributes':_0x362025['options']?_0x362025[_0x7943('0x17')][_0x7943('0x19')]||null:null,'include':_0x362025[_0x7943('0x17')]?_0x362025['options'][_0x7943('0x1b')]?_['map'](_0x362025[_0x7943('0x17')][_0x7943('0x1b')],function(_0x22e672){return{'model':db[_0x22e672['model']],'as':_0x22e672['as'],'attributes':_0x22e672[_0x7943('0x19')],'include':_0x22e672[_0x7943('0x1b')]?_[_0x7943('0x1c')](_0x22e672[_0x7943('0x1b')],function(_0x495b31){return{'model':db[_0x495b31['model']],'as':_0x495b31['as'],'attributes':_0x495b31[_0x7943('0x19')],'include':_0x495b31[_0x7943('0x1b')]?_[_0x7943('0x1c')](_0x495b31['include'],function(_0x8f27c3){return{'model':db[_0x8f27c3['model']],'as':_0x8f27c3['as'],'attributes':_0x8f27c3[_0x7943('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7943('0x22')](function(_0x5ef147){logger['info'](_0x7943('0x23'),_0x362025);logger[_0x7943('0xe')]('ShowTrigger',_0x362025,JSON[_0x7943('0x10')](_0x5ef147));_0x3304a5(_0x5ef147);})['catch'](function(_0x3f382b){logger[_0x7943('0x11')](_0x7943('0x23'),_0x3f382b['message'],_0x362025);_0x11aa2c(_0x4551fc[_0x7943('0x11')](0x1f4,_0x3f382b[_0x7943('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c2a6825..1d99f25 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 _0xe212=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','post','/:id/clone','clone','create','/:id','delete','exports','multer'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe212,0x11f));var _0x2e21=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xe212[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x2e21('0x0'));var util=require(_0x2e21('0x1'));var path=require('path');var timeout=require(_0x2e21('0x2'));var express=require(_0x2e21('0x3'));var router=express['Router']();var fs_extra=require(_0x2e21('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2e21('0x5'));var config=require(_0x2e21('0x6'));var controller=require(_0x2e21('0x7'));router[_0x2e21('0x8')]('/',auth[_0x2e21('0x9')](),controller['index']);router[_0x2e21('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2e21('0xa')]);router[_0x2e21('0xb')](_0x2e21('0xc'),auth[_0x2e21('0x9')](),controller[_0x2e21('0xd')]);router[_0x2e21('0xb')]('/',auth[_0x2e21('0x9')](),controller[_0x2e21('0xe')]);router['put'](_0x2e21('0xf'),auth[_0x2e21('0x9')](),controller['update']);router[_0x2e21('0x10')](_0x2e21('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x2e21('0x11')]=router; \ No newline at end of file +var _0x9c6a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','index','isAuthenticated','show','post','/:id/clone','clone','create','put','/:id','update','destroy','multer','util'];(function(_0x69b44f,_0x3a7b45){var _0x2325ce=function(_0x523be8){while(--_0x523be8){_0x69b44f['push'](_0x69b44f['shift']());}};_0x2325ce(++_0x3a7b45);}(_0x9c6a,0x82));var _0xa9c6=function(_0x458e87,_0x339a72){_0x458e87=_0x458e87-0x0;var _0x475075=_0x9c6a[_0x458e87];return _0x475075;};'use strict';var multer=require(_0xa9c6('0x0'));var util=require(_0xa9c6('0x1'));var path=require(_0xa9c6('0x2'));var timeout=require(_0xa9c6('0x3'));var express=require(_0xa9c6('0x4'));var router=express[_0xa9c6('0x5')]();var fs_extra=require(_0xa9c6('0x6'));var auth=require(_0xa9c6('0x7'));var interaction=require(_0xa9c6('0x8'));var config=require('../../config/environment');var controller=require(_0xa9c6('0x9'));router[_0xa9c6('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9c6('0xb')]);router[_0xa9c6('0xa')]('/:id',auth[_0xa9c6('0xc')](),controller[_0xa9c6('0xd')]);router[_0xa9c6('0xe')](_0xa9c6('0xf'),auth[_0xa9c6('0xc')](),controller[_0xa9c6('0x10')]);router[_0xa9c6('0xe')]('/',auth[_0xa9c6('0xc')](),controller[_0xa9c6('0x11')]);router[_0xa9c6('0x12')](_0xa9c6('0x13'),auth[_0xa9c6('0xc')](),controller[_0xa9c6('0x14')]);router['delete'](_0xa9c6('0x13'),auth[_0xa9c6('0xc')](),controller[_0xa9c6('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index a7c3142..e94a692 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 _0x5849=['PROHIB','STRING','udp','setDataValue','transport','getDataValue','split','info','inband','auto','rfc2833','yes','update','nat','join','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','ENUM','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0x5849,0x86));var _0x9584=function(_0x44c8da,_0x4c2693){_0x44c8da=_0x44c8da-0x0;var _0x479d1e=_0x5849[_0x44c8da];return _0x479d1e;};'use strict';var Sequelize=require(_0x9584('0x0'));module[_0x9584('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9584('0x2')]('friend','user','peer'),'allowNull':![],'defaultValue':_0x9584('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9584('0x4')},'callingpres':{'type':Sequelize[_0x9584('0x2')]('ALLOWED_NOT_SCREENED',_0x9584('0x5'),_0x9584('0x6'),_0x9584('0x7'),_0x9584('0x8'),'PROHIB_PASSED_SCREEN',_0x9584('0x9'),_0x9584('0xa'))},'deny':{'type':Sequelize[_0x9584('0xb')]},'permit':{'type':Sequelize[_0x9584('0xb')]},'secret':{'type':Sequelize[_0x9584('0xb')]},'md5secret':{'type':Sequelize[_0x9584('0xb')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x9584('0xb')],'defaultValue':_0x9584('0xc'),'set':function(_0x42529a){this[_0x9584('0xd')](_0x9584('0xe'),_0x42529a?_0x42529a['join'](','):null);},'get':function(){return this[_0x9584('0xf')](_0x9584('0xe'))?this[_0x9584('0xf')](_0x9584('0xe'))[_0x9584('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x9584('0x11'),'shortinfo',_0x9584('0x12'),_0x9584('0x13')),'defaultValue':_0x9584('0x14')},'directmedia':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no','nonat',_0x9584('0x16'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9584('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9584('0xb')]},'directmediadeny':{'type':Sequelize[_0x9584('0xb')]},'nat':{'type':Sequelize[_0x9584('0xb')],'defaultValue':'force_rport,comedia','set':function(_0x13d8a8){this[_0x9584('0xd')](_0x9584('0x17'),_0x13d8a8?_0x13d8a8[_0x9584('0x18')](','):null);},'get':function(){return this[_0x9584('0xf')](_0x9584('0x17'))?this[_0x9584('0xf')]('nat')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9584('0xb')]},'language':{'type':Sequelize[_0x9584('0xb')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9584('0xb')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9584('0xb')],'defaultValue':_0x9584('0x19')},'allow':{'type':Sequelize[_0x9584('0xb')],'allowNull':![],'defaultValue':_0x9584('0x1a'),'set':function(_0x2d1275){this[_0x9584('0xd')](_0x9584('0x1b'),_0x2d1275?_0x2d1275['join'](';'):_0x9584('0x1a'));},'get':function(){return this[_0x9584('0xf')](_0x9584('0x1b'))?this[_0x9584('0xf')](_0x9584('0x1b'))['split'](';'):null;},'comment':_0x9584('0x1c')},'autoframing':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'insecure':{'type':Sequelize[_0x9584('0xb')],'defaultValue':'port,invite','set':function(_0xaaf543){this[_0x9584('0xd')]('insecure',_0xaaf543?_0xaaf543[_0x9584('0x18')](','):null);},'get':function(){return this['getDataValue'](_0x9584('0x1d'))?this[_0x9584('0xf')](_0x9584('0x1d'))[_0x9584('0x10')](','):null;},'comment':_0x9584('0x1e')},'trustrpid':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9584('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no',_0x9584('0x1f'))},'promiscredir':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9584('0x15'),'no')},'accountcode':{'type':Sequelize[_0x9584('0x20')](0xb)},'setvar':{'type':Sequelize[_0x9584('0xb')]},'callerid':{'type':Sequelize[_0x9584('0xb')],'defaultValue':_0x9584('0x21')},'amaflags':{'type':Sequelize[_0x9584('0xb')]},'callcounter':{'type':Sequelize['ENUM'](_0x9584('0x15'),'no'),'defaultValue':_0x9584('0x15')},'busylevel':{'type':Sequelize[_0x9584('0x20')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x9584('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9584('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x9584('0xb')]},'template':{'type':Sequelize[_0x9584('0xb')]},'videosupport':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no',_0x9584('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9584('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x9584('0x23'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x9584('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x9584('0x20')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x9584('0x24'),'uas'),'defaultValue':_0x9584('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0x9584('0xb')]},'regexten':{'type':Sequelize[_0x9584('0xb')]},'fromdomain':{'type':Sequelize[_0x9584('0xb')]},'fromuser':{'type':Sequelize[_0x9584('0xb')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x9584('0x15'),'no'),'defaultValue':_0x9584('0x15')},'keepalive':{'type':Sequelize[_0x9584('0x20')](0xb)},'defaultip':{'type':Sequelize[_0x9584('0xb')]},'defaultuser':{'type':Sequelize[_0x9584('0xb')]},'rtptimeout':{'type':Sequelize[_0x9584('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9584('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9584('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no',_0x9584('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9584('0xb')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x9584('0x20')](0xb)},'timerb':{'type':Sequelize[_0x9584('0x20')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9584('0x20')](0xb)},'contactpermit':{'type':Sequelize[_0x9584('0xb')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x9584('0xb')]},'use_q850_reason':{'type':Sequelize[_0x9584('0xb')]},'maxforwards':{'type':Sequelize[_0x9584('0x20')](0xb)},'encryption':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0x9584('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no',_0x9584('0x27'),_0x9584('0x28'))},'dtlsrekey':{'type':Sequelize[_0x9584('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9584('0xb')]},'dtlsprivatekey':{'type':Sequelize[_0x9584('0xb')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x9584('0xb')]},'dtlscapath':{'type':Sequelize[_0x9584('0xb')]},'dtlssetup':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x29'),_0x9584('0x2a'),_0x9584('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9584('0xb')]},'usereqphone':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9584('0xb')]},'recordofffeature':{'type':Sequelize[_0x9584('0xb')]},'call_limit':{'type':Sequelize[_0x9584('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9584('0x2')](_0x9584('0x15'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x9584('0x15'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x9584('0xb')]},'mohsuggest':{'type':Sequelize[_0x9584('0xb')]},'parkinglot':{'type':Sequelize[_0x9584('0xb')]},'description':{'type':Sequelize[_0x9584('0xb')]},'host':{'type':Sequelize[_0x9584('0xb')],'defaultValue':_0x9584('0x2c')},'canreinvite':{'type':Sequelize[_0x9584('0x2')]('yes','no',_0x9584('0x2d'),_0x9584('0x16'),_0x9584('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x9584('0xb')]},'active':{'type':Sequelize[_0x9584('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xc901=['uac','uas','pai','fingerprint','passive','actpass','dynamic','sequelize','exports','ENUM','friend','peer','STRING','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','nonat','update','yes','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always'];(function(_0x227831,_0x1036ab){var _0x58dc93=function(_0x2c509c){while(--_0x2c509c){_0x227831['push'](_0x227831['shift']());}};_0x58dc93(++_0x1036ab);}(_0xc901,0x88));var _0x1c90=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc901[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x1c90('0x0'));module[_0x1c90('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x3'),'user',_0x1c90('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x1c90('0x5')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x1c90('0x2')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x1c90('0x6'),'ALLOWED',_0x1c90('0x7'),_0x1c90('0x8'),_0x1c90('0x9'),_0x1c90('0xa'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x1c90('0x5')]},'secret':{'type':Sequelize[_0x1c90('0x5')]},'md5secret':{'type':Sequelize[_0x1c90('0x5')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x1c90('0x5')],'defaultValue':_0x1c90('0xb'),'set':function(_0x374b56){this['setDataValue'](_0x1c90('0xc'),_0x374b56?_0x374b56[_0x1c90('0xd')](','):null);},'get':function(){return this[_0x1c90('0xe')]('transport')?this['getDataValue'](_0x1c90('0xc'))[_0x1c90('0xf')](','):null;},'comment':_0x1c90('0x10')},'dtmfmode':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x11'),'info',_0x1c90('0x12'),_0x1c90('0x13'),_0x1c90('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x1c90('0x15'),_0x1c90('0x16'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1c90('0x5')]},'directmediadeny':{'type':Sequelize[_0x1c90('0x5')]},'nat':{'type':Sequelize[_0x1c90('0x5')],'defaultValue':'force_rport,comedia','set':function(_0x831f21){this[_0x1c90('0x18')]('nat',_0x831f21?_0x831f21[_0x1c90('0xd')](','):null);},'get':function(){return this[_0x1c90('0xe')](_0x1c90('0x19'))?this[_0x1c90('0xe')](_0x1c90('0x19'))['split'](','):null;},'comment':_0x1c90('0x1a')},'callgroup':{'type':Sequelize[_0x1c90('0x5')]},'namedcallgroup':{'type':Sequelize[_0x1c90('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1c90('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1c90('0x5')],'defaultValue':_0x1c90('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1c90('0x1c'),'set':function(_0x3b427f){this['setDataValue'](_0x1c90('0x1d'),_0x3b427f?_0x3b427f[_0x1c90('0xd')](';'):_0x1c90('0x1c'));},'get':function(){return this[_0x1c90('0xe')](_0x1c90('0x1d'))?this['getDataValue'](_0x1c90('0x1d'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x1c90('0x1e'),'set':function(_0x18efc3){this['setDataValue']('insecure',_0x18efc3?_0x18efc3[_0x1c90('0xd')](','):null);},'get':function(){return this[_0x1c90('0xe')](_0x1c90('0x1f'))?this[_0x1c90('0xe')](_0x1c90('0x1f'))[_0x1c90('0xf')](','):null;},'comment':_0x1c90('0x20')},'trustrpid':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no','never')},'promiscredir':{'type':Sequelize[_0x1c90('0x2')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no')},'accountcode':{'type':Sequelize[_0x1c90('0x21')](0xb)},'setvar':{'type':Sequelize[_0x1c90('0x5')]},'callerid':{'type':Sequelize[_0x1c90('0x5')],'defaultValue':_0x1c90('0x22')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no'),'defaultValue':_0x1c90('0x17')},'busylevel':{'type':Sequelize[_0x1c90('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x1c90('0x5')]},'template':{'type':Sequelize[_0x1c90('0x5')]},'videosupport':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no',_0x1c90('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1c90('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'mailbox':{'type':Sequelize[_0x1c90('0x5')]},'session_timers':{'type':Sequelize['ENUM']('accept','refuse','originate')},'session_expires':{'type':Sequelize[_0x1c90('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x1c90('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x24'),'uas'),'defaultValue':_0x1c90('0x25')},'t38pt_usertpsource':{'type':Sequelize[_0x1c90('0x5')]},'regexten':{'type':Sequelize[_0x1c90('0x5')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x1c90('0x21')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1c90('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x1c90('0x5')]},'defaultuser':{'type':Sequelize[_0x1c90('0x5')]},'rtptimeout':{'type':Sequelize[_0x1c90('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no',_0x1c90('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x1c90('0x5')]},'timert1':{'type':Sequelize[_0x1c90('0x21')](0xb)},'timerb':{'type':Sequelize[_0x1c90('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x1c90('0x5')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x1c90('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x1c90('0x5')]},'use_q850_reason':{'type':Sequelize[_0x1c90('0x5')]},'maxforwards':{'type':Sequelize[_0x1c90('0x21')](0xb)},'encryption':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1c90('0x2')]('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no',_0x1c90('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x1c90('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1c90('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x1c90('0x5')]},'dtlscipher':{'type':Sequelize[_0x1c90('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x1c90('0x5')]},'dtlssetup':{'type':Sequelize[_0x1c90('0x2')]('active',_0x1c90('0x28'),_0x1c90('0x29')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1c90('0x5')]},'usereqphone':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1c90('0x5')]},'recordofffeature':{'type':Sequelize[_0x1c90('0x5')]},'call_limit':{'type':Sequelize[_0x1c90('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x1c90('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x1c90('0x2')](_0x1c90('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x1c90('0x5')]},'mohsuggest':{'type':Sequelize[_0x1c90('0x5')]},'parkinglot':{'type':Sequelize[_0x1c90('0x5')]},'description':{'type':Sequelize[_0x1c90('0x5')]},'host':{'type':Sequelize[_0x1c90('0x5')],'defaultValue':_0x1c90('0x2a')},'canreinvite':{'type':Sequelize[_0x1c90('0x2')]('yes','no',_0x1c90('0x15'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1c90('0x5')]},'otherFields':{'type':Sequelize[_0x1c90('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1c90('0x5')],'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 eb8429e..2de4f62 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 _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x598446,_0x1f2d97){var _0x5dd87d=function(_0x87490b){while(--_0x87490b){_0x598446['push'](_0x598446['shift']());}};_0x5dd87d(++_0x1f2d97);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0xf3cd[_0x1895b7];return _0x1aecdc;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));}; \ No newline at end of file +var _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1b91c7,_0x539acd){_0x1b91c7=_0x1b91c7-0x0;var _0xbbe014=_0x4b84[_0x1b91c7];return _0xbbe014;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 012cd0a..563901c 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 _0x2386=['moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util'];(function(_0x1d36dc,_0x19555b){var _0x36ca0c=function(_0x5dd8ea){while(--_0x5dd8ea){_0x1d36dc['push'](_0x1d36dc['shift']());}};_0x36ca0c(++_0x19555b);}(_0x2386,0x128));var _0x6238=function(_0x221f71,_0x221c04){_0x221f71=_0x221f71-0x0;var _0x2df2e5=_0x2386[_0x221f71];return _0x2df2e5;};'use strict';var _=require('lodash');var util=require(_0x6238('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6238('0x1'));var BPromise=require(_0x6238('0x2'));var rp=require(_0x6238('0x3'));var fs=require('fs');var path=require(_0x6238('0x4'));var rimraf=require('rimraf');var config=require(_0x6238('0x5'));var attributes=require(_0x6238('0x6'));module[_0x6238('0x7')]=function(_0x85ecc9,_0x55a924){return _0x85ecc9[_0x6238('0x8')](_0x6238('0x9'),attributes,{'tableName':_0x6238('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27e2=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x27e2,0xea));var _0x227e=function(_0x34bbc5,_0x462e17){_0x34bbc5=_0x34bbc5-0x0;var _0x3f3db9=_0x27e2[_0x34bbc5];return _0x3f3db9;};'use strict';var _=require(_0x227e('0x0'));var util=require(_0x227e('0x1'));var logger=require(_0x227e('0x2'))('api');var moment=require(_0x227e('0x3'));var BPromise=require(_0x227e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x227e('0x5'));var rimraf=require('rimraf');var config=require(_0x227e('0x6'));var attributes=require(_0x227e('0x7'));module[_0x227e('0x8')]=function(_0x3d33b9,_0x36b183){return _0x3d33b9[_0x227e('0x9')](_0x227e('0xa'),attributes,{'tableName':_0x227e('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 c3e208e..d9f8878 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 _0x6974=['Trunk','options','raw','where','attributes','include','map','model','GetTrunk','stringify','catch','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x25a9fe,_0x5cf3c6){var _0xf8c280=function(_0x2fc048){while(--_0x2fc048){_0x25a9fe['push'](_0x25a9fe['shift']());}};_0xf8c280(++_0x5cf3c6);}(_0x6974,0x1bd));var _0x4697=function(_0x527c5e,_0xa1e3b9){_0x527c5e=_0x527c5e-0x0;var _0x1c47b8=_0x6974[_0x527c5e];return _0x1c47b8;};'use strict';var _=require(_0x4697('0x0'));var util=require(_0x4697('0x1'));var moment=require(_0x4697('0x2'));var BPromise=require(_0x4697('0x3'));var rs=require(_0x4697('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4697('0x5'))['db'];var utils=require(_0x4697('0x6'));var logger=require(_0x4697('0x7'))(_0x4697('0x8'));var config=require(_0x4697('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4697('0xa')][_0x4697('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf19754,_0x9de42,_0x2c728b){return new BPromise(function(_0x4f8f72,_0x4df606){return client[_0x4697('0xc')](_0xf19754,_0x2c728b)[_0x4697('0xd')](function(_0xd79eb3){logger[_0x4697('0xe')](_0x4697('0xf'),_0x9de42,_0x4697('0x10'));logger[_0x4697('0x11')](_0x4697('0x12'),_0x9de42,_0x4697('0x10'),JSON['stringify'](_0xd79eb3));if(_0xd79eb3['error']){if(_0xd79eb3[_0x4697('0x13')][_0x4697('0x14')]===0x1f4){logger[_0x4697('0x13')](_0x4697('0xf'),_0x9de42,_0xd79eb3[_0x4697('0x13')][_0x4697('0x15')]);return _0x4df606(_0xd79eb3['error']['message']);}logger[_0x4697('0x13')](_0x4697('0xf'),_0x9de42,_0xd79eb3[_0x4697('0x13')]['message']);return _0x4f8f72(_0xd79eb3[_0x4697('0x13')][_0x4697('0x15')]);}else{logger[_0x4697('0xe')](_0x4697('0xf'),_0x9de42,_0x4697('0x10'));_0x4f8f72(_0xd79eb3[_0x4697('0x16')][_0x4697('0x15')]);}})['catch'](function(_0x3e7fb6){logger[_0x4697('0x13')]('Trunk,\x20%s,\x20%s',_0x9de42,_0x3e7fb6);_0x4df606(_0x3e7fb6);});});}exports['GetTrunk']=function(_0x3c8988){var _0xd90c28=this;return new Promise(function(_0xea5afd,_0x4990d7){return db[_0x4697('0x17')]['findAll']({'raw':_0x3c8988[_0x4697('0x18')]?_0x3c8988['options'][_0x4697('0x19')]===undefined?!![]:![]:!![],'where':_0x3c8988[_0x4697('0x18')]?_0x3c8988[_0x4697('0x18')][_0x4697('0x1a')]||null:null,'attributes':_0x3c8988['options']?_0x3c8988[_0x4697('0x18')][_0x4697('0x1b')]||null:null,'limit':_0x3c8988[_0x4697('0x18')]?_0x3c8988['options']['limit']||null:null,'include':_0x3c8988[_0x4697('0x18')]?_0x3c8988[_0x4697('0x18')][_0x4697('0x1c')]?_[_0x4697('0x1d')](_0x3c8988[_0x4697('0x18')][_0x4697('0x1c')],function(_0x248174){return{'model':db[_0x248174[_0x4697('0x1e')]],'as':_0x248174['as'],'attributes':_0x248174[_0x4697('0x1b')],'include':_0x248174[_0x4697('0x1c')]?_[_0x4697('0x1d')](_0x248174[_0x4697('0x1c')],function(_0xfc62f){return{'model':db[_0xfc62f['model']],'as':_0xfc62f['as'],'attributes':_0xfc62f[_0x4697('0x1b')],'include':_0xfc62f[_0x4697('0x1c')]?_['map'](_0xfc62f[_0x4697('0x1c')],function(_0x249097){return{'model':db[_0x249097['model']],'as':_0x249097['as'],'attributes':_0x249097['attributes']};}):[]};}):[]};}):[]:[]})[_0x4697('0xd')](function(_0x3c63e4){logger[_0x4697('0xe')](_0x4697('0x1f'),_0x3c8988);logger['debug']('GetTrunk',_0x3c8988,JSON[_0x4697('0x20')](_0x3c63e4));_0xea5afd(_0x3c63e4);})[_0x4697('0x21')](function(_0xc9e4ed){logger['error'](_0x4697('0x1f'),_0xc9e4ed[_0x4697('0x15')],_0x3c8988);_0x4990d7(_0xd90c28['error'](0x1f4,_0xc9e4ed[_0x4697('0x15')]));});});};exports['ShowTrunk']=function(_0x397793){var _0x507121=this;return new Promise(function(_0x220e6e,_0x58c403){return db[_0x4697('0x17')][_0x4697('0x22')]({'raw':_0x397793[_0x4697('0x18')]?_0x397793[_0x4697('0x18')][_0x4697('0x19')]===undefined?!![]:![]:!![],'where':_0x397793[_0x4697('0x18')]?_0x397793['options'][_0x4697('0x1a')]||null:null,'attributes':_0x397793['options']?_0x397793[_0x4697('0x18')][_0x4697('0x1b')]||null:null,'include':_0x397793[_0x4697('0x18')]?_0x397793[_0x4697('0x18')]['include']?_[_0x4697('0x1d')](_0x397793[_0x4697('0x18')][_0x4697('0x1c')],function(_0x18d83d){return{'model':db[_0x18d83d[_0x4697('0x1e')]],'as':_0x18d83d['as'],'attributes':_0x18d83d['attributes'],'include':_0x18d83d[_0x4697('0x1c')]?_[_0x4697('0x1d')](_0x18d83d[_0x4697('0x1c')],function(_0xb8699b){return{'model':db[_0xb8699b[_0x4697('0x1e')]],'as':_0xb8699b['as'],'attributes':_0xb8699b['attributes'],'include':_0xb8699b['include']?_['map'](_0xb8699b[_0x4697('0x1c')],function(_0x598e64){return{'model':db[_0x598e64[_0x4697('0x1e')]],'as':_0x598e64['as'],'attributes':_0x598e64[_0x4697('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4697('0xd')](function(_0x223b71){logger['info']('ShowTrunk',_0x397793);logger[_0x4697('0x11')](_0x4697('0x23'),_0x397793,JSON[_0x4697('0x20')](_0x223b71));_0x220e6e(_0x223b71);})[_0x4697('0x21')](function(_0x5268ac){logger[_0x4697('0x13')](_0x4697('0x23'),_0x5268ac[_0x4697('0x15')],_0x397793);_0x58c403(_0x507121[_0x4697('0x13')](0x1f4,_0x5268ac['message']));});});}; \ No newline at end of file +var _0xf878=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','Trunk','options','raw','where','attributes','include','map','model','find','ShowTrunk','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0xf878,0xdf));var _0x8f87=function(_0x9c25a3,_0x272bc0){_0x9c25a3=_0x9c25a3-0x0;var _0x2572e6=_0xf878[_0x9c25a3];return _0x2572e6;};'use strict';var _=require(_0x8f87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8f87('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f87('0x2'));var db=require(_0x8f87('0x3'))['db'];var utils=require(_0x8f87('0x4'));var logger=require(_0x8f87('0x5'))(_0x8f87('0x6'));var config=require(_0x8f87('0x7'));var jayson=require(_0x8f87('0x8'));var client=jayson['client'][_0x8f87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14b0e9,_0x3b35aa,_0x4034b3){return new BPromise(function(_0x14c9c0,_0x3480af){return client[_0x8f87('0xa')](_0x14b0e9,_0x4034b3)[_0x8f87('0xb')](function(_0x306048){logger[_0x8f87('0xc')](_0x8f87('0xd'),_0x3b35aa,_0x8f87('0xe'));logger[_0x8f87('0xf')](_0x8f87('0x10'),_0x3b35aa,_0x8f87('0xe'),JSON[_0x8f87('0x11')](_0x306048));if(_0x306048[_0x8f87('0x12')]){if(_0x306048[_0x8f87('0x12')][_0x8f87('0x13')]===0x1f4){logger['error'](_0x8f87('0xd'),_0x3b35aa,_0x306048[_0x8f87('0x12')][_0x8f87('0x14')]);return _0x3480af(_0x306048[_0x8f87('0x12')][_0x8f87('0x14')]);}logger[_0x8f87('0x12')](_0x8f87('0xd'),_0x3b35aa,_0x306048['error']['message']);return _0x14c9c0(_0x306048[_0x8f87('0x12')][_0x8f87('0x14')]);}else{logger['info'](_0x8f87('0xd'),_0x3b35aa,_0x8f87('0xe'));_0x14c9c0(_0x306048[_0x8f87('0x15')]['message']);}})['catch'](function(_0x5de382){logger[_0x8f87('0x12')]('Trunk,\x20%s,\x20%s',_0x3b35aa,_0x5de382);_0x3480af(_0x5de382);});});}exports[_0x8f87('0x16')]=function(_0x3ba09c){var _0xfe60a8=this;return new Promise(function(_0x29ae45,_0x2d63c7){return db[_0x8f87('0x17')]['findAll']({'raw':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c[_0x8f87('0x18')][_0x8f87('0x19')]===undefined?!![]:![]:!![],'where':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c[_0x8f87('0x18')][_0x8f87('0x1a')]||null:null,'attributes':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c['options'][_0x8f87('0x1b')]||null:null,'limit':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c[_0x8f87('0x18')]['limit']||null:null,'include':_0x3ba09c['options']?_0x3ba09c['options'][_0x8f87('0x1c')]?_[_0x8f87('0x1d')](_0x3ba09c[_0x8f87('0x18')][_0x8f87('0x1c')],function(_0x1beb43){return{'model':db[_0x1beb43[_0x8f87('0x1e')]],'as':_0x1beb43['as'],'attributes':_0x1beb43['attributes'],'include':_0x1beb43[_0x8f87('0x1c')]?_['map'](_0x1beb43[_0x8f87('0x1c')],function(_0xcfced3){return{'model':db[_0xcfced3[_0x8f87('0x1e')]],'as':_0xcfced3['as'],'attributes':_0xcfced3[_0x8f87('0x1b')],'include':_0xcfced3[_0x8f87('0x1c')]?_['map'](_0xcfced3[_0x8f87('0x1c')],function(_0x1a32bf){return{'model':db[_0x1a32bf[_0x8f87('0x1e')]],'as':_0x1a32bf['as'],'attributes':_0x1a32bf[_0x8f87('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8f87('0xb')](function(_0xaa2b4d){logger[_0x8f87('0xc')]('GetTrunk',_0x3ba09c);logger[_0x8f87('0xf')](_0x8f87('0x16'),_0x3ba09c,JSON[_0x8f87('0x11')](_0xaa2b4d));_0x29ae45(_0xaa2b4d);})['catch'](function(_0x3ed5ce){logger['error'](_0x8f87('0x16'),_0x3ed5ce[_0x8f87('0x14')],_0x3ba09c);_0x2d63c7(_0xfe60a8[_0x8f87('0x12')](0x1f4,_0x3ed5ce[_0x8f87('0x14')]));});});};exports['ShowTrunk']=function(_0x11a714){var _0x5adf6d=this;return new Promise(function(_0x475f7c,_0x2dc71e){return db[_0x8f87('0x17')][_0x8f87('0x1f')]({'raw':_0x11a714['options']?_0x11a714['options'][_0x8f87('0x19')]===undefined?!![]:![]:!![],'where':_0x11a714[_0x8f87('0x18')]?_0x11a714[_0x8f87('0x18')]['where']||null:null,'attributes':_0x11a714['options']?_0x11a714[_0x8f87('0x18')][_0x8f87('0x1b')]||null:null,'include':_0x11a714['options']?_0x11a714[_0x8f87('0x18')][_0x8f87('0x1c')]?_[_0x8f87('0x1d')](_0x11a714[_0x8f87('0x18')][_0x8f87('0x1c')],function(_0xa0d6ef){return{'model':db[_0xa0d6ef[_0x8f87('0x1e')]],'as':_0xa0d6ef['as'],'attributes':_0xa0d6ef[_0x8f87('0x1b')],'include':_0xa0d6ef[_0x8f87('0x1c')]?_['map'](_0xa0d6ef[_0x8f87('0x1c')],function(_0x5dcaef){return{'model':db[_0x5dcaef['model']],'as':_0x5dcaef['as'],'attributes':_0x5dcaef['attributes'],'include':_0x5dcaef[_0x8f87('0x1c')]?_[_0x8f87('0x1d')](_0x5dcaef['include'],function(_0x5e7cac){return{'model':db[_0x5e7cac[_0x8f87('0x1e')]],'as':_0x5e7cac['as'],'attributes':_0x5e7cac[_0x8f87('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8f87('0xb')](function(_0x5dd180){logger[_0x8f87('0xc')](_0x8f87('0x20'),_0x11a714);logger[_0x8f87('0xf')]('ShowTrunk',_0x11a714,JSON[_0x8f87('0x11')](_0x5dd180));_0x475f7c(_0x5dd180);})[_0x8f87('0x21')](function(_0x26e0df){logger[_0x8f87('0x12')](_0x8f87('0x20'),_0x26e0df[_0x8f87('0x14')],_0x11a714);_0x2dc71e(_0x5adf6d[_0x8f87('0x12')](0x1f4,_0x26e0df[_0x8f87('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 3f1e931..d981d4d 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 _0x100d=['./user-setting.controller','put','/:id','exports','express','../../components/auth/service'];(function(_0x5f531b,_0xc040ee){var _0x2e082b=function(_0x5f1ab5){while(--_0x5f1ab5){_0x5f531b['push'](_0x5f531b['shift']());}};_0x2e082b(++_0xc040ee);}(_0x100d,0x12a));var _0xd100=function(_0xc752b4,_0x2999c7){_0xc752b4=_0xc752b4-0x0;var _0x135cd5=_0x100d[_0xc752b4];return _0x135cd5;};'use strict';var express=require(_0xd100('0x0'));var router=express['Router']();var auth=require(_0xd100('0x1'));var controller=require(_0xd100('0x2'));router[_0xd100('0x3')](_0xd100('0x4'),auth['isAuthenticated'](),controller['update']);module[_0xd100('0x5')]=router; \ No newline at end of file +var _0x661d=['Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express'];(function(_0x153701,_0x48499f){var _0x4d79f4=function(_0x41eecb){while(--_0x41eecb){_0x153701['push'](_0x153701['shift']());}};_0x4d79f4(++_0x48499f);}(_0x661d,0xa1));var _0xd661=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0x661d[_0x47242d];return _0x30273a;};'use strict';var express=require(_0xd661('0x0'));var router=express[_0xd661('0x1')]();var auth=require(_0xd661('0x2'));var controller=require(_0xd661('0x3'));router[_0xd661('0x4')](_0xd661('0x5'),auth[_0xd661('0x6')](),controller[_0xd661('0x7')]);module[_0xd661('0x8')]=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 2e9012b..05ee440 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 _0x6038=['INTEGER','UserId','sequelize','warning','info','debug','exports','DATE'];(function(_0x54ff5c,_0x3df61c){var _0x196412=function(_0x2cf284){while(--_0x2cf284){_0x54ff5c['push'](_0x54ff5c['shift']());}};_0x196412(++_0x3df61c);}(_0x6038,0xd2));var _0x8603=function(_0x2b2e1f,_0x122f2c){_0x2b2e1f=_0x2b2e1f-0x0;var _0x5cb27c=_0x6038[_0x2b2e1f];return _0x5cb27c;};'use strict';var Sequelize=require(_0x8603('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x8603('0x1'),_0x8603('0x2'),_0x8603('0x3')];module[_0x8603('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8603('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x8603('0x6')],'unique':_0x8603('0x7')}}; \ No newline at end of file +var _0x1a62=['ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','error','warning','debug'];(function(_0x20905c,_0x4672b2){var _0x3be5e8=function(_0x34dacb){while(--_0x34dacb){_0x20905c['push'](_0x20905c['shift']());}};_0x3be5e8(++_0x4672b2);}(_0x1a62,0x1c8));var _0x21a6=function(_0x3852fb,_0xbd80e3){_0x3852fb=_0x3852fb-0x0;var _0x2f2af7=_0x1a62[_0x3852fb];return _0x2f2af7;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x21a6('0x0'),_0x21a6('0x1'),'info',_0x21a6('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x21a6('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x21a6('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x21a6('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x21a6('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x21a6('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x21a6('0x7')],'unique':_0x21a6('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 70992b3..6513178 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 _0xe914=['admin','Unauthorized','params','UserSetting','find','body','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','defaults','localhost','then','stack','name','status','send','update','user'];(function(_0x685499,_0x4fbfea){var _0x4471f2=function(_0x1162c6){while(--_0x1162c6){_0x685499['push'](_0x685499['shift']());}};_0x4471f2(++_0x4fbfea);}(_0xe914,0x7f));var _0x4e91=function(_0x1501e5,_0x5c84a9){_0x1501e5=_0x1501e5-0x0;var _0xb581ea=_0xe914[_0x1501e5];return _0xb581ea;};'use strict';var _=require(_0x4e91('0x0'));var Redis=require(_0x4e91('0x1'));var logger=require('../../config/logger')(_0x4e91('0x2'));var config=require(_0x4e91('0x3'));var db=require(_0x4e91('0x4'))['db'];var socket=require(_0x4e91('0x5'))(new Redis(config[_0x4e91('0x6')]));require(_0x4e91('0x7'))['register'](socket);config[_0x4e91('0x6')]=_[_0x4e91('0x8')](config['redis'],{'host':_0x4e91('0x9'),'port':0x18eb});function respondWithResult(_0x1d4bd6,_0x3f09cb){_0x3f09cb=_0x3f09cb||0xc8;return function(_0x2f2098){if(_0x2f2098){return _0x1d4bd6['status'](_0x3f09cb)['json'](_0x2f2098);}};}function saveUpdates(_0x1dcea3){return function(_0x49d0d3){if(_0x49d0d3){return _0x49d0d3['update'](_0x1dcea3)[_0x4e91('0xa')](function(_0x1a0504){return _0x1a0504;});}return null;};}function handleEntityNotFound(_0x2997fa){return function(_0x2762e9){if(!_0x2762e9){_0x2997fa['sendStatus'](0x194);}return _0x2762e9;};}function handleError(_0x2e411d,_0x200bd1){_0x200bd1=_0x200bd1||0x1f4;return function(_0x38d3b4){logger['error'](_0x38d3b4[_0x4e91('0xb')]);if(_0x38d3b4[_0x4e91('0xc')]){delete _0x38d3b4[_0x4e91('0xc')];}_0x2e411d[_0x4e91('0xd')](_0x200bd1)[_0x4e91('0xe')](_0x38d3b4);};}exports[_0x4e91('0xf')]=function(_0x20fce6,_0x33015e){if(_0x20fce6[_0x4e91('0x10')]['role']!==_0x4e91('0x11'))throw new Error(_0x4e91('0x12'));if(isNaN(Number(_0x20fce6[_0x4e91('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x4e91('0x14')][_0x4e91('0x15')]({'where':{'id':_0x20fce6[_0x4e91('0x13')]['id']}})[_0x4e91('0xa')](handleEntityNotFound(_0x33015e,null))[_0x4e91('0xa')](saveUpdates(_0x20fce6[_0x4e91('0x16')],null))[_0x4e91('0xa')](respondWithResult(_0x33015e,null))[_0x4e91('0x17')](handleError(_0x33015e,null));}; \ No newline at end of file +var _0xeb79=['send','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','../../config/logger','../../config/environment','socket.io-emitter','./user-setting.socket','register','redis','defaults','status','json','update','then','sendStatus','error','stack','name'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xeb79,0x87));var _0x9eb7=function(_0x50a330,_0x2e003c){_0x50a330=_0x50a330-0x0;var _0x475636=_0xeb79[_0x50a330];return _0x475636;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x9eb7('0x0'))('api');var config=require(_0x9eb7('0x1'));var db=require('../../mysqldb')['db'];var socket=require(_0x9eb7('0x2'))(new Redis(config['redis']));require(_0x9eb7('0x3'))[_0x9eb7('0x4')](socket);config[_0x9eb7('0x5')]=_[_0x9eb7('0x6')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0xaa486a,_0x5ae8e6){_0x5ae8e6=_0x5ae8e6||0xc8;return function(_0x152a72){if(_0x152a72){return _0xaa486a[_0x9eb7('0x7')](_0x5ae8e6)[_0x9eb7('0x8')](_0x152a72);}};}function saveUpdates(_0x20ca15){return function(_0x407e20){if(_0x407e20){return _0x407e20[_0x9eb7('0x9')](_0x20ca15)[_0x9eb7('0xa')](function(_0x565439){return _0x565439;});}return null;};}function handleEntityNotFound(_0x27829b){return function(_0x43bb5f){if(!_0x43bb5f){_0x27829b[_0x9eb7('0xb')](0x194);}return _0x43bb5f;};}function handleError(_0x2d298b,_0x1b96d3){_0x1b96d3=_0x1b96d3||0x1f4;return function(_0x37bda3){logger[_0x9eb7('0xc')](_0x37bda3[_0x9eb7('0xd')]);if(_0x37bda3[_0x9eb7('0xe')]){delete _0x37bda3[_0x9eb7('0xe')];}_0x2d298b[_0x9eb7('0x7')](_0x1b96d3)[_0x9eb7('0xf')](_0x37bda3);};}exports[_0x9eb7('0x9')]=function(_0x2dbf93,_0x172c11){if(_0x2dbf93['user'][_0x9eb7('0x10')]!==_0x9eb7('0x11'))throw new Error(_0x9eb7('0x12'));if(isNaN(Number(_0x2dbf93[_0x9eb7('0x13')]['id'])))throw new Error(_0x9eb7('0x14'));return db[_0x9eb7('0x15')][_0x9eb7('0x16')]({'where':{'id':_0x2dbf93[_0x9eb7('0x13')]['id']}})[_0x9eb7('0xa')](handleEntityNotFound(_0x172c11,null))[_0x9eb7('0xa')](saveUpdates(_0x2dbf93[_0x9eb7('0x17')],null))[_0x9eb7('0xa')](respondWithResult(_0x172c11,null))[_0x9eb7('0x18')](handleError(_0x172c11,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 2e18d65..ebb1fa4 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 _0x50e3=['UserSetting','setMaxListeners','update','emit','hook','exports','events'];(function(_0x50353d,_0x21aed4){var _0x388f3c=function(_0x3c5774){while(--_0x3c5774){_0x50353d['push'](_0x50353d['shift']());}};_0x388f3c(++_0x21aed4);}(_0x50e3,0x156));var _0x350e=function(_0x4ea1c0,_0x151643){_0x4ea1c0=_0x4ea1c0-0x0;var _0x58ada1=_0x50e3[_0x4ea1c0];return _0x58ada1;};'use strict';var EventEmitter=require(_0x350e('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x350e('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x350e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x350e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2ad77d){return function(_0x332bcf,_0x2c026f,_0x210057){UserSettingEvents[_0x350e('0x4')](_0x2ad77d+':'+_0x332bcf['id'],_0x332bcf);UserSettingEvents['emit'](_0x2ad77d,_0x332bcf);_0x210057(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x350e('0x5')](e,emitEvent(event));}}module[_0x350e('0x6')]=UserSettingEvents; \ No newline at end of file +var _0xa76f=['hasOwnProperty','exports','events','UserSetting','setMaxListeners','save','update','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa76f,0x1a9));var _0xfa76=function(_0x41d161,_0x34d21e){_0x41d161=_0x41d161-0x0;var _0x469496=_0xa76f[_0x41d161];return _0x469496;};'use strict';var EventEmitter=require(_0xfa76('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xfa76('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xfa76('0x2')](0x0);var events={'afterCreate':_0xfa76('0x3'),'afterUpdate':_0xfa76('0x4'),'afterDestroy':_0xfa76('0x5')};function emitEvent(_0x148d8c){return function(_0x4ed27d,_0x4d58be,_0x341fa5){UserSettingEvents[_0xfa76('0x6')](_0x148d8c+':'+_0x4ed27d['id'],_0x4ed27d);UserSettingEvents[_0xfa76('0x6')](_0x148d8c,_0x4ed27d);_0x341fa5(null);};}for(var e in events){if(events[_0xfa76('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xfa76('0x8')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 3c67e12..7c2e607 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 _0xbf6e=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','define'];(function(_0x3bb20a,_0x3520cd){var _0x5ca385=function(_0x21750f){while(--_0x21750f){_0x3bb20a['push'](_0x3bb20a['shift']());}};_0x5ca385(++_0x3520cd);}(_0xbf6e,0x149));var _0xebf6=function(_0x16959c,_0x18d771){_0x16959c=_0x16959c-0x0;var _0x40b1ee=_0xbf6e[_0x16959c];return _0x40b1ee;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x1f94d5){return _0x1f94d5[_0xebf6('0x0')](_0xebf6('0x1'),attributes,{'tableName':_0xebf6('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x473e65){if(!_0x473e65[_0xebf6('0x3')])_0x473e65[_0xebf6('0x4')]=null;else if(_0x473e65['clientSideLoggingEnabledSince']===null)_0x473e65[_0xebf6('0x4')]=new Date();}}});}; \ No newline at end of file +var _0xf996=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','clientSideLoggingEnabled'];(function(_0x2172c9,_0x4c47fb){var _0x15b4af=function(_0x249194){while(--_0x249194){_0x2172c9['push'](_0x2172c9['shift']());}};_0x15b4af(++_0x4c47fb);}(_0xf996,0x74));var _0x6f99=function(_0x290b76,_0x34c610){_0x290b76=_0x290b76-0x0;var _0x172798=_0xf996[_0x290b76];return _0x172798;};'use strict';var attributes=require(_0x6f99('0x0'));module[_0x6f99('0x1')]=function(_0x31b31e){return _0x31b31e['define'](_0x6f99('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ceb57){if(!_0x5ceb57[_0x6f99('0x3')])_0x5ceb57[_0x6f99('0x4')]=null;else if(_0x5ceb57[_0x6f99('0x4')]===null)_0x5ceb57[_0x6f99('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 8fc9e13..95e4825 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 _0x34cc=['length','user-setting:','./user-setting.events','remove','update','user-setting:update','emit','user-setting:update:user-','register'];(function(_0x149325,_0x5e6be3){var _0x2c46d5=function(_0x4b66d6){while(--_0x4b66d6){_0x149325['push'](_0x149325['shift']());}};_0x2c46d5(++_0x5e6be3);}(_0x34cc,0xec));var _0xc34c=function(_0x446239,_0x3768f4){_0x446239=_0x446239-0x0;var _0x1b7ce9=_0x34cc[_0x446239];return _0x1b7ce9;};'use strict';var UserSettingEvents=require(_0xc34c('0x0'));var events=['save',_0xc34c('0x1'),_0xc34c('0x2')];function createListener(_0x16b12d,_0x51516d){return function(_0x1da4e1){_0x51516d['emit'](_0x16b12d,_0x1da4e1);if(_0x16b12d===_0xc34c('0x3')){_0x51516d[_0xc34c('0x4')](_0xc34c('0x5')+_0x1da4e1['UserId'],_0x1da4e1);}};}exports[_0xc34c('0x6')]=function(_0x4e4b12){for(var _0x4d673e=0x0,_0x3f2346=events[_0xc34c('0x7')];_0x4d673e<_0x3f2346;_0x4d673e++){var _0x574f5d=events[_0x4d673e];var _0x43b92d=createListener(_0xc34c('0x8')+_0x574f5d,_0x4e4b12);UserSettingEvents['on'](_0x574f5d,_0x43b92d);}}; \ No newline at end of file +var _0xb81f=['./user-setting.events','save','remove','update','user-setting:update','emit','UserId','length','user-setting:'];(function(_0x4823e2,_0x5c1129){var _0x4de846=function(_0x48ba4c){while(--_0x48ba4c){_0x4823e2['push'](_0x4823e2['shift']());}};_0x4de846(++_0x5c1129);}(_0xb81f,0x75));var _0xfb81=function(_0x2ca5c0,_0x34ef07){_0x2ca5c0=_0x2ca5c0-0x0;var _0x1d1420=_0xb81f[_0x2ca5c0];return _0x1d1420;};'use strict';var UserSettingEvents=require(_0xfb81('0x0'));var events=[_0xfb81('0x1'),_0xfb81('0x2'),_0xfb81('0x3')];function createListener(_0x3d2771,_0x486b01){return function(_0x3a4767){_0x486b01['emit'](_0x3d2771,_0x3a4767);if(_0x3d2771===_0xfb81('0x4')){_0x486b01[_0xfb81('0x5')]('user-setting:update:user-'+_0x3a4767[_0xfb81('0x6')],_0x3a4767);}};}exports['register']=function(_0x528e87){for(var _0x328017=0x0,_0x2b42c6=events[_0xfb81('0x7')];_0x328017<_0x2b42c6;_0x328017++){var _0x5a5654=events[_0x328017];var _0x384ba2=createListener(_0xfb81('0x8')+_0x5a5654,_0x528e87);UserSettingEvents['on'](_0x5a5654,_0x384ba2);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 8768dad..7d9a3c1 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 _0x25c7=['removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','/describe','get','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','create','/create_many','post','addQueues','diskStorage','join','root','%s-%s','now','file','/:id/login','login','/:id/logout','/:id/pause','pause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','delete','removeTeams','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts'];(function(_0xaca348,_0x4d3993){var _0x560057=function(_0x41e145){while(--_0x41e145){_0xaca348['push'](_0xaca348['shift']());}};_0x560057(++_0x4d3993);}(_0x25c7,0x73));var _0x725c=function(_0x12f0ab,_0x1d066e){_0x12f0ab=_0x12f0ab-0x0;var _0x5d81a1=_0x25c7[_0x12f0ab];return _0x5d81a1;};'use strict';var multer=require(_0x725c('0x0'));var util=require(_0x725c('0x1'));var path=require(_0x725c('0x2'));var timeout=require(_0x725c('0x3'));var express=require(_0x725c('0x4'));var router=express[_0x725c('0x5')]();var fs_extra=require(_0x725c('0x6'));var auth=require(_0x725c('0x7'));var interaction=require(_0x725c('0x8'));var config=require(_0x725c('0x9'));var controller=require(_0x725c('0xa'));router['get']('/',auth[_0x725c('0xb')](),controller[_0x725c('0xc')]);router['get'](_0x725c('0xd'),auth[_0x725c('0xb')](),controller['describe']);router[_0x725c('0xe')]('/whoami',auth['isAuthenticated'](),controller['whoami']);router['get']('/presence',auth[_0x725c('0xb')](),controller['getPresence']);router[_0x725c('0xe')](_0x725c('0xf'),auth[_0x725c('0xb')](),controller['show']);router['get'](_0x725c('0x10'),controller[_0x725c('0x11')]);router['get'](_0x725c('0x12'),auth[_0x725c('0xb')](),controller[_0x725c('0x13')]);router[_0x725c('0xe')](_0x725c('0x14'),auth[_0x725c('0xb')](),controller['getContacts']);router[_0x725c('0xe')](_0x725c('0x15'),auth[_0x725c('0xb')](),controller[_0x725c('0x16')]);router[_0x725c('0xe')](_0x725c('0x17'),auth[_0x725c('0xb')](),controller['getVoiceQueuesRt']);router[_0x725c('0xe')](_0x725c('0x18'),auth[_0x725c('0xb')](),controller[_0x725c('0x19')]);router[_0x725c('0xe')](_0x725c('0x1a'),auth[_0x725c('0xb')](),controller[_0x725c('0x1b')]);router[_0x725c('0xe')](_0x725c('0x1c'),auth[_0x725c('0xb')](),controller['getScreenRecordings']);router[_0x725c('0xe')](_0x725c('0x1d'),auth['isAuthenticated'](),controller[_0x725c('0x1e')]);router[_0x725c('0xe')](_0x725c('0x1f'),auth[_0x725c('0xb')](),controller[_0x725c('0x20')]);router['get'](_0x725c('0x21'),auth['isAuthenticated'](),controller[_0x725c('0x22')]);router[_0x725c('0xe')](_0x725c('0x23'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x725c('0xe')](_0x725c('0x24'),auth[_0x725c('0xb')](),controller[_0x725c('0x25')]);router[_0x725c('0xe')](_0x725c('0x26'),auth[_0x725c('0xb')](),controller['getWhatsappInteractions']);router['get'](_0x725c('0x27'),auth['isAuthenticated'](),controller[_0x725c('0x28')]);router[_0x725c('0xe')](_0x725c('0x29'),auth[_0x725c('0xb')](),controller['getLists']);router[_0x725c('0xe')](_0x725c('0x2a'),auth[_0x725c('0xb')](),controller[_0x725c('0x2b')]);router[_0x725c('0xe')](_0x725c('0x2c'),auth['isAuthenticated'](),controller[_0x725c('0x2d')]);router[_0x725c('0xe')](_0x725c('0x2e'),auth[_0x725c('0xb')](),controller[_0x725c('0x2f')]);router[_0x725c('0xe')](_0x725c('0x30'),auth['isAuthenticated'](),controller['getMailAccounts']);router['get'](_0x725c('0x31'),auth['isAuthenticated'](),controller[_0x725c('0x32')]);router[_0x725c('0xe')](_0x725c('0x33'),auth['isAuthenticated'](),controller[_0x725c('0x34')]);router[_0x725c('0xe')](_0x725c('0x35'),auth[_0x725c('0xb')](),controller['getChatWebsites']);router[_0x725c('0xe')](_0x725c('0x36'),auth['isAuthenticated'](),controller[_0x725c('0x37')]);router['get']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x725c('0x38')]);router[_0x725c('0xe')](_0x725c('0x39'),auth[_0x725c('0xb')](),controller[_0x725c('0x3a')]);router['get']('/:id/api_key',auth[_0x725c('0xb')](),controller['getApiKey']);router['post'](_0x725c('0x14'),auth[_0x725c('0xb')](),controller['addContacts']);router['post']('/',auth[_0x725c('0xb')](),controller[_0x725c('0x3b')]);router['post'](_0x725c('0x3c'),auth[_0x725c('0xb')](),controller['bulkCreate']);router[_0x725c('0x3d')]('/:id/queues',auth[_0x725c('0xb')](),controller[_0x725c('0x3e')]);var upload=multer({'storage':multer[_0x725c('0x3f')]({'destination':function(_0x4cd4bb,_0x4b63dd,_0x6f1322){_0x6f1322(null,path[_0x725c('0x40')](config[_0x725c('0x41')],'server/files/images/'));},'filename':function(_0x576d9c,_0x1833b0,_0x535864){_0x535864(null,util['format'](_0x725c('0x42'),Date[_0x725c('0x43')](),_0x1833b0['originalname']));}})});router[_0x725c('0x3d')](_0x725c('0x10'),upload['single'](_0x725c('0x44')),controller['addAvatar']);router[_0x725c('0x3d')](_0x725c('0x45'),auth[_0x725c('0xb')](),controller[_0x725c('0x46')]);router[_0x725c('0x3d')](_0x725c('0x47'),auth[_0x725c('0xb')](),controller['logout']);router['post'](_0x725c('0x48'),auth[_0x725c('0xb')](),controller[_0x725c('0x49')]);router[_0x725c('0x3d')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x725c('0x4a')]);router[_0x725c('0x3d')](_0x725c('0x27'),auth[_0x725c('0xb')](),controller['addTeams']);router[_0x725c('0x3d')](_0x725c('0x4b'),auth[_0x725c('0xb')](),controller['addChatInteractions']);router[_0x725c('0x3d')](_0x725c('0x4c'),auth[_0x725c('0xb')](),controller[_0x725c('0x4d')]);router['post'](_0x725c('0x4e'),auth[_0x725c('0xb')](),controller[_0x725c('0x4f')]);router[_0x725c('0x3d')](_0x725c('0x50'),auth[_0x725c('0xb')](),controller[_0x725c('0x51')]);router['post'](_0x725c('0x52'),auth[_0x725c('0xb')](),controller['addOpenchannelInteractions']);router[_0x725c('0x3d')](_0x725c('0x53'),auth[_0x725c('0xb')](),controller[_0x725c('0x54')]);router['post'](_0x725c('0x2e'),auth[_0x725c('0xb')](),controller[_0x725c('0x55')]);router[_0x725c('0x3d')](_0x725c('0x30'),auth[_0x725c('0xb')](),controller['addMailAccounts']);router[_0x725c('0x3d')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x725c('0x56')]);router[_0x725c('0x3d')](_0x725c('0x33'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x725c('0x3d')](_0x725c('0x35'),auth[_0x725c('0xb')](),controller['addChatWebsites']);router[_0x725c('0x3d')](_0x725c('0x36'),auth[_0x725c('0xb')](),controller[_0x725c('0x57')]);router[_0x725c('0x3d')](_0x725c('0x58'),auth[_0x725c('0xb')](),controller[_0x725c('0x59')]);router[_0x725c('0x3d')](_0x725c('0x5a'),auth[_0x725c('0xb')](),controller[_0x725c('0x5b')]);router[_0x725c('0x5c')](_0x725c('0xf'),auth['isAuthenticated'](),controller[_0x725c('0x5d')]);router[_0x725c('0x5c')](_0x725c('0x5e'),auth['isAuthenticated'](),controller['changePassword']);router[_0x725c('0x5f')](_0x725c('0x15'),auth['isAuthenticated'](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0x725c('0xb')](),controller[_0x725c('0x60')]);router[_0x725c('0x5f')](_0x725c('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0x725c('0x5f')]('/:id/chat_interactions',auth[_0x725c('0xb')](),controller[_0x725c('0x61')]);router[_0x725c('0x5f')](_0x725c('0x4c'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x725c('0x5f')](_0x725c('0x4e'),auth[_0x725c('0xb')](),controller[_0x725c('0x62')]);router[_0x725c('0x5f')]('/:id/sms_interactions',auth[_0x725c('0xb')](),controller[_0x725c('0x63')]);router[_0x725c('0x5f')](_0x725c('0x52'),auth[_0x725c('0xb')](),controller['removeOpenchannelInteractions']);router[_0x725c('0x5f')](_0x725c('0x53'),auth[_0x725c('0xb')](),controller[_0x725c('0x64')]);router[_0x725c('0x5f')]('/:id/fax_accounts',auth[_0x725c('0xb')](),controller[_0x725c('0x65')]);router[_0x725c('0x5f')](_0x725c('0x30'),auth['isAuthenticated'](),controller[_0x725c('0x66')]);router[_0x725c('0x5f')](_0x725c('0x31'),auth[_0x725c('0xb')](),controller[_0x725c('0x67')]);router[_0x725c('0x5f')]('/:id/sms_accounts',auth[_0x725c('0xb')](),controller[_0x725c('0x68')]);router[_0x725c('0x5f')]('/:id/chat_websites',auth[_0x725c('0xb')](),controller['removeChatWebsites']);router['delete'](_0x725c('0x36'),auth[_0x725c('0xb')](),controller[_0x725c('0x69')]);router[_0x725c('0x5f')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0x725c('0x6a')]);router[_0x725c('0x5f')]('/:id/api_key',auth[_0x725c('0xb')](),controller[_0x725c('0x6b')]);module[_0x725c('0x6c')]=router; \ No newline at end of file +var _0xdd38=['addWhatsappInteractions','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','/describe','describe','whoami','get','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getScheduledCalls','getApiKey','/:id/contacts','addContacts','post','/:id/queues','diskStorage','join','root','server/files/images/','format','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd38,0x161));var _0x8dd3=function(_0x295898,_0x1c7f30){_0x295898=_0x295898-0x0;var _0x922943=_0xdd38[_0x295898];return _0x922943;};'use strict';var multer=require(_0x8dd3('0x0'));var util=require(_0x8dd3('0x1'));var path=require(_0x8dd3('0x2'));var timeout=require(_0x8dd3('0x3'));var express=require(_0x8dd3('0x4'));var router=express['Router']();var fs_extra=require(_0x8dd3('0x5'));var auth=require(_0x8dd3('0x6'));var interaction=require(_0x8dd3('0x7'));var config=require('../../config/environment');var controller=require(_0x8dd3('0x8'));router['get']('/',auth[_0x8dd3('0x9')](),controller['index']);router['get'](_0x8dd3('0xa'),auth['isAuthenticated'](),controller[_0x8dd3('0xb')]);router['get']('/whoami',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0xc')]);router[_0x8dd3('0xd')]('/presence',auth[_0x8dd3('0x9')](),controller['getPresence']);router[_0x8dd3('0xd')](_0x8dd3('0xe'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0xf')]);router[_0x8dd3('0xd')](_0x8dd3('0x10'),controller[_0x8dd3('0x11')]);router[_0x8dd3('0xd')](_0x8dd3('0x12'),auth['isAuthenticated'](),controller[_0x8dd3('0x13')]);router['get']('/:id/contacts',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x14')]);router[_0x8dd3('0xd')]('/:id/queues',auth['isAuthenticated'](),controller[_0x8dd3('0x15')]);router[_0x8dd3('0xd')](_0x8dd3('0x16'),auth['isAuthenticated'](),controller[_0x8dd3('0x17')]);router['get']('/:id/groups',auth[_0x8dd3('0x9')](),controller['getGroups']);router['get'](_0x8dd3('0x18'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x19')]);router[_0x8dd3('0xd')](_0x8dd3('0x1a'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x1b')]);router['get']('/:id/chat/interactions',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x1c')]);router[_0x8dd3('0xd')]('/:id/openchannel/interactions',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x1d')]);router[_0x8dd3('0xd')](_0x8dd3('0x1e'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x1f')]);router['get'](_0x8dd3('0x20'),auth['isAuthenticated'](),controller[_0x8dd3('0x21')]);router[_0x8dd3('0xd')]('/:id/fax/interactions',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x22')]);router[_0x8dd3('0xd')](_0x8dd3('0x23'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x24')]);router[_0x8dd3('0xd')](_0x8dd3('0x25'),auth[_0x8dd3('0x9')](),controller['getTeams']);router[_0x8dd3('0xd')](_0x8dd3('0x26'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x27')]);router[_0x8dd3('0xd')](_0x8dd3('0x28'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8dd3('0xd')](_0x8dd3('0x29'),auth['isAuthenticated'](),controller[_0x8dd3('0x2a')]);router[_0x8dd3('0xd')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x8dd3('0x2b')]);router['get'](_0x8dd3('0x2c'),auth[_0x8dd3('0x9')](),controller['getMailAccounts']);router['get'](_0x8dd3('0x2d'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x2e')]);router[_0x8dd3('0xd')]('/:id/sms_accounts',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x2f')]);router['get'](_0x8dd3('0x30'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x31')]);router[_0x8dd3('0xd')]('/:id/whatsapp_accounts',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x32')]);router[_0x8dd3('0xd')](_0x8dd3('0x33'),auth[_0x8dd3('0x9')](),controller['getSquareProjects']);router['get']('/:id/scheduled_calls',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x34')]);router[_0x8dd3('0xd')]('/:id/api_key',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x35')]);router['post'](_0x8dd3('0x36'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x37')]);router[_0x8dd3('0x38')]('/',auth[_0x8dd3('0x9')](),controller['create']);router['post']('/create_many',auth[_0x8dd3('0x9')](),controller['bulkCreate']);router['post'](_0x8dd3('0x39'),auth[_0x8dd3('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x8dd3('0x3a')]({'destination':function(_0x343eab,_0x189691,_0x1137e2){_0x1137e2(null,path[_0x8dd3('0x3b')](config[_0x8dd3('0x3c')],_0x8dd3('0x3d')));},'filename':function(_0x533e95,_0xaeca40,_0x112a46){_0x112a46(null,util[_0x8dd3('0x3e')]('%s-%s',Date[_0x8dd3('0x3f')](),_0xaeca40[_0x8dd3('0x40')]));}})});router[_0x8dd3('0x38')](_0x8dd3('0x10'),upload[_0x8dd3('0x41')](_0x8dd3('0x42')),controller[_0x8dd3('0x43')]);router[_0x8dd3('0x38')](_0x8dd3('0x44'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x45')]);router[_0x8dd3('0x38')]('/:id/logout',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x46')]);router[_0x8dd3('0x38')](_0x8dd3('0x47'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x48')]);router[_0x8dd3('0x38')]('/:id/unpause',auth[_0x8dd3('0x9')](),controller['unpause']);router[_0x8dd3('0x38')]('/:id/teams',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x49')]);router[_0x8dd3('0x38')](_0x8dd3('0x4a'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x4b')]);router['post'](_0x8dd3('0x4c'),auth['isAuthenticated'](),controller[_0x8dd3('0x4d')]);router[_0x8dd3('0x38')](_0x8dd3('0x4e'),auth[_0x8dd3('0x9')](),controller['addFaxInteractions']);router['post'](_0x8dd3('0x4f'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x50')]);router['post'](_0x8dd3('0x51'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x52')]);router[_0x8dd3('0x38')]('/:id/whatsapp_interactions',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x53')]);router[_0x8dd3('0x38')]('/:id/fax_accounts',auth[_0x8dd3('0x9')](),controller['addFaxAccounts']);router[_0x8dd3('0x38')]('/:id/mail_accounts',auth[_0x8dd3('0x9')](),controller['addMailAccounts']);router[_0x8dd3('0x38')](_0x8dd3('0x2d'),auth['isAuthenticated'](),controller[_0x8dd3('0x54')]);router[_0x8dd3('0x38')](_0x8dd3('0x55'),auth['isAuthenticated'](),controller[_0x8dd3('0x56')]);router['post'](_0x8dd3('0x30'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x8dd3('0x38')]('/:id/whatsapp_accounts',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x57')]);router[_0x8dd3('0x38')](_0x8dd3('0x33'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x58')]);router[_0x8dd3('0x38')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8dd3('0x59')]);router[_0x8dd3('0x5a')](_0x8dd3('0xe'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x5b')]);router[_0x8dd3('0x5a')](_0x8dd3('0x5c'),auth[_0x8dd3('0x9')](),controller['changePassword']);router['delete'](_0x8dd3('0x39'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x5d')]);router[_0x8dd3('0x5e')](_0x8dd3('0x25'),auth[_0x8dd3('0x9')](),controller['removeTeams']);router[_0x8dd3('0x5e')](_0x8dd3('0xe'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x5f')]);router['delete'](_0x8dd3('0x4a'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x60')]);router[_0x8dd3('0x5e')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x8dd3('0x61')]);router[_0x8dd3('0x5e')](_0x8dd3('0x4e'),auth['isAuthenticated'](),controller[_0x8dd3('0x62')]);router['delete'](_0x8dd3('0x4f'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x63')]);router[_0x8dd3('0x5e')](_0x8dd3('0x51'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x64')]);router[_0x8dd3('0x5e')](_0x8dd3('0x65'),auth[_0x8dd3('0x9')](),controller['removeWhatsappInteractions']);router[_0x8dd3('0x5e')](_0x8dd3('0x66'),auth[_0x8dd3('0x9')](),controller['removeFaxAccounts']);router[_0x8dd3('0x5e')]('/:id/mail_accounts',auth[_0x8dd3('0x9')](),controller['removeMailAccounts']);router[_0x8dd3('0x5e')](_0x8dd3('0x2d'),auth[_0x8dd3('0x9')](),controller['removeOpenchannelAccounts']);router[_0x8dd3('0x5e')](_0x8dd3('0x55'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x67')]);router[_0x8dd3('0x5e')]('/:id/chat_websites',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x68')]);router[_0x8dd3('0x5e')](_0x8dd3('0x69'),auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x6a')]);router[_0x8dd3('0x5e')](_0x8dd3('0x33'),auth['isAuthenticated'](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x8dd3('0x9')](),controller[_0x8dd3('0x6b')]);module[_0x8dd3('0x6c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 805227d..8f67e3e 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 _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','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','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x3d2640,_0x53e4f2){var _0x4447ea=function(_0x5e9732){while(--_0x5e9732){_0x3d2640['push'](_0x3d2640['shift']());}};_0x4447ea(++_0x53e4f2);}(_0xedd9,0xfc));var _0x9edd=function(_0x365111,_0x1c536c){_0x365111=_0x365111-0x0;var _0x5d6090=_0xedd9[_0x365111];return _0x5d6090;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index ae4a0ac..f0f5ea0 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 _0x65c9=['$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$in','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','nonce','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','isEmpty','VoiceQueue','inbound','flatten','lower','asc','desc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','voiceStatus','slice','charAt','select','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','moment','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','request','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','emit','userNotification:recalc:','role','admin','Users','Agents','agent','Telephones','filter','ignore','map','value','includes','find','UserProfileResource','destroy','stack','name','send','index','User','rawAttributes','key','password','getOptions','where','includeAll','userSetting','true','include','UserSetting','push','findAll','query','chat','dataValues','sms','rows','fax','mail','whatsapp','show','params','model','differenceBy','keys','intersection','attributes','fields','length','merge','openchannel','all','catch','update','body','describe','addContacts','ids','internal','Setting','securePassword','max','isNil','min_internal','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)','sequelize','QueryTypes','from','mailbox','fullname','email','permissions','103','113','110','104','105','107','108','109','100','111','114','115','create','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','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','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','QueueId','voice','get','online','format','UserVoiceQueueRt','upsert','removeQueues','channel','isValidChannel','remove','Queues','Queue:remove','userpic','file','filename','join','server/files/images/','download','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','CmContact','order','sort','filters','pick','options','getContacts','hasOwnProperty','CmList','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','headers','x-forwarded-for','connection','socket','remoteAddress','getVoiceQueues','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','device','LOGININPAUSE','MemberReport','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','updateAttributes','getChannels','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','smsPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Queue:save','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','flattenDeep','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper'];(function(_0x282cf2,_0xca844c){var _0x5dada8=function(_0x350e9f){while(--_0x350e9f){_0x282cf2['push'](_0x282cf2['shift']());}};_0x5dada8(++_0xca844c);}(_0x65c9,0x1d7));var _0x965c=function(_0x678e07,_0x184eb3){_0x678e07=_0x678e07-0x0;var _0x5acae3=_0x65c9[_0x678e07];return _0x5acae3;};'use strict';var moment=require(_0x965c('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x965c('0x1'));var squel=require(_0x965c('0x2'));var jayson=require(_0x965c('0x3'));var Redis=require(_0x965c('0x4'));var authService=require(_0x965c('0x5'));var qs=require(_0x965c('0x6'));var logger=require(_0x965c('0x7'))('api');var utils=require(_0x965c('0x8'));var config=require(_0x965c('0x9'));var licenseUtil=require(_0x965c('0xa'));var APIBadRequestError=require('../../errors/api')[_0x965c('0xb')];var APINotFoundError=require(_0x965c('0xc'))[_0x965c('0xd')];var APIHandleError=require(_0x965c('0xc'))[_0x965c('0xe')];var db=require(_0x965c('0xf'))['db'];var socket=require(_0x965c('0x10'))(new Redis(config[_0x965c('0x11')]));require(_0x965c('0x12'))[_0x965c('0x13')](socket);config[_0x965c('0x11')]=_[_0x965c('0x14')](config[_0x965c('0x11')],{'host':_0x965c('0x15'),'port':0x18eb});var amiClient=jayson[_0x965c('0x16')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x302445,_0x3ed37b,_0x5c04b8,_0x48f681){return new Promise(function(_0x45d729,_0x31ac7a){var _0x4c20b8=_0x48f681||amiClient;return _0x4c20b8[_0x965c('0x17')](_0x302445,_0x5c04b8)[_0x965c('0x18')](function(_0x52a013){logger['info'](_0x965c('0x19'),_0x3ed37b,_0x965c('0x1a'));logger[_0x965c('0x1b')](_0x965c('0x1c'),_0x3ed37b,'request\x20sent',JSON['stringify'](_0x52a013));if(_0x52a013['error']){if(_0x52a013[_0x965c('0x1d')][_0x965c('0x1e')]===0x1f4){logger[_0x965c('0x1d')](_0x965c('0x19'),_0x3ed37b,_0x52a013['error'][_0x965c('0x1f')]);return _0x31ac7a(_0x52a013[_0x965c('0x1d')][_0x965c('0x1f')]);}logger[_0x965c('0x1d')](_0x965c('0x19'),_0x3ed37b,_0x52a013[_0x965c('0x1d')][_0x965c('0x1f')]);return _0x45d729(_0x52a013[_0x965c('0x1d')][_0x965c('0x1f')]);}else{logger[_0x965c('0x20')](_0x965c('0x19'),_0x3ed37b,_0x965c('0x1a'));_0x45d729(_0x52a013['result'][_0x965c('0x1f')]);}})['catch'](function(_0x346145){logger[_0x965c('0x1d')](_0x965c('0x19'),_0x3ed37b,_0x346145);_0x31ac7a(_0x346145);});});}function respondWithStatusCode(_0x242cbb,_0x1a3bcf){_0x1a3bcf=_0x1a3bcf||0xcc;return function(_0x5385ee){if(_0x5385ee){return _0x242cbb[_0x965c('0x21')](_0x1a3bcf);}return _0x242cbb[_0x965c('0x22')](_0x1a3bcf)[_0x965c('0x23')]();};}function respondWithResult(_0x5c0f56,_0x3d0687){_0x3d0687=_0x3d0687||0xc8;return function(_0xe1cb8f){if(_0xe1cb8f){return _0x5c0f56[_0x965c('0x22')](_0x3d0687)[_0x965c('0x24')](_0xe1cb8f);}};}function respondWithFilteredResult(_0x2715a6,_0x23a10b){return function(_0x3977e9){if(_0x3977e9){var _0x36888a=typeof _0x23a10b['offset']===_0x965c('0x25')&&typeof _0x23a10b[_0x965c('0x26')]==='undefined';var _0x56943b=_0x3977e9['count'];var _0x294ca3=_0x36888a?0x0:_0x23a10b[_0x965c('0x27')];var _0x4d919b=_0x36888a?_0x3977e9[_0x965c('0x28')]:_0x23a10b[_0x965c('0x27')]+_0x23a10b[_0x965c('0x26')];var _0x17b29b;if(_0x4d919b>=_0x56943b){_0x4d919b=_0x56943b;_0x17b29b=0xc8;}else{_0x17b29b=0xce;}_0x2715a6[_0x965c('0x22')](_0x17b29b);return _0x2715a6[_0x965c('0x29')](_0x965c('0x2a'),_0x294ca3+'-'+_0x4d919b+'/'+_0x56943b)[_0x965c('0x24')](_0x3977e9);}return null;};}function saveUpdates(_0x380660){return function(_0x2a63b7){if(_0x2a63b7){return _0x2a63b7['update'](_0x380660)[_0x965c('0x18')](function(_0x4dc39b){socket[_0x965c('0x2b')](_0x965c('0x2c')+_0x4dc39b['id'],{});return _0x4dc39b;});}return null;};}function removeEntity(_0x8c326f){return function(_0x242772){if(_0x242772){return _0x242772['destroy']()['then'](function(){var _0x532f09=_0x242772['get']({'plain':!![]});if(_0x532f09[_0x965c('0x2d')]===_0x965c('0x2e'))return;var _0x6918ee=[{'name':_0x965c('0x2f'),'value':'user','ignore':!![]},{'name':_0x965c('0x30'),'value':_0x965c('0x31'),'ignore':![]},{'name':_0x965c('0x32'),'value':'telephone','ignore':![]}];var _0x530434=_(_0x6918ee)[_0x965c('0x33')](_0x965c('0x34'))[_0x965c('0x35')](_0x965c('0x36'))[_0x965c('0x36')]();if(_[_0x965c('0x37')](_0x530434,_0x532f09[_0x965c('0x2d')])){return;}var _0x5cb888=_[_0x965c('0x38')](_0x6918ee,[_0x965c('0x36'),_0x532f09[_0x965c('0x2d')]])['name'];return db[_0x965c('0x39')][_0x965c('0x3a')]({'where':{'type':_0x5cb888,'resourceId':_0x532f09['id']}})[_0x965c('0x18')](function(){return _0x242772;});})[_0x965c('0x18')](function(){_0x8c326f[_0x965c('0x22')](0xcc)[_0x965c('0x23')]();});}};}function handleEntityNotFound(_0x33a8e5){return function(_0x21e7d9){if(!_0x21e7d9){_0x33a8e5[_0x965c('0x21')](0x194);}return _0x21e7d9;};}function handleError(_0x5425a3,_0x42c06f){_0x42c06f=_0x42c06f||0x1f4;return function(_0x4eecad){logger[_0x965c('0x1d')](_0x4eecad[_0x965c('0x3b')]);if(_0x4eecad[_0x965c('0x3c')]){delete _0x4eecad['name'];}_0x5425a3[_0x965c('0x22')](_0x42c06f)[_0x965c('0x3d')](_0x4eecad);};}exports[_0x965c('0x3e')]=function(_0x12d048,_0x86d7f4){var _0x50844c={},_0x1570a3={'count':0x0,'rows':[]};var _0x1e2b67=_(db[_0x965c('0x3f')][_0x965c('0x40')])[_0x965c('0x35')](function(_0x4c076e){return{'name':_0x4c076e['fieldName'],'type':_0x4c076e['type'][_0x965c('0x41')]};})[_0x965c('0x33')](function(_0x379224){return!_[_0x965c('0x37')]([_0x965c('0x42'),'salt'],_0x379224[_0x965c('0x3c')]);})[_0x965c('0x36')]();_0x50844c=qs[_0x965c('0x43')](_0x1e2b67,_0x12d048);var _0x441835={'where':_0x50844c[_0x965c('0x44')]};return db[_0x965c('0x3f')]['count'](_0x441835)[_0x965c('0x18')](function(_0x4f319b){_0x1570a3[_0x965c('0x28')]=_0x4f319b;if(_0x12d048['query'][_0x965c('0x45')]){_0x50844c['include']=[{'all':!![]}];}if(_0x12d048['query'][_0x965c('0x46')]===_0x965c('0x47')){_0x50844c[_0x965c('0x48')]=[{'model':db[_0x965c('0x49')],'as':_0x965c('0x46')}];}if(!_[_0x965c('0x37')](_0x50844c['attributes'],'id')){_0x50844c['attributes'][_0x965c('0x4a')]('id');}return db[_0x965c('0x3f')][_0x965c('0x4b')](_0x50844c);})[_0x965c('0x18')](function(_0xbebf56){_0x1570a3['rows']=_0xbebf56;if(_0x12d048[_0x965c('0x4c')]['openTabs']===_0x965c('0x47')){var _0x1c1b6d=[];for(var _0x1e80d9=0x0;_0x1e80d9<_0x1570a3['rows']['length'];_0x1e80d9++){_0x1c1b6d[_0x965c('0x4a')](get_open_tabs(_0x965c('0x4d'),_0x1570a3['rows'][_0x1e80d9][_0x965c('0x4e')]));_0x1c1b6d[_0x965c('0x4a')](get_open_tabs(_0x965c('0x4f'),_0x1570a3[_0x965c('0x50')][_0x1e80d9][_0x965c('0x4e')]));_0x1c1b6d[_0x965c('0x4a')](get_open_tabs(_0x965c('0x51'),_0x1570a3['rows'][_0x1e80d9][_0x965c('0x4e')]));_0x1c1b6d[_0x965c('0x4a')](get_open_tabs(_0x965c('0x52'),_0x1570a3[_0x965c('0x50')][_0x1e80d9][_0x965c('0x4e')]));_0x1c1b6d[_0x965c('0x4a')](get_open_tabs('openchannel',_0x1570a3[_0x965c('0x50')][_0x1e80d9]['dataValues']));_0x1c1b6d[_0x965c('0x4a')](get_open_tabs(_0x965c('0x53'),_0x1570a3[_0x965c('0x50')][_0x1e80d9]['dataValues']));}return Promise['all'](_0x1c1b6d)['then'](function(){return _0x1570a3;});}else{return _0x1570a3;}})[_0x965c('0x18')](respondWithFilteredResult(_0x86d7f4,_0x50844c))['catch'](handleError(_0x86d7f4,null));};exports[_0x965c('0x54')]=function(_0x100574,_0x419f6f){var _0x1b0abd={'raw':![],'where':{'id':_0x100574[_0x965c('0x55')]['id']}},_0x5d31be={};_0x5d31be[_0x965c('0x56')]=_[_0x965c('0x57')](_['keys'](db[_0x965c('0x3f')]['rawAttributes']),[_0x965c('0x42'),'salt']);_0x5d31be[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x100574['query']);_0x5d31be['filters']=_[_0x965c('0x59')](_0x5d31be[_0x965c('0x56')],_0x5d31be[_0x965c('0x4c')]);_0x1b0abd[_0x965c('0x5a')]=_['intersection'](_0x5d31be[_0x965c('0x56')],qs[_0x965c('0x5b')](_0x100574[_0x965c('0x4c')][_0x965c('0x5b')]));_0x1b0abd[_0x965c('0x5a')]=_0x1b0abd[_0x965c('0x5a')][_0x965c('0x5c')]?_0x1b0abd[_0x965c('0x5a')]:_0x5d31be[_0x965c('0x56')];if(_0x100574[_0x965c('0x4c')][_0x965c('0x45')]){_0x1b0abd[_0x965c('0x48')]=[{'all':!![]}];}if(_0x100574[_0x965c('0x4c')][_0x965c('0x46')]===_0x965c('0x47')){_0x1b0abd[_0x965c('0x48')]=[{'model':db[_0x965c('0x49')],'as':'userSetting'}];}_0x1b0abd=_[_0x965c('0x5d')]({},_0x1b0abd,_0x100574['options']);if(!_[_0x965c('0x37')](_0x1b0abd[_0x965c('0x5a')],'id')){_0x1b0abd[_0x965c('0x5a')]['push']('id');}return db[_0x965c('0x3f')][_0x965c('0x38')](_0x1b0abd)[_0x965c('0x18')](handleEntityNotFound(_0x419f6f,null))[_0x965c('0x18')](function(_0x4fe03d){var _0x3f483d=[];values=_0x4fe03d;if(_0x100574[_0x965c('0x4c')]['openTabs']==='true'){_0x3f483d[_0x965c('0x4a')](get_open_tabs('chat',_0x4fe03d[_0x965c('0x4e')]));_0x3f483d[_0x965c('0x4a')](get_open_tabs('sms',_0x4fe03d['dataValues']));_0x3f483d[_0x965c('0x4a')](get_open_tabs(_0x965c('0x5e'),_0x4fe03d['dataValues']));_0x3f483d['push'](get_open_tabs(_0x965c('0x53'),_0x4fe03d[_0x965c('0x4e')]));_0x3f483d['push'](get_open_tabs('fax',_0x4fe03d['dataValues']));_0x3f483d[_0x965c('0x4a')](get_open_tabs('mail',_0x4fe03d['dataValues']));return Promise[_0x965c('0x5f')](_0x3f483d);}else{return values;}})[_0x965c('0x18')](function(){return values;})[_0x965c('0x18')](respondWithResult(_0x419f6f,null))[_0x965c('0x60')](handleError(_0x419f6f,null));};exports[_0x965c('0x61')]=function(_0x4819a0,_0x2ca07e){if(_0x4819a0[_0x965c('0x62')]['id']){delete _0x4819a0[_0x965c('0x62')]['id'];}delete _0x4819a0[_0x965c('0x62')][_0x965c('0x2d')];return db['User'][_0x965c('0x38')]({'where':{'id':_0x4819a0['params']['id']}})['then'](handleEntityNotFound(_0x2ca07e,null))[_0x965c('0x18')](saveUpdates(_0x4819a0[_0x965c('0x62')],null))[_0x965c('0x18')](respondWithResult(_0x2ca07e,null))[_0x965c('0x60')](handleError(_0x2ca07e,null));};exports[_0x965c('0x63')]=function(_0x494f8b,_0x426daf){return db[_0x965c('0x3f')][_0x965c('0x63')]()[_0x965c('0x18')](respondWithResult(_0x426daf,null))[_0x965c('0x60')](handleError(_0x426daf,null));};exports[_0x965c('0x64')]=function(_0x57b2e9,_0x38f1d6){return db['User']['find']({'where':{'id':_0x57b2e9[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x38f1d6,null))['then'](function(_0x36a812){if(_0x36a812){return _0x36a812[_0x965c('0x64')](_0x57b2e9[_0x965c('0x62')]['ids'],_['omit'](_0x57b2e9['body'],[_0x965c('0x65'),'id'])||{});}})['then'](respondWithResult(_0x38f1d6,null))[_0x965c('0x60')](handleError(_0x38f1d6,null));};function validateUser(_0x292867){return new Promise(function(_0x3992c1,_0xa65b12){if(_0x292867[_0x965c('0x66')])return _0x3992c1(_0x292867);return db[_0x965c('0x67')]['findById'](0x1)[_0x965c('0x18')](function(_0x562495){if(_0x562495[_0x965c('0x68')])authService['validatePasswordPattern'](_0x292867[_0x965c('0x42')]);db[_0x965c('0x3f')][_0x965c('0x69')](_0x965c('0x66'))['then'](function(_0x973557){if(_[_0x965c('0x6a')](_0x973557)){_0x292867[_0x965c('0x66')]=_0x562495['min_internal']||0x1;return;}if(_[_0x965c('0x6a')](_0x562495[_0x965c('0x6b')])||_0x562495[_0x965c('0x6b')]===_0x973557){_0x292867[_0x965c('0x66')]=_0x973557+0x1;return;}if(_0x562495[_0x965c('0x6b')]>_0x973557){_0x292867[_0x965c('0x66')]=_0x562495[_0x965c('0x6b')];return;}return db['sequelize']['query'](_0x965c('0x6c'),{'type':db[_0x965c('0x6d')][_0x965c('0x6e')]['SELECT']})[_0x965c('0x18')](function(_0x1ac456){if(_0x1ac456&&_0x1ac456[_0x965c('0x5c')]){for(var _0x3e05cb=0x0,_0x28fb21=_0x1ac456[_0x965c('0x5c')];_0x3e05cb<_0x28fb21&&_[_0x965c('0x6a')](_0x292867[_0x965c('0x66')]);_0x3e05cb++){if(_0x562495[_0x965c('0x6b')]<=_0x1ac456[_0x3e05cb][_0x965c('0x6f')]){_0x292867['internal']=_0x1ac456[_0x3e05cb][_0x965c('0x6f')];}else if(_0x562495[_0x965c('0x6b')]>_0x1ac456[_0x3e05cb][_0x965c('0x6f')]&&_0x562495[_0x965c('0x6b')]<=_0x1ac456[_0x3e05cb]['to']){_0x292867[_0x965c('0x66')]=_0x562495[_0x965c('0x6b')];}}}if(_[_0x965c('0x6a')](_0x292867[_0x965c('0x66')])){_0x292867['internal']=_0x973557+0x1;}return _0x3992c1(_0x292867);});});})[_0x965c('0x60')](function(_0x34a0d9){_0xa65b12(_0x34a0d9);});});}function updateUser(_0x1e6cf0){return new Promise(function(_0x22fb07,_0x13ded3){try{if(_0x1e6cf0['voicemail']){_0x1e6cf0[_0x965c('0x70')]=_0x1e6cf0[_0x965c('0x66')];_0x1e6cf0['VoiceMail']={'mailbox':_0x1e6cf0[_0x965c('0x66')],'password':_0x1e6cf0[_0x965c('0x42')],'fullname':_0x1e6cf0[_0x965c('0x71')],'email':_0x1e6cf0[_0x965c('0x72')]};}if(_0x1e6cf0['role']===_0x965c('0x31')){if(!_0x1e6cf0['permissions'])_0x1e6cf0[_0x965c('0x73')]=['101','102',_0x965c('0x74'),_0x965c('0x75'),_0x965c('0x76'),_0x965c('0x77'),_0x965c('0x78'),'106',_0x965c('0x79'),_0x965c('0x7a'),_0x965c('0x7b'),_0x965c('0x7c'),_0x965c('0x7d'),_0x965c('0x7e'),_0x965c('0x7f')];}_0x22fb07(_0x1e6cf0);}catch(_0x4773b6){_0x13ded3(_0x4773b6);}});}exports[_0x965c('0x80')]=function(_0x5f5030,_0x1cb29b){if(_0x5f5030[_0x965c('0x81')][_0x965c('0x2d')]===_0x965c('0x31'))throw new Error('Unauthorized');if(_0x5f5030[_0x965c('0x62')][_0x965c('0x2d')]===_0x965c('0x81')&&_0x5f5030[_0x965c('0x81')][_0x965c('0x2d')]!==_0x965c('0x2e')){throw new Error(_0x965c('0x82'));}if(_0x5f5030[_0x965c('0x62')][_0x965c('0x2d')]===_0x965c('0x2e')&&_0x5f5030[_0x965c('0x81')]['role']!==_0x965c('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x965c('0x83')]([_0x5f5030[_0x965c('0x62')]])[_0x965c('0x18')](function(){return validateUser(_0x5f5030[_0x965c('0x62')]);})[_0x965c('0x18')](function(_0x980943){return updateUser(_0x980943)['then'](function(_0x926b4){if(_0x926b4[_0x965c('0x2d')]===_0x965c('0x2e')){_0x926b4['settingsEnabled']=_0x5f5030[_0x965c('0x81')][_0x965c('0x84')];delete _0x926b4[_0x965c('0x85')];}return _0x926b4;});})[_0x965c('0x18')](function(_0x20d1e2){return db['User'][_0x965c('0x80')](_0x20d1e2,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x965c('0x18')](function(_0x2eb60e){if(_0x5f5030[_0x965c('0x62')][_0x965c('0x2d')]===_0x965c('0x81'))return _0x2eb60e;if(_0x5f5030['user'][_0x965c('0x2d')]!==_0x965c('0x81'))return _0x2eb60e;return db[_0x965c('0x86')][_0x965c('0x38')]({'where':{'name':_0x2eb60e[_0x965c('0x2d')]===_0x965c('0x31')?_0x965c('0x30'):_0x965c('0x32'),'userProfileId':_0x5f5030[_0x965c('0x81')][_0x965c('0x85')]},'raw':!![]})[_0x965c('0x18')](function(_0x4cc678){if(!_0x4cc678||_0x4cc678['autoAssociation']!=0x0)return _0x2eb60e;return db['UserProfileResource'][_0x965c('0x80')]({'name':_0x2eb60e[_0x965c('0x3c')],'resourceId':_0x2eb60e['id'],'type':_0x4cc678['name'],'sectionId':_0x4cc678['id']},{})[_0x965c('0x18')](function(){return _0x2eb60e;});})[_0x965c('0x60')](function(_0x12d0b8){logger[_0x965c('0x1d')](_0x965c('0x87'),_0x12d0b8);throw _0x12d0b8;});})[_0x965c('0x18')](respondWithResult(_0x1cb29b,0xc9))[_0x965c('0x60')](handleError(_0x1cb29b,null));};exports[_0x965c('0x88')]=function(_0x2fa376,_0x3b45d0){var _0x2d077c=_0x2fa376['body'];var _0x91bbb4=[];if(_0x2fa376[_0x965c('0x81')][_0x965c('0x2d')]===_0x965c('0x31'))throw new Error('Unauthorized');if(_[_0x965c('0x89')](_0x2d077c,[_0x965c('0x2d'),_0x965c('0x81')])&&_0x2fa376[_0x965c('0x81')][_0x965c('0x2d')]!=='admin'){throw new Error(_0x965c('0x82'));}if(_[_0x965c('0x89')](_0x2d077c,[_0x965c('0x2d'),_0x965c('0x2e')])&&_0x2fa376[_0x965c('0x81')][_0x965c('0x2d')]!==_0x965c('0x2e')){throw new Error(_0x965c('0x8a'));}return licenseUtil['checkUserLimits'](_0x2d077c)[_0x965c('0x18')](function(){return validateUser(_0x2d077c[0x0]);})[_0x965c('0x18')](function(){for(var _0xba0e3=0x1;_0xba0e3<_0x2d077c[_0x965c('0x5c')];_0xba0e3++){var _0x38ca48=_0x2d077c[_0xba0e3-0x1][_0x965c('0x66')];if(!_0x2d077c[_0xba0e3][_0x965c('0x66')])_0x2d077c[_0xba0e3][_0x965c('0x66')]=_0x38ca48+0x1;_0x91bbb4['push'](validateUser(_0x2d077c[_0xba0e3]));}return Promise[_0x965c('0x5f')](_0x91bbb4);})[_0x965c('0x18')](function(){_0x91bbb4=[];for(var _0x40bd44=0x0;_0x40bd44<_0x2d077c[_0x965c('0x5c')];_0x40bd44++){_0x91bbb4[_0x965c('0x4a')](updateUser(_0x2d077c[_0x40bd44]));}return Promise['all'](_0x91bbb4);})[_0x965c('0x18')](function(){_0x91bbb4=_0x2d077c[_0x965c('0x35')](function(_0x53b732){return db['User']['create'](_0x53b732,{'include':[{'model':db[_0x965c('0x8b')],'as':_0x965c('0x8b')}]})[_0x965c('0x18')](function(_0x3a9c15){_0x53b732['id']=_0x3a9c15['id'];return _0x53b732;});});return Promise[_0x965c('0x5f')](_0x91bbb4);})['then'](function(_0x33cbfc){if(_0x2fa376[_0x965c('0x62')][_0x965c('0x2d')]===_0x965c('0x81'))return _0x33cbfc;if(_0x2fa376[_0x965c('0x81')][_0x965c('0x2d')]!==_0x965c('0x81'))return _0x33cbfc;var _0x414e10=_['some'](_0x33cbfc,function(_0x3dd72f){return _0x3dd72f[_0x965c('0x2d')]===_0x965c('0x31')||_0x3dd72f[_0x965c('0x2d')]==='telephone';});if(!_0x414e10)return _0x33cbfc;return db['UserProfileSection'][_0x965c('0x4b')]({'where':{'name':{'$or':[_0x965c('0x30'),_0x965c('0x32')]},'userProfileId':_0x2fa376[_0x965c('0x81')][_0x965c('0x85')]},'raw':!![]})[_0x965c('0x18')](function(_0x584d76){if(_['isEmpty'](_0x584d76)||!_['some'](_0x584d76,[_0x965c('0x8c'),0x0]))return _0x33cbfc;_0x91bbb4=[];var _0x1d50f6=_(_0x584d76)[_0x965c('0x35')](function(_0x55760a){if(_0x55760a[_0x965c('0x8c')]===0x1)return;return _0x55760a[_0x965c('0x3c')]==='Agents'?_0x965c('0x31'):'telephone';})[_0x965c('0x8d')]()[_0x965c('0x36')]();for(var _0x36d6ab=0x0;_0x36d6ab<_0x33cbfc[_0x965c('0x5c')];_0x36d6ab++){if(!_[_0x965c('0x37')](_0x1d50f6,_0x33cbfc[_0x36d6ab][_0x965c('0x2d')]))return;var _0x35830b=_0x33cbfc[_0x36d6ab]['role']===_0x965c('0x31')?_0x965c('0x30'):_0x965c('0x32');_0x91bbb4[_0x965c('0x4a')](db[_0x965c('0x39')][_0x965c('0x80')]({'name':_0x33cbfc[_0x36d6ab][_0x965c('0x3c')],'resourceId':_0x33cbfc[_0x36d6ab]['id'],'type':_0x35830b,'sectionId':_[_0x965c('0x38')](_0x584d76,[_0x965c('0x3c'),_0x35830b])['id']},{}));}return Promise['all'](_0x91bbb4);});})[_0x965c('0x18')](respondWithResult(_0x3b45d0,0xc9))[_0x965c('0x60')](handleError(_0x3b45d0,null));};exports[_0x965c('0x8e')]=function(_0x366edf,_0x2dc590){if(_0x366edf['body']['id']){delete _0x366edf[_0x965c('0x62')]['id'];}return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x366edf[_0x965c('0x55')]['id']}})[_0x965c('0x18')](function(_0x3d80b4){if(!_0x3d80b4)return null;if(_0x3d80b4['id']===_0x366edf[_0x965c('0x81')]['id']){if(!_0x366edf[_0x965c('0x62')][_0x965c('0x8f')]||!_0x366edf['body'][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0x93'));}if(!_0x3d80b4['authenticate'](_0x366edf[_0x965c('0x62')]['oldPassword'])){throw new db['Sequelize'][(_0x965c('0x92'))](_0x965c('0x94'));}if(_0x366edf['body'][_0x965c('0x8f')]===_0x366edf[_0x965c('0x62')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0x95'));}}else if(_0x366edf[_0x965c('0x81')][_0x965c('0x2d')]===_0x965c('0x2e')){if(!_0x366edf['body'][_0x965c('0x90')]){throw new db['Sequelize'][(_0x965c('0x92'))](_0x965c('0x96'));}}else if(_0x366edf[_0x965c('0x81')]['role']===_0x965c('0x81')){if(!_0x366edf[_0x965c('0x62')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3d80b4[_0x965c('0x2d')]!=='agent'){throw new db['Sequelize'][(_0x965c('0x92'))]('Unauthorized');}}else{throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0x97'));}return _0x3d80b4;})[_0x965c('0x18')](handleEntityNotFound(_0x2dc590,null))[_0x965c('0x18')](function(_0x396399){return db[_0x965c('0x67')][_0x965c('0x98')]({'attributes':['id','securePassword',_0x965c('0x99'),_0x965c('0x9a')]})['then'](function(_0x4eb071){if(_0x4eb071[_0x965c('0x68')])authService['validatePasswordPattern'](_0x366edf[_0x965c('0x62')][_0x965c('0x90')]);if(!_0x4eb071[_0x965c('0x99')]||!_0x396399[_0x965c('0x9b')])return _0x396399;authService[_0x965c('0x9c')](_0x366edf[_0x965c('0x62')][_0x965c('0x90')],_0x396399[_0x965c('0x9b')],_0x4eb071['passwordHistoryLimit']);return _0x396399;})[_0x965c('0x18')](saveUpdates({'password':_0x366edf[_0x965c('0x62')][_0x965c('0x90')],'passwordResetAt':_0x366edf[_0x965c('0x81')]['id']==_0x366edf[_0x965c('0x55')]['id']?moment():null,'previousPasswords':authService[_0x965c('0x9d')](_0x366edf['body']['newPassword'],_0x396399[_0x965c('0x9b')])},null));})[_0x965c('0x18')](respondWithResult(_0x2dc590,null))[_0x965c('0x60')](handleError(_0x2dc590,null));};exports[_0x965c('0x9e')]=function(_0x540f4f,_0x1df8de){var _0x3096b0=_0x540f4f[_0x965c('0x62')]['channel'];return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x540f4f['params']['id']},'attributes':['id',_0x965c('0x3c'),_0x965c('0x2d'),'online',_0x965c('0x9f'),_0x965c('0xa0'),_0x965c('0xa1')]})['then'](handleEntityNotFound(_0x1df8de,null))[_0x965c('0x18')](function(_0x1b4ea4){if(_0x1b4ea4){if(!utils['isValidChannel'](_0x3096b0)){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0xa2'));}return _0x1b4ea4[_0x965c('0xa3')+_[_0x965c('0xa4')](_0x3096b0[_0x965c('0xa5')]())+'Queues'](_0x540f4f['body'][_0x965c('0x65')],{'penalty':_0x540f4f[_0x965c('0x62')][_0x965c('0xa6')]||0x0})[_0x965c('0xa7')](function(_0x4c6831){for(var _0x4a0ce2=0x0;_0x4a0ce2<_0x540f4f[_0x965c('0x62')]['ids'][_0x965c('0x5c')];_0x4a0ce2+=0x1){var _0x5c5475={'UserId':Number(_0x540f4f[_0x965c('0x55')]['id'])};_0x5c5475[_['capitalize'](_0x3096b0[_0x965c('0xa5')]())+_0x965c('0xa8')]=Number(_0x540f4f['body'][_0x965c('0x65')][_0x4a0ce2]);socket[_0x965c('0x2b')](_0x965c('0x81')+_[_0x965c('0xa4')](_0x3096b0[_0x965c('0xa5')]())+'Queue:save',_0x5c5475);}return _0x4c6831;})['then'](function(){if(_0x3096b0===_0x965c('0xa9')){return db['VoiceQueue'][_0x965c('0x4b')]({'where':{'id':_0x540f4f[_0x965c('0x62')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x965c('0x18')](function(_0x2963ac){var _0x195ed6=_0x1b4ea4[_0x965c('0xaa')]({'plain':!![]});var _0x185f68=[];if(_0x3096b0===_0x965c('0xa9')&&_0x195ed6[_0x965c('0x2d')]==='agent'&&_0x195ed6[_0x965c('0xab')]){for(let _0x1f8cf1=0x0;_0x1f8cf1<_0x2963ac['length'];_0x1f8cf1+=0x1){_0x185f68['push']({'membername':_0x195ed6['name'],'UserId':_0x195ed6['id'],'queue_name':_0x2963ac[_0x1f8cf1][_0x965c('0x3c')],'VoiceQueueId':_0x2963ac[_0x1f8cf1]['id'],'interface':_['isNil'](_0x195ed6[_0x965c('0xa1')])?util[_0x965c('0xac')]('SIP/%s',_0x195ed6['name']):_0x195ed6[_0x965c('0xa1')],'paused':_0x195ed6[_0x965c('0xa0')]||![],'penalty':_0x540f4f['body'][_0x965c('0xa6')]||0x0});}return Promise[_0x965c('0x5f')](_0x185f68[_0x965c('0x35')](function(_0x295d44){return db[_0x965c('0xad')][_0x965c('0xae')](_0x295d44);}));}return _0x1b4ea4;});}})['then'](respondWithStatusCode(_0x1df8de,null))[_0x965c('0x60')](handleError(_0x1df8de,null));};exports[_0x965c('0xaf')]=function(_0x5e11ad,_0x1b5dc5){var _0x577aec,_0x18bacf;return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x5e11ad[_0x965c('0x55')]['id']},'attributes':['id',_0x965c('0x3c'),_0x965c('0x2d')]})[_0x965c('0x18')](handleEntityNotFound(_0x1b5dc5,null))[_0x965c('0x18')](function(_0x2db9e2){if(_0x2db9e2){_0x577aec=_0x2db9e2;if(!_0x5e11ad[_0x965c('0x4c')][_0x965c('0xb0')]||!utils[_0x965c('0xb1')](_0x5e11ad[_0x965c('0x4c')][_0x965c('0xb0')])){throw new db[(_0x965c('0x91'))]['ValidationError'](_0x965c('0xa2'));}return _0x2db9e2[_0x965c('0xb2')+_[_0x965c('0xa4')](_0x5e11ad['query'][_0x965c('0xb0')]['toLowerCase']())+_0x965c('0xb3')](_0x5e11ad[_0x965c('0x4c')]['ids']);}})[_0x965c('0x18')](function(_0x1ac647){if(_['isArray'](_0x5e11ad[_0x965c('0x4c')]['ids'])){for(var _0x126aef=0x0;_0x126aef<_0x5e11ad[_0x965c('0x4c')][_0x965c('0x65')][_0x965c('0x5c')];_0x126aef+=0x1){_0x18bacf={'UserId':Number(_0x5e11ad[_0x965c('0x55')]['id'])};_0x18bacf[_[_0x965c('0xa4')](_0x5e11ad[_0x965c('0x4c')][_0x965c('0xb0')][_0x965c('0xa5')]())+_0x965c('0xa8')]=Number(_0x5e11ad['query'][_0x965c('0x65')][_0x126aef]);socket[_0x965c('0x2b')](_0x965c('0x81')+_['capitalize'](_0x5e11ad[_0x965c('0x4c')][_0x965c('0xb0')][_0x965c('0xa5')]())+_0x965c('0xb4'),_0x18bacf);}}else{_0x18bacf={'UserId':Number(_0x5e11ad['params']['id'])};_0x18bacf[_[_0x965c('0xa4')](_0x5e11ad[_0x965c('0x4c')][_0x965c('0xb0')][_0x965c('0xa5')]())+_0x965c('0xa8')]=Number(_0x5e11ad[_0x965c('0x4c')][_0x965c('0x65')]);socket[_0x965c('0x2b')](_0x965c('0x81')+_[_0x965c('0xa4')](_0x5e11ad[_0x965c('0x4c')][_0x965c('0xb0')][_0x965c('0xa5')]())+_0x965c('0xb4'),_0x18bacf);}return _0x1ac647;})[_0x965c('0x18')](function(){if(_0x5e11ad[_0x965c('0x4c')][_0x965c('0xb0')]===_0x965c('0xa9')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x5e11ad[_0x965c('0x55')]['id'],'VoiceQueueId':_0x5e11ad[_0x965c('0x4c')][_0x965c('0x65')]},'individualHooks':!![]})[_0x965c('0x18')](function(){return _0x577aec;});}return _0x577aec;})[_0x965c('0x18')](respondWithStatusCode(_0x1b5dc5,null))['catch'](handleError(_0x1b5dc5,null));};exports['addAvatar']=function(_0x28b851,_0x45ae10){_0x28b851[_0x965c('0x62')][_0x965c('0xb5')]=_0x28b851[_0x965c('0xb6')][_0x965c('0xb7')];return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x28b851[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x45ae10,null))[_0x965c('0x18')](saveUpdates(_0x28b851[_0x965c('0x62')],null))[_0x965c('0x18')](respondWithResult(_0x45ae10,null))[_0x965c('0x60')](handleError(_0x45ae10,null));};exports['getAvatar']=function(_0x42a9bd,_0x329879){var _0x1b94d2=path[_0x965c('0xb8')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x42a9bd[_0x965c('0x55')]['id']},'attributes':['id',_0x965c('0xb5')],'raw':!![]})[_0x965c('0x18')](handleEntityNotFound(_0x329879,null))[_0x965c('0x18')](function(_0x20f8fd){if(_0x20f8fd){if(_[_0x965c('0x6a')](_0x20f8fd[_0x965c('0xb5')])){return _0x329879['download'](_0x1b94d2);}else{if(!fs['existsSync'](path['join'](config['root'],_0x965c('0xb9'),_0x20f8fd[_0x965c('0xb5')]))){return _0x329879[_0x965c('0xba')](_0x1b94d2);}return _0x329879[_0x965c('0xba')](path[_0x965c('0xb8')](config['root'],_0x965c('0xb9'),_0x20f8fd['userpic']));}}})['catch'](handleError(_0x329879,null));};exports['getOpenTabs']=function(_0x54286d,_0x209749){return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x54286d[_0x965c('0x55')]['id']},'attributes':['id']})[_0x965c('0x18')](handleEntityNotFound(_0x209749,null))['then'](function(_0x1ad480){var _0x5b996c=[];values=_0x1ad480['dataValues'];_0x5b996c[_0x965c('0x4a')](get_open_tabs(_0x965c('0x4d'),_0x1ad480[_0x965c('0x4e')]));_0x5b996c[_0x965c('0x4a')](get_open_tabs('sms',_0x1ad480[_0x965c('0x4e')]));_0x5b996c[_0x965c('0x4a')](get_open_tabs(_0x965c('0x5e'),_0x1ad480['dataValues']));_0x5b996c['push'](get_open_tabs(_0x965c('0x53'),_0x1ad480[_0x965c('0x4e')]));_0x5b996c['push'](get_open_tabs(_0x965c('0x51'),_0x1ad480['dataValues']));_0x5b996c[_0x965c('0x4a')](get_open_tabs('mail',_0x1ad480[_0x965c('0x4e')]));return Promise[_0x965c('0x5f')](_0x5b996c);})[_0x965c('0x18')](function(_0x2ccde2){if(_0x2ccde2){var _0x402bcb=_[_0x965c('0x35')](values[_0x965c('0xbb')],function(_0x4b002d){return{'channel':_0x965c('0xbc'),'id':_0x4b002d['id'],'createdAt':_0x4b002d['createdAt']};});var _0x7388e2=_['map'](values[_0x965c('0xbd')],function(_0x267540){return{'channel':_0x965c('0xbe'),'id':_0x267540['id'],'createdAt':_0x267540[_0x965c('0xbf')]};});var _0x4f7d75=_[_0x965c('0x35')](values[_0x965c('0xc0')],function(_0x52aaad){return{'channel':'OPENCHANNEL','id':_0x52aaad['id'],'createdAt':_0x52aaad[_0x965c('0xbf')]};});var _0x1d5a94=_[_0x965c('0x35')](values[_0x965c('0xc1')],function(_0x14f528){return{'channel':_0x965c('0xc2'),'id':_0x14f528['id'],'createdAt':_0x14f528['createdAt']};});var _0x27d3a9=_[_0x965c('0x35')](values[_0x965c('0xc3')],function(_0x517da9){return{'channel':_0x965c('0xc4'),'id':_0x517da9['id'],'createdAt':_0x517da9[_0x965c('0xbf')]};});var _0x153f6f=_['map'](values['WhatsappOpenTabs'],function(_0x3fde1b){return{'channel':_0x965c('0xc5'),'id':_0x3fde1b['id'],'createdAt':_0x3fde1b['createdAt']};});var _0x58c613=_[_0x965c('0xc6')](_0x402bcb,_0x7388e2,_0x4f7d75,_0x1d5a94,_0x27d3a9,_0x153f6f);var _0x58762c={'count':_0x58c613['length'],'rows':_0x58c613};return _0x58762c;}else return null;})[_0x965c('0x18')](respondWithResult(_0x209749,null))[_0x965c('0x60')](handleError(_0x209749,null));};exports['getContacts']=function(_0x27846a,_0x3c8cc8){var _0x2fabdf={};var _0x230cdf={};var _0xf114c4;var _0x37ab98;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x27846a[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x3c8cc8,null))['then'](function(_0x2992b9){if(_0x2992b9){_0xf114c4=_0x2992b9;_0x230cdf[_0x965c('0x56')]=_[_0x965c('0x58')](db[_0x965c('0xc7')][_0x965c('0x40')]);_0x230cdf[_0x965c('0x4c')]=_['keys'](_0x27846a[_0x965c('0x4c')]);_0x230cdf['filters']=_['intersection'](_0x230cdf[_0x965c('0x56')],_0x230cdf[_0x965c('0x4c')]);_0x2fabdf[_0x965c('0x5a')]=_['intersection'](_0x230cdf[_0x965c('0x56')],qs[_0x965c('0x5b')](_0x27846a[_0x965c('0x4c')][_0x965c('0x5b')]));_0x2fabdf[_0x965c('0x5a')]=_0x2fabdf['attributes'][_0x965c('0x5c')]?_0x2fabdf[_0x965c('0x5a')]:_0x230cdf[_0x965c('0x56')];_0x2fabdf[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x27846a[_0x965c('0x4c')][_0x965c('0xc9')]);_0x2fabdf[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x27846a[_0x965c('0x4c')],_0x230cdf['filters']));if(_0x27846a[_0x965c('0x4c')][_0x965c('0x33')]){_0x2fabdf[_0x965c('0x44')]=_[_0x965c('0x5d')](_0x2fabdf[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x2fabdf[_0x965c('0x5a')],function(_0x3f7e2b){var _0x31f911={};_0x31f911[_0x3f7e2b]={'$like':'%'+_0x27846a[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x31f911;})});}_0x2fabdf=_['merge']({},_0x2fabdf,_0x27846a[_0x965c('0xcc')]);return _0xf114c4[_0x965c('0xcd')](_0x2fabdf);}})[_0x965c('0x18')](function(_0x516c5d){if(_0x516c5d){_0x37ab98=_0x516c5d[_0x965c('0x5c')];if(_0x27846a[_0x965c('0x4c')][_0x965c('0xce')](_0x965c('0x45'))){_0x2fabdf[_0x965c('0x48')]=[{'model':db[_0x965c('0xcf')],'as':'List','required':![]},{'model':db[_0x965c('0xd0')],'as':_0x965c('0xd1'),'attributes':['id',_0x965c('0x3c'),_0x965c('0xd2')],'where':_0x27846a[_0x965c('0x4c')][_0x965c('0xd3')]?{'id':_0x27846a[_0x965c('0x4c')][_0x965c('0xd3')]}:undefined,'required':_0x27846a[_0x965c('0x4c')][_0x965c('0xd3')]?!![]:![]}];}if(!_0x27846a['query'][_0x965c('0xce')]('nolimit')){_0x2fabdf[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x27846a[_0x965c('0x4c')]['limit']);_0x2fabdf[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x27846a[_0x965c('0x4c')][_0x965c('0x27')]);}return _0xf114c4[_0x965c('0xcd')](_0x2fabdf);}})[_0x965c('0x18')](function(_0x28bad4){if(_0x28bad4){return _0x28bad4?{'count':_0x37ab98,'rows':_0x28bad4}:null;}})[_0x965c('0x18')](respondWithResult(_0x3c8cc8,null))[_0x965c('0x60')](handleError(_0x3c8cc8,null));};exports[_0x965c('0xd4')]=function(_0x39e431,_0x3f66f6){var _0x2ce089;var _0x150b91={};var _0x174bbb;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x39e431[_0x965c('0x55')]['id']},'attributes':['id',_0x965c('0x3c'),'role']})['then'](handleEntityNotFound(_0x3f66f6,null))['then'](function(_0x46e33f){if(!utils[_0x965c('0xb1')](_0x39e431[_0x965c('0x4c')][_0x965c('0xb0')])){throw new db[(_0x965c('0x91'))]['ValidationError']('Unknown\x20channel');}_0x2ce089=_0x46e33f;var _0x331470={};_0x331470['model']=_['keys'](db[_[_0x965c('0xa4')](_0x39e431[_0x965c('0x4c')]['channel'])+_0x965c('0xd5')][_0x965c('0x40')]);_0x331470[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x39e431[_0x965c('0x4c')]);_0x331470['filters']=_['intersection'](_0x331470[_0x965c('0x56')],_0x331470[_0x965c('0x4c')]);_0x150b91[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x331470[_0x965c('0x56')],qs[_0x965c('0x5b')](_0x39e431[_0x965c('0x4c')]['fields']));_0x150b91['attributes']=_0x150b91[_0x965c('0x5a')]['length']?_0x150b91[_0x965c('0x5a')]:_0x331470[_0x965c('0x56')];_0x150b91['order']=qs[_0x965c('0xc9')](_0x39e431[_0x965c('0x4c')][_0x965c('0xc9')]);_0x150b91[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x39e431[_0x965c('0x4c')],_0x331470['filters']));if(_0x39e431[_0x965c('0x4c')][_0x965c('0x33')]){_0x150b91[_0x965c('0x44')]=_['merge'](_0x150b91[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x150b91['attributes'],function(_0x48a18d){var _0x5b8fb4={};_0x5b8fb4[_0x48a18d]={'$like':'%'+_0x39e431['query'][_0x965c('0x33')]+'%'};return _0x5b8fb4;})});}_0x150b91=_[_0x965c('0x5d')]({},_0x150b91,_0x39e431['options']);switch(_0x2ce089[_0x965c('0x2d')]){case _0x965c('0x2e'):return db[_[_0x965c('0xa4')](_0x39e431[_0x965c('0x4c')][_0x965c('0xb0')])+_0x965c('0xd5')][_0x965c('0x4b')](_0x150b91);case _0x965c('0x81'):case _0x965c('0x31'):return _0x2ce089['get'+_[_0x965c('0xa4')](_0x39e431[_0x965c('0x4c')][_0x965c('0xb0')])+'Queues'](_0x150b91);default:throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0xd6'));}})[_0x965c('0x18')](function(_0x1f073d){_0x174bbb=_0x1f073d[_0x965c('0x5c')];if(!_0x39e431[_0x965c('0x4c')][_0x965c('0xce')](_0x965c('0xd7'))){_0x150b91[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x39e431[_0x965c('0x4c')][_0x965c('0x26')]);_0x150b91[_0x965c('0x27')]=qs['offset'](_0x39e431['query'][_0x965c('0x27')]);}switch(_0x2ce089[_0x965c('0x2d')]){case _0x965c('0x2e'):return db[_[_0x965c('0xa4')](_0x39e431[_0x965c('0x4c')][_0x965c('0xb0')])+_0x965c('0xd5')][_0x965c('0x4b')](_0x150b91);case _0x965c('0x81'):case'agent':return _0x2ce089[_0x965c('0xaa')+_[_0x965c('0xa4')](_0x39e431[_0x965c('0x4c')][_0x965c('0xb0')])+_0x965c('0xb3')](_0x150b91);}})[_0x965c('0x18')](function(_0x4572c9){return{'count':_0x174bbb,'rows':_0x4572c9};})[_0x965c('0x18')](respondWithResult(_0x3f66f6,null))[_0x965c('0x60')](handleError(_0x3f66f6,null));};exports['getVoiceQueuesRt']=function(_0x5dd3a5,_0xd1c2a2){var _0xacb925={};var _0x5d28ac={};var _0x5e72b6;var _0x35aa19;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x5dd3a5['params']['id']}})[_0x965c('0x18')](handleEntityNotFound(_0xd1c2a2,null))[_0x965c('0x18')](function(_0x404e2b){if(_0x404e2b){_0x5e72b6=_0x404e2b;_0x5d28ac[_0x965c('0x56')]=_['keys'](db[_0x965c('0xad')][_0x965c('0x40')]);_0x5d28ac['query']=_[_0x965c('0x58')](_0x5dd3a5[_0x965c('0x4c')]);_0x5d28ac[_0x965c('0xca')]=_['intersection'](_0x5d28ac[_0x965c('0x56')],_0x5d28ac[_0x965c('0x4c')]);_0xacb925['attributes']=_['intersection'](_0x5d28ac[_0x965c('0x56')],qs[_0x965c('0x5b')](_0x5dd3a5[_0x965c('0x4c')][_0x965c('0x5b')]));_0xacb925[_0x965c('0x5a')]=_0xacb925['attributes'][_0x965c('0x5c')]?_0xacb925[_0x965c('0x5a')]:_0x5d28ac['model'];_0xacb925[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x5dd3a5[_0x965c('0x4c')][_0x965c('0xc9')]);_0xacb925[_0x965c('0x44')]=qs[_0x965c('0xca')](_['pick'](_0x5dd3a5[_0x965c('0x4c')],_0x5d28ac[_0x965c('0xca')]));if(_0x5dd3a5[_0x965c('0x4c')][_0x965c('0x33')]){_0xacb925[_0x965c('0x44')]=_['merge'](_0xacb925[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0xacb925[_0x965c('0x5a')],function(_0x400bad){var _0x4a1837={};_0x4a1837[_0x400bad]={'$like':'%'+_0x5dd3a5[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x4a1837;})});}_0xacb925=_['merge']({},_0xacb925,_0x5dd3a5['options']);return _0x5e72b6[_0x965c('0xd8')](_0xacb925);}})[_0x965c('0x18')](function(_0x108841){if(_0x108841){_0x35aa19=_0x108841['length'];if(!_0x5dd3a5['query'][_0x965c('0xce')](_0x965c('0xd7'))){_0xacb925[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x5dd3a5[_0x965c('0x4c')][_0x965c('0x26')]);_0xacb925[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x5dd3a5['query'][_0x965c('0x27')]);}return _0x5e72b6['getVoiceQueuesRt'](_0xacb925);}})[_0x965c('0x18')](function(_0x89a482){if(_0x89a482){return _0x89a482?{'count':_0x35aa19,'rows':_0x89a482}:null;}})[_0x965c('0x18')](respondWithResult(_0xd1c2a2,null))['catch'](handleError(_0xd1c2a2,null));};exports[_0x965c('0xd9')]=function(_0x26f13c,_0x57a73b){var _0x4d2aab={};var _0x4acf9e={};var _0x2b7f47;var _0x42c4cd;return db[_0x965c('0x3f')]['findOne']({'where':{'id':_0x26f13c[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x57a73b,null))[_0x965c('0x18')](function(_0x411935){if(_0x411935){_0x2b7f47=_0x411935;_0x4acf9e['model']=_[_0x965c('0x58')](db[_0x965c('0xda')][_0x965c('0x40')]);_0x4acf9e[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x26f13c['query']);_0x4acf9e[_0x965c('0xca')]=_[_0x965c('0x59')](_0x4acf9e[_0x965c('0x56')],_0x4acf9e[_0x965c('0x4c')]);_0x4d2aab[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x4acf9e['model'],qs[_0x965c('0x5b')](_0x26f13c['query'][_0x965c('0x5b')]));_0x4d2aab['attributes']=_0x4d2aab[_0x965c('0x5a')][_0x965c('0x5c')]?_0x4d2aab[_0x965c('0x5a')]:_0x4acf9e[_0x965c('0x56')];_0x4d2aab['order']=qs[_0x965c('0xc9')](_0x26f13c['query'][_0x965c('0xc9')]);_0x4d2aab[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x26f13c[_0x965c('0x4c')],_0x4acf9e['filters']));if(_0x26f13c[_0x965c('0x4c')][_0x965c('0x33')]){_0x4d2aab[_0x965c('0x44')]=_[_0x965c('0x5d')](_0x4d2aab[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x4d2aab[_0x965c('0x5a')],function(_0x15bd4a){var _0x4b4da7={};_0x4b4da7[_0x15bd4a]={'$like':'%'+_0x26f13c[_0x965c('0x4c')]['filter']+'%'};return _0x4b4da7;})});}_0x4d2aab=_[_0x965c('0x5d')]({},_0x4d2aab,_0x26f13c[_0x965c('0xcc')]);return _0x2b7f47[_0x965c('0xd9')](_0x4d2aab);}})[_0x965c('0x18')](function(_0x28201e){if(_0x28201e){_0x42c4cd=_0x28201e['length'];if(!_0x26f13c[_0x965c('0x4c')]['hasOwnProperty']('nolimit')){_0x4d2aab['limit']=qs[_0x965c('0x26')](_0x26f13c[_0x965c('0x4c')][_0x965c('0x26')]);_0x4d2aab[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x26f13c['query']['offset']);}return _0x2b7f47['getGroups'](_0x4d2aab);}})[_0x965c('0x18')](function(_0x113332){if(_0x113332){return _0x113332?{'count':_0x42c4cd,'rows':_0x113332}:null;}})['then'](respondWithResult(_0x57a73b,null))[_0x965c('0x60')](handleError(_0x57a73b,null));};exports[_0x965c('0xdb')]=function(_0xc802cf,_0x341125){var _0x1c79b5={'raw':!![],'where':{}};var _0x1a9ee3={};var _0x4e8cb0={'count':0x0,'rows':[]};return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0xc802cf[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x341125,null))[_0x965c('0x18')](function(_0x399354){if(_0x399354){_0x1a9ee3['model']=_[_0x965c('0x58')](db['VoiceRecording'][_0x965c('0x40')]);_0x1a9ee3[_0x965c('0x4c')]=_[_0x965c('0x58')](_0xc802cf['query']);_0x1a9ee3[_0x965c('0xca')]=_['intersection'](_0x1a9ee3['model'],_0x1a9ee3[_0x965c('0x4c')]);_0x1c79b5[_0x965c('0x5a')]=_['intersection'](_0x1a9ee3[_0x965c('0x56')],qs[_0x965c('0x5b')](_0xc802cf['query'][_0x965c('0x5b')]));_0x1c79b5[_0x965c('0x5a')]=_0x1c79b5[_0x965c('0x5a')][_0x965c('0x5c')]?_0x1c79b5['attributes']:_0x1a9ee3[_0x965c('0x56')];if(!_0xc802cf['query']['hasOwnProperty'](_0x965c('0xd7'))){_0x1c79b5['limit']=qs[_0x965c('0x26')](_0xc802cf[_0x965c('0x4c')]['limit']);_0x1c79b5[_0x965c('0x27')]=qs[_0x965c('0x27')](_0xc802cf[_0x965c('0x4c')][_0x965c('0x27')]);}_0x1c79b5[_0x965c('0xc8')]=qs['sort'](_0xc802cf[_0x965c('0x4c')][_0x965c('0xc9')]);_0x1c79b5[_0x965c('0x44')]=qs[_0x965c('0xca')](_['pick'](_0xc802cf['query'],_0x1a9ee3['filters']));_0x1c79b5['where'][_0x965c('0xdc')]=_0x399354['id'];if(_0xc802cf['query']['filter']){_0x1c79b5[_0x965c('0x44')]=_[_0x965c('0x5d')](_0x1c79b5[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x1c79b5[_0x965c('0x5a')],function(_0x6250d3){var _0x12cc9d={};_0x12cc9d[_0x6250d3]={'$like':'%'+_0xc802cf['query'][_0x965c('0x33')]+'%'};return _0x12cc9d;})});}_0x1c79b5=_[_0x965c('0x5d')]({},_0x1c79b5,_0xc802cf[_0x965c('0xcc')]);return db['VoiceRecording'][_0x965c('0x28')]({'where':_0x1c79b5['where']})[_0x965c('0x18')](function(_0x594cef){_0x4e8cb0['count']=_0x594cef;if(_0xc802cf[_0x965c('0x4c')]['includeAll']){_0x1c79b5[_0x965c('0x48')]=[{'all':!![]}];}return db[_0x965c('0xdd')][_0x965c('0x4b')](_0x1c79b5);})[_0x965c('0x18')](function(_0x26e571){_0x4e8cb0['rows']=_0x26e571;return _0x4e8cb0;});}})[_0x965c('0x18')](respondWithFilteredResult(_0x341125,_0x1c79b5))[_0x965c('0x60')](handleError(_0x341125,null));};exports[_0x965c('0xde')]=function(_0x4cdb5f,_0x2601dd){var _0x562d04={'raw':!![],'where':{}};var _0x5d1ec5={};var _0x31776c={'count':0x0,'rows':[]};return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x4cdb5f[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x2601dd,null))[_0x965c('0x18')](function(_0x2584a5){if(_0x2584a5){_0x5d1ec5[_0x965c('0x56')]=_['keys'](db[_0x965c('0xdf')][_0x965c('0x40')]);_0x5d1ec5['query']=_[_0x965c('0x58')](_0x4cdb5f['query']);_0x5d1ec5[_0x965c('0xca')]=_[_0x965c('0x59')](_0x5d1ec5[_0x965c('0x56')],_0x5d1ec5[_0x965c('0x4c')]);_0x562d04[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x5d1ec5['model'],qs['fields'](_0x4cdb5f[_0x965c('0x4c')]['fields']));_0x562d04[_0x965c('0x5a')]=_0x562d04[_0x965c('0x5a')][_0x965c('0x5c')]?_0x562d04[_0x965c('0x5a')]:_0x5d1ec5[_0x965c('0x56')];if(!_0x4cdb5f[_0x965c('0x4c')]['hasOwnProperty'](_0x965c('0xd7'))){_0x562d04[_0x965c('0x26')]=qs['limit'](_0x4cdb5f['query'][_0x965c('0x26')]);_0x562d04[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x4cdb5f[_0x965c('0x4c')]['offset']);}_0x562d04['order']=qs[_0x965c('0xc9')](_0x4cdb5f['query'][_0x965c('0xc9')]);_0x562d04[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x4cdb5f[_0x965c('0x4c')],_0x5d1ec5[_0x965c('0xca')]));_0x562d04[_0x965c('0x44')]['UserId']=_0x2584a5['id'];if(_0x4cdb5f['query'][_0x965c('0x33')]){_0x562d04['where']=_[_0x965c('0x5d')](_0x562d04[_0x965c('0x44')],{'$or':_['map'](_0x562d04['attributes'],function(_0x1c8bd9){var _0x4d48da={};_0x4d48da[_0x1c8bd9]={'$like':'%'+_0x4cdb5f['query']['filter']+'%'};return _0x4d48da;})});}_0x562d04=_[_0x965c('0x5d')]({},_0x562d04,_0x4cdb5f[_0x965c('0xcc')]);return db[_0x965c('0xdf')][_0x965c('0x28')]({'where':_0x562d04[_0x965c('0x44')]})['then'](function(_0x3c8a0c){_0x31776c[_0x965c('0x28')]=_0x3c8a0c;if(_0x4cdb5f[_0x965c('0x4c')][_0x965c('0x45')]){_0x562d04[_0x965c('0x48')]=[{'all':!![]}];}return db[_0x965c('0xdf')]['findAll'](_0x562d04);})[_0x965c('0x18')](function(_0x312bb8){_0x31776c[_0x965c('0x50')]=_0x312bb8;return _0x31776c;});}})[_0x965c('0x18')](respondWithFilteredResult(_0x2601dd,_0x562d04))['catch'](handleError(_0x2601dd,null));};exports['getChatInteractions']=function(_0x26f021,_0x131d81){var _0x5e6caf={};var _0x1a6211={};var _0x3ff1e9;var _0x33455b;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x26f021[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x131d81,null))[_0x965c('0x18')](function(_0xa45531){if(_0xa45531){_0x3ff1e9=_0xa45531;_0x1a6211[_0x965c('0x56')]=_[_0x965c('0x58')](db[_0x965c('0xe0')]['rawAttributes']);_0x1a6211[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x26f021[_0x965c('0x4c')]);_0x1a6211['filters']=_[_0x965c('0x59')](_0x1a6211[_0x965c('0x56')],_0x1a6211['query']);_0x5e6caf[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x1a6211[_0x965c('0x56')],qs['fields'](_0x26f021['query'][_0x965c('0x5b')]));_0x5e6caf[_0x965c('0x5a')]=_0x5e6caf['attributes']['length']?_0x5e6caf['attributes']:_0x1a6211[_0x965c('0x56')];_0x5e6caf[_0x965c('0xc8')]=qs['sort'](_0x26f021[_0x965c('0x4c')]['sort']);_0x5e6caf[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x26f021[_0x965c('0x4c')],_0x1a6211[_0x965c('0xca')]));if(_0x26f021['query'][_0x965c('0x33')]){_0x5e6caf[_0x965c('0x44')]=_['merge'](_0x5e6caf['where'],{'$or':_[_0x965c('0x35')](_0x5e6caf[_0x965c('0x5a')],function(_0x34b3ee){var _0x33f77a={};_0x33f77a[_0x34b3ee]={'$like':'%'+_0x26f021[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x33f77a;})});}_0x5e6caf=_[_0x965c('0x5d')]({},_0x5e6caf,_0x26f021[_0x965c('0xcc')]);return _0x3ff1e9[_0x965c('0xe1')](_0x5e6caf);}})[_0x965c('0x18')](function(_0x2b7cd7){if(_0x2b7cd7){_0x33455b=_0x2b7cd7[_0x965c('0x5c')];if(!_0x26f021['query'][_0x965c('0xce')](_0x965c('0xd7'))){_0x5e6caf[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x26f021[_0x965c('0x4c')][_0x965c('0x26')]);_0x5e6caf['offset']=qs['offset'](_0x26f021['query'][_0x965c('0x27')]);}return _0x3ff1e9[_0x965c('0xe1')](_0x5e6caf);}})[_0x965c('0x18')](function(_0x3db1b0){if(_0x3db1b0){return _0x3db1b0?{'count':_0x33455b,'rows':_0x3db1b0}:null;}})[_0x965c('0x18')](respondWithResult(_0x131d81,null))[_0x965c('0x60')](handleError(_0x131d81,null));};exports[_0x965c('0xe2')]=function(_0x39af1c,_0x536065){var _0x15fcc2={};var _0x199cab={};var _0x4bcec5;var _0x3d0bdc;return db[_0x965c('0x3f')]['findOne']({'where':{'id':_0x39af1c[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x536065,null))[_0x965c('0x18')](function(_0x219f17){if(_0x219f17){_0x4bcec5=_0x219f17;_0x199cab[_0x965c('0x56')]=_[_0x965c('0x58')](db[_0x965c('0xe3')][_0x965c('0x40')]);_0x199cab[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x39af1c[_0x965c('0x4c')]);_0x199cab[_0x965c('0xca')]=_['intersection'](_0x199cab[_0x965c('0x56')],_0x199cab[_0x965c('0x4c')]);_0x15fcc2['attributes']=_['intersection'](_0x199cab['model'],qs[_0x965c('0x5b')](_0x39af1c['query'][_0x965c('0x5b')]));_0x15fcc2[_0x965c('0x5a')]=_0x15fcc2['attributes'][_0x965c('0x5c')]?_0x15fcc2[_0x965c('0x5a')]:_0x199cab[_0x965c('0x56')];_0x15fcc2[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x39af1c[_0x965c('0x4c')][_0x965c('0xc9')]);_0x15fcc2[_0x965c('0x44')]=qs[_0x965c('0xca')](_['pick'](_0x39af1c[_0x965c('0x4c')],_0x199cab[_0x965c('0xca')]));if(_0x39af1c[_0x965c('0x4c')][_0x965c('0x33')]){_0x15fcc2[_0x965c('0x44')]=_[_0x965c('0x5d')](_0x15fcc2[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x15fcc2[_0x965c('0x5a')],function(_0x3300cd){var _0x5aed5b={};_0x5aed5b[_0x3300cd]={'$like':'%'+_0x39af1c[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x5aed5b;})});}_0x15fcc2=_[_0x965c('0x5d')]({},_0x15fcc2,_0x39af1c[_0x965c('0xcc')]);return _0x4bcec5[_0x965c('0xe2')](_0x15fcc2);}})['then'](function(_0x10b543){if(_0x10b543){_0x3d0bdc=_0x10b543[_0x965c('0x5c')];if(!_0x39af1c[_0x965c('0x4c')][_0x965c('0xce')](_0x965c('0xd7'))){_0x15fcc2[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x39af1c['query'][_0x965c('0x26')]);_0x15fcc2[_0x965c('0x27')]=qs['offset'](_0x39af1c[_0x965c('0x4c')][_0x965c('0x27')]);}return _0x4bcec5[_0x965c('0xe2')](_0x15fcc2);}})[_0x965c('0x18')](function(_0x1f6a1b){if(_0x1f6a1b){return _0x1f6a1b?{'count':_0x3d0bdc,'rows':_0x1f6a1b}:null;}})['then'](respondWithResult(_0x536065,null))[_0x965c('0x60')](handleError(_0x536065,null));};exports[_0x965c('0xe4')]=function(_0x5d2fce,_0x13067c){var _0x554d0b={'raw':!![],'where':{}};var _0x1a1e4b={};var _0x24d26d={'count':0x0,'rows':[]};return db[_0x965c('0x3f')]['findOne']({'where':{'id':_0x5d2fce[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x13067c,null))[_0x965c('0x18')](function(_0x12a4ad){if(_0x12a4ad){_0x1a1e4b[_0x965c('0x56')]=_[_0x965c('0x58')](db[_0x965c('0xe5')][_0x965c('0x40')]);_0x1a1e4b['query']=_[_0x965c('0x58')](_0x5d2fce['query']);_0x1a1e4b[_0x965c('0xca')]=_[_0x965c('0x59')](_0x1a1e4b['model'],_0x1a1e4b[_0x965c('0x4c')]);_0x554d0b[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x1a1e4b['model'],qs['fields'](_0x5d2fce[_0x965c('0x4c')][_0x965c('0x5b')]));_0x554d0b[_0x965c('0x5a')]=_0x554d0b[_0x965c('0x5a')][_0x965c('0x5c')]?_0x554d0b['attributes']:_0x1a1e4b['model'];if(!_0x5d2fce[_0x965c('0x4c')][_0x965c('0xce')](_0x965c('0xd7'))){_0x554d0b['limit']=qs['limit'](_0x5d2fce['query'][_0x965c('0x26')]);_0x554d0b[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x5d2fce[_0x965c('0x4c')][_0x965c('0x27')]);}_0x554d0b[_0x965c('0xc8')]=qs['sort'](_0x5d2fce[_0x965c('0x4c')][_0x965c('0xc9')]);_0x554d0b['where']=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x5d2fce['query'],_0x1a1e4b[_0x965c('0xca')]));_0x554d0b[_0x965c('0x44')]['UserId']=_0x12a4ad['id'];if(_0x5d2fce[_0x965c('0x4c')][_0x965c('0x33')]){_0x554d0b['where']=_[_0x965c('0x5d')](_0x554d0b[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x554d0b[_0x965c('0x5a')],function(_0x2ecdd9){var _0x5338c0={};_0x5338c0[_0x2ecdd9]={'$like':'%'+_0x5d2fce[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x5338c0;})});}_0x554d0b=_['merge']({},_0x554d0b,_0x5d2fce[_0x965c('0xcc')]);return db[_0x965c('0xe5')][_0x965c('0x28')]({'where':_0x554d0b[_0x965c('0x44')]})[_0x965c('0x18')](function(_0x395e24){_0x24d26d[_0x965c('0x28')]=_0x395e24;if(_0x5d2fce[_0x965c('0x4c')][_0x965c('0x45')]){_0x554d0b[_0x965c('0x48')]=[{'all':!![]}];}return db['MailInteraction'][_0x965c('0x4b')](_0x554d0b);})[_0x965c('0x18')](function(_0x41c47d){_0x24d26d[_0x965c('0x50')]=_0x41c47d;return _0x24d26d;});}})[_0x965c('0x18')](respondWithFilteredResult(_0x13067c,_0x554d0b))[_0x965c('0x60')](handleError(_0x13067c,null));};exports[_0x965c('0xe6')]=function(_0x3b06de,_0x96ec22){var _0x3f6675={};var _0x3d8b22={};var _0x578278;var _0x55def4;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x3b06de[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x96ec22,null))[_0x965c('0x18')](function(_0x5aa202){if(_0x5aa202){_0x578278=_0x5aa202;_0x3d8b22[_0x965c('0x56')]=_[_0x965c('0x58')](db[_0x965c('0xe7')][_0x965c('0x40')]);_0x3d8b22[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x3b06de[_0x965c('0x4c')]);_0x3d8b22['filters']=_[_0x965c('0x59')](_0x3d8b22[_0x965c('0x56')],_0x3d8b22[_0x965c('0x4c')]);_0x3f6675[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x3d8b22['model'],qs[_0x965c('0x5b')](_0x3b06de[_0x965c('0x4c')]['fields']));_0x3f6675[_0x965c('0x5a')]=_0x3f6675[_0x965c('0x5a')][_0x965c('0x5c')]?_0x3f6675[_0x965c('0x5a')]:_0x3d8b22['model'];_0x3f6675[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x3b06de['query']['sort']);_0x3f6675[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x3b06de['query'],_0x3d8b22[_0x965c('0xca')]));if(_0x3b06de['query'][_0x965c('0x33')]){_0x3f6675['where']=_[_0x965c('0x5d')](_0x3f6675[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x3f6675[_0x965c('0x5a')],function(_0x309c46){var _0x32af97={};_0x32af97[_0x309c46]={'$like':'%'+_0x3b06de[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x32af97;})});}_0x3f6675=_[_0x965c('0x5d')]({},_0x3f6675,_0x3b06de[_0x965c('0xcc')]);return _0x578278[_0x965c('0xe6')](_0x3f6675);}})[_0x965c('0x18')](function(_0x1a8576){if(_0x1a8576){_0x55def4=_0x1a8576['length'];if(!_0x3b06de['query'][_0x965c('0xce')]('nolimit')){_0x3f6675[_0x965c('0x26')]=qs['limit'](_0x3b06de[_0x965c('0x4c')][_0x965c('0x26')]);_0x3f6675[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x3b06de['query'][_0x965c('0x27')]);}return _0x578278[_0x965c('0xe6')](_0x3f6675);}})[_0x965c('0x18')](function(_0x1651e3){if(_0x1651e3){return _0x1651e3?{'count':_0x55def4,'rows':_0x1651e3}:null;}})['then'](respondWithResult(_0x96ec22,null))[_0x965c('0x60')](handleError(_0x96ec22,null));};exports[_0x965c('0xe8')]=function(_0x50d750,_0x14ea48){var _0x5c668b={};var _0x40a046={};var _0x2863b4;var _0x161a1d;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x50d750[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x14ea48,null))[_0x965c('0x18')](function(_0x5b546e){if(_0x5b546e){_0x2863b4=_0x5b546e;_0x40a046[_0x965c('0x56')]=_[_0x965c('0x58')](db[_0x965c('0xe9')][_0x965c('0x40')]);_0x40a046[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x50d750[_0x965c('0x4c')]);_0x40a046['filters']=_[_0x965c('0x59')](_0x40a046[_0x965c('0x56')],_0x40a046[_0x965c('0x4c')]);_0x5c668b[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x40a046[_0x965c('0x56')],qs[_0x965c('0x5b')](_0x50d750['query']['fields']));_0x5c668b[_0x965c('0x5a')]=_0x5c668b[_0x965c('0x5a')]['length']?_0x5c668b[_0x965c('0x5a')]:_0x40a046[_0x965c('0x56')];_0x5c668b[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x50d750[_0x965c('0x4c')][_0x965c('0xc9')]);_0x5c668b['where']=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x50d750['query'],_0x40a046[_0x965c('0xca')]));if(_0x50d750['query'][_0x965c('0x33')]){_0x5c668b[_0x965c('0x44')]=_[_0x965c('0x5d')](_0x5c668b[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x5c668b[_0x965c('0x5a')],function(_0x28498a){var _0x1ec736={};_0x1ec736[_0x28498a]={'$like':'%'+_0x50d750[_0x965c('0x4c')]['filter']+'%'};return _0x1ec736;})});}_0x5c668b=_[_0x965c('0x5d')]({},_0x5c668b,_0x50d750[_0x965c('0xcc')]);return _0x2863b4[_0x965c('0xe8')](_0x5c668b);}})[_0x965c('0x18')](function(_0x28e779){if(_0x28e779){_0x161a1d=_0x28e779[_0x965c('0x5c')];if(!_0x50d750[_0x965c('0x4c')]['hasOwnProperty']('nolimit')){_0x5c668b[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x50d750[_0x965c('0x4c')]['limit']);_0x5c668b[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x50d750[_0x965c('0x4c')]['offset']);}return _0x2863b4[_0x965c('0xe8')](_0x5c668b);}})[_0x965c('0x18')](function(_0x3768d5){if(_0x3768d5){return _0x3768d5?{'count':_0x161a1d,'rows':_0x3768d5}:null;}})[_0x965c('0x18')](respondWithResult(_0x14ea48,null))[_0x965c('0x60')](handleError(_0x14ea48,null));};exports[_0x965c('0xea')]=function(_0x5420a8,_0x1f6060){var _0x59e8a9={};var _0x105f48={};var _0x85c70f;var _0x5c134a;return db[_0x965c('0x3f')]['findOne']({'where':{'id':_0x5420a8[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x1f6060,null))['then'](function(_0x3d77ac){if(_0x3d77ac){_0x85c70f=_0x3d77ac;_0x105f48[_0x965c('0x56')]=_[_0x965c('0x58')](db['WhatsappInteraction']['rawAttributes']);_0x105f48[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x5420a8['query']);_0x105f48[_0x965c('0xca')]=_['intersection'](_0x105f48[_0x965c('0x56')],_0x105f48['query']);_0x59e8a9[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x105f48[_0x965c('0x56')],qs[_0x965c('0x5b')](_0x5420a8[_0x965c('0x4c')]['fields']));_0x59e8a9[_0x965c('0x5a')]=_0x59e8a9['attributes']['length']?_0x59e8a9[_0x965c('0x5a')]:_0x105f48[_0x965c('0x56')];_0x59e8a9[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x5420a8[_0x965c('0x4c')][_0x965c('0xc9')]);_0x59e8a9[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x5420a8[_0x965c('0x4c')],_0x105f48['filters']));if(_0x5420a8[_0x965c('0x4c')]['filter']){_0x59e8a9['where']=_[_0x965c('0x5d')](_0x59e8a9['where'],{'$or':_[_0x965c('0x35')](_0x59e8a9[_0x965c('0x5a')],function(_0x246a28){var _0x5cca41={};_0x5cca41[_0x246a28]={'$like':'%'+_0x5420a8['query'][_0x965c('0x33')]+'%'};return _0x5cca41;})});}_0x59e8a9=_[_0x965c('0x5d')]({},_0x59e8a9,_0x5420a8['options']);return _0x85c70f[_0x965c('0xea')](_0x59e8a9);}})[_0x965c('0x18')](function(_0x41c493){if(_0x41c493){_0x5c134a=_0x41c493['length'];if(!_0x5420a8[_0x965c('0x4c')][_0x965c('0xce')](_0x965c('0xd7'))){_0x59e8a9[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x5420a8['query'][_0x965c('0x26')]);_0x59e8a9[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x5420a8['query']['offset']);}return _0x85c70f['getWhatsappInteractions'](_0x59e8a9);}})[_0x965c('0x18')](function(_0x582cf1){if(_0x582cf1){return _0x582cf1?{'count':_0x5c134a,'rows':_0x582cf1}:null;}})['then'](respondWithResult(_0x1f6060,null))[_0x965c('0x60')](handleError(_0x1f6060,null));};exports[_0x965c('0xeb')]=function(_0x25b6f0,_0x937cc7,_0x5e7790){var _0x47ffc7;var _0x2d6fae;var _0x1af014;var _0x2d6e8d=!_['isNil'](_0x25b6f0[_0x965c('0x55')]['id'])?_0x25b6f0[_0x965c('0x55')]['id']:!_[_0x965c('0x6a')](_0x25b6f0['user']['id'])?_0x25b6f0['user']['id']:null;return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x2d6e8d,'role':{'$or':[_0x965c('0x2e'),_0x965c('0x81'),'agent']}},'attributes':['id','name',_0x965c('0xec'),_0x965c('0xed'),_0x965c('0x2d'),'internal',_0x965c('0x9f')]})[_0x965c('0x18')](function(_0x38d151){if(_0x38d151){if(_0x38d151[_0x965c('0x2d')]===_0x965c('0x31')){_0x47ffc7=_0x38d151;if(_0x25b6f0[_0x965c('0x62')][_0x965c('0xa1')]){_0x1af014=util['format'](_0x965c('0xee'),_0x47ffc7[_0x25b6f0['body']['interface']]);}else if(_0x25b6f0[_0x965c('0x62')][_0x965c('0xef')]){_0x1af014=util[_0x965c('0xac')](_0x965c('0xf0'),_0x25b6f0[_0x965c('0x62')][_0x965c('0xef')]);}else{_0x1af014=util['format'](_0x965c('0xf0'),_0x47ffc7[_0x965c('0x3c')]);}socket['to'](util[_0x965c('0xac')]('user:%s',_0x47ffc7[_0x965c('0x3c')]))['emit']('user:forcelogout',{'user':{'id':_0x47ffc7['id'],'name':_0x47ffc7[_0x965c('0x3c')]},'ip':_0x25b6f0[_0x965c('0xf1')][_0x965c('0xf2')]||_0x25b6f0[_0x965c('0xf3')]['remoteAddress']||_0x25b6f0[_0x965c('0xf4')][_0x965c('0xf5')]||_0x25b6f0[_0x965c('0xf3')][_0x965c('0xf4')][_0x965c('0xf5')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x47ffc7[_0x965c('0x3c')]},'individualHooks':!![]});}}else{throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x965c('0x18')](function(){if(_0x47ffc7){return _0x47ffc7[_0x965c('0xf6')]({'raw':!![]});}})[_0x965c('0x18')](function(_0x38a165){if(_0x47ffc7){if(_0x38a165){_0x2d6fae=_0x38a165;if(_0x2d6fae[_0x965c('0x5c')]){var _0x136fae=_0x2d6fae[_0x965c('0x35')](function(_0x348180){var _0x51998e={'membername':_0x47ffc7['name'],'UserId':_0x47ffc7['id'],'queue_name':_0x348180[_0x965c('0x3c')],'VoiceQueueId':_0x348180['id'],'interface':_0x1af014,'paused':_0x47ffc7['loginInPause']||![],'penalty':_0x348180['UserVoiceQueue.penalty']||0x0};return db[_0x965c('0xad')][_0x965c('0xae')](_0x51998e);});return Promise[_0x965c('0x5f')](_0x136fae);}}}})[_0x965c('0x18')](function(){if(_0x47ffc7){return db['MemberReport'][_0x965c('0x4b')]({'where':{'membername':_0x47ffc7[_0x965c('0x3c')],'exitAt':null}});}})[_0x965c('0x18')](function(_0x5a8040){if(_0x47ffc7){var _0x172ba2=[];_0x5a8040['forEach'](function(_0x5c125c){_0x172ba2[_0x965c('0x4a')](_0x5c125c[_0x965c('0x61')]({'exitAt':moment()[_0x965c('0xac')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x965c('0x5f')](_0x172ba2);}})[_0x965c('0x18')](function(){if(_0x47ffc7){var _0x1d874a=[];var _0x498ba6=[];var _0xf3eb08=utils['getChannels']();var _0x53856b={'membername':_0x47ffc7[_0x965c('0x3c')],'interface':_0x1af014,'enterAt':moment()['format'](_0x965c('0xf7')),'role':_0x47ffc7[_0x965c('0x2d')],'internal':_0x47ffc7[_0x965c('0x66')]};_0xf3eb08[_0x965c('0xf8')](function(_0x3bbeb6){_0x1d874a[_0x965c('0x4a')](_[_0x965c('0x5d')]({'channel':_0x3bbeb6,'type':_0x965c('0xf9'),'data1':_0x25b6f0[_0x965c('0x62')][_0x965c('0xfa')],'data2':_0x1af014},_0x53856b));if(_0x47ffc7[_0x965c('0x9f')]){_0x498ba6[_0x965c('0x4a')](_[_0x965c('0x5d')]({'channel':_0x3bbeb6,'type':'PAUSE','data1':_0x965c('0xfb')},_0x53856b));}});return db[_0x965c('0xfc')][_0x965c('0x88')](_0x1d874a[_0x965c('0xc6')](_0x498ba6),{'individualHooks':!![]});}})[_0x965c('0x18')](function(){if(_0x47ffc7){return _0x47ffc7[_0x965c('0x61')]({'online':!![],'lastLoginAt':moment()[_0x965c('0xac')](_0x965c('0xf7')),'voicePause':_0x47ffc7['loginInPause']||![],'mailPause':_0x47ffc7[_0x965c('0x9f')]||![],'chatPause':_0x47ffc7['loginInPause']||![],'faxPause':_0x47ffc7['loginInPause']||![],'smsPause':_0x47ffc7['loginInPause']||![],'openchannelPause':_0x47ffc7[_0x965c('0x9f')]||![],'whatsappPause':_0x47ffc7[_0x965c('0x9f')]||![],'pauseType':_0x47ffc7['loginInPause']?'LOGININPAUSE':null,'interface':_0x1af014,'lastPauseAt':moment()[_0x965c('0xac')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x30787e){if(_0x25b6f0[_0x965c('0xfd')]){return _0x5e7790();}else{return Promise[_0x965c('0xfe')](_0x30787e)[_0x965c('0x18')](respondWithResult(_0x937cc7,null));}})[_0x965c('0x60')](handleError(_0x937cc7,null));};exports[_0x965c('0xff')]=function(_0x1d4fc1,_0x220149){var _0x18bf57;return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x1d4fc1[_0x965c('0x55')]['id'],'role':_0x965c('0x31')},'attributes':['id',_0x965c('0x3c'),_0x965c('0x2d')]})['then'](handleEntityNotFound(_0x220149,null))[_0x965c('0x18')](function(_0x75eca8){if(_0x75eca8){_0x18bf57=_0x75eca8;return db[_0x965c('0xad')][_0x965c('0x3a')]({'where':{'membername':_0x18bf57[_0x965c('0x3c')]},'individualHooks':!![]});}})['then'](function(){return db[_0x965c('0xfc')]['findAll']({'where':{'membername':_0x18bf57[_0x965c('0x3c')],'exitAt':null}});})['then'](function(_0x4e70b9){var _0x5c68af=[];_0x4e70b9['forEach'](function(_0x4f757d){_0x5c68af[_0x965c('0x4a')](_0x4f757d[_0x965c('0x61')]({'exitAt':moment()[_0x965c('0xac')](_0x965c('0xf7'))}));});return Promise[_0x965c('0x5f')](_0x5c68af);})[_0x965c('0x18')](function(){return _0x18bf57[_0x965c('0x61')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x965c('0x18')](respondWithResult(_0x220149,null))[_0x965c('0x60')](handleError(_0x220149,null));};exports[_0x965c('0x100')]=function(_0xc41340,_0x50bbb5){var _0x120ca8;return db[_0x965c('0xad')]['update']({'paused':0x1},{'where':{'UserId':_0xc41340['params']['id']},'individualHooks':!![]})[_0x965c('0x18')](function(){return db[_0x965c('0x3f')]['find']({'where':{'id':_0xc41340[_0x965c('0x55')]['id'],'role':_0x965c('0x31')},'attributes':['id','name',_0x965c('0x2d'),_0x965c('0x66'),_0x965c('0xa1'),_0x965c('0xab')]});})['then'](handleEntityNotFound(_0x50bbb5,null))[_0x965c('0x18')](function(_0x1b8e87){if(_0x1b8e87){_0x120ca8=_0x1b8e87;return respondWithRpcPromise(_0x965c('0x101'),_0x965c('0x100'),{'id':_0x120ca8['id'],'name':_0x120ca8['name'],'pause':!![]});}})[_0x965c('0x18')](function(){if(_0x120ca8){return db['MemberReport']['findAll']({'where':{'membername':_0x120ca8[_0x965c('0x3c')],'type':_0x965c('0x102'),'exitAt':null}});}})[_0x965c('0x18')](function(_0x5702ac){if(_0x5702ac[_0x965c('0x5c')]){var _0x1849eb=moment()[_0x965c('0xac')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ae76f=0x0,_0x21e09a=_0x5702ac[_0x965c('0x5c')];_0x5ae76f<_0x21e09a;_0x5ae76f++){_0x5702ac[_0x5ae76f][_0x965c('0x103')]({'exitAt':_0x1849eb});}}})[_0x965c('0x18')](function(){var _0x4f8da0=[];var _0x58af88=utils[_0x965c('0x104')]();_0x58af88[_0x965c('0xf8')](function(_0x4026a8){_0x4f8da0[_0x965c('0x4a')]({'channel':_0x4026a8,'membername':_0x120ca8['name'],'interface':_[_0x965c('0x6a')](_0x120ca8[_0x965c('0xa1')])?util[_0x965c('0xac')](_0x965c('0xf0'),_0x120ca8[_0x965c('0x3c')]):_0x120ca8[_0x965c('0xa1')],'type':_0x965c('0x102'),'enterAt':moment()[_0x965c('0xac')](_0x965c('0xf7')),'data1':_0xc41340['body'][_0x965c('0x105')]||_0x965c('0x106'),'role':_0x120ca8[_0x965c('0x2d')],'internal':_0x120ca8[_0x965c('0x66')]});});return db[_0x965c('0xfc')][_0x965c('0x88')](_0x4f8da0,{'individualHooks':!![]});})[_0x965c('0x18')](function(){return _0x120ca8[_0x965c('0x61')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xc41340[_0x965c('0x62')][_0x965c('0x105')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x965c('0xac')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x965c('0x18')](respondWithResult(_0x50bbb5,null))['catch'](handleError(_0x50bbb5,null));};exports[_0x965c('0x107')]=function(_0x56abf1,_0x37a51e){if(_0x56abf1[_0x965c('0x62')]['channel']&&!utils[_0x965c('0xb1')](_0x56abf1[_0x965c('0x62')][_0x965c('0xb0')])){throw new APIBadRequestError(util[_0x965c('0xac')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x56abf1[_0x965c('0x62')][_0x965c('0xb0')]));}return db[_0x965c('0x3f')][_0x965c('0x38')]({'where':{'id':_0x56abf1[_0x965c('0x55')]['id']},'attributes':['id',_0x965c('0x3c'),_0x965c('0x2d'),_0x965c('0x66'),_0x965c('0xa1'),_0x965c('0xab'),'voicePause',_0x965c('0x108'),_0x965c('0x109'),_0x965c('0x10a'),'openchannelPause',_0x965c('0x10b'),_0x965c('0x10c'),'pauseType',_0x965c('0x10d')]})[_0x965c('0x18')](function(_0x231e62){if(!_0x231e62){throw new APINotFoundError(util['format'](_0x965c('0x10e'),_0x56abf1['params']['id']));}return _0x231e62['unpause'](_0x56abf1['body'][_0x965c('0xb0')]);})[_0x965c('0x18')](respondWithResult(_0x37a51e,null))[_0x965c('0x60')](APIHandleError(_0x37a51e));};exports[_0x965c('0x10f')]=function(_0x4b0ee0,_0x367b00){var _0x487d2c={};var _0x5b3118={};var _0x41fba5;var _0x3ca249;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x4b0ee0['params']['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x367b00,null))['then'](function(_0x23bf77){if(_0x23bf77){_0x41fba5=_0x23bf77;_0x5b3118['model']=_[_0x965c('0x58')](db[_0x965c('0x110')][_0x965c('0x40')]);_0x5b3118[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x4b0ee0[_0x965c('0x4c')]);_0x5b3118[_0x965c('0xca')]=_['intersection'](_0x5b3118[_0x965c('0x56')],_0x5b3118[_0x965c('0x4c')]);_0x487d2c[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x5b3118['model'],qs[_0x965c('0x5b')](_0x4b0ee0[_0x965c('0x4c')][_0x965c('0x5b')]));_0x487d2c[_0x965c('0x5a')]=_0x487d2c[_0x965c('0x5a')][_0x965c('0x5c')]?_0x487d2c[_0x965c('0x5a')]:_0x5b3118[_0x965c('0x56')];_0x487d2c[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x4b0ee0[_0x965c('0x4c')][_0x965c('0xc9')]);_0x487d2c[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xcb')](_0x4b0ee0[_0x965c('0x4c')],_0x5b3118[_0x965c('0xca')]));if(_0x4b0ee0['query']['filter']){_0x487d2c[_0x965c('0x44')]=_['merge'](_0x487d2c['where'],{'$or':_[_0x965c('0x35')](_0x487d2c['attributes'],function(_0x51c3d4){var _0x5bc37d={};_0x5bc37d[_0x51c3d4]={'$like':'%'+_0x4b0ee0[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x5bc37d;})});}_0x487d2c=_[_0x965c('0x5d')]({},_0x487d2c,_0x4b0ee0[_0x965c('0xcc')]);return _0x41fba5['getTeams'](_0x487d2c);}})[_0x965c('0x18')](function(_0x566691){if(_0x566691){_0x3ca249=_0x566691[_0x965c('0x5c')];if(!_0x4b0ee0[_0x965c('0x4c')]['hasOwnProperty'](_0x965c('0xd7'))){_0x487d2c[_0x965c('0x26')]=qs['limit'](_0x4b0ee0['query'][_0x965c('0x26')]);_0x487d2c['offset']=qs['offset'](_0x4b0ee0[_0x965c('0x4c')][_0x965c('0x27')]);}return _0x41fba5[_0x965c('0x10f')](_0x487d2c);}})[_0x965c('0x18')](function(_0x3840d1){if(_0x3840d1){return _0x3840d1?{'count':_0x3ca249,'rows':_0x3840d1}:null;}})['then'](respondWithResult(_0x367b00,null))[_0x965c('0x60')](handleError(_0x367b00,null));};exports[_0x965c('0x111')]=function(_0x21f545,_0x47c108){var _0x30ca09=_0x21f545[_0x965c('0x55')]['id'];var _0x555f46=_0x21f545['body']?_0x21f545[_0x965c('0x62')][_0x965c('0x65')]:null;var _0x252aca=[];return Promise['resolve']()[_0x965c('0x18')](function(){if(!_0x555f46)throw new APIBadRequestError(_0x965c('0x112'));})[_0x965c('0x18')](function(){return db['User'][_0x965c('0x98')]({'where':{'id':_0x30ca09}});})['then'](function(_0xfebdfe){if(!_0xfebdfe)throw new APINotFoundError(util[_0x965c('0xac')](_0x965c('0x10e'),_0x21f545[_0x965c('0x55')]['id']));return db['sequelize'][_0x965c('0x113')](function(_0x1dd4aa){return _0xfebdfe[_0x965c('0x111')](_0x555f46,{'transaction':_0x1dd4aa})[_0x965c('0x18')](function(){return db[_0x965c('0x110')][_0x965c('0x4b')]({'where':{'id':{'$in':_0x555f46}}});})[_0x965c('0x18')](function(_0x296526){var _0x283500=_[_0x965c('0x35')](_0x296526,function(_0x16efaf){return _0x16efaf[_0x965c('0x114')]();});return Promise[_0x965c('0x5f')](_0x283500);})[_0x965c('0x18')](function(_0x5a1ac7){_0x252aca=_['flattenDeep'](_0x5a1ac7);var _0x13c25d=_[_0x965c('0x35')](_0x252aca,function(_0x1a7a77){return _0x1a7a77[_0x965c('0x115')](_0xfebdfe['id'],{'transaction':_0x1dd4aa});});return Promise[_0x965c('0x5f')](_0x13c25d);})['then'](function(){if(!_0xfebdfe['online'])return;var _0x264993=_['filter'](_0x252aca,function(_0x580d55){return _0x580d55[_0x965c('0x116')](_0x965c('0xb0'))===_0x965c('0x117');});var _0x55722e=_[_0x965c('0x35')](_0x264993,function(_0x452123){return db[_0x965c('0xad')][_0x965c('0xae')]({'membername':_0xfebdfe[_0x965c('0x3c')],'UserId':_0xfebdfe['id'],'queue_name':_0x452123[_0x965c('0x3c')],'VoiceQueueId':_0x452123['id'],'interface':_[_0x965c('0x6a')](_0xfebdfe[_0x965c('0xa1')])?util[_0x965c('0xac')](_0x965c('0xf0'),_0xfebdfe[_0x965c('0x3c')]):_0xfebdfe[_0x965c('0xa1')],'paused':_0xfebdfe[_0x965c('0xa0')]||![],'penalty':_0xfebdfe['penalty']},{'transaction':_0x1dd4aa});});return Promise[_0x965c('0x5f')](_0x55722e);})[_0x965c('0x18')](function(){return db[_0x965c('0x118')][_0x965c('0x4b')]({'where':{'teamId':{'$in':_0x555f46}}});})['then'](function(_0x35a2e1){var _0x497437=_[_0x965c('0x35')](_0x35a2e1,function(_0x393c24){return db[_0x965c('0x119')]['create']({'UserId':_0xfebdfe['id'],'VoicePrefixId':_0x393c24[_0x965c('0x11a')]},{'transaction':_0x1dd4aa});});return Promise['all'](_0x497437);});});})[_0x965c('0x18')](function(){for(var _0x1f8a46=0x0;_0x1f8a46<_0x252aca['length'];_0x1f8a46++){var _0x2e06a9=_0x252aca[_0x1f8a46][_0x965c('0x116')](_0x965c('0xb0'));var _0x29f201=_0x2e06a9+_0x965c('0xa8');socket[_0x965c('0x2b')](_0x965c('0x81')+_0x2e06a9+_0x965c('0x11b'),{'UserId':_0x30ca09,['queueField']:_0x252aca[_0x1f8a46]['id']});}})['then'](respondWithStatusCode(_0x47c108,null))['catch'](APIHandleError(_0x47c108));};exports['removeTeams']=function(_0xf3d10c,_0x48960d){var _0x2c85fd=_0xf3d10c[_0x965c('0x55')]['id'];var _0x11eac3=null;if(_0xf3d10c[_0x965c('0x4c')][_0x965c('0x65')]){_0x11eac3=_[_0x965c('0x11c')](_0xf3d10c[_0x965c('0x4c')][_0x965c('0x65')])?_0xf3d10c[_0x965c('0x4c')]['ids']:[_0xf3d10c[_0x965c('0x4c')][_0x965c('0x65')]];}var _0x29fa72=[];return Promise[_0x965c('0xfe')]()[_0x965c('0x18')](function(){if(!_0x11eac3)throw new APIBadRequestError(_0x965c('0x11d'));})[_0x965c('0x18')](function(){return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x2c85fd}});})[_0x965c('0x18')](function(_0xfaa6c1){if(!_0xfaa6c1)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0xf3d10c['params']['id']));return db[_0x965c('0x6d')]['transaction'](function(_0x531d4c){return _0xfaa6c1[_0x965c('0x11e')](_0x11eac3,{'transaction':_0x531d4c})[_0x965c('0x18')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x11eac3}}});})[_0x965c('0x18')](function(_0x43b6f3){var _0x2807d0=_[_0x965c('0x35')](_0x43b6f3,function(_0x1b0a35){return _0x1b0a35['getAssociatedQueues']();});return Promise[_0x965c('0x5f')](_0x2807d0);})[_0x965c('0x18')](function(_0x31031b){_0x29fa72=_[_0x965c('0x11f')](_0x31031b);var _0x265418=_[_0x965c('0x35')](_0x29fa72,function(_0x3077ea){return _0x3077ea[_0x965c('0x120')](_0xfaa6c1['id'],{'transaction':_0x531d4c});});return Promise[_0x965c('0x5f')](_0x265418);})[_0x965c('0x18')](function(){if(!_0xfaa6c1[_0x965c('0xab')])return;var _0x3833e1=_[_0x965c('0x33')](_0x29fa72,function(_0x54b4da){return _0x54b4da[_0x965c('0x116')]('channel')===_0x965c('0x117');});var _0x4acd87=_[_0x965c('0x35')](_0x3833e1,function(_0x311e78){return db['UserVoiceQueueRt'][_0x965c('0x3a')]({'where':{'VoiceQueueId':_0x311e78['id'],'UserId':_0xfaa6c1['id']},'transaction':_0x531d4c});});return Promise[_0x965c('0x5f')](_0x4acd87);})[_0x965c('0x18')](function(){return db[_0x965c('0x118')][_0x965c('0x4b')]({'where':{'teamId':{'$in':_0x11eac3}}});})[_0x965c('0x18')](function(_0x27d087){var _0x1af100=_[_0x965c('0x35')](_0x27d087,function(_0x5b8696){return db[_0x965c('0x119')][_0x965c('0x3a')]({'where':{'UserId':_0xfaa6c1['id'],'VoicePrefixId':_0x5b8696[_0x965c('0x11a')]}},{'transaction':_0x531d4c});});return Promise[_0x965c('0x5f')](_0x1af100);});});})[_0x965c('0x18')](function(){for(var _0xd42d67=0x0;_0xd42d67<_0x29fa72[_0x965c('0x5c')];_0xd42d67++){var _0x4e593f=_0x29fa72[_0xd42d67][_0x965c('0x116')](_0x965c('0xb0'));var _0x50d120=_0x4e593f+_0x965c('0xa8');socket[_0x965c('0x2b')](_0x965c('0x81')+_0x4e593f+_0x965c('0xb4'),{'UserId':_0x2c85fd,['queueField']:_0x29fa72[_0xd42d67]['id']});}})['then'](respondWithStatusCode(_0x48960d,null))['catch'](APIHandleError(_0x48960d));};exports[_0x965c('0x121')]=function(_0x1c74d9,_0x423cf1){var _0x5abf9d={};var _0x460d42={};var _0x1f18ee;var _0x43c100;return db[_0x965c('0x3f')]['findOne']({'where':{'id':_0x1c74d9[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x423cf1,null))[_0x965c('0x18')](function(_0x57562c){if(_0x57562c){_0x1f18ee=_0x57562c;_0x460d42[_0x965c('0x56')]=_[_0x965c('0x58')](db['CmList'][_0x965c('0x40')]);_0x460d42['query']=_['keys'](_0x1c74d9[_0x965c('0x4c')]);_0x460d42[_0x965c('0xca')]=_['intersection'](_0x460d42[_0x965c('0x56')],_0x460d42[_0x965c('0x4c')]);_0x5abf9d[_0x965c('0x5a')]=_[_0x965c('0x59')](_0x460d42[_0x965c('0x56')],qs['fields'](_0x1c74d9[_0x965c('0x4c')][_0x965c('0x5b')]));_0x5abf9d[_0x965c('0x5a')]=_0x5abf9d['attributes']['length']?_0x5abf9d[_0x965c('0x5a')]:_0x460d42[_0x965c('0x56')];_0x5abf9d[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x1c74d9['query']['sort']);_0x5abf9d[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x1c74d9[_0x965c('0x4c')],_0x460d42['filters']));if(_0x1c74d9['query'][_0x965c('0x33')]){_0x5abf9d['where']=_[_0x965c('0x5d')](_0x5abf9d[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0x5abf9d[_0x965c('0x5a')],function(_0x4a01c9){var _0x3cbe0f={};_0x3cbe0f[_0x4a01c9]={'$like':'%'+_0x1c74d9['query'][_0x965c('0x33')]+'%'};return _0x3cbe0f;})});}_0x5abf9d=_[_0x965c('0x5d')]({},_0x5abf9d,_0x1c74d9[_0x965c('0xcc')]);return _0x1f18ee['getLists'](_0x5abf9d);}})['then'](function(_0x5c791e){if(_0x5c791e){_0x43c100=_0x5c791e[_0x965c('0x5c')];if(!_0x1c74d9['query']['hasOwnProperty'](_0x965c('0xd7'))){_0x5abf9d[_0x965c('0x26')]=qs[_0x965c('0x26')](_0x1c74d9[_0x965c('0x4c')][_0x965c('0x26')]);_0x5abf9d[_0x965c('0x27')]=qs[_0x965c('0x27')](_0x1c74d9[_0x965c('0x4c')][_0x965c('0x27')]);}return _0x1f18ee[_0x965c('0x121')](_0x5abf9d);}})[_0x965c('0x18')](function(_0x4f0c11){if(_0x4f0c11){return _0x4f0c11?{'count':_0x43c100,'rows':_0x4f0c11}:null;}})[_0x965c('0x18')](respondWithResult(_0x423cf1,null))[_0x965c('0x60')](handleError(_0x423cf1,null));};exports[_0x965c('0x122')]=function(_0x1eb887,_0x1b5970){var _0xc664fd={};var _0x138ab6={};var _0x530e9a;return db[_0x965c('0x3f')][_0x965c('0x98')]({'where':{'id':_0x1eb887[_0x965c('0x55')]['id']}})[_0x965c('0x18')](handleEntityNotFound(_0x1b5970,null))[_0x965c('0x18')](function(_0x275986){if(_0x275986){_0x530e9a=_0x275986;_0x138ab6['model']=_[_0x965c('0x58')](db[_0x965c('0x3f')][_0x965c('0x40')]);_0x138ab6[_0x965c('0x4c')]=_[_0x965c('0x58')](_0x1eb887[_0x965c('0x4c')]);_0x138ab6[_0x965c('0xca')]=_[_0x965c('0x59')](_0x138ab6[_0x965c('0x56')],_0x138ab6['query']);_0xc664fd['attributes']=_[_0x965c('0x59')](_0x138ab6[_0x965c('0x56')],qs[_0x965c('0x5b')](_0x1eb887['query'][_0x965c('0x5b')]));_0xc664fd[_0x965c('0x5a')]=_0xc664fd['attributes'][_0x965c('0x5c')]?_0xc664fd[_0x965c('0x5a')]:_0x138ab6[_0x965c('0x56')];_0xc664fd[_0x965c('0xc8')]=qs[_0x965c('0xc9')](_0x1eb887[_0x965c('0x4c')][_0x965c('0xc9')]);_0xc664fd[_0x965c('0x44')]=qs[_0x965c('0xca')](_[_0x965c('0xcb')](_0x1eb887[_0x965c('0x4c')],_0x138ab6['filters']));if(_0x1eb887[_0x965c('0x4c')][_0x965c('0x33')]){_0xc664fd['where']=_[_0x965c('0x5d')](_0xc664fd[_0x965c('0x44')],{'$or':_[_0x965c('0x35')](_0xc664fd[_0x965c('0x5a')],function(_0x20ffef){var _0x3a4450={};_0x3a4450[_0x20ffef]={'$like':'%'+_0x1eb887[_0x965c('0x4c')][_0x965c('0x33')]+'%'};return _0x3a4450;})});}_0xc664fd['model']=db[_0x965c('0x3f')];_0xc664fd['as']='Agents';_0xc664fd=_[_0x965c('0x5d')]({},_0xc664fd,_0x1eb887[_0x965c('0xcc')]);return _0x530e9a[_0x965c('0xf6')]({'include':[_0xc664fd]});}})[_0x965c('0x18')](function(_0x5d4f84){if(_0x5d4f84){var _0x221b2d={},_0x44b06d=[];for(var _0x4cf6aa=0x0;_0x4cf6aa<_0x5d4f84[_0x965c('0x5c')];_0x4cf6aa+=0x1){for(var _0x57a769=0x0,_0x401eea;_0x57a769<_0x5d4f84[_0x4cf6aa]['Agents'][_0x965c('0x5c')];_0x57a769+=0x1){_0x401eea=_0x5d4f84[_0x4cf6aa][_0x965c('0x30')][_0x57a769]['get']({'plain':!![]});_0x221b2d[_0x401eea['id']]=_0x401eea;}}_0x221b2d=_['values'](_0x221b2d);for(var _0x68f3c3=qs[_0x965c('0x27')](_0x1eb887[_0x965c('0x4c')]['offset']);_0x68f3c3<_0x221b2d[_0x965c('0x5c')]&&_0x44b06d[_0x965c('0x5c')]=_0x385e07){_0x3a2111=_0x385e07;_0x17f7ec=0xc8;}else{_0x17f7ec=0xce;}_0x458e93['status'](_0x17f7ec);return _0x458e93['set'](_0xda65('0x29'),_0x5dc5f4+'-'+_0x3a2111+'/'+_0x385e07)[_0xda65('0x2a')](_0x3eae65);}return null;};}function saveUpdates(_0x3ec2db){return function(_0x153cea){if(_0x153cea){return _0x153cea['update'](_0x3ec2db)['then'](function(_0x1c8ea4){socket['emit']('userNotification:recalc:'+_0x1c8ea4['id'],{});return _0x1c8ea4;});}return null;};}function removeEntity(_0x45c0f3){return function(_0x3fb389){if(_0x3fb389){return _0x3fb389[_0xda65('0x2b')]()[_0xda65('0x1a')](function(){var _0x1434d9=_0x3fb389[_0xda65('0x2c')]({'plain':!![]});if(_0x1434d9[_0xda65('0x2d')]===_0xda65('0x2e'))return;var _0x4f09ec=[{'name':_0xda65('0x2f'),'value':_0xda65('0x30'),'ignore':!![]},{'name':_0xda65('0x31'),'value':_0xda65('0x32'),'ignore':![]},{'name':'Telephones','value':_0xda65('0x33'),'ignore':![]}];var _0xf1c2a0=_(_0x4f09ec)[_0xda65('0x34')](_0xda65('0x35'))['map']('value')['value']();if(_[_0xda65('0x36')](_0xf1c2a0,_0x1434d9['role'])){return;}var _0xffbf3d=_[_0xda65('0x37')](_0x4f09ec,[_0xda65('0x38'),_0x1434d9[_0xda65('0x2d')]])['name'];return db['UserProfileResource'][_0xda65('0x2b')]({'where':{'type':_0xffbf3d,'resourceId':_0x1434d9['id']}})[_0xda65('0x1a')](function(){return _0x3fb389;});})[_0xda65('0x1a')](function(){_0x45c0f3[_0xda65('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a106){return function(_0xa4f835){if(!_0xa4f835){_0x41a106['sendStatus'](0x194);}return _0xa4f835;};}function handleError(_0x2eed68,_0x22cad5){_0x22cad5=_0x22cad5||0x1f4;return function(_0xe45f48){logger[_0xda65('0x20')](_0xe45f48[_0xda65('0x39')]);if(_0xe45f48[_0xda65('0x3a')]){delete _0xe45f48[_0xda65('0x3a')];}_0x2eed68['status'](_0x22cad5)[_0xda65('0x3b')](_0xe45f48);};}exports[_0xda65('0x3c')]=function(_0xf8b6d6,_0x40cc7){var _0x464582={},_0x12a55f={'count':0x0,'rows':[]};var _0x15cad5=_(db[_0xda65('0x3d')][_0xda65('0x3e')])[_0xda65('0x3f')](function(_0x16611f){return{'name':_0x16611f[_0xda65('0x40')],'type':_0x16611f['type'][_0xda65('0x41')]};})['filter'](function(_0x3f4da7){return!_[_0xda65('0x36')](['password',_0xda65('0x42')],_0x3f4da7[_0xda65('0x3a')]);})[_0xda65('0x38')]();_0x464582=qs[_0xda65('0x43')](_0x15cad5,_0xf8b6d6);var _0x5e601e={'where':_0x464582[_0xda65('0x44')]};return db['User'][_0xda65('0x28')](_0x5e601e)[_0xda65('0x1a')](function(_0x28f174){_0x12a55f[_0xda65('0x28')]=_0x28f174;if(_0xf8b6d6[_0xda65('0x45')][_0xda65('0x46')]){_0x464582[_0xda65('0x47')]=[{'all':!![]}];}if(_0xf8b6d6['query'][_0xda65('0x48')]===_0xda65('0x49')){_0x464582[_0xda65('0x47')]=[{'model':db[_0xda65('0x4a')],'as':_0xda65('0x48')}];}if(!_[_0xda65('0x36')](_0x464582[_0xda65('0x4b')],'id')){_0x464582[_0xda65('0x4b')][_0xda65('0x4c')]('id');}return db['User'][_0xda65('0x4d')](_0x464582);})[_0xda65('0x1a')](function(_0x152ff8){_0x12a55f[_0xda65('0x4e')]=_0x152ff8;if(_0xf8b6d6[_0xda65('0x45')][_0xda65('0x4f')]===_0xda65('0x49')){var _0x5eb48e=[];for(var _0x11aa12=0x0;_0x11aa12<_0x12a55f[_0xda65('0x4e')]['length'];_0x11aa12++){_0x5eb48e['push'](get_open_tabs(_0xda65('0x50'),_0x12a55f[_0xda65('0x4e')][_0x11aa12][_0xda65('0x51')]));_0x5eb48e[_0xda65('0x4c')](get_open_tabs(_0xda65('0x52'),_0x12a55f[_0xda65('0x4e')][_0x11aa12][_0xda65('0x51')]));_0x5eb48e[_0xda65('0x4c')](get_open_tabs(_0xda65('0x53'),_0x12a55f[_0xda65('0x4e')][_0x11aa12][_0xda65('0x51')]));_0x5eb48e[_0xda65('0x4c')](get_open_tabs(_0xda65('0x54'),_0x12a55f[_0xda65('0x4e')][_0x11aa12][_0xda65('0x51')]));_0x5eb48e[_0xda65('0x4c')](get_open_tabs(_0xda65('0x55'),_0x12a55f['rows'][_0x11aa12][_0xda65('0x51')]));_0x5eb48e['push'](get_open_tabs('whatsapp',_0x12a55f['rows'][_0x11aa12][_0xda65('0x51')]));}return Promise['all'](_0x5eb48e)[_0xda65('0x1a')](function(){return _0x12a55f;});}else{return _0x12a55f;}})[_0xda65('0x1a')](respondWithFilteredResult(_0x40cc7,_0x464582))[_0xda65('0x56')](handleError(_0x40cc7,null));};exports['show']=function(_0x1a3b00,_0x1f5bc7){var _0x1d1c79={'raw':![],'where':{'id':_0x1a3b00['params']['id']}},_0x1c7dfc={};_0x1c7dfc['model']=_['differenceBy'](_[_0xda65('0x57')](db['User'][_0xda65('0x3e')]),[_0xda65('0x58'),_0xda65('0x42')]);_0x1c7dfc[_0xda65('0x45')]=_[_0xda65('0x57')](_0x1a3b00[_0xda65('0x45')]);_0x1c7dfc[_0xda65('0x59')]=_[_0xda65('0x5a')](_0x1c7dfc[_0xda65('0x5b')],_0x1c7dfc['query']);_0x1d1c79[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x1c7dfc[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x1a3b00[_0xda65('0x45')][_0xda65('0x5c')]));_0x1d1c79[_0xda65('0x4b')]=_0x1d1c79['attributes'][_0xda65('0x5d')]?_0x1d1c79[_0xda65('0x4b')]:_0x1c7dfc[_0xda65('0x5b')];if(_0x1a3b00[_0xda65('0x45')][_0xda65('0x46')]){_0x1d1c79[_0xda65('0x47')]=[{'all':!![]}];}if(_0x1a3b00[_0xda65('0x45')][_0xda65('0x48')]===_0xda65('0x49')){_0x1d1c79[_0xda65('0x47')]=[{'model':db[_0xda65('0x4a')],'as':_0xda65('0x48')}];}_0x1d1c79=_[_0xda65('0x5e')]({},_0x1d1c79,_0x1a3b00[_0xda65('0x5f')]);if(!_[_0xda65('0x36')](_0x1d1c79[_0xda65('0x4b')],'id')){_0x1d1c79[_0xda65('0x4b')][_0xda65('0x4c')]('id');}return db['User'][_0xda65('0x37')](_0x1d1c79)[_0xda65('0x1a')](handleEntityNotFound(_0x1f5bc7,null))[_0xda65('0x1a')](function(_0x3dca3f){var _0x2d1e76=[];values=_0x3dca3f;if(_0x1a3b00[_0xda65('0x45')]['openTabs']===_0xda65('0x49')){_0x2d1e76['push'](get_open_tabs(_0xda65('0x50'),_0x3dca3f['dataValues']));_0x2d1e76[_0xda65('0x4c')](get_open_tabs(_0xda65('0x52'),_0x3dca3f[_0xda65('0x51')]));_0x2d1e76['push'](get_open_tabs(_0xda65('0x55'),_0x3dca3f[_0xda65('0x51')]));_0x2d1e76[_0xda65('0x4c')](get_open_tabs('whatsapp',_0x3dca3f[_0xda65('0x51')]));_0x2d1e76['push'](get_open_tabs(_0xda65('0x53'),_0x3dca3f[_0xda65('0x51')]));_0x2d1e76['push'](get_open_tabs(_0xda65('0x54'),_0x3dca3f[_0xda65('0x51')]));return Promise[_0xda65('0x60')](_0x2d1e76);}else{return values;}})[_0xda65('0x1a')](function(){return values;})['then'](respondWithResult(_0x1f5bc7,null))['catch'](handleError(_0x1f5bc7,null));};exports[_0xda65('0x61')]=function(_0x2e99f6,_0x27127f){if(_0x2e99f6['body']['id']){delete _0x2e99f6[_0xda65('0x62')]['id'];}delete _0x2e99f6[_0xda65('0x62')][_0xda65('0x2d')];return db[_0xda65('0x3d')][_0xda65('0x37')]({'where':{'id':_0x2e99f6[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x27127f,null))[_0xda65('0x1a')](saveUpdates(_0x2e99f6[_0xda65('0x62')],null))[_0xda65('0x1a')](respondWithResult(_0x27127f,null))[_0xda65('0x56')](handleError(_0x27127f,null));};exports[_0xda65('0x64')]=function(_0x1d1fb,_0x5bbb95){return db['User'][_0xda65('0x64')]()[_0xda65('0x1a')](respondWithResult(_0x5bbb95,null))[_0xda65('0x56')](handleError(_0x5bbb95,null));};exports[_0xda65('0x65')]=function(_0x22d2bd,_0x38675f){return db[_0xda65('0x3d')]['find']({'where':{'id':_0x22d2bd[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x38675f,null))[_0xda65('0x1a')](function(_0x36a13a){if(_0x36a13a){return _0x36a13a['addContacts'](_0x22d2bd[_0xda65('0x62')][_0xda65('0x66')],_[_0xda65('0x67')](_0x22d2bd[_0xda65('0x62')],['ids','id'])||{});}})[_0xda65('0x1a')](respondWithResult(_0x38675f,null))['catch'](handleError(_0x38675f,null));};function validateUser(_0x72387d){return new Promise(function(_0x237e73,_0x256490){if(_0x72387d[_0xda65('0x68')])return _0x237e73(_0x72387d);return db[_0xda65('0x69')][_0xda65('0x6a')](0x1)[_0xda65('0x1a')](function(_0x29a527){if(_0x29a527[_0xda65('0x6b')])authService[_0xda65('0x6c')](_0x72387d[_0xda65('0x58')]);db['User'][_0xda65('0x6d')](_0xda65('0x68'))[_0xda65('0x1a')](function(_0xd4a287){if(_['isNil'](_0xd4a287)){_0x72387d['internal']=_0x29a527[_0xda65('0x6e')]||0x1;return;}if(_[_0xda65('0x6f')](_0x29a527[_0xda65('0x6e')])||_0x29a527[_0xda65('0x6e')]===_0xd4a287){_0x72387d[_0xda65('0x68')]=_0xd4a287+0x1;return;}if(_0x29a527[_0xda65('0x6e')]>_0xd4a287){_0x72387d[_0xda65('0x68')]=_0x29a527[_0xda65('0x6e')];return;}return db[_0xda65('0x70')][_0xda65('0x45')](_0xda65('0x71'),{'type':db[_0xda65('0x70')][_0xda65('0x72')]['SELECT']})[_0xda65('0x1a')](function(_0x4b20c0){if(_0x4b20c0&&_0x4b20c0[_0xda65('0x5d')]){for(var _0x87523a=0x0,_0x66cca9=_0x4b20c0[_0xda65('0x5d')];_0x87523a<_0x66cca9&&_[_0xda65('0x6f')](_0x72387d[_0xda65('0x68')]);_0x87523a++){if(_0x29a527[_0xda65('0x6e')]<=_0x4b20c0[_0x87523a][_0xda65('0x73')]){_0x72387d[_0xda65('0x68')]=_0x4b20c0[_0x87523a][_0xda65('0x73')];}else if(_0x29a527[_0xda65('0x6e')]>_0x4b20c0[_0x87523a]['from']&&_0x29a527[_0xda65('0x6e')]<=_0x4b20c0[_0x87523a]['to']){_0x72387d[_0xda65('0x68')]=_0x29a527['min_internal'];}}}if(_['isNil'](_0x72387d[_0xda65('0x68')])){_0x72387d[_0xda65('0x68')]=_0xd4a287+0x1;}return _0x237e73(_0x72387d);});});})[_0xda65('0x56')](function(_0x53e28f){_0x256490(_0x53e28f);});});}function updateUser(_0x33dee8){return new Promise(function(_0x403946,_0x5893d1){try{if(_0x33dee8[_0xda65('0x74')]){_0x33dee8['mailbox']=_0x33dee8[_0xda65('0x68')];_0x33dee8['VoiceMail']={'mailbox':_0x33dee8[_0xda65('0x68')],'password':_0x33dee8['password'],'fullname':_0x33dee8[_0xda65('0x75')],'email':_0x33dee8[_0xda65('0x76')]};}if(_0x33dee8[_0xda65('0x2d')]==='agent'){if(!_0x33dee8[_0xda65('0x77')])_0x33dee8[_0xda65('0x77')]=[_0xda65('0x78'),'102',_0xda65('0x79'),_0xda65('0x7a'),_0xda65('0x7b'),'104','105',_0xda65('0x7c'),'107','108',_0xda65('0x7d'),_0xda65('0x7e'),'111',_0xda65('0x7f'),_0xda65('0x80')];}_0x403946(_0x33dee8);}catch(_0x44b47f){_0x5893d1(_0x44b47f);}});}exports['create']=function(_0x4ce410,_0x37e5ae){if(_0x4ce410[_0xda65('0x30')][_0xda65('0x2d')]==='agent')throw new Error(_0xda65('0x81'));if(_0x4ce410[_0xda65('0x62')][_0xda65('0x2d')]===_0xda65('0x30')&&_0x4ce410[_0xda65('0x30')][_0xda65('0x2d')]!==_0xda65('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x4ce410[_0xda65('0x62')][_0xda65('0x2d')]==='admin'&&_0x4ce410[_0xda65('0x30')][_0xda65('0x2d')]!==_0xda65('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xda65('0x82')]([_0x4ce410[_0xda65('0x62')]])[_0xda65('0x1a')](function(){return validateUser(_0x4ce410['body']);})[_0xda65('0x1a')](function(_0x321077){return updateUser(_0x321077)[_0xda65('0x1a')](function(_0x19d68e){if(_0x19d68e[_0xda65('0x2d')]===_0xda65('0x2e')){_0x19d68e[_0xda65('0x83')]=_0x4ce410[_0xda65('0x30')][_0xda65('0x83')];delete _0x19d68e['userProfileId'];}return _0x19d68e;});})[_0xda65('0x1a')](function(_0xa2f5bd){return db['User'][_0xda65('0x84')](_0xa2f5bd,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0xda65('0x1a')](function(_0x5737e9){if(_0x4ce410[_0xda65('0x62')][_0xda65('0x2d')]===_0xda65('0x30'))return _0x5737e9;if(_0x4ce410['user']['role']!==_0xda65('0x30'))return _0x5737e9;return db[_0xda65('0x85')][_0xda65('0x37')]({'where':{'name':_0x5737e9[_0xda65('0x2d')]===_0xda65('0x32')?_0xda65('0x31'):_0xda65('0x86'),'userProfileId':_0x4ce410[_0xda65('0x30')][_0xda65('0x87')]},'raw':!![]})[_0xda65('0x1a')](function(_0x518cee){if(!_0x518cee||_0x518cee[_0xda65('0x88')]!=0x0)return _0x5737e9;return db['UserProfileResource'][_0xda65('0x84')]({'name':_0x5737e9[_0xda65('0x3a')],'resourceId':_0x5737e9['id'],'type':_0x518cee[_0xda65('0x3a')],'sectionId':_0x518cee['id']},{})['then'](function(){return _0x5737e9;});})[_0xda65('0x56')](function(_0x407a0b){logger[_0xda65('0x20')](_0xda65('0x89'),_0x407a0b);throw _0x407a0b;});})[_0xda65('0x1a')](respondWithResult(_0x37e5ae,0xc9))[_0xda65('0x56')](handleError(_0x37e5ae,null));};exports[_0xda65('0x8a')]=function(_0x16bc02,_0x47c20c){var _0x4ae909=_0x16bc02[_0xda65('0x62')];var _0x93c568=[];if(_0x16bc02[_0xda65('0x30')]['role']===_0xda65('0x32'))throw new Error(_0xda65('0x81'));if(_[_0xda65('0x8b')](_0x4ae909,[_0xda65('0x2d'),_0xda65('0x30')])&&_0x16bc02[_0xda65('0x30')][_0xda65('0x2d')]!==_0xda65('0x2e')){throw new Error(_0xda65('0x8c'));}if(_[_0xda65('0x8b')](_0x4ae909,['role','admin'])&&_0x16bc02[_0xda65('0x30')][_0xda65('0x2d')]!==_0xda65('0x2e')){throw new Error(_0xda65('0x8d'));}return licenseUtil['checkUserLimits'](_0x4ae909)[_0xda65('0x1a')](function(){return validateUser(_0x4ae909[0x0]);})[_0xda65('0x1a')](function(){for(var _0xb4445d=0x1;_0xb4445d<_0x4ae909['length'];_0xb4445d++){var _0xa64273=_0x4ae909[_0xb4445d-0x1]['internal'];if(!_0x4ae909[_0xb4445d][_0xda65('0x68')])_0x4ae909[_0xb4445d]['internal']=_0xa64273+0x1;_0x93c568[_0xda65('0x4c')](validateUser(_0x4ae909[_0xb4445d]));}return Promise[_0xda65('0x60')](_0x93c568);})[_0xda65('0x1a')](function(){_0x93c568=[];for(var _0x46c163=0x0;_0x46c163<_0x4ae909[_0xda65('0x5d')];_0x46c163++){_0x93c568[_0xda65('0x4c')](updateUser(_0x4ae909[_0x46c163]));}return Promise['all'](_0x93c568);})[_0xda65('0x1a')](function(){_0x93c568=_0x4ae909[_0xda65('0x3f')](function(_0x3931f4){return db['User'][_0xda65('0x84')](_0x3931f4,{'include':[{'model':db[_0xda65('0x8e')],'as':_0xda65('0x8e')}]})[_0xda65('0x1a')](function(_0xe6b4c){_0x3931f4['id']=_0xe6b4c['id'];return _0x3931f4;});});return Promise[_0xda65('0x60')](_0x93c568);})[_0xda65('0x1a')](function(_0x5cdb2a){if(_0x16bc02[_0xda65('0x62')][_0xda65('0x2d')]===_0xda65('0x30'))return _0x5cdb2a;if(_0x16bc02[_0xda65('0x30')][_0xda65('0x2d')]!=='user')return _0x5cdb2a;var _0x5ed771=_[_0xda65('0x8b')](_0x5cdb2a,function(_0x13f726){return _0x13f726[_0xda65('0x2d')]===_0xda65('0x32')||_0x13f726[_0xda65('0x2d')]===_0xda65('0x33');});if(!_0x5ed771)return _0x5cdb2a;return db['UserProfileSection'][_0xda65('0x4d')]({'where':{'name':{'$or':[_0xda65('0x31'),'Telephones']},'userProfileId':_0x16bc02['user'][_0xda65('0x87')]},'raw':!![]})['then'](function(_0x4c965d){if(_[_0xda65('0x8f')](_0x4c965d)||!_[_0xda65('0x8b')](_0x4c965d,[_0xda65('0x88'),0x0]))return _0x5cdb2a;_0x93c568=[];var _0x2590e1=_(_0x4c965d)['map'](function(_0x59e536){if(_0x59e536[_0xda65('0x88')]===0x1)return;return _0x59e536[_0xda65('0x3a')]===_0xda65('0x31')?'agent':_0xda65('0x33');})[_0xda65('0x90')]()[_0xda65('0x38')]();for(var _0x1eb003=0x0;_0x1eb003<_0x5cdb2a[_0xda65('0x5d')];_0x1eb003++){if(!_[_0xda65('0x36')](_0x2590e1,_0x5cdb2a[_0x1eb003]['role']))return;var _0x251686=_0x5cdb2a[_0x1eb003][_0xda65('0x2d')]===_0xda65('0x32')?'Agents':_0xda65('0x86');_0x93c568[_0xda65('0x4c')](db[_0xda65('0x91')][_0xda65('0x84')]({'name':_0x5cdb2a[_0x1eb003][_0xda65('0x3a')],'resourceId':_0x5cdb2a[_0x1eb003]['id'],'type':_0x251686,'sectionId':_[_0xda65('0x37')](_0x4c965d,[_0xda65('0x3a'),_0x251686])['id']},{}));}return Promise['all'](_0x93c568);});})[_0xda65('0x1a')](respondWithResult(_0x47c20c,0xc9))[_0xda65('0x56')](handleError(_0x47c20c,null));};exports['changePassword']=function(_0x79b762,_0x349d82){if(_0x79b762['body']['id']){delete _0x79b762[_0xda65('0x62')]['id'];}return db['User'][_0xda65('0x37')]({'where':{'id':_0x79b762[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](function(_0x503cc4){if(!_0x503cc4)return null;if(_0x503cc4['id']===_0x79b762[_0xda65('0x30')]['id']){if(!_0x79b762[_0xda65('0x62')]['oldPassword']||!_0x79b762[_0xda65('0x62')][_0xda65('0x92')]){throw new db['Sequelize'][(_0xda65('0x93'))](_0xda65('0x94'));}if(!_0x503cc4[_0xda65('0x95')](_0x79b762[_0xda65('0x62')][_0xda65('0x96')])){throw new db[(_0xda65('0x97'))]['ValidationError'](_0xda65('0x98'));}if(_0x79b762[_0xda65('0x62')][_0xda65('0x96')]===_0x79b762[_0xda65('0x62')][_0xda65('0x92')]){throw new db[(_0xda65('0x97'))][(_0xda65('0x93'))](_0xda65('0x99'));}}else if(_0x79b762[_0xda65('0x30')][_0xda65('0x2d')]===_0xda65('0x2e')){if(!_0x79b762[_0xda65('0x62')]['newPassword']){throw new db[(_0xda65('0x97'))]['ValidationError'](_0xda65('0x9a'));}}else if(_0x79b762[_0xda65('0x30')][_0xda65('0x2d')]===_0xda65('0x30')){if(!_0x79b762[_0xda65('0x62')][_0xda65('0x92')]){throw new db[(_0xda65('0x97'))][(_0xda65('0x93'))](_0xda65('0x9a'));}if(_0x503cc4[_0xda65('0x2d')]!==_0xda65('0x32')){throw new db[(_0xda65('0x97'))]['ValidationError'](_0xda65('0x81'));}}else{throw new db[(_0xda65('0x97'))][(_0xda65('0x93'))]('Unauthorized');}return _0x503cc4;})[_0xda65('0x1a')](handleEntityNotFound(_0x349d82,null))[_0xda65('0x1a')](function(_0x197a9d){return db[_0xda65('0x69')][_0xda65('0x9b')]({'attributes':['id','securePassword',_0xda65('0x9c'),'passwordHistoryLimit']})[_0xda65('0x1a')](function(_0x1c8f01){if(_0x1c8f01[_0xda65('0x6b')])authService[_0xda65('0x6c')](_0x79b762[_0xda65('0x62')][_0xda65('0x92')]);if(!_0x1c8f01[_0xda65('0x9c')]||!_0x197a9d[_0xda65('0x9d')])return _0x197a9d;authService['validatePasswordHistory'](_0x79b762[_0xda65('0x62')][_0xda65('0x92')],_0x197a9d[_0xda65('0x9d')],_0x1c8f01[_0xda65('0x9e')]);return _0x197a9d;})[_0xda65('0x1a')](saveUpdates({'password':_0x79b762[_0xda65('0x62')]['newPassword'],'passwordResetAt':_0x79b762[_0xda65('0x30')]['id']==_0x79b762[_0xda65('0x63')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x79b762['body'][_0xda65('0x92')],_0x197a9d[_0xda65('0x9d')])},null));})[_0xda65('0x1a')](respondWithResult(_0x349d82,null))['catch'](handleError(_0x349d82,null));};exports[_0xda65('0x9f')]=function(_0x2dd7ab,_0x5cea64){var _0x4e37a1=_0x2dd7ab['body'][_0xda65('0xa0')];return db[_0xda65('0x3d')]['find']({'where':{'id':_0x2dd7ab['params']['id']},'attributes':['id','name','role',_0xda65('0xa1'),_0xda65('0xa2'),'voicePause',_0xda65('0xa3')]})['then'](handleEntityNotFound(_0x5cea64,null))[_0xda65('0x1a')](function(_0x451a66){if(_0x451a66){if(!utils[_0xda65('0xa4')](_0x4e37a1)){throw new db['Sequelize'][(_0xda65('0x93'))]('Unknown\x20channel');}return _0x451a66['add'+_[_0xda65('0xa5')](_0x4e37a1[_0xda65('0xa6')]())+'Queues'](_0x2dd7ab[_0xda65('0x62')][_0xda65('0x66')],{'penalty':_0x2dd7ab[_0xda65('0x62')]['penalty']||0x0})['spread'](function(_0x43ff86){for(var _0x2767ad=0x0;_0x2767ad<_0x2dd7ab[_0xda65('0x62')]['ids'][_0xda65('0x5d')];_0x2767ad+=0x1){var _0x19b4d1={'UserId':Number(_0x2dd7ab[_0xda65('0x63')]['id'])};_0x19b4d1[_['capitalize'](_0x4e37a1[_0xda65('0xa6')]())+_0xda65('0xa7')]=Number(_0x2dd7ab['body']['ids'][_0x2767ad]);socket[_0xda65('0xa8')](_0xda65('0x30')+_['capitalize'](_0x4e37a1['toLowerCase']())+_0xda65('0xa9'),_0x19b4d1);}return _0x43ff86;})[_0xda65('0x1a')](function(){if(_0x4e37a1==='voice'){return db[_0xda65('0xaa')][_0xda65('0x4d')]({'where':{'id':_0x2dd7ab[_0xda65('0x62')][_0xda65('0x66')]||[]},'raw':!![],'attributes':['id',_0xda65('0x3a')]});}})[_0xda65('0x1a')](function(_0x44fe1c){var _0x28198b=_0x451a66[_0xda65('0x2c')]({'plain':!![]});var _0x261786=[];if(_0x4e37a1===_0xda65('0xab')&&_0x28198b['role']==='agent'&&_0x28198b[_0xda65('0xa1')]){for(let _0x2a1b81=0x0;_0x2a1b81<_0x44fe1c[_0xda65('0x5d')];_0x2a1b81+=0x1){_0x261786[_0xda65('0x4c')]({'membername':_0x28198b[_0xda65('0x3a')],'UserId':_0x28198b['id'],'queue_name':_0x44fe1c[_0x2a1b81][_0xda65('0x3a')],'VoiceQueueId':_0x44fe1c[_0x2a1b81]['id'],'interface':_['isNil'](_0x28198b[_0xda65('0xa3')])?util[_0xda65('0xac')]('SIP/%s',_0x28198b[_0xda65('0x3a')]):_0x28198b[_0xda65('0xa3')],'paused':_0x28198b[_0xda65('0xad')]||![],'penalty':_0x2dd7ab[_0xda65('0x62')][_0xda65('0xae')]||0x0});}return Promise[_0xda65('0x60')](_0x261786[_0xda65('0x3f')](function(_0x3f4c9a){return db[_0xda65('0xaf')][_0xda65('0xb0')](_0x3f4c9a);}));}return _0x451a66;});}})[_0xda65('0x1a')](respondWithStatusCode(_0x5cea64,null))[_0xda65('0x56')](handleError(_0x5cea64,null));};exports['removeQueues']=function(_0xd0dbd4,_0x4a6675){var _0x4c4dda,_0x1174bd;return db[_0xda65('0x3d')][_0xda65('0x37')]({'where':{'id':_0xd0dbd4['params']['id']},'attributes':['id',_0xda65('0x3a'),_0xda65('0x2d')]})[_0xda65('0x1a')](handleEntityNotFound(_0x4a6675,null))[_0xda65('0x1a')](function(_0x5934ad){if(_0x5934ad){_0x4c4dda=_0x5934ad;if(!_0xd0dbd4[_0xda65('0x45')][_0xda65('0xa0')]||!utils[_0xda65('0xa4')](_0xd0dbd4[_0xda65('0x45')][_0xda65('0xa0')])){throw new db['Sequelize'][(_0xda65('0x93'))]('Unknown\x20channel');}return _0x5934ad['remove'+_[_0xda65('0xa5')](_0xd0dbd4[_0xda65('0x45')][_0xda65('0xa0')][_0xda65('0xa6')]())+_0xda65('0xb1')](_0xd0dbd4[_0xda65('0x45')]['ids']);}})[_0xda65('0x1a')](function(_0x5eb581){if(_[_0xda65('0xb2')](_0xd0dbd4[_0xda65('0x45')][_0xda65('0x66')])){for(var _0x1143c4=0x0;_0x1143c4<_0xd0dbd4[_0xda65('0x45')]['ids']['length'];_0x1143c4+=0x1){_0x1174bd={'UserId':Number(_0xd0dbd4['params']['id'])};_0x1174bd[_[_0xda65('0xa5')](_0xd0dbd4['query'][_0xda65('0xa0')][_0xda65('0xa6')]())+_0xda65('0xa7')]=Number(_0xd0dbd4[_0xda65('0x45')][_0xda65('0x66')][_0x1143c4]);socket[_0xda65('0xa8')](_0xda65('0x30')+_['capitalize'](_0xd0dbd4[_0xda65('0x45')][_0xda65('0xa0')][_0xda65('0xa6')]())+_0xda65('0xb3'),_0x1174bd);}}else{_0x1174bd={'UserId':Number(_0xd0dbd4['params']['id'])};_0x1174bd[_[_0xda65('0xa5')](_0xd0dbd4[_0xda65('0x45')][_0xda65('0xa0')][_0xda65('0xa6')]())+_0xda65('0xa7')]=Number(_0xd0dbd4['query'][_0xda65('0x66')]);socket[_0xda65('0xa8')](_0xda65('0x30')+_[_0xda65('0xa5')](_0xd0dbd4['query'][_0xda65('0xa0')]['toLowerCase']())+_0xda65('0xb3'),_0x1174bd);}return _0x5eb581;})['then'](function(){if(_0xd0dbd4[_0xda65('0x45')][_0xda65('0xa0')]===_0xda65('0xab')){return db['UserVoiceQueueRt'][_0xda65('0x2b')]({'where':{'UserId':_0xd0dbd4[_0xda65('0x63')]['id'],'VoiceQueueId':_0xd0dbd4[_0xda65('0x45')][_0xda65('0x66')]},'individualHooks':!![]})['then'](function(){return _0x4c4dda;});}return _0x4c4dda;})[_0xda65('0x1a')](respondWithStatusCode(_0x4a6675,null))[_0xda65('0x56')](handleError(_0x4a6675,null));};exports[_0xda65('0xb4')]=function(_0x16561b,_0x3e3a24){_0x16561b[_0xda65('0x62')]['userpic']=_0x16561b['file'][_0xda65('0xb5')];return db['User'][_0xda65('0x37')]({'where':{'id':_0x16561b[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x3e3a24,null))[_0xda65('0x1a')](saveUpdates(_0x16561b[_0xda65('0x62')],null))['then'](respondWithResult(_0x3e3a24,null))[_0xda65('0x56')](handleError(_0x3e3a24,null));};exports['getAvatar']=function(_0x40b1c5,_0x6b0515){var _0x6c58d3=path['join'](config['root'],'server/files/images/logos/default_profile.png');return db['User'][_0xda65('0x37')]({'where':{'id':_0x40b1c5[_0xda65('0x63')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x6b0515,null))[_0xda65('0x1a')](function(_0x1071c8){if(_0x1071c8){if(_[_0xda65('0x6f')](_0x1071c8[_0xda65('0xb6')])){return _0x6b0515[_0xda65('0xb7')](_0x6c58d3);}else{if(!fs[_0xda65('0xb8')](path[_0xda65('0xb9')](config[_0xda65('0xba')],_0xda65('0xbb'),_0x1071c8[_0xda65('0xb6')]))){return _0x6b0515[_0xda65('0xb7')](_0x6c58d3);}return _0x6b0515[_0xda65('0xb7')](path[_0xda65('0xb9')](config[_0xda65('0xba')],_0xda65('0xbb'),_0x1071c8[_0xda65('0xb6')]));}}})[_0xda65('0x56')](handleError(_0x6b0515,null));};exports['getOpenTabs']=function(_0x49f6bc,_0x4e0337){return db[_0xda65('0x3d')][_0xda65('0x37')]({'where':{'id':_0x49f6bc[_0xda65('0x63')]['id']},'attributes':['id']})[_0xda65('0x1a')](handleEntityNotFound(_0x4e0337,null))[_0xda65('0x1a')](function(_0x536e62){var _0x2eb1e9=[];values=_0x536e62['dataValues'];_0x2eb1e9['push'](get_open_tabs(_0xda65('0x50'),_0x536e62[_0xda65('0x51')]));_0x2eb1e9[_0xda65('0x4c')](get_open_tabs(_0xda65('0x52'),_0x536e62[_0xda65('0x51')]));_0x2eb1e9[_0xda65('0x4c')](get_open_tabs('openchannel',_0x536e62[_0xda65('0x51')]));_0x2eb1e9[_0xda65('0x4c')](get_open_tabs(_0xda65('0xbc'),_0x536e62['dataValues']));_0x2eb1e9[_0xda65('0x4c')](get_open_tabs(_0xda65('0x53'),_0x536e62['dataValues']));_0x2eb1e9[_0xda65('0x4c')](get_open_tabs('mail',_0x536e62[_0xda65('0x51')]));return Promise[_0xda65('0x60')](_0x2eb1e9);})[_0xda65('0x1a')](function(_0x360a2a){if(_0x360a2a){var _0x31f95f=_[_0xda65('0x3f')](values[_0xda65('0xbd')],function(_0x1af2d7){return{'channel':_0xda65('0xbe'),'id':_0x1af2d7['id'],'createdAt':_0x1af2d7[_0xda65('0xbf')]};});var _0x3c208c=_[_0xda65('0x3f')](values[_0xda65('0xc0')],function(_0x1c24bb){return{'channel':_0xda65('0xc1'),'id':_0x1c24bb['id'],'createdAt':_0x1c24bb['createdAt']};});var _0x1dfb35=_[_0xda65('0x3f')](values[_0xda65('0xc2')],function(_0x4d76bd){return{'channel':_0xda65('0xc3'),'id':_0x4d76bd['id'],'createdAt':_0x4d76bd[_0xda65('0xbf')]};});var _0x330698=_[_0xda65('0x3f')](values[_0xda65('0xc4')],function(_0x2062bb){return{'channel':_0xda65('0xc5'),'id':_0x2062bb['id'],'createdAt':_0x2062bb[_0xda65('0xbf')]};});var _0x1de28e=_[_0xda65('0x3f')](values[_0xda65('0xc6')],function(_0x2264ca){return{'channel':_0xda65('0xc7'),'id':_0x2264ca['id'],'createdAt':_0x2264ca[_0xda65('0xbf')]};});var _0x4ebd96=_[_0xda65('0x3f')](values[_0xda65('0xc8')],function(_0x30b289){return{'channel':_0xda65('0xc9'),'id':_0x30b289['id'],'createdAt':_0x30b289[_0xda65('0xbf')]};});var _0x13ba5a=_[_0xda65('0xca')](_0x31f95f,_0x3c208c,_0x1dfb35,_0x330698,_0x1de28e,_0x4ebd96);var _0x5cb9a0={'count':_0x13ba5a[_0xda65('0x5d')],'rows':_0x13ba5a};return _0x5cb9a0;}else return null;})['then'](respondWithResult(_0x4e0337,null))['catch'](handleError(_0x4e0337,null));};exports[_0xda65('0xcb')]=function(_0x56d39d,_0x322591){var _0x3357b5={};var _0x37c123={};var _0x3bcca3;var _0xd11c32;return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x56d39d[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x322591,null))[_0xda65('0x1a')](function(_0x23d3b0){if(_0x23d3b0){_0x3bcca3=_0x23d3b0;_0x37c123[_0xda65('0x5b')]=_[_0xda65('0x57')](db[_0xda65('0xcc')][_0xda65('0x3e')]);_0x37c123[_0xda65('0x45')]=_[_0xda65('0x57')](_0x56d39d['query']);_0x37c123[_0xda65('0x59')]=_['intersection'](_0x37c123[_0xda65('0x5b')],_0x37c123[_0xda65('0x45')]);_0x3357b5[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x37c123[_0xda65('0x5b')],qs['fields'](_0x56d39d[_0xda65('0x45')][_0xda65('0x5c')]));_0x3357b5[_0xda65('0x4b')]=_0x3357b5[_0xda65('0x4b')][_0xda65('0x5d')]?_0x3357b5[_0xda65('0x4b')]:_0x37c123[_0xda65('0x5b')];_0x3357b5[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x56d39d['query']['sort']);_0x3357b5[_0xda65('0x44')]=qs[_0xda65('0x59')](_['pick'](_0x56d39d[_0xda65('0x45')],_0x37c123[_0xda65('0x59')]));if(_0x56d39d[_0xda65('0x45')][_0xda65('0x34')]){_0x3357b5['where']=_[_0xda65('0x5e')](_0x3357b5[_0xda65('0x44')],{'$or':_['map'](_0x3357b5[_0xda65('0x4b')],function(_0x35cc22){var _0x164bb1={};_0x164bb1[_0x35cc22]={'$like':'%'+_0x56d39d[_0xda65('0x45')][_0xda65('0x34')]+'%'};return _0x164bb1;})});}_0x3357b5=_[_0xda65('0x5e')]({},_0x3357b5,_0x56d39d[_0xda65('0x5f')]);return _0x3bcca3[_0xda65('0xcb')](_0x3357b5);}})[_0xda65('0x1a')](function(_0x3fb1c4){if(_0x3fb1c4){_0xd11c32=_0x3fb1c4[_0xda65('0x5d')];if(_0x56d39d[_0xda65('0x45')][_0xda65('0xcf')]('includeAll')){_0x3357b5[_0xda65('0x47')]=[{'model':db[_0xda65('0xd0')],'as':_0xda65('0xd1'),'required':![]},{'model':db['Tag'],'as':_0xda65('0xd2'),'attributes':['id',_0xda65('0x3a'),'color'],'where':_0x56d39d[_0xda65('0x45')][_0xda65('0xd3')]?{'id':_0x56d39d[_0xda65('0x45')][_0xda65('0xd3')]}:undefined,'required':_0x56d39d['query'][_0xda65('0xd3')]?!![]:![]}];}if(!_0x56d39d[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0x3357b5[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x56d39d[_0xda65('0x45')]['limit']);_0x3357b5['offset']=qs[_0xda65('0x25')](_0x56d39d[_0xda65('0x45')][_0xda65('0x25')]);}return _0x3bcca3[_0xda65('0xcb')](_0x3357b5);}})[_0xda65('0x1a')](function(_0x4fb7be){if(_0x4fb7be){return _0x4fb7be?{'count':_0xd11c32,'rows':_0x4fb7be}:null;}})[_0xda65('0x1a')](respondWithResult(_0x322591,null))[_0xda65('0x56')](handleError(_0x322591,null));};exports[_0xda65('0xd5')]=function(_0x30e4df,_0x348215){var _0x28d486;var _0x582f0c={};var _0x3fbf93;return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x30e4df[_0xda65('0x63')]['id']},'attributes':['id','name',_0xda65('0x2d')]})['then'](handleEntityNotFound(_0x348215,null))[_0xda65('0x1a')](function(_0x21895d){if(!utils[_0xda65('0xa4')](_0x30e4df[_0xda65('0x45')][_0xda65('0xa0')])){throw new db['Sequelize'][(_0xda65('0x93'))]('Unknown\x20channel');}_0x28d486=_0x21895d;var _0x45abc4={};_0x45abc4[_0xda65('0x5b')]=_[_0xda65('0x57')](db[_['capitalize'](_0x30e4df[_0xda65('0x45')][_0xda65('0xa0')])+'Queue']['rawAttributes']);_0x45abc4[_0xda65('0x45')]=_[_0xda65('0x57')](_0x30e4df[_0xda65('0x45')]);_0x45abc4[_0xda65('0x59')]=_[_0xda65('0x5a')](_0x45abc4[_0xda65('0x5b')],_0x45abc4['query']);_0x582f0c['attributes']=_['intersection'](_0x45abc4['model'],qs[_0xda65('0x5c')](_0x30e4df[_0xda65('0x45')]['fields']));_0x582f0c['attributes']=_0x582f0c[_0xda65('0x4b')][_0xda65('0x5d')]?_0x582f0c[_0xda65('0x4b')]:_0x45abc4[_0xda65('0x5b')];_0x582f0c[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x30e4df[_0xda65('0x45')][_0xda65('0xce')]);_0x582f0c['where']=qs[_0xda65('0x59')](_[_0xda65('0xd6')](_0x30e4df['query'],_0x45abc4[_0xda65('0x59')]));if(_0x30e4df[_0xda65('0x45')][_0xda65('0x34')]){_0x582f0c[_0xda65('0x44')]=_[_0xda65('0x5e')](_0x582f0c[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x582f0c[_0xda65('0x4b')],function(_0x164426){var _0x5127e9={};_0x5127e9[_0x164426]={'$like':'%'+_0x30e4df[_0xda65('0x45')]['filter']+'%'};return _0x5127e9;})});}_0x582f0c=_[_0xda65('0x5e')]({},_0x582f0c,_0x30e4df['options']);switch(_0x28d486[_0xda65('0x2d')]){case'admin':return db[_[_0xda65('0xa5')](_0x30e4df['query'][_0xda65('0xa0')])+'Queue']['findAll'](_0x582f0c);case'user':case _0xda65('0x32'):return _0x28d486[_0xda65('0x2c')+_['capitalize'](_0x30e4df['query'][_0xda65('0xa0')])+_0xda65('0xb1')](_0x582f0c);default:throw new db[(_0xda65('0x97'))][(_0xda65('0x93'))]('Unknown\x20role');}})[_0xda65('0x1a')](function(_0x5dc1a7){_0x3fbf93=_0x5dc1a7['length'];if(!_0x30e4df[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0x582f0c[_0xda65('0x27')]=qs['limit'](_0x30e4df['query'][_0xda65('0x27')]);_0x582f0c[_0xda65('0x25')]=qs[_0xda65('0x25')](_0x30e4df['query'][_0xda65('0x25')]);}switch(_0x28d486[_0xda65('0x2d')]){case _0xda65('0x2e'):return db[_[_0xda65('0xa5')](_0x30e4df['query']['channel'])+_0xda65('0xd7')][_0xda65('0x4d')](_0x582f0c);case'user':case _0xda65('0x32'):return _0x28d486['get'+_['capitalize'](_0x30e4df[_0xda65('0x45')][_0xda65('0xa0')])+_0xda65('0xb1')](_0x582f0c);}})[_0xda65('0x1a')](function(_0x47985e){return{'count':_0x3fbf93,'rows':_0x47985e};})[_0xda65('0x1a')](respondWithResult(_0x348215,null))[_0xda65('0x56')](handleError(_0x348215,null));};exports[_0xda65('0xd8')]=function(_0x3a692f,_0x2c89cc){var _0x54a71c={};var _0x21ffdb={};var _0x242762;var _0x2d6544;return db[_0xda65('0x3d')]['findOne']({'where':{'id':_0x3a692f[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x2c89cc,null))[_0xda65('0x1a')](function(_0x5ce01d){if(_0x5ce01d){_0x242762=_0x5ce01d;_0x21ffdb['model']=_[_0xda65('0x57')](db['UserVoiceQueueRt'][_0xda65('0x3e')]);_0x21ffdb[_0xda65('0x45')]=_[_0xda65('0x57')](_0x3a692f[_0xda65('0x45')]);_0x21ffdb[_0xda65('0x59')]=_['intersection'](_0x21ffdb[_0xda65('0x5b')],_0x21ffdb[_0xda65('0x45')]);_0x54a71c['attributes']=_[_0xda65('0x5a')](_0x21ffdb[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x3a692f[_0xda65('0x45')][_0xda65('0x5c')]));_0x54a71c[_0xda65('0x4b')]=_0x54a71c[_0xda65('0x4b')]['length']?_0x54a71c[_0xda65('0x4b')]:_0x21ffdb[_0xda65('0x5b')];_0x54a71c[_0xda65('0xcd')]=qs['sort'](_0x3a692f['query'][_0xda65('0xce')]);_0x54a71c['where']=qs['filters'](_['pick'](_0x3a692f[_0xda65('0x45')],_0x21ffdb['filters']));if(_0x3a692f['query'][_0xda65('0x34')]){_0x54a71c[_0xda65('0x44')]=_[_0xda65('0x5e')](_0x54a71c[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x54a71c['attributes'],function(_0x4bb68e){var _0x552fed={};_0x552fed[_0x4bb68e]={'$like':'%'+_0x3a692f['query'][_0xda65('0x34')]+'%'};return _0x552fed;})});}_0x54a71c=_[_0xda65('0x5e')]({},_0x54a71c,_0x3a692f[_0xda65('0x5f')]);return _0x242762[_0xda65('0xd8')](_0x54a71c);}})[_0xda65('0x1a')](function(_0x3f3898){if(_0x3f3898){_0x2d6544=_0x3f3898[_0xda65('0x5d')];if(!_0x3a692f[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0x54a71c[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x3a692f['query'][_0xda65('0x27')]);_0x54a71c['offset']=qs[_0xda65('0x25')](_0x3a692f['query']['offset']);}return _0x242762[_0xda65('0xd8')](_0x54a71c);}})[_0xda65('0x1a')](function(_0x4be0c9){if(_0x4be0c9){return _0x4be0c9?{'count':_0x2d6544,'rows':_0x4be0c9}:null;}})[_0xda65('0x1a')](respondWithResult(_0x2c89cc,null))[_0xda65('0x56')](handleError(_0x2c89cc,null));};exports[_0xda65('0xd9')]=function(_0x4225ba,_0x2e74a0){var _0x2970f6={};var _0x55f002={};var _0xb5aad4;var _0x269f4e;return db['User'][_0xda65('0x9b')]({'where':{'id':_0x4225ba[_0xda65('0x63')]['id']}})['then'](handleEntityNotFound(_0x2e74a0,null))[_0xda65('0x1a')](function(_0x1c8bf4){if(_0x1c8bf4){_0xb5aad4=_0x1c8bf4;_0x55f002[_0xda65('0x5b')]=_[_0xda65('0x57')](db['ChatGroup'][_0xda65('0x3e')]);_0x55f002[_0xda65('0x45')]=_[_0xda65('0x57')](_0x4225ba['query']);_0x55f002[_0xda65('0x59')]=_[_0xda65('0x5a')](_0x55f002[_0xda65('0x5b')],_0x55f002['query']);_0x2970f6[_0xda65('0x4b')]=_['intersection'](_0x55f002[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x4225ba[_0xda65('0x45')][_0xda65('0x5c')]));_0x2970f6['attributes']=_0x2970f6[_0xda65('0x4b')][_0xda65('0x5d')]?_0x2970f6[_0xda65('0x4b')]:_0x55f002[_0xda65('0x5b')];_0x2970f6['order']=qs[_0xda65('0xce')](_0x4225ba['query'][_0xda65('0xce')]);_0x2970f6[_0xda65('0x44')]=qs[_0xda65('0x59')](_['pick'](_0x4225ba[_0xda65('0x45')],_0x55f002['filters']));if(_0x4225ba[_0xda65('0x45')][_0xda65('0x34')]){_0x2970f6[_0xda65('0x44')]=_[_0xda65('0x5e')](_0x2970f6[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x2970f6[_0xda65('0x4b')],function(_0x109216){var _0x19b116={};_0x19b116[_0x109216]={'$like':'%'+_0x4225ba[_0xda65('0x45')]['filter']+'%'};return _0x19b116;})});}_0x2970f6=_['merge']({},_0x2970f6,_0x4225ba['options']);return _0xb5aad4[_0xda65('0xd9')](_0x2970f6);}})[_0xda65('0x1a')](function(_0xb48e53){if(_0xb48e53){_0x269f4e=_0xb48e53['length'];if(!_0x4225ba[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0x2970f6[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x4225ba['query']['limit']);_0x2970f6['offset']=qs[_0xda65('0x25')](_0x4225ba[_0xda65('0x45')]['offset']);}return _0xb5aad4[_0xda65('0xd9')](_0x2970f6);}})[_0xda65('0x1a')](function(_0x502ec9){if(_0x502ec9){return _0x502ec9?{'count':_0x269f4e,'rows':_0x502ec9}:null;}})[_0xda65('0x1a')](respondWithResult(_0x2e74a0,null))['catch'](handleError(_0x2e74a0,null));};exports['getRecordings']=function(_0x2aebb2,_0x19404c){var _0x2b76e9={'raw':!![],'where':{}};var _0x5d0d9f={};var _0x5dd4d1={'count':0x0,'rows':[]};return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x2aebb2['params']['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x19404c,null))['then'](function(_0x54284d){if(_0x54284d){_0x5d0d9f['model']=_[_0xda65('0x57')](db[_0xda65('0xda')][_0xda65('0x3e')]);_0x5d0d9f[_0xda65('0x45')]=_[_0xda65('0x57')](_0x2aebb2[_0xda65('0x45')]);_0x5d0d9f[_0xda65('0x59')]=_['intersection'](_0x5d0d9f[_0xda65('0x5b')],_0x5d0d9f['query']);_0x2b76e9['attributes']=_['intersection'](_0x5d0d9f[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x2aebb2[_0xda65('0x45')]['fields']));_0x2b76e9[_0xda65('0x4b')]=_0x2b76e9[_0xda65('0x4b')][_0xda65('0x5d')]?_0x2b76e9['attributes']:_0x5d0d9f[_0xda65('0x5b')];if(!_0x2aebb2[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0x2b76e9[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x2aebb2[_0xda65('0x45')][_0xda65('0x27')]);_0x2b76e9[_0xda65('0x25')]=qs['offset'](_0x2aebb2[_0xda65('0x45')][_0xda65('0x25')]);}_0x2b76e9['order']=qs[_0xda65('0xce')](_0x2aebb2[_0xda65('0x45')][_0xda65('0xce')]);_0x2b76e9[_0xda65('0x44')]=qs['filters'](_[_0xda65('0xd6')](_0x2aebb2[_0xda65('0x45')],_0x5d0d9f[_0xda65('0x59')]));_0x2b76e9[_0xda65('0x44')]['UserId']=_0x54284d['id'];if(_0x2aebb2[_0xda65('0x45')][_0xda65('0x34')]){_0x2b76e9['where']=_[_0xda65('0x5e')](_0x2b76e9['where'],{'$or':_[_0xda65('0x3f')](_0x2b76e9[_0xda65('0x4b')],function(_0x3b45b6){var _0x60778d={};_0x60778d[_0x3b45b6]={'$like':'%'+_0x2aebb2[_0xda65('0x45')]['filter']+'%'};return _0x60778d;})});}_0x2b76e9=_[_0xda65('0x5e')]({},_0x2b76e9,_0x2aebb2[_0xda65('0x5f')]);return db['VoiceRecording'][_0xda65('0x28')]({'where':_0x2b76e9[_0xda65('0x44')]})[_0xda65('0x1a')](function(_0x3f527c){_0x5dd4d1[_0xda65('0x28')]=_0x3f527c;if(_0x2aebb2['query'][_0xda65('0x46')]){_0x2b76e9[_0xda65('0x47')]=[{'all':!![]}];}return db['VoiceRecording'][_0xda65('0x4d')](_0x2b76e9);})[_0xda65('0x1a')](function(_0x3148a9){_0x5dd4d1[_0xda65('0x4e')]=_0x3148a9;return _0x5dd4d1;});}})['then'](respondWithFilteredResult(_0x19404c,_0x2b76e9))[_0xda65('0x56')](handleError(_0x19404c,null));};exports[_0xda65('0xdb')]=function(_0x532153,_0x3d22e2){var _0x51e3b3={'raw':!![],'where':{}};var _0x445fb8={};var _0x249cae={'count':0x0,'rows':[]};return db['User'][_0xda65('0x9b')]({'where':{'id':_0x532153['params']['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x3d22e2,null))[_0xda65('0x1a')](function(_0x38f1ad){if(_0x38f1ad){_0x445fb8['model']=_[_0xda65('0x57')](db[_0xda65('0xdc')][_0xda65('0x3e')]);_0x445fb8[_0xda65('0x45')]=_[_0xda65('0x57')](_0x532153[_0xda65('0x45')]);_0x445fb8[_0xda65('0x59')]=_[_0xda65('0x5a')](_0x445fb8[_0xda65('0x5b')],_0x445fb8[_0xda65('0x45')]);_0x51e3b3['attributes']=_[_0xda65('0x5a')](_0x445fb8[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x532153['query'][_0xda65('0x5c')]));_0x51e3b3[_0xda65('0x4b')]=_0x51e3b3[_0xda65('0x4b')][_0xda65('0x5d')]?_0x51e3b3['attributes']:_0x445fb8['model'];if(!_0x532153['query'][_0xda65('0xcf')](_0xda65('0xd4'))){_0x51e3b3[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x532153[_0xda65('0x45')][_0xda65('0x27')]);_0x51e3b3['offset']=qs['offset'](_0x532153[_0xda65('0x45')][_0xda65('0x25')]);}_0x51e3b3[_0xda65('0xcd')]=qs['sort'](_0x532153[_0xda65('0x45')][_0xda65('0xce')]);_0x51e3b3[_0xda65('0x44')]=qs['filters'](_[_0xda65('0xd6')](_0x532153['query'],_0x445fb8[_0xda65('0x59')]));_0x51e3b3['where']['UserId']=_0x38f1ad['id'];if(_0x532153[_0xda65('0x45')]['filter']){_0x51e3b3[_0xda65('0x44')]=_[_0xda65('0x5e')](_0x51e3b3[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x51e3b3[_0xda65('0x4b')],function(_0x5d6efb){var _0x2ea4e7={};_0x2ea4e7[_0x5d6efb]={'$like':'%'+_0x532153[_0xda65('0x45')]['filter']+'%'};return _0x2ea4e7;})});}_0x51e3b3=_[_0xda65('0x5e')]({},_0x51e3b3,_0x532153[_0xda65('0x5f')]);return db[_0xda65('0xdc')]['count']({'where':_0x51e3b3[_0xda65('0x44')]})[_0xda65('0x1a')](function(_0x10e7db){_0x249cae[_0xda65('0x28')]=_0x10e7db;if(_0x532153['query'][_0xda65('0x46')]){_0x51e3b3[_0xda65('0x47')]=[{'all':!![]}];}return db[_0xda65('0xdc')][_0xda65('0x4d')](_0x51e3b3);})['then'](function(_0x44c543){_0x249cae[_0xda65('0x4e')]=_0x44c543;return _0x249cae;});}})[_0xda65('0x1a')](respondWithFilteredResult(_0x3d22e2,_0x51e3b3))['catch'](handleError(_0x3d22e2,null));};exports[_0xda65('0xdd')]=function(_0x5a8859,_0x3eef8a){var _0x1f57ff={};var _0x4ce1fa={};var _0x2642f8;var _0x1b0148;return db['User'][_0xda65('0x9b')]({'where':{'id':_0x5a8859[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x3eef8a,null))[_0xda65('0x1a')](function(_0x727dd9){if(_0x727dd9){_0x2642f8=_0x727dd9;_0x4ce1fa['model']=_[_0xda65('0x57')](db[_0xda65('0xde')][_0xda65('0x3e')]);_0x4ce1fa[_0xda65('0x45')]=_['keys'](_0x5a8859[_0xda65('0x45')]);_0x4ce1fa['filters']=_[_0xda65('0x5a')](_0x4ce1fa[_0xda65('0x5b')],_0x4ce1fa[_0xda65('0x45')]);_0x1f57ff[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x4ce1fa[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x5a8859['query'][_0xda65('0x5c')]));_0x1f57ff[_0xda65('0x4b')]=_0x1f57ff[_0xda65('0x4b')]['length']?_0x1f57ff['attributes']:_0x4ce1fa[_0xda65('0x5b')];_0x1f57ff[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x5a8859[_0xda65('0x45')][_0xda65('0xce')]);_0x1f57ff[_0xda65('0x44')]=qs['filters'](_[_0xda65('0xd6')](_0x5a8859['query'],_0x4ce1fa[_0xda65('0x59')]));if(_0x5a8859[_0xda65('0x45')][_0xda65('0x34')]){_0x1f57ff[_0xda65('0x44')]=_[_0xda65('0x5e')](_0x1f57ff['where'],{'$or':_[_0xda65('0x3f')](_0x1f57ff[_0xda65('0x4b')],function(_0x22594a){var _0x112abf={};_0x112abf[_0x22594a]={'$like':'%'+_0x5a8859[_0xda65('0x45')][_0xda65('0x34')]+'%'};return _0x112abf;})});}_0x1f57ff=_['merge']({},_0x1f57ff,_0x5a8859[_0xda65('0x5f')]);return _0x2642f8[_0xda65('0xdd')](_0x1f57ff);}})[_0xda65('0x1a')](function(_0x517524){if(_0x517524){_0x1b0148=_0x517524[_0xda65('0x5d')];if(!_0x5a8859['query'][_0xda65('0xcf')]('nolimit')){_0x1f57ff[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x5a8859['query'][_0xda65('0x27')]);_0x1f57ff['offset']=qs['offset'](_0x5a8859[_0xda65('0x45')][_0xda65('0x25')]);}return _0x2642f8[_0xda65('0xdd')](_0x1f57ff);}})['then'](function(_0x531614){if(_0x531614){return _0x531614?{'count':_0x1b0148,'rows':_0x531614}:null;}})[_0xda65('0x1a')](respondWithResult(_0x3eef8a,null))[_0xda65('0x56')](handleError(_0x3eef8a,null));};exports[_0xda65('0xdf')]=function(_0x23e649,_0x5fae23){var _0x4c9812={};var _0x467a54={};var _0x5e9d48;var _0x5c01c9;return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x23e649[_0xda65('0x63')]['id']}})['then'](handleEntityNotFound(_0x5fae23,null))[_0xda65('0x1a')](function(_0x52646){if(_0x52646){_0x5e9d48=_0x52646;_0x467a54[_0xda65('0x5b')]=_[_0xda65('0x57')](db[_0xda65('0xe0')][_0xda65('0x3e')]);_0x467a54['query']=_[_0xda65('0x57')](_0x23e649[_0xda65('0x45')]);_0x467a54['filters']=_[_0xda65('0x5a')](_0x467a54[_0xda65('0x5b')],_0x467a54['query']);_0x4c9812[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x467a54['model'],qs['fields'](_0x23e649[_0xda65('0x45')][_0xda65('0x5c')]));_0x4c9812[_0xda65('0x4b')]=_0x4c9812['attributes'][_0xda65('0x5d')]?_0x4c9812['attributes']:_0x467a54[_0xda65('0x5b')];_0x4c9812[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x23e649['query'][_0xda65('0xce')]);_0x4c9812['where']=qs['filters'](_[_0xda65('0xd6')](_0x23e649[_0xda65('0x45')],_0x467a54[_0xda65('0x59')]));if(_0x23e649[_0xda65('0x45')]['filter']){_0x4c9812['where']=_['merge'](_0x4c9812[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x4c9812['attributes'],function(_0x1e70ea){var _0x55088d={};_0x55088d[_0x1e70ea]={'$like':'%'+_0x23e649['query'][_0xda65('0x34')]+'%'};return _0x55088d;})});}_0x4c9812=_['merge']({},_0x4c9812,_0x23e649[_0xda65('0x5f')]);return _0x5e9d48['getOpenchannelInteractions'](_0x4c9812);}})[_0xda65('0x1a')](function(_0x3e8e64){if(_0x3e8e64){_0x5c01c9=_0x3e8e64['length'];if(!_0x23e649[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0x4c9812['limit']=qs[_0xda65('0x27')](_0x23e649[_0xda65('0x45')][_0xda65('0x27')]);_0x4c9812[_0xda65('0x25')]=qs[_0xda65('0x25')](_0x23e649['query'][_0xda65('0x25')]);}return _0x5e9d48[_0xda65('0xdf')](_0x4c9812);}})['then'](function(_0x402299){if(_0x402299){return _0x402299?{'count':_0x5c01c9,'rows':_0x402299}:null;}})['then'](respondWithResult(_0x5fae23,null))[_0xda65('0x56')](handleError(_0x5fae23,null));};exports[_0xda65('0xe1')]=function(_0x4f344a,_0x3befc5){var _0x70b5={'raw':!![],'where':{}};var _0x39ab6e={};var _0x2bb17d={'count':0x0,'rows':[]};return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x4f344a['params']['id']}})['then'](handleEntityNotFound(_0x3befc5,null))[_0xda65('0x1a')](function(_0x21ebce){if(_0x21ebce){_0x39ab6e[_0xda65('0x5b')]=_[_0xda65('0x57')](db[_0xda65('0xe2')][_0xda65('0x3e')]);_0x39ab6e[_0xda65('0x45')]=_[_0xda65('0x57')](_0x4f344a[_0xda65('0x45')]);_0x39ab6e[_0xda65('0x59')]=_['intersection'](_0x39ab6e[_0xda65('0x5b')],_0x39ab6e['query']);_0x70b5[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x39ab6e[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x4f344a[_0xda65('0x45')]['fields']));_0x70b5[_0xda65('0x4b')]=_0x70b5[_0xda65('0x4b')]['length']?_0x70b5['attributes']:_0x39ab6e[_0xda65('0x5b')];if(!_0x4f344a[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0x70b5[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x4f344a[_0xda65('0x45')][_0xda65('0x27')]);_0x70b5[_0xda65('0x25')]=qs[_0xda65('0x25')](_0x4f344a['query'][_0xda65('0x25')]);}_0x70b5[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x4f344a[_0xda65('0x45')][_0xda65('0xce')]);_0x70b5[_0xda65('0x44')]=qs[_0xda65('0x59')](_['pick'](_0x4f344a[_0xda65('0x45')],_0x39ab6e[_0xda65('0x59')]));_0x70b5['where'][_0xda65('0xe3')]=_0x21ebce['id'];if(_0x4f344a['query'][_0xda65('0x34')]){_0x70b5[_0xda65('0x44')]=_['merge'](_0x70b5['where'],{'$or':_[_0xda65('0x3f')](_0x70b5[_0xda65('0x4b')],function(_0x5c89c5){var _0x3de1ac={};_0x3de1ac[_0x5c89c5]={'$like':'%'+_0x4f344a[_0xda65('0x45')]['filter']+'%'};return _0x3de1ac;})});}_0x70b5=_[_0xda65('0x5e')]({},_0x70b5,_0x4f344a['options']);return db['MailInteraction'][_0xda65('0x28')]({'where':_0x70b5['where']})[_0xda65('0x1a')](function(_0x1bae97){_0x2bb17d[_0xda65('0x28')]=_0x1bae97;if(_0x4f344a['query'][_0xda65('0x46')]){_0x70b5['include']=[{'all':!![]}];}return db[_0xda65('0xe2')][_0xda65('0x4d')](_0x70b5);})[_0xda65('0x1a')](function(_0x1ec226){_0x2bb17d[_0xda65('0x4e')]=_0x1ec226;return _0x2bb17d;});}})[_0xda65('0x1a')](respondWithFilteredResult(_0x3befc5,_0x70b5))[_0xda65('0x56')](handleError(_0x3befc5,null));};exports[_0xda65('0xe4')]=function(_0x1d889a,_0x179883){var _0x19a263={};var _0x5427d6={};var _0x8014a7;var _0x148bc2;return db['User'][_0xda65('0x9b')]({'where':{'id':_0x1d889a[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x179883,null))[_0xda65('0x1a')](function(_0x46fa37){if(_0x46fa37){_0x8014a7=_0x46fa37;_0x5427d6[_0xda65('0x5b')]=_[_0xda65('0x57')](db['SmsInteraction'][_0xda65('0x3e')]);_0x5427d6['query']=_[_0xda65('0x57')](_0x1d889a[_0xda65('0x45')]);_0x5427d6[_0xda65('0x59')]=_[_0xda65('0x5a')](_0x5427d6[_0xda65('0x5b')],_0x5427d6[_0xda65('0x45')]);_0x19a263[_0xda65('0x4b')]=_['intersection'](_0x5427d6['model'],qs['fields'](_0x1d889a[_0xda65('0x45')][_0xda65('0x5c')]));_0x19a263[_0xda65('0x4b')]=_0x19a263[_0xda65('0x4b')]['length']?_0x19a263['attributes']:_0x5427d6[_0xda65('0x5b')];_0x19a263['order']=qs['sort'](_0x1d889a[_0xda65('0x45')][_0xda65('0xce')]);_0x19a263[_0xda65('0x44')]=qs['filters'](_[_0xda65('0xd6')](_0x1d889a[_0xda65('0x45')],_0x5427d6['filters']));if(_0x1d889a[_0xda65('0x45')]['filter']){_0x19a263['where']=_[_0xda65('0x5e')](_0x19a263[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x19a263[_0xda65('0x4b')],function(_0x4cd8a6){var _0x421956={};_0x421956[_0x4cd8a6]={'$like':'%'+_0x1d889a[_0xda65('0x45')][_0xda65('0x34')]+'%'};return _0x421956;})});}_0x19a263=_[_0xda65('0x5e')]({},_0x19a263,_0x1d889a['options']);return _0x8014a7[_0xda65('0xe4')](_0x19a263);}})[_0xda65('0x1a')](function(_0x5413ea){if(_0x5413ea){_0x148bc2=_0x5413ea['length'];if(!_0x1d889a['query']['hasOwnProperty']('nolimit')){_0x19a263[_0xda65('0x27')]=qs[_0xda65('0x27')](_0x1d889a[_0xda65('0x45')][_0xda65('0x27')]);_0x19a263['offset']=qs[_0xda65('0x25')](_0x1d889a[_0xda65('0x45')][_0xda65('0x25')]);}return _0x8014a7[_0xda65('0xe4')](_0x19a263);}})[_0xda65('0x1a')](function(_0x2fa171){if(_0x2fa171){return _0x2fa171?{'count':_0x148bc2,'rows':_0x2fa171}:null;}})[_0xda65('0x1a')](respondWithResult(_0x179883,null))['catch'](handleError(_0x179883,null));};exports['getFaxInteractions']=function(_0x4fa860,_0x290f0e){var _0xa817af={};var _0xefb2b6={};var _0x3e2457;var _0x39a9c3;return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x4fa860[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x290f0e,null))[_0xda65('0x1a')](function(_0x1e9f07){if(_0x1e9f07){_0x3e2457=_0x1e9f07;_0xefb2b6['model']=_[_0xda65('0x57')](db['FaxInteraction'][_0xda65('0x3e')]);_0xefb2b6['query']=_[_0xda65('0x57')](_0x4fa860['query']);_0xefb2b6[_0xda65('0x59')]=_[_0xda65('0x5a')](_0xefb2b6['model'],_0xefb2b6[_0xda65('0x45')]);_0xa817af['attributes']=_[_0xda65('0x5a')](_0xefb2b6[_0xda65('0x5b')],qs['fields'](_0x4fa860[_0xda65('0x45')][_0xda65('0x5c')]));_0xa817af[_0xda65('0x4b')]=_0xa817af[_0xda65('0x4b')][_0xda65('0x5d')]?_0xa817af[_0xda65('0x4b')]:_0xefb2b6[_0xda65('0x5b')];_0xa817af[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x4fa860[_0xda65('0x45')][_0xda65('0xce')]);_0xa817af[_0xda65('0x44')]=qs[_0xda65('0x59')](_[_0xda65('0xd6')](_0x4fa860['query'],_0xefb2b6['filters']));if(_0x4fa860['query']['filter']){_0xa817af[_0xda65('0x44')]=_[_0xda65('0x5e')](_0xa817af[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0xa817af['attributes'],function(_0x59e2a0){var _0x4f25e7={};_0x4f25e7[_0x59e2a0]={'$like':'%'+_0x4fa860[_0xda65('0x45')][_0xda65('0x34')]+'%'};return _0x4f25e7;})});}_0xa817af=_[_0xda65('0x5e')]({},_0xa817af,_0x4fa860[_0xda65('0x5f')]);return _0x3e2457[_0xda65('0xe5')](_0xa817af);}})[_0xda65('0x1a')](function(_0xc111a6){if(_0xc111a6){_0x39a9c3=_0xc111a6[_0xda65('0x5d')];if(!_0x4fa860[_0xda65('0x45')][_0xda65('0xcf')](_0xda65('0xd4'))){_0xa817af['limit']=qs['limit'](_0x4fa860['query']['limit']);_0xa817af[_0xda65('0x25')]=qs['offset'](_0x4fa860[_0xda65('0x45')][_0xda65('0x25')]);}return _0x3e2457[_0xda65('0xe5')](_0xa817af);}})['then'](function(_0x4ce919){if(_0x4ce919){return _0x4ce919?{'count':_0x39a9c3,'rows':_0x4ce919}:null;}})[_0xda65('0x1a')](respondWithResult(_0x290f0e,null))['catch'](handleError(_0x290f0e,null));};exports[_0xda65('0xe6')]=function(_0x3dae91,_0x4485c4){var _0x5929bd={};var _0x4886cb={};var _0x296cbc;var _0xb17f02;return db[_0xda65('0x3d')]['findOne']({'where':{'id':_0x3dae91[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x4485c4,null))[_0xda65('0x1a')](function(_0x285346){if(_0x285346){_0x296cbc=_0x285346;_0x4886cb['model']=_[_0xda65('0x57')](db[_0xda65('0xe7')][_0xda65('0x3e')]);_0x4886cb['query']=_[_0xda65('0x57')](_0x3dae91[_0xda65('0x45')]);_0x4886cb[_0xda65('0x59')]=_['intersection'](_0x4886cb[_0xda65('0x5b')],_0x4886cb[_0xda65('0x45')]);_0x5929bd[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x4886cb['model'],qs[_0xda65('0x5c')](_0x3dae91['query'][_0xda65('0x5c')]));_0x5929bd['attributes']=_0x5929bd['attributes'][_0xda65('0x5d')]?_0x5929bd[_0xda65('0x4b')]:_0x4886cb[_0xda65('0x5b')];_0x5929bd['order']=qs['sort'](_0x3dae91['query']['sort']);_0x5929bd[_0xda65('0x44')]=qs[_0xda65('0x59')](_[_0xda65('0xd6')](_0x3dae91['query'],_0x4886cb[_0xda65('0x59')]));if(_0x3dae91['query'][_0xda65('0x34')]){_0x5929bd['where']=_[_0xda65('0x5e')](_0x5929bd[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x5929bd[_0xda65('0x4b')],function(_0x266541){var _0x36b745={};_0x36b745[_0x266541]={'$like':'%'+_0x3dae91[_0xda65('0x45')][_0xda65('0x34')]+'%'};return _0x36b745;})});}_0x5929bd=_[_0xda65('0x5e')]({},_0x5929bd,_0x3dae91[_0xda65('0x5f')]);return _0x296cbc['getWhatsappInteractions'](_0x5929bd);}})[_0xda65('0x1a')](function(_0x584c58){if(_0x584c58){_0xb17f02=_0x584c58['length'];if(!_0x3dae91['query'][_0xda65('0xcf')]('nolimit')){_0x5929bd['limit']=qs[_0xda65('0x27')](_0x3dae91[_0xda65('0x45')][_0xda65('0x27')]);_0x5929bd['offset']=qs[_0xda65('0x25')](_0x3dae91['query'][_0xda65('0x25')]);}return _0x296cbc[_0xda65('0xe6')](_0x5929bd);}})['then'](function(_0x29f76f){if(_0x29f76f){return _0x29f76f?{'count':_0xb17f02,'rows':_0x29f76f}:null;}})[_0xda65('0x1a')](respondWithResult(_0x4485c4,null))['catch'](handleError(_0x4485c4,null));};exports['login']=function(_0x2e696c,_0x105f8e,_0x3995f9){var _0x46ca2b;var _0x5627c8;var _0x5ccf23;var _0x272195=!_['isNil'](_0x2e696c[_0xda65('0x63')]['id'])?_0x2e696c[_0xda65('0x63')]['id']:!_[_0xda65('0x6f')](_0x2e696c['user']['id'])?_0x2e696c[_0xda65('0x30')]['id']:null;return db['User'][_0xda65('0x37')]({'where':{'id':_0x272195,'role':{'$or':[_0xda65('0x2e'),_0xda65('0x30'),_0xda65('0x32')]}},'attributes':['id',_0xda65('0x3a'),_0xda65('0xe8'),_0xda65('0xe9'),_0xda65('0x2d'),'internal',_0xda65('0xa2')]})[_0xda65('0x1a')](function(_0x42f46f){if(_0x42f46f){if(_0x42f46f[_0xda65('0x2d')]===_0xda65('0x32')){_0x46ca2b=_0x42f46f;if(_0x2e696c[_0xda65('0x62')][_0xda65('0xa3')]){_0x5ccf23=util[_0xda65('0xac')](_0xda65('0xea'),_0x46ca2b[_0x2e696c[_0xda65('0x62')][_0xda65('0xa3')]]);}else if(_0x2e696c[_0xda65('0x62')][_0xda65('0xeb')]){_0x5ccf23=util[_0xda65('0xac')](_0xda65('0xec'),_0x2e696c[_0xda65('0x62')]['intrf']);}else{_0x5ccf23=util[_0xda65('0xac')]('SIP/%s',_0x46ca2b[_0xda65('0x3a')]);}socket['to'](util[_0xda65('0xac')]('user:%s',_0x46ca2b[_0xda65('0x3a')]))['emit'](_0xda65('0xed'),{'user':{'id':_0x46ca2b['id'],'name':_0x46ca2b[_0xda65('0x3a')]},'ip':_0x2e696c[_0xda65('0xee')][_0xda65('0xef')]||_0x2e696c['connection'][_0xda65('0xf0')]||_0x2e696c[_0xda65('0xf1')][_0xda65('0xf0')]||_0x2e696c[_0xda65('0xf2')][_0xda65('0xf1')][_0xda65('0xf0')]});return db[_0xda65('0xaf')][_0xda65('0x2b')]({'where':{'membername':_0x46ca2b['name']},'individualHooks':!![]});}}else{throw new db[(_0xda65('0x97'))]['ValidationError'](_0xda65('0xf3'));}})[_0xda65('0x1a')](function(){if(_0x46ca2b){return _0x46ca2b['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x3d7459){if(_0x46ca2b){if(_0x3d7459){_0x5627c8=_0x3d7459;if(_0x5627c8['length']){var _0x5d5b89=_0x5627c8[_0xda65('0x3f')](function(_0x15a0e0){var _0x5b5d0c={'membername':_0x46ca2b[_0xda65('0x3a')],'UserId':_0x46ca2b['id'],'queue_name':_0x15a0e0[_0xda65('0x3a')],'VoiceQueueId':_0x15a0e0['id'],'interface':_0x5ccf23,'paused':_0x46ca2b[_0xda65('0xa2')]||![],'penalty':_0x15a0e0[_0xda65('0xf4')]||0x0};return db[_0xda65('0xaf')][_0xda65('0xb0')](_0x5b5d0c);});return Promise[_0xda65('0x60')](_0x5d5b89);}}}})['then'](function(){if(_0x46ca2b){return db[_0xda65('0xf5')]['findAll']({'where':{'membername':_0x46ca2b[_0xda65('0x3a')],'exitAt':null}});}})[_0xda65('0x1a')](function(_0x460366){if(_0x46ca2b){var _0x5dbb69=[];_0x460366[_0xda65('0xf6')](function(_0x571aff){_0x5dbb69[_0xda65('0x4c')](_0x571aff['update']({'exitAt':moment()[_0xda65('0xac')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xda65('0x60')](_0x5dbb69);}})[_0xda65('0x1a')](function(){if(_0x46ca2b){var _0x11cc33=[];var _0x5add01=[];var _0x29c490=utils['getChannels']();var _0x4cbfa3={'membername':_0x46ca2b[_0xda65('0x3a')],'interface':_0x5ccf23,'enterAt':moment()[_0xda65('0xac')](_0xda65('0xf7')),'role':_0x46ca2b[_0xda65('0x2d')],'internal':_0x46ca2b[_0xda65('0x68')]};_0x29c490[_0xda65('0xf6')](function(_0x66351f){_0x11cc33[_0xda65('0x4c')](_['merge']({'channel':_0x66351f,'type':_0xda65('0xf8'),'data1':_0x2e696c[_0xda65('0x62')][_0xda65('0xf9')],'data2':_0x5ccf23},_0x4cbfa3));if(_0x46ca2b[_0xda65('0xa2')]){_0x5add01[_0xda65('0x4c')](_[_0xda65('0x5e')]({'channel':_0x66351f,'type':_0xda65('0xfa'),'data1':'LOGININPAUSE'},_0x4cbfa3));}});return db[_0xda65('0xf5')][_0xda65('0x8a')](_0x11cc33[_0xda65('0xca')](_0x5add01),{'individualHooks':!![]});}})[_0xda65('0x1a')](function(){if(_0x46ca2b){return _0x46ca2b[_0xda65('0x61')]({'online':!![],'lastLoginAt':moment()[_0xda65('0xac')](_0xda65('0xf7')),'voicePause':_0x46ca2b['loginInPause']||![],'mailPause':_0x46ca2b[_0xda65('0xa2')]||![],'chatPause':_0x46ca2b[_0xda65('0xa2')]||![],'faxPause':_0x46ca2b[_0xda65('0xa2')]||![],'smsPause':_0x46ca2b[_0xda65('0xa2')]||![],'openchannelPause':_0x46ca2b[_0xda65('0xa2')]||![],'whatsappPause':_0x46ca2b[_0xda65('0xa2')]||![],'pauseType':_0x46ca2b[_0xda65('0xa2')]?'LOGININPAUSE':null,'interface':_0x5ccf23,'lastPauseAt':moment()[_0xda65('0xac')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xda65('0x1a')](function(_0x590891){if(_0x2e696c[_0xda65('0xfb')]){return _0x3995f9();}else{return Promise[_0xda65('0xfc')](_0x590891)[_0xda65('0x1a')](respondWithResult(_0x105f8e,null));}})[_0xda65('0x56')](handleError(_0x105f8e,null));};exports[_0xda65('0xfd')]=function(_0x3122c8,_0x2c0693){var _0x326500;return db[_0xda65('0x3d')]['find']({'where':{'id':_0x3122c8[_0xda65('0x63')]['id'],'role':_0xda65('0x32')},'attributes':['id',_0xda65('0x3a'),'role']})['then'](handleEntityNotFound(_0x2c0693,null))[_0xda65('0x1a')](function(_0x4921ef){if(_0x4921ef){_0x326500=_0x4921ef;return db[_0xda65('0xaf')][_0xda65('0x2b')]({'where':{'membername':_0x326500[_0xda65('0x3a')]},'individualHooks':!![]});}})[_0xda65('0x1a')](function(){return db[_0xda65('0xf5')]['findAll']({'where':{'membername':_0x326500[_0xda65('0x3a')],'exitAt':null}});})[_0xda65('0x1a')](function(_0x101858){var _0x47c236=[];_0x101858[_0xda65('0xf6')](function(_0x183c24){_0x47c236[_0xda65('0x4c')](_0x183c24[_0xda65('0x61')]({'exitAt':moment()[_0xda65('0xac')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x47c236);})[_0xda65('0x1a')](function(){return _0x326500[_0xda65('0x61')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xda65('0x1a')](respondWithResult(_0x2c0693,null))[_0xda65('0x56')](handleError(_0x2c0693,null));};exports[_0xda65('0xfe')]=function(_0x230722,_0x34c4d7){var _0x2e3594;return db[_0xda65('0xaf')][_0xda65('0x61')]({'paused':0x1},{'where':{'UserId':_0x230722[_0xda65('0x63')]['id']},'individualHooks':!![]})[_0xda65('0x1a')](function(){return db[_0xda65('0x3d')][_0xda65('0x37')]({'where':{'id':_0x230722[_0xda65('0x63')]['id'],'role':_0xda65('0x32')},'attributes':['id',_0xda65('0x3a'),_0xda65('0x2d'),_0xda65('0x68'),'interface',_0xda65('0xa1')]});})[_0xda65('0x1a')](handleEntityNotFound(_0x34c4d7,null))[_0xda65('0x1a')](function(_0x4b3650){if(_0x4b3650){_0x2e3594=_0x4b3650;return respondWithRpcPromise(_0xda65('0xff'),'pause',{'id':_0x2e3594['id'],'name':_0x2e3594[_0xda65('0x3a')],'pause':!![]});}})[_0xda65('0x1a')](function(){if(_0x2e3594){return db[_0xda65('0xf5')]['findAll']({'where':{'membername':_0x2e3594[_0xda65('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0xda65('0x1a')](function(_0x4ec1ea){if(_0x4ec1ea[_0xda65('0x5d')]){var _0x538e31=moment()[_0xda65('0xac')](_0xda65('0xf7'));for(var _0x368d0f=0x0,_0x3d3d74=_0x4ec1ea['length'];_0x368d0f<_0x3d3d74;_0x368d0f++){_0x4ec1ea[_0x368d0f][_0xda65('0x100')]({'exitAt':_0x538e31});}}})[_0xda65('0x1a')](function(){var _0x11bdd6=[];var _0x420d37=utils[_0xda65('0x101')]();_0x420d37[_0xda65('0xf6')](function(_0x460555){_0x11bdd6[_0xda65('0x4c')]({'channel':_0x460555,'membername':_0x2e3594[_0xda65('0x3a')],'interface':_[_0xda65('0x6f')](_0x2e3594[_0xda65('0xa3')])?util[_0xda65('0xac')](_0xda65('0xec'),_0x2e3594[_0xda65('0x3a')]):_0x2e3594['interface'],'type':'PAUSE','enterAt':moment()[_0xda65('0xac')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x230722[_0xda65('0x62')][_0xda65('0x102')]||'DEFAULT\x20PAUSE','role':_0x2e3594[_0xda65('0x2d')],'internal':_0x2e3594[_0xda65('0x68')]});});return db[_0xda65('0xf5')]['bulkCreate'](_0x11bdd6,{'individualHooks':!![]});})['then'](function(){return _0x2e3594['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x230722['body'][_0xda65('0x102')]||_0xda65('0x103'),'lastPauseAt':moment()[_0xda65('0xac')](_0xda65('0xf7'))});})[_0xda65('0x1a')](respondWithResult(_0x34c4d7,null))['catch'](handleError(_0x34c4d7,null));};exports[_0xda65('0x104')]=function(_0x4411e5,_0x4a727a){if(_0x4411e5[_0xda65('0x62')][_0xda65('0xa0')]&&!utils[_0xda65('0xa4')](_0x4411e5[_0xda65('0x62')]['channel'])){throw new APIBadRequestError(util[_0xda65('0xac')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x4411e5[_0xda65('0x62')][_0xda65('0xa0')]));}return db['User'][_0xda65('0x37')]({'where':{'id':_0x4411e5[_0xda65('0x63')]['id']},'attributes':['id',_0xda65('0x3a'),_0xda65('0x2d'),_0xda65('0x68'),_0xda65('0xa3'),_0xda65('0xa1'),'voicePause',_0xda65('0x105'),_0xda65('0x106'),'faxPause',_0xda65('0x107'),'smsPause','whatsappPause','pauseType',_0xda65('0x108')]})[_0xda65('0x1a')](function(_0x79b40){if(!_0x79b40){throw new APINotFoundError(util[_0xda65('0xac')](_0xda65('0x109'),_0x4411e5['params']['id']));}return _0x79b40[_0xda65('0x104')](_0x4411e5[_0xda65('0x62')][_0xda65('0xa0')]);})['then'](respondWithResult(_0x4a727a,null))[_0xda65('0x56')](APIHandleError(_0x4a727a));};exports[_0xda65('0x10a')]=function(_0x3da970,_0x3bdba6){var _0x363ae9={};var _0x2fbadf={};var _0x361f42;var _0x2a3bec;return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x3da970[_0xda65('0x63')]['id']}})['then'](handleEntityNotFound(_0x3bdba6,null))['then'](function(_0x2659ec){if(_0x2659ec){_0x361f42=_0x2659ec;_0x2fbadf['model']=_['keys'](db[_0xda65('0x10b')][_0xda65('0x3e')]);_0x2fbadf[_0xda65('0x45')]=_[_0xda65('0x57')](_0x3da970[_0xda65('0x45')]);_0x2fbadf[_0xda65('0x59')]=_['intersection'](_0x2fbadf[_0xda65('0x5b')],_0x2fbadf[_0xda65('0x45')]);_0x363ae9[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x2fbadf['model'],qs['fields'](_0x3da970['query'][_0xda65('0x5c')]));_0x363ae9[_0xda65('0x4b')]=_0x363ae9[_0xda65('0x4b')]['length']?_0x363ae9[_0xda65('0x4b')]:_0x2fbadf[_0xda65('0x5b')];_0x363ae9[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x3da970['query'][_0xda65('0xce')]);_0x363ae9['where']=qs[_0xda65('0x59')](_[_0xda65('0xd6')](_0x3da970[_0xda65('0x45')],_0x2fbadf[_0xda65('0x59')]));if(_0x3da970['query']['filter']){_0x363ae9['where']=_['merge'](_0x363ae9['where'],{'$or':_[_0xda65('0x3f')](_0x363ae9['attributes'],function(_0x19f409){var _0x1c1997={};_0x1c1997[_0x19f409]={'$like':'%'+_0x3da970[_0xda65('0x45')][_0xda65('0x34')]+'%'};return _0x1c1997;})});}_0x363ae9=_[_0xda65('0x5e')]({},_0x363ae9,_0x3da970[_0xda65('0x5f')]);return _0x361f42[_0xda65('0x10a')](_0x363ae9);}})[_0xda65('0x1a')](function(_0x38537c){if(_0x38537c){_0x2a3bec=_0x38537c[_0xda65('0x5d')];if(!_0x3da970['query'][_0xda65('0xcf')](_0xda65('0xd4'))){_0x363ae9[_0xda65('0x27')]=qs['limit'](_0x3da970[_0xda65('0x45')]['limit']);_0x363ae9[_0xda65('0x25')]=qs[_0xda65('0x25')](_0x3da970[_0xda65('0x45')]['offset']);}return _0x361f42[_0xda65('0x10a')](_0x363ae9);}})['then'](function(_0x1b4d58){if(_0x1b4d58){return _0x1b4d58?{'count':_0x2a3bec,'rows':_0x1b4d58}:null;}})[_0xda65('0x1a')](respondWithResult(_0x3bdba6,null))[_0xda65('0x56')](handleError(_0x3bdba6,null));};exports[_0xda65('0x10c')]=function(_0x16187a,_0x24c1ee){var _0x4b7a0f=_0x16187a[_0xda65('0x63')]['id'];var _0x46d290=_0x16187a[_0xda65('0x62')]?_0x16187a[_0xda65('0x62')][_0xda65('0x66')]:null;var _0x198847=[];return Promise[_0xda65('0xfc')]()[_0xda65('0x1a')](function(){if(!_0x46d290)throw new APIBadRequestError(_0xda65('0x10d'));})[_0xda65('0x1a')](function(){return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x4b7a0f}});})[_0xda65('0x1a')](function(_0x2abfbd){if(!_0x2abfbd)throw new APINotFoundError(util[_0xda65('0xac')](_0xda65('0x109'),_0x16187a[_0xda65('0x63')]['id']));return db['sequelize'][_0xda65('0x10e')](function(_0x371478){return _0x2abfbd[_0xda65('0x10c')](_0x46d290,{'transaction':_0x371478})['then'](function(){return db[_0xda65('0x10b')][_0xda65('0x4d')]({'where':{'id':{'$in':_0x46d290}}});})[_0xda65('0x1a')](function(_0x766393){var _0x749da6=_[_0xda65('0x3f')](_0x766393,function(_0x4c1714){return _0x4c1714[_0xda65('0x10f')]();});return Promise[_0xda65('0x60')](_0x749da6);})[_0xda65('0x1a')](function(_0x19f140){_0x198847=_['flattenDeep'](_0x19f140);var _0x42bad3=_[_0xda65('0x3f')](_0x198847,function(_0x2a1f61){return _0x2a1f61[_0xda65('0x110')](_0x2abfbd['id'],{'transaction':_0x371478});});return Promise['all'](_0x42bad3);})['then'](function(){if(!_0x2abfbd[_0xda65('0xa1')])return;var _0x52c088=_[_0xda65('0x34')](_0x198847,function(_0x5915d9){return _0x5915d9['getDataValue'](_0xda65('0xa0'))===_0xda65('0x111');});var _0xb3d053=_['map'](_0x52c088,function(_0x3db6f7){return db[_0xda65('0xaf')]['upsert']({'membername':_0x2abfbd['name'],'UserId':_0x2abfbd['id'],'queue_name':_0x3db6f7[_0xda65('0x3a')],'VoiceQueueId':_0x3db6f7['id'],'interface':_[_0xda65('0x6f')](_0x2abfbd['interface'])?util['format'](_0xda65('0xec'),_0x2abfbd[_0xda65('0x3a')]):_0x2abfbd['interface'],'paused':_0x2abfbd[_0xda65('0xad')]||![],'penalty':_0x2abfbd['penalty']},{'transaction':_0x371478});});return Promise[_0xda65('0x60')](_0xb3d053);})['then'](function(){return db[_0xda65('0x112')]['findAll']({'where':{'teamId':{'$in':_0x46d290}}});})[_0xda65('0x1a')](function(_0xa39517){var _0x357d02=_[_0xda65('0x3f')](_0xa39517,function(_0x4f2690){return db[_0xda65('0x113')][_0xda65('0x84')]({'UserId':_0x2abfbd['id'],'VoicePrefixId':_0x4f2690[_0xda65('0x114')]},{'transaction':_0x371478});});return Promise['all'](_0x357d02);});});})[_0xda65('0x1a')](function(){for(var _0x2b24d3=0x0;_0x2b24d3<_0x198847[_0xda65('0x5d')];_0x2b24d3++){var _0x40a570=_0x198847[_0x2b24d3]['getDataValue'](_0xda65('0xa0'));var _0x523442=_0x40a570+'QueueId';socket[_0xda65('0xa8')](_0xda65('0x30')+_0x40a570+'Queue:save',{'UserId':_0x4b7a0f,['queueField']:_0x198847[_0x2b24d3]['id']});}})[_0xda65('0x1a')](respondWithStatusCode(_0x24c1ee,null))[_0xda65('0x56')](APIHandleError(_0x24c1ee));};exports[_0xda65('0x115')]=function(_0x1d28fd,_0x134745){var _0x2546ea=_0x1d28fd['params']['id'];var _0x390045=null;if(_0x1d28fd[_0xda65('0x45')]['ids']){_0x390045=_[_0xda65('0xb2')](_0x1d28fd[_0xda65('0x45')]['ids'])?_0x1d28fd[_0xda65('0x45')][_0xda65('0x66')]:[_0x1d28fd['query'][_0xda65('0x66')]];}var _0x330030=[];return Promise[_0xda65('0xfc')]()[_0xda65('0x1a')](function(){if(!_0x390045)throw new APIBadRequestError(_0xda65('0x116'));})[_0xda65('0x1a')](function(){return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x2546ea}});})[_0xda65('0x1a')](function(_0x3a0c78){if(!_0x3a0c78)throw new APINotFoundError(util[_0xda65('0xac')](_0xda65('0x109'),_0x1d28fd[_0xda65('0x63')]['id']));return db[_0xda65('0x70')][_0xda65('0x10e')](function(_0x51d5cb){return _0x3a0c78[_0xda65('0x115')](_0x390045,{'transaction':_0x51d5cb})[_0xda65('0x1a')](function(){return db[_0xda65('0x10b')][_0xda65('0x4d')]({'where':{'id':{'$in':_0x390045}}});})[_0xda65('0x1a')](function(_0x2492c5){var _0x55ca53=_[_0xda65('0x3f')](_0x2492c5,function(_0x10495d){return _0x10495d[_0xda65('0x10f')]();});return Promise['all'](_0x55ca53);})[_0xda65('0x1a')](function(_0x1a8be5){_0x330030=_[_0xda65('0x117')](_0x1a8be5);var _0x556dc9=_[_0xda65('0x3f')](_0x330030,function(_0x44fa9b){return _0x44fa9b[_0xda65('0x118')](_0x3a0c78['id'],{'transaction':_0x51d5cb});});return Promise[_0xda65('0x60')](_0x556dc9);})['then'](function(){if(!_0x3a0c78[_0xda65('0xa1')])return;var _0x1b70df=_[_0xda65('0x34')](_0x330030,function(_0x3ecd83){return _0x3ecd83[_0xda65('0x119')](_0xda65('0xa0'))===_0xda65('0x111');});var _0xd8a455=_[_0xda65('0x3f')](_0x1b70df,function(_0x285a39){return db[_0xda65('0xaf')]['destroy']({'where':{'VoiceQueueId':_0x285a39['id'],'UserId':_0x3a0c78['id']},'transaction':_0x51d5cb});});return Promise[_0xda65('0x60')](_0xd8a455);})[_0xda65('0x1a')](function(){return db[_0xda65('0x112')][_0xda65('0x4d')]({'where':{'teamId':{'$in':_0x390045}}});})[_0xda65('0x1a')](function(_0x3ab45b){var _0x57d3fa=_[_0xda65('0x3f')](_0x3ab45b,function(_0x10ba07){return db[_0xda65('0x113')][_0xda65('0x2b')]({'where':{'UserId':_0x3a0c78['id'],'VoicePrefixId':_0x10ba07[_0xda65('0x114')]}},{'transaction':_0x51d5cb});});return Promise[_0xda65('0x60')](_0x57d3fa);});});})[_0xda65('0x1a')](function(){for(var _0x2c0de8=0x0;_0x2c0de8<_0x330030[_0xda65('0x5d')];_0x2c0de8++){var _0x31d983=_0x330030[_0x2c0de8][_0xda65('0x119')](_0xda65('0xa0'));var _0x431bb5=_0x31d983+_0xda65('0xa7');socket[_0xda65('0xa8')](_0xda65('0x30')+_0x31d983+'Queue:remove',{'UserId':_0x2546ea,['queueField']:_0x330030[_0x2c0de8]['id']});}})[_0xda65('0x1a')](respondWithStatusCode(_0x134745,null))[_0xda65('0x56')](APIHandleError(_0x134745));};exports[_0xda65('0x11a')]=function(_0x442d25,_0x697728){var _0x50e7c2={};var _0x5bd00e={};var _0x2e8ba2;var _0x40047e;return db['User']['findOne']({'where':{'id':_0x442d25[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x697728,null))[_0xda65('0x1a')](function(_0x5c2004){if(_0x5c2004){_0x2e8ba2=_0x5c2004;_0x5bd00e['model']=_[_0xda65('0x57')](db[_0xda65('0xd0')][_0xda65('0x3e')]);_0x5bd00e[_0xda65('0x45')]=_[_0xda65('0x57')](_0x442d25[_0xda65('0x45')]);_0x5bd00e[_0xda65('0x59')]=_[_0xda65('0x5a')](_0x5bd00e['model'],_0x5bd00e[_0xda65('0x45')]);_0x50e7c2[_0xda65('0x4b')]=_[_0xda65('0x5a')](_0x5bd00e[_0xda65('0x5b')],qs['fields'](_0x442d25[_0xda65('0x45')]['fields']));_0x50e7c2[_0xda65('0x4b')]=_0x50e7c2[_0xda65('0x4b')][_0xda65('0x5d')]?_0x50e7c2[_0xda65('0x4b')]:_0x5bd00e[_0xda65('0x5b')];_0x50e7c2[_0xda65('0xcd')]=qs[_0xda65('0xce')](_0x442d25[_0xda65('0x45')]['sort']);_0x50e7c2[_0xda65('0x44')]=qs[_0xda65('0x59')](_[_0xda65('0xd6')](_0x442d25[_0xda65('0x45')],_0x5bd00e[_0xda65('0x59')]));if(_0x442d25['query'][_0xda65('0x34')]){_0x50e7c2[_0xda65('0x44')]=_[_0xda65('0x5e')](_0x50e7c2[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x50e7c2['attributes'],function(_0xc96911){var _0x19b623={};_0x19b623[_0xc96911]={'$like':'%'+_0x442d25[_0xda65('0x45')][_0xda65('0x34')]+'%'};return _0x19b623;})});}_0x50e7c2=_['merge']({},_0x50e7c2,_0x442d25[_0xda65('0x5f')]);return _0x2e8ba2[_0xda65('0x11a')](_0x50e7c2);}})[_0xda65('0x1a')](function(_0x4d4cc3){if(_0x4d4cc3){_0x40047e=_0x4d4cc3['length'];if(!_0x442d25[_0xda65('0x45')][_0xda65('0xcf')]('nolimit')){_0x50e7c2[_0xda65('0x27')]=qs['limit'](_0x442d25[_0xda65('0x45')]['limit']);_0x50e7c2['offset']=qs[_0xda65('0x25')](_0x442d25[_0xda65('0x45')][_0xda65('0x25')]);}return _0x2e8ba2[_0xda65('0x11a')](_0x50e7c2);}})[_0xda65('0x1a')](function(_0x2f9374){if(_0x2f9374){return _0x2f9374?{'count':_0x40047e,'rows':_0x2f9374}:null;}})[_0xda65('0x1a')](respondWithResult(_0x697728,null))[_0xda65('0x56')](handleError(_0x697728,null));};exports[_0xda65('0x11b')]=function(_0x3b1d2a,_0x2dfea4){var _0x10f73e={};var _0x1a07c4={};var _0x68448d;return db[_0xda65('0x3d')][_0xda65('0x9b')]({'where':{'id':_0x3b1d2a[_0xda65('0x63')]['id']}})[_0xda65('0x1a')](handleEntityNotFound(_0x2dfea4,null))[_0xda65('0x1a')](function(_0x27ea1e){if(_0x27ea1e){_0x68448d=_0x27ea1e;_0x1a07c4[_0xda65('0x5b')]=_[_0xda65('0x57')](db[_0xda65('0x3d')][_0xda65('0x3e')]);_0x1a07c4[_0xda65('0x45')]=_[_0xda65('0x57')](_0x3b1d2a['query']);_0x1a07c4['filters']=_['intersection'](_0x1a07c4[_0xda65('0x5b')],_0x1a07c4['query']);_0x10f73e['attributes']=_[_0xda65('0x5a')](_0x1a07c4[_0xda65('0x5b')],qs[_0xda65('0x5c')](_0x3b1d2a['query'][_0xda65('0x5c')]));_0x10f73e[_0xda65('0x4b')]=_0x10f73e['attributes'][_0xda65('0x5d')]?_0x10f73e['attributes']:_0x1a07c4[_0xda65('0x5b')];_0x10f73e['order']=qs[_0xda65('0xce')](_0x3b1d2a[_0xda65('0x45')][_0xda65('0xce')]);_0x10f73e[_0xda65('0x44')]=qs[_0xda65('0x59')](_[_0xda65('0xd6')](_0x3b1d2a['query'],_0x1a07c4['filters']));if(_0x3b1d2a['query'][_0xda65('0x34')]){_0x10f73e[_0xda65('0x44')]=_[_0xda65('0x5e')](_0x10f73e[_0xda65('0x44')],{'$or':_[_0xda65('0x3f')](_0x10f73e['attributes'],function(_0x379a9d){var _0x360899={};_0x360899[_0x379a9d]={'$like':'%'+_0x3b1d2a['query'][_0xda65('0x34')]+'%'};return _0x360899;})});}_0x10f73e[_0xda65('0x5b')]=db['User'];_0x10f73e['as']='Agents';_0x10f73e=_['merge']({},_0x10f73e,_0x3b1d2a['options']);return _0x68448d[_0xda65('0x11c')]({'include':[_0x10f73e]});}})[_0xda65('0x1a')](function(_0x1895f6){if(_0x1895f6){var _0x990e0e={},_0x37e869=[];for(var _0x5212e1=0x0;_0x5212e1<_0x1895f6[_0xda65('0x5d')];_0x5212e1+=0x1){for(var _0x59bf0d=0x0,_0x3f8341;_0x59bf0d<_0x1895f6[_0x5212e1][_0xda65('0x31')][_0xda65('0x5d')];_0x59bf0d+=0x1){_0x3f8341=_0x1895f6[_0x5212e1]['Agents'][_0x59bf0d][_0xda65('0x2c')]({'plain':!![]});_0x990e0e[_0x3f8341['id']]=_0x3f8341;}}_0x990e0e=_[_0xda65('0x11d')](_0x990e0e);for(var _0x96892=qs['offset'](_0x3b1d2a[_0xda65('0x45')]['offset']);_0x96892<_0x990e0e['length']&&_0x37e869[_0xda65('0x5d')]=_0x1875a3['agents']){throw new Error(_0xe81b('0x4c'));}})['then'](function(){if(_0x508850){return db[_0xe81b('0x43')][_0xe81b('0x44')]({'where':{'membername':_0x508850[_0xe81b('0x22')]},'individualHooks':!![]});}})[_0xe81b('0x18')](function(){if(_0x508850){return _0x508850[_0xe81b('0x4d')]({'raw':!![]});}})[_0xe81b('0x18')](function(_0x403bdb){if(_0x508850){if(_0x403bdb){var _0xf4070a=[];_0x366e45=_0x403bdb;if(_0x366e45['length']){for(var _0x3ffc69=0x0;_0x3ffc69<_0x366e45[_0xe81b('0x28')];_0x3ffc69++){_0xf4070a['push'](db['UserVoiceQueueRt'][_0xe81b('0x4e')]({'membername':_0x508850['name'],'UserId':_0x508850['id'],'queue_name':_0x366e45[_0x3ffc69]['name'],'VoiceQueueId':_0x366e45[_0x3ffc69]['id'],'interface':_0x2f98d2,'paused':_0x508850[_0xe81b('0x4f')]||![],'penalty':_0x366e45[_0x3ffc69][_0xe81b('0x50')]||0x0}));}return BPromise['all'](_0xf4070a);}}}})[_0xe81b('0x18')](function(){if(_0x508850){return db[_0xe81b('0x26')][_0xe81b('0xf')]({'where':{'membername':_0x508850[_0xe81b('0x22')],'exitAt':null}});}})['then'](function(_0x217a33){if(_0x508850){if(_0x217a33&&_0x217a33['length']){var _0x4438eb=[];_0x217a33[_0xe81b('0x2c')](function(_0xd245e3){_0x4438eb[_0xe81b('0x2d')](_0xd245e3[_0xe81b('0x25')]({'exitAt':moment()['format'](_0xe81b('0x2a'))}));});return BPromise['all'](_0x4438eb);}}})[_0xe81b('0x18')](function(){if(_0x508850){var _0x506cba=[];var _0x4bbe82=[];var _0x12fe00=utils[_0xe81b('0x2b')]();var _0x43db2a={'membername':_0x508850[_0xe81b('0x22')],'interface':_0x2f98d2,'enterAt':moment()[_0xe81b('0x29')](_0xe81b('0x2a')),'role':_0x508850['role'],'internal':_0x508850[_0xe81b('0x23')]};_0x12fe00[_0xe81b('0x2c')](function(_0x4aa7ba){_0x506cba['push'](_[_0xe81b('0x51')]({'channel':_0x4aa7ba,'type':_0xe81b('0x52'),'data1':_0xe81b('0x53'),'data2':_0x2f98d2},_0x43db2a));if(_0x508850[_0xe81b('0x4f')]){_0x4bbe82[_0xe81b('0x2d')](_[_0xe81b('0x51')]({'channel':_0x4aa7ba,'type':'PAUSE','data1':_0xe81b('0x54')},_0x43db2a));}});return db[_0xe81b('0x26')][_0xe81b('0x34')](_0x506cba['concat'](_0x4bbe82),{'individualHooks':!![]});}})[_0xe81b('0x18')](function(){if(_0x508850){return _0x508850[_0xe81b('0x25')]({'online':!![],'lastLoginAt':moment()['format'](_0xe81b('0x2a')),'voicePause':_0x508850['loginInPause']||![],'mailPause':_0x508850[_0xe81b('0x4f')]||![],'chatPause':_0x508850[_0xe81b('0x4f')]||![],'faxPause':_0x508850[_0xe81b('0x4f')]||![],'smsPause':_0x508850['loginInPause']||![],'openchannelPause':_0x508850[_0xe81b('0x4f')]||![],'pauseType':_0x508850['loginInPause']?_0xe81b('0x54'):null,'lastPauseAt':moment()[_0xe81b('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2f98d2});}})['then'](function(_0x32ea60){_0x451c26(_0x32ea60);})[_0xe81b('0x20')](function(_0x2c1425){_0x106ed9(_0x258269[_0xe81b('0x1b')](0x1f4,_0x2c1425[_0xe81b('0x1c')]));});});}; \ No newline at end of file +var _0x6eb9=['debug','error','message','ShowUser','stringify','catch','PauseUser','find','role','internal','interface','UserVoiceQueueRt','update','MemberReport','name','length','format','updateAttributes','getChannels','push','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','where','online','voicePause','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','LogoutUser','destroy','forEach','all','LoginUser','mobile','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','merge','LOGININPAUSE','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','defaults','redis','localhost','register','User','findAll','options','raw','attributes','limit','include','map','model','then','GetUser'];(function(_0x24fadb,_0x1ec5c7){var _0x4b6abc=function(_0x170622){while(--_0x170622){_0x24fadb['push'](_0x24fadb['shift']());}};_0x4b6abc(++_0x1ec5c7);}(_0x6eb9,0x141));var _0x96eb=function(_0x5912a0,_0x1f366f){_0x5912a0=_0x5912a0-0x0;var _0x1b69ea=_0x6eb9[_0x5912a0];return _0x1b69ea;};'use strict';var _=require(_0x96eb('0x0'));var util=require(_0x96eb('0x1'));var moment=require(_0x96eb('0x2'));var BPromise=require(_0x96eb('0x3'));var Redis=require('ioredis');var db=require(_0x96eb('0x4'))['db'];var utils=require(_0x96eb('0x5'));var logger=require(_0x96eb('0x6'))('rpc');var config=require(_0x96eb('0x7'));config['redis']=_[_0x96eb('0x8')](config[_0x96eb('0x9')],{'host':_0x96eb('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x96eb('0x9')]));require('./user.socket')[_0x96eb('0xb')](socket);exports['GetUser']=function(_0x427f84){var _0x3d14fb=this;return new Promise(function(_0x392391,_0x430e2f){return db[_0x96eb('0xc')][_0x96eb('0xd')]({'raw':_0x427f84[_0x96eb('0xe')]?_0x427f84[_0x96eb('0xe')][_0x96eb('0xf')]===undefined?!![]:![]:!![],'where':_0x427f84[_0x96eb('0xe')]?_0x427f84[_0x96eb('0xe')]['where']||null:null,'attributes':_0x427f84[_0x96eb('0xe')]?_0x427f84[_0x96eb('0xe')][_0x96eb('0x10')]||null:null,'limit':_0x427f84['options']?_0x427f84[_0x96eb('0xe')][_0x96eb('0x11')]||null:null,'include':_0x427f84[_0x96eb('0xe')]?_0x427f84[_0x96eb('0xe')][_0x96eb('0x12')]?_[_0x96eb('0x13')](_0x427f84[_0x96eb('0xe')][_0x96eb('0x12')],function(_0x57e49d){return{'model':db[_0x57e49d[_0x96eb('0x14')]],'as':_0x57e49d['as'],'attributes':_0x57e49d[_0x96eb('0x10')],'include':_0x57e49d['include']?_[_0x96eb('0x13')](_0x57e49d[_0x96eb('0x12')],function(_0x35edda){return{'model':db[_0x35edda[_0x96eb('0x14')]],'as':_0x35edda['as'],'attributes':_0x35edda[_0x96eb('0x10')],'include':_0x35edda[_0x96eb('0x12')]?_[_0x96eb('0x13')](_0x35edda[_0x96eb('0x12')],function(_0x28aed7){return{'model':db[_0x28aed7['model']],'as':_0x28aed7['as'],'attributes':_0x28aed7[_0x96eb('0x10')]};}):[]};}):[]};}):[]:[]})[_0x96eb('0x15')](function(_0x3b8496){logger['info'](_0x96eb('0x16'),_0x427f84);logger[_0x96eb('0x17')](_0x96eb('0x16'),_0x427f84,JSON['stringify'](_0x3b8496));_0x392391(_0x3b8496);})['catch'](function(_0x19fd5d){logger[_0x96eb('0x18')](_0x96eb('0x16'),_0x19fd5d[_0x96eb('0x19')],_0x427f84);_0x430e2f(_0x3d14fb[_0x96eb('0x18')](0x1f4,_0x19fd5d[_0x96eb('0x19')]));});});};exports[_0x96eb('0x1a')]=function(_0x2919a4){var _0x463f1b=this;return new Promise(function(_0x547fc2,_0x225cfb){return db[_0x96eb('0xc')]['find']({'raw':_0x2919a4[_0x96eb('0xe')]?_0x2919a4[_0x96eb('0xe')][_0x96eb('0xf')]===undefined?!![]:![]:!![],'where':_0x2919a4[_0x96eb('0xe')]?_0x2919a4[_0x96eb('0xe')]['where']||null:null,'attributes':_0x2919a4[_0x96eb('0xe')]?_0x2919a4['options'][_0x96eb('0x10')]||null:null,'include':_0x2919a4['options']?_0x2919a4[_0x96eb('0xe')][_0x96eb('0x12')]?_[_0x96eb('0x13')](_0x2919a4[_0x96eb('0xe')][_0x96eb('0x12')],function(_0x518dc7){return{'model':db[_0x518dc7['model']],'as':_0x518dc7['as'],'attributes':_0x518dc7[_0x96eb('0x10')],'include':_0x518dc7[_0x96eb('0x12')]?_[_0x96eb('0x13')](_0x518dc7[_0x96eb('0x12')],function(_0x23f0cc){return{'model':db[_0x23f0cc[_0x96eb('0x14')]],'as':_0x23f0cc['as'],'attributes':_0x23f0cc[_0x96eb('0x10')],'include':_0x23f0cc[_0x96eb('0x12')]?_[_0x96eb('0x13')](_0x23f0cc[_0x96eb('0x12')],function(_0x446e7f){return{'model':db[_0x446e7f[_0x96eb('0x14')]],'as':_0x446e7f['as'],'attributes':_0x446e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x96eb('0x15')](function(_0x191c12){logger['info'](_0x96eb('0x1a'),_0x2919a4);logger['debug'](_0x96eb('0x1a'),_0x2919a4,JSON[_0x96eb('0x1b')](_0x191c12));_0x547fc2(_0x191c12);})[_0x96eb('0x1c')](function(_0x4c0447){logger[_0x96eb('0x18')](_0x96eb('0x1a'),_0x4c0447[_0x96eb('0x19')],_0x2919a4);_0x225cfb(_0x463f1b[_0x96eb('0x18')](0x1f4,_0x4c0447['message']));});});};exports[_0x96eb('0x1d')]=function(_0x27d929){var _0x15b1fa=this;return new Promise(function(_0x25d4cb,_0x5833d0){var _0x9404ec;return db['User'][_0x96eb('0x1e')]({'where':_0x27d929[_0x96eb('0xe')]['where']||{},'attributes':['id','name',_0x96eb('0x1f'),_0x96eb('0x20'),_0x96eb('0x21')]})[_0x96eb('0x15')](function(_0x5e3914){if(_0x5e3914){_0x9404ec=_0x5e3914;return db[_0x96eb('0x22')][_0x96eb('0x23')]({'paused':0x1},{'where':{'UserId':_0x9404ec['id']},'individualHooks':!![]});}})[_0x96eb('0x15')](function(){if(_0x9404ec){return db[_0x96eb('0x24')][_0x96eb('0xd')]({'where':{'membername':_0x9404ec[_0x96eb('0x25')],'type':'PAUSE','exitAt':null}});}})[_0x96eb('0x15')](function(_0x13a3a6){if(_0x9404ec){if(_0x13a3a6&&_0x13a3a6[_0x96eb('0x26')]){var _0x4a58d7=moment()[_0x96eb('0x27')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5e2dc9=0x0,_0xf13041=_0x13a3a6[_0x96eb('0x26')];_0x5e2dc9<_0xf13041;_0x5e2dc9++){_0x13a3a6[_0x5e2dc9][_0x96eb('0x28')]({'exitAt':_0x4a58d7});}}}})['then'](function(){if(_0x9404ec){var _0x451b05=[];var _0x2dcbae=utils[_0x96eb('0x29')]();_0x2dcbae['forEach'](function(_0x4e4ba9){_0x451b05[_0x96eb('0x2a')]({'channel':_0x4e4ba9,'membername':_0x9404ec['name'],'interface':_['isNil'](_0x9404ec['interface'])?util[_0x96eb('0x27')](_0x96eb('0x2b'),_0x9404ec[_0x96eb('0x25')]):_0x9404ec['interface'],'type':_0x96eb('0x2c'),'enterAt':moment()[_0x96eb('0x27')](_0x96eb('0x2d')),'data1':_0x27d929[_0x96eb('0x2e')][_0x96eb('0x2f')]||_0x96eb('0x30'),'role':_0x9404ec[_0x96eb('0x1f')],'internal':_0x9404ec[_0x96eb('0x20')],'uniqueid':_0x27d929[_0x96eb('0x2e')][_0x96eb('0x31')]||null});});return db[_0x96eb('0x24')][_0x96eb('0x32')](_0x451b05,{'individualHooks':!![]});}})[_0x96eb('0x15')](function(){if(_0x9404ec){return _0x9404ec[_0x96eb('0x23')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x27d929[_0x96eb('0x2e')][_0x96eb('0x2f')]||_0x96eb('0x30'),'lastPauseAt':moment()[_0x96eb('0x27')](_0x96eb('0x2d'))});}})['then'](function(_0x328874){_0x25d4cb(_0x328874);})['catch'](function(_0x3a0afe){_0x5833d0(_0x15b1fa[_0x96eb('0x18')](0x1f4,_0x3a0afe[_0x96eb('0x19')]));});});};exports[_0x96eb('0x33')]=function(_0xdaadf4){var _0x5d07c6=this;return new Promise(function(_0x5b4c72,_0x66d0aa){if(_0xdaadf4[_0x96eb('0x2e')][_0x96eb('0x34')]&&!utils[_0x96eb('0x35')](_0xdaadf4[_0x96eb('0x2e')][_0x96eb('0x34')])){throw new Error(util[_0x96eb('0x27')](_0x96eb('0x36'),_0xdaadf4[_0x96eb('0x2e')][_0x96eb('0x34')]));}return db['User'][_0x96eb('0x37')]({'where':_0xdaadf4[_0x96eb('0xe')][_0x96eb('0x38')]||{},'attributes':['id','name',_0x96eb('0x1f'),_0x96eb('0x20'),_0x96eb('0x21'),_0x96eb('0x39'),_0x96eb('0x3a'),_0x96eb('0x3b'),_0x96eb('0x3c'),'faxPause',_0x96eb('0x3d'),_0x96eb('0x3e'),_0x96eb('0x3f'),_0x96eb('0x40'),_0x96eb('0x41')]})[_0x96eb('0x15')](function(_0x1375d2){if(!_0x1375d2){throw new Error(util[_0x96eb('0x27')]('User\x20with\x20id\x20%s\x20not\x20found',_0xdaadf4['params']['id']));}return _0x1375d2[_0x96eb('0x42')](_0xdaadf4[_0x96eb('0x2e')]['channel'],'system');})['then'](function(_0x2795d0){_0x5b4c72(_0x2795d0);})['catch'](function(_0x1d2914){_0x66d0aa(_0x5d07c6['error'](0x1f4,_0x1d2914[_0x96eb('0x19')]));});});};exports[_0x96eb('0x43')]=function(_0x5a8139){var _0x23514e=this;return new Promise(function(_0x24d88d,_0x370994){var _0x5030c3;return db[_0x96eb('0xc')]['findOne']({'where':_0x5a8139[_0x96eb('0xe')][_0x96eb('0x38')]||{},'attributes':['id',_0x96eb('0x25')]})[_0x96eb('0x15')](function(_0xa4896d){if(_0xa4896d){_0x5030c3=_0xa4896d;return db[_0x96eb('0x22')][_0x96eb('0x44')]({'where':{'membername':_0x5030c3[_0x96eb('0x25')]},'individualHooks':!![]});}})[_0x96eb('0x15')](function(){if(_0x5030c3){return db[_0x96eb('0x24')]['findAll']({'where':{'membername':_0x5030c3[_0x96eb('0x25')],'exitAt':null}});}})[_0x96eb('0x15')](function(_0x424a74){if(_0x5030c3){if(_0x424a74&&_0x424a74['length']){var _0x1abacf=[];_0x424a74[_0x96eb('0x45')](function(_0x5533bf){_0x1abacf[_0x96eb('0x2a')](_0x5533bf[_0x96eb('0x23')]({'exitAt':moment()[_0x96eb('0x27')](_0x96eb('0x2d'))}));});return BPromise[_0x96eb('0x46')](_0x1abacf);}}})[_0x96eb('0x15')](function(){if(_0x5030c3){return _0x5030c3[_0x96eb('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x96eb('0x15')](function(_0x748ced){_0x24d88d(_0x748ced);})['catch'](function(_0x26daf5){_0x370994(_0x23514e[_0x96eb('0x18')](0x1f4,_0x26daf5[_0x96eb('0x19')]));});});};exports[_0x96eb('0x47')]=function(_0x556a0c){var _0x5d9f55=this;return new Promise(function(_0x37ceab,_0x5c8427){var _0x2fda0c;var _0x1fdc36;var _0x57d0dc;var _0x529927;return db[_0x96eb('0xc')][_0x96eb('0x37')]({'where':_0x556a0c[_0x96eb('0xe')][_0x96eb('0x38')]||{},'attributes':['id',_0x96eb('0x25'),_0x96eb('0x1f'),_0x96eb('0x48'),'phone',_0x96eb('0x20'),_0x96eb('0x49'),_0x96eb('0x21')]})[_0x96eb('0x15')](function(_0x1a3d2e){if(_0x1a3d2e){_0x2fda0c=_0x1a3d2e;_0x529927=_0x556a0c['body'][_0x96eb('0x21')]?_0x556a0c[_0x96eb('0x2e')][_0x96eb('0x21')]:util['format']('SIP/%s',_0x2fda0c['name']);return db['User'][_0x96eb('0x4a')]({'where':{'role':_0x96eb('0x4b'),'online':!![],'id':{'$ne':_0x2fda0c['id']}}});}})[_0x96eb('0x15')](function(_0x43b18b){if(_0x43b18b){_0x57d0dc=_0x43b18b;return require(_0x96eb('0x4c'))['getLicense']();}})[_0x96eb('0x15')](function(_0x2dd163){if(_0x2dd163&&_0x2dd163['agents']&&_0x57d0dc>=_0x2dd163[_0x96eb('0x4d')]){throw new Error(_0x96eb('0x4e'));}})['then'](function(){if(_0x2fda0c){return db['UserVoiceQueueRt'][_0x96eb('0x44')]({'where':{'membername':_0x2fda0c[_0x96eb('0x25')]},'individualHooks':!![]});}})[_0x96eb('0x15')](function(){if(_0x2fda0c){return _0x2fda0c[_0x96eb('0x4f')]({'raw':!![]});}})[_0x96eb('0x15')](function(_0x7e59db){if(_0x2fda0c){if(_0x7e59db){var _0x128c0d=[];_0x1fdc36=_0x7e59db;if(_0x1fdc36[_0x96eb('0x26')]){for(var _0x673608=0x0;_0x673608<_0x1fdc36[_0x96eb('0x26')];_0x673608++){_0x128c0d[_0x96eb('0x2a')](db[_0x96eb('0x22')][_0x96eb('0x50')]({'membername':_0x2fda0c[_0x96eb('0x25')],'UserId':_0x2fda0c['id'],'queue_name':_0x1fdc36[_0x673608][_0x96eb('0x25')],'VoiceQueueId':_0x1fdc36[_0x673608]['id'],'interface':_0x529927,'paused':_0x2fda0c[_0x96eb('0x49')]||![],'penalty':_0x1fdc36[_0x673608][_0x96eb('0x51')]||0x0}));}return BPromise[_0x96eb('0x46')](_0x128c0d);}}}})[_0x96eb('0x15')](function(){if(_0x2fda0c){return db['MemberReport'][_0x96eb('0xd')]({'where':{'membername':_0x2fda0c[_0x96eb('0x25')],'exitAt':null}});}})[_0x96eb('0x15')](function(_0x1fb9b9){if(_0x2fda0c){if(_0x1fb9b9&&_0x1fb9b9[_0x96eb('0x26')]){var _0x181c20=[];_0x1fb9b9[_0x96eb('0x45')](function(_0xb9c023){_0x181c20[_0x96eb('0x2a')](_0xb9c023[_0x96eb('0x23')]({'exitAt':moment()[_0x96eb('0x27')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x96eb('0x46')](_0x181c20);}}})[_0x96eb('0x15')](function(){if(_0x2fda0c){var _0x3e5e10=[];var _0x35f4f5=[];var _0x341df5=utils[_0x96eb('0x29')]();var _0xbfe885={'membername':_0x2fda0c['name'],'interface':_0x529927,'enterAt':moment()[_0x96eb('0x27')](_0x96eb('0x2d')),'role':_0x2fda0c[_0x96eb('0x1f')],'internal':_0x2fda0c[_0x96eb('0x20')]};_0x341df5['forEach'](function(_0x4a40dc){_0x3e5e10[_0x96eb('0x2a')](_['merge']({'channel':_0x4a40dc,'type':_0x96eb('0x52'),'data1':_0x96eb('0x53'),'data2':_0x529927},_0xbfe885));if(_0x2fda0c[_0x96eb('0x49')]){_0x35f4f5[_0x96eb('0x2a')](_[_0x96eb('0x54')]({'channel':_0x4a40dc,'type':_0x96eb('0x2c'),'data1':_0x96eb('0x55')},_0xbfe885));}});return db[_0x96eb('0x24')][_0x96eb('0x32')](_0x3e5e10['concat'](_0x35f4f5),{'individualHooks':!![]});}})[_0x96eb('0x15')](function(){if(_0x2fda0c){return _0x2fda0c[_0x96eb('0x23')]({'online':!![],'lastLoginAt':moment()[_0x96eb('0x27')](_0x96eb('0x2d')),'voicePause':_0x2fda0c[_0x96eb('0x49')]||![],'mailPause':_0x2fda0c[_0x96eb('0x49')]||![],'chatPause':_0x2fda0c['loginInPause']||![],'faxPause':_0x2fda0c[_0x96eb('0x49')]||![],'smsPause':_0x2fda0c['loginInPause']||![],'openchannelPause':_0x2fda0c[_0x96eb('0x49')]||![],'pauseType':_0x2fda0c['loginInPause']?_0x96eb('0x55'):null,'lastPauseAt':moment()['format'](_0x96eb('0x2d')),'interface':_0x529927});}})['then'](function(_0x119f41){_0x37ceab(_0x119f41);})[_0x96eb('0x1c')](function(_0x55918f){_0x5c8427(_0x5d9f55['error'](0x1f4,_0x55918f[_0x96eb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 10ce2f5..f8cbea4 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 _0x14fe=['length','user:','./user.events','save','remove','update','emit'];(function(_0x368f36,_0x502bde){var _0x4a0b73=function(_0xc2a12e){while(--_0xc2a12e){_0x368f36['push'](_0x368f36['shift']());}};_0x4a0b73(++_0x502bde);}(_0x14fe,0x72));var _0xe14f=function(_0xac89ad,_0xeb3ebb){_0xac89ad=_0xac89ad-0x0;var _0x199c8e=_0x14fe[_0xac89ad];return _0x199c8e;};'use strict';var UserEvents=require(_0xe14f('0x0'));var events=[_0xe14f('0x1'),_0xe14f('0x2'),_0xe14f('0x3')];function createListener(_0x42828f,_0x3b82f8){return function(_0x4a9f9b){_0x3b82f8[_0xe14f('0x4')](_0x42828f,_0x4a9f9b);};}function removeListener(_0x10ee77,_0x23b2fc){return function(){UserEvents['removeListener'](_0x10ee77,_0x23b2fc);};}exports['register']=function(_0x42ae9d){for(var _0x126ea1=0x0,_0x266b21=events[_0xe14f('0x5')];_0x126ea1<_0x266b21;_0x126ea1++){var _0x1d0797=events[_0x126ea1];var _0x3c50da=createListener(_0xe14f('0x6')+_0x1d0797,_0x42ae9d);UserEvents['on'](_0x1d0797,_0x3c50da);}}; \ No newline at end of file +var _0x338d=['update','emit','removeListener','register','length','./user.events','save','remove'];(function(_0x3eac70,_0x36b0b4){var _0x12893b=function(_0x4cadce){while(--_0x4cadce){_0x3eac70['push'](_0x3eac70['shift']());}};_0x12893b(++_0x36b0b4);}(_0x338d,0x6d));var _0xd338=function(_0x380c32,_0x450437){_0x380c32=_0x380c32-0x0;var _0x5c0ed4=_0x338d[_0x380c32];return _0x5c0ed4;};'use strict';var UserEvents=require(_0xd338('0x0'));var events=[_0xd338('0x1'),_0xd338('0x2'),_0xd338('0x3')];function createListener(_0x36a4b8,_0x17c984){return function(_0x1c97e0){_0x17c984[_0xd338('0x4')](_0x36a4b8,_0x1c97e0);};}function removeListener(_0x1a89f7,_0x3bbf0a){return function(){UserEvents[_0xd338('0x5')](_0x1a89f7,_0x3bbf0a);};}exports[_0xd338('0x6')]=function(_0x405bbd){for(var _0x55cd72=0x0,_0x50c12e=events[_0xd338('0x7')];_0x55cd72<_0x50c12e;_0x55cd72++){var _0x5117fe=events[_0x55cd72];var _0x5b2e6b=createListener('user:'+_0x5117fe,_0x405bbd);UserEvents['on'](_0x5117fe,_0x5b2e6b);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 10d5adc..f1bbb30 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3ce4c4,_0x538ff4){var _0x54082c=function(_0x568e78){while(--_0x568e78){_0x3ce4c4['push'](_0x3ce4c4['shift']());}};_0x54082c(++_0x538ff4);}(_0x70e0,0x17b));var _0x070e=function(_0x19dbcb,_0x5482be){_0x19dbcb=_0x19dbcb-0x0;var _0x2c0b79=_0x70e0[_0x19dbcb];return _0x2c0b79;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1ec1b8,_0x4e3651){var _0x4d0f2c=function(_0x502766){while(--_0x502766){_0x1ec1b8['push'](_0x1ec1b8['shift']());}};_0x4d0f2c(++_0x4e3651);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 a0df74c..a863919 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 _0xdc1e=['sequelize','INTEGER'];(function(_0x23297c,_0x102419){var _0x3a9169=function(_0x4a737e){while(--_0x4a737e){_0x23297c['push'](_0x23297c['shift']());}};_0x3a9169(++_0x102419);}(_0xdc1e,0x1f4));var _0xedc1=function(_0x25e9e2,_0x5ec453){_0x25e9e2=_0x25e9e2-0x0;var _0x3da4dc=_0xdc1e[_0x25e9e2];return _0x3da4dc;};'use strict';var Sequelize=require(_0xedc1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xedc1('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x73a7=['exports','INTEGER'];(function(_0x277023,_0x4ee10a){var _0x2399b5=function(_0x232dc0){while(--_0x232dc0){_0x277023['push'](_0x277023['shift']());}};_0x2399b5(++_0x4ee10a);}(_0x73a7,0x80));var _0x773a=function(_0x4aee47,_0x5b1af1){_0x4aee47=_0x4aee47-0x0;var _0x4971de=_0x73a7[_0x4aee47];return _0x4971de;};'use strict';var Sequelize=require('sequelize');module[_0x773a('0x0')]={'penalty':{'type':Sequelize[_0x773a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 0917b54..0895a04 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 _0x2c36=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api'];(function(_0x341b36,_0x2135db){var _0x45bcb5=function(_0x394078){while(--_0x394078){_0x341b36['push'](_0x341b36['shift']());}};_0x45bcb5(++_0x2135db);}(_0x2c36,0x182));var _0x62c3=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0x2c36[_0x1a87b3];return _0x37e84d;};'use strict';var _=require(_0x62c3('0x0'));var util=require(_0x62c3('0x1'));var logger=require(_0x62c3('0x2'))(_0x62c3('0x3'));var moment=require(_0x62c3('0x4'));var BPromise=require(_0x62c3('0x5'));var rp=require(_0x62c3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x62c3('0x7'));var config=require(_0x62c3('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x62c3('0x9')]=function(_0x290a9d,_0x137c04){return _0x290a9d[_0x62c3('0xa')](_0x62c3('0xb'),attributes,{'tableName':_0x62c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e0c=['lodash','api','request-promise','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues'];(function(_0x2c9f51,_0x2eec01){var _0x12abf9=function(_0x2d463f){while(--_0x2d463f){_0x2c9f51['push'](_0x2c9f51['shift']());}};_0x12abf9(++_0x2eec01);}(_0x9e0c,0x178));var _0xc9e0=function(_0x2ec25a,_0x5e5b87){_0x2ec25a=_0x2ec25a-0x0;var _0x5b24a4=_0x9e0c[_0x2ec25a];return _0x5b24a4;};'use strict';var _=require(_0xc9e0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc9e0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc9e0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc9e0('0x3'));var attributes=require(_0xc9e0('0x4'));module[_0xc9e0('0x5')]=function(_0x2fd776,_0x1403b8){return _0x2fd776[_0xc9e0('0x6')]('UserChatQueue',attributes,{'tableName':_0xc9e0('0x7'),'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 224f7ab..8826882 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 _0x7bec=['../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x41beb0,_0x2298de){var _0x77cc6f=function(_0x2f2cce){while(--_0x2f2cce){_0x41beb0['push'](_0x41beb0['shift']());}};_0x77cc6f(++_0x2298de);}(_0x7bec,0x80));var _0xc7be=function(_0x5674ec,_0x4bccae){_0x5674ec=_0x5674ec-0x0;var _0xe983e1=_0x7bec[_0x5674ec];return _0xe983e1;};'use strict';var _=require(_0xc7be('0x0'));var util=require(_0xc7be('0x1'));var moment=require(_0xc7be('0x2'));var BPromise=require('bluebird');var rs=require(_0xc7be('0x3'));var fs=require('fs');var Redis=require(_0xc7be('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc7be('0x5'));var jayson=require(_0xc7be('0x6'));var client=jayson[_0xc7be('0x7')][_0xc7be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x177c7c,_0x31b487,_0x2cb080){return new BPromise(function(_0x32a969,_0xc613e){return client[_0xc7be('0x9')](_0x177c7c,_0x2cb080)['then'](function(_0xfacfc3){logger[_0xc7be('0xa')](_0xc7be('0xb'),_0x31b487,_0xc7be('0xc'));logger[_0xc7be('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x31b487,_0xc7be('0xc'),JSON[_0xc7be('0xe')](_0xfacfc3));if(_0xfacfc3[_0xc7be('0xf')]){if(_0xfacfc3[_0xc7be('0xf')]['code']===0x1f4){logger['error'](_0xc7be('0xb'),_0x31b487,_0xfacfc3[_0xc7be('0xf')][_0xc7be('0x10')]);return _0xc613e(_0xfacfc3['error'][_0xc7be('0x10')]);}logger['error'](_0xc7be('0xb'),_0x31b487,_0xfacfc3[_0xc7be('0xf')][_0xc7be('0x10')]);return _0x32a969(_0xfacfc3['error'][_0xc7be('0x10')]);}else{logger['info'](_0xc7be('0xb'),_0x31b487,_0xc7be('0xc'));_0x32a969(_0xfacfc3[_0xc7be('0x11')][_0xc7be('0x10')]);}})[_0xc7be('0x12')](function(_0x4888a9){logger[_0xc7be('0xf')](_0xc7be('0xb'),_0x31b487,_0x4888a9);_0xc613e(_0x4888a9);});});} \ No newline at end of file +var _0x6eb9=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x46b701,_0x1dae73){var _0x781729=function(_0x1dd2d1){while(--_0x1dd2d1){_0x46b701['push'](_0x46b701['shift']());}};_0x781729(++_0x1dae73);}(_0x6eb9,0x1cc));var _0x96eb=function(_0x2b70bd,_0x2e39d2){_0x2b70bd=_0x2b70bd-0x0;var _0x4cd986=_0x6eb9[_0x2b70bd];return _0x4cd986;};'use strict';var _=require(_0x96eb('0x0'));var util=require(_0x96eb('0x1'));var moment=require(_0x96eb('0x2'));var BPromise=require(_0x96eb('0x3'));var rs=require(_0x96eb('0x4'));var fs=require('fs');var Redis=require(_0x96eb('0x5'));var db=require(_0x96eb('0x6'))['db'];var utils=require(_0x96eb('0x7'));var logger=require(_0x96eb('0x8'))(_0x96eb('0x9'));var config=require('../../config/environment');var jayson=require(_0x96eb('0xa'));var client=jayson[_0x96eb('0xb')][_0x96eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x495ea3,_0x5268d6,_0xbd3d8c){return new BPromise(function(_0xdf7f91,_0x3cae1d){return client[_0x96eb('0xd')](_0x495ea3,_0xbd3d8c)['then'](function(_0x1c7b39){logger['info'](_0x96eb('0xe'),_0x5268d6,_0x96eb('0xf'));logger[_0x96eb('0x10')](_0x96eb('0x11'),_0x5268d6,'request\x20sent',JSON['stringify'](_0x1c7b39));if(_0x1c7b39['error']){if(_0x1c7b39[_0x96eb('0x12')][_0x96eb('0x13')]===0x1f4){logger[_0x96eb('0x12')](_0x96eb('0xe'),_0x5268d6,_0x1c7b39['error'][_0x96eb('0x14')]);return _0x3cae1d(_0x1c7b39[_0x96eb('0x12')][_0x96eb('0x14')]);}logger[_0x96eb('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x5268d6,_0x1c7b39[_0x96eb('0x12')][_0x96eb('0x14')]);return _0xdf7f91(_0x1c7b39[_0x96eb('0x12')][_0x96eb('0x14')]);}else{logger[_0x96eb('0x15')](_0x96eb('0xe'),_0x5268d6,_0x96eb('0xf'));_0xdf7f91(_0x1c7b39[_0x96eb('0x16')]['message']);}})['catch'](function(_0x485d69){logger[_0x96eb('0x12')](_0x96eb('0xe'),_0x5268d6,_0x485d69);_0x3cae1d(_0x485d69);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ac9ddc5..091f6d9 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3c6504,_0x38efab){var _0x5458e7=function(_0x44139e){while(--_0x44139e){_0x3c6504['push'](_0x3c6504['shift']());}};_0x5458e7(++_0x38efab);}(_0x70e0,0x17b));var _0x070e=function(_0x335b5f,_0x196e67){_0x335b5f=_0x335b5f-0x0;var _0x4b8c96=_0x70e0[_0x335b5f];return _0x4b8c96;};'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(_0xd2a568,_0x4e8606){var _0x4cf0ba=function(_0x1f9dfc){while(--_0x1f9dfc){_0xd2a568['push'](_0xd2a568['shift']());}};_0x4cf0ba(++_0x4e8606);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 40c9ec0..738f09c 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 _0xc93c=['exports','STRING','sequelize'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xc93c,0x134));var _0xcc93=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc93c[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xcc93('0x0'));module[_0xcc93('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xcc93('0x2')]}}; \ No newline at end of file +var _0x76ea=['exports','INTEGER','sequelize'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x76ea,0x101));var _0xa76e=function(_0x3c1a64,_0x16cc30){_0x3c1a64=_0x3c1a64-0x0;var _0x35aac6=_0x76ea[_0x3c1a64];return _0x35aac6;};'use strict';var Sequelize=require(_0xa76e('0x0'));module[_0xa76e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa76e('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a9e51a5..8d5aefc 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 _0x9bcb=['path','rimraf','../../config/environment','exports','lodash','util','../../config/logger','api','bluebird'];(function(_0x3ee70d,_0x5ce548){var _0x5c146c=function(_0x531beb){while(--_0x531beb){_0x3ee70d['push'](_0x3ee70d['shift']());}};_0x5c146c(++_0x5ce548);}(_0x9bcb,0x1e1));var _0xb9bc=function(_0x2fb19c,_0x55b412){_0x2fb19c=_0x2fb19c-0x0;var _0x3273b5=_0x9bcb[_0x2fb19c];return _0x3273b5;};'use strict';var _=require(_0xb9bc('0x0'));var util=require(_0xb9bc('0x1'));var logger=require(_0xb9bc('0x2'))(_0xb9bc('0x3'));var moment=require('moment');var BPromise=require(_0xb9bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9bc('0x5'));var rimraf=require(_0xb9bc('0x6'));var config=require(_0xb9bc('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xb9bc('0x8')]=function(_0x3ec719,_0x5959ed){return _0x3ec719['define']('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2970=['./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x239c42,_0xcd69d6){var _0x3f3fd1=function(_0x45d7dc){while(--_0x45d7dc){_0x239c42['push'](_0x239c42['shift']());}};_0x3f3fd1(++_0xcd69d6);}(_0x2970,0x197));var _0x0297=function(_0x1fbf6c,_0x4732a2){_0x1fbf6c=_0x1fbf6c-0x0;var _0x10ca87=_0x2970[_0x1fbf6c];return _0x10ca87;};'use strict';var _=require('lodash');var util=require(_0x0297('0x0'));var logger=require(_0x0297('0x1'))(_0x0297('0x2'));var moment=require(_0x0297('0x3'));var BPromise=require(_0x0297('0x4'));var rp=require(_0x0297('0x5'));var fs=require('fs');var path=require(_0x0297('0x6'));var rimraf=require(_0x0297('0x7'));var config=require(_0x0297('0x8'));var attributes=require(_0x0297('0x9'));module[_0x0297('0xa')]=function(_0x34d7d8,_0xf8b87b){return _0x34d7d8['define'](_0x0297('0xb'),attributes,{'tableName':_0x0297('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 3b3f2c5..b7732f8 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 _0x65df=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0x65df,0xa4));var _0xf65d=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x65df[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0xf65d('0x0'));var moment=require(_0xf65d('0x1'));var BPromise=require(_0xf65d('0x2'));var rs=require(_0xf65d('0x3'));var fs=require('fs');var Redis=require(_0xf65d('0x4'));var db=require(_0xf65d('0x5'))['db'];var utils=require(_0xf65d('0x6'));var logger=require(_0xf65d('0x7'))(_0xf65d('0x8'));var config=require(_0xf65d('0x9'));var jayson=require(_0xf65d('0xa'));var client=jayson['client'][_0xf65d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x260545,_0x5bf1f8,_0x2d5dca){return new BPromise(function(_0x3286e5,_0x258335){return client[_0xf65d('0xc')](_0x260545,_0x2d5dca)[_0xf65d('0xd')](function(_0x5aead5){logger[_0xf65d('0xe')](_0xf65d('0xf'),_0x5bf1f8,_0xf65d('0x10'));logger[_0xf65d('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x5bf1f8,'request\x20sent',JSON[_0xf65d('0x12')](_0x5aead5));if(_0x5aead5['error']){if(_0x5aead5['error'][_0xf65d('0x13')]===0x1f4){logger[_0xf65d('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x5bf1f8,_0x5aead5[_0xf65d('0x14')][_0xf65d('0x15')]);return _0x258335(_0x5aead5[_0xf65d('0x14')]['message']);}logger[_0xf65d('0x14')](_0xf65d('0xf'),_0x5bf1f8,_0x5aead5[_0xf65d('0x14')][_0xf65d('0x15')]);return _0x3286e5(_0x5aead5['error'][_0xf65d('0x15')]);}else{logger[_0xf65d('0xe')](_0xf65d('0xf'),_0x5bf1f8,_0xf65d('0x10'));_0x3286e5(_0x5aead5[_0xf65d('0x16')]['message']);}})[_0xf65d('0x17')](function(_0x42fb39){logger[_0xf65d('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x5bf1f8,_0x42fb39);_0x258335(_0x42fb39);});});} \ No newline at end of file +var _0x40da=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40da,0x75));var _0xa40d=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x40da[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xa40d('0x0'));var util=require(_0xa40d('0x1'));var moment=require(_0xa40d('0x2'));var BPromise=require(_0xa40d('0x3'));var rs=require(_0xa40d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa40d('0x5'))['db'];var utils=require(_0xa40d('0x6'));var logger=require(_0xa40d('0x7'))(_0xa40d('0x8'));var config=require(_0xa40d('0x9'));var jayson=require(_0xa40d('0xa'));var client=jayson[_0xa40d('0xb')][_0xa40d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c5262,_0x1a4d3f,_0x139ede){return new BPromise(function(_0x431bf2,_0x214ee7){return client[_0xa40d('0xd')](_0x5c5262,_0x139ede)['then'](function(_0x1e691a){logger[_0xa40d('0xe')](_0xa40d('0xf'),_0x1a4d3f,_0xa40d('0x10'));logger[_0xa40d('0x11')](_0xa40d('0x12'),_0x1a4d3f,'request\x20sent',JSON[_0xa40d('0x13')](_0x1e691a));if(_0x1e691a[_0xa40d('0x14')]){if(_0x1e691a[_0xa40d('0x14')][_0xa40d('0x15')]===0x1f4){logger[_0xa40d('0x14')](_0xa40d('0xf'),_0x1a4d3f,_0x1e691a[_0xa40d('0x14')][_0xa40d('0x16')]);return _0x214ee7(_0x1e691a[_0xa40d('0x14')]['message']);}logger[_0xa40d('0x14')](_0xa40d('0xf'),_0x1a4d3f,_0x1e691a[_0xa40d('0x14')]['message']);return _0x431bf2(_0x1e691a[_0xa40d('0x14')]['message']);}else{logger[_0xa40d('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x1a4d3f,_0xa40d('0x10'));_0x431bf2(_0x1e691a['result'][_0xa40d('0x16')]);}})[_0xa40d('0x17')](function(_0x5c9b97){logger[_0xa40d('0x14')](_0xa40d('0xf'),_0x1a4d3f,_0x5c9b97);_0x214ee7(_0x5c9b97);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 1693c16..13ae923 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x556458,_0x1c244a){var _0x2a6c9c=function(_0x677053){while(--_0x677053){_0x556458['push'](_0x556458['shift']());}};_0x2a6c9c(++_0x1c244a);}(_0x70e0,0x17b));var _0x070e=function(_0x2aefab,_0x179520){_0x2aefab=_0x2aefab-0x0;var _0x664da3=_0x70e0[_0x2aefab];return _0x664da3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x231c07,_0x3bfd65){var _0x176560=function(_0x46b70b){while(--_0x46b70b){_0x231c07['push'](_0x231c07['shift']());}};_0x176560(++_0x3bfd65);}(_0x70e0,0x17b));var _0x070e=function(_0x23299c,_0x570d0d){_0x23299c=_0x23299c-0x0;var _0x2e6e35=_0x70e0[_0x23299c];return _0x2e6e35;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 0e31ab7..c07be11 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 _0x4ec5=['exports','sequelize'];(function(_0x23a645,_0x33c02c){var _0x2dad4f=function(_0xdb926e){while(--_0xdb926e){_0x23a645['push'](_0x23a645['shift']());}};_0x2dad4f(++_0x33c02c);}(_0x4ec5,0x1eb));var _0x54ec=function(_0x497bbe,_0x556df3){_0x497bbe=_0x497bbe-0x0;var _0x58365a=_0x4ec5[_0x497bbe];return _0x58365a;};'use strict';var Sequelize=require(_0x54ec('0x0'));module[_0x54ec('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x584f=['sequelize','exports'];(function(_0x3e4b27,_0x30f168){var _0x156235=function(_0x4bea30){while(--_0x4bea30){_0x3e4b27['push'](_0x3e4b27['shift']());}};_0x156235(++_0x30f168);}(_0x584f,0x108));var _0xf584=function(_0x53cf14,_0x29e073){_0x53cf14=_0x53cf14-0x0;var _0x3e5981=_0x584f[_0x53cf14];return _0x3e5981;};'use strict';var Sequelize=require(_0xf584('0x0'));module[_0xf584('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 711106a..07389f8 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 _0xb41d=['UserMailQueue','user_has_mail_queues','lodash','util','api','bluebird','path','rimraf','exports','define'];(function(_0xede80d,_0xe8e0cb){var _0x559a8c=function(_0x367809){while(--_0x367809){_0xede80d['push'](_0xede80d['shift']());}};_0x559a8c(++_0xe8e0cb);}(_0xb41d,0x84));var _0xdb41=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xb41d[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xdb41('0x0'));var util=require(_0xdb41('0x1'));var logger=require('../../config/logger')(_0xdb41('0x2'));var moment=require('moment');var BPromise=require(_0xdb41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb41('0x4'));var rimraf=require(_0xdb41('0x5'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0xdb41('0x6')]=function(_0x517c61,_0x492189){return _0x517c61[_0xdb41('0x7')](_0xdb41('0x8'),attributes,{'tableName':_0xdb41('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5be7=['api','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','lodash','util','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5be7,0xf7));var _0x75be=function(_0x5639a2,_0x1d529c){_0x5639a2=_0x5639a2-0x0;var _0x2c5aa5=_0x5be7[_0x5639a2];return _0x2c5aa5;};'use strict';var _=require(_0x75be('0x0'));var util=require(_0x75be('0x1'));var logger=require(_0x75be('0x2'))(_0x75be('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75be('0x4'));var rimraf=require(_0x75be('0x5'));var config=require(_0x75be('0x6'));var attributes=require(_0x75be('0x7'));module[_0x75be('0x8')]=function(_0x23ff9d,_0x1a3907){return _0x23ff9d['define'](_0x75be('0x9'),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 aeb141f..86bc38a 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x714811,_0x4b8d5d){var _0x25f435=function(_0x57f911){while(--_0x57f911){_0x714811['push'](_0x714811['shift']());}};_0x25f435(++_0x4b8d5d);}(_0x55ca,0x126));var _0xa55c=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x55ca[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x008c,0x188));var _0xc008=function(_0x34331b,_0x22a64c){_0x34331b=_0x34331b-0x0;var _0x1f97c8=_0x008c[_0x34331b];return _0x1f97c8;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index f6aa59c..9dcc485 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 _0xb1f2=['post','isAuthenticated','sendUserNotification','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller'];(function(_0x495984,_0x20ff45){var _0x93c24c=function(_0x48015b){while(--_0x48015b){_0x495984['push'](_0x495984['shift']());}};_0x93c24c(++_0x20ff45);}(_0xb1f2,0x1a4));var _0x2b1f=function(_0x571088,_0x5ec1e6){_0x571088=_0x571088-0x0;var _0x160f64=_0xb1f2[_0x571088];return _0x160f64;};'use strict';var multer=require(_0x2b1f('0x0'));var util=require(_0x2b1f('0x1'));var path=require(_0x2b1f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2b1f('0x3')]();var fs_extra=require(_0x2b1f('0x4'));var auth=require(_0x2b1f('0x5'));var interaction=require(_0x2b1f('0x6'));var config=require(_0x2b1f('0x7'));var controller=require(_0x2b1f('0x8'));router[_0x2b1f('0x9')]('/',auth[_0x2b1f('0xa')](),controller[_0x2b1f('0xb')]);module[_0x2b1f('0xc')]=router; \ No newline at end of file +var _0x1947=['../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x417fef,_0x10aec2){var _0xc9213d=function(_0xf04519){while(--_0xf04519){_0x417fef['push'](_0x417fef['shift']());}};_0xc9213d(++_0x10aec2);}(_0x1947,0xb9));var _0x7194=function(_0x83f53a,_0x3b232e){_0x83f53a=_0x83f53a-0x0;var _0x4d8797=_0x1947[_0x83f53a];return _0x4d8797;};'use strict';var multer=require(_0x7194('0x0'));var util=require(_0x7194('0x1'));var path=require(_0x7194('0x2'));var timeout=require(_0x7194('0x3'));var express=require(_0x7194('0x4'));var router=express[_0x7194('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7194('0x6'));var config=require(_0x7194('0x7'));var controller=require(_0x7194('0x8'));router[_0x7194('0x9')]('/',auth[_0x7194('0xa')](),controller['sendUserNotification']);module[_0x7194('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 ffa83d0..168f4e5 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 _0x09d7=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x09d7,0x127));var _0x709d=function(_0x1c5d20,_0x38d787){_0x1c5d20=_0x1c5d20-0x0;var _0x1ab251=_0x09d7[_0x1c5d20];return _0x1ab251;};'use strict';var Sequelize=require(_0x709d('0x0'));module[_0x709d('0x1')]={'body':{'type':Sequelize[_0x709d('0x2')]},'senderName':{'type':Sequelize[_0x709d('0x3')]},'recipientsId':{'type':Sequelize[_0x709d('0x2')]},'recipientsDescription':{'type':Sequelize[_0x709d('0x3')]},'beep':{'type':Sequelize[_0x709d('0x4')]}}; \ No newline at end of file +var _0x9cdd=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x32be82,_0x21b592){var _0x35aa04=function(_0x3d59ca){while(--_0x3d59ca){_0x32be82['push'](_0x32be82['shift']());}};_0x35aa04(++_0x21b592);}(_0x9cdd,0x76));var _0xd9cd=function(_0x52e06e,_0x220056){_0x52e06e=_0x52e06e-0x0;var _0x3279af=_0x9cdd[_0x52e06e];return _0x3279af;};'use strict';var Sequelize=require(_0xd9cd('0x0'));module[_0xd9cd('0x1')]={'body':{'type':Sequelize[_0xd9cd('0x2')]},'senderName':{'type':Sequelize[_0xd9cd('0x3')]},'recipientsId':{'type':Sequelize[_0xd9cd('0x2')]},'recipientsDescription':{'type':Sequelize[_0xd9cd('0x3')]},'beep':{'type':Sequelize[_0xd9cd('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index b4efc3f..5b77883 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 _0x5568=['sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','ids','queue','replace','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','status','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send'];(function(_0x1005d4,_0x5199ab){var _0x421977=function(_0x30c727){while(--_0x30c727){_0x1005d4['push'](_0x1005d4['shift']());}};_0x421977(++_0x5199ab);}(_0x5568,0x1cc));var _0x8556=function(_0x113124,_0x2d3bc6){_0x113124=_0x113124-0x0;var _0x205781=_0x5568[_0x113124];return _0x205781;};'use strict';var emlformat=require(_0x8556('0x0'));var rimraf=require(_0x8556('0x1'));var zipdir=require(_0x8556('0x2'));var jsonpatch=require(_0x8556('0x3'));var rp=require(_0x8556('0x4'));var moment=require(_0x8556('0x5'));var BPromise=require(_0x8556('0x6'));var Mustache=require('mustache');var util=require(_0x8556('0x7'));var path=require(_0x8556('0x8'));var sox=require('sox');var csv=require(_0x8556('0x9'));var ejs=require(_0x8556('0xa'));var fs=require('fs');var fs_extra=require(_0x8556('0xb'));var _=require(_0x8556('0xc'));var squel=require(_0x8556('0xd'));var crypto=require(_0x8556('0xe'));var jsforce=require(_0x8556('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8556('0x9'));var querystring=require('querystring');var Papa=require(_0x8556('0x10'));var Redis=require(_0x8556('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8556('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8556('0x13'));var logger=require(_0x8556('0x14'))(_0x8556('0x15'));var utils=require(_0x8556('0x16'));var config=require(_0x8556('0x17'));var licenseUtil=require(_0x8556('0x18'));var db=require(_0x8556('0x19'))['db'];config['redis']=_[_0x8556('0x1a')](config[_0x8556('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8556('0x1b')]));require('./userNotification.socket')[_0x8556('0x1c')](socket);function respondWithStatusCode(_0x3a026a,_0x384bc1){_0x384bc1=_0x384bc1||0xcc;return function(_0x186962){if(_0x186962){return _0x3a026a['sendStatus'](_0x384bc1);}return _0x3a026a['status'](_0x384bc1)['end']();};}function respondWithResult(_0x1ac4dc,_0x5e22d6){_0x5e22d6=_0x5e22d6||0xc8;return function(_0x18bd44){if(_0x18bd44){return _0x1ac4dc[_0x8556('0x1d')](_0x5e22d6)['json'](_0x18bd44);}};}function respondWithFilteredResult(_0xb65e12,_0x3250b7){return function(_0x4a33f3){if(_0x4a33f3){var _0x1680b=typeof _0x3250b7['offset']===_0x8556('0x1e')&&typeof _0x3250b7[_0x8556('0x1f')]===_0x8556('0x1e');var _0x59db52=_0x4a33f3[_0x8556('0x20')];var _0x342b91=_0x1680b?0x0:_0x3250b7[_0x8556('0x21')];var _0x211654=_0x1680b?_0x4a33f3[_0x8556('0x20')]:_0x3250b7[_0x8556('0x21')]+_0x3250b7[_0x8556('0x1f')];var _0x23f283;if(_0x211654>=_0x59db52){_0x211654=_0x59db52;_0x23f283=0xc8;}else{_0x23f283=0xce;}_0xb65e12['status'](_0x23f283);return _0xb65e12[_0x8556('0x22')](_0x8556('0x23'),_0x342b91+'-'+_0x211654+'/'+_0x59db52)['json'](_0x4a33f3);}return null;};}function patchUpdates(_0x4f7dd5){return function(_0x2702da){try{jsonpatch['apply'](_0x2702da,_0x4f7dd5,!![]);}catch(_0x47a40e){return BPromise[_0x8556('0x24')](_0x47a40e);}return _0x2702da[_0x8556('0x25')]();};}function saveUpdates(_0x2da0cb,_0x2d2af2){return function(_0x405296){if(_0x405296){return _0x405296['update'](_0x2da0cb)[_0x8556('0x26')](function(_0x80dd04){return _0x80dd04;});}return null;};}function removeEntity(_0x237341,_0x5d888f){return function(_0x327099){if(_0x327099){return _0x327099[_0x8556('0x27')]()[_0x8556('0x26')](function(){_0x237341['status'](0xcc)[_0x8556('0x28')]();});}};}function handleEntityNotFound(_0x2ed9dd,_0x214d7f){return function(_0x2eef58){if(!_0x2eef58){_0x2ed9dd['sendStatus'](0x194);}return _0x2eef58;};}function handleError(_0x327036,_0x3b5aef){_0x3b5aef=_0x3b5aef||0x1f4;return function(_0x1bc064){logger[_0x8556('0x29')](_0x1bc064[_0x8556('0x2a')]);if(_0x1bc064[_0x8556('0x2b')]){delete _0x1bc064[_0x8556('0x2b')];}_0x327036['status'](_0x3b5aef)[_0x8556('0x2c')](_0x1bc064);};}exports[_0x8556('0x2d')]=function(_0x34df5e,_0x2270be,_0x1d94db){if(!_0x34df5e[_0x8556('0x2e')][_0x8556('0x2f')](_0x8556('0x30'))&&!_0x34df5e[_0x8556('0x2e')]['hasOwnProperty'](_0x8556('0x31'))){throw new db[(_0x8556('0x32'))]['ValidationError'](_0x8556('0x33'));}else{if(_0x34df5e[_0x8556('0x2e')][_0x8556('0x2f')](_0x8556('0x31'))&&!_0x34df5e[_0x8556('0x2e')][_0x8556('0x2f')](_0x8556('0x34'))){throw new db[(_0x8556('0x32'))][(_0x8556('0x35'))](_0x8556('0x36'));}if(!_0x34df5e['body'][_0x8556('0x2f')](_0x8556('0x37'))){throw new db['Sequelize'][(_0x8556('0x35'))](_0x8556('0x38'));}else{try{var _0x4a6e88=JSON['parse'](_0x34df5e['body'][_0x8556('0x37')]);}catch(_0x8b0d03){logger[_0x8556('0x29')](_0x8b0d03);throw new db[(_0x8556('0x32'))][(_0x8556('0x35'))](_0x8556('0x39'));}var _0x1ae9f7=[_0x8556('0x3a'),'faxqueue',_0x8556('0x3b'),'openchannelqueue',_0x8556('0x3c'),'voicequeue',_0x8556('0x3d'),_0x8556('0x3e'),_0x8556('0x3f')];if(_[_0x8556('0x40')](_0x4a6e88,function(_0x2becc3){return!_[_0x8556('0x41')](_0x1ae9f7,_0x2becc3['model'][_0x8556('0x42')]());})){throw new db[(_0x8556('0x32'))]['ValidationError'](_0x8556('0x43'));}}}var _0x4249fd={};_0x4249fd[_0x8556('0x44')]=_0x34df5e[_0x8556('0x2e')]['hasOwnProperty'](_0x8556('0x44'))?_0x34df5e[_0x8556('0x2e')][_0x8556('0x44')]:_0x34df5e['user'][_0x8556('0x45')];_0x4249fd[_0x8556('0x46')]=_['isEmpty'](_0x34df5e[_0x8556('0x2e')][_0x8556('0x46')])?null:_0x34df5e['body'][_0x8556('0x46')];_0x4249fd[_0x8556('0x47')]=_0x34df5e[_0x8556('0x2e')][_0x8556('0x47')]||![];_0x4249fd[_0x8556('0x48')]=_0x34df5e[_0x8556('0x3f')]['id'];return getContent(_0x34df5e[_0x8556('0x2e')])[_0x8556('0x26')](function(_0x26da4a){_0x4249fd[_0x8556('0x2e')]=_0x26da4a;return getRecipients(_0x4a6e88);})[_0x8556('0x26')](function(_0x3de5dc){_0x4249fd['recipientsId']=_[_0x8556('0x49')](_0x3de5dc)[_0x8556('0x4a')](',');return db[_0x8556('0x4b')][_0x8556('0x4c')](function(_0x100b04){return db[_0x8556('0x4d')][_0x8556('0x4e')](_0x4249fd,{'raw':!![],'transaction':_0x100b04})[_0x8556('0x26')](function(_0x9b7e81){var _0x13b921={'sender':_0x4249fd['senderName'],'description':_0x4249fd['recipientsDescription'],'content':_0x4249fd[_0x8556('0x2e')],'beep':_0x4249fd[_0x8556('0x47')]};_0x3de5dc[_0x8556('0x4f')](function(_0x370087){_0x13b921[_0x8556('0x50')]=_0x370087;socket[_0x8556('0x51')](_0x8556('0x52'),_0x13b921);});return _0x9b7e81;});});})[_0x8556('0x26')](respondWithResult(_0x2270be,0xc9))[_0x8556('0x53')](handleError(_0x2270be,null));};function getContent(_0x49723c){return new BPromise(function(_0x34f7b4,_0x465387){if(_0x49723c[_0x8556('0x30')]){_0x34f7b4(_0x49723c[_0x8556('0x30')]);return;}return db[_0x8556('0x54')]['findOne']({'attributes':[_0x8556('0x55')],'where':{'id':_0x49723c[_0x8556('0x31')]},'raw':!![]})[_0x8556('0x26')](function(_0x139a98){if(!_0x139a98)throw new db[(_0x8556('0x32'))][(_0x8556('0x35'))](_0x8556('0x56'));var _0xf9ade2=Mustache[_0x8556('0x57')](_0x139a98['html'],_0x49723c[_0x8556('0x34')]);_0x34f7b4(_0xf9ade2);})[_0x8556('0x53')](function(_0x51ab9c){_0x465387(_0x51ab9c);});});}function getRecipients(_0xe055dc){return new BPromise(function(_0x512c91,_0x5510c2){var _0x44c9fb=[];var _0xf4e17a=[];_0xe055dc[_0x8556('0x4f')](function(_0x58767e){var _0x436141=_[_0x8556('0x58')](_0x58767e[_0x8556('0x59')][_0x8556('0x42')]());if(_0x436141===_0x8556('0x5a')){_0x44c9fb=_[_0x8556('0x5b')](_0x44c9fb,_0x58767e[_0x8556('0x5c')]);}else{if(_[_0x8556('0x41')](_0x436141,_0x8556('0x5d')))_0x436141=_0x436141[_0x8556('0x5e')](_0x8556('0x5d'),'Queue');_0x58767e[_0x8556('0x5c')][_0x8556('0x4f')](function(_0x351612){_0xf4e17a[_0x8556('0x5f')](getAgents(_0x436141,_0x351612));});}});return BPromise[_0x8556('0x60')](_0xf4e17a)['then'](function(_0x55b40e){_0x44c9fb=_[_0x8556('0x5b')](_0x44c9fb,_[_0x8556('0x61')](_0x55b40e));_0x512c91(_0x44c9fb);})[_0x8556('0x53')](function(_0x3e1b10){_0x5510c2(_0x3e1b10);});});}function getAgents(_0xe0e172,_0x22ed69){return new BPromise(function(_0x3007d0,_0x27abcf){return db[_0xe0e172][_0x8556('0x62')]({'where':{'id':_0x22ed69}})[_0x8556('0x26')](function(_0x341100){return _0x341100[_0x8556('0x63')]({'attributes':['id'],'raw':!![]})[_0x8556('0x26')](function(_0x2d21a3){var _0x13dc97=_[_0x8556('0x64')](_0x2d21a3,'id');_0x3007d0(_0x13dc97);});})[_0x8556('0x53')](function(_0x58b6ca){_0x27abcf(_0x58b6ca);});});} \ No newline at end of file +var _0x914f=['map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./userNotification.socket','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','parse','recipients','Invalid\x20\x27recipients\x27\x20object','faxqueue','openchannelqueue','whatsappqueue','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','user','fullname','isEmpty','beep','SenderId','sortBy','join','transaction','UserNotification','create','senderName','recipientsDescription','forEach','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','union','ids','queue','replace','push','all','getAgents'];(function(_0x4680a2,_0x2217d5){var _0x5220d2=function(_0x3833ab){while(--_0x3833ab){_0x4680a2['push'](_0x4680a2['shift']());}};_0x5220d2(++_0x2217d5);}(_0x914f,0x1d2));var _0xf914=function(_0x942eca,_0x1d0181){_0x942eca=_0x942eca-0x0;var _0x589c16=_0x914f[_0x942eca];return _0x589c16;};'use strict';var emlformat=require(_0xf914('0x0'));var rimraf=require(_0xf914('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf914('0x2'));var rp=require(_0xf914('0x3'));var moment=require(_0xf914('0x4'));var BPromise=require(_0xf914('0x5'));var Mustache=require(_0xf914('0x6'));var util=require(_0xf914('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf914('0x8'));var fs=require('fs');var fs_extra=require(_0xf914('0x9'));var _=require(_0xf914('0xa'));var squel=require(_0xf914('0xb'));var crypto=require(_0xf914('0xc'));var jsforce=require(_0xf914('0xd'));var deskjs=require(_0xf914('0xe'));var toCsv=require(_0xf914('0xf'));var querystring=require(_0xf914('0x10'));var Papa=require(_0xf914('0x11'));var Redis=require(_0xf914('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf914('0x13'))(_0xf914('0x14'));var utils=require(_0xf914('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf914('0x16'));var db=require('../../mysqldb')['db'];config[_0xf914('0x17')]=_[_0xf914('0x18')](config[_0xf914('0x17')],{'host':_0xf914('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf914('0x17')]));require(_0xf914('0x1a'))['register'](socket);function respondWithStatusCode(_0x54dc36,_0x515c5d){_0x515c5d=_0x515c5d||0xcc;return function(_0x780956){if(_0x780956){return _0x54dc36['sendStatus'](_0x515c5d);}return _0x54dc36['status'](_0x515c5d)[_0xf914('0x1b')]();};}function respondWithResult(_0x85a127,_0x318237){_0x318237=_0x318237||0xc8;return function(_0x17afab){if(_0x17afab){return _0x85a127[_0xf914('0x1c')](_0x318237)['json'](_0x17afab);}};}function respondWithFilteredResult(_0x16256a,_0xc06cb0){return function(_0x140d0a){if(_0x140d0a){var _0x49327e=typeof _0xc06cb0[_0xf914('0x1d')]==='undefined'&&typeof _0xc06cb0['limit']===_0xf914('0x1e');var _0x351bbb=_0x140d0a[_0xf914('0x1f')];var _0x4a92be=_0x49327e?0x0:_0xc06cb0[_0xf914('0x1d')];var _0x2e6091=_0x49327e?_0x140d0a[_0xf914('0x1f')]:_0xc06cb0[_0xf914('0x1d')]+_0xc06cb0[_0xf914('0x20')];var _0x4d8a46;if(_0x2e6091>=_0x351bbb){_0x2e6091=_0x351bbb;_0x4d8a46=0xc8;}else{_0x4d8a46=0xce;}_0x16256a[_0xf914('0x1c')](_0x4d8a46);return _0x16256a[_0xf914('0x21')](_0xf914('0x22'),_0x4a92be+'-'+_0x2e6091+'/'+_0x351bbb)[_0xf914('0x23')](_0x140d0a);}return null;};}function patchUpdates(_0x1e1327){return function(_0x424ba4){try{jsonpatch[_0xf914('0x24')](_0x424ba4,_0x1e1327,!![]);}catch(_0x28db7c){return BPromise[_0xf914('0x25')](_0x28db7c);}return _0x424ba4[_0xf914('0x26')]();};}function saveUpdates(_0x469289,_0x21b6f8){return function(_0x49282f){if(_0x49282f){return _0x49282f[_0xf914('0x27')](_0x469289)['then'](function(_0x59bed2){return _0x59bed2;});}return null;};}function removeEntity(_0x4c61e0,_0x11046b){return function(_0x22cbb0){if(_0x22cbb0){return _0x22cbb0['destroy']()[_0xf914('0x28')](function(){_0x4c61e0[_0xf914('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfffbbf,_0x4585cf){return function(_0x1f8978){if(!_0x1f8978){_0xfffbbf[_0xf914('0x29')](0x194);}return _0x1f8978;};}function handleError(_0x504da6,_0xab8464){_0xab8464=_0xab8464||0x1f4;return function(_0x39c220){logger[_0xf914('0x2a')](_0x39c220['stack']);if(_0x39c220['name']){delete _0x39c220[_0xf914('0x2b')];}_0x504da6[_0xf914('0x1c')](_0xab8464)['send'](_0x39c220);};}exports[_0xf914('0x2c')]=function(_0x5f3395,_0x476839,_0x36acff){if(!_0x5f3395[_0xf914('0x2d')][_0xf914('0x2e')](_0xf914('0x2f'))&&!_0x5f3395[_0xf914('0x2d')][_0xf914('0x2e')](_0xf914('0x30'))){throw new db[(_0xf914('0x31'))][(_0xf914('0x32'))](_0xf914('0x33'));}else{if(_0x5f3395[_0xf914('0x2d')][_0xf914('0x2e')](_0xf914('0x30'))&&!_0x5f3395['body']['hasOwnProperty'](_0xf914('0x34'))){throw new db[(_0xf914('0x31'))][(_0xf914('0x32'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x5f3395['body'][_0xf914('0x2e')]('recipients')){throw new db['Sequelize'][(_0xf914('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x535073=JSON[_0xf914('0x35')](_0x5f3395['body'][_0xf914('0x36')]);}catch(_0x221c3f){logger['error'](_0x221c3f);throw new db[(_0xf914('0x31'))][(_0xf914('0x32'))](_0xf914('0x37'));}var _0x8a08ad=['chatqueue',_0xf914('0x38'),'mailqueue',_0xf914('0x39'),'smsqueue','voicequeue',_0xf914('0x3a'),'team','user'];if(_['some'](_0x535073,function(_0x236232){return!_[_0xf914('0x3b')](_0x8a08ad,_0x236232[_0xf914('0x3c')][_0xf914('0x3d')]());})){throw new db['Sequelize'][(_0xf914('0x32'))](_0xf914('0x3e'));}}}var _0x4ad40c={};_0x4ad40c['senderName']=_0x5f3395['body'][_0xf914('0x2e')]('senderName')?_0x5f3395['body']['senderName']:_0x5f3395[_0xf914('0x3f')][_0xf914('0x40')];_0x4ad40c['recipientsDescription']=_[_0xf914('0x41')](_0x5f3395[_0xf914('0x2d')]['recipientsDescription'])?null:_0x5f3395['body']['recipientsDescription'];_0x4ad40c[_0xf914('0x42')]=_0x5f3395[_0xf914('0x2d')]['beep']||![];_0x4ad40c[_0xf914('0x43')]=_0x5f3395[_0xf914('0x3f')]['id'];return getContent(_0x5f3395['body'])[_0xf914('0x28')](function(_0xcfd9eb){_0x4ad40c[_0xf914('0x2d')]=_0xcfd9eb;return getRecipients(_0x535073);})['then'](function(_0x5361fb){_0x4ad40c['recipientsId']=_[_0xf914('0x44')](_0x5361fb)[_0xf914('0x45')](',');return db['sequelize'][_0xf914('0x46')](function(_0x569752){return db[_0xf914('0x47')][_0xf914('0x48')](_0x4ad40c,{'raw':!![],'transaction':_0x569752})['then'](function(_0x43d319){var _0x4ba641={'sender':_0x4ad40c[_0xf914('0x49')],'description':_0x4ad40c[_0xf914('0x4a')],'content':_0x4ad40c['body'],'beep':_0x4ad40c[_0xf914('0x42')]};_0x5361fb[_0xf914('0x4b')](function(_0x1f3728){_0x4ba641[_0xf914('0x4c')]=_0x1f3728;socket['emit'](_0xf914('0x4d'),_0x4ba641);});return _0x43d319;});});})[_0xf914('0x28')](respondWithResult(_0x476839,0xc9))[_0xf914('0x4e')](handleError(_0x476839,null));};function getContent(_0x591081){return new BPromise(function(_0x1a4265,_0x4428e3){if(_0x591081[_0xf914('0x2f')]){_0x1a4265(_0x591081[_0xf914('0x2f')]);return;}return db[_0xf914('0x4f')][_0xf914('0x50')]({'attributes':[_0xf914('0x51')],'where':{'id':_0x591081['TemplateId']},'raw':!![]})[_0xf914('0x28')](function(_0x1f4e02){if(!_0x1f4e02)throw new db[(_0xf914('0x31'))][(_0xf914('0x32'))](_0xf914('0x52'));var _0x316c4f=Mustache[_0xf914('0x53')](_0x1f4e02[_0xf914('0x51')],_0x591081[_0xf914('0x34')]);_0x1a4265(_0x316c4f);})[_0xf914('0x4e')](function(_0x1dca77){_0x4428e3(_0x1dca77);});});}function getRecipients(_0x540225){return new BPromise(function(_0x194459,_0x5f5358){var _0x1cca0d=[];var _0xc127bb=[];_0x540225[_0xf914('0x4b')](function(_0x2cb389){var _0x5f9520=_['startCase'](_0x2cb389[_0xf914('0x3c')]['toLowerCase']());if(_0x5f9520===_0xf914('0x54')){_0x1cca0d=_[_0xf914('0x55')](_0x1cca0d,_0x2cb389[_0xf914('0x56')]);}else{if(_[_0xf914('0x3b')](_0x5f9520,_0xf914('0x57')))_0x5f9520=_0x5f9520[_0xf914('0x58')]('queue','Queue');_0x2cb389['ids']['forEach'](function(_0x4a755b){_0xc127bb[_0xf914('0x59')](getAgents(_0x5f9520,_0x4a755b));});}});return BPromise[_0xf914('0x5a')](_0xc127bb)[_0xf914('0x28')](function(_0x8c62c7){_0x1cca0d=_[_0xf914('0x55')](_0x1cca0d,_['flatten'](_0x8c62c7));_0x194459(_0x1cca0d);})[_0xf914('0x4e')](function(_0x197c21){_0x5f5358(_0x197c21);});});}function getAgents(_0x1bdb1c,_0x3e5c56){return new BPromise(function(_0x4ad532,_0x2e97c3){return db[_0x1bdb1c][_0xf914('0x50')]({'where':{'id':_0x3e5c56}})['then'](function(_0x54d531){return _0x54d531[_0xf914('0x5b')]({'attributes':['id'],'raw':!![]})[_0xf914('0x28')](function(_0x2a45ed){var _0x24fcb9=_[_0xf914('0x5c')](_0x2a45ed,'id');_0x4ad532(_0x24fcb9);});})[_0xf914('0x4e')](function(_0x2ef70c){_0x2e97c3(_0x2ef70c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index da04e77..f993639 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 _0xed0c=['setMaxListeners','save','remove','emit','hasOwnProperty','UserNotification'];(function(_0x248f00,_0x56bd4f){var _0x1d80ce=function(_0x55c08a){while(--_0x55c08a){_0x248f00['push'](_0x248f00['shift']());}};_0x1d80ce(++_0x56bd4f);}(_0xed0c,0xa7));var _0xced0=function(_0x45025d,_0x308597){_0x45025d=_0x45025d-0x0;var _0x2da6cc=_0xed0c[_0x45025d];return _0x2da6cc;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0xced0('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xced0('0x1')](0x0);var events={'afterCreate':_0xced0('0x2'),'afterUpdate':'update','afterDestroy':_0xced0('0x3')};function emitEvent(_0x14f354){return function(_0x19f2ec,_0x1ae2eb,_0x29f098){UserNotificationEvents[_0xced0('0x4')](_0x14f354+':'+_0x19f2ec['id'],_0x19f2ec);UserNotificationEvents[_0xced0('0x4')](_0x14f354,_0x19f2ec);_0x29f098(null);};}for(var e in events){if(events[_0xced0('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x3b1c=['../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0xdff95a,_0x1525f8){var _0x546c6d=function(_0x53f607){while(--_0x53f607){_0xdff95a['push'](_0xdff95a['shift']());}};_0x546c6d(++_0x1525f8);}(_0x3b1c,0x1ee));var _0xc3b1=function(_0x498a8d,_0xedde9c){_0x498a8d=_0x498a8d-0x0;var _0x4b2242=_0x3b1c[_0x498a8d];return _0x4b2242;};'use strict';var EventEmitter=require(_0xc3b1('0x0'));var UserNotification=require(_0xc3b1('0x1'))['db'][_0xc3b1('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc3b1('0x3')](0x0);var events={'afterCreate':_0xc3b1('0x4'),'afterUpdate':_0xc3b1('0x5'),'afterDestroy':_0xc3b1('0x6')};function emitEvent(_0x244c22){return function(_0x440490,_0x4264a6,_0x271dac){UserNotificationEvents['emit'](_0x244c22+':'+_0x440490['id'],_0x440490);UserNotificationEvents[_0xc3b1('0x7')](_0x244c22,_0x440490);_0x271dac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xc3b1('0x8')](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 35388fb..5db3cd4 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 _0x8fa5=['bluebird','rimraf','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x11f677,_0x1f1c8c){var _0x5602e1=function(_0x113157){while(--_0x113157){_0x11f677['push'](_0x11f677['shift']());}};_0x5602e1(++_0x1f1c8c);}(_0x8fa5,0xb0));var _0x58fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fa5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x58fa('0x0'));var util=require(_0x58fa('0x1'));var logger=require(_0x58fa('0x2'))(_0x58fa('0x3'));var moment=require('moment');var BPromise=require(_0x58fa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x58fa('0x5'));var config=require('../../config/environment');var attributes=require(_0x58fa('0x6'));module['exports']=function(_0x34e3a7,_0x375a8c){return _0x34e3a7[_0x58fa('0x7')](_0x58fa('0x8'),attributes,{'tableName':_0x58fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x58fa('0xa'),'collate':_0x58fa('0xb')});}; \ No newline at end of file +var _0xf016=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserNotification','userNotifications','utf8mb4'];(function(_0x5d7d7f,_0x49e6af){var _0x25bd25=function(_0x11bd24){while(--_0x11bd24){_0x5d7d7f['push'](_0x5d7d7f['shift']());}};_0x25bd25(++_0x49e6af);}(_0xf016,0xe1));var _0x6f01=function(_0x3b316d,_0x290f1f){_0x3b316d=_0x3b316d-0x0;var _0x14950b=_0xf016[_0x3b316d];return _0x14950b;};'use strict';var _=require(_0x6f01('0x0'));var util=require(_0x6f01('0x1'));var logger=require('../../config/logger')(_0x6f01('0x2'));var moment=require(_0x6f01('0x3'));var BPromise=require(_0x6f01('0x4'));var rp=require(_0x6f01('0x5'));var fs=require('fs');var path=require(_0x6f01('0x6'));var rimraf=require(_0x6f01('0x7'));var config=require(_0x6f01('0x8'));var attributes=require('./userNotification.attributes');module[_0x6f01('0x9')]=function(_0x59d23f,_0x4a7971){return _0x59d23f['define'](_0x6f01('0xa'),attributes,{'tableName':_0x6f01('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f01('0xc'),'collate':_0x6f01('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index f2285b5..09afabd 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 _0xf9b5=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x376ad2,_0x39b5be){var _0x119476=function(_0x2f3e18){while(--_0x2f3e18){_0x376ad2['push'](_0x376ad2['shift']());}};_0x119476(++_0x39b5be);}(_0xf9b5,0x197));var _0x5f9b=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0xf9b5[_0x3e531a];return _0x3c2574;};'use strict';var _=require(_0x5f9b('0x0'));var util=require(_0x5f9b('0x1'));var moment=require(_0x5f9b('0x2'));var BPromise=require(_0x5f9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f9b('0x4'));var db=require(_0x5f9b('0x5'))['db'];var utils=require(_0x5f9b('0x6'));var logger=require('../../config/logger')(_0x5f9b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5f9b('0x8'));var client=jayson[_0x5f9b('0x9')]['http']({'port':0x232a});config[_0x5f9b('0xa')]=_[_0x5f9b('0xb')](config[_0x5f9b('0xa')],{'host':_0x5f9b('0xc'),'port':0x18eb});var socket=require(_0x5f9b('0xd'))(new Redis(config['redis']));require(_0x5f9b('0xe'))[_0x5f9b('0xf')](socket);function respondWithRpcPromise(_0x5627ed,_0x3d37bb,_0x52cd08){return new BPromise(function(_0x4f60e5,_0x177cae){return client['request'](_0x5627ed,_0x52cd08)['then'](function(_0x1c27ef){logger['info']('UserNotification,\x20%s,\x20%s',_0x3d37bb,_0x5f9b('0x10'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x3d37bb,_0x5f9b('0x10'),JSON[_0x5f9b('0x11')](_0x1c27ef));if(_0x1c27ef['error']){if(_0x1c27ef[_0x5f9b('0x12')][_0x5f9b('0x13')]===0x1f4){logger[_0x5f9b('0x12')](_0x5f9b('0x14'),_0x3d37bb,_0x1c27ef[_0x5f9b('0x12')][_0x5f9b('0x15')]);return _0x177cae(_0x1c27ef['error'][_0x5f9b('0x15')]);}logger[_0x5f9b('0x12')](_0x5f9b('0x14'),_0x3d37bb,_0x1c27ef[_0x5f9b('0x12')][_0x5f9b('0x15')]);return _0x4f60e5(_0x1c27ef[_0x5f9b('0x12')]['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x3d37bb,'request\x20sent');_0x4f60e5(_0x1c27ef[_0x5f9b('0x16')][_0x5f9b('0x15')]);}})[_0x5f9b('0x17')](function(_0x418d9c){logger[_0x5f9b('0x12')](_0x5f9b('0x14'),_0x3d37bb,_0x418d9c);_0x177cae(_0x418d9c);});});} \ No newline at end of file +var _0x1f8d=['http','redis','defaults','socket.io-emitter','./userNotification.socket','register','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e3568,_0x19932a){var _0x40c851=function(_0x5b7c18){while(--_0x5b7c18){_0x2e3568['push'](_0x2e3568['shift']());}};_0x40c851(++_0x19932a);}(_0x1f8d,0x13a));var _0xd1f8=function(_0x613f98,_0x3985f0){_0x613f98=_0x613f98-0x0;var _0x296895=_0x1f8d[_0x613f98];return _0x296895;};'use strict';var _=require(_0xd1f8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd1f8('0x1'));var rs=require(_0xd1f8('0x2'));var fs=require('fs');var Redis=require(_0xd1f8('0x3'));var db=require(_0xd1f8('0x4'))['db'];var utils=require(_0xd1f8('0x5'));var logger=require('../../config/logger')(_0xd1f8('0x6'));var config=require(_0xd1f8('0x7'));var jayson=require(_0xd1f8('0x8'));var client=jayson[_0xd1f8('0x9')][_0xd1f8('0xa')]({'port':0x232a});config[_0xd1f8('0xb')]=_[_0xd1f8('0xc')](config[_0xd1f8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd1f8('0xd'))(new Redis(config[_0xd1f8('0xb')]));require(_0xd1f8('0xe'))[_0xd1f8('0xf')](socket);function respondWithRpcPromise(_0x42e451,_0x3d1f16,_0x3e3e2a){return new BPromise(function(_0x18acd3,_0x3bad94){return client['request'](_0x42e451,_0x3e3e2a)['then'](function(_0x58e65f){logger['info'](_0xd1f8('0x10'),_0x3d1f16,'request\x20sent');logger[_0xd1f8('0x11')](_0xd1f8('0x12'),_0x3d1f16,_0xd1f8('0x13'),JSON[_0xd1f8('0x14')](_0x58e65f));if(_0x58e65f[_0xd1f8('0x15')]){if(_0x58e65f['error'][_0xd1f8('0x16')]===0x1f4){logger[_0xd1f8('0x15')]('UserNotification,\x20%s,\x20%s',_0x3d1f16,_0x58e65f[_0xd1f8('0x15')]['message']);return _0x3bad94(_0x58e65f['error'][_0xd1f8('0x17')]);}logger['error'](_0xd1f8('0x10'),_0x3d1f16,_0x58e65f[_0xd1f8('0x15')][_0xd1f8('0x17')]);return _0x18acd3(_0x58e65f[_0xd1f8('0x15')][_0xd1f8('0x17')]);}else{logger[_0xd1f8('0x18')](_0xd1f8('0x10'),_0x3d1f16,_0xd1f8('0x13'));_0x18acd3(_0x58e65f[_0xd1f8('0x19')][_0xd1f8('0x17')]);}})[_0xd1f8('0x1a')](function(_0x3ee36c){logger['error'](_0xd1f8('0x10'),_0x3d1f16,_0x3ee36c);_0x3bad94(_0x3ee36c);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index d8387bf..d30d10e 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 _0x38a0=['userNotification:','./userNotification.events','remove','emit','register'];(function(_0x2b7be6,_0x4f2441){var _0x2507d3=function(_0x1abcc9){while(--_0x1abcc9){_0x2b7be6['push'](_0x2b7be6['shift']());}};_0x2507d3(++_0x4f2441);}(_0x38a0,0x1eb));var _0x038a=function(_0x3353b8,_0x200ba5){_0x3353b8=_0x3353b8-0x0;var _0x365e87=_0x38a0[_0x3353b8];return _0x365e87;};'use strict';var UserNotificationEvents=require(_0x038a('0x0'));var events=['save',_0x038a('0x1'),'update'];function createListener(_0x3f678c,_0x1cdf92){return function(_0x4a4233){_0x1cdf92[_0x038a('0x2')](_0x3f678c,_0x4a4233);};}function removeListener(_0x4cd01d,_0x3f90d){return function(){UserNotificationEvents['removeListener'](_0x4cd01d,_0x3f90d);};}exports[_0x038a('0x3')]=function(_0x422313){for(var _0x438c22=0x0,_0x367362=events['length'];_0x438c22<_0x367362;_0x438c22++){var _0x567aad=events[_0x438c22];var _0x51d0bb=createListener(_0x038a('0x4')+_0x567aad,_0x422313);UserNotificationEvents['on'](_0x567aad,_0x51d0bb);}}; \ No newline at end of file +var _0x46c6=['save','remove','register','length','userNotification:','./userNotification.events'];(function(_0x329e1b,_0x2a8efa){var _0x5186fc=function(_0x4e1265){while(--_0x4e1265){_0x329e1b['push'](_0x329e1b['shift']());}};_0x5186fc(++_0x2a8efa);}(_0x46c6,0x1d9));var _0x646c=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x46c6[_0x2e4e19];return _0x9ba20b;};'use strict';var UserNotificationEvents=require(_0x646c('0x0'));var events=[_0x646c('0x1'),_0x646c('0x2'),'update'];function createListener(_0x5971ca,_0x410235){return function(_0x566ee6){_0x410235['emit'](_0x5971ca,_0x566ee6);};}function removeListener(_0x5bb67c,_0x425698){return function(){UserNotificationEvents['removeListener'](_0x5bb67c,_0x425698);};}exports[_0x646c('0x3')]=function(_0x3c82ae){for(var _0x554c9f=0x0,_0x1cfe1f=events[_0x646c('0x4')];_0x554c9f<_0x1cfe1f;_0x554c9f++){var _0x2664a8=events[_0x554c9f];var _0x51f949=createListener(_0x646c('0x5')+_0x2664a8,_0x3c82ae);UserNotificationEvents['on'](_0x2664a8,_0x51f949);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 5562aa5..37ce0a8 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e3d62,_0x5b7ff2){var _0x2159c9=function(_0x12154c){while(--_0x12154c){_0x5e3d62['push'](_0x5e3d62['shift']());}};_0x2159c9(++_0x5b7ff2);}(_0xe706,0xa3));var _0x6e70=function(_0x1af71a,_0x1d18ee){_0x1af71a=_0x1af71a-0x0;var _0x3acd6a=_0xe706[_0x1af71a];return _0x3acd6a;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x279d04,_0xa8f6f4){var _0x41b3de=function(_0x236aef){while(--_0x236aef){_0x279d04['push'](_0x279d04['shift']());}};_0x41b3de(++_0xa8f6f4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xcb91[_0x119705];return _0x2affc2;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 393de55..9006424 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 _0xadaa=['exports','INTEGER'];(function(_0x38db77,_0x18239f){var _0x916e60=function(_0x1bdf37){while(--_0x1bdf37){_0x38db77['push'](_0x38db77['shift']());}};_0x916e60(++_0x18239f);}(_0xadaa,0x1ea));var _0xaada=function(_0x3a5e8f,_0x55f45b){_0x3a5e8f=_0x3a5e8f-0x0;var _0x23a431=_0xadaa[_0x3a5e8f];return _0x23a431;};'use strict';var Sequelize=require('sequelize');module[_0xaada('0x0')]={'penalty':{'type':Sequelize[_0xaada('0x1')],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index a471b08..eea9145 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 _0x5bc9=['../../config/environment','exports','define','UserOpenchannelQueue','lodash','util','api','bluebird','request-promise','path'];(function(_0x55f6d7,_0x5bd984){var _0x2153cc=function(_0x11ff8b){while(--_0x11ff8b){_0x55f6d7['push'](_0x55f6d7['shift']());}};_0x2153cc(++_0x5bd984);}(_0x5bc9,0x194));var _0x95bc=function(_0x45a7fd,_0x14ed71){_0x45a7fd=_0x45a7fd-0x0;var _0xae1a28=_0x5bc9[_0x45a7fd];return _0xae1a28;};'use strict';var _=require(_0x95bc('0x0'));var util=require(_0x95bc('0x1'));var logger=require('../../config/logger')(_0x95bc('0x2'));var moment=require('moment');var BPromise=require(_0x95bc('0x3'));var rp=require(_0x95bc('0x4'));var fs=require('fs');var path=require(_0x95bc('0x5'));var rimraf=require('rimraf');var config=require(_0x95bc('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x95bc('0x7')]=function(_0x35224f,_0x29b10d){return _0x35224f[_0x95bc('0x8')](_0x95bc('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b6e=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4f4ca5,_0x4c02b8){var _0x4a2021=function(_0x1fb3dc){while(--_0x1fb3dc){_0x4f4ca5['push'](_0x4f4ca5['shift']());}};_0x4a2021(++_0x4c02b8);}(_0x3b6e,0xa0));var _0xe3b6=function(_0x411cb9,_0x264b9c){_0x411cb9=_0x411cb9-0x0;var _0x26981a=_0x3b6e[_0x411cb9];return _0x26981a;};'use strict';var _=require(_0xe3b6('0x0'));var util=require(_0xe3b6('0x1'));var logger=require(_0xe3b6('0x2'))('api');var moment=require(_0xe3b6('0x3'));var BPromise=require(_0xe3b6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3b6('0x5'));var rimraf=require(_0xe3b6('0x6'));var config=require(_0xe3b6('0x7'));var attributes=require(_0xe3b6('0x8'));module[_0xe3b6('0x9')]=function(_0x497b76,_0x28970a){return _0x497b76[_0xe3b6('0xa')](_0xe3b6('0xb'),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 20417ef..b02ea88 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 _0x91f7=['http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x12d471,_0xf51537){var _0x37c454=function(_0x309ddf){while(--_0x309ddf){_0x12d471['push'](_0x12d471['shift']());}};_0x37c454(++_0xf51537);}(_0x91f7,0x115));var _0x791f=function(_0x428964,_0x1665a2){_0x428964=_0x428964-0x0;var _0x58df60=_0x91f7[_0x428964];return _0x58df60;};'use strict';var _=require(_0x791f('0x0'));var util=require(_0x791f('0x1'));var moment=require(_0x791f('0x2'));var BPromise=require('bluebird');var rs=require(_0x791f('0x3'));var fs=require('fs');var Redis=require(_0x791f('0x4'));var db=require(_0x791f('0x5'))['db'];var utils=require(_0x791f('0x6'));var logger=require('../../config/logger')(_0x791f('0x7'));var config=require(_0x791f('0x8'));var jayson=require(_0x791f('0x9'));var client=jayson[_0x791f('0xa')][_0x791f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d96b,_0x1830c,_0x455202){return new BPromise(function(_0x1ccad3,_0x24a5e4){return client['request'](_0x37d96b,_0x455202)[_0x791f('0xc')](function(_0x30f1d4){logger[_0x791f('0xd')](_0x791f('0xe'),_0x1830c,_0x791f('0xf'));logger[_0x791f('0x10')](_0x791f('0x11'),_0x1830c,_0x791f('0xf'),JSON[_0x791f('0x12')](_0x30f1d4));if(_0x30f1d4[_0x791f('0x13')]){if(_0x30f1d4[_0x791f('0x13')][_0x791f('0x14')]===0x1f4){logger['error'](_0x791f('0xe'),_0x1830c,_0x30f1d4['error'][_0x791f('0x15')]);return _0x24a5e4(_0x30f1d4[_0x791f('0x13')][_0x791f('0x15')]);}logger['error'](_0x791f('0xe'),_0x1830c,_0x30f1d4[_0x791f('0x13')][_0x791f('0x15')]);return _0x1ccad3(_0x30f1d4[_0x791f('0x13')][_0x791f('0x15')]);}else{logger[_0x791f('0xd')](_0x791f('0xe'),_0x1830c,_0x791f('0xf'));_0x1ccad3(_0x30f1d4[_0x791f('0x16')][_0x791f('0x15')]);}})[_0x791f('0x17')](function(_0x16cda9){logger[_0x791f('0x13')](_0x791f('0xe'),_0x1830c,_0x16cda9);_0x24a5e4(_0x16cda9);});});} \ No newline at end of file +var _0x1915=['stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','util','moment','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1de787,_0x55e79d){var _0x14aa44=function(_0x297a90){while(--_0x297a90){_0x1de787['push'](_0x1de787['shift']());}};_0x14aa44(++_0x55e79d);}(_0x1915,0x15b));var _0x5191=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1915[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x5191('0x0'));var moment=require(_0x5191('0x1'));var BPromise=require('bluebird');var rs=require(_0x5191('0x2'));var fs=require('fs');var Redis=require(_0x5191('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5191('0x4'));var config=require('../../config/environment');var jayson=require(_0x5191('0x5'));var client=jayson[_0x5191('0x6')][_0x5191('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1770e5,_0x22a71,_0x29725a){return new BPromise(function(_0xe47e89,_0x5ea75d){return client[_0x5191('0x8')](_0x1770e5,_0x29725a)[_0x5191('0x9')](function(_0x3ce465){logger[_0x5191('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x22a71,_0x5191('0xb'));logger[_0x5191('0xc')](_0x5191('0xd'),_0x22a71,_0x5191('0xb'),JSON[_0x5191('0xe')](_0x3ce465));if(_0x3ce465['error']){if(_0x3ce465['error']['code']===0x1f4){logger[_0x5191('0xf')](_0x5191('0x10'),_0x22a71,_0x3ce465['error'][_0x5191('0x11')]);return _0x5ea75d(_0x3ce465['error'][_0x5191('0x11')]);}logger[_0x5191('0xf')](_0x5191('0x10'),_0x22a71,_0x3ce465[_0x5191('0xf')][_0x5191('0x11')]);return _0xe47e89(_0x3ce465[_0x5191('0xf')][_0x5191('0x11')]);}else{logger[_0x5191('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x22a71,_0x5191('0xb'));_0xe47e89(_0x3ce465['result'][_0x5191('0x11')]);}})[_0x5191('0x12')](function(_0x55a02f){logger[_0x5191('0xf')](_0x5191('0x10'),_0x22a71,_0x55a02f);_0x5ea75d(_0x55a02f);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index fd87297..df4bb39 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 _0xf3a7=['delete','removeSections','removeResources','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addSections','put','update','destroy'];(function(_0x787f48,_0x11b923){var _0x10fca3=function(_0x83e3d0){while(--_0x83e3d0){_0x787f48['push'](_0x787f48['shift']());}};_0x10fca3(++_0x11b923);}(_0xf3a7,0x125));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7f3a('0x0'));var util=require(_0x7f3a('0x1'));var path=require(_0x7f3a('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f3a('0x3'));var router=express[_0x7f3a('0x4')]();var fs_extra=require(_0x7f3a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7f3a('0x6'));var config=require('../../config/environment');var controller=require(_0x7f3a('0x7'));router[_0x7f3a('0x8')]('/',auth[_0x7f3a('0x9')](),controller[_0x7f3a('0xa')]);router[_0x7f3a('0x8')](_0x7f3a('0xb'),auth[_0x7f3a('0x9')](),controller[_0x7f3a('0xc')]);router[_0x7f3a('0x8')](_0x7f3a('0xd'),auth[_0x7f3a('0x9')](),controller[_0x7f3a('0xe')]);router['get'](_0x7f3a('0xf'),auth[_0x7f3a('0x9')](),controller[_0x7f3a('0x10')]);router[_0x7f3a('0x8')](_0x7f3a('0x11'),auth[_0x7f3a('0x9')](),controller['getResources']);router[_0x7f3a('0x12')]('/',auth[_0x7f3a('0x9')](),controller[_0x7f3a('0x13')]);router[_0x7f3a('0x12')](_0x7f3a('0x14'),auth[_0x7f3a('0x9')](),controller[_0x7f3a('0x15')]);router['post'](_0x7f3a('0xf'),auth['isAuthenticated'](),controller[_0x7f3a('0x16')]);router[_0x7f3a('0x12')](_0x7f3a('0x11'),auth[_0x7f3a('0x9')](),controller['addResources']);router[_0x7f3a('0x17')](_0x7f3a('0xd'),auth[_0x7f3a('0x9')](),controller[_0x7f3a('0x18')]);router['delete'](_0x7f3a('0xd'),auth[_0x7f3a('0x9')](),controller[_0x7f3a('0x19')]);router[_0x7f3a('0x1a')]('/:id/sections',auth[_0x7f3a('0x9')](),controller[_0x7f3a('0x1b')]);router[_0x7f3a('0x1a')](_0x7f3a('0x11'),auth[_0x7f3a('0x9')](),controller[_0x7f3a('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x2283=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','create','/:id/clone','clone','post','addResources','put','update','delete','removeSections','removeResources','multer','util','express','Router','fs-extra'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x2283,0x167));var _0x3228=function(_0x493fbb,_0x220663){_0x493fbb=_0x493fbb-0x0;var _0x522868=_0x2283[_0x493fbb];return _0x522868;};'use strict';var multer=require(_0x3228('0x0'));var util=require(_0x3228('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3228('0x2'));var router=express[_0x3228('0x3')]();var fs_extra=require(_0x3228('0x4'));var auth=require(_0x3228('0x5'));var interaction=require(_0x3228('0x6'));var config=require(_0x3228('0x7'));var controller=require('./userProfile.controller');router[_0x3228('0x8')]('/',auth[_0x3228('0x9')](),controller['index']);router[_0x3228('0x8')](_0x3228('0xa'),auth[_0x3228('0x9')](),controller[_0x3228('0xb')]);router[_0x3228('0x8')](_0x3228('0xc'),auth[_0x3228('0x9')](),controller[_0x3228('0xd')]);router[_0x3228('0x8')](_0x3228('0xe'),auth[_0x3228('0x9')](),controller[_0x3228('0xf')]);router[_0x3228('0x8')](_0x3228('0x10'),auth[_0x3228('0x9')](),controller[_0x3228('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3228('0x12')]);router['post'](_0x3228('0x13'),auth[_0x3228('0x9')](),controller[_0x3228('0x14')]);router['post'](_0x3228('0xe'),auth[_0x3228('0x9')](),controller['addSections']);router[_0x3228('0x15')](_0x3228('0x10'),auth[_0x3228('0x9')](),controller[_0x3228('0x16')]);router[_0x3228('0x17')](_0x3228('0xc'),auth[_0x3228('0x9')](),controller[_0x3228('0x18')]);router['delete'](_0x3228('0xc'),auth[_0x3228('0x9')](),controller['destroy']);router[_0x3228('0x19')](_0x3228('0xe'),auth['isAuthenticated'](),controller[_0x3228('0x1a')]);router[_0x3228('0x19')](_0x3228('0x10'),auth[_0x3228('0x9')](),controller[_0x3228('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 340c1e5..51c71c8 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 _0xf8f6=['sequelize','exports','STRING','crudPermissions','BOOLEAN'];(function(_0x199e76,_0x442c6f){var _0x1a640a=function(_0x1a3337){while(--_0x1a3337){_0x199e76['push'](_0x199e76['shift']());}};_0x1a640a(++_0x442c6f);}(_0xf8f6,0x12c));var _0x6f8f=function(_0x29ae43,_0x494c59){_0x29ae43=_0x29ae43-0x0;var _0x3569de=_0xf8f6[_0x29ae43];return _0x3569de;};'use strict';var Sequelize=require(_0x6f8f('0x0'));module[_0x6f8f('0x1')]={'name':{'type':Sequelize[_0x6f8f('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2ef89a){this['setDataValue'](_0x6f8f('0x3'),_0x2ef89a?_0x2ef89a['join'](''):[]);},'get':function(){return this['getDataValue'](_0x6f8f('0x3'))?this['getDataValue'](_0x6f8f('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x6f8f('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x6f8f('0x4')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x6f8f('0x4')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x6f8f('0x4')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x6f8f('0x4')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x6f8f('0x4')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6f8f('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xde52=['STRING','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x5089d6,_0x3fe08d){var _0xff68d6=function(_0x163660){while(--_0x163660){_0x5089d6['push'](_0x5089d6['shift']());}};_0xff68d6(++_0x3fe08d);}(_0xde52,0x66));var _0x2de5=function(_0x4d916f,_0x59fab1){_0x4d916f=_0x4d916f-0x0;var _0x267390=_0xde52[_0x4d916f];return _0x267390;};'use strict';var Sequelize=require(_0x2de5('0x0'));module[_0x2de5('0x1')]={'name':{'type':Sequelize[_0x2de5('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x2de5('0x2')],'set':function(_0x4f9044){this[_0x2de5('0x3')](_0x2de5('0x4'),_0x4f9044?_0x4f9044['join'](''):[]);},'get':function(){return this[_0x2de5('0x5')](_0x2de5('0x4'))?this[_0x2de5('0x5')](_0x2de5('0x4'))[_0x2de5('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2de5('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x2de5('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x2de5('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x2de5('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2de5('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2de5('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2de5('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 55f52fa..1637a69 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 _0xb5fa=['getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','UserProfile','include','findAll','rows','catch','show','keys','rawAttributes','fields','length','includeAll','merge','find','create','body','clone','get','updatedAt','omit','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','userProfileId','Resources','params','describe','addSections','sectionId','each','push'];(function(_0x3b9206,_0x59d082){var _0x227c87=function(_0x710fce){while(--_0x710fce){_0x3b9206['push'](_0x3b9206['shift']());}};_0x227c87(++_0x59d082);}(_0xb5fa,0xf8));var _0xab5f=function(_0x1b4c8b,_0xc90bf8){_0x1b4c8b=_0x1b4c8b-0x0;var _0x1afa15=_0xb5fa[_0x1b4c8b];return _0x1afa15;};'use strict';var emlformat=require(_0xab5f('0x0'));var rimraf=require(_0xab5f('0x1'));var zipdir=require(_0xab5f('0x2'));var jsonpatch=require(_0xab5f('0x3'));var rp=require(_0xab5f('0x4'));var moment=require(_0xab5f('0x5'));var BPromise=require(_0xab5f('0x6'));var Mustache=require(_0xab5f('0x7'));var util=require(_0xab5f('0x8'));var path=require(_0xab5f('0x9'));var sox=require(_0xab5f('0xa'));var csv=require(_0xab5f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xab5f('0xc'));var crypto=require(_0xab5f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab5f('0xe'));var toCsv=require(_0xab5f('0xb'));var querystring=require(_0xab5f('0xf'));var Papa=require(_0xab5f('0x10'));var Redis=require(_0xab5f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xab5f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab5f('0x13'));var logger=require('../../config/logger')(_0xab5f('0x14'));var utils=require(_0xab5f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xab5f('0x16')]=_[_0xab5f('0x17')](config['redis'],{'host':_0xab5f('0x18'),'port':0x18eb});var socket=require(_0xab5f('0x19'))(new Redis(config[_0xab5f('0x16')]));require(_0xab5f('0x1a'))[_0xab5f('0x1b')](socket);function respondWithStatusCode(_0x4101ee,_0x4319c7){_0x4319c7=_0x4319c7||0xcc;return function(_0x425053){if(_0x425053){return _0x4101ee[_0xab5f('0x1c')](_0x4319c7);}return _0x4101ee[_0xab5f('0x1d')](_0x4319c7)[_0xab5f('0x1e')]();};}function respondWithResult(_0x30089f,_0x177e6d){_0x177e6d=_0x177e6d||0xc8;return function(_0x22588b){if(_0x22588b){return _0x30089f[_0xab5f('0x1d')](_0x177e6d)[_0xab5f('0x1f')](_0x22588b);}};}function respondWithFilteredResult(_0xecd649,_0x340190){return function(_0x4aca7d){if(_0x4aca7d){var _0x2caadb=typeof _0x340190['offset']===_0xab5f('0x20')&&typeof _0x340190[_0xab5f('0x21')]===_0xab5f('0x20');var _0x1d6c2b=_0x4aca7d['count'];var _0xd2df62=_0x2caadb?0x0:_0x340190[_0xab5f('0x22')];var _0x3bca15=_0x2caadb?_0x4aca7d[_0xab5f('0x23')]:_0x340190[_0xab5f('0x22')]+_0x340190[_0xab5f('0x21')];var _0x58cfa4;if(_0x3bca15>=_0x1d6c2b){_0x3bca15=_0x1d6c2b;_0x58cfa4=0xc8;}else{_0x58cfa4=0xce;}_0xecd649[_0xab5f('0x1d')](_0x58cfa4);return _0xecd649[_0xab5f('0x24')](_0xab5f('0x25'),_0xd2df62+'-'+_0x3bca15+'/'+_0x1d6c2b)['json'](_0x4aca7d);}return null;};}function patchUpdates(_0xb47124){return function(_0x134a23){try{jsonpatch[_0xab5f('0x26')](_0x134a23,_0xb47124,!![]);}catch(_0x237704){return BPromise[_0xab5f('0x27')](_0x237704);}return _0x134a23[_0xab5f('0x28')]();};}function saveUpdates(_0x4b3127,_0x55daaf){return function(_0x3c5847){if(_0x3c5847){return _0x3c5847[_0xab5f('0x29')](_0x4b3127)[_0xab5f('0x2a')](function(_0x39bf0f){return _0x39bf0f;});}return null;};}function removeEntity(_0x3fb403,_0x49972a){return function(_0x3db1a6){if(_0x3db1a6){return _0x3db1a6[_0xab5f('0x2b')]()['then'](function(){_0x3fb403[_0xab5f('0x1d')](0xcc)[_0xab5f('0x1e')]();});}};}function handleEntityNotFound(_0x56e074,_0x391fec){return function(_0x4fee82){if(!_0x4fee82){_0x56e074[_0xab5f('0x1c')](0x194);}return _0x4fee82;};}function handleError(_0x2c0a1a,_0x1e1fa9){_0x1e1fa9=_0x1e1fa9||0x1f4;return function(_0x239229){logger['error'](_0x239229[_0xab5f('0x2c')]);if(_0x239229[_0xab5f('0x2d')]){delete _0x239229[_0xab5f('0x2d')];}_0x2c0a1a[_0xab5f('0x1d')](_0x1e1fa9)[_0xab5f('0x2e')](_0x239229);};}exports['index']=function(_0x5c6229,_0x7f5308){var _0x464287={},_0x290df8={},_0x274951={'count':0x0,'rows':[]};var _0x4bd729=_['map'](db['UserProfile']['rawAttributes'],function(_0x494c4b){return{'name':_0x494c4b[_0xab5f('0x2f')],'type':_0x494c4b[_0xab5f('0x30')][_0xab5f('0x31')]};});_0x290df8[_0xab5f('0x32')]=_[_0xab5f('0x33')](_0x4bd729,_0xab5f('0x2d'));_0x290df8[_0xab5f('0x34')]=_['keys'](_0x5c6229[_0xab5f('0x34')]);_0x290df8[_0xab5f('0x35')]=_[_0xab5f('0x36')](_0x290df8[_0xab5f('0x32')],_0x290df8[_0xab5f('0x34')]);_0x464287[_0xab5f('0x37')]=_['intersection'](_0x290df8[_0xab5f('0x32')],qs['fields'](_0x5c6229[_0xab5f('0x34')]['fields']));_0x464287['attributes']=_0x464287['attributes']['length']?_0x464287[_0xab5f('0x37')]:_0x290df8['model'];if(!_0x5c6229[_0xab5f('0x34')][_0xab5f('0x38')](_0xab5f('0x39'))){_0x464287[_0xab5f('0x21')]=qs[_0xab5f('0x21')](_0x5c6229[_0xab5f('0x34')][_0xab5f('0x21')]);_0x464287[_0xab5f('0x22')]=qs[_0xab5f('0x22')](_0x5c6229['query'][_0xab5f('0x22')]);}_0x464287['order']=qs[_0xab5f('0x3a')](_0x5c6229[_0xab5f('0x34')][_0xab5f('0x3a')]);_0x464287['where']=qs[_0xab5f('0x35')](_[_0xab5f('0x3b')](_0x5c6229[_0xab5f('0x34')],_0x290df8[_0xab5f('0x35')]),_0x4bd729);if(_0x5c6229[_0xab5f('0x34')][_0xab5f('0x3c')]){_0x464287[_0xab5f('0x3d')]=_['merge'](_0x464287[_0xab5f('0x3d')],{'$or':_[_0xab5f('0x33')](_0x4bd729,function(_0x6298c4){if(_0x6298c4[_0xab5f('0x30')]!==_0xab5f('0x3e')){var _0x141a34={};_0x141a34[_0x6298c4[_0xab5f('0x2d')]]={'$like':'%'+_0x5c6229[_0xab5f('0x34')]['filter']+'%'};return _0x141a34;}})});}_0x464287=_['merge']({},_0x464287,_0x5c6229[_0xab5f('0x3f')]);var _0x384cbf={'where':_0x464287['where']};return db[_0xab5f('0x40')]['count'](_0x384cbf)[_0xab5f('0x2a')](function(_0x71490a){_0x274951['count']=_0x71490a;if(_0x5c6229[_0xab5f('0x34')]['includeAll']){_0x464287[_0xab5f('0x41')]=[{'all':!![]}];}return db[_0xab5f('0x40')][_0xab5f('0x42')](_0x464287);})[_0xab5f('0x2a')](function(_0x2da96f){_0x274951[_0xab5f('0x43')]=_0x2da96f;return _0x274951;})['then'](respondWithFilteredResult(_0x7f5308,_0x464287))[_0xab5f('0x44')](handleError(_0x7f5308,null));};exports[_0xab5f('0x45')]=function(_0x22249a,_0x2e81c6){var _0x366c5d={'raw':![],'where':{'id':_0x22249a['params']['id']}},_0x358e13={};_0x358e13[_0xab5f('0x32')]=_[_0xab5f('0x46')](db['UserProfile'][_0xab5f('0x47')]);_0x358e13['query']=_[_0xab5f('0x46')](_0x22249a[_0xab5f('0x34')]);_0x358e13['filters']=_[_0xab5f('0x36')](_0x358e13[_0xab5f('0x32')],_0x358e13[_0xab5f('0x34')]);_0x366c5d[_0xab5f('0x37')]=_[_0xab5f('0x36')](_0x358e13[_0xab5f('0x32')],qs[_0xab5f('0x48')](_0x22249a[_0xab5f('0x34')]['fields']));_0x366c5d[_0xab5f('0x37')]=_0x366c5d[_0xab5f('0x37')][_0xab5f('0x49')]?_0x366c5d['attributes']:_0x358e13[_0xab5f('0x32')];if(_0x22249a[_0xab5f('0x34')][_0xab5f('0x4a')]){_0x366c5d[_0xab5f('0x41')]=[{'all':!![]}];}_0x366c5d=_[_0xab5f('0x4b')]({},_0x366c5d,_0x22249a[_0xab5f('0x3f')]);return db[_0xab5f('0x40')][_0xab5f('0x4c')](_0x366c5d)[_0xab5f('0x2a')](handleEntityNotFound(_0x2e81c6,null))[_0xab5f('0x2a')](respondWithResult(_0x2e81c6,null))[_0xab5f('0x44')](handleError(_0x2e81c6,null));};exports[_0xab5f('0x4d')]=function(_0x4502ee,_0x28a126){return db['UserProfile'][_0xab5f('0x4d')](_0x4502ee[_0xab5f('0x4e')],{})[_0xab5f('0x2a')](respondWithResult(_0x28a126,0xc9))[_0xab5f('0x44')](handleError(_0x28a126,null));};exports[_0xab5f('0x4f')]=function(_0x500258,_0x5d1daf){var _0x1cd159={'where':{'id':_0x500258['params']['id']}},_0x20a959={};_0x20a959[_0xab5f('0x32')]=_[_0xab5f('0x46')](db[_0xab5f('0x40')][_0xab5f('0x47')]);_0x1cd159['attributes']=_['intersection'](_0x20a959[_0xab5f('0x32')],qs[_0xab5f('0x48')](_0x500258['query'][_0xab5f('0x48')]));_0x1cd159[_0xab5f('0x37')]=_0x1cd159['attributes']['length']?_0x1cd159[_0xab5f('0x37')]:_0x20a959['model'];if(_0x500258[_0xab5f('0x34')][_0xab5f('0x4a')]){_0x1cd159[_0xab5f('0x41')]=[{'all':!![]}];}_0x1cd159=_[_0xab5f('0x4b')]({},_0x1cd159,_0x500258[_0xab5f('0x3f')]);return db[_0xab5f('0x40')][_0xab5f('0x4c')](_0x1cd159)[_0xab5f('0x2a')](handleEntityNotFound(_0x5d1daf,null))[_0xab5f('0x2a')](function(_0x454932){if(_0x454932){var _0x4c5f73=_0x454932[_0xab5f('0x50')]({'plain':!![]});_0x4c5f73=qs['omit'](_0x4c5f73,['id','createdAt',_0xab5f('0x51'),'crudPermissions']);_0x500258[_0xab5f('0x4e')]=_[_0xab5f('0x52')](_0x500258[_0xab5f('0x4e')],['id',_0xab5f('0x53'),_0xab5f('0x51')]);return db[_0xab5f('0x54')][_0xab5f('0x55')](function(_0xd56352){return db[_0xab5f('0x40')]['create'](_[_0xab5f('0x4b')](_0x4c5f73,_0x500258[_0xab5f('0x4e')]),{'include':_0x500258[_0xab5f('0x34')][_0xab5f('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0xd56352})['then'](function(_0x5b8ca3){var _0x438c04=_0x5b8ca3[_0xab5f('0x50')]({'plain':!![]});return db[_0xab5f('0x56')][_0xab5f('0x42')]({'where':{'userProfileId':_0x500258['params']['id']},'raw':!![]})[_0xab5f('0x2a')](function(_0x42e5e6){if(_0x42e5e6){return BPromise['each'](_0x42e5e6,function(_0x454822){return new BPromise(function(_0x2a5f34,_0x3ca59d){if(_0x454822[_0xab5f('0x57')]===null||_0x454822[_0xab5f('0x57')]===0x1)_0x2a5f34(null);return db[_0xab5f('0x58')][_0xab5f('0x42')]({'where':{'sectionId':_0x454822['id']},'raw':!![]})['then'](function(_0x1f2084){var _0x8ea961=_[_0xab5f('0x33')](_0x1f2084,function(_0x2b13f9){return qs[_0xab5f('0x52')](_0x2b13f9,['id',_0xab5f('0x53'),'updatedAt','sectionId']);});_0x2a5f34(_0x8ea961);})[_0xab5f('0x44')](function(_0x3aa745){_0x3ca59d(_0x3aa745);});})['then'](function(_0x449ae7){var _0x183e7a=qs['omit'](_0x454822,['id',_0xab5f('0x53'),_0xab5f('0x51')]);_0x183e7a[_0xab5f('0x59')]=_0x438c04['id'];if(_0x449ae7)_0x183e7a[_0xab5f('0x5a')]=_0x449ae7;return _0x183e7a;})['then'](function(_0x5e6ff2){return db[_0xab5f('0x56')][_0xab5f('0x4d')](_0x5e6ff2,{'include':[{'model':db[_0xab5f('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0xd56352});});})[_0xab5f('0x2a')](function(){return _0x438c04;});}});});});}})[_0xab5f('0x2a')](respondWithResult(_0x5d1daf,0xc9))['catch'](handleError(_0x5d1daf,null));};exports[_0xab5f('0x29')]=function(_0x20cab5,_0x30911c){if(_0x20cab5[_0xab5f('0x4e')]['id']){delete _0x20cab5[_0xab5f('0x4e')]['id'];}return db[_0xab5f('0x40')][_0xab5f('0x4c')]({'where':{'id':_0x20cab5[_0xab5f('0x5b')]['id']}})[_0xab5f('0x2a')](handleEntityNotFound(_0x30911c,null))[_0xab5f('0x2a')](saveUpdates(_0x20cab5[_0xab5f('0x4e')],null))['then'](respondWithResult(_0x30911c,null))[_0xab5f('0x44')](handleError(_0x30911c,null));};exports[_0xab5f('0x2b')]=function(_0xf925f4,_0x391b32){return db['UserProfile'][_0xab5f('0x4c')]({'where':{'id':_0xf925f4[_0xab5f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x391b32,null))[_0xab5f('0x2a')](removeEntity(_0x391b32,null))[_0xab5f('0x44')](handleError(_0x391b32,null));};exports['describe']=function(_0x542ca0,_0x15b9b1){return db[_0xab5f('0x40')][_0xab5f('0x5c')]()[_0xab5f('0x2a')](respondWithResult(_0x15b9b1,null))[_0xab5f('0x44')](handleError(_0x15b9b1,null));};exports[_0xab5f('0x5d')]=function(_0x2acbaf,_0x2026da){var _0x58442f=_0x2acbaf[_0xab5f('0x4e')];return db[_0xab5f('0x40')][_0xab5f('0x4c')]({'where':{'id':_0x2acbaf[_0xab5f('0x5b')]['id']}})[_0xab5f('0x2a')](handleEntityNotFound(_0x2026da,null))[_0xab5f('0x2a')](function(_0x1bf11e){if(_0x1bf11e){return db[_0xab5f('0x54')][_0xab5f('0x55')](function(_0x23298f){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2acbaf['params']['id'],'sectionId':_[_0xab5f('0x33')](_0x58442f,function(_0x4a6ce5){return _0x4a6ce5[_0xab5f('0x5e')];})},'transaction':_0x23298f})[_0xab5f('0x2a')](function(){var _0x5ec60c=_['map'](_0x58442f,function(_0x1db10e){_0x1db10e[_0xab5f('0x59')]=_0x2acbaf[_0xab5f('0x5b')]['id'];return _0x1db10e;});var _0x515c5c=[];return BPromise[_0xab5f('0x5f')](_0x5ec60c,function(_0x76055e){return db[_0xab5f('0x56')][_0xab5f('0x4d')](_0x76055e,{'include':[{'model':db[_0xab5f('0x58')],'as':_0xab5f('0x5a')}],'raw':!![],'transaction':_0x23298f})[_0xab5f('0x2a')](function(_0xed5baf){_0x515c5c[_0xab5f('0x60')](_0xed5baf[_0xab5f('0x50')]({'plain':!![]}));});})['then'](function(){return _0x515c5c;});});});}})['then'](function(_0x429d50){return _0x429d50;})['then'](respondWithResult(_0x2026da,null))[_0xab5f('0x44')](handleError(_0x2026da,null));};exports['removeSections']=function(_0x66f756,_0x1b0485){var _0x4aaf14;return db['UserProfile'][_0xab5f('0x4c')]({'where':{'id':_0x66f756[_0xab5f('0x5b')]['id']},'attributes':['id',_0xab5f('0x2d')]})[_0xab5f('0x2a')](handleEntityNotFound(_0x1b0485,null))[_0xab5f('0x2a')](function(_0x181470){if(_0x181470){_0x4aaf14=_0x181470;return db[_0xab5f('0x56')]['destroy']({'where':{'userProfileId':_0x66f756['params']['id'],'sectionId':_0x66f756[_0xab5f('0x34')]['ids']}});}})[_0xab5f('0x2a')](function(){return _0x4aaf14;})[_0xab5f('0x2a')](respondWithStatusCode(_0x1b0485,null))['catch'](handleError(_0x1b0485,null));};exports[_0xab5f('0x61')]=function(_0x11fa3d,_0x3667ac){var _0x4ff35f=[];var _0x4f5881=[];return db[_0xab5f('0x56')][_0xab5f('0x42')]({'where':{'userProfileId':_0x11fa3d['params']['id']},'raw':!![]})['then'](function(_0x1cb964){_0x4ff35f=_[_0xab5f('0x3c')](_0x1cb964,function(_0x9857fd){return _0x9857fd[_0xab5f('0x62')]===0x1||_[_0xab5f('0x63')]([0x3eb,0x709],_0x9857fd[_0xab5f('0x5e')]);});if(!_[_0xab5f('0x64')](_0x4ff35f)){return _['map'](_0x4ff35f,function(_0x23acfb){return _0x23acfb['sectionId'];});}else{return;}})[_0xab5f('0x2a')](function(_0x16036a){if(_0x16036a)_0x4f5881=_0x16036a;if(_[_0xab5f('0x63')](_0x4f5881,0x64)){var _0x3ddba3=_[_0xab5f('0x4c')](_0x4ff35f,{'sectionId':0x64});return hasDefaultDashboard(_0x3ddba3)[_0xab5f('0x2a')](function(_0x58bb7e){return _[_0xab5f('0x33')](_0x4ff35f,function(_0x12f94e){if(_0x12f94e[_0xab5f('0x5e')]===0x64){_0x12f94e[_0xab5f('0x65')]=_0x58bb7e;}return _0x12f94e;});});}else{return;}})[_0xab5f('0x2a')](function(_0x13b2e7){if(_0x13b2e7)_0x4ff35f=_0x13b2e7;if(_['includes'](_0x4f5881,0x3eb)){var _0x3e32ee=_[_0xab5f('0x4c')](_0x4ff35f,{'sectionId':0x3eb});return getCustomDashboards(_0x3e32ee)[_0xab5f('0x2a')](function(_0x210f9b){return _['map'](_0x4ff35f,function(_0x4dc8a4){if(_0x3e32ee[_0xab5f('0x62')]){if(_0x4dc8a4[_0xab5f('0x5e')]===0x3eb){_0x4dc8a4[_0xab5f('0x65')]=_0x210f9b;}}else{if(_0x4dc8a4[_0xab5f('0x5e')]===0x64){_0x4dc8a4[_0xab5f('0x65')]=_0x210f9b;}}return _0x4dc8a4;});});}else{return;}})['then'](function(_0x313156){if(_0x313156)_0x4ff35f=_0x313156;if(_['includes'](_0x4f5881,0x709)){var _0x15bee3=_['find'](_0x4ff35f,{'sectionId':0x709});return getPlugins(_0x15bee3)[_0xab5f('0x2a')](function(_0x502538){if(_0x15bee3[_0xab5f('0x62')]){return _[_0xab5f('0x33')](_0x4ff35f,function(_0x3f2735){if(_0x3f2735[_0xab5f('0x5e')]===0x709){_0x3f2735[_0xab5f('0x65')]=_0x502538;}return _0x3f2735;});}else{var _0x323c4f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x502538};var _0x2e08c4=_[_0xab5f('0x33')](_0x4ff35f);_0x2e08c4[_0xab5f('0x60')](_0x323c4f);return _0x2e08c4;}});}else{return;}})[_0xab5f('0x2a')](function(_0x265b37){if(_0x265b37)_0x4ff35f=_0x265b37;return _[_0xab5f('0x3c')](_0x4ff35f,[_0xab5f('0x62'),0x1]);})[_0xab5f('0x2a')](respondWithResult(_0x3667ac,null))[_0xab5f('0x44')](handleError(_0x3667ac,null));};function hasDefaultDashboard(_0x5eb263){var _0x61d75f=[0x65];return new BPromise(function(_0x5c3d83,_0x1faa75){try{if(_0x5eb263['autoAssociation']){_0x5c3d83(_0x61d75f);}else{return db[_0xab5f('0x58')][_0xab5f('0x66')]({'where':{'sectionId':_0x5eb263['id']},'raw':!![]})[_0xab5f('0x2a')](function(_0x22cfbf){_0x22cfbf?_0x5c3d83(_0x61d75f):_0x5c3d83();});}}catch(_0x4c1181){_0x1faa75(_0x4c1181);}});}function getCustomDashboards(_0x1bfd18){var _0x513869=[];return new BPromise(function(_0x5327c8,_0x5db8b8){try{if(_0x1bfd18['autoAssociation']){return db[_0xab5f('0x67')][_0xab5f('0x42')]({'raw':!![]})[_0xab5f('0x2a')](function(_0x10a07f){_0x10a07f[_0xab5f('0x68')](function(_0x400d80){_0x513869['push'](_0x400d80['id']+0x1869f);});_0x5327c8(_0x513869);});}else{return db[_0xab5f('0x58')][_0xab5f('0x42')]({'where':{'sectionId':_0x1bfd18['id']},'raw':!![]})[_0xab5f('0x2a')](function(_0x5ae266){_0x5ae266[_0xab5f('0x68')](function(_0x358b00){_0x513869[_0xab5f('0x60')](_0x358b00[_0xab5f('0x69')]+0x1869f);});_0x5327c8(_0x513869);});}}catch(_0xa6014b){_0x5db8b8(_0xa6014b);}});}function getPlugins(_0x5eac9c){var _0x221e99=[];return new BPromise(function(_0x291d86,_0x5e60f1){try{if(_0x5eac9c[_0xab5f('0x57')]){return db[_0xab5f('0x6a')]['findAll']({'raw':!![]})[_0xab5f('0x2a')](function(_0x36e6e2){_0x36e6e2[_0xab5f('0x68')](function(_0x52d479){_0x221e99['push'](_0x52d479['id']+0x15b38);});_0x291d86(_0x221e99);});}else{return db[_0xab5f('0x58')][_0xab5f('0x42')]({'where':{'sectionId':_0x5eac9c['id']},'raw':!![]})[_0xab5f('0x2a')](function(_0x1eecbb){_0x1eecbb['forEach'](function(_0x2a4491){_0x221e99['push'](_0x2a4491[_0xab5f('0x69')]+0x15b38);});_0x291d86(_0x221e99);});}}catch(_0x159113){_0x5e60f1(_0x159113);}});}exports[_0xab5f('0x6b')]=function(_0x1fdae5,_0x19e4e9){return db[_0xab5f('0x40')][_0xab5f('0x4c')]({'where':{'id':_0x1fdae5[_0xab5f('0x5b')]['id']}})[_0xab5f('0x2a')](handleEntityNotFound(_0x19e4e9,null))[_0xab5f('0x2a')](function(_0xf1566f){if(_0xf1566f){return db[_0xab5f('0x54')][_0xab5f('0x55')](function(_0x9d7975){return db[_0xab5f('0x56')][_0xab5f('0x42')]({'where':{'userProfileId':_0x1fdae5[_0xab5f('0x5b')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x28cf22){if(_0x28cf22){return db['UserProfileSection'][_0xab5f('0x2b')]({'where':{'userProfileId':_0x1fdae5[_0xab5f('0x5b')]['id'],'id':_['map'](_0x28cf22,function(_0x38012a){return _0x38012a['id'];})},'transaction':_0x9d7975});}})[_0xab5f('0x2a')](function(_0x22b3d9){var _0x316a2c=_[_0xab5f('0x33')](_0x1fdae5[_0xab5f('0x4e')],function(_0x3a9f61){_0x3a9f61[_0xab5f('0x59')]=_0x1fdae5[_0xab5f('0x5b')]['id'];return _0x3a9f61;});return db[_0xab5f('0x56')][_0xab5f('0x6c')](_0x316a2c,{'raw':!![],'transaction':_0x9d7975});})[_0xab5f('0x2a')](function(_0x323cd8){var _0x1988fc=_[_0xab5f('0x3c')](_[_0xab5f('0x33')](_0x323cd8,function(_0xc39441){return _0xc39441[_0xab5f('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x1988fc){return db[_0xab5f('0x56')][_0xab5f('0x42')]({'where':{'userProfileId':_0x1fdae5['params']['id'],'sectionId':_['map'](_0x1988fc,function(_0x282af9){return _0x282af9[_0xab5f('0x5e')];})},'attributes':['id',_0xab5f('0x5e')],'raw':!![]})['then'](function(_0x24cd3c){var _0x3dab9a=_[_0xab5f('0x33')](_0x1fdae5[_0xab5f('0x4e')],function(_0x6f1db9){_0x6f1db9['userProfileId']=_0x1fdae5['params']['id'];return _0x6f1db9;});return db[_0xab5f('0x58')][_0xab5f('0x6c')](_0x3dab9a,{'raw':!![],'transaction':_0x9d7975});});}})['catch'](handleError(_0x19e4e9,null));});}})['then'](function(_0x282e61){var _0x3a8573=_[_0xab5f('0x33')](_0x282e61,function(_0x436a24){return _0x436a24['get']({'plain':!![]});});})[_0xab5f('0x2a')](respondWithResult(_0x19e4e9,null))['catch'](handleError(_0x19e4e9,null));};exports[_0xab5f('0x6d')]=function(_0x46b37f,_0x21d746,_0x17a648){return db[_0xab5f('0x40')][_0xab5f('0x4c')]({'where':{'id':_0x46b37f[_0xab5f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x21d746,null))[_0xab5f('0x2a')](function(_0x1284d0){if(_0x1284d0){return _0x1284d0[_0xab5f('0x6d')](_0x46b37f['query'][_0xab5f('0x6e')]);}})[_0xab5f('0x2a')](respondWithStatusCode(_0x21d746,null))[_0xab5f('0x44')](handleError(_0x21d746,null));};exports[_0xab5f('0x6f')]=function(_0x41a241,_0x40f320){var _0x1f1cf2={};if(!_0x41a241['query'][_0xab5f('0x70')])throw new Error(_0xab5f('0x71'));if(!_0x41a241[_0xab5f('0x34')][_0xab5f('0x38')](_0xab5f('0x39'))){_0x1f1cf2[_0xab5f('0x21')]=qs['limit'](_0x41a241['query'][_0xab5f('0x21')]);_0x1f1cf2[_0xab5f('0x22')]=qs[_0xab5f('0x22')](_0x41a241[_0xab5f('0x34')]['offset']);}return db[_0xab5f('0x40')]['find']({'where':{'id':_0x41a241[_0xab5f('0x5b')]['id']}})[_0xab5f('0x2a')](function(_0x278900){if(!_0x278900)throw new Error(_0xab5f('0x72')+_0x41a241[_0xab5f('0x5b')]['id']);return db['UserProfile']['getResources'](_0x41a241);})['then'](respondWithFilteredResult(_0x40f320,_0x1f1cf2))['catch'](handleError(_0x40f320,null));}; \ No newline at end of file +var _0x62cf=['addSections','transaction','userProfileId','push','removeSections','getSections','enabled','includes','sectionId','isEmpty','subsections','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','Missing\x20section\x20parameter','nolimit','eml-format','zip-dir','request-promise','moment','util','path','sox','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','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','destroy','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','UserProfile','findAll','rows','show','params','length','include','find','create','body','catch','get','createdAt','crudPermissions','omit','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','Resources','update','describe'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x62cf,0x81));var _0xf62c=function(_0x455596,_0x132d09){_0x455596=_0x455596-0x0;var _0x27363a=_0x62cf[_0x455596];return _0x27363a;};'use strict';var emlformat=require(_0xf62c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf62c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf62c('0x2'));var moment=require(_0xf62c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf62c('0x4'));var path=require(_0xf62c('0x5'));var sox=require(_0xf62c('0x6'));var csv=require(_0xf62c('0x7'));var ejs=require(_0xf62c('0x8'));var fs=require('fs');var fs_extra=require(_0xf62c('0x9'));var _=require(_0xf62c('0xa'));var squel=require(_0xf62c('0xb'));var crypto=require(_0xf62c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf62c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf62c('0xe'));var Papa=require(_0xf62c('0xf'));var Redis=require(_0xf62c('0x10'));var authService=require(_0xf62c('0x11'));var qs=require(_0xf62c('0x12'));var as=require(_0xf62c('0x13'));var hardwareService=require(_0xf62c('0x14'));var logger=require(_0xf62c('0x15'))(_0xf62c('0x16'));var utils=require(_0xf62c('0x17'));var config=require(_0xf62c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf62c('0x19'))['db'];config['redis']=_['defaults'](config[_0xf62c('0x1a')],{'host':_0xf62c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf62c('0x1a')]));require(_0xf62c('0x1c'))['register'](socket);function respondWithStatusCode(_0x1c47fa,_0x4a5cba){_0x4a5cba=_0x4a5cba||0xcc;return function(_0x265253){if(_0x265253){return _0x1c47fa[_0xf62c('0x1d')](_0x4a5cba);}return _0x1c47fa['status'](_0x4a5cba)[_0xf62c('0x1e')]();};}function respondWithResult(_0x3ffb03,_0x55bba7){_0x55bba7=_0x55bba7||0xc8;return function(_0x29aece){if(_0x29aece){return _0x3ffb03[_0xf62c('0x1f')](_0x55bba7)[_0xf62c('0x20')](_0x29aece);}};}function respondWithFilteredResult(_0x5c087b,_0x25c80c){return function(_0xc7da63){if(_0xc7da63){var _0x8180f3=typeof _0x25c80c[_0xf62c('0x21')]===_0xf62c('0x22')&&typeof _0x25c80c['limit']===_0xf62c('0x22');var _0xad689c=_0xc7da63[_0xf62c('0x23')];var _0x55a475=_0x8180f3?0x0:_0x25c80c['offset'];var _0x3ae15e=_0x8180f3?_0xc7da63[_0xf62c('0x23')]:_0x25c80c[_0xf62c('0x21')]+_0x25c80c[_0xf62c('0x24')];var _0x23bf2b;if(_0x3ae15e>=_0xad689c){_0x3ae15e=_0xad689c;_0x23bf2b=0xc8;}else{_0x23bf2b=0xce;}_0x5c087b['status'](_0x23bf2b);return _0x5c087b['set']('Content-Range',_0x55a475+'-'+_0x3ae15e+'/'+_0xad689c)[_0xf62c('0x20')](_0xc7da63);}return null;};}function patchUpdates(_0x1c883c){return function(_0x4490ed){try{jsonpatch[_0xf62c('0x25')](_0x4490ed,_0x1c883c,!![]);}catch(_0x34bf70){return BPromise[_0xf62c('0x26')](_0x34bf70);}return _0x4490ed['save']();};}function saveUpdates(_0x33b572,_0x120077){return function(_0x424660){if(_0x424660){return _0x424660['update'](_0x33b572)['then'](function(_0x48541f){return _0x48541f;});}return null;};}function removeEntity(_0x496992,_0x2165ae){return function(_0x5c4e52){if(_0x5c4e52){return _0x5c4e52[_0xf62c('0x27')]()['then'](function(){_0x496992[_0xf62c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9da128,_0x41c49f){return function(_0x439f48){if(!_0x439f48){_0x9da128[_0xf62c('0x1d')](0x194);}return _0x439f48;};}function handleError(_0xbaa5a0,_0x4d00ab){_0x4d00ab=_0x4d00ab||0x1f4;return function(_0x1ecd60){logger[_0xf62c('0x28')](_0x1ecd60[_0xf62c('0x29')]);if(_0x1ecd60[_0xf62c('0x2a')]){delete _0x1ecd60[_0xf62c('0x2a')];}_0xbaa5a0[_0xf62c('0x1f')](_0x4d00ab)[_0xf62c('0x2b')](_0x1ecd60);};}exports[_0xf62c('0x2c')]=function(_0x19b820,_0x1862eb){var _0x554fce={},_0x398d1c={},_0x1aaeb9={'count':0x0,'rows':[]};var _0x56ec5f=_[_0xf62c('0x2d')](db['UserProfile'][_0xf62c('0x2e')],function(_0x20895e){return{'name':_0x20895e['fieldName'],'type':_0x20895e['type'][_0xf62c('0x2f')]};});_0x398d1c[_0xf62c('0x30')]=_['map'](_0x56ec5f,_0xf62c('0x2a'));_0x398d1c['query']=_[_0xf62c('0x31')](_0x19b820[_0xf62c('0x32')]);_0x398d1c[_0xf62c('0x33')]=_[_0xf62c('0x34')](_0x398d1c['model'],_0x398d1c['query']);_0x554fce[_0xf62c('0x35')]=_['intersection'](_0x398d1c[_0xf62c('0x30')],qs['fields'](_0x19b820[_0xf62c('0x32')][_0xf62c('0x36')]));_0x554fce[_0xf62c('0x35')]=_0x554fce[_0xf62c('0x35')]['length']?_0x554fce[_0xf62c('0x35')]:_0x398d1c[_0xf62c('0x30')];if(!_0x19b820[_0xf62c('0x32')][_0xf62c('0x37')]('nolimit')){_0x554fce[_0xf62c('0x24')]=qs[_0xf62c('0x24')](_0x19b820['query'][_0xf62c('0x24')]);_0x554fce[_0xf62c('0x21')]=qs[_0xf62c('0x21')](_0x19b820[_0xf62c('0x32')][_0xf62c('0x21')]);}_0x554fce[_0xf62c('0x38')]=qs[_0xf62c('0x39')](_0x19b820[_0xf62c('0x32')][_0xf62c('0x39')]);_0x554fce[_0xf62c('0x3a')]=qs[_0xf62c('0x33')](_[_0xf62c('0x3b')](_0x19b820[_0xf62c('0x32')],_0x398d1c[_0xf62c('0x33')]),_0x56ec5f);if(_0x19b820[_0xf62c('0x32')][_0xf62c('0x3c')]){_0x554fce[_0xf62c('0x3a')]=_[_0xf62c('0x3d')](_0x554fce[_0xf62c('0x3a')],{'$or':_[_0xf62c('0x2d')](_0x56ec5f,function(_0x499d19){if(_0x499d19[_0xf62c('0x3e')]!==_0xf62c('0x3f')){var _0x18c174={};_0x18c174[_0x499d19[_0xf62c('0x2a')]]={'$like':'%'+_0x19b820['query'][_0xf62c('0x3c')]+'%'};return _0x18c174;}})});}_0x554fce=_[_0xf62c('0x3d')]({},_0x554fce,_0x19b820[_0xf62c('0x40')]);var _0x10bc4c={'where':_0x554fce[_0xf62c('0x3a')]};return db['UserProfile']['count'](_0x10bc4c)[_0xf62c('0x41')](function(_0x588ad1){_0x1aaeb9[_0xf62c('0x23')]=_0x588ad1;if(_0x19b820[_0xf62c('0x32')][_0xf62c('0x42')]){_0x554fce['include']=[{'all':!![]}];}return db[_0xf62c('0x43')][_0xf62c('0x44')](_0x554fce);})[_0xf62c('0x41')](function(_0x3a550c){_0x1aaeb9[_0xf62c('0x45')]=_0x3a550c;return _0x1aaeb9;})[_0xf62c('0x41')](respondWithFilteredResult(_0x1862eb,_0x554fce))['catch'](handleError(_0x1862eb,null));};exports[_0xf62c('0x46')]=function(_0x4d0248,_0x40f2d9){var _0x311e77={'raw':![],'where':{'id':_0x4d0248[_0xf62c('0x47')]['id']}},_0x197769={};_0x197769[_0xf62c('0x30')]=_[_0xf62c('0x31')](db[_0xf62c('0x43')][_0xf62c('0x2e')]);_0x197769[_0xf62c('0x32')]=_['keys'](_0x4d0248[_0xf62c('0x32')]);_0x197769[_0xf62c('0x33')]=_['intersection'](_0x197769['model'],_0x197769[_0xf62c('0x32')]);_0x311e77['attributes']=_[_0xf62c('0x34')](_0x197769[_0xf62c('0x30')],qs['fields'](_0x4d0248[_0xf62c('0x32')]['fields']));_0x311e77[_0xf62c('0x35')]=_0x311e77['attributes'][_0xf62c('0x48')]?_0x311e77['attributes']:_0x197769[_0xf62c('0x30')];if(_0x4d0248[_0xf62c('0x32')][_0xf62c('0x42')]){_0x311e77[_0xf62c('0x49')]=[{'all':!![]}];}_0x311e77=_['merge']({},_0x311e77,_0x4d0248[_0xf62c('0x40')]);return db[_0xf62c('0x43')][_0xf62c('0x4a')](_0x311e77)[_0xf62c('0x41')](handleEntityNotFound(_0x40f2d9,null))[_0xf62c('0x41')](respondWithResult(_0x40f2d9,null))['catch'](handleError(_0x40f2d9,null));};exports[_0xf62c('0x4b')]=function(_0x2d8e15,_0x41efdf){return db[_0xf62c('0x43')][_0xf62c('0x4b')](_0x2d8e15[_0xf62c('0x4c')],{})[_0xf62c('0x41')](respondWithResult(_0x41efdf,0xc9))[_0xf62c('0x4d')](handleError(_0x41efdf,null));};exports['clone']=function(_0x236d87,_0x24e405){var _0x501461={'where':{'id':_0x236d87['params']['id']}},_0x112ddf={};_0x112ddf['model']=_[_0xf62c('0x31')](db[_0xf62c('0x43')]['rawAttributes']);_0x501461[_0xf62c('0x35')]=_['intersection'](_0x112ddf[_0xf62c('0x30')],qs[_0xf62c('0x36')](_0x236d87[_0xf62c('0x32')][_0xf62c('0x36')]));_0x501461[_0xf62c('0x35')]=_0x501461[_0xf62c('0x35')][_0xf62c('0x48')]?_0x501461[_0xf62c('0x35')]:_0x112ddf[_0xf62c('0x30')];if(_0x236d87[_0xf62c('0x32')][_0xf62c('0x42')]){_0x501461[_0xf62c('0x49')]=[{'all':!![]}];}_0x501461=_[_0xf62c('0x3d')]({},_0x501461,_0x236d87['options']);return db[_0xf62c('0x43')][_0xf62c('0x4a')](_0x501461)[_0xf62c('0x41')](handleEntityNotFound(_0x24e405,null))['then'](function(_0x1e5a24){if(_0x1e5a24){var _0x13e8bb=_0x1e5a24[_0xf62c('0x4e')]({'plain':!![]});_0x13e8bb=qs['omit'](_0x13e8bb,['id',_0xf62c('0x4f'),'updatedAt',_0xf62c('0x50')]);_0x236d87['body']=_[_0xf62c('0x51')](_0x236d87['body'],['id',_0xf62c('0x4f'),_0xf62c('0x52')]);return db[_0xf62c('0x53')]['transaction'](function(_0x4b8117){return db[_0xf62c('0x43')][_0xf62c('0x4b')](_[_0xf62c('0x3d')](_0x13e8bb,_0x236d87[_0xf62c('0x4c')]),{'include':_0x236d87[_0xf62c('0x32')][_0xf62c('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x4b8117})[_0xf62c('0x41')](function(_0x4289f5){var _0x267344=_0x4289f5[_0xf62c('0x4e')]({'plain':!![]});return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x236d87[_0xf62c('0x47')]['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x25003a){if(_0x25003a){return BPromise[_0xf62c('0x55')](_0x25003a,function(_0x4a6833){return new BPromise(function(_0x307eab,_0x4d5b80){if(_0x4a6833[_0xf62c('0x56')]===null||_0x4a6833[_0xf62c('0x56')]===0x1)_0x307eab(null);return db[_0xf62c('0x57')][_0xf62c('0x44')]({'where':{'sectionId':_0x4a6833['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x6f8e86){var _0x3a57a8=_[_0xf62c('0x2d')](_0x6f8e86,function(_0x3cfe0f){return qs[_0xf62c('0x51')](_0x3cfe0f,['id',_0xf62c('0x4f'),_0xf62c('0x52'),'sectionId']);});_0x307eab(_0x3a57a8);})[_0xf62c('0x4d')](function(_0x2e0b24){_0x4d5b80(_0x2e0b24);});})['then'](function(_0x30c8ef){var _0x38c458=qs[_0xf62c('0x51')](_0x4a6833,['id','createdAt',_0xf62c('0x52')]);_0x38c458['userProfileId']=_0x267344['id'];if(_0x30c8ef)_0x38c458[_0xf62c('0x58')]=_0x30c8ef;return _0x38c458;})[_0xf62c('0x41')](function(_0x5020fa){return db['UserProfileSection'][_0xf62c('0x4b')](_0x5020fa,{'include':[{'model':db[_0xf62c('0x57')],'as':_0xf62c('0x58')}],'raw':!![],'transaction':_0x4b8117});});})['then'](function(){return _0x267344;});}});});});}})['then'](respondWithResult(_0x24e405,0xc9))['catch'](handleError(_0x24e405,null));};exports[_0xf62c('0x59')]=function(_0x51568e,_0x1361ca){if(_0x51568e[_0xf62c('0x4c')]['id']){delete _0x51568e[_0xf62c('0x4c')]['id'];}return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x51568e[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](handleEntityNotFound(_0x1361ca,null))[_0xf62c('0x41')](saveUpdates(_0x51568e[_0xf62c('0x4c')],null))[_0xf62c('0x41')](respondWithResult(_0x1361ca,null))[_0xf62c('0x4d')](handleError(_0x1361ca,null));};exports['destroy']=function(_0x26d55f,_0x18f8d4){return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x26d55f[_0xf62c('0x47')]['id']}})['then'](handleEntityNotFound(_0x18f8d4,null))['then'](removeEntity(_0x18f8d4,null))[_0xf62c('0x4d')](handleError(_0x18f8d4,null));};exports['describe']=function(_0x3a59f7,_0x4a7cb3){return db[_0xf62c('0x43')][_0xf62c('0x5a')]()['then'](respondWithResult(_0x4a7cb3,null))['catch'](handleError(_0x4a7cb3,null));};exports[_0xf62c('0x5b')]=function(_0x11aec2,_0x30f424){var _0x2e2c7e=_0x11aec2['body'];return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x11aec2[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](handleEntityNotFound(_0x30f424,null))['then'](function(_0x561b58){if(_0x561b58){return db[_0xf62c('0x53')][_0xf62c('0x5c')](function(_0x476ddc){return db['UserProfileSection'][_0xf62c('0x27')]({'where':{'userProfileId':_0x11aec2['params']['id'],'sectionId':_[_0xf62c('0x2d')](_0x2e2c7e,function(_0x2e45a3){return _0x2e45a3['sectionId'];})},'transaction':_0x476ddc})[_0xf62c('0x41')](function(){var _0x38e41d=_[_0xf62c('0x2d')](_0x2e2c7e,function(_0x5113ab){_0x5113ab[_0xf62c('0x5d')]=_0x11aec2[_0xf62c('0x47')]['id'];return _0x5113ab;});var _0x3ce580=[];return BPromise['each'](_0x38e41d,function(_0x4d639b){return db[_0xf62c('0x54')][_0xf62c('0x4b')](_0x4d639b,{'include':[{'model':db['UserProfileResource'],'as':_0xf62c('0x58')}],'raw':!![],'transaction':_0x476ddc})[_0xf62c('0x41')](function(_0xcd46d2){_0x3ce580[_0xf62c('0x5e')](_0xcd46d2[_0xf62c('0x4e')]({'plain':!![]}));});})[_0xf62c('0x41')](function(){return _0x3ce580;});});});}})[_0xf62c('0x41')](function(_0x4eb0ae){return _0x4eb0ae;})['then'](respondWithResult(_0x30f424,null))[_0xf62c('0x4d')](handleError(_0x30f424,null));};exports[_0xf62c('0x5f')]=function(_0x5d9f68,_0x1bc9dc){var _0x14ef34;return db[_0xf62c('0x43')]['find']({'where':{'id':_0x5d9f68[_0xf62c('0x47')]['id']},'attributes':['id',_0xf62c('0x2a')]})[_0xf62c('0x41')](handleEntityNotFound(_0x1bc9dc,null))['then'](function(_0x37ef58){if(_0x37ef58){_0x14ef34=_0x37ef58;return db[_0xf62c('0x54')][_0xf62c('0x27')]({'where':{'userProfileId':_0x5d9f68[_0xf62c('0x47')]['id'],'sectionId':_0x5d9f68['query']['ids']}});}})[_0xf62c('0x41')](function(){return _0x14ef34;})[_0xf62c('0x41')](respondWithStatusCode(_0x1bc9dc,null))[_0xf62c('0x4d')](handleError(_0x1bc9dc,null));};exports[_0xf62c('0x60')]=function(_0x48ea18,_0x4ae41e){var _0x2906ac=[];var _0x406f21=[];return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x48ea18['params']['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x54d966){_0x2906ac=_[_0xf62c('0x3c')](_0x54d966,function(_0x435ab7){return _0x435ab7[_0xf62c('0x61')]===0x1||_[_0xf62c('0x62')]([0x3eb,0x709],_0x435ab7[_0xf62c('0x63')]);});if(!_[_0xf62c('0x64')](_0x2906ac)){return _[_0xf62c('0x2d')](_0x2906ac,function(_0x454643){return _0x454643['sectionId'];});}else{return;}})[_0xf62c('0x41')](function(_0x41eabb){if(_0x41eabb)_0x406f21=_0x41eabb;if(_['includes'](_0x406f21,0x64)){var _0x517d56=_['find'](_0x2906ac,{'sectionId':0x64});return hasDefaultDashboard(_0x517d56)[_0xf62c('0x41')](function(_0x5e6bf3){return _['map'](_0x2906ac,function(_0x15db4e){if(_0x15db4e[_0xf62c('0x63')]===0x64){_0x15db4e['subsections']=_0x5e6bf3;}return _0x15db4e;});});}else{return;}})[_0xf62c('0x41')](function(_0x1cf053){if(_0x1cf053)_0x2906ac=_0x1cf053;if(_[_0xf62c('0x62')](_0x406f21,0x3eb)){var _0x3c13f5=_[_0xf62c('0x4a')](_0x2906ac,{'sectionId':0x3eb});return getCustomDashboards(_0x3c13f5)[_0xf62c('0x41')](function(_0x52b418){return _[_0xf62c('0x2d')](_0x2906ac,function(_0x58d86e){if(_0x3c13f5[_0xf62c('0x61')]){if(_0x58d86e[_0xf62c('0x63')]===0x3eb){_0x58d86e['subsections']=_0x52b418;}}else{if(_0x58d86e[_0xf62c('0x63')]===0x64){_0x58d86e['subsections']=_0x52b418;}}return _0x58d86e;});});}else{return;}})[_0xf62c('0x41')](function(_0x41a415){if(_0x41a415)_0x2906ac=_0x41a415;if(_[_0xf62c('0x62')](_0x406f21,0x709)){var _0x151b17=_['find'](_0x2906ac,{'sectionId':0x709});return getPlugins(_0x151b17)['then'](function(_0x2a8290){if(_0x151b17[_0xf62c('0x61')]){return _[_0xf62c('0x2d')](_0x2906ac,function(_0xd1215a){if(_0xd1215a[_0xf62c('0x63')]===0x709){_0xd1215a[_0xf62c('0x65')]=_0x2a8290;}return _0xd1215a;});}else{var _0x12f6dc={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2a8290};var _0x377f37=_[_0xf62c('0x2d')](_0x2906ac);_0x377f37[_0xf62c('0x5e')](_0x12f6dc);return _0x377f37;}});}else{return;}})[_0xf62c('0x41')](function(_0x177848){if(_0x177848)_0x2906ac=_0x177848;return _[_0xf62c('0x3c')](_0x2906ac,[_0xf62c('0x61'),0x1]);})[_0xf62c('0x41')](respondWithResult(_0x4ae41e,null))[_0xf62c('0x4d')](handleError(_0x4ae41e,null));};function hasDefaultDashboard(_0x51cbfa){var _0x398c3c=[0x65];return new BPromise(function(_0x1e03e3,_0x32a4df){try{if(_0x51cbfa[_0xf62c('0x56')]){_0x1e03e3(_0x398c3c);}else{return db['UserProfileResource'][_0xf62c('0x66')]({'where':{'sectionId':_0x51cbfa['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x9be280){_0x9be280?_0x1e03e3(_0x398c3c):_0x1e03e3();});}}catch(_0x415070){_0x32a4df(_0x415070);}});}function getCustomDashboards(_0xdf7c97){var _0x161a8a=[];return new BPromise(function(_0x38fa69,_0x45bbdd){try{if(_0xdf7c97[_0xf62c('0x56')]){return db['Dashboard'][_0xf62c('0x44')]({'raw':!![]})[_0xf62c('0x41')](function(_0x16f330){_0x16f330[_0xf62c('0x67')](function(_0x556579){_0x161a8a[_0xf62c('0x5e')](_0x556579['id']+0x1869f);});_0x38fa69(_0x161a8a);});}else{return db[_0xf62c('0x57')]['findAll']({'where':{'sectionId':_0xdf7c97['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x57c7b4){_0x57c7b4[_0xf62c('0x67')](function(_0x4755af){_0x161a8a['push'](_0x4755af[_0xf62c('0x68')]+0x1869f);});_0x38fa69(_0x161a8a);});}}catch(_0xdaa04d){_0x45bbdd(_0xdaa04d);}});}function getPlugins(_0x2cad38){var _0xd179ba=[];return new BPromise(function(_0x2971c9,_0xae799){try{if(_0x2cad38[_0xf62c('0x56')]){return db[_0xf62c('0x69')][_0xf62c('0x44')]({'raw':!![]})['then'](function(_0x1bc773){_0x1bc773['forEach'](function(_0x249823){_0xd179ba[_0xf62c('0x5e')](_0x249823['id']+0x15b38);});_0x2971c9(_0xd179ba);});}else{return db[_0xf62c('0x57')]['findAll']({'where':{'sectionId':_0x2cad38['id']},'raw':!![]})['then'](function(_0x3b8ec7){_0x3b8ec7[_0xf62c('0x67')](function(_0x742e1c){_0xd179ba[_0xf62c('0x5e')](_0x742e1c[_0xf62c('0x68')]+0x15b38);});_0x2971c9(_0xd179ba);});}}catch(_0x51a76c){_0xae799(_0x51a76c);}});}exports['addResources']=function(_0x221cb3,_0x4f0c40){return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x221cb3[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](handleEntityNotFound(_0x4f0c40,null))[_0xf62c('0x41')](function(_0x7a95a1){if(_0x7a95a1){return db[_0xf62c('0x53')][_0xf62c('0x5c')](function(_0x3320e2){return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x221cb3['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x177227){if(_0x177227){return db[_0xf62c('0x54')][_0xf62c('0x27')]({'where':{'userProfileId':_0x221cb3['params']['id'],'id':_[_0xf62c('0x2d')](_0x177227,function(_0x287cc9){return _0x287cc9['id'];})},'transaction':_0x3320e2});}})['then'](function(_0x4cbd15){var _0x480e4b=_[_0xf62c('0x2d')](_0x221cb3[_0xf62c('0x4c')],function(_0x24a15e){_0x24a15e[_0xf62c('0x5d')]=_0x221cb3[_0xf62c('0x47')]['id'];return _0x24a15e;});return db[_0xf62c('0x54')]['bulkCreate'](_0x480e4b,{'raw':!![],'transaction':_0x3320e2});})[_0xf62c('0x41')](function(_0xaf86d7){var _0x5402a8=_[_0xf62c('0x3c')](_[_0xf62c('0x2d')](_0xaf86d7,function(_0x32dd6b){return _0x32dd6b[_0xf62c('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x5402a8){return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x221cb3[_0xf62c('0x47')]['id'],'sectionId':_['map'](_0x5402a8,function(_0x2eb05b){return _0x2eb05b[_0xf62c('0x63')];})},'attributes':['id',_0xf62c('0x63')],'raw':!![]})['then'](function(_0x3d3d9c){var _0x28a421=_[_0xf62c('0x2d')](_0x221cb3['body'],function(_0x24cf4a){_0x24cf4a[_0xf62c('0x5d')]=_0x221cb3[_0xf62c('0x47')]['id'];return _0x24cf4a;});return db[_0xf62c('0x57')][_0xf62c('0x6a')](_0x28a421,{'raw':!![],'transaction':_0x3320e2});});}})[_0xf62c('0x4d')](handleError(_0x4f0c40,null));});}})[_0xf62c('0x41')](function(_0x4d8647){var _0x50e7b0=_['map'](_0x4d8647,function(_0x193a61){return _0x193a61[_0xf62c('0x4e')]({'plain':!![]});});})[_0xf62c('0x41')](respondWithResult(_0x4f0c40,null))['catch'](handleError(_0x4f0c40,null));};exports[_0xf62c('0x6b')]=function(_0x130f02,_0xf3bca3,_0x528921){return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x130f02[_0xf62c('0x47')]['id']}})['then'](handleEntityNotFound(_0xf3bca3,null))[_0xf62c('0x41')](function(_0xee782f){if(_0xee782f){return _0xee782f[_0xf62c('0x6b')](_0x130f02[_0xf62c('0x32')]['ids']);}})[_0xf62c('0x41')](respondWithStatusCode(_0xf3bca3,null))[_0xf62c('0x4d')](handleError(_0xf3bca3,null));};exports['getResources']=function(_0x30231b,_0x57a0a2){var _0x40f0c9={};if(!_0x30231b['query']['section'])throw new Error(_0xf62c('0x6c'));if(!_0x30231b[_0xf62c('0x32')][_0xf62c('0x37')](_0xf62c('0x6d'))){_0x40f0c9[_0xf62c('0x24')]=qs['limit'](_0x30231b[_0xf62c('0x32')][_0xf62c('0x24')]);_0x40f0c9[_0xf62c('0x21')]=qs[_0xf62c('0x21')](_0x30231b[_0xf62c('0x32')][_0xf62c('0x21')]);}return db['UserProfile'][_0xf62c('0x4a')]({'where':{'id':_0x30231b[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](function(_0x45d000){if(!_0x45d000)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x30231b[_0xf62c('0x47')]['id']);return db[_0xf62c('0x43')]['getResources'](_0x30231b);})['then'](respondWithFilteredResult(_0x57a0a2,_0x40f0c9))['catch'](handleError(_0x57a0a2,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 6bba9d3..c8c372d 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 _0xe61c=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','UserProfile'];(function(_0x5488ea,_0x39eb52){var _0x29a918=function(_0x1cb482){while(--_0x1cb482){_0x5488ea['push'](_0x5488ea['shift']());}};_0x29a918(++_0x39eb52);}(_0xe61c,0xee));var _0xce61=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0xe61c[_0x6287b6];return _0x5d6be4;};'use strict';var EventEmitter=require(_0xce61('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xce61('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xce61('0x2')](0x0);var events={'afterCreate':_0xce61('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x265c61){return function(_0x549866,_0x322876,_0xefb221){UserProfileEvents[_0xce61('0x4')](_0x265c61+':'+_0x549866['id'],_0x549866);UserProfileEvents[_0xce61('0x4')](_0x265c61,_0x549866);_0xefb221(null);};}for(var e in events){if(events[_0xce61('0x5')](e)){var event=events[e];UserProfile[_0xce61('0x6')](e,emitEvent(event));}}module[_0xce61('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xe626=['setMaxListeners','update','remove','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe626,0x9d));var _0x6e62=function(_0x44cf63,_0xadf9dd){_0x44cf63=_0x44cf63-0x0;var _0xbc96b9=_0xe626[_0x44cf63];return _0xbc96b9;};'use strict';var EventEmitter=require(_0x6e62('0x0'));var UserProfile=require(_0x6e62('0x1'))['db'][_0x6e62('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6e62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e62('0x4'),'afterDestroy':_0x6e62('0x5')};function emitEvent(_0x302770){return function(_0xb5cd38,_0x2ebc77,_0x4d4816){UserProfileEvents['emit'](_0x302770+':'+_0xb5cd38['id'],_0xb5cd38);UserProfileEvents['emit'](_0x302770,_0xb5cd38);_0x4d4816(null);};}for(var e in events){if(events[_0x6e62('0x6')](e)){var event=events[e];UserProfile[_0x6e62('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 5de5cd7..2405f34 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 _0xda71=['then','associatedResources','map','catch','field','model','name','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','childModel','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','VoiceQueues','users','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','pauses','scheduler','Schedule','sounds','tags','Tag','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','toString','OpenTabs','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','ignore','union','find','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','include','reportType','default','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','Tags','color','tag','ThroughTags','true','chat','dataValues','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value'];(function(_0x1a9390,_0x3339e6){var _0x2b4514=function(_0x1c07d5){while(--_0x1c07d5){_0x1a9390['push'](_0x1a9390['shift']());}};_0x2b4514(++_0x3339e6);}(_0xda71,0x17e));var _0x1da7=function(_0x139fc8,_0xa8defc){_0x139fc8=_0x139fc8-0x0;var _0xf67906=_0xda71[_0x139fc8];return _0xf67906;};'use strict';var _=require(_0x1da7('0x0'));var attributes=require(_0x1da7('0x1'));var qs=require(_0x1da7('0x2'));var squel=require(_0x1da7('0x3'));module[_0x1da7('0x4')]=function(_0x52d78b){var _0xda0bf5=_0x52d78b[_0x1da7('0x5')];function _0x22c4b9(_0x26c6ca,_0x22467e){return new Promise(function(_0x38ac89,_0x56a826){if(!_0x22467e)return _0x38ac89(null);var _0x2c08a0=_0x22467e[_0x1da7('0x6')]?{[_0x22467e[_0x1da7('0x6')]['field']]:_0x22467e[_0x1da7('0x6')][_0x1da7('0x7')]}:undefined;return _0xda0bf5[_0x26c6ca]['findAll']({'where':_0x2c08a0,'raw':!![]})[_0x1da7('0x8')](function(_0x433fd1){_0x22467e[_0x1da7('0x9')]=_[_0x1da7('0xa')](_0x433fd1,'id');_0x38ac89(_0x22467e);})[_0x1da7('0xb')](function(_0x5cb17a){_0x56a826(_0x5cb17a);});});}function _0x2351f7(_0x259f43,_0x5dfecf){return new Promise(function(_0x16f4b3,_0xe01e3f){var _0x29b96a=_0x259f43[_0x1da7('0x6')]?{[_0x259f43['filter'][_0x1da7('0xc')]]:_0x259f43['filter'][_0x1da7('0x7')]}:undefined;return _0xda0bf5[_0x259f43[_0x1da7('0xd')]]['findAll']({'where':_0x29b96a,'raw':!![]})['then'](function(_0x6ee400){_0x5dfecf[_0x1da7('0x9')]=_[_0x1da7('0xa')](_0x6ee400,function(_0x26da6a){return _0x26da6a[_0x1da7('0xe')];});_0x16f4b3(_0x5dfecf);})[_0x1da7('0xb')](function(_0x314529){_0xe01e3f(_0x314529);});});}function _0xe90ee7(_0xccb873,_0x2575b9,_0x2aeb7d){if(!_0x2575b9)return Promise[_0x1da7('0xf')](null);return new Promise(function(_0x300df9,_0x2ba593){return _0xda0bf5[_0x1da7('0x10')][_0x1da7('0x11')]({'where':{'sectionId':_0x2575b9['id']},'raw':!![]})[_0x1da7('0x8')](function(_0x1aca57){if(_0xccb873[_0x1da7('0xc')]&&_0xccb873['field']!=='id'){_0x2575b9[_0x1da7('0x9')]=_[_0x1da7('0xa')](_0x1aca57,function(_0x4b1e93){return _0x4b1e93[_0xccb873[_0x1da7('0xc')]];});}else{if(_0x2aeb7d===_0x1da7('0x12')){_0x2575b9['associatedResources']=_[_0x1da7('0xa')](_0x1aca57,function(_0x3eb828){return{'id':_0x3eb828[_0x1da7('0x13')],'type':_0x3eb828[_0x1da7('0x14')]};});}else{_0x2575b9[_0x1da7('0x9')]=_[_0x1da7('0xa')](_0x1aca57,function(_0x2aa31f){return _0x2aa31f[_0x1da7('0x13')];});}}_0x300df9(_0x2575b9);})['catch'](function(_0x5a81ab){_0x2ba593(_0x5a81ab);});});}function _0x1afbcd(_0xd1896b,_0x38418a){var _0x39d232={'parentSections':[]};switch(_0xd1896b[_0x1da7('0x15')]()){case _0x1da7('0x16'):_0x39d232['childModel']=_0x1da7('0x17');break;case _0x1da7('0x18'):_0x39d232['childModel']=_0x1da7('0x19');break;case _0x1da7('0x1a'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x1c');_0x39d232['parentSections']=[{'name':_0x1da7('0x1d'),'field':_0x1da7('0xe'),'foreignKey':_0x1da7('0x1e')}];break;case'projects':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x1f');break;case _0x1da7('0x20'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x21');_0x39d232[_0x1da7('0x22')]=[{'name':_0x1da7('0x23'),'field':'id','foreignKey':_0x1da7('0x24')}];break;case _0x1da7('0x25'):_0x39d232['childModel']=_0x1da7('0x26');break;case'companies':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x27');break;case _0x1da7('0x28'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x29');break;case _0x1da7('0x2a'):_0x39d232['childModel']=_0x1da7('0x2b');break;case _0x1da7('0x2c'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x2d');break;case _0x1da7('0x2e'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x2f');break;case _0x1da7('0x30'):_0x39d232[_0x1da7('0x1b')]='FaxAccount';break;case _0x1da7('0x31'):case _0x1da7('0x32'):case _0x1da7('0x33'):_0x39d232['childModel']=_0x1da7('0x34');break;case'contexts':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x35');break;case _0x1da7('0x36'):_0x39d232[_0x1da7('0x1b')]='VoiceMail';break;case _0x1da7('0x37'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x38');_0x39d232[_0x1da7('0x22')]=[{'name':_0x1da7('0x39'),'field':_0x1da7('0xe'),'foreignKey':_0x1da7('0x3a'),'model':'User','filter':{'field':_0x1da7('0x3b'),'value':[_0x1da7('0x3c')]}},{'name':_0x1da7('0x3d'),'field':_0x1da7('0xe'),'foreignKey':_0x1da7('0x3a'),'model':_0x1da7('0x3e'),'filter':{'field':_0x1da7('0x3b'),'value':[_0x1da7('0x3f')]}},{'name':'VoiceQueues','field':_0x1da7('0xe'),'foreignKey':_0x1da7('0x40'),'model':_0x1da7('0x41'),'filter':{'field':_0x1da7('0x14'),'value':[_0x1da7('0x42')]}},{'name':_0x1da7('0x43'),'field':_0x1da7('0xe'),'foreignKey':_0x1da7('0x40'),'model':_0x1da7('0x41'),'filter':{'field':_0x1da7('0x14'),'value':['outbound']}}];break;case _0x1da7('0x44'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x45');break;case'chanspies':_0x39d232['childModel']=_0x1da7('0x46');break;case _0x1da7('0x47'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x48');break;case'ivrcampaigns':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x49');break;case _0x1da7('0x4a'):_0x39d232[_0x1da7('0x1b')]='MailQueue';break;case'mailaccounts':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x4b');break;case _0x1da7('0x4c'):_0x39d232[_0x1da7('0x1b')]='MailSubstatus';break;case _0x1da7('0x4d'):_0x39d232['childModel']=_0x1da7('0x4e');break;case _0x1da7('0x4f'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x50');break;case'smsqueues':_0x39d232['childModel']='SmsQueue';break;case _0x1da7('0x51'):_0x39d232[_0x1da7('0x1b')]='SmsAccount';break;case _0x1da7('0x52'):_0x39d232['childModel']=_0x1da7('0x53');break;case _0x1da7('0x54'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x55');break;case _0x1da7('0x56'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x57');break;case _0x1da7('0x58'):case'queuecampaigns':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x41');if(_0x38418a){_0x39d232[_0x1da7('0x22')]=[{'name':_0x1da7('0x59')},{'name':_0x1da7('0x43')}];}break;case _0x1da7('0x5a'):case'agents':case'telephones':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x3e');if(_0x38418a){_0x39d232[_0x1da7('0x22')]=[{'name':_0x1da7('0x5b'),'filter':{'field':'role','value':[_0x1da7('0x5c'),_0x1da7('0x5d')]},'ignore':!![]},{'name':_0x1da7('0x39')},{'name':_0x1da7('0x3d')}];}break;case _0x1da7('0x5e'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x5f');break;case'salesforceaccounts':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x60');break;case _0x1da7('0x61'):_0x39d232['childModel']=_0x1da7('0x62');break;case _0x1da7('0x63'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x64');break;case'deskaccounts':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x65');break;case _0x1da7('0x66'):_0x39d232[_0x1da7('0x1b')]='ZohoAccount';break;case'vtigeraccounts':_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x3e');break;case _0x1da7('0x67'):_0x39d232[_0x1da7('0x1b')]='CannedAnswer';break;case _0x1da7('0x68'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x69');break;case _0x1da7('0x6a'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x6b');break;case'intervals':_0x39d232[_0x1da7('0x1b')]='Interval';break;case _0x1da7('0x6c'):_0x39d232[_0x1da7('0x1b')]='Pause';break;case _0x1da7('0x6d'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x6e');break;case _0x1da7('0x6f'):_0x39d232[_0x1da7('0x1b')]='Sound';break;case _0x1da7('0x70'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x71');break;case'templates':_0x39d232[_0x1da7('0x1b')]='Template';break;case _0x1da7('0x72'):_0x39d232[_0x1da7('0x1b')]='Trigger';break;case _0x1da7('0x73'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x74');break;case _0x1da7('0x75'):_0x39d232['childModel']=_0x1da7('0x76');break;case _0x1da7('0x77'):_0x39d232['childModel']=_0x1da7('0x78');break;case _0x1da7('0x79'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x12');_0x39d232[_0x1da7('0x22')]=[{'name':_0x1da7('0x7a'),'field':'id','foreignKey':_0x1da7('0x7b')}];break;case _0x1da7('0x7c'):_0x39d232[_0x1da7('0x1b')]=_0x1da7('0x7d');break;}return _0x39d232;}function _0x2dcff1(_0x58d5da,_0x255b82){var _0x409289=_0x58d5da[_0x1da7('0x7e')](0x0)['toUpperCase']()+_0x58d5da[_0x1da7('0x7f')](0x1);var _0x122a1e={'type':_0xda0bf5[_0x1da7('0x80')][_0x1da7('0x81')][_0x1da7('0x82')],'raw':!![]};return new Promise(function(_0x2aeeb0,_0x25b942){var _0x1f597d=squel[_0x1da7('0x83')]()[_0x1da7('0xc')](_0x1da7('0x84')+_0x409289+_0x1da7('0x85'),'id')[_0x1da7('0xc')]('ui.createdAt')[_0x1da7('0x86')](_0x1da7('0x87')+_0x58d5da+_0x1da7('0x88'),'ui')[_0x1da7('0x89')](_0x1da7('0x8a'),_0x255b82['id']);return _0xda0bf5['sequelize']['query'](_0x1f597d[_0x1da7('0x8b')](),_0x122a1e)[_0x1da7('0x8')](function(_0x4e9731){_0x255b82[_0x409289+_0x1da7('0x8c')]=_0x4e9731;_0x2aeeb0(_0x4e9731);})[_0x1da7('0xb')](function(_0xa98085){_0x25b942(_0xa98085);});});}return _0x52d78b['define']('UserProfile',attributes,{'tableName':_0x1da7('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x432ba5){var _0x2e5666={'raw':_0x432ba5[_0x1da7('0x8e')][_0x1da7('0x8f')],'where':{}};var _0x1deba3={};var _0x2ce634={'count':0x0,'rows':[]};var _0xbb7270=_0x432ba5[_0x1da7('0x8e')][_0x1da7('0x90')];var _0x4c7cb0=_0x432ba5['query'][_0x1da7('0x91')]||![];var _0x537ca7=_0x1afbcd(_0xbb7270,_0x4c7cb0);if(!_0x537ca7['childModel'])throw new Error(_0x1da7('0x92')+_0xbb7270+'\x27');var _0x33840b=[{'name':_0xbb7270}];if(!_[_0x1da7('0x93')](_0x537ca7['parentSections']))_0x33840b=_0x537ca7[_0x1da7('0x22')];var _0x3b65fd=[];for(var _0x88890a=0x0;_0x88890a<_0x33840b[_0x1da7('0x94')];_0x88890a++){_0x3b65fd[_0x1da7('0x95')](_0xda0bf5['UserProfileSection']['find']({'where':{'userProfileId':_0x432ba5[_0x1da7('0x96')]['id'],'name':_0x33840b[_0x88890a][_0x1da7('0xe')]},'raw':!![]}));}return Promise[_0x1da7('0x97')](_0x3b65fd)[_0x1da7('0x8')](function(_0x42ea00){var _0x21b8ab=_[_0x1da7('0x6')](_0x42ea00,function(_0x26d44f){return _0x26d44f?_0x26d44f:undefined;});var _0x3546e3=_[_0x1da7('0x6')](_0x33840b,[_0x1da7('0x98'),!![]]);var _0x2ac300=_[_0x1da7('0x93')](_0x21b8ab)&&_[_0x1da7('0x93')](_0x3546e3)?null:_[_0x1da7('0x99')](_0x3546e3,_0x21b8ab);if(!_0x2ac300)return null;var _0x5f4f15=[];for(var _0x5e5a0d=0x0;_0x5e5a0d<_0x2ac300[_0x1da7('0x94')];_0x5e5a0d++){var _0x19e224=_[_0x1da7('0x9a')](_0x33840b,function(_0x5c5a5e){return _0x2ac300[_0x5e5a0d]?_0x5c5a5e['name']===_0x2ac300[_0x5e5a0d][_0x1da7('0xe')]:null;});if(_0x19e224){if(_0x2ac300[_0x5e5a0d][_0x1da7('0x98')]){_0x5f4f15[_0x1da7('0x95')](_0x22c4b9(_0x537ca7[_0x1da7('0x1b')],_0x2ac300[_0x5e5a0d]));}else{if(!_0x2ac300[_0x5e5a0d][_0x1da7('0x9b')]){_0x5f4f15[_0x1da7('0x95')](_0xe90ee7(_0x19e224,_0x2ac300[_0x5e5a0d],_0x537ca7[_0x1da7('0x1b')]));}else{if(_0x19e224[_0x1da7('0xd')]){_0x5f4f15[_0x1da7('0x95')](_0x2351f7(_0x19e224,_0x2ac300[_0x5e5a0d]));}}}}}return Promise['all'](_0x5f4f15);})[_0x1da7('0x8')](function(_0x215e8d){var _0xf78a4e=_0x215e8d;var _0x18bfb9=null;if(_0xf78a4e){_0x18bfb9=_0xf78a4e[_0x1da7('0x94')]===0x1?_0xf78a4e[0x0]:null;}if(!_0x18bfb9&&!_0xf78a4e)return _0x2ce634;var _0x3958a7=_0xda0bf5[_0x537ca7['childModel']][_0x1da7('0x9c')];_0x1deba3['model']=_[_0x1da7('0x9d')](_0x3958a7);_0x1deba3[_0x1da7('0x8e')]=_[_0x1da7('0x9d')](_0x432ba5[_0x1da7('0x8e')]);_0x1deba3[_0x1da7('0x9e')]=_[_0x1da7('0x9f')](_0x1deba3[_0x1da7('0xd')],_0x1deba3[_0x1da7('0x8e')]);_0x2e5666[_0x1da7('0xa0')]=_[_0x1da7('0x9f')](_0x1deba3[_0x1da7('0xd')],qs[_0x1da7('0xa1')](_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xa1')]));_0x2e5666[_0x1da7('0xa0')]=_0x2e5666[_0x1da7('0xa0')]['length']?_0x2e5666[_0x1da7('0xa0')]:_0x1deba3[_0x1da7('0xd')];if(!_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xa2')]('nolimit')){_0x2e5666[_0x1da7('0xa3')]=qs[_0x1da7('0xa3')](_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xa3')]);_0x2e5666['offset']=qs[_0x1da7('0xa4')](_0x432ba5[_0x1da7('0x8e')]['offset']);}_0x2e5666[_0x1da7('0xa5')]=qs[_0x1da7('0xa6')](_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xa6')]);_0x2e5666[_0x1da7('0x89')]=qs[_0x1da7('0x9e')](_[_0x1da7('0xa7')](_0x432ba5['query'],_0x1deba3['filters']));if(_0x432ba5[_0x1da7('0x8e')][_0x1da7('0x6')]){_0x2e5666[_0x1da7('0x89')]=_['merge'](_0x2e5666[_0x1da7('0x89')],{'$or':_[_0x1da7('0xa')](_0x3958a7,function(_0x384b15){if(_0x384b15['type'][_0x1da7('0xa8')]!==_0x1da7('0xa9')){var _0xeea436={};_0xeea436[_0x384b15[_0x1da7('0xc')]]={'$like':'%'+_0x432ba5[_0x1da7('0x8e')][_0x1da7('0x6')]+'%'};return _0xeea436;}})});}var _0x4ec955=[];var _0x46dd4b=null;var _0x73c489={};if(_0x18bfb9){_0x46dd4b=_['find'](_0x33840b,[_0x1da7('0xe'),_0x18bfb9[_0x1da7('0xe')]]);if(_0x46dd4b[_0x1da7('0xc')]){_0x73c489={};if(_0x537ca7['childModel']===_0x1da7('0x12')){_0x73c489[_0x46dd4b[_0x1da7('0xaa')]]=_[_0x1da7('0xa')](_0x18bfb9['associatedResources'],'id');}else{_0x73c489[_0x46dd4b[_0x1da7('0xaa')]]=_0x18bfb9[_0x1da7('0x9')];}_0x4ec955[_0x1da7('0x95')](_0x73c489);}else{_0x2e5666['where']['id']=_0x18bfb9[_0x1da7('0x9')];}}else{for(var _0x343ed4=0x0;_0x343ed4<_0xf78a4e[_0x1da7('0x94')];_0x343ed4++){_0x46dd4b=_[_0x1da7('0x9a')](_0x33840b,[_0x1da7('0xe'),_0xf78a4e[_0x343ed4][_0x1da7('0xe')]]);if(_0x46dd4b[_0x1da7('0xc')]){_0x73c489={};_0x73c489[_0x46dd4b['foreignKey']]=_0xf78a4e[_0x343ed4]['associatedResources'];_0x4ec955[_0x1da7('0x95')](_0x73c489);}else{if(!_0x2e5666[_0x1da7('0x89')]['id'])_0x2e5666['where']['id']=[];_0xf78a4e[_0x343ed4][_0x1da7('0x9')][_0x1da7('0xab')](function(_0x16141f){_0x2e5666[_0x1da7('0x89')]['id']['push'](_0x16141f);});}}}if(!_[_0x1da7('0x93')](_0x4ec955)){_0x2e5666['where']=_['merge'](_0x2e5666['where'],{'$and':{'$or':_0x4ec955}});}_0x2e5666=_[_0x1da7('0xac')]({},_0x2e5666,_0x432ba5[_0x1da7('0xad')]);if(_0x18bfb9&&!_0x18bfb9['autoAssociation']&&_0x537ca7['childModel']===_0x1da7('0x12')){if(_0x432ba5['query']['includeAll']){_0x2e5666[_0x1da7('0xae')]=[{'all':!![]}];}return _0xda0bf5[_0x537ca7['childModel']][_0x1da7('0x11')](_0x2e5666)[_0x1da7('0x8')](function(_0x31b92a){var _0x501420=[];_0x31b92a[_0x1da7('0xab')](function(_0x30c0b2){var _0x3cac88;switch(_0x30c0b2[_0x1da7('0xaf')]){case _0x1da7('0xb0'):_0x3cac88=_['find'](_0x18bfb9[_0x1da7('0x9')],function(_0x594be0){return _0x594be0['id']===_0x30c0b2[_0x1da7('0x7b')]&&_0x594be0[_0x1da7('0x14')]==='DefaultReports';});break;case _0x1da7('0xb1'):_0x3cac88=_['find'](_0x18bfb9[_0x1da7('0x9')],function(_0x314eb2){return _0x314eb2['id']===_0x30c0b2[_0x1da7('0x7b')]&&_0x314eb2[_0x1da7('0x14')]===_0x1da7('0xb2');});break;}if(_0x3cac88)_0x501420['push'](_0x30c0b2);});_0x2ce634[_0x1da7('0xb3')]=_0x501420[_0x1da7('0x94')];_0x2ce634[_0x1da7('0xb4')]=_0x501420;return _0x2ce634;});}else{if(!_[_0x1da7('0x93')](_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xb5')])){_0x2e5666[_0x1da7('0x89')]['id']=_0x2e5666[_0x1da7('0x89')]['id']?_[_0x1da7('0x9f')](_0x2e5666['where']['id'],_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xb5')]):_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xb5')];if(_0x432ba5['query']['customSorting']){_0x2e5666[_0x1da7('0xa5')]=_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xb6')];}}if(_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xb7')]){_0x2e5666[_0x1da7('0x89')]=_[_0x1da7('0xac')](_0x2e5666[_0x1da7('0x89')],{'$and':_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xb7')]});}return _0xda0bf5[_0x537ca7[_0x1da7('0x1b')]][_0x1da7('0xb3')]({'where':_0x2e5666[_0x1da7('0x89')]})[_0x1da7('0x8')](function(_0x26489c){_0x2ce634['count']=_0x26489c;if(_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xb8')]){if(_0x537ca7[_0x1da7('0x1b')]==='CmContact'){_0x2e5666[_0x1da7('0xae')]=[{'model':_0xda0bf5[_0x1da7('0x71')],'as':_0x1da7('0xb9'),'attributes':['id',_0x1da7('0xe'),_0x1da7('0xba')],'required':_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xbb')]?!![]:![]},{'model':_0xda0bf5[_0x1da7('0x71')],'as':_0x1da7('0xbc'),'attributes':['id',_0x1da7('0xe'),_0x1da7('0xba')],'through':_0x432ba5[_0x1da7('0x8e')]['tag']?{'attributes':[],'where':{'TagId':_0x432ba5['query']['tag']||undefined}}:{},'required':_0x432ba5[_0x1da7('0x8e')][_0x1da7('0xbb')]?!![]:![]}];}else{_0x2e5666['include']=[{'all':!![]}];}}return _0xda0bf5[_0x537ca7[_0x1da7('0x1b')]]['findAll'](_0x2e5666);})[_0x1da7('0x8')](function(_0x6545e3){_0x2ce634[_0x1da7('0xb4')]=_0x6545e3;if(_0xbb7270===_0x1da7('0x39')&&_0x432ba5['query']['openTabs']===_0x1da7('0xbd')){var _0xd8ad0e=[];for(var _0x103402=0x0;_0x103402<_0x2ce634['rows'][_0x1da7('0x94')];_0x103402++){_0xd8ad0e[_0x1da7('0x95')](_0x2dcff1(_0x1da7('0xbe'),_0x2ce634[_0x1da7('0xb4')][_0x103402][_0x1da7('0xbf')]));_0xd8ad0e[_0x1da7('0x95')](_0x2dcff1('sms',_0x2ce634[_0x1da7('0xb4')][_0x103402][_0x1da7('0xbf')]));_0xd8ad0e[_0x1da7('0x95')](_0x2dcff1(_0x1da7('0xc0'),_0x2ce634[_0x1da7('0xb4')][_0x103402]['dataValues']));_0xd8ad0e[_0x1da7('0x95')](_0x2dcff1(_0x1da7('0xc1'),_0x2ce634[_0x1da7('0xb4')][_0x103402][_0x1da7('0xbf')]));_0xd8ad0e[_0x1da7('0x95')](_0x2dcff1('openchannel',_0x2ce634['rows'][_0x103402][_0x1da7('0xbf')]));_0xd8ad0e[_0x1da7('0x95')](_0x2dcff1(_0x1da7('0xc2'),_0x2ce634['rows'][_0x103402][_0x1da7('0xbf')]));}return Promise[_0x1da7('0x97')](_0xd8ad0e)[_0x1da7('0x8')](function(){return _0x2ce634;});}return _0x2ce634;});}});}}});}; \ No newline at end of file +var _0x4883=['section','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','include','CustomReports','rows','ids','customSorting','extraQueryConditions','count','includeAll','color','tag','ThroughTags','openTabs','true','chat','fax','dataValues','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','field','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','membername','User','role','agent','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','Agents','Telephones','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','variables','Variable','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','select','InteractionId','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw'];(function(_0x3509d1,_0x34fdc8){var _0x5aad33=function(_0x163e7e){while(--_0x163e7e){_0x3509d1['push'](_0x3509d1['shift']());}};_0x5aad33(++_0x34fdc8);}(_0x4883,0xef));var _0x3488=function(_0x150af9,_0x5296ed){_0x150af9=_0x150af9-0x0;var _0x437552=_0x4883[_0x150af9];return _0x437552;};'use strict';var _=require(_0x3488('0x0'));var attributes=require(_0x3488('0x1'));var qs=require(_0x3488('0x2'));var squel=require('squel');module[_0x3488('0x3')]=function(_0x14becd){var _0x94d054=_0x14becd[_0x3488('0x4')];function _0xc7fe98(_0x1539a0,_0xdc4389){return new Promise(function(_0x25d816,_0x35e1c4){if(!_0xdc4389)return _0x25d816(null);var _0x7c1bb3=_0xdc4389[_0x3488('0x5')]?{[_0xdc4389[_0x3488('0x5')]['field']]:_0xdc4389['filter'][_0x3488('0x6')]}:undefined;return _0x94d054[_0x1539a0][_0x3488('0x7')]({'where':_0x7c1bb3,'raw':!![]})[_0x3488('0x8')](function(_0x439851){_0xdc4389[_0x3488('0x9')]=_[_0x3488('0xa')](_0x439851,'id');_0x25d816(_0xdc4389);})[_0x3488('0xb')](function(_0x14ab13){_0x35e1c4(_0x14ab13);});});}function _0x4a41ca(_0x569c8d,_0x568cee){return new Promise(function(_0x3c74be,_0x23c05e){var _0x178629=_0x569c8d['filter']?{[_0x569c8d['filter']['field']]:_0x569c8d[_0x3488('0x5')][_0x3488('0x6')]}:undefined;return _0x94d054[_0x569c8d[_0x3488('0xc')]][_0x3488('0x7')]({'where':_0x178629,'raw':!![]})[_0x3488('0x8')](function(_0x3a3959){_0x568cee[_0x3488('0x9')]=_[_0x3488('0xa')](_0x3a3959,function(_0x2df401){return _0x2df401[_0x3488('0xd')];});_0x3c74be(_0x568cee);})[_0x3488('0xb')](function(_0x2532dc){_0x23c05e(_0x2532dc);});});}function _0x12034b(_0x55471d,_0x54d891,_0x1b2501){if(!_0x54d891)return Promise[_0x3488('0xe')](null);return new Promise(function(_0x1e9268,_0x400f28){return _0x94d054[_0x3488('0xf')][_0x3488('0x7')]({'where':{'sectionId':_0x54d891['id']},'raw':!![]})[_0x3488('0x8')](function(_0x4a5cf1){if(_0x55471d[_0x3488('0x10')]&&_0x55471d[_0x3488('0x10')]!=='id'){_0x54d891[_0x3488('0x9')]=_[_0x3488('0xa')](_0x4a5cf1,function(_0x3d261c){return _0x3d261c[_0x55471d[_0x3488('0x10')]];});}else{if(_0x1b2501===_0x3488('0x11')){_0x54d891[_0x3488('0x9')]=_['map'](_0x4a5cf1,function(_0xa54404){return{'id':_0xa54404[_0x3488('0x12')],'type':_0xa54404[_0x3488('0x13')]};});}else{_0x54d891['associatedResources']=_[_0x3488('0xa')](_0x4a5cf1,function(_0x2e639b){return _0x2e639b[_0x3488('0x12')];});}}_0x1e9268(_0x54d891);})[_0x3488('0xb')](function(_0xa4d376){_0x400f28(_0xa4d376);});});}function _0x31ce98(_0x5a612e,_0x33e468){var _0x5e7ac8={'parentSections':[]};switch(_0x5a612e[_0x3488('0x14')]()){case _0x3488('0x15'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x17');break;case _0x3488('0x18'):_0x5e7ac8[_0x3488('0x16')]='SquareOdbc';break;case'squarerecordings':_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x19');_0x5e7ac8[_0x3488('0x1a')]=[{'name':_0x3488('0x1b'),'field':_0x3488('0xd'),'foreignKey':_0x3488('0x1c')}];break;case _0x3488('0x1d'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x1e');break;case _0x3488('0x1f'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x20');_0x5e7ac8[_0x3488('0x1a')]=[{'name':_0x3488('0x21'),'field':'id','foreignKey':_0x3488('0x22')}];break;case _0x3488('0x23'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x24');break;case _0x3488('0x25'):_0x5e7ac8[_0x3488('0x16')]='CmCompany';break;case _0x3488('0x26'):_0x5e7ac8[_0x3488('0x16')]='CmCustomField';break;case _0x3488('0x27'):_0x5e7ac8['childModel']=_0x3488('0x28');break;case _0x3488('0x29'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x2a');break;case _0x3488('0x2b'):_0x5e7ac8[_0x3488('0x16')]='FaxQueue';break;case _0x3488('0x2c'):_0x5e7ac8[_0x3488('0x16')]='FaxAccount';break;case _0x3488('0x2d'):case _0x3488('0x2e'):case _0x3488('0x2f'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x30');break;case _0x3488('0x31'):_0x5e7ac8['childModel']=_0x3488('0x32');break;case'voicemails':_0x5e7ac8[_0x3488('0x16')]='VoiceMail';break;case _0x3488('0x33'):_0x5e7ac8[_0x3488('0x16')]='VoiceRecording';_0x5e7ac8['parentSections']=[{'name':'Agents','field':_0x3488('0xd'),'foreignKey':_0x3488('0x34'),'model':_0x3488('0x35'),'filter':{'field':_0x3488('0x36'),'value':[_0x3488('0x37')]}},{'name':'Telephones','field':'name','foreignKey':_0x3488('0x34'),'model':_0x3488('0x35'),'filter':{'field':_0x3488('0x36'),'value':[_0x3488('0x38')]}},{'name':_0x3488('0x39'),'field':'name','foreignKey':'queue','model':_0x3488('0x3a'),'filter':{'field':_0x3488('0x13'),'value':[_0x3488('0x3b')]}},{'name':_0x3488('0x3c'),'field':_0x3488('0xd'),'foreignKey':_0x3488('0x3d'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x3488('0x3e')]}}];break;case _0x3488('0x3f'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x40');break;case'chanspies':_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x41');break;case _0x3488('0x42'):_0x5e7ac8['childModel']=_0x3488('0x43');break;case'ivrcampaigns':_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x44');break;case _0x3488('0x45'):_0x5e7ac8[_0x3488('0x16')]='MailQueue';break;case _0x3488('0x46'):_0x5e7ac8['childModel']=_0x3488('0x47');break;case _0x3488('0x48'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x49');break;case _0x3488('0x4a'):_0x5e7ac8['childModel']=_0x3488('0x4b');break;case _0x3488('0x4c'):_0x5e7ac8[_0x3488('0x16')]='OpenchannelAccount';break;case'smsqueues':_0x5e7ac8[_0x3488('0x16')]='SmsQueue';break;case _0x3488('0x4d'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x4e');break;case _0x3488('0x4f'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x50');break;case _0x3488('0x51'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x52');break;case _0x3488('0x53'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x54');break;case _0x3488('0x55'):case _0x3488('0x56'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x3a');if(_0x33e468){_0x5e7ac8[_0x3488('0x1a')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case'users':case _0x3488('0x57'):case _0x3488('0x58'):_0x5e7ac8[_0x3488('0x16')]='User';if(_0x33e468){_0x5e7ac8[_0x3488('0x1a')]=[{'name':_0x3488('0x59'),'filter':{'field':_0x3488('0x36'),'value':['admin','user']},'ignore':!![]},{'name':_0x3488('0x5a')},{'name':_0x3488('0x5b')}];}break;case'zendeskaccounts':_0x5e7ac8[_0x3488('0x16')]='ZendeskAccount';break;case _0x3488('0x5c'):_0x5e7ac8['childModel']=_0x3488('0x5d');break;case'freshdeskaccounts':_0x5e7ac8['childModel']=_0x3488('0x5e');break;case _0x3488('0x5f'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x60');break;case _0x3488('0x61'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x62');break;case'zohoaccounts':_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x63');break;case _0x3488('0x64'):_0x5e7ac8[_0x3488('0x16')]='User';break;case _0x3488('0x65'):_0x5e7ac8['childModel']=_0x3488('0x66');break;case _0x3488('0x67'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x68');break;case _0x3488('0x69'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x6a');break;case _0x3488('0x6b'):_0x5e7ac8['childModel']=_0x3488('0x6c');break;case _0x3488('0x6d'):_0x5e7ac8['childModel']=_0x3488('0x6e');break;case _0x3488('0x6f'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x70');break;case _0x3488('0x71'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x72');break;case _0x3488('0x73'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x74');break;case _0x3488('0x75'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x76');break;case _0x3488('0x77'):_0x5e7ac8['childModel']=_0x3488('0x78');break;case _0x3488('0x79'):_0x5e7ac8['childModel']='Trunk';break;case _0x3488('0x7a'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x7b');break;case'plugins':_0x5e7ac8[_0x3488('0x16')]='Plugin';break;case _0x3488('0x7c'):_0x5e7ac8['childModel']=_0x3488('0x11');_0x5e7ac8[_0x3488('0x1a')]=[{'name':_0x3488('0x7d'),'field':'id','foreignKey':_0x3488('0x7e')}];break;case _0x3488('0x7f'):_0x5e7ac8[_0x3488('0x16')]=_0x3488('0x80');break;}return _0x5e7ac8;}function _0x51ca45(_0x3b07d6,_0x24aaa2){var _0x3adb4b=_0x3b07d6['charAt'](0x0)[_0x3488('0x81')]()+_0x3b07d6[_0x3488('0x82')](0x1);var _0x2ee377={'type':_0x94d054[_0x3488('0x83')]['QueryTypes'][_0x3488('0x84')],'raw':!![]};return new Promise(function(_0x126171,_0x250beb){var _0x5128a8=squel[_0x3488('0x85')]()[_0x3488('0x10')]('ui.'+_0x3adb4b+_0x3488('0x86'),'id')[_0x3488('0x10')]('ui.createdAt')[_0x3488('0x87')](_0x3488('0x88')+_0x3b07d6+_0x3488('0x89'),'ui')[_0x3488('0x8a')]('ui.UserId\x20=\x20?',_0x24aaa2['id']);return _0x94d054[_0x3488('0x8b')][_0x3488('0x8c')](_0x5128a8[_0x3488('0x8d')](),_0x2ee377)[_0x3488('0x8')](function(_0x422720){_0x24aaa2[_0x3adb4b+_0x3488('0x8e')]=_0x422720;_0x126171(_0x422720);})['catch'](function(_0x1b78f5){_0x250beb(_0x1b78f5);});});}return _0x14becd[_0x3488('0x8f')](_0x3488('0x90'),attributes,{'tableName':_0x3488('0x91'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xbc326d){var _0x39823b={'raw':_0xbc326d[_0x3488('0x8c')][_0x3488('0x92')],'where':{}};var _0x229cd6={};var _0x2b0805={'count':0x0,'rows':[]};var _0xcc36a0=_0xbc326d[_0x3488('0x8c')][_0x3488('0x93')];var _0x3d48eb=_0xbc326d[_0x3488('0x8c')]['mergeResources']||![];var _0x369d98=_0x31ce98(_0xcc36a0,_0x3d48eb);if(!_0x369d98[_0x3488('0x16')])throw new Error('Invalid\x20section\x20\x27'+_0xcc36a0+'\x27');var _0x1dd28a=[{'name':_0xcc36a0}];if(!_[_0x3488('0x94')](_0x369d98[_0x3488('0x1a')]))_0x1dd28a=_0x369d98[_0x3488('0x1a')];var _0x5965c5=[];for(var _0x23aba3=0x0;_0x23aba3<_0x1dd28a[_0x3488('0x95')];_0x23aba3++){_0x5965c5[_0x3488('0x96')](_0x94d054[_0x3488('0x97')][_0x3488('0x98')]({'where':{'userProfileId':_0xbc326d[_0x3488('0x99')]['id'],'name':_0x1dd28a[_0x23aba3][_0x3488('0xd')]},'raw':!![]}));}return Promise[_0x3488('0x9a')](_0x5965c5)[_0x3488('0x8')](function(_0x4059b8){var _0x534e63=_['filter'](_0x4059b8,function(_0x421eb8){return _0x421eb8?_0x421eb8:undefined;});var _0x22851e=_[_0x3488('0x5')](_0x1dd28a,[_0x3488('0x9b'),!![]]);var _0x42b8ff=_[_0x3488('0x94')](_0x534e63)&&_[_0x3488('0x94')](_0x22851e)?null:_[_0x3488('0x9c')](_0x22851e,_0x534e63);if(!_0x42b8ff)return null;var _0x49aa9a=[];for(var _0x4c268f=0x0;_0x4c268f<_0x42b8ff[_0x3488('0x95')];_0x4c268f++){var _0x414b32=_[_0x3488('0x98')](_0x1dd28a,function(_0x15ca27){return _0x42b8ff[_0x4c268f]?_0x15ca27[_0x3488('0xd')]===_0x42b8ff[_0x4c268f][_0x3488('0xd')]:null;});if(_0x414b32){if(_0x42b8ff[_0x4c268f]['ignore']){_0x49aa9a[_0x3488('0x96')](_0xc7fe98(_0x369d98['childModel'],_0x42b8ff[_0x4c268f]));}else{if(!_0x42b8ff[_0x4c268f][_0x3488('0x9d')]){_0x49aa9a[_0x3488('0x96')](_0x12034b(_0x414b32,_0x42b8ff[_0x4c268f],_0x369d98[_0x3488('0x16')]));}else{if(_0x414b32[_0x3488('0xc')]){_0x49aa9a['push'](_0x4a41ca(_0x414b32,_0x42b8ff[_0x4c268f]));}}}}}return Promise[_0x3488('0x9a')](_0x49aa9a);})[_0x3488('0x8')](function(_0x5d00a1){var _0x5eef02=_0x5d00a1;var _0x37c8b9=null;if(_0x5eef02){_0x37c8b9=_0x5eef02[_0x3488('0x95')]===0x1?_0x5eef02[0x0]:null;}if(!_0x37c8b9&&!_0x5eef02)return _0x2b0805;var _0x22a59d=_0x94d054[_0x369d98[_0x3488('0x16')]]['rawAttributes'];_0x229cd6[_0x3488('0xc')]=_[_0x3488('0x9e')](_0x22a59d);_0x229cd6[_0x3488('0x8c')]=_[_0x3488('0x9e')](_0xbc326d[_0x3488('0x8c')]);_0x229cd6[_0x3488('0x9f')]=_[_0x3488('0xa0')](_0x229cd6[_0x3488('0xc')],_0x229cd6[_0x3488('0x8c')]);_0x39823b[_0x3488('0xa1')]=_[_0x3488('0xa0')](_0x229cd6[_0x3488('0xc')],qs[_0x3488('0xa2')](_0xbc326d[_0x3488('0x8c')][_0x3488('0xa2')]));_0x39823b['attributes']=_0x39823b[_0x3488('0xa1')][_0x3488('0x95')]?_0x39823b[_0x3488('0xa1')]:_0x229cd6[_0x3488('0xc')];if(!_0xbc326d['query'][_0x3488('0xa3')]('nolimit')){_0x39823b[_0x3488('0xa4')]=qs[_0x3488('0xa4')](_0xbc326d['query'][_0x3488('0xa4')]);_0x39823b['offset']=qs[_0x3488('0xa5')](_0xbc326d['query'][_0x3488('0xa5')]);}_0x39823b[_0x3488('0xa6')]=qs[_0x3488('0xa7')](_0xbc326d[_0x3488('0x8c')][_0x3488('0xa7')]);_0x39823b[_0x3488('0x8a')]=qs[_0x3488('0x9f')](_[_0x3488('0xa8')](_0xbc326d[_0x3488('0x8c')],_0x229cd6[_0x3488('0x9f')]));if(_0xbc326d[_0x3488('0x8c')][_0x3488('0x5')]){_0x39823b['where']=_[_0x3488('0xa9')](_0x39823b[_0x3488('0x8a')],{'$or':_[_0x3488('0xa')](_0x22a59d,function(_0x44cc08){if(_0x44cc08[_0x3488('0x13')][_0x3488('0xaa')]!==_0x3488('0xab')){var _0x134980={};_0x134980[_0x44cc08['field']]={'$like':'%'+_0xbc326d[_0x3488('0x8c')][_0x3488('0x5')]+'%'};return _0x134980;}})});}var _0x8ec178=[];var _0x24aa77=null;var _0x38dba3={};if(_0x37c8b9){_0x24aa77=_['find'](_0x1dd28a,[_0x3488('0xd'),_0x37c8b9['name']]);if(_0x24aa77[_0x3488('0x10')]){_0x38dba3={};if(_0x369d98['childModel']===_0x3488('0x11')){_0x38dba3[_0x24aa77[_0x3488('0xac')]]=_[_0x3488('0xa')](_0x37c8b9[_0x3488('0x9')],'id');}else{_0x38dba3[_0x24aa77[_0x3488('0xac')]]=_0x37c8b9[_0x3488('0x9')];}_0x8ec178['push'](_0x38dba3);}else{_0x39823b[_0x3488('0x8a')]['id']=_0x37c8b9[_0x3488('0x9')];}}else{for(var _0x5d2478=0x0;_0x5d2478<_0x5eef02[_0x3488('0x95')];_0x5d2478++){_0x24aa77=_[_0x3488('0x98')](_0x1dd28a,[_0x3488('0xd'),_0x5eef02[_0x5d2478]['name']]);if(_0x24aa77[_0x3488('0x10')]){_0x38dba3={};_0x38dba3[_0x24aa77[_0x3488('0xac')]]=_0x5eef02[_0x5d2478][_0x3488('0x9')];_0x8ec178[_0x3488('0x96')](_0x38dba3);}else{if(!_0x39823b['where']['id'])_0x39823b['where']['id']=[];_0x5eef02[_0x5d2478]['associatedResources'][_0x3488('0xad')](function(_0x206f9d){_0x39823b[_0x3488('0x8a')]['id']['push'](_0x206f9d);});}}}if(!_[_0x3488('0x94')](_0x8ec178)){_0x39823b[_0x3488('0x8a')]=_[_0x3488('0xa9')](_0x39823b[_0x3488('0x8a')],{'$and':{'$or':_0x8ec178}});}_0x39823b=_['merge']({},_0x39823b,_0xbc326d[_0x3488('0xae')]);if(_0x37c8b9&&!_0x37c8b9[_0x3488('0x9d')]&&_0x369d98[_0x3488('0x16')]===_0x3488('0x11')){if(_0xbc326d['query']['includeAll']){_0x39823b[_0x3488('0xaf')]=[{'all':!![]}];}return _0x94d054[_0x369d98[_0x3488('0x16')]][_0x3488('0x7')](_0x39823b)[_0x3488('0x8')](function(_0x1ed832){var _0x41e759=[];_0x1ed832[_0x3488('0xad')](function(_0x3ae5cf){var _0x1b996a;switch(_0x3ae5cf['reportType']){case'default':_0x1b996a=_[_0x3488('0x98')](_0x37c8b9[_0x3488('0x9')],function(_0x3acd88){return _0x3acd88['id']===_0x3ae5cf[_0x3488('0x7e')]&&_0x3acd88[_0x3488('0x13')]==='DefaultReports';});break;case'custom':_0x1b996a=_[_0x3488('0x98')](_0x37c8b9[_0x3488('0x9')],function(_0xaf9571){return _0xaf9571['id']===_0x3ae5cf['reportId']&&_0xaf9571['type']===_0x3488('0xb0');});break;}if(_0x1b996a)_0x41e759[_0x3488('0x96')](_0x3ae5cf);});_0x2b0805['count']=_0x41e759['length'];_0x2b0805[_0x3488('0xb1')]=_0x41e759;return _0x2b0805;});}else{if(!_[_0x3488('0x94')](_0xbc326d[_0x3488('0x8c')]['ids'])){_0x39823b[_0x3488('0x8a')]['id']=_0x39823b[_0x3488('0x8a')]['id']?_[_0x3488('0xa0')](_0x39823b['where']['id'],_0xbc326d[_0x3488('0x8c')][_0x3488('0xb2')]):_0xbc326d[_0x3488('0x8c')][_0x3488('0xb2')];if(_0xbc326d[_0x3488('0x8c')]['customSorting']){_0x39823b[_0x3488('0xa6')]=_0xbc326d['query'][_0x3488('0xb3')];}}if(_0xbc326d[_0x3488('0x8c')][_0x3488('0xb4')]){_0x39823b[_0x3488('0x8a')]=_[_0x3488('0xa9')](_0x39823b['where'],{'$and':_0xbc326d[_0x3488('0x8c')][_0x3488('0xb4')]});}return _0x94d054[_0x369d98['childModel']][_0x3488('0xb5')]({'where':_0x39823b[_0x3488('0x8a')]})[_0x3488('0x8')](function(_0x2f0f5e){_0x2b0805[_0x3488('0xb5')]=_0x2f0f5e;if(_0xbc326d[_0x3488('0x8c')][_0x3488('0xb6')]){if(_0x369d98[_0x3488('0x16')]==='CmContact'){_0x39823b[_0x3488('0xaf')]=[{'model':_0x94d054['Tag'],'as':'Tags','attributes':['id','name',_0x3488('0xb7')],'required':_0xbc326d[_0x3488('0x8c')][_0x3488('0xb8')]?!![]:![]},{'model':_0x94d054[_0x3488('0x74')],'as':_0x3488('0xb9'),'attributes':['id',_0x3488('0xd'),_0x3488('0xb7')],'through':_0xbc326d['query']['tag']?{'attributes':[],'where':{'TagId':_0xbc326d['query'][_0x3488('0xb8')]||undefined}}:{},'required':_0xbc326d[_0x3488('0x8c')]['tag']?!![]:![]}];}else{_0x39823b[_0x3488('0xaf')]=[{'all':!![]}];}}return _0x94d054[_0x369d98[_0x3488('0x16')]]['findAll'](_0x39823b);})[_0x3488('0x8')](function(_0x52528c){_0x2b0805[_0x3488('0xb1')]=_0x52528c;if(_0xcc36a0===_0x3488('0x5a')&&_0xbc326d[_0x3488('0x8c')][_0x3488('0xba')]===_0x3488('0xbb')){var _0x3087b6=[];for(var _0x2b5858=0x0;_0x2b5858<_0x2b0805['rows'][_0x3488('0x95')];_0x2b5858++){_0x3087b6[_0x3488('0x96')](_0x51ca45(_0x3488('0xbc'),_0x2b0805[_0x3488('0xb1')][_0x2b5858]['dataValues']));_0x3087b6[_0x3488('0x96')](_0x51ca45('sms',_0x2b0805['rows'][_0x2b5858]['dataValues']));_0x3087b6['push'](_0x51ca45(_0x3488('0xbd'),_0x2b0805[_0x3488('0xb1')][_0x2b5858][_0x3488('0xbe')]));_0x3087b6[_0x3488('0x96')](_0x51ca45(_0x3488('0xbf'),_0x2b0805['rows'][_0x2b5858]['dataValues']));_0x3087b6[_0x3488('0x96')](_0x51ca45(_0x3488('0xc0'),_0x2b0805[_0x3488('0xb1')][_0x2b5858][_0x3488('0xbe')]));_0x3087b6[_0x3488('0x96')](_0x51ca45('whatsapp',_0x2b0805[_0x3488('0xb1')][_0x2b5858][_0x3488('0xbe')]));}return Promise[_0x3488('0x9a')](_0x3087b6)[_0x3488('0x8')](function(){return _0x2b0805;});}return _0x2b0805;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8b8a970..b573522 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 _0x2d2c=['stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x3c8bd0,_0x59d470){var _0x3ab008=function(_0x2f95ef){while(--_0x2f95ef){_0x3c8bd0['push'](_0x3c8bd0['shift']());}};_0x3ab008(++_0x59d470);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0x2d2c[_0x8af54b];return _0x27d8f0;};'use strict';var _=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var moment=require(_0xc2d2('0x2'));var BPromise=require(_0xc2d2('0x3'));var rs=require(_0xc2d2('0x4'));var fs=require('fs');var Redis=require(_0xc2d2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc2d2('0x6'));var logger=require('../../config/logger')(_0xc2d2('0x7'));var config=require(_0xc2d2('0x8'));var jayson=require(_0xc2d2('0x9'));var client=jayson[_0xc2d2('0xa')][_0xc2d2('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc2d2('0xc')],{'host':_0xc2d2('0xd'),'port':0x18eb});var socket=require(_0xc2d2('0xe'))(new Redis(config[_0xc2d2('0xc')]));require(_0xc2d2('0xf'))[_0xc2d2('0x10')](socket);function respondWithRpcPromise(_0xe20d3,_0x408f47,_0x43ecff){return new BPromise(function(_0x1c1d9a,_0x2f247a){return client[_0xc2d2('0x11')](_0xe20d3,_0x43ecff)['then'](function(_0x27eb6b){logger[_0xc2d2('0x12')](_0xc2d2('0x13'),_0x408f47,'request\x20sent');logger[_0xc2d2('0x14')](_0xc2d2('0x15'),_0x408f47,'request\x20sent',JSON[_0xc2d2('0x16')](_0x27eb6b));if(_0x27eb6b[_0xc2d2('0x17')]){if(_0x27eb6b['error'][_0xc2d2('0x18')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x408f47,_0x27eb6b[_0xc2d2('0x17')][_0xc2d2('0x19')]);return _0x2f247a(_0x27eb6b[_0xc2d2('0x17')][_0xc2d2('0x19')]);}logger[_0xc2d2('0x17')](_0xc2d2('0x13'),_0x408f47,_0x27eb6b[_0xc2d2('0x17')][_0xc2d2('0x19')]);return _0x1c1d9a(_0x27eb6b[_0xc2d2('0x17')][_0xc2d2('0x19')]);}else{logger[_0xc2d2('0x12')]('UserProfile,\x20%s,\x20%s',_0x408f47,_0xc2d2('0x1a'));_0x1c1d9a(_0x27eb6b[_0xc2d2('0x1b')][_0xc2d2('0x19')]);}})[_0xc2d2('0x1c')](function(_0x54dc26){logger[_0xc2d2('0x17')](_0xc2d2('0x13'),_0x408f47,_0x54dc26);_0x2f247a(_0x54dc26);});});} \ No newline at end of file +var _0x4e83=['bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x33a5ca,_0x3b9fc4){var _0x156125=function(_0x202dd7){while(--_0x202dd7){_0x33a5ca['push'](_0x33a5ca['shift']());}};_0x156125(++_0x3b9fc4);}(_0x4e83,0x1ae));var _0x34e8=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x4e83[_0x34e14d];return _0x3d8e08;};'use strict';var _=require(_0x34e8('0x0'));var util=require('util');var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require(_0x34e8('0x4'));var db=require(_0x34e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34e8('0x6'));var client=jayson[_0x34e8('0x7')]['http']({'port':0x232a});config[_0x34e8('0x8')]=_[_0x34e8('0x9')](config[_0x34e8('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x34e8('0xa'))(new Redis(config[_0x34e8('0x8')]));require(_0x34e8('0xb'))['register'](socket);function respondWithRpcPromise(_0x8ad56d,_0x1e3038,_0x42bb8d){return new BPromise(function(_0x46fe66,_0x316e99){return client[_0x34e8('0xc')](_0x8ad56d,_0x42bb8d)[_0x34e8('0xd')](function(_0x6827a3){logger[_0x34e8('0xe')]('UserProfile,\x20%s,\x20%s',_0x1e3038,_0x34e8('0xf'));logger[_0x34e8('0x10')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x1e3038,_0x34e8('0xf'),JSON[_0x34e8('0x11')](_0x6827a3));if(_0x6827a3[_0x34e8('0x12')]){if(_0x6827a3[_0x34e8('0x12')][_0x34e8('0x13')]===0x1f4){logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x6827a3[_0x34e8('0x12')][_0x34e8('0x15')]);return _0x316e99(_0x6827a3['error'][_0x34e8('0x15')]);}logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x6827a3[_0x34e8('0x12')][_0x34e8('0x15')]);return _0x46fe66(_0x6827a3['error'][_0x34e8('0x15')]);}else{logger[_0x34e8('0xe')](_0x34e8('0x14'),_0x1e3038,_0x34e8('0xf'));_0x46fe66(_0x6827a3[_0x34e8('0x16')][_0x34e8('0x15')]);}})[_0x34e8('0x17')](function(_0x3eb461){logger[_0x34e8('0x12')](_0x34e8('0x14'),_0x1e3038,_0x3eb461);_0x316e99(_0x3eb461);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 4b39d9c..43bb832 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 _0xa584=['register','length','userProfile:','./userProfile.events','save','update'];(function(_0x459847,_0x3d79f4){var _0x3720fe=function(_0x213c83){while(--_0x213c83){_0x459847['push'](_0x459847['shift']());}};_0x3720fe(++_0x3d79f4);}(_0xa584,0xb1));var _0x4a58=function(_0x162242,_0x542083){_0x162242=_0x162242-0x0;var _0x4085c7=_0xa584[_0x162242];return _0x4085c7;};'use strict';var UserProfileEvents=require(_0x4a58('0x0'));var events=[_0x4a58('0x1'),'remove',_0x4a58('0x2')];function createListener(_0x180682,_0x153ec7){return function(_0x5e49a4){_0x153ec7['emit'](_0x180682,_0x5e49a4);};}function removeListener(_0x35bb74,_0x37d21b){return function(){UserProfileEvents['removeListener'](_0x35bb74,_0x37d21b);};}exports[_0x4a58('0x3')]=function(_0x429b59){for(var _0x27e880=0x0,_0x26bb0a=events[_0x4a58('0x4')];_0x27e880<_0x26bb0a;_0x27e880++){var _0x3566b2=events[_0x27e880];var _0x2065c9=createListener(_0x4a58('0x5')+_0x3566b2,_0x429b59);UserProfileEvents['on'](_0x3566b2,_0x2065c9);}}; \ No newline at end of file +var _0x3309=['remove','update','emit','removeListener','register','./userProfile.events','save'];(function(_0x540407,_0x2d2166){var _0x1b2aac=function(_0xa20b3d){while(--_0xa20b3d){_0x540407['push'](_0x540407['shift']());}};_0x1b2aac(++_0x2d2166);}(_0x3309,0x1a2));var _0x9330=function(_0x1fe188,_0x11e1df){_0x1fe188=_0x1fe188-0x0;var _0x1b3e93=_0x3309[_0x1fe188];return _0x1b3e93;};'use strict';var UserProfileEvents=require(_0x9330('0x0'));var events=[_0x9330('0x1'),_0x9330('0x2'),_0x9330('0x3')];function createListener(_0x79298d,_0x3ac28f){return function(_0x2e8575){_0x3ac28f[_0x9330('0x4')](_0x79298d,_0x2e8575);};}function removeListener(_0x3c8884,_0xf9410a){return function(){UserProfileEvents[_0x9330('0x5')](_0x3c8884,_0xf9410a);};}exports[_0x9330('0x6')]=function(_0x912508){for(var _0x59ad73=0x0,_0x283330=events['length'];_0x59ad73<_0x283330;_0x59ad73++){var _0x4fac3e=events[_0x59ad73];var _0x4dd54a=createListener('userProfile:'+_0x4fac3e,_0x912508);UserProfileEvents['on'](_0x4fac3e,_0x4dd54a);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 3fc71b3..0627b28 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 _0x7346=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x7346,0x17c));var _0x6734=function(_0x1f60ce,_0x3e69e5){_0x1f60ce=_0x1f60ce-0x0;var _0x11c9e4=_0x7346[_0x1f60ce];return _0x11c9e4;};'use strict';var multer=require(_0x6734('0x0'));var util=require(_0x6734('0x1'));var path=require(_0x6734('0x2'));var timeout=require(_0x6734('0x3'));var express=require(_0x6734('0x4'));var router=express['Router']();var fs_extra=require(_0x6734('0x5'));var auth=require(_0x6734('0x6'));var interaction=require(_0x6734('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6734('0x8')]);router[_0x6734('0x9')](_0x6734('0xa'),auth[_0x6734('0xb')](),controller['describe']);router[_0x6734('0x9')]('/:id',auth[_0x6734('0xb')](),controller[_0x6734('0xc')]);router[_0x6734('0xd')]('/',auth['isAuthenticated'](),controller[_0x6734('0xe')]);router['put'](_0x6734('0xf'),auth['isAuthenticated'](),controller[_0x6734('0x10')]);router[_0x6734('0x11')](_0x6734('0xf'),auth[_0x6734('0xb')](),controller[_0x6734('0x12')]);module[_0x6734('0x13')]=router; \ No newline at end of file +var _0x30a3=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x30a3,0x1ee));var _0x330a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x30a3[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x330a('0x0'));var util=require(_0x330a('0x1'));var path=require('path');var timeout=require(_0x330a('0x2'));var express=require('express');var router=express[_0x330a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x330a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x330a('0x5'));var controller=require(_0x330a('0x6'));router[_0x330a('0x7')]('/',auth[_0x330a('0x8')](),controller[_0x330a('0x9')]);router[_0x330a('0x7')](_0x330a('0xa'),auth[_0x330a('0x8')](),controller[_0x330a('0xb')]);router['get'](_0x330a('0xc'),auth['isAuthenticated'](),controller[_0x330a('0xd')]);router[_0x330a('0xe')]('/',auth[_0x330a('0x8')](),controller[_0x330a('0xf')]);router[_0x330a('0x10')](_0x330a('0xc'),auth[_0x330a('0x8')](),controller[_0x330a('0x11')]);router[_0x330a('0x12')](_0x330a('0xc'),auth[_0x330a('0x8')](),controller[_0x330a('0x13')]);module[_0x330a('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 9fd0e94..9a7845a 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 _0x1f13=['exports','INTEGER','STRING','sequelize'];(function(_0x285886,_0x5ca12e){var _0x5e606d=function(_0x418ecd){while(--_0x418ecd){_0x285886['push'](_0x285886['shift']());}};_0x5e606d(++_0x5ca12e);}(_0x1f13,0x193));var _0x31f1=function(_0x48b6a9,_0x25f3be){_0x48b6a9=_0x48b6a9-0x0;var _0x3b6e05=_0x1f13[_0x48b6a9];return _0x3b6e05;};'use strict';var Sequelize=require(_0x31f1('0x0'));module[_0x31f1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x31f1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x31f1('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x18c5=['sequelize','exports','INTEGER','STRING'];(function(_0x115584,_0x22182b){var _0x26f931=function(_0x3711bc){while(--_0x3711bc){_0x115584['push'](_0x115584['shift']());}};_0x26f931(++_0x22182b);}(_0x18c5,0x148));var _0x518c=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x18c5[_0x5834bc];return _0x3e183a;};'use strict';var Sequelize=require(_0x518c('0x0'));module[_0x518c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x518c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x518c('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 8453c37..5dac924 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 _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x183c00,_0x5327b8){var _0x4a8361=function(_0x126739){while(--_0x126739){_0x183c00['push'](_0x183c00['shift']());}};_0x4a8361(++_0x5327b8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x52bd36,_0x3fa72a){_0x52bd36=_0x52bd36-0x0;var _0x12a4f9=_0x5f2f[_0x52bd36];return _0x12a4f9;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));}; \ No newline at end of file +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x1df07a,_0x30f0a2){var _0x5667c3=function(_0x3334b0){while(--_0x3334b0){_0x1df07a['push'](_0x1df07a['shift']());}};_0x5667c3(++_0x30f0a2);}(_0x47c5,0x165));var _0x547c=function(_0x2ad921,_0x3ec1d1){_0x2ad921=_0x2ad921-0x0;var _0x419042=_0x47c5[_0x2ad921];return _0x419042;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index e43c3eb..e5ea3ba 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 _0x6890=['UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','path','../../config/environment','./userProfileResource.attributes','exports','define'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x6890,0xaa));var _0x0689=function(_0x5a5349,_0x3a789d){_0x5a5349=_0x5a5349-0x0;var _0x5efd3c=_0x6890[_0x5a5349];return _0x5efd3c;};'use strict';var _=require(_0x0689('0x0'));var util=require(_0x0689('0x1'));var logger=require(_0x0689('0x2'))(_0x0689('0x3'));var moment=require(_0x0689('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0689('0x5'));var rimraf=require('rimraf');var config=require(_0x0689('0x6'));var attributes=require(_0x0689('0x7'));module[_0x0689('0x8')]=function(_0x5c74c9,_0x4ffbf5){return _0x5c74c9[_0x0689('0x9')](_0x0689('0xa'),attributes,{'tableName':_0x0689('0xb'),'paranoid':![],'indexes':[{'name':_0x0689('0xc'),'fields':[_0x0689('0xd'),_0x0689('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xcb91,0x114));var _0x1cb9=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0xcb91[_0x47df54];return _0x261b87;};'use strict';var _=require('lodash');var util=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var rp=require(_0x1cb9('0x4'));var fs=require('fs');var path=require(_0x1cb9('0x5'));var rimraf=require('rimraf');var config=require(_0x1cb9('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x1cb9('0x7')]=function(_0x2b5e2f,_0x42f508){return _0x2b5e2f['define']('UserProfileResource',attributes,{'tableName':_0x1cb9('0x8'),'paranoid':![],'indexes':[{'name':_0x1cb9('0x9'),'fields':[_0x1cb9('0xa'),_0x1cb9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6b7dac2..8d98f87 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 _0xe578=['then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x2dc217,_0x46a4e0){var _0x51c132=function(_0x57085d){while(--_0x57085d){_0x2dc217['push'](_0x2dc217['shift']());}};_0x51c132(++_0x46a4e0);}(_0xe578,0x139));var _0x8e57=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe578[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x8e57('0x0'));var moment=require('moment');var BPromise=require(_0x8e57('0x1'));var rs=require(_0x8e57('0x2'));var fs=require('fs');var Redis=require(_0x8e57('0x3'));var db=require(_0x8e57('0x4'))['db'];var utils=require(_0x8e57('0x5'));var logger=require('../../config/logger')(_0x8e57('0x6'));var config=require(_0x8e57('0x7'));var jayson=require(_0x8e57('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ec4a9,_0x47b7e2,_0x8538f1){return new BPromise(function(_0x26592e,_0xcec521){return client[_0x8e57('0x9')](_0x4ec4a9,_0x8538f1)[_0x8e57('0xa')](function(_0x430afd){logger['info'](_0x8e57('0xb'),_0x47b7e2,_0x8e57('0xc'));logger[_0x8e57('0xd')](_0x8e57('0xe'),_0x47b7e2,'request\x20sent',JSON['stringify'](_0x430afd));if(_0x430afd[_0x8e57('0xf')]){if(_0x430afd[_0x8e57('0xf')][_0x8e57('0x10')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x47b7e2,_0x430afd[_0x8e57('0xf')][_0x8e57('0x11')]);return _0xcec521(_0x430afd[_0x8e57('0xf')]['message']);}logger[_0x8e57('0xf')](_0x8e57('0xb'),_0x47b7e2,_0x430afd[_0x8e57('0xf')][_0x8e57('0x11')]);return _0x26592e(_0x430afd[_0x8e57('0xf')][_0x8e57('0x11')]);}else{logger['info'](_0x8e57('0xb'),_0x47b7e2,_0x8e57('0xc'));_0x26592e(_0x430afd['result'][_0x8e57('0x11')]);}})[_0x8e57('0x12')](function(_0x556760){logger[_0x8e57('0xf')](_0x8e57('0xb'),_0x47b7e2,_0x556760);_0xcec521(_0x556760);});});} \ No newline at end of file +var _0x67fd=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x67fd,0x1dc));var _0xd67f=function(_0x9763f8,_0x4b85d4){_0x9763f8=_0x9763f8-0x0;var _0x1757c0=_0x67fd[_0x9763f8];return _0x1757c0;};'use strict';var _=require('lodash');var util=require(_0xd67f('0x0'));var moment=require(_0xd67f('0x1'));var BPromise=require(_0xd67f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd67f('0x3'))['db'];var utils=require(_0xd67f('0x4'));var logger=require(_0xd67f('0x5'))(_0xd67f('0x6'));var config=require(_0xd67f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd67f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c36dc,_0x5551d3,_0x332f2f){return new BPromise(function(_0x3bfa47,_0xf5930){return client[_0xd67f('0x9')](_0x2c36dc,_0x332f2f)[_0xd67f('0xa')](function(_0x6bef86){logger[_0xd67f('0xb')](_0xd67f('0xc'),_0x5551d3,_0xd67f('0xd'));logger['debug'](_0xd67f('0xe'),_0x5551d3,_0xd67f('0xd'),JSON[_0xd67f('0xf')](_0x6bef86));if(_0x6bef86['error']){if(_0x6bef86[_0xd67f('0x10')][_0xd67f('0x11')]===0x1f4){logger['error'](_0xd67f('0xc'),_0x5551d3,_0x6bef86[_0xd67f('0x10')][_0xd67f('0x12')]);return _0xf5930(_0x6bef86[_0xd67f('0x10')][_0xd67f('0x12')]);}logger[_0xd67f('0x10')](_0xd67f('0xc'),_0x5551d3,_0x6bef86[_0xd67f('0x10')]['message']);return _0x3bfa47(_0x6bef86[_0xd67f('0x10')][_0xd67f('0x12')]);}else{logger[_0xd67f('0xb')](_0xd67f('0xc'),_0x5551d3,_0xd67f('0xd'));_0x3bfa47(_0x6bef86[_0xd67f('0x13')][_0xd67f('0x12')]);}})['catch'](function(_0x20eb0a){logger[_0xd67f('0x10')](_0xd67f('0xc'),_0x5551d3,_0x20eb0a);_0xf5930(_0x20eb0a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index cf7d58a..7a57621 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 _0xf033=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','post','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x484160,_0x3f928f){var _0x3e3e05=function(_0x446989){while(--_0x446989){_0x484160['push'](_0x484160['shift']());}};_0x3e3e05(++_0x3f928f);}(_0xf033,0x1c2));var _0x3f03=function(_0x4d0b5b,_0xf881c4){_0x4d0b5b=_0x4d0b5b-0x0;var _0x521856=_0xf033[_0x4d0b5b];return _0x521856;};'use strict';var multer=require(_0x3f03('0x0'));var util=require('util');var path=require(_0x3f03('0x1'));var timeout=require(_0x3f03('0x2'));var express=require(_0x3f03('0x3'));var router=express[_0x3f03('0x4')]();var fs_extra=require(_0x3f03('0x5'));var auth=require(_0x3f03('0x6'));var interaction=require(_0x3f03('0x7'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x3f03('0x8')]('/',auth[_0x3f03('0x9')](),controller[_0x3f03('0xa')]);router[_0x3f03('0x8')](_0x3f03('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x3f03('0x9')](),controller[_0x3f03('0xc')]);router[_0x3f03('0xd')]('/',auth[_0x3f03('0x9')](),controller['create']);router[_0x3f03('0xe')](_0x3f03('0xf'),auth[_0x3f03('0x9')](),controller[_0x3f03('0x10')]);router[_0x3f03('0x11')]('/:id',auth[_0x3f03('0x9')](),controller['destroy']);module[_0x3f03('0x12')]=router; \ No newline at end of file +var _0x9461=['get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x106f9e,_0x179018){var _0x5188ca=function(_0x26afde){while(--_0x26afde){_0x106f9e['push'](_0x106f9e['shift']());}};_0x5188ca(++_0x179018);}(_0x9461,0x1ee));var _0x1946=function(_0xbd7cc,_0x17e13d){_0xbd7cc=_0xbd7cc-0x0;var _0x349c15=_0x9461[_0xbd7cc];return _0x349c15;};'use strict';var multer=require(_0x1946('0x0'));var util=require(_0x1946('0x1'));var path=require(_0x1946('0x2'));var timeout=require(_0x1946('0x3'));var express=require(_0x1946('0x4'));var router=express[_0x1946('0x5')]();var fs_extra=require(_0x1946('0x6'));var auth=require(_0x1946('0x7'));var interaction=require(_0x1946('0x8'));var config=require(_0x1946('0x9'));var controller=require('./userProfileSection.controller');router[_0x1946('0xa')]('/',auth[_0x1946('0xb')](),controller[_0x1946('0xc')]);router[_0x1946('0xa')](_0x1946('0xd'),auth[_0x1946('0xb')](),controller[_0x1946('0xe')]);router[_0x1946('0xa')](_0x1946('0xf'),auth[_0x1946('0xb')](),controller[_0x1946('0x10')]);router['post']('/',auth[_0x1946('0xb')](),controller[_0x1946('0x11')]);router['put']('/:id',auth[_0x1946('0xb')](),controller[_0x1946('0x12')]);router['delete'](_0x1946('0xf'),auth['isAuthenticated'](),controller[_0x1946('0x13')]);module[_0x1946('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index f7417b8..6ea9622 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 _0xb7e7=['crudPermissions','getDataValue','sequelize','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x5e7533,_0x30d456){var _0x4f5555=function(_0x191a69){while(--_0x191a69){_0x5e7533['push'](_0x5e7533['shift']());}};_0x4f5555(++_0x30d456);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb7e7[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x7b7e('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x7b7e('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x31d0ed){this[_0x7b7e('0x4')](_0x7b7e('0x5'),_0x31d0ed?_0x31d0ed['join'](''):[]);},'get':function(){return this['getDataValue'](_0x7b7e('0x5'))?this[_0x7b7e('0x6')](_0x7b7e('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x4e81=['join','getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x4e81[_0x22dac7];return _0x3e6cfa;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'name':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x14e8('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x14e8('0x2')],'set':function(_0x224121){this[_0x14e8('0x4')](_0x14e8('0x5'),_0x224121?_0x224121[_0x14e8('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x14e8('0x7')](_0x14e8('0x5'))[_0x14e8('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 84f2b2d..bcee4ef 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 _0x0e2e=['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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','UserProfileSection','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e2e,0x17e));var _0xe0e2=function(_0x3f2f11,_0x25cbfc){_0x3f2f11=_0x3f2f11-0x0;var _0x1c3ccb=_0x0e2e[_0x3f2f11];return _0x1c3ccb;};'use strict';var emlformat=require(_0xe0e2('0x0'));var rimraf=require(_0xe0e2('0x1'));var zipdir=require(_0xe0e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe0e2('0x3'));var BPromise=require(_0xe0e2('0x4'));var Mustache=require('mustache');var util=require(_0xe0e2('0x5'));var path=require(_0xe0e2('0x6'));var sox=require(_0xe0e2('0x7'));var csv=require(_0xe0e2('0x8'));var ejs=require(_0xe0e2('0x9'));var fs=require('fs');var fs_extra=require(_0xe0e2('0xa'));var _=require(_0xe0e2('0xb'));var squel=require(_0xe0e2('0xc'));var crypto=require(_0xe0e2('0xd'));var jsforce=require(_0xe0e2('0xe'));var deskjs=require(_0xe0e2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe0e2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe0e2('0x11'));var qs=require(_0xe0e2('0x12'));var as=require(_0xe0e2('0x13'));var hardwareService=require(_0xe0e2('0x14'));var logger=require(_0xe0e2('0x15'))('api');var utils=require(_0xe0e2('0x16'));var config=require(_0xe0e2('0x17'));var licenseUtil=require(_0xe0e2('0x18'));var db=require(_0xe0e2('0x19'))['db'];function respondWithStatusCode(_0x45cb36,_0x79f4d9){_0x79f4d9=_0x79f4d9||0xcc;return function(_0x3b5fca){if(_0x3b5fca){return _0x45cb36[_0xe0e2('0x1a')](_0x79f4d9);}return _0x45cb36[_0xe0e2('0x1b')](_0x79f4d9)[_0xe0e2('0x1c')]();};}function respondWithResult(_0x8639c1,_0x52fb7b){_0x52fb7b=_0x52fb7b||0xc8;return function(_0x34ee7c){if(_0x34ee7c){return _0x8639c1[_0xe0e2('0x1b')](_0x52fb7b)[_0xe0e2('0x1d')](_0x34ee7c);}};}function respondWithFilteredResult(_0x2bb897,_0x143b20){return function(_0x2b6d67){if(_0x2b6d67){var _0x5b898c=typeof _0x143b20[_0xe0e2('0x1e')]===_0xe0e2('0x1f')&&typeof _0x143b20['limit']===_0xe0e2('0x1f');var _0x26e4f0=_0x2b6d67[_0xe0e2('0x20')];var _0x3b4797=_0x5b898c?0x0:_0x143b20[_0xe0e2('0x1e')];var _0x80304e=_0x5b898c?_0x2b6d67['count']:_0x143b20[_0xe0e2('0x1e')]+_0x143b20[_0xe0e2('0x21')];var _0x52525a;if(_0x80304e>=_0x26e4f0){_0x80304e=_0x26e4f0;_0x52525a=0xc8;}else{_0x52525a=0xce;}_0x2bb897['status'](_0x52525a);return _0x2bb897[_0xe0e2('0x22')]('Content-Range',_0x3b4797+'-'+_0x80304e+'/'+_0x26e4f0)['json'](_0x2b6d67);}return null;};}function patchUpdates(_0x537688){return function(_0x47c4af){try{jsonpatch[_0xe0e2('0x23')](_0x47c4af,_0x537688,!![]);}catch(_0x5bdc0a){return BPromise[_0xe0e2('0x24')](_0x5bdc0a);}return _0x47c4af['save']();};}function saveUpdates(_0x55effc,_0x45d19a){return function(_0x59a59e){if(_0x59a59e){return _0x59a59e[_0xe0e2('0x25')](_0x55effc)['then'](function(_0x299fa3){return _0x299fa3;});}return null;};}function removeEntity(_0x4b46dd,_0x346db4){return function(_0x56f143){if(_0x56f143){return _0x56f143['destroy']()[_0xe0e2('0x26')](function(){_0x4b46dd[_0xe0e2('0x1b')](0xcc)[_0xe0e2('0x1c')]();});}};}function handleEntityNotFound(_0x5b7da2,_0x4c8c92){return function(_0x5ce095){if(!_0x5ce095){_0x5b7da2[_0xe0e2('0x1a')](0x194);}return _0x5ce095;};}function handleError(_0x152b8f,_0x59e6ce){_0x59e6ce=_0x59e6ce||0x1f4;return function(_0x4edef1){logger[_0xe0e2('0x27')](_0x4edef1[_0xe0e2('0x28')]);if(_0x4edef1['name']){delete _0x4edef1[_0xe0e2('0x29')];}_0x152b8f[_0xe0e2('0x1b')](_0x59e6ce)['send'](_0x4edef1);};}exports[_0xe0e2('0x2a')]=function(_0x41cf47,_0x48b7ca){var _0x4cb625={},_0x3592be={},_0x268ab6={'count':0x0,'rows':[]};var _0x21c3c4=_[_0xe0e2('0x2b')](db['UserProfileSection'][_0xe0e2('0x2c')],function(_0x4151c4){return{'name':_0x4151c4[_0xe0e2('0x2d')],'type':_0x4151c4[_0xe0e2('0x2e')][_0xe0e2('0x2f')]};});_0x3592be[_0xe0e2('0x30')]=_[_0xe0e2('0x2b')](_0x21c3c4,_0xe0e2('0x29'));_0x3592be['query']=_[_0xe0e2('0x31')](_0x41cf47[_0xe0e2('0x32')]);_0x3592be['filters']=_[_0xe0e2('0x33')](_0x3592be[_0xe0e2('0x30')],_0x3592be[_0xe0e2('0x32')]);_0x4cb625[_0xe0e2('0x34')]=_[_0xe0e2('0x33')](_0x3592be[_0xe0e2('0x30')],qs['fields'](_0x41cf47['query'][_0xe0e2('0x35')]));_0x4cb625[_0xe0e2('0x34')]=_0x4cb625['attributes'][_0xe0e2('0x36')]?_0x4cb625['attributes']:_0x3592be[_0xe0e2('0x30')];if(!_0x41cf47[_0xe0e2('0x32')][_0xe0e2('0x37')]('nolimit')){_0x4cb625['limit']=qs['limit'](_0x41cf47[_0xe0e2('0x32')][_0xe0e2('0x21')]);_0x4cb625[_0xe0e2('0x1e')]=qs[_0xe0e2('0x1e')](_0x41cf47[_0xe0e2('0x32')][_0xe0e2('0x1e')]);}_0x4cb625[_0xe0e2('0x38')]=qs[_0xe0e2('0x39')](_0x41cf47[_0xe0e2('0x32')][_0xe0e2('0x39')]);_0x4cb625[_0xe0e2('0x3a')]=qs[_0xe0e2('0x3b')](_[_0xe0e2('0x3c')](_0x41cf47[_0xe0e2('0x32')],_0x3592be['filters']),_0x21c3c4);if(_0x41cf47[_0xe0e2('0x32')][_0xe0e2('0x3d')]){_0x4cb625['where']=_[_0xe0e2('0x3e')](_0x4cb625[_0xe0e2('0x3a')],{'$or':_['map'](_0x21c3c4,function(_0x4250af){if(_0x4250af[_0xe0e2('0x2e')]!==_0xe0e2('0x3f')){var _0x59b69c={};_0x59b69c[_0x4250af[_0xe0e2('0x29')]]={'$like':'%'+_0x41cf47['query'][_0xe0e2('0x3d')]+'%'};return _0x59b69c;}})});}_0x4cb625=_[_0xe0e2('0x3e')]({},_0x4cb625,_0x41cf47[_0xe0e2('0x40')]);var _0x3d593e={'where':_0x4cb625[_0xe0e2('0x3a')]};return db[_0xe0e2('0x41')]['count'](_0x3d593e)[_0xe0e2('0x26')](function(_0x129861){_0x268ab6['count']=_0x129861;if(_0x41cf47['query']['includeAll']){_0x4cb625[_0xe0e2('0x42')]=[{'all':!![]}];}return db[_0xe0e2('0x41')][_0xe0e2('0x43')](_0x4cb625);})[_0xe0e2('0x26')](function(_0x467d37){_0x268ab6[_0xe0e2('0x44')]=_0x467d37;return _0x268ab6;})[_0xe0e2('0x26')](respondWithFilteredResult(_0x48b7ca,_0x4cb625))[_0xe0e2('0x45')](handleError(_0x48b7ca,null));};exports[_0xe0e2('0x46')]=function(_0x304766,_0x34e894){var _0x210add={'raw':![],'where':{'id':_0x304766[_0xe0e2('0x47')]['id']}},_0x3cf1c9={};_0x3cf1c9['model']=_[_0xe0e2('0x31')](db[_0xe0e2('0x41')][_0xe0e2('0x2c')]);_0x3cf1c9[_0xe0e2('0x32')]=_[_0xe0e2('0x31')](_0x304766['query']);_0x3cf1c9[_0xe0e2('0x3b')]=_['intersection'](_0x3cf1c9[_0xe0e2('0x30')],_0x3cf1c9[_0xe0e2('0x32')]);_0x210add['attributes']=_[_0xe0e2('0x33')](_0x3cf1c9[_0xe0e2('0x30')],qs[_0xe0e2('0x35')](_0x304766[_0xe0e2('0x32')][_0xe0e2('0x35')]));_0x210add[_0xe0e2('0x34')]=_0x210add[_0xe0e2('0x34')][_0xe0e2('0x36')]?_0x210add[_0xe0e2('0x34')]:_0x3cf1c9['model'];if(_0x304766[_0xe0e2('0x32')][_0xe0e2('0x48')]){_0x210add[_0xe0e2('0x42')]=[{'all':!![]}];}_0x210add=_[_0xe0e2('0x3e')]({},_0x210add,_0x304766[_0xe0e2('0x40')]);return db[_0xe0e2('0x41')]['find'](_0x210add)[_0xe0e2('0x26')](handleEntityNotFound(_0x34e894,null))[_0xe0e2('0x26')](respondWithResult(_0x34e894,null))[_0xe0e2('0x45')](handleError(_0x34e894,null));};exports[_0xe0e2('0x49')]=function(_0xb83211,_0x5b10e0){return db[_0xe0e2('0x41')][_0xe0e2('0x49')](_0xb83211[_0xe0e2('0x4a')],{})['then'](respondWithResult(_0x5b10e0,0xc9))['catch'](handleError(_0x5b10e0,null));};exports['update']=function(_0x5dfab3,_0x4a2202){if(_0x5dfab3['body']['id']){delete _0x5dfab3[_0xe0e2('0x4a')]['id'];}return db['UserProfileSection'][_0xe0e2('0x4b')]({'where':{'id':_0x5dfab3['params']['id']}})[_0xe0e2('0x26')](handleEntityNotFound(_0x4a2202,null))['then'](saveUpdates(_0x5dfab3[_0xe0e2('0x4a')],null))[_0xe0e2('0x26')](respondWithResult(_0x4a2202,null))['catch'](handleError(_0x4a2202,null));};exports[_0xe0e2('0x4c')]=function(_0x2b9f98,_0x40bf86){return db[_0xe0e2('0x41')]['find']({'where':{'id':_0x2b9f98[_0xe0e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x40bf86,null))[_0xe0e2('0x26')](removeEntity(_0x40bf86,null))[_0xe0e2('0x45')](handleError(_0x40bf86,null));};exports[_0xe0e2('0x4d')]=function(_0x1bb829,_0x596c84){return db[_0xe0e2('0x41')][_0xe0e2('0x4d')]()[_0xe0e2('0x26')](respondWithResult(_0x596c84,null))[_0xe0e2('0x45')](handleError(_0x596c84,null));}; \ No newline at end of file +var _0x28b0=['create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','json','apply','reject','save','update','then','end','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','model','keys','find'];(function(_0x3e6ef6,_0x41c865){var _0x4fb82b=function(_0x18e849){while(--_0x18e849){_0x3e6ef6['push'](_0x3e6ef6['shift']());}};_0x4fb82b(++_0x41c865);}(_0x28b0,0xec));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x028b('0x0'));var rimraf=require(_0x028b('0x1'));var zipdir=require(_0x028b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x028b('0x3'));var moment=require(_0x028b('0x4'));var BPromise=require(_0x028b('0x5'));var Mustache=require(_0x028b('0x6'));var util=require(_0x028b('0x7'));var path=require(_0x028b('0x8'));var sox=require(_0x028b('0x9'));var csv=require(_0x028b('0xa'));var ejs=require(_0x028b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x028b('0xc'));var squel=require(_0x028b('0xd'));var crypto=require(_0x028b('0xe'));var jsforce=require(_0x028b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x028b('0xa'));var querystring=require(_0x028b('0x10'));var Papa=require('papaparse');var Redis=require(_0x028b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x028b('0x12'));var as=require(_0x028b('0x13'));var hardwareService=require(_0x028b('0x14'));var logger=require(_0x028b('0x15'))('api');var utils=require(_0x028b('0x16'));var config=require(_0x028b('0x17'));var licenseUtil=require(_0x028b('0x18'));var db=require(_0x028b('0x19'))['db'];function respondWithStatusCode(_0x49bcb1,_0x585293){_0x585293=_0x585293||0xcc;return function(_0x138b01){if(_0x138b01){return _0x49bcb1[_0x028b('0x1a')](_0x585293);}return _0x49bcb1[_0x028b('0x1b')](_0x585293)['end']();};}function respondWithResult(_0x3093bc,_0x473dc9){_0x473dc9=_0x473dc9||0xc8;return function(_0x69ed04){if(_0x69ed04){return _0x3093bc[_0x028b('0x1b')](_0x473dc9)['json'](_0x69ed04);}};}function respondWithFilteredResult(_0x17a320,_0x10bed2){return function(_0x3d0e12){if(_0x3d0e12){var _0x31dfa1=typeof _0x10bed2['offset']===_0x028b('0x1c')&&typeof _0x10bed2['limit']===_0x028b('0x1c');var _0x300232=_0x3d0e12[_0x028b('0x1d')];var _0x47ad27=_0x31dfa1?0x0:_0x10bed2['offset'];var _0x5d7dea=_0x31dfa1?_0x3d0e12['count']:_0x10bed2[_0x028b('0x1e')]+_0x10bed2[_0x028b('0x1f')];var _0x316f08;if(_0x5d7dea>=_0x300232){_0x5d7dea=_0x300232;_0x316f08=0xc8;}else{_0x316f08=0xce;}_0x17a320[_0x028b('0x1b')](_0x316f08);return _0x17a320[_0x028b('0x20')]('Content-Range',_0x47ad27+'-'+_0x5d7dea+'/'+_0x300232)[_0x028b('0x21')](_0x3d0e12);}return null;};}function patchUpdates(_0x37897d){return function(_0x4fce89){try{jsonpatch[_0x028b('0x22')](_0x4fce89,_0x37897d,!![]);}catch(_0xa9a560){return BPromise[_0x028b('0x23')](_0xa9a560);}return _0x4fce89[_0x028b('0x24')]();};}function saveUpdates(_0x4a041a,_0x1cf4ae){return function(_0x411839){if(_0x411839){return _0x411839[_0x028b('0x25')](_0x4a041a)[_0x028b('0x26')](function(_0x3b0ed7){return _0x3b0ed7;});}return null;};}function removeEntity(_0x582253,_0x18c200){return function(_0x5bee31){if(_0x5bee31){return _0x5bee31['destroy']()[_0x028b('0x26')](function(){_0x582253[_0x028b('0x1b')](0xcc)[_0x028b('0x27')]();});}};}function handleEntityNotFound(_0x25a941,_0x534e27){return function(_0x90d88){if(!_0x90d88){_0x25a941['sendStatus'](0x194);}return _0x90d88;};}function handleError(_0x2f446a,_0x57e448){_0x57e448=_0x57e448||0x1f4;return function(_0x1eb0a5){logger[_0x028b('0x28')](_0x1eb0a5['stack']);if(_0x1eb0a5[_0x028b('0x29')]){delete _0x1eb0a5[_0x028b('0x29')];}_0x2f446a['status'](_0x57e448)[_0x028b('0x2a')](_0x1eb0a5);};}exports[_0x028b('0x2b')]=function(_0x24b0b6,_0x14bcc1){var _0x39f2fc={},_0x20dd34={},_0x1ba142={'count':0x0,'rows':[]};var _0xf2a059=_[_0x028b('0x2c')](db[_0x028b('0x2d')][_0x028b('0x2e')],function(_0x51b52e){return{'name':_0x51b52e[_0x028b('0x2f')],'type':_0x51b52e[_0x028b('0x30')][_0x028b('0x31')]};});_0x20dd34['model']=_['map'](_0xf2a059,_0x028b('0x29'));_0x20dd34[_0x028b('0x32')]=_['keys'](_0x24b0b6[_0x028b('0x32')]);_0x20dd34[_0x028b('0x33')]=_[_0x028b('0x34')](_0x20dd34['model'],_0x20dd34[_0x028b('0x32')]);_0x39f2fc[_0x028b('0x35')]=_[_0x028b('0x34')](_0x20dd34['model'],qs[_0x028b('0x36')](_0x24b0b6[_0x028b('0x32')][_0x028b('0x36')]));_0x39f2fc[_0x028b('0x35')]=_0x39f2fc[_0x028b('0x35')][_0x028b('0x37')]?_0x39f2fc[_0x028b('0x35')]:_0x20dd34['model'];if(!_0x24b0b6[_0x028b('0x32')][_0x028b('0x38')](_0x028b('0x39'))){_0x39f2fc[_0x028b('0x1f')]=qs[_0x028b('0x1f')](_0x24b0b6['query'][_0x028b('0x1f')]);_0x39f2fc[_0x028b('0x1e')]=qs['offset'](_0x24b0b6['query'][_0x028b('0x1e')]);}_0x39f2fc[_0x028b('0x3a')]=qs[_0x028b('0x3b')](_0x24b0b6[_0x028b('0x32')][_0x028b('0x3b')]);_0x39f2fc[_0x028b('0x3c')]=qs[_0x028b('0x33')](_['pick'](_0x24b0b6[_0x028b('0x32')],_0x20dd34[_0x028b('0x33')]),_0xf2a059);if(_0x24b0b6['query']['filter']){_0x39f2fc[_0x028b('0x3c')]=_[_0x028b('0x3d')](_0x39f2fc[_0x028b('0x3c')],{'$or':_['map'](_0xf2a059,function(_0x500b8c){if(_0x500b8c[_0x028b('0x30')]!==_0x028b('0x3e')){var _0x191086={};_0x191086[_0x500b8c['name']]={'$like':'%'+_0x24b0b6['query'][_0x028b('0x3f')]+'%'};return _0x191086;}})});}_0x39f2fc=_[_0x028b('0x3d')]({},_0x39f2fc,_0x24b0b6[_0x028b('0x40')]);var _0x5c5131={'where':_0x39f2fc[_0x028b('0x3c')]};return db['UserProfileSection'][_0x028b('0x1d')](_0x5c5131)[_0x028b('0x26')](function(_0x224752){_0x1ba142['count']=_0x224752;if(_0x24b0b6['query'][_0x028b('0x41')]){_0x39f2fc[_0x028b('0x42')]=[{'all':!![]}];}return db[_0x028b('0x2d')][_0x028b('0x43')](_0x39f2fc);})[_0x028b('0x26')](function(_0x2b3f63){_0x1ba142['rows']=_0x2b3f63;return _0x1ba142;})[_0x028b('0x26')](respondWithFilteredResult(_0x14bcc1,_0x39f2fc))['catch'](handleError(_0x14bcc1,null));};exports['show']=function(_0x2cc605,_0x5b8090){var _0x1b9db1={'raw':![],'where':{'id':_0x2cc605[_0x028b('0x44')]['id']}},_0x3e30c3={};_0x3e30c3[_0x028b('0x45')]=_[_0x028b('0x46')](db[_0x028b('0x2d')]['rawAttributes']);_0x3e30c3['query']=_[_0x028b('0x46')](_0x2cc605[_0x028b('0x32')]);_0x3e30c3[_0x028b('0x33')]=_[_0x028b('0x34')](_0x3e30c3[_0x028b('0x45')],_0x3e30c3[_0x028b('0x32')]);_0x1b9db1[_0x028b('0x35')]=_['intersection'](_0x3e30c3[_0x028b('0x45')],qs['fields'](_0x2cc605['query'][_0x028b('0x36')]));_0x1b9db1[_0x028b('0x35')]=_0x1b9db1[_0x028b('0x35')][_0x028b('0x37')]?_0x1b9db1[_0x028b('0x35')]:_0x3e30c3[_0x028b('0x45')];if(_0x2cc605[_0x028b('0x32')]['includeAll']){_0x1b9db1[_0x028b('0x42')]=[{'all':!![]}];}_0x1b9db1=_[_0x028b('0x3d')]({},_0x1b9db1,_0x2cc605[_0x028b('0x40')]);return db[_0x028b('0x2d')][_0x028b('0x47')](_0x1b9db1)[_0x028b('0x26')](handleEntityNotFound(_0x5b8090,null))[_0x028b('0x26')](respondWithResult(_0x5b8090,null))['catch'](handleError(_0x5b8090,null));};exports[_0x028b('0x48')]=function(_0x4daaa6,_0x22b14d){return db[_0x028b('0x2d')][_0x028b('0x48')](_0x4daaa6[_0x028b('0x49')],{})[_0x028b('0x26')](respondWithResult(_0x22b14d,0xc9))[_0x028b('0x4a')](handleError(_0x22b14d,null));};exports['update']=function(_0x14c2e9,_0x165b7f){if(_0x14c2e9[_0x028b('0x49')]['id']){delete _0x14c2e9['body']['id'];}return db[_0x028b('0x2d')]['find']({'where':{'id':_0x14c2e9[_0x028b('0x44')]['id']}})['then'](handleEntityNotFound(_0x165b7f,null))[_0x028b('0x26')](saveUpdates(_0x14c2e9['body'],null))[_0x028b('0x26')](respondWithResult(_0x165b7f,null))['catch'](handleError(_0x165b7f,null));};exports[_0x028b('0x4b')]=function(_0xb652f3,_0x27409b){return db[_0x028b('0x2d')][_0x028b('0x47')]({'where':{'id':_0xb652f3[_0x028b('0x44')]['id']}})[_0x028b('0x26')](handleEntityNotFound(_0x27409b,null))['then'](removeEntity(_0x27409b,null))[_0x028b('0x4a')](handleError(_0x27409b,null));};exports[_0x028b('0x4c')]=function(_0x2227eb,_0x12858e){return db[_0x028b('0x2d')][_0x028b('0x4c')]()[_0x028b('0x26')](respondWithResult(_0x12858e,null))['catch'](handleError(_0x12858e,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index b0606c5..da1c49c 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 _0x0e67=['define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0e67,0x8d));var _0x70e6=function(_0x355689,_0x4c42f2){_0x355689=_0x355689-0x0;var _0x277b46=_0x0e67[_0x355689];return _0x277b46;};'use strict';var _=require(_0x70e6('0x0'));var util=require(_0x70e6('0x1'));var logger=require(_0x70e6('0x2'))(_0x70e6('0x3'));var moment=require('moment');var BPromise=require(_0x70e6('0x4'));var rp=require(_0x70e6('0x5'));var fs=require('fs');var path=require(_0x70e6('0x6'));var rimraf=require('rimraf');var config=require(_0x70e6('0x7'));var attributes=require(_0x70e6('0x8'));module['exports']=function(_0x52f69f,_0x2588a6){return _0x52f69f[_0x70e6('0x9')](_0x70e6('0xa'),attributes,{'tableName':_0x70e6('0xb'),'paranoid':![],'indexes':[{'name':_0x70e6('0xc'),'fields':[_0x70e6('0xd'),_0x70e6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a1f=['sectionId','userProfileId','lodash','util','moment','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex'];(function(_0xd55aa8,_0x4bbab7){var _0x57d2d7=function(_0x27c24c){while(--_0x27c24c){_0xd55aa8['push'](_0xd55aa8['shift']());}};_0x57d2d7(++_0x4bbab7);}(_0x3a1f,0x160));var _0xf3a1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3a1f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xf3a1('0x0'));var util=require(_0xf3a1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf3a1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3a1('0x3'));var rimraf=require(_0xf3a1('0x4'));var config=require(_0xf3a1('0x5'));var attributes=require(_0xf3a1('0x6'));module[_0xf3a1('0x7')]=function(_0x3f655c,_0x41f5de){return _0x3f655c[_0xf3a1('0x8')](_0xf3a1('0x9'),attributes,{'tableName':_0xf3a1('0xa'),'paranoid':![],'indexes':[{'name':_0xf3a1('0xb'),'fields':[_0xf3a1('0xc'),_0xf3a1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 6f29736..3db2d38 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 _0x33b1=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x44769c,_0x4b2cc6){var _0x216eb5=function(_0x3289e7){while(--_0x3289e7){_0x44769c['push'](_0x44769c['shift']());}};_0x216eb5(++_0x4b2cc6);}(_0x33b1,0x186));var _0x133b=function(_0x4f85c2,_0x32e164){_0x4f85c2=_0x4f85c2-0x0;var _0x47bf04=_0x33b1[_0x4f85c2];return _0x47bf04;};'use strict';var _=require('lodash');var util=require(_0x133b('0x0'));var moment=require(_0x133b('0x1'));var BPromise=require(_0x133b('0x2'));var rs=require(_0x133b('0x3'));var fs=require('fs');var Redis=require(_0x133b('0x4'));var db=require(_0x133b('0x5'))['db'];var utils=require(_0x133b('0x6'));var logger=require(_0x133b('0x7'))(_0x133b('0x8'));var config=require('../../config/environment');var jayson=require(_0x133b('0x9'));var client=jayson[_0x133b('0xa')][_0x133b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d30ad,_0x20fa37,_0x4b11a2){return new BPromise(function(_0x6d9c63,_0x1fc9dc){return client['request'](_0x2d30ad,_0x4b11a2)[_0x133b('0xc')](function(_0x19cd55){logger[_0x133b('0xd')](_0x133b('0xe'),_0x20fa37,_0x133b('0xf'));logger['debug'](_0x133b('0x10'),_0x20fa37,_0x133b('0xf'),JSON[_0x133b('0x11')](_0x19cd55));if(_0x19cd55[_0x133b('0x12')]){if(_0x19cd55[_0x133b('0x12')][_0x133b('0x13')]===0x1f4){logger[_0x133b('0x12')](_0x133b('0xe'),_0x20fa37,_0x19cd55[_0x133b('0x12')][_0x133b('0x14')]);return _0x1fc9dc(_0x19cd55[_0x133b('0x12')][_0x133b('0x14')]);}logger[_0x133b('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x20fa37,_0x19cd55[_0x133b('0x12')][_0x133b('0x14')]);return _0x6d9c63(_0x19cd55[_0x133b('0x12')]['message']);}else{logger[_0x133b('0xd')](_0x133b('0xe'),_0x20fa37,_0x133b('0xf'));_0x6d9c63(_0x19cd55[_0x133b('0x15')]['message']);}})[_0x133b('0x16')](function(_0x18e23a){logger['error'](_0x133b('0xe'),_0x20fa37,_0x18e23a);_0x1fc9dc(_0x18e23a);});});} \ No newline at end of file +var _0x7f0d=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x496831,_0x3cd648){var _0xdb5f6=function(_0x57789f){while(--_0x57789f){_0x496831['push'](_0x496831['shift']());}};_0xdb5f6(++_0x3cd648);}(_0x7f0d,0x113));var _0xd7f0=function(_0xc4754c,_0x4c2a1b){_0xc4754c=_0xc4754c-0x0;var _0x282cf2=_0x7f0d[_0xc4754c];return _0x282cf2;};'use strict';var _=require(_0xd7f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd7f0('0x1'));var rs=require(_0xd7f0('0x2'));var fs=require('fs');var Redis=require(_0xd7f0('0x3'));var db=require(_0xd7f0('0x4'))['db'];var utils=require(_0xd7f0('0x5'));var logger=require('../../config/logger')(_0xd7f0('0x6'));var config=require(_0xd7f0('0x7'));var jayson=require(_0xd7f0('0x8'));var client=jayson['client'][_0xd7f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1de64c,_0x1e232a,_0x4475bc){return new BPromise(function(_0x16b254,_0x31e548){return client['request'](_0x1de64c,_0x4475bc)[_0xd7f0('0xa')](function(_0x933e85){logger[_0xd7f0('0xb')](_0xd7f0('0xc'),_0x1e232a,_0xd7f0('0xd'));logger[_0xd7f0('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1e232a,_0xd7f0('0xd'),JSON[_0xd7f0('0xf')](_0x933e85));if(_0x933e85[_0xd7f0('0x10')]){if(_0x933e85[_0xd7f0('0x10')][_0xd7f0('0x11')]===0x1f4){logger[_0xd7f0('0x10')](_0xd7f0('0xc'),_0x1e232a,_0x933e85[_0xd7f0('0x10')][_0xd7f0('0x12')]);return _0x31e548(_0x933e85[_0xd7f0('0x10')][_0xd7f0('0x12')]);}logger[_0xd7f0('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x1e232a,_0x933e85[_0xd7f0('0x10')]['message']);return _0x16b254(_0x933e85['error'][_0xd7f0('0x12')]);}else{logger['info'](_0xd7f0('0xc'),_0x1e232a,'request\x20sent');_0x16b254(_0x933e85[_0xd7f0('0x13')][_0xd7f0('0x12')]);}})[_0xd7f0('0x14')](function(_0x215323){logger[_0xd7f0('0x10')](_0xd7f0('0xc'),_0x1e232a,_0x215323);_0x31e548(_0x215323);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 8262a40..1c9968a 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x13f0f2,_0x2b3566){var _0xe733ed=function(_0x2c64e4){while(--_0x2c64e4){_0x13f0f2['push'](_0x13f0f2['shift']());}};_0xe733ed(++_0x2b3566);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4f6495,_0x1fe01a){var _0x528aec=function(_0x4c9431){while(--_0x4c9431){_0x4f6495['push'](_0x4f6495['shift']());}};_0x528aec(++_0x1fe01a);}(_0x70e0,0x17b));var _0x070e=function(_0x33bdc0,_0x2efc5c){_0x33bdc0=_0x33bdc0-0x0;var _0x30908f=_0x70e0[_0x33bdc0];return _0x30908f;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 65017d7..11102f1 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 _0xf625=['sequelize','exports','INTEGER'];(function(_0x57ef92,_0x275943){var _0x36696a=function(_0x53acf9){while(--_0x53acf9){_0x57ef92['push'](_0x57ef92['shift']());}};_0x36696a(++_0x275943);}(_0xf625,0x18c));var _0x5f62=function(_0x2e2c1b,_0x94deaf){_0x2e2c1b=_0x2e2c1b-0x0;var _0x43a4f2=_0xf625[_0x2e2c1b];return _0x43a4f2;};'use strict';var Sequelize=require(_0x5f62('0x0'));module[_0x5f62('0x1')]={'penalty':{'type':Sequelize[_0x5f62('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe888=['INTEGER','sequelize'];(function(_0x4f52bd,_0x29d170){var _0x42bc01=function(_0x3c6f36){while(--_0x3c6f36){_0x4f52bd['push'](_0x4f52bd['shift']());}};_0x42bc01(++_0x29d170);}(_0xe888,0x97));var _0x8e88=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0xe888[_0x16bb4b];return _0x8aeb84;};'use strict';var Sequelize=require(_0x8e88('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x8e88('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 d093e80..f76fbca 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 _0x1893=['rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x150338,_0x27ee56){var _0x154c81=function(_0x487188){while(--_0x487188){_0x150338['push'](_0x150338['shift']());}};_0x154c81(++_0x27ee56);}(_0x1893,0xa2));var _0x3189=function(_0x26707f,_0x2bcfd5){_0x26707f=_0x26707f-0x0;var _0x3a19df=_0x1893[_0x26707f];return _0x3a19df;};'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 _0xbd10=['UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xbd10,0x85));var _0x0bd1=function(_0x3207bf,_0x5b5543){_0x3207bf=_0x3207bf-0x0;var _0x531b49=_0xbd10[_0x3207bf];return _0x531b49;};'use strict';var _=require(_0x0bd1('0x0'));var util=require(_0x0bd1('0x1'));var logger=require(_0x0bd1('0x2'))('api');var moment=require(_0x0bd1('0x3'));var BPromise=require(_0x0bd1('0x4'));var rp=require(_0x0bd1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0bd1('0x6'));var config=require(_0x0bd1('0x7'));var attributes=require(_0x0bd1('0x8'));module[_0x0bd1('0x9')]=function(_0x453508,_0x46c432){return _0x453508['define'](_0x0bd1('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 0310a21..8202e6b 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 _0x514e=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','info','request\x20sent','result','lodash','util'];(function(_0x2142fa,_0x1e9945){var _0x350983=function(_0x125657){while(--_0x125657){_0x2142fa['push'](_0x2142fa['shift']());}};_0x350983(++_0x1e9945);}(_0x514e,0x124));var _0xe514=function(_0x592efc,_0x275170){_0x592efc=_0x592efc-0x0;var _0x416bb7=_0x514e[_0x592efc];return _0x416bb7;};'use strict';var _=require(_0xe514('0x0'));var util=require(_0xe514('0x1'));var moment=require(_0xe514('0x2'));var BPromise=require(_0xe514('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe514('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe514('0x5'));var logger=require(_0xe514('0x6'))(_0xe514('0x7'));var config=require(_0xe514('0x8'));var jayson=require(_0xe514('0x9'));var client=jayson['client'][_0xe514('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dce07,_0x29b8e6,_0x47dde4){return new BPromise(function(_0x44514d,_0xd4cd7b){return client['request'](_0x4dce07,_0x47dde4)[_0xe514('0xb')](function(_0x59c2b8){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x29b8e6,'request\x20sent');logger[_0xe514('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x29b8e6,'request\x20sent',JSON[_0xe514('0xd')](_0x59c2b8));if(_0x59c2b8[_0xe514('0xe')]){if(_0x59c2b8['error'][_0xe514('0xf')]===0x1f4){logger['error'](_0xe514('0x10'),_0x29b8e6,_0x59c2b8[_0xe514('0xe')][_0xe514('0x11')]);return _0xd4cd7b(_0x59c2b8[_0xe514('0xe')][_0xe514('0x11')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x29b8e6,_0x59c2b8[_0xe514('0xe')][_0xe514('0x11')]);return _0x44514d(_0x59c2b8[_0xe514('0xe')][_0xe514('0x11')]);}else{logger[_0xe514('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x29b8e6,_0xe514('0x13'));_0x44514d(_0x59c2b8[_0xe514('0x14')][_0xe514('0x11')]);}})['catch'](function(_0x5b1244){logger[_0xe514('0xe')](_0xe514('0x10'),_0x29b8e6,_0x5b1244);_0xd4cd7b(_0x5b1244);});});} \ No newline at end of file +var _0x238d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','ioredis'];(function(_0x995c5b,_0x5485b3){var _0x2ade0a=function(_0x59bbbf){while(--_0x59bbbf){_0x995c5b['push'](_0x995c5b['shift']());}};_0x2ade0a(++_0x5485b3);}(_0x238d,0x1b5));var _0xd238=function(_0x1c52f8,_0x5cd4b4){_0x1c52f8=_0x1c52f8-0x0;var _0x566991=_0x238d[_0x1c52f8];return _0x566991;};'use strict';var _=require(_0xd238('0x0'));var util=require(_0xd238('0x1'));var moment=require(_0xd238('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd238('0x3'));var db=require(_0xd238('0x4'))['db'];var utils=require(_0xd238('0x5'));var logger=require(_0xd238('0x6'))(_0xd238('0x7'));var config=require(_0xd238('0x8'));var jayson=require(_0xd238('0x9'));var client=jayson[_0xd238('0xa')][_0xd238('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50ff7c,_0x392c7c,_0x2c6f24){return new BPromise(function(_0x2b74dc,_0xa25828){return client[_0xd238('0xc')](_0x50ff7c,_0x2c6f24)['then'](function(_0x31991f){logger[_0xd238('0xd')](_0xd238('0xe'),_0x392c7c,_0xd238('0xf'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x392c7c,_0xd238('0xf'),JSON[_0xd238('0x10')](_0x31991f));if(_0x31991f[_0xd238('0x11')]){if(_0x31991f[_0xd238('0x11')]['code']===0x1f4){logger[_0xd238('0x11')](_0xd238('0xe'),_0x392c7c,_0x31991f[_0xd238('0x11')][_0xd238('0x12')]);return _0xa25828(_0x31991f[_0xd238('0x11')][_0xd238('0x12')]);}logger[_0xd238('0x11')](_0xd238('0xe'),_0x392c7c,_0x31991f[_0xd238('0x11')][_0xd238('0x12')]);return _0x2b74dc(_0x31991f['error'][_0xd238('0x12')]);}else{logger[_0xd238('0xd')](_0xd238('0xe'),_0x392c7c,_0xd238('0xf'));_0x2b74dc(_0x31991f[_0xd238('0x13')][_0xd238('0x12')]);}})[_0xd238('0x14')](function(_0x160845){logger[_0xd238('0x11')](_0xd238('0xe'),_0x392c7c,_0x160845);_0xa25828(_0x160845);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 41c0932..4455d97 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 _0x5dc6=['exports','INTEGER','sequelize'];(function(_0xef162d,_0x5b3e04){var _0x448bac=function(_0x3d0626){while(--_0x3d0626){_0xef162d['push'](_0xef162d['shift']());}};_0x448bac(++_0x5b3e04);}(_0x5dc6,0xbf));var _0x65dc=function(_0x34b7ae,_0x1ced2a){_0x34b7ae=_0x34b7ae-0x0;var _0x1c1b8b=_0x5dc6[_0x34b7ae];return _0x1c1b8b;};'use strict';var Sequelize=require(_0x65dc('0x0'));module[_0x65dc('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x65dc('0x2')]}}; \ No newline at end of file +var _0x0369=['sequelize','exports','INTEGER'];(function(_0x5aac8e,_0x1c60ef){var _0x89915f=function(_0x134df4){while(--_0x134df4){_0x5aac8e['push'](_0x5aac8e['shift']());}};_0x89915f(++_0x1c60ef);}(_0x0369,0x1b0));var _0x9036=function(_0x528a23,_0x6f4588){_0x528a23=_0x528a23-0x0;var _0x3ab28e=_0x0369[_0x528a23];return _0x3ab28e;};'use strict';var Sequelize=require(_0x9036('0x0'));module[_0x9036('0x1')]={'UserId':{'type':Sequelize[_0x9036('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x9036('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 0e9a5ce..c3a3ac5 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(_0x1c836a,_0x3aa463){var _0x390f1b=function(_0x50721d){while(--_0x50721d){_0x1c836a['push'](_0x1c836a['shift']());}};_0x390f1b(++_0x3aa463);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x33cfb0,_0x510afd){var _0x2b30e6=function(_0x24ffb4){while(--_0x24ffb4){_0x33cfb0['push'](_0x33cfb0['shift']());}};_0x2b30e6(++_0x510afd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 7de1c8b..66cc9dd 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xb71c35,_0x129343){var _0x39224f=function(_0x26eee8){while(--_0x26eee8){_0xb71c35['push'](_0xb71c35['shift']());}};_0x39224f(++_0x129343);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a28bd5e..481e877 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 _0xad05=['exports','INTEGER','sequelize'];(function(_0x3801e4,_0x3b410c){var _0x1d419c=function(_0x1a4b02){while(--_0x1a4b02){_0x3801e4['push'](_0x3801e4['shift']());}};_0x1d419c(++_0x3b410c);}(_0xad05,0x1c7));var _0x5ad0=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0xad05[_0x368e09];return _0x14b7df;};'use strict';var Sequelize=require(_0x5ad0('0x0'));module[_0x5ad0('0x1')]={'penalty':{'type':Sequelize[_0x5ad0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf206=['exports','INTEGER'];(function(_0x3b3551,_0x49dbd7){var _0x10bc70=function(_0x117abb){while(--_0x117abb){_0x3b3551['push'](_0x3b3551['shift']());}};_0x10bc70(++_0x49dbd7);}(_0xf206,0x1f0));var _0x6f20=function(_0x6beb71,_0x17c305){_0x6beb71=_0x6beb71-0x0;var _0x3b6808=_0xf206[_0x6beb71];return _0x3b6808;};'use strict';var Sequelize=require('sequelize');module[_0x6f20('0x0')]={'penalty':{'type':Sequelize[_0x6f20('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index ddecf44..1674594 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 _0x7051=['user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','UserVoiceQueue'];(function(_0x2e6700,_0x548c76){var _0xb76cd7=function(_0x4e4102){while(--_0x4e4102){_0x2e6700['push'](_0x2e6700['shift']());}};_0xb76cd7(++_0x548c76);}(_0x7051,0x169));var _0x1705=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x7051[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x1705('0x0'));var util=require(_0x1705('0x1'));var logger=require(_0x1705('0x2'))(_0x1705('0x3'));var moment=require(_0x1705('0x4'));var BPromise=require('bluebird');var rp=require(_0x1705('0x5'));var fs=require('fs');var path=require(_0x1705('0x6'));var rimraf=require('rimraf');var config=require(_0x1705('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x1705('0x8')]=function(_0x29e73a,_0xd48d89){return _0x29e73a[_0x1705('0x9')](_0x1705('0xa'),attributes,{'tableName':_0x1705('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21c2=['moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x540705,_0x5c8fb1){var _0x3cb184=function(_0x2b8dc9){while(--_0x2b8dc9){_0x540705['push'](_0x540705['shift']());}};_0x3cb184(++_0x5c8fb1);}(_0x21c2,0x188));var _0x221c=function(_0x537e7c,_0x4da0b7){_0x537e7c=_0x537e7c-0x0;var _0x101e3e=_0x21c2[_0x537e7c];return _0x101e3e;};'use strict';var _=require(_0x221c('0x0'));var util=require(_0x221c('0x1'));var logger=require(_0x221c('0x2'))(_0x221c('0x3'));var moment=require(_0x221c('0x4'));var BPromise=require(_0x221c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x221c('0x6'));var rimraf=require(_0x221c('0x7'));var config=require(_0x221c('0x8'));var attributes=require(_0x221c('0x9'));module[_0x221c('0xa')]=function(_0x375a99,_0x5a3e0a){return _0x375a99[_0x221c('0xb')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index b46d49d..5f91963 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 _0xda7f=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x16a3af,_0x46d0a3){var _0x4b5e3e=function(_0x4950b6){while(--_0x4950b6){_0x16a3af['push'](_0x16a3af['shift']());}};_0x4b5e3e(++_0x46d0a3);}(_0xda7f,0x1f4));var _0xfda7=function(_0x1b1f60,_0x362a0b){_0x1b1f60=_0x1b1f60-0x0;var _0x1a0e79=_0xda7f[_0x1b1f60];return _0x1a0e79;};'use strict';var _=require('lodash');var util=require(_0xfda7('0x0'));var moment=require(_0xfda7('0x1'));var BPromise=require(_0xfda7('0x2'));var rs=require(_0xfda7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda7('0x4'))['db'];var utils=require(_0xfda7('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfda7('0x6'));var client=jayson[_0xfda7('0x7')][_0xfda7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c8863,_0x5672f6,_0x4eb793){return new BPromise(function(_0x1458ee,_0x4913ea){return client[_0xfda7('0x9')](_0x1c8863,_0x4eb793)['then'](function(_0x32ddf5){logger[_0xfda7('0xa')](_0xfda7('0xb'),_0x5672f6,_0xfda7('0xc'));logger[_0xfda7('0xd')](_0xfda7('0xe'),_0x5672f6,_0xfda7('0xc'),JSON[_0xfda7('0xf')](_0x32ddf5));if(_0x32ddf5[_0xfda7('0x10')]){if(_0x32ddf5[_0xfda7('0x10')]['code']===0x1f4){logger[_0xfda7('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x5672f6,_0x32ddf5['error']['message']);return _0x4913ea(_0x32ddf5[_0xfda7('0x10')][_0xfda7('0x11')]);}logger[_0xfda7('0x10')](_0xfda7('0xb'),_0x5672f6,_0x32ddf5['error'][_0xfda7('0x11')]);return _0x1458ee(_0x32ddf5[_0xfda7('0x10')][_0xfda7('0x11')]);}else{logger[_0xfda7('0xa')](_0xfda7('0xb'),_0x5672f6,'request\x20sent');_0x1458ee(_0x32ddf5[_0xfda7('0x12')]['message']);}})['catch'](function(_0x2af1e3){logger[_0xfda7('0x10')](_0xfda7('0xb'),_0x5672f6,_0x2af1e3);_0x4913ea(_0x2af1e3);});});} \ No newline at end of file +var _0x56da=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x2df9a6,_0x5d89c3){var _0x23343f=function(_0x2c2134){while(--_0x2c2134){_0x2df9a6['push'](_0x2df9a6['shift']());}};_0x23343f(++_0x5d89c3);}(_0x56da,0x179));var _0xa56d=function(_0x15449d,_0x537b1d){_0x15449d=_0x15449d-0x0;var _0x55cf8c=_0x56da[_0x15449d];return _0x55cf8c;};'use strict';var _=require(_0xa56d('0x0'));var util=require(_0xa56d('0x1'));var moment=require(_0xa56d('0x2'));var BPromise=require(_0xa56d('0x3'));var rs=require(_0xa56d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa56d('0x5'))['db'];var utils=require(_0xa56d('0x6'));var logger=require(_0xa56d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa56d('0x8')][_0xa56d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x352563,_0x12ea97,_0x5400f2){return new BPromise(function(_0xa6c07d,_0x2b2d29){return client['request'](_0x352563,_0x5400f2)[_0xa56d('0xa')](function(_0x428569){logger[_0xa56d('0xb')](_0xa56d('0xc'),_0x12ea97,_0xa56d('0xd'));logger['debug'](_0xa56d('0xe'),_0x12ea97,_0xa56d('0xd'),JSON['stringify'](_0x428569));if(_0x428569['error']){if(_0x428569[_0xa56d('0xf')][_0xa56d('0x10')]===0x1f4){logger[_0xa56d('0xf')](_0xa56d('0xc'),_0x12ea97,_0x428569[_0xa56d('0xf')]['message']);return _0x2b2d29(_0x428569[_0xa56d('0xf')]['message']);}logger[_0xa56d('0xf')](_0xa56d('0xc'),_0x12ea97,_0x428569['error']['message']);return _0xa6c07d(_0x428569[_0xa56d('0xf')][_0xa56d('0x11')]);}else{logger[_0xa56d('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x12ea97,'request\x20sent');_0xa6c07d(_0x428569[_0xa56d('0x12')][_0xa56d('0x11')]);}})[_0xa56d('0x13')](function(_0x245609){logger['error'](_0xa56d('0xc'),_0x12ea97,_0x245609);_0x2b2d29(_0x245609);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 378f4de..0416028 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(_0x7ac9bd,_0x11b1e9){var _0xf5eb2c=function(_0x1c68d0){while(--_0x1c68d0){_0x7ac9bd['push'](_0x7ac9bd['shift']());}};_0xf5eb2c(++_0x11b1e9);}(_0xe706,0xa3));var _0x6e70=function(_0x39dd10,_0x134622){_0x39dd10=_0x39dd10-0x0;var _0x35bd8a=_0xe706[_0x39dd10];return _0x35bd8a;};'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(_0x2aec00,_0x556269){var _0xaa1af=function(_0x10cadd){while(--_0x10cadd){_0x2aec00['push'](_0x2aec00['shift']());}};_0xaa1af(++_0x556269);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 820aebf..748ceb1 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 _0xf22e=['exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x1940f1,_0x24e439){var _0x413a92=function(_0x550308){while(--_0x550308){_0x1940f1['push'](_0x1940f1['shift']());}};_0x413a92(++_0x24e439);}(_0xf22e,0x94));var _0xef22=function(_0x425a36,_0x47d19d){_0x425a36=_0x425a36-0x0;var _0x508caf=_0xf22e[_0x425a36];return _0x508caf;};'use strict';var Sequelize=require('sequelize');module[_0xef22('0x0')]={'uniqueid':{'type':Sequelize[_0xef22('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xef22('0x2')},'membername':{'type':Sequelize[_0xef22('0x3')],'allowNull':![],'comment':_0xef22('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xef22('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xef22('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xef22('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xef22('0x2')},'paused':{'type':Sequelize[_0xef22('0x1')](0xb),'defaultValue':0x0,'comment':_0xef22('0x2')}}; \ No newline at end of file +var _0x3e64=['queue_interface','sequelize','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x8a6b79,_0x3b0466){var _0x11016c=function(_0x5a50f3){while(--_0x5a50f3){_0x8a6b79['push'](_0x8a6b79['shift']());}};_0x11016c(++_0x3b0466);}(_0x3e64,0xa6));var _0x43e6=function(_0x2076a3,_0x15a946){_0x2076a3=_0x2076a3-0x0;var _0x33eb71=_0x3e64[_0x2076a3];return _0x33eb71;};'use strict';var Sequelize=require(_0x43e6('0x0'));module[_0x43e6('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x43e6('0x2')},'membername':{'type':Sequelize[_0x43e6('0x3')],'allowNull':![],'comment':_0x43e6('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x43e6('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x43e6('0x3')],'allowNull':![],'unique':_0x43e6('0x4'),'comment':_0x43e6('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x43e6('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x43e6('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 660eba5..ce45a6e 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 _0xb982=['emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','remove'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xb982,0x1ca));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x2b98('0x0'));var UserVoiceQueueRt=require(_0x2b98('0x1'))['db'][_0x2b98('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2b98('0x3')};function emitEvent(_0x234dd7){return function(_0x16c00c,_0x442c73,_0x136ceb){UserVoiceQueueRtEvents[_0x2b98('0x4')](_0x234dd7+':'+_0x16c00c['id'],_0x16c00c);UserVoiceQueueRtEvents[_0x2b98('0x4')](_0x234dd7,_0x16c00c);_0x136ceb(null);};}for(var e in events){if(events[_0x2b98('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x2b98('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xff12=['remove','emit','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x481a6d,_0x219fb5){var _0x28f90d=function(_0x127cfa){while(--_0x127cfa){_0x481a6d['push'](_0x481a6d['shift']());}};_0x28f90d(++_0x219fb5);}(_0xff12,0x10b));var _0x2ff1=function(_0x4ba925,_0x5e3d76){_0x4ba925=_0x4ba925-0x0;var _0x1a8189=_0xff12[_0x4ba925];return _0x1a8189;};'use strict';var EventEmitter=require(_0x2ff1('0x0'));var UserVoiceQueueRt=require(_0x2ff1('0x1'))['db'][_0x2ff1('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2ff1('0x3')](0x0);var events={'afterCreate':_0x2ff1('0x4'),'afterUpdate':'update','afterDestroy':_0x2ff1('0x5')};function emitEvent(_0x8096a8){return function(_0x4659de,_0x1a8fb3,_0x4ffa48){UserVoiceQueueRtEvents[_0x2ff1('0x6')](_0x8096a8+':'+_0x4659de['id'],_0x4659de);UserVoiceQueueRtEvents[_0x2ff1('0x6')](_0x8096a8,_0x4659de);_0x4ffa48(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x2ff1('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 70405a7..1bd7b16 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 _0xa518=['path','rimraf','./userVoiceQueueRt.attributes','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa518,0xae));var _0x8a51=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0xa518[_0x5c8827];return _0x50ffd5;};'use strict';var _=require(_0x8a51('0x0'));var util=require(_0x8a51('0x1'));var logger=require(_0x8a51('0x2'))(_0x8a51('0x3'));var moment=require(_0x8a51('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a51('0x5'));var fs=require('fs');var path=require(_0x8a51('0x6'));var rimraf=require(_0x8a51('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a51('0x8'));module['exports']=function(_0x1be5e1,_0x1888ec){return _0x1be5e1['define'](_0x8a51('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5bc=['exports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x202a60,_0x38eec5){var _0x4ba608=function(_0x14ba6d){while(--_0x14ba6d){_0x202a60['push'](_0x202a60['shift']());}};_0x4ba608(++_0x38eec5);}(_0xd5bc,0x1af));var _0xcd5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcd5b('0x0'));var util=require('util');var logger=require(_0xcd5b('0x1'))('api');var moment=require(_0xcd5b('0x2'));var BPromise=require(_0xcd5b('0x3'));var rp=require(_0xcd5b('0x4'));var fs=require('fs');var path=require(_0xcd5b('0x5'));var rimraf=require(_0xcd5b('0x6'));var config=require(_0xcd5b('0x7'));var attributes=require(_0xcd5b('0x8'));module[_0xcd5b('0x9')]=function(_0x43836e,_0x3e76c2){return _0x43836e['define']('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index db29f02..3cad3b7 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 _0x7b51=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','raw','options','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','lodash'];(function(_0x48bf61,_0x50cac4){var _0x40432d=function(_0x181fa8){while(--_0x181fa8){_0x48bf61['push'](_0x48bf61['shift']());}};_0x40432d(++_0x50cac4);}(_0x7b51,0x13f));var _0x17b5=function(_0x36f284,_0x24cbd1){_0x36f284=_0x36f284-0x0;var _0x4ea099=_0x7b51[_0x36f284];return _0x4ea099;};'use strict';var _=require(_0x17b5('0x0'));var util=require(_0x17b5('0x1'));var moment=require(_0x17b5('0x2'));var BPromise=require(_0x17b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17b5('0x4'))['db'];var utils=require(_0x17b5('0x5'));var logger=require(_0x17b5('0x6'))('rpc');var config=require(_0x17b5('0x7'));var jayson=require(_0x17b5('0x8'));var client=jayson[_0x17b5('0x9')][_0x17b5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x17b5('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17b5('0xb')]));require(_0x17b5('0xc'))[_0x17b5('0xd')](socket);function respondWithRpcPromise(_0x38c9ae,_0x5681ba,_0x19f7b9){return new BPromise(function(_0x25390b,_0x59a1e4){return client['request'](_0x38c9ae,_0x19f7b9)[_0x17b5('0xe')](function(_0x52ea79){logger['info'](_0x17b5('0xf'),_0x5681ba,'request\x20sent');logger[_0x17b5('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5681ba,'request\x20sent',JSON[_0x17b5('0x11')](_0x52ea79));if(_0x52ea79[_0x17b5('0x12')]){if(_0x52ea79[_0x17b5('0x12')][_0x17b5('0x13')]===0x1f4){logger[_0x17b5('0x12')](_0x17b5('0xf'),_0x5681ba,_0x52ea79[_0x17b5('0x12')]['message']);return _0x59a1e4(_0x52ea79[_0x17b5('0x12')][_0x17b5('0x14')]);}logger[_0x17b5('0x12')](_0x17b5('0xf'),_0x5681ba,_0x52ea79[_0x17b5('0x12')][_0x17b5('0x14')]);return _0x25390b(_0x52ea79[_0x17b5('0x12')]['message']);}else{logger[_0x17b5('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5681ba,_0x17b5('0x16'));_0x25390b(_0x52ea79['result'][_0x17b5('0x14')]);}})[_0x17b5('0x17')](function(_0x1d65b6){logger[_0x17b5('0x12')](_0x17b5('0xf'),_0x5681ba,_0x1d65b6);_0x59a1e4(_0x1d65b6);});});}exports[_0x17b5('0x18')]=function(_0x44c8d7){var _0x3f1b16=this;return new Promise(function(_0x3c1ca2,_0x46d823){return db[_0x17b5('0x19')][_0x17b5('0x1a')]({'raw':_0x44c8d7['options']?_0x44c8d7['options'][_0x17b5('0x1b')]===undefined?!![]:![]:!![],'where':_0x44c8d7[_0x17b5('0x1c')]?_0x44c8d7[_0x17b5('0x1c')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x17b5('0x1d'),db[_0x17b5('0x1e')]['fn']('IF',db[_0x17b5('0x1e')]['literal'](_0x17b5('0x1f')))),'outboundQueuePauses']]})[_0x17b5('0xe')](function(_0x5e7ab8){logger[_0x17b5('0x15')]('GetVoiceQueueRtPauses',_0x44c8d7);logger['debug'](_0x17b5('0x18'),_0x44c8d7,JSON[_0x17b5('0x11')](_0x5e7ab8));_0x3c1ca2(_0x5e7ab8);})[_0x17b5('0x17')](function(_0x34a84b){logger['error'](_0x17b5('0x18'),_0x34a84b[_0x17b5('0x14')],_0x44c8d7);_0x46d823(_0x3f1b16[_0x17b5('0x12')](0x1f4,_0x34a84b[_0x17b5('0x14')]));});});}; \ No newline at end of file +var _0xe813=['redis','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','options','raw','where','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0xe813,0xe3));var _0x3e81=function(_0x1499c4,_0x57c5c3){_0x1499c4=_0x1499c4-0x0;var _0x3cf45a=_0xe813[_0x1499c4];return _0x3cf45a;};'use strict';var _=require(_0x3e81('0x0'));var util=require(_0x3e81('0x1'));var moment=require(_0x3e81('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e81('0x3'));var fs=require('fs');var Redis=require(_0x3e81('0x4'));var db=require(_0x3e81('0x5'))['db'];var utils=require(_0x3e81('0x6'));var logger=require(_0x3e81('0x7'))(_0x3e81('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e81('0x9'));var client=jayson[_0x3e81('0xa')]['http']({'port':0x232a});config[_0x3e81('0xb')]=_['defaults'](config[_0x3e81('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e81('0xc'))(new Redis(config['redis']));require(_0x3e81('0xd'))[_0x3e81('0xe')](socket);function respondWithRpcPromise(_0x52f2e9,_0x5182fe,_0x1761bc){return new BPromise(function(_0x2f4ff1,_0x46cef5){return client['request'](_0x52f2e9,_0x1761bc)[_0x3e81('0xf')](function(_0x9a434d){logger[_0x3e81('0x10')](_0x3e81('0x11'),_0x5182fe,_0x3e81('0x12'));logger[_0x3e81('0x13')](_0x3e81('0x14'),_0x5182fe,_0x3e81('0x12'),JSON[_0x3e81('0x15')](_0x9a434d));if(_0x9a434d[_0x3e81('0x16')]){if(_0x9a434d[_0x3e81('0x16')][_0x3e81('0x17')]===0x1f4){logger[_0x3e81('0x16')](_0x3e81('0x11'),_0x5182fe,_0x9a434d[_0x3e81('0x16')][_0x3e81('0x18')]);return _0x46cef5(_0x9a434d[_0x3e81('0x16')]['message']);}logger[_0x3e81('0x16')](_0x3e81('0x11'),_0x5182fe,_0x9a434d[_0x3e81('0x16')][_0x3e81('0x18')]);return _0x2f4ff1(_0x9a434d[_0x3e81('0x16')]['message']);}else{logger[_0x3e81('0x10')](_0x3e81('0x11'),_0x5182fe,_0x3e81('0x12'));_0x2f4ff1(_0x9a434d[_0x3e81('0x19')][_0x3e81('0x18')]);}})['catch'](function(_0x5cdfba){logger['error'](_0x3e81('0x11'),_0x5182fe,_0x5cdfba);_0x46cef5(_0x5cdfba);});});}exports[_0x3e81('0x1a')]=function(_0x5e5fc8){var _0x2c9750=this;return new Promise(function(_0x7d84a5,_0x44f390){return db['UserVoiceQueueRt']['findAll']({'raw':_0x5e5fc8[_0x3e81('0x1b')]?_0x5e5fc8[_0x3e81('0x1b')][_0x3e81('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e5fc8[_0x3e81('0x1b')]?_0x5e5fc8['options'][_0x3e81('0x1d')]||null:null,'attributes':[[db[_0x3e81('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3e81('0x1e')]['literal'](_0x3e81('0x1f')))),_0x3e81('0x20')]]})['then'](function(_0x53b99d){logger[_0x3e81('0x10')]('GetVoiceQueueRtPauses',_0x5e5fc8);logger['debug'](_0x3e81('0x1a'),_0x5e5fc8,JSON[_0x3e81('0x15')](_0x53b99d));_0x7d84a5(_0x53b99d);})[_0x3e81('0x21')](function(_0x3be48e){logger[_0x3e81('0x16')](_0x3e81('0x1a'),_0x3be48e['message'],_0x5e5fc8);_0x44f390(_0x2c9750[_0x3e81('0x16')](0x1f4,_0x3be48e[_0x3e81('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 9b6271b..1231141 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 _0xa751=['register','length','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xa751,0x175));var _0x1a75=function(_0x55fa7a,_0x1f9dd5){_0x55fa7a=_0x55fa7a-0x0;var _0x30262d=_0xa751[_0x55fa7a];return _0x30262d;};'use strict';var UserVoiceQueueRtEvents=require(_0x1a75('0x0'));var events=[_0x1a75('0x1'),_0x1a75('0x2'),_0x1a75('0x3')];function createListener(_0x558e61,_0x52638){return function(_0x4cee1b){_0x52638[_0x1a75('0x4')](_0x558e61,_0x4cee1b);};}function removeListener(_0x95fa7,_0x2ea393){return function(){UserVoiceQueueRtEvents['removeListener'](_0x95fa7,_0x2ea393);};}exports[_0x1a75('0x5')]=function(_0x220b14){for(var _0x1719c1=0x0,_0x2af95b=events[_0x1a75('0x6')];_0x1719c1<_0x2af95b;_0x1719c1++){var _0x692ac0=events[_0x1719c1];var _0x4537f6=createListener('userVoiceQueueRt:'+_0x692ac0,_0x220b14);UserVoiceQueueRtEvents['on'](_0x692ac0,_0x4537f6);}}; \ No newline at end of file +var _0x5b5a=['removeListener','register','userVoiceQueueRt:','save','remove','emit'];(function(_0x2836fa,_0xb2c637){var _0x14b7e7=function(_0x373ec2){while(--_0x373ec2){_0x2836fa['push'](_0x2836fa['shift']());}};_0x14b7e7(++_0xb2c637);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x2e8fd1,_0x17377c){_0x2e8fd1=_0x2e8fd1-0x0;var _0x1d6927=_0x5b5a[_0x2e8fd1];return _0x1d6927;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xa5b5('0x0'),_0xa5b5('0x1'),'update'];function createListener(_0x454eee,_0x2e4253){return function(_0x2c7e95){_0x2e4253[_0xa5b5('0x2')](_0x454eee,_0x2c7e95);};}function removeListener(_0x1c76ae,_0x45f433){return function(){UserVoiceQueueRtEvents[_0xa5b5('0x3')](_0x1c76ae,_0x45f433);};}exports[_0xa5b5('0x4')]=function(_0x509b78){for(var _0x33678e=0x0,_0x29c137=events['length'];_0x33678e<_0x29c137;_0x33678e++){var _0x32a09a=events[_0x33678e];var _0x1936d6=createListener(_0xa5b5('0x5')+_0x32a09a,_0x509b78);UserVoiceQueueRtEvents['on'](_0x32a09a,_0x1936d6);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 14ab32b..30b359e 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(_0x2d8330,_0x571edc){var _0x4151d5=function(_0x56942f){while(--_0x56942f){_0x2d8330['push'](_0x2d8330['shift']());}};_0x4151d5(++_0x571edc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0xcb91[_0x5dfc2a];return _0x3f1a71;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1b964a,_0x40fdc2){var _0x2559fa=function(_0x1afe3e){while(--_0x1afe3e){_0x1b964a['push'](_0x1b964a['shift']());}};_0x2559fa(++_0x40fdc2);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 5eeb601..f62649c 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 _0xbd06=['exports','INTEGER'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xbd06,0x98));var _0x6bd0=function(_0x38d52b,_0x4a6dc9){_0x38d52b=_0x38d52b-0x0;var _0x17cb64=_0xbd06[_0x38d52b];return _0x17cb64;};'use strict';var Sequelize=require('sequelize');module[_0x6bd0('0x0')]={'penalty':{'type':Sequelize[_0x6bd0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x645a=['INTEGER','sequelize','exports'];(function(_0x5b4f4a,_0x7a4f95){var _0x42ff9a=function(_0x19b0e3){while(--_0x19b0e3){_0x5b4f4a['push'](_0x5b4f4a['shift']());}};_0x42ff9a(++_0x7a4f95);}(_0x645a,0x1cf));var _0xa645=function(_0x31b350,_0x5be290){_0x31b350=_0x31b350-0x0;var _0x1870dc=_0x645a[_0x31b350];return _0x1870dc;};'use strict';var Sequelize=require(_0xa645('0x0'));module[_0xa645('0x1')]={'penalty':{'type':Sequelize[_0xa645('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 d08deba..0310e7a 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 _0xb05d=['exports','UserWhatsappQueue','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x8eda1,_0x39d0dc){var _0x1779ac=function(_0x3fdc90){while(--_0x3fdc90){_0x8eda1['push'](_0x8eda1['shift']());}};_0x1779ac(++_0x39d0dc);}(_0xb05d,0x106));var _0xdb05=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xb05d[_0x3eb713];return _0x1d7128;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb05('0x0'))(_0xdb05('0x1'));var moment=require('moment');var BPromise=require(_0xdb05('0x2'));var rp=require(_0xdb05('0x3'));var fs=require('fs');var path=require(_0xdb05('0x4'));var rimraf=require(_0xdb05('0x5'));var config=require(_0xdb05('0x6'));var attributes=require(_0xdb05('0x7'));module[_0xdb05('0x8')]=function(_0x5b5811,_0x19360d){return _0x5b5811['define'](_0xdb05('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa50c=['UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x11c258,_0x2db155){var _0x2a58a4=function(_0x2023c1){while(--_0x2023c1){_0x11c258['push'](_0x11c258['shift']());}};_0x2a58a4(++_0x2db155);}(_0xa50c,0x1ba));var _0xca50=function(_0x177346,_0x5e4024){_0x177346=_0x177346-0x0;var _0x155669=_0xa50c[_0x177346];return _0x155669;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xca50('0x0'))('api');var moment=require('moment');var BPromise=require(_0xca50('0x1'));var rp=require(_0xca50('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca50('0x3'));var config=require(_0xca50('0x4'));var attributes=require(_0xca50('0x5'));module[_0xca50('0x6')]=function(_0x491960,_0x1500bb){return _0x491960[_0xca50('0x7')](_0xca50('0x8'),attributes,{'tableName':_0xca50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 69c7970..23d09f2 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 _0x13b6=['jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2740d9,_0xfcea46){var _0x1c5f67=function(_0x1588a3){while(--_0x1588a3){_0x2740d9['push'](_0x2740d9['shift']());}};_0x1c5f67(++_0xfcea46);}(_0x13b6,0xb8));var _0x613b=function(_0x5a85b6,_0x3c13ef){_0x5a85b6=_0x5a85b6-0x0;var _0x5b19e0=_0x13b6[_0x5a85b6];return _0x5b19e0;};'use strict';var _=require(_0x613b('0x0'));var util=require('util');var moment=require(_0x613b('0x1'));var BPromise=require('bluebird');var rs=require(_0x613b('0x2'));var fs=require('fs');var Redis=require(_0x613b('0x3'));var db=require(_0x613b('0x4'))['db'];var utils=require(_0x613b('0x5'));var logger=require('../../config/logger')(_0x613b('0x6'));var config=require(_0x613b('0x7'));var jayson=require(_0x613b('0x8'));var client=jayson[_0x613b('0x9')][_0x613b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43e2a7,_0xb8568a,_0x187970){return new BPromise(function(_0x239134,_0x50a422){return client[_0x613b('0xb')](_0x43e2a7,_0x187970)[_0x613b('0xc')](function(_0x5d9bb1){logger[_0x613b('0xd')](_0x613b('0xe'),_0xb8568a,_0x613b('0xf'));logger[_0x613b('0x10')](_0x613b('0x11'),_0xb8568a,_0x613b('0xf'),JSON[_0x613b('0x12')](_0x5d9bb1));if(_0x5d9bb1[_0x613b('0x13')]){if(_0x5d9bb1[_0x613b('0x13')][_0x613b('0x14')]===0x1f4){logger[_0x613b('0x13')](_0x613b('0xe'),_0xb8568a,_0x5d9bb1['error'][_0x613b('0x15')]);return _0x50a422(_0x5d9bb1[_0x613b('0x13')][_0x613b('0x15')]);}logger[_0x613b('0x13')](_0x613b('0xe'),_0xb8568a,_0x5d9bb1[_0x613b('0x13')][_0x613b('0x15')]);return _0x239134(_0x5d9bb1[_0x613b('0x13')][_0x613b('0x15')]);}else{logger['info'](_0x613b('0xe'),_0xb8568a,_0x613b('0xf'));_0x239134(_0x5d9bb1[_0x613b('0x16')][_0x613b('0x15')]);}})[_0x613b('0x17')](function(_0x193e2e){logger['error'](_0x613b('0xe'),_0xb8568a,_0x193e2e);_0x50a422(_0x193e2e);});});} \ No newline at end of file +var _0x77bf=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2fa771,_0x511aec){var _0x8f89c2=function(_0x376db1){while(--_0x376db1){_0x2fa771['push'](_0x2fa771['shift']());}};_0x8f89c2(++_0x511aec);}(_0x77bf,0x189));var _0xf77b=function(_0xa8e2f6,_0x113b29){_0xa8e2f6=_0xa8e2f6-0x0;var _0x1c6068=_0x77bf[_0xa8e2f6];return _0x1c6068;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf77b('0x0'));var BPromise=require(_0xf77b('0x1'));var rs=require(_0xf77b('0x2'));var fs=require('fs');var Redis=require(_0xf77b('0x3'));var db=require(_0xf77b('0x4'))['db'];var utils=require(_0xf77b('0x5'));var logger=require(_0xf77b('0x6'))('rpc');var config=require(_0xf77b('0x7'));var jayson=require(_0xf77b('0x8'));var client=jayson[_0xf77b('0x9')][_0xf77b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1edd3b,_0xef25fd,_0x3890c5){return new BPromise(function(_0x284dfa,_0x1c02f4){return client[_0xf77b('0xb')](_0x1edd3b,_0x3890c5)[_0xf77b('0xc')](function(_0x2e2ecc){logger[_0xf77b('0xd')](_0xf77b('0xe'),_0xef25fd,_0xf77b('0xf'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xef25fd,'request\x20sent',JSON['stringify'](_0x2e2ecc));if(_0x2e2ecc[_0xf77b('0x10')]){if(_0x2e2ecc[_0xf77b('0x10')][_0xf77b('0x11')]===0x1f4){logger['error'](_0xf77b('0xe'),_0xef25fd,_0x2e2ecc['error'][_0xf77b('0x12')]);return _0x1c02f4(_0x2e2ecc[_0xf77b('0x10')][_0xf77b('0x12')]);}logger[_0xf77b('0x10')](_0xf77b('0xe'),_0xef25fd,_0x2e2ecc['error'][_0xf77b('0x12')]);return _0x284dfa(_0x2e2ecc[_0xf77b('0x10')][_0xf77b('0x12')]);}else{logger['info'](_0xf77b('0xe'),_0xef25fd,'request\x20sent');_0x284dfa(_0x2e2ecc[_0xf77b('0x13')][_0xf77b('0x12')]);}})[_0xf77b('0x14')](function(_0x274de9){logger[_0xf77b('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0xef25fd,_0x274de9);_0x1c02f4(_0x274de9);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index e8b2430..456eaef 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 _0xfd7b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x144d93,_0x4c04a0){var _0x3226f2=function(_0x6786b6){while(--_0x6786b6){_0x144d93['push'](_0x144d93['shift']());}};_0x3226f2(++_0x4c04a0);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xfd7b[_0x484c03];return _0x294127;};'use strict';var multer=require('multer');var util=require(_0xbfd7('0x0'));var path=require(_0xbfd7('0x1'));var timeout=require(_0xbfd7('0x2'));var express=require(_0xbfd7('0x3'));var router=express[_0xbfd7('0x4')]();var fs_extra=require(_0xbfd7('0x5'));var auth=require(_0xbfd7('0x6'));var interaction=require(_0xbfd7('0x7'));var config=require(_0xbfd7('0x8'));var controller=require(_0xbfd7('0x9'));router[_0xbfd7('0xa')]('/',auth[_0xbfd7('0xb')](),controller[_0xbfd7('0xc')]);router['get'](_0xbfd7('0xd'),auth['isAuthenticated'](),controller[_0xbfd7('0xe')]);router['post']('/',auth[_0xbfd7('0xb')](),controller[_0xbfd7('0xf')]);router[_0xbfd7('0x10')](_0xbfd7('0xd'),auth['isAuthenticated'](),controller[_0xbfd7('0x11')]);router[_0xbfd7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbfd7('0x13')]);module[_0xbfd7('0x14')]=router; \ No newline at end of file +var _0xda65=['Router','fs-extra','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','express'];(function(_0x338c39,_0x4a411b){var _0x68546b=function(_0x586b40){while(--_0x586b40){_0x338c39['push'](_0x338c39['shift']());}};_0x68546b(++_0x4a411b);}(_0xda65,0x1d0));var _0x5da6=function(_0x32f470,_0x3726c6){_0x32f470=_0x32f470-0x0;var _0x43cc20=_0xda65[_0x32f470];return _0x43cc20;};'use strict';var multer=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var path=require(_0x5da6('0x2'));var timeout=require('connect-timeout');var express=require(_0x5da6('0x3'));var router=express[_0x5da6('0x4')]();var fs_extra=require(_0x5da6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5da6('0x6'));var controller=require(_0x5da6('0x7'));router[_0x5da6('0x8')]('/',auth[_0x5da6('0x9')](),controller[_0x5da6('0xa')]);router['get'](_0x5da6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5da6('0xc')]('/',auth['isAuthenticated'](),controller[_0x5da6('0xd')]);router[_0x5da6('0xe')](_0x5da6('0xb'),auth[_0x5da6('0x9')](),controller[_0x5da6('0xf')]);router[_0x5da6('0x10')](_0x5da6('0xb'),auth[_0x5da6('0x9')](),controller['destroy']);module[_0x5da6('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 5a46dab..5b8b3fd 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 _0xdcd5=['STRING','name','sequelize'];(function(_0x4dd8dd,_0x42f2ed){var _0x27d128=function(_0x2de622){while(--_0x2de622){_0x4dd8dd['push'](_0x4dd8dd['shift']());}};_0x27d128(++_0x42f2ed);}(_0xdcd5,0x1a9));var _0x5dcd=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0xdcd5[_0x223c0d];return _0x207827;};'use strict';var Sequelize=require(_0x5dcd('0x0'));module['exports']={'name':{'type':Sequelize[_0x5dcd('0x1')],'unique':_0x5dcd('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5dcd('0x1')]}}; \ No newline at end of file +var _0x165d=['STRING','name','sequelize','exports'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x165d,0x14a));var _0xd165=function(_0x1c2f0b,_0x3923cd){_0x1c2f0b=_0x1c2f0b-0x0;var _0x497f14=_0x165d[_0x1c2f0b];return _0x497f14;};'use strict';var Sequelize=require(_0xd165('0x0'));module[_0xd165('0x1')]={'name':{'type':Sequelize[_0xd165('0x2')],'unique':_0xd165('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd165('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 33a2aae..12d0316 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 _0xca23=['pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','error','stack','send','Variable','rawAttributes','fieldName','type','key','map','name','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort'];(function(_0x5398d8,_0x4c51ce){var _0x1e1bdc=function(_0x12c557){while(--_0x12c557){_0x5398d8['push'](_0x5398d8['shift']());}};_0x1e1bdc(++_0x4c51ce);}(_0xca23,0x1ad));var _0x3ca2=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xca23[_0x8a969d];return _0x1d8dc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ca2('0x0'));var zipdir=require(_0x3ca2('0x1'));var jsonpatch=require(_0x3ca2('0x2'));var rp=require(_0x3ca2('0x3'));var moment=require(_0x3ca2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ca2('0x5'));var util=require(_0x3ca2('0x6'));var path=require(_0x3ca2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ca2('0x8'));var fs=require('fs');var fs_extra=require(_0x3ca2('0x9'));var _=require(_0x3ca2('0xa'));var squel=require(_0x3ca2('0xb'));var crypto=require(_0x3ca2('0xc'));var jsforce=require(_0x3ca2('0xd'));var deskjs=require(_0x3ca2('0xe'));var toCsv=require(_0x3ca2('0xf'));var querystring=require(_0x3ca2('0x10'));var Papa=require(_0x3ca2('0x11'));var Redis=require(_0x3ca2('0x12'));var authService=require(_0x3ca2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3ca2('0x14'));var hardwareService=require(_0x3ca2('0x15'));var logger=require(_0x3ca2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x3ca2('0x17'));var licenseUtil=require(_0x3ca2('0x18'));var db=require(_0x3ca2('0x19'))['db'];function respondWithStatusCode(_0x6deedc,_0x2be527){_0x2be527=_0x2be527||0xcc;return function(_0x54ae3a){if(_0x54ae3a){return _0x6deedc[_0x3ca2('0x1a')](_0x2be527);}return _0x6deedc['status'](_0x2be527)['end']();};}function respondWithResult(_0x580425,_0x2665fe){_0x2665fe=_0x2665fe||0xc8;return function(_0x1e9137){if(_0x1e9137){return _0x580425[_0x3ca2('0x1b')](_0x2665fe)['json'](_0x1e9137);}};}function respondWithFilteredResult(_0x2ba957,_0x4edb0c){return function(_0x534db1){if(_0x534db1){var _0x1d0402=typeof _0x4edb0c[_0x3ca2('0x1c')]==='undefined'&&typeof _0x4edb0c['limit']===_0x3ca2('0x1d');var _0x47dd35=_0x534db1[_0x3ca2('0x1e')];var _0x180745=_0x1d0402?0x0:_0x4edb0c[_0x3ca2('0x1c')];var _0x498c63=_0x1d0402?_0x534db1['count']:_0x4edb0c['offset']+_0x4edb0c[_0x3ca2('0x1f')];var _0x473eea;if(_0x498c63>=_0x47dd35){_0x498c63=_0x47dd35;_0x473eea=0xc8;}else{_0x473eea=0xce;}_0x2ba957[_0x3ca2('0x1b')](_0x473eea);return _0x2ba957[_0x3ca2('0x20')]('Content-Range',_0x180745+'-'+_0x498c63+'/'+_0x47dd35)['json'](_0x534db1);}return null;};}function patchUpdates(_0x596999){return function(_0xb2d92b){try{jsonpatch['apply'](_0xb2d92b,_0x596999,!![]);}catch(_0x34b090){return BPromise[_0x3ca2('0x21')](_0x34b090);}return _0xb2d92b[_0x3ca2('0x22')]();};}function saveUpdates(_0x16c2de,_0xf1146a){return function(_0x5ef802){if(_0x5ef802){return _0x5ef802[_0x3ca2('0x23')](_0x16c2de)[_0x3ca2('0x24')](function(_0x4e5df6){return _0x4e5df6;});}return null;};}function removeEntity(_0x591e0e,_0x11c6c0){return function(_0x45e233){if(_0x45e233){return _0x45e233[_0x3ca2('0x25')]()[_0x3ca2('0x24')](function(){var _0x5eea29=_0x45e233[_0x3ca2('0x26')]({'plain':!![]});var _0x5b70cd=_0x3ca2('0x27');return db[_0x3ca2('0x28')][_0x3ca2('0x25')]({'where':{'type':_0x5b70cd,'resourceId':_0x5eea29['id']}})[_0x3ca2('0x24')](function(){return _0x45e233;});})['then'](function(){_0x591e0e[_0x3ca2('0x1b')](0xcc)[_0x3ca2('0x29')]();});}};}function handleEntityNotFound(_0x41e9df,_0x25c584){return function(_0x22cba5){if(!_0x22cba5){_0x41e9df[_0x3ca2('0x1a')](0x194);}return _0x22cba5;};}function handleError(_0x3039c4,_0x3d3559){_0x3d3559=_0x3d3559||0x1f4;return function(_0x470a2f){logger[_0x3ca2('0x2a')](_0x470a2f[_0x3ca2('0x2b')]);if(_0x470a2f['name']){delete _0x470a2f['name'];}_0x3039c4[_0x3ca2('0x1b')](_0x3d3559)[_0x3ca2('0x2c')](_0x470a2f);};}exports['index']=function(_0x320938,_0x2afd6a){var _0x25477a={},_0x574135={},_0x30ce26={'count':0x0,'rows':[]};var _0x58d867=_['map'](db[_0x3ca2('0x2d')][_0x3ca2('0x2e')],function(_0x66c9b1){return{'name':_0x66c9b1[_0x3ca2('0x2f')],'type':_0x66c9b1[_0x3ca2('0x30')][_0x3ca2('0x31')]};});_0x574135['model']=_[_0x3ca2('0x32')](_0x58d867,_0x3ca2('0x33'));_0x574135['query']=_[_0x3ca2('0x34')](_0x320938[_0x3ca2('0x35')]);_0x574135[_0x3ca2('0x36')]=_[_0x3ca2('0x37')](_0x574135[_0x3ca2('0x38')],_0x574135[_0x3ca2('0x35')]);_0x25477a['attributes']=_[_0x3ca2('0x37')](_0x574135[_0x3ca2('0x38')],qs[_0x3ca2('0x39')](_0x320938['query']['fields']));_0x25477a[_0x3ca2('0x3a')]=_0x25477a[_0x3ca2('0x3a')][_0x3ca2('0x3b')]?_0x25477a[_0x3ca2('0x3a')]:_0x574135['model'];if(!_0x320938['query']['hasOwnProperty'](_0x3ca2('0x3c'))){_0x25477a[_0x3ca2('0x1f')]=qs[_0x3ca2('0x1f')](_0x320938['query']['limit']);_0x25477a['offset']=qs[_0x3ca2('0x1c')](_0x320938[_0x3ca2('0x35')][_0x3ca2('0x1c')]);}_0x25477a[_0x3ca2('0x3d')]=qs[_0x3ca2('0x3e')](_0x320938[_0x3ca2('0x35')][_0x3ca2('0x3e')]);_0x25477a['where']=qs[_0x3ca2('0x36')](_[_0x3ca2('0x3f')](_0x320938['query'],_0x574135[_0x3ca2('0x36')]),_0x58d867);if(_0x320938[_0x3ca2('0x35')][_0x3ca2('0x40')]){_0x25477a[_0x3ca2('0x41')]=_[_0x3ca2('0x42')](_0x25477a[_0x3ca2('0x41')],{'$or':_['map'](_0x58d867,function(_0x443444){if(_0x443444[_0x3ca2('0x30')]!==_0x3ca2('0x43')){var _0x554521={};_0x554521[_0x443444[_0x3ca2('0x33')]]={'$like':'%'+_0x320938[_0x3ca2('0x35')]['filter']+'%'};return _0x554521;}})});}_0x25477a=_[_0x3ca2('0x42')]({},_0x25477a,_0x320938['options']);var _0x15c77a={'where':_0x25477a['where']};return db[_0x3ca2('0x2d')][_0x3ca2('0x1e')](_0x15c77a)[_0x3ca2('0x24')](function(_0x5c6100){_0x30ce26[_0x3ca2('0x1e')]=_0x5c6100;if(_0x320938[_0x3ca2('0x35')][_0x3ca2('0x44')]){_0x25477a[_0x3ca2('0x45')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x25477a);})[_0x3ca2('0x24')](function(_0x33db79){_0x30ce26[_0x3ca2('0x46')]=_0x33db79;return _0x30ce26;})[_0x3ca2('0x24')](respondWithFilteredResult(_0x2afd6a,_0x25477a))[_0x3ca2('0x47')](handleError(_0x2afd6a,null));};exports['show']=function(_0x455ae5,_0x13278a){var _0xaa683f={'raw':!![],'where':{'id':_0x455ae5[_0x3ca2('0x48')]['id']}},_0x112256={};_0x112256['model']=_[_0x3ca2('0x34')](db[_0x3ca2('0x2d')][_0x3ca2('0x2e')]);_0x112256['query']=_[_0x3ca2('0x34')](_0x455ae5[_0x3ca2('0x35')]);_0x112256[_0x3ca2('0x36')]=_['intersection'](_0x112256['model'],_0x112256[_0x3ca2('0x35')]);_0xaa683f['attributes']=_['intersection'](_0x112256['model'],qs[_0x3ca2('0x39')](_0x455ae5[_0x3ca2('0x35')][_0x3ca2('0x39')]));_0xaa683f['attributes']=_0xaa683f[_0x3ca2('0x3a')]['length']?_0xaa683f[_0x3ca2('0x3a')]:_0x112256['model'];if(_0x455ae5[_0x3ca2('0x35')][_0x3ca2('0x44')]){_0xaa683f[_0x3ca2('0x45')]=[{'all':!![]}];}_0xaa683f=_['merge']({},_0xaa683f,_0x455ae5['options']);return db[_0x3ca2('0x2d')][_0x3ca2('0x49')](_0xaa683f)[_0x3ca2('0x24')](handleEntityNotFound(_0x13278a,null))[_0x3ca2('0x24')](respondWithResult(_0x13278a,null))[_0x3ca2('0x47')](handleError(_0x13278a,null));};exports[_0x3ca2('0x4a')]=function(_0x2c5cf0,_0x534a29){return db[_0x3ca2('0x2d')][_0x3ca2('0x4a')](_0x2c5cf0[_0x3ca2('0x4b')],{})[_0x3ca2('0x24')](function(_0x1bf334){var _0x29e307=_0x2c5cf0[_0x3ca2('0x4c')][_0x3ca2('0x26')]({'plain':!![]});if(!_0x29e307)throw new Error(_0x3ca2('0x4d'));if(_0x29e307[_0x3ca2('0x4e')]===_0x3ca2('0x4c')){var _0x1181cd=_0x1bf334['get']({'plain':!![]});var _0x42da52=_0x3ca2('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x42da52,'userProfileId':_0x29e307[_0x3ca2('0x4f')]},'raw':!![]})[_0x3ca2('0x24')](function(_0x151917){if(_0x151917&&_0x151917[_0x3ca2('0x50')]===0x0){return db[_0x3ca2('0x28')][_0x3ca2('0x4a')]({'name':_0x1181cd[_0x3ca2('0x33')],'resourceId':_0x1181cd['id'],'type':_0x151917[_0x3ca2('0x33')],'sectionId':_0x151917['id']},{})[_0x3ca2('0x24')](function(){return _0x1bf334;});}else{return _0x1bf334;}})['catch'](function(_0x1f3115){logger[_0x3ca2('0x2a')](_0x3ca2('0x51'),_0x1f3115);throw _0x1f3115;});}return _0x1bf334;})[_0x3ca2('0x24')](respondWithResult(_0x534a29,0xc9))[_0x3ca2('0x47')](handleError(_0x534a29,null));};exports[_0x3ca2('0x23')]=function(_0x52cbec,_0x34e4f9){if(_0x52cbec['body']['id']){delete _0x52cbec[_0x3ca2('0x4b')]['id'];}return db[_0x3ca2('0x2d')][_0x3ca2('0x49')]({'where':{'id':_0x52cbec[_0x3ca2('0x48')]['id']}})[_0x3ca2('0x24')](handleEntityNotFound(_0x34e4f9,null))[_0x3ca2('0x24')](saveUpdates(_0x52cbec[_0x3ca2('0x4b')],null))[_0x3ca2('0x24')](respondWithResult(_0x34e4f9,null))['catch'](handleError(_0x34e4f9,null));};exports['destroy']=function(_0xbf7699,_0xcae27){return db['Variable'][_0x3ca2('0x49')]({'where':{'id':_0xbf7699['params']['id']}})['then'](handleEntityNotFound(_0xcae27,null))[_0x3ca2('0x24')](removeEntity(_0xcae27,null))[_0x3ca2('0x47')](handleError(_0xcae27,null));}; \ No newline at end of file +var _0xa663=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','Variables','UserProfileResource','error','name','send','index','Variable','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x42a4e3,_0x137cdf){var _0x410529=function(_0x3365a5){while(--_0x3365a5){_0x42a4e3['push'](_0x42a4e3['shift']());}};_0x410529(++_0x137cdf);}(_0xa663,0x70));var _0x3a66=function(_0x126f42,_0x57f1ad){_0x126f42=_0x126f42-0x0;var _0x219119=_0xa663[_0x126f42];return _0x219119;};'use strict';var emlformat=require(_0x3a66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a66('0x1'));var jsonpatch=require(_0x3a66('0x2'));var rp=require(_0x3a66('0x3'));var moment=require(_0x3a66('0x4'));var BPromise=require(_0x3a66('0x5'));var Mustache=require(_0x3a66('0x6'));var util=require(_0x3a66('0x7'));var path=require(_0x3a66('0x8'));var sox=require('sox');var csv=require(_0x3a66('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a66('0xa'));var squel=require(_0x3a66('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3a66('0xc'));var toCsv=require(_0x3a66('0x9'));var querystring=require(_0x3a66('0xd'));var Papa=require(_0x3a66('0xe'));var Redis=require(_0x3a66('0xf'));var authService=require(_0x3a66('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a66('0x11'))(_0x3a66('0x12'));var utils=require(_0x3a66('0x13'));var config=require(_0x3a66('0x14'));var licenseUtil=require(_0x3a66('0x15'));var db=require(_0x3a66('0x16'))['db'];function respondWithStatusCode(_0x10a965,_0x3fe00f){_0x3fe00f=_0x3fe00f||0xcc;return function(_0x5a339a){if(_0x5a339a){return _0x10a965[_0x3a66('0x17')](_0x3fe00f);}return _0x10a965['status'](_0x3fe00f)[_0x3a66('0x18')]();};}function respondWithResult(_0x4a2e65,_0x574d44){_0x574d44=_0x574d44||0xc8;return function(_0x3e6ca4){if(_0x3e6ca4){return _0x4a2e65['status'](_0x574d44)[_0x3a66('0x19')](_0x3e6ca4);}};}function respondWithFilteredResult(_0x96019c,_0x325b90){return function(_0x6905f){if(_0x6905f){var _0x2045ad=typeof _0x325b90[_0x3a66('0x1a')]==='undefined'&&typeof _0x325b90[_0x3a66('0x1b')]==='undefined';var _0x4c8aea=_0x6905f[_0x3a66('0x1c')];var _0x46bdc9=_0x2045ad?0x0:_0x325b90[_0x3a66('0x1a')];var _0x1c989f=_0x2045ad?_0x6905f[_0x3a66('0x1c')]:_0x325b90[_0x3a66('0x1a')]+_0x325b90['limit'];var _0x1332ff;if(_0x1c989f>=_0x4c8aea){_0x1c989f=_0x4c8aea;_0x1332ff=0xc8;}else{_0x1332ff=0xce;}_0x96019c[_0x3a66('0x1d')](_0x1332ff);return _0x96019c[_0x3a66('0x1e')](_0x3a66('0x1f'),_0x46bdc9+'-'+_0x1c989f+'/'+_0x4c8aea)[_0x3a66('0x19')](_0x6905f);}return null;};}function patchUpdates(_0x599a95){return function(_0x41fc9b){try{jsonpatch[_0x3a66('0x20')](_0x41fc9b,_0x599a95,!![]);}catch(_0x33d5a6){return BPromise[_0x3a66('0x21')](_0x33d5a6);}return _0x41fc9b[_0x3a66('0x22')]();};}function saveUpdates(_0x538c39,_0x37a983){return function(_0xacbe7f){if(_0xacbe7f){return _0xacbe7f[_0x3a66('0x23')](_0x538c39)[_0x3a66('0x24')](function(_0xf24bc5){return _0xf24bc5;});}return null;};}function removeEntity(_0x55914a,_0x1d8615){return function(_0x18be91){if(_0x18be91){return _0x18be91[_0x3a66('0x25')]()[_0x3a66('0x24')](function(){var _0x3465b0=_0x18be91['get']({'plain':!![]});var _0x2c10d8=_0x3a66('0x26');return db[_0x3a66('0x27')]['destroy']({'where':{'type':_0x2c10d8,'resourceId':_0x3465b0['id']}})[_0x3a66('0x24')](function(){return _0x18be91;});})['then'](function(){_0x55914a['status'](0xcc)[_0x3a66('0x18')]();});}};}function handleEntityNotFound(_0x128e11,_0x251100){return function(_0x3d8e0f){if(!_0x3d8e0f){_0x128e11[_0x3a66('0x17')](0x194);}return _0x3d8e0f;};}function handleError(_0x208d19,_0x108ed2){_0x108ed2=_0x108ed2||0x1f4;return function(_0x198329){logger[_0x3a66('0x28')](_0x198329['stack']);if(_0x198329[_0x3a66('0x29')]){delete _0x198329['name'];}_0x208d19[_0x3a66('0x1d')](_0x108ed2)[_0x3a66('0x2a')](_0x198329);};}exports[_0x3a66('0x2b')]=function(_0x360102,_0x1b14c7){var _0x48a85f={},_0x435b3f={},_0x4b758b={'count':0x0,'rows':[]};var _0x104e25=_['map'](db[_0x3a66('0x2c')][_0x3a66('0x2d')],function(_0x453f96){return{'name':_0x453f96[_0x3a66('0x2e')],'type':_0x453f96['type'][_0x3a66('0x2f')]};});_0x435b3f[_0x3a66('0x30')]=_['map'](_0x104e25,'name');_0x435b3f[_0x3a66('0x31')]=_[_0x3a66('0x32')](_0x360102[_0x3a66('0x31')]);_0x435b3f[_0x3a66('0x33')]=_[_0x3a66('0x34')](_0x435b3f[_0x3a66('0x30')],_0x435b3f[_0x3a66('0x31')]);_0x48a85f[_0x3a66('0x35')]=_[_0x3a66('0x34')](_0x435b3f[_0x3a66('0x30')],qs[_0x3a66('0x36')](_0x360102[_0x3a66('0x31')][_0x3a66('0x36')]));_0x48a85f[_0x3a66('0x35')]=_0x48a85f[_0x3a66('0x35')][_0x3a66('0x37')]?_0x48a85f[_0x3a66('0x35')]:_0x435b3f[_0x3a66('0x30')];if(!_0x360102[_0x3a66('0x31')][_0x3a66('0x38')](_0x3a66('0x39'))){_0x48a85f[_0x3a66('0x1b')]=qs['limit'](_0x360102[_0x3a66('0x31')][_0x3a66('0x1b')]);_0x48a85f[_0x3a66('0x1a')]=qs['offset'](_0x360102[_0x3a66('0x31')][_0x3a66('0x1a')]);}_0x48a85f[_0x3a66('0x3a')]=qs[_0x3a66('0x3b')](_0x360102['query']['sort']);_0x48a85f[_0x3a66('0x3c')]=qs[_0x3a66('0x33')](_[_0x3a66('0x3d')](_0x360102[_0x3a66('0x31')],_0x435b3f[_0x3a66('0x33')]),_0x104e25);if(_0x360102[_0x3a66('0x31')]['filter']){_0x48a85f[_0x3a66('0x3c')]=_[_0x3a66('0x3e')](_0x48a85f[_0x3a66('0x3c')],{'$or':_['map'](_0x104e25,function(_0xef8e7f){if(_0xef8e7f[_0x3a66('0x3f')]!==_0x3a66('0x40')){var _0x58aaee={};_0x58aaee[_0xef8e7f[_0x3a66('0x29')]]={'$like':'%'+_0x360102[_0x3a66('0x31')][_0x3a66('0x41')]+'%'};return _0x58aaee;}})});}_0x48a85f=_[_0x3a66('0x3e')]({},_0x48a85f,_0x360102[_0x3a66('0x42')]);var _0x109abe={'where':_0x48a85f[_0x3a66('0x3c')]};return db[_0x3a66('0x2c')][_0x3a66('0x1c')](_0x109abe)[_0x3a66('0x24')](function(_0x45983e){_0x4b758b[_0x3a66('0x1c')]=_0x45983e;if(_0x360102[_0x3a66('0x31')][_0x3a66('0x43')]){_0x48a85f[_0x3a66('0x44')]=[{'all':!![]}];}return db['Variable'][_0x3a66('0x45')](_0x48a85f);})[_0x3a66('0x24')](function(_0x3e4812){_0x4b758b[_0x3a66('0x46')]=_0x3e4812;return _0x4b758b;})[_0x3a66('0x24')](respondWithFilteredResult(_0x1b14c7,_0x48a85f))['catch'](handleError(_0x1b14c7,null));};exports[_0x3a66('0x47')]=function(_0x4671ae,_0x381bcf){var _0x106139={'raw':!![],'where':{'id':_0x4671ae[_0x3a66('0x48')]['id']}},_0xa1cb55={};_0xa1cb55['model']=_[_0x3a66('0x32')](db[_0x3a66('0x2c')][_0x3a66('0x2d')]);_0xa1cb55['query']=_[_0x3a66('0x32')](_0x4671ae[_0x3a66('0x31')]);_0xa1cb55['filters']=_[_0x3a66('0x34')](_0xa1cb55[_0x3a66('0x30')],_0xa1cb55[_0x3a66('0x31')]);_0x106139['attributes']=_[_0x3a66('0x34')](_0xa1cb55[_0x3a66('0x30')],qs[_0x3a66('0x36')](_0x4671ae['query']['fields']));_0x106139[_0x3a66('0x35')]=_0x106139[_0x3a66('0x35')][_0x3a66('0x37')]?_0x106139[_0x3a66('0x35')]:_0xa1cb55[_0x3a66('0x30')];if(_0x4671ae[_0x3a66('0x31')][_0x3a66('0x43')]){_0x106139[_0x3a66('0x44')]=[{'all':!![]}];}_0x106139=_[_0x3a66('0x3e')]({},_0x106139,_0x4671ae[_0x3a66('0x42')]);return db[_0x3a66('0x2c')][_0x3a66('0x49')](_0x106139)[_0x3a66('0x24')](handleEntityNotFound(_0x381bcf,null))[_0x3a66('0x24')](respondWithResult(_0x381bcf,null))[_0x3a66('0x4a')](handleError(_0x381bcf,null));};exports[_0x3a66('0x4b')]=function(_0x357eb7,_0x218417){return db[_0x3a66('0x2c')][_0x3a66('0x4b')](_0x357eb7[_0x3a66('0x4c')],{})[_0x3a66('0x24')](function(_0x139e27){var _0x17c0fa=_0x357eb7[_0x3a66('0x4d')][_0x3a66('0x4e')]({'plain':!![]});if(!_0x17c0fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17c0fa[_0x3a66('0x4f')]===_0x3a66('0x4d')){var _0x47770f=_0x139e27['get']({'plain':!![]});var _0x2d8bf8=_0x3a66('0x26');return db[_0x3a66('0x50')]['find']({'where':{'name':_0x2d8bf8,'userProfileId':_0x17c0fa[_0x3a66('0x51')]},'raw':!![]})[_0x3a66('0x24')](function(_0xc03c1a){if(_0xc03c1a&&_0xc03c1a[_0x3a66('0x52')]===0x0){return db[_0x3a66('0x27')]['create']({'name':_0x47770f[_0x3a66('0x29')],'resourceId':_0x47770f['id'],'type':_0xc03c1a[_0x3a66('0x29')],'sectionId':_0xc03c1a['id']},{})[_0x3a66('0x24')](function(){return _0x139e27;});}else{return _0x139e27;}})[_0x3a66('0x4a')](function(_0x1929dd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1929dd);throw _0x1929dd;});}return _0x139e27;})[_0x3a66('0x24')](respondWithResult(_0x218417,0xc9))['catch'](handleError(_0x218417,null));};exports[_0x3a66('0x23')]=function(_0x3a0cd7,_0x6acef8){if(_0x3a0cd7[_0x3a66('0x4c')]['id']){delete _0x3a0cd7[_0x3a66('0x4c')]['id'];}return db['Variable'][_0x3a66('0x49')]({'where':{'id':_0x3a0cd7[_0x3a66('0x48')]['id']}})['then'](handleEntityNotFound(_0x6acef8,null))[_0x3a66('0x24')](saveUpdates(_0x3a0cd7['body'],null))[_0x3a66('0x24')](respondWithResult(_0x6acef8,null))[_0x3a66('0x4a')](handleError(_0x6acef8,null));};exports[_0x3a66('0x25')]=function(_0x5e89ef,_0x451eca){return db[_0x3a66('0x2c')]['find']({'where':{'id':_0x5e89ef[_0x3a66('0x48')]['id']}})[_0x3a66('0x24')](handleEntityNotFound(_0x451eca,null))[_0x3a66('0x24')](removeEntity(_0x451eca,null))['catch'](handleError(_0x451eca,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 4f7b3d7..7ac01d0 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 _0xe3b5=['bluebird','request-promise','path','rimraf','./variable.attributes','exports','define','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x191c34,_0x1fa270){var _0x43433b=function(_0x3dd0ab){while(--_0x3dd0ab){_0x191c34['push'](_0x191c34['shift']());}};_0x43433b(++_0x1fa270);}(_0xe3b5,0xa4));var _0x5e3b=function(_0x2003f4,_0x31513c){_0x2003f4=_0x2003f4-0x0;var _0x372f05=_0xe3b5[_0x2003f4];return _0x372f05;};'use strict';var _=require(_0x5e3b('0x0'));var util=require(_0x5e3b('0x1'));var logger=require(_0x5e3b('0x2'))(_0x5e3b('0x3'));var moment=require(_0x5e3b('0x4'));var BPromise=require(_0x5e3b('0x5'));var rp=require(_0x5e3b('0x6'));var fs=require('fs');var path=require(_0x5e3b('0x7'));var rimraf=require(_0x5e3b('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e3b('0x9'));module[_0x5e3b('0xa')]=function(_0x1ce4b5,_0x23c905){return _0x1ce4b5[_0x5e3b('0xb')]('Variable',attributes,{'tableName':_0x5e3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8873=['path','rimraf','../../config/environment','exports','Variable','tools_variables','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x8873,0x17a));var _0x3887=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0x8873[_0x485f35];return _0x2ad118;};'use strict';var _=require('lodash');var util=require(_0x3887('0x0'));var logger=require(_0x3887('0x1'))(_0x3887('0x2'));var moment=require(_0x3887('0x3'));var BPromise=require(_0x3887('0x4'));var rp=require(_0x3887('0x5'));var fs=require('fs');var path=require(_0x3887('0x6'));var rimraf=require(_0x3887('0x7'));var config=require(_0x3887('0x8'));var attributes=require('./variable.attributes');module[_0x3887('0x9')]=function(_0x1be341,_0x70bd0a){return _0x1be341['define'](_0x3887('0xa'),attributes,{'tableName':_0x3887('0xb'),'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 34bd7ed..edcfb3e 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 _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xa41a,0x6b));var _0xaa41=function(_0x102b5f,_0x18b318){_0x102b5f=_0x102b5f-0x0;var _0x1ffa35=_0xa41a[_0x102b5f];return _0x1ffa35;};'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 +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0xe011f3,_0x5552b7){var _0x565d37=function(_0x2d5e06){while(--_0x2d5e06){_0xe011f3['push'](_0xe011f3['shift']());}};_0x565d37(++_0x5552b7);}(_0x6aa7,0x178));var _0x76aa=function(_0x868fd5,_0x2547b8){_0x868fd5=_0x868fd5-0x0;var _0x45d1eb=_0x6aa7[_0x868fd5];return _0x45d1eb;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index ac09636..5096dbf 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 _0x211a=['/fetch','isAuthenticated','/reset','canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations','./version.controller','index','get'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x211a,0x6d));var _0xa211=function(_0x2a3449,_0x529e1f){_0x2a3449=_0x2a3449-0x0;var _0x5c8b0a=_0x211a[_0x2a3449];return _0x5c8b0a;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xa211('0x0'));router['get']('/',controller[_0xa211('0x1')]);router[_0xa211('0x2')](_0xa211('0x3'),auth[_0xa211('0x4')](),auth['canUpdate'](),controller['fetch']);router[_0xa211('0x2')](_0xa211('0x5'),auth[_0xa211('0x4')](),auth[_0xa211('0x6')](),controller[_0xa211('0x7')]);router['get'](_0xa211('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xa211('0x9')]);router[_0xa211('0x2')](_0xa211('0xa'),auth[_0xa211('0x4')](),controller[_0xa211('0xb')]);router[_0xa211('0x2')](_0xa211('0xc'),controller[_0xa211('0xd')]);module['exports']=router; \ No newline at end of file +var _0xaa24=['../../components/auth/service','./version.controller','get','index','canUpdate','fetch','isAuthenticated','reset','pull','/restart','restart','/migrations','migrations','exports','Router'];(function(_0x27a887,_0x562706){var _0x15eb32=function(_0x5f8a8d){while(--_0x5f8a8d){_0x27a887['push'](_0x27a887['shift']());}};_0x15eb32(++_0x562706);}(_0xaa24,0x86));var _0x4aa2=function(_0x381360,_0x1d2eff){_0x381360=_0x381360-0x0;var _0x53a472=_0xaa24[_0x381360];return _0x53a472;};'use strict';var express=require('express');var router=express[_0x4aa2('0x0')]();var auth=require(_0x4aa2('0x1'));var controller=require(_0x4aa2('0x2'));router[_0x4aa2('0x3')]('/',controller[_0x4aa2('0x4')]);router[_0x4aa2('0x3')]('/fetch',auth['isAuthenticated'](),auth[_0x4aa2('0x5')](),controller[_0x4aa2('0x6')]);router['get']('/reset',auth[_0x4aa2('0x7')](),auth[_0x4aa2('0x5')](),controller[_0x4aa2('0x8')]);router[_0x4aa2('0x3')]('/pull',auth[_0x4aa2('0x7')](),auth[_0x4aa2('0x5')](),controller[_0x4aa2('0x9')]);router[_0x4aa2('0x3')](_0x4aa2('0xa'),auth[_0x4aa2('0x7')](),controller[_0x4aa2('0xb')]);router[_0x4aa2('0x3')](_0x4aa2('0xc'),controller[_0x4aa2('0xd')]);module[_0x4aa2('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 18c77aa..337ced5 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 _0xc3ce=['json','origin','info','git\x20fetch','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','.js','length','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.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','join','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/pm2','../../config/logger','update','root','index','query','latest','fetch','tags','exports','2.0.0','status'];(function(_0x5eac06,_0x3670e5){var _0x4ab829=function(_0x358fef){while(--_0x358fef){_0x5eac06['push'](_0x5eac06['shift']());}};_0x4ab829(++_0x3670e5);}(_0xc3ce,0xb5));var _0xec3c=function(_0x36780b,_0x2a8141){_0x36780b=_0x36780b-0x0;var _0x106975=_0xc3ce[_0x36780b];return _0x106975;};'use strict';var Umzug=require('umzug');var path=require(_0xec3c('0x0'));var fs=require('fs');var _=require(_0xec3c('0x1'));var pkginfo=require(_0xec3c('0x2'))(module,_0xec3c('0x3'));var compareVersions=require(_0xec3c('0x4'));var exec=require('child_process')[_0xec3c('0x5')];var db=require(_0xec3c('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xec3c('0x7'));var logger=require(_0xec3c('0x8'))(_0xec3c('0x9'));var git=require('simple-git')(config[_0xec3c('0xa')]);exports[_0xec3c('0xb')]=function(_0x420c7e,_0x21e2a2){var _0xe0d9a4={'current':module['exports'][_0xec3c('0x3')],'phonebar':0x2};if(_0x420c7e[_0xec3c('0xc')]&&_0x420c7e[_0xec3c('0xc')][_0xec3c('0xd')]){return git[_0xec3c('0xe')]()[_0xec3c('0xf')](function(_0x226c26,_0x395533){_0xe0d9a4[_0xec3c('0xd')]=(_0x226c26?module[_0xec3c('0x10')]['version']:_0x395533['latest'])||_0xec3c('0x11');return _0x21e2a2[_0xec3c('0x12')](0xc8)[_0xec3c('0x13')](_0xe0d9a4);});}else{return _0x21e2a2['status'](0xc8)[_0xec3c('0x13')](_0xe0d9a4);}};exports[_0xec3c('0xe')]=function(_0x36fea9,_0x4b65c6){return git['fetch']([_0xec3c('0x14'),'master'],function(_0x184832){if(_0x184832){logger['error'](_0x184832);return _0x4b65c6[_0xec3c('0x12')](0x1f4)[_0xec3c('0x13')](_0x184832);}logger[_0xec3c('0x15')](_0xec3c('0x16'));return _0x4b65c6['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x17aeb2,_0x234acf){return git['reset']([_0xec3c('0x17'),'FETCH_HEAD'],function(_0x4ba3a9){if(_0x4ba3a9){logger[_0xec3c('0x18')](_0x4ba3a9);return _0x234acf[_0xec3c('0x12')](0x1f4)[_0xec3c('0x13')](_0x4ba3a9);}logger[_0xec3c('0x15')](_0xec3c('0x19'));return _0x234acf[_0xec3c('0x12')](0xc8)['json']({'output':_0xec3c('0x1a')});});};exports['pull']=function(_0x6f7e77,_0x35c2d5){exec('npm\x20install\x20--production',function(_0x2d5d2b,_0x5145a2,_0x2cf193){logger['info'](_0x5145a2);logger[_0xec3c('0x15')](_0x2cf193);if(_0x2d5d2b){logger[_0xec3c('0x18')](_0x2d5d2b);return _0x35c2d5['status'](0x1f4)['json'](_0x2d5d2b);}return _0x35c2d5[_0xec3c('0x12')](0xc8)[_0xec3c('0x13')]({'output':_0x5145a2});});};exports[_0xec3c('0x1b')]=function(_0xc27b4d,_0x3ed9ca){return pm2[_0xec3c('0x1b')](_0xec3c('0x1c'))[_0xec3c('0x1d')](function(_0x4b414e){logger[_0xec3c('0x15')](_0xec3c('0x1e'),_0x4b414e);return _0x3ed9ca[_0xec3c('0x12')](0xc8)[_0xec3c('0x13')]({'output':_0xec3c('0x1f')});})[_0xec3c('0x20')](function(_0x96169b){logger['error'](_0x96169b);return _0x3ed9ca['status'](0x1f4)['json'](_0x96169b);});};exports[_0xec3c('0x21')]=function(_0xc59bd4,_0x51fd85){var _0x2252e9=fs[_0xec3c('0x22')](path['join'](config[_0xec3c('0xa')],'server',_0xec3c('0x21')));var _0x433607=[];for(var _0x1e7fa7=0x0;_0x1e7fa7<_0x2252e9['length'];_0x1e7fa7++){var _0x15ca42=_0x2252e9[_0x1e7fa7]['replace'](_0xec3c('0x23'),'');if(compareVersions(module[_0xec3c('0x10')][_0xec3c('0x3')],_0x15ca42)===-0x1){_0x433607['push'](_0x15ca42);}}if(_0x433607[_0xec3c('0x24')]){var _0x34e870=_0x433607[_0xec3c('0x25')](compareVersions);var _0x4ad1fb=new Umzug({'storage':_0xec3c('0x26'),'storageOptions':{'model':db[_0xec3c('0x27')],'modelName':'Migration','columnName':_0xec3c('0x3')},'migrations':{'params':[db[_0xec3c('0x26')][_0xec3c('0x28')](),db['sequelize'][_0xec3c('0x29')],function(){throw new Error(_0xec3c('0x2a'));}],'path':path['join'](config[_0xec3c('0xa')],_0xec3c('0x2b'),_0xec3c('0x21')),'pattern':/\.js$/}});_0x4ad1fb['up']({'migrations':_[_0xec3c('0x2c')](_0x34e870,function(_0x45d486){return _0x45d486+_0xec3c('0x23');})})['then'](function(){return _0x51fd85[_0xec3c('0x12')](0xc8)[_0xec3c('0x13')]({'output':_0xec3c('0x2d')+module[_0xec3c('0x10')][_0xec3c('0x3')]+_0xec3c('0x2e')+_['last'](_0x34e870),'migrations':_[_0xec3c('0x2f')](_0x34e870)});})[_0xec3c('0x20')](function(_0x491fdc){if(_0x491fdc instanceof db[_0xec3c('0x26')][_0xec3c('0x30')]){return _0x51fd85['status'](0xc8)[_0xec3c('0x13')]({'output':_0xec3c('0x31')});}else{return _0x51fd85[_0xec3c('0x12')](0x1f4)[_0xec3c('0x13')](_0x491fdc);}});}else{return _0x51fd85['status'](0xc8)[_0xec3c('0x13')]({'output':_0xec3c('0x31')});}}; \ No newline at end of file +var _0x7636=['sequelize','getQueryInterface','constructor','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','join','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../config/pm2','../../config/logger','simple-git','root','version','query','latest','tags','exports','status','json','fetch','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','.js','push','length'];(function(_0x1306f3,_0x1da761){var _0xc1c7bf=function(_0x1ca08e){while(--_0x1ca08e){_0x1306f3['push'](_0x1306f3['shift']());}};_0xc1c7bf(++_0x1da761);}(_0x7636,0xce));var _0x6763=function(_0x5454e2,_0x576f66){_0x5454e2=_0x5454e2-0x0;var _0x5b9409=_0x7636[_0x5454e2];return _0x5b9409;};'use strict';var Umzug=require(_0x6763('0x0'));var path=require(_0x6763('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x6763('0x2'))(module,'version');var compareVersions=require(_0x6763('0x3'));var exec=require(_0x6763('0x4'))[_0x6763('0x5')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x6763('0x6'));var logger=require(_0x6763('0x7'))('update');var git=require(_0x6763('0x8'))(config[_0x6763('0x9')]);exports['index']=function(_0x3c3893,_0x3f40a0){var _0x2ab461={'current':module['exports'][_0x6763('0xa')],'phonebar':0x2};if(_0x3c3893[_0x6763('0xb')]&&_0x3c3893[_0x6763('0xb')][_0x6763('0xc')]){return git['fetch']()[_0x6763('0xd')](function(_0x561145,_0x3c9482){_0x2ab461[_0x6763('0xc')]=(_0x561145?module[_0x6763('0xe')]['version']:_0x3c9482[_0x6763('0xc')])||'2.0.0';return _0x3f40a0[_0x6763('0xf')](0xc8)[_0x6763('0x10')](_0x2ab461);});}else{return _0x3f40a0[_0x6763('0xf')](0xc8)[_0x6763('0x10')](_0x2ab461);}};exports[_0x6763('0x11')]=function(_0x323f52,_0x116608){return git[_0x6763('0x11')]([_0x6763('0x12'),'master'],function(_0x4670cb){if(_0x4670cb){logger[_0x6763('0x13')](_0x4670cb);return _0x116608['status'](0x1f4)['json'](_0x4670cb);}logger[_0x6763('0x14')](_0x6763('0x15'));return _0x116608['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x6763('0x16')]=function(_0x563a36,_0x51b814){return git[_0x6763('0x16')]([_0x6763('0x17'),_0x6763('0x18')],function(_0xb481f8){if(_0xb481f8){logger[_0x6763('0x13')](_0xb481f8);return _0x51b814[_0x6763('0xf')](0x1f4)['json'](_0xb481f8);}logger[_0x6763('0x14')](_0x6763('0x19'));return _0x51b814['status'](0xc8)['json']({'output':_0x6763('0x1a')});});};exports[_0x6763('0x1b')]=function(_0x5f0268,_0x39c81b){exec('npm\x20install\x20--production',function(_0x5ce4a4,_0x523f85,_0x193649){logger[_0x6763('0x14')](_0x523f85);logger[_0x6763('0x14')](_0x193649);if(_0x5ce4a4){logger[_0x6763('0x13')](_0x5ce4a4);return _0x39c81b[_0x6763('0xf')](0x1f4)[_0x6763('0x10')](_0x5ce4a4);}return _0x39c81b[_0x6763('0xf')](0xc8)[_0x6763('0x10')]({'output':_0x523f85});});};exports[_0x6763('0x1c')]=function(_0x8ad8b4,_0x5a2ca9){return pm2[_0x6763('0x1c')]('motion2')[_0x6763('0x1d')](function(_0x695463){logger[_0x6763('0x14')](_0x6763('0x1e'),_0x695463);return _0x5a2ca9[_0x6763('0xf')](0xc8)['json']({'output':_0x6763('0x1f')});})[_0x6763('0x20')](function(_0x2c65d2){logger[_0x6763('0x13')](_0x2c65d2);return _0x5a2ca9[_0x6763('0xf')](0x1f4)['json'](_0x2c65d2);});};exports[_0x6763('0x21')]=function(_0xa8e52d,_0x40f5b0){var _0x5a5f83=fs[_0x6763('0x22')](path['join'](config[_0x6763('0x9')],_0x6763('0x23'),'migrations'));var _0x20ae04=[];for(var _0x4dfbe3=0x0;_0x4dfbe3<_0x5a5f83['length'];_0x4dfbe3++){var _0xc93c58=_0x5a5f83[_0x4dfbe3]['replace'](_0x6763('0x24'),'');if(compareVersions(module[_0x6763('0xe')][_0x6763('0xa')],_0xc93c58)===-0x1){_0x20ae04[_0x6763('0x25')](_0xc93c58);}}if(_0x20ae04[_0x6763('0x26')]){var _0x4ce21d=_0x20ae04['sort'](compareVersions);var _0x508295=new Umzug({'storage':_0x6763('0x27'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x6763('0xa')},'migrations':{'params':[db[_0x6763('0x27')][_0x6763('0x28')](),db['sequelize'][_0x6763('0x29')],function(){throw new Error(_0x6763('0x2a'));}],'path':path['join'](config[_0x6763('0x9')],_0x6763('0x23'),_0x6763('0x21')),'pattern':/\.js$/}});_0x508295['up']({'migrations':_[_0x6763('0x2b')](_0x4ce21d,function(_0x84c4c){return _0x84c4c+_0x6763('0x24');})})[_0x6763('0x1d')](function(){return _0x40f5b0[_0x6763('0xf')](0xc8)[_0x6763('0x10')]({'output':_0x6763('0x2c')+module[_0x6763('0xe')][_0x6763('0xa')]+_0x6763('0x2d')+_[_0x6763('0x2e')](_0x4ce21d),'migrations':_[_0x6763('0x2f')](_0x4ce21d)});})[_0x6763('0x20')](function(_0x45a43a){if(_0x45a43a instanceof db[_0x6763('0x27')]['UniqueConstraintError']){return _0x40f5b0[_0x6763('0xf')](0xc8)['json']({'output':_0x6763('0x30')});}else{return _0x40f5b0[_0x6763('0xf')](0x1f4)[_0x6763('0x10')](_0x45a43a);}});}else{return _0x40f5b0[_0x6763('0xf')](0xc8)[_0x6763('0x10')]({'output':_0x6763('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index de3f638..80d6cb1 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 _0xeeaa=['./voiceAgentReport.controller','get','index','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeeaa,0xac));var _0xaeea=function(_0x3175a1,_0x4948b5){_0x3175a1=_0x3175a1-0x0;var _0x3a4422=_0xeeaa[_0x3175a1];return _0x3a4422;};'use strict';var multer=require(_0xaeea('0x0'));var util=require(_0xaeea('0x1'));var path=require(_0xaeea('0x2'));var timeout=require('connect-timeout');var express=require(_0xaeea('0x3'));var router=express[_0xaeea('0x4')]();var fs_extra=require(_0xaeea('0x5'));var auth=require(_0xaeea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaeea('0x7'));var controller=require(_0xaeea('0x8'));router[_0xaeea('0x9')]('/',auth['isAuthenticated'](),controller[_0xaeea('0xa')]);router[_0xaeea('0x9')]('/describe',auth[_0xaeea('0xb')](),controller[_0xaeea('0xc')]);router['get']('/:id',auth[_0xaeea('0xb')](),controller[_0xaeea('0xd')]);router['post']('/',auth[_0xaeea('0xb')](),controller[_0xaeea('0xe')]);router[_0xaeea('0xf')](_0xaeea('0x10'),auth[_0xaeea('0xb')](),controller[_0xaeea('0x11')]);router[_0xaeea('0x12')](_0xaeea('0x10'),auth['isAuthenticated'](),controller[_0xaeea('0x13')]);module['exports']=router; \ No newline at end of file +var _0x35e6=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x425342,_0x1a39bc){var _0x6cd14b=function(_0x4cb6e3){while(--_0x4cb6e3){_0x425342['push'](_0x425342['shift']());}};_0x6cd14b(++_0x1a39bc);}(_0x35e6,0x179));var _0x635e=function(_0x44cc5c,_0x40ef3e){_0x44cc5c=_0x44cc5c-0x0;var _0x52b91c=_0x35e6[_0x44cc5c];return _0x52b91c;};'use strict';var multer=require(_0x635e('0x0'));var util=require(_0x635e('0x1'));var path=require('path');var timeout=require(_0x635e('0x2'));var express=require('express');var router=express[_0x635e('0x3')]();var fs_extra=require(_0x635e('0x4'));var auth=require(_0x635e('0x5'));var interaction=require(_0x635e('0x6'));var config=require(_0x635e('0x7'));var controller=require(_0x635e('0x8'));router[_0x635e('0x9')]('/',auth[_0x635e('0xa')](),controller[_0x635e('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x635e('0xc')]);router['get'](_0x635e('0xd'),auth['isAuthenticated'](),controller[_0x635e('0xe')]);router[_0x635e('0xf')]('/',auth['isAuthenticated'](),controller[_0x635e('0x10')]);router[_0x635e('0x11')](_0x635e('0xd'),auth[_0x635e('0xa')](),controller[_0x635e('0x12')]);router[_0x635e('0x13')](_0x635e('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x635e('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index a3b2a71..2b5caee 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 _0xfef3=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x5c977d,_0x178322){var _0x48e5df=function(_0x14250c){while(--_0x14250c){_0x5c977d['push'](_0x5c977d['shift']());}};_0x48e5df(++_0x178322);}(_0xfef3,0x118));var _0x3fef=function(_0x1d4c8e,_0x4e9cdf){_0x1d4c8e=_0x1d4c8e-0x0;var _0x532356=_0xfef3[_0x1d4c8e];return _0x532356;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'type':{'type':Sequelize[_0x3fef('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3fef('0x1')]},'calleridname':{'type':Sequelize[_0x3fef('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3fef('0x1')]},'membername':{'type':Sequelize[_0x3fef('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x3fef('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x3fef('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x3fef('0x2')]},'holdtime':{'type':Sequelize[_0x3fef('0x3')]},'agentcomplete':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3fef('0x3')]},'agentacw':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3fef('0x3')]},'reason':{'type':Sequelize[_0x3fef('0x1')]},'lastevent':{'type':Sequelize[_0x3fef('0x1')]},'channel':{'type':Sequelize[_0x3fef('0x1')]},'channelstate':{'type':Sequelize[_0x3fef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x3fef('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3fef('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3fef('0x1')]},'accountcode':{'type':Sequelize[_0x3fef('0x1')]},'context':{'type':Sequelize[_0x3fef('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3fef('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x3fef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3fef('0x1')]},'destcalleridnum':{'type':Sequelize[_0x3fef('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3fef('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x3fef('0x1')]},'destaccountcode':{'type':Sequelize[_0x3fef('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x3fef('0x1')]},'destpriority':{'type':Sequelize[_0x3fef('0x1')]},'destuniqueid':{'type':Sequelize[_0x3fef('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3fef('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x3fef('0x1')]},'transfer':{'type':Sequelize[_0x3fef('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3fef('0x5')},'transferexten':{'type':Sequelize[_0x3fef('0x1')]},'transferuniqueid':{'type':Sequelize[_0x3fef('0x1')]},'agententerreason':{'type':Sequelize[_0x3fef('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1399=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3d6e4c,_0x8879a2){var _0x42a887=function(_0x32ce16){while(--_0x32ce16){_0x3d6e4c['push'](_0x3d6e4c['shift']());}};_0x42a887(++_0x8879a2);}(_0x1399,0x16c));var _0x9139=function(_0x2af276,_0xb15ec5){_0x2af276=_0x2af276-0x0;var _0x4c586e=_0x1399[_0x2af276];return _0x4c586e;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9139('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9139('0x2')]},'queue':{'type':Sequelize[_0x9139('0x2')]},'interface':{'type':Sequelize[_0x9139('0x2')]},'membername':{'type':Sequelize[_0x9139('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9139('0x3')]},'agentconnectAt':{'type':Sequelize[_0x9139('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x9139('0x3')]},'holdtime':{'type':Sequelize[_0x9139('0x4')]},'agentcomplete':{'type':Sequelize[_0x9139('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9139('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9139('0x4')]},'reason':{'type':Sequelize[_0x9139('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9139('0x2')]},'channelstate':{'type':Sequelize[_0x9139('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x9139('0x2')]},'language':{'type':Sequelize[_0x9139('0x2')]},'accountcode':{'type':Sequelize[_0x9139('0x2')]},'context':{'type':Sequelize[_0x9139('0x2')]},'exten':{'type':Sequelize[_0x9139('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9139('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x9139('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9139('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9139('0x2')]},'destlanguage':{'type':Sequelize[_0x9139('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9139('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9139('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9139('0x2')]},'transfer':{'type':Sequelize[_0x9139('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9139('0x2')],'comment':_0x9139('0x6')},'transferexten':{'type':Sequelize[_0x9139('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'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 62555e9..58e5b4f 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(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_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 +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(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 b6effea..d50cca7 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 _0x5fd1=['exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5fd1,0x155));var _0x15fd=function(_0x231b21,_0x51b63a){_0x231b21=_0x231b21-0x0;var _0x4f9bd0=_0x5fd1[_0x231b21];return _0x4f9bd0;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./voiceAgentReport.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x15fd('0xa'),_0x15fd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb81=['define','report_agent','uniqueid','destuniqueid','lodash','util','api','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xcb81,0x154));var _0x1cb8=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xcb81[_0x255ac0];return _0x437bf1;};'use strict';var _=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var logger=require('../../config/logger')(_0x1cb8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb8('0x3'));var rimraf=require(_0x1cb8('0x4'));var config=require(_0x1cb8('0x5'));var attributes=require(_0x1cb8('0x6'));module[_0x1cb8('0x7')]=function(_0x4e5c19,_0x98d682){return _0x4e5c19[_0x1cb8('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x1cb8('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1cb8('0xa'),_0x1cb8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index f619c18..515f00a 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 _0x241f=['stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','catch','UpdateVoiceAgentReport','update','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x26a12e,_0x25d1b5){var _0x4a09d1=function(_0x258760){while(--_0x258760){_0x26a12e['push'](_0x26a12e['shift']());}};_0x4a09d1(++_0x25d1b5);}(_0x241f,0xb5));var _0xf241=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x241f[_0x46f3f8];return _0xbc57cd;};'use strict';var _=require(_0xf241('0x0'));var util=require(_0xf241('0x1'));var moment=require(_0xf241('0x2'));var BPromise=require(_0xf241('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf241('0x4'));var db=require(_0xf241('0x5'))['db'];var utils=require(_0xf241('0x6'));var logger=require(_0xf241('0x7'))(_0xf241('0x8'));var config=require(_0xf241('0x9'));var jayson=require(_0xf241('0xa'));var client=jayson['client'][_0xf241('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14c2d8,_0xb946c8,_0x9cde95){return new BPromise(function(_0x40c9d3,_0x50a74e){return client['request'](_0x14c2d8,_0x9cde95)[_0xf241('0xc')](function(_0x1ee607){logger[_0xf241('0xd')](_0xf241('0xe'),_0xb946c8,_0xf241('0xf'));logger['debug'](_0xf241('0x10'),_0xb946c8,_0xf241('0xf'),JSON[_0xf241('0x11')](_0x1ee607));if(_0x1ee607[_0xf241('0x12')]){if(_0x1ee607['error'][_0xf241('0x13')]===0x1f4){logger['error'](_0xf241('0xe'),_0xb946c8,_0x1ee607[_0xf241('0x12')][_0xf241('0x14')]);return _0x50a74e(_0x1ee607[_0xf241('0x12')]['message']);}logger[_0xf241('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0xb946c8,_0x1ee607['error'][_0xf241('0x14')]);return _0x40c9d3(_0x1ee607[_0xf241('0x12')][_0xf241('0x14')]);}else{logger['info'](_0xf241('0xe'),_0xb946c8,_0xf241('0xf'));_0x40c9d3(_0x1ee607[_0xf241('0x15')][_0xf241('0x14')]);}})['catch'](function(_0x215f4f){logger[_0xf241('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0xb946c8,_0x215f4f);_0x50a74e(_0x215f4f);});});}exports[_0xf241('0x16')]=function(_0x19f89b){var _0x3fe923=this;return new Promise(function(_0x4d70e7,_0xa3cdce){return db[_0xf241('0x17')][_0xf241('0x18')](_0x19f89b[_0xf241('0x19')],{'raw':_0x19f89b[_0xf241('0x1a')]?_0x19f89b[_0xf241('0x1a')][_0xf241('0x1b')]===undefined?!![]:![]:!![]})[_0xf241('0xc')](function(_0x5f4cf1){logger[_0xf241('0xd')](_0xf241('0x16'),_0x19f89b);logger[_0xf241('0x1c')]('CreateVoiceAgentReport',_0x19f89b,JSON['stringify'](_0x5f4cf1));_0x4d70e7(_0x5f4cf1);})[_0xf241('0x1d')](function(_0x2be1f0){logger['error'](_0xf241('0x16'),_0x2be1f0['message'],_0x19f89b);_0xa3cdce(_0x3fe923[_0xf241('0x12')](0x1f4,_0x2be1f0[_0xf241('0x14')]));});});};exports[_0xf241('0x1e')]=function(_0x5da6e5){var _0x2a70c0=this;return new Promise(function(_0x43fc49,_0x390e81){return db[_0xf241('0x17')][_0xf241('0x1f')](_0x5da6e5[_0xf241('0x19')],{'raw':_0x5da6e5['options']?_0x5da6e5[_0xf241('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5da6e5[_0xf241('0x1a')]?_0x5da6e5[_0xf241('0x1a')][_0xf241('0x20')]||null:null,'attributes':_0x5da6e5[_0xf241('0x1a')]?_0x5da6e5[_0xf241('0x1a')]['attributes']||null:null,'limit':_0x5da6e5['options']?_0x5da6e5[_0xf241('0x1a')]['limit']||null:null})['then'](function(_0x42fbac){logger[_0xf241('0xd')](_0xf241('0x1e'),_0x5da6e5);logger[_0xf241('0x1c')](_0xf241('0x1e'),_0x5da6e5,JSON[_0xf241('0x11')](_0x42fbac));_0x43fc49(_0x42fbac);})['catch'](function(_0x3edfe3){logger[_0xf241('0x12')](_0xf241('0x1e'),_0x3edfe3[_0xf241('0x14')],_0x5da6e5);_0x390e81(_0x2a70c0[_0xf241('0x12')](0x1f4,_0x3edfe3[_0xf241('0x14')]));});});}; \ No newline at end of file +var _0x18bf=['update','options','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','catch','UpdateVoiceAgentReport'];(function(_0x3d8d0a,_0x11bb87){var _0x5b9df5=function(_0x3ecba2){while(--_0x3ecba2){_0x3d8d0a['push'](_0x3d8d0a['shift']());}};_0x5b9df5(++_0x11bb87);}(_0x18bf,0x8c));var _0xf18b=function(_0x411c60,_0x32c701){_0x411c60=_0x411c60-0x0;var _0x59b3d3=_0x18bf[_0x411c60];return _0x59b3d3;};'use strict';var _=require(_0xf18b('0x0'));var util=require(_0xf18b('0x1'));var moment=require(_0xf18b('0x2'));var BPromise=require('bluebird');var rs=require(_0xf18b('0x3'));var fs=require('fs');var Redis=require(_0xf18b('0x4'));var db=require(_0xf18b('0x5'))['db'];var utils=require(_0xf18b('0x6'));var logger=require('../../config/logger')(_0xf18b('0x7'));var config=require(_0xf18b('0x8'));var jayson=require(_0xf18b('0x9'));var client=jayson[_0xf18b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ef14b,_0x1c31cf,_0x3a5929){return new BPromise(function(_0x329513,_0x2966b4){return client[_0xf18b('0xb')](_0x3ef14b,_0x3a5929)[_0xf18b('0xc')](function(_0x490a59){logger[_0xf18b('0xd')](_0xf18b('0xe'),_0x1c31cf,'request\x20sent');logger[_0xf18b('0xf')](_0xf18b('0x10'),_0x1c31cf,_0xf18b('0x11'),JSON[_0xf18b('0x12')](_0x490a59));if(_0x490a59[_0xf18b('0x13')]){if(_0x490a59[_0xf18b('0x13')][_0xf18b('0x14')]===0x1f4){logger[_0xf18b('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x1c31cf,_0x490a59[_0xf18b('0x13')]['message']);return _0x2966b4(_0x490a59['error'][_0xf18b('0x15')]);}logger[_0xf18b('0x13')](_0xf18b('0xe'),_0x1c31cf,_0x490a59[_0xf18b('0x13')][_0xf18b('0x15')]);return _0x329513(_0x490a59[_0xf18b('0x13')][_0xf18b('0x15')]);}else{logger['info'](_0xf18b('0xe'),_0x1c31cf,_0xf18b('0x11'));_0x329513(_0x490a59[_0xf18b('0x16')][_0xf18b('0x15')]);}})['catch'](function(_0x187224){logger[_0xf18b('0x13')](_0xf18b('0xe'),_0x1c31cf,_0x187224);_0x2966b4(_0x187224);});});}exports[_0xf18b('0x17')]=function(_0x1500d8){var _0x65fa78=this;return new Promise(function(_0x481c2f,_0x880907){return db[_0xf18b('0x18')][_0xf18b('0x19')](_0x1500d8[_0xf18b('0x1a')],{'raw':_0x1500d8['options']?_0x1500d8['options'][_0xf18b('0x1b')]===undefined?!![]:![]:!![]})[_0xf18b('0xc')](function(_0x49c938){logger[_0xf18b('0xd')](_0xf18b('0x17'),_0x1500d8);logger['debug'](_0xf18b('0x17'),_0x1500d8,JSON[_0xf18b('0x12')](_0x49c938));_0x481c2f(_0x49c938);})[_0xf18b('0x1c')](function(_0x2e29da){logger[_0xf18b('0x13')](_0xf18b('0x17'),_0x2e29da[_0xf18b('0x15')],_0x1500d8);_0x880907(_0x65fa78['error'](0x1f4,_0x2e29da[_0xf18b('0x15')]));});});};exports[_0xf18b('0x1d')]=function(_0x3f1785){var _0x1d4a18=this;return new Promise(function(_0xc18458,_0x145b41){return db[_0xf18b('0x18')][_0xf18b('0x1e')](_0x3f1785[_0xf18b('0x1a')],{'raw':_0x3f1785[_0xf18b('0x1f')]?_0x3f1785[_0xf18b('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f1785[_0xf18b('0x1f')]?_0x3f1785[_0xf18b('0x1f')][_0xf18b('0x20')]||null:null,'attributes':_0x3f1785[_0xf18b('0x1f')]?_0x3f1785[_0xf18b('0x1f')][_0xf18b('0x21')]||null:null,'limit':_0x3f1785[_0xf18b('0x1f')]?_0x3f1785['options']['limit']||null:null})['then'](function(_0x26d969){logger[_0xf18b('0xd')]('UpdateVoiceAgentReport',_0x3f1785);logger[_0xf18b('0xf')]('UpdateVoiceAgentReport',_0x3f1785,JSON['stringify'](_0x26d969));_0xc18458(_0x26d969);})[_0xf18b('0x1c')](function(_0x51a0ed){logger[_0xf18b('0x13')](_0xf18b('0x1d'),_0x51a0ed[_0xf18b('0x15')],_0x3f1785);_0x145b41(_0x1d4a18[_0xf18b('0x13')](0x1f4,_0x51a0ed[_0xf18b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 04eb3df..5b5cf88 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 _0x5fc3=['/:id','show','post','create','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe'];(function(_0x3d812c,_0x3a48d3){var _0x24564f=function(_0x1f197a){while(--_0x1f197a){_0x3d812c['push'](_0x3d812c['shift']());}};_0x24564f(++_0x3a48d3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x5fc3[_0x9b3efc];return _0x200f05;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6f47=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util'];(function(_0x2f8805,_0x2f1d21){var _0xa16375=function(_0x1c5bcc){while(--_0x1c5bcc){_0x2f8805['push'](_0x2f8805['shift']());}};_0xa16375(++_0x2f1d21);}(_0x6f47,0xc7));var _0x76f4=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x6f47[_0x34bc30];return _0x5706de;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f4('0x8')]);router[_0x76f4('0x7')](_0x76f4('0x9'),auth['isAuthenticated'](),controller[_0x76f4('0xa')]);router[_0x76f4('0x7')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76f4('0xe')]);router[_0x76f4('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x76f4('0x10')]);router[_0x76f4('0x11')](_0x76f4('0xb'),auth[_0x76f4('0xc')](),controller[_0x76f4('0x12')]);module[_0x76f4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 54967b3..ab6a403 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 _0xb51d=['STRING','TEXT','DATE','INTEGER','exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb51d,0x159));var _0xdb51=function(_0x1993a2,_0x5e7b4d){_0x1993a2=_0x1993a2-0x0;var _0x5a9e38=_0xb51d[_0x1993a2];return _0x5a9e38;};'use strict';var Sequelize=require('sequelize');module[_0xdb51('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdb51('0x1')](_0xdb51('0x2'),_0xdb51('0x3'),_0xdb51('0x4'),_0xdb51('0x5'),_0xdb51('0x6'),'dialer')},'tag':{'type':Sequelize[_0xdb51('0x7')]},'accountcode':{'type':Sequelize[_0xdb51('0x7')]},'source':{'type':Sequelize[_0xdb51('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xdb51('0x7')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xdb51('0x7')]},'lastdata':{'type':Sequelize[_0xdb51('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xdb51('0x9')]},'answertime':{'type':Sequelize[_0xdb51('0x9')]},'endtime':{'type':Sequelize[_0xdb51('0x9')]},'duration':{'type':Sequelize[_0xdb51('0xa')]},'billableseconds':{'type':Sequelize[_0xdb51('0xa')]},'mohtime':{'type':Sequelize[_0xdb51('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdb51('0x7')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xdb51('0x7')]},'userDisposition':{'type':Sequelize[_0xdb51('0x7')]},'userSecondDisposition':{'type':Sequelize[_0xdb51('0x7')]},'userThirdDisposition':{'type':Sequelize[_0xdb51('0x7')]},'note':{'type':Sequelize[_0xdb51('0x7')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xdb51('0xa')]},'sipcallid':{'type':Sequelize[_0xdb51('0x7')]}}; \ No newline at end of file +var _0x866a=['INTEGER','exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE'];(function(_0x28ca12,_0x4e023b){var _0x352f8b=function(_0x1fe854){while(--_0x1fe854){_0x28ca12['push'](_0x28ca12['shift']());}};_0x352f8b(++_0x4e023b);}(_0x866a,0x156));var _0xa866=function(_0x3c4856,_0x98f049){_0x3c4856=_0x3c4856-0x0;var _0xba2cac=_0x866a[_0x3c4856];return _0xba2cac;};'use strict';var Sequelize=require('sequelize');module[_0xa866('0x0')]={'uniqueid':{'type':Sequelize[_0xa866('0x1')]},'type':{'type':Sequelize[_0xa866('0x2')](_0xa866('0x3'),_0xa866('0x4'),'outbound',_0xa866('0x5'),_0xa866('0x6'),_0xa866('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa866('0x1')]},'source':{'type':Sequelize[_0xa866('0x1')]},'destination':{'type':Sequelize[_0xa866('0x1')]},'destinationcontext':{'type':Sequelize[_0xa866('0x1')]},'callerid':{'type':Sequelize[_0xa866('0x1')]},'channel':{'type':Sequelize[_0xa866('0x1')]},'destinationchannel':{'type':Sequelize[_0xa866('0x1')]},'lastapplication':{'type':Sequelize[_0xa866('0x1')]},'lastdata':{'type':Sequelize[_0xa866('0x8')]},'starttime':{'type':Sequelize[_0xa866('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xa866('0x9')]},'endtime':{'type':Sequelize[_0xa866('0x9')]},'duration':{'type':Sequelize[_0xa866('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa866('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa866('0x1')]},'amaflags':{'type':Sequelize[_0xa866('0x1')]},'userfield':{'type':Sequelize[_0xa866('0x1')]},'userDisposition':{'type':Sequelize[_0xa866('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xa866('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa866('0x1')]},'prefix':{'type':Sequelize[_0xa866('0x1')]},'routeid':{'type':Sequelize[_0xa866('0xa')]},'sipcallid':{'type':Sequelize[_0xa866('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index b89f631..2dd9a38 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 _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0xadb5,0xad));var _0x5adb=function(_0x43ffa5,_0x4b3113){_0x43ffa5=_0x43ffa5-0x0;var _0x345ea5=_0xadb5[_0x43ffa5];return _0x345ea5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +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(_0xb7aeab,_0x4954db){_0xb7aeab=_0xb7aeab-0x0;var _0x3a288b=_0x2032[_0xb7aeab];return _0x3a288b;};'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 diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 024870d..ce26ce6 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 _0x7689=['./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1040e7,_0x5b521a){var _0x18cef5=function(_0x34ccd4){while(--_0x34ccd4){_0x1040e7['push'](_0x1040e7['shift']());}};_0x18cef5(++_0x5b521a);}(_0x7689,0x1aa));var _0x9768=function(_0x5e2f6d,_0x4cc672){_0x5e2f6d=_0x5e2f6d-0x0;var _0x1b1b88=_0x7689[_0x5e2f6d];return _0x1b1b88;};'use strict';var _=require(_0x9768('0x0'));var util=require(_0x9768('0x1'));var logger=require(_0x9768('0x2'))('api');var moment=require(_0x9768('0x3'));var BPromise=require(_0x9768('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9768('0x5'));var rimraf=require(_0x9768('0x6'));var config=require(_0x9768('0x7'));var attributes=require(_0x9768('0x8'));module[_0x9768('0x9')]=function(_0x34ce5f,_0x41e49e){return _0x34ce5f[_0x9768('0xa')](_0x9768('0xb'),attributes,{'tableName':_0x9768('0xc'),'paranoid':![],'indexes':[{'fields':[_0x9768('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1652=['report_call','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x36d7ca,_0x40dea5){var _0x2f3c5d=function(_0x2ea642){while(--_0x2ea642){_0x36d7ca['push'](_0x36d7ca['shift']());}};_0x2f3c5d(++_0x40dea5);}(_0x1652,0x18a));var _0x2165=function(_0x209575,_0x417ae0){_0x209575=_0x209575-0x0;var _0x5b183d=_0x1652[_0x209575];return _0x5b183d;};'use strict';var _=require(_0x2165('0x0'));var util=require(_0x2165('0x1'));var logger=require(_0x2165('0x2'))(_0x2165('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2165('0x4'));var fs=require('fs');var path=require(_0x2165('0x5'));var rimraf=require(_0x2165('0x6'));var config=require(_0x2165('0x7'));var attributes=require(_0x2165('0x8'));module[_0x2165('0x9')]=function(_0x2e624e,_0x3d908a){return _0x2e624e[_0x2165('0xa')](_0x2165('0xb'),attributes,{'tableName':_0x2165('0xc'),'paranoid':![],'indexes':[{'fields':[_0x2165('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 191740b..5adaded 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 _0xf3f9=['../../config/utils','rpc','../../config/environment','client','http','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','then','info','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x496688,_0x2236bf){var _0x3caf1d=function(_0x3b9d76){while(--_0x3b9d76){_0x496688['push'](_0x496688['shift']());}};_0x3caf1d(++_0x2236bf);}(_0xf3f9,0xb8));var _0x9f3f=function(_0x28a0c4,_0x1ddea7){_0x28a0c4=_0x28a0c4-0x0;var _0x6c8fc0=_0xf3f9[_0x28a0c4];return _0x6c8fc0;};'use strict';var _=require(_0x9f3f('0x0'));var util=require(_0x9f3f('0x1'));var moment=require(_0x9f3f('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f3f('0x3'));var fs=require('fs');var Redis=require(_0x9f3f('0x4'));var db=require(_0x9f3f('0x5'))['db'];var utils=require(_0x9f3f('0x6'));var logger=require('../../config/logger')(_0x9f3f('0x7'));var config=require(_0x9f3f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9f3f('0x9')][_0x9f3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110018,_0x5c80f8,_0x69df71){return new BPromise(function(_0x10cbfb,_0xcf859c){return client[_0x9f3f('0xb')](_0x110018,_0x69df71)['then'](function(_0x7e5fc2){logger['info'](_0x9f3f('0xc'),_0x5c80f8,_0x9f3f('0xd'));logger[_0x9f3f('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5c80f8,'request\x20sent',JSON['stringify'](_0x7e5fc2));if(_0x7e5fc2[_0x9f3f('0xf')]){if(_0x7e5fc2[_0x9f3f('0xf')][_0x9f3f('0x10')]===0x1f4){logger[_0x9f3f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x5c80f8,_0x7e5fc2['error']['message']);return _0xcf859c(_0x7e5fc2[_0x9f3f('0xf')][_0x9f3f('0x11')]);}logger[_0x9f3f('0xf')](_0x9f3f('0xc'),_0x5c80f8,_0x7e5fc2[_0x9f3f('0xf')][_0x9f3f('0x11')]);return _0x10cbfb(_0x7e5fc2['error']['message']);}else{logger['info'](_0x9f3f('0xc'),_0x5c80f8,'request\x20sent');_0x10cbfb(_0x7e5fc2['result'][_0x9f3f('0x11')]);}})[_0x9f3f('0x12')](function(_0x52b4db){logger['error'](_0x9f3f('0xc'),_0x5c80f8,_0x52b4db);_0xcf859c(_0x52b4db);});});}exports[_0x9f3f('0x13')]=function(_0x3afba7){var _0x19620c=this;return new Promise(function(_0x25d65b,_0x13d6f6){return db[_0x9f3f('0x14')][_0x9f3f('0x15')]({'raw':_0x3afba7[_0x9f3f('0x16')]?_0x3afba7[_0x9f3f('0x16')][_0x9f3f('0x17')]===undefined?!![]:![]:!![],'where':_0x3afba7[_0x9f3f('0x16')]?_0x3afba7[_0x9f3f('0x16')]['where']||null:null,'attributes':_0x3afba7['options']?_0x3afba7[_0x9f3f('0x16')][_0x9f3f('0x18')]||null:null,'limit':_0x3afba7[_0x9f3f('0x16')]?_0x3afba7[_0x9f3f('0x16')][_0x9f3f('0x19')]||null:null,'include':_0x3afba7['options']?_0x3afba7[_0x9f3f('0x16')][_0x9f3f('0x1a')]?_[_0x9f3f('0x1b')](_0x3afba7[_0x9f3f('0x16')][_0x9f3f('0x1a')],function(_0x404d47){return{'model':db[_0x404d47['model']],'as':_0x404d47['as'],'attributes':_0x404d47[_0x9f3f('0x18')],'include':_0x404d47['include']?_[_0x9f3f('0x1b')](_0x404d47[_0x9f3f('0x1a')],function(_0x59bf6f){return{'model':db[_0x59bf6f['model']],'as':_0x59bf6f['as'],'attributes':_0x59bf6f['attributes'],'include':_0x59bf6f[_0x9f3f('0x1a')]?_[_0x9f3f('0x1b')](_0x59bf6f[_0x9f3f('0x1a')],function(_0x38def2){return{'model':db[_0x38def2[_0x9f3f('0x1c')]],'as':_0x38def2['as'],'attributes':_0x38def2['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f3f('0x1d')](function(_0x5ed5d0){logger[_0x9f3f('0x1e')](_0x9f3f('0x13'),_0x3afba7);logger[_0x9f3f('0xe')]('GetVoiceCallReport',_0x3afba7,JSON['stringify'](_0x5ed5d0));_0x25d65b(_0x5ed5d0);})[_0x9f3f('0x12')](function(_0x24b3e7){logger[_0x9f3f('0xf')](_0x9f3f('0x13'),_0x24b3e7[_0x9f3f('0x11')],_0x3afba7);_0x13d6f6(_0x19620c[_0x9f3f('0xf')](0x1f4,_0x24b3e7[_0x9f3f('0x11')]));});});};exports[_0x9f3f('0x1f')]=function(_0x87b7a0){var _0x5e30fe=this;return new Promise(function(_0x2d430a,_0x2c42e1){return db[_0x9f3f('0x14')][_0x9f3f('0x20')](_0x87b7a0[_0x9f3f('0x21')],{'raw':_0x87b7a0[_0x9f3f('0x16')]?_0x87b7a0[_0x9f3f('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x9f3f('0x1d')](function(_0x4c8208){logger['info']('CreateVoiceCallReport',_0x87b7a0);logger[_0x9f3f('0xe')](_0x9f3f('0x1f'),_0x87b7a0,JSON['stringify'](_0x4c8208));_0x2d430a(_0x4c8208);})[_0x9f3f('0x12')](function(_0x26d103){logger[_0x9f3f('0xf')](_0x9f3f('0x1f'),_0x26d103[_0x9f3f('0x11')],_0x87b7a0);_0x2c42e1(_0x5e30fe[_0x9f3f('0xf')](0x1f4,_0x26d103['message']));});});};exports[_0x9f3f('0x22')]=function(_0x3101ae){var _0x1b8232=this;return new Promise(function(_0x5618fa,_0x33ee06){return db[_0x9f3f('0x14')][_0x9f3f('0x23')](_0x3101ae['body'],{'raw':_0x3101ae[_0x9f3f('0x16')]?_0x3101ae['options'][_0x9f3f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3101ae[_0x9f3f('0x16')]?_0x3101ae[_0x9f3f('0x16')][_0x9f3f('0x24')]||null:null,'attributes':_0x3101ae['options']?_0x3101ae['options'][_0x9f3f('0x18')]||null:null,'limit':_0x3101ae['options']?_0x3101ae['options'][_0x9f3f('0x19')]||null:null})[_0x9f3f('0x1d')](function(_0x4a946b){logger['info'](_0x9f3f('0x22'),_0x3101ae);logger[_0x9f3f('0xe')]('UpdateVoiceCallReport',_0x3101ae,JSON[_0x9f3f('0x25')](_0x4a946b));_0x5618fa(_0x4a946b);})['catch'](function(_0x18ea4d){logger[_0x9f3f('0xf')](_0x9f3f('0x22'),_0x18ea4d['message'],_0x3101ae);_0x33ee06(_0x1b8232[_0x9f3f('0xf')](0x1f4,_0x18ea4d[_0x9f3f('0x11')]));});});}; \ No newline at end of file +var _0x7516=['error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','model','include','attributes','map','stringify','catch','CreateVoiceCallReport','create','UpdateVoiceCallReport','body','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0x7516,0x14d));var _0x6751=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x7516[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0x6751('0x0'));var util=require(_0x6751('0x1'));var moment=require(_0x6751('0x2'));var BPromise=require(_0x6751('0x3'));var rs=require(_0x6751('0x4'));var fs=require('fs');var Redis=require(_0x6751('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6751('0x6'));var logger=require('../../config/logger')(_0x6751('0x7'));var config=require(_0x6751('0x8'));var jayson=require(_0x6751('0x9'));var client=jayson[_0x6751('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aea82,_0x4610b4,_0x2fc5ce){return new BPromise(function(_0x3f1912,_0x34a334){return client[_0x6751('0xb')](_0x4aea82,_0x2fc5ce)[_0x6751('0xc')](function(_0x4acf5a){logger[_0x6751('0xd')](_0x6751('0xe'),_0x4610b4,_0x6751('0xf'));logger[_0x6751('0x10')](_0x6751('0x11'),_0x4610b4,'request\x20sent',JSON['stringify'](_0x4acf5a));if(_0x4acf5a[_0x6751('0x12')]){if(_0x4acf5a['error'][_0x6751('0x13')]===0x1f4){logger[_0x6751('0x12')](_0x6751('0xe'),_0x4610b4,_0x4acf5a['error'][_0x6751('0x14')]);return _0x34a334(_0x4acf5a[_0x6751('0x12')][_0x6751('0x14')]);}logger[_0x6751('0x12')](_0x6751('0xe'),_0x4610b4,_0x4acf5a[_0x6751('0x12')]['message']);return _0x3f1912(_0x4acf5a[_0x6751('0x12')][_0x6751('0x14')]);}else{logger[_0x6751('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x4610b4,'request\x20sent');_0x3f1912(_0x4acf5a[_0x6751('0x15')]['message']);}})['catch'](function(_0x4a8fa8){logger[_0x6751('0x12')](_0x6751('0xe'),_0x4610b4,_0x4a8fa8);_0x34a334(_0x4a8fa8);});});}exports[_0x6751('0x16')]=function(_0x153f03){var _0xf3110f=this;return new Promise(function(_0x351a5b,_0x3f206d){return db[_0x6751('0x17')][_0x6751('0x18')]({'raw':_0x153f03[_0x6751('0x19')]?_0x153f03[_0x6751('0x19')][_0x6751('0x1a')]===undefined?!![]:![]:!![],'where':_0x153f03[_0x6751('0x19')]?_0x153f03[_0x6751('0x19')][_0x6751('0x1b')]||null:null,'attributes':_0x153f03[_0x6751('0x19')]?_0x153f03[_0x6751('0x19')]['attributes']||null:null,'limit':_0x153f03[_0x6751('0x19')]?_0x153f03[_0x6751('0x19')]['limit']||null:null,'include':_0x153f03[_0x6751('0x19')]?_0x153f03[_0x6751('0x19')]['include']?_['map'](_0x153f03[_0x6751('0x19')]['include'],function(_0x516643){return{'model':db[_0x516643[_0x6751('0x1c')]],'as':_0x516643['as'],'attributes':_0x516643['attributes'],'include':_0x516643['include']?_['map'](_0x516643[_0x6751('0x1d')],function(_0x222b08){return{'model':db[_0x222b08[_0x6751('0x1c')]],'as':_0x222b08['as'],'attributes':_0x222b08[_0x6751('0x1e')],'include':_0x222b08[_0x6751('0x1d')]?_[_0x6751('0x1f')](_0x222b08[_0x6751('0x1d')],function(_0x6d80e0){return{'model':db[_0x6d80e0[_0x6751('0x1c')]],'as':_0x6d80e0['as'],'attributes':_0x6d80e0[_0x6751('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6751('0xc')](function(_0x1af6f3){logger['info'](_0x6751('0x16'),_0x153f03);logger['debug'](_0x6751('0x16'),_0x153f03,JSON[_0x6751('0x20')](_0x1af6f3));_0x351a5b(_0x1af6f3);})[_0x6751('0x21')](function(_0x43d264){logger[_0x6751('0x12')](_0x6751('0x16'),_0x43d264['message'],_0x153f03);_0x3f206d(_0xf3110f[_0x6751('0x12')](0x1f4,_0x43d264[_0x6751('0x14')]));});});};exports[_0x6751('0x22')]=function(_0x15d71c){var _0x4846ec=this;return new Promise(function(_0x534939,_0x2e719b){return db[_0x6751('0x17')][_0x6751('0x23')](_0x15d71c['body'],{'raw':_0x15d71c['options']?_0x15d71c[_0x6751('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x6751('0xc')](function(_0x58c03f){logger[_0x6751('0xd')](_0x6751('0x22'),_0x15d71c);logger[_0x6751('0x10')](_0x6751('0x22'),_0x15d71c,JSON[_0x6751('0x20')](_0x58c03f));_0x534939(_0x58c03f);})['catch'](function(_0x5558eb){logger[_0x6751('0x12')](_0x6751('0x22'),_0x5558eb[_0x6751('0x14')],_0x15d71c);_0x2e719b(_0x4846ec['error'](0x1f4,_0x5558eb[_0x6751('0x14')]));});});};exports[_0x6751('0x24')]=function(_0x486c9e){var _0x2e1700=this;return new Promise(function(_0x4da52e,_0x4ed5bc){return db[_0x6751('0x17')]['update'](_0x486c9e[_0x6751('0x25')],{'raw':_0x486c9e['options']?_0x486c9e[_0x6751('0x19')][_0x6751('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x486c9e['options']?_0x486c9e[_0x6751('0x19')]['where']||null:null,'attributes':_0x486c9e[_0x6751('0x19')]?_0x486c9e[_0x6751('0x19')]['attributes']||null:null,'limit':_0x486c9e[_0x6751('0x19')]?_0x486c9e[_0x6751('0x19')][_0x6751('0x26')]||null:null})[_0x6751('0xc')](function(_0x3a439d){logger[_0x6751('0xd')](_0x6751('0x24'),_0x486c9e);logger[_0x6751('0x10')](_0x6751('0x24'),_0x486c9e,JSON[_0x6751('0x20')](_0x3a439d));_0x4da52e(_0x3a439d);})[_0x6751('0x21')](function(_0x577c41){logger['error']('UpdateVoiceCallReport',_0x577c41[_0x6751('0x14')],_0x486c9e);_0x4ed5bc(_0x2e1700[_0x6751('0x12')](0x1f4,_0x577c41[_0x6751('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index fd93b92..52198b0 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 _0x9981=['fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','express','Router'];(function(_0x2cee99,_0x2f30f4){var _0x3f1eee=function(_0x2b793d){while(--_0x2b793d){_0x2cee99['push'](_0x2cee99['shift']());}};_0x3f1eee(++_0x2f30f4);}(_0x9981,0x189));var _0x1998=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x9981[_0x2283dc];return _0x16db90;};'use strict';var multer=require(_0x1998('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1998('0x1'));var router=express[_0x1998('0x2')]();var fs_extra=require(_0x1998('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1998('0x4'));var config=require(_0x1998('0x5'));var controller=require(_0x1998('0x6'));router[_0x1998('0x7')]('/',auth[_0x1998('0x8')](),controller[_0x1998('0x9')]);router[_0x1998('0x7')]('/:id',auth[_0x1998('0x8')](),controller[_0x1998('0xa')]);router[_0x1998('0xb')]('/',auth[_0x1998('0x8')](),controller[_0x1998('0xc')]);router[_0x1998('0xd')](_0x1998('0xe'),auth['isAuthenticated'](),controller[_0x1998('0xf')]);router['delete']('/:id',auth[_0x1998('0x8')](),controller[_0x1998('0x10')]);module[_0x1998('0x11')]=router; \ No newline at end of file +var _0x1c9a=['./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2418fc,_0x2c1342){var _0x2c27e6=function(_0x47ddee){while(--_0x47ddee){_0x2418fc['push'](_0x2418fc['shift']());}};_0x2c27e6(++_0x2c1342);}(_0x1c9a,0x124));var _0xa1c9=function(_0x1bc3ae,_0x3565ee){_0x1bc3ae=_0x1bc3ae-0x0;var _0x291de0=_0x1c9a[_0x1bc3ae];return _0x291de0;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var fs_extra=require(_0xa1c9('0x4'));var auth=require(_0xa1c9('0x5'));var interaction=require(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var controller=require(_0xa1c9('0x8'));router[_0xa1c9('0x9')]('/',auth[_0xa1c9('0xa')](),controller[_0xa1c9('0xb')]);router['get'](_0xa1c9('0xc'),auth[_0xa1c9('0xa')](),controller[_0xa1c9('0xd')]);router[_0xa1c9('0xe')]('/',auth['isAuthenticated'](),controller[_0xa1c9('0xf')]);router['put'](_0xa1c9('0xc'),auth[_0xa1c9('0xa')](),controller[_0xa1c9('0x10')]);router[_0xa1c9('0x11')](_0xa1c9('0xc'),auth[_0xa1c9('0xa')](),controller[_0xa1c9('0x12')]);module[_0xa1c9('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 8411e0a..cfe0c26 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 _0xeaf0=['sequelize','exports','STRING','name','setDataValue','options','getDataValue','BOOLEAN'];(function(_0x425a7b,_0x5b0072){var _0x3bad1f=function(_0x416852){while(--_0x416852){_0x425a7b['push'](_0x425a7b['shift']());}};_0x3bad1f(++_0x5b0072);}(_0xeaf0,0x100));var _0x0eaf=function(_0x47738f,_0x361629){_0x47738f=_0x47738f-0x0;var _0x2a9def=_0xeaf0[_0x47738f];return _0x2a9def;};'use strict';var Sequelize=require(_0x0eaf('0x0'));module[_0x0eaf('0x1')]={'name':{'type':Sequelize[_0x0eaf('0x2')]},'prefix':{'type':Sequelize[_0x0eaf('0x2')],'unique':_0x0eaf('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x2fe381){this[_0x0eaf('0x4')](_0x0eaf('0x5'),_0x2fe381?_0x2fe381['join'](''):[]);},'get':function(){return this[_0x0eaf('0x6')]('options')?this[_0x0eaf('0x6')](_0x0eaf('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x0eaf('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0eaf('0x2')]},'record':{'type':Sequelize[_0x0eaf('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0eaf('0x2')]},'description':{'type':Sequelize[_0x0eaf('0x2')]}}; \ No newline at end of file +var _0xe005=['options','join','getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue'];(function(_0x49ca87,_0x1ced49){var _0x513840=function(_0x285dcb){while(--_0x285dcb){_0x49ca87['push'](_0x49ca87['shift']());}};_0x513840(++_0x1ced49);}(_0xe005,0x85));var _0x5e00=function(_0x147074,_0x5571ca){_0x147074=_0x147074-0x0;var _0x18cc36=_0xe005[_0x147074];return _0x18cc36;};'use strict';var Sequelize=require(_0x5e00('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5e00('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x5e00('0x1')],'set':function(_0x5a10ce){this[_0x5e00('0x2')](_0x5e00('0x3'),_0x5a10ce?_0x5a10ce[_0x5e00('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x5e00('0x3'))?this[_0x5e00('0x5')]('options')[_0x5e00('0x6')](''):[];}},'auth':{'type':Sequelize[_0x5e00('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5e00('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index f90dff3..f50f679 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 _0xfb3f=['../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','name','send','VoiceChanSpy','rawAttributes','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','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/logger','api','../../config/utils'];(function(_0x323fd5,_0x331a2){var _0x280f21=function(_0x3b53ff){while(--_0x3b53ff){_0x323fd5['push'](_0x323fd5['shift']());}};_0x280f21(++_0x331a2);}(_0xfb3f,0xd9));var _0xffb3=function(_0x138493,_0x1fdade){_0x138493=_0x138493-0x0;var _0x228030=_0xfb3f[_0x138493];return _0x228030;};'use strict';var emlformat=require(_0xffb3('0x0'));var rimraf=require(_0xffb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffb3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffb3('0x3'));var Mustache=require('mustache');var util=require(_0xffb3('0x4'));var path=require(_0xffb3('0x5'));var sox=require(_0xffb3('0x6'));var csv=require(_0xffb3('0x7'));var ejs=require(_0xffb3('0x8'));var fs=require('fs');var fs_extra=require(_0xffb3('0x9'));var _=require(_0xffb3('0xa'));var squel=require(_0xffb3('0xb'));var crypto=require('crypto');var jsforce=require(_0xffb3('0xc'));var deskjs=require(_0xffb3('0xd'));var toCsv=require(_0xffb3('0x7'));var querystring=require(_0xffb3('0xe'));var Papa=require(_0xffb3('0xf'));var Redis=require('ioredis');var authService=require(_0xffb3('0x10'));var qs=require(_0xffb3('0x11'));var as=require(_0xffb3('0x12'));var hardwareService=require(_0xffb3('0x13'));var logger=require(_0xffb3('0x14'))(_0xffb3('0x15'));var utils=require(_0xffb3('0x16'));var config=require(_0xffb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffb3('0x18'))['db'];function respondWithStatusCode(_0x40c953,_0x55192c){_0x55192c=_0x55192c||0xcc;return function(_0x21924a){if(_0x21924a){return _0x40c953[_0xffb3('0x19')](_0x55192c);}return _0x40c953[_0xffb3('0x1a')](_0x55192c)[_0xffb3('0x1b')]();};}function respondWithResult(_0x65ef59,_0x420156){_0x420156=_0x420156||0xc8;return function(_0x19ce6e){if(_0x19ce6e){return _0x65ef59[_0xffb3('0x1a')](_0x420156)[_0xffb3('0x1c')](_0x19ce6e);}};}function respondWithFilteredResult(_0x3183bd,_0x38daab){return function(_0x2c3ef7){if(_0x2c3ef7){var _0x4d3c48=typeof _0x38daab[_0xffb3('0x1d')]===_0xffb3('0x1e')&&typeof _0x38daab[_0xffb3('0x1f')]==='undefined';var _0x51f3bb=_0x2c3ef7[_0xffb3('0x20')];var _0x167ed7=_0x4d3c48?0x0:_0x38daab['offset'];var _0x3b35de=_0x4d3c48?_0x2c3ef7[_0xffb3('0x20')]:_0x38daab[_0xffb3('0x1d')]+_0x38daab['limit'];var _0x2dfb40;if(_0x3b35de>=_0x51f3bb){_0x3b35de=_0x51f3bb;_0x2dfb40=0xc8;}else{_0x2dfb40=0xce;}_0x3183bd[_0xffb3('0x1a')](_0x2dfb40);return _0x3183bd['set'](_0xffb3('0x21'),_0x167ed7+'-'+_0x3b35de+'/'+_0x51f3bb)[_0xffb3('0x1c')](_0x2c3ef7);}return null;};}function patchUpdates(_0x223ad5){return function(_0x21c9ad){try{jsonpatch[_0xffb3('0x22')](_0x21c9ad,_0x223ad5,!![]);}catch(_0x46858f){return BPromise[_0xffb3('0x23')](_0x46858f);}return _0x21c9ad['save']();};}function saveUpdates(_0x473cff,_0xe4c60e){return function(_0x5e0f48){if(_0x5e0f48){return _0x5e0f48[_0xffb3('0x24')](_0x473cff)['then'](function(_0x5b707a){return _0x5b707a;});}return null;};}function removeEntity(_0x24c502,_0x3d55e6){return function(_0x22bbea){if(_0x22bbea){return _0x22bbea[_0xffb3('0x25')]()[_0xffb3('0x26')](function(){var _0x146708=_0x22bbea['get']({'plain':!![]});var _0x796b8e='ChanSpies';return db[_0xffb3('0x27')][_0xffb3('0x25')]({'where':{'type':_0x796b8e,'resourceId':_0x146708['id']}})['then'](function(){return _0x22bbea;});})[_0xffb3('0x26')](function(){_0x24c502['status'](0xcc)[_0xffb3('0x1b')]();});}};}function handleEntityNotFound(_0x148ad8,_0x45522c){return function(_0x6ba942){if(!_0x6ba942){_0x148ad8['sendStatus'](0x194);}return _0x6ba942;};}function handleError(_0x5f2f3e,_0x4a3b8c){_0x4a3b8c=_0x4a3b8c||0x1f4;return function(_0x52fc8c){logger[_0xffb3('0x28')](_0x52fc8c['stack']);if(_0x52fc8c[_0xffb3('0x29')]){delete _0x52fc8c[_0xffb3('0x29')];}_0x5f2f3e[_0xffb3('0x1a')](_0x4a3b8c)[_0xffb3('0x2a')](_0x52fc8c);};}exports['index']=function(_0x282f46,_0x42fa8e){var _0x4d544d={},_0x474d85={},_0x39ca38={'count':0x0,'rows':[]};var _0x266d7c=_['map'](db[_0xffb3('0x2b')][_0xffb3('0x2c')],function(_0x2b4bac){return{'name':_0x2b4bac['fieldName'],'type':_0x2b4bac[_0xffb3('0x2d')][_0xffb3('0x2e')]};});_0x474d85['model']=_[_0xffb3('0x2f')](_0x266d7c,_0xffb3('0x29'));_0x474d85[_0xffb3('0x30')]=_[_0xffb3('0x31')](_0x282f46[_0xffb3('0x30')]);_0x474d85['filters']=_[_0xffb3('0x32')](_0x474d85[_0xffb3('0x33')],_0x474d85[_0xffb3('0x30')]);_0x4d544d['attributes']=_[_0xffb3('0x32')](_0x474d85[_0xffb3('0x33')],qs['fields'](_0x282f46[_0xffb3('0x30')][_0xffb3('0x34')]));_0x4d544d['attributes']=_0x4d544d[_0xffb3('0x35')][_0xffb3('0x36')]?_0x4d544d['attributes']:_0x474d85['model'];if(!_0x282f46['query'][_0xffb3('0x37')](_0xffb3('0x38'))){_0x4d544d['limit']=qs[_0xffb3('0x1f')](_0x282f46['query'][_0xffb3('0x1f')]);_0x4d544d[_0xffb3('0x1d')]=qs['offset'](_0x282f46[_0xffb3('0x30')]['offset']);}_0x4d544d[_0xffb3('0x39')]=qs[_0xffb3('0x3a')](_0x282f46['query'][_0xffb3('0x3a')]);_0x4d544d[_0xffb3('0x3b')]=qs[_0xffb3('0x3c')](_[_0xffb3('0x3d')](_0x282f46[_0xffb3('0x30')],_0x474d85[_0xffb3('0x3c')]),_0x266d7c);if(_0x282f46[_0xffb3('0x30')][_0xffb3('0x3e')]){_0x4d544d[_0xffb3('0x3b')]=_[_0xffb3('0x3f')](_0x4d544d[_0xffb3('0x3b')],{'$or':_[_0xffb3('0x2f')](_0x266d7c,function(_0x2f8bc0){if(_0x2f8bc0['type']!==_0xffb3('0x40')){var _0x282431={};_0x282431[_0x2f8bc0[_0xffb3('0x29')]]={'$like':'%'+_0x282f46['query'][_0xffb3('0x3e')]+'%'};return _0x282431;}})});}_0x4d544d=_['merge']({},_0x4d544d,_0x282f46[_0xffb3('0x41')]);var _0x30cd19={'where':_0x4d544d['where']};return db[_0xffb3('0x2b')][_0xffb3('0x20')](_0x30cd19)['then'](function(_0x596af5){_0x39ca38[_0xffb3('0x20')]=_0x596af5;if(_0x282f46[_0xffb3('0x30')]['includeAll']){_0x4d544d[_0xffb3('0x42')]=[{'all':!![]}];}return db[_0xffb3('0x2b')][_0xffb3('0x43')](_0x4d544d);})[_0xffb3('0x26')](function(_0x2e8564){_0x39ca38['rows']=_0x2e8564;return _0x39ca38;})[_0xffb3('0x26')](respondWithFilteredResult(_0x42fa8e,_0x4d544d))[_0xffb3('0x44')](handleError(_0x42fa8e,null));};exports[_0xffb3('0x45')]=function(_0x40a691,_0x3d56d7){var _0x567883={'raw':![],'where':{'id':_0x40a691[_0xffb3('0x46')]['id']}},_0x5d1890={};_0x5d1890[_0xffb3('0x33')]=_['keys'](db[_0xffb3('0x2b')][_0xffb3('0x2c')]);_0x5d1890[_0xffb3('0x30')]=_[_0xffb3('0x31')](_0x40a691['query']);_0x5d1890['filters']=_[_0xffb3('0x32')](_0x5d1890[_0xffb3('0x33')],_0x5d1890[_0xffb3('0x30')]);_0x567883[_0xffb3('0x35')]=_[_0xffb3('0x32')](_0x5d1890[_0xffb3('0x33')],qs['fields'](_0x40a691[_0xffb3('0x30')]['fields']));_0x567883[_0xffb3('0x35')]=_0x567883[_0xffb3('0x35')][_0xffb3('0x36')]?_0x567883[_0xffb3('0x35')]:_0x5d1890['model'];if(_0x40a691['query'][_0xffb3('0x47')]){_0x567883['include']=[{'all':!![]}];}_0x567883=_[_0xffb3('0x3f')]({},_0x567883,_0x40a691[_0xffb3('0x41')]);return db[_0xffb3('0x2b')]['find'](_0x567883)[_0xffb3('0x26')](handleEntityNotFound(_0x3d56d7,null))[_0xffb3('0x26')](respondWithResult(_0x3d56d7,null))[_0xffb3('0x44')](handleError(_0x3d56d7,null));};exports[_0xffb3('0x48')]=function(_0x2f99ed,_0x4b0fd3){return db[_0xffb3('0x2b')][_0xffb3('0x48')](_0x2f99ed[_0xffb3('0x49')],{})['then'](function(_0x21e9e0){var _0x641c4e=_0x2f99ed[_0xffb3('0x4a')]['get']({'plain':!![]});if(!_0x641c4e)throw new Error(_0xffb3('0x4b'));if(_0x641c4e[_0xffb3('0x4c')]===_0xffb3('0x4a')){var _0x1c179c=_0x21e9e0['get']({'plain':!![]});var _0x525ecf='ChanSpies';return db['UserProfileSection'][_0xffb3('0x4d')]({'where':{'name':_0x525ecf,'userProfileId':_0x641c4e['userProfileId']},'raw':!![]})['then'](function(_0x763c1c){if(_0x763c1c&&_0x763c1c[_0xffb3('0x4e')]===0x0){return db[_0xffb3('0x27')][_0xffb3('0x48')]({'name':_0x1c179c[_0xffb3('0x29')],'resourceId':_0x1c179c['id'],'type':_0x763c1c[_0xffb3('0x29')],'sectionId':_0x763c1c['id']},{})[_0xffb3('0x26')](function(){return _0x21e9e0;});}else{return _0x21e9e0;}})['catch'](function(_0x29ba96){logger[_0xffb3('0x28')](_0xffb3('0x4f'),_0x29ba96);throw _0x29ba96;});}return _0x21e9e0;})[_0xffb3('0x26')](respondWithResult(_0x4b0fd3,0xc9))[_0xffb3('0x44')](handleError(_0x4b0fd3,null));};exports[_0xffb3('0x24')]=function(_0x4cf832,_0x99ff99){if(_0x4cf832[_0xffb3('0x49')]['id']){delete _0x4cf832['body']['id'];}return db['VoiceChanSpy'][_0xffb3('0x4d')]({'where':{'id':_0x4cf832['params']['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x99ff99,null))[_0xffb3('0x26')](saveUpdates(_0x4cf832[_0xffb3('0x49')],null))['then'](respondWithResult(_0x99ff99,null))['catch'](handleError(_0x99ff99,null));};exports['destroy']=function(_0x2ec815,_0x5d9bda){return db['VoiceChanSpy']['find']({'where':{'id':_0x2ec815[_0xffb3('0x46')]['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x5d9bda,null))[_0xffb3('0x26')](removeEntity(_0x5d9bda,null))['catch'](handleError(_0x5d9bda,null));}; \ No newline at end of file +var _0x1a5c=['then','destroy','ChanSpies','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','params','rawAttributes','length','includeAll','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update'];(function(_0x5482d1,_0x487514){var _0x4802ca=function(_0x46fe5a){while(--_0x46fe5a){_0x5482d1['push'](_0x5482d1['shift']());}};_0x4802ca(++_0x487514);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x1a5c[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0xc1a5('0x0'));var rimraf=require(_0xc1a5('0x1'));var zipdir=require(_0xc1a5('0x2'));var jsonpatch=require(_0xc1a5('0x3'));var rp=require(_0xc1a5('0x4'));var moment=require(_0xc1a5('0x5'));var BPromise=require(_0xc1a5('0x6'));var Mustache=require(_0xc1a5('0x7'));var util=require(_0xc1a5('0x8'));var path=require(_0xc1a5('0x9'));var sox=require('sox');var csv=require(_0xc1a5('0xa'));var ejs=require(_0xc1a5('0xb'));var fs=require('fs');var fs_extra=require(_0xc1a5('0xc'));var _=require(_0xc1a5('0xd'));var squel=require(_0xc1a5('0xe'));var crypto=require(_0xc1a5('0xf'));var jsforce=require(_0xc1a5('0x10'));var deskjs=require(_0xc1a5('0x11'));var toCsv=require('to-csv');var querystring=require(_0xc1a5('0x12'));var Papa=require(_0xc1a5('0x13'));var Redis=require('ioredis');var authService=require(_0xc1a5('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1a5('0x15'));var logger=require(_0xc1a5('0x16'))('api');var utils=require(_0xc1a5('0x17'));var config=require(_0xc1a5('0x18'));var licenseUtil=require(_0xc1a5('0x19'));var db=require(_0xc1a5('0x1a'))['db'];function respondWithStatusCode(_0x1fb066,_0x52fe6d){_0x52fe6d=_0x52fe6d||0xcc;return function(_0x428ccf){if(_0x428ccf){return _0x1fb066[_0xc1a5('0x1b')](_0x52fe6d);}return _0x1fb066[_0xc1a5('0x1c')](_0x52fe6d)[_0xc1a5('0x1d')]();};}function respondWithResult(_0x1aec58,_0x1dabb5){_0x1dabb5=_0x1dabb5||0xc8;return function(_0x24e513){if(_0x24e513){return _0x1aec58[_0xc1a5('0x1c')](_0x1dabb5)[_0xc1a5('0x1e')](_0x24e513);}};}function respondWithFilteredResult(_0x4fcced,_0x4b2590){return function(_0x1b2cfb){if(_0x1b2cfb){var _0xfdb88e=typeof _0x4b2590[_0xc1a5('0x1f')]==='undefined'&&typeof _0x4b2590[_0xc1a5('0x20')]===_0xc1a5('0x21');var _0x21faf9=_0x1b2cfb['count'];var _0x82766f=_0xfdb88e?0x0:_0x4b2590['offset'];var _0x294e92=_0xfdb88e?_0x1b2cfb[_0xc1a5('0x22')]:_0x4b2590[_0xc1a5('0x1f')]+_0x4b2590[_0xc1a5('0x20')];var _0xcbdda5;if(_0x294e92>=_0x21faf9){_0x294e92=_0x21faf9;_0xcbdda5=0xc8;}else{_0xcbdda5=0xce;}_0x4fcced[_0xc1a5('0x1c')](_0xcbdda5);return _0x4fcced[_0xc1a5('0x23')](_0xc1a5('0x24'),_0x82766f+'-'+_0x294e92+'/'+_0x21faf9)[_0xc1a5('0x1e')](_0x1b2cfb);}return null;};}function patchUpdates(_0x1f327c){return function(_0x45a3f5){try{jsonpatch[_0xc1a5('0x25')](_0x45a3f5,_0x1f327c,!![]);}catch(_0x6452c7){return BPromise[_0xc1a5('0x26')](_0x6452c7);}return _0x45a3f5['save']();};}function saveUpdates(_0xb93792,_0x12002d){return function(_0x4b424c){if(_0x4b424c){return _0x4b424c[_0xc1a5('0x27')](_0xb93792)[_0xc1a5('0x28')](function(_0x283599){return _0x283599;});}return null;};}function removeEntity(_0x2a8ee8,_0x232666){return function(_0x2e2351){if(_0x2e2351){return _0x2e2351[_0xc1a5('0x29')]()[_0xc1a5('0x28')](function(){var _0x4ba053=_0x2e2351['get']({'plain':!![]});var _0x2b19c5=_0xc1a5('0x2a');return db[_0xc1a5('0x2b')]['destroy']({'where':{'type':_0x2b19c5,'resourceId':_0x4ba053['id']}})[_0xc1a5('0x28')](function(){return _0x2e2351;});})['then'](function(){_0x2a8ee8['status'](0xcc)[_0xc1a5('0x1d')]();});}};}function handleEntityNotFound(_0x41f861,_0x20c65b){return function(_0x33ea9a){if(!_0x33ea9a){_0x41f861['sendStatus'](0x194);}return _0x33ea9a;};}function handleError(_0x47f09f,_0x4f3f99){_0x4f3f99=_0x4f3f99||0x1f4;return function(_0x1fa511){logger['error'](_0x1fa511[_0xc1a5('0x2c')]);if(_0x1fa511['name']){delete _0x1fa511[_0xc1a5('0x2d')];}_0x47f09f[_0xc1a5('0x1c')](_0x4f3f99)[_0xc1a5('0x2e')](_0x1fa511);};}exports[_0xc1a5('0x2f')]=function(_0x52653d,_0x4d7542){var _0x20eb2d={},_0x5e50a7={},_0x167fcb={'count':0x0,'rows':[]};var _0xdca8bd=_[_0xc1a5('0x30')](db[_0xc1a5('0x31')]['rawAttributes'],function(_0x4dbf2f){return{'name':_0x4dbf2f[_0xc1a5('0x32')],'type':_0x4dbf2f[_0xc1a5('0x33')][_0xc1a5('0x34')]};});_0x5e50a7[_0xc1a5('0x35')]=_[_0xc1a5('0x30')](_0xdca8bd,_0xc1a5('0x2d'));_0x5e50a7[_0xc1a5('0x36')]=_[_0xc1a5('0x37')](_0x52653d[_0xc1a5('0x36')]);_0x5e50a7[_0xc1a5('0x38')]=_[_0xc1a5('0x39')](_0x5e50a7[_0xc1a5('0x35')],_0x5e50a7[_0xc1a5('0x36')]);_0x20eb2d[_0xc1a5('0x3a')]=_['intersection'](_0x5e50a7[_0xc1a5('0x35')],qs[_0xc1a5('0x3b')](_0x52653d[_0xc1a5('0x36')][_0xc1a5('0x3b')]));_0x20eb2d[_0xc1a5('0x3a')]=_0x20eb2d[_0xc1a5('0x3a')]['length']?_0x20eb2d[_0xc1a5('0x3a')]:_0x5e50a7[_0xc1a5('0x35')];if(!_0x52653d[_0xc1a5('0x36')][_0xc1a5('0x3c')]('nolimit')){_0x20eb2d[_0xc1a5('0x20')]=qs[_0xc1a5('0x20')](_0x52653d[_0xc1a5('0x36')]['limit']);_0x20eb2d['offset']=qs[_0xc1a5('0x1f')](_0x52653d[_0xc1a5('0x36')]['offset']);}_0x20eb2d[_0xc1a5('0x3d')]=qs['sort'](_0x52653d['query'][_0xc1a5('0x3e')]);_0x20eb2d[_0xc1a5('0x3f')]=qs[_0xc1a5('0x38')](_[_0xc1a5('0x40')](_0x52653d[_0xc1a5('0x36')],_0x5e50a7['filters']),_0xdca8bd);if(_0x52653d[_0xc1a5('0x36')][_0xc1a5('0x41')]){_0x20eb2d[_0xc1a5('0x3f')]=_[_0xc1a5('0x42')](_0x20eb2d['where'],{'$or':_[_0xc1a5('0x30')](_0xdca8bd,function(_0xe28eff){if(_0xe28eff[_0xc1a5('0x33')]!==_0xc1a5('0x43')){var _0x46180a={};_0x46180a[_0xe28eff[_0xc1a5('0x2d')]]={'$like':'%'+_0x52653d[_0xc1a5('0x36')]['filter']+'%'};return _0x46180a;}})});}_0x20eb2d=_['merge']({},_0x20eb2d,_0x52653d[_0xc1a5('0x44')]);var _0x32ea6a={'where':_0x20eb2d[_0xc1a5('0x3f')]};return db[_0xc1a5('0x31')][_0xc1a5('0x22')](_0x32ea6a)[_0xc1a5('0x28')](function(_0x2f3c62){_0x167fcb[_0xc1a5('0x22')]=_0x2f3c62;if(_0x52653d['query']['includeAll']){_0x20eb2d['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0xc1a5('0x45')](_0x20eb2d);})[_0xc1a5('0x28')](function(_0x169aa7){_0x167fcb['rows']=_0x169aa7;return _0x167fcb;})[_0xc1a5('0x28')](respondWithFilteredResult(_0x4d7542,_0x20eb2d))['catch'](handleError(_0x4d7542,null));};exports['show']=function(_0x536f30,_0xb2c3b){var _0x26af58={'raw':![],'where':{'id':_0x536f30[_0xc1a5('0x46')]['id']}},_0x19b43f={};_0x19b43f[_0xc1a5('0x35')]=_[_0xc1a5('0x37')](db['VoiceChanSpy'][_0xc1a5('0x47')]);_0x19b43f[_0xc1a5('0x36')]=_[_0xc1a5('0x37')](_0x536f30[_0xc1a5('0x36')]);_0x19b43f[_0xc1a5('0x38')]=_[_0xc1a5('0x39')](_0x19b43f['model'],_0x19b43f[_0xc1a5('0x36')]);_0x26af58[_0xc1a5('0x3a')]=_[_0xc1a5('0x39')](_0x19b43f[_0xc1a5('0x35')],qs['fields'](_0x536f30['query'][_0xc1a5('0x3b')]));_0x26af58['attributes']=_0x26af58['attributes'][_0xc1a5('0x48')]?_0x26af58[_0xc1a5('0x3a')]:_0x19b43f['model'];if(_0x536f30[_0xc1a5('0x36')][_0xc1a5('0x49')]){_0x26af58['include']=[{'all':!![]}];}_0x26af58=_[_0xc1a5('0x42')]({},_0x26af58,_0x536f30['options']);return db[_0xc1a5('0x31')][_0xc1a5('0x4a')](_0x26af58)['then'](handleEntityNotFound(_0xb2c3b,null))[_0xc1a5('0x28')](respondWithResult(_0xb2c3b,null))[_0xc1a5('0x4b')](handleError(_0xb2c3b,null));};exports[_0xc1a5('0x4c')]=function(_0x6a9a49,_0x336523){return db[_0xc1a5('0x31')][_0xc1a5('0x4c')](_0x6a9a49['body'],{})[_0xc1a5('0x28')](function(_0x4b0141){var _0x2390e4=_0x6a9a49[_0xc1a5('0x4d')][_0xc1a5('0x4e')]({'plain':!![]});if(!_0x2390e4)throw new Error(_0xc1a5('0x4f'));if(_0x2390e4['role']===_0xc1a5('0x4d')){var _0x102664=_0x4b0141['get']({'plain':!![]});var _0x359e47=_0xc1a5('0x2a');return db['UserProfileSection'][_0xc1a5('0x4a')]({'where':{'name':_0x359e47,'userProfileId':_0x2390e4[_0xc1a5('0x50')]},'raw':!![]})['then'](function(_0x3973c8){if(_0x3973c8&&_0x3973c8[_0xc1a5('0x51')]===0x0){return db[_0xc1a5('0x2b')][_0xc1a5('0x4c')]({'name':_0x102664[_0xc1a5('0x2d')],'resourceId':_0x102664['id'],'type':_0x3973c8[_0xc1a5('0x2d')],'sectionId':_0x3973c8['id']},{})[_0xc1a5('0x28')](function(){return _0x4b0141;});}else{return _0x4b0141;}})['catch'](function(_0xabe7be){logger[_0xc1a5('0x52')](_0xc1a5('0x53'),_0xabe7be);throw _0xabe7be;});}return _0x4b0141;})['then'](respondWithResult(_0x336523,0xc9))[_0xc1a5('0x4b')](handleError(_0x336523,null));};exports[_0xc1a5('0x27')]=function(_0x5405b3,_0x5bac8){if(_0x5405b3[_0xc1a5('0x54')]['id']){delete _0x5405b3['body']['id'];}return db[_0xc1a5('0x31')]['find']({'where':{'id':_0x5405b3[_0xc1a5('0x46')]['id']}})[_0xc1a5('0x28')](handleEntityNotFound(_0x5bac8,null))[_0xc1a5('0x28')](saveUpdates(_0x5405b3[_0xc1a5('0x54')],null))[_0xc1a5('0x28')](respondWithResult(_0x5bac8,null))[_0xc1a5('0x4b')](handleError(_0x5bac8,null));};exports[_0xc1a5('0x29')]=function(_0x5ed9f0,_0x5e333b){return db['VoiceChanSpy'][_0xc1a5('0x4a')]({'where':{'id':_0x5ed9f0[_0xc1a5('0x46')]['id']}})[_0xc1a5('0x28')](handleEntityNotFound(_0x5e333b,null))['then'](removeEntity(_0x5e333b,null))[_0xc1a5('0x4b')](handleError(_0x5e333b,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d1c9f23..3d3e892 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 _0x2dc6=['concat','User','findAll','agent','then','catch','models','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','record','StopMixMonitor','length','internal','name'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2dc6,0x1ad));var _0x62dc=function(_0x1498fb,_0x111d3b){_0x1498fb=_0x1498fb-0x0;var _0x59ad93=_0x2dc6[_0x1498fb];return _0x59ad93;};'use strict';var _=require(_0x62dc('0x0'));var util=require(_0x62dc('0x1'));var BPromise=require(_0x62dc('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x6250f8,_0x11413f,_0x7f8812){var _0xeb92d5=0x1;var _0x336b4b=[];var _0x4b5ed2={'context':_0x11413f[_0x62dc('0x3')]||_0x62dc('0x4'),'exten':util[_0x62dc('0x5')](_0x62dc('0x6'),_0x6250f8[_0x62dc('0x7')],_0x7f8812),'type':_0x62dc('0x8'),'isApp':![],'ChanSpyId':_0x6250f8['id'],'UserId':_0x11413f['id']};_0x336b4b[_0x62dc('0x9')](_[_0x62dc('0xa')]({'app':_0x62dc('0xb'),'appdata':util['format'](_0x62dc('0xc'),'chanspy'),'priority':_0xeb92d5++},_0x4b5ed2));if(_0x6250f8['record']){_0x336b4b[_0x62dc('0x9')](_[_0x62dc('0xa')]({'app':_0x62dc('0xd'),'appdata':util[_0x62dc('0x5')](_0x62dc('0xe'),_0x6250f8[_0x62dc('0xf')]),'priority':_0xeb92d5++},_0x4b5ed2));}if(_0x6250f8['auth']){_0x336b4b[_0x62dc('0x9')](_[_0x62dc('0xa')]({'app':_0x62dc('0x10'),'appdata':_0x6250f8[_0x62dc('0x11')],'priority':_0xeb92d5++},_0x4b5ed2));}_0x336b4b['push'](_['merge']({'app':_0x62dc('0x12'),'appdata':util['format'](_0x62dc('0x13'),_0x11413f['name'],_0x6250f8[_0x62dc('0x14')]?_0x6250f8[_0x62dc('0x14')][_0x62dc('0x15')](''):''),'priority':_0xeb92d5++},_0x4b5ed2));if(_0x6250f8[_0x62dc('0x16')]){_0x336b4b[_0x62dc('0x9')](_[_0x62dc('0xa')]({'app':_0x62dc('0x17'),'priority':_0xeb92d5++},_0x4b5ed2));}return _0x336b4b;};var getChanSpyApplications=function(_0x441070,_0x4e3d80){var _0x54e577=[];for(var _0x325fc2=0x0,_0x617d66=0x1;_0x325fc2<_0x4e3d80[_0x62dc('0x18')];_0x325fc2++,_0x617d66=0x1){_0x54e577=_0x54e577['concat'](getUserApplications(_0x441070,_0x4e3d80[_0x325fc2],_0x4e3d80[_0x325fc2][_0x62dc('0x19')]));if(_0x4e3d80[_0x325fc2][_0x62dc('0x19')]!=_0x4e3d80[_0x325fc2][_0x62dc('0x1a')]){_0x54e577=_0x54e577[_0x62dc('0x1b')](getUserApplications(_0x441070,_0x4e3d80[_0x325fc2],_0x4e3d80[_0x325fc2][_0x62dc('0x1a')]));}}return _0x54e577;};var getChanSpyPromise=function(_0x5db062,_0x41a16c){return new BPromise(function(_0x17de6d,_0x35c2e8){return _0x5db062[_0x62dc('0x1c')][_0x62dc('0x1d')]({'attributes':['id',_0x62dc('0x1a'),'internal'],'where':{'role':_0x62dc('0x1e'),'chanspy':!![]},'raw':!![]})[_0x62dc('0x1f')](function(_0x1ee00d){if(_0x1ee00d){return _0x17de6d(getChanSpyApplications(_0x41a16c,_0x1ee00d));}return _0x17de6d([]);})[_0x62dc('0x20')](function(_0xff6f58){_0x35c2e8(_0xff6f58);});});};module['exports']=function(_0x2fa489,_0x4abcc3){var _0x265001=_0x2fa489[_0x62dc('0x21')];return _0x2fa489['define'](_0x62dc('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x18be64,_0x2af00e,_0x2e25ba){return getChanSpyPromise(_0x265001,_0x18be64)[_0x62dc('0x1f')](function(_0x2580f6){if(_0x2580f6&&_0x2580f6[_0x62dc('0x18')]){return _0x265001[_0x62dc('0x23')][_0x62dc('0x24')](_0x2580f6);}})[_0x62dc('0x1f')](function(){_0x2e25ba();})[_0x62dc('0x20')](function(_0x1c2933){_0x2e25ba(_0x1c2933);});},'afterUpdate':function(_0xf538ec,_0x563f6d,_0x10c571){return _0x265001['VoiceExtension'][_0x62dc('0x25')]({'where':{'ChanSpyId':_0xf538ec['id']}})[_0x62dc('0x1f')](function(){return getChanSpyPromise(_0x265001,_0xf538ec);})['then'](function(_0x28e00f){if(_0x28e00f&&_0x28e00f[_0x62dc('0x18')]){return _0x265001[_0x62dc('0x23')][_0x62dc('0x24')](_0x28e00f);}})[_0x62dc('0x1f')](function(){_0x10c571();})['catch'](function(_0x413c1f){_0x10c571(_0x413c1f);});},'afterDestroy':function(_0x33f919,_0x1bcf37,_0x290fd9){return _0x265001[_0x62dc('0x23')][_0x62dc('0x25')]({'where':{'ChanSpyId':_0x33f919['id']}})[_0x62dc('0x1f')](function(){_0x290fd9();})[_0x62dc('0x20')](function(_0x140b41){_0x290fd9(_0x140b41);});}}});}; \ No newline at end of file +var _0x184d=['bulkCreate','catch','destroy','lodash','bluebird','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','then','exports','define','VoiceChanSpy','VoiceExtension'];(function(_0x303e7f,_0x1ed1b5){var _0x5c07fd=function(_0x9dc3df){while(--_0x9dc3df){_0x303e7f['push'](_0x303e7f['shift']());}};_0x5c07fd(++_0x1ed1b5);}(_0x184d,0x135));var _0xd184=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x184d[_0x38537f];return _0x141e23;};'use strict';var _=require(_0xd184('0x0'));var util=require('util');var BPromise=require(_0xd184('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2afd22,_0x1a4412,_0x256fbd){var _0x46e075=0x1;var _0xd8e9c4=[];var _0x1f82d9={'context':_0x1a4412[_0xd184('0x2')]||_0xd184('0x3'),'exten':util[_0xd184('0x4')](_0xd184('0x5'),_0x2afd22[_0xd184('0x6')],_0x256fbd),'type':_0xd184('0x7'),'isApp':![],'ChanSpyId':_0x2afd22['id'],'UserId':_0x1a4412['id']};_0xd8e9c4[_0xd184('0x8')](_[_0xd184('0x9')]({'app':_0xd184('0xa'),'appdata':util['format'](_0xd184('0xb'),_0xd184('0xc')),'priority':_0x46e075++},_0x1f82d9));if(_0x2afd22[_0xd184('0xd')]){_0xd8e9c4[_0xd184('0x8')](_[_0xd184('0x9')]({'app':'MixMonitor','appdata':util[_0xd184('0x4')]('${UNIQUEID}.%s,a',_0x2afd22[_0xd184('0xe')]),'priority':_0x46e075++},_0x1f82d9));}if(_0x2afd22[_0xd184('0xf')]){_0xd8e9c4[_0xd184('0x8')](_[_0xd184('0x9')]({'app':'Authenticate','appdata':_0x2afd22[_0xd184('0x10')],'priority':_0x46e075++},_0x1f82d9));}_0xd8e9c4[_0xd184('0x8')](_[_0xd184('0x9')]({'app':_0xd184('0x11'),'appdata':util[_0xd184('0x4')](_0xd184('0x12'),_0x1a4412[_0xd184('0x13')],_0x2afd22[_0xd184('0x14')]?_0x2afd22[_0xd184('0x14')][_0xd184('0x15')](''):''),'priority':_0x46e075++},_0x1f82d9));if(_0x2afd22[_0xd184('0xd')]){_0xd8e9c4[_0xd184('0x8')](_[_0xd184('0x9')]({'app':'StopMixMonitor','priority':_0x46e075++},_0x1f82d9));}return _0xd8e9c4;};var getChanSpyApplications=function(_0x1c6e86,_0x32f90b){var _0x4c296f=[];for(var _0x58e84d=0x0,_0x8c168d=0x1;_0x58e84d<_0x32f90b[_0xd184('0x16')];_0x58e84d++,_0x8c168d=0x1){_0x4c296f=_0x4c296f[_0xd184('0x17')](getUserApplications(_0x1c6e86,_0x32f90b[_0x58e84d],_0x32f90b[_0x58e84d][_0xd184('0x18')]));if(_0x32f90b[_0x58e84d][_0xd184('0x18')]!=_0x32f90b[_0x58e84d][_0xd184('0x13')]){_0x4c296f=_0x4c296f['concat'](getUserApplications(_0x1c6e86,_0x32f90b[_0x58e84d],_0x32f90b[_0x58e84d][_0xd184('0x13')]));}}return _0x4c296f;};var getChanSpyPromise=function(_0x3935e0,_0x3063a0){return new BPromise(function(_0x722567,_0x4cbd1b){return _0x3935e0[_0xd184('0x19')]['findAll']({'attributes':['id',_0xd184('0x13'),_0xd184('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xd184('0x1a')](function(_0x51e75f){if(_0x51e75f){return _0x722567(getChanSpyApplications(_0x3063a0,_0x51e75f));}return _0x722567([]);})['catch'](function(_0x2a951b){_0x4cbd1b(_0x2a951b);});});};module[_0xd184('0x1b')]=function(_0x37808f,_0x21eeec){var _0x48330c=_0x37808f['models'];return _0x37808f[_0xd184('0x1c')](_0xd184('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x226672,_0x50d69c,_0x517dd7){return getChanSpyPromise(_0x48330c,_0x226672)[_0xd184('0x1a')](function(_0x287efc){if(_0x287efc&&_0x287efc['length']){return _0x48330c[_0xd184('0x1e')][_0xd184('0x1f')](_0x287efc);}})[_0xd184('0x1a')](function(){_0x517dd7();})[_0xd184('0x20')](function(_0x2b4565){_0x517dd7(_0x2b4565);});},'afterUpdate':function(_0x53aff1,_0x5f08a5,_0x637616){return _0x48330c['VoiceExtension'][_0xd184('0x21')]({'where':{'ChanSpyId':_0x53aff1['id']}})['then'](function(){return getChanSpyPromise(_0x48330c,_0x53aff1);})[_0xd184('0x1a')](function(_0x579aa8){if(_0x579aa8&&_0x579aa8[_0xd184('0x16')]){return _0x48330c['VoiceExtension'][_0xd184('0x1f')](_0x579aa8);}})[_0xd184('0x1a')](function(){_0x637616();})['catch'](function(_0x3e0298){_0x637616(_0x3e0298);});},'afterDestroy':function(_0x533908,_0x2e503c,_0x436824){return _0x48330c['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x533908['id']}})['then'](function(){_0x436824();})[_0xd184('0x20')](function(_0xf78f16){_0x436824(_0xf78f16);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a7d8f12..96949ea 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 _0x6b20=['request','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xcdfa63,_0x164017){var _0x430e83=function(_0x2dc273){while(--_0x2dc273){_0xcdfa63['push'](_0xcdfa63['shift']());}};_0x430e83(++_0x164017);}(_0x6b20,0xd1));var _0x06b2=function(_0x124f6d,_0xa6bf89){_0x124f6d=_0x124f6d-0x0;var _0x55c9fa=_0x6b20[_0x124f6d];return _0x55c9fa;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});} \ No newline at end of file +var _0xdace=['request\x20sent','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xdace,0xc5));var _0xedac=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xdace[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 21e7c97..18a9ff2 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 _0x3eae=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x51caab,_0x5f09b1){var _0x2072fb=function(_0x29bb4b){while(--_0x29bb4b){_0x51caab['push'](_0x51caab['shift']());}};_0x2072fb(++_0x5f09b1);}(_0x3eae,0x189));var _0xe3ea=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x3eae[_0x2d364e];return _0x1b9312;};'use strict';var multer=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var path=require(_0xe3ea('0x2'));var timeout=require('connect-timeout');var express=require(_0xe3ea('0x3'));var router=express[_0xe3ea('0x4')]();var fs_extra=require(_0xe3ea('0x5'));var auth=require(_0xe3ea('0x6'));var interaction=require(_0xe3ea('0x7'));var config=require(_0xe3ea('0x8'));var controller=require(_0xe3ea('0x9'));router[_0xe3ea('0xa')]('/',auth[_0xe3ea('0xb')](),controller[_0xe3ea('0xc')]);router[_0xe3ea('0xa')](_0xe3ea('0xd'),auth['isAuthenticated'](),controller[_0xe3ea('0xe')]);router[_0xe3ea('0xf')]('/',auth[_0xe3ea('0xb')](),controller[_0xe3ea('0x10')]);router[_0xe3ea('0x11')](_0xe3ea('0xd'),auth[_0xe3ea('0xb')](),controller[_0xe3ea('0x12')]);router['delete'](_0xe3ea('0xd'),auth[_0xe3ea('0xb')](),controller[_0xe3ea('0x13')]);module[_0xe3ea('0x14')]=router; \ No newline at end of file +var _0x2346=['isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0x2346,0x1b8));var _0x6234=function(_0x202aa2,_0x584b66){_0x202aa2=_0x202aa2-0x0;var _0x4e8000=_0x2346[_0x202aa2];return _0x4e8000;};'use strict';var multer=require(_0x6234('0x0'));var util=require(_0x6234('0x1'));var path=require(_0x6234('0x2'));var timeout=require(_0x6234('0x3'));var express=require(_0x6234('0x4'));var router=express[_0x6234('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6234('0x6'));var interaction=require(_0x6234('0x7'));var config=require(_0x6234('0x8'));var controller=require('./voiceContext.controller');router[_0x6234('0x9')]('/',auth[_0x6234('0xa')](),controller[_0x6234('0xb')]);router[_0x6234('0x9')](_0x6234('0xc'),auth['isAuthenticated'](),controller[_0x6234('0xd')]);router[_0x6234('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6234('0xf')]);router['delete'](_0x6234('0xc'),auth[_0x6234('0xa')](),controller[_0x6234('0x10')]);module[_0x6234('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 2d53fa3..8c4e2d5 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 _0x3c9f=['sequelize','exports','STRING','name'];(function(_0x1e67cf,_0xf55ab7){var _0x3a6869=function(_0x5ee7e7){while(--_0x5ee7e7){_0x1e67cf['push'](_0x1e67cf['shift']());}};_0x3a6869(++_0xf55ab7);}(_0x3c9f,0x1c8));var _0xf3c9=function(_0x28c445,_0x7f326c){_0x28c445=_0x28c445-0x0;var _0x752c98=_0x3c9f[_0x28c445];return _0x752c98;};'use strict';var Sequelize=require(_0xf3c9('0x0'));module[_0xf3c9('0x1')]={'name':{'type':Sequelize[_0xf3c9('0x2')],'unique':_0xf3c9('0x3')},'description':{'type':Sequelize[_0xf3c9('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xce9e=['exports','STRING','BOOLEAN','sequelize'];(function(_0xe05e9a,_0xd16e7c){var _0x15061b=function(_0x56c238){while(--_0x56c238){_0xe05e9a['push'](_0xe05e9a['shift']());}};_0x15061b(++_0xd16e7c);}(_0xce9e,0x87));var _0xece9=function(_0x7c7a41,_0x11a170){_0x7c7a41=_0x7c7a41-0x0;var _0x5c09d3=_0xce9e[_0x7c7a41];return _0x5c09d3;};'use strict';var Sequelize=require(_0xece9('0x0'));module[_0xece9('0x1')]={'name':{'type':Sequelize[_0xece9('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xece9('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xece9('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 fd70eb9..136dbd7 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 _0xda1f=['bluebird','mustache','util','path','sox','to-csv','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/environment','../../mysqldb','request','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','VoiceContext','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','length','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','/etc/asterisk/extensions_xcally_contexts.conf','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x550e6d,_0x240265){var _0x4494af=function(_0x4b803c){while(--_0x4b803c){_0x550e6d['push'](_0x550e6d['shift']());}};_0x4494af(++_0x240265);}(_0xda1f,0x1a3));var _0xfda1=function(_0x523c9e,_0x3727ea){_0x523c9e=_0x523c9e-0x0;var _0x3d4be0=_0xda1f[_0x523c9e];return _0x3d4be0;};'use strict';var emlformat=require(_0xfda1('0x0'));var rimraf=require(_0xfda1('0x1'));var zipdir=require(_0xfda1('0x2'));var jsonpatch=require(_0xfda1('0x3'));var rp=require(_0xfda1('0x4'));var moment=require('moment');var BPromise=require(_0xfda1('0x5'));var Mustache=require(_0xfda1('0x6'));var util=require(_0xfda1('0x7'));var path=require(_0xfda1('0x8'));var sox=require(_0xfda1('0x9'));var csv=require(_0xfda1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfda1('0xb'));var _=require(_0xfda1('0xc'));var squel=require(_0xfda1('0xd'));var crypto=require(_0xfda1('0xe'));var jsforce=require(_0xfda1('0xf'));var deskjs=require(_0xfda1('0x10'));var toCsv=require(_0xfda1('0xa'));var querystring=require('querystring');var Papa=require(_0xfda1('0x11'));var Redis=require(_0xfda1('0x12'));var authService=require(_0xfda1('0x13'));var qs=require(_0xfda1('0x14'));var as=require(_0xfda1('0x15'));var hardwareService=require(_0xfda1('0x16'));var logger=require(_0xfda1('0x17'))(_0xfda1('0x18'));var utils=require('../../config/utils');var config=require(_0xfda1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xfda1('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48c5b7,_0x26abf0,_0x26cf0a,_0x323919){return new BPromise(function(_0x9baca4,_0x3e34e7){var _0x18afc8=_0x323919||client;return _0x18afc8[_0xfda1('0x1b')](_0x48c5b7,_0x26cf0a)['then'](function(_0x19af71){logger[_0xfda1('0x1c')](_0xfda1('0x1d'),_0x26abf0,'request\x20sent');logger[_0xfda1('0x1e')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x26abf0,_0xfda1('0x1f'),JSON[_0xfda1('0x20')](_0x19af71));if(_0x19af71[_0xfda1('0x21')]){if(_0x19af71[_0xfda1('0x21')][_0xfda1('0x22')]===0x1f4){logger[_0xfda1('0x21')](_0xfda1('0x1d'),_0x26abf0,_0x19af71[_0xfda1('0x21')][_0xfda1('0x23')]);return _0x3e34e7(_0x19af71[_0xfda1('0x21')]['message']);}logger[_0xfda1('0x21')](_0xfda1('0x1d'),_0x26abf0,_0x19af71[_0xfda1('0x21')][_0xfda1('0x23')]);return _0x9baca4(_0x19af71[_0xfda1('0x21')][_0xfda1('0x23')]);}else{logger[_0xfda1('0x1c')](_0xfda1('0x1d'),_0x26abf0,_0xfda1('0x1f'));_0x9baca4(_0x19af71[_0xfda1('0x24')][_0xfda1('0x23')]);}})[_0xfda1('0x25')](function(_0x4c80ad){logger['error']('VoiceContext,\x20%s,\x20%s',_0x26abf0,_0x4c80ad);_0x3e34e7(_0x4c80ad);});});}function respondWithStatusCode(_0x41c28c,_0x101088){_0x101088=_0x101088||0xcc;return function(_0xe16232){if(_0xe16232){return _0x41c28c[_0xfda1('0x26')](_0x101088);}return _0x41c28c[_0xfda1('0x27')](_0x101088)['end']();};}function respondWithResult(_0xa4da2f,_0x4e8a40){_0x4e8a40=_0x4e8a40||0xc8;return function(_0x34f148){if(_0x34f148){return _0xa4da2f[_0xfda1('0x27')](_0x4e8a40)[_0xfda1('0x28')](_0x34f148);}};}function respondWithFilteredResult(_0x3bb69a,_0x411a30){return function(_0x5f7c69){if(_0x5f7c69){var _0x49b502=typeof _0x411a30['offset']==='undefined'&&typeof _0x411a30[_0xfda1('0x29')]===_0xfda1('0x2a');var _0xe185=_0x5f7c69[_0xfda1('0x2b')];var _0x5807bf=_0x49b502?0x0:_0x411a30[_0xfda1('0x2c')];var _0x3a8634=_0x49b502?_0x5f7c69[_0xfda1('0x2b')]:_0x411a30[_0xfda1('0x2c')]+_0x411a30['limit'];var _0x2fd49f;if(_0x3a8634>=_0xe185){_0x3a8634=_0xe185;_0x2fd49f=0xc8;}else{_0x2fd49f=0xce;}_0x3bb69a[_0xfda1('0x27')](_0x2fd49f);return _0x3bb69a[_0xfda1('0x2d')](_0xfda1('0x2e'),_0x5807bf+'-'+_0x3a8634+'/'+_0xe185)['json'](_0x5f7c69);}return null;};}function patchUpdates(_0x4bce2c){return function(_0x36a6e4){try{jsonpatch[_0xfda1('0x2f')](_0x36a6e4,_0x4bce2c,!![]);}catch(_0x53061f){return BPromise[_0xfda1('0x30')](_0x53061f);}return _0x36a6e4[_0xfda1('0x31')]();};}function saveUpdates(_0x4769c7,_0x53b1e9){return function(_0x14449c){if(_0x14449c){return _0x14449c[_0xfda1('0x32')](_0x4769c7)[_0xfda1('0x33')](function(_0xd2b34a){return _0xd2b34a;});}return null;};}function removeEntity(_0x5d2501,_0x5e5659){return function(_0x433c5d){if(_0x433c5d){return _0x433c5d[_0xfda1('0x34')]()[_0xfda1('0x33')](function(){var _0x4a9724=_0x433c5d[_0xfda1('0x35')]({'plain':!![]});var _0x5e6d69='Contexts';return db[_0xfda1('0x36')][_0xfda1('0x34')]({'where':{'type':_0x5e6d69,'resourceId':_0x4a9724['id']}})['then'](function(){return _0x433c5d;});})['then'](function(){_0x5d2501[_0xfda1('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c4031,_0x4f9ed2){return function(_0x323263){if(!_0x323263){_0x5c4031[_0xfda1('0x26')](0x194);}return _0x323263;};}function handleError(_0x3fd885,_0x3f96d7){_0x3f96d7=_0x3f96d7||0x1f4;return function(_0x18c8ef){logger[_0xfda1('0x21')](_0x18c8ef[_0xfda1('0x37')]);if(_0x18c8ef['name']){delete _0x18c8ef[_0xfda1('0x38')];}_0x3fd885[_0xfda1('0x27')](_0x3f96d7)[_0xfda1('0x39')](_0x18c8ef);};}exports[_0xfda1('0x3a')]=function(_0x43aa91,_0x267628){var _0x4c59d6={},_0x434a92={},_0x54f903={'count':0x0,'rows':[]};var _0x443ea2=_['map'](db[_0xfda1('0x3b')]['rawAttributes'],function(_0x3596b4){return{'name':_0x3596b4[_0xfda1('0x3c')],'type':_0x3596b4[_0xfda1('0x3d')][_0xfda1('0x3e')]};});_0x434a92[_0xfda1('0x3f')]=_[_0xfda1('0x40')](_0x443ea2,_0xfda1('0x38'));_0x434a92[_0xfda1('0x41')]=_[_0xfda1('0x42')](_0x43aa91[_0xfda1('0x41')]);_0x434a92[_0xfda1('0x43')]=_['intersection'](_0x434a92['model'],_0x434a92[_0xfda1('0x41')]);_0x4c59d6[_0xfda1('0x44')]=_[_0xfda1('0x45')](_0x434a92[_0xfda1('0x3f')],qs[_0xfda1('0x46')](_0x43aa91[_0xfda1('0x41')]['fields']));_0x4c59d6[_0xfda1('0x44')]=_0x4c59d6[_0xfda1('0x44')]['length']?_0x4c59d6[_0xfda1('0x44')]:_0x434a92[_0xfda1('0x3f')];if(!_0x43aa91['query']['hasOwnProperty'](_0xfda1('0x47'))){_0x4c59d6['limit']=qs['limit'](_0x43aa91[_0xfda1('0x41')][_0xfda1('0x29')]);_0x4c59d6[_0xfda1('0x2c')]=qs['offset'](_0x43aa91[_0xfda1('0x41')]['offset']);}_0x4c59d6[_0xfda1('0x48')]=qs[_0xfda1('0x49')](_0x43aa91[_0xfda1('0x41')][_0xfda1('0x49')]);_0x4c59d6[_0xfda1('0x4a')]=qs[_0xfda1('0x43')](_['pick'](_0x43aa91[_0xfda1('0x41')],_0x434a92['filters']),_0x443ea2);if(_0x43aa91[_0xfda1('0x41')][_0xfda1('0x4b')]){_0x4c59d6[_0xfda1('0x4a')]=_[_0xfda1('0x4c')](_0x4c59d6['where'],{'$or':_['map'](_0x443ea2,function(_0x5907e2){if(_0x5907e2[_0xfda1('0x3d')]!==_0xfda1('0x4d')){var _0x5cf618={};_0x5cf618[_0x5907e2[_0xfda1('0x38')]]={'$like':'%'+_0x43aa91[_0xfda1('0x41')][_0xfda1('0x4b')]+'%'};return _0x5cf618;}})});}_0x4c59d6=_[_0xfda1('0x4c')]({},_0x4c59d6,_0x43aa91[_0xfda1('0x4e')]);var _0x2e3478={'where':_0x4c59d6['where']};return db['VoiceContext'][_0xfda1('0x2b')](_0x2e3478)[_0xfda1('0x33')](function(_0x21aba5){_0x54f903['count']=_0x21aba5;if(_0x43aa91[_0xfda1('0x41')][_0xfda1('0x4f')]){_0x4c59d6[_0xfda1('0x50')]=[{'all':!![]}];}return db['VoiceContext'][_0xfda1('0x51')](_0x4c59d6);})[_0xfda1('0x33')](function(_0x21bb8a){_0x54f903[_0xfda1('0x52')]=_0x21bb8a;return _0x54f903;})[_0xfda1('0x33')](respondWithFilteredResult(_0x267628,_0x4c59d6))[_0xfda1('0x25')](handleError(_0x267628,null));};exports['show']=function(_0x475511,_0x40c23e){var _0x478986={'raw':![],'where':{'id':_0x475511['params']['id']}},_0x56aefd={};_0x56aefd[_0xfda1('0x3f')]=_[_0xfda1('0x42')](db[_0xfda1('0x3b')][_0xfda1('0x53')]);_0x56aefd[_0xfda1('0x41')]=_[_0xfda1('0x42')](_0x475511[_0xfda1('0x41')]);_0x56aefd[_0xfda1('0x43')]=_[_0xfda1('0x45')](_0x56aefd[_0xfda1('0x3f')],_0x56aefd['query']);_0x478986[_0xfda1('0x44')]=_[_0xfda1('0x45')](_0x56aefd[_0xfda1('0x3f')],qs['fields'](_0x475511[_0xfda1('0x41')][_0xfda1('0x46')]));_0x478986[_0xfda1('0x44')]=_0x478986[_0xfda1('0x44')][_0xfda1('0x54')]?_0x478986[_0xfda1('0x44')]:_0x56aefd[_0xfda1('0x3f')];if(_0x475511[_0xfda1('0x41')]['includeAll']){_0x478986[_0xfda1('0x50')]=[{'all':!![]}];}_0x478986=_[_0xfda1('0x4c')]({},_0x478986,_0x475511[_0xfda1('0x4e')]);return db[_0xfda1('0x3b')][_0xfda1('0x55')](_0x478986)['then'](handleEntityNotFound(_0x40c23e,null))[_0xfda1('0x33')](respondWithResult(_0x40c23e,null))[_0xfda1('0x25')](handleError(_0x40c23e,null));};exports['create']=function(_0x17a127,_0xb3b404,_0x27a28b){var _0x4249ae;return db['VoiceContext'][_0xfda1('0x56')](_0x17a127[_0xfda1('0x57')],{'raw':!![]})[_0xfda1('0x33')](function(_0x18e219){_0x4249ae=_0x18e219;return db[_0xfda1('0x3b')][_0xfda1('0x51')]({'raw':!![]});})[_0xfda1('0x33')](function(_0x4e640d){var _0x447b71=fs[_0xfda1('0x58')](path[_0xfda1('0x59')](config[_0xfda1('0x5a')],_0xfda1('0x5b')),'utf8');var _0x4169fa=ejs[_0xfda1('0x5c')](_0x447b71,{'contexts':_0x4e640d||[]});fs[_0xfda1('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4169fa);})['then'](function(){return respondWithRpcPromise('Reload',_0xfda1('0x56'),{'module':_0xfda1('0x5e')});})[_0xfda1('0x33')](function(){var _0x28d042=_0x17a127[_0xfda1('0x5f')][_0xfda1('0x35')]({'plain':!![]});if(!_0x28d042)throw new Error(_0xfda1('0x60'));if(_0x28d042[_0xfda1('0x61')]===_0xfda1('0x5f')){var _0x3e5cbd=_0x4249ae['get']({'plain':!![]});return db[_0xfda1('0x62')][_0xfda1('0x55')]({'where':{'name':_0xfda1('0x63'),'userProfileId':_0x28d042[_0xfda1('0x64')]},'raw':!![]})[_0xfda1('0x33')](function(_0x59a28a){if(_0x59a28a&&_0x59a28a[_0xfda1('0x65')]===0x0){return db[_0xfda1('0x36')][_0xfda1('0x56')]({'name':_0x3e5cbd['name'],'resourceId':_0x3e5cbd['id'],'type':_0x59a28a['name'],'sectionId':_0x59a28a['id']},{})['then'](function(){return _0x4249ae;});}else{return _0x4249ae;}})[_0xfda1('0x25')](function(_0x37d8f0){logger['error'](_0xfda1('0x66'),_0x37d8f0);throw _0x37d8f0;});}return _0x4249ae;})[_0xfda1('0x33')](respondWithResult(_0xb3b404,0xc9))['catch'](handleError(_0xb3b404,null));};exports['update']=function(_0x566e08,_0x5f12ba,_0x4404c8){var _0x346acb;return db[_0xfda1('0x3b')][_0xfda1('0x55')]({'where':{'id':_0x566e08[_0xfda1('0x67')]['id']}})[_0xfda1('0x33')](handleEntityNotFound(_0x5f12ba,null))[_0xfda1('0x33')](saveUpdates(_0x566e08[_0xfda1('0x57')],null))[_0xfda1('0x33')](function(_0xea84bc){if(_0xea84bc){_0x346acb=_0xea84bc;return db[_0xfda1('0x3b')]['findAll']({'raw':!![]});}})[_0xfda1('0x33')](function(_0x53babc){var _0x3fe0b8=fs[_0xfda1('0x58')](path[_0xfda1('0x59')](config['root'],_0xfda1('0x5b')),'utf8');var _0x521983=ejs['render'](_0x3fe0b8,{'contexts':_0x53babc||[]});fs[_0xfda1('0x5d')](_0xfda1('0x68'),_0x521983);})['then'](function(){return respondWithRpcPromise(_0xfda1('0x69'),_0xfda1('0x32'),{'module':_0xfda1('0x5e')});})[_0xfda1('0x33')](function(){return _0x346acb;})[_0xfda1('0x33')](respondWithResult(_0x5f12ba,null))[_0xfda1('0x25')](handleError(_0x5f12ba,null));};exports[_0xfda1('0x34')]=function(_0x442139,_0xd08413,_0x43153f){var _0x31bb1a;return db['VoiceContext'][_0xfda1('0x55')]({'where':{'id':_0x442139[_0xfda1('0x67')]['id']}})['then'](handleEntityNotFound(_0xd08413,null))[_0xfda1('0x33')](removeEntity(_0xd08413,null))['then'](function(){return db['VoiceContext'][_0xfda1('0x51')]({'raw':!![]});})['then'](function(_0x27e644){var _0x1e3053=fs[_0xfda1('0x58')](path[_0xfda1('0x59')](config['root'],_0xfda1('0x5b')),'utf8');var _0x30c2c5=ejs[_0xfda1('0x5c')](_0x1e3053,{'contexts':_0x27e644});fs[_0xfda1('0x5d')](_0xfda1('0x68'),_0x30c2c5);return respondWithRpcPromise(_0xfda1('0x69'),_0xfda1('0x34'),{'module':_0xfda1('0x5e')});})[_0xfda1('0x25')](handleError(_0xd08413,null));}; \ No newline at end of file +var _0x74e9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','chan_sip.so','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x74e9,0x68));var _0x974e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x74e9[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x974e('0x0'));var rimraf=require(_0x974e('0x1'));var zipdir=require(_0x974e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x974e('0x3'));var BPromise=require(_0x974e('0x4'));var Mustache=require(_0x974e('0x5'));var util=require(_0x974e('0x6'));var path=require('path');var sox=require(_0x974e('0x7'));var csv=require(_0x974e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x974e('0x9'));var _=require(_0x974e('0xa'));var squel=require(_0x974e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x974e('0x8'));var querystring=require(_0x974e('0xc'));var Papa=require('papaparse');var Redis=require(_0x974e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x974e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x974e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x974e('0x10'));var config=require(_0x974e('0x11'));var licenseUtil=require(_0x974e('0x12'));var db=require(_0x974e('0x13'))['db'];var jayson=require(_0x974e('0x14'));var client=jayson[_0x974e('0x15')][_0x974e('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2a990e,_0x498281,_0x170852,_0x2b8543){return new BPromise(function(_0xadc815,_0x4cb8c8){var _0x2b95d0=_0x2b8543||client;return _0x2b95d0[_0x974e('0x17')](_0x2a990e,_0x170852)[_0x974e('0x18')](function(_0x4cf72e){logger[_0x974e('0x19')](_0x974e('0x1a'),_0x498281,_0x974e('0x1b'));logger['debug'](_0x974e('0x1c'),_0x498281,_0x974e('0x1b'),JSON[_0x974e('0x1d')](_0x4cf72e));if(_0x4cf72e[_0x974e('0x1e')]){if(_0x4cf72e['error']['code']===0x1f4){logger[_0x974e('0x1e')](_0x974e('0x1a'),_0x498281,_0x4cf72e[_0x974e('0x1e')][_0x974e('0x1f')]);return _0x4cb8c8(_0x4cf72e['error'][_0x974e('0x1f')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x498281,_0x4cf72e['error'][_0x974e('0x1f')]);return _0xadc815(_0x4cf72e['error'][_0x974e('0x1f')]);}else{logger[_0x974e('0x19')](_0x974e('0x1a'),_0x498281,_0x974e('0x1b'));_0xadc815(_0x4cf72e[_0x974e('0x20')][_0x974e('0x1f')]);}})[_0x974e('0x21')](function(_0x27f13c){logger[_0x974e('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x498281,_0x27f13c);_0x4cb8c8(_0x27f13c);});});}function respondWithStatusCode(_0x3965af,_0xaf7739){_0xaf7739=_0xaf7739||0xcc;return function(_0x14460b){if(_0x14460b){return _0x3965af['sendStatus'](_0xaf7739);}return _0x3965af[_0x974e('0x22')](_0xaf7739)[_0x974e('0x23')]();};}function respondWithResult(_0x544ff9,_0x3c52d7){_0x3c52d7=_0x3c52d7||0xc8;return function(_0x73715e){if(_0x73715e){return _0x544ff9[_0x974e('0x22')](_0x3c52d7)[_0x974e('0x24')](_0x73715e);}};}function respondWithFilteredResult(_0x10ac25,_0x57b80f){return function(_0xe2329d){if(_0xe2329d){var _0x86baab=typeof _0x57b80f[_0x974e('0x25')]==='undefined'&&typeof _0x57b80f['limit']===_0x974e('0x26');var _0x538c58=_0xe2329d[_0x974e('0x27')];var _0x580140=_0x86baab?0x0:_0x57b80f['offset'];var _0x4b0ee7=_0x86baab?_0xe2329d['count']:_0x57b80f[_0x974e('0x25')]+_0x57b80f['limit'];var _0x14e9c2;if(_0x4b0ee7>=_0x538c58){_0x4b0ee7=_0x538c58;_0x14e9c2=0xc8;}else{_0x14e9c2=0xce;}_0x10ac25['status'](_0x14e9c2);return _0x10ac25[_0x974e('0x28')]('Content-Range',_0x580140+'-'+_0x4b0ee7+'/'+_0x538c58)[_0x974e('0x24')](_0xe2329d);}return null;};}function patchUpdates(_0x4eb69f){return function(_0x4a6422){try{jsonpatch[_0x974e('0x29')](_0x4a6422,_0x4eb69f,!![]);}catch(_0x42087a){return BPromise[_0x974e('0x2a')](_0x42087a);}return _0x4a6422[_0x974e('0x2b')]();};}function saveUpdates(_0x3d76a2,_0x2ee52b){return function(_0x88a248){if(_0x88a248){return _0x88a248[_0x974e('0x2c')](_0x3d76a2)['then'](function(_0x51b7c7){return _0x51b7c7;});}return null;};}function removeEntity(_0x4075d7,_0x1f57e0){return function(_0x4b082a){if(_0x4b082a){return _0x4b082a[_0x974e('0x2d')]()[_0x974e('0x18')](function(){var _0x9e3c0e=_0x4b082a[_0x974e('0x2e')]({'plain':!![]});var _0x49f408=_0x974e('0x2f');return db[_0x974e('0x30')][_0x974e('0x2d')]({'where':{'type':_0x49f408,'resourceId':_0x9e3c0e['id']}})[_0x974e('0x18')](function(){return _0x4b082a;});})[_0x974e('0x18')](function(){_0x4075d7[_0x974e('0x22')](0xcc)[_0x974e('0x23')]();});}};}function handleEntityNotFound(_0x2db7a9,_0x3431a7){return function(_0x2288e5){if(!_0x2288e5){_0x2db7a9['sendStatus'](0x194);}return _0x2288e5;};}function handleError(_0x3c08c3,_0x3126aa){_0x3126aa=_0x3126aa||0x1f4;return function(_0x58315b){logger['error'](_0x58315b[_0x974e('0x31')]);if(_0x58315b[_0x974e('0x32')]){delete _0x58315b[_0x974e('0x32')];}_0x3c08c3[_0x974e('0x22')](_0x3126aa)[_0x974e('0x33')](_0x58315b);};}exports['index']=function(_0x6fb29e,_0x3465df){var _0x2e44fb={},_0x494543={},_0x1dbf39={'count':0x0,'rows':[]};var _0x20e603=_[_0x974e('0x34')](db[_0x974e('0x35')]['rawAttributes'],function(_0x51c870){return{'name':_0x51c870[_0x974e('0x36')],'type':_0x51c870[_0x974e('0x37')][_0x974e('0x38')]};});_0x494543[_0x974e('0x39')]=_[_0x974e('0x34')](_0x20e603,_0x974e('0x32'));_0x494543[_0x974e('0x3a')]=_[_0x974e('0x3b')](_0x6fb29e['query']);_0x494543[_0x974e('0x3c')]=_[_0x974e('0x3d')](_0x494543[_0x974e('0x39')],_0x494543[_0x974e('0x3a')]);_0x2e44fb['attributes']=_['intersection'](_0x494543[_0x974e('0x39')],qs[_0x974e('0x3e')](_0x6fb29e[_0x974e('0x3a')]['fields']));_0x2e44fb[_0x974e('0x3f')]=_0x2e44fb[_0x974e('0x3f')][_0x974e('0x40')]?_0x2e44fb[_0x974e('0x3f')]:_0x494543[_0x974e('0x39')];if(!_0x6fb29e['query'][_0x974e('0x41')](_0x974e('0x42'))){_0x2e44fb[_0x974e('0x43')]=qs[_0x974e('0x43')](_0x6fb29e['query'][_0x974e('0x43')]);_0x2e44fb[_0x974e('0x25')]=qs['offset'](_0x6fb29e[_0x974e('0x3a')]['offset']);}_0x2e44fb[_0x974e('0x44')]=qs[_0x974e('0x45')](_0x6fb29e['query'][_0x974e('0x45')]);_0x2e44fb['where']=qs['filters'](_['pick'](_0x6fb29e[_0x974e('0x3a')],_0x494543[_0x974e('0x3c')]),_0x20e603);if(_0x6fb29e[_0x974e('0x3a')][_0x974e('0x46')]){_0x2e44fb[_0x974e('0x47')]=_[_0x974e('0x48')](_0x2e44fb['where'],{'$or':_[_0x974e('0x34')](_0x20e603,function(_0x5dd924){if(_0x5dd924['type']!==_0x974e('0x49')){var _0x2e6bd4={};_0x2e6bd4[_0x5dd924[_0x974e('0x32')]]={'$like':'%'+_0x6fb29e[_0x974e('0x3a')][_0x974e('0x46')]+'%'};return _0x2e6bd4;}})});}_0x2e44fb=_['merge']({},_0x2e44fb,_0x6fb29e[_0x974e('0x4a')]);var _0x4bd44a={'where':_0x2e44fb[_0x974e('0x47')]};return db[_0x974e('0x35')][_0x974e('0x27')](_0x4bd44a)['then'](function(_0x342251){_0x1dbf39['count']=_0x342251;if(_0x6fb29e[_0x974e('0x3a')][_0x974e('0x4b')]){_0x2e44fb[_0x974e('0x4c')]=[{'all':!![]}];}return db[_0x974e('0x35')][_0x974e('0x4d')](_0x2e44fb);})[_0x974e('0x18')](function(_0x2182cd){_0x1dbf39['rows']=_0x2182cd;return _0x1dbf39;})[_0x974e('0x18')](respondWithFilteredResult(_0x3465df,_0x2e44fb))[_0x974e('0x21')](handleError(_0x3465df,null));};exports['show']=function(_0x30e9e0,_0x66db8c){var _0x1bc809={'raw':![],'where':{'id':_0x30e9e0[_0x974e('0x4e')]['id']}},_0x4247b6={};_0x4247b6[_0x974e('0x39')]=_['keys'](db[_0x974e('0x35')][_0x974e('0x4f')]);_0x4247b6[_0x974e('0x3a')]=_[_0x974e('0x3b')](_0x30e9e0[_0x974e('0x3a')]);_0x4247b6[_0x974e('0x3c')]=_[_0x974e('0x3d')](_0x4247b6[_0x974e('0x39')],_0x4247b6[_0x974e('0x3a')]);_0x1bc809['attributes']=_['intersection'](_0x4247b6[_0x974e('0x39')],qs[_0x974e('0x3e')](_0x30e9e0[_0x974e('0x3a')][_0x974e('0x3e')]));_0x1bc809[_0x974e('0x3f')]=_0x1bc809[_0x974e('0x3f')][_0x974e('0x40')]?_0x1bc809['attributes']:_0x4247b6[_0x974e('0x39')];if(_0x30e9e0['query'][_0x974e('0x4b')]){_0x1bc809[_0x974e('0x4c')]=[{'all':!![]}];}_0x1bc809=_['merge']({},_0x1bc809,_0x30e9e0['options']);return db[_0x974e('0x35')][_0x974e('0x50')](_0x1bc809)['then'](handleEntityNotFound(_0x66db8c,null))[_0x974e('0x18')](respondWithResult(_0x66db8c,null))['catch'](handleError(_0x66db8c,null));};exports['create']=function(_0x2300b0,_0x18a1b6,_0x3acc96){var _0x3509a5;return db[_0x974e('0x35')][_0x974e('0x51')](_0x2300b0[_0x974e('0x52')],{'raw':!![]})[_0x974e('0x18')](function(_0x9d5a6e){_0x3509a5=_0x9d5a6e;return db[_0x974e('0x35')]['findAll']({'raw':!![]});})[_0x974e('0x18')](function(_0x460130){var _0x66dc29=fs[_0x974e('0x53')](path[_0x974e('0x54')](config[_0x974e('0x55')],_0x974e('0x56')),_0x974e('0x57'));var _0x98ab0e=ejs[_0x974e('0x58')](_0x66dc29,{'contexts':_0x460130||[]});fs[_0x974e('0x59')](_0x974e('0x5a'),_0x98ab0e);})[_0x974e('0x18')](function(){return respondWithRpcPromise(_0x974e('0x5b'),_0x974e('0x51'),{'module':'chan_sip.so'});})[_0x974e('0x18')](function(){var _0xb53dcf=_0x2300b0[_0x974e('0x5c')][_0x974e('0x2e')]({'plain':!![]});if(!_0xb53dcf)throw new Error(_0x974e('0x5d'));if(_0xb53dcf[_0x974e('0x5e')]===_0x974e('0x5c')){var _0x46f6ae=_0x3509a5[_0x974e('0x2e')]({'plain':!![]});return db['UserProfileSection'][_0x974e('0x50')]({'where':{'name':'Contexts','userProfileId':_0xb53dcf[_0x974e('0x5f')]},'raw':!![]})[_0x974e('0x18')](function(_0x41896f){if(_0x41896f&&_0x41896f[_0x974e('0x60')]===0x0){return db[_0x974e('0x30')][_0x974e('0x51')]({'name':_0x46f6ae['name'],'resourceId':_0x46f6ae['id'],'type':_0x41896f[_0x974e('0x32')],'sectionId':_0x41896f['id']},{})[_0x974e('0x18')](function(){return _0x3509a5;});}else{return _0x3509a5;}})[_0x974e('0x21')](function(_0x30334a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30334a);throw _0x30334a;});}return _0x3509a5;})[_0x974e('0x18')](respondWithResult(_0x18a1b6,0xc9))[_0x974e('0x21')](handleError(_0x18a1b6,null));};exports[_0x974e('0x2c')]=function(_0x3c3a33,_0x3031e3,_0x2d4f5f){var _0x456388;return db[_0x974e('0x35')]['find']({'where':{'id':_0x3c3a33[_0x974e('0x4e')]['id']}})[_0x974e('0x18')](handleEntityNotFound(_0x3031e3,null))[_0x974e('0x18')](saveUpdates(_0x3c3a33[_0x974e('0x52')],null))[_0x974e('0x18')](function(_0xae5f5b){if(_0xae5f5b){_0x456388=_0xae5f5b;return db[_0x974e('0x35')][_0x974e('0x4d')]({'raw':!![]});}})[_0x974e('0x18')](function(_0x50baef){var _0x24b118=fs[_0x974e('0x53')](path[_0x974e('0x54')](config['root'],_0x974e('0x56')),_0x974e('0x57'));var _0x488f1f=ejs[_0x974e('0x58')](_0x24b118,{'contexts':_0x50baef||[]});fs[_0x974e('0x59')](_0x974e('0x5a'),_0x488f1f);})[_0x974e('0x18')](function(){return respondWithRpcPromise(_0x974e('0x5b'),_0x974e('0x2c'),{'module':_0x974e('0x61')});})[_0x974e('0x18')](function(){return _0x456388;})[_0x974e('0x18')](respondWithResult(_0x3031e3,null))[_0x974e('0x21')](handleError(_0x3031e3,null));};exports[_0x974e('0x2d')]=function(_0xb6e3ee,_0x903902,_0x49db96){var _0x318fc8;return db['VoiceContext'][_0x974e('0x50')]({'where':{'id':_0xb6e3ee['params']['id']}})[_0x974e('0x18')](handleEntityNotFound(_0x903902,null))[_0x974e('0x18')](removeEntity(_0x903902,null))['then'](function(){return db[_0x974e('0x35')]['findAll']({'raw':!![]});})[_0x974e('0x18')](function(_0x2dca44){var _0x272297=fs[_0x974e('0x53')](path[_0x974e('0x54')](config[_0x974e('0x55')],_0x974e('0x56')),_0x974e('0x57'));var _0x22d803=ejs['render'](_0x272297,{'contexts':_0x2dca44});fs[_0x974e('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x22d803);return respondWithRpcPromise('Reload','destroy',{'module':_0x974e('0x61')});})[_0x974e('0x21')](handleError(_0x903902,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3f44073..3650c05 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 _0xf5c4=['voice_contexts','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0xf49dc4,_0xef52ed){var _0x4a55cc=function(_0x10140a){while(--_0x10140a){_0xf49dc4['push'](_0xf49dc4['shift']());}};_0x4a55cc(++_0xef52ed);}(_0xf5c4,0x1c4));var _0x4f5c=function(_0x15def9,_0x33453b){_0x15def9=_0x15def9-0x0;var _0x613ec4=_0xf5c4[_0x15def9];return _0x613ec4;};'use strict';var _=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var logger=require(_0x4f5c('0x2'))('api');var moment=require(_0x4f5c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f5c('0x4'));var rimraf=require(_0x4f5c('0x5'));var config=require(_0x4f5c('0x6'));var attributes=require(_0x4f5c('0x7'));module[_0x4f5c('0x8')]=function(_0x53208d,_0x3217ab){return _0x53208d[_0x4f5c('0x9')]('VoiceContext',attributes,{'tableName':_0x4f5c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2e=['exports','define','VoiceContext','voice_contexts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x17f760,_0x56a09b){_0x17f760=_0x17f760-0x0;var _0xe9845=_0x4e2e[_0x17f760];return _0xe9845;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 1ae1afa..6749ef9 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 _0xdcda=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x37dfdb,_0x51140f){var _0x1f1715=function(_0x88d974){while(--_0x88d974){_0x37dfdb['push'](_0x37dfdb['shift']());}};_0x1f1715(++_0x51140f);}(_0xdcda,0xa3));var _0xadcd=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xdcda[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xadcd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xadcd('0x1'));var rs=require(_0xadcd('0x2'));var fs=require('fs');var Redis=require(_0xadcd('0x3'));var db=require(_0xadcd('0x4'))['db'];var utils=require(_0xadcd('0x5'));var logger=require(_0xadcd('0x6'))(_0xadcd('0x7'));var config=require(_0xadcd('0x8'));var jayson=require(_0xadcd('0x9'));var client=jayson[_0xadcd('0xa')][_0xadcd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ee6c2,_0x3cd187,_0x38022b){return new BPromise(function(_0x5de104,_0x5b9926){return client[_0xadcd('0xc')](_0x1ee6c2,_0x38022b)[_0xadcd('0xd')](function(_0x5694e8){logger['info'](_0xadcd('0xe'),_0x3cd187,_0xadcd('0xf'));logger[_0xadcd('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3cd187,_0xadcd('0xf'),JSON[_0xadcd('0x11')](_0x5694e8));if(_0x5694e8['error']){if(_0x5694e8['error']['code']===0x1f4){logger[_0xadcd('0x12')](_0xadcd('0xe'),_0x3cd187,_0x5694e8['error'][_0xadcd('0x13')]);return _0x5b9926(_0x5694e8[_0xadcd('0x12')]['message']);}logger['error'](_0xadcd('0xe'),_0x3cd187,_0x5694e8['error'][_0xadcd('0x13')]);return _0x5de104(_0x5694e8[_0xadcd('0x12')][_0xadcd('0x13')]);}else{logger[_0xadcd('0x14')]('VoiceContext,\x20%s,\x20%s',_0x3cd187,'request\x20sent');_0x5de104(_0x5694e8[_0xadcd('0x15')][_0xadcd('0x13')]);}})[_0xadcd('0x16')](function(_0x7d18e){logger[_0xadcd('0x12')](_0xadcd('0xe'),_0x3cd187,_0x7d18e);_0x5b9926(_0x7d18e);});});} \ No newline at end of file +var _0x6a5f=['randomstring','../../mysqldb','rpc','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x49d40d,_0x30e0ea){var _0x5ec463=function(_0x11bab1){while(--_0x11bab1){_0x49d40d['push'](_0x49d40d['shift']());}};_0x5ec463(++_0x30e0ea);}(_0x6a5f,0xbb));var _0xf6a5=function(_0x1f15bb,_0x4663fb){_0x1f15bb=_0x1f15bb-0x0;var _0x3a49ef=_0x6a5f[_0x1f15bb];return _0x3a49ef;};'use strict';var _=require(_0xf6a5('0x0'));var util=require(_0xf6a5('0x1'));var moment=require('moment');var BPromise=require(_0xf6a5('0x2'));var rs=require(_0xf6a5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf6a5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf6a5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3560d0,_0x2919fe,_0x4627d3){return new BPromise(function(_0x1e3360,_0x19facf){return client[_0xf6a5('0x7')](_0x3560d0,_0x4627d3)[_0xf6a5('0x8')](function(_0x3eaf83){logger[_0xf6a5('0x9')]('VoiceContext,\x20%s,\x20%s',_0x2919fe,_0xf6a5('0xa'));logger[_0xf6a5('0xb')](_0xf6a5('0xc'),_0x2919fe,_0xf6a5('0xa'),JSON[_0xf6a5('0xd')](_0x3eaf83));if(_0x3eaf83[_0xf6a5('0xe')]){if(_0x3eaf83[_0xf6a5('0xe')]['code']===0x1f4){logger[_0xf6a5('0xe')](_0xf6a5('0xf'),_0x2919fe,_0x3eaf83[_0xf6a5('0xe')][_0xf6a5('0x10')]);return _0x19facf(_0x3eaf83['error'][_0xf6a5('0x10')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x2919fe,_0x3eaf83[_0xf6a5('0xe')][_0xf6a5('0x10')]);return _0x1e3360(_0x3eaf83['error'][_0xf6a5('0x10')]);}else{logger[_0xf6a5('0x9')](_0xf6a5('0xf'),_0x2919fe,_0xf6a5('0xa'));_0x1e3360(_0x3eaf83[_0xf6a5('0x11')][_0xf6a5('0x10')]);}})[_0xf6a5('0x12')](function(_0x556a42){logger[_0xf6a5('0xe')]('VoiceContext,\x20%s,\x20%s',_0x2919fe,_0x556a42);_0x19facf(_0x556a42);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c754ef5..148b6eb 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 _0x793b=['show','post','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./voiceDialReport.controller','index','/describe','isAuthenticated','describe','/:id'];(function(_0x194d2c,_0x300448){var _0x4b7565=function(_0x2f720a){while(--_0x2f720a){_0x194d2c['push'](_0x194d2c['shift']());}};_0x4b7565(++_0x300448);}(_0x793b,0x1f2));var _0xb793=function(_0x4608fa,_0x508ff5){_0x4608fa=_0x4608fa-0x0;var _0x20405e=_0x793b[_0x4608fa];return _0x20405e;};'use strict';var multer=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var path=require(_0xb793('0x2'));var timeout=require(_0xb793('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb793('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb793('0x5'));var config=require('../../config/environment');var controller=require(_0xb793('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb793('0x7')]);router['get'](_0xb793('0x8'),auth[_0xb793('0x9')](),controller[_0xb793('0xa')]);router['get'](_0xb793('0xb'),auth[_0xb793('0x9')](),controller[_0xb793('0xc')]);router[_0xb793('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb793('0xb'),auth[_0xb793('0x9')](),controller[_0xb793('0xe')]);router['delete'](_0xb793('0xb'),auth[_0xb793('0x9')](),controller[_0xb793('0xf')]);module[_0xb793('0x10')]=router; \ No newline at end of file +var _0x9063=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','multer','util'];(function(_0x301c86,_0x116aec){var _0x373e1c=function(_0x11d95b){while(--_0x11d95b){_0x301c86['push'](_0x301c86['shift']());}};_0x373e1c(++_0x116aec);}(_0x9063,0x1a2));var _0x3906=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x9063[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x3906('0x0'));var util=require(_0x3906('0x1'));var path=require(_0x3906('0x2'));var timeout=require(_0x3906('0x3'));var express=require(_0x3906('0x4'));var router=express[_0x3906('0x5')]();var fs_extra=require(_0x3906('0x6'));var auth=require(_0x3906('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3906('0x8'));var controller=require(_0x3906('0x9'));router[_0x3906('0xa')]('/',auth[_0x3906('0xb')](),controller[_0x3906('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3906('0xd')]);router[_0x3906('0xa')](_0x3906('0xe'),auth['isAuthenticated'](),controller[_0x3906('0xf')]);router[_0x3906('0x10')]('/',auth['isAuthenticated'](),controller[_0x3906('0x11')]);router[_0x3906('0x12')](_0x3906('0xe'),auth['isAuthenticated'](),controller[_0x3906('0x13')]);router[_0x3906('0x14')]('/:id',auth[_0x3906('0xb')](),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 9e41b65..75d4df6 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 _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x6899c7,_0x363413){var _0x5186ee=function(_0x2f83a9){while(--_0x2f83a9){_0x6899c7['push'](_0x6899c7['shift']());}};_0x5186ee(++_0x363413);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1b8135,_0x348398){_0x1b8135=_0x1b8135-0x0;var _0x59a105=_0x8ef6[_0x1b8135];return _0x59a105;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x1fef32,_0x391ff4){var _0x450c8f=function(_0x5af7c5){while(--_0x5af7c5){_0x1fef32['push'](_0x1fef32['shift']());}};_0x450c8f(++_0x391ff4);}(_0x9a19,0x114));var _0x99a1=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0x9a19[_0x5cbf0e];return _0x1c76f8;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 9ace608..d98313d 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 _0xb55d=['include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xb55d,0x18b));var _0xdb55=function(_0x2f7611,_0x5ba09b){_0x2f7611=_0x2f7611-0x0;var _0x50d4f0=_0xb55d[_0x2f7611];return _0x50d4f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb55('0x0'));var zipdir=require(_0xdb55('0x1'));var jsonpatch=require(_0xdb55('0x2'));var rp=require(_0xdb55('0x3'));var moment=require(_0xdb55('0x4'));var BPromise=require(_0xdb55('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdb55('0x6'));var sox=require(_0xdb55('0x7'));var csv=require(_0xdb55('0x8'));var ejs=require(_0xdb55('0x9'));var fs=require('fs');var fs_extra=require(_0xdb55('0xa'));var _=require(_0xdb55('0xb'));var squel=require(_0xdb55('0xc'));var crypto=require(_0xdb55('0xd'));var jsforce=require(_0xdb55('0xe'));var deskjs=require(_0xdb55('0xf'));var toCsv=require(_0xdb55('0x8'));var querystring=require(_0xdb55('0x10'));var Papa=require(_0xdb55('0x11'));var Redis=require(_0xdb55('0x12'));var authService=require(_0xdb55('0x13'));var qs=require(_0xdb55('0x14'));var as=require(_0xdb55('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdb55('0x16'));var utils=require(_0xdb55('0x17'));var config=require(_0xdb55('0x18'));var licenseUtil=require(_0xdb55('0x19'));var db=require(_0xdb55('0x1a'))['db'];function respondWithStatusCode(_0x20df19,_0x44f671){_0x44f671=_0x44f671||0xcc;return function(_0x22d8e4){if(_0x22d8e4){return _0x20df19['sendStatus'](_0x44f671);}return _0x20df19[_0xdb55('0x1b')](_0x44f671)[_0xdb55('0x1c')]();};}function respondWithResult(_0x46da6e,_0x45af48){_0x45af48=_0x45af48||0xc8;return function(_0x237ed3){if(_0x237ed3){return _0x46da6e[_0xdb55('0x1b')](_0x45af48)[_0xdb55('0x1d')](_0x237ed3);}};}function respondWithFilteredResult(_0x12c3db,_0x40cf5b){return function(_0x358a98){if(_0x358a98){var _0x29d31f=typeof _0x40cf5b[_0xdb55('0x1e')]===_0xdb55('0x1f')&&typeof _0x40cf5b[_0xdb55('0x20')]==='undefined';var _0x35d8e0=_0x358a98['count'];var _0x47e6a6=_0x29d31f?0x0:_0x40cf5b[_0xdb55('0x1e')];var _0x3b2616=_0x29d31f?_0x358a98[_0xdb55('0x21')]:_0x40cf5b['offset']+_0x40cf5b['limit'];var _0x44841a;if(_0x3b2616>=_0x35d8e0){_0x3b2616=_0x35d8e0;_0x44841a=0xc8;}else{_0x44841a=0xce;}_0x12c3db[_0xdb55('0x1b')](_0x44841a);return _0x12c3db[_0xdb55('0x22')](_0xdb55('0x23'),_0x47e6a6+'-'+_0x3b2616+'/'+_0x35d8e0)[_0xdb55('0x1d')](_0x358a98);}return null;};}function patchUpdates(_0x4015d5){return function(_0x717738){try{jsonpatch[_0xdb55('0x24')](_0x717738,_0x4015d5,!![]);}catch(_0x2edd98){return BPromise[_0xdb55('0x25')](_0x2edd98);}return _0x717738['save']();};}function saveUpdates(_0x39767c,_0x477ec7){return function(_0x25a584){if(_0x25a584){return _0x25a584[_0xdb55('0x26')](_0x39767c)['then'](function(_0x579099){return _0x579099;});}return null;};}function removeEntity(_0x4736f5,_0x1f141a){return function(_0x495ddb){if(_0x495ddb){return _0x495ddb[_0xdb55('0x27')]()[_0xdb55('0x28')](function(){_0x4736f5[_0xdb55('0x1b')](0xcc)[_0xdb55('0x1c')]();});}};}function handleEntityNotFound(_0x31e169,_0x4f563d){return function(_0x87fc24){if(!_0x87fc24){_0x31e169['sendStatus'](0x194);}return _0x87fc24;};}function handleError(_0x1648bc,_0xedff7d){_0xedff7d=_0xedff7d||0x1f4;return function(_0x507880){logger['error'](_0x507880['stack']);if(_0x507880[_0xdb55('0x29')]){delete _0x507880[_0xdb55('0x29')];}_0x1648bc[_0xdb55('0x1b')](_0xedff7d)[_0xdb55('0x2a')](_0x507880);};}exports[_0xdb55('0x2b')]=function(_0xf61530,_0x2ff468){var _0x164846={},_0x45f3a3={},_0x1d5970={'count':0x0,'rows':[]};var _0x3ec311=_['map'](db[_0xdb55('0x2c')][_0xdb55('0x2d')],function(_0xcc059){return{'name':_0xcc059[_0xdb55('0x2e')],'type':_0xcc059[_0xdb55('0x2f')]['key']};});_0x45f3a3[_0xdb55('0x30')]=_['map'](_0x3ec311,_0xdb55('0x29'));_0x45f3a3[_0xdb55('0x31')]=_[_0xdb55('0x32')](_0xf61530[_0xdb55('0x31')]);_0x45f3a3[_0xdb55('0x33')]=_[_0xdb55('0x34')](_0x45f3a3['model'],_0x45f3a3[_0xdb55('0x31')]);_0x164846[_0xdb55('0x35')]=_[_0xdb55('0x34')](_0x45f3a3[_0xdb55('0x30')],qs[_0xdb55('0x36')](_0xf61530[_0xdb55('0x31')][_0xdb55('0x36')]));_0x164846[_0xdb55('0x35')]=_0x164846[_0xdb55('0x35')][_0xdb55('0x37')]?_0x164846[_0xdb55('0x35')]:_0x45f3a3[_0xdb55('0x30')];if(!_0xf61530[_0xdb55('0x31')][_0xdb55('0x38')](_0xdb55('0x39'))){_0x164846[_0xdb55('0x20')]=qs['limit'](_0xf61530[_0xdb55('0x31')][_0xdb55('0x20')]);_0x164846[_0xdb55('0x1e')]=qs[_0xdb55('0x1e')](_0xf61530[_0xdb55('0x31')][_0xdb55('0x1e')]);}_0x164846['order']=qs[_0xdb55('0x3a')](_0xf61530[_0xdb55('0x31')][_0xdb55('0x3a')]);_0x164846[_0xdb55('0x3b')]=qs['filters'](_[_0xdb55('0x3c')](_0xf61530['query'],_0x45f3a3['filters']),_0x3ec311);if(_0xf61530[_0xdb55('0x31')][_0xdb55('0x3d')]){_0x164846[_0xdb55('0x3b')]=_[_0xdb55('0x3e')](_0x164846[_0xdb55('0x3b')],{'$or':_[_0xdb55('0x3f')](_0x3ec311,function(_0x4c8f0b){if(_0x4c8f0b[_0xdb55('0x2f')]!==_0xdb55('0x40')){var _0x12ac9e={};_0x12ac9e[_0x4c8f0b[_0xdb55('0x29')]]={'$like':'%'+_0xf61530[_0xdb55('0x31')][_0xdb55('0x3d')]+'%'};return _0x12ac9e;}})});}_0x164846=_['merge']({},_0x164846,_0xf61530[_0xdb55('0x41')]);var _0x5bf3b1={'where':_0x164846[_0xdb55('0x3b')]};return db[_0xdb55('0x2c')][_0xdb55('0x21')](_0x5bf3b1)[_0xdb55('0x28')](function(_0x56d901){_0x1d5970[_0xdb55('0x21')]=_0x56d901;if(_0xf61530[_0xdb55('0x31')][_0xdb55('0x42')]){_0x164846[_0xdb55('0x43')]=[{'all':!![]}];}return db[_0xdb55('0x2c')][_0xdb55('0x44')](_0x164846);})[_0xdb55('0x28')](function(_0x2bc706){_0x1d5970[_0xdb55('0x45')]=_0x2bc706;return _0x1d5970;})[_0xdb55('0x28')](respondWithFilteredResult(_0x2ff468,_0x164846))[_0xdb55('0x46')](handleError(_0x2ff468,null));};exports[_0xdb55('0x47')]=function(_0x133c3d,_0x3a2619){var _0x206d30={'raw':!![],'where':{'id':_0x133c3d[_0xdb55('0x48')]['id']}},_0x5511fa={};_0x5511fa[_0xdb55('0x30')]=_[_0xdb55('0x32')](db[_0xdb55('0x2c')]['rawAttributes']);_0x5511fa[_0xdb55('0x31')]=_[_0xdb55('0x32')](_0x133c3d[_0xdb55('0x31')]);_0x5511fa[_0xdb55('0x33')]=_[_0xdb55('0x34')](_0x5511fa[_0xdb55('0x30')],_0x5511fa[_0xdb55('0x31')]);_0x206d30[_0xdb55('0x35')]=_['intersection'](_0x5511fa[_0xdb55('0x30')],qs[_0xdb55('0x36')](_0x133c3d[_0xdb55('0x31')]['fields']));_0x206d30[_0xdb55('0x35')]=_0x206d30['attributes'][_0xdb55('0x37')]?_0x206d30['attributes']:_0x5511fa[_0xdb55('0x30')];if(_0x133c3d[_0xdb55('0x31')][_0xdb55('0x42')]){_0x206d30[_0xdb55('0x43')]=[{'all':!![]}];}_0x206d30=_['merge']({},_0x206d30,_0x133c3d[_0xdb55('0x41')]);return db['VoiceDialReport'][_0xdb55('0x49')](_0x206d30)[_0xdb55('0x28')](handleEntityNotFound(_0x3a2619,null))[_0xdb55('0x28')](respondWithResult(_0x3a2619,null))[_0xdb55('0x46')](handleError(_0x3a2619,null));};exports['create']=function(_0x1a14fb,_0x4c8987){return db[_0xdb55('0x2c')][_0xdb55('0x4a')](_0x1a14fb[_0xdb55('0x4b')],{})[_0xdb55('0x28')](respondWithResult(_0x4c8987,0xc9))[_0xdb55('0x46')](handleError(_0x4c8987,null));};exports[_0xdb55('0x26')]=function(_0x1cdd8f,_0x5688e2){if(_0x1cdd8f[_0xdb55('0x4b')]['id']){delete _0x1cdd8f['body']['id'];}return db[_0xdb55('0x2c')]['find']({'where':{'id':_0x1cdd8f[_0xdb55('0x48')]['id']}})[_0xdb55('0x28')](handleEntityNotFound(_0x5688e2,null))[_0xdb55('0x28')](saveUpdates(_0x1cdd8f[_0xdb55('0x4b')],null))['then'](respondWithResult(_0x5688e2,null))[_0xdb55('0x46')](handleError(_0x5688e2,null));};exports[_0xdb55('0x27')]=function(_0xc04ab9,_0x52dded){return db[_0xdb55('0x2c')][_0xdb55('0x49')]({'where':{'id':_0xc04ab9[_0xdb55('0x48')]['id']}})[_0xdb55('0x28')](handleEntityNotFound(_0x52dded,null))[_0xdb55('0x28')](removeEntity(_0x52dded,null))['catch'](handleError(_0x52dded,null));};exports[_0xdb55('0x4c')]=function(_0x453c3e,_0x3fcd50){return db[_0xdb55('0x2c')][_0xdb55('0x4c')]()[_0xdb55('0x28')](respondWithResult(_0x3fcd50,null))[_0xdb55('0x46')](handleError(_0x3fcd50,null));}; \ No newline at end of file +var _0xfc6e=['model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','pick','merge','where','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','end','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','key'];(function(_0x533410,_0x560aa8){var _0x5b7a5c=function(_0x5a312d){while(--_0x5a312d){_0x533410['push'](_0x533410['shift']());}};_0x5b7a5c(++_0x560aa8);}(_0xfc6e,0x1cb));var _0xefc6=function(_0x536755,_0x3bfa50){_0x536755=_0x536755-0x0;var _0x2b9dde=_0xfc6e[_0x536755];return _0x2b9dde;};'use strict';var emlformat=require(_0xefc6('0x0'));var rimraf=require(_0xefc6('0x1'));var zipdir=require(_0xefc6('0x2'));var jsonpatch=require(_0xefc6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefc6('0x4'));var path=require(_0xefc6('0x5'));var sox=require(_0xefc6('0x6'));var csv=require(_0xefc6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefc6('0x8'));var _=require(_0xefc6('0x9'));var squel=require(_0xefc6('0xa'));var crypto=require(_0xefc6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xefc6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xefc6('0xd'));var Papa=require(_0xefc6('0xe'));var Redis=require(_0xefc6('0xf'));var authService=require(_0xefc6('0x10'));var qs=require(_0xefc6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xefc6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xefc6('0x13'));var licenseUtil=require(_0xefc6('0x14'));var db=require(_0xefc6('0x15'))['db'];function respondWithStatusCode(_0x31d16b,_0x4e809a){_0x4e809a=_0x4e809a||0xcc;return function(_0x5e5e32){if(_0x5e5e32){return _0x31d16b[_0xefc6('0x16')](_0x4e809a);}return _0x31d16b[_0xefc6('0x17')](_0x4e809a)['end']();};}function respondWithResult(_0x4c3060,_0x260a90){_0x260a90=_0x260a90||0xc8;return function(_0x368008){if(_0x368008){return _0x4c3060[_0xefc6('0x17')](_0x260a90)[_0xefc6('0x18')](_0x368008);}};}function respondWithFilteredResult(_0x5e0e66,_0x42113b){return function(_0x4d2e8b){if(_0x4d2e8b){var _0x12e30f=typeof _0x42113b[_0xefc6('0x19')]===_0xefc6('0x1a')&&typeof _0x42113b[_0xefc6('0x1b')]==='undefined';var _0x2b13b2=_0x4d2e8b[_0xefc6('0x1c')];var _0x4637f0=_0x12e30f?0x0:_0x42113b[_0xefc6('0x19')];var _0x148d4b=_0x12e30f?_0x4d2e8b[_0xefc6('0x1c')]:_0x42113b[_0xefc6('0x19')]+_0x42113b[_0xefc6('0x1b')];var _0x2b3d06;if(_0x148d4b>=_0x2b13b2){_0x148d4b=_0x2b13b2;_0x2b3d06=0xc8;}else{_0x2b3d06=0xce;}_0x5e0e66[_0xefc6('0x17')](_0x2b3d06);return _0x5e0e66[_0xefc6('0x1d')]('Content-Range',_0x4637f0+'-'+_0x148d4b+'/'+_0x2b13b2)[_0xefc6('0x18')](_0x4d2e8b);}return null;};}function patchUpdates(_0x517fa4){return function(_0x23c384){try{jsonpatch['apply'](_0x23c384,_0x517fa4,!![]);}catch(_0x5a10af){return BPromise[_0xefc6('0x1e')](_0x5a10af);}return _0x23c384[_0xefc6('0x1f')]();};}function saveUpdates(_0x3c5418,_0x5523a8){return function(_0x5e27d8){if(_0x5e27d8){return _0x5e27d8[_0xefc6('0x20')](_0x3c5418)['then'](function(_0x51a91d){return _0x51a91d;});}return null;};}function removeEntity(_0x3faaba,_0x2e9d6a){return function(_0x2facff){if(_0x2facff){return _0x2facff[_0xefc6('0x21')]()[_0xefc6('0x22')](function(){_0x3faaba[_0xefc6('0x17')](0xcc)[_0xefc6('0x23')]();});}};}function handleEntityNotFound(_0x302df2,_0x50b691){return function(_0x33caf0){if(!_0x33caf0){_0x302df2[_0xefc6('0x16')](0x194);}return _0x33caf0;};}function handleError(_0x4eadca,_0x58a353){_0x58a353=_0x58a353||0x1f4;return function(_0xf72e8b){logger[_0xefc6('0x24')](_0xf72e8b[_0xefc6('0x25')]);if(_0xf72e8b[_0xefc6('0x26')]){delete _0xf72e8b[_0xefc6('0x26')];}_0x4eadca[_0xefc6('0x17')](_0x58a353)[_0xefc6('0x27')](_0xf72e8b);};}exports['index']=function(_0xb0728d,_0x39a3bd){var _0x19fde2={},_0x1cbad={},_0x36ff1b={'count':0x0,'rows':[]};var _0x4f244a=_[_0xefc6('0x28')](db[_0xefc6('0x29')][_0xefc6('0x2a')],function(_0x4b0590){return{'name':_0x4b0590[_0xefc6('0x2b')],'type':_0x4b0590['type'][_0xefc6('0x2c')]};});_0x1cbad[_0xefc6('0x2d')]=_['map'](_0x4f244a,_0xefc6('0x26'));_0x1cbad['query']=_[_0xefc6('0x2e')](_0xb0728d['query']);_0x1cbad[_0xefc6('0x2f')]=_[_0xefc6('0x30')](_0x1cbad[_0xefc6('0x2d')],_0x1cbad[_0xefc6('0x31')]);_0x19fde2[_0xefc6('0x32')]=_[_0xefc6('0x30')](_0x1cbad[_0xefc6('0x2d')],qs[_0xefc6('0x33')](_0xb0728d[_0xefc6('0x31')][_0xefc6('0x33')]));_0x19fde2[_0xefc6('0x32')]=_0x19fde2[_0xefc6('0x32')][_0xefc6('0x34')]?_0x19fde2[_0xefc6('0x32')]:_0x1cbad[_0xefc6('0x2d')];if(!_0xb0728d[_0xefc6('0x31')][_0xefc6('0x35')](_0xefc6('0x36'))){_0x19fde2['limit']=qs[_0xefc6('0x1b')](_0xb0728d[_0xefc6('0x31')][_0xefc6('0x1b')]);_0x19fde2['offset']=qs[_0xefc6('0x19')](_0xb0728d['query'][_0xefc6('0x19')]);}_0x19fde2['order']=qs['sort'](_0xb0728d[_0xefc6('0x31')]['sort']);_0x19fde2['where']=qs['filters'](_[_0xefc6('0x37')](_0xb0728d[_0xefc6('0x31')],_0x1cbad['filters']),_0x4f244a);if(_0xb0728d[_0xefc6('0x31')]['filter']){_0x19fde2['where']=_[_0xefc6('0x38')](_0x19fde2[_0xefc6('0x39')],{'$or':_['map'](_0x4f244a,function(_0x36fe81){if(_0x36fe81[_0xefc6('0x3a')]!==_0xefc6('0x3b')){var _0x59c007={};_0x59c007[_0x36fe81[_0xefc6('0x26')]]={'$like':'%'+_0xb0728d['query'][_0xefc6('0x3c')]+'%'};return _0x59c007;}})});}_0x19fde2=_[_0xefc6('0x38')]({},_0x19fde2,_0xb0728d[_0xefc6('0x3d')]);var _0x384402={'where':_0x19fde2[_0xefc6('0x39')]};return db[_0xefc6('0x29')][_0xefc6('0x1c')](_0x384402)[_0xefc6('0x22')](function(_0x5de7ec){_0x36ff1b[_0xefc6('0x1c')]=_0x5de7ec;if(_0xb0728d[_0xefc6('0x31')][_0xefc6('0x3e')]){_0x19fde2['include']=[{'all':!![]}];}return db[_0xefc6('0x29')][_0xefc6('0x3f')](_0x19fde2);})[_0xefc6('0x22')](function(_0x34bcfd){_0x36ff1b['rows']=_0x34bcfd;return _0x36ff1b;})['then'](respondWithFilteredResult(_0x39a3bd,_0x19fde2))[_0xefc6('0x40')](handleError(_0x39a3bd,null));};exports[_0xefc6('0x41')]=function(_0x51fb99,_0x512b64){var _0x20727b={'raw':!![],'where':{'id':_0x51fb99['params']['id']}},_0x243002={};_0x243002[_0xefc6('0x2d')]=_[_0xefc6('0x2e')](db[_0xefc6('0x29')][_0xefc6('0x2a')]);_0x243002[_0xefc6('0x31')]=_[_0xefc6('0x2e')](_0x51fb99[_0xefc6('0x31')]);_0x243002['filters']=_[_0xefc6('0x30')](_0x243002['model'],_0x243002[_0xefc6('0x31')]);_0x20727b[_0xefc6('0x32')]=_[_0xefc6('0x30')](_0x243002[_0xefc6('0x2d')],qs['fields'](_0x51fb99[_0xefc6('0x31')][_0xefc6('0x33')]));_0x20727b[_0xefc6('0x32')]=_0x20727b[_0xefc6('0x32')]['length']?_0x20727b[_0xefc6('0x32')]:_0x243002[_0xefc6('0x2d')];if(_0x51fb99[_0xefc6('0x31')][_0xefc6('0x3e')]){_0x20727b[_0xefc6('0x42')]=[{'all':!![]}];}_0x20727b=_[_0xefc6('0x38')]({},_0x20727b,_0x51fb99['options']);return db[_0xefc6('0x29')][_0xefc6('0x43')](_0x20727b)[_0xefc6('0x22')](handleEntityNotFound(_0x512b64,null))[_0xefc6('0x22')](respondWithResult(_0x512b64,null))[_0xefc6('0x40')](handleError(_0x512b64,null));};exports['create']=function(_0x14411d,_0x243e62){return db[_0xefc6('0x29')][_0xefc6('0x44')](_0x14411d[_0xefc6('0x45')],{})[_0xefc6('0x22')](respondWithResult(_0x243e62,0xc9))[_0xefc6('0x40')](handleError(_0x243e62,null));};exports[_0xefc6('0x20')]=function(_0x56b4f0,_0x164ddd){if(_0x56b4f0[_0xefc6('0x45')]['id']){delete _0x56b4f0['body']['id'];}return db[_0xefc6('0x29')][_0xefc6('0x43')]({'where':{'id':_0x56b4f0['params']['id']}})['then'](handleEntityNotFound(_0x164ddd,null))['then'](saveUpdates(_0x56b4f0[_0xefc6('0x45')],null))[_0xefc6('0x22')](respondWithResult(_0x164ddd,null))['catch'](handleError(_0x164ddd,null));};exports[_0xefc6('0x21')]=function(_0x1805a5,_0x26c8a9){return db[_0xefc6('0x29')][_0xefc6('0x43')]({'where':{'id':_0x1805a5[_0xefc6('0x46')]['id']}})[_0xefc6('0x22')](handleEntityNotFound(_0x26c8a9,null))[_0xefc6('0x22')](removeEntity(_0x26c8a9,null))[_0xefc6('0x40')](handleError(_0x26c8a9,null));};exports[_0xefc6('0x47')]=function(_0x5e557f,_0x37ff7e){return db['VoiceDialReport']['describe']()[_0xefc6('0x22')](respondWithResult(_0x37ff7e,null))['catch'](handleError(_0x37ff7e,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f6328c2..0fe1d66 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 _0x886d=['bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x886d,0xe9));var _0xd886=function(_0x5b3447,_0x52bef4){_0x5b3447=_0x5b3447-0x0;var _0x2c10bf=_0x886d[_0x5b3447];return _0x2c10bf;};'use strict';var _=require(_0xd886('0x0'));var util=require(_0xd886('0x1'));var logger=require(_0xd886('0x2'))(_0xd886('0x3'));var moment=require(_0xd886('0x4'));var BPromise=require(_0xd886('0x5'));var rp=require(_0xd886('0x6'));var fs=require('fs');var path=require(_0xd886('0x7'));var rimraf=require('rimraf');var config=require(_0xd886('0x8'));var attributes=require(_0xd886('0x9'));module['exports']=function(_0xaf4bc6,_0xc6d2dd){return _0xaf4bc6[_0xd886('0xa')](_0xd886('0xb'),attributes,{'tableName':_0xd886('0xc'),'paranoid':![],'indexes':[{'fields':[_0xd886('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8881=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports'];(function(_0x1261c2,_0x3ef819){var _0x3aabd2=function(_0x425d76){while(--_0x425d76){_0x1261c2['push'](_0x1261c2['shift']());}};_0x3aabd2(++_0x3ef819);}(_0x8881,0xd0));var _0x1888=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x8881[_0x349367];return _0x14179b;};'use strict';var _=require(_0x1888('0x0'));var util=require(_0x1888('0x1'));var logger=require(_0x1888('0x2'))(_0x1888('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1888('0x4'));var fs=require('fs');var path=require(_0x1888('0x5'));var rimraf=require('rimraf');var config=require(_0x1888('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x1888('0x7')]=function(_0x4f29b5,_0x79a802){return _0x4f29b5[_0x1888('0x8')](_0x1888('0x9'),attributes,{'tableName':_0x1888('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1888('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 8da93ba..acb194f 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 _0x1dba=['raw','stringify','UpdateVoiceDialReport','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x298b27,_0x47ab26){var _0x2074bb=function(_0x33dcbd){while(--_0x33dcbd){_0x298b27['push'](_0x298b27['shift']());}};_0x2074bb(++_0x47ab26);}(_0x1dba,0x1d7));var _0xa1db=function(_0x195b71,_0x338040){_0x195b71=_0x195b71-0x0;var _0x7392ee=_0x1dba[_0x195b71];return _0x7392ee;};'use strict';var _=require(_0xa1db('0x0'));var util=require(_0xa1db('0x1'));var moment=require(_0xa1db('0x2'));var BPromise=require(_0xa1db('0x3'));var rs=require(_0xa1db('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1db('0x6'))(_0xa1db('0x7'));var config=require(_0xa1db('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa1db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x826f36,_0x1b3c73,_0x8ca0d5){return new BPromise(function(_0x4e4a19,_0xd06e63){return client[_0xa1db('0xa')](_0x826f36,_0x8ca0d5)[_0xa1db('0xb')](function(_0x15eca7){logger[_0xa1db('0xc')](_0xa1db('0xd'),_0x1b3c73,_0xa1db('0xe'));logger[_0xa1db('0xf')](_0xa1db('0x10'),_0x1b3c73,_0xa1db('0xe'),JSON['stringify'](_0x15eca7));if(_0x15eca7[_0xa1db('0x11')]){if(_0x15eca7[_0xa1db('0x11')][_0xa1db('0x12')]===0x1f4){logger[_0xa1db('0x11')](_0xa1db('0xd'),_0x1b3c73,_0x15eca7[_0xa1db('0x11')][_0xa1db('0x13')]);return _0xd06e63(_0x15eca7[_0xa1db('0x11')][_0xa1db('0x13')]);}logger[_0xa1db('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x1b3c73,_0x15eca7[_0xa1db('0x11')][_0xa1db('0x13')]);return _0x4e4a19(_0x15eca7[_0xa1db('0x11')][_0xa1db('0x13')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x1b3c73,'request\x20sent');_0x4e4a19(_0x15eca7[_0xa1db('0x14')]['message']);}})[_0xa1db('0x15')](function(_0x46adfd){logger[_0xa1db('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x1b3c73,_0x46adfd);_0xd06e63(_0x46adfd);});});}exports[_0xa1db('0x16')]=function(_0x229dc8){var _0x27d875=this;return new Promise(function(_0x4188fc,_0xe27817){return db[_0xa1db('0x17')]['create'](_0x229dc8['body'],{'raw':_0x229dc8['options']?_0x229dc8['options'][_0xa1db('0x18')]===undefined?!![]:![]:!![]})[_0xa1db('0xb')](function(_0x34ffa0){logger[_0xa1db('0xc')]('CreateVoiceDialReport',_0x229dc8);logger[_0xa1db('0xf')]('CreateVoiceDialReport',_0x229dc8,JSON[_0xa1db('0x19')](_0x34ffa0));_0x4188fc(_0x34ffa0);})[_0xa1db('0x15')](function(_0x49c7fb){logger[_0xa1db('0x11')]('CreateVoiceDialReport',_0x49c7fb[_0xa1db('0x13')],_0x229dc8);_0xe27817(_0x27d875[_0xa1db('0x11')](0x1f4,_0x49c7fb[_0xa1db('0x13')]));});});};exports[_0xa1db('0x1a')]=function(_0x691a22){var _0xdc2716=this;return new Promise(function(_0x33fe68,_0x50f8b9){return db[_0xa1db('0x17')][_0xa1db('0x1b')](_0x691a22[_0xa1db('0x1c')],{'raw':_0x691a22[_0xa1db('0x1d')]?_0x691a22[_0xa1db('0x1d')][_0xa1db('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x691a22[_0xa1db('0x1d')]?_0x691a22['options'][_0xa1db('0x1e')]||null:null,'attributes':_0x691a22[_0xa1db('0x1d')]?_0x691a22[_0xa1db('0x1d')][_0xa1db('0x1f')]||null:null,'limit':_0x691a22[_0xa1db('0x1d')]?_0x691a22[_0xa1db('0x1d')][_0xa1db('0x20')]||null:null})[_0xa1db('0xb')](function(_0x445caa){logger[_0xa1db('0xc')](_0xa1db('0x1a'),_0x691a22);logger[_0xa1db('0xf')](_0xa1db('0x1a'),_0x691a22,JSON[_0xa1db('0x19')](_0x445caa));_0x33fe68(_0x445caa);})[_0xa1db('0x15')](function(_0x3bfa68){logger['error']('UpdateVoiceDialReport',_0x3bfa68[_0xa1db('0x13')],_0x691a22);_0x50f8b9(_0xdc2716[_0xa1db('0x11')](0x1f4,_0x3bfa68[_0xa1db('0x13')]));});});}; \ No newline at end of file +var _0x8b90=['update','where','attributes','limit','UpdateVoiceDialReport','lodash','util','bluebird','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','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','debug'];(function(_0x2dddd5,_0x350741){var _0x1f223a=function(_0x5ba4a7){while(--_0x5ba4a7){_0x2dddd5['push'](_0x2dddd5['shift']());}};_0x1f223a(++_0x350741);}(_0x8b90,0xf3));var _0x08b9=function(_0x1ca8d8,_0x17aa35){_0x1ca8d8=_0x1ca8d8-0x0;var _0x1161d8=_0x8b90[_0x1ca8d8];return _0x1161d8;};'use strict';var _=require(_0x08b9('0x0'));var util=require(_0x08b9('0x1'));var moment=require('moment');var BPromise=require(_0x08b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x08b9('0x3'));var db=require(_0x08b9('0x4'))['db'];var utils=require(_0x08b9('0x5'));var logger=require(_0x08b9('0x6'))(_0x08b9('0x7'));var config=require(_0x08b9('0x8'));var jayson=require(_0x08b9('0x9'));var client=jayson['client'][_0x08b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53afed,_0x2fc822,_0x5c7854){return new BPromise(function(_0x77e8cf,_0x1e3364){return client[_0x08b9('0xb')](_0x53afed,_0x5c7854)[_0x08b9('0xc')](function(_0x1f59ad){logger[_0x08b9('0xd')](_0x08b9('0xe'),_0x2fc822,_0x08b9('0xf'));logger['debug'](_0x08b9('0x10'),_0x2fc822,_0x08b9('0xf'),JSON[_0x08b9('0x11')](_0x1f59ad));if(_0x1f59ad[_0x08b9('0x12')]){if(_0x1f59ad[_0x08b9('0x12')][_0x08b9('0x13')]===0x1f4){logger[_0x08b9('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x2fc822,_0x1f59ad[_0x08b9('0x12')]['message']);return _0x1e3364(_0x1f59ad['error'][_0x08b9('0x14')]);}logger[_0x08b9('0x12')](_0x08b9('0xe'),_0x2fc822,_0x1f59ad['error'][_0x08b9('0x14')]);return _0x77e8cf(_0x1f59ad[_0x08b9('0x12')]['message']);}else{logger[_0x08b9('0xd')](_0x08b9('0xe'),_0x2fc822,_0x08b9('0xf'));_0x77e8cf(_0x1f59ad[_0x08b9('0x15')][_0x08b9('0x14')]);}})[_0x08b9('0x16')](function(_0x12bb65){logger[_0x08b9('0x12')](_0x08b9('0xe'),_0x2fc822,_0x12bb65);_0x1e3364(_0x12bb65);});});}exports[_0x08b9('0x17')]=function(_0x15300f){var _0x5a2c71=this;return new Promise(function(_0x3b1a24,_0x4ce860){return db[_0x08b9('0x18')][_0x08b9('0x19')](_0x15300f[_0x08b9('0x1a')],{'raw':_0x15300f['options']?_0x15300f[_0x08b9('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x45e02c){logger[_0x08b9('0xd')](_0x08b9('0x17'),_0x15300f);logger[_0x08b9('0x1c')](_0x08b9('0x17'),_0x15300f,JSON[_0x08b9('0x11')](_0x45e02c));_0x3b1a24(_0x45e02c);})[_0x08b9('0x16')](function(_0x489a97){logger[_0x08b9('0x12')](_0x08b9('0x17'),_0x489a97[_0x08b9('0x14')],_0x15300f);_0x4ce860(_0x5a2c71[_0x08b9('0x12')](0x1f4,_0x489a97[_0x08b9('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x3c4b12){var _0x56f4bb=this;return new Promise(function(_0x4cb802,_0x5c59a1){return db['VoiceDialReport'][_0x08b9('0x1d')](_0x3c4b12['body'],{'raw':_0x3c4b12['options']?_0x3c4b12[_0x08b9('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c4b12[_0x08b9('0x1b')]?_0x3c4b12[_0x08b9('0x1b')][_0x08b9('0x1e')]||null:null,'attributes':_0x3c4b12['options']?_0x3c4b12[_0x08b9('0x1b')][_0x08b9('0x1f')]||null:null,'limit':_0x3c4b12[_0x08b9('0x1b')]?_0x3c4b12[_0x08b9('0x1b')][_0x08b9('0x20')]||null:null})['then'](function(_0x4da442){logger[_0x08b9('0xd')](_0x08b9('0x21'),_0x3c4b12);logger['debug']('UpdateVoiceDialReport',_0x3c4b12,JSON[_0x08b9('0x11')](_0x4da442));_0x4cb802(_0x4da442);})[_0x08b9('0x16')](function(_0x154eb0){logger[_0x08b9('0x12')](_0x08b9('0x21'),_0x154eb0[_0x08b9('0x14')],_0x3c4b12);_0x5c59a1(_0x56f4bb[_0x08b9('0x12')](0x1f4,_0x154eb0[_0x08b9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a6dee1a..7984926 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 _0x96cd=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','/:id/applications','update','delete','exports','util','path','connect-timeout','express'];(function(_0x51f012,_0x629f0d){var _0x1e3e8f=function(_0x5f4175){while(--_0x5f4175){_0x51f012['push'](_0x51f012['shift']());}};_0x1e3e8f(++_0x629f0d);}(_0x96cd,0x1be));var _0xd96c=function(_0x113166,_0x137768){_0x113166=_0x113166-0x0;var _0x1b097d=_0x96cd[_0x113166];return _0x1b097d;};'use strict';var multer=require('multer');var util=require(_0xd96c('0x0'));var path=require(_0xd96c('0x1'));var timeout=require(_0xd96c('0x2'));var express=require(_0xd96c('0x3'));var router=express[_0xd96c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd96c('0x5'));var interaction=require(_0xd96c('0x6'));var config=require(_0xd96c('0x7'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0xd96c('0x8')](),controller[_0xd96c('0x9')]);router['get'](_0xd96c('0xa'),auth['isAuthenticated'](),controller[_0xd96c('0xb')]);router[_0xd96c('0xc')]('/',auth[_0xd96c('0x8')](),controller[_0xd96c('0xd')]);router['post'](_0xd96c('0xe'),auth['isAuthenticated'](),controller['addApplications']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd96c('0xf')]);router[_0xd96c('0x10')](_0xd96c('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd96c('0x11')]=router; \ No newline at end of file +var _0x1240=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','show','create','post','/:id/applications','addApplications','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5d6769,_0x175e86){var _0x58950b=function(_0x4d4598){while(--_0x4d4598){_0x5d6769['push'](_0x5d6769['shift']());}};_0x58950b(++_0x175e86);}(_0x1240,0xb9));var _0x0124=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x1240[_0x1beef3];return _0x5af964;};'use strict';var multer=require('multer');var util=require(_0x0124('0x0'));var path=require(_0x0124('0x1'));var timeout=require(_0x0124('0x2'));var express=require(_0x0124('0x3'));var router=express[_0x0124('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0124('0x5'));var controller=require(_0x0124('0x6'));router[_0x0124('0x7')]('/',auth[_0x0124('0x8')](),controller['index']);router[_0x0124('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0124('0x9')]);router['post']('/',auth[_0x0124('0x8')](),controller[_0x0124('0xa')]);router[_0x0124('0xb')](_0x0124('0xc'),auth[_0x0124('0x8')](),controller[_0x0124('0xd')]);router[_0x0124('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0124('0xf')](_0x0124('0x10'),auth[_0x0124('0x8')](),controller[_0x0124('0x11')]);module[_0x0124('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 350315b..1b02da6 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 _0xd44b=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','outbound','internal','outbound-fax','any'];(function(_0x48ef03,_0x2cafd2){var _0x213bbe=function(_0x3d0d27){while(--_0x3d0d27){_0x48ef03['push'](_0x48ef03['shift']());}};_0x213bbe(++_0x2cafd2);}(_0xd44b,0x1ba));var _0xbd44=function(_0x187034,_0x20101c){_0x187034=_0x187034-0x0;var _0x59f8e9=_0xd44b[_0x187034];return _0x59f8e9;};'use strict';var Sequelize=require(_0xbd44('0x0'));module['exports']={'context':{'type':Sequelize[_0xbd44('0x1')],'allowNull':![],'unique':_0xbd44('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbd44('0x1')],'allowNull':![],'unique':_0xbd44('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xbd44('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbd44('0x1')],'allowNull':![],'defaultValue':_0xbd44('0x3')},'appdata':{'type':Sequelize[_0xbd44('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xbd44('0x4'),_0xbd44('0x5'),'inbound-fax',_0xbd44('0x6'),'system',_0xbd44('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xbd44('0x1')]},'interval':{'type':Sequelize[_0xbd44('0x1')],'allowNull':![],'defaultValue':_0xbd44('0x8')},'IntervalId':{'type':Sequelize[_0xbd44('0x9')]},'isApp':{'type':Sequelize[_0xbd44('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbd44('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbd44('0x9')]},'recordingFormat':{'type':Sequelize[_0xbd44('0x1')],'defaultValue':_0xbd44('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xbd44('0xc')],'get':function(_0x555cda){return this[_0xbd44('0xd')](_0xbd44('0xe'));}},'alias':{'type':Sequelize[_0xbd44('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xacb4=['any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','system'];(function(_0x3cb5b5,_0x46c74f){var _0x36a650=function(_0x53e219){while(--_0x53e219){_0x3cb5b5['push'](_0x3cb5b5['shift']());}};_0x36a650(++_0x46c74f);}(_0xacb4,0x95));var _0x4acb=function(_0x4828b1,_0x5c8cf3){_0x4828b1=_0x4828b1-0x0;var _0x1fec1b=_0xacb4[_0x4828b1];return _0x1fec1b;};'use strict';var Sequelize=require(_0x4acb('0x0'));module[_0x4acb('0x1')]={'context':{'type':Sequelize[_0x4acb('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4acb('0x2')],'allowNull':![],'unique':_0x4acb('0x3')},'priority':{'type':Sequelize[_0x4acb('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4acb('0x3')},'tag':{'type':Sequelize[_0x4acb('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4acb('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4acb('0x4')](_0x4acb('0x5'),'outbound','internal','inbound-fax','outbound-fax',_0x4acb('0x6'),_0x4acb('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0x4acb('0x2')]},'interval':{'type':Sequelize[_0x4acb('0x2')],'allowNull':![],'defaultValue':_0x4acb('0x8')},'IntervalId':{'type':Sequelize[_0x4acb('0x9')]},'isApp':{'type':Sequelize[_0x4acb('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4acb('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4acb('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4acb('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4acb('0x9')]},'recordingFormat':{'type':Sequelize[_0x4acb('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x4acb('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4acb('0xb')],'get':function(_0x457d68){return this['getDataValue'](_0x4acb('0xc'));}},'alias':{'type':Sequelize[_0x4acb('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 9071fea..441e473 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 _0xbfbd=['OutboundRoutes','InternalRoutes','filter','ignore','value','includes','type','name','end','stack','send','index','map','VoiceExtension','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','outbound','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','internal','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','Transaction','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','sendStatus','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','undefined','limit','count','offset','set','destroy','then','get'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xbfbd,0xa6));var _0xdbfb=function(_0x329384,_0x5eec18){_0x329384=_0x329384-0x0;var _0x301586=_0xbfbd[_0x329384];return _0x301586;};'use strict';var _=require(_0xdbfb('0x0'));var Redis=require(_0xdbfb('0x1'));var qs=require(_0xdbfb('0x2'));var logger=require(_0xdbfb('0x3'))(_0xdbfb('0x4'));var config=require(_0xdbfb('0x5'));var db=require('../../mysqldb')['db'];config[_0xdbfb('0x6')]=_[_0xdbfb('0x7')](config['redis'],{'host':_0xdbfb('0x8'),'port':0x18eb});var socket=require(_0xdbfb('0x9'))(new Redis(config[_0xdbfb('0x6')]));require(_0xdbfb('0xa'))[_0xdbfb('0xb')](socket);function respondWithStatusCode(_0xe675de,_0x4a5d5b){_0x4a5d5b=_0x4a5d5b||0xcc;return function(_0x47989f){if(_0x47989f){return _0xe675de['sendStatus'](_0x4a5d5b);}return _0xe675de[_0xdbfb('0xc')](_0x4a5d5b)['end']();};}function respondWithResult(_0x9f890,_0x4f6698){_0x4f6698=_0x4f6698||0xc8;return function(_0x53b417){if(_0x53b417){return _0x9f890[_0xdbfb('0xc')](_0x4f6698)[_0xdbfb('0xd')](_0x53b417);}};}function respondWithFilteredResult(_0x14e4ed,_0x1e2969){return function(_0x2001eb){if(_0x2001eb){var _0x5e4be1=typeof _0x1e2969['offset']===_0xdbfb('0xe')&&typeof _0x1e2969[_0xdbfb('0xf')]===_0xdbfb('0xe');var _0x4a0e1a=_0x2001eb[_0xdbfb('0x10')];var _0xb1724a=_0x5e4be1?0x0:_0x1e2969[_0xdbfb('0x11')];var _0x2c0cbc=_0x5e4be1?_0x2001eb[_0xdbfb('0x10')]:_0x1e2969['offset']+_0x1e2969['limit'];var _0x217d09;if(_0x2c0cbc>=_0x4a0e1a){_0x2c0cbc=_0x4a0e1a;_0x217d09=0xc8;}else{_0x217d09=0xce;}_0x14e4ed['status'](_0x217d09);return _0x14e4ed[_0xdbfb('0x12')]('Content-Range',_0xb1724a+'-'+_0x2c0cbc+'/'+_0x4a0e1a)[_0xdbfb('0xd')](_0x2001eb);}return null;};}function removeEntity(_0x50fb21){return function(_0x2a9794){if(_0x2a9794){return _0x2a9794[_0xdbfb('0x13')]()[_0xdbfb('0x14')](function(){var _0x10bd9e=_0x2a9794[_0xdbfb('0x15')]({'plain':!![]});var _0x2006ca=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0xdbfb('0x16'),'value':'outbound','ignore':![]},{'name':_0xdbfb('0x17'),'value':'internal','ignore':![]}];var _0x394845=_(_0x2006ca)[_0xdbfb('0x18')](_0xdbfb('0x19'))['map'](_0xdbfb('0x1a'))[_0xdbfb('0x1a')]();if(_[_0xdbfb('0x1b')](_0x394845,_0x10bd9e['type'])){return;}var _0x2e4522=_['find'](_0x2006ca,[_0xdbfb('0x1a'),_0x10bd9e[_0xdbfb('0x1c')]])[_0xdbfb('0x1d')];return db['UserProfileResource'][_0xdbfb('0x13')]({'where':{'type':_0x2e4522,'resourceId':_0x10bd9e['id']}})[_0xdbfb('0x14')](function(){return _0x2a9794;});})[_0xdbfb('0x14')](function(){_0x50fb21[_0xdbfb('0xc')](0xcc)[_0xdbfb('0x1e')]();});}};}function handleEntityNotFound(_0x667e00){return function(_0x2feb28){if(!_0x2feb28){_0x667e00['sendStatus'](0x194);}return _0x2feb28;};}function handleError(_0x405fc3,_0x57e22b){_0x57e22b=_0x57e22b||0x1f4;return function(_0x27bde8){logger['error'](_0x27bde8[_0xdbfb('0x1f')]);if(_0x27bde8[_0xdbfb('0x1d')]){delete _0x27bde8[_0xdbfb('0x1d')];}_0x405fc3[_0xdbfb('0xc')](_0x57e22b)[_0xdbfb('0x20')](_0x27bde8);};}exports[_0xdbfb('0x21')]=function(_0x4c3753,_0x47f8e6){var _0xc725fb={},_0x15c549={},_0x41dfdf={'count':0x0,'rows':[]};var _0x13fab0=_[_0xdbfb('0x22')](db[_0xdbfb('0x23')][_0xdbfb('0x24')],function(_0x266025){return{'name':_0x266025['fieldName'],'type':_0x266025['type'][_0xdbfb('0x25')]};});_0x15c549[_0xdbfb('0x26')]=_[_0xdbfb('0x22')](_0x13fab0,_0xdbfb('0x1d'));_0x15c549[_0xdbfb('0x27')]=_[_0xdbfb('0x28')](_0x4c3753[_0xdbfb('0x27')]);_0x15c549['filters']=_[_0xdbfb('0x29')](_0x15c549[_0xdbfb('0x26')],_0x15c549['query']);_0xc725fb[_0xdbfb('0x2a')]=_[_0xdbfb('0x29')](_0x15c549['model'],qs[_0xdbfb('0x2b')](_0x4c3753['query'][_0xdbfb('0x2b')]));_0xc725fb[_0xdbfb('0x2a')]=_0xc725fb[_0xdbfb('0x2a')][_0xdbfb('0x2c')]?_0xc725fb['attributes']:_0x15c549[_0xdbfb('0x26')];if(!_0x4c3753[_0xdbfb('0x27')][_0xdbfb('0x2d')](_0xdbfb('0x2e'))){_0xc725fb[_0xdbfb('0xf')]=qs[_0xdbfb('0xf')](_0x4c3753[_0xdbfb('0x27')]['limit']);_0xc725fb['offset']=qs['offset'](_0x4c3753[_0xdbfb('0x27')][_0xdbfb('0x11')]);}_0xc725fb[_0xdbfb('0x2f')]=qs[_0xdbfb('0x30')](_0x4c3753['query'][_0xdbfb('0x30')]);_0xc725fb[_0xdbfb('0x31')]=qs['filters'](_[_0xdbfb('0x32')](_0x4c3753[_0xdbfb('0x27')],_0x15c549[_0xdbfb('0x33')]),_0x13fab0);if(_0x4c3753[_0xdbfb('0x27')]['filter']){_0xc725fb['where']=_[_0xdbfb('0x34')](_0xc725fb['where'],{'$or':_[_0xdbfb('0x22')](_0x13fab0,function(_0x1cfb66){if(_0x1cfb66[_0xdbfb('0x1c')]!==_0xdbfb('0x35')){var _0x189735={};_0x189735[_0x1cfb66[_0xdbfb('0x1d')]]={'$like':'%'+_0x4c3753[_0xdbfb('0x27')][_0xdbfb('0x18')]+'%'};return _0x189735;}})});}_0xc725fb=_[_0xdbfb('0x34')]({},_0xc725fb,_0x4c3753[_0xdbfb('0x36')]);var _0x27d938={'where':_0xc725fb['where']};return db[_0xdbfb('0x23')][_0xdbfb('0x10')](_0x27d938)[_0xdbfb('0x14')](function(_0x4f04fc){_0x41dfdf[_0xdbfb('0x10')]=_0x4f04fc;if(_0x4c3753['query']['includeAll']){_0xc725fb[_0xdbfb('0x37')]=[{'all':!![]}];}return db[_0xdbfb('0x23')][_0xdbfb('0x38')](_0xc725fb);})['then'](function(_0x16eb87){_0x41dfdf[_0xdbfb('0x39')]=_0x16eb87;return _0x41dfdf;})[_0xdbfb('0x14')](respondWithFilteredResult(_0x47f8e6,_0xc725fb))[_0xdbfb('0x3a')](handleError(_0x47f8e6,null));};exports[_0xdbfb('0x3b')]=function(_0x304178,_0x183226){var _0x406bd3={'raw':![],'where':{'id':_0x304178[_0xdbfb('0x3c')]['id']}},_0x13ae0={};_0x13ae0[_0xdbfb('0x26')]=_['keys'](db[_0xdbfb('0x23')][_0xdbfb('0x24')]);_0x13ae0['query']=_['keys'](_0x304178[_0xdbfb('0x27')]);_0x13ae0[_0xdbfb('0x33')]=_['intersection'](_0x13ae0['model'],_0x13ae0['query']);_0x406bd3[_0xdbfb('0x2a')]=_[_0xdbfb('0x29')](_0x13ae0[_0xdbfb('0x26')],qs['fields'](_0x304178[_0xdbfb('0x27')][_0xdbfb('0x2b')]));_0x406bd3[_0xdbfb('0x2a')]=_0x406bd3['attributes'][_0xdbfb('0x2c')]?_0x406bd3[_0xdbfb('0x2a')]:_0x13ae0[_0xdbfb('0x26')];if(_0x304178['query']['includeAll']){_0x406bd3[_0xdbfb('0x37')]=[{'all':!![]}];}_0x406bd3=_[_0xdbfb('0x34')]({},_0x406bd3,_0x304178[_0xdbfb('0x36')]);return db[_0xdbfb('0x23')][_0xdbfb('0x3d')](_0x406bd3)[_0xdbfb('0x14')](handleEntityNotFound(_0x183226,null))[_0xdbfb('0x14')](respondWithResult(_0x183226,null))[_0xdbfb('0x3a')](handleError(_0x183226,null));};exports[_0xdbfb('0x13')]=function(_0x277b9f,_0x36c124){return db[_0xdbfb('0x23')][_0xdbfb('0x3d')]({'where':{'id':_0x277b9f[_0xdbfb('0x3c')]['id']}})[_0xdbfb('0x14')](handleEntityNotFound(_0x36c124,null))[_0xdbfb('0x14')](removeEntity(_0x36c124,null))[_0xdbfb('0x3a')](handleError(_0x36c124,null));};exports[_0xdbfb('0x3e')]=function(_0x4b348e,_0x1bb996){if(_0x4b348e['body'][_0xdbfb('0x1c')]===_0xdbfb('0x3f')&&!_[_0xdbfb('0x40')](_0x4b348e[_0xdbfb('0x41')][_0xdbfb('0x42')],'_')){_0x4b348e[_0xdbfb('0x41')][_0xdbfb('0x42')]='_'[_0xdbfb('0x43')](_0x4b348e[_0xdbfb('0x41')][_0xdbfb('0x42')]);}return db['VoiceExtension'][_0xdbfb('0x3e')](_0x4b348e[_0xdbfb('0x41')],{'raw':![]})[_0xdbfb('0x14')](function(_0xaf8d1e){var _0xc2f94=_0x4b348e[_0xdbfb('0x44')][_0xdbfb('0x15')]({'plain':!![]});if(!_0xc2f94)throw new Error(_0xdbfb('0x45'));if(_0xc2f94['role']==='user'){var _0x4a0531=_0xaf8d1e['get']({'plain':!![]});var _0x327489=[{'name':'InboundRoutes','value':_0xdbfb('0x46')},{'name':_0xdbfb('0x16'),'value':'outbound'},{'name':_0xdbfb('0x17'),'value':_0xdbfb('0x47')}];var _0x5e3143=_[_0xdbfb('0x3d')](_0x327489,[_0xdbfb('0x1a'),_0x4a0531[_0xdbfb('0x1c')]])[_0xdbfb('0x1d')];return db[_0xdbfb('0x48')][_0xdbfb('0x3d')]({'where':{'name':_0x5e3143,'userProfileId':_0xc2f94[_0xdbfb('0x49')]},'raw':!![]})['then'](function(_0x40a299){if(_0x40a299&&_0x40a299['autoAssociation']===0x0){return db['UserProfileResource'][_0xdbfb('0x3e')]({'name':_0x4a0531['name'],'resourceId':_0x4a0531['id'],'type':_0x40a299[_0xdbfb('0x1d')],'sectionId':_0x40a299['id']},{})[_0xdbfb('0x14')](function(){return _0xaf8d1e;});}else{return _0xaf8d1e;}})[_0xdbfb('0x3a')](function(_0x39b3b9){logger[_0xdbfb('0x4a')](_0xdbfb('0x4b'),_0x39b3b9);throw _0x39b3b9;});}return _0xaf8d1e;})[_0xdbfb('0x14')](respondWithResult(_0x1bb996,0xc9))[_0xdbfb('0x3a')](handleError(_0x1bb996,null));};exports[_0xdbfb('0x4c')]=function(_0x5e8867,_0x555c19){if(_0x5e8867[_0xdbfb('0x41')]['id']){delete _0x5e8867[_0xdbfb('0x41')]['id'];}return db['VoiceExtension'][_0xdbfb('0x3d')]({'where':{'id':_0x5e8867['params']['id']}})[_0xdbfb('0x14')](handleEntityNotFound(_0x555c19,null))['then'](function(_0x1da1ed){if(_0x1da1ed){return db[_0xdbfb('0x23')][_0xdbfb('0x4c')](_['pick'](_0x5e8867['body'],[_0xdbfb('0x42'),_0xdbfb('0x4d'),_0xdbfb('0x4e'),_0xdbfb('0x4f'),'cutdigits',_0xdbfb('0x50'),_0xdbfb('0x51')]),{'where':{'context':_0x1da1ed[_0xdbfb('0x4d')],'exten':_0x1da1ed[_0xdbfb('0x42')]},'individualHooks':!![]})[_0xdbfb('0x14')](function(_0x475695){return _0x475695;});}return null;})[_0xdbfb('0x14')](respondWithStatusCode(_0x555c19,null))['catch'](handleError(_0x555c19,null));};exports[_0xdbfb('0x52')]=function(_0x18fdf9,_0x2c494c){var _0x35ae31=_0x18fdf9['params']['id'];var _0x307f17=_0x18fdf9[_0xdbfb('0x41')];var _0x3a8bcb=0xc8;var _0x21a008=null;return db[_0xdbfb('0x53')]['transaction']({'isolationLevel':db['sequelize'][_0xdbfb('0x54')]['ISOLATION_LEVELS'][_0xdbfb('0x55')]},function(_0x4ddbc0){return db[_0xdbfb('0x23')][_0xdbfb('0x56')]({'where':{'id':_0x35ae31},'transaction':_0x4ddbc0})[_0xdbfb('0x14')](function(_0x3d0cc3){if(_0x3d0cc3){return db[_0xdbfb('0x23')]['destroy']({'where':{'VoiceExtensionId':_0x35ae31},'transaction':_0x4ddbc0})[_0xdbfb('0x14')](function(){var _0xcaf1cd=_['map'](_0x307f17,function(_0x18cd8f){_0x18cd8f['VoiceExtensionId']=_0x35ae31;_0x18cd8f[_0xdbfb('0x57')]=!![];return _0x18cd8f;});return _0x3d0cc3[_0xdbfb('0x58')](_0xcaf1cd);})['then'](function(_0x593e25){return db['VoiceExtension'][_0xdbfb('0x59')](_0x593e25,{'transaction':_0x4ddbc0});});}else{_0x3a8bcb=0x194;_0x21a008=[];}});})[_0xdbfb('0x14')](function(){if(_0x3a8bcb!==0x194){return db[_0xdbfb('0x23')][_0xdbfb('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x35ae31},'order':_0xdbfb('0x5b')})[_0xdbfb('0x14')](function(_0x1cf158){_0x21a008=_0x1cf158;});}})[_0xdbfb('0x3a')](function(_0x448b0f){_0x3a8bcb=0x1f4;logger[_0xdbfb('0x4a')](_0x448b0f[_0xdbfb('0x1f')]);if(_0x448b0f['name']){delete _0x448b0f[_0xdbfb('0x1d')];}_0x21a008=_0x448b0f;})[_0xdbfb('0x5c')](function(){if(_0x21a008===null){_0x2c494c[_0xdbfb('0x5d')](_0x3a8bcb);}else{if(_0x3a8bcb===0x1f4){_0x2c494c[_0xdbfb('0xc')](_0x3a8bcb)[_0xdbfb('0x20')](_0x21a008);}else{_0x2c494c[_0xdbfb('0xc')](_0x3a8bcb)['json'](_0x21a008);}}});}; \ No newline at end of file +var _0xf159=['show','params','options','catch','create','startsWith','exten','body','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','send','lodash','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','then','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x4dd6d4,_0x31a217){var _0x3d3177=function(_0x405a1a){while(--_0x405a1a){_0x4dd6d4['push'](_0x4dd6d4['shift']());}};_0x3d3177(++_0x31a217);}(_0xf159,0xe3));var _0x9f15=function(_0x1f019a,_0x2abe70){_0x1f019a=_0x1f019a-0x0;var _0x1864ec=_0xf159[_0x1f019a];return _0x1864ec;};'use strict';var _=require(_0x9f15('0x0'));var Redis=require(_0x9f15('0x1'));var qs=require(_0x9f15('0x2'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x9f15('0x3'))['db'];config[_0x9f15('0x4')]=_[_0x9f15('0x5')](config[_0x9f15('0x4')],{'host':_0x9f15('0x6'),'port':0x18eb});var socket=require(_0x9f15('0x7'))(new Redis(config['redis']));require(_0x9f15('0x8'))['register'](socket);function respondWithStatusCode(_0x2cea3f,_0x55b075){_0x55b075=_0x55b075||0xcc;return function(_0x381678){if(_0x381678){return _0x2cea3f[_0x9f15('0x9')](_0x55b075);}return _0x2cea3f[_0x9f15('0xa')](_0x55b075)[_0x9f15('0xb')]();};}function respondWithResult(_0x1b7c6a,_0x1b7f46){_0x1b7f46=_0x1b7f46||0xc8;return function(_0xccf9b5){if(_0xccf9b5){return _0x1b7c6a[_0x9f15('0xa')](_0x1b7f46)[_0x9f15('0xc')](_0xccf9b5);}};}function respondWithFilteredResult(_0x2d5bf2,_0x121937){return function(_0x473f76){if(_0x473f76){var _0x1b50de=typeof _0x121937[_0x9f15('0xd')]===_0x9f15('0xe')&&typeof _0x121937[_0x9f15('0xf')]===_0x9f15('0xe');var _0x30f844=_0x473f76[_0x9f15('0x10')];var _0x3774d4=_0x1b50de?0x0:_0x121937[_0x9f15('0xd')];var _0xb81243=_0x1b50de?_0x473f76[_0x9f15('0x10')]:_0x121937[_0x9f15('0xd')]+_0x121937[_0x9f15('0xf')];var _0x333bf6;if(_0xb81243>=_0x30f844){_0xb81243=_0x30f844;_0x333bf6=0xc8;}else{_0x333bf6=0xce;}_0x2d5bf2[_0x9f15('0xa')](_0x333bf6);return _0x2d5bf2[_0x9f15('0x11')](_0x9f15('0x12'),_0x3774d4+'-'+_0xb81243+'/'+_0x30f844)[_0x9f15('0xc')](_0x473f76);}return null;};}function removeEntity(_0x110187){return function(_0xb3d373){if(_0xb3d373){return _0xb3d373[_0x9f15('0x13')]()['then'](function(){var _0x19c294=_0xb3d373[_0x9f15('0x14')]({'plain':!![]});var _0x481760=[{'name':_0x9f15('0x15'),'value':_0x9f15('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0x9f15('0x17'),'ignore':![]},{'name':_0x9f15('0x18'),'value':_0x9f15('0x19'),'ignore':![]}];var _0x94062b=_(_0x481760)[_0x9f15('0x1a')]('ignore')[_0x9f15('0x1b')](_0x9f15('0x1c'))[_0x9f15('0x1c')]();if(_[_0x9f15('0x1d')](_0x94062b,_0x19c294[_0x9f15('0x1e')])){return;}var _0x3b2562=_[_0x9f15('0x1f')](_0x481760,[_0x9f15('0x1c'),_0x19c294[_0x9f15('0x1e')]])[_0x9f15('0x20')];return db[_0x9f15('0x21')]['destroy']({'where':{'type':_0x3b2562,'resourceId':_0x19c294['id']}})[_0x9f15('0x22')](function(){return _0xb3d373;});})[_0x9f15('0x22')](function(){_0x110187['status'](0xcc)[_0x9f15('0xb')]();});}};}function handleEntityNotFound(_0xb42c54){return function(_0x20b73e){if(!_0x20b73e){_0xb42c54['sendStatus'](0x194);}return _0x20b73e;};}function handleError(_0x2eb268,_0x102f40){_0x102f40=_0x102f40||0x1f4;return function(_0x3ecf98){logger['error'](_0x3ecf98[_0x9f15('0x23')]);if(_0x3ecf98[_0x9f15('0x20')]){delete _0x3ecf98['name'];}_0x2eb268[_0x9f15('0xa')](_0x102f40)['send'](_0x3ecf98);};}exports[_0x9f15('0x24')]=function(_0x133459,_0x4785eb){var _0x1757d7={},_0x3d6329={},_0x59d24b={'count':0x0,'rows':[]};var _0x23562b=_['map'](db[_0x9f15('0x25')][_0x9f15('0x26')],function(_0x53c10b){return{'name':_0x53c10b[_0x9f15('0x27')],'type':_0x53c10b['type'][_0x9f15('0x28')]};});_0x3d6329[_0x9f15('0x29')]=_[_0x9f15('0x1b')](_0x23562b,'name');_0x3d6329['query']=_[_0x9f15('0x2a')](_0x133459[_0x9f15('0x2b')]);_0x3d6329[_0x9f15('0x2c')]=_['intersection'](_0x3d6329[_0x9f15('0x29')],_0x3d6329[_0x9f15('0x2b')]);_0x1757d7[_0x9f15('0x2d')]=_[_0x9f15('0x2e')](_0x3d6329['model'],qs['fields'](_0x133459['query'][_0x9f15('0x2f')]));_0x1757d7[_0x9f15('0x2d')]=_0x1757d7['attributes'][_0x9f15('0x30')]?_0x1757d7['attributes']:_0x3d6329[_0x9f15('0x29')];if(!_0x133459[_0x9f15('0x2b')][_0x9f15('0x31')](_0x9f15('0x32'))){_0x1757d7['limit']=qs[_0x9f15('0xf')](_0x133459[_0x9f15('0x2b')][_0x9f15('0xf')]);_0x1757d7[_0x9f15('0xd')]=qs[_0x9f15('0xd')](_0x133459['query'][_0x9f15('0xd')]);}_0x1757d7[_0x9f15('0x33')]=qs[_0x9f15('0x34')](_0x133459['query'][_0x9f15('0x34')]);_0x1757d7[_0x9f15('0x35')]=qs[_0x9f15('0x2c')](_[_0x9f15('0x36')](_0x133459[_0x9f15('0x2b')],_0x3d6329[_0x9f15('0x2c')]),_0x23562b);if(_0x133459['query'][_0x9f15('0x1a')]){_0x1757d7[_0x9f15('0x35')]=_[_0x9f15('0x37')](_0x1757d7[_0x9f15('0x35')],{'$or':_['map'](_0x23562b,function(_0x2b2517){if(_0x2b2517[_0x9f15('0x1e')]!==_0x9f15('0x38')){var _0x26903c={};_0x26903c[_0x2b2517[_0x9f15('0x20')]]={'$like':'%'+_0x133459[_0x9f15('0x2b')][_0x9f15('0x1a')]+'%'};return _0x26903c;}})});}_0x1757d7=_['merge']({},_0x1757d7,_0x133459['options']);var _0x4a14d8={'where':_0x1757d7['where']};return db[_0x9f15('0x25')][_0x9f15('0x10')](_0x4a14d8)[_0x9f15('0x22')](function(_0x2d8b76){_0x59d24b['count']=_0x2d8b76;if(_0x133459[_0x9f15('0x2b')][_0x9f15('0x39')]){_0x1757d7[_0x9f15('0x3a')]=[{'all':!![]}];}return db['VoiceExtension'][_0x9f15('0x3b')](_0x1757d7);})[_0x9f15('0x22')](function(_0x136b69){_0x59d24b[_0x9f15('0x3c')]=_0x136b69;return _0x59d24b;})[_0x9f15('0x22')](respondWithFilteredResult(_0x4785eb,_0x1757d7))['catch'](handleError(_0x4785eb,null));};exports[_0x9f15('0x3d')]=function(_0x364df6,_0x2580e0){var _0x15af88={'raw':![],'where':{'id':_0x364df6[_0x9f15('0x3e')]['id']}},_0x29098a={};_0x29098a[_0x9f15('0x29')]=_[_0x9f15('0x2a')](db[_0x9f15('0x25')]['rawAttributes']);_0x29098a['query']=_['keys'](_0x364df6[_0x9f15('0x2b')]);_0x29098a[_0x9f15('0x2c')]=_[_0x9f15('0x2e')](_0x29098a[_0x9f15('0x29')],_0x29098a['query']);_0x15af88[_0x9f15('0x2d')]=_[_0x9f15('0x2e')](_0x29098a['model'],qs[_0x9f15('0x2f')](_0x364df6['query']['fields']));_0x15af88[_0x9f15('0x2d')]=_0x15af88[_0x9f15('0x2d')][_0x9f15('0x30')]?_0x15af88['attributes']:_0x29098a[_0x9f15('0x29')];if(_0x364df6[_0x9f15('0x2b')]['includeAll']){_0x15af88[_0x9f15('0x3a')]=[{'all':!![]}];}_0x15af88=_['merge']({},_0x15af88,_0x364df6[_0x9f15('0x3f')]);return db[_0x9f15('0x25')][_0x9f15('0x1f')](_0x15af88)[_0x9f15('0x22')](handleEntityNotFound(_0x2580e0,null))[_0x9f15('0x22')](respondWithResult(_0x2580e0,null))[_0x9f15('0x40')](handleError(_0x2580e0,null));};exports[_0x9f15('0x13')]=function(_0x5129bb,_0x5ce6ed){return db['VoiceExtension'][_0x9f15('0x1f')]({'where':{'id':_0x5129bb[_0x9f15('0x3e')]['id']}})[_0x9f15('0x22')](handleEntityNotFound(_0x5ce6ed,null))['then'](removeEntity(_0x5ce6ed,null))[_0x9f15('0x40')](handleError(_0x5ce6ed,null));};exports[_0x9f15('0x41')]=function(_0x12de16,_0x3239f0){if(_0x12de16['body'][_0x9f15('0x1e')]===_0x9f15('0x17')&&!_[_0x9f15('0x42')](_0x12de16['body'][_0x9f15('0x43')],'_')){_0x12de16[_0x9f15('0x44')][_0x9f15('0x43')]='_'[_0x9f15('0x45')](_0x12de16['body'][_0x9f15('0x43')]);}return db[_0x9f15('0x25')][_0x9f15('0x41')](_0x12de16[_0x9f15('0x44')],{'raw':![]})[_0x9f15('0x22')](function(_0x362bff){var _0x363353=_0x12de16[_0x9f15('0x46')][_0x9f15('0x14')]({'plain':!![]});if(!_0x363353)throw new Error(_0x9f15('0x47'));if(_0x363353[_0x9f15('0x48')]===_0x9f15('0x46')){var _0x231393=_0x362bff[_0x9f15('0x14')]({'plain':!![]});var _0x388db0=[{'name':'InboundRoutes','value':_0x9f15('0x16')},{'name':_0x9f15('0x49'),'value':_0x9f15('0x17')},{'name':_0x9f15('0x18'),'value':_0x9f15('0x19')}];var _0xddd90=_[_0x9f15('0x1f')](_0x388db0,[_0x9f15('0x1c'),_0x231393[_0x9f15('0x1e')]])[_0x9f15('0x20')];return db['UserProfileSection']['find']({'where':{'name':_0xddd90,'userProfileId':_0x363353[_0x9f15('0x4a')]},'raw':!![]})['then'](function(_0x4c085d){if(_0x4c085d&&_0x4c085d[_0x9f15('0x4b')]===0x0){return db[_0x9f15('0x21')][_0x9f15('0x41')]({'name':_0x231393[_0x9f15('0x20')],'resourceId':_0x231393['id'],'type':_0x4c085d[_0x9f15('0x20')],'sectionId':_0x4c085d['id']},{})['then'](function(){return _0x362bff;});}else{return _0x362bff;}})[_0x9f15('0x40')](function(_0x4602d3){logger[_0x9f15('0x4c')](_0x9f15('0x4d'),_0x4602d3);throw _0x4602d3;});}return _0x362bff;})['then'](respondWithResult(_0x3239f0,0xc9))['catch'](handleError(_0x3239f0,null));};exports[_0x9f15('0x4e')]=function(_0x461220,_0x3b9e38){if(_0x461220[_0x9f15('0x44')]['id']){delete _0x461220[_0x9f15('0x44')]['id'];}return db['VoiceExtension'][_0x9f15('0x1f')]({'where':{'id':_0x461220['params']['id']}})[_0x9f15('0x22')](handleEntityNotFound(_0x3b9e38,null))[_0x9f15('0x22')](function(_0x364680){if(_0x364680){return db[_0x9f15('0x25')][_0x9f15('0x4e')](_['pick'](_0x461220['body'],[_0x9f15('0x43'),_0x9f15('0x4f'),_0x9f15('0x50'),_0x9f15('0x51'),_0x9f15('0x52'),_0x9f15('0x53'),_0x9f15('0x54')]),{'where':{'context':_0x364680['context'],'exten':_0x364680[_0x9f15('0x43')]},'individualHooks':!![]})['then'](function(_0x3aab81){return _0x3aab81;});}return null;})[_0x9f15('0x22')](respondWithStatusCode(_0x3b9e38,null))['catch'](handleError(_0x3b9e38,null));};exports[_0x9f15('0x55')]=function(_0x1846a8,_0x521017){var _0x326e59=_0x1846a8[_0x9f15('0x3e')]['id'];var _0x288c3d=_0x1846a8[_0x9f15('0x44')];var _0x5541ba=0xc8;var _0x50e6b7=null;return db[_0x9f15('0x56')]['transaction']({'isolationLevel':db['sequelize'][_0x9f15('0x57')]['ISOLATION_LEVELS'][_0x9f15('0x58')]},function(_0x299aec){return db['VoiceExtension'][_0x9f15('0x59')]({'where':{'id':_0x326e59},'transaction':_0x299aec})['then'](function(_0x1eafa5){if(_0x1eafa5){return db[_0x9f15('0x25')][_0x9f15('0x13')]({'where':{'VoiceExtensionId':_0x326e59},'transaction':_0x299aec})[_0x9f15('0x22')](function(){var _0x8fe3f6=_[_0x9f15('0x1b')](_0x288c3d,function(_0x20651c){_0x20651c[_0x9f15('0x5a')]=_0x326e59;_0x20651c[_0x9f15('0x5b')]=!![];return _0x20651c;});return _0x1eafa5[_0x9f15('0x5c')](_0x8fe3f6);})['then'](function(_0x1cd654){return db[_0x9f15('0x25')]['bulkCreate'](_0x1cd654,{'transaction':_0x299aec});});}else{_0x5541ba=0x194;_0x50e6b7=[];}});})['then'](function(){if(_0x5541ba!==0x194){return db[_0x9f15('0x25')][_0x9f15('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x326e59},'order':_0x9f15('0x5e')})[_0x9f15('0x22')](function(_0x579040){_0x50e6b7=_0x579040;});}})[_0x9f15('0x40')](function(_0x45b78b){_0x5541ba=0x1f4;logger[_0x9f15('0x4c')](_0x45b78b[_0x9f15('0x23')]);if(_0x45b78b[_0x9f15('0x20')]){delete _0x45b78b['name'];}_0x50e6b7=_0x45b78b;})['finally'](function(){if(_0x50e6b7===null){_0x521017['sendStatus'](_0x5541ba);}else{if(_0x5541ba===0x1f4){_0x521017[_0x9f15('0xa')](_0x5541ba)[_0x9f15('0x5f')](_0x50e6b7);}else{_0x521017[_0x9f15('0xa')](_0x5541ba)['json'](_0x50e6b7);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 1c1f3d3..3bc1a5f 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 _0x55e0=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x175bc2,_0x174b9f){var _0x21fe70=function(_0x4383a5){while(--_0x4383a5){_0x175bc2['push'](_0x175bc2['shift']());}};_0x21fe70(++_0x174b9f);}(_0x55e0,0x176));var _0x055e=function(_0x4606be,_0x55649e){_0x4606be=_0x4606be-0x0;var _0x22fec4=_0x55e0[_0x4606be];return _0x22fec4;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x055e('0x0'))['db'][_0x055e('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x055e('0x2')](0x0);var events={'afterCreate':_0x055e('0x3'),'afterUpdate':_0x055e('0x4'),'afterDestroy':_0x055e('0x5')};function emitEvent(_0x3534c6){return function(_0x187141,_0x45b390,_0x295d6d){VoiceExtensionEvents[_0x055e('0x6')](_0x3534c6+':'+_0x187141['id'],_0x187141);VoiceExtensionEvents[_0x055e('0x6')](_0x3534c6,_0x187141);_0x295d6d(null);};}for(var e in events){if(events[_0x055e('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x055e('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0af6=['exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2970f4,_0x171125){var _0x15bb2b=function(_0x48ab7c){while(--_0x48ab7c){_0x2970f4['push'](_0x2970f4['shift']());}};_0x15bb2b(++_0x171125);}(_0x0af6,0x1b9));var _0x60af=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x0af6[_0x231b2e];return _0x3feb2a;};'use strict';var EventEmitter=require(_0x60af('0x0'));var VoiceExtension=require(_0x60af('0x1'))['db'][_0x60af('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x60af('0x3')](0x0);var events={'afterCreate':_0x60af('0x4'),'afterUpdate':_0x60af('0x5'),'afterDestroy':_0x60af('0x6')};function emitEvent(_0xe9e52){return function(_0x121eaf,_0x46228d,_0x1096f9){VoiceExtensionEvents[_0x60af('0x7')](_0xe9e52+':'+_0x121eaf['id'],_0x121eaf);VoiceExtensionEvents[_0x60af('0x7')](_0xe9e52,_0x121eaf);_0x1096f9(null);};}for(var e in events){if(events[_0x60af('0x8')](e)){var event=events[e];VoiceExtension[_0x60af('0x9')](e,emitEvent(event));}}module[_0x60af('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2bfa0af..c6b7b1d 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 _0xf185=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','split','length','name','trunk','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','map','toLowerCase','tag','intervals'];(function(_0x4924ae,_0x1dd735){var _0x2238e4=function(_0x48dc88){while(--_0x48dc88){_0x4924ae['push'](_0x4924ae['shift']());}};_0x2238e4(++_0x1dd735);}(_0xf185,0x1be));var _0x5f18=function(_0x21656a,_0x2bce5e){_0x21656a=_0x21656a-0x0;var _0x29ce5a=_0xf185[_0x21656a];return _0x29ce5a;};'use strict';var _=require(_0x5f18('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x5f18('0x1')]=function(_0x34335b){var _0x26ab30=_0x34335b[_0x5f18('0x2')];function _0x40e868(_0x12abae){var _0x529b25=0x2;var _0x33d44f=[{'type':_0x12abae[_0x5f18('0x3')],'app':_0x5f18('0x4'),'appdata':_0x5f18('0x5')+_0x12abae['type'],'context':_0x12abae[_0x5f18('0x6')],'exten':_0x12abae[_0x5f18('0x7')],'priority':_0x529b25++,'VoiceExtensionId':_0x12abae['id']},{'type':_0x12abae['type'],'app':_0x12abae[_0x5f18('0x8')]?'Set':_0x5f18('0x9'),'appdata':_0x12abae[_0x5f18('0x8')]?'CDR(routeAlias)='+_0x12abae[_0x5f18('0x8')]:_0x5f18('0xa'),'context':_0x12abae['context'],'exten':_0x12abae[_0x5f18('0x7')],'priority':_0x529b25++,'VoiceExtensionId':_0x12abae['id']}];if(_0x12abae[_0x5f18('0x3')]==='inbound'){_0x33d44f['push']({'type':_0x5f18('0xb'),'app':_0x5f18('0x4'),'appdata':_0x5f18('0xc')+_0x12abae['id'],'context':_0x12abae['context'],'exten':_0x12abae[_0x5f18('0x7')],'priority':_0x529b25++,'VoiceExtensionId':_0x12abae['id']});}_0x33d44f[_0x5f18('0xd')]({'type':_0x12abae[_0x5f18('0x3')],'app':_0x5f18('0x4'),'appdata':_0x5f18('0xe'),'context':_0x12abae[_0x5f18('0x6')],'exten':_0x12abae[_0x5f18('0x7')],'priority':_0x529b25++,'VoiceExtensionId':_0x12abae['id']},{'type':_0x12abae[_0x5f18('0x3')],'app':_0x5f18('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x12abae[_0x5f18('0x6')],'exten':_0x12abae['exten'],'priority':_0x529b25++,'VoiceExtensionId':_0x12abae['id']},{'type':_0x12abae['type'],'app':_0x5f18('0x4'),'appdata':_0x5f18('0xf'),'context':_0x12abae[_0x5f18('0x6')],'exten':_0x12abae[_0x5f18('0x7')],'priority':_0x529b25++,'VoiceExtensionId':_0x12abae['id']});return _0x33d44f;}function _0x337ec1(_0x506f4e){var _0x3d61bf=0x2;var _0x45cc93=[{'type':_0x5f18('0x10'),'app':_0x5f18('0x4'),'appdata':_0x5f18('0x11'),'context':_0x506f4e['context'],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':_0x5f18('0x10'),'app':_0x506f4e[_0x5f18('0x8')]?'Set':_0x5f18('0x9'),'appdata':_0x506f4e[_0x5f18('0x8')]?'CDR(routeAlias)='+_0x506f4e['alias']:_0x5f18('0xa'),'context':_0x506f4e[_0x5f18('0x6')],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':_0x5f18('0x10'),'app':_0x5f18('0x4'),'appdata':_0x5f18('0x12')+(_0x506f4e['cutdigits']?'${EXTEN:'+_0x506f4e[_0x5f18('0x13')]+'}':_0x5f18('0x14')),'context':_0x506f4e['context'],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':'outbound','app':_0x5f18('0x4'),'appdata':'CDR(routeid)='+_0x506f4e['id'],'context':_0x506f4e['context'],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':'outbound','app':_0x5f18('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3d61bf+0x2)+_0x5f18('0x16')+(_0x3d61bf+0x1)+')','context':_0x506f4e[_0x5f18('0x6')],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':_0x5f18('0x10'),'app':'Set','appdata':_0x506f4e[_0x5f18('0x13')]?_0x5f18('0x17')+_0x506f4e[_0x5f18('0x13')]+'}':_0x5f18('0x18'),'context':_0x506f4e[_0x5f18('0x6')],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':_0x5f18('0x10'),'app':_0x5f18('0x4'),'appdata':_0x5f18('0xe'),'context':_0x506f4e['context'],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':'outbound','app':'Set','appdata':_0x5f18('0x19'),'context':_0x506f4e[_0x5f18('0x6')],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':'outbound','app':'Set','appdata':_0x5f18('0xf'),'context':_0x506f4e[_0x5f18('0x6')],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':'outbound','app':_0x5f18('0x4'),'appdata':_0x5f18('0x1a')+_0x506f4e['id'],'context':_0x506f4e[_0x5f18('0x6')],'exten':_0x506f4e['exten'],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']}];if(_0x506f4e[_0x5f18('0x1b')](_0x5f18('0x1c'))&&_0x506f4e[_0x5f18('0x1c')]!==_0x5f18('0x1d')){_0x45cc93['push']({'type':_0x5f18('0x10'),'app':'Set','appdata':_0x5f18('0x1e'),'context':_0x506f4e[_0x5f18('0x6')],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']},{'type':_0x5f18('0x10'),'app':_0x5f18('0x4'),'appdata':_0x5f18('0x1f')+_0x506f4e[_0x5f18('0x1c')]||_0x5f18('0x20'),'context':_0x506f4e['context'],'exten':_0x506f4e[_0x5f18('0x7')],'priority':_0x3d61bf++,'VoiceExtensionId':_0x506f4e['id']});}return _0x45cc93;}function _0x548e79(_0x186e65,_0x28cfe2){var _0x224b45=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x5f18('0x21'),'param':0x2},{'name':_0x5f18('0x22'),'param':0x3}];var _0x24fa0f={};var _0x34a15b=_0x28cfe2[_0x5f18('0x23')](',');var _0x2fd94a=[];for(var _0x483217=0x0;_0x483217<_0x224b45[_0x5f18('0x24')];_0x483217++){switch(_0x224b45[_0x483217][_0x5f18('0x25')]){case _0x5f18('0x26'):_0x24fa0f['trunk']=_0x34a15b[_0x224b45[_0x483217][_0x5f18('0x27')]]['split']('/')[0x1];_0x24fa0f['phone']=_0x34a15b[_0x224b45[_0x483217][_0x5f18('0x27')]][_0x5f18('0x23')]('/')[0x2];_0x24fa0f['prefix']=_0x24fa0f[_0x5f18('0x28')]?_0x24fa0f['phone'][_0x5f18('0x23')]('$')[0x0]:undefined;_0x24fa0f[_0x5f18('0x28')]=_0x186e65[_0x5f18('0x13')]?(_0x24fa0f[_0x5f18('0x29')]||'')+'${EXTEN:'+_0x186e65[_0x5f18('0x13')]+'}':(_0x24fa0f[_0x5f18('0x29')]||'')+_0x5f18('0x14');_0x2fd94a[_0x224b45[_0x483217]['param']]=[_0x5f18('0x2a'),_0x24fa0f[_0x5f18('0x26')],_0x24fa0f[_0x5f18('0x28')]][_0x5f18('0x2b')]('/');break;case'options':_0x24fa0f[_0x5f18('0x21')]=_0x34a15b[_0x224b45[_0x483217][_0x5f18('0x27')]];if(_0x186e65[_0x5f18('0x1c')]!=='none'){if(_0x24fa0f['options'][_0x5f18('0x2c')](_0x5f18('0x2d'))<0x0){_0x24fa0f[_0x5f18('0x21')]+=_0x5f18('0x2d');}}else{_0x24fa0f[_0x5f18('0x21')]=_0x24fa0f['options'][_0x5f18('0x2e')](_0x5f18('0x2d'),'');}_0x2fd94a[_0x224b45[_0x483217][_0x5f18('0x27')]]=_0x24fa0f[_0x5f18('0x21')];break;default:_0x2fd94a[_0x224b45[_0x483217]['param']]=_0x34a15b[_0x224b45[_0x483217][_0x5f18('0x27')]];}}return _0x2fd94a[_0x5f18('0x2b')](',');}function _0x4a0c33(_0xec2527,_0x61fe1c,_0xdaf299){return new Promise(function(_0x4bd555,_0xf468cf){var _0x41685b=[];if(_[_0x5f18('0x2f')](_0x61fe1c))return _0x4bd555(_0x41685b);_0x26ab30[_0x5f18('0x30')][_0x5f18('0x31')]({'attributes':['id',_0x5f18('0x32'),_0x5f18('0x33')],'raw':!![]})[_0x5f18('0x34')](function(_0x443910){for(var _0x364455=0x0,_0x1a7098=0x0;_0x364455<_0x61fe1c['length'];_0x364455++,_0x1a7098=0x0){var _0x51695f=_0x61fe1c[_0x364455];var _0x3771b0=[];var _0x267357=[];delete _0x51695f['id'];if(_0x51695f[_0x5f18('0x32')]!==_0x5f18('0x35')){_0x51695f['intervals']=[_0x51695f[_0x5f18('0x32')]];}else{_0x51695f['intervals']=_0x51695f[_0x5f18('0x33')]?_[_0x5f18('0x36')](_['filter'](_0x443910,{'IntervalId':_0x51695f[_0x5f18('0x33')]}),_0x5f18('0x32')):[];}_0x51695f[_0x5f18('0x6')]=_0xec2527[_0x5f18('0x6')];_0x51695f[_0x5f18('0x7')]=_0xec2527[_0x5f18('0x7')];if(_0x51695f[_0x5f18('0x3')])_0x51695f['type']=_0x51695f[_0x5f18('0x3')][_0x5f18('0x37')]();if(_0xec2527[_0x5f18('0x3')]===_0x5f18('0x10')){if(_0x51695f[_0x5f18('0x1b')](_0x5f18('0x38'))&&_0x51695f['tag']&&_0x51695f['tag']!=='--'){_0x3771b0[_0x5f18('0xd')]({'type':_0x51695f[_0x5f18('0x3')][_0x5f18('0x37')](),'app':_0x5f18('0x4'),'appdata':'CDR(tag)='+_0x51695f[_0x5f18('0x38')],'context':_0xec2527[_0x5f18('0x6')],'exten':_0xec2527[_0x5f18('0x7')],'priority':_0x51695f[_0x5f18('0x39')][_0x5f18('0x24')]+_0xdaf299+_0x1a7098++,'VoiceExtensionId':_0xec2527['id']});}_0x3771b0[_0x5f18('0xd')]({'type':_0x51695f[_0x5f18('0x3')][_0x5f18('0x37')](),'app':_0x5f18('0x15'),'appdata':_0x5f18('0x3a')+(_0x51695f['callerID']?_0x5f18('0x3b')+_0x51695f[_0x5f18('0x3c')]+')':_0x5f18('0x3d')),'context':_0xec2527['context'],'exten':_0xec2527[_0x5f18('0x7')],'priority':_0x51695f['intervals'][_0x5f18('0x24')]+_0xdaf299+_0x1a7098++,'VoiceExtensionId':_0xec2527['id']});}else{if(_0x51695f[_0x5f18('0x1b')]('answer')){if([_0x5f18('0x3e'),_0x5f18('0x3f')][_0x5f18('0x40')](_0x51695f[_0x5f18('0x41')][_0x5f18('0x37')]())&&_0x51695f[_0x5f18('0x42')]!==_0x5f18('0x43')){if(_0x51695f['answer']){_0x3771b0['push']({'type':_0x51695f[_0x5f18('0x3')][_0x5f18('0x37')](),'app':_0x5f18('0x15'),'appdata':_0x5f18('0x44'),'context':_0xec2527['context'],'exten':_0xec2527[_0x5f18('0x7')],'priority':_0x51695f[_0x5f18('0x39')][_0x5f18('0x24')]+_0xdaf299+_0x1a7098++,'VoiceExtensionId':_0xec2527['id']});_0x3771b0[_0x5f18('0xd')]({'type':_0x51695f[_0x5f18('0x3')]['toLowerCase'](),'app':_0x5f18('0x4'),'appdata':_0x5f18('0x45'),'context':_0xec2527['context'],'exten':_0xec2527[_0x5f18('0x7')],'priority':_0x51695f[_0x5f18('0x39')][_0x5f18('0x24')]+_0xdaf299+_0x1a7098++,'VoiceExtensionId':_0xec2527['id']});}else{_0x3771b0[_0x5f18('0xd')]({'type':_0x51695f[_0x5f18('0x3')][_0x5f18('0x37')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xec2527['context'],'exten':_0xec2527['exten'],'priority':_0x51695f['intervals'][_0x5f18('0x24')]+_0xdaf299+_0x1a7098++,'VoiceExtensionId':_0xec2527['id']});_0x3771b0[_0x5f18('0xd')]({'type':_0x51695f[_0x5f18('0x3')][_0x5f18('0x37')](),'app':_0x5f18('0x4'),'appdata':_0x5f18('0x46'),'context':_0xec2527[_0x5f18('0x6')],'exten':_0xec2527[_0x5f18('0x7')],'priority':_0x51695f[_0x5f18('0x39')][_0x5f18('0x24')]+_0xdaf299+_0x1a7098++,'VoiceExtensionId':_0xec2527['id']});}}}}for(var _0x34d8a8=0x0;_0x34d8a8<_0x51695f[_0x5f18('0x39')][_0x5f18('0x24')];_0x34d8a8++){var _0x591101=_0xdaf299+_0x51695f[_0x5f18('0x39')][_0x5f18('0x24')];var _0x13effa=_0x34d8a8===_0x51695f[_0x5f18('0x39')][_0x5f18('0x24')]-0x1?_0xdaf299+_0x3771b0[_0x5f18('0x24')]+_0x267357[_0x5f18('0x24')]+0x2:_0xdaf299+_0x34d8a8+0x1;_0x3771b0[_0x5f18('0x47')](_0x34d8a8,0x0,{'type':_0xec2527[_0x5f18('0x3')],'app':'GotoIfTime','appdata':_0x51695f[_0x5f18('0x39')][_0x34d8a8]+'?'+_0xec2527[_0x5f18('0x6')]+_0x5f18('0x48')+_0x591101+':'+_0xec2527['context']+_0x5f18('0x48')+_0x13effa,'exten':_0xec2527[_0x5f18('0x7')],'context':_0xec2527['context'],'priority':_0xdaf299+_0x34d8a8,'VoiceExtensionId':_0xec2527['id']});}if(_0x51695f[_0x5f18('0x42')]===_0x5f18('0x49'))_0x51695f[_0x5f18('0x4a')]=_0x548e79(_0xec2527,_0x51695f[_0x5f18('0x4a')]);_0x51695f[_0x5f18('0x4b')]=_0x3771b0[_0x5f18('0x24')]?_[_0x5f18('0x4c')](_0x3771b0)[_0x5f18('0x4b')]+0x1:_0xdaf299;_0x41685b=_[_0x5f18('0x4d')](_0x41685b,_0x3771b0,[_0x51695f],_0x267357);_0xdaf299=_[_0x5f18('0x4c')](_0x41685b)[_0x5f18('0x4b')]+0x1;}return _0x4bd555(_0x41685b);})[_0x5f18('0x4e')](function(_0x22e9e7){_0xf468cf(_0x22e9e7);});});}return _0x34335b[_0x5f18('0x4f')](_0x5f18('0x50'),attributes,{'tableName':_0x5f18('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4f8e6e){var _0x48536b=this[_0x5f18('0x52')]({'plain':!![]});var _0x3eac7c=_0x48536b['type']===_0x5f18('0x10')?_0x337ec1(_0x48536b):_0x40e868(_0x48536b);return _0x4a0c33(_0x48536b,_0x4f8e6e,_['last'](_0x3eac7c)['priority']+0x1)[_0x5f18('0x34')](function(_0x5b8591){var _0x5b1580=_[_0x5f18('0x4d')](_0x3eac7c,_0x5b8591);_0x5b1580[_0x5f18('0xd')]({'type':_0x48536b[_0x5f18('0x3')],'app':_0x5f18('0x53'),'exten':_0x48536b[_0x5f18('0x7')],'context':_0x48536b[_0x5f18('0x6')],'priority':_['last'](_0x5b1580)[_0x5f18('0x4b')]+0x1,'VoiceExtensionId':_0x48536b['id']});return _0x5b1580;});}}});}; \ No newline at end of file +var _0x0298=['No\x20alias\x20set','context','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','prefix','phone','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','queue','includes','app','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','define','VoiceExtension','voice_extensions','get','Hangup','lodash','exports','models','type','CDR(type)=','exten','alias','Set','NoOp'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0298,0x95));var _0x8029=function(_0x3146d5,_0x483d94){_0x3146d5=_0x3146d5-0x0;var _0x551674=_0x0298[_0x3146d5];return _0x551674;};'use strict';var _=require(_0x8029('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x8029('0x1')]=function(_0x43448f){var _0x2f521b=_0x43448f[_0x8029('0x2')];function _0xd466eb(_0xedf3dc){var _0x2f2e16=0x2;var _0x24d160=[{'type':_0xedf3dc[_0x8029('0x3')],'app':'Set','appdata':_0x8029('0x4')+_0xedf3dc[_0x8029('0x3')],'context':_0xedf3dc['context'],'exten':_0xedf3dc[_0x8029('0x5')],'priority':_0x2f2e16++,'VoiceExtensionId':_0xedf3dc['id']},{'type':_0xedf3dc[_0x8029('0x3')],'app':_0xedf3dc[_0x8029('0x6')]?_0x8029('0x7'):_0x8029('0x8'),'appdata':_0xedf3dc['alias']?'CDR(routeAlias)='+_0xedf3dc[_0x8029('0x6')]:_0x8029('0x9'),'context':_0xedf3dc[_0x8029('0xa')],'exten':_0xedf3dc['exten'],'priority':_0x2f2e16++,'VoiceExtensionId':_0xedf3dc['id']}];if(_0xedf3dc['type']===_0x8029('0xb')){_0x24d160[_0x8029('0xc')]({'type':'inbound','app':_0x8029('0x7'),'appdata':'CDR(routeid)='+_0xedf3dc['id'],'context':_0xedf3dc[_0x8029('0xa')],'exten':_0xedf3dc[_0x8029('0x5')],'priority':_0x2f2e16++,'VoiceExtensionId':_0xedf3dc['id']});}_0x24d160[_0x8029('0xc')]({'type':_0xedf3dc[_0x8029('0x3')],'app':_0x8029('0x7'),'appdata':_0x8029('0xd'),'context':_0xedf3dc['context'],'exten':_0xedf3dc[_0x8029('0x5')],'priority':_0x2f2e16++,'VoiceExtensionId':_0xedf3dc['id']},{'type':_0xedf3dc[_0x8029('0x3')],'app':_0x8029('0x7'),'appdata':_0x8029('0xe'),'context':_0xedf3dc['context'],'exten':_0xedf3dc['exten'],'priority':_0x2f2e16++,'VoiceExtensionId':_0xedf3dc['id']},{'type':_0xedf3dc['type'],'app':_0x8029('0x7'),'appdata':_0x8029('0xf'),'context':_0xedf3dc[_0x8029('0xa')],'exten':_0xedf3dc[_0x8029('0x5')],'priority':_0x2f2e16++,'VoiceExtensionId':_0xedf3dc['id']});return _0x24d160;}function _0x14ad14(_0x3bf5df){var _0x4f524a=0x2;var _0x43117d=[{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':_0x8029('0x11'),'context':_0x3bf5df['context'],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x3bf5df['alias']?_0x8029('0x7'):'NoOp','appdata':_0x3bf5df[_0x8029('0x6')]?_0x8029('0x12')+_0x3bf5df[_0x8029('0x6')]:_0x8029('0x9'),'context':_0x3bf5df['context'],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':'Set','appdata':'CDR(destination)='+(_0x3bf5df[_0x8029('0x13')]?_0x8029('0x14')+_0x3bf5df[_0x8029('0x13')]+'}':_0x8029('0x15')),'context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':_0x8029('0x16')+_0x3bf5df['id'],'context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x17'),'appdata':_0x8029('0x18')+(_0x4f524a+0x2)+_0x8029('0x19')+(_0x4f524a+0x1)+')','context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':_0x3bf5df[_0x8029('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x3bf5df[_0x8029('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':_0x8029('0xd'),'context':_0x3bf5df['context'],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':_0x8029('0xe'),'context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df['exten'],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df['exten'],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':_0x8029('0x1a')+_0x3bf5df['id'],'context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df[_0x8029('0x5')],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']}];if(_0x3bf5df[_0x8029('0x1b')]('recordingFormat')&&_0x3bf5df[_0x8029('0x1c')]!==_0x8029('0x1d')){_0x43117d[_0x8029('0xc')]({'type':_0x8029('0x10'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3bf5df['context'],'exten':_0x3bf5df['exten'],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']},{'type':_0x8029('0x10'),'app':_0x8029('0x7'),'appdata':_0x8029('0x1e')+_0x3bf5df[_0x8029('0x1c')]||_0x8029('0x1f'),'context':_0x3bf5df[_0x8029('0xa')],'exten':_0x3bf5df['exten'],'priority':_0x4f524a++,'VoiceExtensionId':_0x3bf5df['id']});}return _0x43117d;}function _0x2bf869(_0x19a39e,_0x327a79){var _0x5bcd23=[{'name':'trunk','param':0x0},{'name':_0x8029('0x20'),'param':0x1},{'name':_0x8029('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x3d58d2={};var _0x2bc543=_0x327a79[_0x8029('0x22')](',');var _0x23037c=[];for(var _0x139b77=0x0;_0x139b77<_0x5bcd23[_0x8029('0x23')];_0x139b77++){switch(_0x5bcd23[_0x139b77][_0x8029('0x24')]){case _0x8029('0x25'):_0x3d58d2[_0x8029('0x25')]=_0x2bc543[_0x5bcd23[_0x139b77][_0x8029('0x26')]][_0x8029('0x22')]('/')[0x1];_0x3d58d2['phone']=_0x2bc543[_0x5bcd23[_0x139b77]['param']][_0x8029('0x22')]('/')[0x2];_0x3d58d2[_0x8029('0x27')]=_0x3d58d2[_0x8029('0x28')]?_0x3d58d2['phone'][_0x8029('0x22')]('$')[0x0]:undefined;_0x3d58d2[_0x8029('0x28')]=_0x19a39e['cutdigits']?(_0x3d58d2[_0x8029('0x27')]||'')+_0x8029('0x14')+_0x19a39e[_0x8029('0x13')]+'}':(_0x3d58d2[_0x8029('0x27')]||'')+_0x8029('0x15');_0x23037c[_0x5bcd23[_0x139b77][_0x8029('0x26')]]=[_0x8029('0x29'),_0x3d58d2['trunk'],_0x3d58d2['phone']][_0x8029('0x2a')]('/');break;case _0x8029('0x21'):_0x3d58d2[_0x8029('0x21')]=_0x2bc543[_0x5bcd23[_0x139b77][_0x8029('0x26')]];if(_0x19a39e['recordingFormat']!==_0x8029('0x1d')){if(_0x3d58d2[_0x8029('0x21')]['indexOf'](_0x8029('0x2b'))<0x0){_0x3d58d2[_0x8029('0x21')]+=_0x8029('0x2b');}}else{_0x3d58d2[_0x8029('0x21')]=_0x3d58d2[_0x8029('0x21')][_0x8029('0x2c')]('U(xcally-mixmonitor-context)','');}_0x23037c[_0x5bcd23[_0x139b77][_0x8029('0x26')]]=_0x3d58d2['options'];break;default:_0x23037c[_0x5bcd23[_0x139b77][_0x8029('0x26')]]=_0x2bc543[_0x5bcd23[_0x139b77]['param']];}}return _0x23037c[_0x8029('0x2a')](',');}function _0x1cae7d(_0x29b2b7,_0x40a3db,_0x1020fb){return new Promise(function(_0x670193,_0x2f7728){var _0x594ca5=[];if(_[_0x8029('0x2d')](_0x40a3db))return _0x670193(_0x594ca5);_0x2f521b['Interval'][_0x8029('0x2e')]({'attributes':['id',_0x8029('0x2f'),'IntervalId'],'raw':!![]})[_0x8029('0x30')](function(_0x4e2c23){for(var _0x3fc000=0x0,_0x5b9b8d=0x0;_0x3fc000<_0x40a3db[_0x8029('0x23')];_0x3fc000++,_0x5b9b8d=0x0){var _0x24fcd7=_0x40a3db[_0x3fc000];var _0x31ba25=[];var _0x224ccb=[];delete _0x24fcd7['id'];if(_0x24fcd7[_0x8029('0x2f')]!==_0x8029('0x31')){_0x24fcd7[_0x8029('0x32')]=[_0x24fcd7[_0x8029('0x2f')]];}else{_0x24fcd7[_0x8029('0x32')]=_0x24fcd7[_0x8029('0x33')]?_[_0x8029('0x34')](_[_0x8029('0x35')](_0x4e2c23,{'IntervalId':_0x24fcd7[_0x8029('0x33')]}),_0x8029('0x2f')):[];}_0x24fcd7['context']=_0x29b2b7['context'];_0x24fcd7[_0x8029('0x5')]=_0x29b2b7[_0x8029('0x5')];if(_0x24fcd7[_0x8029('0x3')])_0x24fcd7['type']=_0x24fcd7[_0x8029('0x3')][_0x8029('0x36')]();if(_0x29b2b7[_0x8029('0x3')]===_0x8029('0x10')){if(_0x24fcd7[_0x8029('0x1b')]('tag')&&_0x24fcd7[_0x8029('0x37')]&&_0x24fcd7[_0x8029('0x37')]!=='--'){_0x31ba25[_0x8029('0xc')]({'type':_0x24fcd7[_0x8029('0x3')][_0x8029('0x36')](),'app':_0x8029('0x7'),'appdata':_0x8029('0x38')+_0x24fcd7[_0x8029('0x37')],'context':_0x29b2b7['context'],'exten':_0x29b2b7[_0x8029('0x5')],'priority':_0x24fcd7['intervals'][_0x8029('0x23')]+_0x1020fb+_0x5b9b8d++,'VoiceExtensionId':_0x29b2b7['id']});}_0x31ba25['push']({'type':_0x24fcd7['type'][_0x8029('0x36')](),'app':_0x8029('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x24fcd7['callerID']?_0x8029('0x39')+_0x24fcd7[_0x8029('0x3a')]+')':_0x8029('0x3b')),'context':_0x29b2b7[_0x8029('0xa')],'exten':_0x29b2b7[_0x8029('0x5')],'priority':_0x24fcd7[_0x8029('0x32')][_0x8029('0x23')]+_0x1020fb+_0x5b9b8d++,'VoiceExtensionId':_0x29b2b7['id']});}else{if(_0x24fcd7['hasOwnProperty']('answer')){if([_0x8029('0x3c'),'playback'][_0x8029('0x3d')](_0x24fcd7[_0x8029('0x3e')]['toLowerCase']())&&_0x24fcd7['appType']!=='custom'){if(_0x24fcd7['answer']){_0x31ba25['push']({'type':_0x24fcd7[_0x8029('0x3')][_0x8029('0x36')](),'app':_0x8029('0x17'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x29b2b7['context'],'exten':_0x29b2b7[_0x8029('0x5')],'priority':_0x24fcd7['intervals'][_0x8029('0x23')]+_0x1020fb+_0x5b9b8d++,'VoiceExtensionId':_0x29b2b7['id']});_0x31ba25[_0x8029('0xc')]({'type':_0x24fcd7[_0x8029('0x3')][_0x8029('0x36')](),'app':'Set','appdata':_0x8029('0x3f'),'context':_0x29b2b7['context'],'exten':_0x29b2b7['exten'],'priority':_0x24fcd7[_0x8029('0x32')][_0x8029('0x23')]+_0x1020fb+_0x5b9b8d++,'VoiceExtensionId':_0x29b2b7['id']});}else{_0x31ba25[_0x8029('0xc')]({'type':_0x24fcd7[_0x8029('0x3')][_0x8029('0x36')](),'app':_0x8029('0x17'),'appdata':_0x8029('0x40'),'context':_0x29b2b7[_0x8029('0xa')],'exten':_0x29b2b7[_0x8029('0x5')],'priority':_0x24fcd7['intervals'][_0x8029('0x23')]+_0x1020fb+_0x5b9b8d++,'VoiceExtensionId':_0x29b2b7['id']});_0x31ba25[_0x8029('0xc')]({'type':_0x24fcd7[_0x8029('0x3')][_0x8029('0x36')](),'app':_0x8029('0x7'),'appdata':_0x8029('0x41'),'context':_0x29b2b7[_0x8029('0xa')],'exten':_0x29b2b7[_0x8029('0x5')],'priority':_0x24fcd7['intervals'][_0x8029('0x23')]+_0x1020fb+_0x5b9b8d++,'VoiceExtensionId':_0x29b2b7['id']});}}}}for(var _0x37f1f4=0x0;_0x37f1f4<_0x24fcd7['intervals'][_0x8029('0x23')];_0x37f1f4++){var _0x37490d=_0x1020fb+_0x24fcd7[_0x8029('0x32')]['length'];var _0x3fc171=_0x37f1f4===_0x24fcd7[_0x8029('0x32')][_0x8029('0x23')]-0x1?_0x1020fb+_0x31ba25['length']+_0x224ccb[_0x8029('0x23')]+0x2:_0x1020fb+_0x37f1f4+0x1;_0x31ba25['splice'](_0x37f1f4,0x0,{'type':_0x29b2b7[_0x8029('0x3')],'app':_0x8029('0x42'),'appdata':_0x24fcd7[_0x8029('0x32')][_0x37f1f4]+'?'+_0x29b2b7[_0x8029('0xa')]+_0x8029('0x43')+_0x37490d+':'+_0x29b2b7[_0x8029('0xa')]+',${EXTEN},'+_0x3fc171,'exten':_0x29b2b7[_0x8029('0x5')],'context':_0x29b2b7[_0x8029('0xa')],'priority':_0x1020fb+_0x37f1f4,'VoiceExtensionId':_0x29b2b7['id']});}if(_0x24fcd7[_0x8029('0x44')]===_0x8029('0x45'))_0x24fcd7[_0x8029('0x46')]=_0x2bf869(_0x29b2b7,_0x24fcd7[_0x8029('0x46')]);_0x24fcd7[_0x8029('0x47')]=_0x31ba25['length']?_[_0x8029('0x48')](_0x31ba25)[_0x8029('0x47')]+0x1:_0x1020fb;_0x594ca5=_[_0x8029('0x49')](_0x594ca5,_0x31ba25,[_0x24fcd7],_0x224ccb);_0x1020fb=_[_0x8029('0x48')](_0x594ca5)[_0x8029('0x47')]+0x1;}return _0x670193(_0x594ca5);})['catch'](function(_0x237abc){_0x2f7728(_0x237abc);});});}return _0x43448f[_0x8029('0x4a')](_0x8029('0x4b'),attributes,{'tableName':_0x8029('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x26ae5f){var _0x27fe4f=this[_0x8029('0x4d')]({'plain':!![]});var _0x5be614=_0x27fe4f['type']==='outbound'?_0x14ad14(_0x27fe4f):_0xd466eb(_0x27fe4f);return _0x1cae7d(_0x27fe4f,_0x26ae5f,_[_0x8029('0x48')](_0x5be614)[_0x8029('0x47')]+0x1)[_0x8029('0x30')](function(_0x4f68d9){var _0x1d75a3=_[_0x8029('0x49')](_0x5be614,_0x4f68d9);_0x1d75a3[_0x8029('0xc')]({'type':_0x27fe4f[_0x8029('0x3')],'app':_0x8029('0x4e'),'exten':_0x27fe4f[_0x8029('0x5')],'context':_0x27fe4f[_0x8029('0xa')],'priority':_[_0x8029('0x48')](_0x1d75a3)['priority']+0x1,'VoiceExtensionId':_0x27fe4f['id']});return _0x1d75a3;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 8f12e3b..cf7c59b 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 _0xe4d9=['redis','localhost','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceExtension','findAll','options','raw','include','attributes','map','GetVoiceExtension','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xe4d9,0x141));var _0x9e4d=function(_0x333fbc,_0x551e30){_0x333fbc=_0x333fbc-0x0;var _0x11f62f=_0xe4d9[_0x333fbc];return _0x11f62f;};'use strict';var _=require(_0x9e4d('0x0'));var util=require(_0x9e4d('0x1'));var moment=require(_0x9e4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9e4d('0x4'));var logger=require(_0x9e4d('0x5'))('rpc');var config=require(_0x9e4d('0x6'));var jayson=require(_0x9e4d('0x7'));var client=jayson['client'][_0x9e4d('0x8')]({'port':0x232a});config[_0x9e4d('0x9')]=_['defaults'](config['redis'],{'host':_0x9e4d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e4d('0x9')]));require(_0x9e4d('0xb'))['register'](socket);function respondWithRpcPromise(_0x111bf0,_0x205666,_0x43ab1c){return new BPromise(function(_0x219736,_0x3f21e3){return client[_0x9e4d('0xc')](_0x111bf0,_0x43ab1c)[_0x9e4d('0xd')](function(_0x296103){logger[_0x9e4d('0xe')](_0x9e4d('0xf'),_0x205666,_0x9e4d('0x10'));logger[_0x9e4d('0x11')](_0x9e4d('0x12'),_0x205666,_0x9e4d('0x10'),JSON[_0x9e4d('0x13')](_0x296103));if(_0x296103['error']){if(_0x296103[_0x9e4d('0x14')][_0x9e4d('0x15')]===0x1f4){logger[_0x9e4d('0x14')](_0x9e4d('0xf'),_0x205666,_0x296103[_0x9e4d('0x14')][_0x9e4d('0x16')]);return _0x3f21e3(_0x296103['error'][_0x9e4d('0x16')]);}logger[_0x9e4d('0x14')](_0x9e4d('0xf'),_0x205666,_0x296103[_0x9e4d('0x14')][_0x9e4d('0x16')]);return _0x219736(_0x296103[_0x9e4d('0x14')]['message']);}else{logger[_0x9e4d('0xe')]('VoiceExtension,\x20%s,\x20%s',_0x205666,'request\x20sent');_0x219736(_0x296103[_0x9e4d('0x17')][_0x9e4d('0x16')]);}})[_0x9e4d('0x18')](function(_0xfcd186){logger[_0x9e4d('0x14')](_0x9e4d('0xf'),_0x205666,_0xfcd186);_0x3f21e3(_0xfcd186);});});}exports['GetVoiceExtension']=function(_0x141f1f){var _0x55ba7a=this;return new Promise(function(_0x2d514a,_0x103061){return db[_0x9e4d('0x19')][_0x9e4d('0x1a')]({'raw':_0x141f1f[_0x9e4d('0x1b')]?_0x141f1f[_0x9e4d('0x1b')][_0x9e4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x141f1f[_0x9e4d('0x1b')]?_0x141f1f[_0x9e4d('0x1b')]['where']||null:null,'attributes':_0x141f1f[_0x9e4d('0x1b')]?_0x141f1f[_0x9e4d('0x1b')]['attributes']||null:null,'limit':_0x141f1f[_0x9e4d('0x1b')]?_0x141f1f[_0x9e4d('0x1b')]['limit']||null:null,'include':_0x141f1f[_0x9e4d('0x1b')]?_0x141f1f[_0x9e4d('0x1b')][_0x9e4d('0x1d')]?_['map'](_0x141f1f[_0x9e4d('0x1b')][_0x9e4d('0x1d')],function(_0x7ae00b){return{'model':db[_0x7ae00b['model']],'as':_0x7ae00b['as'],'attributes':_0x7ae00b[_0x9e4d('0x1e')],'include':_0x7ae00b['include']?_[_0x9e4d('0x1f')](_0x7ae00b['include'],function(_0x2ad1c8){return{'model':db[_0x2ad1c8['model']],'as':_0x2ad1c8['as'],'attributes':_0x2ad1c8['attributes'],'include':_0x2ad1c8[_0x9e4d('0x1d')]?_[_0x9e4d('0x1f')](_0x2ad1c8[_0x9e4d('0x1d')],function(_0x122e95){return{'model':db[_0x122e95['model']],'as':_0x122e95['as'],'attributes':_0x122e95[_0x9e4d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9e4d('0xd')](function(_0x58c196){logger['info'](_0x9e4d('0x20'),_0x141f1f);logger[_0x9e4d('0x11')](_0x9e4d('0x20'),_0x141f1f,JSON['stringify'](_0x58c196));_0x2d514a(_0x58c196);})[_0x9e4d('0x18')](function(_0x38e9ff){logger[_0x9e4d('0x14')]('GetVoiceExtension',_0x38e9ff[_0x9e4d('0x16')],_0x141f1f);_0x103061(_0x55ba7a['error'](0x1f4,_0x38e9ff['message']));});});}; \ No newline at end of file +var _0x18af=['moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetVoiceExtension','findAll','options','where','attributes','limit','include','map','model','stringify','lodash'];(function(_0x5ac425,_0x408d40){var _0x397c36=function(_0x2b7deb){while(--_0x2b7deb){_0x5ac425['push'](_0x5ac425['shift']());}};_0x397c36(++_0x408d40);}(_0x18af,0x8b));var _0xf18a=function(_0x47884e,_0x1a9a55){_0x47884e=_0x47884e-0x0;var _0x29f668=_0x18af[_0x47884e];return _0x29f668;};'use strict';var _=require(_0xf18a('0x0'));var util=require('util');var moment=require(_0xf18a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf18a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf18a('0x3'))(_0xf18a('0x4'));var config=require(_0xf18a('0x5'));var jayson=require(_0xf18a('0x6'));var client=jayson['client'][_0xf18a('0x7')]({'port':0x232a});config[_0xf18a('0x8')]=_[_0xf18a('0x9')](config['redis'],{'host':_0xf18a('0xa'),'port':0x18eb});var socket=require(_0xf18a('0xb'))(new Redis(config[_0xf18a('0x8')]));require(_0xf18a('0xc'))[_0xf18a('0xd')](socket);function respondWithRpcPromise(_0x270333,_0xcafadb,_0x20247d){return new BPromise(function(_0x33fb6a,_0x31ab9a){return client[_0xf18a('0xe')](_0x270333,_0x20247d)[_0xf18a('0xf')](function(_0x36a9c6){logger['info'](_0xf18a('0x10'),_0xcafadb,_0xf18a('0x11'));logger[_0xf18a('0x12')](_0xf18a('0x13'),_0xcafadb,_0xf18a('0x11'),JSON['stringify'](_0x36a9c6));if(_0x36a9c6[_0xf18a('0x14')]){if(_0x36a9c6[_0xf18a('0x14')]['code']===0x1f4){logger[_0xf18a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0xcafadb,_0x36a9c6[_0xf18a('0x14')][_0xf18a('0x15')]);return _0x31ab9a(_0x36a9c6['error'][_0xf18a('0x15')]);}logger['error'](_0xf18a('0x10'),_0xcafadb,_0x36a9c6[_0xf18a('0x14')]['message']);return _0x33fb6a(_0x36a9c6['error'][_0xf18a('0x15')]);}else{logger[_0xf18a('0x16')]('VoiceExtension,\x20%s,\x20%s',_0xcafadb,'request\x20sent');_0x33fb6a(_0x36a9c6[_0xf18a('0x17')][_0xf18a('0x15')]);}})[_0xf18a('0x18')](function(_0x5c9173){logger[_0xf18a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0xcafadb,_0x5c9173);_0x31ab9a(_0x5c9173);});});}exports[_0xf18a('0x19')]=function(_0x31cb63){var _0x5f170a=this;return new Promise(function(_0x1aa0b2,_0x340d94){return db['VoiceExtension'][_0xf18a('0x1a')]({'raw':_0x31cb63[_0xf18a('0x1b')]?_0x31cb63[_0xf18a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x31cb63['options']?_0x31cb63[_0xf18a('0x1b')][_0xf18a('0x1c')]||null:null,'attributes':_0x31cb63[_0xf18a('0x1b')]?_0x31cb63[_0xf18a('0x1b')][_0xf18a('0x1d')]||null:null,'limit':_0x31cb63[_0xf18a('0x1b')]?_0x31cb63[_0xf18a('0x1b')][_0xf18a('0x1e')]||null:null,'include':_0x31cb63[_0xf18a('0x1b')]?_0x31cb63['options'][_0xf18a('0x1f')]?_[_0xf18a('0x20')](_0x31cb63[_0xf18a('0x1b')][_0xf18a('0x1f')],function(_0x5dd917){return{'model':db[_0x5dd917[_0xf18a('0x21')]],'as':_0x5dd917['as'],'attributes':_0x5dd917[_0xf18a('0x1d')],'include':_0x5dd917[_0xf18a('0x1f')]?_['map'](_0x5dd917[_0xf18a('0x1f')],function(_0x40d6d3){return{'model':db[_0x40d6d3[_0xf18a('0x21')]],'as':_0x40d6d3['as'],'attributes':_0x40d6d3[_0xf18a('0x1d')],'include':_0x40d6d3['include']?_[_0xf18a('0x20')](_0x40d6d3[_0xf18a('0x1f')],function(_0x53ba5b){return{'model':db[_0x53ba5b['model']],'as':_0x53ba5b['as'],'attributes':_0x53ba5b[_0xf18a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf18a('0xf')](function(_0x7e668c){logger[_0xf18a('0x16')]('GetVoiceExtension',_0x31cb63);logger[_0xf18a('0x12')](_0xf18a('0x19'),_0x31cb63,JSON[_0xf18a('0x22')](_0x7e668c));_0x1aa0b2(_0x7e668c);})[_0xf18a('0x18')](function(_0x3a9b89){logger[_0xf18a('0x14')]('GetVoiceExtension',_0x3a9b89['message'],_0x31cb63);_0x340d94(_0x5f170a[_0xf18a('0x14')](0x1f4,_0x3a9b89[_0xf18a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 82ae92b..09c802f 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x290129,_0x33e538){var _0x5d5501=function(_0x5d69fe){while(--_0x5d69fe){_0x290129['push'](_0x290129['shift']());}};_0x5d5501(++_0x33e538);}(_0x326f,0xd1));var _0xf326=function(_0x4a9318,_0x38d6f1){_0x4a9318=_0x4a9318-0x0;var _0x4b90e5=_0x326f[_0x4a9318];return _0x4b90e5;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x203f00,_0x21cb72){var _0x1fe3c8=function(_0x536716){while(--_0x536716){_0x203f00['push'](_0x203f00['shift']());}};_0x1fe3c8(++_0x21cb72);}(_0x326f,0xd1));var _0xf326=function(_0x50e7bf,_0x4bea72){_0x50e7bf=_0x50e7bf-0x0;var _0x249a65=_0x326f[_0x50e7bf];return _0x249a65;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index d367069..9b54b6e 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 _0x3a6d=['/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','post','create'];(function(_0x347102,_0x86cd1f){var _0x2af898=function(_0x2a3556){while(--_0x2a3556){_0x347102['push'](_0x347102['shift']());}};_0x2af898(++_0x86cd1f);}(_0x3a6d,0x143));var _0xd3a6=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3a6d[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/:id',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x10')]);router['put'](_0xd3a6('0x11'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x12')]);router[_0xd3a6('0x13')](_0xd3a6('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','get','/:id','show','/:id/messages','getMessages','post','create','put'];(function(_0x27471e,_0x121ad4){var _0x184db3=function(_0x3d0111){while(--_0x3d0111){_0x27471e['push'](_0x27471e['shift']());}};_0x184db3(++_0x121ad4);}(_0x53ec,0x192));var _0xc53e=function(_0x29d5ce,_0x1503e9){_0x29d5ce=_0x29d5ce-0x0;var _0x266f7b=_0x53ec[_0x29d5ce];return _0x266f7b;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('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 d668ec1..7b1b6c2 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 _0x172d=['VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','STRING','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER'];(function(_0x42702a,_0x578e3a){var _0x162531=function(_0x4bbd11){while(--_0x4bbd11){_0x42702a['push'](_0x42702a['shift']());}};_0x162531(++_0x578e3a);}(_0x172d,0x95));var _0xd172=function(_0x40176b,_0x168e9f){_0x40176b=_0x40176b-0x0;var _0x874f78=_0x172d[_0x40176b];return _0x874f78;};'use strict';var Sequelize=require(_0xd172('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd172('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xd172('0x1')],'defaultValue':'','allowNull':![],'unique':_0xd172('0x2')},'password':{'type':Sequelize[_0xd172('0x1')]},'fullname':{'type':Sequelize[_0xd172('0x1')]},'email':{'type':Sequelize[_0xd172('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5a695c){this['setDataValue'](_0xd172('0x3'),typeof _0x5a695c===_0xd172('0x4')&&_0x5a695c['trim']()?_0x5a695c[_0xd172('0x5')]():null);}},'pager':{'type':Sequelize[_0xd172('0x1')]},'tz':{'type':Sequelize[_0xd172('0x1')],'defaultValue':_0xd172('0x6')},'attach':{'type':Sequelize[_0xd172('0x7')](_0xd172('0x8'),'no'),'defaultValue':_0xd172('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xd172('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xd172('0x1')]},'callback':{'type':Sequelize[_0xd172('0x1')]},'review':{'type':Sequelize[_0xd172('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xd172('0x7')](_0xd172('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xd172('0x7')](_0xd172('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xd172('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xd172('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xd172('0x7')](_0xd172('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xd172('0x7')](_0xd172('0x8'),'no'),'defaultValue':_0xd172('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xd172('0x7')](_0xd172('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd172('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xd172('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xd172('0x1')]},'emailbody':{'type':Sequelize[_0xd172('0x1')]},'maxsecs':{'type':Sequelize[_0xd172('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd172('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xd172('0xb')],'get':function(){return this['getDataValue'](_0xd172('0xc'))+_0xd172('0xd')+this[_0xd172('0xe')](_0xd172('0xf'));}}}; \ No newline at end of file +var _0xf901=['mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20'];(function(_0x335de0,_0x24e38){var _0x12358b=function(_0x27e419){while(--_0x27e419){_0x335de0['push'](_0x335de0['shift']());}};_0x12358b(++_0x24e38);}(_0xf901,0x157));var _0x1f90=function(_0xb7e5e5,_0x16642e){_0xb7e5e5=_0xb7e5e5-0x0;var _0x55e238=_0xf901[_0xb7e5e5];return _0x55e238;};'use strict';var Sequelize=require(_0x1f90('0x0'));module[_0x1f90('0x1')]={'customer_id':{'type':Sequelize[_0x1f90('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x1f90('0x3'),'unique':_0x1f90('0x4')},'mailbox':{'type':Sequelize[_0x1f90('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x1f90('0x2')]},'fullname':{'type':Sequelize[_0x1f90('0x2')]},'email':{'type':Sequelize[_0x1f90('0x2')],'validate':{'isEmail':!![]},'set':function(_0x362ee3){this[_0x1f90('0x5')](_0x1f90('0x6'),typeof _0x362ee3===_0x1f90('0x7')&&_0x362ee3[_0x1f90('0x8')]()?_0x362ee3[_0x1f90('0x8')]():null);}},'pager':{'type':Sequelize[_0x1f90('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x1f90('0x9')},'attach':{'type':Sequelize['ENUM'](_0x1f90('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x1f90('0xb')](_0x1f90('0xa'),'no'),'defaultValue':_0x1f90('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x1f90('0x2')]},'callback':{'type':Sequelize[_0x1f90('0x2')]},'review':{'type':Sequelize['ENUM'](_0x1f90('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1f90('0xb')](_0x1f90('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1f90('0xb')](_0x1f90('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1f90('0xb')](_0x1f90('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x1f90('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1f90('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1f90('0xb')](_0x1f90('0xa'),'no'),'defaultValue':_0x1f90('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x1f90('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1f90('0xb')](_0x1f90('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1f90('0xb')](_0x1f90('0xa'),'no'),'defaultValue':_0x1f90('0xa'),'allowNull':![]},'stamp':{'type':_0x1f90('0xc')},'emailsubject':{'type':Sequelize[_0x1f90('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x1f90('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1f90('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1f90('0xe')](_0x1f90('0xf'))+_0x1f90('0x10')+this[_0x1f90('0xe')](_0x1f90('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3afde60..37a9479 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 _0x1775=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','params','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','rawAttributes','mailbox','options','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/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','Voicemails','UserProfileResource','name','send','index','VoiceMail','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0xd151e0,_0x2c6fb0){var _0x4b78dc=function(_0x331060){while(--_0x331060){_0xd151e0['push'](_0xd151e0['shift']());}};_0x4b78dc(++_0x2c6fb0);}(_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(){var _0x2503ef=_0x3b39b5['get']({'plain':!![]});var _0x564139=_0x5177('0x2a');return db[_0x5177('0x2b')]['destroy']({'where':{'type':_0x564139,'resourceId':_0x2503ef['id']}})[_0x5177('0x28')](function(){return _0x3b39b5;});})['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)[_0x5177('0x1e')]();});}};}function handleEntityNotFound(_0x58846c,_0x3e021a){return function(_0x2554ec){if(!_0x2554ec){_0x58846c[_0x5177('0x1c')](0x194);}return _0x2554ec;};}function handleError(_0x7f86e,_0xe98ff1){_0xe98ff1=_0xe98ff1||0x1f4;return function(_0x1cef5d){logger['error'](_0x1cef5d['stack']);if(_0x1cef5d[_0x5177('0x2c')]){delete _0x1cef5d[_0x5177('0x2c')];}_0x7f86e[_0x5177('0x1d')](_0xe98ff1)[_0x5177('0x2d')](_0x1cef5d);};}exports[_0x5177('0x2e')]=function(_0x8134f9,_0x31eb9f){var _0x72dced={},_0x49f6f1={},_0x42e1db={'count':0x0,'rows':[]};var _0x2233a2=_['map'](db[_0x5177('0x2f')]['rawAttributes'],function(_0x172b36){return{'name':_0x172b36[_0x5177('0x30')],'type':_0x172b36[_0x5177('0x31')]['key']};});_0x49f6f1['model']=_[_0x5177('0x32')](_0x2233a2,_0x5177('0x2c'));_0x49f6f1[_0x5177('0x33')]=_[_0x5177('0x34')](_0x8134f9[_0x5177('0x33')]);_0x49f6f1[_0x5177('0x35')]=_[_0x5177('0x36')](_0x49f6f1[_0x5177('0x37')],_0x49f6f1['query']);_0x72dced[_0x5177('0x38')]=_[_0x5177('0x36')](_0x49f6f1['model'],qs[_0x5177('0x39')](_0x8134f9[_0x5177('0x33')][_0x5177('0x39')]));_0x72dced[_0x5177('0x38')]=_0x72dced[_0x5177('0x38')][_0x5177('0x3a')]?_0x72dced['attributes']:_0x49f6f1[_0x5177('0x37')];if(!_0x8134f9[_0x5177('0x33')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x72dced[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x8134f9[_0x5177('0x33')]['limit']);_0x72dced[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x8134f9['query']['offset']);}_0x72dced[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x8134f9[_0x5177('0x33')][_0x5177('0x3f')]);_0x72dced[_0x5177('0x40')]=qs[_0x5177('0x35')](_[_0x5177('0x41')](_0x8134f9[_0x5177('0x33')],_0x49f6f1[_0x5177('0x35')]),_0x2233a2);if(_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]){_0x72dced[_0x5177('0x40')]=_[_0x5177('0x43')](_0x72dced['where'],{'$or':_[_0x5177('0x32')](_0x2233a2,function(_0x2a4db1){if(_0x2a4db1['type']!==_0x5177('0x44')){var _0x56f297={};_0x56f297[_0x2a4db1[_0x5177('0x2c')]]={'$like':'%'+_0x8134f9[_0x5177('0x33')][_0x5177('0x42')]+'%'};return _0x56f297;}})});}_0x72dced=_['merge']({},_0x72dced,_0x8134f9['options']);var _0x210510={'where':_0x72dced[_0x5177('0x40')]};return db[_0x5177('0x2f')][_0x5177('0x22')](_0x210510)[_0x5177('0x28')](function(_0x3e710d){_0x42e1db[_0x5177('0x22')]=_0x3e710d;if(_0x8134f9[_0x5177('0x33')]['includeAll']){_0x72dced[_0x5177('0x45')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x72dced);})[_0x5177('0x28')](function(_0x17dc98){_0x42e1db['rows']=_0x17dc98;return _0x42e1db;})[_0x5177('0x28')](respondWithFilteredResult(_0x31eb9f,_0x72dced))['catch'](handleError(_0x31eb9f,null));};exports['show']=function(_0x46c833,_0x1769cd){var _0x262c71={'raw':!![],'where':{'id':_0x46c833[_0x5177('0x46')]['id']}},_0x3776b8={};_0x3776b8[_0x5177('0x37')]=_[_0x5177('0x34')](db['VoiceMail']['rawAttributes']);_0x3776b8[_0x5177('0x33')]=_['keys'](_0x46c833[_0x5177('0x33')]);_0x3776b8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],_0x3776b8['query']);_0x262c71[_0x5177('0x38')]=_[_0x5177('0x36')](_0x3776b8[_0x5177('0x37')],qs[_0x5177('0x39')](_0x46c833[_0x5177('0x33')][_0x5177('0x39')]));_0x262c71[_0x5177('0x38')]=_0x262c71[_0x5177('0x38')][_0x5177('0x3a')]?_0x262c71[_0x5177('0x38')]:_0x3776b8[_0x5177('0x37')];if(_0x46c833['query'][_0x5177('0x47')]){_0x262c71['include']=[{'all':!![]}];}_0x262c71=_['merge']({},_0x262c71,_0x46c833['options']);return db[_0x5177('0x2f')][_0x5177('0x48')](_0x262c71)['then'](handleEntityNotFound(_0x1769cd,null))[_0x5177('0x28')](respondWithResult(_0x1769cd,null))[_0x5177('0x49')](handleError(_0x1769cd,null));};exports[_0x5177('0x4a')]=function(_0x4891fe,_0x1d4ae4){return db['VoiceMail']['create'](_0x4891fe['body'],{})[_0x5177('0x28')](function(_0x37d5dd){var _0x1300d7=_0x4891fe['user']['get']({'plain':!![]});if(!_0x1300d7)throw new Error(_0x5177('0x4b'));if(_0x1300d7['role']===_0x5177('0x4c')){var _0x9dd7a2=_0x37d5dd[_0x5177('0x4d')]({'plain':!![]});var _0x31a6e1=_0x5177('0x2a');return db[_0x5177('0x4e')][_0x5177('0x48')]({'where':{'name':_0x31a6e1,'userProfileId':_0x1300d7[_0x5177('0x4f')]},'raw':!![]})[_0x5177('0x28')](function(_0x217aca){if(_0x217aca&&_0x217aca[_0x5177('0x50')]===0x0){return db[_0x5177('0x2b')][_0x5177('0x4a')]({'name':_0x9dd7a2['name'],'resourceId':_0x9dd7a2['id'],'type':_0x217aca['name'],'sectionId':_0x217aca['id']},{})[_0x5177('0x28')](function(){return _0x37d5dd;});}else{return _0x37d5dd;}})['catch'](function(_0x649c6f){logger['error'](_0x5177('0x51'),_0x649c6f);throw _0x649c6f;});}return _0x37d5dd;})[_0x5177('0x28')](respondWithResult(_0x1d4ae4,0xc9))[_0x5177('0x49')](handleError(_0x1d4ae4,null));};exports['update']=function(_0x5be224,_0x19884e){if(_0x5be224[_0x5177('0x52')]['id']){delete _0x5be224[_0x5177('0x52')]['id'];}return db[_0x5177('0x2f')]['find']({'where':{'id':_0x5be224['params']['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x19884e,null))[_0x5177('0x28')](saveUpdates(_0x5be224[_0x5177('0x52')],null))[_0x5177('0x28')](respondWithResult(_0x19884e,null))['catch'](handleError(_0x19884e,null));};exports[_0x5177('0x29')]=function(_0x143aff,_0x3a18ad){return db['VoiceMail'][_0x5177('0x48')]({'where':{'id':_0x143aff[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x3a18ad,null))['then'](removeEntity(_0x3a18ad,null))[_0x5177('0x49')](handleError(_0x3a18ad,null));};exports['getMessages']=function(_0x40dfd6,_0x39fb92,_0x3268bd){return db['VoiceMail'][_0x5177('0x53')]({'where':{'id':_0x40dfd6[_0x5177('0x46')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x39fb92,null))[_0x5177('0x28')](function(_0xc7a59e){var _0x74589e;var _0x37380c={},_0x267599={};_0x267599['model']=_['keys'](db['VoiceMailMessage'][_0x5177('0x54')]);_0x267599[_0x5177('0x33')]=_[_0x5177('0x34')](_0x40dfd6[_0x5177('0x33')]);_0x267599[_0x5177('0x35')]=_[_0x5177('0x36')](_0x267599['model'],_0x267599['query']);_0x37380c[_0x5177('0x38')]=_[_0x5177('0x36')](_0x267599[_0x5177('0x37')],qs[_0x5177('0x39')](_0x40dfd6[_0x5177('0x33')][_0x5177('0x39')]));_0x37380c[_0x5177('0x38')]=_0x37380c[_0x5177('0x38')][_0x5177('0x3a')]?_0x37380c['attributes']:_0x267599[_0x5177('0x37')];if(!_0x40dfd6[_0x5177('0x33')]['hasOwnProperty'](_0x5177('0x3c'))){_0x37380c[_0x5177('0x3d')]=qs['limit'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x3d')]);_0x37380c[_0x5177('0x20')]=qs['offset'](_0x40dfd6[_0x5177('0x33')][_0x5177('0x20')]);}_0x37380c['order']=qs['sort'](_0x40dfd6[_0x5177('0x33')]['sort']);_0x37380c[_0x5177('0x40')]=qs['filters'](_[_0x5177('0x41')](_0x40dfd6[_0x5177('0x33')],_0x267599['filters']));if(_0x40dfd6[_0x5177('0x33')][_0x5177('0x42')]){_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c[_0x5177('0x40')],{'$or':_[_0x5177('0x32')](_0x37380c[_0x5177('0x38')],function(_0x58ebdd){var _0x26b733={};_0x26b733[_0x58ebdd]={'$like':'%'+_0x40dfd6['query']['filter']+'%'};return _0x26b733;})});}_0x37380c[_0x5177('0x40')]=_[_0x5177('0x43')](_0x37380c['where'],{'mailboxuser':_0xc7a59e[_0x5177('0x55')]});_0x37380c=_[_0x5177('0x43')]({},_0x37380c,_0x40dfd6[_0x5177('0x56')]);return db[_0x5177('0x57')][_0x5177('0x58')](_0x37380c)[_0x5177('0x28')](respondWithFilteredResult(_0x39fb92,_0x37380c));})[_0x5177('0x49')](handleError(_0x39fb92,null));}; \ No newline at end of file +var _0x2f68=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','Voicemails','error','stack','name','send','index','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','destroy','getMessages','findOne','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel'];(function(_0x49dfc6,_0x43f8db){var _0xd622=function(_0x30eb26){while(--_0x30eb26){_0x49dfc6['push'](_0x49dfc6['shift']());}};_0xd622(++_0x43f8db);}(_0x2f68,0x9a));var _0x82f6=function(_0x5e99cc,_0x2e5750){_0x5e99cc=_0x5e99cc-0x0;var _0x1d8e38=_0x2f68[_0x5e99cc];return _0x1d8e38;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require('moment');var BPromise=require(_0x82f6('0x4'));var Mustache=require('mustache');var util=require(_0x82f6('0x5'));var path=require(_0x82f6('0x6'));var sox=require('sox');var csv=require(_0x82f6('0x7'));var ejs=require(_0x82f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x82f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82f6('0xa'));var toCsv=require(_0x82f6('0x7'));var querystring=require(_0x82f6('0xb'));var Papa=require('papaparse');var Redis=require(_0x82f6('0xc'));var authService=require(_0x82f6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0xe'));var hardwareService=require(_0x82f6('0xf'));var logger=require(_0x82f6('0x10'))(_0x82f6('0x11'));var utils=require(_0x82f6('0x12'));var config=require(_0x82f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x82f6('0x14'))['db'];function respondWithStatusCode(_0x442262,_0x4cc967){_0x4cc967=_0x4cc967||0xcc;return function(_0x194da7){if(_0x194da7){return _0x442262[_0x82f6('0x15')](_0x4cc967);}return _0x442262[_0x82f6('0x16')](_0x4cc967)[_0x82f6('0x17')]();};}function respondWithResult(_0x371481,_0xa00275){_0xa00275=_0xa00275||0xc8;return function(_0x115c7b){if(_0x115c7b){return _0x371481[_0x82f6('0x16')](_0xa00275)[_0x82f6('0x18')](_0x115c7b);}};}function respondWithFilteredResult(_0x55b58e,_0x389949){return function(_0x5d0827){if(_0x5d0827){var _0x249222=typeof _0x389949[_0x82f6('0x19')]===_0x82f6('0x1a')&&typeof _0x389949[_0x82f6('0x1b')]===_0x82f6('0x1a');var _0x2326ae=_0x5d0827[_0x82f6('0x1c')];var _0xcbc95f=_0x249222?0x0:_0x389949[_0x82f6('0x19')];var _0x2bfd57=_0x249222?_0x5d0827[_0x82f6('0x1c')]:_0x389949[_0x82f6('0x19')]+_0x389949[_0x82f6('0x1b')];var _0x4fe226;if(_0x2bfd57>=_0x2326ae){_0x2bfd57=_0x2326ae;_0x4fe226=0xc8;}else{_0x4fe226=0xce;}_0x55b58e[_0x82f6('0x16')](_0x4fe226);return _0x55b58e['set'](_0x82f6('0x1d'),_0xcbc95f+'-'+_0x2bfd57+'/'+_0x2326ae)[_0x82f6('0x18')](_0x5d0827);}return null;};}function patchUpdates(_0x55cbce){return function(_0x2b03ad){try{jsonpatch[_0x82f6('0x1e')](_0x2b03ad,_0x55cbce,!![]);}catch(_0x46713a){return BPromise[_0x82f6('0x1f')](_0x46713a);}return _0x2b03ad['save']();};}function saveUpdates(_0xdc4dea,_0x4beccf){return function(_0x8668bb){if(_0x8668bb){return _0x8668bb[_0x82f6('0x20')](_0xdc4dea)['then'](function(_0x516deb){return _0x516deb;});}return null;};}function removeEntity(_0x3af5f7,_0x1d96d5){return function(_0x4c57c5){if(_0x4c57c5){return _0x4c57c5['destroy']()[_0x82f6('0x21')](function(){var _0x31face=_0x4c57c5['get']({'plain':!![]});var _0xfd8b68=_0x82f6('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0xfd8b68,'resourceId':_0x31face['id']}})[_0x82f6('0x21')](function(){return _0x4c57c5;});})['then'](function(){_0x3af5f7[_0x82f6('0x16')](0xcc)[_0x82f6('0x17')]();});}};}function handleEntityNotFound(_0x54ce11,_0x3795ef){return function(_0x15c9b7){if(!_0x15c9b7){_0x54ce11[_0x82f6('0x15')](0x194);}return _0x15c9b7;};}function handleError(_0x1125a0,_0x4f9fa4){_0x4f9fa4=_0x4f9fa4||0x1f4;return function(_0x40a071){logger[_0x82f6('0x23')](_0x40a071[_0x82f6('0x24')]);if(_0x40a071[_0x82f6('0x25')]){delete _0x40a071[_0x82f6('0x25')];}_0x1125a0[_0x82f6('0x16')](_0x4f9fa4)[_0x82f6('0x26')](_0x40a071);};}exports[_0x82f6('0x27')]=function(_0x1e1aa4,_0x402449){var _0x3c9419={},_0x20d1c5={},_0x6ce179={'count':0x0,'rows':[]};var _0x91117b=_['map'](db[_0x82f6('0x28')][_0x82f6('0x29')],function(_0x418f34){return{'name':_0x418f34['fieldName'],'type':_0x418f34[_0x82f6('0x2a')][_0x82f6('0x2b')]};});_0x20d1c5[_0x82f6('0x2c')]=_[_0x82f6('0x2d')](_0x91117b,_0x82f6('0x25'));_0x20d1c5[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x1e1aa4[_0x82f6('0x2e')]);_0x20d1c5[_0x82f6('0x30')]=_[_0x82f6('0x31')](_0x20d1c5[_0x82f6('0x2c')],_0x20d1c5[_0x82f6('0x2e')]);_0x3c9419[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x20d1c5['model'],qs[_0x82f6('0x33')](_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x3c9419[_0x82f6('0x32')]=_0x3c9419[_0x82f6('0x32')][_0x82f6('0x34')]?_0x3c9419[_0x82f6('0x32')]:_0x20d1c5[_0x82f6('0x2c')];if(!_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x35')](_0x82f6('0x36'))){_0x3c9419[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x1e1aa4[_0x82f6('0x2e')]['limit']);_0x3c9419[_0x82f6('0x19')]=qs['offset'](_0x1e1aa4['query'][_0x82f6('0x19')]);}_0x3c9419[_0x82f6('0x37')]=qs['sort'](_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x38')]);_0x3c9419[_0x82f6('0x39')]=qs['filters'](_[_0x82f6('0x3a')](_0x1e1aa4['query'],_0x20d1c5[_0x82f6('0x30')]),_0x91117b);if(_0x1e1aa4['query'][_0x82f6('0x3b')]){_0x3c9419['where']=_[_0x82f6('0x3c')](_0x3c9419[_0x82f6('0x39')],{'$or':_['map'](_0x91117b,function(_0xfce1dd){if(_0xfce1dd[_0x82f6('0x2a')]!==_0x82f6('0x3d')){var _0x43dcd1={};_0x43dcd1[_0xfce1dd['name']]={'$like':'%'+_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x3b')]+'%'};return _0x43dcd1;}})});}_0x3c9419=_[_0x82f6('0x3c')]({},_0x3c9419,_0x1e1aa4[_0x82f6('0x3e')]);var _0x55ecd4={'where':_0x3c9419[_0x82f6('0x39')]};return db[_0x82f6('0x28')]['count'](_0x55ecd4)[_0x82f6('0x21')](function(_0x699803){_0x6ce179[_0x82f6('0x1c')]=_0x699803;if(_0x1e1aa4[_0x82f6('0x2e')][_0x82f6('0x3f')]){_0x3c9419['include']=[{'all':!![]}];}return db[_0x82f6('0x28')]['findAll'](_0x3c9419);})[_0x82f6('0x21')](function(_0x38e82d){_0x6ce179[_0x82f6('0x40')]=_0x38e82d;return _0x6ce179;})[_0x82f6('0x21')](respondWithFilteredResult(_0x402449,_0x3c9419))[_0x82f6('0x41')](handleError(_0x402449,null));};exports[_0x82f6('0x42')]=function(_0x43fefc,_0x47a0d1){var _0x165493={'raw':!![],'where':{'id':_0x43fefc[_0x82f6('0x43')]['id']}},_0x297cda={};_0x297cda[_0x82f6('0x2c')]=_['keys'](db[_0x82f6('0x28')]['rawAttributes']);_0x297cda[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x43fefc[_0x82f6('0x2e')]);_0x297cda[_0x82f6('0x30')]=_[_0x82f6('0x31')](_0x297cda[_0x82f6('0x2c')],_0x297cda['query']);_0x165493[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x297cda[_0x82f6('0x2c')],qs[_0x82f6('0x33')](_0x43fefc[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x165493[_0x82f6('0x32')]=_0x165493[_0x82f6('0x32')]['length']?_0x165493[_0x82f6('0x32')]:_0x297cda[_0x82f6('0x2c')];if(_0x43fefc['query'][_0x82f6('0x3f')]){_0x165493['include']=[{'all':!![]}];}_0x165493=_[_0x82f6('0x3c')]({},_0x165493,_0x43fefc['options']);return db[_0x82f6('0x28')][_0x82f6('0x44')](_0x165493)[_0x82f6('0x21')](handleEntityNotFound(_0x47a0d1,null))[_0x82f6('0x21')](respondWithResult(_0x47a0d1,null))[_0x82f6('0x41')](handleError(_0x47a0d1,null));};exports[_0x82f6('0x45')]=function(_0x53f7d4,_0x3cb1f0){return db[_0x82f6('0x28')]['create'](_0x53f7d4['body'],{})[_0x82f6('0x21')](function(_0x2a6366){var _0x2c2b64=_0x53f7d4['user'][_0x82f6('0x46')]({'plain':!![]});if(!_0x2c2b64)throw new Error(_0x82f6('0x47'));if(_0x2c2b64[_0x82f6('0x48')]===_0x82f6('0x49')){var _0x4e9e13=_0x2a6366['get']({'plain':!![]});var _0x1695ea=_0x82f6('0x22');return db[_0x82f6('0x4a')]['find']({'where':{'name':_0x1695ea,'userProfileId':_0x2c2b64[_0x82f6('0x4b')]},'raw':!![]})[_0x82f6('0x21')](function(_0x4bc646){if(_0x4bc646&&_0x4bc646['autoAssociation']===0x0){return db['UserProfileResource'][_0x82f6('0x45')]({'name':_0x4e9e13['name'],'resourceId':_0x4e9e13['id'],'type':_0x4bc646[_0x82f6('0x25')],'sectionId':_0x4bc646['id']},{})['then'](function(){return _0x2a6366;});}else{return _0x2a6366;}})[_0x82f6('0x41')](function(_0x4f69de){logger[_0x82f6('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f69de);throw _0x4f69de;});}return _0x2a6366;})[_0x82f6('0x21')](respondWithResult(_0x3cb1f0,0xc9))[_0x82f6('0x41')](handleError(_0x3cb1f0,null));};exports[_0x82f6('0x20')]=function(_0x1633cf,_0xb8d7d8){if(_0x1633cf[_0x82f6('0x4c')]['id']){delete _0x1633cf['body']['id'];}return db[_0x82f6('0x28')][_0x82f6('0x44')]({'where':{'id':_0x1633cf[_0x82f6('0x43')]['id']}})['then'](handleEntityNotFound(_0xb8d7d8,null))['then'](saveUpdates(_0x1633cf[_0x82f6('0x4c')],null))[_0x82f6('0x21')](respondWithResult(_0xb8d7d8,null))[_0x82f6('0x41')](handleError(_0xb8d7d8,null));};exports[_0x82f6('0x4d')]=function(_0x49a204,_0x2c1c0e){return db[_0x82f6('0x28')][_0x82f6('0x44')]({'where':{'id':_0x49a204['params']['id']}})['then'](handleEntityNotFound(_0x2c1c0e,null))['then'](removeEntity(_0x2c1c0e,null))[_0x82f6('0x41')](handleError(_0x2c1c0e,null));};exports[_0x82f6('0x4e')]=function(_0x221cfc,_0x59176d,_0x4013f0){return db[_0x82f6('0x28')][_0x82f6('0x4f')]({'where':{'id':_0x221cfc[_0x82f6('0x43')]['id']}})['then'](handleEntityNotFound(_0x59176d,null))[_0x82f6('0x21')](function(_0x94aed4){var _0x12a5b9;var _0x33591b={},_0x4a8bdb={};_0x4a8bdb['model']=_[_0x82f6('0x2f')](db[_0x82f6('0x50')]['rawAttributes']);_0x4a8bdb[_0x82f6('0x2e')]=_[_0x82f6('0x2f')](_0x221cfc[_0x82f6('0x2e')]);_0x4a8bdb['filters']=_[_0x82f6('0x31')](_0x4a8bdb[_0x82f6('0x2c')],_0x4a8bdb[_0x82f6('0x2e')]);_0x33591b[_0x82f6('0x32')]=_[_0x82f6('0x31')](_0x4a8bdb[_0x82f6('0x2c')],qs['fields'](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x33')]));_0x33591b[_0x82f6('0x32')]=_0x33591b[_0x82f6('0x32')][_0x82f6('0x34')]?_0x33591b['attributes']:_0x4a8bdb[_0x82f6('0x2c')];if(!_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x35')](_0x82f6('0x36'))){_0x33591b[_0x82f6('0x1b')]=qs[_0x82f6('0x1b')](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x1b')]);_0x33591b['offset']=qs[_0x82f6('0x19')](_0x221cfc['query'][_0x82f6('0x19')]);}_0x33591b[_0x82f6('0x37')]=qs['sort'](_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x38')]);_0x33591b[_0x82f6('0x39')]=qs['filters'](_['pick'](_0x221cfc[_0x82f6('0x2e')],_0x4a8bdb[_0x82f6('0x30')]));if(_0x221cfc['query']['filter']){_0x33591b[_0x82f6('0x39')]=_[_0x82f6('0x3c')](_0x33591b[_0x82f6('0x39')],{'$or':_[_0x82f6('0x2d')](_0x33591b[_0x82f6('0x32')],function(_0x11581c){var _0xc1d784={};_0xc1d784[_0x11581c]={'$like':'%'+_0x221cfc[_0x82f6('0x2e')][_0x82f6('0x3b')]+'%'};return _0xc1d784;})});}_0x33591b[_0x82f6('0x39')]=_[_0x82f6('0x3c')](_0x33591b[_0x82f6('0x39')],{'mailboxuser':_0x94aed4['mailbox']});_0x33591b=_[_0x82f6('0x3c')]({},_0x33591b,_0x221cfc[_0x82f6('0x3e')]);return db[_0x82f6('0x50')][_0x82f6('0x51')](_0x33591b)[_0x82f6('0x21')](respondWithFilteredResult(_0x59176d,_0x33591b));})['catch'](handleError(_0x59176d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4eb8518..5624f07 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 _0xefe0=['api','moment','bluebird','request-promise','../../config/environment','./voiceMail.attributes','define','VoiceMail','mailbox','lodash','util'];(function(_0x5bf5f0,_0x5e0a01){var _0x137159=function(_0x1298f3){while(--_0x1298f3){_0x5bf5f0['push'](_0x5bf5f0['shift']());}};_0x137159(++_0x5e0a01);}(_0xefe0,0x98));var _0x0efe=function(_0x34c542,_0x220b05){_0x34c542=_0x34c542-0x0;var _0x5b9ec2=_0xefe0[_0x34c542];return _0x5b9ec2;};'use strict';var _=require(_0x0efe('0x0'));var util=require(_0x0efe('0x1'));var logger=require('../../config/logger')(_0x0efe('0x2'));var moment=require(_0x0efe('0x3'));var BPromise=require(_0x0efe('0x4'));var rp=require(_0x0efe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0efe('0x6'));var attributes=require(_0x0efe('0x7'));module['exports']=function(_0x2992d0,_0xd9cdfb){return _0x2992d0[_0x0efe('0x8')](_0x0efe('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x0efe('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb758=['define','VoiceMail','voice_voicemail','mailbox','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes'];(function(_0x3e0558,_0x4818a4){var _0xfa1387=function(_0x3b5c61){while(--_0x3b5c61){_0x3e0558['push'](_0x3e0558['shift']());}};_0xfa1387(++_0x4818a4);}(_0xb758,0xfb));var _0x8b75=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xb758[_0x540133];return _0x26b6e9;};'use strict';var _=require(_0x8b75('0x0'));var util=require(_0x8b75('0x1'));var logger=require(_0x8b75('0x2'))(_0x8b75('0x3'));var moment=require('moment');var BPromise=require(_0x8b75('0x4'));var rp=require(_0x8b75('0x5'));var fs=require('fs');var path=require(_0x8b75('0x6'));var rimraf=require('rimraf');var config=require(_0x8b75('0x7'));var attributes=require(_0x8b75('0x8'));module['exports']=function(_0x4fcf9b,_0x12734b){return _0x4fcf9b[_0x8b75('0x9')](_0x8b75('0xa'),attributes,{'tableName':_0x8b75('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8b75('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index c16e75c..d59ea2f 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 _0x865c=['client','http','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x865c,0x1d5));var _0xc865=function(_0x4e49f3,_0x55e529){_0x4e49f3=_0x4e49f3-0x0;var _0xbef0ac=_0x865c[_0x4e49f3];return _0xbef0ac;};'use strict';var _=require(_0xc865('0x0'));var util=require(_0xc865('0x1'));var moment=require(_0xc865('0x2'));var BPromise=require(_0xc865('0x3'));var rs=require(_0xc865('0x4'));var fs=require('fs');var Redis=require(_0xc865('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc865('0x6'));var logger=require(_0xc865('0x7'))(_0xc865('0x8'));var config=require(_0xc865('0x9'));var jayson=require(_0xc865('0xa'));var client=jayson[_0xc865('0xb')][_0xc865('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bb8a6,_0x25bacb,_0x3f86b9){return new BPromise(function(_0x3a3e6d,_0xdd88b6){return client['request'](_0x3bb8a6,_0x3f86b9)[_0xc865('0xd')](function(_0x2083ab){logger['info'](_0xc865('0xe'),_0x25bacb,'request\x20sent');logger[_0xc865('0xf')](_0xc865('0x10'),_0x25bacb,_0xc865('0x11'),JSON['stringify'](_0x2083ab));if(_0x2083ab[_0xc865('0x12')]){if(_0x2083ab[_0xc865('0x12')][_0xc865('0x13')]===0x1f4){logger[_0xc865('0x12')](_0xc865('0xe'),_0x25bacb,_0x2083ab[_0xc865('0x12')][_0xc865('0x14')]);return _0xdd88b6(_0x2083ab[_0xc865('0x12')][_0xc865('0x14')]);}logger[_0xc865('0x12')](_0xc865('0xe'),_0x25bacb,_0x2083ab['error'][_0xc865('0x14')]);return _0x3a3e6d(_0x2083ab[_0xc865('0x12')]['message']);}else{logger[_0xc865('0x15')](_0xc865('0xe'),_0x25bacb,_0xc865('0x11'));_0x3a3e6d(_0x2083ab[_0xc865('0x16')][_0xc865('0x14')]);}})[_0xc865('0x17')](function(_0x460965){logger[_0xc865('0x12')](_0xc865('0xe'),_0x25bacb,_0x460965);_0xdd88b6(_0x460965);});});} \ No newline at end of file +var _0x2986=['VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x350878,_0x1a5ee3){var _0x33da22=function(_0x582bca){while(--_0x582bca){_0x350878['push'](_0x350878['shift']());}};_0x33da22(++_0x1a5ee3);}(_0x2986,0x184));var _0x6298=function(_0x1a6718,_0xf6325){_0x1a6718=_0x1a6718-0x0;var _0x2fdb5e=_0x2986[_0x1a6718];return _0x2fdb5e;};'use strict';var _=require('lodash');var util=require(_0x6298('0x0'));var moment=require('moment');var BPromise=require(_0x6298('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6298('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6298('0x3'));var logger=require(_0x6298('0x4'))(_0x6298('0x5'));var config=require(_0x6298('0x6'));var jayson=require(_0x6298('0x7'));var client=jayson[_0x6298('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c7bf,_0x4b9f9d,_0x586011){return new BPromise(function(_0x2e0551,_0x427f2a){return client['request'](_0x10c7bf,_0x586011)[_0x6298('0x9')](function(_0x160c6e){logger[_0x6298('0xa')](_0x6298('0xb'),_0x4b9f9d,_0x6298('0xc'));logger[_0x6298('0xd')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x4b9f9d,_0x6298('0xc'),JSON[_0x6298('0xe')](_0x160c6e));if(_0x160c6e[_0x6298('0xf')]){if(_0x160c6e[_0x6298('0xf')]['code']===0x1f4){logger[_0x6298('0xf')](_0x6298('0xb'),_0x4b9f9d,_0x160c6e[_0x6298('0xf')][_0x6298('0x10')]);return _0x427f2a(_0x160c6e[_0x6298('0xf')][_0x6298('0x10')]);}logger[_0x6298('0xf')]('VoiceMail,\x20%s,\x20%s',_0x4b9f9d,_0x160c6e[_0x6298('0xf')][_0x6298('0x10')]);return _0x2e0551(_0x160c6e['error'][_0x6298('0x10')]);}else{logger[_0x6298('0xa')](_0x6298('0xb'),_0x4b9f9d,'request\x20sent');_0x2e0551(_0x160c6e[_0x6298('0x11')][_0x6298('0x10')]);}})[_0x6298('0x12')](function(_0x286d5e){logger[_0x6298('0xf')](_0x6298('0xb'),_0x4b9f9d,_0x286d5e);_0x427f2a(_0x286d5e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 6482b07..4cbf96b 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 _0x2016=['/:id','show','download','post','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get'];(function(_0x1c553f,_0x472411){var _0x18cff3=function(_0x5d460f){while(--_0x5d460f){_0x1c553f['push'](_0x1c553f['shift']());}};_0x18cff3(++_0x472411);}(_0x2016,0x16f));var _0x6201=function(_0xf5f2c0,_0x188931){_0xf5f2c0=_0xf5f2c0-0x0;var _0x1cb23a=_0x2016[_0xf5f2c0];return _0x1cb23a;};'use strict';var multer=require(_0x6201('0x0'));var util=require(_0x6201('0x1'));var path=require(_0x6201('0x2'));var timeout=require('connect-timeout');var express=require(_0x6201('0x3'));var router=express[_0x6201('0x4')]();var fs_extra=require(_0x6201('0x5'));var auth=require(_0x6201('0x6'));var interaction=require(_0x6201('0x7'));var config=require(_0x6201('0x8'));var controller=require(_0x6201('0x9'));router['get']('/',auth[_0x6201('0xa')](),controller[_0x6201('0xb')]);router[_0x6201('0xc')](_0x6201('0xd'),auth[_0x6201('0xa')](),controller[_0x6201('0xe')]);router[_0x6201('0xc')]('/:id/download',auth[_0x6201('0xa')](),controller[_0x6201('0xf')]);router[_0x6201('0x10')]('/',auth[_0x6201('0xa')](),controller['create']);router['put']('/:id',auth[_0x6201('0xa')](),controller[_0x6201('0x11')]);router[_0x6201('0x12')](_0x6201('0xd'),auth['isAuthenticated'](),controller[_0x6201('0x13')]);module['exports']=router; \ No newline at end of file +var _0x895e=['../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5b42fe,_0x129d7f){var _0x1b0c93=function(_0x448c23){while(--_0x448c23){_0x5b42fe['push'](_0x5b42fe['shift']());}};_0x1b0c93(++_0x129d7f);}(_0x895e,0x1c2));var _0xe895=function(_0x2a2233,_0x2f2ee5){_0x2a2233=_0x2a2233-0x0;var _0x504cd2=_0x895e[_0x2a2233];return _0x504cd2;};'use strict';var multer=require(_0xe895('0x0'));var util=require(_0xe895('0x1'));var path=require('path');var timeout=require(_0xe895('0x2'));var express=require(_0xe895('0x3'));var router=express[_0xe895('0x4')]();var fs_extra=require(_0xe895('0x5'));var auth=require(_0xe895('0x6'));var interaction=require(_0xe895('0x7'));var config=require('../../config/environment');var controller=require(_0xe895('0x8'));router[_0xe895('0x9')]('/',auth[_0xe895('0xa')](),controller['index']);router['get'](_0xe895('0xb'),auth[_0xe895('0xa')](),controller[_0xe895('0xc')]);router[_0xe895('0x9')](_0xe895('0xd'),auth[_0xe895('0xa')](),controller[_0xe895('0xe')]);router['post']('/',auth[_0xe895('0xa')](),controller[_0xe895('0xf')]);router['put'](_0xe895('0xb'),auth['isAuthenticated'](),controller[_0xe895('0x10')]);router[_0xe895('0x11')](_0xe895('0xb'),auth[_0xe895('0xa')](),controller['destroy']);module[_0xe895('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 5a23728..6be4da8 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 _0xb068=['BLOB','long','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','INTEGER','STRING'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xb068,0xa4));var _0x8b06=function(_0x4cea4f,_0x286486){_0x4cea4f=_0x4cea4f-0x0;var _0x55fe54=_0xb068[_0x4cea4f];return _0x55fe54;};'use strict';var Sequelize=require('sequelize');module[_0x8b06('0x0')]={'name':{'type':Sequelize[_0x8b06('0x1')],'get':function(_0x489003){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x8b06('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x8b06('0x4')](_0x8b06('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8b06('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal'](_0x8b06('0x6'))}}; \ No newline at end of file +var _0x2389=['BLOB','TIMESTAMP','literal','sequelize','exports','VIRTUAL','STRING'];(function(_0x47ec93,_0x8dc08f){var _0x42a807=function(_0x417b12){while(--_0x417b12){_0x47ec93['push'](_0x47ec93['shift']());}};_0x42a807(++_0x8dc08f);}(_0x2389,0xa4));var _0x9238=function(_0x489577,_0x5ca21c){_0x489577=_0x489577-0x0;var _0x3f7c42=_0x2389[_0x489577];return _0x3f7c42;};'use strict';var Sequelize=require(_0x9238('0x0'));module[_0x9238('0x1')]={'name':{'type':Sequelize[_0x9238('0x2')],'get':function(_0xdf3e1c){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x9238('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9238('0x3')],'defaultValue':''},'stamp':{'type':_0x9238('0x5'),'defaultValue':Sequelize[_0x9238('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 78fa500..d580a70 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 _0x376e=['index','map','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','VoiceMailMessage','rawAttributes','catch','create','body','find','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','send','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','offset','count','json','apply','reject','save','update','destroy','then','end','error','stack','name'];(function(_0x5e84cd,_0xb0d9f3){var _0xafd3e6=function(_0x2babeb){while(--_0x2babeb){_0x5e84cd['push'](_0x5e84cd['shift']());}};_0xafd3e6(++_0xb0d9f3);}(_0x376e,0x76));var _0xe376=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x376e[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0xe376('0x0'));var rimraf=require(_0xe376('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe376('0x2'));var rp=require(_0xe376('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe376('0x4'));var util=require('util');var path=require(_0xe376('0x5'));var sox=require('sox');var csv=require(_0xe376('0x6'));var ejs=require(_0xe376('0x7'));var fs=require('fs');var fs_extra=require(_0xe376('0x8'));var _=require(_0xe376('0x9'));var squel=require(_0xe376('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe376('0x6'));var querystring=require(_0xe376('0xb'));var Papa=require(_0xe376('0xc'));var Redis=require(_0xe376('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe376('0xe'));var as=require(_0xe376('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe376('0x10'));var config=require(_0xe376('0x11'));var licenseUtil=require(_0xe376('0x12'));var db=require(_0xe376('0x13'))['db'];function respondWithStatusCode(_0x178eec,_0x4cf158){_0x4cf158=_0x4cf158||0xcc;return function(_0x5d3730){if(_0x5d3730){return _0x178eec['sendStatus'](_0x4cf158);}return _0x178eec[_0xe376('0x14')](_0x4cf158)['end']();};}function respondWithResult(_0x320f1a,_0x2b37ec){_0x2b37ec=_0x2b37ec||0xc8;return function(_0x11bb86){if(_0x11bb86){return _0x320f1a[_0xe376('0x14')](_0x2b37ec)['json'](_0x11bb86);}};}function respondWithFilteredResult(_0x30078a,_0x3863a7){return function(_0x14bd05){if(_0x14bd05){var _0x22ad82=typeof _0x3863a7['offset']===_0xe376('0x15')&&typeof _0x3863a7[_0xe376('0x16')]==='undefined';var _0x219360=_0x14bd05['count'];var _0x5868c2=_0x22ad82?0x0:_0x3863a7[_0xe376('0x17')];var _0x3ecb75=_0x22ad82?_0x14bd05[_0xe376('0x18')]:_0x3863a7[_0xe376('0x17')]+_0x3863a7['limit'];var _0x2ebc4a;if(_0x3ecb75>=_0x219360){_0x3ecb75=_0x219360;_0x2ebc4a=0xc8;}else{_0x2ebc4a=0xce;}_0x30078a[_0xe376('0x14')](_0x2ebc4a);return _0x30078a['set']('Content-Range',_0x5868c2+'-'+_0x3ecb75+'/'+_0x219360)[_0xe376('0x19')](_0x14bd05);}return null;};}function patchUpdates(_0x3f642f){return function(_0x37cf5f){try{jsonpatch[_0xe376('0x1a')](_0x37cf5f,_0x3f642f,!![]);}catch(_0x599a1b){return BPromise[_0xe376('0x1b')](_0x599a1b);}return _0x37cf5f[_0xe376('0x1c')]();};}function saveUpdates(_0x44bac0,_0x2d15ff){return function(_0x37398a){if(_0x37398a){return _0x37398a[_0xe376('0x1d')](_0x44bac0)['then'](function(_0x3b307b){return _0x3b307b;});}return null;};}function removeEntity(_0x4c7693,_0x47fb0e){return function(_0xacb007){if(_0xacb007){return _0xacb007[_0xe376('0x1e')]()[_0xe376('0x1f')](function(){_0x4c7693['status'](0xcc)[_0xe376('0x20')]();});}};}function handleEntityNotFound(_0xa6d0a3,_0x3422ac){return function(_0x4aa64c){if(!_0x4aa64c){_0xa6d0a3['sendStatus'](0x194);}return _0x4aa64c;};}function handleError(_0x41976c,_0x32aa48){_0x32aa48=_0x32aa48||0x1f4;return function(_0xbb69f3){logger[_0xe376('0x21')](_0xbb69f3[_0xe376('0x22')]);if(_0xbb69f3['name']){delete _0xbb69f3[_0xe376('0x23')];}_0x41976c[_0xe376('0x14')](_0x32aa48)['send'](_0xbb69f3);};}exports[_0xe376('0x24')]=function(_0x2c9055,_0xc02a46){var _0x16bbfe={},_0x141f4a={},_0x377f44={'count':0x0,'rows':[]};var _0x49e29a=_[_0xe376('0x25')](db['VoiceMailMessage']['rawAttributes'],function(_0x32df13){return{'name':_0x32df13['fieldName'],'type':_0x32df13[_0xe376('0x26')][_0xe376('0x27')]};});_0x141f4a[_0xe376('0x28')]=_[_0xe376('0x29')](_[_0xe376('0x25')](_0x49e29a,_0xe376('0x23')),[_0xe376('0x23')]);_0x141f4a[_0xe376('0x2a')]=_['keys'](_0x2c9055[_0xe376('0x2a')]);_0x141f4a[_0xe376('0x2b')]=_[_0xe376('0x2c')](_0x141f4a[_0xe376('0x28')],_0x141f4a[_0xe376('0x2a')]);_0x16bbfe[_0xe376('0x2d')]=_[_0xe376('0x2c')](_0x141f4a[_0xe376('0x28')],qs[_0xe376('0x2e')](_0x2c9055[_0xe376('0x2a')]['fields']));_0x16bbfe[_0xe376('0x2d')]=_0x16bbfe[_0xe376('0x2d')][_0xe376('0x2f')]?_0x16bbfe['attributes']:_0x141f4a['model'];if(!_0x2c9055['query'][_0xe376('0x30')](_0xe376('0x31'))){_0x16bbfe[_0xe376('0x16')]=qs[_0xe376('0x16')](_0x2c9055[_0xe376('0x2a')][_0xe376('0x16')]);_0x16bbfe[_0xe376('0x17')]=qs[_0xe376('0x17')](_0x2c9055['query'][_0xe376('0x17')]);}_0x16bbfe['order']=qs[_0xe376('0x32')](_0x2c9055['query'][_0xe376('0x32')]);_0x16bbfe[_0xe376('0x33')]=qs[_0xe376('0x2b')](_[_0xe376('0x34')](_0x2c9055[_0xe376('0x2a')],_0x141f4a[_0xe376('0x2b')]),_0x49e29a);if(_0x2c9055[_0xe376('0x2a')][_0xe376('0x35')]){_0x16bbfe[_0xe376('0x33')]=_[_0xe376('0x36')](_0x16bbfe[_0xe376('0x33')],{'$or':_['map'](_0x49e29a,function(_0x21358e){if(_0x21358e[_0xe376('0x26')]!==_0xe376('0x37')){var _0x5877a9={};_0x5877a9[_0x21358e[_0xe376('0x23')]]={'$like':'%'+_0x2c9055[_0xe376('0x2a')][_0xe376('0x35')]+'%'};return _0x5877a9;}})});}_0x16bbfe=_[_0xe376('0x36')]({},_0x16bbfe,_0x2c9055[_0xe376('0x38')]);var _0x1aad48={'where':_0x16bbfe['where']};return db['VoiceMailMessage']['count'](_0x1aad48)[_0xe376('0x1f')](function(_0x55ba02){_0x377f44['count']=_0x55ba02;if(_0x2c9055[_0xe376('0x2a')]['includeAll']){_0x16bbfe[_0xe376('0x39')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xe376('0x3a')](_0x16bbfe);})['then'](function(_0x54553d){_0x377f44[_0xe376('0x3b')]=_0x54553d;return _0x377f44;})[_0xe376('0x1f')](respondWithFilteredResult(_0xc02a46,_0x16bbfe))['catch'](handleError(_0xc02a46,null));};exports[_0xe376('0x3c')]=function(_0x29bb89,_0x37a15b){var _0x43e083={'raw':!![],'where':{'id':_0x29bb89[_0xe376('0x3d')]['id']}},_0xda0514={};_0xda0514[_0xe376('0x28')]=_[_0xe376('0x3e')](db[_0xe376('0x3f')][_0xe376('0x40')]);_0xda0514[_0xe376('0x2a')]=_[_0xe376('0x3e')](_0x29bb89[_0xe376('0x2a')]);_0xda0514['filters']=_[_0xe376('0x2c')](_0xda0514[_0xe376('0x28')],_0xda0514[_0xe376('0x2a')]);_0x43e083[_0xe376('0x2d')]=_[_0xe376('0x2c')](_0xda0514[_0xe376('0x28')],qs[_0xe376('0x2e')](_0x29bb89[_0xe376('0x2a')]['fields']));_0x43e083[_0xe376('0x2d')]=_0x43e083[_0xe376('0x2d')][_0xe376('0x2f')]?_0x43e083[_0xe376('0x2d')]:_0xda0514[_0xe376('0x28')];if(_0x29bb89[_0xe376('0x2a')]['includeAll']){_0x43e083['include']=[{'all':!![]}];}_0x43e083=_['merge']({},_0x43e083,_0x29bb89[_0xe376('0x38')]);return db[_0xe376('0x3f')]['find'](_0x43e083)['then'](handleEntityNotFound(_0x37a15b,null))[_0xe376('0x1f')](respondWithResult(_0x37a15b,null))[_0xe376('0x41')](handleError(_0x37a15b,null));};exports[_0xe376('0x42')]=function(_0x14d4cd,_0x1d0ae0){return db[_0xe376('0x3f')][_0xe376('0x42')](_0x14d4cd['body'],{})[_0xe376('0x1f')](respondWithResult(_0x1d0ae0,0xc9))[_0xe376('0x41')](handleError(_0x1d0ae0,null));};exports[_0xe376('0x1d')]=function(_0x53a426,_0x11cfd8){if(_0x53a426['body']['id']){delete _0x53a426[_0xe376('0x43')]['id'];}return db['VoiceMailMessage'][_0xe376('0x44')]({'where':{'id':_0x53a426[_0xe376('0x3d')]['id']}})['then'](handleEntityNotFound(_0x11cfd8,null))[_0xe376('0x1f')](saveUpdates(_0x53a426[_0xe376('0x43')],null))[_0xe376('0x1f')](respondWithResult(_0x11cfd8,null))[_0xe376('0x41')](handleError(_0x11cfd8,null));};exports[_0xe376('0x1e')]=function(_0x19c62c,_0x595aaa){return db[_0xe376('0x3f')][_0xe376('0x44')]({'where':{'id':_0x19c62c[_0xe376('0x3d')]['id']}})[_0xe376('0x1f')](handleEntityNotFound(_0x595aaa,null))['then'](removeEntity(_0x595aaa,null))[_0xe376('0x41')](handleError(_0x595aaa,null));};exports['download']=function(_0x3f2967,_0x5a5f27,_0x5183dd){return db[_0xe376('0x3f')][_0xe376('0x44')]({'where':{'id':_0x3f2967[_0xe376('0x3d')]['id']},'attributes':['id',_0xe376('0x45'),_0xe376('0x46')]})[_0xe376('0x1f')](handleEntityNotFound(_0x5a5f27,null))['then'](function(_0x1e46b6){if(_0x1e46b6){if(!_0x1e46b6[_0xe376('0x45')]){throw new db[(_0xe376('0x47'))]['ValidationError'](_0xe376('0x48'));}var _0x21bb4d={'Content-Type':_0xe376('0x49'),'Content-Disposition':_0xe376('0x4a')};if(_0x1e46b6['msg_id']){_0x21bb4d[_0xe376('0x4b')]='attachment;\x20filename=\x22'+_0x1e46b6[_0xe376('0x46')]+'.wav\x22';}_0x5a5f27['set'](_0x21bb4d);return _0x5a5f27[_0xe376('0x4c')](new Buffer(_0x1e46b6[_0xe376('0x45')]));}})[_0xe376('0x41')](handleError(_0x5a5f27,null));}; \ No newline at end of file +var _0x300a=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','download','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','update','destroy','then','sendStatus','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x300a,0x16f));var _0xa300=function(_0x18a4f7,_0x3f915c){_0x18a4f7=_0x18a4f7-0x0;var _0x368cf3=_0x300a[_0x18a4f7];return _0x368cf3;};'use strict';var emlformat=require(_0xa300('0x0'));var rimraf=require(_0xa300('0x1'));var zipdir=require(_0xa300('0x2'));var jsonpatch=require(_0xa300('0x3'));var rp=require(_0xa300('0x4'));var moment=require(_0xa300('0x5'));var BPromise=require(_0xa300('0x6'));var Mustache=require(_0xa300('0x7'));var util=require(_0xa300('0x8'));var path=require(_0xa300('0x9'));var sox=require(_0xa300('0xa'));var csv=require(_0xa300('0xb'));var ejs=require(_0xa300('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa300('0xd'));var squel=require(_0xa300('0xe'));var crypto=require(_0xa300('0xf'));var jsforce=require(_0xa300('0x10'));var deskjs=require(_0xa300('0x11'));var toCsv=require(_0xa300('0xb'));var querystring=require('querystring');var Papa=require(_0xa300('0x12'));var Redis=require(_0xa300('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa300('0x14'));var as=require(_0xa300('0x15'));var hardwareService=require(_0xa300('0x16'));var logger=require(_0xa300('0x17'))(_0xa300('0x18'));var utils=require(_0xa300('0x19'));var config=require(_0xa300('0x1a'));var licenseUtil=require(_0xa300('0x1b'));var db=require(_0xa300('0x1c'))['db'];function respondWithStatusCode(_0x4b1077,_0x12a222){_0x12a222=_0x12a222||0xcc;return function(_0x2aafee){if(_0x2aafee){return _0x4b1077['sendStatus'](_0x12a222);}return _0x4b1077[_0xa300('0x1d')](_0x12a222)['end']();};}function respondWithResult(_0x5e5df3,_0x3d540b){_0x3d540b=_0x3d540b||0xc8;return function(_0x333a3c){if(_0x333a3c){return _0x5e5df3['status'](_0x3d540b)['json'](_0x333a3c);}};}function respondWithFilteredResult(_0x13c432,_0x58d348){return function(_0xddf962){if(_0xddf962){var _0x44874b=typeof _0x58d348[_0xa300('0x1e')]===_0xa300('0x1f')&&typeof _0x58d348['limit']===_0xa300('0x1f');var _0x133faa=_0xddf962[_0xa300('0x20')];var _0x5b4bdc=_0x44874b?0x0:_0x58d348['offset'];var _0x48fc7b=_0x44874b?_0xddf962[_0xa300('0x20')]:_0x58d348[_0xa300('0x1e')]+_0x58d348[_0xa300('0x21')];var _0x5b91ec;if(_0x48fc7b>=_0x133faa){_0x48fc7b=_0x133faa;_0x5b91ec=0xc8;}else{_0x5b91ec=0xce;}_0x13c432[_0xa300('0x1d')](_0x5b91ec);return _0x13c432[_0xa300('0x22')](_0xa300('0x23'),_0x5b4bdc+'-'+_0x48fc7b+'/'+_0x133faa)[_0xa300('0x24')](_0xddf962);}return null;};}function patchUpdates(_0x4aff05){return function(_0x90b2f9){try{jsonpatch[_0xa300('0x25')](_0x90b2f9,_0x4aff05,!![]);}catch(_0x1d60b1){return BPromise['reject'](_0x1d60b1);}return _0x90b2f9['save']();};}function saveUpdates(_0x4b9c5e,_0x24b289){return function(_0x2b936d){if(_0x2b936d){return _0x2b936d[_0xa300('0x26')](_0x4b9c5e)['then'](function(_0x17d705){return _0x17d705;});}return null;};}function removeEntity(_0x18d7de,_0x3a04bd){return function(_0x2aca5d){if(_0x2aca5d){return _0x2aca5d[_0xa300('0x27')]()[_0xa300('0x28')](function(){_0x18d7de[_0xa300('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45368c,_0x29872c){return function(_0x4a5876){if(!_0x4a5876){_0x45368c[_0xa300('0x29')](0x194);}return _0x4a5876;};}function handleError(_0x17b51e,_0x1899ab){_0x1899ab=_0x1899ab||0x1f4;return function(_0xd52ac7){logger['error'](_0xd52ac7['stack']);if(_0xd52ac7[_0xa300('0x2a')]){delete _0xd52ac7['name'];}_0x17b51e['status'](_0x1899ab)[_0xa300('0x2b')](_0xd52ac7);};}exports[_0xa300('0x2c')]=function(_0x10f0c7,_0xe39e6b){var _0x5d9fa8={},_0x39a398={},_0x364d11={'count':0x0,'rows':[]};var _0x59970c=_[_0xa300('0x2d')](db[_0xa300('0x2e')][_0xa300('0x2f')],function(_0x3a5b5e){return{'name':_0x3a5b5e[_0xa300('0x30')],'type':_0x3a5b5e[_0xa300('0x31')][_0xa300('0x32')]};});_0x39a398['model']=_[_0xa300('0x33')](_['map'](_0x59970c,_0xa300('0x2a')),[_0xa300('0x2a')]);_0x39a398[_0xa300('0x34')]=_[_0xa300('0x35')](_0x10f0c7[_0xa300('0x34')]);_0x39a398[_0xa300('0x36')]=_['intersection'](_0x39a398[_0xa300('0x37')],_0x39a398[_0xa300('0x34')]);_0x5d9fa8[_0xa300('0x38')]=_[_0xa300('0x39')](_0x39a398['model'],qs[_0xa300('0x3a')](_0x10f0c7[_0xa300('0x34')]['fields']));_0x5d9fa8['attributes']=_0x5d9fa8['attributes'][_0xa300('0x3b')]?_0x5d9fa8[_0xa300('0x38')]:_0x39a398['model'];if(!_0x10f0c7['query']['hasOwnProperty'](_0xa300('0x3c'))){_0x5d9fa8[_0xa300('0x21')]=qs[_0xa300('0x21')](_0x10f0c7[_0xa300('0x34')]['limit']);_0x5d9fa8[_0xa300('0x1e')]=qs['offset'](_0x10f0c7[_0xa300('0x34')]['offset']);}_0x5d9fa8[_0xa300('0x3d')]=qs[_0xa300('0x3e')](_0x10f0c7[_0xa300('0x34')][_0xa300('0x3e')]);_0x5d9fa8[_0xa300('0x3f')]=qs['filters'](_[_0xa300('0x40')](_0x10f0c7[_0xa300('0x34')],_0x39a398[_0xa300('0x36')]),_0x59970c);if(_0x10f0c7[_0xa300('0x34')][_0xa300('0x41')]){_0x5d9fa8['where']=_[_0xa300('0x42')](_0x5d9fa8[_0xa300('0x3f')],{'$or':_[_0xa300('0x2d')](_0x59970c,function(_0x53cffd){if(_0x53cffd[_0xa300('0x31')]!==_0xa300('0x43')){var _0x40768f={};_0x40768f[_0x53cffd[_0xa300('0x2a')]]={'$like':'%'+_0x10f0c7[_0xa300('0x34')][_0xa300('0x41')]+'%'};return _0x40768f;}})});}_0x5d9fa8=_['merge']({},_0x5d9fa8,_0x10f0c7[_0xa300('0x44')]);var _0x514e2f={'where':_0x5d9fa8[_0xa300('0x3f')]};return db[_0xa300('0x2e')][_0xa300('0x20')](_0x514e2f)['then'](function(_0x3b05ed){_0x364d11['count']=_0x3b05ed;if(_0x10f0c7[_0xa300('0x34')][_0xa300('0x45')]){_0x5d9fa8[_0xa300('0x46')]=[{'all':!![]}];}return db[_0xa300('0x2e')][_0xa300('0x47')](_0x5d9fa8);})[_0xa300('0x28')](function(_0x4b77f5){_0x364d11[_0xa300('0x48')]=_0x4b77f5;return _0x364d11;})[_0xa300('0x28')](respondWithFilteredResult(_0xe39e6b,_0x5d9fa8))[_0xa300('0x49')](handleError(_0xe39e6b,null));};exports[_0xa300('0x4a')]=function(_0x1c1890,_0x8f3d88){var _0x1787a5={'raw':!![],'where':{'id':_0x1c1890[_0xa300('0x4b')]['id']}},_0x3b713a={};_0x3b713a['model']=_['keys'](db[_0xa300('0x2e')][_0xa300('0x2f')]);_0x3b713a[_0xa300('0x34')]=_[_0xa300('0x35')](_0x1c1890[_0xa300('0x34')]);_0x3b713a['filters']=_[_0xa300('0x39')](_0x3b713a[_0xa300('0x37')],_0x3b713a[_0xa300('0x34')]);_0x1787a5[_0xa300('0x38')]=_[_0xa300('0x39')](_0x3b713a[_0xa300('0x37')],qs['fields'](_0x1c1890[_0xa300('0x34')]['fields']));_0x1787a5[_0xa300('0x38')]=_0x1787a5[_0xa300('0x38')][_0xa300('0x3b')]?_0x1787a5[_0xa300('0x38')]:_0x3b713a['model'];if(_0x1c1890[_0xa300('0x34')][_0xa300('0x45')]){_0x1787a5[_0xa300('0x46')]=[{'all':!![]}];}_0x1787a5=_[_0xa300('0x42')]({},_0x1787a5,_0x1c1890[_0xa300('0x44')]);return db[_0xa300('0x2e')]['find'](_0x1787a5)[_0xa300('0x28')](handleEntityNotFound(_0x8f3d88,null))[_0xa300('0x28')](respondWithResult(_0x8f3d88,null))[_0xa300('0x49')](handleError(_0x8f3d88,null));};exports['create']=function(_0x33f4d1,_0x2ffb82){return db[_0xa300('0x2e')]['create'](_0x33f4d1[_0xa300('0x4c')],{})[_0xa300('0x28')](respondWithResult(_0x2ffb82,0xc9))['catch'](handleError(_0x2ffb82,null));};exports[_0xa300('0x26')]=function(_0x4dd5bd,_0x35747c){if(_0x4dd5bd[_0xa300('0x4c')]['id']){delete _0x4dd5bd[_0xa300('0x4c')]['id'];}return db[_0xa300('0x2e')][_0xa300('0x4d')]({'where':{'id':_0x4dd5bd[_0xa300('0x4b')]['id']}})[_0xa300('0x28')](handleEntityNotFound(_0x35747c,null))[_0xa300('0x28')](saveUpdates(_0x4dd5bd[_0xa300('0x4c')],null))['then'](respondWithResult(_0x35747c,null))[_0xa300('0x49')](handleError(_0x35747c,null));};exports['destroy']=function(_0x28c24e,_0x37c87c){return db[_0xa300('0x2e')]['find']({'where':{'id':_0x28c24e['params']['id']}})[_0xa300('0x28')](handleEntityNotFound(_0x37c87c,null))[_0xa300('0x28')](removeEntity(_0x37c87c,null))[_0xa300('0x49')](handleError(_0x37c87c,null));};exports[_0xa300('0x4e')]=function(_0x2238e4,_0x1a0aa4,_0x460aba){return db[_0xa300('0x2e')][_0xa300('0x4d')]({'where':{'id':_0x2238e4['params']['id']},'attributes':['id',_0xa300('0x4f'),'msg_id']})['then'](handleEntityNotFound(_0x1a0aa4,null))[_0xa300('0x28')](function(_0xc844f5){if(_0xc844f5){if(!_0xc844f5[_0xa300('0x4f')]){throw new db[(_0xa300('0x50'))][(_0xa300('0x51'))]('VoiceMailMessage\x20not\x20found');}var _0x52c5f2={'Content-Type':_0xa300('0x52'),'Content-Disposition':_0xa300('0x53')};if(_0xc844f5[_0xa300('0x54')]){_0x52c5f2['Content-Disposition']=_0xa300('0x55')+_0xc844f5[_0xa300('0x54')]+'.wav\x22';}_0x1a0aa4[_0xa300('0x22')](_0x52c5f2);return _0x1a0aa4[_0xa300('0x2b')](new Buffer(_0xc844f5[_0xa300('0x4f')]));}})[_0xa300('0x49')](handleError(_0x1a0aa4,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index ee778fb..9842421 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 _0x1f38=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','voice_voicemail_messages','dir'];(function(_0x2d794c,_0x2f4ddf){var _0x5cac42=function(_0x378d3f){while(--_0x378d3f){_0x2d794c['push'](_0x2d794c['shift']());}};_0x5cac42(++_0x2f4ddf);}(_0x1f38,0x134));var _0x81f3=function(_0x5377a1,_0x22e1e4){_0x5377a1=_0x5377a1-0x0;var _0x45ff6f=_0x1f38[_0x5377a1];return _0x45ff6f;};'use strict';var _=require(_0x81f3('0x0'));var util=require(_0x81f3('0x1'));var logger=require(_0x81f3('0x2'))(_0x81f3('0x3'));var moment=require(_0x81f3('0x4'));var BPromise=require(_0x81f3('0x5'));var rp=require(_0x81f3('0x6'));var fs=require('fs');var path=require(_0x81f3('0x7'));var rimraf=require(_0x81f3('0x8'));var config=require(_0x81f3('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0x81f3('0xa')]=function(_0x149440,_0x44d70e){return _0x149440[_0x81f3('0xb')]('VoiceMailMessage',attributes,{'tableName':_0x81f3('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x81f3('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd2ca=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x18d4cb,_0x3018da){var _0x542fee=function(_0x1fc54f){while(--_0x1fc54f){_0x18d4cb['push'](_0x18d4cb['shift']());}};_0x542fee(++_0x3018da);}(_0xd2ca,0x1d4));var _0xad2c=function(_0x3a2409,_0x25cb8d){_0x3a2409=_0x3a2409-0x0;var _0x90f378=_0xd2ca[_0x3a2409];return _0x90f378;};'use strict';var _=require(_0xad2c('0x0'));var util=require(_0xad2c('0x1'));var logger=require(_0xad2c('0x2'))(_0xad2c('0x3'));var moment=require(_0xad2c('0x4'));var BPromise=require(_0xad2c('0x5'));var rp=require(_0xad2c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad2c('0x7'));var config=require(_0xad2c('0x8'));var attributes=require(_0xad2c('0x9'));module[_0xad2c('0xa')]=function(_0x2d622e,_0x1118b9){return _0x2d622e[_0xad2c('0xb')](_0xad2c('0xc'),attributes,{'tableName':_0xad2c('0xd'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xad2c('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 cfd7f06..59d3f8e 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 _0xb619=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x28d434,_0x2d2610){var _0x1109c6=function(_0x6f8c30){while(--_0x6f8c30){_0x28d434['push'](_0x28d434['shift']());}};_0x1109c6(++_0x2d2610);}(_0xb619,0x187));var _0x9b61=function(_0x4ed62f,_0xe7153a){_0x4ed62f=_0x4ed62f-0x0;var _0x5e4bca=_0xb619[_0x4ed62f];return _0x5e4bca;};'use strict';var _=require(_0x9b61('0x0'));var util=require(_0x9b61('0x1'));var moment=require(_0x9b61('0x2'));var BPromise=require(_0x9b61('0x3'));var rs=require(_0x9b61('0x4'));var fs=require('fs');var Redis=require(_0x9b61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b61('0x6'));var logger=require('../../config/logger')(_0x9b61('0x7'));var config=require(_0x9b61('0x8'));var jayson=require(_0x9b61('0x9'));var client=jayson[_0x9b61('0xa')][_0x9b61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x181b54,_0x4b5ee2,_0x463e58){return new BPromise(function(_0x2cf722,_0x60dfa){return client[_0x9b61('0xc')](_0x181b54,_0x463e58)[_0x9b61('0xd')](function(_0x35dc79){logger[_0x9b61('0xe')](_0x9b61('0xf'),_0x4b5ee2,'request\x20sent');logger[_0x9b61('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x4b5ee2,_0x9b61('0x11'),JSON['stringify'](_0x35dc79));if(_0x35dc79[_0x9b61('0x12')]){if(_0x35dc79['error'][_0x9b61('0x13')]===0x1f4){logger[_0x9b61('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x4b5ee2,_0x35dc79[_0x9b61('0x12')][_0x9b61('0x14')]);return _0x60dfa(_0x35dc79[_0x9b61('0x12')][_0x9b61('0x14')]);}logger[_0x9b61('0x12')](_0x9b61('0xf'),_0x4b5ee2,_0x35dc79['error'][_0x9b61('0x14')]);return _0x2cf722(_0x35dc79[_0x9b61('0x12')][_0x9b61('0x14')]);}else{logger[_0x9b61('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x4b5ee2,_0x9b61('0x11'));_0x2cf722(_0x35dc79[_0x9b61('0x15')]['message']);}})['catch'](function(_0x4de30f){logger[_0x9b61('0x12')](_0x9b61('0xf'),_0x4b5ee2,_0x4de30f);_0x60dfa(_0x4de30f);});});} \ No newline at end of file +var _0x7e65=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b5925,_0x16c2ad){var _0x50bf96=function(_0x41ade4){while(--_0x41ade4){_0x5b5925['push'](_0x5b5925['shift']());}};_0x50bf96(++_0x16c2ad);}(_0x7e65,0x83));var _0x57e6=function(_0x436f18,_0x40b20b){_0x436f18=_0x436f18-0x0;var _0x4177ee=_0x7e65[_0x436f18];return _0x4177ee;};'use strict';var _=require(_0x57e6('0x0'));var util=require(_0x57e6('0x1'));var moment=require(_0x57e6('0x2'));var BPromise=require(_0x57e6('0x3'));var rs=require(_0x57e6('0x4'));var fs=require('fs');var Redis=require(_0x57e6('0x5'));var db=require(_0x57e6('0x6'))['db'];var utils=require(_0x57e6('0x7'));var logger=require('../../config/logger')(_0x57e6('0x8'));var config=require(_0x57e6('0x9'));var jayson=require(_0x57e6('0xa'));var client=jayson[_0x57e6('0xb')][_0x57e6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17e806,_0x5d1005,_0x3b61a3){return new BPromise(function(_0x1d085f,_0xcb0d01){return client['request'](_0x17e806,_0x3b61a3)[_0x57e6('0xd')](function(_0x8f5a4b){logger[_0x57e6('0xe')](_0x57e6('0xf'),_0x5d1005,_0x57e6('0x10'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5d1005,_0x57e6('0x10'),JSON[_0x57e6('0x11')](_0x8f5a4b));if(_0x8f5a4b['error']){if(_0x8f5a4b[_0x57e6('0x12')][_0x57e6('0x13')]===0x1f4){logger['error'](_0x57e6('0xf'),_0x5d1005,_0x8f5a4b[_0x57e6('0x12')][_0x57e6('0x14')]);return _0xcb0d01(_0x8f5a4b['error']['message']);}logger[_0x57e6('0x12')](_0x57e6('0xf'),_0x5d1005,_0x8f5a4b[_0x57e6('0x12')][_0x57e6('0x14')]);return _0x1d085f(_0x8f5a4b[_0x57e6('0x12')][_0x57e6('0x14')]);}else{logger[_0x57e6('0xe')](_0x57e6('0xf'),_0x5d1005,'request\x20sent');_0x1d085f(_0x8f5a4b[_0x57e6('0x15')][_0x57e6('0x14')]);}})[_0x57e6('0x16')](function(_0x1cb22d){logger[_0x57e6('0x12')](_0x57e6('0xf'),_0x5d1005,_0x1cb22d);_0xcb0d01(_0x1cb22d);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 1e2e6dc..9371864 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 _0x09a6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','getSounds','post','/:id/sounds','addSound','put','update','delete','destroy','/:id/sounds/:id2','multer','path'];(function(_0x518eaa,_0x466eda){var _0x175feb=function(_0x3f6f07){while(--_0x3f6f07){_0x518eaa['push'](_0x518eaa['shift']());}};_0x175feb(++_0x466eda);}(_0x09a6,0x14e));var _0x609a=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0x09a6[_0x3fb5eb];return _0x481291;};'use strict';var multer=require(_0x609a('0x0'));var util=require('util');var path=require(_0x609a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x609a('0x2')]();var fs_extra=require(_0x609a('0x3'));var auth=require(_0x609a('0x4'));var interaction=require(_0x609a('0x5'));var config=require(_0x609a('0x6'));var controller=require(_0x609a('0x7'));router[_0x609a('0x8')]('/',auth['isAuthenticated'](),controller[_0x609a('0x9')]);router[_0x609a('0x8')](_0x609a('0xa'),auth[_0x609a('0xb')](),controller['show']);router[_0x609a('0x8')]('/:id/sounds',auth[_0x609a('0xb')](),controller[_0x609a('0xc')]);router[_0x609a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x609a('0xd')](_0x609a('0xe'),auth[_0x609a('0xb')](),controller[_0x609a('0xf')]);router[_0x609a('0x10')](_0x609a('0xa'),auth[_0x609a('0xb')](),controller[_0x609a('0x11')]);router[_0x609a('0x12')](_0x609a('0xa'),auth[_0x609a('0xb')](),controller[_0x609a('0x13')]);router[_0x609a('0x12')](_0x609a('0x14'),auth['isAuthenticated'](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0xd88a=['update','delete','/:id','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','getSounds','post','create','addSound','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd88a,0x11b));var _0xad88=function(_0x317d61,_0x5e6335){_0x317d61=_0x317d61-0x0;var _0x3abc20=_0xd88a[_0x317d61];return _0x3abc20;};'use strict';var multer=require(_0xad88('0x0'));var util=require(_0xad88('0x1'));var path=require(_0xad88('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xad88('0x3')]();var fs_extra=require(_0xad88('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xad88('0x5'));var config=require(_0xad88('0x6'));var controller=require(_0xad88('0x7'));router[_0xad88('0x8')]('/',auth[_0xad88('0x9')](),controller[_0xad88('0xa')]);router[_0xad88('0x8')]('/:id',auth[_0xad88('0x9')](),controller[_0xad88('0xb')]);router[_0xad88('0x8')]('/:id/sounds',auth[_0xad88('0x9')](),controller[_0xad88('0xc')]);router[_0xad88('0xd')]('/',auth['isAuthenticated'](),controller[_0xad88('0xe')]);router[_0xad88('0xd')]('/:id/sounds',auth[_0xad88('0x9')](),controller[_0xad88('0xf')]);router[_0xad88('0x10')]('/:id',auth[_0xad88('0x9')](),controller[_0xad88('0x11')]);router[_0xad88('0x12')](_0xad88('0x13'),auth['isAuthenticated'](),controller['destroy']);router[_0xad88('0x12')]('/:id/sounds/:id2',auth[_0xad88('0x9')](),controller['removeSound']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 8efa0f7..9da87cb 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 _0x0397=['exports','STRING','name','custom','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x1932f3,_0xebd2ac){var _0x4ec74e=function(_0x1d0add){while(--_0x1d0add){_0x1932f3['push'](_0x1932f3['shift']());}};_0x4ec74e(++_0xebd2ac);}(_0x0397,0x1f4));var _0x7039=function(_0x2911e2,_0x39c3d9){_0x2911e2=_0x2911e2-0x0;var _0x111b30=_0x0397[_0x2911e2];return _0x111b30;};'use strict';var Sequelize=require('sequelize');module[_0x7039('0x0')]={'name':{'type':Sequelize[_0x7039('0x1')],'allowNull':![],'unique':_0x7039('0x2')},'mode':{'type':Sequelize['ENUM'](_0x7039('0x3'),'files','mp3nb',_0x7039('0x4'),_0x7039('0x5'),_0x7039('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x7039('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x7039('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x7039('0x1')],'allowNull':!![],'defaultValue':_0x7039('0x7')},'format':{'type':Sequelize[_0x7039('0x1')],'allowNull':!![]},'stamp':{'type':_0x7039('0x8')},'defaultEntry':{'type':Sequelize[_0x7039('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf364=['STRING','name','ENUM','mp3nb','quietmp3nb','quietmp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x2f303d,_0x5c22ce){var _0x2a84a6=function(_0x1af594){while(--_0x1af594){_0x2f303d['push'](_0x2f303d['shift']());}};_0x2a84a6(++_0x5c22ce);}(_0xf364,0x78));var _0x4f36=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xf364[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x4f36('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f36('0x1')],'allowNull':![],'unique':_0x4f36('0x2')},'mode':{'type':Sequelize[_0x4f36('0x3')]('custom','files',_0x4f36('0x4'),_0x4f36('0x5'),_0x4f36('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x4f36('0x7')},'directory':{'type':Sequelize[_0x4f36('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x4f36('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4f36('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4f36('0x1')],'allowNull':!![],'defaultValue':_0x4f36('0x8')},'format':{'type':Sequelize[_0x4f36('0x1')],'allowNull':!![]},'stamp':{'type':_0x4f36('0x9')},'defaultEntry':{'type':Sequelize[_0x4f36('0xa')],'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 77c20be..ce54de2 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 _0xa2a9=['readdirSync','forEach','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','converted_format','symlinkSync','removeSound','id2','unlinkSync','getSounds','nolimit','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceMusicOnHold','includeAll','findAll','catch','show','params','include','find','update','body','create','sequelize','mode','files','directory','join','server/files/moh','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction'];(function(_0x13c779,_0x5a82a8){var _0xcaa0e0=function(_0x37fef3){while(--_0x37fef3){_0x13c779['push'](_0x13c779['shift']());}};_0xcaa0e0(++_0x5a82a8);}(_0xa2a9,0x166));var _0x9a2a=function(_0x2d448d,_0x2cdd53){_0x2d448d=_0x2d448d-0x0;var _0x2c02b0=_0xa2a9[_0x2d448d];return _0x2c02b0;};'use strict';var emlformat=require(_0x9a2a('0x0'));var rimraf=require(_0x9a2a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a2a('0x2'));var rp=require('request-promise');var moment=require(_0x9a2a('0x3'));var BPromise=require(_0x9a2a('0x4'));var Mustache=require(_0x9a2a('0x5'));var util=require('util');var path=require(_0x9a2a('0x6'));var sox=require(_0x9a2a('0x7'));var csv=require(_0x9a2a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a2a('0x9'));var _=require(_0x9a2a('0xa'));var squel=require(_0x9a2a('0xb'));var crypto=require(_0x9a2a('0xc'));var jsforce=require(_0x9a2a('0xd'));var deskjs=require(_0x9a2a('0xe'));var toCsv=require(_0x9a2a('0x8'));var querystring=require('querystring');var Papa=require(_0x9a2a('0xf'));var Redis=require('ioredis');var authService=require(_0x9a2a('0x10'));var qs=require(_0x9a2a('0x11'));var as=require(_0x9a2a('0x12'));var hardwareService=require(_0x9a2a('0x13'));var logger=require(_0x9a2a('0x14'))(_0x9a2a('0x15'));var utils=require(_0x9a2a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a2a('0x17'))['db'];function respondWithStatusCode(_0x5b3c5e,_0x53cd2e){_0x53cd2e=_0x53cd2e||0xcc;return function(_0x3c1f82){if(_0x3c1f82){return _0x5b3c5e[_0x9a2a('0x18')](_0x53cd2e);}return _0x5b3c5e['status'](_0x53cd2e)[_0x9a2a('0x19')]();};}function respondWithResult(_0xd97532,_0x581096){_0x581096=_0x581096||0xc8;return function(_0x52ba10){if(_0x52ba10){return _0xd97532[_0x9a2a('0x1a')](_0x581096)[_0x9a2a('0x1b')](_0x52ba10);}};}function respondWithFilteredResult(_0x19a202,_0x4959fa){return function(_0x568704){if(_0x568704){var _0x25f1bb=typeof _0x4959fa[_0x9a2a('0x1c')]===_0x9a2a('0x1d')&&typeof _0x4959fa[_0x9a2a('0x1e')]==='undefined';var _0x168f7e=_0x568704[_0x9a2a('0x1f')];var _0x7b1ae4=_0x25f1bb?0x0:_0x4959fa['offset'];var _0x5f4a4b=_0x25f1bb?_0x568704[_0x9a2a('0x1f')]:_0x4959fa[_0x9a2a('0x1c')]+_0x4959fa['limit'];var _0xd7bf09;if(_0x5f4a4b>=_0x168f7e){_0x5f4a4b=_0x168f7e;_0xd7bf09=0xc8;}else{_0xd7bf09=0xce;}_0x19a202[_0x9a2a('0x1a')](_0xd7bf09);return _0x19a202[_0x9a2a('0x20')](_0x9a2a('0x21'),_0x7b1ae4+'-'+_0x5f4a4b+'/'+_0x168f7e)[_0x9a2a('0x1b')](_0x568704);}return null;};}function patchUpdates(_0x1fcf67){return function(_0x4d44ba){try{jsonpatch[_0x9a2a('0x22')](_0x4d44ba,_0x1fcf67,!![]);}catch(_0xcb6e19){return BPromise['reject'](_0xcb6e19);}return _0x4d44ba[_0x9a2a('0x23')]();};}function saveUpdates(_0x5d7ddc,_0x22187a){return function(_0x17ce38){if(_0x17ce38){return _0x17ce38['update'](_0x5d7ddc)[_0x9a2a('0x24')](function(_0x3d3c76){return _0x3d3c76;});}return null;};}function removeEntity(_0x1fa38b,_0x1d6fe8){return function(_0x3889fc){if(_0x3889fc){return _0x3889fc[_0x9a2a('0x25')]()[_0x9a2a('0x24')](function(){var _0x3c4f30=_0x3889fc[_0x9a2a('0x26')]({'plain':!![]});var _0x4f89f3=_0x9a2a('0x27');return db[_0x9a2a('0x28')][_0x9a2a('0x25')]({'where':{'type':_0x4f89f3,'resourceId':_0x3c4f30['id']}})[_0x9a2a('0x24')](function(){return _0x3889fc;});})[_0x9a2a('0x24')](function(){_0x1fa38b[_0x9a2a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25440c,_0x2ebf9a){return function(_0x2801bb){if(!_0x2801bb){_0x25440c['sendStatus'](0x194);}return _0x2801bb;};}function handleError(_0xbc9152,_0x3c24e0){_0x3c24e0=_0x3c24e0||0x1f4;return function(_0x698e25){logger[_0x9a2a('0x29')](_0x698e25[_0x9a2a('0x2a')]);if(_0x698e25[_0x9a2a('0x2b')]){delete _0x698e25[_0x9a2a('0x2b')];}_0xbc9152['status'](_0x3c24e0)[_0x9a2a('0x2c')](_0x698e25);};}exports['index']=function(_0x53ee17,_0x5eb76b){var _0x4a1bea={},_0x4d7ddf={},_0x4da45e={'count':0x0,'rows':[]};var _0x18aadc=_[_0x9a2a('0x2d')](db['VoiceMusicOnHold'][_0x9a2a('0x2e')],function(_0x1c2d82){return{'name':_0x1c2d82[_0x9a2a('0x2f')],'type':_0x1c2d82[_0x9a2a('0x30')][_0x9a2a('0x31')]};});_0x4d7ddf['model']=_[_0x9a2a('0x2d')](_0x18aadc,_0x9a2a('0x2b'));_0x4d7ddf[_0x9a2a('0x32')]=_[_0x9a2a('0x33')](_0x53ee17[_0x9a2a('0x32')]);_0x4d7ddf[_0x9a2a('0x34')]=_[_0x9a2a('0x35')](_0x4d7ddf[_0x9a2a('0x36')],_0x4d7ddf[_0x9a2a('0x32')]);_0x4a1bea[_0x9a2a('0x37')]=_['intersection'](_0x4d7ddf['model'],qs[_0x9a2a('0x38')](_0x53ee17[_0x9a2a('0x32')][_0x9a2a('0x38')]));_0x4a1bea[_0x9a2a('0x37')]=_0x4a1bea[_0x9a2a('0x37')][_0x9a2a('0x39')]?_0x4a1bea[_0x9a2a('0x37')]:_0x4d7ddf['model'];if(!_0x53ee17[_0x9a2a('0x32')][_0x9a2a('0x3a')]('nolimit')){_0x4a1bea[_0x9a2a('0x1e')]=qs[_0x9a2a('0x1e')](_0x53ee17[_0x9a2a('0x32')][_0x9a2a('0x1e')]);_0x4a1bea['offset']=qs[_0x9a2a('0x1c')](_0x53ee17['query'][_0x9a2a('0x1c')]);}_0x4a1bea[_0x9a2a('0x3b')]=qs[_0x9a2a('0x3c')](_0x53ee17[_0x9a2a('0x32')]['sort']);delete _0x53ee17[_0x9a2a('0x32')]['sort'];_0x4a1bea['where']=qs[_0x9a2a('0x34')](_[_0x9a2a('0x3d')](_0x53ee17['query'],_0x4d7ddf[_0x9a2a('0x34')]),_0x18aadc);if(_0x53ee17[_0x9a2a('0x32')][_0x9a2a('0x3e')]){_0x4a1bea[_0x9a2a('0x3f')]=_['merge'](_0x4a1bea['where'],{'$or':_[_0x9a2a('0x2d')](_0x18aadc,function(_0x1e88c9){if(_0x1e88c9[_0x9a2a('0x30')]!==_0x9a2a('0x40')){var _0x17faf4={};_0x17faf4[_0x1e88c9[_0x9a2a('0x2b')]]={'$like':'%'+_0x53ee17[_0x9a2a('0x32')][_0x9a2a('0x3e')]+'%'};return _0x17faf4;}})});}_0x4a1bea=_[_0x9a2a('0x41')]({},_0x4a1bea,_0x53ee17[_0x9a2a('0x42')]);var _0x5be114={'where':_0x4a1bea[_0x9a2a('0x3f')]};return db[_0x9a2a('0x43')][_0x9a2a('0x1f')](_0x5be114)[_0x9a2a('0x24')](function(_0x456bef){_0x4da45e[_0x9a2a('0x1f')]=_0x456bef;if(_0x53ee17[_0x9a2a('0x32')][_0x9a2a('0x44')]){_0x4a1bea['include']=[{'all':!![]}];}return db[_0x9a2a('0x43')][_0x9a2a('0x45')](_0x4a1bea);})[_0x9a2a('0x24')](function(_0x50ce8b){_0x4da45e['rows']=_0x50ce8b;return _0x4da45e;})['then'](respondWithFilteredResult(_0x5eb76b,_0x4a1bea))[_0x9a2a('0x46')](handleError(_0x5eb76b,null));};exports[_0x9a2a('0x47')]=function(_0xa0952f,_0x114151){var _0xb91da8={'raw':![],'where':{'id':_0xa0952f[_0x9a2a('0x48')]['id']}},_0x577cc0={};_0x577cc0['model']=_[_0x9a2a('0x33')](db[_0x9a2a('0x43')][_0x9a2a('0x2e')]);_0x577cc0['query']=_[_0x9a2a('0x33')](_0xa0952f[_0x9a2a('0x32')]);_0x577cc0[_0x9a2a('0x34')]=_[_0x9a2a('0x35')](_0x577cc0[_0x9a2a('0x36')],_0x577cc0['query']);_0xb91da8[_0x9a2a('0x37')]=_['intersection'](_0x577cc0[_0x9a2a('0x36')],qs['fields'](_0xa0952f[_0x9a2a('0x32')][_0x9a2a('0x38')]));_0xb91da8[_0x9a2a('0x37')]=_0xb91da8[_0x9a2a('0x37')][_0x9a2a('0x39')]?_0xb91da8[_0x9a2a('0x37')]:_0x577cc0[_0x9a2a('0x36')];if(_0xa0952f[_0x9a2a('0x32')][_0x9a2a('0x44')]){_0xb91da8[_0x9a2a('0x49')]=[{'all':!![]}];}_0xb91da8=_[_0x9a2a('0x41')]({},_0xb91da8,_0xa0952f['options']);return db[_0x9a2a('0x43')][_0x9a2a('0x4a')](_0xb91da8)[_0x9a2a('0x24')](handleEntityNotFound(_0x114151,null))['then'](respondWithResult(_0x114151,null))[_0x9a2a('0x46')](handleError(_0x114151,null));};exports[_0x9a2a('0x4b')]=function(_0x5276b6,_0x126f90){if(_0x5276b6[_0x9a2a('0x4c')]['id']){delete _0x5276b6[_0x9a2a('0x4c')]['id'];}return db[_0x9a2a('0x43')][_0x9a2a('0x4a')]({'where':{'id':_0x5276b6['params']['id']}})['then'](handleEntityNotFound(_0x126f90,null))[_0x9a2a('0x24')](saveUpdates(_0x5276b6['body'],null))['then'](respondWithResult(_0x126f90,null))['catch'](handleError(_0x126f90,null));};exports[_0x9a2a('0x4d')]=function(_0x2fa03c,_0x55c08e,_0x34ccce){return db[_0x9a2a('0x4e')]['transaction'](function(_0x4c02be){if(_0x2fa03c[_0x9a2a('0x4c')][_0x9a2a('0x4f')]===_0x9a2a('0x50')){_0x2fa03c[_0x9a2a('0x4c')][_0x9a2a('0x51')]=path[_0x9a2a('0x52')](config['root'],_0x9a2a('0x53'),_0x2fa03c[_0x9a2a('0x4c')][_0x9a2a('0x2b')]);}return db[_0x9a2a('0x43')][_0x9a2a('0x4d')](_0x2fa03c['body'],{'transaction':_0x4c02be})[_0x9a2a('0x24')](function(_0x146d6c){if(_0x2fa03c[_0x9a2a('0x4c')][_0x9a2a('0x4f')]===_0x9a2a('0x50')){fs[_0x9a2a('0x54')](_0x146d6c[_0x9a2a('0x51')],parseInt('0777',0x8));}var _0x5bb86c=_0x2fa03c['user'][_0x9a2a('0x26')]({'plain':!![]});if(!_0x5bb86c)throw new Error(_0x9a2a('0x55'));if(_0x5bb86c['role']===_0x9a2a('0x56')){var _0x23a7b2=_0x146d6c[_0x9a2a('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x9a2a('0x4a')]({'where':{'name':_0x9a2a('0x27'),'userProfileId':_0x5bb86c[_0x9a2a('0x57')]},'raw':!![]})[_0x9a2a('0x24')](function(_0x158fd3){if(_0x158fd3&&_0x158fd3['autoAssociation']===0x0){return db[_0x9a2a('0x28')]['create']({'name':_0x23a7b2[_0x9a2a('0x2b')],'resourceId':_0x23a7b2['id'],'type':_0x158fd3['name'],'sectionId':_0x158fd3['id']},{})[_0x9a2a('0x24')](function(){return _0x146d6c;});}else{return _0x146d6c;}})[_0x9a2a('0x46')](function(_0x55a014){logger['error'](_0x9a2a('0x58'),_0x55a014);});}return _0x146d6c;});})[_0x9a2a('0x24')](respondWithResult(_0x55c08e,0xc9))[_0x9a2a('0x46')](handleError(_0x55c08e,null));};exports[_0x9a2a('0x25')]=function(_0x186e7e,_0x4915f1,_0x2da773){var _0x1c3476;return db['VoiceMusicOnHold'][_0x9a2a('0x4a')]({'where':{'id':_0x186e7e[_0x9a2a('0x48')]['id']}})[_0x9a2a('0x24')](function(_0x109731){if(_0x109731){return db['sequelize'][_0x9a2a('0x59')](function(_0x473298){return _0x109731[_0x9a2a('0x25')]({'transaction':_0x473298,'raw':!![]})[_0x9a2a('0x24')](function(_0x136dd6){if(_0x136dd6[_0x9a2a('0x51')]){fs[_0x9a2a('0x5a')](_0x136dd6[_0x9a2a('0x51')])[_0x9a2a('0x5b')](function(_0x2a570f){fs['unlinkSync'](path[_0x9a2a('0x52')](_0x136dd6[_0x9a2a('0x51')],_0x2a570f));});fs['rmdirSync'](_0x136dd6[_0x9a2a('0x51')]);}return _0x136dd6;});})[_0x9a2a('0x46')](function(_0x42f2eb){throw new db[(_0x9a2a('0x5c'))][(_0x9a2a('0x5d'))](_0x42f2eb[_0x9a2a('0x5e')]);});}})['then'](handleEntityNotFound(_0x4915f1,null))['then'](removeEntity(_0x4915f1,null))[_0x9a2a('0x46')](handleError(_0x4915f1,null));};exports[_0x9a2a('0x5f')]=function(_0x449ff3,_0x120f1a,_0xd98b92){return db[_0x9a2a('0x4e')]['transaction'](function(_0x2de33b){var _0x195a7e;return db[_0x9a2a('0x43')]['find']({'where':{'id':_0x449ff3['params']['id']}})[_0x9a2a('0x24')](function(_0x2fd49f){if(_0x2fd49f){_0x195a7e=_0x2fd49f;return _0x2fd49f[_0x9a2a('0x5f')](_0x449ff3[_0x9a2a('0x4c')]['id'],{'transaction':_0x2de33b});}})[_0x9a2a('0x24')](function(_0x32a2e3){if(_0x32a2e3){return db[_0x9a2a('0x60')][_0x9a2a('0x61')]({'where':{'id':_0x449ff3[_0x9a2a('0x4c')]['id']},'attributes':['id',_0x9a2a('0x2b'),_0x9a2a('0x62'),'converted_format',_0x9a2a('0x63')],'raw':!![]});}})[_0x9a2a('0x24')](function(_0x42c36f){if(_0x42c36f){var _0x2e0309=path[_0x9a2a('0x52')](config[_0x9a2a('0x64')],_0x9a2a('0x65'),util[_0x9a2a('0x66')](_0x9a2a('0x67'),path[_0x9a2a('0x68')](_0x42c36f[_0x9a2a('0x62')],path['extname'](_0x42c36f[_0x9a2a('0x62')])),_0x42c36f[_0x9a2a('0x69')]));var _0x9f06f=path[_0x9a2a('0x52')](config[_0x9a2a('0x64')],_0x9a2a('0x53'),_0x195a7e['name'],util[_0x9a2a('0x66')]('%s.%s',_0x42c36f['name'],_0x42c36f[_0x9a2a('0x69')]));fs[_0x9a2a('0x6a')](_0x2e0309,_0x9f06f);return _0x42c36f;}})['catch'](function(_0x31a49f){throw new db[(_0x9a2a('0x5c'))][(_0x9a2a('0x5d'))](_0x31a49f[_0x9a2a('0x5e')]);});})[_0x9a2a('0x24')](handleEntityNotFound(_0x120f1a,null))['then'](respondWithResult(_0x120f1a,0xc9))[_0x9a2a('0x46')](handleError(_0x120f1a,null));};exports[_0x9a2a('0x6b')]=function(_0x412434,_0x1fe052,_0x1e12bb){return db[_0x9a2a('0x4e')][_0x9a2a('0x59')](function(_0x168a3d){var _0x122ac3;return db[_0x9a2a('0x43')][_0x9a2a('0x61')]({'where':{'id':_0x412434['params']['id']}})[_0x9a2a('0x24')](handleEntityNotFound(_0x1fe052,null))['then'](function(_0xef3c3){if(_0xef3c3){_0x122ac3=_0xef3c3;return _0xef3c3[_0x9a2a('0x6b')](_0x412434['params'][_0x9a2a('0x6c')]);}})['then'](function(_0xa88fa8){if(_0xa88fa8){return db[_0x9a2a('0x60')][_0x9a2a('0x61')]({'where':{'id':_0x412434[_0x9a2a('0x48')][_0x9a2a('0x6c')]},'attributes':['id',_0x9a2a('0x2b'),_0x9a2a('0x62'),_0x9a2a('0x69'),_0x9a2a('0x63')],'raw':!![]});}})['then'](function(_0x4740ed){if(_0x4740ed){fs[_0x9a2a('0x6d')](path[_0x9a2a('0x52')](_0x122ac3['directory'],util[_0x9a2a('0x66')](_0x9a2a('0x67'),_0x4740ed[_0x9a2a('0x2b')],_0x4740ed[_0x9a2a('0x69')])));return _0x4740ed;}})[_0x9a2a('0x46')](function(_0x1f5b28){throw new db[(_0x9a2a('0x5c'))][(_0x9a2a('0x5d'))](_0x1f5b28[_0x9a2a('0x5e')]);});})['then'](handleEntityNotFound(_0x1fe052,null))[_0x9a2a('0x24')](respondWithStatusCode(_0x1fe052,0xcc))[_0x9a2a('0x46')](handleError(_0x1fe052,null));};exports[_0x9a2a('0x6e')]=function(_0x509148,_0x179cf4,_0x2f58ba){var _0xfee35a={};var _0x399728={};var _0x161da2;var _0x4fc639;return db[_0x9a2a('0x43')][_0x9a2a('0x61')]({'where':{'id':_0x509148[_0x9a2a('0x48')]['id']}})['then'](handleEntityNotFound(_0x179cf4,null))[_0x9a2a('0x24')](function(_0x2e4af4){if(_0x2e4af4){_0x161da2=_0x2e4af4;_0x399728[_0x9a2a('0x36')]=_[_0x9a2a('0x33')](db[_0x9a2a('0x60')][_0x9a2a('0x2e')]);_0x399728[_0x9a2a('0x32')]=_[_0x9a2a('0x33')](_0x509148[_0x9a2a('0x32')]);_0x399728['filters']=_[_0x9a2a('0x35')](_0x399728[_0x9a2a('0x36')],_0x399728[_0x9a2a('0x32')]);_0xfee35a[_0x9a2a('0x37')]=_[_0x9a2a('0x35')](_0x399728[_0x9a2a('0x36')],qs[_0x9a2a('0x38')](_0x509148[_0x9a2a('0x32')][_0x9a2a('0x38')]));_0xfee35a['attributes']=_0xfee35a[_0x9a2a('0x37')][_0x9a2a('0x39')]?_0xfee35a[_0x9a2a('0x37')]:_0x399728[_0x9a2a('0x36')];_0xfee35a[_0x9a2a('0x3b')]=qs['sort'](_0x509148[_0x9a2a('0x32')][_0x9a2a('0x3c')]);_0xfee35a[_0x9a2a('0x3f')]=qs[_0x9a2a('0x34')](_[_0x9a2a('0x3d')](_0x509148[_0x9a2a('0x32')],_0x399728[_0x9a2a('0x34')]));if(_0x509148[_0x9a2a('0x32')]['filter']){_0xfee35a[_0x9a2a('0x3f')]=_['merge'](_0xfee35a[_0x9a2a('0x3f')],{'$or':_['map'](_0xfee35a['attributes'],function(_0x53b6b5){var _0x179537={};_0x179537[_0x53b6b5]={'$like':'%'+_0x509148[_0x9a2a('0x32')]['filter']+'%'};return _0x179537;})});}_0xfee35a=_[_0x9a2a('0x41')]({},_0xfee35a,_0x509148[_0x9a2a('0x42')]);return _0x161da2[_0x9a2a('0x6e')](_0xfee35a);}})['then'](function(_0x2e9ba6){if(_0x2e9ba6){_0x4fc639=_0x2e9ba6[_0x9a2a('0x39')];if(!_0x509148['query'][_0x9a2a('0x3a')](_0x9a2a('0x6f'))){_0xfee35a[_0x9a2a('0x1e')]=qs[_0x9a2a('0x1e')](_0x509148[_0x9a2a('0x32')]['limit']);_0xfee35a[_0x9a2a('0x1c')]=qs[_0x9a2a('0x1c')](_0x509148[_0x9a2a('0x32')]['offset']);}return _0x161da2[_0x9a2a('0x6e')](_0xfee35a);}})[_0x9a2a('0x24')](function(_0x5d890c){if(_0x5d890c){return _0x5d890c?{'count':_0x4fc639,'rows':_0x5d890c}:null;}})[_0x9a2a('0x24')](respondWithResult(_0x179cf4,null))['catch'](handleError(_0x179cf4,null));}; \ No newline at end of file +var _0x6482=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','includeAll','include','body','find','create','sequelize','files','directory','join','server/files/moh','mode','mkdirSync','0777','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','save_name','extname','symlinkSync','removeSound','id2','unlinkSync','getSounds','eml-format','zip-dir','request-promise'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x6482,0x1c5));var _0x2648=function(_0x128cae,_0x398cf9){_0x128cae=_0x128cae-0x0;var _0x177631=_0x6482[_0x128cae];return _0x177631;};'use strict';var emlformat=require(_0x2648('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2648('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2648('0x2'));var moment=require(_0x2648('0x3'));var BPromise=require(_0x2648('0x4'));var Mustache=require(_0x2648('0x5'));var util=require(_0x2648('0x6'));var path=require(_0x2648('0x7'));var sox=require(_0x2648('0x8'));var csv=require(_0x2648('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2648('0xa'));var _=require(_0x2648('0xb'));var squel=require(_0x2648('0xc'));var crypto=require('crypto');var jsforce=require(_0x2648('0xd'));var deskjs=require(_0x2648('0xe'));var toCsv=require(_0x2648('0x9'));var querystring=require(_0x2648('0xf'));var Papa=require(_0x2648('0x10'));var Redis=require(_0x2648('0x11'));var authService=require(_0x2648('0x12'));var qs=require(_0x2648('0x13'));var as=require(_0x2648('0x14'));var hardwareService=require(_0x2648('0x15'));var logger=require(_0x2648('0x16'))(_0x2648('0x17'));var utils=require(_0x2648('0x18'));var config=require(_0x2648('0x19'));var licenseUtil=require(_0x2648('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40eb89,_0x9e57b4){_0x9e57b4=_0x9e57b4||0xcc;return function(_0x5a122e){if(_0x5a122e){return _0x40eb89['sendStatus'](_0x9e57b4);}return _0x40eb89[_0x2648('0x1b')](_0x9e57b4)[_0x2648('0x1c')]();};}function respondWithResult(_0x5cc047,_0xfc35cf){_0xfc35cf=_0xfc35cf||0xc8;return function(_0x2141f8){if(_0x2141f8){return _0x5cc047[_0x2648('0x1b')](_0xfc35cf)[_0x2648('0x1d')](_0x2141f8);}};}function respondWithFilteredResult(_0x555bb7,_0x135d8b){return function(_0x4b1f6a){if(_0x4b1f6a){var _0x14ae3b=typeof _0x135d8b[_0x2648('0x1e')]==='undefined'&&typeof _0x135d8b[_0x2648('0x1f')]===_0x2648('0x20');var _0x44c2ec=_0x4b1f6a[_0x2648('0x21')];var _0x5cd957=_0x14ae3b?0x0:_0x135d8b[_0x2648('0x1e')];var _0x4e4411=_0x14ae3b?_0x4b1f6a[_0x2648('0x21')]:_0x135d8b[_0x2648('0x1e')]+_0x135d8b[_0x2648('0x1f')];var _0x2a9fed;if(_0x4e4411>=_0x44c2ec){_0x4e4411=_0x44c2ec;_0x2a9fed=0xc8;}else{_0x2a9fed=0xce;}_0x555bb7['status'](_0x2a9fed);return _0x555bb7['set'](_0x2648('0x22'),_0x5cd957+'-'+_0x4e4411+'/'+_0x44c2ec)[_0x2648('0x1d')](_0x4b1f6a);}return null;};}function patchUpdates(_0x2f4e81){return function(_0xb4d2bd){try{jsonpatch[_0x2648('0x23')](_0xb4d2bd,_0x2f4e81,!![]);}catch(_0x4a463d){return BPromise['reject'](_0x4a463d);}return _0xb4d2bd[_0x2648('0x24')]();};}function saveUpdates(_0x5d1499,_0x4a0aea){return function(_0xbdd55d){if(_0xbdd55d){return _0xbdd55d[_0x2648('0x25')](_0x5d1499)[_0x2648('0x26')](function(_0x47c683){return _0x47c683;});}return null;};}function removeEntity(_0x1b7811,_0x488086){return function(_0xf0de21){if(_0xf0de21){return _0xf0de21[_0x2648('0x27')]()[_0x2648('0x26')](function(){var _0x231e95=_0xf0de21[_0x2648('0x28')]({'plain':!![]});var _0x526ac3=_0x2648('0x29');return db[_0x2648('0x2a')][_0x2648('0x27')]({'where':{'type':_0x526ac3,'resourceId':_0x231e95['id']}})['then'](function(){return _0xf0de21;});})[_0x2648('0x26')](function(){_0x1b7811['status'](0xcc)[_0x2648('0x1c')]();});}};}function handleEntityNotFound(_0x2363d2,_0x445ad9){return function(_0x3bce11){if(!_0x3bce11){_0x2363d2[_0x2648('0x2b')](0x194);}return _0x3bce11;};}function handleError(_0x2afeef,_0x2dfc77){_0x2dfc77=_0x2dfc77||0x1f4;return function(_0x3eec81){logger[_0x2648('0x2c')](_0x3eec81[_0x2648('0x2d')]);if(_0x3eec81[_0x2648('0x2e')]){delete _0x3eec81[_0x2648('0x2e')];}_0x2afeef[_0x2648('0x1b')](_0x2dfc77)['send'](_0x3eec81);};}exports[_0x2648('0x2f')]=function(_0x2e5466,_0x165815){var _0x326d4d={},_0x790a90={},_0x5ada29={'count':0x0,'rows':[]};var _0x4420f4=_['map'](db[_0x2648('0x30')][_0x2648('0x31')],function(_0xbd27b2){return{'name':_0xbd27b2[_0x2648('0x32')],'type':_0xbd27b2['type']['key']};});_0x790a90[_0x2648('0x33')]=_[_0x2648('0x34')](_0x4420f4,'name');_0x790a90[_0x2648('0x35')]=_[_0x2648('0x36')](_0x2e5466['query']);_0x790a90[_0x2648('0x37')]=_[_0x2648('0x38')](_0x790a90['model'],_0x790a90[_0x2648('0x35')]);_0x326d4d['attributes']=_[_0x2648('0x38')](_0x790a90[_0x2648('0x33')],qs[_0x2648('0x39')](_0x2e5466[_0x2648('0x35')][_0x2648('0x39')]));_0x326d4d[_0x2648('0x3a')]=_0x326d4d[_0x2648('0x3a')][_0x2648('0x3b')]?_0x326d4d[_0x2648('0x3a')]:_0x790a90[_0x2648('0x33')];if(!_0x2e5466['query'][_0x2648('0x3c')](_0x2648('0x3d'))){_0x326d4d[_0x2648('0x1f')]=qs[_0x2648('0x1f')](_0x2e5466[_0x2648('0x35')][_0x2648('0x1f')]);_0x326d4d[_0x2648('0x1e')]=qs['offset'](_0x2e5466[_0x2648('0x35')][_0x2648('0x1e')]);}_0x326d4d[_0x2648('0x3e')]=qs[_0x2648('0x3f')](_0x2e5466[_0x2648('0x35')]['sort']);delete _0x2e5466[_0x2648('0x35')][_0x2648('0x3f')];_0x326d4d[_0x2648('0x40')]=qs[_0x2648('0x37')](_[_0x2648('0x41')](_0x2e5466[_0x2648('0x35')],_0x790a90[_0x2648('0x37')]),_0x4420f4);if(_0x2e5466['query'][_0x2648('0x42')]){_0x326d4d['where']=_[_0x2648('0x43')](_0x326d4d[_0x2648('0x40')],{'$or':_[_0x2648('0x34')](_0x4420f4,function(_0x2cd636){if(_0x2cd636[_0x2648('0x44')]!==_0x2648('0x45')){var _0x1a5a82={};_0x1a5a82[_0x2cd636[_0x2648('0x2e')]]={'$like':'%'+_0x2e5466['query'][_0x2648('0x42')]+'%'};return _0x1a5a82;}})});}_0x326d4d=_[_0x2648('0x43')]({},_0x326d4d,_0x2e5466[_0x2648('0x46')]);var _0x10179b={'where':_0x326d4d[_0x2648('0x40')]};return db[_0x2648('0x30')][_0x2648('0x21')](_0x10179b)[_0x2648('0x26')](function(_0x517e7c){_0x5ada29['count']=_0x517e7c;if(_0x2e5466[_0x2648('0x35')]['includeAll']){_0x326d4d['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x2648('0x47')](_0x326d4d);})['then'](function(_0x46d617){_0x5ada29['rows']=_0x46d617;return _0x5ada29;})[_0x2648('0x26')](respondWithFilteredResult(_0x165815,_0x326d4d))[_0x2648('0x48')](handleError(_0x165815,null));};exports[_0x2648('0x49')]=function(_0x23375d,_0x49bf5a){var _0xf20d6a={'raw':![],'where':{'id':_0x23375d[_0x2648('0x4a')]['id']}},_0x311a28={};_0x311a28['model']=_[_0x2648('0x36')](db[_0x2648('0x30')][_0x2648('0x31')]);_0x311a28[_0x2648('0x35')]=_['keys'](_0x23375d[_0x2648('0x35')]);_0x311a28[_0x2648('0x37')]=_[_0x2648('0x38')](_0x311a28[_0x2648('0x33')],_0x311a28[_0x2648('0x35')]);_0xf20d6a['attributes']=_[_0x2648('0x38')](_0x311a28[_0x2648('0x33')],qs[_0x2648('0x39')](_0x23375d['query'][_0x2648('0x39')]));_0xf20d6a['attributes']=_0xf20d6a['attributes'][_0x2648('0x3b')]?_0xf20d6a[_0x2648('0x3a')]:_0x311a28[_0x2648('0x33')];if(_0x23375d['query'][_0x2648('0x4b')]){_0xf20d6a[_0x2648('0x4c')]=[{'all':!![]}];}_0xf20d6a=_['merge']({},_0xf20d6a,_0x23375d['options']);return db['VoiceMusicOnHold']['find'](_0xf20d6a)[_0x2648('0x26')](handleEntityNotFound(_0x49bf5a,null))[_0x2648('0x26')](respondWithResult(_0x49bf5a,null))[_0x2648('0x48')](handleError(_0x49bf5a,null));};exports['update']=function(_0x566be0,_0x36657e){if(_0x566be0[_0x2648('0x4d')]['id']){delete _0x566be0[_0x2648('0x4d')]['id'];}return db['VoiceMusicOnHold'][_0x2648('0x4e')]({'where':{'id':_0x566be0[_0x2648('0x4a')]['id']}})[_0x2648('0x26')](handleEntityNotFound(_0x36657e,null))[_0x2648('0x26')](saveUpdates(_0x566be0[_0x2648('0x4d')],null))[_0x2648('0x26')](respondWithResult(_0x36657e,null))[_0x2648('0x48')](handleError(_0x36657e,null));};exports[_0x2648('0x4f')]=function(_0x322134,_0x324dd2,_0x43655c){return db[_0x2648('0x50')]['transaction'](function(_0x388180){if(_0x322134[_0x2648('0x4d')]['mode']===_0x2648('0x51')){_0x322134[_0x2648('0x4d')][_0x2648('0x52')]=path[_0x2648('0x53')](config['root'],_0x2648('0x54'),_0x322134['body'][_0x2648('0x2e')]);}return db[_0x2648('0x30')][_0x2648('0x4f')](_0x322134[_0x2648('0x4d')],{'transaction':_0x388180})[_0x2648('0x26')](function(_0xc806e1){if(_0x322134['body'][_0x2648('0x55')]===_0x2648('0x51')){fs[_0x2648('0x56')](_0xc806e1[_0x2648('0x52')],parseInt(_0x2648('0x57'),0x8));}var _0x2a9040=_0x322134[_0x2648('0x58')]['get']({'plain':!![]});if(!_0x2a9040)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a9040[_0x2648('0x59')]===_0x2648('0x58')){var _0x2cf5ef=_0xc806e1['get']({'plain':!![]});return db['UserProfileSection'][_0x2648('0x4e')]({'where':{'name':_0x2648('0x29'),'userProfileId':_0x2a9040['userProfileId']},'raw':!![]})[_0x2648('0x26')](function(_0x3746c3){if(_0x3746c3&&_0x3746c3[_0x2648('0x5a')]===0x0){return db[_0x2648('0x2a')][_0x2648('0x4f')]({'name':_0x2cf5ef['name'],'resourceId':_0x2cf5ef['id'],'type':_0x3746c3[_0x2648('0x2e')],'sectionId':_0x3746c3['id']},{})['then'](function(){return _0xc806e1;});}else{return _0xc806e1;}})[_0x2648('0x48')](function(_0xc4ec0e){logger[_0x2648('0x2c')](_0x2648('0x5b'),_0xc4ec0e);});}return _0xc806e1;});})[_0x2648('0x26')](respondWithResult(_0x324dd2,0xc9))[_0x2648('0x48')](handleError(_0x324dd2,null));};exports[_0x2648('0x27')]=function(_0x4a3c17,_0x598c22,_0x4d2875){var _0x2992f7;return db['VoiceMusicOnHold'][_0x2648('0x4e')]({'where':{'id':_0x4a3c17[_0x2648('0x4a')]['id']}})[_0x2648('0x26')](function(_0x1c9d3c){if(_0x1c9d3c){return db[_0x2648('0x50')][_0x2648('0x5c')](function(_0x295314){return _0x1c9d3c['destroy']({'transaction':_0x295314,'raw':!![]})[_0x2648('0x26')](function(_0x34e850){if(_0x34e850[_0x2648('0x52')]){fs[_0x2648('0x5d')](_0x34e850[_0x2648('0x52')])['forEach'](function(_0x1b0330){fs['unlinkSync'](path['join'](_0x34e850['directory'],_0x1b0330));});fs[_0x2648('0x5e')](_0x34e850[_0x2648('0x52')]);}return _0x34e850;});})['catch'](function(_0x273887){throw new db[(_0x2648('0x5f'))][(_0x2648('0x60'))](_0x273887[_0x2648('0x61')]);});}})[_0x2648('0x26')](handleEntityNotFound(_0x598c22,null))[_0x2648('0x26')](removeEntity(_0x598c22,null))[_0x2648('0x48')](handleError(_0x598c22,null));};exports[_0x2648('0x62')]=function(_0x34d115,_0x5486c9,_0x2176d4){return db[_0x2648('0x50')]['transaction'](function(_0xad9e99){var _0x44d565;return db['VoiceMusicOnHold'][_0x2648('0x4e')]({'where':{'id':_0x34d115['params']['id']}})[_0x2648('0x26')](function(_0x329267){if(_0x329267){_0x44d565=_0x329267;return _0x329267['addSound'](_0x34d115[_0x2648('0x4d')]['id'],{'transaction':_0xad9e99});}})[_0x2648('0x26')](function(_0x6f0e20){if(_0x6f0e20){return db[_0x2648('0x63')][_0x2648('0x64')]({'where':{'id':_0x34d115['body']['id']},'attributes':['id',_0x2648('0x2e'),'save_name',_0x2648('0x65'),_0x2648('0x66')],'raw':!![]});}})['then'](function(_0x26599d){if(_0x26599d){var _0x1f3134=path[_0x2648('0x53')](config[_0x2648('0x67')],_0x2648('0x68'),util[_0x2648('0x69')](_0x2648('0x6a'),path['basename'](_0x26599d[_0x2648('0x6b')],path[_0x2648('0x6c')](_0x26599d['save_name'])),_0x26599d['converted_format']));var _0x5b4f5b=path[_0x2648('0x53')](config[_0x2648('0x67')],'server/files/moh',_0x44d565[_0x2648('0x2e')],util[_0x2648('0x69')](_0x2648('0x6a'),_0x26599d[_0x2648('0x2e')],_0x26599d[_0x2648('0x65')]));fs[_0x2648('0x6d')](_0x1f3134,_0x5b4f5b);return _0x26599d;}})[_0x2648('0x48')](function(_0x8c9bc1){throw new db['Sequelize'][(_0x2648('0x60'))](_0x8c9bc1[_0x2648('0x61')]);});})[_0x2648('0x26')](handleEntityNotFound(_0x5486c9,null))[_0x2648('0x26')](respondWithResult(_0x5486c9,0xc9))['catch'](handleError(_0x5486c9,null));};exports['removeSound']=function(_0x5dd3f8,_0x175038,_0xdb2571){return db[_0x2648('0x50')][_0x2648('0x5c')](function(_0x560a4c){var _0x97cd75;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5dd3f8[_0x2648('0x4a')]['id']}})[_0x2648('0x26')](handleEntityNotFound(_0x175038,null))['then'](function(_0x3e224d){if(_0x3e224d){_0x97cd75=_0x3e224d;return _0x3e224d[_0x2648('0x6e')](_0x5dd3f8[_0x2648('0x4a')][_0x2648('0x6f')]);}})['then'](function(_0x329ee7){if(_0x329ee7){return db[_0x2648('0x63')]['findOne']({'where':{'id':_0x5dd3f8[_0x2648('0x4a')][_0x2648('0x6f')]},'attributes':['id',_0x2648('0x2e'),_0x2648('0x6b'),'converted_format',_0x2648('0x66')],'raw':!![]});}})[_0x2648('0x26')](function(_0x1073fd){if(_0x1073fd){fs[_0x2648('0x70')](path[_0x2648('0x53')](_0x97cd75['directory'],util[_0x2648('0x69')](_0x2648('0x6a'),_0x1073fd['name'],_0x1073fd[_0x2648('0x65')])));return _0x1073fd;}})[_0x2648('0x48')](function(_0x33e1a8){throw new db[(_0x2648('0x5f'))][(_0x2648('0x60'))](_0x33e1a8[_0x2648('0x61')]);});})['then'](handleEntityNotFound(_0x175038,null))[_0x2648('0x26')](respondWithStatusCode(_0x175038,0xcc))[_0x2648('0x48')](handleError(_0x175038,null));};exports[_0x2648('0x71')]=function(_0x4a7db5,_0x465125,_0x4e115a){var _0xc32cf9={};var _0x5e7fce={};var _0x2a5d58;var _0x18df05;return db[_0x2648('0x30')]['findOne']({'where':{'id':_0x4a7db5[_0x2648('0x4a')]['id']}})[_0x2648('0x26')](handleEntityNotFound(_0x465125,null))[_0x2648('0x26')](function(_0x17c391){if(_0x17c391){_0x2a5d58=_0x17c391;_0x5e7fce['model']=_['keys'](db[_0x2648('0x63')]['rawAttributes']);_0x5e7fce['query']=_[_0x2648('0x36')](_0x4a7db5['query']);_0x5e7fce[_0x2648('0x37')]=_[_0x2648('0x38')](_0x5e7fce[_0x2648('0x33')],_0x5e7fce[_0x2648('0x35')]);_0xc32cf9['attributes']=_[_0x2648('0x38')](_0x5e7fce['model'],qs[_0x2648('0x39')](_0x4a7db5[_0x2648('0x35')][_0x2648('0x39')]));_0xc32cf9[_0x2648('0x3a')]=_0xc32cf9['attributes']['length']?_0xc32cf9[_0x2648('0x3a')]:_0x5e7fce[_0x2648('0x33')];_0xc32cf9[_0x2648('0x3e')]=qs['sort'](_0x4a7db5[_0x2648('0x35')][_0x2648('0x3f')]);_0xc32cf9[_0x2648('0x40')]=qs[_0x2648('0x37')](_['pick'](_0x4a7db5['query'],_0x5e7fce['filters']));if(_0x4a7db5[_0x2648('0x35')][_0x2648('0x42')]){_0xc32cf9['where']=_['merge'](_0xc32cf9['where'],{'$or':_['map'](_0xc32cf9[_0x2648('0x3a')],function(_0x183193){var _0x2ba3b7={};_0x2ba3b7[_0x183193]={'$like':'%'+_0x4a7db5[_0x2648('0x35')][_0x2648('0x42')]+'%'};return _0x2ba3b7;})});}_0xc32cf9=_[_0x2648('0x43')]({},_0xc32cf9,_0x4a7db5[_0x2648('0x46')]);return _0x2a5d58[_0x2648('0x71')](_0xc32cf9);}})[_0x2648('0x26')](function(_0x505802){if(_0x505802){_0x18df05=_0x505802[_0x2648('0x3b')];if(!_0x4a7db5[_0x2648('0x35')][_0x2648('0x3c')](_0x2648('0x3d'))){_0xc32cf9[_0x2648('0x1f')]=qs['limit'](_0x4a7db5['query'][_0x2648('0x1f')]);_0xc32cf9[_0x2648('0x1e')]=qs[_0x2648('0x1e')](_0x4a7db5['query'][_0x2648('0x1e')]);}return _0x2a5d58[_0x2648('0x71')](_0xc32cf9);}})['then'](function(_0x222a48){if(_0x222a48){return _0x222a48?{'count':_0x18df05,'rows':_0x222a48}:null;}})['then'](respondWithResult(_0x465125,null))[_0x2648('0x48')](handleError(_0x465125,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1201bed..98de0d6 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 _0x869a=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','bluebird','path','rimraf'];(function(_0x126f47,_0x2199e9){var _0x49508a=function(_0x20ba36){while(--_0x20ba36){_0x126f47['push'](_0x126f47['shift']());}};_0x49508a(++_0x2199e9);}(_0x869a,0x1db));var _0xa869=function(_0x26d5dd,_0x37473){_0x26d5dd=_0x26d5dd-0x0;var _0x4ebf4f=_0x869a[_0x26d5dd];return _0x4ebf4f;};'use strict';var _=require(_0xa869('0x0'));var util=require(_0xa869('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa869('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa869('0x3'));var rimraf=require(_0xa869('0x4'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x276bb7,_0x3daef4){return _0x276bb7[_0xa869('0x5')](_0xa869('0x6'),attributes,{'tableName':_0xa869('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03a7=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api','moment','bluebird'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x03a7,0x121));var _0x703a=function(_0x51ffa0,_0xd23c02){_0x51ffa0=_0x51ffa0-0x0;var _0x459e5d=_0x03a7[_0x51ffa0];return _0x459e5d;};'use strict';var _=require(_0x703a('0x0'));var util=require(_0x703a('0x1'));var logger=require('../../config/logger')(_0x703a('0x2'));var moment=require(_0x703a('0x3'));var BPromise=require(_0x703a('0x4'));var rp=require(_0x703a('0x5'));var fs=require('fs');var path=require(_0x703a('0x6'));var rimraf=require(_0x703a('0x7'));var config=require(_0x703a('0x8'));var attributes=require(_0x703a('0x9'));module[_0x703a('0xa')]=function(_0x16cdbf,_0x3b6eb8){return _0x16cdbf[_0x703a('0xb')](_0x703a('0xc'),attributes,{'tableName':_0x703a('0xd'),'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 e84b2d9..9565b39 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(_0x21a926,_0x512f75){var _0x3ab20e=function(_0x55332f){while(--_0x55332f){_0x21a926['push'](_0x21a926['shift']());}};_0x3ab20e(++_0x512f75);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0xcb91[_0x33bcdb];return _0x18a9bf;};'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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x1d7a18,_0x2bb312){var _0x495f4a=function(_0x5ccfe5){while(--_0x5ccfe5){_0x1d7a18['push'](_0x1d7a18['shift']());}};_0x495f4a(++_0x2bb312);}(_0xedd9,0xfc));var _0x9edd=function(_0x106748,_0x27ebee){_0x106748=_0x106748-0x0;var _0x359346=_0xedd9[_0x106748];return _0x359346;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index b28d5a7..a731f4f 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 _0x3663=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated','describe','show','getAgents','/:id/teams','getTeams','post','/:id/users','addAgents','put','update','delete','/:id','removeAgents','exports','multer','util','path','express','Router'];(function(_0x3cc045,_0x468681){var _0x3998f=function(_0x3790f3){while(--_0x3790f3){_0x3cc045['push'](_0x3cc045['shift']());}};_0x3998f(++_0x468681);}(_0x3663,0x1cf));var _0x3366=function(_0x4d5377,_0x2f824e){_0x4d5377=_0x4d5377-0x0;var _0x31ac8b=_0x3663[_0x4d5377];return _0x31ac8b;};'use strict';var multer=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var path=require(_0x3366('0x2'));var timeout=require('connect-timeout');var express=require(_0x3366('0x3'));var router=express[_0x3366('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3366('0x5'));var interaction=require(_0x3366('0x6'));var config=require(_0x3366('0x7'));var controller=require(_0x3366('0x8'));router[_0x3366('0x9')]('/',auth['isAuthenticated'](),controller[_0x3366('0xa')]);router[_0x3366('0x9')]('/describe',auth[_0x3366('0xb')](),controller[_0x3366('0xc')]);router[_0x3366('0x9')]('/:id',auth[_0x3366('0xb')](),controller[_0x3366('0xd')]);router[_0x3366('0x9')]('/:id/users',auth[_0x3366('0xb')](),controller[_0x3366('0xe')]);router[_0x3366('0x9')](_0x3366('0xf'),auth[_0x3366('0xb')](),controller[_0x3366('0x10')]);router[_0x3366('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3366('0x11')](_0x3366('0x12'),auth[_0x3366('0xb')](),controller[_0x3366('0x13')]);router[_0x3366('0x11')](_0x3366('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0x3366('0x14')]('/:id',auth[_0x3366('0xb')](),controller[_0x3366('0x15')]);router[_0x3366('0x16')](_0x3366('0x17'),auth[_0x3366('0xb')](),controller['destroy']);router[_0x3366('0x16')](_0x3366('0x12'),auth[_0x3366('0xb')](),controller[_0x3366('0x18')]);router[_0x3366('0x16')](_0x3366('0xf'),auth['isAuthenticated'](),controller['removeTeams']);module[_0x3366('0x19')]=router; \ No newline at end of file +var _0xb701=['/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','destroy','delete','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xb701,0x144));var _0x1b70=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb701[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0x1b70('0x0'));var path=require('path');var timeout=require(_0x1b70('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b70('0x2'));var auth=require(_0x1b70('0x3'));var interaction=require(_0x1b70('0x4'));var config=require(_0x1b70('0x5'));var controller=require(_0x1b70('0x6'));router[_0x1b70('0x7')]('/',auth[_0x1b70('0x8')](),controller[_0x1b70('0x9')]);router[_0x1b70('0x7')](_0x1b70('0xa'),auth['isAuthenticated'](),controller[_0x1b70('0xb')]);router[_0x1b70('0x7')](_0x1b70('0xc'),auth[_0x1b70('0x8')](),controller[_0x1b70('0xd')]);router[_0x1b70('0x7')](_0x1b70('0xe'),auth['isAuthenticated'](),controller[_0x1b70('0xf')]);router[_0x1b70('0x7')](_0x1b70('0x10'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x11')]);router[_0x1b70('0x12')]('/',auth[_0x1b70('0x8')](),controller[_0x1b70('0x13')]);router[_0x1b70('0x12')](_0x1b70('0xe'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x14')]);router[_0x1b70('0x12')]('/:id/teams',auth[_0x1b70('0x8')](),controller[_0x1b70('0x15')]);router[_0x1b70('0x16')](_0x1b70('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1b70('0xc'),auth[_0x1b70('0x8')](),controller[_0x1b70('0x17')]);router[_0x1b70('0x18')](_0x1b70('0xe'),auth[_0x1b70('0x8')](),controller['removeAgents']);router[_0x1b70('0x18')](_0x1b70('0x10'),auth[_0x1b70('0x8')](),controller['removeTeams']);module[_0x1b70('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d924000..2e8cef3 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 _0xd5d4=['system-','getDataValue','STRING','INTEGER','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5d4,0xc2));var _0x4d5d=function(_0x44be9a,_0x5ce1a6){_0x44be9a=_0x44be9a-0x0;var _0x3dbb78=_0xd5d4[_0x44be9a];return _0x3dbb78;};'use strict';var Sequelize=require('sequelize');module[_0x4d5d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xcd8d58){return _0x4d5d('0x1')+this[_0x4d5d('0x2')]('name')+'-';}},'description':{'type':Sequelize[_0x4d5d('0x3')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x4d5d('0x4')]}}; \ No newline at end of file +var _0x2e79=['name','sequelize','exports','STRING','VIRTUAL','system-','getDataValue'];(function(_0x321518,_0x363ba6){var _0x47f043=function(_0x50b800){while(--_0x50b800){_0x321518['push'](_0x321518['shift']());}};_0x47f043(++_0x363ba6);}(_0x2e79,0x78));var _0x92e7=function(_0x34d3f8,_0x8a2283){_0x34d3f8=_0x34d3f8-0x0;var _0x3e9532=_0x2e79[_0x34d3f8];return _0x3e9532;};'use strict';var Sequelize=require(_0x92e7('0x0'));module[_0x92e7('0x1')]={'name':{'type':Sequelize[_0x92e7('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x92e7('0x3')],'get':function(_0x5e2ba2){return _0x92e7('0x4')+this[_0x92e7('0x5')](_0x92e7('0x6'))+'-';}},'description':{'type':Sequelize[_0x92e7('0x2')]},'callerIdAll':{'type':Sequelize[_0x92e7('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 b5b58a7..e8410b2 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 _0x93e9=['VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','${EXTEN:','length','charAt','body','system-','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','options','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','compact','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','catch','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','appdata','prefix','NoOp'];(function(_0x5cc4d0,_0x2de3f1){var _0x5555c2=function(_0x46fd61){while(--_0x46fd61){_0x5cc4d0['push'](_0x5cc4d0['shift']());}};_0x5555c2(++_0x2de3f1);}(_0x93e9,0xcc));var _0x993e=function(_0x11f6ce,_0x381e81){_0x11f6ce=_0x11f6ce-0x0;var _0x354883=_0x93e9[_0x11f6ce];return _0x354883;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];config['redis']=_['defaults'](config[_0x993e('0x19')],{'host':_0x993e('0x1a'),'port':0x18eb});var socket=require(_0x993e('0x1b'))(new Redis(config[_0x993e('0x19')]));require(_0x993e('0x1c'))[_0x993e('0x1d')](socket);function respondWithStatusCode(_0x34ddda,_0x20f32a){_0x20f32a=_0x20f32a||0xcc;return function(_0x2a184b){if(_0x2a184b){return _0x34ddda[_0x993e('0x1e')](_0x20f32a);}return _0x34ddda[_0x993e('0x1f')](_0x20f32a)[_0x993e('0x20')]();};}function respondWithResult(_0x3df0e7,_0x125322){_0x125322=_0x125322||0xc8;return function(_0x1f267f){if(_0x1f267f){return _0x3df0e7[_0x993e('0x1f')](_0x125322)[_0x993e('0x21')](_0x1f267f);}};}function respondWithFilteredResult(_0x526e06,_0x22f7cc){return function(_0x1acd21){if(_0x1acd21){var _0x3cc2b9=typeof _0x22f7cc[_0x993e('0x22')]===_0x993e('0x23')&&typeof _0x22f7cc[_0x993e('0x24')]==='undefined';var _0x11cd41=_0x1acd21[_0x993e('0x25')];var _0x1eaf57=_0x3cc2b9?0x0:_0x22f7cc[_0x993e('0x22')];var _0x130a8a=_0x3cc2b9?_0x1acd21[_0x993e('0x25')]:_0x22f7cc[_0x993e('0x22')]+_0x22f7cc[_0x993e('0x24')];var _0x4bbe9c;if(_0x130a8a>=_0x11cd41){_0x130a8a=_0x11cd41;_0x4bbe9c=0xc8;}else{_0x4bbe9c=0xce;}_0x526e06[_0x993e('0x1f')](_0x4bbe9c);return _0x526e06['set'](_0x993e('0x26'),_0x1eaf57+'-'+_0x130a8a+'/'+_0x11cd41)[_0x993e('0x21')](_0x1acd21);}return null;};}function patchUpdates(_0x32b09e){return function(_0x5ba2a1){try{jsonpatch[_0x993e('0x27')](_0x5ba2a1,_0x32b09e,!![]);}catch(_0x13db4e){return BPromise[_0x993e('0x28')](_0x13db4e);}return _0x5ba2a1[_0x993e('0x29')]();};}function saveUpdates(_0x3b45ef,_0x328d22){return function(_0xa1c83e){if(_0xa1c83e){return _0xa1c83e[_0x993e('0x2a')](_0x3b45ef)[_0x993e('0x2b')](function(_0x18f6ac){return _0x18f6ac;});}return null;};}function removeEntity(_0x3fe099,_0x3603fa){return function(_0x4fe471){if(_0x4fe471){return _0x4fe471[_0x993e('0x2c')]()[_0x993e('0x2b')](function(){var _0x52b727=_0x4fe471[_0x993e('0x2d')]({'plain':!![]});var _0x4f5cc1=_0x993e('0x2e');return db[_0x993e('0x2f')][_0x993e('0x2c')]({'where':{'type':_0x4f5cc1,'resourceId':_0x52b727['id']}})[_0x993e('0x2b')](function(){return _0x4fe471;});})['then'](function(){_0x3fe099['status'](0xcc)[_0x993e('0x20')]();});}};}function handleEntityNotFound(_0x466d63,_0x4a4f00){return function(_0x223af0){if(!_0x223af0){_0x466d63[_0x993e('0x1e')](0x194);}return _0x223af0;};}function handleError(_0x248354,_0x4c5ee3){_0x4c5ee3=_0x4c5ee3||0x1f4;return function(_0x2495b7){logger[_0x993e('0x30')](_0x2495b7[_0x993e('0x31')]);if(_0x2495b7[_0x993e('0x32')]){delete _0x2495b7[_0x993e('0x32')];}_0x248354['status'](_0x4c5ee3)[_0x993e('0x33')](_0x2495b7);};}exports['index']=function(_0x782298,_0x5ba163){var _0x1da357={},_0x567ed4={},_0x3b9c3c={'count':0x0,'rows':[]};var _0x2ce5d5=_[_0x993e('0x34')](db[_0x993e('0x35')][_0x993e('0x36')],function(_0x360e2d){return{'name':_0x360e2d['fieldName'],'type':_0x360e2d[_0x993e('0x37')]['key']};});_0x567ed4['model']=_[_0x993e('0x34')](_0x2ce5d5,'name');_0x567ed4[_0x993e('0x38')]=_[_0x993e('0x39')](_0x782298[_0x993e('0x38')]);_0x567ed4[_0x993e('0x3a')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],_0x567ed4[_0x993e('0x38')]);_0x1da357[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x782298[_0x993e('0x38')][_0x993e('0x3e')]));_0x1da357[_0x993e('0x3d')]=_0x1da357[_0x993e('0x3d')]['length']?_0x1da357[_0x993e('0x3d')]:_0x567ed4[_0x993e('0x3c')];if(!_0x782298[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1da357[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x782298[_0x993e('0x38')][_0x993e('0x24')]);_0x1da357['offset']=qs[_0x993e('0x22')](_0x782298['query'][_0x993e('0x22')]);}_0x1da357[_0x993e('0x41')]=qs[_0x993e('0x42')](_0x782298[_0x993e('0x38')][_0x993e('0x42')]);_0x1da357[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x782298['query'],_0x567ed4[_0x993e('0x3a')]),_0x2ce5d5);if(_0x782298['query'][_0x993e('0x45')]){_0x1da357['where']=_[_0x993e('0x46')](_0x1da357[_0x993e('0x43')],{'$or':_[_0x993e('0x34')](_0x2ce5d5,function(_0x1f1327){if(_0x1f1327[_0x993e('0x37')]!==_0x993e('0x47')){var _0xb728cf={};_0xb728cf[_0x1f1327[_0x993e('0x32')]]={'$like':'%'+_0x782298['query'][_0x993e('0x45')]+'%'};return _0xb728cf;}})});}_0x1da357=_['merge']({},_0x1da357,_0x782298['options']);var _0x1a2712={'where':_0x1da357[_0x993e('0x43')]};return db[_0x993e('0x35')]['count'](_0x1a2712)[_0x993e('0x2b')](function(_0x40719d){_0x3b9c3c[_0x993e('0x25')]=_0x40719d;if(_0x782298['query']['includeAll']){_0x1da357['include']=[{'all':!![]}];}return db[_0x993e('0x35')][_0x993e('0x48')](_0x1da357);})[_0x993e('0x2b')](function(_0x539c9d){_0x3b9c3c[_0x993e('0x49')]=_0x539c9d;return _0x3b9c3c;})[_0x993e('0x2b')](respondWithFilteredResult(_0x5ba163,_0x1da357))['catch'](handleError(_0x5ba163,null));};exports[_0x993e('0x4a')]=function(_0x5f7563,_0x5074a6){var _0x258795={'raw':![],'where':{'id':_0x5f7563[_0x993e('0x4b')]['id']}},_0x576ea={};_0x576ea['model']=_['keys'](db['VoicePrefix'][_0x993e('0x36')]);_0x576ea[_0x993e('0x38')]=_[_0x993e('0x39')](_0x5f7563[_0x993e('0x38')]);_0x576ea['filters']=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],_0x576ea[_0x993e('0x38')]);_0x258795[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],qs['fields'](_0x5f7563['query'][_0x993e('0x3e')]));_0x258795[_0x993e('0x3d')]=_0x258795['attributes']['length']?_0x258795[_0x993e('0x3d')]:_0x576ea[_0x993e('0x3c')];if(_0x5f7563[_0x993e('0x38')][_0x993e('0x4c')]){_0x258795[_0x993e('0x4d')]=[{'all':!![]}];}_0x258795=_[_0x993e('0x46')]({},_0x258795,_0x5f7563['options']);return db[_0x993e('0x35')]['find'](_0x258795)[_0x993e('0x2b')](handleEntityNotFound(_0x5074a6,null))[_0x993e('0x2b')](respondWithResult(_0x5074a6,null))[_0x993e('0x4e')](handleError(_0x5074a6,null));};exports[_0x993e('0x2c')]=function(_0x2cba37,_0x276b99){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x2cba37['params']['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x276b99,null))[_0x993e('0x2b')](removeEntity(_0x276b99,null))[_0x993e('0x4e')](handleError(_0x276b99,null));};exports['describe']=function(_0x355912,_0x53c1e9){return db[_0x993e('0x35')][_0x993e('0x50')]()['then'](respondWithResult(_0x53c1e9,null))[_0x993e('0x4e')](handleError(_0x53c1e9,null));};exports[_0x993e('0x51')]=function(_0x579c43,_0x3809ef){var _0x207e27;return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x2e368e){return db['VoicePrefix']['create'](_0x579c43['body'],{'transaction':_0x2e368e})[_0x993e('0x2b')](function(_0x29f8a5){_0x207e27=_0x29f8a5[_0x993e('0x2d')]({'plain':!![]});return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x207e27[_0x993e('0x55')]},'raw':!![]})['then'](function(_0x3a897d){return createVoicePrefixExtensions(_0x207e27,_0x3a897d,_0x2e368e);});});})[_0x993e('0x2b')](function(){var _0x15c8ed=_0x579c43['user'][_0x993e('0x2d')]({'plain':!![]});if(!_0x15c8ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c8ed['role']===_0x993e('0x56')){var _0x37d7b1=_0x207e27;return db['UserProfileSection'][_0x993e('0x4f')]({'where':{'name':'VoicePrefixes','userProfileId':_0x15c8ed[_0x993e('0x57')]},'raw':!![]})[_0x993e('0x2b')](function(_0x4a0dbd){if(_0x4a0dbd&&_0x4a0dbd['autoAssociation']===0x0){return db[_0x993e('0x2f')][_0x993e('0x51')]({'name':_0x37d7b1[_0x993e('0x32')],'resourceId':_0x37d7b1['id'],'type':_0x4a0dbd[_0x993e('0x32')],'sectionId':_0x4a0dbd['id']},{})[_0x993e('0x2b')](function(){return _0x207e27;});}else{return _0x207e27;}})[_0x993e('0x4e')](function(_0x4f9225){logger[_0x993e('0x30')](_0x993e('0x58'),_0x4f9225);throw _0x4f9225;});}return _0x207e27;})['then'](respondWithResult(_0x3809ef,null))[_0x993e('0x4e')](handleError(_0x3809ef,null));};function Extension(_0x473e00,_0x1b2113,_0x5ebaec,_0x426341){this[_0x993e('0x59')]=_0x993e('0x5a');this['exten']=_0x473e00;this[_0x993e('0x5b')]=_0x5ebaec;this[_0x993e('0x37')]=_0x993e('0x5c');this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x1b2113;this[_0x993e('0x5d')]=_0x426341;}function createVoicePrefixExtensions(_0x98d16c,_0x3a3d29,_0x411484){return new BPromise(function(_0xc62106,_0x55a347){var _0x18367f=new Extension(formatPrefixName(_0x98d16c[_0x993e('0x5e')]),0x1,_0x993e('0x5f'),'Voice\x20Prefix');_0x18367f[_0x993e('0x60')]=_0x98d16c['id'];return db[_0x993e('0x54')][_0x993e('0x51')](_0x18367f,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x5e4ab1){var _0x54417b=_0x5e4ab1[_0x993e('0x2d')]({'plain':!![]});var _0x51cec9=_['map'](addVoicePrefixExtensions(_0x98d16c,_0x3a3d29),function(_0x17c7f7){_0x17c7f7[_0x993e('0x55')]=_0x54417b['id'];_0x17c7f7[_0x993e('0x60')]=_0x98d16c['id'];return _0x17c7f7;});return db[_0x993e('0x54')][_0x993e('0x61')](_0x51cec9,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x211204){if(!_0x211204){return _0x55a347(_0x993e('0x62'));}else{return _0xc62106(_0x211204);}})[_0x993e('0x4e')](function(_0x113395){return _0x55a347(_0x113395);});});;});};function addVoicePrefixExtensions(_0x300a93,_0x44def2){var _0x2ddc16=[];var _0x609430=formatPrefixName(_0x300a93[_0x993e('0x5e')]);_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x2,'Set',_0x993e('0x64')+_0x300a93[_0x993e('0x32')]));if(_0x300a93['callerIdAll']){_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'Set',_0x993e('0x65')+_0x300a93[_0x993e('0x66')]));}else{_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'NoOp',_0x993e('0x67')));}_0x2ddc16['push'](new Extension(_0x609430,0x4,'goto',_0x44def2[_0x993e('0x59')]+','+_0x993e('0x68')+(0x8+_0x300a93[_0x993e('0x32')][_0x993e('0x69')])+'}'+','+0x1));return _0x2ddc16;}function formatPrefixName(_0x2a243a){var _0x5194de='_';for(var _0x120d51=0x0;_0x120d51<_0x2a243a[_0x993e('0x69')];_0x120d51++){if(_0x2a243a[_0x993e('0x6a')](_0x120d51)=='-'){_0x5194de+=_0x2a243a['charAt'](_0x120d51);}else{_0x5194de+='['+_0x2a243a[_0x993e('0x6a')](_0x120d51)+']';}}_0x5194de+='.';return _0x5194de;}exports['update']=function(_0x1ab10e,_0x6ef96,_0x42288d){var _0x5afba1=_0x1ab10e[_0x993e('0x6b')];_0x5afba1[_0x993e('0x5e')]=_0x993e('0x6c')+_0x5afba1[_0x993e('0x32')]+'-';return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x108cad){return db[_0x993e('0x35')][_0x993e('0x2a')](_0x5afba1,{'where':{'id':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db['VoiceExtension'][_0x993e('0x2c')]({'where':{'VoicePrefixId':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x5afba1[_0x993e('0x55')]},'raw':!![]})[_0x993e('0x2b')](function(_0x282c53){return createVoicePrefixExtensions(_0x5afba1,_0x282c53,_0x108cad);});});});})[_0x993e('0x2b')](function(){return db['VoicePrefix']['findById'](_0x5afba1['id']);})[_0x993e('0x2b')](respondWithResult(_0x6ef96,null))['catch'](handleError(_0x6ef96,null));};exports[_0x993e('0x6d')]=function(_0x444da6,_0x2ce913,_0x49788e){return db[_0x993e('0x35')]['find']({'where':{'id':_0x444da6[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x2ce913,null))[_0x993e('0x2b')](function(_0x40768a){if(_0x40768a){return _0x40768a[_0x993e('0x6d')](_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')],_[_0x993e('0x6f')](_0x444da6['body'],['ids','id'])||{})[_0x993e('0x70')](function(_0x5a70ff){for(var _0x2fb182=0x0;_0x2fb182<_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x993e('0x69')];_0x2fb182+=0x1){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':Number(_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x2fb182]),'VoicePrefixId':Number(_0x444da6[_0x993e('0x4b')]['id'])});}return _0x5a70ff;});}})[_0x993e('0x2b')](respondWithResult(_0x2ce913,null))['catch'](handleError(_0x2ce913,null));};exports[_0x993e('0x73')]=function(_0x14347f,_0x4a0002,_0x4742d9){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x14347f[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x4a0002,null))[_0x993e('0x2b')](function(_0x4157b6){if(_0x4157b6){return _0x4157b6[_0x993e('0x73')](_0x14347f[_0x993e('0x38')]['ids'])[_0x993e('0x2b')](function(){if(_[_0x993e('0x74')](_0x14347f[_0x993e('0x38')][_0x993e('0x6e')])){for(var _0x53ce16=0x0;_0x53ce16<_0x14347f['query'][_0x993e('0x6e')]['length'];_0x53ce16+=0x1){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')][_0x53ce16]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}}else{socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a0002,null))[_0x993e('0x4e')](handleError(_0x4a0002,null));};exports[_0x993e('0x76')]=function(_0x3abd3a,_0x278c2a,_0x3f6347){var _0x1a3967={};var _0x1079e7={};var _0x5c634a;var _0x47c3b6;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x3abd3a[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x278c2a,null))[_0x993e('0x2b')](function(_0x53b0c8){if(_0x53b0c8){_0x5c634a=_0x53b0c8;_0x1079e7['model']=_['keys'](db[_0x993e('0x78')][_0x993e('0x36')]);_0x1079e7[_0x993e('0x38')]=_[_0x993e('0x39')](_0x3abd3a[_0x993e('0x38')]);_0x1079e7['filters']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],_0x1079e7[_0x993e('0x38')]);_0x1a3967['attributes']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x3e')]));_0x1a3967[_0x993e('0x3d')]=_0x1a3967['attributes'][_0x993e('0x69')]?_0x1a3967['attributes']:_0x1079e7['model'];_0x1a3967['order']=qs['sort'](_0x3abd3a[_0x993e('0x38')][_0x993e('0x42')]);_0x1a3967[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x3abd3a[_0x993e('0x38')],_0x1079e7[_0x993e('0x3a')]));if(_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]){_0x1a3967['where']=_[_0x993e('0x46')](_0x1a3967['where'],{'$or':_[_0x993e('0x34')](_0x1a3967[_0x993e('0x3d')],function(_0x3e7793){var _0x65c6f0={};_0x65c6f0[_0x3e7793]={'$like':'%'+_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x65c6f0;})});}_0x1a3967=_[_0x993e('0x46')]({},_0x1a3967,_0x3abd3a['options']);return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})[_0x993e('0x2b')](function(_0x285c93){if(_0x285c93){_0x47c3b6=_0x285c93['length'];if(!_0x3abd3a[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1a3967['limit']=qs[_0x993e('0x24')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x24')]);_0x1a3967[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x22')]);}return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})['then'](function(_0x412d21){if(_0x412d21){return _0x412d21?{'count':_0x47c3b6,'rows':_0x412d21}:null;}})['then'](respondWithResult(_0x278c2a,null))[_0x993e('0x4e')](handleError(_0x278c2a,null));};exports[_0x993e('0x79')]=function(_0x4d6d94,_0x505f28,_0x4e2ccf){var _0x4506cb={};var _0x31e947={};var _0x7800d4;var _0x4e1fcf;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x4d6d94[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x505f28,null))['then'](function(_0xc35545){if(_0xc35545){_0x7800d4=_0xc35545;_0x31e947['model']=_[_0x993e('0x39')](db['Team']['rawAttributes']);_0x31e947[_0x993e('0x38')]=_[_0x993e('0x39')](_0x4d6d94[_0x993e('0x38')]);_0x31e947[_0x993e('0x3a')]=_['intersection'](_0x31e947['model'],_0x31e947['query']);_0x4506cb[_0x993e('0x3d')]=_['intersection'](_0x31e947[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x3e')]));_0x4506cb[_0x993e('0x3d')]=_0x4506cb['attributes'][_0x993e('0x69')]?_0x4506cb[_0x993e('0x3d')]:_0x31e947['model'];_0x4506cb[_0x993e('0x41')]=qs['sort'](_0x4d6d94[_0x993e('0x38')][_0x993e('0x42')]);_0x4506cb[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x4d6d94[_0x993e('0x38')],_0x31e947[_0x993e('0x3a')]));if(_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]){_0x4506cb['where']=_[_0x993e('0x46')](_0x4506cb['where'],{'$or':_[_0x993e('0x34')](_0x4506cb[_0x993e('0x3d')],function(_0x50dd66){var _0x48acd5={};_0x48acd5[_0x50dd66]={'$like':'%'+_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x48acd5;})});}_0x4506cb=_['merge']({},_0x4506cb,_0x4d6d94[_0x993e('0x7a')]);return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0xc56e5a){if(_0xc56e5a){_0x4e1fcf=_0xc56e5a['length'];if(!_0x4d6d94[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x4506cb[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x4d6d94['query'][_0x993e('0x24')]);_0x4506cb[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x22')]);}return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0x5d2b00){if(_0x5d2b00){return _0x5d2b00?{'count':_0x4e1fcf,'rows':_0x5d2b00}:null;}})[_0x993e('0x2b')](respondWithResult(_0x505f28,null))['catch'](handleError(_0x505f28,null));};exports[_0x993e('0x7b')]=function(_0x8dc65,_0x4a5755,_0x43b5c5){var _0x4d53d1=_0x8dc65['body'][_0x993e('0x6e')];var _0x371be2;return db['Team'][_0x993e('0x48')]({'where':{'id':_0x4d53d1},'attributes':['id'],'include':[{'model':db[_0x993e('0x78')],'as':_0x993e('0x7c'),'attributes':['id',_0x993e('0x32'),'online',_0x993e('0x7d'),'interface'],'raw':!![]}]})[_0x993e('0x2b')](function(_0x5c9960){if(_0x5c9960){_0x371be2=_0x5c9960;var _0x4286a0=_[_0x993e('0x7e')](_0x5c9960,function(_0x2540e4){var _0x56a23a=_0x2540e4['get']({'plain':!![]});return _0x56a23a[_0x993e('0x7c')];});return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x8dc65[_0x993e('0x4b')]['id']}})['then'](function(_0x37409f){return db['sequelize'][_0x993e('0x53')](function(_0xa16043){return _0x37409f[_0x993e('0x7b')](_0x4d53d1,{'transaction':_0xa16043})['then'](function(){return BPromise[_0x993e('0x7f')](_0x371be2,function(_0x30f7a3){return db[_0x993e('0x80')][_0x993e('0x81')]({'TeamId':_0x30f7a3['id'],'VoicePrefixId':_0x8dc65[_0x993e('0x4b')]['id']},{'transaction':_0xa16043});});})[_0x993e('0x2b')](function(){return BPromise[_0x993e('0x7f')](_0x4286a0,function(_0x3e61d2){return db[_0x993e('0x82')]['findOrCreate']({'where':{'UserId':_0x3e61d2['id'],'VoicePrefixId':_0x8dc65['params']['id']},'transaction':_0xa16043});});})['then'](function(){_0x4286a0[_0x993e('0x83')](function(_0x47c230){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':_0x47c230['id'],'VoicePrefixId':_0x37409f['id']});});});});});}})[_0x993e('0x2b')](respondWithStatusCode(_0x4a5755,null))[_0x993e('0x4e')](handleError(_0x4a5755,null));};exports['removeTeams']=function(_0x548dfb,_0x123dcd,_0x4e7340){return db[_0x993e('0x84')][_0x993e('0x48')]({'where':{'id':_0x548dfb[_0x993e('0x38')][_0x993e('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x993e('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x123dcd,null))['then'](function(_0x242374){var _0x1a3779=_[_0x993e('0x34')](_0x242374,'id');var _0x366809=[];var _0x11ba3a=[];var _0x1b2ca0=squel[_0x993e('0x85')]();_0x1b2ca0[_0x993e('0x86')](_0x993e('0x87'))[_0x993e('0x88')](_0x993e('0x89'),'tq')[_0x993e('0x8a')]('user_has_teams','ut',_0x993e('0x8b'))[_0x993e('0x43')](_0x993e('0x8c'),_0x548dfb[_0x993e('0x4b')]['id']);for(var _0x23ecf0=0x0;_0x23ecf0<_0x242374[_0x993e('0x69')];_0x23ecf0+=0x1){let _0x2fcfaa=_0x242374[_0x23ecf0];for(var _0x5303c9=0x0;_0x5303c9<_0x2fcfaa[_0x993e('0x7c')]['length'];_0x5303c9+=0x1){let _0x5d5dc8=_0x2fcfaa[_0x993e('0x7c')][_0x5303c9];var _0x102393=_0x1b2ca0[_0x993e('0x8d')]();_0x102393['where'](_0x993e('0x8e'),_0x5d5dc8['id']);_0x11ba3a[_0x993e('0x63')](db[_0x993e('0x52')][_0x993e('0x38')](_0x102393[_0x993e('0x8f')](),{'type':db[_0x993e('0x52')][_0x993e('0x90')]['SELECT']})[_0x993e('0x2b')](function(_0x6ee3c0){if(_0x6ee3c0['length']===0x1){return _0x5d5dc8['id'];}else{var _0x58fee1=_[_0x993e('0x91')](_[_0x993e('0x34')](_0x6ee3c0,_0x993e('0x92')),function(_0x2f0669){return _[_0x993e('0x93')](_0x1a3779,_0x2f0669);});if(_0x58fee1){return _0x5d5dc8['id'];}}}));}}return BPromise['all'](_0x11ba3a)[_0x993e('0x2b')](function(_0x3725b5){_0x366809=_(_0x366809)['union'](_0x3725b5)[_0x993e('0x94')]()['value']();return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x548dfb['params']['id']}})[_0x993e('0x2b')](function(_0x5ee2e0){return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x289772){return _0x5ee2e0['removeTeams'](_0x548dfb['query'][_0x993e('0x6e')],{'transaction':_0x289772})[_0x993e('0x2b')](function(){if(!_[_0x993e('0x95')](_0x366809)){return _0x5ee2e0[_0x993e('0x73')](_0x366809,{'transaction':_0x289772});}})[_0x993e('0x2b')](function(){_0x366809[_0x993e('0x83')](function(_0x366f8f){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':_0x366f8f,'VoicePrefixId':_0x5ee2e0['id']});});});});});});})['then'](respondWithStatusCode(_0x123dcd,null))[_0x993e('0x4e')](handleError(_0x123dcd,null));}; \ No newline at end of file +var _0xda2d=['UserProfileResource','destroy','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','VoicePrefix','includeAll','findAll','catch','show','params','rawAttributes','include','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','update','system-','transaction','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','options','getTeams','findOne','Team','online','voicePause','interface','flatMap','Agents','addTeams','each','UserVoicePrefix','forEach','userVoicePrefix:save','removeTeams','field','tq.TeamId','from','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','TeamId','includes','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','VoicePrefixes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xda2d,0x102));var _0xdda2=function(_0x3e9399,_0x5a8f82){_0x3e9399=_0x3e9399-0x0;var _0x1c42cb=_0xda2d[_0x3e9399];return _0x1c42cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdda2('0x19')](config[_0xdda2('0x1a')],{'host':_0xdda2('0x1b'),'port':0x18eb});var socket=require(_0xdda2('0x1c'))(new Redis(config[_0xdda2('0x1a')]));require(_0xdda2('0x1d'))[_0xdda2('0x1e')](socket);function respondWithStatusCode(_0x4df902,_0x79c6d4){_0x79c6d4=_0x79c6d4||0xcc;return function(_0x4b0220){if(_0x4b0220){return _0x4df902[_0xdda2('0x1f')](_0x79c6d4);}return _0x4df902[_0xdda2('0x20')](_0x79c6d4)[_0xdda2('0x21')]();};}function respondWithResult(_0x457764,_0x1922b1){_0x1922b1=_0x1922b1||0xc8;return function(_0x5d8a83){if(_0x5d8a83){return _0x457764['status'](_0x1922b1)[_0xdda2('0x22')](_0x5d8a83);}};}function respondWithFilteredResult(_0x518c6d,_0x1a5192){return function(_0x1a3b35){if(_0x1a3b35){var _0x335fb5=typeof _0x1a5192[_0xdda2('0x23')]===_0xdda2('0x24')&&typeof _0x1a5192[_0xdda2('0x25')]===_0xdda2('0x24');var _0x351151=_0x1a3b35[_0xdda2('0x26')];var _0x337b0b=_0x335fb5?0x0:_0x1a5192[_0xdda2('0x23')];var _0x6fdede=_0x335fb5?_0x1a3b35['count']:_0x1a5192[_0xdda2('0x23')]+_0x1a5192['limit'];var _0xc4567c;if(_0x6fdede>=_0x351151){_0x6fdede=_0x351151;_0xc4567c=0xc8;}else{_0xc4567c=0xce;}_0x518c6d[_0xdda2('0x20')](_0xc4567c);return _0x518c6d[_0xdda2('0x27')]('Content-Range',_0x337b0b+'-'+_0x6fdede+'/'+_0x351151)[_0xdda2('0x22')](_0x1a3b35);}return null;};}function patchUpdates(_0x5a9bb8){return function(_0x425489){try{jsonpatch[_0xdda2('0x28')](_0x425489,_0x5a9bb8,!![]);}catch(_0x4ac3eb){return BPromise[_0xdda2('0x29')](_0x4ac3eb);}return _0x425489[_0xdda2('0x2a')]();};}function saveUpdates(_0x2528d7,_0x13b0f3){return function(_0x45ee9d){if(_0x45ee9d){return _0x45ee9d['update'](_0x2528d7)[_0xdda2('0x2b')](function(_0x4be5ea){return _0x4be5ea;});}return null;};}function removeEntity(_0x2391a5,_0x31d48b){return function(_0x5436d1){if(_0x5436d1){return _0x5436d1['destroy']()[_0xdda2('0x2b')](function(){var _0x4567e7=_0x5436d1[_0xdda2('0x2c')]({'plain':!![]});var _0x5e9e74=_0xdda2('0x2d');return db[_0xdda2('0x2e')][_0xdda2('0x2f')]({'where':{'type':_0x5e9e74,'resourceId':_0x4567e7['id']}})[_0xdda2('0x2b')](function(){return _0x5436d1;});})[_0xdda2('0x2b')](function(){_0x2391a5[_0xdda2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c37d,_0x255bbc){return function(_0x53acb5){if(!_0x53acb5){_0x24c37d[_0xdda2('0x1f')](0x194);}return _0x53acb5;};}function handleError(_0x2cfaca,_0x3b18b8){_0x3b18b8=_0x3b18b8||0x1f4;return function(_0x15e511){logger['error'](_0x15e511[_0xdda2('0x30')]);if(_0x15e511[_0xdda2('0x31')]){delete _0x15e511['name'];}_0x2cfaca[_0xdda2('0x20')](_0x3b18b8)['send'](_0x15e511);};}exports[_0xdda2('0x32')]=function(_0x55809a,_0x53ff76){var _0x510b7b={},_0x239c25={},_0x5bfc17={'count':0x0,'rows':[]};var _0x1b13f4=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4637c1){return{'name':_0x4637c1[_0xdda2('0x33')],'type':_0x4637c1[_0xdda2('0x34')][_0xdda2('0x35')]};});_0x239c25[_0xdda2('0x36')]=_[_0xdda2('0x37')](_0x1b13f4,_0xdda2('0x31'));_0x239c25[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x55809a[_0xdda2('0x38')]);_0x239c25['filters']=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],_0x239c25[_0xdda2('0x38')]);_0x510b7b[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],qs[_0xdda2('0x3c')](_0x55809a['query']['fields']));_0x510b7b[_0xdda2('0x3b')]=_0x510b7b[_0xdda2('0x3b')][_0xdda2('0x3d')]?_0x510b7b['attributes']:_0x239c25['model'];if(!_0x55809a[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x510b7b[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x55809a['query'][_0xdda2('0x25')]);_0x510b7b[_0xdda2('0x23')]=qs['offset'](_0x55809a['query'][_0xdda2('0x23')]);}_0x510b7b[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x55809a[_0xdda2('0x38')][_0xdda2('0x41')]);_0x510b7b['where']=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x55809a[_0xdda2('0x38')],_0x239c25[_0xdda2('0x42')]),_0x1b13f4);if(_0x55809a['query']['filter']){_0x510b7b[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x510b7b[_0xdda2('0x44')],{'$or':_['map'](_0x1b13f4,function(_0x1bb2a7){if(_0x1bb2a7['type']!==_0xdda2('0x46')){var _0x4c68d7={};_0x4c68d7[_0x1bb2a7[_0xdda2('0x31')]]={'$like':'%'+_0x55809a[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4c68d7;}})});}_0x510b7b=_[_0xdda2('0x45')]({},_0x510b7b,_0x55809a['options']);var _0x1c5195={'where':_0x510b7b['where']};return db[_0xdda2('0x48')]['count'](_0x1c5195)[_0xdda2('0x2b')](function(_0x12589b){_0x5bfc17[_0xdda2('0x26')]=_0x12589b;if(_0x55809a[_0xdda2('0x38')][_0xdda2('0x49')]){_0x510b7b['include']=[{'all':!![]}];}return db[_0xdda2('0x48')][_0xdda2('0x4a')](_0x510b7b);})['then'](function(_0x2caced){_0x5bfc17['rows']=_0x2caced;return _0x5bfc17;})[_0xdda2('0x2b')](respondWithFilteredResult(_0x53ff76,_0x510b7b))[_0xdda2('0x4b')](handleError(_0x53ff76,null));};exports[_0xdda2('0x4c')]=function(_0x355b6a,_0x3f1f9b){var _0x6718ea={'raw':![],'where':{'id':_0x355b6a[_0xdda2('0x4d')]['id']}},_0x550351={};_0x550351[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x48')][_0xdda2('0x4e')]);_0x550351[_0xdda2('0x38')]=_['keys'](_0x355b6a['query']);_0x550351['filters']=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],_0x550351['query']);_0x6718ea[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],qs['fields'](_0x355b6a[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x6718ea['attributes']=_0x6718ea['attributes'][_0xdda2('0x3d')]?_0x6718ea['attributes']:_0x550351[_0xdda2('0x36')];if(_0x355b6a['query'][_0xdda2('0x49')]){_0x6718ea[_0xdda2('0x4f')]=[{'all':!![]}];}_0x6718ea=_['merge']({},_0x6718ea,_0x355b6a['options']);return db[_0xdda2('0x48')][_0xdda2('0x50')](_0x6718ea)[_0xdda2('0x2b')](handleEntityNotFound(_0x3f1f9b,null))[_0xdda2('0x2b')](respondWithResult(_0x3f1f9b,null))['catch'](handleError(_0x3f1f9b,null));};exports[_0xdda2('0x2f')]=function(_0x3bba94,_0x3d2cb0){return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x3bba94['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x3d2cb0,null))[_0xdda2('0x2b')](removeEntity(_0x3d2cb0,null))['catch'](handleError(_0x3d2cb0,null));};exports[_0xdda2('0x51')]=function(_0x123c2d,_0x143670){return db[_0xdda2('0x48')][_0xdda2('0x51')]()[_0xdda2('0x2b')](respondWithResult(_0x143670,null))['catch'](handleError(_0x143670,null));};exports[_0xdda2('0x52')]=function(_0x4a9814,_0x361038){var _0x4a70ff;return db[_0xdda2('0x53')]['transaction'](function(_0x3b5bbf){return db[_0xdda2('0x48')][_0xdda2('0x52')](_0x4a9814[_0xdda2('0x54')],{'transaction':_0x3b5bbf})[_0xdda2('0x2b')](function(_0x2b45f3){_0x4a70ff=_0x2b45f3[_0xdda2('0x2c')]({'plain':!![]});return db[_0xdda2('0x55')]['find']({'where':{'id':_0x4a70ff[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x1b24f2){return createVoicePrefixExtensions(_0x4a70ff,_0x1b24f2,_0x3b5bbf);});});})['then'](function(){var _0xf380b0=_0x4a9814[_0xdda2('0x57')]['get']({'plain':!![]});if(!_0xf380b0)throw new Error(_0xdda2('0x58'));if(_0xf380b0['role']===_0xdda2('0x57')){var _0x10fbac=_0x4a70ff;return db[_0xdda2('0x59')][_0xdda2('0x50')]({'where':{'name':_0xdda2('0x2d'),'userProfileId':_0xf380b0['userProfileId']},'raw':!![]})['then'](function(_0x5c2cb2){if(_0x5c2cb2&&_0x5c2cb2[_0xdda2('0x5a')]===0x0){return db[_0xdda2('0x2e')]['create']({'name':_0x10fbac[_0xdda2('0x31')],'resourceId':_0x10fbac['id'],'type':_0x5c2cb2[_0xdda2('0x31')],'sectionId':_0x5c2cb2['id']},{})[_0xdda2('0x2b')](function(){return _0x4a70ff;});}else{return _0x4a70ff;}})['catch'](function(_0x3fd76c){logger[_0xdda2('0x5b')](_0xdda2('0x5c'),_0x3fd76c);throw _0x3fd76c;});}return _0x4a70ff;})['then'](respondWithResult(_0x361038,null))[_0xdda2('0x4b')](handleError(_0x361038,null));};function Extension(_0x4495e5,_0x7eb83f,_0x25c9a9,_0x5d8602){this[_0xdda2('0x5d')]='from-sip';this['exten']=_0x4495e5;this['app']=_0x25c9a9;this[_0xdda2('0x34')]=_0xdda2('0x5e');this[_0xdda2('0x5f')]=_0xdda2('0x60');this[_0xdda2('0x61')]=_0x7eb83f;this[_0xdda2('0x62')]=_0x5d8602;}function createVoicePrefixExtensions(_0x29a739,_0x3ac33a,_0x269ad1){return new BPromise(function(_0x138c2f,_0x26e7de){var _0x5e6dcf=new Extension(formatPrefixName(_0x29a739[_0xdda2('0x63')]),0x1,_0xdda2('0x64'),_0xdda2('0x65'));_0x5e6dcf[_0xdda2('0x66')]=_0x29a739['id'];return db[_0xdda2('0x55')][_0xdda2('0x52')](_0x5e6dcf,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x57fb41){var _0x23518f=_0x57fb41[_0xdda2('0x2c')]({'plain':!![]});var _0x19e650=_[_0xdda2('0x37')](addVoicePrefixExtensions(_0x29a739,_0x3ac33a),function(_0x44f619){_0x44f619['VoiceExtensionId']=_0x23518f['id'];_0x44f619[_0xdda2('0x66')]=_0x29a739['id'];return _0x44f619;});return db[_0xdda2('0x55')][_0xdda2('0x67')](_0x19e650,{'transaction':_0x269ad1})[_0xdda2('0x2b')](function(_0x21d0e4){if(!_0x21d0e4){return _0x26e7de('Extensions\x20creation\x20failed');}else{return _0x138c2f(_0x21d0e4);}})[_0xdda2('0x4b')](function(_0x18d251){return _0x26e7de(_0x18d251);});});;});};function addVoicePrefixExtensions(_0x3d49e8,_0x4530b7){var _0x1ac15a=[];var _0x5d34d7=formatPrefixName(_0x3d49e8[_0xdda2('0x63')]);_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x2,_0xdda2('0x69'),'CDR(prefix)='+_0x3d49e8[_0xdda2('0x31')]));if(_0x3d49e8['callerIdAll']){_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x69'),_0xdda2('0x6a')+_0x3d49e8['callerIdAll']));}else{_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x3,_0xdda2('0x64'),'No\x20callerid\x20available'));}_0x1ac15a[_0xdda2('0x68')](new Extension(_0x5d34d7,0x4,'goto',_0x4530b7[_0xdda2('0x5d')]+','+_0xdda2('0x6b')+(0x8+_0x3d49e8[_0xdda2('0x31')][_0xdda2('0x3d')])+'}'+','+0x1));return _0x1ac15a;}function formatPrefixName(_0x10d1de){var _0x4a061a='_';for(var _0x586ca1=0x0;_0x586ca1<_0x10d1de[_0xdda2('0x3d')];_0x586ca1++){if(_0x10d1de[_0xdda2('0x6c')](_0x586ca1)=='-'){_0x4a061a+=_0x10d1de['charAt'](_0x586ca1);}else{_0x4a061a+='['+_0x10d1de['charAt'](_0x586ca1)+']';}}_0x4a061a+='.';return _0x4a061a;}exports[_0xdda2('0x6d')]=function(_0x501336,_0x12a052,_0x1a33ba){var _0x4910a6=_0x501336[_0xdda2('0x54')];_0x4910a6[_0xdda2('0x63')]=_0xdda2('0x6e')+_0x4910a6[_0xdda2('0x31')]+'-';return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x4eebb0){return db[_0xdda2('0x48')][_0xdda2('0x6d')](_0x4910a6,{'where':{'id':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension'][_0xdda2('0x2f')]({'where':{'VoicePrefixId':_0x4910a6['id']},'transaction':_0x4eebb0})[_0xdda2('0x2b')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x4910a6[_0xdda2('0x56')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x2f03b9){return createVoicePrefixExtensions(_0x4910a6,_0x2f03b9,_0x4eebb0);});});});})['then'](function(){return db['VoicePrefix'][_0xdda2('0x70')](_0x4910a6['id']);})['then'](respondWithResult(_0x12a052,null))[_0xdda2('0x4b')](handleError(_0x12a052,null));};exports[_0xdda2('0x71')]=function(_0x19d92e,_0x12fd67,_0x597b09){return db[_0xdda2('0x48')]['find']({'where':{'id':_0x19d92e['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x12fd67,null))['then'](function(_0x2de01c){if(_0x2de01c){return _0x2de01c[_0xdda2('0x71')](_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')],_[_0xdda2('0x73')](_0x19d92e[_0xdda2('0x54')],[_0xdda2('0x72'),'id'])||{})[_0xdda2('0x74')](function(_0x37c547){for(var _0x495a28=0x0;_0x495a28<_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x495a28+=0x1){socket[_0xdda2('0x75')]('userVoicePrefix:save',{'UserId':Number(_0x19d92e[_0xdda2('0x54')][_0xdda2('0x72')][_0x495a28]),'VoicePrefixId':Number(_0x19d92e[_0xdda2('0x4d')]['id'])});}return _0x37c547;});}})[_0xdda2('0x2b')](respondWithResult(_0x12fd67,null))['catch'](handleError(_0x12fd67,null));};exports['removeAgents']=function(_0xe4110b,_0xdef266,_0x423e1f){return db[_0xdda2('0x48')]['find']({'where':{'id':_0xe4110b[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0xdef266,null))[_0xdda2('0x2b')](function(_0x152ba3){if(_0x152ba3){return _0x152ba3[_0xdda2('0x76')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])[_0xdda2('0x2b')](function(){if(_[_0xdda2('0x77')](_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')])){for(var _0x23a80a=0x0;_0x23a80a<_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')][_0xdda2('0x3d')];_0x23a80a+=0x1){socket['emit'](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')]['ids'][_0x23a80a]),'VoicePrefixId':Number(_0xe4110b['params']['id'])});}}else{socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':Number(_0xe4110b[_0xdda2('0x38')][_0xdda2('0x72')]),'VoicePrefixId':Number(_0xe4110b[_0xdda2('0x4d')]['id'])});}});}})[_0xdda2('0x2b')](respondWithStatusCode(_0xdef266,null))['catch'](handleError(_0xdef266,null));};exports[_0xdda2('0x79')]=function(_0x1f3abe,_0x447bd2,_0x2bb4f3){var _0x563be8={};var _0xbf1248={};var _0x5c3d67;var _0x20ebf7;return db[_0xdda2('0x48')]['findOne']({'where':{'id':_0x1f3abe[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x447bd2,null))[_0xdda2('0x2b')](function(_0x1dfe6d){if(_0x1dfe6d){_0x5c3d67=_0x1dfe6d;_0xbf1248[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x7a')][_0xdda2('0x4e')]);_0xbf1248[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x1f3abe[_0xdda2('0x38')]);_0xbf1248['filters']=_[_0xdda2('0x3a')](_0xbf1248[_0xdda2('0x36')],_0xbf1248[_0xdda2('0x38')]);_0x563be8[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xbf1248['model'],qs[_0xdda2('0x3c')](_0x1f3abe[_0xdda2('0x38')]['fields']));_0x563be8[_0xdda2('0x3b')]=_0x563be8[_0xdda2('0x3b')]['length']?_0x563be8['attributes']:_0xbf1248[_0xdda2('0x36')];_0x563be8[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x41')]);_0x563be8[_0xdda2('0x44')]=qs['filters'](_[_0xdda2('0x43')](_0x1f3abe[_0xdda2('0x38')],_0xbf1248['filters']));if(_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]){_0x563be8['where']=_[_0xdda2('0x45')](_0x563be8[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x563be8['attributes'],function(_0xe6f37b){var _0x4a34ee={};_0x4a34ee[_0xe6f37b]={'$like':'%'+_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4a34ee;})});}_0x563be8=_[_0xdda2('0x45')]({},_0x563be8,_0x1f3abe[_0xdda2('0x7b')]);return _0x5c3d67['getAgents'](_0x563be8);}})['then'](function(_0x2b8c0c){if(_0x2b8c0c){_0x20ebf7=_0x2b8c0c[_0xdda2('0x3d')];if(!_0x1f3abe['query'][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x563be8[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x25')]);_0x563be8[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x1f3abe[_0xdda2('0x38')][_0xdda2('0x23')]);}return _0x5c3d67[_0xdda2('0x79')](_0x563be8);}})[_0xdda2('0x2b')](function(_0x528185){if(_0x528185){return _0x528185?{'count':_0x20ebf7,'rows':_0x528185}:null;}})['then'](respondWithResult(_0x447bd2,null))['catch'](handleError(_0x447bd2,null));};exports[_0xdda2('0x7c')]=function(_0x4edf20,_0x2910b0,_0x323af8){var _0x2f18a0={};var _0xe797aa={};var _0x558ab6;var _0x374fc4;return db[_0xdda2('0x48')][_0xdda2('0x7d')]({'where':{'id':_0x4edf20['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x2910b0,null))[_0xdda2('0x2b')](function(_0x2588f5){if(_0x2588f5){_0x558ab6=_0x2588f5;_0xe797aa['model']=_['keys'](db[_0xdda2('0x7e')][_0xdda2('0x4e')]);_0xe797aa[_0xdda2('0x38')]=_['keys'](_0x4edf20[_0xdda2('0x38')]);_0xe797aa[_0xdda2('0x42')]=_[_0xdda2('0x3a')](_0xe797aa[_0xdda2('0x36')],_0xe797aa[_0xdda2('0x38')]);_0x2f18a0[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0xe797aa['model'],qs[_0xdda2('0x3c')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x2f18a0[_0xdda2('0x3b')]=_0x2f18a0['attributes'][_0xdda2('0x3d')]?_0x2f18a0[_0xdda2('0x3b')]:_0xe797aa[_0xdda2('0x36')];_0x2f18a0[_0xdda2('0x40')]=qs['sort'](_0x4edf20['query']['sort']);_0x2f18a0[_0xdda2('0x44')]=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x4edf20[_0xdda2('0x38')],_0xe797aa[_0xdda2('0x42')]));if(_0x4edf20[_0xdda2('0x38')]['filter']){_0x2f18a0[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x2f18a0[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x2f18a0[_0xdda2('0x3b')],function(_0x39ee74){var _0xcbf57f={};_0xcbf57f[_0x39ee74]={'$like':'%'+_0x4edf20[_0xdda2('0x38')]['filter']+'%'};return _0xcbf57f;})});}_0x2f18a0=_[_0xdda2('0x45')]({},_0x2f18a0,_0x4edf20['options']);return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x15066f){if(_0x15066f){_0x374fc4=_0x15066f['length'];if(!_0x4edf20[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x2f18a0[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x4edf20[_0xdda2('0x38')][_0xdda2('0x25')]);_0x2f18a0[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x4edf20['query'][_0xdda2('0x23')]);}return _0x558ab6[_0xdda2('0x7c')](_0x2f18a0);}})['then'](function(_0x42db44){if(_0x42db44){return _0x42db44?{'count':_0x374fc4,'rows':_0x42db44}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x2910b0,null))[_0xdda2('0x4b')](handleError(_0x2910b0,null));};exports['addTeams']=function(_0x1702ae,_0x21ade3,_0x251408){var _0x311e34=_0x1702ae[_0xdda2('0x54')][_0xdda2('0x72')];var _0x4124a5;return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x311e34},'attributes':['id'],'include':[{'model':db[_0xdda2('0x7a')],'as':'Agents','attributes':['id',_0xdda2('0x31'),_0xdda2('0x7f'),_0xdda2('0x80'),_0xdda2('0x81')],'raw':!![]}]})[_0xdda2('0x2b')](function(_0x4c540d){if(_0x4c540d){_0x4124a5=_0x4c540d;var _0x320cf1=_[_0xdda2('0x82')](_0x4c540d,function(_0xdd343d){var _0x56cd13=_0xdd343d[_0xdda2('0x2c')]({'plain':!![]});return _0x56cd13[_0xdda2('0x83')];});return db[_0xdda2('0x48')]['find']({'where':{'id':_0x1702ae[_0xdda2('0x4d')]['id']}})['then'](function(_0x579fc9){return db[_0xdda2('0x53')][_0xdda2('0x6f')](function(_0x3752bf){return _0x579fc9[_0xdda2('0x84')](_0x311e34,{'transaction':_0x3752bf})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x4124a5,function(_0x14baa0){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x14baa0['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},{'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){return BPromise[_0xdda2('0x85')](_0x320cf1,function(_0x16b910){return db[_0xdda2('0x86')]['findOrCreate']({'where':{'UserId':_0x16b910['id'],'VoicePrefixId':_0x1702ae[_0xdda2('0x4d')]['id']},'transaction':_0x3752bf});});})[_0xdda2('0x2b')](function(){_0x320cf1[_0xdda2('0x87')](function(_0x233494){socket[_0xdda2('0x75')](_0xdda2('0x88'),{'UserId':_0x233494['id'],'VoicePrefixId':_0x579fc9['id']});});});});});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x21ade3,null))[_0xdda2('0x4b')](handleError(_0x21ade3,null));};exports[_0xdda2('0x89')]=function(_0x44e93d,_0x2defb2,_0x53c44d){return db[_0xdda2('0x7e')][_0xdda2('0x4a')]({'where':{'id':_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdda2('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2defb2,null))[_0xdda2('0x2b')](function(_0x4f2d5c){var _0x240048=_['map'](_0x4f2d5c,'id');var _0x1da0dd=[];var _0xb93d3b=[];var _0x3d59cb=squel['select']();_0x3d59cb[_0xdda2('0x8a')](_0xdda2('0x8b'))[_0xdda2('0x8c')]('team_has_voice_prefixes','tq')['join'](_0xdda2('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdda2('0x44')](_0xdda2('0x8e'),_0x44e93d[_0xdda2('0x4d')]['id']);for(var _0x182570=0x0;_0x182570<_0x4f2d5c['length'];_0x182570+=0x1){let _0x28a217=_0x4f2d5c[_0x182570];for(var _0x54cd55=0x0;_0x54cd55<_0x28a217['Agents']['length'];_0x54cd55+=0x1){let _0x5235d5=_0x28a217[_0xdda2('0x83')][_0x54cd55];var _0x4a6058=_0x3d59cb[_0xdda2('0x8f')]();_0x4a6058[_0xdda2('0x44')]('ut.UserId\x20=\x20?',_0x5235d5['id']);_0xb93d3b['push'](db[_0xdda2('0x53')][_0xdda2('0x38')](_0x4a6058[_0xdda2('0x90')](),{'type':db[_0xdda2('0x53')]['QueryTypes']['SELECT']})[_0xdda2('0x2b')](function(_0x19c1eb){if(_0x19c1eb[_0xdda2('0x3d')]===0x1){return _0x5235d5['id'];}else{var _0x22e01a=_['every'](_[_0xdda2('0x37')](_0x19c1eb,_0xdda2('0x91')),function(_0x3867b3){return _[_0xdda2('0x92')](_0x240048,_0x3867b3);});if(_0x22e01a){return _0x5235d5['id'];}}}));}}return BPromise[_0xdda2('0x93')](_0xb93d3b)[_0xdda2('0x2b')](function(_0xa798dc){_0x1da0dd=_(_0x1da0dd)[_0xdda2('0x94')](_0xa798dc)[_0xdda2('0x95')]()[_0xdda2('0x96')]();return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x44e93d[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](function(_0x3cb988){return db[_0xdda2('0x53')]['transaction'](function(_0xe54b68){return _0x3cb988[_0xdda2('0x89')](_0x44e93d[_0xdda2('0x38')][_0xdda2('0x72')],{'transaction':_0xe54b68})[_0xdda2('0x2b')](function(){if(!_[_0xdda2('0x97')](_0x1da0dd)){return _0x3cb988[_0xdda2('0x76')](_0x1da0dd,{'transaction':_0xe54b68});}})[_0xdda2('0x2b')](function(){_0x1da0dd[_0xdda2('0x87')](function(_0x1c008c){socket[_0xdda2('0x75')](_0xdda2('0x78'),{'UserId':_0x1c008c,'VoicePrefixId':_0x3cb988['id']});});});});});});})[_0xdda2('0x2b')](respondWithStatusCode(_0x2defb2,null))[_0xdda2('0x4b')](handleError(_0x2defb2,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8b53aeb..72fb95a 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 _0xde58=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xde58,0x1ab));var _0x8de5=function(_0x40af7a,_0x3f5bc6){_0x40af7a=_0x40af7a-0x0;var _0x47c1c8=_0xde58[_0x40af7a];return _0x47c1c8;};'use strict';var EventEmitter=require(_0x8de5('0x0'));var VoicePrefix=require(_0x8de5('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x8de5('0x2')](0x0);var events={'afterCreate':_0x8de5('0x3'),'afterUpdate':_0x8de5('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe0b113){return function(_0x2f9f0b,_0x41921c,_0x5468e5){VoicePrefixEvents['emit'](_0xe0b113+':'+_0x2f9f0b['id'],_0x2f9f0b);VoicePrefixEvents[_0x8de5('0x5')](_0xe0b113,_0x2f9f0b);_0x5468e5(null);};}for(var e in events){if(events[_0x8de5('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x8de5('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xe66f=['VoicePrefix','setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x1f5d35,_0x13db91){var _0x27355a=function(_0x1a3932){while(--_0x1a3932){_0x1f5d35['push'](_0x1f5d35['shift']());}};_0x27355a(++_0x13db91);}(_0xe66f,0x18e));var _0xfe66=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xe66f[_0x5a776b];return _0xbbef59;};'use strict';var EventEmitter=require(_0xfe66('0x0'));var VoicePrefix=require(_0xfe66('0x1'))['db'][_0xfe66('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xfe66('0x3')](0x0);var events={'afterCreate':_0xfe66('0x4'),'afterUpdate':_0xfe66('0x5'),'afterDestroy':_0xfe66('0x6')};function emitEvent(_0x3d5b9d){return function(_0x590e45,_0x16a4e3,_0x46e770){VoicePrefixEvents[_0xfe66('0x7')](_0x3d5b9d+':'+_0x590e45['id'],_0x590e45);VoicePrefixEvents[_0xfe66('0x7')](_0x3d5b9d,_0x590e45);_0x46e770(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e6b021d..4300708 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 _0x54d7=['api','bluebird','request-promise','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger'];(function(_0x7953b4,_0x57c2b0){var _0x58f031=function(_0x5ab784){while(--_0x5ab784){_0x7953b4['push'](_0x7953b4['shift']());}};_0x58f031(++_0x57c2b0);}(_0x54d7,0x11b));var _0x754d=function(_0x5bc3e7,_0x12dcf5){_0x5bc3e7=_0x5bc3e7-0x0;var _0x34cef3=_0x54d7[_0x5bc3e7];return _0x34cef3;};'use strict';var _=require(_0x754d('0x0'));var util=require(_0x754d('0x1'));var logger=require(_0x754d('0x2'))(_0x754d('0x3'));var moment=require('moment');var BPromise=require(_0x754d('0x4'));var rp=require(_0x754d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x754d('0x6'));var config=require('../../config/environment');var attributes=require(_0x754d('0x7'));module[_0x754d('0x8')]=function(_0x420f0b,_0x32bd1b){return _0x420f0b[_0x754d('0x9')](_0x754d('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd20c=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoicePrefix','lodash'];(function(_0x2215d2,_0x563782){var _0x2bb13a=function(_0x1bb042){while(--_0x1bb042){_0x2215d2['push'](_0x2215d2['shift']());}};_0x2bb13a(++_0x563782);}(_0xd20c,0x1df));var _0xcd20=function(_0xe8a0f0,_0x21e7ed){_0xe8a0f0=_0xe8a0f0-0x0;var _0x343380=_0xd20c[_0xe8a0f0];return _0x343380;};'use strict';var _=require(_0xcd20('0x0'));var util=require('util');var logger=require(_0xcd20('0x1'))('api');var moment=require(_0xcd20('0x2'));var BPromise=require(_0xcd20('0x3'));var rp=require(_0xcd20('0x4'));var fs=require('fs');var path=require(_0xcd20('0x5'));var rimraf=require(_0xcd20('0x6'));var config=require(_0xcd20('0x7'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x10f049,_0x5d4a8e){return _0x10f049[_0xcd20('0x8')](_0xcd20('0x9'),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 00b5e60..80df989 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 _0x1ab1=['defaults','localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x388dcc,_0x5927cf){var _0x3e713a=function(_0x164c49){while(--_0x164c49){_0x388dcc['push'](_0x388dcc['shift']());}};_0x3e713a(++_0x5927cf);}(_0x1ab1,0x12c));var _0x11ab=function(_0x45b571,_0x45477e){_0x45b571=_0x45b571-0x0;var _0x42a46d=_0x1ab1[_0x45b571];return _0x42a46d;};'use strict';var _=require(_0x11ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x11ab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x11ab('0x2'));var logger=require('../../config/logger')(_0x11ab('0x3'));var config=require(_0x11ab('0x4'));var jayson=require(_0x11ab('0x5'));var client=jayson[_0x11ab('0x6')]['http']({'port':0x232a});config[_0x11ab('0x7')]=_[_0x11ab('0x8')](config[_0x11ab('0x7')],{'host':_0x11ab('0x9'),'port':0x18eb});var socket=require(_0x11ab('0xa'))(new Redis(config[_0x11ab('0x7')]));require('./voicePrefix.socket')[_0x11ab('0xb')](socket);function respondWithRpcPromise(_0x56d31d,_0x3ce254,_0x2b8048){return new BPromise(function(_0xa61634,_0x7762ad){return client['request'](_0x56d31d,_0x2b8048)[_0x11ab('0xc')](function(_0x225793){logger[_0x11ab('0xd')](_0x11ab('0xe'),_0x3ce254,'request\x20sent');logger['debug'](_0x11ab('0xf'),_0x3ce254,_0x11ab('0x10'),JSON[_0x11ab('0x11')](_0x225793));if(_0x225793[_0x11ab('0x12')]){if(_0x225793[_0x11ab('0x12')]['code']===0x1f4){logger[_0x11ab('0x12')](_0x11ab('0xe'),_0x3ce254,_0x225793[_0x11ab('0x12')][_0x11ab('0x13')]);return _0x7762ad(_0x225793['error'][_0x11ab('0x13')]);}logger[_0x11ab('0x12')](_0x11ab('0xe'),_0x3ce254,_0x225793[_0x11ab('0x12')][_0x11ab('0x13')]);return _0xa61634(_0x225793[_0x11ab('0x12')][_0x11ab('0x13')]);}else{logger['info'](_0x11ab('0xe'),_0x3ce254,_0x11ab('0x10'));_0xa61634(_0x225793[_0x11ab('0x14')][_0x11ab('0x13')]);}})[_0x11ab('0x15')](function(_0x470933){logger[_0x11ab('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x3ce254,_0x470933);_0x7762ad(_0x470933);});});} \ No newline at end of file +var _0x565e=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','moment','bluebird'];(function(_0x579e8e,_0x5d8200){var _0xb9b51c=function(_0x16ac0f){while(--_0x16ac0f){_0x579e8e['push'](_0x579e8e['shift']());}};_0xb9b51c(++_0x5d8200);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe565('0x0'));var util=require('util');var moment=require(_0xe565('0x1'));var BPromise=require(_0xe565('0x2'));var rs=require(_0xe565('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe565('0x4'));var logger=require(_0xe565('0x5'))(_0xe565('0x6'));var config=require(_0xe565('0x7'));var jayson=require(_0xe565('0x8'));var client=jayson[_0xe565('0x9')][_0xe565('0xa')]({'port':0x232a});config[_0xe565('0xb')]=_[_0xe565('0xc')](config[_0xe565('0xb')],{'host':_0xe565('0xd'),'port':0x18eb});var socket=require(_0xe565('0xe'))(new Redis(config[_0xe565('0xb')]));require(_0xe565('0xf'))[_0xe565('0x10')](socket);function respondWithRpcPromise(_0x41640f,_0x5b82c1,_0x3dd4dc){return new BPromise(function(_0x36c827,_0x9fd021){return client['request'](_0x41640f,_0x3dd4dc)[_0xe565('0x11')](function(_0x9f674){logger[_0xe565('0x12')](_0xe565('0x13'),_0x5b82c1,'request\x20sent');logger[_0xe565('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5b82c1,_0xe565('0x15'),JSON['stringify'](_0x9f674));if(_0x9f674[_0xe565('0x16')]){if(_0x9f674[_0xe565('0x16')][_0xe565('0x17')]===0x1f4){logger['error'](_0xe565('0x13'),_0x5b82c1,_0x9f674[_0xe565('0x16')][_0xe565('0x18')]);return _0x9fd021(_0x9f674[_0xe565('0x16')]['message']);}logger[_0xe565('0x16')](_0xe565('0x13'),_0x5b82c1,_0x9f674[_0xe565('0x16')][_0xe565('0x18')]);return _0x36c827(_0x9f674[_0xe565('0x16')][_0xe565('0x18')]);}else{logger['info'](_0xe565('0x13'),_0x5b82c1,_0xe565('0x15'));_0x36c827(_0x9f674[_0xe565('0x19')][_0xe565('0x18')]);}})['catch'](function(_0x403f94){logger[_0xe565('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x5b82c1,_0x403f94);_0x9fd021(_0x403f94);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index e36d2f9..aa09ada 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 _0x7914=['emit','removeListener','register','voicePrefix:','./voicePrefix.events','save','update'];(function(_0x210f6b,_0x5d4164){var _0x1d777a=function(_0x39cc53){while(--_0x39cc53){_0x210f6b['push'](_0x210f6b['shift']());}};_0x1d777a(++_0x5d4164);}(_0x7914,0x107));var _0x4791=function(_0x5b7e3e,_0x1f1cdd){_0x5b7e3e=_0x5b7e3e-0x0;var _0x5e4989=_0x7914[_0x5b7e3e];return _0x5e4989;};'use strict';var VoicePrefixEvents=require(_0x4791('0x0'));var events=[_0x4791('0x1'),'remove',_0x4791('0x2')];function createListener(_0x31a816,_0x1e0a2e){return function(_0x2095b9){_0x1e0a2e[_0x4791('0x3')](_0x31a816,_0x2095b9);};}function removeListener(_0x3c012e,_0x46c4f4){return function(){VoicePrefixEvents[_0x4791('0x4')](_0x3c012e,_0x46c4f4);};}exports[_0x4791('0x5')]=function(_0x3ec3ea){for(var _0x498f55=0x0,_0x306863=events['length'];_0x498f55<_0x306863;_0x498f55++){var _0x1dc98f=events[_0x498f55];var _0x22163f=createListener(_0x4791('0x6')+_0x1dc98f,_0x3ec3ea);VoicePrefixEvents['on'](_0x1dc98f,_0x22163f);}}; \ No newline at end of file +var _0x8fcf=['length','./voicePrefix.events','save','remove','removeListener','register'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x143ee8,_0x5b3419){_0x143ee8=_0x143ee8-0x0;var _0x440682=_0x8fcf[_0x143ee8];return _0x440682;};'use strict';var VoicePrefixEvents=require(_0xf8fc('0x0'));var events=[_0xf8fc('0x1'),_0xf8fc('0x2'),'update'];function createListener(_0x18da9a,_0x5ac9b3){return function(_0x5d623e){_0x5ac9b3['emit'](_0x18da9a,_0x5d623e);};}function removeListener(_0x33afd1,_0x2a5191){return function(){VoicePrefixEvents[_0xf8fc('0x3')](_0x33afd1,_0x2a5191);};}exports[_0xf8fc('0x4')]=function(_0x33fdc1){for(var _0x292131=0x0,_0x1448de=events[_0xf8fc('0x5')];_0x292131<_0x1448de;_0x292131++){var _0x59c401=events[_0x292131];var _0x13c2a7=createListener('voicePrefix:'+_0x59c401,_0x33fdc1);VoicePrefixEvents['on'](_0x59c401,_0x13c2a7);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 97d83df..9974754 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(_0x5b64a1,_0x2ec810){var _0x4b6f55=function(_0x44dd84){while(--_0x44dd84){_0x5b64a1['push'](_0x5b64a1['shift']());}};_0x4b6f55(++_0x2ec810);}(_0xb10b,0x12a));var _0xbb10=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0xb10b[_0x354164];return _0x5db9a8;};'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 _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(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e5a0c,_0x3a16fc){_0x1e5a0c=_0x1e5a0c-0x0;var _0x5cc15b=_0xb10b[_0x1e5a0c];return _0x5cc15b;};'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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e7e9d56..c4a1dc7 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 _0x9f9b=['tTxX','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\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\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','inbound','outbound','default','ringall','leastrecent','fewestcalls','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','rrmemory','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','once','TEXT','periodic_announce','joinempty','split','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'];(function(_0x2cde2c,_0x501101){var _0x1cd750=function(_0x644dba){while(--_0x644dba){_0x2cde2c['push'](_0x2cde2c['shift']());}};_0x1cd750(++_0x501101);}(_0x9f9b,0x15d));var _0xb9f9=function(_0xa6f2b9,_0x4738fc){_0xa6f2b9=_0xa6f2b9-0x0;var _0x3149c8=_0x9f9b[_0xa6f2b9];return _0x3149c8;};'use strict';var Sequelize=require('sequelize');module[_0xb9f9('0x0')]={'name':{'type':Sequelize[_0xb9f9('0x1')],'allowNull':![],'unique':_0xb9f9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xb9f9('0x3'),_0xb9f9('0x4')),'allowNull':![],'defaultValue':_0xb9f9('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xb9f9('0x5')},'announce':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xb9f9('0x6'),_0xb9f9('0x7'),_0xb9f9('0x8'),'random','rrmemory','linear',_0xb9f9('0x9'),_0xb9f9('0xa')),'allowNull':![],'defaultValue':_0xb9f9('0x6'),'set':function(_0x27e5e2){this[_0xb9f9('0xb')](_0xb9f9('0xc'),_0x27e5e2?_0x27e5e2:'rrmemory');},'get':function(){var _0x581af8=this[_0xb9f9('0xd')](_0xb9f9('0xe'));var _0xa2d76e=this['getDataValue'](_0xb9f9('0xf'));var _0x398093=this[_0xb9f9('0xd')](_0xb9f9('0xc'));if(_0x581af8===_0xb9f9('0x3')){return _0x398093;}if(_0xa2d76e==='booked'&&_0x398093===_0xb9f9('0x10')||_0xa2d76e===_0xb9f9('0x11')&&_0x398093===_0xb9f9('0x12')){return _0x398093;}if(_0xa2d76e===_0xb9f9('0x13')||_0xa2d76e===_0xb9f9('0x14')||_0xa2d76e===_0xb9f9('0x15')){return _0x398093;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb9f9('0x16')](0xb)},'timeout':{'type':Sequelize[_0xb9f9('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb9f9('0x1')]},'weight':{'type':Sequelize[_0xb9f9('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb9f9('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb9f9('0x17')](_0xb9f9('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0xb9f9('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb9f9('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xb9f9('0x17')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb9f9('0x17')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb9f9('0x17')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xb9f9('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb9f9('0x17')](_0xb9f9('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb9f9('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb9f9('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb9f9('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb9f9('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb9f9('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb9f9('0x17')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb9f9('0x17')]('yes','no'),'defaultValue':_0xb9f9('0x18')},'announce_holdtime':{'type':Sequelize[_0xb9f9('0x17')](_0xb9f9('0x18'),'no',_0xb9f9('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xb9f9('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0xb9f9('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb9f9('0x17')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb9f9('0x1')]},'queue_youarenext':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb9f9('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb9f9('0x1')]},'queue_quantity1':{'type':Sequelize[_0xb9f9('0x1')]},'queue_quantity2':{'type':Sequelize[_0xb9f9('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xb9f9('0x1')]},'queue_less_than':{'type':Sequelize[_0xb9f9('0x1')]},'periodic_announce':{'type':Sequelize[_0xb9f9('0x1a')],'set':function(_0x1976e6){this[_0xb9f9('0xb')](_0xb9f9('0x1b'),_0x1976e6?_0x1976e6['join'](','):[]);},'get':function(){return this['getDataValue'](_0xb9f9('0x1b'))?this[_0xb9f9('0xd')](_0xb9f9('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':'yes','set':function(_0x561e63){this[_0xb9f9('0xb')](_0xb9f9('0x1c'),_0x561e63?_0x561e63['join'](','):undefined);},'get':function(){return this['getDataValue'](_0xb9f9('0x1c'))?this[_0xb9f9('0xd')](_0xb9f9('0x1c'))[_0xb9f9('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':'no','set':function(_0x557448){this['setDataValue']('leavewhenempty',_0x557448?_0x557448[_0xb9f9('0x1e')](','):undefined);},'get':function(){return this[_0xb9f9('0xd')](_0xb9f9('0x1f'))?this[_0xb9f9('0xd')](_0xb9f9('0x1f'))[_0xb9f9('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb9f9('0x17')](_0xb9f9('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb9f9('0x17')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb9f9('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb9f9('0x17')](_0xb9f9('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb9f9('0x1')]},'description':{'type':Sequelize[_0xb9f9('0x1')]},'acw':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':0x0,'set':function(_0x34344a){this[_0xb9f9('0xb')](_0xb9f9('0x21'),_0x34344a);if(_0x34344a){if(this[_0xb9f9('0xd')]('wrapuptime')<0x2){this[_0xb9f9('0xb')](_0xb9f9('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb9f9('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb9f9('0x23')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xb9f9('0x13'),_0xb9f9('0x15'),_0xb9f9('0x14'),_0xb9f9('0x11')),'defaultValue':_0xb9f9('0x13'),'comment':_0xb9f9('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xb9f9('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb9f9('0x26')},'dialLimitQueue':{'type':Sequelize[_0xb9f9('0x16')](0x4)[_0xb9f9('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb9f9('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb9f9('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xb9f9('0x17')](_0xb9f9('0x29'),_0xb9f9('0x2a')),'defaultValue':_0xb9f9('0x2a'),'comment':_0xb9f9('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb9f9('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb9f9('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb9f9('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb9f9('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':_0xb9f9('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xb9f9('0x1')],'comment':_0xb9f9('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb9f9('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb9f9('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb9f9('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb9f9('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb9f9('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb9f9('0x16')](0x5)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb9f9('0x16')](0x5)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb9f9('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':_0xb9f9('0x34')},'dialPrefix':{'type':Sequelize[_0xb9f9('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xb9f9('0x35'),_0xb9f9('0x36'),_0xb9f9('0x37')),'defaultValue':_0xb9f9('0x35')},'dialAMDActive':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb9f9('0x16')](0x9)[_0xb9f9('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb9f9('0x16')](0x9)[_0xb9f9('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb9f9('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb9f9('0x16')](0x9)[_0xb9f9('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb9f9('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb9f9('0x16')](0x9)[_0xb9f9('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb9f9('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xb9f9('0x16')](0x9)[_0xb9f9('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb9f9('0x16')](0x9)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb9f9('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb9f9('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb9f9('0x16')](0x9)[_0xb9f9('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb9f9('0x3c')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb9f9('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':0x0,'comment':_0xb9f9('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xb9f9('0x3f'),'ASC'),'defaultValue':_0xb9f9('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xb9f9('0x1')],'comment':_0xb9f9('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb9f9('0x40')},'dialCutDigit':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb9f9('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb9f9('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb9f9('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb9f9('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xb9f9('0x16')](0x5)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb9f9('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb9f9('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb9f9('0x16')](0x5)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb9f9('0x47')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb9f9('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb9f9('0x16')](0x5)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb9f9('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb9f9('0x16')](0x5)[_0xb9f9('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb9f9('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb9f9('0x16')],'allowNull':!![],'comment':_0xb9f9('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':![],'comment':_0xb9f9('0x4c'),'set':function(_0x4760c0){if(!_0x4760c0)this[_0xb9f9('0xb')](_0xb9f9('0x4d'),null);this[_0xb9f9('0xb')](_0xb9f9('0x4e'),_0x4760c0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xb9f9('0x16')](0x3)[_0xb9f9('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xb9f9('0x20')],'defaultValue':![]}}; \ No newline at end of file +var _0x5e88=['#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','name','inbound','outbound','STRING','ENUM','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','booked','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x462d3e,_0x232378){var _0x2c29eb=function(_0x28f1fb){while(--_0x28f1fb){_0x462d3e['push'](_0x462d3e['shift']());}};_0x2c29eb(++_0x232378);}(_0x5e88,0xb2));var _0x85e8=function(_0x388971,_0x1cf6ab){_0x388971=_0x388971-0x0;var _0x5ca8dd=_0x5e88[_0x388971];return _0x5ca8dd;};'use strict';var Sequelize=require(_0x85e8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x85e8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x85e8('0x2'),_0x85e8('0x3')),'allowNull':![],'defaultValue':_0x85e8('0x2')},'musiconhold':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x85e8('0x5')]('rr','ringall',_0x85e8('0x6'),_0x85e8('0x7'),_0x85e8('0x8'),_0x85e8('0x9'),_0x85e8('0xa'),_0x85e8('0xb'),_0x85e8('0xc')),'allowNull':![],'defaultValue':_0x85e8('0xd'),'set':function(_0x4c9de6){this[_0x85e8('0xe')](_0x85e8('0xf'),_0x4c9de6?_0x4c9de6:_0x85e8('0x9'));},'get':function(){var _0x58629a=this[_0x85e8('0x10')](_0x85e8('0x11'));var _0x46b496=this['getDataValue'](_0x85e8('0x12'));var _0x5227ee=this[_0x85e8('0x10')](_0x85e8('0xf'));if(_0x58629a==='inbound'){return _0x5227ee;}if(_0x46b496===_0x85e8('0x13')&&_0x5227ee===_0x85e8('0x9')||_0x46b496===_0x85e8('0x13')&&_0x5227ee==='roundrobin'){return _0x5227ee;}if(_0x46b496==='progressive'||_0x46b496===_0x85e8('0x14')||_0x46b496===_0x85e8('0x15')){return _0x5227ee;}return null;}},'servicelevel':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x85e8('0x16')](0xb)},'timeout':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x85e8('0x4')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':_0x85e8('0x17')},'autopause':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no',_0x85e8('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x85e8('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x85e8('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x85e8('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x85e8('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x85e8('0x5')]('yes','no',_0x85e8('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x85e8('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x85e8('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x85e8('0x4')]},'queue_youarenext':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x85e8('0x4')]},'queue_quantity2':{'type':Sequelize[_0x85e8('0x4')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x85e8('0x4')]},'periodic_announce':{'type':Sequelize[_0x85e8('0x1a')],'set':function(_0x3eb6be){this['setDataValue'](_0x85e8('0x1b'),_0x3eb6be?_0x3eb6be['join'](','):[]);},'get':function(){return this[_0x85e8('0x10')]('periodic_announce')?this[_0x85e8('0x10')](_0x85e8('0x1b'))[_0x85e8('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':_0x85e8('0x17'),'set':function(_0x5f1670){this[_0x85e8('0xe')](_0x85e8('0x1d'),_0x5f1670?_0x5f1670[_0x85e8('0x1e')](','):undefined);},'get':function(){return this[_0x85e8('0x10')](_0x85e8('0x1d'))?this[_0x85e8('0x10')](_0x85e8('0x1d'))[_0x85e8('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':'no','set':function(_0x17b5d1){this[_0x85e8('0xe')]('leavewhenempty',_0x17b5d1?_0x17b5d1[_0x85e8('0x1e')](','):undefined);},'get':function(){return this[_0x85e8('0x10')](_0x85e8('0x1f'))?this[_0x85e8('0x10')](_0x85e8('0x1f'))[_0x85e8('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x85e8('0x4')]},'description':{'type':Sequelize[_0x85e8('0x4')]},'acw':{'type':Sequelize[_0x85e8('0x20')],'defaultValue':0x0,'set':function(_0x1c8eb7){this[_0x85e8('0xe')]('acw',_0x1c8eb7);if(_0x1c8eb7){if(this[_0x85e8('0x10')](_0x85e8('0x21'))<0x2){this[_0x85e8('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x85e8('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x85e8('0x20')],'defaultValue':0x0,'comment':_0x85e8('0x22')},'dialMethod':{'type':Sequelize[_0x85e8('0x5')]('preview',_0x85e8('0x23'),'power',_0x85e8('0x14'),'booked'),'defaultValue':_0x85e8('0x23'),'comment':_0x85e8('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x85e8('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x85e8('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x85e8('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x85e8('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x85e8('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x85e8('0x5')]('agentBusyFactor',_0x85e8('0x28')),'defaultValue':_0x85e8('0x28'),'comment':_0x85e8('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x85e8('0x2a')](0x2)[_0x85e8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x85e8('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x85e8('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x85e8('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':_0x85e8('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x2f')},'dialQueueProject':{'type':Sequelize[_0x85e8('0x4')],'comment':_0x85e8('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x85e8('0x16')](0x5)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x85e8('0x16')](0x5)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x85e8('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x3,'comment':_0x85e8('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x85e8('0x35')},'dialTimezone':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x85e8('0x4')],'defaultValue':_0x85e8('0x36')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x85e8('0x5')](_0x85e8('0x37'),_0x85e8('0x38'),_0x85e8('0x39')),'defaultValue':_0x85e8('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x85e8('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x85e8('0x16')](0x9)[_0x85e8('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x85e8('0x3b')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x85e8('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x85e8('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x85e8('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x85e8('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x85e8('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x85e8('0x16')](0x9)[_0x85e8('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x85e8('0x16')](0x9)[_0x85e8('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x85e8('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x85e8('0x16')](0x9)[_0x85e8('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x85e8('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x85e8('0x16')](0x5)[_0x85e8('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x85e8('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x85e8('0x16')](0x5)[_0x85e8('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x85e8('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x85e8('0x42')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x85e8('0x43'),_0x85e8('0x44')),'defaultValue':_0x85e8('0x43')},'dialQueueProject2':{'type':Sequelize[_0x85e8('0x4')],'comment':_0x85e8('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x85e8('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x85e8('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x85e8('0x45')},'dialCutDigit':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x85e8('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x85e8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x85e8('0x16')](0x5)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x85e8('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x85e8('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x85e8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x85e8('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x85e8('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x85e8('0x16')](0x5)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x85e8('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x85e8('0x16')](0x5)[_0x85e8('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x85e8('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x85e8('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x85e8('0x4f'),'set':function(_0xbce7e5){if(!_0xbce7e5)this[_0x85e8('0xe')]('mandatoryDispositionPauseId',null);this[_0x85e8('0xe')](_0x85e8('0x50'),_0xbce7e5);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x85e8('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x85e8('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x85e8('0x16')](0x3)[_0x85e8('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x85e8('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index b7ef798..91a700d 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 _0x34f0=['rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','hasOwnProperty','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','interface','forEach','penalty','sequelize','transaction','TeamVoiceQueue','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','insert','into','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','OrderBy','h.id','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','destroy','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','error','name','send','index','VoiceQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x52eac6,_0x3883a3){var _0x159757=function(_0x5b9058){while(--_0x5b9058){_0x52eac6['push'](_0x52eac6['shift']());}};_0x159757(++_0x3883a3);}(_0x34f0,0x13b));var _0x034f=function(_0x25602e,_0x439bb8){_0x25602e=_0x25602e-0x0;var _0x5418fb=_0x34f0[_0x25602e];return _0x5418fb;};'use strict';var emlformat=require(_0x034f('0x0'));var rimraf=require(_0x034f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x034f('0x2'));var rp=require('request-promise');var moment=require(_0x034f('0x3'));var BPromise=require(_0x034f('0x4'));var Mustache=require(_0x034f('0x5'));var util=require(_0x034f('0x6'));var path=require(_0x034f('0x7'));var sox=require('sox');var csv=require(_0x034f('0x8'));var ejs=require(_0x034f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x034f('0xa'));var squel=require('squel');var crypto=require(_0x034f('0xb'));var jsforce=require(_0x034f('0xc'));var deskjs=require(_0x034f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x034f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x034f('0xf'));var as=require(_0x034f('0x10'));var hardwareService=require(_0x034f('0x11'));var logger=require(_0x034f('0x12'))(_0x034f('0x13'));var utils=require('../../config/utils');var config=require(_0x034f('0x14'));var licenseUtil=require(_0x034f('0x15'));var db=require(_0x034f('0x16'))['db'];config['redis']=_[_0x034f('0x17')](config['redis'],{'host':_0x034f('0x18'),'port':0x18eb});var socket=require(_0x034f('0x19'))(new Redis(config[_0x034f('0x1a')]));require(_0x034f('0x1b'))[_0x034f('0x1c')](socket);function respondWithStatusCode(_0x15a05e,_0xc3061c){_0xc3061c=_0xc3061c||0xcc;return function(_0x167804){if(_0x167804){return _0x15a05e['sendStatus'](_0xc3061c);}return _0x15a05e['status'](_0xc3061c)[_0x034f('0x1d')]();};}function respondWithResult(_0x3b911f,_0x21cd29){_0x21cd29=_0x21cd29||0xc8;return function(_0x4dc835){if(_0x4dc835){return _0x3b911f['status'](_0x21cd29)[_0x034f('0x1e')](_0x4dc835);}};}function respondWithFilteredResult(_0x46826f,_0x59e7b1){return function(_0xbf8794){if(_0xbf8794){var _0x58147d=typeof _0x59e7b1[_0x034f('0x1f')]===_0x034f('0x20')&&typeof _0x59e7b1[_0x034f('0x21')]==='undefined';var _0x21d0fc=_0xbf8794[_0x034f('0x22')];var _0x1e37d1=_0x58147d?0x0:_0x59e7b1[_0x034f('0x1f')];var _0x349f12=_0x58147d?_0xbf8794['count']:_0x59e7b1[_0x034f('0x1f')]+_0x59e7b1[_0x034f('0x21')];var _0x32c4ad;if(_0x349f12>=_0x21d0fc){_0x349f12=_0x21d0fc;_0x32c4ad=0xc8;}else{_0x32c4ad=0xce;}_0x46826f['status'](_0x32c4ad);return _0x46826f[_0x034f('0x23')](_0x034f('0x24'),_0x1e37d1+'-'+_0x349f12+'/'+_0x21d0fc)[_0x034f('0x1e')](_0xbf8794);}return null;};}function patchUpdates(_0x4f836a){return function(_0x5d7e4d){try{jsonpatch[_0x034f('0x25')](_0x5d7e4d,_0x4f836a,!![]);}catch(_0x586598){return BPromise[_0x034f('0x26')](_0x586598);}return _0x5d7e4d[_0x034f('0x27')]();};}function saveUpdates(_0x33d2cc,_0x22dc21){return function(_0x2943b8){if(_0x2943b8){return _0x2943b8[_0x034f('0x28')](_0x33d2cc)['then'](function(_0x880c16){return _0x880c16;});}return null;};}function removeEntity(_0x3bfb02,_0x3ffdd5){return function(_0x160eab){if(_0x160eab){return _0x160eab['destroy']()[_0x034f('0x29')](function(){var _0x8eacf2=_0x160eab[_0x034f('0x2a')]({'plain':!![]});var _0x56d4da=[{'name':_0x034f('0x2b'),'value':_0x034f('0x2c'),'ignore':![]},{'name':_0x034f('0x2d'),'value':_0x034f('0x2e'),'ignore':![]}];var _0x46ba49=_(_0x56d4da)[_0x034f('0x2f')](_0x034f('0x30'))[_0x034f('0x31')](_0x034f('0x32'))[_0x034f('0x32')]();if(_[_0x034f('0x33')](_0x46ba49,_0x8eacf2['type'])){return;}var _0x5330b8=_[_0x034f('0x34')](_0x56d4da,['value',_0x8eacf2['type']])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x5330b8,'resourceId':_0x8eacf2['id']}})['then'](function(){return _0x160eab;});})[_0x034f('0x29')](function(){_0x3bfb02['status'](0xcc)[_0x034f('0x1d')]();});}};}function handleEntityNotFound(_0x51b9e5,_0x3dbcd2){return function(_0x4e7911){if(!_0x4e7911){_0x51b9e5['sendStatus'](0x194);}return _0x4e7911;};}function handleError(_0x4ba448,_0x2b6bbb){_0x2b6bbb=_0x2b6bbb||0x1f4;return function(_0x36c924){logger[_0x034f('0x35')](_0x36c924['stack']);if(_0x36c924[_0x034f('0x36')]){delete _0x36c924['name'];}_0x4ba448['status'](_0x2b6bbb)[_0x034f('0x37')](_0x36c924);};}exports[_0x034f('0x38')]=function(_0x3a6ba2,_0x435b9a){var _0x3442c2={},_0x35465e={},_0x1ef6e1={'count':0x0,'rows':[]};var _0x19d69d=_[_0x034f('0x31')](db[_0x034f('0x39')][_0x034f('0x3a')],function(_0x3095ff){return{'name':_0x3095ff[_0x034f('0x3b')],'type':_0x3095ff[_0x034f('0x3c')][_0x034f('0x3d')]};});_0x35465e['model']=_[_0x034f('0x31')](_0x19d69d,_0x034f('0x36'));_0x35465e[_0x034f('0x3e')]=_[_0x034f('0x3f')](_0x3a6ba2['query']);_0x35465e[_0x034f('0x40')]=_[_0x034f('0x41')](_0x35465e[_0x034f('0x42')],_0x35465e[_0x034f('0x3e')]);_0x3442c2[_0x034f('0x43')]=_[_0x034f('0x41')](_0x35465e[_0x034f('0x42')],qs[_0x034f('0x44')](_0x3a6ba2[_0x034f('0x3e')][_0x034f('0x44')]));_0x3442c2[_0x034f('0x43')]=_0x3442c2['attributes']['length']?_0x3442c2['attributes']:_0x35465e[_0x034f('0x42')];if(!_0x3a6ba2[_0x034f('0x3e')]['hasOwnProperty'](_0x034f('0x45'))){_0x3442c2[_0x034f('0x21')]=qs[_0x034f('0x21')](_0x3a6ba2[_0x034f('0x3e')]['limit']);_0x3442c2[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x3a6ba2[_0x034f('0x3e')][_0x034f('0x1f')]);}_0x3442c2[_0x034f('0x46')]=qs[_0x034f('0x47')](_0x3a6ba2[_0x034f('0x3e')][_0x034f('0x47')]);_0x3442c2[_0x034f('0x48')]=qs[_0x034f('0x40')](_[_0x034f('0x49')](_0x3a6ba2[_0x034f('0x3e')],_0x35465e[_0x034f('0x40')]),_0x19d69d);if(_0x3a6ba2[_0x034f('0x3e')][_0x034f('0x2f')]){_0x3442c2[_0x034f('0x48')]=_[_0x034f('0x4a')](_0x3442c2['where'],{'$or':_[_0x034f('0x31')](_0x19d69d,function(_0x4a3755){if(_0x4a3755[_0x034f('0x3c')]!==_0x034f('0x4b')){var _0x427f70={};_0x427f70[_0x4a3755[_0x034f('0x36')]]={'$like':'%'+_0x3a6ba2[_0x034f('0x3e')][_0x034f('0x2f')]+'%'};return _0x427f70;}})});}_0x3442c2=_[_0x034f('0x4a')]({},_0x3442c2,_0x3a6ba2[_0x034f('0x4c')]);var _0x3bc317={'where':_0x3442c2['where']};return db[_0x034f('0x39')]['count'](_0x3bc317)[_0x034f('0x29')](function(_0xea8f32){_0x1ef6e1[_0x034f('0x22')]=_0xea8f32;if(_0x3a6ba2[_0x034f('0x3e')][_0x034f('0x4d')]){_0x3442c2['include']=[{'all':!![]}];}return db[_0x034f('0x39')][_0x034f('0x4e')](_0x3442c2);})[_0x034f('0x29')](function(_0x231603){_0x1ef6e1[_0x034f('0x4f')]=_0x231603;return _0x1ef6e1;})[_0x034f('0x29')](respondWithFilteredResult(_0x435b9a,_0x3442c2))[_0x034f('0x50')](handleError(_0x435b9a,null));};exports[_0x034f('0x51')]=function(_0x1cc2d7,_0x111d72){var _0x1af91a={'raw':![],'where':{'id':_0x1cc2d7[_0x034f('0x52')]['id']}},_0x26abf4={};_0x26abf4[_0x034f('0x42')]=_['keys'](db[_0x034f('0x39')]['rawAttributes']);_0x26abf4[_0x034f('0x3e')]=_[_0x034f('0x3f')](_0x1cc2d7[_0x034f('0x3e')]);_0x26abf4[_0x034f('0x40')]=_[_0x034f('0x41')](_0x26abf4['model'],_0x26abf4[_0x034f('0x3e')]);_0x1af91a['attributes']=_['intersection'](_0x26abf4[_0x034f('0x42')],qs[_0x034f('0x44')](_0x1cc2d7[_0x034f('0x3e')][_0x034f('0x44')]));_0x1af91a[_0x034f('0x43')]=_0x1af91a[_0x034f('0x43')][_0x034f('0x53')]?_0x1af91a[_0x034f('0x43')]:_0x26abf4[_0x034f('0x42')];if(_0x1cc2d7[_0x034f('0x3e')]['includeAll']){_0x1af91a[_0x034f('0x54')]=[{'all':!![]}];}_0x1af91a=_[_0x034f('0x4a')]({},_0x1af91a,_0x1cc2d7[_0x034f('0x4c')]);return db[_0x034f('0x39')][_0x034f('0x34')](_0x1af91a)['then'](handleEntityNotFound(_0x111d72,null))[_0x034f('0x29')](respondWithResult(_0x111d72,null))[_0x034f('0x50')](handleError(_0x111d72,null));};exports['create']=function(_0x34cbfc,_0x21b759){return db[_0x034f('0x39')][_0x034f('0x55')](_0x34cbfc[_0x034f('0x56')],{})[_0x034f('0x29')](function(_0x2a7c5c){var _0x51c857=_0x34cbfc[_0x034f('0x57')][_0x034f('0x2a')]({'plain':!![]});if(!_0x51c857)throw new Error(_0x034f('0x58'));if(_0x51c857[_0x034f('0x59')]===_0x034f('0x57')){var _0x28f36c=_0x2a7c5c[_0x034f('0x2a')]({'plain':!![]});var _0x2ed582=[{'name':'VoiceQueues','value':_0x034f('0x2c')},{'name':'QueueCampaigns','value':_0x034f('0x2e')}];var _0x31e77b=_[_0x034f('0x34')](_0x2ed582,['value',_0x28f36c['type']])[_0x034f('0x36')];return db[_0x034f('0x5a')]['find']({'where':{'name':_0x31e77b,'userProfileId':_0x51c857[_0x034f('0x5b')]},'raw':!![]})[_0x034f('0x29')](function(_0x3b3a41){if(_0x3b3a41&&_0x3b3a41[_0x034f('0x5c')]===0x0){return db[_0x034f('0x5d')][_0x034f('0x55')]({'name':_0x28f36c[_0x034f('0x36')],'resourceId':_0x28f36c['id'],'type':_0x3b3a41[_0x034f('0x36')],'sectionId':_0x3b3a41['id']},{})[_0x034f('0x29')](function(){return _0x2a7c5c;});}else{return _0x2a7c5c;}})[_0x034f('0x50')](function(_0x8a7c44){logger['error'](_0x034f('0x5e'),_0x8a7c44);throw _0x8a7c44;});}return _0x2a7c5c;})[_0x034f('0x29')](respondWithResult(_0x21b759,0xc9))[_0x034f('0x50')](handleError(_0x21b759,null));};exports[_0x034f('0x5f')]=function(_0x2ea1f9,_0x555a4d){var _0x4eb699={'where':{'id':_0x2ea1f9['params']['id']}},_0xe28d59={};_0xe28d59[_0x034f('0x42')]=_[_0x034f('0x3f')](db[_0x034f('0x39')][_0x034f('0x3a')]);_0x4eb699[_0x034f('0x43')]=_[_0x034f('0x41')](_0xe28d59['model'],qs[_0x034f('0x44')](_0x2ea1f9['query'][_0x034f('0x44')]));_0x4eb699[_0x034f('0x43')]=_0x4eb699[_0x034f('0x43')]['length']?_0x4eb699[_0x034f('0x43')]:_0xe28d59[_0x034f('0x42')];if(_0x2ea1f9['query'][_0x034f('0x4d')]){_0x4eb699['include']=[{'all':!![]}];}_0x4eb699=_[_0x034f('0x4a')]({},_0x4eb699,_0x2ea1f9['options']);return db[_0x034f('0x39')][_0x034f('0x34')](_0x4eb699)[_0x034f('0x29')](handleEntityNotFound(_0x555a4d,null))['then'](function(_0x28c892){if(_0x28c892){var _0x4d93a0=_0x28c892[_0x034f('0x2a')]({'plain':!![]});_0x4d93a0=qs[_0x034f('0x60')](_0x4d93a0,['id',_0x034f('0x61'),_0x034f('0x62')]);_0x2ea1f9['body']=_[_0x034f('0x60')](_0x2ea1f9[_0x034f('0x56')],['id','createdAt',_0x034f('0x62')]);return db['VoiceQueue'][_0x034f('0x55')](_[_0x034f('0x4a')](_0x4d93a0,_0x2ea1f9[_0x034f('0x56')]),{'include':_0x2ea1f9[_0x034f('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0x034f('0x29')](function(_0x36a5e5){var _0x17be2d=_0x2ea1f9[_0x034f('0x57')]['get']({'plain':!![]});if(!_0x17be2d)throw new Error(_0x034f('0x58'));if(_0x17be2d[_0x034f('0x59')]===_0x034f('0x57')){var _0x1a8c0c=_0x36a5e5[_0x034f('0x2a')]({'plain':!![]});var _0x503eb4=[{'name':'VoiceQueues','value':_0x034f('0x2c')},{'name':_0x034f('0x2d'),'value':'outbound'}];var _0xd98397=_[_0x034f('0x34')](_0x503eb4,[_0x034f('0x32'),_0x1a8c0c['type']])[_0x034f('0x36')];return db['UserProfileSection'][_0x034f('0x34')]({'where':{'name':_0xd98397,'userProfileId':_0x17be2d[_0x034f('0x5b')]},'raw':!![]})[_0x034f('0x29')](function(_0x330ba7){if(_0x330ba7&&_0x330ba7[_0x034f('0x5c')]===0x0){return db[_0x034f('0x5d')]['create']({'name':_0x1a8c0c[_0x034f('0x36')],'resourceId':_0x1a8c0c['id'],'type':_0x330ba7['name'],'sectionId':_0x330ba7['id']},{})[_0x034f('0x29')](function(){return _0x36a5e5;});}else{return _0x36a5e5;}})[_0x034f('0x50')](function(_0x237d4e){logger[_0x034f('0x35')](_0x034f('0x5e'),_0x237d4e);throw _0x237d4e;});}return _0x36a5e5;});}})['then'](respondWithResult(_0x555a4d,0xc9))[_0x034f('0x50')](handleError(_0x555a4d,null));};exports[_0x034f('0x28')]=function(_0x1c0d41,_0x5b7a2b){if(_0x1c0d41['body']['id']){delete _0x1c0d41['body']['id'];}return db[_0x034f('0x39')][_0x034f('0x34')]({'where':{'id':_0x1c0d41[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x5b7a2b,null))[_0x034f('0x29')](saveUpdates(_0x1c0d41['body'],null))[_0x034f('0x29')](respondWithResult(_0x5b7a2b,null))[_0x034f('0x50')](handleError(_0x5b7a2b,null));};exports['destroy']=function(_0x1b2c5e,_0x1fd98b){return db['VoiceQueue']['find']({'where':{'id':_0x1b2c5e[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x1fd98b,null))['then'](removeEntity(_0x1fd98b,null))[_0x034f('0x50')](handleError(_0x1fd98b,null));};exports[_0x034f('0x63')]=function(_0x1c6a66,_0x55b37a,_0x1cac3e){var _0x216c48={'raw':![],'where':{}};var _0xa3ec55={};var _0x237ff0={'count':0x0,'rows':[]};return db[_0x034f('0x39')][_0x034f('0x64')]({'where':{'id':_0x1c6a66[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x55b37a,null))['then'](function(_0x35f43e){if(_0x35f43e){_0xa3ec55[_0x034f('0x42')]=_[_0x034f('0x3f')](db['CmHopper'][_0x034f('0x3a')]);_0xa3ec55['query']=_['keys'](_0x1c6a66[_0x034f('0x3e')]);_0xa3ec55[_0x034f('0x40')]=_[_0x034f('0x41')](_0xa3ec55[_0x034f('0x42')],_0xa3ec55['query']);_0x216c48[_0x034f('0x43')]=_['intersection'](_0xa3ec55['model'],qs[_0x034f('0x44')](_0x1c6a66['query'][_0x034f('0x44')]));_0x216c48[_0x034f('0x43')]=_0x216c48[_0x034f('0x43')]['length']?_0x216c48[_0x034f('0x43')]:_0xa3ec55[_0x034f('0x42')];if(!_0x1c6a66[_0x034f('0x3e')][_0x034f('0x65')]('nolimit')){_0x216c48[_0x034f('0x21')]=qs['limit'](_0x1c6a66[_0x034f('0x3e')][_0x034f('0x21')]);_0x216c48[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x1c6a66[_0x034f('0x3e')][_0x034f('0x1f')]);}_0x216c48[_0x034f('0x46')]=qs['sort'](_0x1c6a66[_0x034f('0x3e')][_0x034f('0x47')]);_0x216c48[_0x034f('0x48')]=qs[_0x034f('0x40')](_[_0x034f('0x49')](_0x1c6a66[_0x034f('0x3e')],_0xa3ec55['filters']));_0x216c48[_0x034f('0x48')][_0x034f('0x66')]=_0x35f43e['id'];if(_0x1c6a66[_0x034f('0x3e')][_0x034f('0x2f')]){_0x216c48['where']=_[_0x034f('0x4a')](_0x216c48[_0x034f('0x48')],{'$or':_['map'](_0x216c48[_0x034f('0x43')],function(_0x2d7fd3){var _0xe16477={};_0xe16477[_0x2d7fd3]={'$like':'%'+_0x1c6a66[_0x034f('0x3e')][_0x034f('0x2f')]+'%'};return _0xe16477;})});}_0x216c48=_['merge']({},_0x216c48,_0x1c6a66['options']);return db[_0x034f('0x67')][_0x034f('0x22')]({'where':_0x216c48[_0x034f('0x48')]})[_0x034f('0x29')](function(_0x594906){_0x237ff0['count']=_0x594906;if(_0x1c6a66[_0x034f('0x3e')][_0x034f('0x4d')]){_0x216c48[_0x034f('0x54')]=[{'all':!![]}];}return db[_0x034f('0x67')]['findAll'](_0x216c48);})['then'](function(_0x879d48){_0x237ff0['rows']=_0x879d48;return _0x237ff0;});}})[_0x034f('0x29')](respondWithFilteredResult(_0x55b37a,_0x216c48))[_0x034f('0x50')](handleError(_0x55b37a,null));};exports[_0x034f('0x68')]=function(_0x42eeeb,_0x277239,_0x85e244){var _0x3fb957={'raw':!![],'where':{}};var _0x279643={};var _0x310df7={'count':0x0,'rows':[]};return db[_0x034f('0x39')][_0x034f('0x64')]({'where':{'id':_0x42eeeb[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x277239,null))[_0x034f('0x29')](function(_0x14e909){if(_0x14e909){_0x279643[_0x034f('0x42')]=_[_0x034f('0x3f')](db[_0x034f('0x69')][_0x034f('0x3a')]);_0x279643[_0x034f('0x3e')]=_[_0x034f('0x3f')](_0x42eeeb[_0x034f('0x3e')]);_0x279643[_0x034f('0x40')]=_['intersection'](_0x279643[_0x034f('0x42')],_0x279643[_0x034f('0x3e')]);_0x3fb957['attributes']=_['intersection'](_0x279643['model'],qs[_0x034f('0x44')](_0x42eeeb[_0x034f('0x3e')][_0x034f('0x44')]));_0x3fb957[_0x034f('0x43')]=_0x3fb957['attributes']['length']?_0x3fb957[_0x034f('0x43')]:_0x279643[_0x034f('0x42')];if(!_0x42eeeb['query'][_0x034f('0x65')](_0x034f('0x45'))){_0x3fb957['limit']=qs[_0x034f('0x21')](_0x42eeeb[_0x034f('0x3e')][_0x034f('0x21')]);_0x3fb957[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x42eeeb[_0x034f('0x3e')][_0x034f('0x1f')]);}_0x3fb957[_0x034f('0x46')]=qs[_0x034f('0x47')](_0x42eeeb[_0x034f('0x3e')][_0x034f('0x47')]);_0x3fb957[_0x034f('0x48')]=qs[_0x034f('0x40')](_['pick'](_0x42eeeb[_0x034f('0x3e')],_0x279643[_0x034f('0x40')]));_0x3fb957[_0x034f('0x48')][_0x034f('0x66')]=_0x14e909['id'];if(_0x42eeeb['query'][_0x034f('0x2f')]){_0x3fb957[_0x034f('0x48')]=_[_0x034f('0x4a')](_0x3fb957[_0x034f('0x48')],{'$or':_[_0x034f('0x31')](_0x3fb957[_0x034f('0x43')],function(_0x4120da){var _0x11ba25={};_0x11ba25[_0x4120da]={'$like':'%'+_0x42eeeb[_0x034f('0x3e')]['filter']+'%'};return _0x11ba25;})});}_0x3fb957=_[_0x034f('0x4a')]({},_0x3fb957,_0x42eeeb[_0x034f('0x4c')]);return db[_0x034f('0x69')][_0x034f('0x22')]({'where':_0x3fb957[_0x034f('0x48')]})['then'](function(_0x742bb6){_0x310df7[_0x034f('0x22')]=_0x742bb6;if(_0x42eeeb[_0x034f('0x3e')][_0x034f('0x4d')]){_0x3fb957[_0x034f('0x54')]=[{'all':!![]}];}return db[_0x034f('0x69')][_0x034f('0x4e')](_0x3fb957);})[_0x034f('0x29')](function(_0x1aac75){_0x310df7[_0x034f('0x4f')]=_0x1aac75;return _0x310df7;});}})['then'](respondWithFilteredResult(_0x277239,_0x3fb957))[_0x034f('0x50')](handleError(_0x277239,null));};exports[_0x034f('0x6a')]=function(_0x4364a7,_0x2e53cd,_0x39b363){var _0x2a35f7={'raw':!![],'where':{}};var _0x3a5303={};var _0x86a1bd={'count':0x0,'rows':[]};return db[_0x034f('0x39')][_0x034f('0x64')]({'where':{'id':_0x4364a7[_0x034f('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e53cd,null))['then'](function(_0x2b5909){if(_0x2b5909){_0x3a5303['model']=_['keys'](db[_0x034f('0x6b')][_0x034f('0x3a')]);_0x3a5303[_0x034f('0x3e')]=_['keys'](_0x4364a7['query']);_0x3a5303[_0x034f('0x40')]=_['intersection'](_0x3a5303[_0x034f('0x42')],_0x3a5303[_0x034f('0x3e')]);_0x2a35f7[_0x034f('0x43')]=_[_0x034f('0x41')](_0x3a5303[_0x034f('0x42')],qs[_0x034f('0x44')](_0x4364a7[_0x034f('0x3e')]['fields']));_0x2a35f7[_0x034f('0x43')]=_0x2a35f7[_0x034f('0x43')]['length']?_0x2a35f7[_0x034f('0x43')]:_0x3a5303[_0x034f('0x42')];if(!_0x4364a7[_0x034f('0x3e')]['hasOwnProperty'](_0x034f('0x45'))){_0x2a35f7['limit']=qs[_0x034f('0x21')](_0x4364a7['query'][_0x034f('0x21')]);_0x2a35f7[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x4364a7[_0x034f('0x3e')][_0x034f('0x1f')]);}_0x2a35f7[_0x034f('0x46')]=qs['sort'](_0x4364a7['query'][_0x034f('0x47')]);_0x2a35f7[_0x034f('0x48')]=qs['filters'](_[_0x034f('0x49')](_0x4364a7[_0x034f('0x3e')],_0x3a5303['filters']));_0x2a35f7[_0x034f('0x48')]['VoiceQueueId']=_0x2b5909['id'];if(_0x4364a7[_0x034f('0x3e')][_0x034f('0x2f')]){_0x2a35f7[_0x034f('0x48')]=_[_0x034f('0x4a')](_0x2a35f7[_0x034f('0x48')],{'$or':_[_0x034f('0x31')](_0x2a35f7[_0x034f('0x43')],function(_0x5f43b6){var _0x4dac77={};_0x4dac77[_0x5f43b6]={'$like':'%'+_0x4364a7[_0x034f('0x3e')]['filter']+'%'};return _0x4dac77;})});}_0x2a35f7=_['merge']({},_0x2a35f7,_0x4364a7[_0x034f('0x4c')]);return db['CmHopperFinal'][_0x034f('0x22')]({'where':_0x2a35f7[_0x034f('0x48')]})[_0x034f('0x29')](function(_0x49e04a){_0x86a1bd[_0x034f('0x22')]=_0x49e04a;if(_0x4364a7[_0x034f('0x3e')][_0x034f('0x4d')]){_0x2a35f7[_0x034f('0x54')]=[{'all':!![]}];}return db[_0x034f('0x6b')][_0x034f('0x4e')](_0x2a35f7);})[_0x034f('0x29')](function(_0x5d3ae4){_0x86a1bd['rows']=_0x5d3ae4;return _0x86a1bd;});}})[_0x034f('0x29')](respondWithFilteredResult(_0x2e53cd,_0x2a35f7))[_0x034f('0x50')](handleError(_0x2e53cd,null));};exports[_0x034f('0x6c')]=function(_0x1ae7ff,_0x23c253,_0x2d5288){var _0x5cb368={'raw':!![],'where':{}};var _0x59270f={};var _0x45f79c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x034f('0x64')]({'where':{'id':_0x1ae7ff['params']['id']}})['then'](handleEntityNotFound(_0x23c253,null))[_0x034f('0x29')](function(_0x41d16d){if(_0x41d16d){_0x59270f[_0x034f('0x42')]=_['keys'](db['CmHopperBlack'][_0x034f('0x3a')]);_0x59270f[_0x034f('0x3e')]=_[_0x034f('0x3f')](_0x1ae7ff[_0x034f('0x3e')]);_0x59270f[_0x034f('0x40')]=_[_0x034f('0x41')](_0x59270f['model'],_0x59270f['query']);_0x5cb368[_0x034f('0x43')]=_[_0x034f('0x41')](_0x59270f[_0x034f('0x42')],qs[_0x034f('0x44')](_0x1ae7ff[_0x034f('0x3e')][_0x034f('0x44')]));_0x5cb368[_0x034f('0x43')]=_0x5cb368[_0x034f('0x43')][_0x034f('0x53')]?_0x5cb368[_0x034f('0x43')]:_0x59270f[_0x034f('0x42')];if(!_0x1ae7ff[_0x034f('0x3e')]['hasOwnProperty'](_0x034f('0x45'))){_0x5cb368[_0x034f('0x21')]=qs[_0x034f('0x21')](_0x1ae7ff[_0x034f('0x3e')][_0x034f('0x21')]);_0x5cb368['offset']=qs[_0x034f('0x1f')](_0x1ae7ff[_0x034f('0x3e')][_0x034f('0x1f')]);}_0x5cb368['order']=qs[_0x034f('0x47')](_0x1ae7ff[_0x034f('0x3e')][_0x034f('0x47')]);_0x5cb368[_0x034f('0x48')]=qs[_0x034f('0x40')](_[_0x034f('0x49')](_0x1ae7ff[_0x034f('0x3e')],_0x59270f[_0x034f('0x40')]));_0x5cb368[_0x034f('0x48')][_0x034f('0x66')]=_0x41d16d['id'];if(_0x1ae7ff[_0x034f('0x3e')][_0x034f('0x2f')]){_0x5cb368[_0x034f('0x48')]=_['merge'](_0x5cb368[_0x034f('0x48')],{'$or':_['map'](_0x5cb368[_0x034f('0x43')],function(_0x13d1cb){var _0x4786a7={};_0x4786a7[_0x13d1cb]={'$like':'%'+_0x1ae7ff[_0x034f('0x3e')][_0x034f('0x2f')]+'%'};return _0x4786a7;})});}_0x5cb368=_[_0x034f('0x4a')]({},_0x5cb368,_0x1ae7ff[_0x034f('0x4c')]);return db[_0x034f('0x6d')]['count']({'where':_0x5cb368[_0x034f('0x48')]})[_0x034f('0x29')](function(_0x3f1368){_0x45f79c['count']=_0x3f1368;if(_0x1ae7ff[_0x034f('0x3e')][_0x034f('0x4d')]){_0x5cb368[_0x034f('0x54')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x034f('0x4e')](_0x5cb368);})[_0x034f('0x29')](function(_0x4d88b3){_0x45f79c[_0x034f('0x4f')]=_0x4d88b3;return _0x45f79c;});}})[_0x034f('0x29')](respondWithFilteredResult(_0x23c253,_0x5cb368))[_0x034f('0x50')](handleError(_0x23c253,null));};exports[_0x034f('0x6e')]=function(_0x54b7b9,_0x3ae266,_0x41f99f){var _0x258c9a={};var _0x233fb9={};var _0x305a7a;var _0x41a8ec;return db[_0x034f('0x39')][_0x034f('0x64')]({'where':{'id':_0x54b7b9[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x3ae266,null))[_0x034f('0x29')](function(_0x4802b6){if(_0x4802b6){_0x305a7a=_0x4802b6;_0x233fb9[_0x034f('0x42')]=_[_0x034f('0x3f')](db[_0x034f('0x6f')][_0x034f('0x3a')]);_0x233fb9[_0x034f('0x3e')]=_[_0x034f('0x3f')](_0x54b7b9[_0x034f('0x3e')]);_0x233fb9[_0x034f('0x40')]=_[_0x034f('0x41')](_0x233fb9[_0x034f('0x42')],_0x233fb9[_0x034f('0x3e')]);_0x258c9a[_0x034f('0x43')]=_['intersection'](_0x233fb9[_0x034f('0x42')],qs[_0x034f('0x44')](_0x54b7b9['query'][_0x034f('0x44')]));_0x258c9a[_0x034f('0x43')]=_0x258c9a[_0x034f('0x43')][_0x034f('0x53')]?_0x258c9a['attributes']:_0x233fb9[_0x034f('0x42')];_0x258c9a[_0x034f('0x46')]=qs[_0x034f('0x47')](_0x54b7b9[_0x034f('0x3e')][_0x034f('0x47')]);_0x258c9a['where']=qs[_0x034f('0x40')](_[_0x034f('0x49')](_0x54b7b9['query'],_0x233fb9[_0x034f('0x40')]));if(_0x54b7b9[_0x034f('0x3e')]['filter']){_0x258c9a['where']=_[_0x034f('0x4a')](_0x258c9a[_0x034f('0x48')],{'$or':_[_0x034f('0x31')](_0x258c9a['attributes'],function(_0x1e4ca6){var _0x47392c={};_0x47392c[_0x1e4ca6]={'$like':'%'+_0x54b7b9['query']['filter']+'%'};return _0x47392c;})});}_0x258c9a=_[_0x034f('0x4a')]({},_0x258c9a,_0x54b7b9[_0x034f('0x4c')]);return _0x305a7a[_0x034f('0x6e')](_0x258c9a);}})[_0x034f('0x29')](function(_0x57d65c){if(_0x57d65c){_0x41a8ec=_0x57d65c[_0x034f('0x53')];if(!_0x54b7b9[_0x034f('0x3e')][_0x034f('0x65')](_0x034f('0x45'))){_0x258c9a[_0x034f('0x21')]=qs[_0x034f('0x21')](_0x54b7b9[_0x034f('0x3e')][_0x034f('0x21')]);_0x258c9a[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x54b7b9[_0x034f('0x3e')][_0x034f('0x1f')]);}return _0x305a7a['getTeams'](_0x258c9a);}})[_0x034f('0x29')](function(_0x38f7d4){if(_0x38f7d4){return _0x38f7d4?{'count':_0x41a8ec,'rows':_0x38f7d4}:null;}})['then'](respondWithResult(_0x3ae266,null))[_0x034f('0x50')](handleError(_0x3ae266,null));};exports[_0x034f('0x70')]=function(_0x4b8277,_0x2a5bdf,_0x497d29){var _0x401bd8=_0x4b8277['body']['teams'];var _0x430eda=_[_0x034f('0x31')](_0x401bd8,'id');return db[_0x034f('0x6f')][_0x034f('0x4e')]({'where':{'id':_0x430eda},'attributes':['id'],'include':[{'model':db[_0x034f('0x71')],'as':_0x034f('0x72'),'attributes':['id',_0x034f('0x36'),_0x034f('0x73'),'voicePause',_0x034f('0x74')],'raw':!![]}]})[_0x034f('0x29')](function(_0x23877e){if(_0x23877e){var _0x27539e=_['flatMap'](_0x23877e,function(_0x5ed079){var _0x1227f0=_0x5ed079[_0x034f('0x2a')]({'plain':!![]});_0x1227f0['Agents'][_0x034f('0x75')](function(_0x2c84e9){_0x2c84e9[_0x034f('0x76')]=_[_0x034f('0x34')](_0x401bd8,{'id':_0x1227f0['id']})[_0x034f('0x76')];});return _0x1227f0['Agents'];});return db['VoiceQueue'][_0x034f('0x34')]({'where':{'id':_0x4b8277[_0x034f('0x52')]['id']}})[_0x034f('0x29')](function(_0x2416af){return db[_0x034f('0x77')][_0x034f('0x78')](function(_0x756a7a){return _0x2416af[_0x034f('0x70')](_0x430eda,{'transaction':_0x756a7a})[_0x034f('0x29')](function(){return BPromise['each'](_0x401bd8,function(_0x17d506){return db[_0x034f('0x79')]['upsert']({'TeamId':_0x17d506['id'],'VoiceQueueId':_0x4b8277[_0x034f('0x52')]['id'],'penalty':_0x17d506[_0x034f('0x76')]},{'transaction':_0x756a7a});});})['then'](function(){return BPromise[_0x034f('0x7a')](_0x27539e,function(_0xb82e05){return db[_0x034f('0x7b')][_0x034f('0x7c')]({'where':{'UserId':_0xb82e05['id'],'VoiceQueueId':_0x4b8277[_0x034f('0x52')]['id']},'defaults':{'penalty':_0xb82e05[_0x034f('0x76')]},'transaction':_0x756a7a});});})[_0x034f('0x29')](function(){return BPromise[_0x034f('0x7a')](_[_0x034f('0x2f')](_0x27539e,{'online':!![]}),function(_0x25e7a0){return db[_0x034f('0x7d')][_0x034f('0x7e')]({'membername':_0x25e7a0['name'],'UserId':_0x25e7a0['id'],'queue_name':_0x2416af[_0x034f('0x36')],'VoiceQueueId':_0x2416af['id'],'interface':_[_0x034f('0x7f')](_0x25e7a0['interface'])?util[_0x034f('0x80')](_0x034f('0x81'),_0x25e7a0['name']):_0x25e7a0[_0x034f('0x74')],'paused':_0x25e7a0[_0x034f('0x82')]||![],'penalty':_0x25e7a0[_0x034f('0x76')]},{'transaction':_0x756a7a});});})[_0x034f('0x29')](function(){_0x27539e[_0x034f('0x75')](function(_0x2a5baa){socket[_0x034f('0x83')](_0x034f('0x84'),{'UserId':_0x2a5baa['id'],'VoiceQueueId':_0x2416af['id']});});});});});}})[_0x034f('0x29')](respondWithStatusCode(_0x2a5bdf,null))[_0x034f('0x50')](handleError(_0x2a5bdf,null));};exports[_0x034f('0x85')]=function(_0x1f41be,_0x1d2dee,_0x180613){return db[_0x034f('0x6f')][_0x034f('0x4e')]({'where':{'id':_0x1f41be['query'][_0x034f('0x86')]},'attributes':['id'],'include':[{'model':db[_0x034f('0x71')],'as':_0x034f('0x72'),'attributes':['id'],'raw':!![]}]})[_0x034f('0x29')](handleEntityNotFound(_0x1d2dee,null))[_0x034f('0x29')](function(_0x2f29c5){var _0x2a6d36=_[_0x034f('0x31')](_0x2f29c5,'id');var _0x4de189=[];var _0x41f873=[];var _0x1a9095=squel[_0x034f('0x87')]();_0x1a9095[_0x034f('0x88')](_0x034f('0x89'))[_0x034f('0x8a')](_0x034f('0x8b'),'tq')[_0x034f('0x8c')](_0x034f('0x8d'),'ut',_0x034f('0x8e'))[_0x034f('0x48')](_0x034f('0x8f'),_0x1f41be[_0x034f('0x52')]['id']);for(var _0x35f6dc=0x0;_0x35f6dc<_0x2f29c5[_0x034f('0x53')];_0x35f6dc+=0x1){let _0x1a9edd=_0x2f29c5[_0x35f6dc];for(var _0x5dc8fc=0x0;_0x5dc8fc<_0x1a9edd[_0x034f('0x72')]['length'];_0x5dc8fc+=0x1){let _0x5b2827=_0x1a9edd['Agents'][_0x5dc8fc];var _0x56a49f=_0x1a9095[_0x034f('0x5f')]();_0x56a49f[_0x034f('0x48')](_0x034f('0x90'),_0x5b2827['id']);_0x41f873[_0x034f('0x91')](db[_0x034f('0x77')][_0x034f('0x3e')](_0x56a49f['toString'](),{'type':db[_0x034f('0x77')][_0x034f('0x92')]['SELECT']})['then'](function(_0x4b45fa){if(_0x4b45fa[_0x034f('0x53')]===0x1){return _0x5b2827['id'];}else{var _0x5e3582=_[_0x034f('0x93')](_[_0x034f('0x31')](_0x4b45fa,_0x034f('0x94')),function(_0x5bfb72){return _['includes'](_0x2a6d36,_0x5bfb72);});if(_0x5e3582){return _0x5b2827['id'];}}}));}}return BPromise[_0x034f('0x95')](_0x41f873)[_0x034f('0x29')](function(_0x20c095){_0x4de189=_(_0x4de189)[_0x034f('0x96')](_0x20c095)['compact']()['value']();return db['VoiceQueue'][_0x034f('0x34')]({'where':{'id':_0x1f41be[_0x034f('0x52')]['id']}})[_0x034f('0x29')](function(_0x2effd9){return db[_0x034f('0x77')][_0x034f('0x78')](function(_0xb62ea5){return _0x2effd9[_0x034f('0x85')](_0x1f41be[_0x034f('0x3e')][_0x034f('0x86')],{'transaction':_0xb62ea5})[_0x034f('0x29')](function(){if(!_[_0x034f('0x97')](_0x4de189)){return _0x2effd9[_0x034f('0x98')](_0x4de189,{'transaction':_0xb62ea5})[_0x034f('0x29')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x1f41be[_0x034f('0x52')]['id'],'UserId':_0x4de189},'transaction':_0xb62ea5});});}})['then'](function(){_0x4de189[_0x034f('0x75')](function(_0xee20ba){socket[_0x034f('0x83')](_0x034f('0x99'),{'UserId':_0xee20ba,'VoiceQueueId':_0x2effd9['id']});});});});});});})[_0x034f('0x29')](respondWithStatusCode(_0x1d2dee,null))['catch'](handleError(_0x1d2dee,null));};exports['addAgents']=function(_0x12ffe3,_0x1cfd0a,_0x5f816f){var _0x3d1097,_0x5d66a7;return db['VoiceQueue'][_0x034f('0x34')]({'where':{'id':_0x12ffe3[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x1cfd0a,null))[_0x034f('0x29')](function(_0x186d04){if(_0x186d04){_0x5d66a7=_0x186d04;return _0x186d04[_0x034f('0x9a')](_0x12ffe3[_0x034f('0x56')][_0x034f('0x86')],_['omit'](_0x12ffe3[_0x034f('0x56')],[_0x034f('0x86'),'id'])||{})[_0x034f('0x9b')](function(_0x2c11c1){for(var _0x1ef415=0x0;_0x1ef415<_0x12ffe3[_0x034f('0x56')][_0x034f('0x86')][_0x034f('0x53')];_0x1ef415+=0x1){socket[_0x034f('0x83')](_0x034f('0x84'),{'UserId':Number(_0x12ffe3[_0x034f('0x56')]['ids'][_0x1ef415]),'VoiceQueueId':Number(_0x12ffe3[_0x034f('0x52')]['id'])});}return _0x2c11c1;});}})[_0x034f('0x29')](function(_0x464396){_0x3d1097=_0x464396||[];if(_0x5d66a7){return db['User'][_0x034f('0x4e')]({'where':{'id':_0x12ffe3[_0x034f('0x56')]['ids']},'attributes':['id',_0x034f('0x36'),_0x034f('0x73'),_0x034f('0x82'),_0x034f('0x74')],'raw':!![]});}})[_0x034f('0x29')](function(_0x297c6b){if(!_[_0x034f('0x97')](_0x297c6b)){var _0x3572ef=[];for(var _0x2e4e52=0x0;_0x2e4e52<_0x297c6b[_0x034f('0x53')];_0x2e4e52++){if(_0x297c6b[_0x2e4e52]['online']){_0x3572ef[_0x034f('0x91')](db[_0x034f('0x7d')]['upsert']({'membername':_0x297c6b[_0x2e4e52][_0x034f('0x36')],'UserId':_0x297c6b[_0x2e4e52]['id'],'queue_name':_0x5d66a7[_0x034f('0x36')],'VoiceQueueId':_0x5d66a7['id'],'interface':_[_0x034f('0x7f')](_0x297c6b[_0x2e4e52][_0x034f('0x74')])?util[_0x034f('0x80')](_0x034f('0x81'),_0x297c6b[_0x2e4e52][_0x034f('0x36')]):_0x297c6b[_0x2e4e52]['interface'],'paused':_0x297c6b[_0x2e4e52][_0x034f('0x82')]||![],'penalty':_0x12ffe3[_0x034f('0x56')]['penalty']||0x0}));}}return BPromise[_0x034f('0x95')](_0x3572ef);}})[_0x034f('0x29')](function(){return _0x3d1097;})[_0x034f('0x29')](respondWithResult(_0x1cfd0a,null))['catch'](handleError(_0x1cfd0a,null));};exports['removeAgents']=function(_0xe7592d,_0x57b565,_0x2ddcdd){return db['VoiceQueue'][_0x034f('0x34')]({'where':{'id':_0xe7592d[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x57b565,null))[_0x034f('0x29')](function(_0x3a832b){if(_0x3a832b){return _0x3a832b[_0x034f('0x98')](_0xe7592d[_0x034f('0x3e')][_0x034f('0x86')])['then'](function(){if(_['isArray'](_0xe7592d[_0x034f('0x3e')][_0x034f('0x86')])){for(var _0x1b4edc=0x0;_0x1b4edc<_0xe7592d[_0x034f('0x3e')][_0x034f('0x86')]['length'];_0x1b4edc+=0x1){socket[_0x034f('0x83')](_0x034f('0x99'),{'UserId':Number(_0xe7592d[_0x034f('0x3e')]['ids'][_0x1b4edc]),'VoiceQueueId':Number(_0xe7592d['params']['id'])});}}else{socket[_0x034f('0x83')](_0x034f('0x99'),{'UserId':Number(_0xe7592d[_0x034f('0x3e')][_0x034f('0x86')]),'VoiceQueueId':Number(_0xe7592d[_0x034f('0x52')]['id'])});}});}})[_0x034f('0x29')](function(_0x52f9c3){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0xe7592d[_0x034f('0x52')]['id'],'UserId':_0xe7592d[_0x034f('0x3e')][_0x034f('0x86')]}})[_0x034f('0x29')](function(){return _0x52f9c3;});})[_0x034f('0x29')](respondWithStatusCode(_0x57b565,null))['catch'](handleError(_0x57b565,null));};exports['getAgents']=function(_0x475f8c,_0x14fbba,_0xb1cd36){var _0x20f5b3={};var _0x546790={};var _0x1c7b1c;var _0x1f67f5;return db[_0x034f('0x39')]['findOne']({'where':{'id':_0x475f8c[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x14fbba,null))['then'](function(_0x181231){if(_0x181231){_0x1c7b1c=_0x181231;_0x546790[_0x034f('0x42')]=_[_0x034f('0x3f')](db[_0x034f('0x71')][_0x034f('0x3a')]);_0x546790[_0x034f('0x3e')]=_[_0x034f('0x3f')](_0x475f8c[_0x034f('0x3e')]);_0x546790[_0x034f('0x40')]=_[_0x034f('0x41')](_0x546790[_0x034f('0x42')],_0x546790['query']);_0x20f5b3['attributes']=_[_0x034f('0x41')](_0x546790[_0x034f('0x42')],qs['fields'](_0x475f8c['query'][_0x034f('0x44')]));_0x20f5b3['attributes']=_0x20f5b3[_0x034f('0x43')][_0x034f('0x53')]?_0x20f5b3['attributes']:_0x546790[_0x034f('0x42')];_0x20f5b3['order']=qs[_0x034f('0x47')](_0x475f8c[_0x034f('0x3e')]['sort']);_0x20f5b3['where']=qs[_0x034f('0x40')](_[_0x034f('0x49')](_0x475f8c['query'],_0x546790['filters']));if(_0x475f8c[_0x034f('0x3e')][_0x034f('0x2f')]){_0x20f5b3[_0x034f('0x48')]=_['merge'](_0x20f5b3[_0x034f('0x48')],{'$or':_[_0x034f('0x31')](_0x20f5b3[_0x034f('0x43')],function(_0x46c3a6){var _0x4129ac={};_0x4129ac[_0x46c3a6]={'$like':'%'+_0x475f8c[_0x034f('0x3e')][_0x034f('0x2f')]+'%'};return _0x4129ac;})});}_0x20f5b3=_[_0x034f('0x4a')]({},_0x20f5b3,_0x475f8c[_0x034f('0x4c')]);return _0x1c7b1c[_0x034f('0x9c')](_0x20f5b3);}})[_0x034f('0x29')](function(_0xe2c8c1){if(_0xe2c8c1){_0x1f67f5=_0xe2c8c1[_0x034f('0x53')];if(!_0x475f8c[_0x034f('0x3e')][_0x034f('0x65')](_0x034f('0x45'))){_0x20f5b3[_0x034f('0x21')]=qs['limit'](_0x475f8c['query']['limit']);_0x20f5b3[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x475f8c[_0x034f('0x3e')][_0x034f('0x1f')]);}return _0x1c7b1c['getAgents'](_0x20f5b3);}})[_0x034f('0x29')](function(_0x2941df){if(_0x2941df){return _0x2941df?{'count':_0x1f67f5,'rows':_0x2941df}:null;}})['then'](respondWithResult(_0x14fbba,null))[_0x034f('0x50')](handleError(_0x14fbba,null));};exports[_0x034f('0x9d')]=function(_0x580384,_0x57211d,_0xa33b5d){var _0x51f7f8={};var _0x94c725={};var _0x20e5da;var _0x1a9bce;return db['VoiceQueue']['findOne']({'where':{'id':_0x580384[_0x034f('0x52')]['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x57211d,null))[_0x034f('0x29')](function(_0x170e51){if(_0x170e51){_0x20e5da=_0x170e51;_0x94c725[_0x034f('0x42')]=_[_0x034f('0x3f')](db[_0x034f('0x7d')][_0x034f('0x3a')]);_0x94c725[_0x034f('0x3e')]=_['keys'](_0x580384[_0x034f('0x3e')]);_0x94c725[_0x034f('0x40')]=_['intersection'](_0x94c725[_0x034f('0x42')],_0x94c725[_0x034f('0x3e')]);_0x51f7f8[_0x034f('0x43')]=_['intersection'](_0x94c725[_0x034f('0x42')],qs['fields'](_0x580384[_0x034f('0x3e')][_0x034f('0x44')]));_0x51f7f8[_0x034f('0x43')]=_0x51f7f8['attributes'][_0x034f('0x53')]?_0x51f7f8[_0x034f('0x43')]:_0x94c725['model'];_0x51f7f8['order']=qs[_0x034f('0x47')](_0x580384[_0x034f('0x3e')][_0x034f('0x47')]);_0x51f7f8['where']=qs[_0x034f('0x40')](_[_0x034f('0x49')](_0x580384[_0x034f('0x3e')],_0x94c725[_0x034f('0x40')]));if(_0x580384[_0x034f('0x3e')][_0x034f('0x2f')]){_0x51f7f8['where']=_[_0x034f('0x4a')](_0x51f7f8[_0x034f('0x48')],{'$or':_[_0x034f('0x31')](_0x51f7f8['attributes'],function(_0x1ab5d1){var _0x458cb3={};_0x458cb3[_0x1ab5d1]={'$like':'%'+_0x580384[_0x034f('0x3e')][_0x034f('0x2f')]+'%'};return _0x458cb3;})});}_0x51f7f8=_[_0x034f('0x4a')]({},_0x51f7f8,_0x580384[_0x034f('0x4c')]);return _0x20e5da[_0x034f('0x9d')](_0x51f7f8);}})['then'](function(_0x5c425f){if(_0x5c425f){_0x1a9bce=_0x5c425f[_0x034f('0x53')];if(!_0x580384[_0x034f('0x3e')][_0x034f('0x65')](_0x034f('0x45'))){_0x51f7f8[_0x034f('0x21')]=qs[_0x034f('0x21')](_0x580384['query'][_0x034f('0x21')]);_0x51f7f8[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x580384['query'][_0x034f('0x1f')]);}return _0x20e5da[_0x034f('0x9d')](_0x51f7f8);}})['then'](function(_0x4f3201){return _0x4f3201?{'count':_0x1a9bce,'rows':_0x4f3201}:null;})[_0x034f('0x29')](respondWithResult(_0x57211d,null))[_0x034f('0x50')](handleError(_0x57211d,null));};exports[_0x034f('0x9e')]=function(_0x549ce3,_0xd12a46,_0x343682){var _0xc8191b={};var _0x5a4e74={};var _0x3b24c8;var _0x167105;return db[_0x034f('0x39')][_0x034f('0x64')]({'where':{'id':_0x549ce3['params']['id']}})[_0x034f('0x29')](handleEntityNotFound(_0xd12a46,null))[_0x034f('0x29')](function(_0x26e53c){if(_0x26e53c){_0x3b24c8=_0x26e53c;_0x5a4e74['model']=_[_0x034f('0x3f')](db[_0x034f('0x9f')][_0x034f('0x3a')]);_0x5a4e74['query']=_[_0x034f('0x3f')](_0x549ce3[_0x034f('0x3e')]);_0x5a4e74[_0x034f('0x40')]=_['intersection'](_0x5a4e74[_0x034f('0x42')],_0x5a4e74['query']);_0xc8191b[_0x034f('0x43')]=_[_0x034f('0x41')](_0x5a4e74[_0x034f('0x42')],qs[_0x034f('0x44')](_0x549ce3[_0x034f('0x3e')]['fields']));_0xc8191b[_0x034f('0x43')]=_0xc8191b[_0x034f('0x43')][_0x034f('0x53')]?_0xc8191b[_0x034f('0x43')]:_0x5a4e74[_0x034f('0x42')];_0xc8191b[_0x034f('0x46')]=qs[_0x034f('0x47')](_0x549ce3[_0x034f('0x3e')][_0x034f('0x47')]);_0xc8191b[_0x034f('0x48')]=qs[_0x034f('0x40')](_['pick'](_0x549ce3[_0x034f('0x3e')],_0x5a4e74[_0x034f('0x40')]));if(_0x549ce3[_0x034f('0x3e')]['filter']){_0xc8191b['where']=_[_0x034f('0x4a')](_0xc8191b[_0x034f('0x48')],{'$or':_['map'](_0xc8191b[_0x034f('0x43')],function(_0x244a3b){var _0x405204={};_0x405204[_0x244a3b]={'$like':'%'+_0x549ce3[_0x034f('0x3e')][_0x034f('0x2f')]+'%'};return _0x405204;})});}_0xc8191b=_[_0x034f('0x4a')]({},_0xc8191b,_0x549ce3['options']);return _0x3b24c8[_0x034f('0x9e')](_0xc8191b);}})['then'](function(_0xf7bea){if(_0xf7bea){_0x167105=_0xf7bea[_0x034f('0x53')];if(!_0x549ce3[_0x034f('0x3e')][_0x034f('0x65')](_0x034f('0x45'))){_0xc8191b['limit']=qs[_0x034f('0x21')](_0x549ce3[_0x034f('0x3e')][_0x034f('0x21')]);_0xc8191b[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x549ce3[_0x034f('0x3e')][_0x034f('0x1f')]);}return _0x3b24c8[_0x034f('0x9e')](_0xc8191b);}})[_0x034f('0x29')](function(_0x2e10df){if(_0x2e10df){return _0x2e10df?{'count':_0x167105,'rows':_0x2e10df}:null;}})[_0x034f('0x29')](respondWithResult(_0xd12a46,null))['catch'](handleError(_0xd12a46,null));};exports['addLists']=function(_0xe8041a,_0x943518,_0x1a23b4){var _0x5de12d=moment()[_0x034f('0x80')](_0x034f('0xa0'));var _0x3f1de4,_0x18a51f;return db[_0x034f('0x39')][_0x034f('0x34')]({'where':{'id':_0xe8041a[_0x034f('0x52')]['id']}})['then'](handleEntityNotFound(_0x943518,null))[_0x034f('0x29')](function(_0x3c7ff8){if(_0x3c7ff8){_0x18a51f=_0x3c7ff8;return _0x3c7ff8[_0x034f('0xa1')](_0xe8041a[_0x034f('0x56')]['ids'],_[_0x034f('0x60')](_0xe8041a['body'],[_0x034f('0x86'),'id'])||{});}return null;})['spread'](function(_0x353e68){var _0x1720df;_0x3f1de4=_0x353e68||[];var _0x3f5162=[];if(_0x353e68){for(var _0x110998=0x0;_0x110998<_0x353e68[_0x034f('0x53')];_0x110998+=0x1){var _0x2d90ce=_0x353e68[_0x110998][_0x034f('0x2a')]({'plain':!![]});_0x18a51f[_0x034f('0xa2')]=_0xe8041a[_0x034f('0x56')][_0x034f('0xa2')]?_0xe8041a['body'][_0x034f('0xa2')]:_0x18a51f[_0x034f('0xa2')];switch(_0x18a51f['dialCheckDuplicateType']){case _0x034f('0xa3'):_0x1720df=squel['insert']()['into'](_0x034f('0xa4'))['fromQuery']([_0x034f('0xa5'),_0x034f('0xa6'),_0x034f('0xa7'),_0x034f('0xa8'),'VoiceQueueId',_0x034f('0x61'),_0x034f('0x62')],squel[_0x034f('0x87')]()[_0x034f('0x88')](_0x034f('0xa5'),_0x034f('0xa5'))['field']('\x27'+_0x5de12d+'\x27',_0x034f('0xa6'))[_0x034f('0x88')]('id',_0x034f('0xa7'))[_0x034f('0x88')](_0x2d90ce[_0x034f('0xa9')][_0x034f('0xaa')](),_0x034f('0xa8'))[_0x034f('0x88')](_0xe8041a[_0x034f('0x52')]['id'][_0x034f('0xaa')](),_0x034f('0x66'))[_0x034f('0x88')]('\x27'+_0x5de12d+'\x27','createdAt')[_0x034f('0x88')]('\x27'+_0x5de12d+'\x27',_0x034f('0x62'))[_0x034f('0x8a')]('cm_contacts')['where'](_0x034f('0xab'))['where'](_0x034f('0xac'),_0x2d90ce[_0x034f('0xa9')][_0x034f('0xaa')]())[_0x034f('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x034f('0x48')](_0x034f('0xad'),squel[_0x034f('0x87')]()[_0x034f('0x88')](_0x034f('0xae'))['from'](_0x034f('0xaf'))['where'](_0x034f('0x8f'),_0xe8041a[_0x034f('0x52')]['id'][_0x034f('0xaa')]()))[_0x034f('0x48')](_0x034f('0xad'),squel['select']()[_0x034f('0x88')]('COALESCE(phone,\x27\x27)')[_0x034f('0x8a')](_0x034f('0xa4'))[_0x034f('0x48')](_0x034f('0x8f'),_0xe8041a[_0x034f('0x52')]['id']['toString']())))['toString']();break;case'onlyIfOpen':_0x1720df=squel[_0x034f('0xb0')]()[_0x034f('0xb1')](_0x034f('0xa4'))[_0x034f('0xb2')]([_0x034f('0xa5'),_0x034f('0xa6'),_0x034f('0xa7'),_0x034f('0xa8'),_0x034f('0x66'),_0x034f('0x61'),_0x034f('0x62')],squel[_0x034f('0x87')]()[_0x034f('0x88')](_0x034f('0xa5'),'phone')[_0x034f('0x88')]('\x27'+_0x5de12d+'\x27',_0x034f('0xa6'))['field']('id',_0x034f('0xa7'))['field'](_0x2d90ce[_0x034f('0xa9')][_0x034f('0xaa')](),'ListId')[_0x034f('0x88')](_0xe8041a['params']['id']['toString'](),_0x034f('0x66'))['field']('\x27'+_0x5de12d+'\x27',_0x034f('0x61'))[_0x034f('0x88')]('\x27'+_0x5de12d+'\x27',_0x034f('0x62'))[_0x034f('0x8a')](_0x034f('0xb3'))[_0x034f('0x48')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x2d90ce[_0x034f('0xa9')][_0x034f('0xaa')]())[_0x034f('0x48')](_0x034f('0xb4'))[_0x034f('0x48')](_0x034f('0xad'),squel[_0x034f('0x87')]()[_0x034f('0x88')](_0x034f('0xb5'))['from'](_0x034f('0xa4'))[_0x034f('0x48')](_0x034f('0x8f'),_0xe8041a['params']['id'][_0x034f('0xaa')]())))[_0x034f('0xaa')]();break;default:_0x1720df=squel['insert']()[_0x034f('0xb1')](_0x034f('0xa4'))['fromQuery']([_0x034f('0xa5'),_0x034f('0xa6'),_0x034f('0xa7'),_0x034f('0xa8'),_0x034f('0x66'),_0x034f('0x61'),_0x034f('0x62')],squel[_0x034f('0x87')]()['field'](_0x034f('0xa5'),_0x034f('0xa5'))['field']('\x27'+_0x5de12d+'\x27',_0x034f('0xa6'))[_0x034f('0x88')]('id',_0x034f('0xa7'))[_0x034f('0x88')](_0x2d90ce['CmListId'][_0x034f('0xaa')](),_0x034f('0xa8'))['field'](_0xe8041a[_0x034f('0x52')]['id'][_0x034f('0xaa')](),_0x034f('0x66'))[_0x034f('0x88')]('\x27'+_0x5de12d+'\x27','createdAt')[_0x034f('0x88')]('\x27'+_0x5de12d+'\x27',_0x034f('0x62'))['from'](_0x034f('0xb3'))[_0x034f('0x48')](_0x034f('0xab'))[_0x034f('0x48')](_0x034f('0xac'),_0x2d90ce[_0x034f('0xa9')][_0x034f('0xaa')]())[_0x034f('0x48')](_0x034f('0xb4')))['toString']();}_0x3f5162[_0x034f('0x91')](db[_0x034f('0x77')][_0x034f('0x3e')](_0x1720df));}return BPromise[_0x034f('0x95')](_0x3f5162);}})['then'](function(){var _0x1a37b3=[];var _0xfc9a94=squel[_0x034f('0xb0')]()[_0x034f('0xb1')](_0x034f('0xb6'))[_0x034f('0xb2')](['CmHopperId',_0x034f('0xa5'),_0x034f('0xb7'),_0x034f('0x61'),'updatedAt'],squel[_0x034f('0x87')]()[_0x034f('0x88')](_0x034f('0xb8'))['field']('ci.item')[_0x034f('0x88')](_0x034f('0xb9'))['field']('\x27'+_0x5de12d+'\x27',_0x034f('0x61'))[_0x034f('0x88')]('\x27'+_0x5de12d+'\x27','updatedAt')[_0x034f('0x8a')]('cm_contact_has_items','ci')['join'](_0x034f('0xa4'),'h',_0x034f('0xba'))['where'](_0x034f('0xbb'),_0x5de12d)['where'](_0x034f('0xbc'),_0x034f('0xbd')))['toString']();_0x1a37b3[_0x034f('0x91')](db[_0x034f('0x77')][_0x034f('0x3e')](_0xfc9a94));return BPromise[_0x034f('0x95')](_0x1a37b3);})['then'](function(){return _0x3f1de4;})[_0x034f('0x29')](respondWithResult(_0x943518,null))[_0x034f('0x50')](handleError(_0x943518,null));};exports[_0x034f('0xbe')]=function(_0x231c85,_0x443ff5,_0x416e02){return db[_0x034f('0x39')]['find']({'where':{'id':_0x231c85[_0x034f('0x52')]['id']}})['then'](handleEntityNotFound(_0x443ff5,null))[_0x034f('0x29')](function(_0xf3d532){if(_0xf3d532){return _0xf3d532[_0x034f('0xbe')](_0x231c85[_0x034f('0x3e')]['ids']);}})[_0x034f('0x29')](function(_0x2dcd06){if(_0x2dcd06){return db[_0x034f('0x67')][_0x034f('0xbf')]({'where':{'ListId':_0x231c85[_0x034f('0x3e')][_0x034f('0x86')],'VoiceQueueId':_0x231c85[_0x034f('0x52')]['id']}})[_0x034f('0x29')](function(){return _0x2dcd06;});}})['then'](respondWithStatusCode(_0x443ff5,null))[_0x034f('0x50')](handleError(_0x443ff5,null));};exports['getBlackLists']=function(_0x505fba,_0x31c4bb,_0x2be950){var _0x2d39ba={};var _0x4f9993={};var _0x53f850;var _0x25845b;return db[_0x034f('0x39')][_0x034f('0x64')]({'where':{'id':_0x505fba[_0x034f('0x52')]['id']}})['then'](handleEntityNotFound(_0x31c4bb,null))[_0x034f('0x29')](function(_0x4464c7){if(_0x4464c7){_0x53f850=_0x4464c7;_0x4f9993[_0x034f('0x42')]=_['keys'](db['CmList']['rawAttributes']);_0x4f9993[_0x034f('0x3e')]=_[_0x034f('0x3f')](_0x505fba[_0x034f('0x3e')]);_0x4f9993[_0x034f('0x40')]=_[_0x034f('0x41')](_0x4f9993[_0x034f('0x42')],_0x4f9993[_0x034f('0x3e')]);_0x2d39ba['attributes']=_['intersection'](_0x4f9993[_0x034f('0x42')],qs[_0x034f('0x44')](_0x505fba['query'][_0x034f('0x44')]));_0x2d39ba['attributes']=_0x2d39ba[_0x034f('0x43')][_0x034f('0x53')]?_0x2d39ba[_0x034f('0x43')]:_0x4f9993[_0x034f('0x42')];_0x2d39ba[_0x034f('0x46')]=qs[_0x034f('0x47')](_0x505fba[_0x034f('0x3e')][_0x034f('0x47')]);_0x2d39ba[_0x034f('0x48')]=qs[_0x034f('0x40')](_['pick'](_0x505fba[_0x034f('0x3e')],_0x4f9993['filters']));if(_0x505fba[_0x034f('0x3e')][_0x034f('0x2f')]){_0x2d39ba['where']=_[_0x034f('0x4a')](_0x2d39ba[_0x034f('0x48')],{'$or':_[_0x034f('0x31')](_0x2d39ba[_0x034f('0x43')],function(_0x3fc8c4){var _0x15a7d8={};_0x15a7d8[_0x3fc8c4]={'$like':'%'+_0x505fba[_0x034f('0x3e')][_0x034f('0x2f')]+'%'};return _0x15a7d8;})});}_0x2d39ba=_[_0x034f('0x4a')]({},_0x2d39ba,_0x505fba['options']);return _0x53f850['getBlackLists'](_0x2d39ba);}})[_0x034f('0x29')](function(_0x522f4c){if(_0x522f4c){_0x25845b=_0x522f4c[_0x034f('0x53')];if(!_0x505fba['query']['hasOwnProperty'](_0x034f('0x45'))){_0x2d39ba['limit']=qs['limit'](_0x505fba[_0x034f('0x3e')][_0x034f('0x21')]);_0x2d39ba[_0x034f('0x1f')]=qs[_0x034f('0x1f')](_0x505fba[_0x034f('0x3e')][_0x034f('0x1f')]);}return _0x53f850[_0x034f('0xc0')](_0x2d39ba);}})[_0x034f('0x29')](function(_0x4c580f){if(_0x4c580f){return _0x4c580f?{'count':_0x25845b,'rows':_0x4c580f}:null;}})['then'](respondWithResult(_0x31c4bb,null))['catch'](handleError(_0x31c4bb,null));};exports[_0x034f('0xc1')]=function(_0x2f5c74,_0x489d51,_0x381067){var _0x81befb,_0x150987;return db[_0x034f('0x39')][_0x034f('0x34')]({'where':{'id':_0x2f5c74['params']['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x489d51,null))[_0x034f('0x29')](function(_0x25680f){if(_0x25680f){_0x150987=_0x25680f;return _0x25680f[_0x034f('0xc1')](_0x2f5c74[_0x034f('0x56')][_0x034f('0x86')],_['omit'](_0x2f5c74['body'],[_0x034f('0x86'),'id'])||{});}return null;})[_0x034f('0x9b')](function(_0x387eed){var _0x51f06b;_0x81befb=_0x387eed||[];var _0x1d852e=[];if(_0x387eed){for(var _0x24d42e=0x0;_0x24d42e<_0x387eed[_0x034f('0x53')];_0x24d42e+=0x1){var _0x361403=_0x387eed[_0x24d42e][_0x034f('0x2a')]({'plain':!![]});_0x51f06b=squel[_0x034f('0xb0')]()['into'](_0x034f('0xc2'))[_0x034f('0xb2')](['phone','ContactId',_0x034f('0xa8'),_0x034f('0x66'),_0x034f('0x61'),_0x034f('0x62')],squel[_0x034f('0x87')]()[_0x034f('0x88')](_0x034f('0xa5'),_0x034f('0xa5'))[_0x034f('0x88')]('id',_0x034f('0xa7'))[_0x034f('0x88')](_0x361403[_0x034f('0xa9')][_0x034f('0xaa')](),_0x034f('0xa8'))[_0x034f('0x88')](_0x2f5c74['params']['id'][_0x034f('0xaa')](),_0x034f('0x66'))[_0x034f('0x88')](_0x034f('0xc3'),_0x034f('0x61'))[_0x034f('0x88')](_0x034f('0xc3'),_0x034f('0x62'))['from'](_0x034f('0xb3'))[_0x034f('0x48')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x361403[_0x034f('0xa9')]['toString']())[_0x034f('0x48')](_0x034f('0xb4')))[_0x034f('0xaa')]();_0x1d852e[_0x034f('0x91')](db['sequelize'][_0x034f('0x3e')](_0x51f06b));}return BPromise[_0x034f('0x95')](_0x1d852e);}})[_0x034f('0x29')](function(){return _0x81befb;})[_0x034f('0x29')](respondWithResult(_0x489d51,null))[_0x034f('0x50')](handleError(_0x489d51,null));};exports['removeBlackLists']=function(_0x67f555,_0x10a66f,_0x36d89d){return db[_0x034f('0x39')][_0x034f('0x34')]({'where':{'id':_0x67f555['params']['id']}})[_0x034f('0x29')](handleEntityNotFound(_0x10a66f,null))[_0x034f('0x29')](function(_0x3b7de4){if(_0x3b7de4){return _0x3b7de4[_0x034f('0xc4')](_0x67f555['query'][_0x034f('0x86')]);}})['then'](function(_0x7381ba){if(_0x7381ba){return db[_0x034f('0x6d')]['destroy']({'where':{'ListId':_0x67f555[_0x034f('0x3e')][_0x034f('0x86')],'VoiceQueueId':_0x67f555[_0x034f('0x52')]['id']}})[_0x034f('0x29')](function(){return _0x7381ba;});}})[_0x034f('0x29')](respondWithStatusCode(_0x10a66f,null))['catch'](handleError(_0x10a66f,null));}; \ No newline at end of file +var _0x8d0a=['sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','find','type','name','UserProfileResource','stack','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceQueue','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','error','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','voicePause','removeTeams','ids','select','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','sequelize','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','online','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','ContactId','ListId','phone','field','scheduledAt','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','push','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x45e709,_0x225275){var _0x597e47=function(_0x4e3af8){while(--_0x4e3af8){_0x45e709['push'](_0x45e709['shift']());}};_0x597e47(++_0x225275);}(_0x8d0a,0x172));var _0xa8d0=function(_0x45b775,_0x195120){_0x45b775=_0x45b775-0x0;var _0x2b9c51=_0x8d0a[_0x45b775];return _0x2b9c51;};'use strict';var emlformat=require(_0xa8d0('0x0'));var rimraf=require(_0xa8d0('0x1'));var zipdir=require(_0xa8d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8d0('0x3'));var moment=require(_0xa8d0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa8d0('0x5'));var util=require(_0xa8d0('0x6'));var path=require(_0xa8d0('0x7'));var sox=require('sox');var csv=require(_0xa8d0('0x8'));var ejs=require(_0xa8d0('0x9'));var fs=require('fs');var fs_extra=require(_0xa8d0('0xa'));var _=require(_0xa8d0('0xb'));var squel=require(_0xa8d0('0xc'));var crypto=require(_0xa8d0('0xd'));var jsforce=require(_0xa8d0('0xe'));var deskjs=require(_0xa8d0('0xf'));var toCsv=require(_0xa8d0('0x8'));var querystring=require(_0xa8d0('0x10'));var Papa=require(_0xa8d0('0x11'));var Redis=require(_0xa8d0('0x12'));var authService=require(_0xa8d0('0x13'));var qs=require(_0xa8d0('0x14'));var as=require(_0xa8d0('0x15'));var hardwareService=require(_0xa8d0('0x16'));var logger=require(_0xa8d0('0x17'))(_0xa8d0('0x18'));var utils=require(_0xa8d0('0x19'));var config=require(_0xa8d0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa8d0('0x1b')]=_[_0xa8d0('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa8d0('0x1d'))(new Redis(config[_0xa8d0('0x1b')]));require(_0xa8d0('0x1e'))[_0xa8d0('0x1f')](socket);function respondWithStatusCode(_0x2ebddf,_0x18f935){_0x18f935=_0x18f935||0xcc;return function(_0x192b0a){if(_0x192b0a){return _0x2ebddf[_0xa8d0('0x20')](_0x18f935);}return _0x2ebddf[_0xa8d0('0x21')](_0x18f935)[_0xa8d0('0x22')]();};}function respondWithResult(_0xfa19ee,_0x575f69){_0x575f69=_0x575f69||0xc8;return function(_0x728809){if(_0x728809){return _0xfa19ee[_0xa8d0('0x21')](_0x575f69)['json'](_0x728809);}};}function respondWithFilteredResult(_0x3e1dc6,_0x15620f){return function(_0x2899fb){if(_0x2899fb){var _0x434ad5=typeof _0x15620f[_0xa8d0('0x23')]==='undefined'&&typeof _0x15620f[_0xa8d0('0x24')]===_0xa8d0('0x25');var _0x213de2=_0x2899fb[_0xa8d0('0x26')];var _0x1b5dfb=_0x434ad5?0x0:_0x15620f[_0xa8d0('0x23')];var _0x21a6ca=_0x434ad5?_0x2899fb['count']:_0x15620f[_0xa8d0('0x23')]+_0x15620f[_0xa8d0('0x24')];var _0x3c8843;if(_0x21a6ca>=_0x213de2){_0x21a6ca=_0x213de2;_0x3c8843=0xc8;}else{_0x3c8843=0xce;}_0x3e1dc6[_0xa8d0('0x21')](_0x3c8843);return _0x3e1dc6['set'](_0xa8d0('0x27'),_0x1b5dfb+'-'+_0x21a6ca+'/'+_0x213de2)[_0xa8d0('0x28')](_0x2899fb);}return null;};}function patchUpdates(_0x3212a3){return function(_0x252682){try{jsonpatch['apply'](_0x252682,_0x3212a3,!![]);}catch(_0x150080){return BPromise[_0xa8d0('0x29')](_0x150080);}return _0x252682[_0xa8d0('0x2a')]();};}function saveUpdates(_0x1e9c3e,_0x55e6e0){return function(_0x35b4a6){if(_0x35b4a6){return _0x35b4a6[_0xa8d0('0x2b')](_0x1e9c3e)[_0xa8d0('0x2c')](function(_0x507d18){return _0x507d18;});}return null;};}function removeEntity(_0x34c0bf,_0x5f5dfb){return function(_0x3efa4e){if(_0x3efa4e){return _0x3efa4e[_0xa8d0('0x2d')]()['then'](function(){var _0x5d7292=_0x3efa4e[_0xa8d0('0x2e')]({'plain':!![]});var _0x5d9a04=[{'name':_0xa8d0('0x2f'),'value':_0xa8d0('0x30'),'ignore':![]},{'name':_0xa8d0('0x31'),'value':_0xa8d0('0x32'),'ignore':![]}];var _0x3ceaa9=_(_0x5d9a04)['filter'](_0xa8d0('0x33'))[_0xa8d0('0x34')](_0xa8d0('0x35'))['value']();if(_['includes'](_0x3ceaa9,_0x5d7292['type'])){return;}var _0x472982=_[_0xa8d0('0x36')](_0x5d9a04,[_0xa8d0('0x35'),_0x5d7292[_0xa8d0('0x37')]])[_0xa8d0('0x38')];return db[_0xa8d0('0x39')][_0xa8d0('0x2d')]({'where':{'type':_0x472982,'resourceId':_0x5d7292['id']}})['then'](function(){return _0x3efa4e;});})[_0xa8d0('0x2c')](function(){_0x34c0bf['status'](0xcc)[_0xa8d0('0x22')]();});}};}function handleEntityNotFound(_0x538e51,_0x4ea42b){return function(_0x54bc61){if(!_0x54bc61){_0x538e51['sendStatus'](0x194);}return _0x54bc61;};}function handleError(_0xde0f12,_0x25b7b1){_0x25b7b1=_0x25b7b1||0x1f4;return function(_0x5e2334){logger['error'](_0x5e2334[_0xa8d0('0x3a')]);if(_0x5e2334[_0xa8d0('0x38')]){delete _0x5e2334[_0xa8d0('0x38')];}_0xde0f12[_0xa8d0('0x21')](_0x25b7b1)[_0xa8d0('0x3b')](_0x5e2334);};}exports['index']=function(_0x491efc,_0x128a0c){var _0xf5f87={},_0x431d49={},_0x43c9f0={'count':0x0,'rows':[]};var _0x40ccb6=_[_0xa8d0('0x34')](db['VoiceQueue'][_0xa8d0('0x3c')],function(_0x1f474e){return{'name':_0x1f474e[_0xa8d0('0x3d')],'type':_0x1f474e['type'][_0xa8d0('0x3e')]};});_0x431d49[_0xa8d0('0x3f')]=_[_0xa8d0('0x34')](_0x40ccb6,_0xa8d0('0x38'));_0x431d49[_0xa8d0('0x40')]=_[_0xa8d0('0x41')](_0x491efc[_0xa8d0('0x40')]);_0x431d49[_0xa8d0('0x42')]=_[_0xa8d0('0x43')](_0x431d49[_0xa8d0('0x3f')],_0x431d49[_0xa8d0('0x40')]);_0xf5f87['attributes']=_[_0xa8d0('0x43')](_0x431d49['model'],qs[_0xa8d0('0x44')](_0x491efc[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0xf5f87['attributes']=_0xf5f87[_0xa8d0('0x45')][_0xa8d0('0x46')]?_0xf5f87[_0xa8d0('0x45')]:_0x431d49['model'];if(!_0x491efc[_0xa8d0('0x40')][_0xa8d0('0x47')](_0xa8d0('0x48'))){_0xf5f87[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x491efc[_0xa8d0('0x40')][_0xa8d0('0x24')]);_0xf5f87[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x491efc['query'][_0xa8d0('0x23')]);}_0xf5f87[_0xa8d0('0x49')]=qs[_0xa8d0('0x4a')](_0x491efc[_0xa8d0('0x40')][_0xa8d0('0x4a')]);_0xf5f87[_0xa8d0('0x4b')]=qs[_0xa8d0('0x42')](_[_0xa8d0('0x4c')](_0x491efc[_0xa8d0('0x40')],_0x431d49['filters']),_0x40ccb6);if(_0x491efc[_0xa8d0('0x40')]['filter']){_0xf5f87[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0xf5f87['where'],{'$or':_[_0xa8d0('0x34')](_0x40ccb6,function(_0x5c44f1){if(_0x5c44f1[_0xa8d0('0x37')]!==_0xa8d0('0x4e')){var _0x1a14b8={};_0x1a14b8[_0x5c44f1['name']]={'$like':'%'+_0x491efc['query'][_0xa8d0('0x4f')]+'%'};return _0x1a14b8;}})});}_0xf5f87=_[_0xa8d0('0x4d')]({},_0xf5f87,_0x491efc[_0xa8d0('0x50')]);var _0xaf3120={'where':_0xf5f87[_0xa8d0('0x4b')]};return db[_0xa8d0('0x51')][_0xa8d0('0x26')](_0xaf3120)[_0xa8d0('0x2c')](function(_0x5e33f4){_0x43c9f0[_0xa8d0('0x26')]=_0x5e33f4;if(_0x491efc['query'][_0xa8d0('0x52')]){_0xf5f87['include']=[{'all':!![]}];}return db[_0xa8d0('0x51')][_0xa8d0('0x53')](_0xf5f87);})[_0xa8d0('0x2c')](function(_0x58d820){_0x43c9f0[_0xa8d0('0x54')]=_0x58d820;return _0x43c9f0;})[_0xa8d0('0x2c')](respondWithFilteredResult(_0x128a0c,_0xf5f87))[_0xa8d0('0x55')](handleError(_0x128a0c,null));};exports[_0xa8d0('0x56')]=function(_0x86c7ef,_0x38abbf){var _0x2b0f77={'raw':![],'where':{'id':_0x86c7ef[_0xa8d0('0x57')]['id']}},_0x2c5055={};_0x2c5055[_0xa8d0('0x3f')]=_[_0xa8d0('0x41')](db[_0xa8d0('0x51')][_0xa8d0('0x3c')]);_0x2c5055[_0xa8d0('0x40')]=_[_0xa8d0('0x41')](_0x86c7ef['query']);_0x2c5055['filters']=_[_0xa8d0('0x43')](_0x2c5055[_0xa8d0('0x3f')],_0x2c5055[_0xa8d0('0x40')]);_0x2b0f77[_0xa8d0('0x45')]=_[_0xa8d0('0x43')](_0x2c5055[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x86c7ef[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x2b0f77[_0xa8d0('0x45')]=_0x2b0f77[_0xa8d0('0x45')][_0xa8d0('0x46')]?_0x2b0f77[_0xa8d0('0x45')]:_0x2c5055['model'];if(_0x86c7ef[_0xa8d0('0x40')][_0xa8d0('0x52')]){_0x2b0f77[_0xa8d0('0x58')]=[{'all':!![]}];}_0x2b0f77=_['merge']({},_0x2b0f77,_0x86c7ef[_0xa8d0('0x50')]);return db[_0xa8d0('0x51')][_0xa8d0('0x36')](_0x2b0f77)[_0xa8d0('0x2c')](handleEntityNotFound(_0x38abbf,null))[_0xa8d0('0x2c')](respondWithResult(_0x38abbf,null))['catch'](handleError(_0x38abbf,null));};exports['create']=function(_0x2b7a1c,_0x1021f8){return db[_0xa8d0('0x51')][_0xa8d0('0x59')](_0x2b7a1c[_0xa8d0('0x5a')],{})[_0xa8d0('0x2c')](function(_0x39518a){var _0x15e8d9=_0x2b7a1c[_0xa8d0('0x5b')]['get']({'plain':!![]});if(!_0x15e8d9)throw new Error(_0xa8d0('0x5c'));if(_0x15e8d9[_0xa8d0('0x5d')]===_0xa8d0('0x5b')){var _0x2380fb=_0x39518a[_0xa8d0('0x2e')]({'plain':!![]});var _0x5247df=[{'name':_0xa8d0('0x2f'),'value':'inbound'},{'name':_0xa8d0('0x31'),'value':'outbound'}];var _0x2cd37f=_['find'](_0x5247df,['value',_0x2380fb[_0xa8d0('0x37')]])[_0xa8d0('0x38')];return db[_0xa8d0('0x5e')]['find']({'where':{'name':_0x2cd37f,'userProfileId':_0x15e8d9[_0xa8d0('0x5f')]},'raw':!![]})['then'](function(_0x4ffecd){if(_0x4ffecd&&_0x4ffecd[_0xa8d0('0x60')]===0x0){return db[_0xa8d0('0x39')][_0xa8d0('0x59')]({'name':_0x2380fb['name'],'resourceId':_0x2380fb['id'],'type':_0x4ffecd['name'],'sectionId':_0x4ffecd['id']},{})[_0xa8d0('0x2c')](function(){return _0x39518a;});}else{return _0x39518a;}})[_0xa8d0('0x55')](function(_0xf0c4b8){logger['error'](_0xa8d0('0x61'),_0xf0c4b8);throw _0xf0c4b8;});}return _0x39518a;})['then'](respondWithResult(_0x1021f8,0xc9))[_0xa8d0('0x55')](handleError(_0x1021f8,null));};exports[_0xa8d0('0x62')]=function(_0xcc4cdb,_0x514579){var _0x2b9a12={'where':{'id':_0xcc4cdb[_0xa8d0('0x57')]['id']}},_0x21af6f={};_0x21af6f['model']=_['keys'](db[_0xa8d0('0x51')][_0xa8d0('0x3c')]);_0x2b9a12['attributes']=_['intersection'](_0x21af6f[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0xcc4cdb[_0xa8d0('0x40')]['fields']));_0x2b9a12['attributes']=_0x2b9a12[_0xa8d0('0x45')]['length']?_0x2b9a12[_0xa8d0('0x45')]:_0x21af6f[_0xa8d0('0x3f')];if(_0xcc4cdb['query']['includeAll']){_0x2b9a12['include']=[{'all':!![]}];}_0x2b9a12=_[_0xa8d0('0x4d')]({},_0x2b9a12,_0xcc4cdb['options']);return db[_0xa8d0('0x51')][_0xa8d0('0x36')](_0x2b9a12)[_0xa8d0('0x2c')](handleEntityNotFound(_0x514579,null))['then'](function(_0x5a97ed){if(_0x5a97ed){var _0x5a2b34=_0x5a97ed[_0xa8d0('0x2e')]({'plain':!![]});_0x5a2b34=qs[_0xa8d0('0x63')](_0x5a2b34,['id',_0xa8d0('0x64'),_0xa8d0('0x65')]);_0xcc4cdb[_0xa8d0('0x5a')]=_['omit'](_0xcc4cdb[_0xa8d0('0x5a')],['id','createdAt',_0xa8d0('0x65')]);return db['VoiceQueue'][_0xa8d0('0x59')](_['merge'](_0x5a2b34,_0xcc4cdb[_0xa8d0('0x5a')]),{'include':_0xcc4cdb[_0xa8d0('0x40')][_0xa8d0('0x52')]?[{'all':!![]}]:undefined})[_0xa8d0('0x2c')](function(_0x5dde58){var _0x409614=_0xcc4cdb[_0xa8d0('0x5b')]['get']({'plain':!![]});if(!_0x409614)throw new Error(_0xa8d0('0x5c'));if(_0x409614[_0xa8d0('0x5d')]==='user'){var _0x37f6ba=_0x5dde58[_0xa8d0('0x2e')]({'plain':!![]});var _0x3369da=[{'name':_0xa8d0('0x2f'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xa8d0('0x32')}];var _0x62b34e=_[_0xa8d0('0x36')](_0x3369da,[_0xa8d0('0x35'),_0x37f6ba[_0xa8d0('0x37')]])['name'];return db[_0xa8d0('0x5e')][_0xa8d0('0x36')]({'where':{'name':_0x62b34e,'userProfileId':_0x409614[_0xa8d0('0x5f')]},'raw':!![]})[_0xa8d0('0x2c')](function(_0xbebfea){if(_0xbebfea&&_0xbebfea[_0xa8d0('0x60')]===0x0){return db['UserProfileResource'][_0xa8d0('0x59')]({'name':_0x37f6ba[_0xa8d0('0x38')],'resourceId':_0x37f6ba['id'],'type':_0xbebfea[_0xa8d0('0x38')],'sectionId':_0xbebfea['id']},{})['then'](function(){return _0x5dde58;});}else{return _0x5dde58;}})[_0xa8d0('0x55')](function(_0xa155eb){logger[_0xa8d0('0x66')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa155eb);throw _0xa155eb;});}return _0x5dde58;});}})['then'](respondWithResult(_0x514579,0xc9))[_0xa8d0('0x55')](handleError(_0x514579,null));};exports[_0xa8d0('0x2b')]=function(_0x5dc214,_0xef6c6d){if(_0x5dc214['body']['id']){delete _0x5dc214['body']['id'];}return db['VoiceQueue'][_0xa8d0('0x36')]({'where':{'id':_0x5dc214[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0xef6c6d,null))['then'](saveUpdates(_0x5dc214[_0xa8d0('0x5a')],null))[_0xa8d0('0x2c')](respondWithResult(_0xef6c6d,null))[_0xa8d0('0x55')](handleError(_0xef6c6d,null));};exports[_0xa8d0('0x2d')]=function(_0x126c54,_0x717ea5){return db['VoiceQueue'][_0xa8d0('0x36')]({'where':{'id':_0x126c54[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x717ea5,null))[_0xa8d0('0x2c')](removeEntity(_0x717ea5,null))[_0xa8d0('0x55')](handleError(_0x717ea5,null));};exports[_0xa8d0('0x67')]=function(_0x3ee3dc,_0x471b9b,_0x1c4485){var _0x1732c3={'raw':![],'where':{}};var _0x580a04={};var _0x3f562a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa8d0('0x68')]({'where':{'id':_0x3ee3dc['params']['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x471b9b,null))[_0xa8d0('0x2c')](function(_0xc7a712){if(_0xc7a712){_0x580a04[_0xa8d0('0x3f')]=_[_0xa8d0('0x41')](db[_0xa8d0('0x69')][_0xa8d0('0x3c')]);_0x580a04[_0xa8d0('0x40')]=_[_0xa8d0('0x41')](_0x3ee3dc[_0xa8d0('0x40')]);_0x580a04['filters']=_[_0xa8d0('0x43')](_0x580a04[_0xa8d0('0x3f')],_0x580a04[_0xa8d0('0x40')]);_0x1732c3[_0xa8d0('0x45')]=_['intersection'](_0x580a04[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x3ee3dc[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x1732c3[_0xa8d0('0x45')]=_0x1732c3['attributes'][_0xa8d0('0x46')]?_0x1732c3[_0xa8d0('0x45')]:_0x580a04[_0xa8d0('0x3f')];if(!_0x3ee3dc[_0xa8d0('0x40')][_0xa8d0('0x47')](_0xa8d0('0x48'))){_0x1732c3[_0xa8d0('0x24')]=qs['limit'](_0x3ee3dc[_0xa8d0('0x40')]['limit']);_0x1732c3['offset']=qs[_0xa8d0('0x23')](_0x3ee3dc[_0xa8d0('0x40')][_0xa8d0('0x23')]);}_0x1732c3['order']=qs[_0xa8d0('0x4a')](_0x3ee3dc[_0xa8d0('0x40')]['sort']);_0x1732c3[_0xa8d0('0x4b')]=qs[_0xa8d0('0x42')](_['pick'](_0x3ee3dc[_0xa8d0('0x40')],_0x580a04[_0xa8d0('0x42')]));_0x1732c3[_0xa8d0('0x4b')][_0xa8d0('0x6a')]=_0xc7a712['id'];if(_0x3ee3dc['query'][_0xa8d0('0x4f')]){_0x1732c3[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x1732c3[_0xa8d0('0x4b')],{'$or':_[_0xa8d0('0x34')](_0x1732c3[_0xa8d0('0x45')],function(_0x58c149){var _0x34689e={};_0x34689e[_0x58c149]={'$like':'%'+_0x3ee3dc[_0xa8d0('0x40')][_0xa8d0('0x4f')]+'%'};return _0x34689e;})});}_0x1732c3=_[_0xa8d0('0x4d')]({},_0x1732c3,_0x3ee3dc[_0xa8d0('0x50')]);return db['CmHopper'][_0xa8d0('0x26')]({'where':_0x1732c3['where']})[_0xa8d0('0x2c')](function(_0x31a6d2){_0x3f562a[_0xa8d0('0x26')]=_0x31a6d2;if(_0x3ee3dc[_0xa8d0('0x40')]['includeAll']){_0x1732c3[_0xa8d0('0x58')]=[{'all':!![]}];}return db[_0xa8d0('0x69')]['findAll'](_0x1732c3);})['then'](function(_0x4d53f8){_0x3f562a[_0xa8d0('0x54')]=_0x4d53f8;return _0x3f562a;});}})[_0xa8d0('0x2c')](respondWithFilteredResult(_0x471b9b,_0x1732c3))[_0xa8d0('0x55')](handleError(_0x471b9b,null));};exports[_0xa8d0('0x6b')]=function(_0x1865f1,_0x17c092,_0x127e04){var _0x5d0313={'raw':!![],'where':{}};var _0x39ec37={};var _0x47f818={'count':0x0,'rows':[]};return db[_0xa8d0('0x51')]['findOne']({'where':{'id':_0x1865f1['params']['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x17c092,null))['then'](function(_0xf7f94b){if(_0xf7f94b){_0x39ec37[_0xa8d0('0x3f')]=_['keys'](db['CmHopperHistory'][_0xa8d0('0x3c')]);_0x39ec37[_0xa8d0('0x40')]=_[_0xa8d0('0x41')](_0x1865f1[_0xa8d0('0x40')]);_0x39ec37[_0xa8d0('0x42')]=_[_0xa8d0('0x43')](_0x39ec37[_0xa8d0('0x3f')],_0x39ec37[_0xa8d0('0x40')]);_0x5d0313[_0xa8d0('0x45')]=_[_0xa8d0('0x43')](_0x39ec37[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x1865f1[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x5d0313['attributes']=_0x5d0313[_0xa8d0('0x45')]['length']?_0x5d0313[_0xa8d0('0x45')]:_0x39ec37[_0xa8d0('0x3f')];if(!_0x1865f1[_0xa8d0('0x40')][_0xa8d0('0x47')](_0xa8d0('0x48'))){_0x5d0313[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x1865f1[_0xa8d0('0x40')][_0xa8d0('0x24')]);_0x5d0313[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x1865f1[_0xa8d0('0x40')]['offset']);}_0x5d0313['order']=qs['sort'](_0x1865f1[_0xa8d0('0x40')]['sort']);_0x5d0313[_0xa8d0('0x4b')]=qs[_0xa8d0('0x42')](_['pick'](_0x1865f1[_0xa8d0('0x40')],_0x39ec37['filters']));_0x5d0313[_0xa8d0('0x4b')]['VoiceQueueId']=_0xf7f94b['id'];if(_0x1865f1[_0xa8d0('0x40')][_0xa8d0('0x4f')]){_0x5d0313[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x5d0313[_0xa8d0('0x4b')],{'$or':_[_0xa8d0('0x34')](_0x5d0313[_0xa8d0('0x45')],function(_0x3042af){var _0xf89033={};_0xf89033[_0x3042af]={'$like':'%'+_0x1865f1[_0xa8d0('0x40')][_0xa8d0('0x4f')]+'%'};return _0xf89033;})});}_0x5d0313=_[_0xa8d0('0x4d')]({},_0x5d0313,_0x1865f1[_0xa8d0('0x50')]);return db['CmHopperHistory']['count']({'where':_0x5d0313[_0xa8d0('0x4b')]})[_0xa8d0('0x2c')](function(_0x12945c){_0x47f818['count']=_0x12945c;if(_0x1865f1[_0xa8d0('0x40')]['includeAll']){_0x5d0313['include']=[{'all':!![]}];}return db[_0xa8d0('0x6c')][_0xa8d0('0x53')](_0x5d0313);})[_0xa8d0('0x2c')](function(_0x32d614){_0x47f818['rows']=_0x32d614;return _0x47f818;});}})[_0xa8d0('0x2c')](respondWithFilteredResult(_0x17c092,_0x5d0313))['catch'](handleError(_0x17c092,null));};exports['getHopperFinals']=function(_0x112a24,_0x124864,_0x4b69c2){var _0x31adf5={'raw':!![],'where':{}};var _0x8291aa={};var _0x3b124a={'count':0x0,'rows':[]};return db[_0xa8d0('0x51')]['findOne']({'where':{'id':_0x112a24[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x124864,null))[_0xa8d0('0x2c')](function(_0x580808){if(_0x580808){_0x8291aa[_0xa8d0('0x3f')]=_['keys'](db[_0xa8d0('0x6d')][_0xa8d0('0x3c')]);_0x8291aa[_0xa8d0('0x40')]=_[_0xa8d0('0x41')](_0x112a24[_0xa8d0('0x40')]);_0x8291aa[_0xa8d0('0x42')]=_[_0xa8d0('0x43')](_0x8291aa[_0xa8d0('0x3f')],_0x8291aa[_0xa8d0('0x40')]);_0x31adf5[_0xa8d0('0x45')]=_[_0xa8d0('0x43')](_0x8291aa[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x112a24[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x31adf5[_0xa8d0('0x45')]=_0x31adf5['attributes'][_0xa8d0('0x46')]?_0x31adf5['attributes']:_0x8291aa['model'];if(!_0x112a24[_0xa8d0('0x40')]['hasOwnProperty'](_0xa8d0('0x48'))){_0x31adf5[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x112a24['query']['limit']);_0x31adf5[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x112a24[_0xa8d0('0x40')][_0xa8d0('0x23')]);}_0x31adf5[_0xa8d0('0x49')]=qs[_0xa8d0('0x4a')](_0x112a24['query'][_0xa8d0('0x4a')]);_0x31adf5[_0xa8d0('0x4b')]=qs[_0xa8d0('0x42')](_[_0xa8d0('0x4c')](_0x112a24[_0xa8d0('0x40')],_0x8291aa[_0xa8d0('0x42')]));_0x31adf5[_0xa8d0('0x4b')][_0xa8d0('0x6a')]=_0x580808['id'];if(_0x112a24[_0xa8d0('0x40')]['filter']){_0x31adf5[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x31adf5[_0xa8d0('0x4b')],{'$or':_['map'](_0x31adf5[_0xa8d0('0x45')],function(_0x20fcad){var _0x40a16e={};_0x40a16e[_0x20fcad]={'$like':'%'+_0x112a24[_0xa8d0('0x40')]['filter']+'%'};return _0x40a16e;})});}_0x31adf5=_['merge']({},_0x31adf5,_0x112a24[_0xa8d0('0x50')]);return db[_0xa8d0('0x6d')][_0xa8d0('0x26')]({'where':_0x31adf5[_0xa8d0('0x4b')]})[_0xa8d0('0x2c')](function(_0x394202){_0x3b124a['count']=_0x394202;if(_0x112a24[_0xa8d0('0x40')][_0xa8d0('0x52')]){_0x31adf5[_0xa8d0('0x58')]=[{'all':!![]}];}return db[_0xa8d0('0x6d')]['findAll'](_0x31adf5);})[_0xa8d0('0x2c')](function(_0x121a1b){_0x3b124a['rows']=_0x121a1b;return _0x3b124a;});}})['then'](respondWithFilteredResult(_0x124864,_0x31adf5))[_0xa8d0('0x55')](handleError(_0x124864,null));};exports[_0xa8d0('0x6e')]=function(_0x1f8130,_0x37c476,_0x39d256){var _0x171792={'raw':!![],'where':{}};var _0xfc8f03={};var _0x2e132b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa8d0('0x68')]({'where':{'id':_0x1f8130[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x37c476,null))['then'](function(_0x5e0b86){if(_0x5e0b86){_0xfc8f03[_0xa8d0('0x3f')]=_[_0xa8d0('0x41')](db[_0xa8d0('0x6f')][_0xa8d0('0x3c')]);_0xfc8f03[_0xa8d0('0x40')]=_['keys'](_0x1f8130[_0xa8d0('0x40')]);_0xfc8f03['filters']=_[_0xa8d0('0x43')](_0xfc8f03[_0xa8d0('0x3f')],_0xfc8f03[_0xa8d0('0x40')]);_0x171792[_0xa8d0('0x45')]=_[_0xa8d0('0x43')](_0xfc8f03[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x1f8130[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x171792[_0xa8d0('0x45')]=_0x171792[_0xa8d0('0x45')][_0xa8d0('0x46')]?_0x171792[_0xa8d0('0x45')]:_0xfc8f03[_0xa8d0('0x3f')];if(!_0x1f8130[_0xa8d0('0x40')]['hasOwnProperty'](_0xa8d0('0x48'))){_0x171792[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x1f8130[_0xa8d0('0x40')][_0xa8d0('0x24')]);_0x171792[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x1f8130[_0xa8d0('0x40')][_0xa8d0('0x23')]);}_0x171792['order']=qs[_0xa8d0('0x4a')](_0x1f8130[_0xa8d0('0x40')][_0xa8d0('0x4a')]);_0x171792[_0xa8d0('0x4b')]=qs['filters'](_[_0xa8d0('0x4c')](_0x1f8130['query'],_0xfc8f03['filters']));_0x171792[_0xa8d0('0x4b')][_0xa8d0('0x6a')]=_0x5e0b86['id'];if(_0x1f8130['query']['filter']){_0x171792[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x171792[_0xa8d0('0x4b')],{'$or':_[_0xa8d0('0x34')](_0x171792['attributes'],function(_0x4e7825){var _0x431485={};_0x431485[_0x4e7825]={'$like':'%'+_0x1f8130[_0xa8d0('0x40')]['filter']+'%'};return _0x431485;})});}_0x171792=_[_0xa8d0('0x4d')]({},_0x171792,_0x1f8130['options']);return db['CmHopperBlack'][_0xa8d0('0x26')]({'where':_0x171792[_0xa8d0('0x4b')]})[_0xa8d0('0x2c')](function(_0x26e064){_0x2e132b['count']=_0x26e064;if(_0x1f8130[_0xa8d0('0x40')][_0xa8d0('0x52')]){_0x171792[_0xa8d0('0x58')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa8d0('0x53')](_0x171792);})[_0xa8d0('0x2c')](function(_0x197e57){_0x2e132b[_0xa8d0('0x54')]=_0x197e57;return _0x2e132b;});}})[_0xa8d0('0x2c')](respondWithFilteredResult(_0x37c476,_0x171792))[_0xa8d0('0x55')](handleError(_0x37c476,null));};exports[_0xa8d0('0x70')]=function(_0x11a09a,_0x5b9cb3,_0x20ac47){var _0x4e9c0c={};var _0x4db794={};var _0x4badbd;var _0x4020e5;return db[_0xa8d0('0x51')][_0xa8d0('0x68')]({'where':{'id':_0x11a09a[_0xa8d0('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b9cb3,null))['then'](function(_0x4d1539){if(_0x4d1539){_0x4badbd=_0x4d1539;_0x4db794[_0xa8d0('0x3f')]=_[_0xa8d0('0x41')](db[_0xa8d0('0x71')][_0xa8d0('0x3c')]);_0x4db794['query']=_[_0xa8d0('0x41')](_0x11a09a['query']);_0x4db794[_0xa8d0('0x42')]=_['intersection'](_0x4db794[_0xa8d0('0x3f')],_0x4db794['query']);_0x4e9c0c[_0xa8d0('0x45')]=_[_0xa8d0('0x43')](_0x4db794[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x11a09a[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x4e9c0c[_0xa8d0('0x45')]=_0x4e9c0c['attributes'][_0xa8d0('0x46')]?_0x4e9c0c[_0xa8d0('0x45')]:_0x4db794[_0xa8d0('0x3f')];_0x4e9c0c['order']=qs['sort'](_0x11a09a['query'][_0xa8d0('0x4a')]);_0x4e9c0c['where']=qs[_0xa8d0('0x42')](_[_0xa8d0('0x4c')](_0x11a09a[_0xa8d0('0x40')],_0x4db794[_0xa8d0('0x42')]));if(_0x11a09a['query'][_0xa8d0('0x4f')]){_0x4e9c0c['where']=_[_0xa8d0('0x4d')](_0x4e9c0c[_0xa8d0('0x4b')],{'$or':_[_0xa8d0('0x34')](_0x4e9c0c[_0xa8d0('0x45')],function(_0x44c560){var _0x521d28={};_0x521d28[_0x44c560]={'$like':'%'+_0x11a09a[_0xa8d0('0x40')][_0xa8d0('0x4f')]+'%'};return _0x521d28;})});}_0x4e9c0c=_[_0xa8d0('0x4d')]({},_0x4e9c0c,_0x11a09a[_0xa8d0('0x50')]);return _0x4badbd['getTeams'](_0x4e9c0c);}})[_0xa8d0('0x2c')](function(_0xd9cba2){if(_0xd9cba2){_0x4020e5=_0xd9cba2[_0xa8d0('0x46')];if(!_0x11a09a[_0xa8d0('0x40')][_0xa8d0('0x47')](_0xa8d0('0x48'))){_0x4e9c0c[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x11a09a[_0xa8d0('0x40')][_0xa8d0('0x24')]);_0x4e9c0c[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x11a09a[_0xa8d0('0x40')]['offset']);}return _0x4badbd['getTeams'](_0x4e9c0c);}})[_0xa8d0('0x2c')](function(_0x1f398d){if(_0x1f398d){return _0x1f398d?{'count':_0x4020e5,'rows':_0x1f398d}:null;}})[_0xa8d0('0x2c')](respondWithResult(_0x5b9cb3,null))[_0xa8d0('0x55')](handleError(_0x5b9cb3,null));};exports[_0xa8d0('0x72')]=function(_0x577255,_0x92c5a8,_0x39eeec){var _0x3af9a3=_0x577255[_0xa8d0('0x5a')][_0xa8d0('0x73')];var _0x1c6d52=_[_0xa8d0('0x34')](_0x3af9a3,'id');return db[_0xa8d0('0x71')]['findAll']({'where':{'id':_0x1c6d52},'attributes':['id'],'include':[{'model':db[_0xa8d0('0x74')],'as':_0xa8d0('0x75'),'attributes':['id',_0xa8d0('0x38'),'online','voicePause',_0xa8d0('0x76')],'raw':!![]}]})['then'](function(_0x5a123a){if(_0x5a123a){var _0x5cea52=_[_0xa8d0('0x77')](_0x5a123a,function(_0x5e58ae){var _0x143523=_0x5e58ae['get']({'plain':!![]});_0x143523[_0xa8d0('0x75')][_0xa8d0('0x78')](function(_0x594947){_0x594947[_0xa8d0('0x79')]=_[_0xa8d0('0x36')](_0x3af9a3,{'id':_0x143523['id']})['penalty'];});return _0x143523[_0xa8d0('0x75')];});return db[_0xa8d0('0x51')][_0xa8d0('0x36')]({'where':{'id':_0x577255[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](function(_0x35a253){return db['sequelize'][_0xa8d0('0x7a')](function(_0x1bb9f0){return _0x35a253[_0xa8d0('0x72')](_0x1c6d52,{'transaction':_0x1bb9f0})['then'](function(){return BPromise[_0xa8d0('0x7b')](_0x3af9a3,function(_0x13a361){return db[_0xa8d0('0x7c')][_0xa8d0('0x7d')]({'TeamId':_0x13a361['id'],'VoiceQueueId':_0x577255[_0xa8d0('0x57')]['id'],'penalty':_0x13a361['penalty']},{'transaction':_0x1bb9f0});});})['then'](function(){return BPromise[_0xa8d0('0x7b')](_0x5cea52,function(_0x56ae12){return db[_0xa8d0('0x7e')][_0xa8d0('0x7f')]({'where':{'UserId':_0x56ae12['id'],'VoiceQueueId':_0x577255[_0xa8d0('0x57')]['id']},'defaults':{'penalty':_0x56ae12['penalty']},'transaction':_0x1bb9f0});});})[_0xa8d0('0x2c')](function(){return BPromise[_0xa8d0('0x7b')](_[_0xa8d0('0x4f')](_0x5cea52,{'online':!![]}),function(_0x530404){return db[_0xa8d0('0x80')][_0xa8d0('0x7d')]({'membername':_0x530404['name'],'UserId':_0x530404['id'],'queue_name':_0x35a253[_0xa8d0('0x38')],'VoiceQueueId':_0x35a253['id'],'interface':_[_0xa8d0('0x81')](_0x530404[_0xa8d0('0x76')])?util[_0xa8d0('0x82')]('SIP/%s',_0x530404[_0xa8d0('0x38')]):_0x530404[_0xa8d0('0x76')],'paused':_0x530404[_0xa8d0('0x83')]||![],'penalty':_0x530404[_0xa8d0('0x79')]},{'transaction':_0x1bb9f0});});})['then'](function(){_0x5cea52['forEach'](function(_0x1f795f){socket['emit']('userVoiceQueue:save',{'UserId':_0x1f795f['id'],'VoiceQueueId':_0x35a253['id']});});});});});}})[_0xa8d0('0x2c')](respondWithStatusCode(_0x92c5a8,null))['catch'](handleError(_0x92c5a8,null));};exports[_0xa8d0('0x84')]=function(_0x5c4014,_0x5718b0,_0x5b674d){return db[_0xa8d0('0x71')][_0xa8d0('0x53')]({'where':{'id':_0x5c4014[_0xa8d0('0x40')][_0xa8d0('0x85')]},'attributes':['id'],'include':[{'model':db[_0xa8d0('0x74')],'as':_0xa8d0('0x75'),'attributes':['id'],'raw':!![]}]})[_0xa8d0('0x2c')](handleEntityNotFound(_0x5718b0,null))['then'](function(_0x5bc9fc){var _0x44ffba=_[_0xa8d0('0x34')](_0x5bc9fc,'id');var _0x2ef008=[];var _0x5562d8=[];var _0x4750a5=squel[_0xa8d0('0x86')]();_0x4750a5['field'](_0xa8d0('0x87'))['from'](_0xa8d0('0x88'),'tq')['join'](_0xa8d0('0x89'),'ut',_0xa8d0('0x8a'))[_0xa8d0('0x4b')]('VoiceQueueId\x20=\x20?',_0x5c4014[_0xa8d0('0x57')]['id']);for(var _0x57e85d=0x0;_0x57e85d<_0x5bc9fc[_0xa8d0('0x46')];_0x57e85d+=0x1){let _0x46c417=_0x5bc9fc[_0x57e85d];for(var _0x2b5dc6=0x0;_0x2b5dc6<_0x46c417['Agents'][_0xa8d0('0x46')];_0x2b5dc6+=0x1){let _0xdd17d3=_0x46c417[_0xa8d0('0x75')][_0x2b5dc6];var _0x1f41dc=_0x4750a5[_0xa8d0('0x62')]();_0x1f41dc['where'](_0xa8d0('0x8b'),_0xdd17d3['id']);_0x5562d8['push'](db['sequelize'][_0xa8d0('0x40')](_0x1f41dc[_0xa8d0('0x8c')](),{'type':db['sequelize'][_0xa8d0('0x8d')][_0xa8d0('0x8e')]})[_0xa8d0('0x2c')](function(_0x2c3a62){if(_0x2c3a62[_0xa8d0('0x46')]===0x1){return _0xdd17d3['id'];}else{var _0x31245d=_[_0xa8d0('0x8f')](_[_0xa8d0('0x34')](_0x2c3a62,_0xa8d0('0x90')),function(_0x2ff43b){return _['includes'](_0x44ffba,_0x2ff43b);});if(_0x31245d){return _0xdd17d3['id'];}}}));}}return BPromise[_0xa8d0('0x91')](_0x5562d8)[_0xa8d0('0x2c')](function(_0x2eb444){_0x2ef008=_(_0x2ef008)[_0xa8d0('0x92')](_0x2eb444)[_0xa8d0('0x93')]()[_0xa8d0('0x35')]();return db[_0xa8d0('0x51')]['find']({'where':{'id':_0x5c4014['params']['id']}})[_0xa8d0('0x2c')](function(_0xde05fb){return db[_0xa8d0('0x94')][_0xa8d0('0x7a')](function(_0x51d6bf){return _0xde05fb[_0xa8d0('0x84')](_0x5c4014[_0xa8d0('0x40')][_0xa8d0('0x85')],{'transaction':_0x51d6bf})[_0xa8d0('0x2c')](function(){if(!_['isEmpty'](_0x2ef008)){return _0xde05fb[_0xa8d0('0x95')](_0x2ef008,{'transaction':_0x51d6bf})['then'](function(){return db[_0xa8d0('0x80')]['destroy']({'where':{'VoiceQueueId':_0x5c4014[_0xa8d0('0x57')]['id'],'UserId':_0x2ef008},'transaction':_0x51d6bf});});}})['then'](function(){_0x2ef008[_0xa8d0('0x78')](function(_0x4d0b67){socket[_0xa8d0('0x96')](_0xa8d0('0x97'),{'UserId':_0x4d0b67,'VoiceQueueId':_0xde05fb['id']});});});});});});})[_0xa8d0('0x2c')](respondWithStatusCode(_0x5718b0,null))[_0xa8d0('0x55')](handleError(_0x5718b0,null));};exports[_0xa8d0('0x98')]=function(_0x13cedf,_0x369968,_0x124c90){var _0x1ee414,_0x56e8e1;return db['VoiceQueue'][_0xa8d0('0x36')]({'where':{'id':_0x13cedf[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x369968,null))[_0xa8d0('0x2c')](function(_0x472e25){if(_0x472e25){_0x56e8e1=_0x472e25;return _0x472e25[_0xa8d0('0x98')](_0x13cedf['body'][_0xa8d0('0x85')],_[_0xa8d0('0x63')](_0x13cedf[_0xa8d0('0x5a')],['ids','id'])||{})[_0xa8d0('0x99')](function(_0x130780){for(var _0x27b285=0x0;_0x27b285<_0x13cedf[_0xa8d0('0x5a')][_0xa8d0('0x85')][_0xa8d0('0x46')];_0x27b285+=0x1){socket[_0xa8d0('0x96')](_0xa8d0('0x9a'),{'UserId':Number(_0x13cedf[_0xa8d0('0x5a')][_0xa8d0('0x85')][_0x27b285]),'VoiceQueueId':Number(_0x13cedf[_0xa8d0('0x57')]['id'])});}return _0x130780;});}})[_0xa8d0('0x2c')](function(_0x41cbf7){_0x1ee414=_0x41cbf7||[];if(_0x56e8e1){return db[_0xa8d0('0x74')][_0xa8d0('0x53')]({'where':{'id':_0x13cedf[_0xa8d0('0x5a')]['ids']},'attributes':['id',_0xa8d0('0x38'),_0xa8d0('0x9b'),'voicePause',_0xa8d0('0x76')],'raw':!![]});}})['then'](function(_0x192ebf){if(!_['isEmpty'](_0x192ebf)){var _0x2624c3=[];for(var _0x213782=0x0;_0x213782<_0x192ebf['length'];_0x213782++){if(_0x192ebf[_0x213782][_0xa8d0('0x9b')]){_0x2624c3['push'](db[_0xa8d0('0x80')][_0xa8d0('0x7d')]({'membername':_0x192ebf[_0x213782]['name'],'UserId':_0x192ebf[_0x213782]['id'],'queue_name':_0x56e8e1['name'],'VoiceQueueId':_0x56e8e1['id'],'interface':_['isNil'](_0x192ebf[_0x213782][_0xa8d0('0x76')])?util[_0xa8d0('0x82')](_0xa8d0('0x9c'),_0x192ebf[_0x213782]['name']):_0x192ebf[_0x213782]['interface'],'paused':_0x192ebf[_0x213782][_0xa8d0('0x83')]||![],'penalty':_0x13cedf[_0xa8d0('0x5a')][_0xa8d0('0x79')]||0x0}));}}return BPromise[_0xa8d0('0x91')](_0x2624c3);}})[_0xa8d0('0x2c')](function(){return _0x1ee414;})[_0xa8d0('0x2c')](respondWithResult(_0x369968,null))[_0xa8d0('0x55')](handleError(_0x369968,null));};exports[_0xa8d0('0x95')]=function(_0x28eda7,_0x4fd9c4,_0x262f43){return db[_0xa8d0('0x51')]['find']({'where':{'id':_0x28eda7[_0xa8d0('0x57')]['id']}})['then'](handleEntityNotFound(_0x4fd9c4,null))[_0xa8d0('0x2c')](function(_0x54970f){if(_0x54970f){return _0x54970f[_0xa8d0('0x95')](_0x28eda7[_0xa8d0('0x40')][_0xa8d0('0x85')])[_0xa8d0('0x2c')](function(){if(_[_0xa8d0('0x9d')](_0x28eda7[_0xa8d0('0x40')][_0xa8d0('0x85')])){for(var _0x309505=0x0;_0x309505<_0x28eda7[_0xa8d0('0x40')][_0xa8d0('0x85')][_0xa8d0('0x46')];_0x309505+=0x1){socket[_0xa8d0('0x96')](_0xa8d0('0x97'),{'UserId':Number(_0x28eda7[_0xa8d0('0x40')][_0xa8d0('0x85')][_0x309505]),'VoiceQueueId':Number(_0x28eda7[_0xa8d0('0x57')]['id'])});}}else{socket[_0xa8d0('0x96')](_0xa8d0('0x97'),{'UserId':Number(_0x28eda7[_0xa8d0('0x40')][_0xa8d0('0x85')]),'VoiceQueueId':Number(_0x28eda7[_0xa8d0('0x57')]['id'])});}});}})['then'](function(_0x51ec65){return db[_0xa8d0('0x80')]['destroy']({'where':{'VoiceQueueId':_0x28eda7[_0xa8d0('0x57')]['id'],'UserId':_0x28eda7[_0xa8d0('0x40')][_0xa8d0('0x85')]}})[_0xa8d0('0x2c')](function(){return _0x51ec65;});})[_0xa8d0('0x2c')](respondWithStatusCode(_0x4fd9c4,null))[_0xa8d0('0x55')](handleError(_0x4fd9c4,null));};exports['getAgents']=function(_0x49a924,_0x44e5d9,_0x1bd36e){var _0x7c9c07={};var _0x5cb276={};var _0x1781ea;var _0x68ef0d;return db[_0xa8d0('0x51')][_0xa8d0('0x68')]({'where':{'id':_0x49a924['params']['id']}})['then'](handleEntityNotFound(_0x44e5d9,null))[_0xa8d0('0x2c')](function(_0x327b37){if(_0x327b37){_0x1781ea=_0x327b37;_0x5cb276[_0xa8d0('0x3f')]=_[_0xa8d0('0x41')](db[_0xa8d0('0x74')][_0xa8d0('0x3c')]);_0x5cb276[_0xa8d0('0x40')]=_['keys'](_0x49a924[_0xa8d0('0x40')]);_0x5cb276[_0xa8d0('0x42')]=_['intersection'](_0x5cb276[_0xa8d0('0x3f')],_0x5cb276[_0xa8d0('0x40')]);_0x7c9c07['attributes']=_['intersection'](_0x5cb276[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x49a924['query'][_0xa8d0('0x44')]));_0x7c9c07[_0xa8d0('0x45')]=_0x7c9c07[_0xa8d0('0x45')][_0xa8d0('0x46')]?_0x7c9c07[_0xa8d0('0x45')]:_0x5cb276[_0xa8d0('0x3f')];_0x7c9c07['order']=qs[_0xa8d0('0x4a')](_0x49a924['query']['sort']);_0x7c9c07[_0xa8d0('0x4b')]=qs[_0xa8d0('0x42')](_[_0xa8d0('0x4c')](_0x49a924[_0xa8d0('0x40')],_0x5cb276['filters']));if(_0x49a924[_0xa8d0('0x40')]['filter']){_0x7c9c07[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x7c9c07['where'],{'$or':_['map'](_0x7c9c07[_0xa8d0('0x45')],function(_0x25be54){var _0x2c7820={};_0x2c7820[_0x25be54]={'$like':'%'+_0x49a924[_0xa8d0('0x40')][_0xa8d0('0x4f')]+'%'};return _0x2c7820;})});}_0x7c9c07=_[_0xa8d0('0x4d')]({},_0x7c9c07,_0x49a924['options']);return _0x1781ea[_0xa8d0('0x9e')](_0x7c9c07);}})[_0xa8d0('0x2c')](function(_0x192e5f){if(_0x192e5f){_0x68ef0d=_0x192e5f[_0xa8d0('0x46')];if(!_0x49a924['query'][_0xa8d0('0x47')](_0xa8d0('0x48'))){_0x7c9c07[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x49a924[_0xa8d0('0x40')][_0xa8d0('0x24')]);_0x7c9c07[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x49a924[_0xa8d0('0x40')][_0xa8d0('0x23')]);}return _0x1781ea[_0xa8d0('0x9e')](_0x7c9c07);}})[_0xa8d0('0x2c')](function(_0x492320){if(_0x492320){return _0x492320?{'count':_0x68ef0d,'rows':_0x492320}:null;}})[_0xa8d0('0x2c')](respondWithResult(_0x44e5d9,null))[_0xa8d0('0x55')](handleError(_0x44e5d9,null));};exports[_0xa8d0('0x9f')]=function(_0x4dbccf,_0x4a7886,_0x368a78){var _0x29b310={};var _0x259bbf={};var _0x4cd9e4;var _0x4a99a3;return db[_0xa8d0('0x51')][_0xa8d0('0x68')]({'where':{'id':_0x4dbccf['params']['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x4a7886,null))[_0xa8d0('0x2c')](function(_0x2c9187){if(_0x2c9187){_0x4cd9e4=_0x2c9187;_0x259bbf[_0xa8d0('0x3f')]=_['keys'](db[_0xa8d0('0x80')]['rawAttributes']);_0x259bbf[_0xa8d0('0x40')]=_['keys'](_0x4dbccf[_0xa8d0('0x40')]);_0x259bbf[_0xa8d0('0x42')]=_[_0xa8d0('0x43')](_0x259bbf[_0xa8d0('0x3f')],_0x259bbf[_0xa8d0('0x40')]);_0x29b310[_0xa8d0('0x45')]=_[_0xa8d0('0x43')](_0x259bbf[_0xa8d0('0x3f')],qs[_0xa8d0('0x44')](_0x4dbccf[_0xa8d0('0x40')]['fields']));_0x29b310['attributes']=_0x29b310[_0xa8d0('0x45')][_0xa8d0('0x46')]?_0x29b310[_0xa8d0('0x45')]:_0x259bbf[_0xa8d0('0x3f')];_0x29b310[_0xa8d0('0x49')]=qs['sort'](_0x4dbccf['query'][_0xa8d0('0x4a')]);_0x29b310['where']=qs[_0xa8d0('0x42')](_[_0xa8d0('0x4c')](_0x4dbccf[_0xa8d0('0x40')],_0x259bbf[_0xa8d0('0x42')]));if(_0x4dbccf['query'][_0xa8d0('0x4f')]){_0x29b310[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x29b310['where'],{'$or':_[_0xa8d0('0x34')](_0x29b310[_0xa8d0('0x45')],function(_0x595cd6){var _0x253660={};_0x253660[_0x595cd6]={'$like':'%'+_0x4dbccf[_0xa8d0('0x40')]['filter']+'%'};return _0x253660;})});}_0x29b310=_[_0xa8d0('0x4d')]({},_0x29b310,_0x4dbccf[_0xa8d0('0x50')]);return _0x4cd9e4[_0xa8d0('0x9f')](_0x29b310);}})['then'](function(_0x513eba){if(_0x513eba){_0x4a99a3=_0x513eba['length'];if(!_0x4dbccf[_0xa8d0('0x40')][_0xa8d0('0x47')]('nolimit')){_0x29b310[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x4dbccf[_0xa8d0('0x40')][_0xa8d0('0x24')]);_0x29b310[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x4dbccf['query']['offset']);}return _0x4cd9e4['getMembers'](_0x29b310);}})['then'](function(_0x22dd20){return _0x22dd20?{'count':_0x4a99a3,'rows':_0x22dd20}:null;})['then'](respondWithResult(_0x4a7886,null))[_0xa8d0('0x55')](handleError(_0x4a7886,null));};exports[_0xa8d0('0xa0')]=function(_0x58384b,_0x108a23,_0x55582c){var _0x52cfbd={};var _0x4acf8a={};var _0x902ea6;var _0x2b3482;return db[_0xa8d0('0x51')][_0xa8d0('0x68')]({'where':{'id':_0x58384b[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x108a23,null))[_0xa8d0('0x2c')](function(_0x3cf694){if(_0x3cf694){_0x902ea6=_0x3cf694;_0x4acf8a[_0xa8d0('0x3f')]=_['keys'](db[_0xa8d0('0xa1')]['rawAttributes']);_0x4acf8a[_0xa8d0('0x40')]=_['keys'](_0x58384b[_0xa8d0('0x40')]);_0x4acf8a[_0xa8d0('0x42')]=_[_0xa8d0('0x43')](_0x4acf8a['model'],_0x4acf8a['query']);_0x52cfbd[_0xa8d0('0x45')]=_['intersection'](_0x4acf8a[_0xa8d0('0x3f')],qs['fields'](_0x58384b[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x52cfbd[_0xa8d0('0x45')]=_0x52cfbd['attributes'][_0xa8d0('0x46')]?_0x52cfbd[_0xa8d0('0x45')]:_0x4acf8a[_0xa8d0('0x3f')];_0x52cfbd['order']=qs['sort'](_0x58384b[_0xa8d0('0x40')][_0xa8d0('0x4a')]);_0x52cfbd[_0xa8d0('0x4b')]=qs['filters'](_[_0xa8d0('0x4c')](_0x58384b[_0xa8d0('0x40')],_0x4acf8a[_0xa8d0('0x42')]));if(_0x58384b[_0xa8d0('0x40')][_0xa8d0('0x4f')]){_0x52cfbd[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x52cfbd[_0xa8d0('0x4b')],{'$or':_[_0xa8d0('0x34')](_0x52cfbd[_0xa8d0('0x45')],function(_0x28e307){var _0xfc6ca={};_0xfc6ca[_0x28e307]={'$like':'%'+_0x58384b['query']['filter']+'%'};return _0xfc6ca;})});}_0x52cfbd=_[_0xa8d0('0x4d')]({},_0x52cfbd,_0x58384b['options']);return _0x902ea6[_0xa8d0('0xa0')](_0x52cfbd);}})[_0xa8d0('0x2c')](function(_0xd12287){if(_0xd12287){_0x2b3482=_0xd12287['length'];if(!_0x58384b[_0xa8d0('0x40')][_0xa8d0('0x47')](_0xa8d0('0x48'))){_0x52cfbd[_0xa8d0('0x24')]=qs['limit'](_0x58384b['query'][_0xa8d0('0x24')]);_0x52cfbd[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x58384b[_0xa8d0('0x40')]['offset']);}return _0x902ea6[_0xa8d0('0xa0')](_0x52cfbd);}})[_0xa8d0('0x2c')](function(_0x54b480){if(_0x54b480){return _0x54b480?{'count':_0x2b3482,'rows':_0x54b480}:null;}})[_0xa8d0('0x2c')](respondWithResult(_0x108a23,null))['catch'](handleError(_0x108a23,null));};exports[_0xa8d0('0xa2')]=function(_0x42a32f,_0x257c22,_0x490153){var _0xd3511b=moment()[_0xa8d0('0x82')](_0xa8d0('0xa3'));var _0x21bc45,_0x1e91ba;return db[_0xa8d0('0x51')][_0xa8d0('0x36')]({'where':{'id':_0x42a32f[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x257c22,null))[_0xa8d0('0x2c')](function(_0x5af163){if(_0x5af163){_0x1e91ba=_0x5af163;return _0x5af163[_0xa8d0('0xa2')](_0x42a32f[_0xa8d0('0x5a')]['ids'],_[_0xa8d0('0x63')](_0x42a32f[_0xa8d0('0x5a')],['ids','id'])||{});}return null;})[_0xa8d0('0x99')](function(_0x1fb9da){var _0x4eaa88;_0x21bc45=_0x1fb9da||[];var _0x4d6cde=[];if(_0x1fb9da){for(var _0x12117a=0x0;_0x12117a<_0x1fb9da['length'];_0x12117a+=0x1){var _0x2f2501=_0x1fb9da[_0x12117a][_0xa8d0('0x2e')]({'plain':!![]});_0x1e91ba['dialCheckDuplicateType']=_0x42a32f[_0xa8d0('0x5a')][_0xa8d0('0xa4')]?_0x42a32f['body'][_0xa8d0('0xa4')]:_0x1e91ba[_0xa8d0('0xa4')];switch(_0x1e91ba[_0xa8d0('0xa4')]){case'always':_0x4eaa88=squel[_0xa8d0('0xa5')]()[_0xa8d0('0xa6')](_0xa8d0('0xa7'))['fromQuery'](['phone','scheduledAt',_0xa8d0('0xa8'),_0xa8d0('0xa9'),_0xa8d0('0x6a'),_0xa8d0('0x64'),_0xa8d0('0x65')],squel[_0xa8d0('0x86')]()['field'](_0xa8d0('0xaa'),'phone')[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27',_0xa8d0('0xac'))['field']('id','ContactId')[_0xa8d0('0xab')](_0x2f2501[_0xa8d0('0xad')][_0xa8d0('0x8c')](),'ListId')[_0xa8d0('0xab')](_0x42a32f[_0xa8d0('0x57')]['id'][_0xa8d0('0x8c')](),_0xa8d0('0x6a'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27',_0xa8d0('0x64'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27',_0xa8d0('0x65'))[_0xa8d0('0xae')]('cm_contacts')['where'](_0xa8d0('0xaf'))['where'](_0xa8d0('0xb0'),_0x2f2501['CmListId'][_0xa8d0('0x8c')]())[_0xa8d0('0x4b')](_0xa8d0('0xb1'))[_0xa8d0('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa8d0('0x86')]()[_0xa8d0('0xab')]('COALESCE(calleridnum,\x27\x27)')[_0xa8d0('0xae')](_0xa8d0('0xb2'))[_0xa8d0('0x4b')](_0xa8d0('0xb3'),_0x42a32f[_0xa8d0('0x57')]['id'][_0xa8d0('0x8c')]()))['where'](_0xa8d0('0xb4'),squel[_0xa8d0('0x86')]()['field'](_0xa8d0('0xb5'))[_0xa8d0('0xae')]('cm_hopper')[_0xa8d0('0x4b')]('VoiceQueueId\x20=\x20?',_0x42a32f[_0xa8d0('0x57')]['id'][_0xa8d0('0x8c')]())))[_0xa8d0('0x8c')]();break;case _0xa8d0('0xb6'):_0x4eaa88=squel[_0xa8d0('0xa5')]()['into'](_0xa8d0('0xa7'))['fromQuery']([_0xa8d0('0xaa'),_0xa8d0('0xac'),_0xa8d0('0xa8'),_0xa8d0('0xa9'),_0xa8d0('0x6a'),'createdAt','updatedAt'],squel[_0xa8d0('0x86')]()['field'](_0xa8d0('0xaa'),_0xa8d0('0xaa'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27',_0xa8d0('0xac'))['field']('id','ContactId')[_0xa8d0('0xab')](_0x2f2501[_0xa8d0('0xad')][_0xa8d0('0x8c')](),_0xa8d0('0xa9'))['field'](_0x42a32f[_0xa8d0('0x57')]['id'][_0xa8d0('0x8c')](),_0xa8d0('0x6a'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27',_0xa8d0('0x64'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27',_0xa8d0('0x65'))[_0xa8d0('0xae')]('cm_contacts')[_0xa8d0('0x4b')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x2f2501[_0xa8d0('0xad')][_0xa8d0('0x8c')]())[_0xa8d0('0x4b')](_0xa8d0('0xb1'))[_0xa8d0('0x4b')](_0xa8d0('0xb4'),squel['select']()[_0xa8d0('0xab')](_0xa8d0('0xb5'))['from'](_0xa8d0('0xa7'))[_0xa8d0('0x4b')](_0xa8d0('0xb3'),_0x42a32f[_0xa8d0('0x57')]['id'][_0xa8d0('0x8c')]())))[_0xa8d0('0x8c')]();break;default:_0x4eaa88=squel[_0xa8d0('0xa5')]()[_0xa8d0('0xa6')]('cm_hopper')[_0xa8d0('0xb7')]([_0xa8d0('0xaa'),_0xa8d0('0xac'),_0xa8d0('0xa8'),_0xa8d0('0xa9'),_0xa8d0('0x6a'),_0xa8d0('0x64'),_0xa8d0('0x65')],squel[_0xa8d0('0x86')]()[_0xa8d0('0xab')](_0xa8d0('0xaa'),_0xa8d0('0xaa'))['field']('\x27'+_0xd3511b+'\x27',_0xa8d0('0xac'))[_0xa8d0('0xab')]('id',_0xa8d0('0xa8'))[_0xa8d0('0xab')](_0x2f2501['CmListId'][_0xa8d0('0x8c')](),_0xa8d0('0xa9'))[_0xa8d0('0xab')](_0x42a32f[_0xa8d0('0x57')]['id'][_0xa8d0('0x8c')](),_0xa8d0('0x6a'))['field']('\x27'+_0xd3511b+'\x27',_0xa8d0('0x64'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27','updatedAt')[_0xa8d0('0xae')](_0xa8d0('0xb8'))['where'](_0xa8d0('0xaf'))[_0xa8d0('0x4b')](_0xa8d0('0xb0'),_0x2f2501[_0xa8d0('0xad')]['toString']())[_0xa8d0('0x4b')](_0xa8d0('0xb1')))['toString']();}_0x4d6cde[_0xa8d0('0xb9')](db['sequelize'][_0xa8d0('0x40')](_0x4eaa88));}return BPromise[_0xa8d0('0x91')](_0x4d6cde);}})[_0xa8d0('0x2c')](function(){var _0x50db81=[];var _0x59fa68=squel[_0xa8d0('0xa5')]()[_0xa8d0('0xa6')](_0xa8d0('0xba'))[_0xa8d0('0xb7')]([_0xa8d0('0xbb'),_0xa8d0('0xaa'),_0xa8d0('0xbc'),_0xa8d0('0x64'),'updatedAt'],squel[_0xa8d0('0x86')]()[_0xa8d0('0xab')](_0xa8d0('0xbd'))[_0xa8d0('0xab')](_0xa8d0('0xbe'))[_0xa8d0('0xab')](_0xa8d0('0xbf'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27',_0xa8d0('0x64'))[_0xa8d0('0xab')]('\x27'+_0xd3511b+'\x27','updatedAt')['from'](_0xa8d0('0xc0'),'ci')['join'](_0xa8d0('0xa7'),'h','h.ContactId=ci.CmContactId')[_0xa8d0('0x4b')](_0xa8d0('0xc1'),_0xd3511b)[_0xa8d0('0x4b')](_0xa8d0('0xc2'),_0xa8d0('0xc3')))[_0xa8d0('0x8c')]();_0x50db81['push'](db[_0xa8d0('0x94')]['query'](_0x59fa68));return BPromise[_0xa8d0('0x91')](_0x50db81);})['then'](function(){return _0x21bc45;})['then'](respondWithResult(_0x257c22,null))[_0xa8d0('0x55')](handleError(_0x257c22,null));};exports[_0xa8d0('0xc4')]=function(_0x25cc04,_0x579d20,_0x1da1a3){return db[_0xa8d0('0x51')]['find']({'where':{'id':_0x25cc04[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x579d20,null))[_0xa8d0('0x2c')](function(_0x792d08){if(_0x792d08){return _0x792d08[_0xa8d0('0xc4')](_0x25cc04[_0xa8d0('0x40')][_0xa8d0('0x85')]);}})[_0xa8d0('0x2c')](function(_0x510545){if(_0x510545){return db[_0xa8d0('0x69')][_0xa8d0('0x2d')]({'where':{'ListId':_0x25cc04[_0xa8d0('0x40')][_0xa8d0('0x85')],'VoiceQueueId':_0x25cc04[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](function(){return _0x510545;});}})[_0xa8d0('0x2c')](respondWithStatusCode(_0x579d20,null))[_0xa8d0('0x55')](handleError(_0x579d20,null));};exports['getBlackLists']=function(_0x86125f,_0xe54c2c,_0x1e5e21){var _0x2f0b87={};var _0xd48b0={};var _0x3664fc;var _0x3adff8;return db[_0xa8d0('0x51')]['findOne']({'where':{'id':_0x86125f[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0xe54c2c,null))['then'](function(_0x1d7a59){if(_0x1d7a59){_0x3664fc=_0x1d7a59;_0xd48b0['model']=_[_0xa8d0('0x41')](db[_0xa8d0('0xa1')]['rawAttributes']);_0xd48b0[_0xa8d0('0x40')]=_['keys'](_0x86125f[_0xa8d0('0x40')]);_0xd48b0[_0xa8d0('0x42')]=_['intersection'](_0xd48b0[_0xa8d0('0x3f')],_0xd48b0['query']);_0x2f0b87[_0xa8d0('0x45')]=_['intersection'](_0xd48b0[_0xa8d0('0x3f')],qs['fields'](_0x86125f[_0xa8d0('0x40')][_0xa8d0('0x44')]));_0x2f0b87[_0xa8d0('0x45')]=_0x2f0b87[_0xa8d0('0x45')]['length']?_0x2f0b87[_0xa8d0('0x45')]:_0xd48b0[_0xa8d0('0x3f')];_0x2f0b87[_0xa8d0('0x49')]=qs[_0xa8d0('0x4a')](_0x86125f[_0xa8d0('0x40')][_0xa8d0('0x4a')]);_0x2f0b87[_0xa8d0('0x4b')]=qs[_0xa8d0('0x42')](_[_0xa8d0('0x4c')](_0x86125f['query'],_0xd48b0['filters']));if(_0x86125f[_0xa8d0('0x40')][_0xa8d0('0x4f')]){_0x2f0b87[_0xa8d0('0x4b')]=_[_0xa8d0('0x4d')](_0x2f0b87['where'],{'$or':_[_0xa8d0('0x34')](_0x2f0b87['attributes'],function(_0x3b6de4){var _0x45d6db={};_0x45d6db[_0x3b6de4]={'$like':'%'+_0x86125f['query'][_0xa8d0('0x4f')]+'%'};return _0x45d6db;})});}_0x2f0b87=_[_0xa8d0('0x4d')]({},_0x2f0b87,_0x86125f[_0xa8d0('0x50')]);return _0x3664fc[_0xa8d0('0xc5')](_0x2f0b87);}})[_0xa8d0('0x2c')](function(_0x5e90a6){if(_0x5e90a6){_0x3adff8=_0x5e90a6[_0xa8d0('0x46')];if(!_0x86125f[_0xa8d0('0x40')][_0xa8d0('0x47')]('nolimit')){_0x2f0b87[_0xa8d0('0x24')]=qs[_0xa8d0('0x24')](_0x86125f[_0xa8d0('0x40')][_0xa8d0('0x24')]);_0x2f0b87[_0xa8d0('0x23')]=qs[_0xa8d0('0x23')](_0x86125f['query'][_0xa8d0('0x23')]);}return _0x3664fc[_0xa8d0('0xc5')](_0x2f0b87);}})[_0xa8d0('0x2c')](function(_0x564c74){if(_0x564c74){return _0x564c74?{'count':_0x3adff8,'rows':_0x564c74}:null;}})[_0xa8d0('0x2c')](respondWithResult(_0xe54c2c,null))['catch'](handleError(_0xe54c2c,null));};exports[_0xa8d0('0xc6')]=function(_0x4547bb,_0x30c489,_0xe7d718){var _0xd7eeda,_0x135408;return db[_0xa8d0('0x51')][_0xa8d0('0x36')]({'where':{'id':_0x4547bb[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](handleEntityNotFound(_0x30c489,null))[_0xa8d0('0x2c')](function(_0x4588ba){if(_0x4588ba){_0x135408=_0x4588ba;return _0x4588ba[_0xa8d0('0xc6')](_0x4547bb['body'][_0xa8d0('0x85')],_[_0xa8d0('0x63')](_0x4547bb[_0xa8d0('0x5a')],['ids','id'])||{});}return null;})[_0xa8d0('0x99')](function(_0x12c15f){var _0x22b746;_0xd7eeda=_0x12c15f||[];var _0x295fa5=[];if(_0x12c15f){for(var _0x262779=0x0;_0x262779<_0x12c15f['length'];_0x262779+=0x1){var _0x339f76=_0x12c15f[_0x262779][_0xa8d0('0x2e')]({'plain':!![]});_0x22b746=squel['insert']()[_0xa8d0('0xa6')]('cm_hopper_black')[_0xa8d0('0xb7')]([_0xa8d0('0xaa'),_0xa8d0('0xa8'),_0xa8d0('0xa9'),'VoiceQueueId',_0xa8d0('0x64'),_0xa8d0('0x65')],squel[_0xa8d0('0x86')]()['field'](_0xa8d0('0xaa'),'phone')[_0xa8d0('0xab')]('id','ContactId')[_0xa8d0('0xab')](_0x339f76[_0xa8d0('0xad')][_0xa8d0('0x8c')](),'ListId')['field'](_0x4547bb['params']['id'][_0xa8d0('0x8c')](),_0xa8d0('0x6a'))[_0xa8d0('0xab')](_0xa8d0('0xc7'),_0xa8d0('0x64'))[_0xa8d0('0xab')](_0xa8d0('0xc7'),'updatedAt')[_0xa8d0('0xae')](_0xa8d0('0xb8'))[_0xa8d0('0x4b')]('deletedAt\x20IS\x20NULL')[_0xa8d0('0x4b')]('ListId\x20=\x20?',_0x339f76[_0xa8d0('0xad')]['toString']())[_0xa8d0('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0xa8d0('0x8c')]();_0x295fa5[_0xa8d0('0xb9')](db[_0xa8d0('0x94')][_0xa8d0('0x40')](_0x22b746));}return BPromise['all'](_0x295fa5);}})['then'](function(){return _0xd7eeda;})[_0xa8d0('0x2c')](respondWithResult(_0x30c489,null))['catch'](handleError(_0x30c489,null));};exports[_0xa8d0('0xc8')]=function(_0x2c1c6a,_0x534ab4,_0x2a89e6){return db[_0xa8d0('0x51')]['find']({'where':{'id':_0x2c1c6a[_0xa8d0('0x57')]['id']}})['then'](handleEntityNotFound(_0x534ab4,null))[_0xa8d0('0x2c')](function(_0x3b3066){if(_0x3b3066){return _0x3b3066[_0xa8d0('0xc8')](_0x2c1c6a['query'][_0xa8d0('0x85')]);}})[_0xa8d0('0x2c')](function(_0x46ea24){if(_0x46ea24){return db[_0xa8d0('0x6f')]['destroy']({'where':{'ListId':_0x2c1c6a[_0xa8d0('0x40')][_0xa8d0('0x85')],'VoiceQueueId':_0x2c1c6a[_0xa8d0('0x57')]['id']}})[_0xa8d0('0x2c')](function(){return _0x46ea24;});}})[_0xa8d0('0x2c')](respondWithStatusCode(_0x534ab4,null))[_0xa8d0('0x55')](handleError(_0x534ab4,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 9bf32de..3c30670 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 _0x0c89=['../../mysqldb','VoiceQueue','save','update','remove','emit','hook','exports','events'];(function(_0x555e30,_0x4392cd){var _0x19eaac=function(_0x4b8b51){while(--_0x4b8b51){_0x555e30['push'](_0x555e30['shift']());}};_0x19eaac(++_0x4392cd);}(_0x0c89,0x10d));var _0x90c8=function(_0x49ead9,_0x399b98){_0x49ead9=_0x49ead9-0x0;var _0xcde9a7=_0x0c89[_0x49ead9];return _0xcde9a7;};'use strict';var EventEmitter=require(_0x90c8('0x0'));var VoiceQueue=require(_0x90c8('0x1'))['db'][_0x90c8('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90c8('0x3'),'afterUpdate':_0x90c8('0x4'),'afterDestroy':_0x90c8('0x5')};function emitEvent(_0xcbaf7c){return function(_0x9046c5,_0x41b67b,_0x167057){VoiceQueueEvents[_0x90c8('0x6')](_0xcbaf7c+':'+_0x9046c5['id'],_0x9046c5);VoiceQueueEvents[_0x90c8('0x6')](_0xcbaf7c,_0x9046c5);_0x167057(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x90c8('0x7')](e,emitEvent(event));}}module[_0x90c8('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xaf76=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x50eafa,_0x400830){var _0x1b5227=function(_0x5498c4){while(--_0x5498c4){_0x50eafa['push'](_0x50eafa['shift']());}};_0x1b5227(++_0x400830);}(_0xaf76,0xe2));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6af7('0x0'));var VoiceQueue=require(_0x6af7('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6af7('0x2')](0x0);var events={'afterCreate':_0x6af7('0x3'),'afterUpdate':_0x6af7('0x4'),'afterDestroy':_0x6af7('0x5')};function emitEvent(_0x5499f2){return function(_0x1616b1,_0x575391,_0x23789f){VoiceQueueEvents[_0x6af7('0x6')](_0x5499f2+':'+_0x1616b1['id'],_0x1616b1);VoiceQueueEvents[_0x6af7('0x6')](_0x5499f2,_0x1616b1);_0x23789f(null);};}for(var e in events){if(events[_0x6af7('0x7')](e)){var event=events[e];VoiceQueue[_0x6af7('0x8')](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 8c5377d..4c07f1f 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0xb02d41,_0x2df723){var _0x5880f7=function(_0x55cf71){while(--_0x55cf71){_0xb02d41['push'](_0xb02d41['shift']());}};_0x5880f7(++_0x2df723);}(_0xedd9,0xfc));var _0x9edd=function(_0x368bc7,_0x1a882a){_0x368bc7=_0x368bc7-0x0;var _0x29f71d=_0xedd9[_0x368bc7];return _0x29f71d;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x55ca,0x126));var _0xa55c=function(_0x4d73b1,_0x91ab71){_0x4d73b1=_0x4d73b1-0x0;var _0xe394f9=_0x55ca[_0x4d73b1];return _0xe394f9;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index d5940e0..7744ba3 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 _0x87da=['VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VoiceQueue','findAll','options','attributes','limit','include','map','model','GetVoiceQueue','debug','ShowVoiceQueue','find','raw','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceQueue.socket','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87da,0x67));var _0xa87d=function(_0x2c10c2,_0x372bc0){_0x2c10c2=_0x2c10c2-0x0;var _0x1a37c9=_0x87da[_0x2c10c2];return _0x1a37c9;};'use strict';var _=require(_0xa87d('0x0'));var util=require(_0xa87d('0x1'));var moment=require('moment');var BPromise=require(_0xa87d('0x2'));var rs=require(_0xa87d('0x3'));var fs=require('fs');var Redis=require(_0xa87d('0x4'));var db=require(_0xa87d('0x5'))['db'];var utils=require(_0xa87d('0x6'));var logger=require(_0xa87d('0x7'))(_0xa87d('0x8'));var config=require(_0xa87d('0x9'));var jayson=require(_0xa87d('0xa'));var client=jayson[_0xa87d('0xb')][_0xa87d('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa87d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa87d('0xe'))(new Redis(config[_0xa87d('0xd')]));require(_0xa87d('0xf'))['register'](socket);function respondWithRpcPromise(_0x259010,_0x4d3a2c,_0x198a65){return new BPromise(function(_0x1ca37e,_0x252136){return client['request'](_0x259010,_0x198a65)[_0xa87d('0x10')](function(_0x322670){logger[_0xa87d('0x11')](_0xa87d('0x12'),_0x4d3a2c,_0xa87d('0x13'));logger['debug'](_0xa87d('0x14'),_0x4d3a2c,'request\x20sent',JSON[_0xa87d('0x15')](_0x322670));if(_0x322670['error']){if(_0x322670['error'][_0xa87d('0x16')]===0x1f4){logger['error'](_0xa87d('0x12'),_0x4d3a2c,_0x322670[_0xa87d('0x17')][_0xa87d('0x18')]);return _0x252136(_0x322670['error'][_0xa87d('0x18')]);}logger['error'](_0xa87d('0x12'),_0x4d3a2c,_0x322670[_0xa87d('0x17')][_0xa87d('0x18')]);return _0x1ca37e(_0x322670['error'][_0xa87d('0x18')]);}else{logger['info'](_0xa87d('0x12'),_0x4d3a2c,'request\x20sent');_0x1ca37e(_0x322670[_0xa87d('0x19')][_0xa87d('0x18')]);}})[_0xa87d('0x1a')](function(_0x5453b7){logger[_0xa87d('0x17')](_0xa87d('0x12'),_0x4d3a2c,_0x5453b7);_0x252136(_0x5453b7);});});}exports['GetVoiceQueue']=function(_0x256475){var _0x5e5ecf=this;return new Promise(function(_0x2befc7,_0x31cd62){return db[_0xa87d('0x1b')][_0xa87d('0x1c')]({'raw':_0x256475[_0xa87d('0x1d')]?_0x256475[_0xa87d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x256475[_0xa87d('0x1d')]?_0x256475[_0xa87d('0x1d')]['where']||null:null,'attributes':_0x256475[_0xa87d('0x1d')]?_0x256475[_0xa87d('0x1d')][_0xa87d('0x1e')]||null:null,'limit':_0x256475[_0xa87d('0x1d')]?_0x256475['options'][_0xa87d('0x1f')]||null:null,'include':_0x256475[_0xa87d('0x1d')]?_0x256475[_0xa87d('0x1d')][_0xa87d('0x20')]?_[_0xa87d('0x21')](_0x256475[_0xa87d('0x1d')][_0xa87d('0x20')],function(_0x310d2e){return{'model':db[_0x310d2e[_0xa87d('0x22')]],'as':_0x310d2e['as'],'attributes':_0x310d2e[_0xa87d('0x1e')],'include':_0x310d2e['include']?_[_0xa87d('0x21')](_0x310d2e['include'],function(_0x3583d8){return{'model':db[_0x3583d8[_0xa87d('0x22')]],'as':_0x3583d8['as'],'attributes':_0x3583d8['attributes'],'include':_0x3583d8[_0xa87d('0x20')]?_['map'](_0x3583d8[_0xa87d('0x20')],function(_0x30c026){return{'model':db[_0x30c026[_0xa87d('0x22')]],'as':_0x30c026['as'],'attributes':_0x30c026[_0xa87d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa87d('0x10')](function(_0x2c8880){logger[_0xa87d('0x11')](_0xa87d('0x23'),_0x256475);logger[_0xa87d('0x24')]('GetVoiceQueue',_0x256475,JSON[_0xa87d('0x15')](_0x2c8880));_0x2befc7(_0x2c8880);})[_0xa87d('0x1a')](function(_0x1692a3){logger[_0xa87d('0x17')](_0xa87d('0x23'),_0x1692a3[_0xa87d('0x18')],_0x256475);_0x31cd62(_0x5e5ecf[_0xa87d('0x17')](0x1f4,_0x1692a3[_0xa87d('0x18')]));});});};exports[_0xa87d('0x25')]=function(_0x42270f){var _0x36ddba=this;return new Promise(function(_0x1514f2,_0x369cdd){return db[_0xa87d('0x1b')][_0xa87d('0x26')]({'raw':_0x42270f[_0xa87d('0x1d')]?_0x42270f[_0xa87d('0x1d')][_0xa87d('0x27')]===undefined?!![]:![]:!![],'where':_0x42270f[_0xa87d('0x1d')]?_0x42270f[_0xa87d('0x1d')][_0xa87d('0x28')]||null:null,'attributes':_0x42270f[_0xa87d('0x1d')]?_0x42270f[_0xa87d('0x1d')][_0xa87d('0x1e')]||null:null,'include':_0x42270f[_0xa87d('0x1d')]?_0x42270f[_0xa87d('0x1d')][_0xa87d('0x20')]?_[_0xa87d('0x21')](_0x42270f[_0xa87d('0x1d')][_0xa87d('0x20')],function(_0x39d091){return{'model':db[_0x39d091['model']],'as':_0x39d091['as'],'attributes':_0x39d091[_0xa87d('0x1e')],'include':_0x39d091[_0xa87d('0x20')]?_['map'](_0x39d091[_0xa87d('0x20')],function(_0x126b80){return{'model':db[_0x126b80[_0xa87d('0x22')]],'as':_0x126b80['as'],'attributes':_0x126b80[_0xa87d('0x1e')],'include':_0x126b80[_0xa87d('0x20')]?_[_0xa87d('0x21')](_0x126b80['include'],function(_0x44b027){return{'model':db[_0x44b027[_0xa87d('0x22')]],'as':_0x44b027['as'],'attributes':_0x44b027['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e4142){logger[_0xa87d('0x11')](_0xa87d('0x25'),_0x42270f);logger[_0xa87d('0x24')](_0xa87d('0x25'),_0x42270f,JSON[_0xa87d('0x15')](_0x4e4142));_0x1514f2(_0x4e4142);})['catch'](function(_0x28a2a0){logger[_0xa87d('0x17')](_0xa87d('0x25'),_0x28a2a0[_0xa87d('0x18')],_0x42270f);_0x369cdd(_0x36ddba[_0xa87d('0x17')](0x1f4,_0x28a2a0[_0xa87d('0x18')]));});});}; \ No newline at end of file +var _0x92c3=['redis','socket.io-emitter','./voiceQueue.socket','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','result','catch','VoiceQueue','findAll','options','raw','limit','map','model','attributes','include','GetVoiceQueue','find','where','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','defaults'];(function(_0x24c963,_0x5f32a4){var _0x32a0eb=function(_0x3fd2eb){while(--_0x3fd2eb){_0x24c963['push'](_0x24c963['shift']());}};_0x32a0eb(++_0x5f32a4);}(_0x92c3,0x1ca));var _0x392c=function(_0x584bf4,_0x16c912){_0x584bf4=_0x584bf4-0x0;var _0x275380=_0x92c3[_0x584bf4];return _0x275380;};'use strict';var _=require(_0x392c('0x0'));var util=require(_0x392c('0x1'));var moment=require(_0x392c('0x2'));var BPromise=require(_0x392c('0x3'));var rs=require(_0x392c('0x4'));var fs=require('fs');var Redis=require(_0x392c('0x5'));var db=require(_0x392c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x392c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x392c('0x8')]['http']({'port':0x232a});config['redis']=_[_0x392c('0x9')](config[_0x392c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x392c('0xb'))(new Redis(config[_0x392c('0xa')]));require(_0x392c('0xc'))['register'](socket);function respondWithRpcPromise(_0x5613cd,_0x3f0fea,_0x35f730){return new BPromise(function(_0x5ed916,_0xb6e12){return client[_0x392c('0xd')](_0x5613cd,_0x35f730)[_0x392c('0xe')](function(_0x2aaf2f){logger[_0x392c('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x3f0fea,_0x392c('0x10'));logger[_0x392c('0x11')](_0x392c('0x12'),_0x3f0fea,_0x392c('0x10'),JSON[_0x392c('0x13')](_0x2aaf2f));if(_0x2aaf2f['error']){if(_0x2aaf2f[_0x392c('0x14')][_0x392c('0x15')]===0x1f4){logger[_0x392c('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x3f0fea,_0x2aaf2f[_0x392c('0x14')][_0x392c('0x16')]);return _0xb6e12(_0x2aaf2f[_0x392c('0x14')][_0x392c('0x16')]);}logger[_0x392c('0x14')](_0x392c('0x17'),_0x3f0fea,_0x2aaf2f[_0x392c('0x14')][_0x392c('0x16')]);return _0x5ed916(_0x2aaf2f['error'][_0x392c('0x16')]);}else{logger[_0x392c('0xf')](_0x392c('0x17'),_0x3f0fea,_0x392c('0x10'));_0x5ed916(_0x2aaf2f[_0x392c('0x18')][_0x392c('0x16')]);}})[_0x392c('0x19')](function(_0x3213f7){logger['error'](_0x392c('0x17'),_0x3f0fea,_0x3213f7);_0xb6e12(_0x3213f7);});});}exports['GetVoiceQueue']=function(_0x492c8c){var _0x56a93d=this;return new Promise(function(_0x237ab7,_0x2f35e8){return db[_0x392c('0x1a')][_0x392c('0x1b')]({'raw':_0x492c8c['options']?_0x492c8c[_0x392c('0x1c')][_0x392c('0x1d')]===undefined?!![]:![]:!![],'where':_0x492c8c[_0x392c('0x1c')]?_0x492c8c['options']['where']||null:null,'attributes':_0x492c8c[_0x392c('0x1c')]?_0x492c8c[_0x392c('0x1c')]['attributes']||null:null,'limit':_0x492c8c[_0x392c('0x1c')]?_0x492c8c[_0x392c('0x1c')][_0x392c('0x1e')]||null:null,'include':_0x492c8c[_0x392c('0x1c')]?_0x492c8c[_0x392c('0x1c')]['include']?_[_0x392c('0x1f')](_0x492c8c['options']['include'],function(_0x1b45b9){return{'model':db[_0x1b45b9[_0x392c('0x20')]],'as':_0x1b45b9['as'],'attributes':_0x1b45b9[_0x392c('0x21')],'include':_0x1b45b9[_0x392c('0x22')]?_['map'](_0x1b45b9[_0x392c('0x22')],function(_0x5d0a98){return{'model':db[_0x5d0a98[_0x392c('0x20')]],'as':_0x5d0a98['as'],'attributes':_0x5d0a98[_0x392c('0x21')],'include':_0x5d0a98[_0x392c('0x22')]?_[_0x392c('0x1f')](_0x5d0a98['include'],function(_0xea5f2e){return{'model':db[_0xea5f2e[_0x392c('0x20')]],'as':_0xea5f2e['as'],'attributes':_0xea5f2e[_0x392c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x392c('0xe')](function(_0x3de053){logger[_0x392c('0xf')](_0x392c('0x23'),_0x492c8c);logger['debug'](_0x392c('0x23'),_0x492c8c,JSON[_0x392c('0x13')](_0x3de053));_0x237ab7(_0x3de053);})[_0x392c('0x19')](function(_0x5ec015){logger['error']('GetVoiceQueue',_0x5ec015[_0x392c('0x16')],_0x492c8c);_0x2f35e8(_0x56a93d[_0x392c('0x14')](0x1f4,_0x5ec015[_0x392c('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x5bcc8b){var _0xa8d2e7=this;return new Promise(function(_0x4206b8,_0x1bf2bd){return db['VoiceQueue'][_0x392c('0x24')]({'raw':_0x5bcc8b['options']?_0x5bcc8b[_0x392c('0x1c')][_0x392c('0x1d')]===undefined?!![]:![]:!![],'where':_0x5bcc8b[_0x392c('0x1c')]?_0x5bcc8b[_0x392c('0x1c')][_0x392c('0x25')]||null:null,'attributes':_0x5bcc8b['options']?_0x5bcc8b[_0x392c('0x1c')]['attributes']||null:null,'include':_0x5bcc8b[_0x392c('0x1c')]?_0x5bcc8b[_0x392c('0x1c')][_0x392c('0x22')]?_['map'](_0x5bcc8b[_0x392c('0x1c')][_0x392c('0x22')],function(_0x45e19a){return{'model':db[_0x45e19a['model']],'as':_0x45e19a['as'],'attributes':_0x45e19a[_0x392c('0x21')],'include':_0x45e19a[_0x392c('0x22')]?_['map'](_0x45e19a['include'],function(_0x2c09f2){return{'model':db[_0x2c09f2[_0x392c('0x20')]],'as':_0x2c09f2['as'],'attributes':_0x2c09f2['attributes'],'include':_0x2c09f2[_0x392c('0x22')]?_['map'](_0x2c09f2[_0x392c('0x22')],function(_0x147d47){return{'model':db[_0x147d47[_0x392c('0x20')]],'as':_0x147d47['as'],'attributes':_0x147d47[_0x392c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x392c('0xe')](function(_0x5f0061){logger[_0x392c('0xf')](_0x392c('0x26'),_0x5bcc8b);logger[_0x392c('0x11')](_0x392c('0x26'),_0x5bcc8b,JSON[_0x392c('0x13')](_0x5f0061));_0x4206b8(_0x5f0061);})['catch'](function(_0x1b9335){logger['error']('ShowVoiceQueue',_0x1b9335[_0x392c('0x16')],_0x5bcc8b);_0x1bf2bd(_0xa8d2e7[_0x392c('0x14')](0x1f4,_0x1b9335[_0x392c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e8010e3..4060dd8 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 _0x142c=['removeListener','register','voiceQueue:','./voiceQueue.events','remove','update','emit'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x142c,0x16f));var _0xc142=function(_0x2ae88b,_0x502006){_0x2ae88b=_0x2ae88b-0x0;var _0x3b4288=_0x142c[_0x2ae88b];return _0x3b4288;};'use strict';var VoiceQueueEvents=require(_0xc142('0x0'));var events=['save',_0xc142('0x1'),_0xc142('0x2')];function createListener(_0x121318,_0x19087a){return function(_0x255b6f){_0x19087a[_0xc142('0x3')](_0x121318,_0x255b6f);};}function removeListener(_0x336177,_0x2db2e3){return function(){VoiceQueueEvents[_0xc142('0x4')](_0x336177,_0x2db2e3);};}exports[_0xc142('0x5')]=function(_0x599e9e){for(var _0x1fc8bc=0x0,_0x10d2f4=events['length'];_0x1fc8bc<_0x10d2f4;_0x1fc8bc++){var _0x3505b2=events[_0x1fc8bc];var _0x6566e=createListener(_0xc142('0x6')+_0x3505b2,_0x599e9e);VoiceQueueEvents['on'](_0x3505b2,_0x6566e);}}; \ No newline at end of file +var _0x6ebb=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','remove','update'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x6ebb,0x7d));var _0xb6eb=function(_0x1bb6dd,_0x4a0db2){_0x1bb6dd=_0x1bb6dd-0x0;var _0x4731bf=_0x6ebb[_0x1bb6dd];return _0x4731bf;};'use strict';var VoiceQueueEvents=require(_0xb6eb('0x0'));var events=['save',_0xb6eb('0x1'),_0xb6eb('0x2')];function createListener(_0x48c98c,_0x270aae){return function(_0x3c1fde){_0x270aae[_0xb6eb('0x3')](_0x48c98c,_0x3c1fde);};}function removeListener(_0x36af11,_0x21988f){return function(){VoiceQueueEvents[_0xb6eb('0x4')](_0x36af11,_0x21988f);};}exports[_0xb6eb('0x5')]=function(_0x53bc69){for(var _0x4cd31f=0x0,_0x1170c8=events[_0xb6eb('0x6')];_0x4cd31f<_0x1170c8;_0x4cd31f++){var _0x37ea9b=events[_0x4cd31f];var _0x11576c=createListener(_0xb6eb('0x7')+_0x37ea9b,_0x53bc69);VoiceQueueEvents['on'](_0x37ea9b,_0x11576c);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 3b39632..bad0c07 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 _0x556f=['Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','destroy','multer','util','path','express'];(function(_0x215f81,_0x39c84e){var _0x2fe658=function(_0x2b3d0e){while(--_0x2b3d0e){_0x215f81['push'](_0x215f81['shift']());}};_0x2fe658(++_0x39c84e);}(_0x556f,0x150));var _0xf556=function(_0x29daa3,_0x1559e3){_0x29daa3=_0x29daa3-0x0;var _0x587926=_0x556f[_0x29daa3];return _0x587926;};'use strict';var multer=require(_0xf556('0x0'));var util=require(_0xf556('0x1'));var path=require(_0xf556('0x2'));var timeout=require('connect-timeout');var express=require(_0xf556('0x3'));var router=express[_0xf556('0x4')]();var fs_extra=require(_0xf556('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf556('0x6'));var config=require(_0xf556('0x7'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf556('0x8')]);router[_0xf556('0x9')]('/describe',auth[_0xf556('0xa')](),controller['describe']);router[_0xf556('0x9')](_0xf556('0xb'),auth[_0xf556('0xa')](),controller[_0xf556('0xc')]);router['get'](_0xf556('0xd'),auth['isAuthenticated'](),controller[_0xf556('0xe')]);router[_0xf556('0xf')]('/',auth['isAuthenticated'](),controller[_0xf556('0x10')]);router[_0xf556('0x11')](_0xf556('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf556('0x12')]('/:id',auth[_0xf556('0xa')](),controller[_0xf556('0x13')]);module['exports']=router; \ No newline at end of file +var _0x68cf=['put','delete','destroy','multer','express','Router','../../components/auth/service','./voiceQueueReport.controller','get','/describe','isAuthenticated','getVoiceQueuesReport','/:id','post','create'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x68cf,0xd5));var _0xf68c=function(_0x35f1d8,_0x5e9c25){_0x35f1d8=_0x35f1d8-0x0;var _0x574a2a=_0x68cf[_0x35f1d8];return _0x574a2a;};'use strict';var multer=require(_0xf68c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf68c('0x1'));var router=express[_0xf68c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf68c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf68c('0x4'));router[_0xf68c('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf68c('0x5')](_0xf68c('0x6'),auth[_0xf68c('0x7')](),controller['describe']);router[_0xf68c('0x5')]('/index',auth[_0xf68c('0x7')](),controller[_0xf68c('0x8')]);router[_0xf68c('0x5')](_0xf68c('0x9'),auth[_0xf68c('0x7')](),controller['show']);router[_0xf68c('0xa')]('/',auth[_0xf68c('0x7')](),controller[_0xf68c('0xb')]);router[_0xf68c('0xc')](_0xf68c('0x9'),auth[_0xf68c('0x7')](),controller['update']);router[_0xf68c('0xd')]('/:id',auth[_0xf68c('0x7')](),controller[_0xf68c('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index f681a50..106533e 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 _0x22ea=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment'];(function(_0x160366,_0x4ec82e){var _0x4479ad=function(_0x3d402a){while(--_0x3d402a){_0x160366['push'](_0x160366['shift']());}};_0x4479ad(++_0x4ec82e);}(_0x22ea,0xc1));var _0xa22e=function(_0xc4e62d,_0xffcefe){_0xc4e62d=_0xc4e62d-0x0;var _0x50440f=_0x22ea[_0xc4e62d];return _0x50440f;};'use strict';var Sequelize=require(_0xa22e('0x0'));var moment=require(_0xa22e('0x1'));module[_0xa22e('0x2')]={'type':{'type':Sequelize[_0xa22e('0x3')]},'uniqueid':{'type':Sequelize[_0xa22e('0x3')]},'calleridnum':{'type':Sequelize[_0xa22e('0x3')]},'calleridname':{'type':Sequelize[_0xa22e('0x3')]},'queue':{'type':Sequelize[_0xa22e('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xa22e('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xa22e('0x4')],'set':function(_0x2640a5){var _0x55da87=moment(_0x2640a5);var _0x9853d1=moment(this[_0xa22e('0x5')](_0xa22e('0x6')))[_0xa22e('0x7')](_0xa22e('0x8'));var _0x16666a=_0x55da87[_0xa22e('0x9')](_0x9853d1,'seconds');this[_0xa22e('0xa')]('queuecallerleaveAt',_0x2640a5);this[_0xa22e('0xa')](_0xa22e('0xb'),_0x16666a||null);}},'position':{'type':Sequelize[_0xa22e('0xc')]},'count':{'type':Sequelize[_0xa22e('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xa22e('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xa22e('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa22e('0x4')]},'queuecallerexit':{'type':Sequelize[_0xa22e('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xa22e('0x3')],'comment':_0xa22e('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xa22e('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa22e('0x3')]},'context':{'type':Sequelize[_0xa22e('0x3')]},'exten':{'type':Sequelize[_0xa22e('0x3')]},'priority':{'type':Sequelize[_0xa22e('0x3')]},'holdtime':{'type':Sequelize[_0xa22e('0xc')]},'mohtime':{'type':Sequelize[_0xa22e('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa22e('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa22e('0x3')]},'transfer':{'type':Sequelize[_0xa22e('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa22e('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xa22e('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa22e('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa22e('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xa22e('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9156=['setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds'];(function(_0x59794f,_0x4ab1ad){var _0x1c5919=function(_0x3ec043){while(--_0x3ec043){_0x59794f['push'](_0x59794f['shift']());}};_0x1c5919(++_0x4ab1ad);}(_0x9156,0x155));var _0x6915=function(_0x14c95b,_0x3e3711){_0x14c95b=_0x14c95b-0x0;var _0x16f2c7=_0x9156[_0x14c95b];return _0x16f2c7;};'use strict';var Sequelize=require(_0x6915('0x0'));var moment=require(_0x6915('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6915('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6915('0x2')]},'queue':{'type':Sequelize[_0x6915('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x6915('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x6915('0x3')],'set':function(_0xe3813e){var _0x55072c=moment(_0xe3813e);var _0x5eec15=moment(this[_0x6915('0x4')](_0x6915('0x5')))[_0x6915('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x490729=_0x55072c[_0x6915('0x7')](_0x5eec15,_0x6915('0x8'));this[_0x6915('0x9')](_0x6915('0xa'),_0xe3813e);this[_0x6915('0x9')]('holdtime',_0x490729||null);}},'position':{'type':Sequelize[_0x6915('0xb')]},'count':{'type':Sequelize[_0x6915('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x6915('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6915('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x6915('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x6915('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6915('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x6915('0xb')]},'channel':{'type':Sequelize[_0x6915('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6915('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6915('0x2')]},'context':{'type':Sequelize[_0x6915('0x2')]},'exten':{'type':Sequelize[_0x6915('0x2')]},'priority':{'type':Sequelize[_0x6915('0x2')]},'holdtime':{'type':Sequelize[_0x6915('0xb')]},'mohtime':{'type':Sequelize[_0x6915('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6915('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6915('0x2')]},'transfer':{'type':Sequelize[_0x6915('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x6915('0xd')},'transferexten':{'type':Sequelize[_0x6915('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6915('0x2')]},'secondDisposition':{'type':Sequelize[_0x6915('0x2')]},'thirdDisposition':{'type':Sequelize[_0x6915('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x6915('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index c3c0306..b610540 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 _0xda1c=['bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./voiceQueueReport.socket','register','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','body','describe','merge','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x3b98dd,_0x59ba68){var _0x417f3b=function(_0x4670be){while(--_0x4670be){_0x3b98dd['push'](_0x3b98dd['shift']());}};_0x417f3b(++_0x59ba68);}(_0xda1c,0x13b));var _0xcda1=function(_0x3634b8,_0x220733){_0x3634b8=_0x3634b8-0x0;var _0x55c75c=_0xda1c[_0x3634b8];return _0x55c75c;};'use strict';var emlformat=require(_0xcda1('0x0'));var rimraf=require(_0xcda1('0x1'));var zipdir=require(_0xcda1('0x2'));var jsonpatch=require(_0xcda1('0x3'));var rp=require('request-promise');var moment=require(_0xcda1('0x4'));var BPromise=require(_0xcda1('0x5'));var Mustache=require(_0xcda1('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcda1('0x7'));var csv=require(_0xcda1('0x8'));var ejs=require(_0xcda1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcda1('0xa'));var squel=require(_0xcda1('0xb'));var crypto=require(_0xcda1('0xc'));var jsforce=require(_0xcda1('0xd'));var deskjs=require(_0xcda1('0xe'));var toCsv=require(_0xcda1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcda1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcda1('0x10'));var as=require(_0xcda1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcda1('0x12'));var utils=require(_0xcda1('0x13'));var config=require(_0xcda1('0x14'));var licenseUtil=require(_0xcda1('0x15'));var db=require(_0xcda1('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcda1('0x17'))(new Redis(config[_0xcda1('0x18')]));require(_0xcda1('0x19'))[_0xcda1('0x1a')](socket);function respondWithStatusCode(_0xec08f,_0x4661fd){_0x4661fd=_0x4661fd||0xcc;return function(_0x217cce){if(_0x217cce){return _0xec08f['sendStatus'](_0x4661fd);}return _0xec08f['status'](_0x4661fd)['end']();};}function respondWithResult(_0xcbf43,_0x261a98){_0x261a98=_0x261a98||0xc8;return function(_0x31c639){if(_0x31c639){return _0xcbf43[_0xcda1('0x1b')](_0x261a98)[_0xcda1('0x1c')](_0x31c639);}};}function respondWithFilteredResult(_0x1624e3,_0x382a0d){return function(_0x4c3751){if(_0x4c3751){var _0x3ac99c=typeof _0x382a0d['offset']===_0xcda1('0x1d')&&typeof _0x382a0d[_0xcda1('0x1e')]===_0xcda1('0x1d');var _0x3c080f=_0x4c3751[_0xcda1('0x1f')];var _0x53c5f2=_0x3ac99c?0x0:_0x382a0d[_0xcda1('0x20')];var _0x33402f=_0x3ac99c?_0x4c3751[_0xcda1('0x1f')]:_0x382a0d[_0xcda1('0x20')]+_0x382a0d[_0xcda1('0x1e')];var _0x49763f;if(_0x33402f>=_0x3c080f){_0x33402f=_0x3c080f;_0x49763f=0xc8;}else{_0x49763f=0xce;}_0x1624e3[_0xcda1('0x1b')](_0x49763f);return _0x1624e3[_0xcda1('0x21')]('Content-Range',_0x53c5f2+'-'+_0x33402f+'/'+_0x3c080f)[_0xcda1('0x1c')](_0x4c3751);}return null;};}function patchUpdates(_0x547232){return function(_0x4e92d3){try{jsonpatch['apply'](_0x4e92d3,_0x547232,!![]);}catch(_0x255a87){return BPromise[_0xcda1('0x22')](_0x255a87);}return _0x4e92d3[_0xcda1('0x23')]();};}function saveUpdates(_0x53d7a3,_0x5c0395){return function(_0x47b0a7){if(_0x47b0a7){return _0x47b0a7[_0xcda1('0x24')](_0x53d7a3)[_0xcda1('0x25')](function(_0xf00df2){return _0xf00df2;});}return null;};}function removeEntity(_0x378b29,_0x4da54d){return function(_0x5f2f89){if(_0x5f2f89){return _0x5f2f89[_0xcda1('0x26')]()[_0xcda1('0x25')](function(){_0x378b29['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x549258,_0x280a9a){return function(_0x895670){if(!_0x895670){_0x549258[_0xcda1('0x27')](0x194);}return _0x895670;};}function handleError(_0x11ff3b,_0x5fac0f){_0x5fac0f=_0x5fac0f||0x1f4;return function(_0x3a7051){logger[_0xcda1('0x28')](_0x3a7051[_0xcda1('0x29')]);if(_0x3a7051[_0xcda1('0x2a')]){delete _0x3a7051[_0xcda1('0x2a')];}_0x11ff3b[_0xcda1('0x1b')](_0x5fac0f)[_0xcda1('0x2b')](_0x3a7051);};}exports[_0xcda1('0x2c')]=function(_0x538af0,_0x2565cc){var _0x32f6be={},_0x3d7d47={},_0x3d5cf8={'count':0x0,'rows':[]};var _0x1faa40=_[_0xcda1('0x2d')](db[_0xcda1('0x2e')][_0xcda1('0x2f')],function(_0x5d935a){return{'name':_0x5d935a['fieldName'],'type':_0x5d935a[_0xcda1('0x30')][_0xcda1('0x31')]};});_0x3d7d47[_0xcda1('0x32')]=_[_0xcda1('0x2d')](_0x1faa40,_0xcda1('0x2a'));_0x3d7d47[_0xcda1('0x33')]=_['keys'](_0x538af0['query']);_0x3d7d47[_0xcda1('0x34')]=_['intersection'](_0x3d7d47[_0xcda1('0x32')],_0x3d7d47['query']);_0x32f6be[_0xcda1('0x35')]=_['intersection'](_0x3d7d47[_0xcda1('0x32')],qs[_0xcda1('0x36')](_0x538af0[_0xcda1('0x33')][_0xcda1('0x36')]));_0x32f6be[_0xcda1('0x35')]=_0x32f6be[_0xcda1('0x35')][_0xcda1('0x37')]?_0x32f6be[_0xcda1('0x35')]:_0x3d7d47['model'];if(!_0x538af0[_0xcda1('0x33')][_0xcda1('0x38')](_0xcda1('0x39'))){_0x32f6be[_0xcda1('0x1e')]=qs[_0xcda1('0x1e')](_0x538af0[_0xcda1('0x33')][_0xcda1('0x1e')]);_0x32f6be[_0xcda1('0x20')]=qs[_0xcda1('0x20')](_0x538af0[_0xcda1('0x33')][_0xcda1('0x20')]);}_0x32f6be[_0xcda1('0x3a')]=qs[_0xcda1('0x3b')](_0x538af0[_0xcda1('0x33')]['sort']);_0x32f6be[_0xcda1('0x3c')]=qs[_0xcda1('0x34')](_[_0xcda1('0x3d')](_0x538af0[_0xcda1('0x33')],_0x3d7d47[_0xcda1('0x34')]),_0x1faa40);if(_0x538af0['query'][_0xcda1('0x3e')]){_0x32f6be[_0xcda1('0x3c')]=_['merge'](_0x32f6be[_0xcda1('0x3c')],{'$or':_['map'](_0x1faa40,function(_0x384743){if(_0x384743[_0xcda1('0x30')]!==_0xcda1('0x3f')){var _0x55fc8a={};_0x55fc8a[_0x384743[_0xcda1('0x2a')]]={'$like':'%'+_0x538af0[_0xcda1('0x33')][_0xcda1('0x3e')]+'%'};return _0x55fc8a;}})});}_0x32f6be=_['merge']({},_0x32f6be,_0x538af0[_0xcda1('0x40')]);var _0x5c01dd={'where':_0x32f6be[_0xcda1('0x3c')]};return db[_0xcda1('0x2e')][_0xcda1('0x1f')](_0x5c01dd)[_0xcda1('0x25')](function(_0x43d0da){_0x3d5cf8[_0xcda1('0x1f')]=_0x43d0da;if(_0x538af0[_0xcda1('0x33')]['includeAll']){_0x32f6be[_0xcda1('0x41')]=[{'all':!![]}];}return db[_0xcda1('0x2e')][_0xcda1('0x42')](_0x32f6be);})[_0xcda1('0x25')](function(_0x3ef665){_0x3d5cf8[_0xcda1('0x43')]=_0x3ef665;return _0x3d5cf8;})[_0xcda1('0x25')](respondWithFilteredResult(_0x2565cc,_0x32f6be))[_0xcda1('0x44')](handleError(_0x2565cc,null));};exports[_0xcda1('0x45')]=function(_0x5eda80,_0x2efa8a){var _0x4ed552={'raw':![],'where':{'id':_0x5eda80[_0xcda1('0x46')]['id']}},_0x255a08={};_0x255a08[_0xcda1('0x32')]=_[_0xcda1('0x47')](db[_0xcda1('0x2e')]['rawAttributes']);_0x255a08['query']=_['keys'](_0x5eda80[_0xcda1('0x33')]);_0x255a08['filters']=_[_0xcda1('0x48')](_0x255a08[_0xcda1('0x32')],_0x255a08['query']);_0x4ed552[_0xcda1('0x35')]=_[_0xcda1('0x48')](_0x255a08[_0xcda1('0x32')],qs[_0xcda1('0x36')](_0x5eda80[_0xcda1('0x33')][_0xcda1('0x36')]));_0x4ed552[_0xcda1('0x35')]=_0x4ed552[_0xcda1('0x35')][_0xcda1('0x37')]?_0x4ed552[_0xcda1('0x35')]:_0x255a08['model'];if(_0x5eda80[_0xcda1('0x33')][_0xcda1('0x49')]){_0x4ed552[_0xcda1('0x41')]=[{'all':!![]}];}_0x4ed552=_['merge']({},_0x4ed552,_0x5eda80[_0xcda1('0x40')]);return db[_0xcda1('0x2e')][_0xcda1('0x4a')](_0x4ed552)[_0xcda1('0x25')](handleEntityNotFound(_0x2efa8a,null))[_0xcda1('0x25')](respondWithResult(_0x2efa8a,null))[_0xcda1('0x44')](handleError(_0x2efa8a,null));};exports['create']=function(_0x4dc353,_0x304478){return db[_0xcda1('0x2e')][_0xcda1('0x4b')](_0x4dc353['body'],{})[_0xcda1('0x25')](respondWithResult(_0x304478,0xc9))[_0xcda1('0x44')](handleError(_0x304478,null));};exports[_0xcda1('0x24')]=function(_0xdca3e2,_0x32fd71){if(_0xdca3e2[_0xcda1('0x4c')]['id']){delete _0xdca3e2[_0xcda1('0x4c')]['id'];}return db['VoiceQueueReport'][_0xcda1('0x4a')]({'where':{'id':_0xdca3e2[_0xcda1('0x46')]['id']}})[_0xcda1('0x25')](handleEntityNotFound(_0x32fd71,null))[_0xcda1('0x25')](saveUpdates(_0xdca3e2[_0xcda1('0x4c')],null))['then'](respondWithResult(_0x32fd71,null))[_0xcda1('0x44')](handleError(_0x32fd71,null));};exports[_0xcda1('0x26')]=function(_0x1bb240,_0x2c3610){return db[_0xcda1('0x2e')][_0xcda1('0x4a')]({'where':{'id':_0x1bb240['params']['id']}})[_0xcda1('0x25')](handleEntityNotFound(_0x2c3610,null))[_0xcda1('0x25')](removeEntity(_0x2c3610,null))[_0xcda1('0x44')](handleError(_0x2c3610,null));};exports[_0xcda1('0x4d')]=function(_0x21dea1,_0x20a486){return db['VoiceQueueReport'][_0xcda1('0x4d')]()[_0xcda1('0x25')](respondWithResult(_0x20a486,null))[_0xcda1('0x44')](handleError(_0x20a486,null));};exports['getVoiceQueuesReport']=function(_0x4e4be7,_0x4fef12){var _0x3a28fa={},_0x405bd2={},_0x492b2a={'count':0x0,'rows':[]};_0x405bd2['model']=_[_0xcda1('0x47')](db['VoiceQueueReport'][_0xcda1('0x2f')]);_0x405bd2[_0xcda1('0x33')]=_[_0xcda1('0x47')](_0x4e4be7[_0xcda1('0x33')]);_0x405bd2[_0xcda1('0x34')]=_[_0xcda1('0x48')](_0x405bd2[_0xcda1('0x32')],_0x405bd2[_0xcda1('0x33')]);_0x3a28fa['attributes']=_[_0xcda1('0x48')](_0x405bd2[_0xcda1('0x32')],qs['fields'](_0x4e4be7[_0xcda1('0x33')][_0xcda1('0x36')]));_0x3a28fa[_0xcda1('0x35')]=_0x3a28fa[_0xcda1('0x35')][_0xcda1('0x37')]?_0x3a28fa[_0xcda1('0x35')]:_0x405bd2['model'];if(!_0x4e4be7['query'][_0xcda1('0x38')](_0xcda1('0x39'))){_0x3a28fa['limit']=qs[_0xcda1('0x1e')](_0x4e4be7['query'][_0xcda1('0x1e')]);_0x3a28fa[_0xcda1('0x20')]=qs[_0xcda1('0x20')](_0x4e4be7[_0xcda1('0x33')][_0xcda1('0x20')]);}_0x3a28fa[_0xcda1('0x3a')]=qs[_0xcda1('0x3b')](_0x4e4be7[_0xcda1('0x33')][_0xcda1('0x3b')]);_0x3a28fa[_0xcda1('0x3c')]=qs[_0xcda1('0x34')](_[_0xcda1('0x3d')](_0x4e4be7['query'],_0x405bd2[_0xcda1('0x34')]));if(_0x4e4be7[_0xcda1('0x33')][_0xcda1('0x3e')]){_0x3a28fa['where']=_[_0xcda1('0x4e')](_0x3a28fa[_0xcda1('0x3c')],{'$or':_[_0xcda1('0x2d')](_0x3a28fa['attributes'],function(_0x2b3fb4){var _0x4125c4={};_0x4125c4[_0x2b3fb4]={'$like':'%'+_0x4e4be7['query']['filter']+'%'};return _0x4125c4;})});}_0x3a28fa=_[_0xcda1('0x4e')]({},_0x3a28fa,_0x4e4be7[_0xcda1('0x40')]);var _0x26ba9b={'where':_0x3a28fa[_0xcda1('0x3c')]};return db[_0xcda1('0x2e')][_0xcda1('0x1f')](_0x26ba9b)[_0xcda1('0x25')](function(_0x452674){_0x492b2a[_0xcda1('0x1f')]=_0x452674;if(_0x4e4be7[_0xcda1('0x33')][_0xcda1('0x49')]){_0x3a28fa[_0xcda1('0x41')]=[{'all':!![]}];}return db[_0xcda1('0x2e')][_0xcda1('0x42')](_0x3a28fa);})[_0xcda1('0x25')](function(_0xf2a8ef){_0x492b2a['rows']=_0xf2a8ef;return _0x492b2a;})[_0xcda1('0x25')](respondWithFilteredResult(_0x4fef12,_0x3a28fa,_0xcda1('0x4f')))[_0xcda1('0x44')](handleError(_0x4fef12,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x5f44=['sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','reject','save','update','then','error','stack','send','index','map','VoiceQueueReport','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','destroy','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register'];(function(_0x1caa1d,_0xa95047){var _0xa05f41=function(_0xc58853){while(--_0xc58853){_0x1caa1d['push'](_0x1caa1d['shift']());}};_0xa05f41(++_0xa95047);}(_0x5f44,0x87));var _0x45f4=function(_0xfa9fa9,_0x4f5d57){_0xfa9fa9=_0xfa9fa9-0x0;var _0x189447=_0x5f44[_0xfa9fa9];return _0x189447;};'use strict';var emlformat=require(_0x45f4('0x0'));var rimraf=require(_0x45f4('0x1'));var zipdir=require(_0x45f4('0x2'));var jsonpatch=require(_0x45f4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x45f4('0x4'));var Mustache=require('mustache');var util=require(_0x45f4('0x5'));var path=require(_0x45f4('0x6'));var sox=require('sox');var csv=require(_0x45f4('0x7'));var ejs=require(_0x45f4('0x8'));var fs=require('fs');var fs_extra=require(_0x45f4('0x9'));var _=require(_0x45f4('0xa'));var squel=require(_0x45f4('0xb'));var crypto=require(_0x45f4('0xc'));var jsforce=require(_0x45f4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x45f4('0xe'));var Redis=require(_0x45f4('0xf'));var authService=require(_0x45f4('0x10'));var qs=require(_0x45f4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x45f4('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x45f4('0x13'));var db=require(_0x45f4('0x14'))['db'];config[_0x45f4('0x15')]=_[_0x45f4('0x16')](config[_0x45f4('0x15')],{'host':_0x45f4('0x17'),'port':0x18eb});var socket=require(_0x45f4('0x18'))(new Redis(config[_0x45f4('0x15')]));require(_0x45f4('0x19'))[_0x45f4('0x1a')](socket);function respondWithStatusCode(_0x307296,_0x53973c){_0x53973c=_0x53973c||0xcc;return function(_0x5f3421){if(_0x5f3421){return _0x307296[_0x45f4('0x1b')](_0x53973c);}return _0x307296['status'](_0x53973c)[_0x45f4('0x1c')]();};}function respondWithResult(_0x25f010,_0x1b3f35){_0x1b3f35=_0x1b3f35||0xc8;return function(_0x31faaf){if(_0x31faaf){return _0x25f010['status'](_0x1b3f35)[_0x45f4('0x1d')](_0x31faaf);}};}function respondWithFilteredResult(_0x56667f,_0x576bc0){return function(_0x383125){if(_0x383125){var _0xee62a8=typeof _0x576bc0['offset']===_0x45f4('0x1e')&&typeof _0x576bc0[_0x45f4('0x1f')]===_0x45f4('0x1e');var _0x407855=_0x383125[_0x45f4('0x20')];var _0xcbc3cb=_0xee62a8?0x0:_0x576bc0['offset'];var _0x3453ca=_0xee62a8?_0x383125[_0x45f4('0x20')]:_0x576bc0[_0x45f4('0x21')]+_0x576bc0[_0x45f4('0x1f')];var _0x4a6a8e;if(_0x3453ca>=_0x407855){_0x3453ca=_0x407855;_0x4a6a8e=0xc8;}else{_0x4a6a8e=0xce;}_0x56667f[_0x45f4('0x22')](_0x4a6a8e);return _0x56667f['set'](_0x45f4('0x23'),_0xcbc3cb+'-'+_0x3453ca+'/'+_0x407855)['json'](_0x383125);}return null;};}function patchUpdates(_0x54760d){return function(_0x4b8e07){try{jsonpatch['apply'](_0x4b8e07,_0x54760d,!![]);}catch(_0x1dcd45){return BPromise[_0x45f4('0x24')](_0x1dcd45);}return _0x4b8e07[_0x45f4('0x25')]();};}function saveUpdates(_0x3c4b50,_0x5376fe){return function(_0x3061ee){if(_0x3061ee){return _0x3061ee[_0x45f4('0x26')](_0x3c4b50)[_0x45f4('0x27')](function(_0x89a079){return _0x89a079;});}return null;};}function removeEntity(_0x12acb6,_0x1edf6e){return function(_0x1307e2){if(_0x1307e2){return _0x1307e2['destroy']()[_0x45f4('0x27')](function(){_0x12acb6[_0x45f4('0x22')](0xcc)[_0x45f4('0x1c')]();});}};}function handleEntityNotFound(_0x3bd58d,_0x2704cd){return function(_0xdcb8){if(!_0xdcb8){_0x3bd58d[_0x45f4('0x1b')](0x194);}return _0xdcb8;};}function handleError(_0x879242,_0x3eedf4){_0x3eedf4=_0x3eedf4||0x1f4;return function(_0x4ab9dd){logger[_0x45f4('0x28')](_0x4ab9dd[_0x45f4('0x29')]);if(_0x4ab9dd['name']){delete _0x4ab9dd['name'];}_0x879242[_0x45f4('0x22')](_0x3eedf4)[_0x45f4('0x2a')](_0x4ab9dd);};}exports[_0x45f4('0x2b')]=function(_0x30b8e9,_0x598e1f){var _0x4e2380={},_0x375835={},_0x3b53f3={'count':0x0,'rows':[]};var _0x2c1195=_[_0x45f4('0x2c')](db[_0x45f4('0x2d')]['rawAttributes'],function(_0x42ae39){return{'name':_0x42ae39[_0x45f4('0x2e')],'type':_0x42ae39[_0x45f4('0x2f')][_0x45f4('0x30')]};});_0x375835[_0x45f4('0x31')]=_['map'](_0x2c1195,_0x45f4('0x32'));_0x375835[_0x45f4('0x33')]=_[_0x45f4('0x34')](_0x30b8e9['query']);_0x375835[_0x45f4('0x35')]=_[_0x45f4('0x36')](_0x375835['model'],_0x375835[_0x45f4('0x33')]);_0x4e2380['attributes']=_['intersection'](_0x375835[_0x45f4('0x31')],qs[_0x45f4('0x37')](_0x30b8e9[_0x45f4('0x33')][_0x45f4('0x37')]));_0x4e2380['attributes']=_0x4e2380[_0x45f4('0x38')][_0x45f4('0x39')]?_0x4e2380[_0x45f4('0x38')]:_0x375835[_0x45f4('0x31')];if(!_0x30b8e9[_0x45f4('0x33')]['hasOwnProperty'](_0x45f4('0x3a'))){_0x4e2380[_0x45f4('0x1f')]=qs['limit'](_0x30b8e9[_0x45f4('0x33')][_0x45f4('0x1f')]);_0x4e2380[_0x45f4('0x21')]=qs[_0x45f4('0x21')](_0x30b8e9[_0x45f4('0x33')][_0x45f4('0x21')]);}_0x4e2380[_0x45f4('0x3b')]=qs[_0x45f4('0x3c')](_0x30b8e9['query']['sort']);_0x4e2380[_0x45f4('0x3d')]=qs[_0x45f4('0x35')](_[_0x45f4('0x3e')](_0x30b8e9[_0x45f4('0x33')],_0x375835[_0x45f4('0x35')]),_0x2c1195);if(_0x30b8e9[_0x45f4('0x33')][_0x45f4('0x3f')]){_0x4e2380[_0x45f4('0x3d')]=_[_0x45f4('0x40')](_0x4e2380[_0x45f4('0x3d')],{'$or':_[_0x45f4('0x2c')](_0x2c1195,function(_0x4884f3){if(_0x4884f3[_0x45f4('0x2f')]!==_0x45f4('0x41')){var _0x4d4ea4={};_0x4d4ea4[_0x4884f3[_0x45f4('0x32')]]={'$like':'%'+_0x30b8e9[_0x45f4('0x33')][_0x45f4('0x3f')]+'%'};return _0x4d4ea4;}})});}_0x4e2380=_['merge']({},_0x4e2380,_0x30b8e9[_0x45f4('0x42')]);var _0x731aa0={'where':_0x4e2380[_0x45f4('0x3d')]};return db['VoiceQueueReport'][_0x45f4('0x20')](_0x731aa0)['then'](function(_0x35e920){_0x3b53f3['count']=_0x35e920;if(_0x30b8e9['query'][_0x45f4('0x43')]){_0x4e2380[_0x45f4('0x44')]=[{'all':!![]}];}return db[_0x45f4('0x2d')][_0x45f4('0x45')](_0x4e2380);})['then'](function(_0x3e7005){_0x3b53f3[_0x45f4('0x46')]=_0x3e7005;return _0x3b53f3;})[_0x45f4('0x27')](respondWithFilteredResult(_0x598e1f,_0x4e2380))[_0x45f4('0x47')](handleError(_0x598e1f,null));};exports[_0x45f4('0x48')]=function(_0x146ea8,_0x5533ed){var _0x530d38={'raw':![],'where':{'id':_0x146ea8['params']['id']}},_0x258e61={};_0x258e61[_0x45f4('0x31')]=_['keys'](db[_0x45f4('0x2d')][_0x45f4('0x49')]);_0x258e61['query']=_['keys'](_0x146ea8[_0x45f4('0x33')]);_0x258e61[_0x45f4('0x35')]=_[_0x45f4('0x36')](_0x258e61['model'],_0x258e61['query']);_0x530d38['attributes']=_['intersection'](_0x258e61[_0x45f4('0x31')],qs[_0x45f4('0x37')](_0x146ea8[_0x45f4('0x33')][_0x45f4('0x37')]));_0x530d38[_0x45f4('0x38')]=_0x530d38[_0x45f4('0x38')][_0x45f4('0x39')]?_0x530d38[_0x45f4('0x38')]:_0x258e61[_0x45f4('0x31')];if(_0x146ea8[_0x45f4('0x33')]['includeAll']){_0x530d38[_0x45f4('0x44')]=[{'all':!![]}];}_0x530d38=_[_0x45f4('0x40')]({},_0x530d38,_0x146ea8[_0x45f4('0x42')]);return db[_0x45f4('0x2d')]['find'](_0x530d38)[_0x45f4('0x27')](handleEntityNotFound(_0x5533ed,null))[_0x45f4('0x27')](respondWithResult(_0x5533ed,null))[_0x45f4('0x47')](handleError(_0x5533ed,null));};exports[_0x45f4('0x4a')]=function(_0x46b615,_0x55f1a7){return db[_0x45f4('0x2d')][_0x45f4('0x4a')](_0x46b615[_0x45f4('0x4b')],{})[_0x45f4('0x27')](respondWithResult(_0x55f1a7,0xc9))['catch'](handleError(_0x55f1a7,null));};exports['update']=function(_0x4e27b0,_0xa35e5f){if(_0x4e27b0[_0x45f4('0x4b')]['id']){delete _0x4e27b0[_0x45f4('0x4b')]['id'];}return db[_0x45f4('0x2d')][_0x45f4('0x4c')]({'where':{'id':_0x4e27b0['params']['id']}})['then'](handleEntityNotFound(_0xa35e5f,null))['then'](saveUpdates(_0x4e27b0[_0x45f4('0x4b')],null))[_0x45f4('0x27')](respondWithResult(_0xa35e5f,null))['catch'](handleError(_0xa35e5f,null));};exports[_0x45f4('0x4d')]=function(_0x373f40,_0x5589e6){return db['VoiceQueueReport'][_0x45f4('0x4c')]({'where':{'id':_0x373f40['params']['id']}})[_0x45f4('0x27')](handleEntityNotFound(_0x5589e6,null))['then'](removeEntity(_0x5589e6,null))[_0x45f4('0x47')](handleError(_0x5589e6,null));};exports['describe']=function(_0xfe94f,_0x41d6be){return db[_0x45f4('0x2d')][_0x45f4('0x4e')]()['then'](respondWithResult(_0x41d6be,null))[_0x45f4('0x47')](handleError(_0x41d6be,null));};exports[_0x45f4('0x4f')]=function(_0x357203,_0x3980cb){var _0x4c6817={},_0x29b688={},_0x2c5f94={'count':0x0,'rows':[]};_0x29b688['model']=_[_0x45f4('0x34')](db[_0x45f4('0x2d')][_0x45f4('0x49')]);_0x29b688[_0x45f4('0x33')]=_[_0x45f4('0x34')](_0x357203[_0x45f4('0x33')]);_0x29b688[_0x45f4('0x35')]=_[_0x45f4('0x36')](_0x29b688[_0x45f4('0x31')],_0x29b688[_0x45f4('0x33')]);_0x4c6817[_0x45f4('0x38')]=_[_0x45f4('0x36')](_0x29b688[_0x45f4('0x31')],qs[_0x45f4('0x37')](_0x357203[_0x45f4('0x33')][_0x45f4('0x37')]));_0x4c6817[_0x45f4('0x38')]=_0x4c6817[_0x45f4('0x38')]['length']?_0x4c6817[_0x45f4('0x38')]:_0x29b688[_0x45f4('0x31')];if(!_0x357203['query'][_0x45f4('0x50')](_0x45f4('0x3a'))){_0x4c6817[_0x45f4('0x1f')]=qs[_0x45f4('0x1f')](_0x357203[_0x45f4('0x33')]['limit']);_0x4c6817[_0x45f4('0x21')]=qs['offset'](_0x357203[_0x45f4('0x33')][_0x45f4('0x21')]);}_0x4c6817[_0x45f4('0x3b')]=qs[_0x45f4('0x3c')](_0x357203['query'][_0x45f4('0x3c')]);_0x4c6817[_0x45f4('0x3d')]=qs[_0x45f4('0x35')](_[_0x45f4('0x3e')](_0x357203[_0x45f4('0x33')],_0x29b688[_0x45f4('0x35')]));if(_0x357203[_0x45f4('0x33')][_0x45f4('0x3f')]){_0x4c6817[_0x45f4('0x3d')]=_[_0x45f4('0x40')](_0x4c6817[_0x45f4('0x3d')],{'$or':_['map'](_0x4c6817['attributes'],function(_0x2c18ce){var _0x2a2324={};_0x2a2324[_0x2c18ce]={'$like':'%'+_0x357203[_0x45f4('0x33')][_0x45f4('0x3f')]+'%'};return _0x2a2324;})});}_0x4c6817=_[_0x45f4('0x40')]({},_0x4c6817,_0x357203[_0x45f4('0x42')]);var _0x240147={'where':_0x4c6817[_0x45f4('0x3d')]};return db[_0x45f4('0x2d')][_0x45f4('0x20')](_0x240147)[_0x45f4('0x27')](function(_0x4e98d3){_0x2c5f94[_0x45f4('0x20')]=_0x4e98d3;if(_0x357203[_0x45f4('0x33')][_0x45f4('0x43')]){_0x4c6817[_0x45f4('0x44')]=[{'all':!![]}];}return db[_0x45f4('0x2d')][_0x45f4('0x45')](_0x4c6817);})['then'](function(_0x1ec133){_0x2c5f94['rows']=_0x1ec133;return _0x2c5f94;})[_0x45f4('0x27')](respondWithFilteredResult(_0x3980cb,_0x4c6817,'getVoiceQueuesReport'))[_0x45f4('0x47')](handleError(_0x3980cb,null,_0x45f4('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index d9ea8fc..28449d5 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 _0xf267=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x38abda,_0xabd6b5){var _0x47c7e2=function(_0x2a8789){while(--_0x2a8789){_0x38abda['push'](_0x38abda['shift']());}};_0x47c7e2(++_0xabd6b5);}(_0xf267,0x1da));var _0x7f26=function(_0x4960d6,_0x36b224){_0x4960d6=_0x4960d6-0x0;var _0x4d23f9=_0xf267[_0x4960d6];return _0x4d23f9;};'use strict';var EventEmitter=require(_0x7f26('0x0'));var VoiceQueueReport=require(_0x7f26('0x1'))['db'][_0x7f26('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7f26('0x3')](0x0);var events={'afterCreate':_0x7f26('0x4'),'afterUpdate':_0x7f26('0x5'),'afterDestroy':_0x7f26('0x6')};function emitEvent(_0x5e0d91){return function(_0x3f1e77,_0x4b3ea4,_0x54a594){VoiceQueueReportEvents['emit'](_0x5e0d91+':'+_0x3f1e77['id'],_0x3f1e77);VoiceQueueReportEvents['emit'](_0x5e0d91,_0x3f1e77);_0x54a594(null);};}for(var e in events){if(events[_0x7f26('0x7')](e)){var event=events[e];VoiceQueueReport[_0x7f26('0x8')](e,emitEvent(event));}}module[_0x7f26('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x4eb1=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x4efbfd,_0x105f75){var _0x4264b8=function(_0x4f232f){while(--_0x4f232f){_0x4efbfd['push'](_0x4efbfd['shift']());}};_0x4264b8(++_0x105f75);}(_0x4eb1,0x14e));var _0x14eb=function(_0x5ce5f5,_0x568672){_0x5ce5f5=_0x5ce5f5-0x0;var _0x11f46f=_0x4eb1[_0x5ce5f5];return _0x11f46f;};'use strict';var EventEmitter=require(_0x14eb('0x0'));var VoiceQueueReport=require(_0x14eb('0x1'))['db'][_0x14eb('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x14eb('0x3')](0x0);var events={'afterCreate':_0x14eb('0x4'),'afterUpdate':_0x14eb('0x5'),'afterDestroy':_0x14eb('0x6')};function emitEvent(_0x18a1bb){return function(_0x3a76e7,_0x45375d,_0x4af1a6){VoiceQueueReportEvents[_0x14eb('0x7')](_0x18a1bb+':'+_0x3a76e7['id'],_0x3a76e7);VoiceQueueReportEvents[_0x14eb('0x7')](_0x18a1bb,_0x3a76e7);_0x4af1a6(null);};}for(var e in events){if(events[_0x14eb('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x14eb('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 828f3e7..65369be 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 _0x65fe=['path','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e5da9,_0x18174f){var _0x52efd4=function(_0x4bed89){while(--_0x4bed89){_0x4e5da9['push'](_0x4e5da9['shift']());}};_0x52efd4(++_0x18174f);}(_0x65fe,0x96));var _0xe65f=function(_0x5ab58d,_0x2f9479){_0x5ab58d=_0x5ab58d-0x0;var _0x2239c7=_0x65fe[_0x5ab58d];return _0x2239c7;};'use strict';var _=require('lodash');var util=require(_0xe65f('0x0'));var logger=require(_0xe65f('0x1'))(_0xe65f('0x2'));var moment=require(_0xe65f('0x3'));var BPromise=require(_0xe65f('0x4'));var rp=require(_0xe65f('0x5'));var fs=require('fs');var path=require(_0xe65f('0x6'));var rimraf=require('rimraf');var config=require(_0xe65f('0x7'));var attributes=require(_0xe65f('0x8'));module[_0xe65f('0x9')]=function(_0x55cc30,_0xa4e320){return _0x55cc30[_0xe65f('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xe65f('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xe65f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb261=['exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','api','path','rimraf','./voiceQueueReport.attributes'];(function(_0x26f7c9,_0x1db9c0){var _0xc0786=function(_0x16948e){while(--_0x16948e){_0x26f7c9['push'](_0x26f7c9['shift']());}};_0xc0786(++_0x1db9c0);}(_0xb261,0x12e));var _0x1b26=function(_0x2c85c0,_0x1dac4f){_0x2c85c0=_0x2c85c0-0x0;var _0xf4d4c9=_0xb261[_0x2c85c0];return _0xf4d4c9;};'use strict';var _=require(_0x1b26('0x0'));var util=require(_0x1b26('0x1'));var logger=require('../../config/logger')(_0x1b26('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b26('0x3'));var rimraf=require(_0x1b26('0x4'));var config=require('../../config/environment');var attributes=require(_0x1b26('0x5'));module[_0x1b26('0x6')]=function(_0x51dad9,_0x3473ad){return _0x51dad9[_0x1b26('0x7')](_0x1b26('0x8'),attributes,{'tableName':_0x1b26('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1b26('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 1c11597..6cc70a2 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 _0x064d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','map','include','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xfed05b,_0x38e624){var _0x46e5d2=function(_0x568568){while(--_0x568568){_0xfed05b['push'](_0xfed05b['shift']());}};_0x46e5d2(++_0x38e624);}(_0x064d,0x1bc));var _0xd064=function(_0x4fb30f,_0x510bb0){_0x4fb30f=_0x4fb30f-0x0;var _0x465c31=_0x064d[_0x4fb30f];return _0x465c31;};'use strict';var _=require('lodash');var util=require(_0xd064('0x0'));var moment=require(_0xd064('0x1'));var BPromise=require(_0xd064('0x2'));var rs=require(_0xd064('0x3'));var fs=require('fs');var Redis=require(_0xd064('0x4'));var db=require(_0xd064('0x5'))['db'];var utils=require(_0xd064('0x6'));var logger=require(_0xd064('0x7'))('rpc');var config=require(_0xd064('0x8'));var jayson=require(_0xd064('0x9'));var client=jayson[_0xd064('0xa')][_0xd064('0xb')]({'port':0x232a});config[_0xd064('0xc')]=_[_0xd064('0xd')](config[_0xd064('0xc')],{'host':_0xd064('0xe'),'port':0x18eb});var socket=require(_0xd064('0xf'))(new Redis(config[_0xd064('0xc')]));require(_0xd064('0x10'))[_0xd064('0x11')](socket);function respondWithRpcPromise(_0x527a2a,_0xa6352c,_0x145525){return new BPromise(function(_0x3b9e40,_0x388085){return client[_0xd064('0x12')](_0x527a2a,_0x145525)[_0xd064('0x13')](function(_0x5ae1a9){logger[_0xd064('0x14')](_0xd064('0x15'),_0xa6352c,_0xd064('0x16'));logger[_0xd064('0x17')](_0xd064('0x18'),_0xa6352c,_0xd064('0x16'),JSON[_0xd064('0x19')](_0x5ae1a9));if(_0x5ae1a9[_0xd064('0x1a')]){if(_0x5ae1a9['error']['code']===0x1f4){logger['error'](_0xd064('0x15'),_0xa6352c,_0x5ae1a9[_0xd064('0x1a')][_0xd064('0x1b')]);return _0x388085(_0x5ae1a9['error'][_0xd064('0x1b')]);}logger[_0xd064('0x1a')](_0xd064('0x15'),_0xa6352c,_0x5ae1a9[_0xd064('0x1a')][_0xd064('0x1b')]);return _0x3b9e40(_0x5ae1a9[_0xd064('0x1a')][_0xd064('0x1b')]);}else{logger[_0xd064('0x14')](_0xd064('0x15'),_0xa6352c,_0xd064('0x16'));_0x3b9e40(_0x5ae1a9[_0xd064('0x1c')][_0xd064('0x1b')]);}})[_0xd064('0x1d')](function(_0x297886){logger['error'](_0xd064('0x15'),_0xa6352c,_0x297886);_0x388085(_0x297886);});});}exports[_0xd064('0x1e')]=function(_0x5015b6){var _0x8b0c44=this;return new Promise(function(_0x23b72d,_0x537935){return db[_0xd064('0x1f')][_0xd064('0x20')]({'raw':_0x5015b6[_0xd064('0x21')]?_0x5015b6['options'][_0xd064('0x22')]===undefined?!![]:![]:!![],'where':_0x5015b6[_0xd064('0x21')]?_0x5015b6[_0xd064('0x21')]['where']||null:null,'attributes':_0x5015b6['options']?_0x5015b6[_0xd064('0x21')][_0xd064('0x23')]||null:null,'limit':_0x5015b6[_0xd064('0x21')]?_0x5015b6[_0xd064('0x21')][_0xd064('0x24')]||null:null,'include':_0x5015b6[_0xd064('0x21')]?_0x5015b6[_0xd064('0x21')]['include']?_[_0xd064('0x25')](_0x5015b6[_0xd064('0x21')][_0xd064('0x26')],function(_0x151f4f){return{'model':db[_0x151f4f['model']],'as':_0x151f4f['as'],'attributes':_0x151f4f[_0xd064('0x23')],'include':_0x151f4f[_0xd064('0x26')]?_[_0xd064('0x25')](_0x151f4f[_0xd064('0x26')],function(_0xb1803f){return{'model':db[_0xb1803f[_0xd064('0x27')]],'as':_0xb1803f['as'],'attributes':_0xb1803f[_0xd064('0x23')],'include':_0xb1803f['include']?_[_0xd064('0x25')](_0xb1803f[_0xd064('0x26')],function(_0x273666){return{'model':db[_0x273666[_0xd064('0x27')]],'as':_0x273666['as'],'attributes':_0x273666[_0xd064('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd064('0x13')](function(_0x27e01a){logger[_0xd064('0x14')]('GetVoiceQueueReport',_0x5015b6);logger[_0xd064('0x17')](_0xd064('0x1e'),_0x5015b6,JSON['stringify'](_0x27e01a));_0x23b72d(_0x27e01a);})[_0xd064('0x1d')](function(_0x484731){logger['error']('GetVoiceQueueReport',_0x484731['message'],_0x5015b6);_0x537935(_0x8b0c44['error'](0x1f4,_0x484731['message']));});});};exports[_0xd064('0x28')]=function(_0x4893d2){var _0x2da0c8=this;return new Promise(function(_0x51596e,_0x52fb6c){return db[_0xd064('0x1f')][_0xd064('0x29')](_0x4893d2[_0xd064('0x2a')],{'raw':_0x4893d2[_0xd064('0x21')]?_0x4893d2['options'][_0xd064('0x22')]===undefined?!![]:![]:!![]})[_0xd064('0x13')](function(_0x11fb86){logger[_0xd064('0x14')](_0xd064('0x28'),_0x4893d2);logger['debug'](_0xd064('0x28'),_0x4893d2,JSON[_0xd064('0x19')](_0x11fb86));_0x51596e(_0x11fb86);})['catch'](function(_0x42b77b){logger[_0xd064('0x1a')](_0xd064('0x28'),_0x42b77b[_0xd064('0x1b')],_0x4893d2);_0x52fb6c(_0x2da0c8['error'](0x1f4,_0x42b77b[_0xd064('0x1b')]));});});};exports[_0xd064('0x2b')]=function(_0x197bd5){var _0xd02902=this;return new Promise(function(_0x2ace10,_0x53a0be){return db['VoiceQueueReport'][_0xd064('0x2c')](_0x197bd5[_0xd064('0x2a')],{'raw':_0x197bd5[_0xd064('0x21')]?_0x197bd5[_0xd064('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x197bd5[_0xd064('0x21')]?_0x197bd5[_0xd064('0x21')]['where']||null:null,'attributes':_0x197bd5['options']?_0x197bd5[_0xd064('0x21')][_0xd064('0x23')]||null:null,'limit':_0x197bd5[_0xd064('0x21')]?_0x197bd5['options']['limit']||null:null})['then'](function(_0x123903){logger[_0xd064('0x14')](_0xd064('0x2b'),_0x197bd5);logger[_0xd064('0x17')](_0xd064('0x2b'),_0x197bd5,JSON[_0xd064('0x19')](_0x123903));_0x2ace10(_0x123903);})[_0xd064('0x1d')](function(_0x5f10da){logger['error'](_0xd064('0x2b'),_0x5f10da[_0xd064('0x1b')],_0x197bd5);_0x53a0be(_0xd02902['error'](0x1f4,_0x5f10da[_0xd064('0x1b')]));});});}; \ No newline at end of file +var _0x5542=['stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','limit','include','model','attributes','map','CreateVoiceQueueReport','create','body','then','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','debug'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0x5542,0x17e));var _0x2554=function(_0x5ecaab,_0x2f3053){_0x5ecaab=_0x5ecaab-0x0;var _0x3db1a8=_0x5542[_0x5ecaab];return _0x3db1a8;};'use strict';var _=require(_0x2554('0x0'));var util=require(_0x2554('0x1'));var moment=require(_0x2554('0x2'));var BPromise=require(_0x2554('0x3'));var rs=require(_0x2554('0x4'));var fs=require('fs');var Redis=require(_0x2554('0x5'));var db=require(_0x2554('0x6'))['db'];var utils=require(_0x2554('0x7'));var logger=require(_0x2554('0x8'))(_0x2554('0x9'));var config=require(_0x2554('0xa'));var jayson=require(_0x2554('0xb'));var client=jayson[_0x2554('0xc')][_0x2554('0xd')]({'port':0x232a});config[_0x2554('0xe')]=_[_0x2554('0xf')](config[_0x2554('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x2554('0x10'))(new Redis(config['redis']));require(_0x2554('0x11'))[_0x2554('0x12')](socket);function respondWithRpcPromise(_0x50a607,_0x3fb5e8,_0x5559af){return new BPromise(function(_0x3dc477,_0x52e6ac){return client[_0x2554('0x13')](_0x50a607,_0x5559af)['then'](function(_0x753d8d){logger[_0x2554('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x3fb5e8,_0x2554('0x15'));logger[_0x2554('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x3fb5e8,_0x2554('0x15'),JSON[_0x2554('0x17')](_0x753d8d));if(_0x753d8d[_0x2554('0x18')]){if(_0x753d8d['error'][_0x2554('0x19')]===0x1f4){logger[_0x2554('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x3fb5e8,_0x753d8d[_0x2554('0x18')]['message']);return _0x52e6ac(_0x753d8d[_0x2554('0x18')][_0x2554('0x1a')]);}logger['error'](_0x2554('0x1b'),_0x3fb5e8,_0x753d8d[_0x2554('0x18')][_0x2554('0x1a')]);return _0x3dc477(_0x753d8d[_0x2554('0x18')][_0x2554('0x1a')]);}else{logger[_0x2554('0x14')](_0x2554('0x1b'),_0x3fb5e8,'request\x20sent');_0x3dc477(_0x753d8d[_0x2554('0x1c')]['message']);}})[_0x2554('0x1d')](function(_0x6ba188){logger[_0x2554('0x18')](_0x2554('0x1b'),_0x3fb5e8,_0x6ba188);_0x52e6ac(_0x6ba188);});});}exports[_0x2554('0x1e')]=function(_0x488f57){var _0x1f8c9a=this;return new Promise(function(_0x4ead39,_0x321d7d){return db[_0x2554('0x1f')][_0x2554('0x20')]({'raw':_0x488f57['options']?_0x488f57[_0x2554('0x21')][_0x2554('0x22')]===undefined?!![]:![]:!![],'where':_0x488f57[_0x2554('0x21')]?_0x488f57[_0x2554('0x21')]['where']||null:null,'attributes':_0x488f57['options']?_0x488f57[_0x2554('0x21')]['attributes']||null:null,'limit':_0x488f57[_0x2554('0x21')]?_0x488f57[_0x2554('0x21')][_0x2554('0x23')]||null:null,'include':_0x488f57['options']?_0x488f57[_0x2554('0x21')][_0x2554('0x24')]?_['map'](_0x488f57[_0x2554('0x21')][_0x2554('0x24')],function(_0x4792b1){return{'model':db[_0x4792b1[_0x2554('0x25')]],'as':_0x4792b1['as'],'attributes':_0x4792b1[_0x2554('0x26')],'include':_0x4792b1[_0x2554('0x24')]?_[_0x2554('0x27')](_0x4792b1[_0x2554('0x24')],function(_0x2ff318){return{'model':db[_0x2ff318[_0x2554('0x25')]],'as':_0x2ff318['as'],'attributes':_0x2ff318[_0x2554('0x26')],'include':_0x2ff318[_0x2554('0x24')]?_[_0x2554('0x27')](_0x2ff318[_0x2554('0x24')],function(_0x4639ac){return{'model':db[_0x4639ac[_0x2554('0x25')]],'as':_0x4639ac['as'],'attributes':_0x4639ac['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x52082d){logger[_0x2554('0x14')](_0x2554('0x1e'),_0x488f57);logger[_0x2554('0x16')](_0x2554('0x1e'),_0x488f57,JSON[_0x2554('0x17')](_0x52082d));_0x4ead39(_0x52082d);})['catch'](function(_0x42d3bb){logger[_0x2554('0x18')](_0x2554('0x1e'),_0x42d3bb[_0x2554('0x1a')],_0x488f57);_0x321d7d(_0x1f8c9a[_0x2554('0x18')](0x1f4,_0x42d3bb[_0x2554('0x1a')]));});});};exports[_0x2554('0x28')]=function(_0x3482c0){var _0x1e61bf=this;return new Promise(function(_0x1fe54c,_0x217248){return db['VoiceQueueReport'][_0x2554('0x29')](_0x3482c0[_0x2554('0x2a')],{'raw':_0x3482c0[_0x2554('0x21')]?_0x3482c0[_0x2554('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x2554('0x2b')](function(_0x66fb42){logger[_0x2554('0x14')](_0x2554('0x28'),_0x3482c0);logger[_0x2554('0x16')](_0x2554('0x28'),_0x3482c0,JSON[_0x2554('0x17')](_0x66fb42));_0x1fe54c(_0x66fb42);})[_0x2554('0x1d')](function(_0x435f10){logger['error'](_0x2554('0x28'),_0x435f10['message'],_0x3482c0);_0x217248(_0x1e61bf[_0x2554('0x18')](0x1f4,_0x435f10['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x2a75be){var _0x25f57f=this;return new Promise(function(_0xecc5a5,_0x4c4a6f){return db[_0x2554('0x1f')]['update'](_0x2a75be[_0x2554('0x2a')],{'raw':_0x2a75be[_0x2554('0x21')]?_0x2a75be[_0x2554('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a75be[_0x2554('0x21')]?_0x2a75be[_0x2554('0x21')]['where']||null:null,'attributes':_0x2a75be['options']?_0x2a75be['options']['attributes']||null:null,'limit':_0x2a75be[_0x2554('0x21')]?_0x2a75be['options'][_0x2554('0x23')]||null:null})[_0x2554('0x2b')](function(_0x3ffaaa){logger[_0x2554('0x14')]('UpdateVoiceQueueReport',_0x2a75be);logger['debug'](_0x2554('0x2c'),_0x2a75be,JSON[_0x2554('0x17')](_0x3ffaaa));_0xecc5a5(_0x3ffaaa);})[_0x2554('0x1d')](function(_0x3c81aa){logger[_0x2554('0x18')](_0x2554('0x2c'),_0x3c81aa[_0x2554('0x1a')],_0x2a75be);_0x4c4a6f(_0x25f57f[_0x2554('0x18')](0x1f4,_0x3c81aa[_0x2554('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 5eb1586..452472a 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 _0xde02=['emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x4609fb,_0x3f9488){var _0x2bf4cc=function(_0x1a8dd0){while(--_0x1a8dd0){_0x4609fb['push'](_0x4609fb['shift']());}};_0x2bf4cc(++_0x3f9488);}(_0xde02,0xd5));var _0x2de0=function(_0xca145c,_0xa3ad0f){_0xca145c=_0xca145c-0x0;var _0x5c7458=_0xde02[_0xca145c];return _0x5c7458;};'use strict';var VoiceQueueReportEvents=require(_0x2de0('0x0'));var events=[_0x2de0('0x1'),_0x2de0('0x2'),'update'];function createListener(_0x57cfa6,_0x376fa7){return function(_0x14f298){_0x376fa7[_0x2de0('0x3')](_0x57cfa6,_0x14f298);};}function removeListener(_0x5987bd,_0xe2c452){return function(){VoiceQueueReportEvents[_0x2de0('0x4')](_0x5987bd,_0xe2c452);};}exports[_0x2de0('0x5')]=function(_0x313e40){for(var _0x42b19a=0x0,_0x4a7cc5=events[_0x2de0('0x6')];_0x42b19a<_0x4a7cc5;_0x42b19a++){var _0x182b39=events[_0x42b19a];var _0x15be24=createListener(_0x2de0('0x7')+_0x182b39,_0x313e40);VoiceQueueReportEvents['on'](_0x182b39,_0x15be24);}}; \ No newline at end of file +var _0x668b=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','register'];(function(_0x4b7788,_0x2033ab){var _0xfa38be=function(_0x41042e){while(--_0x41042e){_0x4b7788['push'](_0x4b7788['shift']());}};_0xfa38be(++_0x2033ab);}(_0x668b,0x8d));var _0xb668=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x668b[_0x16629d];return _0x56ccee;};'use strict';var VoiceQueueReportEvents=require(_0xb668('0x0'));var events=[_0xb668('0x1'),_0xb668('0x2'),_0xb668('0x3')];function createListener(_0x279ff1,_0x34692f){return function(_0x2baf22){_0x34692f[_0xb668('0x4')](_0x279ff1,_0x2baf22);};}function removeListener(_0x26d010,_0x172925){return function(){VoiceQueueReportEvents['removeListener'](_0x26d010,_0x172925);};}exports[_0xb668('0x5')]=function(_0x145564){for(var _0x551fc3=0x0,_0x9482c=events['length'];_0x551fc3<_0x9482c;_0x551fc3++){var _0x22e32c=events[_0x551fc3];var _0x39e907=createListener(_0xb668('0x6')+_0x22e32c,_0x145564);VoiceQueueReportEvents['on'](_0x22e32c,_0x39e907);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 38a765e..d7f4067 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 _0xb59a=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xdc2c3b,_0x42a74a){var _0x2156dd=function(_0x112c41){while(--_0x112c41){_0xdc2c3b['push'](_0xdc2c3b['shift']());}};_0x2156dd(++_0x42a74a);}(_0xb59a,0x1ec));var _0xab59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb59a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab59('0x0'));var util=require('util');var path=require(_0xab59('0x1'));var timeout=require(_0xab59('0x2'));var express=require(_0xab59('0x3'));var router=express[_0xab59('0x4')]();var fs_extra=require(_0xab59('0x5'));var auth=require(_0xab59('0x6'));var interaction=require(_0xab59('0x7'));var config=require(_0xab59('0x8'));var controller=require(_0xab59('0x9'));router[_0xab59('0xa')]('/',auth[_0xab59('0xb')](),controller[_0xab59('0xc')]);router['get'](_0xab59('0xd'),auth[_0xab59('0xb')](),controller[_0xab59('0xe')]);router[_0xab59('0xf')]('/',auth[_0xab59('0xb')](),controller[_0xab59('0x10')]);router['put'](_0xab59('0xd'),auth[_0xab59('0xb')](),controller[_0xab59('0x11')]);router[_0xab59('0x12')](_0xab59('0xd'),auth[_0xab59('0xb')](),controller['destroy']);module[_0xab59('0x13')]=router; \ No newline at end of file +var _0x3738=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3738,0x1e5));var _0x8373=function(_0x3c3daa,_0x3ece95){_0x3c3daa=_0x3c3daa-0x0;var _0x273f7e=_0x3738[_0x3c3daa];return _0x273f7e;};'use strict';var multer=require('multer');var util=require(_0x8373('0x0'));var path=require(_0x8373('0x1'));var timeout=require(_0x8373('0x2'));var express=require(_0x8373('0x3'));var router=express[_0x8373('0x4')]();var fs_extra=require(_0x8373('0x5'));var auth=require(_0x8373('0x6'));var interaction=require(_0x8373('0x7'));var config=require(_0x8373('0x8'));var controller=require(_0x8373('0x9'));router[_0x8373('0xa')]('/',auth[_0x8373('0xb')](),controller['index']);router[_0x8373('0xa')](_0x8373('0xc'),auth[_0x8373('0xb')](),controller[_0x8373('0xd')]);router[_0x8373('0xe')]('/',auth['isAuthenticated'](),controller[_0x8373('0xf')]);router[_0x8373('0x10')](_0x8373('0xc'),auth[_0x8373('0xb')](),controller[_0x8373('0x11')]);router[_0x8373('0x12')](_0x8373('0xc'),auth[_0x8373('0xb')](),controller['destroy']);module[_0x8373('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 498f781..28d2bc5 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 _0x2b7a=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x427acc,_0x5ad8d8){var _0x26fa41=function(_0x21a516){while(--_0x21a516){_0x427acc['push'](_0x427acc['shift']());}};_0x26fa41(++_0x5ad8d8);}(_0x2b7a,0x1ae));var _0xa2b7=function(_0x27e8ca,_0x1dc4ca){_0x27e8ca=_0x27e8ca-0x0;var _0x4e9953=_0x2b7a[_0x27e8ca];return _0x4e9953;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa2b7('0x0'));module[_0xa2b7('0x1')]={'time':{'type':Sequelize[_0xa2b7('0x2')]},'callid':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xa2b7('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa2b7('0x3')],'allowNull':![],'defaultValue':moment()[_0xa2b7('0x4')](_0xa2b7('0x5'))}}; \ No newline at end of file +var _0x2f74=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING'];(function(_0x48521b,_0x3f6d08){var _0x1fb75c=function(_0x3220ec){while(--_0x3220ec){_0x48521b['push'](_0x48521b['shift']());}};_0x1fb75c(++_0x3f6d08);}(_0x2f74,0x7b));var _0x42f7=function(_0x1b9d97,_0x19159b){_0x1b9d97=_0x1b9d97-0x0;var _0x1d7a29=_0x2f74[_0x1b9d97];return _0x1d7a29;};'use strict';var Sequelize=require(_0x42f7('0x0'));var moment=require('moment');module[_0x42f7('0x1')]={'time':{'type':Sequelize[_0x42f7('0x2')]},'callid':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x42f7('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x42f7('0x3')],'allowNull':![],'defaultValue':moment()[_0x42f7('0x4')](_0x42f7('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 69103e2..29577b9 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 _0xa9aa=['offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','VoiceQueuesLog','fieldName','type','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','merge','filter','includeAll','include','findAll','rows','params','rawAttributes','options','find','catch','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x190238,_0x59dd54){var _0x2288eb=function(_0x118776){while(--_0x118776){_0x190238['push'](_0x190238['shift']());}};_0x2288eb(++_0x59dd54);}(_0xa9aa,0xb9));var _0xaa9a=function(_0x5a3a16,_0x4f2ab1){_0x5a3a16=_0x5a3a16-0x0;var _0x1a7cb4=_0xa9aa[_0x5a3a16];return _0x1a7cb4;};'use strict';var emlformat=require(_0xaa9a('0x0'));var rimraf=require(_0xaa9a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaa9a('0x2'));var moment=require(_0xaa9a('0x3'));var BPromise=require(_0xaa9a('0x4'));var Mustache=require(_0xaa9a('0x5'));var util=require(_0xaa9a('0x6'));var path=require(_0xaa9a('0x7'));var sox=require(_0xaa9a('0x8'));var csv=require(_0xaa9a('0x9'));var ejs=require(_0xaa9a('0xa'));var fs=require('fs');var fs_extra=require(_0xaa9a('0xb'));var _=require(_0xaa9a('0xc'));var squel=require(_0xaa9a('0xd'));var crypto=require(_0xaa9a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaa9a('0xf'));var toCsv=require(_0xaa9a('0x9'));var querystring=require('querystring');var Papa=require(_0xaa9a('0x10'));var Redis=require(_0xaa9a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaa9a('0x12'));var as=require(_0xaa9a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa9a('0x14'));var utils=require(_0xaa9a('0x15'));var config=require(_0xaa9a('0x16'));var licenseUtil=require(_0xaa9a('0x17'));var db=require(_0xaa9a('0x18'))['db'];function respondWithStatusCode(_0x420166,_0x17c395){_0x17c395=_0x17c395||0xcc;return function(_0x2c8c13){if(_0x2c8c13){return _0x420166[_0xaa9a('0x19')](_0x17c395);}return _0x420166[_0xaa9a('0x1a')](_0x17c395)['end']();};}function respondWithResult(_0x3a7e00,_0x29378b){_0x29378b=_0x29378b||0xc8;return function(_0x38f30c){if(_0x38f30c){return _0x3a7e00[_0xaa9a('0x1a')](_0x29378b)[_0xaa9a('0x1b')](_0x38f30c);}};}function respondWithFilteredResult(_0x92c94c,_0x24e655){return function(_0x474509){if(_0x474509){var _0xcb7827=typeof _0x24e655[_0xaa9a('0x1c')]===_0xaa9a('0x1d')&&typeof _0x24e655[_0xaa9a('0x1e')]===_0xaa9a('0x1d');var _0x1f63d5=_0x474509[_0xaa9a('0x1f')];var _0x40ecad=_0xcb7827?0x0:_0x24e655['offset'];var _0x29591e=_0xcb7827?_0x474509[_0xaa9a('0x1f')]:_0x24e655[_0xaa9a('0x1c')]+_0x24e655[_0xaa9a('0x1e')];var _0x1e009f;if(_0x29591e>=_0x1f63d5){_0x29591e=_0x1f63d5;_0x1e009f=0xc8;}else{_0x1e009f=0xce;}_0x92c94c['status'](_0x1e009f);return _0x92c94c[_0xaa9a('0x20')](_0xaa9a('0x21'),_0x40ecad+'-'+_0x29591e+'/'+_0x1f63d5)['json'](_0x474509);}return null;};}function patchUpdates(_0x556e57){return function(_0x1ff06d){try{jsonpatch[_0xaa9a('0x22')](_0x1ff06d,_0x556e57,!![]);}catch(_0x39edd5){return BPromise[_0xaa9a('0x23')](_0x39edd5);}return _0x1ff06d['save']();};}function saveUpdates(_0x2a50c8,_0x5dcb7d){return function(_0x5bfc75){if(_0x5bfc75){return _0x5bfc75[_0xaa9a('0x24')](_0x2a50c8)[_0xaa9a('0x25')](function(_0x42dc65){return _0x42dc65;});}return null;};}function removeEntity(_0x55daae,_0x4e32db){return function(_0x429963){if(_0x429963){return _0x429963[_0xaa9a('0x26')]()[_0xaa9a('0x25')](function(){_0x55daae[_0xaa9a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250b85,_0x4aff18){return function(_0xa951a2){if(!_0xa951a2){_0x250b85[_0xaa9a('0x19')](0x194);}return _0xa951a2;};}function handleError(_0x7e9bc7,_0x4152f9){_0x4152f9=_0x4152f9||0x1f4;return function(_0x5aebf7){logger[_0xaa9a('0x27')](_0x5aebf7['stack']);if(_0x5aebf7[_0xaa9a('0x28')]){delete _0x5aebf7[_0xaa9a('0x28')];}_0x7e9bc7[_0xaa9a('0x1a')](_0x4152f9)[_0xaa9a('0x29')](_0x5aebf7);};}exports[_0xaa9a('0x2a')]=function(_0x1e6896,_0x3e3a65){var _0x291f64={},_0x187441={},_0x2c94ea={'count':0x0,'rows':[]};var _0x1c735e=_['map'](db[_0xaa9a('0x2b')]['rawAttributes'],function(_0x1f9284){return{'name':_0x1f9284[_0xaa9a('0x2c')],'type':_0x1f9284[_0xaa9a('0x2d')]['key']};});_0x187441[_0xaa9a('0x2e')]=_[_0xaa9a('0x2f')](_0x1c735e,_0xaa9a('0x28'));_0x187441['query']=_['keys'](_0x1e6896[_0xaa9a('0x30')]);_0x187441['filters']=_[_0xaa9a('0x31')](_0x187441[_0xaa9a('0x2e')],_0x187441[_0xaa9a('0x30')]);_0x291f64['attributes']=_['intersection'](_0x187441[_0xaa9a('0x2e')],qs[_0xaa9a('0x32')](_0x1e6896['query'][_0xaa9a('0x32')]));_0x291f64[_0xaa9a('0x33')]=_0x291f64[_0xaa9a('0x33')][_0xaa9a('0x34')]?_0x291f64[_0xaa9a('0x33')]:_0x187441[_0xaa9a('0x2e')];if(!_0x1e6896['query']['hasOwnProperty'](_0xaa9a('0x35'))){_0x291f64[_0xaa9a('0x1e')]=qs[_0xaa9a('0x1e')](_0x1e6896['query'][_0xaa9a('0x1e')]);_0x291f64[_0xaa9a('0x1c')]=qs[_0xaa9a('0x1c')](_0x1e6896['query'][_0xaa9a('0x1c')]);}_0x291f64[_0xaa9a('0x36')]=qs[_0xaa9a('0x37')](_0x1e6896['query'][_0xaa9a('0x37')]);_0x291f64[_0xaa9a('0x38')]=qs[_0xaa9a('0x39')](_['pick'](_0x1e6896[_0xaa9a('0x30')],_0x187441['filters']),_0x1c735e);if(_0x1e6896[_0xaa9a('0x30')]['filter']){_0x291f64[_0xaa9a('0x38')]=_[_0xaa9a('0x3a')](_0x291f64[_0xaa9a('0x38')],{'$or':_['map'](_0x1c735e,function(_0x268926){if(_0x268926[_0xaa9a('0x2d')]!=='VIRTUAL'){var _0x3a6f58={};_0x3a6f58[_0x268926['name']]={'$like':'%'+_0x1e6896['query'][_0xaa9a('0x3b')]+'%'};return _0x3a6f58;}})});}_0x291f64=_['merge']({},_0x291f64,_0x1e6896['options']);var _0x398eae={'where':_0x291f64['where']};return db[_0xaa9a('0x2b')][_0xaa9a('0x1f')](_0x398eae)[_0xaa9a('0x25')](function(_0x1c83f6){_0x2c94ea[_0xaa9a('0x1f')]=_0x1c83f6;if(_0x1e6896[_0xaa9a('0x30')][_0xaa9a('0x3c')]){_0x291f64[_0xaa9a('0x3d')]=[{'all':!![]}];}return db[_0xaa9a('0x2b')][_0xaa9a('0x3e')](_0x291f64);})['then'](function(_0x35e70c){_0x2c94ea[_0xaa9a('0x3f')]=_0x35e70c;return _0x2c94ea;})[_0xaa9a('0x25')](respondWithFilteredResult(_0x3e3a65,_0x291f64))['catch'](handleError(_0x3e3a65,null));};exports['show']=function(_0x457cd4,_0x3040b2){var _0x480bac={'raw':!![],'where':{'id':_0x457cd4[_0xaa9a('0x40')]['id']}},_0x54b65b={};_0x54b65b['model']=_['keys'](db[_0xaa9a('0x2b')][_0xaa9a('0x41')]);_0x54b65b[_0xaa9a('0x30')]=_['keys'](_0x457cd4['query']);_0x54b65b[_0xaa9a('0x39')]=_[_0xaa9a('0x31')](_0x54b65b['model'],_0x54b65b[_0xaa9a('0x30')]);_0x480bac[_0xaa9a('0x33')]=_[_0xaa9a('0x31')](_0x54b65b['model'],qs['fields'](_0x457cd4[_0xaa9a('0x30')][_0xaa9a('0x32')]));_0x480bac[_0xaa9a('0x33')]=_0x480bac[_0xaa9a('0x33')][_0xaa9a('0x34')]?_0x480bac[_0xaa9a('0x33')]:_0x54b65b['model'];if(_0x457cd4['query']['includeAll']){_0x480bac['include']=[{'all':!![]}];}_0x480bac=_[_0xaa9a('0x3a')]({},_0x480bac,_0x457cd4[_0xaa9a('0x42')]);return db[_0xaa9a('0x2b')][_0xaa9a('0x43')](_0x480bac)[_0xaa9a('0x25')](handleEntityNotFound(_0x3040b2,null))[_0xaa9a('0x25')](respondWithResult(_0x3040b2,null))[_0xaa9a('0x44')](handleError(_0x3040b2,null));};exports['create']=function(_0x3cc19b,_0x3808d0){return db[_0xaa9a('0x2b')][_0xaa9a('0x45')](_0x3cc19b[_0xaa9a('0x46')],{})[_0xaa9a('0x25')](respondWithResult(_0x3808d0,0xc9))[_0xaa9a('0x44')](handleError(_0x3808d0,null));};exports[_0xaa9a('0x24')]=function(_0x2ef974,_0x38ff31){if(_0x2ef974[_0xaa9a('0x46')]['id']){delete _0x2ef974[_0xaa9a('0x46')]['id'];}return db[_0xaa9a('0x2b')]['find']({'where':{'id':_0x2ef974['params']['id']}})[_0xaa9a('0x25')](handleEntityNotFound(_0x38ff31,null))[_0xaa9a('0x25')](saveUpdates(_0x2ef974[_0xaa9a('0x46')],null))[_0xaa9a('0x25')](respondWithResult(_0x38ff31,null))[_0xaa9a('0x44')](handleError(_0x38ff31,null));};exports[_0xaa9a('0x26')]=function(_0x7ed0e2,_0x37efd5){return db[_0xaa9a('0x2b')][_0xaa9a('0x43')]({'where':{'id':_0x7ed0e2[_0xaa9a('0x40')]['id']}})['then'](handleEntityNotFound(_0x37efd5,null))[_0xaa9a('0x25')](removeEntity(_0x37efd5,null))[_0xaa9a('0x44')](handleError(_0x37efd5,null));}; \ No newline at end of file +var _0xdacc=['findAll','rows','catch','params','keys','length','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdacc,0x1ba));var _0xcdac=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdacc[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdac('0x0'));var zipdir=require(_0xcdac('0x1'));var jsonpatch=require(_0xcdac('0x2'));var rp=require('request-promise');var moment=require(_0xcdac('0x3'));var BPromise=require(_0xcdac('0x4'));var Mustache=require('mustache');var util=require(_0xcdac('0x5'));var path=require(_0xcdac('0x6'));var sox=require(_0xcdac('0x7'));var csv=require(_0xcdac('0x8'));var ejs=require(_0xcdac('0x9'));var fs=require('fs');var fs_extra=require(_0xcdac('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcdac('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcdac('0xc'));var toCsv=require(_0xcdac('0x8'));var querystring=require(_0xcdac('0xd'));var Papa=require(_0xcdac('0xe'));var Redis=require(_0xcdac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcdac('0x10'));var as=require(_0xcdac('0x11'));var hardwareService=require(_0xcdac('0x12'));var logger=require('../../config/logger')(_0xcdac('0x13'));var utils=require(_0xcdac('0x14'));var config=require(_0xcdac('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdac('0x16'))['db'];function respondWithStatusCode(_0x214f95,_0xbe0ec8){_0xbe0ec8=_0xbe0ec8||0xcc;return function(_0x1add92){if(_0x1add92){return _0x214f95['sendStatus'](_0xbe0ec8);}return _0x214f95[_0xcdac('0x17')](_0xbe0ec8)[_0xcdac('0x18')]();};}function respondWithResult(_0x161dcd,_0x5c71f2){_0x5c71f2=_0x5c71f2||0xc8;return function(_0x568501){if(_0x568501){return _0x161dcd[_0xcdac('0x17')](_0x5c71f2)['json'](_0x568501);}};}function respondWithFilteredResult(_0x4ba94c,_0x456559){return function(_0x245f1d){if(_0x245f1d){var _0x1386f4=typeof _0x456559[_0xcdac('0x19')]==='undefined'&&typeof _0x456559['limit']===_0xcdac('0x1a');var _0x57ffd9=_0x245f1d[_0xcdac('0x1b')];var _0x51e583=_0x1386f4?0x0:_0x456559[_0xcdac('0x19')];var _0x14bd57=_0x1386f4?_0x245f1d['count']:_0x456559[_0xcdac('0x19')]+_0x456559[_0xcdac('0x1c')];var _0x39e4e6;if(_0x14bd57>=_0x57ffd9){_0x14bd57=_0x57ffd9;_0x39e4e6=0xc8;}else{_0x39e4e6=0xce;}_0x4ba94c[_0xcdac('0x17')](_0x39e4e6);return _0x4ba94c[_0xcdac('0x1d')]('Content-Range',_0x51e583+'-'+_0x14bd57+'/'+_0x57ffd9)[_0xcdac('0x1e')](_0x245f1d);}return null;};}function patchUpdates(_0x494730){return function(_0x1aaa8c){try{jsonpatch[_0xcdac('0x1f')](_0x1aaa8c,_0x494730,!![]);}catch(_0x7a81c3){return BPromise['reject'](_0x7a81c3);}return _0x1aaa8c[_0xcdac('0x20')]();};}function saveUpdates(_0x4c8b95,_0x3ba78b){return function(_0x2971f1){if(_0x2971f1){return _0x2971f1[_0xcdac('0x21')](_0x4c8b95)[_0xcdac('0x22')](function(_0x18fcc0){return _0x18fcc0;});}return null;};}function removeEntity(_0x1fdcb0,_0x30a0a5){return function(_0x5ece80){if(_0x5ece80){return _0x5ece80[_0xcdac('0x23')]()[_0xcdac('0x22')](function(){_0x1fdcb0['status'](0xcc)[_0xcdac('0x18')]();});}};}function handleEntityNotFound(_0xe2f55a,_0x1e701a){return function(_0x213157){if(!_0x213157){_0xe2f55a[_0xcdac('0x24')](0x194);}return _0x213157;};}function handleError(_0x4ea5e2,_0x214717){_0x214717=_0x214717||0x1f4;return function(_0x429976){logger[_0xcdac('0x25')](_0x429976[_0xcdac('0x26')]);if(_0x429976[_0xcdac('0x27')]){delete _0x429976[_0xcdac('0x27')];}_0x4ea5e2[_0xcdac('0x17')](_0x214717)[_0xcdac('0x28')](_0x429976);};}exports[_0xcdac('0x29')]=function(_0x49706a,_0x21bcae){var _0x4bc289={},_0x40f5b5={},_0x4b4015={'count':0x0,'rows':[]};var _0x5bd6e9=_[_0xcdac('0x2a')](db[_0xcdac('0x2b')][_0xcdac('0x2c')],function(_0x3c850a){return{'name':_0x3c850a['fieldName'],'type':_0x3c850a[_0xcdac('0x2d')][_0xcdac('0x2e')]};});_0x40f5b5['model']=_[_0xcdac('0x2a')](_0x5bd6e9,_0xcdac('0x27'));_0x40f5b5['query']=_['keys'](_0x49706a[_0xcdac('0x2f')]);_0x40f5b5[_0xcdac('0x30')]=_[_0xcdac('0x31')](_0x40f5b5[_0xcdac('0x32')],_0x40f5b5[_0xcdac('0x2f')]);_0x4bc289[_0xcdac('0x33')]=_['intersection'](_0x40f5b5[_0xcdac('0x32')],qs[_0xcdac('0x34')](_0x49706a['query']['fields']));_0x4bc289[_0xcdac('0x33')]=_0x4bc289['attributes']['length']?_0x4bc289['attributes']:_0x40f5b5[_0xcdac('0x32')];if(!_0x49706a[_0xcdac('0x2f')]['hasOwnProperty'](_0xcdac('0x35'))){_0x4bc289[_0xcdac('0x1c')]=qs[_0xcdac('0x1c')](_0x49706a[_0xcdac('0x2f')][_0xcdac('0x1c')]);_0x4bc289[_0xcdac('0x19')]=qs[_0xcdac('0x19')](_0x49706a[_0xcdac('0x2f')][_0xcdac('0x19')]);}_0x4bc289[_0xcdac('0x36')]=qs[_0xcdac('0x37')](_0x49706a['query'][_0xcdac('0x37')]);_0x4bc289[_0xcdac('0x38')]=qs[_0xcdac('0x30')](_['pick'](_0x49706a[_0xcdac('0x2f')],_0x40f5b5[_0xcdac('0x30')]),_0x5bd6e9);if(_0x49706a[_0xcdac('0x2f')][_0xcdac('0x39')]){_0x4bc289[_0xcdac('0x38')]=_[_0xcdac('0x3a')](_0x4bc289['where'],{'$or':_[_0xcdac('0x2a')](_0x5bd6e9,function(_0x5c5ccc){if(_0x5c5ccc['type']!==_0xcdac('0x3b')){var _0xa2b34e={};_0xa2b34e[_0x5c5ccc['name']]={'$like':'%'+_0x49706a[_0xcdac('0x2f')]['filter']+'%'};return _0xa2b34e;}})});}_0x4bc289=_[_0xcdac('0x3a')]({},_0x4bc289,_0x49706a['options']);var _0x56b2d7={'where':_0x4bc289[_0xcdac('0x38')]};return db['VoiceQueuesLog'][_0xcdac('0x1b')](_0x56b2d7)[_0xcdac('0x22')](function(_0x34178b){_0x4b4015[_0xcdac('0x1b')]=_0x34178b;if(_0x49706a[_0xcdac('0x2f')][_0xcdac('0x3c')]){_0x4bc289[_0xcdac('0x3d')]=[{'all':!![]}];}return db[_0xcdac('0x2b')][_0xcdac('0x3e')](_0x4bc289);})[_0xcdac('0x22')](function(_0x24a9e8){_0x4b4015[_0xcdac('0x3f')]=_0x24a9e8;return _0x4b4015;})[_0xcdac('0x22')](respondWithFilteredResult(_0x21bcae,_0x4bc289))[_0xcdac('0x40')](handleError(_0x21bcae,null));};exports['show']=function(_0x33954d,_0x11dfc5){var _0x22b14d={'raw':!![],'where':{'id':_0x33954d[_0xcdac('0x41')]['id']}},_0x5615de={};_0x5615de['model']=_['keys'](db[_0xcdac('0x2b')][_0xcdac('0x2c')]);_0x5615de['query']=_[_0xcdac('0x42')](_0x33954d[_0xcdac('0x2f')]);_0x5615de[_0xcdac('0x30')]=_[_0xcdac('0x31')](_0x5615de['model'],_0x5615de[_0xcdac('0x2f')]);_0x22b14d['attributes']=_[_0xcdac('0x31')](_0x5615de[_0xcdac('0x32')],qs[_0xcdac('0x34')](_0x33954d[_0xcdac('0x2f')]['fields']));_0x22b14d[_0xcdac('0x33')]=_0x22b14d['attributes'][_0xcdac('0x43')]?_0x22b14d[_0xcdac('0x33')]:_0x5615de[_0xcdac('0x32')];if(_0x33954d[_0xcdac('0x2f')][_0xcdac('0x3c')]){_0x22b14d[_0xcdac('0x3d')]=[{'all':!![]}];}_0x22b14d=_['merge']({},_0x22b14d,_0x33954d[_0xcdac('0x44')]);return db[_0xcdac('0x2b')][_0xcdac('0x45')](_0x22b14d)[_0xcdac('0x22')](handleEntityNotFound(_0x11dfc5,null))[_0xcdac('0x22')](respondWithResult(_0x11dfc5,null))[_0xcdac('0x40')](handleError(_0x11dfc5,null));};exports['create']=function(_0x32ca0b,_0x1cd03b){return db[_0xcdac('0x2b')][_0xcdac('0x46')](_0x32ca0b[_0xcdac('0x47')],{})['then'](respondWithResult(_0x1cd03b,0xc9))[_0xcdac('0x40')](handleError(_0x1cd03b,null));};exports['update']=function(_0x3ffe03,_0x13d8fa){if(_0x3ffe03['body']['id']){delete _0x3ffe03[_0xcdac('0x47')]['id'];}return db['VoiceQueuesLog'][_0xcdac('0x45')]({'where':{'id':_0x3ffe03[_0xcdac('0x41')]['id']}})['then'](handleEntityNotFound(_0x13d8fa,null))[_0xcdac('0x22')](saveUpdates(_0x3ffe03[_0xcdac('0x47')],null))[_0xcdac('0x22')](respondWithResult(_0x13d8fa,null))['catch'](handleError(_0x13d8fa,null));};exports[_0xcdac('0x23')]=function(_0x28f6fe,_0x3aa6e9){return db['VoiceQueuesLog'][_0xcdac('0x45')]({'where':{'id':_0x28f6fe[_0xcdac('0x41')]['id']}})[_0xcdac('0x22')](handleEntityNotFound(_0x3aa6e9,null))[_0xcdac('0x22')](removeEntity(_0x3aa6e9,null))[_0xcdac('0x40')](handleError(_0x3aa6e9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 36654da..c9a352d 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 _0x5eec=['request-promise','path','rimraf','./voiceQueuesLog.attributes','define','voice_queues_log','event_dtm','dtm','lodash','../../config/logger','moment'];(function(_0x1f6d54,_0xdc9fea){var _0x3cbfb8=function(_0x4bc963){while(--_0x4bc963){_0x1f6d54['push'](_0x1f6d54['shift']());}};_0x3cbfb8(++_0xdc9fea);}(_0x5eec,0x11b));var _0xc5ee=function(_0x4f03c2,_0x398b5b){_0x4f03c2=_0x4f03c2-0x0;var _0xb6e42a=_0x5eec[_0x4f03c2];return _0xb6e42a;};'use strict';var _=require(_0xc5ee('0x0'));var util=require('util');var logger=require(_0xc5ee('0x1'))('api');var moment=require(_0xc5ee('0x2'));var BPromise=require('bluebird');var rp=require(_0xc5ee('0x3'));var fs=require('fs');var path=require(_0xc5ee('0x4'));var rimraf=require(_0xc5ee('0x5'));var config=require('../../config/environment');var attributes=require(_0xc5ee('0x6'));module['exports']=function(_0xb6c4ae,_0x44eecd){return _0xb6c4ae[_0xc5ee('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0xc5ee('0x8'),'paranoid':![],'indexes':[{'name':_0xc5ee('0x9'),'fields':['event',_0xc5ee('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1b81=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','util','../../config/logger'];(function(_0x3131c4,_0x5df24e){var _0x5347db=function(_0x32317e){while(--_0x32317e){_0x3131c4['push'](_0x3131c4['shift']());}};_0x5347db(++_0x5df24e);}(_0x1b81,0x124));var _0x11b8=function(_0x447e32,_0x25f7e0){_0x447e32=_0x447e32-0x0;var _0x103b19=_0x1b81[_0x447e32];return _0x103b19;};'use strict';var _=require('lodash');var util=require(_0x11b8('0x0'));var logger=require(_0x11b8('0x1'))('api');var moment=require(_0x11b8('0x2'));var BPromise=require(_0x11b8('0x3'));var rp=require(_0x11b8('0x4'));var fs=require('fs');var path=require(_0x11b8('0x5'));var rimraf=require(_0x11b8('0x6'));var config=require(_0x11b8('0x7'));var attributes=require(_0x11b8('0x8'));module[_0x11b8('0x9')]=function(_0x4f74a4,_0x14b308){return _0x4f74a4[_0x11b8('0xa')](_0x11b8('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x11b8('0xc'),'fields':[_0x11b8('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 63305de..0543ae4 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 _0x9245=['../../mysqldb','../../config/logger','rpc','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x349b6a,_0x496705){var _0x21097c=function(_0x2aaded){while(--_0x2aaded){_0x349b6a['push'](_0x349b6a['shift']());}};_0x21097c(++_0x496705);}(_0x9245,0x164));var _0x5924=function(_0xef1221,_0x2220f5){_0xef1221=_0xef1221-0x0;var _0xa3942b=_0x9245[_0xef1221];return _0xa3942b;};'use strict';var _=require(_0x5924('0x0'));var util=require(_0x5924('0x1'));var moment=require(_0x5924('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5924('0x3'));var db=require(_0x5924('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5924('0x5'))(_0x5924('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5924('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x110acb,_0x1b51f3,_0x4b470b){return new BPromise(function(_0x55db11,_0xac538){return client[_0x5924('0x8')](_0x110acb,_0x4b470b)[_0x5924('0x9')](function(_0x5b920b){logger[_0x5924('0xa')](_0x5924('0xb'),_0x1b51f3,'request\x20sent');logger[_0x5924('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1b51f3,_0x5924('0xd'),JSON[_0x5924('0xe')](_0x5b920b));if(_0x5b920b[_0x5924('0xf')]){if(_0x5b920b[_0x5924('0xf')][_0x5924('0x10')]===0x1f4){logger[_0x5924('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1b51f3,_0x5b920b['error']['message']);return _0xac538(_0x5b920b[_0x5924('0xf')][_0x5924('0x11')]);}logger[_0x5924('0xf')](_0x5924('0xb'),_0x1b51f3,_0x5b920b[_0x5924('0xf')][_0x5924('0x11')]);return _0x55db11(_0x5b920b[_0x5924('0xf')][_0x5924('0x11')]);}else{logger[_0x5924('0xa')](_0x5924('0xb'),_0x1b51f3,_0x5924('0xd'));_0x55db11(_0x5b920b[_0x5924('0x12')][_0x5924('0x11')]);}})[_0x5924('0x13')](function(_0xe1a0a){logger[_0x5924('0xf')](_0x5924('0xb'),_0x1b51f3,_0xe1a0a);_0xac538(_0xe1a0a);});});} \ No newline at end of file +var _0x3306=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x43c355,_0x469b9a){var _0xbf9e1c=function(_0x200617){while(--_0x200617){_0x43c355['push'](_0x43c355['shift']());}};_0xbf9e1c(++_0x469b9a);}(_0x3306,0x1ec));var _0x6330=function(_0x3e5345,_0xf11108){_0x3e5345=_0x3e5345-0x0;var _0x3392c3=_0x3306[_0x3e5345];return _0x3392c3;};'use strict';var _=require(_0x6330('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6330('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6330('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6330('0x3'));var logger=require(_0x6330('0x4'))('rpc');var config=require(_0x6330('0x5'));var jayson=require(_0x6330('0x6'));var client=jayson[_0x6330('0x7')][_0x6330('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd06a5c,_0x3a6cff,_0x360f97){return new BPromise(function(_0x3c2e7d,_0xb4739b){return client['request'](_0xd06a5c,_0x360f97)[_0x6330('0x9')](function(_0x5aa3ce){logger[_0x6330('0xa')](_0x6330('0xb'),_0x3a6cff,'request\x20sent');logger[_0x6330('0xc')](_0x6330('0xd'),_0x3a6cff,_0x6330('0xe'),JSON[_0x6330('0xf')](_0x5aa3ce));if(_0x5aa3ce[_0x6330('0x10')]){if(_0x5aa3ce[_0x6330('0x10')][_0x6330('0x11')]===0x1f4){logger['error'](_0x6330('0xb'),_0x3a6cff,_0x5aa3ce['error']['message']);return _0xb4739b(_0x5aa3ce[_0x6330('0x10')][_0x6330('0x12')]);}logger['error'](_0x6330('0xb'),_0x3a6cff,_0x5aa3ce[_0x6330('0x10')]['message']);return _0x3c2e7d(_0x5aa3ce[_0x6330('0x10')][_0x6330('0x12')]);}else{logger[_0x6330('0xa')](_0x6330('0xb'),_0x3a6cff,_0x6330('0xe'));_0x3c2e7d(_0x5aa3ce[_0x6330('0x13')][_0x6330('0x12')]);}})[_0x6330('0x14')](function(_0x29c290){logger[_0x6330('0x10')](_0x6330('0xb'),_0x3a6cff,_0x29c290);_0xb4739b(_0x29c290);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index f301076..15d92bd 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 _0x34a8=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceRecording.controller','isAuthenticated','index','/describe','get','/:id','show','download','/:id/downloads','downloads','post','create','/:id/transcribe','runTranscribe','delete','exports','multer'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x34a8,0x137));var _0x834a=function(_0x3a31e3,_0x1e50cd){_0x3a31e3=_0x3a31e3-0x0;var _0x569600=_0x34a8[_0x3a31e3];return _0x569600;};'use strict';var multer=require(_0x834a('0x0'));var util=require(_0x834a('0x1'));var path=require(_0x834a('0x2'));var timeout=require(_0x834a('0x3'));var express=require(_0x834a('0x4'));var router=express[_0x834a('0x5')]();var fs_extra=require(_0x834a('0x6'));var auth=require(_0x834a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x834a('0x8'));router['get']('/',auth[_0x834a('0x9')](),controller[_0x834a('0xa')]);router['get'](_0x834a('0xb'),auth[_0x834a('0x9')](),controller['describe']);router[_0x834a('0xc')](_0x834a('0xd'),auth[_0x834a('0x9')](),controller[_0x834a('0xe')]);router[_0x834a('0xc')]('/:id/download',auth[_0x834a('0x9')](),controller[_0x834a('0xf')]);router[_0x834a('0xc')](_0x834a('0x10'),controller[_0x834a('0x11')]);router[_0x834a('0xc')]('/:id/transcribe',auth[_0x834a('0x9')](),controller['downloadTranscribe']);router[_0x834a('0x12')]('/',auth['isAuthenticated'](),controller[_0x834a('0x13')]);router['post'](_0x834a('0x14'),auth[_0x834a('0x9')](),controller[_0x834a('0x15')]);router['put'](_0x834a('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x834a('0x16')]('/:id',auth[_0x834a('0x9')](),controller['destroy']);module[_0x834a('0x17')]=router; \ No newline at end of file +var _0x4521=['put','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','/:id','show','/:id/download','isAuthenticated','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create'];(function(_0x35cc3c,_0x514401){var _0x2ca231=function(_0x5052ce){while(--_0x5052ce){_0x35cc3c['push'](_0x35cc3c['shift']());}};_0x2ca231(++_0x514401);}(_0x4521,0x1d0));var _0x1452=function(_0x57023f,_0x2b8cd7){_0x57023f=_0x57023f-0x0;var _0x1ee860=_0x4521[_0x57023f];return _0x1ee860;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1452('0x0'));var timeout=require(_0x1452('0x1'));var express=require(_0x1452('0x2'));var router=express['Router']();var fs_extra=require(_0x1452('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1452('0x4'));var config=require(_0x1452('0x5'));var controller=require('./voiceRecording.controller');router[_0x1452('0x6')]('/',auth['isAuthenticated'](),controller[_0x1452('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1452('0x8')]);router[_0x1452('0x6')](_0x1452('0x9'),auth['isAuthenticated'](),controller[_0x1452('0xa')]);router[_0x1452('0x6')](_0x1452('0xb'),auth[_0x1452('0xc')](),controller['download']);router[_0x1452('0x6')](_0x1452('0xd'),controller[_0x1452('0xe')]);router['get'](_0x1452('0xf'),auth[_0x1452('0xc')](),controller[_0x1452('0x10')]);router[_0x1452('0x11')]('/',auth[_0x1452('0xc')](),controller[_0x1452('0x12')]);router[_0x1452('0x11')](_0x1452('0xf'),auth[_0x1452('0xc')](),controller['runTranscribe']);router[_0x1452('0x13')](_0x1452('0x9'),auth[_0x1452('0xc')](),controller[_0x1452('0x14')]);router['delete'](_0x1452('0x9'),auth[_0x1452('0xc')](),controller[_0x1452('0x15')]);module[_0x1452('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 014c9d6..14ae2fc 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(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 c650f82..af6df09 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 _0x6022=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceRecording','type','model','differenceBy','format','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','rawAttributes','includeAll','find','create','body','params','describe','uniqueid','value','%s.cypher','decryptFile','secrets','recording','Sequelize','filename','extname','download','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','existsSync','ValidationError','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x6022,0x115));var _0x2602=function(_0x581e4c,_0x3a5292){_0x581e4c=_0x581e4c-0x0;var _0x4aea9d=_0x6022[_0x581e4c];return _0x4aea9d;};'use strict';var emlformat=require(_0x2602('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2602('0x1'));var jsonpatch=require(_0x2602('0x2'));var rp=require(_0x2602('0x3'));var moment=require(_0x2602('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2602('0x5'));var sox=require(_0x2602('0x6'));var csv=require(_0x2602('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2602('0x8'));var _=require(_0x2602('0x9'));var squel=require('squel');var crypto=require(_0x2602('0xa'));var jsforce=require(_0x2602('0xb'));var deskjs=require(_0x2602('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2602('0xd'));var Papa=require(_0x2602('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0x2602('0xf'));var Redis=require(_0x2602('0x10'));var authService=require(_0x2602('0x11'));var qs=require(_0x2602('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2602('0x13'))(_0x2602('0x14'));var utils=require(_0x2602('0x15'));var config=require(_0x2602('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2602('0x17'))['db'];function respondWithStatusCode(_0x1f114d,_0x357492){_0x357492=_0x357492||0xcc;return function(_0x170004){if(_0x170004){return _0x1f114d[_0x2602('0x18')](_0x357492);}return _0x1f114d[_0x2602('0x19')](_0x357492)[_0x2602('0x1a')]();};}function respondWithResult(_0x1056de,_0x24ac90){_0x24ac90=_0x24ac90||0xc8;return function(_0x33d710){if(_0x33d710){return _0x1056de[_0x2602('0x19')](_0x24ac90)[_0x2602('0x1b')](_0x33d710);}};}function respondWithFilteredResult(_0x238fc2,_0x141451){return function(_0x157aad){if(_0x157aad){var _0x52396b=typeof _0x141451['offset']===_0x2602('0x1c')&&typeof _0x141451[_0x2602('0x1d')]==='undefined';var _0x629b61=_0x157aad[_0x2602('0x1e')];var _0x22b2bc=_0x52396b?0x0:_0x141451[_0x2602('0x1f')];var _0x35b630=_0x52396b?_0x157aad[_0x2602('0x1e')]:_0x141451[_0x2602('0x1f')]+_0x141451['limit'];var _0xe83cfb;if(_0x35b630>=_0x629b61){_0x35b630=_0x629b61;_0xe83cfb=0xc8;}else{_0xe83cfb=0xce;}_0x238fc2['status'](_0xe83cfb);return _0x238fc2[_0x2602('0x20')](_0x2602('0x21'),_0x22b2bc+'-'+_0x35b630+'/'+_0x629b61)['json'](_0x157aad);}return null;};}function patchUpdates(_0x226ee6){return function(_0x441c5a){try{jsonpatch[_0x2602('0x22')](_0x441c5a,_0x226ee6,!![]);}catch(_0x4f861f){return BPromise[_0x2602('0x23')](_0x4f861f);}return _0x441c5a[_0x2602('0x24')]();};}function saveUpdates(_0xd00ab2,_0x20e202){return function(_0x53fad4){if(_0x53fad4){return _0x53fad4[_0x2602('0x25')](_0xd00ab2)[_0x2602('0x26')](function(_0xc34d1d){return _0xc34d1d;});}return null;};}function removeEntity(_0xa6d7c0,_0x2549bd){return function(_0x5c1f22){if(_0x5c1f22){return _0x5c1f22['destroy']()['then'](function(){_0xa6d7c0[_0x2602('0x19')](0xcc)[_0x2602('0x1a')]();});}};}function handleEntityNotFound(_0x2ccca7,_0x19f4f4){return function(_0x106a2b){if(!_0x106a2b){_0x2ccca7['sendStatus'](0x194);}return _0x106a2b;};}function handleError(_0x312c47,_0x3c0f96){_0x3c0f96=_0x3c0f96||0x1f4;return function(_0x3c5c82){logger[_0x2602('0x27')](_0x3c5c82[_0x2602('0x28')]);if(_0x3c5c82[_0x2602('0x29')]){delete _0x3c5c82[_0x2602('0x29')];}_0x312c47[_0x2602('0x19')](_0x3c0f96)[_0x2602('0x2a')](_0x3c5c82);};}exports[_0x2602('0x2b')]=function(_0x4361a6,_0x40ee4d){var _0x35d27d={},_0x2e0217={},_0xa1468b={'count':0x0,'rows':[]};var _0x57165d=_[_0x2602('0x2c')](db[_0x2602('0x2d')]['rawAttributes'],function(_0x35f2aa){return{'name':_0x35f2aa['fieldName'],'type':_0x35f2aa[_0x2602('0x2e')]['key']};});_0x2e0217[_0x2602('0x2f')]=_[_0x2602('0x30')](_[_0x2602('0x2c')](_0x57165d,'name'),[_0x2602('0x31')]);_0x2e0217[_0x2602('0x32')]=_[_0x2602('0x33')](_0x4361a6[_0x2602('0x32')]);_0x2e0217['filters']=_[_0x2602('0x34')](_0x2e0217[_0x2602('0x2f')],_0x2e0217['query']);_0x35d27d['attributes']=_[_0x2602('0x34')](_0x2e0217[_0x2602('0x2f')],qs[_0x2602('0x35')](_0x4361a6['query'][_0x2602('0x35')]));_0x35d27d[_0x2602('0x36')]=_0x35d27d[_0x2602('0x36')]['length']?_0x35d27d[_0x2602('0x36')]:_0x2e0217['model'];if(!_0x4361a6[_0x2602('0x32')][_0x2602('0x37')]('nolimit')){_0x35d27d['limit']=qs[_0x2602('0x1d')](_0x4361a6[_0x2602('0x32')][_0x2602('0x1d')]);_0x35d27d[_0x2602('0x1f')]=qs['offset'](_0x4361a6[_0x2602('0x32')][_0x2602('0x1f')]);}_0x35d27d[_0x2602('0x38')]=qs['sort'](_0x4361a6[_0x2602('0x32')][_0x2602('0x39')]);_0x35d27d[_0x2602('0x3a')]=qs[_0x2602('0x3b')](_[_0x2602('0x3c')](_0x4361a6[_0x2602('0x32')],_0x2e0217['filters']),_0x57165d);if(_0x4361a6[_0x2602('0x32')][_0x2602('0x3d')]){_0x35d27d[_0x2602('0x3a')]=_[_0x2602('0x3e')](_0x35d27d[_0x2602('0x3a')],{'$or':_['map'](_0x57165d,function(_0x36c7a0){if(_0x36c7a0[_0x2602('0x2e')]!==_0x2602('0x3f')){var _0x16275d={};_0x16275d[_0x36c7a0[_0x2602('0x29')]]={'$like':'%'+_0x4361a6['query']['filter']+'%'};return _0x16275d;}})});}_0x35d27d=_[_0x2602('0x3e')]({},_0x35d27d,_0x4361a6[_0x2602('0x40')]);var _0x15516f={'where':_0x35d27d[_0x2602('0x3a')]};return db['VoiceRecording'][_0x2602('0x1e')](_0x15516f)['then'](function(_0x588482){_0xa1468b[_0x2602('0x1e')]=_0x588482;if(_0x4361a6['query']['includeAll']){_0x35d27d[_0x2602('0x41')]=[{'all':!![]}];}return db[_0x2602('0x2d')]['findAll'](_0x35d27d);})['then'](function(_0x47961c){_0xa1468b[_0x2602('0x42')]=_0x47961c;return _0xa1468b;})[_0x2602('0x26')](respondWithFilteredResult(_0x40ee4d,_0x35d27d))[_0x2602('0x43')](handleError(_0x40ee4d,null));};exports['show']=function(_0x5f448a,_0x40abc1){var _0x560bc1={'raw':![],'where':{'id':_0x5f448a['params']['id']}},_0x30821b={};_0x30821b[_0x2602('0x2f')]=_[_0x2602('0x33')](db[_0x2602('0x2d')][_0x2602('0x44')]);_0x30821b[_0x2602('0x32')]=_[_0x2602('0x33')](_0x5f448a[_0x2602('0x32')]);_0x30821b[_0x2602('0x3b')]=_[_0x2602('0x34')](_0x30821b[_0x2602('0x2f')],_0x30821b['query']);_0x560bc1[_0x2602('0x36')]=_[_0x2602('0x34')](_0x30821b['model'],qs[_0x2602('0x35')](_0x5f448a[_0x2602('0x32')][_0x2602('0x35')]));_0x560bc1['attributes']=_0x560bc1[_0x2602('0x36')]['length']?_0x560bc1[_0x2602('0x36')]:_0x30821b[_0x2602('0x2f')];if(_0x5f448a['query'][_0x2602('0x45')]){_0x560bc1['include']=[{'all':!![]}];}_0x560bc1=_['merge']({},_0x560bc1,_0x5f448a[_0x2602('0x40')]);return db['VoiceRecording'][_0x2602('0x46')](_0x560bc1)[_0x2602('0x26')](handleEntityNotFound(_0x40abc1,null))['then'](respondWithResult(_0x40abc1,null))['catch'](handleError(_0x40abc1,null));};exports['create']=function(_0x1b45ff,_0x1d73cf){return db[_0x2602('0x2d')][_0x2602('0x47')](_0x1b45ff[_0x2602('0x48')],{})[_0x2602('0x26')](respondWithResult(_0x1d73cf,0xc9))[_0x2602('0x43')](handleError(_0x1d73cf,null));};exports['update']=function(_0x28b037,_0x22073f){if(_0x28b037[_0x2602('0x48')]['id']){delete _0x28b037[_0x2602('0x48')]['id'];}return db[_0x2602('0x2d')]['find']({'where':{'id':_0x28b037[_0x2602('0x49')]['id']}})[_0x2602('0x26')](handleEntityNotFound(_0x22073f,null))['then'](saveUpdates(_0x28b037[_0x2602('0x48')],null))[_0x2602('0x26')](respondWithResult(_0x22073f,null))[_0x2602('0x43')](handleError(_0x22073f,null));};exports[_0x2602('0x4a')]=function(_0x8090ef,_0x158f29){return db[_0x2602('0x2d')][_0x2602('0x4a')]()[_0x2602('0x26')](respondWithResult(_0x158f29,null))[_0x2602('0x43')](handleError(_0x158f29,null));};exports['download']=function(_0x1aefb7,_0x399a4d,_0x1ad2b0){var _0x26c712=require('../../components/encryptor');var _0x33ce81=![];var _0x597fae={};if(_0x1aefb7[_0x2602('0x32')][_0x2602('0x2e')]&&_0x1aefb7[_0x2602('0x32')][_0x2602('0x2e')]===_0x2602('0x4b')){_0x597fae[_0x2602('0x4b')]=_0x1aefb7[_0x2602('0x49')]['id'];}else{_0x597fae['id']=_0x1aefb7[_0x2602('0x49')]['id'];}return db[_0x2602('0x2d')][_0x2602('0x46')]({'where':_0x597fae,'attributes':['id',_0x2602('0x4c')],'raw':!![]})[_0x2602('0x26')](handleEntityNotFound(_0x399a4d,null))['then'](function(_0x4f8333){if(_0x4f8333){var _0x4b9300=_0x4f8333[_0x2602('0x4c')];var _0x161b84=util[_0x2602('0x31')](_0x2602('0x4d'),_0x4b9300);if(fs['existsSync'](_0x161b84)){_0x33ce81=!![];return _0x26c712[_0x2602('0x4e')](_0x161b84,_0x4b9300,config[_0x2602('0x4f')][_0x2602('0x50')])[_0x2602('0x26')](function(){return _0x4f8333;});}return _0x4f8333;}})['then'](function(_0x302efa){if(_0x302efa){var _0x5dcb30=_0x302efa['value'];if(!fs['existsSync'](_0x5dcb30)){throw new db[(_0x2602('0x51'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x302efa[_0x2602('0x52')]){return _0x399a4d['download'](_0x5dcb30,_0x302efa[_0x2602('0x52')]+path[_0x2602('0x53')](_0x5dcb30),function(){if(_0x33ce81){fs['unlink'](_0x5dcb30);}});}else{return _0x399a4d[_0x2602('0x54')](_0x5dcb30,function(_0x5d7e7b){if(_0x33ce81){fs[_0x2602('0x55')](_0x5dcb30);}});}}})[_0x2602('0x43')](function(_0x128c9c){if(_0x128c9c[_0x2602('0x56')]==='VoiceRecording\x20not\x20found'){_0x399a4d[_0x2602('0x19')](0x194)[_0x2602('0x2a')](_0x2602('0x57'));}else{return handleError(_0x399a4d,null);}});};exports[_0x2602('0x58')]=function(_0x26e763,_0x180aac,_0x2cd416){var _0x199a29=require('../../components/encryptor');var _0x3fc61c=![];var _0x267e0c={'$and':[db[_0x2602('0x59')][_0x2602('0x3a')](db[_0x2602('0x59')]['fn']('MD5',db[_0x2602('0x59')][_0x2602('0x5a')](_0x2602('0x4b'))),_0x26e763[_0x2602('0x32')][_0x2602('0x5b')])]};if(_0x26e763['query'][_0x2602('0x2e')]&&_0x26e763['query']['type']===_0x2602('0x4b')){_0x267e0c[_0x2602('0x5c')][_0x2602('0x5d')]({'uniqueid':_0x26e763['params']['id']});}else{_0x267e0c[_0x2602('0x5c')][_0x2602('0x5d')]({'id':_0x26e763[_0x2602('0x49')]['id']});}return db[_0x2602('0x2d')][_0x2602('0x46')]({'where':_0x267e0c,'attributes':['id',_0x2602('0x4c')],'raw':!![]})[_0x2602('0x26')](handleEntityNotFound(_0x180aac,null))[_0x2602('0x26')](function(_0x4cc471){if(_0x4cc471){var _0x470d76=util['format'](_0x2602('0x4d'),_0x4cc471[_0x2602('0x4c')]);if(fs[_0x2602('0x5e')](_0x470d76)){_0x3fc61c=!![];return _0x199a29[_0x2602('0x4e')](_0x470d76,_0x4cc471[_0x2602('0x4c')],config[_0x2602('0x4f')][_0x2602('0x50')])['then'](function(){return _0x4cc471;});}return _0x4cc471;}})[_0x2602('0x26')](function(_0x324df8){if(_0x324df8){if(!fs[_0x2602('0x5e')](_0x324df8['value'])){throw new db[(_0x2602('0x51'))][(_0x2602('0x5f'))]('VoiceRecording\x20not\x20found');}if(_0x324df8['filename']){return _0x180aac[_0x2602('0x54')](_0x324df8[_0x2602('0x4c')],_0x324df8['filename']+path['extname'](_0x324df8[_0x2602('0x4c')]),function(){if(_0x3fc61c){fs[_0x2602('0x55')](_0x324df8[_0x2602('0x4c')]);}});}else{return _0x180aac['download'](_0x324df8[_0x2602('0x4c')],function(_0x422f6d){if(_0x3fc61c){fs[_0x2602('0x55')](_0x324df8[_0x2602('0x4c')]);}});}}})[_0x2602('0x43')](handleError(_0x180aac,null));};exports[_0x2602('0x60')]=function(_0x2b4bd2,_0x5dd9b2){return db[_0x2602('0x2d')][_0x2602('0x46')]({'where':{'id':_0x2b4bd2['params']['id']}})['then'](function(_0x43f557){if(_['isNil'](_0x43f557)){throw new ReferenceError(_0x2602('0x61'));}return _0x43f557;})[_0x2602('0x26')](function(_0x412718){var _0x108c02=_0x412718['value'];logger[_0x2602('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x108c02);if(!_[_0x2602('0x63')](_0x412718['value'])&&fs['existsSync'](_0x108c02)){logger[_0x2602('0x62')](_0x2602('0x64')+_0x108c02+_0x2602('0x65'));fs[_0x2602('0x66')](_0x108c02);}_0x108c02=_0x108c02+'.cypher';if(!_['isNil'](_0x412718[_0x2602('0x4c')])&&fs[_0x2602('0x5e')](_0x108c02)){logger[_0x2602('0x62')]('File:\x20\x22'+_0x108c02+_0x2602('0x65'));fs[_0x2602('0x66')](_0x108c02);}return _0x412718;})[_0x2602('0x26')](function(_0x8e378c){if(!_0x8e378c)throw new InternalError();return _0x8e378c['destroy']();})[_0x2602('0x26')](function(){_0x5dd9b2['status'](0xcc)[_0x2602('0x1a')]();})[_0x2602('0x43')](handleError(_0x5dd9b2,null));};function getBucketslist(_0x2d79c1,_0x2cc8e7,_0x32846c){return new Promise(function(_0x290996,_0x1a7921){var _0x53dd85=new AWS['S3']({'accessKeyId':_0x2cc8e7,'secretAccessKey':_0x2d79c1,'region':_0x32846c});_0x53dd85[_0x2602('0x67')]({},function(_0x464562,_0x40ec5c){if(_0x464562){return _0x1a7921(_0x464562);}else{return _0x290996(_0x40ec5c);}});});}function createBucket(_0x56468a,_0x3d89ce,_0x9dd226,_0x58a2d4){return new Promise(function(_0x3f88da,_0x31acf4){var _0xf599a3=new AWS['S3']({'accessKeyId':_0x3d89ce,'secretAccessKey':_0x56468a,'region':_0x9dd226});_0xf599a3['createBucket']({'Bucket':_0x58a2d4},function(_0x55ea03,_0x5d3ac2){if(_0x55ea03){return _0x31acf4(_0x55ea03);}else{return _0x3f88da(_0x5d3ac2);}});});}function uploadFile(_0x11f6b7,_0x5748d8,_0x4c4c38,_0x42ae26,_0x36e805,_0x284b72){return new Promise(function(_0x536caf,_0x50736a){var _0x5479fc=new AWS['S3']({'accessKeyId':_0x5748d8,'secretAccessKey':_0x11f6b7,'region':_0x4c4c38});_0x5479fc[_0x2602('0x68')]({'Bucket':_0x42ae26,'Key':_0x36e805,'Body':_0x284b72},function(_0x2cacf8,_0x352445){if(_0x2cacf8){return _0x50736a(_0x2cacf8);}else{return _0x536caf(_0x352445);}});});}function startTranscribe(_0x54b94c,_0x5737eb,_0x3c7506,_0x5bcc00,_0x29b984,_0x4e35c3){return new Promise(function(_0x362cac,_0x28784a){var _0x109091=new AWS[(_0x2602('0x69'))]({'accessKeyId':_0x5737eb,'secretAccessKey':_0x54b94c,'region':_0x3c7506});_0x109091[_0x2602('0x6a')]({'TranscriptionJobName':_0x5bcc00,'LanguageCode':_0x29b984,'Media':{'MediaFileUri':_0x4e35c3}},function(_0x451ec7,_0x2dc056){if(_0x451ec7){return _0x28784a(_0x451ec7);}else{return _0x362cac(_0x2dc056);}});});}function transcribe(_0x52e1f6,_0x36a3b7,_0x467b4f,_0x2d0082,_0x5ddc84,_0x13bc39,_0x84e315){return new Promise(function(_0xf83999,_0x215335){var _0x3f49d5={};logger[_0x2602('0x62')](util[_0x2602('0x31')](_0x2602('0x6b'),_0x52e1f6,_0x5ddc84));return uploadFile(_0x36a3b7,_0x467b4f,_0x2d0082,_0x5ddc84,path[_0x2602('0x6c')](_0x13bc39),fs[_0x2602('0x6d')](_0x13bc39))[_0x2602('0x26')](function(_0x4f1991){logger[_0x2602('0x62')](util[_0x2602('0x31')](_0x2602('0x6e'),_0x52e1f6,_0x5ddc84,_0x4f1991[_0x2602('0x6f')]));_0x3f49d5[_0x2602('0x70')]=_0x4f1991['Bucket'];_0x3f49d5[_0x2602('0x71')]=_0x4f1991[_0x2602('0x6f')];logger[_0x2602('0x62')](util[_0x2602('0x31')](_0x2602('0x72'),_0x52e1f6));return startTranscribe(_0x36a3b7,_0x467b4f,_0x2d0082,uuidv4(),_0x84e315,_0x4f1991[_0x2602('0x6f')]);})['then'](function(_0x166faf){logger['info'](util['format'](_0x2602('0x73'),_0x52e1f6,_0x166faf[_0x2602('0x74')][_0x2602('0x75')]));_0x3f49d5[_0x2602('0x76')]=_0x166faf[_0x2602('0x74')][_0x2602('0x75')];_0x3f49d5[_0x2602('0x77')]=_0x166faf['TranscriptionJob']['TranscriptionJobStatus'];return _0xf83999(_0x3f49d5);})[_0x2602('0x43')](function(_0x11d84e){return _0x215335(_0x11d84e);});});}exports[_0x2602('0x78')]=function(_0x558182,_0x21fff3,_0x32e457){var _0x51caab;var _0x52be12;var _0x588c13;var _0xc2409b=require(_0x2602('0x79'));return db['VoiceRecording']['findOne']({'where':{'id':_0x558182['params']['id']}})['then'](function(_0x2a88a4){if(_0x2a88a4){var _0x5d4377=util['format'](_0x2602('0x4d'),_0x2a88a4[_0x2602('0x4c')]);if(fs[_0x2602('0x5e')](_0x5d4377)){cypher=!![];return _0xc2409b['decryptFile'](_0x5d4377,_0x2a88a4[_0x2602('0x4c')],config[_0x2602('0x4f')]['recording'])[_0x2602('0x26')](function(){return _0x2a88a4;});}return _0x2a88a4;}})[_0x2602('0x26')](function(_0x1bcb24){if(!_0x1bcb24){throw new db[(_0x2602('0x51'))][(_0x2602('0x5f'))](_0x2602('0x7a'));}_0x52be12=_0x1bcb24;return db[_0x2602('0x7b')][_0x2602('0x7c')]({'where':{'id':0x1}});})[_0x2602('0x26')](handleEntityNotFound(_0x21fff3,null))['then'](function(_0x562a43){if(_0x562a43){_0x51caab=_0x562a43;if(!_0x51caab[_0x2602('0x7d')]||!_0x51caab[_0x2602('0x7e')]||!_0x51caab['transcribeRegion']||!_0x51caab['language']||!_0x51caab[_0x2602('0x70')]){throw new db[(_0x2602('0x51'))]['ValidationError'](_0x2602('0x7f'));}if(_0x558182['body'][_0x2602('0x80')]&&(!_0x51caab['sentiment']||!_0x51caab[_0x2602('0x81')]||!_0x51caab[_0x2602('0x82')]||!_0x51caab[_0x2602('0x83')]||!_0x51caab[_0x2602('0x70')])){throw new db['Sequelize']['ValidationError'](_0x2602('0x84'));}return db[_0x2602('0x85')][_0x2602('0x7c')]({'where':{'id':_0x51caab[_0x2602('0x7e')]}});}})['then'](function(_0x33ec86){if(!_0x33ec86){throw new db[(_0x2602('0x51'))]['ValidationError'](_0x2602('0x86'));}if(!_0x33ec86[_0x2602('0x87')]||!_0x33ec86['data2']){throw new db['Sequelize'][(_0x2602('0x5f'))]('Cloud\x20Provider\x20not\x20configured');}_0x588c13=_0x33ec86;return getBucketslist(_0x588c13['data1'],_0x588c13[_0x2602('0x88')],_0x51caab[_0x2602('0x89')]);})[_0x2602('0x26')](function(_0x1c16c0){if(_0x1c16c0&&_0x1c16c0[_0x2602('0x8a')]){var _0x4ae107=_[_0x2602('0x46')](_0x1c16c0[_0x2602('0x8a')],function(_0x1b4bae){return _0x1b4bae[_0x2602('0x8b')]===_0x51caab[_0x2602('0x70')];});if(!_0x4ae107){logger[_0x2602('0x62')](util[_0x2602('0x31')](_0x2602('0x8c'),_0x558182[_0x2602('0x49')]['id'],_0x51caab['bucket']));return createBucket(_0x588c13[_0x2602('0x87')],_0x588c13[_0x2602('0x88')],_0x51caab['transcribeRegion'],_0x51caab[_0x2602('0x70')]);}logger[_0x2602('0x62')](util[_0x2602('0x31')](_0x2602('0x8d'),_0x558182[_0x2602('0x49')]['id'],_0x51caab[_0x2602('0x70')]));return;}})[_0x2602('0x26')](function(_0x352d02){if(_0x52be12[_0x2602('0x77')]===_0x2602('0x8e')){return transcribe(_0x558182['params']['id'],_0x588c13[_0x2602('0x87')],_0x588c13[_0x2602('0x88')],_0x51caab[_0x2602('0x89')],_0x51caab[_0x2602('0x70')],_0x52be12[_0x2602('0x4c')],_0x51caab[_0x2602('0x83')]);}else{logger[_0x2602('0x62')](util[_0x2602('0x31')](_0x2602('0x8f'),_0x558182['params']['id']));return{'transcribeStatus':_0x2602('0x90')};}})[_0x2602('0x26')](function(_0x4fd080){if(_0x4fd080){_0x4fd080[_0x2602('0x91')]=_0x558182['body'][_0x2602('0x80')];return _0x52be12[_0x2602('0x92')](_0x4fd080);}})['then'](respondWithResult(_0x21fff3,null))[_0x2602('0x43')](handleError(_0x21fff3,null));};function writeFile(_0x42e078,_0x150910){return new Promise(function(_0x2bdc81,_0x5e57f7){fs['writeFile'](_0x150910,_0x42e078,function(_0x4daf4d,_0x27984a){if(_0x4daf4d){return _0x5e57f7(_0x4daf4d);}else{return _0x2bdc81(_0x27984a);}});});}exports[_0x2602('0x93')]=function(_0x4e2eb5,_0x39707e,_0x32d907){return db[_0x2602('0x2d')][_0x2602('0x7c')]({'where':{'id':_0x4e2eb5['params']['id']}})[_0x2602('0x26')](handleEntityNotFound(_0x39707e))['then'](function(_0x5b411c){if(_0x5b411c&&_0x5b411c[_0x2602('0x94')]){var _0x13d872=_0x5b411c[_0x2602('0x94')];var _0x39de8a=config['root']+_0x2602('0x95')+_0x5b411c['id']+_0x2602('0x96');if(fs[_0x2602('0x5e')](_0x39de8a)){return _0x39de8a;}return writeFile(_0x13d872,_0x39de8a)['then'](function(){return _0x39de8a;});}else{throw new db[(_0x2602('0x51'))]['ValidationError'](_0x2602('0x97'));}})[_0x2602('0x26')](function(_0x3f221e){return _0x39707e['download'](_0x3f221e);})[_0x2602('0x43')](handleError(_0x39707e));}; \ No newline at end of file +var _0x8e58=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','name','send','index','map','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','VoiceRecording','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','secrets','recording','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','sequelize','MD5','col','token','$and','push','decryptFile','ValidationError','extname','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','findOne','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x232493,_0x195497){var _0x5482f7=function(_0x3c240a){while(--_0x3c240a){_0x232493['push'](_0x232493['shift']());}};_0x5482f7(++_0x195497);}(_0x8e58,0x91));var _0x88e5=function(_0x3106e4,_0x4b2f59){_0x3106e4=_0x3106e4-0x0;var _0x4989e2=_0x8e58[_0x3106e4];return _0x4989e2;};'use strict';var emlformat=require(_0x88e5('0x0'));var rimraf=require(_0x88e5('0x1'));var zipdir=require(_0x88e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x88e5('0x3'));var moment=require('moment');var BPromise=require(_0x88e5('0x4'));var Mustache=require(_0x88e5('0x5'));var util=require(_0x88e5('0x6'));var path=require(_0x88e5('0x7'));var sox=require(_0x88e5('0x8'));var csv=require(_0x88e5('0x9'));var ejs=require(_0x88e5('0xa'));var fs=require('fs');var fs_extra=require(_0x88e5('0xb'));var _=require(_0x88e5('0xc'));var squel=require('squel');var crypto=require(_0x88e5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x88e5('0xe'));var Papa=require(_0x88e5('0xf'));var AWS=require(_0x88e5('0x10'));var uuidv4=require(_0x88e5('0x11'));var Redis=require(_0x88e5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x88e5('0x13'));var hardwareService=require(_0x88e5('0x14'));var logger=require(_0x88e5('0x15'))(_0x88e5('0x16'));var utils=require(_0x88e5('0x17'));var config=require(_0x88e5('0x18'));var licenseUtil=require(_0x88e5('0x19'));var db=require(_0x88e5('0x1a'))['db'];function respondWithStatusCode(_0x39253e,_0x3f4b70){_0x3f4b70=_0x3f4b70||0xcc;return function(_0x28678a){if(_0x28678a){return _0x39253e['sendStatus'](_0x3f4b70);}return _0x39253e[_0x88e5('0x1b')](_0x3f4b70)[_0x88e5('0x1c')]();};}function respondWithResult(_0x10c268,_0x232967){_0x232967=_0x232967||0xc8;return function(_0x4c44aa){if(_0x4c44aa){return _0x10c268['status'](_0x232967)['json'](_0x4c44aa);}};}function respondWithFilteredResult(_0x2004b2,_0x24806d){return function(_0x4ae1b9){if(_0x4ae1b9){var _0x5846ec=typeof _0x24806d[_0x88e5('0x1d')]===_0x88e5('0x1e')&&typeof _0x24806d[_0x88e5('0x1f')]===_0x88e5('0x1e');var _0x57d094=_0x4ae1b9[_0x88e5('0x20')];var _0x2a428e=_0x5846ec?0x0:_0x24806d[_0x88e5('0x1d')];var _0x513887=_0x5846ec?_0x4ae1b9['count']:_0x24806d['offset']+_0x24806d[_0x88e5('0x1f')];var _0x184960;if(_0x513887>=_0x57d094){_0x513887=_0x57d094;_0x184960=0xc8;}else{_0x184960=0xce;}_0x2004b2['status'](_0x184960);return _0x2004b2[_0x88e5('0x21')](_0x88e5('0x22'),_0x2a428e+'-'+_0x513887+'/'+_0x57d094)[_0x88e5('0x23')](_0x4ae1b9);}return null;};}function patchUpdates(_0x159369){return function(_0x5e672d){try{jsonpatch[_0x88e5('0x24')](_0x5e672d,_0x159369,!![]);}catch(_0x5488ce){return BPromise['reject'](_0x5488ce);}return _0x5e672d[_0x88e5('0x25')]();};}function saveUpdates(_0x51b13d,_0x2fb787){return function(_0x1c44e5){if(_0x1c44e5){return _0x1c44e5[_0x88e5('0x26')](_0x51b13d)[_0x88e5('0x27')](function(_0x233c37){return _0x233c37;});}return null;};}function removeEntity(_0x5bbaa8,_0x4034a4){return function(_0x28b627){if(_0x28b627){return _0x28b627[_0x88e5('0x28')]()['then'](function(){_0x5bbaa8[_0x88e5('0x1b')](0xcc)[_0x88e5('0x1c')]();});}};}function handleEntityNotFound(_0x3616fe,_0x95265c){return function(_0xb42544){if(!_0xb42544){_0x3616fe[_0x88e5('0x29')](0x194);}return _0xb42544;};}function handleError(_0x3365ec,_0x5c8dff){_0x5c8dff=_0x5c8dff||0x1f4;return function(_0x4d2252){logger['error'](_0x4d2252['stack']);if(_0x4d2252[_0x88e5('0x2a')]){delete _0x4d2252[_0x88e5('0x2a')];}_0x3365ec[_0x88e5('0x1b')](_0x5c8dff)[_0x88e5('0x2b')](_0x4d2252);};}exports[_0x88e5('0x2c')]=function(_0x4dd279,_0x4e45d7){var _0x3eaaf3={},_0x45e8dd={},_0xbe6522={'count':0x0,'rows':[]};var _0x4563b4=_[_0x88e5('0x2d')](db['VoiceRecording']['rawAttributes'],function(_0xfff8fa){return{'name':_0xfff8fa['fieldName'],'type':_0xfff8fa[_0x88e5('0x2e')]['key']};});_0x45e8dd[_0x88e5('0x2f')]=_['differenceBy'](_['map'](_0x4563b4,'name'),['format']);_0x45e8dd[_0x88e5('0x30')]=_['keys'](_0x4dd279[_0x88e5('0x30')]);_0x45e8dd[_0x88e5('0x31')]=_[_0x88e5('0x32')](_0x45e8dd['model'],_0x45e8dd['query']);_0x3eaaf3[_0x88e5('0x33')]=_[_0x88e5('0x32')](_0x45e8dd[_0x88e5('0x2f')],qs[_0x88e5('0x34')](_0x4dd279['query'][_0x88e5('0x34')]));_0x3eaaf3['attributes']=_0x3eaaf3[_0x88e5('0x33')][_0x88e5('0x35')]?_0x3eaaf3[_0x88e5('0x33')]:_0x45e8dd[_0x88e5('0x2f')];if(!_0x4dd279[_0x88e5('0x30')]['hasOwnProperty']('nolimit')){_0x3eaaf3[_0x88e5('0x1f')]=qs[_0x88e5('0x1f')](_0x4dd279[_0x88e5('0x30')]['limit']);_0x3eaaf3[_0x88e5('0x1d')]=qs['offset'](_0x4dd279[_0x88e5('0x30')][_0x88e5('0x1d')]);}_0x3eaaf3[_0x88e5('0x36')]=qs[_0x88e5('0x37')](_0x4dd279[_0x88e5('0x30')][_0x88e5('0x37')]);_0x3eaaf3[_0x88e5('0x38')]=qs[_0x88e5('0x31')](_[_0x88e5('0x39')](_0x4dd279[_0x88e5('0x30')],_0x45e8dd[_0x88e5('0x31')]),_0x4563b4);if(_0x4dd279[_0x88e5('0x30')][_0x88e5('0x3a')]){_0x3eaaf3[_0x88e5('0x38')]=_[_0x88e5('0x3b')](_0x3eaaf3[_0x88e5('0x38')],{'$or':_['map'](_0x4563b4,function(_0x4eba92){if(_0x4eba92[_0x88e5('0x2e')]!=='VIRTUAL'){var _0x3e3e18={};_0x3e3e18[_0x4eba92[_0x88e5('0x2a')]]={'$like':'%'+_0x4dd279['query'][_0x88e5('0x3a')]+'%'};return _0x3e3e18;}})});}_0x3eaaf3=_['merge']({},_0x3eaaf3,_0x4dd279[_0x88e5('0x3c')]);var _0x1621f5={'where':_0x3eaaf3['where']};return db[_0x88e5('0x3d')][_0x88e5('0x20')](_0x1621f5)[_0x88e5('0x27')](function(_0x2413ec){_0xbe6522[_0x88e5('0x20')]=_0x2413ec;if(_0x4dd279[_0x88e5('0x30')][_0x88e5('0x3e')]){_0x3eaaf3[_0x88e5('0x3f')]=[{'all':!![]}];}return db[_0x88e5('0x3d')][_0x88e5('0x40')](_0x3eaaf3);})[_0x88e5('0x27')](function(_0xfa2b64){_0xbe6522[_0x88e5('0x41')]=_0xfa2b64;return _0xbe6522;})['then'](respondWithFilteredResult(_0x4e45d7,_0x3eaaf3))[_0x88e5('0x42')](handleError(_0x4e45d7,null));};exports['show']=function(_0x272036,_0x3ca837){var _0x490f86={'raw':![],'where':{'id':_0x272036['params']['id']}},_0x2fbc1b={};_0x2fbc1b[_0x88e5('0x2f')]=_[_0x88e5('0x43')](db[_0x88e5('0x3d')][_0x88e5('0x44')]);_0x2fbc1b[_0x88e5('0x30')]=_[_0x88e5('0x43')](_0x272036['query']);_0x2fbc1b[_0x88e5('0x31')]=_[_0x88e5('0x32')](_0x2fbc1b[_0x88e5('0x2f')],_0x2fbc1b['query']);_0x490f86[_0x88e5('0x33')]=_[_0x88e5('0x32')](_0x2fbc1b['model'],qs[_0x88e5('0x34')](_0x272036[_0x88e5('0x30')][_0x88e5('0x34')]));_0x490f86[_0x88e5('0x33')]=_0x490f86[_0x88e5('0x33')]['length']?_0x490f86['attributes']:_0x2fbc1b[_0x88e5('0x2f')];if(_0x272036[_0x88e5('0x30')]['includeAll']){_0x490f86['include']=[{'all':!![]}];}_0x490f86=_['merge']({},_0x490f86,_0x272036['options']);return db[_0x88e5('0x3d')][_0x88e5('0x45')](_0x490f86)[_0x88e5('0x27')](handleEntityNotFound(_0x3ca837,null))[_0x88e5('0x27')](respondWithResult(_0x3ca837,null))[_0x88e5('0x42')](handleError(_0x3ca837,null));};exports[_0x88e5('0x46')]=function(_0x372ae3,_0x1d5e8c){return db[_0x88e5('0x3d')][_0x88e5('0x46')](_0x372ae3['body'],{})[_0x88e5('0x27')](respondWithResult(_0x1d5e8c,0xc9))[_0x88e5('0x42')](handleError(_0x1d5e8c,null));};exports[_0x88e5('0x26')]=function(_0x1864e4,_0x219f05){if(_0x1864e4['body']['id']){delete _0x1864e4[_0x88e5('0x47')]['id'];}return db[_0x88e5('0x3d')][_0x88e5('0x45')]({'where':{'id':_0x1864e4[_0x88e5('0x48')]['id']}})[_0x88e5('0x27')](handleEntityNotFound(_0x219f05,null))[_0x88e5('0x27')](saveUpdates(_0x1864e4[_0x88e5('0x47')],null))[_0x88e5('0x27')](respondWithResult(_0x219f05,null))['catch'](handleError(_0x219f05,null));};exports[_0x88e5('0x49')]=function(_0x50a863,_0x243259){return db['VoiceRecording'][_0x88e5('0x49')]()[_0x88e5('0x27')](respondWithResult(_0x243259,null))['catch'](handleError(_0x243259,null));};exports[_0x88e5('0x4a')]=function(_0x48d580,_0x4a6f7a,_0x197089){var _0x53e308=require(_0x88e5('0x4b'));var _0x1354e1=![];var _0x10d9e6={};if(_0x48d580[_0x88e5('0x30')][_0x88e5('0x2e')]&&_0x48d580[_0x88e5('0x30')]['type']===_0x88e5('0x4c')){_0x10d9e6[_0x88e5('0x4c')]=_0x48d580[_0x88e5('0x48')]['id'];}else{_0x10d9e6['id']=_0x48d580[_0x88e5('0x48')]['id'];}return db[_0x88e5('0x3d')][_0x88e5('0x45')]({'where':_0x10d9e6,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4a6f7a,null))[_0x88e5('0x27')](function(_0x2e56d9){if(_0x2e56d9){var _0x5f394d=_0x2e56d9[_0x88e5('0x4d')];var _0x567853=util[_0x88e5('0x4e')](_0x88e5('0x4f'),_0x5f394d);if(fs['existsSync'](_0x567853)){_0x1354e1=!![];return _0x53e308['decryptFile'](_0x567853,_0x5f394d,config[_0x88e5('0x50')][_0x88e5('0x51')])[_0x88e5('0x27')](function(){return _0x2e56d9;});}return _0x2e56d9;}})[_0x88e5('0x27')](function(_0x555f0c){if(_0x555f0c){var _0x4576f4=_0x555f0c[_0x88e5('0x4d')];if(!fs[_0x88e5('0x52')](_0x4576f4)){throw new db[(_0x88e5('0x53'))]['ValidationError'](_0x88e5('0x54'));}if(_0x555f0c['filename']){return _0x4a6f7a[_0x88e5('0x4a')](_0x4576f4,_0x555f0c[_0x88e5('0x55')]+path['extname'](_0x4576f4),function(){if(_0x1354e1){fs[_0x88e5('0x56')](_0x4576f4);}});}else{return _0x4a6f7a['download'](_0x4576f4,function(_0x5e927b){if(_0x1354e1){fs[_0x88e5('0x56')](_0x4576f4);}});}}})[_0x88e5('0x42')](function(_0x33474c){if(_0x33474c[_0x88e5('0x57')]===_0x88e5('0x54')){_0x4a6f7a['status'](0x194)[_0x88e5('0x2b')](_0x88e5('0x58'));}else{return handleError(_0x4a6f7a,null);}});};exports['downloads']=function(_0x51a1d4,_0xbb89b9,_0xdd5440){var _0xa6c122=require(_0x88e5('0x4b'));var _0x52457a=![];var _0x3115f9={'$and':[db[_0x88e5('0x59')]['where'](db[_0x88e5('0x59')]['fn'](_0x88e5('0x5a'),db['sequelize'][_0x88e5('0x5b')](_0x88e5('0x4c'))),_0x51a1d4[_0x88e5('0x30')][_0x88e5('0x5c')])]};if(_0x51a1d4[_0x88e5('0x30')][_0x88e5('0x2e')]&&_0x51a1d4['query'][_0x88e5('0x2e')]==='uniqueid'){_0x3115f9['$and']['push']({'uniqueid':_0x51a1d4[_0x88e5('0x48')]['id']});}else{_0x3115f9[_0x88e5('0x5d')][_0x88e5('0x5e')]({'id':_0x51a1d4[_0x88e5('0x48')]['id']});}return db[_0x88e5('0x3d')][_0x88e5('0x45')]({'where':_0x3115f9,'attributes':['id',_0x88e5('0x4d')],'raw':!![]})[_0x88e5('0x27')](handleEntityNotFound(_0xbb89b9,null))[_0x88e5('0x27')](function(_0x27b9f5){if(_0x27b9f5){var _0x80afed=util[_0x88e5('0x4e')]('%s.cypher',_0x27b9f5[_0x88e5('0x4d')]);if(fs[_0x88e5('0x52')](_0x80afed)){_0x52457a=!![];return _0xa6c122[_0x88e5('0x5f')](_0x80afed,_0x27b9f5[_0x88e5('0x4d')],config['secrets'][_0x88e5('0x51')])['then'](function(){return _0x27b9f5;});}return _0x27b9f5;}})[_0x88e5('0x27')](function(_0x548b72){if(_0x548b72){if(!fs[_0x88e5('0x52')](_0x548b72[_0x88e5('0x4d')])){throw new db[(_0x88e5('0x53'))][(_0x88e5('0x60'))](_0x88e5('0x54'));}if(_0x548b72[_0x88e5('0x55')]){return _0xbb89b9[_0x88e5('0x4a')](_0x548b72[_0x88e5('0x4d')],_0x548b72[_0x88e5('0x55')]+path[_0x88e5('0x61')](_0x548b72[_0x88e5('0x4d')]),function(){if(_0x52457a){fs['unlink'](_0x548b72[_0x88e5('0x4d')]);}});}else{return _0xbb89b9['download'](_0x548b72[_0x88e5('0x4d')],function(_0x5d1729){if(_0x52457a){fs[_0x88e5('0x56')](_0x548b72['value']);}});}}})[_0x88e5('0x42')](handleError(_0xbb89b9,null));};exports[_0x88e5('0x28')]=function(_0x43f740,_0x5e93b5){return db[_0x88e5('0x3d')][_0x88e5('0x45')]({'where':{'id':_0x43f740[_0x88e5('0x48')]['id']}})[_0x88e5('0x27')](function(_0x3f3845){if(_['isNil'](_0x3f3845)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3f3845;})[_0x88e5('0x27')](function(_0x149d45){var _0x1ba0a8=_0x149d45[_0x88e5('0x4d')];logger[_0x88e5('0x62')](_0x88e5('0x63'),_0x1ba0a8);if(!_[_0x88e5('0x64')](_0x149d45['value'])&&fs[_0x88e5('0x52')](_0x1ba0a8)){logger[_0x88e5('0x62')](_0x88e5('0x65')+_0x1ba0a8+_0x88e5('0x66'));fs[_0x88e5('0x67')](_0x1ba0a8);}_0x1ba0a8=_0x1ba0a8+_0x88e5('0x68');if(!_[_0x88e5('0x64')](_0x149d45[_0x88e5('0x4d')])&&fs[_0x88e5('0x52')](_0x1ba0a8)){logger['info'](_0x88e5('0x65')+_0x1ba0a8+_0x88e5('0x66'));fs[_0x88e5('0x67')](_0x1ba0a8);}return _0x149d45;})[_0x88e5('0x27')](function(_0x578885){if(!_0x578885)throw new InternalError();return _0x578885['destroy']();})[_0x88e5('0x27')](function(){_0x5e93b5['status'](0xcc)['end']();})[_0x88e5('0x42')](handleError(_0x5e93b5,null));};function getBucketslist(_0x3b8846,_0x1aeb72,_0x2d9c43){return new Promise(function(_0x5c2a62,_0x398337){var _0x1ce043=new AWS['S3']({'accessKeyId':_0x1aeb72,'secretAccessKey':_0x3b8846,'region':_0x2d9c43});_0x1ce043['listBuckets']({},function(_0x40bfb6,_0x403570){if(_0x40bfb6){return _0x398337(_0x40bfb6);}else{return _0x5c2a62(_0x403570);}});});}function createBucket(_0x170f81,_0x4aba88,_0xca234e,_0x3007fd){return new Promise(function(_0x277f71,_0x15ceb9){var _0x52467e=new AWS['S3']({'accessKeyId':_0x4aba88,'secretAccessKey':_0x170f81,'region':_0xca234e});_0x52467e['createBucket']({'Bucket':_0x3007fd},function(_0x35e2cb,_0x29fa15){if(_0x35e2cb){return _0x15ceb9(_0x35e2cb);}else{return _0x277f71(_0x29fa15);}});});}function uploadFile(_0x3eabb4,_0x5c2dce,_0x483412,_0x1ba0be,_0xebf784,_0x22ea6d){return new Promise(function(_0x328050,_0x237e7d){var _0x4d6851=new AWS['S3']({'accessKeyId':_0x5c2dce,'secretAccessKey':_0x3eabb4,'region':_0x483412});_0x4d6851['upload']({'Bucket':_0x1ba0be,'Key':_0xebf784,'Body':_0x22ea6d},function(_0x27851f,_0x4068f0){if(_0x27851f){return _0x237e7d(_0x27851f);}else{return _0x328050(_0x4068f0);}});});}function startTranscribe(_0x6958a7,_0x5c4ed3,_0x150828,_0x89d036,_0x5e4969,_0x3b47e5){return new Promise(function(_0x1017fd,_0x379acf){var _0x639e1b=new AWS[(_0x88e5('0x69'))]({'accessKeyId':_0x5c4ed3,'secretAccessKey':_0x6958a7,'region':_0x150828});_0x639e1b[_0x88e5('0x6a')]({'TranscriptionJobName':_0x89d036,'LanguageCode':_0x5e4969,'Media':{'MediaFileUri':_0x3b47e5}},function(_0x3bcb7f,_0x43534b){if(_0x3bcb7f){return _0x379acf(_0x3bcb7f);}else{return _0x1017fd(_0x43534b);}});});}function transcribe(_0x3c1ea5,_0x148a22,_0x27b8e4,_0x126543,_0x228d27,_0x1671df,_0x3d401e){return new Promise(function(_0x304b77,_0x855a68){var _0x42073e={};logger[_0x88e5('0x62')](util['format'](_0x88e5('0x6b'),_0x3c1ea5,_0x228d27));return uploadFile(_0x148a22,_0x27b8e4,_0x126543,_0x228d27,path[_0x88e5('0x6c')](_0x1671df),fs[_0x88e5('0x6d')](_0x1671df))['then'](function(_0x47b5f9){logger[_0x88e5('0x62')](util[_0x88e5('0x4e')](_0x88e5('0x6e'),_0x3c1ea5,_0x228d27,_0x47b5f9[_0x88e5('0x6f')]));_0x42073e['bucket']=_0x47b5f9[_0x88e5('0x70')];_0x42073e[_0x88e5('0x71')]=_0x47b5f9[_0x88e5('0x6f')];logger[_0x88e5('0x62')](util['format'](_0x88e5('0x72'),_0x3c1ea5));return startTranscribe(_0x148a22,_0x27b8e4,_0x126543,uuidv4(),_0x3d401e,_0x47b5f9[_0x88e5('0x6f')]);})[_0x88e5('0x27')](function(_0x3744d0){logger[_0x88e5('0x62')](util[_0x88e5('0x4e')](_0x88e5('0x73'),_0x3c1ea5,_0x3744d0['TranscriptionJob'][_0x88e5('0x74')]));_0x42073e[_0x88e5('0x75')]=_0x3744d0[_0x88e5('0x76')][_0x88e5('0x74')];_0x42073e[_0x88e5('0x77')]=_0x3744d0[_0x88e5('0x76')][_0x88e5('0x78')];return _0x304b77(_0x42073e);})['catch'](function(_0x3c2b1e){return _0x855a68(_0x3c2b1e);});});}exports[_0x88e5('0x79')]=function(_0xd72042,_0x13bc84,_0x5873dd){var _0x49e86e;var _0x2c42d7;var _0x5c096e;var _0x2c2107=require(_0x88e5('0x4b'));return db[_0x88e5('0x3d')]['findOne']({'where':{'id':_0xd72042[_0x88e5('0x48')]['id']}})['then'](function(_0x5e4f37){if(_0x5e4f37){var _0xb35cc6=util[_0x88e5('0x4e')](_0x88e5('0x4f'),_0x5e4f37[_0x88e5('0x4d')]);if(fs[_0x88e5('0x52')](_0xb35cc6)){cypher=!![];return _0x2c2107[_0x88e5('0x5f')](_0xb35cc6,_0x5e4f37[_0x88e5('0x4d')],config[_0x88e5('0x50')]['recording'])[_0x88e5('0x27')](function(){return _0x5e4f37;});}return _0x5e4f37;}})[_0x88e5('0x27')](function(_0xf736ea){if(!_0xf736ea){throw new db[(_0x88e5('0x53'))][(_0x88e5('0x60'))](_0x88e5('0x7a'));}_0x2c42d7=_0xf736ea;return db[_0x88e5('0x7b')]['findOne']({'where':{'id':0x1}});})[_0x88e5('0x27')](handleEntityNotFound(_0x13bc84,null))[_0x88e5('0x27')](function(_0x1cc7a2){if(_0x1cc7a2){_0x49e86e=_0x1cc7a2;if(!_0x49e86e['transcribe']||!_0x49e86e['transcribeAccountId']||!_0x49e86e[_0x88e5('0x7c')]||!_0x49e86e['language']||!_0x49e86e['bucket']){throw new db[(_0x88e5('0x53'))][(_0x88e5('0x60'))](_0x88e5('0x7d'));}if(_0xd72042[_0x88e5('0x47')][_0x88e5('0x7e')]&&(!_0x49e86e[_0x88e5('0x7f')]||!_0x49e86e[_0x88e5('0x80')]||!_0x49e86e[_0x88e5('0x81')]||!_0x49e86e[_0x88e5('0x82')]||!_0x49e86e[_0x88e5('0x83')])){throw new db[(_0x88e5('0x53'))][(_0x88e5('0x60'))](_0x88e5('0x84'));}return db['CloudProvider']['findOne']({'where':{'id':_0x49e86e['transcribeAccountId']}});}})[_0x88e5('0x27')](function(_0x1c6aa6){if(!_0x1c6aa6){throw new db['Sequelize'][(_0x88e5('0x60'))](_0x88e5('0x85'));}if(!_0x1c6aa6['data1']||!_0x1c6aa6[_0x88e5('0x86')]){throw new db[(_0x88e5('0x53'))][(_0x88e5('0x60'))](_0x88e5('0x87'));}_0x5c096e=_0x1c6aa6;return getBucketslist(_0x5c096e[_0x88e5('0x88')],_0x5c096e[_0x88e5('0x86')],_0x49e86e['transcribeRegion']);})['then'](function(_0xdd9411){if(_0xdd9411&&_0xdd9411[_0x88e5('0x89')]){var _0x2440f7=_[_0x88e5('0x45')](_0xdd9411[_0x88e5('0x89')],function(_0x5ec414){return _0x5ec414[_0x88e5('0x8a')]===_0x49e86e[_0x88e5('0x83')];});if(!_0x2440f7){logger[_0x88e5('0x62')](util[_0x88e5('0x4e')](_0x88e5('0x8b'),_0xd72042[_0x88e5('0x48')]['id'],_0x49e86e[_0x88e5('0x83')]));return createBucket(_0x5c096e['data1'],_0x5c096e['data2'],_0x49e86e[_0x88e5('0x7c')],_0x49e86e['bucket']);}logger[_0x88e5('0x62')](util[_0x88e5('0x4e')](_0x88e5('0x8c'),_0xd72042[_0x88e5('0x48')]['id'],_0x49e86e['bucket']));return;}})[_0x88e5('0x27')](function(_0x19dd79){if(_0x2c42d7['transcribeStatus']==='NEW'){return transcribe(_0xd72042[_0x88e5('0x48')]['id'],_0x5c096e[_0x88e5('0x88')],_0x5c096e[_0x88e5('0x86')],_0x49e86e[_0x88e5('0x7c')],_0x49e86e['bucket'],_0x2c42d7[_0x88e5('0x4d')],_0x49e86e['language']);}else{logger[_0x88e5('0x62')](util['format'](_0x88e5('0x8d'),_0xd72042[_0x88e5('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x88e5('0x27')](function(_0x1ef8fc){if(_0x1ef8fc){_0x1ef8fc[_0x88e5('0x8e')]=_0xd72042[_0x88e5('0x47')]['runSentiment'];return _0x2c42d7[_0x88e5('0x8f')](_0x1ef8fc);}})[_0x88e5('0x27')](respondWithResult(_0x13bc84,null))['catch'](handleError(_0x13bc84,null));};function writeFile(_0x4d949e,_0x1f97c6){return new Promise(function(_0x152f40,_0x40f87c){fs[_0x88e5('0x90')](_0x1f97c6,_0x4d949e,function(_0x518628,_0x34e303){if(_0x518628){return _0x40f87c(_0x518628);}else{return _0x152f40(_0x34e303);}});});}exports['downloadTranscribe']=function(_0x4c5a36,_0x1942fc,_0x576891){return db[_0x88e5('0x3d')][_0x88e5('0x91')]({'where':{'id':_0x4c5a36[_0x88e5('0x48')]['id']}})[_0x88e5('0x27')](handleEntityNotFound(_0x1942fc))[_0x88e5('0x27')](function(_0x5bcda1){if(_0x5bcda1&&_0x5bcda1[_0x88e5('0x92')]){var _0x21052e=_0x5bcda1['fileText'];var _0x213f57=config[_0x88e5('0x93')]+_0x88e5('0x94')+_0x5bcda1['id']+_0x88e5('0x95');if(fs[_0x88e5('0x52')](_0x213f57)){return _0x213f57;}return writeFile(_0x21052e,_0x213f57)['then'](function(){return _0x213f57;});}else{throw new db['Sequelize'][(_0x88e5('0x60'))](_0x88e5('0x96'));}})[_0x88e5('0x27')](function(_0x3fb8ad){return _0x1942fc[_0x88e5('0x4a')](_0x3fb8ad);})[_0x88e5('0x42')](handleError(_0x1942fc));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2f6a5d4..2ba595a 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 _0x6b61=['uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','voice_recordings'];(function(_0x15be09,_0x150431){var _0x4078e5=function(_0x42d4a3){while(--_0x42d4a3){_0x15be09['push'](_0x15be09['shift']());}};_0x4078e5(++_0x150431);}(_0x6b61,0x16a));var _0x16b6=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x6b61[_0x2cfb58];return _0xd99951;};'use strict';var attributes=require(_0x16b6('0x0'));module['exports']=function(_0x4443d4,_0x71a55){return _0x4443d4[_0x16b6('0x1')](_0x16b6('0x2'),attributes,{'tableName':_0x16b6('0x3'),'paranoid':![],'indexes':[{'name':_0x16b6('0x4'),'fields':[_0x16b6('0x4')]},{'name':_0x16b6('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x452b6e,_0x41ebb7){var _0x3661d4=function(_0x51a7a1){while(--_0x51a7a1){_0x452b6e['push'](_0x452b6e['shift']());}};_0x3661d4(++_0x41ebb7);}(_0x702d,0x147));var _0xd702=function(_0x8d614a,_0x42b849){_0x8d614a=_0x8d614a-0x0;var _0x5b37a3=_0x702d[_0x8d614a];return _0x5b37a3;};'use strict';var attributes=require(_0xd702('0x0'));module[_0xd702('0x1')]=function(_0x37c2c5,_0x33e7c5){return _0x37c2c5[_0xd702('0x2')]('VoiceRecording',attributes,{'tableName':_0xd702('0x3'),'paranoid':![],'indexes':[{'name':_0xd702('0x4'),'fields':[_0xd702('0x4')]},{'name':_0xd702('0x5'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index c0db8f0..4a8473a 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 _0x323f=['UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x8c4785,_0x8cc058){var _0x290c6d=function(_0x80c07f){while(--_0x80c07f){_0x8c4785['push'](_0x8c4785['shift']());}};_0x290c6d(++_0x8cc058);}(_0x323f,0x1ee));var _0xf323=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x323f[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});}exports[_0xf323('0x16')]=function(_0x49b115){var _0x2db977=this;return new Promise(function(_0x272aec,_0x1a459d){return db[_0xf323('0x17')]['update'](_0x49b115[_0xf323('0x18')],{'raw':_0x49b115[_0xf323('0x19')]?_0x49b115['options'][_0xf323('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49b115[_0xf323('0x19')]?_0x49b115[_0xf323('0x19')][_0xf323('0x1b')]||null:null,'attributes':_0x49b115['options']?_0x49b115[_0xf323('0x19')][_0xf323('0x1c')]||null:null,'limit':_0x49b115[_0xf323('0x19')]?_0x49b115['options'][_0xf323('0x1d')]||null:null})[_0xf323('0xc')](function(_0x3e1c49){logger[_0xf323('0xd')](_0xf323('0x16'),_0x49b115);logger[_0xf323('0x10')](_0xf323('0x16'),_0x49b115,JSON[_0xf323('0x12')](_0x3e1c49));_0x272aec(_0x3e1c49);})[_0xf323('0x1e')](function(_0x47fb15){logger[_0xf323('0x13')](_0xf323('0x16'),_0x47fb15[_0xf323('0x14')],_0x49b115);_0x1a459d(_0x2db977[_0xf323('0x13')](0x1f4,_0x47fb15[_0xf323('0x14')]));});});};exports[_0xf323('0x1f')]=function(_0x4d737d){var _0x30ed93=this;return new Promise(function(_0x56ce33,_0x1570d4){var _0x3902eb=require('../../components/encryptor');var _0x46663b;return db[_0xf323('0x20')][_0xf323('0x21')]({'attributes':['id',_0xf323('0x22')],'where':{'id':0x1},'raw':!![]})[_0xf323('0xc')](function(_0x5b8b60){_0x46663b=_0x5b8b60;return db[_0xf323('0x17')][_0xf323('0x23')](_0x4d737d[_0xf323('0x18')]);})[_0xf323('0xc')](function(_0x4260f3){if(_0x46663b[_0xf323('0x22')]&&fs[_0xf323('0x24')](_0x4260f3[_0xf323('0x25')])){var _0x139adc=util['format'](_0xf323('0x26'),_0x4260f3[_0xf323('0x25')]);return _0x3902eb[_0xf323('0x27')](_0x4260f3[_0xf323('0x25')],_0x139adc,config[_0xf323('0x28')]['recording'])[_0xf323('0xc')](function(){fs[_0xf323('0x29')](_0x4260f3[_0xf323('0x25')]);logger[_0xf323('0xd')](_0xf323('0x2a'));return _0x4260f3;});}return _0x4260f3;})['then'](function(_0x33487c){logger[_0xf323('0xd')](_0xf323('0x1f'),_0x4d737d);logger[_0xf323('0x10')]('CreateVoiceRecording',_0x4d737d,JSON[_0xf323('0x12')](_0x33487c));_0x56ce33(_0x33487c);})['catch'](function(_0x372c47){logger[_0xf323('0x13')]('CreateVoiceRecording',_0x372c47[_0xf323('0x14')],_0x4d737d);_0x1570d4(_0x30ed93['error'](0x1f4,_0x372c47[_0xf323('0x14')]));});});}; \ No newline at end of file +var _0x6d11=['message','catch','VoiceRecording','update','options','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','create','body','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5c8736,_0x2a2a03){var _0x142bdb=function(_0x406951){while(--_0x406951){_0x5c8736['push'](_0x5c8736['shift']());}};_0x142bdb(++_0x2a2a03);}(_0x6d11,0xbf));var _0x16d1=function(_0x5e5cd0,_0x540c4c){_0x5e5cd0=_0x5e5cd0-0x0;var _0x418a62=_0x6d11[_0x5e5cd0];return _0x418a62;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['UpdateVoiceRecording']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')](_0x46a25e['body'],{'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x18')]||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x19')]||null:null,'limit':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1a')]||null:null})[_0x16d1('0xa')](function(_0x585ce5){logger[_0x16d1('0xb')](_0x16d1('0x1b'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1b'),_0x46a25e,JSON[_0x16d1('0x10')](_0x585ce5));_0x1da1b8(_0x585ce5);})[_0x16d1('0x14')](function(_0x32f362){logger[_0x16d1('0x11')](_0x16d1('0x1b'),_0x32f362[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x32f362[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1c')]=function(_0x262f89){var _0x346b69=this;return new Promise(function(_0x2b8403,_0x491f65){var _0x25ae4e=require(_0x16d1('0x1d'));var _0x4257f1;return db['Setting'][_0x16d1('0x1e')]({'attributes':['id',_0x16d1('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x16d1('0xa')](function(_0x22e5b3){_0x4257f1=_0x22e5b3;return db[_0x16d1('0x15')][_0x16d1('0x20')](_0x262f89[_0x16d1('0x21')]);})['then'](function(_0x3dd104){if(_0x4257f1[_0x16d1('0x1f')]&&fs[_0x16d1('0x22')](_0x3dd104[_0x16d1('0x23')])){var _0x55c021=util['format'](_0x16d1('0x24'),_0x3dd104[_0x16d1('0x23')]);return _0x25ae4e[_0x16d1('0x25')](_0x3dd104[_0x16d1('0x23')],_0x55c021,config[_0x16d1('0x26')][_0x16d1('0x27')])[_0x16d1('0xa')](function(){fs[_0x16d1('0x28')](_0x3dd104[_0x16d1('0x23')]);logger[_0x16d1('0xb')](_0x16d1('0x29'));return _0x3dd104;});}return _0x3dd104;})[_0x16d1('0xa')](function(_0x188cf4){logger[_0x16d1('0xb')]('CreateVoiceRecording',_0x262f89);logger[_0x16d1('0xd')]('CreateVoiceRecording',_0x262f89,JSON[_0x16d1('0x10')](_0x188cf4));_0x2b8403(_0x188cf4);})[_0x16d1('0x14')](function(_0x2b9126){logger[_0x16d1('0x11')](_0x16d1('0x1c'),_0x2b9126[_0x16d1('0x13')],_0x262f89);_0x491f65(_0x346b69['error'](0x1f4,_0x2b9126['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 6d884e7..d22f8d0 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 _0x1c22=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x222786,_0x450427){var _0x174864=function(_0x17aa7f){while(--_0x17aa7f){_0x222786['push'](_0x222786['shift']());}};_0x174864(++_0x450427);}(_0x1c22,0x6a));var _0x21c2=function(_0x51f237,_0x1b9d7b){_0x51f237=_0x51f237-0x0;var _0x3786f5=_0x1c22[_0x51f237];return _0x3786f5;};'use strict';var multer=require(_0x21c2('0x0'));var util=require(_0x21c2('0x1'));var path=require(_0x21c2('0x2'));var timeout=require(_0x21c2('0x3'));var express=require(_0x21c2('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x21c2('0x5'));var interaction=require(_0x21c2('0x6'));var config=require(_0x21c2('0x7'));var controller=require(_0x21c2('0x8'));router[_0x21c2('0x9')]('/',auth['isAuthenticated'](),controller[_0x21c2('0xa')]);router[_0x21c2('0x9')](_0x21c2('0xb'),auth[_0x21c2('0xc')](),controller[_0x21c2('0xd')]);router['get'](_0x21c2('0xe'),auth[_0x21c2('0xc')](),controller[_0x21c2('0xf')]);router[_0x21c2('0x10')]('/',auth[_0x21c2('0xc')](),controller[_0x21c2('0x11')]);router[_0x21c2('0x12')]('/:id',auth[_0x21c2('0xc')](),controller[_0x21c2('0x13')]);router[_0x21c2('0x14')](_0x21c2('0xe'),auth[_0x21c2('0xc')](),controller['destroy']);module[_0x21c2('0x15')]=router; \ No newline at end of file +var _0x128f=['fs-extra','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x36b322,_0x1e465e){var _0xb2fbe4=function(_0x3f6002){while(--_0x3f6002){_0x36b322['push'](_0x36b322['shift']());}};_0xb2fbe4(++_0x1e465e);}(_0x128f,0x6d));var _0xf128=function(_0x5e4c60,_0x27fb14){_0x5e4c60=_0x5e4c60-0x0;var _0x50e15e=_0x128f[_0x5e4c60];return _0x50e15e;};'use strict';var multer=require(_0xf128('0x0'));var util=require(_0xf128('0x1'));var path=require(_0xf128('0x2'));var timeout=require(_0xf128('0x3'));var express=require(_0xf128('0x4'));var router=express[_0xf128('0x5')]();var fs_extra=require(_0xf128('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf128('0x7'));var config=require(_0xf128('0x8'));var controller=require(_0xf128('0x9'));router[_0xf128('0xa')]('/',auth[_0xf128('0xb')](),controller[_0xf128('0xc')]);router['get'](_0xf128('0xd'),auth[_0xf128('0xb')](),controller[_0xf128('0xe')]);router[_0xf128('0xa')](_0xf128('0xf'),auth['isAuthenticated'](),controller[_0xf128('0x10')]);router[_0xf128('0x11')]('/',auth[_0xf128('0xb')](),controller[_0xf128('0x12')]);router[_0xf128('0x13')]('/:id',auth[_0xf128('0xb')](),controller['update']);router[_0xf128('0x14')](_0xf128('0xf'),auth['isAuthenticated'](),controller[_0xf128('0x15')]);module[_0xf128('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 61914ac..5147cea 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 _0xac5a=['ENUM','STRING','sequelize','moment'];(function(_0x3f868a,_0x32c223){var _0x42fb01=function(_0x1a1ea0){while(--_0x1a1ea0){_0x3f868a['push'](_0x3f868a['shift']());}};_0x42fb01(++_0x32c223);}(_0xac5a,0x162));var _0xaac5=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0xac5a[_0x4df1f5];return _0x56585b;};'use strict';var Sequelize=require(_0xaac5('0x0'));var moment=require(_0xaac5('0x1'));module['exports']={'type':{'type':Sequelize[_0xaac5('0x2')]('blind','attended')},'result':{'type':Sequelize[_0xaac5('0x3')]},'transfererchannel':{'type':Sequelize[_0xaac5('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xaac5('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xaac5('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xaac5('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xaac5('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xaac5('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xaac5('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xaac5('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xaac5('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xaac5('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xaac5('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xaac5('0x3')]},'isexternal':{'type':Sequelize[_0xaac5('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xaac5('0x3')]},'extension':{'type':Sequelize[_0xaac5('0x3')]}}; \ No newline at end of file +var _0xe64d=['attended','STRING','Yes','moment','exports','ENUM','blind'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe64d,0x1ca));var _0xde64=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0xe64d[_0x8ba19a];return _0x2bd8b4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xde64('0x0'));module[_0xde64('0x1')]={'type':{'type':Sequelize[_0xde64('0x2')](_0xde64('0x3'),_0xde64('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xde64('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xde64('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xde64('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xde64('0x5')]},'transferercontext':{'type':Sequelize[_0xde64('0x5')]},'transfererexten':{'type':Sequelize[_0xde64('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xde64('0x5')]},'transfereechannel':{'type':Sequelize[_0xde64('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xde64('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xde64('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xde64('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xde64('0x5')]},'isexternal':{'type':Sequelize[_0xde64('0x2')](_0xde64('0x6'),'No')},'context':{'type':Sequelize[_0xde64('0x5')]},'extension':{'type':Sequelize[_0xde64('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index fe0ab99..6942173 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 _0xc168=['to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','VoiceTransferReport','type','key','model','query','attributes','intersection','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x14f428,_0x3192fe){var _0x14fd4b=function(_0x3dcca4){while(--_0x3dcca4){_0x14f428['push'](_0x14f428['shift']());}};_0x14fd4b(++_0x3192fe);}(_0xc168,0x84));var _0x8c16=function(_0x1327e3,_0x386bae){_0x1327e3=_0x1327e3-0x0;var _0x558110=_0xc168[_0x1327e3];return _0x558110;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c16('0x0'));var zipdir=require(_0x8c16('0x1'));var jsonpatch=require(_0x8c16('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8c16('0x3'));var Mustache=require(_0x8c16('0x4'));var util=require(_0x8c16('0x5'));var path=require(_0x8c16('0x6'));var sox=require(_0x8c16('0x7'));var csv=require(_0x8c16('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c16('0x9'));var crypto=require(_0x8c16('0xa'));var jsforce=require(_0x8c16('0xb'));var deskjs=require(_0x8c16('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8c16('0xd'));var Papa=require(_0x8c16('0xe'));var Redis=require(_0x8c16('0xf'));var authService=require(_0x8c16('0x10'));var qs=require(_0x8c16('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c16('0x12'));var logger=require(_0x8c16('0x13'))(_0x8c16('0x14'));var utils=require(_0x8c16('0x15'));var config=require(_0x8c16('0x16'));var licenseUtil=require(_0x8c16('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56fecc,_0x227ac2){_0x227ac2=_0x227ac2||0xcc;return function(_0xe8f351){if(_0xe8f351){return _0x56fecc[_0x8c16('0x18')](_0x227ac2);}return _0x56fecc[_0x8c16('0x19')](_0x227ac2)[_0x8c16('0x1a')]();};}function respondWithResult(_0x4d505f,_0x4151d4){_0x4151d4=_0x4151d4||0xc8;return function(_0x5c8023){if(_0x5c8023){return _0x4d505f[_0x8c16('0x19')](_0x4151d4)['json'](_0x5c8023);}};}function respondWithFilteredResult(_0x56a0b5,_0x59f152){return function(_0x5d4534){if(_0x5d4534){var _0x17b8f6=typeof _0x59f152['offset']==='undefined'&&typeof _0x59f152['limit']==='undefined';var _0x593f6f=_0x5d4534[_0x8c16('0x1b')];var _0x1ccf88=_0x17b8f6?0x0:_0x59f152[_0x8c16('0x1c')];var _0x57f87a=_0x17b8f6?_0x5d4534[_0x8c16('0x1b')]:_0x59f152['offset']+_0x59f152[_0x8c16('0x1d')];var _0x16afd7;if(_0x57f87a>=_0x593f6f){_0x57f87a=_0x593f6f;_0x16afd7=0xc8;}else{_0x16afd7=0xce;}_0x56a0b5[_0x8c16('0x19')](_0x16afd7);return _0x56a0b5[_0x8c16('0x1e')](_0x8c16('0x1f'),_0x1ccf88+'-'+_0x57f87a+'/'+_0x593f6f)['json'](_0x5d4534);}return null;};}function patchUpdates(_0x542566){return function(_0x481ae9){try{jsonpatch[_0x8c16('0x20')](_0x481ae9,_0x542566,!![]);}catch(_0x410905){return BPromise[_0x8c16('0x21')](_0x410905);}return _0x481ae9[_0x8c16('0x22')]();};}function saveUpdates(_0x139d0b,_0x4c0c56){return function(_0x2f3671){if(_0x2f3671){return _0x2f3671[_0x8c16('0x23')](_0x139d0b)[_0x8c16('0x24')](function(_0x42c17c){return _0x42c17c;});}return null;};}function removeEntity(_0x2ba39d,_0x5ba81b){return function(_0x8d3027){if(_0x8d3027){return _0x8d3027[_0x8c16('0x25')]()[_0x8c16('0x24')](function(){_0x2ba39d[_0x8c16('0x19')](0xcc)[_0x8c16('0x1a')]();});}};}function handleEntityNotFound(_0x38ab39,_0x25bff2){return function(_0x40a0f5){if(!_0x40a0f5){_0x38ab39['sendStatus'](0x194);}return _0x40a0f5;};}function handleError(_0x17134d,_0x553a62){_0x553a62=_0x553a62||0x1f4;return function(_0xea0530){logger[_0x8c16('0x26')](_0xea0530[_0x8c16('0x27')]);if(_0xea0530[_0x8c16('0x28')]){delete _0xea0530[_0x8c16('0x28')];}_0x17134d['status'](_0x553a62)['send'](_0xea0530);};}exports['index']=function(_0x3ec6d5,_0x48be3f){var _0x3886d6={},_0x5a588f={},_0xf97bfc={'count':0x0,'rows':[]};var _0x3d7e4d=_[_0x8c16('0x29')](db[_0x8c16('0x2a')]['rawAttributes'],function(_0x38eec9){return{'name':_0x38eec9['fieldName'],'type':_0x38eec9[_0x8c16('0x2b')][_0x8c16('0x2c')]};});_0x5a588f[_0x8c16('0x2d')]=_['map'](_0x3d7e4d,_0x8c16('0x28'));_0x5a588f['query']=_['keys'](_0x3ec6d5[_0x8c16('0x2e')]);_0x5a588f['filters']=_['intersection'](_0x5a588f[_0x8c16('0x2d')],_0x5a588f['query']);_0x3886d6[_0x8c16('0x2f')]=_[_0x8c16('0x30')](_0x5a588f[_0x8c16('0x2d')],qs[_0x8c16('0x31')](_0x3ec6d5[_0x8c16('0x2e')][_0x8c16('0x31')]));_0x3886d6['attributes']=_0x3886d6[_0x8c16('0x2f')]['length']?_0x3886d6[_0x8c16('0x2f')]:_0x5a588f[_0x8c16('0x2d')];if(!_0x3ec6d5[_0x8c16('0x2e')]['hasOwnProperty']('nolimit')){_0x3886d6[_0x8c16('0x1d')]=qs[_0x8c16('0x1d')](_0x3ec6d5[_0x8c16('0x2e')][_0x8c16('0x1d')]);_0x3886d6[_0x8c16('0x1c')]=qs[_0x8c16('0x1c')](_0x3ec6d5['query'][_0x8c16('0x1c')]);}_0x3886d6[_0x8c16('0x32')]=qs[_0x8c16('0x33')](_0x3ec6d5[_0x8c16('0x2e')][_0x8c16('0x33')]);_0x3886d6[_0x8c16('0x34')]=qs[_0x8c16('0x35')](_[_0x8c16('0x36')](_0x3ec6d5['query'],_0x5a588f[_0x8c16('0x35')]),_0x3d7e4d);if(_0x3ec6d5[_0x8c16('0x2e')][_0x8c16('0x37')]){_0x3886d6[_0x8c16('0x34')]=_[_0x8c16('0x38')](_0x3886d6[_0x8c16('0x34')],{'$or':_['map'](_0x3d7e4d,function(_0x86de55){if(_0x86de55[_0x8c16('0x2b')]!==_0x8c16('0x39')){var _0x1f1f03={};_0x1f1f03[_0x86de55['name']]={'$like':'%'+_0x3ec6d5[_0x8c16('0x2e')][_0x8c16('0x37')]+'%'};return _0x1f1f03;}})});}_0x3886d6=_[_0x8c16('0x38')]({},_0x3886d6,_0x3ec6d5[_0x8c16('0x3a')]);var _0x5161ff={'where':_0x3886d6[_0x8c16('0x34')]};return db['VoiceTransferReport'][_0x8c16('0x1b')](_0x5161ff)[_0x8c16('0x24')](function(_0x376baa){_0xf97bfc[_0x8c16('0x1b')]=_0x376baa;if(_0x3ec6d5['query'][_0x8c16('0x3b')]){_0x3886d6[_0x8c16('0x3c')]=[{'all':!![]}];}return db[_0x8c16('0x2a')][_0x8c16('0x3d')](_0x3886d6);})['then'](function(_0x4dda4f){_0xf97bfc[_0x8c16('0x3e')]=_0x4dda4f;return _0xf97bfc;})['then'](respondWithFilteredResult(_0x48be3f,_0x3886d6))[_0x8c16('0x3f')](handleError(_0x48be3f,null));};exports['show']=function(_0x430d5e,_0x397333){var _0x3f73f1={'raw':!![],'where':{'id':_0x430d5e[_0x8c16('0x40')]['id']}},_0x47a541={};_0x47a541[_0x8c16('0x2d')]=_[_0x8c16('0x41')](db[_0x8c16('0x2a')]['rawAttributes']);_0x47a541[_0x8c16('0x2e')]=_[_0x8c16('0x41')](_0x430d5e[_0x8c16('0x2e')]);_0x47a541['filters']=_['intersection'](_0x47a541['model'],_0x47a541['query']);_0x3f73f1[_0x8c16('0x2f')]=_[_0x8c16('0x30')](_0x47a541['model'],qs[_0x8c16('0x31')](_0x430d5e[_0x8c16('0x2e')][_0x8c16('0x31')]));_0x3f73f1[_0x8c16('0x2f')]=_0x3f73f1[_0x8c16('0x2f')]['length']?_0x3f73f1[_0x8c16('0x2f')]:_0x47a541[_0x8c16('0x2d')];if(_0x430d5e[_0x8c16('0x2e')][_0x8c16('0x3b')]){_0x3f73f1[_0x8c16('0x3c')]=[{'all':!![]}];}_0x3f73f1=_[_0x8c16('0x38')]({},_0x3f73f1,_0x430d5e[_0x8c16('0x3a')]);return db[_0x8c16('0x2a')][_0x8c16('0x42')](_0x3f73f1)[_0x8c16('0x24')](handleEntityNotFound(_0x397333,null))['then'](respondWithResult(_0x397333,null))[_0x8c16('0x3f')](handleError(_0x397333,null));};exports[_0x8c16('0x43')]=function(_0xac5589,_0x27764c){return db[_0x8c16('0x2a')][_0x8c16('0x43')](_0xac5589[_0x8c16('0x44')],{})[_0x8c16('0x24')](respondWithResult(_0x27764c,0xc9))['catch'](handleError(_0x27764c,null));};exports[_0x8c16('0x23')]=function(_0x52f0ae,_0x2c4f8){if(_0x52f0ae[_0x8c16('0x44')]['id']){delete _0x52f0ae[_0x8c16('0x44')]['id'];}return db['VoiceTransferReport'][_0x8c16('0x42')]({'where':{'id':_0x52f0ae[_0x8c16('0x40')]['id']}})[_0x8c16('0x24')](handleEntityNotFound(_0x2c4f8,null))['then'](saveUpdates(_0x52f0ae['body'],null))[_0x8c16('0x24')](respondWithResult(_0x2c4f8,null))[_0x8c16('0x3f')](handleError(_0x2c4f8,null));};exports[_0x8c16('0x25')]=function(_0x37d57e,_0x1aebb1){return db[_0x8c16('0x2a')][_0x8c16('0x42')]({'where':{'id':_0x37d57e[_0x8c16('0x40')]['id']}})[_0x8c16('0x24')](handleEntityNotFound(_0x1aebb1,null))[_0x8c16('0x24')](removeEntity(_0x1aebb1,null))[_0x8c16('0x3f')](handleError(_0x1aebb1,null));};exports[_0x8c16('0x45')]=function(_0x4f19ea,_0x53a38b){return db[_0x8c16('0x2a')]['describe']()[_0x8c16('0x24')](respondWithResult(_0x53a38b,null))[_0x8c16('0x3f')](handleError(_0x53a38b,null));}; \ No newline at end of file +var _0x396b=['catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','sendStatus','end','status','json','limit','undefined','count','offset','set','update','then','destroy','error','stack','name','send','index','VoiceTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows'];(function(_0x1b1fc9,_0x44cee2){var _0x45fc63=function(_0x42c82f){while(--_0x42c82f){_0x1b1fc9['push'](_0x1b1fc9['shift']());}};_0x45fc63(++_0x44cee2);}(_0x396b,0x19a));var _0xb396=function(_0x439b29,_0x21f296){_0x439b29=_0x439b29-0x0;var _0xf1bdd4=_0x396b[_0x439b29];return _0xf1bdd4;};'use strict';var emlformat=require(_0xb396('0x0'));var rimraf=require(_0xb396('0x1'));var zipdir=require(_0xb396('0x2'));var jsonpatch=require(_0xb396('0x3'));var rp=require('request-promise');var moment=require(_0xb396('0x4'));var BPromise=require(_0xb396('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb396('0x6'));var sox=require('sox');var csv=require(_0xb396('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb396('0x8'));var _=require('lodash');var squel=require(_0xb396('0x9'));var crypto=require('crypto');var jsforce=require(_0xb396('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb396('0x7'));var querystring=require(_0xb396('0xb'));var Papa=require(_0xb396('0xc'));var Redis=require(_0xb396('0xd'));var authService=require(_0xb396('0xe'));var qs=require(_0xb396('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb396('0x10'));var utils=require(_0xb396('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x354205,_0x5100bd){_0x5100bd=_0x5100bd||0xcc;return function(_0x2e7061){if(_0x2e7061){return _0x354205[_0xb396('0x12')](_0x5100bd);}return _0x354205['status'](_0x5100bd)[_0xb396('0x13')]();};}function respondWithResult(_0x2cad36,_0x456b23){_0x456b23=_0x456b23||0xc8;return function(_0x4e20a3){if(_0x4e20a3){return _0x2cad36[_0xb396('0x14')](_0x456b23)[_0xb396('0x15')](_0x4e20a3);}};}function respondWithFilteredResult(_0x4b37a1,_0x1c2a70){return function(_0x3ee47d){if(_0x3ee47d){var _0x5aa767=typeof _0x1c2a70['offset']==='undefined'&&typeof _0x1c2a70[_0xb396('0x16')]===_0xb396('0x17');var _0x249522=_0x3ee47d[_0xb396('0x18')];var _0x545b98=_0x5aa767?0x0:_0x1c2a70[_0xb396('0x19')];var _0x1b674a=_0x5aa767?_0x3ee47d[_0xb396('0x18')]:_0x1c2a70[_0xb396('0x19')]+_0x1c2a70[_0xb396('0x16')];var _0xef5ce;if(_0x1b674a>=_0x249522){_0x1b674a=_0x249522;_0xef5ce=0xc8;}else{_0xef5ce=0xce;}_0x4b37a1[_0xb396('0x14')](_0xef5ce);return _0x4b37a1[_0xb396('0x1a')]('Content-Range',_0x545b98+'-'+_0x1b674a+'/'+_0x249522)[_0xb396('0x15')](_0x3ee47d);}return null;};}function patchUpdates(_0x478a84){return function(_0x31ce81){try{jsonpatch['apply'](_0x31ce81,_0x478a84,!![]);}catch(_0x49a84a){return BPromise['reject'](_0x49a84a);}return _0x31ce81['save']();};}function saveUpdates(_0x242a0f,_0x1bb27f){return function(_0x3f2b3e){if(_0x3f2b3e){return _0x3f2b3e[_0xb396('0x1b')](_0x242a0f)[_0xb396('0x1c')](function(_0x14af5c){return _0x14af5c;});}return null;};}function removeEntity(_0x216fc1,_0x31d002){return function(_0x2878b0){if(_0x2878b0){return _0x2878b0[_0xb396('0x1d')]()[_0xb396('0x1c')](function(){_0x216fc1['status'](0xcc)[_0xb396('0x13')]();});}};}function handleEntityNotFound(_0x1ba51a,_0x25b4e7){return function(_0x1ffa0a){if(!_0x1ffa0a){_0x1ba51a[_0xb396('0x12')](0x194);}return _0x1ffa0a;};}function handleError(_0x5c1581,_0x237bd9){_0x237bd9=_0x237bd9||0x1f4;return function(_0x29c35a){logger[_0xb396('0x1e')](_0x29c35a[_0xb396('0x1f')]);if(_0x29c35a[_0xb396('0x20')]){delete _0x29c35a['name'];}_0x5c1581[_0xb396('0x14')](_0x237bd9)[_0xb396('0x21')](_0x29c35a);};}exports[_0xb396('0x22')]=function(_0x17b949,_0x275086){var _0x4a0007={},_0x317d73={},_0x4bae76={'count':0x0,'rows':[]};var _0x144f4f=_['map'](db[_0xb396('0x23')]['rawAttributes'],function(_0x3e82c3){return{'name':_0x3e82c3[_0xb396('0x24')],'type':_0x3e82c3[_0xb396('0x25')][_0xb396('0x26')]};});_0x317d73[_0xb396('0x27')]=_[_0xb396('0x28')](_0x144f4f,'name');_0x317d73[_0xb396('0x29')]=_[_0xb396('0x2a')](_0x17b949[_0xb396('0x29')]);_0x317d73[_0xb396('0x2b')]=_[_0xb396('0x2c')](_0x317d73['model'],_0x317d73[_0xb396('0x29')]);_0x4a0007[_0xb396('0x2d')]=_['intersection'](_0x317d73['model'],qs[_0xb396('0x2e')](_0x17b949[_0xb396('0x29')]['fields']));_0x4a0007[_0xb396('0x2d')]=_0x4a0007[_0xb396('0x2d')]['length']?_0x4a0007['attributes']:_0x317d73['model'];if(!_0x17b949[_0xb396('0x29')][_0xb396('0x2f')](_0xb396('0x30'))){_0x4a0007[_0xb396('0x16')]=qs[_0xb396('0x16')](_0x17b949['query'][_0xb396('0x16')]);_0x4a0007['offset']=qs[_0xb396('0x19')](_0x17b949[_0xb396('0x29')][_0xb396('0x19')]);}_0x4a0007[_0xb396('0x31')]=qs[_0xb396('0x32')](_0x17b949['query']['sort']);_0x4a0007[_0xb396('0x33')]=qs[_0xb396('0x2b')](_[_0xb396('0x34')](_0x17b949[_0xb396('0x29')],_0x317d73[_0xb396('0x2b')]),_0x144f4f);if(_0x17b949[_0xb396('0x29')]['filter']){_0x4a0007[_0xb396('0x33')]=_[_0xb396('0x35')](_0x4a0007['where'],{'$or':_['map'](_0x144f4f,function(_0x47640f){if(_0x47640f[_0xb396('0x25')]!=='VIRTUAL'){var _0xaf4d86={};_0xaf4d86[_0x47640f[_0xb396('0x20')]]={'$like':'%'+_0x17b949[_0xb396('0x29')][_0xb396('0x36')]+'%'};return _0xaf4d86;}})});}_0x4a0007=_[_0xb396('0x35')]({},_0x4a0007,_0x17b949[_0xb396('0x37')]);var _0x4bfaf0={'where':_0x4a0007[_0xb396('0x33')]};return db[_0xb396('0x23')][_0xb396('0x18')](_0x4bfaf0)[_0xb396('0x1c')](function(_0x39128b){_0x4bae76['count']=_0x39128b;if(_0x17b949[_0xb396('0x29')]['includeAll']){_0x4a0007[_0xb396('0x38')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xb396('0x39')](_0x4a0007);})[_0xb396('0x1c')](function(_0x1e9b95){_0x4bae76[_0xb396('0x3a')]=_0x1e9b95;return _0x4bae76;})['then'](respondWithFilteredResult(_0x275086,_0x4a0007))[_0xb396('0x3b')](handleError(_0x275086,null));};exports[_0xb396('0x3c')]=function(_0x22553d,_0x19c9de){var _0x5423e2={'raw':!![],'where':{'id':_0x22553d[_0xb396('0x3d')]['id']}},_0x3bc483={};_0x3bc483[_0xb396('0x27')]=_['keys'](db[_0xb396('0x23')]['rawAttributes']);_0x3bc483['query']=_[_0xb396('0x2a')](_0x22553d[_0xb396('0x29')]);_0x3bc483[_0xb396('0x2b')]=_['intersection'](_0x3bc483[_0xb396('0x27')],_0x3bc483['query']);_0x5423e2[_0xb396('0x2d')]=_['intersection'](_0x3bc483[_0xb396('0x27')],qs['fields'](_0x22553d[_0xb396('0x29')][_0xb396('0x2e')]));_0x5423e2[_0xb396('0x2d')]=_0x5423e2[_0xb396('0x2d')]['length']?_0x5423e2[_0xb396('0x2d')]:_0x3bc483[_0xb396('0x27')];if(_0x22553d['query'][_0xb396('0x3e')]){_0x5423e2[_0xb396('0x38')]=[{'all':!![]}];}_0x5423e2=_[_0xb396('0x35')]({},_0x5423e2,_0x22553d['options']);return db[_0xb396('0x23')][_0xb396('0x3f')](_0x5423e2)[_0xb396('0x1c')](handleEntityNotFound(_0x19c9de,null))['then'](respondWithResult(_0x19c9de,null))['catch'](handleError(_0x19c9de,null));};exports[_0xb396('0x40')]=function(_0x52642e,_0x5213a0){return db[_0xb396('0x23')][_0xb396('0x40')](_0x52642e[_0xb396('0x41')],{})['then'](respondWithResult(_0x5213a0,0xc9))[_0xb396('0x3b')](handleError(_0x5213a0,null));};exports['update']=function(_0x5a804a,_0x1fe59e){if(_0x5a804a['body']['id']){delete _0x5a804a['body']['id'];}return db[_0xb396('0x23')][_0xb396('0x3f')]({'where':{'id':_0x5a804a[_0xb396('0x3d')]['id']}})[_0xb396('0x1c')](handleEntityNotFound(_0x1fe59e,null))[_0xb396('0x1c')](saveUpdates(_0x5a804a['body'],null))[_0xb396('0x1c')](respondWithResult(_0x1fe59e,null))['catch'](handleError(_0x1fe59e,null));};exports[_0xb396('0x1d')]=function(_0x23ce9a,_0x50fbf4){return db[_0xb396('0x23')]['find']({'where':{'id':_0x23ce9a[_0xb396('0x3d')]['id']}})[_0xb396('0x1c')](handleEntityNotFound(_0x50fbf4,null))[_0xb396('0x1c')](removeEntity(_0x50fbf4,null))[_0xb396('0x3b')](handleError(_0x50fbf4,null));};exports[_0xb396('0x42')]=function(_0x168cc7,_0x3d56be){return db[_0xb396('0x23')][_0xb396('0x42')]()[_0xb396('0x1c')](respondWithResult(_0x3d56be,null))[_0xb396('0x3b')](handleError(_0x3d56be,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 27b36f1..e4cbdb6 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 _0xaeff=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x58fad2,_0xb39887){var _0x49f947=function(_0x1b22c2){while(--_0x1b22c2){_0x58fad2['push'](_0x58fad2['shift']());}};_0x49f947(++_0xb39887);}(_0xaeff,0x15a));var _0xfaef=function(_0x38bced,_0x326a00){_0x38bced=_0x38bced-0x0;var _0x4a74fa=_0xaeff[_0x38bced];return _0x4a74fa;};'use strict';var _=require(_0xfaef('0x0'));var util=require(_0xfaef('0x1'));var logger=require(_0xfaef('0x2'))(_0xfaef('0x3'));var moment=require(_0xfaef('0x4'));var BPromise=require(_0xfaef('0x5'));var rp=require(_0xfaef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfaef('0x7'));var attributes=require(_0xfaef('0x8'));module['exports']=function(_0x5d7949,_0x5ada23){return _0x5d7949[_0xfaef('0x9')](_0xfaef('0xa'),attributes,{'tableName':_0xfaef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11d5=['path','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8efa6d,_0x51a861){var _0x3ce69a=function(_0x2bd97d){while(--_0x2bd97d){_0x8efa6d['push'](_0x8efa6d['shift']());}};_0x3ce69a(++_0x51a861);}(_0x11d5,0xde));var _0x511d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x11d5[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0x511d('0x0'));var logger=require(_0x511d('0x1'))(_0x511d('0x2'));var moment=require(_0x511d('0x3'));var BPromise=require(_0x511d('0x4'));var rp=require(_0x511d('0x5'));var fs=require('fs');var path=require(_0x511d('0x6'));var rimraf=require(_0x511d('0x7'));var config=require('../../config/environment');var attributes=require(_0x511d('0x8'));module[_0x511d('0x9')]=function(_0x476b24,_0x208e70){return _0x476b24[_0x511d('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x511d('0xb'),'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 d0d75d2..3cea728 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 _0xbb7f=['code','error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1aab33,_0x327f92){var _0x4bf0df=function(_0x278ffa){while(--_0x278ffa){_0x1aab33['push'](_0x1aab33['shift']());}};_0x4bf0df(++_0x327f92);}(_0xbb7f,0x142));var _0xfbb7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbb7f[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfbb7('0x0'));var util=require(_0xfbb7('0x1'));var moment=require(_0xfbb7('0x2'));var BPromise=require(_0xfbb7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbb7('0x4'));var logger=require(_0xfbb7('0x5'))(_0xfbb7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfbb7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d984d,_0x5b2322,_0x1cae93){return new BPromise(function(_0x4743f3,_0x4641f9){return client[_0xfbb7('0x8')](_0x4d984d,_0x1cae93)[_0xfbb7('0x9')](function(_0x2850c6){logger[_0xfbb7('0xa')](_0xfbb7('0xb'),_0x5b2322,_0xfbb7('0xc'));logger[_0xfbb7('0xd')](_0xfbb7('0xe'),_0x5b2322,_0xfbb7('0xc'),JSON[_0xfbb7('0xf')](_0x2850c6));if(_0x2850c6['error']){if(_0x2850c6['error'][_0xfbb7('0x10')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x5b2322,_0x2850c6[_0xfbb7('0x11')][_0xfbb7('0x12')]);return _0x4641f9(_0x2850c6[_0xfbb7('0x11')][_0xfbb7('0x12')]);}logger[_0xfbb7('0x11')](_0xfbb7('0xb'),_0x5b2322,_0x2850c6[_0xfbb7('0x11')]['message']);return _0x4743f3(_0x2850c6[_0xfbb7('0x11')][_0xfbb7('0x12')]);}else{logger[_0xfbb7('0xa')](_0xfbb7('0xb'),_0x5b2322,_0xfbb7('0xc'));_0x4743f3(_0x2850c6['result'][_0xfbb7('0x12')]);}})[_0xfbb7('0x13')](function(_0x49ecb8){logger[_0xfbb7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x5b2322,_0x49ecb8);_0x4641f9(_0x49ecb8);});});}exports[_0xfbb7('0x14')]=function(_0x4e203f){var _0x203ef4=this;return new Promise(function(_0x2d2c2,_0x36fa96){return db[_0xfbb7('0x15')][_0xfbb7('0x16')](_0x4e203f[_0xfbb7('0x17')],{'raw':_0x4e203f[_0xfbb7('0x18')]?_0x4e203f[_0xfbb7('0x18')][_0xfbb7('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1cc645){logger[_0xfbb7('0xa')](_0xfbb7('0x14'),_0x4e203f);logger[_0xfbb7('0xd')](_0xfbb7('0x14'),_0x4e203f,JSON[_0xfbb7('0xf')](_0x1cc645));_0x2d2c2(_0x1cc645);})[_0xfbb7('0x13')](function(_0x4d9920){logger[_0xfbb7('0x11')](_0xfbb7('0x14'),_0x4d9920[_0xfbb7('0x12')],_0x4e203f);_0x36fa96(_0x203ef4[_0xfbb7('0x11')](0x1f4,_0x4d9920[_0xfbb7('0x12')]));});});}; \ No newline at end of file +var _0x55d6=['body','options','raw','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport'];(function(_0xf2931a,_0x2d490b){var _0x45c15d=function(_0x1ef510){while(--_0x1ef510){_0xf2931a['push'](_0xf2931a['shift']());}};_0x45c15d(++_0x2d490b);}(_0x55d6,0x1ce));var _0x655d=function(_0x1c3266,_0x2da6bf){_0x1c3266=_0x1c3266-0x0;var _0x58cbbb=_0x55d6[_0x1c3266];return _0x58cbbb;};'use strict';var _=require('lodash');var util=require(_0x655d('0x0'));var moment=require(_0x655d('0x1'));var BPromise=require(_0x655d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x655d('0x3'))['db'];var utils=require(_0x655d('0x4'));var logger=require(_0x655d('0x5'))('rpc');var config=require(_0x655d('0x6'));var jayson=require(_0x655d('0x7'));var client=jayson[_0x655d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16cafa,_0x1442a0,_0x1db4d3){return new BPromise(function(_0x5db60a,_0x2ea03f){return client[_0x655d('0x9')](_0x16cafa,_0x1db4d3)[_0x655d('0xa')](function(_0x3ff8c1){logger[_0x655d('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x1442a0,'request\x20sent');logger[_0x655d('0xc')](_0x655d('0xd'),_0x1442a0,_0x655d('0xe'),JSON[_0x655d('0xf')](_0x3ff8c1));if(_0x3ff8c1[_0x655d('0x10')]){if(_0x3ff8c1['error'][_0x655d('0x11')]===0x1f4){logger[_0x655d('0x10')](_0x655d('0x12'),_0x1442a0,_0x3ff8c1[_0x655d('0x10')][_0x655d('0x13')]);return _0x2ea03f(_0x3ff8c1[_0x655d('0x10')][_0x655d('0x13')]);}logger[_0x655d('0x10')](_0x655d('0x12'),_0x1442a0,_0x3ff8c1[_0x655d('0x10')][_0x655d('0x13')]);return _0x5db60a(_0x3ff8c1[_0x655d('0x10')][_0x655d('0x13')]);}else{logger[_0x655d('0xb')](_0x655d('0x12'),_0x1442a0,'request\x20sent');_0x5db60a(_0x3ff8c1[_0x655d('0x14')][_0x655d('0x13')]);}})[_0x655d('0x15')](function(_0x18769e){logger[_0x655d('0x10')](_0x655d('0x12'),_0x1442a0,_0x18769e);_0x2ea03f(_0x18769e);});});}exports[_0x655d('0x16')]=function(_0x329abe){var _0x195279=this;return new Promise(function(_0x5aed2a,_0x2510d0){return db[_0x655d('0x17')]['create'](_0x329abe[_0x655d('0x18')],{'raw':_0x329abe[_0x655d('0x19')]?_0x329abe[_0x655d('0x19')][_0x655d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x29d165){logger['info'](_0x655d('0x16'),_0x329abe);logger[_0x655d('0xc')]('CreateVoiceTransferReport',_0x329abe,JSON[_0x655d('0xf')](_0x29d165));_0x5aed2a(_0x29d165);})[_0x655d('0x15')](function(_0x12c017){logger[_0x655d('0x10')](_0x655d('0x16'),_0x12c017[_0x655d('0x13')],_0x329abe);_0x2510d0(_0x195279['error'](0x1f4,_0x12c017['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 9eb0a06..d371388 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 _0x70e0=['unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','answer','post','/hold','/unhold'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x70e0,0x17b));var _0x070e=function(_0x3e20d2,_0x889352){_0x3e20d2=_0x3e20d2-0x0;var _0x593b11=_0x70e0[_0x3e20d2];return _0x593b11;};'use strict';var express=require(_0x070e('0x0'));var router=express[_0x070e('0x1')]();var auth=require(_0x070e('0x2'));var controller=require('./webbar.controller');router['post'](_0x070e('0x3'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x6')]);router['post'](_0x070e('0x7'),auth['isAuthenticated'](),auth[_0x070e('0x5')](),controller['hangup']);router['post']('/answer',auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0x8')]);router[_0x070e('0x9')](_0x070e('0xa'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller['hold']);router['post'](_0x070e('0xb'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xc')]);router[_0x070e('0x9')](_0x070e('0xd'),auth[_0x070e('0x4')](),auth[_0x070e('0x5')](),controller[_0x070e('0xe')]);router[_0x070e('0x9')](_0x070e('0xf'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x070e('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3969f4,_0x429032){_0x3969f4=_0x3969f4-0x0;var _0x308caa=_0xb43b[_0x3969f4];return _0x308caa;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);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 0bd6f28..87edb0f 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 _0xe739=['info','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','entityFound:','webbar:hangup','hangup\x20executed!','catch','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','handleError:','error','stack','name','status','send','request','code','message','result','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','sessionId\x20','\x20not\x20found!'];(function(_0x56046c,_0x48f853){var _0xfa490d=function(_0x593cf5){while(--_0x593cf5){_0x56046c['push'](_0x56046c['shift']());}};_0xfa490d(++_0x48f853);}(_0xe739,0x105));var _0x9e73=function(_0x3af981,_0x28a5e4){_0x3af981=_0x3af981-0x0;var _0x759e00=_0xe739[_0x3af981];return _0x759e00;};'use strict';var path=require(_0x9e73('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x9e73('0x1'))['db'];var config=require(_0x9e73('0x2'));var util=require(_0x9e73('0x3'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x9e73('0x4')]({'port':0x232a});var logger=require(_0x9e73('0x5'))(_0x9e73('0x6'));var Redis=require(_0x9e73('0x7'));config['redis']=_[_0x9e73('0x8')](config[_0x9e73('0x9')],{'host':_0x9e73('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e73('0x9')]));var Schema=require(_0x9e73('0xb'));var originateValidation=new Schema({'userId':{'type':_0x9e73('0xc'),'required':[!![],_0x9e73('0xd')]},'callNumber':{'type':_0x9e73('0xe'),'required':[!![],_0x9e73('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x9e73('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9e73('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9e73('0xd')]},'sessionId':{'type':_0x9e73('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9e73('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9e73('0xe'),'required':[!![],_0x9e73('0x10')]},'transferNumber':{'type':_0x9e73('0xe'),'required':[!![],_0x9e73('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9e73('0xd')]},'sessionId':{'type':_0x9e73('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9e73('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9e73('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x9e73('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x9e73('0xc'),'required':[!![],_0x9e73('0xd')]}});function emit(_0x21bd3a,_0x5633e1,_0x16b2a9){logger['info'](_0x21bd3a,_0x5633e1,JSON[_0x9e73('0x12')](_0x16b2a9));io['to'](_0x21bd3a)['emit'](_0x5633e1,_0x16b2a9);}function handleError(_0x194eb9){return function(_0x48b1db){console['log'](_0x9e73('0x13'),_0x48b1db,_0x48b1db instanceof RangeError);logger[_0x9e73('0x14')](_0x48b1db[_0x9e73('0x15')]);if(_0x48b1db instanceof RangeError){if(_0x48b1db[_0x9e73('0x16')]){delete _0x48b1db[_0x9e73('0x16')];}_0x194eb9[_0x9e73('0x17')](0x194)[_0x9e73('0x18')](_0x48b1db);}else{if(_0x48b1db[_0x9e73('0x16')]){delete _0x48b1db[_0x9e73('0x16')];}_0x194eb9[_0x9e73('0x17')](0x1f4)['send'](_0x48b1db);}};}function checkError(){return function(_0x3954c0){if(!_0x3954c0){throw new RangeError('NotFound');}return _0x3954c0;};}function respondWithRpcPromise(_0xd3290d,_0x5875c5){return new BPromise(function(_0x31d354,_0x589a5d){var _0x2c2b32=amiClient;return _0x2c2b32[_0x9e73('0x19')](_0xd3290d,_0x5875c5)['then'](function(_0x55704a){if(_0x55704a[_0x9e73('0x14')]){if(_0x55704a[_0x9e73('0x14')][_0x9e73('0x1a')]===0x1f4){return _0x589a5d(_0x55704a[_0x9e73('0x14')][_0x9e73('0x1b')]);}return _0x31d354(_0x55704a['error'][_0x9e73('0x1b')]);}else{_0x31d354(_0x55704a[_0x9e73('0x1c')]);}})['catch'](function(_0x539560){_0x589a5d(_0x539560);});});}function getAgent(_0x28ff38){return db['User']['findOne']({'where':{'id':_0x28ff38,'role':_0x9e73('0x1d')}})[_0x9e73('0x1e')](checkError());}function getAgentCheckSession(_0x46991c,_0x47dcd2){return new BPromise(function(_0x368a70,_0x5fc1df){var _0x4e77bb=respondWithRpcPromise(_0x9e73('0x1f'));var _0x24532d=getAgent(_0x46991c);Promise[_0x9e73('0x20')]([_0x4e77bb,_0x24532d])[_0x9e73('0x1e')](function(_0x2363f6){var _0x511e35=_0x2363f6[0x0];var _0x312e08=_0x2363f6[0x1];var _0x49ec6b=_[_0x9e73('0x21')](_0x511e35[_0x9e73('0x22')],function(_0xb3ef4f){return _0xb3ef4f[_0x9e73('0x23')]==_0x312e08['id']&&_0xb3ef4f[_0x9e73('0x24')]==_0x47dcd2;});if(_0x49ec6b['length']==0x1){_0x368a70(_0x312e08);}else{_0x5fc1df(new RangeError(_0x9e73('0x25')+_0x47dcd2+_0x9e73('0x26')));}});});}exports['originate']=function(_0x4e5ab0,_0x296b93){logger[_0x9e73('0x27')](_0x9e73('0x28'),_0x4e5ab0[_0x9e73('0x29')]);var _0x38ec16=originateValidation[_0x9e73('0xb')](_0x4e5ab0['body']);if(_0x38ec16[_0x9e73('0x2a')]>0x0){return _0x296b93[_0x9e73('0x17')](0x190)[_0x9e73('0x2b')](_0x38ec16);}var _0xf63a46=_0x4e5ab0[_0x9e73('0x29')][_0x9e73('0x2c')];var _0x1c5dbf=_0x4e5ab0[_0x9e73('0x29')][_0x9e73('0x2d')];var _0x4339d6=_0x4e5ab0['body'][_0x9e73('0x2e')];var _0x2c2ebd=_0x4e5ab0[_0x9e73('0x29')][_0x9e73('0x2f')];return getAgent(_0xf63a46)['then'](function(_0x3d2608){logger[_0x9e73('0x27')]('entityFound:',_0x3d2608['name']);emit(util[_0x9e73('0x30')](_0x9e73('0x31'),_0x3d2608[_0x9e73('0x16')]),_0x9e73('0x32'),{'callNumber':_0x1c5dbf,'callerId':_0x4339d6,'callbackUrl':_0x2c2ebd});return _0x296b93[_0x9e73('0x17')](0xc8)[_0x9e73('0x2b')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x296b93));};exports['hangup']=function(_0xccd103,_0x369ecc){logger[_0x9e73('0x27')]('hangup\x20fired:',_0xccd103['body']);var _0x4b4e1b=hangupValidation[_0x9e73('0xb')](_0xccd103[_0x9e73('0x29')]);if(_0x4b4e1b[_0x9e73('0x2a')]>0x0){return _0x369ecc[_0x9e73('0x17')](0x190)['json'](_0x4b4e1b);}var _0x1992c3=_0xccd103[_0x9e73('0x29')][_0x9e73('0x2c')];var _0x395db3=_0xccd103[_0x9e73('0x29')][_0x9e73('0x24')];return getAgent(_0x1992c3)[_0x9e73('0x1e')](function(_0x3431a8){logger[_0x9e73('0x27')](_0x9e73('0x33'),_0x3431a8['name']);emit(util['format']('user:%s',_0x3431a8['name']),_0x9e73('0x34'),{'sessionId':_0x395db3});return _0x369ecc[_0x9e73('0x17')](0xc8)['json']({'error':![],'message':_0x9e73('0x35')});})[_0x9e73('0x36')](handleError(_0x369ecc));};exports['answer']=function(_0x4d4ed1,_0x5b231f){logger['info']('answer\x20fired:',_0x4d4ed1[_0x9e73('0x29')]);var _0x2a0166=answerValidation[_0x9e73('0xb')](_0x4d4ed1[_0x9e73('0x29')]);if(_0x2a0166['length']>0x0){return _0x5b231f['status'](0x190)[_0x9e73('0x2b')](_0x2a0166);}var _0x2ad38a=_0x4d4ed1[_0x9e73('0x29')][_0x9e73('0x2c')];var _0x3f348f=_0x4d4ed1[_0x9e73('0x29')]['sessionId'];return getAgent(_0x2ad38a)[_0x9e73('0x1e')](function(_0x9882c4){logger['info'](_0x9e73('0x33'),_0x9882c4[_0x9e73('0x16')]);emit(util['format'](_0x9e73('0x31'),_0x9882c4[_0x9e73('0x16')]),'webbar:answer',{'sessionId':_0x3f348f});return _0x5b231f[_0x9e73('0x17')](0xc8)[_0x9e73('0x2b')]({'error':![],'message':_0x9e73('0x37')});})[_0x9e73('0x36')](handleError(_0x5b231f));};exports[_0x9e73('0x38')]=function(_0x3933b5,_0x20c4cd){logger[_0x9e73('0x27')](_0x9e73('0x39'),_0x3933b5[_0x9e73('0x29')]);var _0x134be0=holdValidation[_0x9e73('0xb')](_0x3933b5[_0x9e73('0x29')]);if(_0x134be0[_0x9e73('0x2a')]>0x0){return _0x20c4cd[_0x9e73('0x17')](0x190)[_0x9e73('0x2b')](_0x134be0);}var _0x4e7891=_0x3933b5[_0x9e73('0x29')]['userId'];var _0x4e8c96=_0x3933b5[_0x9e73('0x29')][_0x9e73('0x24')];return getAgent(_0x4e7891)['then'](function(_0x4baaf7){logger[_0x9e73('0x27')](_0x9e73('0x33'),_0x4baaf7[_0x9e73('0x16')]);emit(util[_0x9e73('0x30')](_0x9e73('0x31'),_0x4baaf7[_0x9e73('0x16')]),_0x9e73('0x3a'),{'sessionId':_0x4e8c96});return _0x20c4cd[_0x9e73('0x17')](0xc8)[_0x9e73('0x2b')]({'error':![],'message':_0x9e73('0x3b')});})[_0x9e73('0x36')](handleError(_0x20c4cd));};exports[_0x9e73('0x3c')]=function(_0x230249,_0xe70028){logger['info'](_0x9e73('0x3d'),_0x230249[_0x9e73('0x29')]);var _0x1289f9=unholdValidation[_0x9e73('0xb')](_0x230249[_0x9e73('0x29')]);if(_0x1289f9[_0x9e73('0x2a')]>0x0){return _0xe70028[_0x9e73('0x17')](0x190)[_0x9e73('0x2b')](_0x1289f9);}var _0x4b67d4=_0x230249['body']['userId'];var _0xd78532=_0x230249['body'][_0x9e73('0x24')];return getAgent(_0x4b67d4)['then'](function(_0x3c9dcd){logger['info'](_0x9e73('0x33'),_0x3c9dcd[_0x9e73('0x16')]);emit(util[_0x9e73('0x30')](_0x9e73('0x31'),_0x3c9dcd[_0x9e73('0x16')]),_0x9e73('0x3e'),{'sessionId':_0xd78532});return _0xe70028[_0x9e73('0x17')](0xc8)['json']({'error':![],'message':_0x9e73('0x3f')});})['catch'](handleError(_0xe70028));};exports[_0x9e73('0x40')]=function(_0x39aa72,_0x29b3e1){logger['info'](_0x9e73('0x41'),_0x29b3e1[_0x9e73('0x29')]);var _0x50737d=callsValidation[_0x9e73('0xb')](_0x39aa72[_0x9e73('0x29')]);if(_0x50737d[_0x9e73('0x2a')]>0x0){return _0x29b3e1[_0x9e73('0x17')](0x190)[_0x9e73('0x2b')](_0x50737d);}var _0x5d7422=_0x39aa72[_0x9e73('0x29')][_0x9e73('0x2c')];var _0x5ed176=respondWithRpcPromise(_0x9e73('0x1f'));var _0x3b120d=getAgent(_0x5d7422);return Promise[_0x9e73('0x20')]([_0x5ed176,_0x3b120d])['then'](function(_0x1d1c05){var _0x353674=_0x1d1c05[0x0];var _0x5b2021=_0x1d1c05[0x1];var _0x1155d1=_[_0x9e73('0x21')](_0x353674[_0x9e73('0x22')],function(_0x15292f){return _0x15292f[_0x9e73('0x23')]==_0x5b2021['id'];});return _0x29b3e1[_0x9e73('0x17')](0xc8)[_0x9e73('0x2b')]({'count':_0x1155d1[_0x9e73('0x2a')],'rows':_0x1155d1});})[_0x9e73('0x36')](handleError(_0x29b3e1));};exports[_0x9e73('0x42')]=function(_0x22c2cd,_0x2783f0){logger['info'](_0x9e73('0x43'),_0x22c2cd[_0x9e73('0x29')]);var _0x3474d1=conferenceValidation['validate'](_0x22c2cd['body']);if(_0x3474d1[_0x9e73('0x2a')]>0x0){return _0x2783f0[_0x9e73('0x17')](0x190)[_0x9e73('0x2b')](_0x3474d1);}var _0x158b54=_0x22c2cd[_0x9e73('0x29')][_0x9e73('0x2c')];return getAgent(_0x158b54)[_0x9e73('0x1e')](function(_0x31ff2f){logger[_0x9e73('0x27')](_0x9e73('0x33'),_0x31ff2f[_0x9e73('0x16')]);emit(util[_0x9e73('0x30')]('user:%s',_0x31ff2f[_0x9e73('0x16')]),_0x9e73('0x44'));return _0x2783f0[_0x9e73('0x17')](0xc8)[_0x9e73('0x2b')]({'error':![],'message':_0x9e73('0x45')});})[_0x9e73('0x36')](handleError(_0x2783f0));};exports[_0x9e73('0x46')]=function(_0x2a15f0,_0x592593){logger['info'](_0x9e73('0x47'),_0x2a15f0['body']);var _0x598657=transferValidation[_0x9e73('0xb')](_0x2a15f0['body']);if(_0x598657[_0x9e73('0x2a')]>0x0){return _0x592593[_0x9e73('0x17')](0x190)[_0x9e73('0x2b')](_0x598657);}var _0xbb2b40=_0x2a15f0[_0x9e73('0x29')]['userId'];var _0x50fa6f=_0x2a15f0[_0x9e73('0x29')][_0x9e73('0x24')];var _0xa5a487=_0x2a15f0[_0x9e73('0x29')][_0x9e73('0x48')];return getAgent(_0xbb2b40)[_0x9e73('0x1e')](function(_0x2be436){logger[_0x9e73('0x27')](_0x9e73('0x33'),_0x2be436[_0x9e73('0x16')]);emit(util[_0x9e73('0x30')](_0x9e73('0x31'),_0x2be436['name']),_0x9e73('0x49'),{'sessionId':_0x50fa6f,'transferNumber':_0xa5a487});return _0x592593[_0x9e73('0x17')](0xc8)[_0x9e73('0x2b')]({'error':![],'message':_0x9e73('0x4a')});})[_0x9e73('0x36')](handleError(_0x592593));}; \ No newline at end of file +var _0x422f=['transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','name','status','send','request','error','code','message','result','catch','findOne','agent','then','all','filter','UserId','sessionId\x20','\x20not\x20found!','info','originate\x20fired:','body','length','json','userId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup\x20fired:','sessionId','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','rows','conference','conference\x20fired:'];(function(_0x399f9d,_0x5655e9){var _0x2e7b09=function(_0x1f2209){while(--_0x1f2209){_0x399f9d['push'](_0x399f9d['shift']());}};_0x2e7b09(++_0x5655e9);}(_0x422f,0x1c7));var _0xf422=function(_0x5a89e7,_0xb9c029){_0x5a89e7=_0x5a89e7-0x0;var _0x2d7767=_0x422f[_0x5a89e7];return _0x2d7767;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xf422('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xf422('0x1'));var util=require(_0xf422('0x2'));var BPromise=require('bluebird');var jayson=require(_0xf422('0x3'));var amiClient=jayson[_0xf422('0x4')][_0xf422('0x5')]({'port':0x232a});var logger=require(_0xf422('0x6'))(_0xf422('0x7'));var Redis=require(_0xf422('0x8'));config[_0xf422('0x9')]=_[_0xf422('0xa')](config[_0xf422('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf422('0xb'))(new Redis(config[_0xf422('0x9')]));var Schema=require(_0xf422('0xc'));var originateValidation=new Schema({'userId':{'type':_0xf422('0xd'),'required':[!![],_0xf422('0xe')]},'callNumber':{'type':'string','required':[!![],_0xf422('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xf422('0xd'),'required':[!![],_0xf422('0xe')]},'sessionId':{'type':_0xf422('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf422('0xd'),'required':[!![],_0xf422('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf422('0xd'),'required':[!![],_0xf422('0xe')]},'sessionId':{'type':'string','required':[!![],_0xf422('0x11')]},'transferNumber':{'type':_0xf422('0x10'),'required':[!![],_0xf422('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xf422('0xd'),'required':[!![],_0xf422('0xe')]},'sessionId':{'type':_0xf422('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf422('0xd'),'required':[!![],_0xf422('0xe')]},'sessionId':{'type':_0xf422('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf422('0xe')]}});function emit(_0x30b70a,_0x21a35d,_0xdf4434){logger['info'](_0x30b70a,_0x21a35d,JSON[_0xf422('0x13')](_0xdf4434));io['to'](_0x30b70a)[_0xf422('0x14')](_0x21a35d,_0xdf4434);}function handleError(_0x76e4b1){return function(_0x2ae133){console[_0xf422('0x15')](_0xf422('0x16'),_0x2ae133,_0x2ae133 instanceof RangeError);logger['error'](_0x2ae133['stack']);if(_0x2ae133 instanceof RangeError){if(_0x2ae133[_0xf422('0x17')]){delete _0x2ae133[_0xf422('0x17')];}_0x76e4b1[_0xf422('0x18')](0x194)['send'](_0x2ae133);}else{if(_0x2ae133[_0xf422('0x17')]){delete _0x2ae133['name'];}_0x76e4b1[_0xf422('0x18')](0x1f4)[_0xf422('0x19')](_0x2ae133);}};}function checkError(){return function(_0x36b7e7){if(!_0x36b7e7){throw new RangeError('NotFound');}return _0x36b7e7;};}function respondWithRpcPromise(_0xf2d06b,_0x3cdd93){return new BPromise(function(_0x511529,_0x4b80a0){var _0x268575=amiClient;return _0x268575[_0xf422('0x1a')](_0xf2d06b,_0x3cdd93)['then'](function(_0x25b6a5){if(_0x25b6a5['error']){if(_0x25b6a5[_0xf422('0x1b')][_0xf422('0x1c')]===0x1f4){return _0x4b80a0(_0x25b6a5[_0xf422('0x1b')][_0xf422('0x1d')]);}return _0x511529(_0x25b6a5[_0xf422('0x1b')][_0xf422('0x1d')]);}else{_0x511529(_0x25b6a5[_0xf422('0x1e')]);}})[_0xf422('0x1f')](function(_0x5dcab4){_0x4b80a0(_0x5dcab4);});});}function getAgent(_0x1125ce){return db['User'][_0xf422('0x20')]({'where':{'id':_0x1125ce,'role':_0xf422('0x21')}})[_0xf422('0x22')](checkError());}function getAgentCheckSession(_0x3d3fe4,_0xaa3e7e){return new BPromise(function(_0x31f439,_0x2d0053){var _0x4ebfe9=respondWithRpcPromise('VoiceChannels');var _0x35d1fa=getAgent(_0x3d3fe4);Promise[_0xf422('0x23')]([_0x4ebfe9,_0x35d1fa])[_0xf422('0x22')](function(_0x33ef63){var _0xefb99e=_0x33ef63[0x0];var _0x48e0c7=_0x33ef63[0x1];var _0x6d22f1=_[_0xf422('0x24')](_0xefb99e['rows'],function(_0x5f0186){return _0x5f0186[_0xf422('0x25')]==_0x48e0c7['id']&&_0x5f0186['sessionId']==_0xaa3e7e;});if(_0x6d22f1['length']==0x1){_0x31f439(_0x48e0c7);}else{_0x2d0053(new RangeError(_0xf422('0x26')+_0xaa3e7e+_0xf422('0x27')));}});});}exports['originate']=function(_0x261e29,_0x2f5b75){logger[_0xf422('0x28')](_0xf422('0x29'),_0x261e29[_0xf422('0x2a')]);var _0x4d8670=originateValidation[_0xf422('0xc')](_0x261e29['body']);if(_0x4d8670[_0xf422('0x2b')]>0x0){return _0x2f5b75[_0xf422('0x18')](0x190)[_0xf422('0x2c')](_0x4d8670);}var _0x1869a4=_0x261e29[_0xf422('0x2a')][_0xf422('0x2d')];var _0xbd95dd=_0x261e29['body']['callNumber'];var _0x2b35d2=_0x261e29[_0xf422('0x2a')]['callerId'];var _0x259bb2=_0x261e29[_0xf422('0x2a')][_0xf422('0x2e')];return getAgent(_0x1869a4)[_0xf422('0x22')](function(_0x12ddbf){logger[_0xf422('0x28')](_0xf422('0x2f'),_0x12ddbf[_0xf422('0x17')]);emit(util[_0xf422('0x30')](_0xf422('0x31'),_0x12ddbf[_0xf422('0x17')]),_0xf422('0x32'),{'callNumber':_0xbd95dd,'callerId':_0x2b35d2,'callbackUrl':_0x259bb2});return _0x2f5b75[_0xf422('0x18')](0xc8)[_0xf422('0x2c')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x2f5b75));};exports['hangup']=function(_0x2c9861,_0x2ae7e1){logger['info'](_0xf422('0x33'),_0x2c9861['body']);var _0x774834=hangupValidation[_0xf422('0xc')](_0x2c9861['body']);if(_0x774834[_0xf422('0x2b')]>0x0){return _0x2ae7e1[_0xf422('0x18')](0x190)[_0xf422('0x2c')](_0x774834);}var _0x511fc7=_0x2c9861[_0xf422('0x2a')]['userId'];var _0x567667=_0x2c9861['body'][_0xf422('0x34')];return getAgent(_0x511fc7)[_0xf422('0x22')](function(_0x2133a5){logger[_0xf422('0x28')](_0xf422('0x2f'),_0x2133a5[_0xf422('0x17')]);emit(util[_0xf422('0x30')](_0xf422('0x31'),_0x2133a5['name']),'webbar:hangup',{'sessionId':_0x567667});return _0x2ae7e1[_0xf422('0x18')](0xc8)[_0xf422('0x2c')]({'error':![],'message':_0xf422('0x35')});})[_0xf422('0x1f')](handleError(_0x2ae7e1));};exports[_0xf422('0x36')]=function(_0x35eac8,_0x56d615){logger[_0xf422('0x28')]('answer\x20fired:',_0x35eac8[_0xf422('0x2a')]);var _0x391e3c=answerValidation['validate'](_0x35eac8[_0xf422('0x2a')]);if(_0x391e3c[_0xf422('0x2b')]>0x0){return _0x56d615[_0xf422('0x18')](0x190)[_0xf422('0x2c')](_0x391e3c);}var _0x1658d0=_0x35eac8['body'][_0xf422('0x2d')];var _0x1e20a2=_0x35eac8[_0xf422('0x2a')][_0xf422('0x34')];return getAgent(_0x1658d0)[_0xf422('0x22')](function(_0x5ea94e){logger[_0xf422('0x28')](_0xf422('0x2f'),_0x5ea94e['name']);emit(util[_0xf422('0x30')]('user:%s',_0x5ea94e[_0xf422('0x17')]),_0xf422('0x37'),{'sessionId':_0x1e20a2});return _0x56d615[_0xf422('0x18')](0xc8)[_0xf422('0x2c')]({'error':![],'message':_0xf422('0x38')});})[_0xf422('0x1f')](handleError(_0x56d615));};exports[_0xf422('0x39')]=function(_0xd77d9,_0x2ad164){logger[_0xf422('0x28')](_0xf422('0x3a'),_0xd77d9[_0xf422('0x2a')]);var _0x154e72=holdValidation[_0xf422('0xc')](_0xd77d9[_0xf422('0x2a')]);if(_0x154e72['length']>0x0){return _0x2ad164['status'](0x190)[_0xf422('0x2c')](_0x154e72);}var _0x2c2ce9=_0xd77d9[_0xf422('0x2a')]['userId'];var _0x15967f=_0xd77d9[_0xf422('0x2a')][_0xf422('0x34')];return getAgent(_0x2c2ce9)[_0xf422('0x22')](function(_0x1f3a30){logger[_0xf422('0x28')](_0xf422('0x2f'),_0x1f3a30['name']);emit(util[_0xf422('0x30')]('user:%s',_0x1f3a30[_0xf422('0x17')]),_0xf422('0x3b'),{'sessionId':_0x15967f});return _0x2ad164['status'](0xc8)[_0xf422('0x2c')]({'error':![],'message':_0xf422('0x3c')});})[_0xf422('0x1f')](handleError(_0x2ad164));};exports[_0xf422('0x3d')]=function(_0x2df71a,_0x5c3cb8){logger['info'](_0xf422('0x3e'),_0x2df71a['body']);var _0x4429c6=unholdValidation[_0xf422('0xc')](_0x2df71a[_0xf422('0x2a')]);if(_0x4429c6[_0xf422('0x2b')]>0x0){return _0x5c3cb8['status'](0x190)['json'](_0x4429c6);}var _0x44448c=_0x2df71a[_0xf422('0x2a')][_0xf422('0x2d')];var _0xddcd6c=_0x2df71a[_0xf422('0x2a')][_0xf422('0x34')];return getAgent(_0x44448c)['then'](function(_0x315e79){logger['info'](_0xf422('0x2f'),_0x315e79[_0xf422('0x17')]);emit(util[_0xf422('0x30')](_0xf422('0x31'),_0x315e79['name']),'webbar:unhold',{'sessionId':_0xddcd6c});return _0x5c3cb8[_0xf422('0x18')](0xc8)[_0xf422('0x2c')]({'error':![],'message':_0xf422('0x3f')});})[_0xf422('0x1f')](handleError(_0x5c3cb8));};exports[_0xf422('0x40')]=function(_0x2ce919,_0x90f97f){logger['info'](_0xf422('0x41'),_0x90f97f[_0xf422('0x2a')]);var _0x19e687=callsValidation[_0xf422('0xc')](_0x2ce919[_0xf422('0x2a')]);if(_0x19e687[_0xf422('0x2b')]>0x0){return _0x90f97f[_0xf422('0x18')](0x190)[_0xf422('0x2c')](_0x19e687);}var _0x36f8ae=_0x2ce919[_0xf422('0x2a')]['userId'];var _0x4419e6=respondWithRpcPromise(_0xf422('0x42'));var _0x23ee77=getAgent(_0x36f8ae);return Promise[_0xf422('0x23')]([_0x4419e6,_0x23ee77])[_0xf422('0x22')](function(_0x5b14dd){var _0x235fff=_0x5b14dd[0x0];var _0x2b6a57=_0x5b14dd[0x1];var _0x4fa193=_[_0xf422('0x24')](_0x235fff[_0xf422('0x43')],function(_0x39fa95){return _0x39fa95[_0xf422('0x25')]==_0x2b6a57['id'];});return _0x90f97f[_0xf422('0x18')](0xc8)[_0xf422('0x2c')]({'count':_0x4fa193[_0xf422('0x2b')],'rows':_0x4fa193});})['catch'](handleError(_0x90f97f));};exports[_0xf422('0x44')]=function(_0x477a65,_0x462376){logger['info'](_0xf422('0x45'),_0x477a65[_0xf422('0x2a')]);var _0x3d9946=conferenceValidation[_0xf422('0xc')](_0x477a65[_0xf422('0x2a')]);if(_0x3d9946[_0xf422('0x2b')]>0x0){return _0x462376[_0xf422('0x18')](0x190)[_0xf422('0x2c')](_0x3d9946);}var _0x3f2095=_0x477a65[_0xf422('0x2a')][_0xf422('0x2d')];return getAgent(_0x3f2095)[_0xf422('0x22')](function(_0x28c6ac){logger[_0xf422('0x28')](_0xf422('0x2f'),_0x28c6ac[_0xf422('0x17')]);emit(util[_0xf422('0x30')](_0xf422('0x31'),_0x28c6ac[_0xf422('0x17')]),'webbar:conference');return _0x462376['status'](0xc8)[_0xf422('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0xf422('0x1f')](handleError(_0x462376));};exports[_0xf422('0x46')]=function(_0x416e40,_0x14904a){logger['info'](_0xf422('0x47'),_0x416e40[_0xf422('0x2a')]);var _0x2b1d8f=transferValidation['validate'](_0x416e40['body']);if(_0x2b1d8f[_0xf422('0x2b')]>0x0){return _0x14904a[_0xf422('0x18')](0x190)[_0xf422('0x2c')](_0x2b1d8f);}var _0x23d1b5=_0x416e40['body']['userId'];var _0x53f92e=_0x416e40[_0xf422('0x2a')][_0xf422('0x34')];var _0x3de5c5=_0x416e40[_0xf422('0x2a')][_0xf422('0x48')];return getAgent(_0x23d1b5)[_0xf422('0x22')](function(_0x3f165d){logger['info']('entityFound:',_0x3f165d['name']);emit(util[_0xf422('0x30')]('user:%s',_0x3f165d[_0xf422('0x17')]),_0xf422('0x49'),{'sessionId':_0x53f92e,'transferNumber':_0x3de5c5});return _0x14904a['status'](0xc8)[_0xf422('0x2c')]({'error':![],'message':_0xf422('0x4a')});})[_0xf422('0x1f')](handleError(_0x14904a));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 88e796a..d8d5d94 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 _0x5c3c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x41ff25,_0x3f19bf){var _0xe2246a=function(_0x5c8646){while(--_0x5c8646){_0x41ff25['push'](_0x41ff25['shift']());}};_0xe2246a(++_0x3f19bf);}(_0x5c3c,0x132));var _0xc5c3=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x5c3c[_0x45f951];return _0x24756c;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require(_0xc5c3('0x3'));var express=require('express');var router=express[_0xc5c3('0x4')]();var fs_extra=require(_0xc5c3('0x5'));var auth=require(_0xc5c3('0x6'));var interaction=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var controller=require(_0xc5c3('0x9'));router[_0xc5c3('0xa')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc5c3('0xd')]);router[_0xc5c3('0xa')]('/:id',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0xe')]);router['get'](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller['getDispositions']);router[_0xc5c3('0xa')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['getAnswers']);router[_0xc5c3('0xa')](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x12')]);router[_0xc5c3('0xa')](_0xc5c3('0x13'),auth['isAuthenticated'](),controller[_0xc5c3('0x14')]);router[_0xc5c3('0x15')]('/',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x16')]);router[_0xc5c3('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc5c3('0x17')]);router[_0xc5c3('0x15')](_0xc5c3('0x10'),auth[_0xc5c3('0xb')](),controller['addAnswer']);router['post'](_0xc5c3('0x11'),auth['isAuthenticated'](),controller[_0xc5c3('0x18')]);router[_0xc5c3('0x15')](_0xc5c3('0x13'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x19')]);router['post'](_0xc5c3('0x1a'),controller[_0xc5c3('0x1b')]);router[_0xc5c3('0x15')](_0xc5c3('0x1c'),auth['isAuthenticated'](),controller[_0xc5c3('0x1d')]);router[_0xc5c3('0x1e')](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x20')]);router['delete'](_0xc5c3('0x1f'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x21')]);router[_0xc5c3('0x22')](_0xc5c3('0xf'),auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x23')]);router['delete']('/:id/canned_answers',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x24')]);router['delete']('/:id/users',auth[_0xc5c3('0xb')](),controller[_0xc5c3('0x25')]);module[_0xc5c3('0x26')]=router; \ No newline at end of file +var _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x430c,0x1a1));var _0xc430=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x430c[_0x648163];return _0x199d4d;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 383f681..8d97405 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 _0xa79e=['randomstring','STRING','name','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x536869,_0x2128d8){var _0x2746f3=function(_0x4e1c83){while(--_0x4e1c83){_0x536869['push'](_0x536869['shift']());}};_0x2746f3(++_0x2128d8);}(_0xa79e,0xfe));var _0xea79=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xa79e[_0x41bdd4];return _0x5c03a6;};'use strict';var Sequelize=require(_0xea79('0x0'));var rs=require(_0xea79('0x1'));module['exports']={'name':{'type':Sequelize[_0xea79('0x2')],'unique':_0xea79('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xea79('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xea79('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xea79('0x2')]},'type':{'type':Sequelize[_0xea79('0x4')]('twilio',_0xea79('0x5'))},'accountSid':{'type':Sequelize[_0xea79('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xea79('0x6')],'defaultValue':function(){return _0xea79('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xea79('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xea79('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xea79('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xea79('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xea79('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xea79('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xea79('0xb'),'set':function(_0x1c1727){if(!_0x1c1727){this[_0xea79('0xc')](_0xea79('0xd'),null);}this[_0xea79('0xc')](_0xea79('0xe'),_0x1c1727);}},'description':{'type':Sequelize[_0xea79('0x2')]}}; \ No newline at end of file +var _0x0c32=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch'];(function(_0x46166e,_0x3ffa7e){var _0x3a5ab4=function(_0x2e220c){while(--_0x2e220c){_0x46166e['push'](_0x46166e['shift']());}};_0x3a5ab4(++_0x3ffa7e);}(_0x0c32,0xb8));var _0x20c3=function(_0x44e7a8,_0x222d08){_0x44e7a8=_0x44e7a8-0x0;var _0x1f34f7=_0x0c32[_0x44e7a8];return _0x1f34f7;};'use strict';var Sequelize=require(_0x20c3('0x0'));var rs=require(_0x20c3('0x1'));module[_0x20c3('0x2')]={'name':{'type':Sequelize[_0x20c3('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x20c3('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x20c3('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x20c3('0x3')],'defaultValue':function(){return rs[_0x20c3('0x4')]();}},'phone':{'type':Sequelize[_0x20c3('0x3')]},'type':{'type':Sequelize[_0x20c3('0x5')](_0x20c3('0x6'),_0x20c3('0x7'))},'accountSid':{'type':Sequelize[_0x20c3('0x3')]},'baseUrl':{'type':Sequelize[_0x20c3('0x3')]},'authToken':{'type':Sequelize[_0x20c3('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x20c3('0x8');}},'notificationSound':{'type':Sequelize[_0x20c3('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x20c3('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x20c3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x20c3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x20c3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x20c3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x20c3('0xa')],'comment':_0x20c3('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x20c3('0xc'),'set':function(_0x1e4332){if(!_0x1e4332){this[_0x20c3('0xd')](_0x20c3('0xe'),null);}this['setDataValue'](_0x20c3('0xf'),_0x1e4332);}},'description':{'type':Sequelize[_0x20c3('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 636f490..c43f29c 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 _0x69cf=['query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','Pause','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','find','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','params','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','hasOwnProperty','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','account','sinch','statuses','timestamp','message_id','applications','Applications','Sequelize','ValidationError','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','Body','MessageSid','from','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','list','omit','contact','WhatsappInteraction','interaction','autoclose','push','close','*,*,*,*','created','messageId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','redis','./whatsappAccount.socket','register','request\x20sent','debug','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','end','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','index','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','model'];(function(_0x568d89,_0x1dd223){var _0x333f61=function(_0x5af837){while(--_0x5af837){_0x568d89['push'](_0x568d89['shift']());}};_0x333f61(++_0x1dd223);}(_0x69cf,0x7c));var _0xf69c=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0x69cf[_0x5a26db];return _0x4619dd;};'use strict';var emlformat=require(_0xf69c('0x0'));var rimraf=require(_0xf69c('0x1'));var zipdir=require(_0xf69c('0x2'));var jsonpatch=require(_0xf69c('0x3'));var rp=require('request-promise');var moment=require(_0xf69c('0x4'));var BPromise=require(_0xf69c('0x5'));var Mustache=require(_0xf69c('0x6'));var util=require(_0xf69c('0x7'));var path=require(_0xf69c('0x8'));var sox=require(_0xf69c('0x9'));var csv=require('to-csv');var ejs=require(_0xf69c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf69c('0xb'));var crypto=require('crypto');var jsforce=require(_0xf69c('0xc'));var deskjs=require(_0xf69c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf69c('0xe'));var Papa=require(_0xf69c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf69c('0x10'));var as=require(_0xf69c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf69c('0x12'))('api');var utils=require(_0xf69c('0x13'));var config=require(_0xf69c('0x14'));var licenseUtil=require(_0xf69c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf69c('0x16')](config['redis'],{'host':_0xf69c('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf69c('0x18')]));require(_0xf69c('0x19'))[_0xf69c('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x183719,_0x574af4,_0x2169ab,_0x3f9ff1){return new BPromise(function(_0x4adb9c,_0x2309b5){var _0x55fe9b=_0x3f9ff1||client;return _0x55fe9b['request'](_0x183719,_0x2169ab)['then'](function(_0x1291eb){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x574af4,_0xf69c('0x1b'));logger[_0xf69c('0x1c')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x574af4,_0xf69c('0x1b'),JSON['stringify'](_0x1291eb));if(_0x1291eb['error']){if(_0x1291eb[_0xf69c('0x1d')][_0xf69c('0x1e')]===0x1f4){logger[_0xf69c('0x1d')](_0xf69c('0x1f'),_0x574af4,_0x1291eb[_0xf69c('0x1d')]['message']);return _0x2309b5(_0x1291eb['error']['message']);}logger[_0xf69c('0x1d')](_0xf69c('0x1f'),_0x574af4,_0x1291eb['error']['message']);return _0x4adb9c(_0x1291eb[_0xf69c('0x1d')][_0xf69c('0x20')]);}else{logger[_0xf69c('0x21')](_0xf69c('0x1f'),_0x574af4,_0xf69c('0x1b'));_0x4adb9c(_0x1291eb[_0xf69c('0x22')][_0xf69c('0x20')]);}})['catch'](function(_0x442afe){logger[_0xf69c('0x1d')](_0xf69c('0x1f'),_0x574af4,_0x442afe);_0x2309b5(_0x442afe);});});}function respondWithStatusCode(_0x1d8ca9,_0x13796c){_0x13796c=_0x13796c||0xcc;return function(_0x3d9d4f){if(_0x3d9d4f){return _0x1d8ca9['sendStatus'](_0x13796c);}return _0x1d8ca9['status'](_0x13796c)[_0xf69c('0x23')]();};}function respondWithResult(_0x41900c,_0x573d6d){_0x573d6d=_0x573d6d||0xc8;return function(_0x2212dd){if(_0x2212dd){return _0x41900c[_0xf69c('0x24')](_0x573d6d)[_0xf69c('0x25')](_0x2212dd);}};}function respondWithFilteredResult(_0x3cc48e,_0x9e57dd){return function(_0x6666c3){if(_0x6666c3){var _0x2703f8=typeof _0x9e57dd[_0xf69c('0x26')]===_0xf69c('0x27')&&typeof _0x9e57dd['limit']===_0xf69c('0x27');var _0x1b8bb8=_0x6666c3[_0xf69c('0x28')];var _0x290978=_0x2703f8?0x0:_0x9e57dd[_0xf69c('0x26')];var _0x400af4=_0x2703f8?_0x6666c3[_0xf69c('0x28')]:_0x9e57dd[_0xf69c('0x26')]+_0x9e57dd[_0xf69c('0x29')];var _0x138dd4;if(_0x400af4>=_0x1b8bb8){_0x400af4=_0x1b8bb8;_0x138dd4=0xc8;}else{_0x138dd4=0xce;}_0x3cc48e[_0xf69c('0x24')](_0x138dd4);return _0x3cc48e[_0xf69c('0x2a')](_0xf69c('0x2b'),_0x290978+'-'+_0x400af4+'/'+_0x1b8bb8)['json'](_0x6666c3);}return null;};}function patchUpdates(_0x59f665){return function(_0x55ec9c){try{jsonpatch['apply'](_0x55ec9c,_0x59f665,!![]);}catch(_0x908440){return BPromise['reject'](_0x908440);}return _0x55ec9c['save']();};}function saveUpdates(_0x5ac7fe,_0x4c5f93){return function(_0xdc437e){if(_0xdc437e){return _0xdc437e['update'](_0x5ac7fe)[_0xf69c('0x2c')](function(_0xca1e2f){return _0xca1e2f;});}return null;};}function removeEntity(_0x1e3147,_0x150216){return function(_0x5bc6ed){if(_0x5bc6ed){return _0x5bc6ed[_0xf69c('0x2d')]()[_0xf69c('0x2c')](function(){var _0x31ca05=_0x5bc6ed[_0xf69c('0x2e')]({'plain':!![]});var _0x1e5a25=_0xf69c('0x2f');return db[_0xf69c('0x30')]['destroy']({'where':{'type':_0x1e5a25,'resourceId':_0x31ca05['id']}})['then'](function(){return _0x5bc6ed;});})[_0xf69c('0x2c')](function(){_0x1e3147[_0xf69c('0x24')](0xcc)[_0xf69c('0x23')]();});}};}function handleEntityNotFound(_0x5f416f,_0x519a2f){return function(_0x47376f){if(!_0x47376f){_0x5f416f[_0xf69c('0x31')](0x194);}return _0x47376f;};}function handleError(_0x3d881f,_0x42178f){_0x42178f=_0x42178f||0x1f4;return function(_0x4ea7df){logger[_0xf69c('0x1d')](_0x4ea7df[_0xf69c('0x32')]);if(_0x4ea7df[_0xf69c('0x33')]){delete _0x4ea7df['name'];}_0x3d881f['status'](_0x42178f)['send'](_0x4ea7df);};}exports[_0xf69c('0x34')]=function(_0x3dc8ff,_0xcf658e){var _0x276b00={'include':[{'model':db['Pause'],'as':_0xf69c('0x35')}]},_0x12ab90={},_0x3a14d2={'count':0x0,'rows':[]};var _0x9d2d91=_[_0xf69c('0x36')](db[_0xf69c('0x37')]['rawAttributes'],function(_0x209d87){return{'name':_0x209d87[_0xf69c('0x38')],'type':_0x209d87[_0xf69c('0x39')]['key']};});_0x12ab90[_0xf69c('0x3a')]=_['map'](_0x9d2d91,_0xf69c('0x33'));_0x12ab90[_0xf69c('0x3b')]=_[_0xf69c('0x3c')](_0x3dc8ff[_0xf69c('0x3b')]);_0x12ab90[_0xf69c('0x3d')]=_[_0xf69c('0x3e')](_0x12ab90[_0xf69c('0x3a')],_0x12ab90['query']);_0x276b00[_0xf69c('0x3f')]=_[_0xf69c('0x3e')](_0x12ab90[_0xf69c('0x3a')],qs[_0xf69c('0x40')](_0x3dc8ff[_0xf69c('0x3b')]['fields']));_0x276b00[_0xf69c('0x3f')]=_0x276b00[_0xf69c('0x3f')]['length']?_0x276b00[_0xf69c('0x3f')]:_0x12ab90[_0xf69c('0x3a')];if(!_0x3dc8ff[_0xf69c('0x3b')]['hasOwnProperty']('nolimit')){_0x276b00[_0xf69c('0x29')]=qs['limit'](_0x3dc8ff[_0xf69c('0x3b')][_0xf69c('0x29')]);_0x276b00[_0xf69c('0x26')]=qs['offset'](_0x3dc8ff[_0xf69c('0x3b')][_0xf69c('0x26')]);}_0x276b00[_0xf69c('0x41')]=qs['sort'](_0x3dc8ff[_0xf69c('0x3b')][_0xf69c('0x42')]);_0x276b00[_0xf69c('0x43')]=qs[_0xf69c('0x3d')](_[_0xf69c('0x44')](_0x3dc8ff[_0xf69c('0x3b')],_0x12ab90['filters']),_0x9d2d91);if(_0x3dc8ff[_0xf69c('0x3b')][_0xf69c('0x45')]){_0x276b00['where']=_['merge'](_0x276b00['where'],{'$or':_[_0xf69c('0x36')](_0x9d2d91,function(_0x1d0163){if(_0x1d0163[_0xf69c('0x39')]!==_0xf69c('0x46')){var _0xf1872f={};_0xf1872f[_0x1d0163[_0xf69c('0x33')]]={'$like':'%'+_0x3dc8ff[_0xf69c('0x3b')][_0xf69c('0x45')]+'%'};return _0xf1872f;}})});}_0x276b00=_[_0xf69c('0x47')]({},_0x276b00,_0x3dc8ff[_0xf69c('0x48')]);var _0x1689f7={'where':_0x276b00[_0xf69c('0x43')]};return db['WhatsappAccount']['count'](_0x1689f7)[_0xf69c('0x2c')](function(_0x33b407){_0x3a14d2[_0xf69c('0x28')]=_0x33b407;if(_0x3dc8ff[_0xf69c('0x3b')][_0xf69c('0x49')]){_0x276b00[_0xf69c('0x4a')]=[{'all':!![]}];}return db[_0xf69c('0x37')]['findAll'](_0x276b00);})[_0xf69c('0x2c')](function(_0x103ccf){_0x3a14d2[_0xf69c('0x4b')]=_0x103ccf;return _0x3a14d2;})['then'](respondWithFilteredResult(_0xcf658e,_0x276b00))[_0xf69c('0x4c')](handleError(_0xcf658e,null));};exports[_0xf69c('0x4d')]=function(_0x84b173,_0x5e67cd){var _0x30651a={'raw':![],'where':{'id':_0x84b173['params']['id']},'include':[{'model':db[_0xf69c('0x4e')],'as':_0xf69c('0x35')}]},_0xa3289e={};_0xa3289e['model']=_[_0xf69c('0x3c')](db[_0xf69c('0x37')][_0xf69c('0x4f')]);_0xa3289e['query']=_[_0xf69c('0x3c')](_0x84b173['query']);_0xa3289e[_0xf69c('0x3d')]=_[_0xf69c('0x3e')](_0xa3289e[_0xf69c('0x3a')],_0xa3289e[_0xf69c('0x3b')]);_0x30651a[_0xf69c('0x3f')]=_['intersection'](_0xa3289e['model'],qs[_0xf69c('0x40')](_0x84b173[_0xf69c('0x3b')][_0xf69c('0x40')]));_0x30651a['attributes']=_0x30651a['attributes'][_0xf69c('0x50')]?_0x30651a[_0xf69c('0x3f')]:_0xa3289e[_0xf69c('0x3a')];if(_0x84b173[_0xf69c('0x3b')][_0xf69c('0x49')]){_0x30651a[_0xf69c('0x4a')]=[{'all':!![]}];}_0x30651a=_['merge']({},_0x30651a,_0x84b173[_0xf69c('0x48')]);return db[_0xf69c('0x37')]['find'](_0x30651a)[_0xf69c('0x2c')](handleEntityNotFound(_0x5e67cd,null))['then'](respondWithResult(_0x5e67cd,null))[_0xf69c('0x4c')](handleError(_0x5e67cd,null));};exports[_0xf69c('0x51')]=function(_0xa22b5f,_0x869ee6){return db[_0xf69c('0x37')][_0xf69c('0x51')](_0xa22b5f[_0xf69c('0x52')],{})['then'](function(_0x2602e1){var _0x266150=_0xa22b5f[_0xf69c('0x53')][_0xf69c('0x2e')]({'plain':!![]});if(!_0x266150)throw new Error(_0xf69c('0x54'));if(_0x266150[_0xf69c('0x55')]===_0xf69c('0x53')){var _0x234565=_0x2602e1[_0xf69c('0x2e')]({'plain':!![]});var _0x106dd1=_0xf69c('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x106dd1,'userProfileId':_0x266150[_0xf69c('0x56')]},'raw':!![]})[_0xf69c('0x2c')](function(_0x58ac7e){if(_0x58ac7e&&_0x58ac7e[_0xf69c('0x57')]===0x0){return db[_0xf69c('0x30')][_0xf69c('0x51')]({'name':_0x234565['name'],'resourceId':_0x234565['id'],'type':_0x58ac7e['name'],'sectionId':_0x58ac7e['id']},{})[_0xf69c('0x2c')](function(){return _0x2602e1;});}else{return _0x2602e1;}})['catch'](function(_0x43920d){logger[_0xf69c('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43920d);throw _0x43920d;});}return _0x2602e1;})[_0xf69c('0x2c')](respondWithResult(_0x869ee6,0xc9))['catch'](handleError(_0x869ee6,null));};exports[_0xf69c('0x58')]=function(_0xa3f82a,_0x3bc11e){if(_0xa3f82a[_0xf69c('0x52')]['id']){delete _0xa3f82a[_0xf69c('0x52')]['id'];}return db[_0xf69c('0x37')][_0xf69c('0x59')]({'where':{'id':_0xa3f82a['params']['id']},'include':[{'model':db[_0xf69c('0x4e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3bc11e,null))[_0xf69c('0x2c')](saveUpdates(_0xa3f82a['body'],null))['then'](respondWithResult(_0x3bc11e,null))['catch'](handleError(_0x3bc11e,null));};exports['destroy']=function(_0x325202,_0x4a2871){return db[_0xf69c('0x37')][_0xf69c('0x59')]({'where':{'id':_0x325202['params']['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x4a2871,null))['then'](removeEntity(_0x4a2871,null))['catch'](handleError(_0x4a2871,null));};exports[_0xf69c('0x5a')]=function(_0x4f9d4c,_0x10a158){return db[_0xf69c('0x37')][_0xf69c('0x5a')]()[_0xf69c('0x2c')](respondWithResult(_0x10a158,null))[_0xf69c('0x4c')](handleError(_0x10a158,null));};exports[_0xf69c('0x5b')]=function(_0x20fc21,_0x57e048,_0x46fff1){if(_0x20fc21[_0xf69c('0x52')]['id']){delete _0x20fc21[_0xf69c('0x52')]['id'];}return db[_0xf69c('0x37')]['find']({'where':{'id':_0x20fc21['params']['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x57e048,null))[_0xf69c('0x2c')](function(_0x131a9a){if(_0x131a9a){_0x20fc21[_0xf69c('0x52')][_0xf69c('0x5c')]=_0x131a9a['id'];return db[_0xf69c('0x5d')][_0xf69c('0x51')](_0x20fc21[_0xf69c('0x52')]);}})['then'](respondWithResult(_0x57e048,null))['catch'](handleError(_0x57e048,null));};exports[_0xf69c('0x5e')]=function(_0x5f0082,_0x26598b,_0x5e5a3d){var _0x599166={'raw':![],'where':{}};var _0x3bdb7b={};var _0x32825f={'count':0x0,'rows':[]};return db[_0xf69c('0x37')]['findOne']({'where':{'id':_0x5f0082[_0xf69c('0x5f')]['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x26598b,null))[_0xf69c('0x2c')](function(_0x36d194){if(_0x36d194){_0x3bdb7b[_0xf69c('0x3a')]=_[_0xf69c('0x3c')](db['Disposition']['rawAttributes']);_0x3bdb7b[_0xf69c('0x3b')]=_[_0xf69c('0x3c')](_0x5f0082['query']);_0x3bdb7b[_0xf69c('0x3d')]=_[_0xf69c('0x3e')](_0x3bdb7b[_0xf69c('0x3a')],_0x3bdb7b[_0xf69c('0x3b')]);_0x599166[_0xf69c('0x3f')]=_['intersection'](_0x3bdb7b[_0xf69c('0x3a')],qs[_0xf69c('0x40')](_0x5f0082[_0xf69c('0x3b')]['fields']));_0x599166['attributes']=_0x599166[_0xf69c('0x3f')][_0xf69c('0x50')]?_0x599166['attributes']:_0x3bdb7b[_0xf69c('0x3a')];if(!_0x5f0082[_0xf69c('0x3b')]['hasOwnProperty'](_0xf69c('0x60'))){_0x599166[_0xf69c('0x29')]=qs[_0xf69c('0x29')](_0x5f0082[_0xf69c('0x3b')][_0xf69c('0x29')]);_0x599166[_0xf69c('0x26')]=qs['offset'](_0x5f0082['query']['offset']);}_0x599166[_0xf69c('0x41')]=qs['sort'](_0x5f0082[_0xf69c('0x3b')][_0xf69c('0x42')]);_0x599166[_0xf69c('0x43')]=qs[_0xf69c('0x3d')](_[_0xf69c('0x44')](_0x5f0082[_0xf69c('0x3b')],_0x3bdb7b[_0xf69c('0x3d')]));_0x599166[_0xf69c('0x43')]['WhatsappAccountId']=_0x36d194['id'];if(_0x5f0082[_0xf69c('0x3b')][_0xf69c('0x45')]){_0x599166[_0xf69c('0x43')]=_[_0xf69c('0x47')](_0x599166[_0xf69c('0x43')],{'$or':_[_0xf69c('0x36')](_0x599166[_0xf69c('0x3f')],function(_0x508a93){var _0x4856be={};_0x4856be[_0x508a93]={'$like':'%'+_0x5f0082[_0xf69c('0x3b')][_0xf69c('0x45')]+'%'};return _0x4856be;})});}_0x599166=_[_0xf69c('0x47')]({},_0x599166,_0x5f0082[_0xf69c('0x48')]);return db[_0xf69c('0x5d')]['count']({'where':_0x599166[_0xf69c('0x43')]})[_0xf69c('0x2c')](function(_0x56fad8){_0x32825f['count']=_0x56fad8;if(_0x5f0082[_0xf69c('0x3b')]['includeAll']){_0x599166['include']=[{'all':!![]}];}return db[_0xf69c('0x5d')][_0xf69c('0x61')](_0x599166);})[_0xf69c('0x2c')](function(_0x141a15){_0x32825f[_0xf69c('0x4b')]=_0x141a15;return _0x32825f;});}})[_0xf69c('0x2c')](respondWithFilteredResult(_0x26598b,_0x599166))[_0xf69c('0x4c')](handleError(_0x26598b,null));};exports[_0xf69c('0x62')]=function(_0xcf4ca5,_0x2e4927,_0x4d346f){return db[_0xf69c('0x37')][_0xf69c('0x59')]({'where':{'id':_0xcf4ca5[_0xf69c('0x5f')]['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x2e4927,null))[_0xf69c('0x2c')](function(_0x251a10){if(_0x251a10){return _0x251a10[_0xf69c('0x62')](_0xcf4ca5[_0xf69c('0x3b')][_0xf69c('0x63')]);}})[_0xf69c('0x2c')](respondWithStatusCode(_0x2e4927,null))['catch'](handleError(_0x2e4927,null));};exports[_0xf69c('0x64')]=function(_0x2b0f90,_0x124e58,_0x24803f){if(_0x2b0f90['body']['id']){delete _0x2b0f90[_0xf69c('0x52')]['id'];}return db[_0xf69c('0x37')]['find']({'where':{'id':_0x2b0f90[_0xf69c('0x5f')]['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x124e58,null))[_0xf69c('0x2c')](function(_0x488f03){if(_0x488f03){_0x2b0f90[_0xf69c('0x52')][_0xf69c('0x5c')]=_0x488f03['id'];return db[_0xf69c('0x65')][_0xf69c('0x51')](_0x2b0f90['body']);}})[_0xf69c('0x2c')](respondWithResult(_0x124e58,null))[_0xf69c('0x4c')](handleError(_0x124e58,null));};exports[_0xf69c('0x66')]=function(_0x2378fe,_0x46517f,_0x561aca){var _0x386f58={'raw':![],'where':{}};var _0x1874be={};var _0x579ef7={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xf69c('0x67')]({'where':{'id':_0x2378fe[_0xf69c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x46517f,null))[_0xf69c('0x2c')](function(_0x4a2006){if(_0x4a2006){_0x1874be[_0xf69c('0x3a')]=_[_0xf69c('0x3c')](db['CannedAnswer'][_0xf69c('0x4f')]);_0x1874be[_0xf69c('0x3b')]=_['keys'](_0x2378fe['query']);_0x1874be[_0xf69c('0x3d')]=_[_0xf69c('0x3e')](_0x1874be[_0xf69c('0x3a')],_0x1874be[_0xf69c('0x3b')]);_0x386f58['attributes']=_[_0xf69c('0x3e')](_0x1874be['model'],qs['fields'](_0x2378fe[_0xf69c('0x3b')][_0xf69c('0x40')]));_0x386f58['attributes']=_0x386f58['attributes'][_0xf69c('0x50')]?_0x386f58[_0xf69c('0x3f')]:_0x1874be['model'];if(!_0x2378fe[_0xf69c('0x3b')]['hasOwnProperty']('nolimit')){_0x386f58[_0xf69c('0x29')]=qs[_0xf69c('0x29')](_0x2378fe['query'][_0xf69c('0x29')]);_0x386f58[_0xf69c('0x26')]=qs[_0xf69c('0x26')](_0x2378fe['query'][_0xf69c('0x26')]);}_0x386f58[_0xf69c('0x41')]=qs['sort'](_0x2378fe['query'][_0xf69c('0x42')]);_0x386f58[_0xf69c('0x43')]=qs[_0xf69c('0x3d')](_[_0xf69c('0x44')](_0x2378fe[_0xf69c('0x3b')],_0x1874be[_0xf69c('0x3d')]));_0x386f58[_0xf69c('0x43')][_0xf69c('0x5c')]=_0x4a2006['id'];if(_0x2378fe[_0xf69c('0x3b')]['filter']){_0x386f58[_0xf69c('0x43')]=_[_0xf69c('0x47')](_0x386f58[_0xf69c('0x43')],{'$or':_[_0xf69c('0x36')](_0x386f58[_0xf69c('0x3f')],function(_0x3111f8){var _0x27e112={};_0x27e112[_0x3111f8]={'$like':'%'+_0x2378fe[_0xf69c('0x3b')][_0xf69c('0x45')]+'%'};return _0x27e112;})});}_0x386f58=_[_0xf69c('0x47')]({},_0x386f58,_0x2378fe['options']);return db[_0xf69c('0x65')][_0xf69c('0x28')]({'where':_0x386f58[_0xf69c('0x43')]})[_0xf69c('0x2c')](function(_0x4bb755){_0x579ef7[_0xf69c('0x28')]=_0x4bb755;if(_0x2378fe[_0xf69c('0x3b')][_0xf69c('0x49')]){_0x386f58['include']=[{'all':!![]}];}return db[_0xf69c('0x65')][_0xf69c('0x61')](_0x386f58);})[_0xf69c('0x2c')](function(_0x575b2c){_0x579ef7[_0xf69c('0x4b')]=_0x575b2c;return _0x579ef7;});}})['then'](respondWithFilteredResult(_0x46517f,_0x386f58))[_0xf69c('0x4c')](handleError(_0x46517f,null));};exports['removeAnswers']=function(_0xcf3d69,_0x29c687,_0x4553e7){return db[_0xf69c('0x37')]['find']({'where':{'id':_0xcf3d69[_0xf69c('0x5f')]['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x29c687,null))['then'](function(_0xb79f52){if(_0xb79f52){return _0xb79f52[_0xf69c('0x68')](_0xcf3d69[_0xf69c('0x3b')][_0xf69c('0x63')]);}})['then'](respondWithStatusCode(_0x29c687,null))[_0xf69c('0x4c')](handleError(_0x29c687,null));};exports[_0xf69c('0x69')]=function(_0x2caf89,_0x2c09c0,_0x3db83a){return db[_0xf69c('0x37')][_0xf69c('0x59')]({'where':{'id':_0x2caf89['params']['id']}})['then'](handleEntityNotFound(_0x2c09c0,null))[_0xf69c('0x2c')](function(_0x39ad57){if(_0x39ad57){return _0x39ad57[_0xf69c('0x69')](_0x2caf89[_0xf69c('0x52')][_0xf69c('0x63')],_['omit'](_0x2caf89[_0xf69c('0x52')],[_0xf69c('0x63'),'id'])||{})[_0xf69c('0x6a')](function(_0x1a513c){for(var _0x39dec5=0x0;_0x39dec5<_0x2caf89[_0xf69c('0x52')][_0xf69c('0x63')][_0xf69c('0x50')];_0x39dec5+=0x1){socket[_0xf69c('0x6b')]('userWhatsappAccount:save',{'UserId':Number(_0x2caf89[_0xf69c('0x52')][_0xf69c('0x63')][_0x39dec5]),'WhatsappAccountId':Number(_0x2caf89[_0xf69c('0x5f')]['id'])});}return _0x1a513c;});}})[_0xf69c('0x2c')](respondWithResult(_0x2c09c0,null))['catch'](handleError(_0x2c09c0,null));};exports[_0xf69c('0x6c')]=function(_0x54574b,_0x1a0f33,_0x54d5f6){return db[_0xf69c('0x37')][_0xf69c('0x59')]({'where':{'id':_0x54574b[_0xf69c('0x5f')]['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x1a0f33,null))[_0xf69c('0x2c')](function(_0x51ce2f){if(_0x51ce2f){return _0x51ce2f[_0xf69c('0x6c')](_0x54574b[_0xf69c('0x3b')]['ids'])['then'](function(){if(_['isArray'](_0x54574b[_0xf69c('0x3b')][_0xf69c('0x63')])){for(var _0x1e7b10=0x0;_0x1e7b10<_0x54574b[_0xf69c('0x3b')]['ids'][_0xf69c('0x50')];_0x1e7b10+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x54574b[_0xf69c('0x3b')][_0xf69c('0x63')][_0x1e7b10]),'WhatsappAccountId':Number(_0x54574b[_0xf69c('0x5f')]['id'])});}}else{socket['emit'](_0xf69c('0x6d'),{'UserId':Number(_0x54574b[_0xf69c('0x3b')][_0xf69c('0x63')]),'WhatsappAccountId':Number(_0x54574b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1a0f33,null))[_0xf69c('0x4c')](handleError(_0x1a0f33,null));};exports[_0xf69c('0x6e')]=function(_0x2686df,_0x5917a4,_0x598418){var _0x26edd5={};var _0x219b09={};var _0x1ad101;var _0xfa5c1e;return db[_0xf69c('0x37')][_0xf69c('0x67')]({'where':{'id':_0x2686df[_0xf69c('0x5f')]['id']}})[_0xf69c('0x2c')](handleEntityNotFound(_0x5917a4,null))[_0xf69c('0x2c')](function(_0x4f86b0){if(_0x4f86b0){_0x1ad101=_0x4f86b0;_0x219b09[_0xf69c('0x3a')]=_['keys'](db[_0xf69c('0x6f')]['rawAttributes']);_0x219b09[_0xf69c('0x3b')]=_[_0xf69c('0x3c')](_0x2686df[_0xf69c('0x3b')]);_0x219b09[_0xf69c('0x3d')]=_['intersection'](_0x219b09[_0xf69c('0x3a')],_0x219b09[_0xf69c('0x3b')]);_0x26edd5[_0xf69c('0x3f')]=_[_0xf69c('0x3e')](_0x219b09[_0xf69c('0x3a')],qs[_0xf69c('0x40')](_0x2686df[_0xf69c('0x3b')][_0xf69c('0x40')]));_0x26edd5[_0xf69c('0x3f')]=_0x26edd5[_0xf69c('0x3f')][_0xf69c('0x50')]?_0x26edd5[_0xf69c('0x3f')]:_0x219b09[_0xf69c('0x3a')];_0x26edd5['order']=qs['sort'](_0x2686df['query'][_0xf69c('0x42')]);_0x26edd5[_0xf69c('0x43')]=qs[_0xf69c('0x3d')](_[_0xf69c('0x44')](_0x2686df[_0xf69c('0x3b')],_0x219b09[_0xf69c('0x3d')]));if(_0x2686df[_0xf69c('0x3b')][_0xf69c('0x45')]){_0x26edd5[_0xf69c('0x43')]=_['merge'](_0x26edd5['where'],{'$or':_[_0xf69c('0x36')](_0x26edd5[_0xf69c('0x3f')],function(_0x22bf8f){var _0x503724={};_0x503724[_0x22bf8f]={'$like':'%'+_0x2686df[_0xf69c('0x3b')][_0xf69c('0x45')]+'%'};return _0x503724;})});}_0x26edd5=_[_0xf69c('0x47')]({},_0x26edd5,_0x2686df[_0xf69c('0x48')]);return _0x1ad101[_0xf69c('0x6e')](_0x26edd5);}})[_0xf69c('0x2c')](function(_0x1ef9ea){if(_0x1ef9ea){_0xfa5c1e=_0x1ef9ea[_0xf69c('0x50')];if(!_0x2686df[_0xf69c('0x3b')][_0xf69c('0x70')]('nolimit')){_0x26edd5[_0xf69c('0x29')]=qs[_0xf69c('0x29')](_0x2686df[_0xf69c('0x3b')]['limit']);_0x26edd5['offset']=qs[_0xf69c('0x26')](_0x2686df[_0xf69c('0x3b')]['offset']);}return _0x1ad101[_0xf69c('0x6e')](_0x26edd5);}})[_0xf69c('0x2c')](function(_0x3789a5){if(_0x3789a5){return _0x3789a5?{'count':_0xfa5c1e,'rows':_0x3789a5}:null;}})[_0xf69c('0x2c')](respondWithResult(_0x5917a4,null))[_0xf69c('0x4c')](handleError(_0x5917a4,null));};exports['addApplications']=function(_0x3e93fe,_0x5584b3){var _0x5764d2=_0x3e93fe[_0xf69c('0x5f')]['id'];var _0x22e744=_0x3e93fe[_0xf69c('0x52')];var _0x175547=0xc8;var _0x1bad38=null;return db[_0xf69c('0x71')]['transaction']({'isolationLevel':db[_0xf69c('0x71')][_0xf69c('0x72')][_0xf69c('0x73')]['READ_COMMITTED']},function(_0xeeae4d){return db[_0xf69c('0x37')][_0xf69c('0x67')]({'where':{'id':_0x5764d2},'transaction':_0xeeae4d})['then'](function(_0x4dfaba){if(_0x4dfaba){return db[_0xf69c('0x74')][_0xf69c('0x2d')]({'where':{'WhatsappAccountId':_0x5764d2},'transaction':_0xeeae4d})[_0xf69c('0x2c')](function(){var _0x84f2f8=_['map'](_0x22e744,function(_0x1f97e0){_0x1f97e0[_0xf69c('0x5c')]=_0x5764d2;return _0x1f97e0;});return db[_0xf69c('0x74')]['bulkCreate'](_0x84f2f8,{'transaction':_0xeeae4d});});}else{_0x175547=0x194;_0x1bad38=[];}});})[_0xf69c('0x2c')](function(){if(_0x175547!==0x194){return db['WhatsappApplication'][_0xf69c('0x75')]({'where':{'WhatsappAccountId':_0x5764d2},'order':_0xf69c('0x76')})[_0xf69c('0x2c')](function(_0x2d05c1){_0x1bad38=_0x2d05c1;});}})['catch'](function(_0x509d43){_0x175547=0x1f4;logger[_0xf69c('0x1d')](_0x509d43[_0xf69c('0x32')]);if(_0x509d43['name']){delete _0x509d43[_0xf69c('0x33')];}_0x1bad38=_0x509d43;})[_0xf69c('0x77')](function(){if(_0x1bad38===null){_0x5584b3[_0xf69c('0x31')](_0x175547);}else{if(_0x175547===0x1f4){_0x5584b3['status'](_0x175547)[_0xf69c('0x78')](_0x1bad38);}else{_0x5584b3['status'](_0x175547)['json'](_0x1bad38);}}});};exports[_0xf69c('0x79')]=function(_0x1e2b73,_0x35430b,_0x501b49){var _0x1a4919={};var _0x5bb8b4={};var _0x18303b;var _0x25b22e;return db['WhatsappAccount'][_0xf69c('0x67')]({'where':{'id':_0x1e2b73[_0xf69c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x35430b,null))[_0xf69c('0x2c')](function(_0x1a7257){if(_0x1a7257){_0x18303b=_0x1a7257;_0x5bb8b4[_0xf69c('0x3a')]=_['keys'](db[_0xf69c('0x74')][_0xf69c('0x4f')]);_0x5bb8b4[_0xf69c('0x3b')]=_['keys'](_0x1e2b73[_0xf69c('0x3b')]);_0x5bb8b4[_0xf69c('0x3d')]=_[_0xf69c('0x3e')](_0x5bb8b4[_0xf69c('0x3a')],_0x5bb8b4[_0xf69c('0x3b')]);_0x1a4919['attributes']=_['intersection'](_0x5bb8b4['model'],qs[_0xf69c('0x40')](_0x1e2b73[_0xf69c('0x3b')][_0xf69c('0x40')]));_0x1a4919[_0xf69c('0x3f')]=_0x1a4919[_0xf69c('0x3f')]['length']?_0x1a4919[_0xf69c('0x3f')]:_0x5bb8b4[_0xf69c('0x3a')];_0x1a4919[_0xf69c('0x41')]=qs[_0xf69c('0x42')](_0x1e2b73['query'][_0xf69c('0x42')]);_0x1a4919['where']=qs[_0xf69c('0x3d')](_[_0xf69c('0x44')](_0x1e2b73['query'],_0x5bb8b4[_0xf69c('0x3d')]));if(_0x1e2b73['query'][_0xf69c('0x45')]){_0x1a4919['where']=_[_0xf69c('0x47')](_0x1a4919['where'],{'$or':_[_0xf69c('0x36')](_0x1a4919[_0xf69c('0x3f')],function(_0x2688a3){var _0x1b0639={};_0x1b0639[_0x2688a3]={'$like':'%'+_0x1e2b73[_0xf69c('0x3b')][_0xf69c('0x45')]+'%'};return _0x1b0639;})});}_0x1a4919=_[_0xf69c('0x47')]({},_0x1a4919,_0x1e2b73[_0xf69c('0x48')]);return _0x18303b[_0xf69c('0x79')](_0x1a4919);}})[_0xf69c('0x2c')](function(_0x2c69be){if(_0x2c69be){_0x25b22e=_0x2c69be[_0xf69c('0x50')];if(!_0x1e2b73['query']['hasOwnProperty'](_0xf69c('0x60'))){_0x1a4919['limit']=qs[_0xf69c('0x29')](_0x1e2b73['query'][_0xf69c('0x29')]);_0x1a4919['offset']=qs[_0xf69c('0x26')](_0x1e2b73[_0xf69c('0x3b')]['offset']);}return _0x18303b[_0xf69c('0x79')](_0x1a4919);}})['then'](function(_0xa2a656){if(_0xa2a656){return _0xa2a656?{'count':_0x25b22e,'rows':_0xa2a656}:null;}})[_0xf69c('0x2c')](respondWithResult(_0x35430b,null))['catch'](handleError(_0x35430b,null));};exports[_0xf69c('0x7a')]=function(_0x5732df,_0x567cee,_0x225501){var _0x4795c7={'channel':_0xf69c('0x7b')};var _0x4706bb=[];var _0x34bdaf=[];var _0x3a8ca4={};return db[_0xf69c('0x37')][_0xf69c('0x59')]({'where':{'id':_0x5732df[_0xf69c('0x5f')]['id']},'include':[{'model':db['WhatsappApplication'],'as':'Applications'}]})[_0xf69c('0x2c')](handleEntityNotFound(_0x567cee,null))[_0xf69c('0x2c')](function(_0x233c27){_0x4795c7[_0xf69c('0x7c')]=_0x233c27;if(_0x4795c7[_0xf69c('0x7c')]&&_0x4795c7[_0xf69c('0x7c')][_0xf69c('0x39')]===_0xf69c('0x7d')&&_0x5732df[_0xf69c('0x52')][_0xf69c('0x7e')]){if(_0x5732df['body'][_0xf69c('0x7e')][_0xf69c('0x50')]===0x0)return;if(_0x5732df[_0xf69c('0x52')][_0xf69c('0x7e')][0x0]['state']!=='read')return;return db['WhatsappMessage'][_0xf69c('0x58')]({'read':!![],'readAt':_0x5732df[_0xf69c('0x52')]['statuses'][0x0][_0xf69c('0x7f')]},{'where':{'messageId':_0x5732df[_0xf69c('0x52')][_0xf69c('0x7e')][0x0][_0xf69c('0x80')]},'individualHooks':!![]})[_0xf69c('0x2c')](function(_0x5d04f3){return _0x567cee[_0xf69c('0x24')](0xc8)['json'](_0x5d04f3);});}_0x4795c7[_0xf69c('0x81')]=_['orderBy'](_0x233c27[_0xf69c('0x82')],['priority'],['asc']);if(_0x4795c7[_0xf69c('0x7c')][_0xf69c('0x82')]){delete _0x4795c7[_0xf69c('0x7c')]['Applications'];}return db['CmContact'][_0xf69c('0x5a')]()[_0xf69c('0x2c')](function(_0x47d4b5){if(!_0x47d4b5){throw new db[(_0xf69c('0x83'))][(_0xf69c('0x84'))]('no\x20available\x20attributes');}_0x4706bb=_['difference'](_['keys'](_0x47d4b5),[_0xf69c('0x85'),_0xf69c('0x86')]);_0x34bdaf=_['difference'](_['keys'](_0x47d4b5),[_0xf69c('0x85'),_0xf69c('0x86'),_0xf69c('0x87'),_0xf69c('0x88')]);_0x4795c7[_0xf69c('0x52')]={'mapKey':_0xf69c('0x89')};if(_0x4795c7[_0xf69c('0x7c')]&&_0x4795c7['account'][_0xf69c('0x39')]===_0xf69c('0x8a')){_0x4795c7[_0xf69c('0x52')]['from']=_0x5732df[_0xf69c('0x52')][_0xf69c('0x8b')][_0xf69c('0x8c')]('whatsapp:','');_0x4795c7['body'][_0xf69c('0x52')]=_0x5732df[_0xf69c('0x52')][_0xf69c('0x8d')];_0x4795c7[_0xf69c('0x52')]['messageId']=_0x5732df['body'][_0xf69c('0x8e')];}if(_0x4795c7['account']&&_0x4795c7[_0xf69c('0x7c')][_0xf69c('0x39')]==='sinch'){_0x4795c7[_0xf69c('0x52')][_0xf69c('0x8f')]=_0x5732df[_0xf69c('0x52')][_0xf69c('0x90')][0x0][_0xf69c('0x8f')];_0x4795c7[_0xf69c('0x52')][_0xf69c('0x52')]=_0x5732df['body'][_0xf69c('0x90')][0x0][_0xf69c('0x20')][_0xf69c('0x52')];_0x4795c7[_0xf69c('0x52')]['messageId']=_0x5732df[_0xf69c('0x52')][_0xf69c('0x90')][0x0][_0xf69c('0x80')];}if(_0x4795c7['body']['id']){delete _0x4795c7[_0xf69c('0x52')]['id'];}if(_[_0xf69c('0x91')](_0x4795c7[_0xf69c('0x52')][_0xf69c('0x8f')])){throw new db[(_0xf69c('0x83'))][(_0xf69c('0x84'))]('from\x20is\x20mandatory');}if(_[_0xf69c('0x91')](_0x4795c7[_0xf69c('0x52')][_0xf69c('0x52')])||_0x4795c7[_0xf69c('0x52')][_0xf69c('0x52')]===''){throw new db[(_0xf69c('0x83'))][(_0xf69c('0x84'))](_0xf69c('0x92'));}if(_[_0xf69c('0x91')](_0x4795c7[_0xf69c('0x52')][_0xf69c('0x93')])){throw new db[(_0xf69c('0x83'))][(_0xf69c('0x84'))](_0xf69c('0x94')+_0x34bdaf);}if(!_['includes'](_0x34bdaf,_0x4795c7['body']['mapKey'])){throw new db[(_0xf69c('0x83'))][(_0xf69c('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x34bdaf);}_0x3a8ca4[_0x4795c7[_0xf69c('0x52')][_0xf69c('0x93')]]=_0x4795c7[_0xf69c('0x52')][_0xf69c('0x8f')];return db['CmList'][_0xf69c('0x59')]({'where':{'id':_0x4795c7['account'][_0xf69c('0x88')]},'include':[{'model':db[_0xf69c('0x95')],'as':_0xf69c('0x96'),'where':_0x3a8ca4,'limit':0x1,'order':[[_0xf69c('0x86'),_0xf69c('0x97')]]}]});})[_0xf69c('0x2c')](handleEntityNotFound(_0x567cee,null))[_0xf69c('0x2c')](function(_0xacf88){if(_0xacf88){_0x4795c7[_0xf69c('0x98')]=_[_0xf69c('0x99')](_0xacf88,['Contacts']);if(_0xacf88['Contacts']['length']){return _0xacf88[_0xf69c('0x96')][0x0];}var _0x29c68e=_[_0xf69c('0x16')](_0x4795c7[_0xf69c('0x52')],{'firstName':_0x4795c7[_0xf69c('0x52')][_0xf69c('0x8f')],'ListId':_0xacf88['id']});_0x29c68e[_0x4795c7[_0xf69c('0x52')]['mapKey']]=_0x4795c7[_0xf69c('0x52')][_0xf69c('0x8f')];return db[_0xf69c('0x95')][_0xf69c('0x51')](_0x29c68e,{'fields':_0x4706bb,'raw':!![]});}})['then'](handleEntityNotFound(_0x567cee,null))['then'](function(_0x3d5f95){if(_0x3d5f95){_0x4795c7[_0xf69c('0x9a')]=_0x3d5f95;var _0x210fa6={'ContactId':_0x3d5f95['id'],'phone':_0x4795c7[_0xf69c('0x52')][_0xf69c('0x8f')],'WhatsappAccountId':_0x5732df[_0xf69c('0x5f')]['id']};var _0x2ab05d={'ContactId':_0x3d5f95['id'],'WhatsappAccountId':_0x5732df[_0xf69c('0x5f')]['id'],'closed':![]};return db[_0xf69c('0x9b')][_0xf69c('0x59')]({'where':_0x2ab05d})[_0xf69c('0x2c')](function(_0x229f7c){if(_0x229f7c){return[_0x229f7c,![]];}return db['WhatsappInteraction'][_0xf69c('0x51')](_0x210fa6)['then'](function(_0xda85cc){return[_0xda85cc,!![]];});});}})[_0xf69c('0x6a')](function(_0x866d1,_0x373b90){_0x4795c7[_0xf69c('0x9c')]=_0x866d1[_0xf69c('0x2e')]({'plain':!![]});_0x4795c7[_0xf69c('0x9c')]['created']=![];if(_0x373b90){if(_0x4795c7['account'][_0xf69c('0x9d')]){_0x4795c7['applications'][_0xf69c('0x9e')]({'id':0x0,'priority':_0x4795c7[_0xf69c('0x81')][_0xf69c('0x50')]+0x1,'app':_0xf69c('0x9f'),'appdata':'unmanaged','interval':_0xf69c('0xa0')});}_0x4795c7[_0xf69c('0x9c')][_0xf69c('0xa1')]=!![];}return db['WhatsappMessage'][_0xf69c('0x51')]({'phone':_0x4795c7['body'][_0xf69c('0x8f')],'messageId':_0x4795c7['body'][_0xf69c('0xa2')],'body':_0x4795c7[_0xf69c('0x52')][_0xf69c('0x52')],'WhatsappAccountId':_0x5732df[_0xf69c('0x5f')]['id'],'WhatsappInteractionId':_0x866d1['id'],'direction':'in','ContactId':_0x866d1['ContactId'],'AttachmentId':_0x4795c7[_0xf69c('0x52')][_0xf69c('0xa3')]});})[_0xf69c('0x2c')](function(_0x3dd2be){_0x4795c7['message']=_0x3dd2be;if(_0x4795c7[_0xf69c('0x9c')][_0xf69c('0xa4')]){return db['User'][_0xf69c('0x59')]({'attributes':['id',_0xf69c('0x33')],'where':{'id':_0x4795c7[_0xf69c('0x9c')][_0xf69c('0xa4')]}})['then'](function(_0x13fedc){if(_0x13fedc){_0x4795c7[_0xf69c('0x81')][_0xf69c('0xa5')]({'id':0x0,'priority':0x0,'app':_0xf69c('0xa6'),'appdata':_0x13fedc[_0xf69c('0x33')]+','+(_0x4795c7['account'][_0xf69c('0xa7')]||0xa),'interval':_0xf69c('0xa0')});}return respondWithRpcPromise('Start',_0xf69c('0xa8'),_0x4795c7);});}return respondWithRpcPromise(_0xf69c('0xa9'),_0xf69c('0xa8'),_0x4795c7);})[_0xf69c('0x2c')](function(_0x32bdc3){if(_0x32bdc3){var _0x4d1d2d=0xc8;var _0x50c1aa=_0xf69c('0xaa');logger[_0xf69c('0x21')](_0xf69c('0xab'),_0x50c1aa,_0x4d1d2d,_0xf69c('0xac'));logger[_0xf69c('0x1c')](_0xf69c('0xad'),_0x50c1aa,_0x4d1d2d,_0xf69c('0xac'),JSON[_0xf69c('0xae')](_0x32bdc3));if(_0x4795c7[_0xf69c('0x7c')][_0xf69c('0x39')]===_0xf69c('0x8a')){return _0x567cee['status'](_0x4d1d2d)[_0xf69c('0x2a')](_0xf69c('0xaf'),_0xf69c('0xb0'))[_0xf69c('0x78')]('\x0a');}else{return _0x567cee[_0xf69c('0x24')](_0x4d1d2d)['json'](_0x32bdc3);}}});})[_0xf69c('0x4c')](handleError(_0x567cee,null));};exports[_0xf69c('0x78')]=function(_0x5f7191,_0x324042,_0x20327){var _0x564d91,_0x2e3bb6,_0x202f5d;if(_['isNil'](_0x5f7191[_0xf69c('0x52')][_0xf69c('0x52')])||_0x5f7191[_0xf69c('0x52')]['body']===''){throw new db[(_0xf69c('0x83'))]['ValidationError'](_0xf69c('0x92'));}if(_[_0xf69c('0x91')](_0x5f7191['body']['to'])){throw new db['Sequelize']['ValidationError'](_0xf69c('0xb1'));}_0x564d91=_0x5f7191['body']['to'];return db['WhatsappAccount'][_0xf69c('0x59')]({'where':{'id':_0x5f7191[_0xf69c('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xf69c('0xb2'),'include':[{'model':db[_0xf69c('0x95')],'as':_0xf69c('0x96'),'where':{'mobile':_0x564d91},'limit':0x1,'order':[[_0xf69c('0x86'),_0xf69c('0x97')]]}]}]})[_0xf69c('0x2c')](handleEntityNotFound(_0x324042,null))['then'](function(_0x12a41b){if(_0x12a41b&&_0x12a41b['List']){_0x2e3bb6=_0x12a41b[_0xf69c('0x2e')]({'plain':!![]});if(_0x2e3bb6[_0xf69c('0xb2')]&&_0x2e3bb6['List'][_0xf69c('0x96')][_0xf69c('0x50')]){return _0x2e3bb6[_0xf69c('0xb2')][_0xf69c('0x96')][0x0];}return db['CmContact']['create'](_[_0xf69c('0x16')](_0x5f7191['body'],{'firstName':_0x564d91,'mobile':_0x564d91,'phone':_0x564d91,'ListId':_0x2e3bb6[_0xf69c('0x88')]}));}})[_0xf69c('0x2c')](handleEntityNotFound(_0x324042,null))['then'](function(_0x598b54){if(_0x598b54){_0x202f5d=_0x598b54;return db['WhatsappInteraction'][_0xf69c('0x59')]({'where':{'ContactId':_0x202f5d['id'],'closed':![],'WhatsappAccountId':_0x2e3bb6['id']}})['then'](function(_0x5ed712){if(_0x5ed712){return[_0x5ed712,![]];}return db[_0xf69c('0x9b')]['create']({'UserId':_0x5f7191[_0xf69c('0x53')]['id'],'ContactId':_0x202f5d['id'],'WhatsappAccountId':_0x2e3bb6['id'],'phone':_0x564d91,'firstMsgDirection':_0xf69c('0xb3'),'Messages':[_[_0xf69c('0x47')](_0x5f7191[_0xf69c('0x52')],{'read':![],'body':_0x5f7191[_0xf69c('0x52')][_0xf69c('0x52')],'phone':_0x564d91,'WhatsappAccountId':_0x2e3bb6['id'],'UserId':_0x5f7191['user']['id'],'ContactId':_0x202f5d['id']})]},{'include':[{'model':db[_0xf69c('0xb4')],'as':_0xf69c('0xb5')}]})[_0xf69c('0x2c')](function(_0x284047){return[_0x284047,!![]];});});}})[_0xf69c('0x6a')](function(_0x5d18f0,_0x379843){if(_0x379843){return _0x5d18f0;}return db['WhatsappMessage']['create'](_[_0xf69c('0x47')](_0x5f7191['body'],{'read':![],'body':_0x5f7191[_0xf69c('0x52')][_0xf69c('0x52')],'phone':_0x564d91,'WhatsappAccountId':_0x2e3bb6['id'],'WhatsappInteractionId':_0x5d18f0['id'],'UserId':_0x5f7191[_0xf69c('0x53')]['id'],'ContactId':_0x202f5d['id']}))[_0xf69c('0x2c')](function(_0x589b90){_0x5d18f0[_0xf69c('0xb6')][_0xf69c('0xb5')]=[];_0x5d18f0[_0xf69c('0xb6')][_0xf69c('0xb5')]['push'](_0x589b90[_0xf69c('0xb6')]);return _0x5d18f0;});})[_0xf69c('0x2c')](respondWithResult(_0x324042,null))['catch'](handleError(_0x324042,null));}; \ No newline at end of file +var _0x1d61=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','WhatsappAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','rawAttributes','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','messageId','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','push','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','debug','entity\x20found','text/xml','\x0a','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x56960f,_0x5bba63){var _0x467460=function(_0xf217c9){while(--_0xf217c9){_0x56960f['push'](_0x56960f['shift']());}};_0x467460(++_0x5bba63);}(_0x1d61,0x1f3));var _0x11d6=function(_0x34a31c,_0x6b580e){_0x34a31c=_0x34a31c-0x0;var _0x9472d5=_0x1d61[_0x34a31c];return _0x9472d5;};'use strict';var emlformat=require(_0x11d6('0x0'));var rimraf=require(_0x11d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11d6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x11d6('0x3'));var util=require(_0x11d6('0x4'));var path=require(_0x11d6('0x5'));var sox=require(_0x11d6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11d6('0x7'));var _=require(_0x11d6('0x8'));var squel=require(_0x11d6('0x9'));var crypto=require(_0x11d6('0xa'));var jsforce=require(_0x11d6('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x11d6('0xc'));var Redis=require(_0x11d6('0xd'));var authService=require(_0x11d6('0xe'));var qs=require(_0x11d6('0xf'));var as=require(_0x11d6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11d6('0x11'))(_0x11d6('0x12'));var utils=require('../../config/utils');var config=require(_0x11d6('0x13'));var licenseUtil=require(_0x11d6('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x11d6('0x15')](config['redis'],{'host':_0x11d6('0x16'),'port':0x18eb});var socket=require(_0x11d6('0x17'))(new Redis(config['redis']));require(_0x11d6('0x18'))[_0x11d6('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x11d6('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x1281ab,_0x12c829,_0x198bf7,_0x2056ae){return new BPromise(function(_0xcf8742,_0x4f3ea6){var _0x2ff00e=_0x2056ae||client;return _0x2ff00e[_0x11d6('0x1b')](_0x1281ab,_0x198bf7)['then'](function(_0x2db341){logger[_0x11d6('0x1c')](_0x11d6('0x1d'),_0x12c829,_0x11d6('0x1e'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x12c829,'request\x20sent',JSON[_0x11d6('0x1f')](_0x2db341));if(_0x2db341[_0x11d6('0x20')]){if(_0x2db341['error'][_0x11d6('0x21')]===0x1f4){logger['error'](_0x11d6('0x1d'),_0x12c829,_0x2db341[_0x11d6('0x20')][_0x11d6('0x22')]);return _0x4f3ea6(_0x2db341[_0x11d6('0x20')][_0x11d6('0x22')]);}logger[_0x11d6('0x20')](_0x11d6('0x1d'),_0x12c829,_0x2db341[_0x11d6('0x20')]['message']);return _0xcf8742(_0x2db341[_0x11d6('0x20')]['message']);}else{logger[_0x11d6('0x1c')](_0x11d6('0x1d'),_0x12c829,_0x11d6('0x1e'));_0xcf8742(_0x2db341[_0x11d6('0x23')]['message']);}})[_0x11d6('0x24')](function(_0x537fda){logger[_0x11d6('0x20')](_0x11d6('0x1d'),_0x12c829,_0x537fda);_0x4f3ea6(_0x537fda);});});}function respondWithStatusCode(_0x10f290,_0x3503bc){_0x3503bc=_0x3503bc||0xcc;return function(_0x2016df){if(_0x2016df){return _0x10f290[_0x11d6('0x25')](_0x3503bc);}return _0x10f290[_0x11d6('0x26')](_0x3503bc)[_0x11d6('0x27')]();};}function respondWithResult(_0x217f7a,_0x3e9cfc){_0x3e9cfc=_0x3e9cfc||0xc8;return function(_0x98805d){if(_0x98805d){return _0x217f7a[_0x11d6('0x26')](_0x3e9cfc)[_0x11d6('0x28')](_0x98805d);}};}function respondWithFilteredResult(_0x4dcd67,_0x373726){return function(_0x20cebc){if(_0x20cebc){var _0x2ff300=typeof _0x373726[_0x11d6('0x29')]===_0x11d6('0x2a')&&typeof _0x373726[_0x11d6('0x2b')]===_0x11d6('0x2a');var _0x30e7f6=_0x20cebc[_0x11d6('0x2c')];var _0x42138d=_0x2ff300?0x0:_0x373726['offset'];var _0x494b7c=_0x2ff300?_0x20cebc[_0x11d6('0x2c')]:_0x373726[_0x11d6('0x29')]+_0x373726['limit'];var _0x54d352;if(_0x494b7c>=_0x30e7f6){_0x494b7c=_0x30e7f6;_0x54d352=0xc8;}else{_0x54d352=0xce;}_0x4dcd67[_0x11d6('0x26')](_0x54d352);return _0x4dcd67[_0x11d6('0x2d')](_0x11d6('0x2e'),_0x42138d+'-'+_0x494b7c+'/'+_0x30e7f6)[_0x11d6('0x28')](_0x20cebc);}return null;};}function patchUpdates(_0xad23c3){return function(_0x2400dc){try{jsonpatch['apply'](_0x2400dc,_0xad23c3,!![]);}catch(_0x23f4c2){return BPromise[_0x11d6('0x2f')](_0x23f4c2);}return _0x2400dc[_0x11d6('0x30')]();};}function saveUpdates(_0x1f17b9,_0x5720a4){return function(_0x296abb){if(_0x296abb){return _0x296abb[_0x11d6('0x31')](_0x1f17b9)[_0x11d6('0x32')](function(_0x338a41){return _0x338a41;});}return null;};}function removeEntity(_0x482b32,_0x5b4c77){return function(_0x401a14){if(_0x401a14){return _0x401a14[_0x11d6('0x33')]()[_0x11d6('0x32')](function(){var _0x1b3048=_0x401a14[_0x11d6('0x34')]({'plain':!![]});var _0x98b431='WhatsappAccounts';return db[_0x11d6('0x35')][_0x11d6('0x33')]({'where':{'type':_0x98b431,'resourceId':_0x1b3048['id']}})['then'](function(){return _0x401a14;});})[_0x11d6('0x32')](function(){_0x482b32['status'](0xcc)[_0x11d6('0x27')]();});}};}function handleEntityNotFound(_0x4ac30d,_0xd8e50f){return function(_0x5b6703){if(!_0x5b6703){_0x4ac30d[_0x11d6('0x25')](0x194);}return _0x5b6703;};}function handleError(_0x424895,_0x366bab){_0x366bab=_0x366bab||0x1f4;return function(_0x4ae0ee){logger['error'](_0x4ae0ee['stack']);if(_0x4ae0ee[_0x11d6('0x36')]){delete _0x4ae0ee['name'];}_0x424895[_0x11d6('0x26')](_0x366bab)[_0x11d6('0x37')](_0x4ae0ee);};}exports[_0x11d6('0x38')]=function(_0x3dda01,_0x18fda9){var _0xa53403={'include':[{'model':db[_0x11d6('0x39')],'as':_0x11d6('0x3a')}]},_0x132647={},_0x2c36f2={'count':0x0,'rows':[]};var _0x3e829d=_['map'](db[_0x11d6('0x3b')]['rawAttributes'],function(_0x3cafa7){return{'name':_0x3cafa7[_0x11d6('0x3c')],'type':_0x3cafa7[_0x11d6('0x3d')]['key']};});_0x132647['model']=_[_0x11d6('0x3e')](_0x3e829d,_0x11d6('0x36'));_0x132647[_0x11d6('0x3f')]=_[_0x11d6('0x40')](_0x3dda01[_0x11d6('0x3f')]);_0x132647['filters']=_[_0x11d6('0x41')](_0x132647[_0x11d6('0x42')],_0x132647[_0x11d6('0x3f')]);_0xa53403[_0x11d6('0x43')]=_[_0x11d6('0x41')](_0x132647[_0x11d6('0x42')],qs[_0x11d6('0x44')](_0x3dda01['query'][_0x11d6('0x44')]));_0xa53403[_0x11d6('0x43')]=_0xa53403[_0x11d6('0x43')][_0x11d6('0x45')]?_0xa53403[_0x11d6('0x43')]:_0x132647[_0x11d6('0x42')];if(!_0x3dda01[_0x11d6('0x3f')][_0x11d6('0x46')](_0x11d6('0x47'))){_0xa53403[_0x11d6('0x2b')]=qs['limit'](_0x3dda01[_0x11d6('0x3f')][_0x11d6('0x2b')]);_0xa53403[_0x11d6('0x29')]=qs['offset'](_0x3dda01[_0x11d6('0x3f')][_0x11d6('0x29')]);}_0xa53403[_0x11d6('0x48')]=qs[_0x11d6('0x49')](_0x3dda01[_0x11d6('0x3f')]['sort']);_0xa53403[_0x11d6('0x4a')]=qs[_0x11d6('0x4b')](_[_0x11d6('0x4c')](_0x3dda01[_0x11d6('0x3f')],_0x132647[_0x11d6('0x4b')]),_0x3e829d);if(_0x3dda01[_0x11d6('0x3f')][_0x11d6('0x4d')]){_0xa53403['where']=_[_0x11d6('0x4e')](_0xa53403[_0x11d6('0x4a')],{'$or':_[_0x11d6('0x3e')](_0x3e829d,function(_0x66ee75){if(_0x66ee75[_0x11d6('0x3d')]!==_0x11d6('0x4f')){var _0x43e48c={};_0x43e48c[_0x66ee75[_0x11d6('0x36')]]={'$like':'%'+_0x3dda01['query'][_0x11d6('0x4d')]+'%'};return _0x43e48c;}})});}_0xa53403=_[_0x11d6('0x4e')]({},_0xa53403,_0x3dda01[_0x11d6('0x50')]);var _0x2e9b56={'where':_0xa53403['where']};return db[_0x11d6('0x3b')][_0x11d6('0x2c')](_0x2e9b56)[_0x11d6('0x32')](function(_0x302be8){_0x2c36f2[_0x11d6('0x2c')]=_0x302be8;if(_0x3dda01[_0x11d6('0x3f')][_0x11d6('0x51')]){_0xa53403[_0x11d6('0x52')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0xa53403);})['then'](function(_0xbc9f1f){_0x2c36f2[_0x11d6('0x53')]=_0xbc9f1f;return _0x2c36f2;})[_0x11d6('0x32')](respondWithFilteredResult(_0x18fda9,_0xa53403))[_0x11d6('0x24')](handleError(_0x18fda9,null));};exports[_0x11d6('0x54')]=function(_0x5f09e6,_0x44a80c){var _0x782c9d={'raw':![],'where':{'id':_0x5f09e6[_0x11d6('0x55')]['id']},'include':[{'model':db[_0x11d6('0x39')],'as':'mandatoryDispositionPause'}]},_0x39979a={};_0x39979a[_0x11d6('0x42')]=_[_0x11d6('0x40')](db['WhatsappAccount']['rawAttributes']);_0x39979a['query']=_[_0x11d6('0x40')](_0x5f09e6[_0x11d6('0x3f')]);_0x39979a[_0x11d6('0x4b')]=_[_0x11d6('0x41')](_0x39979a['model'],_0x39979a['query']);_0x782c9d['attributes']=_['intersection'](_0x39979a[_0x11d6('0x42')],qs[_0x11d6('0x44')](_0x5f09e6[_0x11d6('0x3f')][_0x11d6('0x44')]));_0x782c9d[_0x11d6('0x43')]=_0x782c9d['attributes'][_0x11d6('0x45')]?_0x782c9d[_0x11d6('0x43')]:_0x39979a[_0x11d6('0x42')];if(_0x5f09e6[_0x11d6('0x3f')][_0x11d6('0x51')]){_0x782c9d[_0x11d6('0x52')]=[{'all':!![]}];}_0x782c9d=_[_0x11d6('0x4e')]({},_0x782c9d,_0x5f09e6[_0x11d6('0x50')]);return db[_0x11d6('0x3b')][_0x11d6('0x56')](_0x782c9d)[_0x11d6('0x32')](handleEntityNotFound(_0x44a80c,null))[_0x11d6('0x32')](respondWithResult(_0x44a80c,null))[_0x11d6('0x24')](handleError(_0x44a80c,null));};exports[_0x11d6('0x57')]=function(_0x34a576,_0x155791){return db['WhatsappAccount'][_0x11d6('0x57')](_0x34a576[_0x11d6('0x58')],{})[_0x11d6('0x32')](function(_0xb69d8a){var _0x6ba055=_0x34a576['user']['get']({'plain':!![]});if(!_0x6ba055)throw new Error(_0x11d6('0x59'));if(_0x6ba055[_0x11d6('0x5a')]===_0x11d6('0x5b')){var _0x281f8c=_0xb69d8a['get']({'plain':!![]});var _0x5a839e=_0x11d6('0x5c');return db[_0x11d6('0x5d')]['find']({'where':{'name':_0x5a839e,'userProfileId':_0x6ba055[_0x11d6('0x5e')]},'raw':!![]})[_0x11d6('0x32')](function(_0x570a56){if(_0x570a56&&_0x570a56['autoAssociation']===0x0){return db[_0x11d6('0x35')][_0x11d6('0x57')]({'name':_0x281f8c['name'],'resourceId':_0x281f8c['id'],'type':_0x570a56['name'],'sectionId':_0x570a56['id']},{})[_0x11d6('0x32')](function(){return _0xb69d8a;});}else{return _0xb69d8a;}})[_0x11d6('0x24')](function(_0x5499cf){logger['error'](_0x11d6('0x5f'),_0x5499cf);throw _0x5499cf;});}return _0xb69d8a;})[_0x11d6('0x32')](respondWithResult(_0x155791,0xc9))[_0x11d6('0x24')](handleError(_0x155791,null));};exports[_0x11d6('0x31')]=function(_0x498f8a,_0x405c0d){if(_0x498f8a[_0x11d6('0x58')]['id']){delete _0x498f8a['body']['id'];}return db[_0x11d6('0x3b')]['find']({'where':{'id':_0x498f8a[_0x11d6('0x55')]['id']},'include':[{'model':db[_0x11d6('0x39')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x405c0d,null))[_0x11d6('0x32')](saveUpdates(_0x498f8a[_0x11d6('0x58')],null))[_0x11d6('0x32')](respondWithResult(_0x405c0d,null))[_0x11d6('0x24')](handleError(_0x405c0d,null));};exports[_0x11d6('0x33')]=function(_0x17a968,_0x1a77e2){return db['WhatsappAccount'][_0x11d6('0x56')]({'where':{'id':_0x17a968[_0x11d6('0x55')]['id']}})[_0x11d6('0x32')](handleEntityNotFound(_0x1a77e2,null))['then'](removeEntity(_0x1a77e2,null))[_0x11d6('0x24')](handleError(_0x1a77e2,null));};exports[_0x11d6('0x60')]=function(_0x256dc7,_0x504ae4){return db[_0x11d6('0x3b')][_0x11d6('0x60')]()[_0x11d6('0x32')](respondWithResult(_0x504ae4,null))[_0x11d6('0x24')](handleError(_0x504ae4,null));};exports['addDisposition']=function(_0xfe42ae,_0x260dda,_0x18be3c){if(_0xfe42ae[_0x11d6('0x58')]['id']){delete _0xfe42ae[_0x11d6('0x58')]['id'];}return db[_0x11d6('0x3b')][_0x11d6('0x56')]({'where':{'id':_0xfe42ae[_0x11d6('0x55')]['id']}})[_0x11d6('0x32')](handleEntityNotFound(_0x260dda,null))['then'](function(_0x1cdbce){if(_0x1cdbce){_0xfe42ae[_0x11d6('0x58')]['WhatsappAccountId']=_0x1cdbce['id'];return db[_0x11d6('0x61')][_0x11d6('0x57')](_0xfe42ae[_0x11d6('0x58')]);}})['then'](respondWithResult(_0x260dda,null))['catch'](handleError(_0x260dda,null));};exports[_0x11d6('0x62')]=function(_0x4e6830,_0x3bb075,_0x476101){var _0x1cc9f6={'raw':![],'where':{}};var _0x49d8d8={};var _0x3a084d={'count':0x0,'rows':[]};return db[_0x11d6('0x3b')][_0x11d6('0x63')]({'where':{'id':_0x4e6830[_0x11d6('0x55')]['id']}})[_0x11d6('0x32')](handleEntityNotFound(_0x3bb075,null))[_0x11d6('0x32')](function(_0x2d4d25){if(_0x2d4d25){_0x49d8d8['model']=_[_0x11d6('0x40')](db['Disposition']['rawAttributes']);_0x49d8d8[_0x11d6('0x3f')]=_[_0x11d6('0x40')](_0x4e6830[_0x11d6('0x3f')]);_0x49d8d8[_0x11d6('0x4b')]=_[_0x11d6('0x41')](_0x49d8d8[_0x11d6('0x42')],_0x49d8d8[_0x11d6('0x3f')]);_0x1cc9f6[_0x11d6('0x43')]=_['intersection'](_0x49d8d8[_0x11d6('0x42')],qs[_0x11d6('0x44')](_0x4e6830[_0x11d6('0x3f')][_0x11d6('0x44')]));_0x1cc9f6['attributes']=_0x1cc9f6[_0x11d6('0x43')][_0x11d6('0x45')]?_0x1cc9f6[_0x11d6('0x43')]:_0x49d8d8[_0x11d6('0x42')];if(!_0x4e6830[_0x11d6('0x3f')][_0x11d6('0x46')](_0x11d6('0x47'))){_0x1cc9f6['limit']=qs[_0x11d6('0x2b')](_0x4e6830['query'][_0x11d6('0x2b')]);_0x1cc9f6['offset']=qs[_0x11d6('0x29')](_0x4e6830[_0x11d6('0x3f')]['offset']);}_0x1cc9f6['order']=qs[_0x11d6('0x49')](_0x4e6830[_0x11d6('0x3f')][_0x11d6('0x49')]);_0x1cc9f6[_0x11d6('0x4a')]=qs['filters'](_[_0x11d6('0x4c')](_0x4e6830[_0x11d6('0x3f')],_0x49d8d8[_0x11d6('0x4b')]));_0x1cc9f6[_0x11d6('0x4a')][_0x11d6('0x64')]=_0x2d4d25['id'];if(_0x4e6830[_0x11d6('0x3f')][_0x11d6('0x4d')]){_0x1cc9f6[_0x11d6('0x4a')]=_[_0x11d6('0x4e')](_0x1cc9f6[_0x11d6('0x4a')],{'$or':_[_0x11d6('0x3e')](_0x1cc9f6[_0x11d6('0x43')],function(_0x51a1d8){var _0x32f73e={};_0x32f73e[_0x51a1d8]={'$like':'%'+_0x4e6830[_0x11d6('0x3f')][_0x11d6('0x4d')]+'%'};return _0x32f73e;})});}_0x1cc9f6=_[_0x11d6('0x4e')]({},_0x1cc9f6,_0x4e6830[_0x11d6('0x50')]);return db['Disposition'][_0x11d6('0x2c')]({'where':_0x1cc9f6[_0x11d6('0x4a')]})[_0x11d6('0x32')](function(_0x27671e){_0x3a084d['count']=_0x27671e;if(_0x4e6830[_0x11d6('0x3f')][_0x11d6('0x51')]){_0x1cc9f6[_0x11d6('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x11d6('0x65')](_0x1cc9f6);})[_0x11d6('0x32')](function(_0x3df1db){_0x3a084d[_0x11d6('0x53')]=_0x3df1db;return _0x3a084d;});}})['then'](respondWithFilteredResult(_0x3bb075,_0x1cc9f6))[_0x11d6('0x24')](handleError(_0x3bb075,null));};exports[_0x11d6('0x66')]=function(_0x14aecd,_0x3ddadc,_0x238049){return db[_0x11d6('0x3b')][_0x11d6('0x56')]({'where':{'id':_0x14aecd[_0x11d6('0x55')]['id']}})[_0x11d6('0x32')](handleEntityNotFound(_0x3ddadc,null))['then'](function(_0x346859){if(_0x346859){return _0x346859['removeDispositions'](_0x14aecd[_0x11d6('0x3f')][_0x11d6('0x67')]);}})[_0x11d6('0x32')](respondWithStatusCode(_0x3ddadc,null))['catch'](handleError(_0x3ddadc,null));};exports[_0x11d6('0x68')]=function(_0x504151,_0x114317,_0x2c870d){if(_0x504151[_0x11d6('0x58')]['id']){delete _0x504151[_0x11d6('0x58')]['id'];}return db['WhatsappAccount'][_0x11d6('0x56')]({'where':{'id':_0x504151['params']['id']}})[_0x11d6('0x32')](handleEntityNotFound(_0x114317,null))[_0x11d6('0x32')](function(_0x2eb8f9){if(_0x2eb8f9){_0x504151[_0x11d6('0x58')][_0x11d6('0x64')]=_0x2eb8f9['id'];return db[_0x11d6('0x69')]['create'](_0x504151[_0x11d6('0x58')]);}})[_0x11d6('0x32')](respondWithResult(_0x114317,null))[_0x11d6('0x24')](handleError(_0x114317,null));};exports['getAnswers']=function(_0x2d8965,_0x7b380a,_0x148814){var _0x5d4995={'raw':![],'where':{}};var _0x4bbfd8={};var _0x945754={'count':0x0,'rows':[]};return db[_0x11d6('0x3b')][_0x11d6('0x63')]({'where':{'id':_0x2d8965[_0x11d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x7b380a,null))[_0x11d6('0x32')](function(_0x40dc06){if(_0x40dc06){_0x4bbfd8[_0x11d6('0x42')]=_[_0x11d6('0x40')](db['CannedAnswer'][_0x11d6('0x6a')]);_0x4bbfd8[_0x11d6('0x3f')]=_[_0x11d6('0x40')](_0x2d8965[_0x11d6('0x3f')]);_0x4bbfd8[_0x11d6('0x4b')]=_[_0x11d6('0x41')](_0x4bbfd8[_0x11d6('0x42')],_0x4bbfd8[_0x11d6('0x3f')]);_0x5d4995[_0x11d6('0x43')]=_[_0x11d6('0x41')](_0x4bbfd8['model'],qs[_0x11d6('0x44')](_0x2d8965[_0x11d6('0x3f')][_0x11d6('0x44')]));_0x5d4995['attributes']=_0x5d4995[_0x11d6('0x43')][_0x11d6('0x45')]?_0x5d4995[_0x11d6('0x43')]:_0x4bbfd8['model'];if(!_0x2d8965[_0x11d6('0x3f')][_0x11d6('0x46')](_0x11d6('0x47'))){_0x5d4995[_0x11d6('0x2b')]=qs[_0x11d6('0x2b')](_0x2d8965['query'][_0x11d6('0x2b')]);_0x5d4995[_0x11d6('0x29')]=qs[_0x11d6('0x29')](_0x2d8965[_0x11d6('0x3f')][_0x11d6('0x29')]);}_0x5d4995[_0x11d6('0x48')]=qs['sort'](_0x2d8965['query'][_0x11d6('0x49')]);_0x5d4995[_0x11d6('0x4a')]=qs[_0x11d6('0x4b')](_[_0x11d6('0x4c')](_0x2d8965['query'],_0x4bbfd8['filters']));_0x5d4995[_0x11d6('0x4a')][_0x11d6('0x64')]=_0x40dc06['id'];if(_0x2d8965[_0x11d6('0x3f')][_0x11d6('0x4d')]){_0x5d4995[_0x11d6('0x4a')]=_[_0x11d6('0x4e')](_0x5d4995[_0x11d6('0x4a')],{'$or':_[_0x11d6('0x3e')](_0x5d4995['attributes'],function(_0x56e490){var _0x398976={};_0x398976[_0x56e490]={'$like':'%'+_0x2d8965[_0x11d6('0x3f')][_0x11d6('0x4d')]+'%'};return _0x398976;})});}_0x5d4995=_[_0x11d6('0x4e')]({},_0x5d4995,_0x2d8965[_0x11d6('0x50')]);return db[_0x11d6('0x69')]['count']({'where':_0x5d4995[_0x11d6('0x4a')]})[_0x11d6('0x32')](function(_0x5a1296){_0x945754[_0x11d6('0x2c')]=_0x5a1296;if(_0x2d8965[_0x11d6('0x3f')][_0x11d6('0x51')]){_0x5d4995[_0x11d6('0x52')]=[{'all':!![]}];}return db[_0x11d6('0x69')]['findAll'](_0x5d4995);})[_0x11d6('0x32')](function(_0x1e0617){_0x945754[_0x11d6('0x53')]=_0x1e0617;return _0x945754;});}})[_0x11d6('0x32')](respondWithFilteredResult(_0x7b380a,_0x5d4995))[_0x11d6('0x24')](handleError(_0x7b380a,null));};exports[_0x11d6('0x6b')]=function(_0x1f62d0,_0xb7e4ff,_0x1682f9){return db[_0x11d6('0x3b')]['find']({'where':{'id':_0x1f62d0[_0x11d6('0x55')]['id']}})[_0x11d6('0x32')](handleEntityNotFound(_0xb7e4ff,null))['then'](function(_0x2c7096){if(_0x2c7096){return _0x2c7096['removeAnswers'](_0x1f62d0[_0x11d6('0x3f')][_0x11d6('0x67')]);}})[_0x11d6('0x32')](respondWithStatusCode(_0xb7e4ff,null))[_0x11d6('0x24')](handleError(_0xb7e4ff,null));};exports['addAgents']=function(_0x84079d,_0x10e74a,_0x23119c){return db[_0x11d6('0x3b')][_0x11d6('0x56')]({'where':{'id':_0x84079d['params']['id']}})[_0x11d6('0x32')](handleEntityNotFound(_0x10e74a,null))[_0x11d6('0x32')](function(_0x4ef6b1){if(_0x4ef6b1){return _0x4ef6b1[_0x11d6('0x6c')](_0x84079d[_0x11d6('0x58')][_0x11d6('0x67')],_[_0x11d6('0x6d')](_0x84079d[_0x11d6('0x58')],[_0x11d6('0x67'),'id'])||{})[_0x11d6('0x6e')](function(_0x490227){for(var _0x44e0f7=0x0;_0x44e0f7<_0x84079d[_0x11d6('0x58')]['ids'][_0x11d6('0x45')];_0x44e0f7+=0x1){socket['emit'](_0x11d6('0x6f'),{'UserId':Number(_0x84079d[_0x11d6('0x58')][_0x11d6('0x67')][_0x44e0f7]),'WhatsappAccountId':Number(_0x84079d['params']['id'])});}return _0x490227;});}})['then'](respondWithResult(_0x10e74a,null))['catch'](handleError(_0x10e74a,null));};exports[_0x11d6('0x70')]=function(_0x2bff23,_0x1cfa43,_0x52cd4a){return db[_0x11d6('0x3b')][_0x11d6('0x56')]({'where':{'id':_0x2bff23[_0x11d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cfa43,null))[_0x11d6('0x32')](function(_0x570c08){if(_0x570c08){return _0x570c08[_0x11d6('0x70')](_0x2bff23[_0x11d6('0x3f')]['ids'])[_0x11d6('0x32')](function(){if(_['isArray'](_0x2bff23[_0x11d6('0x3f')][_0x11d6('0x67')])){for(var _0x548175=0x0;_0x548175<_0x2bff23[_0x11d6('0x3f')]['ids']['length'];_0x548175+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x2bff23[_0x11d6('0x3f')][_0x11d6('0x67')][_0x548175]),'WhatsappAccountId':Number(_0x2bff23[_0x11d6('0x55')]['id'])});}}else{socket['emit'](_0x11d6('0x71'),{'UserId':Number(_0x2bff23[_0x11d6('0x3f')][_0x11d6('0x67')]),'WhatsappAccountId':Number(_0x2bff23[_0x11d6('0x55')]['id'])});}});}})[_0x11d6('0x32')](respondWithStatusCode(_0x1cfa43,null))['catch'](handleError(_0x1cfa43,null));};exports['getAgents']=function(_0x2e3d7e,_0x588352,_0x2a2351){var _0x588f21={};var _0x7fa42a={};var _0x33d087;var _0x27da84;return db['WhatsappAccount'][_0x11d6('0x63')]({'where':{'id':_0x2e3d7e[_0x11d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x588352,null))[_0x11d6('0x32')](function(_0x16c368){if(_0x16c368){_0x33d087=_0x16c368;_0x7fa42a[_0x11d6('0x42')]=_[_0x11d6('0x40')](db[_0x11d6('0x72')]['rawAttributes']);_0x7fa42a[_0x11d6('0x3f')]=_[_0x11d6('0x40')](_0x2e3d7e[_0x11d6('0x3f')]);_0x7fa42a[_0x11d6('0x4b')]=_['intersection'](_0x7fa42a[_0x11d6('0x42')],_0x7fa42a[_0x11d6('0x3f')]);_0x588f21['attributes']=_[_0x11d6('0x41')](_0x7fa42a[_0x11d6('0x42')],qs[_0x11d6('0x44')](_0x2e3d7e[_0x11d6('0x3f')][_0x11d6('0x44')]));_0x588f21[_0x11d6('0x43')]=_0x588f21['attributes']['length']?_0x588f21[_0x11d6('0x43')]:_0x7fa42a[_0x11d6('0x42')];_0x588f21[_0x11d6('0x48')]=qs[_0x11d6('0x49')](_0x2e3d7e[_0x11d6('0x3f')][_0x11d6('0x49')]);_0x588f21['where']=qs['filters'](_['pick'](_0x2e3d7e[_0x11d6('0x3f')],_0x7fa42a[_0x11d6('0x4b')]));if(_0x2e3d7e[_0x11d6('0x3f')][_0x11d6('0x4d')]){_0x588f21['where']=_[_0x11d6('0x4e')](_0x588f21[_0x11d6('0x4a')],{'$or':_['map'](_0x588f21[_0x11d6('0x43')],function(_0x42de45){var _0x32fac2={};_0x32fac2[_0x42de45]={'$like':'%'+_0x2e3d7e[_0x11d6('0x3f')][_0x11d6('0x4d')]+'%'};return _0x32fac2;})});}_0x588f21=_[_0x11d6('0x4e')]({},_0x588f21,_0x2e3d7e[_0x11d6('0x50')]);return _0x33d087['getAgents'](_0x588f21);}})['then'](function(_0x50fc2f){if(_0x50fc2f){_0x27da84=_0x50fc2f['length'];if(!_0x2e3d7e[_0x11d6('0x3f')]['hasOwnProperty'](_0x11d6('0x47'))){_0x588f21[_0x11d6('0x2b')]=qs[_0x11d6('0x2b')](_0x2e3d7e['query'][_0x11d6('0x2b')]);_0x588f21[_0x11d6('0x29')]=qs[_0x11d6('0x29')](_0x2e3d7e[_0x11d6('0x3f')][_0x11d6('0x29')]);}return _0x33d087['getAgents'](_0x588f21);}})[_0x11d6('0x32')](function(_0xf6b3da){if(_0xf6b3da){return _0xf6b3da?{'count':_0x27da84,'rows':_0xf6b3da}:null;}})['then'](respondWithResult(_0x588352,null))[_0x11d6('0x24')](handleError(_0x588352,null));};exports[_0x11d6('0x73')]=function(_0x47dc0d,_0x80e5f){var _0x15b8fd=_0x47dc0d['params']['id'];var _0xc7071=_0x47dc0d[_0x11d6('0x58')];var _0x5665fa=0xc8;var _0x1ab243=null;return db[_0x11d6('0x74')][_0x11d6('0x75')]({'isolationLevel':db[_0x11d6('0x74')]['Transaction'][_0x11d6('0x76')][_0x11d6('0x77')]},function(_0x214b7e){return db[_0x11d6('0x3b')][_0x11d6('0x63')]({'where':{'id':_0x15b8fd},'transaction':_0x214b7e})[_0x11d6('0x32')](function(_0x2bed4a){if(_0x2bed4a){return db['WhatsappApplication'][_0x11d6('0x33')]({'where':{'WhatsappAccountId':_0x15b8fd},'transaction':_0x214b7e})[_0x11d6('0x32')](function(){var _0x52c772=_[_0x11d6('0x3e')](_0xc7071,function(_0x402b8c){_0x402b8c[_0x11d6('0x64')]=_0x15b8fd;return _0x402b8c;});return db[_0x11d6('0x78')][_0x11d6('0x79')](_0x52c772,{'transaction':_0x214b7e});});}else{_0x5665fa=0x194;_0x1ab243=[];}});})[_0x11d6('0x32')](function(){if(_0x5665fa!==0x194){return db['WhatsappApplication'][_0x11d6('0x7a')]({'where':{'WhatsappAccountId':_0x15b8fd},'order':_0x11d6('0x7b')})['then'](function(_0x4206a4){_0x1ab243=_0x4206a4;});}})['catch'](function(_0x4bc62b){_0x5665fa=0x1f4;logger[_0x11d6('0x20')](_0x4bc62b[_0x11d6('0x7c')]);if(_0x4bc62b[_0x11d6('0x36')]){delete _0x4bc62b[_0x11d6('0x36')];}_0x1ab243=_0x4bc62b;})[_0x11d6('0x7d')](function(){if(_0x1ab243===null){_0x80e5f[_0x11d6('0x25')](_0x5665fa);}else{if(_0x5665fa===0x1f4){_0x80e5f[_0x11d6('0x26')](_0x5665fa)[_0x11d6('0x37')](_0x1ab243);}else{_0x80e5f[_0x11d6('0x26')](_0x5665fa)[_0x11d6('0x28')](_0x1ab243);}}});};exports['getApplications']=function(_0x33b75d,_0x34adc9,_0x4afae4){var _0x4bbd2d={};var _0xad22d5={};var _0xb67447;var _0x539853;return db['WhatsappAccount'][_0x11d6('0x63')]({'where':{'id':_0x33b75d[_0x11d6('0x55')]['id']}})['then'](handleEntityNotFound(_0x34adc9,null))[_0x11d6('0x32')](function(_0x3f1abc){if(_0x3f1abc){_0xb67447=_0x3f1abc;_0xad22d5['model']=_[_0x11d6('0x40')](db[_0x11d6('0x78')][_0x11d6('0x6a')]);_0xad22d5[_0x11d6('0x3f')]=_[_0x11d6('0x40')](_0x33b75d['query']);_0xad22d5[_0x11d6('0x4b')]=_[_0x11d6('0x41')](_0xad22d5[_0x11d6('0x42')],_0xad22d5[_0x11d6('0x3f')]);_0x4bbd2d[_0x11d6('0x43')]=_[_0x11d6('0x41')](_0xad22d5[_0x11d6('0x42')],qs[_0x11d6('0x44')](_0x33b75d[_0x11d6('0x3f')]['fields']));_0x4bbd2d[_0x11d6('0x43')]=_0x4bbd2d[_0x11d6('0x43')][_0x11d6('0x45')]?_0x4bbd2d['attributes']:_0xad22d5[_0x11d6('0x42')];_0x4bbd2d['order']=qs[_0x11d6('0x49')](_0x33b75d[_0x11d6('0x3f')]['sort']);_0x4bbd2d[_0x11d6('0x4a')]=qs[_0x11d6('0x4b')](_['pick'](_0x33b75d[_0x11d6('0x3f')],_0xad22d5['filters']));if(_0x33b75d[_0x11d6('0x3f')][_0x11d6('0x4d')]){_0x4bbd2d[_0x11d6('0x4a')]=_[_0x11d6('0x4e')](_0x4bbd2d[_0x11d6('0x4a')],{'$or':_[_0x11d6('0x3e')](_0x4bbd2d['attributes'],function(_0x45c497){var _0x16d28c={};_0x16d28c[_0x45c497]={'$like':'%'+_0x33b75d[_0x11d6('0x3f')]['filter']+'%'};return _0x16d28c;})});}_0x4bbd2d=_['merge']({},_0x4bbd2d,_0x33b75d[_0x11d6('0x50')]);return _0xb67447[_0x11d6('0x7e')](_0x4bbd2d);}})[_0x11d6('0x32')](function(_0xfc87ad){if(_0xfc87ad){_0x539853=_0xfc87ad['length'];if(!_0x33b75d[_0x11d6('0x3f')][_0x11d6('0x46')](_0x11d6('0x47'))){_0x4bbd2d[_0x11d6('0x2b')]=qs[_0x11d6('0x2b')](_0x33b75d[_0x11d6('0x3f')][_0x11d6('0x2b')]);_0x4bbd2d[_0x11d6('0x29')]=qs[_0x11d6('0x29')](_0x33b75d[_0x11d6('0x3f')][_0x11d6('0x29')]);}return _0xb67447[_0x11d6('0x7e')](_0x4bbd2d);}})['then'](function(_0x1306a7){if(_0x1306a7){return _0x1306a7?{'count':_0x539853,'rows':_0x1306a7}:null;}})[_0x11d6('0x32')](respondWithResult(_0x34adc9,null))[_0x11d6('0x24')](handleError(_0x34adc9,null));};exports[_0x11d6('0x7f')]=function(_0x25ff8f,_0x284f42,_0x290991){var _0x565d0a={'channel':'whatsapp'};var _0x5c67d4=[];var _0x437f06=[];var _0x845bbc={};return db[_0x11d6('0x3b')][_0x11d6('0x56')]({'where':{'id':_0x25ff8f[_0x11d6('0x55')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x11d6('0x80')}]})['then'](handleEntityNotFound(_0x284f42,null))[_0x11d6('0x32')](function(_0x4fd519){_0x565d0a[_0x11d6('0x81')]=_0x4fd519;if(_0x565d0a[_0x11d6('0x81')]&&_0x565d0a[_0x11d6('0x81')]['type']==='sinch'&&_0x25ff8f[_0x11d6('0x58')]['statuses']){if(_0x25ff8f['body'][_0x11d6('0x82')][_0x11d6('0x45')]===0x0)return;if(_0x25ff8f[_0x11d6('0x58')][_0x11d6('0x82')][0x0][_0x11d6('0x83')]!==_0x11d6('0x84'))return;return db[_0x11d6('0x85')][_0x11d6('0x31')]({'read':!![],'readAt':_0x25ff8f[_0x11d6('0x58')][_0x11d6('0x82')][0x0][_0x11d6('0x86')]},{'where':{'messageId':_0x25ff8f['body']['statuses'][0x0][_0x11d6('0x87')]},'individualHooks':!![]})['then'](function(_0x2c6b80){return _0x284f42[_0x11d6('0x26')](0xc8)[_0x11d6('0x28')](_0x2c6b80);});}_0x565d0a[_0x11d6('0x88')]=_[_0x11d6('0x89')](_0x4fd519[_0x11d6('0x80')],[_0x11d6('0x7b')],[_0x11d6('0x8a')]);if(_0x565d0a[_0x11d6('0x81')][_0x11d6('0x80')]){delete _0x565d0a[_0x11d6('0x81')][_0x11d6('0x80')];}return db[_0x11d6('0x8b')][_0x11d6('0x60')]()[_0x11d6('0x32')](function(_0x30dcca){if(!_0x30dcca){throw new db[(_0x11d6('0x8c'))][(_0x11d6('0x8d'))]('no\x20available\x20attributes');}_0x5c67d4=_[_0x11d6('0x8e')](_[_0x11d6('0x40')](_0x30dcca),[_0x11d6('0x8f'),_0x11d6('0x90')]);_0x437f06=_[_0x11d6('0x8e')](_[_0x11d6('0x40')](_0x30dcca),[_0x11d6('0x8f'),_0x11d6('0x90'),_0x11d6('0x91'),_0x11d6('0x92')]);_0x565d0a[_0x11d6('0x58')]={'mapKey':_0x11d6('0x93')};if(_0x565d0a[_0x11d6('0x81')]&&_0x565d0a['account'][_0x11d6('0x3d')]===_0x11d6('0x94')){_0x565d0a['body'][_0x11d6('0x95')]=_0x25ff8f['body'][_0x11d6('0x96')][_0x11d6('0x97')]('whatsapp:','');_0x565d0a[_0x11d6('0x58')]['body']=_0x25ff8f[_0x11d6('0x58')][_0x11d6('0x98')];_0x565d0a[_0x11d6('0x58')][_0x11d6('0x99')]=_0x25ff8f[_0x11d6('0x58')]['MessageSid'];}if(_0x565d0a[_0x11d6('0x81')]&&_0x565d0a['account'][_0x11d6('0x3d')]===_0x11d6('0x9a')){_0x565d0a['body'][_0x11d6('0x95')]=_0x25ff8f[_0x11d6('0x58')][_0x11d6('0x9b')][0x0]['from'];_0x565d0a[_0x11d6('0x58')][_0x11d6('0x58')]=_0x25ff8f[_0x11d6('0x58')][_0x11d6('0x9b')][0x0][_0x11d6('0x22')][_0x11d6('0x58')];_0x565d0a[_0x11d6('0x58')]['messageId']=_0x25ff8f[_0x11d6('0x58')][_0x11d6('0x9b')][0x0][_0x11d6('0x87')];}if(_0x565d0a[_0x11d6('0x58')]['id']){delete _0x565d0a[_0x11d6('0x58')]['id'];}if(_[_0x11d6('0x9c')](_0x565d0a['body'][_0x11d6('0x95')])){throw new db[(_0x11d6('0x8c'))][(_0x11d6('0x8d'))](_0x11d6('0x9d'));}if(_[_0x11d6('0x9c')](_0x565d0a['body'][_0x11d6('0x58')])||_0x565d0a[_0x11d6('0x58')][_0x11d6('0x58')]===''){throw new db[(_0x11d6('0x8c'))]['ValidationError'](_0x11d6('0x9e'));}if(_[_0x11d6('0x9c')](_0x565d0a['body'][_0x11d6('0x9f')])){throw new db[(_0x11d6('0x8c'))][(_0x11d6('0x8d'))](_0x11d6('0xa0')+_0x437f06);}if(!_[_0x11d6('0xa1')](_0x437f06,_0x565d0a[_0x11d6('0x58')][_0x11d6('0x9f')])){throw new db['Sequelize'][(_0x11d6('0x8d'))](_0x11d6('0xa2')+_0x437f06);}_0x845bbc[_0x565d0a['body']['mapKey']]=_0x565d0a[_0x11d6('0x58')][_0x11d6('0x95')];return db[_0x11d6('0xa3')]['find']({'where':{'id':_0x565d0a['account'][_0x11d6('0x92')]},'include':[{'model':db[_0x11d6('0x8b')],'as':_0x11d6('0xa4'),'where':_0x845bbc,'limit':0x1,'order':[[_0x11d6('0x90'),_0x11d6('0xa5')]]}]});})[_0x11d6('0x32')](handleEntityNotFound(_0x284f42,null))[_0x11d6('0x32')](function(_0x1c10f0){if(_0x1c10f0){_0x565d0a[_0x11d6('0xa6')]=_[_0x11d6('0x6d')](_0x1c10f0,['Contacts']);if(_0x1c10f0[_0x11d6('0xa4')]['length']){return _0x1c10f0['Contacts'][0x0];}var _0x514aa6=_[_0x11d6('0x15')](_0x565d0a[_0x11d6('0x58')],{'firstName':_0x565d0a[_0x11d6('0x58')]['from'],'ListId':_0x1c10f0['id']});_0x514aa6[_0x565d0a[_0x11d6('0x58')][_0x11d6('0x9f')]]=_0x565d0a[_0x11d6('0x58')][_0x11d6('0x95')];return db[_0x11d6('0x8b')]['create'](_0x514aa6,{'fields':_0x5c67d4,'raw':!![]});}})['then'](handleEntityNotFound(_0x284f42,null))[_0x11d6('0x32')](function(_0x1d33d0){if(_0x1d33d0){_0x565d0a['contact']=_0x1d33d0;var _0x2d6c13={'ContactId':_0x1d33d0['id'],'phone':_0x565d0a['body']['from'],'WhatsappAccountId':_0x25ff8f[_0x11d6('0x55')]['id']};var _0x3e71b6={'ContactId':_0x1d33d0['id'],'WhatsappAccountId':_0x25ff8f[_0x11d6('0x55')]['id'],'closed':![]};return db[_0x11d6('0xa7')][_0x11d6('0x56')]({'where':_0x3e71b6})[_0x11d6('0x32')](function(_0x60035f){if(_0x60035f){return[_0x60035f,![]];}return db[_0x11d6('0xa7')][_0x11d6('0x57')](_0x2d6c13)['then'](function(_0x4b6d56){return[_0x4b6d56,!![]];});});}})[_0x11d6('0x6e')](function(_0x1eeccd,_0x228adc){_0x565d0a['interaction']=_0x1eeccd[_0x11d6('0x34')]({'plain':!![]});_0x565d0a[_0x11d6('0xa8')][_0x11d6('0xa9')]=![];if(_0x228adc){if(_0x565d0a[_0x11d6('0x81')][_0x11d6('0xaa')]){_0x565d0a[_0x11d6('0x88')][_0x11d6('0xab')]({'id':0x0,'priority':_0x565d0a[_0x11d6('0x88')][_0x11d6('0x45')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x11d6('0xac')});}_0x565d0a[_0x11d6('0xa8')][_0x11d6('0xa9')]=!![];}return db['WhatsappMessage'][_0x11d6('0x57')]({'phone':_0x565d0a[_0x11d6('0x58')]['from'],'messageId':_0x565d0a['body'][_0x11d6('0x99')],'body':_0x565d0a['body'][_0x11d6('0x58')],'WhatsappAccountId':_0x25ff8f[_0x11d6('0x55')]['id'],'WhatsappInteractionId':_0x1eeccd['id'],'direction':'in','ContactId':_0x1eeccd[_0x11d6('0xad')],'AttachmentId':_0x565d0a[_0x11d6('0x58')][_0x11d6('0xae')]});})[_0x11d6('0x32')](function(_0x345316){_0x565d0a[_0x11d6('0x22')]=_0x345316;if(_0x565d0a[_0x11d6('0xa8')]['UserId']){return db[_0x11d6('0x72')][_0x11d6('0x56')]({'attributes':['id',_0x11d6('0x36')],'where':{'id':_0x565d0a[_0x11d6('0xa8')][_0x11d6('0xaf')]}})[_0x11d6('0x32')](function(_0x2bee4a){if(_0x2bee4a){_0x565d0a[_0x11d6('0x88')][_0x11d6('0xb0')]({'id':0x0,'priority':0x0,'app':_0x11d6('0xb1'),'appdata':_0x2bee4a[_0x11d6('0x36')]+','+(_0x565d0a[_0x11d6('0x81')][_0x11d6('0xb2')]||0xa),'interval':_0x11d6('0xac')});}return respondWithRpcPromise('Start',_0x11d6('0xb3'),_0x565d0a);});}return respondWithRpcPromise(_0x11d6('0xb4'),_0x11d6('0xb3'),_0x565d0a);})[_0x11d6('0x32')](function(_0x2d0ece){if(_0x2d0ece){var _0x1fa1ff=0xc8;var _0x7852d7=_0x11d6('0xb5');logger[_0x11d6('0x1c')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x7852d7,_0x1fa1ff,'entity\x20found');logger[_0x11d6('0xb6')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x7852d7,_0x1fa1ff,_0x11d6('0xb7'),JSON['stringify'](_0x2d0ece));if(_0x565d0a[_0x11d6('0x81')][_0x11d6('0x3d')]===_0x11d6('0x94')){return _0x284f42[_0x11d6('0x26')](_0x1fa1ff)[_0x11d6('0x2d')]('Content-Type',_0x11d6('0xb8'))[_0x11d6('0x37')](_0x11d6('0xb9'));}else{return _0x284f42['status'](_0x1fa1ff)[_0x11d6('0x28')](_0x2d0ece);}}});})[_0x11d6('0x24')](handleError(_0x284f42,null));};exports[_0x11d6('0x37')]=function(_0x15780c,_0x204a30,_0x225ec6){var _0x3b6a0a,_0x17b98d,_0x72f90f;if(_[_0x11d6('0x9c')](_0x15780c['body']['body'])||_0x15780c[_0x11d6('0x58')][_0x11d6('0x58')]===''){throw new db['Sequelize'][(_0x11d6('0x8d'))](_0x11d6('0x9e'));}if(_[_0x11d6('0x9c')](_0x15780c[_0x11d6('0x58')]['to'])){throw new db[(_0x11d6('0x8c'))][(_0x11d6('0x8d'))]('to\x20is\x20mandatory');}_0x3b6a0a=_0x15780c[_0x11d6('0x58')]['to'];return db['WhatsappAccount'][_0x11d6('0x56')]({'where':{'id':_0x15780c[_0x11d6('0x55')]['id']},'include':[{'model':db[_0x11d6('0xa3')],'as':_0x11d6('0xba'),'include':[{'model':db[_0x11d6('0x8b')],'as':_0x11d6('0xa4'),'where':{'mobile':_0x3b6a0a},'limit':0x1,'order':[[_0x11d6('0x90'),_0x11d6('0xa5')]]}]}]})[_0x11d6('0x32')](handleEntityNotFound(_0x204a30,null))[_0x11d6('0x32')](function(_0x3330bd){if(_0x3330bd&&_0x3330bd[_0x11d6('0xba')]){_0x17b98d=_0x3330bd[_0x11d6('0x34')]({'plain':!![]});if(_0x17b98d['List']&&_0x17b98d[_0x11d6('0xba')]['Contacts']['length']){return _0x17b98d[_0x11d6('0xba')]['Contacts'][0x0];}return db[_0x11d6('0x8b')][_0x11d6('0x57')](_[_0x11d6('0x15')](_0x15780c['body'],{'firstName':_0x3b6a0a,'mobile':_0x3b6a0a,'phone':_0x3b6a0a,'ListId':_0x17b98d[_0x11d6('0x92')]}));}})['then'](handleEntityNotFound(_0x204a30,null))[_0x11d6('0x32')](function(_0x4f937c){if(_0x4f937c){_0x72f90f=_0x4f937c;return db[_0x11d6('0xa7')]['find']({'where':{'ContactId':_0x72f90f['id'],'closed':![],'WhatsappAccountId':_0x17b98d['id']}})[_0x11d6('0x32')](function(_0xd0b23d){if(_0xd0b23d){return[_0xd0b23d,![]];}return db['WhatsappInteraction'][_0x11d6('0x57')]({'UserId':_0x15780c[_0x11d6('0x5b')]['id'],'ContactId':_0x72f90f['id'],'WhatsappAccountId':_0x17b98d['id'],'phone':_0x3b6a0a,'firstMsgDirection':_0x11d6('0xbb'),'Messages':[_['merge'](_0x15780c[_0x11d6('0x58')],{'read':![],'body':_0x15780c[_0x11d6('0x58')][_0x11d6('0x58')],'phone':_0x3b6a0a,'WhatsappAccountId':_0x17b98d['id'],'UserId':_0x15780c[_0x11d6('0x5b')]['id'],'ContactId':_0x72f90f['id']})]},{'include':[{'model':db[_0x11d6('0x85')],'as':_0x11d6('0xbc')}]})[_0x11d6('0x32')](function(_0x3fe35c){return[_0x3fe35c,!![]];});});}})[_0x11d6('0x6e')](function(_0x29126a,_0x1c206f){if(_0x1c206f){return _0x29126a;}return db[_0x11d6('0x85')][_0x11d6('0x57')](_[_0x11d6('0x4e')](_0x15780c[_0x11d6('0x58')],{'read':![],'body':_0x15780c['body'][_0x11d6('0x58')],'phone':_0x3b6a0a,'WhatsappAccountId':_0x17b98d['id'],'WhatsappInteractionId':_0x29126a['id'],'UserId':_0x15780c[_0x11d6('0x5b')]['id'],'ContactId':_0x72f90f['id']}))[_0x11d6('0x32')](function(_0x29ab02){_0x29126a[_0x11d6('0xbd')]['Messages']=[];_0x29126a[_0x11d6('0xbd')]['Messages']['push'](_0x29ab02[_0x11d6('0xbd')]);return _0x29126a;});})[_0x11d6('0x32')](respondWithResult(_0x204a30,null))['catch'](handleError(_0x204a30,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b68e866..41e4347 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 _0xfdc0=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x13d68b,_0x30d254){var _0x193828=function(_0x10e6d1){while(--_0x10e6d1){_0x13d68b['push'](_0x13d68b['shift']());}};_0x193828(++_0x30d254);}(_0xfdc0,0x1f0));var _0x0fdc=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0xfdc0[_0x3ef45e];return _0x69e7c;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x0fdc('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0fdc('0x1')](0x0);var events={'afterCreate':_0x0fdc('0x2'),'afterUpdate':_0x0fdc('0x3'),'afterDestroy':_0x0fdc('0x4')};function emitEvent(_0x241983){return function(_0x33588c,_0x384521,_0xdfc307){WhatsappAccountEvents[_0x0fdc('0x5')](_0x241983+':'+_0x33588c['id'],_0x33588c);WhatsappAccountEvents[_0x0fdc('0x5')](_0x241983,_0x33588c);_0xdfc307(null);};}for(var e in events){if(events[_0x0fdc('0x6')](e)){var event=events[e];WhatsappAccount[_0x0fdc('0x7')](e,emitEvent(event));}}module[_0x0fdc('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xbec1=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','hook','exports'];(function(_0x5c473d,_0x312ec3){var _0x16026c=function(_0x1afc93){while(--_0x1afc93){_0x5c473d['push'](_0x5c473d['shift']());}};_0x16026c(++_0x312ec3);}(_0xbec1,0x190));var _0x1bec=function(_0x3630d3,_0x17503c){_0x3630d3=_0x3630d3-0x0;var _0x40c088=_0xbec1[_0x3630d3];return _0x40c088;};'use strict';var EventEmitter=require(_0x1bec('0x0'));var WhatsappAccount=require(_0x1bec('0x1'))['db'][_0x1bec('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1bec('0x3')](0x0);var events={'afterCreate':_0x1bec('0x4'),'afterUpdate':_0x1bec('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2c1e23){return function(_0x58b411,_0x5ec79e,_0x5563d6){WhatsappAccountEvents['emit'](_0x2c1e23+':'+_0x58b411['id'],_0x58b411);WhatsappAccountEvents['emit'](_0x2c1e23,_0x58b411);_0x5563d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x1bec('0x6')](e,emitEvent(event));}}module[_0x1bec('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 9352ff4..5594bcd 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 _0xee2d=['api','moment','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','define','whatsapp_accounts','lodash','../../config/logger'];(function(_0x2f12f0,_0xb02c86){var _0x50afc8=function(_0x747f83){while(--_0x747f83){_0x2f12f0['push'](_0x2f12f0['shift']());}};_0x50afc8(++_0xb02c86);}(_0xee2d,0x8a));var _0xdee2=function(_0x580ff3,_0x3e5c81){_0x580ff3=_0x580ff3-0x0;var _0x578c4f=_0xee2d[_0x580ff3];return _0x578c4f;};'use strict';var _=require(_0xdee2('0x0'));var util=require('util');var logger=require(_0xdee2('0x1'))(_0xdee2('0x2'));var moment=require(_0xdee2('0x3'));var BPromise=require('bluebird');var rp=require(_0xdee2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdee2('0x5'));var config=require(_0xdee2('0x6'));var attributes=require(_0xdee2('0x7'));module['exports']=function(_0x1d533a,_0x495b53){return _0x1d533a[_0xdee2('0x8')]('WhatsappAccount',attributes,{'tableName':_0xdee2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0da=['../../config/logger','request-promise','path','rimraf','./whatsappAccount.attributes','define','whatsapp_accounts','lodash','util'];(function(_0x5c28f0,_0x2011fd){var _0x3a6389=function(_0x25307a){while(--_0x25307a){_0x5c28f0['push'](_0x5c28f0['shift']());}};_0x3a6389(++_0x2011fd);}(_0xb0da,0x11e));var _0xab0d=function(_0x1c8a38,_0x1f8f1a){_0x1c8a38=_0x1c8a38-0x0;var _0x1e8e5c=_0xb0da[_0x1c8a38];return _0x1e8e5c;};'use strict';var _=require(_0xab0d('0x0'));var util=require(_0xab0d('0x1'));var logger=require(_0xab0d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab0d('0x3'));var fs=require('fs');var path=require(_0xab0d('0x4'));var rimraf=require(_0xab0d('0x5'));var config=require('../../config/environment');var attributes=require(_0xab0d('0x6'));module['exports']=function(_0x34389d,_0x26477d){return _0x34389d[_0xab0d('0x7')]('WhatsappAccount',attributes,{'tableName':_0xab0d('0x8'),'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 1818bf0..44ac4eb 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 _0xf944=['find','options','include','map','model','attributes','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount'];(function(_0x523737,_0x266db3){var _0x1d2e9e=function(_0x5e13c2){while(--_0x5e13c2){_0x523737['push'](_0x523737['shift']());}};_0x1d2e9e(++_0x266db3);}(_0xf944,0x1a9));var _0x4f94=function(_0x426da1,_0x54d869){_0x426da1=_0x426da1-0x0;var _0x4bcde8=_0xf944[_0x426da1];return _0x4bcde8;};'use strict';var _=require(_0x4f94('0x0'));var util=require(_0x4f94('0x1'));var moment=require('moment');var BPromise=require(_0x4f94('0x2'));var rs=require(_0x4f94('0x3'));var fs=require('fs');var Redis=require(_0x4f94('0x4'));var db=require(_0x4f94('0x5'))['db'];var utils=require(_0x4f94('0x6'));var logger=require('../../config/logger')(_0x4f94('0x7'));var config=require(_0x4f94('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4f94('0x9')][_0x4f94('0xa')]({'port':0x232a});config[_0x4f94('0xb')]=_[_0x4f94('0xc')](config[_0x4f94('0xb')],{'host':_0x4f94('0xd'),'port':0x18eb});var socket=require(_0x4f94('0xe'))(new Redis(config['redis']));require(_0x4f94('0xf'))[_0x4f94('0x10')](socket);function respondWithRpcPromise(_0x1a22ea,_0x23c407,_0x32244e){return new BPromise(function(_0x5c86b2,_0x272ef6){return client[_0x4f94('0x11')](_0x1a22ea,_0x32244e)[_0x4f94('0x12')](function(_0x2e7c20){logger[_0x4f94('0x13')](_0x4f94('0x14'),_0x23c407,_0x4f94('0x15'));logger[_0x4f94('0x16')](_0x4f94('0x17'),_0x23c407,_0x4f94('0x15'),JSON[_0x4f94('0x18')](_0x2e7c20));if(_0x2e7c20['error']){if(_0x2e7c20[_0x4f94('0x19')][_0x4f94('0x1a')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x23c407,_0x2e7c20[_0x4f94('0x19')]['message']);return _0x272ef6(_0x2e7c20[_0x4f94('0x19')]['message']);}logger[_0x4f94('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x23c407,_0x2e7c20[_0x4f94('0x19')]['message']);return _0x5c86b2(_0x2e7c20['error'][_0x4f94('0x1b')]);}else{logger[_0x4f94('0x13')](_0x4f94('0x14'),_0x23c407,_0x4f94('0x15'));_0x5c86b2(_0x2e7c20[_0x4f94('0x1c')][_0x4f94('0x1b')]);}})['catch'](function(_0x23f115){logger[_0x4f94('0x19')](_0x4f94('0x14'),_0x23c407,_0x23f115);_0x272ef6(_0x23f115);});});}exports[_0x4f94('0x1d')]=function(_0xb7eebd){var _0x264645=this;return new Promise(function(_0x3a2f41,_0x132a96){return db[_0x4f94('0x1e')][_0x4f94('0x1f')]({'raw':_0xb7eebd[_0x4f94('0x20')]?_0xb7eebd[_0x4f94('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xb7eebd[_0x4f94('0x20')]?_0xb7eebd[_0x4f94('0x20')]['where']||null:null,'attributes':_0xb7eebd['options']?_0xb7eebd[_0x4f94('0x20')]['attributes']||null:null,'include':_0xb7eebd[_0x4f94('0x20')]?_0xb7eebd[_0x4f94('0x20')][_0x4f94('0x21')]?_[_0x4f94('0x22')](_0xb7eebd[_0x4f94('0x20')][_0x4f94('0x21')],function(_0x394035){return{'model':db[_0x394035[_0x4f94('0x23')]],'as':_0x394035['as'],'attributes':_0x394035['attributes'],'include':_0x394035['include']?_[_0x4f94('0x22')](_0x394035[_0x4f94('0x21')],function(_0x2ecf6a){return{'model':db[_0x2ecf6a[_0x4f94('0x23')]],'as':_0x2ecf6a['as'],'attributes':_0x2ecf6a['attributes'],'include':_0x2ecf6a[_0x4f94('0x21')]?_[_0x4f94('0x22')](_0x2ecf6a[_0x4f94('0x21')],function(_0x2eb451){return{'model':db[_0x2eb451[_0x4f94('0x23')]],'as':_0x2eb451['as'],'attributes':_0x2eb451[_0x4f94('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4f94('0x12')](function(_0x42248d){logger[_0x4f94('0x13')]('ShowWhatsappAccount',_0xb7eebd);logger['debug']('ShowWhatsappAccount',_0xb7eebd,JSON[_0x4f94('0x18')](_0x42248d));_0x3a2f41(_0x42248d);})[_0x4f94('0x25')](function(_0x35a553){logger[_0x4f94('0x19')](_0x4f94('0x1d'),_0x35a553['message'],_0xb7eebd);_0x132a96(_0x264645['error'](0x1f4,_0x35a553[_0x4f94('0x1b')]));});});}; \ No newline at end of file +var _0xa354=['./whatsappAccount.socket','request','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','model','map','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter'];(function(_0x1374fc,_0x2f35f3){var _0x1db0b0=function(_0x251a00){while(--_0x251a00){_0x1374fc['push'](_0x1374fc['shift']());}};_0x1db0b0(++_0x2f35f3);}(_0xa354,0xd6));var _0x4a35=function(_0x27abf1,_0x30901d){_0x27abf1=_0x27abf1-0x0;var _0x36b422=_0xa354[_0x27abf1];return _0x36b422;};'use strict';var _=require(_0x4a35('0x0'));var util=require(_0x4a35('0x1'));var moment=require(_0x4a35('0x2'));var BPromise=require(_0x4a35('0x3'));var rs=require(_0x4a35('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a35('0x5'))['db'];var utils=require(_0x4a35('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4a35('0x7'));var jayson=require(_0x4a35('0x8'));var client=jayson[_0x4a35('0x9')][_0x4a35('0xa')]({'port':0x232a});config['redis']=_[_0x4a35('0xb')](config[_0x4a35('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a35('0xd'))(new Redis(config[_0x4a35('0xc')]));require(_0x4a35('0xe'))['register'](socket);function respondWithRpcPromise(_0x5433c6,_0x3e3beb,_0x421d2c){return new BPromise(function(_0x1e2148,_0x5ad864){return client[_0x4a35('0xf')](_0x5433c6,_0x421d2c)['then'](function(_0x1acea5){logger['info'](_0x4a35('0x10'),_0x3e3beb,'request\x20sent');logger[_0x4a35('0x11')](_0x4a35('0x12'),_0x3e3beb,_0x4a35('0x13'),JSON[_0x4a35('0x14')](_0x1acea5));if(_0x1acea5[_0x4a35('0x15')]){if(_0x1acea5[_0x4a35('0x15')][_0x4a35('0x16')]===0x1f4){logger['error'](_0x4a35('0x10'),_0x3e3beb,_0x1acea5[_0x4a35('0x15')][_0x4a35('0x17')]);return _0x5ad864(_0x1acea5[_0x4a35('0x15')][_0x4a35('0x17')]);}logger[_0x4a35('0x15')](_0x4a35('0x10'),_0x3e3beb,_0x1acea5[_0x4a35('0x15')][_0x4a35('0x17')]);return _0x1e2148(_0x1acea5['error'][_0x4a35('0x17')]);}else{logger[_0x4a35('0x18')](_0x4a35('0x10'),_0x3e3beb,_0x4a35('0x13'));_0x1e2148(_0x1acea5[_0x4a35('0x19')][_0x4a35('0x17')]);}})[_0x4a35('0x1a')](function(_0x5bb982){logger[_0x4a35('0x15')](_0x4a35('0x10'),_0x3e3beb,_0x5bb982);_0x5ad864(_0x5bb982);});});}exports[_0x4a35('0x1b')]=function(_0x2d58a2){var _0x375a05=this;return new Promise(function(_0x3293b3,_0x4b470c){return db[_0x4a35('0x1c')][_0x4a35('0x1d')]({'raw':_0x2d58a2[_0x4a35('0x1e')]?_0x2d58a2[_0x4a35('0x1e')][_0x4a35('0x1f')]===undefined?!![]:![]:!![],'where':_0x2d58a2['options']?_0x2d58a2['options'][_0x4a35('0x20')]||null:null,'attributes':_0x2d58a2['options']?_0x2d58a2[_0x4a35('0x1e')][_0x4a35('0x21')]||null:null,'include':_0x2d58a2[_0x4a35('0x1e')]?_0x2d58a2['options'][_0x4a35('0x22')]?_['map'](_0x2d58a2['options'][_0x4a35('0x22')],function(_0x213df3){return{'model':db[_0x213df3[_0x4a35('0x23')]],'as':_0x213df3['as'],'attributes':_0x213df3[_0x4a35('0x21')],'include':_0x213df3[_0x4a35('0x22')]?_[_0x4a35('0x24')](_0x213df3[_0x4a35('0x22')],function(_0x20aac1){return{'model':db[_0x20aac1[_0x4a35('0x23')]],'as':_0x20aac1['as'],'attributes':_0x20aac1['attributes'],'include':_0x20aac1[_0x4a35('0x22')]?_[_0x4a35('0x24')](_0x20aac1[_0x4a35('0x22')],function(_0x183ff1){return{'model':db[_0x183ff1['model']],'as':_0x183ff1['as'],'attributes':_0x183ff1[_0x4a35('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4a35('0x25')](function(_0x528aa9){logger['info'](_0x4a35('0x1b'),_0x2d58a2);logger[_0x4a35('0x11')](_0x4a35('0x1b'),_0x2d58a2,JSON[_0x4a35('0x14')](_0x528aa9));_0x3293b3(_0x528aa9);})[_0x4a35('0x1a')](function(_0x41e42f){logger[_0x4a35('0x15')](_0x4a35('0x1b'),_0x41e42f[_0x4a35('0x17')],_0x2d58a2);_0x4b470c(_0x375a05[_0x4a35('0x15')](0x1f4,_0x41e42f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 15739d5..3b03006 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 _0x73b9=['whatsappAccount:','./whatsappAccount.events','save','update','emit','removeListener','register'];(function(_0x31ae21,_0x406f3d){var _0x4ffc41=function(_0x27010d){while(--_0x27010d){_0x31ae21['push'](_0x31ae21['shift']());}};_0x4ffc41(++_0x406f3d);}(_0x73b9,0x143));var _0x973b=function(_0x1c4de4,_0x45271a){_0x1c4de4=_0x1c4de4-0x0;var _0x38c8bc=_0x73b9[_0x1c4de4];return _0x38c8bc;};'use strict';var WhatsappAccountEvents=require(_0x973b('0x0'));var events=[_0x973b('0x1'),'remove',_0x973b('0x2')];function createListener(_0x2f8f25,_0x13aed9){return function(_0x585a7b){_0x13aed9[_0x973b('0x3')](_0x2f8f25,_0x585a7b);};}function removeListener(_0x5efef6,_0x3d8a1a){return function(){WhatsappAccountEvents[_0x973b('0x4')](_0x5efef6,_0x3d8a1a);};}exports[_0x973b('0x5')]=function(_0x537597){for(var _0x3cdf4b=0x0,_0x442105=events['length'];_0x3cdf4b<_0x442105;_0x3cdf4b++){var _0xf30109=events[_0x3cdf4b];var _0x1d1262=createListener(_0x973b('0x6')+_0xf30109,_0x537597);WhatsappAccountEvents['on'](_0xf30109,_0x1d1262);}}; \ No newline at end of file +var _0x2ca1=['save','remove','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x5359a2,_0x41ce31){var _0x18f21b=function(_0x82b6f5){while(--_0x82b6f5){_0x5359a2['push'](_0x5359a2['shift']());}};_0x18f21b(++_0x41ce31);}(_0x2ca1,0x117));var _0x12ca=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x2ca1[_0x3c5f8d];return _0x3b7beb;};'use strict';var WhatsappAccountEvents=require(_0x12ca('0x0'));var events=[_0x12ca('0x1'),_0x12ca('0x2'),'update'];function createListener(_0x59a623,_0x2ceea7){return function(_0x452f60){_0x2ceea7[_0x12ca('0x3')](_0x59a623,_0x452f60);};}function removeListener(_0x39bc9f,_0x1dd5d5){return function(){WhatsappAccountEvents[_0x12ca('0x4')](_0x39bc9f,_0x1dd5d5);};}exports['register']=function(_0x5f3745){for(var _0x211b35=0x0,_0x52b64c=events[_0x12ca('0x5')];_0x211b35<_0x52b64c;_0x211b35++){var _0x51db6e=events[_0x211b35];var _0xc8db9d=createListener(_0x12ca('0x6')+_0x51db6e,_0x5f3745);WhatsappAccountEvents['on'](_0x51db6e,_0xc8db9d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e6e687e..8f9951f 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 _0x2bc5=['post','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x1c48cc,_0x18581f){var _0x39272a=function(_0x3f432a){while(--_0x3f432a){_0x1c48cc['push'](_0x1c48cc['shift']());}};_0x39272a(++_0x18581f);}(_0x2bc5,0x95));var _0x52bc=function(_0x10723f,_0x1d934e){_0x10723f=_0x10723f-0x0;var _0x5b7982=_0x2bc5[_0x10723f];return _0x5b7982;};'use strict';var multer=require(_0x52bc('0x0'));var util=require(_0x52bc('0x1'));var path=require('path');var timeout=require(_0x52bc('0x2'));var express=require('express');var router=express[_0x52bc('0x3')]();var fs_extra=require(_0x52bc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x52bc('0x5'));var config=require(_0x52bc('0x6'));var controller=require('./whatsappApplication.controller');router[_0x52bc('0x7')]('/',auth[_0x52bc('0x8')](),controller['index']);router[_0x52bc('0x7')](_0x52bc('0x9'),auth[_0x52bc('0x8')](),controller[_0x52bc('0xa')]);router[_0x52bc('0xb')]('/',auth[_0x52bc('0x8')](),controller['create']);router[_0x52bc('0xc')](_0x52bc('0x9'),auth[_0x52bc('0x8')](),controller['update']);router[_0x52bc('0xd')]('/:id',auth[_0x52bc('0x8')](),controller[_0x52bc('0xe')]);module[_0x52bc('0xf')]=router; \ No newline at end of file +var _0x4e77=['get','index','/:id','isAuthenticated','show','post','create','put','update','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x4e77,0xcf));var _0x74e7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4e77[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x74e7('0x0'));var path=require('path');var timeout=require(_0x74e7('0x1'));var express=require(_0x74e7('0x2'));var router=express[_0x74e7('0x3')]();var fs_extra=require(_0x74e7('0x4'));var auth=require(_0x74e7('0x5'));var interaction=require(_0x74e7('0x6'));var config=require(_0x74e7('0x7'));var controller=require(_0x74e7('0x8'));router[_0x74e7('0x9')]('/',auth['isAuthenticated'](),controller[_0x74e7('0xa')]);router[_0x74e7('0x9')](_0x74e7('0xb'),auth[_0x74e7('0xc')](),controller[_0x74e7('0xd')]);router[_0x74e7('0xe')]('/',auth[_0x74e7('0xc')](),controller[_0x74e7('0xf')]);router[_0x74e7('0x10')](_0x74e7('0xb'),auth[_0x74e7('0xc')](),controller[_0x74e7('0x11')]);router['delete'](_0x74e7('0xb'),auth[_0x74e7('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index b53b181..3177663 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 _0x093b=['noop','TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x59dbc2,_0x1faad5){var _0x7796c7=function(_0x3aeb8b){while(--_0x3aeb8b){_0x59dbc2['push'](_0x59dbc2['shift']());}};_0x7796c7(++_0x1faad5);}(_0x093b,0x120));var _0xb093=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0x093b[_0x1529a3];return _0x1a0d4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xb093('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xb093('0x1')],'allowNull':![],'defaultValue':_0xb093('0x2')},'appdata':{'type':Sequelize[_0xb093('0x3')]()},'description':{'type':Sequelize[_0xb093('0x1')]},'interval':{'type':Sequelize[_0xb093('0x1')],'defaultValue':_0xb093('0x4')}}; \ No newline at end of file +var _0x66b2=['INTEGER','noop','STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x66b2,0xa3));var _0x266b=function(_0x4e5b7c,_0x291c10){_0x4e5b7c=_0x4e5b7c-0x0;var _0x2c89af=_0x66b2[_0x4e5b7c];return _0x2c89af;};'use strict';var Sequelize=require(_0x266b('0x0'));module[_0x266b('0x1')]={'priority':{'type':Sequelize[_0x266b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x266b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x266b('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index d9903d6..d585eb6 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 _0x86dc=['fieldName','type','query','keys','intersection','attributes','model','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','length','includeAll','find','body','catch','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes'];(function(_0x297ea6,_0x1f783d){var _0x22024b=function(_0xae32c7){while(--_0xae32c7){_0x297ea6['push'](_0x297ea6['shift']());}};_0x22024b(++_0x1f783d);}(_0x86dc,0x13e));var _0xc86d=function(_0x63d5c8,_0x151ab9){_0x63d5c8=_0x63d5c8-0x0;var _0x3b25af=_0x86dc[_0x63d5c8];return _0x3b25af;};'use strict';var emlformat=require(_0xc86d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc86d('0x1'));var rp=require(_0xc86d('0x2'));var moment=require(_0xc86d('0x3'));var BPromise=require(_0xc86d('0x4'));var Mustache=require('mustache');var util=require(_0xc86d('0x5'));var path=require('path');var sox=require(_0xc86d('0x6'));var csv=require('to-csv');var ejs=require(_0xc86d('0x7'));var fs=require('fs');var fs_extra=require(_0xc86d('0x8'));var _=require(_0xc86d('0x9'));var squel=require('squel');var crypto=require(_0xc86d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc86d('0xb'));var toCsv=require(_0xc86d('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc86d('0xd'));var authService=require(_0xc86d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc86d('0xf'));var hardwareService=require(_0xc86d('0x10'));var logger=require(_0xc86d('0x11'))(_0xc86d('0x12'));var utils=require(_0xc86d('0x13'));var config=require(_0xc86d('0x14'));var licenseUtil=require(_0xc86d('0x15'));var db=require(_0xc86d('0x16'))['db'];function respondWithStatusCode(_0x299776,_0x38abd7){_0x38abd7=_0x38abd7||0xcc;return function(_0x352469){if(_0x352469){return _0x299776[_0xc86d('0x17')](_0x38abd7);}return _0x299776[_0xc86d('0x18')](_0x38abd7)[_0xc86d('0x19')]();};}function respondWithResult(_0x450fb1,_0x2a963c){_0x2a963c=_0x2a963c||0xc8;return function(_0x176ce1){if(_0x176ce1){return _0x450fb1[_0xc86d('0x18')](_0x2a963c)[_0xc86d('0x1a')](_0x176ce1);}};}function respondWithFilteredResult(_0x24c9c3,_0x199a4a){return function(_0x5e58aa){if(_0x5e58aa){var _0x4fb8e7=typeof _0x199a4a['offset']===_0xc86d('0x1b')&&typeof _0x199a4a[_0xc86d('0x1c')]===_0xc86d('0x1b');var _0x2a9459=_0x5e58aa[_0xc86d('0x1d')];var _0x3d7e72=_0x4fb8e7?0x0:_0x199a4a[_0xc86d('0x1e')];var _0x5f3ece=_0x4fb8e7?_0x5e58aa['count']:_0x199a4a[_0xc86d('0x1e')]+_0x199a4a[_0xc86d('0x1c')];var _0x445863;if(_0x5f3ece>=_0x2a9459){_0x5f3ece=_0x2a9459;_0x445863=0xc8;}else{_0x445863=0xce;}_0x24c9c3['status'](_0x445863);return _0x24c9c3[_0xc86d('0x1f')](_0xc86d('0x20'),_0x3d7e72+'-'+_0x5f3ece+'/'+_0x2a9459)[_0xc86d('0x1a')](_0x5e58aa);}return null;};}function patchUpdates(_0x4eb0e5){return function(_0x330c70){try{jsonpatch[_0xc86d('0x21')](_0x330c70,_0x4eb0e5,!![]);}catch(_0x548f59){return BPromise[_0xc86d('0x22')](_0x548f59);}return _0x330c70[_0xc86d('0x23')]();};}function saveUpdates(_0x3a4abb,_0x27ebd8){return function(_0x57d804){if(_0x57d804){return _0x57d804[_0xc86d('0x24')](_0x3a4abb)[_0xc86d('0x25')](function(_0xad7be1){return _0xad7be1;});}return null;};}function removeEntity(_0x1bb9ed,_0xbeed40){return function(_0x56278d){if(_0x56278d){return _0x56278d[_0xc86d('0x26')]()[_0xc86d('0x25')](function(){_0x1bb9ed[_0xc86d('0x18')](0xcc)[_0xc86d('0x19')]();});}};}function handleEntityNotFound(_0x27d636,_0x5347f7){return function(_0x1458fe){if(!_0x1458fe){_0x27d636['sendStatus'](0x194);}return _0x1458fe;};}function handleError(_0x4e1312,_0x533cce){_0x533cce=_0x533cce||0x1f4;return function(_0x2782b8){logger[_0xc86d('0x27')](_0x2782b8[_0xc86d('0x28')]);if(_0x2782b8[_0xc86d('0x29')]){delete _0x2782b8[_0xc86d('0x29')];}_0x4e1312[_0xc86d('0x18')](_0x533cce)[_0xc86d('0x2a')](_0x2782b8);};}exports[_0xc86d('0x2b')]=function(_0x4db581,_0x397a55){var _0x2bce7b={},_0x581a9e={},_0x5cf11a={'count':0x0,'rows':[]};var _0x7dfc22=_[_0xc86d('0x2c')](db[_0xc86d('0x2d')][_0xc86d('0x2e')],function(_0x384bc9){return{'name':_0x384bc9[_0xc86d('0x2f')],'type':_0x384bc9[_0xc86d('0x30')]['key']};});_0x581a9e['model']=_[_0xc86d('0x2c')](_0x7dfc22,_0xc86d('0x29'));_0x581a9e[_0xc86d('0x31')]=_[_0xc86d('0x32')](_0x4db581[_0xc86d('0x31')]);_0x581a9e['filters']=_[_0xc86d('0x33')](_0x581a9e['model'],_0x581a9e[_0xc86d('0x31')]);_0x2bce7b[_0xc86d('0x34')]=_[_0xc86d('0x33')](_0x581a9e[_0xc86d('0x35')],qs[_0xc86d('0x36')](_0x4db581[_0xc86d('0x31')][_0xc86d('0x36')]));_0x2bce7b[_0xc86d('0x34')]=_0x2bce7b[_0xc86d('0x34')]['length']?_0x2bce7b['attributes']:_0x581a9e['model'];if(!_0x4db581['query']['hasOwnProperty']('nolimit')){_0x2bce7b[_0xc86d('0x1c')]=qs[_0xc86d('0x1c')](_0x4db581[_0xc86d('0x31')][_0xc86d('0x1c')]);_0x2bce7b[_0xc86d('0x1e')]=qs[_0xc86d('0x1e')](_0x4db581['query'][_0xc86d('0x1e')]);}_0x2bce7b[_0xc86d('0x37')]=qs[_0xc86d('0x38')](_0x4db581[_0xc86d('0x31')][_0xc86d('0x38')]);_0x2bce7b[_0xc86d('0x39')]=qs[_0xc86d('0x3a')](_[_0xc86d('0x3b')](_0x4db581[_0xc86d('0x31')],_0x581a9e[_0xc86d('0x3a')]),_0x7dfc22);if(_0x4db581['query'][_0xc86d('0x3c')]){_0x2bce7b['where']=_[_0xc86d('0x3d')](_0x2bce7b[_0xc86d('0x39')],{'$or':_[_0xc86d('0x2c')](_0x7dfc22,function(_0x560997){if(_0x560997[_0xc86d('0x30')]!==_0xc86d('0x3e')){var _0x3202b8={};_0x3202b8[_0x560997['name']]={'$like':'%'+_0x4db581[_0xc86d('0x31')][_0xc86d('0x3c')]+'%'};return _0x3202b8;}})});}_0x2bce7b=_[_0xc86d('0x3d')]({},_0x2bce7b,_0x4db581[_0xc86d('0x3f')]);var _0xa6a0f9={'where':_0x2bce7b['where']};return db[_0xc86d('0x2d')][_0xc86d('0x1d')](_0xa6a0f9)[_0xc86d('0x25')](function(_0x38d25e){_0x5cf11a[_0xc86d('0x1d')]=_0x38d25e;if(_0x4db581[_0xc86d('0x31')]['includeAll']){_0x2bce7b[_0xc86d('0x40')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xc86d('0x41')](_0x2bce7b);})[_0xc86d('0x25')](function(_0x39bdc7){_0x5cf11a[_0xc86d('0x42')]=_0x39bdc7;return _0x5cf11a;})['then'](respondWithFilteredResult(_0x397a55,_0x2bce7b))['catch'](handleError(_0x397a55,null));};exports['show']=function(_0x9841ff,_0x1a583b){var _0x172f7b={'raw':!![],'where':{'id':_0x9841ff['params']['id']}},_0x2c3f3d={};_0x2c3f3d[_0xc86d('0x35')]=_[_0xc86d('0x32')](db[_0xc86d('0x2d')][_0xc86d('0x2e')]);_0x2c3f3d[_0xc86d('0x31')]=_['keys'](_0x9841ff[_0xc86d('0x31')]);_0x2c3f3d[_0xc86d('0x3a')]=_[_0xc86d('0x33')](_0x2c3f3d[_0xc86d('0x35')],_0x2c3f3d['query']);_0x172f7b[_0xc86d('0x34')]=_['intersection'](_0x2c3f3d['model'],qs[_0xc86d('0x36')](_0x9841ff['query'][_0xc86d('0x36')]));_0x172f7b[_0xc86d('0x34')]=_0x172f7b[_0xc86d('0x34')][_0xc86d('0x43')]?_0x172f7b['attributes']:_0x2c3f3d[_0xc86d('0x35')];if(_0x9841ff[_0xc86d('0x31')][_0xc86d('0x44')]){_0x172f7b['include']=[{'all':!![]}];}_0x172f7b=_['merge']({},_0x172f7b,_0x9841ff[_0xc86d('0x3f')]);return db['WhatsappApplication'][_0xc86d('0x45')](_0x172f7b)[_0xc86d('0x25')](handleEntityNotFound(_0x1a583b,null))[_0xc86d('0x25')](respondWithResult(_0x1a583b,null))['catch'](handleError(_0x1a583b,null));};exports['create']=function(_0xe8a2aa,_0x21b745){return db[_0xc86d('0x2d')]['create'](_0xe8a2aa[_0xc86d('0x46')],{})['then'](respondWithResult(_0x21b745,0xc9))[_0xc86d('0x47')](handleError(_0x21b745,null));};exports[_0xc86d('0x24')]=function(_0x57231e,_0x485e8b){if(_0x57231e[_0xc86d('0x46')]['id']){delete _0x57231e['body']['id'];}return db[_0xc86d('0x2d')]['find']({'where':{'id':_0x57231e[_0xc86d('0x48')]['id']}})[_0xc86d('0x25')](handleEntityNotFound(_0x485e8b,null))[_0xc86d('0x25')](saveUpdates(_0x57231e['body'],null))['then'](respondWithResult(_0x485e8b,null))[_0xc86d('0x47')](handleError(_0x485e8b,null));};exports[_0xc86d('0x26')]=function(_0x3b5d6a,_0x1ed0fb){return db['WhatsappApplication'][_0xc86d('0x45')]({'where':{'id':_0x3b5d6a[_0xc86d('0x48')]['id']}})[_0xc86d('0x25')](handleEntityNotFound(_0x1ed0fb,null))[_0xc86d('0x25')](removeEntity(_0x1ed0fb,null))[_0xc86d('0x47')](handleError(_0x1ed0fb,null));}; \ No newline at end of file +var _0x5232=['includeAll','options','catch','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','include','WhatsappApplication','findAll','show','params'];(function(_0x5ff41b,_0x5f3133){var _0x57d3d2=function(_0x20ebd8){while(--_0x20ebd8){_0x5ff41b['push'](_0x5ff41b['shift']());}};_0x57d3d2(++_0x5f3133);}(_0x5232,0x1c9));var _0x2523=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x5232[_0x3474ac];return _0x5345ec;};'use strict';var emlformat=require(_0x2523('0x0'));var rimraf=require(_0x2523('0x1'));var zipdir=require(_0x2523('0x2'));var jsonpatch=require(_0x2523('0x3'));var rp=require(_0x2523('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2523('0x5'));var util=require(_0x2523('0x6'));var path=require('path');var sox=require(_0x2523('0x7'));var csv=require(_0x2523('0x8'));var ejs=require(_0x2523('0x9'));var fs=require('fs');var fs_extra=require(_0x2523('0xa'));var _=require(_0x2523('0xb'));var squel=require(_0x2523('0xc'));var crypto=require(_0x2523('0xd'));var jsforce=require(_0x2523('0xe'));var deskjs=require(_0x2523('0xf'));var toCsv=require(_0x2523('0x8'));var querystring=require(_0x2523('0x10'));var Papa=require(_0x2523('0x11'));var Redis=require('ioredis');var authService=require(_0x2523('0x12'));var qs=require(_0x2523('0x13'));var as=require(_0x2523('0x14'));var hardwareService=require(_0x2523('0x15'));var logger=require(_0x2523('0x16'))(_0x2523('0x17'));var utils=require('../../config/utils');var config=require(_0x2523('0x18'));var licenseUtil=require(_0x2523('0x19'));var db=require(_0x2523('0x1a'))['db'];function respondWithStatusCode(_0x99685a,_0x5176d5){_0x5176d5=_0x5176d5||0xcc;return function(_0x37f270){if(_0x37f270){return _0x99685a[_0x2523('0x1b')](_0x5176d5);}return _0x99685a['status'](_0x5176d5)[_0x2523('0x1c')]();};}function respondWithResult(_0x2cd6e1,_0xc9898b){_0xc9898b=_0xc9898b||0xc8;return function(_0xc09a01){if(_0xc09a01){return _0x2cd6e1['status'](_0xc9898b)[_0x2523('0x1d')](_0xc09a01);}};}function respondWithFilteredResult(_0x5974a6,_0x3f9b51){return function(_0x1ac5d3){if(_0x1ac5d3){var _0x173218=typeof _0x3f9b51[_0x2523('0x1e')]==='undefined'&&typeof _0x3f9b51[_0x2523('0x1f')]===_0x2523('0x20');var _0x108159=_0x1ac5d3[_0x2523('0x21')];var _0x1ce828=_0x173218?0x0:_0x3f9b51[_0x2523('0x1e')];var _0x4f2a85=_0x173218?_0x1ac5d3[_0x2523('0x21')]:_0x3f9b51[_0x2523('0x1e')]+_0x3f9b51['limit'];var _0x2819aa;if(_0x4f2a85>=_0x108159){_0x4f2a85=_0x108159;_0x2819aa=0xc8;}else{_0x2819aa=0xce;}_0x5974a6[_0x2523('0x22')](_0x2819aa);return _0x5974a6[_0x2523('0x23')](_0x2523('0x24'),_0x1ce828+'-'+_0x4f2a85+'/'+_0x108159)['json'](_0x1ac5d3);}return null;};}function patchUpdates(_0x4f94c9){return function(_0x4e9498){try{jsonpatch['apply'](_0x4e9498,_0x4f94c9,!![]);}catch(_0x1d52dc){return BPromise[_0x2523('0x25')](_0x1d52dc);}return _0x4e9498[_0x2523('0x26')]();};}function saveUpdates(_0x3baae5,_0x1c39d8){return function(_0x578a83){if(_0x578a83){return _0x578a83['update'](_0x3baae5)['then'](function(_0x50e34e){return _0x50e34e;});}return null;};}function removeEntity(_0x14a685,_0x4847c1){return function(_0x4fc304){if(_0x4fc304){return _0x4fc304['destroy']()[_0x2523('0x27')](function(){_0x14a685[_0x2523('0x22')](0xcc)[_0x2523('0x1c')]();});}};}function handleEntityNotFound(_0x393956,_0xd47858){return function(_0x5495f4){if(!_0x5495f4){_0x393956[_0x2523('0x1b')](0x194);}return _0x5495f4;};}function handleError(_0x45366f,_0x3a8b48){_0x3a8b48=_0x3a8b48||0x1f4;return function(_0x1a8b0c){logger[_0x2523('0x28')](_0x1a8b0c[_0x2523('0x29')]);if(_0x1a8b0c[_0x2523('0x2a')]){delete _0x1a8b0c[_0x2523('0x2a')];}_0x45366f[_0x2523('0x22')](_0x3a8b48)['send'](_0x1a8b0c);};}exports[_0x2523('0x2b')]=function(_0x1565a8,_0x53b772){var _0x304dd4={},_0x52b25d={},_0x4cb11f={'count':0x0,'rows':[]};var _0x5e0ada=_[_0x2523('0x2c')](db['WhatsappApplication'][_0x2523('0x2d')],function(_0x577c90){return{'name':_0x577c90[_0x2523('0x2e')],'type':_0x577c90[_0x2523('0x2f')]['key']};});_0x52b25d[_0x2523('0x30')]=_['map'](_0x5e0ada,_0x2523('0x2a'));_0x52b25d[_0x2523('0x31')]=_[_0x2523('0x32')](_0x1565a8[_0x2523('0x31')]);_0x52b25d[_0x2523('0x33')]=_[_0x2523('0x34')](_0x52b25d['model'],_0x52b25d[_0x2523('0x31')]);_0x304dd4[_0x2523('0x35')]=_[_0x2523('0x34')](_0x52b25d['model'],qs[_0x2523('0x36')](_0x1565a8['query'][_0x2523('0x36')]));_0x304dd4[_0x2523('0x35')]=_0x304dd4[_0x2523('0x35')][_0x2523('0x37')]?_0x304dd4[_0x2523('0x35')]:_0x52b25d[_0x2523('0x30')];if(!_0x1565a8[_0x2523('0x31')]['hasOwnProperty'](_0x2523('0x38'))){_0x304dd4[_0x2523('0x1f')]=qs[_0x2523('0x1f')](_0x1565a8[_0x2523('0x31')][_0x2523('0x1f')]);_0x304dd4['offset']=qs[_0x2523('0x1e')](_0x1565a8[_0x2523('0x31')][_0x2523('0x1e')]);}_0x304dd4[_0x2523('0x39')]=qs['sort'](_0x1565a8[_0x2523('0x31')]['sort']);_0x304dd4[_0x2523('0x3a')]=qs['filters'](_[_0x2523('0x3b')](_0x1565a8[_0x2523('0x31')],_0x52b25d[_0x2523('0x33')]),_0x5e0ada);if(_0x1565a8[_0x2523('0x31')][_0x2523('0x3c')]){_0x304dd4[_0x2523('0x3a')]=_[_0x2523('0x3d')](_0x304dd4[_0x2523('0x3a')],{'$or':_['map'](_0x5e0ada,function(_0x24aea8){if(_0x24aea8[_0x2523('0x2f')]!==_0x2523('0x3e')){var _0x2cd540={};_0x2cd540[_0x24aea8[_0x2523('0x2a')]]={'$like':'%'+_0x1565a8['query'][_0x2523('0x3c')]+'%'};return _0x2cd540;}})});}_0x304dd4=_[_0x2523('0x3d')]({},_0x304dd4,_0x1565a8['options']);var _0x4a5171={'where':_0x304dd4[_0x2523('0x3a')]};return db['WhatsappApplication'][_0x2523('0x21')](_0x4a5171)[_0x2523('0x27')](function(_0x200a6d){_0x4cb11f[_0x2523('0x21')]=_0x200a6d;if(_0x1565a8['query']['includeAll']){_0x304dd4[_0x2523('0x3f')]=[{'all':!![]}];}return db[_0x2523('0x40')][_0x2523('0x41')](_0x304dd4);})[_0x2523('0x27')](function(_0x14104c){_0x4cb11f['rows']=_0x14104c;return _0x4cb11f;})['then'](respondWithFilteredResult(_0x53b772,_0x304dd4))['catch'](handleError(_0x53b772,null));};exports[_0x2523('0x42')]=function(_0x19f453,_0xceff81){var _0x574e6e={'raw':!![],'where':{'id':_0x19f453[_0x2523('0x43')]['id']}},_0x24e0e1={};_0x24e0e1['model']=_[_0x2523('0x32')](db[_0x2523('0x40')][_0x2523('0x2d')]);_0x24e0e1[_0x2523('0x31')]=_[_0x2523('0x32')](_0x19f453['query']);_0x24e0e1[_0x2523('0x33')]=_[_0x2523('0x34')](_0x24e0e1[_0x2523('0x30')],_0x24e0e1[_0x2523('0x31')]);_0x574e6e['attributes']=_[_0x2523('0x34')](_0x24e0e1[_0x2523('0x30')],qs[_0x2523('0x36')](_0x19f453[_0x2523('0x31')]['fields']));_0x574e6e['attributes']=_0x574e6e[_0x2523('0x35')]['length']?_0x574e6e[_0x2523('0x35')]:_0x24e0e1[_0x2523('0x30')];if(_0x19f453[_0x2523('0x31')][_0x2523('0x44')]){_0x574e6e[_0x2523('0x3f')]=[{'all':!![]}];}_0x574e6e=_['merge']({},_0x574e6e,_0x19f453[_0x2523('0x45')]);return db[_0x2523('0x40')]['find'](_0x574e6e)[_0x2523('0x27')](handleEntityNotFound(_0xceff81,null))[_0x2523('0x27')](respondWithResult(_0xceff81,null))[_0x2523('0x46')](handleError(_0xceff81,null));};exports['create']=function(_0x337993,_0x1a1268){return db[_0x2523('0x40')][_0x2523('0x47')](_0x337993[_0x2523('0x48')],{})['then'](respondWithResult(_0x1a1268,0xc9))[_0x2523('0x46')](handleError(_0x1a1268,null));};exports[_0x2523('0x49')]=function(_0x4d0727,_0x569caa){if(_0x4d0727['body']['id']){delete _0x4d0727['body']['id'];}return db[_0x2523('0x40')][_0x2523('0x4a')]({'where':{'id':_0x4d0727[_0x2523('0x43')]['id']}})[_0x2523('0x27')](handleEntityNotFound(_0x569caa,null))[_0x2523('0x27')](saveUpdates(_0x4d0727[_0x2523('0x48')],null))[_0x2523('0x27')](respondWithResult(_0x569caa,null))['catch'](handleError(_0x569caa,null));};exports['destroy']=function(_0x5ec3e2,_0x66d07c){return db[_0x2523('0x40')]['find']({'where':{'id':_0x5ec3e2[_0x2523('0x43')]['id']}})[_0x2523('0x27')](handleEntityNotFound(_0x66d07c,null))[_0x2523('0x27')](removeEntity(_0x66d07c,null))['catch'](handleError(_0x66d07c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index b9e91fc..6144ee3 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 _0x008c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4_unicode_ci'];(function(_0x45bbbd,_0x3fce75){var _0x52e9b3=function(_0x11d183){while(--_0x11d183){_0x45bbbd['push'](_0x45bbbd['shift']());}};_0x52e9b3(++_0x3fce75);}(_0x008c,0x188));var _0xc008=function(_0x32bdd4,_0x143a69){_0x32bdd4=_0x32bdd4-0x0;var _0x4b54d3=_0x008c[_0x32bdd4];return _0x4b54d3;};'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')]('WhatsappApplication',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc008('0xd')});}; \ No newline at end of file +var _0x35aa=['path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x128322,_0x25fedb){var _0x386788=function(_0x44c5fc){while(--_0x44c5fc){_0x128322['push'](_0x128322['shift']());}};_0x386788(++_0x25fedb);}(_0x35aa,0xbe));var _0xa35a=function(_0x8d8485,_0x51d694){_0x8d8485=_0x8d8485-0x0;var _0x50569a=_0x35aa[_0x8d8485];return _0x50569a;};'use strict';var _=require('lodash');var util=require(_0xa35a('0x0'));var logger=require(_0xa35a('0x1'))(_0xa35a('0x2'));var moment=require(_0xa35a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa35a('0x4'));var fs=require('fs');var path=require(_0xa35a('0x5'));var rimraf=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var attributes=require(_0xa35a('0x8'));module[_0xa35a('0x9')]=function(_0x449cfe,_0x10917d){return _0x449cfe['define'](_0xa35a('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa35a('0xb'),'collate':_0xa35a('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index dd6ca6d..9479a61 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 _0xe5b3=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0xe5b3,0x133));var _0x3e5b=function(_0x379c40,_0x577071){_0x379c40=_0x379c40-0x0;var _0x42346d=_0xe5b3[_0x379c40];return _0x42346d;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file +var _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4a7180,_0x42434a){var _0x398f07=function(_0x56e9be){while(--_0x56e9be){_0x4a7180['push'](_0x4a7180['shift']());}};_0x398f07(++_0x42434a);}(_0xfd28,0x148));var _0x8fd2=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xfd28[_0x20a558];return _0x53d3f7;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 3d8a8a5..c44f854 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 _0x885a=['describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0x9')](_0xa885('0xd'),auth['isAuthenticated'](),controller[_0xa885('0xe')]);router[_0xa885('0x9')](_0xa885('0xf'),auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x9')](_0xa885('0x12'),auth['isAuthenticated'](),controller[_0xa885('0x13')]);router[_0xa885('0x14')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x15')]);router[_0xa885('0x14')](_0xa885('0xf'),auth[_0xa885('0x10')](),controller['addMessage']);router[_0xa885('0x14')](_0xa885('0x16'),auth[_0xa885('0x10')](),interaction[_0xa885('0x17')](_0xa885('0x18'),'whatsappinteraction:addtags'),controller[_0xa885('0x19')]);router[_0xa885('0x1a')]('/:id',auth[_0xa885('0x10')](),interaction[_0xa885('0x17')]('whatsapp',_0xa885('0x1b')),controller[_0xa885('0x1c')]);router['delete'](_0xa885('0xd'),auth['isAuthenticated'](),interaction[_0xa885('0x17')](_0xa885('0x18'),_0xa885('0x1d')),controller['destroy']);router[_0xa885('0x1e')]('/:id/tags',auth[_0xa885('0x10')](),controller[_0xa885('0x1f')]);module[_0xa885('0x20')]=router; \ No newline at end of file +var _0x0e4b=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','express','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x2d3f34,_0x2fe664){var _0x1f9e81=function(_0xdcb72f){while(--_0xdcb72f){_0x2d3f34['push'](_0x2d3f34['shift']());}};_0x1f9e81(++_0x2fe664);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x39de07,_0x59d3e3){_0x39de07=_0x39de07-0x0;var _0x5b95d5=_0x0e4b[_0x39de07];return _0x5b95d5;};'use strict';var multer=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var path=require(_0xb0e4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0e4('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(_0xb0e4('0x4'));var controller=require(_0xb0e4('0x5'));router['get']('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x7')]);router[_0xb0e4('0x8')](_0xb0e4('0x9'),auth[_0xb0e4('0x6')](),controller['describe']);router['get'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xb')]);router[_0xb0e4('0x8')](_0xb0e4('0xc'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xd')]);router[_0xb0e4('0x8')](_0xb0e4('0xe'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0xf')]);router[_0xb0e4('0x10')]('/',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x11')]);router[_0xb0e4('0x10')]('/:id/messages',auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x12')]);router['post'](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),interaction[_0xb0e4('0x14')](_0xb0e4('0x15'),_0xb0e4('0x16')),controller['addTags']);router['put'](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked'](_0xb0e4('0x15'),_0xb0e4('0x17')),controller[_0xb0e4('0x18')]);router[_0xb0e4('0x19')](_0xb0e4('0xa'),auth[_0xb0e4('0x6')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller[_0xb0e4('0x1a')]);router[_0xb0e4('0x19')](_0xb0e4('0x13'),auth[_0xb0e4('0x6')](),controller[_0xb0e4('0x1b')]);module[_0xb0e4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 5bfb20d..d2d665f 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 _0x6334=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x22d4d4,_0x10053f){var _0x1d4450=function(_0x30b106){while(--_0x30b106){_0x22d4d4['push'](_0x22d4d4['shift']());}};_0x1d4450(++_0x10053f);}(_0x6334,0x119));var _0x4633=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0x6334[_0x50af9c];return _0x5b5e5a;};'use strict';var Sequelize=require(_0x4633('0x0'));var moment=require(_0x4633('0x1'));module[_0x4633('0x2')]={'closed':{'type':Sequelize[_0x4633('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4633('0x4')]},'disposition':{'type':Sequelize[_0x4633('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4633('0x5')]},'note':{'type':Sequelize[_0x4633('0x5')]},'phone':{'type':Sequelize[_0x4633('0x5')]},'read1stAt':{'type':Sequelize[_0x4633('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4633('0x6')]('in',_0x4633('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4633('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4633('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5fc3=['sequelize','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x9b8ae4,_0x3e37fe){var _0x16749b=function(_0x53cf70){while(--_0x53cf70){_0x9b8ae4['push'](_0x9b8ae4['shift']());}};_0x16749b(++_0x3e37fe);}(_0x5fc3,0xa8));var _0x35fc=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0x5fc3[_0x325501];return _0x2c1626;};'use strict';var Sequelize=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));module['exports']={'closed':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x35fc('0x3')]},'disposition':{'type':Sequelize[_0x35fc('0x4')]},'secondDisposition':{'type':Sequelize[_0x35fc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x35fc('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x35fc('0x4')]},'read1stAt':{'type':Sequelize[_0x35fc('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x35fc('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x35fc('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 5d8d916..ee2d724 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 _0x7a81=['existsSync','createReadStream','createWriteStream','out','Contact','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','unlinkSync','rimraf','moment','bluebird','path','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update','destroy','then','name','send','map','rawAttributes','type','getOptions','findAll','whatsapp','query','catch','keys','WhatsappInteraction','filters','intersection','attributes','model','fields','length','includeAll','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','omit','ids','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','server','files','root','attachments','transcript-%d-%s.zip','push','User','fullname','firstName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','get','Owner','N.A.','closed','closedAt','disposition','basename'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a81,0x85));var _0x17a8=function(_0x47215e,_0x2d4f19){_0x47215e=_0x47215e-0x0;var _0x390f6a=_0x7a81[_0x47215e];return _0x390f6a;};'use strict';var rimraf=require(_0x17a8('0x0'));var zipdir=require('zip-dir');var moment=require(_0x17a8('0x1'));var BPromise=require(_0x17a8('0x2'));var util=require('util');var path=require(_0x17a8('0x3'));var ejs=require(_0x17a8('0x4'));var fs=require('fs');var _=require(_0x17a8('0x5'));var Redis=require(_0x17a8('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x17a8('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x17a8('0x8'))(_0x17a8('0x9'));var config=require('../../config/environment');var db=require(_0x17a8('0xa'))['db'];config[_0x17a8('0xb')]=_[_0x17a8('0xc')](config[_0x17a8('0xb')],{'host':_0x17a8('0xd'),'port':0x18eb});var socket=require(_0x17a8('0xe'))(new Redis(config[_0x17a8('0xb')]));require(_0x17a8('0xf'))[_0x17a8('0x10')](socket);function respondWithStatusCode(_0x2ea600,_0x2787f4){_0x2787f4=_0x2787f4||0xcc;return function(_0x1f5319){if(_0x1f5319){return _0x2ea600[_0x17a8('0x11')](_0x2787f4);}return _0x2ea600[_0x17a8('0x12')](_0x2787f4)[_0x17a8('0x13')]();};}function respondWithResult(_0x5413b2,_0x656d89){_0x656d89=_0x656d89||0xc8;return function(_0x493455){if(_0x493455){return _0x5413b2['status'](_0x656d89)[_0x17a8('0x14')](_0x493455);}};}function respondWithFilteredResult(_0x347831,_0x53500f){return function(_0x468b46){if(_0x468b46){var _0x4f9a3f=typeof _0x53500f['offset']===_0x17a8('0x15')&&typeof _0x53500f['limit']===_0x17a8('0x15');var _0x72f901=_0x468b46[_0x17a8('0x16')];var _0x969fbc=_0x4f9a3f?0x0:_0x53500f[_0x17a8('0x17')];var _0x14673c=_0x4f9a3f?_0x468b46[_0x17a8('0x16')]:_0x53500f['offset']+_0x53500f[_0x17a8('0x18')];var _0x43a103;if(_0x14673c>=_0x72f901){_0x14673c=_0x72f901;_0x43a103=0xc8;}else{_0x43a103=0xce;}_0x347831[_0x17a8('0x12')](_0x43a103);return _0x347831['set'](_0x17a8('0x19'),_0x969fbc+'-'+_0x14673c+'/'+_0x72f901)[_0x17a8('0x14')](_0x468b46);}return null;};}function saveUpdates(_0x15b43c){return function(_0x30020a){if(_0x30020a){return _0x30020a[_0x17a8('0x1a')](_0x15b43c)['then'](function(_0x266218){return _0x266218;});}return null;};}function removeEntity(_0x2b2164){return function(_0x2a2c8d){if(_0x2a2c8d){return _0x2a2c8d[_0x17a8('0x1b')]()[_0x17a8('0x1c')](function(){_0x2b2164['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39adbd){return function(_0x344360){if(!_0x344360){_0x39adbd[_0x17a8('0x11')](0x194);}return _0x344360;};}function handleError(_0x42a1a4,_0x5e2e46){_0x5e2e46=_0x5e2e46||0x1f4;return function(_0x3a5272){logger['error'](_0x3a5272['stack']);if(_0x3a5272[_0x17a8('0x1d')]){delete _0x3a5272[_0x17a8('0x1d')];}_0x42a1a4[_0x17a8('0x12')](_0x5e2e46)[_0x17a8('0x1e')](_0x3a5272);};}exports['index']=function(_0x87c3b7,_0x3d7c02){var _0x119b39={};var _0x3e9099=_[_0x17a8('0x1f')](db['WhatsappInteraction'][_0x17a8('0x20')],function(_0x5c19cf){return{'name':_0x5c19cf['fieldName'],'type':_0x5c19cf[_0x17a8('0x21')]['key']};});_0x119b39=qs[_0x17a8('0x22')](_0x3e9099,_0x87c3b7);return interaction[_0x17a8('0x23')](_0x17a8('0x24'),_0x87c3b7[_0x17a8('0x25')],_0x87c3b7['user'],_0x119b39,_0x3e9099)[_0x17a8('0x1c')](respondWithFilteredResult(_0x3d7c02,_0x119b39))[_0x17a8('0x26')](handleError(_0x3d7c02,null));};exports['show']=function(_0x49c5bc,_0x5a90d0){var _0x43e8da={'raw':![],'where':{'id':_0x49c5bc['params']['id']}},_0x1b047a={};_0x1b047a['model']=_[_0x17a8('0x27')](db[_0x17a8('0x28')][_0x17a8('0x20')]);_0x1b047a['query']=_[_0x17a8('0x27')](_0x49c5bc[_0x17a8('0x25')]);_0x1b047a[_0x17a8('0x29')]=_[_0x17a8('0x2a')](_0x1b047a['model'],_0x1b047a[_0x17a8('0x25')]);_0x43e8da[_0x17a8('0x2b')]=_[_0x17a8('0x2a')](_0x1b047a[_0x17a8('0x2c')],qs[_0x17a8('0x2d')](_0x49c5bc[_0x17a8('0x25')][_0x17a8('0x2d')]));_0x43e8da['attributes']=_0x43e8da['attributes'][_0x17a8('0x2e')]?_0x43e8da[_0x17a8('0x2b')]:_0x1b047a[_0x17a8('0x2c')];if(_0x49c5bc[_0x17a8('0x25')][_0x17a8('0x2f')]){_0x43e8da['include']=[{'all':!![]}];}_0x43e8da=_[_0x17a8('0x30')]({},_0x43e8da,_0x49c5bc[_0x17a8('0x31')]);return db[_0x17a8('0x28')][_0x17a8('0x32')](_0x43e8da)[_0x17a8('0x1c')](handleEntityNotFound(_0x5a90d0,null))['then'](respondWithResult(_0x5a90d0,null))['catch'](handleError(_0x5a90d0,null));};exports['create']=function(_0x1ee17f,_0xd9fcc9){return db['WhatsappInteraction'][_0x17a8('0x33')](_0x1ee17f[_0x17a8('0x34')],{})[_0x17a8('0x1c')](respondWithResult(_0xd9fcc9,0xc9))[_0x17a8('0x26')](handleError(_0xd9fcc9,null));};exports[_0x17a8('0x1a')]=function(_0x227641,_0x1c9a85){if(_0x227641[_0x17a8('0x34')]['id']){delete _0x227641[_0x17a8('0x34')]['id'];}return db[_0x17a8('0x28')]['find']({'where':{'id':_0x227641[_0x17a8('0x35')]['id']}})[_0x17a8('0x1c')](handleEntityNotFound(_0x1c9a85,null))[_0x17a8('0x1c')](saveUpdates(_0x227641[_0x17a8('0x34')],null))['then'](respondWithResult(_0x1c9a85,null))[_0x17a8('0x26')](handleError(_0x1c9a85,null));};exports[_0x17a8('0x1b')]=function(_0x2f8ce6,_0x5c3b5b){return db[_0x17a8('0x28')][_0x17a8('0x32')]({'where':{'id':_0x2f8ce6[_0x17a8('0x35')]['id']}})['then'](handleEntityNotFound(_0x5c3b5b,null))[_0x17a8('0x1c')](removeEntity(_0x5c3b5b,null))[_0x17a8('0x26')](handleError(_0x5c3b5b,null));};exports['describe']=function(_0x6f70c9,_0x473468){return db[_0x17a8('0x28')][_0x17a8('0x36')]()[_0x17a8('0x1c')](respondWithResult(_0x473468,null))['catch'](handleError(_0x473468,null));};exports[_0x17a8('0x37')]=function(_0xdbe009,_0x3643cd){return db[_0x17a8('0x38')][_0x17a8('0x32')]({'where':{'id':_0xdbe009[_0x17a8('0x35')]['id']}})[_0x17a8('0x1c')](handleEntityNotFound(_0x3643cd,null))['then'](function(_0x2018e2){if(_0x2018e2){return _0x2018e2[_0x17a8('0x37')](_0xdbe009['body']['ids'],_[_0x17a8('0x39')](_0xdbe009[_0x17a8('0x34')],[_0x17a8('0x3a'),'id'])||{});}})[_0x17a8('0x1c')](respondWithResult(_0x3643cd,null))[_0x17a8('0x26')](handleError(_0x3643cd,null));};exports['getMessages']=function(_0x53ccb9,_0x1406e2){var _0x31fa45={'raw':![],'where':{}};var _0xf4b00a={};var _0x453186={'count':0x0,'rows':[]};return db[_0x17a8('0x28')]['findOne']({'where':{'id':_0x53ccb9['params']['id']}})[_0x17a8('0x1c')](handleEntityNotFound(_0x1406e2,null))[_0x17a8('0x1c')](function(_0x50306f){if(_0x50306f){_0xf4b00a[_0x17a8('0x2c')]=_[_0x17a8('0x27')](db[_0x17a8('0x38')][_0x17a8('0x20')]);_0xf4b00a['query']=_[_0x17a8('0x27')](_0x53ccb9[_0x17a8('0x25')]);_0xf4b00a[_0x17a8('0x29')]=_[_0x17a8('0x2a')](_0xf4b00a[_0x17a8('0x2c')],_0xf4b00a[_0x17a8('0x25')]);_0x31fa45[_0x17a8('0x2b')]=_['intersection'](_0xf4b00a[_0x17a8('0x2c')],qs['fields'](_0x53ccb9['query'][_0x17a8('0x2d')]));_0x31fa45['attributes']=_0x31fa45[_0x17a8('0x2b')]['length']?_0x31fa45[_0x17a8('0x2b')]:_0xf4b00a['model'];if(!_0x53ccb9['query'][_0x17a8('0x3b')](_0x17a8('0x3c'))){_0x31fa45['limit']=qs[_0x17a8('0x18')](_0x53ccb9[_0x17a8('0x25')][_0x17a8('0x18')]);_0x31fa45[_0x17a8('0x17')]=qs[_0x17a8('0x17')](_0x53ccb9[_0x17a8('0x25')][_0x17a8('0x17')]);}_0x31fa45[_0x17a8('0x3d')]=qs[_0x17a8('0x3e')](_0x53ccb9['query'][_0x17a8('0x3e')]);_0x31fa45[_0x17a8('0x3f')]=qs[_0x17a8('0x29')](_['pick'](_0x53ccb9[_0x17a8('0x25')],_0xf4b00a['filters']));_0x31fa45['where'][_0x17a8('0x40')]=_0x50306f['id'];if(_0x53ccb9[_0x17a8('0x25')][_0x17a8('0x41')]){_0x31fa45[_0x17a8('0x3f')]=_[_0x17a8('0x30')](_0x31fa45[_0x17a8('0x3f')],{'$or':_['map'](_0x31fa45[_0x17a8('0x2b')],function(_0x52f405){var _0x3fd2be={};_0x3fd2be[_0x52f405]={'$like':'%'+_0x53ccb9[_0x17a8('0x25')][_0x17a8('0x41')]+'%'};return _0x3fd2be;})});}if(_0x53ccb9[_0x17a8('0x25')][_0x17a8('0x42')]){var _0x28be72=_0x53ccb9[_0x17a8('0x25')][_0x17a8('0x42')]['split'](',');var _0xf76282={};_0xf76282[_0x28be72[0x0]]={'$gte':moment(_0x28be72[0x1])[_0x17a8('0x43')](_0x17a8('0x44'))};_0x31fa45['where']=_[_0x17a8('0x30')](_0x31fa45['where'],_0xf76282);}_0x31fa45=_[_0x17a8('0x30')]({},_0x31fa45,_0x53ccb9[_0x17a8('0x31')]);return db['WhatsappMessage'][_0x17a8('0x16')]({'where':_0x31fa45['where']})[_0x17a8('0x1c')](function(_0x262bfd){_0x453186[_0x17a8('0x16')]=_0x262bfd;if(_0x53ccb9['query'][_0x17a8('0x2f')]){_0x31fa45[_0x17a8('0x45')]=[{'all':!![]}];}return db[_0x17a8('0x38')]['findAll'](_0x31fa45);})[_0x17a8('0x1c')](function(_0x401bd6){_0x453186[_0x17a8('0x46')]=_0x401bd6;return _0x453186;});}})['then'](respondWithFilteredResult(_0x1406e2,_0x31fa45))[_0x17a8('0x26')](handleError(_0x1406e2,null));};exports[_0x17a8('0x47')]=function(_0x3b8ff0,_0xa7cd8c){return db[_0x17a8('0x28')][_0x17a8('0x32')]({'where':{'id':_0x3b8ff0[_0x17a8('0x35')]['id']}})[_0x17a8('0x1c')](handleEntityNotFound(_0xa7cd8c,null))[_0x17a8('0x1c')](function(_0x307d2a){if(_0x307d2a){return _0x307d2a[_0x17a8('0x48')](_0x3b8ff0['body'][_0x17a8('0x3a')],_['omit'](_0x3b8ff0[_0x17a8('0x34')],[_0x17a8('0x3a'),'id'])||{})[_0x17a8('0x49')](function(){return db[_0x17a8('0x4a')][_0x17a8('0x23')]({'attributes':['id',_0x17a8('0x1d'),_0x17a8('0x4b')],'where':{'id':_0x3b8ff0['body'][_0x17a8('0x3a')]}});})['then'](function(_0x553375){socket[_0x17a8('0x4c')](_0x17a8('0x4d'),{'id':Number(_0x3b8ff0[_0x17a8('0x35')]['id']),'tags':_0x553375||[]});return{'id':Number(_0x3b8ff0[_0x17a8('0x35')]['id']),'tags':_0x553375||[]};});}})[_0x17a8('0x1c')](respondWithResult(_0xa7cd8c,null))[_0x17a8('0x26')](handleError(_0xa7cd8c,null));};exports[_0x17a8('0x4e')]=function(_0x275060,_0x48a92e){return db[_0x17a8('0x28')][_0x17a8('0x32')]({'where':{'id':_0x275060[_0x17a8('0x35')]['id']}})[_0x17a8('0x1c')](handleEntityNotFound(_0x48a92e,null))[_0x17a8('0x1c')](function(_0xab517c){if(_0xab517c){return _0xab517c[_0x17a8('0x4e')](_0x275060[_0x17a8('0x25')][_0x17a8('0x3a')]);}})[_0x17a8('0x1c')](respondWithStatusCode(_0x48a92e,null))['catch'](handleError(_0x48a92e,null));};exports[_0x17a8('0x4f')]=function(_0x1716dd,_0x37af92){var _0x75eab9=moment()[_0x17a8('0x50')]()[_0x17a8('0x51')]();var _0x9e3805=path[_0x17a8('0x52')](config['root'],_0x17a8('0x53'),_0x17a8('0x54'),'tmp');var _0x422403=path[_0x17a8('0x52')](config[_0x17a8('0x55')],_0x17a8('0x53'),'files',_0x17a8('0x56'));var _0x108269=path['join'](_0x9e3805,_0x75eab9);var _0x4add16=util[_0x17a8('0x43')](_0x17a8('0x57'),_0x1716dd[_0x17a8('0x35')]['id'],_0x75eab9);var _0x2a7a55=path['join'](_0x9e3805,_0x4add16);var _0x20c879=[];_0x20c879[_0x17a8('0x58')]({'model':db[_0x17a8('0x59')],'as':_0x17a8('0x59'),'attributes':['id',_0x17a8('0x5a')],'raw':!![]});_0x20c879[_0x17a8('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x17a8('0x5b'),'lastName'],'raw':!![]});if(_0x1716dd[_0x17a8('0x25')]['attachments']){_0x20c879[_0x17a8('0x58')]({'model':db['Attachment'],'as':_0x17a8('0x5c'),'raw':!![]});}var _0x121592=[{'model':db[_0x17a8('0x38')],'as':_0x17a8('0x5d'),'attributes':['id',_0x17a8('0x34'),_0x17a8('0x5e'),_0x17a8('0x5f'),_0x17a8('0x60'),'read'],'include':_0x20c879}];_0x121592[_0x17a8('0x58')]({'model':db[_0x17a8('0x61')],'as':'Account','attributes':['id','name']});_0x121592[_0x17a8('0x58')]({'model':db[_0x17a8('0x59')],'as':'Owner','attributes':['id',_0x17a8('0x5a')]});return db[_0x17a8('0x28')][_0x17a8('0x32')]({'where':{'id':_0x1716dd[_0x17a8('0x35')]['id']},'include':_0x121592})[_0x17a8('0x1c')](handleEntityNotFound(_0x37af92,null))[_0x17a8('0x1c')](function(_0x52a6b5){if(_0x52a6b5){var _0x107350=_0x52a6b5[_0x17a8('0x62')]({'plain':!![]});fs['mkdirSync'](_0x108269);var _0x2f76b9={'channel':'Whatsapp','account':_0x107350['Account'][_0x17a8('0x1d')],'agent':_0x107350['Owner']?_0x107350[_0x17a8('0x63')][_0x17a8('0x5a')]:_0x17a8('0x64'),'createdAt':moment(_0x107350[_0x17a8('0x5e')])[_0x17a8('0x43')](_0x17a8('0x44'))[_0x17a8('0x51')](),'closedAt':_0x107350[_0x17a8('0x65')]?moment(_0x107350[_0x17a8('0x66')])[_0x17a8('0x43')](_0x17a8('0x44'))[_0x17a8('0x51')]():'','disposition':_0x107350[_0x17a8('0x67')],'messages':_(_0x107350[_0x17a8('0x5d')])[_0x17a8('0x41')]({'secret':![]})[_0x17a8('0x1f')](function(_0x1f63ef){if(_0x1f63ef[_0x17a8('0x5c')]){var _0x1e0f76=path[_0x17a8('0x52')](_0x422403,_0x1f63ef[_0x17a8('0x5c')][_0x17a8('0x68')]);if(fs[_0x17a8('0x69')](_0x1e0f76)){fs[_0x17a8('0x6a')](_0x1e0f76)['pipe'](fs[_0x17a8('0x6b')](path[_0x17a8('0x52')](_0x108269,_0x1f63ef[_0x17a8('0x5c')]['basename'])));}}return{'date':moment(_0x1f63ef['createdAt'])[_0x17a8('0x43')](_0x17a8('0x44'))[_0x17a8('0x51')](),'sender':_0x1f63ef[_0x17a8('0x5f')]===_0x17a8('0x6c')?_0x1f63ef['User']?_0x1f63ef[_0x17a8('0x59')][_0x17a8('0x5a')]:'System':_0x1f63ef[_0x17a8('0x6d')][_0x17a8('0x5b')]+(_0x1f63ef[_0x17a8('0x6d')][_0x17a8('0x6e')]?'\x20'+_0x1f63ef[_0x17a8('0x6d')]['lastName']:''),'body':_0x1f63ef['Attachment']?_0x1f63ef[_0x17a8('0x5c')][_0x17a8('0x68')]:_0x1f63ef['body'],'direction':_0x1f63ef['direction']==='out'?'A':'C','secret':_0x1f63ef['secret'],'read':_0x1f63ef['read'],'attachment':_0x1f63ef[_0x17a8('0x5c')]};})['value']()};return ejs[_0x17a8('0x6f')](path['join'](config[_0x17a8('0x55')],_0x17a8('0x53'),_0x17a8('0x70'),_0x17a8('0x71')),{'interaction':_0x2f76b9})[_0x17a8('0x1c')](function(_0x5a1aff){var _0x14c3ab=path[_0x17a8('0x52')](_0x108269,_0x17a8('0x72')+_0x107350['id']+'-'+_0x75eab9+_0x17a8('0x73'));var _0x25687b={'path':_0x14c3ab,'channel':_0x17a8('0x74'),'interactionId':_0x107350['id']};return pdf[_0x17a8('0x75')](_0x5a1aff,_0x25687b);})[_0x17a8('0x1c')](function(){return new BPromise(function(_0x32f0f5,_0x28eeab){zipdir(_0x108269,{'saveTo':_0x2a7a55},function(_0x4de95e,_0x42dfec){if(_0x4de95e)return _0x28eeab(_0x4de95e);return _0x32f0f5(_0x42dfec);});})[_0x17a8('0x1c')](function(){return new BPromise(function(_0x48db80,_0x5542a2){rimraf(_0x108269,function(_0x5c9fb8){if(_0x5c9fb8)_0x5542a2(_0x5c9fb8);return _0x48db80();});});})[_0x17a8('0x1c')](function(){return _0x37af92[_0x17a8('0x4f')](_0x2a7a55,_0x4add16,function(_0x2a7b36){if(_0x2a7b36){console['log']('err',_0x2a7b36);}else{fs[_0x17a8('0x76')](_0x2a7a55);}});});});}else{return _0x37af92['sendStatus'](0xc8);}})[_0x17a8('0x26')](handleError(_0x37af92,null));}; \ No newline at end of file +var _0xd7a4=['rimraf','zip-dir','bluebird','util','path','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus','stack','send','index','map','WhatsappInteraction','fieldName','type','key','getOptions','findAll','whatsapp','query','user','then','catch','params','model','keys','rawAttributes','filters','intersection','fields','length','attributes','includeAll','include','merge','create','body','find','describe','addMessage','WhatsappMessage','omit','getMessages','findOne','nolimit','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','ids','spread','Tag','name','emit','whatsappInteractionTags:save','removeTags','join','files','root','server','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','toString','System','lastName','out','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log'];(function(_0x12e073,_0x2a6387){var _0x17e67b=function(_0x61b780){while(--_0x61b780){_0x12e073['push'](_0x12e073['shift']());}};_0x17e67b(++_0x2a6387);}(_0xd7a4,0x7e));var _0x4d7a=function(_0xa298a2,_0x45b471){_0xa298a2=_0xa298a2-0x0;var _0x530b9f=_0xd7a4[_0xa298a2];return _0x530b9f;};'use strict';var rimraf=require(_0x4d7a('0x0'));var zipdir=require(_0x4d7a('0x1'));var moment=require('moment');var BPromise=require(_0x4d7a('0x2'));var util=require(_0x4d7a('0x3'));var path=require(_0x4d7a('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d7a('0x5'));var Redis=require('ioredis');var interaction=require(_0x4d7a('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4d7a('0x7'));var logger=require(_0x4d7a('0x8'))(_0x4d7a('0x9'));var config=require(_0x4d7a('0xa'));var db=require(_0x4d7a('0xb'))['db'];config[_0x4d7a('0xc')]=_[_0x4d7a('0xd')](config[_0x4d7a('0xc')],{'host':_0x4d7a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d7a('0xc')]));require('./whatsappInteraction.socket')[_0x4d7a('0xf')](socket);function respondWithStatusCode(_0xddb648,_0x5badc5){_0x5badc5=_0x5badc5||0xcc;return function(_0x555c3a){if(_0x555c3a){return _0xddb648['sendStatus'](_0x5badc5);}return _0xddb648[_0x4d7a('0x10')](_0x5badc5)[_0x4d7a('0x11')]();};}function respondWithResult(_0x28c011,_0x37d2c0){_0x37d2c0=_0x37d2c0||0xc8;return function(_0x15f137){if(_0x15f137){return _0x28c011[_0x4d7a('0x10')](_0x37d2c0)[_0x4d7a('0x12')](_0x15f137);}};}function respondWithFilteredResult(_0x65905,_0x183fe1){return function(_0x1e8d6d){if(_0x1e8d6d){var _0x29edf3=typeof _0x183fe1[_0x4d7a('0x13')]===_0x4d7a('0x14')&&typeof _0x183fe1[_0x4d7a('0x15')]===_0x4d7a('0x14');var _0x4db1b0=_0x1e8d6d[_0x4d7a('0x16')];var _0x3670ef=_0x29edf3?0x0:_0x183fe1[_0x4d7a('0x13')];var _0x481fdf=_0x29edf3?_0x1e8d6d[_0x4d7a('0x16')]:_0x183fe1[_0x4d7a('0x13')]+_0x183fe1[_0x4d7a('0x15')];var _0x37fb31;if(_0x481fdf>=_0x4db1b0){_0x481fdf=_0x4db1b0;_0x37fb31=0xc8;}else{_0x37fb31=0xce;}_0x65905[_0x4d7a('0x10')](_0x37fb31);return _0x65905[_0x4d7a('0x17')](_0x4d7a('0x18'),_0x3670ef+'-'+_0x481fdf+'/'+_0x4db1b0)[_0x4d7a('0x12')](_0x1e8d6d);}return null;};}function saveUpdates(_0x392588){return function(_0x5d6407){if(_0x5d6407){return _0x5d6407[_0x4d7a('0x19')](_0x392588)['then'](function(_0x2b27cb){return _0x2b27cb;});}return null;};}function removeEntity(_0xd4da09){return function(_0x450f36){if(_0x450f36){return _0x450f36[_0x4d7a('0x1a')]()['then'](function(){_0xd4da09[_0x4d7a('0x10')](0xcc)[_0x4d7a('0x11')]();});}};}function handleEntityNotFound(_0x129ab5){return function(_0x288d5e){if(!_0x288d5e){_0x129ab5[_0x4d7a('0x1b')](0x194);}return _0x288d5e;};}function handleError(_0x4538e4,_0x1adba0){_0x1adba0=_0x1adba0||0x1f4;return function(_0x2eb19b){logger['error'](_0x2eb19b[_0x4d7a('0x1c')]);if(_0x2eb19b['name']){delete _0x2eb19b['name'];}_0x4538e4[_0x4d7a('0x10')](_0x1adba0)[_0x4d7a('0x1d')](_0x2eb19b);};}exports[_0x4d7a('0x1e')]=function(_0x438ec7,_0x38e38a){var _0x256f4f={};var _0x29f84f=_[_0x4d7a('0x1f')](db[_0x4d7a('0x20')]['rawAttributes'],function(_0x3631b0){return{'name':_0x3631b0[_0x4d7a('0x21')],'type':_0x3631b0[_0x4d7a('0x22')][_0x4d7a('0x23')]};});_0x256f4f=qs[_0x4d7a('0x24')](_0x29f84f,_0x438ec7);return interaction[_0x4d7a('0x25')](_0x4d7a('0x26'),_0x438ec7[_0x4d7a('0x27')],_0x438ec7[_0x4d7a('0x28')],_0x256f4f,_0x29f84f)[_0x4d7a('0x29')](respondWithFilteredResult(_0x38e38a,_0x256f4f))[_0x4d7a('0x2a')](handleError(_0x38e38a,null));};exports['show']=function(_0x2840c7,_0xfbb503){var _0x5bae65={'raw':![],'where':{'id':_0x2840c7[_0x4d7a('0x2b')]['id']}},_0x464595={};_0x464595[_0x4d7a('0x2c')]=_[_0x4d7a('0x2d')](db['WhatsappInteraction'][_0x4d7a('0x2e')]);_0x464595['query']=_['keys'](_0x2840c7['query']);_0x464595[_0x4d7a('0x2f')]=_[_0x4d7a('0x30')](_0x464595['model'],_0x464595[_0x4d7a('0x27')]);_0x5bae65['attributes']=_[_0x4d7a('0x30')](_0x464595[_0x4d7a('0x2c')],qs[_0x4d7a('0x31')](_0x2840c7[_0x4d7a('0x27')][_0x4d7a('0x31')]));_0x5bae65['attributes']=_0x5bae65['attributes'][_0x4d7a('0x32')]?_0x5bae65[_0x4d7a('0x33')]:_0x464595[_0x4d7a('0x2c')];if(_0x2840c7[_0x4d7a('0x27')][_0x4d7a('0x34')]){_0x5bae65[_0x4d7a('0x35')]=[{'all':!![]}];}_0x5bae65=_[_0x4d7a('0x36')]({},_0x5bae65,_0x2840c7['options']);return db[_0x4d7a('0x20')]['find'](_0x5bae65)[_0x4d7a('0x29')](handleEntityNotFound(_0xfbb503,null))[_0x4d7a('0x29')](respondWithResult(_0xfbb503,null))[_0x4d7a('0x2a')](handleError(_0xfbb503,null));};exports[_0x4d7a('0x37')]=function(_0x144c34,_0x2b38dd){return db['WhatsappInteraction'][_0x4d7a('0x37')](_0x144c34[_0x4d7a('0x38')],{})[_0x4d7a('0x29')](respondWithResult(_0x2b38dd,0xc9))['catch'](handleError(_0x2b38dd,null));};exports[_0x4d7a('0x19')]=function(_0x38ae66,_0x3a4037){if(_0x38ae66[_0x4d7a('0x38')]['id']){delete _0x38ae66['body']['id'];}return db[_0x4d7a('0x20')][_0x4d7a('0x39')]({'where':{'id':_0x38ae66['params']['id']}})[_0x4d7a('0x29')](handleEntityNotFound(_0x3a4037,null))[_0x4d7a('0x29')](saveUpdates(_0x38ae66[_0x4d7a('0x38')],null))[_0x4d7a('0x29')](respondWithResult(_0x3a4037,null))[_0x4d7a('0x2a')](handleError(_0x3a4037,null));};exports[_0x4d7a('0x1a')]=function(_0x1734c1,_0x37a09e){return db[_0x4d7a('0x20')]['find']({'where':{'id':_0x1734c1[_0x4d7a('0x2b')]['id']}})[_0x4d7a('0x29')](handleEntityNotFound(_0x37a09e,null))[_0x4d7a('0x29')](removeEntity(_0x37a09e,null))[_0x4d7a('0x2a')](handleError(_0x37a09e,null));};exports[_0x4d7a('0x3a')]=function(_0xa1671,_0x3795e6){return db[_0x4d7a('0x20')]['describe']()[_0x4d7a('0x29')](respondWithResult(_0x3795e6,null))[_0x4d7a('0x2a')](handleError(_0x3795e6,null));};exports[_0x4d7a('0x3b')]=function(_0x4523c3,_0x24d14d){return db[_0x4d7a('0x3c')][_0x4d7a('0x39')]({'where':{'id':_0x4523c3[_0x4d7a('0x2b')]['id']}})[_0x4d7a('0x29')](handleEntityNotFound(_0x24d14d,null))[_0x4d7a('0x29')](function(_0x2c3eda){if(_0x2c3eda){return _0x2c3eda['addMessage'](_0x4523c3[_0x4d7a('0x38')]['ids'],_[_0x4d7a('0x3d')](_0x4523c3[_0x4d7a('0x38')],['ids','id'])||{});}})[_0x4d7a('0x29')](respondWithResult(_0x24d14d,null))['catch'](handleError(_0x24d14d,null));};exports[_0x4d7a('0x3e')]=function(_0x1deee0,_0x5e527c){var _0x2753c1={'raw':![],'where':{}};var _0x1a2974={};var _0x5554a4={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x4d7a('0x3f')]({'where':{'id':_0x1deee0['params']['id']}})[_0x4d7a('0x29')](handleEntityNotFound(_0x5e527c,null))[_0x4d7a('0x29')](function(_0x1f7f8d){if(_0x1f7f8d){_0x1a2974['model']=_['keys'](db['WhatsappMessage'][_0x4d7a('0x2e')]);_0x1a2974[_0x4d7a('0x27')]=_['keys'](_0x1deee0[_0x4d7a('0x27')]);_0x1a2974['filters']=_['intersection'](_0x1a2974['model'],_0x1a2974[_0x4d7a('0x27')]);_0x2753c1[_0x4d7a('0x33')]=_[_0x4d7a('0x30')](_0x1a2974[_0x4d7a('0x2c')],qs['fields'](_0x1deee0[_0x4d7a('0x27')]['fields']));_0x2753c1['attributes']=_0x2753c1[_0x4d7a('0x33')][_0x4d7a('0x32')]?_0x2753c1['attributes']:_0x1a2974[_0x4d7a('0x2c')];if(!_0x1deee0['query']['hasOwnProperty'](_0x4d7a('0x40'))){_0x2753c1[_0x4d7a('0x15')]=qs[_0x4d7a('0x15')](_0x1deee0[_0x4d7a('0x27')]['limit']);_0x2753c1['offset']=qs[_0x4d7a('0x13')](_0x1deee0['query'][_0x4d7a('0x13')]);}_0x2753c1[_0x4d7a('0x41')]=qs[_0x4d7a('0x42')](_0x1deee0[_0x4d7a('0x27')][_0x4d7a('0x42')]);_0x2753c1[_0x4d7a('0x43')]=qs[_0x4d7a('0x2f')](_['pick'](_0x1deee0[_0x4d7a('0x27')],_0x1a2974['filters']));_0x2753c1[_0x4d7a('0x43')]['WhatsappInteractionId']=_0x1f7f8d['id'];if(_0x1deee0[_0x4d7a('0x27')]['filter']){_0x2753c1['where']=_[_0x4d7a('0x36')](_0x2753c1[_0x4d7a('0x43')],{'$or':_['map'](_0x2753c1[_0x4d7a('0x33')],function(_0x2b87e0){var _0x4cfd61={};_0x4cfd61[_0x2b87e0]={'$like':'%'+_0x1deee0[_0x4d7a('0x27')][_0x4d7a('0x44')]+'%'};return _0x4cfd61;})});}if(_0x1deee0[_0x4d7a('0x27')][_0x4d7a('0x45')]){var _0x58c895=_0x1deee0[_0x4d7a('0x27')]['$gte'][_0x4d7a('0x46')](',');var _0x1619d5={};_0x1619d5[_0x58c895[0x0]]={'$gte':moment(_0x58c895[0x1])[_0x4d7a('0x47')](_0x4d7a('0x48'))};_0x2753c1[_0x4d7a('0x43')]=_[_0x4d7a('0x36')](_0x2753c1[_0x4d7a('0x43')],_0x1619d5);}_0x2753c1=_[_0x4d7a('0x36')]({},_0x2753c1,_0x1deee0[_0x4d7a('0x49')]);return db[_0x4d7a('0x3c')][_0x4d7a('0x16')]({'where':_0x2753c1[_0x4d7a('0x43')]})['then'](function(_0x85382c){_0x5554a4[_0x4d7a('0x16')]=_0x85382c;if(_0x1deee0['query'][_0x4d7a('0x34')]){_0x2753c1[_0x4d7a('0x35')]=[{'all':!![]}];}return db[_0x4d7a('0x3c')][_0x4d7a('0x25')](_0x2753c1);})[_0x4d7a('0x29')](function(_0x5f376b){_0x5554a4['rows']=_0x5f376b;return _0x5554a4;});}})['then'](respondWithFilteredResult(_0x5e527c,_0x2753c1))['catch'](handleError(_0x5e527c,null));};exports[_0x4d7a('0x4a')]=function(_0x58dff6,_0x560b33){return db['WhatsappInteraction']['find']({'where':{'id':_0x58dff6['params']['id']}})[_0x4d7a('0x29')](handleEntityNotFound(_0x560b33,null))[_0x4d7a('0x29')](function(_0x388894){if(_0x388894){return _0x388894[_0x4d7a('0x4b')](_0x58dff6['body']['ids'],_['omit'](_0x58dff6[_0x4d7a('0x38')],[_0x4d7a('0x4c'),'id'])||{})[_0x4d7a('0x4d')](function(){return db[_0x4d7a('0x4e')][_0x4d7a('0x25')]({'attributes':['id',_0x4d7a('0x4f'),'color'],'where':{'id':_0x58dff6[_0x4d7a('0x38')][_0x4d7a('0x4c')]}});})[_0x4d7a('0x29')](function(_0x33b774){socket[_0x4d7a('0x50')](_0x4d7a('0x51'),{'id':Number(_0x58dff6[_0x4d7a('0x2b')]['id']),'tags':_0x33b774||[]});return{'id':Number(_0x58dff6[_0x4d7a('0x2b')]['id']),'tags':_0x33b774||[]};});}})[_0x4d7a('0x29')](respondWithResult(_0x560b33,null))[_0x4d7a('0x2a')](handleError(_0x560b33,null));};exports[_0x4d7a('0x52')]=function(_0x518826,_0x29dc71){return db[_0x4d7a('0x20')][_0x4d7a('0x39')]({'where':{'id':_0x518826[_0x4d7a('0x2b')]['id']}})[_0x4d7a('0x29')](handleEntityNotFound(_0x29dc71,null))[_0x4d7a('0x29')](function(_0x193c06){if(_0x193c06){return _0x193c06[_0x4d7a('0x52')](_0x518826[_0x4d7a('0x27')]['ids']);}})[_0x4d7a('0x29')](respondWithStatusCode(_0x29dc71,null))[_0x4d7a('0x2a')](handleError(_0x29dc71,null));};exports['download']=function(_0x4d59ba,_0x1ed7b9){var _0xbae933=moment()['unix']()['toString']();var _0x382101=path[_0x4d7a('0x53')](config['root'],'server',_0x4d7a('0x54'),'tmp');var _0x320be7=path[_0x4d7a('0x53')](config[_0x4d7a('0x55')],_0x4d7a('0x56'),'files','attachments');var _0x7cd799=path['join'](_0x382101,_0xbae933);var _0x304b57=util[_0x4d7a('0x47')](_0x4d7a('0x57'),_0x4d59ba[_0x4d7a('0x2b')]['id'],_0xbae933);var _0x8ab86=path[_0x4d7a('0x53')](_0x382101,_0x304b57);var _0x370234=[];_0x370234['push']({'model':db['User'],'as':_0x4d7a('0x58'),'attributes':['id',_0x4d7a('0x59')],'raw':!![]});_0x370234[_0x4d7a('0x5a')]({'model':db[_0x4d7a('0x5b')],'as':_0x4d7a('0x5c'),'attributes':['id',_0x4d7a('0x5d'),'lastName'],'raw':!![]});if(_0x4d59ba['query'][_0x4d7a('0x5e')]){_0x370234[_0x4d7a('0x5a')]({'model':db['Attachment'],'as':_0x4d7a('0x5f'),'raw':!![]});}var _0x261af9=[{'model':db[_0x4d7a('0x3c')],'as':_0x4d7a('0x60'),'attributes':['id',_0x4d7a('0x38'),_0x4d7a('0x61'),_0x4d7a('0x62'),_0x4d7a('0x63'),'read'],'include':_0x370234}];_0x261af9['push']({'model':db[_0x4d7a('0x64')],'as':_0x4d7a('0x65'),'attributes':['id','name']});_0x261af9[_0x4d7a('0x5a')]({'model':db[_0x4d7a('0x58')],'as':'Owner','attributes':['id',_0x4d7a('0x59')]});return db['WhatsappInteraction'][_0x4d7a('0x39')]({'where':{'id':_0x4d59ba[_0x4d7a('0x2b')]['id']},'include':_0x261af9})[_0x4d7a('0x29')](handleEntityNotFound(_0x1ed7b9,null))['then'](function(_0x3cf061){if(_0x3cf061){var _0xce259f=_0x3cf061[_0x4d7a('0x66')]({'plain':!![]});fs[_0x4d7a('0x67')](_0x7cd799);var _0x6b4338={'channel':_0x4d7a('0x68'),'account':_0xce259f[_0x4d7a('0x65')][_0x4d7a('0x4f')],'agent':_0xce259f[_0x4d7a('0x69')]?_0xce259f[_0x4d7a('0x69')][_0x4d7a('0x59')]:'N.A.','createdAt':moment(_0xce259f['createdAt'])[_0x4d7a('0x47')](_0x4d7a('0x48'))['toString'](),'closedAt':_0xce259f[_0x4d7a('0x6a')]?moment(_0xce259f[_0x4d7a('0x6b')])[_0x4d7a('0x47')](_0x4d7a('0x48'))['toString']():'','disposition':_0xce259f[_0x4d7a('0x6c')],'messages':_(_0xce259f['Messages'])['filter']({'secret':![]})[_0x4d7a('0x1f')](function(_0x190837){if(_0x190837[_0x4d7a('0x5f')]){var _0x5cbb84=path['join'](_0x320be7,_0x190837['Attachment'][_0x4d7a('0x6d')]);if(fs[_0x4d7a('0x6e')](_0x5cbb84)){fs['createReadStream'](_0x5cbb84)[_0x4d7a('0x6f')](fs[_0x4d7a('0x70')](path[_0x4d7a('0x53')](_0x7cd799,_0x190837[_0x4d7a('0x5f')]['basename'])));}}return{'date':moment(_0x190837[_0x4d7a('0x61')])[_0x4d7a('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4d7a('0x71')](),'sender':_0x190837[_0x4d7a('0x62')]==='out'?_0x190837[_0x4d7a('0x58')]?_0x190837[_0x4d7a('0x58')][_0x4d7a('0x59')]:_0x4d7a('0x72'):_0x190837[_0x4d7a('0x5c')][_0x4d7a('0x5d')]+(_0x190837['Contact'][_0x4d7a('0x73')]?'\x20'+_0x190837[_0x4d7a('0x5c')]['lastName']:''),'body':_0x190837['Attachment']?_0x190837[_0x4d7a('0x5f')][_0x4d7a('0x6d')]:_0x190837['body'],'direction':_0x190837['direction']===_0x4d7a('0x74')?'A':'C','secret':_0x190837['secret'],'read':_0x190837[_0x4d7a('0x75')],'attachment':_0x190837['Attachment']};})[_0x4d7a('0x76')]()};return ejs[_0x4d7a('0x77')](path[_0x4d7a('0x53')](config[_0x4d7a('0x55')],_0x4d7a('0x56'),_0x4d7a('0x78'),_0x4d7a('0x79')),{'interaction':_0x6b4338})[_0x4d7a('0x29')](function(_0x4b35a8){var _0x9fc325=path['join'](_0x7cd799,'transcript-'+_0xce259f['id']+'-'+_0xbae933+_0x4d7a('0x7a'));var _0x5043b0={'path':_0x9fc325,'channel':_0x4d7a('0x68'),'interactionId':_0xce259f['id']};return pdf[_0x4d7a('0x7b')](_0x4b35a8,_0x5043b0);})[_0x4d7a('0x29')](function(){return new BPromise(function(_0x5955f8,_0x40ce6f){zipdir(_0x7cd799,{'saveTo':_0x8ab86},function(_0xa62d10,_0x48c81e){if(_0xa62d10)return _0x40ce6f(_0xa62d10);return _0x5955f8(_0x48c81e);});})['then'](function(){return new BPromise(function(_0x55a171,_0x11d547){rimraf(_0x7cd799,function(_0x40de5b){if(_0x40de5b)_0x11d547(_0x40de5b);return _0x55a171();});});})[_0x4d7a('0x29')](function(){return _0x1ed7b9[_0x4d7a('0x7c')](_0x8ab86,_0x304b57,function(_0x2a07c6){if(_0x2a07c6){console[_0x4d7a('0x7d')]('err',_0x2a07c6);}else{fs['unlinkSync'](_0x8ab86);}});});});}else{return _0x1ed7b9['sendStatus'](0xc8);}})['catch'](handleError(_0x1ed7b9,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e8fd7d8..60f122e 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 _0x8128=['WhatsappMessage','update','remove','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x14e761,_0x1d6c77){var _0x171795=function(_0x7fb905){while(--_0x7fb905){_0x14e761['push'](_0x14e761['shift']());}};_0x171795(++_0x1d6c77);}(_0x8128,0x1b1));var _0x8812=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x8128[_0x2e4aa2];return _0x5e6092;};'use strict';var EventEmitter=require(_0x8812('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x8812('0x1'))['db'][_0x8812('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8812('0x3'),'afterDestroy':_0x8812('0x4')};function emitEvent(_0x21b1d5){return function(_0x4a8add,_0x33f9f6,_0x2f4af9){_0x4a8add[_0x8812('0x5')]({'attributes':['id'],'raw':!![]})[_0x8812('0x6')](function(_0x480d1f){_0x4a8add[_0x8812('0x7')](_0x8812('0x8'),_0x480d1f['map'](function(_0x51ad6b){return{'id':_0x51ad6b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4a8add['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8812('0x6')](function(_0x25545c){_0x4a8add[_0x8812('0x7')](_0x8812('0x9'),_0x25545c[_0x8812('0xa')]);WhatsappInteractionEvents[_0x8812('0xb')](_0x21b1d5+':'+_0x4a8add['id'],_0x4a8add);WhatsappInteractionEvents[_0x8812('0xb')](_0x21b1d5,_0x4a8add);_0x2f4af9(null);})[_0x8812('0xc')](_0x2f4af9(null));};}for(var e in events){if(events[_0x8812('0xd')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x8812('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xed8a=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','exports','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','remove','getUsers'];(function(_0x5f1a3f,_0x15f4c7){var _0x3ff879=function(_0x508ac9){while(--_0x508ac9){_0x5f1a3f['push'](_0x5f1a3f['shift']());}};_0x3ff879(++_0x15f4c7);}(_0xed8a,0xc5));var _0xaed8=function(_0x473b44,_0x358c65){_0x473b44=_0x473b44-0x0;var _0x5b243c=_0xed8a[_0x473b44];return _0x5b243c;};'use strict';var EventEmitter=require(_0xaed8('0x0'));var WhatsappInteraction=require(_0xaed8('0x1'))['db'][_0xaed8('0x2')];var WhatsappMessage=require(_0xaed8('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xaed8('0x3')](0x0);var events={'afterCreate':_0xaed8('0x4'),'afterUpdate':'update','afterDestroy':_0xaed8('0x5')};function emitEvent(_0x2b330f){return function(_0x5759dd,_0x4f5082,_0x347ca1){_0x5759dd[_0xaed8('0x6')]({'attributes':['id'],'raw':!![]})[_0xaed8('0x7')](function(_0x2f6ab8){_0x5759dd[_0xaed8('0x8')](_0xaed8('0x9'),_0x2f6ab8[_0xaed8('0xa')](function(_0x5455ff){return{'id':_0x5455ff['id']};}));return WhatsappMessage[_0xaed8('0xb')]({'where':{'WhatsappInteractionId':_0x5759dd['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaed8('0x7')](function(_0x347f88){_0x5759dd['setDataValue'](_0xaed8('0xc'),_0x347f88[_0xaed8('0xd')]);WhatsappInteractionEvents[_0xaed8('0xe')](_0x2b330f+':'+_0x5759dd['id'],_0x5759dd);WhatsappInteractionEvents[_0xaed8('0xe')](_0x2b330f,_0x5759dd);_0x347ca1(null);})[_0xaed8('0xf')](_0x347ca1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xaed8('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 8c6ead6..7826840 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 _0xbbbc=['exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x161f8f,_0x4ab39d){var _0x2ddbd4=function(_0x24ede0){while(--_0x24ede0){_0x161f8f['push'](_0x161f8f['shift']());}};_0x2ddbd4(++_0x4ab39d);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x4c295c,_0x580371){_0x4c295c=_0x4c295c-0x0;var _0x1f85e4=_0xbbbc[_0x4c295c];return _0x1f85e4;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6f4fd8,_0x356249,_0x150355){if(_0x6f4fd8[_0xcbbb('0xe')]('closed')){_0x6f4fd8[_0xcbbb('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x150355(null,_0x6f4fd8);}}});}; \ No newline at end of file +var _0x209e=['exports','WhatsappInteraction','whatsapp_interactions','closed','closedAt','util','../../config/logger','request-promise','path','../../config/environment','./whatsappInteraction.attributes'];(function(_0x35e0ad,_0x521127){var _0x18b62b=function(_0x261e95){while(--_0x261e95){_0x35e0ad['push'](_0x35e0ad['shift']());}};_0x18b62b(++_0x521127);}(_0x209e,0x89));var _0xe209=function(_0x250844,_0x20a3fe){_0x250844=_0x250844-0x0;var _0x4c2d25=_0x209e[_0x250844];return _0x4c2d25;};'use strict';var _=require('lodash');var util=require(_0xe209('0x0'));var logger=require(_0xe209('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe209('0x2'));var fs=require('fs');var path=require(_0xe209('0x3'));var rimraf=require('rimraf');var config=require(_0xe209('0x4'));var attributes=require(_0xe209('0x5'));module[_0xe209('0x6')]=function(_0x338805,_0x164e1b){return _0x338805['define'](_0xe209('0x7'),attributes,{'tableName':_0xe209('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9016f4,_0xbbdeca,_0x33b3e0){if(_0x9016f4['changed'](_0xe209('0x9'))){_0x9016f4[_0xe209('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x33b3e0(null,_0x9016f4);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 366fe9d..9ab61d4 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 _0x85ac=['where','then','addTags','ids','omit','info','AddTags','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','limit'];(function(_0x13d568,_0x1ffdf8){var _0x41d624=function(_0x565306){while(--_0x565306){_0x13d568['push'](_0x13d568['shift']());}};_0x41d624(++_0x1ffdf8);}(_0x85ac,0x1a9));var _0xc85a=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x85ac[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xc85a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc85a('0x1'));var rs=require(_0xc85a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc85a('0x3'))['db'];var utils=require(_0xc85a('0x4'));var logger=require(_0xc85a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc85a('0x6'));var client=jayson[_0xc85a('0x7')][_0xc85a('0x8')]({'port':0x232a});config[_0xc85a('0x9')]=_[_0xc85a('0xa')](config[_0xc85a('0x9')],{'host':_0xc85a('0xb'),'port':0x18eb});var socket=require(_0xc85a('0xc'))(new Redis(config[_0xc85a('0x9')]));require(_0xc85a('0xd'))['register'](socket);function respondWithRpcPromise(_0x29ee36,_0x15bb7f,_0x3c5274){return new BPromise(function(_0x22fa30,_0x330d97){return client[_0xc85a('0xe')](_0x29ee36,_0x3c5274)['then'](function(_0x908456){logger['info'](_0xc85a('0xf'),_0x15bb7f,'request\x20sent');logger[_0xc85a('0x10')](_0xc85a('0x11'),_0x15bb7f,_0xc85a('0x12'),JSON[_0xc85a('0x13')](_0x908456));if(_0x908456[_0xc85a('0x14')]){if(_0x908456[_0xc85a('0x14')]['code']===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x15bb7f,_0x908456[_0xc85a('0x14')][_0xc85a('0x15')]);return _0x330d97(_0x908456['error']['message']);}logger[_0xc85a('0x14')](_0xc85a('0xf'),_0x15bb7f,_0x908456[_0xc85a('0x14')][_0xc85a('0x15')]);return _0x22fa30(_0x908456['error'][_0xc85a('0x15')]);}else{logger['info'](_0xc85a('0xf'),_0x15bb7f,'request\x20sent');_0x22fa30(_0x908456[_0xc85a('0x16')][_0xc85a('0x15')]);}})[_0xc85a('0x17')](function(_0x3f0ad3){logger[_0xc85a('0x14')](_0xc85a('0xf'),_0x15bb7f,_0x3f0ad3);_0x330d97(_0x3f0ad3);});});}exports[_0xc85a('0x18')]=function(_0x5c7f8e){var _0x11505b=this;return new Promise(function(_0x25e1e9,_0x39ee9f){return db[_0xc85a('0x19')][_0xc85a('0x1a')](_0x5c7f8e[_0xc85a('0x1b')],{'raw':_0x5c7f8e[_0xc85a('0x1c')]?_0x5c7f8e[_0xc85a('0x1c')][_0xc85a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c7f8e[_0xc85a('0x1c')]?_0x5c7f8e[_0xc85a('0x1c')]['where']||null:null,'attributes':_0x5c7f8e[_0xc85a('0x1c')]?_0x5c7f8e[_0xc85a('0x1c')]['attributes']||null:null,'limit':_0x5c7f8e[_0xc85a('0x1c')]?_0x5c7f8e['options'][_0xc85a('0x1e')]||null:null})['then'](function(_0xce560b){logger['info'](_0xc85a('0x18'),_0x5c7f8e);logger[_0xc85a('0x10')]('UpdateWhatsappInteraction',_0x5c7f8e,JSON['stringify'](_0xce560b));_0x25e1e9(_0xce560b);})['catch'](function(_0x4b8962){logger[_0xc85a('0x14')](_0xc85a('0x18'),_0x4b8962['message'],_0x5c7f8e);_0x39ee9f(_0x11505b[_0xc85a('0x14')](0x1f4,_0x4b8962['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x5c9446){return new Promise(function(_0x2086d0,_0x558848){return db[_0xc85a('0x19')]['find']({'where':_0x5c9446['options']?_0x5c9446[_0xc85a('0x1c')][_0xc85a('0x1f')]||null:null})[_0xc85a('0x20')](function(_0x906162){if(_0x906162){return _0x906162[_0xc85a('0x21')](_0x5c9446[_0xc85a('0x1b')][_0xc85a('0x22')],_[_0xc85a('0x23')](_0x5c9446[_0xc85a('0x1b')],[_0xc85a('0x22'),'id'])||{});}})['spread'](function(_0x11cf38){logger[_0xc85a('0x24')](_0xc85a('0x25'),_0x5c9446);logger[_0xc85a('0x10')]('AddTags',_0x5c9446,JSON['stringify'](_0x11cf38));_0x2086d0(_0x11cf38);})[_0xc85a('0x17')](function(_0x581264){logger[_0xc85a('0x14')](_0xc85a('0x25'),_0x581264[_0xc85a('0x15')],_0x5c9446);_0x558848(_this[_0xc85a('0x14')](0x1f4,_0x581264['message']));});});}; \ No newline at end of file +var _0x83c1=['error','code','message','info','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','attributes','limit','stringify','AddTagsToWhatsappInteraction','find','where','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x23fd2c,_0x5d8ffe){var _0x2797a8=function(_0x29f36d){while(--_0x29f36d){_0x23fd2c['push'](_0x23fd2c['shift']());}};_0x2797a8(++_0x5d8ffe);}(_0x83c1,0xea));var _0x183c=function(_0x446567,_0x4a7931){_0x446567=_0x446567-0x0;var _0x6af6c0=_0x83c1[_0x446567];return _0x6af6c0;};'use strict';var _=require(_0x183c('0x0'));var util=require('util');var moment=require(_0x183c('0x1'));var BPromise=require(_0x183c('0x2'));var rs=require(_0x183c('0x3'));var fs=require('fs');var Redis=require(_0x183c('0x4'));var db=require(_0x183c('0x5'))['db'];var utils=require(_0x183c('0x6'));var logger=require(_0x183c('0x7'))(_0x183c('0x8'));var config=require(_0x183c('0x9'));var jayson=require(_0x183c('0xa'));var client=jayson[_0x183c('0xb')][_0x183c('0xc')]({'port':0x232a});config['redis']=_[_0x183c('0xd')](config[_0x183c('0xe')],{'host':_0x183c('0xf'),'port':0x18eb});var socket=require(_0x183c('0x10'))(new Redis(config['redis']));require(_0x183c('0x11'))[_0x183c('0x12')](socket);function respondWithRpcPromise(_0x39bcc6,_0x381738,_0x962bf5){return new BPromise(function(_0xcf2c3f,_0xb5af9c){return client[_0x183c('0x13')](_0x39bcc6,_0x962bf5)[_0x183c('0x14')](function(_0x271223){logger['info'](_0x183c('0x15'),_0x381738,_0x183c('0x16'));logger[_0x183c('0x17')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x381738,_0x183c('0x16'),JSON['stringify'](_0x271223));if(_0x271223[_0x183c('0x18')]){if(_0x271223[_0x183c('0x18')][_0x183c('0x19')]===0x1f4){logger[_0x183c('0x18')](_0x183c('0x15'),_0x381738,_0x271223[_0x183c('0x18')][_0x183c('0x1a')]);return _0xb5af9c(_0x271223[_0x183c('0x18')][_0x183c('0x1a')]);}logger[_0x183c('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x381738,_0x271223['error'][_0x183c('0x1a')]);return _0xcf2c3f(_0x271223[_0x183c('0x18')][_0x183c('0x1a')]);}else{logger[_0x183c('0x1b')]('WhatsappInteraction,\x20%s,\x20%s',_0x381738,_0x183c('0x16'));_0xcf2c3f(_0x271223['result'][_0x183c('0x1a')]);}})[_0x183c('0x1c')](function(_0x3ed4c1){logger['error'](_0x183c('0x15'),_0x381738,_0x3ed4c1);_0xb5af9c(_0x3ed4c1);});});}exports[_0x183c('0x1d')]=function(_0x25eb78){var _0x58039e=this;return new Promise(function(_0x38f3c9,_0x1f77c1){return db[_0x183c('0x1e')][_0x183c('0x1f')](_0x25eb78['body'],{'raw':_0x25eb78[_0x183c('0x20')]?_0x25eb78[_0x183c('0x20')][_0x183c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25eb78[_0x183c('0x20')]?_0x25eb78[_0x183c('0x20')]['where']||null:null,'attributes':_0x25eb78['options']?_0x25eb78['options'][_0x183c('0x22')]||null:null,'limit':_0x25eb78[_0x183c('0x20')]?_0x25eb78[_0x183c('0x20')][_0x183c('0x23')]||null:null})[_0x183c('0x14')](function(_0x23e31f){logger[_0x183c('0x1b')](_0x183c('0x1d'),_0x25eb78);logger[_0x183c('0x17')](_0x183c('0x1d'),_0x25eb78,JSON[_0x183c('0x24')](_0x23e31f));_0x38f3c9(_0x23e31f);})[_0x183c('0x1c')](function(_0x3c98ff){logger[_0x183c('0x18')](_0x183c('0x1d'),_0x3c98ff[_0x183c('0x1a')],_0x25eb78);_0x1f77c1(_0x58039e[_0x183c('0x18')](0x1f4,_0x3c98ff[_0x183c('0x1a')]));});});};exports[_0x183c('0x25')]=function(_0x4c8aae){return new Promise(function(_0x1e32c2,_0x11e505){return db['WhatsappInteraction'][_0x183c('0x26')]({'where':_0x4c8aae[_0x183c('0x20')]?_0x4c8aae[_0x183c('0x20')][_0x183c('0x27')]||null:null})[_0x183c('0x14')](function(_0x22e215){if(_0x22e215){return _0x22e215['addTags'](_0x4c8aae['body'][_0x183c('0x28')],_[_0x183c('0x29')](_0x4c8aae['body'],[_0x183c('0x28'),'id'])||{});}})['spread'](function(_0x34957f){logger['info'](_0x183c('0x2a'),_0x4c8aae);logger[_0x183c('0x17')](_0x183c('0x2a'),_0x4c8aae,JSON[_0x183c('0x24')](_0x34957f));_0x1e32c2(_0x34957f);})['catch'](function(_0x76565d){logger[_0x183c('0x18')](_0x183c('0x2a'),_0x76565d[_0x183c('0x1a')],_0x4c8aae);_0x11e505(_this[_0x183c('0x18')](0x1f4,_0x76565d[_0x183c('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ef8f283..352e5bc 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 _0xb149=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','emit','removeListener'];(function(_0x485f0b,_0x2921ff){var _0x3c6518=function(_0x5414f1){while(--_0x5414f1){_0x485f0b['push'](_0x485f0b['shift']());}};_0x3c6518(++_0x2921ff);}(_0xb149,0xd3));var _0x9b14=function(_0x44da96,_0x1f19d5){_0x44da96=_0x44da96-0x0;var _0x519253=_0xb149[_0x44da96];return _0x519253;};'use strict';var WhatsappInteractionEvents=require(_0x9b14('0x0'));var events=[_0x9b14('0x1'),_0x9b14('0x2'),'update'];function createListener(_0x1d6a05,_0x44fabb){return function(_0x39062b){_0x44fabb[_0x9b14('0x3')](_0x1d6a05,_0x39062b);};}function removeListener(_0x5e8dae,_0x1cc690){return function(){WhatsappInteractionEvents[_0x9b14('0x4')](_0x5e8dae,_0x1cc690);};}exports[_0x9b14('0x5')]=function(_0x337943){for(var _0xdd4c24=0x0,_0x5a3d44=events[_0x9b14('0x6')];_0xdd4c24<_0x5a3d44;_0xdd4c24++){var _0x558890=events[_0xdd4c24];var _0x3adbc8=createListener(_0x9b14('0x7')+_0x558890,_0x337943);WhatsappInteractionEvents['on'](_0x558890,_0x3adbc8);}}; \ No newline at end of file +var _0x0c85=['save','remove','update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x1a22ef,_0x1ef6df){var _0x4a8226=function(_0x47508a){while(--_0x47508a){_0x1a22ef['push'](_0x1a22ef['shift']());}};_0x4a8226(++_0x1ef6df);}(_0x0c85,0x7f));var _0x50c8=function(_0x5ccda9,_0x4386de){_0x5ccda9=_0x5ccda9-0x0;var _0x14723d=_0x0c85[_0x5ccda9];return _0x14723d;};'use strict';var WhatsappInteractionEvents=require(_0x50c8('0x0'));var events=[_0x50c8('0x1'),_0x50c8('0x2'),_0x50c8('0x3')];function createListener(_0x5c2afb,_0x167b52){return function(_0x46b505){_0x167b52[_0x50c8('0x4')](_0x5c2afb,_0x46b505);};}function removeListener(_0x16a5c9,_0x4ec4f4){return function(){WhatsappInteractionEvents['removeListener'](_0x16a5c9,_0x4ec4f4);};}exports[_0x50c8('0x5')]=function(_0x18c426){for(var _0x56f271=0x0,_0x44ae99=events[_0x50c8('0x6')];_0x56f271<_0x44ae99;_0x56f271++){var _0x30a8c9=events[_0x56f271];var _0x3d4361=createListener(_0x50c8('0x7')+_0x30a8c9,_0x18c426);WhatsappInteractionEvents['on'](_0x30a8c9,_0x3d4361);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index c409c9a..ec907c7 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 _0x7c8a=['fs-extra','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','update','accept','reject','delete','exports','multer','path','express','Router'];(function(_0x1249f4,_0x27226c){var _0x47c8a9=function(_0x2d9917){while(--_0x2d9917){_0x1249f4['push'](_0x1249f4['shift']());}};_0x47c8a9(++_0x27226c);}(_0x7c8a,0x164));var _0xa7c8=function(_0x285775,_0x11fe0e){_0x285775=_0x285775-0x0;var _0x59c147=_0x7c8a[_0x285775];return _0x59c147;};'use strict';var multer=require(_0xa7c8('0x0'));var util=require('util');var path=require(_0xa7c8('0x1'));var timeout=require('connect-timeout');var express=require(_0xa7c8('0x2'));var router=express[_0xa7c8('0x3')]();var fs_extra=require(_0xa7c8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xa7c8('0x5')]('/',auth[_0xa7c8('0x6')](),controller[_0xa7c8('0x7')]);router['get'](_0xa7c8('0x8'),auth['isAuthenticated'](),controller[_0xa7c8('0x9')]);router['get'](_0xa7c8('0xa'),auth[_0xa7c8('0x6')](),controller[_0xa7c8('0xb')]);router[_0xa7c8('0xc')]('/',auth[_0xa7c8('0x6')](),interaction[_0xa7c8('0xd')](_0xa7c8('0xe'),_0xa7c8('0xf')),controller['create']);router[_0xa7c8('0xc')](_0xa7c8('0x10'),controller[_0xa7c8('0x11')]);router[_0xa7c8('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa7c8('0x13')]);router[_0xa7c8('0x12')]('/:id/accept',auth[_0xa7c8('0x6')](),controller[_0xa7c8('0x14')]);router['put']('/:id/reject',auth[_0xa7c8('0x6')](),controller[_0xa7c8('0x15')]);router[_0xa7c8('0x16')](_0xa7c8('0xa'),auth[_0xa7c8('0x6')](),controller['destroy']);module[_0xa7c8('0x17')]=router; \ No newline at end of file +var _0xe1dd=['accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','isAuthenticated','describe','/:id','show','whatsappmessage:create','create','post','/:id/status','status','put'];(function(_0x5b771d,_0x2d3cb7){var _0x40ccff=function(_0xed7cf3){while(--_0xed7cf3){_0x5b771d['push'](_0x5b771d['shift']());}};_0x40ccff(++_0x2d3cb7);}(_0xe1dd,0xb3));var _0xde1d=function(_0x3e8264,_0x33d8ff){_0x3e8264=_0x3e8264-0x0;var _0x1ed50d=_0xe1dd[_0x3e8264];return _0x1ed50d;};'use strict';var multer=require(_0xde1d('0x0'));var util=require(_0xde1d('0x1'));var path=require(_0xde1d('0x2'));var timeout=require(_0xde1d('0x3'));var express=require('express');var router=express[_0xde1d('0x4')]();var fs_extra=require(_0xde1d('0x5'));var auth=require(_0xde1d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xde1d('0x7'));var controller=require(_0xde1d('0x8'));router[_0xde1d('0x9')]('/',auth['isAuthenticated'](),controller[_0xde1d('0xa')]);router['get']('/describe',auth[_0xde1d('0xb')](),controller[_0xde1d('0xc')]);router[_0xde1d('0x9')](_0xde1d('0xd'),auth[_0xde1d('0xb')](),controller[_0xde1d('0xe')]);router['post']('/',auth[_0xde1d('0xb')](),interaction['tracked']('whatsapp',_0xde1d('0xf')),controller[_0xde1d('0x10')]);router[_0xde1d('0x11')](_0xde1d('0x12'),controller[_0xde1d('0x13')]);router[_0xde1d('0x14')](_0xde1d('0xd'),auth[_0xde1d('0xb')](),controller['update']);router[_0xde1d('0x14')]('/:id/accept',auth[_0xde1d('0xb')](),controller[_0xde1d('0x15')]);router[_0xde1d('0x14')](_0xde1d('0x16'),auth[_0xde1d('0xb')](),controller[_0xde1d('0x17')]);router['delete'](_0xde1d('0xd'),auth[_0xde1d('0xb')](),controller[_0xde1d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index ef24c36..ae08d17 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 _0x3e67=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x3e67,0x88));var _0x73e6=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x3e67[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0x73e6('0x0'));module[_0x73e6('0x1')]={'body':{'type':Sequelize[_0x73e6('0x2')](_0x73e6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x73e6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x73e6('0x5')]('in',_0x73e6('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x73e6('0x7')](0xbe)},'phone':{'type':Sequelize[_0x73e6('0x7')]},'readAt':{'type':Sequelize[_0x73e6('0x8')]},'secret':{'type':Sequelize[_0x73e6('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x73e6('0x2')]}}; \ No newline at end of file +var _0x448a=['out','STRING','DATE','exports','TEXT','BOOLEAN'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x448a,0x1ef));var _0xa448=function(_0x50f8d0,_0x3edfc0){_0x50f8d0=_0x50f8d0-0x0;var _0x1eed82=_0x448a[_0x50f8d0];return _0x1eed82;};'use strict';var Sequelize=require('sequelize');module[_0xa448('0x0')]={'body':{'type':Sequelize[_0xa448('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa448('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xa448('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa448('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xa448('0x5')]},'secret':{'type':Sequelize[_0xa448('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa448('0x4')]},'providerResponse':{'type':Sequelize[_0xa448('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 65b2f46..9a0d3eb 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 _0xebb4=['[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','SELECT','fullname','email','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','WhatsappMessage','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','create','body','../../config/logger','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','user','UserId','get','WhatsappInteraction','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager','WhatsappInteractionId'];(function(_0x671369,_0x433da5){var _0x33f2b4=function(_0x2e9db2){while(--_0x2e9db2){_0x671369['push'](_0x671369['shift']());}};_0x33f2b4(++_0x433da5);}(_0xebb4,0x125));var _0x4ebb=function(_0x2015e4,_0x393873){_0x2015e4=_0x2015e4-0x0;var _0x50686d=_0xebb4[_0x2015e4];return _0x50686d;};'use strict';var emlformat=require(_0x4ebb('0x0'));var rimraf=require(_0x4ebb('0x1'));var zipdir=require(_0x4ebb('0x2'));var jsonpatch=require(_0x4ebb('0x3'));var rp=require(_0x4ebb('0x4'));var moment=require(_0x4ebb('0x5'));var BPromise=require(_0x4ebb('0x6'));var Mustache=require('mustache');var util=require(_0x4ebb('0x7'));var path=require(_0x4ebb('0x8'));var sox=require(_0x4ebb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ebb('0xa'));var _=require(_0x4ebb('0xb'));var squel=require(_0x4ebb('0xc'));var crypto=require(_0x4ebb('0xd'));var jsforce=require(_0x4ebb('0xe'));var deskjs=require(_0x4ebb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ebb('0x10'));var Redis=require(_0x4ebb('0x11'));var authService=require(_0x4ebb('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ebb('0x13'));var logger=require('../../config/logger')(_0x4ebb('0x14'));var utils=require(_0x4ebb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4ebb('0x16'));var db=require(_0x4ebb('0x17'))['db'];config[_0x4ebb('0x18')]=_[_0x4ebb('0x19')](config[_0x4ebb('0x18')],{'host':_0x4ebb('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4ebb('0x1b'))[_0x4ebb('0x1c')](socket);var jayson=require(_0x4ebb('0x1d'));var client=jayson[_0x4ebb('0x1e')][_0x4ebb('0x1f')]({'port':0x232c});var client9002=jayson[_0x4ebb('0x1e')][_0x4ebb('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x56f83c,_0x43d740,_0x2a3cfb,_0x11744f){return new BPromise(function(_0x3569c1,_0x4493dc){var _0x49e936=_0x11744f||client;return _0x49e936[_0x4ebb('0x20')](_0x56f83c,_0x2a3cfb)[_0x4ebb('0x21')](function(_0x406706){logger[_0x4ebb('0x22')](_0x4ebb('0x23'),_0x43d740,_0x4ebb('0x24'));logger[_0x4ebb('0x25')](_0x4ebb('0x26'),_0x43d740,_0x4ebb('0x24'),JSON[_0x4ebb('0x27')](_0x406706));if(_0x406706[_0x4ebb('0x28')]){if(_0x406706[_0x4ebb('0x28')]['code']===0x1f4){logger[_0x4ebb('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x43d740,_0x406706[_0x4ebb('0x28')][_0x4ebb('0x29')]);return _0x4493dc(_0x406706[_0x4ebb('0x28')][_0x4ebb('0x29')]);}logger[_0x4ebb('0x28')](_0x4ebb('0x23'),_0x43d740,_0x406706[_0x4ebb('0x28')][_0x4ebb('0x29')]);return _0x3569c1(_0x406706[_0x4ebb('0x28')][_0x4ebb('0x29')]);}else{logger[_0x4ebb('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x43d740,'request\x20sent');_0x3569c1(_0x406706['result'][_0x4ebb('0x29')]);}})[_0x4ebb('0x2a')](function(_0x596a47){logger[_0x4ebb('0x28')](_0x4ebb('0x23'),_0x43d740,_0x596a47);_0x4493dc(_0x596a47);});});}function respondWithStatusCode(_0x3f851f,_0x2b29c0){_0x2b29c0=_0x2b29c0||0xcc;return function(_0x163cc6){if(_0x163cc6){return _0x3f851f[_0x4ebb('0x2b')](_0x2b29c0);}return _0x3f851f[_0x4ebb('0x2c')](_0x2b29c0)[_0x4ebb('0x2d')]();};}function respondWithResult(_0x4eb723,_0x3a6617){_0x3a6617=_0x3a6617||0xc8;return function(_0x116a38){if(_0x116a38){return _0x4eb723[_0x4ebb('0x2c')](_0x3a6617)['json'](_0x116a38);}};}function respondWithFilteredResult(_0x59bbfd,_0x45af24){return function(_0x463e14){if(_0x463e14){var _0x5bc722=typeof _0x45af24[_0x4ebb('0x2e')]==='undefined'&&typeof _0x45af24[_0x4ebb('0x2f')]===_0x4ebb('0x30');var _0x4ea578=_0x463e14['count'];var _0x3477da=_0x5bc722?0x0:_0x45af24[_0x4ebb('0x2e')];var _0xfc245f=_0x5bc722?_0x463e14[_0x4ebb('0x31')]:_0x45af24[_0x4ebb('0x2e')]+_0x45af24['limit'];var _0x55ddb7;if(_0xfc245f>=_0x4ea578){_0xfc245f=_0x4ea578;_0x55ddb7=0xc8;}else{_0x55ddb7=0xce;}_0x59bbfd['status'](_0x55ddb7);return _0x59bbfd[_0x4ebb('0x32')](_0x4ebb('0x33'),_0x3477da+'-'+_0xfc245f+'/'+_0x4ea578)['json'](_0x463e14);}return null;};}function patchUpdates(_0x262808){return function(_0x45009c){try{jsonpatch[_0x4ebb('0x34')](_0x45009c,_0x262808,!![]);}catch(_0x440338){return BPromise[_0x4ebb('0x35')](_0x440338);}return _0x45009c[_0x4ebb('0x36')]();};}function saveUpdates(_0x37995b,_0x2c641c){return function(_0xd14106){if(_0xd14106){return _0xd14106[_0x4ebb('0x37')](_0x37995b)[_0x4ebb('0x21')](function(_0x39b450){return _0x39b450;});}return null;};}function removeEntity(_0x441abb,_0x210060){return function(_0x4659f9){if(_0x4659f9){return _0x4659f9[_0x4ebb('0x38')]()[_0x4ebb('0x21')](function(){_0x441abb['status'](0xcc)[_0x4ebb('0x2d')]();});}};}function handleEntityNotFound(_0x17fd0e,_0x22102){return function(_0x3bb0f2){if(!_0x3bb0f2){_0x17fd0e[_0x4ebb('0x2b')](0x194);}return _0x3bb0f2;};}function handleError(_0x5009a9,_0x1e2c07){_0x1e2c07=_0x1e2c07||0x1f4;return function(_0x5f4b0d){logger['error'](_0x5f4b0d['stack']);if(_0x5f4b0d[_0x4ebb('0x39')]){delete _0x5f4b0d[_0x4ebb('0x39')];}_0x5009a9[_0x4ebb('0x2c')](_0x1e2c07)[_0x4ebb('0x3a')](_0x5f4b0d);};}exports[_0x4ebb('0x3b')]=function(_0x26bab7,_0x100379){var _0x5a869f={},_0x2ae7ea={},_0x27e82b={'count':0x0,'rows':[]};var _0x15beb6=_['map'](db[_0x4ebb('0x3c')]['rawAttributes'],function(_0x54bfb3){return{'name':_0x54bfb3[_0x4ebb('0x3d')],'type':_0x54bfb3[_0x4ebb('0x3e')][_0x4ebb('0x3f')]};});_0x2ae7ea[_0x4ebb('0x40')]=_[_0x4ebb('0x41')](_0x15beb6,_0x4ebb('0x39'));_0x2ae7ea[_0x4ebb('0x42')]=_[_0x4ebb('0x43')](_0x26bab7[_0x4ebb('0x42')]);_0x2ae7ea['filters']=_[_0x4ebb('0x44')](_0x2ae7ea[_0x4ebb('0x40')],_0x2ae7ea[_0x4ebb('0x42')]);_0x5a869f[_0x4ebb('0x45')]=_['intersection'](_0x2ae7ea[_0x4ebb('0x40')],qs['fields'](_0x26bab7[_0x4ebb('0x42')][_0x4ebb('0x46')]));_0x5a869f[_0x4ebb('0x45')]=_0x5a869f[_0x4ebb('0x45')]['length']?_0x5a869f[_0x4ebb('0x45')]:_0x2ae7ea[_0x4ebb('0x40')];if(!_0x26bab7['query'][_0x4ebb('0x47')](_0x4ebb('0x48'))){_0x5a869f[_0x4ebb('0x2f')]=qs[_0x4ebb('0x2f')](_0x26bab7[_0x4ebb('0x42')][_0x4ebb('0x2f')]);_0x5a869f[_0x4ebb('0x2e')]=qs[_0x4ebb('0x2e')](_0x26bab7['query'][_0x4ebb('0x2e')]);}_0x5a869f['order']=qs['sort'](_0x26bab7[_0x4ebb('0x42')][_0x4ebb('0x49')]);_0x5a869f[_0x4ebb('0x4a')]=qs['filters'](_['pick'](_0x26bab7[_0x4ebb('0x42')],_0x2ae7ea['filters']),_0x15beb6);if(_0x26bab7[_0x4ebb('0x42')][_0x4ebb('0x4b')]){_0x5a869f[_0x4ebb('0x4a')]=_[_0x4ebb('0x4c')](_0x5a869f[_0x4ebb('0x4a')],{'$or':_[_0x4ebb('0x41')](_0x15beb6,function(_0x472f77){if(_0x472f77[_0x4ebb('0x3e')]!==_0x4ebb('0x4d')){var _0x11b532={};_0x11b532[_0x472f77[_0x4ebb('0x39')]]={'$like':'%'+_0x26bab7[_0x4ebb('0x42')][_0x4ebb('0x4b')]+'%'};return _0x11b532;}})});}_0x5a869f=_[_0x4ebb('0x4c')]({},_0x5a869f,_0x26bab7[_0x4ebb('0x4e')]);var _0xecb53d={'where':_0x5a869f[_0x4ebb('0x4a')]};return db['WhatsappMessage'][_0x4ebb('0x31')](_0xecb53d)[_0x4ebb('0x21')](function(_0x48653c){_0x27e82b[_0x4ebb('0x31')]=_0x48653c;if(_0x26bab7['query'][_0x4ebb('0x4f')]){_0x5a869f[_0x4ebb('0x50')]=[{'all':!![]}];}return db[_0x4ebb('0x3c')][_0x4ebb('0x51')](_0x5a869f);})[_0x4ebb('0x21')](function(_0x1bc455){_0x27e82b[_0x4ebb('0x52')]=_0x1bc455;return _0x27e82b;})[_0x4ebb('0x21')](respondWithFilteredResult(_0x100379,_0x5a869f))[_0x4ebb('0x2a')](handleError(_0x100379,null));};exports['show']=function(_0x41aa23,_0x3e3b9f){var _0x260cc1={'raw':!![],'where':{'id':_0x41aa23[_0x4ebb('0x53')]['id']}},_0x46da17={};_0x46da17[_0x4ebb('0x40')]=_[_0x4ebb('0x43')](db[_0x4ebb('0x3c')][_0x4ebb('0x54')]);_0x46da17[_0x4ebb('0x42')]=_[_0x4ebb('0x43')](_0x41aa23[_0x4ebb('0x42')]);_0x46da17['filters']=_[_0x4ebb('0x44')](_0x46da17[_0x4ebb('0x40')],_0x46da17[_0x4ebb('0x42')]);_0x260cc1[_0x4ebb('0x45')]=_[_0x4ebb('0x44')](_0x46da17['model'],qs['fields'](_0x41aa23['query'][_0x4ebb('0x46')]));_0x260cc1['attributes']=_0x260cc1[_0x4ebb('0x45')][_0x4ebb('0x55')]?_0x260cc1['attributes']:_0x46da17[_0x4ebb('0x40')];if(_0x41aa23[_0x4ebb('0x42')][_0x4ebb('0x4f')]){_0x260cc1[_0x4ebb('0x50')]=[{'all':!![]}];}_0x260cc1=_[_0x4ebb('0x4c')]({},_0x260cc1,_0x41aa23['options']);return db[_0x4ebb('0x3c')][_0x4ebb('0x56')](_0x260cc1)[_0x4ebb('0x21')](handleEntityNotFound(_0x3e3b9f,null))[_0x4ebb('0x21')](respondWithResult(_0x3e3b9f,null))[_0x4ebb('0x2a')](handleError(_0x3e3b9f,null));};exports[_0x4ebb('0x57')]=function(_0x290382,_0x4239dc){return db[_0x4ebb('0x3c')][_0x4ebb('0x57')](_0x290382['body'],{})[_0x4ebb('0x21')](respondWithResult(_0x4239dc,0xc9))[_0x4ebb('0x2a')](handleError(_0x4239dc,null));};exports[_0x4ebb('0x37')]=function(_0x4b8fa2,_0x14a5d2){if(_0x4b8fa2[_0x4ebb('0x58')]['id']){delete _0x4b8fa2[_0x4ebb('0x58')]['id'];}return db[_0x4ebb('0x3c')][_0x4ebb('0x56')]({'where':{'id':_0x4b8fa2[_0x4ebb('0x53')]['id']}})[_0x4ebb('0x21')](handleEntityNotFound(_0x14a5d2,null))[_0x4ebb('0x21')](saveUpdates(_0x4b8fa2[_0x4ebb('0x58')],null))[_0x4ebb('0x21')](respondWithResult(_0x14a5d2,null))[_0x4ebb('0x2a')](handleError(_0x14a5d2,null));};exports[_0x4ebb('0x38')]=function(_0x154d75,_0x3458cf){return db[_0x4ebb('0x3c')][_0x4ebb('0x56')]({'where':{'id':_0x154d75[_0x4ebb('0x53')]['id']}})[_0x4ebb('0x21')](handleEntityNotFound(_0x3458cf,null))['then'](removeEntity(_0x3458cf,null))['catch'](handleError(_0x3458cf,null));};exports['describe']=function(_0x4d0e13,_0x909885){return db[_0x4ebb('0x3c')]['describe']()[_0x4ebb('0x21')](respondWithResult(_0x909885,null))[_0x4ebb('0x2a')](handleError(_0x909885,null));};var interaction_log=require(_0x4ebb('0x59'))('whatsapp-interactions');exports[_0x4ebb('0x5a')]=function(_0x481e10,_0x29b1ff,_0x498342){var _0x4f50f2={'agent':{},'channel':_0x4ebb('0x5b')};if(_0x481e10[_0x4ebb('0x58')]['id']){delete _0x481e10['body']['id'];}_0x481e10[_0x4ebb('0x58')]['read']=!![];_0x481e10[_0x4ebb('0x58')][_0x4ebb('0x5c')]=moment()['format'](_0x4ebb('0x5d'));_0x481e10[_0x4ebb('0x58')]['UserId']=_0x481e10[_0x4ebb('0x58')]['UserId']||_0x481e10[_0x4ebb('0x5e')]['id'];_0x4f50f2['agent']['id']=_0x481e10[_0x4ebb('0x58')][_0x4ebb('0x5f')];return db['WhatsappMessage']['find']({'where':{'id':_0x481e10['params']['id'],'UserId':null}})[_0x4ebb('0x21')](handleEntityNotFound(_0x29b1ff,null))[_0x4ebb('0x21')](saveUpdates(_0x481e10[_0x4ebb('0x58')],null))[_0x4ebb('0x21')](function(_0x443a76){if(_0x443a76){_0x4f50f2[_0x4ebb('0x29')]=_0x443a76[_0x4ebb('0x60')]({'plain':!![]});return db[_0x4ebb('0x61')][_0x4ebb('0x56')]({'where':{'id':_0x443a76['WhatsappInteractionId']}});}return null;})[_0x4ebb('0x21')](handleEntityNotFound(_0x29b1ff,null))[_0x4ebb('0x21')](function(_0x5147bd){if(_0x5147bd){return _0x5147bd[_0x4ebb('0x37')]({'UserId':_0x481e10[_0x4ebb('0x58')][_0x4ebb('0x5f')],'read1stAt':_['isNil'](_0x5147bd[_0x4ebb('0x62')])?moment()[_0x4ebb('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4ebb('0x21')](function(_0x4e9192){if(_0x4e9192){_0x4f50f2[_0x4ebb('0x64')]=_0x4e9192[_0x4ebb('0x60')]({'plain':!![]});interaction_log[_0x4ebb('0x22')](_0x4ebb('0x65'),_0x481e10[_0x4ebb('0x5e')]['id'],_0x481e10[_0x4ebb('0x5e')][_0x4ebb('0x39')],_0x481e10[_0x4ebb('0x5e')][_0x4ebb('0x66')],_0x4f50f2[_0x4ebb('0x64')]['id'],_0x481e10[_0x4ebb('0x58')]?JSON[_0x4ebb('0x27')](_0x481e10[_0x4ebb('0x58')]):_0x4ebb('0x67'));return respondWithRpcPromise(_0x4ebb('0x68'),_0x4ebb('0x69'),_0x4f50f2);}return null;})[_0x4ebb('0x21')](function(_0x486764){var _0x5dc617=_0x4ebb('0x6a')+_0x486764[_0x4ebb('0x29')][_0x4ebb('0x6b')];return db['sequelize']['query'](_0x5dc617,{'type':db[_0x4ebb('0x6c')][_0x4ebb('0x6d')]['SELECT'],'raw':!![]})[_0x4ebb('0x21')](function(_0x4f3524){return _0x4f3524;});})[_0x4ebb('0x21')](function(_0x2d580b){if(_0x2d580b){_0x4f50f2['message'][_0x4ebb('0x6e')]=_0x2d580b[0x0];if(!_0x481e10[_0x4ebb('0x58')][_0x4ebb('0x5f')])return;return db[_0x4ebb('0x6f')][_0x4ebb('0x56')]({'where':{'id':_0x481e10[_0x4ebb('0x58')]['UserId'],'role':'agent'},'attributes':['id','name','fullname','email',_0x4ebb('0x70')],'raw':!![]});}return null;})[_0x4ebb('0x21')](function(_0x6ff09a){if(!_0x6ff09a)return null;_0x4f50f2[_0x4ebb('0x29')][_0x4ebb('0x71')]=_0x6ff09a;return _0x4f50f2;})[_0x4ebb('0x21')](function(_0x553d9d){if(_0x553d9d){if(_0x481e10[_0x4ebb('0x58')][_0x4ebb('0x72')]){_0x4f50f2[_0x4ebb('0x29')][_0x4ebb('0x73')]=util['format'](_0x4ebb('0x74'),_0x481e10['user']['name']);_0x4f50f2[_0x4ebb('0x29')][_0x4ebb('0x75')]=_0x4f50f2[_0x4ebb('0x75')];_0x4f50f2[_0x4ebb('0x29')][_0x4ebb('0x76')]=_0x4f50f2[_0x4ebb('0x75')];_0x4f50f2[_0x4ebb('0x29')]['event']=_0x4ebb('0x5a');return respondWithRpcPromise(_0x4ebb('0x77'),_0x4ebb('0x77'),{'event':'acceptmessage','message':_0x4f50f2[_0x4ebb('0x29')]},client9002)[_0x4ebb('0x21')](function(){return _0x4f50f2;});}return _0x4f50f2;}return null;})['then'](respondWithResult(_0x29b1ff,null))[_0x4ebb('0x2a')](handleError(_0x29b1ff,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports['reject']=function(_0x2d6294,_0x34d96a,_0x5c32a4){var _0x418194={'agent':{},'channel':_0x4ebb('0x5b')};if(_0x2d6294[_0x4ebb('0x58')]['id']){delete _0x2d6294[_0x4ebb('0x58')]['id'];}_0x2d6294[_0x4ebb('0x58')][_0x4ebb('0x5f')]=_0x2d6294[_0x4ebb('0x58')][_0x4ebb('0x5f')]||_0x2d6294['user']['id'];_0x418194[_0x4ebb('0x71')]['id']=_0x2d6294[_0x4ebb('0x58')]['UserId'];return db[_0x4ebb('0x3c')][_0x4ebb('0x56')]({'where':{'id':_0x2d6294['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34d96a,null))['then'](function(_0x5b1da5){if(_0x5b1da5){_0x418194[_0x4ebb('0x29')]=_0x5b1da5[_0x4ebb('0x60')]({'plain':!![]});return db['WhatsappInteraction'][_0x4ebb('0x56')]({'where':{'id':_0x5b1da5[_0x4ebb('0x78')]}});}return null;})[_0x4ebb('0x21')](handleEntityNotFound(_0x34d96a,null))[_0x4ebb('0x21')](function(_0x26441e){if(_0x26441e){_0x418194[_0x4ebb('0x64')]=_0x26441e[_0x4ebb('0x60')]({'plain':!![]});interaction_log['info'](_0x4ebb('0x79'),_0x2d6294[_0x4ebb('0x5e')]['id'],_0x2d6294[_0x4ebb('0x5e')]['name'],_0x2d6294[_0x4ebb('0x5e')][_0x4ebb('0x66')],_0x418194[_0x4ebb('0x64')]['id'],_0x2d6294['body']?JSON[_0x4ebb('0x27')](_0x2d6294[_0x4ebb('0x58')]):_0x4ebb('0x67'));return respondWithRpcPromise(_0x4ebb('0x7a'),_0x4ebb('0x7b'),_0x418194);}return null;})[_0x4ebb('0x21')](function(_0x49985d){var _0x23f92e=_0x4ebb('0x6a')+_0x49985d[_0x4ebb('0x29')][_0x4ebb('0x6b')];return db[_0x4ebb('0x7c')][_0x4ebb('0x42')](_0x23f92e,{'type':db['Sequelize'][_0x4ebb('0x6d')][_0x4ebb('0x7d')],'raw':!![]})[_0x4ebb('0x21')](function(_0x5c434b){return _0x5c434b;});})[_0x4ebb('0x21')](function(_0x405d1c){if(_0x405d1c){_0x418194[_0x4ebb('0x29')][_0x4ebb('0x6e')]=_0x405d1c[0x0];if(!_0x2d6294[_0x4ebb('0x58')][_0x4ebb('0x5f')])return;return db[_0x4ebb('0x6f')]['find']({'where':{'id':_0x2d6294[_0x4ebb('0x58')]['UserId'],'role':_0x4ebb('0x71')},'attributes':['id',_0x4ebb('0x39'),_0x4ebb('0x7e'),_0x4ebb('0x7f'),_0x4ebb('0x70')],'raw':!![]});}return null;})[_0x4ebb('0x21')](function(_0x1f242e){if(!_0x1f242e)return null;_0x418194[_0x4ebb('0x29')][_0x4ebb('0x71')]=_0x1f242e;return _0x418194;})[_0x4ebb('0x21')](function(_0x4ce668){if(_0x4ce668){_0x4ce668[_0x4ebb('0x29')]['interface']=util[_0x4ebb('0x63')]('SIP/%s',_0x2d6294[_0x4ebb('0x5e')][_0x4ebb('0x39')]);_0x4ce668['message'][_0x4ebb('0x75')]=_0x418194[_0x4ebb('0x75')];_0x4ce668['message'][_0x4ebb('0x76')]=_0x418194[_0x4ebb('0x75')];_0x4ce668[_0x4ebb('0x29')]['event']=_0x4ebb('0x35');respondWithRpcPromise(_0x4ebb('0x77'),_0x4ebb('0x77'),{'event':_0x4ebb('0x80'),'message':_0x4ce668[_0x4ebb('0x29')]},client9002);return _0x418194;}return null;})['then'](respondWithResult(_0x34d96a,null))[_0x4ebb('0x2a')](handleError(_0x34d96a,null));};exports[_0x4ebb('0x2c')]=function(_0x4c3fbc,_0x935a11,_0x6aa0f5){if(_0x4c3fbc[_0x4ebb('0x58')]['id']){delete _0x4c3fbc['body']['id'];}var _0x42f8b9;return db[_0x4ebb('0x3c')]['find']({'where':{'id':_0x4c3fbc[_0x4ebb('0x53')]['id']}})[_0x4ebb('0x21')](handleEntityNotFound(_0x935a11,null))['then'](function(_0x312a99){if(_0x312a99){_0x42f8b9=_0x312a99;return db[_0x4ebb('0x81')]['find']({'where':{'id':_0x312a99[_0x4ebb('0x82')]}});}})[_0x4ebb('0x21')](handleEntityNotFound(_0x935a11,null))[_0x4ebb('0x21')](function(_0x1b2500){if(_0x1b2500){logger[_0x4ebb('0x25')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x4ebb('0x2c'),'received\x20delivery\x20report\x20from',_0x1b2500[_0x4ebb('0x3e')],util[_0x4ebb('0x83')](_0x4c3fbc['body'],{'showHidden':![],'depth':null}));switch(_0x1b2500['type']){case _0x4ebb('0x84'):if(_0x4c3fbc['body']['MessageSid']&&_0x4c3fbc[_0x4ebb('0x58')][_0x4ebb('0x85')]===_0x42f8b9[_0x4ebb('0x86')]&&_0x4c3fbc[_0x4ebb('0x58')][_0x4ebb('0x87')]&&_0x4c3fbc[_0x4ebb('0x58')][_0x4ebb('0x87')]===_0x4ebb('0x88')){return _0x42f8b9[_0x4ebb('0x37')]({'read':!![]});}else{logger[_0x4ebb('0x28')](_0x4ebb('0x89'),'status',_0x4ebb('0x84'),util[_0x4ebb('0x83')](_0x4c3fbc['body'],{'showHidden':![],'depth':null}));}break;}return _0x42f8b9;}})[_0x4ebb('0x21')](respondWithResult(_0x935a11,null))[_0x4ebb('0x2a')](handleError(_0x935a11,null));}; \ No newline at end of file +var _0x757e=['lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','map','WhatsappMessage','rawAttributes','key','keys','query','intersection','model','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','find','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','RejectMessage','rejectMessage','contact','fullname','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','to-csv','ejs','fs-extra'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x757e,0x187));var _0xe757=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x757e[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xe757('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe757('0x2'));var moment=require(_0xe757('0x3'));var BPromise=require(_0xe757('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe757('0x5'));var ejs=require(_0xe757('0x6'));var fs=require('fs');var fs_extra=require(_0xe757('0x7'));var _=require(_0xe757('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe757('0x9'));var toCsv=require(_0xe757('0x5'));var querystring=require(_0xe757('0xa'));var Papa=require(_0xe757('0xb'));var Redis=require(_0xe757('0xc'));var authService=require(_0xe757('0xd'));var qs=require(_0xe757('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe757('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe757('0x10'));var licenseUtil=require(_0xe757('0x11'));var db=require('../../mysqldb')['db'];config[_0xe757('0x12')]=_[_0xe757('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe757('0x14'))(new Redis(config[_0xe757('0x12')]));require(_0xe757('0x15'))[_0xe757('0x16')](socket);var jayson=require(_0xe757('0x17'));var client=jayson['client'][_0xe757('0x18')]({'port':0x232c});var client9002=jayson[_0xe757('0x19')][_0xe757('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2943be,_0x15e7d4,_0x364503,_0x2e5f11){return new BPromise(function(_0x180d84,_0x4fe776){var _0xdd7dfd=_0x2e5f11||client;return _0xdd7dfd['request'](_0x2943be,_0x364503)[_0xe757('0x1a')](function(_0xbf521f){logger[_0xe757('0x1b')](_0xe757('0x1c'),_0x15e7d4,_0xe757('0x1d'));logger[_0xe757('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x15e7d4,_0xe757('0x1d'),JSON[_0xe757('0x1f')](_0xbf521f));if(_0xbf521f[_0xe757('0x20')]){if(_0xbf521f['error']['code']===0x1f4){logger[_0xe757('0x20')](_0xe757('0x1c'),_0x15e7d4,_0xbf521f[_0xe757('0x20')][_0xe757('0x21')]);return _0x4fe776(_0xbf521f[_0xe757('0x20')][_0xe757('0x21')]);}logger[_0xe757('0x20')](_0xe757('0x1c'),_0x15e7d4,_0xbf521f[_0xe757('0x20')][_0xe757('0x21')]);return _0x180d84(_0xbf521f[_0xe757('0x20')][_0xe757('0x21')]);}else{logger['info'](_0xe757('0x1c'),_0x15e7d4,'request\x20sent');_0x180d84(_0xbf521f[_0xe757('0x22')][_0xe757('0x21')]);}})[_0xe757('0x23')](function(_0x35373e){logger[_0xe757('0x20')](_0xe757('0x1c'),_0x15e7d4,_0x35373e);_0x4fe776(_0x35373e);});});}function respondWithStatusCode(_0x495c90,_0x59612e){_0x59612e=_0x59612e||0xcc;return function(_0x4f3206){if(_0x4f3206){return _0x495c90['sendStatus'](_0x59612e);}return _0x495c90[_0xe757('0x24')](_0x59612e)['end']();};}function respondWithResult(_0x3f20cf,_0xa6953e){_0xa6953e=_0xa6953e||0xc8;return function(_0x3f0680){if(_0x3f0680){return _0x3f20cf[_0xe757('0x24')](_0xa6953e)[_0xe757('0x25')](_0x3f0680);}};}function respondWithFilteredResult(_0x1e4778,_0x3c977b){return function(_0x188be2){if(_0x188be2){var _0x532086=typeof _0x3c977b['offset']===_0xe757('0x26')&&typeof _0x3c977b['limit']===_0xe757('0x26');var _0x2a11e9=_0x188be2[_0xe757('0x27')];var _0x3040b0=_0x532086?0x0:_0x3c977b[_0xe757('0x28')];var _0x248c82=_0x532086?_0x188be2[_0xe757('0x27')]:_0x3c977b[_0xe757('0x28')]+_0x3c977b[_0xe757('0x29')];var _0x3fafca;if(_0x248c82>=_0x2a11e9){_0x248c82=_0x2a11e9;_0x3fafca=0xc8;}else{_0x3fafca=0xce;}_0x1e4778[_0xe757('0x24')](_0x3fafca);return _0x1e4778[_0xe757('0x2a')]('Content-Range',_0x3040b0+'-'+_0x248c82+'/'+_0x2a11e9)[_0xe757('0x25')](_0x188be2);}return null;};}function patchUpdates(_0xbf4ba9){return function(_0x206a59){try{jsonpatch[_0xe757('0x2b')](_0x206a59,_0xbf4ba9,!![]);}catch(_0x6fe0f5){return BPromise[_0xe757('0x2c')](_0x6fe0f5);}return _0x206a59[_0xe757('0x2d')]();};}function saveUpdates(_0x314b46,_0x4f73df){return function(_0x4dcde0){if(_0x4dcde0){return _0x4dcde0[_0xe757('0x2e')](_0x314b46)['then'](function(_0x53fb61){return _0x53fb61;});}return null;};}function removeEntity(_0x27b445,_0x3242ec){return function(_0x1f22ba){if(_0x1f22ba){return _0x1f22ba[_0xe757('0x2f')]()[_0xe757('0x1a')](function(){_0x27b445[_0xe757('0x24')](0xcc)[_0xe757('0x30')]();});}};}function handleEntityNotFound(_0x11d7df,_0x5930b2){return function(_0x45aefd){if(!_0x45aefd){_0x11d7df[_0xe757('0x31')](0x194);}return _0x45aefd;};}function handleError(_0x2224c6,_0x4067b4){_0x4067b4=_0x4067b4||0x1f4;return function(_0x119122){logger[_0xe757('0x20')](_0x119122[_0xe757('0x32')]);if(_0x119122[_0xe757('0x33')]){delete _0x119122['name'];}_0x2224c6[_0xe757('0x24')](_0x4067b4)[_0xe757('0x34')](_0x119122);};}exports['index']=function(_0x513e33,_0x51765b){var _0x4dabd9={},_0x536b5e={},_0x15df9f={'count':0x0,'rows':[]};var _0x3446b8=_[_0xe757('0x35')](db[_0xe757('0x36')][_0xe757('0x37')],function(_0x5685c9){return{'name':_0x5685c9['fieldName'],'type':_0x5685c9['type'][_0xe757('0x38')]};});_0x536b5e['model']=_[_0xe757('0x35')](_0x3446b8,_0xe757('0x33'));_0x536b5e['query']=_[_0xe757('0x39')](_0x513e33[_0xe757('0x3a')]);_0x536b5e['filters']=_[_0xe757('0x3b')](_0x536b5e[_0xe757('0x3c')],_0x536b5e['query']);_0x4dabd9[_0xe757('0x3d')]=_[_0xe757('0x3b')](_0x536b5e[_0xe757('0x3c')],qs[_0xe757('0x3e')](_0x513e33[_0xe757('0x3a')][_0xe757('0x3e')]));_0x4dabd9['attributes']=_0x4dabd9[_0xe757('0x3d')]['length']?_0x4dabd9[_0xe757('0x3d')]:_0x536b5e['model'];if(!_0x513e33[_0xe757('0x3a')]['hasOwnProperty'](_0xe757('0x3f'))){_0x4dabd9['limit']=qs[_0xe757('0x29')](_0x513e33[_0xe757('0x3a')]['limit']);_0x4dabd9[_0xe757('0x28')]=qs[_0xe757('0x28')](_0x513e33[_0xe757('0x3a')][_0xe757('0x28')]);}_0x4dabd9['order']=qs[_0xe757('0x40')](_0x513e33[_0xe757('0x3a')][_0xe757('0x40')]);_0x4dabd9[_0xe757('0x41')]=qs[_0xe757('0x42')](_[_0xe757('0x43')](_0x513e33[_0xe757('0x3a')],_0x536b5e[_0xe757('0x42')]),_0x3446b8);if(_0x513e33[_0xe757('0x3a')][_0xe757('0x44')]){_0x4dabd9[_0xe757('0x41')]=_[_0xe757('0x45')](_0x4dabd9[_0xe757('0x41')],{'$or':_[_0xe757('0x35')](_0x3446b8,function(_0x37e9ba){if(_0x37e9ba[_0xe757('0x46')]!==_0xe757('0x47')){var _0x4e80b4={};_0x4e80b4[_0x37e9ba[_0xe757('0x33')]]={'$like':'%'+_0x513e33[_0xe757('0x3a')]['filter']+'%'};return _0x4e80b4;}})});}_0x4dabd9=_[_0xe757('0x45')]({},_0x4dabd9,_0x513e33[_0xe757('0x48')]);var _0x1d2708={'where':_0x4dabd9[_0xe757('0x41')]};return db[_0xe757('0x36')][_0xe757('0x27')](_0x1d2708)[_0xe757('0x1a')](function(_0x511800){_0x15df9f['count']=_0x511800;if(_0x513e33[_0xe757('0x3a')][_0xe757('0x49')]){_0x4dabd9[_0xe757('0x4a')]=[{'all':!![]}];}return db[_0xe757('0x36')][_0xe757('0x4b')](_0x4dabd9);})['then'](function(_0x3dfb6e){_0x15df9f['rows']=_0x3dfb6e;return _0x15df9f;})[_0xe757('0x1a')](respondWithFilteredResult(_0x51765b,_0x4dabd9))[_0xe757('0x23')](handleError(_0x51765b,null));};exports[_0xe757('0x4c')]=function(_0x204ad8,_0x21d42a){var _0x3ca444={'raw':!![],'where':{'id':_0x204ad8[_0xe757('0x4d')]['id']}},_0x5a58ba={};_0x5a58ba[_0xe757('0x3c')]=_['keys'](db[_0xe757('0x36')][_0xe757('0x37')]);_0x5a58ba[_0xe757('0x3a')]=_[_0xe757('0x39')](_0x204ad8['query']);_0x5a58ba[_0xe757('0x42')]=_['intersection'](_0x5a58ba[_0xe757('0x3c')],_0x5a58ba[_0xe757('0x3a')]);_0x3ca444['attributes']=_['intersection'](_0x5a58ba[_0xe757('0x3c')],qs[_0xe757('0x3e')](_0x204ad8[_0xe757('0x3a')]['fields']));_0x3ca444['attributes']=_0x3ca444[_0xe757('0x3d')]['length']?_0x3ca444[_0xe757('0x3d')]:_0x5a58ba[_0xe757('0x3c')];if(_0x204ad8['query'][_0xe757('0x49')]){_0x3ca444[_0xe757('0x4a')]=[{'all':!![]}];}_0x3ca444=_[_0xe757('0x45')]({},_0x3ca444,_0x204ad8['options']);return db[_0xe757('0x36')]['find'](_0x3ca444)['then'](handleEntityNotFound(_0x21d42a,null))[_0xe757('0x1a')](respondWithResult(_0x21d42a,null))[_0xe757('0x23')](handleError(_0x21d42a,null));};exports[_0xe757('0x4e')]=function(_0x209237,_0x1a41ae){return db[_0xe757('0x36')][_0xe757('0x4e')](_0x209237[_0xe757('0x4f')],{})[_0xe757('0x1a')](respondWithResult(_0x1a41ae,0xc9))[_0xe757('0x23')](handleError(_0x1a41ae,null));};exports[_0xe757('0x2e')]=function(_0x4155f2,_0x349435){if(_0x4155f2[_0xe757('0x4f')]['id']){delete _0x4155f2[_0xe757('0x4f')]['id'];}return db[_0xe757('0x36')]['find']({'where':{'id':_0x4155f2[_0xe757('0x4d')]['id']}})['then'](handleEntityNotFound(_0x349435,null))[_0xe757('0x1a')](saveUpdates(_0x4155f2[_0xe757('0x4f')],null))[_0xe757('0x1a')](respondWithResult(_0x349435,null))['catch'](handleError(_0x349435,null));};exports[_0xe757('0x2f')]=function(_0x585f78,_0x3bba46){return db[_0xe757('0x36')]['find']({'where':{'id':_0x585f78[_0xe757('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3bba46,null))[_0xe757('0x1a')](removeEntity(_0x3bba46,null))[_0xe757('0x23')](handleError(_0x3bba46,null));};exports[_0xe757('0x50')]=function(_0x427bad,_0x477485){return db['WhatsappMessage'][_0xe757('0x50')]()[_0xe757('0x1a')](respondWithResult(_0x477485,null))['catch'](handleError(_0x477485,null));};var interaction_log=require(_0xe757('0x51'))(_0xe757('0x52'));exports[_0xe757('0x53')]=function(_0x397361,_0x2bb451,_0x4419a0){var _0x33a3c3={'agent':{},'channel':_0xe757('0x54')};if(_0x397361[_0xe757('0x4f')]['id']){delete _0x397361[_0xe757('0x4f')]['id'];}_0x397361[_0xe757('0x4f')][_0xe757('0x55')]=!![];_0x397361[_0xe757('0x4f')][_0xe757('0x56')]=moment()[_0xe757('0x57')](_0xe757('0x58'));_0x397361[_0xe757('0x4f')][_0xe757('0x59')]=_0x397361[_0xe757('0x4f')][_0xe757('0x59')]||_0x397361[_0xe757('0x5a')]['id'];_0x33a3c3[_0xe757('0x5b')]['id']=_0x397361[_0xe757('0x4f')][_0xe757('0x59')];return db[_0xe757('0x36')][_0xe757('0x5c')]({'where':{'id':_0x397361[_0xe757('0x4d')]['id'],'UserId':null}})[_0xe757('0x1a')](handleEntityNotFound(_0x2bb451,null))[_0xe757('0x1a')](saveUpdates(_0x397361[_0xe757('0x4f')],null))[_0xe757('0x1a')](function(_0x26ceaf){if(_0x26ceaf){_0x33a3c3[_0xe757('0x21')]=_0x26ceaf[_0xe757('0x5d')]({'plain':!![]});return db[_0xe757('0x5e')][_0xe757('0x5c')]({'where':{'id':_0x26ceaf[_0xe757('0x5f')]}});}return null;})[_0xe757('0x1a')](handleEntityNotFound(_0x2bb451,null))[_0xe757('0x1a')](function(_0x1aea27){if(_0x1aea27){return _0x1aea27[_0xe757('0x2e')]({'UserId':_0x397361[_0xe757('0x4f')]['UserId'],'read1stAt':_[_0xe757('0x60')](_0x1aea27[_0xe757('0x61')])?moment()[_0xe757('0x57')](_0xe757('0x58')):undefined});}return null;})[_0xe757('0x1a')](function(_0x49ab9f){if(_0x49ab9f){_0x33a3c3['interaction']=_0x49ab9f[_0xe757('0x5d')]({'plain':!![]});interaction_log[_0xe757('0x1b')](_0xe757('0x62'),_0x397361[_0xe757('0x5a')]['id'],_0x397361[_0xe757('0x5a')][_0xe757('0x33')],_0x397361[_0xe757('0x5a')][_0xe757('0x63')],_0x33a3c3['interaction']['id'],_0x397361[_0xe757('0x4f')]?JSON['stringify'](_0x397361[_0xe757('0x4f')]):'null');return respondWithRpcPromise(_0xe757('0x64'),_0xe757('0x65'),_0x33a3c3);}return null;})[_0xe757('0x1a')](function(_0x4dc474){var _0x3b51d9=_0xe757('0x66')+_0x4dc474[_0xe757('0x21')][_0xe757('0x67')];return db[_0xe757('0x68')][_0xe757('0x3a')](_0x3b51d9,{'type':db[_0xe757('0x69')][_0xe757('0x6a')][_0xe757('0x6b')],'raw':!![]})[_0xe757('0x1a')](function(_0x294f07){return _0x294f07;});})['then'](function(_0x20768f){if(_0x20768f){_0x33a3c3[_0xe757('0x21')]['contact']=_0x20768f[0x0];if(!_0x397361[_0xe757('0x4f')][_0xe757('0x59')])return;return db[_0xe757('0x6c')][_0xe757('0x5c')]({'where':{'id':_0x397361[_0xe757('0x4f')][_0xe757('0x59')],'role':'agent'},'attributes':['id','name','fullname',_0xe757('0x6d'),'internal'],'raw':!![]});}return null;})['then'](function(_0x123555){if(!_0x123555)return null;_0x33a3c3['message']['agent']=_0x123555;return _0x33a3c3;})[_0xe757('0x1a')](function(_0x405bcb){if(_0x405bcb){if(_0x397361[_0xe757('0x4f')][_0xe757('0x6e')]){_0x33a3c3[_0xe757('0x21')][_0xe757('0x6f')]=util['format'](_0xe757('0x70'),_0x397361[_0xe757('0x5a')]['name']);_0x33a3c3['message'][_0xe757('0x71')]=_0x33a3c3[_0xe757('0x71')];_0x33a3c3[_0xe757('0x21')][_0xe757('0x72')]=_0x33a3c3[_0xe757('0x71')];_0x33a3c3[_0xe757('0x21')][_0xe757('0x73')]='accept';return respondWithRpcPromise(_0xe757('0x74'),'EventManager',{'event':'acceptmessage','message':_0x33a3c3['message']},client9002)[_0xe757('0x1a')](function(){return _0x33a3c3;});}return _0x33a3c3;}return null;})['then'](respondWithResult(_0x2bb451,null))[_0xe757('0x23')](handleError(_0x2bb451,null));};var interaction_log=require(_0xe757('0x51'))('whatsapp-interactions');exports[_0xe757('0x2c')]=function(_0x5eb492,_0x43d6b7,_0x356057){var _0x4bca50={'agent':{},'channel':_0xe757('0x54')};if(_0x5eb492['body']['id']){delete _0x5eb492[_0xe757('0x4f')]['id'];}_0x5eb492[_0xe757('0x4f')][_0xe757('0x59')]=_0x5eb492[_0xe757('0x4f')]['UserId']||_0x5eb492['user']['id'];_0x4bca50[_0xe757('0x5b')]['id']=_0x5eb492[_0xe757('0x4f')][_0xe757('0x59')];return db[_0xe757('0x36')][_0xe757('0x5c')]({'where':{'id':_0x5eb492['params']['id'],'UserId':null}})[_0xe757('0x1a')](handleEntityNotFound(_0x43d6b7,null))[_0xe757('0x1a')](function(_0x4b7153){if(_0x4b7153){_0x4bca50[_0xe757('0x21')]=_0x4b7153[_0xe757('0x5d')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x4b7153[_0xe757('0x5f')]}});}return null;})[_0xe757('0x1a')](handleEntityNotFound(_0x43d6b7,null))[_0xe757('0x1a')](function(_0x2e727c){if(_0x2e727c){_0x4bca50['interaction']=_0x2e727c[_0xe757('0x5d')]({'plain':!![]});interaction_log[_0xe757('0x1b')](_0xe757('0x75'),_0x5eb492[_0xe757('0x5a')]['id'],_0x5eb492[_0xe757('0x5a')][_0xe757('0x33')],_0x5eb492[_0xe757('0x5a')]['role'],_0x4bca50[_0xe757('0x76')]['id'],_0x5eb492['body']?JSON[_0xe757('0x1f')](_0x5eb492['body']):_0xe757('0x77'));return respondWithRpcPromise(_0xe757('0x78'),_0xe757('0x79'),_0x4bca50);}return null;})['then'](function(_0x37a8e3){var _0x2cba88=_0xe757('0x66')+_0x37a8e3[_0xe757('0x21')][_0xe757('0x67')];return db[_0xe757('0x68')]['query'](_0x2cba88,{'type':db['Sequelize'][_0xe757('0x6a')][_0xe757('0x6b')],'raw':!![]})[_0xe757('0x1a')](function(_0x438e9d){return _0x438e9d;});})['then'](function(_0x5c7df6){if(_0x5c7df6){_0x4bca50[_0xe757('0x21')][_0xe757('0x7a')]=_0x5c7df6[0x0];if(!_0x5eb492[_0xe757('0x4f')][_0xe757('0x59')])return;return db[_0xe757('0x6c')]['find']({'where':{'id':_0x5eb492['body']['UserId'],'role':'agent'},'attributes':['id',_0xe757('0x33'),_0xe757('0x7b'),_0xe757('0x6d'),_0xe757('0x7c')],'raw':!![]});}return null;})[_0xe757('0x1a')](function(_0x31014){if(!_0x31014)return null;_0x4bca50[_0xe757('0x21')]['agent']=_0x31014;return _0x4bca50;})[_0xe757('0x1a')](function(_0x9591){if(_0x9591){_0x9591['message'][_0xe757('0x6f')]=util['format'](_0xe757('0x70'),_0x5eb492[_0xe757('0x5a')]['name']);_0x9591[_0xe757('0x21')][_0xe757('0x71')]=_0x4bca50[_0xe757('0x71')];_0x9591[_0xe757('0x21')][_0xe757('0x72')]=_0x4bca50['channel'];_0x9591[_0xe757('0x21')][_0xe757('0x73')]=_0xe757('0x2c');respondWithRpcPromise(_0xe757('0x74'),_0xe757('0x74'),{'event':_0xe757('0x7d'),'message':_0x9591[_0xe757('0x21')]},client9002);return _0x4bca50;}return null;})[_0xe757('0x1a')](respondWithResult(_0x43d6b7,null))[_0xe757('0x23')](handleError(_0x43d6b7,null));};exports[_0xe757('0x24')]=function(_0x28e9c0,_0x5d9426,_0x186da9){if(_0x28e9c0[_0xe757('0x4f')]['id']){delete _0x28e9c0[_0xe757('0x4f')]['id'];}var _0x206a00;return db['WhatsappMessage'][_0xe757('0x5c')]({'where':{'id':_0x28e9c0[_0xe757('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d9426,null))[_0xe757('0x1a')](function(_0x2f2869){if(_0x2f2869){_0x206a00=_0x2f2869;return db[_0xe757('0x7e')][_0xe757('0x5c')]({'where':{'id':_0x2f2869[_0xe757('0x7f')]}});}})[_0xe757('0x1a')](handleEntityNotFound(_0x5d9426,null))[_0xe757('0x1a')](function(_0x262d25){if(_0x262d25){logger[_0xe757('0x1e')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xe757('0x24'),_0xe757('0x80'),_0x262d25[_0xe757('0x46')],util['inspect'](_0x28e9c0['body'],{'showHidden':![],'depth':null}));switch(_0x262d25[_0xe757('0x46')]){case'twilio':if(_0x28e9c0[_0xe757('0x4f')][_0xe757('0x81')]&&_0x28e9c0[_0xe757('0x4f')][_0xe757('0x81')]===_0x206a00[_0xe757('0x82')]&&_0x28e9c0[_0xe757('0x4f')][_0xe757('0x83')]&&_0x28e9c0[_0xe757('0x4f')]['MessageStatus']===_0xe757('0x55')){return _0x206a00[_0xe757('0x2e')]({'read':!![]});}else{logger['error'](_0xe757('0x84'),_0xe757('0x24'),'twilio',util['inspect'](_0x28e9c0[_0xe757('0x4f')],{'showHidden':![],'depth':null}));}break;}return _0x206a00;}})[_0xe757('0x1a')](respondWithResult(_0x5d9426,null))['catch'](handleError(_0x5d9426,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d23d515..af33fae 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 _0x282b=['save','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x2ddfd6,_0x48c9cf){var _0x1be0c6=function(_0xc74ac6){while(--_0xc74ac6){_0x2ddfd6['push'](_0x2ddfd6['shift']());}};_0x1be0c6(++_0x48c9cf);}(_0x282b,0xec));var _0xb282=function(_0xd3559f,_0x5e9c36){_0xd3559f=_0xd3559f-0x0;var _0xdecf79=_0x282b[_0xd3559f];return _0xdecf79;};'use strict';var EventEmitter=require(_0xb282('0x0'));var WhatsappMessage=require(_0xb282('0x1'))['db'][_0xb282('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb282('0x3')](0x0);var events={'afterCreate':_0xb282('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x25d77d){return function(_0x5cadd7,_0x3fbbaf,_0x175c83){WhatsappMessageEvents[_0xb282('0x5')](_0x25d77d+':'+_0x5cadd7['id'],_0x5cadd7);WhatsappMessageEvents[_0xb282('0x5')](_0x25d77d,_0x5cadd7);_0x175c83(null);};}for(var e in events){if(events[_0xb282('0x6')](e)){var event=events[e];WhatsappMessage[_0xb282('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xcf66=['exports','events','../../mysqldb','WhatsappMessage','save','update','emit','hasOwnProperty'];(function(_0x3d9de3,_0x5067bf){var _0x59dfd9=function(_0x2beb1a){while(--_0x2beb1a){_0x3d9de3['push'](_0x3d9de3['shift']());}};_0x59dfd9(++_0x5067bf);}(_0xcf66,0x71));var _0x6cf6=function(_0xe945c8,_0x3597a3){_0xe945c8=_0xe945c8-0x0;var _0x20492c=_0xcf66[_0xe945c8];return _0x20492c;};'use strict';var EventEmitter=require(_0x6cf6('0x0'));var WhatsappMessage=require(_0x6cf6('0x1'))['db'][_0x6cf6('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6cf6('0x3'),'afterUpdate':_0x6cf6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4e16eb){return function(_0x1c599d,_0x45d0d8,_0x57f22f){WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb+':'+_0x1c599d['id'],_0x1c599d);WhatsappMessageEvents[_0x6cf6('0x5')](_0x4e16eb,_0x1c599d);_0x57f22f(null);};}for(var e in events){if(events[_0x6cf6('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x6cf6('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 8fd1e5c..4324b50 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 _0x946e=['authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','sinch','baseUrl','/whatsapp/v1/','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','lodash','../../config/logger','moment','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','models','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','find','WhatsappAccountId','type','twilio','accountSid'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x946e,0x1d0));var _0xe946=function(_0xf6ea70,_0x7c1c6e){_0xf6ea70=_0xf6ea70-0x0;var _0x24898a=_0x946e[_0xf6ea70];return _0x24898a;};'use strict';var _=require(_0xe946('0x0'));var util=require('util');var logger=require(_0xe946('0x1'))('api');var moment=require(_0xe946('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0xe946('0x3'));var fs=require('fs');var path=require(_0xe946('0x4'));var rimraf=require(_0xe946('0x5'));var config=require(_0xe946('0x6'));var attributes=require(_0xe946('0x7'));module['exports']=function(_0x123d0c,_0x1b3546){return _0x123d0c[_0xe946('0x8')]('WhatsappMessage',attributes,{'tableName':_0xe946('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe946('0xa')]},{'name':_0xe946('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e9fc,_0x286140,_0x49b412){var _0x5679f6=_0x123d0c[_0xe946('0xc')];var _0xd0f134=_0x49e9fc['get']({'plain':!![]});if(_0xd0f134['direction'][_0xe946('0xd')]()==='in'||_0xd0f134[_0xe946('0xe')]['toLowerCase']()===_0xe946('0xf')&&!_0xd0f134[_0xe946('0x10')]&&!_[_0xe946('0x11')](_0xd0f134[_0xe946('0x12')])){_0x5679f6[_0xe946('0x13')][_0xe946('0x14')]({'where':{'id':_0xd0f134[_0xe946('0x15')]}})['then'](function(_0x50983e){if(_0x50983e){_0x50983e[_0xe946('0x16')]({'lastMsgAt':_0xd0f134[_0xe946('0x17')],'lastMsgDirection':_0xd0f134[_0xe946('0xe')]['toLowerCase']()});}})[_0xe946('0x18')](function(_0x437f13){console[_0xe946('0x19')](_0x437f13);});}if(_0xd0f134['direction']===_0xe946('0xf')&&!_0xd0f134[_0xe946('0x10')]){var _0x20f621;_0x5679f6['WhatsappAccount'][_0xe946('0x1a')]({'where':{'id':_0xd0f134[_0xe946('0x1b')]},'raw':!![]})['then'](function(_0x2b2b66){_0x20f621=_0x2b2b66;if(_0x20f621&&_0x20f621['type']){switch(_0x20f621[_0xe946('0x1c')]){case _0xe946('0x1d'):var _0x5d9d14=require(_0xe946('0x1d'));if(_0x20f621[_0xe946('0x1e')]&&_0x20f621[_0xe946('0x1f')]&&_0x20f621[_0xe946('0x20')]){var _0x16f491=new _0x5d9d14(_0x20f621[_0xe946('0x1e')],_0x20f621[_0xe946('0x1f')]);_0x16f491[_0xe946('0x21')][_0xe946('0x22')]({'body':_0xd0f134[_0xe946('0x23')],'to':'whatsapp:'+_0xd0f134[_0xe946('0x20')],'from':_0xe946('0x24')+_0x20f621[_0xe946('0x20')],'statusCallback':_0x20f621[_0xe946('0x25')]+_0xe946('0x26')+_0xd0f134['id']+_0xe946('0x27')+_0x20f621['token']})[_0xe946('0x28')](function(_0x360248){if(_0x360248[_0xe946('0x29')]){return _0x49e9fc[_0xe946('0x16')]({'messageId':_0x360248[_0xe946('0x29')]});}})[_0xe946('0x18')](function(_0x289f5e){logger[_0xe946('0x19')](_0xe946('0x2a'),'afterCreate',_0xe946('0x1d'),util[_0xe946('0x2b')](_0x289f5e,{'showHidden':![],'depth':null}));});}else{logger[_0xe946('0x19')](_0xe946('0x2a'),_0xe946('0x2c'),_0xe946('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xe946('0x2d'):var _0x435aa9=_0x20f621[_0xe946('0x1e')];var _0x25682f=_0x20f621[_0xe946('0x1f')];var _0x1e41d2=_0x20f621[_0xe946('0x2e')]+_0xe946('0x2f')+_0x435aa9+'/messages/';var _0x2e5ab0={'to':[_0xd0f134[_0xe946('0x20')]],'message':{'type':'text','text':_0xd0f134[_0xe946('0x23')]}};var _0x207a97={'method':_0xe946('0x30'),'uri':_0x1e41d2,'headers':{'Authorization':_0xe946('0x31')+_0x25682f,'Content-Type':'application/json'},'body':_0x2e5ab0,'json':!![]};rp(_0x207a97)[_0xe946('0x28')](function(_0xbd026d){if(_0xbd026d[_0xe946('0x32')][0x0][_0xe946('0x33')]){return _0x49e9fc[_0xe946('0x16')]({'messageId':_0xbd026d['statuses'][0x0][_0xe946('0x33')]});}})[_0xe946('0x18')](function(_0x35c87d){logger[_0xe946('0x34')](_0xe946('0x35'),_0x35c87d);});break;}}})['finally'](function(){_0x49b412();});}else{_0x49b412();}}},'charset':_0xe946('0x36'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x004c=['api','moment','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','util','../../config/logger'];(function(_0x2ccf87,_0x2ad346){var _0x9256db=function(_0x2fea89){while(--_0x2fea89){_0x2ccf87['push'](_0x2ccf87['shift']());}};_0x9256db(++_0x2ad346);}(_0x004c,0x76));var _0xc004=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x004c[_0x220f3f];return _0x1f170e;};'use strict';var _=require('lodash');var util=require(_0xc004('0x0'));var logger=require(_0xc004('0x1'))(_0xc004('0x2'));var moment=require(_0xc004('0x3'));var BPromise=require('bluebird');var rp=require(_0xc004('0x4'));var fetch=require(_0xc004('0x5'));var fs=require('fs');var path=require(_0xc004('0x6'));var rimraf=require(_0xc004('0x7'));var config=require(_0xc004('0x8'));var attributes=require(_0xc004('0x9'));module[_0xc004('0xa')]=function(_0x291cf0,_0x3e0262){return _0x291cf0[_0xc004('0xb')](_0xc004('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xc004('0xd'),'fields':['messageId']},{'name':_0xc004('0xe'),'fields':[_0xc004('0xf')],'type':_0xc004('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3114e3,_0xddc68a,_0x62e50a){var _0x198980=_0x291cf0['models'];var _0xe672ee=_0x3114e3[_0xc004('0x11')]({'plain':!![]});if(_0xe672ee[_0xc004('0x12')][_0xc004('0x13')]()==='in'||_0xe672ee[_0xc004('0x12')][_0xc004('0x13')]()===_0xc004('0x14')&&!_0xe672ee[_0xc004('0x15')]&&!_[_0xc004('0x16')](_0xe672ee[_0xc004('0x17')])){_0x198980[_0xc004('0x18')]['findOne']({'where':{'id':_0xe672ee[_0xc004('0x19')]}})[_0xc004('0x1a')](function(_0x4bc9e3){if(_0x4bc9e3){_0x4bc9e3[_0xc004('0x1b')]({'lastMsgAt':_0xe672ee[_0xc004('0x1c')],'lastMsgDirection':_0xe672ee[_0xc004('0x12')][_0xc004('0x13')]()});}})[_0xc004('0x1d')](function(_0x58f55c){console[_0xc004('0x1e')](_0x58f55c);});}if(_0xe672ee[_0xc004('0x12')]===_0xc004('0x14')&&!_0xe672ee[_0xc004('0x15')]){var _0x543df4;_0x198980[_0xc004('0x1f')][_0xc004('0x20')]({'where':{'id':_0xe672ee['WhatsappAccountId']},'raw':!![]})[_0xc004('0x1a')](function(_0x5566ad){_0x543df4=_0x5566ad;if(_0x543df4&&_0x543df4[_0xc004('0x21')]){switch(_0x543df4[_0xc004('0x21')]){case _0xc004('0x22'):var _0x1039f1=require(_0xc004('0x22'));if(_0x543df4[_0xc004('0x23')]&&_0x543df4[_0xc004('0x24')]&&_0x543df4[_0xc004('0x25')]){var _0x810652=new _0x1039f1(_0x543df4['accountSid'],_0x543df4[_0xc004('0x24')]);_0x810652['messages']['create']({'body':_0xe672ee[_0xc004('0xf')],'to':_0xc004('0x26')+_0xe672ee[_0xc004('0x25')],'from':_0xc004('0x26')+_0x543df4['phone'],'statusCallback':_0x543df4[_0xc004('0x27')]+_0xc004('0x28')+_0xe672ee['id']+_0xc004('0x29')+_0x543df4['token']})[_0xc004('0x1a')](function(_0x5d05d0){if(_0x5d05d0[_0xc004('0x2a')]){return _0x3114e3[_0xc004('0x1b')]({'messageId':_0x5d05d0['sid']});}})['catch'](function(_0x3e8c03){logger[_0xc004('0x1e')](_0xc004('0x2b'),'afterCreate',_0xc004('0x22'),util[_0xc004('0x2c')](_0x3e8c03,{'showHidden':![],'depth':null}));});}else{logger[_0xc004('0x1e')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc004('0x2d'),_0xc004('0x22'),_0xc004('0x2e'));}break;case _0xc004('0x2f'):var _0x509aac=_0x543df4[_0xc004('0x23')];var _0x54ad9d=_0x543df4['authToken'];var _0x3bb481=_0x543df4[_0xc004('0x30')]+_0xc004('0x31')+_0x509aac+_0xc004('0x32');var _0xe53fdd={'to':[_0xe672ee[_0xc004('0x25')]],'message':{'type':_0xc004('0x33'),'text':_0xe672ee[_0xc004('0xf')]}};var _0xe4778f={'method':'POST','uri':_0x3bb481,'headers':{'Authorization':_0xc004('0x34')+_0x54ad9d,'Content-Type':_0xc004('0x35')},'body':_0xe53fdd,'json':!![]};rp(_0xe4778f)[_0xc004('0x1a')](function(_0x1d991c){if(_0x1d991c[_0xc004('0x36')][0x0][_0xc004('0x37')]){return _0x3114e3[_0xc004('0x1b')]({'messageId':_0x1d991c[_0xc004('0x36')][0x0][_0xc004('0x37')]});}})['catch'](function(_0x5726bf){logger[_0xc004('0x38')](_0xc004('0x39'),_0x5726bf);});break;}}})[_0xc004('0x3a')](function(){_0x62e50a();});}else{_0x62e50a();}}},'charset':_0xc004('0x3b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 7fa2fc6..7531ed3 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 _0x43ae=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappMessage','create','body','options','raw','catch','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','then'];(function(_0x1a13b1,_0x4d1d25){var _0x395e05=function(_0x209692){while(--_0x209692){_0x1a13b1['push'](_0x1a13b1['shift']());}};_0x395e05(++_0x4d1d25);}(_0x43ae,0x1ec));var _0xe43a=function(_0x5ccacb,_0x29439d){_0x5ccacb=_0x5ccacb-0x0;var _0x371606=_0x43ae[_0x5ccacb];return _0x371606;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe43a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe43a('0x1'));var logger=require(_0xe43a('0x2'))(_0xe43a('0x3'));var config=require(_0xe43a('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe43a('0x5')](config[_0xe43a('0x6')],{'host':_0xe43a('0x7'),'port':0x18eb});var socket=require(_0xe43a('0x8'))(new Redis(config['redis']));require(_0xe43a('0x9'))['register'](socket);function respondWithRpcPromise(_0x2b1093,_0x4cb291,_0x671f83){return new BPromise(function(_0x914469,_0x473802){return client[_0xe43a('0xa')](_0x2b1093,_0x671f83)[_0xe43a('0xb')](function(_0x328313){logger[_0xe43a('0xc')](_0xe43a('0xd'),_0x4cb291,_0xe43a('0xe'));logger[_0xe43a('0xf')](_0xe43a('0x10'),_0x4cb291,_0xe43a('0xe'),JSON[_0xe43a('0x11')](_0x328313));if(_0x328313[_0xe43a('0x12')]){if(_0x328313[_0xe43a('0x12')][_0xe43a('0x13')]===0x1f4){logger[_0xe43a('0x12')](_0xe43a('0xd'),_0x4cb291,_0x328313['error'][_0xe43a('0x14')]);return _0x473802(_0x328313['error'][_0xe43a('0x14')]);}logger[_0xe43a('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x4cb291,_0x328313['error']['message']);return _0x914469(_0x328313[_0xe43a('0x12')]['message']);}else{logger['info'](_0xe43a('0xd'),_0x4cb291,_0xe43a('0xe'));_0x914469(_0x328313[_0xe43a('0x15')]['message']);}})['catch'](function(_0x5d033f){logger[_0xe43a('0x12')](_0xe43a('0xd'),_0x4cb291,_0x5d033f);_0x473802(_0x5d033f);});});}exports[_0xe43a('0x16')]=function(_0x1f9e53){var _0x28cae3=this;return new Promise(function(_0x3afb79,_0x26ba55){return db['WhatsappMessage'][_0xe43a('0x17')](_0x1f9e53[_0xe43a('0x18')],{'raw':_0x1f9e53[_0xe43a('0x19')]?_0x1f9e53[_0xe43a('0x19')][_0xe43a('0x1a')]===undefined?!![]:![]:!![]})[_0xe43a('0xb')](function(_0x94978c){logger[_0xe43a('0xc')](_0xe43a('0x16'),_0x1f9e53);logger[_0xe43a('0xf')](_0xe43a('0x16'),_0x1f9e53,JSON['stringify'](_0x94978c));_0x3afb79(_0x94978c);})[_0xe43a('0x1b')](function(_0x103f87){logger[_0xe43a('0x12')](_0xe43a('0x16'),_0x103f87[_0xe43a('0x14')],_0x1f9e53);_0x26ba55(_0x28cae3['error'](0x1f4,_0x103f87['message']));});});}; \ No newline at end of file +var _0x51a0=['request\x20sent','stringify','error','code','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','body','raw','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3937ec,_0x4873be){var _0x4dee34=function(_0x143cab){while(--_0x143cab){_0x3937ec['push'](_0x3937ec['shift']());}};_0x4dee34(++_0x4873be);}(_0x51a0,0x123));var _0x051a=function(_0x39b51c,_0x40010d){_0x39b51c=_0x39b51c-0x0;var _0x146312=_0x51a0[_0x39b51c];return _0x146312;};'use strict';var _=require('lodash');var util=require(_0x051a('0x0'));var moment=require(_0x051a('0x1'));var BPromise=require(_0x051a('0x2'));var rs=require(_0x051a('0x3'));var fs=require('fs');var Redis=require(_0x051a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x051a('0x5'))(_0x051a('0x6'));var config=require(_0x051a('0x7'));var jayson=require(_0x051a('0x8'));var client=jayson['client'][_0x051a('0x9')]({'port':0x232a});config[_0x051a('0xa')]=_['defaults'](config[_0x051a('0xa')],{'host':_0x051a('0xb'),'port':0x18eb});var socket=require(_0x051a('0xc'))(new Redis(config['redis']));require(_0x051a('0xd'))[_0x051a('0xe')](socket);function respondWithRpcPromise(_0x55be27,_0x5ee999,_0x5e11f7){return new BPromise(function(_0x9b6ac1,_0x1c9e94){return client[_0x051a('0xf')](_0x55be27,_0x5e11f7)['then'](function(_0x211840){logger['info'](_0x051a('0x10'),_0x5ee999,'request\x20sent');logger[_0x051a('0x11')](_0x051a('0x12'),_0x5ee999,_0x051a('0x13'),JSON[_0x051a('0x14')](_0x211840));if(_0x211840[_0x051a('0x15')]){if(_0x211840[_0x051a('0x15')][_0x051a('0x16')]===0x1f4){logger[_0x051a('0x15')](_0x051a('0x10'),_0x5ee999,_0x211840[_0x051a('0x15')]['message']);return _0x1c9e94(_0x211840[_0x051a('0x15')][_0x051a('0x17')]);}logger['error'](_0x051a('0x10'),_0x5ee999,_0x211840['error'][_0x051a('0x17')]);return _0x9b6ac1(_0x211840[_0x051a('0x15')][_0x051a('0x17')]);}else{logger[_0x051a('0x18')](_0x051a('0x10'),_0x5ee999,'request\x20sent');_0x9b6ac1(_0x211840[_0x051a('0x19')]['message']);}})[_0x051a('0x1a')](function(_0x22aabb){logger[_0x051a('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x5ee999,_0x22aabb);_0x1c9e94(_0x22aabb);});});}exports[_0x051a('0x1b')]=function(_0x555778){var _0x44c027=this;return new Promise(function(_0x1ce562,_0x53d78c){return db[_0x051a('0x1c')]['create'](_0x555778[_0x051a('0x1d')],{'raw':_0x555778['options']?_0x555778['options'][_0x051a('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x499d84){logger[_0x051a('0x18')]('CreateWhatsappMessage',_0x555778);logger['debug'](_0x051a('0x1b'),_0x555778,JSON['stringify'](_0x499d84));_0x1ce562(_0x499d84);})[_0x051a('0x1a')](function(_0x4a3221){logger[_0x051a('0x15')](_0x051a('0x1b'),_0x4a3221[_0x051a('0x17')],_0x555778);_0x53d78c(_0x44c027['error'](0x1f4,_0x4a3221['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 1b50b44..062f5ef 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 _0x521a=['emit','register','length','whatsappMessage:','./whatsappMessage.events','remove'];(function(_0x13ff53,_0x5e1424){var _0x290228=function(_0x3e3133){while(--_0x3e3133){_0x13ff53['push'](_0x13ff53['shift']());}};_0x290228(++_0x5e1424);}(_0x521a,0x1d8));var _0xa521=function(_0x28d664,_0x8e4d85){_0x28d664=_0x28d664-0x0;var _0x1ce626=_0x521a[_0x28d664];return _0x1ce626;};'use strict';var WhatsappMessageEvents=require(_0xa521('0x0'));var events=['save',_0xa521('0x1'),'update'];function createListener(_0xef9859,_0x53a342){return function(_0x144865){_0x53a342[_0xa521('0x2')](_0xef9859,_0x144865);};}function removeListener(_0x2d12b5,_0x54b022){return function(){WhatsappMessageEvents['removeListener'](_0x2d12b5,_0x54b022);};}exports[_0xa521('0x3')]=function(_0x2d3b8f){for(var _0x5593c3=0x0,_0x4ca823=events[_0xa521('0x4')];_0x5593c3<_0x4ca823;_0x5593c3++){var _0xd8e1c=events[_0x5593c3];var _0x140c36=createListener(_0xa521('0x5')+_0xd8e1c,_0x2d3b8f);WhatsappMessageEvents['on'](_0xd8e1c,_0x140c36);}}; \ No newline at end of file +var _0x24e2=['register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener'];(function(_0x10bd3d,_0x478dfb){var _0x48d6fd=function(_0xdf597f){while(--_0xdf597f){_0x10bd3d['push'](_0x10bd3d['shift']());}};_0x48d6fd(++_0x478dfb);}(_0x24e2,0xae));var _0x224e=function(_0x3474fb,_0x491ee3){_0x3474fb=_0x3474fb-0x0;var _0x5061f5=_0x24e2[_0x3474fb];return _0x5061f5;};'use strict';var WhatsappMessageEvents=require(_0x224e('0x0'));var events=[_0x224e('0x1'),_0x224e('0x2'),_0x224e('0x3')];function createListener(_0x35e79d,_0x19f60f){return function(_0x4a2c1d){_0x19f60f[_0x224e('0x4')](_0x35e79d,_0x4a2c1d);};}function removeListener(_0x96cd4,_0x202f76){return function(){WhatsappMessageEvents[_0x224e('0x5')](_0x96cd4,_0x202f76);};}exports[_0x224e('0x6')]=function(_0xbe4be4){for(var _0x2f9c27=0x0,_0xe61f07=events[_0x224e('0x7')];_0x2f9c27<_0xe61f07;_0x2f9c27++){var _0x44861f=events[_0x2f9c27];var _0x4cf605=createListener(_0x224e('0x8')+_0x44861f,_0xbe4be4);WhatsappMessageEvents['on'](_0x44861f,_0x4cf605);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 558560d..446a3be 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 _0xaa65=['get','index','/describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller'];(function(_0x19348e,_0x2d361e){var _0x52f4c7=function(_0x206f2d){while(--_0x206f2d){_0x19348e['push'](_0x19348e['shift']());}};_0x52f4c7(++_0x2d361e);}(_0xaa65,0x6b));var _0x5aa6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa65[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5aa6('0x0'));var util=require('util');var path=require(_0x5aa6('0x1'));var timeout=require(_0x5aa6('0x2'));var express=require(_0x5aa6('0x3'));var router=express[_0x5aa6('0x4')]();var fs_extra=require(_0x5aa6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5aa6('0x6'));var config=require(_0x5aa6('0x7'));var controller=require(_0x5aa6('0x8'));router[_0x5aa6('0x9')]('/',auth['isAuthenticated'](),controller[_0x5aa6('0xa')]);router[_0x5aa6('0x9')](_0x5aa6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x5aa6('0xc'),auth[_0x5aa6('0xd')](),controller[_0x5aa6('0xe')]);router[_0x5aa6('0x9')](_0x5aa6('0xf'),auth[_0x5aa6('0xd')](),controller[_0x5aa6('0x10')]);router['get'](_0x5aa6('0x11'),auth[_0x5aa6('0xd')](),controller['getTeams']);router[_0x5aa6('0x9')](_0x5aa6('0x12'),auth['isAuthenticated'](),controller[_0x5aa6('0x13')]);router[_0x5aa6('0x14')]('/',auth[_0x5aa6('0xd')](),controller[_0x5aa6('0x15')]);router['post'](_0x5aa6('0x11'),auth[_0x5aa6('0xd')](),controller[_0x5aa6('0x16')]);router[_0x5aa6('0x14')](_0x5aa6('0x12'),auth[_0x5aa6('0xd')](),controller['addAgents']);router[_0x5aa6('0x17')](_0x5aa6('0xc'),auth[_0x5aa6('0xd')](),controller[_0x5aa6('0x18')]);router[_0x5aa6('0x19')](_0x5aa6('0xc'),auth[_0x5aa6('0xd')](),controller[_0x5aa6('0x1a')]);router[_0x5aa6('0x19')](_0x5aa6('0x11'),auth[_0x5aa6('0xd')](),controller['removeTeams']);router[_0x5aa6('0x19')](_0x5aa6('0x12'),auth[_0x5aa6('0xd')](),controller[_0x5aa6('0x1b')]);module[_0x5aa6('0x1c')]=router; \ No newline at end of file +var _0xb796=['/:id/teams','addTeams','update','delete','removeTeams','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post'];(function(_0xe30a3f,_0x2971c0){var _0x33b504=function(_0x35a6ff){while(--_0x35a6ff){_0xe30a3f['push'](_0xe30a3f['shift']());}};_0x33b504(++_0x2971c0);}(_0xb796,0xd2));var _0x6b79=function(_0x37d9dd,_0x924888){_0x37d9dd=_0x37d9dd-0x0;var _0x20983e=_0xb796[_0x37d9dd];return _0x20983e;};'use strict';var multer=require(_0x6b79('0x0'));var util=require(_0x6b79('0x1'));var path=require(_0x6b79('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6b79('0x3')]();var fs_extra=require(_0x6b79('0x4'));var auth=require(_0x6b79('0x5'));var interaction=require(_0x6b79('0x6'));var config=require(_0x6b79('0x7'));var controller=require(_0x6b79('0x8'));router[_0x6b79('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6b79('0x9')](_0x6b79('0xa'),auth[_0x6b79('0xb')](),controller[_0x6b79('0xc')]);router[_0x6b79('0x9')](_0x6b79('0xd'),auth[_0x6b79('0xb')](),controller[_0x6b79('0xe')]);router[_0x6b79('0x9')](_0x6b79('0xf'),auth[_0x6b79('0xb')](),controller[_0x6b79('0x10')]);router[_0x6b79('0x9')]('/:id/teams',auth[_0x6b79('0xb')](),controller[_0x6b79('0x11')]);router[_0x6b79('0x9')](_0x6b79('0x12'),auth['isAuthenticated'](),controller[_0x6b79('0x13')]);router['post']('/',auth[_0x6b79('0xb')](),controller[_0x6b79('0x14')]);router[_0x6b79('0x15')](_0x6b79('0x16'),auth[_0x6b79('0xb')](),controller[_0x6b79('0x17')]);router[_0x6b79('0x15')](_0x6b79('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x6b79('0xd'),auth['isAuthenticated'](),controller[_0x6b79('0x18')]);router[_0x6b79('0x19')](_0x6b79('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x6b79('0x19')](_0x6b79('0x16'),auth[_0x6b79('0xb')](),controller[_0x6b79('0x1a')]);router[_0x6b79('0x19')](_0x6b79('0x12'),auth[_0x6b79('0xb')](),controller[_0x6b79('0x1b')]);module[_0x6b79('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 90bcf94..6465144 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 _0xfd28=['INTEGER','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x2b9bef,_0x125fac){var _0x2ee200=function(_0x324e54){while(--_0x324e54){_0x2b9bef['push'](_0x2b9bef['shift']());}};_0x2ee200(++_0x125fac);}(_0xfd28,0x148));var _0x8fd2=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xfd28[_0x4e7d25];return _0x526fe6;};'use strict';var Sequelize=require('sequelize');module[_0x8fd2('0x0')]={'name':{'type':Sequelize[_0x8fd2('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8fd2('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8fd2('0x3'),_0x8fd2('0x4'),_0x8fd2('0x5'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7cda=['exports','STRING','name','ENUM','rrmemory','roundrobin'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xa7cd('0x0')]={'name':{'type':Sequelize[_0xa7cd('0x1')],'unique':_0xa7cd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa7cd('0x3')](_0xa7cd('0x4'),'beepall',_0xa7cd('0x5'))},'description':{'type':Sequelize[_0xa7cd('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7d093c6..56b2018 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 _0x0b6e=['catch','show','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserWhatsappQueue','rawAttributes','User','UserId','agent','whatsappPause','updatedAt','SIP','createdAt','getTeams','nolimit','addTeams','Team','Agents','online','voicePause','interface','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','includes','all','union','compact','transaction','removeAgents','forEach','userWhatsappQueue:remove','addAgents','ids','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows'];(function(_0x5da498,_0x28e296){var _0xbd1bac=function(_0x123a2f){while(--_0x123a2f){_0x5da498['push'](_0x5da498['shift']());}};_0xbd1bac(++_0x28e296);}(_0x0b6e,0xc9));var _0xe0b6=function(_0x12afbc,_0x54a78f){_0x12afbc=_0x12afbc-0x0;var _0x5952bf=_0x0b6e[_0x12afbc];return _0x5952bf;};'use strict';var emlformat=require(_0xe0b6('0x0'));var rimraf=require(_0xe0b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b6('0x2'));var rp=require(_0xe0b6('0x3'));var moment=require(_0xe0b6('0x4'));var BPromise=require(_0xe0b6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe0b6('0x6'));var sox=require(_0xe0b6('0x7'));var csv=require(_0xe0b6('0x8'));var ejs=require(_0xe0b6('0x9'));var fs=require('fs');var fs_extra=require(_0xe0b6('0xa'));var _=require(_0xe0b6('0xb'));var squel=require(_0xe0b6('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0b6('0xd'));var deskjs=require(_0xe0b6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe0b6('0xf'));var Papa=require(_0xe0b6('0x10'));var Redis=require(_0xe0b6('0x11'));var authService=require(_0xe0b6('0x12'));var qs=require(_0xe0b6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0b6('0x14'));var logger=require(_0xe0b6('0x15'))(_0xe0b6('0x16'));var utils=require(_0xe0b6('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe0b6('0x18'))['db'];config[_0xe0b6('0x19')]=_[_0xe0b6('0x1a')](config[_0xe0b6('0x19')],{'host':_0xe0b6('0x1b'),'port':0x18eb});var socket=require(_0xe0b6('0x1c'))(new Redis(config['redis']));require(_0xe0b6('0x1d'))[_0xe0b6('0x1e')](socket);function respondWithStatusCode(_0x3aa868,_0x5429f0){_0x5429f0=_0x5429f0||0xcc;return function(_0x421ee2){if(_0x421ee2){return _0x3aa868[_0xe0b6('0x1f')](_0x5429f0);}return _0x3aa868['status'](_0x5429f0)[_0xe0b6('0x20')]();};}function respondWithResult(_0x2c9f32,_0x4b1fc7){_0x4b1fc7=_0x4b1fc7||0xc8;return function(_0x55ef27){if(_0x55ef27){return _0x2c9f32[_0xe0b6('0x21')](_0x4b1fc7)[_0xe0b6('0x22')](_0x55ef27);}};}function respondWithFilteredResult(_0x14830f,_0x5914e5){return function(_0x1f31f7){if(_0x1f31f7){var _0x28ee51=typeof _0x5914e5[_0xe0b6('0x23')]==='undefined'&&typeof _0x5914e5[_0xe0b6('0x24')]===_0xe0b6('0x25');var _0x4d4277=_0x1f31f7['count'];var _0x418ac6=_0x28ee51?0x0:_0x5914e5[_0xe0b6('0x23')];var _0xe66c55=_0x28ee51?_0x1f31f7[_0xe0b6('0x26')]:_0x5914e5[_0xe0b6('0x23')]+_0x5914e5[_0xe0b6('0x24')];var _0xd8ad97;if(_0xe66c55>=_0x4d4277){_0xe66c55=_0x4d4277;_0xd8ad97=0xc8;}else{_0xd8ad97=0xce;}_0x14830f['status'](_0xd8ad97);return _0x14830f['set'](_0xe0b6('0x27'),_0x418ac6+'-'+_0xe66c55+'/'+_0x4d4277)['json'](_0x1f31f7);}return null;};}function patchUpdates(_0x4081bb){return function(_0x317e03){try{jsonpatch[_0xe0b6('0x28')](_0x317e03,_0x4081bb,!![]);}catch(_0x4e8f0a){return BPromise[_0xe0b6('0x29')](_0x4e8f0a);}return _0x317e03['save']();};}function saveUpdates(_0x150ead,_0x40b866){return function(_0x334422){if(_0x334422){return _0x334422[_0xe0b6('0x2a')](_0x150ead)[_0xe0b6('0x2b')](function(_0x582f58){return _0x582f58;});}return null;};}function removeEntity(_0x4d547c,_0xc229c0){return function(_0x13f1f1){if(_0x13f1f1){return _0x13f1f1[_0xe0b6('0x2c')]()['then'](function(){var _0x26320e=_0x13f1f1[_0xe0b6('0x2d')]({'plain':!![]});var _0xd7ca77=_0xe0b6('0x2e');return db[_0xe0b6('0x2f')][_0xe0b6('0x2c')]({'where':{'type':_0xd7ca77,'resourceId':_0x26320e['id']}})[_0xe0b6('0x2b')](function(){return _0x13f1f1;});})[_0xe0b6('0x2b')](function(){_0x4d547c[_0xe0b6('0x21')](0xcc)[_0xe0b6('0x20')]();});}};}function handleEntityNotFound(_0x2d8131,_0x2903e9){return function(_0x2bef33){if(!_0x2bef33){_0x2d8131[_0xe0b6('0x1f')](0x194);}return _0x2bef33;};}function handleError(_0x2d0c16,_0x30266d){_0x30266d=_0x30266d||0x1f4;return function(_0xb253fd){logger[_0xe0b6('0x30')](_0xb253fd[_0xe0b6('0x31')]);if(_0xb253fd[_0xe0b6('0x32')]){delete _0xb253fd[_0xe0b6('0x32')];}_0x2d0c16[_0xe0b6('0x21')](_0x30266d)[_0xe0b6('0x33')](_0xb253fd);};}exports['index']=function(_0x53ae0e,_0x12e7e8){var _0x280682={},_0x34baee={},_0x5a840a={'count':0x0,'rows':[]};var _0x485478=_[_0xe0b6('0x34')](db[_0xe0b6('0x35')]['rawAttributes'],function(_0x5becd9){return{'name':_0x5becd9[_0xe0b6('0x36')],'type':_0x5becd9[_0xe0b6('0x37')][_0xe0b6('0x38')]};});_0x34baee[_0xe0b6('0x39')]=_[_0xe0b6('0x34')](_0x485478,'name');_0x34baee[_0xe0b6('0x3a')]=_['keys'](_0x53ae0e[_0xe0b6('0x3a')]);_0x34baee['filters']=_[_0xe0b6('0x3b')](_0x34baee['model'],_0x34baee[_0xe0b6('0x3a')]);_0x280682[_0xe0b6('0x3c')]=_[_0xe0b6('0x3b')](_0x34baee['model'],qs['fields'](_0x53ae0e['query'][_0xe0b6('0x3d')]));_0x280682[_0xe0b6('0x3c')]=_0x280682[_0xe0b6('0x3c')][_0xe0b6('0x3e')]?_0x280682[_0xe0b6('0x3c')]:_0x34baee[_0xe0b6('0x39')];if(!_0x53ae0e[_0xe0b6('0x3a')][_0xe0b6('0x3f')]('nolimit')){_0x280682[_0xe0b6('0x24')]=qs[_0xe0b6('0x24')](_0x53ae0e[_0xe0b6('0x3a')][_0xe0b6('0x24')]);_0x280682[_0xe0b6('0x23')]=qs['offset'](_0x53ae0e[_0xe0b6('0x3a')][_0xe0b6('0x23')]);}_0x280682[_0xe0b6('0x40')]=qs[_0xe0b6('0x41')](_0x53ae0e[_0xe0b6('0x3a')][_0xe0b6('0x41')]);_0x280682[_0xe0b6('0x42')]=qs[_0xe0b6('0x43')](_[_0xe0b6('0x44')](_0x53ae0e[_0xe0b6('0x3a')],_0x34baee[_0xe0b6('0x43')]),_0x485478);if(_0x53ae0e[_0xe0b6('0x3a')][_0xe0b6('0x45')]){_0x280682[_0xe0b6('0x42')]=_[_0xe0b6('0x46')](_0x280682[_0xe0b6('0x42')],{'$or':_[_0xe0b6('0x34')](_0x485478,function(_0x47c13a){if(_0x47c13a[_0xe0b6('0x37')]!=='VIRTUAL'){var _0x198b7f={};_0x198b7f[_0x47c13a[_0xe0b6('0x32')]]={'$like':'%'+_0x53ae0e['query']['filter']+'%'};return _0x198b7f;}})});}_0x280682=_[_0xe0b6('0x46')]({},_0x280682,_0x53ae0e[_0xe0b6('0x47')]);var _0xdd7abf={'where':_0x280682[_0xe0b6('0x42')]};return db['WhatsappQueue'][_0xe0b6('0x26')](_0xdd7abf)[_0xe0b6('0x2b')](function(_0x5ec6a1){_0x5a840a[_0xe0b6('0x26')]=_0x5ec6a1;if(_0x53ae0e[_0xe0b6('0x3a')]['includeAll']){_0x280682[_0xe0b6('0x48')]=[{'all':!![]}];}return db[_0xe0b6('0x35')][_0xe0b6('0x49')](_0x280682);})[_0xe0b6('0x2b')](function(_0x152e2e){_0x5a840a[_0xe0b6('0x4a')]=_0x152e2e;return _0x5a840a;})['then'](respondWithFilteredResult(_0x12e7e8,_0x280682))[_0xe0b6('0x4b')](handleError(_0x12e7e8,null));};exports[_0xe0b6('0x4c')]=function(_0x190731,_0x5a92ef){var _0x181a58={'raw':!![],'where':{'id':_0x190731['params']['id']}},_0x3bbb6e={};_0x3bbb6e['model']=_[_0xe0b6('0x4d')](db[_0xe0b6('0x35')]['rawAttributes']);_0x3bbb6e[_0xe0b6('0x3a')]=_[_0xe0b6('0x4d')](_0x190731['query']);_0x3bbb6e[_0xe0b6('0x43')]=_[_0xe0b6('0x3b')](_0x3bbb6e[_0xe0b6('0x39')],_0x3bbb6e[_0xe0b6('0x3a')]);_0x181a58[_0xe0b6('0x3c')]=_['intersection'](_0x3bbb6e[_0xe0b6('0x39')],qs[_0xe0b6('0x3d')](_0x190731[_0xe0b6('0x3a')]['fields']));_0x181a58[_0xe0b6('0x3c')]=_0x181a58['attributes'][_0xe0b6('0x3e')]?_0x181a58[_0xe0b6('0x3c')]:_0x3bbb6e[_0xe0b6('0x39')];if(_0x190731[_0xe0b6('0x3a')][_0xe0b6('0x4e')]){_0x181a58[_0xe0b6('0x48')]=[{'all':!![]}];}_0x181a58=_[_0xe0b6('0x46')]({},_0x181a58,_0x190731[_0xe0b6('0x47')]);return db[_0xe0b6('0x35')][_0xe0b6('0x4f')](_0x181a58)['then'](handleEntityNotFound(_0x5a92ef,null))[_0xe0b6('0x2b')](respondWithResult(_0x5a92ef,null))[_0xe0b6('0x4b')](handleError(_0x5a92ef,null));};exports[_0xe0b6('0x50')]=function(_0x6951b5,_0x4767de){return db[_0xe0b6('0x35')][_0xe0b6('0x50')](_0x6951b5[_0xe0b6('0x51')],{})['then'](function(_0x79532d){var _0x804860=_0x6951b5[_0xe0b6('0x52')][_0xe0b6('0x2d')]({'plain':!![]});if(!_0x804860)throw new Error(_0xe0b6('0x53'));if(_0x804860[_0xe0b6('0x54')]===_0xe0b6('0x52')){var _0x2e29d9=_0x79532d['get']({'plain':!![]});var _0x325c80=_0xe0b6('0x2e');return db['UserProfileSection']['find']({'where':{'name':_0x325c80,'userProfileId':_0x804860[_0xe0b6('0x55')]},'raw':!![]})[_0xe0b6('0x2b')](function(_0x59ca5c){if(_0x59ca5c&&_0x59ca5c['autoAssociation']===0x0){return db[_0xe0b6('0x2f')]['create']({'name':_0x2e29d9[_0xe0b6('0x32')],'resourceId':_0x2e29d9['id'],'type':_0x59ca5c['name'],'sectionId':_0x59ca5c['id']},{})[_0xe0b6('0x2b')](function(){return _0x79532d;});}else{return _0x79532d;}})[_0xe0b6('0x4b')](function(_0x2e4e12){logger[_0xe0b6('0x30')](_0xe0b6('0x56'),_0x2e4e12);throw _0x2e4e12;});}return _0x79532d;})[_0xe0b6('0x2b')](respondWithResult(_0x4767de,0xc9))[_0xe0b6('0x4b')](handleError(_0x4767de,null));};exports[_0xe0b6('0x2a')]=function(_0x53b44c,_0x12c973){if(_0x53b44c[_0xe0b6('0x51')]['id']){delete _0x53b44c[_0xe0b6('0x51')]['id'];}return db['WhatsappQueue'][_0xe0b6('0x4f')]({'where':{'id':_0x53b44c[_0xe0b6('0x57')]['id']}})[_0xe0b6('0x2b')](handleEntityNotFound(_0x12c973,null))[_0xe0b6('0x2b')](saveUpdates(_0x53b44c[_0xe0b6('0x51')],null))[_0xe0b6('0x2b')](respondWithResult(_0x12c973,null))['catch'](handleError(_0x12c973,null));};exports[_0xe0b6('0x2c')]=function(_0x1d0ea6,_0x2ef5c1){return db[_0xe0b6('0x35')]['find']({'where':{'id':_0x1d0ea6[_0xe0b6('0x57')]['id']}})[_0xe0b6('0x2b')](handleEntityNotFound(_0x2ef5c1,null))[_0xe0b6('0x2b')](removeEntity(_0x2ef5c1,null))['catch'](handleError(_0x2ef5c1,null));};exports[_0xe0b6('0x58')]=function(_0xd06684,_0x4dac39){return db[_0xe0b6('0x35')][_0xe0b6('0x58')]()['then'](respondWithResult(_0x4dac39,null))[_0xe0b6('0x4b')](handleError(_0x4dac39,null));};exports[_0xe0b6('0x59')]=function(_0x3306d9,_0x3fed71,_0x433c68){var _0x435f9d={'raw':!![],'where':{}},_0x824a63={},_0x341f51;return db[_0xe0b6('0x35')][_0xe0b6('0x5a')]({'where':{'id':_0x3306d9[_0xe0b6('0x57')]['id']}})[_0xe0b6('0x2b')](handleEntityNotFound(_0x3fed71,null))[_0xe0b6('0x2b')](function(_0x4259fc){if(_0x4259fc){_0x341f51=_0x4259fc['get']({'plain':!![]});_0x824a63['model']=_[_0xe0b6('0x4d')](db[_0xe0b6('0x5b')][_0xe0b6('0x5c')]);_0x824a63[_0xe0b6('0x3a')]=_[_0xe0b6('0x4d')](_0x3306d9['query']);_0x824a63[_0xe0b6('0x43')]=_[_0xe0b6('0x3b')](_0x824a63[_0xe0b6('0x39')],_0x824a63[_0xe0b6('0x3a')]);_0x435f9d[_0xe0b6('0x3c')]=_[_0xe0b6('0x3b')](_0x824a63[_0xe0b6('0x39')],qs[_0xe0b6('0x3d')](_0x3306d9[_0xe0b6('0x3a')][_0xe0b6('0x3d')]));_0x435f9d[_0xe0b6('0x3c')]=_0x435f9d['attributes']['length']?_0x435f9d['attributes']:_0x824a63[_0xe0b6('0x39')];if(!_0x3306d9[_0xe0b6('0x3a')][_0xe0b6('0x3f')]('nolimit')){_0x435f9d[_0xe0b6('0x24')]=qs['limit'](_0x3306d9['query'][_0xe0b6('0x24')]);_0x435f9d[_0xe0b6('0x23')]=qs[_0xe0b6('0x23')](_0x3306d9[_0xe0b6('0x3a')][_0xe0b6('0x23')]);}_0x435f9d[_0xe0b6('0x40')]=qs[_0xe0b6('0x41')](_0x3306d9[_0xe0b6('0x3a')][_0xe0b6('0x41')]);_0x435f9d[_0xe0b6('0x42')]=qs[_0xe0b6('0x43')](_[_0xe0b6('0x44')](_0x3306d9[_0xe0b6('0x3a')],_0x824a63[_0xe0b6('0x43')]));_0x435f9d['where']['WhatsappQueueId']=_0x4259fc['id'];if(_0x3306d9['query'][_0xe0b6('0x45')]){_0x435f9d['where']=_[_0xe0b6('0x46')](_0x435f9d[_0xe0b6('0x42')],{'$or':_['map'](_0x435f9d[_0xe0b6('0x3c')],function(_0x554974){var _0x3a220d={};_0x3a220d[_0x554974]={'$like':'%'+_0x3306d9[_0xe0b6('0x3a')][_0xe0b6('0x45')]+'%'};return _0x3a220d;})});}_0x435f9d=_[_0xe0b6('0x46')]({},_0x435f9d,_0x3306d9['options']);return db[_0xe0b6('0x5b')]['findAll'](_0x435f9d);}})['then'](function(_0x3988aa){if(_0x3988aa){return db[_0xe0b6('0x5d')]['findAndCountAll']({'where':{'id':_[_0xe0b6('0x34')](_0x3988aa,_0xe0b6('0x5e')),'role':_0xe0b6('0x5f')},'attributes':['id',_0xe0b6('0x32'),_0xe0b6('0x60'),_0xe0b6('0x61'),'createdAt']});}})['then'](function(_0x161f87){if(_0x161f87){return{'count':_0x161f87[_0xe0b6('0x26')],'rows':_['map'](_0x161f87['rows'],function(_0x5c6829){return{'membername':_0x5c6829[_0xe0b6('0x32')],'UserId':_0x5c6829['id'],'queue_name':_0x341f51[_0xe0b6('0x32')],'WhatsappQueueId':_0x341f51['id'],'interface':util['format']('%s/%s',_0xe0b6('0x62'),_0x5c6829[_0xe0b6('0x32')]),'penalty':0x0,'paused':_0x5c6829[_0xe0b6('0x60')],'createdAt':_0x5c6829[_0xe0b6('0x63')],'updatedAt':_0x5c6829[_0xe0b6('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b6('0x2b')](respondWithFilteredResult(_0x3fed71,_0x435f9d))[_0xe0b6('0x4b')](handleError(_0x3fed71,null));};exports[_0xe0b6('0x64')]=function(_0x110159,_0x55539e,_0x1baead){var _0x187f3a={};var _0x58296e={};var _0x4a5598;var _0x2deeca;return db[_0xe0b6('0x35')]['findOne']({'where':{'id':_0x110159['params']['id']}})[_0xe0b6('0x2b')](handleEntityNotFound(_0x55539e,null))['then'](function(_0x379670){if(_0x379670){_0x4a5598=_0x379670;_0x58296e['model']=_[_0xe0b6('0x4d')](db['Team'][_0xe0b6('0x5c')]);_0x58296e[_0xe0b6('0x3a')]=_['keys'](_0x110159[_0xe0b6('0x3a')]);_0x58296e[_0xe0b6('0x43')]=_[_0xe0b6('0x3b')](_0x58296e[_0xe0b6('0x39')],_0x58296e[_0xe0b6('0x3a')]);_0x187f3a[_0xe0b6('0x3c')]=_[_0xe0b6('0x3b')](_0x58296e['model'],qs[_0xe0b6('0x3d')](_0x110159['query'][_0xe0b6('0x3d')]));_0x187f3a[_0xe0b6('0x3c')]=_0x187f3a['attributes'][_0xe0b6('0x3e')]?_0x187f3a[_0xe0b6('0x3c')]:_0x58296e[_0xe0b6('0x39')];_0x187f3a[_0xe0b6('0x40')]=qs['sort'](_0x110159[_0xe0b6('0x3a')][_0xe0b6('0x41')]);_0x187f3a[_0xe0b6('0x42')]=qs['filters'](_['pick'](_0x110159['query'],_0x58296e[_0xe0b6('0x43')]));if(_0x110159[_0xe0b6('0x3a')][_0xe0b6('0x45')]){_0x187f3a['where']=_[_0xe0b6('0x46')](_0x187f3a[_0xe0b6('0x42')],{'$or':_[_0xe0b6('0x34')](_0x187f3a[_0xe0b6('0x3c')],function(_0x3a5c36){var _0x4d04b2={};_0x4d04b2[_0x3a5c36]={'$like':'%'+_0x110159[_0xe0b6('0x3a')][_0xe0b6('0x45')]+'%'};return _0x4d04b2;})});}_0x187f3a=_[_0xe0b6('0x46')]({},_0x187f3a,_0x110159['options']);return _0x4a5598['getTeams'](_0x187f3a);}})[_0xe0b6('0x2b')](function(_0x11a094){if(_0x11a094){_0x2deeca=_0x11a094[_0xe0b6('0x3e')];if(!_0x110159[_0xe0b6('0x3a')]['hasOwnProperty'](_0xe0b6('0x65'))){_0x187f3a['limit']=qs[_0xe0b6('0x24')](_0x110159[_0xe0b6('0x3a')][_0xe0b6('0x24')]);_0x187f3a[_0xe0b6('0x23')]=qs[_0xe0b6('0x23')](_0x110159[_0xe0b6('0x3a')][_0xe0b6('0x23')]);}return _0x4a5598['getTeams'](_0x187f3a);}})['then'](function(_0xe11dc5){if(_0xe11dc5){return _0xe11dc5?{'count':_0x2deeca,'rows':_0xe11dc5}:null;}})[_0xe0b6('0x2b')](respondWithResult(_0x55539e,null))['catch'](handleError(_0x55539e,null));};exports[_0xe0b6('0x66')]=function(_0xffc3ef,_0x49e41c,_0x4e5559){var _0x4250da=_0xffc3ef[_0xe0b6('0x51')]['ids'];return db[_0xe0b6('0x67')][_0xe0b6('0x49')]({'where':{'id':_0x4250da},'attributes':['id'],'include':[{'model':db[_0xe0b6('0x5d')],'as':_0xe0b6('0x68'),'attributes':['id','name',_0xe0b6('0x69'),_0xe0b6('0x6a'),_0xe0b6('0x6b')],'raw':!![]}]})[_0xe0b6('0x2b')](function(_0x381065){if(_0x381065){var _0x35463e=_['flatMap'](_0x381065,function(_0x5cce75){var _0x3a83b9=_0x5cce75[_0xe0b6('0x2d')]({'plain':!![]});return _0x3a83b9[_0xe0b6('0x68')];});return db[_0xe0b6('0x35')][_0xe0b6('0x4f')]({'where':{'id':_0xffc3ef[_0xe0b6('0x57')]['id']}})[_0xe0b6('0x2b')](function(_0x1b999b){return db['sequelize']['transaction'](function(_0x39cd17){return _0x1b999b[_0xe0b6('0x66')](_0x4250da,{'transaction':_0x39cd17})[_0xe0b6('0x2b')](function(){return BPromise['each'](_0x35463e,function(_0x4ea63e){return db[_0xe0b6('0x5b')][_0xe0b6('0x6c')]({'where':{'UserId':_0x4ea63e['id'],'WhatsappQueueId':_0xffc3ef[_0xe0b6('0x57')]['id']},'transaction':_0x39cd17});});})[_0xe0b6('0x2b')](function(){_0x35463e['forEach'](function(_0x36abd9){socket[_0xe0b6('0x6d')](_0xe0b6('0x6e'),{'UserId':_0x36abd9['id'],'WhatsappQueueId':_0x1b999b['id']});});});});});}})[_0xe0b6('0x2b')](respondWithStatusCode(_0x49e41c,null))[_0xe0b6('0x4b')](handleError(_0x49e41c,null));};exports[_0xe0b6('0x6f')]=function(_0x35bf1b,_0xa3d64f,_0x4a7f09){return db[_0xe0b6('0x67')][_0xe0b6('0x49')]({'where':{'id':_0x35bf1b['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe0b6('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe0b6('0x2b')](handleEntityNotFound(_0xa3d64f,null))[_0xe0b6('0x2b')](function(_0x51a409){var _0x57d52a=_[_0xe0b6('0x34')](_0x51a409,'id');var _0x47f07d=[];var _0x690f06=[];var _0x582343=squel[_0xe0b6('0x70')]();_0x582343[_0xe0b6('0x71')]('tq.TeamId')[_0xe0b6('0x72')]('team_has_whatsapp_queues','tq')['join'](_0xe0b6('0x73'),'ut',_0xe0b6('0x74'))[_0xe0b6('0x42')](_0xe0b6('0x75'),_0x35bf1b[_0xe0b6('0x57')]['id']);for(var _0x2a379b=0x0;_0x2a379b<_0x51a409[_0xe0b6('0x3e')];_0x2a379b+=0x1){let _0x4c9b13=_0x51a409[_0x2a379b];for(var _0x3f7f06=0x0;_0x3f7f06<_0x4c9b13['Agents'][_0xe0b6('0x3e')];_0x3f7f06+=0x1){let _0x2500a8=_0x4c9b13[_0xe0b6('0x68')][_0x3f7f06];var _0x58105d=_0x582343['clone']();_0x58105d['where'](_0xe0b6('0x76'),_0x2500a8['id']);_0x690f06[_0xe0b6('0x77')](db[_0xe0b6('0x78')][_0xe0b6('0x3a')](_0x58105d['toString'](),{'type':db['sequelize']['QueryTypes'][_0xe0b6('0x79')]})['then'](function(_0x5d1324){if(_0x5d1324[_0xe0b6('0x3e')]===0x1){return _0x2500a8['id'];}else{var _0x50c627=_[_0xe0b6('0x7a')](_[_0xe0b6('0x34')](_0x5d1324,_0xe0b6('0x7b')),function(_0x4fead1){return _[_0xe0b6('0x7c')](_0x57d52a,_0x4fead1);});if(_0x50c627){return _0x2500a8['id'];}}}));}}return BPromise[_0xe0b6('0x7d')](_0x690f06)['then'](function(_0x6e2123){_0x47f07d=_(_0x47f07d)[_0xe0b6('0x7e')](_0x6e2123)[_0xe0b6('0x7f')]()['value']();return db[_0xe0b6('0x35')][_0xe0b6('0x4f')]({'where':{'id':_0x35bf1b['params']['id']}})[_0xe0b6('0x2b')](function(_0x3ca2f4){return db[_0xe0b6('0x78')][_0xe0b6('0x80')](function(_0x5a6aef){return _0x3ca2f4['removeTeams'](_0x35bf1b[_0xe0b6('0x3a')]['ids'],{'transaction':_0x5a6aef})[_0xe0b6('0x2b')](function(){if(!_['isEmpty'](_0x47f07d)){return _0x3ca2f4[_0xe0b6('0x81')](_0x47f07d,{'transaction':_0x5a6aef});}})[_0xe0b6('0x2b')](function(){_0x47f07d[_0xe0b6('0x82')](function(_0x3b937b){socket[_0xe0b6('0x6d')](_0xe0b6('0x83'),{'UserId':_0x3b937b,'WhatsappQueueId':_0x3ca2f4['id']});});});});});});})['then'](respondWithStatusCode(_0xa3d64f,null))['catch'](handleError(_0xa3d64f,null));};exports[_0xe0b6('0x84')]=function(_0x19e4a9,_0x1ed3df,_0xadecb8){return db[_0xe0b6('0x35')][_0xe0b6('0x4f')]({'where':{'id':_0x19e4a9['params']['id']}})[_0xe0b6('0x2b')](handleEntityNotFound(_0x1ed3df,null))[_0xe0b6('0x2b')](function(_0x357082){if(_0x357082){return _0x357082[_0xe0b6('0x84')](_0x19e4a9[_0xe0b6('0x51')][_0xe0b6('0x85')],_[_0xe0b6('0x86')](_0x19e4a9['body'],['ids','id'])||{})[_0xe0b6('0x87')](function(_0x2ab236){for(var _0x19fbbc=0x0;_0x19fbbc<_0x19e4a9[_0xe0b6('0x51')][_0xe0b6('0x85')][_0xe0b6('0x3e')];_0x19fbbc+=0x1){socket[_0xe0b6('0x6d')](_0xe0b6('0x6e'),{'UserId':Number(_0x19e4a9[_0xe0b6('0x51')]['ids'][_0x19fbbc]),'WhatsappQueueId':Number(_0x19e4a9[_0xe0b6('0x57')]['id'])});}return _0x2ab236;});}})['then'](respondWithResult(_0x1ed3df,null))[_0xe0b6('0x4b')](handleError(_0x1ed3df,null));};exports[_0xe0b6('0x81')]=function(_0x58468f,_0x3c918e,_0xa930a4){return db[_0xe0b6('0x35')][_0xe0b6('0x4f')]({'where':{'id':_0x58468f[_0xe0b6('0x57')]['id']}})['then'](handleEntityNotFound(_0x3c918e,null))[_0xe0b6('0x2b')](function(_0x34960f){if(_0x34960f){return _0x34960f[_0xe0b6('0x81')](_0x58468f[_0xe0b6('0x3a')]['ids'])[_0xe0b6('0x2b')](function(){if(_[_0xe0b6('0x88')](_0x58468f[_0xe0b6('0x3a')][_0xe0b6('0x85')])){for(var _0xd7d174=0x0;_0xd7d174<_0x58468f[_0xe0b6('0x3a')][_0xe0b6('0x85')]['length'];_0xd7d174+=0x1){socket[_0xe0b6('0x6d')](_0xe0b6('0x83'),{'UserId':Number(_0x58468f['query']['ids'][_0xd7d174]),'WhatsappQueueId':Number(_0x58468f['params']['id'])});}}else{socket[_0xe0b6('0x6d')](_0xe0b6('0x83'),{'UserId':Number(_0x58468f[_0xe0b6('0x3a')][_0xe0b6('0x85')]),'WhatsappQueueId':Number(_0x58468f[_0xe0b6('0x57')]['id'])});}});}})[_0xe0b6('0x2b')](respondWithStatusCode(_0x3c918e,null))[_0xe0b6('0x4b')](handleError(_0x3c918e,null));};exports[_0xe0b6('0x89')]=function(_0x5a4969,_0x1a7f80,_0xe5b543){var _0x27689b={};var _0x510cac={};var _0x47a3d4;var _0x4d43c6;return db[_0xe0b6('0x35')][_0xe0b6('0x5a')]({'where':{'id':_0x5a4969[_0xe0b6('0x57')]['id']}})[_0xe0b6('0x2b')](handleEntityNotFound(_0x1a7f80,null))[_0xe0b6('0x2b')](function(_0x1dce25){if(_0x1dce25){_0x47a3d4=_0x1dce25;_0x510cac[_0xe0b6('0x39')]=_['keys'](db[_0xe0b6('0x5d')]['rawAttributes']);_0x510cac[_0xe0b6('0x3a')]=_[_0xe0b6('0x4d')](_0x5a4969[_0xe0b6('0x3a')]);_0x510cac[_0xe0b6('0x43')]=_[_0xe0b6('0x3b')](_0x510cac[_0xe0b6('0x39')],_0x510cac[_0xe0b6('0x3a')]);_0x27689b[_0xe0b6('0x3c')]=_[_0xe0b6('0x3b')](_0x510cac[_0xe0b6('0x39')],qs[_0xe0b6('0x3d')](_0x5a4969['query'][_0xe0b6('0x3d')]));_0x27689b[_0xe0b6('0x3c')]=_0x27689b['attributes']['length']?_0x27689b['attributes']:_0x510cac[_0xe0b6('0x39')];_0x27689b[_0xe0b6('0x40')]=qs[_0xe0b6('0x41')](_0x5a4969[_0xe0b6('0x3a')]['sort']);_0x27689b['where']=qs[_0xe0b6('0x43')](_[_0xe0b6('0x44')](_0x5a4969[_0xe0b6('0x3a')],_0x510cac[_0xe0b6('0x43')]));if(_0x5a4969[_0xe0b6('0x3a')][_0xe0b6('0x45')]){_0x27689b[_0xe0b6('0x42')]=_[_0xe0b6('0x46')](_0x27689b[_0xe0b6('0x42')],{'$or':_[_0xe0b6('0x34')](_0x27689b[_0xe0b6('0x3c')],function(_0x5c0212){var _0x1fa78b={};_0x1fa78b[_0x5c0212]={'$like':'%'+_0x5a4969[_0xe0b6('0x3a')][_0xe0b6('0x45')]+'%'};return _0x1fa78b;})});}_0x27689b=_[_0xe0b6('0x46')]({},_0x27689b,_0x5a4969[_0xe0b6('0x47')]);return _0x47a3d4[_0xe0b6('0x89')](_0x27689b);}})[_0xe0b6('0x2b')](function(_0x5ab4eb){if(_0x5ab4eb){_0x4d43c6=_0x5ab4eb[_0xe0b6('0x3e')];if(!_0x5a4969[_0xe0b6('0x3a')][_0xe0b6('0x3f')](_0xe0b6('0x65'))){_0x27689b['limit']=qs[_0xe0b6('0x24')](_0x5a4969[_0xe0b6('0x3a')][_0xe0b6('0x24')]);_0x27689b[_0xe0b6('0x23')]=qs[_0xe0b6('0x23')](_0x5a4969[_0xe0b6('0x3a')][_0xe0b6('0x23')]);}return _0x47a3d4['getAgents'](_0x27689b);}})[_0xe0b6('0x2b')](function(_0x5d74d6){if(_0x5d74d6){return _0x5d74d6?{'count':_0x4d43c6,'rows':_0x5d74d6}:null;}})[_0xe0b6('0x2b')](respondWithResult(_0x1a7f80,null))[_0xe0b6('0x4b')](handleError(_0x1a7f80,null));}; \ No newline at end of file +var _0xaf02=['stack','name','index','WhatsappQueue','fieldName','type','model','map','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','rawAttributes','hasOwnProperty','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','User','getAgents','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','WhatsappQueues','UserProfileResource','end','error'];(function(_0x5356df,_0x518dc6){var _0x14e235=function(_0x9601cc){while(--_0x9601cc){_0x5356df['push'](_0x5356df['shift']());}};_0x14e235(++_0x518dc6);}(_0xaf02,0xe8));var _0x2af0=function(_0x12a0a3,_0x2652d1){_0x12a0a3=_0x12a0a3-0x0;var _0x1c47c4=_0xaf02[_0x12a0a3];return _0x1c47c4;};'use strict';var emlformat=require(_0x2af0('0x0'));var rimraf=require(_0x2af0('0x1'));var zipdir=require(_0x2af0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2af0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2af0('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2af0('0x5'));var csv=require(_0x2af0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2af0('0x7'));var _=require(_0x2af0('0x8'));var squel=require(_0x2af0('0x9'));var crypto=require(_0x2af0('0xa'));var jsforce=require(_0x2af0('0xb'));var deskjs=require(_0x2af0('0xc'));var toCsv=require(_0x2af0('0x6'));var querystring=require('querystring');var Papa=require(_0x2af0('0xd'));var Redis=require(_0x2af0('0xe'));var authService=require(_0x2af0('0xf'));var qs=require(_0x2af0('0x10'));var as=require(_0x2af0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2af0('0x12'));var utils=require('../../config/utils');var config=require(_0x2af0('0x13'));var licenseUtil=require(_0x2af0('0x14'));var db=require('../../mysqldb')['db'];config[_0x2af0('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2af0('0x16'))(new Redis(config[_0x2af0('0x15')]));require(_0x2af0('0x17'))[_0x2af0('0x18')](socket);function respondWithStatusCode(_0x30fdf1,_0x1bfc93){_0x1bfc93=_0x1bfc93||0xcc;return function(_0x54822b){if(_0x54822b){return _0x30fdf1[_0x2af0('0x19')](_0x1bfc93);}return _0x30fdf1[_0x2af0('0x1a')](_0x1bfc93)['end']();};}function respondWithResult(_0x93c56,_0x8eb2f3){_0x8eb2f3=_0x8eb2f3||0xc8;return function(_0x40540d){if(_0x40540d){return _0x93c56['status'](_0x8eb2f3)[_0x2af0('0x1b')](_0x40540d);}};}function respondWithFilteredResult(_0x2766c2,_0xa692bc){return function(_0x349e39){if(_0x349e39){var _0x5a5b1a=typeof _0xa692bc[_0x2af0('0x1c')]==='undefined'&&typeof _0xa692bc[_0x2af0('0x1d')]==='undefined';var _0x125c7d=_0x349e39[_0x2af0('0x1e')];var _0x37a785=_0x5a5b1a?0x0:_0xa692bc[_0x2af0('0x1c')];var _0xdcf08a=_0x5a5b1a?_0x349e39[_0x2af0('0x1e')]:_0xa692bc[_0x2af0('0x1c')]+_0xa692bc[_0x2af0('0x1d')];var _0x13c836;if(_0xdcf08a>=_0x125c7d){_0xdcf08a=_0x125c7d;_0x13c836=0xc8;}else{_0x13c836=0xce;}_0x2766c2['status'](_0x13c836);return _0x2766c2[_0x2af0('0x1f')](_0x2af0('0x20'),_0x37a785+'-'+_0xdcf08a+'/'+_0x125c7d)[_0x2af0('0x1b')](_0x349e39);}return null;};}function patchUpdates(_0x33a6a2){return function(_0x1f8130){try{jsonpatch[_0x2af0('0x21')](_0x1f8130,_0x33a6a2,!![]);}catch(_0x946b27){return BPromise[_0x2af0('0x22')](_0x946b27);}return _0x1f8130[_0x2af0('0x23')]();};}function saveUpdates(_0x59a9ce,_0x4efcab){return function(_0x10b06f){if(_0x10b06f){return _0x10b06f[_0x2af0('0x24')](_0x59a9ce)['then'](function(_0x2e5591){return _0x2e5591;});}return null;};}function removeEntity(_0x30db34,_0x3524eb){return function(_0x2c4434){if(_0x2c4434){return _0x2c4434[_0x2af0('0x25')]()[_0x2af0('0x26')](function(){var _0x59ff4d=_0x2c4434[_0x2af0('0x27')]({'plain':!![]});var _0x47f0ef=_0x2af0('0x28');return db[_0x2af0('0x29')][_0x2af0('0x25')]({'where':{'type':_0x47f0ef,'resourceId':_0x59ff4d['id']}})['then'](function(){return _0x2c4434;});})[_0x2af0('0x26')](function(){_0x30db34[_0x2af0('0x1a')](0xcc)[_0x2af0('0x2a')]();});}};}function handleEntityNotFound(_0x4f132f,_0x4aaa38){return function(_0x4fdcf9){if(!_0x4fdcf9){_0x4f132f[_0x2af0('0x19')](0x194);}return _0x4fdcf9;};}function handleError(_0x3b1a3c,_0x2105f0){_0x2105f0=_0x2105f0||0x1f4;return function(_0x3aca4e){logger[_0x2af0('0x2b')](_0x3aca4e[_0x2af0('0x2c')]);if(_0x3aca4e[_0x2af0('0x2d')]){delete _0x3aca4e[_0x2af0('0x2d')];}_0x3b1a3c[_0x2af0('0x1a')](_0x2105f0)['send'](_0x3aca4e);};}exports[_0x2af0('0x2e')]=function(_0x260217,_0x4665c1){var _0x4d4ae9={},_0x571390={},_0x10a682={'count':0x0,'rows':[]};var _0x1f1f1e=_['map'](db[_0x2af0('0x2f')]['rawAttributes'],function(_0x33e200){return{'name':_0x33e200[_0x2af0('0x30')],'type':_0x33e200[_0x2af0('0x31')]['key']};});_0x571390[_0x2af0('0x32')]=_[_0x2af0('0x33')](_0x1f1f1e,'name');_0x571390[_0x2af0('0x34')]=_[_0x2af0('0x35')](_0x260217['query']);_0x571390[_0x2af0('0x36')]=_['intersection'](_0x571390['model'],_0x571390[_0x2af0('0x34')]);_0x4d4ae9[_0x2af0('0x37')]=_['intersection'](_0x571390['model'],qs[_0x2af0('0x38')](_0x260217[_0x2af0('0x34')][_0x2af0('0x38')]));_0x4d4ae9['attributes']=_0x4d4ae9[_0x2af0('0x37')]['length']?_0x4d4ae9[_0x2af0('0x37')]:_0x571390[_0x2af0('0x32')];if(!_0x260217[_0x2af0('0x34')]['hasOwnProperty'](_0x2af0('0x39'))){_0x4d4ae9[_0x2af0('0x1d')]=qs[_0x2af0('0x1d')](_0x260217[_0x2af0('0x34')][_0x2af0('0x1d')]);_0x4d4ae9[_0x2af0('0x1c')]=qs['offset'](_0x260217[_0x2af0('0x34')][_0x2af0('0x1c')]);}_0x4d4ae9[_0x2af0('0x3a')]=qs['sort'](_0x260217['query'][_0x2af0('0x3b')]);_0x4d4ae9[_0x2af0('0x3c')]=qs[_0x2af0('0x36')](_[_0x2af0('0x3d')](_0x260217[_0x2af0('0x34')],_0x571390[_0x2af0('0x36')]),_0x1f1f1e);if(_0x260217[_0x2af0('0x34')]['filter']){_0x4d4ae9[_0x2af0('0x3c')]=_[_0x2af0('0x3e')](_0x4d4ae9[_0x2af0('0x3c')],{'$or':_[_0x2af0('0x33')](_0x1f1f1e,function(_0x185f76){if(_0x185f76['type']!==_0x2af0('0x3f')){var _0x5e22e0={};_0x5e22e0[_0x185f76[_0x2af0('0x2d')]]={'$like':'%'+_0x260217[_0x2af0('0x34')][_0x2af0('0x40')]+'%'};return _0x5e22e0;}})});}_0x4d4ae9=_[_0x2af0('0x3e')]({},_0x4d4ae9,_0x260217[_0x2af0('0x41')]);var _0x45a8a8={'where':_0x4d4ae9[_0x2af0('0x3c')]};return db[_0x2af0('0x2f')][_0x2af0('0x1e')](_0x45a8a8)['then'](function(_0x520728){_0x10a682[_0x2af0('0x1e')]=_0x520728;if(_0x260217[_0x2af0('0x34')]['includeAll']){_0x4d4ae9['include']=[{'all':!![]}];}return db[_0x2af0('0x2f')][_0x2af0('0x42')](_0x4d4ae9);})[_0x2af0('0x26')](function(_0x9249e3){_0x10a682[_0x2af0('0x43')]=_0x9249e3;return _0x10a682;})[_0x2af0('0x26')](respondWithFilteredResult(_0x4665c1,_0x4d4ae9))[_0x2af0('0x44')](handleError(_0x4665c1,null));};exports[_0x2af0('0x45')]=function(_0x2d2f04,_0x5a44dd){var _0x2d545c={'raw':!![],'where':{'id':_0x2d2f04[_0x2af0('0x46')]['id']}},_0x324589={};_0x324589['model']=_[_0x2af0('0x35')](db['WhatsappQueue']['rawAttributes']);_0x324589[_0x2af0('0x34')]=_[_0x2af0('0x35')](_0x2d2f04[_0x2af0('0x34')]);_0x324589['filters']=_[_0x2af0('0x47')](_0x324589['model'],_0x324589[_0x2af0('0x34')]);_0x2d545c[_0x2af0('0x37')]=_[_0x2af0('0x47')](_0x324589[_0x2af0('0x32')],qs[_0x2af0('0x38')](_0x2d2f04[_0x2af0('0x34')][_0x2af0('0x38')]));_0x2d545c[_0x2af0('0x37')]=_0x2d545c['attributes'][_0x2af0('0x48')]?_0x2d545c[_0x2af0('0x37')]:_0x324589[_0x2af0('0x32')];if(_0x2d2f04[_0x2af0('0x34')][_0x2af0('0x49')]){_0x2d545c['include']=[{'all':!![]}];}_0x2d545c=_[_0x2af0('0x3e')]({},_0x2d545c,_0x2d2f04[_0x2af0('0x41')]);return db[_0x2af0('0x2f')][_0x2af0('0x4a')](_0x2d545c)[_0x2af0('0x26')](handleEntityNotFound(_0x5a44dd,null))[_0x2af0('0x26')](respondWithResult(_0x5a44dd,null))[_0x2af0('0x44')](handleError(_0x5a44dd,null));};exports[_0x2af0('0x4b')]=function(_0x2ad5f6,_0x2cef58){return db[_0x2af0('0x2f')]['create'](_0x2ad5f6['body'],{})[_0x2af0('0x26')](function(_0x167bc5){var _0x1ea882=_0x2ad5f6[_0x2af0('0x4c')][_0x2af0('0x27')]({'plain':!![]});if(!_0x1ea882)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ea882[_0x2af0('0x4d')]==='user'){var _0x1742d3=_0x167bc5[_0x2af0('0x27')]({'plain':!![]});var _0x8d6aa=_0x2af0('0x28');return db[_0x2af0('0x4e')][_0x2af0('0x4a')]({'where':{'name':_0x8d6aa,'userProfileId':_0x1ea882[_0x2af0('0x4f')]},'raw':!![]})['then'](function(_0x4c644c){if(_0x4c644c&&_0x4c644c['autoAssociation']===0x0){return db[_0x2af0('0x29')][_0x2af0('0x4b')]({'name':_0x1742d3[_0x2af0('0x2d')],'resourceId':_0x1742d3['id'],'type':_0x4c644c[_0x2af0('0x2d')],'sectionId':_0x4c644c['id']},{})[_0x2af0('0x26')](function(){return _0x167bc5;});}else{return _0x167bc5;}})[_0x2af0('0x44')](function(_0xe04499){logger[_0x2af0('0x2b')](_0x2af0('0x50'),_0xe04499);throw _0xe04499;});}return _0x167bc5;})[_0x2af0('0x26')](respondWithResult(_0x2cef58,0xc9))[_0x2af0('0x44')](handleError(_0x2cef58,null));};exports[_0x2af0('0x24')]=function(_0x5814b8,_0x60f636){if(_0x5814b8[_0x2af0('0x51')]['id']){delete _0x5814b8[_0x2af0('0x51')]['id'];}return db[_0x2af0('0x2f')][_0x2af0('0x4a')]({'where':{'id':_0x5814b8['params']['id']}})[_0x2af0('0x26')](handleEntityNotFound(_0x60f636,null))[_0x2af0('0x26')](saveUpdates(_0x5814b8['body'],null))[_0x2af0('0x26')](respondWithResult(_0x60f636,null))[_0x2af0('0x44')](handleError(_0x60f636,null));};exports['destroy']=function(_0x455f97,_0x12083d){return db[_0x2af0('0x2f')][_0x2af0('0x4a')]({'where':{'id':_0x455f97[_0x2af0('0x46')]['id']}})[_0x2af0('0x26')](handleEntityNotFound(_0x12083d,null))[_0x2af0('0x26')](removeEntity(_0x12083d,null))[_0x2af0('0x44')](handleError(_0x12083d,null));};exports[_0x2af0('0x52')]=function(_0x181be4,_0x5d96c1){return db[_0x2af0('0x2f')][_0x2af0('0x52')]()[_0x2af0('0x26')](respondWithResult(_0x5d96c1,null))[_0x2af0('0x44')](handleError(_0x5d96c1,null));};exports[_0x2af0('0x53')]=function(_0xd9499b,_0x5b32e9,_0x887d09){var _0x303584={'raw':!![],'where':{}},_0x8b331b={},_0xf53d45;return db[_0x2af0('0x2f')][_0x2af0('0x54')]({'where':{'id':_0xd9499b['params']['id']}})[_0x2af0('0x26')](handleEntityNotFound(_0x5b32e9,null))[_0x2af0('0x26')](function(_0x4d64df){if(_0x4d64df){_0xf53d45=_0x4d64df[_0x2af0('0x27')]({'plain':!![]});_0x8b331b[_0x2af0('0x32')]=_[_0x2af0('0x35')](db[_0x2af0('0x55')][_0x2af0('0x56')]);_0x8b331b[_0x2af0('0x34')]=_[_0x2af0('0x35')](_0xd9499b[_0x2af0('0x34')]);_0x8b331b[_0x2af0('0x36')]=_[_0x2af0('0x47')](_0x8b331b[_0x2af0('0x32')],_0x8b331b[_0x2af0('0x34')]);_0x303584[_0x2af0('0x37')]=_[_0x2af0('0x47')](_0x8b331b['model'],qs[_0x2af0('0x38')](_0xd9499b[_0x2af0('0x34')][_0x2af0('0x38')]));_0x303584[_0x2af0('0x37')]=_0x303584[_0x2af0('0x37')][_0x2af0('0x48')]?_0x303584['attributes']:_0x8b331b[_0x2af0('0x32')];if(!_0xd9499b[_0x2af0('0x34')][_0x2af0('0x57')](_0x2af0('0x39'))){_0x303584[_0x2af0('0x1d')]=qs[_0x2af0('0x1d')](_0xd9499b[_0x2af0('0x34')][_0x2af0('0x1d')]);_0x303584[_0x2af0('0x1c')]=qs[_0x2af0('0x1c')](_0xd9499b[_0x2af0('0x34')][_0x2af0('0x1c')]);}_0x303584[_0x2af0('0x3a')]=qs[_0x2af0('0x3b')](_0xd9499b[_0x2af0('0x34')][_0x2af0('0x3b')]);_0x303584[_0x2af0('0x3c')]=qs['filters'](_[_0x2af0('0x3d')](_0xd9499b[_0x2af0('0x34')],_0x8b331b[_0x2af0('0x36')]));_0x303584['where'][_0x2af0('0x58')]=_0x4d64df['id'];if(_0xd9499b[_0x2af0('0x34')][_0x2af0('0x40')]){_0x303584[_0x2af0('0x3c')]=_[_0x2af0('0x3e')](_0x303584[_0x2af0('0x3c')],{'$or':_[_0x2af0('0x33')](_0x303584[_0x2af0('0x37')],function(_0x395d50){var _0x59d65f={};_0x59d65f[_0x395d50]={'$like':'%'+_0xd9499b['query'][_0x2af0('0x40')]+'%'};return _0x59d65f;})});}_0x303584=_[_0x2af0('0x3e')]({},_0x303584,_0xd9499b['options']);return db[_0x2af0('0x55')][_0x2af0('0x42')](_0x303584);}})[_0x2af0('0x26')](function(_0x36644b){if(_0x36644b){return db['User'][_0x2af0('0x59')]({'where':{'id':_[_0x2af0('0x33')](_0x36644b,_0x2af0('0x5a')),'role':_0x2af0('0x5b')},'attributes':['id',_0x2af0('0x2d'),_0x2af0('0x5c'),_0x2af0('0x5d'),_0x2af0('0x5e')]});}})[_0x2af0('0x26')](function(_0x216dcb){if(_0x216dcb){return{'count':_0x216dcb['count'],'rows':_['map'](_0x216dcb[_0x2af0('0x43')],function(_0x38c50f){return{'membername':_0x38c50f[_0x2af0('0x2d')],'UserId':_0x38c50f['id'],'queue_name':_0xf53d45[_0x2af0('0x2d')],'WhatsappQueueId':_0xf53d45['id'],'interface':util[_0x2af0('0x5f')](_0x2af0('0x60'),_0x2af0('0x61'),_0x38c50f[_0x2af0('0x2d')]),'penalty':0x0,'paused':_0x38c50f[_0x2af0('0x5c')],'createdAt':_0x38c50f[_0x2af0('0x5e')],'updatedAt':_0x38c50f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2af0('0x26')](respondWithFilteredResult(_0x5b32e9,_0x303584))[_0x2af0('0x44')](handleError(_0x5b32e9,null));};exports[_0x2af0('0x62')]=function(_0x319aa5,_0x255540,_0x1585c6){var _0x2275e4={};var _0x43c347={};var _0x24e4ad;var _0x4c69cc;return db[_0x2af0('0x2f')][_0x2af0('0x54')]({'where':{'id':_0x319aa5['params']['id']}})['then'](handleEntityNotFound(_0x255540,null))[_0x2af0('0x26')](function(_0x176d56){if(_0x176d56){_0x24e4ad=_0x176d56;_0x43c347[_0x2af0('0x32')]=_[_0x2af0('0x35')](db[_0x2af0('0x63')]['rawAttributes']);_0x43c347[_0x2af0('0x34')]=_['keys'](_0x319aa5[_0x2af0('0x34')]);_0x43c347[_0x2af0('0x36')]=_['intersection'](_0x43c347[_0x2af0('0x32')],_0x43c347[_0x2af0('0x34')]);_0x2275e4['attributes']=_[_0x2af0('0x47')](_0x43c347['model'],qs[_0x2af0('0x38')](_0x319aa5[_0x2af0('0x34')][_0x2af0('0x38')]));_0x2275e4['attributes']=_0x2275e4[_0x2af0('0x37')][_0x2af0('0x48')]?_0x2275e4[_0x2af0('0x37')]:_0x43c347[_0x2af0('0x32')];_0x2275e4['order']=qs[_0x2af0('0x3b')](_0x319aa5[_0x2af0('0x34')][_0x2af0('0x3b')]);_0x2275e4['where']=qs[_0x2af0('0x36')](_[_0x2af0('0x3d')](_0x319aa5[_0x2af0('0x34')],_0x43c347[_0x2af0('0x36')]));if(_0x319aa5[_0x2af0('0x34')][_0x2af0('0x40')]){_0x2275e4['where']=_[_0x2af0('0x3e')](_0x2275e4[_0x2af0('0x3c')],{'$or':_[_0x2af0('0x33')](_0x2275e4[_0x2af0('0x37')],function(_0x116562){var _0x37a380={};_0x37a380[_0x116562]={'$like':'%'+_0x319aa5[_0x2af0('0x34')][_0x2af0('0x40')]+'%'};return _0x37a380;})});}_0x2275e4=_[_0x2af0('0x3e')]({},_0x2275e4,_0x319aa5['options']);return _0x24e4ad[_0x2af0('0x62')](_0x2275e4);}})[_0x2af0('0x26')](function(_0x11a62f){if(_0x11a62f){_0x4c69cc=_0x11a62f[_0x2af0('0x48')];if(!_0x319aa5[_0x2af0('0x34')][_0x2af0('0x57')](_0x2af0('0x39'))){_0x2275e4['limit']=qs[_0x2af0('0x1d')](_0x319aa5[_0x2af0('0x34')][_0x2af0('0x1d')]);_0x2275e4[_0x2af0('0x1c')]=qs['offset'](_0x319aa5['query'][_0x2af0('0x1c')]);}return _0x24e4ad[_0x2af0('0x62')](_0x2275e4);}})[_0x2af0('0x26')](function(_0x57cff4){if(_0x57cff4){return _0x57cff4?{'count':_0x4c69cc,'rows':_0x57cff4}:null;}})[_0x2af0('0x26')](respondWithResult(_0x255540,null))[_0x2af0('0x44')](handleError(_0x255540,null));};exports[_0x2af0('0x64')]=function(_0x35e7f7,_0x24ca2e,_0x62c5cb){var _0x4ca2c5=_0x35e7f7[_0x2af0('0x51')][_0x2af0('0x65')];return db[_0x2af0('0x63')][_0x2af0('0x42')]({'where':{'id':_0x4ca2c5},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x2af0('0x2d'),_0x2af0('0x66'),_0x2af0('0x67'),_0x2af0('0x68')],'raw':!![]}]})['then'](function(_0x457882){if(_0x457882){var _0x4ff8c8=_[_0x2af0('0x69')](_0x457882,function(_0xb10da3){var _0x1c8f3f=_0xb10da3[_0x2af0('0x27')]({'plain':!![]});return _0x1c8f3f[_0x2af0('0x6a')];});return db['WhatsappQueue']['find']({'where':{'id':_0x35e7f7['params']['id']}})[_0x2af0('0x26')](function(_0x554e6f){return db[_0x2af0('0x6b')][_0x2af0('0x6c')](function(_0x3dc249){return _0x554e6f['addTeams'](_0x4ca2c5,{'transaction':_0x3dc249})[_0x2af0('0x26')](function(){return BPromise[_0x2af0('0x6d')](_0x4ff8c8,function(_0x23a78c){return db[_0x2af0('0x55')][_0x2af0('0x6e')]({'where':{'UserId':_0x23a78c['id'],'WhatsappQueueId':_0x35e7f7[_0x2af0('0x46')]['id']},'transaction':_0x3dc249});});})['then'](function(){_0x4ff8c8[_0x2af0('0x6f')](function(_0x1f96cb){socket[_0x2af0('0x70')](_0x2af0('0x71'),{'UserId':_0x1f96cb['id'],'WhatsappQueueId':_0x554e6f['id']});});});});});}})[_0x2af0('0x26')](respondWithStatusCode(_0x24ca2e,null))['catch'](handleError(_0x24ca2e,null));};exports['removeTeams']=function(_0x4fd484,_0x45d64a,_0x5d23eb){return db[_0x2af0('0x63')][_0x2af0('0x42')]({'where':{'id':_0x4fd484['query'][_0x2af0('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2af0('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x2af0('0x26')](handleEntityNotFound(_0x45d64a,null))[_0x2af0('0x26')](function(_0x6cae41){var _0x20a5ad=_[_0x2af0('0x33')](_0x6cae41,'id');var _0x3d6236=[];var _0xe1667a=[];var _0xf7053f=squel['select']();_0xf7053f['field']('tq.TeamId')[_0x2af0('0x72')](_0x2af0('0x73'),'tq')[_0x2af0('0x74')]('user_has_teams','ut',_0x2af0('0x75'))[_0x2af0('0x3c')]('WhatsappQueueId\x20=\x20?',_0x4fd484[_0x2af0('0x46')]['id']);for(var _0x35b7a9=0x0;_0x35b7a9<_0x6cae41[_0x2af0('0x48')];_0x35b7a9+=0x1){let _0x235d97=_0x6cae41[_0x35b7a9];for(var _0x423bd4=0x0;_0x423bd4<_0x235d97[_0x2af0('0x6a')][_0x2af0('0x48')];_0x423bd4+=0x1){let _0x435aa0=_0x235d97[_0x2af0('0x6a')][_0x423bd4];var _0x41ab49=_0xf7053f[_0x2af0('0x76')]();_0x41ab49['where']('ut.UserId\x20=\x20?',_0x435aa0['id']);_0xe1667a[_0x2af0('0x77')](db['sequelize'][_0x2af0('0x34')](_0x41ab49[_0x2af0('0x78')](),{'type':db[_0x2af0('0x6b')][_0x2af0('0x79')][_0x2af0('0x7a')]})[_0x2af0('0x26')](function(_0x5796d0){if(_0x5796d0[_0x2af0('0x48')]===0x1){return _0x435aa0['id'];}else{var _0xe91ad6=_[_0x2af0('0x7b')](_[_0x2af0('0x33')](_0x5796d0,_0x2af0('0x7c')),function(_0x672ffd){return _[_0x2af0('0x7d')](_0x20a5ad,_0x672ffd);});if(_0xe91ad6){return _0x435aa0['id'];}}}));}}return BPromise['all'](_0xe1667a)[_0x2af0('0x26')](function(_0x35c429){_0x3d6236=_(_0x3d6236)[_0x2af0('0x7e')](_0x35c429)[_0x2af0('0x7f')]()[_0x2af0('0x80')]();return db[_0x2af0('0x2f')][_0x2af0('0x4a')]({'where':{'id':_0x4fd484[_0x2af0('0x46')]['id']}})['then'](function(_0x171f1b){return db[_0x2af0('0x6b')][_0x2af0('0x6c')](function(_0x18953b){return _0x171f1b[_0x2af0('0x81')](_0x4fd484[_0x2af0('0x34')][_0x2af0('0x65')],{'transaction':_0x18953b})[_0x2af0('0x26')](function(){if(!_['isEmpty'](_0x3d6236)){return _0x171f1b[_0x2af0('0x82')](_0x3d6236,{'transaction':_0x18953b});}})['then'](function(){_0x3d6236[_0x2af0('0x6f')](function(_0x203688){socket[_0x2af0('0x70')](_0x2af0('0x83'),{'UserId':_0x203688,'WhatsappQueueId':_0x171f1b['id']});});});});});});})[_0x2af0('0x26')](respondWithStatusCode(_0x45d64a,null))['catch'](handleError(_0x45d64a,null));};exports[_0x2af0('0x84')]=function(_0x3666cf,_0x336e07,_0x349396){return db[_0x2af0('0x2f')]['find']({'where':{'id':_0x3666cf['params']['id']}})[_0x2af0('0x26')](handleEntityNotFound(_0x336e07,null))[_0x2af0('0x26')](function(_0x2cfb3f){if(_0x2cfb3f){return _0x2cfb3f[_0x2af0('0x84')](_0x3666cf['body'][_0x2af0('0x65')],_[_0x2af0('0x85')](_0x3666cf['body'],[_0x2af0('0x65'),'id'])||{})[_0x2af0('0x86')](function(_0x406d1c){for(var _0x13b1a2=0x0;_0x13b1a2<_0x3666cf[_0x2af0('0x51')][_0x2af0('0x65')]['length'];_0x13b1a2+=0x1){socket[_0x2af0('0x70')](_0x2af0('0x71'),{'UserId':Number(_0x3666cf[_0x2af0('0x51')][_0x2af0('0x65')][_0x13b1a2]),'WhatsappQueueId':Number(_0x3666cf['params']['id'])});}return _0x406d1c;});}})[_0x2af0('0x26')](respondWithResult(_0x336e07,null))['catch'](handleError(_0x336e07,null));};exports['removeAgents']=function(_0x38bb60,_0x23ae4a,_0x3d4635){return db[_0x2af0('0x2f')][_0x2af0('0x4a')]({'where':{'id':_0x38bb60[_0x2af0('0x46')]['id']}})[_0x2af0('0x26')](handleEntityNotFound(_0x23ae4a,null))[_0x2af0('0x26')](function(_0xe5c038){if(_0xe5c038){return _0xe5c038['removeAgents'](_0x38bb60[_0x2af0('0x34')][_0x2af0('0x65')])[_0x2af0('0x26')](function(){if(_[_0x2af0('0x87')](_0x38bb60[_0x2af0('0x34')]['ids'])){for(var _0x1c0612=0x0;_0x1c0612<_0x38bb60[_0x2af0('0x34')][_0x2af0('0x65')]['length'];_0x1c0612+=0x1){socket[_0x2af0('0x70')](_0x2af0('0x83'),{'UserId':Number(_0x38bb60['query']['ids'][_0x1c0612]),'WhatsappQueueId':Number(_0x38bb60[_0x2af0('0x46')]['id'])});}}else{socket[_0x2af0('0x70')](_0x2af0('0x83'),{'UserId':Number(_0x38bb60[_0x2af0('0x34')][_0x2af0('0x65')]),'WhatsappQueueId':Number(_0x38bb60[_0x2af0('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x23ae4a,null))[_0x2af0('0x44')](handleError(_0x23ae4a,null));};exports['getAgents']=function(_0x7d9943,_0x31046e,_0x3c5e13){var _0x453c99={};var _0xbfc575={};var _0x1ce740;var _0xb8d72a;return db[_0x2af0('0x2f')][_0x2af0('0x54')]({'where':{'id':_0x7d9943[_0x2af0('0x46')]['id']}})[_0x2af0('0x26')](handleEntityNotFound(_0x31046e,null))[_0x2af0('0x26')](function(_0xaee409){if(_0xaee409){_0x1ce740=_0xaee409;_0xbfc575[_0x2af0('0x32')]=_[_0x2af0('0x35')](db[_0x2af0('0x88')][_0x2af0('0x56')]);_0xbfc575[_0x2af0('0x34')]=_['keys'](_0x7d9943[_0x2af0('0x34')]);_0xbfc575[_0x2af0('0x36')]=_['intersection'](_0xbfc575[_0x2af0('0x32')],_0xbfc575['query']);_0x453c99[_0x2af0('0x37')]=_[_0x2af0('0x47')](_0xbfc575['model'],qs[_0x2af0('0x38')](_0x7d9943[_0x2af0('0x34')][_0x2af0('0x38')]));_0x453c99['attributes']=_0x453c99[_0x2af0('0x37')][_0x2af0('0x48')]?_0x453c99[_0x2af0('0x37')]:_0xbfc575['model'];_0x453c99['order']=qs['sort'](_0x7d9943[_0x2af0('0x34')][_0x2af0('0x3b')]);_0x453c99[_0x2af0('0x3c')]=qs[_0x2af0('0x36')](_[_0x2af0('0x3d')](_0x7d9943[_0x2af0('0x34')],_0xbfc575[_0x2af0('0x36')]));if(_0x7d9943[_0x2af0('0x34')][_0x2af0('0x40')]){_0x453c99['where']=_[_0x2af0('0x3e')](_0x453c99['where'],{'$or':_['map'](_0x453c99[_0x2af0('0x37')],function(_0x2d7ad7){var _0x2d6129={};_0x2d6129[_0x2d7ad7]={'$like':'%'+_0x7d9943[_0x2af0('0x34')][_0x2af0('0x40')]+'%'};return _0x2d6129;})});}_0x453c99=_[_0x2af0('0x3e')]({},_0x453c99,_0x7d9943[_0x2af0('0x41')]);return _0x1ce740['getAgents'](_0x453c99);}})[_0x2af0('0x26')](function(_0x1f0262){if(_0x1f0262){_0xb8d72a=_0x1f0262[_0x2af0('0x48')];if(!_0x7d9943[_0x2af0('0x34')][_0x2af0('0x57')](_0x2af0('0x39'))){_0x453c99[_0x2af0('0x1d')]=qs[_0x2af0('0x1d')](_0x7d9943[_0x2af0('0x34')][_0x2af0('0x1d')]);_0x453c99['offset']=qs[_0x2af0('0x1c')](_0x7d9943['query'][_0x2af0('0x1c')]);}return _0x1ce740[_0x2af0('0x89')](_0x453c99);}})[_0x2af0('0x26')](function(_0x4c607e){if(_0x4c607e){return _0x4c607e?{'count':_0xb8d72a,'rows':_0x4c607e}:null;}})[_0x2af0('0x26')](respondWithResult(_0x31046e,null))[_0x2af0('0x44')](handleError(_0x31046e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 6ea1065..0f59119 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 _0x17fa=['exports','events','update','remove','emit','hasOwnProperty','hook'];(function(_0x1003f0,_0x4c6cbf){var _0x1bdfd3=function(_0x4bdddd){while(--_0x4bdddd){_0x1003f0['push'](_0x1003f0['shift']());}};_0x1bdfd3(++_0x4c6cbf);}(_0x17fa,0x135));var _0xa17f=function(_0x1405f8,_0x599d03){_0x1405f8=_0x1405f8-0x0;var _0x2fe79d=_0x17fa[_0x1405f8];return _0x2fe79d;};'use strict';var EventEmitter=require(_0xa17f('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa17f('0x1'),'afterDestroy':_0xa17f('0x2')};function emitEvent(_0x382459){return function(_0x920ec9,_0x186e38,_0x5a61e7){WhatsappQueueEvents[_0xa17f('0x3')](_0x382459+':'+_0x920ec9['id'],_0x920ec9);WhatsappQueueEvents[_0xa17f('0x3')](_0x382459,_0x920ec9);_0x5a61e7(null);};}for(var e in events){if(events[_0xa17f('0x4')](e)){var event=events[e];WhatsappQueue[_0xa17f('0x5')](e,emitEvent(event));}}module[_0xa17f('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x309d=['update','emit','hasOwnProperty','hook','exports','events','save'];(function(_0x3b3063,_0x4f9401){var _0x4ffbd9=function(_0x293db5){while(--_0x293db5){_0x3b3063['push'](_0x3b3063['shift']());}};_0x4ffbd9(++_0x4f9401);}(_0x309d,0x139));var _0xd309=function(_0x148b30,_0x1fe1c6){_0x148b30=_0x148b30-0x0;var _0x197038=_0x309d[_0x148b30];return _0x197038;};'use strict';var EventEmitter=require(_0xd309('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd309('0x1'),'afterUpdate':_0xd309('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5b83e1){return function(_0x44221a,_0x22e6f7,_0x5e4057){WhatsappQueueEvents[_0xd309('0x3')](_0x5b83e1+':'+_0x44221a['id'],_0x44221a);WhatsappQueueEvents[_0xd309('0x3')](_0x5b83e1,_0x44221a);_0x5e4057(null);};}for(var e in events){if(events[_0xd309('0x4')](e)){var event=events[e];WhatsappQueue[_0xd309('0x5')](e,emitEvent(event));}}module[_0xd309('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index cec08bb..4b0b23d 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 _0x3552=['exports','define','whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3552,0x1e4));var _0x2355=function(_0x53ae27,_0x1d9532){_0x53ae27=_0x53ae27-0x0;var _0x422393=_0x3552[_0x53ae27];return _0x422393;};'use strict';var _=require(_0x2355('0x0'));var util=require(_0x2355('0x1'));var logger=require(_0x2355('0x2'))('api');var moment=require(_0x2355('0x3'));var BPromise=require(_0x2355('0x4'));var rp=require(_0x2355('0x5'));var fs=require('fs');var path=require(_0x2355('0x6'));var rimraf=require(_0x2355('0x7'));var config=require(_0x2355('0x8'));var attributes=require(_0x2355('0x9'));module[_0x2355('0xa')]=function(_0xb18252,_0x576477){return _0xb18252[_0x2355('0xb')]('WhatsappQueue',attributes,{'tableName':_0x2355('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e33=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues'];(function(_0x2a7e1a,_0xd188fa){var _0x202852=function(_0x382afc){while(--_0x382afc){_0x2a7e1a['push'](_0x2a7e1a['shift']());}};_0x202852(++_0xd188fa);}(_0x4e33,0xa8));var _0x34e3=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x4e33[_0x4bf96c];return _0x281d09;};'use strict';var _=require('lodash');var util=require(_0x34e3('0x0'));var logger=require(_0x34e3('0x1'))(_0x34e3('0x2'));var moment=require(_0x34e3('0x3'));var BPromise=require(_0x34e3('0x4'));var rp=require(_0x34e3('0x5'));var fs=require('fs');var path=require(_0x34e3('0x6'));var rimraf=require(_0x34e3('0x7'));var config=require(_0x34e3('0x8'));var attributes=require(_0x34e3('0x9'));module[_0x34e3('0xa')]=function(_0xe87f51,_0x5afb07){return _0xe87f51[_0x34e3('0xb')](_0x34e3('0xc'),attributes,{'tableName':_0x34e3('0xd'),'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 e825663..0991f4c 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 _0x3f89=['redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','request\x20sent','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x25d100,_0x442e9e){var _0x4800ea=function(_0xf84135){while(--_0xf84135){_0x25d100['push'](_0x25d100['shift']());}};_0x4800ea(++_0x442e9e);}(_0x3f89,0xe5));var _0x93f8=function(_0x17ddf4,_0x7e9b47){_0x17ddf4=_0x17ddf4-0x0;var _0x5d6a36=_0x3f89[_0x17ddf4];return _0x5d6a36;};'use strict';var _=require(_0x93f8('0x0'));var util=require(_0x93f8('0x1'));var moment=require(_0x93f8('0x2'));var BPromise=require(_0x93f8('0x3'));var rs=require(_0x93f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93f8('0x5'))['db'];var utils=require(_0x93f8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x93f8('0x7'));var jayson=require(_0x93f8('0x8'));var client=jayson[_0x93f8('0x9')][_0x93f8('0xa')]({'port':0x232a});config[_0x93f8('0xb')]=_[_0x93f8('0xc')](config[_0x93f8('0xb')],{'host':_0x93f8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x93f8('0xb')]));require(_0x93f8('0xe'))[_0x93f8('0xf')](socket);function respondWithRpcPromise(_0x28798a,_0x3f058e,_0x3a0414){return new BPromise(function(_0x1939e4,_0x478779){return client[_0x93f8('0x10')](_0x28798a,_0x3a0414)[_0x93f8('0x11')](function(_0x5b8d81){logger[_0x93f8('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x3f058e,_0x93f8('0x13'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3f058e,_0x93f8('0x13'),JSON['stringify'](_0x5b8d81));if(_0x5b8d81[_0x93f8('0x14')]){if(_0x5b8d81['error'][_0x93f8('0x15')]===0x1f4){logger[_0x93f8('0x14')](_0x93f8('0x16'),_0x3f058e,_0x5b8d81[_0x93f8('0x14')]['message']);return _0x478779(_0x5b8d81[_0x93f8('0x14')][_0x93f8('0x17')]);}logger[_0x93f8('0x14')](_0x93f8('0x16'),_0x3f058e,_0x5b8d81[_0x93f8('0x14')][_0x93f8('0x17')]);return _0x1939e4(_0x5b8d81['error'][_0x93f8('0x17')]);}else{logger[_0x93f8('0x12')](_0x93f8('0x16'),_0x3f058e,_0x93f8('0x13'));_0x1939e4(_0x5b8d81[_0x93f8('0x18')][_0x93f8('0x17')]);}})[_0x93f8('0x19')](function(_0xc1c375){logger[_0x93f8('0x14')](_0x93f8('0x16'),_0x3f058e,_0xc1c375);_0x478779(_0xc1c375);});});}exports[_0x93f8('0x1a')]=function(_0x4f03a7){var _0x3e820b=this;return new Promise(function(_0x4daa65,_0x4e4b79){return db[_0x93f8('0x1b')][_0x93f8('0x1c')]({'raw':_0x4f03a7[_0x93f8('0x1d')]?_0x4f03a7[_0x93f8('0x1d')][_0x93f8('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f03a7[_0x93f8('0x1d')]?_0x4f03a7[_0x93f8('0x1d')][_0x93f8('0x1f')]||null:null,'attributes':_0x4f03a7[_0x93f8('0x1d')]?_0x4f03a7[_0x93f8('0x1d')]['attributes']||null:null,'limit':_0x4f03a7[_0x93f8('0x1d')]?_0x4f03a7['options'][_0x93f8('0x20')]||null:null,'include':_0x4f03a7['options']?_0x4f03a7[_0x93f8('0x1d')][_0x93f8('0x21')]?_[_0x93f8('0x22')](_0x4f03a7[_0x93f8('0x1d')][_0x93f8('0x21')],function(_0x263291){return{'model':db[_0x263291[_0x93f8('0x23')]],'as':_0x263291['as'],'attributes':_0x263291[_0x93f8('0x24')],'include':_0x263291[_0x93f8('0x21')]?_[_0x93f8('0x22')](_0x263291[_0x93f8('0x21')],function(_0x3602db){return{'model':db[_0x3602db[_0x93f8('0x23')]],'as':_0x3602db['as'],'attributes':_0x3602db['attributes'],'include':_0x3602db['include']?_['map'](_0x3602db['include'],function(_0x418482){return{'model':db[_0x418482[_0x93f8('0x23')]],'as':_0x418482['as'],'attributes':_0x418482[_0x93f8('0x24')]};}):[]};}):[]};}):[]:[]})[_0x93f8('0x11')](function(_0x425a26){logger[_0x93f8('0x12')]('GetWhatsappQueue',_0x4f03a7);logger[_0x93f8('0x25')](_0x93f8('0x1a'),_0x4f03a7,JSON[_0x93f8('0x26')](_0x425a26));_0x4daa65(_0x425a26);})[_0x93f8('0x19')](function(_0x55863f){logger[_0x93f8('0x14')]('GetWhatsappQueue',_0x55863f[_0x93f8('0x17')],_0x4f03a7);_0x4e4b79(_0x3e820b[_0x93f8('0x14')](0x1f4,_0x55863f['message']));});});};exports['ShowWhatsappQueue']=function(_0x8b74be){var _0x4eb8a6=this;return new Promise(function(_0x363d68,_0x3da2eb){return db[_0x93f8('0x1b')]['find']({'raw':_0x8b74be[_0x93f8('0x1d')]?_0x8b74be['options'][_0x93f8('0x1e')]===undefined?!![]:![]:!![],'where':_0x8b74be[_0x93f8('0x1d')]?_0x8b74be[_0x93f8('0x1d')]['where']||null:null,'attributes':_0x8b74be[_0x93f8('0x1d')]?_0x8b74be[_0x93f8('0x1d')][_0x93f8('0x24')]||null:null,'include':_0x8b74be[_0x93f8('0x1d')]?_0x8b74be[_0x93f8('0x1d')][_0x93f8('0x21')]?_[_0x93f8('0x22')](_0x8b74be['options']['include'],function(_0x34511a){return{'model':db[_0x34511a[_0x93f8('0x23')]],'as':_0x34511a['as'],'attributes':_0x34511a['attributes'],'include':_0x34511a[_0x93f8('0x21')]?_[_0x93f8('0x22')](_0x34511a['include'],function(_0x489898){return{'model':db[_0x489898[_0x93f8('0x23')]],'as':_0x489898['as'],'attributes':_0x489898[_0x93f8('0x24')],'include':_0x489898[_0x93f8('0x21')]?_[_0x93f8('0x22')](_0x489898['include'],function(_0x5ecf86){return{'model':db[_0x5ecf86[_0x93f8('0x23')]],'as':_0x5ecf86['as'],'attributes':_0x5ecf86[_0x93f8('0x24')]};}):[]};}):[]};}):[]:[]})[_0x93f8('0x11')](function(_0x433db1){logger[_0x93f8('0x12')](_0x93f8('0x27'),_0x8b74be);logger[_0x93f8('0x25')]('ShowWhatsappQueue',_0x8b74be,JSON[_0x93f8('0x26')](_0x433db1));_0x363d68(_0x433db1);})['catch'](function(_0x387bcd){logger[_0x93f8('0x14')](_0x93f8('0x27'),_0x387bcd[_0x93f8('0x17')],_0x8b74be);_0x3da2eb(_0x4eb8a6[_0x93f8('0x14')](0x1f4,_0x387bcd[_0x93f8('0x17')]));});});}; \ No newline at end of file +var _0x9ce4=['stringify','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','GetWhatsappQueue','WhatsappQueue','findAll','options','where','limit','include','map','model','attributes','debug','catch','ShowWhatsappQueue','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','./whatsappQueue.socket','register','request','then','info','request\x20sent'];(function(_0x2a895b,_0x32e0af){var _0x5b5a07=function(_0x50afbe){while(--_0x50afbe){_0x2a895b['push'](_0x2a895b['shift']());}};_0x5b5a07(++_0x32e0af);}(_0x9ce4,0x154));var _0x49ce=function(_0x23607f,_0x51db51){_0x23607f=_0x23607f-0x0;var _0x5a5be0=_0x9ce4[_0x23607f];return _0x5a5be0;};'use strict';var _=require(_0x49ce('0x0'));var util=require(_0x49ce('0x1'));var moment=require('moment');var BPromise=require(_0x49ce('0x2'));var rs=require(_0x49ce('0x3'));var fs=require('fs');var Redis=require(_0x49ce('0x4'));var db=require(_0x49ce('0x5'))['db'];var utils=require(_0x49ce('0x6'));var logger=require('../../config/logger')(_0x49ce('0x7'));var config=require('../../config/environment');var jayson=require(_0x49ce('0x8'));var client=jayson[_0x49ce('0x9')][_0x49ce('0xa')]({'port':0x232a});config['redis']=_[_0x49ce('0xb')](config[_0x49ce('0xc')],{'host':_0x49ce('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x49ce('0xe'))[_0x49ce('0xf')](socket);function respondWithRpcPromise(_0xdb3021,_0x53f4e9,_0x3243e8){return new BPromise(function(_0x4140a5,_0x3f19be){return client[_0x49ce('0x10')](_0xdb3021,_0x3243e8)[_0x49ce('0x11')](function(_0xb28791){logger[_0x49ce('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x53f4e9,_0x49ce('0x13'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x53f4e9,_0x49ce('0x13'),JSON[_0x49ce('0x14')](_0xb28791));if(_0xb28791['error']){if(_0xb28791[_0x49ce('0x15')][_0x49ce('0x16')]===0x1f4){logger[_0x49ce('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x53f4e9,_0xb28791['error']['message']);return _0x3f19be(_0xb28791[_0x49ce('0x15')][_0x49ce('0x17')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x53f4e9,_0xb28791['error'][_0x49ce('0x17')]);return _0x4140a5(_0xb28791[_0x49ce('0x15')]['message']);}else{logger['info'](_0x49ce('0x18'),_0x53f4e9,_0x49ce('0x13'));_0x4140a5(_0xb28791[_0x49ce('0x19')][_0x49ce('0x17')]);}})['catch'](function(_0x28b158){logger['error'](_0x49ce('0x18'),_0x53f4e9,_0x28b158);_0x3f19be(_0x28b158);});});}exports[_0x49ce('0x1a')]=function(_0x432427){var _0xde271f=this;return new Promise(function(_0x392308,_0x423f0b){return db[_0x49ce('0x1b')][_0x49ce('0x1c')]({'raw':_0x432427['options']?_0x432427[_0x49ce('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x432427[_0x49ce('0x1d')]?_0x432427[_0x49ce('0x1d')][_0x49ce('0x1e')]||null:null,'attributes':_0x432427[_0x49ce('0x1d')]?_0x432427[_0x49ce('0x1d')]['attributes']||null:null,'limit':_0x432427[_0x49ce('0x1d')]?_0x432427[_0x49ce('0x1d')][_0x49ce('0x1f')]||null:null,'include':_0x432427['options']?_0x432427[_0x49ce('0x1d')][_0x49ce('0x20')]?_[_0x49ce('0x21')](_0x432427[_0x49ce('0x1d')]['include'],function(_0x1cfa10){return{'model':db[_0x1cfa10[_0x49ce('0x22')]],'as':_0x1cfa10['as'],'attributes':_0x1cfa10[_0x49ce('0x23')],'include':_0x1cfa10[_0x49ce('0x20')]?_[_0x49ce('0x21')](_0x1cfa10[_0x49ce('0x20')],function(_0x1dde19){return{'model':db[_0x1dde19[_0x49ce('0x22')]],'as':_0x1dde19['as'],'attributes':_0x1dde19[_0x49ce('0x23')],'include':_0x1dde19[_0x49ce('0x20')]?_[_0x49ce('0x21')](_0x1dde19[_0x49ce('0x20')],function(_0x599956){return{'model':db[_0x599956[_0x49ce('0x22')]],'as':_0x599956['as'],'attributes':_0x599956[_0x49ce('0x23')]};}):[]};}):[]};}):[]:[]})[_0x49ce('0x11')](function(_0x59d228){logger[_0x49ce('0x12')]('GetWhatsappQueue',_0x432427);logger[_0x49ce('0x24')]('GetWhatsappQueue',_0x432427,JSON[_0x49ce('0x14')](_0x59d228));_0x392308(_0x59d228);})[_0x49ce('0x25')](function(_0x4b25f8){logger[_0x49ce('0x15')]('GetWhatsappQueue',_0x4b25f8[_0x49ce('0x17')],_0x432427);_0x423f0b(_0xde271f[_0x49ce('0x15')](0x1f4,_0x4b25f8[_0x49ce('0x17')]));});});};exports[_0x49ce('0x26')]=function(_0x54e17d){var _0x4d67ed=this;return new Promise(function(_0x405753,_0x1fdb4e){return db[_0x49ce('0x1b')]['find']({'raw':_0x54e17d[_0x49ce('0x1d')]?_0x54e17d['options'][_0x49ce('0x27')]===undefined?!![]:![]:!![],'where':_0x54e17d[_0x49ce('0x1d')]?_0x54e17d[_0x49ce('0x1d')][_0x49ce('0x1e')]||null:null,'attributes':_0x54e17d[_0x49ce('0x1d')]?_0x54e17d['options'][_0x49ce('0x23')]||null:null,'include':_0x54e17d[_0x49ce('0x1d')]?_0x54e17d[_0x49ce('0x1d')][_0x49ce('0x20')]?_[_0x49ce('0x21')](_0x54e17d[_0x49ce('0x1d')][_0x49ce('0x20')],function(_0x365fa0){return{'model':db[_0x365fa0[_0x49ce('0x22')]],'as':_0x365fa0['as'],'attributes':_0x365fa0[_0x49ce('0x23')],'include':_0x365fa0[_0x49ce('0x20')]?_[_0x49ce('0x21')](_0x365fa0[_0x49ce('0x20')],function(_0xb380fa){return{'model':db[_0xb380fa[_0x49ce('0x22')]],'as':_0xb380fa['as'],'attributes':_0xb380fa[_0x49ce('0x23')],'include':_0xb380fa[_0x49ce('0x20')]?_['map'](_0xb380fa['include'],function(_0x3176b0){return{'model':db[_0x3176b0[_0x49ce('0x22')]],'as':_0x3176b0['as'],'attributes':_0x3176b0[_0x49ce('0x23')]};}):[]};}):[]};}):[]:[]})[_0x49ce('0x11')](function(_0x4ffe2b){logger[_0x49ce('0x12')](_0x49ce('0x26'),_0x54e17d);logger[_0x49ce('0x24')](_0x49ce('0x26'),_0x54e17d,JSON[_0x49ce('0x14')](_0x4ffe2b));_0x405753(_0x4ffe2b);})['catch'](function(_0x454418){logger[_0x49ce('0x15')](_0x49ce('0x26'),_0x454418[_0x49ce('0x17')],_0x54e17d);_0x1fdb4e(_0x4d67ed[_0x49ce('0x15')](0x1f4,_0x454418[_0x49ce('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9d54e14..ccac20d 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 _0x6884=['./whatsappQueue.events','save','update','removeListener','register','length','whatsappQueue:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6884,0x1ab));var _0x4688=function(_0x13e6a7,_0x292781){_0x13e6a7=_0x13e6a7-0x0;var _0x2f9454=_0x6884[_0x13e6a7];return _0x2f9454;};'use strict';var WhatsappQueueEvents=require(_0x4688('0x0'));var events=[_0x4688('0x1'),'remove',_0x4688('0x2')];function createListener(_0x36dc22,_0x53816c){return function(_0x48e41e){_0x53816c['emit'](_0x36dc22,_0x48e41e);};}function removeListener(_0x283677,_0x16e252){return function(){WhatsappQueueEvents[_0x4688('0x3')](_0x283677,_0x16e252);};}exports[_0x4688('0x4')]=function(_0x59645e){for(var _0x14d063=0x0,_0x517f84=events[_0x4688('0x5')];_0x14d063<_0x517f84;_0x14d063++){var _0x3d47f2=events[_0x14d063];var _0x1bf15c=createListener(_0x4688('0x6')+_0x3d47f2,_0x59645e);WhatsappQueueEvents['on'](_0x3d47f2,_0x1bf15c);}}; \ No newline at end of file +var _0xc3aa=['save','update','emit','removeListener','register'];(function(_0x588c41,_0x207ce0){var _0x5c6046=function(_0x17b8cd){while(--_0x17b8cd){_0x588c41['push'](_0x588c41['shift']());}};_0x5c6046(++_0x207ce0);}(_0xc3aa,0x14a));var _0xac3a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc3aa[_0x21a9d9];return _0x46adce;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xac3a('0x0'),'remove',_0xac3a('0x1')];function createListener(_0x173a3a,_0xd77f57){return function(_0x2d8c1a){_0xd77f57[_0xac3a('0x2')](_0x173a3a,_0x2d8c1a);};}function removeListener(_0xdb065,_0x10a99c){return function(){WhatsappQueueEvents[_0xac3a('0x3')](_0xdb065,_0x10a99c);};}exports[_0xac3a('0x4')]=function(_0x26d941){for(var _0x26c5d1=0x0,_0x16ea87=events['length'];_0x26c5d1<_0x16ea87;_0x26c5d1++){var _0x3ad9a3=events[_0x26c5d1];var _0x5e7283=createListener('whatsappQueue:'+_0x3ad9a3,_0x26d941);WhatsappQueueEvents['on'](_0x3ad9a3,_0x5e7283);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8bb5a82..5f781cd 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 _0x418b=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','isAuthenticated','/:id','show','post','create','put'];(function(_0x20a39b,_0x131214){var _0x15475b=function(_0x2c6547){while(--_0x2c6547){_0x20a39b['push'](_0x20a39b['shift']());}};_0x15475b(++_0x131214);}(_0x418b,0x67));var _0xb418=function(_0x48c40e,_0x19657d){_0x48c40e=_0x48c40e-0x0;var _0x417a65=_0x418b[_0x48c40e];return _0x417a65;};'use strict';var multer=require(_0xb418('0x0'));var util=require(_0xb418('0x1'));var path=require(_0xb418('0x2'));var timeout=require(_0xb418('0x3'));var express=require(_0xb418('0x4'));var router=express['Router']();var fs_extra=require(_0xb418('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb418('0x6'));var config=require(_0xb418('0x7'));var controller=require(_0xb418('0x8'));router[_0xb418('0x9')]('/',auth['isAuthenticated'](),controller[_0xb418('0xa')]);router[_0xb418('0x9')]('/describe',auth[_0xb418('0xb')](),controller['describe']);router[_0xb418('0x9')](_0xb418('0xc'),auth[_0xb418('0xb')](),controller[_0xb418('0xd')]);router[_0xb418('0xe')]('/',auth[_0xb418('0xb')](),controller[_0xb418('0xf')]);router[_0xb418('0x10')](_0xb418('0xc'),auth[_0xb418('0xb')](),controller['update']);router[_0xb418('0x11')](_0xb418('0xc'),auth[_0xb418('0xb')](),controller[_0xb418('0x12')]);module[_0xb418('0x13')]=router; \ No newline at end of file +var _0x3325=['create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x1ef726,_0x16fdea){var _0x4c3c66=function(_0x1bf2de){while(--_0x1bf2de){_0x1ef726['push'](_0x1ef726['shift']());}};_0x4c3c66(++_0x16fdea);}(_0x3325,0x16f));var _0x5332=function(_0x5504fc,_0x2e161c){_0x5504fc=_0x5504fc-0x0;var _0xbad34c=_0x3325[_0x5504fc];return _0xbad34c;};'use strict';var multer=require(_0x5332('0x0'));var util=require(_0x5332('0x1'));var path=require(_0x5332('0x2'));var timeout=require(_0x5332('0x3'));var express=require('express');var router=express[_0x5332('0x4')]();var fs_extra=require(_0x5332('0x5'));var auth=require(_0x5332('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5332('0x7'));router[_0x5332('0x8')]('/',auth['isAuthenticated'](),controller[_0x5332('0x9')]);router[_0x5332('0x8')](_0x5332('0xa'),auth[_0x5332('0xb')](),controller[_0x5332('0xc')]);router[_0x5332('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5332('0xb')](),controller[_0x5332('0xd')]);router[_0x5332('0xe')](_0x5332('0xf'),auth[_0x5332('0xb')](),controller['update']);router[_0x5332('0x10')](_0x5332('0xf'),auth[_0x5332('0xb')](),controller[_0x5332('0x11')]);module[_0x5332('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 3cfe4fd..e57f256 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(_0x535d0d,_0x6f1c2d){var _0x54ba38=function(_0x217ceb){while(--_0x217ceb){_0x535d0d['push'](_0x535d0d['shift']());}};_0x54ba38(++_0x6f1c2d);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x48b258,_0x4e5ae9){var _0x3f5e3c=function(_0x8d208d){while(--_0x8d208d){_0x48b258['push'](_0x48b258['shift']());}};_0x3f5e3c(++_0x4e5ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x33bb77,_0x43fd7a){_0x33bb77=_0x33bb77-0x0;var _0x1fbbfd=_0x7a54[_0x33bb77];return _0x1fbbfd;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 408d208..95c9c7c 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 _0xbdb7=['then','findAll','rows','catch','params','rawAttributes','length','include','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4f8b44,_0x4eda31){_0x4f8b44=_0x4f8b44-0x0;var _0x45727b=_0xbdb7[_0x4f8b44];return _0x45727b;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={},_0xd2d7be={},_0x25a1fe={'count':0x0,'rows':[]};var _0x365c02=_[_0x7bdb('0x28')](db[_0x7bdb('0x29')]['rawAttributes'],function(_0x388a45){return{'name':_0x388a45[_0x7bdb('0x2a')],'type':_0x388a45[_0x7bdb('0x2b')][_0x7bdb('0x2c')]};});_0xd2d7be[_0x7bdb('0x2d')]=_['map'](_0x365c02,_0x7bdb('0x25'));_0xd2d7be[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x371e8a[_0x7bdb('0x2e')]);_0xd2d7be['filters']=_['intersection'](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2e')]);_0x1e9996['attributes']=_[_0x7bdb('0x30')](_0xd2d7be['model'],qs[_0x7bdb('0x31')](_0x371e8a[_0x7bdb('0x2e')][_0x7bdb('0x31')]));_0x1e9996['attributes']=_0x1e9996[_0x7bdb('0x32')]['length']?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x2d')];if(!_0x371e8a['query'][_0x7bdb('0x33')]('nolimit')){_0x1e9996['limit']=qs[_0x7bdb('0x1b')](_0x371e8a[_0x7bdb('0x2e')][_0x7bdb('0x1b')]);_0x1e9996[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x371e8a[_0x7bdb('0x2e')]['offset']);}_0x1e9996[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x371e8a[_0x7bdb('0x2e')][_0x7bdb('0x35')]);_0x1e9996[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x371e8a[_0x7bdb('0x2e')],_0xd2d7be[_0x7bdb('0x37')]),_0x365c02);if(_0x371e8a['query']['filter']){_0x1e9996[_0x7bdb('0x36')]=_[_0x7bdb('0x39')](_0x1e9996[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x28')](_0x365c02,function(_0x3732b2){if(_0x3732b2['type']!=='VIRTUAL'){var _0x27164f={};_0x27164f[_0x3732b2['name']]={'$like':'%'+_0x371e8a[_0x7bdb('0x2e')]['filter']+'%'};return _0x27164f;}})});}_0x1e9996=_[_0x7bdb('0x39')]({},_0x1e9996,_0x371e8a['options']);var _0x4cf3fa={'where':_0x1e9996[_0x7bdb('0x36')]};return db[_0x7bdb('0x29')][_0x7bdb('0x1c')](_0x4cf3fa)[_0x7bdb('0x3a')](function(_0x43c7d3){_0x25a1fe[_0x7bdb('0x1c')]=_0x43c7d3;if(_0x371e8a[_0x7bdb('0x2e')]['includeAll']){_0x1e9996['include']=[{'all':!![]}];}return db[_0x7bdb('0x29')][_0x7bdb('0x3b')](_0x1e9996);})[_0x7bdb('0x3a')](function(_0x3509e4){_0x25a1fe[_0x7bdb('0x3c')]=_0x3509e4;return _0x25a1fe;})[_0x7bdb('0x3a')](respondWithFilteredResult(_0x2e8e65,_0x1e9996))[_0x7bdb('0x3d')](handleError(_0x2e8e65,null));};exports['show']=function(_0x4a2ebc,_0x1bcbcd){var _0x8e893e={'raw':!![],'where':{'id':_0x4a2ebc[_0x7bdb('0x3e')]['id']}},_0x4636f8={};_0x4636f8['model']=_[_0x7bdb('0x2f')](db['WhatsappQueueReport'][_0x7bdb('0x3f')]);_0x4636f8[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x4a2ebc[_0x7bdb('0x2e')]);_0x4636f8[_0x7bdb('0x37')]=_[_0x7bdb('0x30')](_0x4636f8[_0x7bdb('0x2d')],_0x4636f8[_0x7bdb('0x2e')]);_0x8e893e[_0x7bdb('0x32')]=_['intersection'](_0x4636f8[_0x7bdb('0x2d')],qs[_0x7bdb('0x31')](_0x4a2ebc['query'][_0x7bdb('0x31')]));_0x8e893e['attributes']=_0x8e893e[_0x7bdb('0x32')][_0x7bdb('0x40')]?_0x8e893e[_0x7bdb('0x32')]:_0x4636f8[_0x7bdb('0x2d')];if(_0x4a2ebc[_0x7bdb('0x2e')]['includeAll']){_0x8e893e[_0x7bdb('0x41')]=[{'all':!![]}];}_0x8e893e=_[_0x7bdb('0x39')]({},_0x8e893e,_0x4a2ebc[_0x7bdb('0x42')]);return db[_0x7bdb('0x29')][_0x7bdb('0x43')](_0x8e893e)['then'](handleEntityNotFound(_0x1bcbcd,null))[_0x7bdb('0x3a')](respondWithResult(_0x1bcbcd,null))[_0x7bdb('0x3d')](handleError(_0x1bcbcd,null));};exports[_0x7bdb('0x44')]=function(_0xb26a9,_0x259007){return db[_0x7bdb('0x29')][_0x7bdb('0x44')](_0xb26a9[_0x7bdb('0x45')],{})[_0x7bdb('0x3a')](respondWithResult(_0x259007,0xc9))[_0x7bdb('0x3d')](handleError(_0x259007,null));};exports['update']=function(_0x189cf8,_0x58c4bc){if(_0x189cf8['body']['id']){delete _0x189cf8[_0x7bdb('0x45')]['id'];}return db[_0x7bdb('0x29')]['find']({'where':{'id':_0x189cf8[_0x7bdb('0x3e')]['id']}})[_0x7bdb('0x3a')](handleEntityNotFound(_0x58c4bc,null))['then'](saveUpdates(_0x189cf8['body'],null))['then'](respondWithResult(_0x58c4bc,null))[_0x7bdb('0x3d')](handleError(_0x58c4bc,null));};exports[_0x7bdb('0x46')]=function(_0x2fab74,_0x46410c){return db[_0x7bdb('0x29')][_0x7bdb('0x43')]({'where':{'id':_0x2fab74[_0x7bdb('0x3e')]['id']}})[_0x7bdb('0x3a')](handleEntityNotFound(_0x46410c,null))[_0x7bdb('0x3a')](removeEntity(_0x46410c,null))[_0x7bdb('0x3d')](handleError(_0x46410c,null));};exports['describe']=function(_0x299ef0,_0x4806e0){return db[_0x7bdb('0x29')][_0x7bdb('0x47')]()[_0x7bdb('0x3a')](respondWithResult(_0x4806e0,null))[_0x7bdb('0x3d')](handleError(_0x4806e0,null));}; \ No newline at end of file +var _0xe1e3=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status','set','Content-Range','apply','reject','destroy','then','end','name','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','util'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4fdacd,_0xb5f277){_0x4fdacd=_0x4fdacd-0x0;var _0x157ad7=_0xe1e3[_0x4fdacd];return _0x157ad7;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)[_0x3e1e('0x1f')]();});}};}function handleEntityNotFound(_0x159212,_0x43d583){return function(_0x21c898){if(!_0x21c898){_0x159212['sendStatus'](0x194);}return _0x21c898;};}function handleError(_0x5d908e,_0x44e419){_0x44e419=_0x44e419||0x1f4;return function(_0x541ef1){logger['error'](_0x541ef1['stack']);if(_0x541ef1['name']){delete _0x541ef1[_0x3e1e('0x20')];}_0x5d908e[_0x3e1e('0x18')](_0x44e419)['send'](_0x541ef1);};}exports[_0x3e1e('0x21')]=function(_0x5ac814,_0xdfcd93){var _0x176bb4={},_0x53a6ff={},_0x43e029={'count':0x0,'rows':[]};var _0x210a84=_[_0x3e1e('0x22')](db['WhatsappQueueReport'][_0x3e1e('0x23')],function(_0x4ec149){return{'name':_0x4ec149['fieldName'],'type':_0x4ec149['type'][_0x3e1e('0x24')]};});_0x53a6ff['model']=_['map'](_0x210a84,_0x3e1e('0x20'));_0x53a6ff[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x5ac814[_0x3e1e('0x25')]);_0x53a6ff[_0x3e1e('0x27')]=_['intersection'](_0x53a6ff['model'],_0x53a6ff['query']);_0x176bb4['attributes']=_[_0x3e1e('0x28')](_0x53a6ff[_0x3e1e('0x29')],qs[_0x3e1e('0x2a')](_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x2a')]));_0x176bb4[_0x3e1e('0x2b')]=_0x176bb4[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x176bb4['attributes']:_0x53a6ff[_0x3e1e('0x29')];if(!_0x5ac814[_0x3e1e('0x25')]['hasOwnProperty'](_0x3e1e('0x2d'))){_0x176bb4[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0x5ac814[_0x3e1e('0x25')]['limit']);_0x176bb4['offset']=qs[_0x3e1e('0x15')](_0x5ac814[_0x3e1e('0x25')]['offset']);}_0x176bb4[_0x3e1e('0x2e')]=qs[_0x3e1e('0x2f')](_0x5ac814['query'][_0x3e1e('0x2f')]);_0x176bb4[_0x3e1e('0x30')]=qs[_0x3e1e('0x27')](_[_0x3e1e('0x31')](_0x5ac814[_0x3e1e('0x25')],_0x53a6ff['filters']),_0x210a84);if(_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x32')]){_0x176bb4[_0x3e1e('0x30')]=_[_0x3e1e('0x33')](_0x176bb4['where'],{'$or':_[_0x3e1e('0x22')](_0x210a84,function(_0xf973c9){if(_0xf973c9[_0x3e1e('0x34')]!==_0x3e1e('0x35')){var _0x2cc5c7={};_0x2cc5c7[_0xf973c9[_0x3e1e('0x20')]]={'$like':'%'+_0x5ac814[_0x3e1e('0x25')]['filter']+'%'};return _0x2cc5c7;}})});}_0x176bb4=_[_0x3e1e('0x33')]({},_0x176bb4,_0x5ac814['options']);var _0x53bdf5={'where':_0x176bb4[_0x3e1e('0x30')]};return db[_0x3e1e('0x36')][_0x3e1e('0x17')](_0x53bdf5)['then'](function(_0x3dbd2a){_0x43e029[_0x3e1e('0x17')]=_0x3dbd2a;if(_0x5ac814['query'][_0x3e1e('0x37')]){_0x176bb4[_0x3e1e('0x38')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x176bb4);})[_0x3e1e('0x1e')](function(_0x49e4cb){_0x43e029['rows']=_0x49e4cb;return _0x43e029;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0xdfcd93,_0x176bb4))[_0x3e1e('0x39')](handleError(_0xdfcd93,null));};exports[_0x3e1e('0x3a')]=function(_0x202748,_0x377a06){var _0x55ea1d={'raw':!![],'where':{'id':_0x202748[_0x3e1e('0x3b')]['id']}},_0x5b32ad={};_0x5b32ad[_0x3e1e('0x29')]=_[_0x3e1e('0x26')](db['WhatsappQueueReport'][_0x3e1e('0x23')]);_0x5b32ad[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x202748['query']);_0x5b32ad[_0x3e1e('0x27')]=_['intersection'](_0x5b32ad['model'],_0x5b32ad[_0x3e1e('0x25')]);_0x55ea1d[_0x3e1e('0x2b')]=_[_0x3e1e('0x28')](_0x5b32ad[_0x3e1e('0x29')],qs['fields'](_0x202748['query']['fields']));_0x55ea1d['attributes']=_0x55ea1d[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x55ea1d['attributes']:_0x5b32ad['model'];if(_0x202748[_0x3e1e('0x25')][_0x3e1e('0x37')]){_0x55ea1d[_0x3e1e('0x38')]=[{'all':!![]}];}_0x55ea1d=_['merge']({},_0x55ea1d,_0x202748[_0x3e1e('0x3c')]);return db['WhatsappQueueReport'][_0x3e1e('0x3d')](_0x55ea1d)[_0x3e1e('0x1e')](handleEntityNotFound(_0x377a06,null))[_0x3e1e('0x1e')](respondWithResult(_0x377a06,null))[_0x3e1e('0x39')](handleError(_0x377a06,null));};exports[_0x3e1e('0x3e')]=function(_0x3de309,_0x53d32b){return db[_0x3e1e('0x36')][_0x3e1e('0x3e')](_0x3de309['body'],{})[_0x3e1e('0x1e')](respondWithResult(_0x53d32b,0xc9))[_0x3e1e('0x39')](handleError(_0x53d32b,null));};exports['update']=function(_0x1cc820,_0x347b3f){if(_0x1cc820[_0x3e1e('0x3f')]['id']){delete _0x1cc820[_0x3e1e('0x3f')]['id'];}return db['WhatsappQueueReport'][_0x3e1e('0x3d')]({'where':{'id':_0x1cc820[_0x3e1e('0x3b')]['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x347b3f,null))[_0x3e1e('0x1e')](saveUpdates(_0x1cc820['body'],null))[_0x3e1e('0x1e')](respondWithResult(_0x347b3f,null))[_0x3e1e('0x39')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x1d')]=function(_0x25ddf7,_0xe2516c){return db[_0x3e1e('0x36')][_0x3e1e('0x3d')]({'where':{'id':_0x25ddf7[_0x3e1e('0x3b')]['id']}})['then'](handleEntityNotFound(_0xe2516c,null))[_0x3e1e('0x1e')](removeEntity(_0xe2516c,null))['catch'](handleError(_0xe2516c,null));};exports['describe']=function(_0x4c8583,_0x1c4269){return db[_0x3e1e('0x36')]['describe']()[_0x3e1e('0x1e')](respondWithResult(_0x1c4269,null))['catch'](handleError(_0x1c4269,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d7b8ec7..0cb9688 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 _0xcff0=['../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger','api','bluebird','request-promise'];(function(_0x383bef,_0x2b6830){var _0x399f07=function(_0xe581b3){while(--_0xe581b3){_0x383bef['push'](_0x383bef['shift']());}};_0x399f07(++_0x2b6830);}(_0xcff0,0x11e));var _0x0cff=function(_0x10f423,_0x189530){_0x10f423=_0x10f423-0x0;var _0xc53f02=_0xcff0[_0x10f423];return _0xc53f02;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0cff('0x0'))(_0x0cff('0x1'));var moment=require('moment');var BPromise=require(_0x0cff('0x2'));var rp=require(_0x0cff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0cff('0x4'));var attributes=require('./whatsappQueueReport.attributes');module[_0x0cff('0x5')]=function(_0x3edeeb,_0x1846b2){return _0x3edeeb[_0x0cff('0x6')](_0x0cff('0x7'),attributes,{'tableName':_0x0cff('0x8'),'paranoid':![],'indexes':[{'name':_0x0cff('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0ff=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x562c16,_0x4a6c17){var _0x3f98cc=function(_0x299d62){while(--_0x299d62){_0x562c16['push'](_0x562c16['shift']());}};_0x3f98cc(++_0x4a6c17);}(_0xa0ff,0xa5));var _0xfa0f=function(_0x4c7149,_0x335342){_0x4c7149=_0x4c7149-0x0;var _0x200122=_0xa0ff[_0x4c7149];return _0x200122;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa0f('0x0'))(_0xfa0f('0x1'));var moment=require('moment');var BPromise=require(_0xfa0f('0x2'));var rp=require(_0xfa0f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa0f('0x4'));var config=require(_0xfa0f('0x5'));var attributes=require('./whatsappQueueReport.attributes');module[_0xfa0f('0x6')]=function(_0x2d1441,_0x1fe6c4){return _0x2d1441[_0xfa0f('0x7')](_0xfa0f('0x8'),attributes,{'tableName':_0xfa0f('0x9'),'paranoid':![],'indexes':[{'name':_0xfa0f('0xa'),'fields':[_0xfa0f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 13407a2..db64e30 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 _0xfe88=['WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xb6a090,_0x1e8274){var _0xb955af=function(_0x1f8d84){while(--_0x1f8d84){_0xb6a090['push'](_0xb6a090['shift']());}};_0xb955af(++_0x1e8274);}(_0xfe88,0x1d0));var _0x8fe8=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xfe88[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require(_0x8fe8('0x0'));var util=require(_0x8fe8('0x1'));var moment=require(_0x8fe8('0x2'));var BPromise=require('bluebird');var rs=require(_0x8fe8('0x3'));var fs=require('fs');var Redis=require(_0x8fe8('0x4'));var db=require(_0x8fe8('0x5'))['db'];var utils=require(_0x8fe8('0x6'));var logger=require(_0x8fe8('0x7'))(_0x8fe8('0x8'));var config=require(_0x8fe8('0x9'));var jayson=require(_0x8fe8('0xa'));var client=jayson[_0x8fe8('0xb')][_0x8fe8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xda74b8,_0x1bc0c1,_0x3b6480){return new BPromise(function(_0x342c83,_0x45cb36){return client[_0x8fe8('0xd')](_0xda74b8,_0x3b6480)[_0x8fe8('0xe')](function(_0x3e6c0d){logger[_0x8fe8('0xf')](_0x8fe8('0x10'),_0x1bc0c1,_0x8fe8('0x11'));logger[_0x8fe8('0x12')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1bc0c1,_0x8fe8('0x11'),JSON[_0x8fe8('0x13')](_0x3e6c0d));if(_0x3e6c0d[_0x8fe8('0x14')]){if(_0x3e6c0d[_0x8fe8('0x14')]['code']===0x1f4){logger[_0x8fe8('0x14')](_0x8fe8('0x10'),_0x1bc0c1,_0x3e6c0d[_0x8fe8('0x14')][_0x8fe8('0x15')]);return _0x45cb36(_0x3e6c0d['error'][_0x8fe8('0x15')]);}logger['error'](_0x8fe8('0x10'),_0x1bc0c1,_0x3e6c0d[_0x8fe8('0x14')][_0x8fe8('0x15')]);return _0x342c83(_0x3e6c0d[_0x8fe8('0x14')][_0x8fe8('0x15')]);}else{logger[_0x8fe8('0xf')](_0x8fe8('0x10'),_0x1bc0c1,_0x8fe8('0x11'));_0x342c83(_0x3e6c0d[_0x8fe8('0x16')][_0x8fe8('0x15')]);}})[_0x8fe8('0x17')](function(_0x351e9e){logger[_0x8fe8('0x14')](_0x8fe8('0x10'),_0x1bc0c1,_0x351e9e);_0x45cb36(_0x351e9e);});});}exports['CreateWhatsappQueueReport']=function(_0x1a9394){var _0xb0199f=this;return new Promise(function(_0xa75e5,_0x3ba187){return db[_0x8fe8('0x18')][_0x8fe8('0x19')](_0x1a9394[_0x8fe8('0x1a')],{'raw':_0x1a9394[_0x8fe8('0x1b')]?_0x1a9394['options'][_0x8fe8('0x1c')]===undefined?!![]:![]:!![]})[_0x8fe8('0xe')](function(_0x1b3aa7){logger[_0x8fe8('0xf')]('CreateWhatsappQueueReport',_0x1a9394);logger[_0x8fe8('0x12')]('CreateWhatsappQueueReport',_0x1a9394,JSON['stringify'](_0x1b3aa7));_0xa75e5(_0x1b3aa7);})[_0x8fe8('0x17')](function(_0x12073f){logger[_0x8fe8('0x14')]('CreateWhatsappQueueReport',_0x12073f[_0x8fe8('0x15')],_0x1a9394);_0x3ba187(_0xb0199f[_0x8fe8('0x14')](0x1f4,_0x12073f[_0x8fe8('0x15')]));});});};exports[_0x8fe8('0x1d')]=function(_0x466c42){var _0x53acd8=this;return new Promise(function(_0x1d0e5e,_0x4f188b){return db['WhatsappQueueReport']['update'](_0x466c42[_0x8fe8('0x1a')],{'raw':_0x466c42[_0x8fe8('0x1b')]?_0x466c42[_0x8fe8('0x1b')][_0x8fe8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x466c42[_0x8fe8('0x1b')]?_0x466c42[_0x8fe8('0x1b')][_0x8fe8('0x1e')]||null:null,'attributes':_0x466c42[_0x8fe8('0x1b')]?_0x466c42[_0x8fe8('0x1b')][_0x8fe8('0x1f')]||null:null,'limit':_0x466c42[_0x8fe8('0x1b')]?_0x466c42['options']['limit']||null:null})[_0x8fe8('0xe')](function(_0x539214){logger['info'](_0x8fe8('0x1d'),_0x466c42);logger['debug']('UpdateWhatsappQueueReport',_0x466c42,JSON[_0x8fe8('0x13')](_0x539214));_0x1d0e5e(_0x539214);})[_0x8fe8('0x17')](function(_0x348394){logger[_0x8fe8('0x14')](_0x8fe8('0x1d'),_0x348394['message'],_0x466c42);_0x4f188b(_0x53acd8[_0x8fe8('0x14')](0x1f4,_0x348394[_0x8fe8('0x15')]));});});}; \ No newline at end of file +var _0x7d67=['error','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','UpdateWhatsappQueueReport','update','body','raw','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3edbae,_0x129a13){var _0x3c8c70=function(_0x5a8465){while(--_0x5a8465){_0x3edbae['push'](_0x3edbae['shift']());}};_0x3c8c70(++_0x129a13);}(_0x7d67,0xaa));var _0x77d6=function(_0x55c036,_0x3f04ce){_0x55c036=_0x55c036-0x0;var _0x5eb794=_0x7d67[_0x55c036];return _0x5eb794;};'use strict';var _=require(_0x77d6('0x0'));var util=require(_0x77d6('0x1'));var moment=require('moment');var BPromise=require(_0x77d6('0x2'));var rs=require(_0x77d6('0x3'));var fs=require('fs');var Redis=require(_0x77d6('0x4'));var db=require(_0x77d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77d6('0x6'))(_0x77d6('0x7'));var config=require(_0x77d6('0x8'));var jayson=require(_0x77d6('0x9'));var client=jayson[_0x77d6('0xa')][_0x77d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c20cf,_0x2e4075,_0x3c3d0c){return new BPromise(function(_0x223817,_0x455704){return client['request'](_0x2c20cf,_0x3c3d0c)['then'](function(_0x4ae527){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x2e4075,'request\x20sent');logger[_0x77d6('0xc')](_0x77d6('0xd'),_0x2e4075,_0x77d6('0xe'),JSON[_0x77d6('0xf')](_0x4ae527));if(_0x4ae527[_0x77d6('0x10')]){if(_0x4ae527[_0x77d6('0x10')]['code']===0x1f4){logger['error'](_0x77d6('0x11'),_0x2e4075,_0x4ae527[_0x77d6('0x10')][_0x77d6('0x12')]);return _0x455704(_0x4ae527[_0x77d6('0x10')][_0x77d6('0x12')]);}logger['error'](_0x77d6('0x11'),_0x2e4075,_0x4ae527[_0x77d6('0x10')][_0x77d6('0x12')]);return _0x223817(_0x4ae527[_0x77d6('0x10')][_0x77d6('0x12')]);}else{logger[_0x77d6('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2e4075,_0x77d6('0xe'));_0x223817(_0x4ae527[_0x77d6('0x14')][_0x77d6('0x12')]);}})[_0x77d6('0x15')](function(_0x51688d){logger[_0x77d6('0x10')](_0x77d6('0x11'),_0x2e4075,_0x51688d);_0x455704(_0x51688d);});});}exports[_0x77d6('0x16')]=function(_0x2e39bf){var _0x4b8f07=this;return new Promise(function(_0x24872b,_0x57d094){return db[_0x77d6('0x17')][_0x77d6('0x18')](_0x2e39bf['body'],{'raw':_0x2e39bf['options']?_0x2e39bf[_0x77d6('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x389d64){logger[_0x77d6('0x13')](_0x77d6('0x16'),_0x2e39bf);logger[_0x77d6('0xc')]('CreateWhatsappQueueReport',_0x2e39bf,JSON[_0x77d6('0xf')](_0x389d64));_0x24872b(_0x389d64);})[_0x77d6('0x15')](function(_0x5e9dc5){logger['error']('CreateWhatsappQueueReport',_0x5e9dc5['message'],_0x2e39bf);_0x57d094(_0x4b8f07[_0x77d6('0x10')](0x1f4,_0x5e9dc5[_0x77d6('0x12')]));});});};exports[_0x77d6('0x1a')]=function(_0x1c1d32){var _0xa33c42=this;return new Promise(function(_0x33747e,_0x547831){return db['WhatsappQueueReport'][_0x77d6('0x1b')](_0x1c1d32[_0x77d6('0x1c')],{'raw':_0x1c1d32[_0x77d6('0x19')]?_0x1c1d32[_0x77d6('0x19')][_0x77d6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1d32['options']?_0x1c1d32['options'][_0x77d6('0x1e')]||null:null,'attributes':_0x1c1d32[_0x77d6('0x19')]?_0x1c1d32[_0x77d6('0x19')]['attributes']||null:null,'limit':_0x1c1d32[_0x77d6('0x19')]?_0x1c1d32[_0x77d6('0x19')]['limit']||null:null})['then'](function(_0x367d3d){logger['info']('UpdateWhatsappQueueReport',_0x1c1d32);logger['debug'](_0x77d6('0x1a'),_0x1c1d32,JSON[_0x77d6('0xf')](_0x367d3d));_0x33747e(_0x367d3d);})[_0x77d6('0x15')](function(_0x4dc7df){logger[_0x77d6('0x10')]('UpdateWhatsappQueueReport',_0x4dc7df[_0x77d6('0x12')],_0x1c1d32);_0x547831(_0xa33c42[_0x77d6('0x10')](0x1f4,_0x4dc7df['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 6ae801b..2ad9732 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 _0xd055=['describe','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x56e612,_0xb30b48){var _0xa5ca04=function(_0x3521e8){while(--_0x3521e8){_0x56e612['push'](_0x56e612['shift']());}};_0xa5ca04(++_0xb30b48);}(_0xd055,0x88));var _0x5d05=function(_0x43a485,_0x336240){_0x43a485=_0x43a485-0x0;var _0x10ffa6=_0xd055[_0x43a485];return _0x10ffa6;};'use strict';var multer=require('multer');var util=require(_0x5d05('0x0'));var path=require('path');var timeout=require(_0x5d05('0x1'));var express=require(_0x5d05('0x2'));var router=express[_0x5d05('0x3')]();var fs_extra=require(_0x5d05('0x4'));var auth=require(_0x5d05('0x5'));var interaction=require(_0x5d05('0x6'));var config=require(_0x5d05('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x5d05('0x8')]('/',auth[_0x5d05('0x9')](),controller['index']);router[_0x5d05('0x8')](_0x5d05('0xa'),auth[_0x5d05('0x9')](),controller[_0x5d05('0xb')]);router[_0x5d05('0x8')](_0x5d05('0xc'),auth[_0x5d05('0x9')](),controller[_0x5d05('0xd')]);router[_0x5d05('0xe')]('/',auth[_0x5d05('0x9')](),controller[_0x5d05('0xf')]);router[_0x5d05('0x10')](_0x5d05('0xc'),auth[_0x5d05('0x9')](),controller[_0x5d05('0x11')]);router[_0x5d05('0x12')](_0x5d05('0xc'),auth[_0x5d05('0x9')](),controller[_0x5d05('0x13')]);module[_0x5d05('0x14')]=router; \ No newline at end of file +var _0x6990=['./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x570dfb,_0x41d131){var _0x1865b5=function(_0xfa2743){while(--_0xfa2743){_0x570dfb['push'](_0x570dfb['shift']());}};_0x1865b5(++_0x41d131);}(_0x6990,0x1bc));var _0x0699=function(_0x4cea27,_0x5d0843){_0x4cea27=_0x4cea27-0x0;var _0x76bf89=_0x6990[_0x4cea27];return _0x76bf89;};'use strict';var multer=require(_0x0699('0x0'));var util=require('util');var path=require(_0x0699('0x1'));var timeout=require(_0x0699('0x2'));var express=require(_0x0699('0x3'));var router=express[_0x0699('0x4')]();var fs_extra=require(_0x0699('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0699('0x6'));router[_0x0699('0x7')]('/',auth[_0x0699('0x8')](),controller[_0x0699('0x9')]);router[_0x0699('0x7')](_0x0699('0xa'),auth[_0x0699('0x8')](),controller[_0x0699('0xb')]);router['get'](_0x0699('0xc'),auth[_0x0699('0x8')](),controller[_0x0699('0xd')]);router[_0x0699('0xe')]('/',auth[_0x0699('0x8')](),controller[_0x0699('0xf')]);router['put'](_0x0699('0xc'),auth['isAuthenticated'](),controller[_0x0699('0x10')]);router[_0x0699('0x11')](_0x0699('0xc'),auth[_0x0699('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 15e958f..c2a359e 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 _0x5800=['account','queue','DATE','exports','STRING','ENUM'];(function(_0x4ef262,_0x21b53b){var _0x520a1d=function(_0x51c691){while(--_0x51c691){_0x4ef262['push'](_0x4ef262['shift']());}};_0x520a1d(++_0x21b53b);}(_0x5800,0x1b9));var _0x0580=function(_0x40cd99,_0x4c52e2){_0x40cd99=_0x40cd99-0x0;var _0x26e4bd=_0x5800[_0x40cd99];return _0x26e4bd;};'use strict';var Sequelize=require('sequelize');module[_0x0580('0x0')]={'uniqueid':{'type':Sequelize[_0x0580('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0580('0x2')](_0x0580('0x3'),'agent',_0x0580('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0580('0x5')]}}; \ No newline at end of file +var _0x94d2=['queue','STRING','ENUM','account','agent'];(function(_0x10d2bd,_0x15049e){var _0x241ac4=function(_0xb2b338){while(--_0xb2b338){_0x10d2bd['push'](_0x10d2bd['shift']());}};_0x241ac4(++_0x15049e);}(_0x94d2,0x1cd));var _0x294d=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0x94d2[_0x509273];return _0x38ef40;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x294d('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x294d('0x1')](_0x294d('0x2'),_0x294d('0x3'),_0x294d('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a63545f..65dd244 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 _0x28f2=['where','pick','filter','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','merge','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x28f2,0x193));var _0x228f=function(_0x23293b,_0x4c98af){_0x23293b=_0x23293b-0x0;var _0x218635=_0x28f2[_0x23293b];return _0x218635;};'use strict';var emlformat=require(_0x228f('0x0'));var rimraf=require(_0x228f('0x1'));var zipdir=require(_0x228f('0x2'));var jsonpatch=require(_0x228f('0x3'));var rp=require(_0x228f('0x4'));var moment=require('moment');var BPromise=require(_0x228f('0x5'));var Mustache=require(_0x228f('0x6'));var util=require(_0x228f('0x7'));var path=require(_0x228f('0x8'));var sox=require(_0x228f('0x9'));var csv=require(_0x228f('0xa'));var ejs=require(_0x228f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x228f('0xc'));var squel=require('squel');var crypto=require(_0x228f('0xd'));var jsforce=require(_0x228f('0xe'));var deskjs=require(_0x228f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x228f('0x10'));var Papa=require('papaparse');var Redis=require(_0x228f('0x11'));var authService=require(_0x228f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x228f('0x13'));var hardwareService=require(_0x228f('0x14'));var logger=require(_0x228f('0x15'))(_0x228f('0x16'));var utils=require(_0x228f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x228f('0x18'));var db=require(_0x228f('0x19'))['db'];function respondWithStatusCode(_0x24f69c,_0x14073a){_0x14073a=_0x14073a||0xcc;return function(_0x2e1a43){if(_0x2e1a43){return _0x24f69c[_0x228f('0x1a')](_0x14073a);}return _0x24f69c[_0x228f('0x1b')](_0x14073a)[_0x228f('0x1c')]();};}function respondWithResult(_0x572535,_0x2fab95){_0x2fab95=_0x2fab95||0xc8;return function(_0xfb6aff){if(_0xfb6aff){return _0x572535[_0x228f('0x1b')](_0x2fab95)[_0x228f('0x1d')](_0xfb6aff);}};}function respondWithFilteredResult(_0x2a4d87,_0x21a913){return function(_0x272723){if(_0x272723){var _0x5b5abb=typeof _0x21a913[_0x228f('0x1e')]==='undefined'&&typeof _0x21a913[_0x228f('0x1f')]===_0x228f('0x20');var _0x195e65=_0x272723['count'];var _0x2d4819=_0x5b5abb?0x0:_0x21a913['offset'];var _0x33e32e=_0x5b5abb?_0x272723['count']:_0x21a913[_0x228f('0x1e')]+_0x21a913['limit'];var _0x5aa203;if(_0x33e32e>=_0x195e65){_0x33e32e=_0x195e65;_0x5aa203=0xc8;}else{_0x5aa203=0xce;}_0x2a4d87[_0x228f('0x1b')](_0x5aa203);return _0x2a4d87['set'](_0x228f('0x21'),_0x2d4819+'-'+_0x33e32e+'/'+_0x195e65)[_0x228f('0x1d')](_0x272723);}return null;};}function patchUpdates(_0x1294a8){return function(_0x3a623a){try{jsonpatch[_0x228f('0x22')](_0x3a623a,_0x1294a8,!![]);}catch(_0x313cf2){return BPromise[_0x228f('0x23')](_0x313cf2);}return _0x3a623a[_0x228f('0x24')]();};}function saveUpdates(_0x15d54f,_0x4ee0c9){return function(_0x1e96d4){if(_0x1e96d4){return _0x1e96d4[_0x228f('0x25')](_0x15d54f)[_0x228f('0x26')](function(_0x3c00ad){return _0x3c00ad;});}return null;};}function removeEntity(_0x1dad27,_0x194d1a){return function(_0x33e882){if(_0x33e882){return _0x33e882[_0x228f('0x27')]()[_0x228f('0x26')](function(){_0x1dad27['status'](0xcc)[_0x228f('0x1c')]();});}};}function handleEntityNotFound(_0x306928,_0x2b3553){return function(_0x272c7d){if(!_0x272c7d){_0x306928[_0x228f('0x1a')](0x194);}return _0x272c7d;};}function handleError(_0x539faa,_0xe8aac){_0xe8aac=_0xe8aac||0x1f4;return function(_0x49efe9){logger[_0x228f('0x28')](_0x49efe9['stack']);if(_0x49efe9['name']){delete _0x49efe9[_0x228f('0x29')];}_0x539faa[_0x228f('0x1b')](_0xe8aac)[_0x228f('0x2a')](_0x49efe9);};}exports[_0x228f('0x2b')]=function(_0x34c735,_0x2c964e){var _0x2eaf4f={},_0x2511e5={},_0xe67c83={'count':0x0,'rows':[]};var _0x2f13d9=_[_0x228f('0x2c')](db[_0x228f('0x2d')][_0x228f('0x2e')],function(_0xc6921f){return{'name':_0xc6921f[_0x228f('0x2f')],'type':_0xc6921f['type'][_0x228f('0x30')]};});_0x2511e5[_0x228f('0x31')]=_[_0x228f('0x2c')](_0x2f13d9,'name');_0x2511e5[_0x228f('0x32')]=_[_0x228f('0x33')](_0x34c735['query']);_0x2511e5[_0x228f('0x34')]=_[_0x228f('0x35')](_0x2511e5[_0x228f('0x31')],_0x2511e5[_0x228f('0x32')]);_0x2eaf4f['attributes']=_[_0x228f('0x35')](_0x2511e5['model'],qs[_0x228f('0x36')](_0x34c735[_0x228f('0x32')][_0x228f('0x36')]));_0x2eaf4f[_0x228f('0x37')]=_0x2eaf4f['attributes'][_0x228f('0x38')]?_0x2eaf4f[_0x228f('0x37')]:_0x2511e5['model'];if(!_0x34c735['query']['hasOwnProperty'](_0x228f('0x39'))){_0x2eaf4f[_0x228f('0x1f')]=qs[_0x228f('0x1f')](_0x34c735[_0x228f('0x32')][_0x228f('0x1f')]);_0x2eaf4f[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0x34c735[_0x228f('0x32')][_0x228f('0x1e')]);}_0x2eaf4f['order']=qs['sort'](_0x34c735[_0x228f('0x32')][_0x228f('0x3a')]);_0x2eaf4f[_0x228f('0x3b')]=qs[_0x228f('0x34')](_[_0x228f('0x3c')](_0x34c735[_0x228f('0x32')],_0x2511e5[_0x228f('0x34')]),_0x2f13d9);if(_0x34c735[_0x228f('0x32')][_0x228f('0x3d')]){_0x2eaf4f[_0x228f('0x3b')]=_['merge'](_0x2eaf4f['where'],{'$or':_[_0x228f('0x2c')](_0x2f13d9,function(_0x29a250){if(_0x29a250[_0x228f('0x3e')]!==_0x228f('0x3f')){var _0x5b7b44={};_0x5b7b44[_0x29a250[_0x228f('0x29')]]={'$like':'%'+_0x34c735[_0x228f('0x32')]['filter']+'%'};return _0x5b7b44;}})});}_0x2eaf4f=_['merge']({},_0x2eaf4f,_0x34c735[_0x228f('0x40')]);var _0x2f6f54={'where':_0x2eaf4f['where']};return db[_0x228f('0x2d')][_0x228f('0x41')](_0x2f6f54)['then'](function(_0x536166){_0xe67c83[_0x228f('0x41')]=_0x536166;if(_0x34c735['query'][_0x228f('0x42')]){_0x2eaf4f[_0x228f('0x43')]=[{'all':!![]}];}return db[_0x228f('0x2d')][_0x228f('0x44')](_0x2eaf4f);})[_0x228f('0x26')](function(_0x20c178){_0xe67c83['rows']=_0x20c178;return _0xe67c83;})[_0x228f('0x26')](respondWithFilteredResult(_0x2c964e,_0x2eaf4f))['catch'](handleError(_0x2c964e,null));};exports[_0x228f('0x45')]=function(_0xc59d9b,_0x285af1){var _0x96126c={'raw':!![],'where':{'id':_0xc59d9b[_0x228f('0x46')]['id']}},_0x41cba5={};_0x41cba5[_0x228f('0x31')]=_[_0x228f('0x33')](db[_0x228f('0x2d')][_0x228f('0x2e')]);_0x41cba5[_0x228f('0x32')]=_[_0x228f('0x33')](_0xc59d9b[_0x228f('0x32')]);_0x41cba5['filters']=_['intersection'](_0x41cba5[_0x228f('0x31')],_0x41cba5[_0x228f('0x32')]);_0x96126c[_0x228f('0x37')]=_[_0x228f('0x35')](_0x41cba5[_0x228f('0x31')],qs[_0x228f('0x36')](_0xc59d9b[_0x228f('0x32')][_0x228f('0x36')]));_0x96126c[_0x228f('0x37')]=_0x96126c[_0x228f('0x37')]['length']?_0x96126c[_0x228f('0x37')]:_0x41cba5[_0x228f('0x31')];if(_0xc59d9b['query'][_0x228f('0x42')]){_0x96126c['include']=[{'all':!![]}];}_0x96126c=_[_0x228f('0x47')]({},_0x96126c,_0xc59d9b['options']);return db[_0x228f('0x2d')]['find'](_0x96126c)[_0x228f('0x26')](handleEntityNotFound(_0x285af1,null))[_0x228f('0x26')](respondWithResult(_0x285af1,null))[_0x228f('0x48')](handleError(_0x285af1,null));};exports[_0x228f('0x49')]=function(_0x3dea4e,_0x2e0054){return db[_0x228f('0x2d')][_0x228f('0x49')](_0x3dea4e[_0x228f('0x4a')],{})[_0x228f('0x26')](respondWithResult(_0x2e0054,0xc9))[_0x228f('0x48')](handleError(_0x2e0054,null));};exports[_0x228f('0x25')]=function(_0x4099d4,_0x250345){if(_0x4099d4[_0x228f('0x4a')]['id']){delete _0x4099d4[_0x228f('0x4a')]['id'];}return db[_0x228f('0x2d')][_0x228f('0x4b')]({'where':{'id':_0x4099d4[_0x228f('0x46')]['id']}})['then'](handleEntityNotFound(_0x250345,null))['then'](saveUpdates(_0x4099d4[_0x228f('0x4a')],null))[_0x228f('0x26')](respondWithResult(_0x250345,null))[_0x228f('0x48')](handleError(_0x250345,null));};exports['destroy']=function(_0x17bcd9,_0x9750ca){return db[_0x228f('0x2d')]['find']({'where':{'id':_0x17bcd9['params']['id']}})['then'](handleEntityNotFound(_0x9750ca,null))[_0x228f('0x26')](removeEntity(_0x9750ca,null))[_0x228f('0x48')](handleError(_0x9750ca,null));};exports[_0x228f('0x4c')]=function(_0x466a2b,_0x42036c){return db[_0x228f('0x2d')][_0x228f('0x4c')]()[_0x228f('0x26')](respondWithResult(_0x42036c,null))[_0x228f('0x48')](handleError(_0x42036c,null));}; \ No newline at end of file +var _0x68b7=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','WhatsappTransferReport','findAll','catch','show','keys','rawAttributes','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox'];(function(_0x515908,_0x4e70c0){var _0x398b59=function(_0x130162){while(--_0x130162){_0x515908['push'](_0x515908['shift']());}};_0x398b59(++_0x4e70c0);}(_0x68b7,0x8c));var _0x768b=function(_0x11ccbc,_0x308b35){_0x11ccbc=_0x11ccbc-0x0;var _0xe7f530=_0x68b7[_0x11ccbc];return _0xe7f530;};'use strict';var emlformat=require(_0x768b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x768b('0x1'));var jsonpatch=require(_0x768b('0x2'));var rp=require(_0x768b('0x3'));var moment=require('moment');var BPromise=require(_0x768b('0x4'));var Mustache=require(_0x768b('0x5'));var util=require(_0x768b('0x6'));var path=require('path');var sox=require(_0x768b('0x7'));var csv=require(_0x768b('0x8'));var ejs=require(_0x768b('0x9'));var fs=require('fs');var fs_extra=require(_0x768b('0xa'));var _=require(_0x768b('0xb'));var squel=require(_0x768b('0xc'));var crypto=require(_0x768b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x768b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x768b('0xf'));var Papa=require(_0x768b('0x10'));var Redis=require(_0x768b('0x11'));var authService=require(_0x768b('0x12'));var qs=require(_0x768b('0x13'));var as=require(_0x768b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x768b('0x15'))(_0x768b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x768b('0x17'));var db=require(_0x768b('0x18'))['db'];function respondWithStatusCode(_0x35689d,_0x9c3671){_0x9c3671=_0x9c3671||0xcc;return function(_0x8fa3e6){if(_0x8fa3e6){return _0x35689d[_0x768b('0x19')](_0x9c3671);}return _0x35689d[_0x768b('0x1a')](_0x9c3671)[_0x768b('0x1b')]();};}function respondWithResult(_0x37a8b5,_0x4cff45){_0x4cff45=_0x4cff45||0xc8;return function(_0x467f33){if(_0x467f33){return _0x37a8b5[_0x768b('0x1a')](_0x4cff45)[_0x768b('0x1c')](_0x467f33);}};}function respondWithFilteredResult(_0x3a40b6,_0x1f655e){return function(_0x50306b){if(_0x50306b){var _0x17078f=typeof _0x1f655e[_0x768b('0x1d')]===_0x768b('0x1e')&&typeof _0x1f655e[_0x768b('0x1f')]===_0x768b('0x1e');var _0x7fc465=_0x50306b[_0x768b('0x20')];var _0x20312a=_0x17078f?0x0:_0x1f655e[_0x768b('0x1d')];var _0x421b6f=_0x17078f?_0x50306b[_0x768b('0x20')]:_0x1f655e[_0x768b('0x1d')]+_0x1f655e['limit'];var _0x507bdc;if(_0x421b6f>=_0x7fc465){_0x421b6f=_0x7fc465;_0x507bdc=0xc8;}else{_0x507bdc=0xce;}_0x3a40b6[_0x768b('0x1a')](_0x507bdc);return _0x3a40b6[_0x768b('0x21')]('Content-Range',_0x20312a+'-'+_0x421b6f+'/'+_0x7fc465)[_0x768b('0x1c')](_0x50306b);}return null;};}function patchUpdates(_0x931aa0){return function(_0x5c81ca){try{jsonpatch[_0x768b('0x22')](_0x5c81ca,_0x931aa0,!![]);}catch(_0x10c81c){return BPromise[_0x768b('0x23')](_0x10c81c);}return _0x5c81ca[_0x768b('0x24')]();};}function saveUpdates(_0xaa1538,_0x4d63a2){return function(_0x58cca0){if(_0x58cca0){return _0x58cca0[_0x768b('0x25')](_0xaa1538)[_0x768b('0x26')](function(_0xdc2648){return _0xdc2648;});}return null;};}function removeEntity(_0x207f99,_0x4694f6){return function(_0x1186ab){if(_0x1186ab){return _0x1186ab[_0x768b('0x27')]()[_0x768b('0x26')](function(){_0x207f99[_0x768b('0x1a')](0xcc)[_0x768b('0x1b')]();});}};}function handleEntityNotFound(_0x3ada89,_0x388e79){return function(_0x3a5307){if(!_0x3a5307){_0x3ada89[_0x768b('0x19')](0x194);}return _0x3a5307;};}function handleError(_0x4e31d5,_0x35614b){_0x35614b=_0x35614b||0x1f4;return function(_0x533665){logger['error'](_0x533665['stack']);if(_0x533665['name']){delete _0x533665[_0x768b('0x28')];}_0x4e31d5[_0x768b('0x1a')](_0x35614b)['send'](_0x533665);};}exports[_0x768b('0x29')]=function(_0x5194ee,_0x19c0ed){var _0x556b47={},_0x2681d4={},_0x1973b8={'count':0x0,'rows':[]};var _0x194812=_[_0x768b('0x2a')](db['WhatsappTransferReport']['rawAttributes'],function(_0x501ec6){return{'name':_0x501ec6[_0x768b('0x2b')],'type':_0x501ec6[_0x768b('0x2c')][_0x768b('0x2d')]};});_0x2681d4[_0x768b('0x2e')]=_['map'](_0x194812,_0x768b('0x28'));_0x2681d4[_0x768b('0x2f')]=_['keys'](_0x5194ee['query']);_0x2681d4[_0x768b('0x30')]=_[_0x768b('0x31')](_0x2681d4['model'],_0x2681d4[_0x768b('0x2f')]);_0x556b47[_0x768b('0x32')]=_[_0x768b('0x31')](_0x2681d4[_0x768b('0x2e')],qs[_0x768b('0x33')](_0x5194ee[_0x768b('0x2f')]['fields']));_0x556b47[_0x768b('0x32')]=_0x556b47[_0x768b('0x32')][_0x768b('0x34')]?_0x556b47['attributes']:_0x2681d4[_0x768b('0x2e')];if(!_0x5194ee[_0x768b('0x2f')][_0x768b('0x35')]('nolimit')){_0x556b47['limit']=qs[_0x768b('0x1f')](_0x5194ee[_0x768b('0x2f')][_0x768b('0x1f')]);_0x556b47[_0x768b('0x1d')]=qs[_0x768b('0x1d')](_0x5194ee['query'][_0x768b('0x1d')]);}_0x556b47[_0x768b('0x36')]=qs[_0x768b('0x37')](_0x5194ee[_0x768b('0x2f')][_0x768b('0x37')]);_0x556b47[_0x768b('0x38')]=qs[_0x768b('0x30')](_[_0x768b('0x39')](_0x5194ee[_0x768b('0x2f')],_0x2681d4['filters']),_0x194812);if(_0x5194ee[_0x768b('0x2f')][_0x768b('0x3a')]){_0x556b47[_0x768b('0x38')]=_[_0x768b('0x3b')](_0x556b47[_0x768b('0x38')],{'$or':_['map'](_0x194812,function(_0x6f018a){if(_0x6f018a[_0x768b('0x2c')]!=='VIRTUAL'){var _0x58abd2={};_0x58abd2[_0x6f018a['name']]={'$like':'%'+_0x5194ee['query'][_0x768b('0x3a')]+'%'};return _0x58abd2;}})});}_0x556b47=_[_0x768b('0x3b')]({},_0x556b47,_0x5194ee[_0x768b('0x3c')]);var _0x3a3b99={'where':_0x556b47[_0x768b('0x38')]};return db['WhatsappTransferReport'][_0x768b('0x20')](_0x3a3b99)['then'](function(_0x5c1e2b){_0x1973b8[_0x768b('0x20')]=_0x5c1e2b;if(_0x5194ee[_0x768b('0x2f')][_0x768b('0x3d')]){_0x556b47[_0x768b('0x3e')]=[{'all':!![]}];}return db[_0x768b('0x3f')][_0x768b('0x40')](_0x556b47);})[_0x768b('0x26')](function(_0x213919){_0x1973b8['rows']=_0x213919;return _0x1973b8;})[_0x768b('0x26')](respondWithFilteredResult(_0x19c0ed,_0x556b47))[_0x768b('0x41')](handleError(_0x19c0ed,null));};exports[_0x768b('0x42')]=function(_0x22cfe8,_0x925c02){var _0x4be074={'raw':!![],'where':{'id':_0x22cfe8['params']['id']}},_0x5c9f57={};_0x5c9f57[_0x768b('0x2e')]=_[_0x768b('0x43')](db[_0x768b('0x3f')][_0x768b('0x44')]);_0x5c9f57[_0x768b('0x2f')]=_[_0x768b('0x43')](_0x22cfe8[_0x768b('0x2f')]);_0x5c9f57['filters']=_['intersection'](_0x5c9f57[_0x768b('0x2e')],_0x5c9f57[_0x768b('0x2f')]);_0x4be074[_0x768b('0x32')]=_[_0x768b('0x31')](_0x5c9f57[_0x768b('0x2e')],qs[_0x768b('0x33')](_0x22cfe8[_0x768b('0x2f')]['fields']));_0x4be074[_0x768b('0x32')]=_0x4be074[_0x768b('0x32')][_0x768b('0x34')]?_0x4be074[_0x768b('0x32')]:_0x5c9f57[_0x768b('0x2e')];if(_0x22cfe8[_0x768b('0x2f')][_0x768b('0x3d')]){_0x4be074[_0x768b('0x3e')]=[{'all':!![]}];}_0x4be074=_[_0x768b('0x3b')]({},_0x4be074,_0x22cfe8[_0x768b('0x3c')]);return db[_0x768b('0x3f')][_0x768b('0x45')](_0x4be074)['then'](handleEntityNotFound(_0x925c02,null))[_0x768b('0x26')](respondWithResult(_0x925c02,null))[_0x768b('0x41')](handleError(_0x925c02,null));};exports[_0x768b('0x46')]=function(_0x16649c,_0x37915d){return db[_0x768b('0x3f')][_0x768b('0x46')](_0x16649c[_0x768b('0x47')],{})[_0x768b('0x26')](respondWithResult(_0x37915d,0xc9))[_0x768b('0x41')](handleError(_0x37915d,null));};exports[_0x768b('0x25')]=function(_0x17fb3c,_0x461cc5){if(_0x17fb3c[_0x768b('0x47')]['id']){delete _0x17fb3c[_0x768b('0x47')]['id'];}return db[_0x768b('0x3f')]['find']({'where':{'id':_0x17fb3c[_0x768b('0x48')]['id']}})[_0x768b('0x26')](handleEntityNotFound(_0x461cc5,null))[_0x768b('0x26')](saveUpdates(_0x17fb3c[_0x768b('0x47')],null))[_0x768b('0x26')](respondWithResult(_0x461cc5,null))[_0x768b('0x41')](handleError(_0x461cc5,null));};exports[_0x768b('0x27')]=function(_0x4ef9ce,_0x40d5cc){return db['WhatsappTransferReport'][_0x768b('0x45')]({'where':{'id':_0x4ef9ce[_0x768b('0x48')]['id']}})['then'](handleEntityNotFound(_0x40d5cc,null))[_0x768b('0x26')](removeEntity(_0x40d5cc,null))[_0x768b('0x41')](handleError(_0x40d5cc,null));};exports[_0x768b('0x49')]=function(_0x578025,_0x3048f6){return db['WhatsappTransferReport']['describe']()['then'](respondWithResult(_0x3048f6,null))[_0x768b('0x41')](handleError(_0x3048f6,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index bd1a2d0..52a0f61 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 _0xc041=['WhatsappTransferReport','report_whatsapp_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappTransferReport.attributes','define'];(function(_0x46da11,_0x5e853d){var _0x4d51b5=function(_0x5c9436){while(--_0x5c9436){_0x46da11['push'](_0x46da11['shift']());}};_0x4d51b5(++_0x5e853d);}(_0xc041,0x1a6));var _0x1c04=function(_0x437546,_0x334f47){_0x437546=_0x437546-0x0;var _0x36b04f=_0xc041[_0x437546];return _0x36b04f;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var logger=require(_0x1c04('0x2'))(_0x1c04('0x3'));var moment=require(_0x1c04('0x4'));var BPromise=require(_0x1c04('0x5'));var rp=require(_0x1c04('0x6'));var fs=require('fs');var path=require(_0x1c04('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1c04('0x8'));module['exports']=function(_0x47b1cf,_0xcad48d){return _0x47b1cf[_0x1c04('0x9')](_0x1c04('0xa'),attributes,{'tableName':_0x1c04('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x117d=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','report_whatsapp_transfer','uniqueid','lodash'];(function(_0xb2d045,_0x4f42ef){var _0x421cc7=function(_0x34756d){while(--_0x34756d){_0xb2d045['push'](_0xb2d045['shift']());}};_0x421cc7(++_0x4f42ef);}(_0x117d,0x1eb));var _0xd117=function(_0x53f04f,_0x419aa8){_0x53f04f=_0x53f04f-0x0;var _0x16a824=_0x117d[_0x53f04f];return _0x16a824;};'use strict';var _=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var logger=require(_0xd117('0x2'))(_0xd117('0x3'));var moment=require(_0xd117('0x4'));var BPromise=require('bluebird');var rp=require(_0xd117('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd117('0x6'));var config=require(_0xd117('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xd117('0x8')]=function(_0x30819a,_0x1afabc){return _0x30819a[_0xd117('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0xd117('0xa'),'paranoid':![],'indexes':[{'name':_0xd117('0xb'),'fields':[_0xd117('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 046ae0b..0249eed 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 _0x5254=['request\x20sent','stringify','error','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x5b8881,_0x4932d6){var _0x50a07c=function(_0x19edec){while(--_0x19edec){_0x5b8881['push'](_0x5b8881['shift']());}};_0x50a07c(++_0x4932d6);}(_0x5254,0xd6));var _0x4525=function(_0x4187d1,_0x334894){_0x4187d1=_0x4187d1-0x0;var _0x269ec2=_0x5254[_0x4187d1];return _0x269ec2;};'use strict';var _=require(_0x4525('0x0'));var util=require(_0x4525('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4525('0x2'));var db=require(_0x4525('0x3'))['db'];var utils=require(_0x4525('0x4'));var logger=require('../../config/logger')(_0x4525('0x5'));var config=require(_0x4525('0x6'));var jayson=require(_0x4525('0x7'));var client=jayson['client'][_0x4525('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x287fa9,_0x20ad3e,_0x5cda56){return new BPromise(function(_0x5e55f5,_0x5238ea){return client['request'](_0x287fa9,_0x5cda56)[_0x4525('0x9')](function(_0x17582f){logger[_0x4525('0xa')](_0x4525('0xb'),_0x20ad3e,'request\x20sent');logger[_0x4525('0xc')](_0x4525('0xd'),_0x20ad3e,_0x4525('0xe'),JSON[_0x4525('0xf')](_0x17582f));if(_0x17582f[_0x4525('0x10')]){if(_0x17582f['error']['code']===0x1f4){logger[_0x4525('0x10')](_0x4525('0xb'),_0x20ad3e,_0x17582f['error'][_0x4525('0x11')]);return _0x5238ea(_0x17582f[_0x4525('0x10')][_0x4525('0x11')]);}logger[_0x4525('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x20ad3e,_0x17582f[_0x4525('0x10')][_0x4525('0x11')]);return _0x5e55f5(_0x17582f[_0x4525('0x10')][_0x4525('0x11')]);}else{logger[_0x4525('0xa')](_0x4525('0xb'),_0x20ad3e,_0x4525('0xe'));_0x5e55f5(_0x17582f['result'][_0x4525('0x11')]);}})[_0x4525('0x12')](function(_0x46aa0b){logger[_0x4525('0x10')](_0x4525('0xb'),_0x20ad3e,_0x46aa0b);_0x5238ea(_0x46aa0b);});});} \ No newline at end of file +var _0xf183=['request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0xc8302f,_0x1d8f18){var _0x163f56=function(_0x31e3fa){while(--_0x31e3fa){_0xc8302f['push'](_0xc8302f['shift']());}};_0x163f56(++_0x1d8f18);}(_0xf183,0x1c3));var _0x3f18=function(_0x3556e3,_0x32985a){_0x3556e3=_0x3556e3-0x0;var _0x3d7471=_0xf183[_0x3556e3];return _0x3d7471;};'use strict';var _=require(_0x3f18('0x0'));var util=require(_0x3f18('0x1'));var moment=require(_0x3f18('0x2'));var BPromise=require(_0x3f18('0x3'));var rs=require(_0x3f18('0x4'));var fs=require('fs');var Redis=require(_0x3f18('0x5'));var db=require(_0x3f18('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3f18('0x7'));var config=require(_0x3f18('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3f18('0x9')][_0x3f18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1faaae,_0x560ba1,_0x3739f3){return new BPromise(function(_0x4889ff,_0x20bc18){return client[_0x3f18('0xb')](_0x1faaae,_0x3739f3)['then'](function(_0x50c529){logger[_0x3f18('0xc')](_0x3f18('0xd'),_0x560ba1,_0x3f18('0xe'));logger[_0x3f18('0xf')](_0x3f18('0x10'),_0x560ba1,_0x3f18('0xe'),JSON[_0x3f18('0x11')](_0x50c529));if(_0x50c529[_0x3f18('0x12')]){if(_0x50c529['error']['code']===0x1f4){logger['error'](_0x3f18('0xd'),_0x560ba1,_0x50c529[_0x3f18('0x12')][_0x3f18('0x13')]);return _0x20bc18(_0x50c529[_0x3f18('0x12')][_0x3f18('0x13')]);}logger[_0x3f18('0x12')](_0x3f18('0xd'),_0x560ba1,_0x50c529['error'][_0x3f18('0x13')]);return _0x4889ff(_0x50c529[_0x3f18('0x12')][_0x3f18('0x13')]);}else{logger[_0x3f18('0xc')](_0x3f18('0xd'),_0x560ba1,_0x3f18('0xe'));_0x4889ff(_0x50c529[_0x3f18('0x14')]['message']);}})[_0x3f18('0x15')](function(_0x26139b){logger['error'](_0x3f18('0xd'),_0x560ba1,_0x26139b);_0x20bc18(_0x26139b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 828c81e..3cfd980 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f7a=['./config/seedDB','./config/license','./config/environment','./config/pm2/config','./config/schedule','./config/schedule/transcribe','then','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','filter','online','Offline\x20apps:','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','lodash','./mysqldb'];(function(_0x125ac9,_0x396c02){var _0x26d16c=function(_0x10fb8e){while(--_0x10fb8e){_0x125ac9['push'](_0x125ac9['shift']());}};_0x26d16c(++_0x396c02);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x9f7a[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xa9f7('0x0'));var db=require(_0xa9f7('0x1'))['db'];var seedDb=require(_0xa9f7('0x2'));var checkLicense=require(_0xa9f7('0x3'));var rpc=require('./rpc');var config=require(_0xa9f7('0x4'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0xa9f7('0x5'));var schedule=require(_0xa9f7('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xa9f7('0x7'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize']['sync']()[_0xa9f7('0x8')](function(){if(config['seedDB']){return seedDb[_0xa9f7('0x9')]();}})[_0xa9f7('0x8')](function(){return checkLicense[_0xa9f7('0x9')]();})['then'](function(){return rpc[_0xa9f7('0xa')]();})[_0xa9f7('0x8')](function(_0x4d9b2a){logger[_0xa9f7('0xb')](_0x4d9b2a);return chat[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return whatsapp[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return schedule[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return transcribe['start']();})[_0xa9f7('0x8')](function(){return provider['start']();})[_0xa9f7('0x8')](function(_0x437a83){logger[_0xa9f7('0xb')](_0x437a83);return pm2['start'](pm2Config);})['then'](function(_0xe56a20){var _0x4855d0=_0xe56a20['filter'](function(_0x188f8a){return typeof _0x188f8a[_0xa9f7('0xd')]===_0xa9f7('0xe')&&_0x188f8a['exitCode']>=0x0;});if(_0x4855d0[_0xa9f7('0xf')]>0x0){throw new Error(_0x4855d0[_0xa9f7('0xf')]+_0xa9f7('0x10')+_['map'](_0x4855d0,function(_0x310009){return'\x22'+_0x310009[_0xa9f7('0x11')][_0xa9f7('0x12')]+'\x22';}));}logger[_0xa9f7('0xb')](_0xa9f7('0x13'),_[_0xa9f7('0x14')](_[_0xa9f7('0x15')](_0xe56a20,{'status':_0xa9f7('0x16')}),_0xa9f7('0x12'))['join']());logger[_0xa9f7('0xb')](_0xa9f7('0x17'),_[_0xa9f7('0x14')](_[_0xa9f7('0x15')](_0xe56a20,function(_0x402c6d){return _0x402c6d['status']!=='online';}),'name')['join']()||'None');console[_0xa9f7('0x18')]('App\x20Ready!');})[_0xa9f7('0x19')](function(_0x504304){console['log'](_0xa9f7('0x1a'),_0x504304);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x504304);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x9417=['lodash','./mysqldb','./config/seedDB','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','join','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x5f0092,_0x3e6a7a){var _0x597a54=function(_0x5ab4c4){while(--_0x5ab4c4){_0x5f0092['push'](_0x5f0092['shift']());}};_0x597a54(++_0x3e6a7a);}(_0x9417,0xb4));var _0x7941=function(_0x18f396,_0x174d17){_0x18f396=_0x18f396-0x0;var _0x3ba532=_0x9417[_0x18f396];return _0x3ba532;};'use strict';var _=require(_0x7941('0x0'));var db=require(_0x7941('0x1'))['db'];var seedDb=require(_0x7941('0x2'));var checkLicense=require(_0x7941('0x3'));var rpc=require('./rpc');var config=require(_0x7941('0x4'));var logger=require(_0x7941('0x5'))(_0x7941('0x6'));var pm2=require(_0x7941('0x7'));var pm2Config=require(_0x7941('0x8'));var schedule=require(_0x7941('0x9'));var chat=require(_0x7941('0xa'));var whatsapp=require(_0x7941('0xb'));var transcribe=require(_0x7941('0xc'));var provider=require(_0x7941('0xd'));function main(){return db['sequelize'][_0x7941('0xe')]()[_0x7941('0xf')](function(){if(config[_0x7941('0x10')]){return seedDb['default']();}})[_0x7941('0xf')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x7941('0x11')]();})[_0x7941('0xf')](function(_0x34b34b){logger[_0x7941('0x12')](_0x34b34b);return chat[_0x7941('0x13')]();})[_0x7941('0xf')](function(){return whatsapp[_0x7941('0x13')]();})[_0x7941('0xf')](function(){return schedule['start']();})[_0x7941('0xf')](function(){return transcribe['start']();})[_0x7941('0xf')](function(){return provider[_0x7941('0x13')]();})['then'](function(_0x4f40af){logger[_0x7941('0x12')](_0x4f40af);return pm2['start'](pm2Config);})[_0x7941('0xf')](function(_0x45c08f){var _0xa9f093=_0x45c08f[_0x7941('0x14')](function(_0x1da410){return typeof _0x1da410[_0x7941('0x15')]==='number'&&_0x1da410[_0x7941('0x15')]>=0x0;});if(_0xa9f093[_0x7941('0x16')]>0x0){throw new Error(_0xa9f093[_0x7941('0x16')]+_0x7941('0x17')+_[_0x7941('0x18')](_0xa9f093,function(_0x256f45){return'\x22'+_0x256f45[_0x7941('0x19')][_0x7941('0x1a')]+'\x22';}));}logger[_0x7941('0x12')]('Online\x20apps:',_['map'](_[_0x7941('0x14')](_0x45c08f,{'status':'online'}),_0x7941('0x1a'))[_0x7941('0x1b')]());logger[_0x7941('0x12')]('Offline\x20apps:',_['map'](_[_0x7941('0x14')](_0x45c08f,function(_0x4d3b28){return _0x4d3b28[_0x7941('0x1c')]!=='online';}),_0x7941('0x1a'))[_0x7941('0x1b')]()||_0x7941('0x1d'));console[_0x7941('0x1e')](_0x7941('0x1f'));})[_0x7941('0x20')](function(_0x368a07){console['log'](_0x7941('0x21'),_0x368a07);logger['error'](_0x7941('0x22'),_0x368a07);process[_0x7941('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index bb4bc48..9342eb4 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 _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x1e0561,_0x370016){var _0x20313d=function(_0x3b68c4){while(--_0x3b68c4){_0x1e0561['push'](_0x1e0561['shift']());}};_0x20313d(++_0x370016);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1ed406,_0x3b3184){_0x1ed406=_0x1ed406-0x0;var _0x359b38=_0xf3cd[_0x1ed406];return _0x359b38;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});} \ No newline at end of file +var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x811272,_0x2523c1){var _0x592744=function(_0x38126a){while(--_0x38126a){_0x811272['push'](_0x811272['shift']());}};_0x592744(++_0x2523c1);}(_0x55ca,0x126));var _0xa55c=function(_0x29638f,_0x5dfb8a){_0x29638f=_0x29638f-0x0;var _0x4c2121=_0x55ca[_0x29638f];return _0x4c2121;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 698e988..78edbce 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 _0xb7e7=['parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','fieldType','type','keys','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x1e235e,_0x994b77){var _0x1e8e94=function(_0x4a9e2c){while(--_0x4a9e2c){_0x1e235e['push'](_0x1e235e['shift']());}};_0x1e8e94(++_0x994b77);}(_0xb7e7,0x121));var _0x7b7e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb7e7[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x7b7e('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x7b7e('0x1'))['db'];exports['findAll']=function(_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){var _0x31d0ed={'count':0x0,'rows':[]};var _0x118577=sqlUtils[_0x7b7e('0x2')](_0x54a37f,_0x1b7cc7);if(_0x118577){return Promise['resolve'](_0x31d0ed);}var _0x53ed64=sqlUtils[_0x7b7e('0x3')]();var _0x372bde={};var _0x7f87e0=![];var _0x55ce81=![];return Promise[_0x7b7e('0x4')]()[_0x7b7e('0x5')](function(){if(_0x1b7cc7[_0x7b7e('0x6')]){return sqlUtils[_0x7b7e('0x7')](_0x1b7cc7[_0x7b7e('0x6')],_0x556d68);}else{return sqlUtils[_0x7b7e('0x8')](_0x1b7cc7,_0x556d68);}})[_0x7b7e('0x5')](function(_0x52de3b){_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xa')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xb')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xc')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xe')]);_0x372bde=_0x52de3b['tags'];_0x55ce81=_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xf')];return sqlUtils['checkListsRestrictions'](_0x54a37f,_0x1b7cc7,_0x55ce81);})[_0x7b7e('0x5')](function(_0x5976ac){_0x53ed64['where'](_0x5976ac);var _0x2889ed=_0x1b7cc7[_0x7b7e('0x6')]?_0x372bde[_0x7b7e('0x10')]:_0x1b7cc7[_0x7b7e('0x11')];_0x7f87e0=_0x2889ed?!![]:![];return sqlUtils[_0x7b7e('0x12')](_0x53ed64,_0x2889ed);})['then'](function(_0x51baf6){_0x31d0ed[_0x7b7e('0x13')]=_0x51baf6;if(_0x31d0ed[_0x7b7e('0x13')]===0x0){return;}return sqlUtils[_0x7b7e('0x14')](_0x53ed64,_0x1b7cc7[_0x7b7e('0xb')],_0x3f5804,_0x7f87e0,_0x372bde[_0x7b7e('0xe')],_0x55ce81);})[_0x7b7e('0x5')](function(_0x242368){if(!_0x242368){return[];}return sqlUtils[_0x7b7e('0x15')](_0x242368,_0x1b7cc7,_0x3f5804);})[_0x7b7e('0x5')](function(_0x429a0e){_0x31d0ed[_0x7b7e('0x16')]=_0x429a0e;return _0x31d0ed;})[_0x7b7e('0x17')](function(_0x448980){throw _0x448980;});};exports[_0x7b7e('0x18')]=function(){var _0x9776c3={};var _0x864287=[];return db[_0x7b7e('0x19')]['describe']()[_0x7b7e('0x5')](function(_0x43db4f){_0x9776c3=_0x43db4f;var _0x24718c=Object['keys'](_0x9776c3)[_0x7b7e('0xc')](function(_0xbf0cb3){return _[_0x7b7e('0x1a')](_0xbf0cb3,_0x7b7e('0x1b'))?_0xbf0cb3:undefined;});var _0x2b7211=_0x24718c[_0x7b7e('0x1c')](function(_0x28bf43){return db[_0x7b7e('0x1d')]['findOne']({'where':{'id':_0x28bf43['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x2b7211);})[_0x7b7e('0x5')](function(_0x22598e){for(var _0x23bfa3=0x0;_0x23bfa3<_0x22598e['length'];_0x23bfa3++){if(_0x22598e[_0x23bfa3]){var _0x51d3b1='cf_'+_0x22598e[_0x23bfa3]['id'];_0x9776c3[_0x51d3b1][_0x7b7e('0x1e')]=_0x22598e[_0x23bfa3][_0x7b7e('0x1f')];}}_0x864287=_[_0x7b7e('0x1c')](Object[_0x7b7e('0x20')](_0x9776c3),function(_0x3ceaf5){return{'name':_0x3ceaf5,'type':_0x9776c3[_0x3ceaf5]['type']};});return _0x864287;})[_0x7b7e('0x17')](function(_0x21a15){throw _0x21a15;});}; \ No newline at end of file +var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x5c324a,_0x5a8590){var _0x1226c4=function(_0x2e7532){while(--_0x2e7532){_0x5c324a['push'](_0x5c324a['shift']());}};_0x1226c4(++_0x5a8590);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0x0b0e[_0x27c25f];return _0x2da4c4;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 0a34c05..a4b32d2 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 _0x9585=['buildExpression','default','value','start','Tag','split','tags','clause','and','User','user','keys','map','some','compact','Contact','push','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','search','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','findAll','color','keyBy','QueryTypes','sequelize','toString','Tags','COUNT(*)','isEmpty','query','exports','squel','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','ListId','true','select','from','where','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','fax','email','CompanyId','createdAt','updatedAt','TagIds','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','DATE'];(function(_0x2a4da6,_0x5e7f66){var _0x21f384=function(_0x1d2b45){while(--_0x1d2b45){_0x2a4da6['push'](_0x2a4da6['shift']());}};_0x21f384(++_0x5e7f66);}(_0x9585,0x15e));var _0x5958=function(_0x1d11be,_0x2d6056){_0x1d11be=_0x1d11be-0x0;var _0x45ce3e=_0x9585[_0x1d11be];return _0x45ce3e;};'use strict';var _=require('lodash');var squel=require(_0x5958('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x5958('0x1'));var utils=require(_0x5958('0x2'));var db=require(_0x5958('0x3'))['db'];function skipContactsQuery(_0x1a8c5e,_0x35e63f){var _0x1f8027=![];if(_0x1a8c5e[_0x5958('0x4')]===_0x5958('0x5')&&!_0x35e63f['search']&&!_0x35e63f[_0x5958('0x6')]&&_0x35e63f['autocomplete']!==_0x5958('0x7')){_0x1f8027=!![];}return _0x1f8027;}function getContactsSubquery(){return squel[_0x5958('0x8')]()[_0x5958('0x9')]('cm_contacts','c')[_0x5958('0xa')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x116453,_0x12aa98){var _0x5018bf=_0x12aa98?'c':'subqry';_0x116453[_0x5958('0xb')](_0x5958('0xc'),'uc',_0x5958('0xd')+_0x5018bf+_0x5958('0xe'))[_0x5958('0xb')]('cm_contact_has_tags','ct',_0x5958('0xf')+_0x5018bf+_0x5958('0xe'))[_0x5958('0xb')](_0x5958('0x10'),'t',_0x5958('0x11'));return _0x116453;}function addFieldsToQuery(_0x4c298b,_0x564ec5,_0x4189c8,_0x3dbeda,_0x2c5570){var _0x4b8c0a=_0x2c5570?'c':_0x5958('0x12');if(!_0x564ec5){_0x564ec5=['id',_0x5958('0x13'),_0x5958('0x14'),_0x5958('0x15'),'mobile',_0x5958('0x16'),_0x5958('0x17'),_0x5958('0x6'),_0x5958('0x18'),_0x5958('0x19'),_0x5958('0x1a'),'deletedAt',_0x5958('0x1b')];}var _0x7cd01c=_0x4189c8&&_0x2c5570||!_0x4189c8&&!_0x2c5570;if(_0x3dbeda){_0x7cd01c=_0x3dbeda&&_0x2c5570||!_0x3dbeda&&!_0x2c5570;}_0x564ec5[_0x5958('0x1c')](function(_0x26c29d){if(_0x26c29d===_0x5958('0x1b')){if(_0x7cd01c){_0x4c298b['field'](_0x5958('0x1d'),_0x26c29d);}else if(_0x4189c8||_0x3dbeda){_0x4c298b[_0x5958('0x1e')](_0x4b8c0a+'.'+_0x26c29d);}}else{_0x4c298b[_0x5958('0x1e')](_0x4b8c0a+'.'+_0x26c29d);}});return _0x4c298b;}function getSqlClauses(){var _0x3de249={'default':squel[_0x5958('0x1f')](),'fields':squel['expr'](),'filter':squel[_0x5958('0x1f')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x3de249;}function parseTagParameter(_0x220f33){var _0x4a32ef=squel[_0x5958('0x1f')]();if(_0x220f33){var _0x40c4c4=utils[_0x5958('0x20')](_0x220f33);_0x40c4c4[_0x5958('0x1c')](function(_0x406b1f){_0x4a32ef['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x406b1f+',%');});}return _0x4a32ef;}function parseSearchFilter(_0x5a6789){var _0x5c5b8a=squel[_0x5958('0x1f')]();if(_0x5a6789){var _0x1f1a87=_0x5a6789[_0x5958('0x21')]('\x5c','\x5c\x5c')[_0x5958('0x21')](/'/g,'\x27\x27');if(_0x1f1a87['split']('\x20')[_0x5958('0x22')]>0x1){_0x5c5b8a['or'](_0x5958('0x23'),qs[_0x5958('0x24')](_0x1f1a87),null);}else{if(qs['isNumeric'](_0x1f1a87)){_0x5c5b8a['or'](_0x5958('0x25'),_0x1f1a87+'%');_0x5c5b8a['or'](_0x5958('0x26'),_0x1f1a87+'%');_0x5c5b8a['or'](_0x5958('0x27'),_0x1f1a87+'%');_0x5c5b8a['or'](_0x5958('0x28'),_0x1f1a87+'%');}else if(qs[_0x5958('0x29')](_0x1f1a87)){_0x5c5b8a['or'](_0x5958('0x2a'),_0x1f1a87+'%');}else{_0x5c5b8a['or'](_0x5958('0x2b'),'%'+_0x1f1a87+'%');_0x5c5b8a['or']('c.lastName\x20LIKE\x20?','%'+_0x1f1a87+'%');_0x5c5b8a['or']('c.email\x20LIKE\x20?','%'+_0x1f1a87+'%');}}}return _0x5c5b8a;}function parseAdvancedSearchFilter(_0xb93ced,_0x3d28d6){var _0x45cd86=getSqlClauses();var _0x57036a=as[_0x5958('0x2c')](_0xb93ced);var _0x388123=_0x57036a[_0x5958('0x2d')];for(var _0x3145a7=0x0;_0x3145a7<_0x57036a[_0x5958('0x2e')][_0x5958('0x22')];_0x3145a7++){var _0x2a020e=_0x57036a['conditions'][_0x3145a7];var _0x499b19='c';var _0x9725ce=_[_0x5958('0x2f')](_0x3d28d6,[_0x5958('0x30'),_0x2a020e['field']]);if(_0x9725ce){if(_0x2a020e['field']===_0x5958('0x31')||_0x9725ce[_0x5958('0x32')]===_0x5958('0x33')){_0x2a020e[_0x5958('0x34')]=_0x5958('0x35');}var _0x39a6b0=as[_0x5958('0x36')](_0x499b19,_0x9725ce['type'],_0x2a020e);_0x45cd86[_0x5958('0x37')][_0x388123](_0x39a6b0['text'],_0x39a6b0[_0x5958('0x38')][_0x5958('0x39')],_0x39a6b0['value']['end']);}else{if(_0x2a020e[_0x5958('0x1e')]===_0x5958('0x3a')){var _0x409380=_0x2a020e[_0x5958('0x38')][_0x5958('0x3b')](',')['map'](function(_0x433c66){return Number(_0x433c66);});var _0xecd835=parseTagParameter(_0x409380);_0x45cd86[_0x5958('0x3c')][_0x5958('0x3d')][_0x5958('0x3e')](_0xecd835);_0x45cd86[_0x5958('0x3c')]['ids']=_0x409380;}else if(_0x2a020e[_0x5958('0x1e')]===_0x5958('0x3f')){_0x45cd86[_0x5958('0x40')][_0x5958('0x3d')]['and']('uc.UserId\x20=\x20?',_0x2a020e[_0x5958('0x38')]);_0x45cd86[_0x5958('0x40')]['skip']=!![];}}}return _0x45cd86;}function parseModelFields(_0x3f6959,_0xc0be68){var _0x3090c9=squel['expr']();var _0x40d75b=_(_0x3f6959)[_0x5958('0x41')]()[_0x5958('0x42')](function(_0x539e14){return _[_0x5958('0x43')](_0xc0be68,[_0x5958('0x30'),_0x539e14])?_0x539e14:undefined;})[_0x5958('0x44')]()[_0x5958('0x38')]();if(_0x3f6959[_0x5958('0x45')]){_0x40d75b[_0x5958('0x46')](_0x5958('0x45'));}if(_0x40d75b['length']>0x0){_0x40d75b[_0x5958('0x1c')](function(_0x328dc1){if(_0x328dc1==='ListId'){_0x3090c9[_0x5958('0x3e')]('c.ListId\x20IN\x20?',[][_0x5958('0x47')](_0x3f6959[_0x328dc1]));}else if(_0x328dc1==='Contact'){var _0x17cef3='%'+_0x3f6959[_0x328dc1]+'%';_0x3090c9[_0x5958('0x3e')](_0x5958('0x48'),_0x17cef3);}else{_0x3090c9[_0x5958('0x3e')]('c.'+_0x328dc1+'\x20=\x20?',_0x3f6959[_0x328dc1]);}});}return _0x3090c9;}function parseQueryParameters(_0x281df4,_0x3fbba5){var _0x57f528=getSqlClauses();return Promise[_0x5958('0x49')]()['then'](function(){return parseModelFields(_0x281df4,_0x3fbba5);})[_0x5958('0x4a')](function(_0x37a329){_0x57f528[_0x5958('0x4b')][_0x5958('0x3e')](_0x37a329);return parseTagParameter(_0x281df4[_0x5958('0x4c')]);})[_0x5958('0x4a')](function(_0x4ea83a){_0x57f528[_0x5958('0x3c')][_0x5958('0x3d')][_0x5958('0x3e')](_0x4ea83a);return parseSearchFilter(_0x281df4[_0x5958('0x4d')]);})['then'](function(_0x8495fb){_0x57f528['filter']=_0x8495fb;return _0x57f528;});}function checkListsRestrictions(_0x1920f0,_0x46068e,_0x5b3ef9){var _0x1942fd=squel[_0x5958('0x1f')]();return Promise[_0x5958('0x49')]()[_0x5958('0x4a')](function(){if(_0x46068e[_0x5958('0x4e')]&&_0x1920f0[_0x5958('0x4')]===_0x5958('0x5')&&!_0x5b3ef9){return _0x1920f0['getLists']({'attributes':['id'],'raw':!![]});}})[_0x5958('0x4a')](function(_0x318f9d){if(_0x318f9d){if(_0x318f9d[_0x5958('0x22')]===0x0){_0x1942fd['and'](_0x5958('0x4f'));}else{_0x1942fd[_0x5958('0x3e')](_0x5958('0x50'),_[_0x5958('0x42')](_0x318f9d,'id'));}}})['then'](function(){return _0x1942fd;});}function buildContactsQuery(_0x12e53e,_0x1de744,_0x2473b5,_0x4a07e3,_0x13caed,_0x5a3e40){if(_0x1de744){_0x1de744=_0x2473b5[_0x5958('0x51')];}_0x12e53e=addFieldsToQuery(_0x12e53e,_0x1de744,_0x4a07e3,_0x5a3e40,!![]);var _0x5d1e39=squel[_0x5958('0x8')]();_0x5d1e39=addFieldsToQuery(_0x5d1e39,_0x1de744,_0x4a07e3,_0x5a3e40,![]);if(_0x4a07e3||_0x5a3e40){_0x12e53e=applyJoinClauses(_0x12e53e,!![]);_0x12e53e[_0x5958('0x52')](_0x5958('0x53'));if(_0x2473b5[_0x5958('0x54')]){_0x5d1e39[_0x5958('0x54')](_0x2473b5[_0x5958('0x54')]);}if(_0x2473b5[_0x5958('0x55')]){_0x5d1e39['offset'](_0x2473b5[_0x5958('0x55')]);}}else{_0x5d1e39=applyJoinClauses(_0x5d1e39,![]);_0x5d1e39[_0x5958('0x52')](_0x5958('0x56'));if(_0x2473b5[_0x5958('0x54')]){_0x12e53e[_0x5958('0x54')](_0x2473b5[_0x5958('0x54')]);}if(_0x2473b5[_0x5958('0x55')]){_0x12e53e[_0x5958('0x55')](_0x2473b5['offset']);}}_0x5d1e39[_0x5958('0x57')](_0x13caed);if(_0x2473b5[_0x5958('0x58')]){_0x2473b5[_0x5958('0x58')]['forEach'](function(_0x436a68){_0x12e53e[_0x5958('0x58')]('c.'+_0x436a68[0x0],_0x436a68[0x1]===_0x5958('0x59')?![]:!![]);_0x5d1e39['order']('subqry.'+_0x436a68[0x0],_0x436a68[0x1]===_0x5958('0x59')?![]:!![]);});}_0x5d1e39[_0x5958('0x9')](_0x12e53e,'subqry');return _0x5d1e39;}function getFilteredContacts(_0x414daa){var _0xace82e=[];return db[_0x5958('0x3a')][_0x5958('0x5a')]({'attributes':['id',_0x5958('0x30'),_0x5958('0x5b')],'raw':!![]})[_0x5958('0x4a')](function(_0x4e4ab5){_0xace82e=_[_0x5958('0x5c')](_0x4e4ab5,'id');var _0x3c0ed4={'type':db['Sequelize'][_0x5958('0x5d')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5958('0x5e')]['query'](_0x414daa[_0x5958('0x5f')](),_0x3c0ed4);})['then'](function(_0x427a9b){_0x427a9b[_0x5958('0x1c')](function(_0x149b1b){if(_0x149b1b[_0x5958('0x1b')]){_0x149b1b[_0x5958('0x60')]=[];_0x149b1b['TagIds'][_0x5958('0x3b')](',')[_0x5958('0x1c')](function(_0x57185b){_0x149b1b[_0x5958('0x60')][_0x5958('0x46')](_0xace82e[_0x57185b]);});}delete _0x149b1b[_0x5958('0x1b')];});return _0x427a9b;});}function countFilteredContacts(_0x571b3e,_0x361507){var _0x8b81e6=_0x571b3e['clone']();_0x8b81e6[_0x5958('0x1e')](_0x5958('0x61'));_0x8b81e6=applyJoinClauses(_0x8b81e6,!![]);_0x571b3e['group'](_0x5958('0x53'));var _0x58afce=utils[_0x5958('0x20')](_0x361507);if(!_[_0x5958('0x62')](_0x58afce)){_0x8b81e6['where']('t.id\x20IN\x20?',_0x58afce);}var _0x379f47={'type':db['Sequelize'][_0x5958('0x5d')]['SELECT'],'raw':!![]};return db[_0x5958('0x5e')][_0x5958('0x63')](_0x8b81e6['toString'](),_0x379f47)[_0x5958('0x4a')](function(_0x411c1f){return _0x411c1f[0x0]['COUNT(*)'];});}module[_0x5958('0x64')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xac72=['TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','datetime','castTo','DATE','buildExpression','type','default','text','start','value','end','Tag','map','and','tags','User','user','uc.UserId\x20=\x20?','skip','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','clause','filter','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','isEmpty','lodash','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','email','CompanyId','createdAt','deletedAt'];(function(_0x1982c8,_0x5cc2e2){var _0x5de728=function(_0x5e8d52){while(--_0x5e8d52){_0x1982c8['push'](_0x1982c8['shift']());}};_0x5de728(++_0x5cc2e2);}(_0xac72,0x1eb));var _0x2ac7=function(_0x29a584,_0x4dccf8){_0x29a584=_0x29a584-0x0;var _0x3d1d26=_0xac72[_0x29a584];return _0x3d1d26;};'use strict';var _=require(_0x2ac7('0x0'));var squel=require(_0x2ac7('0x1'));var as=require(_0x2ac7('0x2'));var qs=require('../parsers/qs');var utils=require(_0x2ac7('0x3'));var db=require(_0x2ac7('0x4'))['db'];function skipContactsQuery(_0x6eda17,_0x260649){var _0x238ae5=![];if(_0x6eda17[_0x2ac7('0x5')]===_0x2ac7('0x6')&&!_0x260649[_0x2ac7('0x7')]&&!_0x260649[_0x2ac7('0x8')]&&_0x260649[_0x2ac7('0x9')]!==_0x2ac7('0xa')){_0x238ae5=!![];}return _0x238ae5;}function getContactsSubquery(){return squel[_0x2ac7('0xb')]()[_0x2ac7('0xc')]('cm_contacts','c')[_0x2ac7('0xd')](_0x2ac7('0xe'));}function applyJoinClauses(_0x4a142a,_0x2679e5){var _0x1b8d5c=_0x2679e5?'c':_0x2ac7('0xf');_0x4a142a[_0x2ac7('0x10')](_0x2ac7('0x11'),'uc',_0x2ac7('0x12')+_0x1b8d5c+_0x2ac7('0x13'))['left_join'](_0x2ac7('0x14'),'ct','ct.CmContactId\x20=\x20'+_0x1b8d5c+_0x2ac7('0x13'))['left_join'](_0x2ac7('0x15'),'t',_0x2ac7('0x16'));return _0x4a142a;}function addFieldsToQuery(_0x4ddc6c,_0x49f10b,_0x1428fb,_0x354b78,_0x49fd6d){var _0x98d965=_0x49fd6d?'c':_0x2ac7('0xf');if(!_0x49f10b){_0x49f10b=['id','firstName',_0x2ac7('0x17'),_0x2ac7('0x18'),'mobile','fax',_0x2ac7('0x19'),_0x2ac7('0x8'),_0x2ac7('0x1a'),_0x2ac7('0x1b'),'updatedAt',_0x2ac7('0x1c'),_0x2ac7('0x1d')];}var _0x206d33=_0x1428fb&&_0x49fd6d||!_0x1428fb&&!_0x49fd6d;if(_0x354b78){_0x206d33=_0x354b78&&_0x49fd6d||!_0x354b78&&!_0x49fd6d;}_0x49f10b[_0x2ac7('0x1e')](function(_0x30378f){if(_0x30378f===_0x2ac7('0x1d')){if(_0x206d33){_0x4ddc6c[_0x2ac7('0x1f')](_0x2ac7('0x20'),_0x30378f);}else if(_0x1428fb||_0x354b78){_0x4ddc6c[_0x2ac7('0x1f')](_0x98d965+'.'+_0x30378f);}}else{_0x4ddc6c[_0x2ac7('0x1f')](_0x98d965+'.'+_0x30378f);}});return _0x4ddc6c;}function getSqlClauses(){var _0xe7e716={'default':squel[_0x2ac7('0x21')](),'fields':squel[_0x2ac7('0x21')](),'filter':squel[_0x2ac7('0x21')](),'tags':{'clause':squel[_0x2ac7('0x21')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0xe7e716;}function parseTagParameter(_0x4d4db2){var _0x4d9873=squel[_0x2ac7('0x21')]();if(_0x4d4db2){var _0x5556cd=utils[_0x2ac7('0x22')](_0x4d4db2);_0x5556cd[_0x2ac7('0x1e')](function(_0x3b1e18){_0x4d9873['or'](_0x2ac7('0x23'),'%,'+_0x3b1e18+',%');});}return _0x4d9873;}function parseSearchFilter(_0x4d6d65){var _0x12813b=squel[_0x2ac7('0x21')]();if(_0x4d6d65){var _0x325818=_0x4d6d65['replace']('\x5c','\x5c\x5c')[_0x2ac7('0x24')](/'/g,'\x27\x27');if(_0x325818[_0x2ac7('0x25')]('\x20')[_0x2ac7('0x26')]>0x1){_0x12813b['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x325818),null);}else{if(qs[_0x2ac7('0x27')](_0x325818)){_0x12813b['or']('c.id\x20LIKE\x20?',_0x325818+'%');_0x12813b['or'](_0x2ac7('0x28'),_0x325818+'%');_0x12813b['or'](_0x2ac7('0x29'),_0x325818+'%');_0x12813b['or'](_0x2ac7('0x2a'),_0x325818+'%');}else if(qs[_0x2ac7('0x2b')](_0x325818)){_0x12813b['or'](_0x2ac7('0x2c'),_0x325818+'%');}else{_0x12813b['or'](_0x2ac7('0x2d'),'%'+_0x325818+'%');_0x12813b['or'](_0x2ac7('0x2e'),'%'+_0x325818+'%');_0x12813b['or']('c.email\x20LIKE\x20?','%'+_0x325818+'%');}}}return _0x12813b;}function parseAdvancedSearchFilter(_0x20c2f5,_0x590dfb){var _0x2f4326=getSqlClauses();var _0x39179d=as['parseSearch'](_0x20c2f5);var _0x3fac0e=_0x39179d[_0x2ac7('0x2f')];for(var _0x458ea4=0x0;_0x458ea4<_0x39179d[_0x2ac7('0x30')][_0x2ac7('0x26')];_0x458ea4++){var _0xadef48=_0x39179d[_0x2ac7('0x30')][_0x458ea4];var _0x2f5fa5='c';var _0x4b00ae=_[_0x2ac7('0x31')](_0x590dfb,[_0x2ac7('0x32'),_0xadef48[_0x2ac7('0x1f')]]);if(_0x4b00ae){if(_0xadef48['field']===_0x2ac7('0x33')||_0x4b00ae['fieldType']===_0x2ac7('0x34')){_0xadef48[_0x2ac7('0x35')]=_0x2ac7('0x36');}var _0x3e82e6=as[_0x2ac7('0x37')](_0x2f5fa5,_0x4b00ae[_0x2ac7('0x38')],_0xadef48);_0x2f4326[_0x2ac7('0x39')][_0x3fac0e](_0x3e82e6[_0x2ac7('0x3a')],_0x3e82e6['value'][_0x2ac7('0x3b')],_0x3e82e6[_0x2ac7('0x3c')][_0x2ac7('0x3d')]);}else{if(_0xadef48[_0x2ac7('0x1f')]===_0x2ac7('0x3e')){var _0x3d35a5=_0xadef48['value']['split'](',')[_0x2ac7('0x3f')](function(_0x2eeac7){return Number(_0x2eeac7);});var _0x86cfbc=parseTagParameter(_0x3d35a5);_0x2f4326['tags']['clause'][_0x2ac7('0x40')](_0x86cfbc);_0x2f4326[_0x2ac7('0x41')]['ids']=_0x3d35a5;}else if(_0xadef48[_0x2ac7('0x1f')]===_0x2ac7('0x42')){_0x2f4326[_0x2ac7('0x43')]['clause']['and'](_0x2ac7('0x44'),_0xadef48[_0x2ac7('0x3c')]);_0x2f4326[_0x2ac7('0x43')][_0x2ac7('0x45')]=!![];}}}return _0x2f4326;}function parseModelFields(_0x5d4492,_0x4333d6){var _0x39b7d4=squel[_0x2ac7('0x21')]();var _0x3c3d62=_(_0x5d4492)['keys']()['map'](function(_0x45cea8){return _['some'](_0x4333d6,[_0x2ac7('0x32'),_0x45cea8])?_0x45cea8:undefined;})[_0x2ac7('0x46')]()[_0x2ac7('0x3c')]();if(_0x5d4492[_0x2ac7('0x47')]){_0x3c3d62[_0x2ac7('0x48')]('Contact');}if(_0x3c3d62[_0x2ac7('0x26')]>0x0){_0x3c3d62[_0x2ac7('0x1e')](function(_0x2c97f5){if(_0x2c97f5===_0x2ac7('0x8')){_0x39b7d4[_0x2ac7('0x40')](_0x2ac7('0x49'),[][_0x2ac7('0x4a')](_0x5d4492[_0x2c97f5]));}else if(_0x2c97f5===_0x2ac7('0x47')){var _0x138666='%'+_0x5d4492[_0x2c97f5]+'%';_0x39b7d4['and'](_0x2ac7('0x4b'),_0x138666);}else{_0x39b7d4[_0x2ac7('0x40')]('c.'+_0x2c97f5+_0x2ac7('0x4c'),_0x5d4492[_0x2c97f5]);}});}return _0x39b7d4;}function parseQueryParameters(_0x12cffd,_0x285c99){var _0x2c613e=getSqlClauses();return Promise['resolve']()[_0x2ac7('0x4d')](function(){return parseModelFields(_0x12cffd,_0x285c99);})[_0x2ac7('0x4d')](function(_0x449f4c){_0x2c613e[_0x2ac7('0x4e')][_0x2ac7('0x40')](_0x449f4c);return parseTagParameter(_0x12cffd[_0x2ac7('0x4f')]);})[_0x2ac7('0x4d')](function(_0x2821fa){_0x2c613e['tags'][_0x2ac7('0x50')][_0x2ac7('0x40')](_0x2821fa);return parseSearchFilter(_0x12cffd[_0x2ac7('0x51')]);})[_0x2ac7('0x4d')](function(_0x2c72fa){_0x2c613e['filter']=_0x2c72fa;return _0x2c613e;});}function checkListsRestrictions(_0x27eb0e,_0x59fd00,_0x4bcc85){var _0x1bd5ec=squel[_0x2ac7('0x21')]();return Promise['resolve']()[_0x2ac7('0x4d')](function(){if(_0x59fd00[_0x2ac7('0x7')]&&_0x27eb0e[_0x2ac7('0x5')]===_0x2ac7('0x6')&&!_0x4bcc85){return _0x27eb0e['getLists']({'attributes':['id'],'raw':!![]});}})[_0x2ac7('0x4d')](function(_0x5d348f){if(_0x5d348f){if(_0x5d348f['length']===0x0){_0x1bd5ec[_0x2ac7('0x40')](_0x2ac7('0x52'));}else{_0x1bd5ec[_0x2ac7('0x40')](_0x2ac7('0x49'),_[_0x2ac7('0x3f')](_0x5d348f,'id'));}}})[_0x2ac7('0x4d')](function(){return _0x1bd5ec;});}function buildContactsQuery(_0x4f256b,_0x931910,_0x529e37,_0x160b5f,_0x49bef0,_0x4b81ec){if(_0x931910){_0x931910=_0x529e37[_0x2ac7('0x53')];}_0x4f256b=addFieldsToQuery(_0x4f256b,_0x931910,_0x160b5f,_0x4b81ec,!![]);var _0x27cc8e=squel[_0x2ac7('0xb')]();_0x27cc8e=addFieldsToQuery(_0x27cc8e,_0x931910,_0x160b5f,_0x4b81ec,![]);if(_0x160b5f||_0x4b81ec){_0x4f256b=applyJoinClauses(_0x4f256b,!![]);_0x4f256b[_0x2ac7('0x54')](_0x2ac7('0x55'));if(_0x529e37['limit']){_0x27cc8e[_0x2ac7('0x56')](_0x529e37[_0x2ac7('0x56')]);}if(_0x529e37[_0x2ac7('0x57')]){_0x27cc8e[_0x2ac7('0x57')](_0x529e37[_0x2ac7('0x57')]);}}else{_0x27cc8e=applyJoinClauses(_0x27cc8e,![]);_0x27cc8e['group'](_0x2ac7('0x58'));if(_0x529e37[_0x2ac7('0x56')]){_0x4f256b['limit'](_0x529e37['limit']);}if(_0x529e37['offset']){_0x4f256b['offset'](_0x529e37['offset']);}}_0x27cc8e[_0x2ac7('0x59')](_0x49bef0);if(_0x529e37[_0x2ac7('0x5a')]){_0x529e37[_0x2ac7('0x5a')][_0x2ac7('0x1e')](function(_0x31a380){_0x4f256b[_0x2ac7('0x5a')]('c.'+_0x31a380[0x0],_0x31a380[0x1]===_0x2ac7('0x5b')?![]:!![]);_0x27cc8e[_0x2ac7('0x5a')]('subqry.'+_0x31a380[0x0],_0x31a380[0x1]===_0x2ac7('0x5b')?![]:!![]);});}_0x27cc8e[_0x2ac7('0xc')](_0x4f256b,'subqry');return _0x27cc8e;}function getFilteredContacts(_0x419ac4){var _0x409794=[];return db[_0x2ac7('0x3e')][_0x2ac7('0x5c')]({'attributes':['id',_0x2ac7('0x32'),_0x2ac7('0x5d')],'raw':!![]})['then'](function(_0x4ec5f6){_0x409794=_[_0x2ac7('0x5e')](_0x4ec5f6,'id');var _0x567eee={'type':db[_0x2ac7('0x5f')][_0x2ac7('0x60')][_0x2ac7('0x61')],'model':db[_0x2ac7('0x62')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x2ac7('0x63')][_0x2ac7('0x64')](_0x419ac4[_0x2ac7('0x65')](),_0x567eee);})[_0x2ac7('0x4d')](function(_0x544625){_0x544625[_0x2ac7('0x1e')](function(_0x3e5984){if(_0x3e5984[_0x2ac7('0x1d')]){_0x3e5984[_0x2ac7('0x66')]=[];_0x3e5984[_0x2ac7('0x1d')][_0x2ac7('0x25')](',')['forEach'](function(_0x2298ab){_0x3e5984['Tags'][_0x2ac7('0x48')](_0x409794[_0x2298ab]);});}delete _0x3e5984[_0x2ac7('0x1d')];});return _0x544625;});}function countFilteredContacts(_0x21b62c,_0x1c747b){var _0x1481c3=_0x21b62c['clone']();_0x1481c3[_0x2ac7('0x1f')]('COUNT(*)');_0x1481c3=applyJoinClauses(_0x1481c3,!![]);_0x21b62c[_0x2ac7('0x54')](_0x2ac7('0x55'));var _0x4df948=utils['getSelectedTags'](_0x1c747b);if(!_[_0x2ac7('0x67')](_0x4df948)){_0x1481c3[_0x2ac7('0xd')]('t.id\x20IN\x20?',_0x4df948);}var _0x4a6fe1={'type':db[_0x2ac7('0x5f')]['QueryTypes'][_0x2ac7('0x61')],'raw':!![]};return db[_0x2ac7('0x63')][_0x2ac7('0x64')](_0x1481c3['toString'](),_0x4a6fe1)[_0x2ac7('0x4d')](function(_0x5962d3){return _0x5962d3[0x0]['COUNT(*)'];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index deb7e73..5255f3b 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 _0x570f=['createWriteStream','createCipher','data','update','write','end','final','binary','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','app','session','aes192','encrypt','algorithm','join','error','filter','hasOwnProperty','encryptFile','createReadStream'];(function(_0x28d391,_0x1357b3){var _0x3c8bf0=function(_0x55bac9){while(--_0x55bac9){_0x28d391['push'](_0x28d391['shift']());}};_0x3c8bf0(++_0x1357b3);}(_0x570f,0x1a3));var _0xf570=function(_0x3b9bb7,_0x4e24df){_0x3b9bb7=_0x3b9bb7-0x0;var _0x4c0b9e=_0x570f[_0x3b9bb7];return _0x4c0b9e;};'use strict';var crypto=require(_0xf570('0x0'));var fs=require('fs');var BPromise=require(_0xf570('0x1'));var _=require(_0xf570('0x2'));var config=require(_0xf570('0x3'));var logger=require('../../config/logger')(_0xf570('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xf570('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xf570('0x6')};if(config[_0xf570('0x7')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xf570('0x8')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf570('0x9')](',\x20');logger[_0xf570('0xa')](config[_0xf570('0x7')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x41a316){return AES_SUPPORTED_RX['test'](_0x41a316);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xf570('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x1c6de9){return getSupportedCiphers()['indexOf'](_0x1c6de9)>-0x1;}function combineOptions(_0x3bb60a){var _0x5791a7={};for(var _0x436fc6 in fileOptions){if(fileOptions[_0xf570('0xc')](_0x436fc6)){_0x5791a7[_0x436fc6]=fileOptions[_0x436fc6];}}if(_0x3bb60a){for(var _0xcb58c5 in _0x3bb60a){if(_0x3bb60a[_0xf570('0xc')](_0xcb58c5)){_0x5791a7[_0xcb58c5]=_0x3bb60a[_0xcb58c5];}}}return _0x5791a7;}exports[_0xf570('0xd')]=function(_0x17b92c,_0x50ec96,_0x457a59,_0x2a6f7a){return new BPromise(function(_0x4ebf22,_0x2ddedd){_0x2a6f7a=combineOptions(_0x2a6f7a);var _0x477141=new Buffer(_0x457a59);var _0x7ff2e4=fs[_0xf570('0xe')](_0x17b92c);var _0x5f1032=fs[_0xf570('0xf')](_0x50ec96);var _0x11574b=crypto[_0xf570('0x10')](_0x2a6f7a[_0xf570('0x8')],_0x477141);_0x7ff2e4['on'](_0xf570('0x11'),function(_0x4f0626){var _0x13c0d7=new Buffer(_0x11574b[_0xf570('0x12')](_0x4f0626),'binary');_0x5f1032[_0xf570('0x13')](_0x13c0d7);});_0x7ff2e4['on'](_0xf570('0x14'),function(){try{var _0x92f8ee=new Buffer(_0x11574b[_0xf570('0x15')]('binary'),_0xf570('0x16'));_0x5f1032[_0xf570('0x13')](_0x92f8ee);_0x5f1032[_0xf570('0x14')]();_0x5f1032['on']('close',function(){return _0x4ebf22(_0x50ec96);});}catch(_0x4ceab9){fs[_0xf570('0x17')](_0x50ec96);return _0x2ddedd(_0x4ceab9);}});});};exports[_0xf570('0x18')]=function(_0x48347c,_0x7ada52,_0x5c6fe0,_0x4dd9d4){return new BPromise(function(_0x90882c,_0x403dd6){_0x4dd9d4=combineOptions(_0x4dd9d4);var _0x25deb9=new Buffer(_0x5c6fe0);var _0x58f027=fs[_0xf570('0xe')](_0x48347c);var _0x20fdcd=fs[_0xf570('0xf')](_0x7ada52);var _0x4421a4=crypto[_0xf570('0x19')](_0x4dd9d4[_0xf570('0x8')],_0x25deb9);_0x58f027['on']('data',function(_0x1cf66a){var _0x37d9cf=new Buffer(_0x4421a4[_0xf570('0x12')](_0x1cf66a),'binary');_0x20fdcd['write'](_0x37d9cf);});_0x58f027['on']('end',function(){try{var _0x4d6193=new Buffer(_0x4421a4[_0xf570('0x15')](_0xf570('0x16')),_0xf570('0x16'));_0x20fdcd['write'](_0x4d6193);_0x20fdcd[_0xf570('0x14')]();_0x20fdcd['on']('close',function(){return _0x90882c(_0x7ada52);});}catch(_0x1b2761){fs[_0xf570('0x17')](_0x7ada52);return _0x403dd6(_0x1b2761);}});});};exports[_0xf570('0x1a')]=function(_0x104b56,_0x5c4c98,_0x3e7440){var _0x226fa8=_0x3e7440||stringOptions[_0xf570('0x8')];var _0x4c74ee=_0x5c4c98||stringOptions[_0xf570('0x1b')];var _0x3b5824=crypto[_0xf570('0x10')](_0x226fa8,_0x4c74ee);var _0x31c818=_0x3b5824[_0xf570('0x12')](_0x104b56,_0xf570('0x1c'),_0xf570('0x1d'));_0x31c818+=_0x3b5824[_0xf570('0x15')]('base64');return _0x31c818;};exports[_0xf570('0x1e')]=function(_0x5e58a4,_0x37b572,_0x40db55){var _0x373432=_0x40db55||stringOptions[_0xf570('0x8')];var _0x1bf1ba=_0x37b572||stringOptions[_0xf570('0x1b')];var _0x3a1a7c=crypto[_0xf570('0x19')](_0x373432,_0x1bf1ba);var _0x43d2e5=_0x3a1a7c['update'](_0x5e58a4,_0xf570('0x1d'),_0xf570('0x1c'));_0x43d2e5+=_0x3a1a7c[_0xf570('0x15')](_0xf570('0x1c'));return _0x43d2e5;}; \ No newline at end of file +var _0xeea5=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','final','close','createDecipher','encryptString','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xeea5,0x86));var _0x5eea=function(_0x2ed32e,_0x36d1cf){_0x2ed32e=_0x2ed32e-0x0;var _0x31022a=_0xeea5[_0x2ed32e];return _0x31022a;};'use strict';var crypto=require(_0x5eea('0x0'));var fs=require('fs');var BPromise=require(_0x5eea('0x1'));var _=require(_0x5eea('0x2'));var config=require(_0x5eea('0x3'));var logger=require(_0x5eea('0x4'))(_0x5eea('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5eea('0x6')][_0x5eea('0x7')],'algorithm':_0x5eea('0x8')};const fileOptions={'algorithm':_0x5eea('0x9')};if(config[_0x5eea('0xa')]&&config[_0x5eea('0xa')][_0x5eea('0xb')]){var isSupported=isAlgorithmSupported(config[_0x5eea('0xa')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x5eea('0xa')][_0x5eea('0xb')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5eea('0xc')](',\x20');logger[_0x5eea('0xd')](config[_0x5eea('0xa')][_0x5eea('0xb')],_0x5eea('0xe'),supportedAlgorithms);}}function isASupportedCipher(_0x3d45e3){return AES_SUPPORTED_RX[_0x5eea('0xf')](_0x3d45e3);}function getSupportedCiphers(){return crypto[_0x5eea('0x10')]()[_0x5eea('0x11')](isASupportedCipher);}function isAlgorithmSupported(_0xd4d75c){return getSupportedCiphers()[_0x5eea('0x12')](_0xd4d75c)>-0x1;}function combineOptions(_0x2cee03){var _0x3602fb={};for(var _0x4e1cbf in fileOptions){if(fileOptions[_0x5eea('0x13')](_0x4e1cbf)){_0x3602fb[_0x4e1cbf]=fileOptions[_0x4e1cbf];}}if(_0x2cee03){for(var _0x4be5c4 in _0x2cee03){if(_0x2cee03['hasOwnProperty'](_0x4be5c4)){_0x3602fb[_0x4be5c4]=_0x2cee03[_0x4be5c4];}}}return _0x3602fb;}exports[_0x5eea('0x14')]=function(_0x51c25e,_0x19c7d5,_0x54d29b,_0xa24146){return new BPromise(function(_0x1d733e,_0x346c5c){_0xa24146=combineOptions(_0xa24146);var _0x36587a=new Buffer(_0x54d29b);var _0x554cd0=fs[_0x5eea('0x15')](_0x51c25e);var _0x1ba751=fs[_0x5eea('0x16')](_0x19c7d5);var _0x51b85a=crypto['createCipher'](_0xa24146[_0x5eea('0xb')],_0x36587a);_0x554cd0['on'](_0x5eea('0x17'),function(_0x5260fa){var _0x13c6c3=new Buffer(_0x51b85a[_0x5eea('0x18')](_0x5260fa),_0x5eea('0x19'));_0x1ba751[_0x5eea('0x1a')](_0x13c6c3);});_0x554cd0['on'](_0x5eea('0x1b'),function(){try{var _0x4d1823=new Buffer(_0x51b85a[_0x5eea('0x1c')](_0x5eea('0x19')),_0x5eea('0x19'));_0x1ba751[_0x5eea('0x1a')](_0x4d1823);_0x1ba751[_0x5eea('0x1b')]();_0x1ba751['on'](_0x5eea('0x1d'),function(){return _0x1d733e(_0x19c7d5);});}catch(_0x4fdaa6){fs['unlink'](_0x19c7d5);return _0x346c5c(_0x4fdaa6);}});});};exports['decryptFile']=function(_0x864e23,_0x4dd0f1,_0x359143,_0x2fd8a4){return new BPromise(function(_0x40e614,_0x401063){_0x2fd8a4=combineOptions(_0x2fd8a4);var _0x1059c8=new Buffer(_0x359143);var _0x7aab40=fs[_0x5eea('0x15')](_0x864e23);var _0x37b62d=fs[_0x5eea('0x16')](_0x4dd0f1);var _0x62aad6=crypto[_0x5eea('0x1e')](_0x2fd8a4['algorithm'],_0x1059c8);_0x7aab40['on'](_0x5eea('0x17'),function(_0x3117af){var _0x4c901e=new Buffer(_0x62aad6['update'](_0x3117af),_0x5eea('0x19'));_0x37b62d[_0x5eea('0x1a')](_0x4c901e);});_0x7aab40['on'](_0x5eea('0x1b'),function(){try{var _0xc55ccf=new Buffer(_0x62aad6[_0x5eea('0x1c')](_0x5eea('0x19')),_0x5eea('0x19'));_0x37b62d[_0x5eea('0x1a')](_0xc55ccf);_0x37b62d[_0x5eea('0x1b')]();_0x37b62d['on']('close',function(){return _0x40e614(_0x4dd0f1);});}catch(_0x522938){fs['unlink'](_0x4dd0f1);return _0x401063(_0x522938);}});});};exports[_0x5eea('0x1f')]=function(_0x2a75e2,_0x434730,_0x563d5a){var _0x3f22b1=_0x563d5a||stringOptions[_0x5eea('0xb')];var _0x23a899=_0x434730||stringOptions[_0x5eea('0x20')];var _0x24d1ac=crypto[_0x5eea('0x21')](_0x3f22b1,_0x23a899);var _0x21abab=_0x24d1ac[_0x5eea('0x18')](_0x2a75e2,_0x5eea('0x22'),_0x5eea('0x23'));_0x21abab+=_0x24d1ac[_0x5eea('0x1c')](_0x5eea('0x23'));return _0x21abab;};exports[_0x5eea('0x24')]=function(_0x4daa47,_0x2cbd49,_0x5cc7c8){var _0x2d7d67=_0x5cc7c8||stringOptions[_0x5eea('0xb')];var _0x25c49b=_0x2cbd49||stringOptions[_0x5eea('0x20')];var _0x28e62d=crypto[_0x5eea('0x1e')](_0x2d7d67,_0x25c49b);var _0x380cbb=_0x28e62d[_0x5eea('0x18')](_0x4daa47,'base64',_0x5eea('0x22'));_0x380cbb+=_0x28e62d[_0x5eea('0x1c')](_0x5eea('0x22'));return _0x380cbb;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 268a027..9620602 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 _0xdccb=['%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','range','isInteger','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','mkdirSync','join','each','csv'];(function(_0x356284,_0x1d17a5){var _0x2ddeca=function(_0x9d003){while(--_0x9d003){_0x356284['push'](_0x356284['shift']());}};_0x2ddeca(++_0x1d17a5);}(_0xdccb,0x14c));var _0xbdcc=function(_0x5e3af6,_0x3c97dd){_0x5e3af6=_0x5e3af6-0x0;var _0x215aa8=_0xdccb[_0x5e3af6];return _0x215aa8;};'use strict';var util=require(_0xbdcc('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0xbdcc('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xbdcc('0x2'));var rimraf=require(_0xbdcc('0x3'));var db=require(_0xbdcc('0x4'))['db'];var dbH=require(_0xbdcc('0x4'))[_0xbdcc('0x5')];var logger=require(_0xbdcc('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbdcc('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xbdcc('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x55d00f,_0x181852){var _0x429b52={'status':_0x55d00f};var _0x2ac585={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x181852){_0x429b52['savename']=_0x181852;}return db['AnalyticExtractedReport'][_0xbdcc('0x8')](_0x429b52,_0x2ac585);}function main(){var _0x5b08e4=0x1388;var _0x25e1b3;logger[_0xbdcc('0x9')](util[_0xbdcc('0xa')](_0xbdcc('0xb'),EXTRACTED_REPORT_ID,_0xbdcc('0xc')));return db[_0xbdcc('0xd')][_0xbdcc('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbdcc('0xf'),_0xbdcc('0x10')]})[_0xbdcc('0x11')](function(_0x9b453){if(_0x9b453){_0x25e1b3=_0x9b453;_0x5b08e4=_0x25e1b3['splitSizeCsv']||0x1388;}})[_0xbdcc('0x11')](function(){return dbH[_0xbdcc('0x12')][_0xbdcc('0x13')](util[_0xbdcc('0xa')](_0xbdcc('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xbdcc('0x15')]});})[_0xbdcc('0x11')](function(_0x234a64){if(!_0x234a64[0x0]['num']){return analyticExtractedReport(_0xbdcc('0x16'));}var _0x597b6f=[];var _0x45273e=0x0;if(_0x25e1b3[_0xbdcc('0xf')]){if(_0x234a64&&_0x234a64[_0xbdcc('0x17')]){var _0x46b704=_[_0xbdcc('0x18')](_0x234a64[0x0]['num']/_0x5b08e4);var _0x49b39b=Number[_0xbdcc('0x19')](_0x234a64[0x0][_0xbdcc('0x1a')]/_0x5b08e4)?_0x234a64[0x0][_0xbdcc('0x1a')]%_0x5b08e4:0x0;_0x46b704['forEach'](function(_0x4188b8){if(_0x4188b8>0x0){_0x45273e+=_0x5b08e4;}_0x597b6f[_0xbdcc('0x1b')](dbH[_0xbdcc('0x12')]['query'](util['format'](_0xbdcc('0x1c'),QUERY,_0x5b08e4,_0x45273e),{'type':dbH[_0xbdcc('0x12')]['QueryTypes'][_0xbdcc('0x15')]}));});if(_0x49b39b>0x0){_0x45273e+=_0x5b08e4;_0x597b6f['push'](dbH[_0xbdcc('0x12')][_0xbdcc('0x13')](util[_0xbdcc('0xa')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x49b39b,_0x45273e),{'type':dbH[_0xbdcc('0x12')][_0xbdcc('0x1d')][_0xbdcc('0x15')]}));}}}else{_0x597b6f[_0xbdcc('0x1b')](dbH[_0xbdcc('0x12')][_0xbdcc('0x13')](QUERY,{'type':dbH[_0xbdcc('0x12')][_0xbdcc('0x1d')]['SELECT']}));}var _0x100832=path[_0xbdcc('0x1e')](PATH);var _0x23e39e=path[_0xbdcc('0x1f')](PATH,'.csv');var _0x568492=_0x25e1b3['split']&&_0x597b6f[_0xbdcc('0x17')]>0x1;var _0xf1a72e=[];if(!fs['existsSync'](path['join'](_0x100832,_0x23e39e))&&_0x568492){fs[_0xbdcc('0x20')](path[_0xbdcc('0x21')](_0x100832,_0x23e39e));}return BPromise[_0xbdcc('0x22')](_0x597b6f,function(_0x1b956e){_0xf1a72e['push'](_0x1b956e);})[_0xbdcc('0x11')](function(){for(var _0x3cc25d=0x0;_0x3cc25d<_0xf1a72e[_0xbdcc('0x17')];_0x3cc25d+=0x1){var _0x34c1c9;var _0x19d824=_0xf1a72e[_0x3cc25d];if(_0x568492){_0x34c1c9=path['join'](_0x100832,_0x23e39e,util['format']('%s%d.%s',_0x23e39e,_0x3cc25d,_0xbdcc('0x23')));}else{_0x34c1c9=path[_0xbdcc('0x21')](_0x100832,util[_0xbdcc('0xa')](_0xbdcc('0x24'),_0x23e39e,_0xbdcc('0x23')));}fs['writeFileSync'](_0x34c1c9,csv(_0x19d824));}})[_0xbdcc('0x11')](function(){if(_0x568492){return new Promise(function(_0x3bc905){zipdir(path[_0xbdcc('0x21')](_0x100832,_0x23e39e),{'saveTo':path[_0xbdcc('0x21')](_0x100832,util[_0xbdcc('0xa')](_0xbdcc('0x24'),_0x23e39e,_0xbdcc('0x25')))},function(_0xc123aa,_0x1a30c1){rimraf(path['join'](_0x100832,_0x23e39e),function(){});_0x3bc905(_0xbdcc('0x26'));});});}})[_0xbdcc('0x11')](function(){logger[_0xbdcc('0x9')](util[_0xbdcc('0xa')](_0xbdcc('0x27'),EXTRACTED_REPORT_ID,_0xbdcc('0xc')));return analyticExtractedReport(_0xbdcc('0x28'),_0x568492?util[_0xbdcc('0xa')](_0xbdcc('0x24'),_0x23e39e,_0x568492?'zip':_0xbdcc('0x23')):null);});})['catch'](function(_0x251d30){logger[_0xbdcc('0x9')](util[_0xbdcc('0xa')](_0xbdcc('0x29'),EXTRACTED_REPORT_ID,_0xbdcc('0xc')),util[_0xbdcc('0x2a')](_0x251d30,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbdcc('0x2b'));})[_0xbdcc('0x2c')](function(){process[_0xbdcc('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x41ef=['basename','existsSync','mkdirSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','zip\x20finished','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Setting','find','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname'];(function(_0x1b5bc2,_0x453d84){var _0x1a5382=function(_0x4ffafb){while(--_0x4ffafb){_0x1b5bc2['push'](_0x1b5bc2['shift']());}};_0x1a5382(++_0x453d84);}(_0x41ef,0x1cb));var _0xf41e=function(_0xf98ec1,_0x4c73b8){_0xf98ec1=_0xf98ec1-0x0;var _0x514b6a=_0x41ef[_0xf98ec1];return _0x514b6a;};'use strict';var util=require(_0xf41e('0x0'));var path=require(_0xf41e('0x1'));var _=require(_0xf41e('0x2'));var csv=require(_0xf41e('0x3'));var fs=require('fs');var BPromise=require(_0xf41e('0x4'));var zipdir=require(_0xf41e('0x5'));var rimraf=require(_0xf41e('0x6'));var db=require(_0xf41e('0x7'))['db'];var dbH=require(_0xf41e('0x7'))[_0xf41e('0x8')];var logger=require(_0xf41e('0x9'))(_0xf41e('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf41e('0xb')][0x3];var PATH=process[_0xf41e('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2dfaa1,_0xf73ea5){var _0x188c0c={'status':_0x2dfaa1};var _0x1af199={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf73ea5){_0x188c0c[_0xf41e('0xc')]=_0xf73ea5;}return db[_0xf41e('0xd')][_0xf41e('0xe')](_0x188c0c,_0x1af199);}function main(){var _0x13d97d=0x1388;var _0x2217f4;logger[_0xf41e('0xf')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xf41e('0x10')][_0xf41e('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf41e('0x12')]})[_0xf41e('0x13')](function(_0x5aa132){if(_0x5aa132){_0x2217f4=_0x5aa132;_0x13d97d=_0x2217f4['splitSizeCsv']||0x1388;}})[_0xf41e('0x13')](function(){return dbH[_0xf41e('0x14')][_0xf41e('0x15')](util[_0xf41e('0x16')](_0xf41e('0x17'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xf41e('0x18')]});})[_0xf41e('0x13')](function(_0x3e7d34){if(!_0x3e7d34[0x0][_0xf41e('0x19')]){return analyticExtractedReport(_0xf41e('0x1a'));}var _0x254c78=[];var _0x43feb8=0x0;if(_0x2217f4[_0xf41e('0x1b')]){if(_0x3e7d34&&_0x3e7d34[_0xf41e('0x1c')]){var _0x3c2b3d=_[_0xf41e('0x1d')](_0x3e7d34[0x0][_0xf41e('0x19')]/_0x13d97d);var _0x20dbf1=Number[_0xf41e('0x1e')](_0x3e7d34[0x0][_0xf41e('0x19')]/_0x13d97d)?_0x3e7d34[0x0]['num']%_0x13d97d:0x0;_0x3c2b3d[_0xf41e('0x1f')](function(_0x95cd51){if(_0x95cd51>0x0){_0x43feb8+=_0x13d97d;}_0x254c78[_0xf41e('0x20')](dbH[_0xf41e('0x14')][_0xf41e('0x15')](util[_0xf41e('0x16')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x13d97d,_0x43feb8),{'type':dbH['sequelize']['QueryTypes'][_0xf41e('0x18')]}));});if(_0x20dbf1>0x0){_0x43feb8+=_0x13d97d;_0x254c78[_0xf41e('0x20')](dbH[_0xf41e('0x14')][_0xf41e('0x15')](util[_0xf41e('0x16')](_0xf41e('0x21'),QUERY,_0x20dbf1,_0x43feb8),{'type':dbH['sequelize'][_0xf41e('0x22')][_0xf41e('0x18')]}));}}}else{_0x254c78[_0xf41e('0x20')](dbH[_0xf41e('0x14')]['query'](QUERY,{'type':dbH[_0xf41e('0x14')][_0xf41e('0x22')][_0xf41e('0x18')]}));}var _0x495050=path[_0xf41e('0x23')](PATH);var _0x225a2c=path[_0xf41e('0x24')](PATH,'.csv');var _0x21a0ac=_0x2217f4[_0xf41e('0x1b')]&&_0x254c78[_0xf41e('0x1c')]>0x1;var _0x4fc9d4=[];if(!fs[_0xf41e('0x25')](path['join'](_0x495050,_0x225a2c))&&_0x21a0ac){fs[_0xf41e('0x26')](path[_0xf41e('0x27')](_0x495050,_0x225a2c));}return BPromise[_0xf41e('0x28')](_0x254c78,function(_0x208410){_0x4fc9d4[_0xf41e('0x20')](_0x208410);})[_0xf41e('0x13')](function(){for(var _0x5502d9=0x0;_0x5502d9<_0x4fc9d4[_0xf41e('0x1c')];_0x5502d9+=0x1){var _0x1699da;var _0xddc0d=_0x4fc9d4[_0x5502d9];if(_0x21a0ac){_0x1699da=path[_0xf41e('0x27')](_0x495050,_0x225a2c,util['format'](_0xf41e('0x29'),_0x225a2c,_0x5502d9,'csv'));}else{_0x1699da=path[_0xf41e('0x27')](_0x495050,util[_0xf41e('0x16')](_0xf41e('0x2a'),_0x225a2c,_0xf41e('0x2b')));}fs[_0xf41e('0x2c')](_0x1699da,csv(_0xddc0d));}})[_0xf41e('0x13')](function(){if(_0x21a0ac){return new Promise(function(_0x5bb0d1){zipdir(path[_0xf41e('0x27')](_0x495050,_0x225a2c),{'saveTo':path[_0xf41e('0x27')](_0x495050,util[_0xf41e('0x16')](_0xf41e('0x2a'),_0x225a2c,'zip'))},function(_0x450682,_0x169904){rimraf(path[_0xf41e('0x27')](_0x495050,_0x225a2c),function(){});_0x5bb0d1(_0xf41e('0x2d'));});});}})[_0xf41e('0x13')](function(){logger['info'](util[_0xf41e('0x16')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf41e('0x2e')));return analyticExtractedReport(_0xf41e('0x2f'),_0x21a0ac?util[_0xf41e('0x16')](_0xf41e('0x2a'),_0x225a2c,_0x21a0ac?_0xf41e('0x30'):_0xf41e('0x2b')):null);});})[_0xf41e('0x31')](function(_0x522e5b){logger[_0xf41e('0xf')](util['format'](_0xf41e('0x32'),EXTRACTED_REPORT_ID,_0xf41e('0x2e')),util[_0xf41e('0x33')](_0x522e5b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf41e('0x34'));})[_0xf41e('0x35')](function(){process[_0xf41e('0x36')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7f55c11..6667916 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 _0x9c0a=['find','then','range','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','split','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','finish','error','end','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','pick','toString','fill','body','push','concat','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','length','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','right','num','Empty','Setting'];(function(_0x7c6eef,_0x421dff){var _0x4a04a4=function(_0x5b2d31){while(--_0x5b2d31){_0x7c6eef['push'](_0x7c6eef['shift']());}};_0x4a04a4(++_0x421dff);}(_0x9c0a,0x19b));var _0xa9c0=function(_0x570f09,_0x5c06ff){_0x570f09=_0x570f09-0x0;var _0x46819a=_0x9c0a[_0x570f09];return _0x46819a;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xa9c0('0x0'));var path=require(_0xa9c0('0x1'));var moment=require(_0xa9c0('0x2'));var htmlToPdfmake=require(_0xa9c0('0x3'));var PdfPrinter=require(_0xa9c0('0x4'));var zipdir=require(_0xa9c0('0x5'));var rimraf=require(_0xa9c0('0x6'));var JSDOM=require(_0xa9c0('0x7'))[_0xa9c0('0x8')];var window=new JSDOM('')[_0xa9c0('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xa9c0('0xa')];var logger=require(_0xa9c0('0xb'))(_0xa9c0('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xa9c0('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xa9c0('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x53e028,_0x242cfd){var _0x14688c={'status':_0x53e028};var _0x544ac1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x242cfd){_0x14688c['savename']=_0x242cfd;}return db[_0xa9c0('0xf')][_0xa9c0('0x10')](_0x14688c,_0x544ac1);}function getHeaders(_0x5c37d0){return _[_0xa9c0('0x11')](_0x5c37d0,function(_0xc57e9b){return{'text':_0xc57e9b,'style':'tableHeader'};});}function getRows(_0x18ae09,_0x1972dc){return _[_0xa9c0('0x11')](_0x1972dc,function(_0x32623d){return _(_0x32623d)[_0xa9c0('0x12')](_0x18ae09)['map'](function(_0xa5126a){return _0xa5126a?_[_0xa9c0('0x13')](_0xa5126a):'';})['value']();});}function createTable(_0x1b1f46,_0xca9888){var _0x1b5a86={'widths':_[_0xa9c0('0x14')](Array(_0x1b1f46['length']),0x91),'heights':function(_0x585fd8){return _0x585fd8===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xfe3054=getHeaders(_0x1b1f46);_0x1b5a86[_0xa9c0('0x15')][_0xa9c0('0x16')](_0xfe3054);var _0x22e7e6=getRows(_0x1b1f46,_0xca9888);_0x1b5a86[_0xa9c0('0x15')]=_0x1b5a86['body'][_0xa9c0('0x17')](_0x22e7e6);return _0x1b5a86;}function createTables(_0xe003bb){var _0x1425ed=[];var _0x1f8a7d=_['chunk'](Object[_0xa9c0('0x18')](_0xe003bb[0x0]),0x5);_0x1f8a7d['forEach'](function(_0x176c97){_0x1425ed[_0xa9c0('0x16')](createTable(_0x176c97,_0xe003bb));});return _0x1425ed;}function getPDFDocDefinition(_0x4bf3dd){var _0x142aae=util[_0xa9c0('0x19')](_0xa9c0('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xa9c0('0x19')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xa9c0('0x19')](FORMAT));var _0x1917c7=[];for(var _0x5a5588=0x0;_0x5a5588<_0x4bf3dd[_0xa9c0('0x1b')];_0x5a5588++){var _0x3ab84f=[];if(_0x5a5588===0x0){_0x3ab84f[_0xa9c0('0x16')]({'text':_0x142aae,'style':_0xa9c0('0x1c')});}var _0x1fc31e={'table':_0x4bf3dd[_0x5a5588]};if(_0x5a5588>0x0){_0x1fc31e[_0xa9c0('0x1d')]=_0xa9c0('0x1e');_0x1fc31e[_0xa9c0('0x1f')]=[0x0,0x46,0x0,0x0];}_0x3ab84f['push'](_0x1fc31e);_0x1917c7['push'](_0x3ab84f);}return{'pageSize':'A4','pageOrientation':_0xa9c0('0x20'),'content':_0x1917c7,'footer':function(_0x5d2e33,_0x50196d){return{'text':_0x5d2e33[_0xa9c0('0x13')]()+_0xa9c0('0x21')+_0x50196d,'style':'footer'};},'defaultStyle':{'font':_0xa9c0('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xa9c0('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x36de5f){var _0xb259cb=0x1388;var _0x553078;if(!_0x36de5f[0x0][_0xa9c0('0x24')]){return analyticExtractedReport(_0xa9c0('0x25'));}return db[_0xa9c0('0x26')][_0xa9c0('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0xa9c0('0x28')](function(_0x27a02e){if(_0x27a02e){_0x553078=_0x27a02e;_0xb259cb=_0x553078['splitSizePdf']||0x3e8;}})[_0xa9c0('0x28')](function(){var _0x488da2=[];var _0x17917e=0x0;if(_0x553078['split']){if(_0x36de5f&&_0x36de5f[_0xa9c0('0x1b')]){var _0x3804bf=_[_0xa9c0('0x29')](_0x36de5f[0x0][_0xa9c0('0x24')]/_0xb259cb);var _0x453d1f=Number[_0xa9c0('0x2a')](_0x36de5f[0x0][_0xa9c0('0x24')]/_0xb259cb)?_0x36de5f[0x0]['num']%_0xb259cb:0x0;_0x3804bf[_0xa9c0('0x2b')](function(_0x2e42cb){if(_0x2e42cb>0x0){_0x17917e+=_0xb259cb;}_0x488da2[_0xa9c0('0x16')](dbH[_0xa9c0('0x2c')][_0xa9c0('0x2d')](util[_0xa9c0('0x19')](_0xa9c0('0x2e'),QUERY,_0xb259cb,_0x17917e),{'type':dbH[_0xa9c0('0x2c')][_0xa9c0('0x2f')]['SELECT']}));});if(_0x453d1f>0x0){_0x17917e+=_0xb259cb;_0x488da2['push'](dbH[_0xa9c0('0x2c')][_0xa9c0('0x2d')](util[_0xa9c0('0x19')](_0xa9c0('0x2e'),QUERY,_0x453d1f,_0x17917e),{'type':dbH[_0xa9c0('0x2c')]['QueryTypes'][_0xa9c0('0x30')]}));}}}else{_0x488da2[_0xa9c0('0x16')](dbH[_0xa9c0('0x2c')][_0xa9c0('0x2d')](QUERY,{'type':dbH[_0xa9c0('0x2c')][_0xa9c0('0x2f')]['SELECT']}));}var _0x5b508b=path[_0xa9c0('0x31')](PATH);var _0x49e001=path[_0xa9c0('0x32')](PATH,'.pdf');var _0x13c6b4=_0x553078[_0xa9c0('0x33')]&&_0x488da2[_0xa9c0('0x1b')]>0x1;var _0x378d8f=[];if(!fs['existsSync'](path[_0xa9c0('0x34')](_0x5b508b,_0x49e001))&&_0x13c6b4){fs[_0xa9c0('0x35')](path[_0xa9c0('0x34')](_0x5b508b,_0x49e001));}return BPromise[_0xa9c0('0x36')](_0x488da2,function(_0x35d377){_0x378d8f[_0xa9c0('0x16')](_0x35d377);})[_0xa9c0('0x28')](function(){var _0x1206f2=[];for(var _0xc8f851=0x0;_0xc8f851<_0x378d8f[_0xa9c0('0x1b')];_0xc8f851+=0x1){var _0x2f071e=_0x378d8f[_0xc8f851];var _0x9b3cf4=createTables(_[_0xa9c0('0x37')](_0x2f071e));var _0x5214f0;var _0xbd545=getPDFDocDefinition(_0x9b3cf4);var _0x22b4c6=getPDFPrinter();var _0xa042a8=_0x22b4c6[_0xa9c0('0x38')](_0xbd545);if(_0x13c6b4){_0x5214f0=path[_0xa9c0('0x34')](_0x5b508b,_0x49e001,util[_0xa9c0('0x19')](_0xa9c0('0x39'),_0x49e001,_0xc8f851,'pdf'));}else{_0x5214f0=path[_0xa9c0('0x34')](_0x5b508b,util[_0xa9c0('0x19')](_0xa9c0('0x3a'),_0x49e001,_0xa9c0('0x3b')));}_0x1206f2[_0xa9c0('0x16')](writePDFDocument(_0xa042a8,_0x5214f0));}return Promise[_0xa9c0('0x3c')](_0x1206f2);})[_0xa9c0('0x28')](function(){if(_0x13c6b4){return new Promise(function(_0x45422c){zipdir(path[_0xa9c0('0x34')](_0x5b508b,_0x49e001),{'saveTo':path['join'](_0x5b508b,util[_0xa9c0('0x19')](_0xa9c0('0x3a'),_0x49e001,_0xa9c0('0x3d')))},function(){rimraf(path[_0xa9c0('0x34')](_0x5b508b,_0x49e001),function(){});_0x45422c(_0xa9c0('0x3e'));});});}})['then'](function(){if(!_0x13c6b4)return;rimraf(path['join'](_0x5b508b,_0x49e001),function(){});})[_0xa9c0('0x28')](function(){logger[_0xa9c0('0x3f')](util[_0xa9c0('0x19')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa9c0('0x40')));return analyticExtractedReport(_0xa9c0('0x41'),_0x13c6b4?util[_0xa9c0('0x19')](_0xa9c0('0x3a'),_0x49e001,_0x13c6b4?_0xa9c0('0x3d'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0xa9c0('0x19')](_0xa9c0('0x42'),EXTRACTED_REPORT_ID,_0xa9c0('0x40')));return db[_0xa9c0('0xf')][_0xa9c0('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa9c0('0x28')](function(_0x302762){EXTRACTED_REPORT=_0x302762;return dbH['sequelize']['query'](util[_0xa9c0('0x19')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa9c0('0x2c')][_0xa9c0('0x2f')][_0xa9c0('0x30')]});})[_0xa9c0('0x28')](extractReport)[_0xa9c0('0x44')](function(_0x16f24d){logger[_0xa9c0('0x3f')](util['format'](_0xa9c0('0x45'),EXTRACTED_REPORT_ID,_0xa9c0('0x40')),util[_0xa9c0('0x46')](_0x16f24d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa9c0('0x47'));})[_0xa9c0('0x48')](function(){process[_0xa9c0('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x139e61=new PdfPrinter({'Arial':{'normal':__dirname+_0xa9c0('0x4a'),'bold':__dirname+_0xa9c0('0x4b'),'italics':__dirname+_0xa9c0('0x4c'),'bolditalics':__dirname+_0xa9c0('0x4d')}});return _0x139e61;}function getPDFDocDefinitionFromHTML(_0xeae1d1,_0x22a6d4){var _0x39fb04=util[_0xa9c0('0x19')](_0xa9c0('0x4e'),_0x22a6d4[_0xa9c0('0x4f')],_0x22a6d4[_0xa9c0('0x50')]);var _0x342d16=moment()['format'](_0xa9c0('0x51'))[_0xa9c0('0x13')]();var _0x3e1265=htmlToPdfmake(_0xeae1d1,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e1265],'defaultStyle':{'font':_0xa9c0('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa9c0('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xa9c0('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xa9c0('0x1c')}];},'footer':function(_0x2d38f6,_0x189009){return[{'text':util[_0xa9c0('0x19')](_0xa9c0('0x53'),_0x39fb04,_0x2d38f6,_0x189009,_0x342d16),'style':_0xa9c0('0x54')}];}};}function writePDFDocument(_0x45a49d,_0x4ec0c0){return new Promise(function(_0x1fc6f2,_0x2cd697){var _0x3ee86c=_0x45a49d[_0xa9c0('0x55')](fs['createWriteStream'](_0x4ec0c0));_0x3ee86c['on']('finish',function(){_0x1fc6f2(_0xa9c0('0x56'));});_0x3ee86c['on'](_0xa9c0('0x57'),function(_0x5e6ef5){_0x2cd697(_0x5e6ef5);});_0x45a49d[_0xa9c0('0x58')]();});}exports[_0xa9c0('0x59')]=function(_0x4ee33a,_0xdbf0e4){var _0x4349f3=getPDFPrinter();var _0x51cb1b=getPDFDocDefinitionFromHTML(_0x4ee33a,_0xdbf0e4);var _0x20faea=_0x4349f3[_0xa9c0('0x38')](_0x51cb1b);return writePDFDocument(_0x20faea,_0xdbf0e4['path'])[_0xa9c0('0x44')](function(_0x32fdaa){throw _0x32fdaa;});}; \ No newline at end of file +var _0xd8af=['before','margin','landscape','\x20/\x20','Arial','black','Setting','find','split','splitSizePdf','then','range','num','isInteger','sequelize','SELECT','query','QueryTypes','dirname','basename','existsSync','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','createWriteStream','finish','error','createPdfFromHTML','createPdfKitDocument','path','lodash','util','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','map','pick','toString','fill','length','auto','body','push','concat','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','header'];(function(_0x31fb16,_0x3a4f55){var _0x50f4b7=function(_0x42f60f){while(--_0x42f60f){_0x31fb16['push'](_0x31fb16['shift']());}};_0x50f4b7(++_0x3a4f55);}(_0xd8af,0x141));var _0xfd8a=function(_0x5e210b,_0x5218b7){_0x5e210b=_0x5e210b-0x0;var _0x596c3a=_0xd8af[_0x5e210b];return _0x596c3a;};'use strict';var _=require(_0xfd8a('0x0'));var fs=require('fs');var util=require(_0xfd8a('0x1'));var path=require('path');var moment=require(_0xfd8a('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xfd8a('0x3'));var zipdir=require(_0xfd8a('0x4'));var rimraf=require(_0xfd8a('0x5'));var JSDOM=require(_0xfd8a('0x6'))[_0xfd8a('0x7')];var window=new JSDOM('')[_0xfd8a('0x8')];var BPromise=require(_0xfd8a('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0xfd8a('0xa'))[_0xfd8a('0xb')];var logger=require(_0xfd8a('0xc'))(_0xfd8a('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xfd8a('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xfd8a('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x54251e,_0x2f1935){var _0x163efc={'status':_0x54251e};var _0x2e0ad7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f1935){_0x163efc[_0xfd8a('0xf')]=_0x2f1935;}return db['AnalyticExtractedReport'][_0xfd8a('0x10')](_0x163efc,_0x2e0ad7);}function getHeaders(_0x44dc84){return _[_0xfd8a('0x11')](_0x44dc84,function(_0x4c8078){return{'text':_0x4c8078,'style':'tableHeader'};});}function getRows(_0x1b9b97,_0x5d7637){return _[_0xfd8a('0x11')](_0x5d7637,function(_0xbf8904){return _(_0xbf8904)[_0xfd8a('0x12')](_0x1b9b97)[_0xfd8a('0x11')](function(_0x5a2d35){return _0x5a2d35?_[_0xfd8a('0x13')](_0x5a2d35):'';})['value']();});}function createTable(_0x141701,_0x1df704){var _0x140601={'widths':_[_0xfd8a('0x14')](Array(_0x141701[_0xfd8a('0x15')]),0x91),'heights':function(_0x3c2f37){return _0x3c2f37===0x0?_0xfd8a('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2d8595=getHeaders(_0x141701);_0x140601[_0xfd8a('0x17')][_0xfd8a('0x18')](_0x2d8595);var _0x55f29a=getRows(_0x141701,_0x1df704);_0x140601[_0xfd8a('0x17')]=_0x140601[_0xfd8a('0x17')][_0xfd8a('0x19')](_0x55f29a);return _0x140601;}function createTables(_0xf4cdba){var _0x1cc574=[];var _0xf9fce3=_['chunk'](Object[_0xfd8a('0x1a')](_0xf4cdba[0x0]),0x5);_0xf9fce3['forEach'](function(_0x4b58ff){_0x1cc574[_0xfd8a('0x18')](createTable(_0x4b58ff,_0xf4cdba));});return _0x1cc574;}function getPDFDocDefinition(_0x30edf4){var _0x5c13b1=util[_0xfd8a('0x1b')](_0xfd8a('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xfd8a('0x1d')])[_0xfd8a('0x1b')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xfd8a('0x1b')](FORMAT));var _0x2c267b=[];for(var _0x2f5a38=0x0;_0x2f5a38<_0x30edf4[_0xfd8a('0x15')];_0x2f5a38++){var _0x4dae93=[];if(_0x2f5a38===0x0){_0x4dae93[_0xfd8a('0x18')]({'text':_0x5c13b1,'style':_0xfd8a('0x1e')});}var _0x3157cf={'table':_0x30edf4[_0x2f5a38]};if(_0x2f5a38>0x0){_0x3157cf['pageBreak']=_0xfd8a('0x1f');_0x3157cf[_0xfd8a('0x20')]=[0x0,0x46,0x0,0x0];}_0x4dae93[_0xfd8a('0x18')](_0x3157cf);_0x2c267b[_0xfd8a('0x18')](_0x4dae93);}return{'pageSize':'A4','pageOrientation':_0xfd8a('0x21'),'content':_0x2c267b,'footer':function(_0x5b2d94,_0x294772){return{'text':_0x5b2d94[_0xfd8a('0x13')]()+_0xfd8a('0x22')+_0x294772,'style':'footer'};},'defaultStyle':{'font':_0xfd8a('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xfd8a('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x595417){var _0x579423=0x1388;var _0x5200e7;if(!_0x595417[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0xfd8a('0x25')][_0xfd8a('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfd8a('0x27'),_0xfd8a('0x28')]})[_0xfd8a('0x29')](function(_0x38e603){if(_0x38e603){_0x5200e7=_0x38e603;_0x579423=_0x5200e7[_0xfd8a('0x28')]||0x3e8;}})[_0xfd8a('0x29')](function(){var _0x4fe834=[];var _0x3837c5=0x0;if(_0x5200e7[_0xfd8a('0x27')]){if(_0x595417&&_0x595417[_0xfd8a('0x15')]){var _0x261b9d=_[_0xfd8a('0x2a')](_0x595417[0x0][_0xfd8a('0x2b')]/_0x579423);var _0x4f0d4a=Number[_0xfd8a('0x2c')](_0x595417[0x0][_0xfd8a('0x2b')]/_0x579423)?_0x595417[0x0][_0xfd8a('0x2b')]%_0x579423:0x0;_0x261b9d['forEach'](function(_0x337190){if(_0x337190>0x0){_0x3837c5+=_0x579423;}_0x4fe834['push'](dbH[_0xfd8a('0x2d')]['query'](util[_0xfd8a('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x579423,_0x3837c5),{'type':dbH[_0xfd8a('0x2d')]['QueryTypes'][_0xfd8a('0x2e')]}));});if(_0x4f0d4a>0x0){_0x3837c5+=_0x579423;_0x4fe834[_0xfd8a('0x18')](dbH[_0xfd8a('0x2d')][_0xfd8a('0x2f')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f0d4a,_0x3837c5),{'type':dbH[_0xfd8a('0x2d')][_0xfd8a('0x30')][_0xfd8a('0x2e')]}));}}}else{_0x4fe834['push'](dbH[_0xfd8a('0x2d')][_0xfd8a('0x2f')](QUERY,{'type':dbH[_0xfd8a('0x2d')]['QueryTypes'][_0xfd8a('0x2e')]}));}var _0x22682a=path[_0xfd8a('0x31')](PATH);var _0x51ec26=path[_0xfd8a('0x32')](PATH,'.pdf');var _0x1cf638=_0x5200e7[_0xfd8a('0x27')]&&_0x4fe834['length']>0x1;var _0x1d07ae=[];if(!fs[_0xfd8a('0x33')](path[_0xfd8a('0x34')](_0x22682a,_0x51ec26))&&_0x1cf638){fs[_0xfd8a('0x35')](path[_0xfd8a('0x34')](_0x22682a,_0x51ec26));}return BPromise[_0xfd8a('0x36')](_0x4fe834,function(_0x22dfd4){_0x1d07ae[_0xfd8a('0x18')](_0x22dfd4);})[_0xfd8a('0x29')](function(){var _0x4fd5d2=[];for(var _0x4965d6=0x0;_0x4965d6<_0x1d07ae[_0xfd8a('0x15')];_0x4965d6+=0x1){var _0x342a9e=_0x1d07ae[_0x4965d6];var _0x14e3ad=createTables(_[_0xfd8a('0x37')](_0x342a9e));var _0x4b9b3e;var _0x44c37c=getPDFDocDefinition(_0x14e3ad);var _0x3e1db6=getPDFPrinter();var _0x2e1ee6=_0x3e1db6['createPdfKitDocument'](_0x44c37c);if(_0x1cf638){_0x4b9b3e=path[_0xfd8a('0x34')](_0x22682a,_0x51ec26,util[_0xfd8a('0x1b')](_0xfd8a('0x38'),_0x51ec26,_0x4965d6,_0xfd8a('0x39')));}else{_0x4b9b3e=path[_0xfd8a('0x34')](_0x22682a,util[_0xfd8a('0x1b')](_0xfd8a('0x3a'),_0x51ec26,_0xfd8a('0x39')));}_0x4fd5d2[_0xfd8a('0x18')](writePDFDocument(_0x2e1ee6,_0x4b9b3e));}return Promise['all'](_0x4fd5d2);})[_0xfd8a('0x29')](function(){if(_0x1cf638){return new Promise(function(_0x29dadf){zipdir(path[_0xfd8a('0x34')](_0x22682a,_0x51ec26),{'saveTo':path[_0xfd8a('0x34')](_0x22682a,util[_0xfd8a('0x1b')](_0xfd8a('0x3a'),_0x51ec26,_0xfd8a('0x3b')))},function(){rimraf(path[_0xfd8a('0x34')](_0x22682a,_0x51ec26),function(){});_0x29dadf(_0xfd8a('0x3c'));});});}})['then'](function(){if(!_0x1cf638)return;rimraf(path['join'](_0x22682a,_0x51ec26),function(){});})['then'](function(){logger[_0xfd8a('0x3d')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xfd8a('0x3e')));return analyticExtractedReport('Completed',_0x1cf638?util[_0xfd8a('0x1b')](_0xfd8a('0x3a'),_0x51ec26,_0x1cf638?'zip':_0xfd8a('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xfd8a('0x3d')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0xfd8a('0x3f')][_0xfd8a('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x253f99){EXTRACTED_REPORT=_0x253f99;return dbH['sequelize'][_0xfd8a('0x2f')](util[_0xfd8a('0x1b')](_0xfd8a('0x41'),QUERY),{'type':dbH[_0xfd8a('0x2d')]['QueryTypes'][_0xfd8a('0x2e')]});})[_0xfd8a('0x29')](extractReport)[_0xfd8a('0x42')](function(_0xc17d4){logger[_0xfd8a('0x3d')](util[_0xfd8a('0x1b')](_0xfd8a('0x43'),EXTRACTED_REPORT_ID,_0xfd8a('0x3e')),util[_0xfd8a('0x44')](_0xc17d4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfd8a('0x45'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x40945f=new PdfPrinter({'Arial':{'normal':__dirname+_0xfd8a('0x46'),'bold':__dirname+_0xfd8a('0x47'),'italics':__dirname+_0xfd8a('0x48'),'bolditalics':__dirname+_0xfd8a('0x49')}});return _0x40945f;}function getPDFDocDefinitionFromHTML(_0x419e45,_0x298dfb){var _0x588151=util[_0xfd8a('0x1b')](_0xfd8a('0x4a'),_0x298dfb[_0xfd8a('0x4b')],_0x298dfb[_0xfd8a('0x4c')]);var _0x63223=moment()['format'](_0xfd8a('0x4d'))[_0xfd8a('0x13')]();var _0x54c6da=htmlToPdfmake(_0x419e45,{'window':window,'tableAutoSize':!![]});return{'content':[_0x54c6da],'defaultStyle':{'font':_0xfd8a('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xfd8a('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xfd8a('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xfd8a('0x4e')}},'header':function(){return[{'text':_0xfd8a('0x4f'),'style':_0xfd8a('0x1e')}];},'footer':function(_0x178219,_0x5a9cd8){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x588151,_0x178219,_0x5a9cd8,_0x63223),'style':_0xfd8a('0x50')}];}};}function writePDFDocument(_0x378ae4,_0x309f36){return new Promise(function(_0x439c90,_0x8e123e){var _0x400ce8=_0x378ae4[_0xfd8a('0x51')](fs[_0xfd8a('0x52')](_0x309f36));_0x400ce8['on'](_0xfd8a('0x53'),function(){_0x439c90(_0xfd8a('0x53'));});_0x400ce8['on'](_0xfd8a('0x54'),function(_0x41c637){_0x8e123e(_0x41c637);});_0x378ae4['end']();});}exports[_0xfd8a('0x55')]=function(_0x6e4ea9,_0x38d746){var _0x8804a0=getPDFPrinter();var _0x2cd2d3=getPDFDocDefinitionFromHTML(_0x6e4ea9,_0x38d746);var _0x24dbfc=_0x8804a0[_0xfd8a('0x56')](_0x2cd2d3);return writePDFDocument(_0x24dbfc,_0x38d746[_0xfd8a('0x57')])['catch'](function(_0x76af3a){throw _0x76af3a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 857b76f..abe7b0d 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 _0xf07f=['push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','json2xls','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','QueryTypes','length','num','forEach'];(function(_0x4ccc23,_0x104cbf){var _0x13f9b5=function(_0x1b6d7b){while(--_0x1b6d7b){_0x4ccc23['push'](_0x4ccc23['shift']());}};_0x13f9b5(++_0x104cbf);}(_0xf07f,0xa4));var _0xff07=function(_0x505337,_0x13c07d){_0x505337=_0x505337-0x0;var _0x43de74=_0xf07f[_0x505337];return _0x43de74;};'use strict';var util=require(_0xff07('0x0'));var path=require(_0xff07('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xff07('0x2'));var BPromise=require('bluebird');var zipdir=require(_0xff07('0x3'));var rimraf=require('rimraf');var db=require(_0xff07('0x4'))['db'];var dbH=require(_0xff07('0x4'))[_0xff07('0x5')];var logger=require(_0xff07('0x6'))(_0xff07('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xff07('0x8')][0x2]);var QUERY=process[_0xff07('0x8')][0x3];var PATH=process[_0xff07('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x158626,_0x3a23c1){var _0x262740={'status':_0x158626};var _0x56954a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a23c1){_0x262740[_0xff07('0x9')]=_0x3a23c1;}return db[_0xff07('0xa')]['update'](_0x262740,_0x56954a);}function main(){var _0x39bf3e=0x1388;var _0x5efd81;logger[_0xff07('0xb')](util[_0xff07('0xc')](_0xff07('0xd'),EXTRACTED_REPORT_ID,_0xff07('0xe')));return db[_0xff07('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xff07('0x10'),_0xff07('0x11')]})['then'](function(_0x3ffbf9){if(_0x3ffbf9){_0x5efd81=_0x3ffbf9;_0x39bf3e=_0x5efd81[_0xff07('0x11')]||0x1388;}})[_0xff07('0x12')](function(){return dbH[_0xff07('0x13')]['query'](util[_0xff07('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xff07('0x13')][_0xff07('0x14')]['SELECT']});})[_0xff07('0x12')](function(_0x1a11a6){if(!_0x1a11a6[0x0]['num']){return analyticExtractedReport('Empty');}var _0x5ca77b=[];var _0x5ed339=0x0;if(_0x5efd81[_0xff07('0x10')]){if(_0x1a11a6&&_0x1a11a6[_0xff07('0x15')]){var _0x6e874=_['range'](_0x1a11a6[0x0][_0xff07('0x16')]/_0x39bf3e);var _0x4bf3f0=Number['isInteger'](_0x1a11a6[0x0]['num']/_0x39bf3e)?_0x1a11a6[0x0]['num']%_0x39bf3e:0x0;_0x6e874[_0xff07('0x17')](function(_0x5927b2){if(_0x5927b2>0x0){_0x5ed339+=_0x39bf3e;}_0x5ca77b[_0xff07('0x18')](dbH[_0xff07('0x13')][_0xff07('0x19')](util[_0xff07('0xc')](_0xff07('0x1a'),QUERY,_0x39bf3e,_0x5ed339),{'type':dbH[_0xff07('0x13')][_0xff07('0x14')]['SELECT']}));});if(_0x4bf3f0>0x0){_0x5ed339+=_0x39bf3e;_0x5ca77b[_0xff07('0x18')](dbH['sequelize']['query'](util[_0xff07('0xc')](_0xff07('0x1a'),QUERY,_0x4bf3f0,_0x5ed339),{'type':dbH['sequelize'][_0xff07('0x14')][_0xff07('0x1b')]}));}}}else{_0x5ca77b[_0xff07('0x18')](dbH[_0xff07('0x13')][_0xff07('0x19')](QUERY,{'type':dbH[_0xff07('0x13')]['QueryTypes'][_0xff07('0x1b')]}));}var _0x593733=path[_0xff07('0x1c')](PATH);var _0x4bf26f=path[_0xff07('0x1d')](PATH,_0xff07('0x1e'));var _0x45727f=_0x5efd81[_0xff07('0x10')]&&_0x5ca77b[_0xff07('0x15')]>0x1;var _0x3c99fd=[];if(!fs[_0xff07('0x1f')](path[_0xff07('0x20')](_0x593733,_0x4bf26f))&&_0x45727f){fs[_0xff07('0x21')](path[_0xff07('0x20')](_0x593733,_0x4bf26f));}return BPromise[_0xff07('0x22')](_0x5ca77b,function(_0x5f1ef7){_0x3c99fd[_0xff07('0x18')](_0x5f1ef7);})[_0xff07('0x12')](function(){for(var _0x56b845=0x0;_0x56b845<_0x3c99fd[_0xff07('0x15')];_0x56b845+=0x1){var _0x515571;var _0x5dcd53=_0x3c99fd[_0x56b845];if(_0x45727f){_0x515571=path['join'](_0x593733,_0x4bf26f,util[_0xff07('0xc')]('%s%d.%s',_0x4bf26f,_0x56b845,_0xff07('0x23')));}else{_0x515571=path[_0xff07('0x20')](_0x593733,util[_0xff07('0xc')]('%s.%s',_0x4bf26f,_0xff07('0x23')));}fs[_0xff07('0x24')](_0x515571,json2xls(_0x5dcd53),_0xff07('0x25'));}})[_0xff07('0x12')](function(){if(_0x45727f){return new Promise(function(_0x46d193){zipdir(path[_0xff07('0x20')](_0x593733,_0x4bf26f),{'saveTo':path['join'](_0x593733,util[_0xff07('0xc')](_0xff07('0x26'),_0x4bf26f,_0xff07('0x27')))},function(_0x37f106,_0xe78c92){rimraf(path[_0xff07('0x20')](_0x593733,_0x4bf26f),function(){});_0x46d193(_0xff07('0x28'));});});}})['then'](function(){logger[_0xff07('0xb')](util[_0xff07('0xc')](_0xff07('0x29'),EXTRACTED_REPORT_ID,_0xff07('0xe')));return analyticExtractedReport(_0xff07('0x2a'),_0x45727f?util[_0xff07('0xc')](_0xff07('0x26'),_0x4bf26f,_0x45727f?_0xff07('0x27'):_0xff07('0x23')):null);});})[_0xff07('0x2b')](function(_0x48e862){logger['info'](util[_0xff07('0xc')](_0xff07('0x2c'),EXTRACTED_REPORT_ID,_0xff07('0xe')),util['inspect'](_0x48e862,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xff07('0x2d')](function(){process[_0xff07('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdee7=['../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','XLSX','find','split','then','splitSizeXlsx','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','join','each','%s.%s','writeFileSync','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','inspect','finally','util','path','lodash','bluebird','zip-dir'];(function(_0x5d8687,_0x46fbb2){var _0xe4c517=function(_0x6002ca){while(--_0x6002ca){_0x5d8687['push'](_0x5d8687['shift']());}};_0xe4c517(++_0x46fbb2);}(_0xdee7,0xf1));var _0x7dee=function(_0x41ec5f,_0x59d889){_0x41ec5f=_0x41ec5f-0x0;var _0x20eb12=_0xdee7[_0x41ec5f];return _0x20eb12;};'use strict';var util=require(_0x7dee('0x0'));var path=require(_0x7dee('0x1'));var _=require(_0x7dee('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x7dee('0x3'));var zipdir=require(_0x7dee('0x4'));var rimraf=require('rimraf');var db=require(_0x7dee('0x5'))['db'];var dbH=require(_0x7dee('0x5'))[_0x7dee('0x6')];var logger=require(_0x7dee('0x7'))(_0x7dee('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x7dee('0x9')][0x2]);var QUERY=process[_0x7dee('0x9')][0x3];var PATH=process[_0x7dee('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x631590,_0x3f3a44){var _0x318920={'status':_0x631590};var _0x27dbe6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f3a44){_0x318920[_0x7dee('0xa')]=_0x3f3a44;}return db['AnalyticExtractedReport'][_0x7dee('0xb')](_0x318920,_0x27dbe6);}function main(){var _0xa8e0fa=0x1388;var _0x102b09;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7dee('0xc')));return db['Setting'][_0x7dee('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7dee('0xe'),'splitSizeXlsx']})[_0x7dee('0xf')](function(_0x3f116b){if(_0x3f116b){_0x102b09=_0x3f116b;_0xa8e0fa=_0x102b09[_0x7dee('0x10')]||0x1388;}})[_0x7dee('0xf')](function(){return dbH[_0x7dee('0x11')][_0x7dee('0x12')](util[_0x7dee('0x13')](_0x7dee('0x14'),QUERY),{'type':dbH[_0x7dee('0x11')][_0x7dee('0x15')][_0x7dee('0x16')]});})[_0x7dee('0xf')](function(_0x3fd4ac){if(!_0x3fd4ac[0x0]['num']){return analyticExtractedReport(_0x7dee('0x17'));}var _0xcfda31=[];var _0x15c3ab=0x0;if(_0x102b09[_0x7dee('0xe')]){if(_0x3fd4ac&&_0x3fd4ac[_0x7dee('0x18')]){var _0x3faa0e=_[_0x7dee('0x19')](_0x3fd4ac[0x0][_0x7dee('0x1a')]/_0xa8e0fa);var _0x1a8b0b=Number[_0x7dee('0x1b')](_0x3fd4ac[0x0][_0x7dee('0x1a')]/_0xa8e0fa)?_0x3fd4ac[0x0][_0x7dee('0x1a')]%_0xa8e0fa:0x0;_0x3faa0e['forEach'](function(_0x43a39a){if(_0x43a39a>0x0){_0x15c3ab+=_0xa8e0fa;}_0xcfda31[_0x7dee('0x1c')](dbH['sequelize'][_0x7dee('0x12')](util[_0x7dee('0x13')](_0x7dee('0x1d'),QUERY,_0xa8e0fa,_0x15c3ab),{'type':dbH[_0x7dee('0x11')][_0x7dee('0x15')][_0x7dee('0x16')]}));});if(_0x1a8b0b>0x0){_0x15c3ab+=_0xa8e0fa;_0xcfda31[_0x7dee('0x1c')](dbH[_0x7dee('0x11')][_0x7dee('0x12')](util[_0x7dee('0x13')](_0x7dee('0x1d'),QUERY,_0x1a8b0b,_0x15c3ab),{'type':dbH['sequelize'][_0x7dee('0x15')][_0x7dee('0x16')]}));}}}else{_0xcfda31[_0x7dee('0x1c')](dbH[_0x7dee('0x11')][_0x7dee('0x12')](QUERY,{'type':dbH[_0x7dee('0x11')]['QueryTypes'][_0x7dee('0x16')]}));}var _0x4d9453=path['dirname'](PATH);var _0x5af77b=path[_0x7dee('0x1e')](PATH,_0x7dee('0x1f'));var _0x30913e=_0x102b09[_0x7dee('0xe')]&&_0xcfda31[_0x7dee('0x18')]>0x1;var _0x351be3=[];if(!fs['existsSync'](path['join'](_0x4d9453,_0x5af77b))&&_0x30913e){fs['mkdirSync'](path[_0x7dee('0x20')](_0x4d9453,_0x5af77b));}return BPromise[_0x7dee('0x21')](_0xcfda31,function(_0x562477){_0x351be3[_0x7dee('0x1c')](_0x562477);})[_0x7dee('0xf')](function(){for(var _0x50a03f=0x0;_0x50a03f<_0x351be3['length'];_0x50a03f+=0x1){var _0x552871;var _0x42df8f=_0x351be3[_0x50a03f];if(_0x30913e){_0x552871=path[_0x7dee('0x20')](_0x4d9453,_0x5af77b,util[_0x7dee('0x13')]('%s%d.%s',_0x5af77b,_0x50a03f,'xlsx'));}else{_0x552871=path[_0x7dee('0x20')](_0x4d9453,util[_0x7dee('0x13')](_0x7dee('0x22'),_0x5af77b,'xlsx'));}fs[_0x7dee('0x23')](_0x552871,json2xls(_0x42df8f),'binary');}})[_0x7dee('0xf')](function(){if(_0x30913e){return new Promise(function(_0x437c0a){zipdir(path[_0x7dee('0x20')](_0x4d9453,_0x5af77b),{'saveTo':path[_0x7dee('0x20')](_0x4d9453,util[_0x7dee('0x13')](_0x7dee('0x22'),_0x5af77b,'zip'))},function(_0x5616b4,_0x1a39eb){rimraf(path[_0x7dee('0x20')](_0x4d9453,_0x5af77b),function(){});_0x437c0a('zip\x20finished');});});}})[_0x7dee('0xf')](function(){logger[_0x7dee('0x24')](util[_0x7dee('0x13')](_0x7dee('0x25'),EXTRACTED_REPORT_ID,_0x7dee('0xc')));return analyticExtractedReport('Completed',_0x30913e?util['format'](_0x7dee('0x22'),_0x5af77b,_0x30913e?_0x7dee('0x26'):'xlsx'):null);});})['catch'](function(_0x20f76f){logger['info'](util[_0x7dee('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x7dee('0x27')](_0x20f76f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x7dee('0x28')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 016332f..65749ad 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 _0xac86=['length','updatedAt','interval','intervals','tag','CDR(tag)=','outbound','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','indexOf','app','toLowerCase','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','models','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x152825,_0x446a97){var _0x5751fa=function(_0x27a894){while(--_0x27a894){_0x152825['push'](_0x152825['shift']());}};_0x5751fa(++_0x446a97);}(_0xac86,0xf7));var _0x6ac8=function(_0x399ad2,_0xe7d74c){_0x399ad2=_0x399ad2-0x0;var _0x5c84df=_0xac86[_0x399ad2];return _0x5c84df;};'use strict';var _=require('lodash');var util=require(_0x6ac8('0x0'));function rewrite(_0x33a0ff,_0x1c2eae){var _0x1e2c14=this;return _0x33a0ff[_0x6ac8('0x1')]['Interval'][_0x6ac8('0x2')]({'raw':!![]})[_0x6ac8('0x3')](function(_0x3929a7){_0x1e2c14['intervals']=_0x3929a7;return _0x33a0ff[_0x6ac8('0x1')][_0x6ac8('0x4')][_0x6ac8('0x2')]({'where':{'IntervalId':_0x1c2eae[_0x6ac8('0x5')]},'raw':!![]});})[_0x6ac8('0x3')](function(_0x1b5885){return _0x33a0ff['models']['VoiceExtension'][_0x6ac8('0x2')]({'where':{'exten':{'$in':_[_0x6ac8('0x6')](_[_0x6ac8('0x7')](_0x1b5885,_0x6ac8('0x8')))}},'order':[{'raw':_0x6ac8('0x9')}],'raw':!![]});})[_0x6ac8('0x3')](function(_0x8d6598){var _0x5b7b48=_[_0x6ac8('0xa')](_0x8d6598,{'priority':'1'});var _0x49a467=_[_0x6ac8('0xa')](_0x8d6598,{'isApp':0x1});var _0x59b013=_['groupBy'](_0x49a467,_0x6ac8('0x8'));var _0x22c29e=[_0x6ac8('0xb'),_0x6ac8('0xc')];var _0x4c9380=[];var _0xdff655=[];for(var _0x59d8f3 in _0x59b013){if(_0x59b013[_0x6ac8('0xd')](_0x59d8f3)){_0x1e2c14[_0x6ac8('0xe')]=0x2;_0x1e2c14[_0x6ac8('0xf')]=[];_0x1e2c14[_0x6ac8('0x10')]=_[_0x6ac8('0x11')](_0x5b7b48,{'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')]});_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':util[_0x6ac8('0x15')](_0x6ac8('0x16'),_0x59b013[_0x59d8f3][0x0]['type']),'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0]['exten'],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});if(_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')]===_0x6ac8('0x19')){_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x1a')+_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')],'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});}else if(_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')]==='outbound'){if(_0x1e2c14[_0x6ac8('0x10')]){_0x1e2c14[_0x6ac8('0xf')]['push']({'type':_0x59b013[_0x59d8f3][0x0]['type'],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x1b')+(_0x1e2c14[_0x6ac8('0x10')][_0x6ac8('0x1c')]?_0x6ac8('0x1d')+_0x1e2c14[_0x6ac8('0x10')][_0x6ac8('0x1c')]+'}':_0x6ac8('0x1e')),'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});}_0x1e2c14['extensions'][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':'CDR(routeid)='+_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')],'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});var _0x3321ac=_0x1e2c14['priority']++;_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x1f'),'appdata':_0x6ac8('0x20')+(_0x3321ac+0x2)+_0x6ac8('0x21')+(_0x3321ac+0x1)+')','context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x3321ac,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});if(_0x1e2c14[_0x6ac8('0x10')]){_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x1e2c14['extension'][_0x6ac8('0x1c')]?_0x6ac8('0x22')+_0x1e2c14['extension'][_0x6ac8('0x1c')]+'}':_0x6ac8('0x23'),'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});}_0x1e2c14['extensions']['push']({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':'Set','appdata':_0x6ac8('0x24')+_0x59b013[_0x59d8f3][0x0]['VoiceExtensionId'],'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});if(_0x1e2c14[_0x6ac8('0x10')]&&_0x1e2c14[_0x6ac8('0x10')][_0x6ac8('0xd')]('recordingFormat')&&_0x1e2c14['extension']['recordingFormat']!==_0x6ac8('0x25')){_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x26'),'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});_0x1e2c14['extensions'][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x27')+_0x1e2c14[_0x6ac8('0x10')][_0x6ac8('0x28')]||_0x6ac8('0x29'),'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0]['VoiceExtensionId']});}}_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x2a'),'context':_0x59b013[_0x59d8f3][0x0]['context'],'exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});_0x1e2c14[_0x6ac8('0xf')]['push']({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x2b'),'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0]['exten'],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x2c'),'context':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x17')],'exten':_0x59b013[_0x59d8f3][0x0]['exten'],'priority':_0x1e2c14[_0x6ac8('0xe')]++,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0]['VoiceExtensionId']});for(var _0x4e8b93=0x0,_0x10bd62=0x0;_0x4e8b93<_0x59b013[_0x59d8f3][_0x6ac8('0x2d')];_0x4e8b93+=0x1,_0x10bd62=0x0){var _0x11f832=_0x59b013[_0x59d8f3][_0x4e8b93];if(_0x11f832[_0x6ac8('0x13')]){_0x11f832[_0x6ac8('0x13')]=_0x11f832[_0x6ac8('0x13')]['toLowerCase']();}var _0x2af31d=[];var _0x142c6f=[];delete _0x11f832['id'];delete _0x11f832['createdAt'];delete _0x11f832[_0x6ac8('0x2e')];var _0x86e5ac=_0x11f832[_0x6ac8('0x2f')]!=='*,*,*,*'?[_0x11f832['interval']]:_0x11f832['IntervalId']?_['map'](_[_0x6ac8('0xa')](_0x1e2c14[_0x6ac8('0x30')],{'IntervalId':_0x11f832[_0x6ac8('0x5')]}),_0x6ac8('0x2f')):[];if(_0x11f832['hasOwnProperty']('tag')){if(_0x11f832[_0x6ac8('0x31')]&&_0x11f832[_0x6ac8('0x31')]!=='--'){_0x2af31d[_0x6ac8('0x12')]({'type':_0x11f832[_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x32')+_0x11f832[_0x6ac8('0x31')],'context':_0x11f832['context'],'exten':_0x11f832[_0x6ac8('0x8')],'priority':_0x86e5ac['length']+_0x1e2c14[_0x6ac8('0xe')]+_0x10bd62++,'VoiceExtensionId':_0x11f832[_0x6ac8('0x18')]});}}if(_0x11f832[_0x6ac8('0x13')]===_0x6ac8('0x33')&&_0x11f832['hasOwnProperty'](_0x6ac8('0x34'))){if(_0x11f832[_0x6ac8('0x34')]){_0x2af31d[_0x6ac8('0x12')]({'type':_0x11f832['type'],'app':_0x6ac8('0x1f'),'appdata':_0x6ac8('0x35')+_0x11f832[_0x6ac8('0x34')]+')','context':_0x11f832[_0x6ac8('0x17')],'exten':_0x11f832[_0x6ac8('0x8')],'priority':_0x86e5ac[_0x6ac8('0x2d')]+_0x1e2c14[_0x6ac8('0xe')]+_0x10bd62++,'VoiceExtensionId':_0x11f832[_0x6ac8('0x18')]});}else{_0x2af31d[_0x6ac8('0x12')]({'type':_0x11f832[_0x6ac8('0x13')],'app':_0x6ac8('0x1f'),'appdata':_0x6ac8('0x36'),'context':_0x11f832[_0x6ac8('0x17')],'exten':_0x11f832[_0x6ac8('0x8')],'priority':_0x86e5ac[_0x6ac8('0x2d')]+_0x1e2c14[_0x6ac8('0xe')]+_0x10bd62++,'VoiceExtensionId':_0x11f832[_0x6ac8('0x18')]});}}if(_0x11f832[_0x6ac8('0xd')](_0x6ac8('0x37'))){if(_0x22c29e[_0x6ac8('0x38')](_0x11f832[_0x6ac8('0x39')][_0x6ac8('0x3a')]())>=0x0&&_0x11f832['appType']!=='custom'){if(_0x11f832[_0x6ac8('0x37')]){_0x2af31d[_0x6ac8('0x12')]({'type':_0x11f832[_0x6ac8('0x13')],'app':_0x6ac8('0x1f'),'appdata':_0x6ac8('0x3b'),'context':_0x11f832[_0x6ac8('0x17')],'exten':_0x11f832[_0x6ac8('0x8')],'priority':_0x86e5ac[_0x6ac8('0x2d')]+_0x1e2c14[_0x6ac8('0xe')]+_0x10bd62++,'VoiceExtensionId':_0x11f832['VoiceExtensionId']});_0x2af31d[_0x6ac8('0x12')]({'type':_0x11f832['type'],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x3c'),'context':_0x11f832[_0x6ac8('0x17')],'exten':_0x11f832[_0x6ac8('0x8')],'priority':_0x86e5ac[_0x6ac8('0x2d')]+_0x1e2c14[_0x6ac8('0xe')]+_0x10bd62++,'VoiceExtensionId':_0x11f832[_0x6ac8('0x18')]});}else{_0x2af31d[_0x6ac8('0x12')]({'type':_0x11f832[_0x6ac8('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x11f832[_0x6ac8('0x17')],'exten':_0x11f832[_0x6ac8('0x8')],'priority':_0x86e5ac['length']+_0x1e2c14['priority']+_0x10bd62++,'VoiceExtensionId':_0x11f832[_0x6ac8('0x18')]});_0x2af31d['push']({'type':_0x11f832[_0x6ac8('0x13')],'app':_0x6ac8('0x14'),'appdata':_0x6ac8('0x3d'),'context':_0x11f832[_0x6ac8('0x17')],'exten':_0x11f832[_0x6ac8('0x8')],'priority':_0x86e5ac['length']+_0x1e2c14[_0x6ac8('0xe')]+_0x10bd62++,'VoiceExtensionId':_0x11f832['VoiceExtensionId']});}}}for(var _0xd8a807=0x0;_0xd8a807<_0x86e5ac[_0x6ac8('0x2d')];_0xd8a807+=0x1){var _0x17ecae=_0x1e2c14[_0x6ac8('0xe')]+_0x86e5ac[_0x6ac8('0x2d')];var _0x4f6440=_0xd8a807===_0x86e5ac[_0x6ac8('0x2d')]-0x1?_0x1e2c14['priority']+_0x2af31d[_0x6ac8('0x2d')]+_0x142c6f['length']+0x2:_0x1e2c14[_0x6ac8('0xe')]+_0xd8a807+0x1;_0x2af31d[_0x6ac8('0x3e')](_0xd8a807,0x0,{'type':_0x11f832[_0x6ac8('0x13')],'app':'GotoIfTime','appdata':_0x86e5ac[_0xd8a807]+'?'+_0x11f832[_0x6ac8('0x17')]+',${EXTEN},'+_0x17ecae+':'+_0x11f832[_0x6ac8('0x17')]+_0x6ac8('0x3f')+_0x4f6440,'exten':_0x11f832[_0x6ac8('0x8')],'context':_0x11f832[_0x6ac8('0x17')],'priority':_0x1e2c14['priority']+_0xd8a807,'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});}_0x11f832[_0x6ac8('0xe')]=_0x2af31d[_0x6ac8('0x2d')]?_[_0x6ac8('0x40')](_0x2af31d)[_0x6ac8('0xe')]+0x1:_0x1e2c14[_0x6ac8('0xe')];_0x1e2c14['priority']=(_0x142c6f[_0x6ac8('0x2d')]?_[_0x6ac8('0x40')](_0x142c6f)['priority']:_0x11f832[_0x6ac8('0xe')])+0x1;_0x1e2c14['extensions']=_[_0x6ac8('0x41')](_0x1e2c14['extensions'],_0x2af31d,[_0x11f832],_0x142c6f);}_0x1e2c14[_0x6ac8('0xf')][_0x6ac8('0x12')]({'type':_0x59b013[_0x59d8f3][0x0]['type'],'app':'Hangup','exten':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x8')],'context':_0x59b013[_0x59d8f3][0x0]['context'],'priority':_0x1e2c14['priority'],'VoiceExtensionId':_0x59b013[_0x59d8f3][0x0][_0x6ac8('0x18')]});_0x4c9380[_0x6ac8('0x12')](_0x59b013[_0x59d8f3][0x0]['VoiceExtensionId']);_0xdff655=_[_0x6ac8('0x41')](_0xdff655,_0x1e2c14[_0x6ac8('0xf')]);}}return _0x33a0ff[_0x6ac8('0x42')](function(_0x54018b){return _0x33a0ff[_0x6ac8('0x1')][_0x6ac8('0x4')][_0x6ac8('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x4c9380}},'transaction':_0x54018b})[_0x6ac8('0x3')](function(_0x28618e){return _0x33a0ff[_0x6ac8('0x1')][_0x6ac8('0x4')][_0x6ac8('0x44')](_[_0x6ac8('0x45')](_0xdff655,_0x6ac8('0xe')),{'transaction':_0x54018b});});});})[_0x6ac8('0x46')](function(_0x27c698){console[_0x6ac8('0x47')](_0x27c698);});}exports[_0x6ac8('0x48')]=rewrite; \ No newline at end of file +var _0xd39b=['error','lodash','util','models','Interval','findAll','intervals','VoiceExtension','then','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','priority','extensions','extension','find','type','Set','format','context','VoiceExtensionId','inbound','push','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','hasOwnProperty','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','destroy','bulkCreate','catch'];(function(_0x10827c,_0x2c13d1){var _0x17fb82=function(_0x4503c2){while(--_0x4503c2){_0x10827c['push'](_0x10827c['shift']());}};_0x17fb82(++_0x2c13d1);}(_0xd39b,0x164));var _0xbd39=function(_0x3cd07e,_0x135124){_0x3cd07e=_0x3cd07e-0x0;var _0x14d0c2=_0xd39b[_0x3cd07e];return _0x14d0c2;};'use strict';var _=require(_0xbd39('0x0'));var util=require(_0xbd39('0x1'));function rewrite(_0xa41c31,_0x8c6f0e){var _0x1c00bc=this;return _0xa41c31[_0xbd39('0x2')][_0xbd39('0x3')][_0xbd39('0x4')]({'raw':!![]})['then'](function(_0x461810){_0x1c00bc[_0xbd39('0x5')]=_0x461810;return _0xa41c31[_0xbd39('0x2')][_0xbd39('0x6')]['findAll']({'where':{'IntervalId':_0x8c6f0e['IntervalId']},'raw':!![]});})[_0xbd39('0x7')](function(_0x202c87){return _0xa41c31[_0xbd39('0x2')][_0xbd39('0x6')][_0xbd39('0x4')]({'where':{'exten':{'$in':_[_0xbd39('0x8')](_[_0xbd39('0x9')](_0x202c87,'exten'))}},'order':[{'raw':_0xbd39('0xa')}],'raw':!![]});})[_0xbd39('0x7')](function(_0x41036e){var _0x58d62a=_[_0xbd39('0xb')](_0x41036e,{'priority':'1'});var _0x303ac5=_[_0xbd39('0xb')](_0x41036e,{'isApp':0x1});var _0x21aa2b=_[_0xbd39('0xc')](_0x303ac5,_0xbd39('0xd'));var _0x15fa44=[_0xbd39('0xe'),_0xbd39('0xf')];var _0xdd79ff=[];var _0x4b7707=[];for(var _0x45d78d in _0x21aa2b){if(_0x21aa2b['hasOwnProperty'](_0x45d78d)){_0x1c00bc[_0xbd39('0x10')]=0x2;_0x1c00bc[_0xbd39('0x11')]=[];_0x1c00bc[_0xbd39('0x12')]=_[_0xbd39('0x13')](_0x58d62a,{'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')]});_0x1c00bc[_0xbd39('0x11')]['push']({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':_0xbd39('0x15'),'appdata':util[_0xbd39('0x16')]('CDR(type)=%s',_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')]),'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});if(_0x21aa2b[_0x45d78d][0x0]['type']===_0xbd39('0x19')){_0x1c00bc['extensions'][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0]['type'],'app':_0xbd39('0x15'),'appdata':_0xbd39('0x1b')+_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')],'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});}else if(_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')]===_0xbd39('0x1c')){if(_0x1c00bc[_0xbd39('0x12')]){_0x1c00bc['extensions'][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':_0xbd39('0x15'),'appdata':_0xbd39('0x1d')+(_0x1c00bc[_0xbd39('0x12')]['cutdigits']?_0xbd39('0x1e')+_0x1c00bc['extension'][_0xbd39('0x1f')]+'}':_0xbd39('0x20')),'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc['priority']++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});}_0x1c00bc[_0xbd39('0x11')]['push']({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':_0xbd39('0x15'),'appdata':_0xbd39('0x1b')+_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')],'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});var _0x3ff379=_0x1c00bc['priority']++;_0x1c00bc['extensions']['push']({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':'ExecIf','appdata':_0xbd39('0x21')+(_0x3ff379+0x2)+_0xbd39('0x22')+(_0x3ff379+0x1)+')','context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x3ff379,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});if(_0x1c00bc['extension']){_0x1c00bc[_0xbd39('0x11')]['push']({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':_0xbd39('0x15'),'appdata':_0x1c00bc[_0xbd39('0x12')][_0xbd39('0x1f')]?_0xbd39('0x23')+_0x1c00bc[_0xbd39('0x12')][_0xbd39('0x1f')]+'}':_0xbd39('0x24'),'context':_0x21aa2b[_0x45d78d][0x0]['context'],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc['priority']++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0]['VoiceExtensionId']});}_0x1c00bc[_0xbd39('0x11')][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':_0xbd39('0x15'),'appdata':'outboundrouteid='+_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')],'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0]['exten'],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});if(_0x1c00bc['extension']&&_0x1c00bc['extension']['hasOwnProperty'](_0xbd39('0x25'))&&_0x1c00bc[_0xbd39('0x12')][_0xbd39('0x25')]!==_0xbd39('0x26')){_0x1c00bc['extensions'][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':_0xbd39('0x15'),'appdata':_0xbd39('0x27'),'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0]['exten'],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});_0x1c00bc[_0xbd39('0x11')][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0]['type'],'app':'Set','appdata':_0xbd39('0x28')+_0x1c00bc['extension'][_0xbd39('0x25')]||_0xbd39('0x29'),'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0]['VoiceExtensionId']});}}_0x1c00bc[_0xbd39('0x11')][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc['priority']++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});_0x1c00bc[_0xbd39('0x11')][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0]['type'],'app':_0xbd39('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x21aa2b[_0x45d78d][0x0]['context'],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});_0x1c00bc[_0xbd39('0x11')][_0xbd39('0x1a')]({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':_0xbd39('0x15'),'appdata':_0xbd39('0x2a'),'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'priority':_0x1c00bc[_0xbd39('0x10')]++,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});for(var _0x139886=0x0,_0x181dfb=0x0;_0x139886<_0x21aa2b[_0x45d78d][_0xbd39('0x2b')];_0x139886+=0x1,_0x181dfb=0x0){var _0x32ffc0=_0x21aa2b[_0x45d78d][_0x139886];if(_0x32ffc0[_0xbd39('0x14')]){_0x32ffc0[_0xbd39('0x14')]=_0x32ffc0[_0xbd39('0x14')][_0xbd39('0x2c')]();}var _0x784195=[];var _0x4f8706=[];delete _0x32ffc0['id'];delete _0x32ffc0[_0xbd39('0x2d')];delete _0x32ffc0['updatedAt'];var _0x294017=_0x32ffc0[_0xbd39('0x2e')]!==_0xbd39('0x2f')?[_0x32ffc0['interval']]:_0x32ffc0['IntervalId']?_[_0xbd39('0x9')](_[_0xbd39('0xb')](_0x1c00bc[_0xbd39('0x5')],{'IntervalId':_0x32ffc0[_0xbd39('0x30')]}),_0xbd39('0x2e')):[];if(_0x32ffc0['hasOwnProperty'](_0xbd39('0x31'))){if(_0x32ffc0[_0xbd39('0x31')]&&_0x32ffc0[_0xbd39('0x31')]!=='--'){_0x784195[_0xbd39('0x1a')]({'type':_0x32ffc0[_0xbd39('0x14')],'app':'Set','appdata':_0xbd39('0x32')+_0x32ffc0['tag'],'context':_0x32ffc0['context'],'exten':_0x32ffc0['exten'],'priority':_0x294017[_0xbd39('0x2b')]+_0x1c00bc[_0xbd39('0x10')]+_0x181dfb++,'VoiceExtensionId':_0x32ffc0[_0xbd39('0x18')]});}}if(_0x32ffc0[_0xbd39('0x14')]===_0xbd39('0x1c')&&_0x32ffc0[_0xbd39('0x33')]('callerID')){if(_0x32ffc0[_0xbd39('0x34')]){_0x784195[_0xbd39('0x1a')]({'type':_0x32ffc0['type'],'app':_0xbd39('0x35'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x32ffc0[_0xbd39('0x34')]+')','context':_0x32ffc0['context'],'exten':_0x32ffc0[_0xbd39('0xd')],'priority':_0x294017[_0xbd39('0x2b')]+_0x1c00bc[_0xbd39('0x10')]+_0x181dfb++,'VoiceExtensionId':_0x32ffc0[_0xbd39('0x18')]});}else{_0x784195[_0xbd39('0x1a')]({'type':_0x32ffc0[_0xbd39('0x14')],'app':_0xbd39('0x35'),'appdata':_0xbd39('0x36'),'context':_0x32ffc0[_0xbd39('0x17')],'exten':_0x32ffc0[_0xbd39('0xd')],'priority':_0x294017[_0xbd39('0x2b')]+_0x1c00bc[_0xbd39('0x10')]+_0x181dfb++,'VoiceExtensionId':_0x32ffc0[_0xbd39('0x18')]});}}if(_0x32ffc0[_0xbd39('0x33')](_0xbd39('0x37'))){if(_0x15fa44['indexOf'](_0x32ffc0[_0xbd39('0x38')]['toLowerCase']())>=0x0&&_0x32ffc0[_0xbd39('0x39')]!==_0xbd39('0x3a')){if(_0x32ffc0['answer']){_0x784195[_0xbd39('0x1a')]({'type':_0x32ffc0[_0xbd39('0x14')],'app':_0xbd39('0x35'),'appdata':_0xbd39('0x3b'),'context':_0x32ffc0['context'],'exten':_0x32ffc0[_0xbd39('0xd')],'priority':_0x294017[_0xbd39('0x2b')]+_0x1c00bc[_0xbd39('0x10')]+_0x181dfb++,'VoiceExtensionId':_0x32ffc0[_0xbd39('0x18')]});_0x784195[_0xbd39('0x1a')]({'type':_0x32ffc0[_0xbd39('0x14')],'app':'Set','appdata':_0xbd39('0x3c'),'context':_0x32ffc0['context'],'exten':_0x32ffc0[_0xbd39('0xd')],'priority':_0x294017[_0xbd39('0x2b')]+_0x1c00bc[_0xbd39('0x10')]+_0x181dfb++,'VoiceExtensionId':_0x32ffc0['VoiceExtensionId']});}else{_0x784195[_0xbd39('0x1a')]({'type':_0x32ffc0[_0xbd39('0x14')],'app':_0xbd39('0x35'),'appdata':_0xbd39('0x3d'),'context':_0x32ffc0['context'],'exten':_0x32ffc0['exten'],'priority':_0x294017[_0xbd39('0x2b')]+_0x1c00bc[_0xbd39('0x10')]+_0x181dfb++,'VoiceExtensionId':_0x32ffc0['VoiceExtensionId']});_0x784195['push']({'type':_0x32ffc0['type'],'app':_0xbd39('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x32ffc0['context'],'exten':_0x32ffc0['exten'],'priority':_0x294017[_0xbd39('0x2b')]+_0x1c00bc[_0xbd39('0x10')]+_0x181dfb++,'VoiceExtensionId':_0x32ffc0['VoiceExtensionId']});}}}for(var _0x40a721=0x0;_0x40a721<_0x294017['length'];_0x40a721+=0x1){var _0x747355=_0x1c00bc[_0xbd39('0x10')]+_0x294017[_0xbd39('0x2b')];var _0xd1a318=_0x40a721===_0x294017[_0xbd39('0x2b')]-0x1?_0x1c00bc[_0xbd39('0x10')]+_0x784195[_0xbd39('0x2b')]+_0x4f8706[_0xbd39('0x2b')]+0x2:_0x1c00bc[_0xbd39('0x10')]+_0x40a721+0x1;_0x784195[_0xbd39('0x3e')](_0x40a721,0x0,{'type':_0x32ffc0[_0xbd39('0x14')],'app':_0xbd39('0x3f'),'appdata':_0x294017[_0x40a721]+'?'+_0x32ffc0['context']+_0xbd39('0x40')+_0x747355+':'+_0x32ffc0[_0xbd39('0x17')]+_0xbd39('0x40')+_0xd1a318,'exten':_0x32ffc0[_0xbd39('0xd')],'context':_0x32ffc0[_0xbd39('0x17')],'priority':_0x1c00bc[_0xbd39('0x10')]+_0x40a721,'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});}_0x32ffc0[_0xbd39('0x10')]=_0x784195[_0xbd39('0x2b')]?_[_0xbd39('0x41')](_0x784195)[_0xbd39('0x10')]+0x1:_0x1c00bc[_0xbd39('0x10')];_0x1c00bc[_0xbd39('0x10')]=(_0x4f8706[_0xbd39('0x2b')]?_[_0xbd39('0x41')](_0x4f8706)[_0xbd39('0x10')]:_0x32ffc0[_0xbd39('0x10')])+0x1;_0x1c00bc[_0xbd39('0x11')]=_['concat'](_0x1c00bc['extensions'],_0x784195,[_0x32ffc0],_0x4f8706);}_0x1c00bc[_0xbd39('0x11')]['push']({'type':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x14')],'app':'Hangup','exten':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0xd')],'context':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x17')],'priority':_0x1c00bc['priority'],'VoiceExtensionId':_0x21aa2b[_0x45d78d][0x0][_0xbd39('0x18')]});_0xdd79ff[_0xbd39('0x1a')](_0x21aa2b[_0x45d78d][0x0]['VoiceExtensionId']);_0x4b7707=_[_0xbd39('0x42')](_0x4b7707,_0x1c00bc[_0xbd39('0x11')]);}}return _0xa41c31['transaction'](function(_0x3f118c){return _0xa41c31['models'][_0xbd39('0x6')][_0xbd39('0x43')]({'where':{'VoiceExtensionId':{'$in':_0xdd79ff}},'transaction':_0x3f118c})[_0xbd39('0x7')](function(_0xc9461c){return _0xa41c31[_0xbd39('0x2')][_0xbd39('0x6')][_0xbd39('0x44')](_['sortBy'](_0x4b7707,'priority'),{'transaction':_0x3f118c});});});})[_0xbd39('0x45')](function(_0x5ee8e0){console[_0xbd39('0x46')](_0x5ee8e0);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 5461c79..8a0b41c 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 _0x4b27=['where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','from','cm_hopper_final','ContactId','id\x20IN\x20?','str','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','Lists','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','outbound','BlackLists','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','contact:csv_','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/logger','api','redis','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','then','catch','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','updatedAt','select','field','toString','NOW()','createdAt','cm_contacts'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x4b27,0x103));var _0x74b2=function(_0x30f08d,_0x1814c9){_0x30f08d=_0x30f08d-0x0;var _0xcee806=_0x4b27[_0x30f08d];return _0xcee806;};'use strict';var BPromise=require(_0x74b2('0x0'));var util=require(_0x74b2('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x74b2('0x2'));var Papa=require(_0x74b2('0x3'));var Redis=require('ioredis');var db=require(_0x74b2('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x74b2('0x5'))(_0x74b2('0x6'));config[_0x74b2('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74b2('0x7')]));require('../../../api/cmContact/cmContact.socket')[_0x74b2('0x8')](socket);try{if(!process[_0x74b2('0x9')][0x2]||process[_0x74b2('0x9')][0x2]===_0x74b2('0xa')||process[_0x74b2('0x9')][0x2]===_0x74b2('0xb')){throw new Error(_0x74b2('0xc'));}var FILEPATH=process[_0x74b2('0x9')][0x2];if(!process[_0x74b2('0x9')][0x3]||process['argv'][0x3]===_0x74b2('0xa')||process[_0x74b2('0x9')][0x3]===_0x74b2('0xb')||!process[_0x74b2('0x9')][0x4]||process[_0x74b2('0x9')][0x4]==='undefined'||process['argv'][0x4]===_0x74b2('0xb')){throw new Error(_0x74b2('0xd'));}var FIELDS=_[_0x74b2('0xe')](process[_0x74b2('0x9')][0x3][_0x74b2('0xf')](','),process[_0x74b2('0x9')][0x4]['split'](','));if(!process[_0x74b2('0x9')][0x5]||process[_0x74b2('0x9')][0x5]===_0x74b2('0xa')||process[_0x74b2('0x9')][0x5]===_0x74b2('0xb')){throw new Error(_0x74b2('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x74b2('0x9')][0x6]&&process[_0x74b2('0x9')][0x6]!==_0x74b2('0xa')&&process[_0x74b2('0x9')][0x6]!=='null'?process[_0x74b2('0x9')][0x6]:null;var DUPLICATES=process[_0x74b2('0x9')][0x7]&&process['argv'][0x7]!==_0x74b2('0xa')&&process[_0x74b2('0x9')][0x7]!==_0x74b2('0xb')?process['argv'][0x7]:null;if(!process[_0x74b2('0x9')][0x8]||process[_0x74b2('0x9')][0x8]===_0x74b2('0xa')||process[_0x74b2('0x9')][0x8]==='null'){throw new Error(_0x74b2('0x11'));}var SOCKET_TIMESTAMP=process[_0x74b2('0x9')][0x8];}catch(_0x1bbcba){logger[_0x74b2('0x12')](_0x1bbcba);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(_0x373e1b,_0x2191a8,_0x209a1f,_0x580a9d){var _0x2f32b2={'message':_0x2191a8};_0x2f32b2[_0x373e1b]=!![];if(_0x209a1f){_0x2f32b2['contact']=_0x209a1f;}if(_0x580a9d){_0x2f32b2[_0x74b2('0x13')]=_0x580a9d;}return _0x2f32b2;}function isEmail(_0x3a0a6c){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))*$/[_0x74b2('0x14')](_0x3a0a6c);}function checkRow(_0x7e111d,_0x441da1,_0x5d0ac4){return new BPromise(function(_0x418b15,_0x48083e){if(_[_0x74b2('0x15')](_0x7e111d)){return _0x48083e(handleCheckRowError(_0x74b2('0x12'),_0x74b2('0x16'),null,_0x5d0ac4));}if(_0x7e111d[_0x74b2('0x17')]&&_0x7e111d[_0x74b2('0x17')][_0x74b2('0x18')]){var _0x1b3af8=_['map'](_0x7e111d[_0x74b2('0x17')],_0x74b2('0x19'))[_0x74b2('0x1a')](';');return _0x48083e(handleCheckRowError(_0x74b2('0x12'),_0x1b3af8,null,_0x5d0ac4));}var _0x205709={};for(var _0x540947 in FIELDS){if(FIELDS[_0x74b2('0x1b')](_0x540947)&&FIELDS[_0x540947]){_0x205709[_0x540947]=_0x7e111d[_0x74b2('0x1c')][0x0][FIELDS[_0x540947]]||_0x7e111d[_0x74b2('0x1c')][0x0]['\ufeff'+FIELDS[_0x540947]];}}if(!_0x205709[_0x74b2('0x1d')]){return _0x48083e(handleCheckRowError('error',_0x74b2('0x1e'),null,_0x5d0ac4));}if(!_0x205709[_0x74b2('0x1f')]){return _0x48083e(handleCheckRowError(_0x74b2('0x12'),_0x74b2('0x20'),null,_0x5d0ac4));}if(_0x205709['birthDate']){var _0xdbec47=moment(_0x205709[_0x74b2('0x21')],_0x74b2('0x22'));if(!_0xdbec47[_0x74b2('0x23')]()){return _0x48083e(handleCheckRowError('error',_0x74b2('0x24'),null,_0x5d0ac4));}}if(_0x205709[_0x74b2('0x25')]){if(!isEmail(_0x205709[_0x74b2('0x25')])){return _0x48083e(handleCheckRowError(_0x74b2('0x12'),_0x74b2('0x26'),null,_0x5d0ac4));}}_0x205709[_0x74b2('0x27')]=LISTID;_0x205709[_0x74b2('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x74b2('0x18')]&&_0x441da1){var _0x420a37={};for(var _0x1d5220=0x0,_0xa9124b=DUPLICATES['length'];_0x1d5220<_0xa9124b;_0x1d5220+=0x1){_0x420a37[DUPLICATES[_0x1d5220]]=_0x205709[DUPLICATES[_0x1d5220]];}var _0x53923e=_[_0x74b2('0x29')](_0x441da1,_0x420a37);if(_0x53923e){return _0x48083e(handleCheckRowError('duplicate',_0x74b2('0x2a'),_0x53923e,_0x5d0ac4));}}return db['CmContact']['create'](_0x205709,{'raw':!![],'hooks':![],'fields':_['keys'](_0x205709)})[_0x74b2('0x2b')](function(_0x165e40){if(DUPLICATES&&DUPLICATES[_0x74b2('0x18')]&&_0x441da1){_0x441da1['push'](_['pick'](_0x205709,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x165e40['id'];return _0x418b15();})[_0x74b2('0x2c')](function(_0x5cd8b1){return _0x48083e(handleCheckRowError(_0x74b2('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x5cd8b1['message']||JSON['stringify'](_0x5cd8b1)),null,_0x5d0ac4));});});}function checkHopper(){function _0x2be2e5(){return function(_0x3b477f){logger[_0x74b2('0x12')](_0x74b2('0x2d'),_0x74b2('0x2e'),util[_0x74b2('0x2f')](_0x3b477f,{'showHidden':![],'depth':null}));};}var _0x335641=function(_0x14df86,_0xd05e99){var _0x45b3d1=squel[_0x74b2('0x30')]()['into'](_0x74b2('0x31'))[_0x74b2('0x32')]([_0x74b2('0x1f'),_0x74b2('0x33'),'ContactId',_0x74b2('0x27'),_0xd05e99,'createdAt',_0x74b2('0x34')],squel[_0x74b2('0x35')]()[_0x74b2('0x36')](_0x74b2('0x1f'),_0x74b2('0x1f'))[_0x74b2('0x36')]('NOW()',_0x74b2('0x33'))['field']('id','ContactId')[_0x74b2('0x36')](LISTID[_0x74b2('0x37')](),_0x74b2('0x27'))[_0x74b2('0x36')](_0x14df86['id'][_0x74b2('0x37')](),_0xd05e99)[_0x74b2('0x36')](_0x74b2('0x38'),_0x74b2('0x39'))[_0x74b2('0x36')](_0x74b2('0x38'),_0x74b2('0x34'))['from'](_0x74b2('0x3a'))[_0x74b2('0x3b')](_0x74b2('0x3c'))[_0x74b2('0x3b')](_0x74b2('0x3d'),LISTID['toString']())['where'](_0x74b2('0x3e'))[_0x74b2('0x3b')](_0x74b2('0x3f'),squel[_0x74b2('0x35')]()[_0x74b2('0x36')]('phone')['from'](_0x74b2('0x31'))[_0x74b2('0x3b')](_0xd05e99+_0x74b2('0x40'),_0x14df86['id'][_0x74b2('0x37')]())))['toString']();return _0x45b3d1;};var _0x3252d3=function(_0x469baa,_0x1ca264){var _0x594095=squel['insert']()[_0x74b2('0x41')](_0x74b2('0x31'))[_0x74b2('0x32')](['phone',_0x74b2('0x33'),'ContactId',_0x74b2('0x27'),_0x1ca264,_0x74b2('0x39'),'updatedAt'],squel[_0x74b2('0x35')]()[_0x74b2('0x36')](_0x74b2('0x1f'),_0x74b2('0x1f'))[_0x74b2('0x36')](_0x74b2('0x38'),_0x74b2('0x33'))['field']('id','ContactId')[_0x74b2('0x36')](LISTID['toString'](),_0x74b2('0x27'))[_0x74b2('0x36')](_0x469baa['id'][_0x74b2('0x37')](),_0x1ca264)['field'](_0x74b2('0x38'),_0x74b2('0x39'))[_0x74b2('0x36')]('NOW()',_0x74b2('0x34'))[_0x74b2('0x42')](_0x74b2('0x3a'))[_0x74b2('0x3b')](_0x74b2('0x3c'))[_0x74b2('0x3b')](_0x74b2('0x3d'),LISTID['toString']())[_0x74b2('0x3b')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0x74b2('0x3e'))[_0x74b2('0x3b')](_0x74b2('0x3f'),squel['select']()[_0x74b2('0x36')]('calleridnum')[_0x74b2('0x42')](_0x74b2('0x43'))[_0x74b2('0x3b')](_0x1ca264+_0x74b2('0x40'),_0x469baa['id']['toString']()))[_0x74b2('0x3b')](_0x74b2('0x3f'),squel[_0x74b2('0x35')]()[_0x74b2('0x36')]('phone')[_0x74b2('0x42')](_0x74b2('0x31'))[_0x74b2('0x3b')](_0x1ca264+'\x20=\x20?',_0x469baa['id'][_0x74b2('0x37')]())))[_0x74b2('0x37')]();return _0x594095;};function _0x577830(_0x287155,_0x3c6da7){var _0x2de886=squel[_0x74b2('0x30')]()[_0x74b2('0x41')](_0x74b2('0x31'))['fromQuery']([_0x74b2('0x1f'),'scheduledAt',_0x74b2('0x44'),_0x74b2('0x27'),_0x3c6da7,_0x74b2('0x39'),_0x74b2('0x34')],squel[_0x74b2('0x35')]()[_0x74b2('0x36')](_0x74b2('0x1f'),_0x74b2('0x1f'))[_0x74b2('0x36')]('NOW()',_0x74b2('0x33'))[_0x74b2('0x36')]('id',_0x74b2('0x44'))['field'](LISTID[_0x74b2('0x37')](),_0x74b2('0x27'))[_0x74b2('0x36')](_0x287155['id'][_0x74b2('0x37')](),_0x3c6da7)[_0x74b2('0x36')](_0x74b2('0x38'),_0x74b2('0x39'))[_0x74b2('0x36')]('NOW()',_0x74b2('0x34'))[_0x74b2('0x42')]('cm_contacts')[_0x74b2('0x3b')](_0x74b2('0x3c'))[_0x74b2('0x3b')](_0x74b2('0x3d'),LISTID[_0x74b2('0x37')]())['where'](_0x74b2('0x45'),squel[_0x74b2('0x46')](hopperContacts))['where'](_0x74b2('0x3e')))[_0x74b2('0x37')]();return _0x2de886;}function _0x364d8b(_0x219c79,_0x38cdba){var _0x59e8d4=squel[_0x74b2('0x30')]()['into'](_0x74b2('0x47'))[_0x74b2('0x32')]([_0x74b2('0x1f'),_0x74b2('0x44'),_0x74b2('0x27'),_0x38cdba,_0x74b2('0x39'),'updatedAt'],squel[_0x74b2('0x35')]()[_0x74b2('0x36')]('phone',_0x74b2('0x1f'))[_0x74b2('0x36')]('id',_0x74b2('0x44'))[_0x74b2('0x36')](LISTID['toString'](),'ListId')[_0x74b2('0x36')](_0x219c79['id'][_0x74b2('0x37')](),_0x38cdba)['field'](_0x74b2('0x38'),'createdAt')[_0x74b2('0x36')](_0x74b2('0x38'),'updatedAt')[_0x74b2('0x42')](_0x74b2('0x3a'))[_0x74b2('0x3b')](_0x74b2('0x3c'))[_0x74b2('0x3b')]('ListId\x20=\x20?',LISTID['toString']())[_0x74b2('0x3b')](_0x74b2('0x45'),squel[_0x74b2('0x46')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x74b2('0x37')]();return _0x59e8d4;}return db['VoiceQueue'][_0x74b2('0x48')]({'where':{'type':'outbound'},'attributes':['id',_0x74b2('0x49')],'include':[{'model':db[_0x74b2('0x4a')],'as':_0x74b2('0x4b'),'where':{'id':LISTID}}]})[_0x74b2('0x2b')](function(_0x45bf9b){var _0x3d9b28=[];if(_0x45bf9b){var _0x1542f3;for(var _0x2224e1=0x0,_0x208d59;_0x2224e1<_0x45bf9b[_0x74b2('0x18')];_0x2224e1+=0x1){_0x208d59=_0x45bf9b[_0x2224e1][_0x74b2('0x4c')]({'plain':!![]});switch(_0x208d59[_0x74b2('0x49')]){case'always':_0x3d9b28[_0x74b2('0x4d')](db[_0x74b2('0x4e')][_0x74b2('0x4f')](_0x3252d3(_0x208d59,_0x74b2('0x50')))[_0x74b2('0x2b')](function(){})[_0x74b2('0x2c')](_0x2be2e5()));break;case _0x74b2('0x51'):_0x3d9b28[_0x74b2('0x4d')](db[_0x74b2('0x4e')][_0x74b2('0x4f')](_0x335641(_0x208d59,_0x74b2('0x50')))[_0x74b2('0x2b')](function(){})[_0x74b2('0x2c')](_0x2be2e5()));break;default:_0x3d9b28[_0x74b2('0x4d')](db[_0x74b2('0x4e')][_0x74b2('0x4f')](_0x577830(_0x208d59,_0x74b2('0x50')))['then'](function(){})['catch'](_0x2be2e5()));}}}return _0x3d9b28;})[_0x74b2('0x52')]()[_0x74b2('0x2b')](function(){return db[_0x74b2('0x53')][_0x74b2('0x48')]({'where':{'type':_0x74b2('0x54')},'attributes':['id'],'include':[{'model':db[_0x74b2('0x4a')],'as':_0x74b2('0x55'),'where':{'id':LISTID}}]})[_0x74b2('0x2b')](function(_0x13d31f){var _0x25a373=[];if(_0x13d31f){var _0x114993;for(var _0x368ef0=0x0,_0x4e1792;_0x368ef0<_0x13d31f[_0x74b2('0x18')];_0x368ef0+=0x1){_0x4e1792=_0x13d31f[_0x368ef0][_0x74b2('0x4c')]({'plain':!![]});_0x25a373[_0x74b2('0x4d')](db[_0x74b2('0x4e')]['query'](_0x364d8b(_0x4e1792,'VoiceQueueId'))['then'](function(){})[_0x74b2('0x2c')](_0x2be2e5()));}}return _0x25a373;})[_0x74b2('0x52')]();})[_0x74b2('0x2b')](function(){return db[_0x74b2('0x56')][_0x74b2('0x48')]({'attributes':['id',_0x74b2('0x49')],'include':[{'model':db[_0x74b2('0x4a')],'as':_0x74b2('0x4b'),'where':{'id':LISTID}}]})[_0x74b2('0x2b')](function(_0x263ee1){var _0x49b70f=[];if(_0x263ee1){for(var _0x25269b=0x0,_0x4dc509;_0x25269b<_0x263ee1[_0x74b2('0x18')];_0x25269b+=0x1){_0x4dc509=_0x263ee1[_0x25269b][_0x74b2('0x4c')]({'plain':!![]});switch(_0x4dc509[_0x74b2('0x49')]){case'always':_0x49b70f['push'](db[_0x74b2('0x4e')][_0x74b2('0x4f')](_0x3252d3(_0x4dc509,_0x74b2('0x57')))['then'](function(){})[_0x74b2('0x2c')](_0x2be2e5()));break;case _0x74b2('0x51'):_0x49b70f[_0x74b2('0x4d')](db[_0x74b2('0x4e')][_0x74b2('0x4f')](_0x335641(_0x4dc509,'CampaignId'))[_0x74b2('0x2b')](function(){})[_0x74b2('0x2c')](_0x2be2e5()));break;default:_0x49b70f[_0x74b2('0x4d')](db['sequelize'][_0x74b2('0x4f')](_0x577830(_0x4dc509,'CampaignId'))[_0x74b2('0x2b')](function(){})[_0x74b2('0x2c')](_0x2be2e5()));}}}return _0x49b70f;})[_0x74b2('0x52')]();})[_0x74b2('0x2b')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x74b2('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x220634){var _0x15b80d=[];if(_0x220634){for(var _0x5e7968=0x0,_0x13dc0b;_0x5e7968<_0x220634['length'];_0x5e7968+=0x1){_0x13dc0b=_0x220634[_0x5e7968]['get']({'plain':!![]});_0x15b80d[_0x74b2('0x4d')](db[_0x74b2('0x4e')]['query'](_0x364d8b(_0x13dc0b,'CampaignId'))[_0x74b2('0x2b')](function(){})[_0x74b2('0x2c')](_0x2be2e5()));}}return _0x15b80d;})[_0x74b2('0x52')]();})[_0x74b2('0x2c')](function(_0x519934){logger['error']('cmContact,\x20%s,\x20%s',_0x74b2('0x58'),_0x519934[_0x74b2('0x19')]);});}var processPromises=function(_0x5b0c97){return BPromise[_0x74b2('0x52')](promises)[_0x74b2('0x2b')](function(_0x579464){})[_0x74b2('0x2c')](function(_0x4a6420){logger[_0x74b2('0x12')](_0x74b2('0x59'),JSON[_0x74b2('0x5a')](_0x4a6420));})[_0x74b2('0x5b')](function(){socket['emit'](_0x74b2('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5b0c97){return _0x5b0c97['resume']();}});};var endCsv=function(){return BPromise[_0x74b2('0x5d')]()[_0x74b2('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x74b2('0x2b')](function(){socket[_0x74b2('0x5e')](_0x74b2('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x99dccd){logger[_0x74b2('0x12')](_0x74b2('0x5f'),JSON[_0x74b2('0x5a')](_0x99dccd));}finally{process[_0x74b2('0x60')](0x0);}});};process['on']('SIGINT',function(){logger[_0x74b2('0x61')](_0x74b2('0x62'));endCsv();});function main(){return BPromise['resolve']()[_0x74b2('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x74b2('0xf')](',');return db['CmContact'][_0x74b2('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x74b2('0x2b')](function(_0x17ddc2){var _0x3d709f=fs[_0x74b2('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x74b2('0x64')](_0x3d709f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x575641,_0x5f4b54){total+=0x1;var _0x57557d=total;promises[_0x74b2('0x4d')](checkRow(_0x575641,_0x17ddc2,_0x57557d)[_0x74b2('0x2b')](function(){success+=0x1;})['catch'](function(_0x31c6e9){if(_0x31c6e9[_0x74b2('0x12')]){errors+=0x1;delete _0x31c6e9['error'];}else if(_0x31c6e9[_0x74b2('0x65')]){duplicates+=0x1;delete _0x31c6e9[_0x74b2('0x65')];}rows['push'](_0x31c6e9);}));if(total%0xc8===0x0){_0x5f4b54[_0x74b2('0x66')]();return processPromises(_0x5f4b54);}},'complete':function(){return processPromises()[_0x74b2('0x2b')](function(){logger[_0x74b2('0x61')](_0x74b2('0x67'));endCsv();});},'error':function(_0x2433fe,_0x51521a){logger[_0x74b2('0x61')](_0x74b2('0x68'),JSON[_0x74b2('0x5a')](_0x2433fe));endCsv();}});})[_0x74b2('0x2c')](function(_0x3cd32a){logger[_0x74b2('0x12')](_0x74b2('0x69'),JSON[_0x74b2('0x5a')](_0x3cd32a));});}main(); \ No newline at end of file +var _0xfd8c=['VoiceQueueId','onlyIfOpen','all','outbound','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','stringify','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','from','cm_contacts','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_final','str','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xfd8c,0x103));var _0xcfd8=function(_0x1d49da,_0x4b8203){_0x1d49da=_0x1d49da-0x0;var _0x206b1d=_0xfd8c[_0x1d49da];return _0x206b1d;};'use strict';var BPromise=require(_0xcfd8('0x0'));var util=require(_0xcfd8('0x1'));var _=require(_0xcfd8('0x2'));var fs=require('fs');var squel=require(_0xcfd8('0x3'));var Papa=require(_0xcfd8('0x4'));var Redis=require(_0xcfd8('0x5'));var db=require(_0xcfd8('0x6'))['db'];var config=require(_0xcfd8('0x7'));var logger=require(_0xcfd8('0x8'))(_0xcfd8('0x9'));config[_0xcfd8('0xa')]=_[_0xcfd8('0xb')](config['redis'],{'host':_0xcfd8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfd8('0xa')]));require(_0xcfd8('0xd'))[_0xcfd8('0xe')](socket);try{if(!process[_0xcfd8('0xf')][0x2]||process['argv'][0x2]===_0xcfd8('0x10')||process['argv'][0x2]===_0xcfd8('0x11')){throw new Error(_0xcfd8('0x12'));}var FILEPATH=process[_0xcfd8('0xf')][0x2];if(!process[_0xcfd8('0xf')][0x3]||process['argv'][0x3]===_0xcfd8('0x10')||process['argv'][0x3]===_0xcfd8('0x11')||!process[_0xcfd8('0xf')][0x4]||process['argv'][0x4]===_0xcfd8('0x10')||process[_0xcfd8('0xf')][0x4]===_0xcfd8('0x11')){throw new Error(_0xcfd8('0x13'));}var FIELDS=_[_0xcfd8('0x14')](process[_0xcfd8('0xf')][0x3][_0xcfd8('0x15')](','),process['argv'][0x4][_0xcfd8('0x15')](','));if(!process['argv'][0x5]||process[_0xcfd8('0xf')][0x5]==='undefined'||process[_0xcfd8('0xf')][0x5]==='null'){throw new Error(_0xcfd8('0x16'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xcfd8('0xf')][0x6]&&process[_0xcfd8('0xf')][0x6]!==_0xcfd8('0x10')&&process[_0xcfd8('0xf')][0x6]!==_0xcfd8('0x11')?process[_0xcfd8('0xf')][0x6]:null;var DUPLICATES=process[_0xcfd8('0xf')][0x7]&&process['argv'][0x7]!==_0xcfd8('0x10')&&process[_0xcfd8('0xf')][0x7]!==_0xcfd8('0x11')?process[_0xcfd8('0xf')][0x7]:null;if(!process[_0xcfd8('0xf')][0x8]||process[_0xcfd8('0xf')][0x8]===_0xcfd8('0x10')||process[_0xcfd8('0xf')][0x8]===_0xcfd8('0x11')){throw new Error(_0xcfd8('0x17'));}var SOCKET_TIMESTAMP=process[_0xcfd8('0xf')][0x8];}catch(_0x382f31){logger[_0xcfd8('0x18')](_0x382f31);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(_0x32418d,_0x58f7f3,_0x3301ee,_0xca910a){var _0xa4bb87={'message':_0x58f7f3};_0xa4bb87[_0x32418d]=!![];if(_0x3301ee){_0xa4bb87[_0xcfd8('0x19')]=_0x3301ee;}if(_0xca910a){_0xa4bb87[_0xcfd8('0x1a')]=_0xca910a;}return _0xa4bb87;}function isEmail(_0x210cf3){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))*$/[_0xcfd8('0x1b')](_0x210cf3);}function checkRow(_0xe1b2d9,_0x4acf24,_0xfe9bcd){return new BPromise(function(_0x58b8a3,_0x5d0a69){if(_[_0xcfd8('0x1c')](_0xe1b2d9)){return _0x5d0a69(handleCheckRowError(_0xcfd8('0x18'),_0xcfd8('0x1d'),null,_0xfe9bcd));}if(_0xe1b2d9[_0xcfd8('0x1e')]&&_0xe1b2d9[_0xcfd8('0x1e')][_0xcfd8('0x1f')]){var _0x4f02b5=_[_0xcfd8('0x20')](_0xe1b2d9[_0xcfd8('0x1e')],_0xcfd8('0x21'))[_0xcfd8('0x22')](';');return _0x5d0a69(handleCheckRowError(_0xcfd8('0x18'),_0x4f02b5,null,_0xfe9bcd));}var _0x35b984={};for(var _0x5434b5 in FIELDS){if(FIELDS[_0xcfd8('0x23')](_0x5434b5)&&FIELDS[_0x5434b5]){_0x35b984[_0x5434b5]=_0xe1b2d9[_0xcfd8('0x24')][0x0][FIELDS[_0x5434b5]]||_0xe1b2d9[_0xcfd8('0x24')][0x0]['\ufeff'+FIELDS[_0x5434b5]];}}if(!_0x35b984['firstName']){return _0x5d0a69(handleCheckRowError(_0xcfd8('0x18'),_0xcfd8('0x25'),null,_0xfe9bcd));}if(!_0x35b984[_0xcfd8('0x26')]){return _0x5d0a69(handleCheckRowError(_0xcfd8('0x18'),_0xcfd8('0x27'),null,_0xfe9bcd));}if(_0x35b984[_0xcfd8('0x28')]){var _0x235f2c=moment(_0x35b984['birthDate'],_0xcfd8('0x29'));if(!_0x235f2c['isValid']()){return _0x5d0a69(handleCheckRowError(_0xcfd8('0x18'),_0xcfd8('0x2a'),null,_0xfe9bcd));}}if(_0x35b984[_0xcfd8('0x2b')]){if(!isEmail(_0x35b984['email'])){return _0x5d0a69(handleCheckRowError('error',_0xcfd8('0x2c'),null,_0xfe9bcd));}}_0x35b984[_0xcfd8('0x2d')]=LISTID;_0x35b984[_0xcfd8('0x2e')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcfd8('0x1f')]&&_0x4acf24){var _0x1b6778={};for(var _0x72838e=0x0,_0xe1e434=DUPLICATES[_0xcfd8('0x1f')];_0x72838e<_0xe1e434;_0x72838e+=0x1){_0x1b6778[DUPLICATES[_0x72838e]]=_0x35b984[DUPLICATES[_0x72838e]];}var _0x4ad846=_[_0xcfd8('0x2f')](_0x4acf24,_0x1b6778);if(_0x4ad846){return _0x5d0a69(handleCheckRowError('duplicate',_0xcfd8('0x30'),_0x4ad846,_0xfe9bcd));}}return db[_0xcfd8('0x31')][_0xcfd8('0x32')](_0x35b984,{'raw':!![],'hooks':![],'fields':_[_0xcfd8('0x33')](_0x35b984)})[_0xcfd8('0x34')](function(_0x3f38a5){if(DUPLICATES&&DUPLICATES[_0xcfd8('0x1f')]&&_0x4acf24){_0x4acf24[_0xcfd8('0x35')](_[_0xcfd8('0x36')](_0x35b984,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3f38a5['id'];return _0x58b8a3();})[_0xcfd8('0x37')](function(_0x114bce){return _0x5d0a69(handleCheckRowError(_0xcfd8('0x18'),_0xcfd8('0x38')+(_0x114bce['message']||JSON['stringify'](_0x114bce)),null,_0xfe9bcd));});});}function checkHopper(){function _0x263be0(){return function(_0x3bc2f7){logger['error']('cmContact',_0xcfd8('0x39'),util[_0xcfd8('0x3a')](_0x3bc2f7,{'showHidden':![],'depth':null}));};}var _0x4d22f6=function(_0x150d6b,_0x2f9b4d){var _0x5dd81e=squel[_0xcfd8('0x3b')]()[_0xcfd8('0x3c')](_0xcfd8('0x3d'))[_0xcfd8('0x3e')]([_0xcfd8('0x26'),_0xcfd8('0x3f'),_0xcfd8('0x40'),'ListId',_0x2f9b4d,_0xcfd8('0x41'),_0xcfd8('0x42')],squel[_0xcfd8('0x43')]()[_0xcfd8('0x44')](_0xcfd8('0x26'),_0xcfd8('0x26'))[_0xcfd8('0x44')](_0xcfd8('0x45'),'scheduledAt')[_0xcfd8('0x44')]('id',_0xcfd8('0x40'))[_0xcfd8('0x44')](LISTID[_0xcfd8('0x46')](),_0xcfd8('0x2d'))[_0xcfd8('0x44')](_0x150d6b['id'][_0xcfd8('0x46')](),_0x2f9b4d)['field'](_0xcfd8('0x45'),'createdAt')[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x42'))['from']('cm_contacts')[_0xcfd8('0x47')](_0xcfd8('0x48'))[_0xcfd8('0x47')]('ListId\x20=\x20?',LISTID[_0xcfd8('0x46')]())['where'](_0xcfd8('0x49'))[_0xcfd8('0x47')](_0xcfd8('0x4a'),squel[_0xcfd8('0x43')]()[_0xcfd8('0x44')]('phone')['from']('cm_hopper')[_0xcfd8('0x47')](_0x2f9b4d+_0xcfd8('0x4b'),_0x150d6b['id'][_0xcfd8('0x46')]())))[_0xcfd8('0x46')]();return _0x5dd81e;};var _0x415bc7=function(_0x7ec3d5,_0x426ee7){var _0x265cd3=squel[_0xcfd8('0x3b')]()[_0xcfd8('0x3c')](_0xcfd8('0x3d'))[_0xcfd8('0x3e')]([_0xcfd8('0x26'),_0xcfd8('0x3f'),'ContactId',_0xcfd8('0x2d'),_0x426ee7,_0xcfd8('0x41'),_0xcfd8('0x42')],squel['select']()[_0xcfd8('0x44')](_0xcfd8('0x26'),_0xcfd8('0x26'))[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x3f'))[_0xcfd8('0x44')]('id','ContactId')[_0xcfd8('0x44')](LISTID[_0xcfd8('0x46')](),_0xcfd8('0x2d'))[_0xcfd8('0x44')](_0x7ec3d5['id']['toString'](),_0x426ee7)['field'](_0xcfd8('0x45'),'createdAt')[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x42'))[_0xcfd8('0x4c')](_0xcfd8('0x4d'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xcfd8('0x4e'),LISTID[_0xcfd8('0x46')]())[_0xcfd8('0x47')](_0xcfd8('0x4f'),squel['str'](hopperContacts))[_0xcfd8('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0xcfd8('0x47')](_0xcfd8('0x4a'),squel[_0xcfd8('0x43')]()['field']('calleridnum')['from'](_0xcfd8('0x50'))[_0xcfd8('0x47')](_0x426ee7+'\x20=\x20?',_0x7ec3d5['id'][_0xcfd8('0x46')]()))[_0xcfd8('0x47')](_0xcfd8('0x4a'),squel['select']()['field'](_0xcfd8('0x26'))['from'](_0xcfd8('0x3d'))[_0xcfd8('0x47')](_0x426ee7+_0xcfd8('0x4b'),_0x7ec3d5['id'][_0xcfd8('0x46')]())))[_0xcfd8('0x46')]();return _0x265cd3;};function _0x229d64(_0x34bb51,_0x2a8477){var _0x3e24b7=squel[_0xcfd8('0x3b')]()[_0xcfd8('0x3c')](_0xcfd8('0x3d'))['fromQuery']([_0xcfd8('0x26'),_0xcfd8('0x3f'),_0xcfd8('0x40'),_0xcfd8('0x2d'),_0x2a8477,_0xcfd8('0x41'),'updatedAt'],squel[_0xcfd8('0x43')]()[_0xcfd8('0x44')](_0xcfd8('0x26'),_0xcfd8('0x26'))[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x3f'))[_0xcfd8('0x44')]('id',_0xcfd8('0x40'))[_0xcfd8('0x44')](LISTID[_0xcfd8('0x46')](),_0xcfd8('0x2d'))[_0xcfd8('0x44')](_0x34bb51['id'][_0xcfd8('0x46')](),_0x2a8477)[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x41'))[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x42'))[_0xcfd8('0x4c')](_0xcfd8('0x4d'))[_0xcfd8('0x47')](_0xcfd8('0x48'))[_0xcfd8('0x47')](_0xcfd8('0x4e'),LISTID[_0xcfd8('0x46')]())[_0xcfd8('0x47')]('id\x20IN\x20?',squel[_0xcfd8('0x51')](hopperContacts))[_0xcfd8('0x47')](_0xcfd8('0x49')))[_0xcfd8('0x46')]();return _0x3e24b7;}function _0x3f280c(_0x3c6a72,_0x2e0cf3){var _0x2e710f=squel[_0xcfd8('0x3b')]()[_0xcfd8('0x3c')](_0xcfd8('0x52'))[_0xcfd8('0x3e')]([_0xcfd8('0x26'),'ContactId',_0xcfd8('0x2d'),_0x2e0cf3,'createdAt',_0xcfd8('0x42')],squel['select']()[_0xcfd8('0x44')](_0xcfd8('0x26'),'phone')[_0xcfd8('0x44')]('id',_0xcfd8('0x40'))['field'](LISTID[_0xcfd8('0x46')](),_0xcfd8('0x2d'))[_0xcfd8('0x44')](_0x3c6a72['id']['toString'](),_0x2e0cf3)[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x41'))[_0xcfd8('0x44')](_0xcfd8('0x45'),_0xcfd8('0x42'))[_0xcfd8('0x4c')](_0xcfd8('0x4d'))['where'](_0xcfd8('0x48'))[_0xcfd8('0x47')](_0xcfd8('0x4e'),LISTID[_0xcfd8('0x46')]())[_0xcfd8('0x47')](_0xcfd8('0x4f'),squel['str'](hopperContacts))[_0xcfd8('0x47')](_0xcfd8('0x49')))[_0xcfd8('0x46')]();return _0x2e710f;}return db[_0xcfd8('0x53')][_0xcfd8('0x54')]({'where':{'type':'outbound'},'attributes':['id',_0xcfd8('0x55')],'include':[{'model':db[_0xcfd8('0x56')],'as':_0xcfd8('0x57'),'where':{'id':LISTID}}]})[_0xcfd8('0x34')](function(_0x51ecae){var _0xb1a0a=[];if(_0x51ecae){var _0x1f250a;for(var _0x24a165=0x0,_0x542bd7;_0x24a165<_0x51ecae[_0xcfd8('0x1f')];_0x24a165+=0x1){_0x542bd7=_0x51ecae[_0x24a165][_0xcfd8('0x58')]({'plain':!![]});switch(_0x542bd7[_0xcfd8('0x55')]){case _0xcfd8('0x59'):_0xb1a0a[_0xcfd8('0x35')](db[_0xcfd8('0x5a')][_0xcfd8('0x5b')](_0x415bc7(_0x542bd7,_0xcfd8('0x5c')))[_0xcfd8('0x34')](function(){})[_0xcfd8('0x37')](_0x263be0()));break;case _0xcfd8('0x5d'):_0xb1a0a['push'](db[_0xcfd8('0x5a')][_0xcfd8('0x5b')](_0x4d22f6(_0x542bd7,_0xcfd8('0x5c')))[_0xcfd8('0x34')](function(){})[_0xcfd8('0x37')](_0x263be0()));break;default:_0xb1a0a[_0xcfd8('0x35')](db['sequelize'][_0xcfd8('0x5b')](_0x229d64(_0x542bd7,'VoiceQueueId'))['then'](function(){})[_0xcfd8('0x37')](_0x263be0()));}}}return _0xb1a0a;})[_0xcfd8('0x5e')]()['then'](function(){return db[_0xcfd8('0x53')]['findAll']({'where':{'type':_0xcfd8('0x5f')},'attributes':['id'],'include':[{'model':db[_0xcfd8('0x56')],'as':_0xcfd8('0x60'),'where':{'id':LISTID}}]})[_0xcfd8('0x34')](function(_0x362740){var _0x272147=[];if(_0x362740){var _0x6bebf8;for(var _0x380859=0x0,_0x39592e;_0x380859<_0x362740[_0xcfd8('0x1f')];_0x380859+=0x1){_0x39592e=_0x362740[_0x380859]['get']({'plain':!![]});_0x272147['push'](db[_0xcfd8('0x5a')][_0xcfd8('0x5b')](_0x3f280c(_0x39592e,'VoiceQueueId'))[_0xcfd8('0x34')](function(){})[_0xcfd8('0x37')](_0x263be0()));}}return _0x272147;})[_0xcfd8('0x5e')]();})[_0xcfd8('0x34')](function(){return db[_0xcfd8('0x61')][_0xcfd8('0x54')]({'attributes':['id',_0xcfd8('0x55')],'include':[{'model':db[_0xcfd8('0x56')],'as':_0xcfd8('0x57'),'where':{'id':LISTID}}]})[_0xcfd8('0x34')](function(_0x11828c){var _0x282239=[];if(_0x11828c){for(var _0x1c7598=0x0,_0x50fc77;_0x1c7598<_0x11828c[_0xcfd8('0x1f')];_0x1c7598+=0x1){_0x50fc77=_0x11828c[_0x1c7598][_0xcfd8('0x58')]({'plain':!![]});switch(_0x50fc77[_0xcfd8('0x55')]){case _0xcfd8('0x59'):_0x282239[_0xcfd8('0x35')](db['sequelize'][_0xcfd8('0x5b')](_0x415bc7(_0x50fc77,_0xcfd8('0x62')))[_0xcfd8('0x34')](function(){})[_0xcfd8('0x37')](_0x263be0()));break;case'onlyIfOpen':_0x282239[_0xcfd8('0x35')](db[_0xcfd8('0x5a')]['query'](_0x4d22f6(_0x50fc77,_0xcfd8('0x62')))[_0xcfd8('0x34')](function(){})[_0xcfd8('0x37')](_0x263be0()));break;default:_0x282239[_0xcfd8('0x35')](db[_0xcfd8('0x5a')][_0xcfd8('0x5b')](_0x229d64(_0x50fc77,'CampaignId'))['then'](function(){})['catch'](_0x263be0()));}}}return _0x282239;})[_0xcfd8('0x5e')]();})[_0xcfd8('0x34')](function(){return db[_0xcfd8('0x61')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xcfd8('0x56')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x4b56dd){var _0x257c7b=[];if(_0x4b56dd){for(var _0x1358fb=0x0,_0x30804a;_0x1358fb<_0x4b56dd[_0xcfd8('0x1f')];_0x1358fb+=0x1){_0x30804a=_0x4b56dd[_0x1358fb][_0xcfd8('0x58')]({'plain':!![]});_0x257c7b[_0xcfd8('0x35')](db['sequelize'][_0xcfd8('0x5b')](_0x3f280c(_0x30804a,_0xcfd8('0x62')))['then'](function(){})[_0xcfd8('0x37')](_0x263be0()));}}return _0x257c7b;})[_0xcfd8('0x5e')]();})[_0xcfd8('0x37')](function(_0x4ed407){logger['error'](_0xcfd8('0x63'),'generalCheckHopper',_0x4ed407[_0xcfd8('0x21')]);});}var processPromises=function(_0xcb055f){return BPromise['all'](promises)['then'](function(_0xfbf3ca){})['catch'](function(_0x30f38f){logger[_0xcfd8('0x18')]('Error\x20processing\x20rows\x20block:',JSON[_0xcfd8('0x64')](_0x30f38f));})['finally'](function(){socket[_0xcfd8('0x65')](_0xcfd8('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xcb055f){return _0xcb055f[_0xcfd8('0x67')]();}});};var endCsv=function(){return BPromise[_0xcfd8('0x68')]()[_0xcfd8('0x34')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xcfd8('0x65')](_0xcfd8('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcfd8('0x69')](FILEPATH);}catch(_0x1964b){logger[_0xcfd8('0x18')](_0xcfd8('0x6a'),JSON['stringify'](_0x1964b));}finally{process[_0xcfd8('0x6b')](0x0);}});};process['on'](_0xcfd8('0x6c'),function(){logger['info'](_0xcfd8('0x6d'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xcfd8('0x31')][_0xcfd8('0x54')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcfd8('0x34')](function(_0x55ea3a){var _0x878544=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xcfd8('0x6e')](_0x878544,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f0aad,_0x4b493a){total+=0x1;var _0x2754ad=total;promises['push'](checkRow(_0x1f0aad,_0x55ea3a,_0x2754ad)[_0xcfd8('0x34')](function(){success+=0x1;})[_0xcfd8('0x37')](function(_0x25d47b){if(_0x25d47b[_0xcfd8('0x18')]){errors+=0x1;delete _0x25d47b[_0xcfd8('0x18')];}else if(_0x25d47b['duplicate']){duplicates+=0x1;delete _0x25d47b[_0xcfd8('0x6f')];}rows[_0xcfd8('0x35')](_0x25d47b);}));if(total%0xc8===0x0){_0x4b493a[_0xcfd8('0x70')]();return processPromises(_0x4b493a);}},'complete':function(){return processPromises()[_0xcfd8('0x34')](function(){logger[_0xcfd8('0x71')](_0xcfd8('0x72'));endCsv();});},'error':function(_0x2f0c71,_0x111846){logger['info'](_0xcfd8('0x73'),JSON[_0xcfd8('0x64')](_0x2f0c71));endCsv();}});})[_0xcfd8('0x37')](function(_0x19c670){logger['error'](_0xcfd8('0x74'),JSON[_0xcfd8('0x64')](_0x19c670));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d7c415a..1bc7387 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 _0xb9f4=['ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','timezones','firstName','itemTypeId','description','SystemRow','appendFileSync','contact:import:','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','orderBy','voice_queues','voice_queues_has_cm_blacklists','CampaignId','VoiceQueueId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','lodash','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','split','length','push','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','insert','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.ListId','into','cm_hopper_black','fields','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','cm_contacts.UserId','.CmListId\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','error','message','exit','errors','code','sequelize','query','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','spread','all','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','main','stringify','send','start','socket_timestamp','.csv','header'];(function(_0x1ff237,_0x2c1bb1){var _0x5cec4e=function(_0x2ffee9){while(--_0x2ffee9){_0x1ff237['push'](_0x1ff237['shift']());}};_0x5cec4e(++_0x2c1bb1);}(_0xb9f4,0xf4));var _0x4b9f=function(_0x105452,_0x393960){_0x105452=_0x105452-0x0;var _0x18d17f=_0xb9f4[_0x105452];return _0x18d17f;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4b9f('0x0'));var Papa=require('papaparse');var util=require(_0x4b9f('0x1'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x4b9f('0x2'));var Redis=require(_0x4b9f('0x3'));var db=require(_0x4b9f('0x4'))['db'];var config=require(_0x4b9f('0x5'));var shared=require('../../../config/environment/shared');var logger=require(_0x4b9f('0x6'))(_0x4b9f('0x7'));config[_0x4b9f('0x8')]=_[_0x4b9f('0x9')](config[_0x4b9f('0x8')],{'host':_0x4b9f('0xa'),'port':0x18eb});var socket=require(_0x4b9f('0xb'))(new Redis(config[_0x4b9f('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x4b9f('0xc')]('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()[_0x4b9f('0xc')](_0x4b9f('0xd'));function isEmail(_0x32b87d){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))*$/[_0x4b9f('0xe')](_0x32b87d);}function selectNotIn(_0x2053ac,_0x1a1856,_0x4e8bfd,_0x389a7c,_0x29b4d2){return squel[_0x4b9f('0xf')]()[_0x4b9f('0x10')](_0x4b9f('0x11'))[_0x4b9f('0x12')](_0x389a7c)[_0x4b9f('0x13')](_0x1a1856,null,_0x1a1856+_0x4b9f('0x14')+_0x389a7c+'.'+_0x4e8bfd)[_0x4b9f('0x15')](_0x389a7c+'.'+_0x4e8bfd+_0x4b9f('0x16')+_0x2053ac+'.'+_0x4e8bfd)[_0x4b9f('0x15')](_0x1a1856+_0x4b9f('0x17')+_0x29b4d2['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1c07c3,_0x5051de){promisesAdditionalPhones=[];return db[_0x4b9f('0x18')][_0x4b9f('0x19')]({'raw':!![],'attributes':['id',_0x4b9f('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x4b9f('0x1b')](function(_0x1276f1){if(_0x1276f1!==null){var _0x3a676c=[];for(var _0x4c1690=0x0;_0x4c1690<_0x1276f1['length'];_0x4c1690++){var _0x354e26=_0x1276f1[_0x4c1690];_0x3a676c['push'](insertAdditionalPhones(_0x354e26));}}Promise['all'](_0x3a676c)[_0x4b9f('0x1b')](function(){_0x1c07c3({'val':0x1});});});});}function insertAdditionalPhones(_0x4c48ec){return new Promise(function(_0x1db32f,_0x322142){var _0x20ea42=_0x4c48ec[_0x4b9f('0x1a')];var _0x20e62b=_0x20ea42[_0x4b9f('0x1c')](';');var _0x53f8f3=[];orderBy=0x0;for(var _0x798eb6=0x0;_0x798eb6<_0x20e62b[_0x4b9f('0x1d')];_0x798eb6++){_0x53f8f3[_0x4b9f('0x1e')](splitAdditionalPhone(_0x4c48ec['id'],_0x20e62b[_0x798eb6]));}Promise['all'](_0x53f8f3)[_0x4b9f('0x1b')](function(){_0x1db32f({'val':_0x20e62b[_0x4b9f('0x1d')]});});});}function splitAdditionalPhone(_0xe0675e,_0x451cbb){return new Promise(function(_0x551227,_0x399f16){var _0x1bd63b=_0x451cbb[_0x4b9f('0x1c')](':');var _0x1c24c0=_0x1bd63b[0x0];var _0xad1c59=_0x1bd63b[0x1];if(!_[_0x4b9f('0x1f')](_0xad1c59)){var _0x457586=_0xad1c59[_0x4b9f('0x1c')]('|');var _0x62af2d=[];for(var _0x1c6d92=0x0;_0x1c6d92<_0x457586[_0x4b9f('0x1d')];_0x1c6d92++){if(_0x457586[_0x1c6d92]!==''){var _0x33622a=_[_0x4b9f('0x20')](promisesAdditionalPhones,{'contactId':_0xe0675e,'phone':_0x457586[_0x1c6d92]});if(_0x33622a[_0x4b9f('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x4b9f('0x1e')]({'contactId':_0xe0675e,'contactTypeId':_0x1c24c0,'phone':_0x457586[_0x1c6d92],'orderBy':orderBy});}}}_0x551227({'ok':0x1});}else _0x551227({'res':0x0});});}function createAdditionalPhone(_0x3ea372,_0x39d716,_0x18cd1c,_0x269a4a){var _0x14f92c='';var _0xb5387d='';var _0x22e836=_0x18cd1c[_0x4b9f('0x1c')]('§');_0x14f92c=_0x22e836[0x0];if(_0x22e836[_0x4b9f('0x1d')]==0x2)_0xb5387d=_0x22e836[0x1];return new Promise(function(_0x313fa2,_0x21a519){return db[_0x4b9f('0x21')][_0x4b9f('0x22')]({'where':{'CmContactId':_0x3ea372,'item':_0x14f92c}})[_0x4b9f('0x1b')](function(_0x562274){if(_0x562274){return db[_0x4b9f('0x21')][_0x4b9f('0x23')]({'ItemTypeId':_0x39d716,'description':_0xb5387d,'OrderBy':_0x269a4a},{'where':{'CmContactId':_0x3ea372,'item':_0x14f92c}})[_0x4b9f('0x1b')](function(_0x3dc7e6){_0x313fa2({'res':_0x4b9f('0x24')});});}else{return db[_0x4b9f('0x21')][_0x4b9f('0x25')]({'CmContactId':_0x3ea372,'item':_0x14f92c,'description':_0xb5387d,'ItemTypeId':_0x39d716,'OrderBy':_0x269a4a,'ItemClass':_0x4b9f('0x26')})[_0x4b9f('0x1b')](function(_0x477a23){_0x313fa2({'res':_0x4b9f('0x27')});});}});});}function insertCmHopper(_0x10cacc,_0x20f4c2,_0x20f3e1,_0x2aff76,_0x287a22){var _0x41b540=[_0x4b9f('0x28'),'cm_contacts.scheduledat',_0x4b9f('0x29'),'cm_contacts.ListId',_0x20f4c2+'.'+_0x2aff76,_0x4b9f('0x2a'),_0x4b9f('0x2b'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x287a22+'\x22'];return squel[_0x4b9f('0x2c')]()['into'](_0x4b9f('0x2d'))[_0x4b9f('0x2e')]([_0x4b9f('0x11'),'scheduledat',_0x4b9f('0x2f'),_0x4b9f('0x30'),_0x2aff76,_0x4b9f('0x31'),_0x4b9f('0x32'),_0x4b9f('0x33'),_0x4b9f('0x34'),_0x4b9f('0x35')],squel[_0x4b9f('0xf')]()['fields'](_0x41b540)[_0x4b9f('0x12')](_0x20f4c2)['join'](_0x4b9f('0x36'),null,_0x4b9f('0x37')+_0x20f4c2+_0x4b9f('0x38'))[_0x4b9f('0x13')](_0x20f3e1,null,_0x20f3e1+_0x4b9f('0x14')+_0x20f4c2+'.'+_0x2aff76)[_0x4b9f('0x15')](_0x20f4c2+'.CmListId\x20=\x20?',_0x10cacc)[_0x4b9f('0x15')](_0x4b9f('0x39'),NOW)[_0x4b9f('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x20f4c2,_0x20f3e1,_0x2aff76,'cm_hopper',[_0x4b9f('0x3a'),_0x4b9f('0x3b')]))[_0x4b9f('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x20f4c2,_0x20f3e1,_0x2aff76,'cm_hopper',[_0x4b9f('0x3a')])))['toString']();}function insertCmHopperBlack(_0x322264,_0x275cde,_0x4b2404,_0x4b99b4){var _0x3d98e=[_0x4b9f('0x28'),_0x4b9f('0x29'),_0x4b9f('0x3c'),_0x275cde+'.'+_0x4b99b4,_0x4b9f('0x2a'),'cm_contacts.updatedAt'];return squel[_0x4b9f('0x2c')]()[_0x4b9f('0x3d')](_0x4b9f('0x3e'))['fromQuery'](['phone',_0x4b9f('0x2f'),'ListId',_0x4b99b4,_0x4b9f('0x31'),_0x4b9f('0x32')],squel['select']()[_0x4b9f('0x3f')](_0x3d98e)[_0x4b9f('0x12')](_0x275cde)['join'](_0x4b9f('0x36'),null,_0x4b9f('0x37')+_0x275cde+'.CmListId')[_0x4b9f('0x13')](_0x4b2404,null,_0x4b2404+_0x4b9f('0x14')+_0x275cde+'.'+_0x4b99b4)[_0x4b9f('0x15')](_0x275cde+'.CmListId\x20=\x20?',_0x322264)['where'](_0x4b9f('0x39'),NOW)[_0x4b9f('0x15')](_0x4b9f('0x40'),squel['select']()[_0x4b9f('0x10')](_0x4b9f('0x11'))['from'](_0x4b9f('0x3e'))['where']('ListId\x20=\x20?',_0x322264)[_0x4b9f('0x15')](_0x4b99b4+_0x4b9f('0x16')+_0x275cde+'.'+_0x4b99b4)))[_0x4b9f('0x41')]();}function insertTzCmHopper(_0x4fcc70,_0x3e8ad4,_0x118423,_0x1a3ef0,_0x59e0cc,_0xd2c083){var _0x37f6b1=[_0x4b9f('0x28'),'date_add(cm_contacts.scheduledat,interval\x20'+_0xd2c083+_0x4b9f('0x42'),'cm_contacts.id',_0x4b9f('0x3c'),_0x3e8ad4+'.'+_0x1a3ef0,_0x4b9f('0x2a'),'cm_contacts.updatedAt',_0x4b9f('0x43'),_0x4b9f('0x44'),'\x22'+_0x59e0cc+'\x22'];var _0x165fc7=squel[_0x4b9f('0x2c')]()[_0x4b9f('0x3d')](_0x4b9f('0x2d'))[_0x4b9f('0x2e')]([_0x4b9f('0x11'),'scheduledat','ContactId',_0x4b9f('0x30'),_0x1a3ef0,_0x4b9f('0x31'),_0x4b9f('0x32'),_0x4b9f('0x33'),_0x4b9f('0x34'),_0x4b9f('0x35')],squel[_0x4b9f('0xf')]()[_0x4b9f('0x3f')](_0x37f6b1)[_0x4b9f('0x12')](_0x3e8ad4)[_0x4b9f('0x13')]('cm_contacts',null,_0x4b9f('0x37')+_0x3e8ad4+'.CmListId')[_0x4b9f('0x13')](_0x118423,null,_0x118423+'.id\x20=\x20'+_0x3e8ad4+'.'+_0x1a3ef0)[_0x4b9f('0x13')](_0xd2c083,null,_0xd2c083+_0x4b9f('0x14')+_0x3e8ad4+'.'+_0x1a3ef0)['where'](_0x3e8ad4+_0x4b9f('0x45'),_0x4fcc70)['where'](_0x4b9f('0x39'),NOW)['where'](_0x4b9f('0x40'),selectNotIn(_0x3e8ad4,_0x118423,_0x1a3ef0,_0x4b9f('0x2d'),[_0x4b9f('0x3a'),'\x22onlyIfOpen\x22']))[_0x4b9f('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3e8ad4,_0x118423,_0x1a3ef0,_0x4b9f('0x2d'),[_0x4b9f('0x3a')])))[_0x4b9f('0x41')]();return _0x165fc7;}function insertTzCmHopperBlack(_0x579665,_0x140b7c,_0x523a30,_0x54f9e1){var _0x26ab5f=[_0x4b9f('0x28'),'cm_contacts.id','cm_contacts.ListId',_0x140b7c+'.'+_0x54f9e1,_0x4b9f('0x2a'),_0x4b9f('0x2b')];return squel['insert']()['into']('cm_hopper_black')[_0x4b9f('0x2e')]([_0x4b9f('0x11'),_0x4b9f('0x2f'),_0x4b9f('0x30'),_0x54f9e1,_0x4b9f('0x31'),_0x4b9f('0x32')],squel[_0x4b9f('0xf')]()[_0x4b9f('0x3f')](_0x26ab5f)[_0x4b9f('0x12')](_0x140b7c)['join'](_0x4b9f('0x36'),null,_0x4b9f('0x37')+_0x140b7c+'.CmListId')[_0x4b9f('0x13')](_0x523a30,null,_0x523a30+_0x4b9f('0x14')+_0x140b7c+'.'+_0x54f9e1)[_0x4b9f('0x15')](_0x140b7c+'.CmListId\x20=\x20?',_0x579665)[_0x4b9f('0x15')](_0x4b9f('0x39'),NOW)[_0x4b9f('0x15')](_0x4b9f('0x40'),squel[_0x4b9f('0xf')]()[_0x4b9f('0x10')](_0x4b9f('0x11'))[_0x4b9f('0x12')](_0x4b9f('0x3e'))[_0x4b9f('0x15')]('ListId\x20=\x20?',_0x579665)[_0x4b9f('0x15')](_0x54f9e1+_0x4b9f('0x16')+_0x140b7c+'.'+_0x54f9e1)))['toString']();}function insertCmHopperAdditionalPhones(_0x4c9303){var _0x56e88c=['cm_hopper.id',_0x4b9f('0x46'),_0x4b9f('0x47'),_0x4b9f('0x48'),_0x4b9f('0x49')];return squel['insert']()[_0x4b9f('0x3d')](_0x4b9f('0x4a'))[_0x4b9f('0x2e')](['CmHopperId',_0x4b9f('0x11'),'OrderBy',_0x4b9f('0x31'),_0x4b9f('0x32')],squel[_0x4b9f('0xf')]()[_0x4b9f('0x3f')](_0x56e88c)[_0x4b9f('0x12')](_0x4b9f('0x2d'))[_0x4b9f('0x13')](_0x4b9f('0x36'),null,_0x4b9f('0x4b'))[_0x4b9f('0x13')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x4b9f('0x15')](_0x4b9f('0x4c'),_0x4c9303)[_0x4b9f('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x4b9f('0x41')]();}function insertCmContact(_0x2a8f23,_0x1cf74d,_0x55923f,_0x570bfb){var _0x52548f=_[_0x4b9f('0x4d')](_[_0x4b9f('0x4e')](_0x570bfb),[_0x4b9f('0x30'),_0x4b9f('0x4f'),'createdAt',_0x4b9f('0x32')]);return squel[_0x4b9f('0x2c')]()['into']('cm_contacts')[_0x4b9f('0x2e')](_0x52548f,squel['select']()[_0x4b9f('0x3f')](_0x52548f)['from'](_0x1cf74d)['where']('('+_0x55923f[_0x4b9f('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x4b9f('0xf')]()[_0x4b9f('0x3f')](_0x55923f)['from'](_0x4b9f('0x36'))[_0x4b9f('0x15')](_0x4b9f('0x50'),_0x2a8f23)[_0x4b9f('0x15')](_0x4b9f('0x51')))[_0x4b9f('0x15')]('id\x20IN\x20?',squel[_0x4b9f('0xf')]()[_0x4b9f('0x10')](_0x4b9f('0x52'),_0x4b9f('0x53'))[_0x4b9f('0x12')](_0x1cf74d)[_0x4b9f('0x54')](_0x55923f['join'](','))))[_0x4b9f('0x41')]();}function handleStop(){logger[_0x4b9f('0x55')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x103532){logger[_0x4b9f('0x56')](_0x103532[_0x4b9f('0x57')]);process[_0x4b9f('0x58')](0x1);}function handleError(_0x573382,_0xa1a190){stats[_0x4b9f('0x59')][_0x4b9f('0x1e')]({'name':_0xa1a190[_0x4b9f('0x5a')],'message':_0xa1a190[_0x4b9f('0x57')],'row':_0x573382});}function handleQuery(_0x1f16de){logger[_0x4b9f('0x55')](_0x1f16de);return db[_0x4b9f('0x5b')][_0x4b9f('0x5c')](_0x1f16de)['spread'](function(_0x36459c){results[_0x4b9f('0x1e')](_0x36459c);})[_0x4b9f('0x5d')](function(_0x5628bf){logger['error'](_0x5628bf[_0x4b9f('0x57')]);});}function updateTzCampaigns(_0x148068){return new Promise(function(_0x198d26,_0x1cb19b){var _0x3b5e88=squel[_0x4b9f('0xf')]()[_0x4b9f('0x3f')]([_0x4b9f('0x5e'),_0x4b9f('0x5f')])[_0x4b9f('0x12')](_0x4b9f('0x60'))[_0x4b9f('0x13')](_0x4b9f('0x61'),null,_0x4b9f('0x62'))[_0x4b9f('0x15')](_0x4b9f('0x63')+_0x148068);db[_0x4b9f('0x5b')]['query'](_0x3b5e88[_0x4b9f('0x41')]())[_0x4b9f('0x64')](function(_0x58142d){var _0x281778=[];for(var _0x42b362=0x0;_0x42b362<_0x58142d[_0x4b9f('0x1d')];_0x42b362++){_0x281778[_0x4b9f('0x1e')](getTimezoneData(_0x58142d[_0x42b362],tmp_campaigns));}BPromise[_0x4b9f('0x65')](_0x281778)[_0x4b9f('0x1b')](function(){_0x198d26({'val':0x1});});})[_0x4b9f('0x5d')](function(_0x4e71e2){logger[_0x4b9f('0x56')](_0x4e71e2[_0x4b9f('0x57')]);_0x198d26({'val':0x0});});});}function updateTzVoiceQueues(_0x4ea6e7){return new Promise(function(_0x533896,_0x11cbe5){var _0x3d2aef=squel['select']()[_0x4b9f('0x3f')](['voice_queues.id','voice_queues.dialTimezone'])['from']('voice_queues')['join'](_0x4b9f('0x66'),null,_0x4b9f('0x67'))[_0x4b9f('0x15')](_0x4b9f('0x68')+_0x4ea6e7);db[_0x4b9f('0x5b')]['query'](_0x3d2aef[_0x4b9f('0x41')]())['spread'](function(_0x339d4c){var _0xab367=[];for(var _0x3becb2=0x0;_0x3becb2<_0x339d4c[_0x4b9f('0x1d')];_0x3becb2++){_0xab367['push'](getTimezoneData(_0x339d4c[_0x3becb2],tmp_voice_queues));}BPromise[_0x4b9f('0x65')](_0xab367)[_0x4b9f('0x1b')](function(){_0x533896({'val':0x1});});})['catch'](function(_0x4e64ca){logger[_0x4b9f('0x56')](_0x4e64ca[_0x4b9f('0x57')]);_0x533896({'val':0x0});});});}function getTimezoneData(_0x179a20,_0x361512){return new Promise(function(_0x4969e0,_0x3bd40b){var _0x20718f=shared['timezones'];var _0x25b3fb=_0x20718f[_0x179a20[_0x4b9f('0x69')]];if(_[_0x4b9f('0x1f')](_0x25b3fb)){_0x4969e0({'ret':0x1});}else{var _0x177735=_0x25b3fb[_0x4b9f('0x6a')];var _0x4a010c=squel[_0x4b9f('0x2c')]()[_0x4b9f('0x3d')](_0x361512)[_0x4b9f('0x6b')]('id',_0x179a20['id'])[_0x4b9f('0x6b')](_0x4b9f('0x6c'),_0x177735)['set']('dialTimezone',_0x179a20['dialTimezone'])[_0x4b9f('0x41')]();return db[_0x4b9f('0x5b')][_0x4b9f('0x5c')](_0x4a010c)[_0x4b9f('0x64')](function(_0x16db75){_0x4969e0({'ret':0x1});})[_0x4b9f('0x5d')](function(_0x156387){logger[_0x4b9f('0x56')](_0x156387[_0x4b9f('0x57')]);_0x3bd40b({'ret':0x1});});}});}function handleTZQuery(_0x57430d){logger['info'](_0x57430d);return db[_0x4b9f('0x5b')][_0x4b9f('0x5c')](_0x57430d)[_0x4b9f('0x64')](function(_0x4776a5){})[_0x4b9f('0x5d')](function(_0x2fc440){logger['error'](_0x2fc440[_0x4b9f('0x57')]);});}function main(_0x5f2110,_0x148763,_0x56a575,_0x26de02){logger['info'](_0x4b9f('0x6d'),_0x5f2110,JSON[_0x4b9f('0x6e')](_0x148763));process[_0x4b9f('0x6f')](_0x4b9f('0x70'));var _0x5565ef=_0x148763['binding'];var _0x41768e=_['clone'](_0x5565ef);var _0x39cbcf=_0x148763[_0x4b9f('0x71')];var _0x1a0410=path[_0x4b9f('0x13')](config['root'],'server/files/tmp',_0x39cbcf+_0x4b9f('0x72'));hasTZ=_[_0x4b9f('0x4e')](_0x5565ef)['includes'](_0x4b9f('0x69'));var _0x10ae65=_['keys'](_0x5565ef)[_0x4b9f('0x13')]();logger[_0x4b9f('0x55')](_0x4b9f('0x73'),_0x10ae65);db[_0x4b9f('0x74')]['findAll']({'raw':!![],'attributes':['id',_0x4b9f('0x75')]})['then'](function(_0xb3158e){for(var _0xdb07c0=0x0;_0xdb07c0<_0xb3158e[_0x4b9f('0x1d')];_0xdb07c0++){if(_0xb3158e[_0xdb07c0][_0x4b9f('0x75')]in _0x5565ef){contactItemTypes['push'](_0xb3158e[_0xdb07c0]);delete _0x41768e[_0xb3158e[_0xdb07c0][_0x4b9f('0x75')]];hasAdditionalPhones=!![];}for(var _0x4b69d8 in _0x5565ef){if(_0xb3158e[_0xdb07c0][_0x4b9f('0x75')]+_0x4b9f('0x76')===_0x4b69d8){phoneDescriptions[_0x4b9f('0x1e')]({'itemTypeId':_0xb3158e[_0xdb07c0]['id'],'description':_0x4b69d8});delete _0x41768e[_0x4b69d8];}}}if(hasAdditionalPhones)_0x41768e[_0x4b9f('0x1a')]='';var _0x52030e=_[_0x4b9f('0x4e')](_0x41768e)[_0x4b9f('0x13')]();logger[_0x4b9f('0x55')](_0x4b9f('0x73'),_0x52030e);fs[_0x4b9f('0x77')](_0x1a0410,_0x52030e+'\x0a');Papa[_0x4b9f('0x78')](fs[_0x4b9f('0x79')](_0x5f2110),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4949af,_0x15ca86){try{for(var _0x200cdc=0x0,_0x5ea55d=[];_0x200cdc<_0x4949af[_0x4b9f('0x7a')][_0x4b9f('0x1d')];_0x200cdc++){stats[_0x4b9f('0x7b')]+=0x1;if(_0x4949af[_0x4b9f('0x59')][_0x200cdc]){handleError(_0x4949af[_0x4b9f('0x7a')][_0x200cdc],_0x4949af[_0x4b9f('0x59')][_0x200cdc]);}else{var _0x234c5e=[];var _0x2db90a=[];var _0x1b8b6e={};for(var _0x16cd91 in _0x5565ef){let _0x4f8ea3=contactItemTypes[_0x4b9f('0x7c')](_0x4dbb5d=>_0x4dbb5d['name']===_0x16cd91);let _0x3b85e3=contactItemTypes[_0x4b9f('0x7c')](_0x72ba4b=>_0x72ba4b[_0x4b9f('0x75')]+_0x4b9f('0x76')===_0x16cd91);if(_[_0x4b9f('0x1f')](_0x4f8ea3)&&_[_0x4b9f('0x1f')](_0x3b85e3)){if(_0x5565ef['hasOwnProperty'](_0x16cd91)){if(_0x4949af[_0x4b9f('0x7a')][_0x200cdc][_0x5565ef[_0x16cd91]]){var _0x37b457=_[_0x4b9f('0x7d')](_0x4949af['data'][_0x200cdc][_0x5565ef[_0x16cd91]][_0x4b9f('0x7e')](/"/g,'\x27'));switch(_0x16cd91){case _0x4b9f('0x7f'):var _0x556e85=moment(_0x37b457,_0x4b9f('0xd'),!![]);if(_0x556e85[_0x4b9f('0x80')]()){_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x37b457+'\x22');}else{_0x234c5e[_0x4b9f('0x1e')](_0x4b9f('0x81'));}break;case _0x4b9f('0x33'):var _0x4a4b20=parseInt(_0x37b457);_0x37b457=_[_0x4b9f('0x82')](_0x4a4b20)||_0x4a4b20<0x0||_0x4a4b20>0x4?_0x26de02?0x3:0x2:_0x4a4b20;_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x37b457+'\x22');break;case _0x4b9f('0x34'):var _0x5b7bba=parseInt(_0x37b457);if(_['isNumber'](_0x5b7bba)&&_[_0x4b9f('0x83')](_0x56a575,_0x5b7bba)){_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x5b7bba+'\x22');}else{_0x234c5e[_0x4b9f('0x1e')](_0x4b9f('0x84'));}break;case'email':if(isEmail(_0x37b457)){_0x5ea55d['push']('\x22'+_0x37b457+'\x22');}else{_0x234c5e[_0x4b9f('0x1e')](_0x4b9f('0x85'));}break;case _0x4b9f('0x86'):var _0x5461b2=moment(_0x37b457,_0x4b9f('0x87'),!![]);if(_0x5461b2[_0x4b9f('0x80')]()){_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x37b457+'\x22');}else{_0x234c5e[_0x4b9f('0x1e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x4b9f('0x69'):var _0x54002d=shared[_0x4b9f('0x88')];var _0x4e7e0a=_0x54002d[_0x37b457];if(!_[_0x4b9f('0x1f')](_0x4e7e0a)){var _0x58ef38=_0x4e7e0a[_0x4b9f('0x6a')];_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x37b457+'\x22');_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x58ef38+'\x22');}break;default:_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x37b457+'\x22');}}else{switch(_0x16cd91){case _0x4b9f('0x89'):case _0x4b9f('0x11'):_0x234c5e[_0x4b9f('0x1e')](_0x16cd91+'\x20not\x20specified');break;default:_0x5ea55d[_0x4b9f('0x1e')]('\x22\x22');}}}}else{var _0x4b1264='';if(!_[_0x4b9f('0x1f')](_0x4f8ea3)){if(!_0x1b8b6e['hasOwnProperty'](_0x4f8ea3['id'])){if(!_[_0x4b9f('0x1f')](_0x4949af[_0x4b9f('0x7a')][_0x200cdc][_0x5565ef[_0x16cd91]])){var _0x37b457=_[_0x4b9f('0x7d')](_0x4949af[_0x4b9f('0x7a')][_0x200cdc][_0x5565ef[_0x16cd91]]['replace'](/"/g,'\x27'));var _0x5168e4=phoneDescriptions[_0x4b9f('0x7c')](_0x59e955=>_0x59e955[_0x4b9f('0x8a')]===_0x4f8ea3['id']);if(!_['isNil'](_0x5168e4)){var _0x9c54d7=_[_0x4b9f('0x7d')](_0x4949af[_0x4b9f('0x7a')][_0x200cdc][_0x5565ef[_0x5168e4[_0x4b9f('0x8b')]]][_0x4b9f('0x7e')](/"/g,'\x27'));if(!_[_0x4b9f('0x1f')](_0x9c54d7))_0x37b457=_0x37b457+'§'+_0x9c54d7;}if(_0x4b1264=='')_0x4b1264=_0x37b457;else _0x4b1264+='|'+_0x37b457;}_0x2db90a[_0x4b9f('0x1e')](_0x4f8ea3['id']+':'+_0x4b1264);_0x1b8b6e[_0x4f8ea3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5ea55d[_0x4b9f('0x1e')]('\x22'+_0x2db90a[_0x4b9f('0x13')](';')+'\x22');}if(_0x234c5e[_0x4b9f('0x1d')]){handleError(_0x4949af[_0x4b9f('0x7a')][_0x200cdc],{'code':_0x4b9f('0x8c'),'message':_0x234c5e[_0x4b9f('0x13')]()});}else{fs[_0x4b9f('0x8d')](_0x1a0410,_0x5ea55d[_0x4b9f('0x13')]()+'\x0a');}_0x5ea55d=[];}if(!(stats[_0x4b9f('0x7b')]%0xc8)){socket['emit'](_0x4b9f('0x8e')+_0x39cbcf,stats);stats[_0x4b9f('0x59')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x15ca86[_0x4b9f('0x8f')]();}}catch(_0x3bb9a5){handleError(_0x4949af[_0x4b9f('0x7a')][_0x200cdc],{'code':'SystemError','message':_0x3bb9a5[_0x4b9f('0x57')]});logger[_0x4b9f('0x56')](_0x4b9f('0x90'),_0x3bb9a5[_0x4b9f('0x57')]);}},'complete':function(){try{var _0x4c610=[];var _0x5b5980=[];var _0x2c0756=_0x4b9f('0x36');if(_0x148763[_0x4b9f('0x91')]&&_0x148763['duplicates'][_0x4b9f('0x1d')]){_0x2c0756=_0x4b9f('0x92')+_0x39cbcf;_0x4c610[_0x4b9f('0x1e')](_0x4b9f('0x93')+_0x2c0756+_0x4b9f('0x94'));}tmp_campaigns=_0x4b9f('0x95')+_0x39cbcf;tmp_voice_queues=_0x4b9f('0x96')+_0x39cbcf;_0x5b5980[_0x4b9f('0x1e')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x5b5980[_0x4b9f('0x1e')](_0x4b9f('0x93')+tmp_voice_queues+_0x4b9f('0x97'));BPromise[_0x4b9f('0x98')](_0x5b5980,handleTZQuery)[_0x4b9f('0x1b')](function(_0x8a7ac7){updateTzCampaigns(_0x148763['ListId'])['then'](function(_0x4b8ca8){updateTzVoiceQueues(_0x148763['ListId'])[_0x4b9f('0x1b')](function(_0x4a7999){if(hasTZ)_0x52030e=_0x52030e[_0x4b9f('0x7e')](_0x4b9f('0x69'),_0x4b9f('0x99'));var _0x362503=util[_0x4b9f('0xc')](_0x4b9f('0x9a'),_0x1a0410,_0x2c0756,_0x52030e,_0x148763[_0x4b9f('0x30')],_0x148763[_0x4b9f('0x4f')]||null,NOW,NOW);if(_[_0x4b9f('0x1f')](_0x5565ef[_0x4b9f('0x7f')])){_0x362503+=_0x4b9f('0x9b');}_0x4c610[_0x4b9f('0x1e')](_0x362503);if(_0x148763[_0x4b9f('0x91')]&&_0x148763['duplicates'][_0x4b9f('0x1d')]){_0x4c610[_0x4b9f('0x1e')](insertCmContact(_0x148763['ListId'],_0x2c0756,_0x148763['duplicates'],_0x5565ef));_0x4c610['push'](_0x4b9f('0x9c')+_0x2c0756+';');}BPromise['each'](_0x4c610,handleQuery)[_0x4b9f('0x1b')](function(_0x22d46f){BPromise[_0x4b9f('0x65')]([handleAdditionalPhones()])[_0x4b9f('0x1b')](function(){_0x4c610=[];for(var _0x49cf4c=0x0;_0x49cf4c\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','push','all','AdditionalPhones','split','then','length','isNil','filter','CmContactHasItem','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','priority','UserId','fields','from','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt'];(function(_0x568fd3,_0x105de5){var _0x164575=function(_0x2f0c06){while(--_0x2f0c06){_0x568fd3['push'](_0x568fd3['shift']());}};_0x164575(++_0x105de5);}(_0x7d5b,0x131));var _0xb7d5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7d5b[_0x17d9e3];return _0x14192d;};'use strict';var fs=require('fs');var path=require(_0xb7d5('0x0'));var _=require(_0xb7d5('0x1'));var Papa=require('papaparse');var util=require(_0xb7d5('0x2'));var BPromise=require(_0xb7d5('0x3'));var moment=require(_0xb7d5('0x4'));var squel=require('squel');var Redis=require(_0xb7d5('0x5'));var db=require(_0xb7d5('0x6'))['db'];var config=require(_0xb7d5('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0xb7d5('0x8'))('import');config[_0xb7d5('0x9')]=_[_0xb7d5('0xa')](config[_0xb7d5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb7d5('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xb7d5('0xc')](_0xb7d5('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xb7d5('0xd'));function isEmail(_0x5e3a82){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))*$/[_0xb7d5('0xe')](_0x5e3a82);}function selectNotIn(_0x50b972,_0x523819,_0x3123f1,_0x393b60,_0x9d89c5){return squel[_0xb7d5('0xf')]()[_0xb7d5('0x10')]('phone')['from'](_0x393b60)[_0xb7d5('0x11')](_0x523819,null,_0x523819+_0xb7d5('0x12')+_0x393b60+'.'+_0x3123f1)[_0xb7d5('0x13')](_0x393b60+'.'+_0x3123f1+_0xb7d5('0x14')+_0x50b972+'.'+_0x3123f1)[_0xb7d5('0x13')](_0x523819+_0xb7d5('0x15')+_0x9d89c5[_0xb7d5('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1cee2c,_0x207b6e){promisesAdditionalPhones=[];return db[_0xb7d5('0x16')][_0xb7d5('0x17')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x187318){if(_0x187318!==null){var _0x18de19=[];for(var _0x599180=0x0;_0x599180<_0x187318['length'];_0x599180++){var _0x5b7fcc=_0x187318[_0x599180];_0x18de19[_0xb7d5('0x18')](insertAdditionalPhones(_0x5b7fcc));}}Promise[_0xb7d5('0x19')](_0x18de19)['then'](function(){_0x1cee2c({'val':0x1});});});});}function insertAdditionalPhones(_0xe5be0b){return new Promise(function(_0x417be2,_0x147318){var _0x432cf5=_0xe5be0b[_0xb7d5('0x1a')];var _0xd62ecb=_0x432cf5[_0xb7d5('0x1b')](';');var _0x40f2cb=[];orderBy=0x0;for(var _0x18692d=0x0;_0x18692d<_0xd62ecb['length'];_0x18692d++){_0x40f2cb[_0xb7d5('0x18')](splitAdditionalPhone(_0xe5be0b['id'],_0xd62ecb[_0x18692d]));}Promise[_0xb7d5('0x19')](_0x40f2cb)[_0xb7d5('0x1c')](function(){_0x417be2({'val':_0xd62ecb[_0xb7d5('0x1d')]});});});}function splitAdditionalPhone(_0x4ca3d1,_0x38060c){return new Promise(function(_0x57c470,_0x455e37){var _0x51db6f=_0x38060c[_0xb7d5('0x1b')](':');var _0x5732e3=_0x51db6f[0x0];var _0xfb43da=_0x51db6f[0x1];if(!_[_0xb7d5('0x1e')](_0xfb43da)){var _0x2b64b7=_0xfb43da[_0xb7d5('0x1b')]('|');var _0x590e4a=[];for(var _0x3eb147=0x0;_0x3eb147<_0x2b64b7[_0xb7d5('0x1d')];_0x3eb147++){if(_0x2b64b7[_0x3eb147]!==''){var _0x18ce4a=_[_0xb7d5('0x1f')](promisesAdditionalPhones,{'contactId':_0x4ca3d1,'phone':_0x2b64b7[_0x3eb147]});if(_0x18ce4a[_0xb7d5('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0xb7d5('0x18')]({'contactId':_0x4ca3d1,'contactTypeId':_0x5732e3,'phone':_0x2b64b7[_0x3eb147],'orderBy':orderBy});}}}_0x57c470({'ok':0x1});}else _0x57c470({'res':0x0});});}function createAdditionalPhone(_0x314124,_0x1dfecd,_0x3d425c,_0x36f91d){var _0x288c72='';var _0x23731d='';var _0x1c19ff=_0x3d425c[_0xb7d5('0x1b')]('§');_0x288c72=_0x1c19ff[0x0];if(_0x1c19ff[_0xb7d5('0x1d')]==0x2)_0x23731d=_0x1c19ff[0x1];return new Promise(function(_0x413baf,_0x7a6cfa){return db[_0xb7d5('0x20')]['findOne']({'where':{'CmContactId':_0x314124,'item':_0x288c72}})[_0xb7d5('0x1c')](function(_0x47161b){if(_0x47161b){return db[_0xb7d5('0x20')][_0xb7d5('0x21')]({'ItemTypeId':_0x1dfecd,'description':_0x23731d,'OrderBy':_0x36f91d},{'where':{'CmContactId':_0x314124,'item':_0x288c72}})[_0xb7d5('0x1c')](function(_0x62ee41){_0x413baf({'res':_0xb7d5('0x22')});});}else{return db['CmContactHasItem'][_0xb7d5('0x23')]({'CmContactId':_0x314124,'item':_0x288c72,'description':_0x23731d,'ItemTypeId':_0x1dfecd,'OrderBy':_0x36f91d,'ItemClass':'PHONE'})['then'](function(_0x438562){_0x413baf({'res':_0xb7d5('0x24')});});}});});}function insertCmHopper(_0x589bf,_0x3da4cf,_0x6ca094,_0x419718,_0x33bb99){var _0x3128d1=[_0xb7d5('0x25'),_0xb7d5('0x26'),_0xb7d5('0x27'),'cm_contacts.ListId',_0x3da4cf+'.'+_0x419718,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0xb7d5('0x28'),'\x22'+_0x33bb99+'\x22'];return squel[_0xb7d5('0x29')]()[_0xb7d5('0x2a')](_0xb7d5('0x2b'))[_0xb7d5('0x2c')](['phone',_0xb7d5('0x2d'),'ContactId',_0xb7d5('0x2e'),_0x419718,_0xb7d5('0x2f'),'updatedAt',_0xb7d5('0x30'),_0xb7d5('0x31'),'recallme'],squel['select']()[_0xb7d5('0x32')](_0x3128d1)[_0xb7d5('0x33')](_0x3da4cf)[_0xb7d5('0x11')]('cm_contacts',null,_0xb7d5('0x34')+_0x3da4cf+_0xb7d5('0x35'))[_0xb7d5('0x11')](_0x6ca094,null,_0x6ca094+_0xb7d5('0x12')+_0x3da4cf+'.'+_0x419718)[_0xb7d5('0x13')](_0x3da4cf+_0xb7d5('0x36'),_0x589bf)[_0xb7d5('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb7d5('0x37'),selectNotIn(_0x3da4cf,_0x6ca094,_0x419718,_0xb7d5('0x2b'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xb7d5('0x13')](_0xb7d5('0x37'),selectNotIn(_0x3da4cf,_0x6ca094,_0x419718,_0xb7d5('0x2b'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x1e0218,_0x580cf5,_0x98ce3c,_0x5ede96){var _0x295482=['cm_contacts.phone','cm_contacts.id',_0xb7d5('0x38'),_0x580cf5+'.'+_0x5ede96,_0xb7d5('0x39'),_0xb7d5('0x3a')];return squel['insert']()[_0xb7d5('0x2a')](_0xb7d5('0x3b'))['fromQuery']([_0xb7d5('0x3c'),'ContactId','ListId',_0x5ede96,_0xb7d5('0x2f'),'updatedAt'],squel['select']()['fields'](_0x295482)[_0xb7d5('0x33')](_0x580cf5)[_0xb7d5('0x11')](_0xb7d5('0x3d'),null,_0xb7d5('0x34')+_0x580cf5+_0xb7d5('0x35'))[_0xb7d5('0x11')](_0x98ce3c,null,_0x98ce3c+_0xb7d5('0x12')+_0x580cf5+'.'+_0x5ede96)[_0xb7d5('0x13')](_0x580cf5+_0xb7d5('0x36'),_0x1e0218)[_0xb7d5('0x13')](_0xb7d5('0x3e'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb7d5('0xf')]()['field']('phone')[_0xb7d5('0x33')](_0xb7d5('0x3b'))[_0xb7d5('0x13')](_0xb7d5('0x3f'),_0x1e0218)[_0xb7d5('0x13')](_0x5ede96+'\x20=\x20'+_0x580cf5+'.'+_0x5ede96)))[_0xb7d5('0x40')]();}function insertTzCmHopper(_0x1337e8,_0x5be8cf,_0x29aa34,_0x3ce35f,_0x50eee9,_0xce42c){var _0x430260=[_0xb7d5('0x25'),'date_add(cm_contacts.scheduledat,interval\x20'+_0xce42c+_0xb7d5('0x41'),_0xb7d5('0x27'),_0xb7d5('0x38'),_0x5be8cf+'.'+_0x3ce35f,_0xb7d5('0x39'),_0xb7d5('0x3a'),_0xb7d5('0x42'),_0xb7d5('0x28'),'\x22'+_0x50eee9+'\x22'];var _0x4fde4f=squel['insert']()[_0xb7d5('0x2a')](_0xb7d5('0x2b'))[_0xb7d5('0x2c')]([_0xb7d5('0x3c'),'scheduledat',_0xb7d5('0x43'),'ListId',_0x3ce35f,_0xb7d5('0x2f'),_0xb7d5('0x44'),_0xb7d5('0x30'),_0xb7d5('0x31'),'recallme'],squel[_0xb7d5('0xf')]()[_0xb7d5('0x32')](_0x430260)[_0xb7d5('0x33')](_0x5be8cf)[_0xb7d5('0x11')](_0xb7d5('0x3d'),null,_0xb7d5('0x34')+_0x5be8cf+_0xb7d5('0x35'))['join'](_0x29aa34,null,_0x29aa34+'.id\x20=\x20'+_0x5be8cf+'.'+_0x3ce35f)['join'](_0xce42c,null,_0xce42c+_0xb7d5('0x12')+_0x5be8cf+'.'+_0x3ce35f)[_0xb7d5('0x13')](_0x5be8cf+_0xb7d5('0x36'),_0x1337e8)['where'](_0xb7d5('0x3e'),NOW)['where'](_0xb7d5('0x37'),selectNotIn(_0x5be8cf,_0x29aa34,_0x3ce35f,'cm_hopper',[_0xb7d5('0x45'),_0xb7d5('0x46')]))['where'](_0xb7d5('0x37'),selectNotIn(_0x5be8cf,_0x29aa34,_0x3ce35f,_0xb7d5('0x2b'),[_0xb7d5('0x45')])))['toString']();return _0x4fde4f;}function insertTzCmHopperBlack(_0x431aed,_0x3f5d78,_0x2587de,_0x36f9bb){var _0x107df1=[_0xb7d5('0x25'),_0xb7d5('0x27'),'cm_contacts.ListId',_0x3f5d78+'.'+_0x36f9bb,_0xb7d5('0x39'),_0xb7d5('0x3a')];return squel['insert']()[_0xb7d5('0x2a')](_0xb7d5('0x3b'))['fromQuery'](['phone',_0xb7d5('0x43'),'ListId',_0x36f9bb,'createdAt','updatedAt'],squel[_0xb7d5('0xf')]()[_0xb7d5('0x32')](_0x107df1)[_0xb7d5('0x33')](_0x3f5d78)['join'](_0xb7d5('0x3d'),null,'cm_contacts.ListId\x20=\x20'+_0x3f5d78+_0xb7d5('0x35'))[_0xb7d5('0x11')](_0x2587de,null,_0x2587de+_0xb7d5('0x12')+_0x3f5d78+'.'+_0x36f9bb)[_0xb7d5('0x13')](_0x3f5d78+_0xb7d5('0x36'),_0x431aed)[_0xb7d5('0x13')](_0xb7d5('0x3e'),NOW)['where'](_0xb7d5('0x37'),squel[_0xb7d5('0xf')]()[_0xb7d5('0x10')](_0xb7d5('0x3c'))['from'](_0xb7d5('0x3b'))[_0xb7d5('0x13')](_0xb7d5('0x3f'),_0x431aed)['where'](_0x36f9bb+_0xb7d5('0x14')+_0x3f5d78+'.'+_0x36f9bb)))['toString']();}function insertCmHopperAdditionalPhones(_0x336b81){var _0x1b4783=['cm_hopper.id',_0xb7d5('0x47'),_0xb7d5('0x48'),_0xb7d5('0x49'),_0xb7d5('0x4a')];return squel[_0xb7d5('0x29')]()[_0xb7d5('0x2a')]('cm_hopper_additional_phones')[_0xb7d5('0x2c')]([_0xb7d5('0x4b'),_0xb7d5('0x3c'),_0xb7d5('0x4c'),'createdAt',_0xb7d5('0x44')],squel[_0xb7d5('0xf')]()[_0xb7d5('0x32')](_0x1b4783)[_0xb7d5('0x33')]('cm_hopper')[_0xb7d5('0x11')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xb7d5('0x11')](_0xb7d5('0x4d'),null,_0xb7d5('0x4e'))['where'](_0xb7d5('0x4f'),_0x336b81)[_0xb7d5('0x13')](_0xb7d5('0x3e'),NOW))['toString']();}function insertCmContact(_0x47eec1,_0x4403ea,_0x57e931,_0x55ee36){var _0x341629=_[_0xb7d5('0x50')](_[_0xb7d5('0x51')](_0x55ee36),['ListId',_0xb7d5('0x52'),_0xb7d5('0x2f'),_0xb7d5('0x44')]);return squel[_0xb7d5('0x29')]()[_0xb7d5('0x2a')](_0xb7d5('0x3d'))[_0xb7d5('0x2c')](_0x341629,squel[_0xb7d5('0xf')]()['fields'](_0x341629)[_0xb7d5('0x33')](_0x4403ea)[_0xb7d5('0x13')]('('+_0x57e931[_0xb7d5('0x11')](',')+_0xb7d5('0x53'),squel[_0xb7d5('0xf')]()[_0xb7d5('0x32')](_0x57e931)[_0xb7d5('0x33')](_0xb7d5('0x3d'))['where']('ListId\x20=\x20?',_0x47eec1)['where'](_0xb7d5('0x54')))['where'](_0xb7d5('0x55'),squel[_0xb7d5('0xf')]()[_0xb7d5('0x10')]('MIN(id)',_0xb7d5('0x56'))[_0xb7d5('0x33')](_0x4403ea)[_0xb7d5('0x57')](_0x57e931[_0xb7d5('0x11')](','))))['toString']();}function handleStop(){logger['info'](_0xb7d5('0x58'));stopped=!![];}function handleUncaughtException(_0x2b31a4){logger[_0xb7d5('0x59')](_0x2b31a4[_0xb7d5('0x5a')]);process[_0xb7d5('0x5b')](0x1);}function handleError(_0x42d2c7,_0x487b3f){stats[_0xb7d5('0x5c')][_0xb7d5('0x18')]({'name':_0x487b3f['code'],'message':_0x487b3f['message'],'row':_0x42d2c7});}function handleQuery(_0x313f66){logger['info'](_0x313f66);return db[_0xb7d5('0x5d')][_0xb7d5('0x5e')](_0x313f66)[_0xb7d5('0x5f')](function(_0x4fded6){results['push'](_0x4fded6);})[_0xb7d5('0x60')](function(_0x1b8385){logger['error'](_0x1b8385['message']);});}function updateTzCampaigns(_0x12a6c3){return new Promise(function(_0x356f1c,_0x2d074e){var _0x428963=squel[_0xb7d5('0xf')]()[_0xb7d5('0x32')](['campaigns.id',_0xb7d5('0x61')])[_0xb7d5('0x33')](_0xb7d5('0x62'))['join']('campaigns_has_cm_lists',null,_0xb7d5('0x63'))['where'](_0xb7d5('0x64')+_0x12a6c3);db[_0xb7d5('0x5d')][_0xb7d5('0x5e')](_0x428963[_0xb7d5('0x40')]())[_0xb7d5('0x5f')](function(_0x5606e8){var _0x6232d4=[];for(var _0x2599ac=0x0;_0x2599ac<_0x5606e8[_0xb7d5('0x1d')];_0x2599ac++){_0x6232d4[_0xb7d5('0x18')](getTimezoneData(_0x5606e8[_0x2599ac],tmp_campaigns));}BPromise[_0xb7d5('0x19')](_0x6232d4)[_0xb7d5('0x1c')](function(){_0x356f1c({'val':0x1});});})[_0xb7d5('0x60')](function(_0x3090c0){logger[_0xb7d5('0x59')](_0x3090c0[_0xb7d5('0x5a')]);_0x356f1c({'val':0x0});});});}function updateTzVoiceQueues(_0x2d7866){return new Promise(function(_0x9992e9,_0x27771f){var _0x382c4f=squel[_0xb7d5('0xf')]()[_0xb7d5('0x32')](['voice_queues.id',_0xb7d5('0x65')])['from'](_0xb7d5('0x66'))[_0xb7d5('0x11')](_0xb7d5('0x67'),null,_0xb7d5('0x68'))['where'](_0xb7d5('0x69')+_0x2d7866);db[_0xb7d5('0x5d')][_0xb7d5('0x5e')](_0x382c4f[_0xb7d5('0x40')]())['spread'](function(_0x55a251){var _0x54e78a=[];for(var _0x52e2a5=0x0;_0x52e2a5<_0x55a251[_0xb7d5('0x1d')];_0x52e2a5++){_0x54e78a[_0xb7d5('0x18')](getTimezoneData(_0x55a251[_0x52e2a5],tmp_voice_queues));}BPromise[_0xb7d5('0x19')](_0x54e78a)['then'](function(){_0x9992e9({'val':0x1});});})[_0xb7d5('0x60')](function(_0x39a85f){logger[_0xb7d5('0x59')](_0x39a85f['message']);_0x9992e9({'val':0x0});});});}function getTimezoneData(_0x51a672,_0x3ebd67){return new Promise(function(_0x3f8225,_0x163029){var _0x501ce7=shared[_0xb7d5('0x6a')];var _0x5a5c25=_0x501ce7[_0x51a672[_0xb7d5('0x6b')]];if(_[_0xb7d5('0x1e')](_0x5a5c25)){_0x3f8225({'ret':0x1});}else{var _0x10a450=_0x5a5c25[_0xb7d5('0x6c')];var _0x317401=squel[_0xb7d5('0x29')]()[_0xb7d5('0x2a')](_0x3ebd67)['set']('id',_0x51a672['id'])[_0xb7d5('0x6d')](_0xb7d5('0x6e'),_0x10a450)[_0xb7d5('0x6d')](_0xb7d5('0x6b'),_0x51a672[_0xb7d5('0x6b')])[_0xb7d5('0x40')]();return db[_0xb7d5('0x5d')][_0xb7d5('0x5e')](_0x317401)[_0xb7d5('0x5f')](function(_0x3a323e){_0x3f8225({'ret':0x1});})[_0xb7d5('0x60')](function(_0x3a0548){logger[_0xb7d5('0x59')](_0x3a0548[_0xb7d5('0x5a')]);_0x163029({'ret':0x1});});}});}function handleTZQuery(_0x56a10c){logger[_0xb7d5('0x6f')](_0x56a10c);return db[_0xb7d5('0x5d')]['query'](_0x56a10c)['spread'](function(_0x39027e){})[_0xb7d5('0x60')](function(_0x175019){logger[_0xb7d5('0x59')](_0x175019['message']);});}function main(_0x19fccd,_0x4cd172,_0x5d0227,_0x3413d1){logger[_0xb7d5('0x6f')](_0xb7d5('0x70'),_0x19fccd,JSON[_0xb7d5('0x71')](_0x4cd172));process[_0xb7d5('0x72')](_0xb7d5('0x73'));var _0x3b73d3=_0x4cd172[_0xb7d5('0x74')];var _0x14ce97=_[_0xb7d5('0x75')](_0x3b73d3);var _0x6e6b81=_0x4cd172[_0xb7d5('0x76')];var _0x1b75e1=path['join'](config['root'],_0xb7d5('0x77'),_0x6e6b81+_0xb7d5('0x78'));hasTZ=_[_0xb7d5('0x51')](_0x3b73d3)[_0xb7d5('0x79')](_0xb7d5('0x6b'));var _0x244b2f=_[_0xb7d5('0x51')](_0x3b73d3)['join']();logger[_0xb7d5('0x6f')](_0xb7d5('0x7a'),_0x244b2f);db[_0xb7d5('0x7b')]['findAll']({'raw':!![],'attributes':['id',_0xb7d5('0x7c')]})['then'](function(_0x4f2188){for(var _0x1e3802=0x0;_0x1e3802<_0x4f2188[_0xb7d5('0x1d')];_0x1e3802++){if(_0x4f2188[_0x1e3802]['name']in _0x3b73d3){contactItemTypes[_0xb7d5('0x18')](_0x4f2188[_0x1e3802]);delete _0x14ce97[_0x4f2188[_0x1e3802][_0xb7d5('0x7c')]];hasAdditionalPhones=!![];}for(var _0x590c68 in _0x3b73d3){if(_0x4f2188[_0x1e3802][_0xb7d5('0x7c')]+_0xb7d5('0x7d')===_0x590c68){phoneDescriptions[_0xb7d5('0x18')]({'itemTypeId':_0x4f2188[_0x1e3802]['id'],'description':_0x590c68});delete _0x14ce97[_0x590c68];}}}if(hasAdditionalPhones)_0x14ce97[_0xb7d5('0x1a')]='';var _0x2fe219=_[_0xb7d5('0x51')](_0x14ce97)['join']();logger[_0xb7d5('0x6f')](_0xb7d5('0x7a'),_0x2fe219);fs[_0xb7d5('0x7e')](_0x1b75e1,_0x2fe219+'\x0a');Papa[_0xb7d5('0x7f')](fs[_0xb7d5('0x80')](_0x19fccd),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36da12,_0x58ad30){try{for(var _0x59b88d=0x0,_0x86b023=[];_0x59b88d<_0x36da12[_0xb7d5('0x81')][_0xb7d5('0x1d')];_0x59b88d++){stats[_0xb7d5('0x82')]+=0x1;if(_0x36da12[_0xb7d5('0x5c')][_0x59b88d]){handleError(_0x36da12[_0xb7d5('0x81')][_0x59b88d],_0x36da12[_0xb7d5('0x5c')][_0x59b88d]);}else{var _0x5c8b95=[];var _0x266a5d=[];var _0x3bb3f0={};for(var _0x169c07 in _0x3b73d3){let _0x275ff8=contactItemTypes[_0xb7d5('0x83')](_0x1cb148=>_0x1cb148[_0xb7d5('0x7c')]===_0x169c07);let _0x2ea0d5=contactItemTypes[_0xb7d5('0x83')](_0x3b2e77=>_0x3b2e77['name']+_0xb7d5('0x7d')===_0x169c07);if(_[_0xb7d5('0x1e')](_0x275ff8)&&_[_0xb7d5('0x1e')](_0x2ea0d5)){if(_0x3b73d3[_0xb7d5('0x84')](_0x169c07)){if(_0x36da12[_0xb7d5('0x81')][_0x59b88d][_0x3b73d3[_0x169c07]]){var _0x14871a=_[_0xb7d5('0x85')](_0x36da12[_0xb7d5('0x81')][_0x59b88d][_0x3b73d3[_0x169c07]][_0xb7d5('0x86')](/"/g,'\x27'));switch(_0x169c07){case _0xb7d5('0x2d'):var _0xc35acd=moment(_0x14871a,_0xb7d5('0xd'),!![]);if(_0xc35acd[_0xb7d5('0x87')]()){_0x86b023[_0xb7d5('0x18')]('\x22'+_0x14871a+'\x22');}else{_0x5c8b95[_0xb7d5('0x18')](_0xb7d5('0x88'));}break;case'priority':var _0x35083c=parseInt(_0x14871a);_0x14871a=_[_0xb7d5('0x89')](_0x35083c)||_0x35083c<0x0||_0x35083c>0x4?_0x3413d1?0x3:0x2:_0x35083c;_0x86b023[_0xb7d5('0x18')]('\x22'+_0x14871a+'\x22');break;case _0xb7d5('0x31'):var _0x26ef16=parseInt(_0x14871a);if(_[_0xb7d5('0x8a')](_0x26ef16)&&_[_0xb7d5('0x79')](_0x5d0227,_0x26ef16)){_0x86b023['push']('\x22'+_0x26ef16+'\x22');}else{_0x5c8b95[_0xb7d5('0x18')](_0xb7d5('0x8b'));}break;case'email':if(isEmail(_0x14871a)){_0x86b023['push']('\x22'+_0x14871a+'\x22');}else{_0x5c8b95[_0xb7d5('0x18')](_0xb7d5('0x8c'));}break;case _0xb7d5('0x8d'):var _0x15ac37=moment(_0x14871a,_0xb7d5('0x8e'),!![]);if(_0x15ac37[_0xb7d5('0x87')]()){_0x86b023[_0xb7d5('0x18')]('\x22'+_0x14871a+'\x22');}else{_0x5c8b95[_0xb7d5('0x18')](_0xb7d5('0x8f'));}break;case'dialTimezone':var _0x3c6eaf=shared[_0xb7d5('0x6a')];var _0x322f81=_0x3c6eaf[_0x14871a];if(!_[_0xb7d5('0x1e')](_0x322f81)){var _0xd3d352=_0x322f81[_0xb7d5('0x6c')];_0x86b023['push']('\x22'+_0x14871a+'\x22');_0x86b023[_0xb7d5('0x18')]('\x22'+_0xd3d352+'\x22');}break;default:_0x86b023['push']('\x22'+_0x14871a+'\x22');}}else{switch(_0x169c07){case _0xb7d5('0x90'):case'phone':_0x5c8b95['push'](_0x169c07+_0xb7d5('0x91'));break;default:_0x86b023[_0xb7d5('0x18')]('\x22\x22');}}}}else{var _0x53caf3='';if(!_[_0xb7d5('0x1e')](_0x275ff8)){if(!_0x3bb3f0[_0xb7d5('0x84')](_0x275ff8['id'])){if(!_[_0xb7d5('0x1e')](_0x36da12[_0xb7d5('0x81')][_0x59b88d][_0x3b73d3[_0x169c07]])){var _0x14871a=_[_0xb7d5('0x85')](_0x36da12[_0xb7d5('0x81')][_0x59b88d][_0x3b73d3[_0x169c07]]['replace'](/"/g,'\x27'));var _0x2edaea=phoneDescriptions[_0xb7d5('0x83')](_0x3eb40f=>_0x3eb40f[_0xb7d5('0x92')]===_0x275ff8['id']);if(!_['isNil'](_0x2edaea)){var _0x5ba6f9=_[_0xb7d5('0x85')](_0x36da12[_0xb7d5('0x81')][_0x59b88d][_0x3b73d3[_0x2edaea['description']]][_0xb7d5('0x86')](/"/g,'\x27'));if(!_['isNil'](_0x5ba6f9))_0x14871a=_0x14871a+'§'+_0x5ba6f9;}if(_0x53caf3=='')_0x53caf3=_0x14871a;else _0x53caf3+='|'+_0x14871a;}_0x266a5d[_0xb7d5('0x18')](_0x275ff8['id']+':'+_0x53caf3);_0x3bb3f0[_0x275ff8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x86b023[_0xb7d5('0x18')]('\x22'+_0x266a5d['join'](';')+'\x22');}if(_0x5c8b95[_0xb7d5('0x1d')]){handleError(_0x36da12['data'][_0x59b88d],{'code':'SystemRow','message':_0x5c8b95['join']()});}else{fs['appendFileSync'](_0x1b75e1,_0x86b023['join']()+'\x0a');}_0x86b023=[];}if(!(stats[_0xb7d5('0x82')]%0xc8)){socket['emit'](_0xb7d5('0x93')+_0x6e6b81,stats);stats[_0xb7d5('0x5c')]=[];}}if(stopped){logger['info'](_0xb7d5('0x94'));_0x58ad30[_0xb7d5('0x95')]();}}catch(_0x238f91){handleError(_0x36da12[_0xb7d5('0x81')][_0x59b88d],{'code':_0xb7d5('0x96'),'message':_0x238f91[_0xb7d5('0x5a')]});logger[_0xb7d5('0x59')]('step',_0x238f91[_0xb7d5('0x5a')]);}},'complete':function(){try{var _0x29fd4f=[];var _0x34c4a7=[];var _0x39e13d=_0xb7d5('0x3d');if(_0x4cd172[_0xb7d5('0x97')]&&_0x4cd172[_0xb7d5('0x97')]['length']){_0x39e13d='cm_contacts_'+_0x6e6b81;_0x29fd4f[_0xb7d5('0x18')]('CREATE\x20TABLE\x20'+_0x39e13d+'\x20LIKE\x20cm_contacts;');}tmp_campaigns='campaigns_'+_0x6e6b81;tmp_voice_queues=_0xb7d5('0x98')+_0x6e6b81;_0x34c4a7['push'](_0xb7d5('0x99')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x34c4a7[_0xb7d5('0x18')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xb7d5('0x9a'));BPromise['each'](_0x34c4a7,handleTZQuery)[_0xb7d5('0x1c')](function(_0x2d43e2){updateTzCampaigns(_0x4cd172[_0xb7d5('0x2e')])['then'](function(_0x252ac){updateTzVoiceQueues(_0x4cd172[_0xb7d5('0x2e')])[_0xb7d5('0x1c')](function(_0x12b67c){if(hasTZ)_0x2fe219=_0x2fe219[_0xb7d5('0x86')](_0xb7d5('0x6b'),_0xb7d5('0x9b'));var _0x556da5=util['format'](_0xb7d5('0x9c'),_0x1b75e1,_0x39e13d,_0x2fe219,_0x4cd172[_0xb7d5('0x2e')],_0x4cd172[_0xb7d5('0x52')]||null,NOW,NOW);if(_['isNil'](_0x3b73d3[_0xb7d5('0x2d')])){_0x556da5+=_0xb7d5('0x9d');}_0x29fd4f[_0xb7d5('0x18')](_0x556da5);if(_0x4cd172[_0xb7d5('0x97')]&&_0x4cd172['duplicates']['length']){_0x29fd4f[_0xb7d5('0x18')](insertCmContact(_0x4cd172[_0xb7d5('0x2e')],_0x39e13d,_0x4cd172[_0xb7d5('0x97')],_0x3b73d3));_0x29fd4f[_0xb7d5('0x18')](_0xb7d5('0x9e')+_0x39e13d+';');}BPromise[_0xb7d5('0x9f')](_0x29fd4f,handleQuery)[_0xb7d5('0x1c')](function(_0x372361){BPromise[_0xb7d5('0x19')]([handleAdditionalPhones()])['then'](function(){_0x29fd4f=[];for(var _0x17d889=0x0;_0x17d889\x20\x20','existsSync','file\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','all','then','catch','error','AdditionalPhones','split','filter','findOne','CmContactHasItem','update','updated','create','inserted','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','into','cm_hopper_black','fromQuery','ContactId','cm_contacts','.CmListId','.CmListId\x20=\x20?','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','message','exit','errors','main','stringify','send','start','binding'];(function(_0x5b5466,_0x35d36e){var _0x1a1d28=function(_0x17ca4b){while(--_0x17ca4b){_0x5b5466['push'](_0x5b5466['shift']());}};_0x1a1d28(++_0x35d36e);}(_0xa19c,0xce));var _0xca19=function(_0x17609f,_0x26cdf5){_0x17609f=_0x17609f-0x0;var _0x227ace=_0xa19c[_0x17609f];return _0x227ace;};'use strict';var fs=require('fs');var path=require(_0xca19('0x0'));var _=require(_0xca19('0x1'));var Papa=require(_0xca19('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xca19('0x3'));var squel=require('squel');var Redis=require(_0xca19('0x4'));var db=require(_0xca19('0x5'))['db'];var config=require(_0xca19('0x6'));var logger=require(_0xca19('0x7'))('import');config[_0xca19('0x8')]=_['defaults'](config[_0xca19('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xca19('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xca19('0xa')](_0xca19('0xb'));var tempTableName=_0xca19('0xc')+moment()[_0xca19('0xa')](_0xca19('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x53f1cf){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))*$/[_0xca19('0xe')](_0x53f1cf);}function selectNotIn(_0x3b1a8d,_0x3ff87d,_0x32434a,_0x3c6e10,_0x14fd71){return squel[_0xca19('0xf')]()[_0xca19('0x10')](_0xca19('0x11'))[_0xca19('0x12')](_0x3c6e10)[_0xca19('0x13')](_0x3ff87d,null,_0x3ff87d+'.id\x20=\x20'+_0x3c6e10+'.'+_0x32434a)[_0xca19('0x14')](_0x3c6e10+'.'+_0x32434a+_0xca19('0x15')+_0x3b1a8d+'.'+_0x32434a)[_0xca19('0x14')](_0x3ff87d+_0xca19('0x16')+_0x14fd71[_0xca19('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3dad52,_0x4129eb){promisesAdditionalPhones=[];promisesContact=[];return db[_0xca19('0x17')][_0xca19('0x18')](_0xca19('0x19')+tempTableName)[_0xca19('0x1a')](function(_0x28c04e){if(_0x28c04e!==null){var _0x191ef5=[];for(var _0x4bc798=0x0;_0x4bc798<_0x28c04e[_0xca19('0x1b')];_0x4bc798++){var _0x2c65f1=_0x28c04e[_0x4bc798];if(!_[_0xca19('0x1c')](_0x2c65f1[_0xca19('0x11')])){if(!_[_0xca19('0x1c')](_0x2c65f1['AdditionalPhones']))_0x191ef5['push'](insertAdditionalPhones(_0x2c65f1));promisesContact[_0xca19('0x1d')]({'contact':_0x2c65f1});}}}Promise[_0xca19('0x1e')](_0x191ef5)[_0xca19('0x1f')](function(){_0x3dad52({'val':0x1});});})[_0xca19('0x20')](function(_0x797ed8){logger[_0xca19('0x21')](_0x797ed8['message']);});});}function insertAdditionalPhones(_0x383f9c){return new Promise(function(_0x8ae4f1,_0x3797e3){var _0x3facea=_0x383f9c[_0xca19('0x22')];if(_[_0xca19('0x1c')](_0x3facea))_0x3797e3({'val':0x0});else{var _0x444379=_0x3facea[_0xca19('0x23')](';');var _0x4527e4=[];orderBy=0x0;for(var _0x32af14=0x0;_0x32af14<_0x444379[_0xca19('0x1b')];_0x32af14++){_0x4527e4[_0xca19('0x1d')](splitAdditionalPhone(_0x383f9c['id'],_0x444379[_0x32af14]));}Promise[_0xca19('0x1e')](_0x4527e4)[_0xca19('0x1f')](function(){_0x8ae4f1({'val':_0x444379[_0xca19('0x1b')]});});}});}function splitAdditionalPhone(_0xbec3ec,_0x42c3ca){return new Promise(function(_0x8afa0f,_0x9d545c){var _0x40956d=_0x42c3ca[_0xca19('0x23')](':');var _0x475be9=_0x40956d[0x0];var _0x3d0803=_0x40956d[0x1];if(_0x3d0803!==''){var _0x51544f=_0x3d0803[_0xca19('0x23')]('|');var _0x1fffdd=[];for(var _0x5bf442=0x0;_0x5bf442<_0x51544f['length'];_0x5bf442++){if(_0x51544f[_0x5bf442]!==''){var _0x517086=_[_0xca19('0x24')](promisesAdditionalPhones,{'contactId':_0xbec3ec,'phone':_0x51544f[_0x5bf442]});if(_0x517086['length']==0x0){orderBy++;promisesAdditionalPhones[_0xca19('0x1d')]({'contactId':_0xbec3ec,'contactTypeId':_0x475be9,'phone':_0x51544f[_0x5bf442],'orderBy':orderBy});}}}_0x8afa0f({'ok':0x1});}else _0x8afa0f({'res':0x0});});}function createAdditionalPhone(_0x237dd9,_0x1b48cb,_0x2fabbe,_0x557388){var _0x58d17f='';var _0x2370da='';var _0x1750ce=_0x2fabbe['split']('§');_0x58d17f=_0x1750ce[0x0];if(_0x1750ce[_0xca19('0x1b')]==0x2)_0x2370da=_0x1750ce[0x1];return new Promise(function(_0x56b8ff,_0x5c5dbc){return db['CmContactHasItem'][_0xca19('0x25')]({'where':{'CmContactId':_0x237dd9,'item':_0x58d17f}})[_0xca19('0x1f')](function(_0x5b44e0){if(_0x5b44e0){return db[_0xca19('0x26')][_0xca19('0x27')]({'ItemTypeId':_0x1b48cb,'description':_0x2370da,'OrderBy':_0x557388},{'where':{'CmContactId':_0x237dd9,'item':_0x58d17f}})['then'](function(_0x2decd1){_0x56b8ff({'res':_0xca19('0x28')});});}else{return db['CmContactHasItem'][_0xca19('0x29')]({'CmContactId':_0x237dd9,'item':_0x58d17f,'ItemTypeId':_0x1b48cb,'description':_0x2370da,'OrderBy':_0x557388,'ItemClass':'PHONE'})[_0xca19('0x1f')](function(_0x118312){_0x56b8ff({'res':_0xca19('0x2a')});});}});});}function updateContact(_0x236e83){return new Promise(function(_0x4d1402,_0x2c68f2){var _0x188670=_0x236e83['id'];delete _0x236e83['id'];return db['CmContact'][_0xca19('0x27')](_0x236e83,{'where':{'id':_0x188670}})[_0xca19('0x1f')](function(_0x22aabb){updatedRows+=0x1;return db[_0xca19('0x2b')]['update']({'phone':_0x236e83[_0xca19('0x11')]},{'where':{'ContactId':_0x188670}})[_0xca19('0x1f')](function(_0x1658eb){_0x4d1402({'ret':'OK'});});});});}function insertCmHopper(_0x557f91,_0xaaad4b,_0x2d334d,_0x20064d,_0x48557a){var _0x149baf=['cm_contacts.phone',_0xca19('0x2c'),_0xca19('0x2d'),_0xca19('0x2e'),_0xaaad4b+'.'+_0x20064d,_0xca19('0x2f'),'cm_contacts.updatedAt',_0xca19('0x30'),_0xca19('0x31'),'\x22'+_0x48557a+'\x22'];return squel[_0xca19('0x32')]()['into'](_0xca19('0x33'))['fromQuery']([_0xca19('0x11'),_0xca19('0x34'),'ContactId',_0xca19('0x35'),_0x20064d,_0xca19('0x36'),_0xca19('0x37'),_0xca19('0x38'),_0xca19('0x39'),_0xca19('0x3a')],squel['select']()[_0xca19('0x3b')](_0x149baf)[_0xca19('0x12')](_0xaaad4b)[_0xca19('0x13')]('cm_contacts',null,_0xca19('0x3c')+_0xaaad4b+'.CmListId')[_0xca19('0x13')](_0x2d334d,null,_0x2d334d+_0xca19('0x3d')+_0xaaad4b+'.'+_0x20064d)[_0xca19('0x14')](_0xaaad4b+'.CmListId\x20=\x20?',_0x557f91)['where'](_0xca19('0x3e'),NOW)[_0xca19('0x14')](_0xca19('0x3f'),selectNotIn(_0xaaad4b,_0x2d334d,_0x20064d,_0xca19('0x33'),[_0xca19('0x40'),'\x22onlyIfOpen\x22']))[_0xca19('0x14')](_0xca19('0x3f'),selectNotIn(_0xaaad4b,_0x2d334d,_0x20064d,'cm_hopper',[_0xca19('0x40')])))[_0xca19('0x41')]();}function insertCmHopperBlack(_0x5325b0,_0x2a9b2f,_0x3dfbfd,_0x102791){var _0x37f12c=[_0xca19('0x42'),_0xca19('0x2d'),_0xca19('0x2e'),_0x2a9b2f+'.'+_0x102791,_0xca19('0x2f'),'cm_contacts.updatedAt'];return squel['insert']()[_0xca19('0x43')](_0xca19('0x44'))[_0xca19('0x45')]([_0xca19('0x11'),_0xca19('0x46'),_0xca19('0x35'),_0x102791,_0xca19('0x36'),_0xca19('0x37')],squel['select']()[_0xca19('0x3b')](_0x37f12c)['from'](_0x2a9b2f)[_0xca19('0x13')](_0xca19('0x47'),null,_0xca19('0x3c')+_0x2a9b2f+_0xca19('0x48'))[_0xca19('0x13')](_0x3dfbfd,null,_0x3dfbfd+_0xca19('0x3d')+_0x2a9b2f+'.'+_0x102791)[_0xca19('0x14')](_0x2a9b2f+_0xca19('0x49'),_0x5325b0)['where'](_0xca19('0x3e'),NOW)[_0xca19('0x14')](_0xca19('0x3f'),squel['select']()['field'](_0xca19('0x11'))[_0xca19('0x12')](_0xca19('0x44'))[_0xca19('0x14')](_0xca19('0x4a'),_0x5325b0)[_0xca19('0x14')](_0x102791+'\x20=\x20?',_0x2a9b2f+'.'+_0x102791)))[_0xca19('0x41')]();}function insertCmHopperAdditionalPhones(_0x27eb19){var _0x4138d=[_0xca19('0x4b'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xca19('0x4c'),_0xca19('0x4d')];return squel[_0xca19('0x32')]()[_0xca19('0x43')](_0xca19('0x4e'))[_0xca19('0x45')](['CmHopperId','phone','OrderBy',_0xca19('0x36'),_0xca19('0x37')],squel[_0xca19('0xf')]()['fields'](_0x4138d)[_0xca19('0x12')](_0xca19('0x33'))['join']('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xca19('0x13')](_0xca19('0x4f'),null,_0xca19('0x50'))[_0xca19('0x14')](_0xca19('0x51'),_0x27eb19)['where'](_0xca19('0x3e'),NOW))['toString']();}function insertCmContact(_0x3f4e92,_0x42ecf0,_0x109576,_0xbbd072){var _0x2ff09d=_['concat'](_['keys'](_0xbbd072),['ListId',_0xca19('0x52'),_0xca19('0x36'),_0xca19('0x37')]);return squel['insert']()[_0xca19('0x43')](_0xca19('0x47'))[_0xca19('0x45')](_0x2ff09d,squel['select']()[_0xca19('0x3b')](_0x2ff09d)[_0xca19('0x12')](_0x42ecf0)[_0xca19('0x14')]('('+_0x109576[_0xca19('0x13')](',')+_0xca19('0x53'),squel[_0xca19('0xf')]()['fields'](_0x109576)[_0xca19('0x12')](_0xca19('0x47'))['where']('ListId\x20=\x20?',_0x3f4e92))[_0xca19('0x14')]('id\x20IN\x20?',squel[_0xca19('0xf')]()[_0xca19('0x10')](_0xca19('0x54'),_0xca19('0x55'))['from'](_0x42ecf0)['group'](_0x109576['join'](','))))['toString']();}function handleStop(){logger[_0xca19('0x56')](_0xca19('0x57'));stopped=!![];}function handleUncaughtException(_0x3958d8){logger['error'](_0x3958d8[_0xca19('0x58')]);process[_0xca19('0x59')](0x1);}function handleError(_0x43658c,_0x1d4c0c){stats[_0xca19('0x5a')]['push']({'name':_0x1d4c0c['code'],'message':_0x1d4c0c[_0xca19('0x58')],'row':_0x43658c});}function handleQuery(_0x22a317){logger[_0xca19('0x56')](_0x22a317);return db[_0xca19('0x17')][_0xca19('0x18')](_0x22a317)[_0xca19('0x1a')](function(_0x5f50fe){results['push'](_0x5f50fe);})[_0xca19('0x20')](function(_0x1011bc){logger[_0xca19('0x21')](_0x1011bc['message']);});}function main(_0x47ecc5,_0x91965b,_0x44c361,_0x3b5247){logger[_0xca19('0x56')](_0xca19('0x5b'),_0x47ecc5,JSON[_0xca19('0x5c')](_0x91965b));process[_0xca19('0x5d')](_0xca19('0x5e'));var _0x4d3180=_0x91965b[_0xca19('0x5f')];var _0x26cb73=_[_0xca19('0x60')](_0x4d3180);var _0x11ac4f=_0x91965b[_0xca19('0x61')];var _0x379b5f=path[_0xca19('0x13')](config[_0xca19('0x62')],_0xca19('0x63'),_0x11ac4f+_0xca19('0x64'));logger['info'](_0xca19('0x65'),_0x91965b);db[_0xca19('0x66')][_0xca19('0x67')]({'raw':!![],'attributes':['id','name']})[_0xca19('0x1f')](function(_0x138a74){for(var _0x590bc4=0x0;_0x590bc4<_0x138a74[_0xca19('0x1b')];_0x590bc4++){if(_0x138a74[_0x590bc4][_0xca19('0x68')]in _0x4d3180){contactItemTypes[_0xca19('0x1d')](_0x138a74[_0x590bc4]);delete _0x26cb73[_0x138a74[_0x590bc4][_0xca19('0x68')]];hasAdditionalPhones=!![];}for(var _0x25f8c0 in _0x4d3180){if(_0x138a74[_0x590bc4][_0xca19('0x68')]+'_description'===_0x25f8c0){phoneDescriptions[_0xca19('0x1d')]({'itemTypeId':_0x138a74[_0x590bc4]['id'],'description':_0x25f8c0});delete _0x26cb73[_0x25f8c0];}}}if(hasAdditionalPhones)_0x26cb73[_0xca19('0x22')]='';var _0x521dd8=_[_0xca19('0x69')](_0x26cb73)['join']();logger[_0xca19('0x56')](_0xca19('0x6a'),_0x521dd8);fs[_0xca19('0x6b')](_0x379b5f,_0x521dd8+'\x0a');Papa[_0xca19('0x6c')](fs['createReadStream'](_0x47ecc5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d1005,_0x43d40c){try{for(var _0x3ca50d=0x0,_0x1dc374=[];_0x3ca50d<_0x5d1005[_0xca19('0x6d')][_0xca19('0x1b')];_0x3ca50d++){stats['rows']+=0x1;if(_0x5d1005[_0xca19('0x5a')][_0x3ca50d]){handleError(_0x5d1005[_0xca19('0x6d')][_0x3ca50d],_0x5d1005[_0xca19('0x5a')][_0x3ca50d]);}else{var _0x45f9bf=[];var _0x36b08d=[];var _0x2e7be5={};for(var _0x59b146 in _0x4d3180){let _0x2938cc=contactItemTypes[_0xca19('0x6e')](_0x85bcad=>_0x85bcad['name']===_0x59b146);let _0xa3a1f1=contactItemTypes[_0xca19('0x6e')](_0x1298c0=>_0x1298c0[_0xca19('0x68')]+'_description'===_0x59b146);if(_[_0xca19('0x1c')](_0x2938cc)&&_[_0xca19('0x1c')](_0xa3a1f1)){if(_0x4d3180['hasOwnProperty'](_0x59b146)){if(_0x5d1005[_0xca19('0x6d')][_0x3ca50d][_0x4d3180[_0x59b146]]){var _0x12c1b8=_[_0xca19('0x6f')](_0x5d1005[_0xca19('0x6d')][_0x3ca50d][_0x4d3180[_0x59b146]]['replace'](/"/g,'\x27'));switch(_0x59b146){case _0xca19('0x34'):var _0x286237=moment(_0x12c1b8,_0xca19('0xb'),!![]);if(_0x286237[_0xca19('0x70')]()){_0x1dc374['push']('\x22'+_0x12c1b8+'\x22');}else{_0x45f9bf[_0xca19('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x3359ea=parseInt(_0x12c1b8);_0x12c1b8=_['isNaN'](_0x3359ea)||_0x3359ea<0x0||_0x3359ea>0x4?_0x3b5247?0x3:0x2:_0x3359ea;_0x1dc374[_0xca19('0x1d')]('\x22'+_0x12c1b8+'\x22');break;case _0xca19('0x39'):var _0x3b4b12=parseInt(_0x12c1b8);if(_['isNumber'](_0x3b4b12)&&_[_0xca19('0x71')](_0x44c361,_0x3b4b12)){_0x1dc374[_0xca19('0x1d')]('\x22'+_0x3b4b12+'\x22');}else{_0x45f9bf[_0xca19('0x1d')](_0xca19('0x72'));}break;case _0xca19('0x73'):if(isEmail(_0x12c1b8)){_0x1dc374['push']('\x22'+_0x12c1b8+'\x22');}else{_0x45f9bf['push']('email\x20wrong\x20format');}break;case _0xca19('0x74'):var _0x46f440=moment(_0x12c1b8,'YYYY-MM-DD',!![]);if(_0x46f440[_0xca19('0x70')]()){_0x1dc374[_0xca19('0x1d')]('\x22'+_0x12c1b8+'\x22');}else{_0x45f9bf[_0xca19('0x1d')](_0xca19('0x75'));}break;default:_0x1dc374[_0xca19('0x1d')]('\x22'+_0x12c1b8+'\x22');}}else{switch(_0x59b146){case _0xca19('0x76'):case _0xca19('0x11'):_0x45f9bf[_0xca19('0x1d')](_0x59b146+_0xca19('0x77'));break;default:_0x1dc374[_0xca19('0x1d')]('\x22\x22');}}}}else{var _0x69f2f9='';if(!_[_0xca19('0x1c')](_0x2938cc)){if(!_0x2e7be5[_0xca19('0x78')](_0x2938cc['id'])){for(var _0x45dd60=0x0;_0x45dd60<_0x4d3180[_0x59b146][_0xca19('0x1b')];_0x45dd60++){var _0x12c1b8=_[_0xca19('0x6f')](_0x5d1005['data'][_0x3ca50d][_0x4d3180[_0x59b146][_0x45dd60]][_0xca19('0x79')](/"/g,'\x27'));var _0x4b3f60=phoneDescriptions[_0xca19('0x6e')](_0x55d446=>_0x55d446[_0xca19('0x7a')]===_0x2938cc['id']);if(!_[_0xca19('0x1c')](_0x4b3f60)){var _0x9d4f44=_['trim'](_0x5d1005[_0xca19('0x6d')][_0x3ca50d][_0x4d3180[_0x4b3f60[_0xca19('0x7b')]][0x0]][_0xca19('0x79')](/"/g,'\x27'));if(!_['isNil'](_0x9d4f44))_0x12c1b8=_0x12c1b8+'§'+_0x9d4f44;}if(_0x69f2f9=='')_0x69f2f9=_0x12c1b8;else _0x69f2f9+='|'+_0x12c1b8;}_0x36b08d[_0xca19('0x1d')](_0x2938cc['id']+':'+_0x69f2f9);_0x2e7be5[_0x2938cc['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1dc374[_0xca19('0x1d')]('\x22'+_0x36b08d[_0xca19('0x13')](';')+'\x22');}if(_0x45f9bf[_0xca19('0x1b')]){handleError(_0x5d1005[_0xca19('0x6d')][_0x3ca50d],{'code':_0xca19('0x7c'),'message':_0x45f9bf['join']()});}else{fs[_0xca19('0x7d')](_0x379b5f,_0x1dc374[_0xca19('0x13')]()+'\x0a');}_0x1dc374=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xca19('0x7e')+_0x11ac4f,stats);stats[_0xca19('0x5a')]=[];}}if(stopped){logger['info'](_0xca19('0x7f'));_0x43d40c[_0xca19('0x80')]();}}catch(_0x186c2c){handleError(_0x5d1005[_0xca19('0x6d')][_0x3ca50d],{'code':_0xca19('0x81'),'message':_0x186c2c[_0xca19('0x58')]});logger[_0xca19('0x21')](_0xca19('0x82'),_0x186c2c[_0xca19('0x58')]);}},'complete':function(){try{var _0x1c2fbd=[];var _0x2ba190=tempTableName;_0x1c2fbd[_0xca19('0x1d')]('CREATE\x20TABLE\x20'+_0x2ba190+_0xca19('0x83'));logger[_0xca19('0x56')]('CIS\x20len',contactItemTypes['length']);var _0x11fc91=util[_0xca19('0xa')](_0xca19('0x84'),_0x379b5f,_0x2ba190,_0x521dd8,_0x91965b[_0xca19('0x35')],_0x91965b[_0xca19('0x52')]||null,NOW,NOW);if(_[_0xca19('0x1c')](_0x4d3180[_0xca19('0x34')])){_0x11fc91+=_0xca19('0x85');}_0x1c2fbd[_0xca19('0x1d')](_0x11fc91);BPromise[_0xca19('0x86')](_0x1c2fbd,handleQuery)[_0xca19('0x1f')](function(_0x543618){BPromise['all']([handleAdditionalPhones()])[_0xca19('0x1f')](function(){_0x1c2fbd=[];for(var _0x5b6fea=0x0;_0x5b6fea\x20\x20','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','query','select\x20*\x20from\x20','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','findOne','update','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','ListId','createdAt','updatedAt','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','into','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','field','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x7e27,0xdd));var _0x77e2=function(_0x5db0c0,_0x500a89){_0x5db0c0=_0x5db0c0-0x0;var _0x435be1=_0x7e27[_0x5db0c0];return _0x435be1;};'use strict';var fs=require('fs');var path=require(_0x77e2('0x0'));var _=require(_0x77e2('0x1'));var Papa=require('papaparse');var util=require(_0x77e2('0x2'));var BPromise=require(_0x77e2('0x3'));var moment=require(_0x77e2('0x4'));var squel=require(_0x77e2('0x5'));var Redis=require('ioredis');var db=require(_0x77e2('0x6'))['db'];var config=require(_0x77e2('0x7'));var logger=require(_0x77e2('0x8'))('import');config[_0x77e2('0x9')]=_['defaults'](config[_0x77e2('0x9')],{'host':_0x77e2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x77e2('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x77e2('0xb')](_0x77e2('0xc'));var tempTableName=_0x77e2('0xd')+moment()[_0x77e2('0xb')](_0x77e2('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x23583e){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'](_0x23583e);}function selectNotIn(_0x5022db,_0x1b4740,_0x533557,_0x1f0cba,_0xf8293f){return squel['select']()['field'](_0x77e2('0xf'))[_0x77e2('0x10')](_0x1f0cba)['join'](_0x1b4740,null,_0x1b4740+_0x77e2('0x11')+_0x1f0cba+'.'+_0x533557)['where'](_0x1f0cba+'.'+_0x533557+'\x20=\x20'+_0x5022db+'.'+_0x533557)[_0x77e2('0x12')](_0x1b4740+_0x77e2('0x13')+_0xf8293f[_0x77e2('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x33e820,_0x20276){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x77e2('0x15')](_0x77e2('0x16')+tempTableName)['spread'](function(_0x46fb81){if(_0x46fb81!==null){var _0x134fee=[];for(var _0x349627=0x0;_0x349627<_0x46fb81[_0x77e2('0x17')];_0x349627++){var _0x266710=_0x46fb81[_0x349627];if(!_[_0x77e2('0x18')](_0x266710[_0x77e2('0xf')])){if(!_[_0x77e2('0x18')](_0x266710[_0x77e2('0x19')]))_0x134fee[_0x77e2('0x1a')](insertAdditionalPhones(_0x266710));promisesContact['push']({'contact':_0x266710});}}}Promise[_0x77e2('0x1b')](_0x134fee)[_0x77e2('0x1c')](function(){_0x33e820({'val':0x1});});})[_0x77e2('0x1d')](function(_0x15d65e){logger[_0x77e2('0x1e')](_0x15d65e[_0x77e2('0x1f')]);});});}function insertAdditionalPhones(_0x1a5415){return new Promise(function(_0x1e5273,_0x298ab0){var _0x3c9dd8=_0x1a5415[_0x77e2('0x19')];if(_['isNil'](_0x3c9dd8))_0x298ab0({'val':0x0});else{var _0x158547=_0x3c9dd8[_0x77e2('0x20')](';');var _0x4c0d0a=[];orderBy=0x0;for(var _0x2d30d3=0x0;_0x2d30d3<_0x158547['length'];_0x2d30d3++){_0x4c0d0a['push'](splitAdditionalPhone(_0x1a5415['id'],_0x158547[_0x2d30d3]));}Promise[_0x77e2('0x1b')](_0x4c0d0a)['then'](function(){_0x1e5273({'val':_0x158547[_0x77e2('0x17')]});});}});}function splitAdditionalPhone(_0x1c8f39,_0x20eda4){return new Promise(function(_0x5b5844,_0x529a43){var _0x119fb1=_0x20eda4['split'](':');var _0x104860=_0x119fb1[0x0];var _0x370dca=_0x119fb1[0x1];if(_0x370dca!==''){var _0x44ba24=_0x370dca['split']('|');var _0x28765e=[];for(var _0x3413aa=0x0;_0x3413aa<_0x44ba24[_0x77e2('0x17')];_0x3413aa++){if(_0x44ba24[_0x3413aa]!==''){var _0xa2a50f=_[_0x77e2('0x21')](promisesAdditionalPhones,{'contactId':_0x1c8f39,'phone':_0x44ba24[_0x3413aa]});if(_0xa2a50f['length']==0x0){orderBy++;promisesAdditionalPhones[_0x77e2('0x1a')]({'contactId':_0x1c8f39,'contactTypeId':_0x104860,'phone':_0x44ba24[_0x3413aa],'orderBy':orderBy});}}}_0x5b5844({'ok':0x1});}else _0x5b5844({'res':0x0});});}function createAdditionalPhone(_0x52ca41,_0x5013e7,_0x362730,_0x4e7c32){var _0x2acae2='';var _0x11c9f7='';var _0x586919=_0x362730['split']('§');_0x2acae2=_0x586919[0x0];if(_0x586919[_0x77e2('0x17')]==0x2)_0x11c9f7=_0x586919[0x1];return new Promise(function(_0x5002b3,_0x4e5996){return db[_0x77e2('0x22')][_0x77e2('0x23')]({'where':{'CmContactId':_0x52ca41,'item':_0x2acae2}})[_0x77e2('0x1c')](function(_0x97af4b){if(_0x97af4b){return db['CmContactHasItem'][_0x77e2('0x24')]({'ItemTypeId':_0x5013e7,'description':_0x11c9f7,'OrderBy':_0x4e7c32},{'where':{'CmContactId':_0x52ca41,'item':_0x2acae2}})['then'](function(_0x598a4e){_0x5002b3({'res':'updated'});});}else{return db[_0x77e2('0x22')]['create']({'CmContactId':_0x52ca41,'item':_0x2acae2,'ItemTypeId':_0x5013e7,'description':_0x11c9f7,'OrderBy':_0x4e7c32,'ItemClass':'PHONE'})['then'](function(_0x955c4f){_0x5002b3({'res':_0x77e2('0x25')});});}});});}function updateContact(_0xd12c66){return new Promise(function(_0xc4044b,_0x4e4af5){var _0x42764c=_0xd12c66['id'];delete _0xd12c66['id'];return db['CmContact'][_0x77e2('0x24')](_0xd12c66,{'where':{'id':_0x42764c}})['then'](function(_0x24af97){updatedRows+=0x1;return db[_0x77e2('0x26')][_0x77e2('0x24')]({'phone':_0xd12c66[_0x77e2('0xf')]},{'where':{'ContactId':_0x42764c}})[_0x77e2('0x1c')](function(_0x12cca4){_0xc4044b({'ret':'OK'});});});});}function insertCmHopper(_0x380966,_0x54294b,_0x239568,_0x25178b,_0xbc5f8b){var _0x19994e=[_0x77e2('0x27'),_0x77e2('0x28'),_0x77e2('0x29'),_0x77e2('0x2a'),_0x54294b+'.'+_0x25178b,_0x77e2('0x2b'),_0x77e2('0x2c'),_0x77e2('0x2d'),_0x77e2('0x2e'),'\x22'+_0xbc5f8b+'\x22'];return squel[_0x77e2('0x2f')]()['into'](_0x77e2('0x30'))[_0x77e2('0x31')]([_0x77e2('0xf'),'scheduledat','ContactId',_0x77e2('0x32'),_0x25178b,_0x77e2('0x33'),_0x77e2('0x34'),'priority','UserId',_0x77e2('0x35')],squel[_0x77e2('0x36')]()[_0x77e2('0x37')](_0x19994e)[_0x77e2('0x10')](_0x54294b)[_0x77e2('0x14')](_0x77e2('0x38'),null,_0x77e2('0x39')+_0x54294b+_0x77e2('0x3a'))[_0x77e2('0x14')](_0x239568,null,_0x239568+'.id\x20=\x20'+_0x54294b+'.'+_0x25178b)[_0x77e2('0x12')](_0x54294b+_0x77e2('0x3b'),_0x380966)[_0x77e2('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x77e2('0x12')](_0x77e2('0x3c'),selectNotIn(_0x54294b,_0x239568,_0x25178b,_0x77e2('0x30'),[_0x77e2('0x3d'),_0x77e2('0x3e')]))[_0x77e2('0x12')](_0x77e2('0x3c'),selectNotIn(_0x54294b,_0x239568,_0x25178b,_0x77e2('0x30'),['\x22always\x22'])))[_0x77e2('0x3f')]();}function insertCmHopperBlack(_0x45e1d1,_0x4b2d7c,_0x1dea57,_0x37d61e){var _0x8d875f=[_0x77e2('0x27'),_0x77e2('0x29'),_0x77e2('0x2a'),_0x4b2d7c+'.'+_0x37d61e,'cm_contacts.createdAt',_0x77e2('0x2c')];return squel[_0x77e2('0x2f')]()[_0x77e2('0x40')](_0x77e2('0x41'))[_0x77e2('0x31')]([_0x77e2('0xf'),'ContactId',_0x77e2('0x32'),_0x37d61e,_0x77e2('0x33'),_0x77e2('0x34')],squel[_0x77e2('0x36')]()[_0x77e2('0x37')](_0x8d875f)[_0x77e2('0x10')](_0x4b2d7c)['join'](_0x77e2('0x38'),null,_0x77e2('0x39')+_0x4b2d7c+_0x77e2('0x3a'))[_0x77e2('0x14')](_0x1dea57,null,_0x1dea57+'.id\x20=\x20'+_0x4b2d7c+'.'+_0x37d61e)[_0x77e2('0x12')](_0x4b2d7c+_0x77e2('0x3b'),_0x45e1d1)[_0x77e2('0x12')](_0x77e2('0x42'),NOW)[_0x77e2('0x12')](_0x77e2('0x3c'),squel[_0x77e2('0x36')]()[_0x77e2('0x43')]('phone')[_0x77e2('0x10')](_0x77e2('0x41'))[_0x77e2('0x12')](_0x77e2('0x44'),_0x45e1d1)['where'](_0x37d61e+_0x77e2('0x45'),_0x4b2d7c+'.'+_0x37d61e)))['toString']();}function insertCmHopperAdditionalPhones(_0xc792bf){var _0x22b649=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0x77e2('0x46'),_0x77e2('0x47')];return squel[_0x77e2('0x2f')]()[_0x77e2('0x40')](_0x77e2('0x48'))['fromQuery'](['CmHopperId',_0x77e2('0xf'),_0x77e2('0x49'),_0x77e2('0x33'),_0x77e2('0x34')],squel[_0x77e2('0x36')]()[_0x77e2('0x37')](_0x22b649)[_0x77e2('0x10')](_0x77e2('0x30'))[_0x77e2('0x14')](_0x77e2('0x38'),null,_0x77e2('0x4a'))['join']('cm_contact_has_items',null,_0x77e2('0x4b'))[_0x77e2('0x12')](_0x77e2('0x4c'),_0xc792bf)[_0x77e2('0x12')](_0x77e2('0x42'),NOW))[_0x77e2('0x3f')]();}function insertCmContact(_0x3cef16,_0x3ec0f6,_0x1c4b7c,_0x29ac31){var _0x2d03d1=_[_0x77e2('0x4d')](_[_0x77e2('0x4e')](_0x29ac31),[_0x77e2('0x32'),_0x77e2('0x4f'),_0x77e2('0x33'),_0x77e2('0x34')]);return squel[_0x77e2('0x2f')]()[_0x77e2('0x40')](_0x77e2('0x38'))[_0x77e2('0x31')](_0x2d03d1,squel[_0x77e2('0x36')]()[_0x77e2('0x37')](_0x2d03d1)[_0x77e2('0x10')](_0x3ec0f6)[_0x77e2('0x12')]('('+_0x1c4b7c['join'](',')+_0x77e2('0x50'),squel[_0x77e2('0x36')]()[_0x77e2('0x37')](_0x1c4b7c)[_0x77e2('0x10')](_0x77e2('0x38'))[_0x77e2('0x12')]('ListId\x20=\x20?',_0x3cef16))[_0x77e2('0x12')](_0x77e2('0x51'),squel[_0x77e2('0x36')]()[_0x77e2('0x43')]('MIN(id)','min_id')[_0x77e2('0x10')](_0x3ec0f6)[_0x77e2('0x52')](_0x1c4b7c[_0x77e2('0x14')](','))))[_0x77e2('0x3f')]();}function handleStop(){logger[_0x77e2('0x53')](_0x77e2('0x54'));stopped=!![];}function handleUncaughtException(_0x263b2d){logger['error'](_0x263b2d[_0x77e2('0x1f')]);process['exit'](0x1);}function handleError(_0x5e884b,_0xd50b68){stats[_0x77e2('0x55')][_0x77e2('0x1a')]({'name':_0xd50b68[_0x77e2('0x56')],'message':_0xd50b68['message'],'row':_0x5e884b});}function handleQuery(_0x25e78d){logger[_0x77e2('0x53')](_0x25e78d);return db['sequelize']['query'](_0x25e78d)[_0x77e2('0x57')](function(_0x2f465d){results[_0x77e2('0x1a')](_0x2f465d);})[_0x77e2('0x1d')](function(_0x350d8a){logger[_0x77e2('0x1e')](_0x350d8a[_0x77e2('0x1f')]);});}function main(_0x2e4938,_0x3487a2,_0x141c95,_0x548bda){logger[_0x77e2('0x53')](_0x77e2('0x58'),_0x2e4938,JSON['stringify'](_0x3487a2));process[_0x77e2('0x59')]('start');var _0x3a2a3d=_0x3487a2[_0x77e2('0x5a')];var _0x794550=_[_0x77e2('0x5b')](_0x3a2a3d);var _0x4fb979=_0x3487a2['socket_timestamp'];var _0x505b5f=path[_0x77e2('0x14')](config[_0x77e2('0x5c')],'server/files/tmp',_0x4fb979+_0x77e2('0x5d'));logger[_0x77e2('0x53')](_0x77e2('0x5e'),_0x3487a2);db[_0x77e2('0x5f')][_0x77e2('0x60')]({'raw':!![],'attributes':['id',_0x77e2('0x61')]})[_0x77e2('0x1c')](function(_0x487964){for(var _0x22b22f=0x0;_0x22b22f<_0x487964[_0x77e2('0x17')];_0x22b22f++){if(_0x487964[_0x22b22f][_0x77e2('0x61')]in _0x3a2a3d){contactItemTypes[_0x77e2('0x1a')](_0x487964[_0x22b22f]);delete _0x794550[_0x487964[_0x22b22f]['name']];hasAdditionalPhones=!![];}for(var _0x100e1e in _0x3a2a3d){if(_0x487964[_0x22b22f][_0x77e2('0x61')]+_0x77e2('0x62')===_0x100e1e){phoneDescriptions[_0x77e2('0x1a')]({'itemTypeId':_0x487964[_0x22b22f]['id'],'description':_0x100e1e});delete _0x794550[_0x100e1e];}}}if(hasAdditionalPhones)_0x794550[_0x77e2('0x19')]='';var _0x1f6079=_[_0x77e2('0x4e')](_0x794550)[_0x77e2('0x14')]();logger[_0x77e2('0x53')](_0x77e2('0x63'),_0x1f6079);fs[_0x77e2('0x64')](_0x505b5f,_0x1f6079+'\x0a');Papa[_0x77e2('0x65')](fs[_0x77e2('0x66')](_0x2e4938),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a87e7,_0x40c84b){try{for(var _0x5cf203=0x0,_0x4a17d4=[];_0x5cf203<_0x3a87e7[_0x77e2('0x67')][_0x77e2('0x17')];_0x5cf203++){stats['rows']+=0x1;if(_0x3a87e7[_0x77e2('0x55')][_0x5cf203]){handleError(_0x3a87e7[_0x77e2('0x67')][_0x5cf203],_0x3a87e7['errors'][_0x5cf203]);}else{var _0x103bc0=[];var _0x3150c4=[];var _0x4a833b={};for(var _0x450600 in _0x3a2a3d){let _0x2ed102=contactItemTypes[_0x77e2('0x68')](_0x1d4441=>_0x1d4441['name']===_0x450600);let _0x4c1e6b=contactItemTypes[_0x77e2('0x68')](_0x5dd34f=>_0x5dd34f[_0x77e2('0x61')]+_0x77e2('0x62')===_0x450600);if(_[_0x77e2('0x18')](_0x2ed102)&&_[_0x77e2('0x18')](_0x4c1e6b)){if(_0x3a2a3d[_0x77e2('0x69')](_0x450600)){if(_0x3a87e7[_0x77e2('0x67')][_0x5cf203][_0x3a2a3d[_0x450600]]){var _0x45f63b=_[_0x77e2('0x6a')](_0x3a87e7[_0x77e2('0x67')][_0x5cf203][_0x3a2a3d[_0x450600]][_0x77e2('0x6b')](/"/g,'\x27'));switch(_0x450600){case'scheduledat':var _0xc543e3=moment(_0x45f63b,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xc543e3[_0x77e2('0x6c')]()){_0x4a17d4[_0x77e2('0x1a')]('\x22'+_0x45f63b+'\x22');}else{_0x103bc0['push'](_0x77e2('0x6d'));}break;case'priority':var _0x516a91=parseInt(_0x45f63b);_0x45f63b=_[_0x77e2('0x6e')](_0x516a91)||_0x516a91<0x0||_0x516a91>0x4?_0x548bda?0x3:0x2:_0x516a91;_0x4a17d4['push']('\x22'+_0x45f63b+'\x22');break;case _0x77e2('0x6f'):var _0x154028=parseInt(_0x45f63b);if(_[_0x77e2('0x70')](_0x154028)&&_['includes'](_0x141c95,_0x154028)){_0x4a17d4['push']('\x22'+_0x154028+'\x22');}else{_0x103bc0[_0x77e2('0x1a')](_0x77e2('0x71'));}break;case'email':if(isEmail(_0x45f63b)){_0x4a17d4[_0x77e2('0x1a')]('\x22'+_0x45f63b+'\x22');}else{_0x103bc0[_0x77e2('0x1a')](_0x77e2('0x72'));}break;case _0x77e2('0x73'):var _0x312b13=moment(_0x45f63b,_0x77e2('0x74'),!![]);if(_0x312b13[_0x77e2('0x6c')]()){_0x4a17d4['push']('\x22'+_0x45f63b+'\x22');}else{_0x103bc0[_0x77e2('0x1a')](_0x77e2('0x75'));}break;default:_0x4a17d4[_0x77e2('0x1a')]('\x22'+_0x45f63b+'\x22');}}else{switch(_0x450600){case'firstName':case _0x77e2('0xf'):_0x103bc0[_0x77e2('0x1a')](_0x450600+'\x20not\x20specified');break;default:_0x4a17d4[_0x77e2('0x1a')]('\x22\x22');}}}}else{var _0x23b081='';if(!_[_0x77e2('0x18')](_0x2ed102)){if(!_0x4a833b[_0x77e2('0x69')](_0x2ed102['id'])){for(var _0x366bf2=0x0;_0x366bf2<_0x3a2a3d[_0x450600][_0x77e2('0x17')];_0x366bf2++){var _0x45f63b=_['trim'](_0x3a87e7[_0x77e2('0x67')][_0x5cf203][_0x3a2a3d[_0x450600][_0x366bf2]]['replace'](/"/g,'\x27'));var _0xc88965=phoneDescriptions[_0x77e2('0x68')](_0x4411fd=>_0x4411fd['itemTypeId']===_0x2ed102['id']);if(!_[_0x77e2('0x18')](_0xc88965)){var _0x2236e6=_[_0x77e2('0x6a')](_0x3a87e7['data'][_0x5cf203][_0x3a2a3d[_0xc88965[_0x77e2('0x76')]][0x0]][_0x77e2('0x6b')](/"/g,'\x27'));if(!_[_0x77e2('0x18')](_0x2236e6))_0x45f63b=_0x45f63b+'§'+_0x2236e6;}if(_0x23b081=='')_0x23b081=_0x45f63b;else _0x23b081+='|'+_0x45f63b;}_0x3150c4[_0x77e2('0x1a')](_0x2ed102['id']+':'+_0x23b081);_0x4a833b[_0x2ed102['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4a17d4[_0x77e2('0x1a')]('\x22'+_0x3150c4[_0x77e2('0x14')](';')+'\x22');}if(_0x103bc0[_0x77e2('0x17')]){handleError(_0x3a87e7[_0x77e2('0x67')][_0x5cf203],{'code':_0x77e2('0x77'),'message':_0x103bc0[_0x77e2('0x14')]()});}else{fs['appendFileSync'](_0x505b5f,_0x4a17d4[_0x77e2('0x14')]()+'\x0a');}_0x4a17d4=[];}if(!(stats[_0x77e2('0x78')]%0xc8)){socket[_0x77e2('0x79')](_0x77e2('0x7a')+_0x4fb979,stats);stats[_0x77e2('0x55')]=[];}}if(stopped){logger['info'](_0x77e2('0x7b'));_0x40c84b[_0x77e2('0x7c')]();}}catch(_0x43d665){handleError(_0x3a87e7[_0x77e2('0x67')][_0x5cf203],{'code':_0x77e2('0x7d'),'message':_0x43d665[_0x77e2('0x1f')]});logger[_0x77e2('0x1e')](_0x77e2('0x7e'),_0x43d665[_0x77e2('0x1f')]);}},'complete':function(){try{var _0x57ff38=[];var _0x1d69dd=tempTableName;_0x57ff38['push'](_0x77e2('0x7f')+_0x1d69dd+_0x77e2('0x80'));logger['info'](_0x77e2('0x81'),contactItemTypes['length']);var _0x22a38e=util[_0x77e2('0xb')]('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',_0x505b5f,_0x1d69dd,_0x1f6079,_0x3487a2[_0x77e2('0x32')],_0x3487a2[_0x77e2('0x4f')]||null,NOW,NOW);if(_[_0x77e2('0x18')](_0x3a2a3d['scheduledat'])){_0x22a38e+=_0x77e2('0x82');}_0x57ff38[_0x77e2('0x1a')](_0x22a38e);BPromise['each'](_0x57ff38,handleQuery)['then'](function(_0x4d926f){BPromise[_0x77e2('0x1b')]([handleAdditionalPhones()])['then'](function(){_0x57ff38=[];for(var _0x55a209=0x0;_0x55a209\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.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.to','i.ContactId','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','agent','search','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?'];(function(_0x1a46d8,_0x402432){var _0x2da129=function(_0x491b5c){while(--_0x491b5c){_0x1a46d8['push'](_0x1a46d8['shift']());}};_0x2da129(++_0x402432);}(_0x63d4,0x12b));var _0x463d=function(_0x31c52a,_0x477d63){_0x31c52a=_0x31c52a-0x0;var _0xd42214=_0x63d4[_0x31c52a];return _0xd42214;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x463d('0x0'));var qs=require(_0x463d('0x1'));var updateInteraction=require(_0x463d('0x2'))[_0x463d('0x3')];var utils=require(_0x463d('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x23fd01,_0x7c6ac3,_0x57c3f7){var _0xfeb794=![];var _0x4d7f88=utils[_0x463d('0x5')](_0x23fd01);if(_0x7c6ac3['role']===_0x463d('0x6')&&!_0x57c3f7[_0x463d('0x7')]&&!_0x57c3f7[_0x4d7f88]){_0xfeb794=!![];}return _0xfeb794;}function getTagsQuery(){return squel['select']()[_0x463d('0x8')]('id')[_0x463d('0x8')](_0x463d('0x9'))[_0x463d('0x8')](_0x463d('0xa'))[_0x463d('0xb')](_0x463d('0xc'));}function getUsersQuery(_0x1ed463,_0x4406ea){var _0x1cd144=utils[_0x463d('0xd')](_0x1ed463);var _0x3c3c1f=_0x463d('0xe')+_0x1ed463+_0x463d('0xf');var _0x1a8dc2=squel['select']()[_0x463d('0x8')](_0x463d('0x10'))[_0x463d('0x8')](_0x463d('0x11'))['field'](_0x463d('0x12')+_0x1cd144)['from'](_0x3c3c1f,'ui')[_0x463d('0x13')](_0x463d('0x14'),'u',_0x463d('0x15'));if(_0x4406ea[_0x463d('0x16')]>0x0){_0x1a8dc2[_0x463d('0x17')](_0x463d('0x12')+_0x1cd144+_0x463d('0x18'),_[_0x463d('0x19')](_0x4406ea,'id'));}return _0x1a8dc2;}function getInteractionsQuery(_0x4ad8b1){var _0x3c9010=utils[_0x463d('0x1a')](_0x4ad8b1);var _0xdce1ec=utils[_0x463d('0x5')](_0x4ad8b1);var _0x3ca2c5=utils['getInteractionFK'](_0x4ad8b1);return squel['select']()[_0x463d('0xb')](_0x3c9010[_0x463d('0x1b')],'i')[_0x463d('0x13')]('cm_contacts','c',_0x463d('0x1c'))[_0x463d('0x13')](_0x463d('0x14'),'o','o.id\x20=\x20i.UserId')[_0x463d('0x13')](_0x3c9010[_0x463d('0x1d')],'a','a.id\x20=\x20i.'+_0xdce1ec)[_0x463d('0x13')](_0x3c9010[_0x463d('0x1e')],'me',_0x463d('0x1f')+_0x3ca2c5+_0x463d('0x20'))['left_join'](_0x3c9010[_0x463d('0x21')],'it','it.'+_0x3ca2c5+_0x463d('0x20'))[_0x463d('0x13')](_0x463d('0xc'),'t',_0x463d('0x22'));}function getSqlClauses(){var _0x497a8c={'body':squel[_0x463d('0x23')](),'contact':squel[_0x463d('0x23')](),'default':squel[_0x463d('0x23')](),'fields':squel[_0x463d('0x23')](),'filter':squel[_0x463d('0x23')](),'read':squel[_0x463d('0x23')](),'tags':{'clause':squel[_0x463d('0x23')](),'ids':null},'user':squel[_0x463d('0x23')]()};return _0x497a8c;}function parseTagParameter(_0x1fdbd9){var _0x33d9a1=squel['expr']();if(_0x1fdbd9){var _0xa66bea=utils[_0x463d('0x24')](_0x1fdbd9);_0xa66bea[_0x463d('0x25')](function(_0xb20467){_0x33d9a1['or'](_0x463d('0x26'),'%,'+_0xb20467+',%');});}return _0x33d9a1;}function parseReadParameter(_0x9c3605){var _0x38c61d='';if(_0x9c3605){_0x38c61d=_0x463d('0x27');if(_0x9c3605==='1'){_0x38c61d=_0x38c61d[_0x463d('0x28')]('{OPERATOR}','=');}else{_0x38c61d=_0x38c61d[_0x463d('0x28')](_0x463d('0x29'),'>');}}return _0x38c61d;}function parseSearchFilter(_0xbb0bf1,_0x149139){var _0x2972ee=squel[_0x463d('0x23')]();if(_0x149139){var _0x342aaf=_0x149139[_0x463d('0x28')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x342aaf)){_0x2972ee['or'](_0x463d('0x2a'),_0x342aaf+'%');if([_0x463d('0x2b'),_0x463d('0x2c')][_0x463d('0x2d')](_0xbb0bf1)){_0x2972ee['or'](_0x463d('0x2e'),_0x342aaf+'%');}else if(_0xbb0bf1===_0x463d('0x2f')){_0x2972ee['or'](_0x463d('0x30'),_0x342aaf+'%');}}else if(_0xbb0bf1==='mail'&&qs[_0x463d('0x31')](_0x342aaf)){_0x2972ee['or']('c.email\x20LIKE\x20?',_0x342aaf+'%');}else{if(_0xbb0bf1===_0x463d('0x32')){_0x2972ee['or'](_0x463d('0x33'),qs[_0x463d('0x34')](_0x342aaf))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x463d('0x34')](_0x342aaf));}else{if(_0xbb0bf1!=='fax'){_0x2972ee['or'](_0x463d('0x35'),qs[_0x463d('0x34')](_0x342aaf));}_0x2972ee['or'](_0x463d('0x36'),_0x342aaf+'%');if(_0xbb0bf1==='openchannel'){_0x2972ee['or'](_0x463d('0x37'),_0x342aaf+'%');}}}}return _0x2972ee;}function parseAdvancedSearchFilter(_0x23ef9c,_0x3629b0){var _0x15e27b=getSqlClauses();var _0x556f45=as[_0x463d('0x38')](_0x23ef9c);var _0x1493b7=_0x556f45[_0x463d('0x39')];for(var _0x224e0d=0x0;_0x224e0d<_0x556f45[_0x463d('0x3a')][_0x463d('0x16')];_0x224e0d++){var _0x26c47b=_0x556f45['conditions'][_0x224e0d];var _0x271b8e='i';var _0x4e82be=_['find'](_0x3629b0,[_0x463d('0x9'),_0x26c47b[_0x463d('0x8')]]);if(_0x4e82be){var _0x3116fd=as[_0x463d('0x3b')](_0x271b8e,_0x4e82be[_0x463d('0x3c')],_0x26c47b);_0x15e27b[_0x463d('0x3d')][_0x1493b7](_0x3116fd[_0x463d('0x3e')],_0x3116fd['value'][_0x463d('0x3f')],_0x3116fd[_0x463d('0x40')]['end']);}else{switch(_0x26c47b[_0x463d('0x8')]){case _0x463d('0x41'):var _0x47e6e2=parseReadParameter(_0x26c47b[_0x463d('0x40')]);_0x15e27b[_0x463d('0x42')][_0x463d('0x43')](_0x47e6e2);break;case _0x463d('0x44'):if(_0x26c47b['operator']===_0x463d('0x45')){if(_0x26c47b[_0x463d('0x40')][_0x463d('0x46')]('\x20')[_0x463d('0x16')]>0x1){_0x15e27b['contact'][_0x1493b7](_0x463d('0x47'),qs[_0x463d('0x34')](_0x26c47b['value']),null);}else{var _0x4f06eb='%'+_0x26c47b['value']+'%';_0x15e27b[_0x463d('0x48')][_0x1493b7](_0x463d('0x49'),_0x4f06eb,_0x4f06eb,_0x4f06eb);}}else{_0x4e82be=_[_0x463d('0x4a')](_0x3629b0,[_0x463d('0x9'),'ContactId']);_0x26c47b['field']=_0x463d('0x4b');_0x3116fd=as[_0x463d('0x3b')](_0x271b8e,_0x4e82be['type'],_0x26c47b);_0x15e27b['contact'][_0x1493b7](_0x3116fd[_0x463d('0x3e')],_0x3116fd[_0x463d('0x40')][_0x463d('0x3f')],_0x3116fd[_0x463d('0x40')]['end']);}break;case _0x463d('0x4c'):var _0x4d3b96=_0x26c47b[_0x463d('0x40')][_0x463d('0x46')](',')[_0x463d('0x19')](function(_0x13cf0c){return Number(_0x13cf0c);});var _0x41b350=parseTagParameter(_0x4d3b96);_0x15e27b[_0x463d('0x4d')]['clause'][_0x463d('0x43')](_0x41b350);_0x15e27b[_0x463d('0x4d')][_0x463d('0x4e')]=_0x4d3b96;break;case _0x463d('0x4f'):if(_0x26c47b[_0x463d('0x50')]===_0x463d('0x45')){_0x15e27b[_0x463d('0x51')][_0x1493b7](_0x463d('0x52'),'%'+_0x26c47b[_0x463d('0x40')]+'%',null);}else{_0x4e82be=_['find'](_0x3629b0,[_0x463d('0x9'),_0x463d('0x53')]);_0x26c47b[_0x463d('0x8')]=_0x463d('0x53');_0x3116fd=as['buildExpression'](_0x271b8e,_0x4e82be[_0x463d('0x3c')],_0x26c47b);_0x15e27b[_0x463d('0x51')][_0x1493b7](_0x3116fd[_0x463d('0x3e')],_0x3116fd[_0x463d('0x40')][_0x463d('0x3f')],_0x3116fd['value'][_0x463d('0x54')]);}break;case _0x463d('0x55'):case _0x463d('0x56'):_0x3116fd=as[_0x463d('0x3b')]('me',null,_0x26c47b);_0x15e27b['body'][_0x1493b7](_0x3116fd[_0x463d('0x3e')],_0x3116fd[_0x463d('0x40')][_0x463d('0x3f')],_0x3116fd['value'][_0x463d('0x54')]);break;}}}return _0x15e27b;}function parseModelFields(_0x546710,_0x5a6ca5,_0x45965f){var _0x43f89e=utils['getAccountFK'](_0x546710);var _0x3f723b=squel[_0x463d('0x23')]();var _0x51d8a2=_(_0x5a6ca5)[_0x463d('0x57')]()[_0x463d('0x19')](function(_0x1735e6){return _[_0x463d('0x58')](_0x45965f,[_0x463d('0x9'),_0x1735e6])?_0x1735e6:undefined;})['compact']()[_0x463d('0x40')]();if(_0x51d8a2[_0x463d('0x16')]>0x0){_0x51d8a2[_0x463d('0x25')](function(_0xaf9b68){if(_0xaf9b68===_0x43f89e){_0x3f723b[_0x463d('0x43')]('i.'+_0x43f89e+_0x463d('0x18'),[][_0x463d('0x59')](_0x5a6ca5[_0xaf9b68]));}else if(_0xaf9b68===_0x463d('0x5a')){var _0x420ce5=JSON[_0x463d('0x5b')](_0x5a6ca5[_0xaf9b68])[_0x463d('0x5c')];var _0x221888=JSON[_0x463d('0x5b')](_0x5a6ca5[_0xaf9b68])[_0x463d('0x5d')];_0x3f723b[_0x463d('0x43')](_0x463d('0x5e'),_0x420ce5,_0x221888);}else{if(_0x5a6ca5[_0xaf9b68]===_0x463d('0x5f')){_0x3f723b['and']('i.'+_0xaf9b68+_0x463d('0x60'));}else{_0x3f723b[_0x463d('0x43')]('i.'+_0xaf9b68+_0x463d('0x61'),_0x5a6ca5[_0xaf9b68]);}}});}return _0x3f723b;}function parseQueryParameters(_0x3faf39,_0xa7642b,_0x89ecca){var _0x56f4a3=getSqlClauses();return Promise[_0x463d('0x62')]()['then'](function(){return parseModelFields(_0x3faf39,_0xa7642b,_0x89ecca);})[_0x463d('0x63')](function(_0x4023a5){_0x56f4a3['fields'][_0x463d('0x43')](_0x4023a5);return parseReadParameter(_0xa7642b[_0x463d('0x42')]);})['then'](function(_0x45e2de){_0x56f4a3[_0x463d('0x42')]['and'](_0x45e2de);return parseTagParameter(_0xa7642b['tag']);})[_0x463d('0x63')](function(_0x2fc281){_0x56f4a3[_0x463d('0x4d')][_0x463d('0x64')][_0x463d('0x43')](_0x2fc281);return parseSearchFilter(_0x3faf39,_0xa7642b['filter']);})['then'](function(_0x1da8ac){_0x56f4a3[_0x463d('0x65')]=_0x1da8ac;return _0x56f4a3;});}function checkAccountsRestrictions(_0x547808,_0x4a1ba7,_0x1c1be8){var _0x2e7be3=utils['getAccountFK'](_0x547808);var _0x48527c=_0x463d('0x66')+_['capitalize'](_0x547808)+(_0x547808===_0x463d('0x67')?'Websites':_0x463d('0x68'));var _0xd705e6=squel[_0x463d('0x23')]();return Promise[_0x463d('0x62')]()[_0x463d('0x63')](function(){if(_0x1c1be8[_0x463d('0x7')]&&_0x4a1ba7[_0x463d('0x69')]==='agent'){return _0x4a1ba7[_0x48527c]({'attributes':['id'],'raw':!![]});}})[_0x463d('0x63')](function(_0x1602b1){if(_0x1602b1){if(_0x1602b1['length']===0x0){_0xd705e6[_0x463d('0x43')]('i.'+_0x2e7be3+'\x20IS\x20NULL');}else{_0xd705e6[_0x463d('0x43')]('i.'+_0x2e7be3+_0x463d('0x18'),_[_0x463d('0x19')](_0x1602b1,'id'));}}else if(!_0x1c1be8[_0x2e7be3]){_0xd705e6[_0x463d('0x43')]('i.'+_0x2e7be3+_0x463d('0x6a'));}})[_0x463d('0x63')](function(){return _0xd705e6;});}function getClosedOrderClause(_0x50b975,_0x2b34d3){var _0x4be30e='';var _0x3c09af=[_0x463d('0x6b'),_0x463d('0x6c'),'i.disposition'];if(_0x50b975===_0x463d('0x32')){_0x3c09af[_0x463d('0x6d')](_0x463d('0x6e'));}if(_0x2b34d3[_0x463d('0x6f')]==='0'&&_0x50b975==='mail'){_0x4be30e='i.substatus';}else{if(_0x2b34d3[_0x463d('0x6f')]==='1'){_0x3c09af[_0x463d('0x70')]();}_0x4be30e=_0x463d('0x71')+_0x3c09af[_0x463d('0x72')](',\x20')+')';}return _0x4be30e;}function getFilteredInteractions(_0x5c0c03,_0x237ea4,_0x1a97bd,_0xffd301){var _0x1c74ad=utils[_0x463d('0xd')](_0x5c0c03);var _0x1d3d9b=_[_0x463d('0x73')](_0x5c0c03)+_0x463d('0x74');var _0x26c000=[];var _0x82c587=getTagsQuery();var _0x189b2c={'type':db[_0x463d('0x75')][_0x463d('0x76')]['SELECT'],'raw':!![]};var _0x11568d=[];var _0x12a6cc=[];return db[_0x463d('0x77')][_0x463d('0x78')](_0x82c587[_0x463d('0x79')](),_0x189b2c)['then'](function(_0xd44f4){_0x26c000=_[_0x463d('0x7a')](_0xd44f4,'id');_0x189b2c=_['merge'](_0x189b2c,{'model':db[_0x1d3d9b],'mapToModel':!![],'nest':!![]});if(_0x1a97bd['fields']){_0xffd301[_0x463d('0x7b')][_0x463d('0x25')](function(_0x55c754){_0x237ea4[_0x463d('0x8')]('i.'+_0x55c754);});}else{_0x237ea4[_0x463d('0x8')](_0x463d('0x7c'),'unreadMessages');_0x237ea4['field'](_0x463d('0x7d'),_0x463d('0x7e'));_0x237ea4[_0x463d('0x8')](_0x463d('0x7f'),_0x463d('0x80'));if(_0x5c0c03===_0x463d('0x32')){_0x237ea4[_0x463d('0x8')]('a.email',_0x463d('0x81'));_0x237ea4[_0x463d('0x8')](_0x463d('0x82'),_0x463d('0x83'));_0x237ea4['field'](_0x463d('0x84'));_0x237ea4[_0x463d('0x8')]('i.createdAt');_0x237ea4[_0x463d('0x8')]('i.updatedAt');_0x237ea4[_0x463d('0x8')](_0x463d('0x85'));_0x237ea4[_0x463d('0x8')](_0x463d('0x86'));_0x237ea4[_0x463d('0x8')](_0x463d('0x87'));_0x237ea4[_0x463d('0x8')](_0x463d('0x88'));_0x237ea4[_0x463d('0x8')](_0x463d('0x89'));_0x237ea4[_0x463d('0x8')](_0x463d('0x8a'));_0x237ea4['field'](_0x463d('0x8b'));_0x237ea4['field'](_0x463d('0x6c'));_0x237ea4['field'](_0x463d('0x6b'));_0x237ea4[_0x463d('0x8')](_0x463d('0x6e'));_0x237ea4[_0x463d('0x8')](_0x463d('0x8c'));_0x237ea4[_0x463d('0x8')](_0x463d('0x8d'));_0x237ea4[_0x463d('0x8')](_0x463d('0x8e'));_0x237ea4[_0x463d('0x8')](_0x463d('0x8f'));}else if(_0x5c0c03===_0x463d('0x90')){_0x237ea4[_0x463d('0x8')](_0x463d('0x91'),'contactName');}else{_0x237ea4['field'](_0x463d('0x92'),'contactName');}if(_0x5c0c03!=='mail'){_0x237ea4[_0x463d('0x8')]('i.*');}_0x237ea4[_0x463d('0x8')](_0x463d('0x93'),_0x463d('0x94'));_0x237ea4[_0x463d('0x8')](_0x463d('0x95'),_0x463d('0x96'));_0x237ea4[_0x463d('0x8')](_0x463d('0x97'),_0x463d('0x98'));_0x237ea4['field']('c.phone',_0x463d('0x99'));_0x237ea4[_0x463d('0x8')](_0x463d('0x9a'),_0x463d('0x9b'));_0x237ea4[_0x463d('0x8')]('c.fax',_0x463d('0x9c'));_0x237ea4['field'](_0x463d('0x9d'),_0x463d('0x9e'));_0x237ea4[_0x463d('0x8')](_0x463d('0x9f'),'Owner.internal');_0x237ea4[_0x463d('0x8')](_0x463d('0xa0'),_0x463d('0xa1'));}if(_0xffd301[_0x463d('0xa2')]){_0x237ea4[_0x463d('0xa2')](_0xffd301[_0x463d('0xa2')]);}if(_0xffd301['offset']){_0x237ea4['offset'](_0xffd301[_0x463d('0xa3')]);}return db[_0x463d('0x77')]['query'](_0x237ea4[_0x463d('0x79')](),_0x189b2c);})[_0x463d('0x63')](function(_0x1b027d){_0x11568d=_0x1b027d;var _0x4dfca9=getUsersQuery(_0x5c0c03,_0x11568d);return db[_0x463d('0x77')]['query'](_0x4dfca9[_0x463d('0x79')](),_0x189b2c);})[_0x463d('0x63')](function(_0x2889ed){_0x12a6cc=_['groupBy'](_0x2889ed,_0x1c74ad);if(_0x5c0c03===_0x463d('0x32')){return db[_0x463d('0xa4')][_0x463d('0xa5')]({'attributes':[_0x463d('0xa6')],'raw':!![]});}})[_0x463d('0x63')](function(_0x56b9bc){var _0x5dbd7d=_0x56b9bc?_0x56b9bc[_0x463d('0xa6')]:undefined;var _0x571cc7=_0x11568d[_0x463d('0x19')](function(_0x327055){return updateInteraction(_0x327055,_0x26c000,_0x12a6cc,_0x5dbd7d);});return Promise[_0x463d('0xa7')](_0x571cc7);});}function countFilteredInteractions(_0x542e62,_0x269ef6){var _0x170b28=_0x542e62[_0x463d('0xa8')]();_0x170b28['field'](_0x463d('0xa9'));_0x170b28[_0x463d('0x8')](_0x463d('0x7c'),_0x463d('0x41'));var _0x18659b=utils[_0x463d('0x24')](_0x269ef6);if(!_[_0x463d('0xaa')](_0x18659b)){_0x170b28[_0x463d('0x17')](_0x463d('0xab'),_0x18659b);}var _0x519687={'type':db['Sequelize']['QueryTypes'][_0x463d('0xac')],'raw':!![]};return db[_0x463d('0x77')][_0x463d('0x78')](_0x170b28['toString'](),_0x519687);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x9a12=['o.fullname','Owner.fullname','o.internal','TagIds','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','exports','lodash','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','user_has_','_interactions','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','length','ui.','map','getInteractionsTables','getInteractionFK','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','interactionsTags','it.','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','whatsapp','includes','fax','i.fax\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','openchannel','i.from\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','buildExpression','type','value','start','end','unreadMessages','read','and','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','tags','clause','ids','User','user','UserId','body','plainBody','keys','some','compact','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20=\x20?','resolve','then','fields','tag','filter','capitalize','chat','Accounts','\x20IS\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','join','Interaction','QueryTypes','SELECT','sequelize','query','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x9a12,0x15e));var _0x29a1=function(_0x31de77,_0x57aaf9){_0x31de77=_0x31de77-0x0;var _0x2aa4ae=_0x9a12[_0x31de77];return _0x2aa4ae;};'use strict';var _=require(_0x29a1('0x0'));var squel=require(_0x29a1('0x1'));var as=require(_0x29a1('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0x29a1('0x3'))[_0x29a1('0x4')];var utils=require(_0x29a1('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x1bc2d9,_0x335870,_0xe76c0d){var _0x5aa149=![];var _0x2f80fa=utils[_0x29a1('0x6')](_0x1bc2d9);if(_0x335870[_0x29a1('0x7')]===_0x29a1('0x8')&&!_0xe76c0d[_0x29a1('0x9')]&&!_0xe76c0d[_0x2f80fa]){_0x5aa149=!![];}return _0x5aa149;}function getTagsQuery(){return squel[_0x29a1('0xa')]()[_0x29a1('0xb')]('id')['field'](_0x29a1('0xc'))['field'](_0x29a1('0xd'))[_0x29a1('0xe')](_0x29a1('0xf'));}function getUsersQuery(_0x42ebbc,_0x1ea904){var _0x4d39c5=utils['getInteractionFK'](_0x42ebbc);var _0x2962cf=_0x29a1('0x10')+_0x42ebbc+_0x29a1('0x11');var _0x2e3bcf=squel[_0x29a1('0xa')]()['field']('u.id')[_0x29a1('0xb')](_0x29a1('0x12'))['field']('ui.'+_0x4d39c5)[_0x29a1('0xe')](_0x2962cf,'ui')[_0x29a1('0x13')](_0x29a1('0x14'),'u',_0x29a1('0x15'));if(_0x1ea904[_0x29a1('0x16')]>0x0){_0x2e3bcf['where'](_0x29a1('0x17')+_0x4d39c5+'\x20IN\x20?',_[_0x29a1('0x18')](_0x1ea904,'id'));}return _0x2e3bcf;}function getInteractionsQuery(_0x3f73af){var _0x37e256=utils[_0x29a1('0x19')](_0x3f73af);var _0x135ad1=utils[_0x29a1('0x6')](_0x3f73af);var _0x70fdf8=utils[_0x29a1('0x1a')](_0x3f73af);return squel[_0x29a1('0xa')]()['from'](_0x37e256['interactions'],'i')[_0x29a1('0x13')](_0x29a1('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x29a1('0x13')](_0x29a1('0x14'),'o',_0x29a1('0x1c'))[_0x29a1('0x13')](_0x37e256[_0x29a1('0x1d')],'a',_0x29a1('0x1e')+_0x135ad1)[_0x29a1('0x13')](_0x37e256[_0x29a1('0x1f')],'me','me.'+_0x70fdf8+'\x20=\x20i.id')[_0x29a1('0x13')](_0x37e256[_0x29a1('0x20')],'it',_0x29a1('0x21')+_0x70fdf8+'\x20=\x20i.id')['left_join'](_0x29a1('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x511cbc={'body':squel[_0x29a1('0x22')](),'contact':squel['expr'](),'default':squel[_0x29a1('0x22')](),'fields':squel['expr'](),'filter':squel[_0x29a1('0x22')](),'read':squel[_0x29a1('0x22')](),'tags':{'clause':squel[_0x29a1('0x22')](),'ids':null},'user':squel['expr']()};return _0x511cbc;}function parseTagParameter(_0x51fb35){var _0x459be3=squel[_0x29a1('0x22')]();if(_0x51fb35){var _0x171b77=utils[_0x29a1('0x23')](_0x51fb35);_0x171b77[_0x29a1('0x24')](function(_0x262505){_0x459be3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x262505+',%');});}return _0x459be3;}function parseReadParameter(_0x4ed019){var _0x4754fc='';if(_0x4ed019){_0x4754fc=_0x29a1('0x25');if(_0x4ed019==='1'){_0x4754fc=_0x4754fc['replace'](_0x29a1('0x26'),'=');}else{_0x4754fc=_0x4754fc[_0x29a1('0x27')]('{OPERATOR}','>');}}return _0x4754fc;}function parseSearchFilter(_0x3e6163,_0x5aee99){var _0x3a047a=squel[_0x29a1('0x22')]();if(_0x5aee99){var _0x23393d=_0x5aee99['replace']('\x5c','\x5c\x5c')[_0x29a1('0x27')](/'/g,'\x27\x27');if(qs[_0x29a1('0x28')](_0x23393d)){_0x3a047a['or'](_0x29a1('0x29'),_0x23393d+'%');if(['sms',_0x29a1('0x2a')][_0x29a1('0x2b')](_0x3e6163)){_0x3a047a['or']('i.phone\x20LIKE\x20?',_0x23393d+'%');}else if(_0x3e6163===_0x29a1('0x2c')){_0x3a047a['or'](_0x29a1('0x2d'),_0x23393d+'%');}}else if(_0x3e6163===_0x29a1('0x2e')&&qs[_0x29a1('0x2f')](_0x23393d)){_0x3a047a['or'](_0x29a1('0x30'),_0x23393d+'%');}else{if(_0x3e6163===_0x29a1('0x2e')){_0x3a047a['or'](_0x29a1('0x31'),qs[_0x29a1('0x32')](_0x23393d))['or'](_0x29a1('0x33'),qs[_0x29a1('0x32')](_0x23393d));}else{if(_0x3e6163!==_0x29a1('0x2c')){_0x3a047a['or'](_0x29a1('0x34'),qs[_0x29a1('0x32')](_0x23393d));}_0x3a047a['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x23393d+'%');if(_0x3e6163===_0x29a1('0x35')){_0x3a047a['or'](_0x29a1('0x36'),_0x23393d+'%');}}}}return _0x3a047a;}function parseAdvancedSearchFilter(_0x30689d,_0x48e86a){var _0x4ba27d=getSqlClauses();var _0x1e9a71=as[_0x29a1('0x37')](_0x30689d);var _0x24e738=_0x1e9a71[_0x29a1('0x38')];for(var _0x5e1402=0x0;_0x5e1402<_0x1e9a71[_0x29a1('0x39')]['length'];_0x5e1402++){var _0x2823fb=_0x1e9a71['conditions'][_0x5e1402];var _0x2dd966='i';var _0x275136=_[_0x29a1('0x3a')](_0x48e86a,['name',_0x2823fb[_0x29a1('0xb')]]);if(_0x275136){var _0x58d192=as[_0x29a1('0x3b')](_0x2dd966,_0x275136[_0x29a1('0x3c')],_0x2823fb);_0x4ba27d['default'][_0x24e738](_0x58d192['text'],_0x58d192[_0x29a1('0x3d')][_0x29a1('0x3e')],_0x58d192['value'][_0x29a1('0x3f')]);}else{switch(_0x2823fb[_0x29a1('0xb')]){case _0x29a1('0x40'):var _0x257139=parseReadParameter(_0x2823fb[_0x29a1('0x3d')]);_0x4ba27d[_0x29a1('0x41')][_0x29a1('0x42')](_0x257139);break;case _0x29a1('0x43'):if(_0x2823fb[_0x29a1('0x44')]===_0x29a1('0x45')){if(_0x2823fb[_0x29a1('0x3d')][_0x29a1('0x46')]('\x20')[_0x29a1('0x16')]>0x1){_0x4ba27d['contact'][_0x24e738](_0x29a1('0x47'),qs[_0x29a1('0x32')](_0x2823fb['value']),null);}else{var _0x53f8ce='%'+_0x2823fb[_0x29a1('0x3d')]+'%';_0x4ba27d[_0x29a1('0x48')][_0x24e738](_0x29a1('0x49'),_0x53f8ce,_0x53f8ce,_0x53f8ce);}}else{_0x275136=_[_0x29a1('0x3a')](_0x48e86a,['name',_0x29a1('0x4a')]);_0x2823fb['field']=_0x29a1('0x4a');_0x58d192=as['buildExpression'](_0x2dd966,_0x275136['type'],_0x2823fb);_0x4ba27d[_0x29a1('0x48')][_0x24e738](_0x58d192[_0x29a1('0x4b')],_0x58d192[_0x29a1('0x3d')][_0x29a1('0x3e')],_0x58d192[_0x29a1('0x3d')]['end']);}break;case'Tag':var _0x1a0f74=_0x2823fb['value'][_0x29a1('0x46')](',')[_0x29a1('0x18')](function(_0x5d4798){return Number(_0x5d4798);});var _0x1646e1=parseTagParameter(_0x1a0f74);_0x4ba27d[_0x29a1('0x4c')][_0x29a1('0x4d')][_0x29a1('0x42')](_0x1646e1);_0x4ba27d[_0x29a1('0x4c')][_0x29a1('0x4e')]=_0x1a0f74;break;case _0x29a1('0x4f'):if(_0x2823fb[_0x29a1('0x44')]==='$substring'){_0x4ba27d[_0x29a1('0x50')][_0x24e738]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2823fb['value']+'%',null);}else{_0x275136=_[_0x29a1('0x3a')](_0x48e86a,[_0x29a1('0xc'),_0x29a1('0x51')]);_0x2823fb['field']=_0x29a1('0x51');_0x58d192=as[_0x29a1('0x3b')](_0x2dd966,_0x275136['type'],_0x2823fb);_0x4ba27d[_0x29a1('0x50')][_0x24e738](_0x58d192[_0x29a1('0x4b')],_0x58d192[_0x29a1('0x3d')][_0x29a1('0x3e')],_0x58d192[_0x29a1('0x3d')][_0x29a1('0x3f')]);}break;case _0x29a1('0x52'):case _0x29a1('0x53'):_0x58d192=as[_0x29a1('0x3b')]('me',null,_0x2823fb);_0x4ba27d[_0x29a1('0x52')][_0x24e738](_0x58d192[_0x29a1('0x4b')],_0x58d192[_0x29a1('0x3d')][_0x29a1('0x3e')],_0x58d192[_0x29a1('0x3d')]['end']);break;}}}return _0x4ba27d;}function parseModelFields(_0x47d232,_0x140c38,_0x27a49d){var _0x46e509=utils[_0x29a1('0x6')](_0x47d232);var _0x5bba7f=squel[_0x29a1('0x22')]();var _0x104ffe=_(_0x140c38)[_0x29a1('0x54')]()[_0x29a1('0x18')](function(_0x2d7d57){return _[_0x29a1('0x55')](_0x27a49d,[_0x29a1('0xc'),_0x2d7d57])?_0x2d7d57:undefined;})[_0x29a1('0x56')]()[_0x29a1('0x3d')]();if(_0x104ffe['length']>0x0){_0x104ffe[_0x29a1('0x24')](function(_0xd6cda){if(_0xd6cda===_0x46e509){_0x5bba7f['and']('i.'+_0x46e509+_0x29a1('0x57'),[][_0x29a1('0x58')](_0x140c38[_0xd6cda]));}else if(_0xd6cda===_0x29a1('0x59')){var _0x7ed8cd=JSON[_0x29a1('0x5a')](_0x140c38[_0xd6cda])[_0x29a1('0x5b')];var _0xa6e102=JSON[_0x29a1('0x5a')](_0x140c38[_0xd6cda])[_0x29a1('0x5c')];_0x5bba7f[_0x29a1('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x7ed8cd,_0xa6e102);}else{if(_0x140c38[_0xd6cda]===_0x29a1('0x5d')){_0x5bba7f[_0x29a1('0x42')]('i.'+_0xd6cda+'\x20IS\x20NULL');}else{_0x5bba7f[_0x29a1('0x42')]('i.'+_0xd6cda+_0x29a1('0x5e'),_0x140c38[_0xd6cda]);}}});}return _0x5bba7f;}function parseQueryParameters(_0x1737bc,_0x517134,_0x19fc67){var _0x109782=getSqlClauses();return Promise[_0x29a1('0x5f')]()['then'](function(){return parseModelFields(_0x1737bc,_0x517134,_0x19fc67);})[_0x29a1('0x60')](function(_0x185eb7){_0x109782[_0x29a1('0x61')]['and'](_0x185eb7);return parseReadParameter(_0x517134[_0x29a1('0x41')]);})[_0x29a1('0x60')](function(_0x596c6f){_0x109782[_0x29a1('0x41')][_0x29a1('0x42')](_0x596c6f);return parseTagParameter(_0x517134[_0x29a1('0x62')]);})[_0x29a1('0x60')](function(_0x2aa556){_0x109782[_0x29a1('0x4c')]['clause'][_0x29a1('0x42')](_0x2aa556);return parseSearchFilter(_0x1737bc,_0x517134[_0x29a1('0x63')]);})['then'](function(_0x4b1864){_0x109782[_0x29a1('0x63')]=_0x4b1864;return _0x109782;});}function checkAccountsRestrictions(_0x2d352d,_0x1279db,_0x52ddc6){var _0x318a7c=utils[_0x29a1('0x6')](_0x2d352d);var _0x5a4aea='get'+_[_0x29a1('0x64')](_0x2d352d)+(_0x2d352d===_0x29a1('0x65')?'Websites':_0x29a1('0x66'));var _0x92a4d4=squel['expr']();return Promise[_0x29a1('0x5f')]()['then'](function(){if(_0x52ddc6[_0x29a1('0x9')]&&_0x1279db[_0x29a1('0x7')]===_0x29a1('0x8')){return _0x1279db[_0x5a4aea]({'attributes':['id'],'raw':!![]});}})[_0x29a1('0x60')](function(_0x2ca126){if(_0x2ca126){if(_0x2ca126[_0x29a1('0x16')]===0x0){_0x92a4d4[_0x29a1('0x42')]('i.'+_0x318a7c+_0x29a1('0x67'));}else{_0x92a4d4[_0x29a1('0x42')]('i.'+_0x318a7c+_0x29a1('0x57'),_[_0x29a1('0x18')](_0x2ca126,'id'));}}else if(!_0x52ddc6[_0x318a7c]){_0x92a4d4['and']('i.'+_0x318a7c+'\x20IS\x20NOT\x20NULL');}})[_0x29a1('0x60')](function(){return _0x92a4d4;});}function getClosedOrderClause(_0x3a5d7f,_0x58829c){var _0x586491='';var _0x6c016d=[_0x29a1('0x68'),'i.secondDisposition',_0x29a1('0x69')];if(_0x3a5d7f==='mail'){_0x6c016d[_0x29a1('0x6a')](_0x29a1('0x6b'));}if(_0x58829c[_0x29a1('0x6c')]==='0'&&_0x3a5d7f===_0x29a1('0x2e')){_0x586491=_0x29a1('0x6b');}else{if(_0x58829c[_0x29a1('0x6c')]==='1'){_0x6c016d[_0x29a1('0x6d')]();}_0x586491='CONCAT_WS(\x27\x27,\x20'+_0x6c016d[_0x29a1('0x6e')](',\x20')+')';}return _0x586491;}function getFilteredInteractions(_0x1701d6,_0x1535f9,_0x248b4c,_0x49843c){var _0x3b2499=utils[_0x29a1('0x1a')](_0x1701d6);var _0x5e8680=_['capitalize'](_0x1701d6)+_0x29a1('0x6f');var _0x27e97e=[];var _0x16265e=getTagsQuery();var _0x4b70a8={'type':db['Sequelize'][_0x29a1('0x70')][_0x29a1('0x71')],'raw':!![]};var _0x1d4e91=[];var _0x1aca54=[];return db[_0x29a1('0x72')][_0x29a1('0x73')](_0x16265e['toString'](),_0x4b70a8)[_0x29a1('0x60')](function(_0x4fcaf2){_0x27e97e=_['keyBy'](_0x4fcaf2,'id');_0x4b70a8=_[_0x29a1('0x74')](_0x4b70a8,{'model':db[_0x5e8680],'mapToModel':!![],'nest':!![]});if(_0x248b4c[_0x29a1('0x61')]){_0x49843c[_0x29a1('0x75')][_0x29a1('0x24')](function(_0x2b6986){_0x1535f9[_0x29a1('0xb')]('i.'+_0x2b6986);});}else{_0x1535f9[_0x29a1('0xb')](_0x29a1('0x76'),_0x29a1('0x40'));_0x1535f9[_0x29a1('0xb')]('a.key',_0x29a1('0x77'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x78'),_0x29a1('0x79'));if(_0x1701d6==='mail'){_0x1535f9[_0x29a1('0xb')](_0x29a1('0x7a'),_0x29a1('0x7b'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x7c'),'contactName');_0x1535f9['field']('i.id');_0x1535f9[_0x29a1('0xb')]('i.createdAt');_0x1535f9[_0x29a1('0xb')]('i.updatedAt');_0x1535f9[_0x29a1('0xb')](_0x29a1('0x7d'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x7e'));_0x1535f9['field'](_0x29a1('0x7f'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x80'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x81'));_0x1535f9['field'](_0x29a1('0x82'));_0x1535f9['field'](_0x29a1('0x69'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x83'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x68'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x6b'));_0x1535f9[_0x29a1('0xb')]('i.to');_0x1535f9['field'](_0x29a1('0x84'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x85'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x86'));}else if(_0x1701d6===_0x29a1('0x35')){_0x1535f9[_0x29a1('0xb')](_0x29a1('0x87'),_0x29a1('0x88'));}else{_0x1535f9[_0x29a1('0xb')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}if(_0x1701d6!==_0x29a1('0x2e')){_0x1535f9[_0x29a1('0xb')](_0x29a1('0x89'));}_0x1535f9[_0x29a1('0xb')](_0x29a1('0x8a'),_0x29a1('0x8b'));_0x1535f9['field'](_0x29a1('0x8c'),_0x29a1('0x8d'));_0x1535f9['field'](_0x29a1('0x8e'),_0x29a1('0x8f'));_0x1535f9['field']('c.phone',_0x29a1('0x90'));_0x1535f9[_0x29a1('0xb')]('c.mobile',_0x29a1('0x91'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x92'),_0x29a1('0x93'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x94'),_0x29a1('0x95'));_0x1535f9[_0x29a1('0xb')](_0x29a1('0x96'),'Owner.internal');_0x1535f9[_0x29a1('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29a1('0x97'));}if(_0x49843c[_0x29a1('0x98')]){_0x1535f9[_0x29a1('0x98')](_0x49843c[_0x29a1('0x98')]);}if(_0x49843c[_0x29a1('0x99')]){_0x1535f9['offset'](_0x49843c[_0x29a1('0x99')]);}return db[_0x29a1('0x72')][_0x29a1('0x73')](_0x1535f9[_0x29a1('0x9a')](),_0x4b70a8);})[_0x29a1('0x60')](function(_0x1e9c3e){_0x1d4e91=_0x1e9c3e;var _0x2d596a=getUsersQuery(_0x1701d6,_0x1d4e91);return db[_0x29a1('0x72')][_0x29a1('0x73')](_0x2d596a[_0x29a1('0x9a')](),_0x4b70a8);})[_0x29a1('0x60')](function(_0x2aaf9b){_0x1aca54=_[_0x29a1('0x9b')](_0x2aaf9b,_0x3b2499);if(_0x1701d6===_0x29a1('0x2e')){return db[_0x29a1('0x9c')][_0x29a1('0x9d')]({'attributes':[_0x29a1('0x9e')],'raw':!![]});}})[_0x29a1('0x60')](function(_0x222716){var _0x20bf1d=_0x222716?_0x222716[_0x29a1('0x9e')]:undefined;var _0x486c24=_0x1d4e91[_0x29a1('0x18')](function(_0x54a859){return updateInteraction(_0x54a859,_0x27e97e,_0x1aca54,_0x20bf1d);});return Promise[_0x29a1('0x9f')](_0x486c24);});}function countFilteredInteractions(_0x55bf3d,_0x27b3be){var _0x45a6ef=_0x55bf3d[_0x29a1('0xa0')]();_0x45a6ef[_0x29a1('0xb')](_0x29a1('0xa1'));_0x45a6ef[_0x29a1('0xb')](_0x29a1('0x76'),_0x29a1('0x40'));var _0x20bdb6=utils[_0x29a1('0x23')](_0x27b3be);if(!_[_0x29a1('0xa2')](_0x20bdb6)){_0x45a6ef['where'](_0x29a1('0xa3'),_0x20bdb6);}var _0x4213e2={'type':db[_0x29a1('0xa4')][_0x29a1('0x70')][_0x29a1('0x71')],'raw':!![]};return db['sequelize'][_0x29a1('0x73')](_0x45a6ef['toString'](),_0x4213e2);}module[_0x29a1('0xa5')]={'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 0e55177..292162d 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 _0xa025=['TagIds','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','unmanaged','abandoned','total','disposition','UserId','answered','talking','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','catch','updateInteraction','Users','Tags'];(function(_0x55a5aa,_0x2adfa9){var _0x24c6d9=function(_0x4503e7){while(--_0x4503e7){_0x55a5aa['push'](_0x55a5aa['shift']());}};_0x24c6d9(++_0x2adfa9);}(_0xa025,0x1e7));var _0x5a02=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0xa025[_0x189c9e];return _0x3f38ca;};'use strict';var _=require(_0x5a02('0x0'));var db=require(_0x5a02('0x1'))['db'];function getInteractionUsers(_0x9616ae,_0x4b35a5){return new Promise(function(_0x329da0,_0x566b48){try{var _0x333df3=[];if(_0x4b35a5[_0x9616ae]){_0x333df3=_0x4b35a5[_0x9616ae][_0x5a02('0x2')](function(_0x131259){return{'id':_0x131259['id'],'fullname':_0x131259[_0x5a02('0x3')]};});}return _0x329da0(_0x333df3);}catch(_0xd5f972){_0x566b48(_0xd5f972);}});}function getInteractionTags(_0x3f7181,_0x106e7e){var _0x3c0b3f=[];if(_0x3f7181){_0x3f7181[_0x5a02('0x4')](',')[_0x5a02('0x5')](function(_0xcce5ca){_0x3c0b3f[_0x5a02('0x6')](_0x106e7e[_0xcce5ca]);});}return _0x3c0b3f;}function updateWaitingCounter(_0x1e525f){if(_0x1e525f['waiting']){_0x1e525f[_0x5a02('0x7')]-=0x1;}}function updateInteractionCounters(_0x5cbc59){_0x5cbc59[_0x5a02('0x7')]=0x0;_0x5cbc59['talking']=0x0;_0x5cbc59['answered']=0x0;_0x5cbc59[_0x5a02('0x8')]=0x0;_0x5cbc59[_0x5a02('0x9')]=0x0;_0x5cbc59[_0x5a02('0xa')]=0x0;if(_0x5cbc59['closed']){if(_0x5cbc59[_0x5a02('0xb')]==='abandoned'){_0x5cbc59[_0x5a02('0x9')]+=0x1;updateWaitingCounter(_0x5cbc59);}if(_0x5cbc59[_0x5a02('0xc')]){_0x5cbc59[_0x5a02('0xd')]+=0x1;if(_0x5cbc59['talking']){_0x5cbc59['talking']-=0x1;}}else{if(_0x5cbc59['disposition']){_0x5cbc59['unmanaged']+=0x1;updateWaitingCounter(_0x5cbc59);}}}else{if(!_0x5cbc59[_0x5a02('0xc')]){_0x5cbc59[_0x5a02('0x7')]+=0x1;}if(_0x5cbc59[_0x5a02('0xc')]){_0x5cbc59[_0x5a02('0xe')]+=0x1;updateWaitingCounter(_0x5cbc59);}}_0x5cbc59[_0x5a02('0xa')]+=0x1;return _0x5cbc59;}function getLastMessageText(_0x3d0bb3){return db[_0x5a02('0xf')][_0x5a02('0x10')]({'where':{'$and':[{'MailInteractionId':_0x3d0bb3['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5a02('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x5a02('0x12')],'order':_0x5a02('0x13'),'raw':!![]})[_0x5a02('0x14')](function(_0x556f66){if(_0x556f66&&_0x556f66[_0x5a02('0x12')]){_0x3d0bb3[_0x5a02('0x15')]=_['trimStart'](_0x556f66[_0x5a02('0x12')]);}return _0x3d0bb3;})[_0x5a02('0x16')](function(_0x732ff1){throw _0x732ff1;});}exports[_0x5a02('0x17')]=function(_0x504988,_0x56bd71,_0x4b03ca,_0x2e48af){return new Promise(function(_0x27bcac,_0x226986){return getInteractionUsers(_0x504988['id'],_0x4b03ca)[_0x5a02('0x14')](function(_0xf70cf9){_0x504988[_0x5a02('0x18')]=_0xf70cf9;return getInteractionTags(_0x504988['TagIds'],_0x56bd71);})[_0x5a02('0x14')](function(_0x5c5286){_0x504988[_0x5a02('0x19')]=_0x5c5286;delete _0x504988[_0x5a02('0x1a')];return updateInteractionCounters(_0x504988);})[_0x5a02('0x14')](function(_0x56596d){if(_0x2e48af){return getLastMessageText(_0x56596d);}else{return _0x56596d;}})['then'](function(_0x4beb50){_0x27bcac(_0x4beb50);})[_0x5a02('0x16')](function(_0x25078f){_0x226986(_0x25078f);});});}; \ No newline at end of file +var _0xd83c=['disposition','UserId','MailMessage','findOne','plainBody','-id','then','trimStart','catch','updateInteraction','Users','TagIds','Tags','../../mysqldb','map','split','forEach','waiting','talking','answered','unmanaged','abandoned','total','closed'];(function(_0x7dc06f,_0xa14a10){var _0x150783=function(_0x1d50b1){while(--_0x1d50b1){_0x7dc06f['push'](_0x7dc06f['shift']());}};_0x150783(++_0xa14a10);}(_0xd83c,0x18d));var _0xcd83=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xd83c[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require('lodash');var db=require(_0xcd83('0x0'))['db'];function getInteractionUsers(_0x25873d,_0x2a1119){return new Promise(function(_0x3ae7c6,_0x5b623d){try{var _0x63e5c5=[];if(_0x2a1119[_0x25873d]){_0x63e5c5=_0x2a1119[_0x25873d][_0xcd83('0x1')](function(_0xe1fcb9){return{'id':_0xe1fcb9['id'],'fullname':_0xe1fcb9['fullname']};});}return _0x3ae7c6(_0x63e5c5);}catch(_0x1bc289){_0x5b623d(_0x1bc289);}});}function getInteractionTags(_0x2e0e0a,_0x4cc4dd){var _0x494ccc=[];if(_0x2e0e0a){_0x2e0e0a[_0xcd83('0x2')](',')[_0xcd83('0x3')](function(_0xfe6bb2){_0x494ccc['push'](_0x4cc4dd[_0xfe6bb2]);});}return _0x494ccc;}function updateWaitingCounter(_0x333d9e){if(_0x333d9e['waiting']){_0x333d9e['waiting']-=0x1;}}function updateInteractionCounters(_0x2ed40c){_0x2ed40c[_0xcd83('0x4')]=0x0;_0x2ed40c[_0xcd83('0x5')]=0x0;_0x2ed40c[_0xcd83('0x6')]=0x0;_0x2ed40c[_0xcd83('0x7')]=0x0;_0x2ed40c[_0xcd83('0x8')]=0x0;_0x2ed40c[_0xcd83('0x9')]=0x0;if(_0x2ed40c[_0xcd83('0xa')]){if(_0x2ed40c[_0xcd83('0xb')]===_0xcd83('0x8')){_0x2ed40c['abandoned']+=0x1;updateWaitingCounter(_0x2ed40c);}if(_0x2ed40c[_0xcd83('0xc')]){_0x2ed40c['answered']+=0x1;if(_0x2ed40c[_0xcd83('0x5')]){_0x2ed40c[_0xcd83('0x5')]-=0x1;}}else{if(_0x2ed40c[_0xcd83('0xb')]){_0x2ed40c[_0xcd83('0x7')]+=0x1;updateWaitingCounter(_0x2ed40c);}}}else{if(!_0x2ed40c[_0xcd83('0xc')]){_0x2ed40c[_0xcd83('0x4')]+=0x1;}if(_0x2ed40c['UserId']){_0x2ed40c[_0xcd83('0x5')]+=0x1;updateWaitingCounter(_0x2ed40c);}}_0x2ed40c[_0xcd83('0x9')]+=0x1;return _0x2ed40c;}function getLastMessageText(_0x5e77b7){return db[_0xcd83('0xd')][_0xcd83('0xe')]({'where':{'$and':[{'MailInteractionId':_0x5e77b7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xcd83('0xf')],'order':_0xcd83('0x10'),'raw':!![]})[_0xcd83('0x11')](function(_0x8f5b57){if(_0x8f5b57&&_0x8f5b57['plainBody']){_0x5e77b7['lastMsgText']=_[_0xcd83('0x12')](_0x8f5b57[_0xcd83('0xf')]);}return _0x5e77b7;})[_0xcd83('0x13')](function(_0x19113d){throw _0x19113d;});}exports[_0xcd83('0x14')]=function(_0x39fb5a,_0x48adac,_0x122f19,_0x5b80d8){return new Promise(function(_0x4dd4fc,_0x24a049){return getInteractionUsers(_0x39fb5a['id'],_0x122f19)[_0xcd83('0x11')](function(_0x9e08cb){_0x39fb5a[_0xcd83('0x15')]=_0x9e08cb;return getInteractionTags(_0x39fb5a[_0xcd83('0x16')],_0x48adac);})[_0xcd83('0x11')](function(_0x4edcd6){_0x39fb5a[_0xcd83('0x17')]=_0x4edcd6;delete _0x39fb5a[_0xcd83('0x16')];return updateInteractionCounters(_0x39fb5a);})[_0xcd83('0x11')](function(_0x59a6a2){if(_0x5b80d8){return getLastMessageText(_0x59a6a2);}else{return _0x59a6a2;}})[_0xcd83('0x11')](function(_0x1cc593){_0x4dd4fc(_0x1cc593);})[_0xcd83('0x13')](function(_0x414a35){_0x24a049(_0x414a35);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 1c30080..2056666 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 _0xde89=['catch','error','exports','lodash','../../mysqldb','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info'];(function(_0x391a3e,_0x78a3d4){var _0x4261f5=function(_0xd99c5a){while(--_0xd99c5a){_0x391a3e['push'](_0x391a3e['shift']());}};_0x4261f5(++_0x78a3d4);}(_0xde89,0x11a));var _0x9de8=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xde89[_0x4063a4];return _0x17908d;};'use strict';var _=require(_0x9de8('0x0'));var db=require(_0x9de8('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x9de8('0x2'))('mail-interactions'),'fax':require(_0x9de8('0x2'))(_0x9de8('0x3')),'sms':require(_0x9de8('0x2'))(_0x9de8('0x4')),'chat':require(_0x9de8('0x2'))(_0x9de8('0x5')),'whatsapp':require(_0x9de8('0x2'))(_0x9de8('0x6'))};function getAccountFK(_0x4cb037){return _['capitalize'](_0x4cb037)+(_0x4cb037===_0x9de8('0x7')?_0x9de8('0x8'):_0x9de8('0x9'))+'Id';}function getInteractionFK(_0xd68c4){return _['capitalize'](_0xd68c4)+_0x9de8('0xa');}function getInteractionId(_0x133fa4,_0x50048d,_0x5388fc){if(_0x133fa4&&_0x133fa4[_['upperFirst'](_0x5388fc)+'InteractionId']){return _0x133fa4[_[_0x9de8('0xb')](_0x5388fc)+_0x9de8('0xa')];}else if(_0x133fa4&&_0x133fa4['id']){return _0x133fa4['id'];}else if(_0x50048d&&_0x50048d['id']){return _0x50048d['id'];}else{return _0x9de8('0xc');}}function getInteractionsTables(_0x4b890b){return{'accounts':_0x4b890b+'_'+(_0x4b890b===_0x9de8('0x7')?_0x9de8('0xd'):_0x9de8('0xe')),'interactions':_0x4b890b+_0x9de8('0xf'),'interactionsTags':_0x4b890b+_0x9de8('0x10'),'messages':_0x4b890b+_0x9de8('0x11'),'userInteractions':'user_has_'+_0x4b890b+_0x9de8('0xf')};}function getSelectedTags(_0x244996){var _0x3b0ec8=[];if(_0x244996){_0x3b0ec8=Array['isArray'](_0x244996)?_0x244996:[_0x244996];}return _0x3b0ec8;}function log(_0x1a07ae,_0x225345,_0x29a16a,_0x213a0b,_0x546d43,_0x303b7b){loggers[_0x546d43['toLowerCase']()][_0x1a07ae](_0x9de8('0x12'),_0x303b7b[_0x9de8('0x13')](),_0x225345?_0x225345['id']:null,_0x225345?_0x225345[_0x9de8('0x14')]:null,_0x225345?_0x225345[_0x9de8('0x15')]:null,getInteractionId(_0x29a16a,_0x213a0b,_0x546d43),_0x29a16a?JSON[_0x9de8('0x16')](_0x29a16a):'null');}function updateUser(_0x34f4e8,_0x214528,_0x1e4d0e,_0x4460ed,_0x17c071){db[_[_0x9de8('0xb')](_0x4460ed)+_0x9de8('0x17')][_0x9de8('0x18')]({'where':{'id':getInteractionId(_0x214528,_0x1e4d0e,_0x4460ed)}})[_0x9de8('0x19')](function(_0x37197f){if(_0x37197f){return _0x37197f[_0x9de8('0x1a')]({'UserId':_0x34f4e8?_0x34f4e8['id']:null});}})[_0x9de8('0x19')](function(_0x391a1d){if(_0x391a1d){log(_0x9de8('0x1b'),_0x34f4e8,_0x214528,_0x1e4d0e,_0x4460ed,_0x17c071);}})[_0x9de8('0x1c')](function(){log(_0x9de8('0x1d'),_0x34f4e8,_0x214528,_0x1e4d0e,_0x4460ed,_0x17c071);});}module[_0x9de8('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x32b2=['update','info','error','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Account','upperFirst','InteractionId','unknown','accounts','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','then'];(function(_0x27d48f,_0x1a926b){var _0x4db5ff=function(_0x348ffd){while(--_0x348ffd){_0x27d48f['push'](_0x27d48f['shift']());}};_0x4db5ff(++_0x1a926b);}(_0x32b2,0x15f));var _0x232b=function(_0x48c03c,_0x3a0d41){_0x48c03c=_0x48c03c-0x0;var _0x33b898=_0x32b2[_0x48c03c];return _0x33b898;};'use strict';var _=require('lodash');var db=require(_0x232b('0x0'))['db'];var loggers={'openchannel':require(_0x232b('0x1'))(_0x232b('0x2')),'mail':require('../../config/logger')(_0x232b('0x3')),'fax':require(_0x232b('0x1'))('fax-interactions'),'sms':require(_0x232b('0x1'))(_0x232b('0x4')),'chat':require(_0x232b('0x1'))(_0x232b('0x5')),'whatsapp':require(_0x232b('0x1'))(_0x232b('0x6'))};function getAccountFK(_0x4f42c8){return _[_0x232b('0x7')](_0x4f42c8)+(_0x4f42c8===_0x232b('0x8')?'Website':_0x232b('0x9'))+'Id';}function getInteractionFK(_0x308f9f){return _[_0x232b('0x7')](_0x308f9f)+'InteractionId';}function getInteractionId(_0xcddf2c,_0x1ee4ca,_0x3807b1){if(_0xcddf2c&&_0xcddf2c[_[_0x232b('0xa')](_0x3807b1)+'InteractionId']){return _0xcddf2c[_[_0x232b('0xa')](_0x3807b1)+_0x232b('0xb')];}else if(_0xcddf2c&&_0xcddf2c['id']){return _0xcddf2c['id'];}else if(_0x1ee4ca&&_0x1ee4ca['id']){return _0x1ee4ca['id'];}else{return _0x232b('0xc');}}function getInteractionsTables(_0x507590){return{'accounts':_0x507590+'_'+(_0x507590===_0x232b('0x8')?'websites':_0x232b('0xd')),'interactions':_0x507590+'_interactions','interactionsTags':_0x507590+_0x232b('0xe'),'messages':_0x507590+_0x232b('0xf'),'userInteractions':_0x232b('0x10')+_0x507590+'_interactions'};}function getSelectedTags(_0x91584e){var _0x33e5f1=[];if(_0x91584e){_0x33e5f1=Array[_0x232b('0x11')](_0x91584e)?_0x91584e:[_0x91584e];}return _0x33e5f1;}function log(_0x20d8f7,_0x1f5bd9,_0x5ef36f,_0x21817d,_0x27ff67,_0x5d5c8a){loggers[_0x27ff67[_0x232b('0x12')]()][_0x20d8f7](_0x232b('0x13'),_0x5d5c8a[_0x232b('0x14')](),_0x1f5bd9?_0x1f5bd9['id']:null,_0x1f5bd9?_0x1f5bd9[_0x232b('0x15')]:null,_0x1f5bd9?_0x1f5bd9[_0x232b('0x16')]:null,getInteractionId(_0x5ef36f,_0x21817d,_0x27ff67),_0x5ef36f?JSON[_0x232b('0x17')](_0x5ef36f):'null');}function updateUser(_0x2e94b6,_0x54e661,_0x500469,_0x400a59,_0x3efe4d){db[_['upperFirst'](_0x400a59)+_0x232b('0x18')]['findOne']({'where':{'id':getInteractionId(_0x54e661,_0x500469,_0x400a59)}})[_0x232b('0x19')](function(_0x5dfdcf){if(_0x5dfdcf){return _0x5dfdcf[_0x232b('0x1a')]({'UserId':_0x2e94b6?_0x2e94b6['id']:null});}})['then'](function(_0x4f8773){if(_0x4f8773){log(_0x232b('0x1b'),_0x2e94b6,_0x54e661,_0x500469,_0x400a59,_0x3efe4d);}})['catch'](function(){log(_0x232b('0x1c'),_0x2e94b6,_0x54e661,_0x500469,_0x400a59,_0x3efe4d);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 87cdbb8..8a9ec6d 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 _0xa850=['admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User'];(function(_0x422f47,_0x6ab554){var _0x3b74a3=function(_0x1f6175){while(--_0x1f6175){_0x422f47['push'](_0x422f47['shift']());}};_0x3b74a3(++_0x6ab554);}(_0xa850,0x1b3));var _0x0a85=function(_0x4154ac,_0x13dcd9){_0x4154ac=_0x4154ac-0x0;var _0x22e9b7=_0xa850[_0x4154ac];return _0x22e9b7;};'use strict';var crypto=require(_0x0a85('0x0'));var util=require(_0x0a85('0x1'));var compose=require('composable-middleware');var db=require(_0x0a85('0x2'))['db'];var config=require(_0x0a85('0x3'));function getValueFromLicense(_0xc928fe,_0x290334){if(_0xc928fe&&_0x290334){if(_0x290334[_0x0a85('0x4')]&&_0x290334[_0x0a85('0x5')]){var _0x35fae0=_0x290334['data1'];var _0x4341a9=_0x290334[_0x0a85('0x5')];var _0x4d8d6b=_0x35fae0[_0x0a85('0x6')]('-')[0x4];var _0x360e92=_0x35fae0[_0x0a85('0x6')]('-')[0x0];var _0xece759=crypto[_0x0a85('0x7')](_0x0a85('0x8'),util[_0x0a85('0x9')](_0x0a85('0xa'),_0x4d8d6b,_0x35fae0,_0x360e92));var _0x31d054=_0xece759[_0x0a85('0xb')](_0x4341a9,'base64',_0x0a85('0xc'));_0x31d054+=_0xece759[_0x0a85('0xd')](_0x0a85('0xc'));var _0x3a204e=JSON[_0x0a85('0xe')](_0x31d054);return _0x3a204e[_0x0a85('0xf')](_0xc928fe)?_0x3a204e[_0xc928fe]:null;}}return null;}function isLimit(_0x34ac7d,_0x376114,_0x4d5b4d,_0x238872){var _0x844252=_0x376114;return compose()[_0x0a85('0x10')](function(_0x219fc6,_0xaaa18b,_0x3be32f){return db['License'][_0x0a85('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x0a85('0x12')](function(_0x4e7905){var _0x5a07e7=getValueFromLicense(_0x34ac7d,_0x4e7905);return _0x5a07e7?_0x5a07e7:_0x844252;})[_0x0a85('0x12')](function(_0x46bcef){_0x844252=_0x46bcef;return _0x4d5b4d['count'](_0x238872);})[_0x0a85('0x12')](function(_0x4f6eee){if(_0x4f6eee>=_0x844252){return _0xaaa18b[_0x0a85('0x13')](0x193)[_0x0a85('0x14')]({'message':util[_0x0a85('0x9')](_0x0a85('0x15'),_0x34ac7d)});}_0x3be32f();})[_0x0a85('0x16')](function(_0x32503e){_0x3be32f(_0x32503e);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x0a85('0x17')],{'where':{'$or':[{'role':_0x0a85('0x18')},{'role':_0x0a85('0x19')}]}});}exports[_0x0a85('0x1a')]=isUserLimit; \ No newline at end of file +var _0xf4c9=['split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xf4c9[_0x47aa64];return _0x549c7a;};'use strict';var crypto=require(_0x9f4c('0x0'));var util=require(_0x9f4c('0x1'));var compose=require(_0x9f4c('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x9f4c('0x3'));function getValueFromLicense(_0x4f495b,_0x80560e){if(_0x4f495b&&_0x80560e){if(_0x80560e[_0x9f4c('0x4')]&&_0x80560e[_0x9f4c('0x5')]){var _0x54ad85=_0x80560e[_0x9f4c('0x4')];var _0x514031=_0x80560e[_0x9f4c('0x5')];var _0x48dc53=_0x54ad85['split']('-')[0x4];var _0x498795=_0x54ad85[_0x9f4c('0x6')]('-')[0x0];var _0x398b30=crypto[_0x9f4c('0x7')](_0x9f4c('0x8'),util[_0x9f4c('0x9')](_0x9f4c('0xa'),_0x48dc53,_0x54ad85,_0x498795));var _0x553357=_0x398b30[_0x9f4c('0xb')](_0x514031,_0x9f4c('0xc'),_0x9f4c('0xd'));_0x553357+=_0x398b30[_0x9f4c('0xe')](_0x9f4c('0xd'));var _0x433f83=JSON[_0x9f4c('0xf')](_0x553357);return _0x433f83[_0x9f4c('0x10')](_0x4f495b)?_0x433f83[_0x4f495b]:null;}}return null;}function isLimit(_0x5700e2,_0x4953e8,_0x4d71a9,_0x124492){var _0x53159a=_0x4953e8;return compose()['use'](function(_0x32db23,_0x4df46b,_0x5a9cb0){return db[_0x9f4c('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1bcf14){var _0x516787=getValueFromLicense(_0x5700e2,_0x1bcf14);return _0x516787?_0x516787:_0x53159a;})[_0x9f4c('0x12')](function(_0x336fc2){_0x53159a=_0x336fc2;return _0x4d71a9[_0x9f4c('0x13')](_0x124492);})[_0x9f4c('0x12')](function(_0x182295){if(_0x182295>=_0x53159a){return _0x4df46b[_0x9f4c('0x14')](0x193)['json']({'message':util[_0x9f4c('0x9')](_0x9f4c('0x15'),_0x5700e2)});}_0x5a9cb0();})[_0x9f4c('0x16')](function(_0x30da19){_0x5a9cb0(_0x30da19);});});}function isUserLimit(){return isLimit(_0x9f4c('0x17'),0x1,db['User'],{'where':{'$or':[{'role':_0x9f4c('0x18')},{'role':_0x9f4c('0x19')}]}});}exports[_0x9f4c('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 8e8991d..6a66374 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 _0x82f5=['$gte','>=\x20?','$in','start','$substring','pop','utcOffset','hours','minutes','seconds','lodash','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','forEach','shift','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','=\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?'];(function(_0x36b594,_0x178663){var _0x5be097=function(_0x41ee63){while(--_0x41ee63){_0x36b594['push'](_0x36b594['shift']());}};_0x5be097(++_0x178663);}(_0x82f5,0x76));var _0x582f=function(_0x26c0a7,_0x2dc26e){_0x26c0a7=_0x26c0a7-0x0;var _0x4fbd83=_0x82f5[_0x26c0a7];return _0x4fbd83;};'use strict';var _=require(_0x582f('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x2c20b0){var _0x3a1c99={'conditions':[]};_0x3a1c99[_0x582f('0x1')]=_[_0x582f('0x2')](_0x2c20b0,'[$or]')?'or':_0x582f('0x3');var _0x17f629=_0x2c20b0[_0x582f('0x4')](_0x582f('0x5'),'')[_0x582f('0x4')](_0x582f('0x6'),'')[_0x582f('0x7')]('||');for(var _0x649732=0x0;_0x649732<_0x17f629[_0x582f('0x8')];_0x649732++){var _0x2850b7=_0x17f629[_0x649732]['split'](':=');var _0x248f6e=_0x2850b7[0x0];var _0x4e2a7d=_0x2850b7['slice'](0x1);_0x4e2a7d[_0x582f('0x9')](function(_0x474a8b){var _0x2645e2=_0x474a8b[_0x582f('0x7')]('[')[_0x582f('0xa')]();var _0x5f5862=_0x474a8b['match'](/\[(.*?)\]/g);_0x5f5862[_0x582f('0x9')](function(_0x12e423){var _0x305ef8=_0x12e423[_0x582f('0x7')]('[')['filter'](function(_0x3860db){return _0x3860db[_0x582f('0xb')](']')>-0x1;})[_0x582f('0xc')](function(_0x4e50b5){return _0x4e50b5['split'](']')[0x0];})[0x0];_0x3a1c99[_0x582f('0xd')][_0x582f('0xe')]({'field':_0x248f6e,'operator':_0x2645e2,'value':_0x305ef8});});});}return _0x3a1c99;};exports[_0x582f('0xf')]=function(_0x1562f6,_0x2f42eb,_0x2556b7){var _0x21c35b={};if(_0x2f42eb===_0x582f('0x10')){if(_0x2556b7[_0x582f('0x11')]===_0x582f('0x12')){_0x2556b7['operator']=_0x582f('0x13');_0x2556b7[_0x582f('0x14')]+=','+_0x2556b7['value'];}else if(_['includes'](['$gt',_0x582f('0x15')],_0x2556b7['operator'])){_0x2556b7['value']=moment(_0x2556b7[_0x582f('0x14')])[_0x582f('0x16')](0x1,'days')[_0x582f('0x17')](_0x582f('0x18'));}}if(_0x2556b7[_0x582f('0x19')]){_0x2f42eb=_0x2556b7[_0x582f('0x19')];_0x21c35b[_0x582f('0x1a')]=_0x582f('0x1b')+_0x1562f6+'.'+_0x2556b7[_0x582f('0x1c')]+_0x582f('0x1d')+_0x2556b7['castTo']+')\x20'+parseOperator(_0x2556b7[_0x582f('0x11')]);}else{_0x21c35b[_0x582f('0x1a')]=_0x1562f6+'.'+_0x2556b7[_0x582f('0x1c')]+'\x20'+parseOperator(_0x2556b7[_0x582f('0x11')]);}if(_[_0x582f('0x1e')]([_0x582f('0x1f'),_0x582f('0x20')],_0x2556b7['operator']))_0x21c35b[_0x582f('0x1a')]='('+_0x21c35b['text']+_0x582f('0x21')+_0x1562f6+'.'+_0x2556b7[_0x582f('0x1c')]+'\x20IS\x20NULL)';_0x21c35b[_0x582f('0x14')]=parseValue(_0x2f42eb,_0x2556b7[_0x582f('0x11')],_0x2556b7[_0x582f('0x14')]);return _0x21c35b;};function parseOperator(_0x4cc895){var _0x42789e;switch(_0x4cc895){case'$in':_0x42789e=_0x582f('0x22');break;case _0x582f('0x20'):_0x42789e=_0x582f('0x23');break;case _0x582f('0x12'):_0x42789e=_0x582f('0x24');break;case _0x582f('0x1f'):_0x42789e='<>\x20?';break;case'$substring':case'$startsWith':case _0x582f('0x25'):_0x42789e=_0x582f('0x26');break;case _0x582f('0x27'):_0x42789e=_0x582f('0x28');break;case _0x582f('0x29'):_0x42789e=_0x582f('0x2a');break;case _0x582f('0x15'):_0x42789e=_0x582f('0x2b');break;case _0x582f('0x2c'):_0x42789e=_0x582f('0x2d');break;case _0x582f('0x13'):_0x42789e='BETWEEN\x20?\x20AND\x20?';break;}return _0x42789e;}function parseValue(_0x4ae041,_0x487a6a,_0x15b876){var _0x27ed97={'start':undefined,'end':undefined};switch(_0x487a6a){case _0x582f('0x2e'):case _0x582f('0x20'):_0x27ed97[_0x582f('0x2f')]=_0x15b876[_0x582f('0x7')](',');break;case _0x582f('0x30'):_0x27ed97[_0x582f('0x2f')]='%'+_0x15b876+'%';break;case'$startsWith':_0x27ed97[_0x582f('0x2f')]=_0x15b876+'%';break;case _0x582f('0x25'):_0x27ed97[_0x582f('0x2f')]='%'+_0x15b876;break;case _0x582f('0x13'):var _0x3ef662=_0x15b876[_0x582f('0x7')](',');var _0x15b876=_0x3ef662[_0x582f('0xa')]();var _0x468179=_0x3ef662[_0x582f('0x31')]();if(_0x4ae041===_0x582f('0x10')){_0x15b876=moment(_0x15b876)[_0x582f('0x32')](0x0,!![])[_0x582f('0x17')]();_0x468179=moment(_0x468179)[_0x582f('0x32')](0x0,!![])[_0x582f('0x16')](0x17,_0x582f('0x33'))['add'](0x3b,_0x582f('0x34'))['add'](0x3b,_0x582f('0x35'))[_0x582f('0x17')]();}_0x27ed97={'start':_0x15b876,'end':_0x468179};break;default:_0x27ed97['start']=_0x15b876;break;}return _0x27ed97;} \ No newline at end of file +var _0xb801=['startsWith','and','replace','[$and]','[$or]','split','length','slice','forEach','match','filter','indexOf','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','castTo','text','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator'];(function(_0x8b63c1,_0x3a2d53){var _0x3f01f9=function(_0x33657e){while(--_0x33657e){_0x8b63c1['push'](_0x8b63c1['shift']());}};_0x3f01f9(++_0x3a2d53);}(_0xb801,0x18b));var _0x1b80=function(_0x4561d5,_0x605006){_0x4561d5=_0x4561d5-0x0;var _0x449ddb=_0xb801[_0x4561d5];return _0x449ddb;};'use strict';var _=require(_0x1b80('0x0'));var moment=require(_0x1b80('0x1'));exports[_0x1b80('0x2')]=function(_0x18cdac){var _0x3f52cc={'conditions':[]};_0x3f52cc[_0x1b80('0x3')]=_[_0x1b80('0x4')](_0x18cdac,'[$or]')?'or':_0x1b80('0x5');var _0x52720a=_0x18cdac[_0x1b80('0x6')](_0x1b80('0x7'),'')[_0x1b80('0x6')](_0x1b80('0x8'),'')[_0x1b80('0x9')]('||');for(var _0x5cb67a=0x0;_0x5cb67a<_0x52720a[_0x1b80('0xa')];_0x5cb67a++){var _0x55c384=_0x52720a[_0x5cb67a]['split'](':=');var _0x41958d=_0x55c384[0x0];var _0x232b2d=_0x55c384[_0x1b80('0xb')](0x1);_0x232b2d[_0x1b80('0xc')](function(_0x49f6e1){var _0x26ab67=_0x49f6e1[_0x1b80('0x9')]('[')['shift']();var _0x5b19dd=_0x49f6e1[_0x1b80('0xd')](/\[(.*?)\]/g);_0x5b19dd[_0x1b80('0xc')](function(_0x3e4dfc){var _0x12d2b6=_0x3e4dfc['split']('[')[_0x1b80('0xe')](function(_0x4cd270){return _0x4cd270[_0x1b80('0xf')](']')>-0x1;})['map'](function(_0x312f73){return _0x312f73['split'](']')[0x0];})[0x0];_0x3f52cc['conditions'][_0x1b80('0x10')]({'field':_0x41958d,'operator':_0x26ab67,'value':_0x12d2b6});});});}return _0x3f52cc;};exports[_0x1b80('0x11')]=function(_0x4610d1,_0x3148d7,_0x1fa9ac){var _0x4e3500={};if(_0x3148d7===_0x1b80('0x12')){if(_0x1fa9ac[_0x1b80('0x13')]===_0x1b80('0x14')){_0x1fa9ac[_0x1b80('0x13')]='$between';_0x1fa9ac[_0x1b80('0x15')]+=','+_0x1fa9ac[_0x1b80('0x15')];}else if(_[_0x1b80('0x16')]([_0x1b80('0x17'),_0x1b80('0x18')],_0x1fa9ac['operator'])){_0x1fa9ac[_0x1b80('0x15')]=moment(_0x1fa9ac[_0x1b80('0x15')])[_0x1b80('0x19')](0x1,_0x1b80('0x1a'))[_0x1b80('0x1b')]('YYYY-MM-DD');}}if(_0x1fa9ac[_0x1b80('0x1c')]){_0x3148d7=_0x1fa9ac['castTo'];_0x4e3500[_0x1b80('0x1d')]='CAST('+_0x4610d1+'.'+_0x1fa9ac[_0x1b80('0x1e')]+'\x20AS\x20'+_0x1fa9ac['castTo']+')\x20'+parseOperator(_0x1fa9ac['operator']);}else{_0x4e3500[_0x1b80('0x1d')]=_0x4610d1+'.'+_0x1fa9ac[_0x1b80('0x1e')]+'\x20'+parseOperator(_0x1fa9ac['operator']);}if(_[_0x1b80('0x16')]([_0x1b80('0x1f'),_0x1b80('0x20')],_0x1fa9ac['operator']))_0x4e3500[_0x1b80('0x1d')]='('+_0x4e3500[_0x1b80('0x1d')]+_0x1b80('0x21')+_0x4610d1+'.'+_0x1fa9ac[_0x1b80('0x1e')]+_0x1b80('0x22');_0x4e3500[_0x1b80('0x15')]=parseValue(_0x3148d7,_0x1fa9ac[_0x1b80('0x13')],_0x1fa9ac['value']);return _0x4e3500;};function parseOperator(_0x1cf7c1){var _0x5f2fb1;switch(_0x1cf7c1){case _0x1b80('0x23'):_0x5f2fb1=_0x1b80('0x24');break;case _0x1b80('0x20'):_0x5f2fb1=_0x1b80('0x25');break;case _0x1b80('0x14'):_0x5f2fb1=_0x1b80('0x26');break;case'$ne':_0x5f2fb1=_0x1b80('0x27');break;case _0x1b80('0x28'):case _0x1b80('0x29'):case _0x1b80('0x2a'):_0x5f2fb1=_0x1b80('0x2b');break;case _0x1b80('0x2c'):_0x5f2fb1=_0x1b80('0x2d');break;case _0x1b80('0x17'):_0x5f2fb1='>\x20?';break;case _0x1b80('0x18'):_0x5f2fb1=_0x1b80('0x2e');break;case _0x1b80('0x2f'):_0x5f2fb1='>=\x20?';break;case _0x1b80('0x30'):_0x5f2fb1=_0x1b80('0x31');break;}return _0x5f2fb1;}function parseValue(_0x460628,_0x31ce3b,_0x5dd842){var _0x3c8c94={'start':undefined,'end':undefined};switch(_0x31ce3b){case'$in':case _0x1b80('0x20'):_0x3c8c94[_0x1b80('0x32')]=_0x5dd842[_0x1b80('0x9')](',');break;case _0x1b80('0x28'):_0x3c8c94[_0x1b80('0x32')]='%'+_0x5dd842+'%';break;case _0x1b80('0x29'):_0x3c8c94['start']=_0x5dd842+'%';break;case _0x1b80('0x2a'):_0x3c8c94[_0x1b80('0x32')]='%'+_0x5dd842;break;case _0x1b80('0x30'):var _0x153b9f=_0x5dd842[_0x1b80('0x9')](',');var _0x5dd842=_0x153b9f[_0x1b80('0x33')]();var _0xebdcad=_0x153b9f[_0x1b80('0x34')]();if(_0x460628==='DATE'){_0x5dd842=moment(_0x5dd842)[_0x1b80('0x35')](0x0,!![])['format']();_0xebdcad=moment(_0xebdcad)[_0x1b80('0x35')](0x0,!![])[_0x1b80('0x19')](0x17,_0x1b80('0x36'))[_0x1b80('0x19')](0x3b,_0x1b80('0x37'))[_0x1b80('0x19')](0x3b,_0x1b80('0x38'))[_0x1b80('0x1b')]();}_0x3c8c94={'start':_0x5dd842,'end':_0xebdcad};break;default:_0x3c8c94['start']=_0x5dd842;break;}return _0x3c8c94;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index cba5783..eaad53f 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 _0x5334=['value','merge','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','intersection','attributes','nolimit','limit','offset','order','where','pick','filter','object','columns'];(function(_0x45a0c5,_0x4e63dd){var _0x49d6c3=function(_0x289482){while(--_0x289482){_0x45a0c5['push'](_0x45a0c5['shift']());}};_0x49d6c3(++_0x4e63dd);}(_0x5334,0x84));var _0x4533=function(_0xac15c3,_0x2451ea){_0xac15c3=_0xac15c3-0x0;var _0x3ef3db=_0x5334[_0xac15c3];return _0x3ef3db;};'use strict';var _=require(_0x4533('0x0'));var sequelize=require(_0x4533('0x1'));var moment=require(_0x4533('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x35fb80){var _0x39af56=['ne'];try{var _0x52b768=JSON[_0x4533('0x3')](_0x35fb80);var _0x5176b5=Object[_0x4533('0x4')](_0x52b768)[0x0];return _0x39af56[_0x4533('0x5')](_0x5176b5);}catch(_0x5cbca4){return![];}}function getOperatorValue(_0x4a576a){var _0x51b4ce=JSON[_0x4533('0x3')](_0x4a576a);var _0x4dea06=Object['keys'](_0x51b4ce)[0x0];var _0x487906=_0x51b4ce[_0x4dea06];return{['$'+_0x4dea06]:_0x487906};}exports[_0x4533('0x6')]=function(_0x42f94b){var _0x300877=null;if(_0x42f94b){_0x300877=_0x42f94b[_0x4533('0x7')](',');}return _0x300877;};exports[_0x4533('0x8')]=function(_0x21b22f,_0xd417){var _0x4fdbda={};if(!_[_0x4533('0x9')](_0x21b22f)){_[_0x4533('0xa')](_0x21b22f,function(_0x1b52ee,_0x12131a){try{if(_0xd417){var _0x5465bf=_[_0x4533('0xb')](_0xd417,{'name':_0x12131a})||{};if(hasSequelizeOperator(_0x1b52ee)){_0x4fdbda[_0x12131a]=getOperatorValue(_0x1b52ee);}else if(_0x5465bf['type']===_0x4533('0xc')&&_[_0x4533('0xd')](_0x1b52ee)){var _0x45ba67=JSON[_0x4533('0x3')](_0x1b52ee);var _0x57ff74={'$gte':moment(moment(_0x45ba67[_0x4533('0xe')])[_0x4533('0xf')](_0x4533('0x10')))[_0x4533('0x11')]()['format'](),'$lte':moment(moment(_0x45ba67[_0x4533('0x12')])['format']('YYYY-MM-DD'))[_0x4533('0x11')]()[_0x4533('0x13')](0x1,'s')['format']()};_0x4fdbda[_0x12131a]=_0x57ff74;}else if(_0x5465bf[_0x4533('0x14')]===_0x4533('0x15')){_0x4fdbda[_0x12131a]=_0x1b52ee;}else{_0x4fdbda[_0x12131a]=_[_0x4533('0x16')](_0x1b52ee)?_0x1b52ee:JSON['parse'](_0x1b52ee);}}else{_0x4fdbda[_0x12131a]=_[_0x4533('0x16')](_0x1b52ee)?_0x1b52ee:JSON['parse'](_0x1b52ee);}}catch(_0x3ddb36){_0x4fdbda[_0x12131a]=_0x1b52ee[_0x4533('0x7')](',');}});}return _0x4fdbda;};exports['limit']=function(_0xd10c6a){_0xd10c6a=parseInt(_0xd10c6a,0xa);if(!_0xd10c6a||_0xd10c6a<0x0){_0xd10c6a=LIMIT_VALUE;}return _0xd10c6a;};exports['offset']=function(_0x5c2c9c){_0x5c2c9c=parseInt(_0x5c2c9c,0xa);if(!_0x5c2c9c||_0x5c2c9c<0x0){_0x5c2c9c=0x0;}return _0x5c2c9c;};exports[_0x4533('0x17')]=function(_0x9740a6){var _0x49fb91,_0x53fe43=null;if(_0x9740a6){_0x49fb91=_0x9740a6[_0x4533('0x7')](',');_0x53fe43=_[_0x4533('0x18')](_0x49fb91,function(_0x3467ba){if(_0x3467ba[_0x4533('0x19')]('-')===0x0){return[_0x3467ba===_0x4533('0x1a')?sequelize[_0x4533('0x1b')](sequelize[_0x4533('0x1c')]('priority'),_0x4533('0x1d')):_0x3467ba[_0x4533('0x1e')](0x1),_0x4533('0x1f')];}else{return[_0x3467ba==='priority'?sequelize['cast'](sequelize[_0x4533('0x1c')](_0x4533('0x1a')),'unsigned'):_0x3467ba,'ASC'];}});}return _0x53fe43;};exports[_0x4533('0x20')]=function(_0x1fa8be,_0xfd9409){if(_['isEmpty'](_0x1fa8be)){return _0x1fa8be;}if(_[_0x4533('0x16')](_0x1fa8be)){for(var _0x39b261=0x0;_0x39b261<_0x1fa8be[_0x4533('0x21')];_0x39b261+=0x1){_0x1fa8be[_0x39b261]=this[_0x4533('0x20')](_0x1fa8be[_0x39b261],_0xfd9409);}return _0x1fa8be;}if(!_[_0x4533('0x22')](_0x1fa8be)){return _0x1fa8be;}if(_[_0x4533('0x23')](_0xfd9409)){_0xfd9409=[_0xfd9409];}if(!_[_0x4533('0x16')](_0xfd9409)){return _0x1fa8be;}for(var _0x27b653=0x0;_0x27b653<_0xfd9409[_0x4533('0x21')];_0x27b653+=0x1){_['unset'](_0x1fa8be,_0xfd9409[_0x27b653]);}for(var _0x5c1e24 in _0x1fa8be){if(_0x1fa8be[_0x4533('0x24')](_0x5c1e24)){_0x1fa8be[_0x5c1e24]=this['omit'](_0x1fa8be[_0x5c1e24],_0xfd9409);}}return _0x1fa8be;};exports[_0x4533('0x25')]=function(_0x4e2b80){return _0x4e2b80[_0x4533('0x26')](RegExp(_0x4533('0x27')))?!![]:![];};exports[_0x4533('0x28')]=function(_0x4300c1){return _0x4300c1[_0x4533('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x4533('0x29')]=function(_0xe584a2){var _0xa58dd1=[];_0xe584a2[_0x4533('0x7')](/[ ,]+/)[_0x4533('0x2a')](function(_0x728791){_0x728791=_0x728791[_0x4533('0x2b')](/([^:]")"+/g,'$1');_0x728791='+'+_0x728791+'*';var _0x7fc887=/[ `!@#$%^&*()_\-?~]/;if(_0x728791['match'](_0x7fc887))_0x728791='\x22'+_0x728791+'\x22';_0xa58dd1[_0x4533('0x2c')](_0x728791);});return _0xa58dd1['join']('\x20');};exports[_0x4533('0x2d')]=function(_0x3f7720,_0xb7f0b1,_0x3b89f0){var _0x24acf5={},_0x6d58aa={};if(_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x2f')]){_0xb7f0b1[_0x4533('0x2e')]['id']=_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x2f')];delete _0xb7f0b1[_0x4533('0x2e')]['$id'];}_0x24acf5[_0x4533('0x30')]=_[_0x4533('0x18')](_0x3f7720,_0x4533('0x14'));_0x24acf5[_0x4533('0x2e')]=_[_0x4533('0x4')](_0xb7f0b1['query']);_0x24acf5[_0x4533('0x8')]=_[_0x4533('0x31')](_0x24acf5[_0x4533('0x30')],_0x24acf5[_0x4533('0x2e')]);_0x6d58aa[_0x4533('0x32')]=_[_0x4533('0x31')](_0x24acf5['model'],this[_0x4533('0x6')](_0xb7f0b1[_0x4533('0x2e')]['fields']));_0x6d58aa[_0x4533('0x32')]=_0x6d58aa[_0x4533('0x32')][_0x4533('0x21')]?_0x6d58aa[_0x4533('0x32')]:_0x24acf5[_0x4533('0x30')];if(!_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x24')](_0x4533('0x33'))){_0x6d58aa[_0x4533('0x34')]=this[_0x4533('0x34')](_0xb7f0b1['query'][_0x4533('0x34')]);_0x6d58aa[_0x4533('0x35')]=this[_0x4533('0x35')](_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x35')]);}_0x6d58aa[_0x4533('0x36')]=this[_0x4533('0x17')](_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x17')]);_0x6d58aa[_0x4533('0x37')]=this[_0x4533('0x8')](_[_0x4533('0x38')](_0xb7f0b1['query'],_0x24acf5['filters']),_0x3f7720);if(_0xb7f0b1[_0x4533('0x2e')]['filter']){var _0x4260e6=_0x3f7720;var _0x97aa9e=_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x39')];if(typeof _0x97aa9e===_0x4533('0x3a')){_0x4260e6=_[_0x4533('0x39')](_0x3f7720,function(_0x2df795){return _[_0x4533('0x5')](_0x97aa9e[_0x4533('0x3b')],_0x2df795[_0x4533('0x14')]);});_0x97aa9e=_0x97aa9e[_0x4533('0x3c')];}_0x6d58aa[_0x4533('0x37')]=_[_0x4533('0x3d')](_0x6d58aa['where'],{'$or':_[_0x4533('0x18')](_0x4260e6,function(_0x556dd9){if(_0x556dd9['type']!=='VIRTUAL'){if(_0x3b89f0){return sequelize['where'](sequelize['fn'](_0x4533('0x3e'),sequelize[_0x4533('0x1c')](_0x556dd9[_0x4533('0x14')])),{'$like':sequelize['fn'](_0x4533('0x3e'),'%'+_0xb7f0b1['query'][_0x4533('0x39')]+'%')});}else{var _0x369284={};_0x369284[_0x556dd9[_0x4533('0x14')]]={'$like':'%'+_0xb7f0b1[_0x4533('0x2e')][_0x4533('0x39')]+'%'};return _0x369284;}}})});}_0x6d58aa=_[_0x4533('0x3d')]({},_0x6d58aa,_0xb7f0b1[_0x4533('0x3f')]);return _0x6d58aa;}; \ No newline at end of file +var _0x24ca=['omit','isEmpty','isObject','isString','hasOwnProperty','isNumeric','match','getFullTextValue','forEach','replace','push','join','query','$id','intersection','model','attributes','length','order','sort','where','filters','filter','object','value','merge','VIRTUAL','lower','lodash','parse','includes','keys','fields','split','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','map','indexOf','priority','cast','col','unsigned','substr','ASC'];(function(_0x347e05,_0x52d75f){var _0xdbbf97=function(_0x59ab46){while(--_0x59ab46){_0x347e05['push'](_0x347e05['shift']());}};_0xdbbf97(++_0x52d75f);}(_0x24ca,0x8c));var _0xa24c=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x24ca[_0xd09668];return _0x68726;};'use strict';var _=require(_0xa24c('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f4ee1){var _0x4e90b0=['ne'];try{var _0x155c49=JSON[_0xa24c('0x1')](_0x1f4ee1);var _0xe69cdd=Object['keys'](_0x155c49)[0x0];return _0x4e90b0[_0xa24c('0x2')](_0xe69cdd);}catch(_0x89148d){return![];}}function getOperatorValue(_0x4707f9){var _0x5a37ae=JSON['parse'](_0x4707f9);var _0x52147a=Object[_0xa24c('0x3')](_0x5a37ae)[0x0];var _0x3c10d9=_0x5a37ae[_0x52147a];return{['$'+_0x52147a]:_0x3c10d9};}exports[_0xa24c('0x4')]=function(_0x3c3959){var _0x34288c=null;if(_0x3c3959){_0x34288c=_0x3c3959[_0xa24c('0x5')](',');}return _0x34288c;};exports['filters']=function(_0x101ca7,_0x413b3d){var _0x355882={};if(!_['isEmpty'](_0x101ca7)){_['forOwn'](_0x101ca7,function(_0x1331f4,_0x73a132){try{if(_0x413b3d){var _0x2da0c3=_[_0xa24c('0x6')](_0x413b3d,{'name':_0x73a132})||{};if(hasSequelizeOperator(_0x1331f4)){_0x355882[_0x73a132]=getOperatorValue(_0x1331f4);}else if(_0x2da0c3[_0xa24c('0x7')]===_0xa24c('0x8')&&_['isPlainObject'](_0x1331f4)){var _0x5bb631=JSON['parse'](_0x1331f4);var _0x2444b7={'$gte':moment(moment(_0x5bb631[_0xa24c('0x9')])[_0xa24c('0xa')](_0xa24c('0xb')))[_0xa24c('0xc')]()['format'](),'$lte':moment(moment(_0x5bb631[_0xa24c('0xd')])['format']('YYYY-MM-DD'))['utc']()[_0xa24c('0xe')](0x1,'s')[_0xa24c('0xa')]()};_0x355882[_0x73a132]=_0x2444b7;}else if(_0x2da0c3[_0xa24c('0xf')]===_0xa24c('0x10')){_0x355882[_0x73a132]=_0x1331f4;}else{_0x355882[_0x73a132]=_[_0xa24c('0x11')](_0x1331f4)?_0x1331f4:JSON[_0xa24c('0x1')](_0x1331f4);}}else{_0x355882[_0x73a132]=_[_0xa24c('0x11')](_0x1331f4)?_0x1331f4:JSON[_0xa24c('0x1')](_0x1331f4);}}catch(_0x14f0aa){_0x355882[_0x73a132]=_0x1331f4[_0xa24c('0x5')](',');}});}return _0x355882;};exports[_0xa24c('0x12')]=function(_0x1a667b){_0x1a667b=parseInt(_0x1a667b,0xa);if(!_0x1a667b||_0x1a667b<0x0){_0x1a667b=LIMIT_VALUE;}return _0x1a667b;};exports[_0xa24c('0x13')]=function(_0x3e4e81){_0x3e4e81=parseInt(_0x3e4e81,0xa);if(!_0x3e4e81||_0x3e4e81<0x0){_0x3e4e81=0x0;}return _0x3e4e81;};exports['sort']=function(_0x167a76){var _0x48fb65,_0x98802d=null;if(_0x167a76){_0x48fb65=_0x167a76[_0xa24c('0x5')](',');_0x98802d=_[_0xa24c('0x14')](_0x48fb65,function(_0x37e20e){if(_0x37e20e[_0xa24c('0x15')]('-')===0x0){return[_0x37e20e===_0xa24c('0x16')?sequelize[_0xa24c('0x17')](sequelize[_0xa24c('0x18')](_0xa24c('0x16')),_0xa24c('0x19')):_0x37e20e[_0xa24c('0x1a')](0x1),'DESC'];}else{return[_0x37e20e==='priority'?sequelize[_0xa24c('0x17')](sequelize[_0xa24c('0x18')](_0xa24c('0x16')),_0xa24c('0x19')):_0x37e20e,_0xa24c('0x1b')];}});}return _0x98802d;};exports[_0xa24c('0x1c')]=function(_0x16bd20,_0x3106ff){if(_[_0xa24c('0x1d')](_0x16bd20)){return _0x16bd20;}if(_['isArray'](_0x16bd20)){for(var _0x2290e1=0x0;_0x2290e1<_0x16bd20['length'];_0x2290e1+=0x1){_0x16bd20[_0x2290e1]=this[_0xa24c('0x1c')](_0x16bd20[_0x2290e1],_0x3106ff);}return _0x16bd20;}if(!_[_0xa24c('0x1e')](_0x16bd20)){return _0x16bd20;}if(_[_0xa24c('0x1f')](_0x3106ff)){_0x3106ff=[_0x3106ff];}if(!_[_0xa24c('0x11')](_0x3106ff)){return _0x16bd20;}for(var _0x54b8a6=0x0;_0x54b8a6<_0x3106ff['length'];_0x54b8a6+=0x1){_['unset'](_0x16bd20,_0x3106ff[_0x54b8a6]);}for(var _0x4e5d2c in _0x16bd20){if(_0x16bd20[_0xa24c('0x20')](_0x4e5d2c)){_0x16bd20[_0x4e5d2c]=this[_0xa24c('0x1c')](_0x16bd20[_0x4e5d2c],_0x3106ff);}}return _0x16bd20;};exports[_0xa24c('0x21')]=function(_0x1cdee4){return _0x1cdee4[_0xa24c('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x33c208){return _0x33c208[_0xa24c('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0xa24c('0x23')]=function(_0x1d500e){var _0x4566dc=[];_0x1d500e[_0xa24c('0x5')](/[ ,]+/)[_0xa24c('0x24')](function(_0x1e30a9){_0x1e30a9=_0x1e30a9[_0xa24c('0x25')](/([^:]")"+/g,'$1');_0x1e30a9='+'+_0x1e30a9+'*';var _0x17a001=/[ `!@#$%^&*()_\-?~]/;if(_0x1e30a9['match'](_0x17a001))_0x1e30a9='\x22'+_0x1e30a9+'\x22';_0x4566dc[_0xa24c('0x26')](_0x1e30a9);});return _0x4566dc[_0xa24c('0x27')]('\x20');};exports['getOptions']=function(_0x3c9649,_0x3e8b0f,_0x33f0c9){var _0x1de2ef={},_0x26f2fe={};if(_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x29')]){_0x3e8b0f[_0xa24c('0x28')]['id']=_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x29')];delete _0x3e8b0f['query']['$id'];}_0x1de2ef['model']=_[_0xa24c('0x14')](_0x3c9649,'name');_0x1de2ef[_0xa24c('0x28')]=_[_0xa24c('0x3')](_0x3e8b0f[_0xa24c('0x28')]);_0x1de2ef['filters']=_[_0xa24c('0x2a')](_0x1de2ef[_0xa24c('0x2b')],_0x1de2ef[_0xa24c('0x28')]);_0x26f2fe['attributes']=_[_0xa24c('0x2a')](_0x1de2ef[_0xa24c('0x2b')],this['fields'](_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x4')]));_0x26f2fe[_0xa24c('0x2c')]=_0x26f2fe['attributes'][_0xa24c('0x2d')]?_0x26f2fe[_0xa24c('0x2c')]:_0x1de2ef[_0xa24c('0x2b')];if(!_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x20')]('nolimit')){_0x26f2fe[_0xa24c('0x12')]=this[_0xa24c('0x12')](_0x3e8b0f['query'][_0xa24c('0x12')]);_0x26f2fe[_0xa24c('0x13')]=this[_0xa24c('0x13')](_0x3e8b0f['query']['offset']);}_0x26f2fe[_0xa24c('0x2e')]=this[_0xa24c('0x2f')](_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x2f')]);_0x26f2fe[_0xa24c('0x30')]=this[_0xa24c('0x31')](_['pick'](_0x3e8b0f[_0xa24c('0x28')],_0x1de2ef[_0xa24c('0x31')]),_0x3c9649);if(_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x32')]){var _0x5f3cd4=_0x3c9649;var _0x34026c=_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x32')];if(typeof _0x34026c===_0xa24c('0x33')){_0x5f3cd4=_[_0xa24c('0x32')](_0x3c9649,function(_0x7d16aa){return _[_0xa24c('0x2')](_0x34026c['columns'],_0x7d16aa['name']);});_0x34026c=_0x34026c[_0xa24c('0x34')];}_0x26f2fe['where']=_[_0xa24c('0x35')](_0x26f2fe['where'],{'$or':_[_0xa24c('0x14')](_0x5f3cd4,function(_0x214627){if(_0x214627[_0xa24c('0x7')]!==_0xa24c('0x36')){if(_0x33f0c9){return sequelize[_0xa24c('0x30')](sequelize['fn'](_0xa24c('0x37'),sequelize[_0xa24c('0x18')](_0x214627[_0xa24c('0xf')])),{'$like':sequelize['fn'](_0xa24c('0x37'),'%'+_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x32')]+'%')});}else{var _0x1f87b7={};_0x1f87b7[_0x214627[_0xa24c('0xf')]]={'$like':'%'+_0x3e8b0f[_0xa24c('0x28')][_0xa24c('0x32')]+'%'};return _0x1f87b7;}}})});}_0x26f2fe=_[_0xa24c('0x35')]({},_0x26f2fe,_0x3e8b0f['options']);return _0x26f2fe;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 8b2b563..a61e879 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 _0xcf9e=['catch','getRealtimeAgents','isArray','startCase','map','getAgents','all','value','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','voicePause','whatsappPause','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','pauseType','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','chatPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','lodash','../../mysqldb','client','http','faxPause','mailPause','openchannelPause','smsPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','idle','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge'];(function(_0xf73bf5,_0x4846a3){var _0x14c881=function(_0x388d9a){while(--_0x388d9a){_0xf73bf5['push'](_0xf73bf5['shift']());}};_0x14c881(++_0x4846a3);}(_0xcf9e,0x1a3));var _0xecf9=function(_0x21ecef,_0x473759){_0x21ecef=_0x21ecef-0x0;var _0x2046c7=_0xcf9e[_0x21ecef];return _0x2046c7;};'use strict';var _=require(_0xecf9('0x0'));var jayson=require('jayson/promise');var db=require(_0xecf9('0x1'))['db'];var amiClient=jayson[_0xecf9('0x2')][_0xecf9('0x3')]({'port':0x232a});var routingClient=jayson[_0xecf9('0x2')][_0xecf9('0x3')]({'port':0x232c});function isAgentPaused(_0x442ae7,_0x2459e0){var _0x57cfbd=[_0x442ae7['chatPause'],_0x442ae7[_0xecf9('0x4')],_0x442ae7[_0xecf9('0x5')],_0x442ae7[_0xecf9('0x6')],_0x442ae7[_0xecf9('0x7')],_0x442ae7['voicePause'],_0x442ae7['whatsappPause']];if(!_0x2459e0)return _[_0xecf9('0x8')](_0x57cfbd);var _0x37ac74=_[_0xecf9('0x9')](_0x57cfbd);return _0x37ac74['length']>0x0&&_0x37ac74[_0xecf9('0xa')]<_0x57cfbd['length']?!![]:![];}function isIdle(_0x5e52fa){return _0x5e52fa==='idle'||_0x5e52fa===_0xecf9('0xb')||_0x5e52fa===_0xecf9('0xc')||_0x5e52fa===_0xecf9('0xd')||_[_0xecf9('0xe')](_0x5e52fa);}function isAgentIdle(_0x578857){if(_0x578857[_0xecf9('0xf')]!==_0xecf9('0x10')&&_0x578857['voicePause']){_0x578857[_0xecf9('0xf')]=_0xecf9('0x11');return![];}return _['every']([_0x578857[_0xecf9('0x12')],_0x578857[_0xecf9('0x13')],_0x578857[_0xecf9('0x14')],_0x578857[_0xecf9('0x15')],_0x578857[_0xecf9('0x16')],_0x578857[_0xecf9('0xf')],_0x578857[_0xecf9('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xecf9('0x18')]('Agents',{})[_0xecf9('0x19')](function(_0x4b0483){if(_0x4b0483[_0xecf9('0x1a')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x297690=_0x4b0483[_0xecf9('0x1b')];return routingClient[_0xecf9('0x18')](_0xecf9('0x1c'),{})[_0xecf9('0x19')](function(_0x32c18a){if(_0x32c18a[_0xecf9('0x1a')]){throw new Error(_0xecf9('0x1d'));}var _0x5c4619=_0x32c18a[_0xecf9('0x1b')];return _[_0xecf9('0x1e')]({},_0x297690,_0x5c4619);});})[_0xecf9('0x1f')](function(_0x5340de){throw _0x5340de;});}exports[_0xecf9('0x20')]=getRealtimeAgents;function getAgentStatus(_0x47a776){var _0x40e254=_0xecf9('0xb');if(isAgentPaused(_0x47a776))_0x40e254=_0xecf9('0x11');else if(isAgentPaused(_0x47a776,!![]))_0x40e254='*pause';else if(isAgentIdle(_0x47a776))_0x40e254=_0xecf9('0x10');else _0x40e254='busy';return _0x40e254;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x14b15f,_0x27af37){var _0x1ed2b8=_[_0xecf9('0x21')](_0x14b15f)?_0x14b15f:[_0x14b15f];var _0x1004ec=_[_0xecf9('0x22')](_0x27af37)+'Queue';var _0x2f081d=_[_0xecf9('0x23')](_0x1ed2b8,function(_0x19baae){return db[_0x1004ec]['findOne']({'where':{'id':_0x19baae}})[_0xecf9('0x19')](function(_0xa8d1e4){if(!_0xa8d1e4)return[];return _0xa8d1e4[_0xecf9('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xecf9('0x25')](_0x2f081d)[_0xecf9('0x19')](function(_0x3f790d){var _0x9abc54=_(_0x3f790d)['flatten']()[_0xecf9('0x23')]('id')['uniq']()[_0xecf9('0x26')]();return _0x9abc54;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x42a91c,_0x1a719c,_0x5ad324){try{if(_0x1a719c[_0xecf9('0xa')]>0x0){_0x42a91c=_0x42a91c[_0xecf9('0x9')](function(_0x533d73){return _0x1a719c[_0xecf9('0x27')](_0x533d73['id']);});}var _0x20b623=_0x42a91c['filter'](function(_0x1f1434){var _0x5642b9='busy';if(isAgentIdle(_0x1f1434)){_0x5642b9=_0xecf9('0x10');}return _0x5642b9===_0x5ad324;});return _[_0xecf9('0x23')](_0x20b623,'id');}catch(_0x3ac26e){throw _0x3ac26e;}}exports[_0xecf9('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5e6c3c,_0x242580,_0x2fb530){return Promise[_0xecf9('0x29')]()[_0xecf9('0x19')](function(){if(_0x242580[_0xecf9('0xa')]>0x0){_0x5e6c3c=_0x5e6c3c[_0xecf9('0x9')](function(_0x10b310){return _0x242580[_0xecf9('0x27')](_0x10b310['id']);});}return _0x5e6c3c;})[_0xecf9('0x19')](function(){return db['User'][_0xecf9('0x2a')]({'attributes':['id',_0xecf9('0x2b'),_0xecf9('0x2c'),'chatPause',_0xecf9('0x4'),_0xecf9('0x5'),_0xecf9('0x6'),_0xecf9('0x7'),_0xecf9('0x2d'),_0xecf9('0x2e'),'pauseType'],'where':{'id':{'$in':_[_0xecf9('0x23')](_0x5e6c3c,'id')}},'raw':!![]});})[_0xecf9('0x19')](function(_0x36e4a3){return _0x36e4a3[_0xecf9('0x23')](function(_0x327e3d){var _0x123c3b=_[_0xecf9('0x2f')](_0x5e6c3c,['id',_0x327e3d['id']]);var _0x5d88a0=filterAgentAttributes(_0x123c3b);_['merge'](_0x327e3d,_0x5d88a0);_0x327e3d[_0xecf9('0x30')]=getAgentStatus(_0x327e3d);return _0x327e3d;});})[_0xecf9('0x19')](function(_0x48986e){var _0x46f7fb=sortAgentsByStatus(_0x48986e,_0x2fb530);return _[_0xecf9('0x23')](_0x46f7fb,'id');})[_0xecf9('0x1f')](function(_0x36394f){throw _0x36394f;});}exports[_0xecf9('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x30d759){var _0x3493bb={'fields':[],'order':null};var _0xb68137=_0x30d759[_0xecf9('0x32')](',');_0x3493bb[_0xecf9('0x33')]=_[_0xecf9('0x9')](_0xb68137,function(_0x175ead){if(!_0x175ead['includes'](_0xecf9('0x30'))){return!![];}_0x3493bb['order']=_[_0xecf9('0x34')](_0x175ead,'-')?_0xecf9('0x35'):_0xecf9('0x36');return![];});return _0x3493bb;}exports[_0xecf9('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0x55b1f4){if(_0x55b1f4['includes'](_0xecf9('0x2c'))&&!_0x55b1f4[_0xecf9('0x27')](_0xecf9('0x38'))){var _0x28c065=_0x55b1f4[_0xecf9('0x39')](0x0,_0x55b1f4[_0xecf9('0x3a')](_0xecf9('0x2c')));_0x55b1f4+=','+_0x28c065+_0xecf9('0x38');}return _0x55b1f4;}exports[_0xecf9('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x3cc3f7,_0x5e817a){var _0x39d77d=_0x3cc3f7['sort'](function(_0x3a94ef,_0x46ee4f){if(_0x3a94ef[_0xecf9('0x30')]===_0x46ee4f['globalStatus']){if(_0x3a94ef[_0xecf9('0x30')]===_0xecf9('0x11')){if(_0x5e817a===_0xecf9('0x35')){return(_0x3a94ef[_0xecf9('0x3c')]||'')<(_0x46ee4f[_0xecf9('0x3c')]||'')||_0x3a94ef[_0xecf9('0x2c')][_0xecf9('0x3d')]()>_0x46ee4f['fullname'][_0xecf9('0x3d')]()?0x1:-0x1;}else{return(_0x3a94ef['pauseType']||'')<(_0x46ee4f[_0xecf9('0x3c')]||'')||_0x3a94ef['fullname'][_0xecf9('0x3d')]()>_0x46ee4f[_0xecf9('0x2c')][_0xecf9('0x3d')]()?-0x1:0x1;}}else{if(_0x5e817a==='DESC'){return _0x3a94ef['fullname'][_0xecf9('0x3d')]()<_0x46ee4f['fullname'][_0xecf9('0x3d')]()?0x1:-0x1;}else{return _0x3a94ef['fullname'][_0xecf9('0x3d')]()<_0x46ee4f[_0xecf9('0x2c')][_0xecf9('0x3d')]()?-0x1:0x1;}}}else{if(_0x5e817a==='DESC'){return _0x3a94ef[_0xecf9('0x30')]<_0x46ee4f[_0xecf9('0x30')]?0x1:-0x1;}else{return _0x3a94ef[_0xecf9('0x30')]<_0x46ee4f[_0xecf9('0x30')]?-0x1:0x1;}}});return _0x39d77d;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x166f9a){var _0xec4238=[_0xecf9('0x3e'),_0xecf9('0x3f'),_0xecf9('0x40'),_0xecf9('0x41'),_0xecf9('0x3c'),_0xecf9('0x41'),_0xecf9('0x38'),_0xecf9('0x42'),_0xecf9('0x43'),_0xecf9('0x6'),_0xecf9('0x5'),'smsPause',_0xecf9('0x2e'),'faxPause','voicePause',_0xecf9('0x44'),_0xecf9('0x45'),_0xecf9('0x46'),_0xecf9('0x47'),_0xecf9('0x48'),_0xecf9('0x49'),'chatCurrentCapacity',_0xecf9('0x4a'),_0xecf9('0x4b'),_0xecf9('0x4c'),_0xecf9('0x4d'),'faxCurrentCapacity','chatStatus',_0xecf9('0x15'),_0xecf9('0x14'),_0xecf9('0x16'),_0xecf9('0x17'),_0xecf9('0x13'),_0xecf9('0xf'),_0xecf9('0x4e'),_0xecf9('0x4f'),_0xecf9('0x50'),_0xecf9('0x51'),_0xecf9('0x52'),'faxStatusTime',_0xecf9('0x53'),_0xecf9('0x54'),'destconnectedlinenum','screenrecording',_0xecf9('0x55'),_0xecf9('0x56'),'routealias'];var _0x1a4c5b=['chatPause',_0xecf9('0x6'),'mailPause','smsPause','whatsappPause',_0xecf9('0x4'),_0xecf9('0x2d'),_0xecf9('0x3f')];var _0x3c1458=_(_0x166f9a)[_0xecf9('0x57')](_0x1a4c5b)[_0xecf9('0x58')](_0xec4238)['value']();return _0x3c1458;}exports[_0xecf9('0x59')]=filterAgentAttributes; \ No newline at end of file +var _0x986e=['lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','mailStatus','smsStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','filterAgentAttributes','lodash','../../mysqldb','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','faxStatus','openchannelStatus','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','error','merge','getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','startCase','map','findOne','getAgents','all','flatten','value','getAgentIdsByStatus','includes','User','findAll','fullname','pauseType','globalStatus','catch','getSortedAgentsIdsByStatus','fields','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt'];(function(_0x3276cd,_0x5b4eb5){var _0x3da820=function(_0x195461){while(--_0x195461){_0x3276cd['push'](_0x3276cd['shift']());}};_0x3da820(++_0x5b4eb5);}(_0x986e,0xc8));var _0xe986=function(_0x38a13a,_0x2b0ac0){_0x38a13a=_0x38a13a-0x0;var _0x37f0d6=_0x986e[_0x38a13a];return _0x37f0d6;};'use strict';var _=require(_0xe986('0x0'));var jayson=require('jayson/promise');var db=require(_0xe986('0x1'))['db'];var amiClient=jayson['client'][_0xe986('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0xe986('0x2')]({'port':0x232c});function isAgentPaused(_0x1fd926,_0x17037c){var _0x4b3248=[_0x1fd926[_0xe986('0x3')],_0x1fd926[_0xe986('0x4')],_0x1fd926[_0xe986('0x5')],_0x1fd926[_0xe986('0x6')],_0x1fd926[_0xe986('0x7')],_0x1fd926[_0xe986('0x8')],_0x1fd926[_0xe986('0x9')]];if(!_0x17037c)return _[_0xe986('0xa')](_0x4b3248);var _0x3df9d=_[_0xe986('0xb')](_0x4b3248);return _0x3df9d['length']>0x0&&_0x3df9d[_0xe986('0xc')]<_0x4b3248[_0xe986('0xc')]?!![]:![];}function isIdle(_0x6b38b8){return _0x6b38b8===_0xe986('0xd')||_0x6b38b8===_0xe986('0xe')||_0x6b38b8===_0xe986('0xf')||_0x6b38b8===_0xe986('0x10')||_[_0xe986('0x11')](_0x6b38b8);}function isAgentIdle(_0x370d3d){if(_0x370d3d[_0xe986('0x12')]!=='idle'&&_0x370d3d['voicePause']){_0x370d3d['voiceStatus']='pause';return![];}return _[_0xe986('0xa')]([_0x370d3d[_0xe986('0x13')],_0x370d3d[_0xe986('0x14')],_0x370d3d['mailStatus'],_0x370d3d[_0xe986('0x15')],_0x370d3d['smsStatus'],_0x370d3d[_0xe986('0x12')],_0x370d3d['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xe986('0x16')]('Agents',{})[_0xe986('0x17')](function(_0x1c34ec){if(_0x1c34ec['error']){throw new Error(_0xe986('0x18'));}var _0x25fb5d=_0x1c34ec['result'];return routingClient[_0xe986('0x16')]('Agents',{})[_0xe986('0x17')](function(_0x5e89d3){if(_0x5e89d3[_0xe986('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x1a8100=_0x5e89d3['result'];return _[_0xe986('0x1a')]({},_0x25fb5d,_0x1a8100);});})['catch'](function(_0x7aa7a5){throw _0x7aa7a5;});}exports[_0xe986('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x3b0985){var _0x18be9e=_0xe986('0xe');if(isAgentPaused(_0x3b0985))_0x18be9e=_0xe986('0x1c');else if(isAgentPaused(_0x3b0985,!![]))_0x18be9e=_0xe986('0x1d');else if(isAgentIdle(_0x3b0985))_0x18be9e=_0xe986('0xd');else _0x18be9e=_0xe986('0x1e');return _0x18be9e;}exports[_0xe986('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x5dbb78,_0x17ce11){var _0x4b7695=_[_0xe986('0x20')](_0x5dbb78)?_0x5dbb78:[_0x5dbb78];var _0x3d94ba=_[_0xe986('0x21')](_0x17ce11)+'Queue';var _0x1d44f8=_[_0xe986('0x22')](_0x4b7695,function(_0x214c3b){return db[_0x3d94ba][_0xe986('0x23')]({'where':{'id':_0x214c3b}})[_0xe986('0x17')](function(_0x5710bc){if(!_0x5710bc)return[];return _0x5710bc[_0xe986('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xe986('0x25')](_0x1d44f8)[_0xe986('0x17')](function(_0x8aae9e){var _0x3821db=_(_0x8aae9e)[_0xe986('0x26')]()[_0xe986('0x22')]('id')['uniq']()[_0xe986('0x27')]();return _0x3821db;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x315c89,_0x3d07f5,_0x54382a){try{if(_0x3d07f5[_0xe986('0xc')]>0x0){_0x315c89=_0x315c89['filter'](function(_0x1d74ac){return _0x3d07f5['includes'](_0x1d74ac['id']);});}var _0x44cd19=_0x315c89[_0xe986('0xb')](function(_0x30f6bc){var _0x13d2ac=_0xe986('0x1e');if(isAgentIdle(_0x30f6bc)){_0x13d2ac=_0xe986('0xd');}return _0x13d2ac===_0x54382a;});return _[_0xe986('0x22')](_0x44cd19,'id');}catch(_0x1ca9b5){throw _0x1ca9b5;}}exports[_0xe986('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x3f15ff,_0x9a5f49,_0x119b77){return Promise['resolve']()[_0xe986('0x17')](function(){if(_0x9a5f49['length']>0x0){_0x3f15ff=_0x3f15ff[_0xe986('0xb')](function(_0x74cdc1){return _0x9a5f49[_0xe986('0x29')](_0x74cdc1['id']);});}return _0x3f15ff;})['then'](function(){return db[_0xe986('0x2a')][_0xe986('0x2b')]({'attributes':['id','name',_0xe986('0x2c'),_0xe986('0x3'),_0xe986('0x4'),_0xe986('0x5'),'openchannelPause',_0xe986('0x7'),_0xe986('0x8'),_0xe986('0x9'),_0xe986('0x2d')],'where':{'id':{'$in':_[_0xe986('0x22')](_0x3f15ff,'id')}},'raw':!![]});})[_0xe986('0x17')](function(_0x214307){return _0x214307['map'](function(_0x1483fc){var _0x563c32=_['find'](_0x3f15ff,['id',_0x1483fc['id']]);var _0x2b644f=filterAgentAttributes(_0x563c32);_[_0xe986('0x1a')](_0x1483fc,_0x2b644f);_0x1483fc[_0xe986('0x2e')]=getAgentStatus(_0x1483fc);return _0x1483fc;});})[_0xe986('0x17')](function(_0x37d4e9){var _0x21c4ce=sortAgentsByStatus(_0x37d4e9,_0x119b77);return _['map'](_0x21c4ce,'id');})[_0xe986('0x2f')](function(_0x4e6516){throw _0x4e6516;});}exports[_0xe986('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x20aa84){var _0x3ac503={'fields':[],'order':null};var _0x5d2abe=_0x20aa84['split'](',');_0x3ac503[_0xe986('0x31')]=_['filter'](_0x5d2abe,function(_0x130a30){if(!_0x130a30['includes'](_0xe986('0x2e'))){return!![];}_0x3ac503['order']=_['startsWith'](_0x130a30,'-')?_0xe986('0x32'):_0xe986('0x33');return![];});return _0x3ac503;}exports[_0xe986('0x34')]=getUpdatedSortOptions;function validateSortParameter(_0xd29676){if(_0xd29676[_0xe986('0x29')]('fullname')&&!_0xd29676[_0xe986('0x29')](_0xe986('0x35'))){var _0x1c4b88=_0xd29676[_0xe986('0x36')](0x0,_0xd29676[_0xe986('0x37')]('fullname'));_0xd29676+=','+_0x1c4b88+_0xe986('0x35');}return _0xd29676;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x4db76f,_0x29c533){var _0x2ebd3d=_0x4db76f['sort'](function(_0x405d61,_0x211243){if(_0x405d61[_0xe986('0x2e')]===_0x211243['globalStatus']){if(_0x405d61[_0xe986('0x2e')]===_0xe986('0x1c')){if(_0x29c533===_0xe986('0x32')){return(_0x405d61[_0xe986('0x2d')]||'')<(_0x211243['pauseType']||'')||_0x405d61[_0xe986('0x2c')][_0xe986('0x38')]()>_0x211243['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x405d61[_0xe986('0x2d')]||'')<(_0x211243[_0xe986('0x2d')]||'')||_0x405d61[_0xe986('0x2c')][_0xe986('0x38')]()>_0x211243[_0xe986('0x2c')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x29c533===_0xe986('0x32')){return _0x405d61[_0xe986('0x2c')][_0xe986('0x38')]()<_0x211243[_0xe986('0x2c')][_0xe986('0x38')]()?0x1:-0x1;}else{return _0x405d61[_0xe986('0x2c')][_0xe986('0x38')]()<_0x211243[_0xe986('0x2c')][_0xe986('0x38')]()?-0x1:0x1;}}}else{if(_0x29c533===_0xe986('0x32')){return _0x405d61[_0xe986('0x2e')]<_0x211243[_0xe986('0x2e')]?0x1:-0x1;}else{return _0x405d61[_0xe986('0x2e')]<_0x211243[_0xe986('0x2e')]?-0x1:0x1;}}});return _0x2ebd3d;}exports[_0xe986('0x39')]=sortAgentsByStatus;function filterAgentAttributes(_0x3d0d44){var _0x4027a9=[_0xe986('0x3a'),_0xe986('0x3b'),_0xe986('0x3c'),_0xe986('0x3d'),_0xe986('0x2d'),_0xe986('0x3d'),_0xe986('0x35'),_0xe986('0x3e'),'chatPause',_0xe986('0x6'),_0xe986('0x5'),_0xe986('0x7'),_0xe986('0x9'),_0xe986('0x4'),'voicePause',_0xe986('0x3f'),_0xe986('0x40'),_0xe986('0x41'),_0xe986('0x42'),_0xe986('0x43'),'faxCapacity','chatCurrentCapacity',_0xe986('0x44'),_0xe986('0x45'),'smsCurrentCapacity',_0xe986('0x46'),'faxCurrentCapacity',_0xe986('0x13'),_0xe986('0x15'),_0xe986('0x47'),_0xe986('0x48'),_0xe986('0x49'),_0xe986('0x14'),_0xe986('0x12'),_0xe986('0x4a'),_0xe986('0x4b'),'mailStatusTime',_0xe986('0x4c'),'whatsappStatusTime',_0xe986('0x4d'),_0xe986('0x4e'),_0xe986('0x4f'),_0xe986('0x50'),_0xe986('0x51'),_0xe986('0x52'),_0xe986('0x53'),_0xe986('0x54')];var _0x4af3c4=['chatPause',_0xe986('0x6'),_0xe986('0x5'),_0xe986('0x7'),_0xe986('0x9'),_0xe986('0x4'),_0xe986('0x8'),_0xe986('0x3b')];var _0x2227e0=_(_0x3d0d44)['omit'](_0x4af3c4)[_0xe986('0x55')](_0x4027a9)[_0xe986('0x27')]();return _0x2227e0;}exports[_0xe986('0x56')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 34e5d31..8df12c6 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5eafca,_0x5008e2){var _0x2b4fa0=function(_0x272b39){while(--_0x272b39){_0x5eafca['push'](_0x5eafca['shift']());}};_0x2b4fa0(++_0x5008e2);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 d2296bf..069b37e 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 _0xe312=['mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex','getUuid','licenseToken','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','filter','family','IPv4','concat','head'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0xe312,0x7b));var _0x2e31=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xe312[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x2e31('0x0'));var os=require('os');var crypto=require(_0x2e31('0x1'));var machine=require(_0x2e31('0x2'));var exec=require(_0x2e31('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0xeca626=[];var _0x52ffaf=os[_0x2e31('0x4')]();var _0x1afe57=_[_0x2e31('0x5')](_[_0x2e31('0x6')](_0x52ffaf));for(var _0x2d29ce=0x0;_0x2d29ce<_0x1afe57[_0x2e31('0x7')];_0x2d29ce++){var _0x2c29f6=_0x52ffaf[_0x1afe57[_0x2d29ce]][_0x2e31('0x8')](function(_0x4ebc26){return _0x4ebc26[_0x2e31('0x9')]===_0x2e31('0xa')&&_0x4ebc26['internal']===![];});_0xeca626=_0xeca626[_0x2e31('0xb')](_0x2c29f6);}return _0xeca626;}function getFirstInterface(){var _0x245e0a=_[_0x2e31('0xc')](getInterfaces());return{'macAddress':_0x245e0a&&_0x245e0a[_0x2e31('0xd')]?_0x245e0a[_0x2e31('0xd')]:_0x2e31('0xe'),'ipAddress':_0x245e0a&&_0x245e0a[_0x2e31('0xf')]?_0x245e0a[_0x2e31('0xf')]:_0x2e31('0x10')};}exports[_0x2e31('0x11')]=getFirstInterface;function getCPUhash(){var _0x1accc2=_[_0x2e31('0x5')](os[_0x2e31('0x12')]()[_0x2e31('0x13')](function(_0x50d6ce){return _0x50d6ce[_0x2e31('0x14')];}))[_0x2e31('0x15')](':');return crypto[_0x2e31('0x16')](_0x2e31('0x17'))['update'](_0x1accc2)[_0x2e31('0x18')](_0x2e31('0x19'));}exports[_0x2e31('0x1a')]=function(){var _0x4fc6af=os['platform']();var _0x45bc9d=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x45bc9d['test'](config[_0x2e31('0x1b')])){return config[_0x2e31('0x1b')];}else if(_0x4fc6af==='win32'){return exec(_0x2e31('0x1c'),{'encoding':'utf8'})[_0x2e31('0x1d')]('\x0d\x0a','');}else{var _0x5dc3a6=getFirstInterface();var _0x7198ef=getCPUhash();var _0xdb690a=_0x7198ef+'|'+os[_0x2e31('0x1e')]()+'|'+_0x5dc3a6[_0x2e31('0x1f')]+'|'+_0x5dc3a6[_0x2e31('0x20')];var _0x223f52=crypto[_0x2e31('0x16')]('md5')['update'](_0xdb690a)[_0x2e31('0x18')]('hex');return _0x223f52['substring'](0x0,0x8)+'-'+_0x223f52[_0x2e31('0x21')](0x8,0xc)+'-'+_0x223f52[_0x2e31('0x21')](0xc,0x10)+'-'+_0x223f52[_0x2e31('0x21')](0x10,0x14)+'-'+_0x223f52[_0x2e31('0x21')](0x14);}}; \ No newline at end of file +var _0xac8f=['crypto','../environment','networkInterfaces','orderBy','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','createHash','substring','lodash'];(function(_0xa90718,_0x2fd952){var _0x56ed79=function(_0x41cff1){while(--_0x41cff1){_0xa90718['push'](_0xa90718['shift']());}};_0x56ed79(++_0x2fd952);}(_0xac8f,0xcb));var _0xfac8=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0xac8f[_0x19f5fc];return _0x315fa3;};'use strict';var _=require(_0xfac8('0x0'));var os=require('os');var crypto=require(_0xfac8('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')['execSync'];var config=require(_0xfac8('0x2'));function getInterfaces(){var _0x28b846=[];var _0x76f991=os[_0xfac8('0x3')]();var _0x55f72c=_[_0xfac8('0x4')](_['keys'](_0x76f991));for(var _0x1eecd7=0x0;_0x1eecd7<_0x55f72c[_0xfac8('0x5')];_0x1eecd7++){var _0x139194=_0x76f991[_0x55f72c[_0x1eecd7]][_0xfac8('0x6')](function(_0x225380){return _0x225380[_0xfac8('0x7')]==='IPv4'&&_0x225380[_0xfac8('0x8')]===![];});_0x28b846=_0x28b846['concat'](_0x139194);}return _0x28b846;}function getFirstInterface(){var _0x1623f2=_[_0xfac8('0x9')](getInterfaces());return{'macAddress':_0x1623f2&&_0x1623f2[_0xfac8('0xa')]?_0x1623f2['mac']:_0xfac8('0xb'),'ipAddress':_0x1623f2&&_0x1623f2[_0xfac8('0xc')]?_0x1623f2[_0xfac8('0xc')]:_0xfac8('0xd')};}exports[_0xfac8('0xe')]=getFirstInterface;function getCPUhash(){var _0x429e13=_[_0xfac8('0x4')](os[_0xfac8('0xf')]()[_0xfac8('0x10')](function(_0x5181a2){return _0x5181a2[_0xfac8('0x11')];}))['join'](':');return crypto['createHash'](_0xfac8('0x12'))[_0xfac8('0x13')](_0x429e13)[_0xfac8('0x14')](_0xfac8('0x15'));}exports[_0xfac8('0x16')]=function(){var _0x5ab13b=os[_0xfac8('0x17')]();var _0x104e2b=/[0-9a-f-]{36}/;if(config[_0xfac8('0x18')]&&_0x104e2b[_0xfac8('0x19')](config[_0xfac8('0x18')])){return config['licenseToken'];}else if(_0x5ab13b===_0xfac8('0x1a')){return exec(_0xfac8('0x1b'),{'encoding':_0xfac8('0x1c')})[_0xfac8('0x1d')]('\x0d\x0a','');}else{var _0x97481b=getFirstInterface();var _0x336fd8=getCPUhash();var _0x2352d8=_0x336fd8+'|'+os[_0xfac8('0x1e')]()+'|'+_0x97481b['macAddress']+'|'+_0x97481b[_0xfac8('0x1f')];var _0x25ec25=crypto[_0xfac8('0x20')]('md5')['update'](_0x2352d8)['digest'](_0xfac8('0x15'));return _0x25ec25[_0xfac8('0x21')](0x0,0x8)+'-'+_0x25ec25['substring'](0x8,0xc)+'-'+_0x25ec25[_0xfac8('0x21')](0xc,0x10)+'-'+_0x25ec25[_0xfac8('0x21')](0x10,0x14)+'-'+_0x25ec25[_0xfac8('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0c49935..1d58510 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 _0xdd1f=['get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','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','decryptString','days','DEMO\x20START\x20AT\x20%s','update','error','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then'];(function(_0x3d5dee,_0x1ac77e){var _0x5c1856=function(_0x5194cb){while(--_0x5194cb){_0x3d5dee['push'](_0x3d5dee['shift']());}};_0x5c1856(++_0x1ac77e);}(_0xdd1f,0x95));var _0xfdd1=function(_0x5c28a4,_0x3fe8f2){_0x5c28a4=_0x5c28a4-0x0;var _0x58348f=_0xdd1f[_0x5c28a4];return _0x58348f;};'use strict';var util=require(_0xfdd1('0x0'));var moment=require(_0xfdd1('0x1'));var rp=require(_0xfdd1('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xfdd1('0x3'))(module,_0xfdd1('0x4'));var db=require(_0xfdd1('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xfdd1('0x6'));var logger=require('../logger')(_0xfdd1('0x7'));var HOST=_0xfdd1('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1b9270){return new BPromise(function(_0x3ed383,_0x54446d){var _0x5d4e94=util[_0xfdd1('0x9')](_0xfdd1('0xa'),HOST,_0x1b9270,module['exports'][_0xfdd1('0x4')]);if(oldToken){_0x5d4e94=util[_0xfdd1('0x9')](_0xfdd1('0xb'),HOST,_0x1b9270,module[_0xfdd1('0xc')]['version'],oldToken);}var _0x13e7cd={'uri':_0x5d4e94,'method':_0xfdd1('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x13e7cd)[_0xfdd1('0xe')](function(_0x1430e7){_0x3ed383(_0x1430e7);})['catch'](function(_0x4b89ec){_0x54446d(_0x4b89ec);});});}function manageLicense(_0x5735ab,_0x5addd3){var _0x1bc041=_0x5addd3[_0xfdd1('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1bc041[_0xfdd1('0x10')]!==_0x5735ab&&!_0x1bc041[_0xfdd1('0x11')]){oldToken=_0x1bc041[_0xfdd1('0x10')];}httpRequest(_0x5735ab)[_0xfdd1('0xe')](function(_0x5f07fc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5f07fc[_0xfdd1('0x12')]){isOldTokenSent=![];if(!_0x1bc041[_0xfdd1('0x7')]&&_0x1bc041['license']!=_0x5f07fc['license']||_0x1bc041[_0xfdd1('0x7')]&&_0x1bc041[_0xfdd1('0x11')]){logger[_0xfdd1('0x13')](_0xfdd1('0x14'));}if(_0x1bc041[_0xfdd1('0x7')]&&!_0x1bc041['data2']&&_0x1bc041[_0xfdd1('0x7')]!=_0x5f07fc[_0xfdd1('0x7')]){logger[_0xfdd1('0x13')](_0xfdd1('0x15'));}if(_0x1bc041[_0xfdd1('0x7')]&&!_0x1bc041['data2']&&_0x1bc041[_0xfdd1('0x7')]==_0x5f07fc[_0xfdd1('0x7')]){return _0x5addd3;}return _0x5addd3['update']({'data1':_0x5735ab,'data2':null,'license':_0x5f07fc['license']});}else{if(_0x5f07fc[_0xfdd1('0x7')]||_0x1bc041['license']){if(!_0x1bc041[_0xfdd1('0x11')]){if(_0x1bc041['data1']==_0x5735ab){GRAY_PERIOD_REASON=_0xfdd1('0x16');logger['info'](_0xfdd1('0x17'));}else{GRAY_PERIOD_REASON=_0xfdd1('0x18');logger[_0xfdd1('0x13')](_0xfdd1('0x19'),_0x1bc041[_0xfdd1('0x10')],_0x5735ab);}logger[_0xfdd1('0x13')](_0xfdd1('0x1a'),GRAY_PERIOD_REASON[_0xfdd1('0x1b')](),moment()[_0xfdd1('0x9')](_0xfdd1('0x1c')));return _0x5addd3['update']({'data2':encryptor['encryptString'](moment()[_0xfdd1('0x9')](_0xfdd1('0x1c')))});}else{if(moment()['diff'](encryptor[_0xfdd1('0x1d')](_0x1bc041['data2']),_0xfdd1('0x1e'))>DAYS){logger[_0xfdd1('0x13')](_0xfdd1('0x1f'),moment()['format'](_0xfdd1('0x1c')));isOldTokenSent=![];return _0x5addd3['update']({'data1':_0x5735ab,'data2':null,'license':null});}}}else{if(_0x1bc041[_0xfdd1('0x10')]!=_0x5735ab){logger[_0xfdd1('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1bc041[_0xfdd1('0x10')],_0x5735ab);return _0x5addd3[_0xfdd1('0x20')]({'data1':_0x5735ab,'data2':null,'license':null});}}}return _0x5addd3;})[_0xfdd1('0xe')](function(_0x616000){_0x5addd3=_0x616000;})['catch'](function(_0x4508c5){logger[_0xfdd1('0x21')](_0x4508c5[_0xfdd1('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xfdd1('0x23')](),_0x5addd3);},TIME);});}function defaultLicense(){var _0x4dd4c1=hardware[_0xfdd1('0x23')]();if(_0x4dd4c1){return db['License'][_0xfdd1('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x4dd4c1}})[_0xfdd1('0x25')](function(_0xad07,_0x485841){logger[_0xfdd1('0x13')](_0xfdd1('0x26'),_0x4dd4c1);manageLicense(_0x4dd4c1,_0xad07);})[_0xfdd1('0x27')](function(_0xc321dd){logger[_0xfdd1('0x21')](_0xc321dd['message']);});}}exports[_0xfdd1('0x28')]=defaultLicense; \ No newline at end of file +var _0xf0db=['https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','update','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf0db,0x109));var _0xbf0d=function(_0x1e2de4,_0x22d700){_0x1e2de4=_0x1e2de4-0x0;var _0x4a5929=_0xf0db[_0x1e2de4];return _0x4a5929;};'use strict';var util=require(_0xbf0d('0x0'));var moment=require(_0xbf0d('0x1'));var rp=require(_0xbf0d('0x2'));var BPromise=require(_0xbf0d('0x3'));var pkginfo=require(_0xbf0d('0x4'))(module,_0xbf0d('0x5'));var db=require(_0xbf0d('0x6'))['db'];var encryptor=require(_0xbf0d('0x7'));var hardware=require(_0xbf0d('0x8'));var logger=require(_0xbf0d('0x9'))(_0xbf0d('0xa'));var HOST=_0xbf0d('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x35a6fd){return new BPromise(function(_0x460385,_0x3025c0){var _0x39a527=util[_0xbf0d('0xc')](_0xbf0d('0xd'),HOST,_0x35a6fd,module['exports']['version']);if(oldToken){_0x39a527=util['format'](_0xbf0d('0xe'),HOST,_0x35a6fd,module[_0xbf0d('0xf')][_0xbf0d('0x5')],oldToken);}var _0x1d75ab={'uri':_0x39a527,'method':_0xbf0d('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x1d75ab)[_0xbf0d('0x11')](function(_0x5e982d){_0x460385(_0x5e982d);})['catch'](function(_0xa8a8ed){_0x3025c0(_0xa8a8ed);});});}function manageLicense(_0x5acf56,_0x4a531d){var _0x3a97f0=_0x4a531d[_0xbf0d('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x3a97f0[_0xbf0d('0x13')]!==_0x5acf56&&!_0x3a97f0[_0xbf0d('0x14')]){oldToken=_0x3a97f0['data1'];}httpRequest(_0x5acf56)[_0xbf0d('0x11')](function(_0x261fc4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x261fc4[_0xbf0d('0x15')]){isOldTokenSent=![];if(!_0x3a97f0[_0xbf0d('0xa')]&&_0x3a97f0['license']!=_0x261fc4[_0xbf0d('0xa')]||_0x3a97f0[_0xbf0d('0xa')]&&_0x3a97f0[_0xbf0d('0x14')]){logger[_0xbf0d('0x16')](_0xbf0d('0x17'));}if(_0x3a97f0['license']&&!_0x3a97f0[_0xbf0d('0x14')]&&_0x3a97f0[_0xbf0d('0xa')]!=_0x261fc4[_0xbf0d('0xa')]){logger[_0xbf0d('0x16')](_0xbf0d('0x18'));}if(_0x3a97f0[_0xbf0d('0xa')]&&!_0x3a97f0[_0xbf0d('0x14')]&&_0x3a97f0[_0xbf0d('0xa')]==_0x261fc4[_0xbf0d('0xa')]){return _0x4a531d;}return _0x4a531d['update']({'data1':_0x5acf56,'data2':null,'license':_0x261fc4[_0xbf0d('0xa')]});}else{if(_0x261fc4['license']||_0x3a97f0[_0xbf0d('0xa')]){if(!_0x3a97f0[_0xbf0d('0x14')]){if(_0x3a97f0[_0xbf0d('0x13')]==_0x5acf56){GRAY_PERIOD_REASON=_0xbf0d('0x19');logger['info'](_0xbf0d('0x1a'));}else{GRAY_PERIOD_REASON=_0xbf0d('0x1b');logger[_0xbf0d('0x16')](_0xbf0d('0x1c'),_0x3a97f0['data1'],_0x5acf56);}logger[_0xbf0d('0x16')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xbf0d('0x1d')](),moment()[_0xbf0d('0xc')](_0xbf0d('0x1e')));return _0x4a531d['update']({'data2':encryptor['encryptString'](moment()['format'](_0xbf0d('0x1e')))});}else{if(moment()[_0xbf0d('0x1f')](encryptor[_0xbf0d('0x20')](_0x3a97f0[_0xbf0d('0x14')]),_0xbf0d('0x21'))>DAYS){logger['info'](_0xbf0d('0x22'),moment()[_0xbf0d('0xc')](_0xbf0d('0x1e')));isOldTokenSent=![];return _0x4a531d[_0xbf0d('0x23')]({'data1':_0x5acf56,'data2':null,'license':null});}}}else{if(_0x3a97f0[_0xbf0d('0x13')]!=_0x5acf56){logger[_0xbf0d('0x16')](_0xbf0d('0x1c'),_0x3a97f0[_0xbf0d('0x13')],_0x5acf56);return _0x4a531d[_0xbf0d('0x23')]({'data1':_0x5acf56,'data2':null,'license':null});}}}return _0x4a531d;})['then'](function(_0x369b56){_0x4a531d=_0x369b56;})[_0xbf0d('0x24')](function(_0x3d2ef6){logger[_0xbf0d('0x25')](_0x3d2ef6[_0xbf0d('0x26')]);})[_0xbf0d('0x27')](function(){setTimeout(function(){manageLicense(hardware[_0xbf0d('0x28')](),_0x4a531d);},TIME);});}function defaultLicense(){var _0x2d527c=hardware['getUuid']();if(_0x2d527c){return db[_0xbf0d('0x29')][_0xbf0d('0x2a')]({'where':{'id':0x1},'defaults':{'data1':_0x2d527c}})[_0xbf0d('0x2b')](function(_0x344338,_0x1539b7){logger['info'](_0xbf0d('0x2c'),_0x2d527c);manageLicense(_0x2d527c,_0x344338);})[_0xbf0d('0x24')](function(_0x1784dd){logger[_0xbf0d('0x25')](_0x1784dd[_0xbf0d('0x26')]);});}}exports[_0xbf0d('0x2d')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 5df9f9d..ab5a4e8 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 _0xf478=['changed','message','User','findAll','role','COUNT','col','count','admin','user','telephone','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','data1','License\x20key\x20value\x20not\x20found','split','decryptString','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','format','grayReason','uuid'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xf478,0x170));var _0x8f47=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xf478[_0x2a6809];return _0x11c371;};'use strict';var util=require('util');var _=require(_0x8f47('0x0'));var moment=require(_0x8f47('0x1'));var BPromise=require(_0x8f47('0x2'));var hardware=require('./hardware');var encryptor=require(_0x8f47('0x3'));var db=require(_0x8f47('0x4'))['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':_0x8f47('0x5'),'machineUuid':hardware[_0x8f47('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8f47('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8f47('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x208f54){return new BPromise(function(_0x5ebd16,_0xa3ffd9){return db[_0x8f47('0x9')][_0x8f47('0xa')](_[_0x8f47('0xb')](_0x208f54,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2a8e87){return checkLicense(_0x2a8e87,null);})[_0x8f47('0xc')](function(_0x5e0016){_0x5ebd16(_0x5e0016);return;})[_0x8f47('0xd')](function(_0x247355){_0xa3ffd9(_0x247355);});});}function checkLicense(_0x58aab4,_0x3c0f18){if(!_0x58aab4){demoLicense['uuid']=_0x58aab4[_0x8f47('0xe')];return demoLicense;}try{var _0x1f26e3=_0x3c0f18||_0x58aab4['license'];if(_['isEmpty'](_0x1f26e3)){throw new Error(_0x8f47('0xf'));}var _0x4322ec=_0x58aab4['data1'];var _0x55432c=_0x58aab4['data2'];var _0x33bb62=_0x4322ec[_0x8f47('0x10')]('-')[0x4];var _0x40e7d0=_0x4322ec[_0x8f47('0x10')]('-')[0x0];var _0x5cc969=encryptor[_0x8f47('0x11')](_0x1f26e3,util['format'](_0x8f47('0x12'),_0x33bb62,_0x4322ec,_0x40e7d0));var _0x39797=JSON[_0x8f47('0x13')](_0x5cc969);_0x39797['demo']=![];_0x39797['uuid']=_0x4322ec;_0x39797[_0x8f47('0x14')]=hardware['getUuid']();if(_0x55432c){var _0x53e112=encryptor['decryptString'](_0x55432c);_0x39797[_0x8f47('0x15')]=_0x53e112;_0x39797[_0x8f47('0x16')]=moment(_0x53e112)[_0x8f47('0x17')](0x7,_0x8f47('0x18'))[_0x8f47('0x19')]();_0x39797[_0x8f47('0x1a')]=_0x39797[_0x8f47('0x1b')]!=_0x39797[_0x8f47('0x14')]?_0x8f47('0x1c'):'disabled';}return _0x39797;}catch(_0x130fbf){breakingLicense[_0x8f47('0x1b')]=_0x58aab4[_0x8f47('0xe')];breakingLicense[_0x8f47('0x1d')]=_0x130fbf[_0x8f47('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1aaf2f,_0x212f5f){getLicense()[_0x8f47('0xc')](function(_0x2c82a3){return db[_0x8f47('0x1e')][_0x8f47('0x1f')]({'attributes':[_0x8f47('0x20'),[db['sequelize']['fn'](_0x8f47('0x21'),db['sequelize'][_0x8f47('0x22')]('role')),_0x8f47('0x23')]],'group':'role','where':{'role':{'$or':[_0x8f47('0x24'),_0x8f47('0x25'),_0x8f47('0x26')]}},'raw':!![]})['then'](function(_0x5d6f3f){var _0x2a9a0e={'user':_0x2c82a3['users']||0x0,'telephone':_0x2c82a3[_0x8f47('0x27')]||0x0};_0x5d6f3f[_0x8f47('0x28')](function(_0x3f9a0d){var _0x2930d5=_0x3f9a0d[_0x8f47('0x20')]===_0x8f47('0x24')?_0x8f47('0x25'):_0x3f9a0d['role'];_0x2a9a0e[_0x2930d5]-=_0x3f9a0d[_0x8f47('0x23')];if(_0x2a9a0e[_0x2930d5]<0x0)_0x2a9a0e[_0x2930d5]=0x0;});_0x1aaf2f(_0x2a9a0e);return;});})[_0x8f47('0xd')](function(_0x266a93){_0x212f5f(_0x266a93);});});}function checkUserLimits(_0x3915d0){return new BPromise(function(_0x3e18ce,_0x526e8b){getLimits()['then'](function(_0x413a13){var _0x3bbe85=_[_0x8f47('0x29')](_[_0x8f47('0x2a')](_0x3915d0,'role'),[_0x8f47('0x24'),_0x8f47('0x25'),_0x8f47('0x26')]);var _0x58c0d0=(_0x3bbe85[_0x8f47('0x24')]||0x0)+(_0x3bbe85[_0x8f47('0x25')]||0x0);var _0x766e82=_0x3bbe85[_0x8f47('0x26')]||0x0;if(_0x58c0d0>_0x413a13[_0x8f47('0x25')])return _0x526e8b('License\x20limit\x20reached\x20for\x20users');if(_0x766e82>_0x413a13['telephone'])return _0x526e8b(_0x8f47('0x2b'));return _0x3e18ce();})[_0x8f47('0xd')](function(_0x32f01f){_0x526e8b(_0x32f01f);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb2be=['%s:%s:%s','parse','uuid','machineUuid','getUuid','gray','deadline','add','days','grayReason','changed','disabled','findAll','col','role','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','find','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format'];(function(_0x1d6a88,_0x6770b2){var _0x369d68=function(_0x24f1d3){while(--_0x24f1d3){_0x1d6a88['push'](_0x1d6a88['shift']());}};_0x369d68(++_0x6770b2);}(_0xb2be,0xc6));var _0xeb2b=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xb2be[_0xb24a3e];return _0x4038d7;};'use strict';var util=require(_0xeb2b('0x0'));var _=require(_0xeb2b('0x1'));var moment=require(_0xeb2b('0x2'));var BPromise=require(_0xeb2b('0x3'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0xeb2b('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeb2b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xeb2b('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeb2b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3f1371){return new BPromise(function(_0x23f9d5,_0x1dc8e4){return db['License'][_0xeb2b('0x7')](_['defaults'](_0x3f1371,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x271b23){return checkLicense(_0x271b23,null);})[_0xeb2b('0x8')](function(_0x2f8452){_0x23f9d5(_0x2f8452);return;})[_0xeb2b('0x9')](function(_0x37ec5e){_0x1dc8e4(_0x37ec5e);});});}function checkLicense(_0x2a3383,_0x3359ff){if(!_0x2a3383){demoLicense['uuid']=_0x2a3383[_0xeb2b('0xa')];return demoLicense;}try{var _0x1c8541=_0x3359ff||_0x2a3383[_0xeb2b('0xb')];if(_[_0xeb2b('0xc')](_0x1c8541)){throw new Error(_0xeb2b('0xd'));}var _0x55696b=_0x2a3383[_0xeb2b('0xa')];var _0x11ee8c=_0x2a3383['data2'];var _0x545fb5=_0x55696b[_0xeb2b('0xe')]('-')[0x4];var _0x5843d5=_0x55696b[_0xeb2b('0xe')]('-')[0x0];var _0x487b33=encryptor[_0xeb2b('0xf')](_0x1c8541,util[_0xeb2b('0x10')](_0xeb2b('0x11'),_0x545fb5,_0x55696b,_0x5843d5));var _0xc1fff7=JSON[_0xeb2b('0x12')](_0x487b33);_0xc1fff7['demo']=![];_0xc1fff7[_0xeb2b('0x13')]=_0x55696b;_0xc1fff7[_0xeb2b('0x14')]=hardware[_0xeb2b('0x15')]();if(_0x11ee8c){var _0xeb4ec5=encryptor[_0xeb2b('0xf')](_0x11ee8c);_0xc1fff7[_0xeb2b('0x16')]=_0xeb4ec5;_0xc1fff7[_0xeb2b('0x17')]=moment(_0xeb4ec5)[_0xeb2b('0x18')](0x7,_0xeb2b('0x19'))[_0xeb2b('0x10')]();_0xc1fff7[_0xeb2b('0x1a')]=_0xc1fff7[_0xeb2b('0x13')]!=_0xc1fff7[_0xeb2b('0x14')]?_0xeb2b('0x1b'):_0xeb2b('0x1c');}return _0xc1fff7;}catch(_0x10dc05){breakingLicense[_0xeb2b('0x13')]=_0x2a3383[_0xeb2b('0xa')];breakingLicense['message']=_0x10dc05['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x6d2307,_0x2c89c4){getLicense()[_0xeb2b('0x8')](function(_0x367663){return db['User'][_0xeb2b('0x1d')]({'attributes':['role',[db['sequelize']['fn']('COUNT',db['sequelize'][_0xeb2b('0x1e')](_0xeb2b('0x1f'))),'count']],'group':_0xeb2b('0x1f'),'where':{'role':{'$or':[_0xeb2b('0x20'),_0xeb2b('0x21'),_0xeb2b('0x22')]}},'raw':!![]})['then'](function(_0x33eb0e){var _0x48510c={'user':_0x367663[_0xeb2b('0x23')]||0x0,'telephone':_0x367663['telephones']||0x0};_0x33eb0e[_0xeb2b('0x24')](function(_0x2c4c66){var _0x319d60=_0x2c4c66[_0xeb2b('0x1f')]==='admin'?_0xeb2b('0x21'):_0x2c4c66[_0xeb2b('0x1f')];_0x48510c[_0x319d60]-=_0x2c4c66[_0xeb2b('0x25')];if(_0x48510c[_0x319d60]<0x0)_0x48510c[_0x319d60]=0x0;});_0x6d2307(_0x48510c);return;});})[_0xeb2b('0x9')](function(_0x3c7433){_0x2c89c4(_0x3c7433);});});}function checkUserLimits(_0x4b2f4f){return new BPromise(function(_0x126058,_0x58280e){getLimits()[_0xeb2b('0x8')](function(_0x222226){var _0x2290f8=_[_0xeb2b('0x26')](_[_0xeb2b('0x27')](_0x4b2f4f,_0xeb2b('0x1f')),[_0xeb2b('0x20'),_0xeb2b('0x21'),_0xeb2b('0x22')]);var _0x570670=(_0x2290f8[_0xeb2b('0x20')]||0x0)+(_0x2290f8[_0xeb2b('0x21')]||0x0);var _0x3af950=_0x2290f8[_0xeb2b('0x22')]||0x0;if(_0x570670>_0x222226[_0xeb2b('0x21')])return _0x58280e(_0xeb2b('0x28'));if(_0x3af950>_0x222226['telephone'])return _0x58280e(_0xeb2b('0x29'));return _0x126058();})[_0xeb2b('0x9')](function(_0x2881a5){_0x58280e(_0x2881a5);});});}module[_0xeb2b('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index ee27509..3d4c240 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 _0x63a5=['myappanuglar-secret','secret','exports','http://localhost:9000'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x63a5,0x18e));var _0x563a=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x63a5[_0x36884e];return _0x1cc367;};'use strict';module[_0x563a('0x0')]={'DOMAIN':_0x563a('0x1'),'SESSION_SECRET':_0x563a('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x563a('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x36ee=['myappanuglar-secret','secret'];(function(_0x3a0646,_0x175525){var _0x59ceee=function(_0x49962c){while(--_0x49962c){_0x3a0646['push'](_0x3a0646['shift']());}};_0x59ceee(++_0x175525);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xe36e('0x0'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe36e('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 6eb1760..cca43dc 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5304=['../utils/loggers','fileLogger'];(function(_0x56022b,_0x3f2637){var _0x51e249=function(_0x38ce5d){while(--_0x38ce5d){_0x56022b['push'](_0x56022b['shift']());}};_0x51e249(++_0x3f2637);}(_0x5304,0x78));var _0x4530=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0x5304[_0x5d61b4];return _0x183fc5;};'use strict';var fileLogger=require(_0x4530('0x0'))[_0x4530('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x4b1a=['../utils/loggers','fileLogger','exports'];(function(_0x1266f9,_0x40f076){var _0x56ced3=function(_0x11b7ba){while(--_0x11b7ba){_0x1266f9['push'](_0x1266f9['shift']());}};_0x56ced3(++_0x40f076);}(_0x4b1a,0x72));var _0xa4b1=function(_0x3cac8d,_0x6b7db7){_0x3cac8d=_0x3cac8d-0x0;var _0x35a69d=_0x4b1a[_0x3cac8d];return _0x35a69d;};'use strict';var fileLogger=require(_0xa4b1('0x0'))[_0xa4b1('0x1')];module[_0xa4b1('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 06f9e84..897fcb6 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 _0x4934=['agi','join','../../services/agi/index.js','email','../../services/routing/index.js','express','ami','../../services/ami/index.js'];(function(_0x321a4b,_0x159266){var _0x3cddca=function(_0x10d8c2){while(--_0x10d8c2){_0x321a4b['push'](_0x321a4b['shift']());}};_0x3cddca(++_0x159266);}(_0x4934,0xb5));var _0x4493=function(_0x3bdae5,_0x2fe723){_0x3bdae5=_0x3bdae5-0x0;var _0x5ceedd=_0x4934[_0x3bdae5];return _0x5ceedd;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x4493('0x0'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x4493('0x1'),'script':path['join'](__dirname,_0x4493('0x2'))},{'name':_0x4493('0x3'),'script':path[_0x4493('0x4')](__dirname,_0x4493('0x5'))},{'name':_0x4493('0x6'),'script':path[_0x4493('0x4')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path['join'](__dirname,_0x4493('0x7'))},{'name':'xdr','script':path[_0x4493('0x4')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0x754d=['routing','../../services/routing/index.js','xdr','exports','express','../../services/express/index.js','ami','agi','../../services/agi/index.js','join','../../services/email/index.js'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x754d,0x72));var _0xd754=function(_0x1b48ce,_0x7f336f){_0x1b48ce=_0x1b48ce-0x0;var _0x3b7f3d=_0x754d[_0x1b48ce];return _0x3b7f3d;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xd754('0x0'),'script':path['join'](__dirname,_0xd754('0x1'))},{'name':_0xd754('0x2'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0xd754('0x3'),'script':path['join'](__dirname,_0xd754('0x4'))},{'name':'email','script':path[_0xd754('0x5')](__dirname,_0xd754('0x6'))},{'name':_0xd754('0x7'),'script':path[_0xd754('0x5')](__dirname,_0xd754('0x8'))},{'name':_0xd754('0x9'),'script':path[_0xd754('0x5')](__dirname,'../../services/xdr/index.js')}]};module[_0xd754('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8d0a5e2..9e05238 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 _0xb29a=['describe','delete','dump','pm2','connect','connected','start','then','disconnect','stop','restart','list'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0xb29a,0x18f));var _0xab29=function(_0x2ad5bd,_0x3dbf7b){_0x2ad5bd=_0x2ad5bd-0x0;var _0x321eb6=_0xb29a[_0x2ad5bd];return _0x321eb6;};'use strict';var pm2=require(_0xab29('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x36464c,_0x22e6ef){return pm2[_0xab29('0x1')](function(_0x235333){if(_0x235333){return _0x22e6ef(_0x235333);}return _0x36464c(_0xab29('0x2'));});});};exports[_0xab29('0x3')]=function(_0x389682){return connect()[_0xab29('0x4')](function(){return new BPromise(function(_0x5b9f9f,_0x2f2da2){return pm2[_0xab29('0x3')](_0x389682,function(_0x2d4c38,_0x3a17be){if(_0x2d4c38){return _0x2f2da2(_0x2d4c38);}pm2[_0xab29('0x5')]();return _0x5b9f9f(_0x3a17be);});});});};exports['stop']=function(_0x146124){return connect()[_0xab29('0x4')](function(){return new BPromise(function(_0x1fabaa,_0x58cf78){return pm2[_0xab29('0x6')](_0x146124,function(_0x2b7b7d,_0x521f95){if(_0x2b7b7d){return _0x58cf78(_0x2b7b7d);}pm2[_0xab29('0x5')]();return _0x1fabaa(_0x521f95);});});});};exports[_0xab29('0x7')]=function(_0x51727e){return connect()[_0xab29('0x4')](function(){return new BPromise(function(_0x242a42,_0xfbb4e6){return pm2['restart'](_0x51727e,function(_0x22192a,_0x4a7ca5){if(_0x22192a){return _0xfbb4e6(_0x22192a);}pm2[_0xab29('0x5')]();return _0x242a42(_0x4a7ca5);});});});};exports['list']=function(){return connect()[_0xab29('0x4')](function(){return new BPromise(function(_0x48de74,_0x2cfde2){return pm2[_0xab29('0x8')](function(_0x3af178,_0x3da737){if(_0x3af178){return _0x2cfde2(_0x3af178);}pm2[_0xab29('0x5')]();return _0x48de74(_0x3da737);});});});};exports['describe']=function(_0x3f60a7){return connect()['then'](function(){return new BPromise(function(_0x24ac55,_0x178fe0){return pm2[_0xab29('0x9')](_0x3f60a7,function(_0x52387,_0x51283e){if(_0x52387){return _0x178fe0(_0x52387);}pm2[_0xab29('0x5')]();return _0x24ac55(_0x51283e);});});});};exports['delete']=function(_0x187cf5){return connect()['then'](function(){return new BPromise(function(_0x36bed4,_0xf5b728){return pm2[_0xab29('0xa')](_0x187cf5,function(_0x2a138d,_0x408e82){if(_0x2a138d){return _0xf5b728(_0x2a138d);}pm2['disconnect']();return _0x36bed4(_0x408e82);});});});};exports[_0xab29('0xb')]=function(){return connect()[_0xab29('0x4')](function(){return new BPromise(function(_0x35f5a1,_0x219ede){return pm2[_0xab29('0xb')](function(_0x314b56){if(_0x314b56){return _0x219ede(_0x314b56);}return _0x35f5a1('saved');});});});}; \ No newline at end of file +var _0xe53d=['start','then','disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','./config','connect'];(function(_0x45c6b8,_0x126026){var _0x4ae199=function(_0x4b295d){while(--_0x4b295d){_0x45c6b8['push'](_0x45c6b8['shift']());}};_0x4ae199(++_0x126026);}(_0xe53d,0x1b7));var _0xde53=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe53d[_0x122ef9];return _0x42fba0;};'use strict';var pm2=require('pm2');var BPromise=require(_0xde53('0x0'));var config=require(_0xde53('0x1'));function connect(){return new BPromise(function(_0x51ca84,_0x1d5222){return pm2[_0xde53('0x2')](function(_0x55e9f6){if(_0x55e9f6){return _0x1d5222(_0x55e9f6);}return _0x51ca84('connected');});});};exports[_0xde53('0x3')]=function(_0x2474e1){return connect()[_0xde53('0x4')](function(){return new BPromise(function(_0x10d6eb,_0xcc4106){return pm2['start'](_0x2474e1,function(_0x2d4dce,_0x34df12){if(_0x2d4dce){return _0xcc4106(_0x2d4dce);}pm2[_0xde53('0x5')]();return _0x10d6eb(_0x34df12);});});});};exports['stop']=function(_0x403aed){return connect()[_0xde53('0x4')](function(){return new BPromise(function(_0x28652e,_0x3b7d03){return pm2[_0xde53('0x6')](_0x403aed,function(_0x495b32,_0x4da8da){if(_0x495b32){return _0x3b7d03(_0x495b32);}pm2[_0xde53('0x5')]();return _0x28652e(_0x4da8da);});});});};exports[_0xde53('0x7')]=function(_0x365f71){return connect()['then'](function(){return new BPromise(function(_0x188ec4,_0x162f73){return pm2[_0xde53('0x7')](_0x365f71,function(_0x84ef57,_0x49f109){if(_0x84ef57){return _0x162f73(_0x84ef57);}pm2[_0xde53('0x5')]();return _0x188ec4(_0x49f109);});});});};exports[_0xde53('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1f2fbd,_0x5d3185){return pm2['list'](function(_0x1911c0,_0x4c1eb3){if(_0x1911c0){return _0x5d3185(_0x1911c0);}pm2[_0xde53('0x5')]();return _0x1f2fbd(_0x4c1eb3);});});});};exports[_0xde53('0x9')]=function(_0x57d1b3){return connect()['then'](function(){return new BPromise(function(_0x4e69c8,_0x45d9f8){return pm2[_0xde53('0x9')](_0x57d1b3,function(_0x5d7512,_0x2cbf19){if(_0x5d7512){return _0x45d9f8(_0x5d7512);}pm2[_0xde53('0x5')]();return _0x4e69c8(_0x2cbf19);});});});};exports[_0xde53('0xa')]=function(_0x524b05){return connect()['then'](function(){return new BPromise(function(_0x486142,_0x1b011b){return pm2[_0xde53('0xa')](_0x524b05,function(_0x30a99d,_0x57da8f){if(_0x30a99d){return _0x1b011b(_0x30a99d);}pm2[_0xde53('0x5')]();return _0x486142(_0x57da8f);});});});};exports['dump']=function(){return connect()[_0xde53('0x4')](function(){return new BPromise(function(_0x4cdcab,_0x4c05b5){return pm2[_0xde53('0xb')](function(_0x322327){if(_0x322327){return _0x4c05b5(_0x322327);}return _0x4cdcab(_0xde53('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 8e6904e..af9414a 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 _0x1dd2=['YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','ioredis','../../mysqldb','../logger','redis','localhost','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1dd2,0x180));var _0x21dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x21dd('0x0'));var moment=require('moment');var Redis=require(_0x21dd('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0x21dd('0x2'))['db'];var logger=require(_0x21dd('0x3'))('schedule');config[_0x21dd('0x4')]=_['defaults'](config[_0x21dd('0x4')],{'host':_0x21dd('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21dd('0x4')]));function closeInteractions(){var _0x396f48=0x0;var _0x4f90da=[];return db['Setting'][_0x21dd('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x13716d){_0x396f48=_0x13716d[_0x21dd('0x7')];if(_0x396f48){return db[_0x21dd('0x8')][_0x21dd('0x9')]({'raw':!![],'attributes':['id',_0x21dd('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x21dd('0xb')](_0x13716d[_0x21dd('0x7')],_0x21dd('0xc'))}}});}else{return[];}})[_0x21dd('0xd')](function(_0x5b7250){if(_0x5b7250&&_0x5b7250[_0x21dd('0xe')]){_0x4f90da=_['map'](_0x5b7250||[],'id');logger[_0x21dd('0xf')](_0x21dd('0x10'),_0x4f90da[_0x21dd('0x11')]());return db['ChatInteraction']['update']({'closeReason':_0x21dd('0x12'),'disposition':_0x21dd('0x13'),'closed':!![],'closedAt':moment()[_0x21dd('0x14')](_0x21dd('0x15'))},{'where':{'id':_0x4f90da}});}})[_0x21dd('0xd')](function(){if(_0x4f90da&&_0x4f90da['length']){logger[_0x21dd('0xf')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x4f90da['join']());for(var _0x24a5f3=0x0;_0x24a5f3<_0x4f90da[_0x21dd('0xe')];_0x24a5f3++){io[_0x21dd('0x16')](_0x21dd('0x17'),{'id':_0x4f90da[_0x24a5f3],'closed':!![]});}}})[_0x21dd('0x18')](function(_0x817b99){logger['error'](_0x21dd('0x19'),_0x817b99?util['inspect'](_0x817b99,{'showHidden':![],'depth':null}):'');});}exports[_0x21dd('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdf19=['../../config/environment','../../mysqldb','../logger','redis','defaults','Setting','find','chatTimeout','then','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','inspect','start','lodash','moment','ioredis','util'];(function(_0x2db370,_0x569287){var _0x4de82e=function(_0x25a864){while(--_0x25a864){_0x2db370['push'](_0x2db370['shift']());}};_0x4de82e(++_0x569287);}(_0xdf19,0x1af));var _0x9df1=function(_0x438687,_0x16e2fe){_0x438687=_0x438687-0x0;var _0x2e3313=_0xdf19[_0x438687];return _0x2e3313;};'use strict';var _=require(_0x9df1('0x0'));var moment=require(_0x9df1('0x1'));var Redis=require(_0x9df1('0x2'));var util=require(_0x9df1('0x3'));var config=require(_0x9df1('0x4'));var db=require(_0x9df1('0x5'))['db'];var logger=require(_0x9df1('0x6'))('schedule');config[_0x9df1('0x7')]=_[_0x9df1('0x8')](config[_0x9df1('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x43d4dd=0x0;var _0x3f48b2=[];return db[_0x9df1('0x9')][_0x9df1('0xa')]({'raw':!![],'attributes':['id',_0x9df1('0xb')],'where':{'id':0x1}})[_0x9df1('0xc')](function(_0x5608f8){_0x43d4dd=_0x5608f8[_0x9df1('0xb')];if(_0x43d4dd){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x9df1('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9df1('0xe')](_0x5608f8[_0x9df1('0xb')],_0x9df1('0xf'))}}});}else{return[];}})[_0x9df1('0xc')](function(_0x37da4d){if(_0x37da4d&&_0x37da4d[_0x9df1('0x10')]){_0x3f48b2=_[_0x9df1('0x11')](_0x37da4d||[],'id');logger[_0x9df1('0x12')](_0x9df1('0x13'),_0x3f48b2[_0x9df1('0x14')]());return db[_0x9df1('0x15')][_0x9df1('0x16')]({'closeReason':_0x9df1('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9df1('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3f48b2}});}})['then'](function(){if(_0x3f48b2&&_0x3f48b2['length']){logger[_0x9df1('0x12')](_0x9df1('0x19'),_0x3f48b2[_0x9df1('0x14')]());for(var _0x225a7c=0x0;_0x225a7c<_0x3f48b2['length'];_0x225a7c++){io['emit'](_0x9df1('0x1a'),{'id':_0x3f48b2[_0x225a7c],'closed':!![]});}}})['catch'](function(_0x469e15){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x469e15?util[_0x9df1('0x1b')](_0x469e15,{'showHidden':![],'depth':null}):'');});}exports[_0x9df1('0x1c')]=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 9c987ab..73b3e51 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 _0x8e2a=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x8e2a,0x15b));var _0xa8e2=function(_0x1f8b74,_0x485382){_0x1f8b74=_0x1f8b74-0x0;var _0x54f31c=_0x8e2a[_0x1f8b74];return _0x54f31c;};'use strict';function start(){var _0x318f39=require(_0xa8e2('0x0'));return _0x318f39['startAllRefreshIntervals']();}module[_0xa8e2('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xd2f8=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xd2f8,0x17c));var _0x8d2f=function(_0x2f4d41,_0x104d39){_0x2f4d41=_0x2f4d41-0x0;var _0x2197d1=_0xd2f8[_0x2f4d41];return _0x2197d1;};'use strict';function start(){var _0x14dba8=require(_0x8d2f('0x0'));return _0x14dba8['startAllRefreshIntervals']();}module[_0x8d2f('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index a8a4a50..e5236e3 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 _0x6397=['text','status','message','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','then','stringify','catch','error','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','findAll','Smtp','CloudProvider','keys','toString','keyBy','intersection','difference','exists','stop','delete\x20cron','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','deleteJob','stop\x20cron','length','run','path','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','%s.%s','extname','existsSync'];(function(_0x1c3b41,_0x50f776){var _0x41e3fe=function(_0x512069){while(--_0x512069){_0x1c3b41['push'](_0x1c3b41['shift']());}};_0x41e3fe(++_0x50f776);}(_0x6397,0xcb));var _0x7639=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x6397[_0x1b3a5c];return _0x2ae8cb;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x7639('0x0'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x7639('0x1'));var jayson=require(_0x7639('0x2'));var BPromise=require(_0x7639('0x3'));var logger=require(_0x7639('0x4'))(_0x7639('0x5'));var db=require(_0x7639('0x6'))['db'];var analyticCustomReportController=require(_0x7639('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7639('0x8')][_0x7639('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x9f4d93,_0x5162d0){return function(){logger[_0x7639('0xa')](_0x7639('0xb'),_0x9f4d93[_0x7639('0xc')]);var _0x3d7550=!![];var _0xedbcba=_0x9f4d93[_0x7639('0xd')]['getSmtpOptions']();var _0x5813c9={'account':_0xedbcba,'message':{'from':util[_0x7639('0xe')]('\x22%s\x22\x20<%s>',_0x9f4d93[_0x7639('0xd')][_0x7639('0xf')],_0x9f4d93[_0x7639('0xd')][_0x7639('0xc')]||_0x9f4d93['MailAccount']['Smtp'][_0x7639('0x10')]),'to':_0x9f4d93['email'],'cc':_0x9f4d93['cc'],'bcc':_0x9f4d93[_0x7639('0x11')],'subject':util[_0x7639('0xe')](_0x7639('0x12'),_0x5162d0[_0x7639('0xf')],_0x9f4d93[_0x7639('0x13')],_0x9f4d93['subtractUnit'])}};var _0x494687=path[_0x7639('0x14')](__dirname,'../../files/reports');var _0x25414d=_0x5162d0[_0x7639('0x15')];var _0x52f2d7=util[_0x7639('0xe')](_0x7639('0x16'),path['basename'](_0x5162d0[_0x7639('0x15')],path[_0x7639('0x17')](_0x5162d0[_0x7639('0x15')])),'zip');var _0xad3544=path[_0x7639('0x14')](_0x494687,_0x25414d);var _0x2c7407=path['join'](_0x494687,_0x52f2d7);if(fs[_0x7639('0x18')](_0xad3544)){_0x5162d0['status']='Sent';_0x5813c9['message']['attachments']=[{'filename':_0x25414d,'path':_0xad3544}];_0x5813c9['message'][_0x7639('0x19')]=util[_0x7639('0xe')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x5162d0,null,0x2));}else if(fs[_0x7639('0x18')](_0x2c7407)){_0x5162d0[_0x7639('0x1a')]='Sent';_0x5813c9[_0x7639('0x1b')][_0x7639('0x1c')]=[{'filename':_0x52f2d7,'path':_0x2c7407}];}else{_0x5813c9[_0x7639('0x1b')]['text']=_0x7639('0x1d');if(!_0x9f4d93['sendIfEmpty']){_0x3d7550=![];logger[_0x7639('0xa')](_0x7639('0x1e'));}}if(_0x3d7550){return client[_0x7639('0x1f')]('SendMail',_0x5813c9)[_0x7639('0x20')](function(_0x20f5cc){if(_0x20f5cc['error']){return logger['error']('error\x20mail',JSON[_0x7639('0x21')](_0x20f5cc));}return logger[_0x7639('0xa')]('email\x20sent');})[_0x7639('0x22')](function(_0x45cd3a){return logger[_0x7639('0x23')](_0x7639('0x24'),JSON['stringify'](_0x45cd3a));});}};}function handleError(){return function(_0x100ad5){return logger['error'](JSON['stringify'](_0x100ad5));};}function handleResult(_0x33792b){return function(_0x4e30d1){logger[_0x7639('0xa')](_0x7639('0x25'),JSON[_0x7639('0x21')](_0x4e30d1));if(_0x33792b[_0x7639('0xd')]&&_0x33792b[_0x7639('0xd')]['Smtp']&&!_[_0x7639('0x26')](_0x33792b[_0x7639('0xc')])){setTimeout(handleSendEmail(_0x33792b,_0x4e30d1),0x3c*0x3e8);}};}function handleJob(_0x393cf8){return function(){try{if(_[_0x7639('0x26')](_0x393cf8[_0x7639('0x13')])){return logger[_0x7639('0xa')](_0x7639('0x27'));}if(_[_0x7639('0x26')](_0x393cf8['subtractUnit'])){return logger['info'](_0x7639('0x28'));}var _0x5b1e39={'startDate':moment()[_0x7639('0x29')](_0x393cf8[_0x7639('0x13')],_0x393cf8['subtractUnit'])[_0x7639('0xe')](_0x7639('0x2a')),'endDate':moment()[_0x7639('0xe')](_0x7639('0x2a')),'type':_0x7639('0x2b'),'output':_0x393cf8[_0x7639('0x2c')],'name':_0x393cf8[_0x7639('0xf')]};if(!_['isNil'](_0x393cf8[_0x7639('0x2d')])){logger['info'](_0x7639('0x2e'),_0x393cf8[_0x7639('0x2d')]);return analyticDefaultReportController[_0x7639('0x2f')]({'id':_0x393cf8[_0x7639('0x2d')]},_0x5b1e39)[_0x7639('0x20')](handleResult(_0x393cf8))['catch'](handleError());}if(!_[_0x7639('0x26')](_0x393cf8['CustomReportId'])){logger[_0x7639('0xa')](_0x7639('0x30'),_0x393cf8[_0x7639('0x31')]);return analyticCustomReportController[_0x7639('0x2f')]({'id':_0x393cf8[_0x7639('0x31')]},_0x5b1e39)[_0x7639('0x20')](handleResult(_0x393cf8))[_0x7639('0x22')](handleError());}}catch(_0x221185){logger[_0x7639('0x23')](JSON[_0x7639('0x21')](_0x221185));}return logger[_0x7639('0xa')]('no\x20report\x20id');};}function getJobs(_0x4fb951){var _0x2b96f4={};if(_0x4fb951){_0x2b96f4['id']=_0x4fb951;}return db[_0x7639('0x32')][_0x7639('0x33')]({'where':_0x2b96f4,'include':[{'model':db[_0x7639('0xd')],'attributes':['id',_0x7639('0xf'),_0x7639('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x7639('0x34'),'include':[{'model':db[_0x7639('0x35')],'as':_0x7639('0x35')}]}]}]})['then'](function(_0x3f3a57){var _0x24558d=_[_0x7639('0x36')](manager['jobs']);var _0x475bf1=_['map'](_0x3f3a57,function(_0x18c764){return _0x18c764['id'][_0x7639('0x37')]();});var _0x1dd143=_[_0x7639('0x38')](_0x3f3a57,function(_0x26f368){return _0x26f368['id'][_0x7639('0x37')]();});var _0x546398=_0x4fb951?_0x475bf1:_['difference'](_0x475bf1,_0x24558d);var _0x52f78c=_[_0x7639('0x39')](_0x475bf1,_0x24558d);var _0x211425=_[_0x7639('0x3a')](_0x24558d,_0x475bf1);var _0xbb4c9f;var _0x2beb8f;for(_0xbb4c9f=0x0;_0xbb4c9f<_0x211425['length']&&!_0x4fb951;_0xbb4c9f+=0x1){_0x2beb8f=_0x211425[_0xbb4c9f][_0x7639('0x37')]();if(manager[_0x7639('0x3b')](_0x2beb8f)){manager[_0x7639('0x3c')](_0x2beb8f);manager['deleteJob'](_0x2beb8f);logger[_0x7639('0xa')](_0x7639('0x3d'),_0x2beb8f);}}logger['info']('toRun',JSON[_0x7639('0x21')](_0x546398));for(_0xbb4c9f=0x0;_0xbb4c9f<_0x546398['length'];_0xbb4c9f+=0x1){_0x2beb8f=_0x546398[_0xbb4c9f][_0x7639('0x37')]();logger[_0x7639('0xa')](_0x7639('0x3e'),_0x2beb8f);if(_0x4fb951){logger['info']('my\x20id',_0x4fb951);logger['info'](JSON[_0x7639('0x21')](_0x1dd143[_0x2beb8f]));BPromise[_0x7639('0x3f')]()[_0x7639('0x20')](handleJob(_0x1dd143[_0x2beb8f]));logger[_0x7639('0xa')](_0x7639('0x40'),_0x1dd143[_0x2beb8f]['name'],_0x1dd143[_0x2beb8f][_0x7639('0x41')]);}else if(_0x1dd143[_0x2beb8f][_0x7639('0x41')]&&_0x1dd143[_0x2beb8f][_0x7639('0x42')]&&moment()[_0x7639('0x43')](_0x1dd143[_0x2beb8f][_0x7639('0x44')],_0x1dd143[_0x2beb8f][_0x7639('0x45')])){manager['add'](_0x2beb8f,_0x1dd143[_0x2beb8f][_0x7639('0x41')],handleJob(_0x1dd143[_0x2beb8f]));manager[_0x7639('0x46')](_0x2beb8f);logger[_0x7639('0xa')](_0x7639('0x47'),_0x1dd143[_0x2beb8f]['name'],_0x1dd143[_0x2beb8f][_0x7639('0x41')]);}else if(manager['exists'](_0x2beb8f)){manager[_0x7639('0x3c')](_0x2beb8f);manager[_0x7639('0x48')](_0x2beb8f);logger['info'](_0x7639('0x49'),_0x1dd143[_0x2beb8f][_0x7639('0xf')],_0x1dd143[_0x2beb8f]['cron']);}}for(_0xbb4c9f=0x0,_0x2beb8f;_0xbb4c9f<_0x52f78c[_0x7639('0x4a')]&&!_0x4fb951;_0xbb4c9f+=0x1){_0x2beb8f=_0x52f78c[_0xbb4c9f][_0x7639('0x37')]();if(manager[_0x7639('0x3b')](_0x2beb8f)){if(_0x1dd143[_0x2beb8f][_0x7639('0x41')]&&_0x1dd143[_0x2beb8f][_0x7639('0x42')]&&moment()[_0x7639('0x43')](_0x1dd143[_0x2beb8f][_0x7639('0x44')],_0x1dd143[_0x2beb8f][_0x7639('0x45')])){manager['update'](_0x2beb8f,_0x1dd143[_0x2beb8f][_0x7639('0x41')],handleJob(_0x1dd143[_0x2beb8f]));logger['info']('update\x20cron',_0x1dd143[_0x2beb8f][_0x7639('0xf')],_0x1dd143[_0x2beb8f][_0x7639('0x41')]);}else{manager[_0x7639('0x3c')](_0x2beb8f);manager['deleteJob'](_0x2beb8f);logger[_0x7639('0xa')](_0x7639('0x49'),_0x1dd143[_0x2beb8f][_0x7639('0xf')],_0x1dd143[_0x2beb8f]['cron']);}}}})[_0x7639('0x22')](function(_0x1ba907){logger[_0x7639('0x23')](JSON[_0x7639('0x21')](_0x1ba907));});}exports[_0x7639('0x4b')]=function(_0x9ae7b4){return getJobs(_0x9ae7b4);};exports[_0x7639('0x46')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa743=['basename','extname','zip','existsSync','Sent','message','text','stringify','status','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then','error','error\x20mail','catch','data','isNil','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','start','stop\x20cron','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xa743,0xe5));var _0x3a74=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0xa743[_0x503564];return _0x4be9fd;};'use strict';var fs=require('fs');var util=require(_0x3a74('0x0'));var path=require(_0x3a74('0x1'));var _=require(_0x3a74('0x2'));var moment=require(_0x3a74('0x3'));var CronJobManager=require(_0x3a74('0x4'));var jayson=require(_0x3a74('0x5'));var BPromise=require(_0x3a74('0x6'));var logger=require(_0x3a74('0x7'))(_0x3a74('0x8'));var db=require(_0x3a74('0x9'))['db'];var analyticCustomReportController=require(_0x3a74('0xa'));var analyticDefaultReportController=require(_0x3a74('0xb'));var client=jayson['client'][_0x3a74('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x331cd1,_0x3cf0ca){return function(){logger[_0x3a74('0xd')](_0x3a74('0xe'),_0x331cd1[_0x3a74('0xf')]);var _0x21ef69=!![];var _0x1d77d4=_0x331cd1[_0x3a74('0x10')][_0x3a74('0x11')]();var _0x4e46d8={'account':_0x1d77d4,'message':{'from':util[_0x3a74('0x12')]('\x22%s\x22\x20<%s>',_0x331cd1['MailAccount'][_0x3a74('0x13')],_0x331cd1[_0x3a74('0x10')]['email']||_0x331cd1[_0x3a74('0x10')][_0x3a74('0x14')][_0x3a74('0x15')]),'to':_0x331cd1[_0x3a74('0xf')],'cc':_0x331cd1['cc'],'bcc':_0x331cd1[_0x3a74('0x16')],'subject':util[_0x3a74('0x12')](_0x3a74('0x17'),_0x3cf0ca[_0x3a74('0x13')],_0x331cd1[_0x3a74('0x18')],_0x331cd1['subtractUnit'])}};var _0x243f52=path[_0x3a74('0x19')](__dirname,_0x3a74('0x1a'));var _0xb1dc37=_0x3cf0ca[_0x3a74('0x1b')];var _0x5ee1a1=util['format'](_0x3a74('0x1c'),path[_0x3a74('0x1d')](_0x3cf0ca[_0x3a74('0x1b')],path[_0x3a74('0x1e')](_0x3cf0ca[_0x3a74('0x1b')])),_0x3a74('0x1f'));var _0x97bae7=path[_0x3a74('0x19')](_0x243f52,_0xb1dc37);var _0x43d1c7=path[_0x3a74('0x19')](_0x243f52,_0x5ee1a1);if(fs[_0x3a74('0x20')](_0x97bae7)){_0x3cf0ca['status']=_0x3a74('0x21');_0x4e46d8[_0x3a74('0x22')]['attachments']=[{'filename':_0xb1dc37,'path':_0x97bae7}];_0x4e46d8['message'][_0x3a74('0x23')]=util[_0x3a74('0x12')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x3a74('0x24')](_0x3cf0ca,null,0x2));}else if(fs['existsSync'](_0x43d1c7)){_0x3cf0ca[_0x3a74('0x25')]='Sent';_0x4e46d8['message'][_0x3a74('0x26')]=[{'filename':_0x5ee1a1,'path':_0x43d1c7}];}else{_0x4e46d8[_0x3a74('0x22')][_0x3a74('0x23')]=_0x3a74('0x27');if(!_0x331cd1[_0x3a74('0x28')]){_0x21ef69=![];logger[_0x3a74('0xd')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x21ef69){return client[_0x3a74('0x29')]('SendMail',_0x4e46d8)[_0x3a74('0x2a')](function(_0x1f43e3){if(_0x1f43e3[_0x3a74('0x2b')]){return logger['error'](_0x3a74('0x2c'),JSON[_0x3a74('0x24')](_0x1f43e3));}return logger[_0x3a74('0xd')]('email\x20sent');})[_0x3a74('0x2d')](function(_0x2477ce){return logger['error']('error\x20mail',JSON['stringify'](_0x2477ce));});}};}function handleError(){return function(_0x44e5e5){return logger[_0x3a74('0x2b')](JSON['stringify'](_0x44e5e5));};}function handleResult(_0x1c8578){return function(_0x4714e9){logger[_0x3a74('0xd')](_0x3a74('0x2e'),JSON[_0x3a74('0x24')](_0x4714e9));if(_0x1c8578[_0x3a74('0x10')]&&_0x1c8578['MailAccount'][_0x3a74('0x14')]&&!_[_0x3a74('0x2f')](_0x1c8578['email'])){setTimeout(handleSendEmail(_0x1c8578,_0x4714e9),0x3c*0x3e8);}};}function handleJob(_0x568145){return function(){try{if(_[_0x3a74('0x2f')](_0x568145[_0x3a74('0x18')])){return logger[_0x3a74('0xd')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x3a74('0x2f')](_0x568145[_0x3a74('0x30')])){return logger[_0x3a74('0xd')](_0x3a74('0x31'));}var _0x59876e={'startDate':moment()['subtract'](_0x568145[_0x3a74('0x18')],_0x568145[_0x3a74('0x30')])[_0x3a74('0x12')](_0x3a74('0x32')),'endDate':moment()[_0x3a74('0x12')](_0x3a74('0x32')),'type':_0x3a74('0x33'),'output':_0x568145[_0x3a74('0x34')],'name':_0x568145['name']};if(!_['isNil'](_0x568145[_0x3a74('0x35')])){logger[_0x3a74('0xd')](_0x3a74('0x36'),_0x568145[_0x3a74('0x35')]);return analyticDefaultReportController[_0x3a74('0x37')]({'id':_0x568145[_0x3a74('0x35')]},_0x59876e)[_0x3a74('0x2a')](handleResult(_0x568145))['catch'](handleError());}if(!_[_0x3a74('0x2f')](_0x568145[_0x3a74('0x38')])){logger[_0x3a74('0xd')](_0x3a74('0x39'),_0x568145[_0x3a74('0x38')]);return analyticCustomReportController[_0x3a74('0x37')]({'id':_0x568145[_0x3a74('0x38')]},_0x59876e)['then'](handleResult(_0x568145))[_0x3a74('0x2d')](handleError());}}catch(_0x1ed8c5){logger[_0x3a74('0x2b')](JSON['stringify'](_0x1ed8c5));}return logger[_0x3a74('0xd')]('no\x20report\x20id');};}function getJobs(_0x2d4bfe){var _0x175391={};if(_0x2d4bfe){_0x175391['id']=_0x2d4bfe;}return db[_0x3a74('0x3a')]['findAll']({'where':_0x175391,'include':[{'model':db[_0x3a74('0x10')],'attributes':['id','name',_0x3a74('0xf')],'include':[{'model':db[_0x3a74('0x3b')],'as':_0x3a74('0x14'),'include':[{'model':db['CloudProvider'],'as':_0x3a74('0x3c')}]}]}]})[_0x3a74('0x2a')](function(_0x52dee5){var _0x5d1b64=_[_0x3a74('0x3d')](manager[_0x3a74('0x3e')]);var _0x49c58c=_[_0x3a74('0x3f')](_0x52dee5,function(_0x26e8cd){return _0x26e8cd['id'][_0x3a74('0x40')]();});var _0x21f1a2=_[_0x3a74('0x41')](_0x52dee5,function(_0xc2fc96){return _0xc2fc96['id'][_0x3a74('0x40')]();});var _0x5cbf03=_0x2d4bfe?_0x49c58c:_[_0x3a74('0x42')](_0x49c58c,_0x5d1b64);var _0x5efb06=_[_0x3a74('0x43')](_0x49c58c,_0x5d1b64);var _0x3b99b1=_['difference'](_0x5d1b64,_0x49c58c);var _0x7a0a85;var _0x2c311c;for(_0x7a0a85=0x0;_0x7a0a85<_0x3b99b1['length']&&!_0x2d4bfe;_0x7a0a85+=0x1){_0x2c311c=_0x3b99b1[_0x7a0a85]['toString']();if(manager[_0x3a74('0x44')](_0x2c311c)){manager[_0x3a74('0x45')](_0x2c311c);manager[_0x3a74('0x46')](_0x2c311c);logger['info'](_0x3a74('0x47'),_0x2c311c);}}logger['info']('toRun',JSON[_0x3a74('0x24')](_0x5cbf03));for(_0x7a0a85=0x0;_0x7a0a85<_0x5cbf03[_0x3a74('0x48')];_0x7a0a85+=0x1){_0x2c311c=_0x5cbf03[_0x7a0a85][_0x3a74('0x40')]();logger['info'](_0x3a74('0x49'),_0x2c311c);if(_0x2d4bfe){logger[_0x3a74('0xd')](_0x3a74('0x4a'),_0x2d4bfe);logger[_0x3a74('0xd')](JSON[_0x3a74('0x24')](_0x21f1a2[_0x2c311c]));BPromise['resolve']()[_0x3a74('0x2a')](handleJob(_0x21f1a2[_0x2c311c]));logger[_0x3a74('0xd')](_0x3a74('0x4b'),_0x21f1a2[_0x2c311c]['name'],_0x21f1a2[_0x2c311c][_0x3a74('0x4c')]);}else if(_0x21f1a2[_0x2c311c][_0x3a74('0x4c')]&&_0x21f1a2[_0x2c311c][_0x3a74('0x4d')]&&moment()[_0x3a74('0x4e')](_0x21f1a2[_0x2c311c][_0x3a74('0x4f')],_0x21f1a2[_0x2c311c][_0x3a74('0x50')])){manager['add'](_0x2c311c,_0x21f1a2[_0x2c311c][_0x3a74('0x4c')],handleJob(_0x21f1a2[_0x2c311c]));manager[_0x3a74('0x51')](_0x2c311c);logger[_0x3a74('0xd')]('add\x20cron',_0x21f1a2[_0x2c311c][_0x3a74('0x13')],_0x21f1a2[_0x2c311c]['cron']);}else if(manager[_0x3a74('0x44')](_0x2c311c)){manager[_0x3a74('0x45')](_0x2c311c);manager['deleteJob'](_0x2c311c);logger[_0x3a74('0xd')](_0x3a74('0x52'),_0x21f1a2[_0x2c311c][_0x3a74('0x13')],_0x21f1a2[_0x2c311c][_0x3a74('0x4c')]);}}for(_0x7a0a85=0x0,_0x2c311c;_0x7a0a85<_0x5efb06[_0x3a74('0x48')]&&!_0x2d4bfe;_0x7a0a85+=0x1){_0x2c311c=_0x5efb06[_0x7a0a85]['toString']();if(manager[_0x3a74('0x44')](_0x2c311c)){if(_0x21f1a2[_0x2c311c][_0x3a74('0x4c')]&&_0x21f1a2[_0x2c311c][_0x3a74('0x4d')]&&moment()[_0x3a74('0x4e')](_0x21f1a2[_0x2c311c][_0x3a74('0x4f')],_0x21f1a2[_0x2c311c][_0x3a74('0x50')])){manager[_0x3a74('0x53')](_0x2c311c,_0x21f1a2[_0x2c311c]['cron'],handleJob(_0x21f1a2[_0x2c311c]));logger[_0x3a74('0xd')](_0x3a74('0x54'),_0x21f1a2[_0x2c311c]['name'],_0x21f1a2[_0x2c311c][_0x3a74('0x4c')]);}else{manager[_0x3a74('0x45')](_0x2c311c);manager[_0x3a74('0x46')](_0x2c311c);logger[_0x3a74('0xd')]('stop\x20cron',_0x21f1a2[_0x2c311c][_0x3a74('0x13')],_0x21f1a2[_0x2c311c][_0x3a74('0x4c')]);}}}})[_0x3a74('0x2d')](function(_0x13fecd){logger[_0x3a74('0x2b')](JSON['stringify'](_0x13fecd));});}exports[_0x3a74('0x55')]=function(_0x4d93a1){return getJobs(_0x4d93a1);};exports[_0x3a74('0x51')]=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 4a6038c..ba89418 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 _0x282b=['sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','ValidationError','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','COMPLETED','name','error','VoiceRecording','Setting','Settings\x20not\x20available','transcribeRegion','Transcribe\x20not\x20configured','all','catch','SequelizeValidationError','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','transcribe','Comprehend','detectSentiment','substring','format','transcribeName','data1','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId'];(function(_0x322e91,_0x2fb412){var _0x476877=function(_0x1ffac6){while(--_0x1ffac6){_0x322e91['push'](_0x322e91['shift']());}};_0x476877(++_0x2fb412);}(_0x282b,0xec));var _0xb282=function(_0x517221,_0x3027e7){_0x517221=_0x517221-0x0;var _0x43e191=_0x282b[_0x517221];return _0x43e191;};var _=require(_0xb282('0x0'));var AWS=require(_0xb282('0x1'));var rp=require(_0xb282('0x2'));var util=require(_0xb282('0x3'));var BPromise=require(_0xb282('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xb282('0x5'));function getTranscriptionJob(_0x5cadd7,_0x3fbbaf,_0x175c83,_0x283325){return new Promise(function(_0x1dd19b,_0x3cad41){var _0x33635f=new AWS['TranscribeService']({'accessKeyId':_0x3fbbaf,'secretAccessKey':_0x5cadd7,'region':_0x175c83});_0x33635f['getTranscriptionJob']({'TranscriptionJobName':_0x283325},function(_0x17fba1,_0x436eaa){if(_0x17fba1){return _0x3cad41(_0x17fba1);}else{return _0x1dd19b(_0x436eaa);}});});}function sentiment(_0x4ef1c3,_0x2928cf,_0x20f517,_0x3435fc,_0x2d86ba){return new Promise(function(_0x56caf2,_0x47e62e){var _0x36b984=new AWS[(_0xb282('0x6'))]({'accessKeyId':_0x2928cf,'secretAccessKey':_0x4ef1c3,'region':_0x20f517});_0x36b984[_0xb282('0x7')]({'Text':_0x3435fc,'LanguageCode':_0x2d86ba[_0xb282('0x8')](0x0,0x2)},function(_0x8c4621,_0x5f1c71){if(_0x8c4621){return _0x47e62e(_0x8c4621);}else{return _0x56caf2(_0x5f1c71);}});});}function checkTranscribeJob(_0x5d52d2,_0x338bdb,_0xc08746){var _0x40d7b8;return new BPromise(function(_0x9e9072,_0x122372){logger['info'](util[_0xb282('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x5d52d2['id'],_0x5d52d2[_0xb282('0xa')]));return getTranscriptionJob(_0xc08746[_0xb282('0xb')],_0xc08746['data2'],_0x338bdb['transcribeRegion'],_0x5d52d2['transcribeName'])[_0xb282('0xc')](function(_0x350676){logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0xe'),_0x5d52d2['id'],_0x5d52d2['transcribeName'],_0x350676[_0xb282('0xf')][_0xb282('0x10')]));if(!_0x5d52d2[_0xb282('0x11')]){switch(_0x350676[_0xb282('0xf')][_0xb282('0x10')]){case'COMPLETED':var _0x52e305={'transcribeStatus':_0x350676[_0xb282('0xf')][_0xb282('0x10')],'fileUri':_0x350676['TranscriptionJob'][_0xb282('0x12')][_0xb282('0x13')]};logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0x14'),_0x5d52d2['id']));return rp({'uri':_0x350676['TranscriptionJob'][_0xb282('0x12')][_0xb282('0x13')],'json':!![]})[_0xb282('0xc')](function(_0x4b79d7){logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0x15'),_0x5d52d2['id']));if(_0x4b79d7&&_0x4b79d7[_0xb282('0x16')]&&_0x4b79d7[_0xb282('0x16')]['transcripts']&&_0x4b79d7['results'][_0xb282('0x17')][_0xb282('0x18')]){_0x52e305['fileText']='';for(var _0x5e828e=0x0;_0x5e828e<_0x4b79d7[_0xb282('0x16')][_0xb282('0x17')][_0xb282('0x18')];_0x5e828e++){_0x52e305[_0xb282('0x11')]+=_0x4b79d7[_0xb282('0x16')][_0xb282('0x17')][_0x5e828e]['transcript']+'';}}return _0x5d52d2[_0xb282('0x19')](_0x52e305);})[_0xb282('0xc')](function(){logger['info'](util[_0xb282('0x9')](_0xb282('0x1a'),_0x5d52d2['id']));if(!_0x5d52d2[_0xb282('0x1b')]){throw new db[(_0xb282('0x1c'))]['ValidationError'](_0xb282('0x1d'));}if(!_0x338bdb[_0xb282('0x1e')]||!_0x338bdb[_0xb282('0x1f')]||!_0x338bdb[_0xb282('0x20')]||!_0x338bdb[_0xb282('0x21')]||!_0x338bdb[_0xb282('0x22')]){throw new db[(_0xb282('0x1c'))]['ValidationError'](_0xb282('0x23'));}if(!_0x52e305[_0xb282('0x11')]){throw new Error(_0xb282('0x24'));}if(_0x338bdb[_0xb282('0x1f')]===_0xc08746['id']){return _0xc08746;}else{return db[_0xb282('0x25')]['findOne']({'where':{'id':_settings[_0xb282('0x1f')]}});}})['then'](function(_0x4b7660){if(!_0x4b7660){throw new db[(_0xb282('0x1c'))][(_0xb282('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4b7660[_0xb282('0xb')]||!_0x4b7660['data2']){throw new db[(_0xb282('0x1c'))][(_0xb282('0x26'))](_0xb282('0x27'));}_0x40d7b8=_0x4b7660;logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0x28'),_0x5d52d2['id']));return sentiment(_0x40d7b8['data1'],_0x40d7b8[_0xb282('0x29')],_0x338bdb[_0xb282('0x20')],_0x52e305['fileText'],_0x338bdb['language']);})[_0xb282('0xc')](function(_0x271643){logger[_0xb282('0xd')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5d52d2['id']));return _0x5d52d2['update']({'sentiment':_0x271643[_0xb282('0x2a')],'sPositive':_0x271643[_0xb282('0x2b')][_0xb282('0x2c')],'sNegative':_0x271643[_0xb282('0x2b')][_0xb282('0x2d')],'sMixed':_0x271643[_0xb282('0x2b')][_0xb282('0x2e')],'sNeutral':_0x271643['SentimentScore'][_0xb282('0x2f')]});})['then'](function(){logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0x1a'),_0x5d52d2['id']));_0x9e9072();});case'FAILED':return _0x5d52d2[_0xb282('0x19')]({'transcribeStatus':'FAILED','failureReason':_0x350676[_0xb282('0xf')][_0xb282('0x30')]})[_0xb282('0xc')](function(){logger[_0xb282('0xd')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5d52d2['id']));_0x9e9072();});default:logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0x31'),_0x5d52d2['id']));break;}}else{return BPromise[_0xb282('0x32')]()['then'](function(){if(!_0x5d52d2[_0xb282('0x1b')]){throw new db['Sequelize'][(_0xb282('0x26'))](_0xb282('0x1d'));}if(!_0x338bdb['sentiment']||!_0x338bdb[_0xb282('0x1f')]||!_0x338bdb[_0xb282('0x20')]||!_0x338bdb[_0xb282('0x21')]||!_0x338bdb[_0xb282('0x22')]){throw new db[(_0xb282('0x1c'))][(_0xb282('0x26'))](_0xb282('0x23'));}if(!_0x5d52d2[_0xb282('0x11')]){throw new Error(_0xb282('0x24'));}if(_0x338bdb[_0xb282('0x1f')]===_0xc08746['id']){return _0xc08746;}else{return db[_0xb282('0x25')][_0xb282('0x33')]({'where':{'id':_settings[_0xb282('0x1f')]}});}})[_0xb282('0xc')](function(_0x309441){if(!_0x309441){throw new db[(_0xb282('0x1c'))][(_0xb282('0x26'))](_0xb282('0x34'));}if(!_0x309441['data1']||!_0x309441[_0xb282('0x29')]){throw new db['Sequelize'][(_0xb282('0x26'))](_0xb282('0x27'));}_0x40d7b8=_0x309441;logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0x28'),_0x5d52d2['id']));return sentiment(_0x40d7b8[_0xb282('0xb')],_0x40d7b8['data2'],_0x338bdb['sentimentRegion'],_0x5d52d2[_0xb282('0x11')],_0x338bdb['language']);})[_0xb282('0xc')](function(_0x273c3e){logger['info'](util[_0xb282('0x9')](_0xb282('0x35'),_0x5d52d2['id']));return _0x5d52d2[_0xb282('0x19')]({'sentiment':_0x273c3e['Sentiment'],'sPositive':_0x273c3e['SentimentScore'][_0xb282('0x2c')],'sNegative':_0x273c3e['SentimentScore'][_0xb282('0x2d')],'sMixed':_0x273c3e[_0xb282('0x2b')][_0xb282('0x2e')],'sNeutral':_0x273c3e[_0xb282('0x2b')][_0xb282('0x2f')],'transcribeStatus':_0xb282('0x36')});})['then'](function(){logger[_0xb282('0xd')](util[_0xb282('0x9')](_0xb282('0x1a'),_0x5d52d2['id']));_0x9e9072();});}})['catch'](function(_0xacf42e){if(_0xacf42e){if(!_0xacf42e['name']||_0xacf42e[_0xb282('0x37')]!=='SequelizeValidationError'){logger[_0xb282('0x38')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5d52d2['id']),util['inspect'](_0xacf42e,{'showHidden':![],'depth':null}));}}_0x9e9072();});});}function checkTranscribe(){var _0x354fc9;var _0x32765f;var _0x42d99f;return db[_0xb282('0x39')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x40080e){if(!_0x40080e||!_0x40080e[_0xb282('0x18')]){throw new db[(_0xb282('0x1c'))][(_0xb282('0x26'))]('No\x20transcribe\x20job\x20to\x20check');}_0x354fc9=_0x40080e;return db[_0xb282('0x3a')][_0xb282('0x33')]({'where':{'id':0x1}});})['then'](function(_0x33bded){if(!_0x33bded){throw new db[(_0xb282('0x1c'))][(_0xb282('0x26'))](_0xb282('0x3b'));}_0x32765f=_0x33bded;if(!_0x32765f[_0xb282('0x5')]||!_0x32765f['transcribeAccountId']||!_0x32765f[_0xb282('0x3c')]||!_0x32765f[_0xb282('0x21')]||!_0x32765f[_0xb282('0x22')]){throw new db[(_0xb282('0x1c'))][(_0xb282('0x26'))](_0xb282('0x3d'));}return db['CloudProvider'][_0xb282('0x33')]({'where':{'id':_0x32765f['transcribeAccountId']}});})[_0xb282('0xc')](function(_0x1e6ade){if(!_0x1e6ade){throw new db['Sequelize'][(_0xb282('0x26'))](_0xb282('0x34'));}if(!_0x1e6ade[_0xb282('0xb')]||!_0x1e6ade['data2']){throw new db['Sequelize'][(_0xb282('0x26'))](_0xb282('0x27'));}_0x42d99f=_0x1e6ade;var _0x7e1525=[];_0x354fc9['forEach'](function(_0x2d3839){_0x7e1525['push'](checkTranscribeJob(_0x2d3839,_0x32765f,_0x42d99f));});return BPromise[_0xb282('0x3e')](_0x7e1525);})[_0xb282('0x3f')](function(_0x55c540){if(_0x55c540){if(!_0x55c540[_0xb282('0x37')]||_0x55c540['name']!==_0xb282('0x40')){logger[_0xb282('0x38')](util[_0xb282('0x41')](_0x55c540,{'showHidden':![],'depth':null}));}}});}exports[_0xb282('0x42')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x90db=['Transcribe\x20not\x20configured','push','all','start','aws-sdk','request-promise','util','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Sequelize','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Mixed','Neutral','FAILED','FailureReason','resolve','bucket','CloudProvider','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId'];(function(_0x1f7e36,_0x4680ab){var _0x1a71f3=function(_0x69b7bc){while(--_0x69b7bc){_0x1f7e36['push'](_0x1f7e36['shift']());}};_0x1a71f3(++_0x4680ab);}(_0x90db,0x1c0));var _0xb90d=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x90db[_0xbb091];return _0x467a04;};var _=require('lodash');var AWS=require(_0xb90d('0x0'));var rp=require(_0xb90d('0x1'));var util=require(_0xb90d('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x4aaef1,_0x17e9b9,_0x29a2e7,_0x95ea24){return new Promise(function(_0x380149,_0x1e7a52){var _0x2d8398=new AWS[(_0xb90d('0x3'))]({'accessKeyId':_0x17e9b9,'secretAccessKey':_0x4aaef1,'region':_0x29a2e7});_0x2d8398[_0xb90d('0x4')]({'TranscriptionJobName':_0x95ea24},function(_0x2ef5e6,_0x108b88){if(_0x2ef5e6){return _0x1e7a52(_0x2ef5e6);}else{return _0x380149(_0x108b88);}});});}function sentiment(_0x261cf6,_0x2b9103,_0x48c4f6,_0x41e5ed,_0xab0570){return new Promise(function(_0x40a3e1,_0x5d05f8){var _0x81c427=new AWS[(_0xb90d('0x5'))]({'accessKeyId':_0x2b9103,'secretAccessKey':_0x261cf6,'region':_0x48c4f6});_0x81c427[_0xb90d('0x6')]({'Text':_0x41e5ed,'LanguageCode':_0xab0570[_0xb90d('0x7')](0x0,0x2)},function(_0x787db4,_0x54a919){if(_0x787db4){return _0x5d05f8(_0x787db4);}else{return _0x40a3e1(_0x54a919);}});});}function checkTranscribeJob(_0x39caa8,_0x5bc2b9,_0xe1b1d6){var _0x1d5eed;return new BPromise(function(_0x265763,_0x1943a9){logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0xa'),_0x39caa8['id'],_0x39caa8['transcribeName']));return getTranscriptionJob(_0xe1b1d6[_0xb90d('0xb')],_0xe1b1d6['data2'],_0x5bc2b9[_0xb90d('0xc')],_0x39caa8[_0xb90d('0xd')])['then'](function(_0x1b2324){logger['info'](util[_0xb90d('0x9')](_0xb90d('0xe'),_0x39caa8['id'],_0x39caa8[_0xb90d('0xd')],_0x1b2324[_0xb90d('0xf')][_0xb90d('0x10')]));if(!_0x39caa8['fileText']){switch(_0x1b2324[_0xb90d('0xf')]['TranscriptionJobStatus']){case _0xb90d('0x11'):var _0x57f517={'transcribeStatus':_0x1b2324['TranscriptionJob'][_0xb90d('0x10')],'fileUri':_0x1b2324[_0xb90d('0xf')][_0xb90d('0x12')][_0xb90d('0x13')]};logger[_0xb90d('0x8')](util[_0xb90d('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x39caa8['id']));return rp({'uri':_0x1b2324[_0xb90d('0xf')][_0xb90d('0x12')]['TranscriptFileUri'],'json':!![]})[_0xb90d('0x14')](function(_0x21d28e){logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0x15'),_0x39caa8['id']));if(_0x21d28e&&_0x21d28e[_0xb90d('0x16')]&&_0x21d28e[_0xb90d('0x16')][_0xb90d('0x17')]&&_0x21d28e[_0xb90d('0x16')][_0xb90d('0x17')][_0xb90d('0x18')]){_0x57f517[_0xb90d('0x19')]='';for(var _0x350218=0x0;_0x350218<_0x21d28e['results'][_0xb90d('0x17')]['length'];_0x350218++){_0x57f517[_0xb90d('0x19')]+=_0x21d28e[_0xb90d('0x16')][_0xb90d('0x17')][_0x350218][_0xb90d('0x1a')]+'';}}return _0x39caa8[_0xb90d('0x1b')](_0x57f517);})[_0xb90d('0x14')](function(){logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0x1c'),_0x39caa8['id']));if(!_0x39caa8[_0xb90d('0x1d')]){throw new db['Sequelize'][(_0xb90d('0x1e'))](_0xb90d('0x1f'));}if(!_0x5bc2b9[_0xb90d('0x20')]||!_0x5bc2b9[_0xb90d('0x21')]||!_0x5bc2b9[_0xb90d('0x22')]||!_0x5bc2b9[_0xb90d('0x23')]||!_0x5bc2b9['bucket']){throw new db['Sequelize']['ValidationError'](_0xb90d('0x24'));}if(!_0x57f517['fileText']){throw new Error(_0xb90d('0x25'));}if(_0x5bc2b9[_0xb90d('0x21')]===_0xe1b1d6['id']){return _0xe1b1d6;}else{return db['CloudProvider'][_0xb90d('0x26')]({'where':{'id':_settings[_0xb90d('0x21')]}});}})[_0xb90d('0x14')](function(_0x1a424f){if(!_0x1a424f){throw new db[(_0xb90d('0x27'))][(_0xb90d('0x1e'))](_0xb90d('0x28'));}if(!_0x1a424f[_0xb90d('0xb')]||!_0x1a424f[_0xb90d('0x29')]){throw new db[(_0xb90d('0x27'))][(_0xb90d('0x1e'))](_0xb90d('0x2a'));}_0x1d5eed=_0x1a424f;logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0x2b'),_0x39caa8['id']));return sentiment(_0x1d5eed[_0xb90d('0xb')],_0x1d5eed[_0xb90d('0x29')],_0x5bc2b9[_0xb90d('0x22')],_0x57f517['fileText'],_0x5bc2b9['language']);})[_0xb90d('0x14')](function(_0x20e1d8){logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0x2c'),_0x39caa8['id']));return _0x39caa8[_0xb90d('0x1b')]({'sentiment':_0x20e1d8[_0xb90d('0x2d')],'sPositive':_0x20e1d8['SentimentScore'][_0xb90d('0x2e')],'sNegative':_0x20e1d8['SentimentScore'][_0xb90d('0x2f')],'sMixed':_0x20e1d8[_0xb90d('0x30')][_0xb90d('0x31')],'sNeutral':_0x20e1d8[_0xb90d('0x30')][_0xb90d('0x32')]});})[_0xb90d('0x14')](function(){logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0x1c'),_0x39caa8['id']));_0x265763();});case'FAILED':return _0x39caa8[_0xb90d('0x1b')]({'transcribeStatus':_0xb90d('0x33'),'failureReason':_0x1b2324[_0xb90d('0xf')][_0xb90d('0x34')]})['then'](function(){logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0x1c'),_0x39caa8['id']));_0x265763();});default:logger[_0xb90d('0x8')](util[_0xb90d('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x39caa8['id']));break;}}else{return BPromise[_0xb90d('0x35')]()[_0xb90d('0x14')](function(){if(!_0x39caa8[_0xb90d('0x1d')]){throw new db[(_0xb90d('0x27'))]['ValidationError'](_0xb90d('0x1f'));}if(!_0x5bc2b9[_0xb90d('0x20')]||!_0x5bc2b9[_0xb90d('0x21')]||!_0x5bc2b9[_0xb90d('0x22')]||!_0x5bc2b9[_0xb90d('0x23')]||!_0x5bc2b9[_0xb90d('0x36')]){throw new db[(_0xb90d('0x27'))][(_0xb90d('0x1e'))](_0xb90d('0x24'));}if(!_0x39caa8[_0xb90d('0x19')]){throw new Error(_0xb90d('0x25'));}if(_0x5bc2b9[_0xb90d('0x21')]===_0xe1b1d6['id']){return _0xe1b1d6;}else{return db[_0xb90d('0x37')][_0xb90d('0x26')]({'where':{'id':_settings[_0xb90d('0x21')]}});}})[_0xb90d('0x14')](function(_0x16974c){if(!_0x16974c){throw new db['Sequelize'][(_0xb90d('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x16974c[_0xb90d('0xb')]||!_0x16974c['data2']){throw new db[(_0xb90d('0x27'))][(_0xb90d('0x1e'))](_0xb90d('0x2a'));}_0x1d5eed=_0x16974c;logger[_0xb90d('0x8')](util[_0xb90d('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x39caa8['id']));return sentiment(_0x1d5eed[_0xb90d('0xb')],_0x1d5eed[_0xb90d('0x29')],_0x5bc2b9['sentimentRegion'],_0x39caa8['fileText'],_0x5bc2b9['language']);})['then'](function(_0x41d001){logger[_0xb90d('0x8')](util['format'](_0xb90d('0x2c'),_0x39caa8['id']));return _0x39caa8['update']({'sentiment':_0x41d001[_0xb90d('0x2d')],'sPositive':_0x41d001['SentimentScore']['Positive'],'sNegative':_0x41d001[_0xb90d('0x30')][_0xb90d('0x2f')],'sMixed':_0x41d001[_0xb90d('0x30')][_0xb90d('0x31')],'sNeutral':_0x41d001[_0xb90d('0x30')]['Neutral'],'transcribeStatus':_0xb90d('0x11')});})[_0xb90d('0x14')](function(){logger[_0xb90d('0x8')](util[_0xb90d('0x9')](_0xb90d('0x1c'),_0x39caa8['id']));_0x265763();});}})[_0xb90d('0x38')](function(_0xcce33e){if(_0xcce33e){if(!_0xcce33e['name']||_0xcce33e[_0xb90d('0x39')]!==_0xb90d('0x3a')){logger[_0xb90d('0x3b')](util['format'](_0xb90d('0x3c'),_0x39caa8['id']),util[_0xb90d('0x3d')](_0xcce33e,{'showHidden':![],'depth':null}));}}_0x265763();});});}function checkTranscribe(){var _0x2b6220;var _0x5cc606;var _0x4a50aa;return db[_0xb90d('0x3e')][_0xb90d('0x3f')]({'where':{'transcribeStatus':_0xb90d('0x40')}})[_0xb90d('0x14')](function(_0xc89422){if(!_0xc89422||!_0xc89422[_0xb90d('0x18')]){throw new db[(_0xb90d('0x27'))][(_0xb90d('0x1e'))](_0xb90d('0x41'));}_0x2b6220=_0xc89422;return db[_0xb90d('0x42')][_0xb90d('0x26')]({'where':{'id':0x1}});})[_0xb90d('0x14')](function(_0x3f3c14){if(!_0x3f3c14){throw new db[(_0xb90d('0x27'))]['ValidationError'](_0xb90d('0x43'));}_0x5cc606=_0x3f3c14;if(!_0x5cc606[_0xb90d('0x44')]||!_0x5cc606[_0xb90d('0x45')]||!_0x5cc606['transcribeRegion']||!_0x5cc606['language']||!_0x5cc606['bucket']){throw new db[(_0xb90d('0x27'))][(_0xb90d('0x1e'))](_0xb90d('0x46'));}return db[_0xb90d('0x37')]['findOne']({'where':{'id':_0x5cc606[_0xb90d('0x45')]}});})[_0xb90d('0x14')](function(_0x3e11ed){if(!_0x3e11ed){throw new db[(_0xb90d('0x27'))][(_0xb90d('0x1e'))](_0xb90d('0x28'));}if(!_0x3e11ed[_0xb90d('0xb')]||!_0x3e11ed[_0xb90d('0x29')]){throw new db['Sequelize'][(_0xb90d('0x1e'))](_0xb90d('0x2a'));}_0x4a50aa=_0x3e11ed;var _0x5570a5=[];_0x2b6220['forEach'](function(_0x49230c){_0x5570a5[_0xb90d('0x47')](checkTranscribeJob(_0x49230c,_0x5cc606,_0x4a50aa));});return BPromise[_0xb90d('0x48')](_0x5570a5);})[_0xb90d('0x38')](function(_0x27d008){if(_0x27d008){if(!_0x27d008['name']||_0x27d008[_0xb90d('0x39')]!=='SequelizeValidationError'){logger[_0xb90d('0x3b')](util[_0xb90d('0x3d')](_0x27d008,{'showHidden':![],'depth':null}));}}});}exports[_0xb90d('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 f42e3a3..124fd63 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 _0xd73c=['findAll','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','then','length','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd73c,0x163));var _0xcd73=function(_0x29d484,_0x541dba){_0x29d484=_0x29d484-0x0;var _0xd89bb9=_0xd73c[_0x29d484];return _0xd89bb9;};'use strict';var _=require(_0xcd73('0x0'));var moment=require(_0xcd73('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require(_0xcd73('0x2'))['db'];var logger=require(_0xcd73('0x3'))(_0xcd73('0x4'));config[_0xcd73('0x5')]=_['defaults'](config['redis'],{'host':_0xcd73('0x6'),'port':0x18eb});var io=require(_0xcd73('0x7'))(new Redis(config[_0xcd73('0x5')]));function closeInteractions(){var _0x1f4106=[];return db[_0xcd73('0x8')][_0xcd73('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xcd73('0xa')](0x18,_0xcd73('0xb'))}}})['then'](function(_0x470af3){if(_0x470af3&&_0x470af3['length']){_0x1f4106=_[_0xcd73('0xc')](_0x470af3||[],'id');logger[_0xcd73('0xd')](_0xcd73('0xe'),_0x1f4106['join']());return db['WhatsappInteraction'][_0xcd73('0xf')]({'closeReason':_0xcd73('0x10'),'disposition':_0xcd73('0x11'),'closed':!![],'closedAt':moment()[_0xcd73('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1f4106}});}})[_0xcd73('0x13')](function(){if(_0x1f4106&&_0x1f4106[_0xcd73('0x14')]){logger[_0xcd73('0xd')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x1f4106['join']());for(var _0x59662d=0x0;_0x59662d<_0x1f4106[_0xcd73('0x14')];_0x59662d++){io[_0xcd73('0x15')](_0xcd73('0x16'),{'id':_0x1f4106[_0x59662d],'closed':!![]});}}})[_0xcd73('0x17')](function(_0x14e244){logger[_0xcd73('0x18')](_0xcd73('0x19'),_0x14e244?util['inspect'](_0x14e244,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd1fd=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xd1fd,0xa1));var _0xdd1f=function(_0x4d3a9b,_0x20b47d){_0x4d3a9b=_0x4d3a9b-0x0;var _0x1b5471=_0xd1fd[_0x4d3a9b];return _0x1b5471;};'use strict';var _=require(_0xdd1f('0x0'));var moment=require(_0xdd1f('0x1'));var Redis=require('ioredis');var util=require(_0xdd1f('0x2'));var config=require(_0xdd1f('0x3'));var db=require(_0xdd1f('0x4'))['db'];var logger=require('../logger')('schedule');config[_0xdd1f('0x5')]=_['defaults'](config['redis'],{'host':_0xdd1f('0x6'),'port':0x18eb});var io=require(_0xdd1f('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x4ce535=[];return db[_0xdd1f('0x8')][_0xdd1f('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xdd1f('0xa')](0x18,_0xdd1f('0xb'))}}})[_0xdd1f('0xc')](function(_0x22c111){if(_0x22c111&&_0x22c111['length']){_0x4ce535=_[_0xdd1f('0xd')](_0x22c111||[],'id');logger[_0xdd1f('0xe')](_0xdd1f('0xf'),_0x4ce535[_0xdd1f('0x10')]());return db['WhatsappInteraction'][_0xdd1f('0x11')]({'closeReason':_0xdd1f('0x12'),'disposition':_0xdd1f('0x13'),'closed':!![],'closedAt':moment()[_0xdd1f('0x14')](_0xdd1f('0x15'))},{'where':{'id':_0x4ce535}});}})[_0xdd1f('0xc')](function(){if(_0x4ce535&&_0x4ce535[_0xdd1f('0x16')]){logger[_0xdd1f('0xe')](_0xdd1f('0x17'),_0x4ce535[_0xdd1f('0x10')]());for(var _0x1384a0=0x0;_0x1384a0<_0x4ce535[_0xdd1f('0x16')];_0x1384a0++){io[_0xdd1f('0x18')](_0xdd1f('0x19'),{'id':_0x4ce535[_0x1384a0],'closed':!![]});}}})['catch'](function(_0x34c37f){logger[_0xdd1f('0x1a')](_0xdd1f('0x1b'),_0x34c37f?util[_0xdd1f('0x1c')](_0x34c37f,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 327ec91..cf1d73d 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc529=['contacts1','CmHopper','bulkCreate','log','hopper1','contacts2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','finished\x20populating'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc529,0xfe));var _0x9c52=function(_0x2d489a,_0x25ce3c){_0x2d489a=_0x2d489a-0x0;var _0x11b301=_0xc529[_0x2d489a];return _0x11b301;};'use strict';var util=require(_0x9c52('0x0'));var db=require(_0x9c52('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x9c52('0x2')+i,'lastName':_0x9c52('0x3')+i,'phone':0xf879fb460+i,'email':_0x9c52('0x4')+i+_0x9c52('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9c52('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x9c52('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9c52('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9c52('0x6')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x9c52('0x4')+i+_0x9c52('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x9c52('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9c52('0x7')](),'updatedAt':Date[_0x9c52('0x7')]()});}db[_0x9c52('0x8')][_0x9c52('0x9')]({'where':{}})['then'](function(){return db[_0x9c52('0x8')]['bulkCreate'](contacts);})[_0x9c52('0xa')](function(){console['log'](_0x9c52('0xb'),_0x9c52('0xc'));return db[_0x9c52('0xd')][_0x9c52('0x9')]({'where':{}});})[_0x9c52('0xa')](function(){return db['CmHopper'][_0x9c52('0xe')](hopper);})[_0x9c52('0xa')](function(){console[_0x9c52('0xf')](_0x9c52('0xb'),_0x9c52('0x10'));return db[_0x9c52('0x8')][_0x9c52('0xe')](contacts2);})[_0x9c52('0xa')](function(){console[_0x9c52('0xf')](_0x9c52('0xb'),_0x9c52('0x11'));return db[_0x9c52('0xd')][_0x9c52('0xe')](hopper2);})[_0x9c52('0xa')](function(){console[_0x9c52('0xf')](_0x9c52('0xb'),'hopper2');})[_0x9c52('0x12')](function(_0x296736){console[_0x9c52('0xf')](_0x296736);}); \ No newline at end of file +var _0x7a16=['contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x31130d,_0x54c773){var _0x177f9f=function(_0x830c){while(--_0x830c){_0x31130d['push'](_0x31130d['shift']());}};_0x177f9f(++_0x54c773);}(_0x7a16,0x11b));var _0x67a1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a16[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x67a1('0x0'));var db=require(_0x67a1('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x67a1('0x2')]({'id':i,'firstName':_0x67a1('0x3')+i,'lastName':_0x67a1('0x4')+i,'phone':0xf879fb460+i,'email':_0x67a1('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x67a1('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x67a1('0x6')](),'updatedAt':Date[_0x67a1('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x67a1('0x3')+i,'lastName':_0x67a1('0x4')+i,'phone':0xf879fb460+i,'email':_0x67a1('0x5')+i+_0x67a1('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x67a1('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x67a1('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x67a1('0x6')](),'updatedAt':Date['now']()});}db[_0x67a1('0x8')][_0x67a1('0x9')]({'where':{}})[_0x67a1('0xa')](function(){return db[_0x67a1('0x8')][_0x67a1('0xb')](contacts);})['then'](function(){console[_0x67a1('0xc')](_0x67a1('0xd'),_0x67a1('0xe'));return db[_0x67a1('0xf')][_0x67a1('0x9')]({'where':{}});})[_0x67a1('0xa')](function(){return db[_0x67a1('0xf')]['bulkCreate'](hopper);})['then'](function(){console[_0x67a1('0xc')]('finished\x20populating',_0x67a1('0x10'));return db[_0x67a1('0x8')][_0x67a1('0xb')](contacts2);})[_0x67a1('0xa')](function(){console['log']('finished\x20populating',_0x67a1('0x11'));return db['CmHopper'][_0x67a1('0xb')](hopper2);})[_0x67a1('0xa')](function(){console[_0x67a1('0xc')](_0x67a1('0xd'),_0x67a1('0x12'));})[_0x67a1('0x13')](function(_0x5d330e){console[_0x67a1('0xc')](_0x5d330e);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 16aba30..13fdc69 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf116=['../mysqldb','format','%s%s','%s%s@xcally.com','agent','password','friend','udp','ulaw','yes','actpass','User','bulkCreate','then','add\x20user','log','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf116,0x120));var _0x6f11=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xf116[_0x5e36d1];return _0x950b9e;};'use strict';var util=require(_0x6f11('0x0'));var db=require(_0x6f11('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x6f11('0x2')]('%s%s','agent',i),'fullname':util[_0x6f11('0x2')](_0x6f11('0x3'),'agent',i),'email':util['format'](_0x6f11('0x4'),_0x6f11('0x5'),i),'role':_0x6f11('0x5'),'password':_0x6f11('0x6'),'internal':0xfa0+i,'type':_0x6f11('0x7'),'transport':[_0x6f11('0x8'),'ws','wss'],'disallow':['all'],'allow':[_0x6f11('0x9')],'defaultuser':util[_0x6f11('0x2')](_0x6f11('0x3'),_0x6f11('0x5'),i),'encryption':'yes','avpf':'yes','force_avp':_0x6f11('0xa'),'icesupport':_0x6f11('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x6f11('0xb'),'callerid':util[_0x6f11('0x2')]('\x22%s\x22\x20<%s>',util[_0x6f11('0x2')](_0x6f11('0x3'),_0x6f11('0x5'),i),0xfa0+i)});}db[_0x6f11('0xc')][_0x6f11('0xd')](users)[_0x6f11('0xe')](function(){console['log'](_0x6f11('0xf'));})['catch'](function(_0x483978){console[_0x6f11('0x10')](_0x483978);}); \ No newline at end of file +var _0x681e=['agent','%s%s@xcally.com','password','friend','udp','all','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','util','push','format','%s%s'];(function(_0x4e44d6,_0x395d6d){var _0x1f328c=function(_0x425e5a){while(--_0x425e5a){_0x4e44d6['push'](_0x4e44d6['shift']());}};_0x1f328c(++_0x395d6d);}(_0x681e,0x68));var _0xe681=function(_0x14e677,_0x3ff38a){_0x14e677=_0x14e677-0x0;var _0x4df163=_0x681e[_0x14e677];return _0x4df163;};'use strict';var util=require(_0xe681('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe681('0x1')]({'name':util[_0xe681('0x2')](_0xe681('0x3'),_0xe681('0x4'),i),'fullname':util[_0xe681('0x2')]('%s%s',_0xe681('0x4'),i),'email':util[_0xe681('0x2')](_0xe681('0x5'),_0xe681('0x4'),i),'role':_0xe681('0x4'),'password':_0xe681('0x6'),'internal':0xfa0+i,'type':_0xe681('0x7'),'transport':[_0xe681('0x8'),'ws','wss'],'disallow':[_0xe681('0x9')],'allow':['ulaw'],'defaultuser':util[_0xe681('0x2')](_0xe681('0x3'),_0xe681('0x4'),i),'encryption':_0xe681('0xa'),'avpf':_0xe681('0xa'),'force_avp':_0xe681('0xa'),'icesupport':_0xe681('0xa'),'dtlsenable':_0xe681('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xe681('0xb'),'dtlssetup':_0xe681('0xc'),'callerid':util['format'](_0xe681('0xd'),util['format']('%s%s',_0xe681('0x4'),i),0xfa0+i)});}db[_0xe681('0xe')][_0xe681('0xf')](users)[_0xe681('0x10')](function(){console[_0xe681('0x11')]('add\x20user');})['catch'](function(_0x4fd4c7){console[_0xe681('0x11')](_0x4fd4c7);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 3ed64cf..71f2b79 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14b2=['getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','CONNECTED','lodash','util','../mysqldb','./environment','name','Agents','role','telephone','agent','type','findOne','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','then','map','resourceId','Campaign','where','ivr','format','%s:queue:%s','length','user:%s','handshake','query','User','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','OpenchannelQueue','ChatQueue','FaxQueues','SmsQueue','WhatsappQueue','Telephones','Trunk','getChatQueues'];(function(_0x1473ae,_0x3e4043){var _0xc974f7=function(_0x1cdb8b){while(--_0x1cdb8b){_0x1473ae['push'](_0x1473ae['shift']());}};_0xc974f7(++_0x3e4043);}(_0x14b2,0x1a1));var _0x214b=function(_0x44d6ea,_0x385a7e){_0x44d6ea=_0x44d6ea-0x0;var _0xf678b1=_0x14b2[_0x44d6ea];return _0xf678b1;};'use strict';var _=require(_0x214b('0x0'));var util=require(_0x214b('0x1'));var BPromise=require('bluebird');var db=require(_0x214b('0x2'))['db'];var config=require(_0x214b('0x3'));var queryQueues={'attributes':['id',_0x214b('0x4')],'include':[{'as':_0x214b('0x5'),'model':db['User'],'attributes':['id',_0x214b('0x4'),_0x214b('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x214b('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x214b('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x214b('0x4')],'where':{'role':_0x214b('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x214b('0x4'),_0x214b('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3dff9b,_0x50950f,_0x232e01){return db['UserProfileSection'][_0x214b('0xa')]({'where':{'name':_0x3dff9b,'userProfileId':_0x50950f},'raw':!![]})['then'](function(_0x5ccdfd){if(_0x5ccdfd){if(_0x5ccdfd['autoAssociation']){switch(_0x3dff9b){case _0x214b('0xb'):case _0x214b('0xc'):case'FaxQueues':case _0x214b('0xd'):case _0x214b('0xe'):case _0x214b('0xf'):case'WhatsappQueues':return db[_0x232e01][_0x214b('0x10')](queryQueues);case'Telephones':return db[_0x232e01]['findAll'](queryTelephones);case _0x214b('0x11'):return db[_0x232e01][_0x214b('0x10')](queryTrunks);case _0x214b('0x12'):return db[_0x232e01][_0x214b('0x10')](queryCampaigns);}}else{return db[_0x214b('0x13')][_0x214b('0x10')]({'attributes':['resourceId'],'where':{'sectionId':_0x5ccdfd['id']},'raw':!![]})[_0x214b('0x14')](function(_0x47f5fe){if(_0x47f5fe){var _0xd50b11={'where':{'id':_[_0x214b('0x15')](_0x47f5fe,_0x214b('0x16'))},'raw':!![]};switch(_0x232e01){case'User':_0xd50b11['where'][_0x214b('0x6')]='telephone';break;case _0x214b('0x17'):_0xd50b11[_0x214b('0x18')]['type']=_0x214b('0x19');break;}return db[_0x232e01]['findAll'](_0xd50b11);}else{return[];}});}}else{return[];}})[_0x214b('0x14')](function(_0x31da06){return _0x31da06;});}function joinOrLeaveQueues(_0x300794,_0x4b0b9c,_0x14c45c,_0x1e80bc){_0x300794[_0x4b0b9c](util[_0x214b('0x1a')](_0x214b('0x1b'),_0x14c45c,_0x1e80bc[_0x214b('0x4')]));if(_0x1e80bc['Agents']){for(var _0x54248e=0x0;_0x54248e<_0x1e80bc[_0x214b('0x5')][_0x214b('0x1c')];_0x54248e+=0x1){_0x300794[_0x4b0b9c](util[_0x214b('0x1a')](_0x214b('0x1d'),_0x1e80bc['Agents'][_0x54248e][_0x214b('0x4')]));}}}function joinOrLeave(_0x15cfd3,_0x168a18,_0x8eb464){var _0x55daef;if(_0x15cfd3[_0x214b('0x1e')][_0x214b('0x1f')]['id']){db[_0x214b('0x20')][_0x214b('0x21')]({'attributes':['id',_0x214b('0x4'),_0x214b('0x6'),_0x214b('0x22')],'where':{'id':_0x15cfd3[_0x214b('0x1e')][_0x214b('0x1f')]['id']},'include':[{'model':db[_0x214b('0x23')],'as':_0x214b('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x214b('0x25')],'as':_0x214b('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x214b('0x27')],'as':_0x214b('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x214b('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x214b('0x2a')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x411813){if(_0x411813){_0x55daef=_0x411813;_0x15cfd3[_0x168a18](util[_0x214b('0x1a')](_0x214b('0x1d'),_0x411813['name']));var _0x1b3a94=[];switch(_0x411813['role']){case'admin':_0x15cfd3[_0x168a18](_0x214b('0x2b'));_0x15cfd3[_0x168a18](_0x214b('0x2c'));if(queryQueues[_0x214b('0x2d')](_0x214b('0x2e'))){delete queryQueues[_0x214b('0x2e')];}_0x1b3a94[_0x214b('0x2f')](db[_0x214b('0x30')][_0x214b('0x10')](queryQueues));_0x1b3a94['push'](db['ChatQueue'][_0x214b('0x10')](queryQueues));_0x1b3a94[_0x214b('0x2f')](db[_0x214b('0x31')][_0x214b('0x10')](queryQueues));_0x1b3a94['push'](db['SmsQueue'][_0x214b('0x10')](queryQueues));_0x1b3a94[_0x214b('0x2f')](db['MailQueue'][_0x214b('0x10')](queryQueues));_0x1b3a94[_0x214b('0x2f')](db[_0x214b('0x32')][_0x214b('0x10')](queryQueues));_0x1b3a94[_0x214b('0x2f')](db['WhatsappQueue'][_0x214b('0x10')](queryQueues));_0x1b3a94[_0x214b('0x2f')](db['User'][_0x214b('0x10')](queryTelephones));_0x1b3a94['push'](db['Trunk'][_0x214b('0x10')](queryTrunks));_0x1b3a94['push'](db[_0x214b('0x17')]['findAll'](queryCampaigns));_0x1b3a94[_0x214b('0x2f')](db[_0x214b('0x20')][_0x214b('0x10')](queryAgents));break;case'user':_0x15cfd3[_0x168a18](_0x214b('0x2b'));_0x15cfd3[_0x168a18](_0x214b('0x2c'));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources(_0x214b('0xb'),_0x411813[_0x214b('0x22')],'VoiceQueue'));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources(_0x214b('0xc'),_0x411813[_0x214b('0x22')],_0x214b('0x33')));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources(_0x214b('0x34'),_0x411813[_0x214b('0x22')],'FaxQueue'));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources(_0x214b('0xd'),_0x411813[_0x214b('0x22')],_0x214b('0x35')));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources('MailQueues',_0x411813['userProfileId'],'MailQueue'));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources(_0x214b('0xf'),_0x411813[_0x214b('0x22')],_0x214b('0x32')));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources('WhatsappQueues',_0x411813[_0x214b('0x22')],_0x214b('0x36')));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources(_0x214b('0x37'),_0x411813[_0x214b('0x22')],_0x214b('0x20')));_0x1b3a94['push'](getAssociatedResources(_0x214b('0x11'),_0x411813[_0x214b('0x22')],_0x214b('0x38')));_0x1b3a94[_0x214b('0x2f')](getAssociatedResources(_0x214b('0x12'),_0x411813[_0x214b('0x22')],'Campaign'));_0x1b3a94['push'](db[_0x214b('0x20')][_0x214b('0x10')](queryAgents));break;case _0x214b('0x8'):_0x15cfd3[_0x168a18](_0x214b('0x2b'));_0x15cfd3[_0x168a18](_0x214b('0x2c'));_0x1b3a94[_0x214b('0x2f')](_0x411813['getVoiceQueues']({'attributes':['id',_0x214b('0x4')]}));_0x1b3a94[_0x214b('0x2f')](_0x411813[_0x214b('0x39')]({'attributes':['id',_0x214b('0x4')]}));_0x1b3a94[_0x214b('0x2f')](_0x411813[_0x214b('0x3a')]({'attributes':['id',_0x214b('0x4')]}));_0x1b3a94[_0x214b('0x2f')](_0x411813[_0x214b('0x3b')]({'attributes':['id',_0x214b('0x4')]}));_0x1b3a94[_0x214b('0x2f')](_0x411813[_0x214b('0x3c')]({'attributes':['id',_0x214b('0x4')]}));_0x1b3a94['push'](_0x411813[_0x214b('0x3d')]({'attributes':['id',_0x214b('0x4')]}));_0x1b3a94['push'](_0x411813['getWhatsappQueues']({'attributes':['id',_0x214b('0x4')]}));break;}return BPromise['all'](_0x1b3a94);}})[_0x214b('0x14')](function(_0x5c8c89){if(_0x5c8c89&&_0x5c8c89[_0x214b('0x1c')]){for(var _0x3df933=0x0;_0x3df933<_0x5c8c89[_0x214b('0x1c')];_0x3df933+=0x1){for(var _0x22e38c=0x0;_0x22e38c<_0x5c8c89[_0x3df933]['length'];_0x22e38c+=0x1){switch(_0x3df933){case 0x0:joinOrLeaveQueues(_0x15cfd3,_0x168a18,_0x214b('0x3e'),_0x5c8c89[_0x3df933][_0x22e38c]);break;case 0x1:joinOrLeaveQueues(_0x15cfd3,_0x168a18,_0x214b('0x3f'),_0x5c8c89[_0x3df933][_0x22e38c]);break;case 0x2:joinOrLeaveQueues(_0x15cfd3,_0x168a18,_0x214b('0x40'),_0x5c8c89[_0x3df933][_0x22e38c]);break;case 0x3:joinOrLeaveQueues(_0x15cfd3,_0x168a18,_0x214b('0x41'),_0x5c8c89[_0x3df933][_0x22e38c]);break;case 0x4:joinOrLeaveQueues(_0x15cfd3,_0x168a18,'mail',_0x5c8c89[_0x3df933][_0x22e38c]);break;case 0x5:joinOrLeaveQueues(_0x15cfd3,_0x168a18,_0x214b('0x42'),_0x5c8c89[_0x3df933][_0x22e38c]);break;case 0x6:joinOrLeaveQueues(_0x15cfd3,_0x168a18,_0x214b('0x43'),_0x5c8c89[_0x3df933][_0x22e38c]);break;case 0x7:if(_0x55daef['role']!==_0x214b('0x8'))_0x15cfd3[_0x168a18](util[_0x214b('0x1a')](_0x214b('0x44'),_0x5c8c89[_0x3df933][_0x22e38c]['name']));break;case 0x8:if(_0x55daef[_0x214b('0x6')]!==_0x214b('0x8'))_0x15cfd3[_0x168a18](util['format']('trunk:%s',_0x5c8c89[_0x3df933][_0x22e38c]['name']));break;case 0x9:if(_0x55daef[_0x214b('0x6')]!==_0x214b('0x8'))_0x15cfd3[_0x168a18](util[_0x214b('0x1a')](_0x214b('0x45'),_0x5c8c89[_0x3df933][_0x22e38c][_0x214b('0x9')],_0x5c8c89[_0x3df933][_0x22e38c]['name']));break;case 0xa:_0x15cfd3[_0x168a18](util[_0x214b('0x1a')](_0x214b('0x1d'),_0x5c8c89[_0x3df933][_0x22e38c][_0x214b('0x4')]));break;}}}}})[_0x214b('0x14')](function(){if(_0x168a18===_0x214b('0x46')){var _0x44f7eb=_[_0x214b('0x15')](_0x55daef[_0x214b('0x24')],'id');return _0x55daef[_0x214b('0x47')](_0x44f7eb)[_0x214b('0x14')](function(){for(var _0x53f1f0=0x0;_0x53f1f0<_0x44f7eb[_0x214b('0x1c')];_0x53f1f0+=0x1){_0x8eb464['emit'](_0x214b('0x48'),{'ChatInteractionId':Number(_0x44f7eb[_0x53f1f0]),'UserId':Number(_0x55daef['id'])});}});}})['then'](function(){if(_0x168a18===_0x214b('0x46')){var _0x20e289=_[_0x214b('0x15')](_0x55daef[_0x214b('0x49')],'id');return _0x55daef[_0x214b('0x4a')](_0x20e289)['then'](function(){for(var _0x401f99=0x0;_0x401f99<_0x20e289[_0x214b('0x1c')];_0x401f99+=0x1){_0x8eb464['emit'](_0x214b('0x4b'),{'MailInteractionId':Number(_0x20e289[_0x401f99]),'UserId':Number(_0x55daef['id'])});}});}})['then'](function(){if(_0x168a18==='leave'){var _0x188265=_[_0x214b('0x15')](_0x55daef['FaxInteractions'],'id');return _0x55daef[_0x214b('0x4c')](_0x188265)[_0x214b('0x14')](function(){for(var _0xef7db=0x0;_0xef7db<_0x188265[_0x214b('0x1c')];_0xef7db+=0x1){_0x8eb464[_0x214b('0x4d')](_0x214b('0x4e'),{'FaxInteractionId':Number(_0x188265[_0xef7db]),'UserId':Number(_0x55daef['id'])});}});}})['then'](function(){if(_0x168a18===_0x214b('0x46')){var _0x455928=_[_0x214b('0x15')](_0x55daef['SmsInteractions'],'id');return _0x55daef['removeSmsInteractions'](_0x455928)[_0x214b('0x14')](function(){for(var _0x315fce=0x0;_0x315fce<_0x455928[_0x214b('0x1c')];_0x315fce+=0x1){_0x8eb464[_0x214b('0x4d')](_0x214b('0x4f'),{'SmsInteractionId':Number(_0x455928[_0x315fce]),'UserId':Number(_0x55daef['id'])});}});}})['then'](function(){if(_0x168a18===_0x214b('0x46')){var _0x30e762=_[_0x214b('0x15')](_0x55daef[_0x214b('0x29')],'id');return _0x55daef[_0x214b('0x50')](_0x30e762)['then'](function(){for(var _0x431c81=0x0;_0x431c81<_0x30e762[_0x214b('0x1c')];_0x431c81+=0x1){_0x8eb464[_0x214b('0x4d')](_0x214b('0x51'),{'OpenchannelInteractionId':Number(_0x30e762[_0x431c81]),'UserId':Number(_0x55daef['id'])});}});}})[_0x214b('0x14')](function(){if(_0x168a18===_0x214b('0x46')){var _0x32ce79=_[_0x214b('0x15')](_0x55daef['WhatsappInteractions'],'id');return _0x55daef[_0x214b('0x52')](_0x32ce79)[_0x214b('0x14')](function(){for(var _0x3955b6=0x0;_0x3955b6<_0x32ce79[_0x214b('0x1c')];_0x3955b6+=0x1){_0x8eb464[_0x214b('0x4d')](_0x214b('0x53'),{'WhatsappInteractionId':Number(_0x32ce79[_0x3955b6]),'UserId':Number(_0x55daef['id'])});}});}})[_0x214b('0x54')](function(_0x3d905d){_0x15cfd3[_0x214b('0x55')](_0x3d905d);});}}function onDisconnect(_0x3294f8,_0x21f9e3){joinOrLeave(_0x3294f8,_0x214b('0x46'),_0x21f9e3);}function onConnect(_0x646227){joinOrLeave(_0x646227,_0x214b('0x56'));}exports['default']=function(_0x1e18e1){_0x1e18e1['on'](_0x214b('0x57'),function(_0x59f653){_0x59f653[_0x214b('0x58')](0x0);_0x59f653[_0x214b('0x59')]=_0x59f653['request'][_0x214b('0x57')]['remoteAddress']+':'+_0x59f653[_0x214b('0x5a')][_0x214b('0x57')][_0x214b('0x5b')];_0x59f653[_0x214b('0x5c')]=new Date();_0x59f653[_0x214b('0x55')]=function(_0x5ec1c2){console[_0x214b('0x55')](_0x214b('0x5d')+_0x59f653['nsp'][_0x214b('0x4')]+'['+_0x59f653['address']+']',_0x5ec1c2);};_0x59f653['on']('disconnect',function(){onDisconnect(_0x59f653,_0x1e18e1);_0x59f653[_0x214b('0x55')]('DISCONNECTED');});onConnect(_0x59f653);_0x59f653['log'](_0x214b('0x5e'));});}; \ No newline at end of file +var _0x3ce9=['length','voice','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','request','remoteAddress','SocketIO\x20','nsp','address','disconnect','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','UserProfileSection','then','autoAssociation','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','resourceId','where','type','ivr','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:inbound','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','Telephones','Trunks','getChatQueues','getSmsQueues','getMailQueues','getWhatsappQueues'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x3ce9,0x85));var _0x93ce=function(_0x390083,_0x31ba26){_0x390083=_0x390083-0x0;var _0x41a4db=_0x3ce9[_0x390083];return _0x41a4db;};'use strict';var _=require(_0x93ce('0x0'));var util=require('util');var BPromise=require(_0x93ce('0x1'));var db=require(_0x93ce('0x2'))['db'];var config=require(_0x93ce('0x3'));var queryQueues={'attributes':['id',_0x93ce('0x4')],'include':[{'as':_0x93ce('0x5'),'model':db[_0x93ce('0x6')],'attributes':['id','name',_0x93ce('0x7')],'raw':!![],'where':{'role':_0x93ce('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x93ce('0x4')],'where':{'role':_0x93ce('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x93ce('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x93ce('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x93ce('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x5769fb,_0xfa433,_0x5e3f70){return db[_0x93ce('0xa')]['findOne']({'where':{'name':_0x5769fb,'userProfileId':_0xfa433},'raw':!![]})[_0x93ce('0xb')](function(_0x5a125f){if(_0x5a125f){if(_0x5a125f[_0x93ce('0xc')]){switch(_0x5769fb){case'VoiceQueues':case'ChatQueues':case'FaxQueues':case'SmsQueues':case'MailQueues':case _0x93ce('0xd'):case _0x93ce('0xe'):return db[_0x5e3f70][_0x93ce('0xf')](queryQueues);case'Telephones':return db[_0x5e3f70][_0x93ce('0xf')](queryTelephones);case'Trunks':return db[_0x5e3f70][_0x93ce('0xf')](queryTrunks);case _0x93ce('0x10'):return db[_0x5e3f70]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x93ce('0xf')]({'attributes':['resourceId'],'where':{'sectionId':_0x5a125f['id']},'raw':!![]})[_0x93ce('0xb')](function(_0x4bc3e1){if(_0x4bc3e1){var _0xecc51b={'where':{'id':_['map'](_0x4bc3e1,_0x93ce('0x11'))},'raw':!![]};switch(_0x5e3f70){case _0x93ce('0x6'):_0xecc51b[_0x93ce('0x12')][_0x93ce('0x7')]=_0x93ce('0x9');break;case'Campaign':_0xecc51b[_0x93ce('0x12')][_0x93ce('0x13')]=_0x93ce('0x14');break;}return db[_0x5e3f70][_0x93ce('0xf')](_0xecc51b);}else{return[];}});}}else{return[];}})[_0x93ce('0xb')](function(_0x25be3b){return _0x25be3b;});}function joinOrLeaveQueues(_0x48929e,_0x4d33de,_0x10cdb5,_0x31d670){_0x48929e[_0x4d33de](util[_0x93ce('0x15')](_0x93ce('0x16'),_0x10cdb5,_0x31d670[_0x93ce('0x4')]));if(_0x31d670[_0x93ce('0x5')]){for(var _0x114527=0x0;_0x114527<_0x31d670[_0x93ce('0x5')]['length'];_0x114527+=0x1){_0x48929e[_0x4d33de](util[_0x93ce('0x15')](_0x93ce('0x17'),_0x31d670[_0x93ce('0x5')][_0x114527][_0x93ce('0x4')]));}}}function joinOrLeave(_0x5de144,_0x1aa60d,_0x49ecf4){var _0xcb26b3;if(_0x5de144[_0x93ce('0x18')]['query']['id']){db[_0x93ce('0x6')][_0x93ce('0x19')]({'attributes':['id',_0x93ce('0x4'),_0x93ce('0x7'),_0x93ce('0x1a')],'where':{'id':_0x5de144[_0x93ce('0x18')][_0x93ce('0x1b')]['id']},'include':[{'model':db[_0x93ce('0x1c')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x93ce('0x1d')],'as':_0x93ce('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x93ce('0x1f')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x93ce('0x20')],'as':_0x93ce('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x93ce('0x22')],'as':_0x93ce('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x93ce('0x24')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x93ce('0xb')](function(_0x212e9e){if(_0x212e9e){_0xcb26b3=_0x212e9e;_0x5de144[_0x1aa60d](util[_0x93ce('0x15')]('user:%s',_0x212e9e[_0x93ce('0x4')]));var _0xd51f28=[];switch(_0x212e9e[_0x93ce('0x7')]){case _0x93ce('0x25'):_0x5de144[_0x1aa60d]('voice:inbound');_0x5de144[_0x1aa60d](_0x93ce('0x26'));if(queryQueues[_0x93ce('0x27')](_0x93ce('0x28'))){delete queryQueues[_0x93ce('0x28')];}_0xd51f28[_0x93ce('0x29')](db['VoiceQueue'][_0x93ce('0xf')](queryQueues));_0xd51f28['push'](db[_0x93ce('0x2a')][_0x93ce('0xf')](queryQueues));_0xd51f28['push'](db[_0x93ce('0x2b')][_0x93ce('0xf')](queryQueues));_0xd51f28[_0x93ce('0x29')](db[_0x93ce('0x2c')][_0x93ce('0xf')](queryQueues));_0xd51f28[_0x93ce('0x29')](db[_0x93ce('0x2d')]['findAll'](queryQueues));_0xd51f28['push'](db[_0x93ce('0x2e')][_0x93ce('0xf')](queryQueues));_0xd51f28[_0x93ce('0x29')](db[_0x93ce('0x2f')][_0x93ce('0xf')](queryQueues));_0xd51f28[_0x93ce('0x29')](db[_0x93ce('0x6')][_0x93ce('0xf')](queryTelephones));_0xd51f28[_0x93ce('0x29')](db[_0x93ce('0x30')][_0x93ce('0xf')](queryTrunks));_0xd51f28['push'](db[_0x93ce('0x31')][_0x93ce('0xf')](queryCampaigns));_0xd51f28[_0x93ce('0x29')](db[_0x93ce('0x6')][_0x93ce('0xf')](queryAgents));break;case _0x93ce('0x32'):_0x5de144[_0x1aa60d](_0x93ce('0x33'));_0x5de144[_0x1aa60d](_0x93ce('0x26'));_0xd51f28['push'](getAssociatedResources(_0x93ce('0x34'),_0x212e9e[_0x93ce('0x1a')],'VoiceQueue'));_0xd51f28['push'](getAssociatedResources(_0x93ce('0x35'),_0x212e9e[_0x93ce('0x1a')],_0x93ce('0x2a')));_0xd51f28[_0x93ce('0x29')](getAssociatedResources(_0x93ce('0x36'),_0x212e9e[_0x93ce('0x1a')],_0x93ce('0x2b')));_0xd51f28[_0x93ce('0x29')](getAssociatedResources(_0x93ce('0x37'),_0x212e9e[_0x93ce('0x1a')],_0x93ce('0x2c')));_0xd51f28[_0x93ce('0x29')](getAssociatedResources(_0x93ce('0x38'),_0x212e9e[_0x93ce('0x1a')],'MailQueue'));_0xd51f28[_0x93ce('0x29')](getAssociatedResources(_0x93ce('0xd'),_0x212e9e['userProfileId'],'OpenchannelQueue'));_0xd51f28[_0x93ce('0x29')](getAssociatedResources(_0x93ce('0xe'),_0x212e9e[_0x93ce('0x1a')],_0x93ce('0x2f')));_0xd51f28['push'](getAssociatedResources(_0x93ce('0x39'),_0x212e9e[_0x93ce('0x1a')],_0x93ce('0x6')));_0xd51f28[_0x93ce('0x29')](getAssociatedResources(_0x93ce('0x3a'),_0x212e9e[_0x93ce('0x1a')],_0x93ce('0x30')));_0xd51f28['push'](getAssociatedResources(_0x93ce('0x10'),_0x212e9e[_0x93ce('0x1a')],_0x93ce('0x31')));_0xd51f28[_0x93ce('0x29')](db['User'][_0x93ce('0xf')](queryAgents));break;case'agent':_0x5de144[_0x1aa60d](_0x93ce('0x33'));_0x5de144[_0x1aa60d]('voice:outbound');_0xd51f28[_0x93ce('0x29')](_0x212e9e['getVoiceQueues']({'attributes':['id','name']}));_0xd51f28[_0x93ce('0x29')](_0x212e9e[_0x93ce('0x3b')]({'attributes':['id',_0x93ce('0x4')]}));_0xd51f28['push'](_0x212e9e['getFaxQueues']({'attributes':['id',_0x93ce('0x4')]}));_0xd51f28[_0x93ce('0x29')](_0x212e9e[_0x93ce('0x3c')]({'attributes':['id',_0x93ce('0x4')]}));_0xd51f28['push'](_0x212e9e[_0x93ce('0x3d')]({'attributes':['id',_0x93ce('0x4')]}));_0xd51f28[_0x93ce('0x29')](_0x212e9e['getOpenchannelQueues']({'attributes':['id',_0x93ce('0x4')]}));_0xd51f28[_0x93ce('0x29')](_0x212e9e[_0x93ce('0x3e')]({'attributes':['id',_0x93ce('0x4')]}));break;}return BPromise['all'](_0xd51f28);}})[_0x93ce('0xb')](function(_0x216978){if(_0x216978&&_0x216978[_0x93ce('0x3f')]){for(var _0x2ee877=0x0;_0x2ee877<_0x216978[_0x93ce('0x3f')];_0x2ee877+=0x1){for(var _0x44e249=0x0;_0x44e249<_0x216978[_0x2ee877][_0x93ce('0x3f')];_0x44e249+=0x1){switch(_0x2ee877){case 0x0:joinOrLeaveQueues(_0x5de144,_0x1aa60d,_0x93ce('0x40'),_0x216978[_0x2ee877][_0x44e249]);break;case 0x1:joinOrLeaveQueues(_0x5de144,_0x1aa60d,'chat',_0x216978[_0x2ee877][_0x44e249]);break;case 0x2:joinOrLeaveQueues(_0x5de144,_0x1aa60d,'fax',_0x216978[_0x2ee877][_0x44e249]);break;case 0x3:joinOrLeaveQueues(_0x5de144,_0x1aa60d,_0x93ce('0x41'),_0x216978[_0x2ee877][_0x44e249]);break;case 0x4:joinOrLeaveQueues(_0x5de144,_0x1aa60d,_0x93ce('0x42'),_0x216978[_0x2ee877][_0x44e249]);break;case 0x5:joinOrLeaveQueues(_0x5de144,_0x1aa60d,'openchannel',_0x216978[_0x2ee877][_0x44e249]);break;case 0x6:joinOrLeaveQueues(_0x5de144,_0x1aa60d,_0x93ce('0x43'),_0x216978[_0x2ee877][_0x44e249]);break;case 0x7:if(_0xcb26b3['role']!==_0x93ce('0x8'))_0x5de144[_0x1aa60d](util[_0x93ce('0x15')](_0x93ce('0x44'),_0x216978[_0x2ee877][_0x44e249][_0x93ce('0x4')]));break;case 0x8:if(_0xcb26b3[_0x93ce('0x7')]!==_0x93ce('0x8'))_0x5de144[_0x1aa60d](util[_0x93ce('0x15')](_0x93ce('0x45'),_0x216978[_0x2ee877][_0x44e249][_0x93ce('0x4')]));break;case 0x9:if(_0xcb26b3[_0x93ce('0x7')]!=='agent')_0x5de144[_0x1aa60d](util[_0x93ce('0x15')](_0x93ce('0x46'),_0x216978[_0x2ee877][_0x44e249][_0x93ce('0x13')],_0x216978[_0x2ee877][_0x44e249][_0x93ce('0x4')]));break;case 0xa:_0x5de144[_0x1aa60d](util[_0x93ce('0x15')](_0x93ce('0x17'),_0x216978[_0x2ee877][_0x44e249][_0x93ce('0x4')]));break;}}}}})[_0x93ce('0xb')](function(){if(_0x1aa60d===_0x93ce('0x47')){var _0x469665=_[_0x93ce('0x48')](_0xcb26b3[_0x93ce('0x49')],'id');return _0xcb26b3[_0x93ce('0x4a')](_0x469665)['then'](function(){for(var _0xf66210=0x0;_0xf66210<_0x469665[_0x93ce('0x3f')];_0xf66210+=0x1){_0x49ecf4[_0x93ce('0x4b')](_0x93ce('0x4c'),{'ChatInteractionId':Number(_0x469665[_0xf66210]),'UserId':Number(_0xcb26b3['id'])});}});}})[_0x93ce('0xb')](function(){if(_0x1aa60d===_0x93ce('0x47')){var _0x26c023=_[_0x93ce('0x48')](_0xcb26b3[_0x93ce('0x1e')],'id');return _0xcb26b3[_0x93ce('0x4d')](_0x26c023)['then'](function(){for(var _0x38c394=0x0;_0x38c394<_0x26c023[_0x93ce('0x3f')];_0x38c394+=0x1){_0x49ecf4[_0x93ce('0x4b')](_0x93ce('0x4e'),{'MailInteractionId':Number(_0x26c023[_0x38c394]),'UserId':Number(_0xcb26b3['id'])});}});}})[_0x93ce('0xb')](function(){if(_0x1aa60d===_0x93ce('0x47')){var _0x1e7e17=_[_0x93ce('0x48')](_0xcb26b3[_0x93ce('0x4f')],'id');return _0xcb26b3[_0x93ce('0x50')](_0x1e7e17)['then'](function(){for(var _0x32a543=0x0;_0x32a543<_0x1e7e17[_0x93ce('0x3f')];_0x32a543+=0x1){_0x49ecf4[_0x93ce('0x4b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1e7e17[_0x32a543]),'UserId':Number(_0xcb26b3['id'])});}});}})[_0x93ce('0xb')](function(){if(_0x1aa60d===_0x93ce('0x47')){var _0x72630a=_[_0x93ce('0x48')](_0xcb26b3[_0x93ce('0x21')],'id');return _0xcb26b3['removeSmsInteractions'](_0x72630a)['then'](function(){for(var _0x241c93=0x0;_0x241c93<_0x72630a[_0x93ce('0x3f')];_0x241c93+=0x1){_0x49ecf4['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x72630a[_0x241c93]),'UserId':Number(_0xcb26b3['id'])});}});}})[_0x93ce('0xb')](function(){if(_0x1aa60d===_0x93ce('0x47')){var _0x41c22c=_['map'](_0xcb26b3[_0x93ce('0x23')],'id');return _0xcb26b3[_0x93ce('0x51')](_0x41c22c)[_0x93ce('0xb')](function(){for(var _0x111df1=0x0;_0x111df1<_0x41c22c[_0x93ce('0x3f')];_0x111df1+=0x1){_0x49ecf4[_0x93ce('0x4b')](_0x93ce('0x52'),{'OpenchannelInteractionId':Number(_0x41c22c[_0x111df1]),'UserId':Number(_0xcb26b3['id'])});}});}})[_0x93ce('0xb')](function(){if(_0x1aa60d==='leave'){var _0x26f86c=_[_0x93ce('0x48')](_0xcb26b3[_0x93ce('0x53')],'id');return _0xcb26b3[_0x93ce('0x54')](_0x26f86c)[_0x93ce('0xb')](function(){for(var _0x50e783=0x0;_0x50e783<_0x26f86c[_0x93ce('0x3f')];_0x50e783+=0x1){_0x49ecf4[_0x93ce('0x4b')](_0x93ce('0x55'),{'WhatsappInteractionId':Number(_0x26f86c[_0x50e783]),'UserId':Number(_0xcb26b3['id'])});}});}})[_0x93ce('0x56')](function(_0x300ffa){_0x5de144[_0x93ce('0x57')](_0x300ffa);});}}function onDisconnect(_0x396963,_0x5298ab){joinOrLeave(_0x396963,'leave',_0x5298ab);}function onConnect(_0x54bf86){joinOrLeave(_0x54bf86,_0x93ce('0x58'));}exports[_0x93ce('0x59')]=function(_0x4b8d72){_0x4b8d72['on'](_0x93ce('0x5a'),function(_0x310425){_0x310425['setMaxListeners'](0x0);_0x310425['address']=_0x310425[_0x93ce('0x5b')][_0x93ce('0x5a')][_0x93ce('0x5c')]+':'+_0x310425['request']['connection']['remotePort'];_0x310425['connectedAt']=new Date();_0x310425['log']=function(_0x18249f){console['log'](_0x93ce('0x5d')+_0x310425[_0x93ce('0x5e')][_0x93ce('0x4')]+'['+_0x310425[_0x93ce('0x5f')]+']',_0x18249f);};_0x310425['on'](_0x93ce('0x60'),function(){onDisconnect(_0x310425,_0x4b8d72);_0x310425[_0x93ce('0x57')]('DISCONNECTED');});onConnect(_0x310425);_0x310425[_0x93ce('0x57')](_0x93ce('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 1a16f5d..84730a4 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 _0x8029=['agent','outgoingmessage','get','resolve','name','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','internal','default','length','hasOwnProperty','model','callback','condition','util','../logger','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','then','info','EventManager','error','Trigger,\x20%s','catch','channel','motionChannel','event','direction','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s'];(function(_0x25663d,_0x21d3b9){var _0x243b21=function(_0x45700e){while(--_0x45700e){_0x25663d['push'](_0x25663d['shift']());}};_0x243b21(++_0x21d3b9);}(_0x8029,0xe3));var _0x9802=function(_0x319229,_0x5e59c1){_0x319229=_0x319229-0x0;var _0xa94546=_0x8029[_0x319229];return _0xa94546;};'use strict';var util=require(_0x9802('0x0'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x9802('0x1'))('triggers');var client=jayson[_0x9802('0x2')][_0x9802('0x3')]({'port':0x232a});var triggers=[{'channel':_0x9802('0x4'),'model':_0x9802('0x5'),'event':_0x9802('0x6'),'condition':_0x9802('0x7'),'callback':afterCreate},{'channel':'Chat','model':_0x9802('0x5'),'event':_0x9802('0x8'),'condition':_0x9802('0x9'),'callback':afterUpdate},{'channel':_0x9802('0x4'),'model':_0x9802('0xa'),'event':_0x9802('0x6'),'condition':_0x9802('0xb'),'callback':afterCreateMessage},{'channel':_0x9802('0x4'),'model':'ChatOfflineMessage','event':_0x9802('0x6'),'condition':_0x9802('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x9802('0xc'),'model':_0x9802('0xd'),'event':'afterCreate','condition':_0x9802('0x7'),'callback':afterCreate},{'channel':_0x9802('0xc'),'model':_0x9802('0xd'),'event':_0x9802('0x8'),'condition':_0x9802('0x9'),'callback':afterUpdate},{'channel':_0x9802('0xc'),'model':_0x9802('0xe'),'event':_0x9802('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x9802('0xf'),'model':_0x9802('0x10'),'event':_0x9802('0x6'),'condition':_0x9802('0x7'),'callback':afterCreate},{'channel':_0x9802('0xf'),'model':_0x9802('0x10'),'event':_0x9802('0x8'),'condition':_0x9802('0x9'),'callback':afterUpdate},{'channel':_0x9802('0xf'),'model':_0x9802('0x11'),'event':_0x9802('0x6'),'condition':_0x9802('0xb'),'callback':afterCreateMessage},{'channel':_0x9802('0x12'),'model':_0x9802('0x13'),'event':_0x9802('0x6'),'condition':_0x9802('0x7'),'callback':afterCreate},{'channel':'Fax','model':_0x9802('0x13'),'event':_0x9802('0x8'),'condition':_0x9802('0x9'),'callback':afterUpdate},{'channel':_0x9802('0x12'),'model':'FaxMessage','event':_0x9802('0x6'),'condition':_0x9802('0xb'),'callback':afterCreateMessage},{'channel':_0x9802('0x14'),'model':_0x9802('0x15'),'event':_0x9802('0x6'),'condition':_0x9802('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0x9802('0x15'),'event':_0x9802('0x8'),'condition':_0x9802('0x9'),'callback':afterUpdate},{'channel':'Mail','model':_0x9802('0x16'),'event':'afterCreate','condition':_0x9802('0xb'),'callback':afterCreateMessage},{'channel':_0x9802('0x17'),'model':_0x9802('0x18'),'event':_0x9802('0x6'),'condition':_0x9802('0x7'),'callback':afterCreate},{'channel':_0x9802('0x17'),'model':_0x9802('0x18'),'event':_0x9802('0x8'),'condition':_0x9802('0x9'),'callback':afterUpdate},{'channel':_0x9802('0x17'),'model':_0x9802('0x19'),'event':_0x9802('0x6'),'condition':_0x9802('0xb'),'callback':afterCreateMessage}];function request(_0x7e541a){return client['request']('EventManager',_0x7e541a)[_0x9802('0x1a')](function(_0x2dc007){logger[_0x9802('0x1b')]('Trigger,\x20%s',_0x9802('0x1c'),_0x2dc007);if(_0x2dc007['error']){if(_0x2dc007[_0x9802('0x1d')]['code']===0x1f4){logger['error'](_0x9802('0x1e'),_0x9802('0x1c'),_0x2dc007[_0x9802('0x1d')]);}}})[_0x9802('0x1f')](function(_0x10a78d){logger[_0x9802('0x1d')](_0x9802('0x1e'),_0x9802('0x1c'),_0x10a78d);});}function afterCreateMessage(_0x3a3e5b){return function(_0x4b3311){_0x4b3311=_0x4b3311['get']({'plain':!![]});_0x4b3311[_0x9802('0x20')]=_0x3a3e5b;_0x4b3311[_0x9802('0x21')]=_0x3a3e5b;_0x4b3311[_0x9802('0x22')]=_0x4b3311[_0x9802('0x23')];Promise['resolve']()[_0x9802('0x1a')](function(){if(typeof _0x4b3311['ContactId']===_0x9802('0x24'))return null;var _0x4545a8=_0x9802('0x25')+_0x4b3311[_0x9802('0x26')];return db[_0x9802('0x27')][_0x9802('0x28')](_0x4545a8,{'type':db[_0x9802('0x29')][_0x9802('0x2a')][_0x9802('0x2b')],'raw':!![]});})[_0x9802('0x1a')](function(_0x1dfaae){if(_0x1dfaae){_0x4b3311[_0x9802('0x2c')]=_0x1dfaae[0x0];}if(typeof _0x4b3311[_0x9802('0x2d')]===_0x9802('0x24'))return;return getAgent(_0x4b3311[_0x9802('0x2d')]);})[_0x9802('0x1a')](function(_0x3f4dbd){if(_0x3f4dbd){_0x4b3311[_0x9802('0x2e')]=util[_0x9802('0x2f')](_0x9802('0x30'),_0x3f4dbd['name']);_0x4b3311[_0x9802('0x31')]=_0x3f4dbd;_0x4b3311[_0x9802('0x20')]=_0x3a3e5b;return request({'event':'incomingmessage','message':_0x4b3311});}else{return request({'event':_0x9802('0x32'),'message':_0x4b3311});}})[_0x9802('0x1f')](function(_0x463f7f){logger['error'](_0x9802('0x1e'),'AfterCreateMessage',_0x463f7f);});};}function afterCreateOfflineMessage(_0x35ad68){return function(_0x43f921){_0x43f921=_0x43f921[_0x9802('0x33')]({'plain':!![]});_0x43f921[_0x9802('0x20')]=_0x35ad68;_0x43f921[_0x9802('0x21')]=_0x35ad68;_0x43f921[_0x9802('0x22')]='offlineMessage';return request({'event':_0x43f921[_0x9802('0x22')],'message':_0x43f921});};}function afterCreate(_0x2d27fa,_0x311987){return function(_0x45e5cf){_0x45e5cf=_0x45e5cf['get']({'plain':!![]});_0x45e5cf['channel']=_0x2d27fa;_0x45e5cf[_0x9802('0x21')]=_0x2d27fa;_0x45e5cf[_0x9802('0x22')]='opened';Promise[_0x9802('0x34')]()[_0x9802('0x1a')](function(){var _0x541e56=_0x9802('0x25')+_0x45e5cf[_0x9802('0x26')];return db[_0x9802('0x27')]['query'](_0x541e56,{'type':db[_0x9802('0x29')]['QueryTypes'][_0x9802('0x2b')],'raw':!![]});})[_0x9802('0x1a')](function(_0x22077d){if(_0x22077d){_0x45e5cf[_0x9802('0x2c')]=_0x22077d[0x0];}if(typeof _0x45e5cf[_0x9802('0x2d')]===_0x9802('0x24'))return;return getAgent(_0x45e5cf[_0x9802('0x2d')]);})['then'](function(_0x2730ed){if(_0x2730ed){_0x45e5cf[_0x9802('0x2e')]=util[_0x9802('0x2f')](_0x9802('0x30'),_0x2730ed[_0x9802('0x35')]);_0x45e5cf['agent']=_0x2730ed;}return request({'event':_0x311987,'message':_0x45e5cf});})[_0x9802('0x1f')](function(_0x339bac){logger[_0x9802('0x1d')](_0x9802('0x1e'),_0x9802('0x36'),_0x339bac);});};}function afterUpdate(_0x2e9778){return function(_0x4aaaa0){var _0x31613d=_0x4aaaa0[_0x9802('0x37')](_0x9802('0x38'))&&_0x4aaaa0[_0x9802('0x38')];var _0x396534=_0x4aaaa0[_0x9802('0x37')](_0x9802('0x39'));if(_0x31613d||_0x396534){var _0x1f5198=_0x31613d?_0x9802('0x9'):_0x9802('0x39');var _0x4d50d6=_0x4aaaa0[_0x9802('0x33')]({'plain':!![]});_0x4d50d6[_0x9802('0x20')]=_0x2e9778;_0x4d50d6[_0x9802('0x21')]=_0x2e9778;_0x4d50d6[_0x9802('0x22')]=_0x31613d?_0x9802('0x38'):_0x9802('0x39');var _0x5268ef=_0x9802('0x25')+_0x4d50d6['ContactId'];return db[_0x9802('0x27')]['query'](_0x5268ef,{'type':db[_0x9802('0x29')]['QueryTypes'][_0x9802('0x2b')],'raw':!![]})['then'](function(_0x330292){if(_0x330292){_0x4d50d6['contact']=_0x330292[0x0];}if(typeof _0x4d50d6[_0x9802('0x2d')]===_0x9802('0x24'))return;return getAgent(_0x4d50d6[_0x9802('0x2d')]);})[_0x9802('0x1a')](function(_0x4e9161){if(_0x4e9161){_0x4d50d6[_0x9802('0x2e')]=util['format'](_0x9802('0x30'),_0x4e9161[_0x9802('0x35')]);_0x4d50d6[_0x9802('0x31')]=_0x4e9161;}return request({'event':_0x1f5198,'message':_0x4d50d6});})[_0x9802('0x1f')](function(_0x5e88f0){logger[_0x9802('0x1d')](_0x9802('0x1e'),_0x9802('0x3a'),_0x5e88f0);});}};}function getAgent(_0x4d6f40){return db[_0x9802('0x3b')][_0x9802('0x3c')]({'where':{'id':_0x4d6f40},'attributes':['id','name',_0x9802('0x3d'),'email',_0x9802('0x3e')],'raw':!![]})[_0x9802('0x1a')](function(_0x49803b){return _0x49803b;});}exports[_0x9802('0x3f')]=function(){for(var _0x4241ac=0x0;_0x4241ac=_0x2698de['agents']){throw Error(_0x62f6('0x15'));}_0x4977cb(_0x4d1be0);})[_0x62f6('0x16')](function(_0x2d177a){_0x3a2c85(_0x2d177a);});});}; \ No newline at end of file +var _0x3e38=['agents','lodash','bluebird','../mysqldb','voice','chat','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','User','agent','then'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x3e38,0xf1));var _0x83e3=function(_0x1c6f74,_0x24c669){_0x1c6f74=_0x1c6f74-0x0;var _0x3328f7=_0x3e38[_0x1c6f74];return _0x3328f7;};'use strict';var _=require(_0x83e3('0x0'));var BPromise=require(_0x83e3('0x1'));var db=require(_0x83e3('0x2'))['db'];var util=require('./license/util');var channels=[_0x83e3('0x3'),'mail',_0x83e3('0x4'),'fax','sms',_0x83e3('0x5'),_0x83e3('0x6')];exports[_0x83e3('0x7')]=function(){return channels;};exports[_0x83e3('0x8')]=function(_0x2bd7ad){_0x2bd7ad=_0x2bd7ad[_0x83e3('0x9')]();return _[_0x83e3('0xa')](channels,_0x2bd7ad);};exports[_0x83e3('0xb')]=function(_0x378d42,_0x4d0046,_0x4a0628,_0x256776){var _0x4ba58c={'loginAttempts':_0x4d0046,'blocked':_0x4a0628};if(!_['isUndefined'](_0x256776)){_0x4ba58c[_0x83e3('0xc')]=_0x256776;}return _0x378d42[_0x83e3('0xd')](_0x4ba58c);};exports[_0x83e3('0xe')]=function(_0x37d4c2){return new BPromise(function(_0x44b920,_0xe46dfa){var _0x58376e=0x0;if(_0x37d4c2[_0x83e3('0xf')]!=='agent'){_0x44b920(_0x37d4c2);}db[_0x83e3('0x10')]['count']({'where':{'role':_0x83e3('0x11'),'online':!![],'id':{'$ne':_0x37d4c2['id']}}})[_0x83e3('0x12')](function(_0xa4dee1){_0x58376e=_0xa4dee1;return util[_0x83e3('0xe')]();})[_0x83e3('0x12')](function(_0x3c4aae){if(_0x3c4aae&&_0x3c4aae[_0x83e3('0x13')]&&_0x58376e>=_0x3c4aae[_0x83e3('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x44b920(_0x37d4c2);})['catch'](function(_0x32add0){_0xe46dfa(_0x32add0);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index b67a0e0..035e965 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['OutOfInterval','error','status','send','exports','util','api','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','Not\x20Found','inherits','Forbidden'];(function(_0x5d508f,_0x4ff34a){var _0x3915fc=function(_0x24a297){while(--_0x24a297){_0x5d508f['push'](_0x5d508f['shift']());}};_0x3915fc(++_0x4ff34a);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0xb4e6[_0x211bc3];return _0x34c9a2;};'use strict';var util=require(_0x6b4e('0x0'));var logger=require('../config/logger')(_0x6b4e('0x1'));var APIError=function(_0x1afd20,_0x365912){this[_0x6b4e('0x2')]=_0x1afd20||_0x6b4e('0x3');this[_0x6b4e('0x4')]=_0x365912||_0x6b4e('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x40da90){this[_0x6b4e('0x2')]=_0x40da90||_0x6b4e('0x6');this['name']=_0x6b4e('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x4f00be){this[_0x6b4e('0x2')]=_0x4f00be||'Entity\x20not\x20found';this['name']=_0x6b4e('0x7');util[_0x6b4e('0x8')](APINotFoundError,APIError);};function getStatusCode(_0x1e3bf6){switch(_0x1e3bf6){case _0x6b4e('0x6'):return 0x190;case _0x6b4e('0x9'),_0x6b4e('0xa'):return 0x193;case _0x6b4e('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x49c734){return function(_0x39b4ec){logger[_0x6b4e('0xb')](_0x39b4ec['stack']);var _0x2a4d0f=getStatusCode(_0x39b4ec[_0x6b4e('0x4')]);if(_0x39b4ec[_0x6b4e('0x4')])delete _0x39b4ec[_0x6b4e('0x4')];return _0x49c734[_0x6b4e('0xc')](_0x2a4d0f)[_0x6b4e('0xd')](_0x39b4ec);};}module[_0x6b4e('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x91a7=['name','inherits','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack','status','send','../config/logger','api','message'];(function(_0x279f47,_0x539fcf){var _0x20a09c=function(_0xc72177){while(--_0xc72177){_0x279f47['push'](_0x279f47['shift']());}};_0x20a09c(++_0x539fcf);}(_0x91a7,0xe7));var _0x791a=function(_0x17f5ea,_0x480b7b){_0x17f5ea=_0x17f5ea-0x0;var _0x376ed6=_0x91a7[_0x17f5ea];return _0x376ed6;};'use strict';var util=require('util');var logger=require(_0x791a('0x0'))(_0x791a('0x1'));var APIError=function(_0x268862,_0x5d2796){this[_0x791a('0x2')]=_0x268862||'Internal\x20Server\x20Error';this[_0x791a('0x3')]=_0x5d2796||'Error';util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x32fe2b){this[_0x791a('0x2')]=_0x32fe2b||'Bad\x20Request';this[_0x791a('0x3')]='Bad\x20Request';util[_0x791a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x159e24){this['message']=_0x159e24||_0x791a('0x5');this[_0x791a('0x3')]=_0x791a('0x6');util[_0x791a('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x266e4b){switch(_0x266e4b){case'Bad\x20Request':return 0x190;case _0x791a('0x7'),_0x791a('0x8'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2bd26a){return function(_0x206eea){logger[_0x791a('0x9')](_0x206eea[_0x791a('0xa')]);var _0x2805c9=getStatusCode(_0x206eea[_0x791a('0x3')]);if(_0x206eea['name'])delete _0x206eea['name'];return _0x2bd26a[_0x791a('0xb')](_0x2805c9)[_0x791a('0xc')](_0x206eea);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 4d0f04f..371f53c 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef32=['exports','status','json','send'];(function(_0x165f8e,_0x516004){var _0x523270=function(_0x4127c6){while(--_0x4127c6){_0x165f8e['push'](_0x165f8e['shift']());}};_0x523270(++_0x516004);}(_0xef32,0x6c));var _0x2ef3=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xef32[_0x1bbc08];return _0x5d825b;};'use strict';module[_0x2ef3('0x0')][0x194]=function pageNotFound(_0x218989,_0x31e39e){var _0x19c59c='404';var _0x32043d=0x194;var _0x3f7406={'status':_0x32043d};_0x31e39e[_0x2ef3('0x1')](_0x3f7406[_0x2ef3('0x1')]);_0x31e39e['render'](_0x19c59c,{},function(_0x2cc83d,_0x438ce8){if(_0x2cc83d){return _0x31e39e['status'](_0x3f7406[_0x2ef3('0x1')])[_0x2ef3('0x2')](_0x3f7406);}_0x31e39e[_0x2ef3('0x3')](_0x438ce8);});}; \ No newline at end of file +var _0x33e5=['404','status','json','send','exports'];(function(_0x515a41,_0x4c631c){var _0x5a435b=function(_0x5dc9b4){while(--_0x5dc9b4){_0x515a41['push'](_0x515a41['shift']());}};_0x5a435b(++_0x4c631c);}(_0x33e5,0x13a));var _0x533e=function(_0x135e45,_0x56e462){_0x135e45=_0x135e45-0x0;var _0xf5b103=_0x33e5[_0x135e45];return _0xf5b103;};'use strict';module[_0x533e('0x0')][0x194]=function pageNotFound(_0x23b543,_0x253d0c){var _0x53a56c=_0x533e('0x1');var _0x597457=0x194;var _0x32d1ff={'status':_0x597457};_0x253d0c[_0x533e('0x2')](_0x32d1ff[_0x533e('0x2')]);_0x253d0c['render'](_0x53a56c,{},function(_0x49957c,_0x422fc7){if(_0x49957c){return _0x253d0c[_0x533e('0x2')](_0x32d1ff[_0x533e('0x2')])[_0x533e('0x3')](_0x32d1ff);}_0x253d0c[_0x533e('0x4')](_0x422fc7);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c90b80b..18c94da 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x983a=['OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','ChatProactiveAction','CmContactHasItem','Phones','CmContactId','Company','CompanyId','cm_contact_has_tags','CmHopperId','Campaign','CampaignId','OwnerId','AutomationAllId','Any','AutomationAnyId','AutomationId','Intervals','MailApplications','ChatApplications','Schedule','CustomReportId','Sound','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','AllConditions','AnyConditions','Actions','TriggerId','AnalyticFieldReport','Fields','DefaultReportId','MetricId','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','Subjects','Description','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','Dynamics365Account','FromId','ToId','SessionId','ProjectId','team_has_chat_queues','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','TrunkId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','HopperHistory','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','UserSetting','exports','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','name','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../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','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../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','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','ChatInteractions','FaxInteraction','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotification','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueues','OpenchannelQueues','UserOpenchannelQueue','UserWhatsappQueue','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','UserVoiceQueueRt','Members','VoiceQueueId','CmHopper','Hoppers','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','restrict','CloudProviderId','Imap','Smtp','Answers','Interactions','List','ListId','MailQueue','team_has_mail_queues','MailInteractionId','Tag','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','Account','ChatOfflineMessageId','TagId','Dispositions','FaxAccountId','Applications','Exntensions','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccount','SmsAccountId','SmsInteractionId','Tags','sms_interaction_has_tags','Interaction'];(function(_0x4dee14,_0x3d6aba){var _0x4daacb=function(_0x194cb3){while(--_0x194cb3){_0x4dee14['push'](_0x4dee14['shift']());}};_0x4daacb(++_0x3d6aba);}(_0x983a,0x75));var _0xa983=function(_0x125866,_0x8f577a){_0x125866=_0x125866-0x0;var _0x113fcc=_0x983a[_0x125866];return _0x113fcc;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xa983('0x0'));var _=require(_0xa983('0x1'));var jstz=require(_0xa983('0x2'));var timezone=jstz[_0xa983('0x3')]();config[_0xa983('0x0')]=_[_0xa983('0x4')](config[_0xa983('0x0')],{'database':'motion2','username':_0xa983('0x5'),'password':_0xa983('0x6'),'options':{'host':_0xa983('0x7'),'port':0xcea,'dialect':_0xa983('0x8'),'dialectOptions':{'charset':_0xa983('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa983('0xa'),'collate':_0xa983('0xb')}}});config[_0xa983('0xc')]=_['defaultsDeep'](config[_0xa983('0xc')],{'database':'motion2','username':_0xa983('0x5'),'password':_0xa983('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa983('0x8'),'dialectOptions':{'charset':_0xa983('0x9')},'logging':![],'timezone':timezone[_0xa983('0xd')](),'define':{'charset':_0xa983('0xa'),'collate':_0xa983('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa983('0x0')]['database'],config[_0xa983('0x0')][_0xa983('0xe')],config[_0xa983('0x0')][_0xa983('0xf')],config[_0xa983('0x0')][_0xa983('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0xa983('0xc')][_0xa983('0xe')],config[_0xa983('0xc')][_0xa983('0xf')],config[_0xa983('0xc')][_0xa983('0x10')])};db[_0xa983('0x11')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x13'));db[_0xa983('0x14')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x15'));db[_0xa983('0x16')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x17'));db[_0xa983('0x18')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x19'));db['VoiceQueue']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x1a'));db[_0xa983('0x1b')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0xa983('0x1c')]=db[_0xa983('0x0')]['import'](_0xa983('0x1d'));db[_0xa983('0x1e')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x1f'));db[_0xa983('0x20')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x21'));db[_0xa983('0x22')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0xa983('0x23')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x24'));db['VoiceAgentReport']=db[_0xa983('0x0')]['import'](_0xa983('0x25'));db[_0xa983('0x26')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x27'));db[_0xa983('0x28')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x29'));db[_0xa983('0x2a')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x2b'));db[_0xa983('0x2c')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x2d'));db['UserVoiceQueueRt']=db[_0xa983('0x0')]['import'](_0xa983('0x2e'));db['UserVoiceQueue']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x2f'));db['UserChatQueue']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x30'));db[_0xa983('0x31')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x32'));db[_0xa983('0x33')]=db[_0xa983('0x0')]['import'](_0xa983('0x34'));db[_0xa983('0x35')]=db[_0xa983('0x0')]['import'](_0xa983('0x36'));db['UserOpenchannelQueue']=db['sequelize'][_0xa983('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x37'));db[_0xa983('0x38')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x39'));db[_0xa983('0x3a')]=db['sequelize'][_0xa983('0x12')]('../api/mailServerOut/mailServerOut.model');db[_0xa983('0x3b')]=db['sequelize'][_0xa983('0x12')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x3c'));db[_0xa983('0x3d')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x3e'));db['MailInteraction']=db['sequelize'][_0xa983('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0xa983('0x3f')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x40'));db[_0xa983('0x41')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x42'));db[_0xa983('0x43')]=db[_0xa983('0x0')]['import'](_0xa983('0x44'));db[_0xa983('0x45')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x46'));db['DashboardItem']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x47'));db[_0xa983('0x48')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x49'));db[_0xa983('0x4a')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x4b'));db['FaxInteraction']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x4c'));db[_0xa983('0x4d')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x4e'));db[_0xa983('0x4f')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x50'));db[_0xa983('0x51')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x52'));db['SmsAccount']=db[_0xa983('0x0')][_0xa983('0x12')]('../api/smsAccount/smsAccount.model');db[_0xa983('0x53')]=db['sequelize']['import'](_0xa983('0x54'));db[_0xa983('0x55')]=db[_0xa983('0x0')]['import'](_0xa983('0x56'));db[_0xa983('0x57')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x58'));db[_0xa983('0x59')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x5a'));db[_0xa983('0x5b')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x5c'));db[_0xa983('0x5d')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x5e'));db['OpenchannelMessage']=db[_0xa983('0x0')][_0xa983('0x12')]('../api/openchannelMessage/openchannelMessage.model');db[_0xa983('0x5f')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/openchannelQueue/openchannelQueue.model');db[_0xa983('0x60')]=db[_0xa983('0x0')]['import'](_0xa983('0x61'));db[_0xa983('0x62')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x63'));db[_0xa983('0x64')]=db[_0xa983('0x0')]['import']('../api/chatApplication/chatApplication.model');db[_0xa983('0x65')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x66'));db[_0xa983('0x67')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x68'));db[_0xa983('0x69')]=db[_0xa983('0x0')]['import'](_0xa983('0x6a'));db[_0xa983('0x6b')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x6c'));db[_0xa983('0x6d')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x6e'));db['ChatProactiveAction']=db[_0xa983('0x0')]['import'](_0xa983('0x6f'));db[_0xa983('0x70')]=db['sequelize']['import'](_0xa983('0x71'));db[_0xa983('0x72')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x73'));db['CmHopper']=db['sequelize'][_0xa983('0x12')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x74'));db['CmHopperFinal']=db['sequelize'][_0xa983('0x12')](_0xa983('0x75'));db[_0xa983('0x76')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x77'));db[_0xa983('0x78')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x79'));db[_0xa983('0x7a')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x7b'));db[_0xa983('0x7c')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/action/action.model');db[_0xa983('0x7d')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x7e'));db[_0xa983('0x7f')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x80'));db[_0xa983('0x81')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x82'));db[_0xa983('0x83')]=db['sequelize']['import'](_0xa983('0x84'));db[_0xa983('0x85')]=db['sequelize']['import'](_0xa983('0x86'));db['Pause']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x87'));db['Cdr']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x88'));db[_0xa983('0x89')]=db['sequelize'][_0xa983('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db['sequelize'][_0xa983('0x12')](_0xa983('0x8a'));db['Sound']=db[_0xa983('0x0')]['import'](_0xa983('0x8b'));db['Tag']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x8c'));db[_0xa983('0x8d')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x8e'));db['CmContactHasItem']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x8f'));db[_0xa983('0x90')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x91'));db[_0xa983('0x92')]=db['sequelize'][_0xa983('0x12')]('../api/template/template.model');db[_0xa983('0x93')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x94'));db[_0xa983('0x95')]=db[_0xa983('0x0')]['import']('../api/variable/variable.model');db[_0xa983('0x96')]=db['sequelize']['import'](_0xa983('0x97'));db[_0xa983('0x98')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x99'));db[_0xa983('0x9a')]=db[_0xa983('0x0')]['import'](_0xa983('0x9b'));db[_0xa983('0x9c')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x9d'));db[_0xa983('0x9e')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x9f'));db[_0xa983('0xa0')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xa1'));db['AnalyticFieldReport']=db[_0xa983('0x0')][_0xa983('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xa983('0xa2')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xa3'));db[_0xa983('0xa4')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xa5'));db[_0xa983('0xa6')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xa7'));db['SalesforceField']=db[_0xa983('0x0')]['import'](_0xa983('0xa8'));db[_0xa983('0xa9')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xa983('0xaa')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xab'));db[_0xa983('0xac')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xad'));db[_0xa983('0xae')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xaf'));db[_0xa983('0xb0')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xb1'));db[_0xa983('0xb2')]=db['sequelize'][_0xa983('0x12')](_0xa983('0xb3'));db[_0xa983('0xb4')]=db['sequelize']['import'](_0xa983('0xb5'));db[_0xa983('0xb6')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xb7'));db[_0xa983('0xb8')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/intZohoField/intZohoField.model');db[_0xa983('0xb9')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xba'));db[_0xa983('0xbb')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xbc'));db[_0xa983('0xbd')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0xa983('0x0')][_0xa983('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xa983('0x0')]['import'](_0xa983('0xbe'));db['FreshdeskField']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xbf'));db[_0xa983('0xc0')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xc1'));db[_0xa983('0xc2')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xc3'));db[_0xa983('0xc4')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xc5'));db[_0xa983('0xc6')]=db['sequelize'][_0xa983('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xa983('0xc7')]=db['sequelize']['import'](_0xa983('0xc8'));db[_0xa983('0xc9')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xca'));db['Dynamics365Account']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xcb'));db[_0xa983('0xcc')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xcd'));db[_0xa983('0xce')]=db[_0xa983('0x0')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xa983('0xcf')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xd0'));db[_0xa983('0xd1')]=db['sequelize'][_0xa983('0x12')](_0xa983('0xd2'));db[_0xa983('0xd3')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xd4'));db['Integration']=db['sequelize'][_0xa983('0x12')](_0xa983('0x97'));db[_0xa983('0xd5')]=db['sequelize']['import'](_0xa983('0xd6'));db[_0xa983('0xd7')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xd8'));db[_0xa983('0xd9')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xda'));db[_0xa983('0xdb')]=db['sequelize'][_0xa983('0x12')](_0xa983('0xdc'));db[_0xa983('0xdd')]=db[_0xa983('0x0')]['import'](_0xa983('0xde'));db['JscriptySessionReport']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xdf'));db[_0xa983('0xe0')]=db['sequelize'][_0xa983('0x12')](_0xa983('0xe1'));db[_0xa983('0xe2')]=db[_0xa983('0x0')]['import'](_0xa983('0xe3'));db[_0xa983('0xe4')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xe5'));db[_0xa983('0xe6')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xe7'));db['Setting']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xe8'));db[_0xa983('0xe9')]=db[_0xa983('0x0')]['import'](_0xa983('0xea'));db[_0xa983('0xeb')]=db['sequelize']['import'](_0xa983('0xec'));db[_0xa983('0xed')]=db[_0xa983('0x0')]['import'](_0xa983('0xee'));db[_0xa983('0xef')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xf0'));db[_0xa983('0xf1')]=db['sequelize'][_0xa983('0x12')]('../api/team/team.model');db[_0xa983('0xf2')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xf3'));db['Campaign']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xf4'));db[_0xa983('0xf5')]=db['sequelize'][_0xa983('0x12')](_0xa983('0xf6'));db['Attachment']=db['sequelize'][_0xa983('0x12')](_0xa983('0xf7'));db['Plugin']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xf8'));db['MailTransferReport']=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xf9'));db[_0xa983('0xfa')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0xfb'));db[_0xa983('0xfc')]=db[_0xa983('0x0')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xa983('0xfd')]=db[_0xa983('0x0')]['import'](_0xa983('0xfe'));db[_0xa983('0xff')]=db[_0xa983('0x0')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0xa983('0x100')]=db[_0xa983('0x0')]['import'](_0xa983('0x101'));db[_0xa983('0x102')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x103'));db[_0xa983('0x104')]=db[_0xa983('0x0')][_0xa983('0x12')]('../api/userProfile/userProfile.model');db[_0xa983('0x105')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x106'));db[_0xa983('0x107')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x108'));db['UserNotification']=db['sequelize'][_0xa983('0x12')](_0xa983('0x109'));db[_0xa983('0x10a')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x10b'));db[_0xa983('0x10c')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x10d'));db[_0xa983('0x10e')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x10f'));db[_0xa983('0x110')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x111'));db['WhatsappQueueReport']=db[_0xa983('0x0')][_0xa983('0x12')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xa983('0x112')]=db[_0xa983('0x0')]['import'](_0xa983('0x113'));db[_0xa983('0x114')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x115'));db[_0xa983('0x116')]=db['sequelize'][_0xa983('0x12')](_0xa983('0x117'));db[_0xa983('0x118')]=db[_0xa983('0x0')]['import'](_0xa983('0x119'));db[_0xa983('0x11a')]=db[_0xa983('0x0')][_0xa983('0x12')](_0xa983('0x11b'));db[_0xa983('0x11c')]=db['sequelize']['import'](_0xa983('0x11d'));db['UserSetting']=db['sequelize']['import'](_0xa983('0x11e'));db[_0xa983('0x11')][_0xa983('0x11f')](db[_0xa983('0x1e')],{'as':_0xa983('0x1e'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x121')});db[_0xa983('0x11')][_0xa983('0x11f')](db['UserSetting'],{'as':'userSetting','onDelete':_0xa983('0x120'),'foreignKey':'UserId'});db[_0xa983('0x11')][_0xa983('0x122')](db['VoiceRecording'],{'as':_0xa983('0x123'),'foreignKey':'UserId'});db[_0xa983('0x11')][_0xa983('0x122')](db['UserVoiceQueueRt'],{'as':_0xa983('0x124'),'foreignKey':_0xa983('0x121')});db[_0xa983('0x11')][_0xa983('0x122')](db[_0xa983('0x16')],{'as':_0xa983('0x125'),'onDelete':_0xa983('0x120'),'hooks':!![]});db[_0xa983('0x11')][_0xa983('0x122')](db[_0xa983('0x126')],{'as':'HopperFinals','foreignKey':_0xa983('0x121')});db[_0xa983('0x11')][_0xa983('0x122')](db[_0xa983('0x76')],{'as':'HopperHistory','foreignKey':_0xa983('0x121')});db[_0xa983('0x11')][_0xa983('0x122')](db[_0xa983('0x78')],{'as':_0xa983('0x78'),'foreignKey':_0xa983('0x121')});db[_0xa983('0x11')][_0xa983('0x122')](db[_0xa983('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0xa983('0x11')]['hasMany'](db[_0xa983('0x65')],{'as':_0xa983('0x127'),'foreignKey':_0xa983('0x121')});db[_0xa983('0x11')]['hasMany'](db[_0xa983('0x55')],{'as':'SmsInteractions','foreignKey':_0xa983('0x121')});db[_0xa983('0x11')][_0xa983('0x122')](db[_0xa983('0x128')],{'as':_0xa983('0x129'),'foreignKey':_0xa983('0x121')});db['User']['hasMany'](db[_0xa983('0x12a')],{'as':'MailInteractions','foreignKey':'UserId'});db['User'][_0xa983('0x122')](db[_0xa983('0x10e')],{'as':_0xa983('0x12b'),'foreignKey':_0xa983('0x121')});db[_0xa983('0x11')][_0xa983('0x122')](db[_0xa983('0x12c')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0xa983('0x11')][_0xa983('0x12d')](db[_0xa983('0x104')],{'as':'UserProfile','foreignKey':_0xa983('0x12e')});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x6d')],{'as':_0xa983('0x130'),'through':_0xa983('0x131')});db[_0xa983('0x11')]['belongsToMany'](db['CmContact'],{'as':_0xa983('0x132'),'through':_0xa983('0x133')});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x100')],{'as':_0xa983('0x134'),'through':_0xa983('0x135')});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0xf1')],{'through':_0xa983('0x136')});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x12a')],{'as':_0xa983('0x137'),'through':_0xa983('0x138')});db['User'][_0xa983('0x12f')](db[_0xa983('0x65')],{'as':_0xa983('0x127'),'through':_0xa983('0x139')});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x128')],{'as':_0xa983('0x129'),'through':'user_has_fax_interactions'});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x55')],{'as':_0xa983('0x13a'),'through':'user_has_sms_interactions'});db[_0xa983('0x11')]['belongsToMany'](db[_0xa983('0x5d')],{'as':_0xa983('0x13b'),'through':_0xa983('0x13c')});db[_0xa983('0x11')]['belongsToMany'](db[_0xa983('0x10e')],{'as':'WhatsappInteractions','through':_0xa983('0x13d')});db['User'][_0xa983('0x12f')](db[_0xa983('0x13e')],{'as':_0xa983('0x13f'),'through':_0xa983('0x140'),'required':![]});db[_0xa983('0x11')][_0xa983('0x12f')](db['VoicePrefix'],{'as':_0xa983('0x141'),'through':'UserVoicePrefix','required':![]});db[_0xa983('0x11')][_0xa983('0x12f')](db['MailQueue'],{'as':_0xa983('0x142'),'through':_0xa983('0x31'),'required':![]});db['User'][_0xa983('0x12f')](db[_0xa983('0x6b')],{'as':_0xa983('0x143'),'through':_0xa983('0x144'),'required':![],'hooks':!![]});db['User'][_0xa983('0x12f')](db[_0xa983('0x4f')],{'as':_0xa983('0x145'),'through':_0xa983('0x33'),'required':![]});db[_0xa983('0x11')][_0xa983('0x12f')](db['SmsQueue'],{'as':'SmsQueues','through':_0xa983('0x35'),'required':![]});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x5f')],{'as':_0xa983('0x146'),'through':_0xa983('0x147'),'required':![]});db['User'][_0xa983('0x12f')](db[_0xa983('0x114')],{'as':'WhatsappQueues','through':_0xa983('0x148'),'required':![]});db[_0xa983('0x11')]['belongsToMany'](db[_0xa983('0x100')],{'through':_0xa983('0x135')});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x60')],{'as':_0xa983('0x149'),'through':'user_has_chat_websites'});db['User'][_0xa983('0x12f')](db['FaxAccount'],{'as':_0xa983('0x14a'),'through':_0xa983('0x14b')});db[_0xa983('0x11')][_0xa983('0x12f')](db[_0xa983('0x3b')],{'as':_0xa983('0x14c'),'through':_0xa983('0x14d')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0xa983('0x14e'),'through':_0xa983('0x14f')});db[_0xa983('0x11')][_0xa983('0x12f')](db['SmsAccount'],{'as':_0xa983('0x150'),'through':_0xa983('0x151')});db['User'][_0xa983('0x12f')](db[_0xa983('0x10a')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xa983('0x11')][_0xa983('0x12f')](db['SquareProject'],{'as':_0xa983('0x152'),'through':_0xa983('0x153')});db[_0xa983('0x14')][_0xa983('0x122')](db[_0xa983('0x16')],{'as':_0xa983('0x154'),'onDelete':'cascade','foreignKey':_0xa983('0x155')});db[_0xa983('0x156')][_0xa983('0x122')](db['VoiceExtension'],{'onDelete':_0xa983('0x120')});db[_0xa983('0x16')][_0xa983('0x122')](db[_0xa983('0x16')],{'as':'Applications','onDelete':_0xa983('0x120')});db['VoiceMusicOnHold'][_0xa983('0x12f')](db['Sound'],{'as':_0xa983('0x157'),'through':'moh_has_sounds'});db[_0xa983('0x13e')][_0xa983('0x122')](db[_0xa983('0x158')],{'as':_0xa983('0x159'),'foreignKey':_0xa983('0x15a')});db['VoiceQueue'][_0xa983('0x122')](db[_0xa983('0x15b')],{'as':_0xa983('0x15c'),'foreignKey':_0xa983('0x15a')});db[_0xa983('0x13e')][_0xa983('0x122')](db[_0xa983('0x126')],{'as':_0xa983('0x15d'),'foreignKey':'VoiceQueueId'});db[_0xa983('0x13e')][_0xa983('0x122')](db['CmHopperHistory'],{'as':_0xa983('0x15e'),'foreignKey':'VoiceQueueId'});db[_0xa983('0x13e')]['hasMany'](db['ReportAgentPreview'],{'as':_0xa983('0x78'),'foreignKey':_0xa983('0x15a')});db['VoiceQueue'][_0xa983('0x122')](db[_0xa983('0x15f')],{'as':_0xa983('0x160'),'foreignKey':_0xa983('0x15a')});db[_0xa983('0x13e')][_0xa983('0x122')](db[_0xa983('0x161')],{'as':_0xa983('0x162'),'foreignKey':'VoiceQueueId'});db[_0xa983('0x13e')][_0xa983('0x12d')](db[_0xa983('0x2a')],{'as':_0xa983('0x2a'),'foreignKey':'TrunkId'});db[_0xa983('0x13e')][_0xa983('0x12d')](db[_0xa983('0x2a')],{'as':_0xa983('0x163'),'foreignKey':_0xa983('0x164')});db['VoiceQueue'][_0xa983('0x12d')](db[_0xa983('0x85')],{'as':_0xa983('0x85'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x13e')][_0xa983('0x12d')](db[_0xa983('0x166')],{'as':_0xa983('0x167'),'foreignKey':_0xa983('0x168')});db[_0xa983('0x13e')][_0xa983('0x12f')](db[_0xa983('0x100')],{'as':_0xa983('0x134'),'through':_0xa983('0x169')});db[_0xa983('0x13e')][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':_0xa983('0x140')});db[_0xa983('0x13e')][_0xa983('0x12f')](db[_0xa983('0xf1')],{'as':_0xa983('0x16b'),'through':_0xa983('0x118')});db[_0xa983('0x13e')][_0xa983('0x12f')](db[_0xa983('0x100')],{'as':_0xa983('0x16c'),'through':_0xa983('0x16d')});db[_0xa983('0x1b')][_0xa983('0x12d')](db['User'],{'as':'User','foreignKey':_0xa983('0x121')});db['ScreenRecording'][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x11'),'foreignKey':_0xa983('0x121')});db[_0xa983('0x1e')][_0xa983('0x122')](db['VoiceMailMessage'],{'as':_0xa983('0x16e'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x16f'),'sourceKey':_0xa983('0x170')});db[_0xa983('0x20')][_0xa983('0x12d')](db['VoiceMail'],{'foreignKey':_0xa983('0x16f'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0xa983('0x26')],{'as':'QueueCalls','foreignKey':_0xa983('0x171'),'constraints':![]});db[_0xa983('0x22')]['hasMany'](db[_0xa983('0x172')],{'as':_0xa983('0x173'),'foreignKey':'uniqueid','constraints':![]});db[_0xa983('0x22')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x11'),'foreignKey':'UserId'});db['VoiceCallReport'][_0xa983('0x12d')](db['CmContact'],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175')});db[_0xa983('0x38')]['belongsTo'](db['MailAccount'],{'as':_0xa983('0x3b'),'foreignKey':_0xa983('0x176')});db[_0xa983('0x38')][_0xa983('0x12d')](db[_0xa983('0x116')],{'as':_0xa983('0x116'),'foreignKey':'CloudProviderId','onDelete':_0xa983('0x177')});db[_0xa983('0x3a')][_0xa983('0x12d')](db[_0xa983('0x3b')],{'as':_0xa983('0x3b'),'foreignKey':_0xa983('0x176')});db[_0xa983('0x3a')][_0xa983('0x12d')](db[_0xa983('0x116')],{'as':_0xa983('0x116'),'foreignKey':_0xa983('0x178'),'onDelete':_0xa983('0x177')});db[_0xa983('0x3b')]['hasOne'](db[_0xa983('0x38')],{'as':_0xa983('0x179'),'onDelete':_0xa983('0x120')});db[_0xa983('0x3b')][_0xa983('0x11f')](db[_0xa983('0x3a')],{'as':_0xa983('0x17a'),'onDelete':'cascade'});db[_0xa983('0x3b')][_0xa983('0x122')](db[_0xa983('0x81')],{'as':'Dispositions','foreignKey':_0xa983('0x176'),'onDelete':_0xa983('0x120')});db[_0xa983('0x3b')]['hasMany'](db['CannedAnswer'],{'as':_0xa983('0x17b'),'foreignKey':_0xa983('0x176')});db['MailAccount'][_0xa983('0x122')](db[_0xa983('0x3f')],{'as':'Messages','foreignKey':_0xa983('0x176')});db['MailAccount'][_0xa983('0x122')](db[_0xa983('0x12a')],{'as':_0xa983('0x17c')});db['MailAccount'][_0xa983('0x122')](db[_0xa983('0x41')],{'as':'Applications'});db[_0xa983('0x3b')][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':_0xa983('0x17d'),'foreignKey':_0xa983('0x17e')});db[_0xa983('0x3b')][_0xa983('0x12d')](db[_0xa983('0x92')],{'as':'Template','foreignKey':'TemplateId'});db['MailAccount'][_0xa983('0x12d')](db[_0xa983('0x166')],{'as':_0xa983('0x167'),'foreignKey':_0xa983('0x168')});db[_0xa983('0x3b')][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':_0xa983('0x14d')});db['MailQueue'][_0xa983('0x12f')](db['User'],{'as':'Agents','through':_0xa983('0x31')});db[_0xa983('0x17f')]['belongsToMany'](db[_0xa983('0xf1')],{'through':_0xa983('0x180'),'as':_0xa983('0x16b')});db[_0xa983('0x12a')]['hasMany'](db[_0xa983('0x3f')],{'as':_0xa983('0x16e'),'onDelete':'cascade','foreignKey':_0xa983('0x181')});db[_0xa983('0x12a')][_0xa983('0x12d')](db[_0xa983('0x3b')],{'as':'Account','foreignKey':_0xa983('0x176')});db[_0xa983('0x12a')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175')});db[_0xa983('0x12a')][_0xa983('0x12d')](db['User'],{'as':'Owner','foreignKey':_0xa983('0x121')});db[_0xa983('0x12a')][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x183'),'as':'Tags'});db[_0xa983('0x12a')][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x183'),'as':_0xa983('0x184')});db[_0xa983('0x12a')][_0xa983('0x12f')](db['User'],{'as':_0xa983('0x185'),'through':_0xa983('0x138'),'foreignKey':_0xa983('0x181')});db['MailMessage']['hasMany'](db[_0xa983('0x186')],{'as':_0xa983('0x187'),'onDelete':'cascade'});db['MailMessage'][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':'User'});db[_0xa983('0x3f')][_0xa983('0x12d')](db[_0xa983('0x72')],{'onDelete':_0xa983('0x120'),'as':_0xa983('0x174')});db[_0xa983('0x3f')]['belongsTo'](db[_0xa983('0x12a')],{'as':'Interaction','foreignKey':_0xa983('0x181')});db[_0xa983('0x3f')][_0xa983('0x12d')](db[_0xa983('0x3b')],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x176')});db[_0xa983('0x3f')][_0xa983('0x12d')](db[_0xa983('0x60')],{'as':_0xa983('0x60'),'foreignKey':'ChatWebsiteId'});db[_0xa983('0x3f')][_0xa983('0x12d')](db[_0xa983('0x69')],{'as':_0xa983('0x69'),'foreignKey':_0xa983('0x189')});db['MailApplication'][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':'restrict'});db[_0xa983('0x41')]['belongsTo'](db['MailQueue'],{'onDelete':_0xa983('0x177')});db[_0xa983('0x41')][_0xa983('0x12d')](db[_0xa983('0x3b')],{'onDelete':_0xa983('0x177')});db['MailApplication'][_0xa983('0x12d')](db[_0xa983('0x85')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x41')]['belongsTo'](db[_0xa983('0x182')],{'onDelete':'restrict','foreignKey':_0xa983('0x18a')});db[_0xa983('0x43')][_0xa983('0x12d')](db['MailAccount'],{});db['MailQueueReport'][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':_0xa983('0x17d'),'foreignKey':_0xa983('0x17e')});db[_0xa983('0x43')]['belongsTo'](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175')});db[_0xa983('0x43')][_0xa983('0x12d')](db[_0xa983('0x12a')],{});db['MailQueueReport'][_0xa983('0x12d')](db[_0xa983('0x3f')],{});db[_0xa983('0x43')][_0xa983('0x12d')](db[_0xa983('0x11')],{});db[_0xa983('0x43')][_0xa983('0x12d')](db[_0xa983('0x17f')],{});db[_0xa983('0x45')][_0xa983('0x122')](db['DashboardItem'],{'as':'Items','onDelete':_0xa983('0x120')});db['FaxAccount']['hasMany'](db[_0xa983('0x81')],{'as':_0xa983('0x18b'),'foreignKey':_0xa983('0x18c'),'onDelete':_0xa983('0x120')});db['FaxAccount'][_0xa983('0x122')](db[_0xa983('0x7f')],{'as':_0xa983('0x17b'),'foreignKey':_0xa983('0x18c')});db[_0xa983('0x48')][_0xa983('0x122')](db['FaxInteraction'],{'as':_0xa983('0x17c')});db[_0xa983('0x48')][_0xa983('0x122')](db[_0xa983('0x4a')],{'as':_0xa983('0x18d')});db['FaxAccount'][_0xa983('0x122')](db[_0xa983('0x16')],{'as':_0xa983('0x18e'),'onDelete':'cascade'});db[_0xa983('0x48')][_0xa983('0x122')](db[_0xa983('0x4d')],{'as':_0xa983('0x16e')});db['FaxAccount'][_0xa983('0x12d')](db[_0xa983('0x2a')],{'as':_0xa983('0x2a')});db[_0xa983('0x48')][_0xa983('0x12d')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xa983('0x48')][_0xa983('0x12d')](db[_0xa983('0x166')],{'as':_0xa983('0x167'),'foreignKey':_0xa983('0x168')});db['FaxAccount']['belongsToMany'](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':'user_has_fax_accounts'});db[_0xa983('0x4a')]['belongsTo'](db[_0xa983('0x11')],{'onDelete':_0xa983('0x177')});db[_0xa983('0x4a')]['belongsTo'](db[_0xa983('0x4f')],{'onDelete':_0xa983('0x177')});db[_0xa983('0x4a')][_0xa983('0x12d')](db[_0xa983('0x48')],{'onDelete':_0xa983('0x177')});db['FaxApplication'][_0xa983('0x12d')](db[_0xa983('0x182')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x18a')});db['FaxInteraction'][_0xa983('0x122')](db[_0xa983('0x4d')],{'as':_0xa983('0x16e'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0xa983('0x128')][_0xa983('0x12d')](db[_0xa983('0x48')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxInteraction'][_0xa983('0x12d')](db['CmContact'],{'as':_0xa983('0x174'),'foreignKey':'ContactId'});db[_0xa983('0x128')]['belongsTo'](db[_0xa983('0x11')],{'as':'Owner','foreignKey':'UserId'});db['FaxInteraction'][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x18f'),'as':'Tags'});db[_0xa983('0x128')][_0xa983('0x12f')](db['Tag'],{'through':_0xa983('0x18f'),'as':_0xa983('0x184')});db['FaxInteraction'][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':'Users','through':_0xa983('0x190'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':'cascade','as':_0xa983('0x11')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0xa983('0x4d')]['belongsTo'](db[_0xa983('0x72')],{'onDelete':_0xa983('0x120'),'as':_0xa983('0x174')});db['FaxMessage'][_0xa983('0x12d')](db['Attachment'],{'as':_0xa983('0x186'),'foreignKey':_0xa983('0x191')});db[_0xa983('0x4d')]['belongsTo'](db[_0xa983('0x48')],{'as':'Account','foreignKey':_0xa983('0x18c')});db[_0xa983('0x4f')][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':'UserFaxQueue'});db[_0xa983('0x4f')][_0xa983('0x12f')](db['Team'],{'through':_0xa983('0x192'),'as':_0xa983('0x16b')});db['FaxQueueReport'][_0xa983('0x12d')](db['FaxAccount'],{});db[_0xa983('0x51')][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':_0xa983('0x17d'),'foreignKey':'ListId'});db[_0xa983('0x51')][_0xa983('0x12d')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xa983('0x51')][_0xa983('0x12d')](db[_0xa983('0x128')],{});db['FaxQueueReport'][_0xa983('0x12d')](db[_0xa983('0x4d')],{});db['FaxQueueReport'][_0xa983('0x12d')](db['User'],{});db['FaxQueueReport'][_0xa983('0x12d')](db[_0xa983('0x4f')],{});db[_0xa983('0x193')]['hasMany'](db[_0xa983('0x81')],{'as':_0xa983('0x18b'),'foreignKey':_0xa983('0x194'),'onDelete':_0xa983('0x120')});db[_0xa983('0x193')][_0xa983('0x122')](db[_0xa983('0x7f')],{'as':_0xa983('0x17b'),'foreignKey':_0xa983('0x194')});db['SmsAccount'][_0xa983('0x122')](db[_0xa983('0x57')],{'as':_0xa983('0x16e'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0xa983('0x55')],{'as':_0xa983('0x17c')});db[_0xa983('0x193')][_0xa983('0x122')](db['SmsApplication'],{'as':'Applications'});db[_0xa983('0x193')][_0xa983('0x12d')](db['CmList'],{'as':_0xa983('0x17d'),'foreignKey':_0xa983('0x17e')});db[_0xa983('0x193')][_0xa983('0x12d')](db[_0xa983('0x166')],{'as':_0xa983('0x167'),'foreignKey':_0xa983('0x168')});db[_0xa983('0x193')]['belongsToMany'](db[_0xa983('0x11')],{'as':'Agents','through':'user_has_sms_accounts'});db[_0xa983('0x53')][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':'restrict'});db[_0xa983('0x53')][_0xa983('0x12d')](db['SmsQueue'],{'onDelete':_0xa983('0x177')});db[_0xa983('0x53')][_0xa983('0x12d')](db[_0xa983('0x193')],{'onDelete':_0xa983('0x177')});db[_0xa983('0x53')][_0xa983('0x12d')](db[_0xa983('0x85')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x53')][_0xa983('0x12d')](db[_0xa983('0x182')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x18a')});db[_0xa983('0x55')][_0xa983('0x122')](db['SmsMessage'],{'as':_0xa983('0x16e'),'onDelete':'cascade','foreignKey':_0xa983('0x195')});db['SmsInteraction'][_0xa983('0x12d')](db[_0xa983('0x193')],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x194')});db[_0xa983('0x55')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':'ContactId'});db['SmsInteraction'][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':'Owner','foreignKey':_0xa983('0x121')});db[_0xa983('0x55')][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':'sms_interaction_has_tags','as':_0xa983('0x196')});db[_0xa983('0x55')]['belongsToMany'](db[_0xa983('0x182')],{'through':_0xa983('0x197'),'as':_0xa983('0x184')});db['SmsInteraction'][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x185'),'through':'user_has_sms_interactions','foreignKey':_0xa983('0x195')});db[_0xa983('0x57')]['belongsTo'](db[_0xa983('0x11')],{'as':'User'});db[_0xa983('0x57')]['belongsTo'](db['CmContact'],{'onDelete':_0xa983('0x120'),'as':_0xa983('0x174')});db[_0xa983('0x57')]['belongsTo'](db[_0xa983('0x55')],{'onDelete':_0xa983('0x120'),'as':_0xa983('0x198'),'foreignKey':_0xa983('0x195')});db[_0xa983('0x57')][_0xa983('0x12d')](db[_0xa983('0x193')],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x194')});db[_0xa983('0x59')][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db['SmsQueue']['belongsToMany'](db[_0xa983('0xf1')],{'through':'team_has_sms_queues','as':_0xa983('0x16b')});db[_0xa983('0x5b')][_0xa983('0x122')](db[_0xa983('0x81')],{'as':_0xa983('0x18b'),'foreignKey':_0xa983('0x199'),'onDelete':'cascade'});db[_0xa983('0x5b')][_0xa983('0x122')](db[_0xa983('0x7f')],{'as':'Answers','foreignKey':_0xa983('0x199')});db[_0xa983('0x5b')][_0xa983('0x122')](db[_0xa983('0x5d')],{'as':_0xa983('0x17c'),'foreignKey':_0xa983('0x199')});db[_0xa983('0x5b')][_0xa983('0x122')](db[_0xa983('0x19a')],{'as':'Messages','foreignKey':_0xa983('0x199')});db[_0xa983('0x5b')][_0xa983('0x122')](db[_0xa983('0x19b')],{'as':_0xa983('0x18d'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':_0xa983('0x17d'),'foreignKey':_0xa983('0x17e')});db[_0xa983('0x5b')]['belongsTo'](db[_0xa983('0x166')],{'as':_0xa983('0x167'),'foreignKey':_0xa983('0x168')});db['OpenchannelAccount'][_0xa983('0x12f')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0xa983('0x19b')][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':_0xa983('0x177')});db[_0xa983('0x19b')][_0xa983('0x12d')](db['OpenchannelQueue'],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x19c')});db[_0xa983('0x19b')][_0xa983('0x12d')](db[_0xa983('0x5b')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x199')});db[_0xa983('0x19b')]['belongsTo'](db[_0xa983('0x85')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x19b')][_0xa983('0x12d')](db[_0xa983('0x182')],{'onDelete':_0xa983('0x177'),'foreignKey':'TagId'});db[_0xa983('0x5d')]['hasMany'](db['OpenchannelMessage'],{'as':_0xa983('0x16e'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x19d')});db[_0xa983('0x5d')][_0xa983('0x12d')](db[_0xa983('0x5b')],{'as':'Account','foreignKey':_0xa983('0x199')});db[_0xa983('0x5d')][_0xa983('0x12d')](db['CmContact'],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175')});db[_0xa983('0x5d')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x19e'),'foreignKey':_0xa983('0x121')});db['OpenchannelInteraction'][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x19f'),'as':_0xa983('0x196')});db['OpenchannelInteraction']['belongsToMany'](db[_0xa983('0x182')],{'through':_0xa983('0x19f'),'as':_0xa983('0x184')});db[_0xa983('0x5d')][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x185'),'through':_0xa983('0x13c'),'foreignKey':'OpenchannelInteractionId'});db[_0xa983('0x19a')][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':_0xa983('0x120'),'as':'User'});db[_0xa983('0x19a')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xa983('0x174')});db[_0xa983('0x19a')]['belongsTo'](db[_0xa983('0x5d')],{'onDelete':_0xa983('0x120'),'as':'Interaction','foreignKey':_0xa983('0x19d')});db[_0xa983('0x19a')][_0xa983('0x12d')](db[_0xa983('0x186')],{'as':_0xa983('0x186'),'foreignKey':_0xa983('0x191')});db[_0xa983('0x19a')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x199')});db[_0xa983('0x5f')]['belongsToMany'](db['User'],{'as':_0xa983('0x16a'),'through':_0xa983('0x147'),'foreignKey':'OpenchannelQueueId'});db[_0xa983('0x5f')]['belongsToMany'](db[_0xa983('0xf1')],{'through':_0xa983('0x1a0'),'as':_0xa983('0x16b')});db[_0xa983('0x60')]['hasMany'](db[_0xa983('0x81')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xa983('0x120')});db[_0xa983('0x60')][_0xa983('0x122')](db[_0xa983('0x7f')],{'as':_0xa983('0x17b'),'foreignKey':_0xa983('0x1a1')});db[_0xa983('0x60')][_0xa983('0x122')](db['ChatProactiveAction'],{'as':_0xa983('0x1a2')});db[_0xa983('0x60')]['hasMany'](db[_0xa983('0x65')],{'as':'Interactions'});db[_0xa983('0x60')][_0xa983('0x122')](db[_0xa983('0x64')],{'as':_0xa983('0x18d')});db[_0xa983('0x60')][_0xa983('0x122')](db[_0xa983('0x67')],{'as':_0xa983('0x16e')});db['ChatWebsite'][_0xa983('0x12d')](db['CmList'],{'as':_0xa983('0x17d'),'foreignKey':_0xa983('0x17e')});db[_0xa983('0x60')][_0xa983('0x12d')](db[_0xa983('0x85')],{'as':_0xa983('0x85'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x60')][_0xa983('0x12d')](db['MailAccount'],{'as':_0xa983('0x3b'),'foreignKey':'MailAccountId'});db[_0xa983('0x60')][_0xa983('0x12d')](db[_0xa983('0x166')],{'as':_0xa983('0x167'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa983('0x60')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xa983('0x1a3')});db[_0xa983('0x62')]['belongsTo'](db[_0xa983('0x5b')],{});db[_0xa983('0x62')][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':_0xa983('0x17d'),'foreignKey':'ListId'});db[_0xa983('0x62')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':'ContactId'});db[_0xa983('0x62')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xa983('0x12d')](db[_0xa983('0x19a')],{});db[_0xa983('0x62')][_0xa983('0x12d')](db[_0xa983('0x11')],{});db['OpenchannelQueueReport'][_0xa983('0x12d')](db['OpenchannelQueue'],{});db[_0xa983('0x64')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x1a4'),'foreignKey':'UserId','onDelete':_0xa983('0x177')});db[_0xa983('0x64')][_0xa983('0x12d')](db[_0xa983('0x6b')],{'as':_0xa983('0x1a5'),'foreignKey':_0xa983('0x1a6'),'onDelete':_0xa983('0x177')});db[_0xa983('0x64')][_0xa983('0x12d')](db[_0xa983('0x60')],{'as':_0xa983('0x1a7'),'foreignKey':_0xa983('0x1a1'),'onDelete':_0xa983('0x177')});db[_0xa983('0x64')][_0xa983('0x12d')](db[_0xa983('0x182')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x18a')});db[_0xa983('0x65')]['hasMany'](db['ChatMessage'],{'as':_0xa983('0x16e'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1a8')});db[_0xa983('0x65')]['belongsTo'](db['ChatWebsite'],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x1a1')});db[_0xa983('0x65')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0xa983('0x65')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x19e'),'foreignKey':'UserId'});db[_0xa983('0x65')][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x1a9'),'as':_0xa983('0x196')});db[_0xa983('0x65')][_0xa983('0x12f')](db['Tag'],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db['ChatInteraction'][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xa983('0x1a8')});db[_0xa983('0x67')][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':_0xa983('0x120'),'as':_0xa983('0x11')});db['ChatMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xa983('0x120'),'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175')});db['ChatMessage'][_0xa983('0x12d')](db['ChatInteraction'],{'onDelete':_0xa983('0x120'),'as':'Interaction','foreignKey':_0xa983('0x1a8')});db['ChatMessage'][_0xa983('0x12d')](db[_0xa983('0x186')],{'as':_0xa983('0x186'),'foreignKey':'AttachmentId'});db[_0xa983('0x67')][_0xa983('0x12d')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xa983('0x1a1')});db[_0xa983('0x69')][_0xa983('0x122')](db[_0xa983('0x186')],{'as':_0xa983('0x187'),'foreignKey':_0xa983('0x189'),'onDelete':_0xa983('0x120'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xa983('0x72')],{'onDelete':_0xa983('0x120'),'as':'Contact','foreignKey':_0xa983('0x175')});db['ChatOfflineMessage'][_0xa983('0x12d')](db[_0xa983('0x60')],{'as':_0xa983('0x188'),'foreignKey':'ChatWebsiteId'});db[_0xa983('0x6b')]['belongsToMany'](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':_0xa983('0x144'),'hooks':!![]});db[_0xa983('0x6b')]['belongsToMany'](db[_0xa983('0xf1')],{'through':'team_has_chat_queues','as':_0xa983('0x16b')});db['ChatGroup'][_0xa983('0x122')](db[_0xa983('0xd9')],{'as':'Messages','foreignKey':_0xa983('0x1aa'),'onDelete':_0xa983('0x120')});db['ChatGroup'][_0xa983('0x12f')](db['User'],{'as':_0xa983('0x159'),'through':'chat_group_has_users'});db[_0xa983('0x1ab')][_0xa983('0x12d')](db[_0xa983('0x60')],{'as':_0xa983('0x1a7'),'foreignKey':_0xa983('0x1a1')});db[_0xa983('0x70')]['hasMany'](db['CmContact'],{'as':_0xa983('0x132'),'foreignKey':'CompanyId'});db[_0xa983('0x72')]['hasMany'](db[_0xa983('0x1ac')],{'as':_0xa983('0x1ad'),'foreignKey':_0xa983('0x1ae')});db[_0xa983('0x72')][_0xa983('0x122')](db['CmHopper'],{'as':_0xa983('0x15c'),'foreignKey':'ContactId'});db[_0xa983('0x72')]['hasMany'](db[_0xa983('0x126')],{'as':_0xa983('0x15d'),'foreignKey':_0xa983('0x175')});db[_0xa983('0x72')][_0xa983('0x122')](db[_0xa983('0x76')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0xa983('0x72')][_0xa983('0x122')](db['ReportAgentPreview'],{'as':_0xa983('0x78'),'foreignKey':_0xa983('0x175')});db[_0xa983('0x72')][_0xa983('0x122')](db[_0xa983('0x161')],{'as':_0xa983('0x162'),'foreignKey':_0xa983('0x175')});db[_0xa983('0x72')][_0xa983('0x122')](db[_0xa983('0x5d')],{'as':_0xa983('0x13b'),'foreignKey':_0xa983('0x175'),'onDelete':'restrict'});db[_0xa983('0x72')][_0xa983('0x122')](db[_0xa983('0x65')],{'as':_0xa983('0x127'),'foreignKey':_0xa983('0x175'),'onDelete':'restrict'});db[_0xa983('0x72')][_0xa983('0x122')](db[_0xa983('0x55')],{'as':_0xa983('0x13a'),'foreignKey':'ContactId','onDelete':_0xa983('0x177')});db[_0xa983('0x72')][_0xa983('0x122')](db[_0xa983('0x128')],{'as':_0xa983('0x129'),'foreignKey':_0xa983('0x175'),'onDelete':'restrict'});db[_0xa983('0x72')][_0xa983('0x122')](db[_0xa983('0x12a')],{'as':_0xa983('0x137'),'foreignKey':'ContactId','onDelete':_0xa983('0x177')});db['CmContact']['belongsTo'](db['CmCompany'],{'as':_0xa983('0x1af'),'foreignKey':_0xa983('0x1b0')});db['CmContact'][_0xa983('0x12d')](db['CmList'],{'as':_0xa983('0x17d'),'foreignKey':_0xa983('0x17e'),'onDelete':'cascade'});db[_0xa983('0x72')][_0xa983('0x12f')](db['User'],{'as':_0xa983('0x185'),'through':_0xa983('0x133')});db[_0xa983('0x72')][_0xa983('0x12f')](db[_0xa983('0x182')],{'as':'Tags','through':_0xa983('0x1b1')});db['CmContact']['belongsToMany'](db[_0xa983('0x182')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xa983('0x15b')]['hasMany'](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':_0xa983('0x1b2')});db[_0xa983('0x15b')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175'),'onDelete':_0xa983('0x120')});db[_0xa983('0x15b')][_0xa983('0x12d')](db['CmList'],{'as':'List','foreignKey':_0xa983('0x17e'),'onDelete':_0xa983('0x120')});db[_0xa983('0x15b')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x1a4'),'foreignKey':_0xa983('0x121')});db[_0xa983('0x15b')]['belongsTo'](db[_0xa983('0x13e')],{'as':_0xa983('0x1a5'),'foreignKey':_0xa983('0x15a'),'onDelete':_0xa983('0x120')});db[_0xa983('0x15b')]['belongsTo'](db['Campaign'],{'as':_0xa983('0x1b3'),'foreignKey':_0xa983('0x1b4'),'onDelete':_0xa983('0x120')});db[_0xa983('0x15b')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x19e'),'foreignKey':_0xa983('0x1b5')});db[_0xa983('0x15f')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175'),'onDelete':_0xa983('0x120')});db[_0xa983('0x15f')][_0xa983('0x12d')](db['CmList'],{'as':_0xa983('0x17d'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xa983('0x15f')][_0xa983('0x12d')](db[_0xa983('0x13e')],{'as':_0xa983('0x1a5'),'foreignKey':_0xa983('0x15a'),'onDelete':_0xa983('0x120')});db[_0xa983('0x15f')][_0xa983('0x12d')](db['Campaign'],{'as':'Campaign','foreignKey':_0xa983('0x1b4'),'onDelete':'cascade'});db[_0xa983('0x7d')]['hasMany'](db[_0xa983('0x83')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xa983('0x1b6'),'onDelete':_0xa983('0x120'),'hooks':!![]});db[_0xa983('0x7d')][_0xa983('0x122')](db[_0xa983('0x83')],{'as':{'plural':_0xa983('0x1b7'),'singular':'OneAny'},'foreignKey':_0xa983('0x1b8'),'onDelete':'cascade','hooks':!![]});db[_0xa983('0x7d')][_0xa983('0x122')](db[_0xa983('0x7c')],{'as':'Actions','foreignKey':_0xa983('0x1b9'),'onDelete':_0xa983('0x120'),'hooks':!![]});db['Disposition']['hasMany'](db[_0xa983('0x81')],{'as':_0xa983('0x18b'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0xa983('0x85')][_0xa983('0x122')](db[_0xa983('0x85')],{'as':_0xa983('0x1ba'),'foreignKey':_0xa983('0x165'),'onDelete':_0xa983('0x120'),'hooks':!![],'required':![]});db['Interval'][_0xa983('0x122')](db[_0xa983('0x16')],{'as':_0xa983('0x125'),'foreignKey':_0xa983('0x165'),'onDelete':_0xa983('0x177')});db[_0xa983('0x85')][_0xa983('0x122')](db['MailApplication'],{'as':_0xa983('0x1bb'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x85')][_0xa983('0x122')](db['ChatApplication'],{'as':_0xa983('0x1bc'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x85')]['hasMany'](db[_0xa983('0x4a')],{'as':'FaxApplications','foreignKey':_0xa983('0x165')});db[_0xa983('0x85')]['hasMany'](db[_0xa983('0x53')],{'as':'SmsApplications','foreignKey':_0xa983('0x165')});db[_0xa983('0x1bd')][_0xa983('0x12d')](db['MailAccount'],{});db[_0xa983('0x1bd')][_0xa983('0x12d')](db[_0xa983('0x9c')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xa983('0x12d')](db[_0xa983('0x9a')],{'foreignKey':_0xa983('0x1be')});db[_0xa983('0x1bf')][_0xa983('0x12f')](db['VoiceMusicOnHold'],{'as':_0xa983('0x1c0'),'through':'moh_has_sounds','onDelete':_0xa983('0x177')});db['Tag'][_0xa983('0x12f')](db[_0xa983('0x72')],{'through':'cm_contact_has_tags'});db['Tag']['belongsToMany'](db['ChatInteraction'],{'through':_0xa983('0x1a9')});db['Tag'][_0xa983('0x12f')](db['MailInteraction'],{'through':_0xa983('0x183')});db[_0xa983('0x182')][_0xa983('0x12f')](db[_0xa983('0x55')],{'through':_0xa983('0x197')});db[_0xa983('0x182')][_0xa983('0x12f')](db[_0xa983('0x128')],{'through':'fax_interaction_has_tags'});db[_0xa983('0x182')][_0xa983('0x12f')](db[_0xa983('0x5d')],{'through':_0xa983('0x19f')});db[_0xa983('0x182')][_0xa983('0x12f')](db[_0xa983('0x10e')],{'through':_0xa983('0x1c1')});db[_0xa983('0x1ac')][_0xa983('0x12d')](db[_0xa983('0x8d')],{'as':'ItemType','foreignKey':_0xa983('0x1c2')});db[_0xa983('0x90')][_0xa983('0x12d')](db[_0xa983('0x15b')],{'as':_0xa983('0x1c3'),'foreignKey':'CmHopperId'});db[_0xa983('0x1ac')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x1ae')});db[_0xa983('0x93')][_0xa983('0x122')](db[_0xa983('0x83')],{'as':{'plural':_0xa983('0x1c4'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xa983('0x93')][_0xa983('0x122')](db[_0xa983('0x83')],{'as':{'plural':_0xa983('0x1c5'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0xa983('0x93')][_0xa983('0x122')](db[_0xa983('0x7c')],{'as':_0xa983('0x1c6'),'foreignKey':_0xa983('0x1c7'),'onDelete':_0xa983('0x120'),'hooks':!![]});db[_0xa983('0x9a')][_0xa983('0x122')](db[_0xa983('0x1c8')],{'as':'Fields','onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1be'),'hooks':!![]});db[_0xa983('0x9c')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xa983('0x1c9'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1ca')});db[_0xa983('0xa0')][_0xa983('0x122')](db[_0xa983('0x1c8')],{'as':_0xa983('0x1c9'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cb')});db[_0xa983('0x1c8')][_0xa983('0x12d')](db[_0xa983('0xa0')],{'foreignKey':_0xa983('0x1cb')});db[_0xa983('0xa4')][_0xa983('0x122')](db['SalesforceConfiguration'],{'as':_0xa983('0x1cc'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0xa6')][_0xa983('0x122')](db[_0xa983('0x1ce')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xa983('0x1cf')});db['SalesforceConfiguration']['hasMany'](db[_0xa983('0x1ce')],{'as':_0xa983('0x1d0'),'onDelete':'cascade','foreignKey':_0xa983('0x1d1')});db[_0xa983('0xa6')][_0xa983('0x122')](db['SalesforceField'],{'as':_0xa983('0x1c9'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xa6')][_0xa983('0x12d')](db['SalesforceAccount'],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x1cd')});db['SalesforceField'][_0xa983('0x122')](db[_0xa983('0x1ce')],{'as':_0xa983('0x1d3'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0x1ce')][_0xa983('0x122')](db['SalesforceField'],{'as':'Description','foreignKey':_0xa983('0x1d1')});db[_0xa983('0x1ce')][_0xa983('0x122')](db[_0xa983('0x1ce')],{'as':_0xa983('0x1d4'),'foreignKey':'FieldId'});db[_0xa983('0x1ce')]['belongsTo'](db[_0xa983('0x95')],{'as':'Variable','foreignKey':_0xa983('0x1d5')});db['SugarcrmAccount'][_0xa983('0x122')](db[_0xa983('0xaa')],{'as':_0xa983('0x1cc'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa983('0xaa')]['hasMany'](db[_0xa983('0xac')],{'as':_0xa983('0x1d6'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xaa')]['hasMany'](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1d1')});db['SugarcrmConfiguration'][_0xa983('0x122')](db[_0xa983('0xac')],{'as':_0xa983('0x1c9'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xaa')][_0xa983('0x12d')](db[_0xa983('0xa9')],{'as':_0xa983('0x188'),'foreignKey':'AccountId'});db[_0xa983('0xac')]['hasMany'](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa983('0xac')][_0xa983('0x122')](db[_0xa983('0xac')],{'as':_0xa983('0x1d7'),'foreignKey':_0xa983('0x1d1')});db['SugarcrmField'][_0xa983('0x122')](db['SugarcrmField'],{'as':'Field','foreignKey':_0xa983('0x1d2')});db[_0xa983('0xac')][_0xa983('0x12d')](db[_0xa983('0x95')],{'as':_0xa983('0x95'),'foreignKey':_0xa983('0x1d5')});db[_0xa983('0xae')][_0xa983('0x122')](db[_0xa983('0xb0')],{'as':_0xa983('0x1cc'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0xb0')][_0xa983('0x122')](db[_0xa983('0xb2')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xa983('0x1cf')});db[_0xa983('0xb0')][_0xa983('0x122')](db['DeskField'],{'as':_0xa983('0x1d0'),'onDelete':_0xa983('0x120'),'foreignKey':'DescriptionId'});db[_0xa983('0xb0')][_0xa983('0x122')](db[_0xa983('0xb2')],{'as':_0xa983('0x1c9'),'onDelete':'cascade','foreignKey':_0xa983('0x1d2')});db['DeskConfiguration'][_0xa983('0x12d')](db['DeskAccount'],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0xb0')]['belongsToMany'](db[_0xa983('0x182')],{'through':_0xa983('0x1d8')});db[_0xa983('0xb2')][_0xa983('0x122')](db[_0xa983('0xb2')],{'as':_0xa983('0x1d3'),'foreignKey':'SubjectId'});db[_0xa983('0xb2')][_0xa983('0x122')](db[_0xa983('0xb2')],{'as':_0xa983('0x1d7'),'foreignKey':_0xa983('0x1d1')});db[_0xa983('0xb2')][_0xa983('0x122')](db[_0xa983('0xb2')],{'as':_0xa983('0x1d4'),'foreignKey':'FieldId'});db[_0xa983('0xb2')][_0xa983('0x12d')](db[_0xa983('0x95')],{'as':_0xa983('0x95'),'foreignKey':'VariableId'});db[_0xa983('0xb4')]['hasMany'](db[_0xa983('0xb6')],{'as':'Configurations','onDelete':_0xa983('0x120'),'foreignKey':'AccountId'});db[_0xa983('0xb6')][_0xa983('0x122')](db[_0xa983('0xb8')],{'as':_0xa983('0x1d6'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xb6')][_0xa983('0x122')](db[_0xa983('0xb8')],{'as':_0xa983('0x1d0'),'onDelete':'cascade','foreignKey':_0xa983('0x1d1')});db[_0xa983('0xb6')][_0xa983('0x122')](db[_0xa983('0xb8')],{'as':_0xa983('0x1c9'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xb6')][_0xa983('0x12d')](db[_0xa983('0xb4')],{'as':_0xa983('0x188'),'foreignKey':'AccountId'});db[_0xa983('0xb8')][_0xa983('0x122')](db[_0xa983('0xb8')],{'as':_0xa983('0x1d3'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xb8')][_0xa983('0x122')](db[_0xa983('0xb8')],{'as':_0xa983('0x1d7'),'foreignKey':'DescriptionId'});db['ZohoField'][_0xa983('0x122')](db['ZohoField'],{'as':_0xa983('0x1d4'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xb8')]['belongsTo'](db['Variable'],{'as':_0xa983('0x95'),'foreignKey':'VariableId'});db[_0xa983('0xb9')][_0xa983('0x122')](db['ZendeskConfiguration'],{'as':_0xa983('0x1cc'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0xbb')][_0xa983('0x122')](db['ZendeskField'],{'as':_0xa983('0x1d6'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xbb')]['hasMany'](db[_0xa983('0xbd')],{'as':_0xa983('0x1d0'),'foreignKey':_0xa983('0x1d1')});db[_0xa983('0xbb')][_0xa983('0x122')](db[_0xa983('0xbd')],{'as':_0xa983('0x1c9'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xbb')]['belongsTo'](db[_0xa983('0xb9')],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0xbb')][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x1d9')});db[_0xa983('0xbd')][_0xa983('0x122')](db[_0xa983('0xbd')],{'as':_0xa983('0x1d3'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xbd')][_0xa983('0x122')](db[_0xa983('0xbd')],{'as':_0xa983('0x1d7'),'foreignKey':_0xa983('0x1d1')});db[_0xa983('0xbd')][_0xa983('0x122')](db['ZendeskField'],{'as':_0xa983('0x1d4'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xbd')]['belongsTo'](db[_0xa983('0x95')],{'as':'Variable','foreignKey':_0xa983('0x1d5')});db['FreshdeskAccount'][_0xa983('0x122')](db[_0xa983('0x1da')],{'as':_0xa983('0x1cc'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0x1da')]['hasMany'](db['FreshdeskField'],{'as':_0xa983('0x1d6'),'onDelete':_0xa983('0x120'),'foreignKey':'SubjectId'});db[_0xa983('0x1da')][_0xa983('0x122')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1d1')});db[_0xa983('0x1da')]['hasMany'](db[_0xa983('0x1db')],{'as':_0xa983('0x1c9'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0x1da')][_0xa983('0x12d')](db[_0xa983('0x1dc')],{'as':'Account','foreignKey':_0xa983('0x1cd')});db['FreshdeskConfiguration'][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x1dd')});db[_0xa983('0x1db')][_0xa983('0x122')](db[_0xa983('0x1db')],{'as':_0xa983('0x1d3'),'foreignKey':'SubjectId'});db[_0xa983('0x1db')][_0xa983('0x122')](db[_0xa983('0x1db')],{'as':'Description','foreignKey':_0xa983('0x1d1')});db[_0xa983('0x1db')][_0xa983('0x122')](db[_0xa983('0x1db')],{'as':_0xa983('0x1d4'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0x1db')][_0xa983('0x12d')](db[_0xa983('0x95')],{'as':_0xa983('0x95'),'foreignKey':_0xa983('0x1d5')});db[_0xa983('0xc0')][_0xa983('0x122')](db[_0xa983('0xc2')],{'as':_0xa983('0x1cc'),'onDelete':'cascade','foreignKey':_0xa983('0x1cd')});db[_0xa983('0xc2')][_0xa983('0x122')](db['VtigerField'],{'as':_0xa983('0x1d6'),'foreignKey':'SubjectId'});db[_0xa983('0xc2')][_0xa983('0x122')](db[_0xa983('0xc4')],{'as':_0xa983('0x1d0'),'foreignKey':_0xa983('0x1d1')});db[_0xa983('0xc2')][_0xa983('0x122')](db[_0xa983('0xc4')],{'as':_0xa983('0x1c9'),'foreignKey':'FieldId'});db[_0xa983('0xc2')][_0xa983('0x12d')](db['VtigerAccount'],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0xc4')]['hasMany'](db['VtigerField'],{'as':_0xa983('0x1d3'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xc4')][_0xa983('0x122')](db[_0xa983('0xc4')],{'as':_0xa983('0x1d7'),'foreignKey':'DescriptionId'});db[_0xa983('0xc4')]['hasMany'](db['VtigerField'],{'as':_0xa983('0x1d4'),'foreignKey':_0xa983('0x1d2')});db['VtigerField']['belongsTo'](db[_0xa983('0x95')],{'as':_0xa983('0x95'),'foreignKey':_0xa983('0x1d5')});db[_0xa983('0xc6')][_0xa983('0x122')](db[_0xa983('0xc7')],{'as':_0xa983('0x1cc'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0xc7')][_0xa983('0x122')](db['ServicenowField'],{'as':_0xa983('0x1d6'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xc7')]['hasMany'](db[_0xa983('0xc9')],{'as':_0xa983('0x1d0'),'foreignKey':_0xa983('0x1d1')});db['ServicenowConfiguration']['hasMany'](db[_0xa983('0xc9')],{'as':_0xa983('0x1c9'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xc7')]['belongsTo'](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xa983('0x1cd')});db['ServicenowField'][_0xa983('0x122')](db[_0xa983('0xc9')],{'as':_0xa983('0x1d3'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xc9')][_0xa983('0x122')](db[_0xa983('0xc9')],{'as':_0xa983('0x1d7'),'foreignKey':_0xa983('0x1d1')});db['ServicenowField'][_0xa983('0x122')](db[_0xa983('0xc9')],{'as':_0xa983('0x1d4'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xc9')]['belongsTo'](db[_0xa983('0x95')],{'as':_0xa983('0x95'),'foreignKey':_0xa983('0x1d5')});db[_0xa983('0x1de')][_0xa983('0x122')](db[_0xa983('0xcc')],{'as':_0xa983('0x1cc'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1cd')});db[_0xa983('0x1de')][_0xa983('0x12d')](db[_0xa983('0x116')],{'as':_0xa983('0x116'),'foreignKey':_0xa983('0x178')});db[_0xa983('0xcc')][_0xa983('0x122')](db[_0xa983('0xce')],{'as':_0xa983('0x1d6'),'onDelete':'cascade','foreignKey':_0xa983('0x1cf')});db['Dynamics365Configuration'][_0xa983('0x122')](db[_0xa983('0xce')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xa983('0x1d1')});db[_0xa983('0xcc')][_0xa983('0x122')](db[_0xa983('0xce')],{'as':'Fields','onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xcc')][_0xa983('0x12d')](db[_0xa983('0x1de')],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x1cd')});db['Dynamics365Field'][_0xa983('0x122')](db[_0xa983('0xce')],{'as':'Subject','foreignKey':_0xa983('0x1cf')});db[_0xa983('0xce')][_0xa983('0x122')](db[_0xa983('0xce')],{'as':'Description','foreignKey':_0xa983('0x1d1')});db[_0xa983('0xce')][_0xa983('0x122')](db[_0xa983('0xce')],{'as':_0xa983('0x1d4'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xce')][_0xa983('0x12d')](db[_0xa983('0x95')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa983('0xcf')][_0xa983('0x122')](db[_0xa983('0xd1')],{'as':_0xa983('0x1cc'),'onDelete':'cascade','foreignKey':_0xa983('0x1cd')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0xa983('0x1d6'),'foreignKey':'SubjectId'});db[_0xa983('0xd1')]['hasMany'](db['FreshsalesField'],{'as':_0xa983('0x1d0'),'foreignKey':'DescriptionId'});db[_0xa983('0xd1')][_0xa983('0x122')](db[_0xa983('0xd3')],{'as':_0xa983('0x1c9'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xd1')][_0xa983('0x12d')](db[_0xa983('0xcf')],{'as':'Account','foreignKey':_0xa983('0x1cd')});db[_0xa983('0xd3')][_0xa983('0x122')](db[_0xa983('0xd3')],{'as':_0xa983('0x1d3'),'foreignKey':_0xa983('0x1cf')});db[_0xa983('0xd3')][_0xa983('0x122')](db[_0xa983('0xd3')],{'as':_0xa983('0x1d7'),'foreignKey':_0xa983('0x1d1')});db['FreshsalesField'][_0xa983('0x122')](db[_0xa983('0xd3')],{'as':_0xa983('0x1d4'),'foreignKey':_0xa983('0x1d2')});db[_0xa983('0xd3')]['belongsTo'](db[_0xa983('0x95')],{'as':_0xa983('0x95'),'foreignKey':'VariableId'});db[_0xa983('0xd7')][_0xa983('0x12d')](db[_0xa983('0x60')],{});db[_0xa983('0xd7')][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':'List','foreignKey':_0xa983('0x17e')});db[_0xa983('0xd7')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':'ContactId'});db[_0xa983('0xd7')][_0xa983('0x12d')](db[_0xa983('0x65')],{});db[_0xa983('0xd7')][_0xa983('0x12d')](db[_0xa983('0x67')],{});db[_0xa983('0xd7')][_0xa983('0x12d')](db[_0xa983('0x11')],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db[_0xa983('0xd9')][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1df')});db[_0xa983('0xd9')][_0xa983('0x12d')](db[_0xa983('0x11')],{'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x1e0')});db[_0xa983('0x161')][_0xa983('0x122')](db[_0xa983('0xdd')],{'foreignKey':'SessionId','onDelete':_0xa983('0x120')});db[_0xa983('0x161')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xa983('0x1e1'),'onDelete':'cascade'});db[_0xa983('0xe0')][_0xa983('0x12d')](db[_0xa983('0x193')],{});db['SmsQueueReport'][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':'List','foreignKey':'ListId'});db[_0xa983('0xe0')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':'ContactId'});db[_0xa983('0xe0')][_0xa983('0x12d')](db[_0xa983('0x55')],{});db[_0xa983('0xe0')]['belongsTo'](db[_0xa983('0x57')],{});db[_0xa983('0xe0')][_0xa983('0x12d')](db[_0xa983('0x11')],{});db[_0xa983('0xe0')][_0xa983('0x12d')](db['SmsQueue'],{});db[_0xa983('0xe6')][_0xa983('0x122')](db[_0xa983('0x161')],{'foreignKey':_0xa983('0x1e2')});db[_0xa983('0xe6')][_0xa983('0x122')](db[_0xa983('0xdd')],{'foreignKey':_0xa983('0x1e2')});db[_0xa983('0xe6')][_0xa983('0x122')](db[_0xa983('0xdb')],{'foreignKey':'ProjectId'});db[_0xa983('0xeb')]['belongsToMany'](db[_0xa983('0x11')],{'as':'Users','through':_0xa983('0x153')});db[_0xa983('0xf1')][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':_0xa983('0x136')});db['Team'][_0xa983('0x12f')](db[_0xa983('0x13e')],{'through':_0xa983('0x118'),'as':'VoiceQueues'});db[_0xa983('0xf1')][_0xa983('0x12f')](db[_0xa983('0x17f')],{'through':_0xa983('0x180'),'as':'MailQueues'});db[_0xa983('0xf1')][_0xa983('0x12f')](db[_0xa983('0x6b')],{'through':_0xa983('0x1e3'),'as':_0xa983('0x143')});db[_0xa983('0xf1')][_0xa983('0x12f')](db['FaxQueue'],{'through':_0xa983('0x192'),'as':_0xa983('0x145')});db[_0xa983('0xf1')][_0xa983('0x12f')](db[_0xa983('0x59')],{'through':_0xa983('0x1e4'),'as':_0xa983('0x1e5')});db[_0xa983('0xf1')][_0xa983('0x12f')](db[_0xa983('0x5f')],{'through':'team_has_openchannel_queues','as':_0xa983('0x146')});db[_0xa983('0xf1')][_0xa983('0x12f')](db[_0xa983('0x114')],{'through':_0xa983('0x1e6'),'as':_0xa983('0x1e7')});db['Team']['belongsToMany'](db[_0xa983('0x102')],{'through':'TeamVoicePrefix','as':_0xa983('0x141')});db[_0xa983('0x1b3')][_0xa983('0x122')](db[_0xa983('0x15b')],{'as':_0xa983('0x15c'),'foreignKey':_0xa983('0x1b4')});db[_0xa983('0x1b3')][_0xa983('0x122')](db['CmHopperFinal'],{'as':_0xa983('0x15d'),'foreignKey':'CampaignId'});db[_0xa983('0x1b3')][_0xa983('0x122')](db[_0xa983('0x76')],{'as':'HopperHistories','foreignKey':_0xa983('0x1b4')});db[_0xa983('0x1b3')][_0xa983('0x122')](db[_0xa983('0x15f')],{'as':_0xa983('0x160'),'foreignKey':'CampaignId'});db['Campaign'][_0xa983('0x12d')](db[_0xa983('0x2a')],{'as':_0xa983('0x2a'),'foreignKey':_0xa983('0x1e8')});db[_0xa983('0x1b3')][_0xa983('0x12d')](db[_0xa983('0x2a')],{'as':'TrunkBackup','foreignKey':_0xa983('0x164')});db[_0xa983('0x1b3')][_0xa983('0x12d')](db[_0xa983('0x85')],{'as':_0xa983('0x85'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x1b3')][_0xa983('0x12d')](db[_0xa983('0xeb')],{'as':_0xa983('0xeb'),'foreignKey':'SquareProjectId'});db[_0xa983('0x1b3')][_0xa983('0x12f')](db[_0xa983('0x100')],{'as':'Lists','through':_0xa983('0x1e9')});db[_0xa983('0x1b3')][_0xa983('0x12f')](db[_0xa983('0x100')],{'as':'BlackLists','through':_0xa983('0x1ea')});db[_0xa983('0x186')][_0xa983('0x12d')](db[_0xa983('0x69')],{'as':_0xa983('0x69'),'foreignKey':'ChatOfflineMessageId'});db[_0xa983('0x1eb')]['belongsTo'](db[_0xa983('0x3f')],{});db[_0xa983('0x1eb')]['belongsTo'](db[_0xa983('0x12a')],{});db['MailTransferReport'][_0xa983('0x12d')](db[_0xa983('0x3b')],{'foreignKey':_0xa983('0x1ec'),'as':'FromAccount'});db[_0xa983('0x1eb')][_0xa983('0x12d')](db['User'],{'foreignKey':_0xa983('0x1ed'),'as':_0xa983('0x1ee')});db[_0xa983('0x1eb')][_0xa983('0x12d')](db[_0xa983('0x11')],{'foreignKey':'ToUserId','as':_0xa983('0x1ef')});db[_0xa983('0x1eb')][_0xa983('0x12d')](db[_0xa983('0x17f')],{'foreignKey':_0xa983('0x1f0'),'as':_0xa983('0x1f1')});db[_0xa983('0x1eb')][_0xa983('0x12d')](db['MailAccount'],{'foreignKey':_0xa983('0x1f2'),'as':_0xa983('0x1f3')});db[_0xa983('0xfa')][_0xa983('0x12d')](db[_0xa983('0x67')],{});db[_0xa983('0xfa')][_0xa983('0x12d')](db[_0xa983('0x65')],{});db[_0xa983('0xfa')][_0xa983('0x12d')](db[_0xa983('0x60')],{'foreignKey':_0xa983('0x1f4'),'as':_0xa983('0x1f5')});db['ChatTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xa983('0x1ed'),'as':'FromAgent'});db['ChatTransferReport'][_0xa983('0x12d')](db[_0xa983('0x11')],{'foreignKey':'ToUserId','as':_0xa983('0x1ef')});db[_0xa983('0xfa')][_0xa983('0x12d')](db[_0xa983('0x6b')],{'foreignKey':_0xa983('0x1f6'),'as':_0xa983('0x1f1')});db[_0xa983('0xfa')][_0xa983('0x12d')](db[_0xa983('0x60')],{'foreignKey':_0xa983('0x1f7'),'as':_0xa983('0x1f3')});db[_0xa983('0xfc')][_0xa983('0x12d')](db[_0xa983('0x4d')],{});db['FaxTransferReport'][_0xa983('0x12d')](db[_0xa983('0x128')],{});db[_0xa983('0xfc')][_0xa983('0x12d')](db[_0xa983('0x48')],{'foreignKey':_0xa983('0x1f8'),'as':_0xa983('0x1f5')});db[_0xa983('0xfc')]['belongsTo'](db[_0xa983('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa983('0xfc')][_0xa983('0x12d')](db['User'],{'foreignKey':_0xa983('0x1f9'),'as':_0xa983('0x1ef')});db[_0xa983('0xfc')][_0xa983('0x12d')](db[_0xa983('0x4f')],{'foreignKey':_0xa983('0x1fa'),'as':_0xa983('0x1f1')});db['FaxTransferReport'][_0xa983('0x12d')](db[_0xa983('0x48')],{'foreignKey':_0xa983('0x1fb'),'as':_0xa983('0x1f3')});db[_0xa983('0xfd')][_0xa983('0x12d')](db[_0xa983('0x19a')],{});db[_0xa983('0xfd')][_0xa983('0x12d')](db[_0xa983('0x5d')],{});db['OpenchannelTransferReport'][_0xa983('0x12d')](db['OpenchannelAccount'],{'foreignKey':_0xa983('0x1fc'),'as':_0xa983('0x1f5')});db['OpenchannelTransferReport'][_0xa983('0x12d')](db[_0xa983('0x11')],{'foreignKey':_0xa983('0x1ed'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0xa983('0x12d')](db[_0xa983('0x11')],{'foreignKey':_0xa983('0x1f9'),'as':_0xa983('0x1ef')});db[_0xa983('0xfd')][_0xa983('0x12d')](db[_0xa983('0x5f')],{'foreignKey':_0xa983('0x1fd'),'as':_0xa983('0x1f1')});db[_0xa983('0xfd')][_0xa983('0x12d')](db[_0xa983('0x5b')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xa983('0xff')][_0xa983('0x12d')](db[_0xa983('0x57')],{});db[_0xa983('0xff')][_0xa983('0x12d')](db['SmsInteraction'],{});db[_0xa983('0xff')][_0xa983('0x12d')](db[_0xa983('0x193')],{'foreignKey':_0xa983('0x1fe'),'as':_0xa983('0x1f5')});db['SmsTransferReport'][_0xa983('0x12d')](db['User'],{'foreignKey':_0xa983('0x1ed'),'as':_0xa983('0x1ee')});db[_0xa983('0xff')]['belongsTo'](db[_0xa983('0x11')],{'foreignKey':'ToUserId','as':_0xa983('0x1ef')});db[_0xa983('0xff')][_0xa983('0x12d')](db['SmsQueue'],{'foreignKey':_0xa983('0x1ff'),'as':_0xa983('0x1f1')});db['SmsTransferReport'][_0xa983('0x12d')](db[_0xa983('0x193')],{'foreignKey':_0xa983('0x200'),'as':_0xa983('0x1f3')});db[_0xa983('0x100')]['hasMany'](db[_0xa983('0x81')],{'as':_0xa983('0x18b'),'foreignKey':_0xa983('0x17e'),'onDelete':'cascade'});db[_0xa983('0x100')][_0xa983('0x122')](db[_0xa983('0x7a')],{'as':'CustomFields','foreignKey':_0xa983('0x17e')});db[_0xa983('0x100')]['hasMany'](db[_0xa983('0x72')],{'as':_0xa983('0x132'),'onDelete':_0xa983('0x120'),'foreignKey':_0xa983('0x17e')});db[_0xa983('0x100')][_0xa983('0x122')](db[_0xa983('0x126')],{'as':_0xa983('0x15d'),'foreignKey':'ListId'});db['CmList'][_0xa983('0x122')](db['CmHopperHistory'],{'as':_0xa983('0x201'),'foreignKey':'ListId'});db['CmList'][_0xa983('0x122')](db['ReportAgentPreview'],{'as':_0xa983('0x78'),'foreignKey':'ListId'});db['CmList'][_0xa983('0x12f')](db['VoiceQueue'],{'as':'Queues','through':_0xa983('0x169')});db[_0xa983('0x100')][_0xa983('0x12f')](db['User'],{'as':_0xa983('0x16a'),'through':_0xa983('0x135')});db[_0xa983('0x102')]['hasMany'](db[_0xa983('0x16')],{'as':_0xa983('0x125'),'onDelete':_0xa983('0x120')});db[_0xa983('0x102')][_0xa983('0x12f')](db['User'],{'as':_0xa983('0x16a'),'through':_0xa983('0x11c')});db[_0xa983('0x102')][_0xa983('0x12f')](db[_0xa983('0xf1')],{'through':_0xa983('0x11a'),'as':_0xa983('0x16b')});db[_0xa983('0x104')]['hasMany'](db[_0xa983('0x11')],{'as':_0xa983('0x185'),'foreignKey':_0xa983('0x12e')});db[_0xa983('0x104')]['hasMany'](db[_0xa983('0x105')],{'as':_0xa983('0x202'),'foreignKey':_0xa983('0x12e'),'onDelete':_0xa983('0x120')});db[_0xa983('0x105')][_0xa983('0x122')](db[_0xa983('0x107')],{'as':_0xa983('0x203'),'foreignKey':_0xa983('0x204'),'onDelete':_0xa983('0x120')});db[_0xa983('0x10a')][_0xa983('0x122')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa983('0x205'),'onDelete':_0xa983('0x120')});db[_0xa983('0x10a')][_0xa983('0x122')](db[_0xa983('0x7f')],{'as':_0xa983('0x17b'),'foreignKey':_0xa983('0x205')});db[_0xa983('0x10a')][_0xa983('0x122')](db['WhatsappMessage'],{'as':_0xa983('0x16e'),'foreignKey':'WhatsappAccountId'});db[_0xa983('0x10a')][_0xa983('0x122')](db[_0xa983('0x10e')],{'as':'Interactions'});db[_0xa983('0x10a')][_0xa983('0x122')](db[_0xa983('0x10c')],{'as':_0xa983('0x18d')});db['WhatsappAccount'][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':_0xa983('0x17d'),'foreignKey':'ListId'});db[_0xa983('0x10a')][_0xa983('0x12d')](db[_0xa983('0x166')],{'as':_0xa983('0x167'),'foreignKey':_0xa983('0x168')});db[_0xa983('0x10a')]['belongsToMany'](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':_0xa983('0x206')});db[_0xa983('0x10c')][_0xa983('0x12d')](db['User'],{'onDelete':_0xa983('0x177')});db['WhatsappApplication'][_0xa983('0x12d')](db[_0xa983('0x114')],{'onDelete':_0xa983('0x177')});db['WhatsappApplication'][_0xa983('0x12d')](db['WhatsappAccount'],{'onDelete':_0xa983('0x177')});db[_0xa983('0x10c')][_0xa983('0x12d')](db[_0xa983('0x85')],{'onDelete':_0xa983('0x177'),'foreignKey':_0xa983('0x165')});db[_0xa983('0x10c')][_0xa983('0x12d')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa983('0x18a')});db[_0xa983('0x10e')][_0xa983('0x122')](db[_0xa983('0x110')],{'as':_0xa983('0x16e'),'onDelete':_0xa983('0x120'),'foreignKey':'WhatsappInteractionId'});db[_0xa983('0x10e')][_0xa983('0x12d')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xa983('0x10e')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':'ContactId'});db[_0xa983('0x10e')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':_0xa983('0x19e'),'foreignKey':'UserId'});db[_0xa983('0x10e')][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x1c1'),'as':_0xa983('0x196')});db[_0xa983('0x10e')][_0xa983('0x12f')](db[_0xa983('0x182')],{'through':_0xa983('0x1c1'),'as':'ThroughTags'});db[_0xa983('0x10e')][_0xa983('0x12f')](db[_0xa983('0x11')],{'as':_0xa983('0x185'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0xa983('0x110')]['belongsTo'](db[_0xa983('0x11')],{'as':_0xa983('0x11')});db[_0xa983('0x110')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0xa983('0x110')][_0xa983('0x12d')](db['WhatsappInteraction'],{'onDelete':_0xa983('0x120'),'as':_0xa983('0x198'),'foreignKey':_0xa983('0x207')});db[_0xa983('0x110')][_0xa983('0x12d')](db[_0xa983('0x10a')],{'as':_0xa983('0x188'),'foreignKey':_0xa983('0x205')});db[_0xa983('0x208')][_0xa983('0x12d')](db['WhatsappAccount'],{});db[_0xa983('0x208')][_0xa983('0x12d')](db[_0xa983('0x100')],{'as':_0xa983('0x17d'),'foreignKey':_0xa983('0x17e')});db[_0xa983('0x208')][_0xa983('0x12d')](db[_0xa983('0x72')],{'as':_0xa983('0x174'),'foreignKey':_0xa983('0x175')});db['WhatsappQueueReport']['belongsTo'](db[_0xa983('0x10e')],{});db[_0xa983('0x208')][_0xa983('0x12d')](db[_0xa983('0x114')],{});db[_0xa983('0x208')][_0xa983('0x12d')](db[_0xa983('0x110')],{});db['WhatsappQueueReport'][_0xa983('0x12d')](db[_0xa983('0x11')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xa983('0x110')],{});db[_0xa983('0x112')][_0xa983('0x12d')](db['WhatsappInteraction'],{});db[_0xa983('0x112')][_0xa983('0x12d')](db[_0xa983('0x10a')],{'foreignKey':_0xa983('0x209'),'as':_0xa983('0x1f5')});db[_0xa983('0x112')]['belongsTo'](db[_0xa983('0x10a')],{'foreignKey':_0xa983('0x20a'),'as':'ToAccount'});db[_0xa983('0x112')]['belongsTo'](db[_0xa983('0x114')],{'foreignKey':'ToQueueId','as':_0xa983('0x1f1')});db[_0xa983('0x112')]['belongsTo'](db[_0xa983('0x11')],{'foreignKey':'FromUserId','as':_0xa983('0x1ee')});db[_0xa983('0x112')][_0xa983('0x12d')](db[_0xa983('0x11')],{'foreignKey':_0xa983('0x1f9'),'as':_0xa983('0x1ef')});db['WhatsappQueue']['belongsToMany'](db[_0xa983('0x11')],{'as':_0xa983('0x16a'),'through':_0xa983('0x148'),'foreignKey':_0xa983('0x20b')});db['WhatsappQueue']['belongsToMany'](db[_0xa983('0xf1')],{'through':_0xa983('0x1e6'),'as':_0xa983('0x16b')});db[_0xa983('0x20c')][_0xa983('0x12d')](db[_0xa983('0x11')],{'as':'user','foreignKey':_0xa983('0x121'),'onDelete':'cascade','hooks':!![]});db[_0xa983('0x116')][_0xa983('0x11f')](db[_0xa983('0x1de')],{'as':_0xa983('0x1de'),'onDelete':_0xa983('0x177')});db[_0xa983('0x116')][_0xa983('0x11f')](db[_0xa983('0x38')],{'as':'Imap','onDelete':_0xa983('0x177')});db[_0xa983('0x116')][_0xa983('0x11f')](db[_0xa983('0x3a')],{'as':_0xa983('0x17a'),'onDelete':'restrict'});module[_0xa983('0x20d')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xc2cc=['SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../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','UserSetting','../api/user-setting/user-setting.model','User','hasOne','UserId','cascade','hasMany','VoiceQueuesRt','Extensions','HopperFinals','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','MailInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoicePrefixes','FaxQueues','SmsQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','CmContact','Contact','ContactId','MailAccount','MailAccountId','CloudProviderId','MailServerOut','Imap','Smtp','Answers','Messages','ListId','TemplateId','Pause','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','IntervalId','TagId','List','Dispositions','FaxAccountId','Interactions','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','Owner','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Interaction','AttachmentId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CmContactHasItem','Phones','CmContactId','HopperHistories','MailInteractions','Company','CompanyId','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','Campaign','CampaignId','Automation','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','ParentId','Intervals','ChatApplications','SmsApplications','DefaultReportId','VoiceMusicOnHold','Mohs','ItemType','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','Subject','Description','Field','FieldId','SugarcrmConfiguration','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','ChatQueueReport','FromId','SessionId','ProjectId','VoiceQueues','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','MailTransferReport','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','ToQueue','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','CustomFields','HopperHistory','Queues','UserProfileSections','userProfileId','UserProfileResource','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','name','database','username','password','options','import','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model'];(function(_0x22ba46,_0x1abde2){var _0x5871a8=function(_0x400ad5){while(--_0x400ad5){_0x22ba46['push'](_0x22ba46['shift']());}};_0x5871a8(++_0x1abde2);}(_0xc2cc,0x123));var _0xcc2c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2cc[_0x4a9fb1];return _0x348672;};'use strict';var config=require(_0xcc2c('0x0'));var Sequelize=require(_0xcc2c('0x1'));var _=require('lodash');var jstz=require(_0xcc2c('0x2'));var timezone=jstz[_0xcc2c('0x3')]();config['sequelize']=_[_0xcc2c('0x4')](config['sequelize'],{'database':_0xcc2c('0x5'),'username':_0xcc2c('0x6'),'password':_0xcc2c('0x7'),'options':{'host':_0xcc2c('0x8'),'port':0xcea,'dialect':_0xcc2c('0x9'),'dialectOptions':{'charset':_0xcc2c('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xcc2c('0xb'),'collate':_0xcc2c('0xc')}}});config['sequelizeHistory']=_[_0xcc2c('0x4')](config[_0xcc2c('0xd')],{'database':_0xcc2c('0x5'),'username':_0xcc2c('0x6'),'password':_0xcc2c('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xcc2c('0x9'),'dialectOptions':{'charset':_0xcc2c('0xa')},'logging':![],'timezone':timezone[_0xcc2c('0xe')](),'define':{'charset':_0xcc2c('0xb'),'collate':_0xcc2c('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xcc2c('0xf')],config[_0xcc2c('0x1')][_0xcc2c('0x10')],config[_0xcc2c('0x1')][_0xcc2c('0x11')],config[_0xcc2c('0x1')][_0xcc2c('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcc2c('0xd')][_0xcc2c('0xf')],config[_0xcc2c('0xd')]['username'],config[_0xcc2c('0xd')][_0xcc2c('0x11')],config[_0xcc2c('0xd')]['options'])};db['User']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/user/user.model');db[_0xcc2c('0x14')]=db[_0xcc2c('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0xcc2c('0x15')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x16'));db[_0xcc2c('0x17')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x18'));db[_0xcc2c('0x19')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x1a'));db[_0xcc2c('0x1b')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x1c'));db[_0xcc2c('0x1d')]=db[_0xcc2c('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0xcc2c('0x1e')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x1f'));db[_0xcc2c('0x20')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x21'));db[_0xcc2c('0x22')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x23'));db[_0xcc2c('0x24')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x25'));db[_0xcc2c('0x26')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x27'));db[_0xcc2c('0x28')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x29'));db[_0xcc2c('0x2a')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x2b'));db['Trunk']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/trunk/trunk.model');db[_0xcc2c('0x2c')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x2d'));db[_0xcc2c('0x2e')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x2f'));db[_0xcc2c('0x30')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x31'));db[_0xcc2c('0x32')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x33'));db[_0xcc2c('0x34')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x35'));db[_0xcc2c('0x36')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x37'));db[_0xcc2c('0x38')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x39'));db[_0xcc2c('0x3a')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x3b'));db[_0xcc2c('0x3c')]=db[_0xcc2c('0x1')]['import']('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x3d'));db['MailAccount']=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x3e'));db[_0xcc2c('0x3f')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x40'));db[_0xcc2c('0x41')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0xcc2c('0x42')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/mailMessage/mailMessage.model');db[_0xcc2c('0x43')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x44'));db[_0xcc2c('0x45')]=db['sequelize']['import'](_0xcc2c('0x46'));db[_0xcc2c('0x47')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x48'));db[_0xcc2c('0x49')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/faxAccount/faxAccount.model');db[_0xcc2c('0x4a')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/faxApplication/faxApplication.model');db[_0xcc2c('0x4b')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x4c'));db['FaxMessage']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x4d'));db[_0xcc2c('0x4e')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/faxQueue/faxQueue.model');db[_0xcc2c('0x4f')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x50'));db[_0xcc2c('0x51')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x52'));db[_0xcc2c('0x53')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x54'));db[_0xcc2c('0x55')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x56'));db['SmsMessage']=db[_0xcc2c('0x1')]['import']('../api/smsMessage/smsMessage.model');db[_0xcc2c('0x57')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/smsQueue/smsQueue.model');db[_0xcc2c('0x58')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x59'));db['OpenchannelApplication']=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x5a'));db[_0xcc2c('0x5b')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x5c'));db['OpenchannelMessage']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x5d'));db[_0xcc2c('0x5e')]=db['sequelize'][_0xcc2c('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xcc2c('0x5f')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x60'));db[_0xcc2c('0x61')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x62'));db[_0xcc2c('0x63')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x64'));db['ChatInteraction']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0xcc2c('0x65')]=db[_0xcc2c('0x1')]['import']('../api/chatMessage/chatMessage.model');db[_0xcc2c('0x66')]=db[_0xcc2c('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xcc2c('0x67')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x68'));db[_0xcc2c('0x69')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x6a'));db['ChatProactiveAction']=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x6b'));db[_0xcc2c('0x6c')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x6d'));db['CmContact']=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x6e'));db[_0xcc2c('0x6f')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/cmHopper/cmHopper.model');db[_0xcc2c('0x70')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x71'));db[_0xcc2c('0x72')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x73'));db[_0xcc2c('0x74')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x75'));db[_0xcc2c('0x76')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xcc2c('0x77')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x78'));db[_0xcc2c('0x79')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x7a'));db['Automation']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x7b'));db[_0xcc2c('0x7c')]=db['sequelize'][_0xcc2c('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0xcc2c('0x7d')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x7e'));db[_0xcc2c('0x7f')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x80'));db[_0xcc2c('0x81')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x82'));db['Pause']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x83'));db[_0xcc2c('0x84')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x85'));db[_0xcc2c('0x86')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x87'));db[_0xcc2c('0x88')]=db[_0xcc2c('0x1')]['import']('../api/schedule/schedule.model');db['Sound']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x89'));db[_0xcc2c('0x8a')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x8b'));db[_0xcc2c('0x8c')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x8d'));db['CmContactHasItem']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x8e'));db['CmHopperAdditionalPhone']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x8f'));db[_0xcc2c('0x90')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x91'));db[_0xcc2c('0x92')]=db[_0xcc2c('0x1')]['import']('../api/trigger/trigger.model');db[_0xcc2c('0x93')]=db['sequelize']['import'](_0xcc2c('0x94'));db[_0xcc2c('0x95')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x96'));db[_0xcc2c('0x97')]=db['sequelize'][_0xcc2c('0x13')]('../api/integrationReport/integrationReport.model');db[_0xcc2c('0x98')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x99'));db[_0xcc2c('0x9a')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x9b'));db['AnalyticExtractedReport']=db[_0xcc2c('0x1')]['import'](_0xcc2c('0x9c'));db[_0xcc2c('0x9d')]=db['sequelize']['import'](_0xcc2c('0x9e'));db[_0xcc2c('0x9f')]=db['sequelize'][_0xcc2c('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xa0'));db[_0xcc2c('0xa1')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xcc2c('0xa2')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xa3'));db['SalesforceField']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0xcc2c('0xa4')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xa5'));db['SugarcrmConfiguration']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xa6'));db[_0xcc2c('0xa7')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xa8'));db[_0xcc2c('0xa9')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xaa'));db[_0xcc2c('0xab')]=db['sequelize']['import'](_0xcc2c('0xac'));db[_0xcc2c('0xad')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xae'));db['ZohoAccount']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xaf'));db[_0xcc2c('0xb0')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xb1'));db[_0xcc2c('0xb2')]=db['sequelize'][_0xcc2c('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xcc2c('0xb3')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xb4'));db[_0xcc2c('0xb5')]=db[_0xcc2c('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xcc2c('0xb6')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xb7'));db[_0xcc2c('0xb8')]=db['sequelize'][_0xcc2c('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xb9'));db[_0xcc2c('0xba')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xbb'));db[_0xcc2c('0xbc')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xbd'));db[_0xcc2c('0xbe')]=db[_0xcc2c('0x1')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xcc2c('0xbf')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xc0'));db[_0xcc2c('0xc1')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xc2'));db['Dynamics365Configuration']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xc3'));db['FreshsalesAccount']=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xc4'));db[_0xcc2c('0xc5')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xc6'));db[_0xcc2c('0xc7')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xc8'));db[_0xcc2c('0x95')]=db[_0xcc2c('0x1')]['import']('../api/integration/integration.model');db[_0xcc2c('0xc9')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xca'));db['ChatQueueReport']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xcb'));db['ChatInternalMessage']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xcc'));db[_0xcc2c('0xcd')]=db[_0xcc2c('0x1')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xcc2c('0xce')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xcf'));db[_0xcc2c('0xd0')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xcc2c('0xd1')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xd2'));db['SquareReport']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xd3'));db['SquareDetailsReport']=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xd4'));db[_0xcc2c('0xd5')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xd6'));db[_0xcc2c('0xd7')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xd8'));db[_0xcc2c('0xd9')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xda'));db['SquareProject']=db[_0xcc2c('0x1')]['import']('../api/squareProject/squareProject.model');db[_0xcc2c('0xdb')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xdc'));db['SquareMessage']=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/squareMessage/squareMessage.model');db[_0xcc2c('0xdd')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xde'));db[_0xcc2c('0xdf')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xe0'));db['Campaign']=db['sequelize']['import'](_0xcc2c('0xe1'));db[_0xcc2c('0xe2')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xe3'));db[_0xcc2c('0xe4')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xe5'));db[_0xcc2c('0xe6')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xe7'));db['MailTransferReport']=db[_0xcc2c('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xe8'));db[_0xcc2c('0xe9')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xea'));db[_0xcc2c('0xeb')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xec'));db['SmsTransferReport']=db[_0xcc2c('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0xcc2c('0xed')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xee'));db[_0xcc2c('0xef')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0xcc2c('0xf0')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xf1'));db[_0xcc2c('0xf2')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xf3'));db[_0xcc2c('0xf4')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xf5'));db[_0xcc2c('0xf6')]=db[_0xcc2c('0x1')]['import'](_0xcc2c('0xf7'));db[_0xcc2c('0xf8')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xf9'));db['WhatsappInteraction']=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0xfa'));db[_0xcc2c('0xfb')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xfc'));db[_0xcc2c('0xfd')]=db[_0xcc2c('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0xfe'));db[_0xcc2c('0xff')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x100'));db[_0xcc2c('0x101')]=db['sequelize'][_0xcc2c('0x13')](_0xcc2c('0x102'));db[_0xcc2c('0x103')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x104'));db[_0xcc2c('0x105')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x106'));db[_0xcc2c('0x107')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x108'));db[_0xcc2c('0x109')]=db[_0xcc2c('0x1')][_0xcc2c('0x13')](_0xcc2c('0x10a'));db[_0xcc2c('0x10b')][_0xcc2c('0x10c')](db['VoiceMail'],{'as':_0xcc2c('0x1e'),'onDelete':'cascade','foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')][_0xcc2c('0x10c')](db[_0xcc2c('0x109')],{'as':'userSetting','onDelete':_0xcc2c('0x10e'),'foreignKey':'UserId'});db[_0xcc2c('0x10b')][_0xcc2c('0x10f')](db[_0xcc2c('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xcc2c('0x10b')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xcc2c('0x110'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')][_0xcc2c('0x10f')](db['VoiceExtension'],{'as':_0xcc2c('0x111'),'onDelete':_0xcc2c('0x10e'),'hooks':!![]});db['User']['hasMany'](db[_0xcc2c('0x72')],{'as':_0xcc2c('0x112'),'foreignKey':'UserId'});db['User'][_0xcc2c('0x10f')](db[_0xcc2c('0x74')],{'as':'HopperHistory','foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')]['hasMany'](db['ReportAgentPreview'],{'as':_0xcc2c('0x76'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')]['hasMany'](db[_0xcc2c('0x5b')],{'as':_0xcc2c('0x113'),'foreignKey':_0xcc2c('0x10d')});db['User'][_0xcc2c('0x10f')](db[_0xcc2c('0x114')],{'as':_0xcc2c('0x115'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')][_0xcc2c('0x10f')](db[_0xcc2c('0x55')],{'as':_0xcc2c('0x116'),'foreignKey':'UserId'});db[_0xcc2c('0x10b')][_0xcc2c('0x10f')](db[_0xcc2c('0x4b')],{'as':'FaxInteractions','foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')]['hasMany'](db[_0xcc2c('0x117')],{'as':'MailInteractions','foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')][_0xcc2c('0x10f')](db['WhatsappInteraction'],{'as':_0xcc2c('0x118'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x10b')][_0xcc2c('0x10f')](db[_0xcc2c('0xf4')],{'as':_0xcc2c('0x119'),'foreignKey':_0xcc2c('0x11a')});db[_0xcc2c('0x10b')][_0xcc2c('0x11b')](db[_0xcc2c('0xf0')],{'as':_0xcc2c('0xf0'),'foreignKey':'userProfileId'});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db['ChatGroup'],{'as':_0xcc2c('0x11d'),'through':_0xcc2c('0x11e')});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db['CmContact'],{'as':_0xcc2c('0x11f'),'through':_0xcc2c('0x120')});db['User'][_0xcc2c('0x11c')](db[_0xcc2c('0xed')],{'as':'Lists','through':_0xcc2c('0x121')});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0xdd')],{'through':_0xcc2c('0x122')});db['User'][_0xcc2c('0x11c')](db['MailInteraction'],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x114')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x4b')],{'as':'FaxInteractions','through':_0xcc2c('0x123')});db[_0xcc2c('0x10b')]['belongsToMany'](db['SmsInteraction'],{'as':_0xcc2c('0x116'),'through':_0xcc2c('0x124')});db['User'][_0xcc2c('0x11c')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0xcc2c('0x125')});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x126')],{'as':'WhatsappInteractions','through':_0xcc2c('0x127')});db['User'][_0xcc2c('0x11c')](db[_0xcc2c('0x19')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db['VoicePrefix'],{'as':_0xcc2c('0x128'),'through':_0xcc2c('0x107'),'required':![]});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x3f')],{'as':'MailQueues','through':_0xcc2c('0x32'),'required':![]});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x67')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xcc2c('0x10b')]['belongsToMany'](db[_0xcc2c('0x4e')],{'as':_0xcc2c('0x129'),'through':_0xcc2c('0x34'),'required':![]});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x57')],{'as':_0xcc2c('0x12a'),'through':_0xcc2c('0x36'),'required':![]});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x5e')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db['WhatsappQueue'],{'as':_0xcc2c('0x12b'),'through':_0xcc2c('0x3a'),'required':![]});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0xed')],{'through':_0xcc2c('0x121')});db['User'][_0xcc2c('0x11c')](db[_0xcc2c('0x5f')],{'as':_0xcc2c('0x12c'),'through':_0xcc2c('0x12d')});db['User'][_0xcc2c('0x11c')](db[_0xcc2c('0x12e')],{'as':'FaxAccounts','through':_0xcc2c('0x12f')});db[_0xcc2c('0x10b')]['belongsToMany'](db['MailAccount'],{'as':_0xcc2c('0x130'),'through':_0xcc2c('0x131')});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x58')],{'as':_0xcc2c('0x132'),'through':'user_has_openchannel_accounts'});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x51')],{'as':'SmsAccounts','through':_0xcc2c('0x133')});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0xf6')],{'as':_0xcc2c('0x134'),'through':'user_has_whatsapp_accounts'});db[_0xcc2c('0x10b')][_0xcc2c('0x11c')](db[_0xcc2c('0x135')],{'as':_0xcc2c('0x136'),'through':_0xcc2c('0x137')});db[_0xcc2c('0x14')][_0xcc2c('0x10f')](db[_0xcc2c('0x17')],{'as':_0xcc2c('0x138'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x139')});db[_0xcc2c('0x15')][_0xcc2c('0x10f')](db[_0xcc2c('0x17')],{'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x17')][_0xcc2c('0x10f')](db[_0xcc2c('0x17')],{'as':_0xcc2c('0x13a'),'onDelete':_0xcc2c('0x10e')});db['VoiceMusicOnHold'][_0xcc2c('0x11c')](db[_0xcc2c('0x13b')],{'as':_0xcc2c('0x13c'),'through':_0xcc2c('0x13d')});db['VoiceQueue'][_0xcc2c('0x10f')](db['UserVoiceQueueRt'],{'as':_0xcc2c('0x13e'),'foreignKey':_0xcc2c('0x13f')});db['VoiceQueue'][_0xcc2c('0x10f')](db[_0xcc2c('0x6f')],{'as':_0xcc2c('0x140'),'foreignKey':_0xcc2c('0x13f')});db['VoiceQueue'][_0xcc2c('0x10f')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xcc2c('0x13f')});db[_0xcc2c('0x19')][_0xcc2c('0x10f')](db[_0xcc2c('0x74')],{'as':'HopperHistories','foreignKey':_0xcc2c('0x13f')});db['VoiceQueue']['hasMany'](db[_0xcc2c('0x76')],{'as':_0xcc2c('0x76'),'foreignKey':_0xcc2c('0x13f')});db[_0xcc2c('0x19')][_0xcc2c('0x10f')](db[_0xcc2c('0x70')],{'as':_0xcc2c('0x141'),'foreignKey':_0xcc2c('0x13f')});db[_0xcc2c('0x19')][_0xcc2c('0x10f')](db['JscriptySessionReport'],{'as':_0xcc2c('0x142'),'foreignKey':_0xcc2c('0x13f')});db[_0xcc2c('0x19')]['belongsTo'](db[_0xcc2c('0x143')],{'as':_0xcc2c('0x143'),'foreignKey':_0xcc2c('0x144')});db[_0xcc2c('0x19')]['belongsTo'](db['Trunk'],{'as':_0xcc2c('0x145'),'foreignKey':'TrunkBackupId'});db[_0xcc2c('0x19')][_0xcc2c('0x11b')](db[_0xcc2c('0x81')],{'as':_0xcc2c('0x81'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xcc2c('0x11b')](db['Pause'],{'as':_0xcc2c('0x146'),'foreignKey':_0xcc2c('0x147')});db[_0xcc2c('0x19')][_0xcc2c('0x11c')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x148'),'through':_0xcc2c('0x149')});db[_0xcc2c('0x19')][_0xcc2c('0x11c')](db['User'],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x2e')});db[_0xcc2c('0x19')][_0xcc2c('0x11c')](db[_0xcc2c('0xdd')],{'as':_0xcc2c('0x14b'),'through':_0xcc2c('0x103')});db['VoiceQueue'][_0xcc2c('0x11c')](db[_0xcc2c('0xed')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0xcc2c('0x1b')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x10b'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x1d')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x10b'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x1e')][_0xcc2c('0x10f')](db[_0xcc2c('0x20')],{'as':'Messages','onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x14c'),'sourceKey':_0xcc2c('0x14d')});db[_0xcc2c('0x20')][_0xcc2c('0x11b')](db[_0xcc2c('0x1e')],{'foreignKey':_0xcc2c('0x14c'),'targetKey':_0xcc2c('0x14d')});db['VoiceCallReport'][_0xcc2c('0x10f')](db['VoiceQueueReport'],{'as':_0xcc2c('0x14e'),'foreignKey':_0xcc2c('0x14f'),'constraints':![]});db[_0xcc2c('0x22')]['hasMany'](db[_0xcc2c('0x26')],{'as':_0xcc2c('0x150'),'foreignKey':_0xcc2c('0x14f'),'constraints':![]});db[_0xcc2c('0x22')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x10b'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x22')][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db['MailServerIn'][_0xcc2c('0x11b')](db[_0xcc2c('0x154')],{'as':_0xcc2c('0x154'),'foreignKey':_0xcc2c('0x155')});db[_0xcc2c('0x3c')]['belongsTo'](db[_0xcc2c('0x101')],{'as':_0xcc2c('0x101'),'foreignKey':_0xcc2c('0x156'),'onDelete':'restrict'});db[_0xcc2c('0x157')][_0xcc2c('0x11b')](db[_0xcc2c('0x154')],{'as':'MailAccount','foreignKey':_0xcc2c('0x155')});db['MailServerOut']['belongsTo'](db[_0xcc2c('0x101')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0xcc2c('0x154')]['hasOne'](db[_0xcc2c('0x3c')],{'as':_0xcc2c('0x158'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x154')][_0xcc2c('0x10c')](db[_0xcc2c('0x157')],{'as':_0xcc2c('0x159'),'onDelete':'cascade'});db[_0xcc2c('0x154')][_0xcc2c('0x10f')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcc2c('0x155'),'onDelete':'cascade'});db['MailAccount'][_0xcc2c('0x10f')](db['CannedAnswer'],{'as':_0xcc2c('0x15a'),'foreignKey':'MailAccountId'});db[_0xcc2c('0x154')][_0xcc2c('0x10f')](db[_0xcc2c('0x42')],{'as':_0xcc2c('0x15b'),'foreignKey':_0xcc2c('0x155')});db[_0xcc2c('0x154')][_0xcc2c('0x10f')](db[_0xcc2c('0x117')],{'as':'Interactions'});db[_0xcc2c('0x154')][_0xcc2c('0x10f')](db['MailApplication'],{'as':_0xcc2c('0x13a')});db[_0xcc2c('0x154')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':'List','foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0x154')]['belongsTo'](db[_0xcc2c('0x90')],{'as':_0xcc2c('0x90'),'foreignKey':_0xcc2c('0x15d')});db[_0xcc2c('0x154')][_0xcc2c('0x11b')](db[_0xcc2c('0x15e')],{'as':_0xcc2c('0x146'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db[_0xcc2c('0x10b')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0xcc2c('0x3f')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':'UserMailQueue'});db[_0xcc2c('0x3f')][_0xcc2c('0x11c')](db[_0xcc2c('0xdd')],{'through':'team_has_mail_queues','as':'Teams'});db[_0xcc2c('0x117')]['hasMany'](db[_0xcc2c('0x42')],{'as':_0xcc2c('0x15b'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x15f')});db['MailInteraction'][_0xcc2c('0x11b')](db['MailAccount'],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x155')});db[_0xcc2c('0x117')]['belongsTo'](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x117')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':'Owner','foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x117')][_0xcc2c('0x11c')](db['Tag'],{'through':_0xcc2c('0x161'),'as':_0xcc2c('0x162')});db[_0xcc2c('0x117')]['belongsToMany'](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x161'),'as':_0xcc2c('0x163')});db[_0xcc2c('0x117')][_0xcc2c('0x11c')](db['User'],{'as':_0xcc2c('0x164'),'through':_0xcc2c('0x165'),'foreignKey':'MailInteractionId'});db[_0xcc2c('0x42')][_0xcc2c('0x10f')](db['Attachment'],{'as':_0xcc2c('0x166'),'onDelete':_0xcc2c('0x10e')});db['MailMessage'][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':'User'});db[_0xcc2c('0x42')]['belongsTo'](db['CmContact'],{'onDelete':_0xcc2c('0x10e'),'as':_0xcc2c('0x152')});db[_0xcc2c('0x42')][_0xcc2c('0x11b')](db[_0xcc2c('0x117')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0xcc2c('0x42')][_0xcc2c('0x11b')](db[_0xcc2c('0x154')],{'as':_0xcc2c('0x160'),'foreignKey':'MailAccountId'});db[_0xcc2c('0x42')][_0xcc2c('0x11b')](db[_0xcc2c('0x5f')],{'as':_0xcc2c('0x5f'),'foreignKey':_0xcc2c('0x167')});db[_0xcc2c('0x42')][_0xcc2c('0x11b')](db['ChatOfflineMessage'],{'as':_0xcc2c('0x66'),'foreignKey':_0xcc2c('0x168')});db[_0xcc2c('0x43')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x43')][_0xcc2c('0x11b')](db['MailQueue'],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x43')][_0xcc2c('0x11b')](db['MailAccount'],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x43')][_0xcc2c('0x11b')](db[_0xcc2c('0x81')],{'onDelete':_0xcc2c('0x169'),'foreignKey':_0xcc2c('0x16a')});db[_0xcc2c('0x43')][_0xcc2c('0x11b')](db[_0xcc2c('0x8a')],{'onDelete':_0xcc2c('0x169'),'foreignKey':_0xcc2c('0x16b')});db[_0xcc2c('0x45')][_0xcc2c('0x11b')](db[_0xcc2c('0x154')],{});db[_0xcc2c('0x45')]['belongsTo'](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0x45')][_0xcc2c('0x11b')](db['CmContact'],{'as':_0xcc2c('0x152'),'foreignKey':'ContactId'});db[_0xcc2c('0x45')][_0xcc2c('0x11b')](db[_0xcc2c('0x117')],{});db['MailQueueReport'][_0xcc2c('0x11b')](db['MailMessage'],{});db[_0xcc2c('0x45')][_0xcc2c('0x11b')](db['User'],{});db[_0xcc2c('0x45')][_0xcc2c('0x11b')](db[_0xcc2c('0x3f')],{});db[_0xcc2c('0x47')][_0xcc2c('0x10f')](db[_0xcc2c('0x49')],{'as':'Items','onDelete':_0xcc2c('0x10e')});db['FaxAccount']['hasMany'](db['Disposition'],{'as':_0xcc2c('0x16d'),'foreignKey':'FaxAccountId','onDelete':_0xcc2c('0x10e')});db['FaxAccount'][_0xcc2c('0x10f')](db['CannedAnswer'],{'as':_0xcc2c('0x15a'),'foreignKey':_0xcc2c('0x16e')});db['FaxAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0x4b')],{'as':_0xcc2c('0x16f')});db[_0xcc2c('0x12e')][_0xcc2c('0x10f')](db[_0xcc2c('0x4a')],{'as':_0xcc2c('0x13a')});db[_0xcc2c('0x12e')][_0xcc2c('0x10f')](db['VoiceExtension'],{'as':_0xcc2c('0x170'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x12e')][_0xcc2c('0x10f')](db[_0xcc2c('0x171')],{'as':_0xcc2c('0x15b')});db[_0xcc2c('0x12e')]['belongsTo'](db[_0xcc2c('0x143')],{'as':_0xcc2c('0x143')});db[_0xcc2c('0x12e')]['belongsTo'](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0x12e')]['belongsTo'](db['Pause'],{'as':_0xcc2c('0x146'),'foreignKey':_0xcc2c('0x147')});db[_0xcc2c('0x12e')]['belongsToMany'](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x12f')});db[_0xcc2c('0x4a')][_0xcc2c('0x11b')](db['User'],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x4a')][_0xcc2c('0x11b')](db['FaxQueue'],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x4a')]['belongsTo'](db[_0xcc2c('0x12e')],{'onDelete':'restrict'});db[_0xcc2c('0x4a')][_0xcc2c('0x11b')](db[_0xcc2c('0x8a')],{'onDelete':_0xcc2c('0x169'),'foreignKey':'TagId'});db[_0xcc2c('0x4b')][_0xcc2c('0x10f')](db[_0xcc2c('0x171')],{'as':_0xcc2c('0x15b'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x172')});db['FaxInteraction'][_0xcc2c('0x11b')](db['FaxAccount'],{'as':'Account','foreignKey':_0xcc2c('0x16e')});db[_0xcc2c('0x4b')][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x4b')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':'Owner','foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x4b')][_0xcc2c('0x11c')](db['Tag'],{'through':_0xcc2c('0x173'),'as':_0xcc2c('0x162')});db[_0xcc2c('0x4b')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x173'),'as':_0xcc2c('0x163')});db[_0xcc2c('0x4b')][_0xcc2c('0x11c')](db['User'],{'as':_0xcc2c('0x164'),'through':_0xcc2c('0x123'),'foreignKey':_0xcc2c('0x172')});db['FaxMessage'][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x10e'),'as':'User'});db[_0xcc2c('0x171')][_0xcc2c('0x11b')](db[_0xcc2c('0x4b')],{'as':'Interaction','foreignKey':_0xcc2c('0x172')});db[_0xcc2c('0x171')][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'onDelete':_0xcc2c('0x10e'),'as':_0xcc2c('0x152')});db[_0xcc2c('0x171')][_0xcc2c('0x11b')](db[_0xcc2c('0xe4')],{'as':_0xcc2c('0xe4'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0xcc2c('0x11b')](db[_0xcc2c('0x12e')],{'as':_0xcc2c('0x160'),'foreignKey':'FaxAccountId'});db[_0xcc2c('0x4e')][_0xcc2c('0x11c')](db['User'],{'as':_0xcc2c('0x14a'),'through':'UserFaxQueue'});db[_0xcc2c('0x4e')]['belongsToMany'](db['Team'],{'through':_0xcc2c('0x174'),'as':_0xcc2c('0x14b')});db[_0xcc2c('0x4f')][_0xcc2c('0x11b')](db['FaxAccount'],{});db[_0xcc2c('0x4f')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':'List','foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0x4f')][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'as':'Contact','foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0xcc2c('0x4b')],{});db[_0xcc2c('0x4f')][_0xcc2c('0x11b')](db[_0xcc2c('0x171')],{});db[_0xcc2c('0x4f')]['belongsTo'](db[_0xcc2c('0x10b')],{});db[_0xcc2c('0x4f')][_0xcc2c('0x11b')](db[_0xcc2c('0x4e')],{});db[_0xcc2c('0x51')]['hasMany'](db[_0xcc2c('0x7d')],{'as':_0xcc2c('0x16d'),'foreignKey':_0xcc2c('0x175'),'onDelete':_0xcc2c('0x10e')});db['SmsAccount'][_0xcc2c('0x10f')](db['CannedAnswer'],{'as':_0xcc2c('0x15a'),'foreignKey':_0xcc2c('0x175')});db['SmsAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0x176')],{'as':_0xcc2c('0x15b'),'foreignKey':_0xcc2c('0x175')});db[_0xcc2c('0x51')]['hasMany'](db[_0xcc2c('0x55')],{'as':_0xcc2c('0x16f')});db[_0xcc2c('0x51')][_0xcc2c('0x10f')](db['SmsApplication'],{'as':_0xcc2c('0x13a')});db[_0xcc2c('0x51')]['belongsTo'](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':'ListId'});db['SmsAccount'][_0xcc2c('0x11b')](db[_0xcc2c('0x15e')],{'as':_0xcc2c('0x146'),'foreignKey':_0xcc2c('0x147')});db[_0xcc2c('0x51')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x133')});db['SmsApplication'][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x169')});db['SmsApplication'][_0xcc2c('0x11b')](db[_0xcc2c('0x57')],{'onDelete':'restrict'});db[_0xcc2c('0x53')]['belongsTo'](db[_0xcc2c('0x51')],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x53')][_0xcc2c('0x11b')](db['Interval'],{'onDelete':_0xcc2c('0x169'),'foreignKey':_0xcc2c('0x16a')});db['SmsApplication'][_0xcc2c('0x11b')](db['Tag'],{'onDelete':_0xcc2c('0x169'),'foreignKey':_0xcc2c('0x16b')});db[_0xcc2c('0x55')]['hasMany'](db[_0xcc2c('0x176')],{'as':_0xcc2c('0x15b'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x177')});db[_0xcc2c('0x55')][_0xcc2c('0x11b')](db[_0xcc2c('0x51')],{'as':_0xcc2c('0x160'),'foreignKey':'SmsAccountId'});db[_0xcc2c('0x55')][_0xcc2c('0x11b')](db['CmContact'],{'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x55')][_0xcc2c('0x11b')](db['User'],{'as':_0xcc2c('0x178'),'foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x55')]['belongsToMany'](db[_0xcc2c('0x8a')],{'through':'sms_interaction_has_tags','as':_0xcc2c('0x162')});db['SmsInteraction'][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':'sms_interaction_has_tags','as':_0xcc2c('0x163')});db['SmsInteraction'][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x164'),'through':_0xcc2c('0x124'),'foreignKey':'SmsInteractionId'});db[_0xcc2c('0x176')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':'User'});db[_0xcc2c('0x176')][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'onDelete':_0xcc2c('0x10e'),'as':_0xcc2c('0x152')});db[_0xcc2c('0x176')]['belongsTo'](db[_0xcc2c('0x55')],{'onDelete':_0xcc2c('0x10e'),'as':'Interaction','foreignKey':_0xcc2c('0x177')});db['SmsMessage'][_0xcc2c('0x11b')](db[_0xcc2c('0x51')],{'as':'Account','foreignKey':_0xcc2c('0x175')});db[_0xcc2c('0x57')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x36'),'foreignKey':_0xcc2c('0x179')});db['SmsQueue'][_0xcc2c('0x11c')](db[_0xcc2c('0xdd')],{'through':_0xcc2c('0x17a'),'as':_0xcc2c('0x14b')});db['OpenchannelAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0x7d')],{'as':_0xcc2c('0x16d'),'foreignKey':_0xcc2c('0x17b'),'onDelete':_0xcc2c('0x10e')});db['OpenchannelAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0x7c')],{'as':_0xcc2c('0x15a'),'foreignKey':_0xcc2c('0x17b')});db[_0xcc2c('0x58')][_0xcc2c('0x10f')](db['OpenchannelInteraction'],{'as':_0xcc2c('0x16f'),'foreignKey':_0xcc2c('0x17b')});db['OpenchannelAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0x17c')],{'as':_0xcc2c('0x15b'),'foreignKey':_0xcc2c('0x17b')});db[_0xcc2c('0x58')][_0xcc2c('0x10f')](db[_0xcc2c('0x17d')],{'as':'Applications','foreignKey':_0xcc2c('0x17b')});db['OpenchannelAccount'][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0x58')][_0xcc2c('0x11b')](db[_0xcc2c('0x15e')],{'as':'mandatoryDispositionPause','foreignKey':_0xcc2c('0x147')});db[_0xcc2c('0x58')]['belongsToMany'](db['User'],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x17e')});db[_0xcc2c('0x17d')]['belongsTo'](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x17d')][_0xcc2c('0x11b')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0xcc2c('0x17f')});db[_0xcc2c('0x17d')][_0xcc2c('0x11b')](db['OpenchannelAccount'],{'onDelete':_0xcc2c('0x169'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0xcc2c('0x11b')](db[_0xcc2c('0x81')],{'onDelete':_0xcc2c('0x169'),'foreignKey':'IntervalId'});db[_0xcc2c('0x17d')][_0xcc2c('0x11b')](db['Tag'],{'onDelete':_0xcc2c('0x169'),'foreignKey':'TagId'});db[_0xcc2c('0x5b')]['hasMany'](db[_0xcc2c('0x17c')],{'as':_0xcc2c('0x15b'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x180')});db[_0xcc2c('0x5b')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xcc2c('0x17b')});db[_0xcc2c('0x5b')]['belongsTo'](db[_0xcc2c('0x151')],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelInteraction']['belongsTo'](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x178'),'foreignKey':'UserId'});db[_0xcc2c('0x5b')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x181'),'as':_0xcc2c('0x162')});db[_0xcc2c('0x5b')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x181'),'as':_0xcc2c('0x163')});db[_0xcc2c('0x5b')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x164'),'through':_0xcc2c('0x125'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x10e'),'as':_0xcc2c('0x10b')});db[_0xcc2c('0x17c')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xcc2c('0x152')});db[_0xcc2c('0x17c')][_0xcc2c('0x11b')](db[_0xcc2c('0x5b')],{'onDelete':_0xcc2c('0x10e'),'as':_0xcc2c('0x182'),'foreignKey':_0xcc2c('0x180')});db[_0xcc2c('0x17c')][_0xcc2c('0x11b')](db[_0xcc2c('0xe4')],{'as':_0xcc2c('0xe4'),'foreignKey':_0xcc2c('0x183')});db[_0xcc2c('0x17c')][_0xcc2c('0x11b')](db['OpenchannelAccount'],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x17b')});db[_0xcc2c('0x5e')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xcc2c('0x38'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xcc2c('0x11c')](db['Team'],{'through':_0xcc2c('0x184'),'as':_0xcc2c('0x14b')});db[_0xcc2c('0x5f')][_0xcc2c('0x10f')](db[_0xcc2c('0x7d')],{'as':_0xcc2c('0x16d'),'foreignKey':_0xcc2c('0x167'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x5f')]['hasMany'](db[_0xcc2c('0x7c')],{'as':_0xcc2c('0x15a'),'foreignKey':_0xcc2c('0x167')});db[_0xcc2c('0x5f')]['hasMany'](db[_0xcc2c('0x185')],{'as':_0xcc2c('0x186')});db[_0xcc2c('0x5f')][_0xcc2c('0x10f')](db[_0xcc2c('0x114')],{'as':'Interactions'});db['ChatWebsite'][_0xcc2c('0x10f')](db[_0xcc2c('0x63')],{'as':_0xcc2c('0x13a')});db['ChatWebsite']['hasMany'](db[_0xcc2c('0x65')],{'as':_0xcc2c('0x15b')});db[_0xcc2c('0x5f')]['belongsTo'](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0x5f')][_0xcc2c('0x11b')](db['Interval'],{'as':_0xcc2c('0x81'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0xcc2c('0x11b')](db[_0xcc2c('0x154')],{'as':'MailAccount','foreignKey':_0xcc2c('0x155')});db['ChatWebsite'][_0xcc2c('0x11b')](db[_0xcc2c('0x15e')],{'as':_0xcc2c('0x146'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xcc2c('0x5f')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x12d')});db[_0xcc2c('0x61')]['belongsTo'](db[_0xcc2c('0x58')],{});db[_0xcc2c('0x61')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0x61')]['belongsTo'](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x152'),'foreignKey':'ContactId'});db[_0xcc2c('0x61')][_0xcc2c('0x11b')](db[_0xcc2c('0x5b')],{});db[_0xcc2c('0x61')][_0xcc2c('0x11b')](db[_0xcc2c('0x17c')],{});db[_0xcc2c('0x61')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{});db[_0xcc2c('0x61')][_0xcc2c('0x11b')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x187'),'foreignKey':_0xcc2c('0x10d'),'onDelete':_0xcc2c('0x169')});db['ChatApplication'][_0xcc2c('0x11b')](db[_0xcc2c('0x67')],{'as':_0xcc2c('0x188'),'foreignKey':'ChatQueueId','onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x63')][_0xcc2c('0x11b')](db[_0xcc2c('0x5f')],{'as':_0xcc2c('0x189'),'foreignKey':_0xcc2c('0x167'),'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x63')][_0xcc2c('0x11b')](db['Tag'],{'onDelete':_0xcc2c('0x169'),'foreignKey':_0xcc2c('0x16b')});db[_0xcc2c('0x114')][_0xcc2c('0x10f')](db[_0xcc2c('0x65')],{'as':_0xcc2c('0x15b'),'onDelete':'cascade','foreignKey':_0xcc2c('0x18a')});db[_0xcc2c('0x114')]['belongsTo'](db['ChatWebsite'],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x167')});db[_0xcc2c('0x114')][_0xcc2c('0x11b')](db['CmContact'],{'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x114')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x178'),'foreignKey':'UserId'});db[_0xcc2c('0x114')]['belongsToMany'](db[_0xcc2c('0x8a')],{'through':'chat_interaction_has_tags','as':_0xcc2c('0x162')});db[_0xcc2c('0x114')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x18b'),'as':_0xcc2c('0x163')});db['ChatInteraction'][_0xcc2c('0x11c')](db['User'],{'as':_0xcc2c('0x164'),'through':_0xcc2c('0x18c'),'foreignKey':_0xcc2c('0x18a')});db[_0xcc2c('0x65')]['belongsTo'](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x10e'),'as':_0xcc2c('0x10b')});db['ChatMessage'][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'onDelete':'cascade','as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db['ChatMessage'][_0xcc2c('0x11b')](db[_0xcc2c('0x114')],{'onDelete':_0xcc2c('0x10e'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xcc2c('0x65')][_0xcc2c('0x11b')](db['Attachment'],{'as':_0xcc2c('0xe4'),'foreignKey':_0xcc2c('0x183')});db['ChatMessage']['belongsTo'](db['ChatWebsite'],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x167')});db[_0xcc2c('0x66')][_0xcc2c('0x10f')](db[_0xcc2c('0xe4')],{'as':_0xcc2c('0x166'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xcc2c('0x10e'),'hooks':!![]});db[_0xcc2c('0x66')][_0xcc2c('0x11b')](db['CmContact'],{'onDelete':_0xcc2c('0x10e'),'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x66')]['belongsTo'](db['ChatWebsite'],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x167')});db['ChatQueue']['belongsToMany'](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue']['belongsToMany'](db['Team'],{'through':_0xcc2c('0x18d'),'as':_0xcc2c('0x14b')});db['ChatGroup'][_0xcc2c('0x10f')](db[_0xcc2c('0x18e')],{'as':_0xcc2c('0x15b'),'foreignKey':_0xcc2c('0x18f'),'onDelete':_0xcc2c('0x10e')});db['ChatGroup'][_0xcc2c('0x11c')](db['User'],{'as':_0xcc2c('0x13e'),'through':_0xcc2c('0x11e')});db[_0xcc2c('0x185')][_0xcc2c('0x11b')](db[_0xcc2c('0x5f')],{'as':'Website','foreignKey':_0xcc2c('0x167')});db['CmCompany']['hasMany'](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x11f'),'foreignKey':'CompanyId'});db['CmContact'][_0xcc2c('0x10f')](db[_0xcc2c('0x190')],{'as':_0xcc2c('0x191'),'foreignKey':_0xcc2c('0x192')});db[_0xcc2c('0x151')]['hasMany'](db[_0xcc2c('0x6f')],{'as':_0xcc2c('0x140'),'foreignKey':_0xcc2c('0x153')});db['CmContact'][_0xcc2c('0x10f')](db[_0xcc2c('0x72')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xcc2c('0x151')][_0xcc2c('0x10f')](db[_0xcc2c('0x74')],{'as':_0xcc2c('0x193'),'foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x151')][_0xcc2c('0x10f')](db[_0xcc2c('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x151')][_0xcc2c('0x10f')](db[_0xcc2c('0xd0')],{'as':_0xcc2c('0x142'),'foreignKey':_0xcc2c('0x153')});db['CmContact'][_0xcc2c('0x10f')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xcc2c('0x153'),'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x151')][_0xcc2c('0x10f')](db[_0xcc2c('0x114')],{'as':'ChatInteractions','foreignKey':_0xcc2c('0x153'),'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x151')][_0xcc2c('0x10f')](db[_0xcc2c('0x55')],{'as':_0xcc2c('0x116'),'foreignKey':_0xcc2c('0x153'),'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x151')][_0xcc2c('0x10f')](db[_0xcc2c('0x4b')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x151')][_0xcc2c('0x10f')](db[_0xcc2c('0x117')],{'as':_0xcc2c('0x194'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xcc2c('0x151')][_0xcc2c('0x11b')](db['CmCompany'],{'as':_0xcc2c('0x195'),'foreignKey':_0xcc2c('0x196')});db[_0xcc2c('0x151')]['belongsTo'](db[_0xcc2c('0xed')],{'as':'List','foreignKey':_0xcc2c('0x15c'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x151')]['belongsToMany'](db[_0xcc2c('0x10b')],{'as':'Users','through':_0xcc2c('0x120')});db[_0xcc2c('0x151')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'as':_0xcc2c('0x162'),'through':'cm_contact_has_tags'});db[_0xcc2c('0x151')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x197'),'as':_0xcc2c('0x163')});db[_0xcc2c('0x6f')][_0xcc2c('0x10f')](db[_0xcc2c('0x198')],{'as':_0xcc2c('0x199'),'foreignKey':'CmHopperId'});db['CmHopper']['belongsTo'](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x6f')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':'List','foreignKey':_0xcc2c('0x15c'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x6f')]['belongsTo'](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x187'),'foreignKey':_0xcc2c('0x10d')});db['CmHopper'][_0xcc2c('0x11b')](db[_0xcc2c('0x19')],{'as':_0xcc2c('0x188'),'foreignKey':_0xcc2c('0x13f'),'onDelete':_0xcc2c('0x10e')});db['CmHopper'][_0xcc2c('0x11b')](db[_0xcc2c('0x19a')],{'as':_0xcc2c('0x19a'),'foreignKey':_0xcc2c('0x19b'),'onDelete':_0xcc2c('0x10e')});db['CmHopper']['belongsTo'](db['User'],{'as':_0xcc2c('0x178'),'foreignKey':'OwnerId'});db[_0xcc2c('0x70')]['belongsTo'](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x152'),'foreignKey':'ContactId','onDelete':'cascade'});db['CmHopperBlack'][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':'ListId','onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x70')][_0xcc2c('0x11b')](db[_0xcc2c('0x19')],{'as':_0xcc2c('0x188'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xcc2c('0x70')][_0xcc2c('0x11b')](db[_0xcc2c('0x19a')],{'as':_0xcc2c('0x19a'),'foreignKey':_0xcc2c('0x19b'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x19c')][_0xcc2c('0x10f')](db[_0xcc2c('0x7f')],{'as':{'plural':_0xcc2c('0x19d'),'singular':_0xcc2c('0x19e')},'foreignKey':_0xcc2c('0x19f'),'onDelete':_0xcc2c('0x10e'),'hooks':!![]});db[_0xcc2c('0x19c')][_0xcc2c('0x10f')](db[_0xcc2c('0x7f')],{'as':{'plural':_0xcc2c('0x1a0'),'singular':_0xcc2c('0x1a1')},'foreignKey':'AutomationAnyId','onDelete':_0xcc2c('0x10e'),'hooks':!![]});db[_0xcc2c('0x19c')][_0xcc2c('0x10f')](db['Action'],{'as':_0xcc2c('0x1a2'),'foreignKey':_0xcc2c('0x1a3'),'onDelete':_0xcc2c('0x10e'),'hooks':!![]});db[_0xcc2c('0x7d')][_0xcc2c('0x10f')](db[_0xcc2c('0x7d')],{'as':_0xcc2c('0x16d'),'foreignKey':_0xcc2c('0x1a4'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0x81')]['hasMany'](db[_0xcc2c('0x81')],{'as':_0xcc2c('0x1a5'),'foreignKey':_0xcc2c('0x16a'),'onDelete':_0xcc2c('0x10e'),'hooks':!![],'required':![]});db[_0xcc2c('0x81')]['hasMany'](db['VoiceExtension'],{'as':_0xcc2c('0x111'),'foreignKey':_0xcc2c('0x16a'),'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x81')][_0xcc2c('0x10f')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xcc2c('0x16a')});db[_0xcc2c('0x81')]['hasMany'](db[_0xcc2c('0x63')],{'as':_0xcc2c('0x1a6'),'foreignKey':_0xcc2c('0x16a')});db['Interval'][_0xcc2c('0x10f')](db[_0xcc2c('0x4a')],{'as':'FaxApplications','foreignKey':_0xcc2c('0x16a')});db[_0xcc2c('0x81')][_0xcc2c('0x10f')](db[_0xcc2c('0x53')],{'as':_0xcc2c('0x1a7'),'foreignKey':_0xcc2c('0x16a')});db[_0xcc2c('0x88')]['belongsTo'](db[_0xcc2c('0x154')],{});db[_0xcc2c('0x88')][_0xcc2c('0x11b')](db[_0xcc2c('0x9a')],{'foreignKey':_0xcc2c('0x1a8')});db[_0xcc2c('0x88')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0xcc2c('0x13b')][_0xcc2c('0x11c')](db[_0xcc2c('0x1a9')],{'as':_0xcc2c('0x1aa'),'through':_0xcc2c('0x13d'),'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x8a')][_0xcc2c('0x11c')](db[_0xcc2c('0x151')],{'through':'cm_contact_has_tags'});db['Tag']['belongsToMany'](db['ChatInteraction'],{'through':_0xcc2c('0x18b')});db['Tag'][_0xcc2c('0x11c')](db[_0xcc2c('0x117')],{'through':_0xcc2c('0x161')});db['Tag'][_0xcc2c('0x11c')](db[_0xcc2c('0x55')],{'through':'sms_interaction_has_tags'});db[_0xcc2c('0x8a')][_0xcc2c('0x11c')](db['FaxInteraction'],{'through':_0xcc2c('0x173')});db[_0xcc2c('0x8a')]['belongsToMany'](db[_0xcc2c('0x5b')],{'through':_0xcc2c('0x181')});db[_0xcc2c('0x8a')]['belongsToMany'](db[_0xcc2c('0x126')],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem']['belongsTo'](db['ContactItemType'],{'as':_0xcc2c('0x1ab'),'foreignKey':_0xcc2c('0x1ac')});db[_0xcc2c('0x198')][_0xcc2c('0x11b')](db['CmHopper'],{'as':_0xcc2c('0x1ad'),'foreignKey':_0xcc2c('0x1ae')});db[_0xcc2c('0x190')]['belongsTo'](db[_0xcc2c('0x151')],{'as':'Contact','foreignKey':_0xcc2c('0x192')});db['Trigger'][_0xcc2c('0x10f')](db[_0xcc2c('0x7f')],{'as':{'plural':_0xcc2c('0x1af'),'singular':_0xcc2c('0x1b0')},'foreignKey':_0xcc2c('0x1b1'),'onDelete':_0xcc2c('0x10e'),'hooks':!![]});db[_0xcc2c('0x92')][_0xcc2c('0x10f')](db[_0xcc2c('0x7f')],{'as':{'plural':_0xcc2c('0x1b2'),'singular':_0xcc2c('0x1b3')},'foreignKey':'TriggerAnyId','onDelete':_0xcc2c('0x10e'),'hooks':!![]});db['Trigger'][_0xcc2c('0x10f')](db[_0xcc2c('0x79')],{'as':_0xcc2c('0x1a2'),'foreignKey':_0xcc2c('0x1b4'),'onDelete':_0xcc2c('0x10e'),'hooks':!![]});db[_0xcc2c('0x98')]['hasMany'](db[_0xcc2c('0x9f')],{'as':'Fields','onDelete':_0xcc2c('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xcc2c('0x9a')][_0xcc2c('0x10f')](db[_0xcc2c('0x9f')],{'as':_0xcc2c('0x1b5'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1a8')});db['AnalyticMetric'][_0xcc2c('0x10f')](db[_0xcc2c('0x9f')],{'as':_0xcc2c('0x1b5'),'onDelete':_0xcc2c('0x10e'),'foreignKey':'MetricId'});db[_0xcc2c('0x9f')][_0xcc2c('0x11b')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xcc2c('0xa1')]['hasMany'](db[_0xcc2c('0xa2')],{'as':_0xcc2c('0x1b6'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0xa2')][_0xcc2c('0x10f')](db[_0xcc2c('0x1b8')],{'as':_0xcc2c('0x1b9'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0xa2')][_0xcc2c('0x10f')](db[_0xcc2c('0x1b8')],{'as':_0xcc2c('0x1bb'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xa2')]['hasMany'](db[_0xcc2c('0x1b8')],{'as':_0xcc2c('0x1b5'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xcc2c('0xa2')]['belongsTo'](db[_0xcc2c('0xa1')],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0x1b8')][_0xcc2c('0x10f')](db[_0xcc2c('0x1b8')],{'as':_0xcc2c('0x1bd'),'foreignKey':'SubjectId'});db['SalesforceField'][_0xcc2c('0x10f')](db['SalesforceField'],{'as':_0xcc2c('0x1be'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0x1b8')][_0xcc2c('0x10f')](db[_0xcc2c('0x1b8')],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0x1b8')][_0xcc2c('0x11b')](db[_0xcc2c('0x93')],{'as':_0xcc2c('0x93'),'foreignKey':'VariableId'});db[_0xcc2c('0xa4')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xcc2c('0x1b6'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0x1c1')][_0xcc2c('0x10f')](db[_0xcc2c('0xa7')],{'as':_0xcc2c('0x1b9'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0x1c1')]['hasMany'](db[_0xcc2c('0xa7')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xcc2c('0x1c1')]['hasMany'](db[_0xcc2c('0xa7')],{'as':_0xcc2c('0x1b5'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1c0')});db['SugarcrmConfiguration']['belongsTo'](db[_0xcc2c('0xa4')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField']['hasMany'](db[_0xcc2c('0xa7')],{'as':'Subject','foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0xa7')][_0xcc2c('0x10f')](db[_0xcc2c('0xa7')],{'as':_0xcc2c('0x1be'),'foreignKey':'DescriptionId'});db[_0xcc2c('0xa7')][_0xcc2c('0x10f')](db['SugarcrmField'],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db['SugarcrmField'][_0xcc2c('0x11b')](db[_0xcc2c('0x93')],{'as':_0xcc2c('0x93'),'foreignKey':_0xcc2c('0x1c2')});db[_0xcc2c('0xa9')][_0xcc2c('0x10f')](db[_0xcc2c('0xab')],{'as':_0xcc2c('0x1b6'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0xab')][_0xcc2c('0x10f')](db[_0xcc2c('0xad')],{'as':_0xcc2c('0x1b9'),'onDelete':'cascade','foreignKey':_0xcc2c('0x1ba')});db['DeskConfiguration'][_0xcc2c('0x10f')](db[_0xcc2c('0xad')],{'as':_0xcc2c('0x1bb'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xab')][_0xcc2c('0x10f')](db[_0xcc2c('0xad')],{'as':_0xcc2c('0x1b5'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0xab')][_0xcc2c('0x11b')](db[_0xcc2c('0xa9')],{'as':'Account','foreignKey':_0xcc2c('0x1b7')});db['DeskConfiguration'][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x1c3')});db[_0xcc2c('0xad')]['hasMany'](db[_0xcc2c('0xad')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xcc2c('0xad')][_0xcc2c('0x10f')](db[_0xcc2c('0xad')],{'as':_0xcc2c('0x1be'),'foreignKey':'DescriptionId'});db[_0xcc2c('0xad')][_0xcc2c('0x10f')](db[_0xcc2c('0xad')],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0xad')][_0xcc2c('0x11b')](db[_0xcc2c('0x93')],{'as':'Variable','foreignKey':_0xcc2c('0x1c2')});db[_0xcc2c('0x1c4')]['hasMany'](db['ZohoConfiguration'],{'as':_0xcc2c('0x1b6'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1b7')});db['ZohoConfiguration'][_0xcc2c('0x10f')](db[_0xcc2c('0xb0')],{'as':_0xcc2c('0x1b9'),'onDelete':'cascade','foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0x1c5')][_0xcc2c('0x10f')](db[_0xcc2c('0xb0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0x1c5')]['hasMany'](db[_0xcc2c('0xb0')],{'as':_0xcc2c('0x1b5'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1c0')});db['ZohoConfiguration'][_0xcc2c('0x11b')](db[_0xcc2c('0x1c4')],{'as':_0xcc2c('0x160'),'foreignKey':'AccountId'});db[_0xcc2c('0xb0')][_0xcc2c('0x10f')](db[_0xcc2c('0xb0')],{'as':_0xcc2c('0x1bd'),'foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0xb0')][_0xcc2c('0x10f')](db[_0xcc2c('0xb0')],{'as':_0xcc2c('0x1be'),'foreignKey':'DescriptionId'});db[_0xcc2c('0xb0')]['hasMany'](db[_0xcc2c('0xb0')],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0xb0')]['belongsTo'](db[_0xcc2c('0x93')],{'as':_0xcc2c('0x93'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0xb3')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xcc2c('0xb3')][_0xcc2c('0x10f')](db[_0xcc2c('0xb5')],{'as':'Subjects','foreignKey':_0xcc2c('0x1ba')});db['ZendeskConfiguration'][_0xcc2c('0x10f')](db[_0xcc2c('0xb5')],{'as':_0xcc2c('0x1bb'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xb3')]['hasMany'](db[_0xcc2c('0xb5')],{'as':'Fields','foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0xb3')][_0xcc2c('0x11b')](db['ZendeskAccount'],{'as':_0xcc2c('0x160'),'foreignKey':'AccountId'});db[_0xcc2c('0xb3')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x1c6')});db['ZendeskField'][_0xcc2c('0x10f')](db[_0xcc2c('0xb5')],{'as':_0xcc2c('0x1bd'),'foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0xb5')]['hasMany'](db[_0xcc2c('0xb5')],{'as':_0xcc2c('0x1be'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xb5')][_0xcc2c('0x10f')](db[_0xcc2c('0xb5')],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0xb5')][_0xcc2c('0x11b')](db[_0xcc2c('0x93')],{'as':_0xcc2c('0x93'),'foreignKey':_0xcc2c('0x1c2')});db['FreshdeskAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0xb6')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xcc2c('0xb6')]['hasMany'](db[_0xcc2c('0xb8')],{'as':_0xcc2c('0x1b9'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1ba')});db['FreshdeskConfiguration']['hasMany'](db[_0xcc2c('0xb8')],{'as':_0xcc2c('0x1bb'),'onDelete':'cascade','foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xb6')][_0xcc2c('0x10f')](db['FreshdeskField'],{'as':_0xcc2c('0x1b5'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0xb6')][_0xcc2c('0x11b')](db[_0xcc2c('0x1c7')],{'as':'Account','foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0xb6')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x1c8')});db[_0xcc2c('0xb8')][_0xcc2c('0x10f')](db[_0xcc2c('0xb8')],{'as':_0xcc2c('0x1bd'),'foreignKey':'SubjectId'});db[_0xcc2c('0xb8')][_0xcc2c('0x10f')](db[_0xcc2c('0xb8')],{'as':_0xcc2c('0x1be'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xb8')]['hasMany'](db[_0xcc2c('0xb8')],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db['FreshdeskField'][_0xcc2c('0x11b')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xcc2c('0x1c9')]['hasMany'](db[_0xcc2c('0xba')],{'as':_0xcc2c('0x1b6'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0xba')][_0xcc2c('0x10f')](db[_0xcc2c('0xbc')],{'as':'Subjects','foreignKey':_0xcc2c('0x1ba')});db['VtigerConfiguration'][_0xcc2c('0x10f')](db[_0xcc2c('0xbc')],{'as':_0xcc2c('0x1bb'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xba')][_0xcc2c('0x10f')](db[_0xcc2c('0xbc')],{'as':_0xcc2c('0x1b5'),'foreignKey':'FieldId'});db[_0xcc2c('0xba')][_0xcc2c('0x11b')](db[_0xcc2c('0x1c9')],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0xbc')]['hasMany'](db[_0xcc2c('0xbc')],{'as':_0xcc2c('0x1bd'),'foreignKey':_0xcc2c('0x1ba')});db['VtigerField'][_0xcc2c('0x10f')](db[_0xcc2c('0xbc')],{'as':_0xcc2c('0x1be'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xbc')]['hasMany'](db['VtigerField'],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0xbc')]['belongsTo'](db[_0xcc2c('0x93')],{'as':_0xcc2c('0x93'),'foreignKey':'VariableId'});db[_0xcc2c('0xbe')][_0xcc2c('0x10f')](db[_0xcc2c('0x1ca')],{'as':_0xcc2c('0x1b6'),'onDelete':'cascade','foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0x1ca')][_0xcc2c('0x10f')](db['ServicenowField'],{'as':'Subjects','foreignKey':_0xcc2c('0x1ba')});db['ServicenowConfiguration'][_0xcc2c('0x10f')](db[_0xcc2c('0xbf')],{'as':_0xcc2c('0x1bb'),'foreignKey':_0xcc2c('0x1bc')});db['ServicenowConfiguration'][_0xcc2c('0x10f')](db[_0xcc2c('0xbf')],{'as':'Fields','foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0x1ca')][_0xcc2c('0x11b')](db[_0xcc2c('0xbe')],{'as':_0xcc2c('0x160'),'foreignKey':'AccountId'});db['ServicenowField'][_0xcc2c('0x10f')](db[_0xcc2c('0xbf')],{'as':'Subject','foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0xbf')][_0xcc2c('0x10f')](db[_0xcc2c('0xbf')],{'as':_0xcc2c('0x1be'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xbf')][_0xcc2c('0x10f')](db[_0xcc2c('0xbf')],{'as':_0xcc2c('0x1bf'),'foreignKey':'FieldId'});db[_0xcc2c('0xbf')][_0xcc2c('0x11b')](db[_0xcc2c('0x93')],{'as':_0xcc2c('0x93'),'foreignKey':_0xcc2c('0x1c2')});db['Dynamics365Account'][_0xcc2c('0x10f')](db[_0xcc2c('0x1cb')],{'as':'Configurations','onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0xc1')][_0xcc2c('0x11b')](db[_0xcc2c('0x101')],{'as':_0xcc2c('0x101'),'foreignKey':_0xcc2c('0x156')});db[_0xcc2c('0x1cb')][_0xcc2c('0x10f')](db[_0xcc2c('0x1cc')],{'as':'Subjects','onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0x1cb')][_0xcc2c('0x10f')](db[_0xcc2c('0x1cc')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0x1cb')][_0xcc2c('0x10f')](db[_0xcc2c('0x1cc')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xcc2c('0x1cb')][_0xcc2c('0x11b')](db[_0xcc2c('0xc1')],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x1b7')});db[_0xcc2c('0x1cc')][_0xcc2c('0x10f')](db[_0xcc2c('0x1cc')],{'as':_0xcc2c('0x1bd'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0xcc2c('0x10f')](db[_0xcc2c('0x1cc')],{'as':'Description','foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0x1cc')][_0xcc2c('0x10f')](db[_0xcc2c('0x1cc')],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db[_0xcc2c('0x1cc')][_0xcc2c('0x11b')](db['Variable'],{'as':'Variable','foreignKey':_0xcc2c('0x1c2')});db['FreshsalesAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0xc5')],{'as':'Configurations','onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1b7')});db['FreshsalesConfiguration'][_0xcc2c('0x10f')](db[_0xcc2c('0xc7')],{'as':'Subjects','foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0xc5')][_0xcc2c('0x10f')](db[_0xcc2c('0xc7')],{'as':_0xcc2c('0x1bb'),'foreignKey':'DescriptionId'});db[_0xcc2c('0xc5')][_0xcc2c('0x10f')](db[_0xcc2c('0xc7')],{'as':_0xcc2c('0x1b5'),'foreignKey':'FieldId'});db[_0xcc2c('0xc5')][_0xcc2c('0x11b')](db[_0xcc2c('0x1cd')],{'as':'Account','foreignKey':'AccountId'});db['FreshsalesField'][_0xcc2c('0x10f')](db[_0xcc2c('0xc7')],{'as':_0xcc2c('0x1bd'),'foreignKey':_0xcc2c('0x1ba')});db[_0xcc2c('0xc7')][_0xcc2c('0x10f')](db[_0xcc2c('0xc7')],{'as':_0xcc2c('0x1be'),'foreignKey':_0xcc2c('0x1bc')});db[_0xcc2c('0xc7')][_0xcc2c('0x10f')](db[_0xcc2c('0xc7')],{'as':_0xcc2c('0x1bf'),'foreignKey':_0xcc2c('0x1c0')});db['FreshsalesField'][_0xcc2c('0x11b')](db[_0xcc2c('0x93')],{'as':_0xcc2c('0x93'),'foreignKey':_0xcc2c('0x1c2')});db[_0xcc2c('0x1ce')][_0xcc2c('0x11b')](db[_0xcc2c('0x5f')],{});db[_0xcc2c('0x1ce')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':_0xcc2c('0x15c')});db['ChatQueueReport'][_0xcc2c('0x11b')](db['CmContact'],{'as':_0xcc2c('0x152'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0xcc2c('0x11b')](db[_0xcc2c('0x114')],{});db[_0xcc2c('0x1ce')][_0xcc2c('0x11b')](db[_0xcc2c('0x65')],{});db[_0xcc2c('0x1ce')]['belongsTo'](db['User'],{});db[_0xcc2c('0x1ce')][_0xcc2c('0x11b')](db[_0xcc2c('0x67')],{});db[_0xcc2c('0x18e')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1cf')});db[_0xcc2c('0x18e')]['belongsTo'](db[_0xcc2c('0x10b')],{'onDelete':'cascade','foreignKey':'ToId'});db[_0xcc2c('0xd0')][_0xcc2c('0x10f')](db[_0xcc2c('0xce')],{'foreignKey':_0xcc2c('0x1d0'),'onDelete':'cascade'});db[_0xcc2c('0xd0')][_0xcc2c('0x10f')](db[_0xcc2c('0xcd')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xcc2c('0xd1')][_0xcc2c('0x11b')](db[_0xcc2c('0x51')],{});db[_0xcc2c('0xd1')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':'List','foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0xd1')][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x152'),'foreignKey':'ContactId'});db[_0xcc2c('0xd1')][_0xcc2c('0x11b')](db[_0xcc2c('0x55')],{});db[_0xcc2c('0xd1')][_0xcc2c('0x11b')](db[_0xcc2c('0x176')],{});db[_0xcc2c('0xd1')]['belongsTo'](db[_0xcc2c('0x10b')],{});db[_0xcc2c('0xd1')][_0xcc2c('0x11b')](db[_0xcc2c('0x57')],{});db[_0xcc2c('0xd5')][_0xcc2c('0x10f')](db[_0xcc2c('0xd0')],{'foreignKey':_0xcc2c('0x1d1')});db[_0xcc2c('0xd5')][_0xcc2c('0x10f')](db[_0xcc2c('0xce')],{'foreignKey':_0xcc2c('0x1d1')});db[_0xcc2c('0xd5')][_0xcc2c('0x10f')](db[_0xcc2c('0xcd')],{'foreignKey':'ProjectId'});db[_0xcc2c('0x135')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x164'),'through':'user_has_square_projects'});db['Team']['belongsToMany'](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x122')});db[_0xcc2c('0xdd')][_0xcc2c('0x11c')](db[_0xcc2c('0x19')],{'through':_0xcc2c('0x103'),'as':_0xcc2c('0x1d2')});db[_0xcc2c('0xdd')]['belongsToMany'](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xcc2c('0x1d3')});db['Team'][_0xcc2c('0x11c')](db['ChatQueue'],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xcc2c('0xdd')][_0xcc2c('0x11c')](db[_0xcc2c('0x4e')],{'through':_0xcc2c('0x174'),'as':_0xcc2c('0x129')});db[_0xcc2c('0xdd')]['belongsToMany'](db[_0xcc2c('0x57')],{'through':_0xcc2c('0x17a'),'as':_0xcc2c('0x12a')});db[_0xcc2c('0xdd')][_0xcc2c('0x11c')](db['OpenchannelQueue'],{'through':_0xcc2c('0x184'),'as':_0xcc2c('0x1d4')});db[_0xcc2c('0xdd')][_0xcc2c('0x11c')](db[_0xcc2c('0xff')],{'through':_0xcc2c('0x1d5'),'as':_0xcc2c('0x12b')});db[_0xcc2c('0xdd')]['belongsToMany'](db[_0xcc2c('0xef')],{'through':_0xcc2c('0x105'),'as':'VoicePrefixes'});db['Campaign'][_0xcc2c('0x10f')](db[_0xcc2c('0x6f')],{'as':'Hoppers','foreignKey':_0xcc2c('0x19b')});db[_0xcc2c('0x19a')][_0xcc2c('0x10f')](db[_0xcc2c('0x72')],{'as':_0xcc2c('0x112'),'foreignKey':_0xcc2c('0x19b')});db[_0xcc2c('0x19a')][_0xcc2c('0x10f')](db[_0xcc2c('0x74')],{'as':_0xcc2c('0x193'),'foreignKey':_0xcc2c('0x19b')});db['Campaign'][_0xcc2c('0x10f')](db[_0xcc2c('0x70')],{'as':_0xcc2c('0x141'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db['Trunk'],{'as':_0xcc2c('0x143'),'foreignKey':_0xcc2c('0x144')});db[_0xcc2c('0x19a')][_0xcc2c('0x11b')](db[_0xcc2c('0x143')],{'as':_0xcc2c('0x145'),'foreignKey':'TrunkBackupId'});db['Campaign']['belongsTo'](db[_0xcc2c('0x81')],{'as':_0xcc2c('0x81'),'foreignKey':_0xcc2c('0x16a')});db[_0xcc2c('0x19a')]['belongsTo'](db[_0xcc2c('0x135')],{'as':'SquareProject','foreignKey':_0xcc2c('0x1d6')});db[_0xcc2c('0x19a')][_0xcc2c('0x11c')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x148'),'through':_0xcc2c('0x1d7')});db['Campaign'][_0xcc2c('0x11c')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x1d8'),'through':'campaigns_has_cm_blacklists'});db[_0xcc2c('0xe4')][_0xcc2c('0x11b')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0xcc2c('0x1d9')][_0xcc2c('0x11b')](db['MailMessage'],{});db['MailTransferReport'][_0xcc2c('0x11b')](db['MailInteraction'],{});db[_0xcc2c('0x1d9')][_0xcc2c('0x11b')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0xcc2c('0x1da')});db[_0xcc2c('0x1d9')][_0xcc2c('0x11b')](db['User'],{'foreignKey':_0xcc2c('0x1db'),'as':_0xcc2c('0x1dc')});db[_0xcc2c('0x1d9')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'foreignKey':_0xcc2c('0x1dd'),'as':_0xcc2c('0x1de')});db[_0xcc2c('0x1d9')][_0xcc2c('0x11b')](db[_0xcc2c('0x3f')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0xcc2c('0x1d9')]['belongsTo'](db[_0xcc2c('0x154')],{'foreignKey':_0xcc2c('0x1df'),'as':_0xcc2c('0x1e0')});db['ChatTransferReport'][_0xcc2c('0x11b')](db[_0xcc2c('0x65')],{});db[_0xcc2c('0x1e1')]['belongsTo'](db['ChatInteraction'],{});db[_0xcc2c('0x1e1')][_0xcc2c('0x11b')](db[_0xcc2c('0x5f')],{'foreignKey':_0xcc2c('0x1e2'),'as':'FromAccount'});db['ChatTransferReport'][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'foreignKey':_0xcc2c('0x1db'),'as':_0xcc2c('0x1dc')});db[_0xcc2c('0x1e1')]['belongsTo'](db[_0xcc2c('0x10b')],{'foreignKey':'ToUserId','as':_0xcc2c('0x1de')});db[_0xcc2c('0x1e1')][_0xcc2c('0x11b')](db[_0xcc2c('0x67')],{'foreignKey':_0xcc2c('0x1e3'),'as':'ToQueue'});db['ChatTransferReport'][_0xcc2c('0x11b')](db[_0xcc2c('0x5f')],{'foreignKey':_0xcc2c('0x1e4'),'as':_0xcc2c('0x1e0')});db[_0xcc2c('0xe9')][_0xcc2c('0x11b')](db[_0xcc2c('0x171')],{});db[_0xcc2c('0xe9')][_0xcc2c('0x11b')](db['FaxInteraction'],{});db[_0xcc2c('0xe9')][_0xcc2c('0x11b')](db[_0xcc2c('0x12e')],{'foreignKey':'FromFaxAccountId','as':_0xcc2c('0x1da')});db[_0xcc2c('0xe9')][_0xcc2c('0x11b')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xcc2c('0xe9')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'foreignKey':_0xcc2c('0x1dd'),'as':_0xcc2c('0x1de')});db['FaxTransferReport'][_0xcc2c('0x11b')](db['FaxQueue'],{'foreignKey':_0xcc2c('0x1e5'),'as':_0xcc2c('0x1e6')});db[_0xcc2c('0xe9')][_0xcc2c('0x11b')](db[_0xcc2c('0x12e')],{'foreignKey':_0xcc2c('0x1e7'),'as':_0xcc2c('0x1e0')});db[_0xcc2c('0xeb')]['belongsTo'](db[_0xcc2c('0x17c')],{});db[_0xcc2c('0xeb')]['belongsTo'](db[_0xcc2c('0x5b')],{});db[_0xcc2c('0xeb')][_0xcc2c('0x11b')](db[_0xcc2c('0x58')],{'foreignKey':_0xcc2c('0x1e8'),'as':_0xcc2c('0x1da')});db[_0xcc2c('0xeb')]['belongsTo'](db[_0xcc2c('0x10b')],{'foreignKey':_0xcc2c('0x1db'),'as':_0xcc2c('0x1dc')});db[_0xcc2c('0xeb')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'foreignKey':'ToUserId','as':'ToAgent'});db['OpenchannelTransferReport']['belongsTo'](db[_0xcc2c('0x5e')],{'foreignKey':_0xcc2c('0x1e9'),'as':_0xcc2c('0x1e6')});db[_0xcc2c('0xeb')][_0xcc2c('0x11b')](db['OpenchannelAccount'],{'foreignKey':_0xcc2c('0x1ea'),'as':'ToAccount'});db[_0xcc2c('0x1eb')]['belongsTo'](db[_0xcc2c('0x176')],{});db[_0xcc2c('0x1eb')]['belongsTo'](db[_0xcc2c('0x55')],{});db['SmsTransferReport'][_0xcc2c('0x11b')](db[_0xcc2c('0x51')],{'foreignKey':_0xcc2c('0x1ec'),'as':_0xcc2c('0x1da')});db[_0xcc2c('0x1eb')][_0xcc2c('0x11b')](db['User'],{'foreignKey':_0xcc2c('0x1db'),'as':_0xcc2c('0x1dc')});db[_0xcc2c('0x1eb')][_0xcc2c('0x11b')](db['User'],{'foreignKey':_0xcc2c('0x1dd'),'as':_0xcc2c('0x1de')});db['SmsTransferReport']['belongsTo'](db[_0xcc2c('0x57')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xcc2c('0x1eb')][_0xcc2c('0x11b')](db[_0xcc2c('0x51')],{'foreignKey':'ToSmsAccountId','as':_0xcc2c('0x1e0')});db['CmList']['hasMany'](db[_0xcc2c('0x7d')],{'as':_0xcc2c('0x16d'),'foreignKey':_0xcc2c('0x15c'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0xed')][_0xcc2c('0x10f')](db[_0xcc2c('0x77')],{'as':_0xcc2c('0x1ed'),'foreignKey':'ListId'});db[_0xcc2c('0xed')]['hasMany'](db[_0xcc2c('0x151')],{'as':_0xcc2c('0x11f'),'onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0xed')][_0xcc2c('0x10f')](db[_0xcc2c('0x72')],{'as':_0xcc2c('0x112'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0xed')]['hasMany'](db['CmHopperHistory'],{'as':_0xcc2c('0x1ee'),'foreignKey':'ListId'});db[_0xcc2c('0xed')][_0xcc2c('0x10f')](db[_0xcc2c('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0xed')][_0xcc2c('0x11c')](db['VoiceQueue'],{'as':_0xcc2c('0x1ef'),'through':_0xcc2c('0x149')});db[_0xcc2c('0xed')][_0xcc2c('0x11c')](db['User'],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x121')});db[_0xcc2c('0xef')]['hasMany'](db[_0xcc2c('0x17')],{'as':'Extensions','onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0xef')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x107')});db[_0xcc2c('0xef')][_0xcc2c('0x11c')](db[_0xcc2c('0xdd')],{'through':_0xcc2c('0x105'),'as':_0xcc2c('0x14b')});db[_0xcc2c('0xf0')][_0xcc2c('0x10f')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x164'),'foreignKey':'userProfileId'});db[_0xcc2c('0xf0')][_0xcc2c('0x10f')](db[_0xcc2c('0xf2')],{'as':_0xcc2c('0x1f0'),'foreignKey':_0xcc2c('0x1f1'),'onDelete':'cascade'});db[_0xcc2c('0xf2')]['hasMany'](db[_0xcc2c('0x1f2')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0xcc2c('0x10e')});db['WhatsappAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0x7d')],{'as':_0xcc2c('0x16d'),'foreignKey':_0xcc2c('0x1f3'),'onDelete':_0xcc2c('0x10e')});db[_0xcc2c('0xf6')][_0xcc2c('0x10f')](db[_0xcc2c('0x7c')],{'as':'Answers','foreignKey':_0xcc2c('0x1f3')});db['WhatsappAccount'][_0xcc2c('0x10f')](db[_0xcc2c('0xfb')],{'as':_0xcc2c('0x15b'),'foreignKey':_0xcc2c('0x1f3')});db[_0xcc2c('0xf6')]['hasMany'](db['WhatsappInteraction'],{'as':_0xcc2c('0x16f')});db[_0xcc2c('0xf6')][_0xcc2c('0x10f')](db[_0xcc2c('0xf8')],{'as':'Applications'});db[_0xcc2c('0xf6')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':_0xcc2c('0x15c')});db[_0xcc2c('0xf6')][_0xcc2c('0x11b')](db['Pause'],{'as':_0xcc2c('0x146'),'foreignKey':_0xcc2c('0x147')});db[_0xcc2c('0xf6')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x1f4')});db[_0xcc2c('0xf8')]['belongsTo'](db[_0xcc2c('0x10b')],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0xf8')][_0xcc2c('0x11b')](db[_0xcc2c('0xff')],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0xf8')][_0xcc2c('0x11b')](db[_0xcc2c('0xf6')],{'onDelete':_0xcc2c('0x169')});db[_0xcc2c('0xf8')][_0xcc2c('0x11b')](db[_0xcc2c('0x81')],{'onDelete':_0xcc2c('0x169'),'foreignKey':'IntervalId'});db[_0xcc2c('0xf8')][_0xcc2c('0x11b')](db[_0xcc2c('0x8a')],{'onDelete':_0xcc2c('0x169'),'foreignKey':_0xcc2c('0x16b')});db[_0xcc2c('0x126')][_0xcc2c('0x10f')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xcc2c('0x10e'),'foreignKey':_0xcc2c('0x1f5')});db[_0xcc2c('0x126')][_0xcc2c('0x11b')](db[_0xcc2c('0xf6')],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x1f3')});db['WhatsappInteraction']['belongsTo'](db['CmContact'],{'as':_0xcc2c('0x152'),'foreignKey':_0xcc2c('0x153')});db[_0xcc2c('0x126')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':'Owner','foreignKey':_0xcc2c('0x10d')});db[_0xcc2c('0x126')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xcc2c('0x126')][_0xcc2c('0x11c')](db[_0xcc2c('0x8a')],{'through':_0xcc2c('0x1f6'),'as':_0xcc2c('0x163')});db[_0xcc2c('0x126')][_0xcc2c('0x11c')](db[_0xcc2c('0x10b')],{'as':'Users','through':_0xcc2c('0x127'),'foreignKey':_0xcc2c('0x1f5')});db[_0xcc2c('0xfb')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x10b')});db[_0xcc2c('0xfb')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0xcc2c('0xfb')][_0xcc2c('0x11b')](db[_0xcc2c('0x126')],{'onDelete':_0xcc2c('0x10e'),'as':'Interaction','foreignKey':_0xcc2c('0x1f5')});db[_0xcc2c('0xfb')]['belongsTo'](db[_0xcc2c('0xf6')],{'as':_0xcc2c('0x160'),'foreignKey':_0xcc2c('0x1f3')});db['WhatsappQueueReport'][_0xcc2c('0x11b')](db[_0xcc2c('0xf6')],{});db[_0xcc2c('0xfd')][_0xcc2c('0x11b')](db[_0xcc2c('0xed')],{'as':_0xcc2c('0x16c'),'foreignKey':'ListId'});db[_0xcc2c('0xfd')][_0xcc2c('0x11b')](db[_0xcc2c('0x151')],{'as':'Contact','foreignKey':_0xcc2c('0x153')});db['WhatsappQueueReport'][_0xcc2c('0x11b')](db[_0xcc2c('0x126')],{});db[_0xcc2c('0xfd')][_0xcc2c('0x11b')](db['WhatsappQueue'],{});db[_0xcc2c('0xfd')][_0xcc2c('0x11b')](db[_0xcc2c('0xfb')],{});db[_0xcc2c('0xfd')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{});db[_0xcc2c('0x1f7')]['belongsTo'](db['WhatsappMessage'],{});db[_0xcc2c('0x1f7')][_0xcc2c('0x11b')](db[_0xcc2c('0x126')],{});db[_0xcc2c('0x1f7')][_0xcc2c('0x11b')](db[_0xcc2c('0xf6')],{'foreignKey':_0xcc2c('0x1f8'),'as':'FromAccount'});db[_0xcc2c('0x1f7')][_0xcc2c('0x11b')](db[_0xcc2c('0xf6')],{'foreignKey':_0xcc2c('0x1f9'),'as':_0xcc2c('0x1e0')});db[_0xcc2c('0x1f7')]['belongsTo'](db[_0xcc2c('0xff')],{'foreignKey':_0xcc2c('0x1fa'),'as':_0xcc2c('0x1e6')});db['WhatsappTransferReport'][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'foreignKey':_0xcc2c('0x1db'),'as':'FromAgent'});db[_0xcc2c('0x1f7')][_0xcc2c('0x11b')](db[_0xcc2c('0x10b')],{'foreignKey':_0xcc2c('0x1dd'),'as':_0xcc2c('0x1de')});db[_0xcc2c('0xff')]['belongsToMany'](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x14a'),'through':_0xcc2c('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0xcc2c('0xff')][_0xcc2c('0x11c')](db[_0xcc2c('0xdd')],{'through':_0xcc2c('0x1d5'),'as':_0xcc2c('0x14b')});db[_0xcc2c('0x109')]['belongsTo'](db[_0xcc2c('0x10b')],{'as':_0xcc2c('0x1fb'),'foreignKey':_0xcc2c('0x10d'),'onDelete':'cascade','hooks':!![]});db[_0xcc2c('0x101')][_0xcc2c('0x10c')](db['Dynamics365Account'],{'as':_0xcc2c('0xc1'),'onDelete':_0xcc2c('0x169')});db['CloudProvider']['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0xcc2c('0x169')});db[_0xcc2c('0x101')]['hasOne'](db[_0xcc2c('0x157')],{'as':_0xcc2c('0x159'),'onDelete':_0xcc2c('0x169')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index cbc9ace..b390307 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5530=['./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./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/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','./api/squareRecording','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','/api/version','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','root','/apidoc','/www','join','/demo','/snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./errors','default','then','use','/api/users','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/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/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/queues','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./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'];(function(_0x4f35b8,_0x2b3356){var _0x58a7d2=function(_0x2b1013){while(--_0x2b1013){_0x4f35b8['push'](_0x4f35b8['shift']());}};_0x58a7d2(++_0x2b3356);}(_0x5530,0x180));var _0x0553=function(_0x3e7696,_0x5f0552){_0x3e7696=_0x3e7696-0x0;var _0x4e58cd=_0x5530[_0x3e7696];return _0x4e58cd;};'use strict';var path=require('path');var express=require(_0x0553('0x0'));var errors=require(_0x0553('0x1'));var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x0553('0x2')]=function(_0x5e57b3){return setupLoggers(_0x5e57b3)[_0x0553('0x3')](function(){_0x5e57b3[_0x0553('0x4')](_0x0553('0x5'),require('./api/user'));_0x5e57b3[_0x0553('0x4')]('/api/voice/chanspy',require(_0x0553('0x6')));_0x5e57b3[_0x0553('0x4')]('/api/voice/contexts',require(_0x0553('0x7')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x8'),require(_0x0553('0x9')));_0x5e57b3['use'](_0x0553('0xa'),require(_0x0553('0xb')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xc'),require(_0x0553('0xd')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xe'),require(_0x0553('0xf')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x10'),require(_0x0553('0x11')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x12'),require(_0x0553('0x13')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x14'),require(_0x0553('0x15')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x16'),require(_0x0553('0x17')));_0x5e57b3['use'](_0x0553('0x18'),require(_0x0553('0x19')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x1a'),require('./api/voiceAgentReport'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x1b'),require(_0x0553('0x1c')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x1d'),require(_0x0553('0x1e')));_0x5e57b3['use'](_0x0553('0x1f'),require(_0x0553('0x20')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x21'),require(_0x0553('0x22')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x23'),require('./api/mailServerOut'));_0x5e57b3[_0x0553('0x4')]('/api/mail/accounts',require('./api/mailAccount'));_0x5e57b3['use'](_0x0553('0x24'),require('./api/mailQueue'));_0x5e57b3['use']('/api/mail/substatuses',require('./api/mailSubstatus'));_0x5e57b3[_0x0553('0x4')]('/api/mail/interactions',require(_0x0553('0x25')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x26'),require(_0x0553('0x27')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x28'),require(_0x0553('0x29')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x2a'),require(_0x0553('0x2b')));_0x5e57b3[_0x0553('0x4')]('/api/dashboards',require(_0x0553('0x2c')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x2d'),require(_0x0553('0x2e')));_0x5e57b3[_0x0553('0x4')]('/api/fax/accounts',require(_0x0553('0x2f')));_0x5e57b3[_0x0553('0x4')]('/api/fax/applications',require(_0x0553('0x30')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x31'),require(_0x0553('0x32')));_0x5e57b3['use'](_0x0553('0x33'),require(_0x0553('0x34')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x35'),require(_0x0553('0x36')));_0x5e57b3[_0x0553('0x4')]('/api/fax/reports/queue',require(_0x0553('0x37')));_0x5e57b3[_0x0553('0x4')]('/api/sms/accounts',require('./api/smsAccount'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x38'),require(_0x0553('0x39')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x3a'),require(_0x0553('0x3b')));_0x5e57b3[_0x0553('0x4')]('/api/sms/messages',require(_0x0553('0x3c')));_0x5e57b3['use']('/api/sms/queues',require(_0x0553('0x3d')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x3e'),require('./api/openchannelAccount'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x3f'),require(_0x0553('0x40')));_0x5e57b3['use'](_0x0553('0x41'),require(_0x0553('0x42')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x43'),require('./api/openchannelMessage'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x44'),require(_0x0553('0x45')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x46'),require('./api/chatWebsite'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x47'),require(_0x0553('0x48')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x49'),require('./api/chatApplication'));_0x5e57b3['use'](_0x0553('0x4a'),require(_0x0553('0x4b')));_0x5e57b3[_0x0553('0x4')]('/api/chat/messages',require(_0x0553('0x4c')));_0x5e57b3[_0x0553('0x4')]('/api/chat/offline_messages',require(_0x0553('0x4d')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x4e'),require(_0x0553('0x4f')));_0x5e57b3[_0x0553('0x4')]('/api/chat/groups',require(_0x0553('0x50')));_0x5e57b3['use'](_0x0553('0x51'),require(_0x0553('0x52')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x53'),require(_0x0553('0x54')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x55'),require('./api/cmContact'));_0x5e57b3[_0x0553('0x4')]('/api/cm/hopper',require(_0x0553('0x56')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x57'),require('./api/cmHopperBlack'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x58'),require(_0x0553('0x59')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x5a'),require(_0x0553('0x5b')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x5c'),require(_0x0553('0x5d')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x5e'),require(_0x0553('0x5f')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x60'),require(_0x0553('0x61')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x62'),require('./api/cannedAnswer'));_0x5e57b3[_0x0553('0x4')]('/api/dispositions',require('./api/disposition'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x63'),require(_0x0553('0x64')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x65'),require('./api/interval'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x66'),require(_0x0553('0x67')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x68'),require('./api/cdr'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x69'),require(_0x0553('0x6a')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x6b'),require('./api/schedule'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x6c'),require(_0x0553('0x6d')));_0x5e57b3[_0x0553('0x4')]('/api/tags',require(_0x0553('0x6e')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x6f'),require(_0x0553('0x70')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x71'),require(_0x0553('0x72')));_0x5e57b3['use']('/api/cm_hopper_additional_phones',require(_0x0553('0x73')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x74'),require(_0x0553('0x75')));_0x5e57b3['use'](_0x0553('0x76'),require(_0x0553('0x77')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x78'),require('./api/variable'));_0x5e57b3[_0x0553('0x4')]('/api/integrations',require(_0x0553('0x79')));_0x5e57b3['use'](_0x0553('0x7a'),require(_0x0553('0x7b')));_0x5e57b3[_0x0553('0x4')]('/api/analytics/custom_reports',require(_0x0553('0x7c')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x7d'),require('./api/analyticDefaultReport'));_0x5e57b3[_0x0553('0x4')]('/api/analytics/extracted_reports',require(_0x0553('0x7e')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x7f'),require(_0x0553('0x80')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x81'),require(_0x0553('0x82')));_0x5e57b3['use']('/api/analytics/tree_reports',require(_0x0553('0x83')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x84'),require(_0x0553('0x85')));_0x5e57b3['use'](_0x0553('0x86'),require(_0x0553('0x87')));_0x5e57b3['use']('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x88'),require(_0x0553('0x89')));_0x5e57b3['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x5e57b3[_0x0553('0x4')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x8a'),require(_0x0553('0x8b')));_0x5e57b3['use'](_0x0553('0x8c'),require(_0x0553('0x8d')));_0x5e57b3[_0x0553('0x4')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x5e57b3[_0x0553('0x4')](_0x0553('0x8e'),require(_0x0553('0x8f')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x90'),require(_0x0553('0x91')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x92'),require(_0x0553('0x93')));_0x5e57b3['use']('/api/integrations/zendesk/accounts',require(_0x0553('0x94')));_0x5e57b3[_0x0553('0x4')]('/api/integrations/zendesk/configurations',require(_0x0553('0x95')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x96'),require(_0x0553('0x97')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x98'),require(_0x0553('0x99')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x9a'),require(_0x0553('0x9b')));_0x5e57b3[_0x0553('0x4')]('/api/integrations/freshdesk/fields',require(_0x0553('0x9c')));_0x5e57b3['use'](_0x0553('0x9d'),require(_0x0553('0x9e')));_0x5e57b3['use'](_0x0553('0x9f'),require('./api/intVtigerConfiguration'));_0x5e57b3[_0x0553('0x4')](_0x0553('0xa0'),require(_0x0553('0xa1')));_0x5e57b3[_0x0553('0x4')]('/api/integrations/servicenow/accounts',require(_0x0553('0xa2')));_0x5e57b3['use'](_0x0553('0xa3'),require(_0x0553('0xa4')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xa5'),require(_0x0553('0xa6')));_0x5e57b3[_0x0553('0x4')]('/api/integrations/dynamics365/accounts',require(_0x0553('0xa7')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xa8'),require(_0x0553('0xa9')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xaa'),require(_0x0553('0xab')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xac'),require(_0x0553('0xad')));_0x5e57b3['use'](_0x0553('0xae'),require(_0x0553('0xaf')));_0x5e57b3[_0x0553('0x4')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x5e57b3[_0x0553('0x4')](_0x0553('0xb0'),require('./api/network'));_0x5e57b3[_0x0553('0x4')](_0x0553('0xb1'),require(_0x0553('0xb2')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xb3'),require(_0x0553('0xb4')));_0x5e57b3['use'](_0x0553('0xb5'),require(_0x0553('0xb6')));_0x5e57b3['use']('/api/jscripty/questions/reports',require(_0x0553('0xb7')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xb8'),require(_0x0553('0xb9')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xba'),require(_0x0553('0xbb')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xbc'),require(_0x0553('0xbd')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xbe'),require(_0x0553('0xbf')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xc0'),require(_0x0553('0xc1')));_0x5e57b3['use'](_0x0553('0xc2'),require(_0x0553('0xc3')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xc4'),require('./api/squareOdbc'));_0x5e57b3['use']('/api/square/projects',require(_0x0553('0xc5')));_0x5e57b3['use']('/api/square/recordings',require(_0x0553('0xc6')));_0x5e57b3[_0x0553('0x4')]('/api/square/messages',require(_0x0553('0xc7')));_0x5e57b3[_0x0553('0x4')]('/api/teams',require(_0x0553('0xc8')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xc9'),require(_0x0553('0xca')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xcb'),require(_0x0553('0xcc')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xcd'),require(_0x0553('0xce')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xcf'),require(_0x0553('0xd0')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xd1'),require(_0x0553('0xd2')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xd3'),require('./api/mailTransferReport'));_0x5e57b3['use'](_0x0553('0xd4'),require(_0x0553('0xd5')));_0x5e57b3['use']('/api/fax/reports/transfer',require(_0x0553('0xd6')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xd7'),require(_0x0553('0xd8')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xd9'),require(_0x0553('0xda')));_0x5e57b3[_0x0553('0x4')]('/api/cm/lists',require('./api/cmList'));_0x5e57b3['use'](_0x0553('0xdb'),require('./api/voicePrefix'));_0x5e57b3['use'](_0x0553('0xdc'),require(_0x0553('0xdd')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xde'),require(_0x0553('0xdf')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xe0'),require(_0x0553('0xe1')));_0x5e57b3[_0x0553('0x4')]('/api/userNotifications',require(_0x0553('0xe2')));_0x5e57b3['use']('/api/whatsapp/accounts',require(_0x0553('0xe3')));_0x5e57b3[_0x0553('0x4')]('/api/whatsapp/applications',require(_0x0553('0xe4')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xe5'),require(_0x0553('0xe6')));_0x5e57b3[_0x0553('0x4')]('/api/whatsapp/messages',require(_0x0553('0xe7')));_0x5e57b3['use']('/api/whatsapp/reports/queue',require(_0x0553('0xe8')));_0x5e57b3[_0x0553('0x4')]('/api/whatsapp/reports/transfer',require(_0x0553('0xe9')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xea'),require(_0x0553('0xeb')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xec'),require(_0x0553('0xed')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xee'),require('./api/realtime'));_0x5e57b3[_0x0553('0x4')](_0x0553('0xef'),require(_0x0553('0xf0')));_0x5e57b3['use'](_0x0553('0xf1'),require(_0x0553('0xf2')));_0x5e57b3[_0x0553('0x4')]('/api/auth/google',require(_0x0553('0xf3')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xf4'),require(_0x0553('0xf5')));_0x5e57b3['use'](_0x0553('0xf6'),require(_0x0553('0xf7')));_0x5e57b3['use']('/api/rpc',require(_0x0553('0xf8')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xf9'),require('./api/version'));_0x5e57b3['use']('/api/system',require('./api/system'));_0x5e57b3[_0x0553('0x4')](_0x0553('0xfa'),require(_0x0553('0xfb')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xfc'),require(_0x0553('0xfd')));_0x5e57b3[_0x0553('0x4')](_0x0553('0xfe'),clientSideLogs);_0x5e57b3[_0x0553('0x4')]('/apidoc',express[_0x0553('0xff')](path['join'](config[_0x0553('0x100')],_0x0553('0x101'))));_0x5e57b3[_0x0553('0x4')](_0x0553('0x102'),express['static'](path[_0x0553('0x103')](config[_0x0553('0x100')],'/www')));_0x5e57b3[_0x0553('0x4')](_0x0553('0x104'),express[_0x0553('0xff')](path[_0x0553('0x103')](config[_0x0553('0x100')],_0x0553('0x104'))));_0x5e57b3[_0x0553('0x4')](_0x0553('0x105'),express[_0x0553('0xff')](path[_0x0553('0x103')](config[_0x0553('0x100')],'snippet',_0x0553('0x106'))));_0x5e57b3['use']('/plugins',express[_0x0553('0xff')](path[_0x0553('0x103')](config['root'],_0x0553('0x107'))));_0x5e57b3[_0x0553('0x108')](_0x0553('0x109'))[_0x0553('0x10a')](errors[0x194]);_0x5e57b3[_0x0553('0x108')]('/*')[_0x0553('0x10a')](function(_0x34fe6c,_0x224e8b){_0x224e8b[_0x0553('0x10b')](path[_0x0553('0x10c')](_0x5e57b3[_0x0553('0x10a')](_0x0553('0x10d'))+_0x0553('0x10e')));});return _0x5e57b3;});}; \ No newline at end of file +var _0x0e48=['/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelQueue','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmHopperAdditionalPhone','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount'];(function(_0x382863,_0x2daa3b){var _0xd75526=function(_0x3fa49f){while(--_0x3fa49f){_0x382863['push'](_0x382863['shift']());}};_0xd75526(++_0x2daa3b);}(_0x0e48,0xe2));var _0x80e4=function(_0x31a51a,_0x2b03ac){_0x31a51a=_0x31a51a-0x0;var _0x3b764c=_0x0e48[_0x31a51a];return _0x3b764c;};'use strict';var path=require(_0x80e4('0x0'));var express=require(_0x80e4('0x1'));var errors=require(_0x80e4('0x2'));var config=require(_0x80e4('0x3'));var setupLoggers=require(_0x80e4('0x4'))[_0x80e4('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0x80e4('0x6')]=function(_0x271457){return setupLoggers(_0x271457)['then'](function(){_0x271457[_0x80e4('0x7')](_0x80e4('0x8'),require(_0x80e4('0x9')));_0x271457[_0x80e4('0x7')](_0x80e4('0xa'),require('./api/voiceChanSpy'));_0x271457[_0x80e4('0x7')](_0x80e4('0xb'),require(_0x80e4('0xc')));_0x271457['use']('/api/voice/extensions',require('./api/voiceExtension'));_0x271457[_0x80e4('0x7')]('/api/voice/mohs',require(_0x80e4('0xd')));_0x271457[_0x80e4('0x7')](_0x80e4('0xe'),require(_0x80e4('0xf')));_0x271457['use'](_0x80e4('0x10'),require('./api/voiceRecording'));_0x271457[_0x80e4('0x7')](_0x80e4('0x11'),require('./api/screenRecording'));_0x271457[_0x80e4('0x7')](_0x80e4('0x12'),require('./api/voiceMail'));_0x271457['use'](_0x80e4('0x13'),require(_0x80e4('0x14')));_0x271457[_0x80e4('0x7')](_0x80e4('0x15'),require(_0x80e4('0x16')));_0x271457[_0x80e4('0x7')](_0x80e4('0x17'),require('./api/voiceDialReport'));_0x271457[_0x80e4('0x7')](_0x80e4('0x18'),require(_0x80e4('0x19')));_0x271457[_0x80e4('0x7')]('/api/voice/queues/reports',require(_0x80e4('0x1a')));_0x271457[_0x80e4('0x7')](_0x80e4('0x1b'),require(_0x80e4('0x1c')));_0x271457[_0x80e4('0x7')](_0x80e4('0x1d'),require(_0x80e4('0x1e')));_0x271457[_0x80e4('0x7')]('/api/voice/transfers/reports',require(_0x80e4('0x1f')));_0x271457[_0x80e4('0x7')]('/api/mail/out_servers',require(_0x80e4('0x20')));_0x271457[_0x80e4('0x7')](_0x80e4('0x21'),require(_0x80e4('0x22')));_0x271457['use'](_0x80e4('0x23'),require(_0x80e4('0x24')));_0x271457[_0x80e4('0x7')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x271457[_0x80e4('0x7')](_0x80e4('0x25'),require(_0x80e4('0x26')));_0x271457['use'](_0x80e4('0x27'),require(_0x80e4('0x28')));_0x271457[_0x80e4('0x7')](_0x80e4('0x29'),require(_0x80e4('0x2a')));_0x271457[_0x80e4('0x7')]('/api/mail/reports/queue',require(_0x80e4('0x2b')));_0x271457[_0x80e4('0x7')](_0x80e4('0x2c'),require(_0x80e4('0x2d')));_0x271457[_0x80e4('0x7')]('/api/dashboards/items',require(_0x80e4('0x2e')));_0x271457[_0x80e4('0x7')]('/api/fax/accounts',require(_0x80e4('0x2f')));_0x271457[_0x80e4('0x7')](_0x80e4('0x30'),require(_0x80e4('0x31')));_0x271457[_0x80e4('0x7')](_0x80e4('0x32'),require(_0x80e4('0x33')));_0x271457[_0x80e4('0x7')](_0x80e4('0x34'),require('./api/faxMessage'));_0x271457[_0x80e4('0x7')](_0x80e4('0x35'),require(_0x80e4('0x36')));_0x271457[_0x80e4('0x7')](_0x80e4('0x37'),require(_0x80e4('0x38')));_0x271457[_0x80e4('0x7')](_0x80e4('0x39'),require(_0x80e4('0x3a')));_0x271457[_0x80e4('0x7')](_0x80e4('0x3b'),require(_0x80e4('0x3c')));_0x271457[_0x80e4('0x7')]('/api/sms/interactions',require(_0x80e4('0x3d')));_0x271457[_0x80e4('0x7')](_0x80e4('0x3e'),require(_0x80e4('0x3f')));_0x271457[_0x80e4('0x7')](_0x80e4('0x40'),require('./api/smsQueue'));_0x271457['use'](_0x80e4('0x41'),require(_0x80e4('0x42')));_0x271457['use']('/api/openchannel/applications',require(_0x80e4('0x43')));_0x271457[_0x80e4('0x7')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x271457[_0x80e4('0x7')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x271457[_0x80e4('0x7')]('/api/openchannel/queues',require(_0x80e4('0x44')));_0x271457['use']('/api/chat/websites',require('./api/chatWebsite'));_0x271457['use'](_0x80e4('0x45'),require(_0x80e4('0x46')));_0x271457['use']('/api/chat/applications',require(_0x80e4('0x47')));_0x271457[_0x80e4('0x7')](_0x80e4('0x48'),require(_0x80e4('0x49')));_0x271457['use'](_0x80e4('0x4a'),require(_0x80e4('0x4b')));_0x271457[_0x80e4('0x7')](_0x80e4('0x4c'),require('./api/chatOfflineMessage'));_0x271457[_0x80e4('0x7')](_0x80e4('0x4d'),require(_0x80e4('0x4e')));_0x271457[_0x80e4('0x7')](_0x80e4('0x4f'),require(_0x80e4('0x50')));_0x271457[_0x80e4('0x7')]('/api/chat/proactive_actions',require(_0x80e4('0x51')));_0x271457[_0x80e4('0x7')](_0x80e4('0x52'),require(_0x80e4('0x53')));_0x271457[_0x80e4('0x7')](_0x80e4('0x54'),require('./api/cmContact'));_0x271457[_0x80e4('0x7')]('/api/cm/hopper',require(_0x80e4('0x55')));_0x271457['use'](_0x80e4('0x56'),require(_0x80e4('0x57')));_0x271457[_0x80e4('0x7')](_0x80e4('0x58'),require(_0x80e4('0x59')));_0x271457[_0x80e4('0x7')](_0x80e4('0x5a'),require(_0x80e4('0x5b')));_0x271457[_0x80e4('0x7')](_0x80e4('0x5c'),require('./api/cmCustomField'));_0x271457[_0x80e4('0x7')]('/api/actions',require(_0x80e4('0x5d')));_0x271457[_0x80e4('0x7')](_0x80e4('0x5e'),require(_0x80e4('0x5f')));_0x271457[_0x80e4('0x7')](_0x80e4('0x60'),require(_0x80e4('0x61')));_0x271457[_0x80e4('0x7')](_0x80e4('0x62'),require('./api/disposition'));_0x271457[_0x80e4('0x7')](_0x80e4('0x63'),require(_0x80e4('0x64')));_0x271457[_0x80e4('0x7')](_0x80e4('0x65'),require(_0x80e4('0x66')));_0x271457[_0x80e4('0x7')](_0x80e4('0x67'),require(_0x80e4('0x68')));_0x271457['use']('/api/cdr',require(_0x80e4('0x69')));_0x271457[_0x80e4('0x7')](_0x80e4('0x6a'),require(_0x80e4('0x6b')));_0x271457[_0x80e4('0x7')](_0x80e4('0x6c'),require(_0x80e4('0x6d')));_0x271457[_0x80e4('0x7')](_0x80e4('0x6e'),require(_0x80e4('0x6f')));_0x271457[_0x80e4('0x7')]('/api/tags',require(_0x80e4('0x70')));_0x271457[_0x80e4('0x7')]('/api/contact_item_types',require(_0x80e4('0x71')));_0x271457[_0x80e4('0x7')](_0x80e4('0x72'),require('./api/cmContactHasItem'));_0x271457[_0x80e4('0x7')]('/api/cm_hopper_additional_phones',require(_0x80e4('0x73')));_0x271457[_0x80e4('0x7')]('/api/templates',require('./api/template'));_0x271457[_0x80e4('0x7')]('/api/triggers',require(_0x80e4('0x74')));_0x271457[_0x80e4('0x7')](_0x80e4('0x75'),require(_0x80e4('0x76')));_0x271457[_0x80e4('0x7')](_0x80e4('0x77'),require(_0x80e4('0x78')));_0x271457['use'](_0x80e4('0x79'),require(_0x80e4('0x7a')));_0x271457[_0x80e4('0x7')](_0x80e4('0x7b'),require(_0x80e4('0x7c')));_0x271457[_0x80e4('0x7')](_0x80e4('0x7d'),require(_0x80e4('0x7e')));_0x271457[_0x80e4('0x7')](_0x80e4('0x7f'),require(_0x80e4('0x80')));_0x271457[_0x80e4('0x7')](_0x80e4('0x81'),require(_0x80e4('0x82')));_0x271457[_0x80e4('0x7')]('/api/analytics/field_reports',require(_0x80e4('0x83')));_0x271457[_0x80e4('0x7')]('/api/analytics/tree_reports',require(_0x80e4('0x84')));_0x271457[_0x80e4('0x7')](_0x80e4('0x85'),require('./api/intSalesforceAccount'));_0x271457[_0x80e4('0x7')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x271457[_0x80e4('0x7')](_0x80e4('0x86'),require(_0x80e4('0x87')));_0x271457[_0x80e4('0x7')](_0x80e4('0x88'),require(_0x80e4('0x89')));_0x271457[_0x80e4('0x7')](_0x80e4('0x8a'),require(_0x80e4('0x8b')));_0x271457[_0x80e4('0x7')]('/api/integrations/sugarcrm/fields',require(_0x80e4('0x8c')));_0x271457[_0x80e4('0x7')](_0x80e4('0x8d'),require(_0x80e4('0x8e')));_0x271457[_0x80e4('0x7')](_0x80e4('0x8f'),require(_0x80e4('0x90')));_0x271457[_0x80e4('0x7')](_0x80e4('0x91'),require('./api/intDeskField'));_0x271457[_0x80e4('0x7')](_0x80e4('0x92'),require(_0x80e4('0x93')));_0x271457[_0x80e4('0x7')](_0x80e4('0x94'),require('./api/intZohoConfiguration'));_0x271457[_0x80e4('0x7')](_0x80e4('0x95'),require(_0x80e4('0x96')));_0x271457[_0x80e4('0x7')]('/api/integrations/zendesk/accounts',require(_0x80e4('0x97')));_0x271457[_0x80e4('0x7')](_0x80e4('0x98'),require(_0x80e4('0x99')));_0x271457['use'](_0x80e4('0x9a'),require(_0x80e4('0x9b')));_0x271457[_0x80e4('0x7')](_0x80e4('0x9c'),require('./api/intFreshdeskAccount'));_0x271457['use']('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x271457[_0x80e4('0x7')]('/api/integrations/freshdesk/fields',require(_0x80e4('0x9d')));_0x271457[_0x80e4('0x7')](_0x80e4('0x9e'),require(_0x80e4('0x9f')));_0x271457[_0x80e4('0x7')]('/api/integrations/vtiger/configurations',require(_0x80e4('0xa0')));_0x271457[_0x80e4('0x7')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x271457[_0x80e4('0x7')](_0x80e4('0xa1'),require(_0x80e4('0xa2')));_0x271457[_0x80e4('0x7')]('/api/integrations/servicenow/configurations',require(_0x80e4('0xa3')));_0x271457[_0x80e4('0x7')]('/api/integrations/servicenow/fields',require(_0x80e4('0xa4')));_0x271457[_0x80e4('0x7')](_0x80e4('0xa5'),require('./api/intDynamics365Account'));_0x271457[_0x80e4('0x7')](_0x80e4('0xa6'),require(_0x80e4('0xa7')));_0x271457[_0x80e4('0x7')](_0x80e4('0xa8'),require('./api/intDynamics365Field'));_0x271457[_0x80e4('0x7')](_0x80e4('0xa9'),require(_0x80e4('0xaa')));_0x271457['use']('/api/integrations/freshsales/configurations',require(_0x80e4('0xab')));_0x271457['use']('/api/integrations/freshsales/fields',require(_0x80e4('0xac')));_0x271457['use'](_0x80e4('0xad'),require(_0x80e4('0xae')));_0x271457['use'](_0x80e4('0xaf'),require(_0x80e4('0xb0')));_0x271457[_0x80e4('0x7')]('/api/chat/internal/messages',require(_0x80e4('0xb1')));_0x271457[_0x80e4('0x7')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x271457[_0x80e4('0x7')](_0x80e4('0xb2'),require('./api/jscriptyQuestionReport'));_0x271457[_0x80e4('0x7')](_0x80e4('0xb3'),require(_0x80e4('0xb4')));_0x271457[_0x80e4('0x7')](_0x80e4('0xb5'),require('./api/smsQueueReport'));_0x271457[_0x80e4('0x7')](_0x80e4('0xb6'),require(_0x80e4('0xb7')));_0x271457[_0x80e4('0x7')](_0x80e4('0xb8'),require('./api/squareReportDetail'));_0x271457['use'](_0x80e4('0xb9'),require(_0x80e4('0xba')));_0x271457[_0x80e4('0x7')](_0x80e4('0xbb'),require('./api/setting'));_0x271457[_0x80e4('0x7')](_0x80e4('0xbc'),require('./api/squareOdbc'));_0x271457[_0x80e4('0x7')](_0x80e4('0xbd'),require(_0x80e4('0xbe')));_0x271457[_0x80e4('0x7')](_0x80e4('0xbf'),require('./api/squareRecording'));_0x271457[_0x80e4('0x7')](_0x80e4('0xc0'),require(_0x80e4('0xc1')));_0x271457[_0x80e4('0x7')](_0x80e4('0xc2'),require(_0x80e4('0xc3')));_0x271457['use']('/api/license',require(_0x80e4('0xc4')));_0x271457[_0x80e4('0x7')](_0x80e4('0xc5'),require('./api/campaign'));_0x271457[_0x80e4('0x7')](_0x80e4('0xc6'),require(_0x80e4('0xc7')));_0x271457['use'](_0x80e4('0xc8'),require(_0x80e4('0xc9')));_0x271457[_0x80e4('0x7')]('/api/plugins',require(_0x80e4('0xca')));_0x271457[_0x80e4('0x7')](_0x80e4('0xcb'),require('./api/mailTransferReport'));_0x271457[_0x80e4('0x7')]('/api/chat/reports/transfer',require(_0x80e4('0xcc')));_0x271457[_0x80e4('0x7')](_0x80e4('0xcd'),require('./api/faxTransferReport'));_0x271457[_0x80e4('0x7')](_0x80e4('0xce'),require('./api/openchannelTransferReport'));_0x271457[_0x80e4('0x7')](_0x80e4('0xcf'),require(_0x80e4('0xd0')));_0x271457[_0x80e4('0x7')](_0x80e4('0xd1'),require(_0x80e4('0xd2')));_0x271457['use'](_0x80e4('0xd3'),require('./api/voicePrefix'));_0x271457[_0x80e4('0x7')](_0x80e4('0xd4'),require(_0x80e4('0xd5')));_0x271457[_0x80e4('0x7')](_0x80e4('0xd6'),require(_0x80e4('0xd7')));_0x271457['use'](_0x80e4('0xd8'),require('./api/userProfileResource'));_0x271457['use'](_0x80e4('0xd9'),require(_0x80e4('0xda')));_0x271457['use']('/api/whatsapp/accounts',require(_0x80e4('0xdb')));_0x271457[_0x80e4('0x7')](_0x80e4('0xdc'),require(_0x80e4('0xdd')));_0x271457['use'](_0x80e4('0xde'),require(_0x80e4('0xdf')));_0x271457['use'](_0x80e4('0xe0'),require('./api/whatsappMessage'));_0x271457[_0x80e4('0x7')]('/api/whatsapp/reports/queue',require(_0x80e4('0xe1')));_0x271457[_0x80e4('0x7')](_0x80e4('0xe2'),require('./api/whatsappTransferReport'));_0x271457[_0x80e4('0x7')](_0x80e4('0xe3'),require('./api/whatsappQueue'));_0x271457[_0x80e4('0x7')](_0x80e4('0xe4'),require(_0x80e4('0xe5')));_0x271457[_0x80e4('0x7')](_0x80e4('0xe6'),require(_0x80e4('0xe7')));_0x271457[_0x80e4('0x7')]('/api/user-settings',require(_0x80e4('0xe8')));_0x271457[_0x80e4('0x7')](_0x80e4('0xe9'),require(_0x80e4('0xea')));_0x271457[_0x80e4('0x7')](_0x80e4('0xeb'),require(_0x80e4('0xec')));_0x271457['use']('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x271457[_0x80e4('0x7')]('/api/jira',require('./api/jira'));_0x271457['use'](_0x80e4('0xed'),require(_0x80e4('0xee')));_0x271457[_0x80e4('0x7')]('/api/version',require('./api/version'));_0x271457['use'](_0x80e4('0xef'),require(_0x80e4('0xf0')));_0x271457[_0x80e4('0x7')](_0x80e4('0xf1'),require(_0x80e4('0xf2')));_0x271457[_0x80e4('0x7')](_0x80e4('0xf3'),require(_0x80e4('0xf4')));_0x271457[_0x80e4('0x7')]('/api/logs',clientSideLogs);_0x271457[_0x80e4('0x7')](_0x80e4('0xf5'),express[_0x80e4('0xf6')](path[_0x80e4('0xf7')](config[_0x80e4('0xf8')],'/apidoc')));_0x271457[_0x80e4('0x7')]('/www',express[_0x80e4('0xf6')](path[_0x80e4('0xf7')](config[_0x80e4('0xf8')],_0x80e4('0xf9'))));_0x271457[_0x80e4('0x7')]('/demo',express[_0x80e4('0xf6')](path[_0x80e4('0xf7')](config['root'],_0x80e4('0xfa'))));_0x271457['use'](_0x80e4('0xfb'),express[_0x80e4('0xf6')](path[_0x80e4('0xf7')](config[_0x80e4('0xf8')],_0x80e4('0xfc'),_0x80e4('0xfd'))));_0x271457[_0x80e4('0x7')]('/plugins',express[_0x80e4('0xf6')](path[_0x80e4('0xf7')](config[_0x80e4('0xf8')],_0x80e4('0xfe'))));_0x271457['route'](_0x80e4('0xff'))[_0x80e4('0x100')](errors[0x194]);_0x271457['route']('/*')[_0x80e4('0x100')](function(_0x17c5f6,_0x2fa328){_0x2fa328[_0x80e4('0x101')](path[_0x80e4('0x102')](_0x271457[_0x80e4('0x100')](_0x80e4('0x103'))+_0x80e4('0x104')));});return _0x271457;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 1704669..26c8c6f 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f10=['../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x0f10,0x7b));var _0x00f1=function(_0x5d5920,_0x2e7a68){_0x5d5920=_0x5d5920-0x0;var _0x4b9f37=_0x0f10[_0x5d5920];return _0x4b9f37;};'use strict';var jayson=require(_0x00f1('0x0'));var _=require(_0x00f1('0x1'));var config=require(_0x00f1('0x2'));exports[_0x00f1('0x3')]=function(){return new Promise(function(_0x364903,_0x1d237d){var _0x445cb9={};_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x4')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x6')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x7')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x8')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x9')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xa')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0xb')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xc')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xd')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xe')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0xf')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x10')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x11')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x12')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x13')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x445cb9=_['merge'](_0x445cb9,require('../api/faxAccount/faxAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x14')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/faxInteraction/faxInteraction.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x15')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x16')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x17')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x18')));_0x445cb9=_['merge'](_0x445cb9,require('../api/smsInteraction/smsInteraction.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x19')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1a')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1b')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1c')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1d')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1e')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x1f')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x20')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x21')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x22')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x23')));_0x445cb9=_['merge'](_0x445cb9,require('../api/cmHopper/cmHopper.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x24')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x25')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x26')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x27')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x28')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x29')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2a')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2b')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x2c')));_0x445cb9=_['merge'](_0x445cb9,require('../api/variable/variable.rpc'));_0x445cb9=_['merge'](_0x445cb9,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2d')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2e')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x2f')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x30')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x31')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x32')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x33')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x34')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/squareReport/squareReport.rpc'));_0x445cb9=_['merge'](_0x445cb9,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x35')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x36')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x37')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/squareRecording/squareRecording.rpc'));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require('../api/squareMessage/squareMessage.rpc'));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x38')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x39')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3a')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x3b')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3c')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3d')));_0x445cb9=_[_0x00f1('0x5')](_0x445cb9,require(_0x00f1('0x3e')));_0x445cb9=_['merge'](_0x445cb9,require(_0x00f1('0x3f')));var _0x5c43e0=jayson[_0x00f1('0x40')](_0x445cb9)[_0x00f1('0x41')]();var _0x5ca473=config[_0x00f1('0x42')][_0x00f1('0x43')]||config[_0x00f1('0x43')]+0x1;var _0x501f2e=config[_0x00f1('0x42')]['ip']||_0x00f1('0x44');_0x5c43e0['on'](_0x00f1('0x45'),function(_0x239e5c){return _0x1d237d(_0x239e5c);});_0x5c43e0[_0x00f1('0x3')](_0x5ca473,_0x501f2e,function(){console['log'](_0x00f1('0x46'),_0x501f2e,_0x5ca473);require(_0x00f1('0x47'))['default']();return _0x364903(_0x00f1('0x48')+_0x501f2e+':'+_0x5ca473);});});}; \ No newline at end of file +var _0x64e4=['listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/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/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/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/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','log','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x64e4,0x12a));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var _=require(_0x464e('0x0'));var config=require(_0x464e('0x1'));exports[_0x464e('0x2')]=function(){return new Promise(function(_0x1dc429,_0x418fc8){var _0x5ba6aa={};_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x3')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x5')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x6')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x7')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x8')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x9')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0xa')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0xb')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/trunk/trunk.rpc'));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0xc')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0xd')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/mailServerIn/mailServerIn.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/mailAccount/mailAccount.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/mailQueue/mailQueue.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0xe')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0xf')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x10')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x11')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x12')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x13')));_0x5ba6aa=_['merge'](_0x5ba6aa,require('../api/faxInteraction/faxInteraction.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x14')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x15')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x16')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/smsAccount/smsAccount.rpc'));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x17')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/smsMessage/smsMessage.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x18')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x19')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x1a')));_0x5ba6aa=_['merge'](_0x5ba6aa,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x1b')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x1c')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/chatInteraction/chatInteraction.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x1d')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x1e')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x1f')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x20')));_0x5ba6aa=_['merge'](_0x5ba6aa,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x21')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x22')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x23')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x24')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x25')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x26')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x27')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x28')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x29')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x2a')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x2b')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x2c')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x2d')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x2e')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x2f')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x30')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x31')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x32')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x33')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x34')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x35')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5ba6aa=_['merge'](_0x5ba6aa,require('../api/squareReport/squareReport.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x36')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x37')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x38')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x39')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x3a')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x3b')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x3c')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x3d')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x3e')));_0x5ba6aa=_['merge'](_0x5ba6aa,require(_0x464e('0x3f')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x40')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x41')));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5ba6aa=_[_0x464e('0x4')](_0x5ba6aa,require(_0x464e('0x42')));var _0x9aaabe=jayson[_0x464e('0x43')](_0x5ba6aa)[_0x464e('0x44')]();var _0x2aaed6=config['rpc'][_0x464e('0x45')]||config[_0x464e('0x45')]+0x1;var _0x22035b=config[_0x464e('0x46')]['ip']||'localhost';_0x9aaabe['on']('error',function(_0x5a2756){return _0x418fc8(_0x5a2756);});_0x9aaabe[_0x464e('0x2')](_0x2aaed6,_0x22035b,function(){console[_0x464e('0x47')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x22035b,_0x2aaed6);require(_0x464e('0x48'))[_0x464e('0x49')]();return _0x1dc429(_0x464e('0x4a')+_0x22035b+':'+_0x2aaed6);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e8b569a..47860ac 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 _0x4c50=['SET\x20PRIORITY\x20%s','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','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','inherits','sendRequest','command','sync','prototype','answer','ANSWER','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority'];(function(_0x56180e,_0x3ac63a){var _0x59d258=function(_0x1f9372){while(--_0x1f9372){_0x56180e['push'](_0x56180e['shift']());}};_0x59d258(++_0x3ac63a);}(_0x4c50,0x1f2));var _0x04c5=function(_0x5ed269,_0x5d0d37){_0x5ed269=_0x5ed269-0x0;var _0x26ac01=_0x4c50[_0x5ed269];return _0x26ac01;};'use strict';var util=require(_0x04c5('0x0'));var _=require('lodash');var EventEmitter=require(_0x04c5('0x1'))['EventEmitter'];var AGIReply=require(_0x04c5('0x2'));var AGIError=require(_0x04c5('0x3'));function AGIChannel(_0x2a99ac){var _0x38453a=this,_0x42b75b=new AGIReply(),_0x1d2a1d=![],_0x8df41a={};EventEmitter[_0x04c5('0x4')](_0x38453a);_0x2a99ac[_0x04c5('0x5')]('utf8');_0x2a99ac[_0x04c5('0x6')](0x8*0x3c*0x3c*0x3e8);_0x42b75b[_0x04c5('0x5')](_0x04c5('0x7'));_0x42b75b['on'](_0x04c5('0x8'),function(_0xed1e5b){for(var _0x5871ea in _0xed1e5b){_0x38453a[_0x5871ea]=_0xed1e5b[_0x5871ea];}_0x38453a[_0x04c5('0x9')](_0x04c5('0xa'));});_0x42b75b['on'](_0x04c5('0xb'),function(_0x20ffe3){if(_0x20ffe3[_0x04c5('0xc')]()=='hangup'){_0x38453a[_0x04c5('0x9')](_0x04c5('0xd'));return;}if(_0x20ffe3[_0x04c5('0xe')](0x0,0xb)==_0x04c5('0xf')){_0x1d2a1d=!![];}if(_0x1d2a1d){_0x8df41a['rx']+=_0x20ffe3+'\x0a';if(_0x20ffe3[_0x04c5('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x1d2a1d=![];}}else{_0x8df41a['rx']=_0x20ffe3;}if(_0x1d2a1d){return;}if(typeof _0x8df41a['cb']==_0x04c5('0x11')){var _0x498e0a=_0x8df41a['rx'][_0x04c5('0xe')](0x0,0x3),_0xa89389=null,_0x5bc321=null;_0x498e0a=parseInt(_0x498e0a);if(isNaN(_0x498e0a)){_0x8df41a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x04c5('0x12')});return;}if(_0x498e0a!=0xc8){_0x8df41a['cb'](null,{'code':_0x498e0a,'result':-0x1,'extra':'KO'});return;}_0xa89389=_0x8df41a['rx']['substring'](0x4)[_0x04c5('0x13')](_0x04c5('0x14'),'');if(_0xa89389[_0x04c5('0x15')]('\x20')!=-0x1){_0xa89389=_0xa89389[_0x04c5('0x16')](0x0,_0xa89389[_0x04c5('0x15')]('\x20'));}if(_[_0x04c5('0x17')](_0xa89389,'-1')){_0xa89389=parseInt(_0xa89389);}_0x5bc321=_0x8df41a['rx'][_0x04c5('0x18')]('\x20');if(_0x5bc321[_0x04c5('0x19')]==0x3){_0x5bc321=_0x5bc321[0x2][_0x04c5('0xe')](0x1,_0x5bc321[0x2][_0x04c5('0x19')]-0x1);}else if(_0x5bc321[_0x04c5('0x19')]>0x3){var _0x2dfeaa=/\((.+)\)/;var _0x3bb59c=_0x8df41a['rx'][_0x04c5('0x1a')](_0x2dfeaa);if(_0x3bb59c){_0x5bc321=_0x3bb59c[0x1];}else{_0x5bc321=null;}}else{_0x5bc321=null;}_0x8df41a['cb'](null,{'code':_0x498e0a,'result':_0xa89389,'extra':_0x5bc321});}});_0x2a99ac['on'](_0x04c5('0x1b'),function(_0x4d8ae6){_0x38453a[_0x04c5('0x9')](_0x04c5('0x1b'),new AGIError(_0x04c5('0x1c'),_0x4d8ae6[_0x04c5('0x1d')]));});_0x2a99ac['on'](_0x04c5('0x1e'),function(){_0x38453a[_0x04c5('0x9')](_0x04c5('0x1e'),new AGIError(_0x04c5('0x1f')));});_0x2a99ac['on']('timeout',function(){_0x38453a[_0x04c5('0x9')]('timeout',new AGIError(_0x04c5('0x20')));_0x2a99ac[_0x04c5('0x21')]();});_0x2a99ac[_0x04c5('0x22')](_0x42b75b);this['command']=function(_0x383d7e,_0x6b0273){var _0x383d7e=_0x383d7e||'',_0x6b0273=typeof _0x6b0273==_0x04c5('0x11')?_0x6b0273:new Function();_0x8df41a={'tx':_0x383d7e,'rx':'','cb':_0x6b0273};_0x2a99ac['write'](_0x383d7e+'\x0a');},this[_0x04c5('0x1e')]=function(){_0x2a99ac['destroy']();};}util[_0x04c5('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x04c5('0x24')]=function(_0x2e08e5){return this[_0x04c5('0x25')][_0x04c5('0x26')](this,_0x2e08e5);};AGIChannel[_0x04c5('0x27')][_0x04c5('0x28')]=function(){return this[_0x04c5('0x24')](_0x04c5('0x29'));};AGIChannel['prototype'][_0x04c5('0x2a')]=function(_0x275aa5,_0x3449cc,_0x2185f2){_0x275aa5=_0x275aa5===undefined?_0x04c5('0x2b'):_0x275aa5;_0x3449cc=_0x3449cc===undefined?'5':_0x3449cc;_0x2185f2=_0x2185f2===undefined?'1':_0x2185f2;return this[_0x04c5('0x24')](util[_0x04c5('0x2c')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x275aa5,_0x3449cc*0x3e8,_0x2185f2));};AGIChannel[_0x04c5('0x27')]['noop']=function(_0x4536c1){_0x4536c1=_0x4536c1||_0x04c5('0x2d');return this[_0x04c5('0x24')](util[_0x04c5('0x2c')](_0x04c5('0x2e'),_0x4536c1));};AGIChannel[_0x04c5('0x27')][_0x04c5('0x2f')]=function(_0xbcacd6,_0x122d0c){if(_['isArray'](_0x122d0c)){return this[_0x04c5('0x24')](util[_0x04c5('0x2c')](_0x04c5('0x30'),_0xbcacd6,_0x122d0c[_0x04c5('0x31')](',')));}return this[_0x04c5('0x24')](util[_0x04c5('0x2c')]('EXEC\x20%s\x20%s',_0xbcacd6,_0x122d0c));};AGIChannel['prototype'][_0x04c5('0x32')]=function(_0x5c1e39){return this[_0x04c5('0x24')](util['format'](_0x04c5('0x33'),_0x5c1e39));};AGIChannel[_0x04c5('0x27')][_0x04c5('0x34')]=function(_0x12eb29){return this[_0x04c5('0x24')](util['format'](_0x04c5('0x35'),_0x12eb29));};AGIChannel['prototype'][_0x04c5('0x36')]=function(_0x492867){return this[_0x04c5('0x24')](util['format'](_0x04c5('0x37'),_0x492867));};AGIChannel[_0x04c5('0x27')]['hangup']=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x04c5('0x27')][_0x04c5('0x38')]=function(_0x21fd4b,_0x3b5d29){var _0x252bff=_[_0x04c5('0x39')](_0x3b5d29)||_[_0x04c5('0x3a')](_0x3b5d29)?_0x3b5d29[_0x04c5('0x3b')]():_0x3b5d29;return this['sendRequest'](util['format'](_0x04c5('0x3c'),_0x21fd4b,_0x252bff?_0x252bff[_0x04c5('0x3b')]()[_0x04c5('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x04c5('0x3d')]=function(_0x34aaec,_0x4cc0b4){return this[_0x04c5('0x24')](util['format'](_0x04c5('0x3e'),_0x34aaec,_0x4cc0b4));};AGIChannel[_0x04c5('0x27')][_0x04c5('0x3f')]=function(_0x1c6ef6,_0x5c8236){return this[_0x04c5('0x24')](util[_0x04c5('0x2c')](_0x04c5('0x40'),_0x1c6ef6,_0x5c8236));};AGIChannel['prototype']['sayPhonetic']=function(_0x51ef0b,_0xdaa824){return this[_0x04c5('0x24')](util[_0x04c5('0x2c')](_0x04c5('0x41'),_0x51ef0b,_0xdaa824));};AGIChannel['prototype']['continueAt']=function(_0x5a6603,_0x1a8951,_0xb44a09){_0x1a8951=_0x1a8951||this['extension'];_0xb44a09=_0xb44a09||0x1;this[_0x04c5('0x32')](_0x5a6603);this[_0x04c5('0x34')](_0x1a8951);this[_0x04c5('0x36')](_0xb44a09);return this[_0x04c5('0x42')](util[_0x04c5('0x2c')](_0x04c5('0x43'),_0x5a6603,_0x1a8951,_0xb44a09));};AGIChannel['prototype'][_0x04c5('0x44')]=function(_0x3140e4){return this[_0x04c5('0x24')](util[_0x04c5('0x2c')](_0x04c5('0x45'),_0x3140e4));};AGIChannel['prototype']['recordFile']=function(_0x5873c5,_0x2795f2,_0x5aabc0,_0xa8c791,_0x387fc6,_0x86b9b4){_0x2795f2=_0x2795f2||_0x04c5('0x46');_0x5aabc0=_0x5aabc0||'';_0xa8c791=_0xa8c791===undefined?-0x1:_0xa8c791==='-1'?-0x1:_0xa8c791*0x3e8;_0x387fc6=_0x387fc6===undefined?'':'s='+_0x387fc6;_0x86b9b4=_0x86b9b4?'BEEP':'';return this[_0x04c5('0x24')](util['format'](_0x04c5('0x47'),_0x5873c5,_0x2795f2,_0x5aabc0,_0xa8c791,_0x86b9b4,_0x387fc6));};AGIChannel[_0x04c5('0x27')][_0x04c5('0x48')]=function(_0x5ba17c,_0x940325){_0x940325=_0x940325||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x5ba17c,_0x940325));};AGIChannel[_0x04c5('0x27')][_0x04c5('0x49')]=function(_0x511c75){return this[_0x04c5('0x2f')]('AGI',_0x511c75);};AGIChannel[_0x04c5('0x27')][_0x04c5('0x4a')]=function(_0x4e54e6){return this[_0x04c5('0x2f')](_0x04c5('0x4b'),_0x4e54e6);};AGIChannel['prototype'][_0x04c5('0x1b')]=function(_0x2f44eb,_0x2e93d2){this['noop'](util['format'](_0x04c5('0x4c'),_0x2f44eb['id'],_0x2f44eb[_0x04c5('0x4d')],_0x2e93d2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x04c5('0x4e')]=AGIChannel; \ No newline at end of file +var _0xdb21=['EventEmitter','./reply','./error','utf8','setTimeout','setEncoding','headers','emit','ready','line','hangup','search','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','prototype','sendRequest','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events'];(function(_0x48e3af,_0x54327e){var _0x717aed=function(_0x2f1e90){while(--_0x2f1e90){_0x48e3af['push'](_0x48e3af['shift']());}};_0x717aed(++_0x54327e);}(_0xdb21,0x135));var _0x1db2=function(_0x36c270,_0x2569ff){_0x36c270=_0x36c270-0x0;var _0x276c73=_0xdb21[_0x36c270];return _0x276c73;};'use strict';var util=require(_0x1db2('0x0'));var _=require(_0x1db2('0x1'));var EventEmitter=require(_0x1db2('0x2'))[_0x1db2('0x3')];var AGIReply=require(_0x1db2('0x4'));var AGIError=require(_0x1db2('0x5'));function AGIChannel(_0x3f2d52){var _0xdc2c0c=this,_0x4102c4=new AGIReply(),_0x54a04e=![],_0x3b16c7={};EventEmitter['call'](_0xdc2c0c);_0x3f2d52['setEncoding'](_0x1db2('0x6'));_0x3f2d52[_0x1db2('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4102c4[_0x1db2('0x8')](_0x1db2('0x6'));_0x4102c4['on'](_0x1db2('0x9'),function(_0x24210c){for(var _0x43c896 in _0x24210c){_0xdc2c0c[_0x43c896]=_0x24210c[_0x43c896];}_0xdc2c0c[_0x1db2('0xa')](_0x1db2('0xb'));});_0x4102c4['on'](_0x1db2('0xc'),function(_0x6bb76d){if(_0x6bb76d['toLowerCase']()==_0x1db2('0xd')){_0xdc2c0c[_0x1db2('0xa')](_0x1db2('0xd'));return;}if(_0x6bb76d['substring'](0x0,0xb)=='520-Invalid'){_0x54a04e=!![];}if(_0x54a04e){_0x3b16c7['rx']+=_0x6bb76d+'\x0a';if(_0x6bb76d[_0x1db2('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x54a04e=![];}}else{_0x3b16c7['rx']=_0x6bb76d;}if(_0x54a04e){return;}if(typeof _0x3b16c7['cb']==_0x1db2('0xf')){var _0x3886e9=_0x3b16c7['rx'][_0x1db2('0x10')](0x0,0x3),_0x322ae8=null,_0x1911b2=null;_0x3886e9=parseInt(_0x3886e9);if(isNaN(_0x3886e9)){_0x3b16c7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1db2('0x11')});return;}if(_0x3886e9!=0xc8){_0x3b16c7['cb'](null,{'code':_0x3886e9,'result':-0x1,'extra':'KO'});return;}_0x322ae8=_0x3b16c7['rx']['substring'](0x4)[_0x1db2('0x12')](_0x1db2('0x13'),'');if(_0x322ae8[_0x1db2('0x14')]('\x20')!=-0x1){_0x322ae8=_0x322ae8[_0x1db2('0x15')](0x0,_0x322ae8[_0x1db2('0x14')]('\x20'));}if(_[_0x1db2('0x16')](_0x322ae8,'-1')){_0x322ae8=parseInt(_0x322ae8);}_0x1911b2=_0x3b16c7['rx'][_0x1db2('0x17')]('\x20');if(_0x1911b2['length']==0x3){_0x1911b2=_0x1911b2[0x2][_0x1db2('0x10')](0x1,_0x1911b2[0x2]['length']-0x1);}else if(_0x1911b2[_0x1db2('0x18')]>0x3){var _0x233d76=/\((.+)\)/;var _0x3b422f=_0x3b16c7['rx'][_0x1db2('0x19')](_0x233d76);if(_0x3b422f){_0x1911b2=_0x3b422f[0x1];}else{_0x1911b2=null;}}else{_0x1911b2=null;}_0x3b16c7['cb'](null,{'code':_0x3886e9,'result':_0x322ae8,'extra':_0x1911b2});}});_0x3f2d52['on'](_0x1db2('0x1a'),function(_0xafdb1){_0xdc2c0c[_0x1db2('0xa')](_0x1db2('0x1a'),new AGIError(_0x1db2('0x1b'),_0xafdb1[_0x1db2('0x1c')]));});_0x3f2d52['on'](_0x1db2('0x1d'),function(){_0xdc2c0c[_0x1db2('0xa')](_0x1db2('0x1d'),new AGIError(_0x1db2('0x1e')));});_0x3f2d52['on'](_0x1db2('0x1f'),function(){_0xdc2c0c['emit'](_0x1db2('0x1f'),new AGIError(_0x1db2('0x20')));_0x3f2d52[_0x1db2('0x21')]();});_0x3f2d52['pipe'](_0x4102c4);this[_0x1db2('0x22')]=function(_0x550d1c,_0x2182ef){var _0x550d1c=_0x550d1c||'',_0x2182ef=typeof _0x2182ef==_0x1db2('0xf')?_0x2182ef:new Function();_0x3b16c7={'tx':_0x550d1c,'rx':'','cb':_0x2182ef};_0x3f2d52[_0x1db2('0x23')](_0x550d1c+'\x0a');},this['close']=function(){_0x3f2d52[_0x1db2('0x21')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1db2('0x24')]['sendRequest']=function(_0x2121df){return this['command']['sync'](this,_0x2121df);};AGIChannel[_0x1db2('0x24')]['answer']=function(){return this[_0x1db2('0x25')](_0x1db2('0x26'));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x27')]=function(_0x1ed8c5,_0x397279,_0xe7889d){_0x1ed8c5=_0x1ed8c5===undefined?'beep':_0x1ed8c5;_0x397279=_0x397279===undefined?'5':_0x397279;_0xe7889d=_0xe7889d===undefined?'1':_0xe7889d;return this[_0x1db2('0x25')](util[_0x1db2('0x28')](_0x1db2('0x29'),_0x1ed8c5,_0x397279*0x3e8,_0xe7889d));};AGIChannel['prototype'][_0x1db2('0x2a')]=function(_0x298e76){_0x298e76=_0x298e76||_0x1db2('0x2b');return this[_0x1db2('0x25')](util['format'](_0x1db2('0x2c'),_0x298e76));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x2d')]=function(_0x4464d9,_0x188a01){if(_[_0x1db2('0x2e')](_0x188a01)){return this[_0x1db2('0x25')](util[_0x1db2('0x28')](_0x1db2('0x2f'),_0x4464d9,_0x188a01['join'](',')));}return this[_0x1db2('0x25')](util[_0x1db2('0x28')](_0x1db2('0x2f'),_0x4464d9,_0x188a01));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x30')]=function(_0x1a3a19){return this[_0x1db2('0x25')](util['format'](_0x1db2('0x31'),_0x1a3a19));};AGIChannel['prototype'][_0x1db2('0x32')]=function(_0x432e5c){return this[_0x1db2('0x25')](util['format']('SET\x20EXTENSION\x20%s',_0x432e5c));};AGIChannel[_0x1db2('0x24')]['setPriority']=function(_0x2c7042){return this[_0x1db2('0x25')](util['format'](_0x1db2('0x33'),_0x2c7042));};AGIChannel[_0x1db2('0x24')][_0x1db2('0xd')]=function(){return this['sendRequest'](_0x1db2('0x34'));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x35')]=function(_0x47d417,_0x4982b8){var _0x91eab3=_[_0x1db2('0x36')](_0x4982b8)||_[_0x1db2('0x37')](_0x4982b8)?_0x4982b8[_0x1db2('0x38')]():_0x4982b8;return this[_0x1db2('0x25')](util[_0x1db2('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x47d417,_0x91eab3?_0x91eab3['toString']()[_0x1db2('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1db2('0x24')]['sayNumber']=function(_0x4aed51,_0x2188f3){return this[_0x1db2('0x25')](util[_0x1db2('0x28')](_0x1db2('0x39'),_0x4aed51,_0x2188f3));};AGIChannel['prototype'][_0x1db2('0x3a')]=function(_0x5bd176,_0x4daf74){return this[_0x1db2('0x25')](util['format'](_0x1db2('0x3b'),_0x5bd176,_0x4daf74));};AGIChannel['prototype'][_0x1db2('0x3c')]=function(_0x38a807,_0x53aaab){return this[_0x1db2('0x25')](util[_0x1db2('0x28')](_0x1db2('0x3d'),_0x38a807,_0x53aaab));};AGIChannel[_0x1db2('0x24')]['continueAt']=function(_0x4ed271,_0x338ff4,_0x536ca5){_0x338ff4=_0x338ff4||this[_0x1db2('0x3e')];_0x536ca5=_0x536ca5||0x1;this['setContext'](_0x4ed271);this[_0x1db2('0x32')](_0x338ff4);this[_0x1db2('0x3f')](_0x536ca5);return this[_0x1db2('0x2a')](util[_0x1db2('0x28')](_0x1db2('0x40'),_0x4ed271,_0x338ff4,_0x536ca5));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x41')]=function(_0x21ed90){return this[_0x1db2('0x25')](util[_0x1db2('0x28')](_0x1db2('0x42'),_0x21ed90));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x43')]=function(_0x520c46,_0x1c19d1,_0x208e7f,_0x180f31,_0x200723,_0x4f226d){_0x1c19d1=_0x1c19d1||_0x1db2('0x44');_0x208e7f=_0x208e7f||'';_0x180f31=_0x180f31===undefined?-0x1:_0x180f31==='-1'?-0x1:_0x180f31*0x3e8;_0x200723=_0x200723===undefined?'':'s='+_0x200723;_0x4f226d=_0x4f226d?_0x1db2('0x45'):'';return this['sendRequest'](util[_0x1db2('0x28')](_0x1db2('0x46'),_0x520c46,_0x1c19d1,_0x208e7f,_0x180f31,_0x4f226d,_0x200723));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x47')]=function(_0x5f3716,_0x5ea19a){_0x5ea19a=_0x5ea19a||'';return this[_0x1db2('0x25')](util[_0x1db2('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x5f3716,_0x5ea19a));};AGIChannel[_0x1db2('0x24')][_0x1db2('0x48')]=function(_0xf534c5){return this[_0x1db2('0x2d')](_0x1db2('0x49'),_0xf534c5);};AGIChannel[_0x1db2('0x24')][_0x1db2('0x4a')]=function(_0x164e29){return this['exec'](_0x1db2('0x4b'),_0x164e29);};AGIChannel[_0x1db2('0x24')][_0x1db2('0x1a')]=function(_0x525f29,_0x5dc4a2){this[_0x1db2('0x2a')](util[_0x1db2('0x28')](_0x1db2('0x4c'),_0x525f29['id'],_0x525f29['label'],_0x5dc4a2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1db2('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 6ba358c..121a93f 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 _0xec84=['push','apply','message','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x3f91af,_0x48325b){var _0xa47cd4=function(_0x5eb368){while(--_0x5eb368){_0x3f91af['push'](_0x3f91af['shift']());}};_0xa47cd4(++_0x48325b);}(_0xec84,0xe3));var _0x4ec8=function(_0x4691be,_0x4df7ed){_0x4691be=_0x4691be-0x0;var _0x4cd4a5=_0xec84[_0x4691be];return _0x4cd4a5;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x4ec8('0x0'),'E_AGI_ARGUMENT_PORT':_0x4ec8('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x4ec8('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x4ec8('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x4ec8('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x4ec8('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x4ec8('0x6'),'E_AGI_COMMAND_EMPTY':_0x4ec8('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4ec8('0x8'),'E_AGI_IVR_ENTRY':_0x4ec8('0x9')};function AGIError(_0x109e5e){var _0x109e5e=_0x109e5e||null,_0x1e7a20=_0x1e7a20||[],_0x38ee9d=0x1,_0x17717a='';if(!error[_0x109e5e]){_0x109e5e=_0x4ec8('0xa');}_0x1e7a20[_0x4ec8('0xb')](error[_0x109e5e]);while(arguments[_0x38ee9d]){_0x1e7a20[_0x4ec8('0xb')](arguments[_0x38ee9d]);_0x38ee9d++;}_0x17717a=util['format'][_0x4ec8('0xc')](util,_0x1e7a20);this[_0x4ec8('0xd')]=_0x17717a;this['name']=_0x109e5e;}module['exports']=AGIError; \ No newline at end of file +var _0xdadb=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0xdadb,0xf9));var _0xbdad=function(_0x162ee0,_0x291661){_0x162ee0=_0x162ee0-0x0;var _0x48fc5e=_0xdadb[_0x162ee0];return _0x48fc5e;};'use strict';var util=require(_0xbdad('0x0'));var error={'E_AGI_UNDEFINED':_0xbdad('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xbdad('0x2'),'E_AGI_SERVER_CLOSE':_0xbdad('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xbdad('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xbdad('0x5'),'E_AGI_SOCKET_ERROR':_0xbdad('0x6'),'E_AGI_SOCKET_CLOSE':_0xbdad('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xbdad('0x8'),'E_AGI_COMMAND_EMPTY':_0xbdad('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xbdad('0xa')};function AGIError(_0x20c5b8){var _0x20c5b8=_0x20c5b8||null,_0xc530bf=_0xc530bf||[],_0x1ee98e=0x1,_0x411aa4='';if(!error[_0x20c5b8]){_0x20c5b8='E_AGI_UNDEFINED';}_0xc530bf[_0xbdad('0xb')](error[_0x20c5b8]);while(arguments[_0x1ee98e]){_0xc530bf[_0xbdad('0xb')](arguments[_0x1ee98e]);_0x1ee98e++;}_0x411aa4=util['format'][_0xbdad('0xc')](util,_0xc530bf);this[_0xbdad('0xd')]=_0x411aa4;this[_0xbdad('0xe')]=_0x20c5b8;}module[_0xbdad('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index ab37546..f50c25b 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 _0xcb8d=['events','ioredis','./error','../../config/environment','defaults','redis','localhost','agi','emit','error','E_AGI_SERVER_ERROR','parse','projectUpdate','exports','lodash'];(function(_0x149a4e,_0x4c5017){var _0x4a1407=function(_0x27e1df){while(--_0x27e1df){_0x149a4e['push'](_0x149a4e['shift']());}};_0x4a1407(++_0x4c5017);}(_0xcb8d,0xef));var _0xdcb8=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0xcb8d[_0x178856];return _0x3c7fe7;};'use strict';var _=require(_0xdcb8('0x0'));var EventEmitter=require(_0xdcb8('0x1'))['EventEmitter'];var Redis=require(_0xdcb8('0x2'));var AGIError=require(_0xdcb8('0x3'));var config=require(_0xdcb8('0x4'));config['redis']=_[_0xdcb8('0x5')](config[_0xdcb8('0x6')],{'host':_0xdcb8('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xdcb8('0x6')]);sub['subscribe'](_0xdcb8('0x8'),function(_0x358b9b){if(_0x358b9b)return eventEmitter[_0xdcb8('0x9')](_0xdcb8('0xa'),new AGIError(_0xdcb8('0xb'),_0x358b9b));});sub['on']('message',function(_0x37d4a7,_0x2c087c){if(_0x37d4a7!==_0xdcb8('0x8'))return;try{var _0x1a0331=JSON[_0xdcb8('0xc')](_0x2c087c);eventEmitter[_0xdcb8('0x9')](_0xdcb8('0xd'),_0x1a0331);}catch(_0x2b4af2){eventEmitter[_0xdcb8('0x9')]('error',new AGIError(_0xdcb8('0xb'),_0x2b4af2));}});module[_0xdcb8('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x17cf=['defaults','subscribe','emit','message','agi','error','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x21770f,_0x3cc121){var _0x113ae0=function(_0x132b69){while(--_0x132b69){_0x21770f['push'](_0x21770f['shift']());}};_0x113ae0(++_0x3cc121);}(_0x17cf,0xf5));var _0xf17c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x17cf[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xf17c('0x0'));var EventEmitter=require(_0xf17c('0x1'))[_0xf17c('0x2')];var Redis=require(_0xf17c('0x3'));var AGIError=require(_0xf17c('0x4'));var config=require(_0xf17c('0x5'));config[_0xf17c('0x6')]=_[_0xf17c('0x7')](config[_0xf17c('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xf17c('0x6')]);sub[_0xf17c('0x8')]('agi',function(_0x2b9301){if(_0x2b9301)return eventEmitter[_0xf17c('0x9')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x2b9301));});sub['on'](_0xf17c('0xa'),function(_0x27ef02,_0x51b711){if(_0x27ef02!==_0xf17c('0xb'))return;try{var _0x37e633=JSON['parse'](_0x51b711);eventEmitter[_0xf17c('0x9')]('projectUpdate',_0x37e633);}catch(_0x15ed5d){eventEmitter[_0xf17c('0x9')](_0xf17c('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x15ed5d));}});module[_0xf17c('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index f14e925..e401b77 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 _0x08a2=['length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','traverseBFS','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','menu','getdigits','getsecretdigits','numberOfEdges','prototype','addVertex','vertices','edges','size','relations','info','stop\x20traverse'];(function(_0x5e3602,_0xf99294){var _0x456261=function(_0x838622){while(--_0x838622){_0x5e3602['push'](_0x5e3602['shift']());}};_0x456261(++_0xf99294);}(_0x08a2,0x15f));var _0x208a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x08a2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x208a('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x208a('0x1'),_0x208a('0x2'),_0x208a('0x3')];var Graph=function(){this['vertices']={};this['edges']={};this[_0x208a('0x4')]=0x0;};Graph[_0x208a('0x5')][_0x208a('0x6')]=function(_0x768a6d){this[_0x208a('0x7')][_0x768a6d['id']]=_0x768a6d;this['edges'][_0x768a6d['id']]=[];};Graph[_0x208a('0x5')]['addEdge']=function(_0x180234,_0x1a97af,_0x26e246){this[_0x208a('0x8')][_0x180234]['push']({'target':_0x1a97af,'condition':_0x26e246});this[_0x208a('0x4')]+=0x1;};Graph[_0x208a('0x5')]['size']=function(){return _[_0x208a('0x9')](this[_0x208a('0x7')]);};Graph['prototype'][_0x208a('0xa')]=function(){return this[_0x208a('0x4')];};Graph[_0x208a('0x5')]['getVertex']=function(_0x84af7b){return this[_0x208a('0x7')][_0x84af7b];};Graph[_0x208a('0x5')]['traverseBFS']=function(_0x2c9391,_0x136ba2){if(!this[_0x208a('0x7')][_0x2c9391]){return logger[_0x208a('0xb')]('no\x20vertex\x20found');}var _0x538526=_0x136ba2(this[_0x208a('0x7')][_0x2c9391]);if(!_0x538526){return logger[_0x208a('0xb')](_0x208a('0xc'));}if(this[_0x208a('0x8')][_0x2c9391][_0x208a('0xd')]===0x0){return logger[_0x208a('0xb')](_0x208a('0xe'));}for(var _0x1da860=0x0,_0x28083d=[],_0x1712d8=![];_0x1da860\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','connection'];(function(_0x21e7cf,_0x4a035c){var _0x339d92=function(_0x129e16){while(--_0x129e16){_0x21e7cf['push'](_0x21e7cf['shift']());}};_0x339d92(++_0x4a035c);}(_0xb0f3,0xe0));var _0x3b0f=function(_0x5c5bf5,_0x2b3e1b){_0x5c5bf5=_0x5c5bf5-0x0;var _0x188b4b=_0xb0f3[_0x5c5bf5];return _0x188b4b;};'use strict';var _=require(_0x3b0f('0x0'));var syncho=require(_0x3b0f('0x1'));var util=require(_0x3b0f('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x3b0f('0x3'));var utilLicense=require(_0x3b0f('0x4'));var rpc=require(_0x3b0f('0x5'));var Project=require('./project');var AGIEmitter=require(_0x3b0f('0x6'))[_0x3b0f('0x7')];var projects=[];config[_0x3b0f('0x3')]=_[_0x3b0f('0x8')](config[_0x3b0f('0x3')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x36c548){process[_0x3b0f('0x9')](function(){syncho(function(){try{setChannelVariables(_0x36c548);agiHandler(_0x36c548);}catch(_0x40a492){logger[_0x3b0f('0xa')](_0x40a492['stack']);}});});}function projectUpdateHandler(_0x2e1316){try{var _0xebe66d=_['findIndex'](projects,['id',_0x2e1316['id']]);if(_0xebe66d>-0x1){if(_0x2e1316[_0x3b0f('0xb')]===!![]){projects[_0x3b0f('0xc')](_0xebe66d,0x1);}else{projects[_0xebe66d]=_0x2e1316;}}else{projects[_0x3b0f('0xd')](_0x2e1316);}}catch(_0x353d2b){logger[_0x3b0f('0xa')](_0x353d2b[_0x3b0f('0xe')]);}}function listeningHandler(){console[_0x3b0f('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi']['port']);logger[_0x3b0f('0x10')](util[_0x3b0f('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x3b0f('0x3')]['ip'],config['agi'][_0x3b0f('0x12')]));}function errorHandler(_0x1edf5d){if(_0x1edf5d&&_0x1edf5d[_0x3b0f('0x13')]&&_0x1edf5d[_0x3b0f('0x14')]){logger['error'](util[_0x3b0f('0x11')](_0x3b0f('0x15'),_0x1edf5d[_0x3b0f('0x13')],_0x1edf5d[_0x3b0f('0x14')]));}else{logger[_0x3b0f('0xa')](util['format'](_0x3b0f('0x16'),_0x1edf5d[_0x3b0f('0xe')]));}}function closeHandler(){logger[_0x3b0f('0x10')](util['format'](_0x3b0f('0x17'),this['arg_1'],this['calleridname'],this[_0x3b0f('0x18')],this[_0x3b0f('0x19')],this[_0x3b0f('0x1a')]));try{createSquareReport(this);}catch(_0x120969){logger[_0x3b0f('0xa')](_0x120969[_0x3b0f('0xe')]);}}function timeoutHandler(){logger[_0x3b0f('0x10')](util[_0x3b0f('0x11')](_0x3b0f('0x1b'),this[_0x3b0f('0x1c')],this[_0x3b0f('0x1d')],this[_0x3b0f('0x18')],this[_0x3b0f('0x19')],this['uniqueid']));}function hangupHandler(){logger[_0x3b0f('0x10')](util[_0x3b0f('0x11')](_0x3b0f('0x1e'),this['arg_1'],this[_0x3b0f('0x1d')],this[_0x3b0f('0x18')],this[_0x3b0f('0x19')],this[_0x3b0f('0x1a')]));this['evtHangup']=!![];}function createSquareReport(_0x1bea39,_0x1e94a3){rpc[_0x3b0f('0x1f')](_0x1bea39)[_0x3b0f('0x20')](function(_0x28b8d9){if(_0x1e94a3){_0x1e94a3(null,_0x28b8d9);}})[_0x3b0f('0x21')](function(_0x4553cb){if(_0x1e94a3){_0x1e94a3(null,_0x4553cb);}});}function setChannelVariables(_0x53aa0a){for(var _0x2c255d in _0x53aa0a){if(_0x53aa0a[_0x3b0f('0x22')](_0x2c255d)){if(_0x2c255d[_0x3b0f('0x23')]('agi_')===0x0){_0x53aa0a[_0x2c255d[_0x3b0f('0x24')](0x4)]=_0x53aa0a[_0x2c255d];delete _0x53aa0a[_0x2c255d];}}}}function agiHandler(_0x4c3a91){logger['debug'](_0x3b0f('0x25'),JSON[_0x3b0f('0x26')](_0x4c3a91,null,0x2));logger[_0x3b0f('0x10')](util[_0x3b0f('0x11')](_0x3b0f('0x27'),_0x4c3a91[_0x3b0f('0x1c')],_0x4c3a91[_0x3b0f('0x1d')],_0x4c3a91[_0x3b0f('0x18')],_0x4c3a91['dnid'],_0x4c3a91[_0x3b0f('0x1a')]));_0x4c3a91['on']('error',errorHandler);_0x4c3a91['on'](_0x3b0f('0x28'),closeHandler);_0x4c3a91['on'](_0x3b0f('0x29'),timeoutHandler);_0x4c3a91[_0x3b0f('0x2a')]=![];_0x4c3a91['on'](_0x3b0f('0x2b'),hangupHandler);var _0x4c276e=_['find'](projects,[_0x3b0f('0x13'),_0x4c3a91['arg_1']]);if(!_0x4c276e)return Project[_0x3b0f('0x2c')](_0x4c3a91);if(!_0x4c276e[_0x3b0f('0x2d')])return Project[_0x3b0f('0x2e')](_0x4c3a91);return Project[_0x3b0f('0x2f')](_0x4c276e,_0x4c3a91);}function main(){var _0x20f905;return utilLicense[_0x3b0f('0x30')]()[_0x3b0f('0x20')](function(_0x458447){if(!_0x458447)return;if(_0x458447[_0x3b0f('0x31')]){if(_0x458447[_0x3b0f('0x32')]&&_0x458447[_0x3b0f('0x32')]>0x0){logger[_0x3b0f('0x10')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x458447[_0x3b0f('0x32')]));_0x20f905=_0x458447[_0x3b0f('0x32')];}else{logger[_0x3b0f('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x3b0f('0x10')](_0x3b0f('0x33'));_0x20f905=-0x1;}})[_0x3b0f('0x20')](function(){return Project[_0x3b0f('0x34')]();})[_0x3b0f('0x20')](function(_0x11028e){projects=_0x11028e;return;})[_0x3b0f('0x21')](function(_0x1f3184){logger[_0x3b0f('0xa')](_0x3b0f('0x35'),_0x1f3184['stack']);})[_0x3b0f('0x36')](function(){var _0x1d1f57=require('./server')(config[_0x3b0f('0x3')][_0x3b0f('0x12')],config[_0x3b0f('0x3')]['ip'],_0x20f905);_0x1d1f57['on']('error',errorHandler);_0x1d1f57['on']('listening',listeningHandler);_0x1d1f57['on'](_0x3b0f('0x37'),connectionHandler);_0x1d1f57['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xc36f=['info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','[%s]\x20%s','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','uniqueid','calleridname','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','createSquareReport','then','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','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','lodash','syncho','util','../../config/environment','agi','../../config/license/util','./project','EventEmitter','127.0.0.1','nextTick','error','stack','findIndex','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port'];(function(_0x2ad847,_0x42edea){var _0xed5770=function(_0x179dfe){while(--_0x179dfe){_0x2ad847['push'](_0x2ad847['shift']());}};_0xed5770(++_0x42edea);}(_0xc36f,0x151));var _0xfc36=function(_0x310a54,_0x44805f){_0x310a54=_0x310a54-0x0;var _0x3a69fc=_0xc36f[_0x310a54];return _0x3a69fc;};'use strict';var _=require(_0xfc36('0x0'));var syncho=require(_0xfc36('0x1'));var util=require(_0xfc36('0x2'));var config=require(_0xfc36('0x3'));var logger=require('../../config/logger')(_0xfc36('0x4'));var utilLicense=require(_0xfc36('0x5'));var rpc=require('./rpc');var Project=require(_0xfc36('0x6'));var AGIEmitter=require('./events')[_0xfc36('0x7')];var projects=[];config[_0xfc36('0x4')]=_['defaults'](config['agi'],{'ip':_0xfc36('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x3de341){process[_0xfc36('0x9')](function(){syncho(function(){try{setChannelVariables(_0x3de341);agiHandler(_0x3de341);}catch(_0x3230f8){logger[_0xfc36('0xa')](_0x3230f8[_0xfc36('0xb')]);}});});}function projectUpdateHandler(_0x17804e){try{var _0x1c6b8c=_[_0xfc36('0xc')](projects,['id',_0x17804e['id']]);if(_0x1c6b8c>-0x1){if(_0x17804e['deleted']===!![]){projects[_0xfc36('0xd')](_0x1c6b8c,0x1);}else{projects[_0x1c6b8c]=_0x17804e;}}else{projects['push'](_0x17804e);}}catch(_0xdf1f11){logger[_0xfc36('0xa')](_0xdf1f11[_0xfc36('0xb')]);}}function listeningHandler(){console[_0xfc36('0xe')](_0xfc36('0xf'),config[_0xfc36('0x4')][_0xfc36('0x10')]);logger[_0xfc36('0x11')](util[_0xfc36('0x12')](_0xfc36('0x13'),config[_0xfc36('0x4')]['ip'],config[_0xfc36('0x4')][_0xfc36('0x10')]));}function errorHandler(_0xeaa69c){if(_0xeaa69c&&_0xeaa69c['name']&&_0xeaa69c['message']){logger[_0xfc36('0xa')](util['format'](_0xfc36('0x14'),_0xeaa69c[_0xfc36('0x15')],_0xeaa69c[_0xfc36('0x16')]));}else{logger[_0xfc36('0xa')](util[_0xfc36('0x12')](_0xfc36('0x17'),_0xeaa69c[_0xfc36('0xb')]));}}function closeHandler(){logger[_0xfc36('0x11')](util[_0xfc36('0x12')](_0xfc36('0x18'),this[_0xfc36('0x19')],this['calleridname'],this['callerid'],this['dnid'],this[_0xfc36('0x1a')]));try{createSquareReport(this);}catch(_0x241369){logger[_0xfc36('0xa')](_0x241369[_0xfc36('0xb')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfc36('0x19')],this[_0xfc36('0x1b')],this['callerid'],this[_0xfc36('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0xfc36('0x11')](util[_0xfc36('0x12')](_0xfc36('0x1d'),this[_0xfc36('0x19')],this['calleridname'],this[_0xfc36('0x1e')],this[_0xfc36('0x1c')],this[_0xfc36('0x1a')]));this[_0xfc36('0x1f')]=!![];}function createSquareReport(_0x2b14ac,_0x392eeb){rpc[_0xfc36('0x20')](_0x2b14ac)[_0xfc36('0x21')](function(_0x701ed1){if(_0x392eeb){_0x392eeb(null,_0x701ed1);}})['catch'](function(_0x578fd0){if(_0x392eeb){_0x392eeb(null,_0x578fd0);}});}function setChannelVariables(_0x242537){for(var _0xfc244a in _0x242537){if(_0x242537[_0xfc36('0x22')](_0xfc244a)){if(_0xfc244a['indexOf'](_0xfc36('0x23'))===0x0){_0x242537[_0xfc244a['substring'](0x4)]=_0x242537[_0xfc244a];delete _0x242537[_0xfc244a];}}}}function agiHandler(_0x1852fe){logger[_0xfc36('0x24')](_0xfc36('0x25'),JSON[_0xfc36('0x26')](_0x1852fe,null,0x2));logger['info'](util[_0xfc36('0x12')](_0xfc36('0x27'),_0x1852fe[_0xfc36('0x19')],_0x1852fe[_0xfc36('0x1b')],_0x1852fe[_0xfc36('0x1e')],_0x1852fe[_0xfc36('0x1c')],_0x1852fe['uniqueid']));_0x1852fe['on'](_0xfc36('0xa'),errorHandler);_0x1852fe['on'](_0xfc36('0x28'),closeHandler);_0x1852fe['on'](_0xfc36('0x29'),timeoutHandler);_0x1852fe[_0xfc36('0x1f')]=![];_0x1852fe['on'](_0xfc36('0x2a'),hangupHandler);var _0x104250=_[_0xfc36('0x2b')](projects,[_0xfc36('0x15'),_0x1852fe[_0xfc36('0x19')]]);if(!_0x104250)return Project[_0xfc36('0x2c')](_0x1852fe);if(!_0x104250[_0xfc36('0x2d')])return Project[_0xfc36('0x2e')](_0x1852fe);return Project[_0xfc36('0x2f')](_0x104250,_0x1852fe);}function main(){var _0x140449;return utilLicense[_0xfc36('0x30')]()[_0xfc36('0x21')](function(_0x5e12ef){if(!_0x5e12ef)return;if(_0x5e12ef[_0xfc36('0x31')]){if(_0x5e12ef[_0xfc36('0x32')]&&_0x5e12ef[_0xfc36('0x32')]>0x0){logger[_0xfc36('0x11')](util[_0xfc36('0x12')](_0xfc36('0x33'),_0x5e12ef[_0xfc36('0x32')]));_0x140449=_0x5e12ef[_0xfc36('0x32')];}else{logger[_0xfc36('0x11')](_0xfc36('0x34'));}}else{logger[_0xfc36('0x11')](_0xfc36('0x35'));_0x140449=-0x1;}})[_0xfc36('0x21')](function(){return Project[_0xfc36('0x36')]();})[_0xfc36('0x21')](function(_0x30e3a7){projects=_0x30e3a7;return;})['catch'](function(_0x5ad2da){logger[_0xfc36('0xa')](_0xfc36('0x37'),_0x5ad2da['stack']);})[_0xfc36('0x38')](function(){var _0x407489=require(_0xfc36('0x39'))(config[_0xfc36('0x4')][_0xfc36('0x10')],config[_0xfc36('0x4')]['ip'],_0x140449);_0x407489['on'](_0xfc36('0xa'),errorHandler);_0x407489['on'](_0xfc36('0x3a'),listeningHandler);_0x407489['on']('connection',connectionHandler);_0x407489['on'](_0xfc36('0x28'),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 7c598a1..5b2b6fb 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 _0x2a53=['SendMail','bluebird','jayson/promise','client','then','error','message','result','catch','sendMailMessage'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2a53,0x1e1));var _0x32a5=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x2a53[_0x421cf8];return _0x145c48;};'use strict';var BPromise=require(_0x32a5('0x0'));var jayson=require(_0x32a5('0x1'));var client=jayson[_0x32a5('0x2')]['http']({'port':0x232b});function request(_0x41c635,_0x1c2a00){return new BPromise(function(_0xdd735f,_0x1dfd98){return client['request'](_0x41c635,_0x1c2a00)[_0x32a5('0x3')](function(_0x38816c){if(_0x38816c['error']){return _0x1dfd98(_0x38816c[_0x32a5('0x4')][_0x32a5('0x5')]);}else{return _0xdd735f(_0x38816c[_0x32a5('0x6')]);}})[_0x32a5('0x7')](function(_0x40c8b7){return _0x1dfd98(_0x40c8b7);});});}exports[_0x32a5('0x8')]=function(_0x20971d,_0x240d37){return request(_0x32a5('0x9'),{'account':_0x20971d,'message':_0x240d37});}; \ No newline at end of file +var _0x4e04=['bluebird','jayson/promise','client','http','request','then','error','message','result','sendMailMessage','SendMail'];(function(_0x758841,_0x29e9df){var _0x24e623=function(_0x5474ea){while(--_0x5474ea){_0x758841['push'](_0x758841['shift']());}};_0x24e623(++_0x29e9df);}(_0x4e04,0x108));var _0x44e0=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x4e04[_0x30faec];return _0x29484f;};'use strict';var BPromise=require(_0x44e0('0x0'));var jayson=require(_0x44e0('0x1'));var client=jayson[_0x44e0('0x2')][_0x44e0('0x3')]({'port':0x232b});function request(_0x13b953,_0x5626ac){return new BPromise(function(_0x4e2d97,_0x5ef908){return client[_0x44e0('0x4')](_0x13b953,_0x5626ac)[_0x44e0('0x5')](function(_0x964a91){if(_0x964a91[_0x44e0('0x6')]){return _0x5ef908(_0x964a91[_0x44e0('0x6')][_0x44e0('0x7')]);}else{return _0x4e2d97(_0x964a91[_0x44e0('0x8')]);}})['catch'](function(_0x64bee6){return _0x5ef908(_0x64bee6);});});}exports[_0x44e0('0x9')]=function(_0x4b9847,_0x11e355){return request(_0x44e0('0xa'),{'account':_0x4b9847,'message':_0x11e355});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index bec63ef..b648544 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 _0x8645=['exports','lodash','xml2json','util','../../config/logger','agi','./rpc','./graph','./vertices','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','retry','addVertex','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','toJson','mxGraphModel','production','start','debug','stringify','joinAt','format','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','stack','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\x20published'];(function(_0x3d8995,_0x5f4f4b){var _0x5dd8ed=function(_0x55e159){while(--_0x55e159){_0x3d8995['push'](_0x3d8995['shift']());}};_0x5dd8ed(++_0x5f4f4b);}(_0x8645,0xe5));var _0x5864=function(_0x5cdb0b,_0x13296d){_0x5cdb0b=_0x5cdb0b-0x0;var _0x1abb94=_0x8645[_0x5cdb0b];return _0x1abb94;};'use strict';var _=require(_0x5864('0x0'));var moment=require('moment');var parser=require(_0x5864('0x1'));var util=require(_0x5864('0x2'));var logger=require(_0x5864('0x3'))(_0x5864('0x4'));var rpc=require(_0x5864('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x5864('0x6'));var Vertices=require(_0x5864('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x766ad2){logger[_0x5864('0x8')](_0x5864('0x9'),_0x766ad2['stack']);return[];});}function addVertex(_0x36480e,_0x53c08d,_0x36b153){_0x53c08d[_0x5864('0xa')]=_0x36b153;if(_0x53c08d['hasOwnProperty'](_0x5864('0xb'))){_0x53c08d['maxRetry']=parseInt(_0x53c08d[_0x5864('0xb')],0xa);}_0x36480e[_0x5864('0xc')](_['omit'](_0x53c08d,_0x5864('0xd')));}function initGraph(_0x1ae383,_0x11450b){var _0x4c2cd5=new Graph();for(var _0x183692 in _0x1ae383){if(_0x1ae383[_0x5864('0xe')](_0x183692)){if(_[_0x5864('0xf')](_0x1ae383[_0x183692])){for(var _0x43fd1b=0x0;_0x43fd1b<_0x1ae383[_0x183692][_0x5864('0x10')];_0x43fd1b+=0x1){addVertex(_0x4c2cd5,_0x1ae383[_0x183692][_0x43fd1b],_0x183692);}}else{addVertex(_0x4c2cd5,_0x1ae383[_0x183692],_0x183692);}}}for(var _0x1e78e1=0x0;_0x1e78e1<_0x11450b['length'];_0x1e78e1+=0x1){if(_0x11450b[_0x1e78e1][_0x5864('0x11')]&&_0x11450b[_0x1e78e1]['target']){_0x4c2cd5[_0x5864('0x12')](_0x11450b[_0x1e78e1]['source'],_0x11450b[_0x1e78e1][_0x5864('0x13')],_0x11450b[_0x1e78e1]['value']);}}return _0x4c2cd5;}function getRoot(_0x2a2f6e){return parser[_0x5864('0x14')](_0x2a2f6e,{'object':!![]})[_0x5864('0x15')]['root'];}function inspect(_0x2247d0){return util['inspect'](_0x2247d0,{'showHidden':![],'depth':null});}function initialize(_0x53c91f,_0x590710){var _0xb485d1=getRoot(_0x53c91f[_0x5864('0x16')]);if(!_0xb485d1||!_0xb485d1[_0x5864('0x17')])return;var _0x46817e,_0x51c0b2,_0x3ca69b;logger[_0x5864('0x18')]('root',JSON[_0x5864('0x19')](_0xb485d1,null,0x2));_0x590710[_0x5864('0x1a')]=moment()[_0x5864('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');_0x46817e=initGraph(_[_0x5864('0x1c')](_0xb485d1,'mxCell'),_0xb485d1['mxCell']);_0x51c0b2=new Vertices(_0x590710,rpc,mailRpc);logger[_0x5864('0x1d')](util[_0x5864('0x1b')](_0x5864('0x1e'),_0x590710[_0x5864('0x1f')],_0x590710[_0x5864('0x20')],_0x590710[_0x5864('0x21')],_0x590710[_0x5864('0x22')],_0x590710[_0x5864('0x23')]));_0x46817e[_0x5864('0x24')](_0xb485d1[_0x5864('0x17')]['id'],function(_0x41ce23){try{_0x41ce23=_0x51c0b2[_0x5864('0x25')](_0x41ce23);logger[_0x5864('0x18')](_0x5864('0x26'),JSON[_0x5864('0x19')](_0x41ce23,null,0x2));if(_0x41ce23[_0x5864('0xa')]===_0x5864('0x27')){logger[_0x5864('0x1d')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x590710[_0x5864('0x28')]=_0x41ce23[_0x5864('0x28')]||_0x590710['context'];_0x590710[_0x5864('0x29')]=_0x41ce23[_0x5864('0x29')];_0x590710[_0x5864('0x2a')]=_0x41ce23[_0x5864('0x2a')]?_0x41ce23[_0x5864('0x2a')]-0x1:0x1;return null;}else if(_0x41ce23&&_0x51c0b2[_0x41ce23[_0x5864('0xa')]]){_0x3ca69b=_0x51c0b2[_0x41ce23[_0x5864('0xa')]](_0x41ce23);logger[_0x5864('0x1d')](_0x5864('0x2b'),JSON[_0x5864('0x19')](_0x3ca69b,null,0x2));if(_0x3ca69b&&_0x3ca69b['code']===AGI_CODE_SUCCESS&&_0x3ca69b[_0x5864('0x2c')]!==AGI_RESULT_ERROR&&!_0x590710[_0x5864('0x2d')]){logger[_0x5864('0x18')](_0x5864('0x2b'),inspect(_0x3ca69b));return _[_0x5864('0x2e')](_0x3ca69b[_0x5864('0x2c')])?null:_0x3ca69b[_0x5864('0x2c')][_0x5864('0x2f')]();}else{logger[_0x5864('0x8')](_0x5864('0x2b'),inspect(_0x3ca69b));return null;}}else{logger[_0x5864('0x8')](_0x5864('0x30'));return null;}}catch(_0x4c61e5){logger[_0x5864('0x8')](_0x4c61e5[_0x5864('0x31')]);return null;}});if(_0xb485d1[_0x5864('0x32')]){logger[_0x5864('0x1d')](util[_0x5864('0x1b')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x590710[_0x5864('0x1f')],_0x590710['calleridname'],_0x590710[_0x5864('0x21')],_0x590710['dnid'],_0x590710[_0x5864('0x23')]));_0x46817e['traverseBFS'](_0xb485d1['finally']['id'],function(_0x28a77e){try{_0x28a77e=_0x51c0b2[_0x5864('0x25')](_0x28a77e);logger[_0x5864('0x18')](_0x5864('0x26'),JSON[_0x5864('0x19')](_0x28a77e,null,0x2));if(_0x28a77e&&_0x51c0b2[_0x28a77e[_0x5864('0xa')]]){_0x3ca69b=_0x51c0b2[_0x28a77e[_0x5864('0xa')]](_0x28a77e);if(_0x3ca69b){logger[_0x5864('0x18')]('response',inspect(_0x3ca69b));return _[_0x5864('0x2e')](_0x3ca69b['result'])?null:_0x3ca69b[_0x5864('0x2c')][_0x5864('0x2f')]();}else{logger[_0x5864('0x8')](_0x5864('0x2b'),inspect(_0x3ca69b));return null;}}else{logger[_0x5864('0x8')](_0x5864('0x30'));return null;}}catch(_0x58b5fc){logger[_0x5864('0x8')](_0x58b5fc[_0x5864('0x31')]);return null;}});}logger[_0x5864('0x1d')](util['format'](_0x5864('0x33'),_0x590710[_0x5864('0x1f')],_0x590710[_0x5864('0x20')],_0x590710[_0x5864('0x21')],_0x590710[_0x5864('0x22')],_0x590710[_0x5864('0x23')]));logger[_0x5864('0x1d')](util[_0x5864('0x1b')](_0x5864('0x34'),_0x590710[_0x5864('0x28')],_0x590710[_0x5864('0x29')],parseInt(_0x590710[_0x5864('0x2a')],0xa)+0x1));_0x590710[_0x5864('0x35')](_0x590710[_0x5864('0x28')],_0x590710['extension'],parseInt(_0x590710[_0x5864('0x2a')],0xa)+0x1);_0x590710[_0x5864('0x36')]();}function handleNotFound(_0x42c45c){logger[_0x5864('0x8')](util[_0x5864('0x1b')]('Project\x20%s\x20not\x20found',_0x42c45c[_0x5864('0x1f')]));_0x42c45c[_0x5864('0x35')](_0x42c45c['context'],_0x42c45c[_0x5864('0x29')],parseInt(_0x42c45c[_0x5864('0x2a')],0xa)+0x1);_0x42c45c[_0x5864('0x36')]();}function handleUnpublished(_0x343b8e){logger[_0x5864('0x8')](util[_0x5864('0x1b')](_0x5864('0x37'),_0x343b8e[_0x5864('0x1f')]));_0x343b8e['continueAt'](_0x343b8e[_0x5864('0x28')],_0x343b8e[_0x5864('0x29')],parseInt(_0x343b8e[_0x5864('0x2a')],0xa)+0x1);_0x343b8e['close']();}module[_0x5864('0x38')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xd114=['YYYY-MM-DD\x20HH:mm:ss','callerid','uniqueid','clear','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','isUndefined','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','traverseBFS','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','exports','moment','xml2json','util','../../config/logger','./rpc','./mailRpc','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','source','target','value','toJson','mxGraphModel','root','start','debug','stringify','format'];(function(_0x582345,_0x4dec6d){var _0x1e95ce=function(_0x5ea046){while(--_0x5ea046){_0x582345['push'](_0x582345['shift']());}};_0x1e95ce(++_0x4dec6d);}(_0xd114,0xbc));var _0x4d11=function(_0x361b49,_0x2e7cf2){_0x361b49=_0x361b49-0x0;var _0x131690=_0xd114[_0x361b49];return _0x131690;};'use strict';var _=require('lodash');var moment=require(_0x4d11('0x0'));var parser=require(_0x4d11('0x1'));var util=require(_0x4d11('0x2'));var logger=require(_0x4d11('0x3'))('agi');var rpc=require(_0x4d11('0x4'));var mailRpc=require(_0x4d11('0x5'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x4d11('0x6')]()['catch'](function(_0x48e3b4){logger[_0x4d11('0x7')](_0x4d11('0x8'),_0x48e3b4[_0x4d11('0x9')]);return[];});}function addVertex(_0x3bb012,_0x485014,_0x223bf8){_0x485014[_0x4d11('0xa')]=_0x223bf8;if(_0x485014[_0x4d11('0xb')](_0x4d11('0xc'))){_0x485014[_0x4d11('0xd')]=parseInt(_0x485014['retry'],0xa);}_0x3bb012['addVertex'](_[_0x4d11('0xe')](_0x485014,_0x4d11('0xf')));}function initGraph(_0x36fe77,_0x4f5db6){var _0x12cea6=new Graph();for(var _0x252b79 in _0x36fe77){if(_0x36fe77[_0x4d11('0xb')](_0x252b79)){if(_[_0x4d11('0x10')](_0x36fe77[_0x252b79])){for(var _0x40e7f7=0x0;_0x40e7f7<_0x36fe77[_0x252b79][_0x4d11('0x11')];_0x40e7f7+=0x1){addVertex(_0x12cea6,_0x36fe77[_0x252b79][_0x40e7f7],_0x252b79);}}else{addVertex(_0x12cea6,_0x36fe77[_0x252b79],_0x252b79);}}}for(var _0x4381d4=0x0;_0x4381d4<_0x4f5db6[_0x4d11('0x11')];_0x4381d4+=0x1){if(_0x4f5db6[_0x4381d4][_0x4d11('0x12')]&&_0x4f5db6[_0x4381d4][_0x4d11('0x13')]){_0x12cea6['addEdge'](_0x4f5db6[_0x4381d4][_0x4d11('0x12')],_0x4f5db6[_0x4381d4][_0x4d11('0x13')],_0x4f5db6[_0x4381d4][_0x4d11('0x14')]);}}return _0x12cea6;}function getRoot(_0x2cb5be){return parser[_0x4d11('0x15')](_0x2cb5be,{'object':!![]})[_0x4d11('0x16')][_0x4d11('0x17')];}function inspect(_0x3de50c){return util['inspect'](_0x3de50c,{'showHidden':![],'depth':null});}function initialize(_0x5cb01b,_0x16de43){var _0x510bcf=getRoot(_0x5cb01b['production']);if(!_0x510bcf||!_0x510bcf[_0x4d11('0x18')])return;var _0x33d448,_0x27f773,_0x4008e7;logger[_0x4d11('0x19')]('root',JSON[_0x4d11('0x1a')](_0x510bcf,null,0x2));_0x16de43['joinAt']=moment()[_0x4d11('0x1b')](_0x4d11('0x1c'));_0x33d448=initGraph(_[_0x4d11('0xe')](_0x510bcf,_0x4d11('0xf')),_0x510bcf[_0x4d11('0xf')]);_0x27f773=new Vertices(_0x16de43,rpc,mailRpc);logger['info'](util[_0x4d11('0x1b')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x16de43['arg_1'],_0x16de43['calleridname'],_0x16de43[_0x4d11('0x1d')],_0x16de43['dnid'],_0x16de43[_0x4d11('0x1e')]));_0x33d448['traverseBFS'](_0x510bcf[_0x4d11('0x18')]['id'],function(_0x2d6d15){try{_0x2d6d15=_0x27f773[_0x4d11('0x1f')](_0x2d6d15);logger['debug']('vertex',JSON[_0x4d11('0x1a')](_0x2d6d15,null,0x2));if(_0x2d6d15[_0x4d11('0xa')]===_0x4d11('0x20')){logger[_0x4d11('0x21')](_0x4d11('0x22'));_0x16de43[_0x4d11('0x23')]=_0x2d6d15[_0x4d11('0x23')]||_0x16de43[_0x4d11('0x23')];_0x16de43[_0x4d11('0x24')]=_0x2d6d15[_0x4d11('0x24')];_0x16de43[_0x4d11('0x25')]=_0x2d6d15[_0x4d11('0x25')]?_0x2d6d15[_0x4d11('0x25')]-0x1:0x1;return null;}else if(_0x2d6d15&&_0x27f773[_0x2d6d15[_0x4d11('0xa')]]){_0x4008e7=_0x27f773[_0x2d6d15[_0x4d11('0xa')]](_0x2d6d15);logger[_0x4d11('0x21')](_0x4d11('0x26'),JSON['stringify'](_0x4008e7,null,0x2));if(_0x4008e7&&_0x4008e7['code']===AGI_CODE_SUCCESS&&_0x4008e7[_0x4d11('0x27')]!==AGI_RESULT_ERROR&&!_0x16de43[_0x4d11('0x28')]){logger[_0x4d11('0x19')](_0x4d11('0x26'),inspect(_0x4008e7));return _[_0x4d11('0x29')](_0x4008e7[_0x4d11('0x27')])?null:_0x4008e7[_0x4d11('0x27')][_0x4d11('0x2a')]();}else{logger[_0x4d11('0x7')]('response',inspect(_0x4008e7));return null;}}else{logger[_0x4d11('0x7')]('agicommand\x20not\x20found');return null;}}catch(_0x2524be){logger[_0x4d11('0x7')](_0x2524be['stack']);return null;}});if(_0x510bcf['finally']){logger[_0x4d11('0x21')](util[_0x4d11('0x1b')](_0x4d11('0x2b'),_0x16de43[_0x4d11('0x2c')],_0x16de43[_0x4d11('0x2d')],_0x16de43[_0x4d11('0x1d')],_0x16de43['dnid'],_0x16de43[_0x4d11('0x1e')]));_0x33d448[_0x4d11('0x2e')](_0x510bcf['finally']['id'],function(_0x533d1c){try{_0x533d1c=_0x27f773[_0x4d11('0x1f')](_0x533d1c);logger['debug'](_0x4d11('0x2f'),JSON[_0x4d11('0x1a')](_0x533d1c,null,0x2));if(_0x533d1c&&_0x27f773[_0x533d1c['agicommand']]){_0x4008e7=_0x27f773[_0x533d1c[_0x4d11('0xa')]](_0x533d1c);if(_0x4008e7){logger[_0x4d11('0x19')](_0x4d11('0x26'),inspect(_0x4008e7));return _['isUndefined'](_0x4008e7[_0x4d11('0x27')])?null:_0x4008e7['result'][_0x4d11('0x2a')]();}else{logger[_0x4d11('0x7')](_0x4d11('0x26'),inspect(_0x4008e7));return null;}}else{logger[_0x4d11('0x7')](_0x4d11('0x30'));return null;}}catch(_0x5c8089){logger[_0x4d11('0x7')](_0x5c8089[_0x4d11('0x9')]);return null;}});}logger['info'](util[_0x4d11('0x1b')](_0x4d11('0x31'),_0x16de43[_0x4d11('0x2c')],_0x16de43['calleridname'],_0x16de43[_0x4d11('0x1d')],_0x16de43['dnid'],_0x16de43[_0x4d11('0x1e')]));logger[_0x4d11('0x21')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x16de43[_0x4d11('0x23')],_0x16de43[_0x4d11('0x24')],parseInt(_0x16de43['priority'],0xa)+0x1));_0x16de43[_0x4d11('0x32')](_0x16de43[_0x4d11('0x23')],_0x16de43[_0x4d11('0x24')],parseInt(_0x16de43[_0x4d11('0x25')],0xa)+0x1);_0x16de43[_0x4d11('0x33')]();}function handleNotFound(_0x2c044d){logger[_0x4d11('0x7')](util[_0x4d11('0x1b')](_0x4d11('0x34'),_0x2c044d[_0x4d11('0x2c')]));_0x2c044d[_0x4d11('0x32')](_0x2c044d[_0x4d11('0x23')],_0x2c044d[_0x4d11('0x24')],parseInt(_0x2c044d['priority'],0xa)+0x1);_0x2c044d[_0x4d11('0x33')]();}function handleUnpublished(_0x1f4317){logger[_0x4d11('0x7')](util[_0x4d11('0x1b')]('Project\x20%s\x20not\x20published',_0x1f4317['arg_1']));_0x1f4317[_0x4d11('0x32')](_0x1f4317[_0x4d11('0x23')],_0x1f4317[_0x4d11('0x24')],parseInt(_0x1f4317[_0x4d11('0x25')],0xa)+0x1);_0x1f4317[_0x4d11('0x33')]();}module[_0x4d11('0x35')]={'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 dd1c295..342faf4 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 _0xbca8=['_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','indexOf','length','split','slice','emit','headers','line','util','stream','Transform','call'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xbca8,0xcc));var _0x8bca=function(_0x1d51f2,_0x264ce0){_0x1d51f2=_0x1d51f2-0x0;var _0x123d8b=_0xbca8[_0x1d51f2];return _0x123d8b;};'use strict';var util=require(_0x8bca('0x0'));var Transform=require(_0x8bca('0x1'))[_0x8bca('0x2')];function AGIReply(_0x216406){Transform[_0x8bca('0x3')](this,_0x216406);this['_localBuffer']='';this[_0x8bca('0x4')]=![];}util[_0x8bca('0x5')](AGIReply,Transform);AGIReply[_0x8bca('0x6')]['_transform']=function(_0x4c2ac8,_0x1753ad,_0x2ecf60){var _0x318474='\x0a',_0x348ddd=['\x0a\x0a',_0x8bca('0x7')],_0x4b3267=-0x1,_0x3fdccf=-0x1,_0x38e241='',_0x278c99=0x0,_0xe4cd8a='',_0x1f5de7='';this[_0x8bca('0x8')]+=_0x4c2ac8['toString']();_0xe4cd8a=this['_localBuffer'];if(!this[_0x8bca('0x4')]){_0x278c99=0x0;while(_0x348ddd[_0x278c99]){while((_0x3fdccf=_0xe4cd8a[_0x8bca('0x9')](_0x348ddd[_0x278c99]))!=-0x1){_0x38e241=_0x348ddd[_0x278c99];_0x1f5de7=_0xe4cd8a['substring'](0x0,_0x3fdccf);_0xe4cd8a=_0xe4cd8a['substring'](_0x3fdccf+_0x38e241[_0x8bca('0xa')]);var _0x59321f=_0x1f5de7[_0x8bca('0xb')](_0x318474),_0x10da2e=0x0,_0x376d41={},_0x5eec01='',_0x62c6d1='',_0x1fe1b5=-0x1;while(_0x59321f[_0x10da2e]){_0x1fe1b5=_0x59321f[_0x10da2e][_0x8bca('0x9')](':');if(_0x1fe1b5!=-0x1){_0x5eec01=_0x59321f[_0x10da2e]['slice'](0x0,_0x1fe1b5)['trim']();_0x62c6d1=_0x59321f[_0x10da2e][_0x8bca('0xc')](_0x1fe1b5+0x1)['trim']();if(_0x5eec01[_0x8bca('0xa')]>0x0){_0x376d41[_0x5eec01]=_0x62c6d1;}}else{}_0x10da2e++;}this[_0x8bca('0xd')](_0x8bca('0xe'),_0x376d41);this[_0x8bca('0x4')]=!![];}_0x278c99++;}this[_0x8bca('0x8')]=_0xe4cd8a;}else{while((_0x4b3267=_0xe4cd8a[_0x8bca('0x9')](_0x318474))!=-0x1){_0x1f5de7=_0xe4cd8a['substring'](0x0,_0x4b3267);this['emit'](_0x8bca('0xf'),_0x1f5de7);_0xe4cd8a=_0xe4cd8a['substring'](_0x4b3267+_0x318474[_0x8bca('0xa')]);}this[_0x8bca('0x8')]=_0xe4cd8a;}_0x2ecf60();};module['exports']=AGIReply; \ No newline at end of file +var _0x0485=['line','exports','util','stream','Transform','call','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','length','split','slice','trim','emit','headers'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x0485,0x74));var _0x5048=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0x0485[_0x3b3210];return _0x5b5484;};'use strict';var util=require(_0x5048('0x0'));var Transform=require(_0x5048('0x1'))[_0x5048('0x2')];function AGIReply(_0x169c9e){Transform[_0x5048('0x3')](this,_0x169c9e);this[_0x5048('0x4')]='';this[_0x5048('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x5048('0x6')][_0x5048('0x7')]=function(_0x58291a,_0x42ac0c,_0x359bfa){var _0x121e04='\x0a',_0x54e41f=['\x0a\x0a',_0x5048('0x8')],_0x573b81=-0x1,_0x350ce6=-0x1,_0x28d074='',_0x13f70e=0x0,_0x366954='',_0x2fdf7e='';this['_localBuffer']+=_0x58291a['toString']();_0x366954=this['_localBuffer'];if(!this[_0x5048('0x5')]){_0x13f70e=0x0;while(_0x54e41f[_0x13f70e]){while((_0x350ce6=_0x366954[_0x5048('0x9')](_0x54e41f[_0x13f70e]))!=-0x1){_0x28d074=_0x54e41f[_0x13f70e];_0x2fdf7e=_0x366954[_0x5048('0xa')](0x0,_0x350ce6);_0x366954=_0x366954['substring'](_0x350ce6+_0x28d074[_0x5048('0xb')]);var _0x13780a=_0x2fdf7e[_0x5048('0xc')](_0x121e04),_0x42240c=0x0,_0x3ecdde={},_0x297dce='',_0x215611='',_0x55ecee=-0x1;while(_0x13780a[_0x42240c]){_0x55ecee=_0x13780a[_0x42240c][_0x5048('0x9')](':');if(_0x55ecee!=-0x1){_0x297dce=_0x13780a[_0x42240c][_0x5048('0xd')](0x0,_0x55ecee)[_0x5048('0xe')]();_0x215611=_0x13780a[_0x42240c][_0x5048('0xd')](_0x55ecee+0x1)[_0x5048('0xe')]();if(_0x297dce[_0x5048('0xb')]>0x0){_0x3ecdde[_0x297dce]=_0x215611;}}else{}_0x42240c++;}this[_0x5048('0xf')](_0x5048('0x10'),_0x3ecdde);this[_0x5048('0x5')]=!![];}_0x13f70e++;}this[_0x5048('0x4')]=_0x366954;}else{while((_0x573b81=_0x366954[_0x5048('0x9')](_0x121e04))!=-0x1){_0x2fdf7e=_0x366954[_0x5048('0xa')](0x0,_0x573b81);this[_0x5048('0xf')](_0x5048('0x11'),_0x2fdf7e);_0x366954=_0x366954[_0x5048('0xa')](_0x573b81+_0x121e04[_0x5048('0xb')]);}this['_localBuffer']=_0x366954;}_0x359bfa();};module[_0x5048('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ceca215..3e0f4a9 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 _0xaa7c=['save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','request','then','error','message','getSquareProjects','GetSquareProjects','production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','name','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x36d5a5,_0x2a0dd6){_0x36d5a5=_0x36d5a5-0x0;var _0x3296f4=_0xaa7c[_0x36d5a5];return _0x3296f4;};'use strict';var _=require(_0xcaa7('0x0'));var moment=require('moment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x1ad795,_0x153b0e){return new Promise(function(_0x4f837e,_0xd4ca36){return client[_0xcaa7('0x1')](_0x1ad795,_0x153b0e)[_0xcaa7('0x2')](function(_0x17d8cf){if(_0x17d8cf[_0xcaa7('0x3')]){return _0xd4ca36(_0x17d8cf['error'][_0xcaa7('0x4')]);}else{return _0x4f837e(_0x17d8cf['result']);}})['catch'](function(_0x4e4fc1){return _0xd4ca36(_0x4e4fc1);});});}exports[_0xcaa7('0x5')]=function(){return request(_0xcaa7('0x6'),{'options':{'raw':![],'attributes':['id','name',_0xcaa7('0x7')]}});};exports[_0xcaa7('0x8')]=function(_0xcffcb0){return request(_0xcaa7('0x9'),{'options':{'raw':![],'where':{'name':_0xcffcb0},'attributes':[_0xcaa7('0x7')]}});};exports['getMailAccountById']=function(_0x2e037c){return request(_0xcaa7('0xa'),{'options':{'raw':![],'where':{'id':_0x2e037c},'include':[{'model':_0xcaa7('0xb'),'as':_0xcaa7('0xc'),'include':[{'model':_0xcaa7('0xd'),'as':_0xcaa7('0xd')}]}],'attributes':['id','name',_0xcaa7('0xe')],'smtp':!![]}});};exports[_0xcaa7('0xf')]=function(_0xec9aea){return request(_0xcaa7('0x9'),{'options':{'where':{'id':_0xec9aea},'attributes':[_0xcaa7('0x10')]}});};exports[_0xcaa7('0x11')]=function(_0x299490){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x299490},'attributes':['name']}});};exports[_0xcaa7('0x12')]=function(_0x1c1286){return request(_0xcaa7('0x13'),{'options':{'where':{'id':_0x1c1286},'attributes':[_0xcaa7('0x10')]}});};exports['getSquareOdbcById']=function(_0x98c3e2){return request(_0xcaa7('0x14'),{'options':{'where':{'id':_0x98c3e2},'attributes':[_0xcaa7('0x15')]}});};exports[_0xcaa7('0x16')]=function(_0x46d9b4){return request(_0xcaa7('0x17'),{'options':{'where':{'id':_0x46d9b4},'attributes':[_0xcaa7('0x10')]}});};exports['getContactByPhone']=function(_0x53e1cb){return request(_0xcaa7('0x18'),{'options':{'where':{'phone':_0x53e1cb[_0xcaa7('0x19')]},'attributes':['id']}});};exports[_0xcaa7('0x1a')]=function(_0x3bc53b){return request(_0xcaa7('0x1b'),{'options':{'where':{'id':_0x3bc53b},'attributes':[_0xcaa7('0x10')]}});};exports[_0xcaa7('0x1c')]=function(_0x4bf9e8){return request(_0xcaa7('0x1d'),{'options':{'where':{'id':_0x4bf9e8},'attributes':[_0xcaa7('0x1e')]}});};exports[_0xcaa7('0x1f')]=function(_0x11cbbf){return request(_0xcaa7('0x20'),{'options':{'raw':![],'where':{'id':_0x11cbbf},'include':[{'model':_0xcaa7('0x21'),'as':_0xcaa7('0x22')}]}});};exports[_0xcaa7('0x23')]=function(_0x2a9a79){return request(_0xcaa7('0x24'),{'options':{'where':{'id':_0x2a9a79},'attributes':['id',_0xcaa7('0x10')]}});};exports[_0xcaa7('0x25')]=function(_0x24a18c){return request('CreateSmsMessage',{'body':_0x24a18c});};exports[_0xcaa7('0x26')]=function(_0x4ee87d){return request('CreateSquareDetailsReport',{'body':_0x4ee87d});};exports[_0xcaa7('0x27')]=function(_0x361264){return request(_0xcaa7('0x28'),{'body':_[_0xcaa7('0x29')](_0x361264,{'project_name':_0x361264['arg_1'],'prev_project_name':_0x361264['arg_2']||'','is_subproject':_0x361264[_0xcaa7('0x2a')]?!![]:![],'leaveAt':moment()[_0xcaa7('0x2b')](_0xcaa7('0x2c'))})});};exports[_0xcaa7('0x2d')]=function(_0x4391a9){return request('CreateSquareRecording',{'body':_0x4391a9});};exports[_0xcaa7('0x2e')]=function(_0x4c6e87){return request('CreateSquareMessage',{'body':_0x4c6e87});};exports[_0xcaa7('0x2f')]=function(_0x492362){return request(_0xcaa7('0x30'),{'options':{'raw':![],'where':{'phone':_0x492362[_0xcaa7('0x19')],'ListId':_0x492362[_0xcaa7('0x31')]}}})[_0xcaa7('0x2')](function(_0x248ca5){if(_0x248ca5){return _0x248ca5;}return request(_0xcaa7('0x32'),{'body':_0x492362});});};exports[_0xcaa7('0x33')]=function(_0x3b9cea){return request('ShowPause',{'options':{'where':{'id':_0x3b9cea},'attributes':[_0xcaa7('0x10')]}});};exports[_0xcaa7('0x34')]=function(_0x24b192,_0x3b2c4c){return request(_0xcaa7('0x35'),{'body':{'interface':_0x3b2c4c},'options':{'where':_0x24b192}});};exports['agentPause']=function(_0x25c847,_0x394da5,_0xcbeb84){return request(_0xcaa7('0x36'),{'body':{'type':_0x394da5,'uniqueid':_0xcbeb84},'options':{'where':_0x25c847}});};exports[_0xcaa7('0x37')]=function(_0x483b44){return request(_0xcaa7('0x38'),{'body':{},'options':{'where':_0x483b44}});};exports['agentLogout']=function(_0xea24c0){return request(_0xcaa7('0x39'),{'body':{},'options':{'where':_0xea24c0}});}; \ No newline at end of file +var _0x0962=['production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','GetContactByPhone','phone','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','request','then','error','message','result','getSquareProjects','GetSquareProjects','name'];(function(_0x5b14d7,_0x10b373){var _0x1eb341=function(_0x2d0955){while(--_0x2d0955){_0x5b14d7['push'](_0x5b14d7['shift']());}};_0x1eb341(++_0x10b373);}(_0x0962,0x198));var _0x2096=function(_0x476d73,_0x5b3cb6){_0x476d73=_0x476d73-0x0;var _0x27b555=_0x0962[_0x476d73];return _0x27b555;};'use strict';var _=require(_0x2096('0x0'));var moment=require(_0x2096('0x1'));var jayson=require(_0x2096('0x2'));var client=jayson[_0x2096('0x3')]['http']({'port':0x2329});function request(_0x38bed1,_0x580e85){return new Promise(function(_0x575ef5,_0x2fe7b1){return client[_0x2096('0x4')](_0x38bed1,_0x580e85)[_0x2096('0x5')](function(_0x2f00d2){if(_0x2f00d2[_0x2096('0x6')]){return _0x2fe7b1(_0x2f00d2[_0x2096('0x6')][_0x2096('0x7')]);}else{return _0x575ef5(_0x2f00d2[_0x2096('0x8')]);}})['catch'](function(_0x16799f){return _0x2fe7b1(_0x16799f);});});}exports[_0x2096('0x9')]=function(){return request(_0x2096('0xa'),{'options':{'raw':![],'attributes':['id',_0x2096('0xb'),_0x2096('0xc')]}});};exports[_0x2096('0xd')]=function(_0x442772){return request(_0x2096('0xe'),{'options':{'raw':![],'where':{'name':_0x442772},'attributes':['production']}});};exports[_0x2096('0xf')]=function(_0x14be8a){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x14be8a},'include':[{'model':_0x2096('0x10'),'as':_0x2096('0x11'),'include':[{'model':_0x2096('0x12'),'as':_0x2096('0x12')}]}],'attributes':['id',_0x2096('0xb'),'email'],'smtp':!![]}});};exports[_0x2096('0x13')]=function(_0xf4233){return request(_0x2096('0xe'),{'options':{'where':{'id':_0xf4233},'attributes':['name']}});};exports[_0x2096('0x14')]=function(_0x45b7ec){return request(_0x2096('0x15'),{'options':{'where':{'id':_0x45b7ec},'attributes':['name']}});};exports[_0x2096('0x16')]=function(_0x37dcd0){return request(_0x2096('0x17'),{'options':{'where':{'id':_0x37dcd0},'attributes':[_0x2096('0xb')]}});};exports['getSquareOdbcById']=function(_0x3ef51e){return request(_0x2096('0x18'),{'options':{'where':{'id':_0x3ef51e},'attributes':[_0x2096('0x19')]}});};exports['getUserById']=function(_0x479ba2){return request(_0x2096('0x1a'),{'options':{'where':{'id':_0x479ba2},'attributes':[_0x2096('0xb')]}});};exports['getContactByPhone']=function(_0xd7e9e0){return request(_0x2096('0x1b'),{'options':{'where':{'phone':_0xd7e9e0[_0x2096('0x1c')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x2a9f62){return request('ShowTrunk',{'options':{'where':{'id':_0x2a9f62},'attributes':[_0x2096('0xb')]}});};exports[_0x2096('0x1d')]=function(_0xb1489a){return request(_0x2096('0x1e'),{'options':{'where':{'id':_0xb1489a},'attributes':[_0x2096('0x1f')]}});};exports[_0x2096('0x20')]=function(_0x2125ad){return request(_0x2096('0x21'),{'options':{'raw':![],'where':{'id':_0x2125ad},'include':[{'model':_0x2096('0x22'),'as':'Intervals'}]}});};exports[_0x2096('0x23')]=function(_0x4b74e2){return request(_0x2096('0x24'),{'options':{'where':{'id':_0x4b74e2},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x362414){return request(_0x2096('0x25'),{'body':_0x362414});};exports[_0x2096('0x26')]=function(_0xb49a24){return request(_0x2096('0x27'),{'body':_0xb49a24});};exports[_0x2096('0x28')]=function(_0x34e9de){return request(_0x2096('0x29'),{'body':_[_0x2096('0x2a')](_0x34e9de,{'project_name':_0x34e9de[_0x2096('0x2b')],'prev_project_name':_0x34e9de[_0x2096('0x2c')]||'','is_subproject':_0x34e9de[_0x2096('0x2c')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x2096('0x2d')]=function(_0x1119a1){return request(_0x2096('0x2e'),{'body':_0x1119a1});};exports[_0x2096('0x2f')]=function(_0x3c6247){return request(_0x2096('0x30'),{'body':_0x3c6247});};exports[_0x2096('0x31')]=function(_0x1e980c){return request(_0x2096('0x32'),{'options':{'raw':![],'where':{'phone':_0x1e980c['phone'],'ListId':_0x1e980c[_0x2096('0x33')]}}})[_0x2096('0x5')](function(_0x77692b){if(_0x77692b){return _0x77692b;}return request(_0x2096('0x34'),{'body':_0x1e980c});});};exports[_0x2096('0x35')]=function(_0x2464a0){return request(_0x2096('0x36'),{'options':{'where':{'id':_0x2464a0},'attributes':[_0x2096('0xb')]}});};exports['agentLogin']=function(_0x3dc95e,_0x32f260){return request('LoginUser',{'body':{'interface':_0x32f260},'options':{'where':_0x3dc95e}});};exports[_0x2096('0x37')]=function(_0x13421b,_0x31924c,_0x3cc62f){return request(_0x2096('0x38'),{'body':{'type':_0x31924c,'uniqueid':_0x3cc62f},'options':{'where':_0x13421b}});};exports[_0x2096('0x39')]=function(_0xd584c4){return request(_0x2096('0x3a'),{'body':{},'options':{'where':_0xd584c4}});};exports['agentLogout']=function(_0x3589f1){return request(_0x2096('0x3b'),{'body':{},'options':{'where':_0x3589f1}});}; \ 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 24a8a83..324b155 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 _0xdc97=['./polly','./lex','exports'];(function(_0x2f2cb9,_0x6e0d62){var _0x15c9c0=function(_0x5770b6){while(--_0x5770b6){_0x2f2cb9['push'](_0x2f2cb9['shift']());}};_0x15c9c0(++_0x6e0d62);}(_0xdc97,0x13b));var _0x7dc9=function(_0x146d4b,_0x5b4d2a){_0x146d4b=_0x146d4b-0x0;var _0x597663=_0xdc97[_0x146d4b];return _0x597663;};var polly=require(_0x7dc9('0x0'));var lex=require(_0x7dc9('0x1'));module[_0x7dc9('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xb89c=['./polly','./lex','exports'];(function(_0x43db26,_0x1a516f){var _0xc63f8e=function(_0x5d9ad8){while(--_0x5d9ad8){_0x43db26['push'](_0x43db26['shift']());}};_0xc63f8e(++_0x1a516f);}(_0xb89c,0x198));var _0xcb89=function(_0x4c959f,_0x4d86e8){_0x4c959f=_0x4c959f-0x0;var _0x51e40d=_0xb89c[_0x4c959f];return _0x51e40d;};var polly=require(_0xcb89('0x0'));var lex=require(_0xcb89('0x1'));module[_0xcb89('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 679611c..b41830c 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 _0x6324=['./lib/api','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6324,0x142));var _0x4632=function(_0x3394a6,_0x7b1ede){_0x3394a6=_0x3394a6-0x0;var _0x4a7909=_0x6324[_0x3394a6];return _0x4a7909;};'use strict';var lex=require(_0x4632('0x0'));module[_0x4632('0x1')]=function(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40){return lex(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40);}; \ No newline at end of file +var _0x91a7=['exports'];(function(_0x11fc8b,_0x4ee51d){var _0x4ea86e=function(_0x50e5bf){while(--_0x50e5bf){_0x11fc8b['push'](_0x11fc8b['shift']());}};_0x4ea86e(++_0x4ee51d);}(_0x91a7,0xe7));var _0x791a=function(_0x1f529d,_0x18308c){_0x1f529d=_0x1f529d-0x0;var _0x4e5197=_0x91a7[_0x1f529d];return _0x4e5197;};'use strict';var lex=require('./lib/api');module[_0x791a('0x0')]=function(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392){return lex(_0x3d6eab,_0x268862,_0x5d2796,_0x415994,_0x5b6f78,_0x2f6392);}; \ 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 8212582..71ad614 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(_0x27600a,_0x5d0a43){var _0x25ec3c=function(_0x4e5d5a){while(--_0x4e5d5a){_0x27600a['push'](_0x27600a['shift']());}};_0x25ec3c(++_0x5d0a43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x2a11c7,_0x478b99){var _0x51a503=function(_0x2fd4ba){while(--_0x2fd4ba){_0x2a11c7['push'](_0x2a11c7['shift']());}};_0x51a503(++_0x478b99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 3e6bb1e..e6e5e6a 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 _0xdace=['exports','./lib/api'];(function(_0x58262d,_0x451a39){var _0xa5e6c3=function(_0x38936f){while(--_0x38936f){_0x58262d['push'](_0x58262d['shift']());}};_0xa5e6c3(++_0x451a39);}(_0xdace,0x1dd));var _0xedac=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xdace[_0x38ced4];return _0x547c07;};'use strict';var polly=require(_0xedac('0x0'));module[_0xedac('0x1')]=function(_0x47b209,_0x5829ba,_0x3f96be,_0x16409b,_0x1ae897,_0x26e21e,_0x9ecd1){return polly(_0x47b209,_0x5829ba,_0x3f96be,_0x16409b,_0x1ae897,_0x26e21e,_0x9ecd1);}; \ No newline at end of file +var _0x96f2=['./lib/api'];(function(_0x137ead,_0x5c100b){var _0x982a69=function(_0x248212){while(--_0x248212){_0x137ead['push'](_0x137ead['shift']());}};_0x982a69(++_0x5c100b);}(_0x96f2,0x188));var _0x296f=function(_0x1bad20,_0x38e6c0){_0x1bad20=_0x1bad20-0x0;var _0x1c0d76=_0x96f2[_0x1bad20];return _0x1c0d76;};'use strict';var polly=require(_0x296f('0x0'));module['exports']=function(_0x4ca9cd,_0xaf5f7,_0x575eb0,_0xb7c10e,_0x453f78,_0x3358e0,_0x71a3ca){return polly(_0x4ca9cd,_0xaf5f7,_0x575eb0,_0xb7c10e,_0x453f78,_0x3358e0,_0x71a3ca);}; \ 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 10605d7..a6d95aa 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 _0x271a=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','aws-sdk','synthesizeSpeech','writeFile'];(function(_0xf5b943,_0x3330e9){var _0x30da5a=function(_0x1d32d3){while(--_0x1d32d3){_0xf5b943['push'](_0xf5b943['shift']());}};_0x30da5a(++_0x3330e9);}(_0x271a,0xef));var _0xa271=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x271a[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var path=require(_0xa271('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xa271('0x1'));function pollyResult(_0x5c1287,_0x5070f4,_0x1aa04d){return new BPromise(function(_0x12d51f,_0x1ef929){_0x5c1287[_0xa271('0x2')](_0x5070f4,function(_0x1a36ef,_0x5d13a){if(_0x1a36ef){_0x1ef929(_0x1a36ef);}else if(_0x5d13a){if(_0x5d13a['AudioStream']instanceof Buffer){fs[_0xa271('0x3')](_0x1aa04d,_0x5d13a[_0xa271('0x4')],function(_0x10a6a3){if(_0x10a6a3){_0x1ef929(_0x10a6a3);}else{_0x12d51f();}});}else{_0x1ef929(new Error(_0xa271('0x5')));}}else{_0x1ef929(new Error(_0xa271('0x6')));}});});}module['exports']=function(_0x5d5447,_0x3e60a7,_0x1cc9b4,_0x45cb2a,_0x35e252,_0x169451,_0x5a9450){var _0x52b7b6=new AWS['Polly']({'accessKeyId':_0x5d5447,'secretAccessKey':_0x3e60a7,'region':_0x1cc9b4});var _0x100de7={'Text':_0x35e252,'TextType':_0x169451||_0xa271('0x7'),'OutputFormat':_0xa271('0x8'),'VoiceId':_0x45cb2a};return pollyResult(_0x52b7b6,_0x100de7,_0x5a9450);}; \ No newline at end of file +var _0x6e8e=['mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x579b34,_0x1b5aaa){var _0x1b309c=function(_0x5c62e2){while(--_0x5c62e2){_0x579b34['push'](_0x579b34['shift']());}};_0x1b309c(++_0x1b5aaa);}(_0x6e8e,0xa6));var _0xe6e8=function(_0x45d6e7,_0x22f98e){_0x45d6e7=_0x45d6e7-0x0;var _0x4df088=_0x6e8e[_0x45d6e7];return _0x4df088;};'use strict';var fs=require('fs');var path=require(_0xe6e8('0x0'));var BPromise=require(_0xe6e8('0x1'));var rs=require(_0xe6e8('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x11ef32,_0x19e0eb,_0x3e436b){return new BPromise(function(_0x563ac4,_0x3f0f71){_0x11ef32[_0xe6e8('0x3')](_0x19e0eb,function(_0x5052d8,_0x1d468b){if(_0x5052d8){_0x3f0f71(_0x5052d8);}else if(_0x1d468b){if(_0x1d468b[_0xe6e8('0x4')]instanceof Buffer){fs[_0xe6e8('0x5')](_0x3e436b,_0x1d468b[_0xe6e8('0x4')],function(_0x3505d2){if(_0x3505d2){_0x3f0f71(_0x3505d2);}else{_0x563ac4();}});}else{_0x3f0f71(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x3f0f71(new Error(_0xe6e8('0x6')));}});});}module[_0xe6e8('0x7')]=function(_0x357d6a,_0x40599f,_0x38319a,_0x2c0a0c,_0x1ffc96,_0x1f1a3f,_0x18ca27){var _0x168844=new AWS[(_0xe6e8('0x8'))]({'accessKeyId':_0x357d6a,'secretAccessKey':_0x40599f,'region':_0x38319a});var _0x23949b={'Text':_0x1ffc96,'TextType':_0x1f1a3f||_0xe6e8('0x9'),'OutputFormat':_0xe6e8('0xa'),'VoiceId':_0x2c0a0c};return pollyResult(_0x168844,_0x23949b,_0x18ca27);}; \ 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 f376181..a5029b0 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 _0x143b=['exports'];(function(_0x2dee2f,_0x19572f){var _0x327c18=function(_0x130ec0){while(--_0x130ec0){_0x2dee2f['push'](_0x2dee2f['shift']());}};_0x327c18(++_0x19572f);}(_0x143b,0x134));var _0xb143=function(_0x4c3ad1,_0x25d872){_0x4c3ad1=_0x4c3ad1-0x0;var _0x1ea08d=_0x143b[_0x4c3ad1];return _0x1ea08d;};'use strict';var asr=require('./lib/api');module[_0xb143('0x0')]=function(_0x576397,_0x340fa2,_0x50ff03,_0x459e4b){return asr(_0x576397,_0x340fa2,_0x50ff03);}; \ No newline at end of file +var _0xdf20=['exports','./lib/api'];(function(_0x38eeb9,_0x468d0c){var _0x51281a=function(_0x5ca2c1){while(--_0x5ca2c1){_0x38eeb9['push'](_0x38eeb9['shift']());}};_0x51281a(++_0x468d0c);}(_0xdf20,0x12f));var _0x0df2=function(_0x5bb8e4,_0x315620){_0x5bb8e4=_0x5bb8e4-0x0;var _0x3330e8=_0xdf20[_0x5bb8e4];return _0x3330e8;};'use strict';var asr=require(_0x0df2('0x0'));module[_0x0df2('0x1')]=function(_0x49470a,_0x439687,_0x4bf69e,_0x49990d){return asr(_0x49470a,_0x439687,_0x4bf69e);}; \ 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 89bce65..36769d3 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 _0xcb91=['lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','https://speech.googleapis.com','exports','string','length','undefined'];(function(_0x48d257,_0x285c58){var _0x1ba4b5=function(_0x586f36){while(--_0x586f36){_0x48d257['push'](_0x48d257['shift']());}};_0x1ba4b5(++_0x285c58);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0xcb91[_0x4da356];return _0x321b07;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0x1cb9('0x0');module[_0x1cb9('0x1')]=function(_0x17d4ec,_0x22c4b8,_0x4c37e8){return new BPromise(function(_0x8c392f,_0x2c17b8){var _0x545a34;if(typeof _0x17d4ec!==_0x1cb9('0x2')||_0x17d4ec[_0x1cb9('0x3')]===0x0){return _0x2c17b8('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x22c4b8!==_0x1cb9('0x2')||_0x22c4b8[_0x1cb9('0x3')]===0x0){return _0x2c17b8('key\x20should\x20be\x20a\x20string');}if(typeof _0x4c37e8!==_0x1cb9('0x4')&&(typeof _0x4c37e8!==_0x1cb9('0x2')||_0x4c37e8['length']===0x0)){return _0x2c17b8(_0x1cb9('0x5'));}try{_0x545a34=fs['readFileSync'](_0x17d4ec)['toString'](_0x1cb9('0x6'));}catch(_0x2fa15c){return _0x2c17b8(_0x2fa15c);}return _0x8c392f({'method':_0x1cb9('0x7'),'uri':host+_0x1cb9('0x8')+_0x22c4b8,'body':{'config':{'encoding':_0x1cb9('0x9'),'sampleRateHertz':'8000','languageCode':_0x4c37e8},'audio':{'content':_0x545a34}},'json':!![]});});}; \ No newline at end of file +var _0x44a3=['toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x4deb98,_0x29ebdd){var _0x2c5f93=function(_0x3bdb80){while(--_0x3bdb80){_0x4deb98['push'](_0x4deb98['shift']());}};_0x2c5f93(++_0x29ebdd);}(_0x44a3,0x1a9));var _0x344a=function(_0x10aa73,_0xc744f4){_0x10aa73=_0x10aa73-0x0;var _0x3496d9=_0x44a3[_0x10aa73];return _0x3496d9;};'use strict';var url=require(_0x344a('0x0'));var BPromise=require(_0x344a('0x1'));var fs=require('fs');var host=_0x344a('0x2');module[_0x344a('0x3')]=function(_0xdffe0b,_0x42b3a6,_0x3bb844){return new BPromise(function(_0x212a39,_0x528a13){var _0x23004c;if(typeof _0xdffe0b!==_0x344a('0x4')||_0xdffe0b[_0x344a('0x5')]===0x0){return _0x528a13(_0x344a('0x6'));}if(typeof _0x42b3a6!==_0x344a('0x4')||_0x42b3a6['length']===0x0){return _0x528a13('key\x20should\x20be\x20a\x20string');}if(typeof _0x3bb844!=='undefined'&&(typeof _0x3bb844!=='string'||_0x3bb844[_0x344a('0x5')]===0x0)){return _0x528a13(_0x344a('0x7'));}try{_0x23004c=fs[_0x344a('0x8')](_0xdffe0b)[_0x344a('0x9')](_0x344a('0xa'));}catch(_0x54288d){return _0x528a13(_0x54288d);}return _0x212a39({'method':_0x344a('0xb'),'uri':host+_0x344a('0xc')+_0x42b3a6,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x344a('0xd'),'languageCode':_0x3bb844},'audio':{'content':_0x23004c}},'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 0417b9c..4878001 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 _0x3cee=['exports'];(function(_0x38b602,_0x57ccd5){var _0x310d16=function(_0x5aca1a){while(--_0x5aca1a){_0x38b602['push'](_0x38b602['shift']());}};_0x310d16(++_0x57ccd5);}(_0x3cee,0x19b));var _0xe3ce=function(_0x37299d,_0x6addee){_0x37299d=_0x37299d-0x0;var _0x1f92a7=_0x3cee[_0x37299d];return _0x1f92a7;};var asr=require('./asr');module[_0xe3ce('0x0')]={'asr':asr}; \ No newline at end of file +var _0xf366=['exports','./asr'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0xf366,0x1c7));var _0x6f36=function(_0x380c21,_0x25991a){_0x380c21=_0x380c21-0x0;var _0xac040e=_0xf366[_0x380c21];return _0xac040e;};var asr=require(_0x6f36('0x0'));module[_0x6f36('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 9be2633..0659501 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 _0x5bd9=['protocol','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','request\x20to\x20','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','jQ1olc','stringify','null','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','score','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','action','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest'];(function(_0x4ae299,_0x3c0edb){var _0x1599a6=function(_0x176024){while(--_0x176024){_0x4ae299['push'](_0x4ae299['shift']());}};_0x1599a6(++_0x3c0edb);}(_0x5bd9,0x10e));var _0x95bd=function(_0x11ab20,_0x64aee1){_0x11ab20=_0x11ab20-0x0;var _0x2f77ea=_0x5bd9[_0x11ab20];return _0x2f77ea;};'use strict';var apiai=require(_0x95bd('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x95bd('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x95bd('0x2'));var md5=require(_0x95bd('0x3'));var path=require(_0x95bd('0x4'));var querystring=require('querystring');var rp=require(_0x95bd('0x5'));var rs=require(_0x95bd('0x6'));var sox=require(_0x95bd('0x7'));var tts=require(_0x95bd('0x8'));var urlParse=require(_0x95bd('0x9'))[_0x95bd('0xa')];var util=require(_0x95bd('0xb'));var aws=require(_0x95bd('0xc'));var google=require(_0x95bd('0xd'));var sestek=require(_0x95bd('0xe'));var tilde=require('./tilde');var logger=require(_0x95bd('0xf'))(_0x95bd('0x10'));var ISPEECH_API=_0x95bd('0x11');function downloadFile(_0x4a25bf,_0x3eafd9){return new BPromise(function(_0x3c71e7,_0x12fdae){var _0x34d615=urlParse(_0x4a25bf);var _0x464329=_0x34d615[_0x95bd('0x12')]===_0x95bd('0x13')?https:http;var _0x49cfa3={'host':_0x34d615[_0x95bd('0x14')],'path':_0x34d615[_0x95bd('0x4')],'headers':{'user-agent':_0x95bd('0x15')}};_0x464329[_0x95bd('0x16')](_0x49cfa3,function(_0x51fa6f){if(_0x51fa6f[_0x95bd('0x17')]!==0xc8){logger[_0x95bd('0x18')]('request\x20to\x20'+_0x4a25bf+_0x95bd('0x19')+_0x51fa6f[_0x95bd('0x17')]+'\x20('+_0x51fa6f[_0x95bd('0x1a')]+')');_0x12fdae(new Error('request\x20to\x20'+_0x4a25bf+_0x95bd('0x19')+_0x51fa6f[_0x95bd('0x17')]+'\x20('+_0x51fa6f[_0x95bd('0x1a')]+')'));return;}var _0x57ccf3=fs[_0x95bd('0x1b')](_0x3eafd9);_0x57ccf3['on'](_0x95bd('0x1c'),function(){logger[_0x95bd('0x1d')](_0x95bd('0x1e'));_0x57ccf3['close'](_0x3c71e7);});_0x57ccf3['on'](_0x95bd('0x18'),function(_0x48e6b6){fs[_0x95bd('0x1f')](_0x3eafd9);logger[_0x95bd('0x18')](_0x95bd('0x20'),_0x48e6b6);_0x12fdae(_0x48e6b6);});_0x51fa6f[_0x95bd('0x21')](_0x57ccf3);})['on'](_0x95bd('0x18'),function(_0x309bac){logger[_0x95bd('0x18')](_0x309bac);_0x12fdae(_0x309bac);})[_0x95bd('0x22')]();});}function uploadFile(_0x26e1ab){return new BPromise(function(_0x17a5d2,_0x67655e){var _0x229260=urlParse(_0x26e1ab);var _0x1720cf=_0x229260[_0x95bd('0x12')]===_0x95bd('0x13')?https:http;var _0x40a3c9={'host':_0x229260[_0x95bd('0x14')],'path':_0x229260[_0x95bd('0x4')],'headers':{'user-agent':_0x95bd('0x15')}};_0x1720cf['get'](_0x40a3c9,function(_0x2ba3f0){if(_0x2ba3f0[_0x95bd('0x17')]!==0xc8){_0x67655e(new Error(_0x95bd('0x23')+_0x26e1ab+_0x95bd('0x19')+_0x2ba3f0[_0x95bd('0x17')]+'\x20('+_0x2ba3f0[_0x95bd('0x1a')]+')'));return;}var _0x332fda='';_0x2ba3f0['on'](_0x95bd('0x24'),function(_0x386705){_0x332fda+=_0x386705;});_0x2ba3f0['on'](_0x95bd('0x22'),function(){_0x17a5d2(_0x332fda);});})['on'](_0x95bd('0x18'),function(_0x23bf51){_0x67655e(_0x23bf51);})[_0x95bd('0x22')]();});}function convertFile(_0x3e76e5,_0xa9067f){return new BPromise(function(_0x42fcfa,_0x388094){var _0x1dba3b=sox[_0x95bd('0x25')](_0x3e76e5,_0xa9067f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1dba3b['on'](_0x95bd('0x18'),function(_0x53d09c){logger['error'](_0x95bd('0x26'),_0x53d09c);_0x388094(_0x53d09c);});_0x1dba3b['on'](_0x95bd('0x22'),function(){logger[_0x95bd('0x1d')](_0x95bd('0x27'));_0x42fcfa();});_0x1dba3b[_0x95bd('0x28')]();});}function base64Decode(_0x29b9b5,_0x101d3c){var _0x36bc60=path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x2c'));fs[_0x95bd('0x2d')](_0x36bc60,_0x29b9b5,_0x95bd('0x2e'));return convertFile(_0x36bc60,_0x101d3c)[_0x95bd('0x2f')](function(){try{fs[_0x95bd('0x1f')](_0x36bc60);fs[_0x95bd('0x30')](_0x101d3c,_0x95bd('0x31'));}catch(_0x153d72){logger[_0x95bd('0x18')](_0x153d72);}return _0x101d3c[_0x95bd('0x32')]('.')[0x0];});}function base64Encode(_0x4888c7){var _0x26894c=fs[_0x95bd('0x33')](_0x4888c7);return new Buffer(_0x26894c)[_0x95bd('0x34')](_0x95bd('0x2e'));}exports['googleCloudTTS']=function(_0x43f520,_0x3ac9eb,_0xd2ac20,_0x5b1d0f,_0x4a29ec,_0x4c2130){var _0x29a431,_0xa0907f;var _0x94287f=_0x95bd('0x35');var _0x17f89a=_0x95bd('0x36')+_0x43f520;var _0x453054={};if(_0x3ac9eb===_0x95bd('0x37')){_0x453054[_0x95bd('0x38')]={'ssml':_0xd2ac20};}else{_0x453054['input']={'text':_0xd2ac20};};_0x453054[_0x95bd('0x39')]={'languageCode':_0x5b1d0f,'ssmlGender':_0x4a29ec};_0x453054[_0x95bd('0x3a')]={'audioEncoding':_0x95bd('0x3b'),'sampleRateHertz':0x1f40};var _0x3fd0ef={'url':_0x94287f+_0x95bd('0x3c')+_0x17f89a,'method':_0x95bd('0x3d'),'json':!![],'body':_0x453054};return rp(_0x3fd0ef)[_0x95bd('0x2f')](function(_0xb27b15){return new BPromise(function(_0x4e3081,_0x5d631e){_0x29a431=path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x3e'));var _0x50a5ea=Buffer[_0x95bd('0x3f')](_0xb27b15[_0x95bd('0x40')],'base64');return fs['writeFile'](_0x29a431,_0x50a5ea,function(_0xd901ac){_0x5d631e(_0xd901ac);},function(_0x197b38){fs[_0x95bd('0x30')](_0x29a431,'777');_0x4e3081(_0x197b38);});});})[_0x95bd('0x2f')](function(_0x3a7efd){_0xa0907f=path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x2c'));return convertFile(_0x29a431,_0xa0907f);})['then'](function(){try{fs[_0x95bd('0x1f')](_0x29a431);fs['chmodSync'](_0xa0907f,_0x95bd('0x31'));}catch(_0x1c24b9){logger[_0x95bd('0x18')](_0x1c24b9);}logger[_0x95bd('0x1d')](_0x95bd('0x41'),_0xa0907f[_0x95bd('0x32')]('.')[0x0]);return _0xa0907f[_0x95bd('0x32')]('.')[0x0];});};exports[_0x95bd('0x42')]=function(_0x55ee76,_0x1dc2f6){var _0x5d0e58=_0x95bd('0x43');var _0xf6430b,_0x5f5507;var _0x17eff2;var _0xfc0c31={'encoding':_0x95bd('0x44'),'method':_0x95bd('0x3d'),'timeout':0x2710,'url':_0x5d0e58,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x95bd('0x45')+encodeURIComponent(JSON['stringify']([[[_0x95bd('0x46'),JSON[_0x95bd('0x47')]([_0x55ee76,_0x1dc2f6||'en',![],_0x95bd('0x48')]),null,'generic']]]))};return rp(_0xfc0c31)['then'](function(_0x4266b2){try{_0x17eff2=eval(_0x4266b2[_0x95bd('0x49')](0x5))[0x0][0x2];}catch(_0x5a6781){throw new Error(_0x95bd('0x4a')+_0x4266b2[_0x95bd('0x24')]);}if(!_0x17eff2){if(_0x55ee76[_0x95bd('0x4b')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x95bd('0x4c')+_0x1dc2f6+_0x95bd('0x4d'));}}try{_0x17eff2=eval(_0x17eff2)[0x0];}catch(_0xe116c0){throw new Error(_0x95bd('0x4a')+res[_0x95bd('0x24')]);}const _0x5e46ae=_0x17eff2;_0xf6430b=path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs[_0x95bd('0x2b')](0x4)+'.mp3');fs[_0x95bd('0x2d')](_0xf6430b,_0x17eff2,{'encoding':_0x95bd('0x2e')});_0x5f5507=path['resolve'](__dirname,'tmp',rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x2c'));return convertFile(_0xf6430b,_0x5f5507);})[_0x95bd('0x2f')](function(){try{fs[_0x95bd('0x1f')](_0xf6430b);fs[_0x95bd('0x30')](_0x5f5507,_0x95bd('0x31'));}catch(_0x3b3a3c){logger[_0x95bd('0x18')](_0x3b3a3c);}logger[_0x95bd('0x1d')]('goggleTTS\x20path',_0x5f5507[_0x95bd('0x32')]('.')[0x0]);return _0x5f5507[_0x95bd('0x32')]('.')[0x0];});};exports[_0x95bd('0x4e')]=function(_0x1749ae,_0x4c5dc6,_0x45d3b9){return google['asr'](_0x1749ae,_0x4c5dc6,_0x45d3b9)[_0x95bd('0x2f')](function(_0x3964c0){logger[_0x95bd('0x1d')](_0x3964c0[_0x95bd('0x4f')]);return rp(_0x3964c0);})['then'](function(_0x37fb8c){var _0x10cd8d='';var _0xfb70ca=0x0;try{fs[_0x95bd('0x1f')](_0x1749ae);}catch(_0x687e34){logger['error'](_0x687e34);}if(_0x37fb8c&&_0x37fb8c[_0x95bd('0x50')]){_0x10cd8d=_0x37fb8c[_0x95bd('0x50')][_0x95bd('0x51')](function(_0x1e2005){return _0x1e2005&&_0x1e2005[_0x95bd('0x52')][0x0]&&_0x1e2005[_0x95bd('0x52')][0x0][_0x95bd('0x53')]?_0x1e2005[_0x95bd('0x52')][0x0]['transcript']:'';})[_0x95bd('0x54')]('\x0a');_0xfb70ca=_0x37fb8c['results'][_0x95bd('0x51')](function(_0x38ee82){return _0x38ee82&&_0x38ee82[_0x95bd('0x52')][0x0]&&_0x38ee82[_0x95bd('0x52')][0x0][_0x95bd('0x55')]?_0x38ee82['alternatives'][0x0][_0x95bd('0x55')]:0x0;})[_0x95bd('0x54')]('\x0a');}logger[_0x95bd('0x1d')](_0x95bd('0x56'),_0x10cd8d);logger[_0x95bd('0x1d')](_0x95bd('0x57'),_0xfb70ca);return{'transcript':_0x10cd8d,'confidence':_0xfb70ca};})[_0x95bd('0x58')](function(_0xdefb2d){logger[_0x95bd('0x18')](_0x95bd('0x59'),_0xdefb2d[_0x95bd('0x17')],_0xdefb2d[_0x95bd('0x5a')],_0xdefb2d[_0x95bd('0x5b')]);});};exports[_0x95bd('0x5c')]=function(_0x4ac3ad,_0x3c520c,_0x5e6585,_0x1928ae){var _0x6b04d0=apiai(_0x3c520c,{'language':_0x1928ae||'en'});return _0x6b04d0[_0x95bd('0x5d')](_0x5e6585,{'sessionId':md5(_0x4ac3ad)})['then'](function(_0x58738a){logger[_0x95bd('0x1d')](JSON['stringify'](_0x58738a));return{'source':_0x58738a[_0x95bd('0x5e')][_0x95bd('0x5f')],'resolvedQuery':_0x58738a['result'][_0x95bd('0x60')],'action':_0x58738a[_0x95bd('0x5e')]['action'],'actionIncomplete':_0x58738a[_0x95bd('0x5e')][_0x95bd('0x61')],'speech':_0x58738a[_0x95bd('0x5e')]['fulfillment']['speech'],'score':_0x58738a['result'][_0x95bd('0x62')],'statusCode':_0x58738a['status'][_0x95bd('0x63')],'endConversation':_0x58738a['result'][_0x95bd('0x64')][_0x95bd('0x65')]||![],'isFallbackIntent':_0x58738a['result'][_0x95bd('0x64')][_0x95bd('0x66')]};});};exports[_0x95bd('0x67')]=function(_0x37f639,_0x56b3cc,_0x2be300,_0x231735,_0x26fad8,_0x12c759){var _0x3d947f=_0x231735['replace'](/\\n/g,'\x0a');var _0x4c1ab6={'credentials':{'private_key':_0x3d947f,'client_email':_0x2be300}};var _0x1b4076=new dialogflow['SessionsClient'](_0x4c1ab6);var _0x186307=_0x1b4076[_0x95bd('0x68')](_0x56b3cc,md5(_0x37f639));var _0x50da9f={'session':_0x186307,'queryInput':{'text':{'text':_0x26fad8,'languageCode':_0x12c759}}};return _0x1b4076[_0x95bd('0x69')](_0x50da9f)[_0x95bd('0x2f')](function(_0x593480){if(_0x593480&&_0x593480[_0x95bd('0x4b')]){logger['info'](_0x95bd('0x6a'),JSON[_0x95bd('0x47')](_0x593480));var _0x4d25c4=_0x593480[0x0];if(_0x4d25c4){var _0x1a4445={'action':_0x4d25c4['queryResult'][_0x95bd('0x6b')],'allRequiredParamsPresent':_0x4d25c4['queryResult'][_0x95bd('0x6c')],'endConversation':_0x4d25c4['queryResult']['diagnosticInfo']&&_0x4d25c4[_0x95bd('0x6d')][_0x95bd('0x6e')][_0x95bd('0x6f')]?_0x4d25c4['queryResult']['diagnosticInfo']['fields'][_0x95bd('0x70')][_0x95bd('0x71')]:![],'fulfillmentText':_0x4d25c4[_0x95bd('0x6d')][_0x95bd('0x72')],'intentName':_0x4d25c4['queryResult'][_0x95bd('0x73')]['name'],'intentDisplayName':_0x4d25c4[_0x95bd('0x6d')][_0x95bd('0x73')][_0x95bd('0x74')],'isFallbackIntent':_0x4d25c4[_0x95bd('0x6d')][_0x95bd('0x73')][_0x95bd('0x75')],'languageCode':_0x4d25c4[_0x95bd('0x6d')][_0x95bd('0x76')],'queryText':_0x4d25c4[_0x95bd('0x6d')][_0x95bd('0x77')],'responseId':_0x4d25c4[_0x95bd('0x78')],'score':_0x4d25c4['queryResult']['intentDetectionConfidence'],'speech':_0x4d25c4[_0x95bd('0x6d')]['fulfillmentText'],'providerResponse':JSON[_0x95bd('0x47')](_0x593480)};return _0x1a4445;}}});};exports[_0x95bd('0x79')]=function(_0x167a25,_0x552dcc,_0x506550,_0x4ea858){return tilde[_0x95bd('0x7a')](_0x167a25,_0x552dcc,_0x506550,_0x4ea858)['then'](function(_0x54c6af){try{fs['unlink'](_0x167a25);}catch(_0x4423cc){logger[_0x95bd('0x18')](_0x4423cc);}logger[_0x95bd('0x1d')](_0x95bd('0x7b'),_0x54c6af[_0x95bd('0x53')]);logger[_0x95bd('0x1d')](_0x95bd('0x7c'),_0x54c6af['confidence']);return _0x54c6af;});};exports[_0x95bd('0x7d')]=function(_0x311704,_0x3f0893,_0xa50792,_0x1225c6,_0x567a13,_0x32c528){var _0x13c2d4=path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x3e'));var _0x49eeb3;return aws[_0x95bd('0x7e')](_0x311704,_0x3f0893,_0xa50792,_0x1225c6,_0x567a13,_0x32c528,_0x13c2d4)['then'](function(){_0x49eeb3=path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs['generate'](0x4)+_0x95bd('0x2c'));return convertFile(_0x13c2d4,_0x49eeb3);})[_0x95bd('0x2f')](function(){try{fs[_0x95bd('0x1f')](_0x13c2d4);fs[_0x95bd('0x30')](_0x49eeb3,'777');}catch(_0x4961c0){logger[_0x95bd('0x18')](_0x4961c0);}return _0x49eeb3['split']('.')[0x0];});};exports['awsLex']=function(_0x5ef1ed,_0x59a713,_0x55cabc,_0x4c9af7,_0x409675,_0x16aeb7){return aws[_0x95bd('0x7f')](_0x5ef1ed,_0x59a713,_0x55cabc,_0x4c9af7,_0x409675,_0x16aeb7)[_0x95bd('0x2f')](function(_0x27a81c){logger[_0x95bd('0x1d')](JSON[_0x95bd('0x47')](_0x27a81c));return _0x27a81c;});};exports[_0x95bd('0x80')]=function(_0x53164c,_0x4887ad,_0x4bb47e,_0x306f51){var _0x31387d=util[_0x95bd('0x81')](_0x95bd('0x82'),ISPEECH_API,_0x53164c,encodeURIComponent(_0x4887ad),_0x4bb47e,_0x306f51);var _0x692603=path[_0x95bd('0x29')](__dirname,'tmp',rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x3e'));var _0x5a2221;return downloadFile(_0x31387d,_0x692603)[_0x95bd('0x2f')](function(){_0x5a2221=path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x2c'));return convertFile(_0x692603,_0x5a2221);})[_0x95bd('0x2f')](function(){try{fs[_0x95bd('0x1f')](_0x692603);fs[_0x95bd('0x30')](_0x5a2221,_0x95bd('0x31'));}catch(_0x346afc){logger[_0x95bd('0x18')](_0x346afc);}return _0x5a2221[_0x95bd('0x32')]('.')[0x0];});};exports['ispeechASR']=function(_0x56199b,_0x4f443f,_0x543220,_0x2351c8){var _0x413a55=util['format'](_0x95bd('0x83'),ISPEECH_API,_0x4f443f,_0x543220,base64Encode(_0x56199b),_0x2351c8?util[_0x95bd('0x81')](_0x95bd('0x84'),encodeURIComponent(_0x2351c8)):_0x95bd('0x85'));return uploadFile(_0x413a55)['then'](function(_0x4d7590){return querystring[_0x95bd('0xa')](_0x4d7590);});};exports[_0x95bd('0x86')]=function(_0x49f83d,_0x52473a){return sestek[_0x95bd('0x87')](_0x49f83d,_0x52473a)[_0x95bd('0x2f')](function(_0x1fc0ff){logger[_0x95bd('0x1d')](JSON[_0x95bd('0x47')](_0x1fc0ff));var _0x280700={'speech':_0x1fc0ff[_0x95bd('0x88')],'action':_0x1fc0ff[_0x95bd('0x89')]?_0x1fc0ff['channelData'][_0x95bd('0x8a')]:undefined,'actiondata':_0x1fc0ff[_0x95bd('0x89')]?_0x1fc0ff['channelData'][_0x95bd('0x8b')]:undefined};if(_0x1fc0ff['channelData']&&_0x1fc0ff[_0x95bd('0x89')][_0x95bd('0x8c')]){return base64Decode(_0x1fc0ff[_0x95bd('0x89')][_0x95bd('0x8c')][_0x95bd('0x8d')],path[_0x95bd('0x29')](__dirname,_0x95bd('0x2a'),rs[_0x95bd('0x2b')](0x4)+_0x95bd('0x2c')))[_0x95bd('0x2f')](function(_0x44ef3e){_0x280700[_0x95bd('0x8e')]=_0x44ef3e;return _0x280700;});}return _0x280700;});};exports[_0x95bd('0x8f')]=function(){return __dirname;}; \ No newline at end of file +var _0xef0f=['transcript','results','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','displayName','languageCode','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','unlink','download\x20error','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','text:synthesize','POST','then','.mp3','writeFile','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','uri','map','alternatives'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xef0f,0x154));var _0xfef0=function(_0x179faf,_0xd988a4){_0x179faf=_0x179faf-0x0;var _0x1c2e51=_0xef0f[_0x179faf];return _0x1c2e51;};'use strict';var apiai=require(_0xfef0('0x0'));var BPromise=require(_0xfef0('0x1'));var dialogflow=require(_0xfef0('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xfef0('0x3'));var path=require(_0xfef0('0x4'));var querystring=require(_0xfef0('0x5'));var rp=require(_0xfef0('0x6'));var rs=require(_0xfef0('0x7'));var sox=require(_0xfef0('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xfef0('0x9'))[_0xfef0('0xa')];var util=require(_0xfef0('0xb'));var aws=require('./aws');var google=require(_0xfef0('0xc'));var sestek=require('./sestek');var tilde=require(_0xfef0('0xd'));var logger=require(_0xfef0('0xe'))(_0xfef0('0xf'));var ISPEECH_API=_0xfef0('0x10');function downloadFile(_0x1e4ca5,_0x3284c4){return new BPromise(function(_0x461639,_0x34d5b0){var _0x6f1e32=urlParse(_0x1e4ca5);var _0x3d4ee5=_0x6f1e32[_0xfef0('0x11')]===_0xfef0('0x12')?https:http;var _0x258cb3={'host':_0x6f1e32[_0xfef0('0x13')],'path':_0x6f1e32[_0xfef0('0x4')],'headers':{'user-agent':_0xfef0('0x14')}};_0x3d4ee5[_0xfef0('0x15')](_0x258cb3,function(_0x357819){if(_0x357819[_0xfef0('0x16')]!==0xc8){logger[_0xfef0('0x17')](_0xfef0('0x18')+_0x1e4ca5+_0xfef0('0x19')+_0x357819[_0xfef0('0x16')]+'\x20('+_0x357819[_0xfef0('0x1a')]+')');_0x34d5b0(new Error('request\x20to\x20'+_0x1e4ca5+'\x20failed,\x20status\x20code\x20=\x20'+_0x357819[_0xfef0('0x16')]+'\x20('+_0x357819['statusMessage']+')'));return;}var _0x4c3c1a=fs[_0xfef0('0x1b')](_0x3284c4);_0x4c3c1a['on']('finish',function(){logger[_0xfef0('0x1c')](_0xfef0('0x1d'));_0x4c3c1a['close'](_0x461639);});_0x4c3c1a['on']('error',function(_0x24c8b9){fs[_0xfef0('0x1e')](_0x3284c4);logger[_0xfef0('0x17')](_0xfef0('0x1f'),_0x24c8b9);_0x34d5b0(_0x24c8b9);});_0x357819['pipe'](_0x4c3c1a);})['on']('error',function(_0x36c597){logger[_0xfef0('0x17')](_0x36c597);_0x34d5b0(_0x36c597);})['end']();});}function uploadFile(_0x404294){return new BPromise(function(_0x40311e,_0x3c71b7){var _0x599543=urlParse(_0x404294);var _0x4d0a5e=_0x599543[_0xfef0('0x11')]===_0xfef0('0x12')?https:http;var _0x331334={'host':_0x599543[_0xfef0('0x13')],'path':_0x599543[_0xfef0('0x4')],'headers':{'user-agent':_0xfef0('0x14')}};_0x4d0a5e['get'](_0x331334,function(_0xae1d65){if(_0xae1d65[_0xfef0('0x16')]!==0xc8){_0x3c71b7(new Error('request\x20to\x20'+_0x404294+_0xfef0('0x19')+_0xae1d65[_0xfef0('0x16')]+'\x20('+_0xae1d65[_0xfef0('0x1a')]+')'));return;}var _0x4b5f9='';_0xae1d65['on'](_0xfef0('0x20'),function(_0x4225c2){_0x4b5f9+=_0x4225c2;});_0xae1d65['on'](_0xfef0('0x21'),function(){_0x40311e(_0x4b5f9);});})['on'](_0xfef0('0x17'),function(_0x17a3c6){_0x3c71b7(_0x17a3c6);})['end']();});}function convertFile(_0x312e71,_0x98690b){return new BPromise(function(_0x13fd29,_0x5a216a){var _0x135f5b=sox[_0xfef0('0x22')](_0x312e71,_0x98690b,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x135f5b['on']('error',function(_0x5adf87){logger[_0xfef0('0x17')](_0xfef0('0x23'),_0x5adf87);_0x5a216a(_0x5adf87);});_0x135f5b['on'](_0xfef0('0x21'),function(){logger[_0xfef0('0x1c')](_0xfef0('0x24'));_0x13fd29();});_0x135f5b[_0xfef0('0x25')]();});}function base64Decode(_0x42ec94,_0xbd7bb4){var _0x34f8bc=path[_0xfef0('0x26')](__dirname,_0xfef0('0x27'),rs[_0xfef0('0x28')](0x4)+_0xfef0('0x29'));fs[_0xfef0('0x2a')](_0x34f8bc,_0x42ec94,_0xfef0('0x2b'));return convertFile(_0x34f8bc,_0xbd7bb4)['then'](function(){try{fs[_0xfef0('0x1e')](_0x34f8bc);fs[_0xfef0('0x2c')](_0xbd7bb4,_0xfef0('0x2d'));}catch(_0x37854b){logger[_0xfef0('0x17')](_0x37854b);}return _0xbd7bb4[_0xfef0('0x2e')]('.')[0x0];});}function base64Encode(_0x30b92e){var _0x424630=fs[_0xfef0('0x2f')](_0x30b92e);return new Buffer(_0x424630)['toString'](_0xfef0('0x2b'));}exports[_0xfef0('0x30')]=function(_0x36b83d,_0x3e65a3,_0x336a48,_0x1ef9f7,_0x497c23,_0x23c141){var _0x2cd822,_0x51ff2e;var _0x5e15e1=_0xfef0('0x31');var _0x2d5a20=_0xfef0('0x32')+_0x36b83d;var _0x15cc65={};if(_0x3e65a3===_0xfef0('0x33')){_0x15cc65[_0xfef0('0x34')]={'ssml':_0x336a48};}else{_0x15cc65[_0xfef0('0x34')]={'text':_0x336a48};};_0x15cc65['voice']={'languageCode':_0x1ef9f7,'ssmlGender':_0x497c23};_0x15cc65['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x1defbe={'url':_0x5e15e1+_0xfef0('0x35')+_0x2d5a20,'method':_0xfef0('0x36'),'json':!![],'body':_0x15cc65};return rp(_0x1defbe)[_0xfef0('0x37')](function(_0x461cd4){return new BPromise(function(_0x46dc1c,_0x4452a2){_0x2cd822=path[_0xfef0('0x26')](__dirname,_0xfef0('0x27'),rs[_0xfef0('0x28')](0x4)+_0xfef0('0x38'));var _0x3e9d13=Buffer['from'](_0x461cd4['audioContent'],_0xfef0('0x2b'));return fs[_0xfef0('0x39')](_0x2cd822,_0x3e9d13,function(_0x35e8ff){_0x4452a2(_0x35e8ff);},function(_0x18fbdb){fs[_0xfef0('0x2c')](_0x2cd822,_0xfef0('0x2d'));_0x46dc1c(_0x18fbdb);});});})[_0xfef0('0x37')](function(_0x50d5d0){_0x51ff2e=path[_0xfef0('0x26')](__dirname,_0xfef0('0x27'),rs[_0xfef0('0x28')](0x4)+_0xfef0('0x29'));return convertFile(_0x2cd822,_0x51ff2e);})[_0xfef0('0x37')](function(){try{fs[_0xfef0('0x1e')](_0x2cd822);fs[_0xfef0('0x2c')](_0x51ff2e,'777');}catch(_0x44bfc5){logger[_0xfef0('0x17')](_0x44bfc5);}logger['info']('googleCloudTTS\x20path',_0x51ff2e['split']('.')[0x0]);return _0x51ff2e[_0xfef0('0x2e')]('.')[0x0];});};exports['googleTTS']=function(_0x3a407e,_0x25a7b5){var _0x1bc3a2=_0xfef0('0x3a');var _0x550ab6,_0x5930f0;var _0x51216d;var _0x196205={'encoding':_0xfef0('0x3b'),'method':_0xfef0('0x36'),'timeout':0x2710,'url':_0x1bc3a2,'headers':{'Content-Type':_0xfef0('0x3c')},'body':_0xfef0('0x3d')+encodeURIComponent(JSON['stringify']([[[_0xfef0('0x3e'),JSON[_0xfef0('0x3f')]([_0x3a407e,_0x25a7b5||'en',![],_0xfef0('0x40')]),null,_0xfef0('0x41')]]]))};return rp(_0x196205)[_0xfef0('0x37')](function(_0x25a1d8){try{_0x51216d=eval(_0x25a1d8['slice'](0x5))[0x0][0x2];}catch(_0x145d1){throw new Error('parse\x20response\x20failed:\x0a'+_0x25a1d8[_0xfef0('0x20')]);}if(!_0x51216d){if(_0x3a407e[_0xfef0('0x42')]>0xc8){throw new Error(_0xfef0('0x43'));}else{throw new Error(_0xfef0('0x44')+_0x25a7b5+_0xfef0('0x45'));}}try{_0x51216d=eval(_0x51216d)[0x0];}catch(_0x3954ae){throw new Error(_0xfef0('0x46')+res[_0xfef0('0x20')]);}const _0x4b41ad=_0x51216d;_0x550ab6=path['resolve'](__dirname,_0xfef0('0x27'),rs[_0xfef0('0x28')](0x4)+_0xfef0('0x38'));fs[_0xfef0('0x2a')](_0x550ab6,_0x51216d,{'encoding':'base64'});_0x5930f0=path[_0xfef0('0x26')](__dirname,'tmp',rs[_0xfef0('0x28')](0x4)+_0xfef0('0x29'));return convertFile(_0x550ab6,_0x5930f0);})[_0xfef0('0x37')](function(){try{fs['unlink'](_0x550ab6);fs[_0xfef0('0x2c')](_0x5930f0,_0xfef0('0x2d'));}catch(_0x9ddaa0){logger['error'](_0x9ddaa0);}logger[_0xfef0('0x1c')](_0xfef0('0x47'),_0x5930f0['split']('.')[0x0]);return _0x5930f0[_0xfef0('0x2e')]('.')[0x0];});};exports[_0xfef0('0x48')]=function(_0x3ff673,_0x3b4d2f,_0x319a5d){return google[_0xfef0('0x49')](_0x3ff673,_0x3b4d2f,_0x319a5d)[_0xfef0('0x37')](function(_0x169bae){logger[_0xfef0('0x1c')](_0x169bae[_0xfef0('0x4a')]);return rp(_0x169bae);})['then'](function(_0x4b1602){var _0x25db81='';var _0x102dd0=0x0;try{fs['unlink'](_0x3ff673);}catch(_0x1114af){logger[_0xfef0('0x17')](_0x1114af);}if(_0x4b1602&&_0x4b1602['results']){_0x25db81=_0x4b1602['results'][_0xfef0('0x4b')](function(_0x13cde7){return _0x13cde7&&_0x13cde7[_0xfef0('0x4c')][0x0]&&_0x13cde7[_0xfef0('0x4c')][0x0]['transcript']?_0x13cde7['alternatives'][0x0][_0xfef0('0x4d')]:'';})['join']('\x0a');_0x102dd0=_0x4b1602[_0xfef0('0x4e')]['map'](function(_0x164c40){return _0x164c40&&_0x164c40['alternatives'][0x0]&&_0x164c40[_0xfef0('0x4c')][0x0][_0xfef0('0x4f')]?_0x164c40[_0xfef0('0x4c')][0x0][_0xfef0('0x4f')]:0x0;})[_0xfef0('0x50')]('\x0a');}logger['info'](_0xfef0('0x51'),_0x25db81);logger['info'](_0xfef0('0x52'),_0x102dd0);return{'transcript':_0x25db81,'confidence':_0x102dd0};})[_0xfef0('0x53')](function(_0x1e2b80){logger[_0xfef0('0x17')](_0xfef0('0x54'),_0x1e2b80[_0xfef0('0x16')],_0x1e2b80[_0xfef0('0x55')],_0x1e2b80[_0xfef0('0x56')]);});};exports[_0xfef0('0x57')]=function(_0x35f533,_0x44bac7,_0x6298cb,_0x248e11){var _0x58ce30=apiai(_0x44bac7,{'language':_0x248e11||'en'});return _0x58ce30[_0xfef0('0x58')](_0x6298cb,{'sessionId':md5(_0x35f533)})[_0xfef0('0x37')](function(_0x2b6556){logger[_0xfef0('0x1c')](JSON[_0xfef0('0x3f')](_0x2b6556));return{'source':_0x2b6556[_0xfef0('0x59')][_0xfef0('0x5a')],'resolvedQuery':_0x2b6556['result'][_0xfef0('0x5b')],'action':_0x2b6556[_0xfef0('0x59')][_0xfef0('0x5c')],'actionIncomplete':_0x2b6556[_0xfef0('0x59')][_0xfef0('0x5d')],'speech':_0x2b6556[_0xfef0('0x59')][_0xfef0('0x5e')][_0xfef0('0x5f')],'score':_0x2b6556['result'][_0xfef0('0x60')],'statusCode':_0x2b6556[_0xfef0('0x61')][_0xfef0('0x62')],'endConversation':_0x2b6556[_0xfef0('0x59')][_0xfef0('0x63')][_0xfef0('0x64')]||![],'isFallbackIntent':_0x2b6556[_0xfef0('0x59')]['metadata'][_0xfef0('0x65')]};});};exports[_0xfef0('0x66')]=function(_0x18edd5,_0x49a132,_0x292399,_0x455475,_0x477bbf,_0x5ba00c){var _0x48e968=_0x455475[_0xfef0('0x67')](/\\n/g,'\x0a');var _0x162388={'credentials':{'private_key':_0x48e968,'client_email':_0x292399}};var _0x2e277f=new dialogflow[(_0xfef0('0x68'))](_0x162388);var _0x20c5a0=_0x2e277f[_0xfef0('0x69')](_0x49a132,md5(_0x18edd5));var _0x2e6cae={'session':_0x20c5a0,'queryInput':{'text':{'text':_0x477bbf,'languageCode':_0x5ba00c}}};return _0x2e277f[_0xfef0('0x6a')](_0x2e6cae)[_0xfef0('0x37')](function(_0x15ecc4){if(_0x15ecc4&&_0x15ecc4[_0xfef0('0x42')]){logger[_0xfef0('0x1c')](_0xfef0('0x6b'),JSON[_0xfef0('0x3f')](_0x15ecc4));var _0x2a35ff=_0x15ecc4[0x0];if(_0x2a35ff){var _0x360558={'action':_0x2a35ff['queryResult']['action'],'allRequiredParamsPresent':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x6d')],'endConversation':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x6e')]&&_0x2a35ff['queryResult']['diagnosticInfo'][_0xfef0('0x6f')]?_0x2a35ff[_0xfef0('0x6c')]['diagnosticInfo'][_0xfef0('0x6f')][_0xfef0('0x70')]['boolValue']:![],'fulfillmentText':_0x2a35ff[_0xfef0('0x6c')]['fulfillmentText'],'intentName':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x71')]['name'],'intentDisplayName':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x71')][_0xfef0('0x72')],'isFallbackIntent':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x71')]['isFallback'],'languageCode':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x73')],'queryText':_0x2a35ff['queryResult']['queryText'],'responseId':_0x2a35ff[_0xfef0('0x74')],'score':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x75')],'speech':_0x2a35ff[_0xfef0('0x6c')][_0xfef0('0x76')],'providerResponse':JSON[_0xfef0('0x3f')](_0x15ecc4)};return _0x360558;}}});};exports[_0xfef0('0x77')]=function(_0x1421aa,_0x10f960,_0x31bf1e,_0x39e499){return tilde['asr'](_0x1421aa,_0x10f960,_0x31bf1e,_0x39e499)['then'](function(_0x4749f9){try{fs['unlink'](_0x1421aa);}catch(_0x43414b){logger['error'](_0x43414b);}logger[_0xfef0('0x1c')](_0xfef0('0x78'),_0x4749f9[_0xfef0('0x4d')]);logger[_0xfef0('0x1c')]('Tilde\x20ASR\x20confidence',_0x4749f9[_0xfef0('0x4f')]);return _0x4749f9;});};exports[_0xfef0('0x79')]=function(_0x150b1a,_0xd9b992,_0x787771,_0x49cd95,_0x1208c9,_0x463a86){var _0x34245a=path[_0xfef0('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x297757;return aws['polly'](_0x150b1a,_0xd9b992,_0x787771,_0x49cd95,_0x1208c9,_0x463a86,_0x34245a)[_0xfef0('0x37')](function(){_0x297757=path[_0xfef0('0x26')](__dirname,'tmp',rs[_0xfef0('0x28')](0x4)+_0xfef0('0x29'));return convertFile(_0x34245a,_0x297757);})[_0xfef0('0x37')](function(){try{fs[_0xfef0('0x1e')](_0x34245a);fs[_0xfef0('0x2c')](_0x297757,'777');}catch(_0x8c1052){logger[_0xfef0('0x17')](_0x8c1052);}return _0x297757[_0xfef0('0x2e')]('.')[0x0];});};exports[_0xfef0('0x7a')]=function(_0x60032c,_0x19d91b,_0x286bf2,_0x1665b8,_0x18f3b8,_0x112ac9){return aws[_0xfef0('0x7b')](_0x60032c,_0x19d91b,_0x286bf2,_0x1665b8,_0x18f3b8,_0x112ac9)[_0xfef0('0x37')](function(_0x45384e){logger[_0xfef0('0x1c')](JSON['stringify'](_0x45384e));return _0x45384e;});};exports[_0xfef0('0x7c')]=function(_0x4c4c1a,_0x517e18,_0x18b42c,_0x21f06c){var _0xf60b86=util[_0xfef0('0x7d')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x4c4c1a,encodeURIComponent(_0x517e18),_0x18b42c,_0x21f06c);var _0x55c83c=path['resolve'](__dirname,_0xfef0('0x27'),rs[_0xfef0('0x28')](0x4)+'.mp3');var _0x59cab6;return downloadFile(_0xf60b86,_0x55c83c)[_0xfef0('0x37')](function(){_0x59cab6=path['resolve'](__dirname,_0xfef0('0x27'),rs[_0xfef0('0x28')](0x4)+'.wav');return convertFile(_0x55c83c,_0x59cab6);})['then'](function(){try{fs[_0xfef0('0x1e')](_0x55c83c);fs['chmodSync'](_0x59cab6,'777');}catch(_0x337510){logger[_0xfef0('0x17')](_0x337510);}return _0x59cab6[_0xfef0('0x2e')]('.')[0x0];});};exports[_0xfef0('0x7e')]=function(_0x1e180f,_0x15ccae,_0x110e58,_0x173671){var _0xfecb8f=util['format'](_0xfef0('0x7f'),ISPEECH_API,_0x15ccae,_0x110e58,base64Encode(_0x1e180f),_0x173671?util['format'](_0xfef0('0x80'),encodeURIComponent(_0x173671)):_0xfef0('0x81'));return uploadFile(_0xfecb8f)[_0xfef0('0x37')](function(_0x268a29){return querystring['parse'](_0x268a29);});};exports[_0xfef0('0x82')]=function(_0x218115,_0xbd1896){return sestek[_0xfef0('0x83')](_0x218115,_0xbd1896)[_0xfef0('0x37')](function(_0x277335){logger[_0xfef0('0x1c')](JSON['stringify'](_0x277335));var _0x1d114a={'speech':_0x277335[_0xfef0('0x84')],'action':_0x277335[_0xfef0('0x85')]?_0x277335[_0xfef0('0x85')][_0xfef0('0x86')]:undefined,'actiondata':_0x277335[_0xfef0('0x85')]?_0x277335[_0xfef0('0x85')][_0xfef0('0x87')]:undefined};if(_0x277335[_0xfef0('0x85')]&&_0x277335[_0xfef0('0x85')]['AudioFromTts']){return base64Decode(_0x277335[_0xfef0('0x85')][_0xfef0('0x88')][_0xfef0('0x89')],path[_0xfef0('0x26')](__dirname,'tmp',rs[_0xfef0('0x28')](0x4)+_0xfef0('0x29')))[_0xfef0('0x37')](function(_0x47ea91){_0x1d114a['audiofile']=_0x47ea91;return _0x1d114a;});}return _0x1d114a;});};exports[_0xfef0('0x8a')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 7d8d4c5..b3448dc 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 _0x7766=['./nda'];(function(_0x5534b7,_0xbe6ba4){var _0x34af05=function(_0x2f8d94){while(--_0x2f8d94){_0x5534b7['push'](_0x5534b7['shift']());}};_0x34af05(++_0xbe6ba4);}(_0x7766,0x18b));var _0x6776=function(_0x656f5c,_0x91ffe7){_0x656f5c=_0x656f5c-0x0;var _0x2beab5=_0x7766[_0x656f5c];return _0x2beab5;};var nda=require(_0x6776('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0xd18d=['./nda','exports'];(function(_0x3a1d55,_0x3aae53){var _0x14b44f=function(_0x5aaac2){while(--_0x5aaac2){_0x3a1d55['push'](_0x3a1d55['shift']());}};_0x14b44f(++_0x3aae53);}(_0xd18d,0xb4));var _0xdd18=function(_0x31f095,_0x4ef11d){_0x31f095=_0x31f095-0x0;var _0xc7f71c=_0xd18d[_0x31f095];return _0xc7f71c;};var nda=require(_0xdd18('0x0'));module[_0xdd18('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 71ed17a..ccbacfe 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 _0x0531=['access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','ndaactivity_type','message','Nda','calleridname','dnid','text','Bearer\x20'];(function(_0x44f1f1,_0x4be4e4){var _0x1fae61=function(_0x3c2051){while(--_0x3c2051){_0x44f1f1['push'](_0x44f1f1['shift']());}};_0x1fae61(++_0x4be4e4);}(_0x0531,0xde));var _0x1053=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x0531[_0x5806c3];return _0x48ac77;};'use strict';var rp=require(_0x1053('0x0'));var url=require(_0x1053('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x1053('0x2')]=function(_0x48bca0,_0x5ced96){var _0x1c256c={'method':_0x1053('0x3'),'uri':url[_0x1053('0x4')](_0x5ced96[_0x1053('0x5')],_0x1053('0x6')),'form':{'grant_type':_0x1053('0x7'),'username':_0x5ced96[_0x1053('0x8')],'password':_0x5ced96[_0x1053('0x7')]},'json':!![]};return rp(_0x1c256c)[_0x1053('0x9')](function(_0x3d052e){var _0x4f1877={'method':_0x1053('0x3'),'uri':url[_0x1053('0x4')](_0x5ced96[_0x1053('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5ced96[_0x1053('0xb')]||_0x1053('0xc'),'channelId':_0x1053('0xd'),'conversation':{'id':_0x48bca0['uniqueid']},'from':{'id':_0x48bca0['callerid'],'name':_0x48bca0[_0x1053('0xe')]},'recipient':{'id':_0x48bca0[_0x1053('0xf')],'name':_0x48bca0['extension']},'text':_0x5ced96[_0x1053('0x10')],'channelData':{}},'headers':{'Authorization':_0x1053('0x11')+_0x3d052e[_0x1053('0x12')]},'json':!![]};if(_0x5ced96[_0x1053('0x13')]){_0x4f1877[_0x1053('0x14')][_0x1053('0x15')][_0x1053('0x16')]=_0x5ced96[_0x1053('0x13')];}if(_0x5ced96[_0x1053('0x17')]=='1'){_0x4f1877[_0x1053('0x14')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x1053('0x18')};}if(_0x5ced96[_0x1053('0x19')]){_0x4f1877[_0x1053('0x14')]['channelData']['CustomAction']=_0x5ced96[_0x1053('0x19')];if(_0x5ced96[_0x1053('0x1a')]){_0x4f1877['body']['channelData'][_0x1053('0x1b')]=_0x5ced96[_0x1053('0x1a')];}}logger[_0x1053('0x1c')](JSON[_0x1053('0x1d')](_0x4f1877));return rp(_0x4f1877);});}; \ No newline at end of file +var _0x765b=['access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','custom_action_data','CustomActionData','info','stringify','agi','POST','resolve','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','calleridname','dnid','extension','Bearer\x20'];(function(_0x36ae4d,_0x2166ab){var _0x1ef773=function(_0x12d574){while(--_0x12d574){_0x36ae4d['push'](_0x36ae4d['shift']());}};_0x1ef773(++_0x2166ab);}(_0x765b,0x18c));var _0xb765=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x765b[_0x51fe5f];return _0x4abce9;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require('../../../../../config/logger')(_0xb765('0x0'));module['exports']=function(_0x1db469,_0x530821){var _0x1e542f={'method':_0xb765('0x1'),'uri':url[_0xb765('0x2')](_0x530821['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x530821['username'],'password':_0x530821[_0xb765('0x3')]},'json':!![]};return rp(_0x1e542f)['then'](function(_0x179545){var _0x3d56b3={'method':_0xb765('0x1'),'uri':url['resolve'](_0x530821[_0xb765('0x4')],_0xb765('0x5')),'body':{'type':_0x530821[_0xb765('0x6')]||'message','channelId':'Nda','conversation':{'id':_0x1db469['uniqueid']},'from':{'id':_0x1db469[_0xb765('0x7')],'name':_0x1db469[_0xb765('0x8')]},'recipient':{'id':_0x1db469[_0xb765('0x9')],'name':_0x1db469[_0xb765('0xa')]},'text':_0x530821['text'],'channelData':{}},'headers':{'Authorization':_0xb765('0xb')+_0x179545[_0xb765('0xc')]},'json':!![]};if(_0x530821[_0xb765('0xd')]){_0x3d56b3[_0xb765('0xe')][_0xb765('0xf')][_0xb765('0x10')]=_0x530821[_0xb765('0xd')];}if(_0x530821[_0xb765('0x11')]=='1'){_0x3d56b3[_0xb765('0xe')]['channelData'][_0xb765('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x530821[_0xb765('0x13')]){_0x3d56b3[_0xb765('0xe')]['channelData']['CustomAction']=_0x530821[_0xb765('0x13')];if(_0x530821[_0xb765('0x14')]){_0x3d56b3[_0xb765('0xe')][_0xb765('0xf')][_0xb765('0x15')]=_0x530821[_0xb765('0x14')];}}logger[_0xb765('0x16')](JSON[_0xb765('0x17')](_0x3d56b3));return rp(_0x3d56b3);});}; \ 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 d57f157..3de8875 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 _0x78bd=['./lib/api','exports'];(function(_0xd7d11b,_0x5e4fc0){var _0x12c8fa=function(_0x1b83eb){while(--_0x1b83eb){_0xd7d11b['push'](_0xd7d11b['shift']());}};_0x12c8fa(++_0x5e4fc0);}(_0x78bd,0x11c));var _0xd78b=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x78bd[_0x4b7895];return _0x264180;};'use strict';var asr=require(_0xd78b('0x0'));module[_0xd78b('0x1')]=function(_0x3f9998,_0x493cc5,_0x254958,_0x5ae8ed){return asr(_0x3f9998,_0x493cc5,_0x254958,_0x5ae8ed);}; \ No newline at end of file +var _0xdd83=['exports','./lib/api'];(function(_0xd41af5,_0x3f0d98){var _0x223db6=function(_0x4fca23){while(--_0x4fca23){_0xd41af5['push'](_0xd41af5['shift']());}};_0x223db6(++_0x3f0d98);}(_0xdd83,0xe1));var _0x3dd8=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xdd83[_0x51020b];return _0x371e47;};'use strict';var asr=require(_0x3dd8('0x0'));module[_0x3dd8('0x1')]=function(_0xb7958d,_0x351176,_0x466878,_0x2b4cdf){return asr(_0xb7958d,_0x351176,_0x466878,_0x2b4cdf);}; \ 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 2ab5ffe..7ed4d56 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 _0x9860=['hex','Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest'];(function(_0x1541ac,_0x180340){var _0x52fe13=function(_0x32129e){while(--_0x32129e){_0x1541ac['push'](_0x1541ac['shift']());}};_0x52fe13(++_0x180340);}(_0x9860,0x197));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x0986('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0986('0x1'));var crypto=require(_0x0986('0x2'));var logger=require(_0x0986('0x3'))(_0x0986('0x4'));module['exports']=function(_0x5ea41c,_0xfa01c3,_0x565a5b,_0x163ab7){return new BPromise(function(_0x4680aa,_0x551952){logger[_0x0986('0x5')](_0x0986('0x6'),_0x163ab7||_0x0986('0x7'));var _0x5f366d=new WebSocket(_0x163ab7||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x10a2f6='';var _0x82665d='0';var _0x5e5097='1';var _0x132aa7=_0x0986('0x8');function _0x5844a6(_0x27fa82){var _0x368fba=crypto[_0x0986('0x9')](_0x0986('0xa'));_0x368fba[_0x0986('0xb')](_0x27fa82);return _0x368fba[_0x0986('0xc')](_0x0986('0xd'));}function _0x58ed54(){try{logger[_0x0986('0x5')](_0x0986('0xe'));var _0xc51808=moment()[_0x0986('0xf')]();var _0x238a90=_0x5844a6(_0xc51808+_0xfa01c3+_0x565a5b);_0x5f366d['send'](JSON['stringify']({'appID':_0xfa01c3,'timestamp':_0xc51808,'appKey':_0x238a90}));var _0x2e1754=fs[_0x0986('0x10')](_0x5ea41c);_0x2e1754['on'](_0x0986('0x11'),function(_0x35d084){_0x5f366d[_0x0986('0x12')](_0x35d084);});_0x2e1754['on'](_0x0986('0x13'),function(){_0x5f366d[_0x0986('0x12')](_0x0986('0x14'));});}catch(_0x573374){logger[_0x0986('0x15')](_0x0986('0x16'),JSON[_0x0986('0x17')](_0x573374));_0x5f366d[_0x0986('0x18')]();}}function _0xdca057(_0x5040f7){try{if(_0x5040f7){var _0x3f9910=JSON[_0x0986('0x19')](_0x5040f7);switch(_0x3f9910[_0x0986('0x1a')]){case 0x0:if(_0x3f9910['result']){if(_0x3f9910[_0x0986('0x1b')][_0x0986('0x1c')]){logger[_0x0986('0x5')](_0x0986('0x1d'),JSON[_0x0986('0x17')](_0x3f9910[_0x0986('0x1b')][_0x0986('0x1e')]));_0x10a2f6=_0x3f9910[_0x0986('0x1b')][_0x0986('0x1e')][0x0][_0x0986('0x1f')];_0x82665d=_0x3f9910[_0x0986('0x1b')]['hypotheses'][0x0][_0x0986('0x20')];_0x5e5097='0';_0x132aa7=_0x0986('0x21');_0x5f366d[_0x0986('0x18')]();}}break;case 0x1:logger[_0x0986('0x5')](_0x0986('0x8'));_0x5e5097='1';_0x132aa7='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0x0986('0x22'));_0x5e5097='2';_0x132aa7='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x0986('0x23'));_0x5e5097='9';_0x132aa7=_0x0986('0x23');break;case 0xa:logger[_0x0986('0x5')](_0x0986('0x24'));_0x5e5097='10';_0x132aa7='Authentication\x20failed.';break;case 0xb:logger[_0x0986('0x5')](_0x0986('0x25'));_0x5e5097='11';_0x132aa7='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1ac899){logger[_0x0986('0x15')](_0x0986('0x26'),JSON[_0x0986('0x17')](_0x1ac899));_0x5f366d['terminate']();}}function _0x223d27(){logger['info'](_0x0986('0x27'));_0x4680aa({'transcript':_0x10a2f6,'confidence':_0x82665d,'status':_0x5e5097,'status_message':_0x132aa7});}function _0x2457a2(_0x5e09eb){logger[_0x0986('0x15')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x0986('0x28')](_0x5e09eb)){logger[_0x0986('0x15')](_['isObject'](_0x5e09eb)?JSON['stringify'](_0x5e09eb):_0x5e09eb);}}_0x5f366d['on']('open',_0x58ed54);_0x5f366d['on'](_0x0986('0x29'),_0xdca057);_0x5f366d['on'](_0x0986('0x13'),_0x223d27);_0x5f366d['on'](_0x0986('0x15'),_0x2457a2);});}; \ No newline at end of file +var _0x8319=['status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','EOS','error','Tilde\x20ASR\x20send\x20error','parse'];(function(_0x4a6301,_0x486c0f){var _0x12997a=function(_0x1bc115){while(--_0x1bc115){_0x4a6301['push'](_0x4a6301['shift']());}};_0x12997a(++_0x486c0f);}(_0x8319,0x183));var _0x9831=function(_0x1320de,_0x6ba896){_0x1320de=_0x1320de-0x0;var _0x4bfb09=_0x8319[_0x1320de];return _0x4bfb09;};'use strict';var BPromise=require(_0x9831('0x0'));var _=require(_0x9831('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9831('0x2'));var crypto=require(_0x9831('0x3'));var logger=require(_0x9831('0x4'))(_0x9831('0x5'));module[_0x9831('0x6')]=function(_0xef70b5,_0x43d7cf,_0x52f30f,_0x27dfd6){return new BPromise(function(_0x222c5a,_0x5f5994){logger[_0x9831('0x7')]('Tilde\x20URI',_0x27dfd6||_0x9831('0x8'));var _0x25e127=new WebSocket(_0x27dfd6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x57a8f6='';var _0x483e28='0';var _0x80f3ce='1';var _0x39ff28=_0x9831('0x9');function _0x2184bf(_0x96a23e){var _0x539086=crypto[_0x9831('0xa')](_0x9831('0xb'));_0x539086[_0x9831('0xc')](_0x96a23e);return _0x539086[_0x9831('0xd')](_0x9831('0xe'));}function _0x5500b2(){try{logger[_0x9831('0x7')](_0x9831('0xf'));var _0x268c12=moment()[_0x9831('0x10')]();var _0x422ae7=_0x2184bf(_0x268c12+_0x43d7cf+_0x52f30f);_0x25e127[_0x9831('0x11')](JSON[_0x9831('0x12')]({'appID':_0x43d7cf,'timestamp':_0x268c12,'appKey':_0x422ae7}));var _0x2ba190=fs['createReadStream'](_0xef70b5);_0x2ba190['on']('data',function(_0x33011e){_0x25e127[_0x9831('0x11')](_0x33011e);});_0x2ba190['on']('close',function(){_0x25e127[_0x9831('0x11')](_0x9831('0x13'));});}catch(_0x3325d6){logger[_0x9831('0x14')](_0x9831('0x15'),JSON[_0x9831('0x12')](_0x3325d6));_0x25e127['terminate']();}}function _0x2deaf3(_0x4651d7){try{if(_0x4651d7){var _0x1c436f=JSON[_0x9831('0x16')](_0x4651d7);switch(_0x1c436f[_0x9831('0x17')]){case 0x0:if(_0x1c436f[_0x9831('0x18')]){if(_0x1c436f['result'][_0x9831('0x19')]){logger['info'](_0x9831('0x1a'),JSON[_0x9831('0x12')](_0x1c436f[_0x9831('0x18')][_0x9831('0x1b')]));_0x57a8f6=_0x1c436f[_0x9831('0x18')][_0x9831('0x1b')][0x0][_0x9831('0x1c')];_0x483e28=_0x1c436f[_0x9831('0x18')][_0x9831('0x1b')][0x0][_0x9831('0x1d')];_0x80f3ce='0';_0x39ff28=_0x9831('0x1e');_0x25e127['terminate']();}}break;case 0x1:logger[_0x9831('0x7')](_0x9831('0x9'));_0x80f3ce='1';_0x39ff28=_0x9831('0x9');break;case 0x2:logger[_0x9831('0x7')](_0x9831('0x1f'));_0x80f3ce='2';_0x39ff28=_0x9831('0x1f');break;case 0x9:logger[_0x9831('0x7')](_0x9831('0x20'));_0x80f3ce='9';_0x39ff28=_0x9831('0x20');break;case 0xa:logger['info'](_0x9831('0x21'));_0x80f3ce='10';_0x39ff28=_0x9831('0x21');break;case 0xb:logger[_0x9831('0x7')](_0x9831('0x22'));_0x80f3ce='11';_0x39ff28='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x28095b){logger[_0x9831('0x14')](_0x9831('0x23'),JSON[_0x9831('0x12')](_0x28095b));_0x25e127[_0x9831('0x24')]();}}function _0x2aa0f9(){logger[_0x9831('0x7')](_0x9831('0x25'));_0x222c5a({'transcript':_0x57a8f6,'confidence':_0x483e28,'status':_0x80f3ce,'status_message':_0x39ff28});}function _0x552354(_0x2384d1){logger[_0x9831('0x14')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x9831('0x26')](_0x2384d1)){logger[_0x9831('0x14')](_[_0x9831('0x27')](_0x2384d1)?JSON[_0x9831('0x12')](_0x2384d1):_0x2384d1);}}_0x25e127['on'](_0x9831('0x28'),_0x5500b2);_0x25e127['on']('message',_0x2deaf3);_0x25e127['on']('close',_0x2aa0f9);_0x25e127['on'](_0x9831('0x14'),_0x552354);});}; \ 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 10cb4be..018cf56 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0xc631=['exports','./asr'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0xc631,0x1e1));var _0x1c63=function(_0x1f08f0,_0x51f178){_0x1f08f0=_0x1f08f0-0x0;var _0x87b2e=_0xc631[_0x1f08f0];return _0x87b2e;};var asr=require(_0x1c63('0x0'));module[_0x1c63('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 1387840..7bbe47a 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(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x6e2d32,_0x1f783e){var _0x4409cd=function(_0x5b5c58){while(--_0x5b5c58){_0x6e2d32['push'](_0x6e2d32['shift']());}};_0x4409cd(++_0x1f783e);}(_0x34e8,0x12c));var _0x834e=function(_0x4deff8,_0x166001){_0x4deff8=_0x4deff8-0x0;var _0x2637ac=_0x34e8[_0x4deff8];return _0x2637ac;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index ede2fe0..82b3ccf 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 _0xbefe=['number','includes','POST','PUT','method','toUpperCase','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','parse','stringify','body','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','ispeechTTS','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','agicommand','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','no\x20grammar\x20configured','grammar','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','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','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','SIP/%s','DIAL','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','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','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','variable_id','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','QUEUE','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','callback','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','error','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MP3','googleTTS','google_tts_language','restAPI','url','timeout'];(function(_0x200a68,_0x4045f1){var _0x447c5b=function(_0x3223f8){while(--_0x3223f8){_0x200a68['push'](_0x200a68['shift']());}};_0x447c5b(++_0x4045f1);}(_0xbefe,0x168));var _0xebef=function(_0xd436c4,_0x298c0b){_0xd436c4=_0xd436c4-0x0;var _0x506952=_0xbefe[_0xd436c4];return _0x506952;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xebef('0x0'));var sh=require('shelljs');var odbc=require(_0xebef('0x1'))();var rs=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var Mustache=require(_0xebef('0x4'));var rp=require(_0xebef('0x5'));var logger=require(_0xebef('0x6'))(_0xebef('0x7'));var config=require(_0xebef('0x8'));var shared=require('../../config/environment/shared');var scripts=require(_0xebef('0x9'));var FILES_PATH=_0xebef('0xa');var recursiveMapAttributes=[_0xebef('0xb'),'rawBody'];var verticesWithRetry=[_0xebef('0xc'),_0xebef('0xd'),'getsecretdigits'];var AGIVertices=function(_0x4d28bb,_0x28bce0,_0xa0a8ef){this[_0xebef('0xe')]=_0x4d28bb;this[_0xebef('0xf')]=_0x28bce0;this[_0xebef('0x10')]=_0xa0a8ef;};AGIVertices[_0xebef('0x11')][_0xebef('0x12')]=function(_0x160f32,_0x56dcce){this[_0xebef('0xf')][_0xebef('0x13')](_0x160f32)[_0xebef('0x14')](function(_0x3c79e0){_0x56dcce(null,_0x3c79e0?_0x3c79e0[_0xebef('0x15')]:![]);})['catch'](function(_0x584ac2){_0x56dcce(_0x584ac2);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x55f53d,_0x124634){this[_0xebef('0xf')][_0xebef('0x16')](_0x55f53d)[_0xebef('0x14')](function(_0x1c0f0a){_0x124634(null,_0x1c0f0a?_0x1c0f0a['name']:![]);})[_0xebef('0x17')](function(_0x9411d4){_0x124634(_0x9411d4);});};AGIVertices[_0xebef('0x11')][_0xebef('0x18')]=function(_0x345115,_0x8e7044){this[_0xebef('0xf')][_0xebef('0x19')](_0x345115)[_0xebef('0x14')](function(_0x16856f){_0x8e7044(null,_0x16856f?_0x16856f[_0xebef('0x15')]:![]);})['catch'](function(_0x1a99ba){_0x8e7044(_0x1a99ba);});};AGIVertices[_0xebef('0x11')][_0xebef('0x1a')]=function(_0x502c1e,_0xc3518f){this[_0xebef('0xf')][_0xebef('0x1b')](_0x502c1e)[_0xebef('0x14')](function(_0x7ca0cc){_0xc3518f(null,_0x7ca0cc?_0x7ca0cc[_0xebef('0x1c')]:![]);})[_0xebef('0x17')](function(_0x4cc18e){_0xc3518f(_0x4cc18e);});};AGIVertices['prototype']['getUser']=function(_0x59e078,_0x2f1193){this[_0xebef('0xf')][_0xebef('0x1d')](_0x59e078)[_0xebef('0x14')](function(_0x1ee3b){_0x2f1193(null,_0x1ee3b?_0x1ee3b[_0xebef('0x15')]:![]);})['catch'](function(_0x460104){_0x2f1193(_0x460104);});};AGIVertices[_0xebef('0x11')][_0xebef('0x1e')]=function(_0x2506eb,_0x1e5e84){this[_0xebef('0xf')][_0xebef('0x1f')](_0x2506eb)[_0xebef('0x14')](function(_0x45bb67){_0x1e5e84(null,_0x45bb67?_0x45bb67[_0xebef('0x15')]:![]);})[_0xebef('0x17')](function(_0x4fb77f){_0x1e5e84(_0x4fb77f);});};AGIVertices[_0xebef('0x11')]['getSound']=function(_0x53f851,_0x56b67e){var _0x4d93c5=this;this['rpc']['getSoundById'](_0x53f851)['then'](function(_0x5703fc){_0x56b67e(null,_0x5703fc?_0x4d93c5['getSoundPath'](_0x5703fc['save_name']):![]);})['catch'](function(_0x136ac3){_0x56b67e(_0x136ac3);});};AGIVertices['prototype'][_0xebef('0x20')]=function(_0x4a0b36,_0x3efbc4){this[_0xebef('0xf')]['getMailAccountById'](_0x4a0b36)[_0xebef('0x14')](function(_0x5aa0b3){_0x3efbc4(null,_0x5aa0b3?_0x5aa0b3:![]);})[_0xebef('0x17')](function(_0x248126){_0x3efbc4(_0x248126);});};AGIVertices[_0xebef('0x11')][_0xebef('0x21')]=function(_0x189886,_0x455f93,_0x504136){this[_0xebef('0x10')]['sendMailMessage'](_0x189886,_0x455f93)[_0xebef('0x14')](function(){_0x504136(null);})[_0xebef('0x17')](function(_0xd48fc3){_0x504136(_0xd48fc3);});};AGIVertices[_0xebef('0x11')][_0xebef('0x22')]=function(_0x2871df,_0x329ffd){this['rpc'][_0xebef('0x23')](_0x2871df)[_0xebef('0x14')](function(_0x42ae33){if(_0x42ae33){if(_0x42ae33[_0xebef('0x24')]){_0x329ffd(null,[_0x42ae33[_0xebef('0x25')]]);}else{_0x329ffd(null,_[_0xebef('0x26')](_0x42ae33[_0xebef('0x27')],'interval'));}}else{_0x329ffd(null,![]);}})[_0xebef('0x17')](function(_0x1a0e41){_0x329ffd(_0x1a0e41);});};AGIVertices['prototype'][_0xebef('0x28')]=function(_0x5c802f){return util[_0xebef('0x29')](_0xebef('0x2a'),FILES_PATH,_0x5c802f);};AGIVertices[_0xebef('0x11')]['getQueryOdbc']=function(_0x19dc01,_0x342092,_0x4d5a40){odbc['open'](_0x19dc01,function(_0x890f2f){if(_0x890f2f){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x890f2f);_0x4d5a40(_0x890f2f);}else{logger['info'](_0xebef('0x2b'));odbc['query'](_0x342092,function(_0x564c73,_0x2a774c){if(_0x564c73){logger[_0xebef('0x2c')](_0xebef('0x2d'),_0x342092);_0x4d5a40(_0x564c73);}else{logger['info'](_0xebef('0x2e'),_0x342092);odbc['close'](function(_0x4f803a){if(_0x4f803a){logger['error'](_0xebef('0x2f'),_0x4f803a);}_0x4d5a40(null,_0x2a774c);});}});}});};AGIVertices['prototype'][_0xebef('0x30')]=function(_0x5078ec,_0x4ff567){this[_0xebef('0xf')][_0xebef('0x31')](_0x5078ec)[_0xebef('0x14')](function(_0x297ee0){_0x4ff567(null,_0x297ee0?_0x297ee0:![]);})[_0xebef('0x17')](function(_0x312f90){_0x4ff567(_0x312f90);});};AGIVertices['prototype'][_0xebef('0x32')]=function(_0x197e2b,_0x1416f0){this[_0xebef('0xf')][_0xebef('0x32')](_0x197e2b)[_0xebef('0x14')](function(_0x3c033d){_0x1416f0(null,_0x3c033d);})[_0xebef('0x17')](function(_0xf4b159){_0x1416f0(_0xf4b159);});};AGIVertices[_0xebef('0x11')]['createSquareDetailsReport']=function(_0x5cf908,_0x4e3f60,_0x4e77f8){this[_0xebef('0xf')][_0xebef('0x33')]({'uniqueid':this[_0xebef('0xe')][_0xebef('0x34')],'node':_0x5cf908[_0xebef('0x35')],'application':_0x5cf908['agicommand'],'data':_0x4e3f60||null,'project_name':this['channel'][_0xebef('0x36')],'callerid':this['channel']['callerid']})[_0xebef('0x14')](function(_0x14890a){if(_0x4e77f8){_0x4e77f8(null,_0x14890a);}})[_0xebef('0x17')](function(_0x20423a){if(_0x4e77f8){_0x4e77f8(_0x20423a);}});};AGIVertices[_0xebef('0x11')][_0xebef('0x37')]=function(_0x425629,_0x34aee3,_0x3c11ab,_0x1dabb6){this[_0xebef('0xf')][_0xebef('0x37')]({'uniqueid':this[_0xebef('0xe')]['uniqueid'],'callerid':this[_0xebef('0xe')][_0xebef('0x38')],'calleridname':this[_0xebef('0xe')][_0xebef('0x39')],'context':this[_0xebef('0xe')][_0xebef('0x3a')],'extension':this['channel'][_0xebef('0x3b')],'priority':this[_0xebef('0xe')][_0xebef('0x3c')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xebef('0xe')]['dnid'],'projectName':this[_0xebef('0xe')][_0xebef('0x36')],'saveName':_0x34aee3,'filename':_0x425629[_0xebef('0x3d')]||_0x34aee3,'savePath':_0x3c11ab})[_0xebef('0x14')](function(_0x297550){_0x1dabb6(null,_0x297550);})[_0xebef('0x17')](function(_0x30972b){_0x1dabb6(_0x30972b);});};AGIVertices['prototype'][_0xebef('0x3e')]=function(_0x5884e4,_0x393b46,_0x212592,_0x9366d3,_0x31704c){this['rpc'][_0xebef('0x3e')]({'uniqueid':this['channel']['uniqueid'],'body':_0x5884e4,'direction':_0x393b46,'providerName':_0x212592,'providerResponse':_0x9366d3})[_0xebef('0x14')](function(_0x1f1301){if(_0x31704c){_0x31704c(null,_0x1f1301);}})[_0xebef('0x17')](function(_0x2cb550){if(_0x31704c){_0x31704c(_0x2cb550);}});};AGIVertices[_0xebef('0x11')][_0xebef('0x3f')]=function(_0x2b7c09,_0x35a755){this[_0xebef('0xf')][_0xebef('0x3f')]({'firstName':_[_0xebef('0x40')](_0x2b7c09[_0xebef('0x15')])||_[_0xebef('0x41')](_0x2b7c09[_0xebef('0x15')])?_0xebef('0x42')+Math[_0xebef('0x43')]():_0x2b7c09[_0xebef('0x15')],'lastName':_[_0xebef('0x40')](_0x2b7c09[_0xebef('0x44')])||_['isNil'](_0x2b7c09['lastName'])?null:_0x2b7c09['lastName'],'phone':_0x2b7c09[_0xebef('0x45')],'ListId':_0x2b7c09['list_id'],'scheduledat':_0x2b7c09['scheduledAt'],'callbackUniqueid':this[_0xebef('0xe')][_0xebef('0x34')],'tags':_0xebef('0x46'),'description':'Callback\x20scheduled\x20at\x20'+_0x2b7c09[_0xebef('0x47')][_0xebef('0x48')](),'priority':_0x2b7c09[_0xebef('0x49')]})[_0xebef('0x14')](function(_0x2421a5){_0x35a755(null,_0x2421a5);})[_0xebef('0x17')](function(_0x5aae65){_0x35a755(_0x5aae65);});};AGIVertices[_0xebef('0x11')][_0xebef('0x4a')]=function(_0x4a9ae8,_0x508524){this['rpc'][_0xebef('0x4b')](_0x4a9ae8)[_0xebef('0x14')](function(_0x3fb41f){_0x508524(null,_0x3fb41f?_0x3fb41f[_0xebef('0x15')]:![]);})[_0xebef('0x17')](function(_0xee7436){_0x508524(_0xee7436);});};AGIVertices['prototype'][_0xebef('0x4c')]=function(_0xdcc10,_0x233f9f,_0x5e1c94){var _0x4225ac={'role':'agent'};_0x4225ac[_0xdcc10]=this['channel'][_0xebef('0x38')];this[_0xebef('0xf')][_0xebef('0x4c')](_0x4225ac,_0x233f9f,this[_0xebef('0xe')][_0xebef('0x34')])[_0xebef('0x14')](function(_0xaa08e1){_0x5e1c94(null,_['isNil'](_0xaa08e1)?![]:!![]);})[_0xebef('0x17')](function(_0x32321a){logger[_0xebef('0x4d')](_0x32321a);_0x5e1c94(null,![]);});};AGIVertices[_0xebef('0x11')]['agentUnpause']=function(_0x13aab2,_0x2ae5be){var _0x10e688={'role':_0xebef('0x4e')};_0x10e688[_0x13aab2]=this['channel'][_0xebef('0x38')];this['rpc'][_0xebef('0x4f')](_0x10e688)['then'](function(_0x3ffc80){_0x2ae5be(null,_[_0xebef('0x41')](_0x3ffc80)?![]:!![]);})[_0xebef('0x17')](function(_0x511d19){logger[_0xebef('0x4d')](_0x511d19);_0x2ae5be(null,![]);});};AGIVertices['prototype'][_0xebef('0x50')]=function(_0x3ab64b,_0xb117cf){var _0x40ee9d={'role':_0xebef('0x4e')};_0x40ee9d[_0x3ab64b]=this['channel'][_0xebef('0x38')];this[_0xebef('0xf')][_0xebef('0x50')](_0x40ee9d)['then'](function(_0x54e62a){_0xb117cf(null,_[_0xebef('0x41')](_0x54e62a)?![]:!![]);})[_0xebef('0x17')](function(_0x1f0071){logger[_0xebef('0x4d')](_0x1f0071);_0xb117cf(null,![]);});};AGIVertices[_0xebef('0x11')][_0xebef('0x51')]=function(_0x201caa,_0x2b767d){var _0x4aec10={'role':_0xebef('0x4e')};_0x4aec10[_0x201caa]=this[_0xebef('0xe')][_0xebef('0x38')];var _0xc5659e=_0x201caa!=_0xebef('0x52')?util['format']('%s/%s@from-sip/n',_0xebef('0x53'),this[_0xebef('0xe')][_0xebef('0x38')]):undefined;this['rpc'][_0xebef('0x51')](_0x4aec10,_0xc5659e)[_0xebef('0x14')](function(_0x43bd54){_0x2b767d(null,_[_0xebef('0x41')](_0x43bd54)?![]:!![]);})['catch'](function(_0x5262f2){logger[_0xebef('0x4d')](_0x5262f2);_0x2b767d(null,![]);});};AGIVertices[_0xebef('0x11')][_0xebef('0x54')]=function(_0x41958a,_0x109a21){sh[_0xebef('0x55')](_[_0xebef('0x56')](_0x41958a),function(_0x16d581,_0x36ea88){var _0x426f73=_0x36ea88['replace'](/(\r\n|\n|\r)/gm,'');_0x109a21(null,_0x426f73);});};AGIVertices[_0xebef('0x11')][_0xebef('0x57')]=function(_0x1f7bc4,_0x3777af){scripts[_0xebef('0x57')](_0x1f7bc4[_0xebef('0x58')],_0x1f7bc4['google_cloud_tts_text_type']||_0xebef('0x59'),_0x1f7bc4[_0xebef('0x59')],_0x1f7bc4[_0xebef('0x5a')]||'en-US',_0x1f7bc4[_0xebef('0x5b')]||'MALE',_0x1f7bc4['audioEncoding']||_0xebef('0x5c'))['then'](function(_0x22e168){_0x3777af(null,_0x22e168);})['catch'](function(_0x159281){_0x3777af(_0x159281);});};AGIVertices[_0xebef('0x11')][_0xebef('0x5d')]=function(_0x225aa1,_0x3a559f){scripts[_0xebef('0x5d')](_0x225aa1[_0xebef('0x59')],_0x225aa1[_0xebef('0x5e')]||'en',0x1)[_0xebef('0x14')](function(_0x2463f9){_0x3a559f(null,_0x2463f9);})[_0xebef('0x17')](function(_0x5960be){_0x3a559f(_0x5960be);});};AGIVertices[_0xebef('0x11')][_0xebef('0x5f')]=function(_0x44fc80,_0x430bff){var _0x575591={'uri':_0x44fc80[_0xebef('0x60')],'method':_0x44fc80['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x44fc80[_0xebef('0x61')])===_0xebef('0x62')&&parseInt(_0x44fc80[_0xebef('0x61')])>=0x1?parseInt(_0x44fc80[_0xebef('0x61')])*0x3e8:0x5*0x3e8};if(_[_0xebef('0x63')]([_0xebef('0x64'),_0xebef('0x65')],_0x575591[_0xebef('0x66')][_0xebef('0x67')]())){try{_0x575591['body']=_0x44fc80[_0xebef('0x68')]?JSON['parse'](_0x44fc80[_0xebef('0x68')]):{};}catch(_0x547405){logger[_0xebef('0x4d')](_0xebef('0x69'),_0x547405);}}try{_0x575591['headers']=_0x44fc80[_0xebef('0xb')]?JSON['parse'](_0x44fc80[_0xebef('0xb')]):{};}catch(_0x724b78){logger['error'](_0xebef('0x6a'),_0x724b78);}if(_0x44fc80['computedVariables']){try{var _0x52ee4c=require(_0x44fc80[_0xebef('0x6b')])[_0xebef('0x6c')](this,_0x575591);_0x575591[_0xebef('0x6d')]=Mustache[_0xebef('0x6e')](_0x44fc80[_0xebef('0x60')],_0x52ee4c,{},['$$','$$']);if(_0x575591[_0xebef('0x6f')]){_0x575591[_0xebef('0x6f')]=JSON[_0xebef('0x70')](Mustache[_0xebef('0x6e')](JSON[_0xebef('0x71')](_0x575591['headers']),_0x52ee4c,{},['$$','$$']));}if(_0x575591['body']){_0x575591[_0xebef('0x72')]=JSON[_0xebef('0x70')](Mustache[_0xebef('0x6e')](JSON[_0xebef('0x71')](_0x575591[_0xebef('0x72')]),_0x52ee4c,{},['$$','$$']));}}catch(_0x399b73){logger[_0xebef('0x4d')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x399b73);}}rp(_0x575591)['then'](function(_0x5ac17f){var _0x23dd07={'statusCode':_0x5ac17f[_0xebef('0x73')]||0xc8,'statusMessage':_0x5ac17f[_0xebef('0x74')]||'OK','headers':_0x5ac17f['headers']||{},'body':_0x5ac17f[_0xebef('0x72')]||{}};_0x430bff(null,_0x23dd07);})[_0xebef('0x17')](function(_0x2549b6){var _0x21adf0={'statusCode':_0x2549b6['statusCode']||0x1f4,'statusMessage':_0x2549b6[_0xebef('0x75')]||_0xebef('0x76'),'headers':_0x2549b6['options'][_0xebef('0x6f')]||{},'body':_0x2549b6[_0xebef('0x77')][_0xebef('0x72')]||{}};_0x430bff(null,_0x21adf0);});};AGIVertices[_0xebef('0x11')][_0xebef('0x78')]=function(_0x398dd9,_0x640a26){scripts[_0xebef('0x78')](this[_0xebef('0xe')][_0xebef('0x34')],_0x398dd9[_0xebef('0x79')],_0x398dd9[_0xebef('0x59')],_0x398dd9['dialogflow_language']||'en')[_0xebef('0x14')](function(_0x1430df){_0x640a26(null,_0x1430df);})[_0xebef('0x17')](function(_0x18b278){_0x640a26(_0x18b278);});};AGIVertices[_0xebef('0x11')]['googleDialogflowV2']=function(_0x34fa97,_0x1b8559){scripts[_0xebef('0x7a')](this[_0xebef('0xe')][_0xebef('0x34')],_0x34fa97[_0xebef('0x7b')],_0x34fa97[_0xebef('0x7c')],_0x34fa97[_0xebef('0x7d')],_0x34fa97[_0xebef('0x59')],_0x34fa97['dialogflowV2_language']||'en')[_0xebef('0x14')](function(_0x275b97){_0x1b8559(null,_0x275b97);})[_0xebef('0x17')](function(_0x5af6d3){_0x1b8559(_0x5af6d3);});};AGIVertices[_0xebef('0x11')]['sestekNDA']=function(_0x4564bd,_0x5c71ad){scripts['sestekNDA'](this[_0xebef('0xe')],_0x4564bd)[_0xebef('0x14')](function(_0x32c89b){_0x5c71ad(null,_0x32c89b);})[_0xebef('0x17')](function(_0x5e27ad){_0x5c71ad(_0x5e27ad);});};AGIVertices['prototype'][_0xebef('0x7e')]=function(_0xb4660d,_0x4207b6){scripts[_0xebef('0x7e')](_0xb4660d[_0xebef('0x79')],_0xb4660d[_0xebef('0x59')],_0xb4660d['ispeech_tts_language']||'en-US',_0xb4660d[_0xebef('0x7f')])[_0xebef('0x14')](function(_0x4b33de){_0x4207b6(null,_0x4b33de);})[_0xebef('0x17')](function(_0x56e61f){_0x4207b6(_0x56e61f);});};AGIVertices[_0xebef('0x11')]['ispeechASR']=function(_0x2d5bed,_0x42b281,_0x22aea4){scripts[_0xebef('0x80')](_0x42b281,_0x2d5bed[_0xebef('0x79')],_0x2d5bed[_0xebef('0x81')]||_0xebef('0x82'),this[_0xebef('0x83')](_0x2d5bed['model'])?_0x2d5bed[_0xebef('0x84')]:undefined)[_0xebef('0x14')](function(_0x17a798){_0x22aea4(null,_0x17a798);})['catch'](function(_0x56b3f3){_0x22aea4(_0x56b3f3);});};AGIVertices[_0xebef('0x11')][_0xebef('0x85')]=function(_0x2708a8,_0x77d787){scripts[_0xebef('0x85')](_0x2708a8['aws_access_key_id'],_0x2708a8['aws_secret_access_key'],_0x2708a8['aws_polly_region'],_0x2708a8[_0xebef('0x86')]||_0xebef('0x87'),_0x2708a8['text'],_0x2708a8[_0xebef('0x88')]||'text')[_0xebef('0x14')](function(_0x55b162){_0x77d787(null,_0x55b162);})[_0xebef('0x17')](function(_0x46bcf7){_0x77d787(_0x46bcf7);});};AGIVertices[_0xebef('0x11')][_0xebef('0x89')]=function(_0x4d6914,_0x337b90){scripts['awsLex'](this[_0xebef('0xe')][_0xebef('0x34')],_0x4d6914['aws_access_key_id'],_0x4d6914[_0xebef('0x8a')],_0x4d6914[_0xebef('0x8b')],_0x4d6914[_0xebef('0x59')],_0x4d6914[_0xebef('0x8c')])[_0xebef('0x14')](function(_0x13da62){_0x337b90(null,_0x13da62);})[_0xebef('0x17')](function(_0xab8b38){_0x337b90(_0xab8b38);});};AGIVertices['prototype'][_0xebef('0x8d')]=function(_0x569d8d,_0x2d0215,_0x4e179d){scripts[_0xebef('0x8d')](_0x2d0215,_0x569d8d[_0xebef('0x79')],_0x569d8d[_0xebef('0x8e')]||_0xebef('0x82'))[_0xebef('0x14')](function(_0x4d1c96){_0x4e179d(null,_0x4d1c96);})['catch'](function(_0x2f808a){_0x4e179d(_0x2f808a);});};AGIVertices['prototype'][_0xebef('0x8f')]=function(_0x3a60ee,_0x58925e,_0x19937c){scripts[_0xebef('0x8f')](_0x58925e,_0x3a60ee['appid'],_0x3a60ee[_0xebef('0x90')],_0x3a60ee[_0xebef('0x6d')])[_0xebef('0x14')](function(_0x2f1835){_0x19937c(null,_0x2f1835);})[_0xebef('0x17')](function(_0x223828){_0x19937c(_0x223828);});};AGIVertices[_0xebef('0x11')]['clear']=function(_0x31a06b){var _0x49f9d9=_['includes'](verticesWithRetry,_0x31a06b[_0xebef('0x91')])?_0x31a06b:_[_0xebef('0x92')](_0x31a06b);for(var _0x53bd32 in _0x49f9d9){if(_0x49f9d9['hasOwnProperty'](_0x53bd32)){if(_0x49f9d9[_0x53bd32]&&_[_0xebef('0x93')](_0x49f9d9[_0x53bd32])){if(_['includes'](recursiveMapAttributes,_0x53bd32)){_0x49f9d9[_0x53bd32]=this[_0xebef('0x94')](_0x49f9d9[_0x53bd32]);}else{_0x49f9d9[_0x53bd32]=this[_0xebef('0x95')](_0x49f9d9[_0x53bd32]);}}}}return _0x49f9d9;};AGIVertices['prototype'][_0xebef('0x96')]=function(_0x1fc9c8){for(var _0x49719b in _0x1fc9c8){if(_0x1fc9c8[_0xebef('0x97')](_0x49719b)){if(_[_0xebef('0x98')](_0x1fc9c8[_0x49719b])){this[_0xebef('0x96')](_0x1fc9c8[_0x49719b]);}else if(_[_0xebef('0x99')](_0x1fc9c8[_0x49719b])){for(var _0xab28eb=0x0;_0xab28eb<_0x1fc9c8[_0x49719b][_0xebef('0x9a')];_0xab28eb++){this[_0xebef('0x96')](_0x1fc9c8[_0x49719b][_0xab28eb]);}}else if(_[_0xebef('0x93')](_0x1fc9c8[_0x49719b])){_0x1fc9c8[_0x49719b]=this[_0xebef('0x95')](_0x1fc9c8[_0x49719b]);}}}};AGIVertices['prototype'][_0xebef('0x9b')]=function(_0x521e62,_0x16d310){for(var _0x2be04c in _0x521e62){if(_0x521e62['hasOwnProperty'](_0x2be04c)){if(_[_0xebef('0x98')](_0x521e62[_0x2be04c])){if(!_[_0xebef('0x40')](_0x521e62[_0x2be04c])){this['saveRestApiResult'](_0x521e62[_0x2be04c],util['format'](_0xebef('0x9c'),_0x16d310,_0x2be04c));}}else if(_[_0xebef('0x99')](_0x521e62[_0x2be04c])){for(var _0x5ba198=0x0;_0x5ba198<_0x521e62[_0x2be04c]['length'];_0x5ba198++){this[_0xebef('0x9b')](_0x521e62[_0x2be04c][_0x5ba198],util[_0xebef('0x29')](_0xebef('0x9c'),_0x16d310,_0x2be04c+'['+_0x5ba198+']'));}}else{if(!_[_0xebef('0x41')](_0x521e62[_0x2be04c])){this[_0xebef('0xe')]['setVariable'](util[_0xebef('0x29')](_0xebef('0x9c'),_0x16d310,_0x2be04c),_0x521e62[_0x2be04c]);}}}}};AGIVertices[_0xebef('0x11')][_0xebef('0x94')]=function(_0xc550ee){try{var _0x27913b=JSON['parse'](_0xc550ee);this[_0xebef('0x96')](_0x27913b);return JSON[_0xebef('0x71')](_0x27913b);}catch(_0x331d91){return this[_0xebef('0x95')](_0xc550ee);}};AGIVertices[_0xebef('0x11')][_0xebef('0x95')]=function(_0x1898a8){var _0x7187ec=_0x1898a8[_0xebef('0x9d')]('{');for(var _0x1e108d=0x1;_0x1e108d<_0x7187ec['length'];_0x1e108d+=0x1){var _0x5a97ad=_0x7187ec[_0x1e108d][_0xebef('0x9d')]('}');if(_0x5a97ad[_0xebef('0x9a')]>0x1){_0x1898a8=_0x1898a8[_0xebef('0x9e')]('{'+_0x5a97ad[0x0]+'}',this[_0xebef('0xe')][_0xebef('0x12')](_0x5a97ad[0x0])['extra']||_0x5a97ad[0x0]);}}if(_0x7187ec[_0xebef('0x9a')]===0x1){return _0x1898a8[_0xebef('0x48')]();}return this[_0xebef('0x95')](_0x1898a8);};AGIVertices[_0xebef('0x11')]['getAndSetVariable']=function(_0x16a981,_0x2e7c4b){var _0x63959f=this[_0xebef('0xe')][_0xebef('0x12')](_0x16a981);if(_0x63959f[_0xebef('0x9f')]===-0x1){return _0x63959f;}logger['info'](util[_0xebef('0x29')](_0xebef('0xa0'),_0x2e7c4b,_0x63959f[_0xebef('0xa1')]));return this[_0xebef('0xe')][_0xebef('0xa2')](_0x2e7c4b,_0x63959f['extra']);};AGIVertices[_0xebef('0x11')]['isConfigured']=function(_0x5b4401){return _0x5b4401&&_0x5b4401!=='0'&&_0x5b4401!=='-1'&&_0x5b4401!=='';};AGIVertices[_0xebef('0x11')][_0xebef('0xa3')]=function(_0x1fa0bc){this['createSquareDetailsReport'][_0xebef('0x6c')](this,_0x1fa0bc,'-');_0x1fa0bc[_0xebef('0xa4')]=_0x1fa0bc[_0xebef('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xebef('0x11')][_0xebef('0xa5')]=function(_0xd08271){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0xa6'),_0xd08271['label']));if(!this[_0xebef('0x83')](_0xd08271[_0xebef('0x59')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xa8'));}var _0x4b7903='\x22'+_0xd08271[_0xebef('0x59')]+'\x22';if(this[_0xebef('0x83')](_0xd08271[_0xebef('0x77')])){_0x4b7903+=','+_0xd08271[_0xebef('0x77')];}var _0x34e7c0=this['channel']['exec'](_0xebef('0xa9'),_0x4b7903);if(_0x34e7c0[_0xebef('0x9f')]===-0x1){return _0x34e7c0;}return this[_0xebef('0xe')]['noop'](util['format'](_0xebef('0xaa'),_0x4b7903));};AGIVertices['prototype'][_0xebef('0xab')]=function(_0x212319){logger['info'](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x212319[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x212319['grammar'])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xac'));}var _0x4ff98f=_0x212319[_0xebef('0xad')];if(this[_0xebef('0x83')](_0x212319[_0xebef('0x77')])){_0x4ff98f+=','+_0x212319[_0xebef('0x77')];}var _0x3dff39=this['channel'][_0xebef('0x55')](_0xebef('0xae'),_0x4ff98f);if(_0x3dff39[_0xebef('0x9f')]===-0x1){return _0x3dff39;}var _0x22ece4=this[_0xebef('0xaf')](_0xebef('0xb0'),_0xebef('0xb1'));if(_0x22ece4[_0xebef('0x9f')]===-0x1){return _0x22ece4;}var _0x8e8275=this[_0xebef('0xaf')]('RECOG_INPUT()',_0xebef('0xb2'));if(_0x8e8275[_0xebef('0x9f')]===-0x1){return _0x8e8275;}var _0x4077cc=this[_0xebef('0xaf')](_0xebef('0xb3'),'MRCP_RECOG_INSTANCE');if(_0x4077cc[_0xebef('0x9f')]===-0x1){return _0x4077cc;}return this['channel'][_0xebef('0xa7')](util['format'](_0xebef('0xb4'),_0x4ff98f));};AGIVertices[_0xebef('0x11')][_0xebef('0x7')]=function(_0x5cde91){logger['info'](util[_0xebef('0x29')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x5cde91[_0xebef('0x35')]));return this['channel'][_0xebef('0x7')]([_0x5cde91['command'],_0x5cde91[_0xebef('0xb5')]]);};AGIVertices[_0xebef('0x11')][_0xebef('0xb6')]=function(_0x3d1528){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0xb7'),_0x3d1528['label']));if(this[_0xebef('0x83')](_0x3d1528[_0xebef('0x61')])){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0xb8'),_0x3d1528[_0xebef('0x61')]));var _0x4b32d4=this[_0xebef('0xe')][_0xebef('0xb9')](_0x3d1528['timeout']);if(_0x4b32d4[_0xebef('0x9f')]===-0x1){return _0x4b32d4;}}return this[_0xebef('0xe')][_0xebef('0xb6')]();};AGIVertices[_0xebef('0x11')]['callback']=function(_0x58d88b){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0xba'),_0x58d88b[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x58d88b[_0xebef('0xbb')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x58d88b,_0xebef('0xbc'));}_0x58d88b['scheduledAt']=moment();if(this[_0xebef('0x83')](_0x58d88b['delay'])){_0x58d88b['scheduledAt']=moment()[_0xebef('0xbd')](_0x58d88b[_0xebef('0xbe')],'minutes');}if(!this[_0xebef('0x83')](_0x58d88b[_0xebef('0x49')])){_0x58d88b[_0xebef('0x49')]=0x2;}this[_0xebef('0x3f')][_0xebef('0x6c')](this,_0x58d88b);return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xbf'),_0x58d88b[_0xebef('0x45')],_0x58d88b[_0xebef('0xbb')],_0x58d88b['scheduledAt']));};AGIVertices[_0xebef('0x11')][_0xebef('0xc0')]=function(_0x363dbb){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0xc1'),_0x363dbb[_0xebef('0x35')]));var _0x33b003=this['channel'][_0xebef('0x55')](_0x363dbb[_0xebef('0xc2')],_0x363dbb[_0xebef('0x77')]);if(_0x33b003[_0xebef('0x9f')]===-0x1){return _0x33b003;}return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xc3'),_0x363dbb[_0xebef('0xc2')],_0x363dbb['options']));};AGIVertices['prototype'][_0xebef('0xc4')]=function(_0x180869){logger['info'](util[_0xebef('0x29')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x180869[_0xebef('0x35')]));if(!this['isConfigured'](_0x180869[_0xebef('0x59')])){return this['channel'][_0xebef('0xa7')](_0xebef('0xa8'));}var _0x50d83a='\x22'+_0x180869[_0xebef('0x59')]+'\x22';if(this['isConfigured'](_0x180869['options'])){_0x50d83a+=','+_0x180869[_0xebef('0x77')];}var _0x288ac6=this[_0xebef('0xe')][_0xebef('0x55')]('MRCPSynth',_0x50d83a);if(_0x288ac6[_0xebef('0x9f')]===-0x1){return _0x288ac6;}return this[_0xebef('0xe')]['noop'](util[_0xebef('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x50d83a));};AGIVertices[_0xebef('0x11')]['sestektts']=function(_0x40481f){logger[_0xebef('0x2c')](util['format'](_0xebef('0xc5'),_0x40481f[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x40481f[_0xebef('0x59')])){return this[_0xebef('0xe')]['noop'](_0xebef('0xa8'));}var _0x3d71dd='\x22'+_0x40481f[_0xebef('0x59')]+'\x22';if(this[_0xebef('0x83')](_0x40481f[_0xebef('0x77')])){_0x3d71dd+=','+_0x40481f['options'];}var _0x5645b9=this[_0xebef('0xe')]['exec']('MRCPSynth',_0x3d71dd);if(_0x5645b9[_0xebef('0x9f')]===-0x1){return _0x5645b9;}return this['channel'][_0xebef('0xa7')](util['format'](_0xebef('0xaa'),_0x3d71dd));};AGIVertices[_0xebef('0x11')][_0xebef('0xc6')]=function(_0x54a174){logger[_0xebef('0x2c')](util['format'](_0xebef('0xc7'),_0x54a174[_0xebef('0x35')]));if(!this['isConfigured'](_0x54a174['grammar'])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xac'));}var _0x474926=_0x54a174[_0xebef('0xad')];if(this['isConfigured'](_0x54a174['options'])){_0x474926+=','+_0x54a174['options'];}var _0x5bcc32=this[_0xebef('0xe')][_0xebef('0x55')](_0xebef('0xae'),_0x474926);if(_0x5bcc32[_0xebef('0x9f')]===-0x1){return _0x5bcc32;}var _0x5efe23=this[_0xebef('0xaf')](_0xebef('0xb0'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5efe23[_0xebef('0x9f')]===-0x1){return _0x5efe23;}var _0x2e5be7=this[_0xebef('0xaf')](_0xebef('0xc8'),_0xebef('0xc9'));if(_0x2e5be7['result']===-0x1){return _0x2e5be7;}var _0x255532=this['getAndSetVariable'](_0xebef('0xb3'),_0xebef('0xca'));if(_0x255532['result']===-0x1){return _0x255532;}return this['channel'][_0xebef('0xa7')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x474926));};AGIVertices[_0xebef('0x11')][_0xebef('0xcb')]=function(_0x560d7f){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0xcc'),_0x560d7f[_0xebef('0x35')]));if(!this['isConfigured'](_0x560d7f['grammar'])){return this['channel'][_0xebef('0xa7')](_0xebef('0xac'));}var _0x212337=_0x560d7f[_0xebef('0xad')];if(this[_0xebef('0x83')](_0x560d7f[_0xebef('0x77')])){_0x212337+=','+_0x560d7f[_0xebef('0x77')];}var _0x4e9afc=this[_0xebef('0xe')][_0xebef('0x55')](_0xebef('0xae'),_0x212337);if(_0x4e9afc[_0xebef('0x9f')]===-0x1){return _0x4e9afc;}var _0x366fc4=this[_0xebef('0xaf')]('RECOG_CONFIDENCE()',_0xebef('0xcd'));if(_0x366fc4[_0xebef('0x9f')]===-0x1){return _0x366fc4;}var _0x2e21df=this[_0xebef('0xaf')](_0xebef('0xc8'),'SESTEK_ASR_TRANSCRIPT');if(_0x2e21df[_0xebef('0x9f')]===-0x1){return _0x2e21df;}var _0x4535a0=this[_0xebef('0xaf')](_0xebef('0xb3'),_0xebef('0xce'));if(_0x4535a0[_0xebef('0x9f')]===-0x1){return _0x4535a0;}return this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xb4'),_0x212337));};AGIVertices[_0xebef('0x11')][_0xebef('0xcf')]=function(_0x364ed9){logger['info'](util[_0xebef('0x29')](_0xebef('0xd0'),_0x364ed9[_0xebef('0x35')]));if(!this['isConfigured'](_0x364ed9['odbc_id'])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x364ed9,'no\x20database\x20selected');}var _0x58cc8d=this['getSquareOdbc']['sync'](this,_0x364ed9[_0xebef('0xd1')]);if(!_0x58cc8d){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x364ed9,_0xebef('0xd2'));}if(!this[_0xebef('0x83')](_0x364ed9['query'])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x364ed9,'no\x20query\x20configured');}var _0x1b00bd=_0x364ed9[_0xebef('0xd3')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xd4'),_0x1b00bd));var _0x3e9802=this[_0xebef('0xd5')][_0xebef('0x6c')](this,_0x58cc8d,_0x1b00bd);this[_0xebef('0x33')][_0xebef('0x6c')](this,_0x364ed9,_0x1b00bd);if(!this['isConfigured'](_0x364ed9['variable_id'])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xd6'));}var _0x26ee03=this['getVariable'][_0xebef('0x6c')](this,_0x364ed9['variable_id']);if(!_0x26ee03){return this['channel'][_0xebef('0x4d')](_0x364ed9,_0xebef('0xd7'));}var _0x274efc=this;_0x3e9802[_0xebef('0xd8')](function(_0x15e3d2,_0x20ad34){Object['keys'](_0x15e3d2)['forEach'](function(_0x4bdf5d){_0x274efc['channel'][_0xebef('0xa2')](util['format']('%s[%s][%s]',_0x26ee03,_0x20ad34,_0x4bdf5d),_0x15e3d2[_0x4bdf5d]);});});this[_0xebef('0xe')]['setVariable'](util['format'](_0xebef('0xd9'),_0x26ee03),_0x3e9802['length']);return this[_0xebef('0xe')]['noop'](util['format'](_0xebef('0xda'),_0x26ee03));};AGIVertices[_0xebef('0x11')][_0xebef('0xdb')]=function(_0x2b2e83){logger[_0xebef('0xdc')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2b2e83['label']));if(!this[_0xebef('0x83')](_0x2b2e83[_0xebef('0xdd')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x2b2e83,_0xebef('0xde'));}var _0x57eed2=this[_0xebef('0xdf')][_0xebef('0x6c')](this,_0x2b2e83[_0xebef('0xdd')]);if(!_0x57eed2){return this['channel'][_0xebef('0x4d')](_0x2b2e83,_0xebef('0xe0'));}var _0x2193ae=this[_0xebef('0xe')][_0xebef('0x55')]('DIAL',[util['format'](_0xebef('0xe1'),_0x57eed2),_0x2b2e83[_0xebef('0x61')],_0x2b2e83['opts'],_0x2b2e83[_0xebef('0x60')]]);if(_0x2193ae[_0xebef('0x9f')]===-0x1){return _0x2193ae;}return this['channel'][_0xebef('0xa7')](util['format']('Executed\x20command\x20%s',_0xebef('0xe2')));};AGIVertices[_0xebef('0x11')][_0xebef('0xe3')]=function(_0x3d36bd){logger['info'](util[_0xebef('0x29')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x3d36bd['label']));if(!this[_0xebef('0x83')](_0x3d36bd[_0xebef('0x79')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xe4'));}if(!this[_0xebef('0x83')](_0x3d36bd[_0xebef('0x59')])){return this[_0xebef('0xe')]['noop']('no\x20text\x20configured');}this['channel'][_0xebef('0xe5')]=!![];this[_0xebef('0x33')](_0x3d36bd);this['createSquareMessage'](_0x3d36bd[_0xebef('0x59')],'in','','');this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xe6'),_0x3d36bd[_0xebef('0x59')]));var _0x4c03da=this['googleDialogflow'][_0xebef('0x6c')](this,_0x3d36bd);if(_0x4c03da){for(var _0x5241cf in _0x4c03da){if(_0x4c03da['hasOwnProperty'](_0x5241cf)){this[_0xebef('0xe')][_0xebef('0xa2')](util['format'](_0xebef('0xe7'),_0x5241cf[_0xebef('0x67')]()),_0x4c03da[_0x5241cf]);}}this['createSquareMessage'](_0x4c03da['speech'],_0xebef('0xe8'),_0xebef('0xe3'),'');return this[_0xebef('0xe')]['noop'](util['format'](_0xebef('0xe9'),_0x4c03da[_0xebef('0xea')]));}return this['channel'][_0xebef('0x4d')](_0x3d36bd,_0xebef('0xeb'));};AGIVertices['prototype'][_0xebef('0xec')]=function(_0x1d31c6){logger['info'](util[_0xebef('0x29')](_0xebef('0xed'),_0x1d31c6[_0xebef('0x35')]));if(!this['isConfigured'](_0x1d31c6['dialogflowV2_project_id'])){return this['channel'][_0xebef('0xa7')](_0xebef('0xee'));}if(!this['isConfigured'](_0x1d31c6[_0xebef('0x7c')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xef'));}if(!this[_0xebef('0x83')](_0x1d31c6[_0xebef('0x7d')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xf0'));}if(!this[_0xebef('0x83')](_0x1d31c6[_0xebef('0xf1')])){return this['channel'][_0xebef('0xa7')]('no\x20anguage\x20configured');}if(!this[_0xebef('0x83')](_0x1d31c6['text'])){return this['channel'][_0xebef('0xa7')](_0xebef('0xa8'));}this[_0xebef('0xe')][_0xebef('0xe5')]=!![];this[_0xebef('0x33')](_0x1d31c6);this[_0xebef('0x3e')](_0x1d31c6[_0xebef('0x59')],'in','','');this['channel'][_0xebef('0xa7')](util['format'](_0xebef('0xf2'),_0x1d31c6[_0xebef('0x59')]));var _0x2411b6=this['googleDialogflowV2'][_0xebef('0x6c')](this,_0x1d31c6);if(_0x2411b6){for(var _0x1782e1 in _0x2411b6){if(_0x2411b6[_0xebef('0x97')](_0x1782e1)){if(_0x1782e1!=='providerResponse'){this[_0xebef('0xe')]['setVariable'](util[_0xebef('0x29')](_0xebef('0xe7'),_0x1782e1['toUpperCase']()),_0x2411b6[_0x1782e1]);}}}this[_0xebef('0x3e')](_0x2411b6[_0xebef('0xea')],_0xebef('0xe8'),_0xebef('0xec'),_0x2411b6[_0xebef('0xf3')]);return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xf4'),_0x2411b6[_0xebef('0xea')]));}return this[_0xebef('0xe')]['error'](_0x1d31c6,_0xebef('0xf5'));};AGIVertices[_0xebef('0x11')]['sesteknda']=function(_0x4e7be7){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0xf6'),_0x4e7be7['label']));if(!this[_0xebef('0x83')](_0x4e7be7['ndauth_url'])){return this[_0xebef('0xe')][_0xebef('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xebef('0x83')](_0x4e7be7[_0xebef('0xf7')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xf8'));}if(!this['isConfigured'](_0x4e7be7['password'])){return this['channel'][_0xebef('0xa7')](_0xebef('0xf9'));}if(!this[_0xebef('0x83')](_0x4e7be7[_0xebef('0xfa')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xa8'));}this[_0xebef('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x4e7be7);this[_0xebef('0x3e')](_0x4e7be7[_0xebef('0x59')],'in','','');this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0xfb'),_0x4e7be7[_0xebef('0x59')]));var _0x469f20=this[_0xebef('0xfc')]['sync'](this,_0x4e7be7);if(_0x469f20){for(var _0x5b28f3 in _0x469f20){if(_0x469f20[_0xebef('0x97')](_0x5b28f3)){this[_0xebef('0xe')][_0xebef('0xa2')](util[_0xebef('0x29')]('SESTEK_NDA_%s',_0x5b28f3[_0xebef('0x67')]()),_0x469f20[_0x5b28f3]);}}this[_0xebef('0x3e')](_0x469f20[_0xebef('0xea')],_0xebef('0xe8'),_0xebef('0xfd'),'');if(_0x469f20[_0xebef('0xfe')]){this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0xff'),_0x469f20['audiofile']));var _0x22d5c5=this[_0xebef('0xe')][_0xebef('0x100')](_0x469f20[_0xebef('0xfe')]);try{fs[_0xebef('0x101')](_0x469f20[_0xebef('0xfe')]+_0xebef('0x102'));}catch(_0x298d50){logger['error'](_0x298d50);}return _0x22d5c5;}else{return this['channel']['noop'](util[_0xebef('0x29')](_0xebef('0x103'),_0x469f20[_0xebef('0xea')]));}}return this[_0xebef('0xe')]['error'](_0x4e7be7,_0xebef('0x104'));};AGIVertices[_0xebef('0x11')][_0xebef('0x105')]=function(_0x4c0c60){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x106'),_0x4c0c60[_0xebef('0x35')]));return this[_0xebef('0xe')][_0xebef('0xa7')]('end');};AGIVertices[_0xebef('0x11')][_0xebef('0x107')]=function(_0x450e5e){logger[_0xebef('0x2c')](util[_0xebef('0x29')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x450e5e[_0xebef('0x35')]));var _0x19ddde='';if(_0x450e5e[_0xebef('0x108')]){if(!this[_0xebef('0x83')](_0x450e5e[_0xebef('0x108')])){return this['channel'][_0xebef('0x4d')](_0x450e5e,_0xebef('0x109'));}else{var _0x225059=parseInt(_0x450e5e[_0xebef('0x108')],0xa);if(isNaN(_0x225059)){_0x19ddde=_0x450e5e[_0xebef('0x108')];}else{_0x19ddde=this[_0xebef('0x1e')][_0xebef('0x6c')](this,_0x450e5e[_0xebef('0x108')]);if(!_0x19ddde){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x450e5e,_0xebef('0x10a'));}}}}else if(_0x450e5e[_0xebef('0x10b')]){_0x19ddde=_0x450e5e[_0xebef('0x10b')];}else{return this[_0xebef('0xe')]['error'](_0x450e5e,_0xebef('0x109'));}var _0x10f905=this[_0xebef('0xe')]['exec'](_0xebef('0xe2'),[util[_0xebef('0x29')](_0xebef('0x10c'),_0x19ddde,_0x450e5e[_0xebef('0x45')]),_0x450e5e[_0xebef('0x61')],_0x450e5e[_0xebef('0x10d')],_0x450e5e[_0xebef('0x60')]]);if(_0x10f905[_0xebef('0x9f')]===-0x1){return _0x10f905;}return this['channel'][_0xebef('0xa7')](util['format'](_0xebef('0x10e'),_0xebef('0xe2')));};AGIVertices['prototype']['finally']=function(_0x267f9b){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x10f'),_0x267f9b[_0xebef('0x35')]));return this[_0xebef('0xe')][_0xebef('0xa7')]('finally');};AGIVertices['prototype'][_0xebef('0xd')]=function(_0x3b6248){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x110'),_0x3b6248['label']));if(_0x3b6248['retry']===0x0){return this['maxRetry'](_0x3b6248);}_0x3b6248[_0xebef('0xa4')]-=0x1;if(!this['isConfigured'](_0x3b6248['file_id'])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x3b6248,_0xebef('0x111'));}var _0x40aa45=this['getSound'][_0xebef('0x6c')](this,_0x3b6248[_0xebef('0x112')]);if(!_0x40aa45){return this[_0xebef('0xe')]['error'](_0x3b6248,_0xebef('0x113'));}if(!this[_0xebef('0x83')](_0x3b6248[_0xebef('0x114')])){return this['channel'][_0xebef('0x4d')](_0xebef('0xd6'));}var _0x50ddb1=this[_0xebef('0xe')][_0xebef('0x115')](_0x40aa45,_0x3b6248[_0xebef('0x116')],_0x3b6248[_0xebef('0x117')]);var _0x179c6f=_0x50ddb1[_0xebef('0x9f')]?_0x50ddb1['result']['toString']():'';logger[_0xebef('0x2c')]('test',JSON[_0xebef('0x71')](_0x50ddb1));if(_0x50ddb1[_0xebef('0x9f')]===-0x1){this[_0xebef('0x33')][_0xebef('0x6c')](this,_0x3b6248,_0x179c6f);return _0x50ddb1;}else if(_0x50ddb1['extra']==='timeout'){_0x50ddb1['result']=_0x179c6f['length']>=parseInt(_0x3b6248[_0xebef('0x118')])?'x':'i';}else{_0x50ddb1[_0xebef('0x9f')]=_0x179c6f[_0xebef('0x9a')]>=parseInt(_0x3b6248[_0xebef('0x118')])&&_0x179c6f['length']<=parseInt(_0x3b6248['maxdigit'])?'x':'i';}var _0x41616d=this['getVariable'][_0xebef('0x6c')](this,_0x3b6248['variable_id']);if(!_0x41616d){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x3b6248,_0xebef('0xd7'));}this[_0xebef('0xe')]['setVariable'](_0x41616d,_0x179c6f);if(this[_0xebef('0x83')](_0x3b6248[_0xebef('0x119')])){var _0x2f487f=parseInt(_0x3b6248[_0xebef('0x119')],0xa);var _0x236042=rs[_0xebef('0x11a')]({'charset':'*','length':_0x2f487f});var _0x337b9e=_0x179c6f['length'];if(_0x337b9e>0x0){if(_0x337b9e>_0x2f487f){this[_0xebef('0x33')]['sync'](this,_0x3b6248,_0x3b6248['hiddendigitspos']===_0xebef('0x11b')?_0x236042+_0x179c6f['substr'](_0x2f487f):_0x179c6f[_0xebef('0x11c')](0x0,_0x337b9e-_0x2f487f)+_0x236042);}else{this[_0xebef('0x33')][_0xebef('0x6c')](this,_0x3b6248,rs[_0xebef('0x11a')]({'charset':'*','length':_0x337b9e}));}}else{this[_0xebef('0x33')]['sync'](this,_0x3b6248,'');}}else{this[_0xebef('0x33')][_0xebef('0x6c')](this,_0x3b6248,_0x179c6f);}return _0x50ddb1;};AGIVertices['prototype'][_0xebef('0x11d')]=function(_0x3a23ea){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x11e'),_0x3a23ea['label']));return this[_0xebef('0xd')](_0x3a23ea);};AGIVertices[_0xebef('0x11')][_0xebef('0x11f')]=function(_0x487557){logger[_0xebef('0x2c')](util[_0xebef('0x29')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x487557[_0xebef('0x35')]));this[_0xebef('0x33')]['sync'](this,_0x487557,_0x487557['goalname']);return this['channel'][_0xebef('0xa7')](util['format'](_0xebef('0x120'),_0x487557[_0xebef('0x121')]));};AGIVertices[_0xebef('0x11')][_0xebef('0x122')]=function(_0x372684){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x123'),_0x372684[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x372684[_0xebef('0x124')])||!this['isConfigured'](_0x372684[_0xebef('0x8a')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x125'));}if(!this[_0xebef('0x83')](_0x372684[_0xebef('0x59')])){return this[_0xebef('0xe')]['noop'](_0xebef('0xa8'));}this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')]('Trying\x20aws\x20Polly\x20%s',_0x372684[_0xebef('0x59')]));var _0x34b3e7=this[_0xebef('0x85')][_0xebef('0x6c')](this,_0x372684);if(_0x34b3e7){this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x34b3e7));var _0x1838bd=this[_0xebef('0xe')]['streamFile'](_0x34b3e7);try{fs[_0xebef('0x101')](_0x34b3e7+_0xebef('0x102'));}catch(_0x2f9bc7){logger[_0xebef('0x4d')](_0x2f9bc7);}return _0x1838bd;}return this[_0xebef('0xe')][_0xebef('0x4d')](_0x372684,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xebef('0x11')]['awslex']=function(_0x3357b9){logger['info'](util[_0xebef('0x29')](_0xebef('0x126'),_0x3357b9[_0xebef('0x35')]));if(!this['isConfigured'](_0x3357b9['aws_access_key_id'])||!this[_0xebef('0x83')](_0x3357b9[_0xebef('0x8a')])){return this[_0xebef('0xe')]['noop'](_0xebef('0x125'));}if(!this[_0xebef('0x83')](_0x3357b9['aws_bot_name'])){return this['channel']['noop'](_0xebef('0x127'));}if(!this['isConfigured'](_0x3357b9[_0xebef('0x59')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xebef('0xe')][_0xebef('0xe5')]=!![];this[_0xebef('0x33')](_0x3357b9);this['createSquareMessage'](_0x3357b9[_0xebef('0x59')],'in','','');this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x128'),_0x3357b9[_0xebef('0x59')]));var _0x518504=this['awsLex'][_0xebef('0x6c')](this,_0x3357b9);if(_0x518504){for(var _0x5d3f15 in _0x518504){if(_0x518504[_0xebef('0x97')](_0x5d3f15)&&_['isString'](_0x518504[_0x5d3f15])){this['channel'][_0xebef('0xa2')](util['format']('AWS_LEX_%s',_0x5d3f15['toUpperCase']()),_0x518504[_0x5d3f15]);}}if(_['isNil'](_0x518504['message'])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x129'));}else{this[_0xebef('0x3e')](_0x518504['message'],_0xebef('0xe8'),_0xebef('0x12a'),'');return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x12b'),_0x518504[_0xebef('0x75')]));}}return this['channel']['error'](_0x3357b9,_0xebef('0x12c'));};AGIVertices[_0xebef('0x11')][_0xebef('0x12d')]=function(_0x1c2363){logger['info'](util[_0xebef('0x29')](_0xebef('0x12e'),_0x1c2363['label'],_0x1c2363[_0xebef('0x61')]));if(!this[_0xebef('0x83')](_0x1c2363[_0xebef('0x79')])){return this[_0xebef('0xe')][_0xebef('0xa7')]('no\x20key\x20configured');}var _0xe789cc=_0xebef('0x12f');var _0x2807d4=util[_0xebef('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0xebef('0x11a')](0x4));var _0x1c095a=util['format'](_0xebef('0x9c'),_0x2807d4,_0xe789cc);var _0x2ea0cb=!![];if(_0x1c2363[_0xebef('0x130')]===_0xebef('0x131')){_0x2ea0cb=![];}var _0x18c2ed=this[_0xebef('0xe')]['recordFile'](_0x2807d4,_0xe789cc,_0x1c2363[_0xebef('0x132')],_0x1c2363[_0xebef('0x61')],undefined,_0x2ea0cb);if(_0x18c2ed[_0xebef('0x9f')]!==-0x1){this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x133'),_0x1c095a));var _0x394d4a=this['googleASR'][_0xebef('0x6c')](this,_0x1c2363,_0x1c095a);if(_0x394d4a){for(var _0x4fa0ff in _0x394d4a){if(_0x394d4a[_0xebef('0x97')](_0x4fa0ff)){this[_0xebef('0xe')][_0xebef('0xa2')](util[_0xebef('0x29')](_0xebef('0x134'),_0x4fa0ff[_0xebef('0x67')]()),_0x394d4a[_0x4fa0ff]);}}return this[_0xebef('0xe')]['noop'](util[_0xebef('0x29')](_0xebef('0x135'),JSON[_0xebef('0x71')](_0x394d4a)));}}return _0x18c2ed;};AGIVertices['prototype'][_0xebef('0x136')]=function(_0x3a6ce1){logger['info'](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3a6ce1[_0xebef('0x35')]));if(!this['isConfigured'](_0x3a6ce1[_0xebef('0x137')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x138'));}if(!this['isConfigured'](_0x3a6ce1['appsecret'])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x139'));}var _0xedbbe5='wav';var _0x1a4c55=util['format'](_0xebef('0x13a'),FILES_PATH,rs[_0xebef('0x11a')](0x4));var _0xd5d3eb=util[_0xebef('0x29')](_0xebef('0x9c'),_0x1a4c55,_0xedbbe5);var _0x554314=!![];if(_0x3a6ce1['beep']===_0xebef('0x131')){_0x554314=![];}var _0x436865=this[_0xebef('0xe')][_0xebef('0x13b')](_0x1a4c55,_0xedbbe5,_0x3a6ce1[_0xebef('0x132')],_0x3a6ce1['timeout'],undefined,_0x554314);if(_0x436865[_0xebef('0x9f')]!==-0x1){this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0x13c'),_0xd5d3eb));var _0x2aa3a2=this[_0xebef('0x8f')][_0xebef('0x6c')](this,_0x3a6ce1,_0xd5d3eb);if(_0x2aa3a2){for(var _0x44b503 in _0x2aa3a2){if(_0x2aa3a2[_0xebef('0x97')](_0x44b503)){this[_0xebef('0xe')][_0xebef('0xa2')](util[_0xebef('0x29')](_0xebef('0x13d'),_0x44b503[_0xebef('0x67')]()),_0x2aa3a2[_0x44b503]);}}return this[_0xebef('0xe')][_0xebef('0xa7')](util['format']('TildeASR\x20Result\x20%s',JSON[_0xebef('0x71')](_0x2aa3a2)));}}return _0x436865;};AGIVertices[_0xebef('0x11')]['gotoc']=function(_0x3e7baa){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x13e'),_0x3e7baa[_0xebef('0x35')]));return this['channel']['continueAt'](_0x3e7baa[_0xebef('0x3a')],_0x3e7baa[_0xebef('0x3b')],_0x3e7baa['priority']);};AGIVertices[_0xebef('0x11')][_0xebef('0x13f')]=function(_0x37eeb6){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x140'),_0x37eeb6[_0xebef('0x35')]));if(!this['isConfigured'](_0x37eeb6[_0xebef('0x141')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x37eeb6,'no\x20condition\x20configured');}try{var _0x2b5b4d=eval(_0x37eeb6[_0xebef('0x141')])?'true':_0xebef('0x142');this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0x143'),_0x37eeb6[_0xebef('0x141')],_0x2b5b4d));return{'code':0xc8,'result':_0x2b5b4d};}catch(_0x548f54){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xebef('0x11')][_0xebef('0x144')]=function(_0x32e0a1){logger['info'](util[_0xebef('0x29')](_0xebef('0x145'),_0x32e0a1[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x32e0a1[_0xebef('0x146')])){return this['channel'][_0xebef('0x4d')](_0x32e0a1,_0xebef('0x147'));}var _0x4e289c=this[_0xebef('0x22')][_0xebef('0x6c')](this,_0x32e0a1[_0xebef('0x146')]);if(!_0x4e289c){return this['channel']['error'](_0x32e0a1,_0xebef('0x148'));}for(var _0x4c3937=0x0;_0x4c3937<_0x4e289c['length'];_0x4c3937+=0x1){var _0x16df92=this[_0xebef('0xe')]['getVariable'](util[_0xebef('0x29')](_0xebef('0x149'),_0x4e289c[_0x4c3937]));if(_0x16df92['result']===-0x1){return _0x16df92;}logger[_0xebef('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x4e289c[_0x4c3937],_0x16df92['extra']));if(_0x16df92[_0xebef('0xa1')]===_0xebef('0x14a')){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x14b'),_0x4e289c[_0x4c3937],'true'));this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x14b'),_0x4e289c[_0x4c3937],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xebef('0x29')](_0xebef('0x14b'),_0x4e289c[_0x4c3937],_0xebef('0x142')));this[_0xebef('0xe')][_0xebef('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x4e289c[_0x4c3937],_0xebef('0x142')));}}return{'code':0xc8,'result':_0xebef('0x142')};};AGIVertices['prototype'][_0xebef('0x14c')]=function(_0x82fd7a){logger['info'](util[_0xebef('0x29')](_0xebef('0x14d'),_0x82fd7a[_0xebef('0x35')]));return this['channel']['hangup']();};AGIVertices[_0xebef('0x11')][_0xebef('0x14e')]=function(_0x5019cc){logger[_0xebef('0x2c')](util['format'](_0xebef('0x14f'),_0x5019cc[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x5019cc[_0xebef('0x79')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xe4'));}var _0x328b80=_0xebef('0x12f');var _0x4b52c5=util[_0xebef('0x29')](_0xebef('0x13a'),FILES_PATH,rs[_0xebef('0x11a')](0x4));var _0x9cea4d=util[_0xebef('0x29')]('%s.%s',_0x4b52c5,_0x328b80);var _0x2ec684=!![];if(_0x5019cc[_0xebef('0x130')]===_0xebef('0x131')){_0x2ec684=![];}var _0xe42883=this[_0xebef('0xe')][_0xebef('0x13b')](_0x4b52c5,_0x328b80,_0x5019cc[_0xebef('0x132')],_0x5019cc[_0xebef('0x61')],undefined,_0x2ec684);if(_0xe42883[_0xebef('0x9f')]!==-0x1){this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x150'),_0x9cea4d));var _0x5ebe52=this[_0xebef('0x80')][_0xebef('0x6c')](this,_0x5019cc,_0x9cea4d);if(_0x5ebe52){for(var _0x5d4442 in _0x5ebe52){if(_0x5ebe52[_0xebef('0x97')](_0x5d4442)){this[_0xebef('0xe')]['setVariable'](util[_0xebef('0x29')](_0xebef('0x151'),_0x5d4442[_0xebef('0x67')]()),_0x5ebe52[_0x5d4442]);}}return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')]('IspeechASR\x20Result\x20%s',JSON[_0xebef('0x71')](_0x5ebe52)));}}return _0xe42883;};AGIVertices[_0xebef('0x11')]['ispeechtts']=function(_0x527c30){logger['info'](util[_0xebef('0x29')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x527c30[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x527c30[_0xebef('0x79')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xe4'));}if(!this['isConfigured'](_0x527c30[_0xebef('0x59')])){return this[_0xebef('0xe')]['noop'](_0xebef('0xa8'));}this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0x152'),_0x527c30[_0xebef('0x59')]));var _0x41465c=this[_0xebef('0x7e')][_0xebef('0x6c')](this,_0x527c30);if(_0x41465c){this['channel']['noop'](util[_0xebef('0x29')](_0xebef('0x150'),_0x41465c));var _0x813968=this['channel'][_0xebef('0x100')](_0x41465c,_0x527c30[_0xebef('0x132')]);try{fs['unlink'](_0x41465c+_0xebef('0x102'));}catch(_0x3ac889){logger[_0xebef('0x4d')](_0x3ac889);}return _0x813968;}return this[_0xebef('0xe')][_0xebef('0x4d')](_0x527c30,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xebef('0x11')][_0xebef('0x153')]=function(_0x3868c5){logger[_0xebef('0x2c')](util['format'](_0xebef('0x154'),_0x3868c5['label']));if(!this['isConfigured'](_0x3868c5[_0xebef('0x155')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x3868c5,_0xebef('0x156'));}logger[_0xebef('0x2c')](util['format'](_0xebef('0x157'),this['channel'][_0xebef('0x38')],_0x3868c5[_0xebef('0x155')]));var _0x3cda59=this[_0xebef('0x51')]['sync'](this,_0x3868c5[_0xebef('0x155')]);if(_0x3cda59){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x158'),this[_0xebef('0xe')][_0xebef('0x38')],_0x3868c5[_0xebef('0x155')]));this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x158'),this['channel'][_0xebef('0x38')],_0x3868c5['findBy']));return{'code':0xc8,'result':_0xebef('0x159')};}else{logger['info'](util['format'](_0xebef('0x15a'),this['channel'][_0xebef('0x38')],_0x3868c5[_0xebef('0x155')]));this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x15a'),this[_0xebef('0xe')][_0xebef('0x38')],_0x3868c5[_0xebef('0x155')]));return{'code':0xc8,'result':_0xebef('0x15b')};}};AGIVertices[_0xebef('0x11')][_0xebef('0x15c')]=function(_0x30c903){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x15d'),_0x30c903[_0xebef('0x35')]));if(!this['isConfigured'](_0x30c903[_0xebef('0x155')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x30c903,_0xebef('0x156'));}logger['info'](util[_0xebef('0x29')](_0xebef('0x157'),this[_0xebef('0xe')][_0xebef('0x38')],_0x30c903[_0xebef('0x155')]));var _0x3fa93e=this[_0xebef('0x50')][_0xebef('0x6c')](this,_0x30c903[_0xebef('0x155')]);if(_0x3fa93e){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x158'),this[_0xebef('0xe')]['callerid'],_0x30c903[_0xebef('0x155')]));this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x158'),this[_0xebef('0xe')][_0xebef('0x38')],_0x30c903[_0xebef('0x155')]));return{'code':0xc8,'result':_0xebef('0x159')};}else{logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x15a'),this[_0xebef('0xe')]['callerid'],_0x30c903[_0xebef('0x155')]));this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x15a'),this[_0xebef('0xe')]['callerid'],_0x30c903[_0xebef('0x155')]));return{'code':0xc8,'result':_0xebef('0x15b')};}};AGIVertices['prototype'][_0xebef('0x15e')]=function(_0x13ebc8){logger[_0xebef('0x2c')](util['format'](_0xebef('0x15f'),_0x13ebc8[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x13ebc8[_0xebef('0x160')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x13ebc8,_0xebef('0x161'));}this['channel'][_0xebef('0xa7')](util['format']('math\x20%s',_0x13ebc8[_0xebef('0x160')]));var _0x2abe0a=eval(_0x13ebc8[_0xebef('0x160')]);if(!this[_0xebef('0x83')](_0x13ebc8[_0xebef('0x114')])){return this['channel'][_0xebef('0xa7')](_0xebef('0xd6'));}var _0x3baca2=this[_0xebef('0x12')][_0xebef('0x6c')](this,_0x13ebc8[_0xebef('0x114')]);if(!_0x3baca2){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x13ebc8,'no\x20variable\x20found');}if(_[_0xebef('0x99')](_0x2abe0a)){var _0x15647a=this;_0x2abe0a[_0xebef('0xd8')](function(_0x15cc05,_0x54d2da){_0x15647a['channel'][_0xebef('0xa2')](util[_0xebef('0x29')](_0xebef('0x162'),_0x3baca2,_0x54d2da),_0x15cc05);});return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')]('variable\x20%s[key]\x20set',_0x3baca2));}else{return this[_0xebef('0xe')][_0xebef('0xa2')](_0x3baca2,_0x2abe0a);}};AGIVertices[_0xebef('0x11')]['menu']=function(_0x4971ab){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x163'),_0x4971ab[_0xebef('0x35')]));if(_0x4971ab[_0xebef('0xa4')]===0x0){return this[_0xebef('0xa3')](_0x4971ab);}_0x4971ab[_0xebef('0xa4')]-=0x1;if(!this[_0xebef('0x83')](_0x4971ab[_0xebef('0x112')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x4971ab,_0xebef('0x111'));}var _0x23dc9f=this[_0xebef('0x164')][_0xebef('0x6c')](this,_0x4971ab[_0xebef('0x112')]);if(!_0x23dc9f){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x4971ab,_0xebef('0x113'));}var _0x42716c=this[_0xebef('0xe')][_0xebef('0x115')](_0x23dc9f,_0x4971ab[_0xebef('0x116')],_0x4971ab[_0xebef('0x165')]);var _0x3ec91e=_0x42716c[_0xebef('0x9f')];if(_0x42716c[_0xebef('0x9f')]===-0x1){this['createSquareDetailsReport'][_0xebef('0x6c')](this,_0x4971ab,'-1');return _0x42716c;}else if(_0x42716c['extra']===_0xebef('0x61')){_0x42716c[_0xebef('0x9f')]=_0x42716c['result'][_0xebef('0x9a')]>0x0?_0x42716c[_0xebef('0x9f')]:'t';}else if(_[_0xebef('0x40')](_0x42716c[_0xebef('0x9f')])){_0x42716c[_0xebef('0x9f')]='#';_0x3ec91e='#';}if(!this['isConfigured'](_0x4971ab[_0xebef('0x114')])){this['channel'][_0xebef('0xa7')](_0xebef('0xd6'));}else{var _0x358bc=this[_0xebef('0x12')][_0xebef('0x6c')](this,_0x4971ab[_0xebef('0x114')]);if(!_0x358bc){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x4971ab,_0xebef('0xd7'));}this[_0xebef('0xe')][_0xebef('0xa2')](_0x358bc,_0x3ec91e);}this['createSquareDetailsReport'][_0xebef('0x6c')](this,_0x4971ab,_0x3ec91e);return _0x42716c;};AGIVertices[_0xebef('0x11')][_0xebef('0xa7')]=function(_0x6b3074){logger['info'](util['format'](_0xebef('0x166'),_0x6b3074[_0xebef('0x35')]));return this['channel']['noop'](_0x6b3074[_0xebef('0x167')]||_0x6b3074['label']);};AGIVertices[_0xebef('0x11')][_0xebef('0x168')]=function(_0x64e631){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x169'),_0x64e631[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x64e631['findBy'])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x64e631,_0xebef('0x156'));}logger[_0xebef('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xebef('0xe')][_0xebef('0x38')],_0x64e631[_0xebef('0x155')]));var _0x46c773=this[_0xebef('0x4a')][_0xebef('0x6c')](this,_0x64e631[_0xebef('0x16a')]);var _0x102f98=this[_0xebef('0x4c')][_0xebef('0x6c')](this,_0x64e631[_0xebef('0x155')],_0x46c773);if(_0x102f98){logger['info'](util['format'](_0xebef('0x158'),this['channel'][_0xebef('0x38')],_0x64e631[_0xebef('0x155')]));this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x158'),this['channel']['callerid'],_0x64e631['findBy']));return{'code':0xc8,'result':_0xebef('0x159')};}else{logger[_0xebef('0x2c')](util[_0xebef('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xebef('0xe')]['callerid'],_0x64e631[_0xebef('0x155')]));this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x158'),this[_0xebef('0xe')][_0xebef('0x38')],_0x64e631[_0xebef('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xebef('0x11')][_0xebef('0x16b')]=function(_0x520d10){logger[_0xebef('0x2c')](util[_0xebef('0x29')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x520d10[_0xebef('0x35')]));if(!this['isConfigured'](_0x520d10[_0xebef('0x112')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x520d10,_0xebef('0x111'));}var _0x32b8ce=this[_0xebef('0x164')][_0xebef('0x6c')](this,_0x520d10[_0xebef('0x112')]);if(!_0x32b8ce){return this['channel'][_0xebef('0x4d')](_0x520d10,_0xebef('0x113'));}var _0xb62f0f=this['channel'][_0xebef('0x55')](_0xebef('0x16c'),[_0x32b8ce,_0x520d10['opts']]);if(_0xb62f0f[_0xebef('0x9f')]===-0x1){return _0xb62f0f;}return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xc3'),_0xebef('0x16c'),_0x32b8ce));};AGIVertices[_0xebef('0x11')][_0xebef('0x16d')]=function(_0x2c3c77){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x16e'),_0x2c3c77['label']));if(!this[_0xebef('0x83')](_0x2c3c77[_0xebef('0x16f')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x2c3c77,_0xebef('0x170'));}var _0x403325='';var _0x3c01a8=parseInt(_0x2c3c77[_0xebef('0x16f')],0xa);if(isNaN(_0x3c01a8)){_0x403325=_0x2c3c77[_0xebef('0x16f')];}else{_0x403325=this['getVoiceQueue'][_0xebef('0x6c')](this,_0x2c3c77['queue_id']);if(!_0x403325){return this[_0xebef('0xe')]['error'](_0x2c3c77,_0xebef('0x171'));}}var _0x417c81='';if(this[_0xebef('0x83')](_0x2c3c77[_0xebef('0x112')])){var _0x496a01=this['getSound'][_0xebef('0x6c')](this,_0x2c3c77['file_id']);if(_0x496a01){_0x417c81=_0x496a01;}}this[_0xebef('0x33')][_0xebef('0x6c')](this,_0x2c3c77,_0x403325);if(_0x2c3c77[_0xebef('0x10d')][_0xebef('0x172')]('x')<0x0){_0x2c3c77[_0xebef('0x10d')]+='x';}if(_0x2c3c77[_0xebef('0x10d')][_0xebef('0x172')]('X')<0x0){_0x2c3c77[_0xebef('0x10d')]+='X';}this['channel'][_0xebef('0xa2')]('XMCS-QUEUE',_0x403325?_0x403325['toLowerCase']():'');var _0x3a1a0f=this['channel']['exec'](_0xebef('0x173'),[_0x403325,_0x2c3c77[_0xebef('0x10d')],_0x2c3c77['url'],_0x417c81,_0x2c3c77[_0xebef('0x61')],_0x2c3c77['agi'],_0x2c3c77['macro'],_0x2c3c77['gosub'],'',_0x2c3c77[_0xebef('0x174')]]);if(_0x3a1a0f[_0xebef('0x9f')]===-0x1){return _0x3a1a0f;}return this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0xc3'),_0xebef('0x173'),_0x403325));};AGIVertices[_0xebef('0x11')][_0xebef('0x175')]=function(_0x576a33){logger[_0xebef('0x2c')](util[_0xebef('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x576a33['label']));var _0x170964=_0x576a33[_0xebef('0x176')]||'wav';var _0x511eb5=util[_0xebef('0x29')](_0xebef('0x177'),this[_0xebef('0xe')][_0xebef('0x34')],rs['generate'](0x5));var _0x3ab520=util[_0xebef('0x29')](_0xebef('0x178'),FILES_PATH,_0x511eb5,_0x170964);var _0x1a4d0f=util[_0xebef('0x29')]('%s/recordings/%s',FILES_PATH,_0x511eb5);this['createSquareRecording']['sync'](this,_0x576a33,_0x511eb5,_0x3ab520);this[_0xebef('0xe')][_0xebef('0xa2')](_0xebef('0x179'),_0x511eb5);logger[_0xebef('0x2c')](_0xebef('0x17a'),_0x1a4d0f,_0x170964,_0x576a33[_0xebef('0x17b')],_0x576a33[_0xebef('0x61')]);return this['channel'][_0xebef('0x13b')](_0x1a4d0f,_0x170964,_0x576a33[_0xebef('0x17b')],_0x576a33[_0xebef('0x61')],undefined,!![]);};AGIVertices[_0xebef('0x11')][_0xebef('0x17c')]=function(_0x4cb50f){logger['info'](util['format'](_0xebef('0x17d'),_0x4cb50f[_0xebef('0x35')]));if(!this['isConfigured'](_0x4cb50f['url'])){return this['channel'][_0xebef('0xa7')](_0xebef('0x17e'));}var _0x2b4c9a=this[_0xebef('0x5f')][_0xebef('0x6c')](this,_0x4cb50f);logger[_0xebef('0x2c')](util['format'](_0xebef('0x17f'),util[_0xebef('0x180')](_0x2b4c9a,{'showHidden':![],'depth':null})));if(!this[_0xebef('0x83')](_0x4cb50f[_0xebef('0x114')])){return this[_0xebef('0xe')][_0xebef('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x2ac9fe=this['getVariable'][_0xebef('0x6c')](this,_0x4cb50f[_0xebef('0x114')]);if(!_0x2ac9fe){return this['channel'][_0xebef('0x4d')](_0x4cb50f,_0xebef('0xd7'));}this[_0xebef('0xe')][_0xebef('0xa2')](util[_0xebef('0x29')](_0xebef('0x181'),_0x2ac9fe),_0x2b4c9a[_0xebef('0x73')]?_0x2b4c9a[_0xebef('0x73')]:'200');this['channel'][_0xebef('0xa2')](util[_0xebef('0x29')](_0xebef('0x182'),_0x2ac9fe),_0x2b4c9a[_0xebef('0x74')]?_0x2b4c9a['statusMessage']:'OK');if(_0x2b4c9a[_0xebef('0x72')]){try{this[_0xebef('0x9b')](_0x2b4c9a['body'],_0x2ac9fe);}catch(_0x22ff37){logger['error'](util['format'](_0xebef('0x183'),_0x2ac9fe));}}return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xda'),_0x2ac9fe));};AGIVertices['prototype'][_0xebef('0x184')]=function(_0x23a8d5){logger[_0xebef('0x2c')](util['format'](_0xebef('0x185'),_0x23a8d5[_0xebef('0x35')]));return this[_0xebef('0xe')][_0xebef('0x186')](_0x23a8d5[_0xebef('0x187')][_0xebef('0x188')](/\s+/g,''),_0x23a8d5[_0xebef('0x17b')]);};AGIVertices[_0xebef('0x11')][_0xebef('0x189')]=function(_0x4c0d26){logger[_0xebef('0x2c')](util['format'](_0xebef('0x18a'),_0x4c0d26[_0xebef('0x35')]));return this['channel'][_0xebef('0x18b')](_0x4c0d26['number'][_0xebef('0x188')](/\s+/g,''),_0x4c0d26['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0xa383f0){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x18c'),_0xa383f0[_0xebef('0x35')]));return this['channel']['sayPhonetic'](_0xa383f0[_0xebef('0x59')],_0xa383f0[_0xebef('0x17b')]);};AGIVertices[_0xebef('0x11')][_0xebef('0x18d')]=function(_0x1f3d64){logger[_0xebef('0x2c')](util[_0xebef('0x29')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x1f3d64[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x1f3d64['account_id'])){return this[_0xebef('0xe')][_0xebef('0xa7')]('no\x20mail\x20account\x20configured');}var _0xf39585=this['getMailAccount'][_0xebef('0x6c')](this,_0x1f3d64[_0xebef('0x18e')]);if(!_0xf39585||!_0xf39585[_0xebef('0x18f')]){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x1f3d64,'no\x20mail\x20account\x20found');}var _0xc13bd1={'from':util[_0xebef('0x29')](_0xebef('0x190'),_0xf39585[_0xebef('0x15')],_0xf39585[_0xebef('0x191')]||_0xf39585['Smtp'][_0xebef('0x192')]),'to':_0x1f3d64['to']||'','cc':_0x1f3d64['cc']||'','bcc':_0x1f3d64['bcc']||'','subject':_0x1f3d64[_0xebef('0x193')],'html':_0x1f3d64['text'],'text':_0x1f3d64[_0xebef('0x59')]};if(this[_0xebef('0x83')](_0x1f3d64['template_id'])){}logger[_0xebef('0xdc')](_0xebef('0x194'),JSON[_0xebef('0x71')](_0xc13bd1));this['createSquareDetailsReport'][_0xebef('0x6c')](this,_0x1f3d64,_0x1f3d64[_0xebef('0x18e')]);this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0x195'),_0xf39585['name']));this[_0xebef('0x21')][_0xebef('0x6c')](this,_0xf39585['smtpOptions'],_0xc13bd1);return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x196'));};AGIVertices['prototype']['sendFax']=function(_0x2974ff){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x197'),_0x2974ff[_0xebef('0x35')]));return this['channel']['noop'](_0xebef('0x198'));};AGIVertices[_0xebef('0x11')][_0xebef('0x199')]=function(_0x503d7f){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x19a'),_0x503d7f[_0xebef('0x35')]));if(!this['isConfigured'](_0x503d7f[_0xebef('0x19b')])){return this[_0xebef('0xe')]['noop'](_0xebef('0x19c'));}var _0x523470=this[_0xebef('0x30')][_0xebef('0x6c')](this,_0x503d7f[_0xebef('0x19b')]);if(!_0x523470){return this['channel'][_0xebef('0x4d')](_0x503d7f,_0xebef('0x19d'));}var _0x3c089d={'body':_0x503d7f[_0xebef('0x19e')],'phone':_0x503d7f['to']||'','SmsAccountId':_0x523470['id']};logger[_0xebef('0xdc')](_0xebef('0x19f'),JSON[_0xebef('0x71')](_0x3c089d));this[_0xebef('0x33')][_0xebef('0x6c')](this,_0x503d7f,_0x503d7f['sms_account_id']);this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0x1a0'),_0x523470[_0xebef('0x15')]));this['createSmsMessage']['sync'](this,_0x3c089d);return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x1a1'));};AGIVertices[_0xebef('0x11')][_0xebef('0x1a2')]=function(_0x226e04){logger[_0xebef('0x2c')](util[_0xebef('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x226e04['label']));if(!this['isConfigured'](_0x226e04[_0xebef('0x114')])){return this['channel']['error'](_0x226e04,_0xebef('0x1a3'));}var _0x201527=this[_0xebef('0x12')][_0xebef('0x6c')](this,_0x226e04[_0xebef('0x114')]);if(!_0x201527){return this['channel']['error'](_0x226e04,_0xebef('0xd7'));}return this[_0xebef('0xe')][_0xebef('0xa2')](_0x201527,_0x226e04[_0xebef('0x1a4')]);};AGIVertices[_0xebef('0x11')][_0xebef('0x1a5')]=function(_0x22bf4f){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x1a6'),_0x22bf4f[_0xebef('0x35')]));this[_0xebef('0xe')]['noop'](_0xebef('0x1a7'));if(_0x22bf4f['answer']===_0xebef('0x1a8')){this['channel'][_0xebef('0xa7')](_0xebef('0x1a9'));return this['channel'][_0xebef('0xb6')]();}return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x1aa'));};AGIVertices['prototype'][_0xebef('0x1ab')]=function(_0x28db84){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x1ac'),_0x28db84[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x28db84['project_id'])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x28db84,_0xebef('0x1ad'));}var _0x506d39=this[_0xebef('0x18')][_0xebef('0x6c')](this,_0x28db84['project_id']);if(!this['isConfigured'](_0x506d39)){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x28db84,util[_0xebef('0x29')](_0xebef('0x1ae'),_0x28db84[_0xebef('0x1af')]));}if(_0x506d39===this[_0xebef('0xe')][_0xebef('0x36')]){return this[_0xebef('0xe')]['error'](_0x28db84,_0xebef('0x1b0'));}this[_0xebef('0x33')]['sync'](this,_0x28db84,_0x506d39);var _0x345d8b=this['channel'][_0xebef('0x55')](_0xebef('0x1b1'),util['format'](_0xebef('0x1b2'),config[_0xebef('0x7')][_0xebef('0x1b3')]||_0xebef('0x1b4'),_0x506d39,this[_0xebef('0xe')]['arg_1']));if(_0x345d8b[_0xebef('0x9f')]===-0x1){return _0x345d8b;}return this[_0xebef('0xe')][_0xebef('0xa7')](util['format'](_0xebef('0xc3'),_0xebef('0x1b1'),_0x506d39));};AGIVertices[_0xebef('0x11')][_0xebef('0x1b5')]=function(_0x3d16f7){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x1b6'),_0x3d16f7[_0xebef('0x35')]));var _0x3895e3=this[_0xebef('0x54')][_0xebef('0x6c')](this,_0x3d16f7[_0xebef('0x1b7')]);this['createSquareDetailsReport'][_0xebef('0x6c')](this,_0x3d16f7,_0x3d16f7[_0xebef('0x1b7')]);if(this[_0xebef('0x83')](_0x3d16f7[_0xebef('0x114')])){var _0x5c924a=this[_0xebef('0x12')][_0xebef('0x6c')](this,_0x3d16f7['variable_id']);if(_0x5c924a){this[_0xebef('0xe')][_0xebef('0xa2')](_0x5c924a,_0x3895e3);return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x3d16f7[_0xebef('0x1b7')],_0x5c924a));}}return this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x1b8'),_0x3d16f7[_0xebef('0x1b7')]));};AGIVertices[_0xebef('0x11')][_0xebef('0x1b9')]=function(_0x32de95){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x1ba'),_0x32de95['label']));_0x32de95[_0xebef('0x59')]=_0x32de95[_0xebef('0x59')][_0xebef('0x188')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x32de95[_0xebef('0x58')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0x1bb'));}if(!this[_0xebef('0x83')](_0x32de95[_0xebef('0x59')])){return this[_0xebef('0xe')][_0xebef('0xa7')](_0xebef('0xa8'));}this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x32de95[_0xebef('0x59')]));var _0x21a9ee=this[_0xebef('0x57')]['sync'](this,_0x32de95);if(_0x21a9ee){this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x1bc'),_0x21a9ee));var _0x52e4ec=this['channel'][_0xebef('0x100')](_0x21a9ee);try{fs[_0xebef('0x101')](_0x21a9ee+_0xebef('0x102'));}catch(_0x7e0881){logger[_0xebef('0x4d')](_0x7e0881);}return _0x52e4ec;}return this[_0xebef('0xe')][_0xebef('0x4d')](_0x32de95,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xebef('0x1bd')]=function(_0x3666fe){logger[_0xebef('0x2c')](util[_0xebef('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3666fe[_0xebef('0x35')]));_0x3666fe[_0xebef('0x59')]=_0x3666fe[_0xebef('0x59')][_0xebef('0x188')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xebef('0x83')](_0x3666fe[_0xebef('0x59')])){return this[_0xebef('0xe')]['noop'](_0xebef('0xa8'));}this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x1be'),_0x3666fe[_0xebef('0x59')]));var _0x5652ad=this[_0xebef('0x5d')][_0xebef('0x6c')](this,_0x3666fe);if(_0x5652ad){this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x1bf'),_0x5652ad));var _0x299175=this[_0xebef('0xe')][_0xebef('0x100')](_0x5652ad);try{fs['unlink'](_0x5652ad+_0xebef('0x102'));}catch(_0x106cb9){logger[_0xebef('0x4d')](_0x106cb9);}return _0x299175;}return this['channel']['error'](_0x3666fe,_0xebef('0x1c0'));};AGIVertices[_0xebef('0x11')][_0xebef('0x1c1')]=function(_0x5567aa){logger[_0xebef('0x2c')](util['format'](_0xebef('0x1c2'),_0x5567aa[_0xebef('0x35')]));if(!this[_0xebef('0x83')](_0x5567aa[_0xebef('0x155')])){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x5567aa,_0xebef('0x156'));}logger['info'](util['format'](_0xebef('0x157'),this['channel'][_0xebef('0x38')],_0x5567aa['findBy']));var _0x4b8cf2=this[_0xebef('0x4f')][_0xebef('0x6c')](this,_0x5567aa[_0xebef('0x155')]);if(_0x4b8cf2){logger['info'](util[_0xebef('0x29')](_0xebef('0x158'),this[_0xebef('0xe')][_0xebef('0x38')],_0x5567aa[_0xebef('0x155')]));this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x158'),this[_0xebef('0xe')]['callerid'],_0x5567aa[_0xebef('0x155')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0xebef('0x15a'),this['channel'][_0xebef('0x38')],_0x5567aa[_0xebef('0x155')]));this[_0xebef('0xe')][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0x15a'),this[_0xebef('0xe')]['callerid'],_0x5567aa[_0xebef('0x155')]));return{'code':0xc8,'result':_0xebef('0x15b')};}};AGIVertices['prototype'][_0xebef('0x1c3')]=function(_0x476c8f){logger[_0xebef('0x2c')](util['format'](_0xebef('0x1c4'),_0x476c8f[_0xebef('0x35')]));var _0xd6faca=this['channel'][_0xebef('0x55')](_0xebef('0x1c5'),[_0x476c8f['mailbox'],_0x476c8f[_0xebef('0x77')]]);if(_0xd6faca[_0xebef('0x9f')]===-0x1){return _0xd6faca;}return this['channel'][_0xebef('0xa7')](util[_0xebef('0x29')](_0xebef('0xc3'),'VOICEMAIL',_0x476c8f[_0xebef('0x1c6')]));};AGIVertices[_0xebef('0x11')]['vswitch']=function(_0x566e01){logger[_0xebef('0x2c')](util[_0xebef('0x29')](_0xebef('0x1c7'),_0x566e01[_0xebef('0x35')]));if(!this['isConfigured'](_0x566e01[_0xebef('0x114')])){return this['channel'][_0xebef('0x4d')](_0x566e01,_0xebef('0x1a3'));}var _0x1d55e5=this[_0xebef('0x12')]['sync'](this,_0x566e01['variable_id']);if(!_0x1d55e5){return this[_0xebef('0xe')][_0xebef('0x4d')](_0x566e01,'no\x20variable\x20found');}var _0x7b9477=this[_0xebef('0xe')][_0xebef('0x12')](_0x1d55e5);return{'code':0xc8,'result':_0x7b9477['extra']?_0x7b9477[_0xebef('0xa1')]:'-'};};String[_0xebef('0x11')][_0xebef('0x9e')]=function(_0x34d528,_0x748f9d){return this[_0xebef('0x9d')](_0x34d528)[_0xebef('0x1c8')](_0x748f9d);};module[_0xebef('0x1c9')]=AGIVertices; \ No newline at end of file +var _0x0833=['mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getSound','getSoundById','getMailAccountById','sendMailMessage','getIntervals','map','Intervals','interval','getSoundPath','format','getQueryOdbc','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','createSquareRecording','uniqueid','callerid','context','extension','priority','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agentUnpause','agent','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','body','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','length','isString','replaceAllVariables','%s.%s','saveRestApiResult','setVariable','split','replaceAll','getAndSetVariable','result','extra','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','noop','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','RECOG_INPUT()','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DIALOGFLOW_%s','out','dialogflowV2','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','NOBEEP','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','menu','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','opts','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','recordFile','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','subject','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','rawHeaders','rawBody','channel','rpc'];(function(_0x19405f,_0xd92bae){var _0x580a3c=function(_0x46bc50){while(--_0x46bc50){_0x19405f['push'](_0x19405f['shift']());}};_0x580a3c(++_0xd92bae);}(_0x0833,0x1bd));var _0x3083=function(_0x5918a8,_0x1a0f92){_0x5918a8=_0x5918a8-0x0;var _0x2edae1=_0x0833[_0x5918a8];return _0x2edae1;};'use strict';var fs=require('fs');var util=require(_0x3083('0x0'));var _=require(_0x3083('0x1'));var sh=require(_0x3083('0x2'));var odbc=require(_0x3083('0x3'))();var rs=require(_0x3083('0x4'));var moment=require('moment');var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0x3083('0x5'))('agi');var config=require(_0x3083('0x6'));var shared=require(_0x3083('0x7'));var scripts=require(_0x3083('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x3083('0x9'),_0x3083('0xa')];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0x44b807,_0x5f1109,_0x5cce3c){this[_0x3083('0xb')]=_0x44b807;this[_0x3083('0xc')]=_0x5f1109;this[_0x3083('0xd')]=_0x5cce3c;};AGIVertices[_0x3083('0xe')][_0x3083('0xf')]=function(_0x23bcf4,_0x17951a){this[_0x3083('0xc')][_0x3083('0x10')](_0x23bcf4)[_0x3083('0x11')](function(_0x3a2460){_0x17951a(null,_0x3a2460?_0x3a2460[_0x3083('0x12')]:![]);})[_0x3083('0x13')](function(_0x2dc6ab){_0x17951a(_0x2dc6ab);});};AGIVertices[_0x3083('0xe')]['getVoiceQueue']=function(_0x2fe399,_0x2a8cd0){this['rpc'][_0x3083('0x14')](_0x2fe399)[_0x3083('0x11')](function(_0x507441){_0x2a8cd0(null,_0x507441?_0x507441[_0x3083('0x12')]:![]);})[_0x3083('0x13')](function(_0x1b6955){_0x2a8cd0(_0x1b6955);});};AGIVertices[_0x3083('0xe')][_0x3083('0x15')]=function(_0x1de928,_0xecb368){this['rpc']['getSquareProjectById'](_0x1de928)['then'](function(_0x424c59){_0xecb368(null,_0x424c59?_0x424c59['name']:![]);})[_0x3083('0x13')](function(_0x2cdeca){_0xecb368(_0x2cdeca);});};AGIVertices[_0x3083('0xe')][_0x3083('0x16')]=function(_0x3bc7f0,_0x43d42a){this[_0x3083('0xc')][_0x3083('0x17')](_0x3bc7f0)[_0x3083('0x11')](function(_0x164988){_0x43d42a(null,_0x164988?_0x164988[_0x3083('0x18')]:![]);})[_0x3083('0x13')](function(_0x9a4aed){_0x43d42a(_0x9a4aed);});};AGIVertices[_0x3083('0xe')]['getUser']=function(_0x4c2a0b,_0x4dc9ad){this['rpc'][_0x3083('0x19')](_0x4c2a0b)[_0x3083('0x11')](function(_0x3e4f5a){_0x4dc9ad(null,_0x3e4f5a?_0x3e4f5a[_0x3083('0x12')]:![]);})[_0x3083('0x13')](function(_0x4170ab){_0x4dc9ad(_0x4170ab);});};AGIVertices[_0x3083('0xe')][_0x3083('0x1a')]=function(_0x4501b2,_0x569b8b){this[_0x3083('0xc')]['getTrunkById'](_0x4501b2)['then'](function(_0x1bea50){_0x569b8b(null,_0x1bea50?_0x1bea50[_0x3083('0x12')]:![]);})[_0x3083('0x13')](function(_0x2efe93){_0x569b8b(_0x2efe93);});};AGIVertices[_0x3083('0xe')][_0x3083('0x1b')]=function(_0x5369f4,_0xd38b35){var _0x57eade=this;this[_0x3083('0xc')][_0x3083('0x1c')](_0x5369f4)['then'](function(_0x3055d2){_0xd38b35(null,_0x3055d2?_0x57eade['getSoundPath'](_0x3055d2['save_name']):![]);})[_0x3083('0x13')](function(_0x233a81){_0xd38b35(_0x233a81);});};AGIVertices[_0x3083('0xe')]['getMailAccount']=function(_0x1a8b75,_0x235c09){this[_0x3083('0xc')][_0x3083('0x1d')](_0x1a8b75)[_0x3083('0x11')](function(_0x29146b){_0x235c09(null,_0x29146b?_0x29146b:![]);})[_0x3083('0x13')](function(_0x1b4680){_0x235c09(_0x1b4680);});};AGIVertices[_0x3083('0xe')][_0x3083('0x1e')]=function(_0x3bd45c,_0x30dcd1,_0xb56270){this[_0x3083('0xd')][_0x3083('0x1e')](_0x3bd45c,_0x30dcd1)[_0x3083('0x11')](function(){_0xb56270(null);})[_0x3083('0x13')](function(_0x300703){_0xb56270(_0x300703);});};AGIVertices[_0x3083('0xe')][_0x3083('0x1f')]=function(_0x4c3404,_0x25ec5f){this[_0x3083('0xc')]['getIntervalById'](_0x4c3404)[_0x3083('0x11')](function(_0x473f0b){if(_0x473f0b){if(_0x473f0b['IntervalId']){_0x25ec5f(null,[_0x473f0b['interval']]);}else{_0x25ec5f(null,_[_0x3083('0x20')](_0x473f0b[_0x3083('0x21')],_0x3083('0x22')));}}else{_0x25ec5f(null,![]);}})[_0x3083('0x13')](function(_0x5642f8){_0x25ec5f(_0x5642f8);});};AGIVertices['prototype'][_0x3083('0x23')]=function(_0x2ae3df){return util[_0x3083('0x24')]('%s/sounds/converted/%s',FILES_PATH,_0x2ae3df);};AGIVertices[_0x3083('0xe')][_0x3083('0x25')]=function(_0x12ff32,_0x418bb2,_0x408f33){odbc['open'](_0x12ff32,function(_0x4c5bbc){if(_0x4c5bbc){logger[_0x3083('0x26')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x4c5bbc);_0x408f33(_0x4c5bbc);}else{logger[_0x3083('0x27')](_0x3083('0x28'));odbc[_0x3083('0x29')](_0x418bb2,function(_0xf9ac6a,_0x56121c){if(_0xf9ac6a){logger[_0x3083('0x27')](_0x3083('0x2a'),_0x418bb2);_0x408f33(_0xf9ac6a);}else{logger[_0x3083('0x27')]('Query\x20executed\x20correctly\x20%s',_0x418bb2);odbc[_0x3083('0x2b')](function(_0x4b2456){if(_0x4b2456){logger[_0x3083('0x26')](_0x3083('0x2c'),_0x4b2456);}_0x408f33(null,_0x56121c);});}});}});};AGIVertices[_0x3083('0xe')][_0x3083('0x2d')]=function(_0x489292,_0x10380f){this['rpc'][_0x3083('0x2e')](_0x489292)[_0x3083('0x11')](function(_0x166162){_0x10380f(null,_0x166162?_0x166162:![]);})[_0x3083('0x13')](function(_0x4597e5){_0x10380f(_0x4597e5);});};AGIVertices['prototype'][_0x3083('0x2f')]=function(_0x28f37e,_0x334084){this[_0x3083('0xc')][_0x3083('0x2f')](_0x28f37e)[_0x3083('0x11')](function(_0x7c08d7){_0x334084(null,_0x7c08d7);})[_0x3083('0x13')](function(_0x3dbc69){_0x334084(_0x3dbc69);});};AGIVertices[_0x3083('0xe')]['createSquareDetailsReport']=function(_0x406d89,_0x505091,_0x5536c0){this[_0x3083('0xc')][_0x3083('0x30')]({'uniqueid':this[_0x3083('0xb')]['uniqueid'],'node':_0x406d89[_0x3083('0x31')],'application':_0x406d89[_0x3083('0x32')],'data':_0x505091||null,'project_name':this[_0x3083('0xb')]['arg_1'],'callerid':this[_0x3083('0xb')]['callerid']})[_0x3083('0x11')](function(_0x5137d3){if(_0x5536c0){_0x5536c0(null,_0x5137d3);}})[_0x3083('0x13')](function(_0x5ad75b){if(_0x5536c0){_0x5536c0(_0x5ad75b);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x553f7f,_0x45c26e,_0x3673b5,_0x3a2be6){this[_0x3083('0xc')][_0x3083('0x33')]({'uniqueid':this[_0x3083('0xb')][_0x3083('0x34')],'callerid':this[_0x3083('0xb')][_0x3083('0x35')],'calleridname':this[_0x3083('0xb')]['calleridname'],'context':this[_0x3083('0xb')][_0x3083('0x36')],'extension':this[_0x3083('0xb')][_0x3083('0x37')],'priority':this['channel'][_0x3083('0x38')],'accountcode':this[_0x3083('0xb')][_0x3083('0x39')],'dnid':this[_0x3083('0xb')][_0x3083('0x3a')],'projectName':this[_0x3083('0xb')][_0x3083('0x3b')],'saveName':_0x45c26e,'filename':_0x553f7f['file']||_0x45c26e,'savePath':_0x3673b5})[_0x3083('0x11')](function(_0x243ee0){_0x3a2be6(null,_0x243ee0);})[_0x3083('0x13')](function(_0x17bcf0){_0x3a2be6(_0x17bcf0);});};AGIVertices[_0x3083('0xe')][_0x3083('0x3c')]=function(_0x5dbfd2,_0x5ca6fa,_0x1637f6,_0x5d6ea1,_0x31891f){this[_0x3083('0xc')][_0x3083('0x3c')]({'uniqueid':this[_0x3083('0xb')][_0x3083('0x34')],'body':_0x5dbfd2,'direction':_0x5ca6fa,'providerName':_0x1637f6,'providerResponse':_0x5d6ea1})[_0x3083('0x11')](function(_0x21b779){if(_0x31891f){_0x31891f(null,_0x21b779);}})['catch'](function(_0x1dd15f){if(_0x31891f){_0x31891f(_0x1dd15f);}});};AGIVertices[_0x3083('0xe')][_0x3083('0x3d')]=function(_0x488943,_0x2e8c80){this['rpc'][_0x3083('0x3d')]({'firstName':_[_0x3083('0x3e')](_0x488943['name'])||_[_0x3083('0x3f')](_0x488943[_0x3083('0x12')])?_0x3083('0x40')+Math[_0x3083('0x41')]():_0x488943['name'],'lastName':_['isEmpty'](_0x488943[_0x3083('0x42')])||_[_0x3083('0x3f')](_0x488943[_0x3083('0x42')])?null:_0x488943[_0x3083('0x42')],'phone':_0x488943[_0x3083('0x43')],'ListId':_0x488943[_0x3083('0x44')],'scheduledat':_0x488943[_0x3083('0x45')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x3083('0x46'),'description':_0x3083('0x47')+_0x488943['scheduledAt'][_0x3083('0x48')](),'priority':_0x488943[_0x3083('0x49')]})[_0x3083('0x11')](function(_0x3944e0){_0x2e8c80(null,_0x3944e0);})[_0x3083('0x13')](function(_0x29f58d){_0x2e8c80(_0x29f58d);});};AGIVertices['prototype'][_0x3083('0x4a')]=function(_0x333456,_0x5ef25e){this[_0x3083('0xc')]['getPauseById'](_0x333456)[_0x3083('0x11')](function(_0x538d09){_0x5ef25e(null,_0x538d09?_0x538d09['name']:![]);})['catch'](function(_0x2b5e29){_0x5ef25e(_0x2b5e29);});};AGIVertices[_0x3083('0xe')][_0x3083('0x4b')]=function(_0x953e2f,_0x360f21,_0x1fa78c){var _0x5af85e={'role':'agent'};_0x5af85e[_0x953e2f]=this[_0x3083('0xb')]['callerid'];this[_0x3083('0xc')][_0x3083('0x4b')](_0x5af85e,_0x360f21,this[_0x3083('0xb')][_0x3083('0x34')])[_0x3083('0x11')](function(_0x25b43b){_0x1fa78c(null,_[_0x3083('0x3f')](_0x25b43b)?![]:!![]);})['catch'](function(_0x590b2b){logger[_0x3083('0x26')](_0x590b2b);_0x1fa78c(null,![]);});};AGIVertices[_0x3083('0xe')][_0x3083('0x4c')]=function(_0x44f745,_0x385dc3){var _0x586cd1={'role':_0x3083('0x4d')};_0x586cd1[_0x44f745]=this[_0x3083('0xb')]['callerid'];this[_0x3083('0xc')][_0x3083('0x4c')](_0x586cd1)[_0x3083('0x11')](function(_0x38448b){_0x385dc3(null,_[_0x3083('0x3f')](_0x38448b)?![]:!![]);})[_0x3083('0x13')](function(_0x41ed35){logger[_0x3083('0x26')](_0x41ed35);_0x385dc3(null,![]);});};AGIVertices[_0x3083('0xe')]['agentLogout']=function(_0xc2343b,_0x43e7c2){var _0x20a126={'role':_0x3083('0x4d')};_0x20a126[_0xc2343b]=this[_0x3083('0xb')][_0x3083('0x35')];this[_0x3083('0xc')]['agentLogout'](_0x20a126)[_0x3083('0x11')](function(_0x5dda6f){_0x43e7c2(null,_[_0x3083('0x3f')](_0x5dda6f)?![]:!![]);})[_0x3083('0x13')](function(_0x3f4ca9){logger[_0x3083('0x26')](_0x3f4ca9);_0x43e7c2(null,![]);});};AGIVertices[_0x3083('0xe')]['agentLogin']=function(_0x119f72,_0x44ac3c){var _0x377d26={'role':'agent'};_0x377d26[_0x119f72]=this[_0x3083('0xb')][_0x3083('0x35')];var _0x281d14=_0x119f72!=_0x3083('0x4e')?util[_0x3083('0x24')](_0x3083('0x4f'),'LOCAL',this[_0x3083('0xb')][_0x3083('0x35')]):undefined;this[_0x3083('0xc')][_0x3083('0x50')](_0x377d26,_0x281d14)['then'](function(_0x160c55){_0x44ac3c(null,_[_0x3083('0x3f')](_0x160c55)?![]:!![]);})[_0x3083('0x13')](function(_0x17f3f0){logger[_0x3083('0x26')](_0x17f3f0);_0x44ac3c(null,![]);});};AGIVertices[_0x3083('0xe')][_0x3083('0x51')]=function(_0x50ca12,_0x25656d){sh[_0x3083('0x52')](_['trim'](_0x50ca12),function(_0xa87e56,_0x531124){var _0x5baaa1=_0x531124[_0x3083('0x53')](/(\r\n|\n|\r)/gm,'');_0x25656d(null,_0x5baaa1);});};AGIVertices['prototype'][_0x3083('0x54')]=function(_0x13260a,_0x3dfb08){scripts['googleCloudTTS'](_0x13260a['apiKey'],_0x13260a[_0x3083('0x55')]||_0x3083('0x56'),_0x13260a[_0x3083('0x56')],_0x13260a[_0x3083('0x57')]||'en-US',_0x13260a[_0x3083('0x58')]||_0x3083('0x59'),_0x13260a[_0x3083('0x5a')]||_0x3083('0x5b'))[_0x3083('0x11')](function(_0xfed6e){_0x3dfb08(null,_0xfed6e);})[_0x3083('0x13')](function(_0x1f3fae){_0x3dfb08(_0x1f3fae);});};AGIVertices['prototype'][_0x3083('0x5c')]=function(_0x108e21,_0x2e0355){scripts['googleTTS'](_0x108e21[_0x3083('0x56')],_0x108e21[_0x3083('0x5d')]||'en',0x1)['then'](function(_0x4ad20e){_0x2e0355(null,_0x4ad20e);})[_0x3083('0x13')](function(_0x396c53){_0x2e0355(_0x396c53);});};AGIVertices[_0x3083('0xe')]['restAPI']=function(_0x315969,_0xb68216){var _0x10c758={'uri':_0x315969[_0x3083('0x5e')],'method':_0x315969[_0x3083('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x315969[_0x3083('0x60')])===_0x3083('0x61')&&parseInt(_0x315969['timeout'])>=0x1?parseInt(_0x315969[_0x3083('0x60')])*0x3e8:0x5*0x3e8};if(_[_0x3083('0x62')]([_0x3083('0x63'),_0x3083('0x64')],_0x10c758[_0x3083('0x5f')][_0x3083('0x65')]())){try{_0x10c758['body']=_0x315969[_0x3083('0xa')]?JSON[_0x3083('0x66')](_0x315969[_0x3083('0xa')]):{};}catch(_0x68705d){logger[_0x3083('0x26')](_0x3083('0x67'),_0x68705d);}}try{_0x10c758[_0x3083('0x68')]=_0x315969['rawHeaders']?JSON[_0x3083('0x66')](_0x315969[_0x3083('0x9')]):{};}catch(_0x1a1214){logger[_0x3083('0x26')](_0x3083('0x69'),_0x1a1214);}if(_0x315969[_0x3083('0x6a')]){try{var _0x1e4c75=require(_0x315969['computedVariables'])[_0x3083('0x6b')](this,_0x10c758);_0x10c758[_0x3083('0x6c')]=Mustache['render'](_0x315969[_0x3083('0x5e')],_0x1e4c75,{},['$$','$$']);if(_0x10c758['headers']){_0x10c758['headers']=JSON[_0x3083('0x66')](Mustache['render'](JSON['stringify'](_0x10c758[_0x3083('0x68')]),_0x1e4c75,{},['$$','$$']));}if(_0x10c758[_0x3083('0x6d')]){_0x10c758['body']=JSON['parse'](Mustache[_0x3083('0x6e')](JSON[_0x3083('0x6f')](_0x10c758[_0x3083('0x6d')]),_0x1e4c75,{},['$$','$$']));}}catch(_0x4ba3fa){logger['error'](_0x3083('0x70'),_0x4ba3fa);}}rp(_0x10c758)[_0x3083('0x11')](function(_0x236267){var _0x3e07c3={'statusCode':_0x236267['statusCode']||0xc8,'statusMessage':_0x236267['statusMessage']||'OK','headers':_0x236267[_0x3083('0x68')]||{},'body':_0x236267[_0x3083('0x6d')]||{}};_0xb68216(null,_0x3e07c3);})[_0x3083('0x13')](function(_0x20f511){var _0x4d845f={'statusCode':_0x20f511[_0x3083('0x71')]||0x1f4,'statusMessage':_0x20f511[_0x3083('0x72')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x20f511[_0x3083('0x73')]['headers']||{},'body':_0x20f511['options']['body']||{}};_0xb68216(null,_0x4d845f);});};AGIVertices['prototype'][_0x3083('0x74')]=function(_0x3c8ae9,_0x1f1c21){scripts[_0x3083('0x74')](this[_0x3083('0xb')][_0x3083('0x34')],_0x3c8ae9[_0x3083('0x75')],_0x3c8ae9['text'],_0x3c8ae9[_0x3083('0x76')]||'en')[_0x3083('0x11')](function(_0x44280c){_0x1f1c21(null,_0x44280c);})[_0x3083('0x13')](function(_0x1bbd2d){_0x1f1c21(_0x1bbd2d);});};AGIVertices[_0x3083('0xe')][_0x3083('0x77')]=function(_0x144697,_0x20d5c5){scripts[_0x3083('0x77')](this[_0x3083('0xb')][_0x3083('0x34')],_0x144697['dialogflowV2_project_id'],_0x144697[_0x3083('0x78')],_0x144697[_0x3083('0x79')],_0x144697[_0x3083('0x56')],_0x144697[_0x3083('0x7a')]||'en')[_0x3083('0x11')](function(_0x40f938){_0x20d5c5(null,_0x40f938);})[_0x3083('0x13')](function(_0x3b4f17){_0x20d5c5(_0x3b4f17);});};AGIVertices['prototype']['sestekNDA']=function(_0x1a932a,_0x42033f){scripts[_0x3083('0x7b')](this['channel'],_0x1a932a)[_0x3083('0x11')](function(_0x4a4fe6){_0x42033f(null,_0x4a4fe6);})[_0x3083('0x13')](function(_0x477185){_0x42033f(_0x477185);});};AGIVertices[_0x3083('0xe')]['ispeechTTS']=function(_0x432d38,_0x53815a){scripts[_0x3083('0x7c')](_0x432d38['key'],_0x432d38['text'],_0x432d38[_0x3083('0x7d')]||_0x3083('0x7e'),_0x432d38['speed'])[_0x3083('0x11')](function(_0x2c2829){_0x53815a(null,_0x2c2829);})['catch'](function(_0x351cdf){_0x53815a(_0x351cdf);});};AGIVertices[_0x3083('0xe')][_0x3083('0x7f')]=function(_0x47a9cb,_0x5d832f,_0x157b6e){scripts[_0x3083('0x7f')](_0x5d832f,_0x47a9cb[_0x3083('0x75')],_0x47a9cb[_0x3083('0x80')]||_0x3083('0x7e'),this[_0x3083('0x81')](_0x47a9cb['model'])?_0x47a9cb[_0x3083('0x82')]:undefined)[_0x3083('0x11')](function(_0x381b5b){_0x157b6e(null,_0x381b5b);})[_0x3083('0x13')](function(_0x5ea17b){_0x157b6e(_0x5ea17b);});};AGIVertices[_0x3083('0xe')][_0x3083('0x83')]=function(_0x17478b,_0x279c12){scripts['awsPolly'](_0x17478b['aws_access_key_id'],_0x17478b[_0x3083('0x84')],_0x17478b[_0x3083('0x85')],_0x17478b[_0x3083('0x86')]||'Amy',_0x17478b['text'],_0x17478b[_0x3083('0x87')]||_0x3083('0x56'))[_0x3083('0x11')](function(_0x2b52bb){_0x279c12(null,_0x2b52bb);})[_0x3083('0x13')](function(_0x2ffb0e){_0x279c12(_0x2ffb0e);});};AGIVertices[_0x3083('0xe')][_0x3083('0x88')]=function(_0x2a26ea,_0xb7cb24){scripts[_0x3083('0x88')](this[_0x3083('0xb')][_0x3083('0x34')],_0x2a26ea[_0x3083('0x89')],_0x2a26ea[_0x3083('0x84')],_0x2a26ea[_0x3083('0x8a')],_0x2a26ea[_0x3083('0x56')],_0x2a26ea[_0x3083('0x8b')])['then'](function(_0x4a84ce){_0xb7cb24(null,_0x4a84ce);})['catch'](function(_0x594866){_0xb7cb24(_0x594866);});};AGIVertices['prototype']['googleASR']=function(_0x471140,_0x26de07,_0xee0500){scripts['googleASR'](_0x26de07,_0x471140[_0x3083('0x75')],_0x471140[_0x3083('0x8c')]||_0x3083('0x7e'))[_0x3083('0x11')](function(_0x51cd44){_0xee0500(null,_0x51cd44);})[_0x3083('0x13')](function(_0x48aa1f){_0xee0500(_0x48aa1f);});};AGIVertices['prototype'][_0x3083('0x8d')]=function(_0x44234d,_0x2e5ad1,_0x389c1c){scripts[_0x3083('0x8d')](_0x2e5ad1,_0x44234d[_0x3083('0x8e')],_0x44234d['appsecret'],_0x44234d[_0x3083('0x6c')])[_0x3083('0x11')](function(_0x3bb702){_0x389c1c(null,_0x3bb702);})['catch'](function(_0x563d60){_0x389c1c(_0x563d60);});};AGIVertices[_0x3083('0xe')][_0x3083('0x8f')]=function(_0x50629e){var _0x1a620c=_[_0x3083('0x62')](verticesWithRetry,_0x50629e[_0x3083('0x32')])?_0x50629e:_[_0x3083('0x90')](_0x50629e);for(var _0x2ec99d in _0x1a620c){if(_0x1a620c[_0x3083('0x91')](_0x2ec99d)){if(_0x1a620c[_0x2ec99d]&&_['isString'](_0x1a620c[_0x2ec99d])){if(_[_0x3083('0x62')](recursiveMapAttributes,_0x2ec99d)){_0x1a620c[_0x2ec99d]=this[_0x3083('0x92')](_0x1a620c[_0x2ec99d]);}else{_0x1a620c[_0x2ec99d]=this['replaceAllVariables'](_0x1a620c[_0x2ec99d]);}}}}return _0x1a620c;};AGIVertices[_0x3083('0xe')][_0x3083('0x93')]=function(_0xdc957f){for(var _0x1416c3 in _0xdc957f){if(_0xdc957f['hasOwnProperty'](_0x1416c3)){if(_[_0x3083('0x94')](_0xdc957f[_0x1416c3])){this[_0x3083('0x93')](_0xdc957f[_0x1416c3]);}else if(_['isArray'](_0xdc957f[_0x1416c3])){for(var _0x13f557=0x0;_0x13f557<_0xdc957f[_0x1416c3][_0x3083('0x95')];_0x13f557++){this['recursiveNodeIndex'](_0xdc957f[_0x1416c3][_0x13f557]);}}else if(_[_0x3083('0x96')](_0xdc957f[_0x1416c3])){_0xdc957f[_0x1416c3]=this[_0x3083('0x97')](_0xdc957f[_0x1416c3]);}}}};AGIVertices[_0x3083('0xe')]['saveRestApiResult']=function(_0x408830,_0x302396){for(var _0x54a515 in _0x408830){if(_0x408830[_0x3083('0x91')](_0x54a515)){if(_[_0x3083('0x94')](_0x408830[_0x54a515])){if(!_[_0x3083('0x3e')](_0x408830[_0x54a515])){this['saveRestApiResult'](_0x408830[_0x54a515],util[_0x3083('0x24')](_0x3083('0x98'),_0x302396,_0x54a515));}}else if(_['isArray'](_0x408830[_0x54a515])){for(var _0x1c8934=0x0;_0x1c8934<_0x408830[_0x54a515][_0x3083('0x95')];_0x1c8934++){this[_0x3083('0x99')](_0x408830[_0x54a515][_0x1c8934],util['format'](_0x3083('0x98'),_0x302396,_0x54a515+'['+_0x1c8934+']'));}}else{if(!_[_0x3083('0x3f')](_0x408830[_0x54a515])){this[_0x3083('0xb')][_0x3083('0x9a')](util['format']('%s.%s',_0x302396,_0x54a515),_0x408830[_0x54a515]);}}}}};AGIVertices['prototype'][_0x3083('0x92')]=function(_0x265c44){try{var _0x16be43=JSON[_0x3083('0x66')](_0x265c44);this['recursiveNodeIndex'](_0x16be43);return JSON['stringify'](_0x16be43);}catch(_0x2568d4){return this[_0x3083('0x97')](_0x265c44);}};AGIVertices[_0x3083('0xe')][_0x3083('0x97')]=function(_0x1b6508){var _0x1f8522=_0x1b6508[_0x3083('0x9b')]('{');for(var _0x420a33=0x1;_0x420a33<_0x1f8522[_0x3083('0x95')];_0x420a33+=0x1){var _0x3c6eb9=_0x1f8522[_0x420a33][_0x3083('0x9b')]('}');if(_0x3c6eb9[_0x3083('0x95')]>0x1){_0x1b6508=_0x1b6508[_0x3083('0x9c')]('{'+_0x3c6eb9[0x0]+'}',this['channel'][_0x3083('0xf')](_0x3c6eb9[0x0])['extra']||_0x3c6eb9[0x0]);}}if(_0x1f8522['length']===0x1){return _0x1b6508[_0x3083('0x48')]();}return this[_0x3083('0x97')](_0x1b6508);};AGIVertices[_0x3083('0xe')][_0x3083('0x9d')]=function(_0x113bb2,_0x1c9680){var _0x13ad38=this[_0x3083('0xb')][_0x3083('0xf')](_0x113bb2);if(_0x13ad38[_0x3083('0x9e')]===-0x1){return _0x13ad38;}logger[_0x3083('0x27')](util[_0x3083('0x24')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x1c9680,_0x13ad38[_0x3083('0x9f')]));return this[_0x3083('0xb')]['setVariable'](_0x1c9680,_0x13ad38[_0x3083('0x9f')]);};AGIVertices[_0x3083('0xe')][_0x3083('0x81')]=function(_0xad0a7d){return _0xad0a7d&&_0xad0a7d!=='0'&&_0xad0a7d!=='-1'&&_0xad0a7d!=='';};AGIVertices[_0x3083('0xe')][_0x3083('0xa0')]=function(_0x49831d){this['createSquareDetailsReport'][_0x3083('0x6b')](this,_0x49831d,'-');_0x49831d['retry']=_0x49831d[_0x3083('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3083('0xe')][_0x3083('0xa1')]=function(_0x38767e){logger['info'](util[_0x3083('0x24')](_0x3083('0xa2'),_0x38767e[_0x3083('0x31')]));if(!this['isConfigured'](_0x38767e[_0x3083('0x56')])){return this[_0x3083('0xb')]['noop']('no\x20text\x20configured');}var _0x4853a2='\x22'+_0x38767e['text']+'\x22';if(this[_0x3083('0x81')](_0x38767e[_0x3083('0x73')])){_0x4853a2+=','+_0x38767e[_0x3083('0x73')];}var _0x3711f7=this['channel'][_0x3083('0x52')](_0x3083('0xa3'),_0x4853a2);if(_0x3711f7[_0x3083('0x9e')]===-0x1){return _0x3711f7;}return this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4853a2));};AGIVertices['prototype'][_0x3083('0xa5')]=function(_0x592bc3){logger['info'](util[_0x3083('0x24')](_0x3083('0xa6'),_0x592bc3[_0x3083('0x31')]));if(!this['isConfigured'](_0x592bc3['grammar'])){return this['channel'][_0x3083('0xa4')](_0x3083('0xa7'));}var _0x24cb46=_0x592bc3['grammar'];if(this[_0x3083('0x81')](_0x592bc3[_0x3083('0x73')])){_0x24cb46+=','+_0x592bc3[_0x3083('0x73')];}var _0x5286fa=this[_0x3083('0xb')][_0x3083('0x52')](_0x3083('0xa8'),_0x24cb46);if(_0x5286fa[_0x3083('0x9e')]===-0x1){return _0x5286fa;}var _0x3ad258=this[_0x3083('0x9d')](_0x3083('0xa9'),_0x3083('0xaa'));if(_0x3ad258['result']===-0x1){return _0x3ad258;}var _0x2a3414=this[_0x3083('0x9d')]('RECOG_INPUT()',_0x3083('0xab'));if(_0x2a3414[_0x3083('0x9e')]===-0x1){return _0x2a3414;}var _0x25e468=this['getAndSetVariable'](_0x3083('0xac'),'MRCP_RECOG_INSTANCE');if(_0x25e468[_0x3083('0x9e')]===-0x1){return _0x25e468;}return this[_0x3083('0xb')]['noop'](util['format'](_0x3083('0xad'),_0x24cb46));};AGIVertices[_0x3083('0xe')][_0x3083('0xae')]=function(_0x251e04){logger[_0x3083('0x27')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x251e04['label']));return this[_0x3083('0xb')][_0x3083('0xae')]([_0x251e04[_0x3083('0xaf')],_0x251e04[_0x3083('0xb0')]]);};AGIVertices[_0x3083('0xe')][_0x3083('0xb1')]=function(_0x47edba){logger[_0x3083('0x27')](util[_0x3083('0x24')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x47edba[_0x3083('0x31')]));if(this[_0x3083('0x81')](_0x47edba[_0x3083('0x60')])){logger['info'](util[_0x3083('0x24')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x47edba[_0x3083('0x60')]));var _0x18edff=this['channel']['wait'](_0x47edba[_0x3083('0x60')]);if(_0x18edff[_0x3083('0x9e')]===-0x1){return _0x18edff;}}return this[_0x3083('0xb')][_0x3083('0xb1')]();};AGIVertices['prototype'][_0x3083('0x46')]=function(_0x27545c){logger['info'](util['format'](_0x3083('0xb2'),_0x27545c[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x27545c[_0x3083('0x44')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x27545c,_0x3083('0xb3'));}_0x27545c['scheduledAt']=moment();if(this[_0x3083('0x81')](_0x27545c[_0x3083('0xb4')])){_0x27545c[_0x3083('0x45')]=moment()['add'](_0x27545c['delay'],_0x3083('0xb5'));}if(!this[_0x3083('0x81')](_0x27545c[_0x3083('0x49')])){_0x27545c[_0x3083('0x49')]=0x2;}this[_0x3083('0x3d')]['sync'](this,_0x27545c);return this['channel']['noop'](util[_0x3083('0x24')](_0x3083('0xb6'),_0x27545c[_0x3083('0x43')],_0x27545c[_0x3083('0x44')],_0x27545c[_0x3083('0x45')]));};AGIVertices[_0x3083('0xe')][_0x3083('0xb7')]=function(_0x59419d){logger['info'](util[_0x3083('0x24')](_0x3083('0xb8'),_0x59419d[_0x3083('0x31')]));var _0x3bf77a=this[_0x3083('0xb')][_0x3083('0x52')](_0x59419d[_0x3083('0xb9')],_0x59419d[_0x3083('0x73')]);if(_0x3bf77a[_0x3083('0x9e')]===-0x1){return _0x3bf77a;}return this['channel'][_0x3083('0xa4')](util['format'](_0x3083('0xba'),_0x59419d[_0x3083('0xb9')],_0x59419d['options']));};AGIVertices[_0x3083('0xe')][_0x3083('0xbb')]=function(_0x15eb51){logger['info'](util[_0x3083('0x24')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x15eb51[_0x3083('0x31')]));if(!this['isConfigured'](_0x15eb51['text'])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xbc'));}var _0x259b2b='\x22'+_0x15eb51['text']+'\x22';if(this[_0x3083('0x81')](_0x15eb51['options'])){_0x259b2b+=','+_0x15eb51[_0x3083('0x73')];}var _0x165277=this[_0x3083('0xb')][_0x3083('0x52')]('MRCPSynth',_0x259b2b);if(_0x165277[_0x3083('0x9e')]===-0x1){return _0x165277;}return this[_0x3083('0xb')][_0x3083('0xa4')](util['format'](_0x3083('0xbd'),_0x259b2b));};AGIVertices[_0x3083('0xe')][_0x3083('0xbe')]=function(_0x298a5e){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0xbf'),_0x298a5e[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x298a5e['text'])){return this[_0x3083('0xb')][_0x3083('0xa4')]('no\x20text\x20configured');}var _0x2bed10='\x22'+_0x298a5e[_0x3083('0x56')]+'\x22';if(this[_0x3083('0x81')](_0x298a5e[_0x3083('0x73')])){_0x2bed10+=','+_0x298a5e[_0x3083('0x73')];}var _0x12598d=this[_0x3083('0xb')][_0x3083('0x52')](_0x3083('0xa3'),_0x2bed10);if(_0x12598d['result']===-0x1){return _0x12598d;}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0xbd'),_0x2bed10));};AGIVertices[_0x3083('0xe')][_0x3083('0xc0')]=function(_0x58bcc8){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0xc1'),_0x58bcc8[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x58bcc8[_0x3083('0xc2')])){return this[_0x3083('0xb')][_0x3083('0xa4')]('no\x20grammar\x20configured');}var _0x15414f=_0x58bcc8[_0x3083('0xc2')];if(this[_0x3083('0x81')](_0x58bcc8[_0x3083('0x73')])){_0x15414f+=','+_0x58bcc8[_0x3083('0x73')];}var _0x22e3c4=this[_0x3083('0xb')][_0x3083('0x52')]('MRCPRecog',_0x15414f);if(_0x22e3c4[_0x3083('0x9e')]===-0x1){return _0x22e3c4;}var _0x21f69d=this[_0x3083('0x9d')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x21f69d['result']===-0x1){return _0x21f69d;}var _0x531676=this[_0x3083('0x9d')](_0x3083('0xc3'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x531676[_0x3083('0x9e')]===-0x1){return _0x531676;}var _0x302694=this['getAndSetVariable']('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x302694[_0x3083('0x9e')]===-0x1){return _0x302694;}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')]('Executed\x20command\x20MRCPRecog\x20%s',_0x15414f));};AGIVertices[_0x3083('0xe')][_0x3083('0xc4')]=function(_0x5141d0){logger[_0x3083('0x27')](util[_0x3083('0x24')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5141d0[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x5141d0['grammar'])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xa7'));}var _0x5b598d=_0x5141d0[_0x3083('0xc2')];if(this[_0x3083('0x81')](_0x5141d0[_0x3083('0x73')])){_0x5b598d+=','+_0x5141d0['options'];}var _0x15ac09=this[_0x3083('0xb')][_0x3083('0x52')](_0x3083('0xa8'),_0x5b598d);if(_0x15ac09['result']===-0x1){return _0x15ac09;}var _0x4e62aa=this[_0x3083('0x9d')](_0x3083('0xa9'),_0x3083('0xc5'));if(_0x4e62aa[_0x3083('0x9e')]===-0x1){return _0x4e62aa;}var _0x1e18eb=this[_0x3083('0x9d')](_0x3083('0xc3'),_0x3083('0xc6'));if(_0x1e18eb['result']===-0x1){return _0x1e18eb;}var _0x4b15e5=this[_0x3083('0x9d')](_0x3083('0xac'),_0x3083('0xc7'));if(_0x4b15e5[_0x3083('0x9e')]===-0x1){return _0x4b15e5;}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0xad'),_0x5b598d));};AGIVertices[_0x3083('0xe')]['database']=function(_0x1d8c8e){logger['info'](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x1d8c8e[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x1d8c8e['odbc_id'])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x1d8c8e,_0x3083('0xc8'));}var _0x4bb641=this[_0x3083('0x16')][_0x3083('0x6b')](this,_0x1d8c8e[_0x3083('0xc9')]);if(!_0x4bb641){return this[_0x3083('0xb')]['error'](_0x1d8c8e,_0x3083('0xca'));}if(!this['isConfigured'](_0x1d8c8e[_0x3083('0x29')])){return this['channel'][_0x3083('0x26')](_0x1d8c8e,_0x3083('0xcb'));}var _0x3a8122=_0x1d8c8e[_0x3083('0x29')][_0x3083('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x3083('0xb')][_0x3083('0xa4')](util['format'](_0x3083('0xcc'),_0x3a8122));var _0x5c9913=this[_0x3083('0x25')]['sync'](this,_0x4bb641,_0x3a8122);this[_0x3083('0x30')][_0x3083('0x6b')](this,_0x1d8c8e,_0x3a8122);if(!this[_0x3083('0x81')](_0x1d8c8e[_0x3083('0xcd')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xce'));}var _0x42a74c=this[_0x3083('0xf')]['sync'](this,_0x1d8c8e['variable_id']);if(!_0x42a74c){return this[_0x3083('0xb')][_0x3083('0x26')](_0x1d8c8e,_0x3083('0xcf'));}var _0x560bc7=this;_0x5c9913[_0x3083('0xd0')](function(_0x919499,_0x1abbac){Object[_0x3083('0xd1')](_0x919499)[_0x3083('0xd0')](function(_0x4f5118){_0x560bc7[_0x3083('0xb')][_0x3083('0x9a')](util[_0x3083('0x24')](_0x3083('0xd2'),_0x42a74c,_0x1abbac,_0x4f5118),_0x919499[_0x4f5118]);});});this['channel'][_0x3083('0x9a')](util[_0x3083('0x24')](_0x3083('0xd3'),_0x42a74c),_0x5c9913[_0x3083('0x95')]);return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0xd4'),_0x42a74c));};AGIVertices[_0x3083('0xe')][_0x3083('0xd5')]=function(_0xe970a9){logger[_0x3083('0xd6')](util['format'](_0x3083('0xd7'),_0xe970a9['label']));if(!this['isConfigured'](_0xe970a9[_0x3083('0xd8')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0xe970a9,_0x3083('0xd9'));}var _0x3ec2b4=this[_0x3083('0xda')][_0x3083('0x6b')](this,_0xe970a9[_0x3083('0xd8')]);if(!_0x3ec2b4){return this['channel']['error'](_0xe970a9,_0x3083('0xdb'));}var _0x1630d9=this['channel'][_0x3083('0x52')](_0x3083('0xdc'),[util[_0x3083('0x24')](_0x3083('0xdd'),_0x3ec2b4),_0xe970a9[_0x3083('0x60')],_0xe970a9['opts'],_0xe970a9[_0x3083('0x5e')]]);if(_0x1630d9['result']===-0x1){return _0x1630d9;}return this[_0x3083('0xb')][_0x3083('0xa4')](util['format']('Executed\x20command\x20%s',_0x3083('0xdc')));};AGIVertices[_0x3083('0xe')]['dialogflow']=function(_0xe91ebe){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0xde'),_0xe91ebe[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0xe91ebe['key'])){return this[_0x3083('0xb')]['noop']('no\x20key\x20configured');}if(!this[_0x3083('0x81')](_0xe91ebe[_0x3083('0x56')])){return this['channel'][_0x3083('0xa4')](_0x3083('0xbc'));}this[_0x3083('0xb')][_0x3083('0xdf')]=!![];this['createSquareDetailsReport'](_0xe91ebe);this['createSquareMessage'](_0xe91ebe[_0x3083('0x56')],'in','','');this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')]('Trying\x20Dialogflow:\x20%s',_0xe91ebe[_0x3083('0x56')]));var _0x1050ee=this[_0x3083('0x74')][_0x3083('0x6b')](this,_0xe91ebe);if(_0x1050ee){for(var _0xff62c6 in _0x1050ee){if(_0x1050ee[_0x3083('0x91')](_0xff62c6)){this['channel'][_0x3083('0x9a')](util['format']('DIALOGFLOW_%s',_0xff62c6[_0x3083('0x65')]()),_0x1050ee[_0xff62c6]);}}this[_0x3083('0x3c')](_0x1050ee[_0x3083('0xe0')],'out',_0x3083('0xe1'),'');return this[_0x3083('0xb')]['noop'](util['format'](_0x3083('0xe2'),_0x1050ee[_0x3083('0xe0')]));}return this['channel'][_0x3083('0x26')](_0xe91ebe,_0x3083('0xe3'));};AGIVertices[_0x3083('0xe')]['dialogflowV2']=function(_0x476ec0){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0xe4'),_0x476ec0[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x476ec0['dialogflowV2_project_id'])){return this['channel'][_0x3083('0xa4')](_0x3083('0xe5'));}if(!this[_0x3083('0x81')](_0x476ec0['client_email'])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xe6'));}if(!this[_0x3083('0x81')](_0x476ec0['private_key'])){return this[_0x3083('0xb')]['noop'](_0x3083('0xe7'));}if(!this['isConfigured'](_0x476ec0[_0x3083('0x7a')])){return this['channel']['noop'](_0x3083('0xe8'));}if(!this[_0x3083('0x81')](_0x476ec0['text'])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xbc'));}this['channel'][_0x3083('0xdf')]=!![];this[_0x3083('0x30')](_0x476ec0);this[_0x3083('0x3c')](_0x476ec0[_0x3083('0x56')],'in','','');this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')]('Trying\x20DialogflowV2:\x20%s',_0x476ec0[_0x3083('0x56')]));var _0x5f4fce=this[_0x3083('0x77')][_0x3083('0x6b')](this,_0x476ec0);if(_0x5f4fce){for(var _0x3eefd3 in _0x5f4fce){if(_0x5f4fce[_0x3083('0x91')](_0x3eefd3)){if(_0x3eefd3!==_0x3083('0xe9')){this['channel'][_0x3083('0x9a')](util[_0x3083('0x24')](_0x3083('0xea'),_0x3eefd3[_0x3083('0x65')]()),_0x5f4fce[_0x3eefd3]);}}}this['createSquareMessage'](_0x5f4fce[_0x3083('0xe0')],_0x3083('0xeb'),_0x3083('0xec'),_0x5f4fce[_0x3083('0xe9')]);return this[_0x3083('0xb')]['noop'](util[_0x3083('0x24')]('DialogflowV2\x20Result\x20%s',_0x5f4fce['speech']));}return this[_0x3083('0xb')][_0x3083('0x26')](_0x476ec0,_0x3083('0xed'));};AGIVertices['prototype']['sesteknda']=function(_0x29c4e7){logger['info'](util[_0x3083('0x24')](_0x3083('0xee'),_0x29c4e7[_0x3083('0x31')]));if(!this['isConfigured'](_0x29c4e7[_0x3083('0xef')])){return this[_0x3083('0xb')][_0x3083('0xa4')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x3083('0x81')](_0x29c4e7['username'])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xf0'));}if(!this[_0x3083('0x81')](_0x29c4e7[_0x3083('0xf1')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xf2'));}if(!this[_0x3083('0x81')](_0x29c4e7[_0x3083('0xf3')])){return this['channel'][_0x3083('0xa4')](_0x3083('0xbc'));}this[_0x3083('0xb')][_0x3083('0xdf')]=!![];this[_0x3083('0x30')](_0x29c4e7);this['createSquareMessage'](_0x29c4e7[_0x3083('0x56')],'in','','');this[_0x3083('0xb')]['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x29c4e7[_0x3083('0x56')]));var _0x5039be=this['sestekNDA']['sync'](this,_0x29c4e7);if(_0x5039be){for(var _0x1368e4 in _0x5039be){if(_0x5039be[_0x3083('0x91')](_0x1368e4)){this[_0x3083('0xb')][_0x3083('0x9a')](util[_0x3083('0x24')]('SESTEK_NDA_%s',_0x1368e4[_0x3083('0x65')]()),_0x5039be[_0x1368e4]);}}this['createSquareMessage'](_0x5039be[_0x3083('0xe0')],'out',_0x3083('0xf4'),'');if(_0x5039be[_0x3083('0xf5')]){this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0xf6'),_0x5039be[_0x3083('0xf5')]));var _0x57fcb0=this['channel'][_0x3083('0xf7')](_0x5039be['audiofile']);try{fs[_0x3083('0xf8')](_0x5039be[_0x3083('0xf5')]+_0x3083('0xf9'));}catch(_0x27eaea){logger['error'](_0x27eaea);}return _0x57fcb0;}else{return this['channel']['noop'](util['format'](_0x3083('0xfa'),_0x5039be['speech']));}}return this[_0x3083('0xb')]['error'](_0x29c4e7,_0x3083('0xfb'));};AGIVertices[_0x3083('0xe')]['end']=function(_0x480542){logger['info'](util[_0x3083('0x24')](_0x3083('0xfc'),_0x480542[_0x3083('0x31')]));return this[_0x3083('0xb')]['noop'](_0x3083('0xfd'));};AGIVertices['prototype']['ext_dial']=function(_0x60f53c){logger[_0x3083('0x27')](util[_0x3083('0x24')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x60f53c[_0x3083('0x31')]));var _0x4f923f='';if(_0x60f53c[_0x3083('0xfe')]){if(!this[_0x3083('0x81')](_0x60f53c[_0x3083('0xfe')])){return this['channel']['error'](_0x60f53c,_0x3083('0xff'));}else{var _0x244ec9=parseInt(_0x60f53c[_0x3083('0xfe')],0xa);if(isNaN(_0x244ec9)){_0x4f923f=_0x60f53c['trunk_id'];}else{_0x4f923f=this[_0x3083('0x1a')][_0x3083('0x6b')](this,_0x60f53c[_0x3083('0xfe')]);if(!_0x4f923f){return this[_0x3083('0xb')][_0x3083('0x26')](_0x60f53c,_0x3083('0x100'));}}}}else if(_0x60f53c['trunk_name']){_0x4f923f=_0x60f53c[_0x3083('0x101')];}else{return this[_0x3083('0xb')][_0x3083('0x26')](_0x60f53c,_0x3083('0xff'));}var _0x35652e=this['channel']['exec'](_0x3083('0xdc'),[util[_0x3083('0x24')](_0x3083('0x102'),_0x4f923f,_0x60f53c[_0x3083('0x43')]),_0x60f53c[_0x3083('0x60')],_0x60f53c['opts'],_0x60f53c[_0x3083('0x5e')]]);if(_0x35652e[_0x3083('0x9e')]===-0x1){return _0x35652e;}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')]('Executed\x20command\x20%s',_0x3083('0xdc')));};AGIVertices[_0x3083('0xe')]['finally']=function(_0x1f5443){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x103'),_0x1f5443[_0x3083('0x31')]));return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x104'));};AGIVertices[_0x3083('0xe')][_0x3083('0x105')]=function(_0x296bb2){logger[_0x3083('0x27')](util['format'](_0x3083('0x106'),_0x296bb2[_0x3083('0x31')]));if(_0x296bb2[_0x3083('0x107')]===0x0){return this[_0x3083('0xa0')](_0x296bb2);}_0x296bb2['retry']-=0x1;if(!this[_0x3083('0x81')](_0x296bb2[_0x3083('0x108')])){return this[_0x3083('0xb')]['error'](_0x296bb2,_0x3083('0x109'));}var _0x54c1b9=this[_0x3083('0x1b')][_0x3083('0x6b')](this,_0x296bb2[_0x3083('0x108')]);if(!_0x54c1b9){return this[_0x3083('0xb')][_0x3083('0x26')](_0x296bb2,_0x3083('0x10a'));}if(!this[_0x3083('0x81')](_0x296bb2[_0x3083('0xcd')])){return this[_0x3083('0xb')]['error'](_0x3083('0xce'));}var _0xf167b=this[_0x3083('0xb')][_0x3083('0x10b')](_0x54c1b9,_0x296bb2[_0x3083('0x10c')],_0x296bb2['maxdigit']);var _0x2c766b=_0xf167b[_0x3083('0x9e')]?_0xf167b[_0x3083('0x9e')]['toString']():'';logger['info'](_0x3083('0x10d'),JSON[_0x3083('0x6f')](_0xf167b));if(_0xf167b[_0x3083('0x9e')]===-0x1){this[_0x3083('0x30')][_0x3083('0x6b')](this,_0x296bb2,_0x2c766b);return _0xf167b;}else if(_0xf167b[_0x3083('0x9f')]===_0x3083('0x60')){_0xf167b[_0x3083('0x9e')]=_0x2c766b['length']>=parseInt(_0x296bb2[_0x3083('0x10e')])?'x':'i';}else{_0xf167b[_0x3083('0x9e')]=_0x2c766b[_0x3083('0x95')]>=parseInt(_0x296bb2[_0x3083('0x10e')])&&_0x2c766b[_0x3083('0x95')]<=parseInt(_0x296bb2[_0x3083('0x10f')])?'x':'i';}var _0x36fc03=this[_0x3083('0xf')][_0x3083('0x6b')](this,_0x296bb2[_0x3083('0xcd')]);if(!_0x36fc03){return this['channel']['error'](_0x296bb2,_0x3083('0xcf'));}this['channel'][_0x3083('0x9a')](_0x36fc03,_0x2c766b);if(this[_0x3083('0x81')](_0x296bb2[_0x3083('0x110')])){var _0x3bf641=parseInt(_0x296bb2[_0x3083('0x110')],0xa);var _0xcaffa0=rs[_0x3083('0x111')]({'charset':'*','length':_0x3bf641});var _0x4e6046=_0x2c766b[_0x3083('0x95')];if(_0x4e6046>0x0){if(_0x4e6046>_0x3bf641){this['createSquareDetailsReport']['sync'](this,_0x296bb2,_0x296bb2['hiddendigitspos']===_0x3083('0x112')?_0xcaffa0+_0x2c766b[_0x3083('0x113')](_0x3bf641):_0x2c766b[_0x3083('0x113')](0x0,_0x4e6046-_0x3bf641)+_0xcaffa0);}else{this['createSquareDetailsReport'][_0x3083('0x6b')](this,_0x296bb2,rs[_0x3083('0x111')]({'charset':'*','length':_0x4e6046}));}}else{this['createSquareDetailsReport'][_0x3083('0x6b')](this,_0x296bb2,'');}}else{this['createSquareDetailsReport'][_0x3083('0x6b')](this,_0x296bb2,_0x2c766b);}return _0xf167b;};AGIVertices['prototype'][_0x3083('0x114')]=function(_0x10330c){logger[_0x3083('0x27')](util[_0x3083('0x24')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x10330c[_0x3083('0x31')]));return this['getdigits'](_0x10330c);};AGIVertices[_0x3083('0xe')][_0x3083('0x115')]=function(_0x2ef4e4){logger['info'](util[_0x3083('0x24')](_0x3083('0x116'),_0x2ef4e4[_0x3083('0x31')]));this[_0x3083('0x30')][_0x3083('0x6b')](this,_0x2ef4e4,_0x2ef4e4[_0x3083('0x117')]);return this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x118'),_0x2ef4e4[_0x3083('0x117')]));};AGIVertices[_0x3083('0xe')]['awspolly']=function(_0x570127){logger[_0x3083('0x27')](util['format'](_0x3083('0x119'),_0x570127['label']));if(!this[_0x3083('0x81')](_0x570127['aws_access_key_id'])||!this[_0x3083('0x81')](_0x570127[_0x3083('0x84')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x11a'));}if(!this['isConfigured'](_0x570127[_0x3083('0x56')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xbc'));}this['channel'][_0x3083('0xa4')](util['format'](_0x3083('0x11b'),_0x570127['text']));var _0x5a5054=this[_0x3083('0x83')][_0x3083('0x6b')](this,_0x570127);if(_0x5a5054){this[_0x3083('0xb')]['noop'](util[_0x3083('0x24')](_0x3083('0x11c'),_0x5a5054));var _0x390fb0=this[_0x3083('0xb')][_0x3083('0xf7')](_0x5a5054);try{fs['unlink'](_0x5a5054+_0x3083('0xf9'));}catch(_0x5a43cd){logger[_0x3083('0x26')](_0x5a43cd);}return _0x390fb0;}return this[_0x3083('0xb')]['error'](_0x570127,_0x3083('0x11d'));};AGIVertices[_0x3083('0xe')][_0x3083('0x11e')]=function(_0x1076ed){logger['info'](util[_0x3083('0x24')](_0x3083('0x11f'),_0x1076ed[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x1076ed['aws_access_key_id'])||!this['isConfigured'](_0x1076ed[_0x3083('0x84')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x11a'));}if(!this[_0x3083('0x81')](_0x1076ed[_0x3083('0x8b')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x120'));}if(!this['isConfigured'](_0x1076ed[_0x3083('0x56')])){return this[_0x3083('0xb')][_0x3083('0xa4')]('no\x20text\x20configured');}this[_0x3083('0xb')]['bot']=!![];this[_0x3083('0x30')](_0x1076ed);this['createSquareMessage'](_0x1076ed['text'],'in','','');this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x121'),_0x1076ed[_0x3083('0x56')]));var _0xf7e6da=this['awsLex'][_0x3083('0x6b')](this,_0x1076ed);if(_0xf7e6da){for(var _0xacf661 in _0xf7e6da){if(_0xf7e6da['hasOwnProperty'](_0xacf661)&&_[_0x3083('0x96')](_0xf7e6da[_0xacf661])){this[_0x3083('0xb')]['setVariable'](util[_0x3083('0x24')]('AWS_LEX_%s',_0xacf661[_0x3083('0x65')]()),_0xf7e6da[_0xacf661]);}}if(_[_0x3083('0x3f')](_0xf7e6da['message'])){return this[_0x3083('0xb')][_0x3083('0xa4')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x3083('0x3c')](_0xf7e6da[_0x3083('0x72')],'out',_0x3083('0x122'),'');return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x123'),_0xf7e6da[_0x3083('0x72')]));}}return this[_0x3083('0xb')]['error'](_0x1076ed,_0x3083('0x124'));};AGIVertices[_0x3083('0xe')][_0x3083('0x125')]=function(_0x130864){logger[_0x3083('0x27')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x130864[_0x3083('0x31')],_0x130864[_0x3083('0x60')]));if(!this[_0x3083('0x81')](_0x130864[_0x3083('0x75')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x126'));}var _0x2f83ac=_0x3083('0x127');var _0x46fc72=util[_0x3083('0x24')](_0x3083('0x128'),FILES_PATH,rs[_0x3083('0x111')](0x4));var _0xe299=util[_0x3083('0x24')](_0x3083('0x98'),_0x46fc72,_0x2f83ac);var _0x3c2f73=!![];if(_0x130864['beep']==='NOBEEP'){_0x3c2f73=![];}var _0x5a5452=this[_0x3083('0xb')]['recordFile'](_0x46fc72,_0x2f83ac,_0x130864[_0x3083('0x129')],_0x130864['timeout'],undefined,_0x3c2f73);if(_0x5a5452['result']!==-0x1){this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x12a'),_0xe299));var _0x13a52b=this['googleASR'][_0x3083('0x6b')](this,_0x130864,_0xe299);if(_0x13a52b){for(var _0x1e76c4 in _0x13a52b){if(_0x13a52b[_0x3083('0x91')](_0x1e76c4)){this[_0x3083('0xb')]['setVariable'](util[_0x3083('0x24')](_0x3083('0x12b'),_0x1e76c4['toUpperCase']()),_0x13a52b[_0x1e76c4]);}}return this['channel'][_0x3083('0xa4')](util['format'](_0x3083('0x12c'),JSON[_0x3083('0x6f')](_0x13a52b)));}}return _0x5a5452;};AGIVertices[_0x3083('0xe')][_0x3083('0x12d')]=function(_0xe43471){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x12e'),_0xe43471[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0xe43471['appid'])){return this['channel']['noop'](_0x3083('0x12f'));}if(!this[_0x3083('0x81')](_0xe43471[_0x3083('0x130')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x131'));}var _0x309245=_0x3083('0x127');var _0x2e8e7f=util[_0x3083('0x24')]('%s/recordings/%s',FILES_PATH,rs[_0x3083('0x111')](0x4));var _0x1c3334=util[_0x3083('0x24')]('%s.%s',_0x2e8e7f,_0x309245);var _0x3eb835=!![];if(_0xe43471[_0x3083('0x132')]===_0x3083('0x133')){_0x3eb835=![];}var _0x394ab7=this['channel']['recordFile'](_0x2e8e7f,_0x309245,_0xe43471[_0x3083('0x129')],_0xe43471['timeout'],undefined,_0x3eb835);if(_0x394ab7[_0x3083('0x9e')]!==-0x1){this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x134'),_0x1c3334));var _0x3ae2b2=this[_0x3083('0x8d')]['sync'](this,_0xe43471,_0x1c3334);if(_0x3ae2b2){for(var _0x287634 in _0x3ae2b2){if(_0x3ae2b2['hasOwnProperty'](_0x287634)){this[_0x3083('0xb')][_0x3083('0x9a')](util['format']('TILDE_ASR_%s',_0x287634['toUpperCase']()),_0x3ae2b2[_0x287634]);}}return this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x135'),JSON[_0x3083('0x6f')](_0x3ae2b2)));}}return _0x394ab7;};AGIVertices[_0x3083('0xe')][_0x3083('0x136')]=function(_0x3dc206){logger[_0x3083('0x27')](util['format'](_0x3083('0x137'),_0x3dc206[_0x3083('0x31')]));return this[_0x3083('0xb')]['continueAt'](_0x3dc206[_0x3083('0x36')],_0x3dc206[_0x3083('0x37')],_0x3dc206[_0x3083('0x38')]);};AGIVertices[_0x3083('0xe')][_0x3083('0x138')]=function(_0x33d327){logger['info'](util[_0x3083('0x24')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x33d327[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x33d327[_0x3083('0x139')])){return this[_0x3083('0xb')]['error'](_0x33d327,_0x3083('0x13a'));}try{var _0x4ad6bf=eval(_0x33d327['condition'])?_0x3083('0x13b'):'false';this['channel']['noop'](util['format'](_0x3083('0x13c'),_0x33d327[_0x3083('0x139')],_0x4ad6bf));return{'code':0xc8,'result':_0x4ad6bf};}catch(_0x39a27d){return{'code':0xc8,'result':_0x3083('0x13d')};}};AGIVertices[_0x3083('0xe')][_0x3083('0x13e')]=function(_0x4d4577){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x13f'),_0x4d4577[_0x3083('0x31')]));if(!this['isConfigured'](_0x4d4577[_0x3083('0x140')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x4d4577,_0x3083('0x141'));}var _0x1308ac=this[_0x3083('0x1f')][_0x3083('0x6b')](this,_0x4d4577[_0x3083('0x140')]);if(!_0x1308ac){return this['channel']['error'](_0x4d4577,_0x3083('0x142'));}for(var _0x20288f=0x0;_0x20288f<_0x1308ac[_0x3083('0x95')];_0x20288f+=0x1){var _0x10db2e=this['channel'][_0x3083('0xf')](util[_0x3083('0x24')](_0x3083('0x143'),_0x1308ac[_0x20288f]));if(_0x10db2e['result']===-0x1){return _0x10db2e;}logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x144'),_0x1308ac[_0x20288f],_0x10db2e[_0x3083('0x9f')]));if(_0x10db2e['extra']===_0x3083('0x13b')){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x144'),_0x1308ac[_0x20288f],_0x3083('0x13b')));this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x144'),_0x1308ac[_0x20288f],_0x3083('0x13b')));return{'code':0xc8,'result':'true'};}else{logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x144'),_0x1308ac[_0x20288f],_0x3083('0x13d')));this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x144'),_0x1308ac[_0x20288f],_0x3083('0x13d')));}}return{'code':0xc8,'result':_0x3083('0x13d')};};AGIVertices[_0x3083('0xe')]['hangup']=function(_0x4af5fa){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x145'),_0x4af5fa[_0x3083('0x31')]));return this[_0x3083('0xb')][_0x3083('0x146')]();};AGIVertices[_0x3083('0xe')][_0x3083('0x147')]=function(_0x281ff3){logger[_0x3083('0x27')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x281ff3[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x281ff3[_0x3083('0x75')])){return this[_0x3083('0xb')]['noop']('no\x20key\x20configured');}var _0x39c619=_0x3083('0x127');var _0x3ec12b=util['format'](_0x3083('0x128'),FILES_PATH,rs['generate'](0x4));var _0xb900a8=util[_0x3083('0x24')](_0x3083('0x98'),_0x3ec12b,_0x39c619);var _0x5d3e10=!![];if(_0x281ff3[_0x3083('0x132')]==='NOBEEP'){_0x5d3e10=![];}var _0x43cc0b=this[_0x3083('0xb')]['recordFile'](_0x3ec12b,_0x39c619,_0x281ff3[_0x3083('0x129')],_0x281ff3[_0x3083('0x60')],undefined,_0x5d3e10);if(_0x43cc0b[_0x3083('0x9e')]!==-0x1){this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x148'),_0xb900a8));var _0x187643=this[_0x3083('0x7f')]['sync'](this,_0x281ff3,_0xb900a8);if(_0x187643){for(var _0x193868 in _0x187643){if(_0x187643['hasOwnProperty'](_0x193868)){this[_0x3083('0xb')][_0x3083('0x9a')](util[_0x3083('0x24')](_0x3083('0x149'),_0x193868['toUpperCase']()),_0x187643[_0x193868]);}}return this[_0x3083('0xb')]['noop'](util[_0x3083('0x24')]('IspeechASR\x20Result\x20%s',JSON[_0x3083('0x6f')](_0x187643)));}}return _0x43cc0b;};AGIVertices[_0x3083('0xe')][_0x3083('0x14a')]=function(_0x46e39d){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x14b'),_0x46e39d[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x46e39d['key'])){return this[_0x3083('0xb')]['noop'](_0x3083('0x126'));}if(!this[_0x3083('0x81')](_0x46e39d[_0x3083('0x56')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0xbc'));}this[_0x3083('0xb')][_0x3083('0xa4')](util['format'](_0x3083('0x14c'),_0x46e39d[_0x3083('0x56')]));var _0x1679db=this[_0x3083('0x7c')][_0x3083('0x6b')](this,_0x46e39d);if(_0x1679db){this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x148'),_0x1679db));var _0x2b047a=this[_0x3083('0xb')][_0x3083('0xf7')](_0x1679db,_0x46e39d['intKey']);try{fs[_0x3083('0xf8')](_0x1679db+_0x3083('0xf9'));}catch(_0x3050be){logger[_0x3083('0x26')](_0x3050be);}return _0x2b047a;}return this['channel']['error'](_0x46e39d,_0x3083('0x14d'));};AGIVertices['prototype'][_0x3083('0x14e')]=function(_0x29dcc6){logger[_0x3083('0x27')](util['format'](_0x3083('0x14f'),_0x29dcc6['label']));if(!this['isConfigured'](_0x29dcc6[_0x3083('0x150')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x29dcc6,_0x3083('0x151'));}logger['info'](util['format'](_0x3083('0x152'),this['channel'][_0x3083('0x35')],_0x29dcc6['findBy']));var _0x4d30ad=this[_0x3083('0x50')][_0x3083('0x6b')](this,_0x29dcc6[_0x3083('0x150')]);if(_0x4d30ad){logger[_0x3083('0x27')](util['format'](_0x3083('0x153'),this['channel'][_0x3083('0x35')],_0x29dcc6['findBy']));this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x153'),this[_0x3083('0xb')][_0x3083('0x35')],_0x29dcc6[_0x3083('0x150')]));return{'code':0xc8,'result':_0x3083('0x154')};}else{logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x155'),this[_0x3083('0xb')][_0x3083('0x35')],_0x29dcc6[_0x3083('0x150')]));this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3083('0xb')]['callerid'],_0x29dcc6['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x3083('0xe')][_0x3083('0x156')]=function(_0x30ee5d){logger['info'](util[_0x3083('0x24')](_0x3083('0x157'),_0x30ee5d['label']));if(!this[_0x3083('0x81')](_0x30ee5d[_0x3083('0x150')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x30ee5d,_0x3083('0x151'));}logger[_0x3083('0x27')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x3083('0x35')],_0x30ee5d[_0x3083('0x150')]));var _0x4ec144=this['agentLogout'][_0x3083('0x6b')](this,_0x30ee5d[_0x3083('0x150')]);if(_0x4ec144){logger['info'](util[_0x3083('0x24')](_0x3083('0x153'),this[_0x3083('0xb')][_0x3083('0x35')],_0x30ee5d[_0x3083('0x150')]));this[_0x3083('0xb')]['noop'](util[_0x3083('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x3083('0x35')],_0x30ee5d['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x3083('0x24')](_0x3083('0x155'),this[_0x3083('0xb')][_0x3083('0x35')],_0x30ee5d[_0x3083('0x150')]));this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x155'),this[_0x3083('0xb')][_0x3083('0x35')],_0x30ee5d[_0x3083('0x150')]));return{'code':0xc8,'result':_0x3083('0x158')};}};AGIVertices['prototype']['math']=function(_0x4310d3){logger['info'](util[_0x3083('0x24')](_0x3083('0x159'),_0x4310d3[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x4310d3['operation'])){return this['channel'][_0x3083('0x26')](_0x4310d3,'no\x20operation\x20configured');}this[_0x3083('0xb')]['noop'](util[_0x3083('0x24')](_0x3083('0x15a'),_0x4310d3['operation']));var _0x3acba5=eval(_0x4310d3[_0x3083('0x15b')]);if(!this[_0x3083('0x81')](_0x4310d3[_0x3083('0xcd')])){return this[_0x3083('0xb')][_0x3083('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1f27e3=this[_0x3083('0xf')][_0x3083('0x6b')](this,_0x4310d3[_0x3083('0xcd')]);if(!_0x1f27e3){return this[_0x3083('0xb')]['error'](_0x4310d3,_0x3083('0xcf'));}if(_['isArray'](_0x3acba5)){var _0x1e8498=this;_0x3acba5['forEach'](function(_0x204580,_0x3f4313){_0x1e8498[_0x3083('0xb')]['setVariable'](util[_0x3083('0x24')](_0x3083('0x15c'),_0x1f27e3,_0x3f4313),_0x204580);});return this['channel']['noop'](util[_0x3083('0x24')]('variable\x20%s[key]\x20set',_0x1f27e3));}else{return this[_0x3083('0xb')]['setVariable'](_0x1f27e3,_0x3acba5);}};AGIVertices[_0x3083('0xe')][_0x3083('0x15d')]=function(_0x142c99){logger[_0x3083('0x27')](util[_0x3083('0x24')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x142c99[_0x3083('0x31')]));if(_0x142c99[_0x3083('0x107')]===0x0){return this[_0x3083('0xa0')](_0x142c99);}_0x142c99[_0x3083('0x107')]-=0x1;if(!this[_0x3083('0x81')](_0x142c99[_0x3083('0x108')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x142c99,'no\x20file\x20audio\x20selected');}var _0x4f7bd9=this[_0x3083('0x1b')][_0x3083('0x6b')](this,_0x142c99[_0x3083('0x108')]);if(!_0x4f7bd9){return this[_0x3083('0xb')]['error'](_0x142c99,_0x3083('0x10a'));}var _0x4397fd=this['channel'][_0x3083('0x10b')](_0x4f7bd9,_0x142c99[_0x3083('0x10c')],_0x142c99[_0x3083('0x15e')]);var _0x2e770f=_0x4397fd[_0x3083('0x9e')];if(_0x4397fd[_0x3083('0x9e')]===-0x1){this[_0x3083('0x30')]['sync'](this,_0x142c99,'-1');return _0x4397fd;}else if(_0x4397fd[_0x3083('0x9f')]==='timeout'){_0x4397fd[_0x3083('0x9e')]=_0x4397fd['result'][_0x3083('0x95')]>0x0?_0x4397fd[_0x3083('0x9e')]:'t';}else if(_['isEmpty'](_0x4397fd[_0x3083('0x9e')])){_0x4397fd[_0x3083('0x9e')]='#';_0x2e770f='#';}if(!this[_0x3083('0x81')](_0x142c99[_0x3083('0xcd')])){this[_0x3083('0xb')]['noop'](_0x3083('0xce'));}else{var _0x55a8a1=this[_0x3083('0xf')][_0x3083('0x6b')](this,_0x142c99[_0x3083('0xcd')]);if(!_0x55a8a1){return this[_0x3083('0xb')][_0x3083('0x26')](_0x142c99,_0x3083('0xcf'));}this[_0x3083('0xb')][_0x3083('0x9a')](_0x55a8a1,_0x2e770f);}this['createSquareDetailsReport'][_0x3083('0x6b')](this,_0x142c99,_0x2e770f);return _0x4397fd;};AGIVertices['prototype'][_0x3083('0xa4')]=function(_0x2fdac9){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x15f'),_0x2fdac9[_0x3083('0x31')]));return this[_0x3083('0xb')][_0x3083('0xa4')](_0x2fdac9[_0x3083('0x160')]||_0x2fdac9[_0x3083('0x31')]);};AGIVertices[_0x3083('0xe')]['pause']=function(_0x42ce7d){logger[_0x3083('0x27')](util['format'](_0x3083('0x161'),_0x42ce7d[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x42ce7d[_0x3083('0x150')])){return this[_0x3083('0xb')]['error'](_0x42ce7d,_0x3083('0x151'));}logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x152'),this[_0x3083('0xb')]['callerid'],_0x42ce7d['findBy']));var _0x5f4b05=this[_0x3083('0x4a')]['sync'](this,_0x42ce7d[_0x3083('0x162')]);var _0x528a3a=this[_0x3083('0x4b')]['sync'](this,_0x42ce7d[_0x3083('0x150')],_0x5f4b05);if(_0x528a3a){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x153'),this['channel']['callerid'],_0x42ce7d[_0x3083('0x150')]));this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x153'),this[_0x3083('0xb')][_0x3083('0x35')],_0x42ce7d[_0x3083('0x150')]));return{'code':0xc8,'result':_0x3083('0x154')};}else{logger['info'](util['format'](_0x3083('0x155'),this[_0x3083('0xb')][_0x3083('0x35')],_0x42ce7d['findBy']));this[_0x3083('0xb')][_0x3083('0xa4')](util['format'](_0x3083('0x153'),this[_0x3083('0xb')][_0x3083('0x35')],_0x42ce7d[_0x3083('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x3083('0xe')][_0x3083('0x163')]=function(_0x5c2db9){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x164'),_0x5c2db9[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x5c2db9['file_id'])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x5c2db9,_0x3083('0x109'));}var _0x58cc32=this[_0x3083('0x1b')][_0x3083('0x6b')](this,_0x5c2db9[_0x3083('0x108')]);if(!_0x58cc32){return this['channel']['error'](_0x5c2db9,_0x3083('0x10a'));}var _0x349b71=this[_0x3083('0xb')][_0x3083('0x52')]('PLAYBACK',[_0x58cc32,_0x5c2db9['opts']]);if(_0x349b71[_0x3083('0x9e')]===-0x1){return _0x349b71;}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0xba'),_0x3083('0x165'),_0x58cc32));};AGIVertices[_0x3083('0xe')][_0x3083('0x166')]=function(_0x4c38e8){logger[_0x3083('0x27')](util['format'](_0x3083('0x167'),_0x4c38e8[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x4c38e8[_0x3083('0x168')])){return this[_0x3083('0xb')]['error'](_0x4c38e8,_0x3083('0x169'));}var _0x562aa8='';var _0x295f28=parseInt(_0x4c38e8[_0x3083('0x168')],0xa);if(isNaN(_0x295f28)){_0x562aa8=_0x4c38e8[_0x3083('0x168')];}else{_0x562aa8=this[_0x3083('0x16a')][_0x3083('0x6b')](this,_0x4c38e8[_0x3083('0x168')]);if(!_0x562aa8){return this[_0x3083('0xb')][_0x3083('0x26')](_0x4c38e8,'no\x20queue\x20found');}}var _0x82cf00='';if(this['isConfigured'](_0x4c38e8['file_id'])){var _0x392302=this[_0x3083('0x1b')][_0x3083('0x6b')](this,_0x4c38e8[_0x3083('0x108')]);if(_0x392302){_0x82cf00=_0x392302;}}this['createSquareDetailsReport'][_0x3083('0x6b')](this,_0x4c38e8,_0x562aa8);if(_0x4c38e8[_0x3083('0x16b')][_0x3083('0x16c')]('x')<0x0){_0x4c38e8[_0x3083('0x16b')]+='x';}if(_0x4c38e8[_0x3083('0x16b')][_0x3083('0x16c')]('X')<0x0){_0x4c38e8[_0x3083('0x16b')]+='X';}this[_0x3083('0xb')][_0x3083('0x9a')](_0x3083('0x16d'),_0x562aa8?_0x562aa8['toLowerCase']():'');var _0x1b5556=this['channel'][_0x3083('0x52')](_0x3083('0x16e'),[_0x562aa8,_0x4c38e8[_0x3083('0x16b')],_0x4c38e8[_0x3083('0x5e')],_0x82cf00,_0x4c38e8[_0x3083('0x60')],_0x4c38e8[_0x3083('0xae')],_0x4c38e8[_0x3083('0x16f')],_0x4c38e8[_0x3083('0x170')],'',_0x4c38e8[_0x3083('0x171')]]);if(_0x1b5556[_0x3083('0x9e')]===-0x1){return _0x1b5556;}return this['channel'][_0x3083('0xa4')](util['format'](_0x3083('0xba'),'QUEUE',_0x562aa8));};AGIVertices[_0x3083('0xe')][_0x3083('0x172')]=function(_0x3c96ab){logger['info'](util[_0x3083('0x24')](_0x3083('0x173'),_0x3c96ab[_0x3083('0x31')]));var _0x505a06=_0x3c96ab[_0x3083('0x174')]||'wav';var _0x40f9d3=util[_0x3083('0x24')](_0x3083('0x175'),this[_0x3083('0xb')][_0x3083('0x34')],rs[_0x3083('0x111')](0x5));var _0x5c6ab5=util[_0x3083('0x24')]('%s/recordings/%s.%s',FILES_PATH,_0x40f9d3,_0x505a06);var _0x459c2e=util['format'](_0x3083('0x128'),FILES_PATH,_0x40f9d3);this['createSquareRecording'][_0x3083('0x6b')](this,_0x3c96ab,_0x40f9d3,_0x5c6ab5);this[_0x3083('0xb')][_0x3083('0x9a')](_0x3083('0x176'),_0x40f9d3);logger[_0x3083('0x27')](_0x3083('0x177'),_0x459c2e,_0x505a06,_0x3c96ab[_0x3083('0x178')],_0x3c96ab[_0x3083('0x60')]);return this[_0x3083('0xb')][_0x3083('0x179')](_0x459c2e,_0x505a06,_0x3c96ab['escape_digits'],_0x3c96ab[_0x3083('0x60')],undefined,!![]);};AGIVertices['prototype'][_0x3083('0x17a')]=function(_0x3e4aa6){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x17b'),_0x3e4aa6['label']));if(!this[_0x3083('0x81')](_0x3e4aa6['url'])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x17c'));}var _0x2f5755=this['restAPI'][_0x3083('0x6b')](this,_0x3e4aa6);logger['info'](util[_0x3083('0x24')](_0x3083('0x17d'),util['inspect'](_0x2f5755,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x3e4aa6[_0x3083('0xcd')])){return this['channel'][_0x3083('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x17b8c4=this['getVariable'][_0x3083('0x6b')](this,_0x3e4aa6['variable_id']);if(!_0x17b8c4){return this[_0x3083('0xb')]['error'](_0x3e4aa6,_0x3083('0xcf'));}this[_0x3083('0xb')][_0x3083('0x9a')](util['format'](_0x3083('0x17e'),_0x17b8c4),_0x2f5755['statusCode']?_0x2f5755[_0x3083('0x71')]:_0x3083('0x17f'));this[_0x3083('0xb')][_0x3083('0x9a')](util[_0x3083('0x24')]('%s_STATUS_MESSAGE',_0x17b8c4),_0x2f5755[_0x3083('0x180')]?_0x2f5755[_0x3083('0x180')]:'OK');if(_0x2f5755['body']){try{this[_0x3083('0x99')](_0x2f5755[_0x3083('0x6d')],_0x17b8c4);}catch(_0x26faf5){logger[_0x3083('0x26')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x17b8c4));}}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0xd4'),_0x17b8c4));};AGIVertices[_0x3083('0xe')][_0x3083('0x181')]=function(_0x309bda){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x182'),_0x309bda[_0x3083('0x31')]));return this[_0x3083('0xb')][_0x3083('0x183')](_0x309bda[_0x3083('0x184')][_0x3083('0x53')](/\s+/g,''),_0x309bda['escape_digits']);};AGIVertices[_0x3083('0xe')][_0x3083('0x185')]=function(_0xba518){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x186'),_0xba518[_0x3083('0x31')]));return this[_0x3083('0xb')][_0x3083('0x187')](_0xba518['number'][_0x3083('0x53')](/\s+/g,''),_0xba518['escape_digits']);};AGIVertices[_0x3083('0xe')][_0x3083('0x188')]=function(_0x136efc){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x189'),_0x136efc[_0x3083('0x31')]));return this[_0x3083('0xb')][_0x3083('0x18a')](_0x136efc['text'],_0x136efc[_0x3083('0x178')]);};AGIVertices[_0x3083('0xe')][_0x3083('0x18b')]=function(_0x1aa0cc){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x18c'),_0x1aa0cc[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x1aa0cc[_0x3083('0x18d')])){return this['channel'][_0x3083('0xa4')](_0x3083('0x18e'));}var _0x2dfe8d=this[_0x3083('0x18f')][_0x3083('0x6b')](this,_0x1aa0cc[_0x3083('0x18d')]);if(!_0x2dfe8d||!_0x2dfe8d[_0x3083('0x190')]){return this[_0x3083('0xb')][_0x3083('0x26')](_0x1aa0cc,'no\x20mail\x20account\x20found');}var _0x435fa4={'from':util['format'](_0x3083('0x191'),_0x2dfe8d['name'],_0x2dfe8d[_0x3083('0x192')]||_0x2dfe8d[_0x3083('0x190')]['user']),'to':_0x1aa0cc['to']||'','cc':_0x1aa0cc['cc']||'','bcc':_0x1aa0cc['bcc']||'','subject':_0x1aa0cc[_0x3083('0x193')],'html':_0x1aa0cc[_0x3083('0x56')],'text':_0x1aa0cc['text']};if(this[_0x3083('0x81')](_0x1aa0cc['template_id'])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x435fa4));this['createSquareDetailsReport'][_0x3083('0x6b')](this,_0x1aa0cc,_0x1aa0cc['account_id']);this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x194'),_0x2dfe8d[_0x3083('0x12')]));this[_0x3083('0x1e')][_0x3083('0x6b')](this,_0x2dfe8d[_0x3083('0x195')],_0x435fa4);return this['channel'][_0x3083('0xa4')](_0x3083('0x196'));};AGIVertices['prototype'][_0x3083('0x197')]=function(_0x53ce2d){logger[_0x3083('0x27')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x53ce2d[_0x3083('0x31')]));return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x198'));};AGIVertices[_0x3083('0xe')][_0x3083('0x199')]=function(_0x100a83){logger['info'](util[_0x3083('0x24')](_0x3083('0x19a'),_0x100a83[_0x3083('0x31')]));if(!this['isConfigured'](_0x100a83[_0x3083('0x19b')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x19c'));}var _0x4194a3=this[_0x3083('0x2d')][_0x3083('0x6b')](this,_0x100a83[_0x3083('0x19b')]);if(!_0x4194a3){return this['channel'][_0x3083('0x26')](_0x100a83,_0x3083('0x19d'));}var _0x399f3a={'body':_0x100a83[_0x3083('0x19e')],'phone':_0x100a83['to']||'','SmsAccountId':_0x4194a3['id']};logger[_0x3083('0xd6')]('sendSMS\x20message',JSON['stringify'](_0x399f3a));this[_0x3083('0x30')][_0x3083('0x6b')](this,_0x100a83,_0x100a83[_0x3083('0x19b')]);this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x4194a3[_0x3083('0x12')]));this['createSmsMessage'][_0x3083('0x6b')](this,_0x399f3a);return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x19f'));};AGIVertices[_0x3083('0xe')][_0x3083('0x1a0')]=function(_0x4da2e6){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x1a1'),_0x4da2e6[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x4da2e6[_0x3083('0xcd')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x4da2e6,_0x3083('0x1a2'));}var _0x5d710e=this['getVariable'][_0x3083('0x6b')](this,_0x4da2e6[_0x3083('0xcd')]);if(!_0x5d710e){return this[_0x3083('0xb')][_0x3083('0x26')](_0x4da2e6,'no\x20variable\x20found');}return this['channel'][_0x3083('0x9a')](_0x5d710e,_0x4da2e6[_0x3083('0x1a3')]);};AGIVertices['prototype']['start']=function(_0x36abe9){logger['info'](util[_0x3083('0x24')]('Enter\x20in\x20START\x20(%s)\x20block',_0x36abe9[_0x3083('0x31')]));this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x1a4'));if(_0x36abe9[_0x3083('0xb1')]===_0x3083('0x1a5')){this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x1a6'));return this[_0x3083('0xb')]['answer']();}return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x1a7'));};AGIVertices[_0x3083('0xe')][_0x3083('0x1a8')]=function(_0x55efaf){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x1a9'),_0x55efaf[_0x3083('0x31')]));if(!this['isConfigured'](_0x55efaf['project_id'])){return this['channel'][_0x3083('0x26')](_0x55efaf,_0x3083('0x1aa'));}var _0x1ef4fb=this[_0x3083('0x15')][_0x3083('0x6b')](this,_0x55efaf[_0x3083('0x1ab')]);if(!this[_0x3083('0x81')](_0x1ef4fb)){return this['channel'][_0x3083('0x26')](_0x55efaf,util[_0x3083('0x24')](_0x3083('0x1ac'),_0x55efaf[_0x3083('0x1ab')]));}if(_0x1ef4fb===this['channel'][_0x3083('0x3b')]){return this[_0x3083('0xb')][_0x3083('0x26')](_0x55efaf,_0x3083('0x1ad'));}this[_0x3083('0x30')][_0x3083('0x6b')](this,_0x55efaf,_0x1ef4fb);var _0x3dba40=this[_0x3083('0xb')][_0x3083('0x52')](_0x3083('0x1ae'),util[_0x3083('0x24')](_0x3083('0x1af'),config['agi'][_0x3083('0x1b0')]||_0x3083('0x1b1'),_0x1ef4fb,this[_0x3083('0xb')][_0x3083('0x3b')]));if(_0x3dba40[_0x3083('0x9e')]===-0x1){return _0x3dba40;}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0xba'),_0x3083('0x1ae'),_0x1ef4fb));};AGIVertices[_0x3083('0xe')][_0x3083('0x1b2')]=function(_0x969e55){logger['info'](util[_0x3083('0x24')](_0x3083('0x1b3'),_0x969e55[_0x3083('0x31')]));var _0xb19c2b=this[_0x3083('0x51')]['sync'](this,_0x969e55['command']);this[_0x3083('0x30')][_0x3083('0x6b')](this,_0x969e55,_0x969e55[_0x3083('0xaf')]);if(this['isConfigured'](_0x969e55[_0x3083('0xcd')])){var _0x246d61=this[_0x3083('0xf')][_0x3083('0x6b')](this,_0x969e55[_0x3083('0xcd')]);if(_0x246d61){this[_0x3083('0xb')][_0x3083('0x9a')](_0x246d61,_0xb19c2b);return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x1b4'),_0x969e55[_0x3083('0xaf')],_0x246d61));}}return this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x1b5'),_0x969e55[_0x3083('0xaf')]));};AGIVertices[_0x3083('0xe')][_0x3083('0x1b6')]=function(_0x115107){logger[_0x3083('0x27')](util[_0x3083('0x24')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x115107['label']));_0x115107['text']=_0x115107[_0x3083('0x56')][_0x3083('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3083('0x81')](_0x115107[_0x3083('0x1b7')])){return this[_0x3083('0xb')][_0x3083('0xa4')](_0x3083('0x1b8'));}if(!this[_0x3083('0x81')](_0x115107[_0x3083('0x56')])){return this[_0x3083('0xb')]['noop'](_0x3083('0xbc'));}this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x1b9'),_0x115107['text']));var _0x1375e3=this[_0x3083('0x54')][_0x3083('0x6b')](this,_0x115107);if(_0x1375e3){this[_0x3083('0xb')][_0x3083('0xa4')](util['format'](_0x3083('0x1ba'),_0x1375e3));var _0x31bf50=this[_0x3083('0xb')][_0x3083('0xf7')](_0x1375e3);try{fs[_0x3083('0xf8')](_0x1375e3+'.wav');}catch(_0x237eb9){logger[_0x3083('0x26')](_0x237eb9);}return _0x31bf50;}return this[_0x3083('0xb')][_0x3083('0x26')](_0x115107,_0x3083('0x1bb'));};AGIVertices[_0x3083('0xe')][_0x3083('0x1bc')]=function(_0x60429){logger['info'](util['format'](_0x3083('0x1bd'),_0x60429['label']));_0x60429['text']=_0x60429[_0x3083('0x56')][_0x3083('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3083('0x81')](_0x60429[_0x3083('0x56')])){return this[_0x3083('0xb')][_0x3083('0xa4')]('no\x20text\x20configured');}this['channel'][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x1be'),_0x60429[_0x3083('0x56')]));var _0x36c48f=this['googleTTS']['sync'](this,_0x60429);if(_0x36c48f){this[_0x3083('0xb')][_0x3083('0xa4')](util['format'](_0x3083('0x1bf'),_0x36c48f));var _0x438d59=this[_0x3083('0xb')]['streamFile'](_0x36c48f);try{fs[_0x3083('0xf8')](_0x36c48f+_0x3083('0xf9'));}catch(_0x58e6c3){logger['error'](_0x58e6c3);}return _0x438d59;}return this['channel'][_0x3083('0x26')](_0x60429,_0x3083('0x1c0'));};AGIVertices[_0x3083('0xe')][_0x3083('0x1c1')]=function(_0x2c3f1f){logger[_0x3083('0x27')](util[_0x3083('0x24')](_0x3083('0x1c2'),_0x2c3f1f[_0x3083('0x31')]));if(!this[_0x3083('0x81')](_0x2c3f1f[_0x3083('0x150')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x2c3f1f,'no\x20find\x20by\x20configured');}logger[_0x3083('0x27')](util['format'](_0x3083('0x152'),this[_0x3083('0xb')][_0x3083('0x35')],_0x2c3f1f[_0x3083('0x150')]));var _0x2aafda=this[_0x3083('0x4c')][_0x3083('0x6b')](this,_0x2c3f1f[_0x3083('0x150')]);if(_0x2aafda){logger['info'](util[_0x3083('0x24')](_0x3083('0x153'),this[_0x3083('0xb')][_0x3083('0x35')],_0x2c3f1f[_0x3083('0x150')]));this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')](_0x3083('0x153'),this[_0x3083('0xb')][_0x3083('0x35')],_0x2c3f1f[_0x3083('0x150')]));return{'code':0xc8,'result':_0x3083('0x154')};}else{logger['info'](util[_0x3083('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x2c3f1f[_0x3083('0x150')]));this[_0x3083('0xb')][_0x3083('0xa4')](util[_0x3083('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x3083('0x35')],_0x2c3f1f[_0x3083('0x150')]));return{'code':0xc8,'result':_0x3083('0x158')};}};AGIVertices[_0x3083('0xe')]['voicemail']=function(_0x2d9ba7){logger['info'](util[_0x3083('0x24')](_0x3083('0x1c3'),_0x2d9ba7[_0x3083('0x31')]));var _0x175f34=this[_0x3083('0xb')][_0x3083('0x52')](_0x3083('0x1c4'),[_0x2d9ba7[_0x3083('0x1c5')],_0x2d9ba7[_0x3083('0x73')]]);if(_0x175f34[_0x3083('0x9e')]===-0x1){return _0x175f34;}return this[_0x3083('0xb')]['noop'](util[_0x3083('0x24')](_0x3083('0xba'),_0x3083('0x1c4'),_0x2d9ba7[_0x3083('0x1c5')]));};AGIVertices[_0x3083('0xe')][_0x3083('0x1c6')]=function(_0x4b0fcd){logger['info'](util[_0x3083('0x24')](_0x3083('0x1c7'),_0x4b0fcd[_0x3083('0x31')]));if(!this['isConfigured'](_0x4b0fcd[_0x3083('0xcd')])){return this[_0x3083('0xb')][_0x3083('0x26')](_0x4b0fcd,_0x3083('0x1a2'));}var _0x2ac89e=this['getVariable'][_0x3083('0x6b')](this,_0x4b0fcd['variable_id']);if(!_0x2ac89e){return this[_0x3083('0xb')]['error'](_0x4b0fcd,_0x3083('0xcf'));}var _0x3db423=this[_0x3083('0xb')]['getVariable'](_0x2ac89e);return{'code':0xc8,'result':_0x3db423[_0x3083('0x9f')]?_0x3db423[_0x3083('0x9f')]:'-'};};String[_0x3083('0xe')]['replaceAll']=function(_0x23ca9e,_0x382c54){return this[_0x3083('0x9b')](_0x23ca9e)[_0x3083('0x1c8')](_0x382c54);};module[_0x3083('0x1c9')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 22ee84e..66b66a7 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 _0x58f0=['secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','syncAgentConnect','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid'];(function(_0x2fd0d3,_0x50bd4f){var _0x764c4c=function(_0x261ccc){while(--_0x261ccc){_0x2fd0d3['push'](_0x2fd0d3['shift']());}};_0x764c4c(++_0x50bd4f);}(_0x58f0,0xb8));var _0x058f=function(_0x48f0e1,_0x6f048){_0x48f0e1=_0x48f0e1-0x0;var _0x3628aa=_0x58f0[_0x48f0e1];return _0x3628aa;};'use strict';var util=require(_0x058f('0x0'));var _=require(_0x058f('0x1'));var moment=require(_0x058f('0x2'));var ami=require(_0x058f('0x3'));var logger=require(_0x058f('0x4'))(_0x058f('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x058f('0x6'));function Acw(_0x3a6750){this[_0x058f('0x7')]=_0x3a6750[_0x058f('0x7')];this['agents']=_0x3a6750[_0x058f('0x8')];this[_0x058f('0x9')]=_0x3a6750[_0x058f('0x9')];this[_0x058f('0xa')]={};ami['on'](_0x058f('0xb'),this['syncAgentConnect'][_0x058f('0xc')](this));ami['on'](_0x058f('0xd'),this[_0x058f('0xe')][_0x058f('0xc')](this));ami['on'](_0x058f('0xf'),this[_0x058f('0x10')][_0x058f('0xc')](this));ami['on'](_0x058f('0x11'),this[_0x058f('0x12')][_0x058f('0xc')](this));ami['on']('attendedtransfer',this[_0x058f('0x13')][_0x058f('0xc')](this));ami['on'](_0x058f('0x14'),this[_0x058f('0x15')][_0x058f('0xc')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x058f('0xc')](this));}function getDiff(_0x2af75a){var _0x12ae64=moment()[_0x058f('0x16')](0x0);var _0x3099eb=moment(_0x2af75a)[_0x058f('0x16')](0x0);return _0x12ae64[_0x058f('0x17')](_0x3099eb,_0x058f('0x18'));}Acw[_0x058f('0x19')][_0x058f('0x1a')]=function(_0x524cfc){try{var _0x1be795=this;var _0x21aaf3=this['channels'][_0x524cfc][_0x058f('0x1b')];var _0x531f63=this[_0x058f('0xa')][_0x524cfc][_0x058f('0x1c')];var _0x1a0d42=this[_0x058f('0x7')][_0x531f63];var _0x439bf2=![];var _0x1d5d26=_0x058f('0x1d');if(_0x1a0d42[_0x058f('0x1e')]){if(_0x1a0d42[_0x058f('0x1f')][_0x058f('0x20')]){_0x439bf2=!![];_0x1d5d26=_0x1a0d42[_0x058f('0x1f')][_0x058f('0x20')];}}ami['Action']({'action':_0x058f('0x21'),'interface':_0x21aaf3,'paused':!![],'reason':_0x1d5d26})[_0x058f('0x22')](function(_0x2ea04f){if(_0x1be795[_0x058f('0x8')][_0x21aaf3]){return RpcUser[_0x058f('0x23')](_0x1be795[_0x058f('0x8')][_0x21aaf3]['id'])[_0x058f('0x22')](function(_0x49ce4c){if(_0x49ce4c&&!_0x49ce4c[_0x058f('0x24')]){logger[_0x058f('0x25')](_0x058f('0x26'),_0x524cfc,_0x21aaf3,_0x531f63);var _0x2d3a65=_0x1be795[_0x058f('0xa')][_0x524cfc]['attended']&&_0x1be795['channels'][_0x524cfc]['destlinkedid']?_0x1be795[_0x058f('0xa')][_0x524cfc][_0x058f('0x27')]:_0x524cfc;return RpcUser['savePause'](_0x1be795[_0x058f('0x8')][_0x21aaf3],_0x1d5d26,_0x2d3a65)[_0x058f('0x22')](function(_0x138eee){if(!_0x439bf2){_0x1be795[_0x058f('0x9')][_0x21aaf3]={};logger[_0x058f('0x25')](_0x058f('0x28'),_0x524cfc,_0x1be795[_0x058f('0x7')][_0x531f63][_0x058f('0x29')],_0x21aaf3,_0x531f63);_0x1be795[_0x058f('0x9')][_0x21aaf3]['timer']=setTimeout(_0x1be795[_0x058f('0x2a')][_0x058f('0xc')](_0x1be795,_0x21aaf3),_0x1be795[_0x058f('0x7')][_0x531f63]['acwTimeout']*0x3e8);_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2b')]=moment()['format'](_0x058f('0x2c'));_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2d')]=_0x524cfc;_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x1c')]=_0x531f63;_0x1be795[_0x058f('0x9')][_0x21aaf3]['updateAcw']=function(){var _0x3af987=getDiff(_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2b')]);clearTimeout(_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2e')]);_0x1be795['timers'][_0x21aaf3][_0x058f('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x3af987},_0x1be795[_0x058f('0x9')][_0x21aaf3]['uniqueid'],_0x21aaf3)[_0x058f('0x22')](function(_0x540208){logger[_0x058f('0x25')](_0x058f('0x2f'),_0x524cfc,_0x3af987,_0x540208);})[_0x058f('0x30')](function(_0x5a823a){logger[_0x058f('0x31')](_0x058f('0x32'),_0x524cfc,_0x5a823a);});delete _0x1be795['timers'][_0x21aaf3];};}});}else{logger[_0x058f('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x524cfc,_0x21aaf3,_0x531f63);}});}})['catch'](function(_0x2ce9ee){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x524cfc,_0x1be795[_0x058f('0x7')][_0x531f63][_0x058f('0x29')],_0x21aaf3,_0x531f63);})['finally'](function(){delete _0x1be795[_0x058f('0xa')][_0x524cfc];});}catch(_0x535cfe){logger[_0x058f('0x31')](_0x058f('0x33'),_0x535cfe['message']);}};Acw[_0x058f('0x19')]['stopAcw']=function(_0x177045){try{var _0x5b525e=this;if(_0x5b525e[_0x058f('0x9')][_0x177045]){_0x5b525e[_0x058f('0x9')][_0x177045][_0x058f('0x2e')]=![];var _0x1bdd9a=_0x5b525e[_0x058f('0x9')][_0x177045][_0x058f('0x2d')];var _0x3f8f0d=_0x5b525e['timers'][_0x177045][_0x058f('0x1c')];var _0x4990ff=_0x5b525e[_0x058f('0x7')][_0x3f8f0d][_0x058f('0x29')];logger[_0x058f('0x25')](_0x058f('0x34'),_0x1bdd9a,_0x177045);RpcUser['saveUnpause'](this[_0x058f('0x8')][_0x177045]);RpcVoiceAgentReport['update']({'acwtime':_0x4990ff,'agentacw':!![]},_0x1bdd9a,_0x177045)[_0x058f('0x22')](function(_0x292dcf){logger[_0x058f('0x25')](_0x058f('0x2f'),_0x1bdd9a,_0x4990ff,_0x292dcf);})['catch'](function(_0xbeb6c5){logger[_0x058f('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x1bdd9a,_0xbeb6c5);});}else{logger[_0x058f('0x31')](_0x058f('0x35'),_0x177045);if(_0x5b525e[_0x058f('0x9')]){logger[_0x058f('0x25')](_0x058f('0x36'),JSON['stringify'](_0x5b525e['timers']));}}}catch(_0x203994){logger[_0x058f('0x31')](_0x058f('0x37'),_0x203994[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x39')]=function(_0x43e5bd){try{if(this[_0x058f('0x7')][_0x43e5bd[_0x058f('0x1c')]]&&(this[_0x058f('0x7')][_0x43e5bd[_0x058f('0x1c')]][_0x058f('0x5')]||this[_0x058f('0x7')][_0x43e5bd[_0x058f('0x1c')]][_0x058f('0x1e')])){if(this[_0x058f('0x8')][_0x43e5bd[_0x058f('0x1b')]]){this[_0x058f('0xa')][_0x43e5bd[_0x058f('0x2d')]]={'queue':_0x43e5bd[_0x058f('0x1c')],'interface':_0x43e5bd['interface'],'destlinkedid':_0x43e5bd[_0x058f('0x27')]};}}}catch(_0x5239f9){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x5239f9[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x3a')]=function(_0x19a790){try{if(this[_0x058f('0x7')][_0x19a790['queue']]&&(this[_0x058f('0x7')][_0x19a790[_0x058f('0x1c')]][_0x058f('0x5')]||this[_0x058f('0x7')][_0x19a790[_0x058f('0x1c')]]['mandatoryDisposition'])){if(this[_0x058f('0x8')][_0x19a790[_0x058f('0x1b')]]){this[_0x058f('0xa')][_0x19a790['uniqueid']]={'queue':_0x19a790[_0x058f('0x1c')],'interface':_0x19a790['interface']};}}}catch(_0x43419a){logger[_0x058f('0x31')](_0x058f('0x3b'),_0x43419a['message']);}};Acw[_0x058f('0x19')][_0x058f('0xe')]=function(_0x3d1551){try{if(this['channels'][_0x3d1551['uniqueid']]&&_[_0x058f('0x3c')](this[_0x058f('0xa')][_0x3d1551[_0x058f('0x2d')]][_0x058f('0x3d')])){logger[_0x058f('0x25')]('[%s][HANGUP:UNIQUEID]',_0x3d1551['uniqueid']);this[_0x058f('0x1a')](_0x3d1551['uniqueid']);}else if(this[_0x058f('0xa')][_0x3d1551[_0x058f('0x3e')]]&&_[_0x058f('0x3c')](this[_0x058f('0xa')][_0x3d1551[_0x058f('0x3e')]][_0x058f('0x3d')])){logger[_0x058f('0x25')](_0x058f('0x3f'),_0x3d1551[_0x058f('0x3e')]);this['startAcw'](_0x3d1551[_0x058f('0x3e')]);}}catch(_0x266e2a){logger[_0x058f('0x31')](_0x058f('0x40'),_0x266e2a[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x10')]=function(_0x29f4d0){try{if(this[_0x058f('0xa')][_0x29f4d0[_0x058f('0x2d')]]&&this['channels'][_0x29f4d0[_0x058f('0x2d')]]['attended']){logger[_0x058f('0x25')](_0x058f('0x41'),_0x29f4d0['uniqueid']);this[_0x058f('0x1a')](_0x29f4d0[_0x058f('0x2d')]);}else if(this[_0x058f('0xa')][_0x29f4d0[_0x058f('0x3e')]]&&this['channels'][_0x29f4d0[_0x058f('0x3e')]][_0x058f('0x3d')]){logger['info'](_0x058f('0x42'),_0x29f4d0[_0x058f('0x3e')]);this['startAcw'](_0x29f4d0[_0x058f('0x3e')]);}}catch(_0x33b3ef){logger[_0x058f('0x31')]('[ACW][syncHangup]\x20%s',_0x33b3ef['message']);}};Acw[_0x058f('0x19')][_0x058f('0x13')]=function(_0x2a6207){try{if(!_['isNil'](this['channels'][_0x2a6207[_0x058f('0x43')]])){this[_0x058f('0x1a')](_0x2a6207[_0x058f('0x43')]);if(this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]]){this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]][_0x058f('0x3d')]=!![];this['channels'][_0x2a6207[_0x058f('0x45')]]=this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]];delete this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]];}}else if(!_[_0x058f('0x46')](this['channels'][_0x2a6207[_0x058f('0x45')]])){this['startAcw'](_0x2a6207[_0x058f('0x45')]);if(this['channels'][_0x2a6207[_0x058f('0x47')]]){this[_0x058f('0xa')][_0x2a6207['origtransfereruniqueid']][_0x058f('0x3d')]=!![];this[_0x058f('0xa')][_0x2a6207[_0x058f('0x43')]]=this['channels'][_0x2a6207[_0x058f('0x47')]];delete this['channels'][_0x2a6207[_0x058f('0x47')]];}}}catch(_0x1879ab){logger[_0x058f('0x31')](_0x058f('0x48'),_0x1879ab[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x15')]=function(_0x593265){try{if(this[_0x058f('0xa')][_0x593265[_0x058f('0x49')]]){logger[_0x058f('0x25')](_0x058f('0x4a'),JSON[_0x058f('0x4b')](_0x593265['transfereruniqueid']));this['startAcw'](_0x593265[_0x058f('0x49')]);}else if(this[_0x058f('0xa')][_0x593265[_0x058f('0x4c')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x058f('0x4b')](_0x593265[_0x058f('0x4c')]));this[_0x058f('0x1a')](_0x593265[_0x058f('0x4c')]);}}catch(_0x431659){logger[_0x058f('0x31')](_0x058f('0x4d'),_0x431659[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x12')]=function(_0x59ce7a){try{if(this['voiceQueues'][_0x59ce7a[_0x058f('0x1c')]]&&this['voiceQueues'][_0x59ce7a[_0x058f('0x1c')]][_0x058f('0x4e')]===_0x058f('0x4f')){if(this[_0x058f('0x8')][_0x59ce7a['interface']]){logger[_0x058f('0x25')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x59ce7a[_0x058f('0x2d')],_0x59ce7a[_0x058f('0x1b')],_0x59ce7a[_0x058f('0x1c')]);return RpcUser[_0x058f('0x50')](this[_0x058f('0x8')][_0x59ce7a[_0x058f('0x1b')]],_0x058f('0x51'),_0x59ce7a['uniqueid']);}}}catch(_0x2f283b){logger[_0x058f('0x31')](_0x058f('0x52'),_0x2f283b[_0x058f('0x38')]);}};module[_0x058f('0x53')]=Acw; \ No newline at end of file +var _0xc90d=['format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','timer','update','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','prototype','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt'];(function(_0x196cfc,_0x186713){var _0x4e7116=function(_0x4c3213){while(--_0x4c3213){_0x196cfc['push'](_0x196cfc['shift']());}};_0x4e7116(++_0x186713);}(_0xc90d,0x1e5));var _0xdc90=function(_0x3f1b36,_0x205b14){_0x3f1b36=_0x3f1b36-0x0;var _0x56a704=_0xc90d[_0x3f1b36];return _0x56a704;};'use strict';var util=require(_0xdc90('0x0'));var _=require(_0xdc90('0x1'));var moment=require('moment');var ami=require(_0xdc90('0x2'));var logger=require('../../../config/logger')(_0xdc90('0x3'));var RpcUser=require(_0xdc90('0x4'));var RpcVoiceAgentReport=require(_0xdc90('0x5'));function Acw(_0x563be3){this[_0xdc90('0x6')]=_0x563be3[_0xdc90('0x6')];this[_0xdc90('0x7')]=_0x563be3[_0xdc90('0x7')];this['timers']=_0x563be3['timers'];this[_0xdc90('0x8')]={};ami['on'](_0xdc90('0x9'),this[_0xdc90('0xa')]['bind'](this));ami['on']('hanguprequest',this[_0xdc90('0xb')][_0xdc90('0xc')](this));ami['on'](_0xdc90('0xd'),this[_0xdc90('0xe')][_0xdc90('0xc')](this));ami['on'](_0xdc90('0xf'),this[_0xdc90('0x10')][_0xdc90('0xc')](this));ami['on']('attendedtransfer',this[_0xdc90('0x11')][_0xdc90('0xc')](this));ami['on'](_0xdc90('0x12'),this[_0xdc90('0x13')][_0xdc90('0xc')](this));ami['on'](_0xdc90('0x14'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x3c1160){var _0x47a025=moment()[_0xdc90('0x15')](0x0);var _0x4d39f3=moment(_0x3c1160)[_0xdc90('0x15')](0x0);return _0x47a025[_0xdc90('0x16')](_0x4d39f3,_0xdc90('0x17'));}Acw['prototype'][_0xdc90('0x18')]=function(_0x5f0d65){try{var _0x494722=this;var _0x3cc87a=this[_0xdc90('0x8')][_0x5f0d65][_0xdc90('0x19')];var _0x341ed6=this['channels'][_0x5f0d65][_0xdc90('0x1a')];var _0x3095cb=this[_0xdc90('0x6')][_0x341ed6];var _0x3ecdb5=![];var _0x35ae58=_0xdc90('0x1b');if(_0x3095cb[_0xdc90('0x1c')]){if(_0x3095cb[_0xdc90('0x1d')][_0xdc90('0x1e')]){_0x3ecdb5=!![];_0x35ae58=_0x3095cb[_0xdc90('0x1d')]['name'];}}ami['Action']({'action':'QueuePause','interface':_0x3cc87a,'paused':!![],'reason':_0x35ae58})[_0xdc90('0x1f')](function(_0x133605){if(_0x494722[_0xdc90('0x7')][_0x3cc87a]){return RpcUser[_0xdc90('0x20')](_0x494722[_0xdc90('0x7')][_0x3cc87a]['id'])[_0xdc90('0x1f')](function(_0x37ba4f){if(_0x37ba4f&&!_0x37ba4f[_0xdc90('0x21')]){logger['info'](_0xdc90('0x22'),_0x5f0d65,_0x3cc87a,_0x341ed6);var _0x35f636=_0x494722[_0xdc90('0x8')][_0x5f0d65][_0xdc90('0x23')]&&_0x494722[_0xdc90('0x8')][_0x5f0d65][_0xdc90('0x24')]?_0x494722[_0xdc90('0x8')][_0x5f0d65][_0xdc90('0x24')]:_0x5f0d65;return RpcUser[_0xdc90('0x25')](_0x494722[_0xdc90('0x7')][_0x3cc87a],_0x35ae58,_0x35f636)[_0xdc90('0x1f')](function(_0x1077fa){if(!_0x3ecdb5){_0x494722[_0xdc90('0x26')][_0x3cc87a]={};logger['info'](_0xdc90('0x27'),_0x5f0d65,_0x494722['voiceQueues'][_0x341ed6][_0xdc90('0x28')],_0x3cc87a,_0x341ed6);_0x494722[_0xdc90('0x26')][_0x3cc87a]['timer']=setTimeout(_0x494722[_0xdc90('0x29')][_0xdc90('0xc')](_0x494722,_0x3cc87a),_0x494722[_0xdc90('0x6')][_0x341ed6][_0xdc90('0x28')]*0x3e8);_0x494722[_0xdc90('0x26')][_0x3cc87a][_0xdc90('0x2a')]=moment()[_0xdc90('0x2b')](_0xdc90('0x2c'));_0x494722[_0xdc90('0x26')][_0x3cc87a]['uniqueid']=_0x5f0d65;_0x494722[_0xdc90('0x26')][_0x3cc87a][_0xdc90('0x1a')]=_0x341ed6;_0x494722['timers'][_0x3cc87a][_0xdc90('0x2d')]=function(){var _0x4e0ba6=getDiff(_0x494722[_0xdc90('0x26')][_0x3cc87a][_0xdc90('0x2a')]);clearTimeout(_0x494722[_0xdc90('0x26')][_0x3cc87a][_0xdc90('0x2e')]);_0x494722[_0xdc90('0x26')][_0x3cc87a][_0xdc90('0x2e')]=![];RpcVoiceAgentReport[_0xdc90('0x2f')]({'acwtime':_0x4e0ba6},_0x494722[_0xdc90('0x26')][_0x3cc87a][_0xdc90('0x30')],_0x3cc87a)[_0xdc90('0x1f')](function(_0x3857ef){logger[_0xdc90('0x31')](_0xdc90('0x32'),_0x5f0d65,_0x4e0ba6,_0x3857ef);})[_0xdc90('0x33')](function(_0x157649){logger[_0xdc90('0x34')](_0xdc90('0x35'),_0x5f0d65,_0x157649);});delete _0x494722['timers'][_0x3cc87a];};}});}else{logger[_0xdc90('0x31')](_0xdc90('0x36'),_0x5f0d65,_0x3cc87a,_0x341ed6);}});}})['catch'](function(_0x298833){logger[_0xdc90('0x34')](_0xdc90('0x27'),_0x5f0d65,_0x494722[_0xdc90('0x6')][_0x341ed6]['acwTimeout'],_0x3cc87a,_0x341ed6);})[_0xdc90('0x37')](function(){delete _0x494722[_0xdc90('0x8')][_0x5f0d65];});}catch(_0x55d5e9){logger[_0xdc90('0x34')](_0xdc90('0x38'),_0x55d5e9[_0xdc90('0x39')]);}};Acw['prototype'][_0xdc90('0x29')]=function(_0x58a53a){try{var _0x2d5c85=this;if(_0x2d5c85['timers'][_0x58a53a]){_0x2d5c85[_0xdc90('0x26')][_0x58a53a]['timer']=![];var _0x5af603=_0x2d5c85[_0xdc90('0x26')][_0x58a53a][_0xdc90('0x30')];var _0x136f91=_0x2d5c85['timers'][_0x58a53a][_0xdc90('0x1a')];var _0x2f4ff0=_0x2d5c85[_0xdc90('0x6')][_0x136f91][_0xdc90('0x28')];logger[_0xdc90('0x31')](_0xdc90('0x3a'),_0x5af603,_0x58a53a);RpcUser[_0xdc90('0x3b')](this['agents'][_0x58a53a]);RpcVoiceAgentReport[_0xdc90('0x2f')]({'acwtime':_0x2f4ff0,'agentacw':!![]},_0x5af603,_0x58a53a)[_0xdc90('0x1f')](function(_0x1f6968){logger[_0xdc90('0x31')](_0xdc90('0x32'),_0x5af603,_0x2f4ff0,_0x1f6968);})[_0xdc90('0x33')](function(_0x57ffff){logger[_0xdc90('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x5af603,_0x57ffff);});}else{logger['error'](_0xdc90('0x3c'),_0x58a53a);if(_0x2d5c85[_0xdc90('0x26')]){logger[_0xdc90('0x31')]('[ACW][TIMERS]',JSON[_0xdc90('0x3d')](_0x2d5c85[_0xdc90('0x26')]));}}}catch(_0x50e2d6){logger[_0xdc90('0x34')]('[ACW][STOP]\x20%s',_0x50e2d6['message']);}};Acw[_0xdc90('0x3e')][_0xdc90('0xa')]=function(_0x163517){try{if(this['voiceQueues'][_0x163517['queue']]&&(this[_0xdc90('0x6')][_0x163517[_0xdc90('0x1a')]][_0xdc90('0x3')]||this[_0xdc90('0x6')][_0x163517[_0xdc90('0x1a')]][_0xdc90('0x1c')])){if(this[_0xdc90('0x7')][_0x163517[_0xdc90('0x19')]]){this[_0xdc90('0x8')][_0x163517[_0xdc90('0x30')]]={'queue':_0x163517['queue'],'interface':_0x163517[_0xdc90('0x19')],'destlinkedid':_0x163517[_0xdc90('0x24')]};}}}catch(_0x59fd9f){logger['error'](_0xdc90('0x3f'),_0x59fd9f[_0xdc90('0x39')]);}};Acw['prototype'][_0xdc90('0x40')]=function(_0xc03c38){try{if(this[_0xdc90('0x6')][_0xc03c38[_0xdc90('0x1a')]]&&(this[_0xdc90('0x6')][_0xc03c38[_0xdc90('0x1a')]][_0xdc90('0x3')]||this[_0xdc90('0x6')][_0xc03c38[_0xdc90('0x1a')]][_0xdc90('0x1c')])){if(this[_0xdc90('0x7')][_0xc03c38[_0xdc90('0x19')]]){this[_0xdc90('0x8')][_0xc03c38[_0xdc90('0x30')]]={'queue':_0xc03c38[_0xdc90('0x1a')],'interface':_0xc03c38[_0xdc90('0x19')]};}}}catch(_0x44f197){logger[_0xdc90('0x34')](_0xdc90('0x41'),_0x44f197['message']);}};Acw[_0xdc90('0x3e')]['syncHangupRequest']=function(_0x1524fc){try{if(this[_0xdc90('0x8')][_0x1524fc[_0xdc90('0x30')]]&&_[_0xdc90('0x42')](this[_0xdc90('0x8')][_0x1524fc[_0xdc90('0x30')]][_0xdc90('0x23')])){logger[_0xdc90('0x31')](_0xdc90('0x43'),_0x1524fc[_0xdc90('0x30')]);this['startAcw'](_0x1524fc[_0xdc90('0x30')]);}else if(this[_0xdc90('0x8')][_0x1524fc[_0xdc90('0x44')]]&&_[_0xdc90('0x42')](this[_0xdc90('0x8')][_0x1524fc[_0xdc90('0x44')]][_0xdc90('0x23')])){logger['info'](_0xdc90('0x45'),_0x1524fc[_0xdc90('0x44')]);this[_0xdc90('0x18')](_0x1524fc[_0xdc90('0x44')]);}}catch(_0x482fb0){logger[_0xdc90('0x34')](_0xdc90('0x46'),_0x482fb0[_0xdc90('0x39')]);}};Acw['prototype'][_0xdc90('0xe')]=function(_0x2ce501){try{if(this[_0xdc90('0x8')][_0x2ce501['uniqueid']]&&this[_0xdc90('0x8')][_0x2ce501[_0xdc90('0x30')]]['attended']){logger[_0xdc90('0x31')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2ce501[_0xdc90('0x30')]);this['startAcw'](_0x2ce501[_0xdc90('0x30')]);}else if(this[_0xdc90('0x8')][_0x2ce501[_0xdc90('0x44')]]&&this['channels'][_0x2ce501[_0xdc90('0x44')]][_0xdc90('0x23')]){logger['info'](_0xdc90('0x47'),_0x2ce501['linkedid']);this[_0xdc90('0x18')](_0x2ce501[_0xdc90('0x44')]);}}catch(_0x35606a){logger[_0xdc90('0x34')](_0xdc90('0x48'),_0x35606a[_0xdc90('0x39')]);}};Acw[_0xdc90('0x3e')][_0xdc90('0x11')]=function(_0x13b583){try{if(!_[_0xdc90('0x49')](this[_0xdc90('0x8')][_0x13b583['transfereeuniqueid']])){this[_0xdc90('0x18')](_0x13b583[_0xdc90('0x4a')]);if(this['channels'][_0x13b583['secondtransfereruniqueid']]){this['channels'][_0x13b583[_0xdc90('0x4b')]][_0xdc90('0x23')]=!![];this['channels'][_0x13b583[_0xdc90('0x4c')]]=this[_0xdc90('0x8')][_0x13b583[_0xdc90('0x4b')]];delete this[_0xdc90('0x8')][_0x13b583['secondtransfereruniqueid']];}}else if(!_[_0xdc90('0x49')](this[_0xdc90('0x8')][_0x13b583[_0xdc90('0x4c')]])){this[_0xdc90('0x18')](_0x13b583[_0xdc90('0x4c')]);if(this[_0xdc90('0x8')][_0x13b583['origtransfereruniqueid']]){this[_0xdc90('0x8')][_0x13b583['origtransfereruniqueid']]['attended']=!![];this[_0xdc90('0x8')][_0x13b583[_0xdc90('0x4a')]]=this[_0xdc90('0x8')][_0x13b583['origtransfereruniqueid']];delete this[_0xdc90('0x8')][_0x13b583[_0xdc90('0x4d')]];}}}catch(_0x19b5cb){logger['error'](_0xdc90('0x4e'),_0x19b5cb[_0xdc90('0x39')]);}};Acw['prototype'][_0xdc90('0x13')]=function(_0x56e412){try{if(this[_0xdc90('0x8')][_0x56e412['transfereruniqueid']]){logger[_0xdc90('0x31')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xdc90('0x3d')](_0x56e412[_0xdc90('0x4f')]));this['startAcw'](_0x56e412[_0xdc90('0x4f')]);}else if(this[_0xdc90('0x8')][_0x56e412['transfererlinkedid']]){logger[_0xdc90('0x31')](_0xdc90('0x50'),JSON['stringify'](_0x56e412['transfererlinkedid']));this[_0xdc90('0x18')](_0x56e412[_0xdc90('0x51')]);}}catch(_0x5b5dda){logger[_0xdc90('0x34')](_0xdc90('0x52'),_0x5b5dda[_0xdc90('0x39')]);}};Acw['prototype'][_0xdc90('0x10')]=function(_0x538ba2){try{if(this[_0xdc90('0x6')][_0x538ba2[_0xdc90('0x1a')]]&&this['voiceQueues'][_0x538ba2['queue']][_0xdc90('0x53')]===_0xdc90('0x54')){if(this['agents'][_0x538ba2[_0xdc90('0x19')]]){logger[_0xdc90('0x31')](_0xdc90('0x55'),_0x538ba2[_0xdc90('0x30')],_0x538ba2[_0xdc90('0x19')],_0x538ba2[_0xdc90('0x1a')]);return RpcUser[_0xdc90('0x25')](this[_0xdc90('0x7')][_0x538ba2[_0xdc90('0x19')]],'Auto-Pause',_0x538ba2[_0xdc90('0x30')]);}}}catch(_0x5c6c58){logger['error'](_0xdc90('0x56'),_0x5c6c58[_0xdc90('0x39')]);}};module[_0xdc90('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 94c232e..09c876d 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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x2991e2,_0x435468){_0x2991e2=_0x2991e2-0x0;var _0x4d0fd7=_0x2032[_0x2991e2];return _0x4d0fd7;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x4c987f,_0x5bb5d9){var _0x523598=function(_0x4e57ab){while(--_0x4e57ab){_0x4c987f['push'](_0x4c987f['shift']());}};_0x523598(++_0x5bb5d9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0x0b0e[_0x1979d8];return _0x1d5bb3;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),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 bf55eae..4a447ce 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2a8a97,_0x2d5a32){_0x2a8a97=_0x2a8a97-0x0;var _0x470ec5=_0xb43b[_0x2a8a97];return _0x470ec5;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xda3f,0xec));var _0xfda3=function(_0x38162e,_0x31266d){_0x38162e=_0x38162e-0x0;var _0x361218=_0xda3f[_0x38162e];return _0x361218;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index c739145..5a084bd 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd109=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat'];(function(_0x1acfb9,_0x52bc80){var _0x1416e3=function(_0x1909d1){while(--_0x1909d1){_0x1acfb9['push'](_0x1acfb9['shift']());}};_0x1416e3(++_0x52bc80);}(_0xd109,0xcb));var _0x9d10=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd109[_0x40220a];return _0x3903cc;};'use strict';var util=require(_0x9d10('0x0'));var _=require(_0x9d10('0x1'));var moment=require(_0x9d10('0x2'));function checkNameSurname(_0xff44f2,_0x18dc5a,_0x3f5fc7){var _0x239cfb='';if(!_[_0x9d10('0x3')](_0x18dc5a)&&_0x9d10('0x4')===typeof _0x18dc5a){_0x239cfb+=_0x18dc5a;}if(!_['isNil'](_0x3f5fc7)&&_0x9d10('0x4')===typeof _0x3f5fc7){_0x239cfb+='\x20'+_0x3f5fc7;}if(_0x239cfb!==''){return _0x239cfb;}return _0xff44f2;}function Action(_0xe64def,_0x28c017,_0x30ff8b){this[_0x9d10('0x5')]=_0xe64def;this['uniqueid']=_0x30ff8b||undefined;this[_0x9d10('0x6')]=checkNameSurname(_0x28c017[_0x9d10('0x7')][_0x9d10('0x8')],_0x28c017[_0x9d10('0x7')][_0x9d10('0x9')],_0x28c017['Contact'][_0x9d10('0xa')]);this[_0x9d10('0xb')]=_0x28c017[_0x9d10('0x8')];this[_0x9d10('0xc')]=_0xe64def[_0x9d10('0x6')];this[_0x9d10('0xd')]=_0x28c017[_0x9d10('0xd')]||![];this[_0x9d10('0xe')]=_0xe64def[_0x9d10('0xe')];this[_0x9d10('0xf')]=_0xe64def[_0x9d10('0xf')]||0x3;this[_0x9d10('0x10')]=_0x28c017[_0x9d10('0x10')];this['countbusyretry']=_0x28c017['countbusyretry'];this['countcongestionretry']=_0x28c017[_0x9d10('0x11')];this[_0x9d10('0x12')]=_0x28c017['countnoanswerretry'];this[_0x9d10('0x13')]=_0x28c017['countnosuchnumberretry'];this[_0x9d10('0x14')]=_0x28c017[_0x9d10('0x14')];this['countabandonedretry']=_0x28c017[_0x9d10('0x15')];this['countmachineretry']=_0x28c017[_0x9d10('0x16')];this['countagentrejectretry']=_0x28c017[_0x9d10('0x17')];this[_0x9d10('0x18')]=_0x28c017[_0x9d10('0x18')];this[_0x9d10('0x19')]=_0x28c017[_0x9d10('0x19')];this[_0x9d10('0x1a')]=_0x28c017[_0x9d10('0x1a')];this[_0x9d10('0x1b')]=_0x28c017[_0x9d10('0x1b')];this['CampaignId']=_0x28c017['CampaignId'];this['idHopper']=_0x28c017['id'];this[_0x9d10('0x1c')]=_0x28c017['Contact'][_0x9d10('0x9')]||'';this[_0x9d10('0x1d')]=moment()[_0x9d10('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x28c017[_0x9d10('0x1f')];this['callbackuniqueid']=_0x28c017[_0x9d10('0x20')];this[_0x9d10('0x21')]=_0x28c017[_0x9d10('0x21')];this[_0x9d10('0x22')]=_0x28c017[_0x9d10('0x22')];this[_0x9d10('0x23')]='';this[_0x9d10('0x24')]='';}Action[_0x9d10('0x25')][_0x9d10('0x26')]=function(){return util['format'](_0x9d10('0x27'),this[_0x9d10('0x6')],this[_0x9d10('0x5')][_0x9d10('0x28')]>0x0?this[_0x9d10('0xb')][_0x9d10('0x29')](this[_0x9d10('0x5')]['dialCutDigit']):this[_0x9d10('0xb')]);};Action['prototype'][_0x9d10('0x2a')]=function(){return this[_0x9d10('0xc')];};module[_0x9d10('0x2b')]=Action; \ No newline at end of file +var _0xf5bc=['VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','substring','voiceQueue','dialCutDigit','getQueue','isNil','string','name','Contact','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId'];(function(_0x183dc8,_0x44675d){var _0x555fc6=function(_0x2314eb){while(--_0x2314eb){_0x183dc8['push'](_0x183dc8['shift']());}};_0x555fc6(++_0x44675d);}(_0xf5bc,0x133));var _0xcf5b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf5bc[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x3d9c1a,_0x1eed1e,_0x3e8b70){var _0x149cb4='';if(!_[_0xcf5b('0x0')](_0x1eed1e)&&_0xcf5b('0x1')===typeof _0x1eed1e){_0x149cb4+=_0x1eed1e;}if(!_[_0xcf5b('0x0')](_0x3e8b70)&&_0xcf5b('0x1')===typeof _0x3e8b70){_0x149cb4+='\x20'+_0x3e8b70;}if(_0x149cb4!==''){return _0x149cb4;}return _0x3d9c1a;}function Action(_0x328fb6,_0x5986a5,_0x33bb87){this['voiceQueue']=_0x328fb6;this['uniqueid']=_0x33bb87||undefined;this[_0xcf5b('0x2')]=checkNameSurname(_0x5986a5[_0xcf5b('0x3')]['phone'],_0x5986a5[_0xcf5b('0x3')]['firstName'],_0x5986a5[_0xcf5b('0x3')]['lastName']);this[_0xcf5b('0x4')]=_0x5986a5[_0xcf5b('0x5')];this[_0xcf5b('0x6')]=_0x328fb6[_0xcf5b('0x2')];this[_0xcf5b('0x7')]=_0x5986a5[_0xcf5b('0x7')]||![];this[_0xcf5b('0x8')]=_0x328fb6[_0xcf5b('0x8')];this['dialQueueTimeout']=_0x328fb6[_0xcf5b('0x9')]||0x3;this[_0xcf5b('0xa')]=_0x5986a5[_0xcf5b('0xa')];this['countbusyretry']=_0x5986a5[_0xcf5b('0xb')];this[_0xcf5b('0xc')]=_0x5986a5[_0xcf5b('0xc')];this['countnoanswerretry']=_0x5986a5[_0xcf5b('0xd')];this[_0xcf5b('0xe')]=_0x5986a5[_0xcf5b('0xe')];this['countdropretry']=_0x5986a5[_0xcf5b('0xf')];this[_0xcf5b('0x10')]=_0x5986a5[_0xcf5b('0x10')];this['countmachineretry']=_0x5986a5['countmachineretry'];this[_0xcf5b('0x11')]=_0x5986a5[_0xcf5b('0x11')];this[_0xcf5b('0x12')]=_0x5986a5['ContactId'];this[_0xcf5b('0x13')]=_0x5986a5[_0xcf5b('0x13')];this[_0xcf5b('0x14')]=_0x5986a5['UserId'];this[_0xcf5b('0x15')]=_0x5986a5['VoiceQueueId'];this[_0xcf5b('0x16')]=_0x5986a5[_0xcf5b('0x16')];this[_0xcf5b('0x17')]=_0x5986a5['id'];this[_0xcf5b('0x18')]=_0x5986a5[_0xcf5b('0x3')][_0xcf5b('0x19')]||'';this[_0xcf5b('0x1a')]=moment()[_0xcf5b('0x1b')](_0xcf5b('0x1c'));this[_0xcf5b('0x1d')]=_0x5986a5[_0xcf5b('0x1d')];this[_0xcf5b('0x1e')]=_0x5986a5[_0xcf5b('0x1e')];this[_0xcf5b('0x1f')]=_0x5986a5[_0xcf5b('0x1f')];this[_0xcf5b('0x20')]=_0x5986a5[_0xcf5b('0x20')];this[_0xcf5b('0x21')]='';this[_0xcf5b('0x22')]='';}Action[_0xcf5b('0x23')][_0xcf5b('0x24')]=function(){return util[_0xcf5b('0x1b')]('\x22%s\x22\x20<%s>',this[_0xcf5b('0x2')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0xcf5b('0x25')](this[_0xcf5b('0x26')][_0xcf5b('0x27')]):this[_0xcf5b('0x4')]);};Action[_0xcf5b('0x23')][_0xcf5b('0x28')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index c65d4e4..ec93458 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5aa=['talktime','endtime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x5d1026,_0x8c8732){var _0xe2bef3=function(_0x171ba5){while(--_0x171ba5){_0x5d1026['push'](_0x5d1026['shift']());}};_0xe2bef3(++_0x8c8732);}(_0xf5aa,0xc2));var _0xaf5a=function(_0x2945cd,_0x246524){_0x2945cd=_0x2945cd-0x0;var _0x24c63b=_0xf5aa[_0x2945cd];return _0x24c63b;};'use strict';var util=require(_0xaf5a('0x0'));var _=require(_0xaf5a('0x1'));var moment=require('moment');function getSeconds(_0x25deae,_0x493603){var _0x2e5ff0=moment(_0x25deae)[_0xaf5a('0x2')](0x0);var _0x3e02b4=moment(_0x493603)[_0xaf5a('0x2')](0x0);return _0x2e5ff0[_0xaf5a('0x3')](_0x3e02b4,_0xaf5a('0x4'));}function AgentComplete(_0x5c432e,_0x20f797){this[_0xaf5a('0x5')]=0x4;this[_0xaf5a('0x6')]='Answer';this[_0xaf5a('0x7')]=_0x5c432e[_0xaf5a('0x7')];this[_0xaf5a('0x8')]=_0x5c432e[_0xaf5a('0x8')];this[_0xaf5a('0x9')]=_0x5c432e['type']===_0xaf5a('0xa')?_0xaf5a('0xb'):_0x5c432e[_0xaf5a('0x8')];this['countbusyretry']=_0x5c432e[_0xaf5a('0xc')];this[_0xaf5a('0xd')]=_0x5c432e[_0xaf5a('0xd')];this[_0xaf5a('0xe')]=_0x5c432e[_0xaf5a('0xe')];this[_0xaf5a('0xf')]=_0x5c432e['countbusyretry']+_0x5c432e[_0xaf5a('0xd')]+_0x5c432e[_0xaf5a('0xe')]+_0x5c432e[_0xaf5a('0x10')]+_0x5c432e[_0xaf5a('0x11')]+_0x5c432e[_0xaf5a('0x12')]+_0x5c432e[_0xaf5a('0x13')]+_0x5c432e[_0xaf5a('0x14')];this['countnosuchnumberretry']=_0x5c432e[_0xaf5a('0x10')];this[_0xaf5a('0x11')]=_0x5c432e['countdropretry'];this['countabandonedretry']=_0x5c432e[_0xaf5a('0x12')];this['countmachineretry']=_0x5c432e['countmachineretry'];this['countagentrejectretry']=_0x5c432e['countagentrejectretry'];this[_0xaf5a('0x15')]=_0x20f797[_0xaf5a('0x15')];this['calleridname']=_0x5c432e[_0xaf5a('0x16')];this[_0xaf5a('0x17')]=_0x5c432e['number'];this[_0xaf5a('0x18')]=_0x5c432e[_0xaf5a('0x18')];this[_0xaf5a('0x19')]=_0x5c432e['responsetime'];this[_0xaf5a('0x1a')]=_0x5c432e[_0xaf5a('0x1a')];this['endtime']=moment()[_0xaf5a('0x1b')](_0xaf5a('0x1c'));this[_0xaf5a('0x1d')]=getSeconds(_0x5c432e[_0xaf5a('0x19')],_0x5c432e[_0xaf5a('0x18')]);this[_0xaf5a('0x1e')]=getSeconds(_0x5c432e[_0xaf5a('0x1a')],_0x5c432e['responsetime']);this[_0xaf5a('0x1f')]=getSeconds(this[_0xaf5a('0x20')],_0x5c432e[_0xaf5a('0x1a')]);this[_0xaf5a('0xb')]=_0x20f797[_0xaf5a('0xb')];this['membername']=_0x20f797[_0xaf5a('0x21')];this['reason']=_0x20f797['reason'];this[_0xaf5a('0x22')]=_0x5c432e['callback'];this[_0xaf5a('0x23')]=_0x5c432e[_0xaf5a('0x23')];this[_0xaf5a('0x24')]=_0x5c432e[_0xaf5a('0x24')];this[_0xaf5a('0x25')]=_0x5c432e[_0xaf5a('0x25')];this[_0xaf5a('0x26')]=_0x5c432e[_0xaf5a('0x26')];this[_0xaf5a('0x27')]=_0x5c432e['ListId'];this['UserId']=_0x5c432e[_0xaf5a('0x28')];this[_0xaf5a('0x29')]=_0x5c432e[_0xaf5a('0x29')];this['CampaignId']=_0x5c432e['CampaignId'];this[_0xaf5a('0x2a')]=_0x5c432e[_0xaf5a('0x2a')]||'';this[_0xaf5a('0x2b')]=_0x5c432e[_0xaf5a('0x2b')]||'';}module[_0xaf5a('0x2c')]=AgentComplete; \ No newline at end of file +var _0x4347=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x3f369c,_0x1c5793){var _0x3f851a=function(_0x482e57){while(--_0x482e57){_0x3f369c['push'](_0x3f369c['shift']());}};_0x3f851a(++_0x1c5793);}(_0x4347,0xea));var _0x7434=function(_0x10c97a,_0x1dc52e){_0x10c97a=_0x10c97a-0x0;var _0x54e5a5=_0x4347[_0x10c97a];return _0x54e5a5;};'use strict';var util=require(_0x7434('0x0'));var _=require(_0x7434('0x1'));var moment=require('moment');function getSeconds(_0x2bda83,_0x3dd677){var _0x272b28=moment(_0x2bda83)[_0x7434('0x2')](0x0);var _0x3e4f33=moment(_0x3dd677)['milliseconds'](0x0);return _0x272b28[_0x7434('0x3')](_0x3e4f33,'seconds');}function AgentComplete(_0x220178,_0x17c603){this[_0x7434('0x4')]=0x4;this[_0x7434('0x5')]=_0x7434('0x6');this['scheduledat']=_0x220178[_0x7434('0x7')];this['type']=_0x220178['type'];this[_0x7434('0x8')]=_0x220178[_0x7434('0x9')]===_0x7434('0xa')?_0x7434('0xb'):_0x220178['type'];this[_0x7434('0xc')]=_0x220178['countbusyretry'];this[_0x7434('0xd')]=_0x220178['countcongestionretry'];this[_0x7434('0xe')]=_0x220178[_0x7434('0xe')];this[_0x7434('0xf')]=_0x220178[_0x7434('0xc')]+_0x220178[_0x7434('0xd')]+_0x220178[_0x7434('0xe')]+_0x220178['countnosuchnumberretry']+_0x220178[_0x7434('0x10')]+_0x220178[_0x7434('0x11')]+_0x220178[_0x7434('0x12')]+_0x220178[_0x7434('0x13')];this[_0x7434('0x14')]=_0x220178[_0x7434('0x14')];this[_0x7434('0x10')]=_0x220178[_0x7434('0x10')];this[_0x7434('0x11')]=_0x220178[_0x7434('0x11')];this[_0x7434('0x12')]=_0x220178[_0x7434('0x12')];this[_0x7434('0x13')]=_0x220178[_0x7434('0x13')];this[_0x7434('0x15')]=_0x17c603[_0x7434('0x15')];this[_0x7434('0x16')]=_0x220178[_0x7434('0x17')];this[_0x7434('0x18')]=_0x220178['number'];this[_0x7434('0x19')]=_0x220178[_0x7434('0x19')];this[_0x7434('0x1a')]=_0x220178[_0x7434('0x1a')];this[_0x7434('0x1b')]=_0x220178[_0x7434('0x1b')];this[_0x7434('0x1c')]=moment()[_0x7434('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7434('0x1e')]=getSeconds(_0x220178['responsetime'],_0x220178['starttime']);this[_0x7434('0x1f')]=getSeconds(_0x220178['answertime'],_0x220178[_0x7434('0x1a')]);this[_0x7434('0x20')]=getSeconds(this[_0x7434('0x1c')],_0x220178[_0x7434('0x1b')]);this[_0x7434('0xb')]=_0x17c603['queue'];this[_0x7434('0x21')]=_0x17c603['membername'];this['reason']=_0x17c603[_0x7434('0x22')];this[_0x7434('0x23')]=_0x220178[_0x7434('0x23')];this[_0x7434('0x24')]=_0x220178[_0x7434('0x24')];this['callbackat']=_0x220178['callbackat'];this[_0x7434('0x25')]=_0x220178[_0x7434('0x25')];this[_0x7434('0x26')]=_0x220178['ContactId'];this[_0x7434('0x27')]=_0x220178['ListId'];this[_0x7434('0x28')]=_0x220178[_0x7434('0x28')];this[_0x7434('0x29')]=_0x220178[_0x7434('0x29')];this[_0x7434('0x2a')]=_0x220178[_0x7434('0x2a')];this[_0x7434('0x2b')]=_0x220178[_0x7434('0x2b')]||'';this[_0x7434('0x2c')]=_0x220178[_0x7434('0x2c')]||'';}module[_0x7434('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 34062a6..e9a23f4 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3baf=['countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x59a45c,_0x347cea){var _0x8f33fb=function(_0x31a5bf){while(--_0x31a5bf){_0x59a45c['push'](_0x59a45c['shift']());}};_0x8f33fb(++_0x347cea);}(_0x3baf,0xf7));var _0xf3ba=function(_0x3bb9da,_0x502962){_0x3bb9da=_0x3bb9da-0x0;var _0x17eef7=_0x3baf[_0x3bb9da];return _0x17eef7;};'use strict';var util=require(_0xf3ba('0x0'));var _=require(_0xf3ba('0x1'));var moment=require(_0xf3ba('0x2'));function getSeconds(_0x3979b3,_0x29bbc2){var _0x22f9c0=moment(_0x3979b3)[_0xf3ba('0x3')](0x0);var _0x306bdd=moment(_0x29bbc2)[_0xf3ba('0x3')](0x0);return _0x22f9c0[_0xf3ba('0x4')](_0x306bdd,_0xf3ba('0x5'));}function Final(_0x1c7a62){this[_0xf3ba('0x6')]=_0x1c7a62[_0xf3ba('0x6')];this[_0xf3ba('0x7')]=_0x1c7a62['scheduledat'];this['type']=_0x1c7a62['type'];this[_0xf3ba('0x8')]=_0x1c7a62['type']===_0xf3ba('0x9')?_0xf3ba('0xa'):_0x1c7a62[_0xf3ba('0xb')];this[_0xf3ba('0xc')]=_0x1c7a62[_0xf3ba('0xc')];this[_0xf3ba('0xd')]=_0x1c7a62[_0xf3ba('0xd')];this[_0xf3ba('0xe')]=_0x1c7a62[_0xf3ba('0xe')];this[_0xf3ba('0xf')]=_0x1c7a62[_0xf3ba('0xc')]+_0x1c7a62[_0xf3ba('0xd')]+_0x1c7a62[_0xf3ba('0xe')]+_0x1c7a62[_0xf3ba('0x10')]+_0x1c7a62[_0xf3ba('0x11')]+_0x1c7a62[_0xf3ba('0x12')]+_0x1c7a62[_0xf3ba('0x13')]+_0x1c7a62[_0xf3ba('0x14')];this['countnosuchnumberretry']=_0x1c7a62[_0xf3ba('0x10')];this['countdropretry']=_0x1c7a62[_0xf3ba('0x11')];this[_0xf3ba('0x12')]=_0x1c7a62[_0xf3ba('0x12')];this[_0xf3ba('0x13')]=_0x1c7a62[_0xf3ba('0x13')];this['countagentrejectretry']=_0x1c7a62[_0xf3ba('0x14')];this[_0xf3ba('0xa')]=_0x1c7a62[_0xf3ba('0xa')];this['calleridname']=_0x1c7a62[_0xf3ba('0x15')];this[_0xf3ba('0x16')]=_0x1c7a62[_0xf3ba('0x16')];this[_0xf3ba('0x17')]=_0x1c7a62['starttime'];this[_0xf3ba('0x18')]=_0x1c7a62[_0xf3ba('0x18')];this['endtime']=_0x1c7a62['responsetime'];this[_0xf3ba('0x19')]=_0x1c7a62[_0xf3ba('0x19')]||0x0;this[_0xf3ba('0x1a')]=_0x1c7a62['holdtime']||0x0;this[_0xf3ba('0x1b')]=_0x1c7a62[_0xf3ba('0x1b')]||0x0;this[_0xf3ba('0x1c')]=_0x1c7a62[_0xf3ba('0x1c')];this[_0xf3ba('0x1d')]=_0x1c7a62[_0xf3ba('0x1d')];this[_0xf3ba('0x1e')]=_0x1c7a62['callbackat'];this['recallme']=_0x1c7a62['recallme'];this[_0xf3ba('0x1f')]=_0x1c7a62[_0xf3ba('0x1f')];this[_0xf3ba('0x20')]=_0x1c7a62[_0xf3ba('0x20')];this[_0xf3ba('0x21')]=_0x1c7a62['UserId'];this['VoiceQueueId']=_0x1c7a62[_0xf3ba('0x22')];this[_0xf3ba('0x23')]=_0x1c7a62['CampaignId'];this[_0xf3ba('0x24')]=_0x1c7a62[_0xf3ba('0x24')]||'';this['originatecalleridname']=_0x1c7a62['originatecalleridname']||'';}module[_0xf3ba('0x25')]=Final; \ No newline at end of file +var _0x4b84=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x4b84[_0x2d344f];return _0x2e796b;};'use strict';var util=require(_0x44b8('0x0'));var _=require(_0x44b8('0x1'));var moment=require('moment');function getSeconds(_0x5005fd,_0x765943){var _0x519db3=moment(_0x5005fd)['milliseconds'](0x0);var _0x3b26c7=moment(_0x765943)[_0x44b8('0x2')](0x0);return _0x519db3[_0x44b8('0x3')](_0x3b26c7,'seconds');}function Final(_0x4f875e){this['uniqueid']=_0x4f875e[_0x44b8('0x4')];this['scheduledat']=_0x4f875e[_0x44b8('0x5')];this['type']=_0x4f875e[_0x44b8('0x6')];this['campaigntype']=_0x4f875e['type']===_0x44b8('0x7')?_0x44b8('0x8'):_0x4f875e[_0x44b8('0x6')];this['countbusyretry']=_0x4f875e[_0x44b8('0x9')];this[_0x44b8('0xa')]=_0x4f875e[_0x44b8('0xa')];this[_0x44b8('0xb')]=_0x4f875e[_0x44b8('0xb')];this[_0x44b8('0xc')]=_0x4f875e[_0x44b8('0x9')]+_0x4f875e['countcongestionretry']+_0x4f875e[_0x44b8('0xb')]+_0x4f875e[_0x44b8('0xd')]+_0x4f875e['countdropretry']+_0x4f875e[_0x44b8('0xe')]+_0x4f875e['countmachineretry']+_0x4f875e[_0x44b8('0xf')];this[_0x44b8('0xd')]=_0x4f875e['countnosuchnumberretry'];this[_0x44b8('0x10')]=_0x4f875e['countdropretry'];this['countabandonedretry']=_0x4f875e[_0x44b8('0xe')];this[_0x44b8('0x11')]=_0x4f875e[_0x44b8('0x11')];this[_0x44b8('0xf')]=_0x4f875e['countagentrejectretry'];this['queue']=_0x4f875e['queue'];this[_0x44b8('0x12')]=_0x4f875e['calleridname'];this[_0x44b8('0x13')]=_0x4f875e[_0x44b8('0x13')];this['starttime']=_0x4f875e[_0x44b8('0x14')];this[_0x44b8('0x15')]=_0x4f875e['responsetime'];this[_0x44b8('0x16')]=_0x4f875e[_0x44b8('0x15')];this['ringtime']=_0x4f875e[_0x44b8('0x17')]||0x0;this[_0x44b8('0x18')]=_0x4f875e[_0x44b8('0x18')]||0x0;this[_0x44b8('0x19')]=_0x4f875e[_0x44b8('0x19')]||0x0;this[_0x44b8('0x1a')]=_0x4f875e[_0x44b8('0x1a')];this[_0x44b8('0x1b')]=_0x4f875e[_0x44b8('0x1b')];this[_0x44b8('0x1c')]=_0x4f875e[_0x44b8('0x1c')];this[_0x44b8('0x1d')]=_0x4f875e['recallme'];this[_0x44b8('0x1e')]=_0x4f875e[_0x44b8('0x1e')];this[_0x44b8('0x1f')]=_0x4f875e[_0x44b8('0x1f')];this[_0x44b8('0x20')]=_0x4f875e['UserId'];this[_0x44b8('0x21')]=_0x4f875e['VoiceQueueId'];this[_0x44b8('0x22')]=_0x4f875e[_0x44b8('0x22')];this[_0x44b8('0x23')]=_0x4f875e[_0x44b8('0x23')]||'';this[_0x44b8('0x24')]=_0x4f875e['originatecalleridname']||'';}module[_0x44b8('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index d4fbc4e..6c45ebf 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7085=['membername','IVR','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x7085,0x1a6));var _0x5708=function(_0x49fb87,_0x5d65bb){_0x49fb87=_0x49fb87-0x0;var _0x17db71=_0x7085[_0x49fb87];return _0x17db71;};'use strict';var util=require('util');var _=require(_0x5708('0x0'));var moment=require('moment');function getSeconds(_0x294326,_0x23d77e){var _0x484d34=moment(_0x294326)['milliseconds'](0x0);var _0xf33acc=moment(_0x23d77e)[_0x5708('0x1')](0x0);return _0x484d34['diff'](_0xf33acc,_0x5708('0x2'));}function Hangup(_0x10d409,_0x22e007){this[_0x5708('0x3')]=0x4;this[_0x5708('0x4')]=_0x5708('0x5');this['scheduledat']=_0x10d409[_0x5708('0x6')];this[_0x5708('0x7')]=_0x10d409['type'];this[_0x5708('0x8')]=_0x10d409[_0x5708('0x7')]===_0x5708('0x9')?_0x5708('0xa'):_0x10d409[_0x5708('0x7')];this[_0x5708('0xb')]=_0x10d409[_0x5708('0xb')];this[_0x5708('0xc')]=_0x10d409[_0x5708('0xc')];this[_0x5708('0xd')]=_0x10d409[_0x5708('0xd')];this[_0x5708('0xe')]=_0x10d409[_0x5708('0xb')]+_0x10d409['countcongestionretry']+_0x10d409[_0x5708('0xd')]+_0x10d409[_0x5708('0xf')]+_0x10d409[_0x5708('0x10')]+_0x10d409['countabandonedretry']+_0x10d409[_0x5708('0x11')]+_0x10d409[_0x5708('0x12')];this[_0x5708('0xf')]=_0x10d409[_0x5708('0xf')];this[_0x5708('0x10')]=_0x10d409[_0x5708('0x10')];this['countabandonedretry']=_0x10d409['countabandonedretry'];this[_0x5708('0x11')]=_0x10d409[_0x5708('0x11')];this[_0x5708('0x12')]=_0x10d409[_0x5708('0x12')];this[_0x5708('0x13')]=_0x22e007[_0x5708('0x13')];this['calleridname']=_0x10d409[_0x5708('0x14')];this['calleridnum']=_0x10d409[_0x5708('0x15')];this[_0x5708('0x16')]=_0x10d409[_0x5708('0x16')];this[_0x5708('0x17')]=_0x10d409[_0x5708('0x17')];this[_0x5708('0x18')]=moment()[_0x5708('0x19')](_0x5708('0x1a'));this[_0x5708('0x1b')]=getSeconds(_0x10d409[_0x5708('0x17')],_0x10d409[_0x5708('0x16')]);this[_0x5708('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x5708('0x18')],_0x10d409['responsetime']);this[_0x5708('0xa')]=_0x10d409['queue'];this[_0x5708('0x1d')]=_0x5708('0x1e');this['reason']=_0x22e007[_0x5708('0x1f')];this[_0x5708('0x20')]=_0x10d409[_0x5708('0x20')];this[_0x5708('0x21')]=_0x10d409[_0x5708('0x21')];this['callbackat']=_0x10d409['callbackat'];this[_0x5708('0x22')]=_0x10d409[_0x5708('0x22')];this[_0x5708('0x23')]=_0x10d409[_0x5708('0x23')];this[_0x5708('0x24')]=_0x10d409[_0x5708('0x24')];this[_0x5708('0x25')]=_0x10d409[_0x5708('0x25')];this[_0x5708('0x26')]=_0x10d409[_0x5708('0x26')];this[_0x5708('0x27')]=_0x10d409[_0x5708('0x27')];}module[_0x5708('0x28')]=Hangup; \ No newline at end of file +var _0x214b=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','queue','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry'];(function(_0x227901,_0x1d8fca){var _0x5a55e4=function(_0x528862){while(--_0x528862){_0x227901['push'](_0x227901['shift']());}};_0x5a55e4(++_0x1d8fca);}(_0x214b,0x1a3));var _0xb214=function(_0x411b71,_0x38c1af){_0x411b71=_0x411b71-0x0;var _0x870e79=_0x214b[_0x411b71];return _0x870e79;};'use strict';var util=require(_0xb214('0x0'));var _=require('lodash');var moment=require(_0xb214('0x1'));function getSeconds(_0x181b37,_0x5b1a85){var _0x32a08d=moment(_0x181b37)[_0xb214('0x2')](0x0);var _0x384e9f=moment(_0x5b1a85)[_0xb214('0x2')](0x0);return _0x32a08d[_0xb214('0x3')](_0x384e9f,'seconds');}function Hangup(_0x154c2c,_0x409128){this[_0xb214('0x4')]=0x4;this[_0xb214('0x5')]=_0xb214('0x6');this[_0xb214('0x7')]=_0x154c2c['scheduledat'];this[_0xb214('0x8')]=_0x154c2c[_0xb214('0x8')];this[_0xb214('0x9')]=_0x154c2c[_0xb214('0x8')]==='outbound'?'queue':_0x154c2c[_0xb214('0x8')];this[_0xb214('0xa')]=_0x154c2c[_0xb214('0xa')];this['countcongestionretry']=_0x154c2c[_0xb214('0xb')];this[_0xb214('0xc')]=_0x154c2c[_0xb214('0xc')];this['countglobal']=_0x154c2c[_0xb214('0xa')]+_0x154c2c[_0xb214('0xb')]+_0x154c2c[_0xb214('0xc')]+_0x154c2c[_0xb214('0xd')]+_0x154c2c['countdropretry']+_0x154c2c[_0xb214('0xe')]+_0x154c2c['countmachineretry']+_0x154c2c[_0xb214('0xf')];this[_0xb214('0xd')]=_0x154c2c[_0xb214('0xd')];this[_0xb214('0x10')]=_0x154c2c[_0xb214('0x10')];this['countabandonedretry']=_0x154c2c[_0xb214('0xe')];this[_0xb214('0x11')]=_0x154c2c[_0xb214('0x11')];this[_0xb214('0xf')]=_0x154c2c['countagentrejectretry'];this[_0xb214('0x12')]=_0x409128[_0xb214('0x12')];this[_0xb214('0x13')]=_0x154c2c[_0xb214('0x14')];this[_0xb214('0x15')]=_0x154c2c[_0xb214('0x16')];this['starttime']=_0x154c2c[_0xb214('0x17')];this[_0xb214('0x18')]=_0x154c2c[_0xb214('0x18')];this['endtime']=moment()[_0xb214('0x19')](_0xb214('0x1a'));this[_0xb214('0x1b')]=getSeconds(_0x154c2c[_0xb214('0x18')],_0x154c2c[_0xb214('0x17')]);this['holdtime']=0x0;this[_0xb214('0x1c')]=getSeconds(this[_0xb214('0x1d')],_0x154c2c[_0xb214('0x18')]);this[_0xb214('0x1e')]=_0x154c2c[_0xb214('0x1e')];this['membername']=_0xb214('0x1f');this['reason']=_0x409128[_0xb214('0x20')];this[_0xb214('0x21')]=_0x154c2c['callback'];this[_0xb214('0x22')]=_0x154c2c[_0xb214('0x22')];this[_0xb214('0x23')]=_0x154c2c[_0xb214('0x23')];this[_0xb214('0x24')]=_0x154c2c['recallme'];this[_0xb214('0x25')]=_0x154c2c[_0xb214('0x25')];this[_0xb214('0x26')]=_0x154c2c[_0xb214('0x26')];this[_0xb214('0x27')]=_0x154c2c[_0xb214('0x27')];this[_0xb214('0x28')]=_0x154c2c[_0xb214('0x28')];this['CampaignId']=_0x154c2c[_0xb214('0x29')];}module[_0xb214('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 0c0842a..eddc231 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x537a=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','lodash'];(function(_0x1fe1c2,_0xb435b0){var _0x37c825=function(_0x18fa12){while(--_0x18fa12){_0x1fe1c2['push'](_0x1fe1c2['shift']());}};_0x37c825(++_0xb435b0);}(_0x537a,0x1ac));var _0xa537=function(_0x4ad075,_0x3cf4f6){_0x4ad075=_0x4ad075-0x0;var _0xcd775b=_0x537a[_0x4ad075];return _0xcd775b;};'use strict';var util=require('util');var _=require(_0xa537('0x0'));var moment=require(_0xa537('0x1'));function getSeconds(_0x45095f,_0x42e462){var _0xd5939f=moment(_0x45095f)[_0xa537('0x2')](0x0);var _0x284273=moment(_0x42e462)[_0xa537('0x2')](0x0);return _0xd5939f[_0xa537('0x3')](_0x284273,_0xa537('0x4'));}function History(_0x1b8e77){this['uniqueid']=_0x1b8e77[_0xa537('0x5')];this['scheduledat']=_0x1b8e77[_0xa537('0x6')]||undefined;this[_0xa537('0x7')]=_0x1b8e77['type'];this['campaigntype']=_0x1b8e77[_0xa537('0x7')]===_0xa537('0x8')?_0xa537('0x9'):_0x1b8e77[_0xa537('0x7')];this[_0xa537('0xa')]=_0x1b8e77[_0xa537('0xa')];this[_0xa537('0xb')]=_0x1b8e77[_0xa537('0xb')];this[_0xa537('0xc')]=_0x1b8e77[_0xa537('0xc')];this[_0xa537('0xd')]=_0x1b8e77[_0xa537('0xa')]+_0x1b8e77[_0xa537('0xb')]+_0x1b8e77['countnoanswerretry']+_0x1b8e77[_0xa537('0xe')]+_0x1b8e77[_0xa537('0xf')]+_0x1b8e77[_0xa537('0x10')]+_0x1b8e77[_0xa537('0x11')]+_0x1b8e77['countagentrejectretry'];this[_0xa537('0xe')]=_0x1b8e77[_0xa537('0xe')];this[_0xa537('0xf')]=_0x1b8e77['countdropretry'];this[_0xa537('0x10')]=_0x1b8e77[_0xa537('0x10')];this[_0xa537('0x11')]=_0x1b8e77[_0xa537('0x11')];this[_0xa537('0x12')]=_0x1b8e77[_0xa537('0x12')];this[_0xa537('0x9')]=_0x1b8e77[_0xa537('0x9')];this[_0xa537('0x13')]=_0x1b8e77[_0xa537('0x14')];this[_0xa537('0x15')]=_0x1b8e77[_0xa537('0x16')];this[_0xa537('0x17')]=_0x1b8e77['starttime'];this[_0xa537('0x18')]=_0x1b8e77[_0xa537('0x18')];this[_0xa537('0x19')]=_0x1b8e77[_0xa537('0x18')];this[_0xa537('0x1a')]=getSeconds(_0x1b8e77['responsetime'],_0x1b8e77[_0xa537('0x17')]);this[_0xa537('0x1b')]=0x0;this[_0xa537('0x1c')]=0x0;this[_0xa537('0x1d')]=_0x1b8e77[_0xa537('0x1d')];this[_0xa537('0x1e')]=_0x1b8e77['callbackuniqueid'];this[_0xa537('0x1f')]=_0x1b8e77[_0xa537('0x1f')];this['recallme']=_0x1b8e77[_0xa537('0x20')];this[_0xa537('0x21')]=_0x1b8e77['ContactId'];this[_0xa537('0x22')]=_0x1b8e77['ListId'];this[_0xa537('0x23')]=_0x1b8e77['UserId'];this[_0xa537('0x24')]=_0x1b8e77[_0xa537('0x24')];this['CampaignId']=_0x1b8e77['CampaignId'];this['originatecalleridnum']=_0x1b8e77[_0xa537('0x25')]||'';this['originatecalleridname']=_0x1b8e77[_0xa537('0x26')]||'';}module['exports']=History; \ No newline at end of file +var _0xa3eb=['milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x3dc559,_0x31b77e){var _0x16e92f=function(_0xfd2f6b){while(--_0xfd2f6b){_0x3dc559['push'](_0x3dc559['shift']());}};_0x16e92f(++_0x31b77e);}(_0xa3eb,0x1c5));var _0xba3e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa3eb[_0x2bf141];return _0x48277b;};'use strict';var util=require(_0xba3e('0x0'));var _=require(_0xba3e('0x1'));var moment=require('moment');function getSeconds(_0x4222d6,_0x41dcef){var _0x16d3e7=moment(_0x4222d6)[_0xba3e('0x2')](0x0);var _0x27194d=moment(_0x41dcef)[_0xba3e('0x2')](0x0);return _0x16d3e7[_0xba3e('0x3')](_0x27194d,_0xba3e('0x4'));}function History(_0x168d54){this[_0xba3e('0x5')]=_0x168d54[_0xba3e('0x5')];this[_0xba3e('0x6')]=_0x168d54[_0xba3e('0x6')]||undefined;this[_0xba3e('0x7')]=_0x168d54['type'];this['campaigntype']=_0x168d54[_0xba3e('0x7')]==='outbound'?_0xba3e('0x8'):_0x168d54[_0xba3e('0x7')];this[_0xba3e('0x9')]=_0x168d54[_0xba3e('0x9')];this[_0xba3e('0xa')]=_0x168d54[_0xba3e('0xa')];this[_0xba3e('0xb')]=_0x168d54[_0xba3e('0xb')];this[_0xba3e('0xc')]=_0x168d54[_0xba3e('0x9')]+_0x168d54['countcongestionretry']+_0x168d54[_0xba3e('0xb')]+_0x168d54[_0xba3e('0xd')]+_0x168d54[_0xba3e('0xe')]+_0x168d54[_0xba3e('0xf')]+_0x168d54[_0xba3e('0x10')]+_0x168d54['countagentrejectretry'];this['countnosuchnumberretry']=_0x168d54['countnosuchnumberretry'];this['countdropretry']=_0x168d54['countdropretry'];this[_0xba3e('0xf')]=_0x168d54[_0xba3e('0xf')];this['countmachineretry']=_0x168d54[_0xba3e('0x10')];this[_0xba3e('0x11')]=_0x168d54['countagentrejectretry'];this[_0xba3e('0x8')]=_0x168d54[_0xba3e('0x8')];this['calleridname']=_0x168d54[_0xba3e('0x12')];this[_0xba3e('0x13')]=_0x168d54['number'];this['starttime']=_0x168d54['starttime'];this[_0xba3e('0x14')]=_0x168d54[_0xba3e('0x14')];this['endtime']=_0x168d54[_0xba3e('0x14')];this[_0xba3e('0x15')]=getSeconds(_0x168d54[_0xba3e('0x14')],_0x168d54['starttime']);this[_0xba3e('0x16')]=0x0;this['talktime']=0x0;this[_0xba3e('0x17')]=_0x168d54['callback'];this[_0xba3e('0x18')]=_0x168d54[_0xba3e('0x18')];this['callbackat']=_0x168d54[_0xba3e('0x19')];this[_0xba3e('0x1a')]=_0x168d54[_0xba3e('0x1a')];this[_0xba3e('0x1b')]=_0x168d54[_0xba3e('0x1b')];this[_0xba3e('0x1c')]=_0x168d54['ListId'];this[_0xba3e('0x1d')]=_0x168d54[_0xba3e('0x1d')];this['VoiceQueueId']=_0x168d54[_0xba3e('0x1e')];this[_0xba3e('0x1f')]=_0x168d54[_0xba3e('0x1f')];this[_0xba3e('0x20')]=_0x168d54[_0xba3e('0x20')]||'';this[_0xba3e('0x21')]=_0x168d54['originatecalleridname']||'';}module[_0xba3e('0x22')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 227e63e..63f64bf 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 _0x876a=['[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','countglobal','reason19\x20machine....','ListId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AGI','Unknow','[syncHangupIvr]','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','TIMEOUT','agiafterat','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','paused','stateinterface','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','rrmemory','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','Failure','isArray','push','command','indexOf','true','iftime\x20%s,%s','timezones','content','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','dialActive','dialGlobalInterval','dialTimezone','throttle','filter','dialPreviewRecallmeReminder','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','Contact','tags','createdAt','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','trim','dialCutDigit','SIP/%s/%s%s','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','voicePause','run','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','floor','dialLimitQueue','not_inuse','RUNNING','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','Ts\x20=\x20','Umin\x20=\x20','util','lodash','moment','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueStatusComplete','getSettings','then','previewRecallmeReminderInterval','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','isEmpty','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','md5','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','ivr','string','\x22%s\x22\x20<%s>','debug','inspect','stack','error','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','undefined','Action','status','channel','catch','No\x20such\x20channel','queue','updateOriginated','countReScheduled','resolve','[countReScheduled]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','isNil','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId'];(function(_0x3da3c4,_0x2b874d){var _0x36a3af=function(_0x6d3f2d){while(--_0x6d3f2d){_0x3da3c4['push'](_0x3da3c4['shift']());}};_0x36a3af(++_0x2b874d);}(_0x876a,0x12a));var _0xa876=function(_0x4cf1a8,_0x530c36){_0x4cf1a8=_0x4cf1a8-0x0;var _0x437a16=_0x876a[_0x4cf1a8];return _0x437a16;};'use strict';var util=require(_0xa876('0x0'));var _=require(_0xa876('0x1'));var uuid=require('uuid');var moment=require(_0xa876('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xa876('0x3'));var ut=require(_0xa876('0x4'));var config=require('../../../config/environment/');var logger=require(_0xa876('0x5'))(_0xa876('0x6'));var loggerBooked=require(_0xa876('0x5'))(_0xa876('0x7'));var loggerPredictive=require(_0xa876('0x5'))(_0xa876('0x8'));var loggerPredictiveCalls=require(_0xa876('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xa876('0x5'))(_0xa876('0x9'));var ami=require(_0xa876('0xa'));config[_0xa876('0xb')]=_[_0xa876('0xc')](config[_0xa876('0xb')],{'host':_0xa876('0xd'),'port':0x18eb});var io=require(_0xa876('0xe'))(new Redis(config[_0xa876('0xb')]));var cmHopper=require(_0xa876('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperAdditionalPhone=require(_0xa876('0x10'));var cmHopperBlack=require(_0xa876('0x11'));var voiceQueueRt=require(_0xa876('0x12'));var RpcSetting=require(_0xa876('0x13'));var Action=require(_0xa876('0x14'));var History=require('./history');var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xa876('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0xa876('0x16')][_0xa876('0x17')]||_0xa876('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0xa876('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xa876('0x1a')][_0xa876('0x1b')]=function(_0xa80322){this[_0xa876('0x1c')]=this[_0xa876('0x1c')]?this[_0xa876('0x1c')][_0xa876('0x1d')](_0xa80322):_0xa80322();};function Dialer(_0x154234,_0x131bba){this['sequence']=new Sequence();this['preview']=_0x131bba;this[_0xa876('0x1e')]=_0x154234[_0xa876('0x1e')];this[_0xa876('0x1f')]=_0x154234[_0xa876('0x1f')];this[_0xa876('0x20')]=_0x154234['agents'];this['trunks']=_0x154234[_0xa876('0x21')];this[_0xa876('0x22')]=config[_0xa876('0x22')]||0x2;this[_0xa876('0x23')]={};this[_0xa876('0x24')]={};this[_0xa876('0x25')]={};this[_0xa876('0x26')]={};this[_0xa876('0x27')]={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0xa876('0x28')]={};this[_0xa876('0x29')]={};ami['on'](_0xa876('0x2a'),this['syncAgentConnect'][_0xa876('0x2b')](this));ami['on'](_0xa876('0x2c'),this[_0xa876('0x2d')]['bind'](this));ami['on'](_0xa876('0x2e'),this[_0xa876('0x2f')][_0xa876('0x2b')](this));ami['on'](_0xa876('0x30'),this[_0xa876('0x31')][_0xa876('0x2b')](this));ami['on'](_0xa876('0x32'),this['syncQueueSummary'][_0xa876('0x2b')](this));ami['on'](_0xa876('0x33'),this[_0xa876('0x34')][_0xa876('0x2b')](this));ami['on'](_0xa876('0x35'),this['syncHangup'][_0xa876('0x2b')](this));ami['on']('newexten',this[_0xa876('0x36')][_0xa876('0x2b')](this));ami['on'](_0xa876('0x37'),this[_0xa876('0x38')][_0xa876('0x2b')](this));ami['on'](_0xa876('0x39'),this['syncQueueMember'][_0xa876('0x2b')](this));ami['on']('queuestatuscomplete',this[_0xa876('0x3a')][_0xa876('0x2b')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0xa876('0x3b')]()[_0xa876('0x3c')](function(_0x34ee50){previewRecallmeReminderInterval=_0x34ee50[_0xa876('0x3d')];});}function isNotNull(_0x51ff7d){return _0x51ff7d!==null&&!_['isUndefined'](_0x51ff7d);}function checkIsLoggedIn(_0xc08e74,_0x58673d){return function(){if(_0x58673d<=0x0){_0xc08e74['message']=_0xa876('0x3e');throw _0xc08e74['name']+_0xa876('0x3f');}};}function isActive(_0x2e6495){return _0x2e6495;}function checkIsActive(_0x2c881c,_0x4f1094){return function(){if(!isActive(_0x4f1094)){_0x2c881c['message']=_0xa876('0x40');throw _0x2c881c[_0xa876('0x41')]+_0xa876('0x42');}};}function checkInterval(_0x5296e9){return function(){if(!isNotNull(_0x5296e9['Interval'])){_0x5296e9['message']='INTERVAL_IS_NULL';throw _0x5296e9['name']+_0xa876('0x43');}if(!isNotNull(_0x5296e9[_0xa876('0x44')][_0xa876('0x45')])){_0x5296e9['message']=_0xa876('0x46');throw _0x5296e9['name']+_0xa876('0x43');}if(!isNotNull(_[_0xa876('0x47')](_0x5296e9[_0xa876('0x44')][_0xa876('0x45')]))){_0x5296e9['message']=_0xa876('0x46');throw _0x5296e9[_0xa876('0x41')]+_0xa876('0x43');}};}function msgResponse(_0x25edb1,_0x2f0bca,_0x44fed5){return{'action':_0x25edb1,'response':_0x2f0bca,'message':_0x44fed5,'stack':_0x44fed5};}function myreject(_0x5a90fd){return function(_0x6c7a70){return _0x5a90fd(msgResponse('[ifTime][Action]','Error',JSON[_0xa876('0x48')](_0x6c7a70)));};}function getSeconds(_0x124ea7,_0x1aeb69){var _0x413c08=moment(_0x124ea7)[_0xa876('0x49')](0x0);var _0x2e193f=moment(_0x1aeb69)[_0xa876('0x49')](0x0);return _0x413c08[_0xa876('0x4a')](_0x2e193f,_0xa876('0x4b'));}function emit(_0x3adfa8,_0x2ef757,_0x276920){io['to'](_0x3adfa8)[_0xa876('0x4c')](_0x2ef757,_0x276920);}function emitVoiceQueueSummary(_0x32e88b){if(_0x32e88b[_0xa876('0x4d')]===_0xa876('0x4e')){var _0x49d836={'id':_0x32e88b['id'],'name':_0x32e88b[_0xa876('0x41')],'strategy':_0x32e88b[_0xa876('0x4f')],'answered':_0x32e88b[_0xa876('0x50')],'available':_0x32e88b[_0xa876('0x51')],'loggedIn':_0x32e88b[_0xa876('0x52')],'pTalking':_0x32e88b[_0xa876('0x53')],'sumBillable':_0x32e88b[_0xa876('0x54')],'sumDuration':_0x32e88b[_0xa876('0x55')],'sumHoldTime':_0x32e88b[_0xa876('0x56')]||0x0,'talking':_0x32e88b[_0xa876('0x57')],'total':_0x32e88b[_0xa876('0x58')],'type':_0x32e88b[_0xa876('0x4d')],'unmanaged':_0x32e88b['unmanaged'],'abandoned':_0x32e88b[_0xa876('0x59')],'waiting':_0x32e88b[_0xa876('0x5a')],'loggedInDb':_0x32e88b['loggedInDb'],'dialActive':_0x32e88b['dialActive'],'dialMethod':_0x32e88b[_0xa876('0x5b')],'dialOriginateCallerIdName':_0x32e88b[_0xa876('0x5c')],'dialOriginateCallerIdNumber':_0x32e88b[_0xa876('0x5d')],'dialOriginateTimeout':_0x32e88b[_0xa876('0x5e')],'dialPrefix':_0x32e88b[_0xa876('0x5f')],'outboundAnswerAgiCallsDay':_0x32e88b[_0xa876('0x60')],'outboundAnswerCallsDay':_0x32e88b[_0xa876('0x61')],'outboundBlacklistCallsDay':_0x32e88b[_0xa876('0x62')],'outboundBusyCallsDay':_0x32e88b[_0xa876('0x63')],'outboundCongestionCallsDay':_0x32e88b[_0xa876('0x64')],'outboundDropCallsDayACS':_0x32e88b[_0xa876('0x65')],'outboundDropCallsDayCallersExit':_0x32e88b[_0xa876('0x66')],'outboundDropCallsDayTimeout':_0x32e88b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x32e88b[_0xa876('0x67')],'outboundNoSuchCallsDay':_0x32e88b['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x32e88b[_0xa876('0x68')],'outboundReCallsDay':_0x32e88b[_0xa876('0x69')],'outboundRejectCallsDay':_0x32e88b[_0xa876('0x6a')],'outboundUnknownCallsDay':_0x32e88b[_0xa876('0x6b')],'predictiveIntervalAnsweredCalls':_0x32e88b[_0xa876('0x6c')],'predictiveIntervalAvgHoldtime':_0x32e88b['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x32e88b[_0xa876('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x32e88b[_0xa876('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x32e88b[_0xa876('0x6f')],'predictiveIntervalErlangCalls':_0x32e88b[_0xa876('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x32e88b[_0xa876('0x71')],'predictiveIntervalHitRate':_0x32e88b[_0xa876('0x72')],'predictiveIntervalMultiplicativeFactor':_0x32e88b[_0xa876('0x73')],'predictiveIntervalPauses':_0x32e88b[_0xa876('0x74')],'predictiveIntervalAvailable':_0x32e88b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x32e88b[_0xa876('0x75')],'message':_0x32e88b[_0xa876('0x76')],'originated':_0x32e88b[_0xa876('0x77')],'erlangCalls':_0x32e88b[_0xa876('0x78')],'erlangCallToSecond':_0x32e88b[_0xa876('0x79')],'erlangAbandonmentRate':_0x32e88b[_0xa876('0x7a')],'erlangBusyFactor':_0x32e88b['erlangBusyFactor'],'startPredictive':_0x32e88b[_0xa876('0x7b')],'startProgressive':_0x32e88b[_0xa876('0x7c')]};if(_0x32e88b[_0xa876('0x7d')]){_0x49d836[_0xa876('0x7d')]={'id':_0x32e88b[_0xa876('0x7d')]['id'],'name':_0x32e88b[_0xa876('0x7d')][_0xa876('0x41')],'active':_0x32e88b[_0xa876('0x7d')][_0xa876('0x7e')],'callerid':_0x32e88b[_0xa876('0x7d')]['callerid']};}if(_0x32e88b[_0xa876('0x44')]){_0x49d836['Interval']={'id':_0x32e88b[_0xa876('0x44')]['id'],'name':_0x32e88b[_0xa876('0x44')]['name']};}var _0x3d0a39=md5(JSON[_0xa876('0x48')](_0x49d836));if(_0x32e88b[_0xa876('0x7f')]!==_0x3d0a39){_0x32e88b[_0xa876('0x7f')]=_0x3d0a39;emit(util[_0xa876('0x80')](_0xa876('0x81'),_0x49d836[_0xa876('0x41')]),_0xa876('0x82'),_0x49d836);}}}function emitCampaignSummary(_0x379322){if(_0x379322[_0xa876('0x4d')]==='ivr'){emit(util['format'](_0xa876('0x83'),_0x379322[_0xa876('0x41')]),'campaign:save',_0x379322);}}function checkGetDataPredictive(_0x592746){if(isNotNull(_0x592746)&&!_['isEmpty'](_0x592746)){loggerPredictive['info'](_0xa876('0x84'));loggerPredictive[_0xa876('0x85')](_0xa876('0x86'),_0x592746['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0xa876('0x87'),_0x592746['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa876('0x85')](_0xa876('0x88'),_0x592746[_0xa876('0x6f')]);loggerPredictive[_0xa876('0x85')](_0xa876('0x89'),_0x592746['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xa876('0x85')](_0xa876('0x8a'),_0x592746[_0xa876('0x8b')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x592746[_0xa876('0x6d')]);loggerPredictive[_0xa876('0x85')](_0xa876('0x8c'));if(_0x592746[_0xa876('0x75')]>0x0){if(!_[_0xa876('0x8d')](_0x592746[_0xa876('0x6d')])&&_0x592746[_0xa876('0x6d')]>0x0){return!![];}loggerPredictive[_0xa876('0x85')](_0xa876('0x8e'));if(!_[_0xa876('0x8d')](_0x592746[_0xa876('0x8b')])&&_0x592746[_0xa876('0x8b')]>0x0){return!![];}loggerPredictive[_0xa876('0x85')](_0xa876('0x8f'));}else{loggerPredictive[_0xa876('0x85')](_0xa876('0x90'));}}else{loggerPredictive['info'](_0xa876('0x91'));}return![];}function mergeDataErlangB(_0xe1eb56){return function(_0x471c6d){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xa876('0x85')](_0xa876('0x92'),_0x471c6d['erlangCalls']);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x471c6d[_0xa876('0x79')]);loggerPredictive[_0xa876('0x85')](_0xa876('0x93'),_0x471c6d['erlangAbandonmentRate']);loggerPredictive[_0xa876('0x85')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x471c6d['erlangBusyFactor']);loggerPredictive[_0xa876('0x85')](_0xa876('0x93'),_0x471c6d[_0xa876('0x7a')]);loggerPredictive[_0xa876('0x85')](_0xa876('0x8c'));_[_0xa876('0x94')](_0xe1eb56,_0x471c6d);};}function getDiff(_0x1a6e2a){var _0x1d76c0=moment()[_0xa876('0x49')](0x0);var _0x376a59=moment(_0x1a6e2a)['milliseconds'](0x0);return _0x1d76c0[_0xa876('0x4a')](_0x376a59,_0xa876('0x4b'));}function ifInterval(_0xf8dc50,_0x26d1f8){if(_[_0xa876('0x8d')](_0x26d1f8)){return![];}return getDiff(_0x26d1f8)<_0xf8dc50*0x3c;}function freeVariablesPredictive(_0x47ae35){if(isNotNull(_0x47ae35)){if(!_['isUndefined'](_0x47ae35['startProgressive'])){_0x47ae35['startProgressive']=undefined;loggerPredictive[_0xa876('0x85')](_0x47ae35[_0xa876('0x41')],_0xa876('0x95'));}if(!_[_0xa876('0x8d')](_0x47ae35['startPredictive'])){_0x47ae35['startPredictive']=undefined;loggerPredictive[_0xa876('0x85')](_0x47ae35[_0xa876('0x41')],_0xa876('0x96'));}if(!_[_0xa876('0x8d')](_0x47ae35[_0xa876('0x97')])){clearInterval(_0x47ae35[_0xa876('0x97')]);_0x47ae35[_0xa876('0x97')]=undefined;loggerPredictive[_0xa876('0x85')](_0x47ae35['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x4845ca,_0x5f03f1){if(_0x5f03f1===0x0){return 0x0;}var _0x3a4e5a=0x1;for(var _0x38418b=0x1;_0x38418b<=_0x5f03f1;_0x38418b+=0x1){_0x3a4e5a=0x1+_0x3a4e5a*_0x38418b/_0x4845ca;}return 0x1/_0x3a4e5a;}function isVoiceQueueOutbound(_0x202d07){return _0x202d07===_0xa876('0x4e');}function isNotPreview(_0x4a2988){return _0x4a2988!==_0xa876('0x98');}function isCampaignIvr(_0x49efc8){return _0x49efc8===_0xa876('0x99');}function getCallerId(_0x113cea,_0x484951,_0x49024c){if(!_['isUndefined'](_0x49024c)&&typeof _0x49024c===_0xa876('0x9a')&&!_[_0xa876('0x47')](_0x49024c)){if(!_[_0xa876('0x8d')](_0x484951)&&typeof _0x484951===_0xa876('0x9a')&&!_[_0xa876('0x47')](_0x484951)){return util['format'](_0xa876('0x9b'),_0x484951,_0x49024c);}return util[_0xa876('0x80')]('\x22%s\x22\x20<%s>',_0x49024c,_0x49024c);}if(!_[_0xa876('0x8d')](_0x113cea)&&typeof _0x113cea==='string'&&!_[_0xa876('0x47')](_0x113cea)){return _0x113cea;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x10b394,_0x4435a9){return function(_0x49091e){freeVariablesPredictive(_0x4435a9);emitVoiceQueueSummary(_0x4435a9);emitCampaignSummary(_0x4435a9);loggerSyncQueueSummary[_0xa876('0x9c')](_0x10b394,util[_0xa876('0x9d')](_0x49091e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5db067,_0x57355e){return function(_0x520d8d){loggerPredictive['error'](_0x57355e['name'],_0x5db067);loggerPredictive['error'](_0x520d8d[_0xa876('0x9e')]);freeVariablesPredictive(_0x57355e);};}function loggerCatch(_0x524309){return function(_0x4bfcd4){logger[_0xa876('0x9f')](_0x524309,util[_0xa876('0x9d')](_0x4bfcd4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x173475){return _0x173475&&!_[_0xa876('0x8d')](_0x173475)&&_0x173475['length']>0x0;}function decremetOriginate(_0x54f056){if(!_[_0xa876('0x8d')](_0x54f056)&&_0x54f056!==null){if(typeof _0x54f056['originated']!=='undefined'){if(_0x54f056[_0xa876('0x77')]>0x0){_0x54f056[_0xa876('0x77')]-=0x1;}else{logger[_0xa876('0x9f')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xa876('0x9f')](_0xa876('0xa0'));}}function checkContactLowerLimitOriginate(_0x1eb016,_0x336f3a,_0x4f46ec){if(_0x336f3a>_0x4f46ec){for(var _0x12412d=0x0;_0x12412d<_0x336f3a-_0x4f46ec;_0x12412d+=0x1){decremetOriginate(_0x1eb016);}}}function loggerGetContactDialer(_0x427128,_0x2f1660,_0x196418){return function(_0x42591a){checkContactLowerLimitOriginate(_0x2f1660,_0x196418,0x0);logger[_0xa876('0x9f')](_0x427128,util[_0xa876('0x9d')](_0x42591a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x466d97){return function(_0x4564ce){if(isNotNull(_0x4564ce)&&isNotNull(_0x4564ce[0x0])){if(_0x4564ce[0x0][_0xa876('0xa1')]>0x0){_0x466d97[_0xa876('0x76')]=_0xa876('0xa2');logger[_0xa876('0x85')](_0xa876('0xa3')+_0x466d97[_0xa876('0x41')],_0x4564ce[0x0][_0xa876('0xa1')],_0xa876('0xa4'));}else{_0x466d97[_0xa876('0x76')]=_0xa876('0xa5');logger['info']('[getContactDialer2][Empty]'+_0x466d97['name']);}}};}function notSendMessagesQueue(_0x825c77){if(_0x825c77[_0xa876('0xa6')]){freeVariablesPredictive(_0x825c77);if(_0x825c77[_0xa876('0x77')]===0x0&&_0x825c77[_0xa876('0x57')]===0x0&&_0x825c77['waiting']===0x0&&(_0x825c77[_0xa876('0x53')]||0x0)===0x0){_0x825c77['sendMessageOneNotActive']=![];_0x825c77[_0xa876('0x51')]=0x0;_0x825c77[_0xa876('0x76')]=_0xa876('0x40');loggerSyncQueueSummary[_0xa876('0x9c')](_0xa876('0xa7'),_0x825c77['name'],_0xa876('0xa8'));}else{_0x825c77[_0xa876('0x76')]=_0xa876('0xa9');loggerSyncQueueSummary[_0xa876('0x9c')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x825c77[_0xa876('0x41')],_0xa876('0xaa'));}emitVoiceQueueSummary(_0x825c77);}}function notSendMessagesCampaign(_0x3a461a){if(_0x3a461a[_0xa876('0xa6')]){if(_0x3a461a[_0xa876('0x77')]===0x0){_0x3a461a[_0xa876('0xa6')]=![];_0x3a461a[_0xa876('0x76')]=_0xa876('0x40');loggerSyncQueueSummary[_0xa876('0x9c')](_0xa876('0xab'),_0x3a461a[_0xa876('0x41')],_0xa876('0xa8'));}else{_0x3a461a[_0xa876('0x76')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xa876('0x9c')](_0xa876('0xab'),_0x3a461a[_0xa876('0x41')],'is\x20disactive');}emitCampaignSummary(_0x3a461a);}}function createObjHistory(_0x44b267,_0x11f33c,_0x24a62e,_0x22f59c,_0x33d5c6){_0x44b267['message']=_0x24a62e;var _0x2c1551=new Action(_0x44b267,_0x11f33c);var _0x3a9561=new History(_0x2c1551);_0x3a9561[_0xa876('0xac')]=_0x22f59c;_0x3a9561['statedesc']=_0x33d5c6;_0x3a9561[_0xa876('0xad')]=_0x2c1551['starttime'];return _0x3a9561;}Dialer[_0xa876('0x1a')][_0xa876('0xae')]=function(){var _0x1d9cbe=this;setInterval(function(){_0x1d9cbe[_0xa876('0xaf')](_0x1d9cbe[_0xa876('0x26')],_0xa876('0xb0'));_0x1d9cbe[_0xa876('0xaf')](_0x1d9cbe[_0xa876('0x24')],_0xa876('0xb1'));},0x32c8);};Dialer['prototype'][_0xa876('0xaf')]=function(_0x152d9b,_0x45dbc6){var _0x352eb6=this;for(var _0x12fdf6 in _0x152d9b){if(typeof _0x152d9b[_0x12fdf6]!==_0xa876('0xb2')){this['sequence'][_0xa876('0x1b')](function(){if(!_['isNil'](_0x152d9b[_0x12fdf6])){return ami[_0xa876('0xb3')]({'action':_0xa876('0xb4'),'channel':_0x152d9b[_0x12fdf6][_0xa876('0xb5')]})[_0xa876('0xb6')](function(_0x40efd6){if(_0x40efd6[_0xa876('0x76')]===_0xa876('0xb7')){setTimeout(function(){if(_0x152d9b[_0x12fdf6]&&_0x152d9b[_0x12fdf6][_0xa876('0x4d')]!==_0xa876('0x99')){_0x352eb6['updateOriginated'](_0x352eb6[_0xa876('0x1e')][_0x152d9b[_0x12fdf6]['queue']]);logger[_0xa876('0x9f')]('[Dialer][checkChannel]',_0x45dbc6,_0x12fdf6,_0x152d9b[_0x12fdf6][_0xa876('0xb8')]);delete _0x152d9b[_0x12fdf6];}if(_0x152d9b[_0x12fdf6]&&_0x152d9b[_0x12fdf6][_0xa876('0x4d')]==='ivr'){_0x352eb6[_0xa876('0xb9')](_0x352eb6[_0xa876('0x1f')][_0x152d9b[_0x12fdf6]['queue']]);logger[_0xa876('0x9f')]('[Dialer][checkChannel][ivr]',_0x45dbc6,_0x12fdf6,_0x152d9b[_0x12fdf6][_0xa876('0xb8')]);delete _0x152d9b[_0x12fdf6];}},0x2328);}});}});}}};Dialer[_0xa876('0x1a')][_0xa876('0xba')]=function(_0x1b2ef4){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopper['countReScheduled'](_0x1b2ef4))[_0xa876('0xb6')](loggerCatch(_0xa876('0xbc')));};Dialer['prototype']['checkIsBlackList']=function(_0x5793fc){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopperBlack['checkIsBlackList'](_0x5793fc))[_0xa876('0xb6')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xa876('0x1a')][_0xa876('0xbd')]=function(_0x5e4cbe,_0x323622,_0x17836a){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xa876('0xbd')](_0x5e4cbe,_0x323622,_0x17836a))[_0xa876('0xb6')](loggerCatch(_0xa876('0xbe')));};Dialer['prototype'][_0xa876('0xbf')]=function(_0x443df7,_0x1543c1,_0x423945){return Promise[_0xa876('0xbb')]()['then'](cmHopperAdditionalPhone[_0xa876('0xbf')](_0x443df7,_0x1543c1,_0x423945))[_0xa876('0xb6')](loggerCatch(_0xa876('0xc0')));};Dialer[_0xa876('0x1a')]['checkIsBlackListIvr']=function(_0x1aaaab){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopperBlack[_0xa876('0xc1')](_0x1aaaab))[_0xa876('0xb6')](loggerCatch(_0xa876('0xc2')));};Dialer[_0xa876('0x1a')][_0xa876('0xc3')]=function(_0x5a7f68){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopperHistory[_0xa876('0xc4')](_0x5a7f68))[_0xa876('0xb6')](loggerCatch(_0xa876('0xc5')));};Dialer[_0xa876('0x1a')][_0xa876('0xc6')]=function(_0x376d99){return Promise['resolve']()['then'](cmHopper[_0xa876('0xc6')](_0x376d99))[_0xa876('0xb6')](loggerCatch(_0xa876('0xc7')));};Dialer[_0xa876('0x1a')][_0xa876('0xc8')]=function(_0x240f99,_0x3aad70,_0x550675){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopper[_0xa876('0xc8')](_0x240f99,_0x3aad70,_0x550675))[_0xa876('0xb6')](loggerCatch(_0xa876('0xc9')));};Dialer['prototype']['getContactDialer']=function(_0x5e6eae,_0x2631b6,_0x2cf841,_0x4d4d61,_0x5a642b){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopper[_0xa876('0xca')](_0x5e6eae,_0x2631b6,_0x2cf841,_0x4d4d61))['catch'](function(_0x598888){_0x5a642b[_0xa876('0xcb')]-=_0x2cf841;_0x5a642b[_0xa876('0xcb')]=_0x5a642b['temp']>0x0?_0x5a642b[_0xa876('0xcb')]:0x0;loggerCatch(_0xa876('0xcc'))(_0x598888);});};Dialer['prototype'][_0xa876('0xcd')]=function(_0x3da2e2,_0x385bf2,_0x54e903,_0x5ce6ae){return Promise['resolve']()['then'](cmHopper[_0xa876('0xcd')](_0x3da2e2,_0x385bf2,_0x54e903))[_0xa876('0xb6')](function(_0x2e9e5c){_0x5ce6ae['temp']-=_0x385bf2;_0x5ce6ae[_0xa876('0xcb')]=_0x5ce6ae[_0xa876('0xcb')]>0x0?_0x5ce6ae[_0xa876('0xcb')]:0x0;loggerCatch(_0xa876('0xce'))(_0x2e9e5c);});};Dialer[_0xa876('0x1a')][_0xa876('0xcf')]=function(_0x3835eb){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](voiceQueueRt['getVoiceQueueRtPauses'](_0x3835eb))[_0xa876('0xb6')](loggerCatch(_0xa876('0xd0')));};Dialer[_0xa876('0x1a')][_0xa876('0xd1')]=function(_0x2885ac){return Promise[_0xa876('0xbb')]()['then'](cmHopper[_0xa876('0xd1')](_0x2885ac))['catch'](loggerCatch(_0xa876('0xd2')));};Dialer[_0xa876('0x1a')][_0xa876('0xd3')]=function(_0x314011){return Promise['resolve']()['then'](cmHopperHistory['createHistory'](_0x314011))[_0xa876('0xb6')](loggerCatch(_0xa876('0xd4')));};Dialer['prototype']['updateOriginated']=function(_0x2ded19){if(!_[_0xa876('0x8d')](_0x2ded19)&&_0x2ded19!==null){if(typeof _0x2ded19[_0xa876('0x77')]!==_0xa876('0xb2')){if(_0x2ded19[_0xa876('0x77')]>0x0){_0x2ded19[_0xa876('0x77')]-=0x1;}else{logger[_0xa876('0x9f')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xa876('0x9f')](_0xa876('0xd5'));}};Dialer['prototype'][_0xa876('0xd6')]=function(_0x37796c,_0x9d4ba8){var _0x2b1c56=this;return function(_0x542287){_0x2b1c56[_0xa876('0xb9')](_0x9d4ba8);logger[_0xa876('0x9f')](_0x37796c,util['inspect'](_0x542287,{'showHidden':![],'depth':null}));};};Dialer[_0xa876('0x1a')]['emptyContact']=function(_0x460636,_0x161c29,_0x4e98e2){var _0x49dbe5={'state':0x19,'statedesc':_0xa876('0xd7')};this[_0xa876('0xb9')](_0x161c29);this[_0xa876('0xd8')](_[_0xa876('0x94')](_0x49dbe5,_[_0xa876('0xd9')](_0x4e98e2,['ContactId','ListId',_0xa876('0xda'),'VoiceQueueId',_0xa876('0xdb')])),_0xa876('0xdc'),_0xa876('0xdd'));logger[_0xa876('0x9f')](_0x460636);};Dialer[_0xa876('0x1a')]['isSuccess']=function(_0xd56d40){return _0xd56d40===_0xa876('0xde');};Dialer[_0xa876('0x1a')][_0xa876('0xdf')]=function(_0x42b975){return!_[_0xa876('0x8d')](_0x42b975)&&_0x42b975&&!_['isUndefined'](_0x42b975[_0xa876('0x41')])&&!_[_0xa876('0x8d')](_0x42b975[_0xa876('0x7e')])&&_0x42b975[_0xa876('0x7e')]&&(this[_0xa876('0x21')][util[_0xa876('0x80')](_0xa876('0xe0'),_0x42b975[_0xa876('0x41')])][_0xa876('0xb4')]===_0xa876('0xe1')||this[_0xa876('0x21')][util[_0xa876('0x80')](_0xa876('0xe0'),_0x42b975['name'])][_0xa876('0xb4')]===_0xa876('0xe2'));};Dialer['prototype'][_0xa876('0xd8')]=function(_0x463a00,_0x49a705,_0x564fb0){this[_0xa876('0xd3')](_0x463a00)[_0xa876('0xb6')](loggerCatch(_0x49a705));this[_0xa876('0xd1')](_0x463a00)[_0xa876('0xb6')](loggerCatch(_0x564fb0));};Dialer[_0xa876('0x1a')]['syncVarSet']=function(_0x2eb118){var _0x7677b=this;var _0x34e84f=this[_0xa876('0x26')][_0x2eb118[_0xa876('0xe3')]];var _0x1d1762;if(!_[_0xa876('0xe4')](_0x2eb118)&&!_[_0xa876('0xe4')](_0x2eb118['variable'])&&!_[_0xa876('0xe4')](_0x2eb118['variable'][_0xa876('0xe5')])&&_0x2eb118['exten']===_0xa876('0xe6')&&_0x34e84f){if(_0x34e84f[_0xa876('0x4d')]!==_0xa876('0x99')&&this[_0xa876('0x1e')][_0x34e84f[_0xa876('0xb8')]][_0xa876('0xe7')]&&_0x2eb118[_0xa876('0xe8')]===_0xa876('0xe9')){delete this[_0xa876('0x26')][_0x2eb118[_0xa876('0xe3')]];this[_0xa876('0xb9')](this[_0xa876('0x1e')][_0x34e84f[_0xa876('0xb8')]]);this[_0xa876('0x1e')][_0x34e84f[_0xa876('0xb8')]][_0xa876('0x61')]+=0x1;this[_0xa876('0x1e')][_0x34e84f[_0xa876('0xb8')]][_0xa876('0x60')]+=0x1;_0x1d1762=new Hangup(_0x34e84f,_0x2eb118);_0x1d1762[_0xa876('0xac')]=0x12;_0x1d1762[_0xa876('0xea')]=_0xa876('0xeb');_0x1d1762[_0xa876('0xec')]=_0xa876('0xed');ami[_0xa876('0x4c')](_0xa876('0xee'),ut['buildObj'](_0x1d1762,_0xa876('0xef')));this[_0xa876('0xd8')](_0x1d1762,_0xa876('0xf0'),_0xa876('0xf1'));}if(_0x34e84f['type']!==_0xa876('0x99')&&this['voiceQueues'][_0x34e84f[_0xa876('0xb8')]][_0xa876('0xe7')]&&_0x2eb118[_0xa876('0xe8')]==='MACHINE'){return new Promise(function(_0xc209bc,_0x1340f0){delete _0x7677b['uniqueId'][_0x2eb118[_0xa876('0xe3')]];_0x7677b[_0xa876('0xb9')](_0x7677b[_0xa876('0x1e')][_0x34e84f[_0xa876('0xb8')]]);_0x7677b[_0xa876('0x1e')][_0x34e84f[_0xa876('0xb8')]]['outboundAnswerCallsDay']+=0x1;_0x7677b['voiceQueues'][_0x34e84f['queue']][_0xa876('0x60')]+=0x1;var _0x329464=_0x7677b[_0xa876('0x1e')][_0x34e84f['queue']];var _0x19cd05=new Hangup(_0x34e84f,_0x2eb118);_0x19cd05[_0xa876('0xac')]=0x13;_0x19cd05['statedesc']='Machine';_0x19cd05[_0xa876('0xec')]=_0xa876('0xed');_0x19cd05[_0xa876('0xf2')]+=0x1;_0x19cd05['countglobal']+=0x1;_0x19cd05[_0xa876('0xef')]=!![];ami[_0xa876('0x4c')](_0xa876('0xee'),ut[_0xa876('0xf3')](_0x19cd05,'amd'));_0x7677b[_0xa876('0xd3')](_0x19cd05)[_0xa876('0xb6')](loggerCatch(_0xa876('0xf4')));if(_0x19cd05[_0xa876('0xf5')]+_0x19cd05[_0xa876('0xf6')]+_0x19cd05[_0xa876('0xf7')]+_0x19cd05[_0xa876('0xf8')]+_0x19cd05[_0xa876('0xf9')]+_0x19cd05[_0xa876('0xfa')]+_0x19cd05[_0xa876('0xf2')]+_0x19cd05[_0xa876('0xfb')]>=_0x329464[_0xa876('0xfc')]){_0x7677b[_0xa876('0xfd')](_0x19cd05,_0xc209bc,_0x1340f0,'reason19\x20machine....');}else{if(_0x19cd05[_0xa876('0xf2')]>=_0x329464[_0xa876('0xfe')]){_0x7677b[_0xa876('0xff')](_0x19cd05,_0xc209bc,_0x1340f0,_0xa876('0x100'));}else{_0x7677b[_0xa876('0xc6')]({'active':![],'countmachineretry':_0x19cd05[_0xa876('0xf2')],'scheduledat':moment()[_0xa876('0x101')](_0x329464[_0xa876('0x102')],_0xa876('0x103'))[_0xa876('0x80')](_0xa876('0x104')),'ContactId':_0x19cd05[_0xa876('0x105')],'ListId':_0x19cd05['ListId'],'VoiceQueueId':_0x19cd05[_0xa876('0x106')]||undefined,'CampaignId':_0x19cd05[_0xa876('0xdb')]||undefined})['catch'](loggerCatch(_0xa876('0x107')));_0xc209bc({'reschedule':0x1});}}});}if(_0x34e84f['type']===_0xa876('0x99')&&this[_0xa876('0x1f')][_0x34e84f[_0xa876('0xb8')]][_0xa876('0xe7')]&&_0x2eb118['value']===_0xa876('0xe9')){delete this[_0xa876('0x26')][_0x2eb118[_0xa876('0xe3')]];this[_0xa876('0xb9')](this[_0xa876('0x1f')][_0x34e84f['queue']]);_0x1d1762=new Hangup(_0x34e84f,_0x2eb118);_0x1d1762[_0xa876('0xac')]=0x12;_0x1d1762['statedesc']=_0xa876('0xeb');_0x1d1762[_0xa876('0xec')]=_0xa876('0xed');ami['emit'](_0xa876('0xee'),ut[_0xa876('0xf3')](_0x1d1762,_0xa876('0xef')));this[_0xa876('0xd8')](_0x1d1762,_0xa876('0x108'),_0xa876('0x109'));}if(_0x34e84f[_0xa876('0x4d')]===_0xa876('0x99')&&this[_0xa876('0x1f')][_0x34e84f[_0xa876('0xb8')]][_0xa876('0xe7')]&&_0x2eb118[_0xa876('0xe8')]===_0xa876('0x10a')){return new Promise(function(_0x3434ba,_0x5016c1){delete _0x7677b[_0xa876('0x26')][_0x2eb118[_0xa876('0xe3')]];_0x7677b[_0xa876('0xb9')](_0x7677b['campaigns'][_0x34e84f[_0xa876('0xb8')]]);_0x7677b[_0xa876('0x1f')][_0x34e84f[_0xa876('0xb8')]][_0xa876('0x61')]+=0x1;_0x7677b['campaigns'][_0x34e84f[_0xa876('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x543be5=_0x7677b[_0xa876('0x1f')][_0x34e84f[_0xa876('0xb8')]];var _0x27a34d=new Hangup(_0x34e84f,_0x2eb118);_0x27a34d[_0xa876('0xac')]=0x13;_0x27a34d[_0xa876('0xea')]=_0xa876('0x10b');_0x27a34d[_0xa876('0xec')]=_0xa876('0xed');_0x27a34d[_0xa876('0xf2')]+=0x1;_0x27a34d[_0xa876('0x10c')]+=0x1;_0x27a34d[_0xa876('0xef')]=!![];ami['emit'](_0xa876('0xee'),ut[_0xa876('0xf3')](_0x27a34d,'amd'));_0x7677b[_0xa876('0xd3')](_0x27a34d)['catch'](loggerCatch(_0xa876('0xf4')));if(_0x27a34d[_0xa876('0xf5')]+_0x27a34d[_0xa876('0xf6')]+_0x27a34d['countnoanswerretry']+_0x27a34d[_0xa876('0xf8')]+_0x27a34d[_0xa876('0xf9')]+_0x27a34d[_0xa876('0xfa')]+_0x27a34d[_0xa876('0xf2')]+_0x27a34d[_0xa876('0xfb')]>=_0x543be5[_0xa876('0xfc')]){_0x7677b[_0xa876('0xfd')](_0x27a34d,_0x3434ba,_0x5016c1,_0xa876('0x10d'));}else{if(_0x27a34d[_0xa876('0xf2')]>=_0x543be5['dialMachineMaxRetry']){_0x7677b[_0xa876('0xff')](_0x27a34d,_0x3434ba,_0x5016c1,_0xa876('0x100'));}else{_0x7677b[_0xa876('0xc6')]({'active':![],'countmachineretry':_0x27a34d[_0xa876('0xf2')],'scheduledat':moment()[_0xa876('0x101')](_0x543be5[_0xa876('0x102')],'minutes')[_0xa876('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x27a34d[_0xa876('0x105')],'ListId':_0x27a34d[_0xa876('0x10e')],'VoiceQueueId':_0x27a34d['VoiceQueueId']||undefined,'CampaignId':_0x27a34d[_0xa876('0xdb')]||undefined})[_0xa876('0xb6')](loggerCatch('[rescheduleContact][Machine]'));_0x3434ba({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x25954f){var _0x3b9b0c=this[_0xa876('0x26')][_0x25954f['uniqueid']];var _0xd08fe4;if(_0x3b9b0c&&_0x3b9b0c['type']==='ivr'){delete this['uniqueId'][_0x25954f[_0xa876('0xe3')]];this[_0xa876('0xb9')](this[_0xa876('0x1f')][_0x3b9b0c['queue']]);this[_0xa876('0x1f')][_0x3b9b0c[_0xa876('0xb8')]][_0xa876('0x10f')]+=0x1;_0xd08fe4=new Hangup(_0x3b9b0c,_0x25954f);this[_0xa876('0xd3')](_0xd08fe4)[_0xa876('0xb6')](loggerCatch(_0xa876('0x110')));this[_0xa876('0xd1')](_0xd08fe4)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3b9b0c&&_0x3b9b0c[_0xa876('0x4d')]!==_0xa876('0x99')&&isNotNull(this[_0xa876('0x1e')][_0x3b9b0c[_0xa876('0xb8')]][_0xa876('0x111')])){delete this['uniqueId'][_0x25954f['uniqueid']];this[_0xa876('0xb9')](this[_0xa876('0x1e')][_0x3b9b0c[_0xa876('0xb8')]]);this[_0xa876('0x1e')][_0x3b9b0c[_0xa876('0xb8')]]['outboundAnswerCallsDay']+=0x1;this[_0xa876('0x1e')][_0x3b9b0c[_0xa876('0xb8')]][_0xa876('0x60')]+=0x1;_0xd08fe4=new Hangup(_0x3b9b0c,_0x25954f);_0xd08fe4[_0xa876('0xac')]=0x10;_0xd08fe4[_0xa876('0xea')]='AnswerAGI';_0xd08fe4['membername']=_0xa876('0x112');this[_0xa876('0xd3')](_0xd08fe4)[_0xa876('0xb6')](loggerCatch(_0xa876('0x110')));this[_0xa876('0xd1')](_0xd08fe4)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3b9b0c&&_0x3b9b0c[_0xa876('0x4d')]!==_0xa876('0x99')&&!isNotNull(this[_0xa876('0x1e')][_0x3b9b0c[_0xa876('0xb8')]][_0xa876('0x111')])){delete this[_0xa876('0x26')][_0x25954f[_0xa876('0xe3')]];this[_0xa876('0xb9')](this[_0xa876('0x1e')][_0x3b9b0c['queue']]);this[_0xa876('0x1e')][_0x3b9b0c['queue']][_0xa876('0x6b')]+=0x1;_0xd08fe4=new Hangup(_0x3b9b0c,_0x25954f);_0xd08fe4[_0xa876('0xac')]=0xc;_0xd08fe4['statedesc']=_0x25954f['cause-txt'];_0xd08fe4[_0xa876('0xec')]=_0xa876('0x113');this[_0xa876('0xd3')](_0xd08fe4)[_0xa876('0xb6')](loggerCatch(_0xa876('0x110')));this[_0xa876('0xd1')](_0xd08fe4)['catch'](loggerCatch(_0xa876('0x114')));}};Dialer[_0xa876('0x1a')]['syncAgentComplete']=function(_0x40ea7f){var _0x2c470f=this[_0xa876('0x26')][_0x40ea7f[_0xa876('0xe3')]];if(this[_0xa876('0x1e')][_0x40ea7f[_0xa876('0xb8')]]){if(_0x2c470f&&_0x2c470f['type']!==_0xa876('0x99')){delete this[_0xa876('0x26')][_0x40ea7f[_0xa876('0xe3')]];this[_0xa876('0x1e')][_0x40ea7f[_0xa876('0xb8')]][_0xa876('0x61')]+=0x1;var _0x27de1a=new AgentComplete(_0x2c470f,_0x40ea7f);if(_0x40ea7f[_0xa876('0x115')]===_0xa876('0x116')){_0x27de1a['agiafterat']=this[_0xa876('0x1e')][_0x40ea7f[_0xa876('0xb8')]][_0xa876('0x117')]&&this['voiceQueues'][_0x40ea7f[_0xa876('0xb8')]][_0xa876('0x118')]?moment()[_0xa876('0x80')](_0xa876('0x104')):undefined;}this['createHistory'](_0x27de1a)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xa876('0xd1')](_0x27de1a)[_0xa876('0xb6')](loggerCatch(_0xa876('0x119')));}}};Dialer[_0xa876('0x1a')][_0xa876('0x11a')]=function(_0x3f26e8){if(this['voiceQueues'][_0x3f26e8[_0xa876('0xb8')]]){if(this[_0xa876('0x26')][_0x3f26e8[_0xa876('0xe3')]]&&this[_0xa876('0x26')][_0x3f26e8[_0xa876('0xe3')]][_0xa876('0x4d')]!==_0xa876('0x99')){this[_0xa876('0xb9')](this[_0xa876('0x1e')][_0x3f26e8[_0xa876('0xb8')]]);this[_0xa876('0x26')][_0x3f26e8[_0xa876('0xe3')]][_0xa876('0x11b')]=moment()[_0xa876('0x80')](_0xa876('0x104'));}}};Dialer[_0xa876('0x1a')][_0xa876('0x11c')]=function(_0x2b7a7f,_0x561148){this[_0xa876('0xd3')](_0x2b7a7f)[_0xa876('0xb6')](loggerCatch(_0xa876('0x11d')));if(_0x561148==0x0){this[_0xa876('0xd1')](_0x2b7a7f)[_0xa876('0xb6')](loggerCatch(_0xa876('0x11e')));}};Dialer[_0xa876('0x1a')][_0xa876('0x2d')]=function(_0x33809e){var _0x3de674=this[_0xa876('0x26')][_0x33809e[_0xa876('0xe3')]];var _0x5e7f31=this;var _0x4c6dd3=![];var _0x347c15;var _0x27a3f5;if(this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]]){if(_0x3de674&&_0x3de674[_0xa876('0x4d')]!==_0xa876('0x99')){delete this[_0xa876('0x26')][_0x33809e[_0xa876('0xe3')]];this[_0xa876('0xb9')](this['voiceQueues'][_0x33809e[_0xa876('0xb8')]]);_0x3de674[_0xa876('0x11f')]=moment()[_0xa876('0x80')](_0xa876('0x104'));var _0x1afe1c=new QueueCallerAbandon(_0x3de674,_0x33809e);if(getSeconds(_0x3de674['droptime'],_0x3de674[_0xa876('0x120')])>=_0x3de674[_0xa876('0x121')]){this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]][_0xa876('0x122')]+=0x1;this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1afe1c[_0xa876('0xac')]=0xa;_0x1afe1c[_0xa876('0xea')]=_0xa876('0x123');_0x1afe1c['dropreason']=_0xa876('0x124');_0x1afe1c[_0xa876('0x125')]=this[_0xa876('0x1e')][_0x33809e['queue']]['dialQueueProject2']?moment()[_0xa876('0x80')](_0xa876('0x104')):undefined;_0x1afe1c['countdropretry']+=0x1;_0x1afe1c[_0xa876('0x10c')]+=0x1;_0x347c15=this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]]['dialDropRetryFrequency'];_0x27a3f5=this['voiceQueues'][_0x33809e['queue']][_0xa876('0x126')];_0x5e7f31[_0xa876('0xbd')](_0x1afe1c,_0x1afe1c['state'],_0x3de674[_0xa876('0x127')])[_0xa876('0x3c')](function(_0x19181d){_0x4c6dd3=_0x19181d[_0xa876('0x128')]==0x1;if(_0x1afe1c[_0xa876('0xf9')]>=_0x5e7f31[_0xa876('0x1e')][_0x33809e['queue']][_0xa876('0x129')]){_0x5e7f31[_0xa876('0x11c')](_0x1afe1c,_0x19181d[_0xa876('0x128')]);}else{_0x5e7f31[_0xa876('0xc6')]({'active':![],'countdropretry':_0x1afe1c['countdropretry'],'scheduledat':moment()['add'](_0x5e7f31[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]]['dialDropRetryFrequency'],_0xa876('0x103'))[_0xa876('0x80')](_0xa876('0x104')),'ContactId':_0x3de674[_0xa876('0x105')],'ListId':_0x3de674[_0xa876('0x10e')],'VoiceQueueId':_0x3de674[_0xa876('0x106')]||undefined,'CampaignId':_0x3de674[_0xa876('0xdb')]||undefined})[_0xa876('0xb6')](loggerCatch(_0xa876('0x12a')));var _0x2ee057=new History(_0x1afe1c);_0x2ee057[_0xa876('0xac')]=0xa;_0x2ee057[_0xa876('0xea')]=_0xa876('0x123');_0x2ee057[_0xa876('0x12b')]=moment()['format'](_0xa876('0x104'));_0x2ee057['endtime']=_0x2ee057[_0xa876('0x12b')];_0x2ee057['calleridname']=_0x1afe1c[_0xa876('0x12c')];_0x2ee057['calleridnum']=_0x1afe1c[_0xa876('0x12d')];_0x5e7f31[_0xa876('0xd3')](_0x2ee057)['catch'](loggerCatch(_0xa876('0x12e')));}})[_0xa876('0x3c')](function(){if(_0x4c6dd3)_0x5e7f31[_0xa876('0xbf')](_0x1afe1c,_0x347c15,_0x27a3f5)[_0xa876('0x3c')](function(){return 0x1;});});}else{this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]][_0xa876('0x6e')]+=0x1;this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]][_0xa876('0x66')]+=0x1;_0x1afe1c['state']=0xb;_0x1afe1c[_0xa876('0xea')]=_0xa876('0x12f');_0x1afe1c[_0xa876('0x130')]='CALLEREXIT';_0x1afe1c[_0xa876('0xfa')]+=0x1;_0x1afe1c['countglobal']+=0x1;_0x347c15=this['voiceQueues'][_0x33809e[_0xa876('0xb8')]][_0xa876('0x131')];_0x27a3f5=this[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]]['callAdditionalPhoneAfterMin'];_0x5e7f31['verifyAdditionalPhones'](_0x1afe1c,_0x1afe1c[_0xa876('0xac')],_0x3de674[_0xa876('0x127')])[_0xa876('0x3c')](function(_0x427a2e){if(_0x1afe1c[_0xa876('0xfa')]>=_0x5e7f31[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]]['dialAbandonedMaxRetry']){_0x5e7f31[_0xa876('0x11c')](_0x1afe1c,_0x427a2e['additional']);}else{_0x5e7f31[_0xa876('0xc6')]({'active':![],'countabandonedretry':_0x1afe1c[_0xa876('0xfa')],'scheduledat':moment()[_0xa876('0x101')](_0x5e7f31[_0xa876('0x1e')][_0x33809e[_0xa876('0xb8')]][_0xa876('0x131')],_0xa876('0x103'))[_0xa876('0x80')](_0xa876('0x104')),'ContactId':_0x3de674[_0xa876('0x105')],'ListId':_0x3de674[_0xa876('0x10e')],'VoiceQueueId':_0x3de674['VoiceQueueId']||undefined,'CampaignId':_0x3de674[_0xa876('0xdb')]||undefined})[_0xa876('0xb6')](loggerCatch(_0xa876('0x132')));var _0x55883b=new History(_0x1afe1c);_0x55883b['state']=0xb;_0x55883b[_0xa876('0xea')]=_0xa876('0x12f');_0x55883b['starttime']=moment()[_0xa876('0x80')](_0xa876('0x104'));_0x55883b[_0xa876('0xad')]=_0x55883b[_0xa876('0x12b')];_0x55883b[_0xa876('0x12c')]=_0x1afe1c['calleridname'];_0x55883b['calleridnum']=_0x1afe1c[_0xa876('0x12d')];_0x5e7f31[_0xa876('0xd3')](_0x55883b)[_0xa876('0xb6')](loggerCatch(_0xa876('0x133')));}})[_0xa876('0x3c')](function(){if(_0x4c6dd3)_0x5e7f31[_0xa876('0xbf')](_0x1afe1c,_0x347c15,_0x27a3f5)[_0xa876('0x3c')](function(){return 0x1;});});}}}};Dialer['prototype'][_0xa876('0x36')]=function(_0x1bdbbc){if(this['actions'][_0x1bdbbc[_0xa876('0xe3')]]){this['actions'][_0x1bdbbc[_0xa876('0xe3')]][_0xa876('0xb5')]=_0x1bdbbc['channel'];}if(this[_0xa876('0x26')][_0x1bdbbc[_0xa876('0xe3')]]){this[_0xa876('0x26')][_0x1bdbbc['uniqueid']][_0xa876('0xb5')]=_0x1bdbbc[_0xa876('0xb5')];}};Dialer[_0xa876('0x1a')][_0xa876('0x134')]=function(_0x28636b){if(strategy[this[_0xa876('0x1e')][this[_0xa876('0x24')][_0x28636b['actionid']][_0xa876('0xb8')]][_0xa876('0x4f')]]===_0xa876('0x19')){if(this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]]&&_[_0xa876('0xe4')](this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]][_0xa876('0x136')])&&_0x28636b['status']==='1'&&_0x28636b[_0xa876('0x137')]==='0'){if(this['agents'][_0x28636b[_0xa876('0x138')]]){if(!this[_0xa876('0x20')][_0x28636b['stateinterface']]['locked']){this[_0xa876('0x20')][_0x28636b[_0xa876('0x138')]]['locked']=!![];this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]]['locked']=!![];this[_0xa876('0x24')][_0x28636b['actionid']][_0xa876('0x138')]=_0x28636b[_0xa876('0x138')];}}}}else if((strategy[this[_0xa876('0x1e')][this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]]['queue']]['strategy']]||'rrmemory')==='rrmemory'){if(this['actions'][_0x28636b[_0xa876('0x135')]]){if(this[_0xa876('0x20')][_0x28636b[_0xa876('0x138')]]){this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]][_0xa876('0x138')]=_0x28636b['stateinterface'];if(_['isNil'](this[_0xa876('0x28')][this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]][_0xa876('0xb8')]])){this[_0xa876('0x28')][this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]][_0xa876('0xb8')]]=[];}this[_0xa876('0x28')][this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]]['queue']]['push'](_[_0xa876('0x94')](_[_0xa876('0xd9')](this[_0xa876('0x24')][_0x28636b[_0xa876('0x135')]],[_0xa876('0x139'),'stateinterface']),{'status':_0x28636b[_0xa876('0xb4')],'paused':_0x28636b[_0xa876('0x137')]}));}}}};function unlockQueueStatus(_0x3aed30,_0x31a41b){setTimeout(function(){if(_['isUndefined'](_0x3aed30[_0xa876('0x13a')])){loggerBooked['error'](_0xa876('0x13b'),_0x31a41b);}_0x3aed30[_0xa876('0x13a')]=!![];loggerBooked[_0xa876('0x85')](_0xa876('0x13c'),_0x31a41b,JSON[_0xa876('0x48')](_[_0xa876('0xd9')](_0x3aed30,['name',_0xa876('0x13a')])));},0x1f3);}Dialer[_0xa876('0x1a')]['syncQueueStatusComplete']=function(_0x25b2cc){var _0x23c2dc=this;var _0x4749c1=_0x23c2dc['voiceQueues'][_0x23c2dc[_0xa876('0x24')][_0x25b2cc['actionid']][_0xa876('0xb8')]];if(strategy[this['voiceQueues'][this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0xb8')]][_0xa876('0x4f')]]===_0xa876('0x19')){if(this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]]&&this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]]['stateinterface']){this[_0xa876('0x98')]['run'](this['actions'][_0x25b2cc[_0xa876('0x135')]][_0xa876('0x139')],this[_0xa876('0x24')][_0x25b2cc['actionid']][_0xa876('0x138')])[_0xa876('0xb6')](function(_0x477ead){logger[_0xa876('0x9f')](_0xa876('0x13d'),util[_0xa876('0x9d')](_0x477ead,{'showHidden':![],'depth':null}));})[_0xa876('0x1d')](function(){_0x23c2dc['updateOriginated'](_0x23c2dc[_0xa876('0x1e')][_0x23c2dc[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0xb8')]]);_0x23c2dc[_0xa876('0x20')][_0x23c2dc[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0x138')]][_0xa876('0x136')]=![];delete _0x23c2dc[_0xa876('0x24')][_0x25b2cc['actionid']];unlockQueueStatus(_0x4749c1);});}else{this[_0xa876('0xb9')](this[_0xa876('0x1e')][this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0xb8')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0x105')],'ListId':this[_0xa876('0x24')][_0x25b2cc['actionid']][_0xa876('0x10e')],'VoiceQueueId':this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0x106')]||undefined,'CampaignId':this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0xdb')]||undefined})[_0xa876('0xb6')](loggerCatch(_0xa876('0x13e')));delete this['actions'][_0x25b2cc[_0xa876('0x135')]];unlockQueueStatus(_0x4749c1);}}else if((strategy[this[_0xa876('0x1e')][this[_0xa876('0x24')][_0x25b2cc['actionid']]['queue']]['strategy']]||_0xa876('0x13f'))===_0xa876('0x13f')){var _0xc795e6;if(this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]]&&!_[_0xa876('0x47')](this[_0xa876('0x28')][this[_0xa876('0x24')][_0x25b2cc['actionid']][_0xa876('0xb8')]])){if(this[_0xa876('0x29')][_0x23c2dc[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0xb8')]]){this[_0xa876('0x29')][_0x23c2dc[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0xb8')]]=this[_0xa876('0x29')][this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]][_0xa876('0xb8')]]?this[_0xa876('0x29')][this['actions'][_0x25b2cc['actionid']][_0xa876('0xb8')]]:this[_0xa876('0x28')][this[_0xa876('0x24')][_0x25b2cc['actionid']][_0xa876('0xb8')]]?this[_0xa876('0x28')][this['actions'][_0x25b2cc['actionid']][_0xa876('0xb8')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]]['queue']][_0xa876('0x140')]=this[_0xa876('0x29')][this[_0xa876('0x24')][_0x25b2cc[_0xa876('0x135')]]['queue']];for(var _0xee2d5b=0x0;_0xee2d5b=0x0;})[_0xa876('0xb6')](myreject(_0x3e6259)));}}else{_0x37097a[_0xa876('0x159')](ami[_0xa876('0xb3')]({'action':_0xa876('0x15a'),'command':util[_0xa876('0x80')](_0xa876('0x15d'),_0x516dac,!_[_0xa876('0x8d')](config[_0xa876('0x15e')][_0x4e28e7])?_0x4e28e7:'')})[_0xa876('0x3c')](function(_0x2aa3d2){return _0x2aa3d2[_0xa876('0x15f')][_0xa876('0x15b')](_0xa876('0x15c'))>=0x0;})['catch'](myreject(_0x3e6259)));}Promise['all'](_0x37097a)['then'](function(_0x547f42){var _0xb67bfe=_[_0xa876('0x160')](_0x547f42);if(_0xb67bfe){return _0x424c2b(_0xb67bfe);}else{_0x30b1b0['message']=_0x339be8?_0xa876('0x161'):_0xa876('0x162');return _0x3e6259(msgResponse(_0xa876('0x163'),'Failure','Global:\x20'+_0x339be8+'\x20'+_0x2d9eac+_0xa876('0x164')+util[_0xa876('0x9d')](_0x516dac,{'showHidden':![],'depth':null})+_0xa876('0x165')+_0x4e28e7));}})[_0xa876('0xb6')](function(_0x552f59){return _0x3e6259(msgResponse('ifTime',_0xa876('0x157'),JSON[_0xa876('0x48')](_0x552f59)));});});};Dialer['prototype'][_0xa876('0x166')]=function(_0x2500df){var _0x276490=this;return function(){switch(_0x2500df[_0xa876('0x5b')]){case _0xa876('0x167'):freeVariablesPredictive(_0x2500df);_0x276490[_0xa876('0x168')](_0x2500df,0x1);break;case _0xa876('0x169'):freeVariablesPredictive(_0x2500df);_0x276490[_0xa876('0x168')](_0x2500df,_0x2500df[_0xa876('0x16a')]);break;case _0xa876('0x8'):_0x276490[_0xa876('0x8')](_0x2500df);break;case _0xa876('0x7'):freeVariablesPredictive(_0x2500df);_0x276490[_0xa876('0x168')](_0x2500df,0x1);break;default:freeVariablesPredictive(_0x2500df);logger[_0xa876('0x9f')]('Queue',_0x2500df['name'],_0xa876('0x16b'));}};};Dialer[_0xa876('0x1a')][_0xa876('0x16c')]=function(_0x2f9034){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopper[_0xa876('0x16d')](_0x2f9034['id'],previewRecallmeReminderInterval))[_0xa876('0x3c')](function(_0x1f90f6){for(var _0x19db0e=0x0;_0x19db0e<_0x1f90f6[_0xa876('0x141')];_0x19db0e++){var _0x12403b=_0x1f90f6[_0x19db0e][_0xa876('0x16e')][_0xa876('0x41')];if(_0x12403b)io['to'](util[_0xa876('0x80')](_0xa876('0x16f'),_0x12403b))[_0xa876('0x4c')](_0xa876('0x170'),{'hopper':_0x1f90f6[_0x19db0e]});}})[_0xa876('0xb6')](function(){});};Dialer[_0xa876('0x1a')][_0xa876('0x171')]=function(_0x59d61c){var _0x10cedf=this;return function(){_0x10cedf['handleIvr'](_0x59d61c);};};Dialer[_0xa876('0x1a')][_0xa876('0x9')]=function(_0x468cde){var _0x231089=this;if(isNotPreview(_0x468cde[_0xa876('0x5b')])){if(isVoiceQueueOutbound(_0x468cde[_0xa876('0x4d')])&&isActive(_0x468cde[_0xa876('0x172')])){_0x468cde[_0xa876('0xa6')]=!![];Promise['resolve']()[_0xa876('0x3c')](checkIsLoggedIn(_0x468cde,_0x468cde['loggedIn']))[_0xa876('0x3c')](checkIsActive(_0x468cde,_0x468cde[_0xa876('0x172')]))[_0xa876('0x3c')](checkInterval(_0x468cde))[_0xa876('0x3c')](_0x231089['checkIsTrunkReachable'](_0x468cde))[_0xa876('0x3c')](_0x231089['checkIfTime'](_0x468cde[_0xa876('0x173')],_0x468cde[_0xa876('0x174')],_0x468cde[_0xa876('0x41')],_0x468cde))[_0xa876('0x3c')](_0x231089[_0xa876('0x152')](_0x468cde[_0xa876('0x44')],_0x468cde['dialTimezone'],_0x468cde[_0xa876('0x41')],_0x468cde))['then'](_0x231089['checkDialMethod'](_0x468cde))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x468cde));}else{notSendMessagesQueue(_0x468cde);}}else{freeVariablesPredictive(_0x468cde);}};Dialer['prototype']['syncQueueSummaryComplete']=_[_0xa876('0x175')](function(){var _0x59cdc1=_[_0xa876('0x176')](this[_0xa876('0x1e')],function(_0x3946e2){return _0x3946e2[_0xa876('0x177')];});var _0x480483=_['filter'](this[_0xa876('0x20')],function(_0x11928f){return _0x11928f['online']&&_0x11928f[_0xa876('0xb4')]===_0xa876('0xe1');});if(_0x59cdc1[_0xa876('0x141')]>0x0&&_0x480483[_0xa876('0x141')]>0x0){return Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x59cdc1,'id'),previewRecallmeReminderInterval,_['map'](_0x480483,'id')))[_0xa876('0x3c')](function(_0x5ed788){for(var _0x4ee3a6=0x0;_0x4ee3a6<_0x5ed788[_0xa876('0x141')];_0x4ee3a6++){var _0x5be25f=_0x5ed788[_0x4ee3a6][_0xa876('0x16e')][_0xa876('0x41')];if(_0x5be25f)io['to'](util['format'](_0xa876('0x16f'),_0x5be25f))[_0xa876('0x4c')](_0xa876('0x170'),{'hopper':_0x5ed788[_0x4ee3a6]});}})[_0xa876('0xb6')](function(_0x45b9a8){logger['error'](_0xa876('0x16c'),_0x45b9a8);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xa876('0x14c')]=function(){var _0x4b1cca=this;var _0x4fa094;for(var _0x29191e in this[_0xa876('0x1f')]){if(typeof this['campaigns'][_0x29191e]!==_0xa876('0xb2')){_0x4fa094=this[_0xa876('0x1f')][_0x29191e];if(isCampaignIvr(_0x4fa094[_0xa876('0x4d')])&&isActive(_0x4fa094['active'])){_0x4fa094[_0xa876('0xa6')]=!![];Promise[_0xa876('0xbb')]()[_0xa876('0x3c')](checkIsActive(_0x4fa094,_0x4fa094[_0xa876('0x7e')]))['then'](checkInterval(_0x4fa094))[_0xa876('0x3c')](_0x4b1cca['checkIsTrunkReachable'](_0x4fa094))[_0xa876('0x3c')](_0x4b1cca['checkIfTime'](_0x4fa094[_0xa876('0x173')],_0x4fa094[_0xa876('0x174')],_0x4fa094['name'],_0x4fa094))[_0xa876('0x3c')](_0x4b1cca[_0xa876('0x152')](_0x4fa094[_0xa876('0x44')],_0x4fa094['dialTimezone'],_0x4fa094[_0xa876('0x41')],_0x4fa094))['then'](_0x4b1cca['launchHandleIvr'](_0x4fa094))[_0xa876('0xb6')](loggerCatchQueueSummary(_0xa876('0x178'),_0x4fa094));}else{notSendMessagesCampaign(_0x4fa094);}}}};function getCallerIdRandom(_0x2d39f8,_0x2b6966){var _0x15be6c;var _0x1df8ec;var _0x342da1;if(_0x2b6966<=0x0){_0x2b6966=0x1;}_0x15be6c=new RegExp('\x5cw{0,'+_0x2b6966+'}$');_0x1df8ec=Math[_0xa876('0x179')](0xa,_0x2b6966-0x1);_0x342da1=Math['pow'](0xa,_0x2b6966)-0x1;return util[_0xa876('0x80')]('%s',_[_0xa876('0x17a')](_0x2d39f8,_0x15be6c,_[_0xa876('0x17b')](_0x1df8ec,_0x342da1)));}function extractCalleridName(_0x3ed652){var _0xac38fb=_0x3ed652[_0xa876('0x17c')](/"(.*?)"/);return _0xac38fb?_0xac38fb[0x1]:_0x3ed652;}Dialer[_0xa876('0x1a')][_0xa876('0x17d')]=function(_0x448d5e,_0x156c1b){var _0x4f947d=this;var _0x37f4ab=uuid['v4']();this[_0xa876('0x24')][_0x37f4ab]=new Action(_0x448d5e,_0x156c1b,_0x37f4ab);return new Promise(function(_0x3f3c9c,_0x2b59a4){if(_[_0xa876('0x8d')](_0x448d5e)&&typeof _0x448d5e!==_0xa876('0x17e')){return _0x2b59a4(msgResponse(_0xa876('0x17f'),_0xa876('0x157'),_0xa876('0x180')));}if(_[_0xa876('0x8d')](_0x156c1b[_0xa876('0x181')])||_0x156c1b[_0xa876('0x181')]===null){return _0x2b59a4(msgResponse('originate',_0xa876('0x157'),_0xa876('0x182')));}var _0x439ec3={'XMD-CALLERID':_0x4f947d[_0xa876('0x24')][_0x37f4ab]['getCaller'](),'XMD-AGI':_0x448d5e[_0xa876('0x111')]?util[_0xa876('0x80')](_0xa876('0x183'),ipAgi,_0x448d5e[_0xa876('0x111')]):_0xa876('0x184'),'XMD-AGIAFTER':_0x448d5e['dialQueueProject2']?util[_0xa876('0x80')](_0xa876('0x183'),ipAgi,_0x448d5e[_0xa876('0x117')]):_0xa876('0x184'),'XMD-QUEUE':_0x448d5e[_0xa876('0x4d')]==='outbound'?util[_0xa876('0x80')](_0xa876('0x185'),_0x448d5e[_0xa876('0x41')],_0x448d5e[_0xa876('0x186')]||'',_0x448d5e['dialAgiAfterHangupAgent']?'c':'',_0x448d5e[_0xa876('0x121')]||0x3):_0xa876('0x184'),'XMD-CONTACTID':_0x156c1b[_0xa876('0x105')],'XMD-CDRTYPE':_0xa876('0x6'),'CALLERID(all)':_0x4f947d[_0xa876('0x24')][_0x37f4ab][_0xa876('0x187')](),'XMD-AMD':_0x448d5e[_0xa876('0xe7')]?'ACTIVE':_0xa876('0x184'),'XMD-DESTINATION':_0xa876('0xe6')};if(_0x448d5e[_0xa876('0xe7')]){_0x439ec3[_0xa876('0x188')]=_0x448d5e[_0xa876('0x189')]||0x9c4;_0x439ec3[_0xa876('0x18a')]=_0x448d5e[_0xa876('0x18b')]||0x5dc;_0x439ec3[_0xa876('0x18c')]=_0x448d5e[_0xa876('0x18d')]||0x320;_0x439ec3[_0xa876('0x18e')]=_0x448d5e[_0xa876('0x18f')]||0x1388;_0x439ec3['XMD-AMDMINWORDLENGTH']=_0x448d5e[_0xa876('0x190')]||0x64;_0x439ec3[_0xa876('0x191')]=_0x448d5e[_0xa876('0x192')]||0x32;_0x439ec3[_0xa876('0x193')]=_0x448d5e[_0xa876('0x194')]||0x3;_0x439ec3[_0xa876('0x195')]=_0x448d5e[_0xa876('0x196')]||0x100;_0x439ec3[_0xa876('0x197')]=_0x448d5e[_0xa876('0x198')]||0x1388;}if(_0x448d5e[_0xa876('0x4d')]===_0xa876('0x4e')){_0x439ec3['XMD-VOICEQUEUEID']=_0x156c1b[_0xa876('0x106')];}else{_0x439ec3['XMD-CAMPAIGNID']=_0x156c1b[_0xa876('0xdb')];}for(var _0x3f4fc8 in _0x156c1b[_0xa876('0x199')]){if(typeof _0x156c1b[_0xa876('0x199')][_0x3f4fc8]!=='undefined'){if(isNotNull(_0x156c1b[_0xa876('0x199')][_0x3f4fc8])&&_0x3f4fc8!=='id'&&_0x3f4fc8!==_0xa876('0x19a')&&_0x3f4fc8!==_0xa876('0x19b')&&_0x3f4fc8!=='updatedAt'){_0x439ec3[util['format']('%s%s',_0xa876('0x19c'),_[_0xa876('0x19d')](_0x3f4fc8))]=_0x156c1b['Contact'][_0x3f4fc8];}}}var _0x509e10=_0x4f947d[_0xa876('0xdf')](_0x448d5e[_0xa876('0x7d')])?getCallerId(_0x448d5e[_0xa876('0x7d')][_0xa876('0x19e')],_0x448d5e[_0xa876('0x5c')],_0x448d5e['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x448d5e[_0xa876('0x5d')],_0x448d5e[_0xa876('0x19f')]):_0x448d5e[_0xa876('0x5d')]):getCallerId(_['isNil'](_0x448d5e['TrunkBackup'])?_0x448d5e['Trunk'][_0xa876('0x19e')]:_0x448d5e[_0xa876('0x1a0')][_0xa876('0x19e')],_0x448d5e['dialOriginateCallerIdName'],_0x448d5e[_0xa876('0x19f')]>0x0?getCallerIdRandom(_0x448d5e[_0xa876('0x5d')],_0x448d5e['dialRandomLastDigitCallerIdNumber']):_0x448d5e[_0xa876('0x5d')]);if(_0x509e10){_0x439ec3['XMD-ORIGINATECALLERIDNAME']=_0x4f947d[_0xa876('0x24')][_0x37f4ab][_0xa876('0x1a1')]=extractCalleridName(_0x509e10);_0x439ec3[_0xa876('0x1a2')]=_0x156c1b[_0xa876('0x181')];}_0x448d5e[_0xa876('0x1a3')]=_0x439ec3;return ami['Action']({'actionid':_0x37f4ab,'action':'originate','channel':_0x4f947d['isTrunkReachable'](_0x448d5e[_0xa876('0x7d')])?util[_0xa876('0x80')]('SIP/%s/%s%s',_0x448d5e[_0xa876('0x7d')]['name'],isNotNull(_0x448d5e[_0xa876('0x5f')])?_0x448d5e[_0xa876('0x5f')][_0xa876('0x1a4')]()||'':'',_0x448d5e[_0xa876('0x1a5')]>0x0?_0x156c1b[_0xa876('0x181')]['substring'](_0x448d5e['dialCutDigit']):_0x156c1b['phone']):util[_0xa876('0x80')](_0xa876('0x1a6'),_['isNil'](_0x448d5e[_0xa876('0x1a0')])?_0x448d5e[_0xa876('0x7d')][_0xa876('0x41')]:_0x448d5e[_0xa876('0x1a0')]['name'],isNotNull(_0x448d5e[_0xa876('0x5f')])?_0x448d5e[_0xa876('0x5f')][_0xa876('0x1a4')]()||'':'',_0x448d5e['dialCutDigit']>0x0?_0x156c1b[_0xa876('0x181')]['substring'](_0x448d5e['dialCutDigit']):_0x156c1b[_0xa876('0x181')]),'callerid':_0x509e10,'Exten':_0xa876('0xe6'),'Context':'from-sip','Priority':'1','variable':_0x439ec3,'timeout':(_0x448d5e[_0xa876('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x37f4ab})[_0xa876('0x3c')](function(_0x474ff1){return _0x3f3c9c(_0x474ff1);})[_0xa876('0xb6')](function(_0x3505fb){_0x448d5e[_0xa876('0x68')]+=0x1;var _0x4ba74c=new History(_0x4f947d[_0xa876('0x24')][_0x37f4ab]);logger[_0xa876('0x9f')](util[_0xa876('0x80')](_0xa876('0x1a7'),JSON[_0xa876('0x48')](_0x3505fb)));_0x4ba74c[_0xa876('0xac')]=0xe;_0x4ba74c[_0xa876('0xea')]=_0xa876('0x1a8');_0x4ba74c['starttime']=moment()['format'](_0xa876('0x104'));_0x4ba74c[_0xa876('0xad')]=_0x4ba74c[_0xa876('0x12b')];_0x4f947d['createHistory'](_0x4ba74c)[_0xa876('0xb6')](loggerCatch(_0xa876('0x1a9')));_0x4f947d['moveContactManagedDialer'](_0x4ba74c)[_0xa876('0xb6')](loggerCatch(_0xa876('0x1a9')))['finally'](function(){delete _0x4f947d[_0xa876('0x24')][_0x37f4ab];return _0x2b59a4(msgResponse(_0xa876('0x17f'),_0xa876('0x1aa'),_0xa876('0x1ab')));});});});};Dialer[_0xa876('0x1a')][_0xa876('0x2f')]=function(_0x16df2d){var _0x226b73=this[_0xa876('0x24')][_0x16df2d[_0xa876('0x135')]];if(_0x226b73){delete this[_0xa876('0x24')][_0x16df2d[_0xa876('0x135')]];_0x226b73[_0xa876('0x120')]=moment()[_0xa876('0x80')]('YYYY-MM-DD\x20HH:mm:ss');var _0x295f66=_0x226b73['type']==='ivr'?this['campaigns'][_0x226b73[_0xa876('0xb8')]]:this['voiceQueues'][_0x226b73[_0xa876('0x1ac')]()];if(!this['isSuccess'](_0x16df2d[_0xa876('0x1ad')])){this['updateOriginated'](_0x295f66);return this[_0xa876('0x1ae')](_0x226b73,_0x295f66,_0x16df2d)[_0xa876('0xb6')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xa876('0x26')][_0x16df2d[_0xa876('0xe3')]]=_0x226b73;}};Dialer[_0xa876('0x1a')][_0xa876('0x1af')]=function(_0x3f6e0d,_0x397ffa,_0x2e4085){var _0x1ee8f8=new History(_0x397ffa);if(_0x1ee8f8['countbusyretry']+_0x1ee8f8[_0xa876('0xf6')]+_0x1ee8f8[_0xa876('0xf7')]+_0x1ee8f8['countnosuchnumberretry']+_0x1ee8f8[_0xa876('0xf9')]+_0x1ee8f8[_0xa876('0xfa')]+_0x1ee8f8[_0xa876('0xf2')]+_0x1ee8f8[_0xa876('0xfb')]>=_0x2e4085[_0xa876('0xfc')]-0x1){return!![];}switch(_0x3f6e0d){case 0x3:if(_0x1ee8f8[_0xa876('0xf7')]>=_0x2e4085[_0xa876('0x1b0')]-0x1){return!![];}this[_0xa876('0xc6')]({'active':![],'countnoanswerretry':_0x1ee8f8[_0xa876('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x2e4085[_0xa876('0x1b1')],_0xa876('0x103'))[_0xa876('0x80')](_0xa876('0x104')),'ContactId':_0x1ee8f8[_0xa876('0x105')],'ListId':_0x1ee8f8['ListId'],'VoiceQueueId':_0x1ee8f8[_0xa876('0x106')]||undefined,'CampaignId':_0x1ee8f8[_0xa876('0xdb')]||undefined})[_0xa876('0xb6')](loggerCatch(_0xa876('0x1b2')));break;case 0x5:if(_0x1ee8f8[_0xa876('0xf5')]>=_0x2e4085[_0xa876('0x1b3')]-0x1){return!![];}this[_0xa876('0xc6')]({'active':![],'countbusyretry':_0x1ee8f8[_0xa876('0xf5')]+=0x1,'scheduledat':moment()[_0xa876('0x101')](_0x2e4085[_0xa876('0x1b4')],_0xa876('0x103'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee8f8['ContactId'],'ListId':_0x1ee8f8['ListId'],'VoiceQueueId':_0x1ee8f8['VoiceQueueId']||undefined,'CampaignId':_0x1ee8f8['CampaignId']||undefined})['catch'](loggerCatch(_0xa876('0x1b5')));break;case 0x8:if(_0x1ee8f8[_0xa876('0xf6')]>=_0x2e4085[_0xa876('0x1b6')]-0x1){return!![];}this[_0xa876('0xc6')]({'active':![],'countcongestionretry':_0x1ee8f8[_0xa876('0xf6')]+=0x1,'scheduledat':moment()[_0xa876('0x101')](_0x2e4085[_0xa876('0x1b7')],'minutes')[_0xa876('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee8f8[_0xa876('0x105')],'ListId':_0x1ee8f8[_0xa876('0x10e')],'VoiceQueueId':_0x1ee8f8[_0xa876('0x106')]||undefined,'CampaignId':_0x1ee8f8['CampaignId']||undefined})['catch'](loggerCatch(_0xa876('0x1b8')));break;case 0x0:if(_0x1ee8f8['countnosuchnumberretry']>=_0x2e4085['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xa876('0xc6')]({'active':![],'countnosuchnumberretry':_0x1ee8f8[_0xa876('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x2e4085[_0xa876('0x1b9')],_0xa876('0x103'))['format'](_0xa876('0x104')),'ContactId':_0x1ee8f8[_0xa876('0x105')],'ListId':_0x1ee8f8[_0xa876('0x10e')],'VoiceQueueId':_0x1ee8f8[_0xa876('0x106')]||undefined,'CampaignId':_0x1ee8f8[_0xa876('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x1ee8f8[_0xa876('0xf9')]>=_0x2e4085[_0xa876('0x129')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x1ee8f8['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x2e4085[_0xa876('0x1ba')],_0xa876('0x103'))[_0xa876('0x80')](_0xa876('0x104')),'ContactId':_0x1ee8f8[_0xa876('0x105')],'ListId':_0x1ee8f8[_0xa876('0x10e')],'VoiceQueueId':_0x1ee8f8[_0xa876('0x106')]||undefined,'CampaignId':_0x1ee8f8[_0xa876('0xdb')]||undefined})['catch'](loggerCatch(_0xa876('0x12a')));break;case 0xb:if(_0x1ee8f8[_0xa876('0xfa')]>=_0x2e4085[_0xa876('0x1bb')]-0x1){return!![];}this[_0xa876('0xc6')]({'active':![],'countabandonedretry':_0x1ee8f8[_0xa876('0xfa')]+=0x1,'scheduledat':moment()[_0xa876('0x101')](_0x2e4085[_0xa876('0x131')],'minutes')[_0xa876('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee8f8[_0xa876('0x105')],'ListId':_0x1ee8f8[_0xa876('0x10e')],'VoiceQueueId':_0x1ee8f8[_0xa876('0x106')]||undefined,'CampaignId':_0x1ee8f8[_0xa876('0xdb')]||undefined})[_0xa876('0xb6')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1ee8f8[_0xa876('0xf2')]>=_0x2e4085[_0xa876('0xfe')]-0x1){return!![];}this[_0xa876('0xc6')]({'active':![],'countmachineretry':_0x1ee8f8[_0xa876('0xf2')]+=0x1,'scheduledat':moment()[_0xa876('0x101')](_0x2e4085[_0xa876('0x102')],_0xa876('0x103'))[_0xa876('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee8f8['ContactId'],'ListId':_0x1ee8f8[_0xa876('0x10e')],'VoiceQueueId':_0x1ee8f8[_0xa876('0x106')]||undefined,'CampaignId':_0x1ee8f8['CampaignId']||undefined})['catch'](loggerCatch(_0xa876('0x107')));break;case 0x14:if(_0x1ee8f8[_0xa876('0xfb')]>=_0x2e4085[_0xa876('0x1bc')]-0x1){return!![];}this[_0xa876('0xc6')]({'active':![],'countagentrejectretry':_0x1ee8f8[_0xa876('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x2e4085[_0xa876('0x1bd')],_0xa876('0x103'))[_0xa876('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1ee8f8['ContactId'],'ListId':_0x1ee8f8[_0xa876('0x10e')],'VoiceQueueId':_0x1ee8f8[_0xa876('0x106')]||undefined,'CampaignId':_0x1ee8f8['CampaignId']||undefined})[_0xa876('0xb6')](loggerCatch(_0xa876('0x1be')));break;default:return!![];}};Dialer[_0xa876('0x1a')][_0xa876('0x1ae')]=function(_0x84da1c,_0x2b9678,_0x20fd5d){var _0x285402=this;var _0x35b4b5=new History(_0x84da1c);var _0x4f4c4b=![];var _0x59aa61;var _0x41576b;return new Promise(function(_0x431895,_0x3060fc){if(_[_0xa876('0x8d')](_0x2b9678)&&typeof _0x2b9678!==_0xa876('0x17e')){return _0x3060fc(msgResponse(_0xa876('0x1bf'),_0xa876('0x157'),_0xa876('0x1c0')));}if(_[_0xa876('0x8d')](_0x20fd5d)&&typeof _0x20fd5d!==_0xa876('0x17e')){return _0x3060fc(msgResponse(_0xa876('0x1bf'),_0xa876('0x157'),_0xa876('0x1c1')));}_0x285402[_0xa876('0xbd')](_0x35b4b5,_0x20fd5d[_0xa876('0x115')],_0x2b9678)['then'](function(_0x10031f){if(_0x10031f[_0xa876('0x128')]==0x1)_0x4f4c4b=!![];switch(_0x20fd5d['reason']){case'0':_0x2b9678[_0xa876('0x1c2')]+=0x1;_0x35b4b5[_0xa876('0xac')]=0x0;_0x35b4b5['statedesc']=_0xa876('0x1c3');_0x35b4b5[_0xa876('0xf8')]+=0x1;_0x35b4b5[_0xa876('0x10c')]+=0x1;ami[_0xa876('0x4c')]('custom:agentnosuchnumber',ut[_0xa876('0xf3')](_0x84da1c,_0xa876('0x1c4')));_0x59aa61=_0x2b9678[_0xa876('0x1b9')];_0x41576b=_0x2b9678[_0xa876('0x126')];_0x285402['createHistory'](_0x35b4b5)['catch'](loggerCatch(_0xa876('0xf4')));if(_0x285402['checkRetriveMax'](0x0,_0x84da1c,_0x2b9678)&&!_0x4f4c4b){if(_0x35b4b5[_0xa876('0xf8')]>=_0x2b9678[_0xa876('0x1c5')]){_0x285402[_0xa876('0xff')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1c6'));}else{_0x285402['stateGlobal'](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1c6'));}}break;case'3':_0x2b9678[_0xa876('0x67')]+=0x1;_0x35b4b5['state']=0x3;_0x35b4b5[_0xa876('0xea')]=_0xa876('0x1c7');_0x35b4b5[_0xa876('0xf7')]+=0x1;_0x35b4b5[_0xa876('0x10c')]+=0x1;var _0x56f798=ut['buildNoAnswerEventPayload'](_0x84da1c,_0x2b9678);ami[_0xa876('0x4c')](_0xa876('0x1c8'),_0x56f798);_0x59aa61=_0x2b9678['dialNoAnswerRetryFrequency'];_0x41576b=_0x2b9678['callAdditionalPhoneAfterMin'];_0x285402[_0xa876('0xd3')](_0x35b4b5)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x285402[_0xa876('0x1af')](0x3,_0x84da1c,_0x2b9678)&&!_0x4f4c4b){if(_0x35b4b5[_0xa876('0xf7')]>=_0x2b9678['dialNoAnswerMaxRetry']){_0x285402[_0xa876('0xff')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1c9'));}else{_0x285402[_0xa876('0xfd')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1c9'));}}break;case'5':_0x2b9678[_0xa876('0x63')]+=0x1;_0x35b4b5[_0xa876('0xac')]=0x5;_0x35b4b5['statedesc']=_0xa876('0x1ca');_0x35b4b5[_0xa876('0xf5')]+=0x1;_0x35b4b5[_0xa876('0x10c')]+=0x1;ami[_0xa876('0x4c')](_0xa876('0x1cb'),ut['buildObj'](_0x84da1c,'busy'));_0x59aa61=_0x2b9678['dialBusyRetryFrequency'];_0x41576b=_0x2b9678[_0xa876('0x126')];_0x285402[_0xa876('0xd3')](_0x35b4b5)[_0xa876('0xb6')](loggerCatch(_0xa876('0x1cc')));if(_0x285402[_0xa876('0x1af')](0x5,_0x84da1c,_0x2b9678)&&!_0x4f4c4b){if(_0x35b4b5[_0xa876('0xf5')]>=_0x2b9678[_0xa876('0x1b3')]){_0x285402[_0xa876('0xff')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1cd'));}else{_0x285402['stateGlobal'](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1cd'));}}break;case'8':_0x2b9678['outboundCongestionCallsDay']+=0x1;_0x35b4b5[_0xa876('0xac')]=0x8;_0x35b4b5[_0xa876('0xea')]=_0xa876('0x1ce');_0x35b4b5[_0xa876('0xf6')]+=0x1;_0x35b4b5[_0xa876('0x10c')]+=0x1;_0x59aa61=_0x2b9678['dialCongestionRetryFrequency'];_0x41576b=_0x2b9678[_0xa876('0x126')];ami[_0xa876('0x4c')]('custom:agentcongestion',ut[_0xa876('0xf3')](_0x84da1c,_0xa876('0x1cf')));_0x285402[_0xa876('0xd3')](_0x35b4b5)[_0xa876('0xb6')](loggerCatch(_0xa876('0x1d0')));if(_0x285402[_0xa876('0x1af')](0x8,_0x84da1c,_0x2b9678)&&!_0x4f4c4b){if(_0x35b4b5[_0xa876('0xf6')]>=_0x2b9678[_0xa876('0x1b6')]){_0x285402[_0xa876('0xff')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1d1'));}else{_0x285402[_0xa876('0xfd')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1d1'));}}break;case'11':_0x2b9678['outboundAbandonedCallsDay']+=0x1;_0x35b4b5[_0xa876('0xac')]=0xb;_0x35b4b5['statedesc']='Abandoned';_0x35b4b5[_0xa876('0xfa')]+=0x1;_0x35b4b5[_0xa876('0x10c')]+=0x1;_0x59aa61=_0x2b9678[_0xa876('0x131')];_0x41576b=_0x2b9678[_0xa876('0x126')];_0x285402[_0xa876('0xd3')](_0x35b4b5)[_0xa876('0xb6')](loggerCatch(_0xa876('0x133')));if(_0x285402[_0xa876('0x1af')](0xb,_0x84da1c,_0x2b9678)&&!_0x4f4c4b){if(_0x35b4b5[_0xa876('0xfa')]>=_0x2b9678[_0xa876('0x1bb')]){_0x285402[_0xa876('0xff')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1d2'));}else{_0x285402[_0xa876('0xfd')](_0x35b4b5,_0x431895,_0x3060fc,_0xa876('0x1d2'));}}break;case'20':_0x2b9678[_0xa876('0x6a')]+=0x1;_0x35b4b5[_0xa876('0xac')]=0x14;_0x35b4b5[_0xa876('0xea')]=_0xa876('0x1d3');_0x35b4b5['countagentrejectretry']+=0x1;_0x35b4b5[_0xa876('0x10c')]+=0x1;_0x59aa61=_0x2b9678[_0xa876('0x1bd')];_0x41576b=_0x2b9678[_0xa876('0x126')];ami[_0xa876('0x4c')](_0xa876('0x1d4'),ut['buildObj'](_0x84da1c,_0xa876('0x1d5')));_0x285402['createHistory'](_0x35b4b5)[_0xa876('0xb6')](loggerCatch(_0xa876('0x1d6')));if(_0x285402[_0xa876('0x1af')](0x14,_0x84da1c,_0x2b9678)&&!_0x4f4c4b){if(_0x35b4b5[_0xa876('0xfb')]>=_0x2b9678[_0xa876('0x1bc')]){_0x285402[_0xa876('0xff')](_0x35b4b5,_0x431895,_0x3060fc,'reason\x2020\x20agentreject');}else{_0x285402[_0xa876('0xfd')](_0x35b4b5,_0x431895,_0x3060fc,'reason\x2020\x20agentreject');}}break;default:_0x2b9678[_0xa876('0x6b')]+=0x1;_0x35b4b5['state']=0xc;_0x35b4b5[_0xa876('0xea')]=_0x20fd5d['reason'];_0x59aa61=_0x2b9678[_0xa876('0x1bd')];_0x41576b=_0x2b9678[_0xa876('0x126')];_0x285402[_0xa876('0xd3')](_0x35b4b5)[_0xa876('0xb6')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x285402[_0xa876('0x1af')](_0x20fd5d[_0xa876('0x115')],_0x84da1c,_0x2b9678)&&!_0x4f4c4b){if(_0x35b4b5[_0xa876('0xf5')]+_0x35b4b5[_0xa876('0xf6')]+_0x35b4b5[_0xa876('0xf7')]+_0x35b4b5[_0xa876('0xf8')]+_0x35b4b5[_0xa876('0xf9')]+_0x35b4b5[_0xa876('0xfa')]+_0x35b4b5[_0xa876('0xf2')]+_0x35b4b5['countagentrejectretry']>=_0x2b9678[_0xa876('0xfc')]){_0x285402[_0xa876('0xfd')](_0x35b4b5,_0x431895,_0x3060fc,_0x20fd5d[_0xa876('0x115')]);}else{_0x285402[_0xa876('0xff')](_0x35b4b5,_0x431895,_0x3060fc,_0x20fd5d[_0xa876('0x115')]);}}}})['then'](function(){if(_0x4f4c4b){_0x285402[_0xa876('0xbf')](_0x35b4b5,_0x59aa61,_0x41576b)[_0xa876('0x3c')](function(){return _0x431895(0x1);});}});});};Dialer[_0xa876('0x1a')][_0xa876('0xfd')]=function(_0x1675ee,_0x396c20,_0x4aa2c2,_0x33723e){var _0x158843=new Final(_0x1675ee);_0x158843[_0xa876('0xac')]=0xf;_0x158843[_0xa876('0xea')]=_0xa876('0x1d7');this[_0xa876('0xff')](_0x158843,_0x396c20,_0x4aa2c2,_0x33723e);};Dialer[_0xa876('0x1a')][_0xa876('0xff')]=function(_0x394de6,_0x4f0cc6,_0xf5056c,_0x10f2c5){this[_0xa876('0xd1')](_0x394de6)['then'](function(){return _0x4f0cc6(msgResponse(_0xa876('0x1bf'),'Success',_0x10f2c5));})['catch'](function(){return _0xf5056c(msgResponse(_0xa876('0x1d8'),'Failure',_0xa876('0x1d9')));});};Dialer['prototype'][_0xa876('0x8')]=function(_0x19a51a){var _0x56cd35=_0x19a51a[_0xa876('0x1da')]/0x64;var _0x15c138=_0x19a51a[_0xa876('0x122')]/(_0x19a51a[_0xa876('0x122')]+_0x19a51a['outboundAnswerCallsDay']);var _0x35ac83=Math[_0xa876('0x1db')](_0x19a51a[_0xa876('0x1dc')]*(_0x19a51a['predictiveIntervalMaxThreshold']/0x64));var _0x2d2789=Math[_0xa876('0x1db')](_0x19a51a[_0xa876('0x1dc')]*(_0x19a51a[_0xa876('0x1dd')]/0x64));var _0x2e0366=_0x19a51a['available']+_0x19a51a[_0xa876('0x57')];var _0x209e89=Math['floor'](_0x19a51a['erlangCalls']*_0x19a51a['erlangAbandonmentRate']*_0x19a51a['predictiveIntervalHitRate']*_0x19a51a[_0xa876('0x73')]);if(_[_0xa876('0x8d')](_0x19a51a[_0xa876('0x7c')])){if(!_[_0xa876('0x8d')](_0x19a51a[_0xa876('0x7b')])){_0x19a51a[_0xa876('0x7b')]=undefined;loggerPredictive[_0xa876('0x9f')](_0xa876('0x1de'),_0xa876('0x1df'));}if(!_[_0xa876('0x8d')](_0x19a51a[_0xa876('0x97')])){loggerPredictive['error'](_0xa876('0x1de'),_0xa876('0x1e0'));clearInterval(_0x19a51a[_0xa876('0x97')]);_0x19a51a[_0xa876('0x97')]=undefined;}_0x19a51a[_0xa876('0x7c')]=moment()[_0xa876('0x80')](_0xa876('0x104'));loggerPredictive['info'](_0x19a51a[_0xa876('0x41')],_0xa876('0x1e1'),_0x19a51a['startProgressive']);this[_0xa876('0x168')](_0x19a51a,0x1);}else if(ifInterval(_0x19a51a[_0xa876('0x1e2')],_0x19a51a[_0xa876('0x7c')])){this['handlePower'](_0x19a51a,0x1);loggerPredictiveCalls[_0xa876('0x85')](_0xa876('0x1e3'),_0x19a51a[_0xa876('0x7c')],_0x19a51a[_0xa876('0x41')]);_0x19a51a[_0xa876('0x78')]=0x0;_0x19a51a[_0xa876('0x71')]=0x0;}else if(_0x56cd35<_0x15c138&&_0x19a51a[_0xa876('0x1e4')]===_0xa876('0x1e5')){freeVariablesPredictive(_0x19a51a);loggerPredictive[_0xa876('0x85')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xa876('0x1e6'),_0x15c138,_0xa876('0x7c'),_0x19a51a[_0xa876('0x41')]);}else if(_0x209e89<_0x19a51a[_0xa876('0x71')]&&_0x19a51a['dialPredictiveOptimization']===_0xa876('0x1e5')){freeVariablesPredictive(_0x19a51a);loggerPredictive['info'](_0xa876('0x1e7'),_0xa876('0x1e8'),_0x209e89,_0xa876('0x1e9'),_0x19a51a[_0xa876('0x71')],'startProgressive',_0x19a51a[_0xa876('0x41')]);}else if(!ifInterval(_0x19a51a[_0xa876('0x1e2')],_0x19a51a[_0xa876('0x7c')])&&_['isUndefined'](_0x19a51a[_0xa876('0x7b')])&&!_[_0xa876('0x8d')](_0x19a51a[_0xa876('0x7c')])){_0x19a51a['startPredictive']=moment()[_0xa876('0x80')](_0xa876('0x104'));loggerPredictive[_0xa876('0x85')](_0x19a51a[_0xa876('0x41')],'started\x20in\x20predictive\x20at',_0x19a51a[_0xa876('0x7b')]);this[_0xa876('0xc3')](_0x19a51a['dialPredictiveInterval'])[_0xa876('0x3c')](this[_0xa876('0x1ea')](_0x19a51a))[_0xa876('0x3c')](mergeDataErlangB(_0x19a51a))[_0xa876('0x3c')](this[_0xa876('0x1eb')](_0x19a51a))[_0xa876('0xb6')](loggerCatchPredictive(_0xa876('0x1ec'),_0x19a51a));}else if(!ifInterval(_0x19a51a[_0xa876('0x1e2')],_0x19a51a[_0xa876('0x7b')])){_0x19a51a[_0xa876('0x71')]=0x0;_0x19a51a[_0xa876('0x7b')]=moment()[_0xa876('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x19a51a[_0xa876('0x41')],_0xa876('0x1ed'),_0x19a51a[_0xa876('0x7b')]);clearInterval(_0x19a51a[_0xa876('0x97')]);_0x19a51a[_0xa876('0x97')]=undefined;this['averageHandleTime'](_0x19a51a['dialPredictiveInterval'])[_0xa876('0x3c')](this['getDataPredictive'](_0x19a51a))[_0xa876('0x3c')](mergeDataErlangB(_0x19a51a))[_0xa876('0x3c')](this[_0xa876('0x1eb')](_0x19a51a))[_0xa876('0xb6')](loggerCatchPredictive(_0xa876('0x1ee'),_0x19a51a));}else if(_0x19a51a[_0xa876('0x1dc')]&&_0x2e0366<_0x19a51a[_0xa876('0x1dc')]-_0x2d2789){freeVariablesPredictive(_0x19a51a);loggerPredictive[_0xa876('0x85')](_0x19a51a[_0xa876('0x41')],_0xa876('0x1ef'),_0x2e0366,_0xa876('0x1f0'),_0x19a51a['predictiveIntervalAvailable'],'-',_0x2d2789,'=',_0x19a51a['predictiveIntervalAvailable']-_0x2d2789,')');}else if(_0x19a51a[_0xa876('0x1dc')]&&_0x2e0366>_0x19a51a['predictiveIntervalAvailable']+_0x35ac83){freeVariablesPredictive(_0x19a51a);loggerPredictive[_0xa876('0x85')](_0x19a51a[_0xa876('0x41')],_0xa876('0x1ef'),_0x2e0366,')\x20are\x20more\x20than\x20threshold\x20(',_0x19a51a[_0xa876('0x1dc')],'+',_0x35ac83,'=',_0x19a51a[_0xa876('0x1dc')]+_0x35ac83,')');}};Dialer[_0xa876('0x1a')][_0xa876('0x1ea')]=function(_0x56210a){var _0xb0d584=this;return function(_0x178519){return new Promise(function(_0x949426,_0x449d28){_['merge'](_0x56210a,_0x178519[0x0]);if(checkGetDataPredictive(_0x178519[0x0])){var _0x2cf04f=_0x56210a['predictiveIntervalAvailable']=_0x56210a[_0xa876('0x57')]+_0x56210a[_0xa876('0x51')];var _0x1f394c=_0x56210a[_0xa876('0x1e2')]*0x3c;var _0x2b89c7=_0x178519[0x0]['predictiveIntervalAvgTalktime']+_0x178519[0x0][_0xa876('0x8b')];var _0x251a07=(_0x178519[0x0][_0xa876('0x6c')]+_0x178519[0x0][_0xa876('0x6f')]+_0x178519[0x0][_0xa876('0x6e')])/_0x178519[0x0][_0xa876('0x75')];_0x56210a['predictiveIntervalHitRate']=_0x251a07>0x0?_0x251a07:0x1;switch(_0x56210a[_0xa876('0x1e4')]){case _0xa876('0x1e5'):var _0x29b529=_0x56210a[_0xa876('0x1da')]/0x64;return _0xb0d584[_0xa876('0x1f1')](_0x2cf04f,_0x1f394c,_0x2b89c7,_0x251a07,_0x29b529)[_0xa876('0x3c')](function(_0x301fc2){return _0x949426(_0x301fc2);});case _0xa876('0x1f2'):var _0x286b06=_0x56210a[_0xa876('0x1da')]/0x64;return _0xb0d584[_0xa876('0x1f3')](_0x2cf04f,_0x1f394c,_0x2b89c7,_0x251a07,_0x286b06)[_0xa876('0x3c')](function(_0x534cc8){return _0x949426(_0x534cc8);});default:return _0x449d28(msgResponse(_0xa876('0x1f4'),_0xa876('0x157'),'Unknown\x20Predictive'));}}else{return _0x449d28(msgResponse(_0xa876('0x1f4'),_0xa876('0x157'),_0xa876('0x1f5')));}});};};Dialer['prototype'][_0xa876('0x1f6')]=function(_0x5d8615){var _0x49f118=this;return function(_0x494ccf){return new Promise(function(_0x2375a2,_0x35f517){_['merge'](_0x5d8615,_0x494ccf[0x0]);if(checkGetDataPredictive(_0x494ccf[0x0])){loggerPredictive['info'](JSON['stringify'](_0x494ccf[0x0]));if(_0x5d8615[_0xa876('0x1e4')]===_0xa876('0x1e5')){return _0x49f118[_0xa876('0xcf')](_0x5d8615['id'])[_0xa876('0x3c')](function(_0xae1c25){var _0x11156b=_0x5d8615[_0xa876('0x52')]-_0xae1c25[0x0]['outboundQueuePauses'];var _0x101aa1=_0x5d8615[_0xa876('0x1e2')]*0x3c;var _0x447620=_0x494ccf[0x0]['predictiveIntervalAvgTalktime']+_0x494ccf[0x0][_0xa876('0x8b')];var _0x3ed1f2=(_0x494ccf[0x0]['predictiveIntervalAnsweredCalls']+_0x494ccf[0x0][_0xa876('0x6f')]+_0x494ccf[0x0][_0xa876('0x6e')])/_0x494ccf[0x0][_0xa876('0x75')];var _0x4b8f7c=_0x5d8615[_0xa876('0x1da')]/0x64;_0x5d8615[_0xa876('0x74')]=_0xae1c25[0x0][_0xa876('0x1f7')]||0x0;_0x5d8615[_0xa876('0x72')]=_0x3ed1f2>0x0?_0x3ed1f2:0x1;return _0x49f118[_0xa876('0x1f1')](_0x11156b,_0x101aa1,_0x447620,_0x3ed1f2,_0x4b8f7c);})[_0xa876('0x3c')](function(_0x26697c){return _0x2375a2(_0x26697c);})[_0xa876('0xb6')](function(_0x3cdea1){return _0x35f517(msgResponse(_0xa876('0x1f8'),'Failure',JSON[_0xa876('0x48')](_0x3cdea1)));});}if(_0x5d8615[_0xa876('0x1e4')]===_0xa876('0x1f2')){return _0x49f118[_0xa876('0xcf')](_0x5d8615['id'])[_0xa876('0x3c')](function(_0x33991a){var _0x12fe93=_0x5d8615[_0xa876('0x52')]-_0x33991a[0x0][_0xa876('0x1f7')];var _0x3e5dbc=_0x5d8615['dialPredictiveInterval']*0x3c;var _0x346cf1=_0x494ccf[0x0][_0xa876('0x6d')]+_0x494ccf[0x0][_0xa876('0x8b')];var _0x48d7f6=(_0x494ccf[0x0][_0xa876('0x6c')]+_0x494ccf[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x494ccf[0x0][_0xa876('0x6e')])/_0x494ccf[0x0][_0xa876('0x75')];var _0x9ed3ea=_0x5d8615[_0xa876('0x1da')]/0x64;_0x5d8615[_0xa876('0x74')]=_0x33991a[0x0][_0xa876('0x1f7')]||0x0;_0x5d8615[_0xa876('0x72')]=_0x48d7f6>0x0?_0x48d7f6:0x1;return _0x49f118[_0xa876('0x1f3')](_0x12fe93,_0x3e5dbc,_0x346cf1,_0x48d7f6,_0x9ed3ea);})['then'](function(_0x2e97b5){return _0x2375a2(_0x2e97b5);})[_0xa876('0xb6')](function(_0x263b50){return _0x35f517(msgResponse(_0xa876('0x1f8'),'Failure',JSON[_0xa876('0x48')](_0x263b50)));});}}else{return _0x35f517(msgResponse(_0xa876('0x1f4'),'Failure',_0xa876('0x1f5')));}});};};Dialer[_0xa876('0x1a')]['startMethodPredictive']=function(_0x334cf5){var _0x414369=this;return function(){var _0x12997e=0x0;var _0x488410=Math['floor'](_0x334cf5[_0xa876('0x79')]*0x3e8);if(_0x488410>0x0){_0x488410=_0x488410<0x64?0x64:_0x488410;loggerPredictive[_0xa876('0x85')](_0x334cf5[_0xa876('0x41')],_0xa876('0x1f9'),_0x488410,_0xa876('0x49'));_0x334cf5['handlePredictive']=setInterval(function(){_0x414369[_0xa876('0x97')](_0x334cf5);loggerPredictiveCalls['info'](_0xa876('0x1fa'),_0x12997e+=0x1);},_0x488410);}else{loggerPredictive[_0xa876('0x85')](_0x334cf5[_0xa876('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xa876('0x1fb')]=function(_0x5e9f14,_0x48c97d){var _0xee6c5b=this;return function(_0x234d39){if(_[_0xa876('0x47')](_0x234d39)){if(_[_0xa876('0xe4')](_0x48c97d[_0xa876('0xda')])||!_0x48c97d['recallme']){if(_0x5e9f14[_0xa876('0x5b')]===_0xa876('0x7')){_0x5e9f14[_0xa876('0x13a')]=_[_0xa876('0x8d')](_0x5e9f14[_0xa876('0x13a')])?!![]:_0x5e9f14[_0xa876('0x13a')];var _0x35efa8=uuid['v4']();_0xee6c5b[_0xa876('0x24')][_0x35efa8]=new Action(_0x5e9f14,_0x48c97d,_0x35efa8);loggerBooked[_0xa876('0x85')](_0xa876('0x1fc'),_0x35efa8,_0xa876('0x1fd'),JSON[_0xa876('0x48')](_0x5e9f14[_0xa876('0x13a')]),'Queue:\x20',_0x5e9f14[_0xa876('0x41')]);if(_0x5e9f14[_0xa876('0x13a')]){_0x5e9f14['queueStatusComplete']=![];_0xee6c5b['queueBooked'][_0xee6c5b[_0xa876('0x24')][_0x35efa8][_0xa876('0xb8')]]=[];ami[_0xa876('0xb3')]({'actionid':_0x35efa8,'action':_0xa876('0x1fe'),'queue':_0x5e9f14[_0xa876('0x41')]})['catch'](function(){_0xee6c5b[_0xa876('0xb9')](_0x5e9f14);_0xee6c5b[_0xa876('0xc6')]({'active':![],'ContactId':_0xee6c5b['actions'][_0x35efa8]['ContactId'],'ListId':_0xee6c5b['actions'][_0x35efa8][_0xa876('0x10e')],'VoiceQueueId':_0xee6c5b[_0xa876('0x24')][_0x35efa8][_0xa876('0x106')]||undefined,'CampaignId':_0xee6c5b[_0xa876('0x24')][_0x35efa8][_0xa876('0xdb')]||undefined})[_0xa876('0xb6')](loggerCatch(_0xa876('0x1ff')));delete _0xee6c5b[_0xa876('0x24')][_0x35efa8];});}else{loggerBooked['info'](_0xa876('0x200'),JSON[_0xa876('0x48')](_0x5e9f14[_0xa876('0x13a')]),_0xa876('0x201'),_0x5e9f14[_0xa876('0x41')]);_0xee6c5b[_0xa876('0xb9')](_0x5e9f14);_0xee6c5b['rescheduleContact']({'active':![],'ContactId':_0xee6c5b[_0xa876('0x24')][_0x35efa8][_0xa876('0x105')],'ListId':_0xee6c5b[_0xa876('0x24')][_0x35efa8][_0xa876('0x10e')],'VoiceQueueId':_0xee6c5b[_0xa876('0x24')][_0x35efa8][_0xa876('0x106')]||undefined,'CampaignId':_0xee6c5b[_0xa876('0x24')][_0x35efa8][_0xa876('0xdb')]||undefined})['catch'](loggerCatch(_0xa876('0x1ff')));delete _0xee6c5b['actions'][_0x35efa8];}}else{return _0xee6c5b[_0xa876('0x17d')](_0x5e9f14,_0x48c97d);}}else{if(getDiff(_0x48c97d[_0xa876('0x202')])<_0x5e9f14['dialRecallMeTimeout']*0x3c){if(_0x48c97d[_0xa876('0x16e')]&&!_0x48c97d[_0xa876('0x16e')][_0xa876('0x203')]){_0xee6c5b['preview'][_0xa876('0x204')](_0x48c97d['id'])[_0xa876('0x1d')](function(){_0xee6c5b['updateOriginated'](_0x5e9f14);});}else{_0xee6c5b[_0xa876('0xc8')]({'active':![]},_0x48c97d['id'],0x1)[_0xa876('0x1d')](function(){_0xee6c5b[_0xa876('0xb9')](_0x5e9f14);});}}else{_0x5e9f14['outboundReCallsDay']+=0x1;_0xee6c5b[_0xa876('0xb9')](_0x5e9f14);if(_0x5e9f14['dialRecallInQueue']){_0xee6c5b[_0xa876('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x48c97d[_0xa876('0x105')],'ListId':_0x48c97d[_0xa876('0x10e')],'VoiceQueueId':_0x48c97d[_0xa876('0x106')]||undefined,'CampaignId':_0x48c97d[_0xa876('0xdb')]||undefined})['catch'](loggerCatch(_0xa876('0x205')));_0xee6c5b[_0xa876('0xd3')](createObjHistory(_0x5e9f14,_0x48c97d,_0xa876('0x206'),0x17,_0xa876('0x207')))['catch'](loggerCatch(_0xa876('0x208')));}else{_0xee6c5b[_0xa876('0xd8')](createObjHistory(_0x5e9f14,_0x48c97d,_0xa876('0x209'),0x16,_0xa876('0x20a')),_0xa876('0x20b'),'[Originate][HistoryRecallClose]');}}}}else{_0x5e9f14[_0xa876('0x62')]+=0x1;_0xee6c5b[_0xa876('0xd8')](createObjHistory(_0x5e9f14,_0x48c97d,'BLACKLIST',0xd,_0xa876('0x20c')),_0xa876('0x20d'),_0xa876('0x20e'));throw _0xa876('0x20f');}};};Dialer['prototype'][_0xa876('0x210')]=function(_0x11ee8f){var _0x15ab22=this;var _0x49f06b=_0x11ee8f['limitCalls']-_0x11ee8f[_0xa876('0x77')]-_0x11ee8f[_0xa876('0xcb')];emitCampaignSummary(_0x11ee8f);if(_0x49f06b>0x0){if(_0x49f06b>this[_0xa876('0x22')]){_0x49f06b=this[_0xa876('0x22')];}_0x11ee8f['temp']+=_0x49f06b;this[_0xa876('0xcd')](_0x11ee8f['id'],_0x49f06b,_0x11ee8f[_0xa876('0x211')],_0x11ee8f)[_0xa876('0x3c')](function(_0x195e6a){_0x11ee8f[_0xa876('0xcb')]-=_0x49f06b;_0x11ee8f[_0xa876('0xcb')]=_0x11ee8f[_0xa876('0xcb')]>0x0?_0x11ee8f[_0xa876('0xcb')]:0x0;if(!checkContactEmpty(_0x195e6a)){_0x11ee8f['message']='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xa876('0x212')+_0x11ee8f[_0xa876('0x41')]);}else{_0x11ee8f[_0xa876('0x77')]+=_0x195e6a[_0xa876('0x141')];_0x11ee8f[_0xa876('0x76')]='RUNNING';for(var _0x52b63c=0x0;_0x52b63c<_0x195e6a[_0xa876('0x141')];_0x52b63c+=0x1){_0x11ee8f[_0xa876('0x213')]+=0x1;if(_[_0xa876('0xe4')](_0x195e6a[_0x52b63c])||_[_0xa876('0xe4')](_0x195e6a[_0x52b63c][_0xa876('0x199')])||_[_0xa876('0xe4')](_0x195e6a[_0x52b63c][_0xa876('0x181')])){_0x15ab22[_0xa876('0x214')](_0xa876('0x215'),_0x11ee8f,_0x195e6a[_0x52b63c]);}else{_0x15ab22[_0xa876('0xc1')](_['pick'](_0x195e6a[_0x52b63c],[_0xa876('0xdb'),_0xa876('0x216')]))[_0xa876('0x3c')](_0x15ab22[_0xa876('0x1fb')](_0x11ee8f,_0x195e6a[_0x52b63c]))[_0xa876('0xb6')](_0x15ab22[_0xa876('0xd6')](_0xa876('0x217'),_0x11ee8f));}}}})[_0xa876('0xb6')](loggerGetContactDialer('[getContactCampaign2]',_0x11ee8f,_0x49f06b));}};Dialer['prototype'][_0xa876('0x168')]=function(_0x3e7df1,_0x5116ab){var _0x6f579=this;var _0x35d156=[];var _0x3fa489=_0x5116ab>=0x1?_0x5116ab:0x1;if(_0x3e7df1[_0xa876('0x5b')]===_0xa876('0x7')){_0x3fa489=0x1;}var _0x443645=Math[_0xa876('0x218')](_0x3e7df1[_0xa876('0x51')]*_0x3fa489)-_0x3e7df1[_0xa876('0x77')]-_0x3e7df1[_0xa876('0xcb')];emitVoiceQueueSummary(_0x3e7df1);if(_0x3e7df1[_0xa876('0x219')]>0x0){var _0x1249a2=_0x3e7df1['dialLimitQueue']-_0x3e7df1[_0xa876('0x77')]-_0x3e7df1[_0xa876('0x57')]-_0x3e7df1['temp']-_0x3e7df1[_0xa876('0x53')];if(_0x443645>_0x1249a2){_0x443645=_0x1249a2;}}if(_0x443645>0x0){if(_0x3e7df1[_0xa876('0x5b')]===_0xa876('0x7')){_0x443645=0x1;}if(_0x443645>this['maxNumberOriginate']){_0x443645=this['maxNumberOriginate'];}_0x3e7df1['temp']+=_0x443645;for(var _0x56149f in this[_0xa876('0x20')]){if(typeof this[_0xa876('0x20')][_0x56149f]!==_0xa876('0xb2')){if(this[_0xa876('0x20')][_0x56149f][_0xa876('0xac')]===_0xa876('0x21a')&&this[_0xa876('0x20')][_0x56149f][_0xa876('0xb4')]===_0xa876('0xe1')){_0x35d156['push'](this['agents'][_0x56149f]['id']);}}}this[_0xa876('0xca')](_0x3e7df1['id'],_0x35d156,_0x443645,_0x3e7df1[_0xa876('0x211')],_0x3e7df1)[_0xa876('0x3c')](function(_0xbaf05f){_0x3e7df1[_0xa876('0xcb')]-=_0x443645;_0x3e7df1[_0xa876('0xcb')]=_0x3e7df1[_0xa876('0xcb')]>0x0?_0x3e7df1[_0xa876('0xcb')]:0x0;if(!checkContactEmpty(_0xbaf05f)){_0x6f579['countReScheduled'](_0x3e7df1)[_0xa876('0x3c')](sendMessageReschedule(_0x3e7df1))[_0xa876('0xb6')](loggerCatch(_0xa876('0xbc')));}else{_0x3e7df1[_0xa876('0x77')]+=_0xbaf05f[_0xa876('0x141')];_0x3e7df1[_0xa876('0x76')]=_0x3e7df1[_0xa876('0x5b')]==='booked'?'ACTIVE':_0xa876('0x21b');for(var _0x1f65a5=0x0;_0x1f65a5<_0xbaf05f[_0xa876('0x141')];_0x1f65a5+=0x1){if(_[_0xa876('0xe4')](_0xbaf05f[_0x1f65a5])||_[_0xa876('0xe4')](_0xbaf05f[_0x1f65a5][_0xa876('0x199')])||_['isNil'](_0xbaf05f[_0x1f65a5]['phone'])){_0x6f579['emptyContact'](_0xa876('0x215'),_0x3e7df1,_0xbaf05f[_0x1f65a5]);}else{_0x6f579[_0xa876('0x21c')](_[_0xa876('0xd9')](_0xbaf05f[_0x1f65a5],[_0xa876('0x106'),_0xa876('0x216')]))[_0xa876('0x3c')](_0x6f579[_0xa876('0x1fb')](_0x3e7df1,_0xbaf05f[_0x1f65a5]))[_0xa876('0xb6')](_0x6f579[_0xa876('0xd6')]('[actionOriginate]\x20',_0x3e7df1));}}}})[_0xa876('0xb6')](loggerGetContactDialer(_0xa876('0x21d'),_0x3e7df1,_0x443645));}};Dialer[_0xa876('0x1a')][_0xa876('0x97')]=function(_0x3d9d9a){if(_0x3d9d9a['dialLimitQueue']>0x0){var _0x41caf8=_0x3d9d9a[_0xa876('0x219')]-_0x3d9d9a['originated']-_0x3d9d9a[_0xa876('0x57')];if(_0x41caf8>0x0){this[_0xa876('0x21e')](_0x3d9d9a);}else{loggerPredictiveCalls[_0xa876('0x85')](_0xa876('0x21f'));}}else{this['tryOriginatePredictive'](_0x3d9d9a);}};Dialer[_0xa876('0x1a')][_0xa876('0x21e')]=function(_0x3c14d2){var _0xa32f37=this;var _0x370865=[];_0x3c14d2[_0xa876('0x77')]+=0x1;for(var _0x5efcd5 in this['agents']){if(typeof this['agents'][_0x5efcd5]!==_0xa876('0xb2')){if(this[_0xa876('0x20')][_0x5efcd5][_0xa876('0xac')]===_0xa876('0x21a')&&this[_0xa876('0x20')][_0x5efcd5][_0xa876('0xb4')]===_0xa876('0xe1')){_0x370865[_0xa876('0x159')](this[_0xa876('0x20')][_0x5efcd5]['id']);}}}this['getContactDialer'](_0x3c14d2['id'],_0x370865,0x1,_0x3c14d2[_0xa876('0x211')],_0x3c14d2)[_0xa876('0x3c')](function(_0x6a82b3){if(!checkContactEmpty(_0x6a82b3)){checkContactLowerLimitOriginate(_0x3c14d2,0x1,0x0);_0xa32f37['countReScheduled'](_0x3c14d2)[_0xa876('0x3c')](sendMessageReschedule(_0x3c14d2))['catch'](loggerCatch(_0xa876('0xbc')));}else{_0x3c14d2[_0xa876('0x76')]=_0xa876('0x21b');if(_[_0xa876('0xe4')](_0x6a82b3[0x0])||_[_0xa876('0xe4')](_0x6a82b3[0x0][_0xa876('0x199')])||_['isNil'](_0x6a82b3[0x0][_0xa876('0x181')])){_0xa32f37['emptyContact'](_0xa876('0x215'),_0x3c14d2,_0x6a82b3[0x0]);}else{_0xa32f37['checkIsBlackList'](_['pick'](_0x6a82b3[0x0],[_0xa876('0x106'),'Contact.phone']))[_0xa876('0x3c')](_0xa32f37[_0xa876('0x1fb')](_0x3c14d2,_0x6a82b3[0x0]))[_0xa876('0xb6')](_0xa32f37[_0xa876('0xd6')](_0xa876('0x220'),_0x3c14d2));}}})[_0xa876('0xb6')](loggerGetContactDialer(_0xa876('0x221'),_0x3c14d2,0x1));emitVoiceQueueSummary(_0x3c14d2);};Dialer['prototype'][_0xa876('0x1f1')]=function(_0x1ce2d0,_0x4f9d5f,_0x316047,_0x376ca4,_0x37c2f9,_0x8dc6d3){loggerPredictive[_0xa876('0x85')](_0xa876('0x222'));loggerPredictive[_0xa876('0x85')](_0xa876('0x223'),_0x1ce2d0);loggerPredictive[_0xa876('0x85')](_0xa876('0x224'),_0x4f9d5f);loggerPredictive['info'](_0xa876('0x225'),_0x316047);loggerPredictive[_0xa876('0x85')]('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',_0x376ca4);loggerPredictive[_0xa876('0x85')](_0xa876('0x226'),_0x37c2f9);loggerPredictive[_0xa876('0x85')]('---------------------------');return new Promise(function(_0x2b6cb9,_0x51261e){if(_0x1ce2d0<=0x0||isNaN(_0x1ce2d0)){return _0x51261e(msgResponse(_0xa876('0x227'),_0xa876('0x1aa'),_0xa876('0x228')+_0x1ce2d0));}if(_0x316047<=0x0||isNaN(_0x316047)){return _0x51261e(msgResponse(_0xa876('0x227'),_0xa876('0x1aa'),'Ts\x20=\x20'+_0x316047));}if(_0x376ca4<=0x0||isNaN(_0x376ca4)){return _0x51261e(msgResponse(_0xa876('0x227'),'Error',_0xa876('0x229')+_0x376ca4));}if(_0x4f9d5f<=0x0||isNaN(_0x4f9d5f)){return _0x51261e(msgResponse(_0xa876('0x227'),_0xa876('0x1aa'),_0xa876('0x22a')+_0x4f9d5f));}if(_0x37c2f9<=0x0||isNaN(_0x37c2f9)){return _0x51261e(msgResponse(_0xa876('0x227'),'Error','Amax\x20=\x20'+_0x37c2f9));}_0x8dc6d3=_0x8dc6d3||0x0;var _0x5a36ec=0x1/_0x316047;var _0x13594c=0x0;var _0x1dd071=0x0;var _0x319b05=0x0;var _0x1c1b23=0x0;for(var _0xd0dc1f=0x0;_0x319b05<_0x37c2f9;_0xd0dc1f+=0x1){_0x1dd071=_0xd0dc1f/_0x4f9d5f;_0x13594c=(_0x376ca4*_0x1dd071+_0x8dc6d3)/_0x5a36ec;_0x319b05=erlangb(_0x13594c,_0x1ce2d0);_0x1c1b23=_0x13594c/_0x1ce2d0*(0x1-erlangb(_0x13594c,_0x1ce2d0));}return _0x2b6cb9({'erlangCalls':_0xd0dc1f,'erlangCallToSecond':_0x4f9d5f/_0xd0dc1f,'erlangAbandonmentRate':_0x319b05,'erlangBusyFactor':_0x1c1b23});});};Dialer[_0xa876('0x1a')][_0xa876('0x1f3')]=function(_0x4285a5,_0x49c69e,_0x224c0c,_0x422c68,_0x4249c6,_0x10d419){loggerPredictive[_0xa876('0x85')](_0xa876('0x22b'));loggerPredictive['info'](_0xa876('0x223'),_0x4285a5);loggerPredictive[_0xa876('0x85')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49c69e);loggerPredictive[_0xa876('0x85')]('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',_0x224c0c);loggerPredictive[_0xa876('0x85')](_0xa876('0x22c'),_0x422c68);loggerPredictive['info'](_0xa876('0x22d'),_0x4249c6);loggerPredictive[_0xa876('0x85')](_0xa876('0x8c'));return new Promise(function(_0x50d9d5,_0x2d75eb){if(_0x4285a5<=0x0||isNaN(_0x4285a5)){return _0x2d75eb(msgResponse(_0xa876('0x22e'),_0xa876('0x1aa'),_0xa876('0x228')+_0x4285a5));}if(_0x224c0c<=0x0||isNaN(_0x224c0c)){return _0x2d75eb(msgResponse(_0xa876('0x22e'),_0xa876('0x1aa'),_0xa876('0x22f')+_0x224c0c));}if(_0x422c68<=0x0||isNaN(_0x422c68)){return _0x2d75eb(msgResponse(_0xa876('0x22e'),'Error',_0xa876('0x229')+_0x422c68));}if(_0x49c69e<=0x0||isNaN(_0x49c69e)){return _0x2d75eb(msgResponse(_0xa876('0x22e'),_0xa876('0x1aa'),_0xa876('0x22a')+_0x49c69e));}if(_0x4249c6<=0x0||isNaN(_0x4249c6)){return _0x2d75eb(msgResponse('[busyFactor]',_0xa876('0x1aa'),_0xa876('0x230')+_0x4249c6));}_0x10d419=_0x10d419||0x0;var _0x39718b=0x1/_0x224c0c;var _0x41e431=0x0;var _0x13e8df=0x0;var _0x1e353a=0x0;var _0x3d6566=0x0;for(var _0x5cda2f=0x0;_0x3d6566<_0x4249c6;_0x5cda2f+=0x1){_0x13e8df=_0x5cda2f/_0x49c69e;_0x41e431=(_0x422c68*_0x13e8df+_0x10d419)/_0x39718b;_0x1e353a=erlangb(_0x41e431,_0x4285a5);_0x3d6566=_0x41e431/_0x4285a5*(0x1-erlangb(_0x41e431,_0x4285a5));}return _0x50d9d5({'erlangCalls':_0x5cda2f,'erlangCallToSecond':_0x49c69e/_0x5cda2f,'erlangAbandonmentRate':_0x1e353a,'erlangBusyFactor':_0x3d6566});});};module['exports']=Dialer; \ No newline at end of file +var _0xc4c4=['VoiceQueueId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','voiceQueue','additional','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','paused','stateinterface','queueBooked','push','merge','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','dialPowerLevel','handlePower','method\x20not\x20recognized','checkPreviewRecallReminder','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialMethod','dialGlobalInterval','dialTimezone','[syncQueueSummary]','filter','online','map','Agent','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','SIP/%s/%s%s','dialPrefix','substring','dialCutDigit','trim','[originateError]:\x20%s','[originate][error]','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','erlangAbandonmentRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','maxNumberOriginate','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','dialLimitQueue','not_inuse','emptyContact','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','Contact.phone','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','type','outbound','strategy','answered','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','voice_queue:save','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','error','inspect','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','statedesc','starttime','[uniqueid]','actions','[actions]','clearZombieChannels','undefined','enqueue','Action','status','channel','catch','No\x20such\x20channel','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','UserId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','syncVarSet','isNil','variable','amdstatus','exten','xcally-motion-dialer','value','state','membername','AMD','custom:amd','buildObj','amd','dialAMDActive','MACHINE','Machine','countmachineretry','countglobal','emit','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','HANGUP','uniqueid','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','countagentrejectretry','reason19\x20machine....'];(function(_0x5496ff,_0x104d17){var _0x36881c=function(_0x395a82){while(--_0x395a82){_0x5496ff['push'](_0x5496ff['shift']());}};_0x36881c(++_0x104d17);}(_0xc4c4,0x11c));var _0x4c4c=function(_0x34311c,_0x52a317){_0x34311c=_0x34311c-0x0;var _0x4b8b35=_0xc4c4[_0x34311c];return _0x4b8b35;};'use strict';var util=require(_0x4c4c('0x0'));var _=require(_0x4c4c('0x1'));var uuid=require(_0x4c4c('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x4c4c('0x3'));var Redis=require(_0x4c4c('0x4'));var ut=require(_0x4c4c('0x5'));var config=require(_0x4c4c('0x6'));var logger=require(_0x4c4c('0x7'))('dialer');var loggerBooked=require(_0x4c4c('0x7'))(_0x4c4c('0x8'));var loggerPredictive=require(_0x4c4c('0x7'))(_0x4c4c('0x9'));var loggerPredictiveCalls=require(_0x4c4c('0x7'))(_0x4c4c('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x4c4c('0xb'));var ami=require(_0x4c4c('0xc'));config['redis']=_[_0x4c4c('0xd')](config['redis'],{'host':_0x4c4c('0xe'),'port':0x18eb});var io=require(_0x4c4c('0xf'))(new Redis(config[_0x4c4c('0x10')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x4c4c('0x11'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x4c4c('0x12'));var voiceQueueRt=require(_0x4c4c('0x13'));var RpcSetting=require(_0x4c4c('0x14'));var Action=require(_0x4c4c('0x15'));var History=require(_0x4c4c('0x16'));var Final=require(_0x4c4c('0x17'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x4c4c('0x18'));var ipAgi=process[_0x4c4c('0x19')][_0x4c4c('0x1a')]||_0x4c4c('0x1b');var strategy={'rrmemory':_0x4c4c('0x1c'),'roundrobin':_0x4c4c('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4c4c('0x1e')]['enqueue']=function(_0x24ccbc){this[_0x4c4c('0x1f')]=this[_0x4c4c('0x1f')]?this['tail'][_0x4c4c('0x20')](_0x24ccbc):_0x24ccbc();};function Dialer(_0x5522b6,_0x6b67fa){this[_0x4c4c('0x21')]=new Sequence();this['preview']=_0x6b67fa;this[_0x4c4c('0x22')]=_0x5522b6[_0x4c4c('0x22')];this[_0x4c4c('0x23')]=_0x5522b6[_0x4c4c('0x23')];this[_0x4c4c('0x24')]=_0x5522b6[_0x4c4c('0x24')];this[_0x4c4c('0x25')]=_0x5522b6[_0x4c4c('0x25')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this[_0x4c4c('0x26')]={};this['actions']={};this[_0x4c4c('0x27')]={};this[_0x4c4c('0x28')]={};this[_0x4c4c('0x29')]={};this[_0x4c4c('0x2a')]={};this[_0x4c4c('0x2b')]={};this[_0x4c4c('0x2c')]={};this['queueBooked']={};this[_0x4c4c('0x2d')]={};ami['on'](_0x4c4c('0x2e'),this['syncAgentConnect'][_0x4c4c('0x2f')](this));ami['on'](_0x4c4c('0x30'),this['syncQueueCallerAbandon'][_0x4c4c('0x2f')](this));ami['on'](_0x4c4c('0x31'),this[_0x4c4c('0x32')][_0x4c4c('0x2f')](this));ami['on']('agentcomplete',this[_0x4c4c('0x33')][_0x4c4c('0x2f')](this));ami['on'](_0x4c4c('0x34'),this[_0x4c4c('0xb')]['bind'](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on']('hangup',this[_0x4c4c('0x35')][_0x4c4c('0x2f')](this));ami['on'](_0x4c4c('0x36'),this[_0x4c4c('0x37')][_0x4c4c('0x2f')](this));ami['on'](_0x4c4c('0x38'),this['syncVarSet'][_0x4c4c('0x2f')](this));ami['on'](_0x4c4c('0x39'),this['syncQueueMember'][_0x4c4c('0x2f')](this));ami['on'](_0x4c4c('0x3a'),this[_0x4c4c('0x3b')][_0x4c4c('0x2f')](this));this['loopCampaigns']();this[_0x4c4c('0x3c')]();RpcSetting[_0x4c4c('0x3d')]()[_0x4c4c('0x3e')](function(_0x282398){previewRecallmeReminderInterval=_0x282398[_0x4c4c('0x3f')];});}function isNotNull(_0x2ab8cc){return _0x2ab8cc!==null&&!_[_0x4c4c('0x40')](_0x2ab8cc);}function checkIsLoggedIn(_0x5bed83,_0x493166){return function(){if(_0x493166<=0x0){_0x5bed83[_0x4c4c('0x41')]=_0x4c4c('0x42');throw _0x5bed83[_0x4c4c('0x43')]+_0x4c4c('0x44');}};}function isActive(_0x180a0a){return _0x180a0a;}function checkIsActive(_0x306b34,_0x2b5365){return function(){if(!isActive(_0x2b5365)){_0x306b34[_0x4c4c('0x41')]=_0x4c4c('0x45');throw _0x306b34[_0x4c4c('0x43')]+_0x4c4c('0x46');}};}function checkInterval(_0x5a1594){return function(){if(!isNotNull(_0x5a1594[_0x4c4c('0x47')])){_0x5a1594[_0x4c4c('0x41')]=_0x4c4c('0x48');throw _0x5a1594[_0x4c4c('0x43')]+_0x4c4c('0x49');}if(!isNotNull(_0x5a1594[_0x4c4c('0x47')][_0x4c4c('0x4a')])){_0x5a1594[_0x4c4c('0x41')]=_0x4c4c('0x48');throw _0x5a1594[_0x4c4c('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x4c4c('0x4b')](_0x5a1594[_0x4c4c('0x47')][_0x4c4c('0x4a')]))){_0x5a1594['message']=_0x4c4c('0x48');throw _0x5a1594[_0x4c4c('0x43')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x2f0aa9,_0x5c2463,_0x1626aa){return{'action':_0x2f0aa9,'response':_0x5c2463,'message':_0x1626aa,'stack':_0x1626aa};}function myreject(_0x39fb4d){return function(_0x41df7f){return _0x39fb4d(msgResponse(_0x4c4c('0x4c'),_0x4c4c('0x4d'),JSON[_0x4c4c('0x4e')](_0x41df7f)));};}function getSeconds(_0xe0c7fb,_0xda41e6){var _0x1844af=moment(_0xe0c7fb)[_0x4c4c('0x4f')](0x0);var _0x9a48d6=moment(_0xda41e6)[_0x4c4c('0x4f')](0x0);return _0x1844af[_0x4c4c('0x50')](_0x9a48d6,'seconds');}function emit(_0x3f4c71,_0x2cb788,_0x3ea043){io['to'](_0x3f4c71)['emit'](_0x2cb788,_0x3ea043);}function emitVoiceQueueSummary(_0x792d25){if(_0x792d25[_0x4c4c('0x51')]===_0x4c4c('0x52')){var _0x5ea522={'id':_0x792d25['id'],'name':_0x792d25[_0x4c4c('0x43')],'strategy':_0x792d25[_0x4c4c('0x53')],'answered':_0x792d25[_0x4c4c('0x54')],'available':_0x792d25['available'],'loggedIn':_0x792d25[_0x4c4c('0x55')],'pTalking':_0x792d25[_0x4c4c('0x56')],'sumBillable':_0x792d25['sumBillable'],'sumDuration':_0x792d25[_0x4c4c('0x57')],'sumHoldTime':_0x792d25[_0x4c4c('0x58')]||0x0,'talking':_0x792d25[_0x4c4c('0x59')],'total':_0x792d25[_0x4c4c('0x5a')],'type':_0x792d25[_0x4c4c('0x51')],'unmanaged':_0x792d25[_0x4c4c('0x5b')],'abandoned':_0x792d25[_0x4c4c('0x5c')],'waiting':_0x792d25[_0x4c4c('0x5d')],'loggedInDb':_0x792d25['loggedInDb'],'dialActive':_0x792d25[_0x4c4c('0x5e')],'dialMethod':_0x792d25['dialMethod'],'dialOriginateCallerIdName':_0x792d25[_0x4c4c('0x5f')],'dialOriginateCallerIdNumber':_0x792d25[_0x4c4c('0x60')],'dialOriginateTimeout':_0x792d25['dialOriginateTimeout'],'dialPrefix':_0x792d25['dialPrefix'],'outboundAnswerAgiCallsDay':_0x792d25[_0x4c4c('0x61')],'outboundAnswerCallsDay':_0x792d25[_0x4c4c('0x62')],'outboundBlacklistCallsDay':_0x792d25[_0x4c4c('0x63')],'outboundBusyCallsDay':_0x792d25[_0x4c4c('0x64')],'outboundCongestionCallsDay':_0x792d25[_0x4c4c('0x65')],'outboundDropCallsDayACS':_0x792d25['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x792d25[_0x4c4c('0x66')],'outboundDropCallsDayTimeout':_0x792d25[_0x4c4c('0x67')],'outboundNoAnswerCallsDay':_0x792d25['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x792d25['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x792d25[_0x4c4c('0x68')],'outboundReCallsDay':_0x792d25[_0x4c4c('0x69')],'outboundRejectCallsDay':_0x792d25[_0x4c4c('0x6a')],'outboundUnknownCallsDay':_0x792d25[_0x4c4c('0x6b')],'predictiveIntervalAnsweredCalls':_0x792d25[_0x4c4c('0x6c')],'predictiveIntervalAvgHoldtime':_0x792d25[_0x4c4c('0x6d')],'predictiveIntervalAvgTalktime':_0x792d25[_0x4c4c('0x6e')],'predictiveIntervalDroppedCallsCallersExit':_0x792d25[_0x4c4c('0x6f')],'predictiveIntervalDroppedCallsTimeout':_0x792d25[_0x4c4c('0x70')],'predictiveIntervalErlangCalls':_0x792d25[_0x4c4c('0x71')],'predictiveIntervalErlangCallsDroppedCalls':_0x792d25[_0x4c4c('0x72')],'predictiveIntervalHitRate':_0x792d25[_0x4c4c('0x73')],'predictiveIntervalMultiplicativeFactor':_0x792d25['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x792d25[_0x4c4c('0x74')],'predictiveIntervalAvailable':_0x792d25[_0x4c4c('0x75')],'predictiveIntervalTotalCalls':_0x792d25[_0x4c4c('0x76')],'message':_0x792d25[_0x4c4c('0x41')],'originated':_0x792d25[_0x4c4c('0x77')],'erlangCalls':_0x792d25['erlangCalls'],'erlangCallToSecond':_0x792d25[_0x4c4c('0x78')],'erlangAbandonmentRate':_0x792d25['erlangAbandonmentRate'],'erlangBusyFactor':_0x792d25[_0x4c4c('0x79')],'startPredictive':_0x792d25[_0x4c4c('0x2a')],'startProgressive':_0x792d25[_0x4c4c('0x2b')]};if(_0x792d25[_0x4c4c('0x7a')]){_0x5ea522['Trunk']={'id':_0x792d25[_0x4c4c('0x7a')]['id'],'name':_0x792d25[_0x4c4c('0x7a')][_0x4c4c('0x43')],'active':_0x792d25[_0x4c4c('0x7a')][_0x4c4c('0x7b')],'callerid':_0x792d25[_0x4c4c('0x7a')][_0x4c4c('0x7c')]};}if(_0x792d25[_0x4c4c('0x47')]){_0x5ea522[_0x4c4c('0x47')]={'id':_0x792d25[_0x4c4c('0x47')]['id'],'name':_0x792d25[_0x4c4c('0x47')][_0x4c4c('0x43')]};}var _0x22b5fc=md5(JSON['stringify'](_0x5ea522));if(_0x792d25[_0x4c4c('0x3')]!==_0x22b5fc){_0x792d25[_0x4c4c('0x3')]=_0x22b5fc;emit(util['format']('voice:queue:%s',_0x5ea522[_0x4c4c('0x43')]),_0x4c4c('0x7d'),_0x5ea522);}}}function emitCampaignSummary(_0x1e7968){if(_0x1e7968[_0x4c4c('0x51')]==='ivr'){emit(util[_0x4c4c('0x7e')](_0x4c4c('0x7f'),_0x1e7968[_0x4c4c('0x43')]),_0x4c4c('0x80'),_0x1e7968);}}function checkGetDataPredictive(_0x256ee6){if(isNotNull(_0x256ee6)&&!_[_0x4c4c('0x4b')](_0x256ee6)){loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x82'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x256ee6['predictiveIntervalTotalCalls']);loggerPredictive[_0x4c4c('0x81')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x256ee6[_0x4c4c('0x6c')]);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x83'),_0x256ee6[_0x4c4c('0x70')]);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x84'),_0x256ee6[_0x4c4c('0x6f')]);loggerPredictive['info'](_0x4c4c('0x85'),_0x256ee6[_0x4c4c('0x6d')]);loggerPredictive['info'](_0x4c4c('0x86'),_0x256ee6[_0x4c4c('0x6e')]);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x87'));if(_0x256ee6[_0x4c4c('0x76')]>0x0){if(!_[_0x4c4c('0x40')](_0x256ee6[_0x4c4c('0x6e')])&&_0x256ee6[_0x4c4c('0x6e')]>0x0){return!![];}loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x88'));if(!_[_0x4c4c('0x40')](_0x256ee6[_0x4c4c('0x6d')])&&_0x256ee6[_0x4c4c('0x6d')]>0x0){return!![];}loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x89'));}else{loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x8a'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3e0775){return function(_0x47d907){loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x8b'));loggerPredictive['info'](_0x4c4c('0x8c'),_0x47d907[_0x4c4c('0x8d')]);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x8e'),_0x47d907['erlangCallToSecond']);loggerPredictive['info'](_0x4c4c('0x8f'),_0x47d907['erlangAbandonmentRate']);loggerPredictive[_0x4c4c('0x81')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x47d907['erlangBusyFactor']);loggerPredictive['info'](_0x4c4c('0x8f'),_0x47d907['erlangAbandonmentRate']);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x87'));_['merge'](_0x3e0775,_0x47d907);};}function getDiff(_0x4e8827){var _0x5a749=moment()[_0x4c4c('0x4f')](0x0);var _0x13c299=moment(_0x4e8827)[_0x4c4c('0x4f')](0x0);return _0x5a749[_0x4c4c('0x50')](_0x13c299,_0x4c4c('0x90'));}function ifInterval(_0x5f16cb,_0x474819){if(_[_0x4c4c('0x40')](_0x474819)){return![];}return getDiff(_0x474819)<_0x5f16cb*0x3c;}function freeVariablesPredictive(_0x29ee3e){if(isNotNull(_0x29ee3e)){if(!_[_0x4c4c('0x40')](_0x29ee3e['startProgressive'])){_0x29ee3e[_0x4c4c('0x2b')]=undefined;loggerPredictive[_0x4c4c('0x81')](_0x29ee3e[_0x4c4c('0x43')],_0x4c4c('0x91'));}if(!_[_0x4c4c('0x40')](_0x29ee3e[_0x4c4c('0x2a')])){_0x29ee3e['startPredictive']=undefined;loggerPredictive[_0x4c4c('0x81')](_0x29ee3e['name'],_0x4c4c('0x92'));}if(!_[_0x4c4c('0x40')](_0x29ee3e[_0x4c4c('0x93')])){clearInterval(_0x29ee3e[_0x4c4c('0x93')]);_0x29ee3e[_0x4c4c('0x93')]=undefined;loggerPredictive[_0x4c4c('0x81')](_0x29ee3e[_0x4c4c('0x43')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x42bc32,_0x1bbc92){if(_0x1bbc92===0x0){return 0x0;}var _0x4abd42=0x1;for(var _0x11d006=0x1;_0x11d006<=_0x1bbc92;_0x11d006+=0x1){_0x4abd42=0x1+_0x4abd42*_0x11d006/_0x42bc32;}return 0x1/_0x4abd42;}function isVoiceQueueOutbound(_0x185540){return _0x185540==='outbound';}function isNotPreview(_0x2e5027){return _0x2e5027!==_0x4c4c('0x94');}function isCampaignIvr(_0x3827b2){return _0x3827b2==='ivr';}function getCallerId(_0x4984d0,_0x4f9a34,_0x4bd8a1){if(!_[_0x4c4c('0x40')](_0x4bd8a1)&&typeof _0x4bd8a1===_0x4c4c('0x95')&&!_[_0x4c4c('0x4b')](_0x4bd8a1)){if(!_[_0x4c4c('0x40')](_0x4f9a34)&&typeof _0x4f9a34==='string'&&!_['isEmpty'](_0x4f9a34)){return util[_0x4c4c('0x7e')](_0x4c4c('0x96'),_0x4f9a34,_0x4bd8a1);}return util[_0x4c4c('0x7e')](_0x4c4c('0x96'),_0x4bd8a1,_0x4bd8a1);}if(!_[_0x4c4c('0x40')](_0x4984d0)&&typeof _0x4984d0===_0x4c4c('0x95')&&!_['isEmpty'](_0x4984d0)){return _0x4984d0;}return _0x4c4c('0x97');}function loggerCatchQueueSummary(_0x11505c,_0x160256){return function(_0x35d24f){freeVariablesPredictive(_0x160256);emitVoiceQueueSummary(_0x160256);emitCampaignSummary(_0x160256);loggerSyncQueueSummary[_0x4c4c('0x98')](_0x11505c,util['inspect'](_0x35d24f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5bfac3,_0x15e5e9){return function(_0x31fb95){loggerPredictive['error'](_0x15e5e9['name'],_0x5bfac3);loggerPredictive['error'](_0x31fb95['stack']);freeVariablesPredictive(_0x15e5e9);};}function loggerCatch(_0x98e9f6){return function(_0x26035a){logger[_0x4c4c('0x99')](_0x98e9f6,util[_0x4c4c('0x9a')](_0x26035a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x11db32){return _0x11db32&&!_[_0x4c4c('0x40')](_0x11db32)&&_0x11db32[_0x4c4c('0x9b')]>0x0;}function decremetOriginate(_0x5c33e9){if(!_[_0x4c4c('0x40')](_0x5c33e9)&&_0x5c33e9!==null){if(typeof _0x5c33e9[_0x4c4c('0x77')]!=='undefined'){if(_0x5c33e9[_0x4c4c('0x77')]>0x0){_0x5c33e9[_0x4c4c('0x77')]-=0x1;}else{logger[_0x4c4c('0x99')](_0x4c4c('0x9c'));}}}else{logger[_0x4c4c('0x99')](_0x4c4c('0x9d'));}}function checkContactLowerLimitOriginate(_0x3ca964,_0x350f6a,_0xb4470c){if(_0x350f6a>_0xb4470c){for(var _0x5c2293=0x0;_0x5c2293<_0x350f6a-_0xb4470c;_0x5c2293+=0x1){decremetOriginate(_0x3ca964);}}}function loggerGetContactDialer(_0x3718cc,_0x5bbe0f,_0x1dac71){return function(_0x57a8a2){checkContactLowerLimitOriginate(_0x5bbe0f,_0x1dac71,0x0);logger[_0x4c4c('0x99')](_0x3718cc,util[_0x4c4c('0x9a')](_0x57a8a2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x55f9fa){return function(_0x1c422c){if(isNotNull(_0x1c422c)&&isNotNull(_0x1c422c[0x0])){if(_0x1c422c[0x0]['contactsRescheduled']>0x0){_0x55f9fa[_0x4c4c('0x41')]='RESCHEDULED_CONTACTS';logger[_0x4c4c('0x81')](_0x4c4c('0x9e')+_0x55f9fa[_0x4c4c('0x43')],_0x1c422c[0x0][_0x4c4c('0x9f')],'contacts');}else{_0x55f9fa[_0x4c4c('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4c4c('0x81')](_0x4c4c('0xa0')+_0x55f9fa[_0x4c4c('0x43')]);}}};}function notSendMessagesQueue(_0x36a0b9){if(_0x36a0b9[_0x4c4c('0xa1')]){freeVariablesPredictive(_0x36a0b9);if(_0x36a0b9['originated']===0x0&&_0x36a0b9[_0x4c4c('0x59')]===0x0&&_0x36a0b9['waiting']===0x0&&(_0x36a0b9[_0x4c4c('0x56')]||0x0)===0x0){_0x36a0b9['sendMessageOneNotActive']=![];_0x36a0b9[_0x4c4c('0xa2')]=0x0;_0x36a0b9[_0x4c4c('0x41')]=_0x4c4c('0x45');loggerSyncQueueSummary[_0x4c4c('0x98')](_0x4c4c('0xa3'),_0x36a0b9[_0x4c4c('0x43')],_0x4c4c('0xa4'));}else{_0x36a0b9[_0x4c4c('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x4c4c('0x98')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x36a0b9[_0x4c4c('0x43')],'is\x20disactive');}emitVoiceQueueSummary(_0x36a0b9);}}function notSendMessagesCampaign(_0x57715b){if(_0x57715b[_0x4c4c('0xa1')]){if(_0x57715b[_0x4c4c('0x77')]===0x0){_0x57715b[_0x4c4c('0xa1')]=![];_0x57715b[_0x4c4c('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x4c4c('0x98')](_0x4c4c('0xa5'),_0x57715b[_0x4c4c('0x43')],_0x4c4c('0xa4'));}else{_0x57715b[_0x4c4c('0x41')]=_0x4c4c('0xa6');loggerSyncQueueSummary[_0x4c4c('0x98')](_0x4c4c('0xa5'),_0x57715b[_0x4c4c('0x43')],_0x4c4c('0xa7'));}emitCampaignSummary(_0x57715b);}}function createObjHistory(_0x1f53e3,_0x5774e1,_0x1b4840,_0x2a02e9,_0x170579){_0x1f53e3[_0x4c4c('0x41')]=_0x1b4840;var _0x5b71dd=new Action(_0x1f53e3,_0x5774e1);var _0x23415b=new History(_0x5b71dd);_0x23415b['state']=_0x2a02e9;_0x23415b[_0x4c4c('0xa8')]=_0x170579;_0x23415b['endtime']=_0x5b71dd[_0x4c4c('0xa9')];return _0x23415b;}Dialer[_0x4c4c('0x1e')][_0x4c4c('0x3c')]=function(){var _0x5a4267=this;setInterval(function(){_0x5a4267['clearZombieChannels'](_0x5a4267[_0x4c4c('0x28')],_0x4c4c('0xaa'));_0x5a4267['clearZombieChannels'](_0x5a4267[_0x4c4c('0xab')],_0x4c4c('0xac'));},0x32c8);};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xad')]=function(_0x3bf697,_0x4f2e96){var _0x546a27=this;for(var _0x2ea0eb in _0x3bf697){if(typeof _0x3bf697[_0x2ea0eb]!==_0x4c4c('0xae')){this['sequence'][_0x4c4c('0xaf')](function(){if(!_['isNil'](_0x3bf697[_0x2ea0eb])){return ami[_0x4c4c('0xb0')]({'action':_0x4c4c('0xb1'),'channel':_0x3bf697[_0x2ea0eb][_0x4c4c('0xb2')]})[_0x4c4c('0xb3')](function(_0x545cc1){if(_0x545cc1[_0x4c4c('0x41')]===_0x4c4c('0xb4')){setTimeout(function(){if(_0x3bf697[_0x2ea0eb]&&_0x3bf697[_0x2ea0eb][_0x4c4c('0x51')]!==_0x4c4c('0xb5')){_0x546a27[_0x4c4c('0xb6')](_0x546a27[_0x4c4c('0x22')][_0x3bf697[_0x2ea0eb][_0x4c4c('0xb7')]]);logger[_0x4c4c('0x99')](_0x4c4c('0xb8'),_0x4f2e96,_0x2ea0eb,_0x3bf697[_0x2ea0eb][_0x4c4c('0xb7')]);delete _0x3bf697[_0x2ea0eb];}if(_0x3bf697[_0x2ea0eb]&&_0x3bf697[_0x2ea0eb][_0x4c4c('0x51')]===_0x4c4c('0xb5')){_0x546a27[_0x4c4c('0xb6')](_0x546a27[_0x4c4c('0x23')][_0x3bf697[_0x2ea0eb][_0x4c4c('0xb7')]]);logger[_0x4c4c('0x99')](_0x4c4c('0xb9'),_0x4f2e96,_0x2ea0eb,_0x3bf697[_0x2ea0eb]['queue']);delete _0x3bf697[_0x2ea0eb];}},0x2328);}});}});}}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xba')]=function(_0x4af4bd){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopper[_0x4c4c('0xba')](_0x4af4bd))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xbc')));};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xbd')]=function(_0x471851){return Promise['resolve']()[_0x4c4c('0x3e')](cmHopperBlack['checkIsBlackList'](_0x471851))['catch'](loggerCatch(_0x4c4c('0xbe')));};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xbf')]=function(_0x22b95c,_0xd31e55,_0x3e2fde){return Promise['resolve']()[_0x4c4c('0x3e')](cmHopperAdditionalPhone[_0x4c4c('0xbf')](_0x22b95c,_0xd31e55,_0x3e2fde))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xc0')));};Dialer['prototype']['swapAdditionalPhones']=function(_0xcf816c,_0x19cc4c,_0x3d0742){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopperAdditionalPhone[_0x4c4c('0xc1')](_0xcf816c,_0x19cc4c,_0x3d0742))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xc2')));};Dialer[_0x4c4c('0x1e')]['checkIsBlackListIvr']=function(_0x39e69f){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopperBlack[_0x4c4c('0xc3')](_0x39e69f))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xc4')));};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xc5')]=function(_0x2cda96){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopperHistory[_0x4c4c('0xc6')](_0x2cda96))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xc7')));};Dialer['prototype'][_0x4c4c('0xc8')]=function(_0x4382b7){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopper['rescheduleContact'](_0x4382b7))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xc9')));};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xca')]=function(_0x5dc72c,_0x6d3504,_0x1e1376){return Promise[_0x4c4c('0xbb')]()['then'](cmHopper[_0x4c4c('0xca')](_0x5dc72c,_0x6d3504,_0x1e1376))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xcb')));};Dialer['prototype']['getContactDialer']=function(_0x23a89f,_0x590938,_0x492009,_0xf1c7c0,_0x27f5c8){return Promise[_0x4c4c('0xbb')]()['then'](cmHopper['getContactDialer'](_0x23a89f,_0x590938,_0x492009,_0xf1c7c0))[_0x4c4c('0xb3')](function(_0x324be0){_0x27f5c8['temp']-=_0x492009;_0x27f5c8[_0x4c4c('0xcc')]=_0x27f5c8[_0x4c4c('0xcc')]>0x0?_0x27f5c8[_0x4c4c('0xcc')]:0x0;loggerCatch(_0x4c4c('0xcd'))(_0x324be0);});};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xce')]=function(_0x2424bb,_0x7c66d8,_0x380df5,_0x2f6c5a){return Promise['resolve']()['then'](cmHopper[_0x4c4c('0xce')](_0x2424bb,_0x7c66d8,_0x380df5))['catch'](function(_0x3cc4f3){_0x2f6c5a['temp']-=_0x7c66d8;_0x2f6c5a[_0x4c4c('0xcc')]=_0x2f6c5a[_0x4c4c('0xcc')]>0x0?_0x2f6c5a['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x3cc4f3);});};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xcf')]=function(_0x1c7460){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](voiceQueueRt[_0x4c4c('0xcf')](_0x1c7460))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xd0')]=function(_0x1371fc){return Promise['resolve']()[_0x4c4c('0x3e')](cmHopper[_0x4c4c('0xd0')](_0x1371fc))[_0x4c4c('0xb3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xd1')]=function(_0x60948e){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopperHistory[_0x4c4c('0xd1')](_0x60948e))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xd2')));};Dialer['prototype'][_0x4c4c('0xb6')]=function(_0x5d98f0){if(!_['isUndefined'](_0x5d98f0)&&_0x5d98f0!==null){if(typeof _0x5d98f0[_0x4c4c('0x77')]!==_0x4c4c('0xae')){if(_0x5d98f0[_0x4c4c('0x77')]>0x0){_0x5d98f0['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4c4c('0x99')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x4c4c('0xd3')]=function(_0xf8b00b,_0x1ba646){var _0x3e6d73=this;return function(_0x5a51ab){_0x3e6d73[_0x4c4c('0xb6')](_0x1ba646);logger[_0x4c4c('0x99')](_0xf8b00b,util['inspect'](_0x5a51ab,{'showHidden':![],'depth':null}));};};Dialer[_0x4c4c('0x1e')]['emptyContact']=function(_0x3de51b,_0x2c8f37,_0x5c06ba){var _0x2cc412={'state':0x19,'statedesc':_0x4c4c('0xd4')};this['updateOriginated'](_0x2c8f37);this[_0x4c4c('0xd5')](_['merge'](_0x2cc412,_[_0x4c4c('0xd6')](_0x5c06ba,[_0x4c4c('0xd7'),_0x4c4c('0xd8'),_0x4c4c('0xd9'),'VoiceQueueId','CampaignId'])),_0x4c4c('0xda'),_0x4c4c('0xdb'));logger[_0x4c4c('0x99')](_0x3de51b);};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xdc')]=function(_0x4f39c6){return _0x4f39c6===_0x4c4c('0xdd');};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xde')]=function(_0x43d555){return!_[_0x4c4c('0x40')](_0x43d555)&&_0x43d555&&!_[_0x4c4c('0x40')](_0x43d555[_0x4c4c('0x43')])&&!_[_0x4c4c('0x40')](_0x43d555[_0x4c4c('0x7b')])&&_0x43d555['active']&&(this[_0x4c4c('0x25')][util[_0x4c4c('0x7e')]('SIP/%s',_0x43d555['name'])][_0x4c4c('0xb1')]===_0x4c4c('0xdf')||this[_0x4c4c('0x25')][util['format'](_0x4c4c('0xe0'),_0x43d555[_0x4c4c('0x43')])][_0x4c4c('0xb1')]===_0x4c4c('0xe1'));};Dialer[_0x4c4c('0x1e')]['saveInDb']=function(_0x10c672,_0x2d31ec,_0xb34385){this[_0x4c4c('0xd1')](_0x10c672)[_0x4c4c('0xb3')](loggerCatch(_0x2d31ec));this['moveContactManagedDialer'](_0x10c672)[_0x4c4c('0xb3')](loggerCatch(_0xb34385));};Dialer['prototype'][_0x4c4c('0xe2')]=function(_0x43de34){var _0x507bec=this;var _0xd50d2c=this['uniqueId'][_0x43de34['uniqueid']];var _0x4005bc;if(!_[_0x4c4c('0xe3')](_0x43de34)&&!_[_0x4c4c('0xe3')](_0x43de34[_0x4c4c('0xe4')])&&!_[_0x4c4c('0xe3')](_0x43de34[_0x4c4c('0xe4')][_0x4c4c('0xe5')])&&_0x43de34[_0x4c4c('0xe6')]===_0x4c4c('0xe7')&&_0xd50d2c){if(_0xd50d2c[_0x4c4c('0x51')]!==_0x4c4c('0xb5')&&this[_0x4c4c('0x22')][_0xd50d2c[_0x4c4c('0xb7')]]['dialAMDActive']&&_0x43de34[_0x4c4c('0xe8')]==='HANGUP'){delete this[_0x4c4c('0x28')][_0x43de34['uniqueid']];this[_0x4c4c('0xb6')](this[_0x4c4c('0x22')][_0xd50d2c['queue']]);this['voiceQueues'][_0xd50d2c[_0x4c4c('0xb7')]]['outboundAnswerCallsDay']+=0x1;this[_0x4c4c('0x22')][_0xd50d2c[_0x4c4c('0xb7')]][_0x4c4c('0x61')]+=0x1;_0x4005bc=new Hangup(_0xd50d2c,_0x43de34);_0x4005bc[_0x4c4c('0xe9')]=0x12;_0x4005bc['statedesc']='HangupInAMD';_0x4005bc[_0x4c4c('0xea')]=_0x4c4c('0xeb');ami['emit'](_0x4c4c('0xec'),ut[_0x4c4c('0xed')](_0x4005bc,_0x4c4c('0xee')));this[_0x4c4c('0xd5')](_0x4005bc,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0xd50d2c['type']!=='ivr'&&this['voiceQueues'][_0xd50d2c[_0x4c4c('0xb7')]][_0x4c4c('0xef')]&&_0x43de34['value']===_0x4c4c('0xf0')){return new Promise(function(_0x12e685,_0x22c2d3){delete _0x507bec[_0x4c4c('0x28')][_0x43de34['uniqueid']];_0x507bec[_0x4c4c('0xb6')](_0x507bec[_0x4c4c('0x22')][_0xd50d2c[_0x4c4c('0xb7')]]);_0x507bec[_0x4c4c('0x22')][_0xd50d2c['queue']][_0x4c4c('0x62')]+=0x1;_0x507bec['voiceQueues'][_0xd50d2c[_0x4c4c('0xb7')]][_0x4c4c('0x61')]+=0x1;var _0x44d83c=_0x507bec['voiceQueues'][_0xd50d2c[_0x4c4c('0xb7')]];var _0x2d00f2=new Hangup(_0xd50d2c,_0x43de34);_0x2d00f2['state']=0x13;_0x2d00f2[_0x4c4c('0xa8')]=_0x4c4c('0xf1');_0x2d00f2[_0x4c4c('0xea')]=_0x4c4c('0xeb');_0x2d00f2[_0x4c4c('0xf2')]+=0x1;_0x2d00f2[_0x4c4c('0xf3')]+=0x1;_0x2d00f2['amd']=!![];ami[_0x4c4c('0xf4')]('custom:amd',ut['buildObj'](_0x2d00f2,_0x4c4c('0xee')));_0x507bec[_0x4c4c('0xd1')](_0x2d00f2)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xf5')));if(_0x2d00f2[_0x4c4c('0xf6')]+_0x2d00f2['countcongestionretry']+_0x2d00f2[_0x4c4c('0xf7')]+_0x2d00f2[_0x4c4c('0xf8')]+_0x2d00f2[_0x4c4c('0xf9')]+_0x2d00f2[_0x4c4c('0xfa')]+_0x2d00f2[_0x4c4c('0xf2')]+_0x2d00f2['countagentrejectretry']>=_0x44d83c[_0x4c4c('0xfb')]){_0x507bec[_0x4c4c('0xfc')](_0x2d00f2,_0x12e685,_0x22c2d3,'reason19\x20machine....');}else{if(_0x2d00f2[_0x4c4c('0xf2')]>=_0x44d83c[_0x4c4c('0xfd')]){_0x507bec[_0x4c4c('0xfe')](_0x2d00f2,_0x12e685,_0x22c2d3,_0x4c4c('0xff'));}else{_0x507bec['rescheduleContact']({'active':![],'countmachineretry':_0x2d00f2[_0x4c4c('0xf2')],'scheduledat':moment()[_0x4c4c('0x100')](_0x44d83c[_0x4c4c('0x101')],_0x4c4c('0x102'))['format'](_0x4c4c('0x103')),'ContactId':_0x2d00f2[_0x4c4c('0xd7')],'ListId':_0x2d00f2[_0x4c4c('0xd8')],'VoiceQueueId':_0x2d00f2['VoiceQueueId']||undefined,'CampaignId':_0x2d00f2[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x105')));_0x12e685({'reschedule':0x1});}}});}if(_0xd50d2c[_0x4c4c('0x51')]==='ivr'&&this['campaigns'][_0xd50d2c['queue']][_0x4c4c('0xef')]&&_0x43de34['value']===_0x4c4c('0x106')){delete this[_0x4c4c('0x28')][_0x43de34[_0x4c4c('0x107')]];this['updateOriginated'](this[_0x4c4c('0x23')][_0xd50d2c['queue']]);_0x4005bc=new Hangup(_0xd50d2c,_0x43de34);_0x4005bc[_0x4c4c('0xe9')]=0x12;_0x4005bc[_0x4c4c('0xa8')]=_0x4c4c('0x108');_0x4005bc[_0x4c4c('0xea')]=_0x4c4c('0xeb');ami[_0x4c4c('0xf4')](_0x4c4c('0xec'),ut[_0x4c4c('0xed')](_0x4005bc,'amd'));this['saveInDb'](_0x4005bc,_0x4c4c('0x109'),_0x4c4c('0x10a'));}if(_0xd50d2c[_0x4c4c('0x51')]===_0x4c4c('0xb5')&&this[_0x4c4c('0x23')][_0xd50d2c[_0x4c4c('0xb7')]]['dialAMDActive']&&_0x43de34[_0x4c4c('0xe8')]==='MACHINE'){return new Promise(function(_0x42bdbb,_0x1b6839){delete _0x507bec[_0x4c4c('0x28')][_0x43de34['uniqueid']];_0x507bec[_0x4c4c('0xb6')](_0x507bec[_0x4c4c('0x23')][_0xd50d2c[_0x4c4c('0xb7')]]);_0x507bec[_0x4c4c('0x23')][_0xd50d2c[_0x4c4c('0xb7')]][_0x4c4c('0x62')]+=0x1;_0x507bec[_0x4c4c('0x23')][_0xd50d2c[_0x4c4c('0xb7')]][_0x4c4c('0x61')]+=0x1;var _0x75a90c=_0x507bec[_0x4c4c('0x23')][_0xd50d2c[_0x4c4c('0xb7')]];var _0x44105b=new Hangup(_0xd50d2c,_0x43de34);_0x44105b[_0x4c4c('0xe9')]=0x13;_0x44105b['statedesc']=_0x4c4c('0xf1');_0x44105b['membername']=_0x4c4c('0xeb');_0x44105b['countmachineretry']+=0x1;_0x44105b[_0x4c4c('0xf3')]+=0x1;_0x44105b[_0x4c4c('0xee')]=!![];ami[_0x4c4c('0xf4')](_0x4c4c('0xec'),ut[_0x4c4c('0xed')](_0x44105b,'amd'));_0x507bec[_0x4c4c('0xd1')](_0x44105b)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xf5')));if(_0x44105b[_0x4c4c('0xf6')]+_0x44105b[_0x4c4c('0x10b')]+_0x44105b[_0x4c4c('0xf7')]+_0x44105b['countnosuchnumberretry']+_0x44105b[_0x4c4c('0xf9')]+_0x44105b[_0x4c4c('0xfa')]+_0x44105b[_0x4c4c('0xf2')]+_0x44105b[_0x4c4c('0x10c')]>=_0x75a90c[_0x4c4c('0xfb')]){_0x507bec['stateGlobal'](_0x44105b,_0x42bdbb,_0x1b6839,_0x4c4c('0x10d'));}else{if(_0x44105b['countmachineretry']>=_0x75a90c[_0x4c4c('0xfd')]){_0x507bec['createStateFinal'](_0x44105b,_0x42bdbb,_0x1b6839,_0x4c4c('0xff'));}else{_0x507bec['rescheduleContact']({'active':![],'countmachineretry':_0x44105b[_0x4c4c('0xf2')],'scheduledat':moment()[_0x4c4c('0x100')](_0x75a90c[_0x4c4c('0x101')],_0x4c4c('0x102'))['format'](_0x4c4c('0x103')),'ContactId':_0x44105b[_0x4c4c('0xd7')],'ListId':_0x44105b[_0x4c4c('0xd8')],'VoiceQueueId':_0x44105b[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x44105b[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x105')));_0x42bdbb({'reschedule':0x1});}}});}}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x35')]=function(_0x2bfa43){var _0x471348=this['uniqueId'][_0x2bfa43[_0x4c4c('0x107')]];var _0x414055;if(_0x471348&&_0x471348[_0x4c4c('0x51')]===_0x4c4c('0xb5')){delete this['uniqueId'][_0x2bfa43['uniqueid']];this[_0x4c4c('0xb6')](this[_0x4c4c('0x23')][_0x471348['queue']]);this[_0x4c4c('0x23')][_0x471348[_0x4c4c('0xb7')]][_0x4c4c('0x10f')]+=0x1;_0x414055=new Hangup(_0x471348,_0x2bfa43);this[_0x4c4c('0xd1')](_0x414055)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x110')));this['moveContactManagedDialer'](_0x414055)['catch'](loggerCatch(_0x4c4c('0x111')));}if(_0x471348&&_0x471348[_0x4c4c('0x51')]!=='ivr'&&isNotNull(this[_0x4c4c('0x22')][_0x471348[_0x4c4c('0xb7')]][_0x4c4c('0x112')])){delete this[_0x4c4c('0x28')][_0x2bfa43['uniqueid']];this[_0x4c4c('0xb6')](this[_0x4c4c('0x22')][_0x471348[_0x4c4c('0xb7')]]);this[_0x4c4c('0x22')][_0x471348[_0x4c4c('0xb7')]][_0x4c4c('0x62')]+=0x1;this[_0x4c4c('0x22')][_0x471348[_0x4c4c('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;_0x414055=new Hangup(_0x471348,_0x2bfa43);_0x414055[_0x4c4c('0xe9')]=0x10;_0x414055[_0x4c4c('0xa8')]=_0x4c4c('0x113');_0x414055[_0x4c4c('0xea')]=_0x4c4c('0x114');this['createHistory'](_0x414055)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x110')));this[_0x4c4c('0xd0')](_0x414055)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x111')));}if(_0x471348&&_0x471348['type']!==_0x4c4c('0xb5')&&!isNotNull(this[_0x4c4c('0x22')][_0x471348['queue']]['dialQueueProject'])){delete this[_0x4c4c('0x28')][_0x2bfa43['uniqueid']];this[_0x4c4c('0xb6')](this[_0x4c4c('0x22')][_0x471348[_0x4c4c('0xb7')]]);this[_0x4c4c('0x22')][_0x471348[_0x4c4c('0xb7')]][_0x4c4c('0x6b')]+=0x1;_0x414055=new Hangup(_0x471348,_0x2bfa43);_0x414055[_0x4c4c('0xe9')]=0xc;_0x414055['statedesc']=_0x2bfa43[_0x4c4c('0x115')];_0x414055[_0x4c4c('0xea')]=_0x4c4c('0x116');this[_0x4c4c('0xd1')](_0x414055)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x110')));this[_0x4c4c('0xd0')](_0x414055)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x111')));}};Dialer['prototype'][_0x4c4c('0x33')]=function(_0x1d0ba4){var _0x29cd7d=this['uniqueId'][_0x1d0ba4[_0x4c4c('0x107')]];if(this[_0x4c4c('0x22')][_0x1d0ba4[_0x4c4c('0xb7')]]){if(_0x29cd7d&&_0x29cd7d['type']!==_0x4c4c('0xb5')){delete this['uniqueId'][_0x1d0ba4[_0x4c4c('0x107')]];this[_0x4c4c('0x22')][_0x1d0ba4[_0x4c4c('0xb7')]]['outboundAnswerCallsDay']+=0x1;var _0xe15d79=new AgentComplete(_0x29cd7d,_0x1d0ba4);if(_0x1d0ba4[_0x4c4c('0x117')]===_0x4c4c('0x118')){_0xe15d79[_0x4c4c('0x119')]=this['voiceQueues'][_0x1d0ba4['queue']][_0x4c4c('0x11a')]&&this[_0x4c4c('0x22')][_0x1d0ba4['queue']][_0x4c4c('0x11b')]?moment()[_0x4c4c('0x7e')](_0x4c4c('0x103')):undefined;}this['createHistory'](_0xe15d79)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x11c')));this[_0x4c4c('0xd0')](_0xe15d79)['catch'](loggerCatch(_0x4c4c('0x11d')));}}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x11e')]=function(_0xd088c3){if(this[_0x4c4c('0x22')][_0xd088c3[_0x4c4c('0xb7')]]){if(this[_0x4c4c('0x28')][_0xd088c3[_0x4c4c('0x107')]]&&this[_0x4c4c('0x28')][_0xd088c3[_0x4c4c('0x107')]][_0x4c4c('0x51')]!==_0x4c4c('0xb5')){this[_0x4c4c('0xb6')](this[_0x4c4c('0x22')][_0xd088c3['queue']]);this[_0x4c4c('0x28')][_0xd088c3[_0x4c4c('0x107')]][_0x4c4c('0x11f')]=moment()[_0x4c4c('0x7e')](_0x4c4c('0x103'));}}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x120')]=function(_0x3974f2,_0x2a955b){this[_0x4c4c('0xd1')](_0x3974f2)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x11c')));if(_0x2a955b==0x0){this['moveContactManagedDialer'](_0x3974f2)['catch'](loggerCatch(_0x4c4c('0x121')));}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x122')]=function(_0x3b384d){var _0x38d61d=this[_0x4c4c('0x28')][_0x3b384d['uniqueid']];var _0x31e703=this;var _0x272e61=![];var _0x2cee58;var _0x18a84e;if(this[_0x4c4c('0x22')][_0x3b384d['queue']]){if(_0x38d61d&&_0x38d61d[_0x4c4c('0x51')]!==_0x4c4c('0xb5')){delete this[_0x4c4c('0x28')][_0x3b384d['uniqueid']];this[_0x4c4c('0xb6')](this['voiceQueues'][_0x3b384d[_0x4c4c('0xb7')]]);_0x38d61d[_0x4c4c('0x123')]=moment()[_0x4c4c('0x7e')](_0x4c4c('0x103'));var _0x862354=new QueueCallerAbandon(_0x38d61d,_0x3b384d);if(getSeconds(_0x38d61d[_0x4c4c('0x123')],_0x38d61d[_0x4c4c('0x124')])>=_0x38d61d[_0x4c4c('0x125')]){this[_0x4c4c('0x22')][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x70')]+=0x1;this['voiceQueues'][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x67')]+=0x1;this[_0x4c4c('0x22')][_0x3b384d['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x862354['state']=0xa;_0x862354[_0x4c4c('0xa8')]=_0x4c4c('0x126');_0x862354[_0x4c4c('0x127')]='TIMEOUT';_0x862354['agiafterat']=this[_0x4c4c('0x22')][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x11a')]?moment()[_0x4c4c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x862354[_0x4c4c('0xf9')]+=0x1;_0x862354['countglobal']+=0x1;_0x2cee58=this['voiceQueues'][_0x3b384d[_0x4c4c('0xb7')]]['dialDropRetryFrequency'];_0x18a84e=this[_0x4c4c('0x22')][_0x3b384d[_0x4c4c('0xb7')]]['callAdditionalPhoneAfterMin'];_0x31e703[_0x4c4c('0xbf')](_0x862354,_0x862354[_0x4c4c('0xe9')],_0x38d61d[_0x4c4c('0x128')])[_0x4c4c('0x3e')](function(_0x4b0c6f){_0x272e61=_0x4b0c6f[_0x4c4c('0x129')]==0x1;if(_0x862354[_0x4c4c('0xf9')]>=_0x31e703[_0x4c4c('0x22')][_0x3b384d['queue']][_0x4c4c('0x12a')]){_0x31e703[_0x4c4c('0x120')](_0x862354,_0x4b0c6f[_0x4c4c('0x129')]);}else{_0x31e703[_0x4c4c('0xc8')]({'active':![],'countdropretry':_0x862354[_0x4c4c('0xf9')],'scheduledat':moment()['add'](_0x31e703[_0x4c4c('0x22')][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x12b')],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x38d61d['ContactId'],'ListId':_0x38d61d[_0x4c4c('0xd8')],'VoiceQueueId':_0x38d61d[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x38d61d[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x12c')));var _0x341eb1=new History(_0x862354);_0x341eb1['state']=0xa;_0x341eb1[_0x4c4c('0xa8')]=_0x4c4c('0x126');_0x341eb1[_0x4c4c('0xa9')]=moment()[_0x4c4c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x341eb1['endtime']=_0x341eb1[_0x4c4c('0xa9')];_0x341eb1[_0x4c4c('0x12d')]=_0x862354[_0x4c4c('0x12d')];_0x341eb1[_0x4c4c('0x12e')]=_0x862354['calleridnum'];_0x31e703['createHistory'](_0x341eb1)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x12f')));}})[_0x4c4c('0x3e')](function(){if(_0x272e61)_0x31e703['swapAdditionalPhones'](_0x862354,_0x2cee58,_0x18a84e)['then'](function(){return 0x1;});});}else{this['voiceQueues'][_0x3b384d['queue']][_0x4c4c('0x6f')]+=0x1;this['voiceQueues'][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x66')]+=0x1;_0x862354['state']=0xb;_0x862354['statedesc']=_0x4c4c('0x130');_0x862354['dropreason']=_0x4c4c('0x131');_0x862354[_0x4c4c('0xfa')]+=0x1;_0x862354[_0x4c4c('0xf3')]+=0x1;_0x2cee58=this['voiceQueues'][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x132')];_0x18a84e=this['voiceQueues'][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x133')];_0x31e703[_0x4c4c('0xbf')](_0x862354,_0x862354[_0x4c4c('0xe9')],_0x38d61d[_0x4c4c('0x128')])[_0x4c4c('0x3e')](function(_0x4a910d){if(_0x862354[_0x4c4c('0xfa')]>=_0x31e703[_0x4c4c('0x22')][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x134')]){_0x31e703[_0x4c4c('0x120')](_0x862354,_0x4a910d[_0x4c4c('0x129')]);}else{_0x31e703[_0x4c4c('0xc8')]({'active':![],'countabandonedretry':_0x862354['countabandonedretry'],'scheduledat':moment()[_0x4c4c('0x100')](_0x31e703[_0x4c4c('0x22')][_0x3b384d[_0x4c4c('0xb7')]][_0x4c4c('0x132')],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x38d61d['ContactId'],'ListId':_0x38d61d[_0x4c4c('0xd8')],'VoiceQueueId':_0x38d61d[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x38d61d[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x205097=new History(_0x862354);_0x205097[_0x4c4c('0xe9')]=0xb;_0x205097['statedesc']=_0x4c4c('0x130');_0x205097['starttime']=moment()['format'](_0x4c4c('0x103'));_0x205097['endtime']=_0x205097['starttime'];_0x205097[_0x4c4c('0x12d')]=_0x862354['calleridname'];_0x205097[_0x4c4c('0x12e')]=_0x862354['calleridnum'];_0x31e703[_0x4c4c('0xd1')](_0x205097)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x135')));}})[_0x4c4c('0x3e')](function(){if(_0x272e61)_0x31e703['swapAdditionalPhones'](_0x862354,_0x2cee58,_0x18a84e)[_0x4c4c('0x3e')](function(){return 0x1;});});}}}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x37')]=function(_0x337e17){if(this[_0x4c4c('0xab')][_0x337e17[_0x4c4c('0x107')]]){this[_0x4c4c('0xab')][_0x337e17[_0x4c4c('0x107')]][_0x4c4c('0xb2')]=_0x337e17[_0x4c4c('0xb2')];}if(this[_0x4c4c('0x28')][_0x337e17[_0x4c4c('0x107')]]){this[_0x4c4c('0x28')][_0x337e17['uniqueid']][_0x4c4c('0xb2')]=_0x337e17['channel'];}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x136')]=function(_0x2f691c){if(strategy[this[_0x4c4c('0x22')][this['actions'][_0x2f691c[_0x4c4c('0x137')]][_0x4c4c('0xb7')]][_0x4c4c('0x53')]]===_0x4c4c('0x1d')){if(this['actions'][_0x2f691c[_0x4c4c('0x137')]]&&_['isNil'](this['actions'][_0x2f691c['actionid']][_0x4c4c('0x138')])&&_0x2f691c[_0x4c4c('0xb1')]==='1'&&_0x2f691c[_0x4c4c('0x139')]==='0'){if(this[_0x4c4c('0x24')][_0x2f691c['stateinterface']]){if(!this['agents'][_0x2f691c[_0x4c4c('0x13a')]][_0x4c4c('0x138')]){this[_0x4c4c('0x24')][_0x2f691c[_0x4c4c('0x13a')]][_0x4c4c('0x138')]=!![];this['actions'][_0x2f691c[_0x4c4c('0x137')]][_0x4c4c('0x138')]=!![];this['actions'][_0x2f691c['actionid']][_0x4c4c('0x13a')]=_0x2f691c['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x2f691c[_0x4c4c('0x137')]][_0x4c4c('0xb7')]][_0x4c4c('0x53')]]||_0x4c4c('0x1c'))===_0x4c4c('0x1c')){if(this[_0x4c4c('0xab')][_0x2f691c[_0x4c4c('0x137')]]){if(this['agents'][_0x2f691c[_0x4c4c('0x13a')]]){this[_0x4c4c('0xab')][_0x2f691c[_0x4c4c('0x137')]][_0x4c4c('0x13a')]=_0x2f691c[_0x4c4c('0x13a')];if(_[_0x4c4c('0xe3')](this[_0x4c4c('0x13b')][this[_0x4c4c('0xab')][_0x2f691c[_0x4c4c('0x137')]][_0x4c4c('0xb7')]])){this[_0x4c4c('0x13b')][this[_0x4c4c('0xab')][_0x2f691c[_0x4c4c('0x137')]][_0x4c4c('0xb7')]]=[];}this[_0x4c4c('0x13b')][this[_0x4c4c('0xab')][_0x2f691c['actionid']]['queue']][_0x4c4c('0x13c')](_[_0x4c4c('0x13d')](_[_0x4c4c('0xd6')](this[_0x4c4c('0xab')][_0x2f691c[_0x4c4c('0x137')]],[_0x4c4c('0x13e'),_0x4c4c('0x13a')]),{'status':_0x2f691c[_0x4c4c('0xb1')],'paused':_0x2f691c[_0x4c4c('0x139')]}));}}}};function unlockQueueStatus(_0xb3dd82,_0x4358f0){setTimeout(function(){if(_[_0x4c4c('0x40')](_0xb3dd82[_0x4c4c('0x13f')])){loggerBooked[_0x4c4c('0x99')]('[unlockQueueStatus][undefined]',_0x4358f0);}_0xb3dd82[_0x4c4c('0x13f')]=!![];loggerBooked[_0x4c4c('0x81')](_0x4c4c('0x140'),_0x4358f0,JSON['stringify'](_['pick'](_0xb3dd82,['name',_0x4c4c('0x13f')])));},0x1f3);}Dialer[_0x4c4c('0x1e')][_0x4c4c('0x3b')]=function(_0x40d9c2){var _0x491666=this;var _0x126907=_0x491666[_0x4c4c('0x22')][_0x491666[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xb7')]];if(strategy[this[_0x4c4c('0x22')][this['actions'][_0x40d9c2['actionid']][_0x4c4c('0xb7')]][_0x4c4c('0x53')]]===_0x4c4c('0x1d')){if(this['actions'][_0x40d9c2['actionid']]&&this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0x13a')]){this[_0x4c4c('0x94')][_0x4c4c('0x141')](this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]]['idHopper'],this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0x13a')])[_0x4c4c('0xb3')](function(_0x2de24e){logger['error'](_0x4c4c('0x142'),util[_0x4c4c('0x9a')](_0x2de24e,{'showHidden':![],'depth':null}));})[_0x4c4c('0x20')](function(){_0x491666[_0x4c4c('0xb6')](_0x491666['voiceQueues'][_0x491666['actions'][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xb7')]]);_0x491666['agents'][_0x491666[_0x4c4c('0xab')][_0x40d9c2['actionid']]['stateinterface']]['locked']=![];delete _0x491666[_0x4c4c('0xab')][_0x40d9c2['actionid']];unlockQueueStatus(_0x126907);});}else{this[_0x4c4c('0xb6')](this[_0x4c4c('0x22')][this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]]['queue']]);this[_0x4c4c('0xc8')]({'active':![],'ContactId':this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xd7')],'ListId':this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xd8')],'VoiceQueueId':this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0x10e')]||undefined,'CampaignId':this[_0x4c4c('0xab')][_0x40d9c2['actionid']][_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x143')));delete this[_0x4c4c('0xab')][_0x40d9c2['actionid']];unlockQueueStatus(_0x126907);}}else if((strategy[this['voiceQueues'][this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xb7')]][_0x4c4c('0x53')]]||_0x4c4c('0x1c'))===_0x4c4c('0x1c')){var _0x126012;if(this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]]&&!_[_0x4c4c('0x4b')](this[_0x4c4c('0x13b')][this[_0x4c4c('0xab')][_0x40d9c2['actionid']][_0x4c4c('0xb7')]])){if(this[_0x4c4c('0x2d')][_0x491666[_0x4c4c('0xab')][_0x40d9c2['actionid']][_0x4c4c('0xb7')]]){this[_0x4c4c('0x2d')][_0x491666[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xb7')]]=this[_0x4c4c('0x2d')][this[_0x4c4c('0xab')][_0x40d9c2['actionid']][_0x4c4c('0xb7')]]?this[_0x4c4c('0x2d')][this[_0x4c4c('0xab')][_0x40d9c2['actionid']][_0x4c4c('0xb7')]]:this[_0x4c4c('0x13b')][this['actions'][_0x40d9c2['actionid']][_0x4c4c('0xb7')]]?this[_0x4c4c('0x13b')][this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]]['queue']]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xb7')]][_0x4c4c('0x144')]=this['queueBookedRR'][this[_0x4c4c('0xab')][_0x40d9c2[_0x4c4c('0x137')]][_0x4c4c('0xb7')]];for(var _0xef3535=0x0;_0xef3535=0x0;})['catch'](myreject(_0x2de0c7)));}}else{_0xb64f20[_0x4c4c('0x13c')](ami[_0x4c4c('0xb0')]({'action':_0x4c4c('0x15d'),'command':util['format'](_0x4c4c('0x15e'),_0x3b9692,!_[_0x4c4c('0x40')](config[_0x4c4c('0x160')][_0x1092d1])?_0x1092d1:'')})[_0x4c4c('0x3e')](function(_0x3c9488){return _0x3c9488['content']['indexOf'](_0x4c4c('0x163'))>=0x0;})['catch'](myreject(_0x2de0c7)));}Promise[_0x4c4c('0x164')](_0xb64f20)[_0x4c4c('0x3e')](function(_0x1a6760){var _0x53ea45=_[_0x4c4c('0x165')](_0x1a6760);if(_0x53ea45){return _0x593679(_0x53ea45);}else{_0x11bd99[_0x4c4c('0x41')]=_0x325386?_0x4c4c('0x166'):_0x4c4c('0x167');return _0x2de0c7(msgResponse(_0x4c4c('0x168'),_0x4c4c('0x157'),_0x4c4c('0x169')+_0x325386+'\x20'+_0x2ae9d2+_0x4c4c('0x16a')+util[_0x4c4c('0x9a')](_0x3b9692,{'showHidden':![],'depth':null})+_0x4c4c('0x16b')+_0x1092d1));}})[_0x4c4c('0xb3')](function(_0x51266a){return _0x2de0c7(msgResponse(_0x4c4c('0x155'),_0x4c4c('0x157'),JSON[_0x4c4c('0x4e')](_0x51266a)));});});};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x16c')]=function(_0x106b2a){var _0x292e17=this;return function(){switch(_0x106b2a['dialMethod']){case _0x4c4c('0x16d'):freeVariablesPredictive(_0x106b2a);_0x292e17['handlePower'](_0x106b2a,0x1);break;case'power':freeVariablesPredictive(_0x106b2a);_0x292e17['handlePower'](_0x106b2a,_0x106b2a[_0x4c4c('0x16e')]);break;case'predictive':_0x292e17[_0x4c4c('0x9')](_0x106b2a);break;case'booked':freeVariablesPredictive(_0x106b2a);_0x292e17[_0x4c4c('0x16f')](_0x106b2a,0x1);break;default:freeVariablesPredictive(_0x106b2a);logger[_0x4c4c('0x99')]('Queue',_0x106b2a['name'],_0x4c4c('0x170'));}};};Dialer['prototype'][_0x4c4c('0x171')]=function(_0x4c8a84){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopper['handlePreviewRecallNotifications'](_0x4c8a84['id'],previewRecallmeReminderInterval))[_0x4c4c('0x3e')](function(_0x50ad01){for(var _0x1a3fdc=0x0;_0x1a3fdc<_0x50ad01[_0x4c4c('0x9b')];_0x1a3fdc++){var _0xdca1df=_0x50ad01[_0x1a3fdc]['Agent']['name'];if(_0xdca1df)io['to'](util[_0x4c4c('0x7e')](_0x4c4c('0x172'),_0xdca1df))[_0x4c4c('0xf4')](_0x4c4c('0x173'),{'hopper':_0x50ad01[_0x1a3fdc]});}})['catch'](function(){});};Dialer['prototype'][_0x4c4c('0x174')]=function(_0x4e844f){var _0x4ca317=this;return function(){_0x4ca317[_0x4c4c('0x175')](_0x4e844f);};};Dialer[_0x4c4c('0x1e')][_0x4c4c('0xb')]=function(_0x4c5e19){var _0x35d629=this;if(isNotPreview(_0x4c5e19[_0x4c4c('0x176')])){if(isVoiceQueueOutbound(_0x4c5e19[_0x4c4c('0x51')])&&isActive(_0x4c5e19[_0x4c4c('0x5e')])){_0x4c5e19['sendMessageOneNotActive']=!![];Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](checkIsLoggedIn(_0x4c5e19,_0x4c5e19['loggedIn']))[_0x4c4c('0x3e')](checkIsActive(_0x4c5e19,_0x4c5e19[_0x4c4c('0x5e')]))['then'](checkInterval(_0x4c5e19))[_0x4c4c('0x3e')](_0x35d629[_0x4c4c('0x151')](_0x4c5e19))['then'](_0x35d629[_0x4c4c('0x154')](_0x4c5e19[_0x4c4c('0x177')],_0x4c5e19[_0x4c4c('0x178')],_0x4c5e19[_0x4c4c('0x43')],_0x4c5e19))[_0x4c4c('0x3e')](_0x35d629['checkIfTimeIntervals'](_0x4c5e19[_0x4c4c('0x47')],_0x4c5e19['dialTimezone'],_0x4c5e19[_0x4c4c('0x43')],_0x4c5e19))[_0x4c4c('0x3e')](_0x35d629[_0x4c4c('0x16c')](_0x4c5e19))[_0x4c4c('0xb3')](loggerCatchQueueSummary(_0x4c4c('0x179'),_0x4c5e19));}else{notSendMessagesQueue(_0x4c5e19);}}else{freeVariablesPredictive(_0x4c5e19);}};Dialer['prototype']['syncQueueSummaryComplete']=_['throttle'](function(){var _0x15f9d1=_[_0x4c4c('0x17a')](this[_0x4c4c('0x22')],function(_0x56e3f7){return _0x56e3f7['dialPreviewRecallmeReminder'];});var _0x2ff0d8=_[_0x4c4c('0x17a')](this[_0x4c4c('0x24')],function(_0x18c26f){return _0x18c26f[_0x4c4c('0x17b')]&&_0x18c26f[_0x4c4c('0xb1')]==='reachable';});if(_0x15f9d1[_0x4c4c('0x9b')]>0x0&&_0x2ff0d8[_0x4c4c('0x9b')]>0x0){return Promise[_0x4c4c('0xbb')]()[_0x4c4c('0x3e')](cmHopper['handlePreviewRecallNotifications'](_[_0x4c4c('0x17c')](_0x15f9d1,'id'),previewRecallmeReminderInterval,_[_0x4c4c('0x17c')](_0x2ff0d8,'id')))[_0x4c4c('0x3e')](function(_0x12d1e4){for(var _0x412aa6=0x0;_0x412aa6<_0x12d1e4[_0x4c4c('0x9b')];_0x412aa6++){var _0x56c097=_0x12d1e4[_0x412aa6][_0x4c4c('0x17d')][_0x4c4c('0x43')];if(_0x56c097)io['to'](util[_0x4c4c('0x7e')]('user:%s',_0x56c097))[_0x4c4c('0xf4')](_0x4c4c('0x173'),{'hopper':_0x12d1e4[_0x412aa6]});}})[_0x4c4c('0xb3')](function(_0x23e9ae){logger[_0x4c4c('0x99')](_0x4c4c('0x171'),_0x23e9ae);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x4c4c('0x1e')]['syncCampaigns']=function(){var _0x345eb6=this;var _0x60fb2a;for(var _0x527f35 in this['campaigns']){if(typeof this[_0x4c4c('0x23')][_0x527f35]!=='undefined'){_0x60fb2a=this['campaigns'][_0x527f35];if(isCampaignIvr(_0x60fb2a[_0x4c4c('0x51')])&&isActive(_0x60fb2a[_0x4c4c('0x7b')])){_0x60fb2a['sendMessageOneNotActive']=!![];Promise[_0x4c4c('0xbb')]()['then'](checkIsActive(_0x60fb2a,_0x60fb2a[_0x4c4c('0x7b')]))[_0x4c4c('0x3e')](checkInterval(_0x60fb2a))[_0x4c4c('0x3e')](_0x345eb6[_0x4c4c('0x151')](_0x60fb2a))[_0x4c4c('0x3e')](_0x345eb6['checkIfTime'](_0x60fb2a[_0x4c4c('0x177')],_0x60fb2a[_0x4c4c('0x178')],_0x60fb2a[_0x4c4c('0x43')],_0x60fb2a))[_0x4c4c('0x3e')](_0x345eb6[_0x4c4c('0x156')](_0x60fb2a['Interval'],_0x60fb2a[_0x4c4c('0x178')],_0x60fb2a['name'],_0x60fb2a))[_0x4c4c('0x3e')](_0x345eb6['launchHandleIvr'](_0x60fb2a))[_0x4c4c('0xb3')](loggerCatchQueueSummary('[syncCampaigns]',_0x60fb2a));}else{notSendMessagesCampaign(_0x60fb2a);}}}};function getCallerIdRandom(_0x20a1bf,_0x1618a0){var _0x4c07e5;var _0x191523;var _0xb4ef20;if(_0x1618a0<=0x0){_0x1618a0=0x1;}_0x4c07e5=new RegExp('\x5cw{0,'+_0x1618a0+'}$');_0x191523=Math[_0x4c4c('0x17e')](0xa,_0x1618a0-0x1);_0xb4ef20=Math[_0x4c4c('0x17e')](0xa,_0x1618a0)-0x1;return util['format']('%s',_['replace'](_0x20a1bf,_0x4c07e5,_[_0x4c4c('0x17f')](_0x191523,_0xb4ef20)));}function extractCalleridName(_0x4ba110){var _0xc8d798=_0x4ba110[_0x4c4c('0x180')](/"(.*?)"/);return _0xc8d798?_0xc8d798[0x1]:_0x4ba110;}Dialer[_0x4c4c('0x1e')][_0x4c4c('0x181')]=function(_0xf68d0,_0x2ef42a){var _0x2faab4=this;var _0xdde858=uuid['v4']();this[_0x4c4c('0xab')][_0xdde858]=new Action(_0xf68d0,_0x2ef42a,_0xdde858);return new Promise(function(_0x195ec5,_0x3fd2a9){if(_[_0x4c4c('0x40')](_0xf68d0)&&typeof _0xf68d0!==_0x4c4c('0x182')){return _0x3fd2a9(msgResponse(_0x4c4c('0x183'),_0x4c4c('0x157'),_0x4c4c('0x184')));}if(_[_0x4c4c('0x40')](_0x2ef42a['phone'])||_0x2ef42a[_0x4c4c('0x185')]===null){return _0x3fd2a9(msgResponse('originate',_0x4c4c('0x157'),_0x4c4c('0x186')));}var _0x1850bf={'XMD-CALLERID':_0x2faab4[_0x4c4c('0xab')][_0xdde858][_0x4c4c('0x187')](),'XMD-AGI':_0xf68d0[_0x4c4c('0x112')]?util[_0x4c4c('0x7e')](_0x4c4c('0x188'),ipAgi,_0xf68d0['dialQueueProject']):_0x4c4c('0x189'),'XMD-AGIAFTER':_0xf68d0[_0x4c4c('0x11a')]?util['format'](_0x4c4c('0x188'),ipAgi,_0xf68d0['dialQueueProject2']):_0x4c4c('0x189'),'XMD-QUEUE':_0xf68d0[_0x4c4c('0x51')]===_0x4c4c('0x52')?util[_0x4c4c('0x7e')](_0x4c4c('0x18a'),_0xf68d0[_0x4c4c('0x43')],_0xf68d0[_0x4c4c('0x18b')]||'',_0xf68d0[_0x4c4c('0x11b')]?'c':'',_0xf68d0[_0x4c4c('0x125')]||0x3):_0x4c4c('0x189'),'XMD-CONTACTID':_0x2ef42a[_0x4c4c('0xd7')],'XMD-CDRTYPE':_0x4c4c('0x18c'),'CALLERID(all)':_0x2faab4[_0x4c4c('0xab')][_0xdde858][_0x4c4c('0x187')](),'XMD-AMD':_0xf68d0['dialAMDActive']?_0x4c4c('0x18d'):_0x4c4c('0x189'),'XMD-DESTINATION':_0x4c4c('0xe7')};if(_0xf68d0[_0x4c4c('0xef')]){_0x1850bf[_0x4c4c('0x18e')]=_0xf68d0['dialAMDInitialSilence']||0x9c4;_0x1850bf[_0x4c4c('0x18f')]=_0xf68d0['dialAMDGreeting']||0x5dc;_0x1850bf[_0x4c4c('0x190')]=_0xf68d0[_0x4c4c('0x191')]||0x320;_0x1850bf[_0x4c4c('0x192')]=_0xf68d0[_0x4c4c('0x193')]||0x1388;_0x1850bf['XMD-AMDMINWORDLENGTH']=_0xf68d0[_0x4c4c('0x194')]||0x64;_0x1850bf[_0x4c4c('0x195')]=_0xf68d0[_0x4c4c('0x196')]||0x32;_0x1850bf['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0xf68d0[_0x4c4c('0x197')]||0x3;_0x1850bf[_0x4c4c('0x198')]=_0xf68d0[_0x4c4c('0x199')]||0x100;_0x1850bf['XMD-AMDMAXIMUMWORDLENGTH']=_0xf68d0['dialAMDMaximumWordLength']||0x1388;}if(_0xf68d0['type']===_0x4c4c('0x52')){_0x1850bf[_0x4c4c('0x19a')]=_0x2ef42a['VoiceQueueId'];}else{_0x1850bf[_0x4c4c('0x19b')]=_0x2ef42a[_0x4c4c('0x104')];}for(var _0x8eb750 in _0x2ef42a[_0x4c4c('0x19c')]){if(typeof _0x2ef42a[_0x4c4c('0x19c')][_0x8eb750]!==_0x4c4c('0xae')){if(isNotNull(_0x2ef42a[_0x4c4c('0x19c')][_0x8eb750])&&_0x8eb750!=='id'&&_0x8eb750!==_0x4c4c('0x19d')&&_0x8eb750!=='createdAt'&&_0x8eb750!=='updatedAt'){_0x1850bf[util[_0x4c4c('0x7e')]('%s%s','XMD-',_[_0x4c4c('0x19e')](_0x8eb750))]=_0x2ef42a[_0x4c4c('0x19c')][_0x8eb750];}}}var _0x25b319=_0x2faab4[_0x4c4c('0xde')](_0xf68d0[_0x4c4c('0x7a')])?getCallerId(_0xf68d0['Trunk'][_0x4c4c('0x7c')],_0xf68d0[_0x4c4c('0x5f')],_0xf68d0[_0x4c4c('0x19f')]>0x0?getCallerIdRandom(_0xf68d0['dialOriginateCallerIdNumber'],_0xf68d0[_0x4c4c('0x19f')]):_0xf68d0[_0x4c4c('0x60')]):getCallerId(_[_0x4c4c('0xe3')](_0xf68d0[_0x4c4c('0x1a0')])?_0xf68d0[_0x4c4c('0x7a')][_0x4c4c('0x7c')]:_0xf68d0['TrunkBackup'][_0x4c4c('0x7c')],_0xf68d0[_0x4c4c('0x5f')],_0xf68d0['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xf68d0[_0x4c4c('0x60')],_0xf68d0[_0x4c4c('0x19f')]):_0xf68d0[_0x4c4c('0x60')]);if(_0x25b319){_0x1850bf[_0x4c4c('0x1a1')]=_0x2faab4[_0x4c4c('0xab')][_0xdde858][_0x4c4c('0x1a2')]=extractCalleridName(_0x25b319);_0x1850bf['XMD-ORIGINATECALLERIDNUM']=_0x2ef42a[_0x4c4c('0x185')];}_0xf68d0['variables']=_0x1850bf;return ami[_0x4c4c('0xb0')]({'actionid':_0xdde858,'action':_0x4c4c('0x183'),'channel':_0x2faab4[_0x4c4c('0xde')](_0xf68d0[_0x4c4c('0x7a')])?util['format'](_0x4c4c('0x1a3'),_0xf68d0[_0x4c4c('0x7a')][_0x4c4c('0x43')],isNotNull(_0xf68d0[_0x4c4c('0x1a4')])?_0xf68d0[_0x4c4c('0x1a4')]['trim']()||'':'',_0xf68d0['dialCutDigit']>0x0?_0x2ef42a[_0x4c4c('0x185')][_0x4c4c('0x1a5')](_0xf68d0[_0x4c4c('0x1a6')]):_0x2ef42a[_0x4c4c('0x185')]):util[_0x4c4c('0x7e')](_0x4c4c('0x1a3'),_[_0x4c4c('0xe3')](_0xf68d0['TrunkBackup'])?_0xf68d0[_0x4c4c('0x7a')][_0x4c4c('0x43')]:_0xf68d0[_0x4c4c('0x1a0')]['name'],isNotNull(_0xf68d0[_0x4c4c('0x1a4')])?_0xf68d0['dialPrefix'][_0x4c4c('0x1a7')]()||'':'',_0xf68d0[_0x4c4c('0x1a6')]>0x0?_0x2ef42a[_0x4c4c('0x185')]['substring'](_0xf68d0[_0x4c4c('0x1a6')]):_0x2ef42a[_0x4c4c('0x185')]),'callerid':_0x25b319,'Exten':_0x4c4c('0xe7'),'Context':'from-sip','Priority':'1','variable':_0x1850bf,'timeout':(_0xf68d0['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xdde858})[_0x4c4c('0x3e')](function(_0x283f11){return _0x195ec5(_0x283f11);})[_0x4c4c('0xb3')](function(_0x2b0649){_0xf68d0['outboundOriginateFailureCallsDay']+=0x1;var _0x123c3e=new History(_0x2faab4[_0x4c4c('0xab')][_0xdde858]);logger[_0x4c4c('0x99')](util[_0x4c4c('0x7e')](_0x4c4c('0x1a8'),JSON[_0x4c4c('0x4e')](_0x2b0649)));_0x123c3e[_0x4c4c('0xe9')]=0xe;_0x123c3e[_0x4c4c('0xa8')]='OriginateError';_0x123c3e['starttime']=moment()[_0x4c4c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x123c3e['endtime']=_0x123c3e[_0x4c4c('0xa9')];_0x2faab4[_0x4c4c('0xd1')](_0x123c3e)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1a9')));_0x2faab4[_0x4c4c('0xd0')](_0x123c3e)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1a9')))[_0x4c4c('0x20')](function(){delete _0x2faab4['actions'][_0xdde858];return _0x3fd2a9(msgResponse('originate',_0x4c4c('0x4d'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x4c4c('0x32')]=function(_0x57ae59){var _0x531f53=this['actions'][_0x57ae59[_0x4c4c('0x137')]];if(_0x531f53){delete this['actions'][_0x57ae59[_0x4c4c('0x137')]];_0x531f53[_0x4c4c('0x124')]=moment()['format'](_0x4c4c('0x103'));var _0x18d680=_0x531f53['type']===_0x4c4c('0xb5')?this[_0x4c4c('0x23')][_0x531f53[_0x4c4c('0xb7')]]:this[_0x4c4c('0x22')][_0x531f53[_0x4c4c('0x1aa')]()];if(!this['isSuccess'](_0x57ae59['response'])){this[_0x4c4c('0xb6')](_0x18d680);return this[_0x4c4c('0x1ab')](_0x531f53,_0x18d680,_0x57ae59)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1ac')));}this[_0x4c4c('0x28')][_0x57ae59[_0x4c4c('0x107')]]=_0x531f53;}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x1ad')]=function(_0x522949,_0x1b07e3,_0x450ec0){var _0x17adf2=new History(_0x1b07e3);if(_0x17adf2[_0x4c4c('0xf6')]+_0x17adf2['countcongestionretry']+_0x17adf2[_0x4c4c('0xf7')]+_0x17adf2[_0x4c4c('0xf8')]+_0x17adf2['countdropretry']+_0x17adf2[_0x4c4c('0xfa')]+_0x17adf2[_0x4c4c('0xf2')]+_0x17adf2[_0x4c4c('0x10c')]>=_0x450ec0['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x522949){case 0x3:if(_0x17adf2['countnoanswerretry']>=_0x450ec0[_0x4c4c('0x1ae')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x17adf2['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x4c4c('0x100')](_0x450ec0[_0x4c4c('0x1af')],'minutes')[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2[_0x4c4c('0xd8')],'VoiceQueueId':_0x17adf2['VoiceQueueId']||undefined,'CampaignId':_0x17adf2[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1b0')));break;case 0x5:if(_0x17adf2['countbusyretry']>=_0x450ec0['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x17adf2[_0x4c4c('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x450ec0[_0x4c4c('0x1b1')],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2[_0x4c4c('0xd8')],'VoiceQueueId':_0x17adf2[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x17adf2[_0x4c4c('0x104')]||undefined})['catch'](loggerCatch(_0x4c4c('0x1b2')));break;case 0x8:if(_0x17adf2[_0x4c4c('0x10b')]>=_0x450ec0['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x17adf2[_0x4c4c('0x10b')]+=0x1,'scheduledat':moment()[_0x4c4c('0x100')](_0x450ec0['dialCongestionRetryFrequency'],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2[_0x4c4c('0xd8')],'VoiceQueueId':_0x17adf2['VoiceQueueId']||undefined,'CampaignId':_0x17adf2['CampaignId']||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1b3')));break;case 0x0:if(_0x17adf2['countnosuchnumberretry']>=_0x450ec0[_0x4c4c('0x1b4')]-0x1){return!![];}else{this[_0x4c4c('0xc8')]({'active':![],'countnosuchnumberretry':_0x17adf2[_0x4c4c('0xf8')]+=0x1,'scheduledat':moment()[_0x4c4c('0x100')](_0x450ec0['dialNoSuchNumberRetryFrequency'],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2['ListId'],'VoiceQueueId':_0x17adf2['VoiceQueueId']||undefined,'CampaignId':_0x17adf2[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1b5')));}break;case 0xa:if(_0x17adf2[_0x4c4c('0xf9')]>=_0x450ec0[_0x4c4c('0x12a')]-0x1){return!![];}this[_0x4c4c('0xc8')]({'active':![],'countdropretry':_0x17adf2[_0x4c4c('0xf9')]+=0x1,'scheduledat':moment()[_0x4c4c('0x100')](_0x450ec0['dialDropRetryFrequency'],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2['ListId'],'VoiceQueueId':_0x17adf2[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x17adf2[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x12c')));break;case 0xb:if(_0x17adf2['countabandonedretry']>=_0x450ec0[_0x4c4c('0x134')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x17adf2[_0x4c4c('0xfa')]+=0x1,'scheduledat':moment()[_0x4c4c('0x100')](_0x450ec0['dialAbandonedRetryFrequency'],'minutes')[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2[_0x4c4c('0xd8')],'VoiceQueueId':_0x17adf2[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x17adf2[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x17adf2['countmachineretry']>=_0x450ec0[_0x4c4c('0xfd')]-0x1){return!![];}this[_0x4c4c('0xc8')]({'active':![],'countmachineretry':_0x17adf2[_0x4c4c('0xf2')]+=0x1,'scheduledat':moment()[_0x4c4c('0x100')](_0x450ec0[_0x4c4c('0x101')],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2[_0x4c4c('0xd8')],'VoiceQueueId':_0x17adf2[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x17adf2['CampaignId']||undefined})[_0x4c4c('0xb3')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x17adf2[_0x4c4c('0x10c')]>=_0x450ec0[_0x4c4c('0x1b6')]-0x1){return!![];}this[_0x4c4c('0xc8')]({'active':![],'countagentrejectretry':_0x17adf2[_0x4c4c('0x10c')]+=0x1,'scheduledat':moment()[_0x4c4c('0x100')](_0x450ec0['dialAgentRejectRetryFrequency'],_0x4c4c('0x102'))[_0x4c4c('0x7e')](_0x4c4c('0x103')),'ContactId':_0x17adf2[_0x4c4c('0xd7')],'ListId':_0x17adf2[_0x4c4c('0xd8')],'VoiceQueueId':_0x17adf2[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x17adf2[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1b7')));break;default:return!![];}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x1ab')]=function(_0x48e02d,_0x18cc17,_0x101b0f){var _0x2707d9=this;var _0x1b339f=new History(_0x48e02d);var _0x4a4579=![];var _0x1c9932;var _0xf04c18;return new Promise(function(_0x38d93e,_0x6bd8d0){if(_[_0x4c4c('0x40')](_0x18cc17)&&typeof _0x18cc17!==_0x4c4c('0x182')){return _0x6bd8d0(msgResponse(_0x4c4c('0x1b8'),_0x4c4c('0x157'),_0x4c4c('0x1b9')));}if(_[_0x4c4c('0x40')](_0x101b0f)&&typeof _0x101b0f!=='object'){return _0x6bd8d0(msgResponse(_0x4c4c('0x1b8'),_0x4c4c('0x157'),_0x4c4c('0x1ba')));}_0x2707d9[_0x4c4c('0xbf')](_0x1b339f,_0x101b0f['reason'],_0x18cc17)[_0x4c4c('0x3e')](function(_0x357a30){if(_0x357a30['additional']==0x1)_0x4a4579=!![];switch(_0x101b0f[_0x4c4c('0x117')]){case'0':_0x18cc17[_0x4c4c('0x1bb')]+=0x1;_0x1b339f[_0x4c4c('0xe9')]=0x0;_0x1b339f['statedesc']=_0x4c4c('0x1bc');_0x1b339f[_0x4c4c('0xf8')]+=0x1;_0x1b339f[_0x4c4c('0xf3')]+=0x1;ami[_0x4c4c('0xf4')]('custom:agentnosuchnumber',ut[_0x4c4c('0xed')](_0x48e02d,_0x4c4c('0x1bd')));_0x1c9932=_0x18cc17['dialNoSuchNumberRetryFrequency'];_0xf04c18=_0x18cc17[_0x4c4c('0x133')];_0x2707d9[_0x4c4c('0xd1')](_0x1b339f)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xf5')));if(_0x2707d9[_0x4c4c('0x1ad')](0x0,_0x48e02d,_0x18cc17)&&!_0x4a4579){if(_0x1b339f[_0x4c4c('0xf8')]>=_0x18cc17[_0x4c4c('0x1b4')]){_0x2707d9['createStateFinal'](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1be'));}else{_0x2707d9[_0x4c4c('0xfc')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1be'));}}break;case'3':_0x18cc17[_0x4c4c('0x1bf')]+=0x1;_0x1b339f[_0x4c4c('0xe9')]=0x3;_0x1b339f[_0x4c4c('0xa8')]=_0x4c4c('0x1c0');_0x1b339f[_0x4c4c('0xf7')]+=0x1;_0x1b339f['countglobal']+=0x1;var _0x8aa3fb=ut['buildNoAnswerEventPayload'](_0x48e02d,_0x18cc17);ami[_0x4c4c('0xf4')](_0x4c4c('0x1c1'),_0x8aa3fb);_0x1c9932=_0x18cc17[_0x4c4c('0x1af')];_0xf04c18=_0x18cc17[_0x4c4c('0x133')];_0x2707d9[_0x4c4c('0xd1')](_0x1b339f)['catch'](loggerCatch(_0x4c4c('0x1c2')));if(_0x2707d9[_0x4c4c('0x1ad')](0x3,_0x48e02d,_0x18cc17)&&!_0x4a4579){if(_0x1b339f[_0x4c4c('0xf7')]>=_0x18cc17[_0x4c4c('0x1ae')]){_0x2707d9[_0x4c4c('0xfe')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1c3'));}else{_0x2707d9['stateGlobal'](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1c3'));}}break;case'5':_0x18cc17[_0x4c4c('0x64')]+=0x1;_0x1b339f[_0x4c4c('0xe9')]=0x5;_0x1b339f['statedesc']='Busy';_0x1b339f[_0x4c4c('0xf6')]+=0x1;_0x1b339f[_0x4c4c('0xf3')]+=0x1;ami[_0x4c4c('0xf4')](_0x4c4c('0x1c4'),ut['buildObj'](_0x48e02d,_0x4c4c('0x1c5')));_0x1c9932=_0x18cc17[_0x4c4c('0x1b1')];_0xf04c18=_0x18cc17[_0x4c4c('0x133')];_0x2707d9[_0x4c4c('0xd1')](_0x1b339f)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x1c6')));if(_0x2707d9[_0x4c4c('0x1ad')](0x5,_0x48e02d,_0x18cc17)&&!_0x4a4579){if(_0x1b339f[_0x4c4c('0xf6')]>=_0x18cc17[_0x4c4c('0x1c7')]){_0x2707d9[_0x4c4c('0xfe')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1c8'));}else{_0x2707d9[_0x4c4c('0xfc')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1c8'));}}break;case'8':_0x18cc17['outboundCongestionCallsDay']+=0x1;_0x1b339f[_0x4c4c('0xe9')]=0x8;_0x1b339f[_0x4c4c('0xa8')]=_0x4c4c('0x1c9');_0x1b339f[_0x4c4c('0x10b')]+=0x1;_0x1b339f[_0x4c4c('0xf3')]+=0x1;_0x1c9932=_0x18cc17['dialCongestionRetryFrequency'];_0xf04c18=_0x18cc17['callAdditionalPhoneAfterMin'];ami[_0x4c4c('0xf4')](_0x4c4c('0x1ca'),ut[_0x4c4c('0xed')](_0x48e02d,'congestion'));_0x2707d9[_0x4c4c('0xd1')](_0x1b339f)[_0x4c4c('0xb3')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x2707d9[_0x4c4c('0x1ad')](0x8,_0x48e02d,_0x18cc17)&&!_0x4a4579){if(_0x1b339f[_0x4c4c('0x10b')]>=_0x18cc17[_0x4c4c('0x1cb')]){_0x2707d9[_0x4c4c('0xfe')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1cc'));}else{_0x2707d9[_0x4c4c('0xfc')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1cc'));}}break;case'11':_0x18cc17[_0x4c4c('0x1cd')]+=0x1;_0x1b339f[_0x4c4c('0xe9')]=0xb;_0x1b339f[_0x4c4c('0xa8')]=_0x4c4c('0x130');_0x1b339f[_0x4c4c('0xfa')]+=0x1;_0x1b339f[_0x4c4c('0xf3')]+=0x1;_0x1c9932=_0x18cc17[_0x4c4c('0x132')];_0xf04c18=_0x18cc17[_0x4c4c('0x133')];_0x2707d9['createHistory'](_0x1b339f)[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x135')));if(_0x2707d9[_0x4c4c('0x1ad')](0xb,_0x48e02d,_0x18cc17)&&!_0x4a4579){if(_0x1b339f[_0x4c4c('0xfa')]>=_0x18cc17[_0x4c4c('0x134')]){_0x2707d9[_0x4c4c('0xfe')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1ce'));}else{_0x2707d9[_0x4c4c('0xfc')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1ce'));}}break;case'20':_0x18cc17[_0x4c4c('0x6a')]+=0x1;_0x1b339f['state']=0x14;_0x1b339f[_0x4c4c('0xa8')]=_0x4c4c('0x1cf');_0x1b339f[_0x4c4c('0x10c')]+=0x1;_0x1b339f[_0x4c4c('0xf3')]+=0x1;_0x1c9932=_0x18cc17[_0x4c4c('0x1d0')];_0xf04c18=_0x18cc17[_0x4c4c('0x133')];ami[_0x4c4c('0xf4')](_0x4c4c('0x1d1'),ut[_0x4c4c('0xed')](_0x48e02d,'agentreject'));_0x2707d9['createHistory'](_0x1b339f)[_0x4c4c('0xb3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2707d9[_0x4c4c('0x1ad')](0x14,_0x48e02d,_0x18cc17)&&!_0x4a4579){if(_0x1b339f['countagentrejectretry']>=_0x18cc17[_0x4c4c('0x1b6')]){_0x2707d9[_0x4c4c('0xfe')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1d2'));}else{_0x2707d9[_0x4c4c('0xfc')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x4c4c('0x1d2'));}}break;default:_0x18cc17[_0x4c4c('0x6b')]+=0x1;_0x1b339f[_0x4c4c('0xe9')]=0xc;_0x1b339f[_0x4c4c('0xa8')]=_0x101b0f[_0x4c4c('0x117')];_0x1c9932=_0x18cc17[_0x4c4c('0x1d0')];_0xf04c18=_0x18cc17['callAdditionalPhoneAfterMin'];_0x2707d9[_0x4c4c('0xd1')](_0x1b339f)[_0x4c4c('0xb3')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2707d9[_0x4c4c('0x1ad')](_0x101b0f[_0x4c4c('0x117')],_0x48e02d,_0x18cc17)&&!_0x4a4579){if(_0x1b339f[_0x4c4c('0xf6')]+_0x1b339f[_0x4c4c('0x10b')]+_0x1b339f[_0x4c4c('0xf7')]+_0x1b339f[_0x4c4c('0xf8')]+_0x1b339f[_0x4c4c('0xf9')]+_0x1b339f[_0x4c4c('0xfa')]+_0x1b339f[_0x4c4c('0xf2')]+_0x1b339f[_0x4c4c('0x10c')]>=_0x18cc17[_0x4c4c('0xfb')]){_0x2707d9[_0x4c4c('0xfc')](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x101b0f[_0x4c4c('0x117')]);}else{_0x2707d9['createStateFinal'](_0x1b339f,_0x38d93e,_0x6bd8d0,_0x101b0f[_0x4c4c('0x117')]);}}}})[_0x4c4c('0x3e')](function(){if(_0x4a4579){_0x2707d9[_0x4c4c('0xc1')](_0x1b339f,_0x1c9932,_0xf04c18)[_0x4c4c('0x3e')](function(){return _0x38d93e(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x294b49,_0x9e7bd1,_0x4e408c,_0xa48b70){var _0x584bd3=new Final(_0x294b49);_0x584bd3[_0x4c4c('0xe9')]=0xf;_0x584bd3['statedesc']=_0x4c4c('0x1d3');this[_0x4c4c('0xfe')](_0x584bd3,_0x9e7bd1,_0x4e408c,_0xa48b70);};Dialer['prototype'][_0x4c4c('0xfe')]=function(_0x343f1a,_0x38615b,_0x2dfe1b,_0x32998d){this[_0x4c4c('0xd0')](_0x343f1a)[_0x4c4c('0x3e')](function(){return _0x38615b(msgResponse(_0x4c4c('0x1b8'),'Success',_0x32998d));})[_0x4c4c('0xb3')](function(){return _0x2dfe1b(msgResponse(_0x4c4c('0x1d4'),_0x4c4c('0x157'),_0x4c4c('0x1d5')));});};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x9')]=function(_0x5298fd){var _0x57721e=_0x5298fd[_0x4c4c('0x1d6')]/0x64;var _0x56ed54=_0x5298fd[_0x4c4c('0x67')]/(_0x5298fd['outboundDropCallsDayTimeout']+_0x5298fd[_0x4c4c('0x62')]);var _0x508f7e=Math[_0x4c4c('0x1d7')](_0x5298fd['predictiveIntervalAvailable']*(_0x5298fd[_0x4c4c('0x1d8')]/0x64));var _0x195ebc=Math[_0x4c4c('0x1d7')](_0x5298fd['predictiveIntervalAvailable']*(_0x5298fd[_0x4c4c('0x1d9')]/0x64));var _0x29524b=_0x5298fd[_0x4c4c('0xa2')]+_0x5298fd[_0x4c4c('0x59')];var _0x354098=Math['floor'](_0x5298fd[_0x4c4c('0x8d')]*_0x5298fd[_0x4c4c('0x1da')]*_0x5298fd[_0x4c4c('0x73')]*_0x5298fd[_0x4c4c('0x1db')]);if(_[_0x4c4c('0x40')](_0x5298fd[_0x4c4c('0x2b')])){if(!_[_0x4c4c('0x40')](_0x5298fd[_0x4c4c('0x2a')])){_0x5298fd['startPredictive']=undefined;loggerPredictive[_0x4c4c('0x99')]('[startMethodPredictive][StartProgressive]',_0x4c4c('0x1dc'));}if(!_[_0x4c4c('0x40')](_0x5298fd[_0x4c4c('0x93')])){loggerPredictive[_0x4c4c('0x99')](_0x4c4c('0x1dd'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5298fd[_0x4c4c('0x93')]);_0x5298fd[_0x4c4c('0x93')]=undefined;}_0x5298fd[_0x4c4c('0x2b')]=moment()['format'](_0x4c4c('0x103'));loggerPredictive[_0x4c4c('0x81')](_0x5298fd[_0x4c4c('0x43')],_0x4c4c('0x1de'),_0x5298fd['startProgressive']);this['handlePower'](_0x5298fd,0x1);}else if(ifInterval(_0x5298fd['dialPredictiveInterval'],_0x5298fd['startProgressive'])){this[_0x4c4c('0x16f')](_0x5298fd,0x1);loggerPredictiveCalls[_0x4c4c('0x81')](_0x4c4c('0x1df'),_0x5298fd[_0x4c4c('0x2b')],_0x5298fd[_0x4c4c('0x43')]);_0x5298fd['erlangCalls']=0x0;_0x5298fd[_0x4c4c('0x72')]=0x0;}else if(_0x57721e<_0x56ed54&&_0x5298fd['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x5298fd);loggerPredictive[_0x4c4c('0x81')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x4c4c('0x1e0'),_0x56ed54,_0x4c4c('0x2b'),_0x5298fd[_0x4c4c('0x43')]);}else if(_0x354098<_0x5298fd[_0x4c4c('0x72')]&&_0x5298fd[_0x4c4c('0x1e1')]===_0x4c4c('0x1e2')){freeVariablesPredictive(_0x5298fd);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x1e3'),_0x4c4c('0x1e4'),_0x354098,_0x4c4c('0x1e5'),_0x5298fd[_0x4c4c('0x72')],'startProgressive',_0x5298fd[_0x4c4c('0x43')]);}else if(!ifInterval(_0x5298fd[_0x4c4c('0x1e6')],_0x5298fd[_0x4c4c('0x2b')])&&_[_0x4c4c('0x40')](_0x5298fd[_0x4c4c('0x2a')])&&!_[_0x4c4c('0x40')](_0x5298fd[_0x4c4c('0x2b')])){_0x5298fd[_0x4c4c('0x2a')]=moment()[_0x4c4c('0x7e')](_0x4c4c('0x103'));loggerPredictive[_0x4c4c('0x81')](_0x5298fd[_0x4c4c('0x43')],'started\x20in\x20predictive\x20at',_0x5298fd[_0x4c4c('0x2a')]);this[_0x4c4c('0xc5')](_0x5298fd['dialPredictiveInterval'])[_0x4c4c('0x3e')](this['getDataPredictive'](_0x5298fd))[_0x4c4c('0x3e')](mergeDataErlangB(_0x5298fd))['then'](this[_0x4c4c('0x1e7')](_0x5298fd))[_0x4c4c('0xb3')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5298fd));}else if(!ifInterval(_0x5298fd[_0x4c4c('0x1e6')],_0x5298fd[_0x4c4c('0x2a')])){_0x5298fd[_0x4c4c('0x72')]=0x0;_0x5298fd[_0x4c4c('0x2a')]=moment()[_0x4c4c('0x7e')](_0x4c4c('0x103'));loggerPredictive['info'](_0x5298fd['name'],_0x4c4c('0x1e8'),_0x5298fd[_0x4c4c('0x2a')]);clearInterval(_0x5298fd[_0x4c4c('0x93')]);_0x5298fd[_0x4c4c('0x93')]=undefined;this['averageHandleTime'](_0x5298fd['dialPredictiveInterval'])['then'](this[_0x4c4c('0x1e9')](_0x5298fd))[_0x4c4c('0x3e')](mergeDataErlangB(_0x5298fd))[_0x4c4c('0x3e')](this[_0x4c4c('0x1e7')](_0x5298fd))[_0x4c4c('0xb3')](loggerCatchPredictive(_0x4c4c('0x1ea'),_0x5298fd));}else if(_0x5298fd[_0x4c4c('0x75')]&&_0x29524b<_0x5298fd[_0x4c4c('0x75')]-_0x195ebc){freeVariablesPredictive(_0x5298fd);loggerPredictive[_0x4c4c('0x81')](_0x5298fd['name'],_0x4c4c('0x1eb'),_0x29524b,_0x4c4c('0x1ec'),_0x5298fd[_0x4c4c('0x75')],'-',_0x195ebc,'=',_0x5298fd[_0x4c4c('0x75')]-_0x195ebc,')');}else if(_0x5298fd['predictiveIntervalAvailable']&&_0x29524b>_0x5298fd[_0x4c4c('0x75')]+_0x508f7e){freeVariablesPredictive(_0x5298fd);loggerPredictive[_0x4c4c('0x81')](_0x5298fd[_0x4c4c('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x29524b,')\x20are\x20more\x20than\x20threshold\x20(',_0x5298fd[_0x4c4c('0x75')],'+',_0x508f7e,'=',_0x5298fd[_0x4c4c('0x75')]+_0x508f7e,')');}};Dialer['prototype'][_0x4c4c('0x1e9')]=function(_0x4d2022){var _0x3db570=this;return function(_0x20e70e){return new Promise(function(_0x3ed4e9,_0xf88466){_[_0x4c4c('0x13d')](_0x4d2022,_0x20e70e[0x0]);if(checkGetDataPredictive(_0x20e70e[0x0])){var _0x10d945=_0x4d2022[_0x4c4c('0x75')]=_0x4d2022['talking']+_0x4d2022['available'];var _0x4bf6d9=_0x4d2022[_0x4c4c('0x1e6')]*0x3c;var _0x468b81=_0x20e70e[0x0][_0x4c4c('0x6e')]+_0x20e70e[0x0][_0x4c4c('0x6d')];var _0x28c784=(_0x20e70e[0x0][_0x4c4c('0x6c')]+_0x20e70e[0x0][_0x4c4c('0x70')]+_0x20e70e[0x0][_0x4c4c('0x6f')])/_0x20e70e[0x0][_0x4c4c('0x76')];_0x4d2022[_0x4c4c('0x73')]=_0x28c784>0x0?_0x28c784:0x1;switch(_0x4d2022[_0x4c4c('0x1e1')]){case _0x4c4c('0x1e2'):var _0x39a4c8=_0x4d2022[_0x4c4c('0x1d6')]/0x64;return _0x3db570['abandonmentRate'](_0x10d945,_0x4bf6d9,_0x468b81,_0x28c784,_0x39a4c8)[_0x4c4c('0x3e')](function(_0x7d05bb){return _0x3ed4e9(_0x7d05bb);});case _0x4c4c('0x1ed'):var _0x17ebae=_0x4d2022[_0x4c4c('0x1d6')]/0x64;return _0x3db570[_0x4c4c('0x1ee')](_0x10d945,_0x4bf6d9,_0x468b81,_0x28c784,_0x17ebae)['then'](function(_0x216634){return _0x3ed4e9(_0x216634);});default:return _0xf88466(msgResponse(_0x4c4c('0x1ef'),_0x4c4c('0x157'),_0x4c4c('0x1f0')));}}else{return _0xf88466(msgResponse(_0x4c4c('0x1ef'),'Failure',_0x4c4c('0x1f1')));}});};};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x1f2')]=function(_0x4319b3){var _0x3d2414=this;return function(_0x590c17){return new Promise(function(_0x5a9a60,_0x263331){_[_0x4c4c('0x13d')](_0x4319b3,_0x590c17[0x0]);if(checkGetDataPredictive(_0x590c17[0x0])){loggerPredictive[_0x4c4c('0x81')](JSON[_0x4c4c('0x4e')](_0x590c17[0x0]));if(_0x4319b3[_0x4c4c('0x1e1')]===_0x4c4c('0x1e2')){return _0x3d2414[_0x4c4c('0xcf')](_0x4319b3['id'])['then'](function(_0x545bae){var _0x2b209c=_0x4319b3[_0x4c4c('0x55')]-_0x545bae[0x0][_0x4c4c('0x1f3')];var _0x43da93=_0x4319b3[_0x4c4c('0x1e6')]*0x3c;var _0x203d1c=_0x590c17[0x0][_0x4c4c('0x6e')]+_0x590c17[0x0][_0x4c4c('0x6d')];var _0x37bf29=(_0x590c17[0x0][_0x4c4c('0x6c')]+_0x590c17[0x0][_0x4c4c('0x70')]+_0x590c17[0x0][_0x4c4c('0x6f')])/_0x590c17[0x0][_0x4c4c('0x76')];var _0x2eee97=_0x4319b3[_0x4c4c('0x1d6')]/0x64;_0x4319b3[_0x4c4c('0x74')]=_0x545bae[0x0]['outboundQueuePauses']||0x0;_0x4319b3['predictiveIntervalHitRate']=_0x37bf29>0x0?_0x37bf29:0x1;return _0x3d2414[_0x4c4c('0x1f4')](_0x2b209c,_0x43da93,_0x203d1c,_0x37bf29,_0x2eee97);})['then'](function(_0x5e3721){return _0x5a9a60(_0x5e3721);})[_0x4c4c('0xb3')](function(_0x4772c7){return _0x263331(msgResponse(_0x4c4c('0x1f5'),_0x4c4c('0x157'),JSON[_0x4c4c('0x4e')](_0x4772c7)));});}if(_0x4319b3['dialPredictiveOptimization']===_0x4c4c('0x1ed')){return _0x3d2414[_0x4c4c('0xcf')](_0x4319b3['id'])[_0x4c4c('0x3e')](function(_0x282e69){var _0xa4df92=_0x4319b3[_0x4c4c('0x55')]-_0x282e69[0x0][_0x4c4c('0x1f3')];var _0x39199d=_0x4319b3['dialPredictiveInterval']*0x3c;var _0x342305=_0x590c17[0x0][_0x4c4c('0x6e')]+_0x590c17[0x0]['predictiveIntervalAvgHoldtime'];var _0x216a8e=(_0x590c17[0x0][_0x4c4c('0x6c')]+_0x590c17[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x590c17[0x0][_0x4c4c('0x6f')])/_0x590c17[0x0][_0x4c4c('0x76')];var _0x41e979=_0x4319b3['dialPredictiveOptimizationPercentage']/0x64;_0x4319b3['predictiveIntervalPauses']=_0x282e69[0x0][_0x4c4c('0x1f3')]||0x0;_0x4319b3[_0x4c4c('0x73')]=_0x216a8e>0x0?_0x216a8e:0x1;return _0x3d2414['busyFactor'](_0xa4df92,_0x39199d,_0x342305,_0x216a8e,_0x41e979);})[_0x4c4c('0x3e')](function(_0x94c695){return _0x5a9a60(_0x94c695);})['catch'](function(_0x34cd33){return _0x263331(msgResponse(_0x4c4c('0x1f5'),_0x4c4c('0x157'),JSON[_0x4c4c('0x4e')](_0x34cd33)));});}}else{return _0x263331(msgResponse(_0x4c4c('0x1ef'),'Failure','check\x20failure'));}});};};Dialer[_0x4c4c('0x1e')]['startMethodPredictive']=function(_0x514a3c){var _0x4daf75=this;return function(){var _0x49de4b=0x0;var _0x9f1f29=Math[_0x4c4c('0x1f6')](_0x514a3c[_0x4c4c('0x78')]*0x3e8);if(_0x9f1f29>0x0){_0x9f1f29=_0x9f1f29<0x64?0x64:_0x9f1f29;loggerPredictive[_0x4c4c('0x81')](_0x514a3c['name'],_0x4c4c('0x1f7'),_0x9f1f29,'milliseconds');_0x514a3c['handlePredictive']=setInterval(function(){_0x4daf75[_0x4c4c('0x93')](_0x514a3c);loggerPredictiveCalls[_0x4c4c('0x81')](_0x4c4c('0x1f8'),_0x49de4b+=0x1);},_0x9f1f29);}else{loggerPredictive[_0x4c4c('0x81')](_0x514a3c[_0x4c4c('0x43')],_0x4c4c('0x1f9'));}};};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x1fa')]=function(_0x20a446,_0x1e4e0d){var _0x595114=this;return function(_0x169640){if(_['isEmpty'](_0x169640)){if(_[_0x4c4c('0xe3')](_0x1e4e0d[_0x4c4c('0xd9')])||!_0x1e4e0d[_0x4c4c('0x1fb')]){if(_0x20a446[_0x4c4c('0x176')]===_0x4c4c('0x8')){_0x20a446[_0x4c4c('0x13f')]=_[_0x4c4c('0x40')](_0x20a446[_0x4c4c('0x13f')])?!![]:_0x20a446[_0x4c4c('0x13f')];var _0x455075=uuid['v4']();_0x595114[_0x4c4c('0xab')][_0x455075]=new Action(_0x20a446,_0x1e4e0d,_0x455075);loggerBooked[_0x4c4c('0x81')](_0x4c4c('0x1fc'),_0x455075,_0x4c4c('0x1fd'),JSON[_0x4c4c('0x4e')](_0x20a446[_0x4c4c('0x13f')]),_0x4c4c('0x1fe'),_0x20a446[_0x4c4c('0x43')]);if(_0x20a446['queueStatusComplete']){_0x20a446['queueStatusComplete']=![];_0x595114[_0x4c4c('0x13b')][_0x595114[_0x4c4c('0xab')][_0x455075][_0x4c4c('0xb7')]]=[];ami[_0x4c4c('0xb0')]({'actionid':_0x455075,'action':_0x4c4c('0x1ff'),'queue':_0x20a446['name']})['catch'](function(){_0x595114[_0x4c4c('0xb6')](_0x20a446);_0x595114[_0x4c4c('0xc8')]({'active':![],'ContactId':_0x595114[_0x4c4c('0xab')][_0x455075][_0x4c4c('0xd7')],'ListId':_0x595114[_0x4c4c('0xab')][_0x455075][_0x4c4c('0xd8')],'VoiceQueueId':_0x595114['actions'][_0x455075]['VoiceQueueId']||undefined,'CampaignId':_0x595114[_0x4c4c('0xab')][_0x455075]['CampaignId']||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x200')));delete _0x595114['actions'][_0x455075];});}else{loggerBooked[_0x4c4c('0x81')](_0x4c4c('0x201'),JSON[_0x4c4c('0x4e')](_0x20a446['queueStatusComplete']),_0x4c4c('0x1fe'),_0x20a446['name']);_0x595114[_0x4c4c('0xb6')](_0x20a446);_0x595114[_0x4c4c('0xc8')]({'active':![],'ContactId':_0x595114[_0x4c4c('0xab')][_0x455075]['ContactId'],'ListId':_0x595114[_0x4c4c('0xab')][_0x455075][_0x4c4c('0xd8')],'VoiceQueueId':_0x595114[_0x4c4c('0xab')][_0x455075][_0x4c4c('0x10e')]||undefined,'CampaignId':_0x595114[_0x4c4c('0xab')][_0x455075][_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x200')));delete _0x595114[_0x4c4c('0xab')][_0x455075];}}else{return _0x595114[_0x4c4c('0x181')](_0x20a446,_0x1e4e0d);}}else{if(getDiff(_0x1e4e0d[_0x4c4c('0x202')])<_0x20a446[_0x4c4c('0x203')]*0x3c){if(_0x1e4e0d[_0x4c4c('0x17d')]&&!_0x1e4e0d[_0x4c4c('0x17d')]['voicePause']){_0x595114['preview'][_0x4c4c('0x141')](_0x1e4e0d['id'])[_0x4c4c('0x20')](function(){_0x595114[_0x4c4c('0xb6')](_0x20a446);});}else{_0x595114[_0x4c4c('0xca')]({'active':![]},_0x1e4e0d['id'],0x1)['finally'](function(){_0x595114['updateOriginated'](_0x20a446);});}}else{_0x20a446['outboundReCallsDay']+=0x1;_0x595114[_0x4c4c('0xb6')](_0x20a446);if(_0x20a446[_0x4c4c('0x204')]){_0x595114[_0x4c4c('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1e4e0d[_0x4c4c('0xd7')],'ListId':_0x1e4e0d[_0x4c4c('0xd8')],'VoiceQueueId':_0x1e4e0d[_0x4c4c('0x10e')]||undefined,'CampaignId':_0x1e4e0d[_0x4c4c('0x104')]||undefined})[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x205')));_0x595114[_0x4c4c('0xd1')](createObjHistory(_0x20a446,_0x1e4e0d,_0x4c4c('0x206'),0x17,_0x4c4c('0x207')))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0x208')));}else{_0x595114[_0x4c4c('0xd5')](createObjHistory(_0x20a446,_0x1e4e0d,'RECALLFAILEDTIMEOUT',0x16,_0x4c4c('0x209')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x20a446[_0x4c4c('0x63')]+=0x1;_0x595114['saveInDb'](createObjHistory(_0x20a446,_0x1e4e0d,_0x4c4c('0x20a'),0xd,_0x4c4c('0x20b')),_0x4c4c('0x20c'),_0x4c4c('0x20d'));throw'inBlackList';}};};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x175')]=function(_0x2795f0){var _0x4a8fa1=this;var _0x29823d=_0x2795f0['limitCalls']-_0x2795f0[_0x4c4c('0x77')]-_0x2795f0[_0x4c4c('0xcc')];emitCampaignSummary(_0x2795f0);if(_0x29823d>0x0){if(_0x29823d>this[_0x4c4c('0x20e')]){_0x29823d=this[_0x4c4c('0x20e')];}_0x2795f0[_0x4c4c('0xcc')]+=_0x29823d;this[_0x4c4c('0xce')](_0x2795f0['id'],_0x29823d,_0x2795f0[_0x4c4c('0x20f')],_0x2795f0)['then'](function(_0x3a85c6){_0x2795f0[_0x4c4c('0xcc')]-=_0x29823d;_0x2795f0[_0x4c4c('0xcc')]=_0x2795f0['temp']>0x0?_0x2795f0[_0x4c4c('0xcc')]:0x0;if(!checkContactEmpty(_0x3a85c6)){_0x2795f0[_0x4c4c('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4c4c('0x81')]('[getContactCampaign2][Empty]'+_0x2795f0[_0x4c4c('0x43')]);}else{_0x2795f0['originated']+=_0x3a85c6['length'];_0x2795f0[_0x4c4c('0x41')]=_0x4c4c('0x210');for(var _0x4bf0d8=0x0;_0x4bf0d8<_0x3a85c6['length'];_0x4bf0d8+=0x1){_0x2795f0['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x3a85c6[_0x4bf0d8])||_['isNil'](_0x3a85c6[_0x4bf0d8]['Contact'])||_[_0x4c4c('0xe3')](_0x3a85c6[_0x4bf0d8][_0x4c4c('0x185')])){_0x4a8fa1['emptyContact'](_0x4c4c('0x211'),_0x2795f0,_0x3a85c6[_0x4bf0d8]);}else{_0x4a8fa1[_0x4c4c('0xc3')](_[_0x4c4c('0xd6')](_0x3a85c6[_0x4bf0d8],['CampaignId','Contact.phone']))[_0x4c4c('0x3e')](_0x4a8fa1[_0x4c4c('0x1fa')](_0x2795f0,_0x3a85c6[_0x4bf0d8]))[_0x4c4c('0xb3')](_0x4a8fa1[_0x4c4c('0xd3')]('[actionOriginateIvr]\x20',_0x2795f0));}}}})[_0x4c4c('0xb3')](loggerGetContactDialer('[getContactCampaign2]',_0x2795f0,_0x29823d));}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x16f')]=function(_0x3eac30,_0x552f74){var _0x375127=this;var _0x3272b2=[];var _0x3b2b6a=_0x552f74>=0x1?_0x552f74:0x1;if(_0x3eac30['dialMethod']===_0x4c4c('0x8')){_0x3b2b6a=0x1;}var _0x2ad8ac=Math[_0x4c4c('0x1f6')](_0x3eac30[_0x4c4c('0xa2')]*_0x3b2b6a)-_0x3eac30['originated']-_0x3eac30[_0x4c4c('0xcc')];emitVoiceQueueSummary(_0x3eac30);if(_0x3eac30[_0x4c4c('0x212')]>0x0){var _0x27121c=_0x3eac30[_0x4c4c('0x212')]-_0x3eac30['originated']-_0x3eac30['talking']-_0x3eac30[_0x4c4c('0xcc')]-_0x3eac30[_0x4c4c('0x56')];if(_0x2ad8ac>_0x27121c){_0x2ad8ac=_0x27121c;}}if(_0x2ad8ac>0x0){if(_0x3eac30[_0x4c4c('0x176')]===_0x4c4c('0x8')){_0x2ad8ac=0x1;}if(_0x2ad8ac>this['maxNumberOriginate']){_0x2ad8ac=this[_0x4c4c('0x20e')];}_0x3eac30[_0x4c4c('0xcc')]+=_0x2ad8ac;for(var _0xbfe55f in this[_0x4c4c('0x24')]){if(typeof this[_0x4c4c('0x24')][_0xbfe55f]!=='undefined'){if(this[_0x4c4c('0x24')][_0xbfe55f][_0x4c4c('0xe9')]===_0x4c4c('0x213')&&this[_0x4c4c('0x24')][_0xbfe55f]['status']===_0x4c4c('0xdf')){_0x3272b2['push'](this[_0x4c4c('0x24')][_0xbfe55f]['id']);}}}this['getContactDialer'](_0x3eac30['id'],_0x3272b2,_0x2ad8ac,_0x3eac30[_0x4c4c('0x20f')],_0x3eac30)[_0x4c4c('0x3e')](function(_0x335cea){_0x3eac30[_0x4c4c('0xcc')]-=_0x2ad8ac;_0x3eac30['temp']=_0x3eac30[_0x4c4c('0xcc')]>0x0?_0x3eac30[_0x4c4c('0xcc')]:0x0;if(!checkContactEmpty(_0x335cea)){_0x375127['countReScheduled'](_0x3eac30)[_0x4c4c('0x3e')](sendMessageReschedule(_0x3eac30))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xbc')));}else{_0x3eac30['originated']+=_0x335cea['length'];_0x3eac30[_0x4c4c('0x41')]=_0x3eac30['dialMethod']==='booked'?_0x4c4c('0x18d'):_0x4c4c('0x210');for(var _0x278a4c=0x0;_0x278a4c<_0x335cea[_0x4c4c('0x9b')];_0x278a4c+=0x1){if(_['isNil'](_0x335cea[_0x278a4c])||_[_0x4c4c('0xe3')](_0x335cea[_0x278a4c][_0x4c4c('0x19c')])||_[_0x4c4c('0xe3')](_0x335cea[_0x278a4c][_0x4c4c('0x185')])){_0x375127[_0x4c4c('0x214')](_0x4c4c('0x211'),_0x3eac30,_0x335cea[_0x278a4c]);}else{_0x375127[_0x4c4c('0xbd')](_[_0x4c4c('0xd6')](_0x335cea[_0x278a4c],[_0x4c4c('0x10e'),'Contact.phone']))[_0x4c4c('0x3e')](_0x375127[_0x4c4c('0x1fa')](_0x3eac30,_0x335cea[_0x278a4c]))[_0x4c4c('0xb3')](_0x375127['loggerHandler'](_0x4c4c('0x211'),_0x3eac30));}}}})[_0x4c4c('0xb3')](loggerGetContactDialer(_0x4c4c('0x215'),_0x3eac30,_0x2ad8ac));}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x93')]=function(_0x19ce4d){if(_0x19ce4d[_0x4c4c('0x212')]>0x0){var _0x840def=_0x19ce4d['dialLimitQueue']-_0x19ce4d['originated']-_0x19ce4d[_0x4c4c('0x59')];if(_0x840def>0x0){this[_0x4c4c('0x216')](_0x19ce4d);}else{loggerPredictiveCalls[_0x4c4c('0x81')](_0x4c4c('0x217'));}}else{this[_0x4c4c('0x216')](_0x19ce4d);}};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x216')]=function(_0x3a10ea){var _0x5a8e01=this;var _0x4566ef=[];_0x3a10ea['originated']+=0x1;for(var _0x2d0832 in this[_0x4c4c('0x24')]){if(typeof this[_0x4c4c('0x24')][_0x2d0832]!==_0x4c4c('0xae')){if(this['agents'][_0x2d0832][_0x4c4c('0xe9')]===_0x4c4c('0x213')&&this['agents'][_0x2d0832][_0x4c4c('0xb1')]==='reachable'){_0x4566ef['push'](this[_0x4c4c('0x24')][_0x2d0832]['id']);}}}this[_0x4c4c('0x218')](_0x3a10ea['id'],_0x4566ef,0x1,_0x3a10ea['dialOrderByScheduledAt'],_0x3a10ea)[_0x4c4c('0x3e')](function(_0x524ba7){if(!checkContactEmpty(_0x524ba7)){checkContactLowerLimitOriginate(_0x3a10ea,0x1,0x0);_0x5a8e01[_0x4c4c('0xba')](_0x3a10ea)['then'](sendMessageReschedule(_0x3a10ea))[_0x4c4c('0xb3')](loggerCatch(_0x4c4c('0xbc')));}else{_0x3a10ea['message']=_0x4c4c('0x210');if(_[_0x4c4c('0xe3')](_0x524ba7[0x0])||_['isNil'](_0x524ba7[0x0]['Contact'])||_[_0x4c4c('0xe3')](_0x524ba7[0x0]['phone'])){_0x5a8e01['emptyContact'](_0x4c4c('0x211'),_0x3a10ea,_0x524ba7[0x0]);}else{_0x5a8e01[_0x4c4c('0xbd')](_[_0x4c4c('0xd6')](_0x524ba7[0x0],[_0x4c4c('0x10e'),_0x4c4c('0x219')]))[_0x4c4c('0x3e')](_0x5a8e01['checkContactBlack'](_0x3a10ea,_0x524ba7[0x0]))[_0x4c4c('0xb3')](_0x5a8e01[_0x4c4c('0xd3')]('[actionOriginatePredictive]\x20',_0x3a10ea));}}})[_0x4c4c('0xb3')](loggerGetContactDialer(_0x4c4c('0x21a'),_0x3a10ea,0x1));emitVoiceQueueSummary(_0x3a10ea);};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x1f4')]=function(_0x560a75,_0x29b18d,_0x3d2026,_0x687c65,_0x21b2a3,_0x2f8697){loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x21b'));loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x21c'),_0x560a75);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x21d'),_0x29b18d);loggerPredictive[_0x4c4c('0x81')]('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',_0x3d2026);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x21e'),_0x687c65);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x21f'),_0x21b2a3);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x87'));return new Promise(function(_0x311c9c,_0xc5c6d6){if(_0x560a75<=0x0||isNaN(_0x560a75)){return _0xc5c6d6(msgResponse(_0x4c4c('0x220'),_0x4c4c('0x4d'),_0x4c4c('0x221')+_0x560a75));}if(_0x3d2026<=0x0||isNaN(_0x3d2026)){return _0xc5c6d6(msgResponse('[abandonmentRate]','Error',_0x4c4c('0x222')+_0x3d2026));}if(_0x687c65<=0x0||isNaN(_0x687c65)){return _0xc5c6d6(msgResponse(_0x4c4c('0x220'),'Error',_0x4c4c('0x223')+_0x687c65));}if(_0x29b18d<=0x0||isNaN(_0x29b18d)){return _0xc5c6d6(msgResponse(_0x4c4c('0x220'),'Error','interval\x20=\x20'+_0x29b18d));}if(_0x21b2a3<=0x0||isNaN(_0x21b2a3)){return _0xc5c6d6(msgResponse(_0x4c4c('0x220'),_0x4c4c('0x4d'),_0x4c4c('0x224')+_0x21b2a3));}_0x2f8697=_0x2f8697||0x0;var _0x3292d4=0x1/_0x3d2026;var _0xf2dee0=0x0;var _0x256d70=0x0;var _0x2872c9=0x0;var _0x4cd48a=0x0;for(var _0x225e18=0x0;_0x2872c9<_0x21b2a3;_0x225e18+=0x1){_0x256d70=_0x225e18/_0x29b18d;_0xf2dee0=(_0x687c65*_0x256d70+_0x2f8697)/_0x3292d4;_0x2872c9=erlangb(_0xf2dee0,_0x560a75);_0x4cd48a=_0xf2dee0/_0x560a75*(0x1-erlangb(_0xf2dee0,_0x560a75));}return _0x311c9c({'erlangCalls':_0x225e18,'erlangCallToSecond':_0x29b18d/_0x225e18,'erlangAbandonmentRate':_0x2872c9,'erlangBusyFactor':_0x4cd48a});});};Dialer[_0x4c4c('0x1e')][_0x4c4c('0x1ee')]=function(_0x3d73c0,_0x561d5a,_0x4cf8fe,_0x5ec3b8,_0x1b6b42,_0x20482a){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x21c'),_0x3d73c0);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x21d'),_0x561d5a);loggerPredictive[_0x4c4c('0x81')]('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',_0x4cf8fe);loggerPredictive['info'](_0x4c4c('0x21e'),_0x5ec3b8);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x225'),_0x1b6b42);loggerPredictive[_0x4c4c('0x81')](_0x4c4c('0x87'));return new Promise(function(_0x12c2a2,_0x44c71a){if(_0x3d73c0<=0x0||isNaN(_0x3d73c0)){return _0x44c71a(msgResponse(_0x4c4c('0x226'),_0x4c4c('0x4d'),_0x4c4c('0x221')+_0x3d73c0));}if(_0x4cf8fe<=0x0||isNaN(_0x4cf8fe)){return _0x44c71a(msgResponse('[busyFactor]',_0x4c4c('0x4d'),_0x4c4c('0x222')+_0x4cf8fe));}if(_0x5ec3b8<=0x0||isNaN(_0x5ec3b8)){return _0x44c71a(msgResponse(_0x4c4c('0x226'),_0x4c4c('0x4d'),'p\x20=\x20'+_0x5ec3b8));}if(_0x561d5a<=0x0||isNaN(_0x561d5a)){return _0x44c71a(msgResponse(_0x4c4c('0x226'),'Error',_0x4c4c('0x227')+_0x561d5a));}if(_0x1b6b42<=0x0||isNaN(_0x1b6b42)){return _0x44c71a(msgResponse(_0x4c4c('0x226'),_0x4c4c('0x4d'),_0x4c4c('0x228')+_0x1b6b42));}_0x20482a=_0x20482a||0x0;var _0x1a58e6=0x1/_0x4cf8fe;var _0x49aa67=0x0;var _0x26df2b=0x0;var _0x56dd19=0x0;var _0xd7feef=0x0;for(var _0x5b58dc=0x0;_0xd7feef<_0x1b6b42;_0x5b58dc+=0x1){_0x26df2b=_0x5b58dc/_0x561d5a;_0x49aa67=(_0x5ec3b8*_0x26df2b+_0x20482a)/_0x1a58e6;_0x56dd19=erlangb(_0x49aa67,_0x3d73c0);_0xd7feef=_0x49aa67/_0x3d73c0*(0x1-erlangb(_0x49aa67,_0x3d73c0));}return _0x12c2a2({'erlangCalls':_0x5b58dc,'erlangCallToSecond':_0x561d5a/_0x5b58dc,'erlangAbandonmentRate':_0x56dd19,'erlangBusyFactor':_0xd7feef});});};module[_0x4c4c('0x229')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 3c2914a..9cdce0c 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c81=['seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','droptime','endtime','responsetime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds'];(function(_0x5626c8,_0x3499f9){var _0x138a7d=function(_0x136367){while(--_0x136367){_0x5626c8['push'](_0x5626c8['shift']());}};_0x138a7d(++_0x3499f9);}(_0x8c81,0x16d));var _0x18c8=function(_0x215be5,_0x36ab76){_0x215be5=_0x215be5-0x0;var _0x5d0361=_0x8c81[_0x215be5];return _0x5d0361;};'use strict';var util=require(_0x18c8('0x0'));var _=require(_0x18c8('0x1'));var moment=require(_0x18c8('0x2'));function getSeconds(_0x3b8fda,_0x3e25e0){var _0x499cd1=moment(_0x3b8fda)[_0x18c8('0x3')](0x0);var _0x1a7cf7=moment(_0x3e25e0)[_0x18c8('0x3')](0x0);return _0x499cd1['diff'](_0x1a7cf7,_0x18c8('0x4'));}function QueueCallerAbandon(_0x4334f9,_0xea115a){this['scheduledat']=_0x4334f9[_0x18c8('0x5')];this[_0x18c8('0x6')]=_0x4334f9[_0x18c8('0x6')];this['campaigntype']=_0x4334f9[_0x18c8('0x6')]===_0x18c8('0x7')?_0x18c8('0x8'):_0x4334f9[_0x18c8('0x6')];this[_0x18c8('0x9')]=_0x4334f9[_0x18c8('0x9')];this[_0x18c8('0xa')]=_0x4334f9['countcongestionretry'];this['countnoanswerretry']=_0x4334f9[_0x18c8('0xb')];this[_0x18c8('0xc')]=_0x4334f9[_0x18c8('0x9')]+_0x4334f9['countcongestionretry']+_0x4334f9[_0x18c8('0xb')]+_0x4334f9[_0x18c8('0xd')]+_0x4334f9[_0x18c8('0xe')]+_0x4334f9[_0x18c8('0xf')]+_0x4334f9[_0x18c8('0x10')]+_0x4334f9[_0x18c8('0x11')];this[_0x18c8('0xd')]=_0x4334f9[_0x18c8('0xd')];this['countdropretry']=_0x4334f9[_0x18c8('0xe')];this['countabandonedretry']=_0x4334f9[_0x18c8('0xf')];this[_0x18c8('0x10')]=_0x4334f9[_0x18c8('0x10')];this[_0x18c8('0x11')]=_0x4334f9['countagentrejectretry'];this[_0x18c8('0x12')]=_0xea115a['uniqueid'];this['calleridname']=_0x4334f9['name'];this[_0x18c8('0x13')]=_0x4334f9[_0x18c8('0x14')];this[_0x18c8('0x15')]=_0x4334f9[_0x18c8('0x15')];this['responsetime']=_0x4334f9['responsetime'];this[_0x18c8('0x16')]=_0x4334f9[_0x18c8('0x16')];this[_0x18c8('0x17')]=this[_0x18c8('0x16')];this['ringtime']=getSeconds(_0x4334f9[_0x18c8('0x18')],_0x4334f9[_0x18c8('0x15')]);this[_0x18c8('0x19')]=getSeconds(this[_0x18c8('0x16')],_0x4334f9[_0x18c8('0x18')]);this[_0x18c8('0x1a')]=0x0;this[_0x18c8('0x8')]=_0xea115a[_0x18c8('0x8')];this['membername']=_0xea115a[_0x18c8('0x1b')];this['reason']=_0xea115a[_0x18c8('0x1c')];this['callback']=_0x4334f9[_0x18c8('0x1d')];this[_0x18c8('0x1e')]=_0x4334f9['callbackuniqueid'];this[_0x18c8('0x1f')]=_0x4334f9[_0x18c8('0x1f')];this[_0x18c8('0x20')]=_0x4334f9['recallme'];this[_0x18c8('0x21')]=_0x4334f9[_0x18c8('0x21')];this['ListId']=_0x4334f9[_0x18c8('0x22')];this['UserId']=_0x4334f9[_0x18c8('0x23')];this[_0x18c8('0x24')]=_0x4334f9[_0x18c8('0x24')];this[_0x18c8('0x25')]=_0x4334f9[_0x18c8('0x25')];this[_0x18c8('0x26')]=_0x4334f9[_0x18c8('0x26')]||'';this[_0x18c8('0x27')]=_0x4334f9[_0x18c8('0x27')]||'';}module[_0x18c8('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0x5fed=['countnosuchnumberretry','countabandonedretry','uniqueid','name','number','starttime','responsetime','droptime','endtime','ringtime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5fed,0x1a7));var _0xd5fe=function(_0x2d97fa,_0x5b488a){_0x2d97fa=_0x2d97fa-0x0;var _0x575d9c=_0x5fed[_0x2d97fa];return _0x575d9c;};'use strict';var util=require(_0xd5fe('0x0'));var _=require(_0xd5fe('0x1'));var moment=require(_0xd5fe('0x2'));function getSeconds(_0x392169,_0x418c3b){var _0x481ef4=moment(_0x392169)[_0xd5fe('0x3')](0x0);var _0x1bc337=moment(_0x418c3b)[_0xd5fe('0x3')](0x0);return _0x481ef4['diff'](_0x1bc337,_0xd5fe('0x4'));}function QueueCallerAbandon(_0x2a2307,_0x27c81f){this[_0xd5fe('0x5')]=_0x2a2307[_0xd5fe('0x5')];this['type']=_0x2a2307['type'];this[_0xd5fe('0x6')]=_0x2a2307[_0xd5fe('0x7')]===_0xd5fe('0x8')?_0xd5fe('0x9'):_0x2a2307[_0xd5fe('0x7')];this['countbusyretry']=_0x2a2307[_0xd5fe('0xa')];this[_0xd5fe('0xb')]=_0x2a2307[_0xd5fe('0xb')];this[_0xd5fe('0xc')]=_0x2a2307[_0xd5fe('0xc')];this[_0xd5fe('0xd')]=_0x2a2307[_0xd5fe('0xa')]+_0x2a2307[_0xd5fe('0xb')]+_0x2a2307['countnoanswerretry']+_0x2a2307['countnosuchnumberretry']+_0x2a2307[_0xd5fe('0xe')]+_0x2a2307['countabandonedretry']+_0x2a2307[_0xd5fe('0xf')]+_0x2a2307[_0xd5fe('0x10')];this[_0xd5fe('0x11')]=_0x2a2307[_0xd5fe('0x11')];this[_0xd5fe('0xe')]=_0x2a2307['countdropretry'];this[_0xd5fe('0x12')]=_0x2a2307['countabandonedretry'];this[_0xd5fe('0xf')]=_0x2a2307[_0xd5fe('0xf')];this[_0xd5fe('0x10')]=_0x2a2307[_0xd5fe('0x10')];this['uniqueid']=_0x27c81f[_0xd5fe('0x13')];this['calleridname']=_0x2a2307[_0xd5fe('0x14')];this['calleridnum']=_0x2a2307[_0xd5fe('0x15')];this['starttime']=_0x2a2307[_0xd5fe('0x16')];this[_0xd5fe('0x17')]=_0x2a2307[_0xd5fe('0x17')];this[_0xd5fe('0x18')]=_0x2a2307[_0xd5fe('0x18')];this[_0xd5fe('0x19')]=this['droptime'];this[_0xd5fe('0x1a')]=getSeconds(_0x2a2307[_0xd5fe('0x17')],_0x2a2307[_0xd5fe('0x16')]);this['holdtime']=getSeconds(this[_0xd5fe('0x18')],_0x2a2307[_0xd5fe('0x17')]);this['talktime']=0x0;this['queue']=_0x27c81f[_0xd5fe('0x9')];this['membername']=_0x27c81f[_0xd5fe('0x1b')];this[_0xd5fe('0x1c')]=_0x27c81f[_0xd5fe('0x1c')];this[_0xd5fe('0x1d')]=_0x2a2307[_0xd5fe('0x1d')];this['callbackuniqueid']=_0x2a2307[_0xd5fe('0x1e')];this[_0xd5fe('0x1f')]=_0x2a2307[_0xd5fe('0x1f')];this['recallme']=_0x2a2307[_0xd5fe('0x20')];this[_0xd5fe('0x21')]=_0x2a2307[_0xd5fe('0x21')];this[_0xd5fe('0x22')]=_0x2a2307[_0xd5fe('0x22')];this['UserId']=_0x2a2307[_0xd5fe('0x23')];this['VoiceQueueId']=_0x2a2307[_0xd5fe('0x24')];this[_0xd5fe('0x25')]=_0x2a2307[_0xd5fe('0x25')];this['originatecalleridnum']=_0x2a2307[_0xd5fe('0x26')]||'';this[_0xd5fe('0x27')]=_0x2a2307[_0xd5fe('0x27')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 680c7b0..d62c89a 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(_0x10b4ea,_0xbfdd15){var _0x527054=function(_0x241be6){while(--_0x241be6){_0x10b4ea['push'](_0x10b4ea['shift']());}};_0x527054(++_0xbfdd15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0xd5d76f,_0x3baa98){var _0x84dcf=function(_0x27cb16){while(--_0x27cb16){_0xd5d76f['push'](_0xd5d76f['shift']());}};_0x84dcf(++_0x3baa98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 a5cbeb0..1a4c397 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 _0x777d=['Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','path','tiff2pdf','../ami','./channel','./action','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','name','info','uniqueid','\x20syncNewchannel\x20','channel','variable','value','syncNewState','channelstate','channelstatedesc','status','localstationid','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','error','catch','\x20receiveFax\x20','stringify','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','Fax\x20received','checkAfterSend','checkTrunk','Trunk','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','dir','XMF-PATH'];(function(_0x3f46a2,_0x48542e){var _0xd82e3e=function(_0x49fb2b){while(--_0x49fb2b){_0x3f46a2['push'](_0x3f46a2['shift']());}};_0xd82e3e(++_0x48542e);}(_0x777d,0xe9));var _0xd777=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0x777d[_0x3df3c6];return _0x254c43;};'use strict';var util=require('util');var _=require(_0xd777('0x0'));var BPromise=require(_0xd777('0x1'));var uuid=require(_0xd777('0x2'));var moment=require('moment');var path=require(_0xd777('0x3'));var tiff2pdf=require(_0xd777('0x4'));var gs=require('./util/gs');var logger=require('../../../config/logger')('fax');var ami=require(_0xd777('0x5'));var rpcDb=require('./rpcDb');var Channel=require(_0xd777('0x6'));var ut=require('./util/util');var Action=require(_0xd777('0x7'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x197296){this[_0xd777('0x8')]={};this[_0xd777('0x9')]=_0x197296[_0xd777('0x9')];this[_0xd777('0xa')]=_0x197296[_0xd777('0xa')];this[_0xd777('0xb')]={};ami['on'](_0xd777('0xc'),this[_0xd777('0xd')][_0xd777('0xe')](this));ami['on'](_0xd777('0xf'),this[_0xd777('0x10')][_0xd777('0xe')](this));ami['on']('newstate',this['syncNewState'][_0xd777('0xe')](this));ami['on']('newexten',this[_0xd777('0x11')][_0xd777('0xe')](this));ami['on'](_0xd777('0x12'),this[_0xd777('0x13')][_0xd777('0xe')](this));ami['on']('receivefax',this[_0xd777('0x14')]['bind'](this));ami['on'](_0xd777('0x15'),this[_0xd777('0x16')][_0xd777('0xe')](this));ami['on'](_0xd777('0x17'),this[_0xd777('0x18')]['bind'](this));}Fax[_0xd777('0x19')]['syncNewchannel']=function(_0x39b300){if(_0x39b300['context']===_0xd777('0x1a')){for(var _0x386f1a in this[_0xd777('0x9')]){if(this[_0xd777('0x9')][_0xd777('0x1b')](_0x386f1a)){if(_0x39b300[_0xd777('0x1c')]===this['faxAccounts'][_0x386f1a]['localstationid']){this[_0xd777('0x8')][_0x39b300['uniqueid']]={};this[_0xd777('0x8')][_0x39b300['uniqueid']]['channel']=_0x39b300['channel'];this[_0xd777('0x8')][_0x39b300['uniqueid']]['id']=this['faxAccounts'][_0x386f1a]['id'];this['channels'][_0x39b300['uniqueid']]['name']=this[_0xd777('0x9')][_0x386f1a][_0xd777('0x1d')];logger[_0xd777('0x1e')](_0x39b300[_0xd777('0x1f')],_0xd777('0x20'));}}}}if(this[_0xd777('0xb')][_0x39b300[_0xd777('0x1f')]]){this[_0xd777('0x8')][_0x39b300[_0xd777('0x1f')]]={};this[_0xd777('0x8')][_0x39b300[_0xd777('0x1f')]]['channel']=_0x39b300[_0xd777('0x21')];logger[_0xd777('0x1e')](_0x39b300[_0xd777('0x1f')],_0xd777('0x20'));}};Fax[_0xd777('0x19')]['syncVarSet']=function(_0x141e68){if(this['channels'][_0x141e68['uniqueid']]){for(var _0x2ff04b in _0x141e68[_0xd777('0x22')]){if(_0x141e68[_0xd777('0x22')][_0xd777('0x1b')](_0x2ff04b)){this['channels'][_0x141e68[_0xd777('0x1f')]][_0x2ff04b]=_0x141e68[_0xd777('0x23')];}}}};Fax[_0xd777('0x19')][_0xd777('0x24')]=function(_0xb63cf7){if(this[_0xd777('0x8')][_0xb63cf7[_0xd777('0x1f')]]){this[_0xd777('0x8')][_0xb63cf7['uniqueid']][_0xd777('0x25')]=_0xb63cf7['channelstate'];this['channels'][_0xb63cf7[_0xd777('0x1f')]][_0xd777('0x26')]=_0xb63cf7[_0xd777('0x26')];}};Fax[_0xd777('0x19')]['syncNewExten']=function(_0x540292){if(this[_0xd777('0x8')][_0x540292[_0xd777('0x1f')]]){for(var _0x1c8357 in _0x540292[_0xd777('0x22')]){if(_0x540292[_0xd777('0x22')][_0xd777('0x1b')](_0x1c8357)){this['channels'][_0x540292['uniqueid']][_0x1c8357]=_0x540292[_0xd777('0x23')];}}}};Fax[_0xd777('0x19')][_0xd777('0x13')]=function(_0x41f648){if(this[_0xd777('0x8')][_0x41f648[_0xd777('0x1f')]]){this[_0xd777('0x8')][_0x41f648[_0xd777('0x1f')]]['operation']=_0x41f648['operation'];this[_0xd777('0x8')][_0x41f648['uniqueid']][_0xd777('0x27')]=_0x41f648[_0xd777('0x27')];this[_0xd777('0x8')][_0x41f648[_0xd777('0x1f')]]['localstationid']=_0x41f648[_0xd777('0x28')];this['channels'][_0x41f648[_0xd777('0x1f')]]['filename']=_0x41f648['filename'];logger['info'](_0x41f648['uniqueid'],_0xd777('0x29'));}};Fax[_0xd777('0x19')][_0xd777('0x14')]=function(_0x4de2c2){var _0x51adbd=this;if(this['channels'][_0x4de2c2[_0xd777('0x1f')]]){var _0x21466=this[_0xd777('0x8')][_0x4de2c2[_0xd777('0x1f')]]['id'];this[_0xd777('0x8')][_0x4de2c2[_0xd777('0x1f')]][_0xd777('0x2a')]=_0x4de2c2[_0xd777('0x2a')];this[_0xd777('0x8')][_0x4de2c2[_0xd777('0x1f')]]['pagestransferred']=_0x4de2c2[_0xd777('0x2b')];this[_0xd777('0x8')][_0x4de2c2[_0xd777('0x1f')]][_0xd777('0x28')]=_0x4de2c2[_0xd777('0x28')];this[_0xd777('0x8')][_0x4de2c2[_0xd777('0x1f')]][_0xd777('0x2c')]=_0x4de2c2[_0xd777('0x2c')];this[_0xd777('0x8')][_0x4de2c2[_0xd777('0x1f')]][_0xd777('0x2d')]=_0x4de2c2['transferrate'];this[_0xd777('0x8')][_0x4de2c2['uniqueid']][_0xd777('0x2e')]=_0x4de2c2[_0xd777('0x2e')];this[_0xd777('0x8')][_0x4de2c2[_0xd777('0x1f')]][_0xd777('0x2f')]=_0x4de2c2[_0xd777('0x2f')];if(this['channels'][_0x4de2c2[_0xd777('0x1f')]][_0xd777('0x2b')]>0x0){tiff2pdf(_0x4de2c2[_0xd777('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x13f620){logger[_0xd777('0x1e')](_0x4de2c2[_0xd777('0x1f')],_0xd777('0x30'),_0x13f620[_0xd777('0x31')]);attachment[_0xd777('0x32')]({'name':path[_0xd777('0x33')](_0x4de2c2['filename'])[_0xd777('0x1d')],'basename':path[_0xd777('0x33')](_0x4de2c2['filename'])['name']+_0xd777('0x34'),'type':_0xd777('0x35')})[_0xd777('0x36')](function(_0x38344c){faxAccount[_0xd777('0x37')](_0x21466,{'from':_0x4de2c2[_0xd777('0x2f')],'mapKey':_0xd777('0x38'),'body':path[_0xd777('0x33')](_0x4de2c2[_0xd777('0x2e')])[_0xd777('0x1d')]+_0xd777('0x34'),'AttachmentId':_0x38344c['id']})['catch'](function(_0x15bf5a){logger[_0xd777('0x39')](_0x4de2c2[_0xd777('0x1f')],'\x20notify\x20',JSON['stringify'](_0x15bf5a));});})[_0xd777('0x3a')](function(_0x35f275){logger[_0xd777('0x39')](_0x4de2c2[_0xd777('0x1f')],_0xd777('0x3b'),JSON[_0xd777('0x3c')](_0x35f275));});});}logger[_0xd777('0x1e')](_0x4de2c2[_0xd777('0x1f')],'\x20receiveFax\x20');}};Fax[_0xd777('0x19')]['syncOriginateResponse']=function(_0x4c059d){if(this[_0xd777('0xb')][_0x4c059d[_0xd777('0x1f')]]){_['merge'](this[_0xd777('0x8')][_0x4c059d[_0xd777('0x1f')]],_[_0xd777('0x3d')](_0x4c059d,[_0xd777('0x3e'),'reason']));}};function updateStatus(_0x48740f){if(_0x48740f[_0xd777('0x3f')]){faxMessage['update'](_0x48740f[_0xd777('0x3f')],{'failMessage':_0xd777('0x40')})[_0xd777('0x36')](function(_0x442954){ut[_0xd777('0x41')]('[Fax][Message][Error][Updated]',_0x442954);})[_0xd777('0x3a')](function(_0x170f92){ut[_0xd777('0x41')]('[Fax][Message][Error][NoUpdate1]',_0x170f92);});}else{ut[_0xd777('0x41')](_0xd777('0x42'));}}Fax['prototype'][_0xd777('0x43')]=function(_0x2d2848,_0x1fd64e,_0x52e9db){var _0xbb8cbb=this;var _0x290ec6={};if(_0x1fd64e){_0x290ec6={'read':_0x1fd64e};}else{_0x290ec6={'failMessage':_0x52e9db};}if(this[_0xd777('0xb')][_0x2d2848][_0xd777('0x3f')]){faxMessage[_0xd777('0x44')](this[_0xd777('0xb')][_0x2d2848][_0xd777('0x3f')],_0x290ec6)[_0xd777('0x36')](function(_0x406e0e){ut[_0xd777('0x41')](_0xd777('0x45'),_0x406e0e);})[_0xd777('0x3a')](function(_0x3911ba){ut[_0xd777('0x41')](_0xd777('0x46'),_0x3911ba);})[_0xd777('0x47')](function(){delete _0xbb8cbb[_0xd777('0x8')][_0x2d2848];delete _0xbb8cbb[_0xd777('0xb')][_0x2d2848];});}else{ut[_0xd777('0x41')](_0xd777('0x48'));delete this[_0xd777('0x8')][_0x2d2848];delete this[_0xd777('0xb')][_0x2d2848];}};Fax[_0xd777('0x19')]['syncHangup']=function(_0x4a92ae){var _0x515a98=this;if(this[_0xd777('0x8')][_0x4a92ae[_0xd777('0x1f')]]){if(this[_0xd777('0xb')][_0x4a92ae[_0xd777('0x1f')]]){this[_0xd777('0x8')][_0x4a92ae['uniqueid']]['id']=this[_0xd777('0xb')][_0x4a92ae[_0xd777('0x1f')]]['id'];this['channels'][_0x4a92ae[_0xd777('0x1f')]][_0xd777('0x1d')]=this[_0xd777('0xb')][_0x4a92ae['uniqueid']][_0xd777('0x1d')];}logger['info'](_0x4a92ae[_0xd777('0x1f')],this[_0xd777('0xb')][_0x4a92ae[_0xd777('0x1f')]]?_0xd777('0x49'):_0xd777('0x4a'),JSON['stringify'](this[_0xd777('0x8')][_0x4a92ae['uniqueid']]));if(this[_0xd777('0xb')][_0x4a92ae[_0xd777('0x1f')]]){if(this[_0xd777('0x8')][_0x4a92ae[_0xd777('0x1f')]][_0xd777('0x4b')]>0x0&&this[_0xd777('0x8')][_0x4a92ae['uniqueid']]['faxstatus']===_0xd777('0x4c')){this['updateStatus'](_0x4a92ae['uniqueid'],!![]);}else{this[_0xd777('0x43')](_0x4a92ae['uniqueid'],![],this[_0xd777('0x8')][_0x4a92ae[_0xd777('0x1f')]][_0xd777('0x4d')]?_0xd777('0x4e')+this['channels'][_0x4a92ae['uniqueid']][_0xd777('0x4d')]:_0xd777('0x4f'));}}}};Fax[_0xd777('0x19')][_0xd777('0x50')]=function(_0x1bd77a){var _0x40b488=this;return new BPromise(function(_0x2e73ee,_0x5aa003){_0x40b488['execOriginate'](_0x1bd77a,_0x40b488['faxAccounts'][_0x1bd77a[_0xd777('0x51')]])[_0xd777('0x36')](function(_0x1474f3){ut[_0xd777('0x41')]('[Fax][execOriginate][success]',_0x1474f3);_0x2e73ee(ut[_0xd777('0x31')](_0xd777('0x52')));})[_0xd777('0x3a')](function(_0x243cba){ut[_0xd777('0x41')]('[Fax][execOriginate][failure]',_0x243cba);updateStatus(_0x1bd77a);_0x5aa003(ut[_0xd777('0x31')]('Fax\x20failed'));});});};Fax[_0xd777('0x19')][_0xd777('0x53')]=function(_0x4dec5b){var _0x5ddbf5=this;return new BPromise(function(_0x83dae1,_0x124248){var _0x335a3f=_0x5ddbf5[_0xd777('0x54')](_0x5ddbf5[_0xd777('0x9')][_0x4dec5b[_0xd777('0x51')]][_0xd777('0x55')],_0x4dec5b);if(_0x335a3f['isValid']){_0x83dae1(ut[_0xd777('0x31')](_0xd777('0x56')));}else{_0x124248(ut[_0xd777('0x31')](_0x335a3f['message']));}});};function originate(_0x41e7ca,_0x2e15b1,_0x4ad86d){return new BPromise(function(_0x4038cc,_0x5b26aa){if(_0x4ad86d){var _0x593d65=util[_0xd777('0x57')](_0xd777('0x58'),path[_0xd777('0x33')](_0x41e7ca['path'])[_0xd777('0x1d')],_0x41e7ca[_0xd777('0x3')]);gs['execute'](_0x593d65)[_0xd777('0x36')](function(){_0x41e7ca[_0xd777('0x3')]=util[_0xd777('0x57')]('%s/%s.tif',path['parse'](_0x41e7ca[_0xd777('0x3')])[_0xd777('0x59')],path[_0xd777('0x33')](_0x41e7ca[_0xd777('0x3')])[_0xd777('0x1d')]);_0x2e15b1[_0xd777('0x5a')]=_0x41e7ca[_0xd777('0x3')];ut[_0xd777('0x41')](_0xd777('0x5b'),'');ami['Action'](ut[_0xd777('0x5c')](_0x41e7ca,_0x2e15b1))[_0xd777('0x36')](function(_0x3ea645){_0x4038cc(_0x3ea645);})[_0xd777('0x3a')](function(_0x386a98){_0x5b26aa(_0x386a98);});})[_0xd777('0x3a')](function(_0x411225){_0x5b26aa(_0x411225);});}else{ami[_0xd777('0x5d')](ut[_0xd777('0x5c')](_0x41e7ca,_0x2e15b1))['then'](function(_0x79a918){_0x4038cc(_0x79a918);})[_0xd777('0x3a')](function(_0x1819da){_0x5b26aa(_0x1819da);});}});}Fax[_0xd777('0x19')]['execOriginate']=function(_0x5eb985,_0x418ba0){var _0x509ddd=this;return new BPromise(function(_0x98773a,_0x389e70){var _0x2bbf70=uuid['v4']();var _0x523e81=ut[_0xd777('0x5e')](_0x5eb985,_0x418ba0);_0x509ddd[_0xd777('0xb')][_0x2bbf70]=new Action(_0x2bbf70,_0x418ba0,_0x5eb985);var _0x5b3a5f=_0x509ddd[_0xd777('0xb')][_0x2bbf70];if(path[_0xd777('0x33')](_0x5eb985[_0xd777('0x3')])['ext']===_0xd777('0x34')){originate(_0x5b3a5f,_0x523e81,!![])['then'](function(_0x30d207){_0x98773a(_0x30d207);})[_0xd777('0x3a')](function(_0x1b3f2e){_0x389e70(_0x1b3f2e);});}else{originate(_0x5b3a5f,_0x523e81,![])['then'](function(_0x1a4975){_0x98773a(_0x1a4975);})[_0xd777('0x3a')](function(_0x862f8f){_0x389e70(_0x862f8f);});}});};Fax[_0xd777('0x19')][_0xd777('0x5f')]=function(_0x5ca3fa){return!_[_0xd777('0x60')](_0x5ca3fa)&&!_['isNil'](_0x5ca3fa[_0xd777('0x1d')])&&!_[_0xd777('0x60')](_0x5ca3fa[_0xd777('0x61')])&&_0x5ca3fa[_0xd777('0x61')]&&!_[_0xd777('0x60')](this[_0xd777('0xa')][util[_0xd777('0x57')](_0xd777('0x62'),_0x5ca3fa[_0xd777('0x1d')])])&&!_[_0xd777('0x60')](this[_0xd777('0xa')][util['format'](_0xd777('0x62'),_0x5ca3fa[_0xd777('0x1d')])]['status'])&&(this[_0xd777('0xa')][util[_0xd777('0x57')]('SIP/%s',_0x5ca3fa['name'])]['status']===_0xd777('0x63')||this['trunks'][util[_0xd777('0x57')](_0xd777('0x62'),_0x5ca3fa['name'])][_0xd777('0x27')]==='unmonitored');};Fax[_0xd777('0x19')][_0xd777('0x54')]=function(_0x1809da,_0xfcc3fd){if(!this[_0xd777('0x5f')](_0x1809da)){ut['logger'](_0xd777('0x64'),_['isNil'](_0x1809da)?'':_0x1809da['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xd777('0x65')};}if(_['isNil'](_0xfcc3fd['fax'])){ut[_0xd777('0x41')](_0xd777('0x66'),JSON[_0xd777('0x3c')](_0xfcc3fd));return{'isValid':![],'message':_0xd777('0x67')};}if(_[_0xd777('0x60')](_0xfcc3fd[_0xd777('0x3')])){ut[_0xd777('0x41')](_0xd777('0x68'),JSON['stringify'](_0xfcc3fd));return{'isValid':![],'message':_0xd777('0x69')};}return{'isValid':!![],'message':_0xd777('0x6a')};};module[_0xd777('0x6b')]=Fax; \ No newline at end of file +var _0x834d=['context','hasOwnProperty','exten','uniqueid','channel','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','notify','catch','error','stringify','\x20receiveFax\x20','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','then','[Fax][Message][NoUpdate1]','finally','name','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','message','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x834d,0x140));var _0xd834=function(_0x27913d,_0x594c03){_0x27913d=_0x27913d-0x0;var _0x5beaf1=_0x834d[_0x27913d];return _0x5beaf1;};'use strict';var util=require(_0xd834('0x0'));var _=require(_0xd834('0x1'));var BPromise=require('bluebird');var uuid=require(_0xd834('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0xd834('0x3'));var gs=require(_0xd834('0x4'));var logger=require(_0xd834('0x5'))(_0xd834('0x6'));var ami=require('../ami');var rpcDb=require(_0xd834('0x7'));var Channel=require(_0xd834('0x8'));var ut=require(_0xd834('0x9'));var Action=require(_0xd834('0xa'));var faxAccount=require(_0xd834('0xb'));var attachment=require(_0xd834('0xc'));var faxMessage=require(_0xd834('0xd'));function Fax(_0x6ab9ae){this[_0xd834('0xe')]={};this[_0xd834('0xf')]=_0x6ab9ae['faxAccounts'];this[_0xd834('0x10')]=_0x6ab9ae[_0xd834('0x10')];this['actions']={};ami['on'](_0xd834('0x11'),this[_0xd834('0x12')]['bind'](this));ami['on'](_0xd834('0x13'),this[_0xd834('0x14')][_0xd834('0x15')](this));ami['on'](_0xd834('0x16'),this[_0xd834('0x17')][_0xd834('0x15')](this));ami['on'](_0xd834('0x18'),this[_0xd834('0x19')][_0xd834('0x15')](this));ami['on'](_0xd834('0x1a'),this[_0xd834('0x1b')]['bind'](this));ami['on'](_0xd834('0x1c'),this[_0xd834('0x1d')][_0xd834('0x15')](this));ami['on']('hangup',this[_0xd834('0x1e')][_0xd834('0x15')](this));ami['on'](_0xd834('0x1f'),this[_0xd834('0x20')]['bind'](this));}Fax[_0xd834('0x21')][_0xd834('0x12')]=function(_0x375fdd){if(_0x375fdd[_0xd834('0x22')]==='from-voip-provider'){for(var _0x21ce1a in this[_0xd834('0xf')]){if(this['faxAccounts'][_0xd834('0x23')](_0x21ce1a)){if(_0x375fdd[_0xd834('0x24')]===this[_0xd834('0xf')][_0x21ce1a]['localstationid']){this[_0xd834('0xe')][_0x375fdd['uniqueid']]={};this[_0xd834('0xe')][_0x375fdd[_0xd834('0x25')]]['channel']=_0x375fdd[_0xd834('0x26')];this[_0xd834('0xe')][_0x375fdd[_0xd834('0x25')]]['id']=this[_0xd834('0xf')][_0x21ce1a]['id'];this[_0xd834('0xe')][_0x375fdd[_0xd834('0x25')]]['name']=this[_0xd834('0xf')][_0x21ce1a]['name'];logger[_0xd834('0x27')](_0x375fdd['uniqueid'],_0xd834('0x28'));}}}}if(this[_0xd834('0x29')][_0x375fdd[_0xd834('0x25')]]){this['channels'][_0x375fdd['uniqueid']]={};this['channels'][_0x375fdd[_0xd834('0x25')]]['channel']=_0x375fdd[_0xd834('0x26')];logger['info'](_0x375fdd[_0xd834('0x25')],'\x20syncNewchannel\x20');}};Fax[_0xd834('0x21')][_0xd834('0x14')]=function(_0x3a412a){if(this[_0xd834('0xe')][_0x3a412a[_0xd834('0x25')]]){for(var _0x570c95 in _0x3a412a[_0xd834('0x2a')]){if(_0x3a412a['variable'][_0xd834('0x23')](_0x570c95)){this[_0xd834('0xe')][_0x3a412a[_0xd834('0x25')]][_0x570c95]=_0x3a412a[_0xd834('0x2b')];}}}};Fax['prototype']['syncNewState']=function(_0x297bd5){if(this['channels'][_0x297bd5['uniqueid']]){this['channels'][_0x297bd5[_0xd834('0x25')]][_0xd834('0x2c')]=_0x297bd5[_0xd834('0x2c')];this['channels'][_0x297bd5['uniqueid']][_0xd834('0x2d')]=_0x297bd5[_0xd834('0x2d')];}};Fax[_0xd834('0x21')][_0xd834('0x19')]=function(_0x32eb87){if(this[_0xd834('0xe')][_0x32eb87[_0xd834('0x25')]]){for(var _0x3234a4 in _0x32eb87['variable']){if(_0x32eb87[_0xd834('0x2a')]['hasOwnProperty'](_0x3234a4)){this[_0xd834('0xe')][_0x32eb87[_0xd834('0x25')]][_0x3234a4]=_0x32eb87['value'];}}}};Fax[_0xd834('0x21')][_0xd834('0x1b')]=function(_0x4a14c3){if(this[_0xd834('0xe')][_0x4a14c3['uniqueid']]){this[_0xd834('0xe')][_0x4a14c3[_0xd834('0x25')]][_0xd834('0x2e')]=_0x4a14c3['operation'];this[_0xd834('0xe')][_0x4a14c3['uniqueid']][_0xd834('0x2f')]=_0x4a14c3[_0xd834('0x2f')];this['channels'][_0x4a14c3[_0xd834('0x25')]][_0xd834('0x30')]=_0x4a14c3['localstationid'];this[_0xd834('0xe')][_0x4a14c3[_0xd834('0x25')]][_0xd834('0x31')]=_0x4a14c3['filename'];logger[_0xd834('0x27')](_0x4a14c3['uniqueid'],_0xd834('0x32'));}};Fax['prototype'][_0xd834('0x1d')]=function(_0x1a8eb3){var _0x441f28=this;if(this['channels'][_0x1a8eb3[_0xd834('0x25')]]){var _0x2e5e30=this[_0xd834('0xe')][_0x1a8eb3[_0xd834('0x25')]]['id'];this[_0xd834('0xe')][_0x1a8eb3[_0xd834('0x25')]][_0xd834('0x33')]=_0x1a8eb3['remotestationid'];this[_0xd834('0xe')][_0x1a8eb3[_0xd834('0x25')]][_0xd834('0x34')]=_0x1a8eb3[_0xd834('0x34')];this[_0xd834('0xe')][_0x1a8eb3['uniqueid']][_0xd834('0x30')]=_0x1a8eb3[_0xd834('0x30')];this[_0xd834('0xe')][_0x1a8eb3['uniqueid']]['resolution']=_0x1a8eb3['resolution'];this[_0xd834('0xe')][_0x1a8eb3[_0xd834('0x25')]][_0xd834('0x35')]=_0x1a8eb3['transferrate'];this[_0xd834('0xe')][_0x1a8eb3[_0xd834('0x25')]][_0xd834('0x31')]=_0x1a8eb3[_0xd834('0x31')];this[_0xd834('0xe')][_0x1a8eb3['uniqueid']][_0xd834('0x36')]=_0x1a8eb3[_0xd834('0x36')];if(this[_0xd834('0xe')][_0x1a8eb3[_0xd834('0x25')]][_0xd834('0x34')]>0x0){tiff2pdf(_0x1a8eb3['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x34cee3){logger[_0xd834('0x27')](_0x1a8eb3[_0xd834('0x25')],_0xd834('0x37'),_0x34cee3['message']);attachment['create']({'name':path['parse'](_0x1a8eb3[_0xd834('0x31')])['name'],'basename':path[_0xd834('0x38')](_0x1a8eb3['filename'])['name']+_0xd834('0x39'),'type':_0xd834('0x3a')})['then'](function(_0x5ef2ef){faxAccount[_0xd834('0x3b')](_0x2e5e30,{'from':_0x1a8eb3['calleridnum'],'mapKey':_0xd834('0x6'),'body':path['parse'](_0x1a8eb3[_0xd834('0x31')])['name']+'.pdf','AttachmentId':_0x5ef2ef['id']})[_0xd834('0x3c')](function(_0x2fc3fa){logger[_0xd834('0x3d')](_0x1a8eb3[_0xd834('0x25')],'\x20notify\x20',JSON[_0xd834('0x3e')](_0x2fc3fa));});})[_0xd834('0x3c')](function(_0x45cc71){logger[_0xd834('0x3d')](_0x1a8eb3[_0xd834('0x25')],_0xd834('0x3f'),JSON['stringify'](_0x45cc71));});});}logger[_0xd834('0x27')](_0x1a8eb3[_0xd834('0x25')],'\x20receiveFax\x20');}};Fax[_0xd834('0x21')]['syncOriginateResponse']=function(_0x2cbb69){if(this['actions'][_0x2cbb69[_0xd834('0x25')]]){_['merge'](this[_0xd834('0xe')][_0x2cbb69[_0xd834('0x25')]],_['pick'](_0x2cbb69,[_0xd834('0x40'),_0xd834('0x41')]));}};function updateStatus(_0x52b049){if(_0x52b049['AttachmentId']){faxMessage[_0xd834('0x42')](_0x52b049[_0xd834('0x43')],{'failMessage':_0xd834('0x44')})['then'](function(_0x307502){ut[_0xd834('0x45')](_0xd834('0x46'),_0x307502);})[_0xd834('0x3c')](function(_0x1a7b14){ut[_0xd834('0x45')](_0xd834('0x47'),_0x1a7b14);});}else{ut[_0xd834('0x45')](_0xd834('0x48'));}}Fax[_0xd834('0x21')]['updateStatus']=function(_0x203d5b,_0x2ab921,_0x5bcd52){var _0x3cc674=this;var _0x17c908={};if(_0x2ab921){_0x17c908={'read':_0x2ab921};}else{_0x17c908={'failMessage':_0x5bcd52};}if(this[_0xd834('0x29')][_0x203d5b][_0xd834('0x43')]){faxMessage[_0xd834('0x42')](this['actions'][_0x203d5b][_0xd834('0x43')],_0x17c908)[_0xd834('0x49')](function(_0x2dc9dc){ut[_0xd834('0x45')]('[Fax][Message][Updated]',_0x2dc9dc);})['catch'](function(_0x10e265){ut[_0xd834('0x45')](_0xd834('0x4a'),_0x10e265);})[_0xd834('0x4b')](function(){delete _0x3cc674[_0xd834('0xe')][_0x203d5b];delete _0x3cc674[_0xd834('0x29')][_0x203d5b];});}else{ut[_0xd834('0x45')]('[Fax][Message][NoUpdate2]');delete this[_0xd834('0xe')][_0x203d5b];delete this[_0xd834('0x29')][_0x203d5b];}};Fax[_0xd834('0x21')][_0xd834('0x1e')]=function(_0x358ba0){var _0x3de389=this;if(this[_0xd834('0xe')][_0x358ba0[_0xd834('0x25')]]){if(this[_0xd834('0x29')][_0x358ba0[_0xd834('0x25')]]){this[_0xd834('0xe')][_0x358ba0[_0xd834('0x25')]]['id']=this[_0xd834('0x29')][_0x358ba0[_0xd834('0x25')]]['id'];this[_0xd834('0xe')][_0x358ba0[_0xd834('0x25')]][_0xd834('0x4c')]=this['actions'][_0x358ba0[_0xd834('0x25')]]['name'];}logger[_0xd834('0x27')](_0x358ba0[_0xd834('0x25')],this[_0xd834('0x29')][_0x358ba0[_0xd834('0x25')]]?_0xd834('0x4d'):_0xd834('0x4e'),JSON[_0xd834('0x3e')](this[_0xd834('0xe')][_0x358ba0[_0xd834('0x25')]]));if(this[_0xd834('0x29')][_0x358ba0['uniqueid']]){if(this[_0xd834('0xe')][_0x358ba0[_0xd834('0x25')]][_0xd834('0x4f')]>0x0&&this[_0xd834('0xe')][_0x358ba0[_0xd834('0x25')]][_0xd834('0x1a')]===_0xd834('0x50')){this['updateStatus'](_0x358ba0[_0xd834('0x25')],!![]);}else{this[_0xd834('0x51')](_0x358ba0[_0xd834('0x25')],![],this[_0xd834('0xe')][_0x358ba0['uniqueid']]['faxstatusstring']?_0xd834('0x52')+this[_0xd834('0xe')][_0x358ba0[_0xd834('0x25')]]['faxstatusstring']:_0xd834('0x53'));}}}};Fax[_0xd834('0x21')][_0xd834('0x54')]=function(_0x1f642f){var _0x2b5795=this;return new BPromise(function(_0x1ceb98,_0x57f1d1){_0x2b5795[_0xd834('0x55')](_0x1f642f,_0x2b5795['faxAccounts'][_0x1f642f[_0xd834('0x56')]])[_0xd834('0x49')](function(_0x2f8c04){ut[_0xd834('0x45')]('[Fax][execOriginate][success]',_0x2f8c04);_0x1ceb98(ut[_0xd834('0x57')]('Fax\x20received'));})[_0xd834('0x3c')](function(_0x544c1c){ut['logger'](_0xd834('0x58'),_0x544c1c);updateStatus(_0x1f642f);_0x57f1d1(ut['message'](_0xd834('0x59')));});});};Fax[_0xd834('0x21')]['checkAfterSend']=function(_0x365478){var _0x498070=this;return new BPromise(function(_0x1bd276,_0x387ba2){var _0x2c8c86=_0x498070[_0xd834('0x5a')](_0x498070[_0xd834('0xf')][_0x365478[_0xd834('0x56')]][_0xd834('0x5b')],_0x365478);if(_0x2c8c86[_0xd834('0x5c')]){_0x1bd276(ut[_0xd834('0x57')](_0xd834('0x5d')));}else{_0x387ba2(ut[_0xd834('0x57')](_0x2c8c86[_0xd834('0x57')]));}});};function originate(_0x3795f3,_0x12be61,_0x33ed5b){return new BPromise(function(_0x1a9e0d,_0x5528f9){if(_0x33ed5b){var _0x48f4d9=util['format'](_0xd834('0x5e'),path[_0xd834('0x38')](_0x3795f3['path'])[_0xd834('0x4c')],_0x3795f3[_0xd834('0x5f')]);gs['execute'](_0x48f4d9)['then'](function(){_0x3795f3[_0xd834('0x5f')]=util[_0xd834('0x60')](_0xd834('0x61'),path[_0xd834('0x38')](_0x3795f3[_0xd834('0x5f')])[_0xd834('0x62')],path[_0xd834('0x38')](_0x3795f3[_0xd834('0x5f')])['name']);_0x12be61[_0xd834('0x63')]=_0x3795f3[_0xd834('0x5f')];ut[_0xd834('0x45')](_0xd834('0x64'),'');ami['Action'](ut[_0xd834('0x65')](_0x3795f3,_0x12be61))[_0xd834('0x49')](function(_0x27957a){_0x1a9e0d(_0x27957a);})[_0xd834('0x3c')](function(_0x244d1e){_0x5528f9(_0x244d1e);});})[_0xd834('0x3c')](function(_0x3ff1a4){_0x5528f9(_0x3ff1a4);});}else{ami[_0xd834('0x66')](ut[_0xd834('0x65')](_0x3795f3,_0x12be61))[_0xd834('0x49')](function(_0x57942a){_0x1a9e0d(_0x57942a);})['catch'](function(_0x1c16ec){_0x5528f9(_0x1c16ec);});}});}Fax[_0xd834('0x21')][_0xd834('0x55')]=function(_0x3b009c,_0x12bfd7){var _0x53abe6=this;return new BPromise(function(_0x4ab4eb,_0x27e893){var _0x5af59a=uuid['v4']();var _0x1a51c1=ut[_0xd834('0x67')](_0x3b009c,_0x12bfd7);_0x53abe6['actions'][_0x5af59a]=new Action(_0x5af59a,_0x12bfd7,_0x3b009c);var _0x158f2f=_0x53abe6[_0xd834('0x29')][_0x5af59a];if(path[_0xd834('0x38')](_0x3b009c['path'])[_0xd834('0x68')]===_0xd834('0x39')){originate(_0x158f2f,_0x1a51c1,!![])['then'](function(_0x195596){_0x4ab4eb(_0x195596);})[_0xd834('0x3c')](function(_0xb0bb5b){_0x27e893(_0xb0bb5b);});}else{originate(_0x158f2f,_0x1a51c1,![])[_0xd834('0x49')](function(_0xa2f12f){_0x4ab4eb(_0xa2f12f);})[_0xd834('0x3c')](function(_0x51fef8){_0x27e893(_0x51fef8);});}});};Fax[_0xd834('0x21')][_0xd834('0x69')]=function(_0x4adf06){return!_[_0xd834('0x6a')](_0x4adf06)&&!_['isNil'](_0x4adf06['name'])&&!_['isNil'](_0x4adf06[_0xd834('0x6b')])&&_0x4adf06['active']&&!_['isNil'](this[_0xd834('0x10')][util[_0xd834('0x60')](_0xd834('0x6c'),_0x4adf06[_0xd834('0x4c')])])&&!_[_0xd834('0x6a')](this[_0xd834('0x10')][util['format']('SIP/%s',_0x4adf06[_0xd834('0x4c')])][_0xd834('0x2f')])&&(this[_0xd834('0x10')][util[_0xd834('0x60')]('SIP/%s',_0x4adf06[_0xd834('0x4c')])][_0xd834('0x2f')]===_0xd834('0x6d')||this[_0xd834('0x10')][util['format'](_0xd834('0x6c'),_0x4adf06[_0xd834('0x4c')])][_0xd834('0x2f')]===_0xd834('0x6e'));};Fax[_0xd834('0x21')][_0xd834('0x5a')]=function(_0x1090d8,_0x486a4a){if(!this[_0xd834('0x69')](_0x1090d8)){ut['logger'](_0xd834('0x6f'),_[_0xd834('0x6a')](_0x1090d8)?'':_0x1090d8[_0xd834('0x4c')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xd834('0x70')};}if(_['isNil'](_0x486a4a[_0xd834('0x6')])){ut[_0xd834('0x45')](_0xd834('0x71'),JSON['stringify'](_0x486a4a));return{'isValid':![],'message':_0xd834('0x72')};}if(_[_0xd834('0x6a')](_0x486a4a[_0xd834('0x5f')])){ut[_0xd834('0x45')](_0xd834('0x73'),JSON[_0xd834('0x3e')](_0x486a4a));return{'isValid':![],'message':_0xd834('0x74')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xd834('0x75')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index a827699..cd77cde 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 _0x9f28=['lodash','../rpc/faxAccount','error','inspect','notify','then','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x9f28,0x1d5));var _0x89f2=function(_0x54d944,_0x4c5672){_0x54d944=_0x54d944-0x0;var _0x394604=_0x9f28[_0x54d944];return _0x394604;};'use strict';var util=require(_0x89f2('0x0'));var BPromise=require(_0x89f2('0x1'));var logger=require(_0x89f2('0x2'))(_0x89f2('0x3'));var _=require(_0x89f2('0x4'));var faxAccount=require(_0x89f2('0x5'));function loggerCatch(_0x12078e){return function(_0x30dfa7){logger[_0x89f2('0x6')](_0x12078e,util[_0x89f2('0x7')](_0x30dfa7,{'showHidden':![],'depth':null}));};}exports[_0x89f2('0x8')]=function(_0x1e1f28,_0x4f1d4b){return BPromise['resolve']()[_0x89f2('0x9')](faxAccount['notify'](_0x1e1f28,_0x4f1d4b))['catch'](loggerCatch(_0x89f2('0xa')));}; \ No newline at end of file +var _0x6535=['lodash','error','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','preview'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x6535,0xe4));var _0x5653=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6535[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x5653('0x0'));var BPromise=require(_0x5653('0x1'));var logger=require('../../../config/logger')(_0x5653('0x2'));var _=require(_0x5653('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1a00ee){return function(_0x32c005){logger[_0x5653('0x4')](_0x1a00ee,util[_0x5653('0x5')](_0x32c005,{'showHidden':![],'depth':null}));};}exports[_0x5653('0x6')]=function(_0x4d899f,_0x93ac08){return BPromise[_0x5653('0x7')]()[_0x5653('0x8')](faxAccount[_0x5653('0x6')](_0x4d899f,_0x93ac08))[_0x5653('0x9')](loggerCatch(_0x5653('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 3f80ade..c317489 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 _0x2590=['bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:','../../../../config/logger'];(function(_0x4be457,_0x352d3e){var _0xacad60=function(_0x22cc11){while(--_0x22cc11){_0x4be457['push'](_0x4be457['shift']());}};_0xacad60(++_0x352d3e);}(_0x2590,0x125));var _0x0259=function(_0x3a4bf2,_0xad59b){_0x3a4bf2=_0x3a4bf2-0x0;var _0x2318db=_0x2590[_0x3a4bf2];return _0x2318db;};'use strict';var util=require('util');var logger=require(_0x0259('0x0'))('fax');var BPromise=require(_0x0259('0x1'));var exec=require(_0x0259('0x2'))[_0x0259('0x3')];exports['execute']=function(_0x242c24){return new BPromise(function(_0x29d140,_0x551640){exec(_0x242c24,function(_0x1c3518,_0x308b1c,_0x5e3a20){logger[_0x0259('0x4')](_0x0259('0x5'),_0x308b1c);if(_0x1c3518){logger[_0x0259('0x4')]('Exec\x20gs',_0x0259('0x6'),util['inspect'](_0x1c3518,{'showHidden':![],'depth':null}),_0x308b1c,_0x5e3a20);_0x551640(_0x1c3518);}_0x29d140(_0x308b1c);});});}; \ No newline at end of file +var _0x6e82=['../../../../config/logger','bluebird','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6e82,0x8c));var _0x26e8=function(_0x31bcb2,_0x23cc0e){_0x31bcb2=_0x31bcb2-0x0;var _0x3f150c=_0x6e82[_0x31bcb2];return _0x3f150c;};'use strict';var util=require('util');var logger=require(_0x26e8('0x0'))('fax');var BPromise=require(_0x26e8('0x1'));var exec=require('child_process')['exec'];exports[_0x26e8('0x2')]=function(_0x26a500){return new BPromise(function(_0x1ef53d,_0x494d90){exec(_0x26a500,function(_0x1b203f,_0x251a9f,_0x148b6){logger[_0x26e8('0x3')](_0x26e8('0x4'),_0x251a9f);if(_0x1b203f){logger['info'](_0x26e8('0x4'),_0x26e8('0x5'),util[_0x26e8('0x6')](_0x1b203f,{'showHidden':![],'depth':null}),_0x251a9f,_0x148b6);_0x494d90(_0x1b203f);}_0x1ef53d(_0x251a9f);});});}; \ 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 97b02d4..5f8f234 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 _0x765c=['maxrate','format','gateway','t38timeout','localstationid','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','util','moment','../../../../config/logger','message','logger','info','inspect','ecm','minrate'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x765c,0x10f));var _0xc765=function(_0x16aa70,_0x5b1f73){_0x16aa70=_0x16aa70-0x0;var _0x11875f=_0x765c[_0x16aa70];return _0x11875f;};'use strict';var util=require(_0xc765('0x0'));var _=require('lodash');var moment=require(_0xc765('0x1'));var logger=require(_0xc765('0x2'))('fax');exports[_0xc765('0x3')]=function(_0x17d609){return{'message':_0x17d609};};exports[_0xc765('0x4')]=function(_0x241cd1,_0x16e459){logger[_0xc765('0x5')](_0x241cd1,util[_0xc765('0x6')](_0x16e459,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3a5cc6,_0x3fe24f){var _0x3dbc31={'XMF-ECM':_0x3fe24f[_0xc765('0x7')],'XMF-HEADERINFO':_0x3fe24f['headerinfo'],'XMF-MINRATE':_0x3fe24f[_0xc765('0x8')],'XMF-MAXRATE':_0x3fe24f[_0xc765('0x9')],'XMF-MODEM':util[_0xc765('0xa')]('\x22%s\x22',_0x3fe24f['modem']),'XMF-GATEWAY':_0x3fe24f[_0xc765('0xb')],'XMF-FAXDETECT':_0x3fe24f['faxdetect'],'XMF-T38TIMEOUT':_0x3fe24f[_0xc765('0xc')],'XMF-LOCALSTATIONID':_0x3fe24f[_0xc765('0xd')],'XMF-PATH':_0x3a5cc6['path']};return _0x3dbc31;};exports['variablesAction']=function(_0x2ad7dc,_0x2b0a51){return{'actionid':_0x2ad7dc[_0xc765('0xe')],'action':_0xc765('0xf'),'channel':_0x2ad7dc[_0xc765('0x10')],'Exten':_0xc765('0x11'),'Context':'from-sip','Priority':'1','callerid':util[_0xc765('0xa')](_0xc765('0x12'),_0x2ad7dc[_0xc765('0x13')]?_0x2ad7dc[_0xc765('0x13')]:'',_0x2ad7dc[_0xc765('0xd')]),'variable':_0x2b0a51,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2ad7dc[_0xc765('0xe')]};}; \ No newline at end of file +var _0x4fa6=['\x22%s\x22\x20<%s>','moment','../../../../config/logger','fax','info','inspect','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','xcally-motion-fax','from-sip'];(function(_0x337aae,_0x5387ca){var _0x4a6713=function(_0x9b01d5){while(--_0x9b01d5){_0x337aae['push'](_0x337aae['shift']());}};_0x4a6713(++_0x5387ca);}(_0x4fa6,0xd2));var _0x64fa=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x4fa6[_0x525c7b];return _0x27b33e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x64fa('0x0'));var logger=require(_0x64fa('0x1'))(_0x64fa('0x2'));exports['message']=function(_0xaaa562){return{'message':_0xaaa562};};exports['logger']=function(_0x1d1373,_0x4acda5){logger[_0x64fa('0x3')](_0x1d1373,util[_0x64fa('0x4')](_0x4acda5,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x211bf1,_0x1954f2){var _0x387b00={'XMF-ECM':_0x1954f2[_0x64fa('0x5')],'XMF-HEADERINFO':_0x1954f2[_0x64fa('0x6')],'XMF-MINRATE':_0x1954f2[_0x64fa('0x7')],'XMF-MAXRATE':_0x1954f2[_0x64fa('0x8')],'XMF-MODEM':util['format']('\x22%s\x22',_0x1954f2[_0x64fa('0x9')]),'XMF-GATEWAY':_0x1954f2[_0x64fa('0xa')],'XMF-FAXDETECT':_0x1954f2[_0x64fa('0xb')],'XMF-T38TIMEOUT':_0x1954f2[_0x64fa('0xc')],'XMF-LOCALSTATIONID':_0x1954f2[_0x64fa('0xd')],'XMF-PATH':_0x211bf1[_0x64fa('0xe')]};return _0x387b00;};exports[_0x64fa('0xf')]=function(_0x547202,_0x2c6a8c){return{'actionid':_0x547202['uniqueid'],'action':'originate','channel':_0x547202['channel'],'Exten':_0x64fa('0x10'),'Context':_0x64fa('0x11'),'Priority':'1','callerid':util['format'](_0x64fa('0x12'),_0x547202[_0x64fa('0x6')]?_0x547202[_0x64fa('0x6')]:'',_0x547202[_0x64fa('0xd')]),'variable':_0x2c6a8c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x547202['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 179765b..55425b3 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 _0xb01d=['./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','resolve','getAgents','initAgents','then','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','listen','error','[index.js][main]','inspect','moment','./realtime','./acw','./trigger','./preview'];(function(_0x440513,_0x3d3ceb){var _0x41bd85=function(_0x258d67){while(--_0x258d67){_0x440513['push'](_0x440513['shift']());}};_0x41bd85(++_0x3d3ceb);}(_0xb01d,0x7f));var _0xdb01=function(_0xe24446,_0x1c93de){_0xe24446=_0xe24446-0x0;var _0x64f1e8=_0xb01d[_0xe24446];return _0x64f1e8;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0xdb01('0x0'));var server=require('./server');var Realtime=require(_0xdb01('0x1'));var Report=require('./report');var Acw=require(_0xdb01('0x2'));var Trigger=require(_0xdb01('0x3'));var Dialer=require('./dialer');var Preview=require(_0xdb01('0x4'));var Fax=require('./fax');var user=require(_0xdb01('0x5'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xdb01('0x6'));var voiceCallReport=require(_0xdb01('0x7'));var trunk=require(_0xdb01('0x8'));var trigger=require(_0xdb01('0x9'));var template=require(_0xdb01('0xa'));var cmHopperHistory=require(_0xdb01('0xb'));var campaign=require(_0xdb01('0xc'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xdb01('0xd'));var zendesk=require(_0xdb01('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xdb01('0xf'));var freshdesk=require(_0xdb01('0x10'));var desk=require(_0xdb01('0x11'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xdb01('0x12'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xdb01('0x13'));var dynamics365=require(_0xdb01('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xdb01('0x15'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xdb01('0x16')]()['then'](user[_0xdb01('0x17')]())['then'](realtime[_0xdb01('0x18')]())[_0xdb01('0x19')](user[_0xdb01('0x1a')]())[_0xdb01('0x19')](realtime[_0xdb01('0x1b')]())['then'](trunk[_0xdb01('0x1c')]())[_0xdb01('0x19')](realtime['initTrunks']())[_0xdb01('0x19')](voiceQueue['getVoiceQueues']())[_0xdb01('0x19')](realtime[_0xdb01('0x1d')]())[_0xdb01('0x19')](trigger[_0xdb01('0x1e')]())[_0xdb01('0x19')](realtime[_0xdb01('0x1f')]())[_0xdb01('0x19')](template[_0xdb01('0x20')]())[_0xdb01('0x19')](realtime[_0xdb01('0x21')]())[_0xdb01('0x19')](zendesk[_0xdb01('0x22')]())['then'](realtime['initZendeskAccounts']())['then'](salesforce['getSalesforceAccounts']())[_0xdb01('0x19')](realtime[_0xdb01('0x23')]())[_0xdb01('0x19')](sugarcrm[_0xdb01('0x24')]())[_0xdb01('0x19')](realtime[_0xdb01('0x25')]())[_0xdb01('0x19')](freshdesk[_0xdb01('0x26')]())[_0xdb01('0x19')](realtime[_0xdb01('0x27')]())[_0xdb01('0x19')](desk['getDeskAccounts']())[_0xdb01('0x19')](realtime[_0xdb01('0x28')]())['then'](zoho[_0xdb01('0x29')]())['then'](realtime['initZohoAccounts']())[_0xdb01('0x19')](vtiger[_0xdb01('0x2a')]())[_0xdb01('0x19')](realtime[_0xdb01('0x2b')]())[_0xdb01('0x19')](freshsales[_0xdb01('0x2c')]())[_0xdb01('0x19')](realtime[_0xdb01('0x2d')]())[_0xdb01('0x19')](servicenow[_0xdb01('0x2e')]())[_0xdb01('0x19')](realtime[_0xdb01('0x2f')]())[_0xdb01('0x19')](dynamics365['getDynamics365Accounts']())[_0xdb01('0x19')](realtime[_0xdb01('0x30')]())['then'](campaign[_0xdb01('0x31')]())[_0xdb01('0x19')](realtime[_0xdb01('0x32')]())[_0xdb01('0x19')](voiceExtension['getVoiceExtensions']())[_0xdb01('0x19')](realtime[_0xdb01('0x33')]())[_0xdb01('0x19')](faxAccount[_0xdb01('0x34')]())[_0xdb01('0x19')](realtime[_0xdb01('0x35')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xdb01('0x19')](voiceQueueReport['getVoiceQueueReports']())[_0xdb01('0x19')](realtime[_0xdb01('0x36')]())[_0xdb01('0x19')](cmHopperHistory[_0xdb01('0x37')]())[_0xdb01('0x19')](realtime[_0xdb01('0x38')]())[_0xdb01('0x19')](cmHopperHistory[_0xdb01('0x39')]())[_0xdb01('0x19')](realtime['initCampaignHopperHistory']())[_0xdb01('0x19')](voiceCallReport[_0xdb01('0x3a')]())[_0xdb01('0x19')](realtime[_0xdb01('0x3b')]())[_0xdb01('0x3c')](function(_0x28678f){logger['error'](_0xdb01('0x3d'),util['inspect'](_0x28678f,{'showHidden':![],'depth':null}));});}function main(){return server[_0xdb01('0x3e')](realtime,preview,fax)[_0xdb01('0x19')](function(_0x4f571c){return initRealtime();})[_0xdb01('0x19')](function(){return initParams();})[_0xdb01('0x19')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x57e9e5){logger[_0xdb01('0x3f')](_0xdb01('0x40'),util[_0xdb01('0x41')](_0x57e9e5,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x1428=['initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','then','getAgents','getTelephones','initTelephones','initVoiceQueues','initTemplates','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory'];(function(_0x4c7134,_0x1eae0b){var _0x54da70=function(_0x5ebfa3){while(--_0x5ebfa3){_0x4c7134['push'](_0x4c7134['shift']());}};_0x54da70(++_0x1eae0b);}(_0x1428,0x1c8));var _0x8142=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x1428[_0x3054be];return _0x3df150;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require(_0x8142('0x0'));var Realtime=require(_0x8142('0x1'));var Report=require(_0x8142('0x2'));var Acw=require('./acw');var Trigger=require(_0x8142('0x3'));var Dialer=require(_0x8142('0x4'));var Preview=require(_0x8142('0x5'));var Fax=require(_0x8142('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0x8142('0x7'));var voiceQueueReport=require(_0x8142('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x8142('0x9'));var trigger=require(_0x8142('0xa'));var template=require(_0x8142('0xb'));var cmHopperHistory=require(_0x8142('0xc'));var campaign=require(_0x8142('0xd'));var voiceExtension=require(_0x8142('0xe'));var faxAccount=require(_0x8142('0xf'));var zendesk=require(_0x8142('0x10'));var salesforce=require(_0x8142('0x11'));var sugarcrm=require(_0x8142('0x12'));var freshdesk=require(_0x8142('0x13'));var desk=require(_0x8142('0x14'));var zoho=require(_0x8142('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x8142('0x16'));var servicenow=require(_0x8142('0x17'));var dynamics365=require(_0x8142('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(_0x8142('0x19'))(_0x8142('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x8142('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8142('0x1c')](_0x8142('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8142('0x1d')]()[_0x8142('0x1e')](user[_0x8142('0x1f')]())[_0x8142('0x1e')](realtime['initAgents']())[_0x8142('0x1e')](user[_0x8142('0x20')]())[_0x8142('0x1e')](realtime[_0x8142('0x21')]())[_0x8142('0x1e')](trunk['getTrunks']())['then'](realtime['initTrunks']())[_0x8142('0x1e')](voiceQueue['getVoiceQueues']())[_0x8142('0x1e')](realtime[_0x8142('0x22')]())[_0x8142('0x1e')](trigger['getTriggers']())[_0x8142('0x1e')](realtime['initTriggers']())[_0x8142('0x1e')](template['getTemplates']())['then'](realtime[_0x8142('0x23')]())[_0x8142('0x1e')](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())[_0x8142('0x1e')](salesforce[_0x8142('0x24')]())[_0x8142('0x1e')](realtime['initSalesforceAccounts']())[_0x8142('0x1e')](sugarcrm[_0x8142('0x25')]())['then'](realtime[_0x8142('0x26')]())[_0x8142('0x1e')](freshdesk['getFreshdeskAccounts']())['then'](realtime['initFreshdeskAccounts']())[_0x8142('0x1e')](desk[_0x8142('0x27')]())[_0x8142('0x1e')](realtime[_0x8142('0x28')]())[_0x8142('0x1e')](zoho[_0x8142('0x29')]())['then'](realtime['initZohoAccounts']())[_0x8142('0x1e')](vtiger['getVtigerAccounts']())[_0x8142('0x1e')](realtime[_0x8142('0x2a')]())[_0x8142('0x1e')](freshsales[_0x8142('0x2b')]())[_0x8142('0x1e')](realtime[_0x8142('0x2c')]())['then'](servicenow[_0x8142('0x2d')]())[_0x8142('0x1e')](realtime[_0x8142('0x2e')]())[_0x8142('0x1e')](dynamics365[_0x8142('0x2f')]())['then'](realtime['initDynamics365Accounts']())[_0x8142('0x1e')](campaign[_0x8142('0x30')]())[_0x8142('0x1e')](realtime[_0x8142('0x31')]())[_0x8142('0x1e')](voiceExtension[_0x8142('0x32')]())['then'](realtime[_0x8142('0x33')]())['then'](faxAccount[_0x8142('0x34')]())[_0x8142('0x1e')](realtime[_0x8142('0x35')]())[_0x8142('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8142('0x1e')](voiceQueueReport[_0x8142('0x36')]())[_0x8142('0x1e')](realtime['initVoiceQueueReports']())[_0x8142('0x1e')](cmHopperHistory[_0x8142('0x37')]())[_0x8142('0x1e')](realtime['initVoiceQueueHopperHistory']())[_0x8142('0x1e')](cmHopperHistory['getCampaignHopperHistory']())[_0x8142('0x1e')](realtime[_0x8142('0x38')]())[_0x8142('0x1e')](voiceCallReport['getVoiceCallReports']())[_0x8142('0x1e')](realtime[_0x8142('0x39')]())[_0x8142('0x3a')](function(_0x4b6db9){logger['error'](_0x8142('0x3b'),util[_0x8142('0x3c')](_0x4b6db9,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8142('0x3d')](realtime,preview,fax)['then'](function(_0x4c55bb){return initRealtime();})[_0x8142('0x1e')](function(){return initParams();})[_0x8142('0x1e')](function(){report[_0x8142('0x3e')]();setInterval(initRealtime,0x1388);})[_0x8142('0x3a')](function(_0xcd6dc){logger[_0x8142('0x3f')]('[index.js][main]',util[_0x8142('0x3c')](_0xcd6dc,{'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 780c9aa..b53841d 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x6a8097,_0x1e9df0){var _0x5e8b70=function(_0x23de1b){while(--_0x23de1b){_0x6a8097['push'](_0x6a8097['shift']());}};_0x5e8b70(++_0x1e9df0);}(_0x70e0,0x17b));var _0x070e=function(_0x3fbcbe,_0x52cfee){_0x3fbcbe=_0x3fbcbe-0x0;var _0x103b22=_0x70e0[_0x3fbcbe];return _0x103b22;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x5a29bf,_0xc8da9){var _0x4b25c6=function(_0x3f9d9e){while(--_0x3f9d9e){_0x5a29bf['push'](_0x5a29bf['shift']());}};_0x4b25c6(++_0xc8da9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0xcb91[_0x967959];return _0x5c4489;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index e97e0cc..477ba9e 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 _0x4a40=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x251abe,_0x289410){var _0x12d91f=function(_0x478321){while(--_0x478321){_0x251abe['push'](_0x251abe['shift']());}};_0x12d91f(++_0x289410);}(_0x4a40,0x1b9));var _0x04a4=function(_0x16fe4c,_0x2421e8){_0x16fe4c=_0x16fe4c-0x0;var _0x9999d=_0x4a40[_0x16fe4c];return _0x9999d;};'use strict';function Campaign(_0x2d284e){this['id']=_0x2d284e['id']||0x0;this['name']=_0x2d284e[_0x04a4('0x0')]||'';this[_0x04a4('0x1')]=_0x2d284e[_0x04a4('0x1')]||_0x04a4('0x2');this[_0x04a4('0x3')]=0x0;this[_0x04a4('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0x04a4('0x5')]='';this[_0x04a4('0x6')]=!![];this['active']=_0x2d284e[_0x04a4('0x7')];this[_0x04a4('0x8')]=_0x2d284e[_0x04a4('0x8')];this[_0x04a4('0x9')]=_0x2d284e[_0x04a4('0x9')]||null;this[_0x04a4('0xa')]=_0x2d284e[_0x04a4('0xa')]?_0x2d284e[_0x04a4('0xa')]:null;this['dialOriginateCallerIdName']=_0x2d284e[_0x04a4('0xb')];this[_0x04a4('0xc')]=_0x2d284e[_0x04a4('0xc')];this[_0x04a4('0xd')]=_0x2d284e[_0x04a4('0xd')]||0x1e;this[_0x04a4('0xe')]=_0x2d284e['dialCongestionMaxRetry'];this[_0x04a4('0xf')]=_0x2d284e[_0x04a4('0xf')];this[_0x04a4('0x10')]=_0x2d284e[_0x04a4('0x10')];this[_0x04a4('0x11')]=_0x2d284e['dialBusyRetryFrequency'];this[_0x04a4('0x12')]=_0x2d284e[_0x04a4('0x12')];this['dialNoAnswerRetryFrequency']=_0x2d284e[_0x04a4('0x13')];this[_0x04a4('0x14')]=_0x2d284e[_0x04a4('0x14')];this[_0x04a4('0x15')]=_0x2d284e[_0x04a4('0x15')]||0x3;this[_0x04a4('0x16')]=_0x2d284e[_0x04a4('0x16')]||0x96;this[_0x04a4('0x17')]=_0x2d284e[_0x04a4('0x17')]||0x3;this[_0x04a4('0x18')]=_0x2d284e['dialDropRetryFrequency']||0x96;this[_0x04a4('0x19')]=_0x2d284e[_0x04a4('0x19')]||0x3;this[_0x04a4('0x1a')]=_0x2d284e[_0x04a4('0x1a')]||0x96;this[_0x04a4('0x1b')]=_0x2d284e['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x2d284e[_0x04a4('0x1c')]||0x96;this[_0x04a4('0x1d')]=_0x2d284e[_0x04a4('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2d284e[_0x04a4('0x1e')]||0x96;this[_0x04a4('0x1f')]=_0x2d284e['dialOrderByScheduledAt']||_0x04a4('0x20');this['dialPrefix']=_0x2d284e['dialPrefix']||undefined;this[_0x04a4('0x21')]=_0x2d284e['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x2d284e[_0x04a4('0x22')]||undefined;this[_0x04a4('0x23')]=_0x2d284e['TrunkBackup']?_0x2d284e[_0x04a4('0x23')]:undefined;this['Trunk']=_0x2d284e[_0x04a4('0x24')]?_0x2d284e[_0x04a4('0x24')]:undefined;this[_0x04a4('0x25')]=_0x2d284e['Interval']?_0x2d284e[_0x04a4('0x25')]:undefined;this[_0x04a4('0x26')]=_0x2d284e['SquareProject']?_0x2d284e[_0x04a4('0x26')]:undefined;this[_0x04a4('0x27')]=_0x2d284e[_0x04a4('0x26')]?_0x2d284e[_0x04a4('0x26')][_0x04a4('0x0')]:undefined;this[_0x04a4('0x28')]=_0x2d284e[_0x04a4('0x28')]||![];this[_0x04a4('0x29')]=_0x2d284e['dialAMDInitialSilence'];this[_0x04a4('0x2a')]=_0x2d284e['dialAMDGreeting'];this[_0x04a4('0x2b')]=_0x2d284e[_0x04a4('0x2b')];this[_0x04a4('0x2c')]=_0x2d284e[_0x04a4('0x2c')];this['dialAMDMinWordLength']=_0x2d284e[_0x04a4('0x2d')];this[_0x04a4('0x2e')]=_0x2d284e[_0x04a4('0x2e')];this[_0x04a4('0x2f')]=_0x2d284e[_0x04a4('0x2f')];this['dialAMDSilenceThreshold']=_0x2d284e[_0x04a4('0x30')];this[_0x04a4('0x31')]=_0x2d284e[_0x04a4('0x31')];}module[_0x04a4('0x32')]=Campaign; \ No newline at end of file +var _0xa8e1=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0xa8e1,0xfe));var _0x1a8e=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0xa8e1[_0x4d7a70];return _0x3aafbb;};'use strict';function Campaign(_0x595102){this['id']=_0x595102['id']||0x0;this[_0x1a8e('0x0')]=_0x595102['name']||'';this[_0x1a8e('0x1')]=_0x595102[_0x1a8e('0x1')]||'campaign';this['originated']=0x0;this[_0x1a8e('0x2')]=0x0;this[_0x1a8e('0x3')]=0x0;this[_0x1a8e('0x4')]=0x0;this[_0x1a8e('0x5')]='';this[_0x1a8e('0x6')]=!![];this[_0x1a8e('0x7')]=_0x595102[_0x1a8e('0x7')];this[_0x1a8e('0x8')]=_0x595102['limitCalls'];this['dialTimezone']=_0x595102[_0x1a8e('0x9')]||null;this[_0x1a8e('0xa')]=_0x595102['dialGlobalInterval']?_0x595102[_0x1a8e('0xa')]:null;this[_0x1a8e('0xb')]=_0x595102[_0x1a8e('0xb')];this['dialOriginateCallerIdNumber']=_0x595102[_0x1a8e('0xc')];this[_0x1a8e('0xd')]=_0x595102[_0x1a8e('0xd')]||0x1e;this[_0x1a8e('0xe')]=_0x595102[_0x1a8e('0xe')];this[_0x1a8e('0xf')]=_0x595102[_0x1a8e('0xf')];this['dialBusyMaxRetry']=_0x595102[_0x1a8e('0x10')];this['dialBusyRetryFrequency']=_0x595102[_0x1a8e('0x11')];this[_0x1a8e('0x12')]=_0x595102[_0x1a8e('0x12')];this[_0x1a8e('0x13')]=_0x595102['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x595102['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x595102[_0x1a8e('0x14')]||0x3;this[_0x1a8e('0x15')]=_0x595102[_0x1a8e('0x15')]||0x96;this[_0x1a8e('0x16')]=_0x595102[_0x1a8e('0x16')]||0x3;this['dialDropRetryFrequency']=_0x595102[_0x1a8e('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x595102[_0x1a8e('0x18')]||0x3;this[_0x1a8e('0x19')]=_0x595102['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x595102['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x595102[_0x1a8e('0x1a')]||0x96;this[_0x1a8e('0x1b')]=_0x595102[_0x1a8e('0x1b')]||0x3;this[_0x1a8e('0x1c')]=_0x595102[_0x1a8e('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x595102[_0x1a8e('0x1d')]||_0x1a8e('0x1e');this[_0x1a8e('0x1f')]=_0x595102[_0x1a8e('0x1f')]||undefined;this[_0x1a8e('0x20')]=_0x595102[_0x1a8e('0x20')]||undefined;this[_0x1a8e('0x21')]=_0x595102[_0x1a8e('0x21')]||undefined;this[_0x1a8e('0x22')]=_0x595102[_0x1a8e('0x22')]?_0x595102[_0x1a8e('0x22')]:undefined;this[_0x1a8e('0x23')]=_0x595102[_0x1a8e('0x23')]?_0x595102[_0x1a8e('0x23')]:undefined;this[_0x1a8e('0x24')]=_0x595102[_0x1a8e('0x24')]?_0x595102[_0x1a8e('0x24')]:undefined;this['SquareProject']=_0x595102[_0x1a8e('0x25')]?_0x595102['SquareProject']:undefined;this['dialQueueProject']=_0x595102[_0x1a8e('0x25')]?_0x595102[_0x1a8e('0x25')][_0x1a8e('0x0')]:undefined;this[_0x1a8e('0x26')]=_0x595102[_0x1a8e('0x26')]||![];this[_0x1a8e('0x27')]=_0x595102['dialAMDInitialSilence'];this[_0x1a8e('0x28')]=_0x595102['dialAMDGreeting'];this[_0x1a8e('0x29')]=_0x595102['dialAMDAfterGreetingSilence'];this[_0x1a8e('0x2a')]=_0x595102[_0x1a8e('0x2a')];this['dialAMDMinWordLength']=_0x595102[_0x1a8e('0x2b')];this[_0x1a8e('0x2c')]=_0x595102['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x595102[_0x1a8e('0x2d')];this[_0x1a8e('0x2e')]=_0x595102['dialAMDSilenceThreshold'];this[_0x1a8e('0x2f')]=_0x595102[_0x1a8e('0x2f')];}module[_0x1a8e('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 48f2ec4..a8f9528 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 _0xc401=['holdtime','type','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','unmanaged','abandoned','lastdata','duration'];(function(_0x3006f7,_0x5ba8ee){var _0x1dcbf3=function(_0x1793cb){while(--_0x1793cb){_0x3006f7['push'](_0x3006f7['shift']());}};_0x1dcbf3(++_0x5ba8ee);}(_0xc401,0x15d));var _0x1c40=function(_0x29107c,_0x3a83ed){_0x29107c=_0x29107c-0x0;var _0x5781df=_0xc401[_0x29107c];return _0x5781df;};'use strict';function Channel(){this['starttime']=null;this[_0x1c40('0x0')]='';this[_0x1c40('0x1')]='';this[_0x1c40('0x2')]=0x0;this[_0x1c40('0x3')]='';this[_0x1c40('0x4')]=undefined;this[_0x1c40('0x5')]=undefined;this[_0x1c40('0x6')]=0x0;this[_0x1c40('0x7')]='';this[_0x1c40('0x8')]=0x0;this['linkedid']=0x0;this[_0x1c40('0x9')]=0x0;this[_0x1c40('0xa')]=![];this['answertime']=null;this['endtime']=null;this[_0x1c40('0xb')]=![];this[_0x1c40('0xc')]=![];this['lastapplication']='';this[_0x1c40('0xd')]='';this[_0x1c40('0xe')]=0x0;this['billableseconds']=0x0;this[_0x1c40('0xf')]=0x0;this[_0x1c40('0x10')]=null;this['tag']=null;this[_0x1c40('0x11')]=null;this['monitor']=![];this[_0x1c40('0x12')]=null;this[_0x1c40('0x13')]=null;this[_0x1c40('0x14')]=[];this[_0x1c40('0x15')]=undefined;this[_0x1c40('0x16')]=undefined;this[_0x1c40('0x17')]=undefined;this[_0x1c40('0x18')]=0x0;}module[_0x1c40('0x19')]=Channel; \ No newline at end of file +var _0xe1c4=['destinationchannel','connectedlinenum','accountcode','context','uniqueid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','channel'];(function(_0x10990e,_0x227b0c){var _0x261527=function(_0x7eb641){while(--_0x7eb641){_0x10990e['push'](_0x10990e['shift']());}};_0x261527(++_0x227b0c);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x40f1d0,_0x45dd7b){_0x40f1d0=_0x40f1d0-0x0;var _0x45f139=_0xe1c4[_0x40f1d0];return _0x45f139;};'use strict';function Channel(){this[_0x4e1c('0x0')]=null;this[_0x4e1c('0x1')]='';this[_0x4e1c('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x4e1c('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x4e1c('0x4')]=0x0;this[_0x4e1c('0x5')]='';this[_0x4e1c('0x6')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x4e1c('0x7')]=![];this[_0x4e1c('0x8')]=null;this[_0x4e1c('0x9')]=null;this[_0x4e1c('0xa')]=![];this[_0x4e1c('0xb')]=![];this[_0x4e1c('0xc')]='';this[_0x4e1c('0xd')]='';this[_0x4e1c('0xe')]=0x0;this[_0x4e1c('0xf')]=0x0;this[_0x4e1c('0x10')]=0x0;this[_0x4e1c('0x11')]=null;this[_0x4e1c('0x12')]=null;this[_0x4e1c('0x13')]=null;this['monitor']=![];this[_0x4e1c('0x14')]=null;this[_0x4e1c('0x15')]=null;this['monitors']=[];this[_0x4e1c('0x16')]=undefined;this[_0x4e1c('0x17')]=undefined;this[_0x4e1c('0x18')]=undefined;this[_0x4e1c('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 67f9a35..7bd2a64 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 _0xcd6b=['tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x21515a,_0x33e23f){var _0x346b31=function(_0x10e18f){while(--_0x10e18f){_0x21515a['push'](_0x21515a['shift']());}};_0x346b31(++_0x33e23f);}(_0xcd6b,0x1a8));var _0xbcd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6b[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x15f616){this['id']=_0x15f616['id']||0x0;this[_0xbcd6('0x0')]=_0x15f616['name']||'';this['username']=_0x15f616[_0xbcd6('0x1')]||'';this[_0xbcd6('0x2')]=_0x15f616[_0xbcd6('0x2')]||'';this[_0xbcd6('0x3')]=_0x15f616[_0xbcd6('0x3')]||'';this[_0xbcd6('0x4')]=_0x15f616[_0xbcd6('0x4')]||'';this[_0xbcd6('0x5')]=_0x15f616['consumerKey']||'';this[_0xbcd6('0x6')]=_0x15f616[_0xbcd6('0x6')]||'';this[_0xbcd6('0x7')]=_0x15f616[_0xbcd6('0x7')]||'';this['tokenSecret']=_0x15f616[_0xbcd6('0x8')]||'';this[_0xbcd6('0x9')]=_0x15f616[_0xbcd6('0x9')]||'';this[_0xbcd6('0xa')]=_0x15f616[_0xbcd6('0xa')]||'';this[_0xbcd6('0xb')]=_0x15f616[_0xbcd6('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x04e6=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x293db4,_0x9f8c9a){var _0x6f200f=function(_0x219957){while(--_0x219957){_0x293db4['push'](_0x293db4['shift']());}};_0x6f200f(++_0x9f8c9a);}(_0x04e6,0x8e));var _0x604e=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x04e6[_0x496333];return _0x44256e;};'use strict';function DeskAccount(_0x17c727){this['id']=_0x17c727['id']||0x0;this['name']=_0x17c727[_0x604e('0x0')]||'';this[_0x604e('0x1')]=_0x17c727['username']||'';this[_0x604e('0x2')]=_0x17c727['remoteUri']||'';this['authType']=_0x17c727[_0x604e('0x3')]||'';this['password']=_0x17c727[_0x604e('0x4')]||'';this[_0x604e('0x5')]=_0x17c727[_0x604e('0x5')]||'';this[_0x604e('0x6')]=_0x17c727['consumerSecret']||'';this[_0x604e('0x7')]=_0x17c727['token']||'';this[_0x604e('0x8')]=_0x17c727[_0x604e('0x8')]||'';this[_0x604e('0x9')]=_0x17c727[_0x604e('0x9')]||'';this[_0x604e('0xa')]=_0x17c727[_0x604e('0xa')]||'';this[_0x604e('0xb')]=_0x17c727[_0x604e('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 8b46660..8abc7a1 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 _0x2325=['CloudProvider','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x12d6ad,_0x2abeda){var _0x36b0c7=function(_0x5d841){while(--_0x5d841){_0x12d6ad['push'](_0x12d6ad['shift']());}};_0x36b0c7(++_0x2abeda);}(_0x2325,0x1cf));var _0x5232=function(_0x1e2868,_0x144b25){_0x1e2868=_0x1e2868-0x0;var _0x53dfc1=_0x2325[_0x1e2868];return _0x53dfc1;};'use strict';function Dynamics365Account(_0x242651){this['id']=_0x242651['id']||0x0;this[_0x5232('0x0')]=_0x242651[_0x5232('0x0')]||'';this['username']=_0x242651[_0x5232('0x1')]||'';this['password']=_0x242651[_0x5232('0x2')]||'';this[_0x5232('0x3')]=_0x242651[_0x5232('0x3')]||'';this[_0x5232('0x4')]=_0x242651[_0x5232('0x4')]||'';this['clientId']=_0x242651[_0x5232('0x5')]||'';this[_0x5232('0x6')]=_0x242651[_0x5232('0x6')]||{};this[_0x5232('0x7')]=_0x242651[_0x5232('0x7')]||'';this[_0x5232('0x8')]=_0x242651['modernAuthentication']||![];this[_0x5232('0x9')]=_0x242651[_0x5232('0x9')]||{};this['CloudProvider']=_0x242651[_0x5232('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x9a14=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9a14,0x1eb));var _0x49a1=function(_0x42828b,_0x5df5dd){_0x42828b=_0x42828b-0x0;var _0x2d17c7=_0x9a14[_0x42828b];return _0x2d17c7;};'use strict';function Dynamics365Account(_0x192fa6){this['id']=_0x192fa6['id']||0x0;this[_0x49a1('0x0')]=_0x192fa6[_0x49a1('0x0')]||'';this[_0x49a1('0x1')]=_0x192fa6[_0x49a1('0x1')]||'';this[_0x49a1('0x2')]=_0x192fa6[_0x49a1('0x2')]||'';this[_0x49a1('0x3')]=_0x192fa6[_0x49a1('0x3')]||'';this['tenantId']=_0x192fa6[_0x49a1('0x4')]||'';this[_0x49a1('0x5')]=_0x192fa6[_0x49a1('0x5')]||'';this[_0x49a1('0x6')]=_0x192fa6[_0x49a1('0x6')]||{};this['serverUrl']=_0x192fa6[_0x49a1('0x7')]||'';this[_0x49a1('0x8')]=_0x192fa6[_0x49a1('0x8')]||![];this[_0x49a1('0x9')]=_0x192fa6[_0x49a1('0x9')]||{};this[_0x49a1('0xa')]=_0x192fa6[_0x49a1('0xa')]||{};}module[_0x49a1('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 025060b..b1d3637 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 _0x8b6b=['localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','headerinfo'];(function(_0x452f73,_0x3015da){var _0xa650f2=function(_0x457eb4){while(--_0x457eb4){_0x452f73['push'](_0x452f73['shift']());}};_0xa650f2(++_0x3015da);}(_0x8b6b,0x7d));var _0xb8b6=function(_0x4a0bce,_0x7fc6b4){_0x4a0bce=_0x4a0bce-0x0;var _0x2188ad=_0x8b6b[_0x4a0bce];return _0x2188ad;};'use strict';function FaxAccount(_0x48a3c9){this['id']=_0x48a3c9['id']||0x0;this[_0xb8b6('0x0')]=_0x48a3c9[_0xb8b6('0x0')]||'';this[_0xb8b6('0x1')]=_0x48a3c9[_0xb8b6('0x1')];this['ecm']=_0x48a3c9['ecm'];this[_0xb8b6('0x2')]=_0x48a3c9[_0xb8b6('0x2')];this['localstationid']=_0x48a3c9[_0xb8b6('0x3')];this[_0xb8b6('0x4')]=_0x48a3c9[_0xb8b6('0x4')]||0x960;this[_0xb8b6('0x5')]=_0x48a3c9[_0xb8b6('0x5')]||0x3840;this['modem']=_0x48a3c9['modem']||_0xb8b6('0x6');this[_0xb8b6('0x7')]=_0x48a3c9[_0xb8b6('0x7')]||'no';this[_0xb8b6('0x8')]=_0x48a3c9[_0xb8b6('0x8')]||'no';this[_0xb8b6('0x9')]=_0x48a3c9[_0xb8b6('0x9')]||0x1388;this['tech']=_0x48a3c9[_0xb8b6('0xa')]||_0xb8b6('0xb');this[_0xb8b6('0xc')]=_0x48a3c9[_0xb8b6('0xc')]?_0x48a3c9[_0xb8b6('0xc')]:undefined;this[_0xb8b6('0xd')]=_0x48a3c9[_0xb8b6('0xd')];this[_0xb8b6('0xe')]=_0x48a3c9[_0xb8b6('0xe')];}module[_0xb8b6('0xf')]=FaxAccount; \ No newline at end of file +var _0xcdef=['tech','SIP','Trunk','ListId','key','exports','name','headerinfo','localstationid','maxrate','modem','gateway','faxdetect','t38timeout'];(function(_0x4df85c,_0x248dfb){var _0x4e2a61=function(_0x4e2c8e){while(--_0x4e2c8e){_0x4df85c['push'](_0x4df85c['shift']());}};_0x4e2a61(++_0x248dfb);}(_0xcdef,0xca));var _0xfcde=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xcdef[_0x42cae2];return _0x5f256f;};'use strict';function FaxAccount(_0x452e07){this['id']=_0x452e07['id']||0x0;this[_0xfcde('0x0')]=_0x452e07[_0xfcde('0x0')]||'';this['description']=_0x452e07['description'];this['ecm']=_0x452e07['ecm'];this[_0xfcde('0x1')]=_0x452e07[_0xfcde('0x1')];this[_0xfcde('0x2')]=_0x452e07['localstationid'];this['minrate']=_0x452e07['minrate']||0x960;this[_0xfcde('0x3')]=_0x452e07[_0xfcde('0x3')]||0x3840;this[_0xfcde('0x4')]=_0x452e07['modem']||'v17,v27,v29';this['gateway']=_0x452e07[_0xfcde('0x5')]||'no';this[_0xfcde('0x6')]=_0x452e07[_0xfcde('0x6')]||'no';this[_0xfcde('0x7')]=_0x452e07['t38timeout']||0x1388;this[_0xfcde('0x8')]=_0x452e07[_0xfcde('0x8')]||_0xfcde('0x9');this[_0xfcde('0xa')]=_0x452e07[_0xfcde('0xa')]?_0x452e07['Trunk']:undefined;this[_0xfcde('0xb')]=_0x452e07[_0xfcde('0xb')];this[_0xfcde('0xc')]=_0x452e07[_0xfcde('0xc')];}module[_0xfcde('0xd')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b043287..6298f70 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 _0xc6fd=['username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x224c5e,_0x574664){var _0x31591b=function(_0x5290fa){while(--_0x5290fa){_0x224c5e['push'](_0x224c5e['shift']());}};_0x31591b(++_0x574664);}(_0xc6fd,0x7e));var _0xdc6f=function(_0x4d8f59,_0xd351f2){_0x4d8f59=_0x4d8f59-0x0;var _0x5c2506=_0xc6fd[_0x4d8f59];return _0x5c2506;};'use strict';function FreshdeskAccount(_0x10f48b){this['id']=_0x10f48b['id']||0x0;this['name']=_0x10f48b['name']||'';this[_0xdc6f('0x0')]=_0x10f48b[_0xdc6f('0x0')]||'';this['apiKey']=_0x10f48b[_0xdc6f('0x1')]||'';this[_0xdc6f('0x2')]=_0x10f48b['remoteUri']||'';this[_0xdc6f('0x3')]=_0x10f48b[_0xdc6f('0x3')]||'';this[_0xdc6f('0x4')]=_0x10f48b[_0xdc6f('0x4')]||{};}module[_0xdc6f('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xc89f=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x4398c1,_0xb83ec1){var _0xd720f1=function(_0x51ffe1){while(--_0x51ffe1){_0x4398c1['push'](_0x4398c1['shift']());}};_0xd720f1(++_0xb83ec1);}(_0xc89f,0x1c2));var _0xfc89=function(_0x5d4f70,_0x5e8506){_0x5d4f70=_0x5d4f70-0x0;var _0x39bc3b=_0xc89f[_0x5d4f70];return _0x39bc3b;};'use strict';function FreshdeskAccount(_0x7385be){this['id']=_0x7385be['id']||0x0;this[_0xfc89('0x0')]=_0x7385be[_0xfc89('0x0')]||'';this[_0xfc89('0x1')]=_0x7385be[_0xfc89('0x1')]||'';this[_0xfc89('0x2')]=_0x7385be[_0xfc89('0x3')]||'';this[_0xfc89('0x4')]=_0x7385be[_0xfc89('0x4')]||'';this[_0xfc89('0x5')]=_0x7385be['serverUrl']||'';this[_0xfc89('0x6')]=_0x7385be[_0xfc89('0x6')]||{};}module[_0xfc89('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 360be98..3654b11 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 _0xd8fb=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x57dfaa,_0x4a79e6){var _0x184641=function(_0x1a7b07){while(--_0x1a7b07){_0x57dfaa['push'](_0x57dfaa['shift']());}};_0x184641(++_0x4a79e6);}(_0xd8fb,0x99));var _0xbd8f=function(_0x558718,_0x1fdc90){_0x558718=_0x558718-0x0;var _0x31e7af=_0xd8fb[_0x558718];return _0x31e7af;};'use strict';function FreshsalesAccount(_0x66e31){this['id']=_0x66e31['id']||0x0;this[_0xbd8f('0x0')]=_0x66e31[_0xbd8f('0x0')]||'';this[_0xbd8f('0x1')]=_0x66e31['username']||'';this['apiKey']=_0x66e31['token']||'';this[_0xbd8f('0x2')]=_0x66e31[_0xbd8f('0x2')]||'';this['serverUrl']=_0x66e31[_0xbd8f('0x3')]||'';this[_0xbd8f('0x4')]=_0x66e31['Configurations']||{};}module[_0xbd8f('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0x16a6=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x16a6,0x15c));var _0x616a=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0x16a6[_0x115621];return _0x5ef5ce;};'use strict';function FreshsalesAccount(_0x563d7e){this['id']=_0x563d7e['id']||0x0;this[_0x616a('0x0')]=_0x563d7e['name']||'';this[_0x616a('0x1')]=_0x563d7e[_0x616a('0x1')]||'';this[_0x616a('0x2')]=_0x563d7e[_0x616a('0x3')]||'';this[_0x616a('0x4')]=_0x563d7e[_0x616a('0x4')]||'';this['serverUrl']=_0x563d7e[_0x616a('0x5')]||'';this[_0x616a('0x6')]=_0x563d7e['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 5e5a007..8fa17c6 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 _0x798c=['mohtime','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','exten','priority','holdtime','lastAssignedTo','motionChannel','voice'];(function(_0x1af8d3,_0x544d86){var _0x3a50c5=function(_0x4179aa){while(--_0x4179aa){_0x1af8d3['push'](_0x1af8d3['shift']());}};_0x3a50c5(++_0x544d86);}(_0x798c,0x188));var _0xc798=function(_0xa8c0b9,_0x158b3e){_0xa8c0b9=_0xa8c0b9-0x0;var _0x566982=_0x798c[_0xa8c0b9];return _0x566982;};'use strict';function QueueReport(){this[_0xc798('0x0')]=_0xc798('0x1');this[_0xc798('0x2')]='';this[_0xc798('0x3')]='';this[_0xc798('0x4')]='';this[_0xc798('0x5')]='';this['queuecallerjoinAt']=null;this[_0xc798('0x6')]=null;this[_0xc798('0x7')]=0x1;this[_0xc798('0x8')]=0x1;this[_0xc798('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xc798('0xa')]=![];this[_0xc798('0xb')]=null;this[_0xc798('0xc')]=![];this['queuecallerexitAt']=null;this[_0xc798('0xd')]=0x1;this[_0xc798('0xe')]='';this[_0xc798('0xf')]='';this['connectedlinename']='';this['accountcode']='';this['context']='';this[_0xc798('0x10')]='';this[_0xc798('0x11')]='';this[_0xc798('0x12')]=0x0;this['assigned']=![];this[_0xc798('0x13')]='';this[_0xc798('0x14')]=_0xc798('0x15');this[_0xc798('0x16')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x627d=['channel','connectedlinename','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition'];(function(_0x24fd2b,_0x58c575){var _0x571d2a=function(_0x3fbcf1){while(--_0x3fbcf1){_0x24fd2b['push'](_0x24fd2b['shift']());}};_0x571d2a(++_0x58c575);}(_0x627d,0xab));var _0xd627=function(_0xd341a,_0x238ce0){_0xd341a=_0xd341a-0x0;var _0x545c03=_0x627d[_0xd341a];return _0x545c03;};'use strict';function QueueReport(){this[_0xd627('0x0')]=_0xd627('0x1');this['uniqueid']='';this['calleridnum']='';this[_0xd627('0x2')]='';this['queue']='';this[_0xd627('0x3')]=null;this[_0xd627('0x4')]=null;this[_0xd627('0x5')]=0x1;this[_0xd627('0x6')]=0x1;this[_0xd627('0x7')]=![];this[_0xd627('0x8')]=null;this['queuecallercomplete']=![];this[_0xd627('0x9')]=null;this[_0xd627('0xa')]=![];this[_0xd627('0xb')]=null;this[_0xd627('0xc')]=0x1;this[_0xd627('0xd')]='';this['connectedlinenum']='';this[_0xd627('0xe')]='';this['accountcode']='';this['context']='';this['exten']='';this[_0xd627('0xf')]='';this[_0xd627('0x10')]=0x0;this[_0xd627('0x11')]=![];this[_0xd627('0x12')]='';this[_0xd627('0x13')]=_0xd627('0x14');this[_0xd627('0x15')]=0x0;this[_0xd627('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 47409cb..bcf144c 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 _0x2bbc=['clientSecret','securityToken','serverUrl','Configurations','name','username','remoteUri','password','clientId'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x2bbc,0x1ea));var _0xc2bb=function(_0xb7689c,_0x255cd9){_0xb7689c=_0xb7689c-0x0;var _0x2769a6=_0x2bbc[_0xb7689c];return _0x2769a6;};'use strict';function SalesforceAccount(_0x2ca441){this['id']=_0x2ca441['id']||0x0;this[_0xc2bb('0x0')]=_0x2ca441[_0xc2bb('0x0')]||'';this[_0xc2bb('0x1')]=_0x2ca441['username']||'';this[_0xc2bb('0x2')]=_0x2ca441[_0xc2bb('0x2')]||'';this[_0xc2bb('0x3')]=_0x2ca441[_0xc2bb('0x3')]||'';this[_0xc2bb('0x4')]=_0x2ca441[_0xc2bb('0x4')]||'';this['clientSecret']=_0x2ca441[_0xc2bb('0x5')]||'';this[_0xc2bb('0x6')]=_0x2ca441[_0xc2bb('0x6')]||'';this['type']=_0x2ca441['type']||'integrationTab';this['serverUrl']=_0x2ca441[_0xc2bb('0x7')]||'';this[_0xc2bb('0x8')]=_0x2ca441[_0xc2bb('0x8')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x07b2=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x56e891,_0x28e6e4){var _0x1af3ab=function(_0x5e4069){while(--_0x5e4069){_0x56e891['push'](_0x56e891['shift']());}};_0x1af3ab(++_0x28e6e4);}(_0x07b2,0x1ee));var _0x207b=function(_0x1a55a8,_0x4e2b57){_0x1a55a8=_0x1a55a8-0x0;var _0x4f37c4=_0x07b2[_0x1a55a8];return _0x4f37c4;};'use strict';function SalesforceAccount(_0x232c0a){this['id']=_0x232c0a['id']||0x0;this['name']=_0x232c0a[_0x207b('0x0')]||'';this['username']=_0x232c0a[_0x207b('0x1')]||'';this[_0x207b('0x2')]=_0x232c0a[_0x207b('0x2')]||'';this[_0x207b('0x3')]=_0x232c0a[_0x207b('0x3')]||'';this[_0x207b('0x4')]=_0x232c0a[_0x207b('0x4')]||'';this[_0x207b('0x5')]=_0x232c0a['clientSecret']||'';this[_0x207b('0x6')]=_0x232c0a['securityToken']||'';this[_0x207b('0x7')]=_0x232c0a[_0x207b('0x7')]||_0x207b('0x8');this['serverUrl']=_0x232c0a[_0x207b('0x9')]||'';this[_0x207b('0xa')]=_0x232c0a[_0x207b('0xa')]||{};}module[_0x207b('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 31292c1..844c816 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 _0x84e0=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x5440a1,_0x458f21){var _0x36a648=function(_0x109497){while(--_0x109497){_0x5440a1['push'](_0x5440a1['shift']());}};_0x36a648(++_0x458f21);}(_0x84e0,0x1bd));var _0x084e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84e0[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x1cfa5c){this['id']=_0x1cfa5c['id']||0x0;this[_0x084e('0x0')]=_0x1cfa5c[_0x084e('0x0')]||'';this[_0x084e('0x1')]=_0x1cfa5c[_0x084e('0x1')]||'';this[_0x084e('0x2')]=_0x1cfa5c[_0x084e('0x2')]||'';this[_0x084e('0x3')]=_0x1cfa5c[_0x084e('0x3')]||'';this[_0x084e('0x4')]=_0x1cfa5c[_0x084e('0x4')]||'';this[_0x084e('0x5')]=_0x1cfa5c[_0x084e('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x8cc4=['Configurations','exports','name','remoteUri','serverUrl'];(function(_0xf67a90,_0x2eb2f3){var _0x648b2=function(_0x298232){while(--_0x298232){_0xf67a90['push'](_0xf67a90['shift']());}};_0x648b2(++_0x2eb2f3);}(_0x8cc4,0xd9));var _0x48cc=function(_0x488982,_0x3e260c){_0x488982=_0x488982-0x0;var _0xfe389c=_0x8cc4[_0x488982];return _0xfe389c;};'use strict';function ServicenowAccount(_0x3cd196){this['id']=_0x3cd196['id']||0x0;this[_0x48cc('0x0')]=_0x3cd196[_0x48cc('0x0')]||'';this['username']=_0x3cd196['username']||'';this['password']=_0x3cd196['password']||'';this[_0x48cc('0x1')]=_0x3cd196[_0x48cc('0x1')]||'';this[_0x48cc('0x2')]=_0x3cd196['serverUrl']||'';this[_0x48cc('0x3')]=_0x3cd196['Configurations']||{};}module[_0x48cc('0x4')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 19cbd16..3c38377 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 _0x629f=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x491c1e,_0x32710a){var _0x30d20b=function(_0x586f3b){while(--_0x586f3b){_0x491c1e['push'](_0x491c1e['shift']());}};_0x30d20b(++_0x32710a);}(_0x629f,0x174));var _0xf629=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x629f[_0x4c1ec2];return _0x3f6f1c;};'use strict';function SugarcrmAccount(_0x4506b4){this['id']=_0x4506b4['id']||0x0;this[_0xf629('0x0')]=_0x4506b4[_0xf629('0x0')]||'';this[_0xf629('0x1')]=_0x4506b4[_0xf629('0x1')]||'';this['password']=_0x4506b4[_0xf629('0x2')]||'';this[_0xf629('0x3')]=_0x4506b4[_0xf629('0x3')]||'';this['serverUrl']=_0x4506b4[_0xf629('0x4')]||'';this[_0xf629('0x5')]=_0x4506b4[_0xf629('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x3a08=['password','serverUrl','Configurations','exports','name','username'];(function(_0x361736,_0xe0804e){var _0xd70b31=function(_0x25604b){while(--_0x25604b){_0x361736['push'](_0x361736['shift']());}};_0xd70b31(++_0xe0804e);}(_0x3a08,0x10c));var _0x83a0=function(_0x4e4a3f,_0x42009f){_0x4e4a3f=_0x4e4a3f-0x0;var _0x3b2b12=_0x3a08[_0x4e4a3f];return _0x3b2b12;};'use strict';function SugarcrmAccount(_0x36587f){this['id']=_0x36587f['id']||0x0;this[_0x83a0('0x0')]=_0x36587f['name']||'';this[_0x83a0('0x1')]=_0x36587f[_0x83a0('0x1')]||'';this[_0x83a0('0x2')]=_0x36587f[_0x83a0('0x2')]||'';this['remoteUri']=_0x36587f['remoteUri']||'';this[_0x83a0('0x3')]=_0x36587f['serverUrl']||'';this[_0x83a0('0x4')]=_0x36587f[_0x83a0('0x4')]||{};}module[_0x83a0('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 970a3f2..5765a44 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 _0x44e6=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x2edc96,_0x11d9cd){var _0xf5c028=function(_0x1d8166){while(--_0x1d8166){_0x2edc96['push'](_0x2edc96['shift']());}};_0xf5c028(++_0x11d9cd);}(_0x44e6,0xa9));var _0x644e=function(_0x31aa05,_0x190889){_0x31aa05=_0x31aa05-0x0;var _0x59437d=_0x44e6[_0x31aa05];return _0x59437d;};'use strict';function Telephone(_0x4ec5d4){this['id']=_0x4ec5d4['id']||0x0;this[_0x644e('0x0')]=_0x4ec5d4[_0x644e('0x0')]||'';this[_0x644e('0x1')]=_0x4ec5d4[_0x644e('0x1')]||'';this[_0x644e('0x2')]=_0x644e('0x3');this[_0x644e('0x4')]=0x0;this[_0x644e('0x5')]=_0x644e('0x3');this[_0x644e('0x6')]='';}module[_0x644e('0x7')]=Telephone; \ No newline at end of file +var _0xebb1=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xebb1,0x1e3));var _0x1ebb=function(_0x1bb7f2,_0x1f3733){_0x1bb7f2=_0x1bb7f2-0x0;var _0x57ff7e=_0xebb1[_0x1bb7f2];return _0x57ff7e;};'use strict';function Telephone(_0x5edf3c){this['id']=_0x5edf3c['id']||0x0;this[_0x1ebb('0x0')]=_0x5edf3c[_0x1ebb('0x0')]||'';this[_0x1ebb('0x1')]=_0x5edf3c[_0x1ebb('0x1')]||'';this[_0x1ebb('0x2')]=_0x1ebb('0x3');this[_0x1ebb('0x4')]=0x0;this[_0x1ebb('0x5')]=_0x1ebb('0x3');this[_0x1ebb('0x6')]='';}module[_0x1ebb('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index aaf8af3..7aba59d 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(_0x360515,_0xfc58b6){var _0x3dc3c8=function(_0x5325f0){while(--_0x5325f0){_0x360515['push'](_0x360515['shift']());}};_0x3dc3c8(++_0xfc58b6);}(_0xb10b,0x12a));var _0xbb10=function(_0x3da241,_0xeba26a){_0x3da241=_0x3da241-0x0;var _0x43e156=_0xb10b[_0x3da241];return _0x43e156;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x206c96,_0x355232){var _0x413575=function(_0x599454){while(--_0x599454){_0x206c96['push'](_0x206c96['shift']());}};_0x413575(++_0x355232);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index dc0ed32..9d76ac8 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x53c148,_0x5b5327){var _0x59377d=function(_0xda2130){while(--_0xda2130){_0x53c148['push'](_0x53c148['shift']());}};_0x59377d(++_0x5b5327);}(_0xda3f,0xec));var _0xfda3=function(_0x32d709,_0x3df305){_0x32d709=_0x32d709-0x0;var _0x6d0864=_0xda3f[_0x32d709];return _0x6d0864;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f3d420f..2cfa927 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 _0xd9bf=['defaultuser','active','state','unknown','stateTime','status','registry','indexOf','split','port','domainport','refresh','stateRegistry','registrationtime','address'];(function(_0x21e152,_0x4ce056){var _0x5c9053=function(_0x3357ea){while(--_0x3357ea){_0x21e152['push'](_0x21e152['shift']());}};_0x5c9053(++_0x4ce056);}(_0xd9bf,0x79));var _0xfd9b=function(_0x294c3a,_0x514ba2){_0x294c3a=_0x294c3a-0x0;var _0x426b48=_0xd9bf[_0x294c3a];return _0x426b48;};'use strict';function Trunk(_0x4cb3eb){this['id']=_0x4cb3eb['id']||0x0;this[_0xfd9b('0x0')]=_0x4cb3eb['active']||![];this['name']=_0x4cb3eb['name']||'';this[_0xfd9b('0x1')]=_0xfd9b('0x2');this[_0xfd9b('0x3')]=0x0;this[_0xfd9b('0x4')]=_0xfd9b('0x2');this[_0xfd9b('0x5')]=_0x4cb3eb[_0xfd9b('0x5')]&&_0x4cb3eb[_0xfd9b('0x5')][_0xfd9b('0x6')](':')?_0x4cb3eb[_0xfd9b('0x5')][_0xfd9b('0x7')](':')[0x0]:'';this['host']='';this[_0xfd9b('0x8')]='';this['domain']='';this[_0xfd9b('0x9')]='';this[_0xfd9b('0xa')]='';this[_0xfd9b('0xb')]=_0xfd9b('0x2');this[_0xfd9b('0xc')]='';this[_0xfd9b('0xd')]='';this[_0xfd9b('0xe')]=_0x4cb3eb[_0xfd9b('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x9910=['split','host','port','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','unknown','status','registry','indexOf'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x9910,0x69));var _0x0991=function(_0xa8c58e,_0xfbc3cd){_0xa8c58e=_0xa8c58e-0x0;var _0x56ffdf=_0x9910[_0xa8c58e];return _0x56ffdf;};'use strict';function Trunk(_0x5a40e2){this['id']=_0x5a40e2['id']||0x0;this[_0x0991('0x0')]=_0x5a40e2[_0x0991('0x0')]||![];this[_0x0991('0x1')]=_0x5a40e2[_0x0991('0x1')]||'';this[_0x0991('0x2')]=_0x0991('0x3');this['stateTime']=0x0;this[_0x0991('0x4')]=_0x0991('0x3');this[_0x0991('0x5')]=_0x5a40e2[_0x0991('0x5')]&&_0x5a40e2[_0x0991('0x5')][_0x0991('0x6')](':')?_0x5a40e2[_0x0991('0x5')][_0x0991('0x7')](':')[0x0]:'';this[_0x0991('0x8')]='';this[_0x0991('0x9')]='';this['domain']='';this[_0x0991('0xa')]='';this[_0x0991('0xb')]='';this[_0x0991('0xc')]=_0x0991('0x3');this[_0x0991('0xd')]='';this[_0x0991('0xe')]='';this[_0x0991('0xf')]=_0x5a40e2[_0x0991('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 35c0f69..6a9c889 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 _0x606d=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x304241,_0x4c73ac){var _0x3d80b4=function(_0x98c459){while(--_0x98c459){_0x304241['push'](_0x304241['shift']());}};_0x3d80b4(++_0x4c73ac);}(_0x606d,0x97));var _0xd606=function(_0x3833aa,_0x28190a){_0x3833aa=_0x3833aa-0x0;var _0x3b0da9=_0x606d[_0x3833aa];return _0x3b0da9;};'use strict';function voiceExtension(_0x5354fa){this['id']=_0x5354fa['id']||0x0;this['exten']=_0x5354fa[_0xd606('0x0')]||'';this[_0xd606('0x1')]=_0x5354fa[_0xd606('0x1')]||_0xd606('0x2');this[_0xd606('0x3')]=_0x5354fa['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x586e=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x586e,0x7f));var _0xe586=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0x586e[_0x2525f1];return _0x13c1b5;};'use strict';function voiceExtension(_0x113f80){this['id']=_0x113f80['id']||0x0;this[_0xe586('0x0')]=_0x113f80[_0xe586('0x0')]||'';this[_0xe586('0x1')]=_0x113f80[_0xe586('0x1')]||'none';this[_0xe586('0x2')]=_0x113f80[_0xe586('0x2')]||![];}module[_0xe586('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 98f2aac..5b6f641 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 _0xb796=['dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','inuse','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x22bcbd,_0x373f17){var _0x2155ff=function(_0x24dd8d){while(--_0x24dd8d){_0x22bcbd['push'](_0x22bcbd['shift']());}};_0x2155ff(++_0x373f17);}(_0xb796,0xc0));var _0x6b79=function(_0x1f7717,_0x752d35){_0x1f7717=_0x1f7717-0x0;var _0x4b4c48=_0xb796[_0x1f7717];return _0x4b4c48;};'use strict';var statusDesc=['unknown','not_inuse',_0x6b79('0x0'),'busy','invalid',_0x6b79('0x1'),_0x6b79('0x2'),_0x6b79('0x3'),_0x6b79('0x4')];var monitorFormat={'wav':_0x6b79('0x5'),'wav49':_0x6b79('0x6'),'gsm':_0x6b79('0x7')};var strategy={'rrmemory':_0x6b79('0x8'),'roundrobin':_0x6b79('0x9')};function VoiceQueue(_0x160d45){this['id']=_0x160d45['id']||0x0;this[_0x6b79('0xa')]=_0x160d45[_0x6b79('0xa')]||'';this[_0x6b79('0xb')]=_0x160d45[_0x6b79('0xb')]||'';this[_0x6b79('0xc')]=_0x160d45['type']||_0x6b79('0xd');this[_0x6b79('0xe')]=0x0;this[_0x6b79('0xf')]=0x0;this[_0x6b79('0x10')]=0x0;this[_0x6b79('0x11')]=0x0;this[_0x6b79('0x12')]=0x0;this[_0x6b79('0x13')]=0x0;this['sumBillable']=0x0;this[_0x6b79('0x14')]=0x0;this[_0x6b79('0x15')]=0x0;this[_0x6b79('0x16')]=0x0;this[_0x6b79('0x17')]=0x0;this[_0x6b79('0x18')]=_0x160d45[_0x6b79('0x18')]||![];this[_0x6b79('0x19')]=_0x160d45[_0x6b79('0x19')]||0xa;this[_0x6b79('0x1a')]=_0x160d45[_0x6b79('0x1a')]||'no';this[_0x6b79('0x1b')]=!![];this[_0x6b79('0x1c')]='';this[_0x6b79('0x1d')]=0x0;this[_0x6b79('0x1e')]=0x0;this[_0x6b79('0x1f')]=_0x160d45[_0x6b79('0x1f')]||null;this['dialGlobalInterval']=_0x160d45[_0x6b79('0x20')]?_0x160d45[_0x6b79('0x20')]:null;this['dialActive']=_0x160d45[_0x6b79('0x21')];this['dialMethod']=_0x160d45[_0x6b79('0x22')]||'progressive';this[_0x6b79('0x23')]=_0x160d45[_0x6b79('0x23')]||0x0;this['dialLimitQueue']=_0x160d45['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x160d45[_0x6b79('0x24')]||0x1;this[_0x6b79('0x25')]=_0x160d45[_0x6b79('0x25')]||_0x6b79('0x26');this[_0x6b79('0x27')]=_0x160d45['dialPredictiveOptimizationPercentage']||0.03;this[_0x6b79('0x28')]=_0x160d45[_0x6b79('0x28')]||0x258;this[_0x6b79('0x29')]=_0x160d45[_0x6b79('0x29')]||_0x6b79('0x2a');this[_0x6b79('0x2b')]=_0x160d45['dialOriginateCallerIdNumber']||'anonymous';this[_0x6b79('0x2c')]=_0x160d45[_0x6b79('0x2c')]||0x1e;this[_0x6b79('0x2d')]=_0x160d45[_0x6b79('0x2d')]||_0x6b79('0x2e');this['dialQueueTimeout']=_0x160d45[_0x6b79('0x2f')]||0x3;this[_0x6b79('0x30')]=_0x160d45[_0x6b79('0x30')]||undefined;this['dialCongestionMaxRetry']=_0x160d45[_0x6b79('0x31')]||0x3;this['dialCongestionRetryFrequency']=_0x160d45[_0x6b79('0x32')]||0x96;this['dialBusyMaxRetry']=_0x160d45[_0x6b79('0x33')]||0x3;this[_0x6b79('0x34')]=_0x160d45['dialBusyRetryFrequency']||0x96;this[_0x6b79('0x35')]=_0x160d45['dialNoAnswerMaxRetry']||0x3;this[_0x6b79('0x36')]=_0x160d45[_0x6b79('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x160d45[_0x6b79('0x37')]||0x3;this[_0x6b79('0x38')]=_0x160d45[_0x6b79('0x38')]||0x96;this[_0x6b79('0x39')]=_0x160d45[_0x6b79('0x39')]||0x3;this[_0x6b79('0x3a')]=_0x160d45[_0x6b79('0x3a')]||0x96;this[_0x6b79('0x3b')]=_0x160d45[_0x6b79('0x3b')]||0x3;this[_0x6b79('0x3c')]=_0x160d45[_0x6b79('0x3c')]||0x96;this[_0x6b79('0x3d')]=_0x160d45[_0x6b79('0x3d')]||0x3;this[_0x6b79('0x3e')]=_0x160d45[_0x6b79('0x3e')]||0x96;this[_0x6b79('0x3f')]=_0x160d45['dialAgentRejectMaxRetry']||0x3;this[_0x6b79('0x40')]=_0x160d45[_0x6b79('0x40')]||0x96;this[_0x6b79('0x41')]=_0x160d45[_0x6b79('0x41')]||0x3;this[_0x6b79('0x42')]=_0x160d45[_0x6b79('0x42')]||0x4;this[_0x6b79('0x43')]=_0x160d45['Trunk']?_0x160d45[_0x6b79('0x43')]:undefined;this[_0x6b79('0x44')]=_0x160d45['TrunkBackup']?_0x160d45[_0x6b79('0x44')]:undefined;this[_0x6b79('0x45')]=_0x160d45[_0x6b79('0x45')]||undefined;this['Interval']=_0x160d45[_0x6b79('0x46')]?_0x160d45['Interval']:undefined;this['dialOrderByScheduledAt']=_0x160d45[_0x6b79('0x47')]||_0x6b79('0x48');this[_0x6b79('0x49')]=_0x160d45[_0x6b79('0x49')]||undefined;this[_0x6b79('0x4a')]=_0x160d45[_0x6b79('0x4a')]||undefined;this[_0x6b79('0x4b')]=strategy[_0x160d45[_0x6b79('0x4b')]]||'rrmemory';this[_0x6b79('0x4c')]=!![];this[_0x6b79('0x4d')]=_0x160d45[_0x6b79('0x4d')]||![];this['dialAMDInitialSilence']=_0x160d45[_0x6b79('0x4e')];this[_0x6b79('0x4f')]=_0x160d45[_0x6b79('0x4f')];this[_0x6b79('0x50')]=_0x160d45[_0x6b79('0x50')];this[_0x6b79('0x51')]=_0x160d45[_0x6b79('0x51')];this[_0x6b79('0x52')]=_0x160d45['dialAMDMinWordLength'];this[_0x6b79('0x53')]=_0x160d45['dialAMDBetweenWordsSilence'];this[_0x6b79('0x54')]=_0x160d45['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x160d45[_0x6b79('0x55')];this[_0x6b79('0x56')]=_0x160d45[_0x6b79('0x56')];this[_0x6b79('0x57')]=0x0;this['pTalking']=0x0;this[_0x6b79('0x58')]=_0x160d45[_0x6b79('0x58')];this[_0x6b79('0x59')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x6b79('0x5a')]=0x0;this[_0x6b79('0x5b')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x6b79('0x5c')]=0x0;this[_0x6b79('0x5d')]=0x0;this[_0x6b79('0x5e')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x6b79('0x5f')]=0x0;this[_0x6b79('0x60')]=0x0;this[_0x6b79('0x61')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x6b79('0x62')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x6b79('0x63')]=1.05;this[_0x6b79('0x64')]=0x0;this[_0x6b79('0x65')]=0x0;this[_0x6b79('0x66')]=0x0;this[_0x6b79('0x67')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x6b79('0x68')]=0x0;this[_0x6b79('0x69')]=0x0;this[_0x6b79('0x6a')]=_0x160d45['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x6b79('0x6b')]=_0x160d45[_0x6b79('0x6c')]||0xa;this[_0x6b79('0x6d')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x6b79('0x6e')]=0x1;this[_0x6b79('0x6f')]=0x0;this[_0x6b79('0x70')]=0x0;this[_0x6b79('0x71')]=0x0;this['erlangBusyFactor']=0x0;this[_0x6b79('0x72')]=_0x160d45[_0x6b79('0x72')]||0x1e;this[_0x6b79('0x73')]=_0x160d45[_0x6b79('0x73')]||![];this[_0x6b79('0x74')]=!!_0x160d45[_0x6b79('0x74')]||![];this[_0x6b79('0x75')]=!!_0x160d45['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x160d45['dialQueueProject2']||undefined;this[_0x6b79('0x76')]=_0x160d45[_0x6b79('0x76')]||![];this[_0x6b79('0x77')]=_0x160d45[_0x6b79('0x77')]||![];this[_0x6b79('0xb')]=monitorFormat[_0x160d45['monitor_format']]?monitorFormat[_0x160d45[_0x6b79('0xb')]]:undefined;this['mandatoryDisposition']=_0x160d45[_0x6b79('0x78')]||![];this[_0x6b79('0x79')]=_0x160d45[_0x6b79('0x79')]?_0x160d45[_0x6b79('0x79')]:undefined;}module[_0x6b79('0x7a')]=VoiceQueue; \ No newline at end of file +var _0xd99e=['predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','ringing','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold'];(function(_0x3420d6,_0x395bc6){var _0x487efc=function(_0x366b9a){while(--_0x366b9a){_0x3420d6['push'](_0x3420d6['shift']());}};_0x487efc(++_0x395bc6);}(_0xd99e,0x102));var _0xed99=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0xd99e[_0xa9a245];return _0x2d0eaa;};'use strict';var statusDesc=[_0xed99('0x0'),'not_inuse',_0xed99('0x1'),_0xed99('0x2'),_0xed99('0x3'),'unavailable',_0xed99('0x4'),_0xed99('0x5'),_0xed99('0x6')];var monitorFormat={'wav':_0xed99('0x7'),'wav49':'wav49','gsm':_0xed99('0x8')};var strategy={'rrmemory':_0xed99('0x9'),'roundrobin':_0xed99('0xa')};function VoiceQueue(_0x4542f4){this['id']=_0x4542f4['id']||0x0;this[_0xed99('0xb')]=_0x4542f4[_0xed99('0xb')]||'';this['monitor_format']=_0x4542f4[_0xed99('0xc')]||'';this['type']=_0x4542f4[_0xed99('0xd')]||_0xed99('0xe');this[_0xed99('0xf')]=0x0;this[_0xed99('0x10')]=0x0;this[_0xed99('0x11')]=0x0;this[_0xed99('0x12')]=0x0;this[_0xed99('0x13')]=0x0;this[_0xed99('0x14')]=0x0;this[_0xed99('0x15')]=0x0;this[_0xed99('0x16')]=0x0;this[_0xed99('0x17')]=0x0;this['loggedIn']=0x0;this[_0xed99('0x18')]=0x0;this[_0xed99('0x19')]=_0x4542f4[_0xed99('0x19')]||![];this['acwTimeout']=_0x4542f4[_0xed99('0x1a')]||0xa;this[_0xed99('0x1b')]=_0x4542f4[_0xed99('0x1b')]||'no';this[_0xed99('0x1c')]=!![];this['message']='';this[_0xed99('0x1d')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x4542f4[_0xed99('0x1e')]||null;this[_0xed99('0x1f')]=_0x4542f4[_0xed99('0x1f')]?_0x4542f4['dialGlobalInterval']:null;this[_0xed99('0x20')]=_0x4542f4[_0xed99('0x20')];this[_0xed99('0x21')]=_0x4542f4[_0xed99('0x21')]||_0xed99('0x22');this[_0xed99('0x23')]=_0x4542f4[_0xed99('0x23')]||0x0;this[_0xed99('0x24')]=_0x4542f4[_0xed99('0x24')]||0x0;this[_0xed99('0x25')]=_0x4542f4[_0xed99('0x25')]||0x1;this[_0xed99('0x26')]=_0x4542f4[_0xed99('0x26')]||_0xed99('0x27');this[_0xed99('0x28')]=_0x4542f4[_0xed99('0x28')]||0.03;this[_0xed99('0x29')]=_0x4542f4['dialPredictiveInterval']||0x258;this[_0xed99('0x2a')]=_0x4542f4['dialOriginateCallerIdName']||_0xed99('0x2b');this['dialOriginateCallerIdNumber']=_0x4542f4['dialOriginateCallerIdNumber']||_0xed99('0x2b');this[_0xed99('0x2c')]=_0x4542f4['dialOriginateTimeout']||0x1e;this[_0xed99('0x2d')]=_0x4542f4[_0xed99('0x2d')]||'tTxX';this[_0xed99('0x2e')]=_0x4542f4['dialQueueTimeout']||0x3;this[_0xed99('0x2f')]=_0x4542f4[_0xed99('0x2f')]||undefined;this[_0xed99('0x30')]=_0x4542f4[_0xed99('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x4542f4[_0xed99('0x31')]||0x96;this[_0xed99('0x32')]=_0x4542f4[_0xed99('0x32')]||0x3;this[_0xed99('0x33')]=_0x4542f4[_0xed99('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x4542f4[_0xed99('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4542f4[_0xed99('0x35')]||0x96;this[_0xed99('0x36')]=_0x4542f4[_0xed99('0x36')]||0x3;this[_0xed99('0x37')]=_0x4542f4[_0xed99('0x37')]||0x96;this[_0xed99('0x38')]=_0x4542f4[_0xed99('0x38')]||0x3;this[_0xed99('0x39')]=_0x4542f4[_0xed99('0x39')]||0x96;this[_0xed99('0x3a')]=_0x4542f4['dialAbandonedMaxRetry']||0x3;this[_0xed99('0x3b')]=_0x4542f4[_0xed99('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x4542f4['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x4542f4[_0xed99('0x3c')]||0x96;this[_0xed99('0x3d')]=_0x4542f4[_0xed99('0x3d')]||0x3;this[_0xed99('0x3e')]=_0x4542f4[_0xed99('0x3e')]||0x96;this['callAdditionalPhoneAfterMin']=_0x4542f4['callAdditionalPhoneAfterMin']||0x3;this[_0xed99('0x3f')]=_0x4542f4['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x4542f4[_0xed99('0x40')]?_0x4542f4[_0xed99('0x40')]:undefined;this[_0xed99('0x41')]=_0x4542f4[_0xed99('0x41')]?_0x4542f4[_0xed99('0x41')]:undefined;this['dialPrefix']=_0x4542f4[_0xed99('0x42')]||undefined;this['Interval']=_0x4542f4[_0xed99('0x43')]?_0x4542f4[_0xed99('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x4542f4[_0xed99('0x44')]||_0xed99('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x4542f4[_0xed99('0x46')]||undefined;this['dialCutDigit']=_0x4542f4[_0xed99('0x47')]||undefined;this['strategy']=strategy[_0x4542f4[_0xed99('0x48')]]||_0xed99('0x9');this[_0xed99('0x49')]=!![];this[_0xed99('0x4a')]=_0x4542f4[_0xed99('0x4a')]||![];this[_0xed99('0x4b')]=_0x4542f4[_0xed99('0x4b')];this[_0xed99('0x4c')]=_0x4542f4['dialAMDGreeting'];this[_0xed99('0x4d')]=_0x4542f4[_0xed99('0x4d')];this[_0xed99('0x4e')]=_0x4542f4[_0xed99('0x4e')];this[_0xed99('0x4f')]=_0x4542f4[_0xed99('0x4f')];this[_0xed99('0x50')]=_0x4542f4[_0xed99('0x50')];this['dialAMDMaximumNumberOfWords']=_0x4542f4[_0xed99('0x51')];this['dialAMDSilenceThreshold']=_0x4542f4[_0xed99('0x52')];this[_0xed99('0x53')]=_0x4542f4['dialAMDMaximumWordLength'];this[_0xed99('0x54')]=0x0;this[_0xed99('0x55')]=0x0;this[_0xed99('0x56')]=_0x4542f4[_0xed99('0x56')];this[_0xed99('0x57')]=0x0;this[_0xed99('0x58')]=0x0;this[_0xed99('0x59')]=0x0;this[_0xed99('0x5a')]=0x0;this[_0xed99('0x5b')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xed99('0x5c')]=0x0;this[_0xed99('0x5d')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xed99('0x5e')]=0x0;this[_0xed99('0x5f')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xed99('0x60')]=undefined;this[_0xed99('0x61')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xed99('0x62')]=0x0;this[_0xed99('0x63')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xed99('0x64')]=0x0;this[_0xed99('0x65')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xed99('0x66')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4542f4[_0xed99('0x67')]||0x14;this[_0xed99('0x68')]=_0x4542f4[_0xed99('0x67')]||0xa;this[_0xed99('0x69')]=0x0;this[_0xed99('0x6a')]=0x0;this[_0xed99('0x6b')]=0x1;this[_0xed99('0x6c')]=0x0;this[_0xed99('0x6d')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xed99('0x6e')]=0x0;this['dialRecallMeTimeout']=_0x4542f4[_0xed99('0x6f')]||0x1e;this['dialRecallInQueue']=_0x4542f4[_0xed99('0x70')]||![];this[_0xed99('0x71')]=!!_0x4542f4[_0xed99('0x71')]||![];this[_0xed99('0x72')]=!!_0x4542f4[_0xed99('0x72')]||![];this[_0xed99('0x73')]=_0x4542f4[_0xed99('0x73')]||undefined;this[_0xed99('0x74')]=_0x4542f4[_0xed99('0x74')]||![];this[_0xed99('0x75')]=_0x4542f4['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x4542f4[_0xed99('0xc')]]?monitorFormat[_0x4542f4[_0xed99('0xc')]]:undefined;this[_0xed99('0x76')]=_0x4542f4['mandatoryDisposition']||![];this[_0xed99('0x77')]=_0x4542f4[_0xed99('0x77')]?_0x4542f4[_0xed99('0x77')]:undefined;}module[_0xed99('0x78')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 8fb74e6..038abad 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 _0x34d1=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x34d1,0xb9));var _0x134d=function(_0xc8debf,_0x1772d7){_0xc8debf=_0xc8debf-0x0;var _0x96236f=_0x34d1[_0xc8debf];return _0x96236f;};'use strict';function VtigerAccount(_0xb96e16){this['id']=_0xb96e16['id']||0x0;this[_0x134d('0x0')]=_0xb96e16[_0x134d('0x0')]||'';this[_0x134d('0x1')]=_0xb96e16['username']||'';this[_0x134d('0x2')]=_0xb96e16[_0x134d('0x2')]||'';this[_0x134d('0x3')]=_0xb96e16[_0x134d('0x3')]||'';this[_0x134d('0x4')]=_0xb96e16[_0x134d('0x4')]||'';this[_0x134d('0x5')]=_0xb96e16[_0x134d('0x5')]||{};}module[_0x134d('0x6')]=VtigerAccount; \ No newline at end of file +var _0x216e=['serverUrl','Configurations','exports','name','accessKey','remoteUri'];(function(_0x299ef7,_0x106e8c){var _0x283d59=function(_0xc7abe5){while(--_0xc7abe5){_0x299ef7['push'](_0x299ef7['shift']());}};_0x283d59(++_0x106e8c);}(_0x216e,0x117));var _0xe216=function(_0x4bdcdd,_0x5b0462){_0x4bdcdd=_0x4bdcdd-0x0;var _0x3c1555=_0x216e[_0x4bdcdd];return _0x3c1555;};'use strict';function VtigerAccount(_0x14077e){this['id']=_0x14077e['id']||0x0;this[_0xe216('0x0')]=_0x14077e[_0xe216('0x0')]||'';this['username']=_0x14077e['username']||'';this[_0xe216('0x1')]=_0x14077e['accessKey']||'';this[_0xe216('0x2')]=_0x14077e[_0xe216('0x2')]||'';this['serverUrl']=_0x14077e[_0xe216('0x3')]||'';this[_0xe216('0x4')]=_0x14077e[_0xe216('0x4')]||{};}module[_0xe216('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index da89486..3390c83 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 _0x1da5=['type','serverUrl','Configurations','exports','name','username','password','token','authType'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x1da5,0x112));var _0x51da=function(_0x123035,_0x122952){_0x123035=_0x123035-0x0;var _0x516c5f=_0x1da5[_0x123035];return _0x516c5f;};'use strict';function ZendeskAccount(_0xce29f4){this['id']=_0xce29f4['id']||0x0;this[_0x51da('0x0')]=_0xce29f4[_0x51da('0x0')]||'';this[_0x51da('0x1')]=_0xce29f4[_0x51da('0x1')]||'';this[_0x51da('0x2')]=_0xce29f4[_0x51da('0x2')]||'';this[_0x51da('0x3')]=_0xce29f4[_0x51da('0x3')]||'';this['remoteUri']=_0xce29f4['remoteUri']||'';this[_0x51da('0x4')]=_0xce29f4[_0x51da('0x4')]||'';this[_0x51da('0x5')]=_0xce29f4[_0x51da('0x5')]||'integrationTab';this['serverUrl']=_0xce29f4[_0x51da('0x6')]||'';this['Configurations']=_0xce29f4[_0x51da('0x7')]||{};}module[_0x51da('0x8')]=ZendeskAccount; \ No newline at end of file +var _0xc9e6=['token','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x28f83c,_0x2f1257){var _0x4210ba=function(_0x485ac1){while(--_0x485ac1){_0x28f83c['push'](_0x28f83c['shift']());}};_0x4210ba(++_0x2f1257);}(_0xc9e6,0x7d));var _0x6c9e=function(_0x4571ba,_0x8f4c5d){_0x4571ba=_0x4571ba-0x0;var _0x226f48=_0xc9e6[_0x4571ba];return _0x226f48;};'use strict';function ZendeskAccount(_0x57aa16){this['id']=_0x57aa16['id']||0x0;this[_0x6c9e('0x0')]=_0x57aa16[_0x6c9e('0x0')]||'';this[_0x6c9e('0x1')]=_0x57aa16['username']||'';this[_0x6c9e('0x2')]=_0x57aa16[_0x6c9e('0x2')]||'';this[_0x6c9e('0x3')]=_0x57aa16['token']||'';this['remoteUri']=_0x57aa16['remoteUri']||'';this['authType']=_0x57aa16['authType']||'';this[_0x6c9e('0x4')]=_0x57aa16[_0x6c9e('0x4')]||_0x6c9e('0x5');this[_0x6c9e('0x6')]=_0x57aa16[_0x6c9e('0x6')]||'';this[_0x6c9e('0x7')]=_0x57aa16[_0x6c9e('0x7')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 326ffd1..6e38cbc 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 _0x0d07=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0d07,0xb0));var _0x70d0=function(_0x34bfb9,_0x2df653){_0x34bfb9=_0x34bfb9-0x0;var _0x5ba9b8=_0x0d07[_0x34bfb9];return _0x5ba9b8;};'use strict';function ZohoAccount(_0x3abc38){this['id']=_0x3abc38['id']||0x0;this[_0x70d0('0x0')]=_0x3abc38[_0x70d0('0x0')]||'';this[_0x70d0('0x1')]=_0x3abc38[_0x70d0('0x1')]||'';this[_0x70d0('0x2')]=_0x3abc38[_0x70d0('0x2')]||'';this[_0x70d0('0x3')]=_0x3abc38[_0x70d0('0x3')]||'';this[_0x70d0('0x4')]=_0x3abc38[_0x70d0('0x4')]||'';this[_0x70d0('0x5')]=_0x3abc38[_0x70d0('0x5')]||'';this[_0x70d0('0x6')]=_0x3abc38[_0x70d0('0x6')]||'';this[_0x70d0('0x7')]=_0x3abc38[_0x70d0('0x7')]||'';this[_0x70d0('0x8')]=_0x3abc38[_0x70d0('0x8')]||'';this[_0x70d0('0x9')]=_0x3abc38[_0x70d0('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x29a5=['name','description','host','zone','clientId','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x279c9a,_0x2095ce){var _0x4b712b=function(_0x391c9b){while(--_0x391c9b){_0x279c9a['push'](_0x279c9a['shift']());}};_0x4b712b(++_0x2095ce);}(_0x29a5,0x19a));var _0x529a=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x29a5[_0xa8883];return _0x479426;};'use strict';function ZohoAccount(_0x49b04a){this['id']=_0x49b04a['id']||0x0;this[_0x529a('0x0')]=_0x49b04a['name']||'';this[_0x529a('0x1')]=_0x49b04a[_0x529a('0x1')]||'';this[_0x529a('0x2')]=_0x49b04a[_0x529a('0x2')]||'';this[_0x529a('0x3')]=_0x49b04a[_0x529a('0x3')]||'';this[_0x529a('0x4')]=_0x49b04a['clientId']||'';this['clientSecret']=_0x49b04a['clientSecret']||'';this[_0x529a('0x5')]=_0x49b04a[_0x529a('0x5')]||'';this[_0x529a('0x6')]=_0x49b04a[_0x529a('0x6')]||'';this['refreshToken']=_0x49b04a[_0x529a('0x7')]||'';this[_0x529a('0x8')]=_0x49b04a[_0x529a('0x8')]||{};}module[_0x529a('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index f63407c..715739e 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 _0x5204=['isNil','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','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','exports','util','lodash'];(function(_0xf2b1f7,_0x42868a){var _0x39a29d=function(_0x2bfff2){while(--_0x2bfff2){_0xf2b1f7['push'](_0xf2b1f7['shift']());}};_0x39a29d(++_0x42868a);}(_0x5204,0xdf));var _0x4520=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0x5204[_0x58ae8a];return _0x2f0b6b;};'use strict';var util=require(_0x4520('0x0'));var _=require(_0x4520('0x1'));var moment=require('moment');function checkNameSurname(_0x12a3a1,_0x3bf0b1,_0x10cbc2){var _0x36caca='';if(!_[_0x4520('0x2')](_0x3bf0b1)&&'string'===typeof _0x3bf0b1){_0x36caca+=_0x3bf0b1;}if(!_[_0x4520('0x2')](_0x10cbc2)&&'string'===typeof _0x10cbc2){_0x36caca+='\x20'+_0x10cbc2;}if(_0x36caca!==''){return _0x36caca;}return _0x12a3a1;}function Action(_0x180174,_0x209381,_0xe0a256,_0xe741c2,_0x396d29){this[_0x4520('0x3')]=_0xe0a256||undefined;this[_0x4520('0x4')]=_0x180174['id'];this['queue']=_0x209381[_0x4520('0x5')];this['type']=_0x209381[_0x4520('0x6')];this[_0x4520('0x7')]=_0x4520('0x8');this[_0x4520('0x9')]=![];this[_0x4520('0xa')]=_[_0x4520('0x2')](_0x180174[_0x4520('0xb')])?undefined:_0x180174[_0x4520('0xb')][_0x4520('0x5')];this[_0x4520('0xc')]=this[_0x4520('0xa')]?util[_0x4520('0xd')](_0x4520('0xe'),this[_0x4520('0xa')]):_0xe741c2||undefined;this[_0x4520('0xf')]=checkNameSurname(_0x180174[_0x4520('0x10')][_0x4520('0x11')],_0x180174[_0x4520('0x10')][_0x4520('0x12')],_0x180174[_0x4520('0x10')][_0x4520('0x13')]);this['active']=_0x180174[_0x4520('0x14')]||![];this[_0x4520('0x15')]=_0x180174[_0x4520('0x11')];this[_0x4520('0x16')]=_0x180174[_0x4520('0x16')];this['countbusyretry']=_0x180174[_0x4520('0x17')]||0x0;this[_0x4520('0x18')]=_0x180174[_0x4520('0x18')]||0x0;this[_0x4520('0x19')]=_0x180174[_0x4520('0x19')]||0x0;this[_0x4520('0x1a')]=(_0x180174[_0x4520('0x17')]||0x0)+(_0x180174[_0x4520('0x18')]||0x0)+(_0x180174[_0x4520('0x19')]||0x0)+(_0x180174[_0x4520('0x1b')]||0x0)+(_0x180174[_0x4520('0x1c')]||0x0)+(_0x180174[_0x4520('0x1d')]||0x0)+(_0x180174['countmachineretry']||0x0)+(_0x180174[_0x4520('0x1e')]||0x0);this['countnosuchnumberretry']=_0x180174['countnosuchnumberretry']||0x0;this['countdropretry']=_0x180174[_0x4520('0x1c')]||0x0;this['countabandonedretry']=_0x180174[_0x4520('0x1d')]||0x0;this[_0x4520('0x1f')]=_0x180174[_0x4520('0x1f')]||0x0;this['countagentrejectretry']=_0x180174[_0x4520('0x1e')]||0x0;this[_0x4520('0x20')]=_0x180174[_0x4520('0x20')];this['callbackuniqueid']=_0x180174[_0x4520('0x21')];this[_0x4520('0x22')]=_0x180174[_0x4520('0x22')];this[_0x4520('0x23')]=_0x180174[_0x4520('0x23')];this['ContactId']=_0x180174[_0x4520('0x24')];this[_0x4520('0x25')]=_0x180174[_0x4520('0x25')];this[_0x4520('0x26')]=_['isNil'](_0x180174[_0x4520('0xb')])?_0x180174[_0x4520('0x26')]:_0x180174[_0x4520('0xb')]['id'];this[_0x4520('0x27')]=_0x180174[_0x4520('0x27')];this[_0x4520('0x28')]='';this[_0x4520('0x29')]='';}Action[_0x4520('0x2a')][_0x4520('0x2b')]=function(){return util[_0x4520('0xd')]('\x22%s\x22\x20<%s>',this[_0x4520('0xf')],this['number']);};module[_0x4520('0x2c')]=Action; \ No newline at end of file +var _0x0b0e=['prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','moment','isNil','string','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0x362c30,_0x392f61){var _0x53f3ee=function(_0x30c39d){while(--_0x30c39d){_0x362c30['push'](_0x362c30['shift']());}};_0x53f3ee(++_0x392f61);}(_0x0b0e,0x187));var _0xe0b0=function(_0x232cf2,_0x4ffb79){_0x232cf2=_0x232cf2-0x0;var _0x463cec=_0x0b0e[_0x232cf2];return _0x463cec;};'use strict';var util=require(_0xe0b0('0x0'));var _=require('lodash');var moment=require(_0xe0b0('0x1'));function checkNameSurname(_0x536e9b,_0x7e5a8a,_0xdf715e){var _0x3b5e2b='';if(!_[_0xe0b0('0x2')](_0x7e5a8a)&&_0xe0b0('0x3')===typeof _0x7e5a8a){_0x3b5e2b+=_0x7e5a8a;}if(!_[_0xe0b0('0x2')](_0xdf715e)&&_0xe0b0('0x3')===typeof _0xdf715e){_0x3b5e2b+='\x20'+_0xdf715e;}if(_0x3b5e2b!==''){return _0x3b5e2b;}return _0x536e9b;}function Action(_0x185efa,_0x30e20d,_0x28e40f,_0x219b1c,_0x5cf9cc){this['uniqueid']=_0x28e40f||undefined;this[_0xe0b0('0x4')]=_0x185efa['id'];this[_0xe0b0('0x5')]=_0x30e20d[_0xe0b0('0x6')];this[_0xe0b0('0x7')]=_0x30e20d['type'];this[_0xe0b0('0x8')]=_0xe0b0('0x5');this['dialAnswer']=![];this[_0xe0b0('0x9')]=_[_0xe0b0('0x2')](_0x185efa['Agent'])?undefined:_0x185efa[_0xe0b0('0xa')][_0xe0b0('0x6')];this[_0xe0b0('0xb')]=this['membername']?util[_0xe0b0('0xc')](_0xe0b0('0xd'),this[_0xe0b0('0x9')]):_0x219b1c||undefined;this[_0xe0b0('0xe')]=checkNameSurname(_0x185efa[_0xe0b0('0xf')]['phone'],_0x185efa[_0xe0b0('0xf')][_0xe0b0('0x10')],_0x185efa[_0xe0b0('0xf')][_0xe0b0('0x11')]);this[_0xe0b0('0x12')]=_0x185efa['active']||![];this[_0xe0b0('0x13')]=_0x185efa['phone'];this[_0xe0b0('0x14')]=_0x185efa[_0xe0b0('0x14')];this['countbusyretry']=_0x185efa[_0xe0b0('0x15')]||0x0;this['countcongestionretry']=_0x185efa[_0xe0b0('0x16')]||0x0;this[_0xe0b0('0x17')]=_0x185efa['countnoanswerretry']||0x0;this['countglobal']=(_0x185efa[_0xe0b0('0x15')]||0x0)+(_0x185efa['countcongestionretry']||0x0)+(_0x185efa['countnoanswerretry']||0x0)+(_0x185efa['countnosuchnumberretry']||0x0)+(_0x185efa[_0xe0b0('0x18')]||0x0)+(_0x185efa['countabandonedretry']||0x0)+(_0x185efa['countmachineretry']||0x0)+(_0x185efa[_0xe0b0('0x19')]||0x0);this['countnosuchnumberretry']=_0x185efa[_0xe0b0('0x1a')]||0x0;this['countdropretry']=_0x185efa[_0xe0b0('0x18')]||0x0;this[_0xe0b0('0x1b')]=_0x185efa[_0xe0b0('0x1b')]||0x0;this[_0xe0b0('0x1c')]=_0x185efa[_0xe0b0('0x1c')]||0x0;this['countagentrejectretry']=_0x185efa['countagentrejectretry']||0x0;this[_0xe0b0('0x1d')]=_0x185efa['callback'];this[_0xe0b0('0x1e')]=_0x185efa[_0xe0b0('0x1e')];this['callbackat']=_0x185efa[_0xe0b0('0x1f')];this['recallme']=_0x185efa[_0xe0b0('0x20')];this['ContactId']=_0x185efa[_0xe0b0('0x21')];this['ListId']=_0x185efa[_0xe0b0('0x22')];this['UserId']=_[_0xe0b0('0x2')](_0x185efa['Agent'])?_0x185efa[_0xe0b0('0x23')]:_0x185efa['Agent']['id'];this[_0xe0b0('0x24')]=_0x185efa[_0xe0b0('0x24')];this[_0xe0b0('0x25')]='';this[_0xe0b0('0x26')]='';}Action[_0xe0b0('0x27')][_0xe0b0('0x28')]=function(){return util['format'](_0xe0b0('0x29'),this[_0xe0b0('0xe')],this['number']);};module[_0xe0b0('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 28da2c9..32d04be 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 _0x511d=['../rpc/cmHopperAdditionalPhone','./action','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','agentReadyId','isNil','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','info','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','BUSY','countbusyretry','countglobal','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','called','Calling','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','reachable','SIP/%s','unmonitored','execRun','recallme','isValid','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','unlockContact','custom:agentringnoanswer','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','preview','../../../config/logger','actionPreview','../ami'];(function(_0x5bc771,_0x1708d7){var _0x132c75=function(_0x1110e2){while(--_0x1110e2){_0x5bc771['push'](_0x5bc771['shift']());}};_0x132c75(++_0x1708d7);}(_0x511d,0x149));var _0xd511=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x511d[_0x2064e5];return _0x21a233;};'use strict';var util=require(_0xd511('0x0'));var _=require(_0xd511('0x1'));var uuid=require(_0xd511('0x2'));var moment=require(_0xd511('0x3'));var md5=require(_0xd511('0x4'));var Redis=require(_0xd511('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xd511('0x6'));var loggerAction=require(_0xd511('0x7'))(_0xd511('0x8'));var ami=require(_0xd511('0x9'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xd511('0xa'));var Action=require(_0xd511('0xb'));var ut=require('./util/util');config[_0xd511('0xc')]=_['defaults'](config[_0xd511('0xc')],{'host':_0xd511('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd511('0xc')]));var Sequence=function(){};Sequence[_0xd511('0xe')][_0xd511('0xf')]=function(_0xe1e2a9){this[_0xd511('0x10')]=this[_0xd511('0x10')]?this[_0xd511('0x10')][_0xd511('0x11')](_0xe1e2a9):_0xe1e2a9();};function Preview(_0x57a0cf){this[_0xd511('0x12')]=new Sequence();this[_0xd511('0x13')]=_0x57a0cf[_0xd511('0x14')];this[_0xd511('0x15')]=_0x57a0cf['trunks'];this[_0xd511('0x16')]={};this[_0xd511('0x17')]=_0x57a0cf['agents'];this[_0xd511('0x18')]=0x0;ami['on'](_0xd511('0x19'),this[_0xd511('0x1a')][_0xd511('0x1b')](this));ami['on']('hangup',this['syncHangup'][_0xd511('0x1b')](this));ami['on'](_0xd511('0x1c'),this[_0xd511('0x1d')][_0xd511('0x1b')](this));ami['on'](_0xd511('0x1e'),this[_0xd511('0x1f')][_0xd511('0x1b')](this));ami['on'](_0xd511('0x20'),this['syncNewExten'][_0xd511('0x1b')](this));ami['on'](_0xd511('0x21'),this['syncVarSet']['bind'](this));ami['on']('attendedtransfer',this[_0xd511('0x22')][_0xd511('0x1b')](this));ami['on'](_0xd511('0x23'),this[_0xd511('0x24')][_0xd511('0x1b')](this));this[_0xd511('0x25')](this[_0xd511('0x13')]);}function emit(_0x481557,_0x5ce36a,_0x2e4432){io['to'](_0x481557)[_0xd511('0x26')](_0x5ce36a,_0x2e4432);}function emitCampaignPreview(_0x5b8376){if(_0x5b8376[_0xd511('0x27')]===_0xd511('0x28')){var _0x359681={'id':_0x5b8376['id'],'name':_0x5b8376[_0xd511('0x29')],'strategy':_0x5b8376[_0xd511('0x2a')],'answered':_0x5b8376[_0xd511('0x2b')],'available':_0x5b8376[_0xd511('0x2c')],'loggedIn':_0x5b8376[_0xd511('0x2d')],'pTalking':_0x5b8376['pTalking'],'sumBillable':_0x5b8376[_0xd511('0x2e')],'sumDuration':_0x5b8376['sumDuration'],'sumHoldTime':_0x5b8376[_0xd511('0x2f')]||0x0,'talking':_0x5b8376[_0xd511('0x30')],'total':_0x5b8376[_0xd511('0x31')],'type':_0x5b8376[_0xd511('0x27')],'unmanaged':_0x5b8376['unmanaged'],'abandoned':_0x5b8376['abandoned'],'waiting':_0x5b8376[_0xd511('0x32')],'loggedInDb':_0x5b8376[_0xd511('0x33')],'dialActive':_0x5b8376[_0xd511('0x34')],'dialMethod':_0x5b8376[_0xd511('0x35')],'dialOriginateCallerIdName':_0x5b8376[_0xd511('0x36')],'dialOriginateCallerIdNumber':_0x5b8376[_0xd511('0x37')],'dialOriginateTimeout':_0x5b8376[_0xd511('0x38')],'dialPrefix':_0x5b8376[_0xd511('0x39')],'outboundAnswerAgiCallsDay':_0x5b8376['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5b8376[_0xd511('0x3a')],'outboundBlacklistCallsDay':_0x5b8376[_0xd511('0x3b')],'outboundBusyCallsDay':_0x5b8376['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5b8376[_0xd511('0x3c')],'outboundDropCallsDayACS':_0x5b8376[_0xd511('0x3d')],'outboundDropCallsDayCallersExit':_0x5b8376[_0xd511('0x3e')],'outboundDropCallsDayTimeout':_0x5b8376[_0xd511('0x3f')],'outboundNoAnswerCallsDay':_0x5b8376[_0xd511('0x40')],'outboundNoSuchCallsDay':_0x5b8376[_0xd511('0x41')],'outboundOriginateFailureCallsDay':_0x5b8376[_0xd511('0x42')],'outboundReCallsDay':_0x5b8376['outboundReCallsDay'],'outboundRejectCallsDay':_0x5b8376[_0xd511('0x43')],'outboundUnknownCallsDay':_0x5b8376[_0xd511('0x44')],'outboundAbandonedCallsDay':_0x5b8376[_0xd511('0x45')],'predictiveIntervalAnsweredCalls':_0x5b8376['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5b8376[_0xd511('0x46')],'predictiveIntervalAvgTalktime':_0x5b8376[_0xd511('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x5b8376[_0xd511('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x5b8376[_0xd511('0x49')],'predictiveIntervalErlangCalls':_0x5b8376[_0xd511('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x5b8376[_0xd511('0x4b')],'predictiveIntervalHitRate':_0x5b8376['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x5b8376[_0xd511('0x4c')],'predictiveIntervalPauses':_0x5b8376[_0xd511('0x4d')],'predictiveIntervalAvailable':_0x5b8376['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5b8376['predictiveIntervalTotalCalls'],'message':_0x5b8376['message'],'originated':_0x5b8376[_0xd511('0x4e')],'erlangCalls':_0x5b8376[_0xd511('0x4f')],'erlangCallToSecond':_0x5b8376['erlangCallToSecond'],'erlangAbandonmentRate':_0x5b8376[_0xd511('0x50')],'erlangBusyFactor':_0x5b8376[_0xd511('0x51')],'startPredictive':_0x5b8376['startPredictive'],'startProgressive':_0x5b8376[_0xd511('0x52')]};if(_0x5b8376[_0xd511('0x53')]){_0x359681['Trunk']={'id':_0x5b8376[_0xd511('0x53')]['id'],'name':_0x5b8376[_0xd511('0x53')][_0xd511('0x29')],'active':_0x5b8376[_0xd511('0x53')][_0xd511('0x54')],'callerid':_0x5b8376[_0xd511('0x53')]['callerid']};}if(_0x5b8376['Interval']){_0x359681[_0xd511('0x55')]={'id':_0x5b8376[_0xd511('0x55')]['id'],'name':_0x5b8376[_0xd511('0x55')]['name']};}var _0x10103f=md5(JSON[_0xd511('0x56')](_0x359681));if(_0x5b8376[_0xd511('0x4')]!==_0x10103f){_0x5b8376[_0xd511('0x4')]=_0x10103f;emit(util[_0xd511('0x57')](_0xd511('0x58'),_0x359681['name']),_0xd511('0x59'),_0x359681);}}}function emitVoiceQueueChannelRemove(_0x2ba22b){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd511('0x56')](_0x2ba22b));emit(util[_0xd511('0x57')](_0xd511('0x58'),_0x2ba22b[_0xd511('0x29')]),'voice_queue_channel:remove',_0x2ba22b);io[_0xd511('0x26')](_0xd511('0x5a'),_0x2ba22b);}function notSendMessagesQueue(_0x5393a7){if(_0x5393a7[_0xd511('0x5b')]){if(_0x5393a7[_0xd511('0x4e')]===0x0&&_0x5393a7[_0xd511('0x5c')]===0x0){_0x5393a7[_0xd511('0x5b')]=![];_0x5393a7[_0xd511('0x2c')]=0x0;_0x5393a7['paused']=0x0;_0x5393a7[_0xd511('0x5d')]=_0xd511('0x5e');ut[_0xd511('0x5f')](_0xd511('0x60'),_0x5393a7[_0xd511('0x29')]+_0xd511('0x61'));}else{_0x5393a7[_0xd511('0x5d')]='DEACTIVATED';ut['logger'](_0xd511('0x60'),_0x5393a7['name']+'\x20is\x20deactivated');}emitCampaignPreview(_0x5393a7);}}Preview[_0xd511('0xe')][_0xd511('0x25')]=function(){var _0x5f28fc=this;setInterval(function(){_0x5f28fc[_0xd511('0x62')]();},0x7cf);};Preview[_0xd511('0xe')]['syncCampaigns']=function(){var _0x21fb93=this['campaignsPreview'];this[_0xd511('0x18')]+=0x1;for(var _0x37fdd2 in _0x21fb93){if(_0x21fb93[_0xd511('0x63')](_0x37fdd2)&&(_0x21fb93[_0x37fdd2][_0xd511('0x35')]==='preview'||_0x21fb93[_0x37fdd2][_0xd511('0x35')]===_0xd511('0x64'))&&_0x21fb93[_0x37fdd2][_0xd511('0x27')]===_0xd511('0x28')){if(this[_0xd511('0x18')]>0x7){this[_0xd511('0x18')]=0x0;this[_0xd511('0x65')]();}}if(_0x21fb93[_0xd511('0x63')](_0x37fdd2)&&_0x21fb93[_0x37fdd2]['dialMethod']===_0xd511('0x6')&&_0x21fb93[_0x37fdd2][_0xd511('0x27')]===_0xd511('0x28')){if(_0x21fb93[_0x37fdd2][_0xd511('0x34')]){this[_0xd511('0x66')](_0x21fb93[_0x37fdd2]);if(_0x21fb93[_0x37fdd2][_0xd511('0x67')])this[_0xd511('0x68')](_0x21fb93[_0x37fdd2]);}else{notSendMessagesQueue(_0x21fb93[_0x37fdd2]);}}}};Preview['prototype'][_0xd511('0x69')]=function(_0x175540){var _0x102a3f=this;this[_0xd511('0x12')][_0xd511('0xf')](function(){if(!_['isNil'](_0x102a3f[_0xd511('0x16')][_0x175540])){loggerAction['info'](_0xd511('0x6a'),_0x175540,'Queue',_0x102a3f[_0xd511('0x16')][_0x175540]['queue'],_0xd511('0x6b'),JSON[_0xd511('0x56')](_0x102a3f[_0xd511('0x13')][_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x6c')]][_0xd511('0x4e')]),_0xd511('0x6d'),JSON[_0xd511('0x56')](_0x102a3f[_0xd511('0x13')][_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x6c')]]['pTalking']),JSON['stringify'](_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x6e')]),JSON[_0xd511('0x56')](_[_0xd511('0x6f')](_0x102a3f[_0xd511('0x16')][_0x175540],[_0xd511('0x70'),_0xd511('0x71'),_0xd511('0x72'),'ListId'])));return ami[_0xd511('0x73')]({'action':_0xd511('0x74'),'channel':_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x75')]})[_0xd511('0x76')](function(_0x67fd0c){if(_0x67fd0c[_0xd511('0x5d')]===_0xd511('0x77')){setTimeout(function(){if(_0x102a3f[_0xd511('0x16')][_0x175540]){ut[_0xd511('0x78')](_0x102a3f[_0xd511('0x13')][_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x6c')]],_0xd511('0x79'));if(_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x6e')]===!![]){ut[_0xd511('0x7a')](_0x102a3f[_0xd511('0x13')][_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x6c')]],_0xd511('0x79'));ut[_0xd511('0x7b')](_0xd511('0x7c')+_0x175540,_0x102a3f[_0xd511('0x16')][_0x175540][_0xd511('0x6c')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x175540,_0x102a3f[_0xd511('0x16')][_0x175540]['queue']);delete _0x102a3f[_0xd511('0x16')][_0x175540];}},0x2328);}});}});};Preview[_0xd511('0xe')][_0xd511('0x65')]=function(){var _0x57df84=this;loggerAction['info'](_0xd511('0x7d'),_['size'](this['actions']));for(var _0x5bd8d5 in this[_0xd511('0x16')]){if(_0x57df84[_0xd511('0x16')][_0xd511('0x63')](_0x5bd8d5)){_0x57df84[_0xd511('0x69')](_0x5bd8d5);}}};Preview[_0xd511('0xe')][_0xd511('0x68')]=function(_0x242c52){var _0x132a6d=this;rpcDb[_0xd511('0x7e')](_0x242c52['id'],ut[_0xd511('0x7f')](this[_0xd511('0x17')]))['then'](function(_0x491a4c){if(!_[_0xd511('0x80')](_0x491a4c)){for(var _0x446f43=0x0;_0x446f43<_0x491a4c['length'];_0x446f43+=0x1){if(ut[_0xd511('0x81')](_0x491a4c[_0x446f43][_0xd511('0x82')])<_0x242c52[_0xd511('0x83')]*0x3c){if(_0x491a4c[_0x446f43]['Agent']&&!_0x491a4c[_0x446f43][_0xd511('0x84')][_0xd511('0x85')]){_0x132a6d[_0xd511('0x86')](_0x491a4c[_0x446f43]['id'])[_0xd511('0x87')](ut[_0xd511('0x88')](_0xd511('0x89')))[_0xd511('0x76')](ut[_0xd511('0x88')]('[RecallMe]'));}else{rpcDb[_0xd511('0x8a')](_0x491a4c[_0x446f43]['id']);}}else{var _0x1ccb91=new Action(_0x491a4c[_0x446f43],_0x242c52);_0x1ccb91[_0xd511('0x8b')]=moment()[_0xd511('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x242c52[_0xd511('0x8c')]+=0x1;ut[_0xd511('0x8d')](_0x1ccb91,0x17,_0xd511('0x8e'));if(_0x242c52[_0xd511('0x8f')]){rpcDb[_0xd511('0x90')](ut['createBody'](_0x491a4c[_0x446f43]));rpcDb[_0xd511('0x91')](_0x1ccb91,_0xd511('0x92'));}else{ut[_0xd511('0x8d')](_0x1ccb91,0x16,_0xd511('0x93'));rpcDb[_0xd511('0x91')](_0x1ccb91,_0xd511('0x94'));rpcDb[_0xd511('0x95')](_0x1ccb91,_0xd511('0x94'));}}}}})[_0xd511('0x76')](ut['logger2'](_0xd511('0x96')));};Preview[_0xd511('0xe')][_0xd511('0x66')]=function(_0x15f59c){_0x15f59c[_0xd511('0x5b')]=!![];if(ut[_0xd511('0x97')](_0x15f59c[_0xd511('0x2d')])){_0x15f59c[_0xd511('0x5d')]=_0xd511('0x98');}else if(!ut['isActive'](_0x15f59c[_0xd511('0x34')])){_0x15f59c[_0xd511('0x5d')]=_0xd511('0x5e');}else if(!this[_0xd511('0x99')](_0x15f59c[_0xd511('0x53')])){if(!this[_0xd511('0x99')](_0x15f59c['TrunkBackup'])){_0x15f59c[_0xd511('0x5d')]=_0xd511('0x9a');}else{_0x15f59c[_0xd511('0x5d')]=_0xd511('0x9b');}}else{_0x15f59c[_0xd511('0x5d')]=_0xd511('0x9b');}emitCampaignPreview(_0x15f59c);};Preview[_0xd511('0xe')][_0xd511('0x9c')]=function(_0x293861,_0x358c43,_0x1f9a79){var _0x53652e=this;var _0x26d1b5=this[_0xd511('0x16')][_0x358c43];var _0x2a096a=this[_0xd511('0x13')][_0x26d1b5[_0xd511('0x6c')]];var _0x54b0a5;var _0x421e81=![];var _0x33907b=0x2;var _0x405f95=0x3;if(_0x2a096a){switch(_0x1f9a79){case'1':_0x2a096a[_0xd511('0x41')]+=0x1;_0x26d1b5[_0xd511('0x9d')]+=0x1;_0x26d1b5['countglobal']=ut[_0xd511('0x9e')](_0x26d1b5);ut[_0xd511('0x8d')](_0x26d1b5,0x0,_0xd511('0x9f'));ami['emit'](_0xd511('0xa0'),ut[_0xd511('0xa1')](_0x26d1b5,'nosuchnumber'));rpcDb[_0xd511('0x91')](_0x26d1b5,_0xd511('0xa2'));_0x53652e[_0xd511('0xa3')](_0x26d1b5,'0',_0x2a096a)['then'](function(_0x3e5bb7){_0x421e81=_0x3e5bb7[_0xd511('0xa4')]==0x1;_0x33907b=_0x2a096a[_0xd511('0xa5')];_0x405f95=_0x2a096a[_0xd511('0xa6')];if(!_0x421e81){if(ut['totalGlobal'](_0x26d1b5)>=_0x2a096a[_0xd511('0xa7')]){_0x54b0a5=ut['cloneAction'](_0x26d1b5,0xf,_0xd511('0xa8'));rpcDb[_0xd511('0x95')](_0x54b0a5,_0xd511('0xa9'));}else{if(_0x26d1b5['countnosuchnumberretry']>=_0x2a096a[_0xd511('0xaa')]){rpcDb[_0xd511('0x95')](_0x26d1b5,_0xd511('0xa9'));}else{rpcDb[_0xd511('0xab')](ut[_0xd511('0xac')](_0x26d1b5,_0xd511('0x9d'),_0x2a096a[_0xd511('0xa5')]),_0x26d1b5[_0xd511('0xad')],_0x26d1b5[_0xd511('0xae')]);}}delete this['actions'][_0x293861[_0xd511('0xaf')]];}else{_0x26d1b5[_0xd511('0x9d')]++;logger[_0xd511('0xb0')](_0xd511('0xb1'),_0x26d1b5[_0xd511('0x9d')]);logger[_0xd511('0xb0')]('id',_0x26d1b5[_0xd511('0xb2')]);_0x53652e[_0xd511('0xb3')]({'id':_0x26d1b5['idContact'],'field':{'countnosuchnumberretry':_0x26d1b5[_0xd511('0x9d')]}})['then'](function(){_0x53652e[_0xd511('0xb4')](_0x26d1b5,_0x33907b,_0x405f95)[_0xd511('0x87')](function(){});});}});break;case'ANSWER':var _0x29a779=moment()['format'](_0xd511('0xb5'));_0x26d1b5[_0xd511('0xb6')]=_0x29a779;_0x26d1b5[_0xd511('0xb7')]=_0x29a779;_0x26d1b5[_0xd511('0x6e')]=!![];_0x2a096a[_0xd511('0x5c')]+=0x1;logger[_0xd511('0xb0')](_0xd511('0xb8'),_0x26d1b5[_0xd511('0xb9')],_0xd511('0xba'),_0x2a096a['name'],'pTalking:\x20',_0x2a096a[_0xd511('0x5c')]);ami['emit']('custom:agentconnect',ut['buildObj'](_0x26d1b5,'connect',this[_0xd511('0x13')][_0x26d1b5['queue']]));if(_0x2a096a[_0xd511('0xbb')]){ami[_0xd511('0x26')](_0xd511('0xbc'),ut['buildAcw'](_0x26d1b5));}break;case'16':ami[_0xd511('0x26')](_0xd511('0xbd'),ut[_0xd511('0xa1')](_0x26d1b5,_0xd511('0xbe'),this[_0xd511('0x13')][_0x26d1b5[_0xd511('0x6c')]]));emitVoiceQueueChannelRemove(ut[_0xd511('0xa1')](_0x26d1b5,'complete'));_0x2a096a[_0xd511('0x3a')]+=0x1;_0x2a096a[_0xd511('0x31')]+=0x1;_0x2a096a['answered']+=0x1;ut[_0xd511('0x7a')](_0x2a096a,_0xd511('0xbf'));_0x26d1b5['countglobal']=ut[_0xd511('0x9e')](_0x26d1b5);ut['logCustomer'](_0x26d1b5,0x4,'Answer');rpcDb[_0xd511('0x91')](_0x26d1b5,_0xd511('0xc0'));rpcDb[_0xd511('0x95')](_0x26d1b5,_0xd511('0xc1'));rpcDb[_0xd511('0xc2')](_0x26d1b5);_0x2a096a[_0xd511('0xc3')]+=_0x26d1b5[_0xd511('0xc4')];_0x2a096a[_0xd511('0x2e')]+=_0x26d1b5[_0xd511('0xc4')];logger[_0xd511('0xb0')]('[syncHangup][talking][decrement]',_0x26d1b5['uniqueid'],'\x20Queue',_0x2a096a[_0xd511('0x29')],_0xd511('0x6d'),_0x2a096a[_0xd511('0x5c')]);delete this['actions'][_0x293861[_0xd511('0xaf')]];break;case _0xd511('0xc5'):_0x2a096a['outboundBusyCallsDay']+=0x1;_0x26d1b5[_0xd511('0xc6')]+=0x1;_0x26d1b5[_0xd511('0xc7')]=ut[_0xd511('0x9e')](_0x26d1b5);ut[_0xd511('0x8d')](_0x26d1b5,0x5,_0xd511('0xc8'));_0x33907b=_0x2a096a[_0xd511('0xc9')];_0x405f95=_0x2a096a[_0xd511('0xa6')];ami[_0xd511('0x26')](_0xd511('0xca'),ut[_0xd511('0xa1')](_0x26d1b5,_0xd511('0xcb')));rpcDb[_0xd511('0x91')](_0x26d1b5,_0xd511('0xcc'));_0x53652e['verifyAdditionalPhones'](_0x26d1b5,'5',_0x2a096a)[_0xd511('0x87')](function(_0x462440){_0x421e81=_0x462440[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut[_0xd511('0x9e')](_0x26d1b5)>=_0x2a096a['dialGlobalMaxRetry']){_0x54b0a5=ut[_0xd511('0xcd')](_0x26d1b5,0xf,'Global');rpcDb['createCustomerFinal'](_0x54b0a5,_0xd511('0xce'));}else{if(_0x26d1b5[_0xd511('0xc6')]>=_0x2a096a[_0xd511('0xcf')]){rpcDb[_0xd511('0x95')](_0x26d1b5,_0xd511('0xcc'));}else{rpcDb[_0xd511('0xab')](ut[_0xd511('0xac')](_0x26d1b5,'countbusyretry',_0x2a096a['dialBusyRetryFrequency']),_0x26d1b5[_0xd511('0xad')],_0x26d1b5[_0xd511('0xae')]);}}}else{_0x26d1b5[_0xd511('0xc6')]++;_0x53652e[_0xd511('0xb3')]({'id':_0x26d1b5[_0xd511('0xb2')],'field':{'countbusyretry':_0x26d1b5['countbusyretry']}})['then'](function(){_0x53652e['swapAdditionalPhones'](_0x26d1b5,_0x33907b,_0x405f95)[_0xd511('0x87')](function(){});});}});break;case _0xd511('0xd0'):_0x2a096a[_0xd511('0x40')]+=0x1;_0x26d1b5[_0xd511('0xd1')]+=0x1;_0x26d1b5[_0xd511('0xc7')]=ut[_0xd511('0x9e')](_0x26d1b5);ut[_0xd511('0x8d')](_0x26d1b5,0x3,_0xd511('0xd2'));_0x33907b=_0x2a096a['dialNoAnswerRetryFrequency'];_0x405f95=_0x2a096a['callAdditionalPhoneAfterMin'];var _0x448155=ut['buildNoAnswerEventPayload'](_0x26d1b5,_0x2a096a);ami[_0xd511('0x26')](_0xd511('0xd3'),_0x448155);rpcDb['createCustomerHistory'](_0x26d1b5,'[callProgressDetectingCustomer][logNoAnswer]');_0x53652e[_0xd511('0xa3')](_0x26d1b5,'3',_0x2a096a)[_0xd511('0x87')](function(_0x40b22e){_0x421e81=_0x40b22e[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut[_0xd511('0x9e')](_0x26d1b5)>=_0x2a096a[_0xd511('0xa7')]){_0x54b0a5=ut[_0xd511('0xcd')](_0x26d1b5,0xf,_0xd511('0xa8'));rpcDb[_0xd511('0x95')](_0x54b0a5,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x26d1b5[_0xd511('0xd1')]>=_0x2a096a['dialNoAnswerMaxRetry']){rpcDb[_0xd511('0x95')](_0x26d1b5,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0xd511('0xac')](_0x26d1b5,_0xd511('0xd1'),_0x2a096a['dialNoAnswerRetryFrequency']),_0x26d1b5[_0xd511('0xad')],_0x26d1b5['activeContact']);}}}else{_0x26d1b5['countnoanswerretry']++;_0x53652e[_0xd511('0xb3')]({'id':_0x26d1b5[_0xd511('0xb2')],'field':{'countnoanswerretry':_0x26d1b5[_0xd511('0xd1')]}})[_0xd511('0x87')](function(){_0x53652e[_0xd511('0xb4')](_0x26d1b5,_0x33907b,_0x405f95)['then'](function(){});});}});break;case'CONGESTION':_0x2a096a[_0xd511('0x3c')]+=0x1;_0x26d1b5['countcongestionretry']+=0x1;_0x26d1b5[_0xd511('0xc7')]=ut[_0xd511('0x9e')](_0x26d1b5);ut['logCustomer'](_0x26d1b5,0x8,_0xd511('0xd4'));_0x33907b=_0x2a096a[_0xd511('0xd5')];_0x405f95=_0x2a096a[_0xd511('0xa6')];ami[_0xd511('0x26')](_0xd511('0xd6'),ut[_0xd511('0xa1')](_0x26d1b5,_0xd511('0xd7')));rpcDb[_0xd511('0x91')](_0x26d1b5,'[callProgressDetectingCustomer][logCongestion]');_0x53652e[_0xd511('0xa3')](_0x26d1b5,'8',_0x2a096a)[_0xd511('0x87')](function(_0x4a6784){_0x421e81=_0x4a6784[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut[_0xd511('0x9e')](_0x26d1b5)>=_0x2a096a[_0xd511('0xa7')]){_0x54b0a5=ut[_0xd511('0xcd')](_0x26d1b5,0xf,_0xd511('0xa8'));rpcDb[_0xd511('0x95')](_0x54b0a5,_0xd511('0xd8'));}else{if(_0x26d1b5[_0xd511('0xd9')]>=_0x2a096a['dialCongestionMaxRetry']){rpcDb[_0xd511('0x95')](_0x26d1b5,_0xd511('0xda'));}else{rpcDb[_0xd511('0xab')](ut['scheduledAt'](_0x26d1b5,_0xd511('0xd9'),_0x2a096a[_0xd511('0xc9')]),_0x26d1b5[_0xd511('0xad')],_0x26d1b5[_0xd511('0xae')]);}}}else{_0x26d1b5['countcongestionretry']++;_0x53652e['incrementPreviewCounters']({'id':_0x26d1b5['idContact'],'field':{'countcongestionretry':_0x26d1b5[_0xd511('0xd9')]}})[_0xd511('0x87')](function(){_0x53652e[_0xd511('0xb4')](_0x26d1b5,_0x33907b,_0x405f95)['then'](function(){});});}});break;case _0xd511('0xdb'):_0x2a096a[_0xd511('0x43')]+=0x1;_0x26d1b5[_0xd511('0xdc')]+=0x1;_0x26d1b5[_0xd511('0xc7')]=ut[_0xd511('0x9e')](_0x26d1b5);ut['logCustomer'](_0x26d1b5,0x14,_0xd511('0xdd'));_0x33907b=_0x2a096a['dialAgentRejectRetryFrequency'];_0x405f95=_0x2a096a[_0xd511('0xa6')];ami[_0xd511('0x26')](_0xd511('0xde'),ut[_0xd511('0xa1')](_0x26d1b5,_0xd511('0xdf')));rpcDb[_0xd511('0x91')](_0x26d1b5,_0xd511('0xe0'));_0x53652e[_0xd511('0xa3')](_0x26d1b5,'20',_0x2a096a)[_0xd511('0x87')](function(_0x571f8a){_0x421e81=_0x571f8a[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut['totalGlobal'](_0x26d1b5)>=_0x2a096a[_0xd511('0xa7')]){_0x54b0a5=ut[_0xd511('0xcd')](_0x26d1b5,0x14,_0xd511('0xdd'));rpcDb[_0xd511('0x95')](_0x54b0a5,_0xd511('0xe1'));}else{if(_0x26d1b5['countagentrejectretry']>=_0x2a096a[_0xd511('0xe2')]){rpcDb[_0xd511('0x95')](_0x26d1b5,_0xd511('0xe1'));}else{rpcDb[_0xd511('0xab')](ut[_0xd511('0xac')](_0x26d1b5,'countagentrejectretry',_0x2a096a[_0xd511('0xe3')]),_0x26d1b5[_0xd511('0xad')],_0x26d1b5['activeContact']);}}}else{_0x26d1b5[_0xd511('0xd1')]++;_0x53652e[_0xd511('0xb3')]({'id':_0x26d1b5['idContact'],'field':{'countnoanswerretry':_0x26d1b5[_0xd511('0xd1')]}})['then'](function(){_0x53652e[_0xd511('0xb4')](_0x26d1b5,_0x33907b,_0x405f95)[_0xd511('0x87')](function(){});});}});break;case _0xd511('0xe4'):_0x2a096a[_0xd511('0x45')]+=0x1;_0x26d1b5[_0xd511('0xe5')]+=0x1;_0x26d1b5[_0xd511('0xc7')]=ut[_0xd511('0x9e')](_0x26d1b5);ut[_0xd511('0x8d')](_0x26d1b5,0xb,_0xd511('0xe6'));rpcDb[_0xd511('0x91')](_0x26d1b5,_0xd511('0xe7'));_0x53652e[_0xd511('0xa3')](_0x26d1b5,'11',_0x2a096a)[_0xd511('0x87')](function(_0x4395a4){_0x421e81=_0x4395a4[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut['totalGlobal'](_0x26d1b5)>=_0x2a096a[_0xd511('0xa7')]){_0x54b0a5=ut[_0xd511('0xcd')](_0x26d1b5,0xf,_0xd511('0xa8'));rpcDb['createCustomerFinal'](_0x54b0a5,_0xd511('0xe7'));}else{if(_0x26d1b5['countabandonedetry']>=_0x2a096a['dialAbandonedMaxRety']){rpcDb[_0xd511('0x95')](_0x26d1b5,_0xd511('0xe7'));}else{rpcDb['rescheduleContact'](ut[_0xd511('0xac')](_0x26d1b5,_0xd511('0xe5'),_0x2a096a[_0xd511('0xe8')]),_0x26d1b5[_0xd511('0xad')],_0x26d1b5['activeContact']);}}}else{_0x26d1b5[_0xd511('0xd1')]++;_0x53652e['incrementPreviewCounters']({'id':_0x26d1b5['idContact'],'field':{'countnoanswerretry':_0x26d1b5['countnoanswerretry']}})[_0xd511('0x87')](function(){_0x53652e[_0xd511('0xb4')](_0x26d1b5,_0x33907b,_0x405f95)[_0xd511('0x87')](function(){});});}});break;case'18':_0x2a096a[_0xd511('0x44')]+=0x1;_0x26d1b5[_0xd511('0xe9')]+=0x1;_0x26d1b5['countglobal']=ut['totalGlobal'](_0x26d1b5);ut[_0xd511('0x8d')](_0x26d1b5,0x12,_0x293861[_0xd511('0xea')]||_0x293861[_0xd511('0xeb')]);ami[_0xd511('0x26')](_0xd511('0xec'),ut['buildObj'](_0x26d1b5,'amd'));rpcDb[_0xd511('0x91')](_0x26d1b5,_0xd511('0xed'));_0x53652e[_0xd511('0xa3')](_0x26d1b5,'18',_0x2a096a)[_0xd511('0x87')](function(_0x40aa62){_0x421e81=_0x40aa62[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut[_0xd511('0x9e')](_0x26d1b5)>=_0x2a096a[_0xd511('0xa7')]){_0x54b0a5=ut[_0xd511('0xcd')](_0x26d1b5,0x12,_0xd511('0xa8'));rpcDb['createCustomerFinal'](_0x54b0a5,_0xd511('0xed'));}else{rpcDb[_0xd511('0x95')](_0x26d1b5,_0xd511('0xed'));}}else{_0x26d1b5[_0xd511('0xd1')]++;_0x53652e['incrementPreviewCounters']({'id':_0x26d1b5[_0xd511('0xb2')],'field':{'countnoanswerretry':_0x26d1b5[_0xd511('0xd1')]}})[_0xd511('0x87')](function(){_0x53652e['swapAdditionalPhones'](_0x26d1b5,_0x33907b,_0x405f95)[_0xd511('0x87')](function(){});});}});delete this[_0xd511('0x16')][_0x293861[_0xd511('0xaf')]];break;case'19':_0x2a096a[_0xd511('0x44')]+=0x1;_0x26d1b5[_0xd511('0xc7')]=ut['totalGlobal'](_0x26d1b5);ut['logCustomer'](_0x26d1b5,0x13,_0x293861[_0xd511('0xea')]||_0x293861['dialstatus']);ami[_0xd511('0x26')]('custom:amd',ut[_0xd511('0xa1')](_0x26d1b5,_0xd511('0xee')));rpcDb[_0xd511('0x91')](_0x26d1b5,'[callProgressDetectingCustomer][machine]');_0x53652e[_0xd511('0xa3')](_0x26d1b5,'18',_0x2a096a)['then'](function(_0xd8992e){_0x421e81=_0xd8992e[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut[_0xd511('0x9e')](_0x26d1b5)>=_0x2a096a[_0xd511('0xa7')]){_0x54b0a5=ut[_0xd511('0xcd')](_0x26d1b5,0xf,_0xd511('0xa8'));rpcDb['createCustomerFinal'](_0x54b0a5,_0xd511('0xef'));}else{rpcDb[_0xd511('0x95')](_0x26d1b5,'[callProgressDetectingCustomer][machine]');}}else{_0x26d1b5[_0xd511('0xd1')]++;_0x53652e[_0xd511('0xb3')]({'id':_0x26d1b5[_0xd511('0xb2')],'field':{'countnoanswerretry':_0x26d1b5[_0xd511('0xd1')]}})['then'](function(){_0x53652e[_0xd511('0xb4')](_0x26d1b5,_0x33907b,_0x405f95)['then'](function(){});});}});delete this[_0xd511('0x16')][_0x293861[_0xd511('0xaf')]];break;default:if(_0x26d1b5[_0xd511('0x6e')]){ut[_0xd511('0x7a')](_0x2a096a,_0xd511('0xf0'));ut[_0xd511('0x7b')](_0xd511('0xf1')+_0x2a096a[_0xd511('0x29')],_0x293861);}_0x2a096a[_0xd511('0x44')]+=0x1;_0x26d1b5[_0xd511('0xc7')]=ut[_0xd511('0x9e')](_0x26d1b5);ut[_0xd511('0x8d')](_0x26d1b5,0xc,_0x293861[_0xd511('0xea')]||_0x293861[_0xd511('0xeb')]);_0x33907b=_0x2a096a[_0xd511('0xe3')];_0x405f95=_0x2a096a[_0xd511('0xa6')];rpcDb[_0xd511('0x91')](_0x26d1b5,'[callProgressDetectingCustomer][logUnknown]');_0x53652e['verifyAdditionalPhones'](_0x26d1b5,'20',_0x2a096a)[_0xd511('0x87')](function(_0x23e661){_0x421e81=_0x23e661[_0xd511('0xa4')]==0x1;if(!_0x421e81){if(ut[_0xd511('0x9e')](_0x26d1b5)>=_0x2a096a['dialGlobalMaxRetry']){_0x54b0a5=ut['cloneAction'](_0x26d1b5,0xf,'Global');rpcDb[_0xd511('0x95')](_0x54b0a5,_0xd511('0xf2'));}else{rpcDb[_0xd511('0x95')](_0x26d1b5,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xd511('0x16')][_0x293861[_0xd511('0xaf')]];}else{_0x53652e[_0xd511('0xb4')](_0x26d1b5,_0x33907b,_0x405f95)[_0xd511('0x87')](function(){});}});}if(!(_0x26d1b5[_0xd511('0x6e')]&&_0x1f9a79==='16')){ut['updateOriginated'](_0x2a096a,'[callProgressDetectingCustomer]');logger[_0xd511('0xb0')](_0xd511('0xf3'),_0x26d1b5[_0xd511('0xb9')],_0xd511('0xba'),_0x2a096a[_0xd511('0x29')],_0xd511('0x6b'),_0x2a096a[_0xd511('0x4e')]);}if(_0x1f9a79!==_0xd511('0xf4')){delete this['actions'][_0x293861[_0xd511('0xaf')]];delete this[_0xd511('0x16')][_0x293861[_0xd511('0xf5')]];}}};Preview[_0xd511('0xe')][_0xd511('0xf6')]=function(_0x46754e,_0x415e0a,_0x5bcb7c){if(_[_0xd511('0xf7')](_0x415e0a)&&_0xd511('0xf8')!==typeof _0x415e0a){return;}if(_['isUndefined'](_0x5bcb7c)&&'object'!==typeof _0x5bcb7c){return;}switch(_0x5bcb7c[_0xd511('0xf9')]){case'0':ut[_0xd511('0xfa')](_0x46754e,0x0,_0xd511('0x9f'));rpcDb[_0xd511('0xfb')](_0x46754e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xd511('0xfa')](_0x46754e,0x3,'NoAnswer');rpcDb[_0xd511('0xfb')](_0x46754e,_0xd511('0xfc'));break;case'5':ut[_0xd511('0xfa')](_0x46754e,0x5,_0xd511('0xc8'));rpcDb[_0xd511('0xfb')](_0x46754e,_0xd511('0xfd'));break;case'8':ut[_0xd511('0xfa')](_0x46754e,0x8,_0xd511('0xd4'));rpcDb[_0xd511('0xfb')](_0x46754e,_0xd511('0xfe'));break;case'22':ut['logAgent'](_0x46754e,0x16,_0xd511('0xff'));rpcDb[_0xd511('0xfb')](_0x46754e,_0xd511('0x100'));break;default:ut['logAgent'](_0x46754e,0xc,_0x5bcb7c[_0xd511('0xf9')]);rpcDb[_0xd511('0xfb')](_0x46754e,'[callProgressDetectingAgent][logCongestion]');}ut[_0xd511('0x78')](_0x415e0a,_0xd511('0x101'));logger['info'](_0xd511('0x102'),_0x46754e['uniqueid'],_0xd511('0xba'),_0x415e0a[_0xd511('0x29')],_0xd511('0x6b'),_0x415e0a[_0xd511('0x4e')]);delete this[_0xd511('0x16')][_0x46754e[_0xd511('0xb9')]];};Preview[_0xd511('0xe')][_0xd511('0xa3')]=function(_0x33fb5d,_0x329f53,_0x17c83e){return Promise[_0xd511('0x103')]()[_0xd511('0x87')](cmHopperAdditionalPhone[_0xd511('0xa3')](_0x33fb5d,_0x329f53,_0x17c83e))['catch'](logger[_0xd511('0xb0')](_0xd511('0x104')));};Preview[_0xd511('0xe')][_0xd511('0xb4')]=function(_0x417500,_0x54ca02,_0x1b74e){return Promise[_0xd511('0x103')]()['then'](cmHopperAdditionalPhone[_0xd511('0xb4')](_0x417500,_0x54ca02,_0x1b74e))[_0xd511('0x76')](logger[_0xd511('0xb0')](_0xd511('0x105')));};Preview[_0xd511('0xe')][_0xd511('0xb3')]=function(_0x122575){return Promise[_0xd511('0x103')]()[_0xd511('0x87')](cmHopperAdditionalPhone[_0xd511('0xb3')](_0x122575))['catch'](logger['info'](_0xd511('0x106')));};Preview[_0xd511('0xe')][_0xd511('0x107')]=function(_0x31957d,_0x5d79d0,_0x22e2a7,_0x5bc253,_0x45f64e){var _0x30d503=this;return new Promise(function(_0x372194,_0x3aaa0e){if(_['isNil'](_0x5d79d0)||_[_0xd511('0x80')](_0x5d79d0[_0xd511('0x108')])||_['isNil'](_0x5d79d0[_0xd511('0x109')])||_[_0xd511('0x80')](_0x5d79d0['VoiceQueueId'])){_0x3aaa0e(ut['message'](_0xd511('0x10a'),_0x5bc253,_0x45f64e));return;}var _0x2936f3=uuid['v4']();var _0x3f5409=_0x30d503[_0xd511('0x13')][_0x5d79d0[_0xd511('0x10b')][_0xd511('0x29')]];var _0x2a31f1=_0x22e2a7?_0x30d503[_0xd511('0x17')][_0x22e2a7]['id']:undefined;_0x30d503[_0xd511('0x16')][_0x2936f3]=new Action(_0x5d79d0,_0x3f5409,_0x2936f3,_0x22e2a7,_0x2a31f1);var _0x5a4741=_0x30d503[_0xd511('0x16')][_0x2936f3];_0x5a4741['unlockAgent']=_0x5bc253;_0x5a4741[_0xd511('0xae')]=_0x45f64e;_0x5a4741[_0xd511('0x10c')]=_0x22e2a7;if(_[_0xd511('0x10d')](_0x31957d)){_0x30d503[_0xd511('0x10e')](_0x5a4741,_0x3f5409,_0x5d79d0,_0x22e2a7)[_0xd511('0x87')](function(_0x4f97e7){logger[_0xd511('0xb0')]('[Preview][execCall][success]',_0xd511('0x10f')+_0x5a4741[_0xd511('0x6c')]+_0xd511('0x110')+_0x5a4741[_0xd511('0xb2')],JSON[_0xd511('0x56')](_0x4f97e7));ami[_0xd511('0x26')]('custom:agentcalled',ut[_0xd511('0xa1')](_0x5a4741,_0xd511('0x111'),_0x30d503['campaignsPreview'][_0x5a4741[_0xd511('0x6c')]]));_0x372194(ut[_0xd511('0x5d')](_0xd511('0x112')));})[_0xd511('0x76')](function(_0x38d062){ut[_0xd511('0x5f')]('[Preview][execCall][failure]',_0x38d062);_0x3aaa0e(ut[_0xd511('0x5d')](_0xd511('0x113'),_0x5bc253,_0x45f64e));});}else{_0x3f5409[_0xd511('0x3b')]+=0x1;ut['logBlacklist'](_0x5a4741);rpcDb[_0xd511('0x114')](_0x5a4741,_0xd511('0x115'));delete _0x30d503[_0xd511('0x16')][_0x2936f3];_0x3aaa0e(ut[_0xd511('0x5d')](_0xd511('0x116'),_0x5bc253,_0x45f64e));}});};Preview[_0xd511('0xe')][_0xd511('0x99')]=function(_0x4c3161){return!_[_0xd511('0x80')](_0x4c3161)&&!_[_0xd511('0x80')](_0x4c3161[_0xd511('0x29')])&&!_[_0xd511('0x80')](_0x4c3161[_0xd511('0x54')])&&_0x4c3161[_0xd511('0x54')]&&!_[_0xd511('0x80')](this[_0xd511('0x15')][util[_0xd511('0x57')]('SIP/%s',_0x4c3161[_0xd511('0x29')])])&&!_[_0xd511('0x80')](this['trunks'][util['format']('SIP/%s',_0x4c3161[_0xd511('0x29')])]['status'])&&(this[_0xd511('0x15')][util['format']('SIP/%s',_0x4c3161['name'])][_0xd511('0x74')]===_0xd511('0x117')||this['trunks'][util['format'](_0xd511('0x118'),_0x4c3161[_0xd511('0x29')])][_0xd511('0x74')]===_0xd511('0x119'));};Preview[_0xd511('0xe')]['run']=function(_0x32492a,_0xf94110){var _0x2dce94=this;return new Promise(function(_0x526304,_0x306459){_0x2dce94[_0xd511('0x11a')](_0x32492a,_0xf94110)[_0xd511('0x87')](function(_0x5d1853){_0x526304(_['pick'](_0x5d1853,['message']));})[_0xd511('0x76')](function(_0x3e91ff){if(_0x3e91ff['unlock']){rpcDb['unlockContact'](_0x32492a);}if(_0x3e91ff[_0xd511('0x54')]){rpcDb['disableContact'](_0x32492a);}_0x306459(_['pick'](_0x3e91ff,['message']));});});};Preview[_0xd511('0xe')][_0xd511('0x11a')]=function(_0x559cd0,_0x530fa1){var _0xf5c574=this;return new Promise(function(_0x2b5f88,_0x45fb74){var _0x2407b6,_0x14a479;rpcDb['getContactPreview'](_0x559cd0)[_0xd511('0x87')](function(_0x7b17a8){if(!_[_0xd511('0x80')](_0x7b17a8[0x0])){_0x14a479=_0x7b17a8[0x0]['recallme']?![]:!![];_0x2407b6=_0x7b17a8[0x0][_0xd511('0x11b')]?!![]:![];_0x2407b6=_0x530fa1?!![]:_0x2407b6;}var _0x37dd3d=_0xf5c574['validateContact'](_0x7b17a8);if(_0x37dd3d[_0xd511('0x11c')]){rpcDb['checkIsBlackList'](_[_0xd511('0x6f')](_0x7b17a8[0x0],['VoiceQueueId',_0xd511('0x109')]))['then'](function(_0x5fc0a0){_0xf5c574[_0xd511('0x107')](_0x5fc0a0,_0x7b17a8[0x0],_0x530fa1,_0x14a479,_0x2407b6)[_0xd511('0x87')](function(_0xa84d12){_0x2b5f88(_0xa84d12);})[_0xd511('0x76')](function(_0x51fd46){_0x45fb74(_0x51fd46);});})[_0xd511('0x76')](function(_0x47d83a){ut[_0xd511('0x5f')]('[Preview][checkIsBlackList]',_0x47d83a);_0x45fb74(ut[_0xd511('0x5d')](_0xd511('0x11d'),_0x14a479,_0x2407b6));});}else{_0x45fb74(ut[_0xd511('0x5d')](_0x37dd3d[_0xd511('0x5d')],_0x14a479,_0x2407b6));}})[_0xd511('0x76')](function(_0x520a23){ut[_0xd511('0x5f')](_0xd511('0x11e'),_0x520a23);_0x45fb74(ut[_0xd511('0x5d')](_0xd511('0x11d'),![],!![]));});});};Preview[_0xd511('0xe')]['validateContact']=function(_0x41a283){if(_[_0xd511('0x80')](_0x41a283)||_['isEmpty'](_0x41a283)||!_['isNil'](_0x41a283[0x0][_0xd511('0x84')])&&_[_0xd511('0x80')](_0x41a283[0x0][_0xd511('0x84')][_0xd511('0x29')])){ut['logger'](_0xd511('0x11f'),_0x41a283);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x57342b=this[_0xd511('0x13')][_0x41a283[0x0][_0xd511('0x10b')][_0xd511('0x29')]];_0x57342b[_0xd511('0x5d')]=_0xd511('0x9b');if(_['isNil'](_0x57342b)){ut['logger'](_0xd511('0x120'),_0x57342b);return{'isValid':![],'message':_0xd511('0x121')};}if(!this['isTrunkReachable'](_0x57342b[_0xd511('0x53')])){ut[_0xd511('0x5f')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20'+_0x57342b[_0xd511('0x29')]+_0xd511('0x122'));if(!this[_0xd511('0x99')](_0x57342b['TrunkBackup'])){ut[_0xd511('0x5f')](_0xd511('0x123'),_0x57342b['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xd511('0x124')};}}if(!ut['isActive'](_0x57342b[_0xd511('0x34')])){ut['logger'](_0xd511('0x125'),_0x57342b[_0xd511('0x29')]+_0xd511('0x126'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x57342b['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xd511('0x127')};};Preview[_0xd511('0xe')][_0xd511('0x10e')]=function(_0x24b3d5,_0x5395b6,_0x576aad,_0x467beb){var _0x34f830=this;return new Promise(function(_0xfd9110,_0x261538){var _0x4074e4=_0x24b3d5['uniqueid'];var _0x2c4388=_0x34f830[_0xd511('0x99')](_0x5395b6[_0xd511('0x53')])?util[_0xd511('0x57')](_0xd511('0x128'),_0x5395b6['Trunk'][_0xd511('0x29')],_[_0xd511('0x80')](_0x5395b6['dialPrefix'])?'':_0x5395b6[_0xd511('0x39')]['trim']()||'',_0x5395b6[_0xd511('0x129')]>0x0?_0x576aad['phone'][_0xd511('0x12a')](_0x5395b6['dialCutDigit']):_0x576aad[_0xd511('0x109')]):util[_0xd511('0x57')](_0xd511('0x128'),_[_0xd511('0x80')](_0x5395b6['TrunkBackup'])?_0x5395b6[_0xd511('0x53')][_0xd511('0x29')]:_0x5395b6['TrunkBackup'][_0xd511('0x29')],_[_0xd511('0x80')](_0x5395b6[_0xd511('0x39')])?'':_0x5395b6['dialPrefix']['trim']()||'',_0x5395b6[_0xd511('0x129')]>0x0?_0x576aad[_0xd511('0x109')][_0xd511('0x12a')](_0x5395b6[_0xd511('0x129')]):_0x576aad[_0xd511('0x109')]);var _0x3642ac=_0x34f830['isTrunkReachable'](_0x5395b6[_0xd511('0x53')])?ut[_0xd511('0x12b')](_0x5395b6[_0xd511('0x53')]['callerid'],_0x5395b6[_0xd511('0x36')],_0x5395b6['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xd511('0x12c')](_0x5395b6[_0xd511('0x37')],_0x5395b6[_0xd511('0x12d')]):_0x5395b6[_0xd511('0x37')]):ut[_0xd511('0x12b')](_[_0xd511('0x80')](_0x5395b6[_0xd511('0x12e')])?_0x5395b6[_0xd511('0x53')][_0xd511('0x12f')]:_0x5395b6[_0xd511('0x12e')][_0xd511('0x12f')],_0x5395b6[_0xd511('0x36')],_0x5395b6[_0xd511('0x12d')]>0x0?ut[_0xd511('0x12c')](_0x5395b6['dialOriginateCallerIdNumber'],_0x5395b6[_0xd511('0x12d')]):_0x5395b6['dialOriginateCallerIdNumber']);if(_0x3642ac){_0x24b3d5['originatecalleridname']=ut[_0xd511('0x130')](_0x3642ac);_0x24b3d5[_0xd511('0x131')]=ut[_0xd511('0x132')](_0x3642ac);}var _0x36d551=ut[_0xd511('0x133')](_0x5395b6,_0x576aad,_0x2c4388,_0x3642ac,_0x4074e4,_0x24b3d5);_[_0xd511('0x134')](_0x24b3d5,ut['toLowerVariables'](_0x36d551));_0x24b3d5[_0xd511('0x8b')]=moment()[_0xd511('0x57')](_0xd511('0xb5'));_0x5395b6['variables']=_0x36d551;ami[_0xd511('0x73')](ut['variablesAction'](_0x24b3d5,_0x5395b6,_0x36d551,_0x24b3d5['activeContact'],_0x467beb))[_0xd511('0x87')](function(_0x556ecd){_0x5395b6['originated']+=0x1;logger[_0xd511('0xb0')]('[originated][increment]',_0x4074e4,_0xd511('0xba'),_0x5395b6[_0xd511('0x29')],_0xd511('0x6b'),_0x5395b6['originated']);_0xfd9110(_0x556ecd);})[_0xd511('0x76')](function(_0x6fbce1){ut[_0xd511('0xfa')](_0x24b3d5,0xe,_0xd511('0x135'));rpcDb[_0xd511('0xfb')](_0x24b3d5,_0xd511('0x136'));_0x261538(_0x6fbce1);});});};Preview[_0xd511('0xe')][_0xd511('0x137')]=function(_0x449624){if(this['actions'][_0x449624[_0xd511('0xaf')]]){this['actions'][_0x449624[_0xd511('0xaf')]][_0xd511('0x75')]=_0x449624[_0xd511('0x75')];}};Preview[_0xd511('0xe')][_0xd511('0x1a')]=function(_0x2ec467){var _0x12105e=this;var _0x1c0df7=this['actions'][_0x2ec467[_0xd511('0x138')]];if(_0x1c0df7){if(_0x1c0df7[_0xd511('0x10c')]&&this['agents'][_0x1c0df7[_0xd511('0x10c')]]){ut[_0xd511('0x139')](_0x1c0df7,this['agents'][_0x1c0df7[_0xd511('0x10c')]][_0xd511('0x29')],this[_0xd511('0x17')][_0x1c0df7['lookAgent']]['id']);}var _0x1b19d2=_[_0xd511('0x13a')](_0x1c0df7);_0x1b19d2[_0xd511('0xb6')]=moment()[_0xd511('0x57')](_0xd511('0xb5'));var _0x569017=_0x12105e[_0xd511('0x13')][_0x1c0df7[_0xd511('0x6c')]];if(ut['isFailure'](_0x2ec467['response'])){if(_0x1c0df7[_0xd511('0xad')]){rpcDb[_0xd511('0x13b')](_0x1c0df7[_0xd511('0xb2')]);}if(_0x1c0df7[_0xd511('0xae')]){rpcDb['disableContact'](_0x1c0df7[_0xd511('0xb2')]);}ami['emit'](_0xd511('0x13c'),ut[_0xd511('0xa1')](_0x1c0df7,'rejected',this[_0xd511('0x13')][_0x1c0df7[_0xd511('0x6c')]]));this[_0xd511('0xf6')](_0x1b19d2,_0x569017,_0x2ec467);}else{_0x1c0df7['starttime']=moment()[_0xd511('0x57')](_0xd511('0xb5'));ut['logAgent'](_0x1b19d2,0x4,_0xd511('0x13d'));rpcDb[_0xd511('0xfb')](_0x1b19d2,_0xd511('0x13e'));}}};Preview[_0xd511('0xe')]['syncHangup']=function(_0x3ea21b){var _0x2e66b8=this[_0xd511('0x16')][_0x3ea21b[_0xd511('0xaf')]];var _0x86b7b7;if(_0x2e66b8){_0x86b7b7=this[_0xd511('0x13')][_0x2e66b8[_0xd511('0x6c')]];logger[_0xd511('0xb0')](_0xd511('0x13f'),_0x3ea21b[_0xd511('0xaf')],'\x20Queue',_0x86b7b7[_0xd511('0x29')],_0xd511('0x6d'),_0x86b7b7[_0xd511('0x5c')]);}if(this[_0xd511('0x16')][_0x3ea21b[_0xd511('0xaf')]]&&_0x3ea21b[_0xd511('0xaf')]!==_0x3ea21b[_0xd511('0xb9')]){if(_0x3ea21b[_0xd511('0x140')]==='16'&&this[_0xd511('0x16')][_0x3ea21b[_0xd511('0xaf')]][_0xd511('0x6e')]){this[_0xd511('0x9c')](_0x3ea21b,_0x3ea21b[_0xd511('0xaf')],_0x3ea21b['cause']);}else if(this[_0xd511('0x16')][_0x3ea21b[_0xd511('0xaf')]]['dialAnswer']){logger[_0xd511('0xb0')]('[syncHangup][talking][cause]',_0x3ea21b[_0xd511('0xaf')],_0x3ea21b[_0xd511('0x140')],_0xd511('0xba'),_0x86b7b7[_0xd511('0x29')],_0xd511('0x6d'),_0x86b7b7[_0xd511('0x5c')]);this[_0xd511('0x9c')](_0x3ea21b,_0x3ea21b[_0xd511('0xaf')],_0x3ea21b[_0xd511('0x140')]);}}else if(_0x2e66b8&&_[_0xd511('0x80')](_0x2e66b8[_0xd511('0x141')])&&_0x86b7b7['dialQueueProject']&&_0x3ea21b['linkedid']===_0x3ea21b['uniqueid']&&_[_0xd511('0x80')](_0x3ea21b[_0xd511('0xf9')])&&_0x3ea21b[_0xd511('0x140')]==='16'&&_0x3ea21b[_0xd511('0x142')]==='6'&&_[_0xd511('0xf7')](_0x2e66b8['transfer'])){if(_0x2e66b8['unlockAgent']){rpcDb['unlockContact'](_0x2e66b8[_0xd511('0xb2')]);}if(_0x2e66b8[_0xd511('0xae')]){rpcDb[_0xd511('0x8a')](_0x2e66b8[_0xd511('0xb2')]);}_0x3ea21b[_0xd511('0xf9')]='22';this['callProgressDetectingAgent'](_0x2e66b8,_0x86b7b7,_0x3ea21b);}else if(_0x2e66b8&&_0x2e66b8[_0xd511('0x143')]){if(_0x3ea21b[_0xd511('0x140')]==='16'&&this[_0xd511('0x16')][_0x3ea21b[_0xd511('0xaf')]][_0xd511('0x6e')]){logger[_0xd511('0xb0')](_0xd511('0x144'),_0x3ea21b[_0xd511('0xaf')],_0x3ea21b[_0xd511('0x140')],_0xd511('0xba'),_0x86b7b7[_0xd511('0x29')],_0xd511('0x6d'),_0x86b7b7['pTalking']);this[_0xd511('0x9c')](_0x3ea21b,_0x3ea21b[_0xd511('0xaf')],_0x3ea21b[_0xd511('0x140')]);}else if(this[_0xd511('0x16')][_0x3ea21b[_0xd511('0xaf')]][_0xd511('0x6e')]){logger[_0xd511('0xb0')](_0xd511('0x145'),_0x3ea21b[_0xd511('0xaf')],_0x3ea21b['cause'],'\x20Queue',_0x86b7b7[_0xd511('0x29')],_0xd511('0x6d'),_0x86b7b7[_0xd511('0x5c')]);this[_0xd511('0x9c')](_0x3ea21b,_0x3ea21b['linkedid'],_0x3ea21b['cause']);}}};Preview['prototype'][_0xd511('0x1f')]=function(_0x47eaad){if(this[_0xd511('0x16')][_0x47eaad[_0xd511('0xf5')]]&&_0x47eaad['destlinkedid']!==_0x47eaad[_0xd511('0x146')]){this[_0xd511('0x9c')](_0x47eaad,_0x47eaad['destlinkedid'],_0x47eaad[_0xd511('0xeb')]);}};Preview[_0xd511('0xe')][_0xd511('0x1d')]=function(_0x597357){if(this[_0xd511('0x16')][_0x597357[_0xd511('0xaf')]]&&_0x597357['linkedid']!==_0x597357[_0xd511('0xb9')]&&!this[_0xd511('0x16')][_0x597357[_0xd511('0xaf')]][_0xd511('0x6e')]){if(_0x597357[_0xd511('0x140')]==='1'){this[_0xd511('0x9c')](_0x597357,_0x597357[_0xd511('0xaf')],_0x597357[_0xd511('0x140')]);}}};Preview['prototype']['addVariable']=function(_0x2a0e65,_0x1c47b2,_0x20e000){if(this[_0xd511('0x16')][_0x2a0e65]){if(_[_0xd511('0x80')](this['actions'][_0x2a0e65][_0xd511('0x147')])){this['actions'][_0x2a0e65]['variables']={};}this[_0xd511('0x16')][_0x2a0e65][_0xd511('0x147')][_0x1c47b2]=_0x20e000;}};Preview[_0xd511('0xe')]['syncVarSet']=function(_0x258b85){try{if(!_[_0xd511('0x80')](_0x258b85)){if(ut[_0xd511('0x148')](_[_0xd511('0x149')](_0x258b85[_0xd511('0x14a')])[0x0])){this[_0xd511('0x14b')](_0x258b85['uniqueid'],_[_0xd511('0x149')](_0x258b85[_0xd511('0x14a')])[0x0],_0x258b85[_0xd511('0x14c')]);}}}catch(_0x4a1492){logger[_0xd511('0x14d')](_0xd511('0x14e'),util[_0xd511('0x14f')](_0x4a1492,{'showHidden':![],'depth':null}));}};Preview[_0xd511('0xe')][_0xd511('0x22')]=function(_0x4897b4){if(_0x4897b4){if(this[_0xd511('0x16')][_0x4897b4[_0xd511('0x150')]]){this['actions'][_0x4897b4[_0xd511('0x150')]][_0xd511('0x143')]=!![];}}};Preview[_0xd511('0xe')][_0xd511('0x24')]=function(_0x2f0655){if(_0x2f0655){if(this[_0xd511('0x16')][_0x2f0655[_0xd511('0x151')]]){this['actions'][_0x2f0655[_0xd511('0x151')]][_0xd511('0x143')]=!![];}}};module[_0xd511('0x152')]=Preview; \ No newline at end of file +var _0x9b44=['custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countagentrejectretry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','dialAgentRejectRetryFrequency','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unlock','execRun','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridnum','extractCalleridNumber','addVariables','merge','variables','variablesAction','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','Answer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','exports','util','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','strategy','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','name','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','type','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','stringify','dialAnswer','pick','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[action]','size','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','dialActive','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','buildAcw','complete','[16]','[callProgressDetectingCustomer][logAnswer]','talktime','sumBillable','linkedid','BUSY','countbusyretry','totalGlobal','Busy','verifyAdditionalPhones','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency'];(function(_0x34fcee,_0x21b407){var _0xaf2194=function(_0x2ad21a){while(--_0x2ad21a){_0x34fcee['push'](_0x34fcee['shift']());}};_0xaf2194(++_0x21b407);}(_0x9b44,0x1ea));var _0x49b4=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x9b44[_0x4b9dc9];return _0x57b302;};'use strict';var util=require(_0x49b4('0x0'));var _=require(_0x49b4('0x1'));var uuid=require('uuid');var moment=require(_0x49b4('0x2'));var md5=require(_0x49b4('0x3'));var Redis=require(_0x49b4('0x4'));var config=require(_0x49b4('0x5'));var logger=require(_0x49b4('0x6'))(_0x49b4('0x7'));var loggerAction=require(_0x49b4('0x6'))(_0x49b4('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x49b4('0x9'));var Action=require('./action');var ut=require(_0x49b4('0xa'));config[_0x49b4('0xb')]=_[_0x49b4('0xc')](config[_0x49b4('0xb')],{'host':_0x49b4('0xd'),'port':0x18eb});var io=require(_0x49b4('0xe'))(new Redis(config[_0x49b4('0xb')]));var Sequence=function(){};Sequence[_0x49b4('0xf')]['enqueue']=function(_0x1239a9){this[_0x49b4('0x10')]=this[_0x49b4('0x10')]?this[_0x49b4('0x10')][_0x49b4('0x11')](_0x1239a9):_0x1239a9();};function Preview(_0x5c034f){this[_0x49b4('0x12')]=new Sequence();this[_0x49b4('0x13')]=_0x5c034f[_0x49b4('0x14')];this[_0x49b4('0x15')]=_0x5c034f['trunks'];this[_0x49b4('0x16')]={};this[_0x49b4('0x17')]=_0x5c034f[_0x49b4('0x17')];this[_0x49b4('0x18')]=0x0;ami['on'](_0x49b4('0x19'),this[_0x49b4('0x1a')][_0x49b4('0x1b')](this));ami['on']('hangup',this[_0x49b4('0x1c')][_0x49b4('0x1b')](this));ami['on'](_0x49b4('0x1d'),this[_0x49b4('0x1e')][_0x49b4('0x1b')](this));ami['on'](_0x49b4('0x1f'),this[_0x49b4('0x20')][_0x49b4('0x1b')](this));ami['on']('newexten',this['syncNewExten'][_0x49b4('0x1b')](this));ami['on'](_0x49b4('0x21'),this[_0x49b4('0x22')][_0x49b4('0x1b')](this));ami['on'](_0x49b4('0x23'),this[_0x49b4('0x24')]['bind'](this));ami['on']('blindtransfer',this[_0x49b4('0x25')][_0x49b4('0x1b')](this));this[_0x49b4('0x26')](this['campaignsPreview']);}function emit(_0x537ec2,_0x14e55e,_0xcb597d){io['to'](_0x537ec2)[_0x49b4('0x27')](_0x14e55e,_0xcb597d);}function emitCampaignPreview(_0x5a5bc7){if(_0x5a5bc7['type']==='outbound'){var _0xfa5149={'id':_0x5a5bc7['id'],'name':_0x5a5bc7['name'],'strategy':_0x5a5bc7[_0x49b4('0x28')],'answered':_0x5a5bc7['answered'],'available':_0x5a5bc7[_0x49b4('0x29')],'loggedIn':_0x5a5bc7[_0x49b4('0x2a')],'pTalking':_0x5a5bc7[_0x49b4('0x2b')],'sumBillable':_0x5a5bc7['sumBillable'],'sumDuration':_0x5a5bc7['sumDuration'],'sumHoldTime':_0x5a5bc7[_0x49b4('0x2c')]||0x0,'talking':_0x5a5bc7[_0x49b4('0x2d')],'total':_0x5a5bc7[_0x49b4('0x2e')],'type':_0x5a5bc7['type'],'unmanaged':_0x5a5bc7[_0x49b4('0x2f')],'abandoned':_0x5a5bc7[_0x49b4('0x30')],'waiting':_0x5a5bc7[_0x49b4('0x31')],'loggedInDb':_0x5a5bc7[_0x49b4('0x32')],'dialActive':_0x5a5bc7['dialActive'],'dialMethod':_0x5a5bc7[_0x49b4('0x33')],'dialOriginateCallerIdName':_0x5a5bc7['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5a5bc7['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5a5bc7[_0x49b4('0x34')],'dialPrefix':_0x5a5bc7['dialPrefix'],'outboundAnswerAgiCallsDay':_0x5a5bc7['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5a5bc7[_0x49b4('0x35')],'outboundBlacklistCallsDay':_0x5a5bc7[_0x49b4('0x36')],'outboundBusyCallsDay':_0x5a5bc7[_0x49b4('0x37')],'outboundCongestionCallsDay':_0x5a5bc7[_0x49b4('0x38')],'outboundDropCallsDayACS':_0x5a5bc7['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5a5bc7['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5a5bc7[_0x49b4('0x39')],'outboundNoAnswerCallsDay':_0x5a5bc7[_0x49b4('0x3a')],'outboundNoSuchCallsDay':_0x5a5bc7[_0x49b4('0x3b')],'outboundOriginateFailureCallsDay':_0x5a5bc7['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5a5bc7['outboundReCallsDay'],'outboundRejectCallsDay':_0x5a5bc7[_0x49b4('0x3c')],'outboundUnknownCallsDay':_0x5a5bc7[_0x49b4('0x3d')],'outboundAbandonedCallsDay':_0x5a5bc7[_0x49b4('0x3e')],'predictiveIntervalAnsweredCalls':_0x5a5bc7['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5a5bc7[_0x49b4('0x3f')],'predictiveIntervalAvgTalktime':_0x5a5bc7[_0x49b4('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x5a5bc7[_0x49b4('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x5a5bc7[_0x49b4('0x42')],'predictiveIntervalErlangCalls':_0x5a5bc7[_0x49b4('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a5bc7[_0x49b4('0x44')],'predictiveIntervalHitRate':_0x5a5bc7[_0x49b4('0x45')],'predictiveIntervalMultiplicativeFactor':_0x5a5bc7[_0x49b4('0x46')],'predictiveIntervalPauses':_0x5a5bc7[_0x49b4('0x47')],'predictiveIntervalAvailable':_0x5a5bc7[_0x49b4('0x48')],'predictiveIntervalTotalCalls':_0x5a5bc7[_0x49b4('0x49')],'message':_0x5a5bc7[_0x49b4('0x4a')],'originated':_0x5a5bc7[_0x49b4('0x4b')],'erlangCalls':_0x5a5bc7[_0x49b4('0x4c')],'erlangCallToSecond':_0x5a5bc7[_0x49b4('0x4d')],'erlangAbandonmentRate':_0x5a5bc7[_0x49b4('0x4e')],'erlangBusyFactor':_0x5a5bc7[_0x49b4('0x4f')],'startPredictive':_0x5a5bc7[_0x49b4('0x50')],'startProgressive':_0x5a5bc7[_0x49b4('0x51')]};if(_0x5a5bc7[_0x49b4('0x52')]){_0xfa5149[_0x49b4('0x52')]={'id':_0x5a5bc7['Trunk']['id'],'name':_0x5a5bc7[_0x49b4('0x52')]['name'],'active':_0x5a5bc7[_0x49b4('0x52')][_0x49b4('0x53')],'callerid':_0x5a5bc7[_0x49b4('0x52')][_0x49b4('0x54')]};}if(_0x5a5bc7['Interval']){_0xfa5149[_0x49b4('0x55')]={'id':_0x5a5bc7[_0x49b4('0x55')]['id'],'name':_0x5a5bc7['Interval'][_0x49b4('0x56')]};}var _0x19c39b=md5(JSON['stringify'](_0xfa5149));if(_0x5a5bc7[_0x49b4('0x3')]!==_0x19c39b){_0x5a5bc7[_0x49b4('0x3')]=_0x19c39b;emit(util['format'](_0x49b4('0x57'),_0xfa5149['name']),_0x49b4('0x58'),_0xfa5149);}}}function emitVoiceQueueChannelRemove(_0x18b564){logger[_0x49b4('0x59')](_0x49b4('0x5a'),JSON['stringify'](_0x18b564));emit(util[_0x49b4('0x5b')](_0x49b4('0x57'),_0x18b564[_0x49b4('0x56')]),'voice_queue_channel:remove',_0x18b564);io[_0x49b4('0x27')]('voice_queue_presence:remove',_0x18b564);}function notSendMessagesQueue(_0x579962){if(_0x579962[_0x49b4('0x5c')]){if(_0x579962[_0x49b4('0x4b')]===0x0&&_0x579962[_0x49b4('0x2b')]===0x0){_0x579962[_0x49b4('0x5c')]=![];_0x579962['available']=0x0;_0x579962[_0x49b4('0x5d')]=0x0;_0x579962[_0x49b4('0x4a')]=_0x49b4('0x5e');ut[_0x49b4('0x5f')](_0x49b4('0x60'),_0x579962[_0x49b4('0x56')]+_0x49b4('0x61'));}else{_0x579962[_0x49b4('0x4a')]=_0x49b4('0x62');ut['logger'](_0x49b4('0x60'),_0x579962['name']+_0x49b4('0x63'));}emitCampaignPreview(_0x579962);}}Preview[_0x49b4('0xf')][_0x49b4('0x26')]=function(){var _0xbecf2=this;setInterval(function(){_0xbecf2[_0x49b4('0x64')]();},0x7cf);};Preview[_0x49b4('0xf')][_0x49b4('0x64')]=function(){var _0x11234c=this['campaignsPreview'];this[_0x49b4('0x18')]+=0x1;for(var _0x220319 in _0x11234c){if(_0x11234c[_0x49b4('0x65')](_0x220319)&&(_0x11234c[_0x220319][_0x49b4('0x33')]===_0x49b4('0x7')||_0x11234c[_0x220319]['dialMethod']==='booked')&&_0x11234c[_0x220319][_0x49b4('0x66')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x49b4('0x18')]=0x0;this[_0x49b4('0x67')]();}}if(_0x11234c[_0x49b4('0x65')](_0x220319)&&_0x11234c[_0x220319]['dialMethod']===_0x49b4('0x7')&&_0x11234c[_0x220319][_0x49b4('0x66')]==='outbound'){if(_0x11234c[_0x220319]['dialActive']){this[_0x49b4('0x68')](_0x11234c[_0x220319]);if(_0x11234c[_0x220319][_0x49b4('0x69')])this[_0x49b4('0x6a')](_0x11234c[_0x220319]);}else{notSendMessagesQueue(_0x11234c[_0x220319]);}}}};Preview[_0x49b4('0xf')][_0x49b4('0x6b')]=function(_0xbad117){var _0x5e37ee=this;this[_0x49b4('0x12')][_0x49b4('0x6c')](function(){if(!_[_0x49b4('0x6d')](_0x5e37ee['actions'][_0xbad117])){loggerAction['info'](_0x49b4('0x6e'),_0xbad117,_0x49b4('0x6f'),_0x5e37ee['actions'][_0xbad117][_0x49b4('0x70')],'originated:\x20',JSON[_0x49b4('0x71')](_0x5e37ee[_0x49b4('0x13')][_0x5e37ee[_0x49b4('0x16')][_0xbad117][_0x49b4('0x70')]][_0x49b4('0x4b')]),'pTalking:\x20',JSON[_0x49b4('0x71')](_0x5e37ee['campaignsPreview'][_0x5e37ee[_0x49b4('0x16')][_0xbad117][_0x49b4('0x70')]][_0x49b4('0x2b')]),JSON[_0x49b4('0x71')](_0x5e37ee['actions'][_0xbad117][_0x49b4('0x72')]),JSON['stringify'](_[_0x49b4('0x73')](_0x5e37ee['actions'][_0xbad117],['contactId',_0x49b4('0x74'),'VoiceQueueId',_0x49b4('0x75')])));return ami[_0x49b4('0x76')]({'action':_0x49b4('0x77'),'channel':_0x5e37ee[_0x49b4('0x16')][_0xbad117][_0x49b4('0x78')]})[_0x49b4('0x79')](function(_0x285faf){if(_0x285faf[_0x49b4('0x4a')]===_0x49b4('0x7a')){setTimeout(function(){if(_0x5e37ee[_0x49b4('0x16')][_0xbad117]){ut['updateOriginated'](_0x5e37ee[_0x49b4('0x13')][_0x5e37ee[_0x49b4('0x16')][_0xbad117][_0x49b4('0x70')]],_0x49b4('0x7b'));if(_0x5e37ee['actions'][_0xbad117][_0x49b4('0x72')]===!![]){ut[_0x49b4('0x7c')](_0x5e37ee[_0x49b4('0x13')][_0x5e37ee[_0x49b4('0x16')][_0xbad117][_0x49b4('0x70')]],'[clearZombieChannel]');ut['loggerError'](_0x49b4('0x7d')+_0xbad117,_0x5e37ee[_0x49b4('0x16')][_0xbad117]['queue']);}ut[_0x49b4('0x7e')]('[Dialer][checkChannel][Preview]'+_0xbad117,_0x5e37ee[_0x49b4('0x16')][_0xbad117][_0x49b4('0x70')]);delete _0x5e37ee[_0x49b4('0x16')][_0xbad117];}},0x2328);}});}});};Preview[_0x49b4('0xf')][_0x49b4('0x67')]=function(){var _0x121e61=this;loggerAction[_0x49b4('0x59')](_0x49b4('0x7f'),_[_0x49b4('0x80')](this[_0x49b4('0x16')]));for(var _0x27e904 in this[_0x49b4('0x16')]){if(_0x121e61[_0x49b4('0x16')][_0x49b4('0x65')](_0x27e904)){_0x121e61[_0x49b4('0x6b')](_0x27e904);}}};Preview['prototype'][_0x49b4('0x6a')]=function(_0x1e6871){var _0x3cbcfd=this;rpcDb['getContactRecallMe'](_0x1e6871['id'],ut['agentReadyId'](this[_0x49b4('0x17')]))[_0x49b4('0x81')](function(_0x209be3){if(!_[_0x49b4('0x6d')](_0x209be3)){for(var _0x21c02e=0x0;_0x21c02e<_0x209be3[_0x49b4('0x82')];_0x21c02e+=0x1){if(ut['getDiff'](_0x209be3[_0x21c02e][_0x49b4('0x83')])<_0x1e6871[_0x49b4('0x84')]*0x3c){if(_0x209be3[_0x21c02e][_0x49b4('0x85')]&&!_0x209be3[_0x21c02e]['Agent'][_0x49b4('0x86')]){_0x3cbcfd[_0x49b4('0x87')](_0x209be3[_0x21c02e]['id'])[_0x49b4('0x81')](ut['logger2'](_0x49b4('0x88')))['catch'](ut[_0x49b4('0x89')](_0x49b4('0x88')));}else{rpcDb[_0x49b4('0x8a')](_0x209be3[_0x21c02e]['id']);}}else{var _0x75341=new Action(_0x209be3[_0x21c02e],_0x1e6871);_0x75341[_0x49b4('0x8b')]=moment()[_0x49b4('0x5b')](_0x49b4('0x8c'));_0x1e6871[_0x49b4('0x8d')]+=0x1;ut[_0x49b4('0x8e')](_0x75341,0x17,_0x49b4('0x8f'));if(_0x1e6871['dialRecallInQueue']){rpcDb[_0x49b4('0x90')](ut['createBody'](_0x209be3[_0x21c02e]));rpcDb[_0x49b4('0x91')](_0x75341,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x49b4('0x8e')](_0x75341,0x16,_0x49b4('0x92'));rpcDb[_0x49b4('0x91')](_0x75341,_0x49b4('0x93'));rpcDb['createCustomerFinal'](_0x75341,_0x49b4('0x93'));}}}}})['catch'](ut[_0x49b4('0x89')](_0x49b4('0x94')));};Preview[_0x49b4('0xf')][_0x49b4('0x68')]=function(_0x2fdcec){_0x2fdcec[_0x49b4('0x5c')]=!![];if(ut[_0x49b4('0x95')](_0x2fdcec['loggedIn'])){_0x2fdcec[_0x49b4('0x4a')]=_0x49b4('0x96');}else if(!ut['isActive'](_0x2fdcec[_0x49b4('0x97')])){_0x2fdcec[_0x49b4('0x4a')]=_0x49b4('0x5e');}else if(!this['isTrunkReachable'](_0x2fdcec['Trunk'])){if(!this[_0x49b4('0x98')](_0x2fdcec['TrunkBackup'])){_0x2fdcec[_0x49b4('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x2fdcec[_0x49b4('0x4a')]='ACTIVE';}}else{_0x2fdcec['message']=_0x49b4('0x99');}emitCampaignPreview(_0x2fdcec);};Preview[_0x49b4('0xf')][_0x49b4('0x9a')]=function(_0x45d71a,_0x5de247,_0x4b5eb1){var _0x577062=this;var _0x41e9aa=this[_0x49b4('0x16')][_0x5de247];var _0x559499=this['campaignsPreview'][_0x41e9aa['queue']];var _0x4a58c6;var _0x233fb4=![];var _0x52708e=0x2;var _0x45c6ec=0x3;if(_0x559499){switch(_0x4b5eb1){case'1':_0x559499['outboundNoSuchCallsDay']+=0x1;_0x41e9aa[_0x49b4('0x9b')]+=0x1;_0x41e9aa[_0x49b4('0x9c')]=ut['totalGlobal'](_0x41e9aa);ut['logCustomer'](_0x41e9aa,0x0,_0x49b4('0x9d'));ami[_0x49b4('0x27')](_0x49b4('0x9e'),ut[_0x49b4('0x9f')](_0x41e9aa,_0x49b4('0xa0')));rpcDb[_0x49b4('0x91')](_0x41e9aa,_0x49b4('0xa1'));_0x577062['verifyAdditionalPhones'](_0x41e9aa,'0',_0x559499)['then'](function(_0x4d59d4){_0x233fb4=_0x4d59d4[_0x49b4('0xa2')]==0x1;_0x52708e=_0x559499[_0x49b4('0xa3')];_0x45c6ec=_0x559499[_0x49b4('0xa4')];if(!_0x233fb4){if(ut['totalGlobal'](_0x41e9aa)>=_0x559499['dialGlobalMaxRetry']){_0x4a58c6=ut['cloneAction'](_0x41e9aa,0xf,_0x49b4('0xa5'));rpcDb[_0x49b4('0xa6')](_0x4a58c6,_0x49b4('0xa7'));}else{if(_0x41e9aa[_0x49b4('0x9b')]>=_0x559499[_0x49b4('0xa8')]){rpcDb[_0x49b4('0xa6')](_0x41e9aa,_0x49b4('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0x49b4('0xa9')](_0x41e9aa,_0x49b4('0x9b'),_0x559499[_0x49b4('0xa3')]),_0x41e9aa[_0x49b4('0xaa')],_0x41e9aa[_0x49b4('0xab')]);}}delete this[_0x49b4('0x16')][_0x45d71a['linkedid']];}else{_0x41e9aa[_0x49b4('0x9b')]++;logger[_0x49b4('0x59')]('actioncountonusuch',_0x41e9aa['countnosuchnumberretry']);logger[_0x49b4('0x59')]('id',_0x41e9aa['idContact']);_0x577062[_0x49b4('0xac')]({'id':_0x41e9aa[_0x49b4('0xad')],'field':{'countnosuchnumberretry':_0x41e9aa['countnosuchnumberretry']}})[_0x49b4('0x81')](function(){_0x577062[_0x49b4('0xae')](_0x41e9aa,_0x52708e,_0x45c6ec)[_0x49b4('0x81')](function(){});});}});break;case _0x49b4('0xaf'):var _0x13b756=moment()[_0x49b4('0x5b')](_0x49b4('0x8c'));_0x41e9aa[_0x49b4('0xb0')]=_0x13b756;_0x41e9aa[_0x49b4('0xb1')]=_0x13b756;_0x41e9aa[_0x49b4('0x72')]=!![];_0x559499[_0x49b4('0x2b')]+=0x1;logger[_0x49b4('0x59')](_0x49b4('0xb2'),_0x41e9aa[_0x49b4('0xb3')],_0x49b4('0xb4'),_0x559499[_0x49b4('0x56')],_0x49b4('0xb5'),_0x559499[_0x49b4('0x2b')]);ami['emit'](_0x49b4('0xb6'),ut[_0x49b4('0x9f')](_0x41e9aa,_0x49b4('0xb7'),this[_0x49b4('0x13')][_0x41e9aa[_0x49b4('0x70')]]));if(_0x559499['acw']){ami[_0x49b4('0x27')]('custom:agentConnectPreview',ut[_0x49b4('0xb8')](_0x41e9aa));}break;case'16':ami[_0x49b4('0x27')]('custom:agentcomplete',ut[_0x49b4('0x9f')](_0x41e9aa,_0x49b4('0xb9'),this[_0x49b4('0x13')][_0x41e9aa[_0x49b4('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x49b4('0x9f')](_0x41e9aa,_0x49b4('0xb9')));_0x559499[_0x49b4('0x35')]+=0x1;_0x559499[_0x49b4('0x2e')]+=0x1;_0x559499['answered']+=0x1;ut[_0x49b4('0x7c')](_0x559499,_0x49b4('0xba'));_0x41e9aa[_0x49b4('0x9c')]=ut['totalGlobal'](_0x41e9aa);ut[_0x49b4('0x8e')](_0x41e9aa,0x4,'Answer');rpcDb[_0x49b4('0x91')](_0x41e9aa,_0x49b4('0xbb'));rpcDb[_0x49b4('0xa6')](_0x41e9aa,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x41e9aa);_0x559499['sumDuration']+=_0x41e9aa[_0x49b4('0xbc')];_0x559499[_0x49b4('0xbd')]+=_0x41e9aa[_0x49b4('0xbc')];logger[_0x49b4('0x59')]('[syncHangup][talking][decrement]',_0x41e9aa[_0x49b4('0xb3')],_0x49b4('0xb4'),_0x559499[_0x49b4('0x56')],_0x49b4('0xb5'),_0x559499[_0x49b4('0x2b')]);delete this['actions'][_0x45d71a[_0x49b4('0xbe')]];break;case _0x49b4('0xbf'):_0x559499[_0x49b4('0x37')]+=0x1;_0x41e9aa[_0x49b4('0xc0')]+=0x1;_0x41e9aa[_0x49b4('0x9c')]=ut[_0x49b4('0xc1')](_0x41e9aa);ut['logCustomer'](_0x41e9aa,0x5,_0x49b4('0xc2'));_0x52708e=_0x559499['dialBusyRetryFrequency'];_0x45c6ec=_0x559499[_0x49b4('0xa4')];ami[_0x49b4('0x27')]('custom:agentbusy',ut[_0x49b4('0x9f')](_0x41e9aa,'busy'));rpcDb[_0x49b4('0x91')](_0x41e9aa,'[callProgressDetectingCustomer][logBusy]');_0x577062[_0x49b4('0xc3')](_0x41e9aa,'5',_0x559499)[_0x49b4('0x81')](function(_0x2b8a38){_0x233fb4=_0x2b8a38[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut[_0x49b4('0xc1')](_0x41e9aa)>=_0x559499[_0x49b4('0xc4')]){_0x4a58c6=ut[_0x49b4('0xc5')](_0x41e9aa,0xf,'Global');rpcDb['createCustomerFinal'](_0x4a58c6,_0x49b4('0xc6'));}else{if(_0x41e9aa[_0x49b4('0xc0')]>=_0x559499[_0x49b4('0xc7')]){rpcDb[_0x49b4('0xa6')](_0x41e9aa,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x49b4('0xc8')](ut[_0x49b4('0xa9')](_0x41e9aa,_0x49b4('0xc0'),_0x559499[_0x49b4('0xc9')]),_0x41e9aa[_0x49b4('0xaa')],_0x41e9aa[_0x49b4('0xab')]);}}}else{_0x41e9aa[_0x49b4('0xc0')]++;_0x577062['incrementPreviewCounters']({'id':_0x41e9aa['idContact'],'field':{'countbusyretry':_0x41e9aa[_0x49b4('0xc0')]}})[_0x49b4('0x81')](function(){_0x577062['swapAdditionalPhones'](_0x41e9aa,_0x52708e,_0x45c6ec)[_0x49b4('0x81')](function(){});});}});break;case _0x49b4('0xca'):_0x559499[_0x49b4('0x3a')]+=0x1;_0x41e9aa[_0x49b4('0xcb')]+=0x1;_0x41e9aa['countglobal']=ut[_0x49b4('0xc1')](_0x41e9aa);ut[_0x49b4('0x8e')](_0x41e9aa,0x3,_0x49b4('0xcc'));_0x52708e=_0x559499[_0x49b4('0xcd')];_0x45c6ec=_0x559499['callAdditionalPhoneAfterMin'];var _0x5ddf8b=ut['buildNoAnswerEventPayload'](_0x41e9aa,_0x559499);ami[_0x49b4('0x27')](_0x49b4('0xce'),_0x5ddf8b);rpcDb[_0x49b4('0x91')](_0x41e9aa,'[callProgressDetectingCustomer][logNoAnswer]');_0x577062[_0x49b4('0xc3')](_0x41e9aa,'3',_0x559499)['then'](function(_0x4ca822){_0x233fb4=_0x4ca822[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut[_0x49b4('0xc1')](_0x41e9aa)>=_0x559499['dialGlobalMaxRetry']){_0x4a58c6=ut[_0x49b4('0xc5')](_0x41e9aa,0xf,_0x49b4('0xa5'));rpcDb[_0x49b4('0xa6')](_0x4a58c6,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x41e9aa['countnoanswerretry']>=_0x559499[_0x49b4('0xcf')]){rpcDb[_0x49b4('0xa6')](_0x41e9aa,_0x49b4('0xd0'));}else{rpcDb[_0x49b4('0xc8')](ut['scheduledAt'](_0x41e9aa,'countnoanswerretry',_0x559499[_0x49b4('0xcd')]),_0x41e9aa['unlockAgent'],_0x41e9aa[_0x49b4('0xab')]);}}}else{_0x41e9aa['countnoanswerretry']++;_0x577062[_0x49b4('0xac')]({'id':_0x41e9aa['idContact'],'field':{'countnoanswerretry':_0x41e9aa[_0x49b4('0xcb')]}})[_0x49b4('0x81')](function(){_0x577062[_0x49b4('0xae')](_0x41e9aa,_0x52708e,_0x45c6ec)[_0x49b4('0x81')](function(){});});}});break;case'CONGESTION':_0x559499[_0x49b4('0x38')]+=0x1;_0x41e9aa[_0x49b4('0xd1')]+=0x1;_0x41e9aa[_0x49b4('0x9c')]=ut[_0x49b4('0xc1')](_0x41e9aa);ut[_0x49b4('0x8e')](_0x41e9aa,0x8,'Congestion');_0x52708e=_0x559499[_0x49b4('0xd2')];_0x45c6ec=_0x559499[_0x49b4('0xa4')];ami['emit'](_0x49b4('0xd3'),ut[_0x49b4('0x9f')](_0x41e9aa,_0x49b4('0xd4')));rpcDb['createCustomerHistory'](_0x41e9aa,_0x49b4('0xd5'));_0x577062['verifyAdditionalPhones'](_0x41e9aa,'8',_0x559499)[_0x49b4('0x81')](function(_0x482047){_0x233fb4=_0x482047[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut['totalGlobal'](_0x41e9aa)>=_0x559499[_0x49b4('0xc4')]){_0x4a58c6=ut[_0x49b4('0xc5')](_0x41e9aa,0xf,_0x49b4('0xa5'));rpcDb[_0x49b4('0xa6')](_0x4a58c6,_0x49b4('0xd6'));}else{if(_0x41e9aa[_0x49b4('0xd1')]>=_0x559499[_0x49b4('0xd7')]){rpcDb[_0x49b4('0xa6')](_0x41e9aa,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x49b4('0xa9')](_0x41e9aa,_0x49b4('0xd1'),_0x559499[_0x49b4('0xc9')]),_0x41e9aa[_0x49b4('0xaa')],_0x41e9aa['activeContact']);}}}else{_0x41e9aa['countcongestionretry']++;_0x577062[_0x49b4('0xac')]({'id':_0x41e9aa[_0x49b4('0xad')],'field':{'countcongestionretry':_0x41e9aa['countcongestionretry']}})[_0x49b4('0x81')](function(){_0x577062['swapAdditionalPhones'](_0x41e9aa,_0x52708e,_0x45c6ec)[_0x49b4('0x81')](function(){});});}});break;case _0x49b4('0xd8'):_0x559499[_0x49b4('0x3c')]+=0x1;_0x41e9aa['countagentrejectretry']+=0x1;_0x41e9aa['countglobal']=ut[_0x49b4('0xc1')](_0x41e9aa);ut['logCustomer'](_0x41e9aa,0x14,'AgentReject');_0x52708e=_0x559499['dialAgentRejectRetryFrequency'];_0x45c6ec=_0x559499[_0x49b4('0xa4')];ami[_0x49b4('0x27')](_0x49b4('0xd9'),ut[_0x49b4('0x9f')](_0x41e9aa,_0x49b4('0xda')));rpcDb[_0x49b4('0x91')](_0x41e9aa,_0x49b4('0xdb'));_0x577062[_0x49b4('0xc3')](_0x41e9aa,'20',_0x559499)[_0x49b4('0x81')](function(_0x5ca749){_0x233fb4=_0x5ca749[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut[_0x49b4('0xc1')](_0x41e9aa)>=_0x559499[_0x49b4('0xc4')]){_0x4a58c6=ut[_0x49b4('0xc5')](_0x41e9aa,0x14,_0x49b4('0xdc'));rpcDb[_0x49b4('0xa6')](_0x4a58c6,_0x49b4('0xdd'));}else{if(_0x41e9aa['countagentrejectretry']>=_0x559499[_0x49b4('0xde')]){rpcDb[_0x49b4('0xa6')](_0x41e9aa,_0x49b4('0xdd'));}else{rpcDb[_0x49b4('0xc8')](ut['scheduledAt'](_0x41e9aa,_0x49b4('0xdf'),_0x559499['dialAgentRejectRetryFrequency']),_0x41e9aa[_0x49b4('0xaa')],_0x41e9aa[_0x49b4('0xab')]);}}}else{_0x41e9aa[_0x49b4('0xcb')]++;_0x577062[_0x49b4('0xac')]({'id':_0x41e9aa['idContact'],'field':{'countnoanswerretry':_0x41e9aa[_0x49b4('0xcb')]}})[_0x49b4('0x81')](function(){_0x577062['swapAdditionalPhones'](_0x41e9aa,_0x52708e,_0x45c6ec)['then'](function(){});});}});break;case _0x49b4('0xe0'):_0x559499[_0x49b4('0x3e')]+=0x1;_0x41e9aa['countabandonedretry']+=0x1;_0x41e9aa[_0x49b4('0x9c')]=ut[_0x49b4('0xc1')](_0x41e9aa);ut[_0x49b4('0x8e')](_0x41e9aa,0xb,_0x49b4('0xe1'));rpcDb[_0x49b4('0x91')](_0x41e9aa,_0x49b4('0xe2'));_0x577062[_0x49b4('0xc3')](_0x41e9aa,'11',_0x559499)[_0x49b4('0x81')](function(_0x154a7a){_0x233fb4=_0x154a7a[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut['totalGlobal'](_0x41e9aa)>=_0x559499[_0x49b4('0xc4')]){_0x4a58c6=ut[_0x49b4('0xc5')](_0x41e9aa,0xf,_0x49b4('0xa5'));rpcDb[_0x49b4('0xa6')](_0x4a58c6,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x41e9aa[_0x49b4('0xe3')]>=_0x559499['dialAbandonedMaxRety']){rpcDb[_0x49b4('0xa6')](_0x41e9aa,_0x49b4('0xe2'));}else{rpcDb[_0x49b4('0xc8')](ut['scheduledAt'](_0x41e9aa,_0x49b4('0xe4'),_0x559499['dialAbandonedRetryFrequency']),_0x41e9aa['unlockAgent'],_0x41e9aa[_0x49b4('0xab')]);}}}else{_0x41e9aa[_0x49b4('0xcb')]++;_0x577062[_0x49b4('0xac')]({'id':_0x41e9aa[_0x49b4('0xad')],'field':{'countnoanswerretry':_0x41e9aa[_0x49b4('0xcb')]}})[_0x49b4('0x81')](function(){_0x577062[_0x49b4('0xae')](_0x41e9aa,_0x52708e,_0x45c6ec)[_0x49b4('0x81')](function(){});});}});break;case'18':_0x559499[_0x49b4('0x3d')]+=0x1;_0x41e9aa[_0x49b4('0xe5')]+=0x1;_0x41e9aa[_0x49b4('0x9c')]=ut[_0x49b4('0xc1')](_0x41e9aa);ut[_0x49b4('0x8e')](_0x41e9aa,0x12,_0x45d71a[_0x49b4('0xe6')]||_0x45d71a[_0x49b4('0xe7')]);ami[_0x49b4('0x27')](_0x49b4('0xe8'),ut[_0x49b4('0x9f')](_0x41e9aa,_0x49b4('0xe9')));rpcDb[_0x49b4('0x91')](_0x41e9aa,_0x49b4('0xea'));_0x577062[_0x49b4('0xc3')](_0x41e9aa,'18',_0x559499)[_0x49b4('0x81')](function(_0x129882){_0x233fb4=_0x129882[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut[_0x49b4('0xc1')](_0x41e9aa)>=_0x559499[_0x49b4('0xc4')]){_0x4a58c6=ut['cloneAction'](_0x41e9aa,0x12,'Global');rpcDb[_0x49b4('0xa6')](_0x4a58c6,_0x49b4('0xea'));}else{rpcDb[_0x49b4('0xa6')](_0x41e9aa,_0x49b4('0xea'));}}else{_0x41e9aa['countnoanswerretry']++;_0x577062[_0x49b4('0xac')]({'id':_0x41e9aa[_0x49b4('0xad')],'field':{'countnoanswerretry':_0x41e9aa['countnoanswerretry']}})[_0x49b4('0x81')](function(){_0x577062[_0x49b4('0xae')](_0x41e9aa,_0x52708e,_0x45c6ec)['then'](function(){});});}});delete this['actions'][_0x45d71a[_0x49b4('0xbe')]];break;case'19':_0x559499[_0x49b4('0x3d')]+=0x1;_0x41e9aa[_0x49b4('0x9c')]=ut['totalGlobal'](_0x41e9aa);ut['logCustomer'](_0x41e9aa,0x13,_0x45d71a[_0x49b4('0xe6')]||_0x45d71a[_0x49b4('0xe7')]);ami[_0x49b4('0x27')]('custom:amd',ut['buildObj'](_0x41e9aa,'amd'));rpcDb['createCustomerHistory'](_0x41e9aa,_0x49b4('0xeb'));_0x577062['verifyAdditionalPhones'](_0x41e9aa,'18',_0x559499)['then'](function(_0x241218){_0x233fb4=_0x241218[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut['totalGlobal'](_0x41e9aa)>=_0x559499[_0x49b4('0xc4')]){_0x4a58c6=ut[_0x49b4('0xc5')](_0x41e9aa,0xf,_0x49b4('0xa5'));rpcDb[_0x49b4('0xa6')](_0x4a58c6,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x49b4('0xa6')](_0x41e9aa,_0x49b4('0xeb'));}}else{_0x41e9aa['countnoanswerretry']++;_0x577062['incrementPreviewCounters']({'id':_0x41e9aa[_0x49b4('0xad')],'field':{'countnoanswerretry':_0x41e9aa['countnoanswerretry']}})[_0x49b4('0x81')](function(){_0x577062[_0x49b4('0xae')](_0x41e9aa,_0x52708e,_0x45c6ec)[_0x49b4('0x81')](function(){});});}});delete this[_0x49b4('0x16')][_0x45d71a[_0x49b4('0xbe')]];break;default:if(_0x41e9aa[_0x49b4('0x72')]){ut[_0x49b4('0x7c')](_0x559499,_0x49b4('0xec'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x559499[_0x49b4('0x56')],_0x45d71a);}_0x559499[_0x49b4('0x3d')]+=0x1;_0x41e9aa[_0x49b4('0x9c')]=ut['totalGlobal'](_0x41e9aa);ut[_0x49b4('0x8e')](_0x41e9aa,0xc,_0x45d71a[_0x49b4('0xe6')]||_0x45d71a['dialstatus']);_0x52708e=_0x559499[_0x49b4('0xed')];_0x45c6ec=_0x559499[_0x49b4('0xa4')];rpcDb[_0x49b4('0x91')](_0x41e9aa,_0x49b4('0xee'));_0x577062[_0x49b4('0xc3')](_0x41e9aa,'20',_0x559499)[_0x49b4('0x81')](function(_0x381416){_0x233fb4=_0x381416[_0x49b4('0xa2')]==0x1;if(!_0x233fb4){if(ut[_0x49b4('0xc1')](_0x41e9aa)>=_0x559499[_0x49b4('0xc4')]){_0x4a58c6=ut[_0x49b4('0xc5')](_0x41e9aa,0xf,'Global');rpcDb[_0x49b4('0xa6')](_0x4a58c6,_0x49b4('0xef'));}else{rpcDb['createCustomerFinal'](_0x41e9aa,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x45d71a[_0x49b4('0xbe')]];}else{_0x577062[_0x49b4('0xae')](_0x41e9aa,_0x52708e,_0x45c6ec)['then'](function(){});}});}if(!(_0x41e9aa[_0x49b4('0x72')]&&_0x4b5eb1==='16')){ut[_0x49b4('0xf0')](_0x559499,_0x49b4('0xf1'));logger[_0x49b4('0x59')](_0x49b4('0xf2'),_0x41e9aa[_0x49b4('0xb3')],_0x49b4('0xb4'),_0x559499[_0x49b4('0x56')],'originated:\x20',_0x559499['originated']);}if(_0x4b5eb1!==_0x49b4('0xaf')){delete this['actions'][_0x45d71a[_0x49b4('0xbe')]];delete this[_0x49b4('0x16')][_0x45d71a[_0x49b4('0xf3')]];}}};Preview[_0x49b4('0xf')][_0x49b4('0xf4')]=function(_0x44e04c,_0x245feb,_0x23c1dc){if(_['isUndefined'](_0x245feb)&&_0x49b4('0xf5')!==typeof _0x245feb){return;}if(_[_0x49b4('0xf6')](_0x23c1dc)&&'object'!==typeof _0x23c1dc){return;}switch(_0x23c1dc[_0x49b4('0xf7')]){case'0':ut[_0x49b4('0xf8')](_0x44e04c,0x0,_0x49b4('0x9d'));rpcDb[_0x49b4('0xf9')](_0x44e04c,_0x49b4('0xfa'));break;case'3':ut[_0x49b4('0xf8')](_0x44e04c,0x3,_0x49b4('0xcc'));rpcDb[_0x49b4('0xf9')](_0x44e04c,_0x49b4('0xfb'));break;case'5':ut[_0x49b4('0xf8')](_0x44e04c,0x5,_0x49b4('0xc2'));rpcDb[_0x49b4('0xf9')](_0x44e04c,_0x49b4('0xfc'));break;case'8':ut[_0x49b4('0xf8')](_0x44e04c,0x8,_0x49b4('0xfd'));rpcDb[_0x49b4('0xf9')](_0x44e04c,_0x49b4('0xfe'));break;case'22':ut[_0x49b4('0xf8')](_0x44e04c,0x16,_0x49b4('0xff'));rpcDb[_0x49b4('0xf9')](_0x44e04c,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x44e04c,0xc,_0x23c1dc[_0x49b4('0xf7')]);rpcDb[_0x49b4('0xf9')](_0x44e04c,_0x49b4('0xfe'));}ut[_0x49b4('0xf0')](_0x245feb,_0x49b4('0x100'));logger[_0x49b4('0x59')](_0x49b4('0x101'),_0x44e04c['uniqueid'],_0x49b4('0xb4'),_0x245feb[_0x49b4('0x56')],_0x49b4('0x102'),_0x245feb[_0x49b4('0x4b')]);delete this[_0x49b4('0x16')][_0x44e04c['uniqueid']];};Preview['prototype'][_0x49b4('0xc3')]=function(_0x3877e9,_0x54bc5f,_0x31d33d){return Promise[_0x49b4('0x103')]()[_0x49b4('0x81')](cmHopperAdditionalPhone[_0x49b4('0xc3')](_0x3877e9,_0x54bc5f,_0x31d33d))[_0x49b4('0x79')](logger[_0x49b4('0x59')](_0x49b4('0x104')));};Preview['prototype'][_0x49b4('0xae')]=function(_0x355fe8,_0x166f06,_0x37b8de){return Promise[_0x49b4('0x103')]()[_0x49b4('0x81')](cmHopperAdditionalPhone[_0x49b4('0xae')](_0x355fe8,_0x166f06,_0x37b8de))[_0x49b4('0x79')](logger[_0x49b4('0x59')]('[swapAdditionalPhone]\x20'));};Preview[_0x49b4('0xf')][_0x49b4('0xac')]=function(_0x256541){return Promise[_0x49b4('0x103')]()[_0x49b4('0x81')](cmHopperAdditionalPhone[_0x49b4('0xac')](_0x256541))['catch'](logger[_0x49b4('0x59')](_0x49b4('0x105')));};Preview[_0x49b4('0xf')][_0x49b4('0x106')]=function(_0x1c8b92,_0x1afa0f,_0x2facff,_0x25c79e,_0x4ded40){var _0x378d8d=this;return new Promise(function(_0x2de4f4,_0x33f4d5){if(_[_0x49b4('0x6d')](_0x1afa0f)||_['isNil'](_0x1afa0f[_0x49b4('0x107')])||_[_0x49b4('0x6d')](_0x1afa0f[_0x49b4('0x108')])||_[_0x49b4('0x6d')](_0x1afa0f[_0x49b4('0x109')])){_0x33f4d5(ut[_0x49b4('0x4a')](_0x49b4('0x10a'),_0x25c79e,_0x4ded40));return;}var _0x2f387d=uuid['v4']();var _0x1a3606=_0x378d8d['campaignsPreview'][_0x1afa0f[_0x49b4('0x6f')][_0x49b4('0x56')]];var _0x18d426=_0x2facff?_0x378d8d['agents'][_0x2facff]['id']:undefined;_0x378d8d['actions'][_0x2f387d]=new Action(_0x1afa0f,_0x1a3606,_0x2f387d,_0x2facff,_0x18d426);var _0x333852=_0x378d8d['actions'][_0x2f387d];_0x333852['unlockAgent']=_0x25c79e;_0x333852[_0x49b4('0xab')]=_0x4ded40;_0x333852[_0x49b4('0x10b')]=_0x2facff;if(_[_0x49b4('0x10c')](_0x1c8b92)){_0x378d8d[_0x49b4('0x10d')](_0x333852,_0x1a3606,_0x1afa0f,_0x2facff)['then'](function(_0x24645b){logger[_0x49b4('0x59')](_0x49b4('0x10e'),_0x49b4('0x10f')+_0x333852['queue']+'\x20IdHopper:\x20'+_0x333852['idContact'],JSON[_0x49b4('0x71')](_0x24645b));ami[_0x49b4('0x27')](_0x49b4('0x110'),ut[_0x49b4('0x9f')](_0x333852,_0x49b4('0x111'),_0x378d8d['campaignsPreview'][_0x333852[_0x49b4('0x70')]]));_0x2de4f4(ut[_0x49b4('0x4a')](_0x49b4('0x112')));})[_0x49b4('0x79')](function(_0x14e591){ut[_0x49b4('0x5f')](_0x49b4('0x113'),_0x14e591);_0x33f4d5(ut[_0x49b4('0x4a')](_0x49b4('0x114'),_0x25c79e,_0x4ded40));});}else{_0x1a3606[_0x49b4('0x36')]+=0x1;ut['logBlacklist'](_0x333852);rpcDb[_0x49b4('0x115')](_0x333852,_0x49b4('0x116'));delete _0x378d8d[_0x49b4('0x16')][_0x2f387d];_0x33f4d5(ut[_0x49b4('0x4a')](_0x49b4('0x117'),_0x25c79e,_0x4ded40));}});};Preview['prototype']['isTrunkReachable']=function(_0x21d14d){return!_['isNil'](_0x21d14d)&&!_['isNil'](_0x21d14d[_0x49b4('0x56')])&&!_[_0x49b4('0x6d')](_0x21d14d[_0x49b4('0x53')])&&_0x21d14d[_0x49b4('0x53')]&&!_['isNil'](this['trunks'][util[_0x49b4('0x5b')]('SIP/%s',_0x21d14d['name'])])&&!_[_0x49b4('0x6d')](this[_0x49b4('0x15')][util['format'](_0x49b4('0x118'),_0x21d14d[_0x49b4('0x56')])][_0x49b4('0x77')])&&(this['trunks'][util[_0x49b4('0x5b')]('SIP/%s',_0x21d14d[_0x49b4('0x56')])][_0x49b4('0x77')]===_0x49b4('0x119')||this[_0x49b4('0x15')][util[_0x49b4('0x5b')](_0x49b4('0x118'),_0x21d14d[_0x49b4('0x56')])][_0x49b4('0x77')]==='unmonitored');};Preview[_0x49b4('0xf')][_0x49b4('0x87')]=function(_0x250844,_0x22b861){var _0x5bab8e=this;return new Promise(function(_0x4499b5,_0x539269){_0x5bab8e['execRun'](_0x250844,_0x22b861)[_0x49b4('0x81')](function(_0x4d81df){_0x4499b5(_['pick'](_0x4d81df,[_0x49b4('0x4a')]));})[_0x49b4('0x79')](function(_0x46ccf9){if(_0x46ccf9[_0x49b4('0x11a')]){rpcDb['unlockContact'](_0x250844);}if(_0x46ccf9['active']){rpcDb[_0x49b4('0x8a')](_0x250844);}_0x539269(_[_0x49b4('0x73')](_0x46ccf9,[_0x49b4('0x4a')]));});});};Preview[_0x49b4('0xf')][_0x49b4('0x11b')]=function(_0x350757,_0x3dfd15){var _0x4b1421=this;return new Promise(function(_0x29a8fa,_0x2a81fa){var _0x46f3f3,_0x30cf5c;rpcDb[_0x49b4('0x11c')](_0x350757)[_0x49b4('0x81')](function(_0x393449){if(!_[_0x49b4('0x6d')](_0x393449[0x0])){_0x30cf5c=_0x393449[0x0][_0x49b4('0x11d')]?![]:!![];_0x46f3f3=_0x393449[0x0][_0x49b4('0x11d')]?!![]:![];_0x46f3f3=_0x3dfd15?!![]:_0x46f3f3;}var _0x85fba=_0x4b1421['validateContact'](_0x393449);if(_0x85fba[_0x49b4('0x11e')]){rpcDb[_0x49b4('0x11f')](_['pick'](_0x393449[0x0],[_0x49b4('0x109'),_0x49b4('0x108')]))[_0x49b4('0x81')](function(_0x49848f){_0x4b1421[_0x49b4('0x106')](_0x49848f,_0x393449[0x0],_0x3dfd15,_0x30cf5c,_0x46f3f3)[_0x49b4('0x81')](function(_0x2307ea){_0x29a8fa(_0x2307ea);})[_0x49b4('0x79')](function(_0x24240a){_0x2a81fa(_0x24240a);});})[_0x49b4('0x79')](function(_0x599ec5){ut['logger'](_0x49b4('0x120'),_0x599ec5);_0x2a81fa(ut[_0x49b4('0x4a')]('Call\x20unsuccessful',_0x30cf5c,_0x46f3f3));});}else{_0x2a81fa(ut[_0x49b4('0x4a')](_0x85fba[_0x49b4('0x4a')],_0x30cf5c,_0x46f3f3));}})[_0x49b4('0x79')](function(_0x2e51a4){ut[_0x49b4('0x5f')](_0x49b4('0x121'),_0x2e51a4);_0x2a81fa(ut[_0x49b4('0x4a')](_0x49b4('0x122'),![],!![]));});});};Preview[_0x49b4('0xf')]['validateContact']=function(_0x43dee9){if(_[_0x49b4('0x6d')](_0x43dee9)||_[_0x49b4('0x10c')](_0x43dee9)||!_[_0x49b4('0x6d')](_0x43dee9[0x0][_0x49b4('0x85')])&&_[_0x49b4('0x6d')](_0x43dee9[0x0][_0x49b4('0x85')][_0x49b4('0x56')])){ut['logger'](_0x49b4('0x123'),_0x43dee9);return{'isValid':![],'message':_0x49b4('0x124')};}var _0x46d225=this[_0x49b4('0x13')][_0x43dee9[0x0][_0x49b4('0x6f')]['name']];_0x46d225['message']=_0x49b4('0x99');if(_['isNil'](_0x46d225)){ut['logger'](_0x49b4('0x125'),_0x46d225);return{'isValid':![],'message':_0x49b4('0x126')};}if(!this[_0x49b4('0x98')](_0x46d225['Trunk'])){ut[_0x49b4('0x5f')](_0x49b4('0x127'),'campaign\x20Name:\x20'+_0x46d225[_0x49b4('0x56')]+_0x49b4('0x128'));if(!this['isTrunkReachable'](_0x46d225[_0x49b4('0x129')])){ut['logger'](_0x49b4('0x127'),_0x46d225['name']+_0x49b4('0x12a'));return{'isValid':![],'message':_0x49b4('0x12b')};}}if(!ut[_0x49b4('0x12c')](_0x46d225[_0x49b4('0x97')])){ut[_0x49b4('0x5f')](_0x49b4('0x12d'),_0x46d225[_0x49b4('0x56')]+_0x49b4('0x12e'));return{'isValid':![],'message':_0x49b4('0x12f')+_0x46d225['name']+_0x49b4('0x12e')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype']['execCall']=function(_0x29fee3,_0x156104,_0xc8290e,_0x344bc6){var _0x1acecd=this;return new Promise(function(_0x2a9af6,_0x15fbe5){var _0x1617f9=_0x29fee3['uniqueid'];var _0x20dec1=_0x1acecd[_0x49b4('0x98')](_0x156104[_0x49b4('0x52')])?util[_0x49b4('0x5b')](_0x49b4('0x130'),_0x156104[_0x49b4('0x52')][_0x49b4('0x56')],_[_0x49b4('0x6d')](_0x156104['dialPrefix'])?'':_0x156104[_0x49b4('0x131')][_0x49b4('0x132')]()||'',_0x156104['dialCutDigit']>0x0?_0xc8290e['phone']['substring'](_0x156104['dialCutDigit']):_0xc8290e[_0x49b4('0x108')]):util[_0x49b4('0x5b')](_0x49b4('0x130'),_[_0x49b4('0x6d')](_0x156104['TrunkBackup'])?_0x156104[_0x49b4('0x52')]['name']:_0x156104[_0x49b4('0x129')][_0x49b4('0x56')],_['isNil'](_0x156104[_0x49b4('0x131')])?'':_0x156104['dialPrefix']['trim']()||'',_0x156104[_0x49b4('0x133')]>0x0?_0xc8290e[_0x49b4('0x108')][_0x49b4('0x134')](_0x156104[_0x49b4('0x133')]):_0xc8290e[_0x49b4('0x108')]);var _0xd4361b=_0x1acecd['isTrunkReachable'](_0x156104[_0x49b4('0x52')])?ut[_0x49b4('0x135')](_0x156104[_0x49b4('0x52')][_0x49b4('0x54')],_0x156104[_0x49b4('0x136')],_0x156104['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x49b4('0x137')](_0x156104['dialOriginateCallerIdNumber'],_0x156104['dialRandomLastDigitCallerIdNumber']):_0x156104[_0x49b4('0x138')]):ut[_0x49b4('0x135')](_[_0x49b4('0x6d')](_0x156104[_0x49b4('0x129')])?_0x156104[_0x49b4('0x52')]['callerid']:_0x156104[_0x49b4('0x129')][_0x49b4('0x54')],_0x156104['dialOriginateCallerIdName'],_0x156104[_0x49b4('0x139')]>0x0?ut[_0x49b4('0x137')](_0x156104[_0x49b4('0x138')],_0x156104['dialRandomLastDigitCallerIdNumber']):_0x156104[_0x49b4('0x138')]);if(_0xd4361b){_0x29fee3['originatecalleridname']=ut['extractCalleridName'](_0xd4361b);_0x29fee3[_0x49b4('0x13a')]=ut[_0x49b4('0x13b')](_0xd4361b);}var _0x58a00f=ut[_0x49b4('0x13c')](_0x156104,_0xc8290e,_0x20dec1,_0xd4361b,_0x1617f9,_0x29fee3);_[_0x49b4('0x13d')](_0x29fee3,ut['toLowerVariables'](_0x58a00f));_0x29fee3['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x156104[_0x49b4('0x13e')]=_0x58a00f;ami['Action'](ut[_0x49b4('0x13f')](_0x29fee3,_0x156104,_0x58a00f,_0x29fee3['activeContact'],_0x344bc6))[_0x49b4('0x81')](function(_0x11ae16){_0x156104[_0x49b4('0x4b')]+=0x1;logger[_0x49b4('0x59')]('[originated][increment]',_0x1617f9,_0x49b4('0xb4'),_0x156104[_0x49b4('0x56')],'originated:\x20',_0x156104[_0x49b4('0x4b')]);_0x2a9af6(_0x11ae16);})['catch'](function(_0x44768b){ut[_0x49b4('0xf8')](_0x29fee3,0xe,'OriginateError');rpcDb[_0x49b4('0xf9')](_0x29fee3,_0x49b4('0x140'));_0x15fbe5(_0x44768b);});});};Preview[_0x49b4('0xf')][_0x49b4('0x141')]=function(_0x3b0044){if(this['actions'][_0x3b0044[_0x49b4('0xbe')]]){this[_0x49b4('0x16')][_0x3b0044[_0x49b4('0xbe')]][_0x49b4('0x78')]=_0x3b0044[_0x49b4('0x78')];}};Preview[_0x49b4('0xf')][_0x49b4('0x1a')]=function(_0x34ae96){var _0x5e1f67=this;var _0x138e41=this['actions'][_0x34ae96[_0x49b4('0x142')]];if(_0x138e41){if(_0x138e41[_0x49b4('0x10b')]&&this[_0x49b4('0x17')][_0x138e41[_0x49b4('0x10b')]]){ut[_0x49b4('0x143')](_0x138e41,this[_0x49b4('0x17')][_0x138e41[_0x49b4('0x10b')]]['name'],this[_0x49b4('0x17')][_0x138e41['lookAgent']]['id']);}var _0x1adb67=_[_0x49b4('0x144')](_0x138e41);_0x1adb67['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x278940=_0x5e1f67[_0x49b4('0x13')][_0x138e41[_0x49b4('0x70')]];if(ut[_0x49b4('0x145')](_0x34ae96[_0x49b4('0x146')])){if(_0x138e41[_0x49b4('0xaa')]){rpcDb[_0x49b4('0x147')](_0x138e41[_0x49b4('0xad')]);}if(_0x138e41[_0x49b4('0xab')]){rpcDb['disableContact'](_0x138e41[_0x49b4('0xad')]);}ami[_0x49b4('0x27')](_0x49b4('0x148'),ut[_0x49b4('0x9f')](_0x138e41,'rejected',this[_0x49b4('0x13')][_0x138e41[_0x49b4('0x70')]]));this[_0x49b4('0xf4')](_0x1adb67,_0x278940,_0x34ae96);}else{_0x138e41['starttime']=moment()[_0x49b4('0x5b')](_0x49b4('0x8c'));ut[_0x49b4('0xf8')](_0x1adb67,0x4,_0x49b4('0x149'));rpcDb[_0x49b4('0xf9')](_0x1adb67,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x49b4('0xf')]['syncHangup']=function(_0x2bec5c){var _0x421e80=this[_0x49b4('0x16')][_0x2bec5c[_0x49b4('0xbe')]];var _0x21fee2;if(_0x421e80){_0x21fee2=this[_0x49b4('0x13')][_0x421e80['queue']];logger[_0x49b4('0x59')]('[syncHangup][talking]',_0x2bec5c[_0x49b4('0xbe')],_0x49b4('0xb4'),_0x21fee2['name'],_0x49b4('0xb5'),_0x21fee2[_0x49b4('0x2b')]);}if(this[_0x49b4('0x16')][_0x2bec5c[_0x49b4('0xbe')]]&&_0x2bec5c[_0x49b4('0xbe')]!==_0x2bec5c['uniqueid']){if(_0x2bec5c['cause']==='16'&&this[_0x49b4('0x16')][_0x2bec5c[_0x49b4('0xbe')]]['dialAnswer']){this[_0x49b4('0x9a')](_0x2bec5c,_0x2bec5c[_0x49b4('0xbe')],_0x2bec5c[_0x49b4('0x14a')]);}else if(this[_0x49b4('0x16')][_0x2bec5c[_0x49b4('0xbe')]][_0x49b4('0x72')]){logger[_0x49b4('0x59')](_0x49b4('0x14b'),_0x2bec5c[_0x49b4('0xbe')],_0x2bec5c['cause'],_0x49b4('0xb4'),_0x21fee2[_0x49b4('0x56')],_0x49b4('0xb5'),_0x21fee2[_0x49b4('0x2b')]);this[_0x49b4('0x9a')](_0x2bec5c,_0x2bec5c[_0x49b4('0xbe')],_0x2bec5c[_0x49b4('0x14a')]);}}else if(_0x421e80&&_[_0x49b4('0x6d')](_0x421e80[_0x49b4('0x14c')])&&_0x21fee2[_0x49b4('0x14d')]&&_0x2bec5c[_0x49b4('0xbe')]===_0x2bec5c[_0x49b4('0xb3')]&&_[_0x49b4('0x6d')](_0x2bec5c[_0x49b4('0xf7')])&&_0x2bec5c[_0x49b4('0x14a')]==='16'&&_0x2bec5c[_0x49b4('0x14e')]==='6'&&_[_0x49b4('0xf6')](_0x421e80[_0x49b4('0x14f')])){if(_0x421e80[_0x49b4('0xaa')]){rpcDb['unlockContact'](_0x421e80[_0x49b4('0xad')]);}if(_0x421e80[_0x49b4('0xab')]){rpcDb[_0x49b4('0x8a')](_0x421e80[_0x49b4('0xad')]);}_0x2bec5c[_0x49b4('0xf7')]='22';this['callProgressDetectingAgent'](_0x421e80,_0x21fee2,_0x2bec5c);}else if(_0x421e80&&_0x421e80['transfer']){if(_0x2bec5c[_0x49b4('0x14a')]==='16'&&this[_0x49b4('0x16')][_0x2bec5c[_0x49b4('0xbe')]][_0x49b4('0x72')]){logger[_0x49b4('0x59')](_0x49b4('0x150'),_0x2bec5c[_0x49b4('0xbe')],_0x2bec5c['cause'],'\x20Queue',_0x21fee2['name'],'pTalking:\x20',_0x21fee2[_0x49b4('0x2b')]);this[_0x49b4('0x9a')](_0x2bec5c,_0x2bec5c['linkedid'],_0x2bec5c['cause']);}else if(this[_0x49b4('0x16')][_0x2bec5c['linkedid']]['dialAnswer']){logger[_0x49b4('0x59')](_0x49b4('0x14b'),_0x2bec5c[_0x49b4('0xbe')],_0x2bec5c['cause'],_0x49b4('0xb4'),_0x21fee2[_0x49b4('0x56')],_0x49b4('0xb5'),_0x21fee2[_0x49b4('0x2b')]);this[_0x49b4('0x9a')](_0x2bec5c,_0x2bec5c[_0x49b4('0xbe')],_0x2bec5c['cause']);}}};Preview[_0x49b4('0xf')][_0x49b4('0x20')]=function(_0x25a4e9){if(this[_0x49b4('0x16')][_0x25a4e9['destlinkedid']]&&_0x25a4e9[_0x49b4('0xf3')]!==_0x25a4e9[_0x49b4('0x151')]){this['callProgressDetectingCustomer'](_0x25a4e9,_0x25a4e9['destlinkedid'],_0x25a4e9['dialstatus']);}};Preview[_0x49b4('0xf')][_0x49b4('0x1e')]=function(_0x1fc035){if(this[_0x49b4('0x16')][_0x1fc035[_0x49b4('0xbe')]]&&_0x1fc035[_0x49b4('0xbe')]!==_0x1fc035[_0x49b4('0xb3')]&&!this[_0x49b4('0x16')][_0x1fc035['linkedid']]['dialAnswer']){if(_0x1fc035[_0x49b4('0x14a')]==='1'){this[_0x49b4('0x9a')](_0x1fc035,_0x1fc035[_0x49b4('0xbe')],_0x1fc035[_0x49b4('0x14a')]);}}};Preview[_0x49b4('0xf')][_0x49b4('0x152')]=function(_0x6345de,_0x267f9d,_0x3a949d){if(this[_0x49b4('0x16')][_0x6345de]){if(_[_0x49b4('0x6d')](this[_0x49b4('0x16')][_0x6345de][_0x49b4('0x13e')])){this['actions'][_0x6345de]['variables']={};}this['actions'][_0x6345de][_0x49b4('0x13e')][_0x267f9d]=_0x3a949d;}};Preview['prototype'][_0x49b4('0x22')]=function(_0x2b8ce7){try{if(!_['isNil'](_0x2b8ce7)){if(ut[_0x49b4('0x153')](_[_0x49b4('0x154')](_0x2b8ce7[_0x49b4('0x155')])[0x0])){this[_0x49b4('0x152')](_0x2b8ce7[_0x49b4('0xb3')],_['keys'](_0x2b8ce7['variable'])[0x0],_0x2b8ce7[_0x49b4('0x156')]);}}}catch(_0x43341d){logger[_0x49b4('0x157')](_0x49b4('0x158'),util[_0x49b4('0x159')](_0x43341d,{'showHidden':![],'depth':null}));}};Preview[_0x49b4('0xf')]['syncAttendedTransfer']=function(_0x13202d){if(_0x13202d){if(this['actions'][_0x13202d[_0x49b4('0x15a')]]){this[_0x49b4('0x16')][_0x13202d['transfertargetlinkedid']][_0x49b4('0x14f')]=!![];}}};Preview[_0x49b4('0xf')]['syncBlindTransfer']=function(_0x59337d){if(_0x59337d){if(this[_0x49b4('0x16')][_0x59337d['transfererlinkedid']]){this[_0x49b4('0x16')][_0x59337d['transfererlinkedid']][_0x49b4('0x14f')]=!![];}}};module[_0x49b4('0x15b')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 635350c..5d49318 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 _0xf789=['checkIsBlackList','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer'];(function(_0x12dfaf,_0x390977){var _0x2a1e24=function(_0x23a69b){while(--_0x23a69b){_0x12dfaf['push'](_0x12dfaf['shift']());}};_0x2a1e24(++_0x390977);}(_0xf789,0x95));var _0x9f78=function(_0x5a00e2,_0x500992){_0x5a00e2=_0x5a00e2-0x0;var _0x1990cc=_0xf789[_0x5a00e2];return _0x1990cc;};'use strict';var util=require(_0x9f78('0x0'));var BPromise=require('bluebird');var logger=require(_0x9f78('0x1'))(_0x9f78('0x2'));var _=require(_0x9f78('0x3'));var cmHopper=require(_0x9f78('0x4'));var cmHopperFinal=require(_0x9f78('0x5'));var cmHopperHistory=require(_0x9f78('0x6'));var cmHopperBlack=require(_0x9f78('0x7'));var voiceQueueRt=require(_0x9f78('0x8'));var agentReportPreview=require(_0x9f78('0x9'));var voiceQueueReport=require(_0x9f78('0xa'));function loggerCatch(_0x2e9916){return function(_0x1980b5){logger[_0x9f78('0xb')](_0x2e9916,util[_0x9f78('0xc')](_0x1980b5,{'showHidden':![],'depth':null}));};}function create(_0x182896){return BPromise[_0x9f78('0xd')]()[_0x9f78('0xe')](cmHopperHistory[_0x9f78('0xf')](_0x182896))[_0x9f78('0x10')](loggerCatch(_0x9f78('0x11')));}function createAgent(_0x28d32f){return BPromise[_0x9f78('0xd')]()['then'](agentReportPreview[_0x9f78('0xf')](_0x28d32f))[_0x9f78('0x10')](loggerCatch(_0x9f78('0x11')));}function moveContact(_0x1b9f5b){return BPromise[_0x9f78('0xd')]()['then'](cmHopper[_0x9f78('0x12')](_0x1b9f5b,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x9f78('0x13')]=function(_0x119b71){return BPromise['resolve']()[_0x9f78('0xe')](cmHopperBlack['checkIsBlackList'](_0x119b71))[_0x9f78('0x10')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x234ad5){return BPromise[_0x9f78('0xd')]()[_0x9f78('0xe')](cmHopper['getContactPreview'](_0x234ad5))['catch'](loggerCatch(_0x9f78('0x14')));};exports['createHistory']=function(_0x224096,_0x5506db){create(_0x224096)['catch'](loggerCatch(_0x5506db));moveContact(_0x224096)[_0x9f78('0x10')](loggerCatch(_0x5506db));};exports[_0x9f78('0x15')]=function(_0x594bd8,_0x1b4a71){createAgent(_0x594bd8)[_0x9f78('0x10')](loggerCatch(_0x1b4a71));};exports['createCustomerHistory']=function(_0x578d02,_0x37f1bf){create(_0x578d02)[_0x9f78('0x10')](loggerCatch(_0x37f1bf));};exports[_0x9f78('0x16')]=function(_0x35efe4,_0x2dc42b){moveContact(_0x35efe4)['catch'](loggerCatch(_0x2dc42b));};exports[_0x9f78('0x17')]=function(_0x54f7b5,_0x18c3c7,_0xb81d95){if(_0x18c3c7){_0x54f7b5[_0x9f78('0x18')]=null;}if(_0xb81d95){_0x54f7b5[_0x9f78('0x19')]=![];}return BPromise[_0x9f78('0xd')]()['then'](cmHopper[_0x9f78('0x17')](_0x54f7b5))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x9f78('0x1a')]=function(_0x15683b){return BPromise['resolve']()[_0x9f78('0xe')](cmHopper[_0x9f78('0x1a')](_0x15683b))[_0x9f78('0x10')](loggerCatch('[countReScheduled]\x20'));};exports[_0x9f78('0x1b')]=function(_0x11022f){return BPromise[_0x9f78('0xd')]()[_0x9f78('0xe')](cmHopper[_0x9f78('0x1b')]({'UserId':null},_0x11022f,0x1))[_0x9f78('0x10')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x300ff0){return BPromise[_0x9f78('0xd')]()[_0x9f78('0xe')](cmHopper['unlockContact']({'active':![]},_0x300ff0,0x1))['catch'](loggerCatch(_0x9f78('0x1c')));};exports[_0x9f78('0x1d')]=function(_0x4b38c9){var _0x2032dc={};_0x2032dc['type']=_0x4b38c9[_0x9f78('0x1e')];_0x2032dc['uniqueid']=_0x4b38c9[_0x9f78('0x1f')];_0x2032dc[_0x9f78('0x20')]=_0x4b38c9['calleridnum'];_0x2032dc[_0x9f78('0x21')]=_0x4b38c9[_0x9f78('0x21')];_0x2032dc[_0x9f78('0x22')]=_0x4b38c9[_0x9f78('0x22')];_0x2032dc[_0x9f78('0x23')]=_0x4b38c9[_0x9f78('0x24')];_0x2032dc['queuecallerleaveAt']=_0x4b38c9[_0x9f78('0x24')];_0x2032dc[_0x9f78('0x25')]=0x1;_0x2032dc[_0x9f78('0x26')]=_0x4b38c9[_0x9f78('0x27')];_0x2032dc[_0x9f78('0x28')]=_0x4b38c9[_0x9f78('0x29')];_0x2032dc[_0x9f78('0x2a')]=_0x9f78('0x2b');_0x2032dc[_0x9f78('0x2c')]=_0x9f78('0x2d');_0x2032dc[_0x9f78('0x2e')]=0x0;_0x2032dc[_0x9f78('0x2f')]=0x1;_0x2032dc[_0x9f78('0x30')]=_0x4b38c9[_0x9f78('0x29')];_0x2032dc[_0x9f78('0x31')]=_0x9f78('0x32');return BPromise[_0x9f78('0xd')]()['then'](voiceQueueReport[_0x9f78('0x33')](_0x2032dc))[_0x9f78('0x10')](loggerCatch(_0x9f78('0x34')));};exports['getContactRecallMe']=function(_0x239189,_0x3fff37){return BPromise[_0x9f78('0xd')]()[_0x9f78('0xe')](cmHopper[_0x9f78('0x35')](_0x239189,_0x3fff37))[_0x9f78('0x10')](loggerCatch(_0x9f78('0x36')));};exports['rescheduleContactInQueue']=function(_0x3b19f3){return BPromise[_0x9f78('0xd')]()[_0x9f78('0xe')](cmHopper[_0x9f78('0x17')](_0x3b19f3,!![],!![]))['catch'](loggerCatch(_0x9f78('0x37')));}; \ No newline at end of file +var _0xbc5d=['../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash'];(function(_0x2ecd37,_0x4c1b3a){var _0x2c5c63=function(_0x3625a2){while(--_0x3625a2){_0x2ecd37['push'](_0x2ecd37['shift']());}};_0x2c5c63(++_0x4c1b3a);}(_0xbc5d,0x146));var _0xdbc5=function(_0x117677,_0xc892df){_0x117677=_0x117677-0x0;var _0x2584e6=_0xbc5d[_0x117677];return _0x2584e6;};'use strict';var util=require(_0xdbc5('0x0'));var BPromise=require(_0xdbc5('0x1'));var logger=require('../../../config/logger')(_0xdbc5('0x2'));var _=require(_0xdbc5('0x3'));var cmHopper=require(_0xdbc5('0x4'));var cmHopperFinal=require(_0xdbc5('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xdbc5('0x6'));var voiceQueueRt=require(_0xdbc5('0x7'));var agentReportPreview=require(_0xdbc5('0x8'));var voiceQueueReport=require(_0xdbc5('0x9'));function loggerCatch(_0x56db9f){return function(_0x14aa73){logger['error'](_0x56db9f,util['inspect'](_0x14aa73,{'showHidden':![],'depth':null}));};}function create(_0x36915f){return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopperHistory[_0xdbc5('0xc')](_0x36915f))[_0xdbc5('0xd')](loggerCatch(_0xdbc5('0xe')));}function createAgent(_0x237fc8){return BPromise[_0xdbc5('0xa')]()['then'](agentReportPreview[_0xdbc5('0xc')](_0x237fc8))[_0xdbc5('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2dd8ac){return BPromise[_0xdbc5('0xa')]()['then'](cmHopper[_0xdbc5('0xf')](_0x2dd8ac,!![]))['catch'](loggerCatch(_0xdbc5('0x10')));}exports[_0xdbc5('0x11')]=function(_0x4179ce){return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopperBlack['checkIsBlackList'](_0x4179ce))[_0xdbc5('0xd')](loggerCatch(_0xdbc5('0x12')));};exports['getContactPreview']=function(_0x518f3d){return BPromise[_0xdbc5('0xa')]()['then'](cmHopper['getContactPreview'](_0x518f3d))[_0xdbc5('0xd')](loggerCatch(_0xdbc5('0x13')));};exports[_0xdbc5('0xc')]=function(_0x4e170b,_0x1a2330){create(_0x4e170b)[_0xdbc5('0xd')](loggerCatch(_0x1a2330));moveContact(_0x4e170b)[_0xdbc5('0xd')](loggerCatch(_0x1a2330));};exports[_0xdbc5('0x14')]=function(_0x3cfdf8,_0x3890c7){createAgent(_0x3cfdf8)[_0xdbc5('0xd')](loggerCatch(_0x3890c7));};exports[_0xdbc5('0x15')]=function(_0x17225a,_0x82e88f){create(_0x17225a)[_0xdbc5('0xd')](loggerCatch(_0x82e88f));};exports['createCustomerFinal']=function(_0x470229,_0x449759){moveContact(_0x470229)['catch'](loggerCatch(_0x449759));};exports[_0xdbc5('0x16')]=function(_0x16216d,_0x175ab4,_0x5f15a2){if(_0x175ab4){_0x16216d[_0xdbc5('0x17')]=null;}if(_0x5f15a2){_0x16216d[_0xdbc5('0x18')]=![];}return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopper[_0xdbc5('0x16')](_0x16216d))[_0xdbc5('0xd')](loggerCatch(_0xdbc5('0x19')));};exports[_0xdbc5('0x1a')]=function(_0x339c8c){return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopper[_0xdbc5('0x1a')](_0x339c8c))[_0xdbc5('0xd')](loggerCatch(_0xdbc5('0x1b')));};exports[_0xdbc5('0x1c')]=function(_0x30db6f){return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopper[_0xdbc5('0x1c')]({'UserId':null},_0x30db6f,0x1))['catch'](loggerCatch(_0xdbc5('0x1d')));};exports[_0xdbc5('0x1e')]=function(_0x1088e7){return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopper['unlockContact']({'active':![]},_0x1088e7,0x1))[_0xdbc5('0xd')](loggerCatch(_0xdbc5('0x1f')));};exports[_0xdbc5('0x20')]=function(_0x3aa0df){var _0x1b5bfa={};_0x1b5bfa['type']=_0x3aa0df[_0xdbc5('0x21')];_0x1b5bfa[_0xdbc5('0x22')]=_0x3aa0df[_0xdbc5('0x22')];_0x1b5bfa[_0xdbc5('0x23')]=_0x3aa0df[_0xdbc5('0x23')];_0x1b5bfa[_0xdbc5('0x24')]=_0x3aa0df[_0xdbc5('0x24')];_0x1b5bfa[_0xdbc5('0x25')]=_0x3aa0df[_0xdbc5('0x25')];_0x1b5bfa[_0xdbc5('0x26')]=_0x3aa0df['answertime'];_0x1b5bfa['queuecallerleaveAt']=_0x3aa0df[_0xdbc5('0x27')];_0x1b5bfa[_0xdbc5('0x28')]=0x1;_0x1b5bfa['queuecallercompleteAt']=_0x3aa0df[_0xdbc5('0x29')];_0x1b5bfa[_0xdbc5('0x2a')]=_0x3aa0df[_0xdbc5('0x2b')];_0x1b5bfa[_0xdbc5('0x2c')]='from-sip';_0x1b5bfa[_0xdbc5('0x2d')]='xcally-motion-preview';_0x1b5bfa[_0xdbc5('0x2e')]=0x0;_0x1b5bfa[_0xdbc5('0x2f')]=0x1;_0x1b5bfa[_0xdbc5('0x30')]=_0x3aa0df[_0xdbc5('0x2b')];_0x1b5bfa[_0xdbc5('0x31')]=_0xdbc5('0x32');return BPromise['resolve']()[_0xdbc5('0xb')](voiceQueueReport[_0xdbc5('0x33')](_0x1b5bfa))[_0xdbc5('0xd')](loggerCatch(_0xdbc5('0x34')));};exports['getContactRecallMe']=function(_0x15307c,_0x1b1655){return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopper[_0xdbc5('0x35')](_0x15307c,_0x1b1655))[_0xdbc5('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x1ff3b5){return BPromise[_0xdbc5('0xa')]()[_0xdbc5('0xb')](cmHopper['rescheduleContact'](_0x1ff3b5,!![],!![]))['catch'](loggerCatch(_0xdbc5('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 77ee278..3b9a349 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 _0xde30=['isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','responsetime','endtime','logAgent','state','logLookAgent','UserId','logCustomer','ringtime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','not_inuse','status','reachable','push','getDiff','diff','createBody','ContactId','CampaignId','filterKey','idContact','type','dialAnswer','membername','active','countcongestionretry','countglobal','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId'];(function(_0x3d004a,_0x11e3c0){var _0x6d8d5d=function(_0x366c70){while(--_0x366c70){_0x3d004a['push'](_0x3d004a['shift']());}};_0x6d8d5d(++_0x11e3c0);}(_0xde30,0x82));var _0x0de3=function(_0x43c7e0,_0x5b1635){_0x43c7e0=_0x43c7e0-0x0;var _0x38f669=_0xde30[_0x43c7e0];return _0x38f669;};'use strict';var util=require('util');var _=require(_0x0de3('0x0'));var moment=require(_0x0de3('0x1'));var logger=require(_0x0de3('0x2'))(_0x0de3('0x3'));var ipAgi=process[_0x0de3('0x4')][_0x0de3('0x5')]||'127.0.0.1';function getSeconds(_0x8c3e05,_0x1efeaf){var _0x39b211=moment(_0x8c3e05)[_0x0de3('0x6')](0x0);var _0x5e3ab3=moment(_0x1efeaf)['milliseconds'](0x0);return _0x39b211['diff'](_0x5e3ab3,'seconds');}exports[_0x0de3('0x7')]=function(_0x3b0b77){return function(_0xd0ece4){logger[_0x0de3('0x8')](_0x3b0b77,util[_0x0de3('0x9')](_0xd0ece4,{'showHidden':![],'depth':null}));};};exports[_0x0de3('0xa')]=function(_0x48405a,_0x5bd3dd){logger[_0x0de3('0xb')](_0x48405a,util[_0x0de3('0x9')](_0x5bd3dd,{'showHidden':![],'depth':null}));};exports[_0x0de3('0xc')]=function(_0x1035b8,_0x3bb92a){logger[_0x0de3('0x8')](_0x1035b8,util[_0x0de3('0x9')](_0x3bb92a,{'showHidden':![],'depth':null}));};exports[_0x0de3('0xd')]=function(_0x269c65){return function(_0x3b79f8){logger['info'](_0x269c65,util[_0x0de3('0x9')](_0x3b79f8,{'showHidden':![],'depth':null}));};};exports[_0x0de3('0xe')]=function(_0x5cdc7f,_0x128771,_0x4ffec4){return{'message':_0x5cdc7f,'unlock':_0x128771,'active':_0x4ffec4};};exports[_0x0de3('0xf')]=function(_0x4d2461,_0x40ab40,_0xc35078){if(!_[_0x0de3('0x10')](_0xc35078)&&_0x0de3('0x11')===typeof _0xc35078&&!_['isEmpty'](_0xc35078)){if(!_[_0x0de3('0x10')](_0x40ab40)&&_0x0de3('0x11')===typeof _0x40ab40&&!_[_0x0de3('0x12')](_0x40ab40)){return util['format'](_0x0de3('0x13'),_0x40ab40,_0xc35078);}return util[_0x0de3('0x14')](_0x0de3('0x13'),_0xc35078,_0xc35078);}if(!_[_0x0de3('0x10')](_0x4d2461)&&'string'===typeof _0x4d2461&&!_[_0x0de3('0x12')](_0x4d2461)){return _0x4d2461;}return _0x0de3('0x15');};exports[_0x0de3('0x16')]=function(_0xf7eda7){if(_[_0x0de3('0x17')](_0xf7eda7)){return![];}return _0xf7eda7;};exports['addVariables']=function(_0xdbec39,_0x2f5b63,_0x635934,_0x440bcd,_0x37931f,_0x7cc2e3){var _0x118b71={'XMD-QUEUE':_0x2f5b63[_0x0de3('0x18')]?_0x2f5b63[_0x0de3('0x18')][_0x0de3('0x19')]:'','XMD-CALLERID':_0x440bcd,'XMD-CALLERID-PREVIEW':_0x7cc2e3?util[_0x0de3('0x14')](_0x0de3('0x13'),_0x7cc2e3[_0x0de3('0x1a')],_0x7cc2e3[_0x0de3('0x1b')]):_0x440bcd,'XMD-DIALID':_0x37931f,'XMD-CONTACTID':_0x2f5b63['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x440bcd,'XMD-VOICEQUEUEID':_0x2f5b63[_0x0de3('0x1c')],'XMD-DIALCHANNEL':_0x635934,'XMD-DIALTIMEOUT':_0xdbec39['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x0de3('0x14')](_0x0de3('0x1d'),_0xdbec39[_0x0de3('0x1e')]?'g':'',_['isEmpty'](_0xdbec39[_0x0de3('0x1f')])?'':_0x0de3('0x20')),'XMD-DIALURL':_0xdbec39[_0x0de3('0x21')]||'','XMD-AGI':_0xdbec39[_0x0de3('0x22')]?util[_0x0de3('0x14')](_0x0de3('0x23'),ipAgi,_0xdbec39[_0x0de3('0x22')]):_0x0de3('0x24'),'XMD-AGIAFTER':_0xdbec39[_0x0de3('0x1e')]?util[_0x0de3('0x14')](_0x0de3('0x23'),ipAgi,_0xdbec39[_0x0de3('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x7cc2e3?_0x7cc2e3[_0x0de3('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x7cc2e3?_0x7cc2e3[_0x0de3('0x26')]:'','XMD-DESTINATION':_0x0de3('0x27'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x0de3('0x12')](_0xdbec39[_0x0de3('0x1f')])){_0x118b71[util[_0x0de3('0x14')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xdbec39[_0x0de3('0x1f')];_0x118b71[util[_0x0de3('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x37931f;}if(_0x2f5b63&&_0x2f5b63[_0x0de3('0x28')]){for(var _0xb26494 in _0x2f5b63[_0x0de3('0x28')]){if(_0x2f5b63[_0x0de3('0x28')][_0x0de3('0x29')](_0xb26494)){if(!_['isNil'](_0x2f5b63[_0x0de3('0x28')][_0xb26494])&&_0xb26494!=='id'&&_0xb26494!==_0x0de3('0x2a')&&_0xb26494!==_0x0de3('0x2b')&&_0xb26494!==_0x0de3('0x2c')){_0x118b71[util[_0x0de3('0x14')](_0x0de3('0x2d'),'XMD-',_[_0x0de3('0x2e')](_0xb26494))]=_0x2f5b63['Contact'][_0xb26494];}}}}return _0x118b71;};exports[_0x0de3('0x2f')]=function(_0x3e5625){var _0x3eb9a8={};for(var _0x51e82b in _0x3e5625){if(_0x3e5625[_0x0de3('0x29')](_0x51e82b)){_0x3eb9a8[util[_0x0de3('0x14')]('%s',_[_0x0de3('0x30')](_0x51e82b))]=_0x3e5625[_0x51e82b];}}return{'variables':_0x3eb9a8};};exports[_0x0de3('0x31')]=function(_0x2ba656,_0x31de42){if(!_[_0x0de3('0x17')](_0x2ba656)){if(_0x2ba656[_0x0de3('0x29')](_0x0de3('0x32'))){if(_0x2ba656['originated']>0x0){_0x2ba656[_0x0de3('0x32')]-=0x1;}else{logger['error'](_0x0de3('0x33'),_0x31de42);}}}else{logger[_0x0de3('0x8')](_0x0de3('0x34'),_0x31de42);}};exports[_0x0de3('0x35')]=function(_0x3c3265){var _0x2b1eb3=moment()[_0x0de3('0x14')](_0x0de3('0x36'));_0x3c3265['state']=0xd;_0x3c3265[_0x0de3('0x37')]='Blacklist';_0x3c3265[_0x0de3('0x38')]=_0x2b1eb3;_0x3c3265[_0x0de3('0x39')]=_0x2b1eb3;_0x3c3265[_0x0de3('0x3a')]=_0x2b1eb3;};exports[_0x0de3('0x3b')]=function(_0x35e458,_0x27065c,_0x290428){var _0x29f979=moment()[_0x0de3('0x14')](_0x0de3('0x36'));_0x35e458[_0x0de3('0x3c')]=_0x27065c;_0x35e458['statedesc']=_0x290428;_0x35e458[_0x0de3('0x39')]=_0x29f979;_0x35e458['ringtime']=getSeconds(_0x35e458[_0x0de3('0x39')],_0x35e458['starttime']);};exports[_0x0de3('0x3d')]=function(_0x447003,_0x569052,_0x590600){_0x447003['membername']=_0x569052;_0x447003[_0x0de3('0x3e')]=_0x590600;};exports[_0x0de3('0x3f')]=function(_0x158a28,_0x39b40d,_0x405289){var _0x3ee810=moment()[_0x0de3('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x158a28['state']=_0x39b40d;_0x158a28[_0x0de3('0x37')]=_0x405289;_0x158a28[_0x0de3('0x39')]=_0x158a28['responsetime']?_0x158a28['responsetime']:_0x3ee810;_0x158a28[_0x0de3('0x3a')]=_0x158a28[_0x0de3('0x3a')]?_0x158a28['endtime']:_0x3ee810;_0x158a28[_0x0de3('0x40')]=getSeconds(_0x158a28[_0x0de3('0x39')]||0x0,_0x158a28[_0x0de3('0x38')]||0x0);_0x158a28[_0x0de3('0x41')]=_0x158a28[_0x0de3('0x42')]?getSeconds(_0x158a28[_0x0de3('0x3a')],_0x158a28[_0x0de3('0x42')]):0x0;};exports[_0x0de3('0x43')]=function(_0x4123f0){return _0x4123f0==='Failure';};exports[_0x0de3('0x44')]=function(_0x57690c,_0x431d05,_0x43a129,_0x3b5754,_0x38dd3a){var _0x151122=_0x3b5754?_0x0de3('0x45'):_0x57690c['calleridname'];_0x151122=_0x38dd3a?_0x0de3('0x46'):_0x151122;return{'actionid':_0x57690c[_0x0de3('0x47')],'action':'originate','channel':_0x57690c[_0x0de3('0x48')],'callerid':util['format'](_0x0de3('0x13'),_0x151122,_0x57690c[_0x0de3('0x1b')]),'Exten':_0x0de3('0x27'),'Context':_0x0de3('0x49'),'Priority':'1','variable':_0x43a129,'timeout':(_0x431d05[_0x0de3('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x57690c[_0x0de3('0x47')]};};exports[_0x0de3('0x4b')]=function(_0x54a775){return _0x54a775[_0x0de3('0x4c')]+_0x54a775['countcongestionretry']+_0x54a775[_0x0de3('0x4d')]+_0x54a775[_0x0de3('0x4e')]+_0x54a775[_0x0de3('0x4f')];};exports['cloneAction']=function(_0x546d21){var _0x5cec21=_[_0x0de3('0x50')](_0x546d21);_0x5cec21[_0x0de3('0x3c')]=0xf;_0x5cec21[_0x0de3('0x37')]=_0x0de3('0x51');return _0x5cec21;};exports[_0x0de3('0x52')]=function(_0x55e89c,_0x5d1ff9,_0x2f9edf){var _0x49df0b={};_0x49df0b[_0x5d1ff9]=_0x55e89c[_0x5d1ff9];_0x49df0b['active']=![];_0x49df0b[_0x0de3('0x53')]=moment()['add'](_0x2f9edf,_0x0de3('0x54'))[_0x0de3('0x14')](_0x0de3('0x36'));_0x49df0b['ContactId']=_0x55e89c['ContactId'];_0x49df0b[_0x0de3('0x55')]=_0x55e89c[_0x0de3('0x55')];_0x49df0b[_0x0de3('0x1c')]=_0x55e89c[_0x0de3('0x1c')]||undefined;return _0x49df0b;};exports[_0x0de3('0x56')]=function(_0x2e814a,_0x2dd56e){if(!_[_0x0de3('0x17')](_0x2e814a)){if(_0x2e814a[_0x0de3('0x57')]>0x0){_0x2e814a['pTalking']-=0x1;}else{logger['error'](_0x2dd56e,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x0de3('0x8')](_0x2dd56e,_0x0de3('0x58'));}};exports['IsNotLoggedIn']=function(_0x16ee00){if(_0x16ee00<=0x0){return!![];}return![];};function buildObj(_0x1cb308,_0x26b13c,_0x16fe45){_0x1cb308[_0x0de3('0x59')]=_0x26b13c;_0x1cb308[_0x0de3('0x19')]=_0x1cb308[_0x0de3('0x5a')];_0x1cb308[_0x0de3('0x5b')]=_0x1cb308[_0x0de3('0x48')];_0x1cb308[_0x0de3('0x5c')]=_0x0de3('0x5d');if(_0x16fe45){_0x1cb308['mandatoryDisposition']=_0x16fe45[_0x0de3('0x5e')];}return _0x1cb308;}exports[_0x0de3('0x5f')]=buildObj;exports[_0x0de3('0x60')]=function(_0xcec093){var _0x438efb={};_0x438efb[_0x0de3('0x5a')]=_0xcec093['queue'];_0x438efb[_0x0de3('0x5b')]=_0xcec093[_0x0de3('0x48')];_0x438efb[_0x0de3('0x47')]=_0xcec093[_0x0de3('0x47')];return _0x438efb;};exports['agentReadyId']=function(_0x7eb1b8){var _0x2e990f=[];for(var _0xe5c067 in _0x7eb1b8){if(_0x7eb1b8[_0x0de3('0x29')](_0xe5c067)){if(!_[_0x0de3('0x17')](_0x7eb1b8[_0xe5c067])&&_0x7eb1b8[_0xe5c067][_0x0de3('0x3c')]===_0x0de3('0x61')&&_0x7eb1b8[_0xe5c067][_0x0de3('0x62')]===_0x0de3('0x63')){_0x2e990f[_0x0de3('0x64')](_0x7eb1b8[_0xe5c067]['id']);}}}return _0x2e990f;};exports[_0x0de3('0x65')]=function(_0xa4943a){var _0x2d4b46=moment()[_0x0de3('0x6')](0x0);var _0x42c760=moment(_0xa4943a)[_0x0de3('0x6')](0x0);return _0x2d4b46[_0x0de3('0x66')](_0x42c760,'seconds');};exports[_0x0de3('0x67')]=function(_0x4d247f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d247f[_0x0de3('0x68')],'ListId':_0x4d247f[_0x0de3('0x55')],'VoiceQueueId':_0x4d247f[_0x0de3('0x1c')]||undefined,'CampaignId':_0x4d247f[_0x0de3('0x69')]||undefined};};exports[_0x0de3('0x6a')]=function(_0x26da11){if(_0x26da11===_0x0de3('0x47')||_0x26da11===_0x0de3('0x6b')||_0x26da11==='queue'||_0x26da11===_0x0de3('0x6c')||_0x26da11==='campaigntype'||_0x26da11===_0x0de3('0x6d')||_0x26da11===_0x0de3('0x6e')||_0x26da11===_0x0de3('0x48')||_0x26da11==='calleridname'||_0x26da11===_0x0de3('0x6f')||_0x26da11===_0x0de3('0x1b')||_0x26da11==='scheduledat'||_0x26da11===_0x0de3('0x4c')||_0x26da11===_0x0de3('0x70')||_0x26da11===_0x0de3('0x4d')||_0x26da11===_0x0de3('0x71')||_0x26da11==='callback'||_0x26da11===_0x0de3('0x72')||_0x26da11==='callbackat'||_0x26da11===_0x0de3('0x73')||_0x26da11===_0x0de3('0x68')||_0x26da11==='ListId'||_0x26da11===_0x0de3('0x3e')||_0x26da11==='VoiceQueueId'||_0x26da11===_0x0de3('0x74')||_0x26da11==='xmd-voicequeueid'||_0x26da11===_0x0de3('0x75')||_0x26da11===_0x0de3('0x76')||_0x26da11===_0x0de3('0x77')||_0x26da11===_0x0de3('0x78')||_0x26da11===_0x0de3('0x79')||_0x26da11===_0x0de3('0x7a')||_0x26da11===_0x0de3('0x7b')||_0x26da11==='xmd-dialchannel'||_0x26da11===_0x0de3('0x7c')||_0x26da11===_0x0de3('0x7d')||_0x26da11===_0x0de3('0x7e')||_0x26da11==='xmd-agiafter'||_0x26da11===_0x0de3('0x7f')||_0x26da11===_0x0de3('0x80')||_0x26da11==='rtpaudioqosbridged'||_0x26da11==='rtpaudioqosjitter'||_0x26da11===_0x0de3('0x81')||_0x26da11===_0x0de3('0x82')||_0x26da11==='rtpaudioqoslossbridged'||_0x26da11===_0x0de3('0x83')||_0x26da11===_0x0de3('0x84')||_0x26da11===_0x0de3('0x80')||_0x26da11==='rtpaudioqosbridged'||_0x26da11===_0x0de3('0x85')||_0x26da11===_0x0de3('0x81')||_0x26da11==='rtpaudioqosloss'||_0x26da11==='rtpaudioqoslossbridged'||_0x26da11===_0x0de3('0x83')||_0x26da11===_0x0de3('0x84')||_0x26da11===_0x0de3('0x86')||_0x26da11===_0x0de3('0x87')||_0x26da11===_0x0de3('0x3c')||_0x26da11===_0x0de3('0x37')){return![];}return!![];};exports[_0x0de3('0x88')]=function(_0x3a2342,_0x34e337){var _0x18c501,_0x383c2c,_0x3cc2bb;if(_0x34e337<=0x0){_0x34e337=0x1;}_0x18c501=new RegExp('\x5cw{0,'+_0x34e337+'}$');_0x383c2c=Math[_0x0de3('0x89')](0xa,_0x34e337-0x1);_0x3cc2bb=Math['pow'](0xa,_0x34e337)-0x1;return util[_0x0de3('0x14')]('%s',_[_0x0de3('0x8a')](_0x3a2342,_0x18c501,_['random'](_0x383c2c,_0x3cc2bb)));};exports[_0x0de3('0x8b')]=function(_0x13342f){var _0x5b94da=_0x13342f[_0x0de3('0x8c')](/"(.*?)"/);return _0x5b94da?_0x5b94da[0x1]:_0x13342f;};exports[_0x0de3('0x8d')]=function(_0x220b12){var _0xc61a3b=_0x220b12[_0x0de3('0x8c')](/<(.*?)>/);return _0xc61a3b?_0xc61a3b[0x1]:_0x220b12;};function buildNoAnswerEventPayload(_0x1f3512,_0x29f471){var _0x37d9a0=buildObj(_0x1f3512,'noanswer');if(!_['isEmpty'](_0x29f471[_0x0de3('0x8e')])){Object[_0x0de3('0x8f')](_0x29f471[_0x0de3('0x8e')])[_0x0de3('0x90')](function(_0x149d2){_0x37d9a0[_0x149d2['toLowerCase']()]=_0x29f471[_0x0de3('0x8e')][_0x149d2];});}return _0x37d9a0;}exports[_0x0de3('0x91')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x92e1=['forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','responsetime','endtime','statedesc','ringtime','starttime','membername','talktime','answertime','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','countglobal','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosrttbridged','bridgepvtcallid','pow','replace','random','extractCalleridName','extractCalleridNumber','noanswer','variables'];(function(_0x575f10,_0x2da96a){var _0x1aa2fb=function(_0x420d93){while(--_0x420d93){_0x575f10['push'](_0x575f10['shift']());}};_0x1aa2fb(++_0x2da96a);}(_0x92e1,0x1c8));var _0x192e=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x92e1[_0x1abb09];return _0xea1c07;};'use strict';var util=require(_0x192e('0x0'));var _=require(_0x192e('0x1'));var moment=require(_0x192e('0x2'));var logger=require(_0x192e('0x3'))(_0x192e('0x4'));var ipAgi=process[_0x192e('0x5')][_0x192e('0x6')]||_0x192e('0x7');function getSeconds(_0x2b2fa1,_0x263e6e){var _0x351aab=moment(_0x2b2fa1)[_0x192e('0x8')](0x0);var _0x10efd1=moment(_0x263e6e)[_0x192e('0x8')](0x0);return _0x351aab[_0x192e('0x9')](_0x10efd1,_0x192e('0xa'));}exports[_0x192e('0xb')]=function(_0x4cdcb7){return function(_0x99bf41){logger[_0x192e('0xc')](_0x4cdcb7,util[_0x192e('0xd')](_0x99bf41,{'showHidden':![],'depth':null}));};};exports[_0x192e('0xe')]=function(_0x5ee574,_0x4a44a1){logger[_0x192e('0xf')](_0x5ee574,util[_0x192e('0xd')](_0x4a44a1,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x21d125,_0x30a7df){logger[_0x192e('0xc')](_0x21d125,util[_0x192e('0xd')](_0x30a7df,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x59fa48){return function(_0x53330d){logger[_0x192e('0xf')](_0x59fa48,util['inspect'](_0x53330d,{'showHidden':![],'depth':null}));};};exports[_0x192e('0x10')]=function(_0x1704ac,_0x167fca,_0x26ef3e){return{'message':_0x1704ac,'unlock':_0x167fca,'active':_0x26ef3e};};exports[_0x192e('0x11')]=function(_0x1308bf,_0x4c5fdd,_0x3824f1){if(!_[_0x192e('0x12')](_0x3824f1)&&_0x192e('0x13')===typeof _0x3824f1&&!_[_0x192e('0x14')](_0x3824f1)){if(!_[_0x192e('0x12')](_0x4c5fdd)&&_0x192e('0x13')===typeof _0x4c5fdd&&!_['isEmpty'](_0x4c5fdd)){return util[_0x192e('0x15')](_0x192e('0x16'),_0x4c5fdd,_0x3824f1);}return util[_0x192e('0x15')](_0x192e('0x16'),_0x3824f1,_0x3824f1);}if(!_['isUndefined'](_0x1308bf)&&_0x192e('0x13')===typeof _0x1308bf&&!_[_0x192e('0x14')](_0x1308bf)){return _0x1308bf;}return'\x22\x22\x20<>';};exports[_0x192e('0x17')]=function(_0x4977b){if(_[_0x192e('0x18')](_0x4977b)){return![];}return _0x4977b;};exports[_0x192e('0x19')]=function(_0x4436ce,_0x24abcf,_0x5362e0,_0x47bf95,_0x5e7092,_0x5c2b8b){var _0x9480d1={'XMD-QUEUE':_0x24abcf[_0x192e('0x1a')]?_0x24abcf[_0x192e('0x1a')][_0x192e('0x1b')]:'','XMD-CALLERID':_0x47bf95,'XMD-CALLERID-PREVIEW':_0x5c2b8b?util[_0x192e('0x15')](_0x192e('0x16'),_0x5c2b8b['calleridname'],_0x5c2b8b[_0x192e('0x1c')]):_0x47bf95,'XMD-DIALID':_0x5e7092,'XMD-CONTACTID':_0x24abcf[_0x192e('0x1d')],'XMD-CDRTYPE':_0x192e('0x1e'),'CALLERID(all)':_0x47bf95,'XMD-VOICEQUEUEID':_0x24abcf[_0x192e('0x1f')],'XMD-DIALCHANNEL':_0x5362e0,'XMD-DIALTIMEOUT':_0x4436ce[_0x192e('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x192e('0x15')](_0x192e('0x21'),_0x4436ce[_0x192e('0x22')]?'g':'',_[_0x192e('0x14')](_0x4436ce[_0x192e('0x23')])?'':_0x192e('0x24')),'XMD-DIALURL':_0x4436ce[_0x192e('0x25')]||'','XMD-AGI':_0x4436ce[_0x192e('0x26')]?util[_0x192e('0x15')](_0x192e('0x27'),ipAgi,_0x4436ce[_0x192e('0x26')]):'NONE','XMD-AGIAFTER':_0x4436ce[_0x192e('0x22')]?util[_0x192e('0x15')](_0x192e('0x27'),ipAgi,_0x4436ce[_0x192e('0x22')]):_0x192e('0x28'),'XMD-ORIGINATECALLERIDNUM':_0x5c2b8b?_0x5c2b8b[_0x192e('0x29')]:'','XMD-ORIGINATECALLERIDNAME':_0x5c2b8b?_0x5c2b8b[_0x192e('0x2a')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x192e('0x14')](_0x4436ce[_0x192e('0x23')])){_0x9480d1[util[_0x192e('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4436ce[_0x192e('0x23')];_0x9480d1[util['format']('%s',_0x192e('0x2b'))]=_0x5e7092;}if(_0x24abcf&&_0x24abcf[_0x192e('0x2c')]){for(var _0x14388d in _0x24abcf[_0x192e('0x2c')]){if(_0x24abcf[_0x192e('0x2c')][_0x192e('0x2d')](_0x14388d)){if(!_[_0x192e('0x18')](_0x24abcf[_0x192e('0x2c')][_0x14388d])&&_0x14388d!=='id'&&_0x14388d!==_0x192e('0x2e')&&_0x14388d!==_0x192e('0x2f')&&_0x14388d!==_0x192e('0x30')){_0x9480d1[util[_0x192e('0x15')](_0x192e('0x31'),_0x192e('0x32'),_[_0x192e('0x33')](_0x14388d))]=_0x24abcf[_0x192e('0x2c')][_0x14388d];}}}}return _0x9480d1;};exports[_0x192e('0x34')]=function(_0xbb4103){var _0x47d7a3={};for(var _0x4b9b8e in _0xbb4103){if(_0xbb4103[_0x192e('0x2d')](_0x4b9b8e)){_0x47d7a3[util[_0x192e('0x15')]('%s',_[_0x192e('0x35')](_0x4b9b8e))]=_0xbb4103[_0x4b9b8e];}}return{'variables':_0x47d7a3};};exports[_0x192e('0x36')]=function(_0x2b3b34,_0x5335e8){if(!_[_0x192e('0x18')](_0x2b3b34)){if(_0x2b3b34[_0x192e('0x2d')]('originated')){if(_0x2b3b34[_0x192e('0x37')]>0x0){_0x2b3b34[_0x192e('0x37')]-=0x1;}else{logger[_0x192e('0xc')](_0x192e('0x38'),_0x5335e8);}}}else{logger['error'](_0x192e('0x39'),_0x5335e8);}};exports[_0x192e('0x3a')]=function(_0x41a236){var _0x61f1da=moment()[_0x192e('0x15')](_0x192e('0x3b'));_0x41a236[_0x192e('0x3c')]=0xd;_0x41a236['statedesc']=_0x192e('0x3d');_0x41a236['starttime']=_0x61f1da;_0x41a236[_0x192e('0x3e')]=_0x61f1da;_0x41a236[_0x192e('0x3f')]=_0x61f1da;};exports['logAgent']=function(_0xcedcb8,_0x53c5dd,_0x20cbf8){var _0x19e31c=moment()[_0x192e('0x15')](_0x192e('0x3b'));_0xcedcb8[_0x192e('0x3c')]=_0x53c5dd;_0xcedcb8[_0x192e('0x40')]=_0x20cbf8;_0xcedcb8[_0x192e('0x3e')]=_0x19e31c;_0xcedcb8[_0x192e('0x41')]=getSeconds(_0xcedcb8[_0x192e('0x3e')],_0xcedcb8[_0x192e('0x42')]);};exports['logLookAgent']=function(_0x59881b,_0x22602a,_0x110a93){_0x59881b[_0x192e('0x43')]=_0x22602a;_0x59881b['UserId']=_0x110a93;};exports['logCustomer']=function(_0x11e4e2,_0x4c92c4,_0x35d34f){var _0x1add7c=moment()[_0x192e('0x15')](_0x192e('0x3b'));_0x11e4e2[_0x192e('0x3c')]=_0x4c92c4;_0x11e4e2[_0x192e('0x40')]=_0x35d34f;_0x11e4e2[_0x192e('0x3e')]=_0x11e4e2[_0x192e('0x3e')]?_0x11e4e2[_0x192e('0x3e')]:_0x1add7c;_0x11e4e2[_0x192e('0x3f')]=_0x11e4e2['endtime']?_0x11e4e2[_0x192e('0x3f')]:_0x1add7c;_0x11e4e2[_0x192e('0x41')]=getSeconds(_0x11e4e2[_0x192e('0x3e')]||0x0,_0x11e4e2['starttime']||0x0);_0x11e4e2[_0x192e('0x44')]=_0x11e4e2['answertime']?getSeconds(_0x11e4e2[_0x192e('0x3f')],_0x11e4e2[_0x192e('0x45')]):0x0;};exports['isFailure']=function(_0x708884){return _0x708884==='Failure';};exports[_0x192e('0x46')]=function(_0x120e5d,_0xef1050,_0x22d869,_0x319d56,_0x3c8f36){var _0x4d04b2=_0x319d56?_0x192e('0x47'):_0x120e5d[_0x192e('0x48')];_0x4d04b2=_0x3c8f36?_0x192e('0x49'):_0x4d04b2;return{'actionid':_0x120e5d[_0x192e('0x4a')],'action':_0x192e('0x4b'),'channel':_0x120e5d[_0x192e('0x4c')],'callerid':util[_0x192e('0x15')](_0x192e('0x16'),_0x4d04b2,_0x120e5d[_0x192e('0x1c')]),'Exten':_0x192e('0x4d'),'Context':_0x192e('0x4e'),'Priority':'1','variable':_0x22d869,'timeout':(_0xef1050[_0x192e('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x120e5d['uniqueid']};};exports[_0x192e('0x50')]=function(_0x4ef64d){return _0x4ef64d[_0x192e('0x51')]+_0x4ef64d[_0x192e('0x52')]+_0x4ef64d[_0x192e('0x53')]+_0x4ef64d[_0x192e('0x54')]+_0x4ef64d[_0x192e('0x55')];};exports[_0x192e('0x56')]=function(_0x1533c9){var _0x24c1d4=_[_0x192e('0x57')](_0x1533c9);_0x24c1d4[_0x192e('0x3c')]=0xf;_0x24c1d4[_0x192e('0x40')]=_0x192e('0x58');return _0x24c1d4;};exports['scheduledAt']=function(_0xd088b9,_0x2c0b52,_0x35f71b){var _0x5c9b29={};_0x5c9b29[_0x2c0b52]=_0xd088b9[_0x2c0b52];_0x5c9b29[_0x192e('0x59')]=![];_0x5c9b29[_0x192e('0x5a')]=moment()['add'](_0x35f71b,_0x192e('0x5b'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5c9b29[_0x192e('0x1d')]=_0xd088b9[_0x192e('0x1d')];_0x5c9b29[_0x192e('0x5c')]=_0xd088b9[_0x192e('0x5c')];_0x5c9b29[_0x192e('0x1f')]=_0xd088b9[_0x192e('0x1f')]||undefined;return _0x5c9b29;};exports[_0x192e('0x5d')]=function(_0x4a9883,_0x46ef4c){if(!_['isNil'](_0x4a9883)){if(_0x4a9883['pTalking']>0x0){_0x4a9883[_0x192e('0x5e')]-=0x1;}else{logger[_0x192e('0xc')](_0x46ef4c,_0x192e('0x5f'));}}else{logger[_0x192e('0xc')](_0x46ef4c,_0x192e('0x60'));}};exports[_0x192e('0x61')]=function(_0x4f3f58){if(_0x4f3f58<=0x0){return!![];}return![];};function buildObj(_0x5dbe93,_0x8fe797,_0x9f806c){_0x5dbe93[_0x192e('0x62')]=_0x8fe797;_0x5dbe93[_0x192e('0x1b')]=_0x5dbe93[_0x192e('0x63')];_0x5dbe93[_0x192e('0x64')]=_0x5dbe93['channelAgent'];_0x5dbe93[_0x192e('0x65')]=_0x192e('0x66');if(_0x9f806c){_0x5dbe93['mandatoryDisposition']=_0x9f806c[_0x192e('0x67')];}return _0x5dbe93;}exports[_0x192e('0x68')]=buildObj;exports[_0x192e('0x69')]=function(_0x115f13){var _0xa09c0c={};_0xa09c0c['queue']=_0x115f13['queue'];_0xa09c0c['interface']=_0x115f13[_0x192e('0x4c')];_0xa09c0c[_0x192e('0x4a')]=_0x115f13['uniqueid'];return _0xa09c0c;};exports[_0x192e('0x6a')]=function(_0x56a51b){var _0x2c61b1=[];for(var _0x2ce32d in _0x56a51b){if(_0x56a51b[_0x192e('0x2d')](_0x2ce32d)){if(!_['isNil'](_0x56a51b[_0x2ce32d])&&_0x56a51b[_0x2ce32d]['state']===_0x192e('0x6b')&&_0x56a51b[_0x2ce32d][_0x192e('0x6c')]===_0x192e('0x6d')){_0x2c61b1[_0x192e('0x6e')](_0x56a51b[_0x2ce32d]['id']);}}}return _0x2c61b1;};exports['getDiff']=function(_0x2fd794){var _0x190a21=moment()[_0x192e('0x8')](0x0);var _0x44aeae=moment(_0x2fd794)[_0x192e('0x8')](0x0);return _0x190a21[_0x192e('0x9')](_0x44aeae,_0x192e('0xa'));};exports[_0x192e('0x6f')]=function(_0x129977){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x129977[_0x192e('0x1d')],'ListId':_0x129977[_0x192e('0x5c')],'VoiceQueueId':_0x129977[_0x192e('0x1f')]||undefined,'CampaignId':_0x129977[_0x192e('0x70')]||undefined};};exports[_0x192e('0x71')]=function(_0x4082e7){if(_0x4082e7===_0x192e('0x4a')||_0x4082e7===_0x192e('0x72')||_0x4082e7===_0x192e('0x63')||_0x4082e7==='type'||_0x4082e7===_0x192e('0x73')||_0x4082e7===_0x192e('0x74')||_0x4082e7===_0x192e('0x43')||_0x4082e7==='channelAgent'||_0x4082e7===_0x192e('0x48')||_0x4082e7==='active'||_0x4082e7==='calleridnum'||_0x4082e7===_0x192e('0x5a')||_0x4082e7===_0x192e('0x51')||_0x4082e7===_0x192e('0x52')||_0x4082e7===_0x192e('0x53')||_0x4082e7===_0x192e('0x75')||_0x4082e7==='callback'||_0x4082e7===_0x192e('0x76')||_0x4082e7===_0x192e('0x77')||_0x4082e7==='recallme'||_0x4082e7===_0x192e('0x1d')||_0x4082e7===_0x192e('0x5c')||_0x4082e7===_0x192e('0x78')||_0x4082e7===_0x192e('0x1f')||_0x4082e7===_0x192e('0x79')||_0x4082e7===_0x192e('0x7a')||_0x4082e7===_0x192e('0x7b')||_0x4082e7==='xmd-phone'||_0x4082e7===_0x192e('0x7c')||_0x4082e7===_0x192e('0x7d')||_0x4082e7===_0x192e('0x7e')||_0x4082e7===_0x192e('0x7f')||_0x4082e7==='xmd-dialid'||_0x4082e7===_0x192e('0x80')||_0x4082e7==='xmd-contactid'||_0x4082e7==='xmd-cdrtype'||_0x4082e7===_0x192e('0x81')||_0x4082e7===_0x192e('0x82')||_0x4082e7===_0x192e('0x83')||_0x4082e7==='rtpaudioqos'||_0x4082e7===_0x192e('0x84')||_0x4082e7===_0x192e('0x85')||_0x4082e7===_0x192e('0x86')||_0x4082e7===_0x192e('0x87')||_0x4082e7===_0x192e('0x88')||_0x4082e7===_0x192e('0x89')||_0x4082e7==='rtpaudioqosrttbridged'||_0x4082e7===_0x192e('0x8a')||_0x4082e7===_0x192e('0x84')||_0x4082e7===_0x192e('0x85')||_0x4082e7===_0x192e('0x86')||_0x4082e7===_0x192e('0x87')||_0x4082e7===_0x192e('0x88')||_0x4082e7===_0x192e('0x89')||_0x4082e7===_0x192e('0x8b')||_0x4082e7==='bridgepeer'||_0x4082e7===_0x192e('0x8c')||_0x4082e7===_0x192e('0x3c')||_0x4082e7==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x283158,_0xb7e887){var _0x21f13f,_0x540928,_0x1212e8;if(_0xb7e887<=0x0){_0xb7e887=0x1;}_0x21f13f=new RegExp('\x5cw{0,'+_0xb7e887+'}$');_0x540928=Math[_0x192e('0x8d')](0xa,_0xb7e887-0x1);_0x1212e8=Math[_0x192e('0x8d')](0xa,_0xb7e887)-0x1;return util[_0x192e('0x15')]('%s',_[_0x192e('0x8e')](_0x283158,_0x21f13f,_[_0x192e('0x8f')](_0x540928,_0x1212e8)));};exports[_0x192e('0x90')]=function(_0x9b4df2){var _0x135758=_0x9b4df2['match'](/"(.*?)"/);return _0x135758?_0x135758[0x1]:_0x9b4df2;};exports[_0x192e('0x91')]=function(_0x59435d){var _0x43c710=_0x59435d['match'](/<(.*?)>/);return _0x43c710?_0x43c710[0x1]:_0x59435d;};function buildNoAnswerEventPayload(_0x1bc56c,_0x512ffa){var _0x22959a=buildObj(_0x1bc56c,_0x192e('0x92'));if(!_['isEmpty'](_0x512ffa[_0x192e('0x93')])){Object['keys'](_0x512ffa[_0x192e('0x93')])[_0x192e('0x94')](function(_0x565e8f){_0x22959a[_0x565e8f[_0x192e('0x95')]()]=_0x512ffa[_0x192e('0x93')][_0x565e8f];});}return _0x22959a;}exports[_0x192e('0x96')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d538dc4..8fda93f 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 _0xc7e2=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean'];(function(_0x3742a7,_0x389432){var _0x1afce0=function(_0x203721){while(--_0x203721){_0x3742a7['push'](_0x3742a7['shift']());}};_0x1afce0(++_0x389432);}(_0xc7e2,0x1d3));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';exports['queueadd']={'queue':{'type':_0x2c7e('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x2c7e('0x0'),'required':!![]},'penalty':{'type':_0x2c7e('0x1'),'required':![]},'paused':{'type':_0x2c7e('0x2'),'required':![]}};exports[_0x2c7e('0x3')]={'queue':{'type':_0x2c7e('0x0'),'required':!![]},'interface':{'type':_0x2c7e('0x0'),'required':!![]}};exports[_0x2c7e('0x4')]={'interface':{'type':_0x2c7e('0x0'),'required':!![]},'paused':{'type':_0x2c7e('0x2')},'reason':{'type':_0x2c7e('0x0'),'required':![]}};exports[_0x2c7e('0x5')]={'module':{'type':_0x2c7e('0x0'),'required':![]}};exports[_0x2c7e('0x6')]={'uniqueid':{'type':_0x2c7e('0x0'),'required':!![]}};exports[_0x2c7e('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x2c7e('0x0')},'format':{'type':_0x2c7e('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x2c7e('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x2c7e('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x2c7e('0x0'),'required':!![]},'context':{'type':_0x2c7e('0x0')}}; \ No newline at end of file +var _0x8f19=['string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8f19,0xb3));var _0x98f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f19[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0x98f1('0x0')]={'queue':{'type':_0x98f1('0x1'),'required':!![]},'interface':{'type':_0x98f1('0x1'),'required':!![]},'membername':{'type':_0x98f1('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x98f1('0x2'),'required':![]}};exports[_0x98f1('0x3')]={'queue':{'type':_0x98f1('0x1'),'required':!![]},'interface':{'type':_0x98f1('0x1'),'required':!![]}};exports[_0x98f1('0x4')]={'interface':{'type':_0x98f1('0x1'),'required':!![]},'paused':{'type':_0x98f1('0x2')},'reason':{'type':_0x98f1('0x1'),'required':![]}};exports[_0x98f1('0x5')]={'module':{'type':_0x98f1('0x1'),'required':![]}};exports[_0x98f1('0x6')]={'uniqueid':{'type':_0x98f1('0x1'),'required':!![]}};exports[_0x98f1('0x7')]={'uniqueid':{'type':_0x98f1('0x1'),'required':!![]},'filename':{'type':_0x98f1('0x1')},'format':{'type':_0x98f1('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x98f1('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x98f1('0x9')]={'uniqueid':{'type':_0x98f1('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x98f1('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b7482af..79fcf5d 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 _0xe02e=['isEmpty','total','abandoned','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents','length','interface','SIP/%s','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','lodash','moment','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','answered','sumHoldTime','sumDuration','sumBillable'];(function(_0x29970c,_0x376af8){var _0x44e163=function(_0xd6a38c){while(--_0xd6a38c){_0x29970c['push'](_0x29970c['shift']());}};_0x44e163(++_0x376af8);}(_0xe02e,0x1f0));var _0xee02=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xe02e[_0x5783f4];return _0x28e380;};'use strict';var util=require('util');var _=require(_0xee02('0x0'));var moment=require(_0xee02('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0xee02('0x2'));var VoiceQueue=require(_0xee02('0x3'));var Trigger=require(_0xee02('0x4'));var Template=require(_0xee02('0x5'));var Campaign=require(_0xee02('0x6'));var VoiceExtension=require(_0xee02('0x7'));var ZendeskAccount=require(_0xee02('0x8'));var SalesforceAccount=require(_0xee02('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xee02('0xa'));var ZohoAccount=require(_0xee02('0xb'));var DeskAccount=require(_0xee02('0xc'));var VtigerAccount=require(_0xee02('0xd'));var ServicenowAccount=require(_0xee02('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xee02('0xf'));var FaxAccount=require(_0xee02('0x10'));var Realtime=function(){this['agents']={};this[_0xee02('0x11')]={};this['trunks']={};this[_0xee02('0x12')]={};this[_0xee02('0x13')]={};this[_0xee02('0x14')]={};this[_0xee02('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xee02('0x16')]={};this[_0xee02('0x17')]={};this[_0xee02('0x18')]={};this['outboundChannels']={};this['timers']={};this[_0xee02('0x19')]={};this[_0xee02('0x1a')]={};this[_0xee02('0x1b')]={};this[_0xee02('0x1c')]={};this[_0xee02('0x1d')]={};this[_0xee02('0x1e')]={};this[_0xee02('0x1f')]={};this[_0xee02('0x20')]={};this['servicenowAccounts']={};this[_0xee02('0x21')]={};this[_0xee02('0x22')]={};this[_0xee02('0x23')]={};};function freeIsNotKey(_0x3bb150,_0x58cd27,_0x401c04){var _0x4eadfe=_[_0xee02('0x24')](_0x3bb150,function(_0x2fccb8,_0x502179){return _0x2fccb8[_0x401c04];});for(var _0xbfdb9e in _0x58cd27){if(_0x58cd27[_0xee02('0x25')](_0xbfdb9e)){if(!_0x4eadfe[_0xbfdb9e]){delete _0x58cd27[_0xbfdb9e];}}}}function freeIsNotKeySip(_0x364b41,_0x1e3477){var _0x7ba582=_[_0xee02('0x24')](_0x364b41,function(_0x20bbbe,_0x5b8e49){return util[_0xee02('0x26')]('SIP/%s',_0x20bbbe[_0xee02('0x27')]);});for(var _0x5edf51 in _0x1e3477){if(_0x1e3477[_0xee02('0x25')](_0x5edf51)){if(!_0x7ba582[_0x5edf51]){delete _0x1e3477[_0x5edf51];}}}}function freeIsNotKeyAgent(_0x1816a9,_0x5e0a9b){var _0x19487d=_[_0xee02('0x24')](_0x1816a9,function(_0x5cf63d,_0x132242){var _0x1a2ab1=_['isNil'](_0x5cf63d['interface'])?util[_0xee02('0x26')]('SIP/%s',_0x5cf63d['name']):_0x5cf63d['interface'];return _0x1a2ab1;});for(var _0x1d6c93 in _0x5e0a9b){if(_0x5e0a9b['hasOwnProperty'](_0x1d6c93)){if(!_0x19487d[_0x1d6c93]){delete _0x5e0a9b[_0x1d6c93];}}}}function clearVoiceCallReports(_0x401d82){_0x401d82['total']=0x0;_0x401d82[_0xee02('0x28')]=0x0;_0x401d82[_0xee02('0x29')]=0x0;_0x401d82[_0xee02('0x2a')]=0x0;_0x401d82[_0xee02('0x2b')]=0x0;}function clearCampaigns(_0x547e6f){if(!_[_0xee02('0x2c')](_0x547e6f)){for(var _0x15c175 in _0x547e6f){if(_0x547e6f[_0xee02('0x25')](_0x15c175)){_0x547e6f[_0x15c175]['ivrTotalCallsDays']=0x0;_0x547e6f[_0x15c175]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x3d7747){if(!_['isEmpty'](_0x3d7747)){for(var _0x2948e7 in _0x3d7747){if(_0x3d7747[_0xee02('0x25')](_0x2948e7)){_0x3d7747[_0x2948e7][_0xee02('0x2d')]=0x0;_0x3d7747[_0x2948e7]['answered']=0x0;_0x3d7747[_0x2948e7]['unmanaged']=0x0;_0x3d7747[_0x2948e7][_0xee02('0x2e')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x29')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x2a')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x2b')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x2f')]=0x0;_0x3d7747[_0x2948e7]['outboundNoAnswerCallsDay']=0x0;_0x3d7747[_0x2948e7]['outboundBusyCallsDay']=0x0;_0x3d7747[_0x2948e7][_0xee02('0x30')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x31')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x32')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x33')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x34')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x35')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x36')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x37')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x38')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x2f')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x39')]=0x0;_0x3d7747[_0x2948e7][_0xee02('0x3a')]=!![];}}}}Realtime['prototype'][_0xee02('0x3b')]=function(_0x24daad,_0x1217f7){for(var _0x3149c0 in _0x1217f7){if(_0x24daad['hasOwnProperty'](_0x3149c0)){_0x24daad[_0x3149c0]=_0x1217f7[_0x3149c0];}}};Realtime[_0xee02('0x3c')][_0xee02('0x3d')]=function(){var _0x72cc8d=this;return function(_0x17a7c7){if(_0x17a7c7){freeIsNotKeyAgent(_0x17a7c7,_0x72cc8d[_0xee02('0x3e')]);for(var _0x22410e=0x0,_0x458d7c={},_0x397f7a={};_0x22410e<_0x17a7c7[_0xee02('0x3f')];_0x22410e+=0x1){_0x458d7c=_0x17a7c7[_0x22410e];var _0x14feca=_['isNil'](_0x458d7c[_0xee02('0x40')])?util[_0xee02('0x26')](_0xee02('0x41'),_0x458d7c[_0xee02('0x27')]):_0x458d7c[_0xee02('0x40')];if(_[_0xee02('0x42')](_0x72cc8d[_0xee02('0x3e')][_0x14feca])){_0x72cc8d['agents'][_0x14feca]=new Agent(_0x458d7c);}else{_0x72cc8d[_0xee02('0x3b')](_0x72cc8d['agents'][_0x14feca],_0x458d7c);}}}return _0x72cc8d[_0xee02('0x3e')];};};Realtime[_0xee02('0x3c')][_0xee02('0x43')]=function(){var _0x52002f=this;return function(_0xaae53f){if(_0xaae53f){freeIsNotKeySip(_0xaae53f,_0x52002f[_0xee02('0x11')]);for(var _0x4dd4df=0x0,_0x5b087a={},_0x460726={};_0x4dd4df<_0xaae53f['length'];_0x4dd4df+=0x1){_0x5b087a=_0xaae53f[_0x4dd4df];if(_['isUndefined'](_0x52002f[_0xee02('0x11')][util[_0xee02('0x26')](_0xee02('0x41'),_0x5b087a[_0xee02('0x27')])])){_0x52002f[_0xee02('0x11')][util[_0xee02('0x26')](_0xee02('0x41'),_0x5b087a[_0xee02('0x27')])]=new Telephone(_0x5b087a);}else{_0x52002f[_0xee02('0x3b')](_0x52002f['telephones'][util[_0xee02('0x26')](_0xee02('0x41'),_0x5b087a[_0xee02('0x27')])],_0x5b087a);}}}return _0x52002f[_0xee02('0x11')];};};Realtime['prototype'][_0xee02('0x44')]=function(){var _0x5e1618=this;return function(_0x5187d8){if(_0x5187d8){freeIsNotKeySip(_0x5187d8,_0x5e1618[_0xee02('0x45')]);for(var _0x4e53e5=0x0,_0x587b9e={},_0x1936da={};_0x4e53e5<_0x5187d8[_0xee02('0x3f')];_0x4e53e5+=0x1){_0x587b9e=_0x5187d8[_0x4e53e5];if(_[_0xee02('0x42')](_0x5e1618[_0xee02('0x45')][util['format'](_0xee02('0x41'),_0x587b9e[_0xee02('0x27')])])){_0x5e1618['trunks'][util[_0xee02('0x26')](_0xee02('0x41'),_0x587b9e['name'])]=new Trunk(_0x587b9e);}else{_0x5e1618[_0xee02('0x3b')](_0x5e1618[_0xee02('0x45')][util[_0xee02('0x26')](_0xee02('0x41'),_0x587b9e[_0xee02('0x27')])],_0x587b9e);}}}return _0x5e1618[_0xee02('0x45')];};};Realtime[_0xee02('0x3c')][_0xee02('0x46')]=function(){var _0x204db2=this;return function(_0x2b505e){if(_0x2b505e){freeIsNotKey(_0x2b505e,_0x204db2[_0xee02('0x12')],_0xee02('0x27'));for(var _0xce8670=0x0,_0x1254a0={},_0x3a1410={};_0xce8670<_0x2b505e[_0xee02('0x3f')];_0xce8670+=0x1){_0x1254a0=_0x2b505e[_0xce8670];if(_[_0xee02('0x42')](_0x204db2[_0xee02('0x12')][_0x1254a0[_0xee02('0x27')]])){_0x204db2['voiceQueues'][_0x1254a0[_0xee02('0x27')]]=new VoiceQueue(_0x1254a0);}else{_0x204db2[_0xee02('0x3b')](_0x204db2[_0xee02('0x12')][_0x1254a0[_0xee02('0x27')]],_0x1254a0);}}}return _0x204db2[_0xee02('0x12')];};};Realtime[_0xee02('0x3c')]['initTriggers']=function(){var _0x510b95=this;return function(_0x244389){if(_0x244389){freeIsNotKey(_0x244389,_0x510b95[_0xee02('0x13')],'id');for(var _0x3f7afa=0x0,_0x4808f4={},_0xbc9b45={};_0x3f7afa<_0x244389[_0xee02('0x3f')];_0x3f7afa+=0x1){_0x4808f4=_0x244389[_0x3f7afa];if(_['isUndefined'](_0x510b95[_0xee02('0x13')][_0x4808f4['id']])){_0x510b95['triggers'][_0x4808f4['id']]=new Trigger(_0x4808f4);}else{_0x510b95[_0xee02('0x3b')](_0x510b95[_0xee02('0x13')][_0x4808f4['id']],_0x4808f4);}}}return _0x510b95[_0xee02('0x13')];};};Realtime['prototype'][_0xee02('0x47')]=function(){var _0x3a573c=this;return function(_0x4f11ff){if(_0x4f11ff){freeIsNotKey(_0x4f11ff,_0x3a573c[_0xee02('0x15')],'id');for(var _0x39337d=0x0,_0x32496f={},_0x59d1f7={};_0x39337d<_0x4f11ff[_0xee02('0x3f')];_0x39337d+=0x1){_0x32496f=_0x4f11ff[_0x39337d];if(_[_0xee02('0x42')](_0x3a573c[_0xee02('0x15')][_0x32496f['id']])){_0x3a573c['templates'][_0x32496f['id']]=new Template(_0x32496f);}else{_0x3a573c[_0xee02('0x3b')](_0x3a573c[_0xee02('0x15')][_0x32496f['id']],_0x32496f);}}}return _0x3a573c['templates'];};};Realtime['prototype'][_0xee02('0x48')]=function(){var _0x452b40=this;return function(_0x10cd0e){if(_0x10cd0e){freeIsNotKey(_0x10cd0e,_0x452b40['zendeskAccounts'],'id');for(var _0x1638c4=0x0,_0x16ad98={},_0x5f5043={};_0x1638c4<_0x10cd0e[_0xee02('0x3f')];_0x1638c4+=0x1){_0x16ad98=_0x10cd0e[_0x1638c4];if(_[_0xee02('0x42')](_0x452b40[_0xee02('0x1a')][_0x16ad98['id']])){_0x452b40[_0xee02('0x1a')][_0x16ad98['id']]=new ZendeskAccount(_0x16ad98);}else{_0x452b40['mergeFromDatabase'](_0x452b40[_0xee02('0x1a')][_0x16ad98['id']],_0x16ad98);}}}return _0x452b40[_0xee02('0x1a')];};};Realtime['prototype'][_0xee02('0x49')]=function(){var _0x3d5448=this;return function(_0x242904){if(_0x242904){freeIsNotKey(_0x242904,_0x3d5448[_0xee02('0x1b')],'id');for(var _0x2381a5=0x0,_0x16fc0a={},_0x941ae1={};_0x2381a5<_0x242904[_0xee02('0x3f')];_0x2381a5+=0x1){_0x16fc0a=_0x242904[_0x2381a5];if(_[_0xee02('0x42')](_0x3d5448[_0xee02('0x1b')][_0x16fc0a['id']])){_0x3d5448['salesforceAccounts'][_0x16fc0a['id']]=new SalesforceAccount(_0x16fc0a);}else{_0x3d5448[_0xee02('0x3b')](_0x3d5448[_0xee02('0x1b')][_0x16fc0a['id']],_0x16fc0a);}}}return _0x3d5448[_0xee02('0x1b')];};};Realtime[_0xee02('0x3c')][_0xee02('0x4a')]=function(){var _0x37e28b=this;return function(_0x59b8e1){if(_0x59b8e1){freeIsNotKey(_0x59b8e1,_0x37e28b['freshdeskAccounts'],'id');for(var _0x2bb913=0x0,_0x9afe29={},_0x225b13={};_0x2bb913<_0x59b8e1[_0xee02('0x3f')];_0x2bb913+=0x1){_0x9afe29=_0x59b8e1[_0x2bb913];if(_['isUndefined'](_0x37e28b['freshdeskAccounts'][_0x9afe29['id']])){_0x37e28b[_0xee02('0x1d')][_0x9afe29['id']]=new FreshdeskAccount(_0x9afe29);}else{_0x37e28b[_0xee02('0x3b')](_0x37e28b['freshdeskAccounts'][_0x9afe29['id']],_0x9afe29);}}}return _0x37e28b[_0xee02('0x1d')];};};Realtime[_0xee02('0x3c')][_0xee02('0x4b')]=function(){var _0x1dd98e=this;return function(_0x58c009){if(_0x58c009){freeIsNotKey(_0x58c009,_0x1dd98e[_0xee02('0x1e')],'id');for(var _0x5cda22=0x0,_0x30d4e9={},_0x54cf70={};_0x5cda22<_0x58c009[_0xee02('0x3f')];_0x5cda22+=0x1){_0x30d4e9=_0x58c009[_0x5cda22];if(_['isUndefined'](_0x1dd98e[_0xee02('0x1e')][_0x30d4e9['id']])){_0x1dd98e[_0xee02('0x1e')][_0x30d4e9['id']]=new ZohoAccount(_0x30d4e9);}else{_0x1dd98e[_0xee02('0x3b')](_0x1dd98e['zohoAccounts'][_0x30d4e9['id']],_0x30d4e9);}}}return _0x1dd98e[_0xee02('0x1e')];};};Realtime[_0xee02('0x3c')][_0xee02('0x4c')]=function(){var _0x256225=this;return function(_0x1ae93f){if(_0x1ae93f){freeIsNotKey(_0x1ae93f,_0x256225[_0xee02('0x1f')],'id');for(var _0x6d63a1=0x0,_0x17857b={},_0x4e58d2={};_0x6d63a1<_0x1ae93f[_0xee02('0x3f')];_0x6d63a1+=0x1){_0x17857b=_0x1ae93f[_0x6d63a1];if(_[_0xee02('0x42')](_0x256225[_0xee02('0x1f')][_0x17857b['id']])){_0x256225[_0xee02('0x1f')][_0x17857b['id']]=new DeskAccount(_0x17857b);}else{_0x256225['mergeFromDatabase'](_0x256225[_0xee02('0x1f')][_0x17857b['id']],_0x17857b);}}}return _0x256225['deskAccounts'];};};Realtime[_0xee02('0x3c')][_0xee02('0x4d')]=function(){var _0x1dd3a0=this;return function(_0x493faf){if(_0x493faf){freeIsNotKey(_0x493faf,_0x1dd3a0[_0xee02('0x1c')],'id');for(var _0x591ee3=0x0,_0x260285={},_0x480874={};_0x591ee3<_0x493faf[_0xee02('0x3f')];_0x591ee3+=0x1){_0x260285=_0x493faf[_0x591ee3];if(_[_0xee02('0x42')](_0x1dd3a0[_0xee02('0x1c')][_0x260285['id']])){_0x1dd3a0[_0xee02('0x1c')][_0x260285['id']]=new SugarcrmAccount(_0x260285);}else{_0x1dd3a0[_0xee02('0x3b')](_0x1dd3a0[_0xee02('0x1c')][_0x260285['id']],_0x260285);}}}return _0x1dd3a0[_0xee02('0x1c')];};};Realtime[_0xee02('0x3c')][_0xee02('0x4e')]=function(){var _0x324f8a=this;return function(_0x46973e){if(_0x46973e){freeIsNotKey(_0x46973e,_0x324f8a[_0xee02('0x20')],'id');for(var _0x452f71=0x0,_0x55bd23={},_0x23928d={};_0x452f71<_0x46973e[_0xee02('0x3f')];_0x452f71+=0x1){_0x55bd23=_0x46973e[_0x452f71];if(_[_0xee02('0x42')](_0x324f8a[_0xee02('0x20')][_0x55bd23['id']])){_0x324f8a[_0xee02('0x20')][_0x55bd23['id']]=new VtigerAccount(_0x55bd23);}else{_0x324f8a[_0xee02('0x3b')](_0x324f8a['vtigerAccounts'][_0x55bd23['id']],_0x55bd23);}}}return _0x324f8a['vtigerAccounts'];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x527cc9=this;return function(_0x4c5507){if(_0x4c5507){freeIsNotKey(_0x4c5507,_0x527cc9[_0xee02('0x4f')],'id');for(var _0x526d47=0x0,_0x426fac={},_0x278021={};_0x526d47<_0x4c5507[_0xee02('0x3f')];_0x526d47+=0x1){_0x426fac=_0x4c5507[_0x526d47];if(_[_0xee02('0x42')](_0x527cc9[_0xee02('0x4f')][_0x426fac['id']])){_0x527cc9['servicenowAccounts'][_0x426fac['id']]=new ServicenowAccount(_0x426fac);}else{_0x527cc9[_0xee02('0x3b')](_0x527cc9[_0xee02('0x4f')][_0x426fac['id']],_0x426fac);}}}return _0x527cc9['servicenowAccounts'];};};Realtime[_0xee02('0x3c')][_0xee02('0x50')]=function(){var _0x4435ca=this;return function(_0x3fc440){if(_0x3fc440){freeIsNotKey(_0x3fc440,_0x4435ca['dynamics365Accounts'],'id');for(var _0x1f14fc=0x0,_0x947777={},_0x378bae={};_0x1f14fc<_0x3fc440[_0xee02('0x3f')];_0x1f14fc+=0x1){_0x947777=_0x3fc440[_0x1f14fc];if(_[_0xee02('0x42')](_0x4435ca[_0xee02('0x21')][_0x947777['id']])){_0x4435ca[_0xee02('0x21')][_0x947777['id']]=new Dynamics365Account(_0x947777);}else{_0x4435ca[_0xee02('0x3b')](_0x4435ca[_0xee02('0x21')][_0x947777['id']],_0x947777);}}}return _0x4435ca[_0xee02('0x21')];};};Realtime[_0xee02('0x3c')][_0xee02('0x51')]=function(){var _0x3225a0=this;return function(_0xd7130c){if(_0xd7130c){freeIsNotKey(_0xd7130c,_0x3225a0[_0xee02('0x22')],'id');for(var _0x5d81e9=0x0,_0x1b06d9={},_0x2f5945={};_0x5d81e9<_0xd7130c[_0xee02('0x3f')];_0x5d81e9+=0x1){_0x1b06d9=_0xd7130c[_0x5d81e9];if(_[_0xee02('0x42')](_0x3225a0[_0xee02('0x22')][_0x1b06d9['id']])){_0x3225a0[_0xee02('0x22')][_0x1b06d9['id']]=new FreshsalesAccount(_0x1b06d9);}else{_0x3225a0[_0xee02('0x3b')](_0x3225a0[_0xee02('0x22')][_0x1b06d9['id']],_0x1b06d9);}}}return _0x3225a0[_0xee02('0x22')];};};Realtime[_0xee02('0x3c')][_0xee02('0x52')]=function(){var _0x4be38d=this;return function(_0x4e7188){for(var _0x4804b7=0x0;_0x4804b7<_0x4e7188[_0xee02('0x3f')];_0x4804b7+=0x1){_[_0xee02('0x53')](_0x4be38d[_0xee02('0x12')][_0x4e7188[_0x4804b7][_0xee02('0x27')]],_0x4e7188[_0x4804b7]);}return _0x4be38d[_0xee02('0x12')];};};Realtime[_0xee02('0x3c')][_0xee02('0x54')]=function(){var _0x5f0e3b=this;return function(_0x1cac55){clearVoiceQueues(_0x5f0e3b[_0xee02('0x12')]);if(_0x1cac55){_0x1cac55=_[_0xee02('0x55')](_0x1cac55,_0xee02('0x56'));for(var _0x212634 in _0x1cac55){if(_0x1cac55[_0xee02('0x25')](_0x212634)){var _0x5a7f60={};for(var _0x4b4761=0x0;_0x4b4761<_0x1cac55[_0x212634][_0xee02('0x3f')];_0x4b4761+=0x1){var _0x153ad1=_0x1cac55[_0x212634][_0x4b4761]['queue'];if(_0x5f0e3b[_0xee02('0x12')][_0x153ad1]){if(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x57')]){_0x5f0e3b[_0xee02('0x12')][_0x153ad1][_0xee02('0x58')]+=0x1;}if(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x59')]){_0x5f0e3b['voiceQueues'][_0x153ad1][_0xee02('0x2e')]+=0x1;}_0x5f0e3b[_0xee02('0x12')][_0x153ad1][_0xee02('0x29')]+=moment(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x5a')])[_0xee02('0x5b')](moment(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x5c')]),_0xee02('0x5d'))||0x0;if(_0x4b4761===_0x1cac55[_0x212634][_0xee02('0x3f')]-0x1){_0x5f0e3b['voiceQueues'][_0x153ad1][_0xee02('0x2a')]+=moment(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x5e')]||_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x5f')]||_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x60')])[_0xee02('0x5b')](moment(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x5c')]),_0xee02('0x5d'))||0x0;_0x5f0e3b['voiceQueues'][_0x153ad1]['total']+=0x1;if(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x61')]){_0x5f0e3b[_0xee02('0x12')][_0x153ad1][_0xee02('0x28')]+=0x1;_0x5f0e3b[_0xee02('0x12')][_0x153ad1]['sumBillable']+=moment(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x5e')])[_0xee02('0x5b')](moment(_0x1cac55[_0x212634][_0x4b4761][_0xee02('0x5a')]),'seconds')||0x0;}}else{_0x5f0e3b[_0xee02('0x12')][_0x153ad1][_0xee02('0x2a')]+=_0x5f0e3b[_0xee02('0x12')][_0x153ad1][_0xee02('0x29')]||0x0;}}}}}}return _0x5f0e3b[_0xee02('0x12')];};};Realtime[_0xee02('0x3c')][_0xee02('0x62')]=function(){var _0x1ab8a5=this;return function(_0x5232d0){clearVoiceCallReports(_0x1ab8a5[_0xee02('0x63')]);if(_0x5232d0){for(var _0x2b12d9=0x0;_0x2b12d9<_0x5232d0[_0xee02('0x3f')];_0x2b12d9+=0x1){_0x1ab8a5[_0xee02('0x63')]['total']+=0x1;_0x1ab8a5[_0xee02('0x63')]['sumDuration']+=_0x5232d0[_0x2b12d9]['duration'];if(_0x5232d0[_0x2b12d9][_0xee02('0x64')]==='ANSWERED'){_0x1ab8a5[_0xee02('0x63')][_0xee02('0x28')]+=0x1;_0x1ab8a5[_0xee02('0x63')][_0xee02('0x29')]+=_0x5232d0[_0x2b12d9]['duration']-_0x5232d0[_0x2b12d9][_0xee02('0x65')]||0x0;_0x1ab8a5['outbound'][_0xee02('0x2b')]+=_0x5232d0[_0x2b12d9][_0xee02('0x65')];}}}return _0x1ab8a5[_0xee02('0x63')];};};Realtime[_0xee02('0x3c')][_0xee02('0x66')]=function(){var _0xe9f6d0=this;return function(_0x183519){if(_0x183519){freeIsNotKey(_0x183519,_0xe9f6d0[_0xee02('0x14')],_0xee02('0x27'));for(var _0x47a22f=0x0,_0x400003={};_0x47a22f<_0x183519[_0xee02('0x3f')];_0x47a22f+=0x1){_0x400003=_0x183519[_0x47a22f];if(_['isUndefined'](_0xe9f6d0[_0xee02('0x14')][_0x400003['name']])){_0xe9f6d0['campaigns'][_0x400003[_0xee02('0x27')]]=new Campaign(_0x400003);}else{_0xe9f6d0[_0xee02('0x3b')](_0xe9f6d0['campaigns'][_0x400003['name']],_0x400003);_0xe9f6d0['campaigns'][_0x400003[_0xee02('0x27')]][_0xee02('0x67')]=_0x400003[_0xee02('0x68')]?_0x400003[_0xee02('0x68')][_0xee02('0x27')]:undefined;}}}return _0xe9f6d0[_0xee02('0x14')];};};Realtime['prototype'][_0xee02('0x69')]=function(){var _0x400c4d=this;return function(_0x1bd499){if(_0x1bd499){freeIsNotKey(_0x1bd499,_0x400c4d[_0xee02('0x16')],'id');for(var _0x1bca3c=0x0,_0x923a0={};_0x1bca3c<_0x1bd499[_0xee02('0x3f')];_0x1bca3c+=0x1){_0x923a0=_0x1bd499[_0x1bca3c];if(_['isUndefined'](_0x400c4d['voiceExtensions'][_0x923a0['id']])){_0x400c4d[_0xee02('0x16')][_0x923a0['id']]=new VoiceExtension(_0x923a0);}else{_0x400c4d[_0xee02('0x3b')](_0x400c4d[_0xee02('0x16')][_0x923a0['id']],_0x923a0);}}}return _0x400c4d['voiceExtensions'];};};Realtime[_0xee02('0x3c')][_0xee02('0x6a')]=function(){var _0x320cd7=this;return function(_0x3b7cf0){clearCampaigns(_0x320cd7[_0xee02('0x14')]);for(var _0x4713f9=0x0;_0x4713f9<_0x3b7cf0[_0xee02('0x3f')];_0x4713f9+=0x1){_[_0xee02('0x53')](_0x320cd7['campaigns'][_0x3b7cf0[_0x4713f9][_0xee02('0x27')]],_0x3b7cf0[_0x4713f9]);}return _0x320cd7[_0xee02('0x14')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x5c14ac=this;return function(_0x3c23ec){if(_0x3c23ec){freeIsNotKey(_0x3c23ec,_0x5c14ac[_0xee02('0x23')],'id');for(var _0x2f6cc4=0x0,_0x22fe82={},_0x2ba1de={};_0x2f6cc4<_0x3c23ec['length'];_0x2f6cc4+=0x1){_0x22fe82=_0x3c23ec[_0x2f6cc4];if(_[_0xee02('0x42')](_0x5c14ac[_0xee02('0x23')][_0x22fe82['id']])){_0x5c14ac['faxAccounts'][_0x22fe82['id']]=new FaxAccount(_0x22fe82);}else{_0x5c14ac[_0xee02('0x3b')](_0x5c14ac[_0xee02('0x23')][_0x22fe82['id']],_0x22fe82);}}}return _0x5c14ac['faxAccounts'];};};module[_0xee02('0x6b')]=Realtime; \ No newline at end of file +var _0xf47e=['initFaxAccounts','faxAccounts','exports','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','settings','salesforceAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','format','SIP/%s','name','isNil','interface','hasOwnProperty','total','sumHoldTime','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','length','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','answered','sumBillable','initVoiceCallReports','duration','disposition','billableseconds','SquareProject','initVoiceExtensions','initCampaignHopperHistory'];(function(_0x2b8e40,_0x1087af){var _0x874dd7=function(_0x59e68f){while(--_0x59e68f){_0x2b8e40['push'](_0x2b8e40['shift']());}};_0x874dd7(++_0x1087af);}(_0xf47e,0x1bf));var _0xef47=function(_0x48cf46,_0x319824){_0x48cf46=_0x48cf46-0x0;var _0x39984e=_0xf47e[_0x48cf46];return _0x39984e;};'use strict';var util=require(_0xef47('0x0'));var _=require(_0xef47('0x1'));var moment=require('moment');var Agent=require(_0xef47('0x2'));var Telephone=require(_0xef47('0x3'));var Trunk=require(_0xef47('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xef47('0x5'));var Template=require(_0xef47('0x6'));var Campaign=require(_0xef47('0x7'));var VoiceExtension=require(_0xef47('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xef47('0x9'));var FreshdeskAccount=require(_0xef47('0xa'));var SugarcrmAccount=require(_0xef47('0xb'));var ZohoAccount=require(_0xef47('0xc'));var DeskAccount=require(_0xef47('0xd'));var VtigerAccount=require(_0xef47('0xe'));var ServicenowAccount=require(_0xef47('0xf'));var Dynamics365Account=require(_0xef47('0x10'));var FreshsalesAccount=require(_0xef47('0x11'));var FaxAccount=require(_0xef47('0x12'));var Realtime=function(){this[_0xef47('0x13')]={};this[_0xef47('0x14')]={};this[_0xef47('0x15')]={};this[_0xef47('0x16')]={};this[_0xef47('0x17')]={};this[_0xef47('0x18')]={};this[_0xef47('0x19')]={};this[_0xef47('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xef47('0x1b')]={};this[_0xef47('0x1c')]={};this[_0xef47('0x1d')]={};this['outboundChannels']={};this['timers']={};this[_0xef47('0x1e')]={};this['zendeskAccounts']={};this[_0xef47('0x1f')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this['zohoAccounts']={};this['deskAccounts']={};this[_0xef47('0x20')]={};this[_0xef47('0x21')]={};this[_0xef47('0x22')]={};this[_0xef47('0x23')]={};this['faxAccounts']={};};function freeIsNotKey(_0x11fff1,_0x47f249,_0x3ed50a){var _0x5cda37=_['mapKeys'](_0x11fff1,function(_0x151902,_0x3370a0){return _0x151902[_0x3ed50a];});for(var _0x53c355 in _0x47f249){if(_0x47f249['hasOwnProperty'](_0x53c355)){if(!_0x5cda37[_0x53c355]){delete _0x47f249[_0x53c355];}}}}function freeIsNotKeySip(_0x366bcc,_0x4d61c6){var _0x544224=_[_0xef47('0x24')](_0x366bcc,function(_0x59ecc8,_0x58e502){return util[_0xef47('0x25')](_0xef47('0x26'),_0x59ecc8[_0xef47('0x27')]);});for(var _0x521426 in _0x4d61c6){if(_0x4d61c6['hasOwnProperty'](_0x521426)){if(!_0x544224[_0x521426]){delete _0x4d61c6[_0x521426];}}}}function freeIsNotKeyAgent(_0x43000a,_0x36592a){var _0x5813a2=_[_0xef47('0x24')](_0x43000a,function(_0x4186f0,_0x395bd3){var _0x36cd70=_[_0xef47('0x28')](_0x4186f0['interface'])?util[_0xef47('0x25')]('SIP/%s',_0x4186f0[_0xef47('0x27')]):_0x4186f0[_0xef47('0x29')];return _0x36cd70;});for(var _0x11931d in _0x36592a){if(_0x36592a[_0xef47('0x2a')](_0x11931d)){if(!_0x5813a2[_0x11931d]){delete _0x36592a[_0x11931d];}}}}function clearVoiceCallReports(_0x2468fe){_0x2468fe[_0xef47('0x2b')]=0x0;_0x2468fe['answered']=0x0;_0x2468fe[_0xef47('0x2c')]=0x0;_0x2468fe[_0xef47('0x2d')]=0x0;_0x2468fe['sumBillable']=0x0;}function clearCampaigns(_0x36e441){if(!_['isEmpty'](_0x36e441)){for(var _0x4c56e4 in _0x36e441){if(_0x36e441['hasOwnProperty'](_0x4c56e4)){_0x36e441[_0x4c56e4][_0xef47('0x2e')]=0x0;_0x36e441[_0x4c56e4][_0xef47('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x50b018){if(!_['isEmpty'](_0x50b018)){for(var _0x307856 in _0x50b018){if(_0x50b018[_0xef47('0x2a')](_0x307856)){_0x50b018[_0x307856][_0xef47('0x2b')]=0x0;_0x50b018[_0x307856]['answered']=0x0;_0x50b018[_0x307856][_0xef47('0x30')]=0x0;_0x50b018[_0x307856][_0xef47('0x31')]=0x0;_0x50b018[_0x307856][_0xef47('0x2c')]=0x0;_0x50b018[_0x307856][_0xef47('0x2d')]=0x0;_0x50b018[_0x307856]['sumBillable']=0x0;_0x50b018[_0x307856][_0xef47('0x32')]=0x0;_0x50b018[_0x307856][_0xef47('0x33')]=0x0;_0x50b018[_0x307856][_0xef47('0x34')]=0x0;_0x50b018[_0x307856][_0xef47('0x35')]=0x0;_0x50b018[_0x307856][_0xef47('0x36')]=0x0;_0x50b018[_0x307856][_0xef47('0x37')]=0x0;_0x50b018[_0x307856][_0xef47('0x38')]=0x0;_0x50b018[_0x307856]['outboundDropCallsDayCallersExit']=0x0;_0x50b018[_0x307856][_0xef47('0x39')]=0x0;_0x50b018[_0x307856][_0xef47('0x3a')]=0x0;_0x50b018[_0x307856]['outboundRejectCallsDay']=0x0;_0x50b018[_0x307856][_0xef47('0x3b')]=0x0;_0x50b018[_0x307856][_0xef47('0x32')]=0x0;_0x50b018[_0x307856][_0xef47('0x3c')]=0x0;_0x50b018[_0x307856][_0xef47('0x3d')]=!![];}}}}Realtime[_0xef47('0x3e')][_0xef47('0x3f')]=function(_0x5db33a,_0x57984a){for(var _0x5dbc49 in _0x57984a){if(_0x5db33a[_0xef47('0x2a')](_0x5dbc49)){_0x5db33a[_0x5dbc49]=_0x57984a[_0x5dbc49];}}};Realtime[_0xef47('0x3e')][_0xef47('0x40')]=function(){var _0x23e87e=this;return function(_0x98f373){if(_0x98f373){freeIsNotKeyAgent(_0x98f373,_0x23e87e[_0xef47('0x13')]);for(var _0x555d71=0x0,_0x1c7fcd={},_0xee780f={};_0x555d71<_0x98f373['length'];_0x555d71+=0x1){_0x1c7fcd=_0x98f373[_0x555d71];var _0x1067d5=_[_0xef47('0x28')](_0x1c7fcd['interface'])?util['format']('SIP/%s',_0x1c7fcd[_0xef47('0x27')]):_0x1c7fcd[_0xef47('0x29')];if(_[_0xef47('0x41')](_0x23e87e[_0xef47('0x13')][_0x1067d5])){_0x23e87e[_0xef47('0x13')][_0x1067d5]=new Agent(_0x1c7fcd);}else{_0x23e87e[_0xef47('0x3f')](_0x23e87e[_0xef47('0x13')][_0x1067d5],_0x1c7fcd);}}}return _0x23e87e[_0xef47('0x13')];};};Realtime[_0xef47('0x3e')][_0xef47('0x42')]=function(){var _0xa23e3d=this;return function(_0x1bd222){if(_0x1bd222){freeIsNotKeySip(_0x1bd222,_0xa23e3d[_0xef47('0x14')]);for(var _0x5b9f40=0x0,_0x4e5fe1={},_0x535ed3={};_0x5b9f40<_0x1bd222[_0xef47('0x43')];_0x5b9f40+=0x1){_0x4e5fe1=_0x1bd222[_0x5b9f40];if(_['isUndefined'](_0xa23e3d[_0xef47('0x14')][util[_0xef47('0x25')](_0xef47('0x26'),_0x4e5fe1[_0xef47('0x27')])])){_0xa23e3d['telephones'][util['format'](_0xef47('0x26'),_0x4e5fe1[_0xef47('0x27')])]=new Telephone(_0x4e5fe1);}else{_0xa23e3d[_0xef47('0x3f')](_0xa23e3d[_0xef47('0x14')][util['format'](_0xef47('0x26'),_0x4e5fe1['name'])],_0x4e5fe1);}}}return _0xa23e3d[_0xef47('0x14')];};};Realtime['prototype'][_0xef47('0x44')]=function(){var _0x5a0077=this;return function(_0x5a3848){if(_0x5a3848){freeIsNotKeySip(_0x5a3848,_0x5a0077['trunks']);for(var _0x424cd7=0x0,_0x5e47cc={},_0x2d9a05={};_0x424cd7<_0x5a3848[_0xef47('0x43')];_0x424cd7+=0x1){_0x5e47cc=_0x5a3848[_0x424cd7];if(_[_0xef47('0x41')](_0x5a0077[_0xef47('0x15')][util[_0xef47('0x25')](_0xef47('0x26'),_0x5e47cc['name'])])){_0x5a0077['trunks'][util[_0xef47('0x25')](_0xef47('0x26'),_0x5e47cc[_0xef47('0x27')])]=new Trunk(_0x5e47cc);}else{_0x5a0077['mergeFromDatabase'](_0x5a0077[_0xef47('0x15')][util[_0xef47('0x25')](_0xef47('0x26'),_0x5e47cc[_0xef47('0x27')])],_0x5e47cc);}}}return _0x5a0077[_0xef47('0x15')];};};Realtime['prototype'][_0xef47('0x45')]=function(){var _0x283f78=this;return function(_0x48258d){if(_0x48258d){freeIsNotKey(_0x48258d,_0x283f78[_0xef47('0x16')],_0xef47('0x27'));for(var _0x6e5b02=0x0,_0x51f9ed={},_0x53a3e1={};_0x6e5b02<_0x48258d[_0xef47('0x43')];_0x6e5b02+=0x1){_0x51f9ed=_0x48258d[_0x6e5b02];if(_[_0xef47('0x41')](_0x283f78[_0xef47('0x16')][_0x51f9ed[_0xef47('0x27')]])){_0x283f78[_0xef47('0x16')][_0x51f9ed[_0xef47('0x27')]]=new VoiceQueue(_0x51f9ed);}else{_0x283f78['mergeFromDatabase'](_0x283f78[_0xef47('0x16')][_0x51f9ed[_0xef47('0x27')]],_0x51f9ed);}}}return _0x283f78[_0xef47('0x16')];};};Realtime[_0xef47('0x3e')][_0xef47('0x46')]=function(){var _0x3e17c9=this;return function(_0x41b0f8){if(_0x41b0f8){freeIsNotKey(_0x41b0f8,_0x3e17c9[_0xef47('0x17')],'id');for(var _0xe0b0f=0x0,_0x1991c8={},_0x46b9e3={};_0xe0b0f<_0x41b0f8[_0xef47('0x43')];_0xe0b0f+=0x1){_0x1991c8=_0x41b0f8[_0xe0b0f];if(_['isUndefined'](_0x3e17c9['triggers'][_0x1991c8['id']])){_0x3e17c9[_0xef47('0x17')][_0x1991c8['id']]=new Trigger(_0x1991c8);}else{_0x3e17c9[_0xef47('0x3f')](_0x3e17c9[_0xef47('0x17')][_0x1991c8['id']],_0x1991c8);}}}return _0x3e17c9[_0xef47('0x17')];};};Realtime[_0xef47('0x3e')][_0xef47('0x47')]=function(){var _0x31ca33=this;return function(_0x4eea53){if(_0x4eea53){freeIsNotKey(_0x4eea53,_0x31ca33[_0xef47('0x19')],'id');for(var _0x182fb1=0x0,_0x469af3={},_0x11d476={};_0x182fb1<_0x4eea53[_0xef47('0x43')];_0x182fb1+=0x1){_0x469af3=_0x4eea53[_0x182fb1];if(_[_0xef47('0x41')](_0x31ca33[_0xef47('0x19')][_0x469af3['id']])){_0x31ca33[_0xef47('0x19')][_0x469af3['id']]=new Template(_0x469af3);}else{_0x31ca33[_0xef47('0x3f')](_0x31ca33[_0xef47('0x19')][_0x469af3['id']],_0x469af3);}}}return _0x31ca33[_0xef47('0x19')];};};Realtime[_0xef47('0x3e')][_0xef47('0x48')]=function(){var _0x3ba8bc=this;return function(_0x405636){if(_0x405636){freeIsNotKey(_0x405636,_0x3ba8bc[_0xef47('0x49')],'id');for(var _0x444d57=0x0,_0x2d6469={},_0x219b4f={};_0x444d57<_0x405636['length'];_0x444d57+=0x1){_0x2d6469=_0x405636[_0x444d57];if(_['isUndefined'](_0x3ba8bc[_0xef47('0x49')][_0x2d6469['id']])){_0x3ba8bc['zendeskAccounts'][_0x2d6469['id']]=new ZendeskAccount(_0x2d6469);}else{_0x3ba8bc[_0xef47('0x3f')](_0x3ba8bc['zendeskAccounts'][_0x2d6469['id']],_0x2d6469);}}}return _0x3ba8bc['zendeskAccounts'];};};Realtime[_0xef47('0x3e')][_0xef47('0x4a')]=function(){var _0x1709d0=this;return function(_0x523f0f){if(_0x523f0f){freeIsNotKey(_0x523f0f,_0x1709d0[_0xef47('0x1f')],'id');for(var _0x4b3d86=0x0,_0x36ac07={},_0x4252d3={};_0x4b3d86<_0x523f0f['length'];_0x4b3d86+=0x1){_0x36ac07=_0x523f0f[_0x4b3d86];if(_[_0xef47('0x41')](_0x1709d0[_0xef47('0x1f')][_0x36ac07['id']])){_0x1709d0[_0xef47('0x1f')][_0x36ac07['id']]=new SalesforceAccount(_0x36ac07);}else{_0x1709d0[_0xef47('0x3f')](_0x1709d0[_0xef47('0x1f')][_0x36ac07['id']],_0x36ac07);}}}return _0x1709d0['salesforceAccounts'];};};Realtime[_0xef47('0x3e')]['initFreshdeskAccounts']=function(){var _0xdcd0ea=this;return function(_0x46dfb8){if(_0x46dfb8){freeIsNotKey(_0x46dfb8,_0xdcd0ea['freshdeskAccounts'],'id');for(var _0x3bdd25=0x0,_0x530eaa={},_0x426f3e={};_0x3bdd25<_0x46dfb8[_0xef47('0x43')];_0x3bdd25+=0x1){_0x530eaa=_0x46dfb8[_0x3bdd25];if(_[_0xef47('0x41')](_0xdcd0ea[_0xef47('0x4b')][_0x530eaa['id']])){_0xdcd0ea[_0xef47('0x4b')][_0x530eaa['id']]=new FreshdeskAccount(_0x530eaa);}else{_0xdcd0ea[_0xef47('0x3f')](_0xdcd0ea[_0xef47('0x4b')][_0x530eaa['id']],_0x530eaa);}}}return _0xdcd0ea[_0xef47('0x4b')];};};Realtime['prototype'][_0xef47('0x4c')]=function(){var _0x4bd165=this;return function(_0x513281){if(_0x513281){freeIsNotKey(_0x513281,_0x4bd165[_0xef47('0x4d')],'id');for(var _0x3a0f3d=0x0,_0x58e8f8={},_0x4e4a41={};_0x3a0f3d<_0x513281[_0xef47('0x43')];_0x3a0f3d+=0x1){_0x58e8f8=_0x513281[_0x3a0f3d];if(_[_0xef47('0x41')](_0x4bd165[_0xef47('0x4d')][_0x58e8f8['id']])){_0x4bd165[_0xef47('0x4d')][_0x58e8f8['id']]=new ZohoAccount(_0x58e8f8);}else{_0x4bd165[_0xef47('0x3f')](_0x4bd165[_0xef47('0x4d')][_0x58e8f8['id']],_0x58e8f8);}}}return _0x4bd165[_0xef47('0x4d')];};};Realtime[_0xef47('0x3e')][_0xef47('0x4e')]=function(){var _0x2f5b5a=this;return function(_0x46cc64){if(_0x46cc64){freeIsNotKey(_0x46cc64,_0x2f5b5a[_0xef47('0x4f')],'id');for(var _0x109ff2=0x0,_0x3aeb85={},_0x2ff96a={};_0x109ff2<_0x46cc64['length'];_0x109ff2+=0x1){_0x3aeb85=_0x46cc64[_0x109ff2];if(_[_0xef47('0x41')](_0x2f5b5a[_0xef47('0x4f')][_0x3aeb85['id']])){_0x2f5b5a[_0xef47('0x4f')][_0x3aeb85['id']]=new DeskAccount(_0x3aeb85);}else{_0x2f5b5a[_0xef47('0x3f')](_0x2f5b5a['deskAccounts'][_0x3aeb85['id']],_0x3aeb85);}}}return _0x2f5b5a[_0xef47('0x4f')];};};Realtime[_0xef47('0x3e')]['initSugarcrmAccounts']=function(){var _0x431ecb=this;return function(_0x4fcb07){if(_0x4fcb07){freeIsNotKey(_0x4fcb07,_0x431ecb['sugarcrmAccounts'],'id');for(var _0x403230=0x0,_0x2ba8d3={},_0x7b412={};_0x403230<_0x4fcb07[_0xef47('0x43')];_0x403230+=0x1){_0x2ba8d3=_0x4fcb07[_0x403230];if(_['isUndefined'](_0x431ecb[_0xef47('0x50')][_0x2ba8d3['id']])){_0x431ecb[_0xef47('0x50')][_0x2ba8d3['id']]=new SugarcrmAccount(_0x2ba8d3);}else{_0x431ecb[_0xef47('0x3f')](_0x431ecb[_0xef47('0x50')][_0x2ba8d3['id']],_0x2ba8d3);}}}return _0x431ecb[_0xef47('0x50')];};};Realtime[_0xef47('0x3e')][_0xef47('0x51')]=function(){var _0x34f36a=this;return function(_0x57056f){if(_0x57056f){freeIsNotKey(_0x57056f,_0x34f36a[_0xef47('0x20')],'id');for(var _0x488383=0x0,_0x36eda2={},_0x18cd0a={};_0x488383<_0x57056f[_0xef47('0x43')];_0x488383+=0x1){_0x36eda2=_0x57056f[_0x488383];if(_[_0xef47('0x41')](_0x34f36a[_0xef47('0x20')][_0x36eda2['id']])){_0x34f36a[_0xef47('0x20')][_0x36eda2['id']]=new VtigerAccount(_0x36eda2);}else{_0x34f36a[_0xef47('0x3f')](_0x34f36a[_0xef47('0x20')][_0x36eda2['id']],_0x36eda2);}}}return _0x34f36a[_0xef47('0x20')];};};Realtime[_0xef47('0x3e')][_0xef47('0x52')]=function(){var _0x4ab4f1=this;return function(_0x4ea398){if(_0x4ea398){freeIsNotKey(_0x4ea398,_0x4ab4f1[_0xef47('0x21')],'id');for(var _0x460514=0x0,_0x12a61f={},_0x2ab34b={};_0x460514<_0x4ea398[_0xef47('0x43')];_0x460514+=0x1){_0x12a61f=_0x4ea398[_0x460514];if(_[_0xef47('0x41')](_0x4ab4f1['servicenowAccounts'][_0x12a61f['id']])){_0x4ab4f1[_0xef47('0x21')][_0x12a61f['id']]=new ServicenowAccount(_0x12a61f);}else{_0x4ab4f1[_0xef47('0x3f')](_0x4ab4f1[_0xef47('0x21')][_0x12a61f['id']],_0x12a61f);}}}return _0x4ab4f1[_0xef47('0x21')];};};Realtime[_0xef47('0x3e')][_0xef47('0x53')]=function(){var _0x3c1e13=this;return function(_0x4f1c0f){if(_0x4f1c0f){freeIsNotKey(_0x4f1c0f,_0x3c1e13[_0xef47('0x22')],'id');for(var _0x8b30ec=0x0,_0x289cf4={},_0x349d1a={};_0x8b30ec<_0x4f1c0f[_0xef47('0x43')];_0x8b30ec+=0x1){_0x289cf4=_0x4f1c0f[_0x8b30ec];if(_[_0xef47('0x41')](_0x3c1e13[_0xef47('0x22')][_0x289cf4['id']])){_0x3c1e13['dynamics365Accounts'][_0x289cf4['id']]=new Dynamics365Account(_0x289cf4);}else{_0x3c1e13[_0xef47('0x3f')](_0x3c1e13['dynamics365Accounts'][_0x289cf4['id']],_0x289cf4);}}}return _0x3c1e13['dynamics365Accounts'];};};Realtime[_0xef47('0x3e')][_0xef47('0x54')]=function(){var _0x573db6=this;return function(_0x40b234){if(_0x40b234){freeIsNotKey(_0x40b234,_0x573db6['freshsalesAccounts'],'id');for(var _0x117d49=0x0,_0x4f3a7d={},_0x567b1e={};_0x117d49<_0x40b234[_0xef47('0x43')];_0x117d49+=0x1){_0x4f3a7d=_0x40b234[_0x117d49];if(_[_0xef47('0x41')](_0x573db6[_0xef47('0x23')][_0x4f3a7d['id']])){_0x573db6['freshsalesAccounts'][_0x4f3a7d['id']]=new FreshsalesAccount(_0x4f3a7d);}else{_0x573db6[_0xef47('0x3f')](_0x573db6[_0xef47('0x23')][_0x4f3a7d['id']],_0x4f3a7d);}}}return _0x573db6['freshsalesAccounts'];};};Realtime['prototype'][_0xef47('0x55')]=function(){var _0x52e799=this;return function(_0x46c6ac){for(var _0x500fb2=0x0;_0x500fb2<_0x46c6ac[_0xef47('0x43')];_0x500fb2+=0x1){_[_0xef47('0x56')](_0x52e799[_0xef47('0x16')][_0x46c6ac[_0x500fb2][_0xef47('0x27')]],_0x46c6ac[_0x500fb2]);}return _0x52e799[_0xef47('0x16')];};};Realtime['prototype'][_0xef47('0x57')]=function(){var _0x2a8366=this;return function(_0x4e2c7f){clearVoiceQueues(_0x2a8366[_0xef47('0x16')]);if(_0x4e2c7f){_0x4e2c7f=_['groupBy'](_0x4e2c7f,_0xef47('0x58'));for(var _0x113baf in _0x4e2c7f){if(_0x4e2c7f[_0xef47('0x2a')](_0x113baf)){var _0x5ab3d0={};for(var _0x5ac971=0x0;_0x5ac971<_0x4e2c7f[_0x113baf]['length'];_0x5ac971+=0x1){var _0x309338=_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x59')];if(_0x2a8366[_0xef47('0x16')][_0x309338]){if(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x5a')]){_0x2a8366['voiceQueues'][_0x309338][_0xef47('0x30')]+=0x1;}if(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x5b')]){_0x2a8366['voiceQueues'][_0x309338]['abandoned']+=0x1;}_0x2a8366[_0xef47('0x16')][_0x309338][_0xef47('0x2c')]+=moment(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x5c')])[_0xef47('0x5d')](moment(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x5e')]),_0xef47('0x5f'))||0x0;if(_0x5ac971===_0x4e2c7f[_0x113baf][_0xef47('0x43')]-0x1){_0x2a8366[_0xef47('0x16')][_0x309338][_0xef47('0x2d')]+=moment(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x60')]||_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x61')]||_0x4e2c7f[_0x113baf][_0x5ac971]['queuecallerexitAt'])['diff'](moment(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x5e')]),'seconds')||0x0;_0x2a8366[_0xef47('0x16')][_0x309338][_0xef47('0x2b')]+=0x1;if(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x62')]){_0x2a8366[_0xef47('0x16')][_0x309338][_0xef47('0x63')]+=0x1;_0x2a8366[_0xef47('0x16')][_0x309338][_0xef47('0x64')]+=moment(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x60')])[_0xef47('0x5d')](moment(_0x4e2c7f[_0x113baf][_0x5ac971][_0xef47('0x5c')]),_0xef47('0x5f'))||0x0;}}else{_0x2a8366[_0xef47('0x16')][_0x309338][_0xef47('0x2d')]+=_0x2a8366[_0xef47('0x16')][_0x309338]['sumHoldTime']||0x0;}}}}}}return _0x2a8366[_0xef47('0x16')];};};Realtime[_0xef47('0x3e')][_0xef47('0x65')]=function(){var _0x130ea5=this;return function(_0x4563ac){clearVoiceCallReports(_0x130ea5['outbound']);if(_0x4563ac){for(var _0x1902ec=0x0;_0x1902ec<_0x4563ac[_0xef47('0x43')];_0x1902ec+=0x1){_0x130ea5[_0xef47('0x1a')]['total']+=0x1;_0x130ea5[_0xef47('0x1a')]['sumDuration']+=_0x4563ac[_0x1902ec][_0xef47('0x66')];if(_0x4563ac[_0x1902ec][_0xef47('0x67')]==='ANSWERED'){_0x130ea5[_0xef47('0x1a')]['answered']+=0x1;_0x130ea5[_0xef47('0x1a')]['sumHoldTime']+=_0x4563ac[_0x1902ec][_0xef47('0x66')]-_0x4563ac[_0x1902ec][_0xef47('0x68')]||0x0;_0x130ea5[_0xef47('0x1a')][_0xef47('0x64')]+=_0x4563ac[_0x1902ec][_0xef47('0x68')];}}}return _0x130ea5[_0xef47('0x1a')];};};Realtime[_0xef47('0x3e')]['initCampaigns']=function(){var _0x4cdf41=this;return function(_0x39e029){if(_0x39e029){freeIsNotKey(_0x39e029,_0x4cdf41[_0xef47('0x18')],'name');for(var _0x57d576=0x0,_0x410bf5={};_0x57d576<_0x39e029[_0xef47('0x43')];_0x57d576+=0x1){_0x410bf5=_0x39e029[_0x57d576];if(_[_0xef47('0x41')](_0x4cdf41[_0xef47('0x18')][_0x410bf5['name']])){_0x4cdf41['campaigns'][_0x410bf5[_0xef47('0x27')]]=new Campaign(_0x410bf5);}else{_0x4cdf41[_0xef47('0x3f')](_0x4cdf41[_0xef47('0x18')][_0x410bf5[_0xef47('0x27')]],_0x410bf5);_0x4cdf41['campaigns'][_0x410bf5[_0xef47('0x27')]]['dialQueueProject']=_0x410bf5[_0xef47('0x69')]?_0x410bf5[_0xef47('0x69')][_0xef47('0x27')]:undefined;}}}return _0x4cdf41[_0xef47('0x18')];};};Realtime[_0xef47('0x3e')][_0xef47('0x6a')]=function(){var _0x387eb9=this;return function(_0x398114){if(_0x398114){freeIsNotKey(_0x398114,_0x387eb9['voiceExtensions'],'id');for(var _0x385842=0x0,_0x306f2a={};_0x385842<_0x398114[_0xef47('0x43')];_0x385842+=0x1){_0x306f2a=_0x398114[_0x385842];if(_[_0xef47('0x41')](_0x387eb9[_0xef47('0x1b')][_0x306f2a['id']])){_0x387eb9[_0xef47('0x1b')][_0x306f2a['id']]=new VoiceExtension(_0x306f2a);}else{_0x387eb9[_0xef47('0x3f')](_0x387eb9['voiceExtensions'][_0x306f2a['id']],_0x306f2a);}}}return _0x387eb9[_0xef47('0x1b')];};};Realtime['prototype'][_0xef47('0x6b')]=function(){var _0x521012=this;return function(_0x4e36c6){clearCampaigns(_0x521012[_0xef47('0x18')]);for(var _0x3402d6=0x0;_0x3402d6<_0x4e36c6[_0xef47('0x43')];_0x3402d6+=0x1){_[_0xef47('0x56')](_0x521012[_0xef47('0x18')][_0x4e36c6[_0x3402d6][_0xef47('0x27')]],_0x4e36c6[_0x3402d6]);}return _0x521012[_0xef47('0x18')];};};Realtime[_0xef47('0x3e')][_0xef47('0x6c')]=function(){var _0x29f734=this;return function(_0x3cdc82){if(_0x3cdc82){freeIsNotKey(_0x3cdc82,_0x29f734[_0xef47('0x6d')],'id');for(var _0xb8a584=0x0,_0xc966e7={},_0x4acbb1={};_0xb8a584<_0x3cdc82[_0xef47('0x43')];_0xb8a584+=0x1){_0xc966e7=_0x3cdc82[_0xb8a584];if(_[_0xef47('0x41')](_0x29f734[_0xef47('0x6d')][_0xc966e7['id']])){_0x29f734[_0xef47('0x6d')][_0xc966e7['id']]=new FaxAccount(_0xc966e7);}else{_0x29f734['mergeFromDatabase'](_0x29f734['faxAccounts'][_0xc966e7['id']],_0xc966e7);}}}return _0x29f734[_0xef47('0x6d')];};};module[_0xef47('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 21d5112..d31bb0b 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 _0x2806=['custom:voiceQueueReport','voiceQueueReport','bind','voiceAgentReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','find','accountcode','name','interface','SIP/%s','prototype','length','findAgent','connectedlinenum','assigned','lastAssignedTo','format','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','match','keys','getCallType','split','getAgentByInternal','calleridnum','outbound','internal','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','callerid','xcally-motion-preview','originatecalleridnum','channel','destinationchannel','disposition','\x22%s\x22\x20<%s>','transfers','linkedid','uniqueid','isNil','UserId','membername','create','monitor','monitors','createdAt','calleridname','isArray','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled'];(function(_0x5cc58d,_0x540989){var _0x102a94=function(_0x58ae99){while(--_0x58ae99){_0x5cc58d['push'](_0x5cc58d['shift']());}};_0x102a94(++_0x540989);}(_0x2806,0x195));var _0x6280=function(_0x3c3cf5,_0x2923bc){_0x3c3cf5=_0x3c3cf5-0x0;var _0x402fb4=_0x2806[_0x3c3cf5];return _0x402fb4;};'use strict';var _=require(_0x6280('0x0'));var moment=require('moment');var util=require(_0x6280('0x1'));var config=require(_0x6280('0x2'));var ami=require(_0x6280('0x3'));var RpcVoiceAgentReport=require(_0x6280('0x4'));var RpcVoiceCallReport=require(_0x6280('0x5'));var RpcVoiceDialReport=require(_0x6280('0x6'));var RpcMemberReport=require(_0x6280('0x7'));var RpcVoiceQueueReport=require(_0x6280('0x8'));var RpcVoiceRecording=require(_0x6280('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x6280('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x6280('0xb'));var VoiceDialReport=require(_0x6280('0xc'));var UserReport=require(_0x6280('0xd'));function Report(_0x1ea2e7){this[_0x6280('0xe')]=_0x1ea2e7;this['agents']=_0x1ea2e7[_0x6280('0xf')];this['telephones']=_0x1ea2e7[_0x6280('0x10')];}Report['prototype'][_0x6280('0x11')]=function(_0x307e42){var _0x51fda1=new VoiceQueueReport(this[_0x6280('0xe')]);var _0x370884=new VoiceAgentReport(this[_0x6280('0xe')]);var _0x1c6b95=new VoiceDialReport(this['realtime']);var _0x2bcb8f=new VoiceCallReport(this[_0x6280('0xe')]);var _0x47e9b3=new UserReport(this[_0x6280('0xe')]);if(config[_0x6280('0x12')]&&config[_0x6280('0x12')][_0x6280('0x13')]){ami['on'](_0x6280('0x14'),this[_0x6280('0x15')][_0x6280('0x16')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x6280('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0x6280('0x17')][_0x6280('0x16')](this));ami['on']('custom:voiceDialReport',this[_0x6280('0x18')]['bind'](this));ami['on'](_0x6280('0x19'),this['blindTransfer'][_0x6280('0x16')](this));ami['on'](_0x6280('0x1a'),this[_0x6280('0x1b')][_0x6280('0x16')](this));}};Report['prototype']['findAgent']=function(_0x30044a){var _0x30e73e;_0x30e73e=_[_0x6280('0x1c')](this[_0x6280('0xf')],function(_0x272009){return _0x272009[_0x6280('0x1d')]==_0x30044a||_0x272009[_0x6280('0x1e')]==_0x30044a;});if(_['isNil'](_0x30e73e)){var _0x3686e8=_[_0x6280('0x1c')](this['telephones'],function(_0x1312f0){return _0x1312f0['accountcode']==_0x30044a||_0x1312f0[_0x6280('0x1e')]==_0x30044a;});if(_0x3686e8){_0x30e73e=_[_0x6280('0x1c')](this[_0x6280('0xf')],function(_0xdd7729){return _0xdd7729[_0x6280('0x1f')]==util['format'](_0x6280('0x20'),_0x3686e8[_0x6280('0x1e')]);});}}return _0x30e73e;};Report[_0x6280('0x21')][_0x6280('0x15')]=function(_0x32cc5b){for(var _0x5aa6cb=0x0;_0x5aa6cb<_0x32cc5b[_0x6280('0x22')];_0x5aa6cb+=0x1){var _0x4519ae=this[_0x6280('0x23')](_0x32cc5b[_0x5aa6cb][_0x6280('0x24')]);if(_0x4519ae){_0x32cc5b[_0x5aa6cb][_0x6280('0x1d')]=_0x4519ae[_0x6280('0x1d')];_0x32cc5b[_0x5aa6cb][_0x6280('0x25')]=!![];_0x32cc5b[_0x5aa6cb][_0x6280('0x26')]=_0x4519ae[_0x6280('0x1e')];_0x32cc5b[_0x5aa6cb][_0x6280('0x1f')]=_['isNil'](_0x4519ae[_0x6280('0x1f')])?util[_0x6280('0x27')](_0x6280('0x20'),_0x4519ae[_0x6280('0x1e')]):_0x4519ae[_0x6280('0x1f')];if(_0x32cc5b[_0x5aa6cb]['queuecallercomplete']){_0x32cc5b[_0x5aa6cb][_0x6280('0x28')]=moment()['format'](_0x6280('0x29'));}if(_0x32cc5b[_0x5aa6cb][_0x6280('0x2a')]){_0x32cc5b[_0x5aa6cb]['queuecallerexitAt']=moment()[_0x6280('0x27')](_0x6280('0x29'));}RpcMemberReport[_0x6280('0x15')](_0x32cc5b[_0x5aa6cb]);}RpcVoiceQueueReport['create'](_0x32cc5b[_0x5aa6cb]);}};function extractCalleridNumber(_0x1ed794){var _0x4ae34c=_0x1ed794[_0x6280('0x2b')](/<(.*?)>/);return _0x4ae34c?_0x4ae34c[0x1]:_0x1ed794;}Report[_0x6280('0x21')]['getAgentByInternal']=function(_0x382223){for(var _0x576622=0x0;_0x576622','calleridname','transfers','linkedid','uniqueid','getCallType','UserId','membername','monitors','length','monitorFilename','createdAt','exten','xcally-motion-preview','connectedlinenum','xcally-motion-dialer','create','startsWith','Local','indexOf','mobile','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport'];(function(_0x3df186,_0x12592c){var _0x5440fc=function(_0x2a7a70){while(--_0x2a7a70){_0x3df186['push'](_0x3df186['shift']());}};_0x5440fc(++_0x12592c);}(_0x91dd,0x1c7));var _0xd91d=function(_0x1bd1aa,_0x22d6ab){_0x1bd1aa=_0x1bd1aa-0x0;var _0x381579=_0x91dd[_0x1bd1aa];return _0x381579;};'use strict';var _=require(_0xd91d('0x0'));var moment=require(_0xd91d('0x1'));var util=require(_0xd91d('0x2'));var config=require(_0xd91d('0x3'));var ami=require(_0xd91d('0x4'));var RpcVoiceAgentReport=require(_0xd91d('0x5'));var RpcVoiceCallReport=require(_0xd91d('0x6'));var RpcVoiceDialReport=require(_0xd91d('0x7'));var RpcMemberReport=require(_0xd91d('0x8'));var RpcVoiceQueueReport=require(_0xd91d('0x9'));var RpcVoiceRecording=require(_0xd91d('0xa'));var RpcVoiceTransferReport=require(_0xd91d('0xb'));var VoiceQueueReport=require(_0xd91d('0xc'));var VoiceCallReport=require(_0xd91d('0xd'));var VoiceAgentReport=require(_0xd91d('0xe'));var VoiceDialReport=require(_0xd91d('0xf'));var UserReport=require(_0xd91d('0x10'));function Report(_0x49d210){this[_0xd91d('0x11')]=_0x49d210;this[_0xd91d('0x12')]=_0x49d210[_0xd91d('0x12')];this[_0xd91d('0x13')]=_0x49d210['telephones'];}Report[_0xd91d('0x14')][_0xd91d('0x15')]=function(_0x2bf434){var _0x2119d5=new VoiceQueueReport(this[_0xd91d('0x11')]);var _0x16d26e=new VoiceAgentReport(this[_0xd91d('0x11')]);var _0x22453e=new VoiceDialReport(this[_0xd91d('0x11')]);var _0x575a23=new VoiceCallReport(this['realtime']);var _0x14a3c2=new UserReport(this[_0xd91d('0x11')]);if(config[_0xd91d('0x16')]&&config[_0xd91d('0x16')][_0xd91d('0x17')]){ami['on'](_0xd91d('0x18'),this[_0xd91d('0x19')]['bind'](this));ami['on'](_0xd91d('0x1a'),this[_0xd91d('0x1b')][_0xd91d('0x1c')](this));ami['on'](_0xd91d('0x1d'),this[_0xd91d('0x1e')][_0xd91d('0x1c')](this));ami['on']('custom:voiceDialReport',this[_0xd91d('0x1f')][_0xd91d('0x1c')](this));ami['on'](_0xd91d('0x20'),this[_0xd91d('0x21')][_0xd91d('0x1c')](this));ami['on'](_0xd91d('0x22'),this['attendedTransfer'][_0xd91d('0x1c')](this));}};Report[_0xd91d('0x14')][_0xd91d('0x23')]=function(_0x27ffd6){var _0xd7f9f6;_0xd7f9f6=_[_0xd91d('0x24')](this['agents'],function(_0x576c58){return _0x576c58[_0xd91d('0x25')]==_0x27ffd6||_0x576c58[_0xd91d('0x26')]==_0x27ffd6;});if(_['isNil'](_0xd7f9f6)){var _0x7f5dc2=_[_0xd91d('0x24')](this['telephones'],function(_0x453f7e){return _0x453f7e[_0xd91d('0x25')]==_0x27ffd6||_0x453f7e[_0xd91d('0x26')]==_0x27ffd6;});if(_0x7f5dc2){_0xd7f9f6=_['find'](this[_0xd91d('0x12')],function(_0x14d47a){return _0x14d47a[_0xd91d('0x27')]==util[_0xd91d('0x28')]('SIP/%s',_0x7f5dc2[_0xd91d('0x26')]);});}}return _0xd7f9f6;};Report[_0xd91d('0x14')][_0xd91d('0x19')]=function(_0x27f73a){for(var _0x221933=0x0;_0x221933<_0x27f73a['length'];_0x221933+=0x1){var _0x7bb9f7=this['findAgent'](_0x27f73a[_0x221933]['connectedlinenum']);if(_0x7bb9f7){_0x27f73a[_0x221933][_0xd91d('0x25')]=_0x7bb9f7['accountcode'];_0x27f73a[_0x221933][_0xd91d('0x29')]=!![];_0x27f73a[_0x221933][_0xd91d('0x2a')]=_0x7bb9f7[_0xd91d('0x26')];_0x27f73a[_0x221933][_0xd91d('0x27')]=_[_0xd91d('0x2b')](_0x7bb9f7[_0xd91d('0x27')])?util['format'](_0xd91d('0x2c'),_0x7bb9f7[_0xd91d('0x26')]):_0x7bb9f7[_0xd91d('0x27')];if(_0x27f73a[_0x221933][_0xd91d('0x2d')]){_0x27f73a[_0x221933][_0xd91d('0x2e')]=moment()[_0xd91d('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x27f73a[_0x221933][_0xd91d('0x2f')]){_0x27f73a[_0x221933][_0xd91d('0x30')]=moment()[_0xd91d('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x27f73a[_0x221933]);}RpcVoiceQueueReport['create'](_0x27f73a[_0x221933]);}};function extractCalleridNumber(_0x345efa){var _0x27e769=_0x345efa['match'](/<(.*?)>/);return _0x27e769?_0x27e769[0x1]:_0x345efa;}Report['prototype'][_0xd91d('0x31')]=function(_0x3d1336){for(var _0x24af03=0x0;_0x24af030x0?_0x263a3d:0x0;this['voiceQueues'][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x2f')]=this['voiceQueues'][_0x2badea[_0x99e7('0x67')]]['talking']>_[_0x99e7('0x6e')](_0x2badea[_0x99e7('0x6f')])?_['toNumber'](_0x2badea[_0x99e7('0x6f')]):this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x2f')];this['emitVoiceQueueSummary'](this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]],'queuesummary');}logger[_0x99e7('0x68')](_0x99e7('0x70'),util[_0x99e7('0x40')](this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]],{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')]('custom:queuesummary',this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]]);}}}catch(_0x27e030){logger[_0x99e7('0x3e')](_0x99e7('0x66'),util[_0x99e7('0x40')](_0x27e030,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x16')]=function(_0x2a2383){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x99e7('0x40')](_0x2a2383,{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')](_0x99e7('0x71'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x18')]=function(_0x444149){try{if(this['isNotNull'](_0x444149)){logger[_0x99e7('0x68')](_0x99e7('0x72'),_0x444149['uniqueid'],util[_0x99e7('0x40')](_0x444149,{'showHidden':![],'depth':null}));if(_[_0x99e7('0x73')](this[_0x99e7('0xf')][_0x444149[_0x99e7('0x48')]]))this[_0x99e7('0xf')][_0x444149[_0x99e7('0x48')]]=[];if(_[_0x99e7('0x73')](this['channels'][_0x444149[_0x99e7('0x48')]]))this[_0x99e7('0x35')][_0x444149[_0x99e7('0x48')]]={};var _0x2a337b=new QueueReport();_0x2a337b[_0x99e7('0x4b')]=_0x444149[_0x99e7('0x67')];_0x2a337b[_0x99e7('0x51')]=this[_0x99e7('0x12')][_0x2a337b[_0x99e7('0x4b')]]&&this[_0x99e7('0x12')][_0x2a337b[_0x99e7('0x4b')]][_0x99e7('0x51')]?this[_0x99e7('0x12')][_0x2a337b[_0x99e7('0x4b')]]['type']||_0x99e7('0x52'):_0x99e7('0x52');_0x2a337b[_0x99e7('0x67')]=_0x444149[_0x99e7('0x67')];_0x2a337b[_0x99e7('0x74')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a337b[_0x99e7('0x75')]=_0x444149[_0x99e7('0x75')];_0x2a337b[_0x99e7('0x76')]=_0x444149[_0x99e7('0x76')];_0x2a337b[_0x99e7('0x48')]=_0x444149['uniqueid'];_0x2a337b[_0x99e7('0x77')]=this['channels'][_0x444149['uniqueid']][_0x99e7('0x77')];logger[_0x99e7('0x6a')](_0x99e7('0x78'),_0x2a337b[_0x99e7('0x4b')],_0x2a337b[_0x99e7('0x51')]);_[_0x99e7('0x79')](_0x2a337b,_[_0x99e7('0x7a')](_0x444149,_[_0x99e7('0x7b')](_0x2a337b)));this[_0x99e7('0xf')][_0x444149[_0x99e7('0x48')]][_0x99e7('0x7c')](_0x2a337b);this[_0x99e7('0x35')][_0x444149[_0x99e7('0x48')]]=_0x2a337b;this[_0x99e7('0x46')](_0x2a337b,_0x99e7('0x17'));}}catch(_0x3b8921){logger[_0x99e7('0x3e')](_0x99e7('0x72'),_0x444149['uniqueid'],util[_0x99e7('0x40')](_0x3b8921,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x4f7e47){try{if(this[_0x99e7('0x5f')](_0x4f7e47)){logger[_0x99e7('0x68')](_0x99e7('0x7d'),_0x4f7e47[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x4f7e47,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4f7e47['uniqueid']]){var _0x1a640d=_['last'](this[_0x99e7('0xf')][_0x4f7e47[_0x99e7('0x48')]]);_0x1a640d[_0x99e7('0x7e')]=![];_0x1a640d[_0x99e7('0x7f')]=null;_0x1a640d[_0x99e7('0x80')]=_0x4f7e47[_0x99e7('0x80')];_0x1a640d[_0x99e7('0x81')]=_0x4f7e47[_0x99e7('0x81')];_0x1a640d['queuecallerabandon']=!![];_0x1a640d[_0x99e7('0x82')]=moment()[_0x99e7('0x49')](_0x99e7('0x83'));_0x1a640d['queuecallerexitreason']=_0x99e7('0x84');_0x1a640d['lastAssignedTo']=null;logger[_0x99e7('0x6a')](_0x99e7('0x85'),_0x1a640d['name'],_0x1a640d[_0x99e7('0x51')]);this[_0x99e7('0x35')][_0x4f7e47['uniqueid']]=_0x1a640d;this[_0x99e7('0x43')](_0x1a640d,_0x99e7('0x19'));}}}catch(_0x3a8da6){logger[_0x99e7('0x3e')](_0x99e7('0x7d'),_0x4f7e47[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x3a8da6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x1b')]=function(_0x4cf848){try{if(this[_0x99e7('0x5f')](_0x4cf848)){logger[_0x99e7('0x68')](_0x99e7('0x86'),_0x4cf848[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x4cf848,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x4cf848['uniqueid']]){var _0x1b266b=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x4cf848[_0x99e7('0x48')]]);_0x1b266b[_0x99e7('0x88')]=moment()[_0x99e7('0x49')](_0x99e7('0x83'));_0x1b266b[_0x99e7('0x89')]=_0x4cf848[_0x99e7('0x89')];_0x1b266b['connectedlinename']=_0x4cf848['connectedlinename'];logger[_0x99e7('0x6a')](_0x99e7('0x8a'),_0x1b266b[_0x99e7('0x4b')],_0x1b266b['type'],_0x4cf848['connectedlinenum'],_0x4cf848[_0x99e7('0x8b')]);this[_0x99e7('0x35')][_0x4cf848[_0x99e7('0x48')]]=_0x1b266b;this[_0x99e7('0x46')](_0x1b266b,'queuecallerleave');}}}catch(_0x1d0355){logger['error'](_0x99e7('0x86'),_0x4cf848[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1d0355,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x99e7('0x8c')]=function(_0x3e30c2){try{if(this[_0x99e7('0x5f')](_0x3e30c2)){logger[_0x99e7('0x68')](_0x99e7('0x8d'),_0x3e30c2[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x3e30c2,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x3e30c2[_0x99e7('0x48')]]){var _0x2bbf94=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x3e30c2[_0x99e7('0x48')]]);_0x2bbf94[_0x99e7('0x7e')]=!![];_0x2bbf94[_0x99e7('0x8e')]='COMPLETEDBYAGENT';logger[_0x99e7('0x6a')](_0x99e7('0x8f'),_0x2bbf94[_0x99e7('0x4b')],_0x2bbf94[_0x99e7('0x51')]);}}}catch(_0x342c72){logger['error'](_0x99e7('0x8d'),_0x3e30c2[_0x99e7('0x48')],util['inspect'](_0x342c72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x1d')]=function(_0x3ab3a3){try{if(this[_0x99e7('0x5f')](_0x3ab3a3)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x3ab3a3['uniqueid'],util[_0x99e7('0x40')](_0x3ab3a3,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x3ab3a3['uniqueid']]){var _0x43bdf1=_['last'](this['queueReports'][_0x3ab3a3['uniqueid']]);_0x43bdf1[_0x99e7('0x19')]=![];_0x43bdf1[_0x99e7('0x82')]=null;_0x43bdf1[_0x99e7('0x90')]=!![];_0x43bdf1[_0x99e7('0x91')]=_0x3ab3a3[_0x99e7('0x92')];_0x43bdf1[_0x99e7('0x80')]=_0x3ab3a3[_0x99e7('0x80')];_0x43bdf1[_0x99e7('0x7e')]=!![];_0x43bdf1[_0x99e7('0x93')]=![];_0x43bdf1['queuecallerexitAt']=null;if(!_0x43bdf1[_0x99e7('0x94')]){if(_0x3ab3a3['reason']==_0x99e7('0x94')){_0x43bdf1[_0x99e7('0x8e')]='COMPLETED';logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x43bdf1[_0x99e7('0x4b')],_0x43bdf1['type']);}else{if(_['startsWith'](_0x3ab3a3[_0x99e7('0x3a')][_0x99e7('0x95')](),_0x99e7('0x96'))){if(this['queueReports'][_0x3ab3a3['linkedid']]){var _0x43452c=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x3ab3a3[_0x99e7('0x97')]]);_0x43452c[_0x99e7('0x7e')]=![];_0x43452c[_0x99e7('0x93')]=!![];_0x43452c['queuecallerexitAt']=moment(_0x43bdf1['queuecallerjoinAt'])['add'](_0x3ab3a3['holdtime'],_0x99e7('0x98'))['format'](_0x99e7('0x83'));_0x43452c[_0x99e7('0x8e')]=_0x99e7('0x99');_0x43452c[_0x99e7('0x94')]=!![];_0x43452c[_0x99e7('0x9a')]=_0x99e7('0x9b');_0x43452c[_0x99e7('0x9c')]=_0x3ab3a3[_0x99e7('0x9d')];_0x43452c[_0x99e7('0x9e')]=_0x3ab3a3[_0x99e7('0x48')];logger[_0x99e7('0x6a')](_0x99e7('0x9f'),_0x43452c['name'],_0x43452c[_0x99e7('0x51')]);var _0x213e38=this[_0x99e7('0xf')][_0x3ab3a3[_0x99e7('0x97')]];this['queueReports'][_0x3ab3a3[_0x99e7('0x97')]]=this['queueReports'][_0x3ab3a3['uniqueid']];this[_0x99e7('0xf')][_0x3ab3a3[_0x99e7('0x48')]]=_0x213e38;}}else{_0x43bdf1[_0x99e7('0x8e')]=_0x99e7('0xa0')+_0x3ab3a3[_0x99e7('0xa1')][_0x99e7('0xa2')]();logger[_0x99e7('0x6a')](_0x99e7('0xa3'),_0x43bdf1[_0x99e7('0x4b')],_0x43bdf1[_0x99e7('0x51')],_0x43bdf1['queuecallerexitreason']);}}}this['channels'][_0x3ab3a3['uniqueid']]=_0x43bdf1;this['emitVoiceQueueChannelRemove'](_0x43bdf1,'agentcomplete');}}}catch(_0x2953a6){logger['error'](_0x99e7('0xa4'),_0x3ab3a3[_0x99e7('0x48')],util['inspect'](_0x2953a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')]['syncVarSet']=function(_0x1e0fbc){try{if(this['isNotNull'](_0x1e0fbc)){logger[_0x99e7('0x68')](_0x99e7('0xa5'),_0x1e0fbc[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1e0fbc,{'showHidden':![],'depth':null}));this[_0x99e7('0xa6')](_0x1e0fbc['uniqueid'],_['keys'](_0x1e0fbc['variable'])[0x0],_0x1e0fbc[_0x99e7('0xa7')]);if(this[_0x99e7('0xf')][_0x1e0fbc[_0x99e7('0x48')]]){var _0x1653a1=_['last'](this[_0x99e7('0xf')][_0x1e0fbc[_0x99e7('0x48')]]);if(_0x1653a1){if(this[_0x99e7('0x5f')](_0x1e0fbc['variable'])&&this[_0x99e7('0x5f')](_0x1e0fbc[_0x99e7('0xa8')][_0x99e7('0xa9')])){switch(_0x1e0fbc[_0x99e7('0xa7')]){case _0x99e7('0xaa'):_0x1653a1[_0x99e7('0x93')]=![];_0x1653a1[_0x99e7('0xab')]=null;break;case _0x99e7('0xac'):_0x1653a1[_0x99e7('0xad')]=_0x99e7('0xae');_0x1653a1[_0x99e7('0x93')]=!![];_0x1653a1[_0x99e7('0xab')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1653a1['queuecallerleaveAt']=moment()['format'](_0x99e7('0x83'));logger[_0x99e7('0x68')](_0x99e7('0xaf'),_0x1e0fbc[_0x99e7('0x48')],util['inspect'](_0x1653a1,{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')]('custom:timeout',_0x1653a1);break;default:_0x1653a1[_0x99e7('0x93')]=!![];_0x1653a1[_0x99e7('0xab')]=moment()['format'](_0x99e7('0x83'));_0x1653a1[_0x99e7('0x88')]=moment()['format'](_0x99e7('0x83'));}_0x1653a1[_0x99e7('0x19')]=![];_0x1653a1[_0x99e7('0x82')]=null;_0x1653a1['queuecallerexitreason']=_0x1e0fbc['value'];this['channels'][_0x1e0fbc['uniqueid']]=_0x1653a1;this[_0x99e7('0x43')](_0x1653a1,'varset');}else if(this['isNotNull'](_0x1e0fbc[_0x99e7('0xa8')])&&this[_0x99e7('0x5f')](_0x1e0fbc[_0x99e7('0xa8')][_0x99e7('0xb0')])){if(!_0x1653a1[_0x99e7('0x19')]){_0x1653a1[_0x99e7('0x93')]=!![];_0x1653a1[_0x99e7('0xab')]=moment()[_0x99e7('0x49')](_0x99e7('0x83'));_0x1653a1['queuecallerexitreason']=_0x99e7('0xb1');_0x1653a1['queuecallerleaveAt']=moment()[_0x99e7('0x49')](_0x99e7('0x83'));this[_0x99e7('0x35')][_0x1e0fbc['uniqueid']]=_0x1653a1;}}logger['info'](_0x99e7('0xb2'),_0x1e0fbc['uniqueid'],_0x1653a1['name'],_0x1653a1[_0x99e7('0x51')],_[_0x99e7('0x7b')](_0x1e0fbc[_0x99e7('0xa8')])[0x0],_0x1e0fbc[_0x99e7('0xa7')]);_0x1653a1[_0x99e7('0x14')]=this[_0x99e7('0x14')][_0x1e0fbc[_0x99e7('0x48')]];}}}}catch(_0x1a2112){logger[_0x99e7('0x3e')](_0x99e7('0xa5'),_0x1e0fbc[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1a2112,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')]['addVariable']=function(_0x181ef3,_0x174330,_0x5919df){var _0xba0500=[_0x99e7('0xb3'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x99e7('0xb4'),_0x99e7('0xb5'),_0x99e7('0xb6'),_0x99e7('0xb7'),'rtpaudioqosrttbridged',_0x99e7('0xb8'),_0x99e7('0xb9'),_0x99e7('0xba'),'bridgepvtcallid',_0x99e7('0xbb'),_0x99e7('0xbc'),_0x99e7('0xbd'),_0x99e7('0xbe'),'membername','memberpenalty',_0x99e7('0xbf')];if(!_[_0x99e7('0x37')](_0x174330)&&!_[_0x99e7('0xc0')](_0xba0500,_0x174330)){if(_[_0x99e7('0x73')](this[_0x99e7('0x14')][_0x181ef3])){this['variables'][_0x181ef3]={};}this[_0x99e7('0x14')][_0x181ef3][_0x174330]=_0x5919df;}};VoiceQueueReport['prototype'][_0x99e7('0xc1')]=function(_0x1df6e3,_0x299ee6,_0x2135ca){var _0x3acf21={};for(var _0x96ec12=0x0;_0x96ec120x0?_0x3b3096:0x0;this[_0x9e0c('0x45')][_0x20a43a[_0x9e0c('0x69')]]['talking']=this[_0x9e0c('0x45')][_0x20a43a[_0x9e0c('0x69')]][_0x9e0c('0x31')]>_[_0x9e0c('0x6e')](_0x20a43a[_0x9e0c('0x6f')])?_['toNumber'](_0x20a43a[_0x9e0c('0x6f')]):this['voiceQueues'][_0x20a43a[_0x9e0c('0x69')]][_0x9e0c('0x31')];this[_0x9e0c('0x70')](this[_0x9e0c('0x45')][_0x20a43a['queue']],'queuesummary');}logger[_0x9e0c('0x48')](_0x9e0c('0x71'),util[_0x9e0c('0x41')](this['voiceQueues'][_0x20a43a[_0x9e0c('0x69')]],{'showHidden':![],'depth':null}));ami[_0x9e0c('0x46')](_0x9e0c('0x72'),this[_0x9e0c('0x45')][_0x20a43a[_0x9e0c('0x69')]]);}}}catch(_0x2c985d){logger[_0x9e0c('0x3e')](_0x9e0c('0x67'),util[_0x9e0c('0x41')](_0x2c985d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e0c('0xb')][_0x9e0c('0x18')]=function(_0x810a4b){logger[_0x9e0c('0x48')](_0x9e0c('0x73'),util['inspect'](_0x810a4b,{'showHidden':![],'depth':null}));ami[_0x9e0c('0x46')](_0x9e0c('0x74'),{});this[_0x9e0c('0x12')]=!![];};VoiceQueueReport[_0x9e0c('0xb')][_0x9e0c('0x1a')]=function(_0x59cc92){try{if(this['isNotNull'](_0x59cc92)){logger['debug'](_0x9e0c('0x75'),_0x59cc92[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x59cc92,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9e0c('0xf')][_0x59cc92[_0x9e0c('0x76')]]))this[_0x9e0c('0xf')][_0x59cc92[_0x9e0c('0x76')]]=[];if(_['isUndefined'](this[_0x9e0c('0x37')][_0x59cc92['uniqueid']]))this[_0x9e0c('0x37')][_0x59cc92[_0x9e0c('0x76')]]={};var _0x1dcb1b=new QueueReport();_0x1dcb1b[_0x9e0c('0x4b')]=_0x59cc92[_0x9e0c('0x69')];_0x1dcb1b['type']=this[_0x9e0c('0x45')][_0x1dcb1b[_0x9e0c('0x4b')]]&&this[_0x9e0c('0x45')][_0x1dcb1b[_0x9e0c('0x4b')]][_0x9e0c('0x52')]?this[_0x9e0c('0x45')][_0x1dcb1b['name']]['type']||_0x9e0c('0x53'):'inbound';_0x1dcb1b[_0x9e0c('0x69')]=_0x59cc92['queue'];_0x1dcb1b[_0x9e0c('0x77')]=moment()[_0x9e0c('0x49')](_0x9e0c('0x78'));_0x1dcb1b['position']=_0x59cc92[_0x9e0c('0x79')];_0x1dcb1b[_0x9e0c('0x7a')]=_0x59cc92[_0x9e0c('0x7a')];_0x1dcb1b[_0x9e0c('0x76')]=_0x59cc92[_0x9e0c('0x76')];_0x1dcb1b[_0x9e0c('0x7b')]=this[_0x9e0c('0x37')][_0x59cc92[_0x9e0c('0x76')]][_0x9e0c('0x7b')];logger[_0x9e0c('0x6a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1dcb1b[_0x9e0c('0x4b')],_0x1dcb1b[_0x9e0c('0x52')]);_[_0x9e0c('0x7c')](_0x1dcb1b,_[_0x9e0c('0x7d')](_0x59cc92,_['keys'](_0x1dcb1b)));this['queueReports'][_0x59cc92[_0x9e0c('0x76')]][_0x9e0c('0x7e')](_0x1dcb1b);this[_0x9e0c('0x37')][_0x59cc92[_0x9e0c('0x76')]]=_0x1dcb1b;this[_0x9e0c('0x47')](_0x1dcb1b,_0x9e0c('0x19'));}}catch(_0x252286){logger[_0x9e0c('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x59cc92['uniqueid'],util[_0x9e0c('0x41')](_0x252286,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x279138){try{if(this['isNotNull'](_0x279138)){logger[_0x9e0c('0x48')](_0x9e0c('0x7f'),_0x279138[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x279138,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x279138[_0x9e0c('0x76')]]){var _0x4dd7f3=_[_0x9e0c('0x80')](this[_0x9e0c('0xf')][_0x279138[_0x9e0c('0x76')]]);_0x4dd7f3['queuecallercomplete']=![];_0x4dd7f3['queuecallercompleteAt']=null;_0x4dd7f3['holdtime']=_0x279138[_0x9e0c('0x81')];_0x4dd7f3[_0x9e0c('0x82')]=_0x279138[_0x9e0c('0x82')];_0x4dd7f3[_0x9e0c('0x1b')]=!![];_0x4dd7f3['queuecallerabandonAt']=moment()[_0x9e0c('0x49')](_0x9e0c('0x78'));_0x4dd7f3['queuecallerexitreason']=_0x9e0c('0x83');_0x4dd7f3[_0x9e0c('0x84')]=null;logger[_0x9e0c('0x6a')](_0x9e0c('0x85'),_0x4dd7f3['name'],_0x4dd7f3[_0x9e0c('0x52')]);this['channels'][_0x279138[_0x9e0c('0x76')]]=_0x4dd7f3;this[_0x9e0c('0x86')](_0x4dd7f3,_0x9e0c('0x1b'));}}}catch(_0x3407f9){logger[_0x9e0c('0x3e')](_0x9e0c('0x7f'),_0x279138[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x3407f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e0c('0xb')][_0x9e0c('0x1f')]=function(_0xd5f2a0){try{if(this[_0x9e0c('0x68')](_0xd5f2a0)){logger[_0x9e0c('0x48')](_0x9e0c('0x87'),_0xd5f2a0[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0xd5f2a0,{'showHidden':![],'depth':null}));if(this[_0x9e0c('0xf')][_0xd5f2a0[_0x9e0c('0x76')]]){var _0x5333ee=_['last'](this['queueReports'][_0xd5f2a0[_0x9e0c('0x76')]]);_0x5333ee[_0x9e0c('0x88')]=moment()['format'](_0x9e0c('0x78'));_0x5333ee['connectedlinenum']=_0xd5f2a0[_0x9e0c('0x89')];_0x5333ee[_0x9e0c('0x8a')]=_0xd5f2a0[_0x9e0c('0x8a')];logger[_0x9e0c('0x6a')](_0x9e0c('0x8b'),_0x5333ee[_0x9e0c('0x4b')],_0x5333ee['type'],_0xd5f2a0['connectedlinenum'],_0xd5f2a0[_0x9e0c('0x8a')]);this['channels'][_0xd5f2a0[_0x9e0c('0x76')]]=_0x5333ee;this[_0x9e0c('0x47')](_0x5333ee,_0x9e0c('0x1e'));}}}catch(_0x31ed71){logger['error'](_0x9e0c('0x87'),_0xd5f2a0[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x31ed71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e0c('0xb')]['syncAgentConnect']=function(_0xec1d0f){try{if(this[_0x9e0c('0x68')](_0xec1d0f)){logger['debug'](_0x9e0c('0x8c'),_0xec1d0f[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0xec1d0f,{'showHidden':![],'depth':null}));if(this[_0x9e0c('0xf')][_0xec1d0f['uniqueid']]){var _0x2aed69=_[_0x9e0c('0x80')](this[_0x9e0c('0xf')][_0xec1d0f['uniqueid']]);_0x2aed69[_0x9e0c('0x8d')]=!![];_0x2aed69[_0x9e0c('0x8e')]=_0x9e0c('0x8f');logger[_0x9e0c('0x6a')](_0x9e0c('0x90'),_0x2aed69[_0x9e0c('0x4b')],_0x2aed69[_0x9e0c('0x52')]);}}}catch(_0x236328){logger[_0x9e0c('0x3e')](_0x9e0c('0x8c'),_0xec1d0f[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x236328,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x3d40cb){try{if(this[_0x9e0c('0x68')](_0x3d40cb)){logger[_0x9e0c('0x48')](_0x9e0c('0x91'),_0x3d40cb['uniqueid'],util[_0x9e0c('0x41')](_0x3d40cb,{'showHidden':![],'depth':null}));if(this[_0x9e0c('0xf')][_0x3d40cb[_0x9e0c('0x76')]]){var _0x4b824a=_['last'](this['queueReports'][_0x3d40cb['uniqueid']]);_0x4b824a[_0x9e0c('0x1b')]=![];_0x4b824a[_0x9e0c('0x92')]=null;_0x4b824a['assigned']=!![];_0x4b824a[_0x9e0c('0x84')]=_0x3d40cb[_0x9e0c('0x93')];_0x4b824a[_0x9e0c('0x81')]=_0x3d40cb[_0x9e0c('0x81')];_0x4b824a[_0x9e0c('0x8d')]=!![];_0x4b824a[_0x9e0c('0x94')]=![];_0x4b824a[_0x9e0c('0x95')]=null;if(!_0x4b824a[_0x9e0c('0x96')]){if(_0x3d40cb['reason']=='transfer'){_0x4b824a[_0x9e0c('0x8e')]='COMPLETED';logger[_0x9e0c('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x4b824a['name'],_0x4b824a[_0x9e0c('0x52')]);}else{if(_[_0x9e0c('0x97')](_0x3d40cb[_0x9e0c('0x3c')][_0x9e0c('0x98')](),_0x9e0c('0x99'))){if(this[_0x9e0c('0xf')][_0x3d40cb[_0x9e0c('0x9a')]]){var _0x4cc5c8=_[_0x9e0c('0x80')](this['queueReports'][_0x3d40cb['linkedid']]);_0x4cc5c8[_0x9e0c('0x8d')]=![];_0x4cc5c8['queuecallerexit']=!![];_0x4cc5c8[_0x9e0c('0x95')]=moment(_0x4b824a[_0x9e0c('0x77')])[_0x9e0c('0x9b')](_0x3d40cb[_0x9e0c('0x81')],'seconds')['format'](_0x9e0c('0x78'));_0x4cc5c8['queuecallerexitreason']='FORWARDTRANSFER';_0x4cc5c8[_0x9e0c('0x96')]=!![];_0x4cc5c8[_0x9e0c('0x9c')]='FORWARD';_0x4cc5c8[_0x9e0c('0x9d')]=_0x3d40cb['destexten'];_0x4cc5c8[_0x9e0c('0x9e')]=_0x3d40cb[_0x9e0c('0x76')];logger[_0x9e0c('0x6a')](_0x9e0c('0x9f'),_0x4cc5c8[_0x9e0c('0x4b')],_0x4cc5c8[_0x9e0c('0x52')]);var _0x5cbeae=this[_0x9e0c('0xf')][_0x3d40cb[_0x9e0c('0x9a')]];this[_0x9e0c('0xf')][_0x3d40cb['linkedid']]=this[_0x9e0c('0xf')][_0x3d40cb[_0x9e0c('0x76')]];this[_0x9e0c('0xf')][_0x3d40cb[_0x9e0c('0x76')]]=_0x5cbeae;}}else{_0x4b824a['queuecallerexitreason']=_0x9e0c('0xa0')+_0x3d40cb['reason'][_0x9e0c('0xa1')]();logger['info'](_0x9e0c('0xa2'),_0x4b824a[_0x9e0c('0x4b')],_0x4b824a[_0x9e0c('0x52')],_0x4b824a[_0x9e0c('0x8e')]);}}}this[_0x9e0c('0x37')][_0x3d40cb['uniqueid']]=_0x4b824a;this[_0x9e0c('0x86')](_0x4b824a,_0x9e0c('0x20'));}}}catch(_0x463b79){logger[_0x9e0c('0x3e')](_0x9e0c('0x91'),_0x3d40cb[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x463b79,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e0c('0xb')][_0x9e0c('0xa3')]=function(_0xffdecf){try{if(this[_0x9e0c('0x68')](_0xffdecf)){logger[_0x9e0c('0x48')](_0x9e0c('0xa4'),_0xffdecf['uniqueid'],util[_0x9e0c('0x41')](_0xffdecf,{'showHidden':![],'depth':null}));this[_0x9e0c('0xa5')](_0xffdecf[_0x9e0c('0x76')],_[_0x9e0c('0xa6')](_0xffdecf[_0x9e0c('0xa7')])[0x0],_0xffdecf['value']);if(this[_0x9e0c('0xf')][_0xffdecf[_0x9e0c('0x76')]]){var _0x9852fe=_[_0x9e0c('0x80')](this[_0x9e0c('0xf')][_0xffdecf[_0x9e0c('0x76')]]);if(_0x9852fe){if(this[_0x9e0c('0x68')](_0xffdecf[_0x9e0c('0xa7')])&&this['isNotNull'](_0xffdecf[_0x9e0c('0xa7')][_0x9e0c('0xa8')])){switch(_0xffdecf[_0x9e0c('0xa9')]){case _0x9e0c('0xaa'):_0x9852fe[_0x9e0c('0x94')]=![];_0x9852fe[_0x9e0c('0x95')]=null;break;case _0x9e0c('0xab'):_0x9852fe[_0x9e0c('0xac')]=_0x9e0c('0xad');_0x9852fe['queuecallerexit']=!![];_0x9852fe['queuecallerexitAt']=moment()[_0x9e0c('0x49')](_0x9e0c('0x78'));_0x9852fe[_0x9e0c('0x88')]=moment()[_0x9e0c('0x49')](_0x9e0c('0x78'));logger[_0x9e0c('0x48')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0xffdecf[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x9852fe,{'showHidden':![],'depth':null}));ami[_0x9e0c('0x46')](_0x9e0c('0xae'),_0x9852fe);break;default:_0x9852fe[_0x9e0c('0x94')]=!![];_0x9852fe[_0x9e0c('0x95')]=moment()[_0x9e0c('0x49')](_0x9e0c('0x78'));_0x9852fe['queuecallerleaveAt']=moment()['format'](_0x9e0c('0x78'));}_0x9852fe[_0x9e0c('0x1b')]=![];_0x9852fe[_0x9e0c('0x92')]=null;_0x9852fe[_0x9e0c('0x8e')]=_0xffdecf[_0x9e0c('0xa9')];this['channels'][_0xffdecf[_0x9e0c('0x76')]]=_0x9852fe;this['emitVoiceQueueChannelRemove'](_0x9852fe,'varset');}else if(this[_0x9e0c('0x68')](_0xffdecf[_0x9e0c('0xa7')])&&this[_0x9e0c('0x68')](_0xffdecf[_0x9e0c('0xa7')][_0x9e0c('0xaf')])){if(!_0x9852fe[_0x9e0c('0x1b')]){_0x9852fe['queuecallerexit']=!![];_0x9852fe[_0x9e0c('0x95')]=moment()[_0x9e0c('0x49')](_0x9e0c('0x78'));_0x9852fe['queuecallerexitreason']=_0x9e0c('0xb0');_0x9852fe[_0x9e0c('0x88')]=moment()['format'](_0x9e0c('0x78'));this[_0x9e0c('0x37')][_0xffdecf[_0x9e0c('0x76')]]=_0x9852fe;}}logger['info'](_0x9e0c('0xb1'),_0xffdecf['uniqueid'],_0x9852fe[_0x9e0c('0x4b')],_0x9852fe[_0x9e0c('0x52')],_[_0x9e0c('0xa6')](_0xffdecf[_0x9e0c('0xa7')])[0x0],_0xffdecf[_0x9e0c('0xa9')]);_0x9852fe[_0x9e0c('0x14')]=this['variables'][_0xffdecf[_0x9e0c('0x76')]];}}}}catch(_0x53364d){logger[_0x9e0c('0x3e')]('[%s][voiceQueueReport][varset]',_0xffdecf[_0x9e0c('0x76')],util[_0x9e0c('0x41')](_0x53364d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e0c('0xb')][_0x9e0c('0xa5')]=function(_0x4b3d2a,_0x529c76,_0x49a9a9){var _0x1713b4=['rtpaudioqos',_0x9e0c('0xb2'),_0x9e0c('0xb3'),_0x9e0c('0xb4'),_0x9e0c('0xb5'),_0x9e0c('0xb6'),_0x9e0c('0xb7'),'rtpaudioqosrttbridged',_0x9e0c('0xb8'),_0x9e0c('0xb9'),_0x9e0c('0xba'),_0x9e0c('0xbb'),_0x9e0c('0xbc'),'memberdynamic',_0x9e0c('0xbd'),_0x9e0c('0xbe'),_0x9e0c('0x93'),'memberpenalty',_0x9e0c('0xbf')];if(!_['isNil'](_0x529c76)&&!_['includes'](_0x1713b4,_0x529c76)){if(_[_0x9e0c('0x63')](this[_0x9e0c('0x14')][_0x4b3d2a])){this[_0x9e0c('0x14')][_0x4b3d2a]={};}this[_0x9e0c('0x14')][_0x4b3d2a][_0x529c76]=_0x49a9a9;}};VoiceQueueReport[_0x9e0c('0xb')]['handleHangup']=function(_0x3a79ce,_0x195165,_0x9491c4){var _0xa067e7={};for(var _0x1a7739=0x0;_0x1a7739=0x0?moment(_0xee2459[_0x5fcf('0x17')])[_0x5fcf('0x18')](_0xee2459[_0x5fcf('0x16')],_0x5fcf('0xc')):null,'data1':'outbound','data2':_0xee2459[_0x5fcf('0x10')],'data3':_0xee2459['exten'],'data4':_0xee2459[_0x5fcf('0x19')]||null,'role':_0x5fcf('0xf'),'internal':_0xee2459[_0x5fcf('0x10')]?_['toNumber'](_0xee2459[_0x5fcf('0x10')]):undefined,'uniqueid':_0xee2459[_0x5fcf('0x11')]},'log':_0x5fcf('0x5')});}; \ No newline at end of file +var _0x8b5d=['lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','lastAssignedTo','isNil','interface','format','SIP/%s','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','Request','voice','membername','TALKING','starttime','endtime','dialstring','moment'];(function(_0xa70472,_0x4367b5){var _0x570dda=function(_0x2de937){while(--_0x2de937){_0xa70472['push'](_0xa70472['shift']());}};_0x570dda(++_0x4367b5);}(_0x8b5d,0xf7));var _0xd8b5=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x8b5d[_0x1857d0];return _0x3e3c46;};'use strict';var moment=require(_0xd8b5('0x0'));var _=require(_0xd8b5('0x1'));var util=require(_0xd8b5('0x2'));var client=require(_0xd8b5('0x3'));exports[_0xd8b5('0x4')]=function(_0x2c3089){var _0x52ef85=_0x2c3089[_0xd8b5('0x5')]||_0x2c3089[_0xd8b5('0x6')];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x2c3089[_0xd8b5('0x7')],'interface':_[_0xd8b5('0x8')](_0x2c3089[_0xd8b5('0x9')])?util[_0xd8b5('0xa')](_0xd8b5('0xb'),_0x2c3089[_0xd8b5('0x7')]):_0x2c3089[_0xd8b5('0x9')],'type':'TALKING','enterAt':_0x2c3089['queuecallerleaveAt'],'exitAt':_0x52ef85,'duration':moment(_0x52ef85)[_0xd8b5('0xc')](_0x2c3089[_0xd8b5('0xd')],_0xd8b5('0xe')),'data1':_0xd8b5('0xf'),'data2':_0x2c3089[_0xd8b5('0x10')],'data3':_0x2c3089[_0xd8b5('0x11')],'data4':null,'data5':_0x2c3089['queue'],'role':_0xd8b5('0x12'),'internal':_0x2c3089[_0xd8b5('0x13')]?_[_0xd8b5('0x14')](_0x2c3089[_0xd8b5('0x13')]):undefined,'uniqueid':_0x2c3089[_0xd8b5('0x15')]},'log':_0xd8b5('0x16')});};exports[_0xd8b5('0x17')]=function(_0x2ff7a1){return client[_0xd8b5('0x18')](_0xd8b5('0x16'),{'body':{'channel':_0xd8b5('0x19'),'membername':_0x2ff7a1[_0xd8b5('0x1a')],'interface':_0x2ff7a1[_0xd8b5('0x9')],'type':_0xd8b5('0x1b'),'enterAt':_0x2ff7a1[_0xd8b5('0x1c')],'exitAt':_0x2ff7a1[_0xd8b5('0x1d')],'duration':moment(_0x2ff7a1['endtime'])[_0xd8b5('0xc')](_0x2ff7a1[_0xd8b5('0x1c')],_0xd8b5('0xe'))>=0x0?moment(_0x2ff7a1['endtime'])[_0xd8b5('0xc')](_0x2ff7a1[_0xd8b5('0x1c')],_0xd8b5('0xe')):null,'data1':'outbound','data2':_0x2ff7a1[_0xd8b5('0x13')],'data3':_0x2ff7a1['exten'],'data4':_0x2ff7a1[_0xd8b5('0x1e')]||null,'role':_0xd8b5('0x12'),'internal':_0x2ff7a1['accountcode']?_[_0xd8b5('0x14')](_0x2ff7a1[_0xd8b5('0x13')]):undefined,'uniqueid':_0x2ff7a1['uniqueid']},'log':_0xd8b5('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index e520d74..c7788a2 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 _0xab75=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0xbc4266,_0x63b70f){var _0x4e2961=function(_0xfa341c){while(--_0xfa341c){_0xbc4266['push'](_0xbc4266['shift']());}};_0x4e2961(++_0x63b70f);}(_0xab75,0x11f));var _0x5ab7=function(_0x5785f1,_0x1af264){_0x5785f1=_0x5785f1-0x0;var _0x15798b=_0xab75[_0x5785f1];return _0x15798b;};'use strict';var client=require(_0x5ab7('0x0'));exports[_0x5ab7('0x1')]=function(){return client[_0x5ab7('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x5ab7('0x3')]},'log':_0x5ab7('0x4')});}; \ No newline at end of file +var _0xe195=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','Request'];(function(_0x109dc3,_0xf6b661){var _0x41a1c=function(_0x558639){while(--_0x558639){_0x109dc3['push'](_0x109dc3['shift']());}};_0x41a1c(++_0xf6b661);}(_0xe195,0x1c6));var _0x5e19=function(_0x241c4a,_0x4d97e3){_0x241c4a=_0x241c4a-0x0;var _0x3e2544=_0xe195[_0x241c4a];return _0x3e2544;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x5e19('0x0')](_0x5e19('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5e19('0x2'),_0x5e19('0x3')]},'log':_0x5e19('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 8a8560d..5fb86fc 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 _0x1bc8=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0x1bc8,0x94));var _0x81bc=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x1bc8[_0x725b8e];return _0x43ac45;};'use strict';var client=require(_0x81bc('0x0'));exports[_0x81bc('0x1')]=function(_0x503c9a){return function(_0x556151){return client[_0x81bc('0x2')](_0x81bc('0x3'),{'options':{'raw':!![],'attributes':['id',_0x81bc('0x4'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x9ff3=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x3db61b,_0x19c164){var _0x5ce7c1=function(_0x26dfb9){while(--_0x26dfb9){_0x3db61b['push'](_0x3db61b['shift']());}};_0x5ce7c1(++_0x19c164);}(_0x9ff3,0x104));var _0x39ff=function(_0x379edb,_0xd2ff59){_0x379edb=_0x379edb-0x0;var _0x30b6e3=_0x9ff3[_0x379edb];return _0x30b6e3;};'use strict';var client=require(_0x39ff('0x0'));exports[_0x39ff('0x1')]=function(_0x372745){return function(_0x575aa0){return client[_0x39ff('0x2')](_0x39ff('0x3'),{'options':{'raw':!![],'attributes':['id',_0x39ff('0x4'),_0x39ff('0x5')]},'log':_0x39ff('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index bfab1c8..26e6ced 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 _0x01fa=['AnyConditions','Actions','action','data2','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','channel','Condition','AllConditions','field','operator','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01fa,0xe0));var _0xa01f=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x01fa[_0x24237f];return _0x48298e;};'use strict';var client=require(_0xa01f('0x0'));exports[_0xa01f('0x1')]=function(_0x5887fc){return function(_0x33f545){return client[_0xa01f('0x2')](_0xa01f('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xa01f('0x4'),'status'],'include':[{'model':_0xa01f('0x5'),'as':_0xa01f('0x6'),'attributes':['id',_0xa01f('0x7'),_0xa01f('0x8'),_0xa01f('0x9')]},{'model':_0xa01f('0x5'),'as':_0xa01f('0xa'),'attributes':['id',_0xa01f('0x7'),_0xa01f('0x8'),_0xa01f('0x9')]},{'model':'Action','as':_0xa01f('0xb'),'attributes':['id',_0xa01f('0xc'),'data1',_0xa01f('0xd'),'data3',_0xa01f('0xe'),_0xa01f('0xf'),_0xa01f('0x10'),_0xa01f('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xd1de=['AllConditions','operator','value','AnyConditions','field','Action','Actions','data1','data3','data4','data5','data6','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd1de,0x124));var _0xed1d=function(_0x320f5f,_0x3166ca){_0x320f5f=_0x320f5f-0x0;var _0x16ff4c=_0xd1de[_0x320f5f];return _0x16ff4c;};'use strict';var client=require(_0xed1d('0x0'));exports[_0xed1d('0x1')]=function(_0x3bead1){return function(_0x3bc8da){return client[_0xed1d('0x2')](_0xed1d('0x3'),{'options':{'raw':![],'attributes':['id',_0xed1d('0x4'),_0xed1d('0x5'),_0xed1d('0x6')],'include':[{'model':_0xed1d('0x7'),'as':_0xed1d('0x8'),'attributes':['id','field',_0xed1d('0x9'),_0xed1d('0xa')]},{'model':'Condition','as':_0xed1d('0xb'),'attributes':['id',_0xed1d('0xc'),_0xed1d('0x9'),_0xed1d('0xa')]},{'model':_0xed1d('0xd'),'as':_0xed1d('0xe'),'attributes':['id','action',_0xed1d('0xf'),'data2',_0xed1d('0x10'),_0xed1d('0x11'),_0xed1d('0x12'),_0xed1d('0x13'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 5f8faa2..90f6f5c 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 _0x3036=['name','Request'];(function(_0x272ceb,_0x202a22){var _0x1fc019=function(_0x3547d9){while(--_0x3547d9){_0x272ceb['push'](_0x272ceb['shift']());}};_0x1fc019(++_0x202a22);}(_0x3036,0x1a9));var _0x6303=function(_0x533e71,_0xa08c1){_0x533e71=_0x533e71-0x0;var _0x38f006=_0x3036[_0x533e71];return _0x38f006;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x7aa5f9){return function(_0xd38168){return client[_0x6303('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6303('0x1'),'registry','defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x4d9e=['../client','GetTrunk','registry','defaultuser'];(function(_0x2876c0,_0x118594){var _0xe572e2=function(_0x16ab89){while(--_0x16ab89){_0x2876c0['push'](_0x2876c0['shift']());}};_0xe572e2(++_0x118594);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x16d65c,_0x296e81){_0x16d65c=_0x16d65c-0x0;var _0x39f9ab=_0x4d9e[_0x16d65c];return _0x39f9ab;};'use strict';var client=require(_0xe4d9('0x0'));exports['getTrunks']=function(_0x4da72e){return function(_0x46e8c2){return client['Request'](_0xe4d9('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xe4d9('0x2'),_0xe4d9('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 973c924..3394237 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe706,0xa3));var _0x6e70=function(_0x10e3f7,_0x353b97){_0x10e3f7=_0x10e3f7-0x0;var _0x3ee398=_0xe706[_0x10e3f7];return _0x3ee398;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 000dd90..9deb24f 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 _0xcb76=['UpdateVoiceAgentReport','../client','CreateVoiceAgentReport','update'];(function(_0x3ebd05,_0x1d34c4){var _0x22524a=function(_0x5868dd){while(--_0x5868dd){_0x3ebd05['push'](_0x3ebd05['shift']());}};_0x22524a(++_0x1d34c4);}(_0xcb76,0x81));var _0x6cb7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xcb76[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x6cb7('0x0'));exports['create']=function(_0x1d3836){return client['Request'](_0x6cb7('0x1'),{'body':_0x1d3836,'log':_0x6cb7('0x1')});};exports[_0x6cb7('0x2')]=function(_0x158f99,_0xebd20c,_0x4f9ee8){return client['Request'](_0x6cb7('0x3'),{'body':_0x158f99,'options':{'where':{'uniqueid':_0xebd20c,'interface':_0x4f9ee8,'agentcomplete':!![]}},'log':_0x6cb7('0x3')});}; \ No newline at end of file +var _0x432d=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x559f51,_0x46e5e8){var _0x1262f3=function(_0x2beed3){while(--_0x2beed3){_0x559f51['push'](_0x559f51['shift']());}};_0x1262f3(++_0x46e5e8);}(_0x432d,0x12a));var _0xd432=function(_0x2e0763,_0x37e6e4){_0x2e0763=_0x2e0763-0x0;var _0x189643=_0x432d[_0x2e0763];return _0x189643;};'use strict';var client=require(_0xd432('0x0'));exports[_0xd432('0x1')]=function(_0x589793){return client[_0xd432('0x2')]('CreateVoiceAgentReport',{'body':_0x589793,'log':_0xd432('0x3')});};exports[_0xd432('0x4')]=function(_0x1ad9f3,_0x4b3e24,_0x30700b){return client[_0xd432('0x2')](_0xd432('0x5'),{'body':_0x1ad9f3,'options':{'where':{'uniqueid':_0x4b3e24,'interface':_0x30700b,'agentcomplete':!![]}},'log':_0xd432('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 2b28d05..fbe6cf8 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 _0xbb5d=['endOf','day','type','disposition','billableseconds','GetVoiceCallReports','lodash','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1a2c57,_0x39ffb2){var _0x1a9fd0=function(_0x47a5a2){while(--_0x47a5a2){_0x1a2c57['push'](_0x1a2c57['shift']());}};_0x1a9fd0(++_0x39ffb2);}(_0xbb5d,0x1d1));var _0xdbb5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbb5d[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xdbb5('0x0'));var client=require('../client');exports['create']=function(_0x39387b){return client[_0xdbb5('0x1')](_0xdbb5('0x2'),{'body':_[_0xdbb5('0x3')](_0x39387b,{'source':_0x39387b[_0xdbb5('0x4')],'destinationcontext':_0x39387b[_0xdbb5('0x5')],'callerid':_0x39387b['callerid'],'amaflags':_0xdbb5('0x6')}),'log':_0xdbb5('0x2')});};exports[_0xdbb5('0x7')]=function(){return function(){return client[_0xdbb5('0x1')](_0xdbb5('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')[_0xdbb5('0x9')](_0xdbb5('0xa')),moment()[_0xdbb5('0xb')](_0xdbb5('0xc'))[_0xdbb5('0x9')](_0xdbb5('0xa'))]}},'attributes':[_0xdbb5('0xd'),_0xdbb5('0xe'),'duration',_0xdbb5('0xf')]},'log':_0xdbb5('0x10')});};}; \ No newline at end of file +var _0xb351=['GetVoiceCallReports','util','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xb351,0x94));var _0x1b35=function(_0x39d56f,_0x2bacbe){_0x39d56f=_0x39d56f-0x0;var _0x18484c=_0xb351[_0x39d56f];return _0x18484c;};'use strict';var moment=require('moment');var util=require(_0x1b35('0x0'));var _=require(_0x1b35('0x1'));var client=require('../client');exports[_0x1b35('0x2')]=function(_0x47856c){return client[_0x1b35('0x3')](_0x1b35('0x4'),{'body':_[_0x1b35('0x5')](_0x47856c,{'source':_0x47856c[_0x1b35('0x6')],'destinationcontext':_0x47856c[_0x1b35('0x7')],'callerid':_0x47856c[_0x1b35('0x8')],'amaflags':_0x1b35('0x9')}),'log':_0x1b35('0x4')});};exports[_0x1b35('0xa')]=function(){return function(){return client[_0x1b35('0x3')](_0x1b35('0xb'),{'options':{'where':{'type':[_0x1b35('0xc')],'createdAt':{'$between':[moment()[_0x1b35('0xd')](_0x1b35('0xe'))[_0x1b35('0xf')](_0x1b35('0x10')),moment()['endOf']('day')[_0x1b35('0xf')](_0x1b35('0x10'))]}},'attributes':[_0x1b35('0x11'),_0x1b35('0x12'),'duration',_0x1b35('0x13')]},'log':_0x1b35('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fb91ca5..7f5a451 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 _0x760b=['Request','CreateVoiceDialReport','../client'];(function(_0x480fa2,_0x968ff0){var _0x16813f=function(_0x538757){while(--_0x538757){_0x480fa2['push'](_0x480fa2['shift']());}};_0x16813f(++_0x968ff0);}(_0x760b,0x1e2));var _0xb760=function(_0x17f228,_0x24a891){_0x17f228=_0x17f228-0x0;var _0x367a05=_0x760b[_0x17f228];return _0x367a05;};'use strict';var client=require(_0xb760('0x0'));exports['create']=function(_0x2146f5){return client[_0xb760('0x1')](_0xb760('0x2'),{'body':_0x2146f5,'log':_0xb760('0x2')});}; \ No newline at end of file +var _0x08f4=['CreateVoiceDialReport','create'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x08f4,0xd3));var _0x408f=function(_0x18b1d3,_0x4b42fc){_0x18b1d3=_0x18b1d3-0x0;var _0x5144c7=_0x08f4[_0x18b1d3];return _0x5144c7;};'use strict';var client=require('../client');exports[_0x408f('0x0')]=function(_0x4edd67){return client['Request'](_0x408f('0x1'),{'body':_0x4edd67,'log':_0x408f('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 7c1f9f7..ee8fb56 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 _0xaf80=['getVoiceExtensions','Request','GetVoiceExtension','../client'];(function(_0x32b08b,_0x3c939f){var _0x2234e5=function(_0x53c5db){while(--_0x53c5db){_0x32b08b['push'](_0x32b08b['shift']());}};_0x2234e5(++_0x3c939f);}(_0xaf80,0x1ef));var _0x0af8=function(_0x386047,_0x1ff5a9){_0x386047=_0x386047-0x0;var _0x19c9fc=_0xaf80[_0x386047];return _0x19c9fc;};'use strict';var client=require(_0x0af8('0x0'));exports[_0x0af8('0x1')]=function(){return function(){return client[_0x0af8('0x2')](_0x0af8('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xe3ee=['GetVoiceExtension','getVoiceExtensions','Request'];(function(_0x24c396,_0x2c9192){var _0x148e0c=function(_0x5ca55a){while(--_0x5ca55a){_0x24c396['push'](_0x24c396['shift']());}};_0x148e0c(++_0x2c9192);}(_0xe3ee,0x116));var _0xee3e=function(_0x53b3e0,_0x522724){_0x53b3e0=_0x53b3e0-0x0;var _0x1fd4ce=_0xe3ee[_0x53b3e0];return _0x1fd4ce;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xee3e('0x0')](_0xee3e('0x1'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xee3e('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index cf40327..ffa90fb 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 _0x66db=['dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x66db,0x133));var _0xb66d=function(_0xe68a79,_0x5183df){_0xe68a79=_0xe68a79-0x0;var _0x3d476a=_0x66db[_0xe68a79];return _0x3d476a;};'use strict';var client=require(_0xb66d('0x0'));exports[_0xb66d('0x1')]=function(){return function(){return client[_0xb66d('0x2')](_0xb66d('0x3'),{'options':{'raw':![],'attributes':['id',_0xb66d('0x4'),_0xb66d('0x5'),'acwTimeout',_0xb66d('0x6'),_0xb66d('0x7'),_0xb66d('0x8'),'dialActive',_0xb66d('0x9'),_0xb66d('0xa'),_0xb66d('0xb'),_0xb66d('0xc'),_0xb66d('0xd'),_0xb66d('0xe'),_0xb66d('0xf'),_0xb66d('0x10'),_0xb66d('0x11'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0xb66d('0x12'),_0xb66d('0x13'),_0xb66d('0x14'),_0xb66d('0x15'),'dialBusyRetryFrequency',_0xb66d('0x16'),_0xb66d('0x17'),_0xb66d('0x18'),_0xb66d('0x19'),_0xb66d('0x1a'),_0xb66d('0x1b'),_0xb66d('0x1c'),'dialAMDActive','dialAMDInitialSilence',_0xb66d('0x1d'),_0xb66d('0x1e'),_0xb66d('0x1f'),_0xb66d('0x20'),_0xb66d('0x21'),_0xb66d('0x22'),_0xb66d('0x23'),_0xb66d('0x24'),_0xb66d('0x25'),_0xb66d('0x26'),_0xb66d('0x27'),_0xb66d('0x28'),_0xb66d('0x29'),'dialAgiAfterHangupClient','dialQueueProject2',_0xb66d('0x7'),_0xb66d('0x2a'),_0xb66d('0x2b'),_0xb66d('0x2c'),_0xb66d('0x2d'),_0xb66d('0x2e'),_0xb66d('0x2f'),_0xb66d('0x30'),_0xb66d('0x31'),_0xb66d('0x32'),'dialMachineMaxRetry',_0xb66d('0x33'),_0xb66d('0x34'),_0xb66d('0x35'),_0xb66d('0x36'),_0xb66d('0x37'),_0xb66d('0x38'),_0xb66d('0x39'),_0xb66d('0x3a'),_0xb66d('0x3b')],'include':[{'model':'Trunk','as':_0xb66d('0x3c'),'attributes':['id','name',_0xb66d('0x3d'),'active']},{'model':_0xb66d('0x3e'),'as':'mandatoryDispositionPause','attributes':['id',_0xb66d('0x4')]},{'model':_0xb66d('0x3c'),'as':_0xb66d('0x3f'),'attributes':['id',_0xb66d('0x4'),_0xb66d('0x3d'),_0xb66d('0x40')]},{'model':_0xb66d('0x41'),'as':_0xb66d('0x41'),'attributes':['id','name'],'include':[{'model':_0xb66d('0x41'),'as':_0xb66d('0x42'),'attributes':['id','name','interval']}]}]},'log':_0xb66d('0x1')});};}; \ No newline at end of file +var _0x05e4=['timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence'];(function(_0x4cd4a8,_0xa2e25a){var _0x2c4f84=function(_0x474116){while(--_0x474116){_0x4cd4a8['push'](_0x4cd4a8['shift']());}};_0x2c4f84(++_0xa2e25a);}(_0x05e4,0x1ba));var _0x405e=function(_0x404c6e,_0x42c0e1){_0x404c6e=_0x404c6e-0x0;var _0x2b6c07=_0x05e4[_0x404c6e];return _0x2b6c07;};'use strict';var client=require('../client');exports[_0x405e('0x0')]=function(){return function(){return client[_0x405e('0x1')](_0x405e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x405e('0x3'),_0x405e('0x4'),_0x405e('0x5'),_0x405e('0x6'),_0x405e('0x7'),_0x405e('0x8'),_0x405e('0x9'),_0x405e('0xa'),'dialLimitQueue',_0x405e('0xb'),_0x405e('0xc'),_0x405e('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x405e('0xe'),_0x405e('0xf'),_0x405e('0x10'),_0x405e('0x11'),_0x405e('0x12'),_0x405e('0x13'),_0x405e('0x14'),'dialBusyRetryFrequency',_0x405e('0x15'),'dialNoAnswerRetryFrequency',_0x405e('0x16'),'dialTimezone',_0x405e('0x17'),_0x405e('0x18'),_0x405e('0x19'),_0x405e('0x1a'),'dialAMDInitialSilence',_0x405e('0x1b'),'dialAMDAfterGreetingSilence',_0x405e('0x1c'),'dialAMDMinWordLength',_0x405e('0x1d'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x405e('0x1e'),'dialRecallMeTimeout',_0x405e('0x1f'),_0x405e('0x20'),_0x405e('0x21'),'dialAgiAfterHangupClient',_0x405e('0x22'),_0x405e('0x6'),'strategy',_0x405e('0x23'),'dialCutDigit',_0x405e('0x24'),_0x405e('0x25'),_0x405e('0x26'),_0x405e('0x27'),_0x405e('0x28'),_0x405e('0x29'),_0x405e('0x2a'),_0x405e('0x2b'),'dialAgentRejectMaxRetry',_0x405e('0x2c'),'mandatoryDisposition',_0x405e('0x2d'),_0x405e('0x2e'),_0x405e('0x2f'),'dialPreviewRecallmeReminder',_0x405e('0x30')],'include':[{'model':_0x405e('0x31'),'as':_0x405e('0x31'),'attributes':['id',_0x405e('0x32'),_0x405e('0x33'),_0x405e('0x34')]},{'model':_0x405e('0x35'),'as':_0x405e('0x36'),'attributes':['id',_0x405e('0x32')]},{'model':'Trunk','as':_0x405e('0x37'),'attributes':['id',_0x405e('0x32'),'callerid',_0x405e('0x34')]},{'model':_0x405e('0x38'),'as':_0x405e('0x38'),'attributes':['id',_0x405e('0x32')],'include':[{'model':_0x405e('0x38'),'as':_0x405e('0x39'),'attributes':['id',_0x405e('0x32'),_0x405e('0x3a')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d4e8e75..4a9a2b4 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(_0x2b6c43,_0x476984){var _0x1a4bef=function(_0x246ba9){while(--_0x246ba9){_0x2b6c43['push'](_0x2b6c43['shift']());}};_0x1a4bef(++_0x476984);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x33beb4,_0x43f142){var _0x591f05=function(_0x15c88d){while(--_0x15c88d){_0x33beb4['push'](_0x33beb4['shift']());}};_0x591f05(++_0x43f142);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 f6fdafa..ab6c0ac 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 _0xa9b0=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x1c9ff9,_0x300fdf){var _0x366768=function(_0x1ecd71){while(--_0x1ecd71){_0x1c9ff9['push'](_0x1c9ff9['shift']());}};_0x366768(++_0x300fdf);}(_0xa9b0,0x18d));var _0x0a9b=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0xa9b0[_0xee5d2a];return _0x346948;};'use strict';var client=require(_0x0a9b('0x0'));exports[_0x0a9b('0x1')]=function(_0x1e163b){return function(){return client['Request'](_0x0a9b('0x2'),{'options':{'where':{'VoiceQueueId':_0x1e163b,'paused':!![]},'raw':!![]},'log':_0x0a9b('0x1')});};}; \ No newline at end of file +var _0x349b=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x349b,0xc6));var _0xb349=function(_0x5c9e15,_0x3f4293){_0x5c9e15=_0x5c9e15-0x0;var _0x10077f=_0x349b[_0x5c9e15];return _0x10077f;};'use strict';var client=require('../client');exports[_0xb349('0x0')]=function(_0x2ce25b){return function(){return client[_0xb349('0x1')](_0xb349('0x2'),{'options':{'where':{'VoiceQueueId':_0x2ce25b,'paused':!![]},'raw':!![]},'log':_0xb349('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8450536..029a8a5 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0xcea29b,_0x1a45fe){var _0x1a9794=function(_0x519e86){while(--_0x519e86){_0xcea29b['push'](_0xcea29b['shift']());}};_0x1a9794(++_0x1a45fe);}(_0x7a54,0x106));var _0x47a5=function(_0x5f37cb,_0x5f352c){_0x5f37cb=_0x5f37cb-0x0;var _0x484d75=_0x7a54[_0x5f37cb];return _0x484d75;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x57606f,_0x21b162){var _0x39af18=function(_0x225b66){while(--_0x225b66){_0x57606f['push'](_0x57606f['shift']());}};_0x39af18(++_0x21b162);}(_0x7a54,0x106));var _0x47a5=function(_0x5d9eaa,_0x4c218b){_0x5d9eaa=_0x5d9eaa-0x0;var _0x259173=_0x7a54[_0x5d9eaa];return _0x259173;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index c9d68c2..a4806ac 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 _0xe5b2=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','blind','origtransfererchannel'];(function(_0x536755,_0x3bfa50){var _0x2b9dde=function(_0xe1efcc){while(--_0xe1efcc){_0x536755['push'](_0x536755['shift']());}};_0x2b9dde(++_0x3bfa50);}(_0xe5b2,0x12f));var _0x2e5b=function(_0x4c8cc2,_0x22c17c){_0x4c8cc2=_0x4c8cc2-0x0;var _0xcf1186=_0xe5b2[_0x4c8cc2];return _0xcf1186;};'use strict';var client=require(_0x2e5b('0x0'));exports[_0x2e5b('0x1')]={};exports[_0x2e5b('0x2')]=function(_0x17c1da){return client[_0x2e5b('0x3')](_0x2e5b('0x4'),{'body':{'result':_0x17c1da[_0x2e5b('0x5')],'transfererchannel':_0x17c1da[_0x2e5b('0x6')],'transferercalleridnum':_0x17c1da[_0x2e5b('0x7')],'transferercalleridname':_0x17c1da[_0x2e5b('0x8')],'transfererconnectedlinenum':_0x17c1da[_0x2e5b('0x9')],'transfererconnectedlinename':_0x17c1da['transfererconnectedlinename'],'transfereraccountcode':_0x17c1da[_0x2e5b('0xa')],'transferercontext':_0x17c1da[_0x2e5b('0xb')],'transfererexten':_0x17c1da[_0x2e5b('0xc')],'transfererlinkedid':_0x17c1da[_0x2e5b('0xd')],'transfereechannel':_0x17c1da[_0x2e5b('0xe')],'transfereecalleridnum':_0x17c1da[_0x2e5b('0xf')],'transfereecalleridname':_0x17c1da[_0x2e5b('0x10')],'transfereeconnectedlinenum':_0x17c1da[_0x2e5b('0x11')],'transfereeconnectedlinename':_0x17c1da['transfereeconnectedlinename'],'transfereeaccountcode':_0x17c1da[_0x2e5b('0x12')],'transfereecontext':_0x17c1da[_0x2e5b('0x13')],'transfereeexten':_0x17c1da['transfereeexten'],'transfereelinkedid':_0x17c1da[_0x2e5b('0x14')],'isexternal':_0x17c1da[_0x2e5b('0x15')],'context':_0x17c1da['context'],'extension':_0x17c1da[_0x2e5b('0x16')],'type':_0x2e5b('0x17')},'log':_0x2e5b('0x4')});};exports['attendedTransfer']=function(_0x53afb2){return client[_0x2e5b('0x3')](_0x2e5b('0x4'),{'body':{'result':_0x53afb2[_0x2e5b('0x5')],'transfererchannel':_0x53afb2[_0x2e5b('0x18')],'transferercalleridnum':_0x53afb2['origtransferercalleridnum'],'transferercalleridname':_0x53afb2[_0x2e5b('0x19')],'transfererconnectedlinenum':_0x53afb2[_0x2e5b('0x1a')],'transfererconnectedlinename':_0x53afb2[_0x2e5b('0x1b')],'transfereraccountcode':_0x53afb2[_0x2e5b('0x1c')],'transferercontext':_0x53afb2['secondtransferercontext'],'transfererexten':_0x53afb2[_0x2e5b('0x1d')],'transfererlinkedid':_0x53afb2[_0x2e5b('0x1e')],'transfereechannel':_0x53afb2[_0x2e5b('0x1f')],'transfereecalleridnum':_0x53afb2[_0x2e5b('0x20')],'transfereecalleridname':_0x53afb2[_0x2e5b('0x21')],'transfereeconnectedlinenum':_0x53afb2[_0x2e5b('0x22')],'transfereeconnectedlinename':_0x53afb2[_0x2e5b('0x23')],'transfereeaccountcode':_0x53afb2[_0x2e5b('0x24')],'transfereecontext':_0x53afb2[_0x2e5b('0x25')],'transfereeexten':_0x53afb2[_0x2e5b('0x26')],'transfereelinkedid':_0x53afb2['transfertargetlinkedid'],'isexternal':_0x53afb2[_0x2e5b('0x15')],'context':_0x53afb2['origtransferercontext'],'extension':_0x53afb2[_0x2e5b('0x27')],'type':_0x2e5b('0x28')},'log':_0x2e5b('0x4')});}; \ No newline at end of file +var _0x5a46=['transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel'];(function(_0x376efa,_0x1bceb7){var _0x1d8e2d=function(_0x2e5716){while(--_0x2e5716){_0x376efa['push'](_0x376efa['shift']());}};_0x1d8e2d(++_0x1bceb7);}(_0x5a46,0xe0));var _0x65a4=function(_0xaf4441,_0x4b477c){_0xaf4441=_0xaf4441-0x0;var _0x26dbea=_0x5a46[_0xaf4441];return _0x26dbea;};'use strict';var client=require(_0x65a4('0x0'));exports[_0x65a4('0x1')]={};exports['blindTransfer']=function(_0x732ce8){return client[_0x65a4('0x2')](_0x65a4('0x3'),{'body':{'result':_0x732ce8['result'],'transfererchannel':_0x732ce8[_0x65a4('0x4')],'transferercalleridnum':_0x732ce8[_0x65a4('0x5')],'transferercalleridname':_0x732ce8[_0x65a4('0x6')],'transfererconnectedlinenum':_0x732ce8[_0x65a4('0x7')],'transfererconnectedlinename':_0x732ce8['transfererconnectedlinename'],'transfereraccountcode':_0x732ce8['transfereraccountcode'],'transferercontext':_0x732ce8[_0x65a4('0x8')],'transfererexten':_0x732ce8[_0x65a4('0x9')],'transfererlinkedid':_0x732ce8['transfererlinkedid'],'transfereechannel':_0x732ce8[_0x65a4('0xa')],'transfereecalleridnum':_0x732ce8[_0x65a4('0xb')],'transfereecalleridname':_0x732ce8[_0x65a4('0xc')],'transfereeconnectedlinenum':_0x732ce8['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x732ce8[_0x65a4('0xd')],'transfereeaccountcode':_0x732ce8[_0x65a4('0xe')],'transfereecontext':_0x732ce8[_0x65a4('0xf')],'transfereeexten':_0x732ce8['transfereeexten'],'transfereelinkedid':_0x732ce8[_0x65a4('0x10')],'isexternal':_0x732ce8[_0x65a4('0x11')],'context':_0x732ce8[_0x65a4('0x12')],'extension':_0x732ce8[_0x65a4('0x13')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x446075){return client['Request'](_0x65a4('0x3'),{'body':{'result':_0x446075['result'],'transfererchannel':_0x446075[_0x65a4('0x14')],'transferercalleridnum':_0x446075[_0x65a4('0x15')],'transferercalleridname':_0x446075[_0x65a4('0x16')],'transfererconnectedlinenum':_0x446075['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x446075[_0x65a4('0x17')],'transfereraccountcode':_0x446075['origtransfereraccountcode'],'transferercontext':_0x446075[_0x65a4('0x18')],'transfererexten':_0x446075[_0x65a4('0x19')],'transfererlinkedid':_0x446075[_0x65a4('0x1a')],'transfereechannel':_0x446075[_0x65a4('0x1b')],'transfereecalleridnum':_0x446075['transfertargetcalleridnum'],'transfereecalleridname':_0x446075[_0x65a4('0x1c')],'transfereeconnectedlinenum':_0x446075['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x446075['transfertargetconnectedlinename'],'transfereeaccountcode':_0x446075[_0x65a4('0x1d')],'transfereecontext':_0x446075[_0x65a4('0x1e')],'transfereeexten':_0x446075[_0x65a4('0x1f')],'transfereelinkedid':_0x446075[_0x65a4('0x20')],'isexternal':_0x446075[_0x65a4('0x11')],'context':_0x446075[_0x65a4('0x21')],'extension':_0x446075[_0x65a4('0x22')],'type':_0x65a4('0x23')},'log':_0x65a4('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8c17e74..1bbc05a 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 _0x74f0=['pTalking','sumBillable','sumDuration','talking','total','type','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','length','find','omit','undefined','values','voicechannel','validate','map','channels','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','isConnected','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','Redirect','exten','context','telephones','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','moment','../../../config/environment','../properties','../ami','format','%s/%s','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','answered','available','loggedIn'];(function(_0x57d308,_0x1c13c8){var _0x2fab30=function(_0x2126e1){while(--_0x2126e1){_0x57d308['push'](_0x57d308['shift']());}};_0x2fab30(++_0x1c13c8);}(_0x74f0,0xf3));var _0x074f=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x74f0[_0x4bc65f];return _0x44f85f;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x074f('0x1'));var config=require(_0x074f('0x2'));var properties=require(_0x074f('0x3'));var ami=require(_0x074f('0x4'));exports['listen']=function(_0x51fbdc,_0x3d8d87,_0x8965cc){return new Promise(function(_0x203f47,_0x126607){var _0x10b244={'QueuePause':function(_0x395b3c){return new Promise(function(_0x3dd440){var _0x547297=util[_0x074f('0x5')](_0x074f('0x6'),'SIP',_0x395b3c[_0x074f('0x7')]);if(_0x51fbdc[_0x074f('0x8')]&&_0x51fbdc[_0x074f('0x8')][_0x547297]&&_0x51fbdc[_0x074f('0x8')][_0x547297][_0x074f('0x9')]){_0x51fbdc['timers'][_0x547297]['updateAcw']();}if(_0x51fbdc[_0x074f('0xa')][_0x547297]){_0x51fbdc[_0x074f('0xa')][_0x547297][_0x074f('0xb')]({'statePause':_0x395b3c[_0x074f('0xc')]?!![]:![]});}_0x3dd440({'code':0xc8,'message':_0x074f('0xd')});});},'Reload':function(_0x2416e0){var _0x1d3304=this;return new Promise(function(_0x46cea0,_0x2c4596){if(ami['isConnected']()==![]){return _0x2c4596(_0x1d3304[_0x074f('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x074f('0xf')][_0x074f('0x10')],_0x074f('0x11')][_0x074f('0x12')]('\x20')));}_0x2416e0=_[_0x074f('0x13')](_0x2416e0,_[_0x074f('0x14')](properties[_0x074f('0x15')]));_0x2416e0[_0x074f('0x16')]=_0x074f('0x17');return ami[_0x074f('0x18')](_0x2416e0)[_0x074f('0x19')](function(_0x59e57a){_0x46cea0({'code':0xc8,'message':_0x59e57a[_0x074f('0x1a')]});})[_0x074f('0x1b')](function(_0x200e43){_0x2c4596(_0x1d3304[_0x074f('0xe')](0x1f5,_0x200e43[_0x074f('0x1a')]));});});},'Command':function(_0x1c5406){var _0x548aab=this;return new Promise(function(_0x568a50,_0x1d241d){if(ami['isConnected']()==![]){return _0x1d241d(_0x548aab['error'](0x1f4,[config[_0x074f('0xf')]['ip'],config[_0x074f('0xf')][_0x074f('0x10')],_0x074f('0x11')][_0x074f('0x12')]('\x20')));}_0x1c5406=_[_0x074f('0x13')](_0x1c5406,_0x074f('0x1c'));_0x1c5406[_0x074f('0x16')]=_0x074f('0x1d');return ami[_0x074f('0x18')](_0x1c5406)[_0x074f('0x19')](function(_0x3bc3f6){_0x568a50({'code':0xc8,'message':_0x3bc3f6[_0x074f('0x1e')]});})[_0x074f('0x1b')](function(_0x39e502){_0x1d241d(_0x548aab[_0x074f('0xe')](0x1f5,_0x39e502[_0x074f('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x504632){var _0x440d23=[];for(var _0x8b8e98 in _0x51fbdc['voiceQueues']){if(_0x51fbdc['voiceQueues']['hasOwnProperty'](_0x8b8e98)){var _0x1051ce=_0x51fbdc[_0x074f('0x1f')][_0x8b8e98];var _0x151977={'id':_0x1051ce['id'],'name':_0x1051ce[_0x074f('0x7')],'strategy':_0x1051ce['strategy'],'answered':_0x1051ce[_0x074f('0x20')],'available':_0x1051ce[_0x074f('0x21')],'loggedIn':_0x1051ce[_0x074f('0x22')],'pTalking':_0x1051ce[_0x074f('0x23')],'sumBillable':_0x1051ce[_0x074f('0x24')],'sumDuration':_0x1051ce[_0x074f('0x25')],'sumHoldTime':_0x1051ce['sumHoldTime']||0x0,'talking':_0x1051ce[_0x074f('0x26')],'total':_0x1051ce[_0x074f('0x27')],'type':_0x1051ce[_0x074f('0x28')],'unmanaged':_0x1051ce['unmanaged'],'abandoned':_0x1051ce[_0x074f('0x29')],'waiting':_0x1051ce['waiting'],'loggedInDb':_0x1051ce['loggedInDb']};if(_0x1051ce[_0x074f('0x28')]==='outbound'){_0x151977[_0x074f('0x2a')]=_0x1051ce[_0x074f('0x2a')];_0x151977[_0x074f('0x2b')]=_0x1051ce[_0x074f('0x2b')];_0x151977['dialOriginateCallerIdName']=_0x1051ce[_0x074f('0x2c')];_0x151977[_0x074f('0x2d')]=_0x1051ce[_0x074f('0x2d')];_0x151977['dialOriginateTimeout']=_0x1051ce[_0x074f('0x2e')];_0x151977[_0x074f('0x2f')]=_0x1051ce[_0x074f('0x2f')];_0x151977[_0x074f('0x30')]=_0x1051ce[_0x074f('0x30')];_0x151977['outboundAnswerAgiCallsDay']=_0x1051ce[_0x074f('0x31')];_0x151977[_0x074f('0x32')]=_0x1051ce['outboundAnswerCallsDay'];_0x151977[_0x074f('0x33')]=_0x1051ce[_0x074f('0x33')];_0x151977[_0x074f('0x34')]=_0x1051ce['outboundBusyCallsDay'];_0x151977[_0x074f('0x35')]=_0x1051ce[_0x074f('0x35')];_0x151977['outboundDropCallsDayACS']=_0x1051ce[_0x074f('0x36')];_0x151977[_0x074f('0x37')]=_0x1051ce[_0x074f('0x37')];_0x151977[_0x074f('0x38')]=_0x1051ce[_0x074f('0x38')];_0x151977[_0x074f('0x39')]=_0x1051ce[_0x074f('0x39')];_0x151977[_0x074f('0x3a')]=_0x1051ce[_0x074f('0x3a')];_0x151977[_0x074f('0x3b')]=_0x1051ce['outboundOriginateFailureCallsDay'];_0x151977[_0x074f('0x3c')]=_0x1051ce[_0x074f('0x3c')];_0x151977['outboundRejectCallsDay']=_0x1051ce[_0x074f('0x3d')];_0x151977[_0x074f('0x3e')]=_0x1051ce[_0x074f('0x3e')];_0x151977[_0x074f('0x3f')]=_0x1051ce[_0x074f('0x3f')];_0x151977[_0x074f('0x40')]=_0x1051ce[_0x074f('0x40')];_0x151977['predictiveIntervalAvgTalktime']=_0x1051ce[_0x074f('0x41')];_0x151977[_0x074f('0x42')]=_0x1051ce[_0x074f('0x42')];_0x151977[_0x074f('0x43')]=_0x1051ce[_0x074f('0x43')];_0x151977[_0x074f('0x44')]=_0x1051ce['predictiveIntervalErlangCalls'];_0x151977[_0x074f('0x45')]=_0x1051ce[_0x074f('0x45')];_0x151977['predictiveIntervalHitRate']=_0x1051ce[_0x074f('0x46')];_0x151977[_0x074f('0x47')]=_0x1051ce[_0x074f('0x47')];_0x151977['predictiveIntervalPauses']=_0x1051ce['predictiveIntervalPauses'];_0x151977['predictiveIntervalAvailable']=_0x1051ce[_0x074f('0x48')];_0x151977[_0x074f('0x49')]=_0x1051ce[_0x074f('0x49')];_0x151977['message']=_0x1051ce[_0x074f('0x1a')];_0x151977[_0x074f('0x4a')]=_0x1051ce['originated'];_0x151977[_0x074f('0x4b')]=_0x1051ce[_0x074f('0x4b')];_0x151977[_0x074f('0x4c')]=_0x1051ce[_0x074f('0x4c')];_0x151977[_0x074f('0x4d')]=_0x1051ce[_0x074f('0x4d')];_0x151977[_0x074f('0x4e')]=_0x1051ce[_0x074f('0x4e')];_0x151977[_0x074f('0x4f')]=_0x1051ce[_0x074f('0x4f')];_0x151977['startProgressive']=_0x1051ce[_0x074f('0x50')];}if(_0x1051ce['Trunk']){_0x151977[_0x074f('0x51')]={'id':_0x1051ce['Trunk']['id'],'name':_0x1051ce[_0x074f('0x51')]['name'],'active':_0x1051ce[_0x074f('0x51')]['active'],'callerid':_0x1051ce[_0x074f('0x51')][_0x074f('0x52')]};}if(_0x1051ce[_0x074f('0x53')]){_0x151977[_0x074f('0x53')]={'id':_0x1051ce[_0x074f('0x53')]['id'],'name':_0x1051ce[_0x074f('0x53')][_0x074f('0x7')]};}_0x440d23['push'](_0x151977);}}_0x504632({'count':_0x440d23[_0x074f('0x54')],'rows':_0x440d23});});},'UpdateVoiceQueue':function(_0x377791){return new Promise(function(_0x22d316,_0x1a3927){var _0x4b500a=_[_0x074f('0x55')](_0x51fbdc['voiceQueues'],{'id':parseInt(_0x377791['id'])});var _0x5eef32=_[_0x074f('0x56')](_0x377791,['id']);if(_0x4b500a){for(var _0x324ca3 in _0x5eef32){if(typeof _0x5eef32[_0x324ca3]!=='undefined'&&typeof _0x4b500a[_0x324ca3]!==_0x074f('0x57')){_0x4b500a[_0x324ca3]=_0x5eef32[_0x324ca3];}}_0x22d316(_0x4b500a);}else{_0x1a3927();}});},'VoiceChannels':function(){return new Promise(function(_0x53b6fc){var _0x3316ed=_[_0x074f('0x58')](_0x51fbdc['channels']);_0x53b6fc({'count':_0x3316ed[_0x074f('0x54')],'rows':_0x3316ed});});},'VoiceChannelMixMonitor':function(_0x4c840c){var _0x45492a=this;return new Promise(function(_0x130448,_0x598fee){if(ami['isConnected']()==![]){return _0x598fee(_0x45492a['error'](0x1f4,[config['asterisk']['ip'],config[_0x074f('0xf')][_0x074f('0x10')],_0x074f('0x11')][_0x074f('0x12')]('\x20')));}var _0x53b1e5=schema(properties[_0x074f('0x59')])[_0x074f('0x5a')](_0x4c840c);if(_0x53b1e5[_0x074f('0x54')]>0x0){return _0x598fee(_0x45492a[_0x074f('0xe')](0x1f4,_[_0x074f('0x5b')](_0x53b1e5,_0x074f('0x1a'))[_0x074f('0x12')](',\x20')));}var _0x357717=_['find'](_0x51fbdc[_0x074f('0x5c')],{'uniqueid':_0x4c840c[_0x074f('0x5d')]});if(_0x357717&&_0x357717[_0x074f('0x5e')]){var _0x306a17=util['format'](_0x074f('0x5f'),_0x4c840c[_0x074f('0x60')]||_0x4c840c['uniqueid'],_0x4c840c['format']||_0x074f('0x61'));return ami[_0x074f('0x18')]({'action':_0x074f('0x62'),'channel':_0x357717[_0x074f('0x5e')],'file':_0x306a17,'options':'ai(mixmonitorid)'})['then'](function(_0x3db639){var _0xc38f21=_[_0x074f('0x55')](_0x357717[_0x074f('0x63')],{'filename':_0x074f('0x64')+_0x306a17[_0x074f('0x65')]()});if(_[_0x074f('0x66')](_0xc38f21)){_0x357717[_0x074f('0x63')][_0x074f('0x67')]({'filename':'/var/spool/asterisk/monitor/'+_0x306a17[_0x074f('0x65')](),'createdAt':moment()[_0x074f('0x5')](_0x074f('0x68')),'mixmonitorid':_0x3db639[_0x074f('0x69')],'status':_0x074f('0x6a')});}else{_0xc38f21[_0x074f('0x69')]=_0x3db639['mixmonitorid'];_0xc38f21[_0x074f('0x6b')]=_0x074f('0x6a');}_0x130448({'code':0xc8,'message':[_0x4c840c['uniqueid'],_0x074f('0x6c'),_0x3db639[_0x074f('0x69')]][_0x074f('0x12')]('\x20'),'mixmonitorid':_0x3db639[_0x074f('0x69')]});})[_0x074f('0x1b')](function(_0x2efcbd){_0x598fee(_0x45492a[_0x074f('0xe')](0x1f5,[_0x4c840c[_0x074f('0x5d')],_0x2efcbd[_0x074f('0x1a')][_0x074f('0x65')]()]['join']('\x20')));});}else{return _0x598fee(_0x45492a[_0x074f('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x572912){var _0x41aec7=this;return new Promise(function(_0x599f5c,_0x582cbe){if(ami[_0x074f('0x6d')]()==![]){return _0x582cbe(_0x41aec7[_0x074f('0xe')](0x1f4,[config[_0x074f('0xf')]['ip'],config[_0x074f('0xf')][_0x074f('0x10')],_0x074f('0x11')][_0x074f('0x12')]('\x20')));}var _0x3afacd=schema(properties['voicechannel'])['validate'](_0x572912);if(_0x3afacd[_0x074f('0x54')]>0x0){return _0x582cbe(_0x41aec7[_0x074f('0xe')](0x1f4,_[_0x074f('0x5b')](_0x3afacd,'message')[_0x074f('0x12')](',\x20')));}var _0x1fa2ba=_['find'](_0x51fbdc['channels'],{'uniqueid':_0x572912[_0x074f('0x5d')]});if(_0x1fa2ba){return Promise['resolve']()[_0x074f('0x19')](function(){if(_0x1fa2ba[_0x074f('0x5e')]){return ami['Action']({'action':_0x074f('0x6e'),'channel':_0x1fa2ba[_0x074f('0x5e')],'mixmonitorid':_0x572912[_0x074f('0x69')]})[_0x074f('0x1b')](function(){});}})[_0x074f('0x19')](function(){if(_0x1fa2ba[_0x074f('0x6f')]){return ami[_0x074f('0x18')]({'action':_0x074f('0x6e'),'channel':_0x1fa2ba[_0x074f('0x6f')],'mixmonitorid':_0x572912[_0x074f('0x69')]})[_0x074f('0x1b')](function(){});}})[_0x074f('0x19')](function(){var _0x565414=_['find'](_0x1fa2ba['monitors'],{'mixmonitorid':_0x572912[_0x074f('0x69')]});if(_0x565414){_0x565414['status']=_0x074f('0x70');}})['then'](function(){var _0x30296f=util[_0x074f('0x5')]('%s.%s',_0x572912[_0x074f('0x60')]||_0x572912[_0x074f('0x5d')],_0x572912[_0x074f('0x5')]||_0x074f('0x61'));var _0x183bbf=_[_0x074f('0x55')](_0x1fa2ba[_0x074f('0x63')],{'filename':'/var/spool/asterisk/monitor/'+_0x30296f[_0x074f('0x65')]()});if(_0x183bbf){_0x183bbf[_0x074f('0x6b')]='stop';}})[_0x074f('0x19')](function(){_0x599f5c({'code':0xc8,'message':[_0x572912[_0x074f('0x5d')],_0x074f('0x71')][_0x074f('0x12')]('\x20')});})['catch'](function(_0x5a938e){_0x582cbe(_0x41aec7[_0x074f('0xe')](0x1f5,[_0x572912[_0x074f('0x5d')],_0x5a938e['message']['toLowerCase']()][_0x074f('0x12')]('\x20')));});}else{return _0x582cbe(_0x41aec7[_0x074f('0xe')](0x1f5,_0x074f('0x72')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x306bb4){var _0x31d5e8=_['values'](_0x51fbdc[_0x074f('0x73')]);_0x306bb4({'count':_0x31d5e8['length'],'rows':_0x31d5e8});});},'VoiceQueuesChannel':function(_0x21d997){var _0x7eb0e2=this;return new Promise(function(_0x174a0d,_0x16136a){var _0x11c51c=schema(properties[_0x074f('0x74')])[_0x074f('0x5a')](_0x21d997);if(_0x11c51c[_0x074f('0x54')]>0x0){return _0x16136a(_0x7eb0e2[_0x074f('0xe')](0x1f4,_[_0x074f('0x5b')](_0x11c51c,_0x074f('0x1a'))['join'](',\x20')));}var _0x10483b=_[_0x074f('0x55')](_0x51fbdc['queueChannels'],{'uniqueid':_0x21d997['uniqueid']});if(_0x10483b){_0x174a0d(_0x10483b);}else{return _0x16136a(_0x7eb0e2['error'](0x1f5,_0x074f('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x13fbf6){var _0x2c06df=this;return new Promise(function(_0x3d33b9,_0x2cca7e){if(ami['isConnected']()==![]){return _0x2cca7e(_0x2c06df['error'](0x1f4,[config[_0x074f('0xf')]['ip'],config['asterisk'][_0x074f('0x10')],'ami\x20disconnected'][_0x074f('0x12')]('\x20')));}var _0x4a469b=schema(properties['voicequeuechannelhangup'])[_0x074f('0x5a')](_0x13fbf6);if(_0x4a469b[_0x074f('0x54')]>0x0){return _0x2cca7e(_0x2c06df[_0x074f('0xe')](0x1f4,_[_0x074f('0x5b')](_0x4a469b,'message')[_0x074f('0x12')](',\x20')));}var _0x503a9e=_[_0x074f('0x55')](_0x51fbdc[_0x074f('0x73')],{'uniqueid':_0x13fbf6['uniqueid']});if(_0x503a9e&&_0x503a9e[_0x074f('0x5e')]){return ami[_0x074f('0x18')]({'action':_0x074f('0x75'),'channel':_0x503a9e['channel']})['then'](function(_0x1362f2){_0x3d33b9({'code':0xc8,'message':[_0x13fbf6[_0x074f('0x5d')],_0x1362f2[_0x074f('0x1a')][_0x074f('0x65')]()][_0x074f('0x12')]('\x20')});})[_0x074f('0x1b')](function(_0x22daff){_0x2cca7e(_0x2c06df['error'](0x1f5,[_0x13fbf6[_0x074f('0x5d')],_0x22daff[_0x074f('0x1a')][_0x074f('0x65')]()]['join']('\x20')));});}else{return _0x2cca7e(_0x2c06df[_0x074f('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x322daf){var _0x46d0c6=this;return new Promise(function(_0x12c53a,_0x26007e){if(ami[_0x074f('0x6d')]()==![]){return _0x26007e(_0x46d0c6['error'](0x1f4,[config[_0x074f('0xf')]['ip'],config[_0x074f('0xf')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x416727=schema(properties['voicequeuechannelredirect'])[_0x074f('0x5a')](_0x322daf);if(_0x416727[_0x074f('0x54')]>0x0){return _0x26007e(_0x46d0c6[_0x074f('0xe')](0x1f4,_[_0x074f('0x5b')](_0x416727,_0x074f('0x1a'))[_0x074f('0x12')](',\x20')));}var _0x4cd7a2=_[_0x074f('0x55')](_0x51fbdc[_0x074f('0x73')],{'uniqueid':_0x322daf[_0x074f('0x5d')]});if(_0x4cd7a2&&_0x4cd7a2[_0x074f('0x5e')]){return ami[_0x074f('0x18')]({'action':_0x074f('0x76'),'channel':_0x4cd7a2[_0x074f('0x5e')],'exten':_0x322daf[_0x074f('0x77')],'context':_0x322daf[_0x074f('0x78')]||_0x4cd7a2[_0x074f('0x78')],'priority':0x1})['then'](function(_0x24218d){_0x12c53a({'code':0xc8,'message':[_0x322daf[_0x074f('0x5d')],_0x24218d[_0x074f('0x1a')][_0x074f('0x65')]()]['join']('\x20')});})['catch'](function(_0x1d436d){_0x26007e(_0x46d0c6[_0x074f('0xe')](0x1f5,[_0x322daf[_0x074f('0x5d')],_0x1d436d[_0x074f('0x1a')]['toLowerCase']()][_0x074f('0x12')]('\x20')));});}else{return _0x26007e(_0x46d0c6[_0x074f('0xe')](0x1f5,_0x074f('0x72')));}});},'Agents':function(_0x2e7166){return new Promise(function(_0xa8b1a4){var _0x230d8e=_[_0x074f('0x58')](_0x51fbdc['agents']);if(_0x2e7166&&_0x2e7166['id']){var _0x1c394e=_[_0x074f('0x55')](_0x230d8e,function(_0x1edd33){return _0x1edd33['id']===_0x2e7166['id'];});_0xa8b1a4(_0x1c394e);}else{_0xa8b1a4({'count':_0x230d8e[_0x074f('0x54')],'rows':_0x230d8e});}});},'Telephones':function(){return new Promise(function(_0x5bd04a){var _0x148ab3=_[_0x074f('0x58')](_0x51fbdc[_0x074f('0x79')]);_0x5bd04a({'count':_0x148ab3[_0x074f('0x54')],'rows':_0x148ab3});});},'Trunks':function(){return new Promise(function(_0x3caf05){var _0x22c323=_[_0x074f('0x58')](_0x51fbdc['trunks']);_0x3caf05({'count':_0x22c323[_0x074f('0x54')],'rows':_0x22c323});});},'OutboundChannels':function(){return new Promise(function(_0x5de370){var _0x29ae80=_['values'](_0x51fbdc[_0x074f('0x7a')]);_0x5de370({'count':_0x29ae80[_0x074f('0x54')],'rows':_0x29ae80});});},'Outbound':function(){return new Promise(function(_0x5dcb03){_0x5dcb03(_0x51fbdc[_0x074f('0x7b')]);});},'Campaigns':function(){return new Promise(function(_0x4a2c83){var _0xcb7022=_[_0x074f('0x58')](_0x51fbdc[_0x074f('0x7c')]);_0x4a2c83({'count':_0xcb7022[_0x074f('0x54')],'rows':_0xcb7022});});},'VoiceQueuesPreview':function(_0x315cf9){var _0x4e53b5=this;return new Promise(function(_0x3c816a,_0x4d2fa5){_0x3d8d87[_0x074f('0x7d')](_0x315cf9['id'])['then'](function(_0x4c6207){_0x3c816a({'code':0xc8,'message':_0x4c6207[_0x074f('0x1a')]});})[_0x074f('0x1b')](function(_0x5f3c40){_0x4d2fa5(_0x4e53b5['error'](0x1f4,_0x5f3c40['message']));});});},'EventManager':function(_0x306592){var _0x574989=this;return new Promise(function(_0x2b8866,_0x1b6200){if(!_0x306592[_0x074f('0x7e')]){return _0x1b6200(_0x574989[_0x074f('0xe')](0x1f4,_0x074f('0x7f')));}ami[_0x074f('0x80')](_0x074f('0x81')+_0x306592[_0x074f('0x7e')],_0x306592[_0x074f('0x1a')]);_0x2b8866({'code':0xc8,'message':_0x306592});});},'FaxAccounts':function(){return new Promise(function(_0x3de941){var _0xca4398=_[_0x074f('0x58')](_0x51fbdc[_0x074f('0x82')]);_0x3de941({'count':_0xca4398[_0x074f('0x54')],'rows':_0xca4398});});},'SendFax':function(_0x38be8b){var _0x7c6558=this;return new Promise(function(_0x2dcb59,_0xce17a6){_0x8965cc[_0x074f('0x83')](_0x38be8b)[_0x074f('0x19')](function(_0x30cdbb){_0x2dcb59({'code':0xc8,'message':_0x30cdbb[_0x074f('0x1a')]});})[_0x074f('0x1b')](function(_0x58e92e){_0xce17a6(_0x7c6558[_0x074f('0xe')](0x1f4,_0x58e92e[_0x074f('0x1a')]));});});},'CheckAfterSend':function(_0x3eeaee){var _0x352b89=this;return new Promise(function(_0x5d2571,_0x5299fb){_0x8965cc['checkAfterSend'](_0x3eeaee)[_0x074f('0x19')](function(_0x55c8d4){_0x5d2571({'code':0xc8,'message':_0x55c8d4[_0x074f('0x1a')]});})[_0x074f('0x1b')](function(_0x39ce55){_0x5299fb(_0x352b89[_0x074f('0xe')](0x1f4,_0x39ce55[_0x074f('0x1a')]));});});}};var _0x36ecce=jayson[_0x074f('0x84')](_0x10b244)[_0x074f('0x85')]();_0x36ecce['on'](_0x074f('0xe'),function(_0xfc5f6b){return _0x126607(_0xfc5f6b);});_0x36ecce[_0x074f('0x86')](0x232a,_0x074f('0x87'),function(){console[_0x074f('0x88')](_0x074f('0x89'),0x232a);return _0x203f47(_0x074f('0x8a')+0x232a);});});}; \ No newline at end of file +var _0x8130=['erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','voicechannel','find','uniqueid','channel','filename','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','channels','resolve','StopMixMonitor','destinationchannel','%s.%s','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','values','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','keys','action','Reload','Action','then','message','catch','error','username','pick','command','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8130,0x146));var _0x0813=function(_0x2f8f15,_0x1cfd5d){_0x2f8f15=_0x2f8f15-0x0;var _0x87c1c8=_0x8130[_0x2f8f15];return _0x87c1c8;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var jayson=require('jayson/promise');var schema=require(_0x0813('0x2'));var moment=require(_0x0813('0x3'));var config=require(_0x0813('0x4'));var properties=require(_0x0813('0x5'));var ami=require(_0x0813('0x6'));exports[_0x0813('0x7')]=function(_0x4e66f4,_0x442a9b,_0x578c7c){return new Promise(function(_0x563ee2,_0x306454){var _0x2df45a={'QueuePause':function(_0x2bbdfd){return new Promise(function(_0x19a508){var _0x2ab8f0=util[_0x0813('0x8')](_0x0813('0x9'),'SIP',_0x2bbdfd[_0x0813('0xa')]);if(_0x4e66f4[_0x0813('0xb')]&&_0x4e66f4[_0x0813('0xb')][_0x2ab8f0]&&_0x4e66f4['timers'][_0x2ab8f0]['timer']){_0x4e66f4[_0x0813('0xb')][_0x2ab8f0]['updateAcw']();}if(_0x4e66f4[_0x0813('0xc')][_0x2ab8f0]){_0x4e66f4['agents'][_0x2ab8f0][_0x0813('0xd')]({'statePause':_0x2bbdfd[_0x0813('0xe')]?!![]:![]});}_0x19a508({'code':0xc8,'message':_0x0813('0xf')});});},'Reload':function(_0x230ec7){var _0x5b17f2=this;return new Promise(function(_0x4dcc3a,_0x29bdd8){if(ami[_0x0813('0x10')]()==![]){return _0x29bdd8(_0x5b17f2['error'](0x1f4,[config[_0x0813('0x11')]['ip'],config['asterisk']['username'],_0x0813('0x12')][_0x0813('0x13')]('\x20')));}_0x230ec7=_['pick'](_0x230ec7,_[_0x0813('0x14')](properties['module']));_0x230ec7[_0x0813('0x15')]=_0x0813('0x16');return ami[_0x0813('0x17')](_0x230ec7)[_0x0813('0x18')](function(_0x96a8){_0x4dcc3a({'code':0xc8,'message':_0x96a8[_0x0813('0x19')]});})[_0x0813('0x1a')](function(_0x3e15da){_0x29bdd8(_0x5b17f2['error'](0x1f5,_0x3e15da[_0x0813('0x19')]));});});},'Command':function(_0x555c32){var _0x112720=this;return new Promise(function(_0x14c55c,_0x518923){if(ami[_0x0813('0x10')]()==![]){return _0x518923(_0x112720[_0x0813('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x0813('0x11')][_0x0813('0x1c')],'ami\x20disconnected'][_0x0813('0x13')]('\x20')));}_0x555c32=_[_0x0813('0x1d')](_0x555c32,_0x0813('0x1e'));_0x555c32[_0x0813('0x15')]=_0x0813('0x1f');return ami['Action'](_0x555c32)[_0x0813('0x18')](function(_0x3aa1b6){_0x14c55c({'code':0xc8,'message':_0x3aa1b6[_0x0813('0x20')]});})['catch'](function(_0x35b3d6){_0x518923(_0x112720['error'](0x1f5,_0x35b3d6['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x2655b6){var _0x50ad7b=[];for(var _0x5eb50e in _0x4e66f4[_0x0813('0x21')]){if(_0x4e66f4[_0x0813('0x21')][_0x0813('0x22')](_0x5eb50e)){var _0x2f8849=_0x4e66f4[_0x0813('0x21')][_0x5eb50e];var _0x1418c7={'id':_0x2f8849['id'],'name':_0x2f8849[_0x0813('0xa')],'strategy':_0x2f8849[_0x0813('0x23')],'answered':_0x2f8849['answered'],'available':_0x2f8849[_0x0813('0x24')],'loggedIn':_0x2f8849[_0x0813('0x25')],'pTalking':_0x2f8849[_0x0813('0x26')],'sumBillable':_0x2f8849[_0x0813('0x27')],'sumDuration':_0x2f8849[_0x0813('0x28')],'sumHoldTime':_0x2f8849[_0x0813('0x29')]||0x0,'talking':_0x2f8849['talking'],'total':_0x2f8849[_0x0813('0x2a')],'type':_0x2f8849[_0x0813('0x2b')],'unmanaged':_0x2f8849['unmanaged'],'abandoned':_0x2f8849['abandoned'],'waiting':_0x2f8849[_0x0813('0x2c')],'loggedInDb':_0x2f8849[_0x0813('0x2d')]};if(_0x2f8849[_0x0813('0x2b')]===_0x0813('0x2e')){_0x1418c7[_0x0813('0x2f')]=_0x2f8849[_0x0813('0x2f')];_0x1418c7['dialMethod']=_0x2f8849[_0x0813('0x30')];_0x1418c7[_0x0813('0x31')]=_0x2f8849['dialOriginateCallerIdName'];_0x1418c7['dialOriginateCallerIdNumber']=_0x2f8849[_0x0813('0x32')];_0x1418c7[_0x0813('0x33')]=_0x2f8849[_0x0813('0x33')];_0x1418c7['dialPrefix']=_0x2f8849[_0x0813('0x34')];_0x1418c7[_0x0813('0x35')]=_0x2f8849['temp'];_0x1418c7['outboundAnswerAgiCallsDay']=_0x2f8849[_0x0813('0x36')];_0x1418c7[_0x0813('0x37')]=_0x2f8849[_0x0813('0x37')];_0x1418c7[_0x0813('0x38')]=_0x2f8849['outboundBlacklistCallsDay'];_0x1418c7[_0x0813('0x39')]=_0x2f8849[_0x0813('0x39')];_0x1418c7[_0x0813('0x3a')]=_0x2f8849[_0x0813('0x3a')];_0x1418c7['outboundDropCallsDayACS']=_0x2f8849['outboundDropCallsDayACS'];_0x1418c7[_0x0813('0x3b')]=_0x2f8849[_0x0813('0x3b')];_0x1418c7[_0x0813('0x3c')]=_0x2f8849['outboundDropCallsDayTimeout'];_0x1418c7[_0x0813('0x3d')]=_0x2f8849[_0x0813('0x3d')];_0x1418c7[_0x0813('0x3e')]=_0x2f8849['outboundNoSuchCallsDay'];_0x1418c7['outboundOriginateFailureCallsDay']=_0x2f8849[_0x0813('0x3f')];_0x1418c7[_0x0813('0x40')]=_0x2f8849[_0x0813('0x40')];_0x1418c7[_0x0813('0x41')]=_0x2f8849[_0x0813('0x41')];_0x1418c7[_0x0813('0x42')]=_0x2f8849['outboundUnknownCallsDay'];_0x1418c7[_0x0813('0x43')]=_0x2f8849['predictiveIntervalAnsweredCalls'];_0x1418c7['predictiveIntervalAvgHoldtime']=_0x2f8849['predictiveIntervalAvgHoldtime'];_0x1418c7[_0x0813('0x44')]=_0x2f8849[_0x0813('0x44')];_0x1418c7['predictiveIntervalDroppedCallsCallersExit']=_0x2f8849['predictiveIntervalDroppedCallsCallersExit'];_0x1418c7[_0x0813('0x45')]=_0x2f8849[_0x0813('0x45')];_0x1418c7[_0x0813('0x46')]=_0x2f8849[_0x0813('0x46')];_0x1418c7[_0x0813('0x47')]=_0x2f8849[_0x0813('0x47')];_0x1418c7[_0x0813('0x48')]=_0x2f8849[_0x0813('0x48')];_0x1418c7[_0x0813('0x49')]=_0x2f8849[_0x0813('0x49')];_0x1418c7['predictiveIntervalPauses']=_0x2f8849['predictiveIntervalPauses'];_0x1418c7['predictiveIntervalAvailable']=_0x2f8849[_0x0813('0x4a')];_0x1418c7[_0x0813('0x4b')]=_0x2f8849['predictiveIntervalTotalCalls'];_0x1418c7[_0x0813('0x19')]=_0x2f8849[_0x0813('0x19')];_0x1418c7[_0x0813('0x4c')]=_0x2f8849['originated'];_0x1418c7[_0x0813('0x4d')]=_0x2f8849[_0x0813('0x4d')];_0x1418c7[_0x0813('0x4e')]=_0x2f8849['erlangCallToSecond'];_0x1418c7[_0x0813('0x4f')]=_0x2f8849[_0x0813('0x4f')];_0x1418c7[_0x0813('0x50')]=_0x2f8849['erlangBusyFactor'];_0x1418c7[_0x0813('0x51')]=_0x2f8849[_0x0813('0x51')];_0x1418c7['startProgressive']=_0x2f8849[_0x0813('0x52')];}if(_0x2f8849[_0x0813('0x53')]){_0x1418c7['Trunk']={'id':_0x2f8849[_0x0813('0x53')]['id'],'name':_0x2f8849['Trunk'][_0x0813('0xa')],'active':_0x2f8849[_0x0813('0x53')][_0x0813('0x54')],'callerid':_0x2f8849['Trunk'][_0x0813('0x55')]};}if(_0x2f8849['Interval']){_0x1418c7[_0x0813('0x56')]={'id':_0x2f8849[_0x0813('0x56')]['id'],'name':_0x2f8849[_0x0813('0x56')][_0x0813('0xa')]};}_0x50ad7b[_0x0813('0x57')](_0x1418c7);}}_0x2655b6({'count':_0x50ad7b[_0x0813('0x58')],'rows':_0x50ad7b});});},'UpdateVoiceQueue':function(_0x48e8aa){return new Promise(function(_0x146546,_0x594d1d){var _0x182154=_['find'](_0x4e66f4['voiceQueues'],{'id':parseInt(_0x48e8aa['id'])});var _0x54647c=_[_0x0813('0x59')](_0x48e8aa,['id']);if(_0x182154){for(var _0x141049 in _0x54647c){if(typeof _0x54647c[_0x141049]!==_0x0813('0x5a')&&typeof _0x182154[_0x141049]!==_0x0813('0x5a')){_0x182154[_0x141049]=_0x54647c[_0x141049];}}_0x146546(_0x182154);}else{_0x594d1d();}});},'VoiceChannels':function(){return new Promise(function(_0x1a07f6){var _0x308081=_['values'](_0x4e66f4['channels']);_0x1a07f6({'count':_0x308081[_0x0813('0x58')],'rows':_0x308081});});},'VoiceChannelMixMonitor':function(_0x82a59b){var _0x19fab7=this;return new Promise(function(_0x3fd5f9,_0xadaead){if(ami[_0x0813('0x10')]()==![]){return _0xadaead(_0x19fab7[_0x0813('0x1b')](0x1f4,[config[_0x0813('0x11')]['ip'],config['asterisk'][_0x0813('0x1c')],_0x0813('0x12')][_0x0813('0x13')]('\x20')));}var _0x1baf77=schema(properties[_0x0813('0x5b')])[_0x0813('0x2')](_0x82a59b);if(_0x1baf77['length']>0x0){return _0xadaead(_0x19fab7[_0x0813('0x1b')](0x1f4,_['map'](_0x1baf77,_0x0813('0x19'))[_0x0813('0x13')](',\x20')));}var _0x10e3b9=_[_0x0813('0x5c')](_0x4e66f4['channels'],{'uniqueid':_0x82a59b[_0x0813('0x5d')]});if(_0x10e3b9&&_0x10e3b9[_0x0813('0x5e')]){var _0x353e25=util[_0x0813('0x8')]('%s.%s',_0x82a59b[_0x0813('0x5f')]||_0x82a59b[_0x0813('0x5d')],_0x82a59b['format']||'wav');return ami[_0x0813('0x17')]({'action':_0x0813('0x60'),'channel':_0x10e3b9[_0x0813('0x5e')],'file':_0x353e25,'options':'ai(mixmonitorid)'})['then'](function(_0x5c596a){var _0x497aab=_[_0x0813('0x5c')](_0x10e3b9[_0x0813('0x61')],{'filename':_0x0813('0x62')+_0x353e25[_0x0813('0x63')]()});if(_['isNil'](_0x497aab)){_0x10e3b9[_0x0813('0x61')][_0x0813('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x353e25['toLowerCase'](),'createdAt':moment()[_0x0813('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5c596a[_0x0813('0x64')],'status':_0x0813('0x65')});}else{_0x497aab[_0x0813('0x64')]=_0x5c596a['mixmonitorid'];_0x497aab[_0x0813('0x66')]=_0x0813('0x65');}_0x3fd5f9({'code':0xc8,'message':[_0x82a59b[_0x0813('0x5d')],_0x0813('0x67'),_0x5c596a[_0x0813('0x64')]][_0x0813('0x13')]('\x20'),'mixmonitorid':_0x5c596a['mixmonitorid']});})['catch'](function(_0x40ae2d){_0xadaead(_0x19fab7[_0x0813('0x1b')](0x1f5,[_0x82a59b[_0x0813('0x5d')],_0x40ae2d[_0x0813('0x19')]['toLowerCase']()][_0x0813('0x13')]('\x20')));});}else{return _0xadaead(_0x19fab7['error'](0x1f5,_0x0813('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x13e1fc){var _0x76fecb=this;return new Promise(function(_0x28a05,_0x19b183){if(ami[_0x0813('0x10')]()==![]){return _0x19b183(_0x76fecb[_0x0813('0x1b')](0x1f4,[config[_0x0813('0x11')]['ip'],config['asterisk'][_0x0813('0x1c')],_0x0813('0x12')][_0x0813('0x13')]('\x20')));}var _0x3dc5ec=schema(properties[_0x0813('0x5b')])[_0x0813('0x2')](_0x13e1fc);if(_0x3dc5ec[_0x0813('0x58')]>0x0){return _0x19b183(_0x76fecb['error'](0x1f4,_[_0x0813('0x69')](_0x3dc5ec,_0x0813('0x19'))[_0x0813('0x13')](',\x20')));}var _0x573cdf=_[_0x0813('0x5c')](_0x4e66f4[_0x0813('0x6a')],{'uniqueid':_0x13e1fc[_0x0813('0x5d')]});if(_0x573cdf){return Promise[_0x0813('0x6b')]()[_0x0813('0x18')](function(){if(_0x573cdf[_0x0813('0x5e')]){return ami[_0x0813('0x17')]({'action':_0x0813('0x6c'),'channel':_0x573cdf[_0x0813('0x5e')],'mixmonitorid':_0x13e1fc[_0x0813('0x64')]})[_0x0813('0x1a')](function(){});}})['then'](function(){if(_0x573cdf[_0x0813('0x6d')]){return ami[_0x0813('0x17')]({'action':'StopMixMonitor','channel':_0x573cdf[_0x0813('0x6d')],'mixmonitorid':_0x13e1fc['mixmonitorid']})[_0x0813('0x1a')](function(){});}})['then'](function(){var _0x587645=_['find'](_0x573cdf[_0x0813('0x61')],{'mixmonitorid':_0x13e1fc[_0x0813('0x64')]});if(_0x587645){_0x587645[_0x0813('0x66')]='stop';}})[_0x0813('0x18')](function(){var _0x5783cd=util['format'](_0x0813('0x6e'),_0x13e1fc['filename']||_0x13e1fc[_0x0813('0x5d')],_0x13e1fc[_0x0813('0x8')]||_0x0813('0x6f'));var _0x341f04=_[_0x0813('0x5c')](_0x573cdf[_0x0813('0x61')],{'filename':_0x0813('0x62')+_0x5783cd[_0x0813('0x63')]()});if(_0x341f04){_0x341f04[_0x0813('0x66')]='stop';}})['then'](function(){_0x28a05({'code':0xc8,'message':[_0x13e1fc['uniqueid'],_0x0813('0x70')][_0x0813('0x13')]('\x20')});})[_0x0813('0x1a')](function(_0xf556f0){_0x19b183(_0x76fecb[_0x0813('0x1b')](0x1f5,[_0x13e1fc['uniqueid'],_0xf556f0['message'][_0x0813('0x63')]()]['join']('\x20')));});}else{return _0x19b183(_0x76fecb[_0x0813('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x447fed){var _0x35b22d=_['values'](_0x4e66f4['queueChannels']);_0x447fed({'count':_0x35b22d[_0x0813('0x58')],'rows':_0x35b22d});});},'VoiceQueuesChannel':function(_0x3c962a){var _0x17083f=this;return new Promise(function(_0x527bfa,_0x315944){var _0xbdf9fd=schema(properties['voicequeuechannel'])[_0x0813('0x2')](_0x3c962a);if(_0xbdf9fd[_0x0813('0x58')]>0x0){return _0x315944(_0x17083f['error'](0x1f4,_[_0x0813('0x69')](_0xbdf9fd,_0x0813('0x19'))[_0x0813('0x13')](',\x20')));}var _0x50d940=_[_0x0813('0x5c')](_0x4e66f4[_0x0813('0x71')],{'uniqueid':_0x3c962a['uniqueid']});if(_0x50d940){_0x527bfa(_0x50d940);}else{return _0x315944(_0x17083f[_0x0813('0x1b')](0x1f5,_0x0813('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x2b07c6){var _0x3f3615=this;return new Promise(function(_0x334b91,_0x17d4f4){if(ami['isConnected']()==![]){return _0x17d4f4(_0x3f3615[_0x0813('0x1b')](0x1f4,[config[_0x0813('0x11')]['ip'],config['asterisk']['username'],_0x0813('0x12')][_0x0813('0x13')]('\x20')));}var _0x44e141=schema(properties[_0x0813('0x72')])['validate'](_0x2b07c6);if(_0x44e141['length']>0x0){return _0x17d4f4(_0x3f3615[_0x0813('0x1b')](0x1f4,_[_0x0813('0x69')](_0x44e141,_0x0813('0x19'))['join'](',\x20')));}var _0x3ca55b=_[_0x0813('0x5c')](_0x4e66f4[_0x0813('0x71')],{'uniqueid':_0x2b07c6[_0x0813('0x5d')]});if(_0x3ca55b&&_0x3ca55b['channel']){return ami[_0x0813('0x17')]({'action':_0x0813('0x73'),'channel':_0x3ca55b[_0x0813('0x5e')]})[_0x0813('0x18')](function(_0x3ca560){_0x334b91({'code':0xc8,'message':[_0x2b07c6[_0x0813('0x5d')],_0x3ca560[_0x0813('0x19')][_0x0813('0x63')]()][_0x0813('0x13')]('\x20')});})[_0x0813('0x1a')](function(_0x477281){_0x17d4f4(_0x3f3615[_0x0813('0x1b')](0x1f5,[_0x2b07c6[_0x0813('0x5d')],_0x477281[_0x0813('0x19')][_0x0813('0x63')]()][_0x0813('0x13')]('\x20')));});}else{return _0x17d4f4(_0x3f3615['error'](0x1f5,_0x0813('0x68')));}});},'VoiceQueuesChannelRedirect':function(_0x149fb7){var _0x2d7316=this;return new Promise(function(_0x29af6d,_0x48ee01){if(ami['isConnected']()==![]){return _0x48ee01(_0x2d7316['error'](0x1f4,[config[_0x0813('0x11')]['ip'],config[_0x0813('0x11')]['username'],_0x0813('0x12')][_0x0813('0x13')]('\x20')));}var _0x5a61c5=schema(properties[_0x0813('0x74')])[_0x0813('0x2')](_0x149fb7);if(_0x5a61c5[_0x0813('0x58')]>0x0){return _0x48ee01(_0x2d7316[_0x0813('0x1b')](0x1f4,_[_0x0813('0x69')](_0x5a61c5,_0x0813('0x19'))['join'](',\x20')));}var _0x235e61=_['find'](_0x4e66f4[_0x0813('0x71')],{'uniqueid':_0x149fb7[_0x0813('0x5d')]});if(_0x235e61&&_0x235e61[_0x0813('0x5e')]){return ami[_0x0813('0x17')]({'action':_0x0813('0x75'),'channel':_0x235e61['channel'],'exten':_0x149fb7[_0x0813('0x76')],'context':_0x149fb7[_0x0813('0x77')]||_0x235e61[_0x0813('0x77')],'priority':0x1})['then'](function(_0x5e5969){_0x29af6d({'code':0xc8,'message':[_0x149fb7[_0x0813('0x5d')],_0x5e5969[_0x0813('0x19')][_0x0813('0x63')]()][_0x0813('0x13')]('\x20')});})[_0x0813('0x1a')](function(_0x4ad155){_0x48ee01(_0x2d7316[_0x0813('0x1b')](0x1f5,[_0x149fb7[_0x0813('0x5d')],_0x4ad155['message'][_0x0813('0x63')]()][_0x0813('0x13')]('\x20')));});}else{return _0x48ee01(_0x2d7316[_0x0813('0x1b')](0x1f5,_0x0813('0x68')));}});},'Agents':function(_0x24867c){return new Promise(function(_0x24e229){var _0x4f82a7=_[_0x0813('0x78')](_0x4e66f4[_0x0813('0xc')]);if(_0x24867c&&_0x24867c['id']){var _0x5ed158=_[_0x0813('0x5c')](_0x4f82a7,function(_0x39ee17){return _0x39ee17['id']===_0x24867c['id'];});_0x24e229(_0x5ed158);}else{_0x24e229({'count':_0x4f82a7['length'],'rows':_0x4f82a7});}});},'Telephones':function(){return new Promise(function(_0x4342d3){var _0x58315a=_[_0x0813('0x78')](_0x4e66f4['telephones']);_0x4342d3({'count':_0x58315a[_0x0813('0x58')],'rows':_0x58315a});});},'Trunks':function(){return new Promise(function(_0x222a98){var _0xa29fbc=_['values'](_0x4e66f4[_0x0813('0x79')]);_0x222a98({'count':_0xa29fbc[_0x0813('0x58')],'rows':_0xa29fbc});});},'OutboundChannels':function(){return new Promise(function(_0x4c2251){var _0x3662fc=_[_0x0813('0x78')](_0x4e66f4[_0x0813('0x7a')]);_0x4c2251({'count':_0x3662fc[_0x0813('0x58')],'rows':_0x3662fc});});},'Outbound':function(){return new Promise(function(_0x5c3891){_0x5c3891(_0x4e66f4[_0x0813('0x2e')]);});},'Campaigns':function(){return new Promise(function(_0x59c0cd){var _0x13ff2a=_['values'](_0x4e66f4['campaigns']);_0x59c0cd({'count':_0x13ff2a[_0x0813('0x58')],'rows':_0x13ff2a});});},'VoiceQueuesPreview':function(_0x49dd7d){var _0x11d58a=this;return new Promise(function(_0x174374,_0x313ec0){_0x442a9b[_0x0813('0x7b')](_0x49dd7d['id'])['then'](function(_0x2d074e){_0x174374({'code':0xc8,'message':_0x2d074e[_0x0813('0x19')]});})[_0x0813('0x1a')](function(_0x17f2ad){_0x313ec0(_0x11d58a['error'](0x1f4,_0x17f2ad[_0x0813('0x19')]));});});},'EventManager':function(_0x401fa3){var _0x21b632=this;return new Promise(function(_0x5461cb,_0x13e5f1){if(!_0x401fa3['event']){return _0x13e5f1(_0x21b632['error'](0x1f4,_0x0813('0x7c')));}ami[_0x0813('0x7d')](_0x0813('0x7e')+_0x401fa3['event'],_0x401fa3['message']);_0x5461cb({'code':0xc8,'message':_0x401fa3});});},'FaxAccounts':function(){return new Promise(function(_0x34c269){var _0x40530e=_['values'](_0x4e66f4[_0x0813('0x7f')]);_0x34c269({'count':_0x40530e[_0x0813('0x58')],'rows':_0x40530e});});},'SendFax':function(_0xdbb037){var _0x1e49d7=this;return new Promise(function(_0x313f59,_0x5ab3c5){_0x578c7c[_0x0813('0x80')](_0xdbb037)['then'](function(_0x57f98a){_0x313f59({'code':0xc8,'message':_0x57f98a[_0x0813('0x19')]});})[_0x0813('0x1a')](function(_0x299fd){_0x5ab3c5(_0x1e49d7['error'](0x1f4,_0x299fd[_0x0813('0x19')]));});});},'CheckAfterSend':function(_0x597df9){var _0x41b0bb=this;return new Promise(function(_0x3c12ab,_0xcc5884){_0x578c7c[_0x0813('0x81')](_0x597df9)[_0x0813('0x18')](function(_0x234fe6){_0x3c12ab({'code':0xc8,'message':_0x234fe6['message']});})[_0x0813('0x1a')](function(_0x294360){_0xcc5884(_0x41b0bb[_0x0813('0x1b')](0x1f4,_0x294360[_0x0813('0x19')]));});});}};var _0x3ba596=jayson[_0x0813('0x82')](_0x2df45a)[_0x0813('0x83')]();_0x3ba596['on'](_0x0813('0x1b'),function(_0x3d69c8){return _0x306454(_0x3d69c8);});_0x3ba596[_0x0813('0x7')](0x232a,_0x0813('0x84'),function(){console['log'](_0x0813('0x85'),0x232a);return _0x563ee2(_0x0813('0x86')+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 447b2ff..4fb2a0e 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 _0xc822=['then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','map','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','info','stringify','data2','isNil','data5','xmd-contactid','data3','phone','$or','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','updatedAt','union','resolve','getContacts'];(function(_0x5b952e,_0x26158d){var _0x34d8f1=function(_0xb9cb51){while(--_0xb9cb51){_0x5b952e['push'](_0x5b952e['shift']());}};_0x34d8f1(++_0x26158d);}(_0xc822,0x1b7));var _0x2c82=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0xc822[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require(_0x2c82('0x0'));var BPromise=require(_0x2c82('0x1'));var Redis=require(_0x2c82('0x2'));var util=require('util');var config=require(_0x2c82('0x3'));var logger=require(_0x2c82('0x4'))('trigger');var cmContactRpc=require(_0x2c82('0x5'));config[_0x2c82('0x6')]=_[_0x2c82('0x7')](config[_0x2c82('0x6')],{'host':_0x2c82('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2c82('0x6')]));function emit(_0x1d7e23,_0xb590cb,_0x312774,_0x3a14fc,_0x4f233b){logger[_0x2c82('0x9')]('[CM][%s][%s]',_0x1d7e23,_0xb590cb['id'],_0x312774,_0x3a14fc,JSON[_0x2c82('0xa')](_0x4f233b));io['to'](_0x312774)['emit'](_0x3a14fc,_0x4f233b);}exports['exec']=function(_0x5c0a09,_0x34ecd2,_0xf25c34,_0x29b302){var _0x18ac1a,_0x47e9b8;var _0x36eb1f={};var _0x9402e7;var _0x3ac311=Number(_0xf25c34['data1']);var _0x1ea0ef=_0xf25c34[_0x2c82('0xb')]?Boolean(Number(_0xf25c34['data2'])):![];var _0x15fba5;var _0x441f52=![];if(!_[_0x2c82('0xc')](_0xf25c34[_0x2c82('0xd')])){if(_0xf25c34[_0x2c82('0xd')]=='1')_0x441f52=!![];}if(!_0x441f52){if(_0x29b302['xmd-contactid']){_0x36eb1f['id']=_0x29b302[_0x2c82('0xe')];}}if(!_0x36eb1f['id']){_0x36eb1f['ListId']=_0x3ac311;_0x15fba5=_0xf25c34[_0x2c82('0xf')]&&_0xf25c34['data3']!=='0'?_0xf25c34['data3']['split'](','):[_0x2c82('0x10')];_0x36eb1f[_0x2c82('0x11')]=_['map'](_0x15fba5,function(_0x994eef){var _0x58bb76={};_0x58bb76[_0x994eef]=_0x29b302[_0x2c82('0x12')]?_0x29b302['destcalleridnum']:_0x29b302['calleridnum'];return _0x58bb76;});_0x9402e7=_0x29b302[_0x2c82('0x12')]?_0x29b302[_0x2c82('0x13')]:_0x29b302[_0x2c82('0x14')];}var _0x6da762=['id',_0x2c82('0x15'),'lastName','phone',_0x2c82('0x16'),_0x2c82('0x17'),'ListId',_0x2c82('0x18'),'scheduledAt',_0x2c82('0x19')];var _0x1267f4=_[_0x2c82('0x1a')](_0x6da762,_0x15fba5);BPromise[_0x2c82('0x1b')]()['then'](cmContactRpc[_0x2c82('0x1c')]({'attributes':_0x1267f4,'where':_0x36eb1f,'phone':_0x9402e7}))[_0x2c82('0x1d')](function(_0x319e1d){_0x47e9b8=_0x319e1d;if(!_[_0x2c82('0x1e')](_0x47e9b8)){if(_0x47e9b8[_0x2c82('0x1f')]===0x1){_0x18ac1a=_0x47e9b8[0x0];logger[_0x2c82('0x9')](_0x2c82('0x20'),_0x29b302[_0x2c82('0x21')],_0x34ecd2['id'],_0x18ac1a['id']);}else{logger['info']('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x29b302[_0x2c82('0x21')],_0x34ecd2['id'],_[_0x2c82('0x22')](_0x47e9b8,'id')['join'](','));}return;}else{logger[_0x2c82('0x9')](_0x2c82('0x23'),_0x29b302[_0x2c82('0x21')],_0x34ecd2['id']);var _0x39e617={'ListId':_0x3ac311};var _0x35935c=_0xf25c34[_0x2c82('0x24')]&&_0xf25c34['data4']!=='0'?_0xf25c34[_0x2c82('0x24')]:_0x2c82('0x10');if(_0x1ea0ef){logger[_0x2c82('0x9')](_0x2c82('0x25'),_0x29b302[_0x2c82('0x21')],_0x34ecd2['id']);_0x39e617[_0x35935c]=_[_0x2c82('0xc')](_0x29b302[_0x2c82('0x12')])?_0x29b302['calleridnum']:_0x29b302[_0x2c82('0x13')];if(_[_0x2c82('0xc')](_0x29b302[_0x2c82('0x12')])){_0x39e617[_0x2c82('0x15')]=_0x29b302[_0x2c82('0x26')]&&_0x29b302[_0x2c82('0x26')]!==_0x2c82('0x27')?_0x29b302[_0x2c82('0x26')]:'Unknown';}else{_0x39e617['firstName']=_0x29b302['destcalleridname']&&_0x29b302[_0x2c82('0x28')]!==_0x2c82('0x27')?_0x29b302[_0x2c82('0x28')]:_0x2c82('0x29');}return BPromise[_0x2c82('0x1b')]()[_0x2c82('0x1d')](cmContactRpc[_0x2c82('0x2a')](_0x39e617))[_0x2c82('0x1d')](function(_0x1429f6){_0x18ac1a=_0x1429f6;_0x47e9b8[_0x2c82('0x2b')](_0x1429f6);if(_0x18ac1a){logger[_0x2c82('0x9')](_0x2c82('0x2c'),_0x29b302[_0x2c82('0x21')],_0x34ecd2['id'],_0x18ac1a['id']);}return;});}else{logger[_0x2c82('0x9')](_0x2c82('0x2d'),_0x29b302[_0x2c82('0x21')],_0x34ecd2['id']);_0x39e617[_0x35935c]=_[_0x2c82('0xc')](_0x29b302[_0x2c82('0x12')])?_0x29b302[_0x2c82('0x14')]:_0x29b302[_0x2c82('0x13')];if(_[_0x2c82('0xc')](_0x29b302[_0x2c82('0x12')])){_0x39e617[_0x2c82('0x15')]=_0x29b302[_0x2c82('0x26')]&&_0x29b302[_0x2c82('0x26')]!==''?_0x29b302['calleridname']:_0x2c82('0x29');}else{_0x39e617['firstName']=_0x29b302[_0x2c82('0x28')]&&_0x29b302['destcalleridname']!==''?_0x29b302['destcalleridname']:_0x2c82('0x29');}_0x18ac1a=_0x39e617;_0x47e9b8[_0x2c82('0x2b')](_0x39e617);return;}}})[_0x2c82('0x1d')](function(){if(_0x5c0a09){emit(_0x29b302['uniqueid'],_0x34ecd2,util[_0x2c82('0x2e')](_0x2c82('0x2f'),_0x5c0a09[_0x2c82('0x30')]),util[_0x2c82('0x2e')]('trigger:%s',_0xf25c34[_0x2c82('0x31')][_0x2c82('0x32')]()),{'evt':_[_0x2c82('0x33')](_0x29b302,{'autoCreate':_0x1ea0ef}),'contact':_0x18ac1a===undefined?{}:_0x18ac1a,'contacts':_0x47e9b8[_0x2c82('0x1f')]===0x0?undefined:_0x47e9b8});}});}; \ No newline at end of file +var _0xb8f0=['util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','lastName','phone','mobile','fax','createdAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','firstName','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','calleridnum','format','user:%s','trigger:%s','action','merge','ioredis'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb8f0,0x6d));var _0x0b8f=function(_0x3ddca9,_0x576a5b){_0x3ddca9=_0x3ddca9-0x0;var _0x527f02=_0xb8f0[_0x3ddca9];return _0x527f02;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x0b8f('0x0'));var util=require(_0x0b8f('0x1'));var config=require(_0x0b8f('0x2'));var logger=require(_0x0b8f('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config['redis']=_[_0x0b8f('0x4')](config[_0x0b8f('0x5')],{'host':_0x0b8f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0b8f('0x5')]));function emit(_0x45d201,_0x2fbc42,_0x5e2ce4,_0x1ea34b,_0x525701){logger[_0x0b8f('0x7')](_0x0b8f('0x8'),_0x45d201,_0x2fbc42['id'],_0x5e2ce4,_0x1ea34b,JSON[_0x0b8f('0x9')](_0x525701));io['to'](_0x5e2ce4)[_0x0b8f('0xa')](_0x1ea34b,_0x525701);}exports['exec']=function(_0xf35b54,_0x304f4b,_0x2e0631,_0x6e325c){var _0x5581ed,_0x637f6b;var _0x1957f5={};var _0x42f30d;var _0x27ec33=Number(_0x2e0631[_0x0b8f('0xb')]);var _0x3da90b=_0x2e0631[_0x0b8f('0xc')]?Boolean(Number(_0x2e0631[_0x0b8f('0xc')])):![];var _0x570d8d;var _0x321b44=![];if(!_[_0x0b8f('0xd')](_0x2e0631[_0x0b8f('0xe')])){if(_0x2e0631[_0x0b8f('0xe')]=='1')_0x321b44=!![];}if(!_0x321b44){if(_0x6e325c[_0x0b8f('0xf')]){_0x1957f5['id']=_0x6e325c[_0x0b8f('0xf')];}}if(!_0x1957f5['id']){_0x1957f5[_0x0b8f('0x10')]=_0x27ec33;_0x570d8d=_0x2e0631[_0x0b8f('0x11')]&&_0x2e0631[_0x0b8f('0x11')]!=='0'?_0x2e0631[_0x0b8f('0x11')][_0x0b8f('0x12')](','):['phone'];_0x1957f5[_0x0b8f('0x13')]=_[_0x0b8f('0x14')](_0x570d8d,function(_0x6534dc){var _0x303e3a={};_0x303e3a[_0x6534dc]=_0x6e325c[_0x0b8f('0x15')]?_0x6e325c[_0x0b8f('0x16')]:_0x6e325c['calleridnum'];return _0x303e3a;});_0x42f30d=_0x6e325c['routeId']?_0x6e325c[_0x0b8f('0x16')]:_0x6e325c['calleridnum'];}var _0x1cbe18=['id','firstName',_0x0b8f('0x17'),_0x0b8f('0x18'),_0x0b8f('0x19'),_0x0b8f('0x1a'),'ListId',_0x0b8f('0x1b'),'scheduledAt',_0x0b8f('0x1c')];var _0x4ee2d0=_[_0x0b8f('0x1d')](_0x1cbe18,_0x570d8d);BPromise[_0x0b8f('0x1e')]()[_0x0b8f('0x1f')](cmContactRpc['getContacts']({'attributes':_0x4ee2d0,'where':_0x1957f5,'phone':_0x42f30d}))['then'](function(_0x4d5584){_0x637f6b=_0x4d5584;if(!_[_0x0b8f('0x20')](_0x637f6b)){if(_0x637f6b[_0x0b8f('0x21')]===0x1){_0x5581ed=_0x637f6b[0x0];logger[_0x0b8f('0x7')](_0x0b8f('0x22'),_0x6e325c[_0x0b8f('0x23')],_0x304f4b['id'],_0x5581ed['id']);}else{logger[_0x0b8f('0x7')](_0x0b8f('0x24'),_0x6e325c['uniqueid'],_0x304f4b['id'],_[_0x0b8f('0x14')](_0x637f6b,'id')[_0x0b8f('0x25')](','));}return;}else{logger[_0x0b8f('0x7')](_0x0b8f('0x26'),_0x6e325c[_0x0b8f('0x23')],_0x304f4b['id']);var _0x1c2800={'ListId':_0x27ec33};var _0x17d83b=_0x2e0631['data4']&&_0x2e0631['data4']!=='0'?_0x2e0631[_0x0b8f('0x27')]:'phone';if(_0x3da90b){logger[_0x0b8f('0x7')](_0x0b8f('0x28'),_0x6e325c[_0x0b8f('0x23')],_0x304f4b['id']);_0x1c2800[_0x17d83b]=_[_0x0b8f('0xd')](_0x6e325c[_0x0b8f('0x15')])?_0x6e325c['calleridnum']:_0x6e325c[_0x0b8f('0x16')];if(_[_0x0b8f('0xd')](_0x6e325c[_0x0b8f('0x15')])){_0x1c2800['firstName']=_0x6e325c[_0x0b8f('0x29')]&&_0x6e325c[_0x0b8f('0x29')]!==_0x0b8f('0x2a')?_0x6e325c['calleridname']:_0x0b8f('0x2b');}else{_0x1c2800[_0x0b8f('0x2c')]=_0x6e325c['destcalleridname']&&_0x6e325c[_0x0b8f('0x2d')]!==_0x0b8f('0x2a')?_0x6e325c[_0x0b8f('0x2d')]:'Unknown';}return BPromise['resolve']()[_0x0b8f('0x1f')](cmContactRpc[_0x0b8f('0x2e')](_0x1c2800))[_0x0b8f('0x1f')](function(_0x10e7bf){_0x5581ed=_0x10e7bf;_0x637f6b[_0x0b8f('0x2f')](_0x10e7bf);if(_0x5581ed){logger[_0x0b8f('0x7')](_0x0b8f('0x30'),_0x6e325c['uniqueid'],_0x304f4b['id'],_0x5581ed['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x6e325c[_0x0b8f('0x23')],_0x304f4b['id']);_0x1c2800[_0x17d83b]=_['isNil'](_0x6e325c[_0x0b8f('0x15')])?_0x6e325c[_0x0b8f('0x31')]:_0x6e325c['destcalleridnum'];if(_[_0x0b8f('0xd')](_0x6e325c[_0x0b8f('0x15')])){_0x1c2800[_0x0b8f('0x2c')]=_0x6e325c['calleridname']&&_0x6e325c[_0x0b8f('0x29')]!==_0x0b8f('0x2a')?_0x6e325c[_0x0b8f('0x29')]:_0x0b8f('0x2b');}else{_0x1c2800['firstName']=_0x6e325c[_0x0b8f('0x2d')]&&_0x6e325c[_0x0b8f('0x2d')]!==_0x0b8f('0x2a')?_0x6e325c[_0x0b8f('0x2d')]:_0x0b8f('0x2b');}_0x5581ed=_0x1c2800;_0x637f6b[_0x0b8f('0x2f')](_0x1c2800);return;}}})[_0x0b8f('0x1f')](function(){if(_0xf35b54){emit(_0x6e325c['uniqueid'],_0x304f4b,util[_0x0b8f('0x32')](_0x0b8f('0x33'),_0xf35b54['name']),util[_0x0b8f('0x32')](_0x0b8f('0x34'),_0x2e0631[_0x0b8f('0x35')]['toLowerCase']()),{'evt':_[_0x0b8f('0x36')](_0x6e325c,{'autoCreate':_0x3da90b}),'contact':_0x5581ed===undefined?{}:_0x5581ed,'contacts':_0x637f6b[_0x0b8f('0x21')]===0x0?undefined:_0x637f6b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 49a64a0..5cd203c 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 _0xd566=['membername','lastevent','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentreject','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','interface','checkTriggers','hasOwnProperty','checkTrigger','merge','Actions','contactmanager','motionbar','browser','TemplateId','html','data2','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','windowWidth','data5','800','data6','600','winApplication','winArguments','user:%s','name','format','trigger:%s:%s','action','toLowerCase','data1','jscripty','trigger:%s','exec','integration','routeId','urlforward','script','query','search','replace','channel','AllConditions','length','every','checkConditions','AnyConditions','some','account','chat','operator','ChatWebsiteId','AccountId','upperFirst','interaction','message','value','event','queue'];(function(_0xb6f5a4,_0x1d17ec){var _0x3bca2d=function(_0x2a51a8){while(--_0x2a51a8){_0xb6f5a4['push'](_0xb6f5a4['shift']());}};_0x3bca2d(++_0x1d17ec);}(_0xd566,0x100));var _0x6d56=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd566[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x6d56('0x0'));var _=require(_0x6d56('0x1'));var url=require(_0x6d56('0x2'));var Mustache=require(_0x6d56('0x3'));var Redis=require(_0x6d56('0x4'));var urlforward=require(_0x6d56('0x5'));var integration=require('./integration');var cmContact=require(_0x6d56('0x6'));var script=require(_0x6d56('0x7'));var config=require(_0x6d56('0x8'));var logger=require(_0x6d56('0x9'))('trigger');var ami=require('../ami');config[_0x6d56('0xa')]=_[_0x6d56('0xb')](config['redis'],{'host':_0x6d56('0xc'),'port':0x18eb});var io=require(_0x6d56('0xd'))(new Redis(config[_0x6d56('0xa')]));var operators={'equals':function(_0x1c4e99,_0x2bbc08){return _0x1c4e99==_0x2bbc08;},'not_equals':function(_0x15f37f,_0x8a7506){return _0x15f37f!=_0x8a7506;}};var barAndWebActions=['popup',_0x6d56('0x2'),_0x6d56('0xe')];function Trigger(_0x736ff9){this[_0x6d56('0xf')]=_0x736ff9[_0x6d56('0xf')];this[_0x6d56('0x10')]=_0x736ff9[_0x6d56('0x10')];this[_0x6d56('0x11')]=_0x736ff9[_0x6d56('0x11')];this['templates']=_0x736ff9[_0x6d56('0x12')];this[_0x6d56('0x13')]=_0x736ff9[_0x6d56('0x13')];this[_0x6d56('0x14')]=_0x736ff9[_0x6d56('0x14')];this[_0x6d56('0x15')]=_0x736ff9[_0x6d56('0x15')];this[_0x6d56('0x16')]=_0x736ff9[_0x6d56('0x16')];this[_0x6d56('0x17')]=_0x736ff9['sugarcrmAccounts'];this[_0x6d56('0x18')]=_0x736ff9['zohoAccounts'];this[_0x6d56('0x19')]=_0x736ff9[_0x6d56('0x19')];this['vtigerAccounts']=_0x736ff9[_0x6d56('0x1a')];this[_0x6d56('0x1b')]=_0x736ff9[_0x6d56('0x1b')];this[_0x6d56('0x1c')]=_0x736ff9[_0x6d56('0x1c')];this[_0x6d56('0x1d')]=_0x736ff9[_0x6d56('0x1d')];this[_0x6d56('0x1e')]={'zendesk':this[_0x6d56('0x14')],'salesforce':this[_0x6d56('0x16')],'freshdesk':this[_0x6d56('0x15')],'sugarcrm':this[_0x6d56('0x17')],'zoho':this[_0x6d56('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x6d56('0x1a')],'dynamics365':this[_0x6d56('0x1c')],'freshsales':this[_0x6d56('0x1d')],'servicenow':this[_0x6d56('0x1b')]};ami['on'](_0x6d56('0x1f'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on']('custom:agentconnect',this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x22'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x23'),this[_0x6d56('0x20')]['bind'](this));ami['on'](_0x6d56('0x24'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x25'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on']('custom:agentbusy',this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on']('custom:agentcongestion',this[_0x6d56('0x20')]['bind'](this));ami['on'](_0x6d56('0x26'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on']('custom:amd',this['syncCustomEvent'][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x27'),this[_0x6d56('0x20')]['bind'](this));ami['on'](_0x6d56('0x28'),this['syncCustomEvent'][_0x6d56('0x21')](this));ami['on']('custom:dialbegin',this[_0x6d56('0x29')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x2a'),this[_0x6d56('0x29')][_0x6d56('0x21')](this));ami['on']('custom:dialend',this[_0x6d56('0x29')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x2b'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x2c'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on']('custom:substatus',this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x2d'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on']('custom:outgoingmessage',this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on']('custom:acceptmessage',this[_0x6d56('0x20')][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x2e'),this['syncCustomEvent'][_0x6d56('0x21')](this));ami['on'](_0x6d56('0x2f'),this[_0x6d56('0x20')][_0x6d56('0x21')](this));}Trigger[_0x6d56('0x30')][_0x6d56('0x31')]=function(_0xe80839,_0x26b6a0,_0x416d45){logger['info'](_0xe80839,_0x26b6a0,JSON[_0x6d56('0x32')](_0x416d45));io['to'](_0xe80839)[_0x6d56('0x31')](_0x26b6a0,_0x416d45);};Trigger['prototype'][_0x6d56('0x20')]=function(_0x3704b4){var _0x53f609=_[_0x6d56('0x33')](_0x3704b4);if(typeof _0x53f609[_0x6d56('0x34')]===_0x6d56('0x35')){_0x53f609[_0x6d56('0x34')]='voice';}this['checkTriggers'](_0x53f609);};Trigger[_0x6d56('0x30')][_0x6d56('0x29')]=function(_0x18abad){if(this[_0x6d56('0x10')][_0x18abad[_0x6d56('0x36')]]){this[_0x6d56('0x20')](_0x18abad);}};Trigger['prototype'][_0x6d56('0x37')]=function(_0x1b9184){var _0x3cd511;for(var _0x35e992 in this[_0x6d56('0xf')]){if(this[_0x6d56('0xf')][_0x6d56('0x38')](_0x35e992)){if(this[_0x6d56('0xf')][_0x35e992]['status']){_0x3cd511=this[_0x6d56('0x39')](this['triggers'][_0x35e992],_0x1b9184);if(_0x3cd511){_[_0x6d56('0x3a')](_0x1b9184,_0x1b9184['variables']);for(var _0x40b110=0x0,_0x1d71a9,_0x174387,_0x4ec43e;_0x40b1100x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x40c3b9,_0x21d124){var _0x3401bd=function(_0x385b0c){while(--_0x385b0c){_0x40c3b9['push'](_0x40c3b9['shift']());}};_0x3401bd(++_0x21d124);}(_0x3e74,0x175));var _0x43e7=function(_0x31d991,_0x122cdf){_0x31d991=_0x31d991-0x0;var _0x37dfe4=_0x3e74[_0x31d991];return _0x37dfe4;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ 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 cca6714..b474aca 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 _0x2221=['destcalleridnum','telephone1','contactid','nothing',']\x20Enduser\x20created!','forEach','includes','picklist','nameField','customField','idField','indexOf','content','incidents','assign','getString','Descriptions','/contacts(','ticketType','Bearer\x20','phonecall','callDirection','queue','Subjects','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%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:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','defaults','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','clientId','password','clientSecret','catch','toUpperCase',']\x20Wrong\x20credentials!','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','info','userEmail','username','message','toLowerCase','outbound','calleridnum','POST','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId'];(function(_0x27bc65,_0x365d3f){var _0x448885=function(_0x1fe0f8){while(--_0x1fe0f8){_0x27bc65['push'](_0x27bc65['shift']());}};_0x448885(++_0x365d3f);}(_0x2221,0xa7));var _0x1222=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x2221[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x1222('0x0'));var rp=require(_0x1222('0x1'));var util=require(_0x1222('0x2'));var intUtil=require(_0x1222('0x3'));var md5=require('md5');var Redis=require(_0x1222('0x4'));var logger=require(_0x1222('0x5'))(_0x1222('0x6'));var config=require('../../../../config/environment');config['redis']=_[_0x1222('0x7')](config[_0x1222('0x8')],{'host':_0x1222('0x9'),'port':0x18eb});var io=require(_0x1222('0xa'))(new Redis(config[_0x1222('0x8')]));function getAuthToken(_0x231385,_0x1bc3bf,_0x1a92ba){if(_0x231385['modernAuthentication']){_0x231385[_0x1222('0xb')]=_0x231385[_0x1222('0xc')][_0x1222('0xd')];_0x231385[_0x1222('0xe')]=_0x231385[_0x1222('0xc')][_0x1222('0xf')];return Promise[_0x1222('0x10')](_0x231385[_0x1222('0xc')]['data5']);}var _0x596943={'method':'POST','uri':_0x1bc3bf,'form':{'client_id':_0x231385[_0x1222('0x11')],'resource':_0x231385['remoteUri'],'username':_0x231385['username'],'password':_0x231385['password'],'grant_type':_0x1222('0x12'),'client_secret':_0x231385[_0x1222('0x13')]},'json':!![]};return rp(_0x596943)['then'](function(_0x3ae6e7){return _0x3ae6e7['access_token'];})[_0x1222('0x14')](function(_0x48b1f0){logger['error']('['+[_0x1a92ba[_0x1222('0x15')]()]+_0x1222('0x16'));return _0x48b1f0['message'];});}function getUser(_0x3222ba,_0x5542e7,_0x3246ce,_0x5cd387,_0x24314a,_0x25076a){return new Promise(function(_0x52a87e,_0x1b2c46){return getAuthToken(_0x5542e7,_0x5cd387,_0x25076a)[_0x1222('0x17')](function(_0x178281){var _0x116e76={'method':_0x1222('0x18'),'uri':_0x24314a+_0x1222('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x178281,'OData-Version':_0x1222('0x1a')},'json':!![]};return rp(_0x116e76);})[_0x1222('0x17')](function(_0x43bde8){var _0x27d196=_0x43bde8[_0x1222('0x1b')];var _0x1ff99d=![];var _0x1fe01b=null;if(!_[_0x1222('0x1c')](_0x3246ce)){if(intUtil[_0x1222('0x1d')](_0x3246ce[_0x1222('0x1e')])){_0x3222ba['userEmail']=_0x3246ce[_0x1222('0x1e')];for(_0x1fe01b=0x0;_0x1fe01b<_0x27d196[_0x1222('0x1f')];_0x1fe01b++){if(_0x27d196[_0x1fe01b][_0x1222('0x20')]===_0x3246ce[_0x1222('0x1e')]&&!_0x27d196[_0x1fe01b]['isdisabled']){_0x1ff99d=!![];logger['info']('['+[_0x25076a['toUpperCase']()]+_0x1222('0x21')+_0x27d196[_0x1fe01b][_0x1222('0x22')]+'!');_0x3222ba[_0x1222('0x23')]=_0x27d196[_0x1fe01b][_0x1222('0x22')];}}}}if(!_0x1ff99d){logger[_0x1222('0x24')]('['+[_0x25076a[_0x1222('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3222ba[_0x1222('0x25')]=_0x5542e7[_0x1222('0x26')];for(_0x1fe01b=0x0;_0x1fe01b<_0x27d196['length'];_0x1fe01b++){if(_0x27d196[_0x1fe01b][_0x1222('0x20')]===_0x5542e7['username']){_0x3222ba['userId']=_0x27d196[_0x1fe01b]['systemuserid'];}}}_0x52a87e(_0x3222ba);})[_0x1222('0x14')](function(_0x36593a){_0x1b2c46(_0x36593a[_0x1222('0x27')]);});});}function createEndUser(_0x4035ac,_0xd5a0fe,_0x538055,_0x1ecbd8,_0x33ed85,_0x5bd936,_0x4aad5b){return new Promise(function(_0x19972e,_0x346540){return getAuthToken(_0xd5a0fe,_0x538055,_0x5bd936)[_0x1222('0x17')](function(_0xe802db){var _0x584926=_0x5bd936[_0x1222('0x28')]()===_0x1222('0x29')?_0x33ed85['destcalleridnum']:_0x33ed85[_0x1222('0x2a')];var _0x4d9097={'method':_0x1222('0x2b'),'uri':_0x1ecbd8+_0x1222('0x2c'),'body':{'fullname':_0x584926,'firstname':_0x584926,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1222('0x2d')+_0x4035ac[_0x1222('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0xe802db,'OData-Version':_0x1222('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x4d9097['body'][_0x4aad5b]=_0x584926;return rp(_0x4d9097);})[_0x1222('0x17')](function(_0x546877){var _0x29e0ef=_0x546877[_0x1222('0x2e')][_0x1222('0x2f')];var _0x8f6ac7=_0x29e0ef[_0x1222('0x30')](_0x29e0ef['lastIndexOf']('(')+0x1,_0x29e0ef[_0x1222('0x31')](')'));_0x4035ac[_0x1222('0x32')]=_0x8f6ac7;_0x19972e(_0x4035ac);})['catch'](function(_0x5758d7){_0x346540(_0x5758d7[_0x1222('0x27')]);});});}function getEndUser(_0x42c915,_0x53aa74,_0xe100bf,_0x547fdc,_0xf88787,_0x2d6405,_0x157c7b,_0x3754ea){var _0x3bd2d3=_0x2d6405['toLowerCase']()===_0x1222('0x29')?_0xf88787[_0x1222('0x33')]:_0xf88787[_0x1222('0x2a')];return getAuthToken(_0x53aa74,_0xe100bf,_0x2d6405)[_0x1222('0x17')](function(_0x24e667){_0x3754ea=_0x3754ea?_0x3754ea:_0x1222('0x34');var _0x48eb41={'method':_0x1222('0x18'),'uri':_0x547fdc+'contacts?$select='+_0x3754ea+'&$filter='+_0x3754ea+'\x20eq\x20\x27'+_0x3bd2d3['replace']('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x24e667,'If-None-Match':null,'OData-Version':_0x1222('0x1a')},'json':!![]};return rp(_0x48eb41);})[_0x1222('0x17')](function(_0xa210f4){var _0x2882c0=![];if(!_0xa210f4)return _0x2882c0;var _0x1368fe=_0xa210f4[_0x1222('0x1b')];for(var _0xc9947d=0x0;_0xc9947d<_0x1368fe[_0x1222('0x1f')];_0xc9947d++){if(_0x1368fe[_0xc9947d][_0x3754ea]===_0x3bd2d3){_0x2882c0=!![];_0x42c915[_0x1222('0x32')]=_0x1368fe[_0xc9947d][_0x1222('0x35')];}}return _0x2882c0;})[_0x1222('0x17')](function(_0x535ad4){if(_0x535ad4)return _0x42c915;if(_0x157c7b===_0x1222('0x36')){logger[_0x1222('0x24')]('['+[_0x2d6405[_0x1222('0x15')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x42c915;}return createEndUser(_0x42c915,_0x53aa74,_0xe100bf,_0x547fdc,_0xf88787,_0x2d6405,_0x3754ea)['then'](function(_0x5586f7){logger[_0x1222('0x24')]('['+[_0x2d6405[_0x1222('0x15')]()]+_0x1222('0x37'),_0x5586f7[_0x1222('0x32')]);return _0x5586f7;});});}function getCustomFields(_0x55a649,_0x4b70af,_0x41e875){var _0x288d4a={};if(_0x55a649[_0x1222('0x1f')]>0x0){_[_0x1222('0x38')](_0x55a649,function(_0xc01fa2){if(_[_0x1222('0x39')](['string',_0x1222('0x3a')],_0xc01fa2['type'])&&_0xc01fa2[_0x1222('0x3b')]&&!_0xc01fa2[_0x1222('0x3c')]){var _0x853326=_0xc01fa2[_0x1222('0x3d')][_0x1222('0x28')]();var _0x39dec2=_0x853326['substring'](0x0,_0x853326[_0x1222('0x3e')]('_'));var _0x5ea99f=_0x853326[_0x1222('0x30')](_0x853326['indexOf']('_')+0x1);if(_0x39dec2===_0x41e875){_0x288d4a[_0x5ea99f]=_0xc01fa2[_0x1222('0x3f')];}}});}return _0x288d4a;}function getTicket(_0x1e8c02,_0x241e9a,_0x1faba6,_0xb4480d,_0x256b9a,_0x103594,_0x2014f6){return new Promise(function(_0x3c7ba2,_0x5b3880){var _0x43aa18;return getAuthToken(_0x241e9a,_0x1faba6,_0x2014f6)['then'](function(_0x4b9593){if(_0x103594['ticketType']==='incident'){_0x43aa18={'method':_0x1222('0x2b'),'uri':_0xb4480d+_0x1222('0x40'),'body':Object[_0x1222('0x41')]({},{'title':intUtil[_0x1222('0x42')](_0x103594['Subjects'],_0x256b9a,'\x20'),'description':intUtil[_0x1222('0x42')](_0x103594[_0x1222('0x43')],_0x256b9a,'\x0a'),'customerid_contact@odata.bind':_0x1e8c02[_0x1222('0x32')]?_0x1222('0x44')+_0x1e8c02[_0x1222('0x32')]+')':undefined,'ownerid@odata.bind':_0x1222('0x2d')+_0x1e8c02[_0x1222('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x103594['Fields'],_0x256b9a,_0x103594[_0x1222('0x45')])),'headers':{'Authorization':_0x1222('0x46')+_0x4b9593,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x103594['ticketType']===_0x1222('0x47')){var _0x1d2299=_0x1e8c02[_0x1222('0x32')]?[{'partyid_systemuser@odata.bind':_0x1222('0x2d')+_0x1e8c02[_0x1222('0x23')]+')','participationtypemask':_0x1e8c02[_0x1222('0x48')]===_0x1222('0x49')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1e8c02[_0x1222('0x32')]+')','participationtypemask':_0x1e8c02[_0x1222('0x48')]===_0x1222('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x1222('0x2d')+_0x1e8c02[_0x1222('0x23')]+')','participationtypemask':_0x1e8c02[_0x1222('0x48')]==='queue'?0x2:0x1}];_0x43aa18={'method':'POST','uri':_0xb4480d+'phonecalls','body':Object['assign']({},{'subject':intUtil['getString'](_0x103594[_0x1222('0x4a')],_0x256b9a,'\x20'),'phonenumber':String(_0x256b9a[_0x1222('0x2a')]),'description':intUtil[_0x1222('0x42')](_0x103594[_0x1222('0x43')],_0x256b9a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1e8c02[_0x1222('0x32')]?_0x1222('0x44')+_0x1e8c02[_0x1222('0x32')]+')':undefined,'ownerid@odata.bind':_0x1222('0x2d')+_0x1e8c02[_0x1222('0x23')]+')','directioncode':_0x1e8c02[_0x1222('0x48')]===_0x1222('0x49')?![]:!![],'phonecall_activity_parties':_0x1d2299},getCustomFields(_0x103594[_0x1222('0x4b')],_0x256b9a,_0x103594[_0x1222('0x45')])),'headers':{'Authorization':_0x1222('0x46')+_0x4b9593,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x43aa18);})['then'](function(_0x17c4c5){var _0x8ffcbd=_0x17c4c5['headers'][_0x1222('0x2f')];var _0x4f791a=_0x8ffcbd[_0x1222('0x30')](_0x8ffcbd[_0x1222('0x31')]('(')+0x1,_0x8ffcbd[_0x1222('0x31')](')'));_0x1e8c02[_0x1222('0x4c')]=_0x4f791a;_0x3c7ba2(_0x1e8c02);})['catch'](function(_0x18953f){_0x5b3880(_0x18953f['message']);});});}function emit(_0x52e162,_0x1270db,_0x15628a,_0x26fcd5){var _0x450d69={'uri':util[_0x1222('0x4d')](_0x1222('0x4e'),_0x52e162,_0x15628a,_0x26fcd5)};io['to'](util['format'](_0x1222('0x4f'),_0x1270db))[_0x1222('0x50')](_0x1222('0x51'),_0x450d69);}exports['cs']=function(_0x6a97d,_0x1c8a21,_0x37e294,_0x4391c1,_0x499b8e,_0x5ce532,_0x565a84,_0x4a089f){var _0x2968f7={};_0x5ce532[_0x1222('0xb')]=_0x5ce532[_0x1222('0x52')]?intUtil[_0x1222('0x53')](_0x5ce532[_0x1222('0xc')][_0x1222('0xd')]):intUtil[_0x1222('0x53')](_0x5ce532['remoteUri']);_0x5ce532['serverUrl']=intUtil['stripTrailingSlash'](_0x5ce532[_0x1222('0x54')]);_0x2968f7[_0x1222('0x48')]=_0x4a089f===_0x1222('0x49')||_0x4a089f===_0x1222('0x55')?_0x1222('0x49'):_0x1222('0x29');var _0x5d5b40=_0x5ce532[_0x1222('0x52')]?util['format'](_0x1222('0x56'),_0x5ce532['CloudProvider']['data7']):util['format'](_0x1222('0x56'),_0x5ce532['remoteUri']);var _0x3bfe8a=util[_0x1222('0x4d')](_0x1222('0x57'),_0x5ce532['tenantId']);var _0xd3318e=util[_0x1222('0x4d')](_0x1222('0x58'),_0x5ce532[_0x1222('0x54')],_0x1c8a21[_0x1222('0x59')],md5(_0x1c8a21[_0x1222('0x59')]));if(_0x499b8e&&_0x499b8e[_0x1222('0x5a')]){logger[_0x1222('0x24')](_0x1222('0x5b'),_0x1222('0x5c'));_0x1c8a21[_0x1222('0x5d')]=_0xd3318e;}else if(_0x565a84&&_0x565a84['recordingFormat']&&_0x565a84[_0x1222('0x5e')]!==_0x1222('0x5f')){logger['info'](_0x1222('0x60'),_0x1222('0x5c'));_0x1c8a21['recordingURL']=_0xd3318e;}else{_0x1c8a21[_0x1222('0x5d')]='';}return getUser(_0x2968f7,_0x5ce532,_0x4391c1,_0x3bfe8a,_0x5d5b40,_0x4a089f)[_0x1222('0x17')](function(_0x30f6a5){logger[_0x1222('0x24')]('['+_0x4a089f['toUpperCase']()+_0x1222('0x61'),_0x30f6a5[_0x1222('0x23')]);logger[_0x1222('0x24')]('['+_0x4a089f[_0x1222('0x15')]()+_0x1222('0x62'),_0x30f6a5[_0x1222('0x25')]);return getEndUser(_0x30f6a5,_0x5ce532,_0x3bfe8a,_0x5d5b40,_0x1c8a21,_0x4a089f,_0x37e294[_0x1222('0x63')],_0x37e294[_0x1222('0x64')]);})['then'](function(_0x21095b){logger[_0x1222('0x24')]('['+_0x4a089f[_0x1222('0x15')]()+_0x1222('0x65'),_0x21095b[_0x1222('0x32')]);logger['info']('['+_0x4a089f['toUpperCase']()+_0x1222('0x66'),_0x1c8a21[_0x1222('0x2a')]);return getTicket(_0x21095b,_0x5ce532,_0x3bfe8a,_0x5d5b40,_0x1c8a21,_0x37e294,_0x4a089f);})[_0x1222('0x17')](function(_0x4ca912){logger[_0x1222('0x24')](util['format']('['+_0x4a089f[_0x1222('0x15')]()+_0x1222('0x67'),_0x37e294['ticketType'],_0x4ca912[_0x1222('0x4c')]));logger[_0x1222('0x24')](util[_0x1222('0x4d')]('['+_0x4a089f[_0x1222('0x15')]()+_0x1222('0x68'),_0x4a089f));if(_0x4a089f!=='unmanaged'&&_0x37e294['openNewTab']){logger[_0x1222('0x24')]('['+_0x4a089f[_0x1222('0x15')]()+']',_0x1222('0x69'));emit(_0x5ce532[_0x1222('0xb')],_0x4391c1['name'],_0x37e294[_0x1222('0x45')],_0x4ca912['ticketId']);}})[_0x1222('0x14')](function(_0x2859bc){logger[_0x1222('0x6a')]('['+_0x4a089f[_0x1222('0x15')]()+_0x1222('0x6b'),_0x2859bc['message']);console['error'](_0x1222('0x6c'),_0x2859bc);});}; \ No newline at end of file +var _0x668f=['Descriptions','Fields','phonecall','queue','/contacts(','callDirection','phonecalls','assign','calleridnum','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%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','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','POST','clientId','username','password','then','access_token',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','length','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','userId','userEmail','systemuserid','catch','message','outbound','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','destcalleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','picklist','type','customField','idField','indexOf','ticketType','incident','incidents','Subjects','getString'];(function(_0x43763f,_0x338f0b){var _0x1132c3=function(_0xe79bc2){while(--_0xe79bc2){_0x43763f['push'](_0x43763f['shift']());}};_0x1132c3(++_0x338f0b);}(_0x668f,0x165));var _0xf668=function(_0x4d3ce4,_0x9b6ae8){_0x4d3ce4=_0x4d3ce4-0x0;var _0x2d578a=_0x668f[_0x4d3ce4];return _0x2d578a;};'use strict';var _=require(_0xf668('0x0'));var rp=require(_0xf668('0x1'));var util=require(_0xf668('0x2'));var intUtil=require(_0xf668('0x3'));var md5=require(_0xf668('0x4'));var Redis=require(_0xf668('0x5'));var logger=require(_0xf668('0x6'))(_0xf668('0x7'));var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0xf668('0x8')],{'host':_0xf668('0x9'),'port':0x18eb});var io=require(_0xf668('0xa'))(new Redis(config[_0xf668('0x8')]));function getAuthToken(_0x311588,_0x5082a4,_0x33f2ed){if(_0x311588[_0xf668('0xb')]){_0x311588[_0xf668('0xc')]=_0x311588[_0xf668('0xd')]['data7'];_0x311588[_0xf668('0xe')]=_0x311588[_0xf668('0xd')]['data2'];return Promise['resolve'](_0x311588[_0xf668('0xd')]['data5']);}var _0x9fd99a={'method':_0xf668('0xf'),'uri':_0x5082a4,'form':{'client_id':_0x311588[_0xf668('0x10')],'resource':_0x311588['remoteUri'],'username':_0x311588[_0xf668('0x11')],'password':_0x311588[_0xf668('0x12')],'grant_type':'password','client_secret':_0x311588['clientSecret']},'json':!![]};return rp(_0x9fd99a)[_0xf668('0x13')](function(_0x555d54){return _0x555d54[_0xf668('0x14')];})['catch'](function(_0x15b514){logger['error']('['+[_0x33f2ed['toUpperCase']()]+_0xf668('0x15'));return _0x15b514['message'];});}function getUser(_0x2c77df,_0x57e632,_0x1e36f5,_0x327d3d,_0x2c53a2,_0x4f4400){return new Promise(function(_0x1e099c,_0x400283){return getAuthToken(_0x57e632,_0x327d3d,_0x4f4400)[_0xf668('0x13')](function(_0x36ed46){var _0x5ab16b={'method':_0xf668('0x16'),'uri':_0x2c53a2+_0xf668('0x17'),'headers':{'Authorization':_0xf668('0x18')+_0x36ed46,'OData-Version':_0xf668('0x19')},'json':!![]};return rp(_0x5ab16b);})['then'](function(_0x5d1485){var _0x5ec6c2=_0x5d1485[_0xf668('0x1a')];var _0x46d124=![];var _0x313119=null;if(!_[_0xf668('0x1b')](_0x1e36f5)){if(intUtil['validateEmail'](_0x1e36f5['email'])){_0x2c77df['userEmail']=_0x1e36f5['email'];for(_0x313119=0x0;_0x313119<_0x5ec6c2[_0xf668('0x1c')];_0x313119++){if(_0x5ec6c2[_0x313119][_0xf668('0x1d')]===_0x1e36f5['email']&&!_0x5ec6c2[_0x313119]['isdisabled']){_0x46d124=!![];logger[_0xf668('0x1e')]('['+[_0x4f4400[_0xf668('0x1f')]()]+_0xf668('0x20')+_0x5ec6c2[_0x313119]['systemuserid']+'!');_0x2c77df[_0xf668('0x21')]=_0x5ec6c2[_0x313119]['systemuserid'];}}}}if(!_0x46d124){logger[_0xf668('0x1e')]('['+[_0x4f4400[_0xf668('0x1f')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x2c77df[_0xf668('0x22')]=_0x57e632[_0xf668('0x11')];for(_0x313119=0x0;_0x313119<_0x5ec6c2[_0xf668('0x1c')];_0x313119++){if(_0x5ec6c2[_0x313119]['internalemailaddress']===_0x57e632[_0xf668('0x11')]){_0x2c77df[_0xf668('0x21')]=_0x5ec6c2[_0x313119][_0xf668('0x23')];}}}_0x1e099c(_0x2c77df);})[_0xf668('0x24')](function(_0x2527f7){_0x400283(_0x2527f7[_0xf668('0x25')]);});});}function createEndUser(_0x1aa376,_0x29f2ae,_0x540192,_0x136f01,_0x1fa106,_0x5ea835,_0x45ad6e){return new Promise(function(_0x4ca9da,_0x1fc812){return getAuthToken(_0x29f2ae,_0x540192,_0x5ea835)[_0xf668('0x13')](function(_0x386e8f){var _0x525a93=_0x5ea835['toLowerCase']()===_0xf668('0x26')?_0x1fa106['destcalleridnum']:_0x1fa106['calleridnum'];var _0x5170b4={'method':'POST','uri':_0x136f01+'contacts','body':{'fullname':_0x525a93,'firstname':_0x525a93,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf668('0x27')+_0x1aa376[_0xf668('0x21')]+')'},'headers':{'Authorization':_0xf668('0x18')+_0x386e8f,'OData-Version':_0xf668('0x19')},'json':!![],'resolveWithFullResponse':!![]};_0x5170b4['body'][_0x45ad6e]=_0x525a93;return rp(_0x5170b4);})['then'](function(_0x59221e){var _0x466369=_0x59221e[_0xf668('0x28')][_0xf668('0x29')];var _0x3cf52e=_0x466369[_0xf668('0x2a')](_0x466369[_0xf668('0x2b')]('(')+0x1,_0x466369[_0xf668('0x2b')](')'));_0x1aa376[_0xf668('0x2c')]=_0x3cf52e;_0x4ca9da(_0x1aa376);})[_0xf668('0x24')](function(_0x4400b7){_0x1fc812(_0x4400b7[_0xf668('0x25')]);});});}function getEndUser(_0x2f404e,_0x41fb6e,_0x50e05c,_0x591579,_0x471279,_0x129256,_0x5e2a6d,_0x26af7b){var _0x3f70aa=_0x129256[_0xf668('0x2d')]()===_0xf668('0x26')?_0x471279[_0xf668('0x2e')]:_0x471279['calleridnum'];return getAuthToken(_0x41fb6e,_0x50e05c,_0x129256)[_0xf668('0x13')](function(_0x2fb46a){_0x26af7b=_0x26af7b?_0x26af7b:_0xf668('0x2f');var _0x4e27ae={'method':_0xf668('0x16'),'uri':_0x591579+_0xf668('0x30')+_0x26af7b+_0xf668('0x31')+_0x26af7b+_0xf668('0x32')+_0x3f70aa[_0xf668('0x33')]('+',_0xf668('0x34'))+'\x27','headers':{'Authorization':_0xf668('0x18')+_0x2fb46a,'If-None-Match':null,'OData-Version':_0xf668('0x19')},'json':!![]};return rp(_0x4e27ae);})[_0xf668('0x13')](function(_0x2da99c){var _0x2363d9=![];if(!_0x2da99c)return _0x2363d9;var _0x4ca4fa=_0x2da99c[_0xf668('0x1a')];for(var _0x5873d2=0x0;_0x5873d2<_0x4ca4fa[_0xf668('0x1c')];_0x5873d2++){if(_0x4ca4fa[_0x5873d2][_0x26af7b]===_0x3f70aa){_0x2363d9=!![];_0x2f404e[_0xf668('0x2c')]=_0x4ca4fa[_0x5873d2][_0xf668('0x35')];}}return _0x2363d9;})[_0xf668('0x13')](function(_0x1c93ce){if(_0x1c93ce)return _0x2f404e;if(_0x5e2a6d===_0xf668('0x36')){logger[_0xf668('0x1e')]('['+[_0x129256['toUpperCase']()]+_0xf668('0x37'));return _0x2f404e;}return createEndUser(_0x2f404e,_0x41fb6e,_0x50e05c,_0x591579,_0x471279,_0x129256,_0x26af7b)[_0xf668('0x13')](function(_0x5cdace){logger['info']('['+[_0x129256[_0xf668('0x1f')]()]+']\x20Enduser\x20created!',_0x5cdace[_0xf668('0x2c')]);return _0x5cdace;});});}function getCustomFields(_0x3613ea,_0x49ed1c,_0xf9643b){var _0x14504f={};if(_0x3613ea[_0xf668('0x1c')]>0x0){_[_0xf668('0x38')](_0x3613ea,function(_0x37c26d){if(_['includes'](['string',_0xf668('0x39')],_0x37c26d[_0xf668('0x3a')])&&_0x37c26d['nameField']&&!_0x37c26d[_0xf668('0x3b')]){var _0x31f61b=_0x37c26d[_0xf668('0x3c')][_0xf668('0x2d')]();var _0xc618b0=_0x31f61b[_0xf668('0x2a')](0x0,_0x31f61b[_0xf668('0x3d')]('_'));var _0x2db86c=_0x31f61b[_0xf668('0x2a')](_0x31f61b[_0xf668('0x3d')]('_')+0x1);if(_0xc618b0===_0xf9643b){_0x14504f[_0x2db86c]=_0x37c26d['content'];}}});}return _0x14504f;}function getTicket(_0x41d32e,_0x54a694,_0x4eb6ae,_0x3c4450,_0x3e501f,_0x5206b7,_0x585d4c){return new Promise(function(_0x2c3af6,_0x2938e0){var _0x5baa02;return getAuthToken(_0x54a694,_0x4eb6ae,_0x585d4c)[_0xf668('0x13')](function(_0x171b18){if(_0x5206b7[_0xf668('0x3e')]===_0xf668('0x3f')){_0x5baa02={'method':'POST','uri':_0x3c4450+_0xf668('0x40'),'body':Object['assign']({},{'title':intUtil['getString'](_0x5206b7[_0xf668('0x41')],_0x3e501f,'\x20'),'description':intUtil[_0xf668('0x42')](_0x5206b7[_0xf668('0x43')],_0x3e501f,'\x0a'),'customerid_contact@odata.bind':_0x41d32e[_0xf668('0x2c')]?'/contacts('+_0x41d32e[_0xf668('0x2c')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x41d32e[_0xf668('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x5206b7[_0xf668('0x44')],_0x3e501f,_0x5206b7[_0xf668('0x3e')])),'headers':{'Authorization':_0xf668('0x18')+_0x171b18,'OData-Version':_0xf668('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5206b7['ticketType']===_0xf668('0x45')){var _0x3181f6=_0x41d32e[_0xf668('0x2c')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x41d32e[_0xf668('0x21')]+')','participationtypemask':_0x41d32e['callDirection']===_0xf668('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0xf668('0x47')+_0x41d32e[_0xf668('0x2c')]+')','participationtypemask':_0x41d32e['callDirection']===_0xf668('0x46')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xf668('0x27')+_0x41d32e[_0xf668('0x21')]+')','participationtypemask':_0x41d32e[_0xf668('0x48')]===_0xf668('0x46')?0x2:0x1}];_0x5baa02={'method':_0xf668('0xf'),'uri':_0x3c4450+_0xf668('0x49'),'body':Object[_0xf668('0x4a')]({},{'subject':intUtil[_0xf668('0x42')](_0x5206b7[_0xf668('0x41')],_0x3e501f,'\x20'),'phonenumber':String(_0x3e501f[_0xf668('0x4b')]),'description':intUtil[_0xf668('0x42')](_0x5206b7['Descriptions'],_0x3e501f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x41d32e[_0xf668('0x2c')]?_0xf668('0x47')+_0x41d32e[_0xf668('0x2c')]+')':undefined,'ownerid@odata.bind':_0xf668('0x27')+_0x41d32e[_0xf668('0x21')]+')','directioncode':_0x41d32e['callDirection']===_0xf668('0x46')?![]:!![],'phonecall_activity_parties':_0x3181f6},getCustomFields(_0x5206b7[_0xf668('0x44')],_0x3e501f,_0x5206b7[_0xf668('0x3e')])),'headers':{'Authorization':_0xf668('0x18')+_0x171b18,'OData-Version':_0xf668('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5baa02);})[_0xf668('0x13')](function(_0x173066){var _0x26d320=_0x173066[_0xf668('0x28')][_0xf668('0x29')];var _0x2d0261=_0x26d320['substring'](_0x26d320[_0xf668('0x2b')]('(')+0x1,_0x26d320[_0xf668('0x2b')](')'));_0x41d32e['ticketId']=_0x2d0261;_0x2c3af6(_0x41d32e);})[_0xf668('0x24')](function(_0x1f115a){_0x2938e0(_0x1f115a[_0xf668('0x25')]);});});}function emit(_0x1b01ea,_0x33fd0d,_0xaca168,_0x18b06e){var _0x7b8ab1={'uri':util[_0xf668('0x4c')](_0xf668('0x4d'),_0x1b01ea,_0xaca168,_0x18b06e)};io['to'](util[_0xf668('0x4c')]('user:%s',_0x33fd0d))['emit'](_0xf668('0x4e'),_0x7b8ab1);}exports['cs']=function(_0x45d896,_0x3be4a2,_0x5b529c,_0x3daff4,_0x28ecdb,_0x4479e3,_0x9c59b6,_0x8d333a){var _0x312a3a={};_0x4479e3[_0xf668('0xc')]=_0x4479e3['modernAuthentication']?intUtil[_0xf668('0x4f')](_0x4479e3[_0xf668('0xd')][_0xf668('0x50')]):intUtil[_0xf668('0x4f')](_0x4479e3['remoteUri']);_0x4479e3[_0xf668('0x51')]=intUtil[_0xf668('0x4f')](_0x4479e3['serverUrl']);_0x312a3a['callDirection']=_0x8d333a===_0xf668('0x46')||_0x8d333a===_0xf668('0x52')?_0xf668('0x46'):_0xf668('0x26');var _0x5b9673=_0x4479e3[_0xf668('0xb')]?util[_0xf668('0x4c')](_0xf668('0x53'),_0x4479e3[_0xf668('0xd')][_0xf668('0x50')]):util[_0xf668('0x4c')]('%s/api/data/v9.0/',_0x4479e3[_0xf668('0xc')]);var _0x3d1976=util[_0xf668('0x4c')](_0xf668('0x54'),_0x4479e3[_0xf668('0xe')]);var _0x369b67=util['format'](_0xf668('0x55'),_0x4479e3[_0xf668('0x51')],_0x3be4a2[_0xf668('0x56')],md5(_0x3be4a2[_0xf668('0x56')]));if(_0x28ecdb&&_0x28ecdb[_0xf668('0x57')]){logger[_0xf668('0x1e')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3be4a2[_0xf668('0x58')]=_0x369b67;}else if(_0x9c59b6&&_0x9c59b6[_0xf668('0x59')]&&_0x9c59b6[_0xf668('0x59')]!==_0xf668('0x5a')){logger[_0xf668('0x1e')](_0xf668('0x5b'),_0xf668('0x5c'));_0x3be4a2[_0xf668('0x58')]=_0x369b67;}else{_0x3be4a2[_0xf668('0x58')]='';}return getUser(_0x312a3a,_0x4479e3,_0x3daff4,_0x3d1976,_0x5b9673,_0x8d333a)[_0xf668('0x13')](function(_0x5eb160){logger['info']('['+_0x8d333a[_0xf668('0x1f')]()+_0xf668('0x5d'),_0x5eb160[_0xf668('0x21')]);logger['info']('['+_0x8d333a[_0xf668('0x1f')]()+']\x20The\x20User\x20email\x20is:',_0x5eb160[_0xf668('0x22')]);return getEndUser(_0x5eb160,_0x4479e3,_0x3d1976,_0x5b9673,_0x3be4a2,_0x8d333a,_0x5b529c[_0xf668('0x5e')],_0x5b529c[_0xf668('0x5f')]);})['then'](function(_0x3678b3){logger[_0xf668('0x1e')]('['+_0x8d333a[_0xf668('0x1f')]()+_0xf668('0x60'),_0x3678b3[_0xf668('0x2c')]);logger[_0xf668('0x1e')]('['+_0x8d333a[_0xf668('0x1f')]()+_0xf668('0x61'),_0x3be4a2[_0xf668('0x4b')]);return getTicket(_0x3678b3,_0x4479e3,_0x3d1976,_0x5b9673,_0x3be4a2,_0x5b529c,_0x8d333a);})[_0xf668('0x13')](function(_0x41e6b9){logger['info'](util[_0xf668('0x4c')]('['+_0x8d333a[_0xf668('0x1f')]()+_0xf668('0x62'),_0x5b529c[_0xf668('0x3e')],_0x41e6b9[_0xf668('0x63')]));logger[_0xf668('0x1e')](util['format']('['+_0x8d333a[_0xf668('0x1f')]()+']\x20Call\x20direction:\x20%s',_0x8d333a));if(_0x8d333a!==_0xf668('0x52')&&_0x5b529c[_0xf668('0x64')]){logger[_0xf668('0x1e')]('['+_0x8d333a[_0xf668('0x1f')]()+']',_0xf668('0x65'));emit(_0x4479e3[_0xf668('0xc')],_0x3daff4[_0xf668('0x66')],_0x5b529c[_0xf668('0x3e')],_0x41e6b9[_0xf668('0x63')]);}})[_0xf668('0x24')](function(_0x3e782e){logger[_0xf668('0x67')]('['+_0x8d333a[_0xf668('0x1f')]()+_0xf668('0x68'),_0x3e782e[_0xf668('0x25')]);console[_0xf668('0x67')](_0xf668('0x69'),_0x3e782e);});}; \ 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 069156d..ceaad22 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 _0x13b5=['The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','catch','unmanaged','lastevent','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','defaults','redis','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','map','includes','picklist','type','nameField','string','idField','customField','content','variable','variableName','customVariable','Variable','toLowerCase','push','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:'];(function(_0x4d89a9,_0x8ffb64){var _0x1d7587=function(_0x16fcd2){while(--_0x16fcd2){_0x4d89a9['push'](_0x4d89a9['shift']());}};_0x1d7587(++_0x8ffb64);}(_0x13b5,0x125));var _0x513b=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x13b5[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x513b('0x0'));var rp=require(_0x513b('0x1'));var md5=require('md5');var util=require(_0x513b('0x2'));var Redis=require(_0x513b('0x3'));var intUtil=require(_0x513b('0x4'));var config=require(_0x513b('0x5'));var logger=require('../../../../config/logger')(_0x513b('0x6'));config['redis']=_[_0x513b('0x7')](config[_0x513b('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x513b('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x513b('0xa'),'Accept':'application/json'};function emit(_0x55ca0b,_0x21fc61,_0x189344){io['to'](_0x55ca0b)[_0x513b('0xb')](_0x21fc61,_0x189344);}function getTicket(_0x18cbfd,_0x11e6d9,_0x144a08,_0xe3e848,_0x3d26b2){logger[_0x513b('0xc')](_0x513b('0xd'));var _0x197174=_[_0x513b('0xe')]({'responder_id':_0x11e6d9['id'],'requester_id':_0x144a08['id'],'name':util['format'](_0x513b('0xf'),_0x3d26b2[_0x513b('0x10')]),'phone':_0x3d26b2[_0x513b('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xe3e848[_0x513b('0x12')],_0x3d26b2,'\x20'),'description':intUtil['getString'](_0xe3e848[_0x513b('0x13')],_0x3d26b2,'
'),'tags':getTags(_0xe3e848[_0x513b('0x14')],_0x513b('0x15'))},getCustomFields(_0xe3e848[_0x513b('0x16')],_0x3d26b2));_0x197174[_0x513b('0x17')]=_[_0x513b('0x18')](_[_0x513b('0x19')](_0x197174['custom_fields'],'id'),_0x513b('0x1a'));return request({'uri':util[_0x513b('0x1b')](_0x513b('0x1c'),_0x18cbfd[_0x513b('0x1d')]),'method':_0x513b('0x1e'),'body':_0x197174})[_0x513b('0x1f')](function(_0xf51ab8){logger[_0x513b('0xc')](_0x513b('0x20'));return _0xf51ab8;});}function getUser(_0x45fb9e,_0x2cd192){if(intUtil[_0x513b('0x21')](_0x2cd192)){return request({'uri':util['format']('%s/api/v2/agents',_0x45fb9e[_0x513b('0x1d')]),'qs':{'email':_0x2cd192}})[_0x513b('0x1f')](function(_0x2a56ad){if(_0x2a56ad['length']){logger[_0x513b('0xc')](_0x513b('0x22'));return _[_0x513b('0x23')](_0x2a56ad,function(_0x3a75a2){return _0x3a75a2[_0x513b('0x24')]['email']===_0x2cd192;});}else{logger[_0x513b('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x513b('0x1b')](_0x513b('0x25'),_0x45fb9e[_0x513b('0x1d')])})[_0x513b('0x1f')](function(_0x1b7239){logger[_0x513b('0xc')]('Admin\x20account\x20selected.');return _0x1b7239;});}});}else{logger['info'](_0x513b('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x45fb9e[_0x513b('0x1d')])})['then'](function(_0x5a8294){logger[_0x513b('0xc')](_0x513b('0x27'));return _0x5a8294;});}}function getEndUser(_0x9ed063,_0x37919c,_0x456d23){logger[_0x513b('0xc')](_0x513b('0x28'),_0x456d23);return request({'uri':util[_0x513b('0x1b')]('%s/api/v2/contacts',_0x9ed063[_0x513b('0x1d')]),'qs':{'phone':_0x456d23}})[_0x513b('0x1f')](function(_0x9d1117){if(_0x9d1117[_0x513b('0x29')]){logger[_0x513b('0xc')](_0x513b('0x2a'));return _[_0x513b('0x23')](_0x9d1117,{'phone':_0x456d23});}else{logger[_0x513b('0xc')](_0x513b('0x2b'));return request({'uri':util['format'](_0x513b('0x2c'),_0x9ed063[_0x513b('0x1d')]),'method':'POST','body':{'name':_0x37919c,'phone':_0x456d23}})['then'](function(_0x5e6c9b){logger[_0x513b('0xc')](_0x513b('0x2d'));return _0x5e6c9b;});}});}function getAuth(_0x40da4d){return util['format'](_0x513b('0x2e'),new Buffer(_0x40da4d[_0x513b('0x2f')]+':X')[_0x513b('0x30')](_0x513b('0x31')));}function request(_0x205052){logger[_0x513b('0x32')](_0x513b('0x33'),JSON[_0x513b('0x34')](_0x205052));return rp(_[_0x513b('0x7')](_0x205052,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x42880c,_0x5b02dd){var _0x5a6e5e=[];if(_0x42880c&&_0x42880c[_0x513b('0x29')]>0x0){_0x5a6e5e=_[_0x513b('0x35')](_0x42880c,_0x5b02dd);}return _0x5a6e5e;}function getCustomFields(_0x3a3a03,_0x3b2640){var _0x48ae69=[];var _0x47fe3f={'custom_fields':[]};if(_0x3a3a03[_0x513b('0x29')]>0x0){_['forEach'](_0x3a3a03,function(_0x3a8130){if(_[_0x513b('0x36')](['string',_0x513b('0x37')],_0x3a8130[_0x513b('0x38')])&&_0x3a8130[_0x513b('0x39')]&&!_0x3a8130['customField']){_0x47fe3f[_0x3a8130[_0x513b('0x39')]['toLowerCase']()]=_0x3a8130['content'][_0x513b('0x30')]();}else if(_[_0x513b('0x36')]([_0x513b('0x3a'),_0x513b('0x37')],_0x3a8130[_0x513b('0x38')])&&_0x3a8130[_0x513b('0x3b')]&&_0x3a8130[_0x513b('0x3c')]){_0x47fe3f[_0x513b('0x17')]['push']({'id':_0x3a8130['idField'],'value':_0x3a8130[_0x513b('0x3d')][_0x513b('0x30')]()});}else if(_0x3a8130[_0x513b('0x38')]===_0x513b('0x3e')&&_0x3a8130['variableName']&&_0x3a8130[_0x513b('0x3b')]&&_0x3a8130[_0x513b('0x3c')]){_0x3b2640[_0x3a8130[_0x513b('0x3f')]]&&_0x47fe3f[_0x513b('0x17')]['push']({'id':_0x3a8130[_0x513b('0x3b')],'value':_0x3b2640[_0x3a8130['variableName']][_0x513b('0x30')]()});}else if(_0x3a8130[_0x513b('0x38')]===_0x513b('0x40')&&_0x3a8130['Variable']&&_0x3a8130[_0x513b('0x41')][_0x513b('0x15')]&&_0x3a8130[_0x513b('0x3b')]&&_0x3a8130[_0x513b('0x3c')]){_0x3b2640[_0x3a8130[_0x513b('0x41')][_0x513b('0x15')][_0x513b('0x42')]()]&&_0x47fe3f[_0x513b('0x17')][_0x513b('0x43')]({'id':_0x3a8130[_0x513b('0x3b')],'value':_0x3b2640[_0x3a8130[_0x513b('0x41')]['name']['toLowerCase']()][_0x513b('0x30')]()});}});}return _0x47fe3f;}exports[_0x513b('0x44')]=function(_0x524a8b,_0x3144bf,_0x24d626,_0x1f4965,_0x2f3388,_0x3ccb78){var _0x53b9e8,_0x21e0af;_0x3ccb78[_0x513b('0x1d')]=intUtil[_0x513b('0x45')](_0x3ccb78[_0x513b('0x1d')]);_0x3ccb78[_0x513b('0x46')]=intUtil[_0x513b('0x45')](_0x3ccb78[_0x513b('0x46')]);if(_0x2f3388&&_0x2f3388[_0x513b('0x47')]){logger[_0x513b('0xc')]('[QUEUE]',_0x513b('0x48'));_0x3144bf[_0x513b('0x49')]=util[_0x513b('0x1b')](_0x513b('0x4a'),_0x3ccb78[_0x513b('0x46')],_0x3144bf[_0x513b('0x4b')],md5(_0x3144bf[_0x513b('0x4b')]));}else{_0x3144bf[_0x513b('0x49')]='';}headers[_0x513b('0x4c')]=getAuth(_0x3ccb78);return getUser(_0x3ccb78,_0x1f4965[_0x513b('0x4d')])[_0x513b('0x1f')](function(_0x225249){_0x53b9e8=_0x225249;logger[_0x513b('0xc')](_0x513b('0x4e'),_0x53b9e8['id']);return getEndUser(_0x3ccb78,_0x3144bf['calleridname'],_0x3144bf[_0x513b('0x11')]);})['then'](function(_0x338dfd){_0x21e0af=_0x338dfd;logger[_0x513b('0xc')](_0x513b('0x4f'),_0x21e0af['id']);return getTicket(_0x3ccb78,_0x53b9e8,_0x21e0af,_0x24d626,_0x3144bf);})[_0x513b('0x1f')](function(_0x4a0c3b){if(_0x4a0c3b&&_0x4a0c3b['id']){logger[_0x513b('0xc')](_0x513b('0x20'));logger[_0x513b('0xc')](_0x513b('0x50'),_0x4a0c3b['id']);logger[_0x513b('0xc')]('[QUEUE]',_0x513b('0x51'));emit(util[_0x513b('0x1b')]('user:%s',_0x1f4965[_0x513b('0x15')]),_0x513b('0x52'),{'uri':util['format'](_0x513b('0x53'),_0x3ccb78[_0x513b('0x1d')],_0x4a0c3b['id'])});}})['catch'](function(_0x3bb664){logger[_0x513b('0x54')]('[QUEUE]',JSON[_0x513b('0x34')](_0x3bb664));});};exports[_0x513b('0x55')]=function(_0x542e26,_0x547921,_0x298a43,_0xd421f2,_0x4fa4a1,_0x22d7ed,_0x3e99b1){var _0x41ed5a,_0x234ec5;_0x22d7ed['remoteUri']=intUtil[_0x513b('0x45')](_0x22d7ed[_0x513b('0x1d')]);_0x22d7ed[_0x513b('0x46')]=intUtil[_0x513b('0x45')](_0x22d7ed['serverUrl']);if(_0x3e99b1&&_0x3e99b1['recordingFormat']&&_0x3e99b1['recordingFormat']!=='none'){logger[_0x513b('0xc')](_0x513b('0x56'),_0x513b('0x48'));_0x547921[_0x513b('0x49')]=util['format'](_0x513b('0x4a'),_0x22d7ed[_0x513b('0x46')],_0x547921['uniqueid'],md5(_0x547921[_0x513b('0x4b')]));}headers[_0x513b('0x4c')]=getAuth(_0x22d7ed);return getUser(_0x22d7ed,_0xd421f2[_0x513b('0x4d')])[_0x513b('0x1f')](function(_0x427f27){_0x41ed5a=_0x427f27;logger[_0x513b('0xc')](_0x513b('0x4e'),_0x41ed5a['id']);return getEndUser(_0x22d7ed,_0x547921[_0x513b('0x57')],_0x547921[_0x513b('0x58')]);})[_0x513b('0x1f')](function(_0x217455){_0x234ec5=_0x217455;logger[_0x513b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x234ec5['id']);return getTicket(_0x22d7ed,_0x41ed5a,_0x234ec5,_0x298a43,_0x547921);})[_0x513b('0x1f')](function(_0x3e6f92){if(_0x3e6f92&&_0x3e6f92['id']){logger[_0x513b('0xc')](_0x513b('0x20'));logger[_0x513b('0xc')](_0x513b('0x50'),_0x3e6f92['id']);logger[_0x513b('0xc')](_0x513b('0x56'),_0x513b('0x51'));emit(util[_0x513b('0x1b')](_0x513b('0x59'),_0xd421f2[_0x513b('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x513b('0x53'),_0x22d7ed[_0x513b('0x1d')],_0x3e6f92['id'])});}})[_0x513b('0x5a')](function(_0xad73bb){logger[_0x513b('0x54')](_0x513b('0x56'),JSON[_0x513b('0x34')](_0xad73bb));});};exports[_0x513b('0x5b')]=function(_0x2fc84b,_0xf826d8,_0x37121a,_0x46b942,_0x28e163,_0x3546fb){var _0x29a74c,_0xf2eb58;_0x3546fb[_0x513b('0x1d')]=intUtil['stripTrailingSlash'](_0x3546fb[_0x513b('0x1d')]);_0x3546fb['serverUrl']=intUtil[_0x513b('0x45')](_0x3546fb[_0x513b('0x46')]);if(_0x28e163&&_0x28e163[_0x513b('0x47')]){logger['info']('['+_0xf826d8[_0x513b('0x5c')]['toUpperCase']()+']',_0x513b('0x48'));_0xf826d8['recordingURL']=util[_0x513b('0x1b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3546fb[_0x513b('0x46')],_0xf826d8[_0x513b('0x4b')],md5(_0xf826d8[_0x513b('0x4b')]));}else{_0xf826d8[_0x513b('0x49')]='';}headers['Authorization']=getAuth(_0x3546fb);return getUser(_0x3546fb,'')['then'](function(_0x2dd337){_0x29a74c=_0x2dd337;logger[_0x513b('0xc')](_0x513b('0x4e'),_0x29a74c['id']);return getEndUser(_0x3546fb,_0xf826d8[_0x513b('0x10')],_0xf826d8[_0x513b('0x11')]);})['then'](function(_0x3d7f13){_0xf2eb58=_0x3d7f13;logger[_0x513b('0xc')](_0x513b('0x4f'),_0xf2eb58['id']);return getTicket(_0x3546fb,_0x29a74c,_0xf2eb58,_0x37121a,_0xf826d8);})[_0x513b('0x1f')](function(_0x144fdf){if(_0x144fdf){logger[_0x513b('0xc')](_0x513b('0x20'));logger[_0x513b('0xc')](_0x513b('0x50'),_0x144fdf['id']);}})['catch'](function(_0x2b1518){logger[_0x513b('0x54')]('['+_0xf826d8[_0x513b('0x5c')]['toUpperCase']()+']',JSON['stringify'](_0x2b1518));});}; \ No newline at end of file +var _0x7ee9=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','[QUEUE]','user:%s','catch','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Descriptions','
','Tags','name','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','%s/api/v2/agents','length','info','Agent\x20found!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','[HTTP]','stringify','GET','map','picklist','nameField','customField','toLowerCase','content','includes','string','type','idField','push','variable','variableName','customVariable','Variable','queue','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL'];(function(_0x27ec50,_0x1d8698){var _0x2da0f5=function(_0x206a3e){while(--_0x206a3e){_0x27ec50['push'](_0x27ec50['shift']());}};_0x2da0f5(++_0x1d8698);}(_0x7ee9,0x6f));var _0x97ee=function(_0x2610f9,_0x531c0b){_0x2610f9=_0x2610f9-0x0;var _0x553bc1=_0x7ee9[_0x2610f9];return _0x553bc1;};'use strict';var _=require(_0x97ee('0x0'));var rp=require(_0x97ee('0x1'));var md5=require(_0x97ee('0x2'));var util=require(_0x97ee('0x3'));var Redis=require(_0x97ee('0x4'));var intUtil=require('./util');var config=require(_0x97ee('0x5'));var logger=require(_0x97ee('0x6'))(_0x97ee('0x7'));config[_0x97ee('0x8')]=_[_0x97ee('0x9')](config[_0x97ee('0x8')],{'host':_0x97ee('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x97ee('0x8')]));var headers={'Content-Type':_0x97ee('0xb'),'Accept':_0x97ee('0xb')};function emit(_0x2d6a37,_0x1c9da8,_0x4ac174){io['to'](_0x2d6a37)[_0x97ee('0xc')](_0x1c9da8,_0x4ac174);}function getTicket(_0x359627,_0x35138d,_0x5d280b,_0xecbfe5,_0x7fbe9a){logger['info'](_0x97ee('0xd'));var _0x11f774=_[_0x97ee('0xe')]({'responder_id':_0x35138d['id'],'requester_id':_0x5d280b['id'],'name':util[_0x97ee('0xf')](_0x97ee('0x10'),_0x7fbe9a[_0x97ee('0x11')]),'phone':_0x7fbe9a['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x97ee('0x12')](_0xecbfe5['Subjects'],_0x7fbe9a,'\x20'),'description':intUtil[_0x97ee('0x12')](_0xecbfe5[_0x97ee('0x13')],_0x7fbe9a,_0x97ee('0x14')),'tags':getTags(_0xecbfe5[_0x97ee('0x15')],_0x97ee('0x16'))},getCustomFields(_0xecbfe5['Fields'],_0x7fbe9a));_0x11f774[_0x97ee('0x17')]=_['mapValues'](_['keyBy'](_0x11f774['custom_fields'],'id'),_0x97ee('0x18'));return request({'uri':util[_0x97ee('0xf')](_0x97ee('0x19'),_0x359627[_0x97ee('0x1a')]),'method':'POST','body':_0x11f774})[_0x97ee('0x1b')](function(_0x25fe5d){logger['info'](_0x97ee('0x1c'));return _0x25fe5d;});}function getUser(_0x2c9292,_0x4e5f42){if(intUtil['validateEmail'](_0x4e5f42)){return request({'uri':util[_0x97ee('0xf')](_0x97ee('0x1d'),_0x2c9292[_0x97ee('0x1a')]),'qs':{'email':_0x4e5f42}})[_0x97ee('0x1b')](function(_0x34f337){if(_0x34f337[_0x97ee('0x1e')]){logger[_0x97ee('0x1f')](_0x97ee('0x20'));return _['find'](_0x34f337,function(_0x4db170){return _0x4db170['contact']['email']===_0x4e5f42;});}else{logger[_0x97ee('0x1f')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x97ee('0xf')](_0x97ee('0x21'),_0x2c9292[_0x97ee('0x1a')])})[_0x97ee('0x1b')](function(_0x216520){logger['info'](_0x97ee('0x22'));return _0x216520;});}});}else{logger[_0x97ee('0x1f')](_0x97ee('0x23'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x2c9292[_0x97ee('0x1a')])})[_0x97ee('0x1b')](function(_0x111949){logger[_0x97ee('0x1f')](_0x97ee('0x22'));return _0x111949;});}}function getEndUser(_0x31f3a0,_0x37d63f,_0x3b05f1){logger['info']('Searching\x20enduser\x20with\x20phone',_0x3b05f1);return request({'uri':util[_0x97ee('0xf')](_0x97ee('0x24'),_0x31f3a0[_0x97ee('0x1a')]),'qs':{'phone':_0x3b05f1}})[_0x97ee('0x1b')](function(_0x5d0eea){if(_0x5d0eea[_0x97ee('0x1e')]){logger['info'](_0x97ee('0x25'));return _['find'](_0x5d0eea,{'phone':_0x3b05f1});}else{logger[_0x97ee('0x1f')](_0x97ee('0x26'));return request({'uri':util[_0x97ee('0xf')]('%s/api/v2/contacts',_0x31f3a0[_0x97ee('0x1a')]),'method':_0x97ee('0x27'),'body':{'name':_0x37d63f,'phone':_0x3b05f1}})[_0x97ee('0x1b')](function(_0x2a516e){logger[_0x97ee('0x1f')](_0x97ee('0x28'));return _0x2a516e;});}});}function getAuth(_0x552415){return util[_0x97ee('0xf')](_0x97ee('0x29'),new Buffer(_0x552415[_0x97ee('0x2a')]+':X')[_0x97ee('0x2b')]('base64'));}function request(_0x524a7c){logger['debug'](_0x97ee('0x2c'),JSON[_0x97ee('0x2d')](_0x524a7c));return rp(_[_0x97ee('0x9')](_0x524a7c,{'method':_0x97ee('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x2d356b,_0x1a8092){var _0x37c25a=[];if(_0x2d356b&&_0x2d356b[_0x97ee('0x1e')]>0x0){_0x37c25a=_[_0x97ee('0x2f')](_0x2d356b,_0x1a8092);}return _0x37c25a;}function getCustomFields(_0x493ba7,_0xfb62b){var _0x2ee3b4=[];var _0x3b8c7e={'custom_fields':[]};if(_0x493ba7['length']>0x0){_['forEach'](_0x493ba7,function(_0x61eaef){if(_['includes'](['string',_0x97ee('0x30')],_0x61eaef['type'])&&_0x61eaef[_0x97ee('0x31')]&&!_0x61eaef[_0x97ee('0x32')]){_0x3b8c7e[_0x61eaef[_0x97ee('0x31')][_0x97ee('0x33')]()]=_0x61eaef[_0x97ee('0x34')][_0x97ee('0x2b')]();}else if(_[_0x97ee('0x35')]([_0x97ee('0x36'),'picklist'],_0x61eaef[_0x97ee('0x37')])&&_0x61eaef[_0x97ee('0x38')]&&_0x61eaef[_0x97ee('0x32')]){_0x3b8c7e[_0x97ee('0x17')][_0x97ee('0x39')]({'id':_0x61eaef['idField'],'value':_0x61eaef[_0x97ee('0x34')][_0x97ee('0x2b')]()});}else if(_0x61eaef['type']===_0x97ee('0x3a')&&_0x61eaef['variableName']&&_0x61eaef[_0x97ee('0x38')]&&_0x61eaef[_0x97ee('0x32')]){_0xfb62b[_0x61eaef[_0x97ee('0x3b')]]&&_0x3b8c7e[_0x97ee('0x17')][_0x97ee('0x39')]({'id':_0x61eaef[_0x97ee('0x38')],'value':_0xfb62b[_0x61eaef[_0x97ee('0x3b')]][_0x97ee('0x2b')]()});}else if(_0x61eaef[_0x97ee('0x37')]===_0x97ee('0x3c')&&_0x61eaef['Variable']&&_0x61eaef[_0x97ee('0x3d')]['name']&&_0x61eaef[_0x97ee('0x38')]&&_0x61eaef[_0x97ee('0x32')]){_0xfb62b[_0x61eaef[_0x97ee('0x3d')][_0x97ee('0x16')]['toLowerCase']()]&&_0x3b8c7e[_0x97ee('0x17')][_0x97ee('0x39')]({'id':_0x61eaef[_0x97ee('0x38')],'value':_0xfb62b[_0x61eaef[_0x97ee('0x3d')][_0x97ee('0x16')]['toLowerCase']()][_0x97ee('0x2b')]()});}});}return _0x3b8c7e;}exports[_0x97ee('0x3e')]=function(_0x4377b4,_0x60323,_0x4ffbac,_0x1807dd,_0x5bdbfa,_0x87c28b){var _0x4b2ae1,_0x27906e;_0x87c28b[_0x97ee('0x1a')]=intUtil['stripTrailingSlash'](_0x87c28b[_0x97ee('0x1a')]);_0x87c28b[_0x97ee('0x3f')]=intUtil['stripTrailingSlash'](_0x87c28b[_0x97ee('0x3f')]);if(_0x5bdbfa&&_0x5bdbfa[_0x97ee('0x40')]){logger[_0x97ee('0x1f')]('[QUEUE]',_0x97ee('0x41'));_0x60323[_0x97ee('0x42')]=util['format'](_0x97ee('0x43'),_0x87c28b['serverUrl'],_0x60323['uniqueid'],md5(_0x60323[_0x97ee('0x44')]));}else{_0x60323[_0x97ee('0x42')]='';}headers['Authorization']=getAuth(_0x87c28b);return getUser(_0x87c28b,_0x1807dd[_0x97ee('0x45')])[_0x97ee('0x1b')](function(_0x5144b1){_0x4b2ae1=_0x5144b1;logger[_0x97ee('0x1f')](_0x97ee('0x46'),_0x4b2ae1['id']);return getEndUser(_0x87c28b,_0x60323[_0x97ee('0x11')],_0x60323[_0x97ee('0x47')]);})[_0x97ee('0x1b')](function(_0x49660e){_0x27906e=_0x49660e;logger[_0x97ee('0x1f')](_0x97ee('0x48'),_0x27906e['id']);return getTicket(_0x87c28b,_0x4b2ae1,_0x27906e,_0x4ffbac,_0x60323);})[_0x97ee('0x1b')](function(_0x247717){if(_0x247717&&_0x247717['id']){logger[_0x97ee('0x1f')](_0x97ee('0x1c'));logger[_0x97ee('0x1f')]('The\x20Ticket\x20ID\x20is:',_0x247717['id']);logger[_0x97ee('0x1f')](_0x97ee('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x97ee('0xf')](_0x97ee('0x4a'),_0x1807dd[_0x97ee('0x16')]),'trigger:browser:url',{'uri':util[_0x97ee('0xf')]('%s/helpdesk/tickets/%d',_0x87c28b[_0x97ee('0x1a')],_0x247717['id'])});}})[_0x97ee('0x4b')](function(_0x24a707){logger[_0x97ee('0x4c')](_0x97ee('0x49'),JSON[_0x97ee('0x2d')](_0x24a707));});};exports[_0x97ee('0x4d')]=function(_0x1b0800,_0x5f0c88,_0x47bdd3,_0x57525c,_0x276717,_0x1e831e,_0x4e10db){var _0x50b4c9,_0x3fa8f6;_0x1e831e['remoteUri']=intUtil['stripTrailingSlash'](_0x1e831e[_0x97ee('0x1a')]);_0x1e831e['serverUrl']=intUtil[_0x97ee('0x4e')](_0x1e831e[_0x97ee('0x3f')]);if(_0x4e10db&&_0x4e10db[_0x97ee('0x4f')]&&_0x4e10db[_0x97ee('0x4f')]!==_0x97ee('0x50')){logger['info'](_0x97ee('0x51'),_0x97ee('0x41'));_0x5f0c88[_0x97ee('0x42')]=util[_0x97ee('0xf')](_0x97ee('0x43'),_0x1e831e['serverUrl'],_0x5f0c88[_0x97ee('0x44')],md5(_0x5f0c88[_0x97ee('0x44')]));}headers[_0x97ee('0x52')]=getAuth(_0x1e831e);return getUser(_0x1e831e,_0x57525c['email'])[_0x97ee('0x1b')](function(_0x4bbbc6){_0x50b4c9=_0x4bbbc6;logger[_0x97ee('0x1f')]('The\x20User\x20ID\x20is:',_0x50b4c9['id']);return getEndUser(_0x1e831e,_0x5f0c88['destcalleridname'],_0x5f0c88['destcalleridnum']);})[_0x97ee('0x1b')](function(_0x234d75){_0x3fa8f6=_0x234d75;logger[_0x97ee('0x1f')](_0x97ee('0x48'),_0x3fa8f6['id']);return getTicket(_0x1e831e,_0x50b4c9,_0x3fa8f6,_0x47bdd3,_0x5f0c88);})[_0x97ee('0x1b')](function(_0x1e43a1){if(_0x1e43a1&&_0x1e43a1['id']){logger['info'](_0x97ee('0x1c'));logger['info'](_0x97ee('0x53'),_0x1e43a1['id']);logger['info'](_0x97ee('0x51'),_0x97ee('0x54'));emit(util['format']('user:%s',_0x57525c[_0x97ee('0x16')]),_0x97ee('0x55'),{'uri':util[_0x97ee('0xf')](_0x97ee('0x56'),_0x1e831e['remoteUri'],_0x1e43a1['id'])});}})[_0x97ee('0x4b')](function(_0x1f9df0){logger[_0x97ee('0x4c')](_0x97ee('0x51'),JSON[_0x97ee('0x2d')](_0x1f9df0));});};exports['unmanaged']=function(_0xc89308,_0x55596f,_0xe17d32,_0x437643,_0x5b93ec,_0x1c9653){var _0xec9caf,_0x5952f3;_0x1c9653[_0x97ee('0x1a')]=intUtil[_0x97ee('0x4e')](_0x1c9653[_0x97ee('0x1a')]);_0x1c9653[_0x97ee('0x3f')]=intUtil[_0x97ee('0x4e')](_0x1c9653[_0x97ee('0x3f')]);if(_0x5b93ec&&_0x5b93ec[_0x97ee('0x40')]){logger[_0x97ee('0x1f')]('['+_0x55596f[_0x97ee('0x57')][_0x97ee('0x58')]()+']',_0x97ee('0x41'));_0x55596f[_0x97ee('0x42')]=util[_0x97ee('0xf')](_0x97ee('0x43'),_0x1c9653[_0x97ee('0x3f')],_0x55596f[_0x97ee('0x44')],md5(_0x55596f[_0x97ee('0x44')]));}else{_0x55596f[_0x97ee('0x42')]='';}headers[_0x97ee('0x52')]=getAuth(_0x1c9653);return getUser(_0x1c9653,'')[_0x97ee('0x1b')](function(_0x13b6e4){_0xec9caf=_0x13b6e4;logger[_0x97ee('0x1f')]('The\x20User\x20ID\x20is:',_0xec9caf['id']);return getEndUser(_0x1c9653,_0x55596f['calleridname'],_0x55596f['calleridnum']);})[_0x97ee('0x1b')](function(_0x3c3e6e){_0x5952f3=_0x3c3e6e;logger[_0x97ee('0x1f')](_0x97ee('0x48'),_0x5952f3['id']);return getTicket(_0x1c9653,_0xec9caf,_0x5952f3,_0xe17d32,_0x55596f);})['then'](function(_0x24a825){if(_0x24a825){logger[_0x97ee('0x1f')](_0x97ee('0x1c'));logger['info'](_0x97ee('0x53'),_0x24a825['id']);}})[_0x97ee('0x4b')](function(_0x7b1a64){logger[_0x97ee('0x4c')]('['+_0x55596f[_0x97ee('0x57')][_0x97ee('0x58')]()+']',JSON[_0x97ee('0x2d')](_0x7b1a64));});}; \ 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 ee42956..29297cf 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 _0xfdf6=['contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','userEmail','/api/lookup?q=','&f='];(function(_0xf38cb1,_0x24259c){var _0x51682a=function(_0x1de7b4){while(--_0x1de7b4){_0xf38cb1['push'](_0xf38cb1['shift']());}};_0x51682a(++_0x24259c);}(_0xfdf6,0x134));var _0x6fdf=function(_0x72cb71,_0x589d43){_0x72cb71=_0x72cb71-0x0;var _0x4f62ec=_0xfdf6[_0x72cb71];return _0x4f62ec;};'use strict';var _=require(_0x6fdf('0x0'));var rp=require(_0x6fdf('0x1'));var md5=require(_0x6fdf('0x2'));var util=require('util');var moment=require(_0x6fdf('0x3'));var Promise=require(_0x6fdf('0x4'));var Redis=require(_0x6fdf('0x5'));var intUtil=require(_0x6fdf('0x6'));var config=require('../../../../config/environment');var logger=require(_0x6fdf('0x7'))(_0x6fdf('0x8'));config[_0x6fdf('0x9')]=_['defaults'](config[_0x6fdf('0x9')],{'host':_0x6fdf('0xa'),'port':0x18eb});var io=require(_0x6fdf('0xb'))(new Redis(config['redis']));function getAdminId(_0x51d654,_0x5e9140,_0x5b27c5,_0xba8327){return new Promise(function(_0x44fcc7,_0x5ef189){var _0x4d691d=![];var _0x3e5c63={'method':_0x6fdf('0xc'),'uri':_0xba8327+_0x6fdf('0xd'),'json':!![]};_0x3e5c63[_0x6fdf('0xe')]=_0x5b27c5;logger[_0x6fdf('0xf')](_0x6fdf('0x10'));return rp(_0x3e5c63)[_0x6fdf('0x11')](function(_0x206c76){if(_0x206c76){var _0x3d66fb=_0x206c76[_0x6fdf('0x12')];var _0x5207bf=null;for(_0x5207bf=0x0;_0x5207bf<_0x3d66fb[_0x6fdf('0x13')];_0x5207bf++){if(_0x3d66fb[_0x5207bf]['email']===_0x51d654[_0x6fdf('0x14')]){_0x51d654[_0x6fdf('0x15')]=_0x3d66fb[_0x5207bf]['id'];_0x4d691d=!![];}}if(_0x4d691d){logger[_0x6fdf('0xf')](_0x6fdf('0x16'),_0x51d654[_0x6fdf('0x15')]);_0x44fcc7(_0x51d654);}else{_0x5ef189({'statusCode':0x194,'message':_0x6fdf('0x17')});}}else{_0x5ef189({'statusCode':0x194,'message':_0x6fdf('0x17')});}})[_0x6fdf('0x18')](function(_0x19fcd0){logger[_0x6fdf('0x19')]('['+[_0x5e9140[_0x6fdf('0x1a')]()]+']',_0x19fcd0[_0x6fdf('0x1b')]);_0x5ef189(_0x19fcd0);});});}function getUser(_0x5b3932,_0x18a449,_0x3ec218){return function(_0x142e37){return new Promise(function(_0x1d948b,_0x45b010){var _0x1ac298={'method':_0x6fdf('0xc'),'uri':_0x3ec218+_0x6fdf('0xd'),'json':!![]};_0x1ac298['headers']=_0x18a449;logger[_0x6fdf('0xf')](_0x6fdf('0x1c'));return rp(_0x1ac298)['then'](function(_0x374d6b){if(_0x374d6b){var _0xac0fbd=_0x374d6b['users'];var _0x7c370d=![];var _0x313125=null;if(_0x142e37[_0x6fdf('0x1d')]!==null){logger['info'](_0x6fdf('0x1e'),_0x142e37[_0x6fdf('0x1d')]);_0x142e37['userEmail']=_0x142e37[_0x6fdf('0x1d')];for(_0x313125=0x0;_0x313125<_0xac0fbd[_0x6fdf('0x13')];_0x313125++){if(_0xac0fbd[_0x313125]['email']===_0x142e37[_0x6fdf('0x1d')]){_0x7c370d=!![];_0x142e37[_0x6fdf('0x1f')]=_0xac0fbd[_0x313125]['id'];logger[_0x6fdf('0xf')](_0x6fdf('0x20'),_0x142e37[_0x6fdf('0x1f')]);}}}if(!_0x7c370d){logger[_0x6fdf('0xf')]('Admin\x20selected');_0x142e37[_0x6fdf('0x21')]=_0x142e37[_0x6fdf('0x14')];_0x142e37[_0x6fdf('0x1f')]=_0x142e37[_0x6fdf('0x15')];_0x7c370d=!![];}if(_0x7c370d){_0x1d948b(_0x142e37);}else{_0x45b010({'statusCode':0x194,'message':_0x6fdf('0x17')});}}else{_0x45b010({'statusCode':0x194,'message':_0x6fdf('0x17')});}})[_0x6fdf('0x18')](function(_0xf97597){logger[_0x6fdf('0x19')]('['+[_0x5b3932[_0x6fdf('0x1a')]()]+']',_0xf97597[_0x6fdf('0x1b')]);_0x45b010(_0xf97597);});});};}function searchContact(_0x15ce3b,_0x37030d,_0x437525,_0x556d2c){return new Promise(function(_0x5b8db7,_0x542266){var _0x38dbf9={'method':'GET','headers':_0x37030d,'uri':_0x15ce3b+_0x6fdf('0x22')+_0x556d2c+_0x6fdf('0x23')+_0x437525+'&entities=contact','json':!![]};rp(_0x38dbf9)[_0x6fdf('0x11')](function(_0x2511fa){var _0x2b56af=_['find'](_0x2511fa[_0x6fdf('0x24')][_0x6fdf('0x24')],[_0x437525,_0x556d2c]);_0x5b8db7(_0x2b56af);})[_0x6fdf('0x18')](function(_0x18dfd6){_0x542266(_0x18dfd6);});});}function getEndUser(_0x238b7d,_0x563b35,_0x5b2682){return function(_0x3701bf){return new Promise(function(_0x3279ca,_0x2de0cf){logger['info'](util[_0x6fdf('0x25')](_0x6fdf('0x26'),_0x3701bf[_0x6fdf('0x27')]));searchContact(_0x5b2682,_0x563b35,_0x6fdf('0x28'),_0x3701bf[_0x6fdf('0x27')])[_0x6fdf('0x11')](function(_0x43e133){if(_0x43e133){_0x3701bf['endUserId']=_0x43e133['id'];logger[_0x6fdf('0xf')](_0x6fdf('0x29'),_0x3701bf[_0x6fdf('0x2a')]);return _0x3279ca(_0x3701bf);}searchContact(_0x5b2682,_0x563b35,_0x6fdf('0x2b'),_0x3701bf[_0x6fdf('0x27')])['then'](function(_0x2077b0){if(_0x2077b0){_0x3701bf[_0x6fdf('0x2a')]=_0x2077b0['id'];logger[_0x6fdf('0xf')]('Contact\x20found\x20work_number:',_0x3701bf[_0x6fdf('0x2a')]);return _0x3279ca(_0x3701bf);}createEndUser(_0x3701bf,_0x238b7d,_0x563b35,_0x5b2682)[_0x6fdf('0x11')](function(_0x3a6358){logger[_0x6fdf('0xf')](_0x6fdf('0x2c'),_0x3a6358[_0x6fdf('0x2a')]);return _0x3279ca(_0x3a6358);});});})[_0x6fdf('0x18')](function(_0x323c97){_0x2de0cf(_0x323c97);});});};}function createEndUser(_0x6ced85,_0xc63056,_0x304b90,_0x232224){return new Promise(function(_0x331be9,_0x4e6fce){var _0x37b18d=moment();var _0x2b64a3={'method':_0x6fdf('0x2d'),'uri':_0x232224+_0x6fdf('0x2e'),'body':{'contact':{'last_name':_0x6ced85[_0x6fdf('0x27')],'work_number':_0x6ced85[_0x6fdf('0x27')],'mobile_number':_0x6ced85['contactNumber'],'owner_id':_0x6ced85[_0x6fdf('0x1f')],'created_at':_0x37b18d[_0x6fdf('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x2b64a3[_0x6fdf('0xe')]=_0x304b90;logger[_0x6fdf('0xf')](_0x6fdf('0x2f'));return rp(_0x2b64a3)[_0x6fdf('0x11')](function(_0x25afb7){_0x6ced85[_0x6fdf('0x2a')]=_0x25afb7[_0x6fdf('0x30')]['id'];_0x331be9(_0x6ced85);})[_0x6fdf('0x18')](function(_0x1f3cea){logger[_0x6fdf('0x19')]('['+[_0xc63056[_0x6fdf('0x1a')]()]+']',_0x1f3cea[_0x6fdf('0x1b')]);_0x4e6fce(_0x1f3cea[_0x6fdf('0x1b')]);});});}function getTicket(_0x455c5d,_0x56f29c,_0x42aa6e,_0x18eb52,_0x302953){return function(_0x4a1942){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x13cace,_0x588b09){var _0xf41bbb=moment();var _0x55f0d6={'method':_0x6fdf('0x2d'),'uri':_0x42aa6e+_0x6fdf('0x31'),'body':{'title':intUtil[_0x6fdf('0x32')](_0x18eb52[_0x6fdf('0x33')],_0x302953,'\x20'),'description':intUtil['getString'](_0x18eb52[_0x6fdf('0x34')],_0x302953,'\x0a'),'owner_id':_0x4a1942[_0x6fdf('0x1f')],'creater_id':_0x4a1942[_0x6fdf('0x15')],'targetable_id':_0x4a1942[_0x6fdf('0x2a')],'targetable_type':_0x6fdf('0x35'),'created_at':_0xf41bbb[_0x6fdf('0x25')](_0x6fdf('0x36')),'due_date':_0xf41bbb[_0x6fdf('0x37')](0x1e,'m')['format'](_0x6fdf('0x36'))},'json':!![]};_0x55f0d6[_0x6fdf('0xe')]=_0x56f29c;return rp(_0x55f0d6)[_0x6fdf('0x11')](function(_0x5d8091){_0x4a1942[_0x6fdf('0x38')]=_0x5d8091[_0x6fdf('0x39')]['id'];logger['info'](_0x6fdf('0x3a'),_0x4a1942[_0x6fdf('0x38')]);_0x13cace(_0x4a1942);})[_0x6fdf('0x18')](function(_0x4b508b){logger[_0x6fdf('0x19')]('['+[_0x455c5d[_0x6fdf('0x1a')]()]+']',_0x4b508b[_0x6fdf('0x1b')]);_0x588b09(_0x4b508b[_0x6fdf('0x1b')]);});});};}function emit(_0xd8239f,_0x4f3b2a,_0x528d7c){var _0x4a048c={'uri':_0xd8239f+_0x6fdf('0x3b')+_0x528d7c};io['to'](util[_0x6fdf('0x25')](_0x6fdf('0x3c'),_0x4f3b2a))[_0x6fdf('0x3d')](_0x6fdf('0x3e'),_0x4a048c);}exports['cs']=function(_0x152e6e,_0x146fa1,_0x4a53b2,_0x3e8a2e,_0x4451c9,_0x22955c,_0x9ea30f,_0x128e4a){var _0x3bf392={};var _0x2fd864={'Authorization':_0x6fdf('0x3f')+_0x22955c[_0x6fdf('0x40')]};_0x22955c[_0x6fdf('0x41')]=intUtil[_0x6fdf('0x42')](_0x22955c[_0x6fdf('0x41')]);_0x22955c[_0x6fdf('0x43')]=intUtil[_0x6fdf('0x42')](_0x22955c[_0x6fdf('0x43')]);var _0x4ed6e3=_0x22955c[_0x6fdf('0x41')];_0x3bf392[_0x6fdf('0x14')]=_0x22955c['username'];_0x3bf392['contactNumber']=_0x128e4a[_0x6fdf('0x44')]()===_0x6fdf('0x45')?_0x146fa1[_0x6fdf('0x46')]:_0x146fa1[_0x6fdf('0x47')];_0x3bf392[_0x6fdf('0x48')]=_0x128e4a==='queue'||_0x128e4a===_0x6fdf('0x49')?_0x6fdf('0x4a'):_0x6fdf('0x45');if(_0x3e8a2e){_0x3bf392['agentEmail']=_0x3e8a2e['email'];}var _0x49295e=util[_0x6fdf('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x22955c[_0x6fdf('0x43')],_0x146fa1['uniqueid'],md5(_0x146fa1[_0x6fdf('0x4b')]));if(_0x4451c9&&_0x4451c9['monitor_format']){logger[_0x6fdf('0xf')]('[QUEUE]',_0x6fdf('0x4c'));_0x146fa1[_0x6fdf('0x4d')]=_0x49295e;}else if(_0x9ea30f&&_0x9ea30f['recordingFormat']&&_0x9ea30f[_0x6fdf('0x4e')]!==_0x6fdf('0x4f')){logger[_0x6fdf('0xf')](_0x6fdf('0x50'),'Recording\x20is\x20enabled!');_0x146fa1[_0x6fdf('0x4d')]=_0x49295e;}else{_0x146fa1['recordingURL']='';}return getAdminId(_0x3bf392,_0x128e4a,_0x2fd864,_0x4ed6e3)['then'](getUser(_0x128e4a,_0x2fd864,_0x4ed6e3))[_0x6fdf('0x11')](getEndUser(_0x128e4a,_0x2fd864,_0x4ed6e3))['then'](getTicket(_0x128e4a,_0x2fd864,_0x4ed6e3,_0x4a53b2,_0x146fa1))['then'](function(_0x5eda8c){logger[_0x6fdf('0xf')](util['format'](_0x6fdf('0x51'),_0x5eda8c[_0x6fdf('0x38')]));if(_0x128e4a!==_0x6fdf('0x49')){logger[_0x6fdf('0xf')]('['+[_0x128e4a[_0x6fdf('0x1a')]()]+']',_0x6fdf('0x52'));emit(_0x4ed6e3,_0x3e8a2e[_0x6fdf('0x53')],_0x5eda8c['endUserId']);}})[_0x6fdf('0x18')](function(_0xf7b991){logger[_0x6fdf('0x19')]('['+[_0x128e4a['toUpperCase']()]+_0x6fdf('0x54'),util[_0x6fdf('0x55')](_0xf7b991,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4622=['inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','headers','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','GET','/api/selector/owners','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','catch','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','error','toUpperCase','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration'];(function(_0x2fe19b,_0x341817){var _0x4c0fe8=function(_0x3ae58c){while(--_0x3ae58c){_0x2fe19b['push'](_0x2fe19b['shift']());}};_0x4c0fe8(++_0x341817);}(_0x4622,0x112));var _0x2462=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x4622[_0x503950];return _0x1657a9;};'use strict';var _=require(_0x2462('0x0'));var rp=require(_0x2462('0x1'));var md5=require(_0x2462('0x2'));var util=require('util');var moment=require(_0x2462('0x3'));var Promise=require(_0x2462('0x4'));var Redis=require(_0x2462('0x5'));var intUtil=require(_0x2462('0x6'));var config=require(_0x2462('0x7'));var logger=require('../../../../config/logger')(_0x2462('0x8'));config[_0x2462('0x9')]=_[_0x2462('0xa')](config[_0x2462('0x9')],{'host':_0x2462('0xb'),'port':0x18eb});var io=require(_0x2462('0xc'))(new Redis(config['redis']));function getAdminId(_0x5791df,_0xf42612,_0x153ad8,_0x33bb26){return new Promise(function(_0x5ba0ac,_0x4f3d67){var _0x49273a=![];var _0x466991={'method':'GET','uri':_0x33bb26+'/api/selector/owners','json':!![]};_0x466991[_0x2462('0xd')]=_0x153ad8;logger['info'](_0x2462('0xe'));return rp(_0x466991)[_0x2462('0xf')](function(_0x1bfa2d){if(_0x1bfa2d){var _0x1b7aaa=_0x1bfa2d['users'];var _0x13d67b=null;for(_0x13d67b=0x0;_0x13d67b<_0x1b7aaa[_0x2462('0x10')];_0x13d67b++){if(_0x1b7aaa[_0x13d67b][_0x2462('0x11')]===_0x5791df[_0x2462('0x12')]){_0x5791df[_0x2462('0x13')]=_0x1b7aaa[_0x13d67b]['id'];_0x49273a=!![];}}if(_0x49273a){logger[_0x2462('0x14')](_0x2462('0x15'),_0x5791df[_0x2462('0x13')]);_0x5ba0ac(_0x5791df);}else{_0x4f3d67({'statusCode':0x194,'message':_0x2462('0x16')});}}else{_0x4f3d67({'statusCode':0x194,'message':_0x2462('0x16')});}})['catch'](function(_0x165ccf){logger['error']('['+[_0xf42612['toUpperCase']()]+']',_0x165ccf['message']);_0x4f3d67(_0x165ccf);});});}function getUser(_0x5d1de1,_0x4769c8,_0x13c9fc){return function(_0x48d8d7){return new Promise(function(_0x1f81b2,_0x431b8e){var _0x11899f={'method':_0x2462('0x17'),'uri':_0x13c9fc+_0x2462('0x18'),'json':!![]};_0x11899f[_0x2462('0xd')]=_0x4769c8;logger[_0x2462('0x14')]('Getting\x20user\x20list');return rp(_0x11899f)[_0x2462('0xf')](function(_0xa375dc){if(_0xa375dc){var _0x292425=_0xa375dc['users'];var _0x48ee31=![];var _0x424392=null;if(_0x48d8d7[_0x2462('0x19')]!==null){logger[_0x2462('0x14')](_0x2462('0x1a'),_0x48d8d7['agentEmail']);_0x48d8d7[_0x2462('0x1b')]=_0x48d8d7[_0x2462('0x19')];for(_0x424392=0x0;_0x424392<_0x292425[_0x2462('0x10')];_0x424392++){if(_0x292425[_0x424392][_0x2462('0x11')]===_0x48d8d7[_0x2462('0x19')]){_0x48ee31=!![];_0x48d8d7['userId']=_0x292425[_0x424392]['id'];logger['info'](_0x2462('0x1c'),_0x48d8d7[_0x2462('0x1d')]);}}}if(!_0x48ee31){logger[_0x2462('0x14')](_0x2462('0x1e'));_0x48d8d7[_0x2462('0x1b')]=_0x48d8d7[_0x2462('0x12')];_0x48d8d7['userId']=_0x48d8d7[_0x2462('0x13')];_0x48ee31=!![];}if(_0x48ee31){_0x1f81b2(_0x48d8d7);}else{_0x431b8e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x431b8e({'statusCode':0x194,'message':_0x2462('0x16')});}})['catch'](function(_0x1a302f){logger['error']('['+[_0x5d1de1['toUpperCase']()]+']',_0x1a302f[_0x2462('0x1f')]);_0x431b8e(_0x1a302f);});});};}function searchContact(_0x4eb4b5,_0x17cee9,_0x55c7f1,_0x176f43){return new Promise(function(_0x280131,_0xe64854){var _0x427d91={'method':_0x2462('0x17'),'headers':_0x17cee9,'uri':_0x4eb4b5+_0x2462('0x20')+_0x176f43+_0x2462('0x21')+_0x55c7f1+_0x2462('0x22'),'json':!![]};rp(_0x427d91)['then'](function(_0x5bf676){var _0x168d5b=_[_0x2462('0x23')](_0x5bf676[_0x2462('0x24')][_0x2462('0x24')],[_0x55c7f1,_0x176f43]);_0x280131(_0x168d5b);})['catch'](function(_0x218080){_0xe64854(_0x218080);});});}function getEndUser(_0x10d0bb,_0x4d8b23,_0x2c53cb){return function(_0x1fa169){return new Promise(function(_0xbed7ce,_0xe26bc){logger[_0x2462('0x14')](util[_0x2462('0x25')](_0x2462('0x26'),_0x1fa169['contactNumber']));searchContact(_0x2c53cb,_0x4d8b23,_0x2462('0x27'),_0x1fa169[_0x2462('0x28')])[_0x2462('0xf')](function(_0x29271c){if(_0x29271c){_0x1fa169[_0x2462('0x29')]=_0x29271c['id'];logger['info'](_0x2462('0x2a'),_0x1fa169[_0x2462('0x29')]);return _0xbed7ce(_0x1fa169);}searchContact(_0x2c53cb,_0x4d8b23,_0x2462('0x2b'),_0x1fa169[_0x2462('0x28')])[_0x2462('0xf')](function(_0x20c513){if(_0x20c513){_0x1fa169[_0x2462('0x29')]=_0x20c513['id'];logger[_0x2462('0x14')](_0x2462('0x2c'),_0x1fa169[_0x2462('0x29')]);return _0xbed7ce(_0x1fa169);}createEndUser(_0x1fa169,_0x10d0bb,_0x4d8b23,_0x2c53cb)['then'](function(_0x47b747){logger[_0x2462('0x14')](_0x2462('0x2d'),_0x47b747[_0x2462('0x29')]);return _0xbed7ce(_0x47b747);});});})[_0x2462('0x2e')](function(_0x49f820){_0xe26bc(_0x49f820);});});};}function createEndUser(_0x41feeb,_0x50bd0c,_0x3bd1e9,_0x4b9475){return new Promise(function(_0x24ab23,_0x46cace){var _0x2d9073=moment();var _0x55cab1={'method':'POST','uri':_0x4b9475+'/api/contacts','body':{'contact':{'last_name':_0x41feeb['contactNumber'],'work_number':_0x41feeb[_0x2462('0x28')],'mobile_number':_0x41feeb['contactNumber'],'owner_id':_0x41feeb[_0x2462('0x1d')],'created_at':_0x2d9073['format'](_0x2462('0x2f'))}},'json':!![]};_0x55cab1[_0x2462('0xd')]=_0x3bd1e9;logger[_0x2462('0x14')](_0x2462('0x30'));return rp(_0x55cab1)[_0x2462('0xf')](function(_0x2ca7ef){_0x41feeb[_0x2462('0x29')]=_0x2ca7ef[_0x2462('0x31')]['id'];_0x24ab23(_0x41feeb);})['catch'](function(_0x3d1b6b){logger['error']('['+[_0x50bd0c['toUpperCase']()]+']',_0x3d1b6b[_0x2462('0x1f')]);_0x46cace(_0x3d1b6b[_0x2462('0x1f')]);});});}function getTicket(_0x5df3ef,_0xc174aa,_0x930c2c,_0x4d6165,_0x5f07c){return function(_0x22db6b){logger[_0x2462('0x14')](_0x2462('0x32'));return new Promise(function(_0x35d02c,_0x4fe7de){var _0x4ed044=moment();var _0x2f771c={'method':_0x2462('0x33'),'uri':_0x930c2c+_0x2462('0x34'),'body':{'title':intUtil[_0x2462('0x35')](_0x4d6165[_0x2462('0x36')],_0x5f07c,'\x20'),'description':intUtil[_0x2462('0x35')](_0x4d6165[_0x2462('0x37')],_0x5f07c,'\x0a'),'owner_id':_0x22db6b[_0x2462('0x1d')],'creater_id':_0x22db6b[_0x2462('0x13')],'targetable_id':_0x22db6b[_0x2462('0x29')],'targetable_type':_0x2462('0x38'),'created_at':_0x4ed044[_0x2462('0x25')](_0x2462('0x2f')),'due_date':_0x4ed044[_0x2462('0x39')](0x1e,'m')[_0x2462('0x25')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x2f771c[_0x2462('0xd')]=_0xc174aa;return rp(_0x2f771c)[_0x2462('0xf')](function(_0xfa0f76){_0x22db6b[_0x2462('0x3a')]=_0xfa0f76[_0x2462('0x3b')]['id'];logger[_0x2462('0x14')](_0x2462('0x3c'),_0x22db6b[_0x2462('0x3a')]);_0x35d02c(_0x22db6b);})[_0x2462('0x2e')](function(_0x24601d){logger[_0x2462('0x3d')]('['+[_0x5df3ef[_0x2462('0x3e')]()]+']',_0x24601d[_0x2462('0x1f')]);_0x4fe7de(_0x24601d[_0x2462('0x1f')]);});});};}function emit(_0x3e3bda,_0x103ac0,_0xf4bf51){var _0x57c99e={'uri':_0x3e3bda+_0x2462('0x3f')+_0xf4bf51};io['to'](util[_0x2462('0x25')](_0x2462('0x40'),_0x103ac0))[_0x2462('0x41')](_0x2462('0x42'),_0x57c99e);}exports['cs']=function(_0x598aa3,_0x2f1c23,_0x480944,_0x4a8a2e,_0x1d095c,_0x5eb977,_0x4c810b,_0x179891){var _0x355d06={};var _0x984f85={'Authorization':_0x2462('0x43')+_0x5eb977[_0x2462('0x44')]};_0x5eb977[_0x2462('0x45')]=intUtil[_0x2462('0x46')](_0x5eb977[_0x2462('0x45')]);_0x5eb977['serverUrl']=intUtil[_0x2462('0x46')](_0x5eb977[_0x2462('0x47')]);var _0x170e6b=_0x5eb977['remoteUri'];_0x355d06[_0x2462('0x12')]=_0x5eb977[_0x2462('0x48')];_0x355d06[_0x2462('0x28')]=_0x179891[_0x2462('0x49')]()===_0x2462('0x4a')?_0x2f1c23['destcalleridnum']:_0x2f1c23[_0x2462('0x4b')];_0x355d06[_0x2462('0x4c')]=_0x179891===_0x2462('0x4d')||_0x179891==='unmanaged'?_0x2462('0x4d'):_0x2462('0x4a');if(_0x4a8a2e){_0x355d06[_0x2462('0x19')]=_0x4a8a2e[_0x2462('0x11')];}var _0x438cca=util[_0x2462('0x25')](_0x2462('0x4e'),_0x5eb977[_0x2462('0x47')],_0x2f1c23[_0x2462('0x4f')],md5(_0x2f1c23[_0x2462('0x4f')]));if(_0x1d095c&&_0x1d095c[_0x2462('0x50')]){logger['info'](_0x2462('0x51'),_0x2462('0x52'));_0x2f1c23[_0x2462('0x53')]=_0x438cca;}else if(_0x4c810b&&_0x4c810b[_0x2462('0x54')]&&_0x4c810b[_0x2462('0x54')]!=='none'){logger[_0x2462('0x14')](_0x2462('0x55'),_0x2462('0x52'));_0x2f1c23[_0x2462('0x53')]=_0x438cca;}else{_0x2f1c23[_0x2462('0x53')]='';}return getAdminId(_0x355d06,_0x179891,_0x984f85,_0x170e6b)[_0x2462('0xf')](getUser(_0x179891,_0x984f85,_0x170e6b))['then'](getEndUser(_0x179891,_0x984f85,_0x170e6b))[_0x2462('0xf')](getTicket(_0x179891,_0x984f85,_0x170e6b,_0x480944,_0x2f1c23))['then'](function(_0xa48712){logger['info'](util['format'](_0x2462('0x56'),_0xa48712[_0x2462('0x3a')]));if(_0x179891!==_0x2462('0x57')){logger[_0x2462('0x14')]('['+[_0x179891[_0x2462('0x3e')]()]+']',_0x2462('0x58'));emit(_0x170e6b,_0x4a8a2e['name'],_0xa48712[_0x2462('0x29')]);}})[_0x2462('0x2e')](function(_0x134f9e){logger[_0x2462('0x3d')]('['+[_0x179891[_0x2462('0x3e')]()]+_0x2462('0x59'),util[_0x2462('0x5a')](_0x134f9e,{'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 13e2d92..7aa4697 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 _0xadbf=['servicenow','exec','includes','data1','toLowerCase','data3','queue','routeId','unmanaged','salesforce','log','../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xadbf,0x7e));var _0xfadb=function(_0x48a617,_0x3ffeac){_0x48a617=_0x48a617-0x0;var _0x98b663=_0xadbf[_0x48a617];return _0x98b663;};'use strict';var _=require(_0xfadb('0x0'));var util=require(_0xfadb('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xfadb('0x2'));var sugarcrm=require(_0xfadb('0x3'));var freshdesk=require(_0xfadb('0x4'));var zoho=require(_0xfadb('0x5'));var desk=require(_0xfadb('0x6'));var vtiger=require(_0xfadb('0x7'));var servicenow=require(_0xfadb('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0xfadb('0x9'));var integrations=[_0xfadb('0xa'),'salesforce',_0xfadb('0xb'),_0xfadb('0xc'),_0xfadb('0xd'),_0xfadb('0xe'),_0xfadb('0xf'),_0xfadb('0x10'),_0xfadb('0x11'),_0xfadb('0x12')];exports[_0xfadb('0x13')]=function(_0x10d80d,_0x2761bc,_0x4b7d3b,_0x18076b,_0x46b558,_0x575cb1){if(_0x4b7d3b){if(_[_0xfadb('0x14')](integrations,_0x10d80d[_0xfadb('0x15')][_0xfadb('0x16')]())){try{var _0x38c313=null;var _0x371987='';var _0x1af0a8=_0x4b7d3b[_0x10d80d[_0xfadb('0x15')]['toLowerCase']()];if(_0x1af0a8){var _0x1baa37=_0x1af0a8[_0x10d80d['data2']];if(_0x1baa37){var _0x22e3c9=_['find'](_0x1baa37['Configurations'],{'id':parseInt(_0x10d80d[_0xfadb('0x17')],0xa)});if(_0x22e3c9){if(_0x18076b){if(_0x46b558&&_0x2761bc[_0xfadb('0x18')]){_0x371987=_0xfadb('0x18');}else if(_0x2761bc[_0xfadb('0x19')]){_0x371987='outbound';}else{console['log']('EVENT\x20UNKNOWN',_0x2761bc);}}else{_0x371987=_0xfadb('0x1a');}switch(_0x10d80d[_0xfadb('0x15')][_0xfadb('0x16')]()){case _0xfadb('0xa'):zendesk[_0x371987](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1);break;case _0xfadb('0x1b'):salesforce[_0x371987](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1);break;case'sugarcrm':sugarcrm[_0x371987](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1);break;case'freshdesk':freshdesk[_0x371987](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1);break;case _0xfadb('0xd'):zoho[_0x371987](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1);break;case _0xfadb('0xe'):desk[_0x371987](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1);break;case _0xfadb('0xf'):vtiger[_0x371987](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1);break;case _0xfadb('0x11'):freshsales['cs'](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1,_0x371987);break;case _0xfadb('0x12'):servicenow['cs'](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1,_0x371987);break;case'dynamics365':dynamics365['cs'](_0x10d80d,_0x2761bc,_0x22e3c9,_0x18076b,_0x46b558,_0x1baa37,_0x575cb1,_0x371987);break;default:console[_0xfadb('0x1c')]('unknown\x20integration');}}else{_0x38c313=require(_0xfadb('0x1d'))(_0x10d80d[_0xfadb('0x15')][_0xfadb('0x16')]());_0x38c313[_0xfadb('0x1e')]('[EXEC]',util['format'](_0xfadb('0x1f'),_0x10d80d[_0xfadb('0x15')][_0xfadb('0x16')](),_0x10d80d[_0xfadb('0x17')]));}}else{_0x38c313=require('../../../../config/logger')(_0x10d80d['data1'][_0xfadb('0x16')]());_0x38c313[_0xfadb('0x1e')](_0xfadb('0x20'),util[_0xfadb('0x21')](_0xfadb('0x22'),_0x10d80d['data1'][_0xfadb('0x16')](),_0x10d80d[_0xfadb('0x23')]));}}else{}}catch(_0x275ee6){console[_0xfadb('0x1e')](_0x275ee6);}}}}; \ No newline at end of file +var _0x9bd9=['freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','data1','unknown\x20integration','error','[EXEC]','format','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm'];(function(_0x87a0d9,_0x37386e){var _0x219984=function(_0x410c8b){while(--_0x410c8b){_0x87a0d9['push'](_0x87a0d9['shift']());}};_0x219984(++_0x37386e);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x2a1465,_0x8bf785){_0x2a1465=_0x2a1465-0x0;var _0x128933=_0x9bd9[_0x2a1465];return _0x128933;};'use strict';var _=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var zendesk=require(_0x99bd('0x2'));var salesforce=require(_0x99bd('0x3'));var sugarcrm=require(_0x99bd('0x4'));var freshdesk=require(_0x99bd('0x5'));var zoho=require('./zoho');var desk=require(_0x99bd('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0x99bd('0x7'));var dynamics365=require(_0x99bd('0x8'));var freshsales=require('./freshsales');var integrations=[_0x99bd('0x9'),_0x99bd('0xa'),_0x99bd('0xb'),_0x99bd('0xc'),_0x99bd('0xd'),_0x99bd('0xe'),_0x99bd('0xf'),_0x99bd('0x10'),_0x99bd('0x11'),_0x99bd('0x12')];exports[_0x99bd('0x13')]=function(_0x468b6e,_0x2ded61,_0x2c479b,_0x521f4c,_0x2b836f,_0x529796){if(_0x2c479b){if(_[_0x99bd('0x14')](integrations,_0x468b6e['data1'][_0x99bd('0x15')]())){try{var _0x219902=null;var _0x4a8bd9='';var _0x22237c=_0x2c479b[_0x468b6e['data1'][_0x99bd('0x15')]()];if(_0x22237c){var _0x48b2aa=_0x22237c[_0x468b6e[_0x99bd('0x16')]];if(_0x48b2aa){var _0x401299=_[_0x99bd('0x17')](_0x48b2aa['Configurations'],{'id':parseInt(_0x468b6e[_0x99bd('0x18')],0xa)});if(_0x401299){if(_0x521f4c){if(_0x2b836f&&_0x2ded61[_0x99bd('0x19')]){_0x4a8bd9=_0x99bd('0x19');}else if(_0x2ded61[_0x99bd('0x1a')]){_0x4a8bd9=_0x99bd('0x1b');}else{console[_0x99bd('0x1c')](_0x99bd('0x1d'),_0x2ded61);}}else{_0x4a8bd9=_0x99bd('0x1e');}switch(_0x468b6e[_0x99bd('0x1f')]['toLowerCase']()){case _0x99bd('0x9'):zendesk[_0x4a8bd9](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796);break;case _0x99bd('0xa'):salesforce[_0x4a8bd9](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796);break;case _0x99bd('0xb'):sugarcrm[_0x4a8bd9](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796);break;case'freshdesk':freshdesk[_0x4a8bd9](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796);break;case'zoho':zoho[_0x4a8bd9](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796);break;case _0x99bd('0xe'):desk[_0x4a8bd9](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796);break;case _0x99bd('0xf'):vtiger[_0x4a8bd9](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796);break;case _0x99bd('0x11'):freshsales['cs'](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796,_0x4a8bd9);break;case _0x99bd('0x12'):servicenow['cs'](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796,_0x4a8bd9);break;case _0x99bd('0x10'):dynamics365['cs'](_0x468b6e,_0x2ded61,_0x401299,_0x521f4c,_0x2b836f,_0x48b2aa,_0x529796,_0x4a8bd9);break;default:console['log'](_0x99bd('0x20'));}}else{_0x219902=require('../../../../config/logger')(_0x468b6e[_0x99bd('0x1f')][_0x99bd('0x15')]());_0x219902[_0x99bd('0x21')](_0x99bd('0x22'),util[_0x99bd('0x23')]('%s\x20configuration\x20#%s\x20not\x20found',_0x468b6e[_0x99bd('0x1f')][_0x99bd('0x15')](),_0x468b6e[_0x99bd('0x18')]));}}else{_0x219902=require('../../../../config/logger')(_0x468b6e[_0x99bd('0x1f')]['toLowerCase']());_0x219902['error'](_0x99bd('0x22'),util[_0x99bd('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x468b6e[_0x99bd('0x1f')][_0x99bd('0x15')](),_0x468b6e[_0x99bd('0x16')]));}}else{}}catch(_0x3f7bf4){console['error'](_0x3f7bf4);}}}}; \ 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 37ba940..4168278 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 _0x5d25=['assign','getString','Subjects','Descriptions','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','account','WhatId','ticketType','Case','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','toString','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','lastevent','calleridname',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter'];(function(_0x43edb9,_0x1dee44){var _0xbab2cc=function(_0x32936a){while(--_0x32936a){_0x43edb9['push'](_0x43edb9['shift']());}};_0xbab2cc(++_0x1dee44);}(_0x5d25,0x77));var _0x55d2=function(_0x5e5973,_0x43e7b5){_0x5e5973=_0x5e5973-0x0;var _0x1cf536=_0x5d25[_0x5e5973];return _0x1cf536;};'use strict';var _=require(_0x55d2('0x0'));var rp=require('request-promise');var moment=require(_0x55d2('0x1'));var BPromise=require(_0x55d2('0x2'));var md5=require(_0x55d2('0x3'));var jsforce=require(_0x55d2('0x4'));var util=require(_0x55d2('0x5'));var Redis=require('ioredis');var intUtil=require(_0x55d2('0x6'));var config=require(_0x55d2('0x7'));var logger=require(_0x55d2('0x8'))(_0x55d2('0x9'));config[_0x55d2('0xa')]=_[_0x55d2('0xb')](config['redis'],{'host':_0x55d2('0xc'),'port':0x18eb});var io=require(_0x55d2('0xd'))(new Redis(config[_0x55d2('0xa')]));function emit(_0x557a9e,_0x2a6938,_0x4ab0c8){io['to'](_0x557a9e)['emit'](_0x2a6938,_0x4ab0c8);}function getTicket(_0x56a7e1,_0x31d4dc,_0xd30e49,_0x352786,_0x23560a,_0xb96338,_0x421ed9,_0x314fc2){var _0x3c83f5=Object[_0x55d2('0xe')]({},{'OwnerId':_0x31d4dc['id'],'Subject':intUtil[_0x55d2('0xf')](_0x352786[_0x55d2('0x10')],_0x23560a,'\x20'),'Description':intUtil[_0x55d2('0xf')](_0x352786[_0x55d2('0x11')],_0x23560a,'\x0a')},getCustomFields(_0xb96338,_0x23560a));if(_0xd30e49){if(_0x352786['ticketType']===_0x55d2('0x12')){_0x3c83f5['ActivityDate']=moment[_0x55d2('0x13')]();_0x3c83f5[_0x55d2('0x14')]=![];_0x3c83f5[_0x55d2('0x15')]=![];if(_0xd30e49[_0x55d2('0x16')]===_0x55d2('0x17')||_0xd30e49[_0x55d2('0x16')]==='lead'){_0x3c83f5['WhoId']=_0xd30e49['id'];}else if(_0xd30e49['endUserType']===_0x55d2('0x18')){_0x3c83f5[_0x55d2('0x19')]=_0xd30e49['id'];}}else if(_0x352786[_0x55d2('0x1a')]===_0x55d2('0x1b')){if(_0xd30e49['endUserType']===_0x55d2('0x17')){_0x3c83f5[_0x55d2('0x1c')]=_0xd30e49['id'];}else if(_0xd30e49[_0x55d2('0x16')]==='account'){_0x3c83f5[_0x55d2('0x1d')]=_0xd30e49['id'];}else if(_0xd30e49[_0x55d2('0x16')]===_0x55d2('0x1e')&&_0x352786[_0x55d2('0x1f')]){_0x3c83f5[_0x352786['leadId']]=_0xd30e49['id'];}else{logger['info'](_0x55d2('0x20'));}}}return _0x421ed9[_0x55d2('0x21')](_0x352786[_0x55d2('0x1a')])[_0x55d2('0x22')](_0x3c83f5);}function getUser(_0x5d40a2,_0x37f4e7,_0x40f1ed){if(!_[_0x55d2('0x23')](_0x37f4e7)&&intUtil[_0x55d2('0x24')](_0x37f4e7)){var _0x45c597={'Email':_0x37f4e7};var _0x55cefd={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x40f1ed['sobject'](_0x55d2('0x25'))[_0x55d2('0x26')](_0x45c597,_0x55cefd)[_0x55d2('0x27')]()[_0x55d2('0x28')](function(_0x2e5325){if(_0x2e5325[_0x55d2('0x29')]){var _0x2ee0b2=_[_0x55d2('0x26')](_0x2e5325,function(_0x39be2e){return _0x39be2e[_0x55d2('0x2a')]===_0x37f4e7;});if(_0x2ee0b2){logger[_0x55d2('0x2b')](_0x55d2('0x2c'),_0x37f4e7);return BPromise[_0x55d2('0x2d')]({'id':_0x2ee0b2['Id'],'name':_0x2ee0b2[_0x55d2('0x2e')]});}}else{logger['info'](_0x55d2('0x2f'),_0x37f4e7);return _0x40f1ed[_0x55d2('0x30')]()[_0x55d2('0x28')](function(_0x1a09f4){return BPromise[_0x55d2('0x2d')]({'id':_0x1a09f4[_0x55d2('0x31')],'name':_0x1a09f4[_0x55d2('0x32')]});});}});}else{logger[_0x55d2('0x2b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x37f4e7);return _0x40f1ed[_0x55d2('0x30')]()[_0x55d2('0x28')](function(_0x328ff9){return BPromise[_0x55d2('0x2d')]({'id':_0x328ff9[_0x55d2('0x31')],'name':_0x328ff9[_0x55d2('0x32')]});});}}function getEndUser(_0x400b05,_0x4baf11,_0x9ff43b,_0x326110,_0x4c4a19){var _0x4e8c47={'$or':{'Phone':_0x326110}};var _0x4640be={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x55d2('0x2d')]()['then'](function(){logger[_0x55d2('0x2b')](_0x55d2('0x33'),_0x326110,_0x4baf11[_0x55d2('0x34')]);switch(_0x4baf11[_0x55d2('0x34')]){case _0x55d2('0x35'):var _0x55ee7a=_[_0x55d2('0x36')](_0x4e8c47);if(_0x4baf11['additionalSearchContact']){var _0x4f013b={};_0x4f013b[_0x4baf11[_0x55d2('0x37')]]=_0x326110;_[_0x55d2('0x38')](_0x55ee7a[_0x55d2('0x39')],_0x4f013b);}return _0x4c4a19[_0x55d2('0x21')](_0x55d2('0x3a'))[_0x55d2('0x26')](_0x55ee7a,_0x4640be)['execute']()[_0x55d2('0x28')](function(_0x26a159){if(_0x26a159&&_0x26a159[_0x55d2('0x29')]){return _0x26a159;}else{var _0x5aebfb=_[_0x55d2('0x36')](_0x4e8c47);if(_0x4baf11[_0x55d2('0x3b')]){var _0x27267d={};_0x27267d[_0x4baf11[_0x55d2('0x3b')]]=_0x326110;_[_0x55d2('0x38')](_0x5aebfb['$or'],_0x27267d);}return _0x4c4a19[_0x55d2('0x21')](_0x55d2('0x3c'))['find'](_0x5aebfb,_0x4640be);}});case _0x55d2('0x3d'):var _0x3bb061=_['cloneDeep'](_0x4e8c47);if(_0x4baf11['additionalSearchAccount']){var _0x4f013b={};_0x4f013b[_0x4baf11[_0x55d2('0x3e')]]=_0x326110;_[_0x55d2('0x38')](_0x3bb061[_0x55d2('0x39')],_0x4f013b);}return _0x4c4a19[_0x55d2('0x21')](_0x55d2('0x3f'))['find'](_0x3bb061,_0x4640be)[_0x55d2('0x27')]()[_0x55d2('0x28')](function(_0x3f3f5d){if(_0x3f3f5d&&_0x3f3f5d[_0x55d2('0x29')]){return _0x3f3f5d;}else{var _0x2a9e0b=_['cloneDeep'](_0x4e8c47);if(_0x4baf11[_0x55d2('0x37')]){var _0x50641c={};_0x50641c[_0x4baf11['additionalSearchContact']]=_0x326110;_['merge'](_0x2a9e0b[_0x55d2('0x39')],_0x50641c);}return _0x4c4a19[_0x55d2('0x21')](_0x55d2('0x3a'))[_0x55d2('0x26')](_0x2a9e0b,_0x4640be)[_0x55d2('0x28')](function(_0x26d6a7){if(_0x26d6a7&&_0x26d6a7[_0x55d2('0x29')]){return _0x26d6a7;}else{var _0x4780df=_[_0x55d2('0x36')](_0x4e8c47);if(_0x4baf11[_0x55d2('0x3b')]){var _0x1c0967={};_0x1c0967[_0x4baf11[_0x55d2('0x3b')]]=_0x326110;_['merge'](_0x4780df[_0x55d2('0x39')],_0x1c0967);}return _0x4c4a19[_0x55d2('0x21')]('Lead')['find'](_0x4780df,_0x4640be);}});}});case _0x55d2('0x17'):var _0x55ee7a=_[_0x55d2('0x36')](_0x4e8c47);if(_0x4baf11['additionalSearchContact']){var _0x4f013b={};_0x4f013b[_0x4baf11[_0x55d2('0x37')]]=_0x326110;_[_0x55d2('0x38')](_0x55ee7a[_0x55d2('0x39')],_0x4f013b);}return _0x4c4a19['sobject'](_0x55d2('0x3a'))[_0x55d2('0x26')](_0x55ee7a,_0x4640be)[_0x55d2('0x27')]();case'lead':var _0x423564=_[_0x55d2('0x36')](_0x4e8c47);if(_0x4baf11[_0x55d2('0x3b')]){var _0x4f013b={};_0x4f013b[_0x4baf11[_0x55d2('0x3b')]]=_0x326110;_['merge'](_0x423564[_0x55d2('0x39')],_0x4f013b);}return _0x4c4a19[_0x55d2('0x21')](_0x55d2('0x3c'))[_0x55d2('0x26')](_0x423564,_0x4640be);case _0x55d2('0x18'):var _0x3bb061=_['cloneDeep'](_0x4e8c47);if(_0x4baf11[_0x55d2('0x3e')]){var _0x4f013b={};_0x4f013b[_0x4baf11[_0x55d2('0x3e')]]=_0x326110;_[_0x55d2('0x38')](_0x3bb061['$or'],_0x4f013b);}return _0x4c4a19['sobject'](_0x55d2('0x3f'))[_0x55d2('0x26')](_0x3bb061,_0x4640be);default:return null;}})[_0x55d2('0x28')](function(_0x38fbba){if(_0x38fbba&&_0x38fbba[_0x55d2('0x29')]){var _0x3c2d05=_[_0x55d2('0x40')](_0x38fbba);if(_0x3c2d05){return BPromise[_0x55d2('0x2d')]({'id':_0x3c2d05['Id'],'name':_0x3c2d05['Name'],'phone':_0x3c2d05[_0x55d2('0x41')],'endUserType':_0x3c2d05[_0x55d2('0x42')][_0x55d2('0x43')][_0x55d2('0x44')]()});}}})['then'](function(_0x2c00ea){if(_0x2c00ea){logger['info'](_0x55d2('0x45'),_0x2c00ea[_0x55d2('0x16')],_0x326110);return BPromise[_0x55d2('0x2d')](_0x2c00ea);}else{logger[_0x55d2('0x2b')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x326110);var _0x22daf8={'Phone':_0x326110};if(_0x4baf11[_0x55d2('0x46')]){if(_0x4baf11['moduleCreate']===_0x55d2('0x17')){logger[_0x55d2('0x2b')](_0x55d2('0x47'),_0x326110,_0x4baf11[_0x55d2('0x46')]);_0x22daf8[_0x55d2('0x48')]=_0x9ff43b!==''?_0x9ff43b:util[_0x55d2('0x49')]('Caller\x20-\x20%s',_0x326110);}else if(_0x4baf11[_0x55d2('0x46')]===_0x55d2('0x1e')){logger[_0x55d2('0x2b')](_0x55d2('0x47'),_0x326110,_0x4baf11[_0x55d2('0x46')]);_0x22daf8[_0x55d2('0x48')]=_0x9ff43b!==_0x55d2('0x4a')?_0x9ff43b:util[_0x55d2('0x49')](_0x55d2('0x4b'),_0x326110);_0x22daf8[_0x55d2('0x4c')]=_0x55d2('0x4d');}else if(_0x4baf11[_0x55d2('0x46')]==='account'){logger[_0x55d2('0x2b')](_0x55d2('0x47'),_0x326110,_0x4baf11[_0x55d2('0x46')]);_0x22daf8['Name']=_0x9ff43b!==''?_0x9ff43b:util['format'](_0x55d2('0x4b'),_0x326110);}else{return null;}}return _0x4c4a19[_0x55d2('0x21')](_[_0x55d2('0x4e')](_0x4baf11['moduleCreate']))[_0x55d2('0x22')](_0x22daf8)[_0x55d2('0x28')](function(_0x49e23e){return BPromise[_0x55d2('0x2d')]({'id':_0x49e23e['id'],'endUserType':_0x4baf11['moduleCreate']});});}});}function getCustomFields(_0x15ec9e,_0x1aeb9a){var _0x2470e6={};if(_0x15ec9e[_0x55d2('0x29')]>0x0){_[_0x55d2('0x4f')](_0x15ec9e,function(_0xd6f93f){if(_[_0x55d2('0x50')]([_0x55d2('0x51'),_0x55d2('0x52')],_0xd6f93f['type'])&&_0xd6f93f[_0x55d2('0x53')]){_0x2470e6[_0xd6f93f[_0x55d2('0x53')]]=_0xd6f93f['content'][_0x55d2('0x54')]();}else if(_0xd6f93f[_0x55d2('0x43')]==='variable'&&_0xd6f93f[_0x55d2('0x55')]&&_0xd6f93f[_0x55d2('0x53')]){_0x1aeb9a[_0xd6f93f[_0x55d2('0x55')]]&&(_0x2470e6[_0xd6f93f[_0x55d2('0x53')]]=_0x1aeb9a[_0xd6f93f[_0x55d2('0x55')]][_0x55d2('0x54')]());}else if(_0xd6f93f[_0x55d2('0x43')]===_0x55d2('0x56')&&_0xd6f93f[_0x55d2('0x57')]&&_0xd6f93f[_0x55d2('0x57')]['name']&&_0xd6f93f['idField']){_0x1aeb9a[_0xd6f93f[_0x55d2('0x57')]['name'][_0x55d2('0x44')]()]&&(_0x2470e6[_0xd6f93f[_0x55d2('0x53')]]=_0x1aeb9a[_0xd6f93f[_0x55d2('0x57')][_0x55d2('0x58')][_0x55d2('0x44')]()][_0x55d2('0x54')]());}});}return _0x2470e6;}function getConnection(_0xe9ba24){var _0x4fa715=_0xe9ba24[_0x55d2('0x59')][_0x55d2('0x5a')](_0xe9ba24['securityToken']);var _0x1ceb57=new jsforce[(_0x55d2('0x5b'))]({'oauth2':{'loginUrl':_0xe9ba24[_0x55d2('0x5c')]||_0x55d2('0x5d'),'clientId':_0xe9ba24[_0x55d2('0x5e')],'clientSecret':_0xe9ba24['clientSecret']}});return _0x1ceb57[_0x55d2('0x5f')](_0xe9ba24[_0x55d2('0x60')],_0x4fa715)['then'](function(){logger[_0x55d2('0x2b')]('Connection\x20established.');return _0x1ceb57;});}exports[_0x55d2('0x61')]=function(_0x39a2c1,_0x4b7470,_0x2b90db,_0x48726d,_0x57ee72,_0x5f4eee){var _0x578438,_0x1fbeab,_0x46fd02,_0x23db52;_0x5f4eee[_0x55d2('0x62')]=intUtil[_0x55d2('0x63')](_0x5f4eee['serverUrl']);_0x5f4eee[_0x55d2('0x5c')]=intUtil[_0x55d2('0x63')](_0x5f4eee['remoteUri']);if(_0x57ee72&&_0x57ee72[_0x55d2('0x64')]){logger[_0x55d2('0x2b')]('[QUEUE]',_0x55d2('0x65'));_0x4b7470[_0x55d2('0x66')]=util[_0x55d2('0x49')](_0x55d2('0x67'),_0x5f4eee['serverUrl'],_0x4b7470['uniqueid'],md5(_0x4b7470['uniqueid']));}else{_0x4b7470[_0x55d2('0x66')]='';}return getConnection(_0x5f4eee)[_0x55d2('0x28')](function(_0x5363bc){_0x23db52=_0x5363bc;return getUser(_0x5f4eee,_0x48726d[_0x55d2('0x68')],_0x23db52);})[_0x55d2('0x28')](function(_0x17a434){_0x578438=_0x17a434;return getEndUser(_0x5f4eee,_0x2b90db,_0x4b7470['calleridname'],_0x4b7470[_0x55d2('0x69')],_0x23db52);})[_0x55d2('0x28')](function(_0x4782e3){_0x1fbeab=_0x4782e3;return getTicket(_0x5f4eee,_0x578438,_0x1fbeab,_0x2b90db,_0x4b7470,_0x2b90db[_0x55d2('0x6a')],_0x23db52,'queue');})['then'](function(_0x551d8c){_0x46fd02=_0x551d8c;logger[_0x55d2('0x2b')](_0x55d2('0x6b'),_0x46fd02['id']);logger[_0x55d2('0x2b')](_0x55d2('0x6c'),_0x46fd02['id'],_0x48726d[_0x55d2('0x58')],_0x5f4eee['type']);switch(_0x5f4eee[_0x55d2('0x43')]){case _0x55d2('0x6d'):emit(util[_0x55d2('0x49')](_0x55d2('0x6e'),_0x48726d[_0x55d2('0x58')]),'trigger:salesforce:display',{'recordId':_0x46fd02['id']});break;case _0x55d2('0x6f'):emit(util['format'](_0x55d2('0x6e'),_0x48726d[_0x55d2('0x58')]),'trigger:browser:url',{'uri':util[_0x55d2('0x49')](_0x55d2('0x70'),_0x23db52[_0x55d2('0x71')],_0x46fd02['id'])});break;default:logger[_0x55d2('0x72')](_0x55d2('0x73'));}})[_0x55d2('0x74')](function(_0x49fbca){logger['error'](_0x55d2('0x75'),_0x49fbca);});};exports[_0x55d2('0x76')]=function(_0x2f431f,_0x1edaa3,_0x54817c,_0x49b6e4,_0x3c16c9,_0x3b5119,_0x1de27e){var _0x4ad8fb,_0x4becef,_0x14347a,_0x3901f5;_0x3b5119[_0x55d2('0x62')]=intUtil[_0x55d2('0x63')](_0x3b5119[_0x55d2('0x62')]);_0x3b5119['remoteUri']=intUtil[_0x55d2('0x63')](_0x3b5119[_0x55d2('0x5c')]);if(_0x1de27e&&_0x1de27e[_0x55d2('0x77')]&&_0x1de27e[_0x55d2('0x77')]!==_0x55d2('0x78')){logger[_0x55d2('0x2b')](_0x55d2('0x79'),_0x55d2('0x65'));_0x1edaa3[_0x55d2('0x66')]=util[_0x55d2('0x49')](_0x55d2('0x67'),_0x3b5119['serverUrl'],_0x1edaa3['uniqueid'],md5(_0x1edaa3[_0x55d2('0x7a')]));}return getConnection(_0x3b5119)[_0x55d2('0x28')](function(_0x3e1aed){_0x3901f5=_0x3e1aed;return getUser(_0x3b5119,_0x49b6e4['email'],_0x3901f5);})['then'](function(_0x360bf9){_0x4ad8fb=_0x360bf9;return getEndUser(_0x3b5119,_0x54817c,_0x1edaa3[_0x55d2('0x7b')],_0x1edaa3[_0x55d2('0x7c')],_0x3901f5);})[_0x55d2('0x28')](function(_0x285e0d){_0x4becef=_0x285e0d;return getTicket(_0x3b5119,_0x4ad8fb,_0x4becef,_0x54817c,_0x1edaa3,_0x54817c[_0x55d2('0x6a')],_0x3901f5,_0x55d2('0x76'));})[_0x55d2('0x28')](function(_0x593ba1){_0x14347a=_0x593ba1;logger[_0x55d2('0x2b')](_0x55d2('0x7d'),_0x14347a['id']);logger[_0x55d2('0x2b')](_0x55d2('0x7e'),_0x14347a['id'],_0x49b6e4[_0x55d2('0x58')],_0x3b5119[_0x55d2('0x43')]);switch(_0x3b5119[_0x55d2('0x43')]){case'integrationTab':emit(util[_0x55d2('0x49')](_0x55d2('0x6e'),_0x49b6e4['name']),_0x55d2('0x7f'),{'recordId':_0x14347a['id']});break;case'newTab':emit(util[_0x55d2('0x49')](_0x55d2('0x6e'),_0x49b6e4['name']),'trigger:browser:url',{'uri':util[_0x55d2('0x49')](_0x55d2('0x70'),_0x3901f5['instanceUrl'],_0x14347a['id'])});break;default:logger['error'](_0x55d2('0x79'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x1c5a1){logger[_0x55d2('0x72')](_0x55d2('0x79'),_0x1c5a1);});};exports['unmanaged']=function(_0x12eab0,_0x145a36,_0x11aa29,_0x4b30b3,_0x42040c,_0x1044d8){var _0x4e1d26,_0x599086,_0x5c7846,_0x56076b;_0x1044d8[_0x55d2('0x62')]=intUtil[_0x55d2('0x63')](_0x1044d8[_0x55d2('0x62')]);_0x1044d8[_0x55d2('0x5c')]=intUtil[_0x55d2('0x63')](_0x1044d8['remoteUri']);if(_0x42040c&&_0x42040c[_0x55d2('0x64')]){logger['info']('['+_0x145a36[_0x55d2('0x80')]['toUpperCase']()+']',_0x55d2('0x65'));_0x145a36[_0x55d2('0x66')]=util[_0x55d2('0x49')](_0x55d2('0x67'),_0x1044d8[_0x55d2('0x62')],_0x145a36[_0x55d2('0x7a')],md5(_0x145a36['uniqueid']));}else{_0x145a36[_0x55d2('0x66')]='';}return getConnection(_0x1044d8)[_0x55d2('0x28')](function(_0x8ccb1d){_0x56076b=_0x8ccb1d;if(!_[_0x55d2('0x23')](_0x4b30b3)){return getUser(_0x1044d8,_0x4b30b3[_0x55d2('0x58')],_0x56076b);}else{return getUser(_0x1044d8,null,_0x56076b);}})['then'](function(_0xeb703e){_0x4e1d26=_0xeb703e;return getEndUser(_0x1044d8,_0x11aa29,_0x145a36[_0x55d2('0x81')],_0x145a36[_0x55d2('0x69')],_0x56076b);})['then'](function(_0x7a3705){_0x599086=_0x7a3705;return getTicket(_0x1044d8,_0x4e1d26,_0x599086,_0x11aa29,_0x145a36,_0x11aa29[_0x55d2('0x6a')],_0x56076b);})[_0x55d2('0x28')](function(_0x5da0b4){_0x5c7846=_0x5da0b4;logger['info']('['+_0x145a36[_0x55d2('0x80')]['toUpperCase']()+_0x55d2('0x82'),_0x5c7846['id']);logger['info']('['+_0x145a36[_0x55d2('0x80')][_0x55d2('0x83')]()+_0x55d2('0x84'),_0x1044d8[_0x55d2('0x43')]);})['catch'](function(_0x22db55){logger['error']('['+_0x145a36[_0x55d2('0x80')][_0x55d2('0x83')]()+']',_0x22db55);});}; \ No newline at end of file +var _0x1780=['uniqueid','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','error','catch','remoteUri','[OUTBOUND]','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','find','execute','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','resolve','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','length','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1780,0x114));var _0x0178=function(_0x273216,_0x4398d4){_0x273216=_0x273216-0x0;var _0x51d024=_0x1780[_0x273216];return _0x51d024;};'use strict';var _=require('lodash');var rp=require(_0x0178('0x0'));var moment=require(_0x0178('0x1'));var BPromise=require(_0x0178('0x2'));var md5=require(_0x0178('0x3'));var jsforce=require('jsforce');var util=require(_0x0178('0x4'));var Redis=require(_0x0178('0x5'));var intUtil=require(_0x0178('0x6'));var config=require(_0x0178('0x7'));var logger=require(_0x0178('0x8'))(_0x0178('0x9'));config['redis']=_['defaults'](config[_0x0178('0xa')],{'host':_0x0178('0xb'),'port':0x18eb});var io=require(_0x0178('0xc'))(new Redis(config[_0x0178('0xa')]));function emit(_0x5b37df,_0x4c292d,_0x13d943){io['to'](_0x5b37df)['emit'](_0x4c292d,_0x13d943);}function getTicket(_0x22b3b2,_0x4b0618,_0x254fb4,_0x52c3fc,_0x37189d,_0x5ce90e,_0x3f7ce7,_0x280cbc){var _0x608959=Object[_0x0178('0xd')]({},{'OwnerId':_0x4b0618['id'],'Subject':intUtil[_0x0178('0xe')](_0x52c3fc[_0x0178('0xf')],_0x37189d,'\x20'),'Description':intUtil[_0x0178('0xe')](_0x52c3fc[_0x0178('0x10')],_0x37189d,'\x0a')},getCustomFields(_0x5ce90e,_0x37189d));if(_0x254fb4){if(_0x52c3fc[_0x0178('0x11')]===_0x0178('0x12')){_0x608959[_0x0178('0x13')]=moment[_0x0178('0x14')]();_0x608959[_0x0178('0x15')]=![];_0x608959[_0x0178('0x16')]=![];if(_0x254fb4[_0x0178('0x17')]===_0x0178('0x18')||_0x254fb4[_0x0178('0x17')]===_0x0178('0x19')){_0x608959[_0x0178('0x1a')]=_0x254fb4['id'];}else if(_0x254fb4[_0x0178('0x17')]===_0x0178('0x1b')){_0x608959[_0x0178('0x1c')]=_0x254fb4['id'];}}else if(_0x52c3fc['ticketType']==='Case'){if(_0x254fb4[_0x0178('0x17')]===_0x0178('0x18')){_0x608959[_0x0178('0x1d')]=_0x254fb4['id'];}else if(_0x254fb4[_0x0178('0x17')]==='account'){_0x608959[_0x0178('0x1e')]=_0x254fb4['id'];}else if(_0x254fb4[_0x0178('0x17')]===_0x0178('0x19')&&_0x52c3fc[_0x0178('0x1f')]){_0x608959[_0x52c3fc[_0x0178('0x1f')]]=_0x254fb4['id'];}else{logger[_0x0178('0x20')](_0x0178('0x21'));}}}return _0x3f7ce7[_0x0178('0x22')](_0x52c3fc['ticketType'])['create'](_0x608959);}function getUser(_0x18ec99,_0x3a0314,_0x166d39){if(!_[_0x0178('0x23')](_0x3a0314)&&intUtil[_0x0178('0x24')](_0x3a0314)){var _0x47e2d0={'Email':_0x3a0314};var _0x2656a1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x166d39[_0x0178('0x22')]('User')[_0x0178('0x25')](_0x47e2d0,_0x2656a1)[_0x0178('0x26')]()['then'](function(_0x4a4098){if(_0x4a4098['length']){var _0xc470eb=_[_0x0178('0x25')](_0x4a4098,function(_0x2897ad){return _0x2897ad['Email']===_0x3a0314;});if(_0xc470eb){logger[_0x0178('0x20')](_0x0178('0x27'),_0x3a0314);return BPromise['resolve']({'id':_0xc470eb['Id'],'name':_0xc470eb['Name']});}}else{logger[_0x0178('0x20')](_0x0178('0x28'),_0x3a0314);return _0x166d39['identity']()[_0x0178('0x29')](function(_0x3eedac){return BPromise[_0x0178('0x2a')]({'id':_0x3eedac[_0x0178('0x2b')],'name':_0x3eedac[_0x0178('0x2c')]});});}});}else{logger['info'](_0x0178('0x28'),_0x3a0314);return _0x166d39['identity']()[_0x0178('0x29')](function(_0x152781){return BPromise[_0x0178('0x2a')]({'id':_0x152781[_0x0178('0x2b')],'name':_0x152781['display_name']});});}}function getEndUser(_0x398431,_0xe2d99c,_0x57dd32,_0x7cfe5a,_0x23fa23){var _0x545aca={'$or':{'Phone':_0x7cfe5a}};var _0x54aa05={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0178('0x2a')]()[_0x0178('0x29')](function(){logger[_0x0178('0x20')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x7cfe5a,_0xe2d99c[_0x0178('0x2d')]);switch(_0xe2d99c[_0x0178('0x2d')]){case _0x0178('0x2e'):var _0x1a9a51=_[_0x0178('0x2f')](_0x545aca);if(_0xe2d99c[_0x0178('0x30')]){var _0x3be2c7={};_0x3be2c7[_0xe2d99c[_0x0178('0x30')]]=_0x7cfe5a;_['merge'](_0x1a9a51[_0x0178('0x31')],_0x3be2c7);}return _0x23fa23['sobject'](_0x0178('0x32'))[_0x0178('0x25')](_0x1a9a51,_0x54aa05)[_0x0178('0x26')]()['then'](function(_0x260657){if(_0x260657&&_0x260657[_0x0178('0x33')]){return _0x260657;}else{var _0x49d7c0=_['cloneDeep'](_0x545aca);if(_0xe2d99c[_0x0178('0x34')]){var _0x36f296={};_0x36f296[_0xe2d99c[_0x0178('0x34')]]=_0x7cfe5a;_[_0x0178('0x35')](_0x49d7c0[_0x0178('0x31')],_0x36f296);}return _0x23fa23['sobject'](_0x0178('0x36'))['find'](_0x49d7c0,_0x54aa05);}});case _0x0178('0x37'):var _0x48df8b=_[_0x0178('0x2f')](_0x545aca);if(_0xe2d99c[_0x0178('0x38')]){var _0x3be2c7={};_0x3be2c7[_0xe2d99c[_0x0178('0x38')]]=_0x7cfe5a;_[_0x0178('0x35')](_0x48df8b[_0x0178('0x31')],_0x3be2c7);}return _0x23fa23[_0x0178('0x22')](_0x0178('0x39'))[_0x0178('0x25')](_0x48df8b,_0x54aa05)[_0x0178('0x26')]()['then'](function(_0x272e76){if(_0x272e76&&_0x272e76['length']){return _0x272e76;}else{var _0x1fc774=_[_0x0178('0x2f')](_0x545aca);if(_0xe2d99c[_0x0178('0x30')]){var _0x1454ca={};_0x1454ca[_0xe2d99c[_0x0178('0x30')]]=_0x7cfe5a;_[_0x0178('0x35')](_0x1fc774[_0x0178('0x31')],_0x1454ca);}return _0x23fa23[_0x0178('0x22')](_0x0178('0x32'))[_0x0178('0x25')](_0x1fc774,_0x54aa05)[_0x0178('0x29')](function(_0x3fbd10){if(_0x3fbd10&&_0x3fbd10[_0x0178('0x33')]){return _0x3fbd10;}else{var _0x558819=_[_0x0178('0x2f')](_0x545aca);if(_0xe2d99c[_0x0178('0x34')]){var _0xdbdfd7={};_0xdbdfd7[_0xe2d99c[_0x0178('0x34')]]=_0x7cfe5a;_[_0x0178('0x35')](_0x558819[_0x0178('0x31')],_0xdbdfd7);}return _0x23fa23[_0x0178('0x22')]('Lead')[_0x0178('0x25')](_0x558819,_0x54aa05);}});}});case _0x0178('0x18'):var _0x1a9a51=_[_0x0178('0x2f')](_0x545aca);if(_0xe2d99c[_0x0178('0x30')]){var _0x3be2c7={};_0x3be2c7[_0xe2d99c[_0x0178('0x30')]]=_0x7cfe5a;_['merge'](_0x1a9a51[_0x0178('0x31')],_0x3be2c7);}return _0x23fa23[_0x0178('0x22')](_0x0178('0x32'))[_0x0178('0x25')](_0x1a9a51,_0x54aa05)[_0x0178('0x26')]();case _0x0178('0x19'):var _0x23ee1b=_[_0x0178('0x2f')](_0x545aca);if(_0xe2d99c['additionalSearchLead']){var _0x3be2c7={};_0x3be2c7[_0xe2d99c[_0x0178('0x34')]]=_0x7cfe5a;_[_0x0178('0x35')](_0x23ee1b[_0x0178('0x31')],_0x3be2c7);}return _0x23fa23[_0x0178('0x22')](_0x0178('0x36'))[_0x0178('0x25')](_0x23ee1b,_0x54aa05);case _0x0178('0x1b'):var _0x48df8b=_[_0x0178('0x2f')](_0x545aca);if(_0xe2d99c[_0x0178('0x38')]){var _0x3be2c7={};_0x3be2c7[_0xe2d99c[_0x0178('0x38')]]=_0x7cfe5a;_[_0x0178('0x35')](_0x48df8b['$or'],_0x3be2c7);}return _0x23fa23[_0x0178('0x22')](_0x0178('0x39'))[_0x0178('0x25')](_0x48df8b,_0x54aa05);default:return null;}})[_0x0178('0x29')](function(_0x43724f){if(_0x43724f&&_0x43724f[_0x0178('0x33')]){var _0x590e3e=_[_0x0178('0x3a')](_0x43724f);if(_0x590e3e){return BPromise['resolve']({'id':_0x590e3e['Id'],'name':_0x590e3e[_0x0178('0x3b')],'phone':_0x590e3e[_0x0178('0x3c')],'endUserType':_0x590e3e[_0x0178('0x3d')][_0x0178('0x3e')][_0x0178('0x3f')]()});}}})[_0x0178('0x29')](function(_0x1cf96a){if(_0x1cf96a){logger[_0x0178('0x20')](_0x0178('0x40'),_0x1cf96a[_0x0178('0x17')],_0x7cfe5a);return BPromise['resolve'](_0x1cf96a);}else{logger[_0x0178('0x20')](_0x0178('0x41'),_0x7cfe5a);var _0x3dd036={'Phone':_0x7cfe5a};if(_0xe2d99c[_0x0178('0x42')]){if(_0xe2d99c[_0x0178('0x42')]==='contact'){logger[_0x0178('0x20')](_0x0178('0x43'),_0x7cfe5a,_0xe2d99c[_0x0178('0x42')]);_0x3dd036['LastName']=_0x57dd32!==''?_0x57dd32:util[_0x0178('0x44')](_0x0178('0x45'),_0x7cfe5a);}else if(_0xe2d99c[_0x0178('0x42')]===_0x0178('0x19')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x7cfe5a,_0xe2d99c[_0x0178('0x42')]);_0x3dd036['LastName']=_0x57dd32!==''?_0x57dd32:util[_0x0178('0x44')]('Caller\x20-\x20%s',_0x7cfe5a);_0x3dd036['Company']='No\x20Company';}else if(_0xe2d99c[_0x0178('0x42')]===_0x0178('0x1b')){logger[_0x0178('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x7cfe5a,_0xe2d99c['moduleCreate']);_0x3dd036[_0x0178('0x3b')]=_0x57dd32!==''?_0x57dd32:util[_0x0178('0x44')](_0x0178('0x45'),_0x7cfe5a);}else{return null;}}return _0x23fa23[_0x0178('0x22')](_[_0x0178('0x46')](_0xe2d99c[_0x0178('0x42')]))['create'](_0x3dd036)[_0x0178('0x29')](function(_0x4a3dcc){return BPromise[_0x0178('0x2a')]({'id':_0x4a3dcc['id'],'endUserType':_0xe2d99c['moduleCreate']});});}});}function getCustomFields(_0x39f1be,_0xe6f9f2){var _0x3fa0f3={};if(_0x39f1be[_0x0178('0x33')]>0x0){_[_0x0178('0x47')](_0x39f1be,function(_0x29bdfc){if(_[_0x0178('0x48')]([_0x0178('0x49'),_0x0178('0x4a')],_0x29bdfc['type'])&&_0x29bdfc['idField']){_0x3fa0f3[_0x29bdfc[_0x0178('0x4b')]]=_0x29bdfc[_0x0178('0x4c')][_0x0178('0x4d')]();}else if(_0x29bdfc[_0x0178('0x3e')]===_0x0178('0x4e')&&_0x29bdfc['variableName']&&_0x29bdfc[_0x0178('0x4b')]){_0xe6f9f2[_0x29bdfc[_0x0178('0x4f')]]&&(_0x3fa0f3[_0x29bdfc[_0x0178('0x4b')]]=_0xe6f9f2[_0x29bdfc[_0x0178('0x4f')]]['toString']());}else if(_0x29bdfc[_0x0178('0x3e')]===_0x0178('0x50')&&_0x29bdfc[_0x0178('0x51')]&&_0x29bdfc[_0x0178('0x51')][_0x0178('0x52')]&&_0x29bdfc[_0x0178('0x4b')]){_0xe6f9f2[_0x29bdfc[_0x0178('0x51')][_0x0178('0x52')][_0x0178('0x3f')]()]&&(_0x3fa0f3[_0x29bdfc[_0x0178('0x4b')]]=_0xe6f9f2[_0x29bdfc[_0x0178('0x51')]['name'][_0x0178('0x3f')]()]['toString']());}});}return _0x3fa0f3;}function getConnection(_0xd8769){var _0x4e56ab=_0xd8769[_0x0178('0x53')]['concat'](_0xd8769[_0x0178('0x54')]);var _0x5e2af6=new jsforce[(_0x0178('0x55'))]({'oauth2':{'loginUrl':_0xd8769['remoteUri']||_0x0178('0x56'),'clientId':_0xd8769[_0x0178('0x57')],'clientSecret':_0xd8769[_0x0178('0x58')]}});return _0x5e2af6[_0x0178('0x59')](_0xd8769[_0x0178('0x5a')],_0x4e56ab)[_0x0178('0x29')](function(){logger[_0x0178('0x20')](_0x0178('0x5b'));return _0x5e2af6;});}exports['queue']=function(_0x1d949b,_0x3e0df5,_0x3e790a,_0x58f7d5,_0xb3aa05,_0x34e6a4){var _0x374afc,_0x457132,_0x4bd6d8,_0x32abc5;_0x34e6a4[_0x0178('0x5c')]=intUtil[_0x0178('0x5d')](_0x34e6a4[_0x0178('0x5c')]);_0x34e6a4['remoteUri']=intUtil[_0x0178('0x5d')](_0x34e6a4['remoteUri']);if(_0xb3aa05&&_0xb3aa05[_0x0178('0x5e')]){logger[_0x0178('0x20')](_0x0178('0x5f'),_0x0178('0x60'));_0x3e0df5[_0x0178('0x61')]=util[_0x0178('0x44')](_0x0178('0x62'),_0x34e6a4[_0x0178('0x5c')],_0x3e0df5[_0x0178('0x63')],md5(_0x3e0df5[_0x0178('0x63')]));}else{_0x3e0df5['recordingURL']='';}return getConnection(_0x34e6a4)['then'](function(_0x3954e8){_0x32abc5=_0x3954e8;return getUser(_0x34e6a4,_0x58f7d5[_0x0178('0x64')],_0x32abc5);})[_0x0178('0x29')](function(_0x3db6e4){_0x374afc=_0x3db6e4;return getEndUser(_0x34e6a4,_0x3e790a,_0x3e0df5[_0x0178('0x65')],_0x3e0df5[_0x0178('0x66')],_0x32abc5);})[_0x0178('0x29')](function(_0xa91dd2){_0x457132=_0xa91dd2;return getTicket(_0x34e6a4,_0x374afc,_0x457132,_0x3e790a,_0x3e0df5,_0x3e790a[_0x0178('0x67')],_0x32abc5,'queue');})[_0x0178('0x29')](function(_0x396aca){_0x4bd6d8=_0x396aca;logger[_0x0178('0x20')](_0x0178('0x68'),_0x4bd6d8['id']);logger['info'](_0x0178('0x69'),_0x4bd6d8['id'],_0x58f7d5[_0x0178('0x52')],_0x34e6a4[_0x0178('0x3e')]);switch(_0x34e6a4[_0x0178('0x3e')]){case _0x0178('0x6a'):emit(util['format'](_0x0178('0x6b'),_0x58f7d5[_0x0178('0x52')]),_0x0178('0x6c'),{'recordId':_0x4bd6d8['id']});break;case _0x0178('0x6d'):emit(util[_0x0178('0x44')]('user:%s',_0x58f7d5[_0x0178('0x52')]),_0x0178('0x6e'),{'uri':util[_0x0178('0x44')](_0x0178('0x6f'),_0x32abc5['instanceUrl'],_0x4bd6d8['id'])});break;default:logger[_0x0178('0x70')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0178('0x71')](function(_0x52834a){logger[_0x0178('0x70')](_0x0178('0x5f'),_0x52834a);});};exports['outbound']=function(_0x5a259e,_0x30e6f4,_0x58bbfc,_0x2ffb1,_0xc3e9a5,_0x78ed57,_0x5dbd53){var _0x48b64b,_0x3b8db4,_0x332fc0,_0x47e98b;_0x78ed57['serverUrl']=intUtil['stripTrailingSlash'](_0x78ed57[_0x0178('0x5c')]);_0x78ed57['remoteUri']=intUtil[_0x0178('0x5d')](_0x78ed57[_0x0178('0x72')]);if(_0x5dbd53&&_0x5dbd53['recordingFormat']&&_0x5dbd53['recordingFormat']!=='none'){logger['info'](_0x0178('0x73'),_0x0178('0x60'));_0x30e6f4[_0x0178('0x61')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x78ed57['serverUrl'],_0x30e6f4[_0x0178('0x63')],md5(_0x30e6f4[_0x0178('0x63')]));}return getConnection(_0x78ed57)['then'](function(_0x270451){_0x47e98b=_0x270451;return getUser(_0x78ed57,_0x2ffb1[_0x0178('0x64')],_0x47e98b);})[_0x0178('0x29')](function(_0x9afc7f){_0x48b64b=_0x9afc7f;return getEndUser(_0x78ed57,_0x58bbfc,_0x30e6f4['destcalleridname'],_0x30e6f4['destcalleridnum'],_0x47e98b);})['then'](function(_0x259ee1){_0x3b8db4=_0x259ee1;return getTicket(_0x78ed57,_0x48b64b,_0x3b8db4,_0x58bbfc,_0x30e6f4,_0x58bbfc[_0x0178('0x67')],_0x47e98b,_0x0178('0x74'));})[_0x0178('0x29')](function(_0x17617f){_0x332fc0=_0x17617f;logger[_0x0178('0x20')](_0x0178('0x75'),_0x332fc0['id']);logger[_0x0178('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x332fc0['id'],_0x2ffb1[_0x0178('0x52')],_0x78ed57[_0x0178('0x3e')]);switch(_0x78ed57['type']){case _0x0178('0x6a'):emit(util['format'](_0x0178('0x6b'),_0x2ffb1[_0x0178('0x52')]),'trigger:salesforce:display',{'recordId':_0x332fc0['id']});break;case'newTab':emit(util[_0x0178('0x44')](_0x0178('0x6b'),_0x2ffb1['name']),_0x0178('0x6e'),{'uri':util[_0x0178('0x44')](_0x0178('0x6f'),_0x47e98b[_0x0178('0x76')],_0x332fc0['id'])});break;default:logger[_0x0178('0x70')]('[OUTBOUND]',_0x0178('0x77'));}})[_0x0178('0x71')](function(_0x2ffbe3){logger[_0x0178('0x70')](_0x0178('0x73'),_0x2ffbe3);});};exports[_0x0178('0x78')]=function(_0x17bc86,_0xec162e,_0x388ca5,_0x34fead,_0x15d3ed,_0x194a24){var _0x3b4a57,_0x337d3c,_0xb15c25,_0x3de8bf;_0x194a24[_0x0178('0x5c')]=intUtil[_0x0178('0x5d')](_0x194a24[_0x0178('0x5c')]);_0x194a24['remoteUri']=intUtil[_0x0178('0x5d')](_0x194a24[_0x0178('0x72')]);if(_0x15d3ed&&_0x15d3ed['monitor_format']){logger[_0x0178('0x20')]('['+_0xec162e['lastevent'][_0x0178('0x79')]()+']',_0x0178('0x60'));_0xec162e[_0x0178('0x61')]=util[_0x0178('0x44')](_0x0178('0x62'),_0x194a24[_0x0178('0x5c')],_0xec162e[_0x0178('0x63')],md5(_0xec162e[_0x0178('0x63')]));}else{_0xec162e[_0x0178('0x61')]='';}return getConnection(_0x194a24)['then'](function(_0x55e439){_0x3de8bf=_0x55e439;if(!_['isNil'](_0x34fead)){return getUser(_0x194a24,_0x34fead[_0x0178('0x52')],_0x3de8bf);}else{return getUser(_0x194a24,null,_0x3de8bf);}})[_0x0178('0x29')](function(_0x37f296){_0x3b4a57=_0x37f296;return getEndUser(_0x194a24,_0x388ca5,_0xec162e[_0x0178('0x65')],_0xec162e[_0x0178('0x66')],_0x3de8bf);})[_0x0178('0x29')](function(_0x5186ce){_0x337d3c=_0x5186ce;return getTicket(_0x194a24,_0x3b4a57,_0x337d3c,_0x388ca5,_0xec162e,_0x388ca5['Fields'],_0x3de8bf);})[_0x0178('0x29')](function(_0x3e7b33){_0xb15c25=_0x3e7b33;logger['info']('['+_0xec162e[_0x0178('0x7a')][_0x0178('0x79')]()+_0x0178('0x7b'),_0xb15c25['id']);logger['info']('['+_0xec162e['lastevent'][_0x0178('0x79')]()+_0x0178('0x7c'),_0x194a24['type']);})[_0x0178('0x71')](function(_0x4bffe6){logger['error']('['+_0xec162e[_0x0178('0x7a')][_0x0178('0x79')]()+']',_0x4bffe6);});}; \ 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 012a1ee..c358a6a 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 _0xb169=['Incident\x20-\x20','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','emit','username','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','true','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','toString','idField','customField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xb169,0x1e5));var _0x9b16=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0xb169[_0xcf5436];return _0xc4f5c8;};'use strict';var _=require('lodash');var Promise=require(_0x9b16('0x0'));var rp=require(_0x9b16('0x1'));var util=require('util');var md5=require(_0x9b16('0x2'));var Redis=require(_0x9b16('0x3'));var intUtil=require(_0x9b16('0x4'));var config=require(_0x9b16('0x5'));var logger=require(_0x9b16('0x6'))(_0x9b16('0x7'));config[_0x9b16('0x8')]=_[_0x9b16('0x9')](config[_0x9b16('0x8')],{'host':_0x9b16('0xa'),'port':0x18eb});var io=require(_0x9b16('0xb'))(new Redis(config[_0x9b16('0x8')]));function getAdminUser(_0x430702,_0x265682,_0x2a04c0,_0x41868e,_0x1d0cf5,_0x254f05){return new Promise(function(_0x331f0d,_0x335f52){var _0x3f1a76={'method':_0x9b16('0xc'),'uri':_0x41868e+_0x9b16('0xd')+'&'+_0x1d0cf5+'&'+_0x254f05,'auth':_0x265682,'json':!![]};return rp(_0x3f1a76)[_0x9b16('0xe')](function(_0xad59e9){if(_0xad59e9['result'][_0x9b16('0xf')]>0x0){_0x2a04c0[_0x9b16('0x10')]=_0xad59e9[_0x9b16('0x11')][0x0][_0x9b16('0x12')];}logger[_0x9b16('0x13')]('['+[_0x430702[_0x9b16('0x14')]()]+_0x9b16('0x15'),_0x2a04c0);_0x331f0d(_0x2a04c0);})[_0x9b16('0x16')](function(_0x4ee579){logger[_0x9b16('0x17')]('['+[_0x430702[_0x9b16('0x14')]()]+']',_0x4ee579['message']);_0x335f52(_0x4ee579[_0x9b16('0x18')]);});});}function getUser(_0x644c25,_0x192451,_0x58df76,_0x44267a,_0x3149b1){return function(_0x9453fb){logger['info']('['+[_0x644c25[_0x9b16('0x14')]()]+'],\x20getUser\x20input\x20crm',_0x9453fb);return new Promise(function(_0x2064a5,_0x1d0c0c){if(intUtil[_0x9b16('0x19')](_0x9453fb[_0x9b16('0x1a')])){var _0x46b2b6={'method':_0x9b16('0xc'),'uri':_0x58df76+_0x9b16('0x1b')+_0x9453fb[_0x9b16('0x1a')]+'&'+_0x44267a+'&'+_0x3149b1,'auth':_0x192451,'json':!![]};logger['info']('['+[_0x644c25['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x46b2b6);return rp(_0x46b2b6)[_0x9b16('0xe')](function(_0x5072cc){logger['info']('['+[_0x644c25[_0x9b16('0x14')]()]+_0x9b16('0x1c'),_0x5072cc);if(_0x5072cc['result'][_0x9b16('0xf')]>0x0&&String(_0x5072cc[_0x9b16('0x11')][0x0][_0x9b16('0x1d')])==='true'){_0x9453fb[_0x9b16('0x1e')]=_0x5072cc[_0x9b16('0x11')][0x0][_0x9b16('0x12')];}else{_0x9453fb[_0x9b16('0x1e')]=_0x9453fb['adminId'];_0x9453fb[_0x9b16('0x1a')]=_0x9453fb[_0x9b16('0x1f')];}logger[_0x9b16('0x13')]('['+[_0x644c25[_0x9b16('0x14')]()]+_0x9b16('0x20'),_0x9453fb);_0x2064a5(_0x9453fb);})['catch'](function(_0x2d5424){logger[_0x9b16('0x17')]('['+[_0x644c25[_0x9b16('0x14')]()]+']',_0x2d5424[_0x9b16('0x18')]);_0x1d0c0c(_0x2d5424['message']);});}else{logger['info']('['+[_0x644c25[_0x9b16('0x14')]()]+_0x9b16('0x21'));_0x9453fb['userId']=_0x9453fb['adminId'];_0x9453fb['userEmail']=_0x9453fb[_0x9b16('0x1f')];_0x2064a5(_0x9453fb);}});};}function createEndUser(_0x59f577,_0x4aadf8,_0x455dd4,_0xc2a86e,_0x1a286f){logger[_0x9b16('0x13')]('['+[_0x59f577[_0x9b16('0x14')]()]+_0x9b16('0x22'),_0x455dd4);return new Promise(function(_0x2844b3,_0x1ff5ea){var _0xc698f={'method':_0x9b16('0x23'),'uri':_0xc2a86e+'sys_user?'+_0x1a286f,'body':{'user_name':_0x455dd4['endUserNumber'],'roles':_0x9b16('0x24'),'first_name':_0x455dd4[_0x9b16('0x25')],'active':_0x9b16('0x26'),'date_format':_0x9b16('0x27'),'phone':_0x455dd4['endUserNumber']},'auth':_0x4aadf8,'json':!![]};return rp(_0xc698f)[_0x9b16('0xe')](function(_0xf37f){logger[_0x9b16('0x13')]('['+[_0x59f577['toUpperCase']()]+_0x9b16('0x28'),_0xf37f['result']);_0x455dd4['endUserId']=_0xf37f[_0x9b16('0x11')][_0x9b16('0x12')];_0x2844b3(_0x455dd4);})[_0x9b16('0x16')](function(_0x4e1af1){logger[_0x9b16('0x17')]('['+[_0x59f577[_0x9b16('0x14')]()]+']',_0x4e1af1[_0x9b16('0x18')]);_0x1ff5ea(_0x4e1af1[_0x9b16('0x18')]);});});}function getEndUser(_0x4105b2,_0x1766c5,_0x15fcfa,_0x4d31ef,_0x1969ef){return function(_0x33c5c3){logger[_0x9b16('0x13')]('['+[_0x4105b2[_0x9b16('0x14')]()]+_0x9b16('0x29'),_0x33c5c3);return new Promise(function(_0x3350b9,_0x4316aa){var _0x2078a1={'method':'GET','uri':_0x15fcfa+'sys_user?sysparm_query=phone%3D'+_0x33c5c3[_0x9b16('0x25')]+'&'+_0x4d31ef+'&'+_0x1969ef,'auth':_0x1766c5,'json':!![]};return rp(_0x2078a1)[_0x9b16('0xe')](function(_0x1106b5){if(_0x1106b5[_0x9b16('0x11')]['length']>0x0){_0x33c5c3[_0x9b16('0x2a')]=_0x1106b5[_0x9b16('0x11')][0x0][_0x9b16('0x12')];logger[_0x9b16('0x13')]('['+[_0x4105b2[_0x9b16('0x14')]()]+_0x9b16('0x2b'),_0x33c5c3);_0x3350b9(_0x33c5c3);}else{return createEndUser(_0x4105b2,_0x1766c5,_0x33c5c3,_0x15fcfa,_0x4d31ef)['then'](function(_0x39fc2a){logger[_0x9b16('0x13')]('['+[_0x4105b2[_0x9b16('0x14')]()]+_0x9b16('0x2c'),_0x39fc2a);_0x3350b9(_0x39fc2a);});}})['catch'](function(_0x5efa6b){logger[_0x9b16('0x17')]('['+[_0x4105b2[_0x9b16('0x14')]()]+']',_0x5efa6b['message']);_0x4316aa(_0x5efa6b[_0x9b16('0x18')]);});});};}function getCustomFields(_0x272598,_0x2b9f4b){var _0x54dd2e={};if(_0x272598['length']>0x0){_[_0x9b16('0x2d')](_0x272598,function(_0x3989e9){if(_[_0x9b16('0x2e')]([_0x9b16('0x2f'),_0x9b16('0x30')],_0x3989e9[_0x9b16('0x31')])&&_0x3989e9['nameField']&&!_0x3989e9['customField']){_0x54dd2e[_0x3989e9[_0x9b16('0x32')][_0x9b16('0x33')]()]=_0x3989e9['content'][_0x9b16('0x34')]();}else if(_['includes']([_0x9b16('0x2f'),'picklist'],_0x3989e9['type'])&&_0x3989e9[_0x9b16('0x35')]&&_0x3989e9[_0x9b16('0x36')]){_0x54dd2e[_0x3989e9[_0x9b16('0x35')]['toLowerCase']()]=_0x3989e9[_0x9b16('0x37')][_0x9b16('0x34')]();}else if(_0x3989e9[_0x9b16('0x31')]===_0x9b16('0x38')&&_0x3989e9[_0x9b16('0x39')]&&_0x3989e9[_0x9b16('0x35')]&&_0x3989e9[_0x9b16('0x36')]){_0x54dd2e[_0x3989e9[_0x9b16('0x35')]['toLowerCase']()]=_0x2b9f4b[_0x3989e9['variableName']][_0x9b16('0x34')]();}else if(_0x3989e9['type']===_0x9b16('0x3a')&&_0x3989e9[_0x9b16('0x3b')]&&_0x3989e9[_0x9b16('0x3b')][_0x9b16('0x3c')]&&_0x3989e9[_0x9b16('0x35')]&&_0x3989e9[_0x9b16('0x36')]){_0x54dd2e[_0x3989e9[_0x9b16('0x35')][_0x9b16('0x33')]()]=_0x2b9f4b[_0x3989e9['Variable'][_0x9b16('0x3c')][_0x9b16('0x33')]()][_0x9b16('0x34')]();}});}return _0x54dd2e;}function getTicket(_0x5c2a49,_0x31cdd1,_0x32607b,_0x473f32,_0x562029,_0x5b8bfb){return function(_0x41068e){logger['info']('['+[_0x5c2a49['toUpperCase']()]+_0x9b16('0x3d'),_0x41068e);return new Promise(function(_0x33f1d4,_0x3ec3b7){var _0x42e618=_0x5c2a49[_0x9b16('0x33')]()==='outbound'?_0x41068e[_0x9b16('0x1e')]:_0x41068e['endUserId'];var _0x4b2053={'method':_0x9b16('0x23'),'uri':_0x32607b+_0x9b16('0x3e')+'?'+_0x5b8bfb,'body':Object['assign']({},{'active':_0x9b16('0x26'),'caller_id':_0x42e618,'assigned_to':_0x41068e[_0x9b16('0x1e')],'short_description':intUtil[_0x9b16('0x3f')](_0x473f32[_0x9b16('0x40')],_0x562029,'\x20'),'description':intUtil[_0x9b16('0x3f')](_0x473f32[_0x9b16('0x41')],_0x562029,'\x0a')},getCustomFields(_0x473f32[_0x9b16('0x42')],_0x562029)),'auth':_0x31cdd1,'json':!![]};return rp(_0x4b2053)[_0x9b16('0xe')](function(_0x3c458e){logger[_0x9b16('0x13')]('['+[_0x5c2a49['toUpperCase']()]+_0x9b16('0x43'),_0x3c458e[_0x9b16('0x11')]);_0x41068e[_0x9b16('0x44')]=_0x3c458e[_0x9b16('0x11')][_0x9b16('0x12')];_0x41068e['ticketNumber']=_0x3c458e[_0x9b16('0x11')][_0x9b16('0x45')];logger[_0x9b16('0x13')]('['+[_0x5c2a49[_0x9b16('0x14')]()]+_0x9b16('0x46'),_0x41068e);_0x33f1d4(_0x41068e);})[_0x9b16('0x16')](function(_0x14484){logger[_0x9b16('0x17')]('['+[_0x5c2a49[_0x9b16('0x14')]()]+']',_0x14484[_0x9b16('0x18')]);_0x3ec3b7(_0x14484[_0x9b16('0x18')]);});});};}function createRemoteTag(_0x35a3a7,_0x2e65d6,_0x3fa39b,_0x184cdd){return new Promise(function(_0x4c5967,_0x1efb77){var _0x15c571={'method':_0x9b16('0x23'),'uri':_0x3fa39b+_0x9b16('0x47')+'?'+_0x184cdd,'body':{'short_description':_0x35a3a7,'global':!![],'active':!![],'name':_0x35a3a7},'auth':_0x2e65d6,'json':!![]};return rp(_0x15c571)[_0x9b16('0xe')](function(_0x2f6f52){var _0x327b41=_0x2f6f52[_0x9b16('0x11')][_0x9b16('0x12')];_0x4c5967(_0x327b41);});});}function getRemoteTag(_0xdab028,_0x19af4e,_0xca5786,_0x530380,_0x4ef2d7){return new Promise(function(_0x4f9474,_0x1101bb){var _0x53d3a5={'method':_0x9b16('0xc'),'uri':_0xca5786+_0x9b16('0x47')+_0x9b16('0x48')+_0xdab028+'&'+_0x530380,'auth':_0x19af4e,'json':!![]};return rp(_0x53d3a5)[_0x9b16('0xe')](function(_0x269df4){if(_0x269df4[_0x9b16('0x11')][_0x9b16('0xf')]>0x0){var _0xaf15dd=_0x269df4[_0x9b16('0x11')][0x0][_0x9b16('0x12')];_0x4f9474(_0xaf15dd);}else{return createRemoteTag(_0xdab028,_0x19af4e,_0xca5786,_0x530380)[_0x9b16('0xe')](function(_0x53dc57){_0x4f9474(_0x53dc57);});}});});}function assignTagToIncident(_0x39562f,_0x151728,_0x33cf25,_0x1fff2c,_0x4345e0){return new Promise(function(_0x17626d,_0x3d9bdd){var _0x11d22c={'method':'POST','uri':_0x33cf25+_0x9b16('0x49')+'?'+_0x4345e0,'body':{'label':_0x39562f,'table':_0x9b16('0x3e'),'id_type':_0x9b16('0x4a'),'table_key':_0x1fff2c[_0x9b16('0x44')],'title':_0x9b16('0x4b')+_0x1fff2c[_0x9b16('0x4c')],'id_display':_0x1fff2c['ticketNumber']},'auth':_0x151728,'json':!![]};return rp(_0x11d22c)[_0x9b16('0xe')](function(_0xb9344e){_0x17626d();})[_0x9b16('0x16')](function(){_0x17626d();});});}function manageTags(_0x310fd3,_0x13b3e0,_0xe21297,_0x4b7148,_0x46cbd9,_0x148460,_0x2fd31d){return new Promise(function(_0x5e7839,_0x327819){var _0x2918cd=[];_0x13b3e0[_0x9b16('0x2d')](function(_0x32cf35){_0x2918cd['push'](getRemoteTag(_0x32cf35,_0xe21297,_0x4b7148,_0x148460,_0x2fd31d));});return Promise[_0x9b16('0x4d')](_0x2918cd)[_0x9b16('0xe')](function(_0x3379e4){if(_0x3379e4[_0x9b16('0xf')]){logger[_0x9b16('0x13')]('['+[_0x310fd3['toUpperCase']()]+_0x9b16('0x4e'),_0x3379e4);var _0x185aa3=[];_0x3379e4[_0x9b16('0x2d')](function(_0x1c756a){_0x185aa3[_0x9b16('0x4f')](assignTagToIncident(_0x1c756a,_0xe21297,_0x4b7148,_0x46cbd9,_0x148460));});return Promise[_0x9b16('0x4d')](_0x185aa3)['then'](function(){_0x5e7839();})[_0x9b16('0x16')](function(){_0x5e7839();});}else{_0x5e7839();}});});}function getTags(_0x69aa2f,_0x44925f,_0x39c443,_0x1b1eee,_0x40fbd3,_0x5cd219){return function(_0x323c27){return new Promise(function(_0x43243f,_0x510204){var _0x42d1cb=[];var _0x41796d=_0x1b1eee[_0x9b16('0x50')];if(_0x41796d&&_0x41796d['length']>0x0){_0x42d1cb=_['map'](_0x41796d,_0x9b16('0x3c'));}if(_0x42d1cb[_0x9b16('0xf')]>0x0){return manageTags(_0x69aa2f,_0x42d1cb,_0x44925f,_0x39c443,_0x323c27,_0x40fbd3,_0x5cd219)[_0x9b16('0xe')](function(){_0x43243f(_0x323c27);});}else{_0x43243f(_0x323c27);}});};}function emit(_0x30574a,_0x5e218d,_0x50de4e){var _0x1656c0='%26sysparm_record_target%3Dincident'+_0x9b16('0x51')+_0x9b16('0x52')+_0x9b16('0x53');var _0x473235={'uri':_0x30574a+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x50de4e+_0x1656c0};io['to'](util[_0x9b16('0x54')]('user:%s',_0x5e218d))[_0x9b16('0x55')]('trigger:browser:url',_0x473235);}exports['cs']=function(_0x14863e,_0xd43921,_0x1bf630,_0x599705,_0xc6ba67,_0x2c5f6f,_0x2f871f,_0x25b692){var _0x95b8e0={};var _0x434cdb={'user':_0x2c5f6f[_0x9b16('0x56')],'pass':_0x2c5f6f['password']};var _0x191d43=_0x9b16('0x57');var _0x5ba5ec=_0x9b16('0x58');_0x2c5f6f['remoteUri']=intUtil[_0x9b16('0x59')](_0x2c5f6f[_0x9b16('0x5a')]);_0x2c5f6f[_0x9b16('0x5b')]=intUtil[_0x9b16('0x59')](_0x2c5f6f[_0x9b16('0x5b')]);var _0x504c97=util[_0x9b16('0x54')](_0x9b16('0x5c'),_0x2c5f6f['remoteUri']);_0x95b8e0[_0x9b16('0x1a')]=!_['isNil'](_0x599705)?_0x599705[_0x9b16('0x5d')]:null;_0x95b8e0[_0x9b16('0x1f')]=_0x2c5f6f['email'];_0x95b8e0[_0x9b16('0x25')]=_0x25b692[_0x9b16('0x33')]()===_0x9b16('0x5e')?_0xd43921[_0x9b16('0x5f')]:_0xd43921[_0x9b16('0x60')];_0x95b8e0[_0x9b16('0x61')]=_0x25b692===_0x9b16('0x62')||_0x25b692==='unmanaged'?_0x9b16('0x62'):_0x9b16('0x5e');var _0x488082=util[_0x9b16('0x54')](_0x9b16('0x63'),_0x2c5f6f[_0x9b16('0x5b')],_0xd43921['uniqueid'],md5(_0xd43921['uniqueid']));if(_0xc6ba67&&_0xc6ba67[_0x9b16('0x64')]){logger[_0x9b16('0x13')](_0x9b16('0x65'),_0x9b16('0x66'));_0xd43921[_0x9b16('0x67')]=_0x488082;}else if(_0x2f871f&&_0x2f871f[_0x9b16('0x68')]&&_0x2f871f[_0x9b16('0x68')]!==_0x9b16('0x69')){logger[_0x9b16('0x13')]('[OUTBOUND]',_0x9b16('0x66'));_0xd43921[_0x9b16('0x67')]=_0x488082;}else{_0xd43921[_0x9b16('0x67')]='';}return getAdminUser(_0x25b692,_0x434cdb,_0x95b8e0,_0x504c97,_0x5ba5ec,_0x191d43)['then'](getUser(_0x25b692,_0x434cdb,_0x504c97,_0x5ba5ec,_0x191d43))[_0x9b16('0xe')](getEndUser(_0x25b692,_0x434cdb,_0x504c97,_0x5ba5ec,_0x191d43))[_0x9b16('0xe')](getTicket(_0x25b692,_0x434cdb,_0x504c97,_0x1bf630,_0xd43921,_0x5ba5ec))[_0x9b16('0xe')](function(_0xc33f0e){logger['info'](util[_0x9b16('0x54')](_0x9b16('0x6a'),_0xc33f0e[_0x9b16('0x44')]));logger[_0x9b16('0x13')](util['format'](_0x9b16('0x6b'),_0x25b692));if(_0x25b692!==_0x9b16('0x6c')){logger[_0x9b16('0x13')]('['+[_0x25b692[_0x9b16('0x14')]()]+']',_0x9b16('0x6d'));emit(_0x2c5f6f[_0x9b16('0x5a')],_0x599705[_0x9b16('0x3c')],_0xc33f0e[_0x9b16('0x44')]);}})[_0x9b16('0x16')](function(_0x229861){logger[_0x9b16('0x17')]('['+[_0x25b692[_0x9b16('0x14')]()]+_0x9b16('0x6e'),util[_0x9b16('0x6f')](_0x229861,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x266d=['info','],\x20getAdminUser\x20crm','catch','error','message','toUpperCase','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','toLowerCase','content','idField','customField','type','variable','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x266d,0x144));var _0xd266=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x266d[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var Promise=require(_0xd266('0x0'));var rp=require(_0xd266('0x1'));var util=require(_0xd266('0x2'));var md5=require(_0xd266('0x3'));var Redis=require(_0xd266('0x4'));var intUtil=require(_0xd266('0x5'));var config=require('../../../../config/environment');var logger=require(_0xd266('0x6'))(_0xd266('0x7'));config[_0xd266('0x8')]=_[_0xd266('0x9')](config[_0xd266('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd266('0xa'))(new Redis(config[_0xd266('0x8')]));function getAdminUser(_0xa1ada4,_0x538622,_0x428474,_0x2b7a84,_0x43a15b,_0x578198){return new Promise(function(_0x117b60,_0x12e7bc){var _0x329a94={'method':_0xd266('0xb'),'uri':_0x2b7a84+_0xd266('0xc')+'&'+_0x43a15b+'&'+_0x578198,'auth':_0x538622,'json':!![]};return rp(_0x329a94)[_0xd266('0xd')](function(_0x2ddb64){if(_0x2ddb64[_0xd266('0xe')][_0xd266('0xf')]>0x0){_0x428474[_0xd266('0x10')]=_0x2ddb64[_0xd266('0xe')][0x0][_0xd266('0x11')];}logger[_0xd266('0x12')]('['+[_0xa1ada4['toUpperCase']()]+_0xd266('0x13'),_0x428474);_0x117b60(_0x428474);})[_0xd266('0x14')](function(_0x144c9f){logger[_0xd266('0x15')]('['+[_0xa1ada4['toUpperCase']()]+']',_0x144c9f['message']);_0x12e7bc(_0x144c9f[_0xd266('0x16')]);});});}function getUser(_0x260b54,_0x58d2b3,_0x5f4519,_0x25cd35,_0xb8834){return function(_0x5af8f5){logger['info']('['+[_0x260b54[_0xd266('0x17')]()]+_0xd266('0x18'),_0x5af8f5);return new Promise(function(_0xb7c59b,_0x3c167b){if(intUtil['validateEmail'](_0x5af8f5[_0xd266('0x19')])){var _0x1866df={'method':_0xd266('0xb'),'uri':_0x5f4519+_0xd266('0x1a')+_0x5af8f5[_0xd266('0x19')]+'&'+_0x25cd35+'&'+_0xb8834,'auth':_0x58d2b3,'json':!![]};logger[_0xd266('0x12')]('['+[_0x260b54['toUpperCase']()]+_0xd266('0x1b'),_0x1866df);return rp(_0x1866df)[_0xd266('0xd')](function(_0x1c628f){logger['info']('['+[_0x260b54['toUpperCase']()]+_0xd266('0x1c'),_0x1c628f);if(_0x1c628f[_0xd266('0xe')]['length']>0x0&&String(_0x1c628f[_0xd266('0xe')][0x0][_0xd266('0x1d')])===_0xd266('0x1e')){_0x5af8f5[_0xd266('0x1f')]=_0x1c628f[_0xd266('0xe')][0x0][_0xd266('0x11')];}else{_0x5af8f5[_0xd266('0x1f')]=_0x5af8f5['adminId'];_0x5af8f5['userEmail']=_0x5af8f5[_0xd266('0x20')];}logger[_0xd266('0x12')]('['+[_0x260b54['toUpperCase']()]+_0xd266('0x21'),_0x5af8f5);_0xb7c59b(_0x5af8f5);})['catch'](function(_0x3c1ea9){logger[_0xd266('0x15')]('['+[_0x260b54['toUpperCase']()]+']',_0x3c1ea9['message']);_0x3c167b(_0x3c1ea9['message']);});}else{logger['info']('['+[_0x260b54['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x5af8f5[_0xd266('0x1f')]=_0x5af8f5[_0xd266('0x10')];_0x5af8f5[_0xd266('0x19')]=_0x5af8f5[_0xd266('0x20')];_0xb7c59b(_0x5af8f5);}});};}function createEndUser(_0x1b2eaf,_0x3653e5,_0x153498,_0x161fe6,_0x29e3d7){logger[_0xd266('0x12')]('['+[_0x1b2eaf[_0xd266('0x17')]()]+'],\x20createEndUser\x20input\x20crm',_0x153498);return new Promise(function(_0x49d16c,_0x2187bc){var _0x28624d={'method':_0xd266('0x22'),'uri':_0x161fe6+'sys_user?'+_0x29e3d7,'body':{'user_name':_0x153498[_0xd266('0x23')],'roles':_0xd266('0x24'),'first_name':_0x153498[_0xd266('0x23')],'active':_0xd266('0x1e'),'date_format':_0xd266('0x25'),'phone':_0x153498[_0xd266('0x23')]},'auth':_0x3653e5,'json':!![]};return rp(_0x28624d)[_0xd266('0xd')](function(_0x1a8b1d){logger[_0xd266('0x12')]('['+[_0x1b2eaf[_0xd266('0x17')]()]+_0xd266('0x26'),_0x1a8b1d[_0xd266('0xe')]);_0x153498['endUserId']=_0x1a8b1d[_0xd266('0xe')][_0xd266('0x11')];_0x49d16c(_0x153498);})['catch'](function(_0x522160){logger['error']('['+[_0x1b2eaf['toUpperCase']()]+']',_0x522160[_0xd266('0x16')]);_0x2187bc(_0x522160['message']);});});}function getEndUser(_0x21b3f7,_0x567f60,_0x1b56ef,_0x4b6a83,_0x42d9c9){return function(_0x57fa8c){logger[_0xd266('0x12')]('['+[_0x21b3f7['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x57fa8c);return new Promise(function(_0x1b6422,_0x42bbae){var _0x24c8c2={'method':_0xd266('0xb'),'uri':_0x1b56ef+_0xd266('0x27')+_0x57fa8c[_0xd266('0x23')]+'&'+_0x4b6a83+'&'+_0x42d9c9,'auth':_0x567f60,'json':!![]};return rp(_0x24c8c2)[_0xd266('0xd')](function(_0x1a0567){if(_0x1a0567['result'][_0xd266('0xf')]>0x0){_0x57fa8c[_0xd266('0x28')]=_0x1a0567[_0xd266('0xe')][0x0][_0xd266('0x11')];logger[_0xd266('0x12')]('['+[_0x21b3f7[_0xd266('0x17')]()]+'],\x20getEndUser\x20crm',_0x57fa8c);_0x1b6422(_0x57fa8c);}else{return createEndUser(_0x21b3f7,_0x567f60,_0x57fa8c,_0x1b56ef,_0x4b6a83)[_0xd266('0xd')](function(_0x2c8efa){logger[_0xd266('0x12')]('['+[_0x21b3f7[_0xd266('0x17')]()]+_0xd266('0x29'),_0x2c8efa);_0x1b6422(_0x2c8efa);});}})[_0xd266('0x14')](function(_0x3e2a9e){logger[_0xd266('0x15')]('['+[_0x21b3f7[_0xd266('0x17')]()]+']',_0x3e2a9e[_0xd266('0x16')]);_0x42bbae(_0x3e2a9e[_0xd266('0x16')]);});});};}function getCustomFields(_0x345096,_0x210e43){var _0x45b7ce={};if(_0x345096['length']>0x0){_[_0xd266('0x2a')](_0x345096,function(_0x5e4335){if(_[_0xd266('0x2b')]([_0xd266('0x2c'),_0xd266('0x2d')],_0x5e4335['type'])&&_0x5e4335[_0xd266('0x2e')]&&!_0x5e4335['customField']){_0x45b7ce[_0x5e4335[_0xd266('0x2e')][_0xd266('0x2f')]()]=_0x5e4335[_0xd266('0x30')]['toString']();}else if(_[_0xd266('0x2b')](['string',_0xd266('0x2d')],_0x5e4335['type'])&&_0x5e4335[_0xd266('0x31')]&&_0x5e4335[_0xd266('0x32')]){_0x45b7ce[_0x5e4335[_0xd266('0x31')][_0xd266('0x2f')]()]=_0x5e4335['content']['toString']();}else if(_0x5e4335[_0xd266('0x33')]===_0xd266('0x34')&&_0x5e4335['variableName']&&_0x5e4335[_0xd266('0x31')]&&_0x5e4335[_0xd266('0x32')]){_0x45b7ce[_0x5e4335[_0xd266('0x31')][_0xd266('0x2f')]()]=_0x210e43[_0x5e4335[_0xd266('0x35')]][_0xd266('0x36')]();}else if(_0x5e4335['type']===_0xd266('0x37')&&_0x5e4335[_0xd266('0x38')]&&_0x5e4335[_0xd266('0x38')][_0xd266('0x39')]&&_0x5e4335[_0xd266('0x31')]&&_0x5e4335[_0xd266('0x32')]){_0x45b7ce[_0x5e4335[_0xd266('0x31')][_0xd266('0x2f')]()]=_0x210e43[_0x5e4335[_0xd266('0x38')][_0xd266('0x39')][_0xd266('0x2f')]()][_0xd266('0x36')]();}});}return _0x45b7ce;}function getTicket(_0x5e6bfe,_0xe75dc7,_0x4f0150,_0x3192d2,_0x57c1da,_0x18e913){return function(_0x35fae9){logger['info']('['+[_0x5e6bfe[_0xd266('0x17')]()]+_0xd266('0x3a'),_0x35fae9);return new Promise(function(_0x140857,_0x33ce66){var _0x4b5223=_0x5e6bfe['toLowerCase']()===_0xd266('0x3b')?_0x35fae9['userId']:_0x35fae9['endUserId'];var _0x189c98={'method':_0xd266('0x22'),'uri':_0x4f0150+_0xd266('0x3c')+'?'+_0x18e913,'body':Object[_0xd266('0x3d')]({},{'active':_0xd266('0x1e'),'caller_id':_0x4b5223,'assigned_to':_0x35fae9[_0xd266('0x1f')],'short_description':intUtil[_0xd266('0x3e')](_0x3192d2[_0xd266('0x3f')],_0x57c1da,'\x20'),'description':intUtil[_0xd266('0x3e')](_0x3192d2[_0xd266('0x40')],_0x57c1da,'\x0a')},getCustomFields(_0x3192d2[_0xd266('0x41')],_0x57c1da)),'auth':_0xe75dc7,'json':!![]};return rp(_0x189c98)[_0xd266('0xd')](function(_0x28c1f2){logger[_0xd266('0x12')]('['+[_0x5e6bfe['toUpperCase']()]+_0xd266('0x42'),_0x28c1f2[_0xd266('0xe')]);_0x35fae9['ticketId']=_0x28c1f2[_0xd266('0xe')][_0xd266('0x11')];_0x35fae9[_0xd266('0x43')]=_0x28c1f2['result'][_0xd266('0x44')];logger['info']('['+[_0x5e6bfe[_0xd266('0x17')]()]+_0xd266('0x45'),_0x35fae9);_0x140857(_0x35fae9);})['catch'](function(_0x3f45e4){logger['error']('['+[_0x5e6bfe[_0xd266('0x17')]()]+']',_0x3f45e4[_0xd266('0x16')]);_0x33ce66(_0x3f45e4[_0xd266('0x16')]);});});};}function createRemoteTag(_0x4c82c6,_0x3698a7,_0x3e6509,_0x21aebe){return new Promise(function(_0x31e53f,_0x2807ca){var _0x217983={'method':_0xd266('0x22'),'uri':_0x3e6509+_0xd266('0x46')+'?'+_0x21aebe,'body':{'short_description':_0x4c82c6,'global':!![],'active':!![],'name':_0x4c82c6},'auth':_0x3698a7,'json':!![]};return rp(_0x217983)[_0xd266('0xd')](function(_0x2dd776){var _0x138517=_0x2dd776[_0xd266('0xe')]['sys_id'];_0x31e53f(_0x138517);});});}function getRemoteTag(_0x50fc13,_0x53e1c3,_0x52ad9c,_0x2b9a3c,_0x491931){return new Promise(function(_0x460ff0,_0x116909){var _0x4f3236={'method':'GET','uri':_0x52ad9c+_0xd266('0x46')+'?sysparm_query=name%3D'+_0x50fc13+'&'+_0x2b9a3c,'auth':_0x53e1c3,'json':!![]};return rp(_0x4f3236)[_0xd266('0xd')](function(_0x3bfe47){if(_0x3bfe47[_0xd266('0xe')]['length']>0x0){var _0x3a53c6=_0x3bfe47[_0xd266('0xe')][0x0][_0xd266('0x11')];_0x460ff0(_0x3a53c6);}else{return createRemoteTag(_0x50fc13,_0x53e1c3,_0x52ad9c,_0x2b9a3c)[_0xd266('0xd')](function(_0x18c0a1){_0x460ff0(_0x18c0a1);});}});});}function assignTagToIncident(_0x10d34c,_0x5b6bf1,_0x212ae8,_0x4a864b,_0xa4f710){return new Promise(function(_0x2988f9,_0x469240){var _0x50820c={'method':_0xd266('0x22'),'uri':_0x212ae8+_0xd266('0x47')+'?'+_0xa4f710,'body':{'label':_0x10d34c,'table':_0xd266('0x3c'),'id_type':_0xd266('0x48'),'table_key':_0x4a864b['ticketId'],'title':_0xd266('0x49')+_0x4a864b[_0xd266('0x43')],'id_display':_0x4a864b['ticketNumber']},'auth':_0x5b6bf1,'json':!![]};return rp(_0x50820c)[_0xd266('0xd')](function(_0x4b17c3){_0x2988f9();})[_0xd266('0x14')](function(){_0x2988f9();});});}function manageTags(_0x297872,_0x523b71,_0x227593,_0x389aca,_0xd8d140,_0x34fa71,_0x2920f6){return new Promise(function(_0x4e1a25,_0x15b28d){var _0x593c15=[];_0x523b71[_0xd266('0x2a')](function(_0x5b2a5e){_0x593c15[_0xd266('0x4a')](getRemoteTag(_0x5b2a5e,_0x227593,_0x389aca,_0x34fa71,_0x2920f6));});return Promise['all'](_0x593c15)[_0xd266('0xd')](function(_0x5cf5a1){if(_0x5cf5a1['length']){logger['info']('['+[_0x297872['toUpperCase']()]+_0xd266('0x4b'),_0x5cf5a1);var _0x1727cc=[];_0x5cf5a1['forEach'](function(_0x137259){_0x1727cc[_0xd266('0x4a')](assignTagToIncident(_0x137259,_0x227593,_0x389aca,_0xd8d140,_0x34fa71));});return Promise[_0xd266('0x4c')](_0x1727cc)['then'](function(){_0x4e1a25();})[_0xd266('0x14')](function(){_0x4e1a25();});}else{_0x4e1a25();}});});}function getTags(_0xbbafe3,_0x532824,_0x3d66f5,_0x4bf560,_0x5824d3,_0x27b08e){return function(_0x122aeb){return new Promise(function(_0x1d1cd1,_0x10e55b){var _0x21a0a5=[];var _0x366ac=_0x4bf560[_0xd266('0x4d')];if(_0x366ac&&_0x366ac[_0xd266('0xf')]>0x0){_0x21a0a5=_[_0xd266('0x4e')](_0x366ac,_0xd266('0x39'));}if(_0x21a0a5[_0xd266('0xf')]>0x0){return manageTags(_0xbbafe3,_0x21a0a5,_0x532824,_0x3d66f5,_0x122aeb,_0x5824d3,_0x27b08e)[_0xd266('0xd')](function(){_0x1d1cd1(_0x122aeb);});}else{_0x1d1cd1(_0x122aeb);}});};}function emit(_0x574100,_0x4983de,_0x2681d9){var _0x1ecee2=_0xd266('0x4f')+_0xd266('0x50')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xd266('0x51');var _0x45e75b={'uri':_0x574100+_0xd266('0x52')+_0x2681d9+_0x1ecee2};io['to'](util[_0xd266('0x53')]('user:%s',_0x4983de))[_0xd266('0x54')](_0xd266('0x55'),_0x45e75b);}exports['cs']=function(_0x1051a4,_0x38e1a8,_0x2c439b,_0x259b78,_0x41781b,_0x534fd8,_0x539108,_0x16417b){var _0x1b3aa6={};var _0x5eed5a={'user':_0x534fd8[_0xd266('0x56')],'pass':_0x534fd8[_0xd266('0x57')]};var _0x3c411a='sysparm_limit=1';var _0x4acfc8=_0xd266('0x58');_0x534fd8[_0xd266('0x59')]=intUtil['stripTrailingSlash'](_0x534fd8[_0xd266('0x59')]);_0x534fd8[_0xd266('0x5a')]=intUtil[_0xd266('0x5b')](_0x534fd8['serverUrl']);var _0x28cc0f=util['format'](_0xd266('0x5c'),_0x534fd8[_0xd266('0x59')]);_0x1b3aa6['userEmail']=!_[_0xd266('0x5d')](_0x259b78)?_0x259b78[_0xd266('0x5e')]:null;_0x1b3aa6[_0xd266('0x20')]=_0x534fd8[_0xd266('0x5e')];_0x1b3aa6[_0xd266('0x23')]=_0x16417b[_0xd266('0x2f')]()===_0xd266('0x3b')?_0x38e1a8[_0xd266('0x5f')]:_0x38e1a8[_0xd266('0x60')];_0x1b3aa6[_0xd266('0x61')]=_0x16417b==='queue'||_0x16417b===_0xd266('0x62')?_0xd266('0x63'):'outbound';var _0x1b3b5e=util[_0xd266('0x53')](_0xd266('0x64'),_0x534fd8[_0xd266('0x5a')],_0x38e1a8[_0xd266('0x65')],md5(_0x38e1a8[_0xd266('0x65')]));if(_0x41781b&&_0x41781b[_0xd266('0x66')]){logger[_0xd266('0x12')](_0xd266('0x67'),_0xd266('0x68'));_0x38e1a8[_0xd266('0x69')]=_0x1b3b5e;}else if(_0x539108&&_0x539108[_0xd266('0x6a')]&&_0x539108[_0xd266('0x6a')]!==_0xd266('0x6b')){logger[_0xd266('0x12')]('[OUTBOUND]',_0xd266('0x68'));_0x38e1a8[_0xd266('0x69')]=_0x1b3b5e;}else{_0x38e1a8[_0xd266('0x69')]='';}return getAdminUser(_0x16417b,_0x5eed5a,_0x1b3aa6,_0x28cc0f,_0x4acfc8,_0x3c411a)[_0xd266('0xd')](getUser(_0x16417b,_0x5eed5a,_0x28cc0f,_0x4acfc8,_0x3c411a))[_0xd266('0xd')](getEndUser(_0x16417b,_0x5eed5a,_0x28cc0f,_0x4acfc8,_0x3c411a))[_0xd266('0xd')](getTicket(_0x16417b,_0x5eed5a,_0x28cc0f,_0x2c439b,_0x38e1a8,_0x4acfc8))[_0xd266('0xd')](function(_0x1e4965){logger[_0xd266('0x12')](util[_0xd266('0x53')](_0xd266('0x6c'),_0x1e4965[_0xd266('0x6d')]));logger[_0xd266('0x12')](util['format'](_0xd266('0x6e'),_0x16417b));if(_0x16417b!=='unmanaged'){logger[_0xd266('0x12')]('['+[_0x16417b[_0xd266('0x17')]()]+']',_0xd266('0x6f'));emit(_0x534fd8[_0xd266('0x59')],_0x259b78[_0xd266('0x39')],_0x1e4965[_0xd266('0x6d')]);}})[_0xd266('0x14')](function(_0x5710d7){logger[_0xd266('0x15')]('['+[_0x16417b[_0xd266('0x17')]()]+_0xd266('0x70'),util[_0xd266('0x71')](_0x5710d7,{'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 172578c..3e0cede 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 _0x379c=['map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','POST','login','password','xCALLY\x20Motion\x20integration','sessionID','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','catch','error','outbound','uri','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','trigger:browser:url','[OUTBOUND]','unmanaged','lastevent','toUpperCase','calleridname','Ticket\x20created!','lodash','bluebird','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','apiKey','toString','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','user_name','Agent\x20found!','resolve','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','merge'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x379c,0xae));var _0xc379=function(_0x5ccdfb,_0x1a73ce){_0x5ccdfb=_0x5ccdfb-0x0;var _0x1a4767=_0x379c[_0x5ccdfb];return _0x1a4767;};'use strict';var _=require(_0xc379('0x0'));var rp=require('request-promise');var BPromise=require(_0xc379('0x1'));var md5=require('md5');var util=require(_0xc379('0x2'));var Redis=require(_0xc379('0x3'));var intUtil=require(_0xc379('0x4'));var config=require('../../../../config/environment');var logger=require(_0xc379('0x5'))(_0xc379('0x6'));config[_0xc379('0x7')]=_[_0xc379('0x8')](config[_0xc379('0x7')],{'host':_0xc379('0x9'),'port':0x18eb});var io=require(_0xc379('0xa'))(new Redis(config[_0xc379('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x4395ef,_0x5b473b,_0x218724){io['to'](_0x4395ef)[_0xc379('0xb')](_0x5b473b,_0x218724);}function getTicket(_0xf21aad,_0x239fef,_0x185108,_0x2588ee,_0x3197c6,_0x158957,_0x2cf98e,_0x56c48b){logger[_0xc379('0xc')](_0xc379('0xd'));var _0x12d232=new Date();var _0x13c224=[{'name':_0xc379('0xe'),'value':intUtil[_0xc379('0xf')](_0x2588ee[_0xc379('0x10')],_0x3197c6,'\x20')},{'name':'assigned_user_id','value':_0x239fef['id']},{'name':'created_by','value':_0x239fef['id']},{'name':'description','value':intUtil[_0xc379('0xf')](_0x2588ee[_0xc379('0x11')],_0x3197c6,'\x0a')},{'name':_0xc379('0x12'),'value':_0x12d232[_0xc379('0x13')]()[_0xc379('0x14')](0x0,0x13)[_0xc379('0x15')]('T','\x20')},{'name':_0xc379('0x16'),'value':'0'},{'name':_0xc379('0x17'),'value':'15'},{'name':_0xc379('0x18'),'value':_0x185108['id']},{'name':'parent_type','value':'Contacts'},{'name':_0xc379('0x19'),'value':_0x185108[_0xc379('0xe')]},{'name':_0xc379('0x1a'),'value':_0x56c48b}];if(_0x158957[_0xc379('0x1b')]){_[_0xc379('0x1c')](_0x158957,function(_0x4f65fe){if(_0x3197c6[_0x4f65fe['variableName']]){_0x13c224[_0xc379('0x1d')]({'name':_0x4f65fe[_0xc379('0x1e')],'value':_0x3197c6[_0x4f65fe[_0xc379('0x1f')]]});}});}return request({'form':{'method':_0xc379('0x20'),'input_type':_0xc379('0x21'),'response_type':_0xc379('0x21'),'rest_data':JSON[_0xc379('0x22')]({'session':_0x2cf98e['id'],'module_name':_0xc379('0x23'),'name_value_list':_0x13c224})}});}function getAuth(_0x5f0a59){return util['format']('Basic\x20%s',new Buffer(_0x5f0a59[_0xc379('0x24')]+':X')[_0xc379('0x25')]('base64'));}function getServerInfo(_0x2a290e){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0xc379('0x21'),'rest_data':JSON['stringify']({'session':_0x2a290e['id']})}});}function getUser(_0x5de637,_0x5e14dc,_0xd4c819){if(!_[_0xc379('0x26')](_0x5e14dc)){logger[_0xc379('0xc')](_0xc379('0x27'),_0x5e14dc);return request({'form':{'method':'get_entry_list','input_type':_0xc379('0x21'),'response_type':_0xc379('0x21'),'rest_data':JSON[_0xc379('0x22')]({'session':_0xd4c819['id'],'module_name':_0xc379('0x28'),'query':util['format'](_0xc379('0x29'),_0x5e14dc),'order_by':'','offset':'0','select_fields':['id',_0xc379('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc379('0x2a')](function(_0x322a03){if(_0x322a03[_0xc379('0x2b')][_0xc379('0x1b')]){var _0x44d5a1=_[_0xc379('0x2c')](_0x322a03[_0xc379('0x2b')],function(_0x12f74c){return _0x12f74c['name_value_list'][_0xc379('0x2d')]['value']===_0x5e14dc;});if(_0x44d5a1){logger[_0xc379('0xc')](_0xc379('0x2e'));return BPromise[_0xc379('0x2f')]({'id':_0x44d5a1[_0xc379('0x30')]['id'][_0xc379('0x31')],'name':_0x44d5a1[_0xc379('0x30')][_0xc379('0xe')][_0xc379('0x31')]});}}logger[_0xc379('0xc')](_0xc379('0x32'));return BPromise[_0xc379('0x2f')]({'id':_0xd4c819[_0xc379('0x30')][_0xc379('0x33')][_0xc379('0x31')],'name':_0xd4c819[_0xc379('0x30')][_0xc379('0x2d')][_0xc379('0x31')]});});}else{logger['info'](_0xc379('0x34'));return BPromise[_0xc379('0x2f')]({'id':_0xd4c819[_0xc379('0x30')][_0xc379('0x33')][_0xc379('0x31')],'name':_0xd4c819['name_value_list'][_0xc379('0x2d')]['value']});}}function getEndUser(_0x336282,_0x517c17,_0x451831,_0x5e05c9){logger[_0xc379('0xc')](_0xc379('0x35'),_0x451831);return request({'form':{'method':_0xc379('0x36'),'input_type':'JSON','response_type':_0xc379('0x21'),'rest_data':JSON[_0xc379('0x22')]({'session':_0x5e05c9['id'],'module_name':_0xc379('0x37'),'query':util[_0xc379('0x38')](_0xc379('0x39'),_0x451831),'order_by':'','offset':'0','select_fields':['id',_0xc379('0xe'),_0xc379('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc379('0x2a')](function(_0x54a9cc){if(_0x54a9cc['entry_list'][_0xc379('0x1b')]){var _0x51170f=_[_0xc379('0x2c')](_0x54a9cc[_0xc379('0x2b')],function(_0x816748){return _0x816748['name_value_list'][_0xc379('0x3a')]['value']===_0x451831;});if(_0x51170f){logger['info'](_0xc379('0x3b'));return BPromise['resolve']({'id':_0x51170f['name_value_list']['id'][_0xc379('0x31')],'name':_0x51170f['name_value_list'][_0xc379('0xe')][_0xc379('0x31')],'phone':_0x51170f[_0xc379('0x30')][_0xc379('0x3a')]['value']});}}else{logger[_0xc379('0xc')](_0xc379('0x3c'));return request({'form':{'method':_0xc379('0x20'),'input_type':'JSON','response_type':_0xc379('0x21'),'rest_data':JSON[_0xc379('0x22')]({'session':_0x5e05c9['id'],'module_name':_0xc379('0x37'),'name_value_list':[{'name':_0xc379('0x3d'),'value':_0x517c17!==_0xc379('0x3e')?_0x517c17:util['format'](_0xc379('0x3f'),_0x451831)},{'name':'phone_home','value':_0x451831}]})}})[_0xc379('0x2a')](function(_0x1475aa){logger[_0xc379('0xc')](_0xc379('0x40'));return BPromise[_0xc379('0x2f')]({'id':_0x1475aa['id'],'name':_0x1475aa[_0xc379('0x2b')][_0xc379('0x3d')][_0xc379('0x31')],'phone':_0x1475aa[_0xc379('0x2b')]['phone_home'][_0xc379('0x31')]});});}});}function request(_0xd09ed7){logger['debug']('[HTTP]',JSON[_0xc379('0x22')](_0xd09ed7));return rp(_[_0xc379('0x41')](def,_0xd09ed7));}function getTags(_0x46dba1,_0x25bf1a){var _0x507b2=[];if(_0x46dba1&&_0x46dba1['length']>0x0){_0x507b2=_[_0xc379('0x42')](_0x46dba1,_0x25bf1a);}return _0x507b2;}function getCustomFields(_0x5654a1,_0xb7ae4a){var _0xfe9432=[];var _0xee9ac6={'custom_fields':[]};if(_0x5654a1[_0xc379('0x1b')]>0x0){_['forEach'](_0x5654a1,function(_0x45d19b){if(_0x45d19b[_0xc379('0x43')]===_0xc379('0x44')&&_0x45d19b[_0xc379('0x45')]&&!_0x45d19b[_0xc379('0x46')]){_0xee9ac6[_0x45d19b[_0xc379('0x45')][_0xc379('0x47')]()]=_0x45d19b[_0xc379('0x48')][_0xc379('0x25')]();}else if(_0x45d19b[_0xc379('0x43')]===_0xc379('0x44')&&_0x45d19b['idField']&&_0x45d19b[_0xc379('0x46')]){_0xee9ac6[_0xc379('0x49')][_0xc379('0x1d')]({'id':_0x45d19b['idField'],'value':_0x45d19b[_0xc379('0x48')][_0xc379('0x25')]()});}else if(_0x45d19b[_0xc379('0x43')]===_0xc379('0x4a')&&_0x45d19b[_0xc379('0x1f')]&&_0x45d19b['idField']&&_0x45d19b[_0xc379('0x46')]){_0xb7ae4a[_0x45d19b[_0xc379('0x1f')]]&&_0xee9ac6[_0xc379('0x49')][_0xc379('0x1d')]({'id':_0x45d19b['idField'],'value':_0xb7ae4a[_0x45d19b[_0xc379('0x1f')]]['toString']()});}else if(_0x45d19b[_0xc379('0x43')]===_0xc379('0x4b')&&_0x45d19b['Variable']&&_0x45d19b[_0xc379('0x4c')][_0xc379('0xe')]&&_0x45d19b['idField']&&_0x45d19b[_0xc379('0x46')]){_0xb7ae4a[_0x45d19b[_0xc379('0x4c')][_0xc379('0xe')]['toLowerCase']()]&&_0xee9ac6[_0xc379('0x49')]['push']({'id':_0x45d19b['idField'],'value':_0xb7ae4a[_0x45d19b[_0xc379('0x4c')][_0xc379('0xe')]['toLowerCase']()][_0xc379('0x25')]()});}});}return _0xee9ac6;}function getConnection(_0x3f120f){return request({'method':_0xc379('0x4d'),'form':{'method':_0xc379('0x4e'),'input_type':_0xc379('0x21'),'response_type':_0xc379('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3f120f['username'],'password':_0x3f120f[_0xc379('0x4f')],'encryption':'PLAIN'},'application':_0xc379('0x50')})}})['then'](function(_0x37ec9a){var _0x282a8d=_0x37ec9a;if(_0x282a8d['id']){def[_0xc379('0x51')]=_0x282a8d['id'];return BPromise['resolve'](_0x282a8d);}else{throw new Error(util[_0xc379('0x38')]('Account\x20%d\x20is\x20not\x20valid',_0x3f120f['id']));}});}function setRelationship(_0x53fcf4,_0x184833,_0x3de9a1,_0x3327a9){return request({'form':{'method':_0xc379('0x52'),'input_type':_0xc379('0x21'),'response_type':_0xc379('0x21'),'rest_data':JSON['stringify']({'session':_0x53fcf4['id'],'module_name':_0xc379('0x23'),'module_id':_0x3de9a1['id'],'link_field_name':_0x3327a9,'related_ids':[_0x184833['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x4c3dea,_0x2e9ad9,_0x373068,_0x2de907,_0x1cca64,_0x321e13){var _0x5aee97,_0x4f9d3b,_0x252379,_0xe40ae8;_0x321e13[_0xc379('0x53')]=intUtil[_0xc379('0x54')](_0x321e13[_0xc379('0x53')]);_0x321e13[_0xc379('0x55')]=intUtil[_0xc379('0x54')](_0x321e13[_0xc379('0x55')]);def['uri']=util['format'](_0xc379('0x56'),_0x321e13[_0xc379('0x53')]);if(_0x1cca64&&_0x1cca64[_0xc379('0x57')]){logger[_0xc379('0xc')](_0xc379('0x58'),'Recording\x20is\x20enabled!');_0x2e9ad9[_0xc379('0x59')]=util[_0xc379('0x38')](_0xc379('0x5a'),_0x321e13[_0xc379('0x55')],_0x2e9ad9[_0xc379('0x5b')],md5(_0x2e9ad9[_0xc379('0x5b')]));}else{_0x2e9ad9[_0xc379('0x59')]='';}return getConnection(_0x321e13)['then'](function(_0xf93edb){_0xe40ae8=_0xf93edb;return getUser(_0x321e13,_0x2de907[_0xc379('0xe')],_0xe40ae8);})[_0xc379('0x2a')](function(_0x30fb71){_0x5aee97=_0x30fb71;logger[_0xc379('0xc')]('The\x20User\x20ID\x20is:',_0x5aee97['id']);return getEndUser(_0x321e13,_0x2e9ad9['calleridname'],_0x2e9ad9[_0xc379('0x5c')],_0xe40ae8);})[_0xc379('0x2a')](function(_0x3a84de){_0x4f9d3b=_0x3a84de;logger[_0xc379('0xc')](_0xc379('0x5d'),_0x4f9d3b['id']);return getTicket(_0x321e13,_0x5aee97,_0x4f9d3b,_0x373068,_0x2e9ad9,_0x373068[_0xc379('0x5e')],_0xe40ae8,_0xc379('0x5f'));})[_0xc379('0x2a')](function(_0x2b62fa){_0x252379=_0x2b62fa;logger[_0xc379('0xc')]('Ticket\x20created!');logger[_0xc379('0xc')]('The\x20Ticket\x20ID\x20is:',_0x252379['id']);return setRelationship(_0xe40ae8,_0x5aee97,_0x252379,_0xc379('0x60'));})[_0xc379('0x2a')](function(){return setRelationship(_0xe40ae8,_0x4f9d3b,_0x252379,_0xc379('0x61'));})['then'](function(){return getServerInfo(_0xe40ae8);})['then'](function(_0xf06f45){var _0x459fec=parseInt(_0xf06f45[_0xc379('0x62')][_0xc379('0x63')](0x0));var _0x5b5a4c=util[_0xc379('0x38')](_0xc379('0x64'),_0x321e13['remoteUri'],_0x252379['id']);if(_0x459fec>0x6){_0x5b5a4c=util['format'](_0xc379('0x65'),_0x321e13[_0xc379('0x53')],_0x252379['id']);}logger[_0xc379('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc379('0x38')](_0xc379('0x66'),_0x2de907[_0xc379('0xe')]),'trigger:browser:url',{'uri':_0x5b5a4c});})[_0xc379('0x67')](function(_0x3c58bb){logger[_0xc379('0x68')](_0xc379('0x58'),JSON['stringify'](_0x3c58bb));});};exports[_0xc379('0x69')]=function(_0x10c54b,_0x383c84,_0x2c6f0e,_0xd65109,_0x5b61e3,_0x3ee05b,_0x49a356){var _0x294aee,_0x2e7cf3,_0x2908dc,_0x2c3ce8;_0x3ee05b[_0xc379('0x53')]=intUtil['stripTrailingSlash'](_0x3ee05b[_0xc379('0x53')]);_0x3ee05b[_0xc379('0x55')]=intUtil['stripTrailingSlash'](_0x3ee05b[_0xc379('0x55')]);def[_0xc379('0x6a')]=util['format']('%s/service/v4_1/rest.php',_0x3ee05b[_0xc379('0x53')]);if(_0x49a356&&_0x49a356['recordingFormat']&&_0x49a356['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0xc379('0x6b'));_0x383c84[_0xc379('0x59')]=util['format'](_0xc379('0x5a'),_0x3ee05b[_0xc379('0x55')],_0x383c84[_0xc379('0x5b')],md5(_0x383c84[_0xc379('0x5b')]));}return getConnection(_0x3ee05b)[_0xc379('0x2a')](function(_0x5d8205){_0x2c3ce8=_0x5d8205;return getUser(_0x3ee05b,_0xd65109[_0xc379('0xe')],_0x2c3ce8);})[_0xc379('0x2a')](function(_0x5e9cee){_0x294aee=_0x5e9cee;logger['info'](_0xc379('0x6c'),_0x294aee['id']);return getEndUser(_0x3ee05b,_0x383c84[_0xc379('0x6d')],_0x383c84[_0xc379('0x6e')],_0x2c3ce8);})['then'](function(_0x25ce41){_0x2e7cf3=_0x25ce41;logger[_0xc379('0xc')](_0xc379('0x5d'),_0x2e7cf3['id']);return getTicket(_0x3ee05b,_0x294aee,_0x2e7cf3,_0x2c6f0e,_0x383c84,_0x2c6f0e[_0xc379('0x5e')],_0x2c3ce8,_0xc379('0x6f'));})['then'](function(_0x2a779c){_0x2908dc=_0x2a779c;logger[_0xc379('0xc')]('Ticket\x20created!');logger[_0xc379('0xc')](_0xc379('0x70'),_0x2908dc['id']);return setRelationship(_0x2c3ce8,_0x294aee,_0x2908dc,_0xc379('0x60'));})[_0xc379('0x2a')](function(){return setRelationship(_0x2c3ce8,_0x2e7cf3,_0x2908dc,_0xc379('0x61'));})[_0xc379('0x2a')](function(){return getServerInfo(_0x2c3ce8);})[_0xc379('0x2a')](function(_0xa5770b){var _0x56fcd1=parseInt(_0xa5770b[_0xc379('0x62')][_0xc379('0x63')](0x0));var _0x277187=util[_0xc379('0x38')](_0xc379('0x64'),_0x3ee05b[_0xc379('0x53')],_0x2908dc['id']);if(_0x56fcd1>0x6){_0x277187=util[_0xc379('0x38')](_0xc379('0x65'),_0x3ee05b[_0xc379('0x53')],_0x2908dc['id']);}logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc379('0x38')](_0xc379('0x66'),_0xd65109['name']),_0xc379('0x71'),{'uri':_0x277187});})['catch'](function(_0x125690){logger[_0xc379('0x68')](_0xc379('0x72'),JSON[_0xc379('0x22')](_0x125690));});};exports[_0xc379('0x73')]=function(_0x32829d,_0x3ecded,_0x3cc0f1,_0x2e3831,_0x14baa3,_0x2e0361){var _0x356e73,_0x5de093,_0x5f2e71,_0x10d809;_0x2e0361[_0xc379('0x53')]=intUtil[_0xc379('0x54')](_0x2e0361[_0xc379('0x53')]);_0x2e0361[_0xc379('0x55')]=intUtil['stripTrailingSlash'](_0x2e0361['serverUrl']);def['uri']=util['format'](_0xc379('0x56'),_0x2e0361[_0xc379('0x53')]);if(_0x14baa3&&_0x14baa3[_0xc379('0x57')]){logger[_0xc379('0xc')]('['+_0x3ecded[_0xc379('0x74')][_0xc379('0x75')]()+']',_0xc379('0x6b'));_0x3ecded['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e0361[_0xc379('0x55')],_0x3ecded['uniqueid'],md5(_0x3ecded[_0xc379('0x5b')]));}else{_0x3ecded[_0xc379('0x59')]='';}return getConnection(_0x2e0361)[_0xc379('0x2a')](function(_0x4d505c){_0x10d809=_0x4d505c;if(!_[_0xc379('0x26')](_0x2e3831)){return getUser(_0x2e0361,_0x2e3831[_0xc379('0xe')],_0x10d809);}else{return getUser(_0x2e0361,null,_0x10d809);}})['then'](function(_0x93cf46){_0x356e73=_0x93cf46;logger[_0xc379('0xc')](_0xc379('0x6c'),_0x356e73['id']);return getEndUser(_0x2e0361,_0x3ecded[_0xc379('0x76')],_0x3ecded[_0xc379('0x5c')],_0x10d809);})[_0xc379('0x2a')](function(_0xe98087){_0x5de093=_0xe98087;logger[_0xc379('0xc')](_0xc379('0x5d'),_0x5de093['id']);return getTicket(_0x2e0361,_0x356e73,_0x5de093,_0x3cc0f1,_0x3ecded,_0x3cc0f1[_0xc379('0x5e')],_0x10d809,'Inbound');})[_0xc379('0x2a')](function(_0x4eb3cc){_0x5f2e71=_0x4eb3cc;logger[_0xc379('0xc')](_0xc379('0x77'));logger[_0xc379('0xc')](_0xc379('0x70'),_0x5f2e71['id']);return setRelationship(_0x10d809,_0x356e73,_0x5f2e71,_0xc379('0x60'));})['then'](function(){return setRelationship(_0x10d809,_0x5de093,_0x5f2e71,'contacts');})['then'](function(){return getServerInfo(_0x10d809);})[_0xc379('0x67')](function(_0x237511){logger[_0xc379('0x68')]('['+_0x3ecded[_0xc379('0x74')]['toUpperCase']()+']',JSON['stringify'](_0x237511));});}; \ No newline at end of file +var _0x73af=['slice','replace','duration_hours','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','then','find','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','entry_list','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Enduser\x20created.','first_name','[HTTP]','merge','map','string','nameField','toLowerCase','content','type','idField','customField','custom_fields','variable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','Inbound','lodash','bluebird','md5','util','ioredis','./util','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','date_start','toISOString'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x73af,0x152));var _0xf73a=function(_0x20c512,_0x36c198){_0x20c512=_0x20c512-0x0;var _0x25236e=_0x73af[_0x20c512];return _0x25236e;};'use strict';var _=require(_0xf73a('0x0'));var rp=require('request-promise');var BPromise=require(_0xf73a('0x1'));var md5=require(_0xf73a('0x2'));var util=require(_0xf73a('0x3'));var Redis=require(_0xf73a('0x4'));var intUtil=require(_0xf73a('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf73a('0x6'));config[_0xf73a('0x7')]=_[_0xf73a('0x8')](config[_0xf73a('0x7')],{'host':_0xf73a('0x9'),'port':0x18eb});var io=require(_0xf73a('0xa'))(new Redis(config[_0xf73a('0x7')]));var def={'method':_0xf73a('0xb'),'json':!![]};function emit(_0x3b5cd0,_0x549cd4,_0x3ac6c3){io['to'](_0x3b5cd0)[_0xf73a('0xc')](_0x549cd4,_0x3ac6c3);}function getTicket(_0x4f0ada,_0x266d2e,_0xf8e545,_0x54998a,_0x28ea06,_0x41be30,_0x23f08a,_0x5ba14d){logger[_0xf73a('0xd')](_0xf73a('0xe'));var _0x36a64c=new Date();var _0x770ca=[{'name':_0xf73a('0xf'),'value':intUtil[_0xf73a('0x10')](_0x54998a[_0xf73a('0x11')],_0x28ea06,'\x20')},{'name':'assigned_user_id','value':_0x266d2e['id']},{'name':_0xf73a('0x12'),'value':_0x266d2e['id']},{'name':_0xf73a('0x13'),'value':intUtil[_0xf73a('0x10')](_0x54998a['Descriptions'],_0x28ea06,'\x0a')},{'name':_0xf73a('0x14'),'value':_0x36a64c[_0xf73a('0x15')]()[_0xf73a('0x16')](0x0,0x13)[_0xf73a('0x17')]('T','\x20')},{'name':_0xf73a('0x18'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0xf8e545['id']},{'name':_0xf73a('0x19'),'value':_0xf73a('0x1a')},{'name':_0xf73a('0x1b'),'value':_0xf8e545[_0xf73a('0xf')]},{'name':_0xf73a('0x1c'),'value':_0x5ba14d}];if(_0x41be30[_0xf73a('0x1d')]){_[_0xf73a('0x1e')](_0x41be30,function(_0x62099e){if(_0x28ea06[_0x62099e[_0xf73a('0x1f')]]){_0x770ca[_0xf73a('0x20')]({'name':_0x62099e['idField'],'value':_0x28ea06[_0x62099e['variableName']]});}});}return request({'form':{'method':_0xf73a('0x21'),'input_type':'JSON','response_type':_0xf73a('0x22'),'rest_data':JSON[_0xf73a('0x23')]({'session':_0x23f08a['id'],'module_name':_0xf73a('0x24'),'name_value_list':_0x770ca})}});}function getAuth(_0x4fb702){return util[_0xf73a('0x25')](_0xf73a('0x26'),new Buffer(_0x4fb702['apiKey']+':X')[_0xf73a('0x27')](_0xf73a('0x28')));}function getServerInfo(_0x3c9e49){return request({'form':{'method':_0xf73a('0x29'),'input_type':_0xf73a('0x22'),'response_type':_0xf73a('0x22'),'rest_data':JSON['stringify']({'session':_0x3c9e49['id']})}});}function getUser(_0x1cf64a,_0x271420,_0x383158){if(!_[_0xf73a('0x2a')](_0x271420)){logger[_0xf73a('0xd')](_0xf73a('0x2b'),_0x271420);return request({'form':{'method':'get_entry_list','input_type':_0xf73a('0x22'),'response_type':_0xf73a('0x22'),'rest_data':JSON[_0xf73a('0x23')]({'session':_0x383158['id'],'module_name':_0xf73a('0x2c'),'query':util[_0xf73a('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x271420),'order_by':'','offset':'0','select_fields':['id',_0xf73a('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf73a('0x2d')](function(_0x2f9569){if(_0x2f9569['entry_list'][_0xf73a('0x1d')]){var _0x552f06=_[_0xf73a('0x2e')](_0x2f9569['entry_list'],function(_0x4affb8){return _0x4affb8['name_value_list']['user_name']['value']===_0x271420;});if(_0x552f06){logger[_0xf73a('0xd')](_0xf73a('0x2f'));return BPromise[_0xf73a('0x30')]({'id':_0x552f06[_0xf73a('0x31')]['id']['value'],'name':_0x552f06['name_value_list'][_0xf73a('0xf')]['value']});}}logger[_0xf73a('0xd')](_0xf73a('0x32'));return BPromise[_0xf73a('0x30')]({'id':_0x383158[_0xf73a('0x31')][_0xf73a('0x33')][_0xf73a('0x34')],'name':_0x383158[_0xf73a('0x31')][_0xf73a('0x35')][_0xf73a('0x34')]});});}else{logger[_0xf73a('0xd')](_0xf73a('0x36'));return BPromise[_0xf73a('0x30')]({'id':_0x383158['name_value_list'][_0xf73a('0x33')][_0xf73a('0x34')],'name':_0x383158[_0xf73a('0x31')][_0xf73a('0x35')][_0xf73a('0x34')]});}}function getEndUser(_0x566388,_0x39c520,_0x2913a9,_0x1906b7){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2913a9);return request({'form':{'method':_0xf73a('0x37'),'input_type':_0xf73a('0x22'),'response_type':_0xf73a('0x22'),'rest_data':JSON['stringify']({'session':_0x1906b7['id'],'module_name':_0xf73a('0x1a'),'query':util[_0xf73a('0x25')](_0xf73a('0x38'),_0x2913a9),'order_by':'','offset':'0','select_fields':['id',_0xf73a('0xf'),_0xf73a('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf73a('0x2d')](function(_0x298c3a){if(_0x298c3a[_0xf73a('0x3a')][_0xf73a('0x1d')]){var _0x31e3f0=_[_0xf73a('0x2e')](_0x298c3a[_0xf73a('0x3a')],function(_0x34f29d){return _0x34f29d[_0xf73a('0x31')][_0xf73a('0x39')][_0xf73a('0x34')]===_0x2913a9;});if(_0x31e3f0){logger[_0xf73a('0xd')]('Enduser\x20found!');return BPromise[_0xf73a('0x30')]({'id':_0x31e3f0[_0xf73a('0x31')]['id']['value'],'name':_0x31e3f0[_0xf73a('0x31')][_0xf73a('0xf')][_0xf73a('0x34')],'phone':_0x31e3f0[_0xf73a('0x31')][_0xf73a('0x39')][_0xf73a('0x34')]});}}else{logger[_0xf73a('0xd')](_0xf73a('0x3b'));return request({'form':{'method':'set_entry','input_type':_0xf73a('0x22'),'response_type':'JSON','rest_data':JSON[_0xf73a('0x23')]({'session':_0x1906b7['id'],'module_name':_0xf73a('0x1a'),'name_value_list':[{'name':'first_name','value':_0x39c520!==_0xf73a('0x3c')?_0x39c520:util[_0xf73a('0x25')]('Caller\x20-\x20%s',_0x2913a9)},{'name':_0xf73a('0x39'),'value':_0x2913a9}]})}})['then'](function(_0x5f2453){logger[_0xf73a('0xd')](_0xf73a('0x3d'));return BPromise[_0xf73a('0x30')]({'id':_0x5f2453['id'],'name':_0x5f2453['entry_list'][_0xf73a('0x3e')]['value'],'phone':_0x5f2453[_0xf73a('0x3a')][_0xf73a('0x39')]['value']});});}});}function request(_0x335d44){logger['debug'](_0xf73a('0x3f'),JSON[_0xf73a('0x23')](_0x335d44));return rp(_[_0xf73a('0x40')](def,_0x335d44));}function getTags(_0x358015,_0x243755){var _0x5e01a9=[];if(_0x358015&&_0x358015['length']>0x0){_0x5e01a9=_[_0xf73a('0x41')](_0x358015,_0x243755);}return _0x5e01a9;}function getCustomFields(_0x3815bb,_0x1e337a){var _0x3239f5=[];var _0x34e57d={'custom_fields':[]};if(_0x3815bb[_0xf73a('0x1d')]>0x0){_[_0xf73a('0x1e')](_0x3815bb,function(_0x21ec17){if(_0x21ec17['type']===_0xf73a('0x42')&&_0x21ec17['nameField']&&!_0x21ec17['customField']){_0x34e57d[_0x21ec17[_0xf73a('0x43')][_0xf73a('0x44')]()]=_0x21ec17[_0xf73a('0x45')]['toString']();}else if(_0x21ec17[_0xf73a('0x46')]===_0xf73a('0x42')&&_0x21ec17[_0xf73a('0x47')]&&_0x21ec17[_0xf73a('0x48')]){_0x34e57d[_0xf73a('0x49')]['push']({'id':_0x21ec17[_0xf73a('0x47')],'value':_0x21ec17['content'][_0xf73a('0x27')]()});}else if(_0x21ec17['type']===_0xf73a('0x4a')&&_0x21ec17[_0xf73a('0x1f')]&&_0x21ec17[_0xf73a('0x47')]&&_0x21ec17[_0xf73a('0x48')]){_0x1e337a[_0x21ec17[_0xf73a('0x1f')]]&&_0x34e57d[_0xf73a('0x49')][_0xf73a('0x20')]({'id':_0x21ec17[_0xf73a('0x47')],'value':_0x1e337a[_0x21ec17['variableName']][_0xf73a('0x27')]()});}else if(_0x21ec17[_0xf73a('0x46')]==='customVariable'&&_0x21ec17[_0xf73a('0x4b')]&&_0x21ec17[_0xf73a('0x4b')][_0xf73a('0xf')]&&_0x21ec17[_0xf73a('0x47')]&&_0x21ec17[_0xf73a('0x48')]){_0x1e337a[_0x21ec17['Variable']['name'][_0xf73a('0x44')]()]&&_0x34e57d[_0xf73a('0x49')][_0xf73a('0x20')]({'id':_0x21ec17[_0xf73a('0x47')],'value':_0x1e337a[_0x21ec17[_0xf73a('0x4b')][_0xf73a('0xf')][_0xf73a('0x44')]()][_0xf73a('0x27')]()});}});}return _0x34e57d;}function getConnection(_0xe6aaa6){return request({'method':_0xf73a('0xb'),'form':{'method':_0xf73a('0x4c'),'input_type':_0xf73a('0x22'),'response_type':_0xf73a('0x22'),'rest_data':JSON[_0xf73a('0x23')]({'user_auth':{'user_name':_0xe6aaa6['username'],'password':_0xe6aaa6[_0xf73a('0x4d')],'encryption':_0xf73a('0x4e')},'application':_0xf73a('0x4f')})}})[_0xf73a('0x2d')](function(_0xb9e7dd){var _0x4c4274=_0xb9e7dd;if(_0x4c4274['id']){def[_0xf73a('0x50')]=_0x4c4274['id'];return BPromise['resolve'](_0x4c4274);}else{throw new Error(util[_0xf73a('0x25')]('Account\x20%d\x20is\x20not\x20valid',_0xe6aaa6['id']));}});}function setRelationship(_0x51f7bd,_0x4b81b6,_0x3d0e73,_0x533014){return request({'form':{'method':_0xf73a('0x51'),'input_type':_0xf73a('0x22'),'response_type':_0xf73a('0x22'),'rest_data':JSON['stringify']({'session':_0x51f7bd['id'],'module_name':_0xf73a('0x24'),'module_id':_0x3d0e73['id'],'link_field_name':_0x533014,'related_ids':[_0x4b81b6['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xf73a('0x52')]=function(_0x590749,_0x556320,_0x4ca6ef,_0x18cf4e,_0x3f4d15,_0x3be414){var _0x3b462c,_0xcff102,_0xfabf75,_0x48e098;_0x3be414[_0xf73a('0x53')]=intUtil[_0xf73a('0x54')](_0x3be414[_0xf73a('0x53')]);_0x3be414[_0xf73a('0x55')]=intUtil[_0xf73a('0x54')](_0x3be414[_0xf73a('0x55')]);def[_0xf73a('0x56')]=util[_0xf73a('0x25')]('%s/service/v4_1/rest.php',_0x3be414[_0xf73a('0x53')]);if(_0x3f4d15&&_0x3f4d15[_0xf73a('0x57')]){logger[_0xf73a('0xd')](_0xf73a('0x58'),_0xf73a('0x59'));_0x556320['recordingURL']=util[_0xf73a('0x25')](_0xf73a('0x5a'),_0x3be414[_0xf73a('0x55')],_0x556320[_0xf73a('0x5b')],md5(_0x556320['uniqueid']));}else{_0x556320[_0xf73a('0x5c')]='';}return getConnection(_0x3be414)['then'](function(_0x352224){_0x48e098=_0x352224;return getUser(_0x3be414,_0x18cf4e[_0xf73a('0xf')],_0x48e098);})['then'](function(_0x2dcabe){_0x3b462c=_0x2dcabe;logger[_0xf73a('0xd')]('The\x20User\x20ID\x20is:',_0x3b462c['id']);return getEndUser(_0x3be414,_0x556320[_0xf73a('0x5d')],_0x556320[_0xf73a('0x5e')],_0x48e098);})[_0xf73a('0x2d')](function(_0x1e7abd){_0xcff102=_0x1e7abd;logger[_0xf73a('0xd')]('The\x20Enduser\x20ID\x20is:',_0xcff102['id']);return getTicket(_0x3be414,_0x3b462c,_0xcff102,_0x4ca6ef,_0x556320,_0x4ca6ef[_0xf73a('0x5f')],_0x48e098,'Inbound');})['then'](function(_0x4ab59e){_0xfabf75=_0x4ab59e;logger[_0xf73a('0xd')](_0xf73a('0x60'));logger[_0xf73a('0xd')](_0xf73a('0x61'),_0xfabf75['id']);return setRelationship(_0x48e098,_0x3b462c,_0xfabf75,_0xf73a('0x62'));})[_0xf73a('0x2d')](function(){return setRelationship(_0x48e098,_0xcff102,_0xfabf75,_0xf73a('0x63'));})[_0xf73a('0x2d')](function(){return getServerInfo(_0x48e098);})[_0xf73a('0x2d')](function(_0x41c440){var _0x2cfcf3=parseInt(_0x41c440[_0xf73a('0x64')][_0xf73a('0x65')](0x0));var _0x15d3f6=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3be414['remoteUri'],_0xfabf75['id']);if(_0x2cfcf3>0x6){_0x15d3f6=util[_0xf73a('0x25')](_0xf73a('0x66'),_0x3be414['remoteUri'],_0xfabf75['id']);}logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf73a('0x25')](_0xf73a('0x67'),_0x18cf4e[_0xf73a('0xf')]),_0xf73a('0x68'),{'uri':_0x15d3f6});})[_0xf73a('0x69')](function(_0x41ff08){logger[_0xf73a('0x6a')](_0xf73a('0x58'),JSON['stringify'](_0x41ff08));});};exports['outbound']=function(_0x383966,_0x23be72,_0x25f763,_0x634c4d,_0x1fc082,_0x2df259,_0x4bbe8b){var _0x261439,_0x5d0ec3,_0x23ca23,_0x318339;_0x2df259[_0xf73a('0x53')]=intUtil[_0xf73a('0x54')](_0x2df259['remoteUri']);_0x2df259[_0xf73a('0x55')]=intUtil[_0xf73a('0x54')](_0x2df259[_0xf73a('0x55')]);def['uri']=util[_0xf73a('0x25')](_0xf73a('0x6b'),_0x2df259[_0xf73a('0x53')]);if(_0x4bbe8b&&_0x4bbe8b[_0xf73a('0x6c')]&&_0x4bbe8b[_0xf73a('0x6c')]!==_0xf73a('0x6d')){logger[_0xf73a('0xd')](_0xf73a('0x6e'),_0xf73a('0x59'));_0x23be72[_0xf73a('0x5c')]=util[_0xf73a('0x25')](_0xf73a('0x5a'),_0x2df259[_0xf73a('0x55')],_0x23be72[_0xf73a('0x5b')],md5(_0x23be72[_0xf73a('0x5b')]));}return getConnection(_0x2df259)[_0xf73a('0x2d')](function(_0x2b0818){_0x318339=_0x2b0818;return getUser(_0x2df259,_0x634c4d['name'],_0x318339);})[_0xf73a('0x2d')](function(_0x2c0ba6){_0x261439=_0x2c0ba6;logger[_0xf73a('0xd')]('The\x20User\x20ID\x20is:',_0x261439['id']);return getEndUser(_0x2df259,_0x23be72['destcalleridname'],_0x23be72[_0xf73a('0x6f')],_0x318339);})[_0xf73a('0x2d')](function(_0x22bcd2){_0x5d0ec3=_0x22bcd2;logger[_0xf73a('0xd')](_0xf73a('0x70'),_0x5d0ec3['id']);return getTicket(_0x2df259,_0x261439,_0x5d0ec3,_0x25f763,_0x23be72,_0x25f763[_0xf73a('0x5f')],_0x318339,'Outbound');})[_0xf73a('0x2d')](function(_0x233b5c){_0x23ca23=_0x233b5c;logger[_0xf73a('0xd')](_0xf73a('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x23ca23['id']);return setRelationship(_0x318339,_0x261439,_0x23ca23,'users');})['then'](function(){return setRelationship(_0x318339,_0x5d0ec3,_0x23ca23,_0xf73a('0x63'));})[_0xf73a('0x2d')](function(){return getServerInfo(_0x318339);})[_0xf73a('0x2d')](function(_0x599be7){var _0x4afcf3=parseInt(_0x599be7['version'][_0xf73a('0x65')](0x0));var _0x22a0bb=util['format'](_0xf73a('0x71'),_0x2df259['remoteUri'],_0x23ca23['id']);if(_0x4afcf3>0x6){_0x22a0bb=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2df259[_0xf73a('0x53')],_0x23ca23['id']);}logger['info'](_0xf73a('0x6e'),_0xf73a('0x72'));emit(util['format'](_0xf73a('0x67'),_0x634c4d[_0xf73a('0xf')]),'trigger:browser:url',{'uri':_0x22a0bb});})[_0xf73a('0x69')](function(_0x53d569){logger[_0xf73a('0x6a')](_0xf73a('0x6e'),JSON[_0xf73a('0x23')](_0x53d569));});};exports[_0xf73a('0x73')]=function(_0x574d29,_0x3efbe5,_0x3cc977,_0x4a1891,_0x2af8d5,_0x3a0403){var _0x46e3e4,_0x534d9c,_0x442079,_0x3c375f;_0x3a0403[_0xf73a('0x53')]=intUtil['stripTrailingSlash'](_0x3a0403[_0xf73a('0x53')]);_0x3a0403[_0xf73a('0x55')]=intUtil[_0xf73a('0x54')](_0x3a0403[_0xf73a('0x55')]);def[_0xf73a('0x56')]=util[_0xf73a('0x25')](_0xf73a('0x6b'),_0x3a0403[_0xf73a('0x53')]);if(_0x2af8d5&&_0x2af8d5[_0xf73a('0x57')]){logger[_0xf73a('0xd')]('['+_0x3efbe5[_0xf73a('0x74')][_0xf73a('0x75')]()+']',_0xf73a('0x59'));_0x3efbe5[_0xf73a('0x5c')]=util['format'](_0xf73a('0x5a'),_0x3a0403[_0xf73a('0x55')],_0x3efbe5['uniqueid'],md5(_0x3efbe5[_0xf73a('0x5b')]));}else{_0x3efbe5[_0xf73a('0x5c')]='';}return getConnection(_0x3a0403)[_0xf73a('0x2d')](function(_0x39f029){_0x3c375f=_0x39f029;if(!_[_0xf73a('0x2a')](_0x4a1891)){return getUser(_0x3a0403,_0x4a1891[_0xf73a('0xf')],_0x3c375f);}else{return getUser(_0x3a0403,null,_0x3c375f);}})[_0xf73a('0x2d')](function(_0x581b9e){_0x46e3e4=_0x581b9e;logger[_0xf73a('0xd')](_0xf73a('0x76'),_0x46e3e4['id']);return getEndUser(_0x3a0403,_0x3efbe5[_0xf73a('0x5d')],_0x3efbe5[_0xf73a('0x5e')],_0x3c375f);})['then'](function(_0x4a76ec){_0x534d9c=_0x4a76ec;logger['info']('The\x20Enduser\x20ID\x20is:',_0x534d9c['id']);return getTicket(_0x3a0403,_0x46e3e4,_0x534d9c,_0x3cc977,_0x3efbe5,_0x3cc977[_0xf73a('0x5f')],_0x3c375f,_0xf73a('0x77'));})[_0xf73a('0x2d')](function(_0x49cdae){_0x442079=_0x49cdae;logger['info'](_0xf73a('0x60'));logger[_0xf73a('0xd')](_0xf73a('0x61'),_0x442079['id']);return setRelationship(_0x3c375f,_0x46e3e4,_0x442079,_0xf73a('0x62'));})['then'](function(){return setRelationship(_0x3c375f,_0x534d9c,_0x442079,'contacts');})[_0xf73a('0x2d')](function(){return getServerInfo(_0x3c375f);})[_0xf73a('0x69')](function(_0x12849e){logger[_0xf73a('0x6a')]('['+_0x3efbe5[_0xf73a('0x74')]['toUpperCase']()+']',JSON[_0xf73a('0x23')](_0x12849e));});}; \ 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 639c70f..3029c58 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 _0x2803=['toLowerCase','keyType','key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','lodash','util','getString','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name'];(function(_0x96691d,_0x544a9d){var _0x5a79ca=function(_0x48421a){while(--_0x48421a){_0x96691d['push'](_0x96691d['shift']());}};_0x5a79ca(++_0x544a9d);}(_0x2803,0xe4));var _0x3280=function(_0x2ac494,_0x51988c){_0x2ac494=_0x2ac494-0x0;var _0x4eb769=_0x2803[_0x2ac494];return _0x4eb769;};'use strict';var _=require(_0x3280('0x0'));var util=require(_0x3280('0x1'));exports[_0x3280('0x2')]=function(_0x1ab060,_0xf8df50,_0x319887){var _0x59926d=[];if(_0x1ab060[_0x3280('0x3')]>0x0){var _0x573238=_[_0x3280('0x4')](_0x1ab060,['id']);for(var _0x281ee1=0x0;_0x281ee1<_0x573238['length'];_0x281ee1++){var _0x11828c=_0x573238[_0x281ee1];if(_0x11828c['type']===_0x3280('0x5')){_0x59926d[_0x3280('0x6')](_0x11828c[_0x3280('0x7')]);}else if(_0x11828c[_0x3280('0x8')]===_0x3280('0x9')&&_0x11828c['variableName']){_0xf8df50[_0x11828c[_0x3280('0xa')]]&&_0x59926d[_0x3280('0x6')](_0xf8df50[_0x11828c[_0x3280('0xa')]][_0x3280('0xb')]());}else if(_0x11828c[_0x3280('0x8')]===_0x3280('0xc')&&_0x11828c['Variable']&&_0x11828c[_0x3280('0xd')][_0x3280('0xe')]){_0xf8df50[_0x11828c['Variable'][_0x3280('0xe')][_0x3280('0xf')]()]&&_0x59926d[_0x3280('0x6')](_0xf8df50[_0x11828c[_0x3280('0xd')][_0x3280('0xe')]['toLowerCase']()][_0x3280('0xb')]());}else if(_0x11828c['type']==='keyValue'){if(_0x11828c[_0x3280('0x10')]===_0x3280('0x5')&&_0x11828c[_0x3280('0x11')]){_0x59926d[_0x3280('0x6')](util['format'](_0x3280('0x12'),_0x11828c[_0x3280('0x11')],_0x11828c[_0x3280('0x13')]));}else if(_0x11828c[_0x3280('0x10')]===_0x3280('0x9')&&_0x11828c[_0x3280('0xa')]&&_0x11828c[_0x3280('0x11')]){_0xf8df50[_0x11828c[_0x3280('0xa')]]&&_0x59926d['push'](util[_0x3280('0x14')](_0x3280('0x12'),_0x11828c[_0x3280('0x11')],_0xf8df50[_0x11828c[_0x3280('0xa')]]));}else if(_0x11828c[_0x3280('0x10')]===_0x3280('0xc')&&_0x11828c[_0x3280('0xd')]&&_0x11828c[_0x3280('0xd')]['name']&&_0x11828c[_0x3280('0x11')]){_0xf8df50[_0x11828c[_0x3280('0xd')][_0x3280('0xe')]['toLowerCase']()]&&_0x59926d[_0x3280('0x6')](util[_0x3280('0x14')]('%s:\x20%s',_0x11828c[_0x3280('0x11')],_0xf8df50[_0x11828c[_0x3280('0xd')][_0x3280('0xe')][_0x3280('0xf')]()]));}}}}return _0x59926d[_0x3280('0x15')](_0x319887);};exports[_0x3280('0x16')]=function(_0x2941a2){var _0x17f98e=_0x2941a2[_0x3280('0x17')](-0x1);if(_0x17f98e==='/'){_0x2941a2=_0x2941a2[_0x3280('0x18')](0x0,_0x2941a2[_0x3280('0x19')](_0x17f98e));}return _0x2941a2;};exports['validateEmail']=function(_0x3b8a07){if(!_[_0x3280('0x1a')](_0x3b8a07)&&_0x3b8a07!==''){var _0x1bbc47=/^(([^<>()\[\]\\.,;:\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 _0x1bbc47['test'](String(_0x3b8a07)[_0x3280('0xf')]());}else{return![];}}; \ No newline at end of file +var _0x7db2=['substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','%s:\x20%s','keyContent','format','key','join','stripTrailingSlash','slice'];(function(_0x51dcbc,_0x7dabfd){var _0x4ad2e2=function(_0x47b2d4){while(--_0x47b2d4){_0x51dcbc['push'](_0x51dcbc['shift']());}};_0x4ad2e2(++_0x7dabfd);}(_0x7db2,0x154));var _0x27db=function(_0xaa7b4e,_0x40912f){_0xaa7b4e=_0xaa7b4e-0x0;var _0x561494=_0x7db2[_0xaa7b4e];return _0x561494;};'use strict';var _=require(_0x27db('0x0'));var util=require(_0x27db('0x1'));exports[_0x27db('0x2')]=function(_0x5ac347,_0x2b0bbf,_0x6af3ac){var _0x96132a=[];if(_0x5ac347[_0x27db('0x3')]>0x0){var _0x374a59=_[_0x27db('0x4')](_0x5ac347,['id']);for(var _0x307bc8=0x0;_0x307bc8<_0x374a59[_0x27db('0x3')];_0x307bc8++){var _0x2783a8=_0x374a59[_0x307bc8];if(_0x2783a8[_0x27db('0x5')]===_0x27db('0x6')){_0x96132a[_0x27db('0x7')](_0x2783a8['content']);}else if(_0x2783a8[_0x27db('0x5')]===_0x27db('0x8')&&_0x2783a8[_0x27db('0x9')]){_0x2b0bbf[_0x2783a8['variableName']]&&_0x96132a[_0x27db('0x7')](_0x2b0bbf[_0x2783a8[_0x27db('0x9')]][_0x27db('0xa')]());}else if(_0x2783a8[_0x27db('0x5')]===_0x27db('0xb')&&_0x2783a8['Variable']&&_0x2783a8[_0x27db('0xc')][_0x27db('0xd')]){_0x2b0bbf[_0x2783a8[_0x27db('0xc')][_0x27db('0xd')][_0x27db('0xe')]()]&&_0x96132a[_0x27db('0x7')](_0x2b0bbf[_0x2783a8[_0x27db('0xc')][_0x27db('0xd')][_0x27db('0xe')]()][_0x27db('0xa')]());}else if(_0x2783a8[_0x27db('0x5')]===_0x27db('0xf')){if(_0x2783a8[_0x27db('0x10')]==='string'&&_0x2783a8['key']){_0x96132a[_0x27db('0x7')](util['format'](_0x27db('0x11'),_0x2783a8['key'],_0x2783a8[_0x27db('0x12')]));}else if(_0x2783a8[_0x27db('0x10')]===_0x27db('0x8')&&_0x2783a8[_0x27db('0x9')]&&_0x2783a8['key']){_0x2b0bbf[_0x2783a8[_0x27db('0x9')]]&&_0x96132a[_0x27db('0x7')](util[_0x27db('0x13')](_0x27db('0x11'),_0x2783a8[_0x27db('0x14')],_0x2b0bbf[_0x2783a8[_0x27db('0x9')]]));}else if(_0x2783a8['keyType']===_0x27db('0xb')&&_0x2783a8[_0x27db('0xc')]&&_0x2783a8[_0x27db('0xc')][_0x27db('0xd')]&&_0x2783a8[_0x27db('0x14')]){_0x2b0bbf[_0x2783a8[_0x27db('0xc')][_0x27db('0xd')][_0x27db('0xe')]()]&&_0x96132a[_0x27db('0x7')](util[_0x27db('0x13')](_0x27db('0x11'),_0x2783a8[_0x27db('0x14')],_0x2b0bbf[_0x2783a8['Variable'][_0x27db('0xd')][_0x27db('0xe')]()]));}}}}return _0x96132a[_0x27db('0x15')](_0x6af3ac);};exports[_0x27db('0x16')]=function(_0x250b07){var _0x4746dd=_0x250b07[_0x27db('0x17')](-0x1);if(_0x4746dd==='/'){_0x250b07=_0x250b07[_0x27db('0x18')](0x0,_0x250b07[_0x27db('0x19')](_0x4746dd));}return _0x250b07;};exports['validateEmail']=function(_0x2c322e){if(!_[_0x27db('0x1a')](_0x2c322e)&&_0x2c322e!==''){var _0x38773e=/^(([^<>()\[\]\\.,;:\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 _0x38773e[_0x27db('0x1b')](String(_0x2c322e)[_0x27db('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 fb73055..84fed9e 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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0xddfbc6,_0x1e1f7f){var _0x28a264=function(_0x2c5a28){while(--_0x2c5a28){_0xddfbc6['push'](_0xddfbc6['shift']());}};_0x28a264(++_0x1e1f7f);}(_0x34e8,0x12c));var _0x834e=function(_0x5a8582,_0x4515a3){_0x5a8582=_0x5a8582-0x0;var _0x55073e=_0x34e8[_0x5a8582];return _0x55073e;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 4375a2f..a540743 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 _0xd06c=['Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Searching\x20enduser\x20with\x20phone','%s/search.json','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','password','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','string','picklist','nameField','includes','idField','customField','custom_fields','push','content','type','variable','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','email','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','./util','../../../../config/environment','zendesk','defaults','localhost','socket.io-emitter','redis','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','merge','Tags','name','getString','Subjects','Fields','then','Ticket\x20created!'];(function(_0x33737c,_0x5b9480){var _0x3980ce=function(_0x25873c){while(--_0x25873c){_0x33737c['push'](_0x33737c['shift']());}};_0x3980ce(++_0x5b9480);}(_0xd06c,0x1a9));var _0xcd06=function(_0x15517b,_0x503782){_0x15517b=_0x15517b-0x0;var _0x365ac6=_0xd06c[_0x15517b];return _0x365ac6;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xcd06('0x0'));var util=require(_0xcd06('0x1'));var Redis=require(_0xcd06('0x2'));var intUtil=require(_0xcd06('0x3'));var config=require(_0xcd06('0x4'));var logger=require('../../../../config/logger')(_0xcd06('0x5'));config['redis']=_[_0xcd06('0x6')](config['redis'],{'host':_0xcd06('0x7'),'port':0x18eb});var io=require(_0xcd06('0x8'))(new Redis(config[_0xcd06('0x9')]));function emit(_0x5de857,_0x1557b6,_0x16a082){io['to'](_0x5de857)[_0xcd06('0xa')](_0x1557b6,_0x16a082);}var headers={'Content-Type':_0xcd06('0xb'),'Accept':_0xcd06('0xb')};function getTicket(_0x5ee7e3,_0x589197,_0x3f921d,_0x36e503,_0x2a8064){logger[_0xcd06('0xc')](_0xcd06('0xd'));return request({'uri':util['format'](_0xcd06('0xe'),_0x5ee7e3['remoteUri']),'method':'POST','body':{'ticket':_[_0xcd06('0xf')]({'requester_id':_0x3f921d['id'],'submitter_id':_0x589197?_0x589197['id']:undefined,'assignee_id':_0x589197?_0x589197['id']:undefined,'tags':getTags(_0x36e503[_0xcd06('0x10')],_0xcd06('0x11')),'subject':intUtil[_0xcd06('0x12')](_0x36e503[_0xcd06('0x13')],_0x2a8064,'\x20'),'description':intUtil['getString'](_0x36e503['Descriptions'],_0x2a8064,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x36e503['Descriptions'],_0x2a8064,'\x0a')}},getCustomFields(_0x36e503[_0xcd06('0x14')],_0x2a8064))}})[_0xcd06('0x15')](function(_0x36f02e){logger[_0xcd06('0xc')](_0xcd06('0x16'));return _0x36f02e['ticket'];});}function getUser(_0x2fa2e4,_0x49e291){if(intUtil['validateEmail'](_0x49e291)){logger[_0xcd06('0xc')](_0xcd06('0x17'),_0x49e291);return request({'uri':util[_0xcd06('0x18')]('%s/search.json',_0x2fa2e4['remoteUri']),'qs':{'query':util[_0xcd06('0x18')](_0xcd06('0x19'),_0x49e291)}})[_0xcd06('0x15')](function(_0x3d44f6){if(_0x3d44f6[_0xcd06('0x1a')]){logger['info'](_0xcd06('0x1b'));return _[_0xcd06('0x1c')](_0x3d44f6[_0xcd06('0x1d')],{'email':_0x49e291,'role':_0xcd06('0x1e')});}else{logger[_0xcd06('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcd06('0x18')]('%s/users/me.json',_0x2fa2e4['remoteUri'])})[_0xcd06('0x15')](function(_0x184a1e){logger[_0xcd06('0xc')]('Admin\x20account\x20selected.');return _0x184a1e[_0xcd06('0x1f')];});}});}else{logger['info'](_0xcd06('0x20'));return request({'uri':util[_0xcd06('0x18')](_0xcd06('0x21'),_0x2fa2e4[_0xcd06('0x22')])})[_0xcd06('0x15')](function(_0x5bd8ba){logger[_0xcd06('0xc')]('Admin\x20account\x20selected.');return _0x5bd8ba[_0xcd06('0x1f')];});}}function getEndUser(_0x2221ed,_0x2a5a01,_0x770e4a){logger['info'](_0xcd06('0x23'),_0x770e4a);return request({'uri':util['format'](_0xcd06('0x24'),_0x2221ed['remoteUri']),'qs':{'query':util[_0xcd06('0x18')]('type:user\x20role:end-user\x20phone:%s',_0x770e4a)}})[_0xcd06('0x15')](function(_0x3e1238){var _0x4d2f29;if(_0x3e1238['results']['length']){_0x3e1238[_0xcd06('0x1d')]=_[_0xcd06('0x25')](_0x3e1238[_0xcd06('0x1d')],{'suspended':![],'role':_0xcd06('0x26')});if(_0x3e1238[_0xcd06('0x1d')][_0xcd06('0x27')]){_0x4d2f29=_[_0xcd06('0x28')](_0x3e1238[_0xcd06('0x1d')]);}}if(_0x4d2f29){logger['info'](_0xcd06('0x29'));return _0x4d2f29;}else{logger[_0xcd06('0xc')](_0xcd06('0x2a'));return request({'uri':util[_0xcd06('0x18')](_0xcd06('0x2b'),_0x2221ed['remoteUri']),'method':_0xcd06('0x2c'),'body':{'user':{'role':_0xcd06('0x26'),'name':util[_0xcd06('0x18')](_0xcd06('0x2d'),_0x2a5a01||_0x770e4a),'phone':_0x770e4a}}})[_0xcd06('0x15')](function(_0x3ab5bc){logger[_0xcd06('0xc')]('Enduser\x20created.');return _0x3ab5bc['user'];});}});}function getAuth(_0x5aaecf){var _0x1b3528;if(_0x5aaecf['authType']===_0xcd06('0x2e')){_0x1b3528=util['format']('%s:%s',_0x5aaecf[_0xcd06('0x2f')],_0x5aaecf[_0xcd06('0x2e')]);}else if(_0x5aaecf[_0xcd06('0x30')]===_0xcd06('0x31')){_0x1b3528=util[_0xcd06('0x18')](_0xcd06('0x32'),_0x5aaecf[_0xcd06('0x2f')],_0x5aaecf['token']);}return util[_0xcd06('0x18')](_0xcd06('0x33'),new Buffer(_0x1b3528)[_0xcd06('0x34')](_0xcd06('0x35')));}function request(_0xdbd8df){logger['debug'](_0xcd06('0x36'),JSON[_0xcd06('0x37')](_0xdbd8df));return rp(_['defaults'](_0xdbd8df,{'method':_0xcd06('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x1141fd,_0x1e0b02){var _0x1842fb=[];if(_0x1141fd&&_0x1141fd[_0xcd06('0x27')]>0x0){_0x1842fb=_[_0xcd06('0x39')](_0x1141fd,_0x1e0b02);}return _0x1842fb;}function getCustomFields(_0x5ddab1,_0xf9eaac){var _0x12d567=[];var _0x341bb8={'custom_fields':[]};if(_0x5ddab1['length']>0x0){_[_0xcd06('0x3a')](_0x5ddab1,function(_0x4e8ed8){if(_['includes']([_0xcd06('0x3b'),_0xcd06('0x3c')],_0x4e8ed8['type'])&&_0x4e8ed8[_0xcd06('0x3d')]&&!_0x4e8ed8['customField']){_0x341bb8[_0x4e8ed8[_0xcd06('0x3d')]['toLowerCase']()]=_0x4e8ed8['content'][_0xcd06('0x34')]();}else if(_[_0xcd06('0x3e')]([_0xcd06('0x3b'),_0xcd06('0x3c')],_0x4e8ed8['type'])&&_0x4e8ed8[_0xcd06('0x3f')]&&_0x4e8ed8[_0xcd06('0x40')]){_0x341bb8[_0xcd06('0x41')][_0xcd06('0x42')]({'id':_0x4e8ed8[_0xcd06('0x3f')],'value':_0x4e8ed8[_0xcd06('0x43')]['toString']()});}else if(_0x4e8ed8[_0xcd06('0x44')]===_0xcd06('0x45')&&_0x4e8ed8[_0xcd06('0x46')]&&_0x4e8ed8[_0xcd06('0x3f')]&&_0x4e8ed8[_0xcd06('0x40')]){_0xf9eaac[_0x4e8ed8[_0xcd06('0x46')]]&&_0x341bb8[_0xcd06('0x41')][_0xcd06('0x42')]({'id':_0x4e8ed8['idField'],'value':_0xf9eaac[_0x4e8ed8[_0xcd06('0x46')]][_0xcd06('0x34')]()});}else if(_0x4e8ed8[_0xcd06('0x44')]===_0xcd06('0x47')&&_0x4e8ed8[_0xcd06('0x48')]&&_0x4e8ed8[_0xcd06('0x48')][_0xcd06('0x11')]&&_0x4e8ed8[_0xcd06('0x3f')]&&_0x4e8ed8[_0xcd06('0x40')]){_0xf9eaac[_0x4e8ed8[_0xcd06('0x48')][_0xcd06('0x11')]['toLowerCase']()]&&_0x341bb8[_0xcd06('0x41')][_0xcd06('0x42')]({'id':_0x4e8ed8['idField'],'value':_0xf9eaac[_0x4e8ed8[_0xcd06('0x48')][_0xcd06('0x11')][_0xcd06('0x49')]()][_0xcd06('0x34')]()});}});}return _0x341bb8;}exports['queue']=function(_0x559552,_0x578a87,_0x2e2b40,_0xe3810d,_0x4a390f,_0x4943a9){var _0x8b0add,_0x1085b8;_0x4943a9[_0xcd06('0x22')]=intUtil[_0xcd06('0x4a')](_0x4943a9[_0xcd06('0x22')]);_0x4943a9[_0xcd06('0x4b')]=intUtil[_0xcd06('0x4a')](_0x4943a9[_0xcd06('0x4b')]);if(_0x4a390f&&_0x4a390f['monitor_format']){logger[_0xcd06('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x578a87[_0xcd06('0x4c')]=util[_0xcd06('0x18')](_0xcd06('0x4d'),_0x4943a9['serverUrl'],_0x578a87['uniqueid'],md5(_0x578a87['uniqueid']));}else{_0x578a87['recordingURL']='';}headers[_0xcd06('0x4e')]=getAuth(_0x4943a9);return getUser(_0x4943a9,_0xe3810d['email'])[_0xcd06('0x15')](function(_0x405174){_0x8b0add=_0x405174;logger['info'](_0xcd06('0x4f'),_0x8b0add['id']);return getEndUser(_0x4943a9,_0x578a87[_0xcd06('0x50')],_0x578a87[_0xcd06('0x51')]);})[_0xcd06('0x15')](function(_0x88cc57){_0x1085b8=_0x88cc57;logger[_0xcd06('0xc')](_0xcd06('0x52'),_0x1085b8['id']);return getTicket(_0x4943a9,_0x8b0add,_0x1085b8,_0x2e2b40,_0x578a87);})['then'](function(_0x3e70e0){if(_0x3e70e0){logger[_0xcd06('0xc')](_0xcd06('0x53'),_0x3e70e0['id']);switch(_0x4943a9['type']){case _0xcd06('0x54'):logger[_0xcd06('0xc')]('[QUEUE]',_0xcd06('0x55'));return request({'uri':util['format'](_0xcd06('0x56'),_0x4943a9['remoteUri'],_0x8b0add['id'],_0x3e70e0['id']),'method':'POST'});case _0xcd06('0x57'):logger[_0xcd06('0xc')](_0xcd06('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcd06('0x18')](_0xcd06('0x59'),_0xe3810d[_0xcd06('0x11')]),_0xcd06('0x5a'),{'uri':util['format'](_0xcd06('0x5b'),_0x4943a9[_0xcd06('0x22')][_0xcd06('0x5c')](_0xcd06('0x5d'),''),_0x3e70e0['id'])});break;default:logger[_0xcd06('0x5e')](_0xcd06('0x58'),_0xcd06('0x5f'));}}})[_0xcd06('0x60')](function(_0x2a006f){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xcd06('0x61')](_0x2a006f,{'showHidden':!![],'depth':null}));});};exports[_0xcd06('0x62')]=function(_0x1cbc3a,_0x19aa6a,_0xe47078,_0x21cc13,_0x4bc84f,_0x268d86,_0x2dc0aa){var _0x23d5af,_0x49bcd2;_0x268d86[_0xcd06('0x22')]=intUtil['stripTrailingSlash'](_0x268d86[_0xcd06('0x22')]);_0x268d86[_0xcd06('0x4b')]=intUtil[_0xcd06('0x4a')](_0x268d86['serverUrl']);if(_0x2dc0aa&&_0x2dc0aa[_0xcd06('0x63')]&&_0x2dc0aa[_0xcd06('0x63')]!=='none'){logger[_0xcd06('0xc')](_0xcd06('0x64'),_0xcd06('0x65'));_0x19aa6a['recordingURL']=util[_0xcd06('0x18')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x268d86[_0xcd06('0x4b')],_0x19aa6a[_0xcd06('0x66')],md5(_0x19aa6a[_0xcd06('0x66')]));}headers[_0xcd06('0x4e')]=getAuth(_0x268d86);return getUser(_0x268d86,_0x21cc13[_0xcd06('0x67')])['then'](function(_0x6bbfb3){_0x23d5af=_0x6bbfb3;logger[_0xcd06('0xc')](_0xcd06('0x4f'),_0x23d5af['id']);return getEndUser(_0x268d86,_0x19aa6a[_0xcd06('0x68')],_0x19aa6a[_0xcd06('0x69')]);})[_0xcd06('0x15')](function(_0x339406){_0x49bcd2=_0x339406;logger[_0xcd06('0xc')]('The\x20Enduser\x20ID\x20is:',_0x49bcd2['id']);return getTicket(_0x268d86,_0x23d5af,_0x49bcd2,_0xe47078,_0x19aa6a);})['then'](function(_0x4cac94){if(_0x4cac94){logger[_0xcd06('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4cac94['id']);switch(_0x268d86['type']){case _0xcd06('0x54'):logger[_0xcd06('0xc')]('[OUTBOUND]',_0xcd06('0x55'));return request({'uri':util[_0xcd06('0x18')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x268d86[_0xcd06('0x22')],_0x23d5af['id'],_0x4cac94['id']),'method':'POST'});case _0xcd06('0x57'):logger[_0xcd06('0xc')](_0xcd06('0x64'),_0xcd06('0x6a'));emit(util[_0xcd06('0x18')](_0xcd06('0x59'),_0x21cc13['name']),_0xcd06('0x5a'),{'uri':util[_0xcd06('0x18')](_0xcd06('0x5b'),_0x268d86[_0xcd06('0x22')][_0xcd06('0x5c')](_0xcd06('0x5d'),''),_0x4cac94['id'])});break;default:logger[_0xcd06('0x5e')](_0xcd06('0x64'),_0xcd06('0x5f'));}}})['catch'](function(_0x50009a){logger[_0xcd06('0x5e')](_0xcd06('0x6b'),util[_0xcd06('0x61')](_0x50009a,{'showHidden':!![],'depth':null}));});};exports[_0xcd06('0x6c')]=function(_0x33a352,_0x4c8914,_0x50f6c8,_0x2e41e5,_0x290073,_0x1f5f1c){var _0x3ec335,_0x37ce4a;_0x1f5f1c[_0xcd06('0x22')]=intUtil[_0xcd06('0x4a')](_0x1f5f1c[_0xcd06('0x22')]);_0x1f5f1c[_0xcd06('0x4b')]=intUtil[_0xcd06('0x4a')](_0x1f5f1c[_0xcd06('0x4b')]);if(_0x290073&&_0x290073['monitor_format']){logger[_0xcd06('0xc')]('['+_0x4c8914[_0xcd06('0x6d')][_0xcd06('0x6e')]()+']',_0xcd06('0x65'));_0x4c8914[_0xcd06('0x4c')]=util[_0xcd06('0x18')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f5f1c[_0xcd06('0x4b')],_0x4c8914[_0xcd06('0x66')],md5(_0x4c8914['uniqueid']));}else{_0x4c8914[_0xcd06('0x4c')]='';}headers[_0xcd06('0x4e')]=getAuth(_0x1f5f1c);return getUser(_0x1f5f1c)['then'](function(_0x32adf6){_0x3ec335=_0x32adf6;logger[_0xcd06('0xc')](_0xcd06('0x4f'),_0x3ec335['id']);return getEndUser(_0x1f5f1c,_0x4c8914[_0xcd06('0x50')],_0x4c8914[_0xcd06('0x51')]);})['then'](function(_0x55dffc){_0x37ce4a=_0x55dffc;logger[_0xcd06('0xc')]('The\x20Enduser\x20ID\x20is:',_0x37ce4a['id']);return getTicket(_0x1f5f1c,_0x3ec335,_0x37ce4a,_0x50f6c8,_0x4c8914);})['then'](function(_0x1513ac){if(_0x1513ac){logger['info'](_0xcd06('0x53'),_0x1513ac['id']);}})[_0xcd06('0x60')](function(_0x389905){logger['error']('['+_0x4c8914[_0xcd06('0x6d')][_0xcd06('0x6e')]()+']'+_0xcd06('0x6f'),util[_0xcd06('0x61')](_0x389905,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf92d=['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','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','Recording\x20is\x20enabled!','Authorization','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','format','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','username','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','picklist','type','customField','toLowerCase','content','includes','idField','custom_fields','variable','variableName','push','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...'];(function(_0x3a347b,_0x5a9a7a){var _0x12cd00=function(_0x877674){while(--_0x877674){_0x3a347b['push'](_0x3a347b['shift']());}};_0x12cd00(++_0x5a9a7a);}(_0xf92d,0xec));var _0xdf92=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xf92d[_0xc77819];return _0x1c9434;};'use strict';var _=require(_0xdf92('0x0'));var rp=require('request-promise');var md5=require(_0xdf92('0x1'));var util=require(_0xdf92('0x2'));var Redis=require(_0xdf92('0x3'));var intUtil=require(_0xdf92('0x4'));var config=require(_0xdf92('0x5'));var logger=require('../../../../config/logger')('zendesk');config[_0xdf92('0x6')]=_[_0xdf92('0x7')](config[_0xdf92('0x6')],{'host':_0xdf92('0x8'),'port':0x18eb});var io=require(_0xdf92('0x9'))(new Redis(config['redis']));function emit(_0x5e0dc6,_0x4d665a,_0x39592f){io['to'](_0x5e0dc6)[_0xdf92('0xa')](_0x4d665a,_0x39592f);}var headers={'Content-Type':_0xdf92('0xb'),'Accept':_0xdf92('0xb')};function getTicket(_0x391d04,_0x5a75db,_0x5e0bd0,_0x19c0aa,_0x6556ea){logger[_0xdf92('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xdf92('0xd')]('%s/tickets.json',_0x391d04[_0xdf92('0xe')]),'method':_0xdf92('0xf'),'body':{'ticket':_[_0xdf92('0x10')]({'requester_id':_0x5e0bd0['id'],'submitter_id':_0x5a75db?_0x5a75db['id']:undefined,'assignee_id':_0x5a75db?_0x5a75db['id']:undefined,'tags':getTags(_0x19c0aa[_0xdf92('0x11')],'name'),'subject':intUtil[_0xdf92('0x12')](_0x19c0aa[_0xdf92('0x13')],_0x6556ea,'\x20'),'description':intUtil[_0xdf92('0x12')](_0x19c0aa[_0xdf92('0x14')],_0x6556ea,'\x0a'),'comment':{'public':![],'body':intUtil[_0xdf92('0x12')](_0x19c0aa['Descriptions'],_0x6556ea,'\x0a')}},getCustomFields(_0x19c0aa['Fields'],_0x6556ea))}})[_0xdf92('0x15')](function(_0x24d054){logger[_0xdf92('0xc')](_0xdf92('0x16'));return _0x24d054[_0xdf92('0x17')];});}function getUser(_0x20e706,_0x323771){if(intUtil['validateEmail'](_0x323771)){logger[_0xdf92('0xc')](_0xdf92('0x18'),_0x323771);return request({'uri':util['format'](_0xdf92('0x19'),_0x20e706['remoteUri']),'qs':{'query':util[_0xdf92('0xd')](_0xdf92('0x1a'),_0x323771)}})[_0xdf92('0x15')](function(_0x4e217b){if(_0x4e217b[_0xdf92('0x1b')]){logger[_0xdf92('0xc')](_0xdf92('0x1c'));return _['find'](_0x4e217b[_0xdf92('0x1d')],{'email':_0x323771,'role':_0xdf92('0x1e')});}else{logger[_0xdf92('0xc')](_0xdf92('0x1f'));return request({'uri':util[_0xdf92('0xd')](_0xdf92('0x20'),_0x20e706['remoteUri'])})[_0xdf92('0x15')](function(_0x891582){logger[_0xdf92('0xc')](_0xdf92('0x21'));return _0x891582[_0xdf92('0x22')];});}});}else{logger[_0xdf92('0xc')](_0xdf92('0x1f'));return request({'uri':util[_0xdf92('0xd')](_0xdf92('0x20'),_0x20e706['remoteUri'])})[_0xdf92('0x15')](function(_0x593088){logger[_0xdf92('0xc')](_0xdf92('0x21'));return _0x593088[_0xdf92('0x22')];});}}function getEndUser(_0x58ea45,_0x4ff0a6,_0x4bde55){logger['info'](_0xdf92('0x23'),_0x4bde55);return request({'uri':util['format'](_0xdf92('0x19'),_0x58ea45[_0xdf92('0xe')]),'qs':{'query':util[_0xdf92('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x4bde55)}})[_0xdf92('0x15')](function(_0x130711){var _0x181608;if(_0x130711['results'][_0xdf92('0x24')]){_0x130711[_0xdf92('0x1d')]=_[_0xdf92('0x25')](_0x130711[_0xdf92('0x1d')],{'suspended':![],'role':_0xdf92('0x26')});if(_0x130711[_0xdf92('0x1d')][_0xdf92('0x24')]){_0x181608=_['first'](_0x130711[_0xdf92('0x1d')]);}}if(_0x181608){logger[_0xdf92('0xc')](_0xdf92('0x27'));return _0x181608;}else{logger[_0xdf92('0xc')](_0xdf92('0x28'));return request({'uri':util[_0xdf92('0xd')](_0xdf92('0x29'),_0x58ea45[_0xdf92('0xe')]),'method':_0xdf92('0xf'),'body':{'user':{'role':'end-user','name':util[_0xdf92('0xd')](_0xdf92('0x2a'),_0x4ff0a6||_0x4bde55),'phone':_0x4bde55}}})['then'](function(_0x3fee08){logger[_0xdf92('0xc')]('Enduser\x20created.');return _0x3fee08[_0xdf92('0x22')];});}});}function getAuth(_0x59fc5f){var _0xb3ccad;if(_0x59fc5f['authType']==='password'){_0xb3ccad=util['format']('%s:%s',_0x59fc5f[_0xdf92('0x2b')],_0x59fc5f['password']);}else if(_0x59fc5f['authType']==='token'){_0xb3ccad=util[_0xdf92('0xd')](_0xdf92('0x2c'),_0x59fc5f[_0xdf92('0x2b')],_0x59fc5f[_0xdf92('0x2d')]);}return util[_0xdf92('0xd')](_0xdf92('0x2e'),new Buffer(_0xb3ccad)[_0xdf92('0x2f')](_0xdf92('0x30')));}function request(_0x151326){logger[_0xdf92('0x31')](_0xdf92('0x32'),JSON[_0xdf92('0x33')](_0x151326));return rp(_[_0xdf92('0x7')](_0x151326,{'method':_0xdf92('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x252f19,_0x71a33){var _0x53dcce=[];if(_0x252f19&&_0x252f19[_0xdf92('0x24')]>0x0){_0x53dcce=_[_0xdf92('0x35')](_0x252f19,_0x71a33);}return _0x53dcce;}function getCustomFields(_0x221abe,_0x5c6251){var _0x5f0e9a=[];var _0x3f0915={'custom_fields':[]};if(_0x221abe['length']>0x0){_['forEach'](_0x221abe,function(_0x5166f3){if(_['includes'](['string',_0xdf92('0x36')],_0x5166f3[_0xdf92('0x37')])&&_0x5166f3['nameField']&&!_0x5166f3[_0xdf92('0x38')]){_0x3f0915[_0x5166f3['nameField'][_0xdf92('0x39')]()]=_0x5166f3[_0xdf92('0x3a')][_0xdf92('0x2f')]();}else if(_[_0xdf92('0x3b')](['string',_0xdf92('0x36')],_0x5166f3['type'])&&_0x5166f3[_0xdf92('0x3c')]&&_0x5166f3[_0xdf92('0x38')]){_0x3f0915[_0xdf92('0x3d')]['push']({'id':_0x5166f3[_0xdf92('0x3c')],'value':_0x5166f3[_0xdf92('0x3a')][_0xdf92('0x2f')]()});}else if(_0x5166f3[_0xdf92('0x37')]===_0xdf92('0x3e')&&_0x5166f3[_0xdf92('0x3f')]&&_0x5166f3[_0xdf92('0x3c')]&&_0x5166f3[_0xdf92('0x38')]){_0x5c6251[_0x5166f3[_0xdf92('0x3f')]]&&_0x3f0915[_0xdf92('0x3d')][_0xdf92('0x40')]({'id':_0x5166f3[_0xdf92('0x3c')],'value':_0x5c6251[_0x5166f3[_0xdf92('0x3f')]]['toString']()});}else if(_0x5166f3[_0xdf92('0x37')]===_0xdf92('0x41')&&_0x5166f3[_0xdf92('0x42')]&&_0x5166f3[_0xdf92('0x42')][_0xdf92('0x43')]&&_0x5166f3[_0xdf92('0x3c')]&&_0x5166f3['customField']){_0x5c6251[_0x5166f3[_0xdf92('0x42')][_0xdf92('0x43')][_0xdf92('0x39')]()]&&_0x3f0915[_0xdf92('0x3d')][_0xdf92('0x40')]({'id':_0x5166f3[_0xdf92('0x3c')],'value':_0x5c6251[_0x5166f3[_0xdf92('0x42')][_0xdf92('0x43')][_0xdf92('0x39')]()]['toString']()});}});}return _0x3f0915;}exports[_0xdf92('0x44')]=function(_0x1b7759,_0x213991,_0x336742,_0x1fa629,_0x588aed,_0x4e1fd5){var _0x44a027,_0x3938eb;_0x4e1fd5[_0xdf92('0xe')]=intUtil[_0xdf92('0x45')](_0x4e1fd5['remoteUri']);_0x4e1fd5[_0xdf92('0x46')]=intUtil[_0xdf92('0x45')](_0x4e1fd5[_0xdf92('0x46')]);if(_0x588aed&&_0x588aed[_0xdf92('0x47')]){logger[_0xdf92('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x213991[_0xdf92('0x48')]=util[_0xdf92('0xd')](_0xdf92('0x49'),_0x4e1fd5[_0xdf92('0x46')],_0x213991[_0xdf92('0x4a')],md5(_0x213991[_0xdf92('0x4a')]));}else{_0x213991[_0xdf92('0x48')]='';}headers['Authorization']=getAuth(_0x4e1fd5);return getUser(_0x4e1fd5,_0x1fa629[_0xdf92('0x4b')])[_0xdf92('0x15')](function(_0x29b9b2){_0x44a027=_0x29b9b2;logger[_0xdf92('0xc')](_0xdf92('0x4c'),_0x44a027['id']);return getEndUser(_0x4e1fd5,_0x213991[_0xdf92('0x4d')],_0x213991['calleridnum']);})[_0xdf92('0x15')](function(_0x4a7627){_0x3938eb=_0x4a7627;logger['info'](_0xdf92('0x4e'),_0x3938eb['id']);return getTicket(_0x4e1fd5,_0x44a027,_0x3938eb,_0x336742,_0x213991);})[_0xdf92('0x15')](function(_0x4c20c4){if(_0x4c20c4){logger[_0xdf92('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4c20c4['id']);switch(_0x4e1fd5['type']){case _0xdf92('0x4f'):logger['info'](_0xdf92('0x50'),_0xdf92('0x51'));return request({'uri':util[_0xdf92('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e1fd5['remoteUri'],_0x44a027['id'],_0x4c20c4['id']),'method':_0xdf92('0xf')});case _0xdf92('0x52'):logger['info'](_0xdf92('0x50'),_0xdf92('0x53'));emit(util[_0xdf92('0xd')](_0xdf92('0x54'),_0x1fa629[_0xdf92('0x43')]),_0xdf92('0x55'),{'uri':util[_0xdf92('0xd')](_0xdf92('0x56'),_0x4e1fd5[_0xdf92('0xe')]['replace'](_0xdf92('0x57'),''),_0x4c20c4['id'])});break;default:logger[_0xdf92('0x58')](_0xdf92('0x50'),_0xdf92('0x59'));}}})[_0xdf92('0x5a')](function(_0x327f6e){logger[_0xdf92('0x58')](_0xdf92('0x5b'),util[_0xdf92('0x5c')](_0x327f6e,{'showHidden':!![],'depth':null}));});};exports[_0xdf92('0x5d')]=function(_0x329bb5,_0x2ee7f7,_0xc9996c,_0xc41ac3,_0x23dffa,_0x41018c,_0x4734d6){var _0x113aae,_0x1631b3;_0x41018c[_0xdf92('0xe')]=intUtil[_0xdf92('0x45')](_0x41018c[_0xdf92('0xe')]);_0x41018c[_0xdf92('0x46')]=intUtil['stripTrailingSlash'](_0x41018c[_0xdf92('0x46')]);if(_0x4734d6&&_0x4734d6[_0xdf92('0x5e')]&&_0x4734d6[_0xdf92('0x5e')]!==_0xdf92('0x5f')){logger['info'](_0xdf92('0x60'),'Recording\x20is\x20enabled!');_0x2ee7f7['recordingURL']=util['format'](_0xdf92('0x49'),_0x41018c[_0xdf92('0x46')],_0x2ee7f7['uniqueid'],md5(_0x2ee7f7[_0xdf92('0x4a')]));}headers['Authorization']=getAuth(_0x41018c);return getUser(_0x41018c,_0xc41ac3[_0xdf92('0x4b')])[_0xdf92('0x15')](function(_0x317e89){_0x113aae=_0x317e89;logger[_0xdf92('0xc')](_0xdf92('0x4c'),_0x113aae['id']);return getEndUser(_0x41018c,_0x2ee7f7[_0xdf92('0x61')],_0x2ee7f7['destcalleridnum']);})[_0xdf92('0x15')](function(_0x425e93){_0x1631b3=_0x425e93;logger[_0xdf92('0xc')](_0xdf92('0x4e'),_0x1631b3['id']);return getTicket(_0x41018c,_0x113aae,_0x1631b3,_0xc9996c,_0x2ee7f7);})[_0xdf92('0x15')](function(_0x4666d0){if(_0x4666d0){logger[_0xdf92('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4666d0['id']);switch(_0x41018c[_0xdf92('0x37')]){case _0xdf92('0x4f'):logger['info'](_0xdf92('0x60'),_0xdf92('0x51'));return request({'uri':util[_0xdf92('0xd')](_0xdf92('0x62'),_0x41018c['remoteUri'],_0x113aae['id'],_0x4666d0['id']),'method':_0xdf92('0xf')});case _0xdf92('0x52'):logger[_0xdf92('0xc')](_0xdf92('0x60'),_0xdf92('0x53'));emit(util[_0xdf92('0xd')](_0xdf92('0x54'),_0xc41ac3[_0xdf92('0x43')]),_0xdf92('0x55'),{'uri':util[_0xdf92('0xd')](_0xdf92('0x56'),_0x41018c[_0xdf92('0xe')]['replace'](_0xdf92('0x57'),''),_0x4666d0['id'])});break;default:logger[_0xdf92('0x58')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xdf92('0x5a')](function(_0x564d1c){logger[_0xdf92('0x58')](_0xdf92('0x63'),util['inspect'](_0x564d1c,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x1e73d0,_0x5b817b,_0x21bfae,_0x5200bf,_0x2c4b3d,_0x106282){var _0x39d3bb,_0x517dc1;_0x106282['remoteUri']=intUtil['stripTrailingSlash'](_0x106282[_0xdf92('0xe')]);_0x106282['serverUrl']=intUtil['stripTrailingSlash'](_0x106282[_0xdf92('0x46')]);if(_0x2c4b3d&&_0x2c4b3d['monitor_format']){logger[_0xdf92('0xc')]('['+_0x5b817b[_0xdf92('0x64')][_0xdf92('0x65')]()+']',_0xdf92('0x66'));_0x5b817b[_0xdf92('0x48')]=util['format'](_0xdf92('0x49'),_0x106282[_0xdf92('0x46')],_0x5b817b['uniqueid'],md5(_0x5b817b[_0xdf92('0x4a')]));}else{_0x5b817b[_0xdf92('0x48')]='';}headers[_0xdf92('0x67')]=getAuth(_0x106282);return getUser(_0x106282)[_0xdf92('0x15')](function(_0x568367){_0x39d3bb=_0x568367;logger[_0xdf92('0xc')]('The\x20User\x20ID\x20is:',_0x39d3bb['id']);return getEndUser(_0x106282,_0x5b817b[_0xdf92('0x4d')],_0x5b817b['calleridnum']);})['then'](function(_0x16a348){_0x517dc1=_0x16a348;logger[_0xdf92('0xc')]('The\x20Enduser\x20ID\x20is:',_0x517dc1['id']);return getTicket(_0x106282,_0x39d3bb,_0x517dc1,_0x21bfae,_0x5b817b);})['then'](function(_0x1448b5){if(_0x1448b5){logger[_0xdf92('0xc')](_0xdf92('0x68'),_0x1448b5['id']);}})[_0xdf92('0x5a')](function(_0x2f49e6){logger[_0xdf92('0x58')]('['+_0x5b817b[_0xdf92('0x64')]['toUpperCase']()+']'+_0xdf92('0x69'),util[_0xdf92('0x5c')](_0x2f49e6,{'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 dd31898..0d91996 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 _0xc7fa=['split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','error','Failing\x20creating\x20the\x20access_token','info','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','catch','https://www.zohoapis.','startCase','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','Contacts','moduleCreate','lead','Owner','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','$se_module','talktime','Call_Duration','mm:ss','endtime','utc','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','complete','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','zoho.eu','com','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','calleridname','lodash','request-promise','md5','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','includes','string','picklist','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','indexOf'];(function(_0x26a10d,_0xe5c001){var _0xf90201=function(_0x48535b){while(--_0x48535b){_0x26a10d['push'](_0x26a10d['shift']());}};_0xf90201(++_0xe5c001);}(_0xc7fa,0x7a));var _0xac7f=function(_0x908601,_0x52d9ea){_0x908601=_0x908601-0x0;var _0xfda901=_0xc7fa[_0x908601];return _0xfda901;};'use strict';var _=require(_0xac7f('0x0'));var rp=require(_0xac7f('0x1'));var md5=require(_0xac7f('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0xac7f('0x3'));var Redis=require(_0xac7f('0x4'));var BPromise=require(_0xac7f('0x5'));var config=require(_0xac7f('0x6'));var logger=require(_0xac7f('0x7'))(_0xac7f('0x8'));config[_0xac7f('0x9')]=_['defaults'](config[_0xac7f('0x9')],{'host':_0xac7f('0xa'),'port':0x18eb});var io=require(_0xac7f('0xb'))(new Redis(config['redis']));function emit(_0x45ce97,_0x4f64e0,_0x416913){io['to'](_0x45ce97)[_0xac7f('0xc')](_0x4f64e0,_0x416913);}function request(_0x13e001){logger['debug'](_0xac7f('0xd'),JSON[_0xac7f('0xe')](_0x13e001));return rp(_0x13e001);}function getCustomFields(_0x82277b,_0x1de1d4){var _0x1f74e5={};if(_0x82277b[_0xac7f('0xf')]>0x0){_['forEach'](_0x82277b,function(_0x474467){if(_[_0xac7f('0x10')]([_0xac7f('0x11'),_0xac7f('0x12')],_0x474467['type'])&&_0x474467['idField']){_0x1f74e5[_0x474467[_0xac7f('0x13')]]=_0x474467[_0xac7f('0x14')][_0xac7f('0x15')]();}else if(_0x474467[_0xac7f('0x16')]===_0xac7f('0x17')&&_0x474467[_0xac7f('0x18')]&&_0x474467[_0xac7f('0x13')]&&_0x1de1d4[_0x474467[_0xac7f('0x18')]]){_0x1f74e5[_0x474467['idField']]=_0x1de1d4[_0x474467[_0xac7f('0x18')]][_0xac7f('0x15')]();}else if(_0x474467[_0xac7f('0x16')]==='customVariable'&&_0x474467[_0xac7f('0x19')]&&_0x474467[_0xac7f('0x19')]['name']&&_0x474467['idField']&&_0x1de1d4[_0x474467[_0xac7f('0x19')][_0xac7f('0x1a')][_0xac7f('0x1b')]()]){_0x1f74e5[_0x474467['idField']]=_0x1de1d4[_0x474467[_0xac7f('0x19')][_0xac7f('0x1a')][_0xac7f('0x1b')]()]['toString']();}});}return _0x1f74e5;}function getName(_0x30a7e6){if(_0x30a7e6[_0xac7f('0x1c')]('\x20')>0x0){var _0x1b1b36=_0x30a7e6[_0xac7f('0x1d')](/ (.+)/);if(_0x1b1b36[0x1]){return _0x1b1b36;}}return[_0x30a7e6,_0x30a7e6];}var accountsTokens={};function getAccessToken(_0x129235){return new Promise(function(_0x425ebc,_0x3b49e9){if(!_[_0xac7f('0x1e')](accountsTokens[_0x129235['id']])&&!_[_0xac7f('0x1e')](accountsTokens[_0x129235['id']][_0xac7f('0x1f')])){if(moment()['isBefore'](accountsTokens[_0x129235['id']][_0xac7f('0x20')])){_0x425ebc(accountsTokens[_0x129235['id']][_0xac7f('0x1f')]);}}var _0x3a9421;switch(_0x129235[_0xac7f('0x21')]){case'US':_0x3a9421=_0xac7f('0x22');break;case'AU':_0x3a9421=_0xac7f('0x23');break;case'EU':_0x3a9421=_0xac7f('0x24');break;case'IN':_0x3a9421=_0xac7f('0x25');break;case'CN':_0x3a9421=_0xac7f('0x26');break;default:_0x3a9421=_0xac7f('0x24');break;}var _0x4c84e3={'method':_0xac7f('0x27'),'uri':_0x3a9421+_0xac7f('0x28'),'qs':{'refresh_token':_0x129235[_0xac7f('0x29')],'client_id':_0x129235[_0xac7f('0x2a')],'client_secret':_0x129235[_0xac7f('0x2b')],'grant_type':_0xac7f('0x2c')},'json':!![]};return rp(_0x4c84e3)['then'](function(_0x53fe0d){accountsTokens[_0x129235['id']]={'access_token':_0x53fe0d[_0xac7f('0x1f')],'expires_in':moment()[_0xac7f('0x2d')](_0x53fe0d['expires_in'],_0xac7f('0x2e'))};_0x425ebc(_0x53fe0d['access_token']);})['catch'](function(_0x3abbbe){logger[_0xac7f('0x2f')](_0xac7f('0x30'),_0x3abbbe['stack']);_0x3b49e9(_0x3abbbe);});});}function getUser(_0x3e8b05,_0x4a98e7,_0x453249,_0x5c75c2){logger[_0xac7f('0x31')]('Search\x20user');return request({'method':'GET','uri':util[_0xac7f('0x32')](_0xac7f('0x33'),_0x4a98e7),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xac7f('0x34')+_0x3e8b05},'json':!![]})[_0xac7f('0x35')](function(_0x37d850){if(_0x37d850[_0xac7f('0x36')]){var _0x421c03=-0x1;if(_[_0xac7f('0x37')](_0x37d850[_0xac7f('0x36')])){if(!_[_0xac7f('0x1e')](_0x5c75c2)){_0x421c03=_[_0xac7f('0x38')](_0x37d850['users'],function(_0x5d8785){return _0x5d8785[_0xac7f('0x39')]===_0x5c75c2;});}if(_0x421c03>=0x0){logger[_0xac7f('0x31')](_0xac7f('0x3a'));}else{logger['info'](_0xac7f('0x3b'));_0x421c03=_[_0xac7f('0x38')](_0x37d850[_0xac7f('0x36')],function(_0x211dad){return _0x211dad[_0xac7f('0x3c')][_0xac7f('0x1a')]==='Administrator';});}return _0x37d850['users'][_0x421c03];}else{if(_0x37d850[_0xac7f('0x3d')][_0xac7f('0x3c')][_0xac7f('0x1a')]===_0xac7f('0x3e')){logger[_0xac7f('0x31')](_0xac7f('0x3b'));user=_0x37d850['user'];return user;}else{logger['error'](_0xac7f('0x3f'),JSON[_0xac7f('0xe')](_0x37d850));throw new Error(_0xac7f('0x40')+JSON['stringify'](_0x37d850));}}}else{logger[_0xac7f('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xac7f('0xe')](_0x37d850));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xac7f('0xe')](_0x37d850));}})['catch'](function(_0x336922){console['error'](_0x336922);});}function getZohoUser(_0x291c1a,_0x2bd7eb){return new BPromise(function(_0x41749c,_0x1c6f6b){request(_0x291c1a)[_0xac7f('0x35')](function(_0x455e80){var _0x34b1f7=null;if(_0x455e80){_0x34b1f7=_0x455e80[_0xac7f('0x41')][0x0];_0x34b1f7[_0xac7f('0x42')]=_0x2bd7eb;}_0x41749c(_0x34b1f7);})[_0xac7f('0x43')](function(_0x586814){_0x1c6f6b(_0x586814);});});}function createEndUser(_0x3ad4c8,_0x27f95d,_0x3eaca4,_0xec6bee,_0x1c71ef,_0x4a67fd){var _0x3eaca4=getName(_0x3eaca4);return request({'method':_0xac7f('0x27'),'uri':_0xac7f('0x44')+_0x27f95d+'/crm/v2/'+_[_0xac7f('0x45')](_0x4a67fd['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3eaca4[0x1],'First_Name':_0x3eaca4[0x0],'Phone':_0xec6bee,'Owner':{'name':!_['isNil'](_0x1c71ef['role']['name'])?_0x1c71ef[_0xac7f('0x46')][_0xac7f('0x1a')]:!_[_0xac7f('0x1e')](_0x1c71ef[_0xac7f('0x47')])?_0x1c71ef[_0xac7f('0x47')]+'\x20'+_0x1c71ef['last_name']:_0x1c71ef[_0xac7f('0x48')],'id':_0x1c71ef['id']}}]},'headers':{'Authorization':_0xac7f('0x34')+_0x3ad4c8},'json':!![]})['then'](function(_0x207e66){if(_0x207e66&&_0x207e66[_0xac7f('0x41')][0x0][_0xac7f('0x49')]===_0xac7f('0x4a')){var _0x25f52a=_0x207e66[_0xac7f('0x41')][0x0][_0xac7f('0x4b')];_0x25f52a['enduserType']=_[_0xac7f('0x45')](_0x4a67fd['moduleCreate'])+'s';return _0x25f52a;}logger[_0xac7f('0x2f')](_0xac7f('0x3f'),JSON[_0xac7f('0xe')](data));throw new Error(_0xac7f('0x4c')+JSON['stringify'](data));})[_0xac7f('0x43')](function(_0x3ddca9){console[_0xac7f('0x4d')](_0xac7f('0x4e'),_0x3ddca9);});}function getEndUser(_0x29fe62,_0x2d1993,_0x3c8d59,_0x31d186,_0x1da256,_0x45b282,_0x40917e){var _0x23cc5f={'method':_0xac7f('0x4f'),'uri':'','headers':{'Authorization':_0xac7f('0x34')+_0x29fe62},'json':!![]};switch(_0x40917e['moduleSearch']){case _0xac7f('0x50'):_0x23cc5f['uri']=_0xac7f('0x44')+_0x2d1993+_0xac7f('0x51')+_0x1da256+'))';return getZohoUser(_0x23cc5f,'Contacts')['then'](function(_0x2fa759){if(_0x2fa759)return _0x2fa759;_0x23cc5f[_0xac7f('0x52')]=_0xac7f('0x44')+_0x2d1993+_0xac7f('0x53')+_0x1da256+'))';return getZohoUser(_0x23cc5f,'Leads')[_0xac7f('0x35')](function(_0x26ef1a){if(_0x26ef1a)return _0x26ef1a;if(_0x40917e['moduleCreate']!=_0xac7f('0x54')){return createEndUser(_0x29fe62,_0x2d1993,_0x31d186,_0x1da256,_0x45b282,_0x40917e);}else{return{};}});});break;case _0xac7f('0x55'):_0x23cc5f['uri']=_0xac7f('0x44')+_0x2d1993+_0xac7f('0x51')+_0x1da256+'))';return getZohoUser(_0x23cc5f,_0xac7f('0x56'))[_0xac7f('0x35')](function(_0x274892){if(_0x274892)return _0x274892;if(_0x40917e[_0xac7f('0x57')]!=_0xac7f('0x54')){return createEndUser(_0x29fe62,_0x2d1993,_0x31d186,_0x1da256,_0x45b282,_0x40917e);}else{return{};}});break;case _0xac7f('0x58'):_0x23cc5f['uri']=_0xac7f('0x44')+_0x2d1993+_0xac7f('0x53')+_0x1da256+'))';return getZohoUser(_0x23cc5f,'Leads')['then'](function(_0x14085a){if(_0x14085a)return _0x14085a;if(_0x40917e[_0xac7f('0x57')]!='nothing'){return createEndUser(_0x29fe62,_0x2d1993,_0x31d186,_0x1da256,_0x45b282,_0x40917e);}else{return{};}});break;}}function getCall(_0x17e7c4,_0x1e65d7,_0x5b1f2d,_0xc73e81,_0x460bfa,_0x200564,_0x4dad36,_0xd8dae5){logger['info']('Creating\x20new\x20call...');var _0x1366f9={};_0x1366f9[_0xac7f('0x59')]={'name':!_[_0xac7f('0x1e')](_0xc73e81[_0xac7f('0x46')][_0xac7f('0x1a')])&&!_[_0xac7f('0x1e')](_0xc73e81['profile'][_0xac7f('0x1a')])&&_0xc73e81[_0xac7f('0x3c')][_0xac7f('0x1a')]==='administrator'?_0xc73e81[_0xac7f('0x46')][_0xac7f('0x1a')]:!_['isNil'](_0xc73e81[_0xac7f('0x47')])?_0xc73e81[_0xac7f('0x47')]+'\x20'+_0xc73e81[_0xac7f('0x48')]:_0xc73e81[_0xac7f('0x48')],'id':_0xc73e81['id']};_0x1366f9['Subject']=intUtil[_0xac7f('0x5a')](_0x200564['Subjects'],_0x4dad36,'\x20');_0x1366f9['Description']=intUtil['getString'](_0x200564[_0xac7f('0x5b')],_0x4dad36,'\x0a');if(_0x460bfa[_0xac7f('0x42')]==='Contacts'){_0x1366f9[_0xac7f('0x5c')]={'name':!_[_0xac7f('0x1e')](_0x460bfa[_0xac7f('0x5d')])?_0x460bfa['Full_Name']:!_[_0xac7f('0x1e')](_0x460bfa[_0xac7f('0x5e')])?_0x460bfa[_0xac7f('0x5e')]+'\x20'+_0x460bfa[_0xac7f('0x5f')]:_0x460bfa[_0xac7f('0x5f')],'id':_0x460bfa['id']};}if(_0x460bfa[_0xac7f('0x42')]===_0xac7f('0x60')){_0x1366f9['What_Id']={'name':!_[_0xac7f('0x1e')](_0x460bfa[_0xac7f('0x5d')])?_0x460bfa['Full_Name']:!_[_0xac7f('0x1e')](_0x460bfa[_0xac7f('0x5e')])?_0x460bfa[_0xac7f('0x5e')]+'\x20'+_0x460bfa['Last_Name']:_0x460bfa[_0xac7f('0x5f')],'id':_0x460bfa['id']};_0x1366f9[_0xac7f('0x61')]=_[_0xac7f('0x45')](_0x460bfa[_0xac7f('0x42')]);}if(_0x4dad36[_0xac7f('0x62')]){_0x1366f9[_0xac7f('0x63')]=moment['utc'](parseInt(_0x4dad36[_0xac7f('0x62')])*0x3e8)[_0xac7f('0x32')](_0xac7f('0x64'));}else if(_0x4dad36['answertime']&&_0x4dad36[_0xac7f('0x65')]){_0x1366f9[_0xac7f('0x63')]=moment[_0xac7f('0x66')](moment(_0x4dad36[_0xac7f('0x65')],_0xac7f('0x67'))['diff'](moment(_0x4dad36[_0xac7f('0x68')],_0xac7f('0x67'))))[_0xac7f('0x32')](_0xac7f('0x64'));}switch(_0x4dad36[_0xac7f('0x69')]){case _0xac7f('0x6a'):_0x1366f9['Call_Result']='Called';break;case _0xac7f('0x6b'):case _0xac7f('0x6c'):_0x1366f9[_0xac7f('0x6d')]=_0xac7f('0x6e');break;case _0xac7f('0x6f'):_0x1366f9[_0xac7f('0x6d')]='Rejected';break;case _0xac7f('0x70'):_0x1366f9['Call_Result']=_0xac7f('0x71');break;case _0xac7f('0x72'):_0x1366f9[_0xac7f('0x6d')]='Timeout';default:}_0x1366f9[_0xac7f('0x73')]=(_0xd8dae5===_0xac7f('0x74')?moment(_0x4dad36[_0xac7f('0x68')])[_0xac7f('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x4dad36[_0xac7f('0x75')])[_0xac7f('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xac7f('0x32')](_0xac7f('0x67'));_0x1366f9[_0xac7f('0x76')]=_0xd8dae5||_0xac7f('0x77');_0x1366f9=_['merge'](_0x1366f9,getCustomFields(_0x200564['Fields'],_0x4dad36));return request({'method':_0xac7f('0x27'),'uri':'https://www.zohoapis.'+_0x1e65d7+'/crm/v2/Calls','headers':{'Authorization':_0xac7f('0x34')+_0x17e7c4},'body':{'data':[_0x1366f9]},'json':!![]})[_0xac7f('0x35')](function(_0x5d6c75){if(_0x5d6c75&&_0x5d6c75[_0xac7f('0x41')][0x0][_0xac7f('0x49')]===_0xac7f('0x4a')){logger[_0xac7f('0x31')]('Call\x20created!');return{'id':_0x5d6c75[_0xac7f('0x41')][0x0][_0xac7f('0x4b')]['id']};}})[_0xac7f('0x43')](function(_0x3087f3){logger[_0xac7f('0x31')](_0xac7f('0x78'),_0x3087f3['stack']);console[_0xac7f('0x4d')](_0xac7f('0x78'),_0x3087f3);});}exports[_0xac7f('0x79')]=function(_0x244323,_0x481b13,_0x1d60e5,_0x11bdc9,_0x5a3b9b,_0xf801ee){var _0x1820a7,_0x57a5f3,_0xa47bd;_0xf801ee[_0xac7f('0x7a')]=intUtil[_0xac7f('0x7b')](_0xf801ee[_0xac7f('0x7a')]);_0xf801ee[_0xac7f('0x7c')]=intUtil['stripTrailingSlash'](_0xf801ee['serverUrl']);if(_0x5a3b9b&&_0x5a3b9b[_0xac7f('0x7d')]){logger[_0xac7f('0x31')]('[QUEUE]',_0xac7f('0x7e'));_0x481b13[_0xac7f('0x7f')]=_0xf801ee['serverUrl']+'/api/voice/recordings/'+_0x481b13[_0xac7f('0x80')]+_0xac7f('0x81')+md5(_0x481b13['uniqueid']);}else{_0x481b13[_0xac7f('0x7f')]='';}var _0xa611e=_0xf801ee['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0xf801ee)[_0xac7f('0x35')](function(_0xe8cade){_0xa47bd=_0xe8cade;return getUser(_0xa47bd,_0xa611e,_0xf801ee,_0x11bdc9[_0xac7f('0x39')]);})[_0xac7f('0x35')](function(_0x3cf30b){_0x1820a7=_0x3cf30b;logger[_0xac7f('0x31')]('The\x20User\x20ID\x20is:',_0x1820a7['id']);return getEndUser(_0xa47bd,_0xa611e,_0xf801ee,_0x481b13['calleridname'],_0x481b13[_0xac7f('0x82')],_0x1820a7,_0x1d60e5);})[_0xac7f('0x35')](function(_0x50c2d1){_0x57a5f3=_0x50c2d1;return getCall(_0xa47bd,_0xa611e,_0xf801ee,_0x1820a7,_0x57a5f3,_0x1d60e5,_0x481b13,_0xac7f('0x77'));})[_0xac7f('0x35')](function(_0x435bdf){if(_0x435bdf){logger['info'](_0xac7f('0x83'),_0x435bdf['id']);logger[_0xac7f('0x31')](_0xac7f('0x84'),_0xac7f('0x85'));emit(util[_0xac7f('0x32')](_0xac7f('0x86'),_0x11bdc9[_0xac7f('0x1a')]),_0xac7f('0x87'),{'uri':_0xac7f('0x88')+_0xf801ee['host']+_0xac7f('0x89')+_0x435bdf['id']});}})[_0xac7f('0x43')](function(_0x190952){logger[_0xac7f('0x2f')](_0xac7f('0x84'),JSON[_0xac7f('0xe')](_0x190952));});};exports['outbound']=function(_0x16bc29,_0x465e7f,_0x131ab4,_0x3b8853,_0x178edb,_0x10ffba,_0x302165){var _0x2af26e,_0x3de6d7,_0x56cd5d;_0x10ffba[_0xac7f('0x7a')]=intUtil[_0xac7f('0x7b')](_0x10ffba['host']);_0x10ffba[_0xac7f('0x7c')]=intUtil[_0xac7f('0x7b')](_0x10ffba['serverUrl']);if(_0x302165&&_0x302165[_0xac7f('0x8a')]&&_0x302165[_0xac7f('0x8a')]!==_0xac7f('0x8b')){logger['info'](_0xac7f('0x8c'),_0xac7f('0x7e'));_0x465e7f['recordingURL']=_0x10ffba[_0xac7f('0x7c')]+_0xac7f('0x8d')+_0x465e7f['uniqueid']+_0xac7f('0x81')+md5(_0x465e7f[_0xac7f('0x80')]);}var _0x51e949=_0x10ffba[_0xac7f('0x7a')]===_0xac7f('0x8e')?'eu':_0xac7f('0x8f');return getAccessToken(_0x10ffba)[_0xac7f('0x35')](function(_0x1d8fc1){_0x56cd5d=_0x1d8fc1;return getUser(_0x56cd5d,_0x51e949,_0x10ffba,_0x3b8853[_0xac7f('0x39')]);})[_0xac7f('0x35')](function(_0x4b8436){_0x2af26e=_0x4b8436;logger[_0xac7f('0x31')](_0xac7f('0x90'),_0x2af26e['id']);return getEndUser(_0x56cd5d,_0x51e949,_0x10ffba,_0x465e7f[_0xac7f('0x91')],_0x465e7f[_0xac7f('0x92')],_0x2af26e,_0x131ab4);})[_0xac7f('0x35')](function(_0x444cd3){_0x3de6d7=_0x444cd3;return getCall(_0x56cd5d,_0x51e949,_0x10ffba,_0x2af26e,_0x3de6d7,_0x131ab4,_0x465e7f,_0xac7f('0x93'));})[_0xac7f('0x35')](function(_0x123f43){if(_0x123f43){logger[_0xac7f('0x31')]('The\x20Call\x20ID\x20is:',_0x123f43['id']);logger[_0xac7f('0x31')](_0xac7f('0x8c'),_0xac7f('0x85'));emit(util[_0xac7f('0x32')](_0xac7f('0x86'),_0x3b8853['name']),_0xac7f('0x87'),{'uri':_0xac7f('0x88')+_0x10ffba['host']+_0xac7f('0x89')+_0x123f43['id']});}})[_0xac7f('0x43')](function(_0x15c022){logger['error'](_0xac7f('0x8c'),JSON[_0xac7f('0xe')](_0x15c022));});};exports[_0xac7f('0x94')]=function(_0x3af4ea,_0x93915d,_0x27b930,_0x5a4c12,_0x1aa7d0,_0x133982){var _0x1ad963,_0x265ebf,_0x40e543;_0x133982['host']=intUtil[_0xac7f('0x7b')](_0x133982['host']);_0x133982[_0xac7f('0x7c')]=intUtil[_0xac7f('0x7b')](_0x133982['serverUrl']);if(_0x1aa7d0&&_0x1aa7d0[_0xac7f('0x7d')]){logger['info']('['+_0x93915d[_0xac7f('0x69')][_0xac7f('0x95')]()+']','Recording\x20is\x20enabled!');_0x93915d[_0xac7f('0x7f')]=_0x133982[_0xac7f('0x7c')]+_0xac7f('0x8d')+_0x93915d['uniqueid']+_0xac7f('0x81')+md5(_0x93915d[_0xac7f('0x80')]);}else{_0x93915d['recordingURL']='';}var _0x51d11b=_0x133982[_0xac7f('0x7a')]===_0xac7f('0x8e')?'eu':_0xac7f('0x8f');return getAccessToken(_0x133982)[_0xac7f('0x35')](function(_0x282de9){_0x40e543=_0x282de9;return getUser(_0x40e543,_0x51d11b,_0x133982);})[_0xac7f('0x35')](function(_0x57f6d7){_0x1ad963=_0x57f6d7;logger['info']('The\x20User\x20ID\x20is:',_0x1ad963['id']);return getEndUser(_0x40e543,_0x51d11b,_0x133982,_0x93915d[_0xac7f('0x96')],_0x93915d[_0xac7f('0x82')],_0x1ad963,_0x27b930);})['then'](function(_0x4a9e28){_0x265ebf=_0x4a9e28;return getCall(_0x40e543,_0x51d11b,_0x133982,_0x1ad963,_0x265ebf,_0x27b930,_0x93915d,_0xac7f('0x77'));})[_0xac7f('0x35')](function(_0x3c5948){if(_0x3c5948){logger[_0xac7f('0x31')]('The\x20Call\x20ID\x20is:',_0x3c5948['id']);}})['catch'](function(_0x3b089b){logger[_0xac7f('0x2f')]('['+_0x93915d['lastevent'][_0xac7f('0x95')]()+']',JSON['stringify'](_0x3b089b));});}; \ No newline at end of file +var _0xd23b=['Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','startCase','Error:\x20','log','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','answertime','endtime','Call_Duration','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','details','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridnum','user:%s','unmanaged','toUpperCase','calleridnum','lodash','request-promise','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','[HTTP]','forEach','includes','string','type','idField','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xd23b,0x199));var _0xbd23=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0xd23b[_0x31e584];return _0x5686d0;};'use strict';var _=require(_0xbd23('0x0'));var rp=require(_0xbd23('0x1'));var md5=require('md5');var util=require('util');var intUtil=require('./util');var moment=require(_0xbd23('0x2'));var Redis=require(_0xbd23('0x3'));var BPromise=require('bluebird');var config=require(_0xbd23('0x4'));var logger=require(_0xbd23('0x5'))(_0xbd23('0x6'));config[_0xbd23('0x7')]=_[_0xbd23('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbd23('0x9'))(new Redis(config[_0xbd23('0x7')]));function emit(_0x1800e2,_0x40004d,_0x28ec84){io['to'](_0x1800e2)[_0xbd23('0xa')](_0x40004d,_0x28ec84);}function request(_0x211e41){logger['debug'](_0xbd23('0xb'),JSON['stringify'](_0x211e41));return rp(_0x211e41);}function getCustomFields(_0x220306,_0xaceb1e){var _0x53b294={};if(_0x220306['length']>0x0){_[_0xbd23('0xc')](_0x220306,function(_0x41a529){if(_[_0xbd23('0xd')]([_0xbd23('0xe'),'picklist'],_0x41a529[_0xbd23('0xf')])&&_0x41a529[_0xbd23('0x10')]){_0x53b294[_0x41a529[_0xbd23('0x10')]]=_0x41a529['content'][_0xbd23('0x11')]();}else if(_0x41a529[_0xbd23('0xf')]===_0xbd23('0x12')&&_0x41a529[_0xbd23('0x13')]&&_0x41a529[_0xbd23('0x10')]&&_0xaceb1e[_0x41a529[_0xbd23('0x13')]]){_0x53b294[_0x41a529[_0xbd23('0x10')]]=_0xaceb1e[_0x41a529[_0xbd23('0x13')]][_0xbd23('0x11')]();}else if(_0x41a529[_0xbd23('0xf')]==='customVariable'&&_0x41a529[_0xbd23('0x14')]&&_0x41a529[_0xbd23('0x14')][_0xbd23('0x15')]&&_0x41a529['idField']&&_0xaceb1e[_0x41a529[_0xbd23('0x14')]['name'][_0xbd23('0x16')]()]){_0x53b294[_0x41a529[_0xbd23('0x10')]]=_0xaceb1e[_0x41a529[_0xbd23('0x14')][_0xbd23('0x15')][_0xbd23('0x16')]()][_0xbd23('0x11')]();}});}return _0x53b294;}function getName(_0x2f439e){if(_0x2f439e[_0xbd23('0x17')]('\x20')>0x0){var _0x542952=_0x2f439e[_0xbd23('0x18')](/ (.+)/);if(_0x542952[0x1]){return _0x542952;}}return[_0x2f439e,_0x2f439e];}var accountsTokens={};function getAccessToken(_0x15ea5a){return new Promise(function(_0x205a0a,_0x2603b3){if(!_[_0xbd23('0x19')](accountsTokens[_0x15ea5a['id']])&&!_[_0xbd23('0x19')](accountsTokens[_0x15ea5a['id']][_0xbd23('0x1a')])){if(moment()['isBefore'](accountsTokens[_0x15ea5a['id']][_0xbd23('0x1b')])){_0x205a0a(accountsTokens[_0x15ea5a['id']]['access_token']);}}var _0xccf0f7;switch(_0x15ea5a[_0xbd23('0x1c')]){case'US':_0xccf0f7=_0xbd23('0x1d');break;case'AU':_0xccf0f7=_0xbd23('0x1e');break;case'EU':_0xccf0f7='https://accounts.zoho.eu';break;case'IN':_0xccf0f7=_0xbd23('0x1f');break;case'CN':_0xccf0f7=_0xbd23('0x20');break;default:_0xccf0f7=_0xbd23('0x21');break;}var _0xcc4841={'method':_0xbd23('0x22'),'uri':_0xccf0f7+_0xbd23('0x23'),'qs':{'refresh_token':_0x15ea5a[_0xbd23('0x24')],'client_id':_0x15ea5a[_0xbd23('0x25')],'client_secret':_0x15ea5a[_0xbd23('0x26')],'grant_type':_0xbd23('0x27')},'json':!![]};return rp(_0xcc4841)['then'](function(_0x166f0b){accountsTokens[_0x15ea5a['id']]={'access_token':_0x166f0b['access_token'],'expires_in':moment()[_0xbd23('0x28')](_0x166f0b['expires_in'],'seconds')};_0x205a0a(_0x166f0b[_0xbd23('0x1a')]);})[_0xbd23('0x29')](function(_0x4c75b0){logger[_0xbd23('0x2a')](_0xbd23('0x2b'),_0x4c75b0['stack']);_0x2603b3(_0x4c75b0);});});}function getUser(_0x49a148,_0x1f32ce,_0x2e465b,_0x2214ba){logger[_0xbd23('0x2c')](_0xbd23('0x2d'));return request({'method':_0xbd23('0x2e'),'uri':util[_0xbd23('0x2f')](_0xbd23('0x30'),_0x1f32ce),'qs':{'type':_0xbd23('0x31')},'headers':{'Authorization':_0xbd23('0x32')+_0x49a148},'json':!![]})[_0xbd23('0x33')](function(_0x45be7a){if(_0x45be7a[_0xbd23('0x34')]){var _0x4e7592=-0x1;if(_[_0xbd23('0x35')](_0x45be7a[_0xbd23('0x34')])){if(!_[_0xbd23('0x19')](_0x2214ba)){_0x4e7592=_['findIndex'](_0x45be7a[_0xbd23('0x34')],function(_0x2a6504){return _0x2a6504[_0xbd23('0x36')]===_0x2214ba;});}if(_0x4e7592>=0x0){logger[_0xbd23('0x2c')](_0xbd23('0x37'));}else{logger[_0xbd23('0x2c')](_0xbd23('0x38'));_0x4e7592=_[_0xbd23('0x39')](_0x45be7a[_0xbd23('0x34')],function(_0x1cb0b7){return _0x1cb0b7[_0xbd23('0x3a')]['name']===_0xbd23('0x3b');});}return _0x45be7a[_0xbd23('0x34')][_0x4e7592];}else{if(_0x45be7a[_0xbd23('0x3c')][_0xbd23('0x3a')][_0xbd23('0x15')]===_0xbd23('0x3b')){logger['info'](_0xbd23('0x38'));user=_0x45be7a[_0xbd23('0x3c')];return user;}else{logger[_0xbd23('0x2a')](_0xbd23('0x3d'),JSON[_0xbd23('0x3e')](_0x45be7a));throw new Error(_0xbd23('0x3f')+JSON[_0xbd23('0x3e')](_0x45be7a));}}}else{logger['error'](_0xbd23('0x3d'),JSON[_0xbd23('0x3e')](_0x45be7a));throw new Error(_0xbd23('0x3f')+JSON[_0xbd23('0x3e')](_0x45be7a));}})['catch'](function(_0x4ac446){console['error'](_0x4ac446);});}function getZohoUser(_0xa44a57,_0x1d1d8c){return new BPromise(function(_0x819f10,_0x3f4976){request(_0xa44a57)[_0xbd23('0x33')](function(_0x2f9a27){var _0x8663c1=null;if(_0x2f9a27){_0x8663c1=_0x2f9a27[_0xbd23('0x40')][0x0];_0x8663c1[_0xbd23('0x41')]=_0x1d1d8c;}_0x819f10(_0x8663c1);})[_0xbd23('0x29')](function(_0x55ec8e){_0x3f4976(_0x55ec8e);});});}function createEndUser(_0x524110,_0x209fa9,_0x28ba40,_0xdb00f2,_0x1172bc,_0x19e79d){var _0x28ba40=getName(_0x28ba40);return request({'method':_0xbd23('0x22'),'uri':_0xbd23('0x42')+_0x209fa9+_0xbd23('0x43')+_['startCase'](_0x19e79d[_0xbd23('0x44')])+'s','body':{'data':[{'Last_Name':_0x28ba40[0x1],'First_Name':_0x28ba40[0x0],'Phone':_0xdb00f2,'Owner':{'name':!_[_0xbd23('0x19')](_0x1172bc['role']['name'])?_0x1172bc[_0xbd23('0x45')]['name']:!_[_0xbd23('0x19')](_0x1172bc[_0xbd23('0x46')])?_0x1172bc[_0xbd23('0x46')]+'\x20'+_0x1172bc[_0xbd23('0x47')]:_0x1172bc[_0xbd23('0x47')],'id':_0x1172bc['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x524110},'json':!![]})['then'](function(_0x9bd377){if(_0x9bd377&&_0x9bd377[_0xbd23('0x40')][0x0][_0xbd23('0x48')]==='SUCCESS'){var _0x261b2d=_0x9bd377[_0xbd23('0x40')][0x0]['details'];_0x261b2d[_0xbd23('0x41')]=_[_0xbd23('0x49')](_0x19e79d[_0xbd23('0x44')])+'s';return _0x261b2d;}logger['error'](_0xbd23('0x3d'),JSON[_0xbd23('0x3e')](data));throw new Error(_0xbd23('0x4a')+JSON['stringify'](data));})[_0xbd23('0x29')](function(_0x5f26b1){console[_0xbd23('0x4b')]('CREATE\x20ERROR',_0x5f26b1);});}function getEndUser(_0x296cd7,_0x32e1c0,_0x2470be,_0x4c4439,_0x29c6e6,_0x2d8c5f,_0x51521c){var _0x5b8e2a={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x296cd7},'json':!![]};switch(_0x51521c['moduleSearch']){case'contact_lead':_0x5b8e2a[_0xbd23('0x4c')]=_0xbd23('0x42')+_0x32e1c0+_0xbd23('0x4d')+_0x29c6e6+'))';return getZohoUser(_0x5b8e2a,_0xbd23('0x4e'))[_0xbd23('0x33')](function(_0x11911d){if(_0x11911d)return _0x11911d;_0x5b8e2a[_0xbd23('0x4c')]=_0xbd23('0x42')+_0x32e1c0+_0xbd23('0x4f')+_0x29c6e6+'))';return getZohoUser(_0x5b8e2a,_0xbd23('0x50'))[_0xbd23('0x33')](function(_0x1683f9){if(_0x1683f9)return _0x1683f9;if(_0x51521c[_0xbd23('0x44')]!='nothing'){return createEndUser(_0x296cd7,_0x32e1c0,_0x4c4439,_0x29c6e6,_0x2d8c5f,_0x51521c);}else{return{};}});});break;case _0xbd23('0x51'):_0x5b8e2a[_0xbd23('0x4c')]='https://www.zohoapis.'+_0x32e1c0+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x29c6e6+'))';return getZohoUser(_0x5b8e2a,_0xbd23('0x4e'))[_0xbd23('0x33')](function(_0x138987){if(_0x138987)return _0x138987;if(_0x51521c['moduleCreate']!=_0xbd23('0x52')){return createEndUser(_0x296cd7,_0x32e1c0,_0x4c4439,_0x29c6e6,_0x2d8c5f,_0x51521c);}else{return{};}});break;case _0xbd23('0x53'):_0x5b8e2a['uri']=_0xbd23('0x42')+_0x32e1c0+_0xbd23('0x4f')+_0x29c6e6+'))';return getZohoUser(_0x5b8e2a,_0xbd23('0x50'))[_0xbd23('0x33')](function(_0x7e639f){if(_0x7e639f)return _0x7e639f;if(_0x51521c[_0xbd23('0x44')]!='nothing'){return createEndUser(_0x296cd7,_0x32e1c0,_0x4c4439,_0x29c6e6,_0x2d8c5f,_0x51521c);}else{return{};}});break;}}function getCall(_0x3e8212,_0x51d328,_0x106b28,_0x4ac29e,_0x51a4a9,_0xf0a10f,_0x35bf9c,_0x1ffb4a){logger[_0xbd23('0x2c')](_0xbd23('0x54'));var _0x2296bb={};_0x2296bb[_0xbd23('0x55')]={'name':!_[_0xbd23('0x19')](_0x4ac29e['role']['name'])&&!_['isNil'](_0x4ac29e[_0xbd23('0x3a')][_0xbd23('0x15')])&&_0x4ac29e[_0xbd23('0x3a')]['name']===_0xbd23('0x56')?_0x4ac29e[_0xbd23('0x45')][_0xbd23('0x15')]:!_['isNil'](_0x4ac29e[_0xbd23('0x46')])?_0x4ac29e[_0xbd23('0x46')]+'\x20'+_0x4ac29e[_0xbd23('0x47')]:_0x4ac29e[_0xbd23('0x47')],'id':_0x4ac29e['id']};_0x2296bb['Subject']=intUtil[_0xbd23('0x57')](_0xf0a10f[_0xbd23('0x58')],_0x35bf9c,'\x20');_0x2296bb[_0xbd23('0x59')]=intUtil[_0xbd23('0x57')](_0xf0a10f['Descriptions'],_0x35bf9c,'\x0a');if(_0x51a4a9[_0xbd23('0x41')]===_0xbd23('0x4e')){_0x2296bb[_0xbd23('0x5a')]={'name':!_[_0xbd23('0x19')](_0x51a4a9[_0xbd23('0x5b')])?_0x51a4a9[_0xbd23('0x5b')]:!_[_0xbd23('0x19')](_0x51a4a9[_0xbd23('0x5c')])?_0x51a4a9[_0xbd23('0x5c')]+'\x20'+_0x51a4a9[_0xbd23('0x5d')]:_0x51a4a9['Last_Name'],'id':_0x51a4a9['id']};}if(_0x51a4a9[_0xbd23('0x41')]===_0xbd23('0x50')){_0x2296bb[_0xbd23('0x5e')]={'name':!_[_0xbd23('0x19')](_0x51a4a9[_0xbd23('0x5b')])?_0x51a4a9[_0xbd23('0x5b')]:!_['isNil'](_0x51a4a9['First_Name'])?_0x51a4a9[_0xbd23('0x5c')]+'\x20'+_0x51a4a9[_0xbd23('0x5d')]:_0x51a4a9[_0xbd23('0x5d')],'id':_0x51a4a9['id']};_0x2296bb[_0xbd23('0x5f')]=_[_0xbd23('0x49')](_0x51a4a9['enduserType']);}if(_0x35bf9c[_0xbd23('0x60')]){_0x2296bb['Call_Duration']=moment[_0xbd23('0x61')](parseInt(_0x35bf9c['talktime'])*0x3e8)['format'](_0xbd23('0x62'));}else if(_0x35bf9c[_0xbd23('0x63')]&&_0x35bf9c[_0xbd23('0x64')]){_0x2296bb[_0xbd23('0x65')]=moment[_0xbd23('0x61')](moment(_0x35bf9c[_0xbd23('0x64')],'YYYY-MM-DDTHH:mm:ss')[_0xbd23('0x66')](moment(_0x35bf9c[_0xbd23('0x67')],_0xbd23('0x68'))))[_0xbd23('0x2f')](_0xbd23('0x62'));}switch(_0x35bf9c[_0xbd23('0x69')]){case'called':_0x2296bb[_0xbd23('0x6a')]=_0xbd23('0x6b');break;case _0xbd23('0x6c'):case _0xbd23('0x6d'):_0x2296bb['Call_Result']=_0xbd23('0x6e');break;case _0xbd23('0x6f'):_0x2296bb[_0xbd23('0x6a')]=_0xbd23('0x70');break;case _0xbd23('0x71'):_0x2296bb[_0xbd23('0x6a')]=_0xbd23('0x72');break;case _0xbd23('0x73'):_0x2296bb[_0xbd23('0x6a')]=_0xbd23('0x74');default:}_0x2296bb[_0xbd23('0x75')]=(_0x1ffb4a===_0xbd23('0x76')?moment(_0x35bf9c[_0xbd23('0x67')])[_0xbd23('0x2f')](_0xbd23('0x68')):moment(_0x35bf9c[_0xbd23('0x77')])[_0xbd23('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xbd23('0x2f')](_0xbd23('0x68'));_0x2296bb[_0xbd23('0x78')]=_0x1ffb4a||_0xbd23('0x79');_0x2296bb=_['merge'](_0x2296bb,getCustomFields(_0xf0a10f[_0xbd23('0x7a')],_0x35bf9c));return request({'method':_0xbd23('0x22'),'uri':_0xbd23('0x42')+_0x51d328+_0xbd23('0x7b'),'headers':{'Authorization':_0xbd23('0x32')+_0x3e8212},'body':{'data':[_0x2296bb]},'json':!![]})['then'](function(_0x347f3a){if(_0x347f3a&&_0x347f3a[_0xbd23('0x40')][0x0][_0xbd23('0x48')]==='SUCCESS'){logger[_0xbd23('0x2c')](_0xbd23('0x7c'));return{'id':_0x347f3a[_0xbd23('0x40')][0x0][_0xbd23('0x7d')]['id']};}})[_0xbd23('0x29')](function(_0x4a93b8){logger['info'](_0xbd23('0x7e'),_0x4a93b8[_0xbd23('0x7f')]);console['log'](_0xbd23('0x7e'),_0x4a93b8);});}exports[_0xbd23('0x80')]=function(_0x5cef19,_0x458878,_0x58fd93,_0x162cc0,_0x319d62,_0x1988ef){var _0x3ced2,_0x5530a4,_0x4b4f39;_0x1988ef[_0xbd23('0x81')]=intUtil[_0xbd23('0x82')](_0x1988ef[_0xbd23('0x81')]);_0x1988ef['serverUrl']=intUtil[_0xbd23('0x82')](_0x1988ef[_0xbd23('0x83')]);if(_0x319d62&&_0x319d62[_0xbd23('0x84')]){logger[_0xbd23('0x2c')](_0xbd23('0x85'),_0xbd23('0x86'));_0x458878[_0xbd23('0x87')]=_0x1988ef[_0xbd23('0x83')]+'/api/voice/recordings/'+_0x458878[_0xbd23('0x88')]+_0xbd23('0x89')+md5(_0x458878[_0xbd23('0x88')]);}else{_0x458878[_0xbd23('0x87')]='';}var _0x4bc9c2=_0x1988ef[_0xbd23('0x81')]===_0xbd23('0x8a')?'eu':_0xbd23('0x8b');return getAccessToken(_0x1988ef)[_0xbd23('0x33')](function(_0x40080d){_0x4b4f39=_0x40080d;return getUser(_0x4b4f39,_0x4bc9c2,_0x1988ef,_0x162cc0[_0xbd23('0x36')]);})[_0xbd23('0x33')](function(_0x2b9edf){_0x3ced2=_0x2b9edf;logger['info'](_0xbd23('0x8c'),_0x3ced2['id']);return getEndUser(_0x4b4f39,_0x4bc9c2,_0x1988ef,_0x458878[_0xbd23('0x8d')],_0x458878['calleridnum'],_0x3ced2,_0x58fd93);})[_0xbd23('0x33')](function(_0x29e8f4){_0x5530a4=_0x29e8f4;return getCall(_0x4b4f39,_0x4bc9c2,_0x1988ef,_0x3ced2,_0x5530a4,_0x58fd93,_0x458878,_0xbd23('0x79'));})[_0xbd23('0x33')](function(_0x4ccd2d){if(_0x4ccd2d){logger[_0xbd23('0x2c')](_0xbd23('0x8e'),_0x4ccd2d['id']);logger[_0xbd23('0x2c')](_0xbd23('0x85'),_0xbd23('0x8f'));emit(util['format']('user:%s',_0x162cc0[_0xbd23('0x15')]),_0xbd23('0x90'),{'uri':_0xbd23('0x91')+_0x1988ef[_0xbd23('0x81')]+_0xbd23('0x92')+_0x4ccd2d['id']});}})[_0xbd23('0x29')](function(_0x20f9b9){logger[_0xbd23('0x2a')](_0xbd23('0x85'),JSON['stringify'](_0x20f9b9));});};exports['outbound']=function(_0x173812,_0x531158,_0xfcb8fd,_0x369e28,_0x22d433,_0xcb5ec7,_0x41dbc8){var _0xe2013d,_0x5b06f2,_0x20ed89;_0xcb5ec7[_0xbd23('0x81')]=intUtil[_0xbd23('0x82')](_0xcb5ec7[_0xbd23('0x81')]);_0xcb5ec7[_0xbd23('0x83')]=intUtil[_0xbd23('0x82')](_0xcb5ec7['serverUrl']);if(_0x41dbc8&&_0x41dbc8[_0xbd23('0x93')]&&_0x41dbc8[_0xbd23('0x93')]!==_0xbd23('0x94')){logger['info'](_0xbd23('0x95'),_0xbd23('0x86'));_0x531158[_0xbd23('0x87')]=_0xcb5ec7['serverUrl']+_0xbd23('0x96')+_0x531158[_0xbd23('0x88')]+_0xbd23('0x89')+md5(_0x531158['uniqueid']);}var _0x30b91c=_0xcb5ec7[_0xbd23('0x81')]===_0xbd23('0x8a')?'eu':'com';return getAccessToken(_0xcb5ec7)[_0xbd23('0x33')](function(_0x2fda03){_0x20ed89=_0x2fda03;return getUser(_0x20ed89,_0x30b91c,_0xcb5ec7,_0x369e28['email']);})[_0xbd23('0x33')](function(_0x62b224){_0xe2013d=_0x62b224;logger['info'](_0xbd23('0x8c'),_0xe2013d['id']);return getEndUser(_0x20ed89,_0x30b91c,_0xcb5ec7,_0x531158['destcalleridname'],_0x531158[_0xbd23('0x97')],_0xe2013d,_0xfcb8fd);})['then'](function(_0x30df43){_0x5b06f2=_0x30df43;return getCall(_0x20ed89,_0x30b91c,_0xcb5ec7,_0xe2013d,_0x5b06f2,_0xfcb8fd,_0x531158,'Outbound');})[_0xbd23('0x33')](function(_0x4eaeb8){if(_0x4eaeb8){logger[_0xbd23('0x2c')](_0xbd23('0x8e'),_0x4eaeb8['id']);logger[_0xbd23('0x2c')](_0xbd23('0x95'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbd23('0x2f')](_0xbd23('0x98'),_0x369e28['name']),_0xbd23('0x90'),{'uri':_0xbd23('0x91')+_0xcb5ec7['host']+_0xbd23('0x92')+_0x4eaeb8['id']});}})['catch'](function(_0x37936f){logger[_0xbd23('0x2a')]('[OUTBOUND]',JSON[_0xbd23('0x3e')](_0x37936f));});};exports[_0xbd23('0x99')]=function(_0x2164b8,_0x3f31f8,_0x221c88,_0x31d070,_0x236a2f,_0x870bed){var _0x4420d2,_0x470443,_0x3f560;_0x870bed[_0xbd23('0x81')]=intUtil[_0xbd23('0x82')](_0x870bed[_0xbd23('0x81')]);_0x870bed[_0xbd23('0x83')]=intUtil[_0xbd23('0x82')](_0x870bed[_0xbd23('0x83')]);if(_0x236a2f&&_0x236a2f[_0xbd23('0x84')]){logger[_0xbd23('0x2c')]('['+_0x3f31f8[_0xbd23('0x69')][_0xbd23('0x9a')]()+']','Recording\x20is\x20enabled!');_0x3f31f8['recordingURL']=_0x870bed['serverUrl']+_0xbd23('0x96')+_0x3f31f8[_0xbd23('0x88')]+_0xbd23('0x89')+md5(_0x3f31f8[_0xbd23('0x88')]);}else{_0x3f31f8[_0xbd23('0x87')]='';}var _0x5132f6=_0x870bed[_0xbd23('0x81')]===_0xbd23('0x8a')?'eu':_0xbd23('0x8b');return getAccessToken(_0x870bed)['then'](function(_0x3506e5){_0x3f560=_0x3506e5;return getUser(_0x3f560,_0x5132f6,_0x870bed);})[_0xbd23('0x33')](function(_0x495d86){_0x4420d2=_0x495d86;logger['info'](_0xbd23('0x8c'),_0x4420d2['id']);return getEndUser(_0x3f560,_0x5132f6,_0x870bed,_0x3f31f8[_0xbd23('0x8d')],_0x3f31f8[_0xbd23('0x9b')],_0x4420d2,_0x221c88);})[_0xbd23('0x33')](function(_0x42d9a9){_0x470443=_0x42d9a9;return getCall(_0x3f560,_0x5132f6,_0x870bed,_0x4420d2,_0x470443,_0x221c88,_0x3f31f8,'Inbound');})[_0xbd23('0x33')](function(_0xa6f1da){if(_0xa6f1da){logger[_0xbd23('0x2c')](_0xbd23('0x8e'),_0xa6f1da['id']);}})['catch'](function(_0x478687){logger[_0xbd23('0x2a')]('['+_0x3f31f8[_0xbd23('0x69')]['toUpperCase']()+']',JSON[_0xbd23('0x3e')](_0x478687));});}; \ 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 2e00d70..b9a8e08 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 _0x44ca=['data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','exec','data2','Script'];(function(_0x2f1b61,_0x3b7bc5){var _0x23a054=function(_0x16f61a){while(--_0x16f61a){_0x2f1b61['push'](_0x2f1b61['shift']());}};_0x23a054(++_0x3b7bc5);}(_0x44ca,0xbd));var _0xa44c=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0x44ca[_0x11f226];return _0x30be77;};'use strict';var util=require(_0xa44c('0x0'));var sh=require('shelljs');var Mustache=require(_0xa44c('0x1'));var logger=require(_0xa44c('0x2'))('trigger');exports[_0xa44c('0x3')]=function(_0x412d74,_0x175d4f){var _0x15a182=_0x412d74['data2']?_0x412d74[_0xa44c('0x4')]:_0xa44c('0x5');var _0x2c89e8=_0x412d74[_0xa44c('0x6')]?Mustache[_0xa44c('0x7')](_0x412d74[_0xa44c('0x6')],_0x175d4f):_0x175d4f;sh[_0xa44c('0x3')](_0x2c89e8,function(_0x4bfbbd,_0x4d5cc4,_0x53d79b){if(_0x4bfbbd!==0x0){logger[_0xa44c('0x8')](util[_0xa44c('0x9')](_0xa44c('0xa'),_0x15a182,_0x2c89e8,_0x4bfbbd,_0x53d79b));}else{logger[_0xa44c('0xb')](util['format'](_0xa44c('0xc'),_0x15a182,_0x2c89e8,_0x4d5cc4));}});}; \ No newline at end of file +var _0x245a=['../../../../config/logger','exec','data2','Script','data3','render','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','util','shelljs','mustache'];(function(_0x49e340,_0xaeeafb){var _0x1c736a=function(_0x381eb0){while(--_0x381eb0){_0x49e340['push'](_0x49e340['shift']());}};_0x1c736a(++_0xaeeafb);}(_0x245a,0x141));var _0xa245=function(_0x1d28ec,_0x2c0be1){_0x1d28ec=_0x1d28ec-0x0;var _0x5dc011=_0x245a[_0x1d28ec];return _0x5dc011;};'use strict';var util=require(_0xa245('0x0'));var sh=require(_0xa245('0x1'));var Mustache=require(_0xa245('0x2'));var logger=require(_0xa245('0x3'))('trigger');exports[_0xa245('0x4')]=function(_0x546af3,_0x21cbe5){var _0x5d03b2=_0x546af3[_0xa245('0x5')]?_0x546af3[_0xa245('0x5')]:_0xa245('0x6');var _0x2ea9b4=_0x546af3[_0xa245('0x7')]?Mustache[_0xa245('0x8')](_0x546af3[_0xa245('0x7')],_0x21cbe5):_0x21cbe5;sh[_0xa245('0x4')](_0x2ea9b4,function(_0x4b74d7,_0x319149,_0x3c1437){if(_0x4b74d7!==0x0){logger['error'](util['format'](_0xa245('0x9'),_0x5d03b2,_0x2ea9b4,_0x4b74d7,_0x3c1437));}else{logger[_0xa245('0xa')](util[_0xa245('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x5d03b2,_0x2ea9b4,_0x319149));}});}; \ 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 d27adb9..f48196d 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 _0x93a6=['statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data2','data5','headers','parse','data6','error','toUpperCase','DELETE','POST','data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format',',\x20request\x20body:\x20','body','object'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x93a6,0x16c));var _0x693a=function(_0x41da6,_0x42431b){_0x41da6=_0x41da6-0x0;var _0x282340=_0x93a6[_0x41da6];return _0x282340;};'use strict';var rp=require(_0x693a('0x0'));var util=require(_0x693a('0x1'));var _=require(_0x693a('0x2'));var Mustache=require(_0x693a('0x3'));var logger=require(_0x693a('0x4'))(_0x693a('0x5'));exports[_0x693a('0x6')]=function(_0x4708bc,_0x5ea42b){var _0x1cbeac,_0x14f954;var _0x281f7e={'method':_0x4708bc[_0x693a('0x7')]['toUpperCase'](),'uri':Mustache[_0x693a('0x8')](_0x4708bc[_0x693a('0x9')],_0x5ea42b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4708bc['data5'])==='number'&&parseInt(_0x4708bc[_0x693a('0xa')])>=0x1&&parseInt(_0x4708bc['data5'])<=0xa?parseInt(_0x4708bc[_0x693a('0xa')])*0x3e8:0x5*0x3e8};try{_0x281f7e[_0x693a('0xb')]=_0x4708bc['data6']?JSON[_0x693a('0xc')](Mustache[_0x693a('0x8')](_0x4708bc[_0x693a('0xd')],_0x5ea42b)):{};}catch(_0x55cc3a){logger[_0x693a('0xe')](_0x55cc3a['stack']);}switch(_0x4708bc[_0x693a('0x7')][_0x693a('0xf')]()){case'GET':case _0x693a('0x10'):_0x1cbeac=null;_0x281f7e['qs']=_0x5ea42b;break;case _0x693a('0x11'):case'PUT':if(_0x4708bc[_0x693a('0x12')]){try{_0x1cbeac=JSON[_0x693a('0xc')](Mustache[_0x693a('0x8')](_0x4708bc[_0x693a('0x12')],_0x5ea42b));_0x281f7e['body']=_0x1cbeac;}catch(_0x27ab60){logger[_0x693a('0xe')](_0x27ab60[_0x693a('0x13')]);logger[_0x693a('0xe')](_0x693a('0x14'));}}else{_0x1cbeac=_0x5ea42b;_0x281f7e['body']=_0x1cbeac;}break;}logger[_0x693a('0x15')](util[_0x693a('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x4708bc['data1'],_0x4708bc[_0x693a('0x9')],JSON['stringify'](_0x281f7e)));rp(_0x281f7e)['then'](function(_0x606d88){_0x1cbeac=!_['isNil'](_0x1cbeac)?_0x693a('0x17')+_0x1cbeac:'';_0x14f954=typeof _0x606d88[_0x693a('0x18')]===_0x693a('0x19')?JSON['stringify'](_0x606d88['body']):_0x606d88[_0x693a('0x18')];logger['info'](util[_0x693a('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x4708bc[_0x693a('0x7')],_0x4708bc[_0x693a('0x9')],_0x606d88[_0x693a('0x1a')],_0x14f954));})['catch'](function(_0x2ddd7f){logger[_0x693a('0xe')](util[_0x693a('0x16')](_0x693a('0x1b'),_0x4708bc[_0x693a('0x7')],_0x4708bc[_0x693a('0x9')],_0x2ddd7f[_0x693a('0x1a')],_0x2ddd7f[_0x693a('0x1c')],_0x2ddd7f[_0x693a('0x1d')]));});}; \ No newline at end of file +var _0x7a8f=['data7','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','data1','toUpperCase','render','data2','data5','headers','data6','parse','error','GET','DELETE','POST','PUT'];(function(_0x1b7980,_0xce7b6f){var _0x50d300=function(_0x4cc76a){while(--_0x4cc76a){_0x1b7980['push'](_0x1b7980['shift']());}};_0x50d300(++_0xce7b6f);}(_0x7a8f,0x95));var _0xf7a8=function(_0x4d05c2,_0x3a05fc){_0x4d05c2=_0x4d05c2-0x0;var _0x38512a=_0x7a8f[_0x4d05c2];return _0x38512a;};'use strict';var rp=require(_0xf7a8('0x0'));var util=require(_0xf7a8('0x1'));var _=require(_0xf7a8('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x37da95,_0x2285f6){var _0x28298a,_0x15a3e2;var _0x22112d={'method':_0x37da95[_0xf7a8('0x3')][_0xf7a8('0x4')](),'uri':Mustache[_0xf7a8('0x5')](_0x37da95[_0xf7a8('0x6')],_0x2285f6),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x37da95[_0xf7a8('0x7')])==='number'&&parseInt(_0x37da95[_0xf7a8('0x7')])>=0x1&&parseInt(_0x37da95[_0xf7a8('0x7')])<=0xa?parseInt(_0x37da95[_0xf7a8('0x7')])*0x3e8:0x5*0x3e8};try{_0x22112d[_0xf7a8('0x8')]=_0x37da95[_0xf7a8('0x9')]?JSON[_0xf7a8('0xa')](Mustache[_0xf7a8('0x5')](_0x37da95[_0xf7a8('0x9')],_0x2285f6)):{};}catch(_0x4d43da){logger[_0xf7a8('0xb')](_0x4d43da['stack']);}switch(_0x37da95[_0xf7a8('0x3')][_0xf7a8('0x4')]()){case _0xf7a8('0xc'):case _0xf7a8('0xd'):_0x28298a=null;_0x22112d['qs']=_0x2285f6;break;case _0xf7a8('0xe'):case _0xf7a8('0xf'):if(_0x37da95[_0xf7a8('0x10')]){try{_0x28298a=JSON['parse'](Mustache[_0xf7a8('0x5')](_0x37da95[_0xf7a8('0x10')],_0x2285f6));_0x22112d['body']=_0x28298a;}catch(_0x596791){logger[_0xf7a8('0xb')](_0x596791[_0xf7a8('0x11')]);logger[_0xf7a8('0xb')](_0xf7a8('0x12'));}}else{_0x28298a=_0x2285f6;_0x22112d[_0xf7a8('0x13')]=_0x28298a;}break;}logger[_0xf7a8('0x14')](util[_0xf7a8('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x37da95['data1'],_0x37da95[_0xf7a8('0x6')],JSON[_0xf7a8('0x16')](_0x22112d)));rp(_0x22112d)[_0xf7a8('0x17')](function(_0x34e9b9){_0x28298a=!_[_0xf7a8('0x18')](_0x28298a)?_0xf7a8('0x19')+_0x28298a:'';_0x15a3e2=typeof _0x34e9b9[_0xf7a8('0x13')]===_0xf7a8('0x1a')?JSON['stringify'](_0x34e9b9[_0xf7a8('0x13')]):_0x34e9b9['body'];logger[_0xf7a8('0x14')](util[_0xf7a8('0x15')](_0xf7a8('0x1b'),_0x37da95['data1'],_0x37da95[_0xf7a8('0x6')],_0x34e9b9[_0xf7a8('0x1c')],_0x15a3e2));})[_0xf7a8('0x1d')](function(_0x1fe081){logger[_0xf7a8('0xb')](util[_0xf7a8('0x15')](_0xf7a8('0x1e'),_0x37da95['data1'],_0x37da95[_0xf7a8('0x6')],_0x1fe081[_0xf7a8('0x1c')],_0x1fe081[_0xf7a8('0x1f')],_0x1fe081[_0xf7a8('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index dcb18b1..d24e1d3 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 _0xc64b=['debug','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger','routing','client','request','then'];(function(_0x4d94e2,_0x5bd7db){var _0x5bcacf=function(_0x5af075){while(--_0x5af075){_0x4d94e2['push'](_0x4d94e2['shift']());}};_0x5bcacf(++_0x5bd7db);}(_0xc64b,0x117));var _0xbc64=function(_0x1bf57f,_0x255df4){_0x1bf57f=_0x1bf57f-0x0;var _0x23a86b=_0xc64b[_0x1bf57f];return _0x23a86b;};'use strict';var jayson=require(_0xbc64('0x0'));var BPromise=require(_0xbc64('0x1'));var logger=require(_0xbc64('0x2'))(_0xbc64('0x3'));var client=jayson[_0xbc64('0x4')]['http']({'port':0x2329});client['Request']=function(_0x4e10f8,_0x66e086){return new BPromise(function(_0x258199,_0x4666b7){return client[_0xbc64('0x5')](_0x4e10f8,_0x66e086)[_0xbc64('0x6')](function(_0x132929){logger[_0xbc64('0x7')]('rpc',_0xbc64('0x3'),_0x4e10f8,_0x66e086,_0x132929);if(_0x132929[_0xbc64('0x8')]){logger[_0xbc64('0x8')]('rpc',_0xbc64('0x3'),_0x4e10f8,_0x132929[_0xbc64('0x8')][_0xbc64('0x9')],_0x66e086);return _0x4666b7(_0x132929[_0xbc64('0x8')][_0xbc64('0x9')]);}else{return _0x258199(_0x132929[_0xbc64('0xa')]);}})[_0xbc64('0xb')](function(_0x5b316f){logger['error'](_0xbc64('0xc'),_0xbc64('0x3'),_0x4e10f8,_0x5b316f,_0x66e086);return _0x4666b7(_0x5b316f);});});};module['exports']=client; \ No newline at end of file +var _0x4938=['jayson/promise','bluebird','../../config/logger','routing','http','request','then','debug','rpc','error','message','result','catch'];(function(_0x46aed3,_0x1331f2){var _0x22724e=function(_0x51e6c9){while(--_0x51e6c9){_0x46aed3['push'](_0x46aed3['shift']());}};_0x22724e(++_0x1331f2);}(_0x4938,0x145));var _0x8493=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x4938[_0x77773a];return _0x1091a2;};'use strict';var jayson=require(_0x8493('0x0'));var BPromise=require(_0x8493('0x1'));var logger=require(_0x8493('0x2'))(_0x8493('0x3'));var client=jayson['client'][_0x8493('0x4')]({'port':0x2329});client['Request']=function(_0x3604d2,_0x40d9f7){return new BPromise(function(_0x10a62b,_0x44e23f){return client[_0x8493('0x5')](_0x3604d2,_0x40d9f7)[_0x8493('0x6')](function(_0x3ffff1){logger[_0x8493('0x7')](_0x8493('0x8'),_0x8493('0x3'),_0x3604d2,_0x40d9f7,_0x3ffff1);if(_0x3ffff1[_0x8493('0x9')]){logger['error']('rpc','routing',_0x3604d2,_0x3ffff1[_0x8493('0x9')][_0x8493('0xa')],_0x40d9f7);return _0x44e23f(_0x3ffff1['error'][_0x8493('0xa')]);}else{return _0x10a62b(_0x3ffff1[_0x8493('0xb')]);}})[_0x8493('0xc')](function(_0x50c53c){logger['error'](_0x8493('0x8'),_0x8493('0x3'),_0x3604d2,_0x50c53c,_0x40d9f7);return _0x44e23f(_0x50c53c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index a7a4dd7..7df37c2 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 _0xb279=['catch','Email\x20service\x20initialization','./server','./realtime','./lib/email','../../config/logger','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency'];(function(_0x540315,_0x5e4286){var _0x45b752=function(_0x42f23e){while(--_0x42f23e){_0x540315['push'](_0x540315['shift']());}};_0x45b752(++_0x5e4286);}(_0xb279,0x1d0));var _0x9b27=function(_0x512ee3,_0x22379b){_0x512ee3=_0x512ee3-0x0;var _0x2f5574=_0xb279[_0x512ee3];return _0x2f5574;};'use strict';var server=require(_0x9b27('0x0'));var Realtime=require(_0x9b27('0x1'));var EmailChannel=require(_0x9b27('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0x9b27('0x3'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x9b27('0x4')]()[_0x9b27('0x5')](mailAccount[_0x9b27('0x6')]())['then'](realtime[_0x9b27('0x7')]())[_0x9b27('0x5')](function(){email[_0x9b27('0x8')](realtime[_0x9b27('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x9b27('0x5')](function(){return initRealtime();})[_0x9b27('0x5')](function(){return setting[_0x9b27('0xa')]();})[_0x9b27('0x5')](function(_0x295122){return setInterval(initRealtime,_0x295122[_0x9b27('0xb')]*0x3e8);})[_0x9b27('0xc')](function(_0x109fb5){logger['error'](_0x9b27('0xd'),_0x109fb5);});}main(); \ No newline at end of file +var _0x1f51=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x422e2d,_0x482168){var _0x548f4b=function(_0x34b630){while(--_0x34b630){_0x422e2d['push'](_0x422e2d['shift']());}};_0x548f4b(++_0x482168);}(_0x1f51,0x7c));var _0x11f5=function(_0x196fb8,_0x669ab9){_0x196fb8=_0x196fb8-0x0;var _0x1b1963=_0x1f51[_0x196fb8];return _0x1b1963;};'use strict';var server=require(_0x11f5('0x0'));var Realtime=require(_0x11f5('0x1'));var EmailChannel=require(_0x11f5('0x2'));var mailAccount=require(_0x11f5('0x3'));var setting=require(_0x11f5('0x4'));var logger=require(_0x11f5('0x5'))(_0x11f5('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x11f5('0x7')]()[_0x11f5('0x8')](mailAccount[_0x11f5('0x9')]())[_0x11f5('0x8')](realtime[_0x11f5('0xa')]())[_0x11f5('0x8')](function(){email[_0x11f5('0xb')](realtime[_0x11f5('0xc')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x11f5('0x8')](function(){return initRealtime();})[_0x11f5('0x8')](function(){return setting[_0x11f5('0xd')]();})[_0x11f5('0x8')](function(_0xe71508){return setInterval(initRealtime,_0xe71508[_0x11f5('0xe')]*0x3e8);})[_0x11f5('0xf')](function(_0x4ce78f){logger[_0x11f5('0x10')](_0x11f5('0x11'),_0x4ce78f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 426a1ed..bcf3891 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 _0xe82a=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','smtp','Smtp','verified','catch','exports','lodash','bluebird','md5','ioredis','../../../config/environment','redis','defaults','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','prototype','key','status','Imap','messageStatus','isNil','stringify','emit','mailAccount:update','refresh','active','provider','custom','service','imapAccounts','hasOwnProperty','email','box','handleImapBox','bind','end','handleImapEnd','error','connected','name','total','messages','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xe82a,0x146));var _0xae82=function(_0x244c5c,_0x2d77e6){_0x244c5c=_0x244c5c-0x0;var _0x247e77=_0xe82a[_0x244c5c];return _0x247e77;};'use strict';var _=require(_0xae82('0x0'));var moment=require('moment');var BPromise=require(_0xae82('0x1'));var md5=require(_0xae82('0x2'));var Redis=require(_0xae82('0x3'));var config=require(_0xae82('0x4'));var logger=require('../../../config/logger')('email');config[_0xae82('0x5')]=_[_0xae82('0x6')](config[_0xae82('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xae82('0x7'));var EmailSmtp=require(_0xae82('0x8'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x199b1c){logger[_0xae82('0x9')](_0xae82('0xa'));this[_0xae82('0xb')]=_0x199b1c['mailAccounts'];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0xae82('0xc')]['emit']=function(_0x154cb1){var _0x51127c=this['mailAccounts'][_0x154cb1];var _0x1745eb={'id':_0x51127c['id'],'name':_0x51127c['name'],'key':_0x51127c[_0xae82('0xd')],'active':_0x51127c['active'],'Imap':{'status':_0x51127c['Imap'][_0xae82('0xe')],'messageStatus':_0x51127c[_0xae82('0xf')][_0xae82('0x10')],'total':_0x51127c[_0xae82('0xf')]['total']}};if(_[_0xae82('0x11')](md5Accounts[_0x154cb1])){md5Accounts[_0x154cb1]={};}var _0x9f4f63=md5(JSON[_0xae82('0x12')](_0x1745eb));if(md5Accounts[_0x154cb1][_0xae82('0x2')]!==_0x9f4f63){md5Accounts[_0x154cb1][_0xae82('0x2')]=_0x9f4f63;io[_0xae82('0x13')](_0xae82('0x14'),_0x1745eb);}};EmailChannel[_0xae82('0xc')][_0xae82('0x15')]=function(_0x54e070){for(var _0x33a318 in _0x54e070){if(_0x54e070['hasOwnProperty'](_0x33a318)){if(_0x54e070[_0x33a318][_0xae82('0xf')]&&_0x54e070[_0x33a318][_0xae82('0x16')]){var _0x23ce5a=_0x54e070[_0x33a318][_0xae82('0xf')];if(!_0x23ce5a['service']&&_0x54e070[_0x33a318][_0xae82('0x17')]!==_0xae82('0x18'))_0x23ce5a[_0xae82('0x19')]=_0x54e070[_0x33a318][_0xae82('0x17')];if(!this[_0xae82('0x1a')][_0xae82('0x1b')](_0x23ce5a['id'])){this['imapAccounts'][_0x23ce5a['id']]=new EmailImap(_0x23ce5a,_0x54e070[_0x33a318][_0xae82('0x1c')]);this['imapAccounts'][_0x23ce5a['id']]['on'](_0xae82('0x1d'),this[_0xae82('0x1e')]['bind'](this,_0x33a318));this[_0xae82('0x1a')][_0x23ce5a['id']]['on'](_0xae82('0x1c'),this['handleImapEmail'][_0xae82('0x1f')](this,_0x33a318));this[_0xae82('0x1a')][_0x23ce5a['id']]['on'](_0xae82('0x20'),this[_0xae82('0x21')][_0xae82('0x1f')](this,_0x33a318));this['imapAccounts'][_0x23ce5a['id']]['on'](_0xae82('0x22'),this['handleImapError'][_0xae82('0x1f')](this,_0x33a318));}}else{if(_['isNil'](this[_0xae82('0xb')][_0x33a318][_0xae82('0xf')])){this[_0xae82('0xb')][_0x33a318]['Imap']={};}this[_0xae82('0xb')][_0x33a318][_0xae82('0xf')][_0xae82('0xe')]='disabled';this['mailAccounts'][_0x33a318][_0xae82('0xf')][_0xae82('0x10')]='';this[_0xae82('0x13')](_0x33a318);}}}};EmailChannel[_0xae82('0xc')][_0xae82('0x1e')]=function(_0x20f7e6,_0x4e856c){if(this['mailAccounts'][_0x20f7e6]){this['mailAccounts'][_0x20f7e6][_0xae82('0xf')][_0xae82('0xe')]=_0xae82('0x23');this['mailAccounts'][_0x20f7e6][_0xae82('0xf')][_0xae82('0x10')]=_0x4e856c[_0xae82('0x24')];if(_0x4e856c['messages']){this[_0xae82('0xb')][_0x20f7e6][_0xae82('0xf')][_0xae82('0x25')]=_0x4e856c[_0xae82('0x26')]['total'];}return this[_0xae82('0x13')](_0x20f7e6);}};EmailChannel[_0xae82('0xc')]['handleImapEmail']=function(_0x48f86f,_0x18453f){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x18453f[_0xae82('0x27')],_0x18453f[_0xae82('0x28')],_0x18453f[_0xae82('0x29')],_0x48f86f);if(this[_0xae82('0xb')][_0x48f86f]){return mailAccount[_0xae82('0x2a')](_0x48f86f,_0x18453f)[_0xae82('0x2b')](function(_0x3c94d3){if(_0x3c94d3){logger[_0xae82('0x9')](_0xae82('0x2c'));}})['catch'](function(_0x1084ff){logger[_0xae82('0x22')](_0xae82('0x2d'),JSON[_0xae82('0x12')](_0x1084ff));});}};EmailChannel[_0xae82('0xc')]['handleImapEnd']=function(_0x5f3106){if(this[_0xae82('0xb')][_0x5f3106]&&this[_0xae82('0xb')][_0x5f3106][_0xae82('0xf')]){if(this[_0xae82('0x1a')][this['mailAccounts'][_0x5f3106]['Imap']['id']]){delete this[_0xae82('0x1a')][this['mailAccounts'][_0x5f3106][_0xae82('0xf')]['id']];}this[_0xae82('0xb')][_0x5f3106]['Imap'][_0xae82('0x2e')]=moment();this[_0xae82('0x13')](_0x5f3106);}};EmailChannel['prototype'][_0xae82('0x2f')]=function(_0x1e4309,_0x349396){if(this['mailAccounts'][_0x1e4309]){this[_0xae82('0xb')][_0x1e4309][_0xae82('0xf')][_0xae82('0xe')]='error';this[_0xae82('0xb')][_0x1e4309][_0xae82('0xf')][_0xae82('0x10')]=_0x349396;return this[_0xae82('0x13')](_0x1e4309);}};EmailChannel[_0xae82('0xc')]['sendMail']=function(_0x1cd867,_0x52f211){return this[_0xae82('0x30')]['send'](_0x1cd867,_0x52f211);};EmailChannel[_0xae82('0xc')]['verifySmtp']=function(_0x54645a){var _0x1d074d=this;if(this[_0xae82('0xb')][_0x54645a['id']]){if(_[_0xae82('0x11')](this['mailAccounts'][_0x54645a['id']][_0xae82('0x31')])){this[_0xae82('0xb')][_0x54645a['id']]['Smtp']={};}this[_0xae82('0xb')][_0x54645a['id']][_0xae82('0x31')][_0xae82('0x2e')]=moment();return new BPromise(function(_0x55ca42,_0xc767d9){return _0x1d074d['smtp']['verify'](_0x54645a)[_0xae82('0x2b')](function(_0x1431f2){_0x1d074d['mailAccounts'][_0x54645a['id']][_0xae82('0x31')][_0xae82('0xe')]=_0xae82('0x32');_0x1d074d['mailAccounts'][_0x54645a['id']][_0xae82('0x31')]['messageStatus']='';_0x1d074d[_0xae82('0x13')](_0x54645a['id']);_0x55ca42(_0x1431f2);})[_0xae82('0x33')](function(_0x41ed66){_0x1d074d[_0xae82('0xb')][_0x54645a['id']][_0xae82('0x31')][_0xae82('0xe')]=_0xae82('0x22');_0x1d074d[_0xae82('0xb')][_0x54645a['id']][_0xae82('0x31')][_0xae82('0x10')]=_0x41ed66;_0x1d074d[_0xae82('0x13')](_0x54645a['id']);_0xc767d9(_0x41ed66);});});}return this[_0xae82('0x30')]['verify'](_0x54645a);};module[_0xae82('0x34')]=EmailChannel; \ No newline at end of file +var _0x0719=['end','error','handleImapError','isNil','status','messages','firstName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','bluebird','md5','ioredis','../../../config/logger','email','defaults','localhost','socket.io-emitter','redis','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','stringify','mailAccount:update','refresh','custom','provider','hasOwnProperty','box','handleImapBox','handleImapEmail','bind'];(function(_0x43e97d,_0x56a06b){var _0x424cd9=function(_0x4f574b){while(--_0x4f574b){_0x43e97d['push'](_0x43e97d['shift']());}};_0x424cd9(++_0x56a06b);}(_0x0719,0x12c));var _0x9071=function(_0x4a96d2,_0x3fe8f4){_0x4a96d2=_0x4a96d2-0x0;var _0x23e6b3=_0x0719[_0x4a96d2];return _0x23e6b3;};'use strict';var _=require(_0x9071('0x0'));var moment=require('moment');var BPromise=require(_0x9071('0x1'));var md5=require(_0x9071('0x2'));var Redis=require(_0x9071('0x3'));var config=require('../../../config/environment');var logger=require(_0x9071('0x4'))(_0x9071('0x5'));config['redis']=_[_0x9071('0x6')](config['redis'],{'host':_0x9071('0x7'),'port':0x18eb});var io=require(_0x9071('0x8'))(new Redis(config[_0x9071('0x9')]));var EmailImap=require(_0x9071('0xa'));var EmailSmtp=require(_0x9071('0xb'));var mailAccount=require(_0x9071('0xc'));var md5Accounts={};function EmailChannel(_0x81849a){logger[_0x9071('0xd')](_0x9071('0xe'));this[_0x9071('0xf')]=_0x81849a[_0x9071('0xf')];this[_0x9071('0x10')]={};this[_0x9071('0x11')]=new EmailSmtp();}EmailChannel[_0x9071('0x12')][_0x9071('0x13')]=function(_0x249a30){var _0x2fb519=this[_0x9071('0xf')][_0x249a30];var _0x5f484d={'id':_0x2fb519['id'],'name':_0x2fb519[_0x9071('0x14')],'key':_0x2fb519[_0x9071('0x15')],'active':_0x2fb519[_0x9071('0x16')],'Imap':{'status':_0x2fb519[_0x9071('0x17')]['status'],'messageStatus':_0x2fb519[_0x9071('0x17')][_0x9071('0x18')],'total':_0x2fb519['Imap'][_0x9071('0x19')]}};if(_['isNil'](md5Accounts[_0x249a30])){md5Accounts[_0x249a30]={};}var _0x2021eb=md5(JSON[_0x9071('0x1a')](_0x5f484d));if(md5Accounts[_0x249a30][_0x9071('0x2')]!==_0x2021eb){md5Accounts[_0x249a30]['md5']=_0x2021eb;io['emit'](_0x9071('0x1b'),_0x5f484d);}};EmailChannel[_0x9071('0x12')][_0x9071('0x1c')]=function(_0x8fbaaf){for(var _0x45530c in _0x8fbaaf){if(_0x8fbaaf['hasOwnProperty'](_0x45530c)){if(_0x8fbaaf[_0x45530c][_0x9071('0x17')]&&_0x8fbaaf[_0x45530c]['active']){var _0x1f08c9=_0x8fbaaf[_0x45530c][_0x9071('0x17')];if(!_0x1f08c9['service']&&_0x8fbaaf[_0x45530c]['provider']!==_0x9071('0x1d'))_0x1f08c9['service']=_0x8fbaaf[_0x45530c][_0x9071('0x1e')];if(!this['imapAccounts'][_0x9071('0x1f')](_0x1f08c9['id'])){this[_0x9071('0x10')][_0x1f08c9['id']]=new EmailImap(_0x1f08c9,_0x8fbaaf[_0x45530c][_0x9071('0x5')]);this[_0x9071('0x10')][_0x1f08c9['id']]['on'](_0x9071('0x20'),this[_0x9071('0x21')]['bind'](this,_0x45530c));this[_0x9071('0x10')][_0x1f08c9['id']]['on'](_0x9071('0x5'),this[_0x9071('0x22')][_0x9071('0x23')](this,_0x45530c));this['imapAccounts'][_0x1f08c9['id']]['on'](_0x9071('0x24'),this['handleImapEnd'][_0x9071('0x23')](this,_0x45530c));this[_0x9071('0x10')][_0x1f08c9['id']]['on'](_0x9071('0x25'),this[_0x9071('0x26')][_0x9071('0x23')](this,_0x45530c));}}else{if(_[_0x9071('0x27')](this[_0x9071('0xf')][_0x45530c][_0x9071('0x17')])){this[_0x9071('0xf')][_0x45530c][_0x9071('0x17')]={};}this[_0x9071('0xf')][_0x45530c][_0x9071('0x17')][_0x9071('0x28')]='disabled';this[_0x9071('0xf')][_0x45530c][_0x9071('0x17')][_0x9071('0x18')]='';this[_0x9071('0x13')](_0x45530c);}}}};EmailChannel[_0x9071('0x12')][_0x9071('0x21')]=function(_0x471881,_0x4bd049){if(this[_0x9071('0xf')][_0x471881]){this[_0x9071('0xf')][_0x471881][_0x9071('0x17')]['status']='connected';this['mailAccounts'][_0x471881][_0x9071('0x17')][_0x9071('0x18')]=_0x4bd049['name'];if(_0x4bd049[_0x9071('0x29')]){this['mailAccounts'][_0x471881]['Imap'][_0x9071('0x19')]=_0x4bd049[_0x9071('0x29')]['total'];}return this[_0x9071('0x13')](_0x471881);}};EmailChannel[_0x9071('0x12')][_0x9071('0x22')]=function(_0x16f7d9,_0x3021af){logger[_0x9071('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3021af[_0x9071('0x2a')],_0x3021af['lastName'],_0x3021af['from'],_0x16f7d9);if(this[_0x9071('0xf')][_0x16f7d9]){return mailAccount[_0x9071('0x2b')](_0x16f7d9,_0x3021af)[_0x9071('0x2c')](function(_0x166268){if(_0x166268){logger['info'](_0x9071('0x2d'));}})[_0x9071('0x2e')](function(_0x45dbdc){logger[_0x9071('0x25')](_0x9071('0x2f'),JSON[_0x9071('0x1a')](_0x45dbdc));});}};EmailChannel[_0x9071('0x12')][_0x9071('0x30')]=function(_0x404e44){if(this[_0x9071('0xf')][_0x404e44]&&this['mailAccounts'][_0x404e44][_0x9071('0x17')]){if(this[_0x9071('0x10')][this[_0x9071('0xf')][_0x404e44][_0x9071('0x17')]['id']]){delete this[_0x9071('0x10')][this['mailAccounts'][_0x404e44]['Imap']['id']];}this['mailAccounts'][_0x404e44][_0x9071('0x17')][_0x9071('0x31')]=moment();this[_0x9071('0x13')](_0x404e44);}};EmailChannel[_0x9071('0x12')][_0x9071('0x26')]=function(_0x585090,_0xfce44f){if(this[_0x9071('0xf')][_0x585090]){this[_0x9071('0xf')][_0x585090][_0x9071('0x17')][_0x9071('0x28')]=_0x9071('0x25');this[_0x9071('0xf')][_0x585090][_0x9071('0x17')][_0x9071('0x18')]=_0xfce44f;return this[_0x9071('0x13')](_0x585090);}};EmailChannel[_0x9071('0x12')][_0x9071('0x32')]=function(_0x1936ed,_0x1e3f5d){return this[_0x9071('0x11')][_0x9071('0x33')](_0x1936ed,_0x1e3f5d);};EmailChannel[_0x9071('0x12')][_0x9071('0x34')]=function(_0x3c9228){var _0x552d09=this;if(this[_0x9071('0xf')][_0x3c9228['id']]){if(_[_0x9071('0x27')](this[_0x9071('0xf')][_0x3c9228['id']][_0x9071('0x35')])){this[_0x9071('0xf')][_0x3c9228['id']][_0x9071('0x35')]={};}this[_0x9071('0xf')][_0x3c9228['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x1a135e,_0x3fe078){return _0x552d09['smtp'][_0x9071('0x36')](_0x3c9228)[_0x9071('0x2c')](function(_0x6de721){_0x552d09[_0x9071('0xf')][_0x3c9228['id']][_0x9071('0x35')][_0x9071('0x28')]=_0x9071('0x37');_0x552d09[_0x9071('0xf')][_0x3c9228['id']][_0x9071('0x35')][_0x9071('0x18')]='';_0x552d09['emit'](_0x3c9228['id']);_0x1a135e(_0x6de721);})['catch'](function(_0x46f1b0){_0x552d09[_0x9071('0xf')][_0x3c9228['id']]['Smtp'][_0x9071('0x28')]=_0x9071('0x25');_0x552d09[_0x9071('0xf')][_0x3c9228['id']][_0x9071('0x35')][_0x9071('0x18')]=_0x46f1b0;_0x552d09['emit'](_0x3c9228['id']);_0x3fe078(_0x46f1b0);});});}return this[_0x9071('0x11')][_0x9071('0x36')](_0x3c9228);};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 79f5d3c..1736a03 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 _0x2c8f=['user','anonymous@xcally.com','modernAuthentication','xoauth2','data5','password','host','tls','required','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','stringify','textCode','upperFirst','util','iconv','Iconv','events','../../../config/logger','email','mailbox','account','getAccount','imap','once','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2c8f,0x192));var _0xf2c8=function(_0xc9721a,_0xc21747){_0xc9721a=_0xc9721a-0x0;var _0x217128=_0x2c8f[_0xc9721a];return _0x217128;};'use strict';var _=require('lodash');var util=require(_0xf2c8('0x0'));var Imap=require('imap');var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0xf2c8('0x1'))[_0xf2c8('0x2')];var EventEmitter=require(_0xf2c8('0x3'))['EventEmitter'];var utils=require('./utils');var logger=require(_0xf2c8('0x4'))(_0xf2c8('0x5'));function EmailImap(_0x182b73,_0x3ad7a0){this[_0xf2c8('0x6')]='INBOX';this[_0xf2c8('0x7')]=this[_0xf2c8('0x8')](_0x182b73,_0x3ad7a0);this[_0xf2c8('0x9')]=new Imap(this[_0xf2c8('0x7')]);this[_0xf2c8('0x9')][_0xf2c8('0xa')]('ready',this[_0xf2c8('0xb')][_0xf2c8('0xc')](this));this[_0xf2c8('0x9')][_0xf2c8('0xa')](_0xf2c8('0xd'),this[_0xf2c8('0xe')][_0xf2c8('0xc')](this));this[_0xf2c8('0x9')]['on']('error',this[_0xf2c8('0xf')]['bind'](this));this[_0xf2c8('0x9')][_0xf2c8('0x10')]();}util[_0xf2c8('0x11')](EmailImap,EventEmitter);EmailImap[_0xf2c8('0x12')][_0xf2c8('0x8')]=function(_0x40849c,_0x54dd36){var _0x3b86f0={'connTimeout':_0x40849c[_0xf2c8('0x13')]?_0x40849c[_0xf2c8('0x13')]*0x3e8:0x2710,'authTimeout':_0x40849c[_0xf2c8('0x14')]?_0x40849c[_0xf2c8('0x14')]*0x3e8:0x1388};if(_0x40849c[_0xf2c8('0x15')]){_0x3b86f0[_0xf2c8('0x16')]=_0x40849c['user'];_0x3b86f0[_0xf2c8('0x5')]=_0x54dd36||_0x40849c[_0xf2c8('0x16')]||_0xf2c8('0x17');if(_0x40849c[_0xf2c8('0x18')]){_0x3b86f0[_0xf2c8('0x19')]=utils['generateXOAuth2Token'](_0x40849c['CloudProvider'][_0xf2c8('0x1a')],_0x40849c[_0xf2c8('0x16')]);}else{_0x3b86f0[_0xf2c8('0x1b')]=_0x40849c[_0xf2c8('0x1b')];}}else{if(_0x40849c['authentication']){_0x3b86f0[_0xf2c8('0x16')]=_0x40849c[_0xf2c8('0x16')];_0x3b86f0[_0xf2c8('0x1b')]=_0x40849c['password'];}}_0x3b86f0[_0xf2c8('0x1c')]=_0x40849c[_0xf2c8('0x1c')];_0x3b86f0['port']=_0x40849c['port']||0x3e1;if(_0x40849c[_0xf2c8('0x1d')]){_0x3b86f0[_0xf2c8('0x1d')]=!![];}else{_0x3b86f0[_0xf2c8('0x1d')]=![];_0x3b86f0['autotls']=_0xf2c8('0x1e');}return _0x3b86f0;};EmailImap[_0xf2c8('0x12')][_0xf2c8('0xb')]=function(){this[_0xf2c8('0x9')]['openBox'](this[_0xf2c8('0x6')],![],this[_0xf2c8('0x1f')][_0xf2c8('0xc')](this));};EmailImap[_0xf2c8('0x12')][_0xf2c8('0x1f')]=function(_0x4d0e56,_0x93707c){if(_0x4d0e56){this['handleError'](_0x4d0e56,!![]);}else{this[_0xf2c8('0x20')](_0xf2c8('0x21'),_0x93707c);this[_0xf2c8('0x22')]();}};EmailImap[_0xf2c8('0x12')][_0xf2c8('0x23')]=function(_0x3160a5){if(_0x3160a5){this[_0xf2c8('0xf')](_0x3160a5,!![]);}else{this[_0xf2c8('0x9')][_0xf2c8('0xd')]();}};EmailImap[_0xf2c8('0x12')][_0xf2c8('0x22')]=function(){this[_0xf2c8('0x9')][_0xf2c8('0x24')](['UNSEEN'],this[_0xf2c8('0x25')]['bind'](this));};EmailImap['prototype'][_0xf2c8('0x25')]=function(_0x48bcf9,_0x3e9e8a){if(_0x48bcf9){this[_0xf2c8('0xf')](_0x48bcf9,!![]);}else{if(_0x3e9e8a[_0xf2c8('0x26')]){try{var _0x10c825=this[_0xf2c8('0x9')][_0xf2c8('0x27')](_0x3e9e8a,{'bodies':'','markSeen':!![]});_0x10c825['on'](_0xf2c8('0x28'),this['handleFetchMessage'][_0xf2c8('0xc')](this));_0x10c825[_0xf2c8('0xa')](_0xf2c8('0x29'),this[_0xf2c8('0x2a')][_0xf2c8('0xc')](this));_0x10c825[_0xf2c8('0xa')]('end',this[_0xf2c8('0x2b')]['bind'](this));}catch(_0x3a01db){logger['error'](_0x3a01db);}}else{this[_0xf2c8('0x9')][_0xf2c8('0x2c')](!![],this[_0xf2c8('0x23')][_0xf2c8('0xc')](this));}}};EmailImap[_0xf2c8('0x12')]['handleFetchMessage']=function(_0x3fb2b0){_0x3fb2b0['on'](_0xf2c8('0x2d'),this['handleMessageBody'][_0xf2c8('0xc')](this));_0x3fb2b0[_0xf2c8('0xa')]('attributes',this[_0xf2c8('0x2e')][_0xf2c8('0xc')](this));_0x3fb2b0[_0xf2c8('0xa')](_0xf2c8('0xd'),this[_0xf2c8('0x2f')]['bind'](this));};EmailImap['prototype'][_0xf2c8('0x30')]=function(_0x301567){simpleParser(_0x301567,{'Iconv':Iconv},this[_0xf2c8('0x31')][_0xf2c8('0xc')](this));};EmailImap[_0xf2c8('0x12')][_0xf2c8('0x2e')]=function(){};EmailImap[_0xf2c8('0x12')][_0xf2c8('0x2f')]=function(){};EmailImap['prototype'][_0xf2c8('0x31')]=function(_0x4775c6,_0x2a673a){if(_0x4775c6){logger['error'](_0x4775c6);}else{var _0x4ea8ad=this;utils['parser'](this['account'],_0x2a673a,function(_0x3af100){_0x4ea8ad['emit'](_0xf2c8('0x5'),_0x3af100);});}};EmailImap['prototype'][_0xf2c8('0x2b')]=function(){this['imap']['closeBox'](!![],this[_0xf2c8('0x23')][_0xf2c8('0xc')](this));};EmailImap['prototype'][_0xf2c8('0x2a')]=function(_0x93284c){this['handleError'](_0x93284c);this[_0xf2c8('0x9')][_0xf2c8('0x2c')](!![],this[_0xf2c8('0x23')][_0xf2c8('0xc')](this));};EmailImap[_0xf2c8('0x12')][_0xf2c8('0xe')]=function(){this['emit']('end');};EmailImap[_0xf2c8('0x12')]['handleError']=function(_0x1a27c8,_0x558fb6){logger[_0xf2c8('0x29')]('handleError',this[_0xf2c8('0x7')][_0xf2c8('0x5')],JSON[_0xf2c8('0x32')](_0x1a27c8));var _0x3fd25f='';if(_0x1a27c8){if(_0x1a27c8['textCode']){_0x3fd25f=_0x1a27c8[_0xf2c8('0x33')];}else{for(var _0x40fb25 in _0x1a27c8){if(_0x1a27c8['hasOwnProperty'](_0x40fb25)){_0x3fd25f+=_[_0xf2c8('0x34')](_0x40fb25)+':\x20'+_0x1a27c8[_0x40fb25]+'\x0a';}}}}if(_0x558fb6){this[_0xf2c8('0x9')][_0xf2c8('0xd')]();}else{this[_0xf2c8('0x20')](_0xf2c8('0x29'),_0x3fd25f);this[_0xf2c8('0x20')](_0xf2c8('0xd'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xafc4=['connect','inherits','prototype','getAccount','connTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','required','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','lodash','imap','simpleParser','iconv','Iconv','events','email','mailbox','INBOX','account','once','ready','handleReady','handleEnd','bind','error','handleError'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0xafc4,0x69));var _0x4afc=function(_0x45b4c3,_0x11bbb2){_0x45b4c3=_0x45b4c3-0x0;var _0x2427b0=_0xafc4[_0x45b4c3];return _0x2427b0;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var Imap=require(_0x4afc('0x1'));var simpleParser=require('mailparser')[_0x4afc('0x2')];var Iconv=require(_0x4afc('0x3'))[_0x4afc('0x4')];var EventEmitter=require(_0x4afc('0x5'))['EventEmitter'];var utils=require('./utils');var logger=require('../../../config/logger')(_0x4afc('0x6'));function EmailImap(_0x471d45,_0x16953b){this[_0x4afc('0x7')]=_0x4afc('0x8');this[_0x4afc('0x9')]=this['getAccount'](_0x471d45,_0x16953b);this[_0x4afc('0x1')]=new Imap(this[_0x4afc('0x9')]);this[_0x4afc('0x1')][_0x4afc('0xa')](_0x4afc('0xb'),this[_0x4afc('0xc')]['bind'](this));this['imap'][_0x4afc('0xa')]('end',this[_0x4afc('0xd')][_0x4afc('0xe')](this));this['imap']['on'](_0x4afc('0xf'),this[_0x4afc('0x10')][_0x4afc('0xe')](this));this[_0x4afc('0x1')][_0x4afc('0x11')]();}util[_0x4afc('0x12')](EmailImap,EventEmitter);EmailImap[_0x4afc('0x13')][_0x4afc('0x14')]=function(_0x5effb4,_0x26f3f1){var _0x429fd8={'connTimeout':_0x5effb4[_0x4afc('0x15')]?_0x5effb4[_0x4afc('0x15')]*0x3e8:0x2710,'authTimeout':_0x5effb4['authTimeout']?_0x5effb4['authTimeout']*0x3e8:0x1388};if(_0x5effb4[_0x4afc('0x16')]){_0x429fd8['user']=_0x5effb4[_0x4afc('0x17')];_0x429fd8[_0x4afc('0x6')]=_0x26f3f1||_0x5effb4[_0x4afc('0x17')]||_0x4afc('0x18');if(_0x5effb4[_0x4afc('0x19')]){_0x429fd8[_0x4afc('0x1a')]=utils[_0x4afc('0x1b')](_0x5effb4[_0x4afc('0x1c')][_0x4afc('0x1d')],_0x5effb4[_0x4afc('0x17')]);}else{_0x429fd8[_0x4afc('0x1e')]=_0x5effb4['password'];}}else{if(_0x5effb4[_0x4afc('0x1f')]){_0x429fd8[_0x4afc('0x17')]=_0x5effb4[_0x4afc('0x17')];_0x429fd8[_0x4afc('0x1e')]=_0x5effb4['password'];}}_0x429fd8[_0x4afc('0x20')]=_0x5effb4[_0x4afc('0x20')];_0x429fd8[_0x4afc('0x21')]=_0x5effb4[_0x4afc('0x21')]||0x3e1;if(_0x5effb4[_0x4afc('0x22')]){_0x429fd8[_0x4afc('0x22')]=!![];}else{_0x429fd8[_0x4afc('0x22')]=![];_0x429fd8['autotls']=_0x4afc('0x23');}return _0x429fd8;};EmailImap[_0x4afc('0x13')]['handleReady']=function(){this[_0x4afc('0x1')]['openBox'](this[_0x4afc('0x7')],![],this[_0x4afc('0x24')][_0x4afc('0xe')](this));};EmailImap[_0x4afc('0x13')][_0x4afc('0x24')]=function(_0x28a86c,_0x40a0db){if(_0x28a86c){this[_0x4afc('0x10')](_0x28a86c,!![]);}else{this[_0x4afc('0x25')](_0x4afc('0x26'),_0x40a0db);this[_0x4afc('0x27')]();}};EmailImap[_0x4afc('0x13')][_0x4afc('0x28')]=function(_0x55842c){if(_0x55842c){this[_0x4afc('0x10')](_0x55842c,!![]);}else{this[_0x4afc('0x1')][_0x4afc('0x29')]();}};EmailImap['prototype']['readUnseen']=function(){this['imap'][_0x4afc('0x2a')]([_0x4afc('0x2b')],this['handleReadUnseen'][_0x4afc('0xe')](this));};EmailImap[_0x4afc('0x13')]['handleReadUnseen']=function(_0x514278,_0x52e3dd){if(_0x514278){this[_0x4afc('0x10')](_0x514278,!![]);}else{if(_0x52e3dd[_0x4afc('0x2c')]){try{var _0x17a43d=this[_0x4afc('0x1')][_0x4afc('0x2d')](_0x52e3dd,{'bodies':'','markSeen':!![]});_0x17a43d['on'](_0x4afc('0x2e'),this['handleFetchMessage'][_0x4afc('0xe')](this));_0x17a43d[_0x4afc('0xa')](_0x4afc('0xf'),this[_0x4afc('0x2f')][_0x4afc('0xe')](this));_0x17a43d[_0x4afc('0xa')](_0x4afc('0x29'),this[_0x4afc('0x30')]['bind'](this));}catch(_0x1383cf){logger['error'](_0x1383cf);}}else{this['imap'][_0x4afc('0x31')](!![],this[_0x4afc('0x28')][_0x4afc('0xe')](this));}}};EmailImap[_0x4afc('0x13')][_0x4afc('0x32')]=function(_0x3f50cc){_0x3f50cc['on']('body',this[_0x4afc('0x33')][_0x4afc('0xe')](this));_0x3f50cc[_0x4afc('0xa')](_0x4afc('0x34'),this[_0x4afc('0x35')][_0x4afc('0xe')](this));_0x3f50cc['once'](_0x4afc('0x29'),this[_0x4afc('0x36')][_0x4afc('0xe')](this));};EmailImap[_0x4afc('0x13')]['handleMessageBody']=function(_0x4be1e6){simpleParser(_0x4be1e6,{'Iconv':Iconv},this[_0x4afc('0x37')][_0x4afc('0xe')](this));};EmailImap[_0x4afc('0x13')]['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x4afc('0x36')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x295b53,_0x1dc853){if(_0x295b53){logger[_0x4afc('0xf')](_0x295b53);}else{var _0x3e41f5=this;utils[_0x4afc('0x38')](this[_0x4afc('0x9')],_0x1dc853,function(_0x453e12){_0x3e41f5[_0x4afc('0x25')](_0x4afc('0x6'),_0x453e12);});}};EmailImap[_0x4afc('0x13')][_0x4afc('0x30')]=function(){this[_0x4afc('0x1')][_0x4afc('0x31')](!![],this[_0x4afc('0x28')][_0x4afc('0xe')](this));};EmailImap['prototype'][_0x4afc('0x2f')]=function(_0x6a8345){this[_0x4afc('0x10')](_0x6a8345);this[_0x4afc('0x1')][_0x4afc('0x31')](!![],this[_0x4afc('0x28')][_0x4afc('0xe')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0x4afc('0x29'));};EmailImap[_0x4afc('0x13')]['handleError']=function(_0xe62748,_0x38a1bb){logger[_0x4afc('0xf')](_0x4afc('0x10'),this['account'][_0x4afc('0x6')],JSON[_0x4afc('0x39')](_0xe62748));var _0x348bc1='';if(_0xe62748){if(_0xe62748[_0x4afc('0x3a')]){_0x348bc1=_0xe62748[_0x4afc('0x3a')];}else{for(var _0x2404fc in _0xe62748){if(_0xe62748['hasOwnProperty'](_0x2404fc)){_0x348bc1+=_[_0x4afc('0x3b')](_0x2404fc)+':\x20'+_0xe62748[_0x2404fc]+'\x0a';}}}}if(_0x38a1bb){this['imap'][_0x4afc('0x29')]();}else{this[_0x4afc('0x25')](_0x4afc('0xf'),_0x348bc1);this['emit']('end');}};module[_0x4afc('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index ca6a49a..808dccd 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 _0xcf14=['createTransport','compile','sendMail','prototype','verify','toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send'];(function(_0x57f7f1,_0x38ce10){var _0xca2d6b=function(_0x457d92){while(--_0x457d92){_0x57f7f1['push'](_0x57f7f1['shift']());}};_0xca2d6b(++_0x38ce10);}(_0xcf14,0x126));var _0x4cf1=function(_0xaa4454,_0x56dc09){_0xaa4454=_0xaa4454-0x0;var _0x58c5a5=_0xcf14[_0xaa4454];return _0x58c5a5;};'use strict';var nodemailer=require(_0x4cf1('0x0'));var inlineBase64=require(_0x4cf1('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x4cf1('0x2')]=function(_0x23c0e9,_0x40b419){return new Promise(function(_0x4f3a9a,_0x4e71d2){var _0x59277c=nodemailer[_0x4cf1('0x3')](_0x23c0e9);_0x59277c['use'](_0x4cf1('0x4'),inlineBase64());_0x59277c[_0x4cf1('0x5')](_0x40b419,function(_0x261e87,_0x36f2de){if(_0x261e87){_0x4e71d2(_0x261e87['toString']());}else{_0x4f3a9a(_0x36f2de);}});});};EmailSmtp[_0x4cf1('0x6')][_0x4cf1('0x7')]=function(_0x473341){return new Promise(function(_0x4aee3e,_0x581046){var _0x364d66=nodemailer[_0x4cf1('0x3')](_0x473341);_0x364d66[_0x4cf1('0x7')](function(_0x5e42cd,_0xf1a855){if(_0x5e42cd){_0x581046(_0x5e42cd[_0x4cf1('0x8')]());}else{if(_0xf1a855){_0x4aee3e(_0xf1a855);}else{_0x581046(_0x4cf1('0x9'));}}});});};module[_0x4cf1('0xa')]=EmailSmtp; \ No newline at end of file +var _0x16a8=['verify','toString','Not\x20verifired','nodemailer','prototype','send','createTransport','use','compile','sendMail'];(function(_0xf07ddf,_0x146cb6){var _0x7aef5=function(_0x519bd8){while(--_0x519bd8){_0xf07ddf['push'](_0xf07ddf['shift']());}};_0x7aef5(++_0x146cb6);}(_0x16a8,0x107));var _0x816a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x16a8[_0x4b369d];return _0x571a98;};'use strict';var nodemailer=require(_0x816a('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x816a('0x1')][_0x816a('0x2')]=function(_0x7dfb28,_0x10a95f){return new Promise(function(_0x1c0538,_0x50aa24){var _0x47d931=nodemailer[_0x816a('0x3')](_0x7dfb28);_0x47d931[_0x816a('0x4')](_0x816a('0x5'),inlineBase64());_0x47d931[_0x816a('0x6')](_0x10a95f,function(_0x292bd2,_0x242161){if(_0x292bd2){_0x50aa24(_0x292bd2['toString']());}else{_0x1c0538(_0x242161);}});});};EmailSmtp[_0x816a('0x1')][_0x816a('0x7')]=function(_0x1dc9c4){return new Promise(function(_0x572ad5,_0x20fdbb){var _0x284aaa=nodemailer[_0x816a('0x3')](_0x1dc9c4);_0x284aaa[_0x816a('0x7')](function(_0x5b5b7f,_0x30a858){if(_0x5b5b7f){_0x20fdbb(_0x5b5b7f[_0x816a('0x8')]());}else{if(_0x30a858){_0x572ad5(_0x30a858);}else{_0x20fdbb(_0x816a('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index adc59a5..a1ddbb7 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 _0x2381=['now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','parser','from','subject','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','messageId','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','address','anonymous','generate','@xcally.com','head','value','name','substring','indexOf','split','slice','join','length','isEmpty','html','test','replace','includes','','body','textAsHtml','0x1?_0x405b83[_0x1238('0x13')](0x0,-0x1)[_0x1238('0x14')]('\x20'):_0x5b8d77[_0x1238('0xf')];}return'Anonymous';}function getLastName(_0x2b7674){var _0x45066f=_[_0x1238('0xd')](_0x2b7674[_0x1238('0xe')]);if(_0x45066f&&_0x45066f[_0x1238('0xf')]){var _0x5233d7=_0x45066f[_0x1238('0xf')][_0x1238('0x12')](/\s+/);return _0x5233d7[_0x1238('0x15')]>0x1?_0x5233d7['pop']():'';}return'';}function getMails(_0x36ab36,_0x1bb460){var _0x418688='';for(var _0x1910eb=0x0;_0x1910eb<_0x1bb460['value'][_0x1238('0x15')];_0x1910eb+=0x1){if(_0x1bb460[_0x1238('0xe')][_0x1910eb][_0x1238('0x9')]!==_0x36ab36){if(!_[_0x1238('0x16')](_0x418688)){_0x418688+=',';}_0x418688+=_0x1bb460[_0x1238('0xe')][_0x1910eb][_0x1238('0xf')]||_0x1bb460[_0x1238('0xe')][_0x1910eb][_0x1238('0x9')]||'';_0x418688+='\x20<';_0x418688+=_0x1bb460['value'][_0x1910eb][_0x1238('0x9')]?_0x1bb460[_0x1238('0xe')][_0x1910eb][_0x1238('0x9')]:_0x1238('0xa')+random[_0x1238('0xb')](0x6)+_0x1238('0xc');_0x418688+='>';}}return _0x418688;}function parseEmail(_0x2367eb,_0xc2edc9,_0x2f3f1a){if(_0xc2edc9[_0x1238('0x17')]){var _0x489fdf=/)<[^<]*)*<\/script>/gi;while(_0x489fdf[_0x1238('0x18')](_0xc2edc9['html'])){_0xc2edc9[_0x1238('0x17')]=_0xc2edc9[_0x1238('0x17')][_0x1238('0x19')](_0x489fdf,'');}if(_0xc2edc9[_0x1238('0x17')][_0x1238('0x1a')](_0x1238('0x1b'))){var _0x404900=[];_0xc2edc9['attachments']['forEach'](_0x20061c=>{_0x404900[_0x1238('0x1c')](_0x20061c['filename']);});var _0x34c1ef=/]+>/g;var _0xa60f46=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x13a914=_0xc2edc9[_0x1238('0x17')][_0x1238('0x19')](_0xa60f46,_0x1238('0x1d'));var _0x37c309=_0x13a914[_0x1238('0x19')](_0x34c1ef,'_IMG');for(let _0x901b74=0x0;_0x901b74<_0x404900[_0x1238('0x15')];_0x901b74++){var _0x4f27fc=_0x37c309[_0x1238('0x19')](_0x1238('0x1e'),'\x20[Attachment:\x20'+_0x404900[_0x901b74]+_0x1238('0x1f'));_0x37c309=_0x4f27fc;}_0xc2edc9[_0x1238('0x17')]=_0x37c309;}_0x2f3f1a[_0x1238('0x20')]=_0xc2edc9['html'];}else{_0x2f3f1a['body']=_0xc2edc9[_0x1238('0x21')];}if(_0x2f3f1a['body']){_0x2f3f1a[_0x1238('0x20')]=_0x2f3f1a[_0x1238('0x20')][_0x1238('0x19')](/0x0){var _0x5a621d=[_0x1238('0x32'),_0x1238('0x33'),_0x1238('0x34')];for(var _0x327dcc=0x0;_0x327dcc<_0xc2edc9[_0x1238('0x31')][_0x1238('0x15')];_0x327dcc++){var _0x709713=_[_0x1238('0x11')](_0x5a621d,_0xc2edc9['headerLines'][_0x327dcc]['line']);if(_0x709713>=0x0){_0x2f3f1a[_0x1238('0x35')]=!![];}}}return _0x2f3f1a;}exports[_0x1238('0x36')]=function(_0x18f310,_0x1919c3,_0x16380a){var _0x5b4dd8={'from':getAddress(_0x1919c3[_0x1238('0x37')]),'firstName':getFirstName(_0x1919c3['from']),'lastName':getLastName(_0x1919c3[_0x1238('0x37')]),'mapKey':'email','message':{'from':getMails(_0x18f310[_0x1238('0x7')],_0x1919c3[_0x1238('0x37')]),'to':_0x18f310[_0x1238('0x7')],'cc':'','subject':_0x1919c3[_0x1238('0x38')]||'','messageId':_0x1919c3['messageId'],'inReplyTo':_0x1919c3[_0x1238('0x39')],'sentAt':moment(_0x1919c3['date'])[_0x1238('0x29')](_0x1238('0x3a')),'attach':![],'attachments':[]}};if(!_0x1919c3['html']&&!_0x1919c3[_0x1238('0x21')]){var _0x460b3c=_['filter'](_0x1919c3[_0x1238('0x27')],{'contentType':_0x1238('0x3b')});if(_0x460b3c[_0x1238('0x15')]){logger[_0x1238('0x3c')](util[_0x1238('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x1919c3[_0x1238('0x3d')]));tnef[_0x1238('0x3e')](_[_0x1238('0x3f')](_0x460b3c)['content'],function(_0x3de924,_0x18d8d3){if(_0x18d8d3){_0x1919c3[_0x1238('0x17')]=_0x18d8d3[_0x1238('0x40')]||_0x1238('0x41');if(_0x18d8d3[_0x1238('0x42')]){for(var _0x613417=0x0;_0x613417<_0x18d8d3[_0x1238('0x42')][_0x1238('0x15')];_0x613417++){var _0x12b1a4=_0x18d8d3['Attachments'][_0x613417];_0x5b4dd8[_0x1238('0x23')]['attachments'][_0x1238('0x1c')]({'filename':_0x12b1a4[_0x1238('0x43')],'content':Buffer[_0x1238('0x37')](_0x12b1a4['Data'])});}}}_0x16380a(parseEmail(_0x18f310,_0x1919c3,_0x5b4dd8));});}else{_0x1919c3[_0x1238('0x17')]=_0x1238('0x41');_0x16380a(parseEmail(_0x18f310,_0x1919c3,_0x5b4dd8));}}else{_0x16380a(parseEmail(_0x18f310,_0x1919c3,_0x5b4dd8));}};exports[_0x1238('0x44')]=function(_0x3c5576,_0x3f5300){var _0x2e9658=[_0x1238('0x45')+(_0x3f5300||''),_0x1238('0x46')+_0x3c5576,'',''];return Buffer['from'](_0x2e9658[_0x1238('0x14')](''),_0x1238('0x47'))['toString'](_0x1238('0x48'));}; \ No newline at end of file +var _0x8c5d=['server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','line','isAutoreply','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Data','auth=Bearer\x20','utf-8','base64','lodash','moment','path','util','node-tnef','../../../config/logger','../../../config/environment','head','address','generate','@xcally.com','value','name','indexOf','slice','join','Anonymous','split','length','anonymous','html','test','replace','','body','textAsHtml','0x1?_0x33d610[_0xd8c5('0xe')](0x0,-0x1)[_0xd8c5('0xf')]('\x20'):_0x594bc4[_0xd8c5('0xc')];}return _0xd8c5('0x10');}function getLastName(_0xd361e5){var _0x33c0d9=_['head'](_0xd361e5['value']);if(_0x33c0d9&&_0x33c0d9[_0xd8c5('0xc')]){var _0x3977ff=_0x33c0d9[_0xd8c5('0xc')][_0xd8c5('0x11')](/\s+/);return _0x3977ff['length']>0x1?_0x3977ff['pop']():'';}return'';}function getMails(_0x214d10,_0x39a344){var _0x573295='';for(var _0x2cfac4=0x0;_0x2cfac4<_0x39a344[_0xd8c5('0xb')][_0xd8c5('0x12')];_0x2cfac4+=0x1){if(_0x39a344['value'][_0x2cfac4][_0xd8c5('0x8')]!==_0x214d10){if(!_['isEmpty'](_0x573295)){_0x573295+=',';}_0x573295+=_0x39a344[_0xd8c5('0xb')][_0x2cfac4][_0xd8c5('0xc')]||_0x39a344[_0xd8c5('0xb')][_0x2cfac4][_0xd8c5('0x8')]||'';_0x573295+='\x20<';_0x573295+=_0x39a344[_0xd8c5('0xb')][_0x2cfac4][_0xd8c5('0x8')]?_0x39a344['value'][_0x2cfac4][_0xd8c5('0x8')]:_0xd8c5('0x13')+random[_0xd8c5('0x9')](0x6)+'@xcally.com';_0x573295+='>';}}return _0x573295;}function parseEmail(_0x31b5c9,_0x2c7f16,_0x465802){if(_0x2c7f16[_0xd8c5('0x14')]){var _0x36735b=/)<[^<]*)*<\/script>/gi;while(_0x36735b[_0xd8c5('0x15')](_0x2c7f16[_0xd8c5('0x14')])){_0x2c7f16[_0xd8c5('0x14')]=_0x2c7f16[_0xd8c5('0x14')][_0xd8c5('0x16')](_0x36735b,'');}if(_0x2c7f16[_0xd8c5('0x14')]['includes'](_0xd8c5('0x17'))){var _0x3a5ae2=[];_0x2c7f16[_0xd8c5('0x18')]['forEach'](_0x4a5020=>{_0x3a5ae2[_0xd8c5('0x19')](_0x4a5020[_0xd8c5('0x1a')]);});var _0x5b668c=/]+>/g;var _0x16787c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1c41a8=_0x2c7f16[_0xd8c5('0x14')]['replace'](_0x16787c,_0xd8c5('0x1b'));var _0x47fd86=_0x1c41a8[_0xd8c5('0x16')](_0x5b668c,_0xd8c5('0x1c'));for(let _0x43f97b=0x0;_0x43f97b<_0x3a5ae2['length'];_0x43f97b++){var _0x864bbc=_0x47fd86[_0xd8c5('0x16')]('_IMG','\x20[Attachment:\x20'+_0x3a5ae2[_0x43f97b]+_0xd8c5('0x1d'));_0x47fd86=_0x864bbc;}_0x2c7f16[_0xd8c5('0x14')]=_0x47fd86;}_0x465802[_0xd8c5('0x1e')]=_0x2c7f16[_0xd8c5('0x14')];}else{_0x465802['body']=_0x2c7f16[_0xd8c5('0x1f')];}if(_0x465802['body']){_0x465802[_0xd8c5('0x1e')]=_0x465802[_0xd8c5('0x1e')][_0xd8c5('0x16')](/0x0){var _0x56b140=[_0xd8c5('0x33'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x59bf10=0x0;_0x59bf10<_0x2c7f16[_0xd8c5('0x32')][_0xd8c5('0x12')];_0x59bf10++){var _0x209566=_['indexOf'](_0x56b140,_0x2c7f16['headerLines'][_0x59bf10][_0xd8c5('0x34')]);if(_0x209566>=0x0){_0x465802[_0xd8c5('0x35')]=!![];}}}return _0x465802;}exports['parser']=function(_0xf95645,_0x3f1f78,_0x2f4917){var _0x2dcb9a={'from':getAddress(_0x3f1f78[_0xd8c5('0x36')]),'firstName':getFirstName(_0x3f1f78[_0xd8c5('0x36')]),'lastName':getLastName(_0x3f1f78[_0xd8c5('0x36')]),'mapKey':_0xd8c5('0x23'),'message':{'from':getMails(_0xf95645[_0xd8c5('0x23')],_0x3f1f78[_0xd8c5('0x36')]),'to':_0xf95645[_0xd8c5('0x23')],'cc':'','subject':_0x3f1f78[_0xd8c5('0x37')]||'','messageId':_0x3f1f78[_0xd8c5('0x38')],'inReplyTo':_0x3f1f78['inReplyTo'],'sentAt':moment(_0x3f1f78[_0xd8c5('0x39')])[_0xd8c5('0x2a')](_0xd8c5('0x3a')),'attach':![],'attachments':[]}};if(!_0x3f1f78['html']&&!_0x3f1f78[_0xd8c5('0x1f')]){var _0x53cb2f=_[_0xd8c5('0x3b')](_0x3f1f78['attachments'],{'contentType':'application/ms-tnef'});if(_0x53cb2f[_0xd8c5('0x12')]){logger['info'](util[_0xd8c5('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x3f1f78[_0xd8c5('0x38')]));tnef[_0xd8c5('0x3c')](_[_0xd8c5('0x3d')](_0x53cb2f)[_0xd8c5('0x30')],function(_0x38a930,_0x337d5d){if(_0x337d5d){_0x3f1f78[_0xd8c5('0x14')]=_0x337d5d[_0xd8c5('0x3e')]||_0xd8c5('0x3f');if(_0x337d5d[_0xd8c5('0x40')]){for(var _0x1c9117=0x0;_0x1c9117<_0x337d5d['Attachments'][_0xd8c5('0x12')];_0x1c9117++){var _0x25b96f=_0x337d5d[_0xd8c5('0x40')][_0x1c9117];_0x2dcb9a[_0xd8c5('0x21')][_0xd8c5('0x18')][_0xd8c5('0x19')]({'filename':_0x25b96f['Title'],'content':Buffer['from'](_0x25b96f[_0xd8c5('0x41')])});}}}_0x2f4917(parseEmail(_0xf95645,_0x3f1f78,_0x2dcb9a));});}else{_0x3f1f78[_0xd8c5('0x14')]=_0xd8c5('0x3f');_0x2f4917(parseEmail(_0xf95645,_0x3f1f78,_0x2dcb9a));}}else{_0x2f4917(parseEmail(_0xf95645,_0x3f1f78,_0x2dcb9a));}};exports['generateXOAuth2Token']=function(_0x268bd6,_0x1fa06e){var _0x248e8f=['user='+(_0x1fa06e||''),_0xd8c5('0x42')+_0x268bd6,'',''];return Buffer[_0xd8c5('0x36')](_0x248e8f[_0xd8c5('0xf')](''),_0xd8c5('0x43'))['toString'](_0xd8c5('0x44'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 39c186d..a97b391 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 _0xae8b=['Service','key','active','Imap','Smtp','lodash','name'];(function(_0x10b995,_0x9dede4){var _0x328bcb=function(_0x557f68){while(--_0x557f68){_0x10b995['push'](_0x10b995['shift']());}};_0x328bcb(++_0x9dede4);}(_0xae8b,0x16a));var _0xbae8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xae8b[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xbae8('0x0'));function MailAccount(_0x12e6a4){this['id']=_0x12e6a4['id']||0x0;this['name']=_0x12e6a4[_0xbae8('0x1')]||_0xbae8('0x2');this[_0xbae8('0x3')]=_0x12e6a4[_0xbae8('0x3')]||'SERV';this[_0xbae8('0x4')]=_0x12e6a4['active']||![];this[_0xbae8('0x5')]=_0x12e6a4[_0xbae8('0x5')]||[];this[_0xbae8('0x6')]=_0x12e6a4[_0xbae8('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xd6b4=['lodash','name','Service','key','active','Imap','Smtp','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd6b4,0x150));var _0x4d6b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd6b4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4d6b('0x0'));function MailAccount(_0xc7627d){this['id']=_0xc7627d['id']||0x0;this[_0x4d6b('0x1')]=_0xc7627d[_0x4d6b('0x1')]||_0x4d6b('0x2');this[_0x4d6b('0x3')]=_0xc7627d[_0x4d6b('0x3')]||'SERV';this[_0x4d6b('0x4')]=_0xc7627d['active']||![];this[_0x4d6b('0x5')]=_0xc7627d[_0x4d6b('0x5')]||[];this[_0x4d6b('0x6')]=_0xc7627d[_0x4d6b('0x6')]||[];}module[_0x4d6b('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index c4aaa57..3a7c02c 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 _0x5cdb=['isUndefined','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x5cdb,0x137));var _0xb5cd=function(_0x453407,_0x3f8145){_0x453407=_0x453407-0x0;var _0x139f58=_0x5cdb[_0x453407];return _0x139f58;};'use strict';var _=require(_0xb5cd('0x0'));var MailAccount=require(_0xb5cd('0x1'));var Realtime=function(){this[_0xb5cd('0x2')]={};};function freeIsNotKey(_0x2e5b74,_0xb29499,_0x40eb5e){var _0xb7df94=_[_0xb5cd('0x3')](_0x2e5b74,function(_0x2323c8,_0x2bbdaf){return _0x2323c8[_0x40eb5e];});for(var _0x4818e9 in _0xb29499){if(_0xb29499[_0xb5cd('0x4')](_0x4818e9)){if(!_0xb7df94[_0x4818e9]){delete _0xb29499[_0x4818e9];}}}}Realtime[_0xb5cd('0x5')][_0xb5cd('0x6')]=function(_0x2d7072,_0x180faa){for(var _0x347d97 in _0x180faa){if(_0x2d7072['hasOwnProperty'](_0x347d97)){_0x2d7072[_0x347d97]=_0x180faa[_0x347d97];}}};Realtime[_0xb5cd('0x5')][_0xb5cd('0x7')]=function(){var _0x5b22ab=this;return function(_0x30970b){if(_0x30970b){freeIsNotKey(_0x30970b,_0x5b22ab['mailAccounts'],'id');for(var _0x2f04a1=0x0,_0x3f22be={},_0x188e7b={};_0x2f04a1<_0x30970b[_0xb5cd('0x8')];_0x2f04a1+=0x1){_0x3f22be=_0x30970b[_0x2f04a1];if(_[_0xb5cd('0x9')](_0x5b22ab[_0xb5cd('0x2')][_0x3f22be['id']])){_0x5b22ab[_0xb5cd('0x2')][_0x3f22be['id']]=new MailAccount(_0x3f22be);}else{_['merge'](_0x5b22ab['mailAccounts'][_0x3f22be['id']],_0x3f22be);}}}return _0x5b22ab[_0xb5cd('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0x644b=['prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0xf77fa6,_0x4c9df8){var _0x5bd317=function(_0x4af34a){while(--_0x4af34a){_0xf77fa6['push'](_0xf77fa6['shift']());}};_0x5bd317(++_0x4c9df8);}(_0x644b,0x14b));var _0xb644=function(_0x1a8506,_0x4f55a8){_0x1a8506=_0x1a8506-0x0;var _0x2648b5=_0x644b[_0x1a8506];return _0x2648b5;};'use strict';var _=require(_0xb644('0x0'));var MailAccount=require(_0xb644('0x1'));var Realtime=function(){this[_0xb644('0x2')]={};};function freeIsNotKey(_0x27c9ef,_0x4d8e9b,_0x16647a){var _0x2e9d05=_[_0xb644('0x3')](_0x27c9ef,function(_0x3602df,_0x407940){return _0x3602df[_0x16647a];});for(var _0x662fd5 in _0x4d8e9b){if(_0x4d8e9b[_0xb644('0x4')](_0x662fd5)){if(!_0x2e9d05[_0x662fd5]){delete _0x4d8e9b[_0x662fd5];}}}}Realtime[_0xb644('0x5')][_0xb644('0x6')]=function(_0x7432c6,_0x2fb62f){for(var _0x1c51ed in _0x2fb62f){if(_0x7432c6[_0xb644('0x4')](_0x1c51ed)){_0x7432c6[_0x1c51ed]=_0x2fb62f[_0x1c51ed];}}};Realtime[_0xb644('0x5')][_0xb644('0x7')]=function(){var _0x4cc425=this;return function(_0x5df4e5){if(_0x5df4e5){freeIsNotKey(_0x5df4e5,_0x4cc425[_0xb644('0x2')],'id');for(var _0xdee0c0=0x0,_0x39858d={},_0x43f208={};_0xdee0c0<_0x5df4e5[_0xb644('0x8')];_0xdee0c0+=0x1){_0x39858d=_0x5df4e5[_0xdee0c0];if(_[_0xb644('0x9')](_0x4cc425[_0xb644('0x2')][_0x39858d['id']])){_0x4cc425[_0xb644('0x2')][_0x39858d['id']]=new MailAccount(_0x39858d);}else{_[_0xb644('0xa')](_0x4cc425[_0xb644('0x2')][_0x39858d['id']],_0x39858d);}}}return _0x4cc425['mailAccounts'];};};module[_0xb644('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 5a966d2..2b65f34 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 _0x1488=['getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','email','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','data5','MailServerOut','Smtp','type'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x1488,0x88));var _0x8148=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x1488[_0x3ee55a];return _0x581800;};'use strict';var client=require(_0x8148('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x8148('0x1')](_0x8148('0x2'),{'options':{'attributes':['id',_0x8148('0x3'),'provider','service',_0x8148('0x4'),'active',_0x8148('0x5'),_0x8148('0x6'),_0x8148('0x7')],'raw':![],'include':[{'model':_0x8148('0x8'),'as':_0x8148('0x9'),'include':[{'model':_0x8148('0xa'),'attributes':['id',_0x8148('0x3'),_0x8148('0xb'),'type',_0x8148('0xc')],'as':_0x8148('0xa')}]},{'model':_0x8148('0xd'),'as':_0x8148('0xe'),'include':[{'model':_0x8148('0xa'),'attributes':['id',_0x8148('0x3'),_0x8148('0xb'),_0x8148('0xf'),_0x8148('0xc')],'as':_0x8148('0xa')}]}]},'log':_0x8148('0x10')});};};exports[_0x8148('0x11')]=function(_0x5855a7,_0x2b8959){return client[_0x8148('0x1')](_0x8148('0x12'),{'account':{'id':_0x5855a7},'body':_0x2b8959,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xdbfa=['type','MailServerOut','Smtp','data5','getMailAccount','notify','Request','NotifyMailAccount','GetMailAccount','provider','service','active','key','ListId','TemplateId','MailServerIn','CloudProvider','name'];(function(_0x4614cc,_0x1253ac){var _0x4debec=function(_0x6c4a58){while(--_0x6c4a58){_0x4614cc['push'](_0x4614cc['shift']());}};_0x4debec(++_0x1253ac);}(_0xdbfa,0x128));var _0xadbf=function(_0x20ce09,_0x2a1e86){_0x20ce09=_0x20ce09-0x0;var _0x1ea138=_0xdbfa[_0x20ce09];return _0x1ea138;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request'](_0xadbf('0x0'),{'options':{'attributes':['id','name',_0xadbf('0x1'),_0xadbf('0x2'),'email',_0xadbf('0x3'),_0xadbf('0x4'),_0xadbf('0x5'),_0xadbf('0x6')],'raw':![],'include':[{'model':_0xadbf('0x7'),'as':'Imap','include':[{'model':_0xadbf('0x8'),'attributes':['id',_0xadbf('0x9'),_0xadbf('0x2'),_0xadbf('0xa'),'data5'],'as':_0xadbf('0x8')}]},{'model':_0xadbf('0xb'),'as':_0xadbf('0xc'),'include':[{'model':'CloudProvider','attributes':['id',_0xadbf('0x9'),_0xadbf('0x2'),_0xadbf('0xa'),_0xadbf('0xd')],'as':_0xadbf('0x8')}]}]},'log':_0xadbf('0xe')});};};exports[_0xadbf('0xf')]=function(_0x11b6c1,_0x53e912){return client[_0xadbf('0x10')](_0xadbf('0x11'),{'account':{'id':_0x11b6c1},'body':_0x53e912,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index de59753..fa82509 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 _0xeb87=['../client','getSettings','Request','loginMailFrequency','GetSettings'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0xeb87,0xa5));var _0x7eb8=function(_0x43b4c6,_0x1c9c80){_0x43b4c6=_0x43b4c6-0x0;var _0x5b5e9b=_0xeb87[_0x43b4c6];return _0x5b5e9b;};'use strict';var client=require(_0x7eb8('0x0'));exports[_0x7eb8('0x1')]=function(){return client[_0x7eb8('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7eb8('0x3')]},'log':_0x7eb8('0x4')});}; \ No newline at end of file +var _0xad44=['getSettings','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x23efc4,_0x40fc50){var _0x470d95=function(_0x2cb92a){while(--_0x2cb92a){_0x23efc4['push'](_0x23efc4['shift']());}};_0x470d95(++_0x40fc50);}(_0xad44,0x162));var _0x4ad4=function(_0x3d2d6f,_0x368872){_0x3d2d6f=_0x3d2d6f-0x0;var _0x5c0022=_0xad44[_0x3d2d6f];return _0x5c0022;};'use strict';var client=require(_0x4ad4('0x0'));exports[_0x4ad4('0x1')]=function(){return client['Request'](_0x4ad4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4ad4('0x3')]},'log':_0x4ad4('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 5317a78..38090b9 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 8cda1c9..424d950 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 _0x6af1=['localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','ioredis','../../config/environment','timeout','port','websocket','polling','redis'];(function(_0x2129b2,_0x3637a8){var _0x5dc81d=function(_0x42fd5c){while(--_0x42fd5c){_0x2129b2['push'](_0x2129b2['shift']());}};_0x5dc81d(++_0x3637a8);}(_0x6af1,0x70));var _0x16af=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6af1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var http=require(_0x16af('0x0'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x16af('0x1'));var config=require(_0x16af('0x2'));var app=express();var server=http['createServer'](app);server[_0x16af('0x3')]=0xdbba0;if(sticky['listen'](server,config[_0x16af('0x4')])){var socketio=require('socket.io')(server,{'transports':[_0x16af('0x5'),_0x16af('0x6')]});config[_0x16af('0x7')]=_['defaults'](config[_0x16af('0x7')],{'host':_0x16af('0x8'),'port':0x18eb});socketio[_0x16af('0x9')](require(_0x16af('0xa'))({'pubClient':new Redis(config[_0x16af('0x7')]),'subClient':new Redis(config[_0x16af('0x7')])}));require(_0x16af('0xb'))[_0x16af('0xc')]();require(_0x16af('0xd'))[_0x16af('0xc')](socketio);require(_0x16af('0xe'))[_0x16af('0xc')](app);require(_0x16af('0xf'))['default'](app);}else{server[_0x16af('0x10')](_0x16af('0x11'),function(){console[_0x16af('0x12')](_0x16af('0x13'),config[_0x16af('0x4')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x5d32=['log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','timeout','listen','socket.io','polling','redis','defaults','localhost','adapter','../../config/socketio','default','../../routes'];(function(_0xb2fa87,_0x68ed62){var _0x1f4ddd=function(_0x433414){while(--_0x433414){_0xb2fa87['push'](_0xb2fa87['shift']());}};_0x1f4ddd(++_0x68ed62);}(_0x5d32,0xc1));var _0x25d3=function(_0x51539c,_0x25f587){_0x51539c=_0x51539c-0x0;var _0x4f7914=_0x5d32[_0x51539c];return _0x4f7914;};'use strict';var _=require(_0x25d3('0x0'));var http=require(_0x25d3('0x1'));var express=require(_0x25d3('0x2'));var sticky=require(_0x25d3('0x3'));var Redis=require(_0x25d3('0x4'));var config=require(_0x25d3('0x5'));var app=express();var server=http['createServer'](app);server[_0x25d3('0x6')]=0xdbba0;if(sticky[_0x25d3('0x7')](server,config['port'])){var socketio=require(_0x25d3('0x8'))(server,{'transports':['websocket',_0x25d3('0x9')]});config[_0x25d3('0xa')]=_[_0x25d3('0xb')](config[_0x25d3('0xa')],{'host':_0x25d3('0xc'),'port':0x18eb});socketio[_0x25d3('0xd')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x25d3('0xa')])}));require('../../config/triggers')['default']();require(_0x25d3('0xe'))[_0x25d3('0xf')](socketio);require('../../config/express')[_0x25d3('0xf')](app);require(_0x25d3('0x10'))[_0x25d3('0xf')](app);}else{server['once']('listening',function(){console[_0x25d3('0x11')](_0x25d3('0x12'),config[_0x25d3('0x13')]);});}exports=module[_0x25d3('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 3cf882f..f45ccb4 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 _0xb693=['Request','then','debug','rpc','error','message','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x3835d6,_0x11022c){var _0x312bfe=function(_0x5a3b44){while(--_0x5a3b44){_0x3835d6['push'](_0x3835d6['shift']());}};_0x312bfe(++_0x11022c);}(_0xb693,0xb0));var _0x3b69=function(_0x3b2c6f,_0xa9f35c){_0x3b2c6f=_0x3b2c6f-0x0;var _0x22e219=_0xb693[_0x3b2c6f];return _0x22e219;};'use strict';var jayson=require(_0x3b69('0x0'));var BPromise=require(_0x3b69('0x1'));var logger=require(_0x3b69('0x2'))(_0x3b69('0x3'));var client=jayson[_0x3b69('0x4')][_0x3b69('0x5')]({'port':0x2329});client[_0x3b69('0x6')]=function(_0x162e07,_0x2784ba){return new BPromise(function(_0x345455,_0x1e508a){return client['request'](_0x162e07,_0x2784ba)[_0x3b69('0x7')](function(_0x4756fc){logger[_0x3b69('0x8')](_0x3b69('0x9'),_0x3b69('0x3'),_0x162e07,_0x2784ba,_0x4756fc);if(_0x4756fc[_0x3b69('0xa')]){logger[_0x3b69('0xa')](_0x3b69('0x9'),'routing',_0x162e07,_0x4756fc[_0x3b69('0xa')][_0x3b69('0xb')],_0x2784ba);return _0x1e508a(_0x4756fc[_0x3b69('0xa')][_0x3b69('0xb')]);}else{return _0x345455(_0x4756fc['result']);}})['catch'](function(_0x58d2ae){logger[_0x3b69('0xa')](_0x3b69('0x9'),'routing',_0x162e07,_0x58d2ae,_0x2784ba);return _0x1e508a(_0x58d2ae);});});};module[_0x3b69('0xc')]=client; \ No newline at end of file +var _0x2c94=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','routing','message'];(function(_0x514edf,_0x2d3111){var _0x1b0c8d=function(_0x283116){while(--_0x283116){_0x514edf['push'](_0x514edf['shift']());}};_0x1b0c8d(++_0x2d3111);}(_0x2c94,0x92));var _0x42c9=function(_0x536105,_0x3b9730){_0x536105=_0x536105-0x0;var _0x2d6651=_0x2c94[_0x536105];return _0x2d6651;};'use strict';var jayson=require(_0x42c9('0x0'));var BPromise=require(_0x42c9('0x1'));var logger=require(_0x42c9('0x2'))('routing');var client=jayson['client'][_0x42c9('0x3')]({'port':0x2329});client['Request']=function(_0x556c22,_0x225e91){return new BPromise(function(_0x33761b,_0x1072a8){return client[_0x42c9('0x4')](_0x556c22,_0x225e91)['then'](function(_0x4d79ee){logger[_0x42c9('0x5')](_0x42c9('0x6'),'routing',_0x556c22,_0x225e91,_0x4d79ee);if(_0x4d79ee[_0x42c9('0x7')]){logger[_0x42c9('0x7')](_0x42c9('0x6'),_0x42c9('0x8'),_0x556c22,_0x4d79ee[_0x42c9('0x7')][_0x42c9('0x9')],_0x225e91);return _0x1072a8(_0x4d79ee['error'][_0x42c9('0x9')]);}else{return _0x33761b(_0x4d79ee[_0x42c9('0xa')]);}})[_0x42c9('0xb')](function(_0x1e0882){logger[_0x42c9('0x7')](_0x42c9('0x6'),_0x42c9('0x8'),_0x556c22,_0x1e0882,_0x225e91);return _0x1072a8(_0x1e0882);});});};module[_0x42c9('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 5f26c6e..6e70cfe 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 _0xe4c4=['getAgents','initAgents','getIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','then'];(function(_0x1164c7,_0x159495){var _0x5996f3=function(_0x1f161f){while(--_0x1f161f){_0x1164c7['push'](_0x1164c7['shift']());}};_0x5996f3(++_0x159495);}(_0xe4c4,0x133));var _0x4e4c=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0xe4c4[_0x38aeea];return _0x5e8d2c;};'use strict';var BPromise=require(_0x4e4c('0x0'));var server=require(_0x4e4c('0x1'));var Realtime=require(_0x4e4c('0x2'));var user=require('./rpc/user');var interval=require(_0x4e4c('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x4e4c('0x4'));var smsQueue=require(_0x4e4c('0x5'));var mailQueue=require(_0x4e4c('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x4e4c('0x7')](user[_0x4e4c('0x8')]())[_0x4e4c('0x7')](realtime[_0x4e4c('0x9')]())[_0x4e4c('0x7')](interval[_0x4e4c('0xa')]())[_0x4e4c('0x7')](realtime['initIntervals']())[_0x4e4c('0x7')](openchannelQueue[_0x4e4c('0xb')]())[_0x4e4c('0x7')](realtime['initOpenchannelQueues']())[_0x4e4c('0x7')](chatQueue[_0x4e4c('0xc')]())[_0x4e4c('0x7')](realtime['initChatQueues']())[_0x4e4c('0x7')](smsQueue[_0x4e4c('0xd')]())[_0x4e4c('0x7')](realtime['initSmsQueues']())[_0x4e4c('0x7')](mailQueue['getMailQueues']())[_0x4e4c('0x7')](realtime[_0x4e4c('0xe')]())[_0x4e4c('0x7')](faxQueue[_0x4e4c('0xf')]())['then'](realtime[_0x4e4c('0x10')]())[_0x4e4c('0x7')](whatsappQueue[_0x4e4c('0x11')]())[_0x4e4c('0x7')](realtime['initWhatsappQueues']())[_0x4e4c('0x7')](function(){return realtime;});}function main(){return server[_0x4e4c('0x12')](realtime)[_0x4e4c('0x7')](function(_0x3181a6){return initRealtime();})[_0x4e4c('0x7')](function(_0x41d5af){return setInterval(initRealtime,0x1388);})[_0x4e4c('0x13')](function(_0x18d571){console[_0x4e4c('0x14')](_0x18d571);});}main(); \ No newline at end of file +var _0xc760=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue'];(function(_0xe44297,_0x2d72fe){var _0x2b2f1a=function(_0x54655c){while(--_0x54655c){_0xe44297['push'](_0xe44297['shift']());}};_0x2b2f1a(++_0x2d72fe);}(_0xc760,0x103));var _0x0c76=function(_0x17e2c5,_0x3b0464){_0x17e2c5=_0x17e2c5-0x0;var _0x1e15c7=_0xc760[_0x17e2c5];return _0x1e15c7;};'use strict';var BPromise=require('bluebird');var server=require(_0x0c76('0x0'));var Realtime=require(_0x0c76('0x1'));var user=require(_0x0c76('0x2'));var interval=require(_0x0c76('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x0c76('0x4'));var smsQueue=require(_0x0c76('0x5'));var mailQueue=require(_0x0c76('0x6'));var faxQueue=require(_0x0c76('0x7'));var whatsappQueue=require(_0x0c76('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x0c76('0x9')](user['getAgents']())[_0x0c76('0x9')](realtime[_0x0c76('0xa')]())[_0x0c76('0x9')](interval[_0x0c76('0xb')]())[_0x0c76('0x9')](realtime[_0x0c76('0xc')]())[_0x0c76('0x9')](openchannelQueue[_0x0c76('0xd')]())[_0x0c76('0x9')](realtime[_0x0c76('0xe')]())[_0x0c76('0x9')](chatQueue[_0x0c76('0xf')]())[_0x0c76('0x9')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0x0c76('0x9')](realtime[_0x0c76('0x10')]())[_0x0c76('0x9')](mailQueue[_0x0c76('0x11')]())[_0x0c76('0x9')](realtime[_0x0c76('0x12')]())[_0x0c76('0x9')](faxQueue[_0x0c76('0x13')]())[_0x0c76('0x9')](realtime[_0x0c76('0x14')]())[_0x0c76('0x9')](whatsappQueue['getWhatsappQueues']())[_0x0c76('0x9')](realtime['initWhatsappQueues']())[_0x0c76('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x0c76('0x9')](function(_0x4fbb32){return initRealtime();})[_0x0c76('0x9')](function(_0xf688e8){return setInterval(initRealtime,0x1388);})['catch'](function(_0x10e051){console[_0x0c76('0x15')](_0x10e051);});}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 77b6d4b..af22538 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 _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x2bfd4f,_0x1bbf2c){var _0x341849=function(_0x4c246e){while(--_0x4c246e){_0x2bfd4f['push'](_0x2bfd4f['shift']());}};_0x341849(++_0x1bbf2c);}(_0x326f,0xd1));var _0xf326=function(_0x268b7a,_0x208a81){_0x268b7a=_0x268b7a-0x0;var _0xf20098=_0x326f[_0x268b7a];return _0xf20098;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x2010f0,_0x4f3471){var _0x53d72d=function(_0x5e23d3){while(--_0x5e23d3){_0x2010f0['push'](_0x2010f0['shift']());}};_0x53d72d(++_0x4f3471);}(_0x2ef3,0xba));var _0x32ef=function(_0x1fde93,_0xd6c414){_0x1fde93=_0x1fde93-0x0;var _0x43af5a=_0x2ef3[_0x1fde93];return _0x43af5a;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 30ada62..3c2f2fc 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 _0xbc11=['request','then','error','result','SendMail','bluebird','jayson/promise','client'];(function(_0x1c209b,_0x5e4c92){var _0x3a591a=function(_0x2da9fd){while(--_0x2da9fd){_0x1c209b['push'](_0x1c209b['shift']());}};_0x3a591a(++_0x5e4c92);}(_0xbc11,0x195));var _0x1bc1=function(_0x58dd16,_0x19e7cc){_0x58dd16=_0x58dd16-0x0;var _0x49e8eb=_0xbc11[_0x58dd16];return _0x49e8eb;};'use strict';var BPromise=require(_0x1bc1('0x0'));var jayson=require(_0x1bc1('0x1'));var client=jayson[_0x1bc1('0x2')]['http']({'port':0x232b});function request(_0x592001,_0x561e6e){return new BPromise(function(_0xb66d73,_0x287ab4){return client[_0x1bc1('0x3')](_0x592001,_0x561e6e)[_0x1bc1('0x4')](function(_0x193a61){if(_0x193a61['error']){return _0x287ab4(_0x193a61[_0x1bc1('0x5')]['message']);}else{return _0xb66d73(_0x193a61[_0x1bc1('0x6')]);}})['catch'](function(_0x51fc38){return _0x287ab4(_0x51fc38);});});}exports['sendMailMessage']=function(_0x1d2ad1,_0x299f23){return request(_0x1bc1('0x7'),{'account':_0x1d2ad1,'message':_0x299f23});}; \ No newline at end of file +var _0x07e5=['then','error','result','catch','sendMailMessage','bluebird','client','http','request'];(function(_0x3411c5,_0x41d0c3){var _0x77b0e7=function(_0x3ebcf8){while(--_0x3ebcf8){_0x3411c5['push'](_0x3411c5['shift']());}};_0x77b0e7(++_0x41d0c3);}(_0x07e5,0x1d9));var _0x507e=function(_0x195f7d,_0x47ca49){_0x195f7d=_0x195f7d-0x0;var _0x519fb9=_0x07e5[_0x195f7d];return _0x519fb9;};'use strict';var BPromise=require(_0x507e('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x507e('0x1')][_0x507e('0x2')]({'port':0x232b});function request(_0x55a668,_0x45a363){return new BPromise(function(_0x4c71a9,_0x33d400){return client[_0x507e('0x3')](_0x55a668,_0x45a363)[_0x507e('0x4')](function(_0x59af6d){if(_0x59af6d[_0x507e('0x5')]){return _0x33d400(_0x59af6d['error']['message']);}else{return _0x4c71a9(_0x59af6d[_0x507e('0x6')]);}})[_0x507e('0x7')](function(_0x519415){return _0x33d400(_0x519415);});});}exports[_0x507e('0x8')]=function(_0x47306e,_0x3aa769){return request('SendMail',{'account':_0x47306e,'message':_0x3aa769});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 816c5b2..c332545 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 _0x8546=['socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','getChannelStatus','Status','StatusTime','toNumber','format','smsStatus','stringify','user:save','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x4665cf,_0x258305){var _0x387506=function(_0x58705a){while(--_0x58705a){_0x4665cf['push'](_0x4665cf['shift']());}};_0x387506(++_0x258305);}(_0x8546,0x75));var _0x6854=function(_0x4ead40,_0x1a7ecd){_0x4ead40=_0x4ead40-0x0;var _0x5b5823=_0x8546[_0x4ead40];return _0x5b5823;};'use strict';var _=require('lodash');var moment=require(_0x6854('0x0'));var md5=require(_0x6854('0x1'));var Redis=require(_0x6854('0x2'));var config=require(_0x6854('0x3'));config[_0x6854('0x4')]=_[_0x6854('0x5')](config[_0x6854('0x4')],{'host':_0x6854('0x6'),'port':0x18eb});var io=require(_0x6854('0x7'))(new Redis(config[_0x6854('0x4')]));function Agent(_0x24bee2){this['id']=_0x24bee2['id']||0x0;this[_0x6854('0x8')]=_0x24bee2[_0x6854('0x8')]||'';this[_0x6854('0x9')]=_0x24bee2[_0x6854('0x9')]||!![];this[_0x6854('0xa')]=_0x24bee2[_0x6854('0xa')]||![];this[_0x6854('0xb')]=_0x24bee2['chatPause']||![];this[_0x6854('0xc')]=_0x24bee2[_0x6854('0xc')]||![];this[_0x6854('0xd')]=_0x24bee2[_0x6854('0xd')]||![];this[_0x6854('0xe')]=_0x24bee2['smsPause']||![];this['openchannelPause']=_0x24bee2[_0x6854('0xf')]||![];this[_0x6854('0x10')]=_0x6854('0x11');this[_0x6854('0x12')]=0x0;this[_0x6854('0x13')]=_0x24bee2['chatCapacity']||0x0;this[_0x6854('0x14')]=0x0;this[_0x6854('0x15')]=_0x6854('0x11');this[_0x6854('0x16')]=0x0;this[_0x6854('0x17')]=_0x24bee2[_0x6854('0x17')]||0x0;this[_0x6854('0x18')]=0x0;this[_0x6854('0x19')]='unknown';this[_0x6854('0x1a')]=0x0;this[_0x6854('0x1b')]=_0x24bee2[_0x6854('0x1b')]||0x0;this[_0x6854('0x1c')]=0x0;this['smsStatus']=_0x6854('0x11');this[_0x6854('0x1d')]=0x0;this[_0x6854('0x1e')]=_0x24bee2[_0x6854('0x1e')]||0x0;this[_0x6854('0x1f')]=0x0;this[_0x6854('0x20')]=_0x6854('0x11');this[_0x6854('0x21')]=0x0;this[_0x6854('0x22')]=_0x24bee2[_0x6854('0x22')]||0x0;this[_0x6854('0x23')]=0x0;this[_0x6854('0x24')]=_0x6854('0x11');this[_0x6854('0x25')]=0x0;this[_0x6854('0x26')]=_0x24bee2[_0x6854('0x26')]||0x0;this[_0x6854('0x27')]=0x0;this[_0x6854('0x28')]=![];this[_0x6854('0x29')]=undefined;this[_0x6854('0x1')]='';this[_0x6854('0x2a')]();}Agent[_0x6854('0x2b')]['getChannelStatus']=function(_0x381efb){if(this[_0x381efb+_0x6854('0x2c')]>0x0){if(this[_0x381efb+_0x6854('0x2d')]>0x0&&this[_0x381efb+_0x6854('0x2c')]>=this[_0x381efb+_0x6854('0x2d')]){return _0x6854('0x2e');}else{return _0x6854('0x2f');}}else{return _0x6854('0x30');}};Agent[_0x6854('0x2b')][_0x6854('0x2a')]=function(){var _0x44e60d=[_0x6854('0x31'),_0x6854('0x32'),_0x6854('0x33'),_0x6854('0x34'),'sms','whatsapp'];for(var _0x250d49=0x0;_0x250d49<_0x44e60d['length'];_0x250d49+=0x1){var _0x9e5e08=this[_0x6854('0x35')](_0x44e60d[_0x250d49]);if(this[_0x44e60d[_0x250d49]+_0x6854('0x36')]!==_0x9e5e08){this[_0x44e60d[_0x250d49]+_0x6854('0x37')]=_[_0x6854('0x38')](moment()[_0x6854('0x39')]('x'));}this[_0x44e60d[_0x250d49]+_0x6854('0x36')]=_0x9e5e08;}var _0x4e7c33={'id':this['id'],'name':this[_0x6854('0x8')],'online':this[_0x6854('0x9')],'voicePause':this[_0x6854('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x6854('0xc')],'smsPause':this[_0x6854('0xe')],'faxPause':this[_0x6854('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x6854('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x6854('0x13')],'chatCurrentCapacity':this[_0x6854('0x14')],'mailStatus':this[_0x6854('0x15')],'mailStatusTime':this[_0x6854('0x16')],'mailCapacity':this[_0x6854('0x17')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x6854('0x1a')],'faxCapacity':this[_0x6854('0x1b')],'faxCurrentCapacity':this[_0x6854('0x1c')],'smsStatus':this[_0x6854('0x3a')],'smsStatusTime':this[_0x6854('0x1d')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x6854('0x1f')],'whatsappStatus':this[_0x6854('0x20')],'whatsappStatusTime':this[_0x6854('0x21')],'whatsappCapacity':this[_0x6854('0x22')],'whatsappCurrentCapacity':this[_0x6854('0x23')],'openchannelStatus':this[_0x6854('0x24')],'openchannelStatusTime':this[_0x6854('0x25')],'openchannelCapacity':this[_0x6854('0x26')],'openchannelCurrentCapacity':this[_0x6854('0x27')],'busy':this[_0x6854('0x28')],'busyQueue':this['busyQueue']};var _0x2b8c9f=md5(JSON[_0x6854('0x3b')](_0x4e7c33));if(this[_0x6854('0x1')]!==_0x2b8c9f){this[_0x6854('0x1')]=_0x2b8c9f;io['emit'](_0x6854('0x3c'),_0x4e7c33);}};module[_0x6854('0x3d')]=Agent; \ No newline at end of file +var _0x729a=['redis','defaults','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','unknown','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','chat','fax','length','Status','toNumber','format','mailCapacity','mailCurrentCapacity','faxStatus','faxCurrentCapacity','openchannelCurrentCapacity','stringify','exports','lodash','md5','../../../config/environment'];(function(_0x43736b,_0x387962){var _0x57e799=function(_0x57e452){while(--_0x57e452){_0x43736b['push'](_0x43736b['shift']());}};_0x57e799(++_0x387962);}(_0x729a,0x177));var _0xa729=function(_0x347402,_0x5efc6f){_0x347402=_0x347402-0x0;var _0xde66f9=_0x729a[_0x347402];return _0xde66f9;};'use strict';var _=require(_0xa729('0x0'));var moment=require('moment');var md5=require(_0xa729('0x1'));var Redis=require('ioredis');var config=require(_0xa729('0x2'));config[_0xa729('0x3')]=_[_0xa729('0x4')](config['redis'],{'host':_0xa729('0x5'),'port':0x18eb});var io=require(_0xa729('0x6'))(new Redis(config[_0xa729('0x3')]));function Agent(_0x207e07){this['id']=_0x207e07['id']||0x0;this[_0xa729('0x7')]=_0x207e07[_0xa729('0x7')]||'';this['online']=_0x207e07[_0xa729('0x8')]||!![];this['voicePause']=_0x207e07['voicePause']||![];this[_0xa729('0x9')]=_0x207e07[_0xa729('0x9')]||![];this['mailPause']=_0x207e07[_0xa729('0xa')]||![];this[_0xa729('0xb')]=_0x207e07[_0xa729('0xb')]||![];this[_0xa729('0xc')]=_0x207e07[_0xa729('0xc')]||![];this[_0xa729('0xd')]=_0x207e07[_0xa729('0xd')]||![];this[_0xa729('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0xa729('0xf')]=_0x207e07['chatCapacity']||0x0;this[_0xa729('0x10')]=0x0;this['mailStatus']=_0xa729('0x11');this['mailStatusTime']=0x0;this['mailCapacity']=_0x207e07['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']='unknown';this[_0xa729('0x12')]=0x0;this[_0xa729('0x13')]=_0x207e07[_0xa729('0x13')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xa729('0x14')]=_0xa729('0x11');this[_0xa729('0x15')]=0x0;this[_0xa729('0x16')]=_0x207e07[_0xa729('0x16')]||0x0;this[_0xa729('0x17')]=0x0;this['whatsappStatus']=_0xa729('0x11');this[_0xa729('0x18')]=0x0;this[_0xa729('0x19')]=_0x207e07[_0xa729('0x19')]||0x0;this[_0xa729('0x1a')]=0x0;this[_0xa729('0x1b')]=_0xa729('0x11');this[_0xa729('0x1c')]=0x0;this[_0xa729('0x1d')]=_0x207e07[_0xa729('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xa729('0x1e')]=![];this[_0xa729('0x1f')]=undefined;this[_0xa729('0x1')]='';this[_0xa729('0x20')]();}Agent['prototype'][_0xa729('0x21')]=function(_0x2b1d10){if(this[_0x2b1d10+_0xa729('0x22')]>0x0){if(this[_0x2b1d10+_0xa729('0x23')]>0x0&&this[_0x2b1d10+_0xa729('0x22')]>=this[_0x2b1d10+'Capacity']){return _0xa729('0x24');}else{return _0xa729('0x25');}}else{return _0xa729('0x26');}};Agent[_0xa729('0x27')][_0xa729('0x20')]=function(){var _0x1daf0d=[_0xa729('0x28'),_0xa729('0x29'),'openchannel',_0xa729('0x2a'),'sms','whatsapp'];for(var _0x55b01f=0x0;_0x55b01f<_0x1daf0d[_0xa729('0x2b')];_0x55b01f+=0x1){var _0x2ce884=this['getChannelStatus'](_0x1daf0d[_0x55b01f]);if(this[_0x1daf0d[_0x55b01f]+_0xa729('0x2c')]!==_0x2ce884){this[_0x1daf0d[_0x55b01f]+'StatusTime']=_[_0xa729('0x2d')](moment()[_0xa729('0x2e')]('x'));}this[_0x1daf0d[_0x55b01f]+_0xa729('0x2c')]=_0x2ce884;}var _0x592afc={'id':this['id'],'name':this[_0xa729('0x7')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xa729('0x9')],'mailPause':this[_0xa729('0xa')],'smsPause':this[_0xa729('0xc')],'faxPause':this[_0xa729('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xa729('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xa729('0x10')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xa729('0x2f')],'mailCurrentCapacity':this[_0xa729('0x30')],'faxStatus':this[_0xa729('0x31')],'faxStatusTime':this[_0xa729('0x12')],'faxCapacity':this[_0xa729('0x13')],'faxCurrentCapacity':this[_0xa729('0x32')],'smsStatus':this[_0xa729('0x14')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xa729('0x16')],'smsCurrentCapacity':this[_0xa729('0x17')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xa729('0x18')],'whatsappCapacity':this[_0xa729('0x19')],'whatsappCurrentCapacity':this[_0xa729('0x1a')],'openchannelStatus':this[_0xa729('0x1b')],'openchannelStatusTime':this[_0xa729('0x1c')],'openchannelCapacity':this[_0xa729('0x1d')],'openchannelCurrentCapacity':this[_0xa729('0x33')],'busy':this['busy'],'busyQueue':this[_0xa729('0x1f')]};var _0x10355c=md5(JSON[_0xa729('0x34')](_0x592afc));if(this[_0xa729('0x1')]!==_0x10355c){this[_0xa729('0x1')]=_0x10355c;io['emit']('user:save',_0x592afc);}};module[_0xa729('0x35')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 7bee517..635b9bd 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 _0x366f=['util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','map','_rr','loggedIn','length','online','chatPause','available','paused','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5'];(function(_0x2f0cbd,_0x2affb7){var _0x2f28c9=function(_0x32585d){while(--_0x32585d){_0x2f0cbd['push'](_0x2f0cbd['shift']());}};_0x2f28c9(++_0x2affb7);}(_0x366f,0xe7));var _0xf366=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x366f[_0x376b45];return _0x2341b3;};'use strict';var _=require('lodash');var md5=require(_0xf366('0x0'));var util=require(_0xf366('0x1'));var Redis=require('ioredis');var config=require(_0xf366('0x2'));config[_0xf366('0x3')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf366('0x4'))(new Redis(config[_0xf366('0x3')]));function ChatQueue(_0x47d616){this['id']=_0x47d616['id']||0x0;this['name']=_0x47d616[_0xf366('0x5')]||'';this[_0xf366('0x6')]=_0x47d616[_0xf366('0x6')]||0xa;this[_0xf366('0x7')]=_0x47d616[_0xf366('0x7')]||_0xf366('0x8');this[_0xf366('0x9')]=_0x47d616[_0xf366('0x9')];this['mapAgentsId']={};this[_0xf366('0xa')]=0x0;this[_0xf366('0x0')]='';this['updateRouting']();this[_0xf366('0xb')]();}ChatQueue[_0xf366('0xc')][_0xf366('0xd')]=function(){var _0x334dad=this[_0xf366('0xe')]['_rr'];this[_0xf366('0xe')]=_[_0xf366('0xf')](this[_0xf366('0x9')],'id');this[_0xf366('0xe')][_0xf366('0x10')]=_0x334dad;};ChatQueue[_0xf366('0xc')][_0xf366('0xb')]=function(){this[_0xf366('0x11')]=0x0;this['paused']=0x0;for(var _0x2e06c1=0x0;_0x2e06c1=0x0?this[_0xf366('0x15')]:0x0;var _0x172a12={'id':this['id'],'available':this[_0xf366('0x15')],'loggedIn':this[_0xf366('0x11')],'name':this[_0xf366('0x5')],'paused':this[_0xf366('0x16')],'waiting':this[_0xf366('0xa')]};var _0x5df7fd=md5(JSON[_0xf366('0x17')](_0x172a12));if(this[_0xf366('0x0')]!==_0x5df7fd){this['md5']=_0x5df7fd;io['to'](util[_0xf366('0x18')](_0xf366('0x19'),_0x172a12['name']))[_0xf366('0x1a')](_0xf366('0x1b'),_0x172a12);}};module[_0xf366('0x1c')]=ChatQueue; \ No newline at end of file +var _0x50ce=['exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRouting','updateRealtime','prototype','map','Agents','loggedIn','paused','length','online','chatPause','available','waiting','stringify','format','chat:queue:%s','chat_queue:save'];(function(_0x5e5c20,_0x3966cb){var _0x412a1e=function(_0x8f0c45){while(--_0x8f0c45){_0x5e5c20['push'](_0x5e5c20['shift']());}};_0x412a1e(++_0x3966cb);}(_0x50ce,0x169));var _0xe50c=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x50ce[_0x276468];return _0x36dc3a;};'use strict';var _=require(_0xe50c('0x0'));var md5=require(_0xe50c('0x1'));var util=require(_0xe50c('0x2'));var Redis=require('ioredis');var config=require(_0xe50c('0x3'));config['redis']=_[_0xe50c('0x4')](config[_0xe50c('0x5')],{'host':_0xe50c('0x6'),'port':0x18eb});var io=require(_0xe50c('0x7'))(new Redis(config[_0xe50c('0x5')]));function ChatQueue(_0x5eb190){this['id']=_0x5eb190['id']||0x0;this[_0xe50c('0x8')]=_0x5eb190[_0xe50c('0x8')]||'';this[_0xe50c('0x9')]=_0x5eb190[_0xe50c('0x9')]||0xa;this[_0xe50c('0xa')]=_0x5eb190[_0xe50c('0xa')]||_0xe50c('0xb');this['Agents']=_0x5eb190['Agents'];this[_0xe50c('0xc')]={};this['waiting']=0x0;this[_0xe50c('0x1')]='';this[_0xe50c('0xd')]();this[_0xe50c('0xe')]();}ChatQueue[_0xe50c('0xf')][_0xe50c('0xd')]=function(){var _0x5858be=this[_0xe50c('0xc')]['_rr'];this[_0xe50c('0xc')]=_[_0xe50c('0x10')](this[_0xe50c('0x11')],'id');this[_0xe50c('0xc')]['_rr']=_0x5858be;};ChatQueue[_0xe50c('0xf')][_0xe50c('0xe')]=function(){this[_0xe50c('0x12')]=0x0;this[_0xe50c('0x13')]=0x0;for(var _0x2012d7=0x0;_0x2012d7=0x0?this[_0xe50c('0x17')]:0x0;var _0x3b91f6={'id':this['id'],'available':this[_0xe50c('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xe50c('0x13')],'waiting':this[_0xe50c('0x18')]};var _0x278ce1=md5(JSON[_0xe50c('0x19')](_0x3b91f6));if(this[_0xe50c('0x1')]!==_0x278ce1){this[_0xe50c('0x1')]=_0x278ce1;io['to'](util[_0xe50c('0x1a')](_0xe50c('0x1b'),_0x3b91f6[_0xe50c('0x8')]))['emit'](_0xe50c('0x1c'),_0x3b91f6);}};module[_0xe50c('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 5997d1a..976ddd1 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 _0xd8fc=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','online','loggedIn','available','format','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x3f0503,_0x1a7a56){var _0x5a1080=function(_0x172b60){while(--_0x172b60){_0x3f0503['push'](_0x3f0503['shift']());}};_0x5a1080(++_0x1a7a56);}(_0xd8fc,0x180));var _0xcd8f=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0xd8fc[_0x469ac7];return _0x22f3b0;};'use strict';var _=require('lodash');var md5=require(_0xcd8f('0x0'));var util=require('util');var Redis=require(_0xcd8f('0x1'));var config=require(_0xcd8f('0x2'));config[_0xcd8f('0x3')]=_[_0xcd8f('0x4')](config['redis'],{'host':_0xcd8f('0x5'),'port':0x18eb});var io=require(_0xcd8f('0x6'))(new Redis(config[_0xcd8f('0x3')]));function FaxQueue(_0x2f52be){this['id']=_0x2f52be['id']||0x0;this[_0xcd8f('0x7')]=_0x2f52be['name']||'';this[_0xcd8f('0x8')]=_0x2f52be[_0xcd8f('0x8')]||0xa;this['strategy']=_0x2f52be[_0xcd8f('0x9')]||_0xcd8f('0xa');this[_0xcd8f('0xb')]=_0x2f52be[_0xcd8f('0xb')];this['mapAgentsId']={};this[_0xcd8f('0xc')]=0x0;this['md5']='';this[_0xcd8f('0xd')]();this[_0xcd8f('0xe')]();}FaxQueue[_0xcd8f('0xf')]['updateRouting']=function(){var _0x4a52a5=this[_0xcd8f('0x10')]['_rr'];this[_0xcd8f('0x10')]=_[_0xcd8f('0x11')](this['Agents'],'id');this[_0xcd8f('0x10')][_0xcd8f('0x12')]=_0x4a52a5;};FaxQueue[_0xcd8f('0xf')][_0xcd8f('0xe')]=function(){this['loggedIn']=0x0;this[_0xcd8f('0x13')]=0x0;for(var _0x284058=0x0;_0x284058=0x0?this['available']:0x0;var _0x57f993={'id':this['id'],'available':this[_0xcd8f('0x16')],'loggedIn':this[_0xcd8f('0x15')],'name':this[_0xcd8f('0x7')],'paused':this[_0xcd8f('0x13')],'waiting':this['waiting']};var _0x2b7539=md5(JSON['stringify'](_0x57f993));if(this['md5']!==_0x2b7539){this[_0xcd8f('0x0')]=_0x2b7539;io['to'](util[_0xcd8f('0x17')](_0xcd8f('0x18'),_0x57f993['name']))[_0xcd8f('0x19')](_0xcd8f('0x1a'),_0x57f993);}};module[_0xcd8f('0x1b')]=FaxQueue; \ No newline at end of file +var _0x3a01=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','exports','ioredis','../../../config/environment','defaults','redis','localhost'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0x3a01,0x191));var _0x13a0=function(_0x2465d0,_0x8be961){_0x2465d0=_0x2465d0-0x0;var _0x3e1be3=_0x3a01[_0x2465d0];return _0x3e1be3;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x13a0('0x0'));var config=require(_0x13a0('0x1'));config['redis']=_[_0x13a0('0x2')](config[_0x13a0('0x3')],{'host':_0x13a0('0x4'),'port':0x18eb});var io=require(_0x13a0('0x5'))(new Redis(config[_0x13a0('0x3')]));function FaxQueue(_0x239e0c){this['id']=_0x239e0c['id']||0x0;this[_0x13a0('0x6')]=_0x239e0c[_0x13a0('0x6')]||'';this[_0x13a0('0x7')]=_0x239e0c[_0x13a0('0x7')]||0xa;this[_0x13a0('0x8')]=_0x239e0c[_0x13a0('0x8')]||_0x13a0('0x9');this[_0x13a0('0xa')]=_0x239e0c[_0x13a0('0xa')];this[_0x13a0('0xb')]={};this[_0x13a0('0xc')]=0x0;this[_0x13a0('0xd')]='';this[_0x13a0('0xe')]();this[_0x13a0('0xf')]();}FaxQueue[_0x13a0('0x10')][_0x13a0('0xe')]=function(){var _0x33cb00=this['mapAgentsId'][_0x13a0('0x11')];this[_0x13a0('0xb')]=_['map'](this[_0x13a0('0xa')],'id');this[_0x13a0('0xb')]['_rr']=_0x33cb00;};FaxQueue[_0x13a0('0x10')]['updateRealtime']=function(){this[_0x13a0('0x12')]=0x0;this[_0x13a0('0x13')]=0x0;for(var _0x29bd41=0x0;_0x29bd41=0x0?this[_0x13a0('0x17')]:0x0;var _0x58e7b1={'id':this['id'],'available':this[_0x13a0('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x13a0('0x13')],'waiting':this['waiting']};var _0x3d7627=md5(JSON[_0x13a0('0x18')](_0x58e7b1));if(this['md5']!==_0x3d7627){this[_0x13a0('0xd')]=_0x3d7627;io['to'](util[_0x13a0('0x19')](_0x13a0('0x1a'),_0x58e7b1[_0x13a0('0x6')]))[_0x13a0('0x1b')]('fax_queue:save',_0x58e7b1);}};module[_0x13a0('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index a72fe13..a867c6f 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 _0x1450=['name','Intervals'];(function(_0x490b80,_0x2eebaf){var _0x56d571=function(_0x4153cf){while(--_0x4153cf){_0x490b80['push'](_0x490b80['shift']());}};_0x56d571(++_0x2eebaf);}(_0x1450,0x120));var _0x0145=function(_0x47e52d,_0x2c6878){_0x47e52d=_0x47e52d-0x0;var _0x2c8fdd=_0x1450[_0x47e52d];return _0x2c8fdd;};'use strict';function Interval(_0x401f1f){this['id']=_0x401f1f['id']||0x0;this[_0x0145('0x0')]=_0x401f1f[_0x0145('0x0')]||'';this[_0x0145('0x1')]=_0x401f1f[_0x0145('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xaba6=['name','Intervals'];(function(_0x13332c,_0x2bfb4f){var _0x478d46=function(_0x296714){while(--_0x296714){_0x13332c['push'](_0x13332c['shift']());}};_0x478d46(++_0x2bfb4f);}(_0xaba6,0x190));var _0x6aba=function(_0x280cb6,_0x4b92fa){_0x280cb6=_0x280cb6-0x0;var _0xbaf53=_0xaba6[_0x280cb6];return _0xbaf53;};'use strict';function Interval(_0x36821a){this['id']=_0x36821a['id']||0x0;this[_0x6aba('0x0')]=_0x36821a[_0x6aba('0x0')]||'';this['Intervals']=_0x36821a[_0x6aba('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index ba22c10..c3c7d29 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 _0x64ba=['util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5'];(function(_0x98828d,_0xe82cc4){var _0x215bf3=function(_0x29b915){while(--_0x29b915){_0x98828d['push'](_0x98828d['shift']());}};_0x215bf3(++_0xe82cc4);}(_0x64ba,0x186));var _0xa64b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x64ba[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xa64b('0x0'));var md5=require(_0xa64b('0x1'));var util=require(_0xa64b('0x2'));var Redis=require(_0xa64b('0x3'));var config=require(_0xa64b('0x4'));config['redis']=_[_0xa64b('0x5')](config[_0xa64b('0x6')],{'host':_0xa64b('0x7'),'port':0x18eb});var io=require(_0xa64b('0x8'))(new Redis(config[_0xa64b('0x6')]));function MailQueue(_0x18d818){this['id']=_0x18d818['id']||0x0;this[_0xa64b('0x9')]=_0x18d818[_0xa64b('0x9')]||'';this[_0xa64b('0xa')]=_0x18d818[_0xa64b('0xa')]||0xa;this[_0xa64b('0xb')]=_0x18d818[_0xa64b('0xb')]||'beepall';this['Agents']=_0x18d818[_0xa64b('0xc')];this[_0xa64b('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xa64b('0xe')]();this[_0xa64b('0xf')]();}MailQueue[_0xa64b('0x10')]['updateRouting']=function(){var _0xb82ca1=this[_0xa64b('0xd')][_0xa64b('0x11')];this[_0xa64b('0xd')]=_[_0xa64b('0x12')](this[_0xa64b('0xc')],'id');this[_0xa64b('0xd')]['_rr']=_0xb82ca1;};MailQueue[_0xa64b('0x10')][_0xa64b('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3595b2=0x0;_0x3595b2=0x0?this['available']:0x0;var _0x1e0c4f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa64b('0x13')],'name':this['name'],'paused':this[_0xa64b('0x15')],'waiting':this['waiting']};var _0x331c35=md5(JSON[_0xa64b('0x17')](_0x1e0c4f));if(this[_0xa64b('0x1')]!==_0x331c35){this['md5']=_0x331c35;io['to'](util[_0xa64b('0x18')](_0xa64b('0x19'),_0x1e0c4f[_0xa64b('0x9')]))[_0xa64b('0x1a')](_0xa64b('0x1b'),_0x1e0c4f);}};module['exports']=MailQueue; \ No newline at end of file +var _0x0e60=['socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','length','online','mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e60,0x1ab));var _0x00e6=function(_0x266efd,_0x1893b7){_0x266efd=_0x266efd-0x0;var _0x36a5ca=_0x0e60[_0x266efd];return _0x36a5ca;};'use strict';var _=require('lodash');var md5=require(_0x00e6('0x0'));var util=require(_0x00e6('0x1'));var Redis=require(_0x00e6('0x2'));var config=require(_0x00e6('0x3'));config[_0x00e6('0x4')]=_[_0x00e6('0x5')](config[_0x00e6('0x4')],{'host':_0x00e6('0x6'),'port':0x18eb});var io=require(_0x00e6('0x7'))(new Redis(config[_0x00e6('0x4')]));function MailQueue(_0x92059b){this['id']=_0x92059b['id']||0x0;this[_0x00e6('0x8')]=_0x92059b[_0x00e6('0x8')]||'';this[_0x00e6('0x9')]=_0x92059b[_0x00e6('0x9')]||0xa;this[_0x00e6('0xa')]=_0x92059b[_0x00e6('0xa')]||_0x00e6('0xb');this['Agents']=_0x92059b['Agents'];this[_0x00e6('0xc')]={};this[_0x00e6('0xd')]=0x0;this['md5']='';this[_0x00e6('0xe')]();this[_0x00e6('0xf')]();}MailQueue[_0x00e6('0x10')][_0x00e6('0xe')]=function(){var _0x2ac14d=this['mapAgentsId'][_0x00e6('0x11')];this[_0x00e6('0xc')]=_[_0x00e6('0x12')](this[_0x00e6('0x13')],'id');this[_0x00e6('0xc')][_0x00e6('0x11')]=_0x2ac14d;};MailQueue['prototype'][_0x00e6('0xf')]=function(){this[_0x00e6('0x14')]=0x0;this['paused']=0x0;for(var _0x52d600=0x0;_0x52d600=0x0?this[_0x00e6('0x19')]:0x0;var _0x1154d6={'id':this['id'],'available':this[_0x00e6('0x19')],'loggedIn':this['loggedIn'],'name':this[_0x00e6('0x8')],'paused':this[_0x00e6('0x18')],'waiting':this[_0x00e6('0xd')]};var _0x15d7a3=md5(JSON[_0x00e6('0x1a')](_0x1154d6));if(this[_0x00e6('0x0')]!==_0x15d7a3){this[_0x00e6('0x0')]=_0x15d7a3;io['to'](util[_0x00e6('0x1b')](_0x00e6('0x1c'),_0x1154d6['name']))[_0x00e6('0x1d')](_0x00e6('0x1e'),_0x1154d6);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 81a1a8b..632da77 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x454416,_0x5d180f){var _0x52c59c=function(_0xacafdc){while(--_0xacafdc){_0x454416['push'](_0x454416['shift']());}};_0x52c59c(++_0x5d180f);}(_0x814b,0x1a2));var _0xb814=function(_0x38a155,_0x2aa026){_0x38a155=_0x38a155-0x0;var _0x269403=_0x814b[_0x38a155];return _0x269403;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0x2ef3,0xba));var _0x32ef=function(_0x3149b2,_0x2303c2){_0x3149b2=_0x3149b2-0x0;var _0x841b56=_0x2ef3[_0x3149b2];return _0x841b56;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 91bf293..2530401 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 _0x9b67=['redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','sms:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults'];(function(_0x3965a1,_0x2e3621){var _0x2189ce=function(_0x586ea4){while(--_0x586ea4){_0x3965a1['push'](_0x3965a1['shift']());}};_0x2189ce(++_0x2e3621);}(_0x9b67,0xf6));var _0x79b6=function(_0x15409e,_0x39c1da){_0x15409e=_0x15409e-0x0;var _0x525216=_0x9b67[_0x15409e];return _0x525216;};'use strict';var _=require(_0x79b6('0x0'));var md5=require(_0x79b6('0x1'));var util=require(_0x79b6('0x2'));var Redis=require(_0x79b6('0x3'));var config=require(_0x79b6('0x4'));config['redis']=_[_0x79b6('0x5')](config[_0x79b6('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x79b6('0x6')]));function SmsQueue(_0x174768){this['id']=_0x174768['id']||0x0;this[_0x79b6('0x7')]=_0x174768[_0x79b6('0x7')]||'';this[_0x79b6('0x8')]=_0x174768[_0x79b6('0x8')]||0xa;this[_0x79b6('0x9')]=_0x174768['strategy']||_0x79b6('0xa');this[_0x79b6('0xb')]=_0x174768[_0x79b6('0xb')];this[_0x79b6('0xc')]={};this[_0x79b6('0xd')]=0x0;this['md5']='';this[_0x79b6('0xe')]();this[_0x79b6('0xf')]();}SmsQueue[_0x79b6('0x10')][_0x79b6('0xe')]=function(){var _0x58a98b=this['mapAgentsId'][_0x79b6('0x11')];this[_0x79b6('0xc')]=_[_0x79b6('0x12')](this['Agents'],'id');this[_0x79b6('0xc')][_0x79b6('0x11')]=_0x58a98b;};SmsQueue[_0x79b6('0x10')][_0x79b6('0xf')]=function(){this[_0x79b6('0x13')]=0x0;this[_0x79b6('0x14')]=0x0;for(var _0x19d5b2=0x0;_0x19d5b2=0x0?this[_0x79b6('0x17')]:0x0;var _0x3123b8={'id':this['id'],'available':this[_0x79b6('0x17')],'loggedIn':this[_0x79b6('0x13')],'name':this[_0x79b6('0x7')],'paused':this[_0x79b6('0x14')],'waiting':this[_0x79b6('0xd')]};var _0x52a70f=md5(JSON[_0x79b6('0x18')](_0x3123b8));if(this['md5']!==_0x52a70f){this[_0x79b6('0x1')]=_0x52a70f;io['to'](util['format'](_0x79b6('0x19'),_0x3123b8[_0x79b6('0x7')]))[_0x79b6('0x1a')]('sms_queue:save',_0x3123b8);}};module[_0x79b6('0x1b')]=SmsQueue; \ No newline at end of file +var _0x0207=['emit','sms_queue:save','exports','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','updateRealtime','paused','length','online','loggedIn','available','format','sms:queue:%s'];(function(_0x2639ed,_0x4f5769){var _0x4ed95f=function(_0x354ff2){while(--_0x354ff2){_0x2639ed['push'](_0x2639ed['shift']());}};_0x4ed95f(++_0x4f5769);}(_0x0207,0x162));var _0x7020=function(_0x1e1962,_0x5a2061){_0x1e1962=_0x1e1962-0x0;var _0x3c06be=_0x0207[_0x1e1962];return _0x3c06be;};'use strict';var _=require('lodash');var md5=require(_0x7020('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x7020('0x1'));config[_0x7020('0x2')]=_[_0x7020('0x3')](config[_0x7020('0x2')],{'host':_0x7020('0x4'),'port':0x18eb});var io=require(_0x7020('0x5'))(new Redis(config[_0x7020('0x2')]));function SmsQueue(_0x5b7cf1){this['id']=_0x5b7cf1['id']||0x0;this['name']=_0x5b7cf1[_0x7020('0x6')]||'';this[_0x7020('0x7')]=_0x5b7cf1[_0x7020('0x7')]||0xa;this[_0x7020('0x8')]=_0x5b7cf1[_0x7020('0x8')]||_0x7020('0x9');this[_0x7020('0xa')]=_0x5b7cf1['Agents'];this['mapAgentsId']={};this[_0x7020('0xb')]=0x0;this[_0x7020('0x0')]='';this[_0x7020('0xc')]();this['updateRealtime']();}SmsQueue[_0x7020('0xd')][_0x7020('0xc')]=function(){var _0x4e16da=this[_0x7020('0xe')][_0x7020('0xf')];this[_0x7020('0xe')]=_['map'](this[_0x7020('0xa')],'id');this[_0x7020('0xe')][_0x7020('0xf')]=_0x4e16da;};SmsQueue[_0x7020('0xd')][_0x7020('0x10')]=function(){this['loggedIn']=0x0;this[_0x7020('0x11')]=0x0;for(var _0x5f5872=0x0;_0x5f5872=0x0?this['available']:0x0;var _0x3d5d25={'id':this['id'],'available':this[_0x7020('0x15')],'loggedIn':this[_0x7020('0x14')],'name':this[_0x7020('0x6')],'paused':this[_0x7020('0x11')],'waiting':this[_0x7020('0xb')]};var _0x59b5d2=md5(JSON['stringify'](_0x3d5d25));if(this[_0x7020('0x0')]!==_0x59b5d2){this[_0x7020('0x0')]=_0x59b5d2;io['to'](util[_0x7020('0x16')](_0x7020('0x17'),_0x3d5d25['name']))[_0x7020('0x18')](_0x7020('0x19'),_0x3d5d25);}};module[_0x7020('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 e52053b..6c55cd7 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 _0xe491=['defaults','localhost','socket.io-emitter','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','paused','online','whatsappPause','available','loggedIn','name','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xe491,0x1da));var _0x1e49=function(_0x2efc41,_0x4bf811){_0x2efc41=_0x2efc41-0x0;var _0x3da51e=_0xe491[_0x2efc41];return _0x3da51e;};'use strict';var _=require(_0x1e49('0x0'));var md5=require(_0x1e49('0x1'));var util=require(_0x1e49('0x2'));var Redis=require(_0x1e49('0x3'));var config=require(_0x1e49('0x4'));config[_0x1e49('0x5')]=_[_0x1e49('0x6')](config['redis'],{'host':_0x1e49('0x7'),'port':0x18eb});var io=require(_0x1e49('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0x233b92){this['id']=_0x233b92['id']||0x0;this['name']=_0x233b92['name']||'';this[_0x1e49('0x9')]=_0x233b92[_0x1e49('0x9')]||0xa;this[_0x1e49('0xa')]=_0x233b92[_0x1e49('0xa')]||'beepall';this['Agents']=_0x233b92[_0x1e49('0xb')];this['mapAgentsId']={};this[_0x1e49('0xc')]=0x0;this[_0x1e49('0x1')]='';this[_0x1e49('0xd')]();this[_0x1e49('0xe')]();}WhatsappQueue['prototype'][_0x1e49('0xd')]=function(){var _0xa51970=this[_0x1e49('0xf')][_0x1e49('0x10')];this['mapAgentsId']=_[_0x1e49('0x11')](this['Agents'],'id');this[_0x1e49('0xf')][_0x1e49('0x10')]=_0xa51970;};WhatsappQueue[_0x1e49('0x12')][_0x1e49('0xe')]=function(){this['loggedIn']=0x0;this[_0x1e49('0x13')]=0x0;for(var _0x54a472=0x0;_0x54a472=0x0?this[_0x1e49('0x16')]:0x0;var _0xd0d3d2={'id':this['id'],'available':this[_0x1e49('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x1e49('0x18')],'paused':this['paused'],'waiting':this['waiting']};var _0x21ea81=md5(JSON[_0x1e49('0x19')](_0xd0d3d2));if(this[_0x1e49('0x1')]!==_0x21ea81){this[_0x1e49('0x1')]=_0x21ea81;io['to'](util[_0x1e49('0x1a')](_0x1e49('0x1b'),_0xd0d3d2[_0x1e49('0x18')]))[_0x1e49('0x1c')](_0x1e49('0x1d'),_0xd0d3d2);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x1068=['online','available','stringify','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','loggedIn','paused','length'];(function(_0x2833fd,_0x28c021){var _0x3331a0=function(_0x10851d){while(--_0x10851d){_0x2833fd['push'](_0x2833fd['shift']());}};_0x3331a0(++_0x28c021);}(_0x1068,0x13d));var _0x8106=function(_0x4c17e0,_0x3701c7){_0x4c17e0=_0x4c17e0-0x0;var _0x17448d=_0x1068[_0x4c17e0];return _0x17448d;};'use strict';var _=require(_0x8106('0x0'));var md5=require(_0x8106('0x1'));var util=require(_0x8106('0x2'));var Redis=require(_0x8106('0x3'));var config=require(_0x8106('0x4'));config['redis']=_[_0x8106('0x5')](config['redis'],{'host':_0x8106('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x3f614d){this['id']=_0x3f614d['id']||0x0;this[_0x8106('0x7')]=_0x3f614d[_0x8106('0x7')]||'';this[_0x8106('0x8')]=_0x3f614d['timeout']||0xa;this[_0x8106('0x9')]=_0x3f614d[_0x8106('0x9')]||_0x8106('0xa');this['Agents']=_0x3f614d[_0x8106('0xb')];this[_0x8106('0xc')]={};this[_0x8106('0xd')]=0x0;this[_0x8106('0x1')]='';this[_0x8106('0xe')]();this['updateRealtime']();}WhatsappQueue[_0x8106('0xf')]['updateRouting']=function(){var _0x164b8d=this[_0x8106('0xc')][_0x8106('0x10')];this[_0x8106('0xc')]=_[_0x8106('0x11')](this[_0x8106('0xb')],'id');this['mapAgentsId'][_0x8106('0x10')]=_0x164b8d;};WhatsappQueue[_0x8106('0xf')]['updateRealtime']=function(){this[_0x8106('0x12')]=0x0;this[_0x8106('0x13')]=0x0;for(var _0x3496e2=0x0;_0x3496e2=0x0?this['available']:0x0;var _0x56011c={'id':this['id'],'available':this[_0x8106('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x8106('0x7')],'paused':this[_0x8106('0x13')],'waiting':this[_0x8106('0xd')]};var _0x5b294=md5(JSON[_0x8106('0x17')](_0x56011c));if(this['md5']!==_0x5b294){this['md5']=_0x5b294;io['to'](util['format']('whatsapp:queue:%s',_0x56011c[_0x8106('0x7')]))[_0x8106('0x18')](_0x8106('0x19'),_0x56011c);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 4b5d051..5a86031 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x579c8a,_0xc65888){var _0xc25ce9=function(_0x52a6bb){while(--_0x52a6bb){_0x579c8a['push'](_0x579c8a['shift']());}};_0xc25ce9(++_0xc65888);}(_0xb10b,0x12a));var _0xbb10=function(_0x3513a0,_0x3bdc88){_0x3513a0=_0x3513a0-0x0;var _0x2bdeb9=_0xb10b[_0x3513a0];return _0x2bdeb9;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 f4ee020..e14cc4a 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 _0x5d60=['../client','update','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x15062c,_0x483759){var _0x141503=function(_0x93b720){while(--_0x93b720){_0x15062c['push'](_0x15062c['shift']());}};_0x141503(++_0x483759);}(_0x5d60,0x181));var _0x05d6=function(_0x30b77b,_0x47bddb){_0x30b77b=_0x30b77b-0x0;var _0x30d09e=_0x5d60[_0x30b77b];return _0x30d09e;};'use strict';var client=require(_0x05d6('0x0'));exports[_0x05d6('0x1')]=function(_0x3fce3e,_0xb73ed){return client[_0x05d6('0x2')]('UpdateChatInteraction',{'body':_0xb73ed,'options':{'where':{'id':_0x3fce3e}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x25c46c,_0x57a242){return client[_0x05d6('0x2')](_0x05d6('0x3'),{'body':_0x57a242,'options':{'where':{'id':_0x25c46c}},'log':_0x05d6('0x4')});}; \ No newline at end of file +var _0x0adf=['UpdateChatInteraction','updateChatInteraction','addTags','addTagsToChatInteraction','../client','update','Request'];(function(_0x27cf08,_0x2d56ed){var _0x2f6d6e=function(_0x46f8c5){while(--_0x46f8c5){_0x27cf08['push'](_0x27cf08['shift']());}};_0x2f6d6e(++_0x2d56ed);}(_0x0adf,0xeb));var _0xf0ad=function(_0x4b4c7d,_0x30ae2b){_0x4b4c7d=_0x4b4c7d-0x0;var _0x2d586=_0x0adf[_0x4b4c7d];return _0x2d586;};'use strict';var client=require(_0xf0ad('0x0'));exports[_0xf0ad('0x1')]=function(_0xeea790,_0x58a1f1){return client[_0xf0ad('0x2')](_0xf0ad('0x3'),{'body':_0x58a1f1,'options':{'where':{'id':_0xeea790}},'log':_0xf0ad('0x4')});};exports[_0xf0ad('0x5')]=function(_0x370c8f,_0x21b386){return client[_0xf0ad('0x2')]('AddTagsToChatInteraction',{'body':_0x21b386,'options':{'where':{'id':_0x370c8f}},'log':_0xf0ad('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index de921bf..eb74190 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 _0x2a24=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x22a4cc,_0x5731e4){var _0x27bb2f=function(_0x282372){while(--_0x282372){_0x22a4cc['push'](_0x22a4cc['shift']());}};_0x27bb2f(++_0x5731e4);}(_0x2a24,0xeb));var _0x42a2=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2a24[_0x465a0c];return _0x1e202e;};'use strict';var client=require(_0x42a2('0x0'));exports[_0x42a2('0x1')]=function(_0x4cfa75){return client[_0x42a2('0x2')](_0x42a2('0x3'),{'body':_0x4cfa75,'log':_0x42a2('0x4')});}; \ No newline at end of file +var _0x2bcb=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x391ccc,_0x14926f){var _0x50d327=function(_0x34e7a0){while(--_0x34e7a0){_0x391ccc['push'](_0x391ccc['shift']());}};_0x50d327(++_0x14926f);}(_0x2bcb,0x74));var _0xb2bc=function(_0x4165f8,_0x182b87){_0x4165f8=_0x4165f8-0x0;var _0xd8644d=_0x2bcb[_0x4165f8];return _0xd8644d;};'use strict';var client=require(_0xb2bc('0x0'));exports[_0xb2bc('0x1')]=function(_0x17f6a6){return client['Request'](_0xb2bc('0x2'),{'body':_0x17f6a6,'log':_0xb2bc('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9c34c67..4f8cf33 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 _0x4250=['timeout','strategy','User','name','online','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x5c3b10,_0x3d2a2b){var _0x24800b=function(_0x41b99c){while(--_0x41b99c){_0x5c3b10['push'](_0x5c3b10['shift']());}};_0x24800b(++_0x3d2a2b);}(_0x4250,0x146));var _0x0425=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x4250[_0x5e36d1];return _0x950b9e;};'use strict';var client=require(_0x0425('0x0'));exports[_0x0425('0x1')]=function(){return function(){return client[_0x0425('0x2')](_0x0425('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0425('0x4'),_0x0425('0x5')],'include':[{'model':_0x0425('0x6'),'as':'Agents','attributes':['id',_0x0425('0x7'),_0x0425('0x8'),_0x0425('0x9')]}]},'log':_0x0425('0x1')});};}; \ No newline at end of file +var _0x482d=['strategy','User','online','chatPause','Request','GetChatQueue','name','timeout'];(function(_0x20a270,_0x8b8437){var _0x49429a=function(_0x4dc00b){while(--_0x4dc00b){_0x20a270['push'](_0x20a270['shift']());}};_0x49429a(++_0x8b8437);}(_0x482d,0x16c));var _0xd482=function(_0x2c533c,_0x5129f9){_0x2c533c=_0x2c533c-0x0;var _0x583bd2=_0x482d[_0x2c533c];return _0x583bd2;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0xd482('0x0')](_0xd482('0x1'),{'options':{'raw':![],'attributes':['id',_0xd482('0x2'),_0xd482('0x3'),_0xd482('0x4')],'include':[{'model':_0xd482('0x5'),'as':'Agents','attributes':['id',_0xd482('0x2'),_0xd482('0x6'),_0xd482('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 3a88fee..ba8b495 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 _0x1738=['Request','UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport','update'];(function(_0x3b3199,_0x10216d){var _0x4f592c=function(_0x1160c3){while(--_0x1160c3){_0x3b3199['push'](_0x3b3199['shift']());}};_0x4f592c(++_0x10216d);}(_0x1738,0x1bc));var _0x8173=function(_0x1d8c57,_0x33618f){_0x1d8c57=_0x1d8c57-0x0;var _0x19a971=_0x1738[_0x1d8c57];return _0x19a971;};'use strict';var client=require(_0x8173('0x0'));exports[_0x8173('0x1')]=function(_0x5b1fa9){return client['Request'](_0x8173('0x2'),{'body':_0x5b1fa9,'log':_0x8173('0x2')});};exports[_0x8173('0x3')]=function(_0x4e83f2,_0x555d4e){return client[_0x8173('0x4')](_0x8173('0x5'),{'body':_0x555d4e,'options':{'where':{'uniqueid':_0x4e83f2},'order':[['id',_0x8173('0x6')]],'limit':0x1},'log':_0x8173('0x5')});}; \ No newline at end of file +var _0xe105=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x3f3a19,_0x50cf2b){var _0x4855ae=function(_0x3a0276){while(--_0x3a0276){_0x3f3a19['push'](_0x3f3a19['shift']());}};_0x4855ae(++_0x50cf2b);}(_0xe105,0xef));var _0x5e10=function(_0x1ffa4b,_0x583f78){_0x1ffa4b=_0x1ffa4b-0x0;var _0x4fd7d6=_0xe105[_0x1ffa4b];return _0x4fd7d6;};'use strict';var client=require(_0x5e10('0x0'));exports['create']=function(_0x4d5a73){return client['Request']('CreateChatQueueReport',{'body':_0x4d5a73,'log':_0x5e10('0x1')});};exports[_0x5e10('0x2')]=function(_0x1cddb3,_0x191ab2){return client['Request'](_0x5e10('0x3'),{'body':_0x191ab2,'options':{'where':{'uniqueid':_0x1cddb3},'order':[['id',_0x5e10('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 6d5751e..9a87e74 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(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x7a54,0x106));var _0x47a5=function(_0x114d0f,_0x2566b5){_0x114d0f=_0x114d0f-0x0;var _0x53bc78=_0x7a54[_0x114d0f];return _0x53bc78;};'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(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x7a54,0x106));var _0x47a5=function(_0x3e990b,_0x36056b){_0x3e990b=_0x3e990b-0x0;var _0x5e07cf=_0x7a54[_0x3e990b];return _0x5e07cf;};'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 4ae2133..7169639 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 _0x2c7a=['../client','create','createFaxMessage'];(function(_0x21f013,_0x3a2050){var _0x1addf8=function(_0x45463c){while(--_0x45463c){_0x21f013['push'](_0x21f013['shift']());}};_0x1addf8(++_0x3a2050);}(_0x2c7a,0x171));var _0xa2c7=function(_0x14881f,_0x13b5e3){_0x14881f=_0x14881f-0x0;var _0x595fa0=_0x2c7a[_0x14881f];return _0x595fa0;};'use strict';var client=require(_0xa2c7('0x0'));exports[_0xa2c7('0x1')]=function(_0xf1e351){return client['Request']('CreateFaxMessage',{'body':_0xf1e351,'log':_0xa2c7('0x2')});}; \ No newline at end of file +var _0x6510=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x585f40,_0x4a3091){var _0x44fc86=function(_0x5bcedc){while(--_0x5bcedc){_0x585f40['push'](_0x585f40['shift']());}};_0x44fc86(++_0x4a3091);}(_0x6510,0xf1));var _0x0651=function(_0x61e0a5,_0x4722c3){_0x61e0a5=_0x61e0a5-0x0;var _0x5da5e4=_0x6510[_0x61e0a5];return _0x5da5e4;};'use strict';var client=require(_0x0651('0x0'));exports[_0x0651('0x1')]=function(_0x3adcf4){return client[_0x0651('0x2')](_0x0651('0x3'),{'body':_0x3adcf4,'log':_0x0651('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index c5d0b16..323a675 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 _0xb108=['timeout','strategy','User','Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb108,0xd8));var _0x8b10=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb108[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0x8b10('0x0')]=function(){return function(){return client[_0x8b10('0x1')](_0x8b10('0x2'),{'options':{'raw':![],'attributes':['id',_0x8b10('0x3'),_0x8b10('0x4'),_0x8b10('0x5')],'include':[{'model':_0x8b10('0x6'),'as':_0x8b10('0x7'),'attributes':['id',_0x8b10('0x3'),_0x8b10('0x8'),_0x8b10('0x9')]}]},'log':_0x8b10('0x0')});};}; \ No newline at end of file +var _0x2df4=['faxPause','getFaxQueues','Request','strategy','User','Agents','name','online'];(function(_0x725e56,_0xa5d92d){var _0x173bfc=function(_0x453c44){while(--_0x453c44){_0x725e56['push'](_0x725e56['shift']());}};_0x173bfc(++_0xa5d92d);}(_0x2df4,0x1c9));var _0x42df=function(_0x4978de,_0x5912e4){_0x4978de=_0x4978de-0x0;var _0x675221=_0x2df4[_0x4978de];return _0x675221;};'use strict';var client=require('../client');exports[_0x42df('0x0')]=function(){return function(){return client[_0x42df('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x42df('0x2')],'include':[{'model':_0x42df('0x3'),'as':_0x42df('0x4'),'attributes':['id',_0x42df('0x5'),_0x42df('0x6'),_0x42df('0x7')]}]},'log':_0x42df('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index a4a04e8..e8d653d 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 _0xe8a4=['DESC','UpdateFaxQueueReport','../client','CreateFaxQueueReport','update','Request'];(function(_0x2bf86b,_0x43a7fd){var _0x19df60=function(_0x3d54d9){while(--_0x3d54d9){_0x2bf86b['push'](_0x2bf86b['shift']());}};_0x19df60(++_0x43a7fd);}(_0xe8a4,0x158));var _0x4e8a=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xe8a4[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0x4e8a('0x0'));exports['create']=function(_0x124c39){return client['Request'](_0x4e8a('0x1'),{'body':_0x124c39,'log':_0x4e8a('0x1')});};exports[_0x4e8a('0x2')]=function(_0x51ee1e,_0x9d4261){return client[_0x4e8a('0x3')]('UpdateFaxQueueReport',{'body':_0x9d4261,'options':{'where':{'uniqueid':_0x51ee1e},'order':[['id',_0x4e8a('0x4')]],'limit':0x1},'log':_0x4e8a('0x5')});}; \ No newline at end of file +var _0x8b62=['DESC','UpdateFaxQueueReport','create','Request','CreateFaxQueueReport','update'];(function(_0x56407a,_0x51ab09){var _0x2e7c2e=function(_0x5870d2){while(--_0x5870d2){_0x56407a['push'](_0x56407a['shift']());}};_0x2e7c2e(++_0x51ab09);}(_0x8b62,0xb6));var _0x28b6=function(_0x47e93d,_0x26bbdd){_0x47e93d=_0x47e93d-0x0;var _0xe86c46=_0x8b62[_0x47e93d];return _0xe86c46;};'use strict';var client=require('../client');exports[_0x28b6('0x0')]=function(_0x28a2ba){return client[_0x28b6('0x1')](_0x28b6('0x2'),{'body':_0x28a2ba,'log':_0x28b6('0x2')});};exports[_0x28b6('0x3')]=function(_0x2a2fea,_0x3ab766){return client[_0x28b6('0x1')]('UpdateFaxQueueReport',{'body':_0x3ab766,'options':{'where':{'uniqueid':_0x2a2fea},'order':[['id',_0x28b6('0x4')]],'limit':0x1},'log':_0x28b6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 68e8ec7..6109fbd 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 _0x8635=['Intervals','interval','GetInterval','name','Interval'];(function(_0x2ed48b,_0x59d705){var _0x5c4f37=function(_0x5b8fc1){while(--_0x5b8fc1){_0x2ed48b['push'](_0x2ed48b['shift']());}};_0x5c4f37(++_0x59d705);}(_0x8635,0x19c));var _0x5863=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x8635[_0x2bf141];return _0x48277b;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client['Request'](_0x5863('0x0'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5863('0x1')],'include':[{'model':_0x5863('0x2'),'as':_0x5863('0x3'),'attributes':['id',_0x5863('0x1'),_0x5863('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xe2e1=['interval','../client','getIntervals','Request','GetInterval','Interval'];(function(_0x317ba6,_0x415351){var _0x356f9c=function(_0x29249b){while(--_0x29249b){_0x317ba6['push'](_0x317ba6['shift']());}};_0x356f9c(++_0x415351);}(_0xe2e1,0x157));var _0x1e2e=function(_0x2b4f49,_0x200f03){_0x2b4f49=_0x2b4f49-0x0;var _0x223a76=_0xe2e1[_0x2b4f49];return _0x223a76;};'use strict';var client=require(_0x1e2e('0x0'));exports[_0x1e2e('0x1')]=function(){return function(){return client[_0x1e2e('0x2')](_0x1e2e('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x1e2e('0x4'),'as':'Intervals','attributes':['id','name',_0x1e2e('0x5')]}]},'log':_0x1e2e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index aba70a7..b9e01f0 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 _0xbbbc=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x50cd94,_0x4e3f38){_0x50cd94=_0x50cd94-0x0;var _0x44b6d6=_0xbbbc[_0x50cd94];return _0x44b6d6;};'use strict';var client=require(_0xcbbb('0x0'));exports[_0xcbbb('0x1')]=function(_0x4314a8,_0x4538f9){return client[_0xcbbb('0x2')](_0xcbbb('0x3'),{'body':_0x4538f9,'options':{'where':{'id':_0x4314a8}},'log':_0xcbbb('0x4')});};exports['addTags']=function(_0xb1ad23,_0x938376){return client[_0xcbbb('0x2')](_0xcbbb('0x5'),{'body':_0x938376,'options':{'where':{'id':_0xb1ad23}},'log':_0xcbbb('0x6')});}; \ No newline at end of file +var _0xe820=['../client','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0xa51e3e,_0xea78db){var _0x11147c=function(_0x2c9918){while(--_0x2c9918){_0xa51e3e['push'](_0xa51e3e['shift']());}};_0x11147c(++_0xea78db);}(_0xe820,0xd2));var _0x0e82=function(_0x5c8b35,_0x5154d0){_0x5c8b35=_0x5c8b35-0x0;var _0x214007=_0xe820[_0x5c8b35];return _0x214007;};'use strict';var client=require(_0x0e82('0x0'));exports['update']=function(_0x908a54,_0x4e6b50){return client['Request'](_0x0e82('0x1'),{'body':_0x4e6b50,'options':{'where':{'id':_0x908a54}},'log':_0x0e82('0x2')});};exports[_0x0e82('0x3')]=function(_0x59b28d,_0xc6d61e){return client['Request'](_0x0e82('0x4'),{'body':_0xc6d61e,'options':{'where':{'id':_0x59b28d}},'log':_0x0e82('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 632ef44..61ef37b 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 _0x191f=['../client','create','Request','CreateMailMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x191f,0x164));var _0xf191=function(_0x50bd62,_0x217adb){_0x50bd62=_0x50bd62-0x0;var _0x3384f3=_0x191f[_0x50bd62];return _0x3384f3;};'use strict';var client=require(_0xf191('0x0'));exports[_0xf191('0x1')]=function(_0x306d3c){return client[_0xf191('0x2')](_0xf191('0x3'),{'body':_0x306d3c,'log':'createMailMessage'});}; \ No newline at end of file +var _0x5eff=['Request','CreateMailMessage','createMailMessage','../client'];(function(_0x33e664,_0x22fc9f){var _0x52c1e8=function(_0x28d6c0){while(--_0x28d6c0){_0x33e664['push'](_0x33e664['shift']());}};_0x52c1e8(++_0x22fc9f);}(_0x5eff,0x177));var _0xf5ef=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x5eff[_0xa148b7];return _0x51efd3;};'use strict';var client=require(_0xf5ef('0x0'));exports['create']=function(_0x1b4d50){return client[_0xf5ef('0x1')](_0xf5ef('0x2'),{'body':_0x1b4d50,'log':_0xf5ef('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 5498125..f95b8a5 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 _0xb8ef=['Agents','online','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User'];(function(_0x52f485,_0x5ce705){var _0x325aef=function(_0x3edc51){while(--_0x3edc51){_0x52f485['push'](_0x52f485['shift']());}};_0x325aef(++_0x5ce705);}(_0xb8ef,0x7a));var _0xfb8e=function(_0x7598cf,_0x47df31){_0x7598cf=_0x7598cf-0x0;var _0x9bd0de=_0xb8ef[_0x7598cf];return _0x9bd0de;};'use strict';var client=require(_0xfb8e('0x0'));exports[_0xfb8e('0x1')]=function(){return function(){return client[_0xfb8e('0x2')](_0xfb8e('0x3'),{'options':{'raw':![],'attributes':['id',_0xfb8e('0x4'),_0xfb8e('0x5'),_0xfb8e('0x6')],'include':[{'model':_0xfb8e('0x7'),'as':_0xfb8e('0x8'),'attributes':['id','name',_0xfb8e('0x9'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xf6da=['timeout','strategy','User','Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x703c94,_0x273a5b){var _0x586fb9=function(_0x12dca7){while(--_0x12dca7){_0x703c94['push'](_0x703c94['shift']());}};_0x586fb9(++_0x273a5b);}(_0xf6da,0x19f));var _0xaf6d=function(_0x2a276d,_0x11589e){_0x2a276d=_0x2a276d-0x0;var _0x8441bf=_0xf6da[_0x2a276d];return _0x8441bf;};'use strict';var client=require(_0xaf6d('0x0'));exports[_0xaf6d('0x1')]=function(){return function(){return client[_0xaf6d('0x2')](_0xaf6d('0x3'),{'options':{'raw':![],'attributes':['id',_0xaf6d('0x4'),_0xaf6d('0x5'),_0xaf6d('0x6')],'include':[{'model':_0xaf6d('0x7'),'as':_0xaf6d('0x8'),'attributes':['id',_0xaf6d('0x4'),'online',_0xaf6d('0x9')]}]},'log':_0xaf6d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f6df9b7..1eff7c8 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 _0x4618=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4618,0x1c9));var _0x8461=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x4618[_0x255d5b];return _0x3e141a;};'use strict';var client=require(_0x8461('0x0'));exports[_0x8461('0x1')]=function(_0x1f1616){return client[_0x8461('0x2')](_0x8461('0x3'),{'body':_0x1f1616,'log':_0x8461('0x3')});};exports[_0x8461('0x4')]=function(_0x53be85,_0x162d7d){return client[_0x8461('0x2')](_0x8461('0x5'),{'body':_0x162d7d,'options':{'where':{'uniqueid':_0x53be85},'order':[['id',_0x8461('0x6')]],'limit':0x1},'log':_0x8461('0x5')});}; \ No newline at end of file +var _0xe326=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe326,0x176));var _0x6e32=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0xe326[_0x34ad72];return _0x5c9aa8;};'use strict';var client=require(_0x6e32('0x0'));exports[_0x6e32('0x1')]=function(_0x2cc672){return client[_0x6e32('0x2')](_0x6e32('0x3'),{'body':_0x2cc672,'log':_0x6e32('0x3')});};exports[_0x6e32('0x4')]=function(_0xcf7594,_0x1c7ed9){return client['Request'](_0x6e32('0x5'),{'body':_0x1c7ed9,'options':{'where':{'uniqueid':_0xcf7594},'order':[['id',_0x6e32('0x6')]],'limit':0x1},'log':_0x6e32('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 0dfc34c..0867f3c 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 _0xbf16=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x5df6ec,_0x428d22){var _0x5813ea=function(_0x111b91){while(--_0x111b91){_0x5df6ec['push'](_0x5df6ec['shift']());}};_0x5813ea(++_0x428d22);}(_0xbf16,0x18a));var _0x6bf1=function(_0x515949,_0x2c6395){_0x515949=_0x515949-0x0;var _0x131e1b=_0xbf16[_0x515949];return _0x131e1b;};'use strict';var client=require(_0x6bf1('0x0'));exports[_0x6bf1('0x1')]=function(_0x32975d,_0x2af4da){return client[_0x6bf1('0x2')](_0x6bf1('0x3'),{'body':_0x2af4da,'options':{'where':{'id':_0x32975d}},'log':_0x6bf1('0x4')});};exports[_0x6bf1('0x5')]=function(_0x49397c,_0x243f16){return client[_0x6bf1('0x2')](_0x6bf1('0x6'),{'body':_0x243f16,'options':{'where':{'id':_0x49397c}},'log':_0x6bf1('0x7')});}; \ No newline at end of file +var _0xd039=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x37fccd,_0x15f747){var _0x1ce641=function(_0x5aa2d3){while(--_0x5aa2d3){_0x37fccd['push'](_0x37fccd['shift']());}};_0x1ce641(++_0x15f747);}(_0xd039,0x110));var _0x9d03=function(_0x3032ac,_0x34980c){_0x3032ac=_0x3032ac-0x0;var _0x43f1b6=_0xd039[_0x3032ac];return _0x43f1b6;};'use strict';var client=require(_0x9d03('0x0'));exports[_0x9d03('0x1')]=function(_0x121c64,_0x2c54eb){return client[_0x9d03('0x2')](_0x9d03('0x3'),{'body':_0x2c54eb,'options':{'where':{'id':_0x121c64}},'log':_0x9d03('0x4')});};exports[_0x9d03('0x5')]=function(_0x667a5,_0x5edc1a){return client[_0x9d03('0x2')](_0x9d03('0x6'),{'body':_0x5edc1a,'options':{'where':{'id':_0x667a5}},'log':_0x9d03('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 5adfb89..ede055c 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 _0x3461=['../client','createOpenchannelMessage'];(function(_0xd3323c,_0x312c10){var _0x125fc0=function(_0x4add99){while(--_0x4add99){_0xd3323c['push'](_0xd3323c['shift']());}};_0x125fc0(++_0x312c10);}(_0x3461,0x1b2));var _0x1346=function(_0x10e2c9,_0x489aab){_0x10e2c9=_0x10e2c9-0x0;var _0x426947=_0x3461[_0x10e2c9];return _0x426947;};'use strict';var client=require(_0x1346('0x0'));exports['create']=function(_0x21a81c){return client['Request']('CreateOpenchannelMessage',{'body':_0x21a81c,'log':_0x1346('0x1')});}; \ No newline at end of file +var _0xed2f=['createOpenchannelMessage','../client','create','Request'];(function(_0x211825,_0x5a09ac){var _0xd40b05=function(_0x47031e){while(--_0x47031e){_0x211825['push'](_0x211825['shift']());}};_0xd40b05(++_0x5a09ac);}(_0xed2f,0x185));var _0xfed2=function(_0x2cd411,_0x4d1181){_0x2cd411=_0x2cd411-0x0;var _0x39bdcc=_0xed2f[_0x2cd411];return _0x39bdcc;};'use strict';var client=require(_0xfed2('0x0'));exports[_0xfed2('0x1')]=function(_0x31ea4f){return client[_0xfed2('0x2')]('CreateOpenchannelMessage',{'body':_0x31ea4f,'log':_0xfed2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 8ffccb9..3777bfe 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 _0xefdd=['name','timeout','strategy','User','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue'];(function(_0x33ca26,_0xd94c2){var _0x47fcbe=function(_0x35555a){while(--_0x35555a){_0x33ca26['push'](_0x33ca26['shift']());}};_0x47fcbe(++_0xd94c2);}(_0xefdd,0x75));var _0xdefd=function(_0x24e835,_0x2ee036){_0x24e835=_0x24e835-0x0;var _0x2dc162=_0xefdd[_0x24e835];return _0x2dc162;};'use strict';var client=require(_0xdefd('0x0'));exports[_0xdefd('0x1')]=function(){return function(){return client['Request'](_0xdefd('0x2'),{'options':{'raw':![],'attributes':['id',_0xdefd('0x3'),_0xdefd('0x4'),_0xdefd('0x5')],'include':[{'model':_0xdefd('0x6'),'as':'Agents','attributes':['id','name','online',_0xdefd('0x7')]}]},'log':_0xdefd('0x1')});};}; \ No newline at end of file +var _0xccb3=['online','openchannelPause','getOpenchannelQueues','Request','timeout','strategy','User','name'];(function(_0x157432,_0x48a4dc){var _0x21fa86=function(_0x52814a){while(--_0x52814a){_0x157432['push'](_0x157432['shift']());}};_0x21fa86(++_0x48a4dc);}(_0xccb3,0x15a));var _0x3ccb=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0xccb3[_0x4d6bfd];return _0x243a46;};'use strict';var client=require('../client');exports[_0x3ccb('0x0')]=function(){return function(){return client[_0x3ccb('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x3ccb('0x2'),_0x3ccb('0x3')],'include':[{'model':_0x3ccb('0x4'),'as':'Agents','attributes':['id',_0x3ccb('0x5'),_0x3ccb('0x6'),_0x3ccb('0x7')]}]},'log':_0x3ccb('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index c8ec05a..3805dd7 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 _0xe1bf=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe1bf,0x67));var _0xfe1b=function(_0x21ff15,_0x5be093){_0x21ff15=_0x21ff15-0x0;var _0x3cd4c0=_0xe1bf[_0x21ff15];return _0x3cd4c0;};'use strict';var client=require('../client');exports[_0xfe1b('0x0')]=function(_0x4ed873){return client[_0xfe1b('0x1')](_0xfe1b('0x2'),{'body':_0x4ed873,'log':_0xfe1b('0x2')});};exports[_0xfe1b('0x3')]=function(_0x4cdabd,_0x2dcee6){return client[_0xfe1b('0x1')](_0xfe1b('0x4'),{'body':_0x2dcee6,'options':{'where':{'uniqueid':_0x4cdabd},'order':[['id',_0xfe1b('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x2357=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','create'];(function(_0x1b21d8,_0x3cc422){var _0x1cdc25=function(_0x691aff){while(--_0x691aff){_0x1b21d8['push'](_0x1b21d8['shift']());}};_0x1cdc25(++_0x3cc422);}(_0x2357,0xa9));var _0x7235=function(_0x5d107c,_0x1f204d){_0x5d107c=_0x5d107c-0x0;var _0x53bd5a=_0x2357[_0x5d107c];return _0x53bd5a;};'use strict';var client=require('../client');exports[_0x7235('0x0')]=function(_0x3fa6d3){return client[_0x7235('0x1')](_0x7235('0x2'),{'body':_0x3fa6d3,'log':_0x7235('0x2')});};exports[_0x7235('0x3')]=function(_0x2e5bcb,_0x39b704){return client['Request'](_0x7235('0x4'),{'body':_0x39b704,'options':{'where':{'uniqueid':_0x2e5bcb},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7bad703..e6ea224 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 _0x899a=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x899a,0x1b6));var _0xa899=function(_0x3d210f,_0x576189){_0x3d210f=_0x3d210f-0x0;var _0x52ca87=_0x899a[_0x3d210f];return _0x52ca87;};'use strict';var client=require(_0xa899('0x0'));exports[_0xa899('0x1')]=function(_0x4f77af,_0x26e9a7){return client[_0xa899('0x2')]('UpdateSmsInteraction',{'body':_0x26e9a7,'options':{'where':{'id':_0x4f77af}},'log':_0xa899('0x3')});};exports[_0xa899('0x4')]=function(_0x1c5c93,_0x223383){return client['Request'](_0xa899('0x5'),{'body':_0x223383,'options':{'where':{'id':_0x1c5c93}},'log':_0xa899('0x6')});}; \ No newline at end of file +var _0x52ad=['../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x5b383a,_0x119991){var _0x596055=function(_0x3c4e4e){while(--_0x3c4e4e){_0x5b383a['push'](_0x5b383a['shift']());}};_0x596055(++_0x119991);}(_0x52ad,0x1d8));var _0xd52a=function(_0x34db04,_0x4a8d43){_0x34db04=_0x34db04-0x0;var _0x3e3d72=_0x52ad[_0x34db04];return _0x3e3d72;};'use strict';var client=require(_0xd52a('0x0'));exports[_0xd52a('0x1')]=function(_0x44ae9f,_0xd42738){return client['Request'](_0xd52a('0x2'),{'body':_0xd42738,'options':{'where':{'id':_0x44ae9f}},'log':_0xd52a('0x3')});};exports[_0xd52a('0x4')]=function(_0xf1d12e,_0x69fd93){return client[_0xd52a('0x5')](_0xd52a('0x6'),{'body':_0x69fd93,'options':{'where':{'id':_0xf1d12e}},'log':_0xd52a('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index c80235f..8a361fe 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 _0x016c=['../client','createSmsMessage'];(function(_0x5b9458,_0x184cc5){var _0x1134d4=function(_0x1dae3d){while(--_0x1dae3d){_0x5b9458['push'](_0x5b9458['shift']());}};_0x1134d4(++_0x184cc5);}(_0x016c,0x1c6));var _0xc016=function(_0x507daa,_0x2f4fa9){_0x507daa=_0x507daa-0x0;var _0x2a7254=_0x016c[_0x507daa];return _0x2a7254;};'use strict';var client=require(_0xc016('0x0'));exports['create']=function(_0x5b02d5){return client['Request']('CreateSmsMessage',{'body':_0x5b02d5,'log':_0xc016('0x1')});}; \ No newline at end of file +var _0xcd5f=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0xcd5f,0xd4));var _0xfcd5=function(_0x3c65e5,_0x1a175d){_0x3c65e5=_0x3c65e5-0x0;var _0x2ab862=_0xcd5f[_0x3c65e5];return _0x2ab862;};'use strict';var client=require(_0xfcd5('0x0'));exports[_0xfcd5('0x1')]=function(_0x52ec44){return client[_0xfcd5('0x2')](_0xfcd5('0x3'),{'body':_0x52ec44,'log':_0xfcd5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index f9ca9ea..3eccfa5 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5df09c,_0x33f358){var _0x57d4d4=function(_0x19184f){while(--_0x19184f){_0x5df09c['push'](_0x5df09c['shift']());}};_0x57d4d4(++_0x33f358);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('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 +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x190a9f,_0x31b462){var _0x3d944f=function(_0x41804d){while(--_0x41804d){_0x190a9f['push'](_0x190a9f['shift']());}};_0x3d944f(++_0x31b462);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 6c89589..0e12f50 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x551527,_0xd1ae00){var _0x54d7b2=function(_0x391bd3){while(--_0x391bd3){_0x551527['push'](_0x551527['shift']());}};_0x54d7b2(++_0xd1ae00);}(_0x34e8,0x12c));var _0x834e=function(_0x44c255,_0x269366){_0x44c255=_0x44c255-0x0;var _0x4f4f9c=_0x34e8[_0x44c255];return _0x4f4f9c;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0xa3de09,_0x191222){var _0x20d31c=function(_0x1b26e8){while(--_0x1b26e8){_0xa3de09['push'](_0xa3de09['shift']());}};_0x20d31c(++_0x191222);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index b5efad6..2f331dd 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(_0x3a27fd,_0x5357ea){var _0x2e519=function(_0x1e2112){while(--_0x1e2112){_0x3a27fd['push'](_0x3a27fd['shift']());}};_0x2e519(++_0x5357ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x5e055e,_0x36b550){var _0x4ce50d=function(_0x21446e){while(--_0x21446e){_0x5e055e['push'](_0x5e055e['shift']());}};_0x4ce50d(++_0x36b550);}(_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 diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 5f78ced..d03372c 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 _0xacf4=['AddTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xacf4,0xe7));var _0x4acf=function(_0x3ebdf8,_0x3d80cd){_0x3ebdf8=_0x3ebdf8-0x0;var _0xe367c8=_0xacf4[_0x3ebdf8];return _0xe367c8;};'use strict';var client=require('../client');exports['update']=function(_0x867c40,_0x14a022){return client[_0x4acf('0x0')](_0x4acf('0x1'),{'body':_0x14a022,'options':{'where':{'id':_0x867c40}},'log':_0x4acf('0x2')});};exports[_0x4acf('0x3')]=function(_0x145264,_0x5cf22d){return client[_0x4acf('0x0')](_0x4acf('0x4'),{'body':_0x5cf22d,'options':{'where':{'id':_0x145264}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x1224=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x392dc2,_0x47c3f3){var _0x14150f=function(_0x9f305a){while(--_0x9f305a){_0x392dc2['push'](_0x392dc2['shift']());}};_0x14150f(++_0x47c3f3);}(_0x1224,0x10d));var _0x4122=function(_0xb1ee0e,_0x2126df){_0xb1ee0e=_0xb1ee0e-0x0;var _0x376116=_0x1224[_0xb1ee0e];return _0x376116;};'use strict';var client=require(_0x4122('0x0'));exports[_0x4122('0x1')]=function(_0x23c391,_0x4122fd){return client[_0x4122('0x2')](_0x4122('0x3'),{'body':_0x4122fd,'options':{'where':{'id':_0x23c391}},'log':'updateWhatsappInteraction'});};exports[_0x4122('0x4')]=function(_0x1f1533,_0x2f506b){return client['Request'](_0x4122('0x5'),{'body':_0x2f506b,'options':{'where':{'id':_0x1f1533}},'log':_0x4122('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 223ebff..2805b16 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 _0xd870=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x3b8139,_0x459b80){var _0x5143a4=function(_0x452ffe){while(--_0x452ffe){_0x3b8139['push'](_0x3b8139['shift']());}};_0x5143a4(++_0x459b80);}(_0xd870,0xc1));var _0x0d87=function(_0x619df8,_0x3c9b3c){_0x619df8=_0x619df8-0x0;var _0x5e11b2=_0xd870[_0x619df8];return _0x5e11b2;};'use strict';var client=require('../client');exports[_0x0d87('0x0')]=function(_0x5c27c0){return client[_0x0d87('0x1')](_0x0d87('0x2'),{'body':_0x5c27c0,'log':_0x0d87('0x3')});}; \ No newline at end of file +var _0x5bfb=['createWhatsappMessage','create','CreateWhatsappMessage'];(function(_0x3926dd,_0x291f75){var _0x3446f8=function(_0x5a54ae){while(--_0x5a54ae){_0x3926dd['push'](_0x3926dd['shift']());}};_0x3446f8(++_0x291f75);}(_0x5bfb,0xeb));var _0xb5bf=function(_0x5815d7,_0x150c8c){_0x5815d7=_0x5815d7-0x0;var _0x24e44e=_0x5bfb[_0x5815d7];return _0x24e44e;};'use strict';var client=require('../client');exports[_0xb5bf('0x0')]=function(_0x35d2b3){return client['Request'](_0xb5bf('0x1'),{'body':_0x35d2b3,'log':_0xb5bf('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index f7901b9..5bf0dce 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 _0xcf40=['Agents','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0xcf40,0x1b2));var _0x0cf4=function(_0x5a22bc,_0x43a46f){_0x5a22bc=_0x5a22bc-0x0;var _0x36461b=_0xcf40[_0x5a22bc];return _0x36461b;};'use strict';var client=require(_0x0cf4('0x0'));exports[_0x0cf4('0x1')]=function(){return function(){return client[_0x0cf4('0x2')](_0x0cf4('0x3'),{'options':{'raw':![],'attributes':['id',_0x0cf4('0x4'),'timeout',_0x0cf4('0x5')],'include':[{'model':'User','as':_0x0cf4('0x6'),'attributes':['id',_0x0cf4('0x4'),'online',_0x0cf4('0x7')]}]},'log':_0x0cf4('0x1')});};}; \ No newline at end of file +var _0x2545=['GetWhatsappQueue','name','timeout','User','Agents','getWhatsappQueues','Request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2545,0x148));var _0x5254=function(_0x33cb98,_0x59d992){_0x33cb98=_0x33cb98-0x0;var _0x1edd8f=_0x2545[_0x33cb98];return _0x1edd8f;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x5254('0x0')](_0x5254('0x1'),{'options':{'raw':![],'attributes':['id',_0x5254('0x2'),_0x5254('0x3'),'strategy'],'include':[{'model':_0x5254('0x4'),'as':_0x5254('0x5'),'attributes':['id','name','online','whatsappPause']}]},'log':_0x5254('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 21a21f4..4e694af 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 _0x89b4=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x89b4,0x150));var _0x489b=function(_0x3d28fc,_0x4e27f0){_0x3d28fc=_0x3d28fc-0x0;var _0x2b5f42=_0x89b4[_0x3d28fc];return _0x2b5f42;};'use strict';var client=require(_0x489b('0x0'));exports['create']=function(_0x33d772){return client[_0x489b('0x1')](_0x489b('0x2'),{'body':_0x33d772,'log':_0x489b('0x2')});};exports[_0x489b('0x3')]=function(_0x514784,_0x59c4cc){return client[_0x489b('0x1')](_0x489b('0x4'),{'body':_0x59c4cc,'options':{'where':{'uniqueid':_0x514784},'order':[['id','DESC']],'limit':0x1},'log':_0x489b('0x4')});}; \ No newline at end of file +var _0x5980=['Request','UpdateWhatsappQueueReport','DESC','../client','CreateWhatsappQueueReport','update'];(function(_0x1127bf,_0x542714){var _0x5bdfce=function(_0x29b766){while(--_0x29b766){_0x1127bf['push'](_0x1127bf['shift']());}};_0x5bdfce(++_0x542714);}(_0x5980,0x1b3));var _0x0598=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x5980[_0x999b85];return _0x1d7124;};'use strict';var client=require(_0x0598('0x0'));exports['create']=function(_0x378884){return client['Request'](_0x0598('0x1'),{'body':_0x378884,'log':_0x0598('0x1')});};exports[_0x0598('0x2')]=function(_0x5a5acf,_0x2e10bf){return client[_0x0598('0x3')](_0x0598('0x4'),{'body':_0x2e10bf,'options':{'where':{'uniqueid':_0x5a5acf},'order':[['id',_0x0598('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 17dfd70..73af33d 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 _0x480d=['./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','log','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','../../../../config/logger','routing'];(function(_0x365745,_0x55a3cf){var _0x53938f=function(_0x306a5f){while(--_0x306a5f){_0x365745['push'](_0x365745['shift']());}};_0x53938f(++_0x55a3cf);}(_0x480d,0x114));var _0xd480=function(_0x1f3af8,_0x5f28ec){_0x1f3af8=_0x1f3af8-0x0;var _0x38b2d3=_0x480d[_0x1f3af8];return _0x38b2d3;};'use strict';var schema=require('validate');var _=require(_0xd480('0x0'));var util=require('util');var seqqueue=require(_0xd480('0x1'));var logger=require(_0xd480('0x2'))(_0xd480('0x3'));var strategy=require(_0xd480('0x4'));var queue=schema({'name':{'type':_0xd480('0x5'),'required':!![],'message':_0xd480('0x6')},'timeout':{'type':_0xd480('0x7'),'message':_0xd480('0x8')}});function writeLog(_0x20ae04,_0x2d6505,_0x12c246){return logger[_0xd480('0x9')](util[_0xd480('0xa')](_0xd480('0xb'),_0x20ae04,_0x2d6505[_0xd480('0xc')],_0x12c246));}function handleFindAgent(_0x510276){return function(_0x295332){return _0x295332[_0xd480('0xc')]['toLowerCase']()===_0x510276['toLowerCase']();};}exports[_0xd480('0xd')]=function(_0x28fcc8,_0x4040c8,_0x336c24,_0x24f5f8){return function(_0x1f81cf){try{var _0x469cb3={'name':_0x4040c8[0x0],'timeout':_0x4040c8[0x1]};var _0x53b979=queue[_0xd480('0xe')](_0x469cb3,{'typecast':!![]});if(_0x53b979[_0xd480('0xf')]){logger[_0xd480('0x10')](_0xd480('0x11'),_0x28fcc8,_[_0xd480('0x12')](_0x53b979,_0xd480('0x13'))[_0xd480('0x14')](',\x20'));_0x1f81cf[_0xd480('0x15')]();}else{var _0x2d3991=_['find'](_0x336c24[_0xd480('0x16')],handleFindAgent(_0x469cb3[_0xd480('0xc')]));if(_0x2d3991){var _0x2bc1ff=(_0x469cb3[_0xd480('0x17')]||0xa)*0x3e8;var _0x15793f,_0x1f5e8e;var _0xe97b5d=seqqueue['createQueue'](_0x2bc1ff);_0xe97b5d['id']=_0x28fcc8;_0xe97b5d['atimeout']=_0x2bc1ff;_0xe97b5d['channel']=_0x24f5f8[_0xd480('0x18')];writeLog(_0x28fcc8,_0x2d3991,util[_0xd480('0xa')](_0xd480('0x19'),_0x2bc1ff));_0x336c24[_0xd480('0x1a')][_0x28fcc8]['on'](_0xd480('0x1b'),function(){logger['info'](_0xd480('0x1c'),_0x28fcc8);clearTimeout(_0x1f5e8e);_0x1f5e8e=undefined;_0xe97b5d[_0xd480('0x1d')]();if(_0x336c24['rules'][_0x28fcc8]){delete _0x336c24[_0xd480('0x1a')][_0x28fcc8];}_0x1f81cf[_0xd480('0x15')]();});_0x336c24[_0xd480('0x1a')][_0x28fcc8]['on']('complete',function(){if(_0x336c24['rules'][_0x28fcc8]){delete _0x336c24[_0xd480('0x1a')][_0x28fcc8];}});_0x1f5e8e=setTimeout(function(){logger[_0xd480('0x9')](_0xd480('0x1e'),_0x28fcc8);clearTimeout(_0x1f5e8e);_0xe97b5d[_0xd480('0x1d')]();_0x1f81cf[_0xd480('0x1f')]();},_0x2bc1ff);strategy['agent'](_0xe97b5d,_0x2d3991,_0x336c24,_0x24f5f8);}else{logger[_0xd480('0x10')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x28fcc8,_0x469cb3[_0xd480('0xc')]);_0x1f81cf[_0xd480('0x15')]();}}}catch(_0x11790f){console[_0xd480('0x20')](_0x11790f);logger[_0xd480('0x10')](_0xd480('0x21'),_0x28fcc8,_0x11790f[_0xd480('0x22')]);_0x1f81cf['stop']();}};}; \ No newline at end of file +var _0x05b9=['atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','timeout'];(function(_0x29d849,_0x209ceb){var _0x30b104=function(_0x2a1669){while(--_0x2a1669){_0x29d849['push'](_0x29d849['shift']());}};_0x30b104(++_0x209ceb);}(_0x05b9,0xc3));var _0x905b=function(_0x4e84d3,_0x1add05){_0x4e84d3=_0x4e84d3-0x0;var _0x1a0df6=_0x05b9[_0x4e84d3];return _0x1a0df6;};'use strict';var schema=require(_0x905b('0x0'));var _=require('lodash');var util=require(_0x905b('0x1'));var seqqueue=require(_0x905b('0x2'));var logger=require(_0x905b('0x3'))(_0x905b('0x4'));var strategy=require(_0x905b('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x905b('0x6')},'timeout':{'type':_0x905b('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0xe8e373,_0x4f3383,_0xc7cbb5){return logger[_0x905b('0x8')](util[_0x905b('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0xe8e373,_0x4f3383['name'],_0xc7cbb5));}function handleFindAgent(_0x1b3401){return function(_0x491594){return _0x491594[_0x905b('0xa')]['toLowerCase']()===_0x1b3401[_0x905b('0xb')]();};}exports[_0x905b('0xc')]=function(_0x3224d1,_0xfe32c3,_0x51f203,_0x4438d6){return function(_0x45bb5a){try{var _0x2a494f={'name':_0xfe32c3[0x0],'timeout':_0xfe32c3[0x1]};var _0xd6599f=queue[_0x905b('0x0')](_0x2a494f,{'typecast':!![]});if(_0xd6599f[_0x905b('0xd')]){logger[_0x905b('0xe')](_0x905b('0xf'),_0x3224d1,_['map'](_0xd6599f,_0x905b('0x10'))[_0x905b('0x11')](',\x20'));_0x45bb5a[_0x905b('0x12')]();}else{var _0x2623ec=_[_0x905b('0x13')](_0x51f203['agents'],handleFindAgent(_0x2a494f[_0x905b('0xa')]));if(_0x2623ec){var _0x1a86f0=(_0x2a494f[_0x905b('0x14')]||0xa)*0x3e8;var _0x25bbc1,_0x46f611;var _0x1b1aa6=seqqueue['createQueue'](_0x1a86f0);_0x1b1aa6['id']=_0x3224d1;_0x1b1aa6[_0x905b('0x15')]=_0x1a86f0;_0x1b1aa6['channel']=_0x4438d6[_0x905b('0x16')];writeLog(_0x3224d1,_0x2623ec,util[_0x905b('0x9')](_0x905b('0x17'),_0x1a86f0));_0x51f203['rules'][_0x3224d1]['on'](_0x905b('0x18'),function(){logger[_0x905b('0x8')](_0x905b('0x19'),_0x3224d1);clearTimeout(_0x46f611);_0x46f611=undefined;_0x1b1aa6[_0x905b('0x1a')]();if(_0x51f203[_0x905b('0x1b')][_0x3224d1]){delete _0x51f203['rules'][_0x3224d1];}_0x45bb5a[_0x905b('0x12')]();});_0x51f203['rules'][_0x3224d1]['on'](_0x905b('0x1c'),function(){if(_0x51f203['rules'][_0x3224d1]){delete _0x51f203[_0x905b('0x1b')][_0x3224d1];}});_0x46f611=setTimeout(function(){logger[_0x905b('0x8')](_0x905b('0x1d'),_0x3224d1);clearTimeout(_0x46f611);_0x1b1aa6[_0x905b('0x1a')]();_0x45bb5a[_0x905b('0x1e')]();},_0x1a86f0);strategy[_0x905b('0x1f')](_0x1b1aa6,_0x2623ec,_0x51f203,_0x4438d6);}else{logger[_0x905b('0xe')](_0x905b('0x20'),_0x3224d1,_0x2a494f['name']);_0x45bb5a['stop']();}}}catch(_0x32bd0c){console[_0x905b('0x21')](_0x32bd0c);logger[_0x905b('0xe')](_0x905b('0x22'),_0x3224d1,_0x32bd0c[_0x905b('0x23')]);_0x45bb5a[_0x905b('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index d3fffe2..b063847 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 _0x6b7b=['isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','toString','postText','message','amazonlex','providerName','providerResponse','Failed','lodash','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence'];(function(_0x352373,_0x17b5bb){var _0x5a9007=function(_0x474fae){while(--_0x474fae){_0x352373['push'](_0x352373['shift']());}};_0x5a9007(++_0x17b5bb);}(_0x6b7b,0xbd));var _0xb6b7=function(_0x2cabde,_0x455090){_0x2cabde=_0x2cabde-0x0;var _0x4ca924=_0x6b7b[_0x2cabde];return _0x4ca924;};'use strict';var _=require(_0xb6b7('0x0'));var moment=require('moment');var AWS=require(_0xb6b7('0x1'));var utils=require('./utils');var logger=require(_0xb6b7('0x2'))('routing');var rpc={'chatMessage':require(_0xb6b7('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb6b7('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb6b7('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xb6b7('0x6')]=function(_0x451699,_0x12b864){return function(_0x21a1c0){try{if(!_[_0xb6b7('0x7')](this[_0xb6b7('0x8')][_0xb6b7('0x9')])){logger[_0xb6b7('0xa')](_0xb6b7('0xb'),_0x451699,_0xb6b7('0xc'));return _0x21a1c0[_0xb6b7('0xd')]();}var _0x322dc3={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb6b7('0xe')](_0xb6b7('0xf')),'direction':_0xb6b7('0x10')};if(this[_0xb6b7('0x11')]===_0xb6b7('0x12')||this[_0xb6b7('0x11')]===_0xb6b7('0x13')){_0x322dc3['phone']=this[_0xb6b7('0x8')][_0xb6b7('0x14')];}var _0x1bff4c=this[_0xb6b7('0x11')];if(_0x1bff4c===_0xb6b7('0x15')){_0x322dc3[_0xb6b7('0x16')]=this[_0xb6b7('0x17')]['id'];}else{_0x322dc3[_[_0xb6b7('0x18')](_0x1bff4c)+_0xb6b7('0x19')]=this[_0xb6b7('0x17')]['id'];}_0x322dc3[_['upperFirst'](_0x1bff4c)+_0xb6b7('0x1a')]=this[_0xb6b7('0x8')]['id'];if(this[_0xb6b7('0x8')][_0xb6b7('0x1b')]){var _0x207bac=_0x12b864[0x4];if(!_[_0xb6b7('0x1c')](_0x207bac)){_0x322dc3[_0xb6b7('0x1d')]=utils[_0xb6b7('0x1e')](_0x207bac,this);return rpc[_0x1bff4c+_0xb6b7('0x1f')][_0xb6b7('0x20')](_0x322dc3)[_0xb6b7('0x21')](function(_0x5dfe1a){logger[_0xb6b7('0xa')](_0xb6b7('0xb'),_0x451699,_0x322dc3[_0xb6b7('0x1d')]);})[_0xb6b7('0x22')](function(_0x1c8846){logger[_0xb6b7('0x23')](_0xb6b7('0xb'),_0x451699,JSON[_0xb6b7('0x24')](_0x1c8846));})['finally'](function(){logger[_0xb6b7('0xa')](_0xb6b7('0x25'),_0x451699);_0x21a1c0['stop']();});}else{logger[_0xb6b7('0xa')](_0xb6b7('0x26'),_0x451699);_0x21a1c0[_0xb6b7('0x27')]();}}else{var _0x380c89=this;var _0x1cfcfc=new AWS[(_0xb6b7('0x28'))]({'accessKeyId':_0x12b864[0x0],'secretAccessKey':_0x12b864[0x1],'region':_0x12b864[0x2]});var _0x11234b={'botAlias':_0xb6b7('0x29'),'botName':_0x12b864[0x3],'inputText':this['message']['body'],'userId':this[_0xb6b7('0x11')]+':'+this[_0xb6b7('0x8')]['id'][_0xb6b7('0x2a')]()};_0x1cfcfc[_0xb6b7('0x2b')](_0x11234b,function(_0x4a5a1f,_0x14880c){if(_0x4a5a1f){logger[_0xb6b7('0x23')](_0xb6b7('0xb'),_0x451699,_0x4a5a1f['message']);_0x21a1c0[_0xb6b7('0xd')]();}else if(_0x14880c&&_0x14880c[_0xb6b7('0x2c')]){_0x380c89[_0xb6b7('0x1d')][_0xb6b7('0x2d')]=_0x14880c;_0x322dc3['body']=_0x14880c[_0xb6b7('0x2c')];_0x322dc3[_0xb6b7('0x2e')]=_0xb6b7('0x2d');_0x322dc3[_0xb6b7('0x2f')]=JSON[_0xb6b7('0x24')](_0x14880c);return rpc[_0x1bff4c+_0xb6b7('0x1f')][_0xb6b7('0x20')](_0x322dc3)[_0xb6b7('0x21')](function(_0x4191b2){logger[_0xb6b7('0xa')](_0xb6b7('0xb'),_0x451699,_0x322dc3['body']);if(_0x14880c['dialogState']==_0xb6b7('0x30')){_0x21a1c0['next']();}else{_0x21a1c0['stop']();}})[_0xb6b7('0x22')](function(_0x48377d){logger[_0xb6b7('0x23')](_0xb6b7('0xb'),_0x451699,JSON[_0xb6b7('0x24')](_0x48377d));_0x21a1c0[_0xb6b7('0xd')]();});}else{_0x21a1c0['next']();}});}}catch(_0x655dca){logger[_0xb6b7('0x23')](_0xb6b7('0xb'),_0x451699,JSON[_0xb6b7('0x24')](_0x655dca));_0x21a1c0['stop']();}};}; \ No newline at end of file +var _0x47d6=['then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','error','message','amazonlex','providerName','providerResponse','create','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','body','getMustacheRender','Message'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x47d6,0x190));var _0x647d=function(_0x1b915e,_0x367c64){_0x1b915e=_0x1b915e-0x0;var _0x2673ff=_0x47d6[_0x1b915e];return _0x2673ff;};'use strict';var _=require(_0x647d('0x0'));var moment=require(_0x647d('0x1'));var AWS=require(_0x647d('0x2'));var utils=require(_0x647d('0x3'));var logger=require('../../../../config/logger')(_0x647d('0x4'));var rpc={'chatMessage':require(_0x647d('0x5')),'openchannelMessage':require(_0x647d('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x647d('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x647d('0x8')]=function(_0x357e5d,_0x3d96bc){return function(_0x1ee928){try{if(!_[_0x647d('0x9')](this['interaction'][_0x647d('0xa')])){logger[_0x647d('0xb')](_0x647d('0xc'),_0x357e5d,_0x647d('0xd'));return _0x1ee928[_0x647d('0xe')]();}var _0x359fc7={'ContactId':this[_0x647d('0xf')]['id'],'sentAt':moment()[_0x647d('0x10')](_0x647d('0x11')),'direction':'out'};if(this['channel']===_0x647d('0x12')||this[_0x647d('0x13')]===_0x647d('0x14')){_0x359fc7[_0x647d('0x15')]=this[_0x647d('0x16')]['phone'];}var _0x4a65ce=this[_0x647d('0x13')];if(_0x4a65ce===_0x647d('0x17')){_0x359fc7[_0x647d('0x18')]=this[_0x647d('0x19')]['id'];}else{_0x359fc7[_[_0x647d('0x1a')](_0x4a65ce)+'AccountId']=this[_0x647d('0x19')]['id'];}_0x359fc7[_['upperFirst'](_0x4a65ce)+_0x647d('0x1b')]=this[_0x647d('0x16')]['id'];if(this['interaction'][_0x647d('0x1c')]){var _0x3bef84=_0x3d96bc[0x4];if(!_['isEmpty'](_0x3bef84)){_0x359fc7[_0x647d('0x1d')]=utils[_0x647d('0x1e')](_0x3bef84,this);return rpc[_0x4a65ce+_0x647d('0x1f')]['create'](_0x359fc7)[_0x647d('0x20')](function(_0x539a47){logger[_0x647d('0xb')](_0x647d('0xc'),_0x357e5d,_0x359fc7[_0x647d('0x1d')]);})[_0x647d('0x21')](function(_0x150fd5){logger['error']('[%s][AMAZONLEX]\x20%s',_0x357e5d,JSON[_0x647d('0x22')](_0x150fd5));})[_0x647d('0x23')](function(){logger['info'](_0x647d('0x24'),_0x357e5d);_0x1ee928[_0x647d('0x25')]();});}else{logger[_0x647d('0xb')](_0x647d('0x26'),_0x357e5d);_0x1ee928[_0x647d('0x25')]();}}else{var _0x76f19a=this;var _0x1c4a4b=new AWS[(_0x647d('0x27'))]({'accessKeyId':_0x3d96bc[0x0],'secretAccessKey':_0x3d96bc[0x1],'region':_0x3d96bc[0x2]});var _0x4d0e63={'botAlias':_0x647d('0x28'),'botName':_0x3d96bc[0x3],'inputText':this['message'][_0x647d('0x1d')],'userId':this[_0x647d('0x13')]+':'+this['interaction']['id']['toString']()};_0x1c4a4b['postText'](_0x4d0e63,function(_0x594619,_0x4db156){if(_0x594619){logger[_0x647d('0x29')]('[%s][AMAZONLEX]\x20%s',_0x357e5d,_0x594619[_0x647d('0x2a')]);_0x1ee928[_0x647d('0xe')]();}else if(_0x4db156&&_0x4db156[_0x647d('0x2a')]){_0x76f19a[_0x647d('0x1d')][_0x647d('0x2b')]=_0x4db156;_0x359fc7[_0x647d('0x1d')]=_0x4db156[_0x647d('0x2a')];_0x359fc7[_0x647d('0x2c')]=_0x647d('0x2b');_0x359fc7[_0x647d('0x2d')]=JSON[_0x647d('0x22')](_0x4db156);return rpc[_0x4a65ce+_0x647d('0x1f')][_0x647d('0x2e')](_0x359fc7)[_0x647d('0x20')](function(_0x500be0){logger[_0x647d('0xb')](_0x647d('0xc'),_0x357e5d,_0x359fc7[_0x647d('0x1d')]);if(_0x4db156['dialogState']==_0x647d('0x2f')){_0x1ee928[_0x647d('0xe')]();}else{_0x1ee928[_0x647d('0x25')]();}})[_0x647d('0x21')](function(_0x273e65){logger['error'](_0x647d('0xc'),_0x357e5d,JSON[_0x647d('0x22')](_0x273e65));_0x1ee928[_0x647d('0xe')]();});}else{_0x1ee928[_0x647d('0xe')]();}});}}catch(_0x3897b7){logger['error']('[%s][AMAZONLEX]\x20%s',_0x357e5d,JSON[_0x647d('0x22')](_0x3897b7));_0x1ee928[_0x647d('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 911413e..6cb573a 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 _0x12a9=['../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','body','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','InteractionId','inReplyTo','messageId','','replace','','headers','auto-replied','All','sendMailMessage','smtpOptions','then','Message','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12a9,0xcc));var _0x912a=function(_0x3da971,_0x597854){_0x3da971=_0x3da971-0x0;var _0x59c2a1=_0x12a9[_0x3da971];return _0x59c2a1;};'use strict';var _=require(_0x912a('0x0'));var moment=require('moment');var utils=require(_0x912a('0x1'));var logger=require(_0x912a('0x2'))(_0x912a('0x3'));var rpc={'chatMessage':require(_0x912a('0x4')),'openchannelMessage':require(_0x912a('0x5')),'mailMessage':require(_0x912a('0x6')),'smsMessage':require(_0x912a('0x7')),'faxMessage':require(_0x912a('0x8')),'whatsappMessage':require(_0x912a('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x912a('0xa')),'mailInteraction':require(_0x912a('0xb')),'smsInteraction':require(_0x912a('0xc')),'faxInteraction':require(_0x912a('0xd')),'whatsappInteraction':require(_0x912a('0xe'))};var mailRpc=require('../../mailRpc');exports[_0x912a('0xf')]=function(_0x3fc502,_0x10e9e3,_0x58254c,_0xc40063){return function(_0x1d52f4){try{var _0x210740=this[_0x912a('0x10')];if(_0x210740===_0x912a('0x11')&&_0xc40063['body'][_0x912a('0x12')]){logger[_0x912a('0x13')](_0x912a('0x14'),_0x3fc502,_0x912a('0x15'));return _0x1d52f4[_0x912a('0x16')]();}if(_0x10e9e3[0x0]==='1'&&(_[_0x912a('0x17')](this[_0x912a('0x18')]['created'])||!this[_0x912a('0x18')][_0x912a('0x19')])){logger[_0x912a('0x13')](_0x912a('0x14'),_0x3fc502,_0x912a('0x1a'));return _0x1d52f4[_0x912a('0x16')]();}if(_0x10e9e3[0x0]==='2'&&this['interaction'][_0x912a('0x1b')]){logger[_0x912a('0x13')](_0x912a('0x1c'),_0x3fc502,_0x912a('0x1d'));return _0x1d52f4[_0x912a('0x16')]();}var _0x27c9d0={'ContactId':this[_0x912a('0x1e')]['id'],'sentAt':moment()[_0x912a('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x912a('0x20')};if(this[_0x912a('0x10')]===_0x912a('0x11')){_0x27c9d0['body']=utils[_0x912a('0x21')](_0x10e9e3[0x2],this);}else{_0x27c9d0[_0x912a('0x22')]=utils[_0x912a('0x21')](_0x10e9e3[0x1],this);}if(this[_0x912a('0x23')]){_0x27c9d0['to']=this['message'][_0x912a('0x24')]||'';if(this['channel']===_0x912a('0x11')&&_0x10e9e3[0x1]==='1'){_0x27c9d0['cc']=this[_0x912a('0x23')]['cc']||'';}_0x27c9d0[_0x912a('0x24')]=this['message']['to']||'';_0x27c9d0[_0x912a('0x25')]=this[_0x912a('0x23')][_0x912a('0x25')]||'';_0x27c9d0[_0x912a('0x26')]=!![];if(this[_0x912a('0x23')][_0x912a('0x27')]){_0x27c9d0[_0x912a('0x27')]='';_0x27c9d0['subject']+=_[_0x912a('0x28')](this[_0x912a('0x23')][_0x912a('0x27')],_0x912a('0x29'))?'':_0x912a('0x2a');_0x27c9d0[_0x912a('0x27')]+=this[_0x912a('0x23')][_0x912a('0x27')];}}if(this[_0x912a('0x10')]===_0x912a('0x2b')){_0x27c9d0[_0x912a('0x2c')]=this[_0x912a('0x2d')]['id'];}else{_0x27c9d0[_[_0x912a('0x2e')](this['channel'])+'AccountId']=this[_0x912a('0x2d')]['id'];}_0x27c9d0[_['upperFirst'](this['channel'])+_0x912a('0x2f')]=this[_0x912a('0x18')]['id'];var _0x5d4b93=this[_0x912a('0x18')];if(rpc[this[_0x912a('0x10')]+'Message']){if(this['channel']===_0x912a('0x11')){_0x27c9d0[_0x912a('0x30')]=this[_0x912a('0x23')][_0x912a('0x31')];_0x27c9d0['html']=_0x912a('0x32')+_[_0x912a('0x33')](_0x27c9d0[_0x912a('0x22')],'','replace','','headers','All','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','inReplyTo','messageId'];(function(_0x4123ec,_0x47061c){var _0x1931e1=function(_0x5067f9){while(--_0x5067f9){_0x4123ec['push'](_0x4123ec['shift']());}};_0x1931e1(++_0x47061c);}(_0xd492,0xe4));var _0x2d49=function(_0xbb85d9,_0x2ae27b){_0xbb85d9=_0xbb85d9-0x0;var _0x1676c7=_0xd492[_0xbb85d9];return _0x1676c7;};'use strict';var _=require(_0x2d49('0x0'));var moment=require(_0x2d49('0x1'));var utils=require(_0x2d49('0x2'));var logger=require(_0x2d49('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2d49('0x4')),'mailMessage':require(_0x2d49('0x5')),'smsMessage':require(_0x2d49('0x6')),'faxMessage':require(_0x2d49('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x2d49('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2d49('0x9')),'smsInteraction':require(_0x2d49('0xa')),'faxInteraction':require(_0x2d49('0xb')),'whatsappInteraction':require(_0x2d49('0xc'))};var mailRpc=require(_0x2d49('0xd'));exports['consequence']=function(_0x339ba8,_0x3df680,_0x40f571,_0x88dca1){return function(_0x17886c){try{var _0x189735=this[_0x2d49('0xe')];if(_0x189735===_0x2d49('0xf')&&_0x88dca1[_0x2d49('0x10')][_0x2d49('0x11')]){logger['info']('[%s][AUTOREPLY]\x20%s',_0x339ba8,_0x2d49('0x12'));return _0x17886c[_0x2d49('0x13')]();}if(_0x3df680[0x0]==='1'&&(_[_0x2d49('0x14')](this['interaction']['created'])||!this[_0x2d49('0x15')][_0x2d49('0x16')])){logger[_0x2d49('0x17')](_0x2d49('0x18'),_0x339ba8,_0x2d49('0x19'));return _0x17886c[_0x2d49('0x13')]();}if(_0x3df680[0x0]==='2'&&this[_0x2d49('0x15')]['autoreplyExecuted']){logger[_0x2d49('0x17')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x339ba8,_0x2d49('0x1a'));return _0x17886c[_0x2d49('0x13')]();}var _0x194333={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2d49('0x1b')](_0x2d49('0x1c')),'direction':_0x2d49('0x1d')};if(this['channel']===_0x2d49('0xf')){_0x194333[_0x2d49('0x10')]=utils[_0x2d49('0x1e')](_0x3df680[0x2],this);}else{_0x194333[_0x2d49('0x10')]=utils[_0x2d49('0x1e')](_0x3df680[0x1],this);}if(this[_0x2d49('0x1f')]){_0x194333['to']=this[_0x2d49('0x1f')]['from']||'';if(this[_0x2d49('0xe')]==='mail'&&_0x3df680[0x1]==='1'){_0x194333['cc']=this['message']['cc']||'';}_0x194333[_0x2d49('0x20')]=this[_0x2d49('0x1f')]['to']||'';_0x194333[_0x2d49('0x21')]=this[_0x2d49('0x1f')][_0x2d49('0x21')]||'';_0x194333['read']=!![];if(this['message'][_0x2d49('0x22')]){_0x194333[_0x2d49('0x22')]='';_0x194333[_0x2d49('0x22')]+=_[_0x2d49('0x23')](this[_0x2d49('0x1f')][_0x2d49('0x22')],'Re:')?'':'Re:\x20';_0x194333[_0x2d49('0x22')]+=this[_0x2d49('0x1f')][_0x2d49('0x22')];}}if(this[_0x2d49('0xe')]===_0x2d49('0x24')){_0x194333[_0x2d49('0x25')]=this[_0x2d49('0x26')]['id'];}else{_0x194333[_[_0x2d49('0x27')](this[_0x2d49('0xe')])+_0x2d49('0x28')]=this[_0x2d49('0x26')]['id'];}_0x194333[_[_0x2d49('0x27')](this[_0x2d49('0xe')])+_0x2d49('0x29')]=this['interaction']['id'];var _0x5c8997=this[_0x2d49('0x15')];if(rpc[this['channel']+'Message']){if(this[_0x2d49('0xe')]===_0x2d49('0xf')){_0x194333[_0x2d49('0x2a')]=this[_0x2d49('0x1f')][_0x2d49('0x2b')];_0x194333[_0x2d49('0x2c')]=_0x2d49('0x2d')+_[_0x2d49('0x2e')](_0x194333['body'],_0x2d49('0x2f'),_0x2d49('0x30'))+_0x2d49('0x31');_0x194333[_0x2d49('0x32')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x2d49('0x33'),'Precedence':_0x2d49('0x34')};return mailRpc['sendMailMessage'](this[_0x2d49('0x26')]['smtpOptions'],_0x194333)[_0x2d49('0x35')](function(_0x30f962){logger[_0x2d49('0x17')](_0x2d49('0x36'),_0x339ba8);_0x194333[_0x2d49('0x2b')]=_0x30f962[_0x2d49('0x1f')][_0x2d49('0x2b')];return rpc[_0x189735+_0x2d49('0x37')]['create'](_0x194333);})['then'](function(_0x16d4ff){logger[_0x2d49('0x17')](_0x2d49('0x18'),_0x339ba8,JSON[_0x2d49('0x38')](_0x16d4ff));})['catch'](function(_0x1d6c33){logger[_0x2d49('0x39')](_0x2d49('0x3a'),_0x339ba8,JSON[_0x2d49('0x38')](_0x1d6c33));})[_0x2d49('0x3b')](function(){Promise[_0x2d49('0x3c')]()[_0x2d49('0x35')](function(){if(_0x3df680[0x0]!=='2'||_0x5c8997[_0x2d49('0x3d')])return;return rpc[_0x189735+_0x2d49('0x3e')][_0x2d49('0x3f')](_0x5c8997['id'],{'autoreplyExecuted':!![]})[_0x2d49('0x35')](function(_0x2d7189){logger[_0x2d49('0x17')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x339ba8,JSON[_0x2d49('0x38')](_0x2d7189));})[_0x2d49('0x40')](function(_0x305219){logger[_0x2d49('0x39')](_0x2d49('0x41'),_0x339ba8,JSON[_0x2d49('0x38')](_0x305219));});})['then'](function(){_0x17886c[_0x2d49('0x13')]();});});}else{return rpc[this[_0x2d49('0xe')]+_0x2d49('0x37')][_0x2d49('0x42')](_0x194333)[_0x2d49('0x35')](function(){logger['info'](_0x2d49('0x18'),_0x339ba8,_0x194333[_0x2d49('0x10')]);})[_0x2d49('0x40')](function(_0x530856){logger[_0x2d49('0x39')](_0x2d49('0x18'),_0x339ba8,JSON['stringify'](_0x530856));})['finally'](function(){Promise[_0x2d49('0x3c')]()[_0x2d49('0x35')](function(){if(_0x3df680[0x0]!=='2'||_0x5c8997['autoreplyExecuted'])return;return rpc[_0x189735+_0x2d49('0x3e')][_0x2d49('0x3f')](_0x5c8997['id'],{'autoreplyExecuted':!![]})['then'](function(_0x2a45c6){logger[_0x2d49('0x17')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x339ba8,JSON[_0x2d49('0x38')](_0x2a45c6));})[_0x2d49('0x40')](function(_0x38365e){logger['error'](_0x2d49('0x41'),_0x339ba8,JSON[_0x2d49('0x38')](_0x38365e));});})['then'](function(){_0x17886c[_0x2d49('0x13')]();});});}}}catch(_0x1b9446){logger[_0x2d49('0x39')](_0x2d49('0x18'),_0x339ba8,JSON[_0x2d49('0x38')](_0x1b9446));_0x17886c[_0x2d49('0x43')]();}};}; \ 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 07e0702..4ae0908 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 _0xb8b1=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','finally','stop','[%s][CLOSE]\x20%s','stringify','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x5ca30d,_0x920653){var _0x183310=function(_0x563335){while(--_0x563335){_0x5ca30d['push'](_0x5ca30d['shift']());}};_0x183310(++_0x920653);}(_0xb8b1,0x1de));var _0x1b8b=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xb8b1[_0x5f5cce];return _0x705ecf;};'use strict';var moment=require('moment');var logger=require(_0x1b8b('0x0'))(_0x1b8b('0x1'));var rpc={'chatInteraction':require(_0x1b8b('0x2')),'openchannelInteraction':require(_0x1b8b('0x3')),'smsInteraction':require(_0x1b8b('0x4')),'mailInteraction':require(_0x1b8b('0x5')),'faxInteraction':require(_0x1b8b('0x6')),'whatsappInteraction':require(_0x1b8b('0x7'))};exports['consequence']=function(_0x469aae,_0x1cd420,_0x4b3dc8,_0x4139b8){return function(_0x15b44e){try{logger[_0x1b8b('0x8')](_0x1b8b('0x9'),_0x469aae,_0x1cd420[0x0]);var _0x1dc49b={'closed':0x1,'closedAt':moment()['format'](_0x1b8b('0xa')),'closeReason':_0x1b8b('0xb'),'disposition':_0x1cd420[0x0]};if(rpc[_0x4139b8[_0x1b8b('0xc')]+_0x1b8b('0xd')]){rpc[_0x4139b8[_0x1b8b('0xc')]+'Interaction']['update'](_0x4139b8[_0x1b8b('0xe')]['id'],_0x1dc49b)[_0x1b8b('0xf')](function(_0x591533){logger[_0x1b8b('0x8')](_0x1b8b('0x10'),_0x469aae,_0x4139b8[_0x1b8b('0xe')]['id']);})[_0x1b8b('0x11')](function(_0x2fa378){logger[_0x1b8b('0x12')]('[%s][CLOSE]\x20%s',_0x469aae,JSON['stringify'](_0x2fa378));})[_0x1b8b('0x13')](function(){_0x15b44e[_0x1b8b('0x14')]();});}}catch(_0x39ec18){logger[_0x1b8b('0x12')](_0x1b8b('0x15'),_0x469aae,JSON[_0x1b8b('0x16')](_0x39ec18));_0x15b44e[_0x1b8b('0x14')]();}};}; \ No newline at end of file +var _0x217f=['then','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update'];(function(_0x23dc4c,_0x188a42){var _0xb5377d=function(_0x31bebc){while(--_0x31bebc){_0x23dc4c['push'](_0x23dc4c['shift']());}};_0xb5377d(++_0x188a42);}(_0x217f,0xd6));var _0xf217=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x217f[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xf217('0x0'));var logger=require(_0xf217('0x1'))(_0xf217('0x2'));var rpc={'chatInteraction':require(_0xf217('0x3')),'openchannelInteraction':require(_0xf217('0x4')),'smsInteraction':require(_0xf217('0x5')),'mailInteraction':require(_0xf217('0x6')),'faxInteraction':require(_0xf217('0x7')),'whatsappInteraction':require(_0xf217('0x8'))};exports[_0xf217('0x9')]=function(_0xb5e42b,_0x1d21ea,_0x1f6cbf,_0x5768a4){return function(_0x31372e){try{logger[_0xf217('0xa')](_0xf217('0xb'),_0xb5e42b,_0x1d21ea[0x0]);var _0x57b404={'closed':0x1,'closedAt':moment()['format'](_0xf217('0xc')),'closeReason':'system','disposition':_0x1d21ea[0x0]};if(rpc[_0x5768a4[_0xf217('0xd')]+_0xf217('0xe')]){rpc[_0x5768a4[_0xf217('0xd')]+'Interaction'][_0xf217('0xf')](_0x5768a4['interaction']['id'],_0x57b404)[_0xf217('0x10')](function(_0x4847dc){logger[_0xf217('0xa')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xb5e42b,_0x5768a4[_0xf217('0x11')]['id']);})[_0xf217('0x12')](function(_0x293468){logger[_0xf217('0x13')](_0xf217('0x14'),_0xb5e42b,JSON[_0xf217('0x15')](_0x293468));})['finally'](function(){_0x31372e['stop']();});}}catch(_0x46f2bf){logger['error'](_0xf217('0x14'),_0xb5e42b,JSON[_0xf217('0x15')](_0x46f2bf));_0x31372e[_0xf217('0x16')]();}};}; \ 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 c0501c9..607546b 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 _0xc9b0=['stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x47fdfb,_0x273baf){var _0x38f3ee=function(_0x4cb309){while(--_0x4cb309){_0x47fdfb['push'](_0x47fdfb['shift']());}};_0x38f3ee(++_0x273baf);}(_0xc9b0,0x143));var _0x0c9b=function(_0x2768fb,_0x172dfc){_0x2768fb=_0x2768fb-0x0;var _0x4d6a43=_0xc9b0[_0x2768fb];return _0x4d6a43;};'use strict';var _=require(_0x0c9b('0x0'));var moment=require(_0x0c9b('0x1'));var apiai=require(_0x0c9b('0x2'));var md5=require(_0x0c9b('0x3'));var utils=require(_0x0c9b('0x4'));var logger=require(_0x0c9b('0x5'))(_0x0c9b('0x6'));var rpc={'chatMessage':require(_0x0c9b('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0c9b('0x8')),'faxMessage':require(_0x0c9b('0x9')),'whatsappMessage':require(_0x0c9b('0xa'))};exports[_0x0c9b('0xb')]=function(_0x1bd53c,_0x16779e){return function(_0x363958){try{if(!_[_0x0c9b('0xc')](this[_0x0c9b('0xd')]['UserId'])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x1bd53c,_0x0c9b('0xe'));return _0x363958[_0x0c9b('0xf')]();}var _0x1b6d84={'ContactId':this[_0x0c9b('0x10')]['id'],'sentAt':moment()[_0x0c9b('0x11')](_0x0c9b('0x12')),'direction':'out'};if(this[_0x0c9b('0x13')]===_0x0c9b('0x14')||this['channel']===_0x0c9b('0x15')){_0x1b6d84['phone']=this[_0x0c9b('0xd')][_0x0c9b('0x16')];}var _0x2d97b8=this[_0x0c9b('0x13')];if(_0x2d97b8===_0x0c9b('0x17')){_0x1b6d84[_0x0c9b('0x18')]=this[_0x0c9b('0x19')]['id'];}else{_0x1b6d84[_[_0x0c9b('0x1a')](_0x2d97b8)+_0x0c9b('0x1b')]=this[_0x0c9b('0x19')]['id'];}_0x1b6d84[_['upperFirst'](_0x2d97b8)+'InteractionId']=this['interaction']['id'];if(this[_0x0c9b('0xd')][_0x0c9b('0x1c')]){var _0x58f574=_0x16779e[0x2];if(!_[_0x0c9b('0x1d')](_0x58f574)){_0x1b6d84[_0x0c9b('0x1e')]=utils[_0x0c9b('0x1f')](_0x58f574,this);return rpc[_0x2d97b8+_0x0c9b('0x20')][_0x0c9b('0x21')](_0x1b6d84)[_0x0c9b('0x22')](function(_0x39218d){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x1bd53c,_0x1b6d84[_0x0c9b('0x1e')]);})['catch'](function(_0x13e1d7){logger[_0x0c9b('0x23')](_0x0c9b('0x24'),_0x1bd53c,JSON[_0x0c9b('0x25')](_0x13e1d7));})[_0x0c9b('0x26')](function(){logger[_0x0c9b('0x27')](_0x0c9b('0x28'),_0x1bd53c);_0x363958[_0x0c9b('0x29')]();});}else{logger[_0x0c9b('0x27')](_0x0c9b('0x2a'),_0x1bd53c);_0x363958['stop']();}}else{var _0x19f6e2=this;var _0x3dfd64=apiai(_0x16779e[0x0],{'language':_0x16779e[0x1]||'en'});return _0x3dfd64[_0x0c9b('0x2b')](this['message'][_0x0c9b('0x1e')],{'sessionId':md5(this[_0x0c9b('0xd')]['id'])})[_0x0c9b('0x22')](function(_0x5c83c8){_0x19f6e2[_0x0c9b('0x1e')]['dialogflow']=_0x5c83c8;_0x1b6d84[_0x0c9b('0x1e')]=_0x5c83c8[_0x0c9b('0x2c')][_0x0c9b('0x2d')][_0x0c9b('0x2e')];_0x1b6d84[_0x0c9b('0x2f')]=_0x0c9b('0x30');_0x1b6d84[_0x0c9b('0x31')]=JSON[_0x0c9b('0x25')](_0x5c83c8);return rpc[_0x2d97b8+_0x0c9b('0x20')][_0x0c9b('0x21')](_0x1b6d84)[_0x0c9b('0x22')](function(_0x56dc5f){logger['info'](_0x0c9b('0x24'),_0x1bd53c,_0x1b6d84[_0x0c9b('0x1e')]);if(_0x5c83c8[_0x0c9b('0x2c')][_0x0c9b('0x32')]['endConversation']){_0x363958[_0x0c9b('0xf')]();}else{_0x363958[_0x0c9b('0x29')]();}})['catch'](function(_0x709be7){logger[_0x0c9b('0x23')](_0x0c9b('0x24'),_0x1bd53c,JSON[_0x0c9b('0x25')](_0x709be7));_0x363958[_0x0c9b('0xf')]();});})[_0x0c9b('0x33')](function(_0x523fad){logger[_0x0c9b('0x23')](_0x0c9b('0x24'),_0x1bd53c,_0x523fad['message']);_0x363958[_0x0c9b('0xf')]();});}}catch(_0x1cd43a){logger[_0x0c9b('0x23')](_0x0c9b('0x24'),_0x1bd53c,JSON[_0x0c9b('0x25')](_0x1cd43a));_0x363958[_0x0c9b('0x29')]();}};}; \ No newline at end of file +var _0xd2f5=['interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','getMustacheRender','Message','create','[%s][DIALOGFLOW]\x20%s','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','then','dialogflow','fulfillment','speech','providerName','providerResponse','stringify','result','endConversation','lodash','apiai-promise','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xd2f5,0x144));var _0x5d2f=function(_0xef233b,_0xe5f011){_0xef233b=_0xef233b-0x0;var _0x451b24=_0xd2f5[_0xef233b];return _0x451b24;};'use strict';var _=require(_0x5d2f('0x0'));var moment=require('moment');var apiai=require(_0x5d2f('0x1'));var md5=require('md5');var utils=require(_0x5d2f('0x2'));var logger=require('../../../../config/logger')(_0x5d2f('0x3'));var rpc={'chatMessage':require(_0x5d2f('0x4')),'openchannelMessage':require(_0x5d2f('0x5')),'mailMessage':require(_0x5d2f('0x6')),'smsMessage':require(_0x5d2f('0x7')),'faxMessage':require(_0x5d2f('0x8')),'whatsappMessage':require(_0x5d2f('0x9'))};exports[_0x5d2f('0xa')]=function(_0x4b2540,_0x443779){return function(_0x908c6){try{if(!_[_0x5d2f('0xb')](this[_0x5d2f('0xc')][_0x5d2f('0xd')])){logger[_0x5d2f('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x4b2540,_0x5d2f('0xf'));return _0x908c6[_0x5d2f('0x10')]();}var _0x4e24af={'ContactId':this[_0x5d2f('0x11')]['id'],'sentAt':moment()[_0x5d2f('0x12')](_0x5d2f('0x13')),'direction':'out'};if(this[_0x5d2f('0x14')]===_0x5d2f('0x15')||this[_0x5d2f('0x14')]==='whatsapp'){_0x4e24af['phone']=this[_0x5d2f('0xc')]['phone'];}var _0x293e95=this[_0x5d2f('0x14')];if(_0x293e95==='chat'){_0x4e24af[_0x5d2f('0x16')]=this['account']['id'];}else{_0x4e24af[_[_0x5d2f('0x17')](_0x293e95)+_0x5d2f('0x18')]=this[_0x5d2f('0x19')]['id'];}_0x4e24af[_['upperFirst'](_0x293e95)+_0x5d2f('0x1a')]=this[_0x5d2f('0xc')]['id'];if(this[_0x5d2f('0xc')][_0x5d2f('0x1b')]){var _0x1536ee=_0x443779[0x2];if(!_['isEmpty'](_0x1536ee)){_0x4e24af[_0x5d2f('0x1c')]=utils[_0x5d2f('0x1d')](_0x1536ee,this);return rpc[_0x293e95+_0x5d2f('0x1e')][_0x5d2f('0x1f')](_0x4e24af)['then'](function(_0x27e16d){logger[_0x5d2f('0xe')](_0x5d2f('0x20'),_0x4b2540,_0x4e24af[_0x5d2f('0x1c')]);})[_0x5d2f('0x21')](function(_0x32ec09){logger[_0x5d2f('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x4b2540,JSON['stringify'](_0x32ec09));})['finally'](function(){logger[_0x5d2f('0xe')](_0x5d2f('0x23'),_0x4b2540);_0x908c6[_0x5d2f('0x24')]();});}else{logger[_0x5d2f('0xe')](_0x5d2f('0x25'),_0x4b2540);_0x908c6['stop']();}}else{var _0x5cc8d6=this;var _0x368693=apiai(_0x443779[0x0],{'language':_0x443779[0x1]||'en'});return _0x368693['textRequest'](this[_0x5d2f('0x26')][_0x5d2f('0x1c')],{'sessionId':md5(this[_0x5d2f('0xc')]['id'])})[_0x5d2f('0x27')](function(_0x6d4ad2){_0x5cc8d6[_0x5d2f('0x1c')][_0x5d2f('0x28')]=_0x6d4ad2;_0x4e24af[_0x5d2f('0x1c')]=_0x6d4ad2['result'][_0x5d2f('0x29')][_0x5d2f('0x2a')];_0x4e24af[_0x5d2f('0x2b')]=_0x5d2f('0x28');_0x4e24af[_0x5d2f('0x2c')]=JSON[_0x5d2f('0x2d')](_0x6d4ad2);return rpc[_0x293e95+_0x5d2f('0x1e')][_0x5d2f('0x1f')](_0x4e24af)['then'](function(_0x10351a){logger[_0x5d2f('0xe')](_0x5d2f('0x20'),_0x4b2540,_0x4e24af[_0x5d2f('0x1c')]);if(_0x6d4ad2[_0x5d2f('0x2e')]['metadata'][_0x5d2f('0x2f')]){_0x908c6[_0x5d2f('0x10')]();}else{_0x908c6[_0x5d2f('0x24')]();}})[_0x5d2f('0x21')](function(_0x536f1d){logger[_0x5d2f('0x22')](_0x5d2f('0x20'),_0x4b2540,JSON['stringify'](_0x536f1d));_0x908c6[_0x5d2f('0x10')]();});})[_0x5d2f('0x21')](function(_0x26e988){logger['error'](_0x5d2f('0x20'),_0x4b2540,_0x26e988[_0x5d2f('0x26')]);_0x908c6[_0x5d2f('0x10')]();});}}catch(_0x4b30e4){logger[_0x5d2f('0x22')](_0x5d2f('0x20'),_0x4b2540,JSON['stringify'](_0x4b30e4));_0x908c6[_0x5d2f('0x24')]();}};}; \ 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 3cd5915..79d4bbd 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 _0x1175=['phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','then','catch','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','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','end_conversation','DIALOGFLOWV2_INTENTNAME','name','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x525a77,_0x5a0af8){var _0x208b43=function(_0x3d662b){while(--_0x3d662b){_0x525a77['push'](_0x525a77['shift']());}};_0x208b43(++_0x5a0af8);}(_0x1175,0x139));var _0x5117=function(_0x35fc46,_0x1a7efd){_0x35fc46=_0x35fc46-0x0;var _0x12aab9=_0x1175[_0x35fc46];return _0x12aab9;};'use strict';var _=require('lodash');var dialogflow=require(_0x5117('0x0'));var md5=require(_0x5117('0x1'));var moment=require(_0x5117('0x2'));var Promise=require(_0x5117('0x3'));var logger=require('../../../../config/logger')(_0x5117('0x4'));var utils=require(_0x5117('0x5'));var rpc={'chatMessage':require(_0x5117('0x6')),'openchannelMessage':require(_0x5117('0x7')),'mailMessage':require(_0x5117('0x8')),'smsMessage':require(_0x5117('0x9')),'faxMessage':require(_0x5117('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x233e37,_0x5a12c0,_0x25efb5,_0x2b65c0){return new Promise(function(_0x252b2a,_0x343db4){var _0x4cf83e=_[_0x5117('0xb')](_0x25efb5);_0x4cf83e[_0x5117('0xc')]=_0x2b65c0;return rpc[_0x5a12c0+_0x5117('0xd')]['create'](_0x4cf83e)['then'](function(){logger[_0x5117('0xe')](_0x5117('0xf'),_0x233e37,_0x4cf83e[_0x5117('0xc')]);_0x252b2a();})['catch'](function(_0x32ccca){logger[_0x5117('0x10')](_0x5117('0xf'),_0x233e37,JSON[_0x5117('0x11')](_0x32ccca));_0x343db4(_0x32ccca);});});}exports[_0x5117('0x12')]=function(_0x4987ed,_0x3a1924){return function(_0x12dfaf){try{if(!_['isNil'](this[_0x5117('0x13')][_0x5117('0x14')])){logger[_0x5117('0xe')](_0x5117('0xf'),_0x4987ed,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x12dfaf[_0x5117('0x15')]();}var _0x4c2b97={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5117('0x16')](_0x5117('0x17')),'direction':_0x5117('0x18')};if(this[_0x5117('0x19')]===_0x5117('0x1a')||this[_0x5117('0x19')]==='whatsapp'){_0x4c2b97[_0x5117('0x1b')]=this[_0x5117('0x13')]['phone'];}var _0xf34ef2=this[_0x5117('0x19')];if(_0xf34ef2===_0x5117('0x1c')){_0x4c2b97[_0x5117('0x1d')]=this[_0x5117('0x1e')]['id'];}else{_0x4c2b97[_[_0x5117('0x1f')](_0xf34ef2)+_0x5117('0x20')]=this[_0x5117('0x1e')]['id'];}_0x4c2b97[_[_0x5117('0x1f')](_0xf34ef2)+_0x5117('0x21')]=this[_0x5117('0x13')]['id'];if(this[_0x5117('0x13')][_0x5117('0x22')]){var _0x2d01c7=_0x3a1924[0x4];if(!_['isEmpty'](_0x2d01c7)){_0x4c2b97[_0x5117('0xc')]=utils[_0x5117('0x23')](_0x2d01c7,this);return rpc[_0xf34ef2+'Message']['create'](_0x4c2b97)[_0x5117('0x24')](function(_0x4e546b){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x4987ed,_0x4c2b97['body']);})[_0x5117('0x25')](function(_0x116f26){logger[_0x5117('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x4987ed,JSON[_0x5117('0x11')](_0x116f26));})[_0x5117('0x26')](function(){logger[_0x5117('0xe')](_0x5117('0x27'),_0x4987ed);_0x12dfaf[_0x5117('0x28')]();});}else{logger[_0x5117('0xe')](_0x5117('0x29'),_0x4987ed);_0x12dfaf[_0x5117('0x28')]();}}else{var _0x493468=this;var _0x3402db=_0x3a1924[0x2][_0x5117('0x2a')](/\\n/g,'\x0a');var _0x597b9a={'credentials':{'private_key':_0x3402db,'client_email':_0x3a1924[0x1]}};var _0x2b8795=new dialogflow[(_0x5117('0x2b'))](_0x597b9a);var _0x577889=_0x2b8795[_0x5117('0x2c')](_0x3a1924[0x0],md5(_0x493468['interaction']['id']));var _0x3c6e9e={'session':_0x577889,'queryInput':{'text':{'text':_0x493468[_0x5117('0x2d')]['body'],'languageCode':_0x3a1924[0x3]||'en'}}};return _0x2b8795[_0x5117('0x2e')](_0x3c6e9e)['then'](function(_0x3505cc){if(_0x3505cc&&_0x3505cc['length']){_0x493468[_0x5117('0xc')][_0x5117('0x2f')]=_0x3505cc;var _0x2b616f=_0x3505cc[0x0];var _0x11fda3=_0x2b616f[_0x5117('0x30')][_0x5117('0x31')]&&_0x2b616f[_0x5117('0x30')]['diagnosticInfo'][_0x5117('0x32')]?_0x2b616f['queryResult'][_0x5117('0x31')][_0x5117('0x32')]['end_conversation'][_0x5117('0x33')]:![];_0x493468[_0x5117('0xc')][_0x5117('0x34')]=_0x2b616f['queryResult']['action'];_0x493468[_0x5117('0xc')][_0x5117('0x35')]=_0x2b616f[_0x5117('0x30')]['allRequiredParamsPresent'];_0x493468[_0x5117('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x2b616f[_0x5117('0x30')][_0x5117('0x31')]&&_0x2b616f[_0x5117('0x30')][_0x5117('0x31')]['fields']?_0x2b616f[_0x5117('0x30')][_0x5117('0x31')][_0x5117('0x32')][_0x5117('0x36')]['boolValue']:![];_0x493468[_0x5117('0xc')][_0x5117('0x37')]=_0x2b616f[_0x5117('0x30')]['intent'][_0x5117('0x38')];_0x493468[_0x5117('0xc')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x2b616f['queryResult'][_0x5117('0x39')][_0x5117('0x3a')];_0x493468[_0x5117('0xc')][_0x5117('0x3b')]=_0x2b616f[_0x5117('0x30')]['intent'][_0x5117('0x3c')];_0x493468[_0x5117('0xc')]['DIALOGFLOWV2_LANGUAGECODE']=_0x2b616f[_0x5117('0x30')]['languageCode'];_0x493468['body'][_0x5117('0x3d')]=_0x2b616f[_0x5117('0x30')]['queryText'];_0x493468[_0x5117('0xc')][_0x5117('0x3e')]=_0x2b616f['queryResult'][_0x5117('0x3f')];_0x4c2b97[_0x5117('0x40')]='dialogflowV2';_0x4c2b97[_0x5117('0x41')]=JSON[_0x5117('0x11')](_0x3505cc);var _0x23fabc=[];for(var _0x571d6b=0x0;_0x571d6b<_0x3505cc['length'];_0x571d6b++){var _0x2b0c9a=_0x3505cc[_0x571d6b];if(_0x2b0c9a&&_0x2b0c9a[_0x5117('0x30')]&&_0x2b0c9a[_0x5117('0x30')]['fulfillmentText']){_0x23fabc['push'](createMessage(_0x4987ed,_0xf34ef2,_0x4c2b97,_0x2b0c9a[_0x5117('0x30')][_0x5117('0x42')]));}}return Promise[_0x5117('0x43')](_0x23fabc)['then'](function(){if(_0x11fda3){_0x12dfaf['next']();}else{_0x12dfaf[_0x5117('0x28')]();}})['catch'](function(_0xfa6353){logger[_0x5117('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x4987ed,JSON[_0x5117('0x11')](_0xfa6353));_0x12dfaf[_0x5117('0x15')]();});}})['catch'](function(_0x3095d5){logger['error'](_0x5117('0xf'),_0x4987ed,_0x3095d5[_0x5117('0x2d')]);_0x12dfaf[_0x5117('0x15')]();});}}catch(_0x4ecf40){logger[_0x5117('0x10')](_0x5117('0xf'),_0x4987ed,JSON[_0x5117('0x11')](_0x4ecf40));_0x12dfaf[_0x5117('0x28')]();}};}; \ No newline at end of file +var _0xccaf=['DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','next','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','created','getMustacheRender','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','name','displayName'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xccaf,0x139));var _0xfcca=function(_0x42184d,_0x264f92){_0x42184d=_0x42184d-0x0;var _0x144722=_0xccaf[_0x42184d];return _0x144722;};'use strict';var _=require(_0xfcca('0x0'));var dialogflow=require(_0xfcca('0x1'));var md5=require(_0xfcca('0x2'));var moment=require(_0xfcca('0x3'));var Promise=require(_0xfcca('0x4'));var logger=require(_0xfcca('0x5'))(_0xfcca('0x6'));var utils=require(_0xfcca('0x7'));var rpc={'chatMessage':require(_0xfcca('0x8')),'openchannelMessage':require(_0xfcca('0x9')),'mailMessage':require(_0xfcca('0xa')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xfcca('0xb'))};function createMessage(_0x31338c,_0x404452,_0x4114a7,_0x329d40){return new Promise(function(_0x26796e,_0x4db5a8){var _0x20e48b=_[_0xfcca('0xc')](_0x4114a7);_0x20e48b[_0xfcca('0xd')]=_0x329d40;return rpc[_0x404452+_0xfcca('0xe')][_0xfcca('0xf')](_0x20e48b)[_0xfcca('0x10')](function(){logger[_0xfcca('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x31338c,_0x20e48b['body']);_0x26796e();})['catch'](function(_0x12cfa0){logger['error'](_0xfcca('0x12'),_0x31338c,JSON[_0xfcca('0x13')](_0x12cfa0));_0x4db5a8(_0x12cfa0);});});}exports[_0xfcca('0x14')]=function(_0x1615b4,_0x4e12f5){return function(_0x1e6344){try{if(!_[_0xfcca('0x15')](this['interaction']['UserId'])){logger[_0xfcca('0x11')](_0xfcca('0x12'),_0x1615b4,_0xfcca('0x16'));return _0x1e6344['next']();}var _0x5f48fc={'ContactId':this[_0xfcca('0x17')]['id'],'sentAt':moment()['format'](_0xfcca('0x18')),'direction':_0xfcca('0x19')};if(this[_0xfcca('0x1a')]===_0xfcca('0x1b')||this['channel']===_0xfcca('0x1c')){_0x5f48fc[_0xfcca('0x1d')]=this[_0xfcca('0x1e')][_0xfcca('0x1d')];}var _0x444107=this['channel'];if(_0x444107===_0xfcca('0x1f')){_0x5f48fc[_0xfcca('0x20')]=this[_0xfcca('0x21')]['id'];}else{_0x5f48fc[_[_0xfcca('0x22')](_0x444107)+_0xfcca('0x23')]=this[_0xfcca('0x21')]['id'];}_0x5f48fc[_[_0xfcca('0x22')](_0x444107)+'InteractionId']=this[_0xfcca('0x1e')]['id'];if(this[_0xfcca('0x1e')][_0xfcca('0x24')]){var _0x59a82c=_0x4e12f5[0x4];if(!_['isEmpty'](_0x59a82c)){_0x5f48fc['body']=utils[_0xfcca('0x25')](_0x59a82c,this);return rpc[_0x444107+_0xfcca('0xe')][_0xfcca('0xf')](_0x5f48fc)[_0xfcca('0x10')](function(_0x1d4ece){logger['info'](_0xfcca('0x12'),_0x1615b4,_0x5f48fc['body']);})[_0xfcca('0x26')](function(_0x57c0f8){logger[_0xfcca('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x1615b4,JSON['stringify'](_0x57c0f8));})[_0xfcca('0x28')](function(){logger[_0xfcca('0x11')](_0xfcca('0x29'),_0x1615b4);_0x1e6344[_0xfcca('0x2a')]();});}else{logger['info'](_0xfcca('0x2b'),_0x1615b4);_0x1e6344['stop']();}}else{var _0x19ed7a=this;var _0x4288a1=_0x4e12f5[0x2]['replace'](/\\n/g,'\x0a');var _0x1ef634={'credentials':{'private_key':_0x4288a1,'client_email':_0x4e12f5[0x1]}};var _0x35672e=new dialogflow[(_0xfcca('0x2c'))](_0x1ef634);var _0x21e8c3=_0x35672e['sessionPath'](_0x4e12f5[0x0],md5(_0x19ed7a[_0xfcca('0x1e')]['id']));var _0x4c20db={'session':_0x21e8c3,'queryInput':{'text':{'text':_0x19ed7a[_0xfcca('0x2d')][_0xfcca('0xd')],'languageCode':_0x4e12f5[0x3]||'en'}}};return _0x35672e[_0xfcca('0x2e')](_0x4c20db)[_0xfcca('0x10')](function(_0x25465c){if(_0x25465c&&_0x25465c[_0xfcca('0x2f')]){_0x19ed7a[_0xfcca('0xd')][_0xfcca('0x30')]=_0x25465c;var _0x4915cb=_0x25465c[0x0];var _0x4b9aa2=_0x4915cb[_0xfcca('0x31')][_0xfcca('0x32')]&&_0x4915cb[_0xfcca('0x31')][_0xfcca('0x32')][_0xfcca('0x33')]?_0x4915cb[_0xfcca('0x31')][_0xfcca('0x32')][_0xfcca('0x33')]['end_conversation'][_0xfcca('0x34')]:![];_0x19ed7a[_0xfcca('0xd')][_0xfcca('0x35')]=_0x4915cb[_0xfcca('0x31')][_0xfcca('0x36')];_0x19ed7a[_0xfcca('0xd')][_0xfcca('0x37')]=_0x4915cb['queryResult'][_0xfcca('0x38')];_0x19ed7a[_0xfcca('0xd')][_0xfcca('0x39')]=_0x4915cb[_0xfcca('0x31')][_0xfcca('0x32')]&&_0x4915cb[_0xfcca('0x31')][_0xfcca('0x32')][_0xfcca('0x33')]?_0x4915cb[_0xfcca('0x31')][_0xfcca('0x32')][_0xfcca('0x33')][_0xfcca('0x3a')][_0xfcca('0x34')]:![];_0x19ed7a['body'][_0xfcca('0x3b')]=_0x4915cb['queryResult']['intent'][_0xfcca('0x3c')];_0x19ed7a['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x4915cb[_0xfcca('0x31')]['intent'][_0xfcca('0x3d')];_0x19ed7a[_0xfcca('0xd')][_0xfcca('0x3e')]=_0x4915cb[_0xfcca('0x31')][_0xfcca('0x3f')][_0xfcca('0x40')];_0x19ed7a['body'][_0xfcca('0x41')]=_0x4915cb[_0xfcca('0x31')]['languageCode'];_0x19ed7a[_0xfcca('0xd')][_0xfcca('0x42')]=_0x4915cb[_0xfcca('0x31')][_0xfcca('0x43')];_0x19ed7a[_0xfcca('0xd')][_0xfcca('0x44')]=_0x4915cb['queryResult'][_0xfcca('0x45')];_0x5f48fc[_0xfcca('0x46')]=_0xfcca('0x30');_0x5f48fc[_0xfcca('0x47')]=JSON[_0xfcca('0x13')](_0x25465c);var _0xfcb572=[];for(var _0x39f22f=0x0;_0x39f22f<_0x25465c[_0xfcca('0x2f')];_0x39f22f++){var _0x409964=_0x25465c[_0x39f22f];if(_0x409964&&_0x409964[_0xfcca('0x31')]&&_0x409964[_0xfcca('0x31')][_0xfcca('0x48')]){_0xfcb572['push'](createMessage(_0x1615b4,_0x444107,_0x5f48fc,_0x409964[_0xfcca('0x31')][_0xfcca('0x48')]));}}return Promise[_0xfcca('0x49')](_0xfcb572)[_0xfcca('0x10')](function(){if(_0x4b9aa2){_0x1e6344['next']();}else{_0x1e6344[_0xfcca('0x2a')]();}})[_0xfcca('0x26')](function(_0x5088fd){logger['error'](_0xfcca('0x12'),_0x1615b4,JSON[_0xfcca('0x13')](_0x5088fd));_0x1e6344[_0xfcca('0x4a')]();});}})[_0xfcca('0x26')](function(_0x29adef){logger[_0xfcca('0x27')](_0xfcca('0x12'),_0x1615b4,_0x29adef[_0xfcca('0x2d')]);_0x1e6344[_0xfcca('0x4a')]();});}}catch(_0x4a9c3c){logger['error'](_0xfcca('0x12'),_0x1615b4,JSON[_0xfcca('0x13')](_0x4a9c3c));_0x1e6344[_0xfcca('0x2a')]();}};}; \ 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 5a08480..42bccd9 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 _0x1a50=['join','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stop','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','length','[%s][GOTOIF]\x20%s','map','message'];(function(_0x3847e6,_0x4b3321){var _0x55e21c=function(_0xf65a1e){while(--_0xf65a1e){_0x3847e6['push'](_0x3847e6['shift']());}};_0x55e21c(++_0x4b3321);}(_0x1a50,0x142));var _0x01a5=function(_0x2c27c6,_0xb57741){_0x2c27c6=_0x2c27c6-0x0;var _0x43e0a3=_0x1a50[_0x2c27c6];return _0x43e0a3;};'use strict';var schema=require(_0x01a5('0x0'));var _=require(_0x01a5('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x01a5('0x2'));var logger=require(_0x01a5('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x01a5('0x4'),'required':!![],'message':_0x01a5('0x5')},'priorityTrue':{'type':'number','message':_0x01a5('0x6')},'priorityFalse':{'type':_0x01a5('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x01a5('0x8')]=function(_0x41d852,_0x52fdcb){return function(_0x3d0c05){try{var _0x484afe={'condition':htmlToText[_0x01a5('0x9')](utils['getMustacheRender'](_0x52fdcb[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x52fdcb[0x1],'priorityFalse':_0x52fdcb[0x2]};var _0x36d3e9=gotoif[_0x01a5('0x0')](_0x484afe,{'typecast':!![]});if(_0x36d3e9[_0x01a5('0xa')]){logger['error'](_0x01a5('0xb'),_0x41d852,_[_0x01a5('0xc')](_0x36d3e9,_0x01a5('0xd'))[_0x01a5('0xe')](',\x20'));_0x3d0c05['stop']();}else{try{var _0x58ad23=eval('('+_0x484afe['condition']+')');var _0x41e68c=_0x58ad23?_0x484afe['priorityTrue']:_0x484afe['priorityFalse'];logger[_0x01a5('0xf')](_0x01a5('0x10'),_0x41d852,_0x484afe[_0x01a5('0x11')],_0x58ad23,_0x41e68c||_0x01a5('0x12'));if(_0x41e68c){var _0x2bfd96=_[_0x01a5('0x13')](_0x3d0c05['rules'](),{'p':_0x41e68c});if(_0x2bfd96>=0x0){logger['info'](_0x01a5('0x14'),_0x41d852,_0x41e68c||_0x01a5('0x12'),_0x2bfd96);_0x3d0c05[_0x01a5('0x12')](_0x2bfd96);}else{logger[_0x01a5('0xf')](_0x01a5('0x15'),_0x41d852,_0x41e68c||_0x01a5('0x12'));_0x3d0c05['stop']();}}else{_0x3d0c05[_0x01a5('0x12')]();}}catch(_0x33170a){logger[_0x01a5('0x16')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x41d852,_0x33170a[_0x01a5('0xd')]);_0x3d0c05[_0x01a5('0x17')]();}}}catch(_0x54fd82){logger[_0x01a5('0x16')](_0x01a5('0xb'),_0x41d852,JSON['stringify'](_0x54fd82));_0x3d0c05[_0x01a5('0x17')]();}};}; \ No newline at end of file +var _0xaea3=['number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','error','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','[%s][GOTOIF]\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string'];(function(_0x9dc3a1,_0x1fadd2){var _0x167e96=function(_0x1fa1c8){while(--_0x1fa1c8){_0x9dc3a1['push'](_0x9dc3a1['shift']());}};_0x167e96(++_0x1fadd2);}(_0xaea3,0xff));var _0x3aea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaea3[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0x3aea('0x0'));var _=require('lodash');var htmlToText=require(_0x3aea('0x1'));var utils=require(_0x3aea('0x2'));var logger=require(_0x3aea('0x3'))(_0x3aea('0x4'));var gotoif=schema({'condition':{'type':_0x3aea('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3aea('0x6'),'message':_0x3aea('0x7')},'priorityFalse':{'type':'number','message':_0x3aea('0x8')}});exports[_0x3aea('0x9')]=function(_0x5a6cd8,_0x27b76b){return function(_0x5d450b){try{var _0x2f21d8={'condition':htmlToText['fromString'](utils[_0x3aea('0xa')](_0x27b76b[0x0],this),{'wordwrap':![]})[_0x3aea('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x27b76b[0x1],'priorityFalse':_0x27b76b[0x2]};var _0x4d912e=gotoif['validate'](_0x2f21d8,{'typecast':!![]});if(_0x4d912e['length']){logger[_0x3aea('0xc')]('[%s][GOTOIF]\x20%s',_0x5a6cd8,_['map'](_0x4d912e,'message')[_0x3aea('0xd')](',\x20'));_0x5d450b[_0x3aea('0xe')]();}else{try{var _0x490dfa=eval('('+_0x2f21d8[_0x3aea('0xf')]+')');var _0x77a1d6=_0x490dfa?_0x2f21d8[_0x3aea('0x10')]:_0x2f21d8[_0x3aea('0x11')];logger[_0x3aea('0x12')](_0x3aea('0x13'),_0x5a6cd8,_0x2f21d8[_0x3aea('0xf')],_0x490dfa,_0x77a1d6||_0x3aea('0x14'));if(_0x77a1d6){var _0x110730=_[_0x3aea('0x15')](_0x5d450b[_0x3aea('0x16')](),{'p':_0x77a1d6});if(_0x110730>=0x0){logger[_0x3aea('0x12')](_0x3aea('0x17'),_0x5a6cd8,_0x77a1d6||_0x3aea('0x14'),_0x110730);_0x5d450b[_0x3aea('0x14')](_0x110730);}else{logger[_0x3aea('0x12')](_0x3aea('0x18'),_0x5a6cd8,_0x77a1d6||'next');_0x5d450b[_0x3aea('0xe')]();}}else{_0x5d450b[_0x3aea('0x14')]();}}catch(_0x28f5a6){logger[_0x3aea('0xc')](_0x3aea('0x19'),_0x5a6cd8,_0x28f5a6[_0x3aea('0x1a')]);_0x5d450b['stop']();}}}catch(_0x2e48bc){logger['error'](_0x3aea('0x1b'),_0x5a6cd8,JSON[_0x3aea('0x1c')](_0x2e48bc));_0x5d450b[_0x3aea('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 04054c7..23a1451 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 _0xc3d6=['priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','[%s][GOTOP]\x20priority\x20%s'];(function(_0xa070,_0x1c1f3c){var _0x7150a3=function(_0x452ca3){while(--_0x452ca3){_0xa070['push'](_0xa070['shift']());}};_0x7150a3(++_0x1c1f3c);}(_0xc3d6,0x1aa));var _0x6c3d=function(_0xbe07b7,_0x1130ae){_0xbe07b7=_0xbe07b7-0x0;var _0x28e625=_0xc3d6[_0xbe07b7];return _0x28e625;};'use strict';var schema=require(_0x6c3d('0x0'));var _=require('lodash');var logger=require(_0x6c3d('0x1'))(_0x6c3d('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x6c3d('0x3')}});exports['consequence']=function(_0x457f50,_0x46830f){return function(_0x2f1eab){try{var _0x52726e={'priority':_0x46830f[0x0]};var _0x22e7e4=gotop[_0x6c3d('0x0')](_0x52726e,{'typecast':!![]});if(_0x22e7e4[_0x6c3d('0x4')]){logger[_0x6c3d('0x5')](_0x6c3d('0x6'),_0x457f50,_[_0x6c3d('0x7')](_0x22e7e4,_0x6c3d('0x8'))[_0x6c3d('0x9')](',\x20'));_0x2f1eab['stop']();}else{logger['info'](_0x6c3d('0xa'),_0x457f50,_0x52726e[_0x6c3d('0xb')]);if(_0x52726e[_0x6c3d('0xb')]){var _0x5d39c9=_[_0x6c3d('0xc')](_0x2f1eab[_0x6c3d('0xd')](),{'p':_0x52726e['priority']});if(_0x5d39c9>=0x0){logger[_0x6c3d('0xe')](_0x6c3d('0xf'),_0x457f50,_0x52726e[_0x6c3d('0xb')]||_0x6c3d('0x10'),_0x5d39c9);_0x2f1eab[_0x6c3d('0x10')](_0x5d39c9);}else{logger['info'](_0x6c3d('0x11'),_0x457f50,_0x52726e[_0x6c3d('0xb')]||'next');_0x2f1eab[_0x6c3d('0x12')]();}}else{_0x2f1eab[_0x6c3d('0x10')]();}}}catch(_0x50beed){logger[_0x6c3d('0x5')]('[%s][GOTOP]\x20%s',_0x457f50,JSON['stringify'](_0x50beed));_0x2f1eab[_0x6c3d('0x12')]();}};}; \ No newline at end of file +var _0x438e=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','priority','findIndex','[%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'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x438e,0x10d));var _0xe438=function(_0x5ebf44,_0x4e543e){_0x5ebf44=_0x5ebf44-0x0;var _0x2fef12=_0x438e[_0x5ebf44];return _0x2fef12;};'use strict';var schema=require(_0xe438('0x0'));var _=require(_0xe438('0x1'));var logger=require(_0xe438('0x2'))(_0xe438('0x3'));var gotop=schema({'priority':{'type':_0xe438('0x4'),'required':!![],'message':_0xe438('0x5')}});exports[_0xe438('0x6')]=function(_0x2a206c,_0x29544e){return function(_0x3535bb){try{var _0x567f81={'priority':_0x29544e[0x0]};var _0x43956a=gotop[_0xe438('0x0')](_0x567f81,{'typecast':!![]});if(_0x43956a[_0xe438('0x7')]){logger[_0xe438('0x8')](_0xe438('0x9'),_0x2a206c,_[_0xe438('0xa')](_0x43956a,_0xe438('0xb'))[_0xe438('0xc')](',\x20'));_0x3535bb['stop']();}else{logger[_0xe438('0xd')]('[%s][GOTOP]\x20priority\x20%s',_0x2a206c,_0x567f81['priority']);if(_0x567f81[_0xe438('0xe')]){var _0x41bcbd=_[_0xe438('0xf')](_0x3535bb['rules'](),{'p':_0x567f81[_0xe438('0xe')]});if(_0x41bcbd>=0x0){logger['info'](_0xe438('0x10'),_0x2a206c,_0x567f81['priority']||_0xe438('0x11'),_0x41bcbd);_0x3535bb[_0xe438('0x11')](_0x41bcbd);}else{logger[_0xe438('0xd')](_0xe438('0x12'),_0x2a206c,_0x567f81[_0xe438('0xe')]||'next');_0x3535bb[_0xe438('0x13')]();}}else{_0x3535bb[_0xe438('0x11')]();}}}catch(_0x51dc4c){logger[_0xe438('0x8')](_0xe438('0x9'),_0x2a206c,JSON[_0xe438('0x14')](_0x51dc4c));_0x3535bb[_0xe438('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 1071c76..8c51b18 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 _0x31af=['routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash'];(function(_0x8531f8,_0xe334b3){var _0x1ffe1b=function(_0x4f903c){while(--_0x4f903c){_0x8531f8['push'](_0x8531f8['shift']());}};_0x1ffe1b(++_0xe334b3);}(_0x31af,0x1b9));var _0xf31a=function(_0x998b30,_0x473369){_0x998b30=_0x998b30-0x0;var _0x20ff4b=_0x31af[_0x998b30];return _0x20ff4b;};'use strict';var _=require(_0xf31a('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xf31a('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf31a('0x2')),'mailMessage':require(_0xf31a('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf31a('0x4'))};exports[_0xf31a('0x5')]=function(_0x144b1b,_0x32e828){return function(_0x354ef9){try{var _0x2f2e98={'body':utils[_0xf31a('0x6')](_0x32e828[0x0],this),'ContactId':this[_0xf31a('0x7')]['id']};if(this[_0xf31a('0x8')]===_0xf31a('0x9')){_0x2f2e98[_0xf31a('0xa')]=this[_0xf31a('0xb')]['id'];}else{_0x2f2e98[_[_0xf31a('0xc')](this[_0xf31a('0x8')])+'AccountId']=this[_0xf31a('0xb')]['id'];}_0x2f2e98[_[_0xf31a('0xc')](this[_0xf31a('0x8')])+_0xf31a('0xd')]=this[_0xf31a('0xe')]['id'];if(rpc[this[_0xf31a('0x8')]+'Message']){return rpc[this[_0xf31a('0x8')]+_0xf31a('0xf')][_0xf31a('0x10')](_0x2f2e98)[_0xf31a('0x11')](function(_0x38a949){logger[_0xf31a('0x12')](_0xf31a('0x13'),_0x144b1b,_0x2f2e98[_0xf31a('0x14')]);_0x354ef9[_0xf31a('0x15')]();})[_0xf31a('0x16')](function(_0x4518b5){logger[_0xf31a('0x17')]('[%s][MESSAGE]\x20%s',_0x144b1b,JSON[_0xf31a('0x18')](_0x4518b5));_0x354ef9[_0xf31a('0x19')]();});}}catch(_0x408ee0){logger[_0xf31a('0x17')]('[%s][MESSAGE]\x20%s',_0x144b1b,JSON[_0xf31a('0x18')](_0x408ee0));_0x354ef9['stop']();}};}; \ No newline at end of file +var _0xa953=['AccountId','upperFirst','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','getMustacheRender','contact','channel','account'];(function(_0x272440,_0x2d9c92){var _0x28dc6b=function(_0x3952e6){while(--_0x3952e6){_0x272440['push'](_0x272440['shift']());}};_0x28dc6b(++_0x2d9c92);}(_0xa953,0x1d0));var _0x3a95=function(_0x297b8b,_0x10031d){_0x297b8b=_0x297b8b-0x0;var _0x4566e9=_0xa953[_0x297b8b];return _0x4566e9;};'use strict';var _=require(_0x3a95('0x0'));var utils=require(_0x3a95('0x1'));var logger=require(_0x3a95('0x2'))(_0x3a95('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3a95('0x4')),'mailMessage':require(_0x3a95('0x5')),'smsMessage':require(_0x3a95('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xfd621a,_0x1ffe5f){return function(_0x29613f){try{var _0xb8a831={'body':utils[_0x3a95('0x7')](_0x1ffe5f[0x0],this),'ContactId':this[_0x3a95('0x8')]['id']};if(this[_0x3a95('0x9')]==='chat'){_0xb8a831['ChatWebsiteId']=this[_0x3a95('0xa')]['id'];}else{_0xb8a831[_['upperFirst'](this['channel'])+_0x3a95('0xb')]=this['account']['id'];}_0xb8a831[_[_0x3a95('0xc')](this[_0x3a95('0x9')])+'InteractionId']=this[_0x3a95('0xd')]['id'];if(rpc[this[_0x3a95('0x9')]+_0x3a95('0xe')]){return rpc[this['channel']+_0x3a95('0xe')][_0x3a95('0xf')](_0xb8a831)[_0x3a95('0x10')](function(_0x54e2a6){logger[_0x3a95('0x11')](_0x3a95('0x12'),_0xfd621a,_0xb8a831[_0x3a95('0x13')]);_0x29613f[_0x3a95('0x14')]();})[_0x3a95('0x15')](function(_0x5098c6){logger[_0x3a95('0x16')]('[%s][MESSAGE]\x20%s',_0xfd621a,JSON[_0x3a95('0x17')](_0x5098c6));_0x29613f['stop']();});}}catch(_0x40a01d){logger[_0x3a95('0x16')]('[%s][MESSAGE]\x20%s',_0xfd621a,JSON[_0x3a95('0x17')](_0x40a01d));_0x29613f[_0x3a95('0x18')]();}};}; \ 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 1d3c4ea..2f7c168 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 _0x5db2=['error','stringify','stop','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0xa61e43,_0x2dc2f3){var _0x4f80ae=function(_0x42665d){while(--_0x42665d){_0xa61e43['push'](_0xa61e43['shift']());}};_0x4f80ae(++_0x2dc2f3);}(_0x5db2,0x157));var _0x25db=function(_0x3e0c53,_0x166095){_0x3e0c53=_0x3e0c53-0x0;var _0x1a09d5=_0x5db2[_0x3e0c53];return _0x1a09d5;};'use strict';var utils=require(_0x25db('0x0'));var logger=require('../../../../config/logger')(_0x25db('0x1'));exports[_0x25db('0x2')]=function(_0xf8db88,_0x13e535){return function(_0x1f6fc7){try{logger[_0x25db('0x3')](_0x25db('0x4'),_0xf8db88,utils[_0x25db('0x5')](_0x13e535[0x0],this));_0x1f6fc7[_0x25db('0x6')]();}catch(_0x1d31d3){logger[_0x25db('0x7')](_0x25db('0x4'),_0xf8db88,JSON[_0x25db('0x8')](_0x1d31d3));_0x1f6fc7[_0x25db('0x9')]();}};}; \ No newline at end of file +var _0x5655=['routing','consequence','[%s][NOOP]\x20%s','next','error','stringify','./utils','../../../../config/logger'];(function(_0x500dde,_0x23cdb8){var _0x3c2ca8=function(_0x5d2245){while(--_0x5d2245){_0x500dde['push'](_0x500dde['shift']());}};_0x3c2ca8(++_0x23cdb8);}(_0x5655,0x15e));var _0x5565=function(_0x369e78,_0x18dea1){_0x369e78=_0x369e78-0x0;var _0x4ad433=_0x5655[_0x369e78];return _0x4ad433;};'use strict';var utils=require(_0x5565('0x0'));var logger=require(_0x5565('0x1'))(_0x5565('0x2'));exports[_0x5565('0x3')]=function(_0x42be35,_0x243782){return function(_0x5b1b44){try{logger['info'](_0x5565('0x4'),_0x42be35,utils['getMustacheRender'](_0x243782[0x0],this));_0x5b1b44[_0x5565('0x5')]();}catch(_0x129c84){logger[_0x5565('0x6')](_0x5565('0x4'),_0x42be35,JSON[_0x5565('0x7')](_0x129c84));_0x5b1b44['stop']();}};}; \ 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 577ac50..bcb1f52 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 _0x943a=['timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','complete','close','next','strategy','rrmemory','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue','from','joinAt','clone','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','update','update\x20queue\x20report'];(function(_0x1f6902,_0x21b293){var _0x2e0d8a=function(_0x48be56){while(--_0x48be56){_0x1f6902['push'](_0x1f6902['shift']());}};_0x2e0d8a(++_0x21b293);}(_0x943a,0xfd));var _0xa943=function(_0x3cc657,_0x38c731){_0x3cc657=_0x3cc657-0x0;var _0x5340c3=_0x943a[_0x3cc657];return _0x5340c3;};'use strict';var schema=require(_0xa943('0x0'));var _=require(_0xa943('0x1'));var util=require(_0xa943('0x2'));var seqqueue=require(_0xa943('0x3'));var moment=require(_0xa943('0x4'));var Redis=require(_0xa943('0x5'));var config=require(_0xa943('0x6'));var logger=require(_0xa943('0x7'))(_0xa943('0x8'));var strategy=require(_0xa943('0x9'));config[_0xa943('0xa')]=_[_0xa943('0xb')](config[_0xa943('0xa')],{'host':_0xa943('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id','queue_id','account',_0xa943('0xd'),_0xa943('0xe'),_0xa943('0xf')];function emit(_0x3542a6,_0x29a01a,_0x3e8de8){io['to'](_0x3542a6)['emit'](_0x29a01a,_0x3e8de8);}function emitChannelQueueInteraction(_0x39c8bf,_0x4e2e5d,_0x46dce6,_0x1491f7,_0x2a2a70,_0x1c402a,_0x529a17,_0x3e5583){var _0x3bd459=_[_0xa943('0x10')](_0x46dce6);_0x3bd459[_0xa943('0x11')]=_0x3e5583;_0x3bd459['queue']=_0x4e2e5d;_0x3bd459['account']=_0x1491f7;_0x3bd459['id']=_0x2a2a70;if(_0x1c402a){_0x529a17[util[_0xa943('0x12')](_0xa943('0x13'),_0x39c8bf)][_0x2a2a70]=_[_0xa943('0x14')](_0x3bd459,attributes);}else{delete _0x529a17[util['format'](_0xa943('0x13'),_0x39c8bf)][_0x2a2a70];}emit(util['format'](_0xa943('0x15'),_0x39c8bf,_0x4e2e5d),util[_0xa943('0x12')](_0xa943('0x16'),_0x39c8bf,_0x1c402a?'save':_0xa943('0x17')),_['pick'](_0x3bd459,attributes));}var rpc={'openchannelQueueReport':require(_0xa943('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xa943('0x19')),'smsQueueReport':require(_0xa943('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa943('0x1b'))};var queue=schema({'name':{'type':_0xa943('0x1c'),'required':!![],'message':_0xa943('0x1d')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xae86e0,_0x153ed6,_0x200b15,_0x35f524){if(_0xae86e0&&_0x153ed6&&_0x200b15){_0x153ed6['waiting']+=0x1;var _0x4c64b8={'uniqueid':_0xae86e0,'from':_0x200b15[_0xa943('0x1e')]?_0x200b15[_0xa943('0x1e')][_0xa943('0xe')]:'','joinAt':moment()[_0xa943('0x12')](_0xa943('0x1f')),'ContactId':_0x200b15[_0xa943('0x20')]?_0x200b15[_0xa943('0x20')]['id']:null,'ListId':_0x200b15[_0xa943('0x21')]?_0x200b15['list']['id']:null};_0x4c64b8[_['upperFirst'](_0x200b15['channel'])+'QueueId']=_0x153ed6['id']||null;_0x4c64b8[_[_0xa943('0x22')](_0x200b15[_0xa943('0x23')])+_0xa943('0x24')]=_0x200b15[_0xa943('0x25')]?_0x200b15[_0xa943('0x25')]['id']:null;_0x4c64b8[_[_0xa943('0x22')](_0x200b15[_0xa943('0x23')])+_0xa943('0x26')]=_0x200b15[_0xa943('0x27')]?_0x200b15[_0xa943('0x27')]['id']:null;_0x4c64b8[_['upperFirst'](_0x200b15[_0xa943('0x23')])+(_0x200b15[_0xa943('0x23')]!=='chat'?_0xa943('0x28'):_0xa943('0x29'))]=_0x200b15[_0xa943('0x2a')]?_0x200b15[_0xa943('0x2a')]['id']:null;logger[_0xa943('0x2b')](util['format'](_0xa943('0x2c'),_0xae86e0,_0x153ed6[_0xa943('0x2d')]));emitChannelQueueInteraction(_0x200b15['channel'],_0x153ed6[_0xa943('0x2d')],_0x4c64b8,_0x200b15[_0xa943('0x2a')][_0xa943('0x2d')],_0x200b15[_0xa943('0x27')]['id'],!![],_0x35f524,_0x153ed6['id']);if(rpc[_0x200b15[_0xa943('0x23')]+_0xa943('0x2e')]){return rpc[_0x200b15['channel']+_0xa943('0x2e')][_0xa943('0x2f')](_0x4c64b8)[_0xa943('0x30')](function(_0x4de510){logger[_0xa943('0x31')](_0xa943('0x32'));});}}}function stopRouting(_0x464e8a,_0x45f613,_0x2de383,_0xcfc9da){if(_0x464e8a&&_0x45f613){_0x45f613[_0xa943('0x33')]-=0x1;var _0x4e6ba0={'leaveAt':moment()[_0xa943('0x12')](_0xa943('0x1f')),'acceptAt':moment()[_0xa943('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa943('0x34')};logger[_0xa943('0x2b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x464e8a,_0x45f613[_0xa943('0x2d')]));emitChannelQueueInteraction(_0x2de383[_0xa943('0x23')],_0x45f613[_0xa943('0x2d')],_0x2de383[_0xa943('0x1e')],_0x2de383['account'][_0xa943('0x2d')],_0x2de383[_0xa943('0x27')]['id'],![],_0xcfc9da,_0x45f613['id']);if(rpc[_0x2de383[_0xa943('0x23')]+_0xa943('0x2e')]){return rpc[_0x2de383[_0xa943('0x23')]+_0xa943('0x2e')][_0xa943('0x35')](_0x464e8a,_0x4e6ba0)[_0xa943('0x30')](function(_0x42529a){logger[_0xa943('0x31')](_0xa943('0x36'));});}}}function endRouting(_0x30762c,_0x21dcde,_0x34b908,_0x4d3efb){if(_0x30762c&&_0x21dcde){_0x21dcde[_0xa943('0x33')]-=0x1;var _0x5068c3={'leaveAt':moment()[_0xa943('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xa943('0x12')](_0xa943('0x1f')),'reason':_0xa943('0x37')};logger[_0xa943('0x2b')](util[_0xa943('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x30762c,_0x21dcde['name']));emitChannelQueueInteraction(_0x34b908[_0xa943('0x23')],_0x21dcde[_0xa943('0x2d')],_0x34b908[_0xa943('0x1e')],_0x34b908[_0xa943('0x2a')]['name'],_0x34b908[_0xa943('0x27')]['id'],![],_0x4d3efb);if(rpc[_0x34b908[_0xa943('0x23')]+'QueueReport']){return rpc[_0x34b908[_0xa943('0x23')]+'QueueReport']['update'](_0x30762c,_0x5068c3)[_0xa943('0x30')](function(_0x702fab){logger['error'](_0xa943('0x36'));});}}}function handleFindQueue(_0x188146){return function(_0x24f132){return _0x24f132[_0xa943('0x2d')][_0xa943('0x38')]()===_0x188146[_0xa943('0x38')]();};}exports[_0xa943('0x39')]=function(_0x2b3c16,_0x44dd56,_0x4ffd3c,_0x54211d){return function(_0xdc9ba3){try{var _0x105b1a={'name':_0x44dd56[0x0],'timeout':_0x44dd56[0x1]};var _0x223dc1=queue[_0xa943('0x0')](_0x105b1a,{'typecast':!![]});if(_0x223dc1[_0xa943('0x3a')]){logger[_0xa943('0x31')](_0xa943('0x3b'),_0x2b3c16,_[_0xa943('0x3c')](_0x223dc1,'message')[_0xa943('0x3d')](',\x20'));_0xdc9ba3['stop']();}else{var _0x12caf1=_[_0xa943('0x3e')](_0x4ffd3c[_0x54211d['channel']+_0xa943('0x3f')],handleFindQueue(_0x105b1a[_0xa943('0x2d')]));if(_0x12caf1){startRouting(_0x2b3c16,_0x12caf1,_0x54211d,_0x4ffd3c);var _0x482dc6=(_0x12caf1['timeout']||0xa)*0x3e8;var _0x1fabff=(_0x105b1a[_0xa943('0x37')]||0x14)*0x3e8;var _0x10fe8e,_0xa0f8e8;if(_0x482dc6>_0x1fabff){_0x1fabff=_0x482dc6;}var _0x1d9ef0=seqqueue[_0xa943('0x40')](_0x482dc6);_0x1d9ef0['id']=_0x2b3c16;_0x1d9ef0['atimeout']=_0x482dc6;_0x1d9ef0[_0xa943('0x41')]=_0x1fabff;_0x1d9ef0['channel']=_0x54211d['channel'];_0x4ffd3c[_0xa943('0x42')][_0x2b3c16]['on'](_0xa943('0x43'),function(){logger[_0xa943('0x2b')](_0xa943('0x44'),_0x2b3c16);stopRouting(_0x2b3c16,_0x12caf1,_0x54211d,_0x4ffd3c);clearTimeout(_0x10fe8e);_0x10fe8e=undefined;_0x1d9ef0['close'](!![]);if(_0x4ffd3c[_0xa943('0x42')][_0x2b3c16]){delete _0x4ffd3c[_0xa943('0x42')][_0x2b3c16];}_0xdc9ba3[_0xa943('0x45')]();});_0x4ffd3c[_0xa943('0x42')][_0x2b3c16]['on'](_0xa943('0x46'),function(){if(_0x4ffd3c[_0xa943('0x42')][_0x2b3c16]){delete _0x4ffd3c[_0xa943('0x42')][_0x2b3c16];}});_0x10fe8e=setTimeout(function(){logger[_0xa943('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x2b3c16);endRouting(_0x2b3c16,_0x12caf1,_0x54211d,_0x4ffd3c);clearTimeout(_0x10fe8e);_0x1d9ef0[_0xa943('0x47')](!![]);_0xdc9ba3[_0xa943('0x48')]();},_0x1fabff);switch(_0x12caf1[_0xa943('0x49')]){case _0xa943('0x4a'):strategy[_0xa943('0x4a')](_0x1d9ef0,_0x12caf1,_0x4ffd3c,_0x54211d);break;default:strategy['beepall'](_0x1d9ef0,_0x12caf1,_0x4ffd3c,_0x54211d);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2b3c16,_0x105b1a[_0xa943('0x2d')]);_0xdc9ba3[_0xa943('0x45')]();}}}catch(_0x144da9){console[_0xa943('0x4b')](_0x144da9);logger[_0xa943('0x31')]('[%s][QUEUE]\x20%s',_0x2b3c16,_0x144da9[_0xa943('0x4c')]);_0xdc9ba3['stop']();}};}; \ No newline at end of file +var _0x9a1c=['account','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','map','find','Queues','createQueue','atimeout','qtimeout','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','routing','./strategy','redis','defaults','localhost','queue_id','queue','joinAt'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9a1c,0x1c6));var _0xc9a1=function(_0x44cee4,_0x301386){_0x44cee4=_0x44cee4-0x0;var _0x3062c9=_0x9a1c[_0x44cee4];return _0x3062c9;};'use strict';var schema=require(_0xc9a1('0x0'));var _=require(_0xc9a1('0x1'));var util=require(_0xc9a1('0x2'));var seqqueue=require(_0xc9a1('0x3'));var moment=require(_0xc9a1('0x4'));var Redis=require('ioredis');var config=require(_0xc9a1('0x5'));var logger=require('../../../../config/logger')(_0xc9a1('0x6'));var strategy=require(_0xc9a1('0x7'));config[_0xc9a1('0x8')]=_[_0xc9a1('0x9')](config['redis'],{'host':_0xc9a1('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc9a1('0x8')]));var attributes=['id',_0xc9a1('0xb'),'account',_0xc9a1('0xc'),'from',_0xc9a1('0xd')];function emit(_0x24d789,_0x10beed,_0x8e794f){io['to'](_0x24d789)['emit'](_0x10beed,_0x8e794f);}function emitChannelQueueInteraction(_0x6b745f,_0x44ad80,_0x151e10,_0x51c6aa,_0xe00bb8,_0x5b597e,_0x38c3cc,_0x23bdff){var _0x3e430c=_['clone'](_0x151e10);_0x3e430c['queue_id']=_0x23bdff;_0x3e430c[_0xc9a1('0xc')]=_0x44ad80;_0x3e430c[_0xc9a1('0xe')]=_0x51c6aa;_0x3e430c['id']=_0xe00bb8;if(_0x5b597e){_0x38c3cc[util[_0xc9a1('0xf')](_0xc9a1('0x10'),_0x6b745f)][_0xe00bb8]=_[_0xc9a1('0x11')](_0x3e430c,attributes);}else{delete _0x38c3cc[util['format'](_0xc9a1('0x10'),_0x6b745f)][_0xe00bb8];}emit(util[_0xc9a1('0xf')]('%s:queue:%s',_0x6b745f,_0x44ad80),util[_0xc9a1('0xf')](_0xc9a1('0x12'),_0x6b745f,_0x5b597e?'save':_0xc9a1('0x13')),_[_0xc9a1('0x11')](_0x3e430c,attributes));}var rpc={'openchannelQueueReport':require(_0xc9a1('0x14')),'mailQueueReport':require(_0xc9a1('0x15')),'chatQueueReport':require(_0xc9a1('0x16')),'smsQueueReport':require(_0xc9a1('0x17')),'faxQueueReport':require(_0xc9a1('0x18')),'whatsappQueueReport':require(_0xc9a1('0x19'))};var queue=schema({'name':{'type':_0xc9a1('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc9a1('0x1b'),'message':_0xc9a1('0x1c')}});function startRouting(_0x46c388,_0x56a9f5,_0x3460aa,_0x2a7e83){if(_0x46c388&&_0x56a9f5&&_0x3460aa){_0x56a9f5[_0xc9a1('0x1d')]+=0x1;var _0x518547={'uniqueid':_0x46c388,'from':_0x3460aa[_0xc9a1('0x1e')]?_0x3460aa[_0xc9a1('0x1e')]['from']:'','joinAt':moment()[_0xc9a1('0xf')](_0xc9a1('0x1f')),'ContactId':_0x3460aa[_0xc9a1('0x20')]?_0x3460aa[_0xc9a1('0x20')]['id']:null,'ListId':_0x3460aa[_0xc9a1('0x21')]?_0x3460aa['list']['id']:null};_0x518547[_[_0xc9a1('0x22')](_0x3460aa[_0xc9a1('0x23')])+_0xc9a1('0x24')]=_0x56a9f5['id']||null;_0x518547[_[_0xc9a1('0x22')](_0x3460aa[_0xc9a1('0x23')])+_0xc9a1('0x25')]=_0x3460aa[_0xc9a1('0x26')]?_0x3460aa[_0xc9a1('0x26')]['id']:null;_0x518547[_[_0xc9a1('0x22')](_0x3460aa[_0xc9a1('0x23')])+'MessageId']=_0x3460aa[_0xc9a1('0x27')]?_0x3460aa[_0xc9a1('0x27')]['id']:null;_0x518547[_[_0xc9a1('0x22')](_0x3460aa[_0xc9a1('0x23')])+(_0x3460aa[_0xc9a1('0x23')]!==_0xc9a1('0x28')?_0xc9a1('0x29'):_0xc9a1('0x2a'))]=_0x3460aa[_0xc9a1('0xe')]?_0x3460aa['account']['id']:null;logger[_0xc9a1('0x2b')](util['format'](_0xc9a1('0x2c'),_0x46c388,_0x56a9f5[_0xc9a1('0x2d')]));emitChannelQueueInteraction(_0x3460aa[_0xc9a1('0x23')],_0x56a9f5[_0xc9a1('0x2d')],_0x518547,_0x3460aa[_0xc9a1('0xe')][_0xc9a1('0x2d')],_0x3460aa[_0xc9a1('0x27')]['id'],!![],_0x2a7e83,_0x56a9f5['id']);if(rpc[_0x3460aa['channel']+'QueueReport']){return rpc[_0x3460aa['channel']+_0xc9a1('0x2e')][_0xc9a1('0x2f')](_0x518547)[_0xc9a1('0x30')](function(_0x49c774){logger[_0xc9a1('0x31')](_0xc9a1('0x32'));});}}}function stopRouting(_0x4be44e,_0x2590bd,_0x13b5bc,_0x1fea3e){if(_0x4be44e&&_0x2590bd){_0x2590bd[_0xc9a1('0x1d')]-=0x1;var _0xb087c={'leaveAt':moment()[_0xc9a1('0xf')](_0xc9a1('0x1f')),'acceptAt':moment()[_0xc9a1('0xf')](_0xc9a1('0x1f')),'reason':_0xc9a1('0x33')};logger[_0xc9a1('0x2b')](util[_0xc9a1('0xf')](_0xc9a1('0x34'),_0x4be44e,_0x2590bd[_0xc9a1('0x2d')]));emitChannelQueueInteraction(_0x13b5bc['channel'],_0x2590bd['name'],_0x13b5bc[_0xc9a1('0x1e')],_0x13b5bc['account'][_0xc9a1('0x2d')],_0x13b5bc[_0xc9a1('0x27')]['id'],![],_0x1fea3e,_0x2590bd['id']);if(rpc[_0x13b5bc[_0xc9a1('0x23')]+_0xc9a1('0x2e')]){return rpc[_0x13b5bc[_0xc9a1('0x23')]+_0xc9a1('0x2e')][_0xc9a1('0x35')](_0x4be44e,_0xb087c)[_0xc9a1('0x30')](function(_0x264f47){logger[_0xc9a1('0x31')](_0xc9a1('0x36'));});}}}function endRouting(_0x543cfb,_0x34ca2d,_0x27a2ab,_0x45d560){if(_0x543cfb&&_0x34ca2d){_0x34ca2d[_0xc9a1('0x1d')]-=0x1;var _0x57b807={'leaveAt':moment()[_0xc9a1('0xf')](_0xc9a1('0x1f')),'exitAt':moment()[_0xc9a1('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xc9a1('0x37')};logger[_0xc9a1('0x2b')](util['format'](_0xc9a1('0x38'),_0x543cfb,_0x34ca2d[_0xc9a1('0x2d')]));emitChannelQueueInteraction(_0x27a2ab['channel'],_0x34ca2d['name'],_0x27a2ab[_0xc9a1('0x1e')],_0x27a2ab[_0xc9a1('0xe')]['name'],_0x27a2ab[_0xc9a1('0x27')]['id'],![],_0x45d560);if(rpc[_0x27a2ab[_0xc9a1('0x23')]+_0xc9a1('0x2e')]){return rpc[_0x27a2ab[_0xc9a1('0x23')]+_0xc9a1('0x2e')][_0xc9a1('0x35')](_0x543cfb,_0x57b807)[_0xc9a1('0x30')](function(_0x4be893){logger['error'](_0xc9a1('0x36'));});}}}function handleFindQueue(_0x2587c2){return function(_0x2ac260){return _0x2ac260['name'][_0xc9a1('0x39')]()===_0x2587c2[_0xc9a1('0x39')]();};}exports[_0xc9a1('0x3a')]=function(_0x3fd372,_0x5a38b4,_0x37d136,_0x3bf900){return function(_0x521412){try{var _0x1546f3={'name':_0x5a38b4[0x0],'timeout':_0x5a38b4[0x1]};var _0x48fe0f=queue[_0xc9a1('0x0')](_0x1546f3,{'typecast':!![]});if(_0x48fe0f['length']){logger[_0xc9a1('0x31')]('[%s][QUEUE]\x20%s',_0x3fd372,_[_0xc9a1('0x3b')](_0x48fe0f,_0xc9a1('0x27'))['join'](',\x20'));_0x521412['stop']();}else{var _0x2647e5=_[_0xc9a1('0x3c')](_0x37d136[_0x3bf900[_0xc9a1('0x23')]+_0xc9a1('0x3d')],handleFindQueue(_0x1546f3[_0xc9a1('0x2d')]));if(_0x2647e5){startRouting(_0x3fd372,_0x2647e5,_0x3bf900,_0x37d136);var _0x463548=(_0x2647e5[_0xc9a1('0x37')]||0xa)*0x3e8;var _0x2ffb87=(_0x1546f3[_0xc9a1('0x37')]||0x14)*0x3e8;var _0x456261,_0x58d64d;if(_0x463548>_0x2ffb87){_0x2ffb87=_0x463548;}var _0x1e55a6=seqqueue[_0xc9a1('0x3e')](_0x463548);_0x1e55a6['id']=_0x3fd372;_0x1e55a6[_0xc9a1('0x3f')]=_0x463548;_0x1e55a6[_0xc9a1('0x40')]=_0x2ffb87;_0x1e55a6[_0xc9a1('0x23')]=_0x3bf900['channel'];_0x37d136[_0xc9a1('0x41')][_0x3fd372]['on']('end',function(){logger[_0xc9a1('0x2b')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x3fd372);stopRouting(_0x3fd372,_0x2647e5,_0x3bf900,_0x37d136);clearTimeout(_0x456261);_0x456261=undefined;_0x1e55a6['close'](!![]);if(_0x37d136[_0xc9a1('0x41')][_0x3fd372]){delete _0x37d136[_0xc9a1('0x41')][_0x3fd372];}_0x521412[_0xc9a1('0x42')]();});_0x37d136[_0xc9a1('0x41')][_0x3fd372]['on'](_0xc9a1('0x43'),function(){if(_0x37d136[_0xc9a1('0x41')][_0x3fd372]){delete _0x37d136[_0xc9a1('0x41')][_0x3fd372];}});_0x456261=setTimeout(function(){logger[_0xc9a1('0x2b')](_0xc9a1('0x44'),_0x3fd372);endRouting(_0x3fd372,_0x2647e5,_0x3bf900,_0x37d136);clearTimeout(_0x456261);_0x1e55a6[_0xc9a1('0x45')](!![]);_0x521412[_0xc9a1('0x46')]();},_0x2ffb87);switch(_0x2647e5[_0xc9a1('0x47')]){case'rrmemory':strategy[_0xc9a1('0x48')](_0x1e55a6,_0x2647e5,_0x37d136,_0x3bf900);break;default:strategy[_0xc9a1('0x49')](_0x1e55a6,_0x2647e5,_0x37d136,_0x3bf900);}}else{logger[_0xc9a1('0x31')](_0xc9a1('0x4a'),_0x3fd372,_0x1546f3[_0xc9a1('0x2d')]);_0x521412[_0xc9a1('0x42')]();}}}catch(_0x45c243){console[_0xc9a1('0x4b')](_0x45c243);logger['error'](_0xc9a1('0x4c'),_0x3fd372,_0x45c243[_0xc9a1('0x4d')]);_0x521412['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index b07e1d8..8bc3f14 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 _0x002b=['agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','agent','isNil'];(function(_0x4d9812,_0x36ec1f){var _0xd94812=function(_0x419be7){while(--_0x419be7){_0x4d9812['push'](_0x4d9812['shift']());}};_0xd94812(++_0x36ec1f);}(_0x002b,0x132));var _0xb002=function(_0x3e27ba,_0x46b120){_0x3e27ba=_0x3e27ba-0x0;var _0x10b3f2=_0x002b[_0x3e27ba];return _0x10b3f2;};'use strict';var _=require(_0xb002('0x0'));var uuid=require(_0xb002('0x1'));var util=require(_0xb002('0x2'));var logger=require(_0xb002('0x3'))(_0xb002('0x4'));var Agent=function(_0x4107d2,_0xdd7465,_0x5759ed,_0x5655a3){this['notificationId']=uuid['v4']();this[_0xb002('0x5')]=_0x4107d2;this['agent']=_0xdd7465;this[_0xb002('0x6')]=_0x5759ed;this['routing']=_0x5655a3;this[_0xb002('0x5')][_0xb002('0x7')](this[_0xb002('0x8')][_0xb002('0x9')](this),this[_0xb002('0xa')][_0xb002('0x9')](this));this['squeue']['on'](_0xb002('0xb'),this[_0xb002('0xa')][_0xb002('0x9')](this));this[_0xb002('0x5')]['on'](_0xb002('0xc'),this[_0xb002('0xd')][_0xb002('0x9')](this));};Agent[_0xb002('0xe')]['push']=function(){this[_0xb002('0x5')]['push'](this[_0xb002('0x8')][_0xb002('0x9')](this),this[_0xb002('0xa')][_0xb002('0x9')](this));};Agent['prototype'][_0xb002('0xd')]=function(){this[_0xb002('0xa')](!![]);};Agent[_0xb002('0xe')][_0xb002('0x8')]=function(){logger[_0xb002('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xb002('0x5')]['id'],this[_0xb002('0x10')]['id']);if(_[_0xb002('0x11')](this[_0xb002('0x6')][_0xb002('0x12')][this[_0xb002('0x10')]['id']])){logger[_0xb002('0xf')](_0xb002('0x13'),this['squeue']['id'],this[_0xb002('0x10')]['id']);setTimeout(this[_0xb002('0x7')][_0xb002('0x9')](this),0x3e8);}else{if(this[_0xb002('0x4')]['forcedOwnership']||util[_0xb002('0x14')](this['squeue']['id'],this[_0xb002('0x6')]['agents'][this[_0xb002('0x10')]['id']],this[_0xb002('0x5')][_0xb002('0x15')],![])){this[_0xb002('0x6')]['agents'][this[_0xb002('0x10')]['id']][_0xb002('0x16')]=!![];this[_0xb002('0x6')][_0xb002('0x12')][this[_0xb002('0x10')]['id']][_0xb002('0x17')]=undefined;util[_0xb002('0x18')](this[_0xb002('0x19')],this[_0xb002('0x5')]['id'],this[_0xb002('0x6')][_0xb002('0x12')][this[_0xb002('0x10')]['id']],null,this[_0xb002('0x4')]);util[_0xb002('0x1a')](this[_0xb002('0x5')]['id'],this[_0xb002('0x6')][_0xb002('0x12')][this['agent']['id']],_0xb002('0x1b')+(this[_0xb002('0x4')][_0xb002('0x1c')]?_0xb002('0x1d'):''));}else{logger[_0xb002('0xf')](_0xb002('0x1e'),this[_0xb002('0x5')]['id'],this[_0xb002('0x10')]['id']);setTimeout(this[_0xb002('0x7')]['bind'](this),0x3e8);}}};Agent[_0xb002('0xe')]['handleTimeout']=function(_0x29b1b6){if(_['isNil'](this['realtime']['agents'][this[_0xb002('0x10')]['id']])){return logger['debug'](_0xb002('0x13'),this[_0xb002('0x5')]['id'],this['agent']['id']);}else{logger[_0xb002('0xf')](_0xb002('0x1f'),this[_0xb002('0x5')]['id'],this['agent']['id']);util[_0xb002('0x20')](this[_0xb002('0x19')],this[_0xb002('0x5')]['id'],this['realtime'][_0xb002('0x12')][this[_0xb002('0x10')]['id']],null,this[_0xb002('0x4')]);this[_0xb002('0x6')][_0xb002('0x12')][this[_0xb002('0x10')]['id']][_0xb002('0x16')]=![];this[_0xb002('0x6')][_0xb002('0x12')][this[_0xb002('0x10')]['id']]['busyQueue']=undefined;util[_0xb002('0x1a')](this[_0xb002('0x5')]['id'],this[_0xb002('0x6')]['agents'][this['agent']['id']],_0x29b1b6?_0xb002('0x21'):_0xb002('0x22'));}if(!_0x29b1b6){setTimeout(this[_0xb002('0x7')][_0xb002('0x9')](this),0x3e8);}};function agent(_0x530ea3,_0x1fdeae,_0xf47236,_0x4ae2fc){return new Agent(_0x530ea3,_0x1fdeae,_0xf47236,_0x4ae2fc);}module[_0xb002('0x23')]=agent; \ No newline at end of file +var _0x2594=['showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','squeue','realtime','handleRun','bind','handleTimeout','drained','handleDrained','prototype','push','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue'];(function(_0x2cde74,_0x55cf68){var _0x39ee49=function(_0x1e312e){while(--_0x1e312e){_0x2cde74['push'](_0x2cde74['shift']());}};_0x39ee49(++_0x55cf68);}(_0x2594,0x1dc));var _0x4259=function(_0x4aa7e5,_0x234bfb){_0x4aa7e5=_0x4aa7e5-0x0;var _0x3f3ecf=_0x2594[_0x4aa7e5];return _0x3f3ecf;};'use strict';var _=require('lodash');var uuid=require(_0x4259('0x0'));var util=require(_0x4259('0x1'));var logger=require('../../../../../config/logger')(_0x4259('0x2'));var Agent=function(_0x52aae9,_0x2bdc9e,_0x14faae,_0x2d3536){this['notificationId']=uuid['v4']();this[_0x4259('0x3')]=_0x52aae9;this['agent']=_0x2bdc9e;this[_0x4259('0x4')]=_0x14faae;this[_0x4259('0x2')]=_0x2d3536;this[_0x4259('0x3')]['push'](this[_0x4259('0x5')][_0x4259('0x6')](this),this[_0x4259('0x7')][_0x4259('0x6')](this));this['squeue']['on']('timeout',this[_0x4259('0x7')][_0x4259('0x6')](this));this['squeue']['on'](_0x4259('0x8'),this[_0x4259('0x9')][_0x4259('0x6')](this));};Agent[_0x4259('0xa')][_0x4259('0xb')]=function(){this[_0x4259('0x3')][_0x4259('0xb')](this[_0x4259('0x5')][_0x4259('0x6')](this),this['handleTimeout']['bind'](this));};Agent[_0x4259('0xa')][_0x4259('0x9')]=function(){this[_0x4259('0x7')](!![]);};Agent['prototype'][_0x4259('0x5')]=function(){logger[_0x4259('0xc')](_0x4259('0xd'),this[_0x4259('0x3')]['id'],this['agent']['id']);if(_[_0x4259('0xe')](this[_0x4259('0x4')][_0x4259('0xf')][this[_0x4259('0x10')]['id']])){logger['debug'](_0x4259('0x11'),this[_0x4259('0x3')]['id'],this[_0x4259('0x10')]['id']);setTimeout(this['push'][_0x4259('0x6')](this),0x3e8);}else{if(this[_0x4259('0x2')]['forcedOwnership']||util['isAgentAvailable'](this[_0x4259('0x3')]['id'],this[_0x4259('0x4')][_0x4259('0xf')][this[_0x4259('0x10')]['id']],this[_0x4259('0x3')]['channel'],![])){this[_0x4259('0x4')]['agents'][this[_0x4259('0x10')]['id']][_0x4259('0x12')]=!![];this[_0x4259('0x4')][_0x4259('0xf')][this[_0x4259('0x10')]['id']][_0x4259('0x13')]=undefined;util[_0x4259('0x14')](this[_0x4259('0x15')],this[_0x4259('0x3')]['id'],this['realtime'][_0x4259('0xf')][this[_0x4259('0x10')]['id']],null,this[_0x4259('0x2')]);util[_0x4259('0x16')](this[_0x4259('0x3')]['id'],this['realtime']['agents'][this[_0x4259('0x10')]['id']],_0x4259('0x17')+(this[_0x4259('0x2')]['forcedOwnership']?_0x4259('0x18'):''));}else{logger[_0x4259('0xc')](_0x4259('0x19'),this[_0x4259('0x3')]['id'],this[_0x4259('0x10')]['id']);setTimeout(this[_0x4259('0xb')][_0x4259('0x6')](this),0x3e8);}}};Agent['prototype'][_0x4259('0x7')]=function(_0x5a9ec8){if(_[_0x4259('0xe')](this[_0x4259('0x4')][_0x4259('0xf')][this[_0x4259('0x10')]['id']])){return logger['debug'](_0x4259('0x11'),this[_0x4259('0x3')]['id'],this[_0x4259('0x10')]['id']);}else{logger[_0x4259('0xc')](_0x4259('0x1a'),this['squeue']['id'],this[_0x4259('0x10')]['id']);util[_0x4259('0x1b')](this[_0x4259('0x15')],this['squeue']['id'],this['realtime'][_0x4259('0xf')][this[_0x4259('0x10')]['id']],null,this['routing']);this['realtime'][_0x4259('0xf')][this[_0x4259('0x10')]['id']][_0x4259('0x12')]=![];this[_0x4259('0x4')][_0x4259('0xf')][this[_0x4259('0x10')]['id']][_0x4259('0x13')]=undefined;util['writeLog'](this['squeue']['id'],this[_0x4259('0x4')][_0x4259('0xf')][this[_0x4259('0x10')]['id']],_0x5a9ec8?_0x4259('0x1c'):_0x4259('0x1d'));}if(!_0x5a9ec8){setTimeout(this[_0x4259('0xb')][_0x4259('0x6')](this),0x3e8);}};function agent(_0x3730e9,_0x588487,_0x77b47d,_0x233fe7){return new Agent(_0x3730e9,_0x588487,_0x77b47d,_0x233fe7);}module[_0x4259('0x1e')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 4882668..2836ff3 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 _0x0624=['queue','Agents','length','debug','agents','channel','writeLog','busy','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','busyQueue','exports','routing','notificationId','realtime','squeue','push','handleRun','handleTimeout','timeout','bind','drained','handleDrained','prototype','isNil'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x0624,0x132));var _0x4062=function(_0x2466d3,_0x5e11b0){_0x2466d3=_0x2466d3-0x0;var _0x466602=_0x0624[_0x2466d3];return _0x466602;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')(_0x4062('0x0'));var Beepall=function(_0x144406,_0x106cf5,_0x3b4af5,_0x29add8){this[_0x4062('0x1')]=uuid['v4']();this['squeue']=_0x144406;this['queue']=_0x106cf5;this[_0x4062('0x2')]=_0x3b4af5;this[_0x4062('0x0')]=_0x29add8;this[_0x4062('0x3')][_0x4062('0x4')](this[_0x4062('0x5')]['bind'](this),this[_0x4062('0x6')]['bind'](this));this[_0x4062('0x3')]['on'](_0x4062('0x7'),this[_0x4062('0x6')][_0x4062('0x8')](this));this[_0x4062('0x3')]['on'](_0x4062('0x9'),this[_0x4062('0xa')]['bind'](this));};Beepall[_0x4062('0xb')]['push']=function(){this[_0x4062('0x3')][_0x4062('0x4')](this[_0x4062('0x5')][_0x4062('0x8')](this),this[_0x4062('0x6')]['bind'](this));};Beepall[_0x4062('0xb')][_0x4062('0xa')]=function(){this['handleTimeout'](!![]);};Beepall[_0x4062('0xb')][_0x4062('0x5')]=function(){var _0x95bb42=!![];if(!_['isNil'](this['queue'])&&!_[_0x4062('0xc')](this[_0x4062('0xd')]['Agents'])&&this['queue']['Agents']['length']>0x0){for(var _0x437432=0x0,_0x501045;_0x4374320x0){for(var _0x46d2c4=0x0,_0x16ab1e;_0x46d2c40x0&&_0x486de2[_0x396646+_0xaf2c('0x24')]>=_0x486de2[_0x396646+_0xaf2c('0x25')]){writeLog(_0x237318,_0x486de2,_0x396646[_0xaf2c('0x26')]()+_0xaf2c('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x29f8b0,_0x2051be,_0x36f37c,_0x410536,_0x4b7cf2){return sendNotification(!![],_0x29f8b0,_0x2051be,_0x36f37c,_0x410536,_0x4b7cf2);};exports[_0xaf2c('0x28')]=function(_0x589d47,_0x38db1b,_0x42f980,_0x15466b,_0x5d685a){return sendNotification(![],_0x589d47,_0x38db1b,_0x42f980,_0x15466b,_0x5d685a);};exports[_0xaf2c('0x29')]=writeLog; \ No newline at end of file +var _0x3e74=['isAgentAvailable','busy','BUSY','online','Pause','Capacity','hasOwnProperty','\x20MAXCAPACITY','showNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','redis','localhost','socket.io-emitter','format','name','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','user:%s','emit','notification:%s','save','remove','debug'];(function(_0x2db84d,_0x3dca86){var _0x585e55=function(_0xf52287){while(--_0xf52287){_0x2db84d['push'](_0x2db84d['shift']());}};_0x585e55(++_0x3dca86);}(_0x3e74,0x175));var _0x43e7=function(_0x6d97dc,_0x3a7761){_0x6d97dc=_0x6d97dc-0x0;var _0x1572e3=_0x3e74[_0x6d97dc];return _0x1572e3;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var utils=require(_0x43e7('0x1'));var Redis=require(_0x43e7('0x2'));var config=require(_0x43e7('0x3'));var logger=require('../../../../../config/logger')('routing');config[_0x43e7('0x4')]=_['defaults'](config[_0x43e7('0x4')],{'host':_0x43e7('0x5'),'port':0x18eb});var io=require(_0x43e7('0x6'))(new Redis(config[_0x43e7('0x4')]));function sendNotification(_0xc98b9c,_0x503698,_0x45a0d1,_0x3491d6,_0x2ede2d,_0x8528fc){io['to'](util[_0x43e7('0x7')]('user:%s',_0x3491d6[_0x43e7('0x8')]))['emit']('user:save',_0x3491d6);var _0x39c8bd=_0x8528fc||{};var _0x4139c9=_0x45a0d1['split']('.');var _0x2803d9={'uniqueid':_0x503698,'channel':_0x4139c9[0x0],'id':_0x4139c9[0x1],'title':_0x4139c9[0x0]+'\x20interaction','interactionId':_0x4139c9[0x2],'queue':_0x2ede2d?_0x2ede2d[_0x43e7('0x8')]:null,'sound':_0x39c8bd[_0x43e7('0x9')]['notificationSound'],'shake':_0x39c8bd[_0x43e7('0x9')][_0x43e7('0xa')]};try{if(!_0x39c8bd[_0x43e7('0xb')]){_0x39c8bd[_0x43e7('0xb')]={};}if(_0x2ede2d){_0x39c8bd['body']['queue']=_0x2ede2d;}else if(_0x39c8bd[_0x43e7('0xb')][_0x43e7('0xc')]){delete _0x39c8bd[_0x43e7('0xb')]['queue'];}_0x2803d9['msg']=utils[_0x43e7('0xd')](_0x39c8bd[_0x43e7('0x9')][_0x43e7('0xe')],_0x39c8bd);}catch(_0x328445){_0x2803d9['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0x43e7('0xf')](util[_0x43e7('0x7')](_0x43e7('0x10'),_0x503698,_0x328445['message']));}io['to'](util['format'](_0x43e7('0x11'),_0x3491d6[_0x43e7('0x8')]))[_0x43e7('0x12')](util[_0x43e7('0x7')](_0x43e7('0x13'),_0xc98b9c?_0x43e7('0x14'):_0x43e7('0x15')),_0x2803d9);}function writeLog(_0x1441ef,_0x2377a3,_0xab63cf){return logger[_0x43e7('0x16')](util[_0x43e7('0x7')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1441ef,_0x2377a3[_0x43e7('0x8')],_0xab63cf));}exports[_0x43e7('0x17')]=function(_0x4b386b,_0x2898b5,_0x3e281e,_0x3945bb){if(_0x2898b5[_0x43e7('0x18')]){writeLog(_0x4b386b,_0x2898b5,_0x43e7('0x19'));return![];}if(!_0x2898b5[_0x43e7('0x1a')]){writeLog(_0x4b386b,_0x2898b5,'OFFLINE');return![];}if(_0x2898b5[_0x3e281e+_0x43e7('0x1b')]){writeLog(_0x4b386b,_0x2898b5,'PAUSE');return![];}if(_0x3945bb&&_0x2898b5['hasOwnProperty'](_0x3e281e+_0x43e7('0x1c'))&&_0x2898b5[_0x43e7('0x1d')](_0x3e281e+'CurrentCapacity')){if(_0x2898b5[_0x3e281e+_0x43e7('0x1c')]>0x0&&_0x2898b5[_0x3e281e+'CurrentCapacity']>=_0x2898b5[_0x3e281e+_0x43e7('0x1c')]){writeLog(_0x4b386b,_0x2898b5,_0x3e281e['toUpperCase']()+_0x43e7('0x1e'));return![];}}return!![];};exports[_0x43e7('0x1f')]=function(_0x20888b,_0x405f85,_0x51f4d7,_0x52b7b3,_0x805b54){return sendNotification(!![],_0x20888b,_0x405f85,_0x51f4d7,_0x52b7b3,_0x805b54);};exports['hideNotification']=function(_0x2dd5f,_0x40dc8f,_0x3565cf,_0xb1fc63,_0x5087d7){return sendNotification(![],_0x2dd5f,_0x40dc8f,_0x3565cf,_0xb1fc63,_0x5087d7);};exports[_0x43e7('0x20')]=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 6ea19f1..ca494d5 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 _0xb73b=['isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','./utils','../../../../config/logger','routing','string','consequence','length','[%s][SYSTEM]\x20%s','map','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim'];(function(_0x167e54,_0x540dc1){var _0x139468=function(_0x43388f){while(--_0x43388f){_0x167e54['push'](_0x167e54['shift']());}};_0x139468(++_0x540dc1);}(_0xb73b,0x14f));var _0xbb73=function(_0x5d20a5,_0x207bc1){_0x5d20a5=_0x5d20a5-0x0;var _0x4380aa=_0xb73b[_0x5d20a5];return _0x4380aa;};'use strict';var schema=require(_0xbb73('0x0'));var sh=require(_0xbb73('0x1'));var _=require('lodash');var utils=require(_0xbb73('0x2'));var logger=require(_0xbb73('0x3'))(_0xbb73('0x4'));var system=schema({'command':{'type':_0xbb73('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xbb73('0x6')]=function(_0x5cc1af,_0x2e91f7){return function(_0x5cc835){try{var _0x32262={'command':_0x2e91f7[0x0]};var _0x33b17c=system['validate'](_0x32262,{'typecast':!![]});if(_0x33b17c[_0xbb73('0x7')]){logger['error'](_0xbb73('0x8'),_0x5cc1af,_[_0xbb73('0x9')](_0x33b17c,'message')['join'](',\x20'));logger[_0xbb73('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5cc1af);_0x5cc835['next']();}else{var _0x4aeb0d=this;var _0x31931d=utils[_0xbb73('0xb')](_0x2e91f7[0x0],this);logger[_0xbb73('0xa')](_0xbb73('0xc'),_0x5cc1af,_0x31931d);sh[_0xbb73('0xd')](_[_0xbb73('0xe')](_0x31931d),function(_0x4f6e1f,_0x4dda10){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x5cc1af,_0x4f6e1f);if(_0x4f6e1f==0x0){var _0x30b6cd=_0x4dda10['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xbb73('0xf')](_0x2e91f7[0x1])||_[_0xbb73('0x10')](_0x2e91f7[0x1])){logger[_0xbb73('0xa')](_0xbb73('0x11'),_0x5cc1af);_0x4aeb0d[_0xbb73('0x12')][_0x2e91f7[0x1]]=_0x30b6cd;}else{logger[_0xbb73('0xa')](_0xbb73('0x13'),_0x5cc1af,_0x2e91f7[0x1],_0x30b6cd);_0x4aeb0d[_0xbb73('0x12')][_0x2e91f7[0x1]]=_0x30b6cd;}}_0x5cc835[_0xbb73('0x14')]();});}}catch(_0x3b2861){logger[_0xbb73('0x15')]('[%s][SYSTEM]\x20%s',_0x5cc1af,_[_0xbb73('0x16')](_0x3b2861)?JSON[_0xbb73('0x17')](_0x3b2861):_0x3b2861);logger[_0xbb73('0xa')](_0xbb73('0x18'),_0x5cc1af);_0x5cc835[_0xbb73('0x14')]();}};}; \ No newline at end of file +var _0x18ab=['exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','message','join','info','next','getMustacheRender'];(function(_0x45d9fe,_0xd8baa4){var _0x55a029=function(_0x5c5100){while(--_0x5c5100){_0x45d9fe['push'](_0x45d9fe['shift']());}};_0x55a029(++_0xd8baa4);}(_0x18ab,0xd2));var _0xb18a=function(_0x234250,_0x129c35){_0x234250=_0x234250-0x0;var _0x3919d8=_0x18ab[_0x234250];return _0x3919d8;};'use strict';var schema=require(_0xb18a('0x0'));var sh=require(_0xb18a('0x1'));var _=require(_0xb18a('0x2'));var utils=require(_0xb18a('0x3'));var logger=require(_0xb18a('0x4'))(_0xb18a('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xb18a('0x6')}});exports[_0xb18a('0x7')]=function(_0x260f23,_0x3d1990){return function(_0x48fe50){try{var _0x1e5da1={'command':_0x3d1990[0x0]};var _0x4cccff=system[_0xb18a('0x0')](_0x1e5da1,{'typecast':!![]});if(_0x4cccff[_0xb18a('0x8')]){logger['error'](_0xb18a('0x9'),_0x260f23,_['map'](_0x4cccff,_0xb18a('0xa'))[_0xb18a('0xb')](',\x20'));logger[_0xb18a('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x260f23);_0x48fe50[_0xb18a('0xd')]();}else{var _0x2b3ccc=this;var _0x4a6e05=utils[_0xb18a('0xe')](_0x3d1990[0x0],this);logger[_0xb18a('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x260f23,_0x4a6e05);sh[_0xb18a('0xf')](_[_0xb18a('0x10')](_0x4a6e05),function(_0x132090,_0x9170fc){logger[_0xb18a('0xc')](_0xb18a('0x11'),_0x260f23,_0x132090);if(_0x132090==0x0){var _0x5da8a6=_0x9170fc[_0xb18a('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3d1990[0x1])||_[_0xb18a('0x13')](_0x3d1990[0x1])){logger['info'](_0xb18a('0x14'),_0x260f23);_0x2b3ccc[_0xb18a('0x15')][_0x3d1990[0x1]]=_0x5da8a6;}else{logger[_0xb18a('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x260f23,_0x3d1990[0x1],_0x5da8a6);_0x2b3ccc[_0xb18a('0x15')][_0x3d1990[0x1]]=_0x5da8a6;}}_0x48fe50[_0xb18a('0xd')]();});}}catch(_0x33c7e7){logger[_0xb18a('0x16')](_0xb18a('0x9'),_0x260f23,_[_0xb18a('0x17')](_0x33c7e7)?JSON['stringify'](_0x33c7e7):_0x33c7e7);logger['info'](_0xb18a('0x18'),_0x260f23);_0x48fe50[_0xb18a('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index c05cb47..66eeb6c 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 _0x6b3b=['catch','finally','next','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','interaction'];(function(_0x5c2288,_0x588181){var _0x28ed7c=function(_0x29470d){while(--_0x29470d){_0x5c2288['push'](_0x5c2288['shift']());}};_0x28ed7c(++_0x588181);}(_0x6b3b,0x1a5));var _0xb6b3=function(_0x9b925f,_0x3bb715){_0x9b925f=_0x9b925f-0x0;var _0x3e0842=_0x6b3b[_0x9b925f];return _0x3e0842;};'use strict';var schema=require(_0xb6b3('0x0'));var _=require(_0xb6b3('0x1'));var rpc={'chatInteraction':require(_0xb6b3('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xb6b3('0x3')),'mailInteraction':require(_0xb6b3('0x4')),'faxInteraction':require(_0xb6b3('0x5')),'whatsappInteraction':require(_0xb6b3('0x6'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0xb6b3('0x7'),'required':!![],'message':_0xb6b3('0x8')}});exports[_0xb6b3('0x9')]=function(_0x3ebfd6,_0x1835f1,_0x41fe0e,_0x1577c7){return function(_0x1716c4){try{var _0x586851={'tag':_0x1835f1[0x0]};var _0x33a2c3=tag[_0xb6b3('0x0')](_0x586851,{'typecast':!![]});if(_0x33a2c3[_0xb6b3('0xa')]){logger[_0xb6b3('0xb')](_0xb6b3('0xc'),_0x3ebfd6,_[_0xb6b3('0xd')](_0x33a2c3,_0xb6b3('0xe'))[_0xb6b3('0xf')](',\x20'));logger[_0xb6b3('0x10')](_0xb6b3('0x11'),_0x3ebfd6);_0x1716c4['next']();}else{var _0x1cef9d={'ids':[_0x1835f1[0x0]]};if(rpc[_0x1577c7['channel']+_0xb6b3('0x12')]){rpc[_0x1577c7[_0xb6b3('0x13')]+_0xb6b3('0x12')]['addTags'](_0x1577c7[_0xb6b3('0x14')]['id'],_0x1cef9d)['then'](function(_0x540fea){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3ebfd6,_0x1835f1[0x1],_0x1577c7['channel'],_0x1577c7['interaction']['id']);})[_0xb6b3('0x15')](function(_0x36eadc){logger[_0xb6b3('0xb')](_0xb6b3('0xc'),_0x3ebfd6,JSON['stringify'](_0x36eadc));logger[_0xb6b3('0x10')](_0xb6b3('0x11'),_0x3ebfd6);})[_0xb6b3('0x16')](function(){_0x1716c4[_0xb6b3('0x17')]();});}}}catch(_0x55130b){logger[_0xb6b3('0xb')](_0xb6b3('0xc'),_0x3ebfd6,_[_0xb6b3('0x18')](_0x55130b)?JSON[_0xb6b3('0x19')](_0x55130b):_0x55130b);logger[_0xb6b3('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3ebfd6);_0x1716c4[_0xb6b3('0x17')]();}};}; \ No newline at end of file +var _0x26d6=['interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','info','next','channel','Interaction','addTags'];(function(_0x173369,_0x7c0699){var _0x357fc1=function(_0x1d743c){while(--_0x1d743c){_0x173369['push'](_0x173369['shift']());}};_0x357fc1(++_0x7c0699);}(_0x26d6,0x10b));var _0x626d=function(_0xc2b4c8,_0x756a49){_0xc2b4c8=_0xc2b4c8-0x0;var _0x402443=_0x26d6[_0xc2b4c8];return _0x402443;};'use strict';var schema=require(_0x626d('0x0'));var _=require(_0x626d('0x1'));var rpc={'chatInteraction':require(_0x626d('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x626d('0x3')),'mailInteraction':require(_0x626d('0x4')),'faxInteraction':require(_0x626d('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x626d('0x6'))(_0x626d('0x7'));var tag=schema({'tag':{'type':_0x626d('0x8'),'required':!![],'message':_0x626d('0x9')}});exports['consequence']=function(_0x25ec57,_0x5b28f9,_0x5649cf,_0x4aa9f3){return function(_0x1729b4){try{var _0x240563={'tag':_0x5b28f9[0x0]};var _0xe2135d=tag['validate'](_0x240563,{'typecast':!![]});if(_0xe2135d['length']){logger[_0x626d('0xa')](_0x626d('0xb'),_0x25ec57,_[_0x626d('0xc')](_0xe2135d,_0x626d('0xd'))['join'](',\x20'));logger[_0x626d('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x25ec57);_0x1729b4[_0x626d('0xf')]();}else{var _0x499b60={'ids':[_0x5b28f9[0x0]]};if(rpc[_0x4aa9f3[_0x626d('0x10')]+_0x626d('0x11')]){rpc[_0x4aa9f3[_0x626d('0x10')]+'Interaction'][_0x626d('0x12')](_0x4aa9f3[_0x626d('0x13')]['id'],_0x499b60)[_0x626d('0x14')](function(_0x1b5bc0){logger[_0x626d('0xe')](_0x626d('0x15'),_0x25ec57,_0x5b28f9[0x1],_0x4aa9f3['channel'],_0x4aa9f3[_0x626d('0x13')]['id']);})[_0x626d('0x16')](function(_0x135b5b){logger[_0x626d('0xa')](_0x626d('0xb'),_0x25ec57,JSON['stringify'](_0x135b5b));logger['info'](_0x626d('0x17'),_0x25ec57);})[_0x626d('0x18')](function(){_0x1729b4['next']();});}}}catch(_0x1a93fd){logger['error'](_0x626d('0xb'),_0x25ec57,_[_0x626d('0x19')](_0x1a93fd)?JSON['stringify'](_0x1a93fd):_0x1a93fd);logger[_0x626d('0xe')](_0x626d('0x17'),_0x25ec57);_0x1729b4['next']();}};}; \ 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 4b8c387..6df8ae9 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 _0x5778=['stringify','POST','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params'];(function(_0x226cda,_0x54ccf6){var _0x4febdb=function(_0xe371a6){while(--_0xe371a6){_0x226cda['push'](_0x226cda['shift']());}};_0x4febdb(++_0x54ccf6);}(_0x5778,0x144));var _0x8577=function(_0xcd206,_0x597dab){_0xcd206=_0xcd206-0x0;var _0x5599bc=_0x5778[_0xcd206];return _0x5599bc;};'use strict';var rp=require(_0x8577('0x0'));var logger=require(_0x8577('0x1'))(_0x8577('0x2'));var _=require('lodash');var arr=[];exports[_0x8577('0x3')]=function(_0x8892b3,_0x7a89b3){return function(_0x455d7e){var _0x1b814b=_0x7a89b3[0xa];var _0x21d8f8=_0x7a89b3[0xb];var _0x1d15dd=_0x7a89b3[0xc];var _0x23bbd5=_0x7a89b3[0xd];var _0x13e21c=_0x7a89b3[0xe];var _0x3adc18=_0x7a89b3[0xf][_0x8577('0x4')](/\n/g,_0x8577('0x5'));var _0x348ae7=_0x7a89b3[0x10][_0x8577('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x21d8f8)){arr[_0x8577('0x6')](_0x21d8f8);var _0x26611c=_0x7a89b3[0x3];var _0x3bfda0=_0x7a89b3[0x4];var _0x23998f=_0x7a89b3[0x1];var _0x29b207=_0x7a89b3[0x0];var _0x37d088={};_0x37d088[_0x8577('0x7')]=_0x7a89b3[0x8]+_0x8577('0x8')+_0x1d15dd+'|'+_0x1b814b+'|'+_0x23bbd5+'|'+_0x21d8f8+'|'+_0x13e21c;_0x37d088[_0x8577('0x9')]=_0x7a89b3[0x7]+_0x8577('0x8')+_0x1d15dd+'|'+_0x1b814b+'|'+_0x23bbd5+'|'+_0x21d8f8+'|'+_0x13e21c+'|'+_0x3adc18+'|'+_0x348ae7;_0x37d088[_0x8577('0xa')]=_0x7a89b3[0x9];var _0x503b07={};_0x503b07[_0x8577('0xb')]=_0x8577('0xc');_0x503b07[_0x8577('0xd')]=_0x8577('0xe');var _0x554952=[];_0x554952[_0x8577('0x6')](_0x7a89b3[0x2]);_0x554952[_0x8577('0x6')](_0x7a89b3[0x5]);_0x554952[_0x8577('0x6')](_0x7a89b3[0x6]);_0x503b07[_0x8577('0xf')]=_0x554952;_0x503b07['id']=0x1;var _0xe6ea8a=JSON[_0x8577('0x10')](_0x503b07);var _0x5516c1={'encoding':'utf8','method':_0x8577('0x11'),'timeout':0x2710,'url':_0x26611c,'headers':{'Content-Type':'application/json-rpc'},'body':_0xe6ea8a};return rp(_0x5516c1)[_0x8577('0x12')](function(_0xe67dfe){const _0x1fec93=JSON['parse'](_0xe67dfe);if(!_0x1fec93[_0x8577('0x13')][_0x8577('0x14')]){throw new Error(_0x8577('0x15'));}var _0x1a1403=_0x21d8f8;var _0x356aca='channelId='+_0x23998f+_0x8577('0x16')+_0x29b207+_0x8577('0x17')+_0x1a1403+_0x8577('0x18')+JSON['stringify'](_0x37d088);var _0x4f7f74=_0x3bfda0+'?'+_0x356aca;return rp(_0x4f7f74);})[_0x8577('0x12')](function(_0x5a60da){logger[_0x8577('0x19')](_0x8577('0x1a'),_0x8892b3,_0x5a60da);_0x455d7e[_0x8577('0x1b')]();})[_0x8577('0x1c')](function(_0x3bf349){logger[_0x8577('0x1d')](_0x8577('0x1e'),_0x8892b3,_[_0x8577('0x1f')](_0x3bf349)?JSON[_0x8577('0x10')](_0x3bf349):_0x3bf349);_0x455d7e[_0x8577('0x1b')]();});}else{logger[_0x8577('0x19')](_0x8577('0x20'),_0x8892b3);_0x455d7e[_0x8577('0x21')]();}};}; \ No newline at end of file +var _0x2c64=['result','Unable\x20to\x20login\x20with\x20TVox\x20application','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','params','stringify','utf8','application/json-rpc','then'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x2c64,0x167));var _0x42c6=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0x2c64[_0x1e172a];return _0x96338b;};'use strict';var rp=require(_0x42c6('0x0'));var logger=require(_0x42c6('0x1'))(_0x42c6('0x2'));var _=require('lodash');var arr=[];exports[_0x42c6('0x3')]=function(_0x2e15e3,_0x3fdfa7){return function(_0x19bef7){var _0x11ab04=_0x3fdfa7[0xa];var _0x9b3e4e=_0x3fdfa7[0xb];var _0x4ced32=_0x3fdfa7[0xc];var _0x2951b0=_0x3fdfa7[0xd];var _0x4a8a33=_0x3fdfa7[0xe];var _0x27bbec=_0x3fdfa7[0xf][_0x42c6('0x4')](/\n/g,_0x42c6('0x5'));var _0x5e96fb=_0x3fdfa7[0x10][_0x42c6('0x4')](/\n/g,'\x20');if(!arr[_0x42c6('0x6')](_0x9b3e4e)){arr[_0x42c6('0x7')](_0x9b3e4e);var _0x5ced82=_0x3fdfa7[0x3];var _0x3882a3=_0x3fdfa7[0x4];var _0x5123b9=_0x3fdfa7[0x1];var _0x52869b=_0x3fdfa7[0x0];var _0x57536b={};_0x57536b[_0x42c6('0x8')]=_0x3fdfa7[0x8]+_0x42c6('0x9')+_0x4ced32+'|'+_0x11ab04+'|'+_0x2951b0+'|'+_0x9b3e4e+'|'+_0x4a8a33;_0x57536b[_0x42c6('0xa')]=_0x3fdfa7[0x7]+_0x42c6('0x9')+_0x4ced32+'|'+_0x11ab04+'|'+_0x2951b0+'|'+_0x9b3e4e+'|'+_0x4a8a33+'|'+_0x27bbec+'|'+_0x5e96fb;_0x57536b[_0x42c6('0xb')]=_0x3fdfa7[0x9];var _0x575191={};_0x575191[_0x42c6('0xc')]='2.0';_0x575191[_0x42c6('0xd')]='login';var _0x3329b2=[];_0x3329b2[_0x42c6('0x7')](_0x3fdfa7[0x2]);_0x3329b2[_0x42c6('0x7')](_0x3fdfa7[0x5]);_0x3329b2[_0x42c6('0x7')](_0x3fdfa7[0x6]);_0x575191[_0x42c6('0xe')]=_0x3329b2;_0x575191['id']=0x1;var _0x4a3b4d=JSON[_0x42c6('0xf')](_0x575191);var _0x13a04b={'encoding':_0x42c6('0x10'),'method':'POST','timeout':0x2710,'url':_0x5ced82,'headers':{'Content-Type':_0x42c6('0x11')},'body':_0x4a3b4d};return rp(_0x13a04b)[_0x42c6('0x12')](function(_0x57a99d){const _0x501d0e=JSON['parse'](_0x57a99d);if(!_0x501d0e[_0x42c6('0x13')]['logged']){throw new Error(_0x42c6('0x14'));}var _0x543de1=_0x9b3e4e;var _0x584d5='channelId='+_0x5123b9+'&serviceId='+_0x52869b+'&sessionId='+_0x543de1+'&data='+JSON[_0x42c6('0xf')](_0x57536b);var _0x439276=_0x3882a3+'?'+_0x584d5;return rp(_0x439276);})['then'](function(_0x192d53){logger[_0x42c6('0x15')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x2e15e3,_0x192d53);_0x19bef7[_0x42c6('0x16')]();})[_0x42c6('0x17')](function(_0x1aa8ed){logger[_0x42c6('0x18')](_0x42c6('0x19'),_0x2e15e3,_[_0x42c6('0x1a')](_0x1aa8ed)?JSON[_0x42c6('0xf')](_0x1aa8ed):_0x1aa8ed);_0x19bef7[_0x42c6('0x16')]();});}else{logger[_0x42c6('0x15')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x2e15e3);_0x19bef7['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 6c57e7c..1ffffbe 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(_0x4c8a56,_0x1a6858){var _0xf2aa95=function(_0x180a20){while(--_0x180a20){_0x4c8a56['push'](_0x4c8a56['shift']());}};_0xf2aa95(++_0x1a6858);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x1b39a2,_0x4a2a0c){var _0x1c62c1=function(_0x4e019f){while(--_0x4e019f){_0x1b39a2['push'](_0x1b39a2['shift']());}};_0x1c62c1(++_0x4a2a0c);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 2f10cc0..a053dac 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 _0x19ea=['dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','end','QueueReport','update','UserId','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','length'];(function(_0x14dc9a,_0xce613e){var _0xb0a219=function(_0xfaba0d){while(--_0xfaba0d){_0x14dc9a['push'](_0x14dc9a['shift']());}};_0xb0a219(++_0xce613e);}(_0x19ea,0xfe));var _0xa19e=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x19ea[_0x234ae1];return _0x227ba0;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xa19e('0x1'));var BPromise=require('bluebird');var utils=require(_0xa19e('0x2'));var logger=require(_0xa19e('0x3'))(_0xa19e('0x4'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xa19e('0x5')),'smsQueueReport':require(_0xa19e('0x6')),'faxQueueReport':require(_0xa19e('0x7')),'whatsappQueueReport':require(_0xa19e('0x8'))};var RuleEngine=require(_0xa19e('0x9'));function getId(_0x30fd4a,_0x336e23,_0x1867cb){return util[_0xa19e('0xa')](_0xa19e('0xb'),_0x30fd4a,_0x336e23||0x0,_0x1867cb||0x0);}function getIntervals(_0x349a7f,_0x59b907){var _0xc9a851=[];if(!_[_0xa19e('0xc')](_0x59b907[_0xa19e('0xd')])&&!_[_0xa19e('0xc')](_0x349a7f[_0x59b907['IntervalId']])&&!_[_0xa19e('0xc')](_0x349a7f[_0x59b907[_0xa19e('0xd')]][_0xa19e('0xe')])){_0xc9a851=_['map'](_0x349a7f[_0x59b907[_0xa19e('0xd')]][_0xa19e('0xe')],_0xa19e('0xf'));}else if(!_[_0xa19e('0xc')](_0x59b907[_0xa19e('0xf')])){_0xc9a851=[_0x59b907['interval']];}return _0xc9a851;}exports[_0xa19e('0x10')]=function(_0x1e5420){_0x1e5420[_0xa19e('0x11')]={};return new BPromise(function(_0x28dedd,_0x564d2a){var _0x3c6425={'Start':function(_0x28555e){var _0x245bcb=this;return new Promise(function(_0x3be281,_0x1fdea2){if(_0x28555e){try{var _0x2598f5=[];var _0x48530c=getId(_0x28555e[_0xa19e('0x12')],_0x28555e[_0xa19e('0x13')]?_0x28555e[_0xa19e('0x13')]['id']:0x0,_0x28555e[_0xa19e('0x14')]?_0x28555e[_0xa19e('0x14')]['id']:0x0);if(_0x28555e[_0xa19e('0x15')]&&_[_0xa19e('0x16')](_0x28555e['applications'])&&_0x28555e[_0xa19e('0x15')]['length']){for(var _0x265f96=0x0;_0x265f96<_0x28555e['applications']['length'];_0x265f96+=0x1){var _0x4c9078=_0x28555e[_0xa19e('0x15')][_0x265f96];if(fs['existsSync'](path[_0xa19e('0x17')](__dirname,_0xa19e('0x15'),_0x4c9078[_0xa19e('0x18')]+_0xa19e('0x19')))){var _0x5869c8=[];switch(_0x4c9078[_0xa19e('0x18')][_0xa19e('0x1a')]()){case _0xa19e('0x1b'):var _0x301f6d=_0x4c9078[_0xa19e('0x1c')][_0xa19e('0x1d')](',');if(_0x28555e[_0xa19e('0x12')]===_0xa19e('0x1e')){_0x5869c8[_0xa19e('0x1f')](_0x301f6d[0x0]);_0x5869c8['push'](_0x301f6d[0x1]);_0x5869c8[_0xa19e('0x1f')](_0x301f6d[_0xa19e('0x20')](0x2,_0x301f6d['length'])[_0xa19e('0x17')](','));}else{_0x5869c8[_0xa19e('0x1f')](_0x301f6d[0x0]);_0x5869c8['push'](_0x301f6d[_0xa19e('0x20')](0x1,_0x301f6d[_0xa19e('0x21')])['join'](','));}break;case _0xa19e('0x22'):var _0x10682d=_0x4c9078[_0xa19e('0x1c')][_0xa19e('0x1d')](',');_0x5869c8[_0xa19e('0x1f')](_0x10682d[0x0]);_0x5869c8[_0xa19e('0x1f')](_0x10682d[0x1]);_0x5869c8[_0xa19e('0x1f')](_0x10682d[_0xa19e('0x20')](0x2,_0x10682d[_0xa19e('0x21')])[_0xa19e('0x17')](','));break;case _0xa19e('0x23'):var _0x3d1cae=_0x4c9078[_0xa19e('0x1c')][_0xa19e('0x1d')](',');_0x5869c8[_0xa19e('0x1f')](_0x3d1cae[0x0]);_0x5869c8[_0xa19e('0x1f')](_0x3d1cae[0x1]);_0x5869c8[_0xa19e('0x1f')](_0x3d1cae[0x2]);_0x5869c8[_0xa19e('0x1f')](_0x3d1cae[0x3]);_0x5869c8[_0xa19e('0x1f')](_0x3d1cae[_0xa19e('0x20')](0x4,_0x3d1cae['length'])[_0xa19e('0x17')](','));break;case _0xa19e('0x24'):var _0xbb5987=_0x4c9078[_0xa19e('0x1c')][_0xa19e('0x1d')](',');_0x5869c8[_0xa19e('0x1f')](_0xbb5987[0x0]);_0x5869c8['push'](_0xbb5987[0x1]);_0x5869c8[_0xa19e('0x1f')](_0xbb5987[0x2]);_0x5869c8[_0xa19e('0x1f')](_0xbb5987[0x3]);_0x5869c8['push'](_0xbb5987[_0xa19e('0x20')](0x4,_0xbb5987['length'])['join'](','));break;case _0xa19e('0x13'):_0x5869c8['push'](_0x4c9078['appdata']);break;case'tag':_0x5869c8[_0xa19e('0x1f')](_0x4c9078[_0xa19e('0x25')]);_0x5869c8[_0xa19e('0x1f')](_0x4c9078['appdata']);break;case _0xa19e('0x26'):var _0x3f959c=utils[_0xa19e('0x27')](_0x28555e[_0xa19e('0x28')][_0xa19e('0x29')],_0x28555e);var _0x2c5592=_0x4c9078['appdata'][_0xa19e('0x1d')](',');_0x5869c8[_0xa19e('0x1f')](_0x2c5592[0x0]);_0x5869c8['push'](_0x2c5592[0x1]);_0x5869c8[_0xa19e('0x1f')](_0x2c5592[0x2]);_0x5869c8[_0xa19e('0x1f')](_0x2c5592[0x3]);_0x5869c8[_0xa19e('0x1f')](_0x2c5592[0x4]);_0x5869c8['push'](_0x2c5592[0x5]);_0x5869c8['push'](_0x2c5592[0x6]);_0x5869c8[_0xa19e('0x1f')](_0x2c5592[0x7]);_0x5869c8['push'](_0x2c5592[0x8]);_0x5869c8[_0xa19e('0x1f')](_0x2c5592[0x9]);_0x5869c8[_0xa19e('0x1f')](_0x2c5592[0xa]);_0x5869c8[_0xa19e('0x1f')](_0x28555e[_0xa19e('0x14')]['id']);_0x5869c8['push'](_0x28555e[_0xa19e('0x13')]['id']);_0x5869c8[_0xa19e('0x1f')](_0x4c9078['ChatWebsiteId']);_0x5869c8[_0xa19e('0x1f')](_0x28555e['interaction'][_0xa19e('0x2a')]);_0x5869c8[_0xa19e('0x1f')](_0x28555e[_0xa19e('0x2b')]['body']);_0x5869c8[_0xa19e('0x1f')](_0x3f959c);break;default:_0x5869c8=_[_0xa19e('0xc')](_0x4c9078[_0xa19e('0x1c')])?[]:_0x4c9078['appdata'][_0xa19e('0x1d')](',');}var _0x244ee5={'id':util['format']('%s:%s:%s',_0x48530c,_0x4c9078['id'],_0x4c9078[_0xa19e('0x18')]),'condition':require(_0xa19e('0x2c'))['condition'](_0x48530c,getIntervals(_0x1e5420[_0xa19e('0x2d')],_0x4c9078),_0x1e5420),'consequence':require(_0xa19e('0x2e')+_0x4c9078['app'])[_0xa19e('0x2f')](_0x48530c,_0x5869c8,_0x1e5420,_0x28555e),'p':_0x4c9078[_0xa19e('0x30')]||0x0};logger[_0xa19e('0x31')](_0xa19e('0x32'),_0x244ee5['id'],_0xa19e('0x33'),getIntervals(_0x1e5420['intervals'],_0x4c9078)[_0xa19e('0x17')](_0xa19e('0x34')));_0x2598f5[_0xa19e('0x1f')](_0x244ee5);}else{logger[_0xa19e('0x35')](_0xa19e('0x36'),path['join'](__dirname,_0xa19e('0x15'),_0x4c9078['app']+_0xa19e('0x19')));}}_0x1e5420[_0xa19e('0x11')][_0x48530c]=new RuleEngine(_0x2598f5);_0x1e5420['rules'][_0x48530c][_0xa19e('0x37')](_0x28555e,function(_0x19a712){logger['info'](_0xa19e('0x38'),JSON['stringify'](_0x19a712[_0xa19e('0x39')]));if(_0x1e5420[_0xa19e('0x11')][_0x48530c]){_0x1e5420[_0xa19e('0x11')][_0x48530c][_0xa19e('0x3a')](_0xa19e('0x3b'));}});return _0x3be281({'code':0xc8,'message':_0x28555e});}else{logger[_0xa19e('0x31')](_0xa19e('0x3c'));return _0x3be281({'code':0xc8,'message':_0x28555e});}}catch(_0x2780b4){logger['error'](_0x2780b4[_0xa19e('0x3d')]);return _0x1fdea2(_0x245bcb[_0xa19e('0x35')](0x1f4,_0x2780b4));}}return _0x1fdea2('routing\x20is\x20empty');});},'AcceptMessage':function(_0x5ce8b3){var _0x3bcd9f=this;return new Promise(function(_0x16ec15,_0x3cbc3b){if(_0x5ce8b3['agent']&&_0x5ce8b3[_0xa19e('0x3e')]['id']){if(_0x1e5420[_0xa19e('0x3f')][_0x5ce8b3['agent']['id']]){_0x1e5420[_0xa19e('0x3f')][_0x5ce8b3[_0xa19e('0x3e')]['id']][_0xa19e('0x40')]=![];_0x1e5420['agents'][_0x5ce8b3[_0xa19e('0x3e')]['id']]['busyQueue']=undefined;}}if(_0x5ce8b3[_0xa19e('0x13')]&&_0x5ce8b3[_0xa19e('0x13')]['id']){try{var _0xef8c1f=getId(_0x5ce8b3[_0xa19e('0x12')],_0x5ce8b3[_0xa19e('0x13')]?_0x5ce8b3['message']['id']:0x0,_0x5ce8b3[_0xa19e('0x14')]?_0x5ce8b3['interaction']['id']:0x0);if(_0x1e5420[_0xa19e('0x11')][_0xef8c1f]){_0x1e5420['rules'][_0xef8c1f][_0xa19e('0x3a')](_0xa19e('0x41'));if(rpc[_0x5ce8b3[_0xa19e('0x12')]+_0xa19e('0x42')]){rpc[_0x5ce8b3['channel']+_0xa19e('0x42')][_0xa19e('0x43')](_0xef8c1f,{'UserId':_0x5ce8b3[_0xa19e('0x13')][_0xa19e('0x44')]})['catch'](function(){logger[_0xa19e('0x35')]('error\x20update\x20queue\x20report');});}}return _0x16ec15({'code':0xc8,'message':_0x5ce8b3});}catch(_0x2c58c8){logger[_0xa19e('0x35')](_0x2c58c8[_0xa19e('0x3d')]);return _0x3cbc3b(_0x3bcd9f['error'](0x1f4,_0x2c58c8));}}logger[_0xa19e('0x35')](_0xa19e('0x45'));return _0x3cbc3b(_0x3bcd9f['error'](0x1f4,_0xa19e('0x45')));});},'RejectMessage':function(_0x13045d){var _0x33b6b0=this;return new Promise(function(_0x3f8751,_0x58b3f4){if(_0x13045d['agent']&&_0x13045d[_0xa19e('0x3e')]['id']){try{if(_0x1e5420[_0xa19e('0x3f')][_0x13045d['agent']['id']]){_0x1e5420[_0xa19e('0x3f')][_0x13045d[_0xa19e('0x3e')]['id']]['busy']=![];_0x1e5420[_0xa19e('0x3f')][_0x13045d[_0xa19e('0x3e')]['id']][_0xa19e('0x46')]=undefined;}return _0x3f8751({'code':0xc8,'message':_0x13045d});}catch(_0x22890b){logger[_0xa19e('0x35')](_0x22890b[_0xa19e('0x3d')]);return _0x58b3f4(_0x33b6b0[_0xa19e('0x35')](0x1f4,_0x22890b));}}logger[_0xa19e('0x35')](_0xa19e('0x45'));return _0x58b3f4(_0x33b6b0[_0xa19e('0x35')](0x1f4,_0xa19e('0x45')));});},'AbandonInteraction':function(_0x479b09){var _0x520af6=this;return new Promise(function(_0x2f37b0,_0x1a41a0){if(_0x479b09[_0xa19e('0x12')]&&_0x479b09['interaction']&&_0x479b09['interaction']['id']){try{var _0x51b2cc=getId(_0x479b09[_0xa19e('0x12')],_0x479b09['message']?_0x479b09[_0xa19e('0x13')]['id']:0x0,_0x479b09[_0xa19e('0x14')]?_0x479b09[_0xa19e('0x14')]['id']:0x0);if(_0x1e5420[_0xa19e('0x11')][_0x51b2cc]){_0x1e5420['rules'][_0x51b2cc][_0xa19e('0x3a')](_0xa19e('0x41'));}return _0x2f37b0({'code':0xc8,'message':_0x479b09});}catch(_0x437292){logger[_0xa19e('0x35')](_0x437292[_0xa19e('0x3d')]);return _0x1a41a0(_0x520af6[_0xa19e('0x35')](0x1f4,_0x437292));}}logger[_0xa19e('0x35')](_0xa19e('0x45'));return _0x1a41a0(_0x520af6[_0xa19e('0x35')](0x1f4,_0xa19e('0x45')));});},'AgentCapacity':function(_0xa77fd){var _0xae7dbc=this;return new Promise(function(_0xce7ccd,_0x8128f6){if(_0x1e5420[_0xa19e('0x3f')][_0xa19e('0x47')](_0xa77fd['id'])){for(var _0x45f7ee in _0xa77fd['capacity']){if(_0xa77fd[_0xa19e('0x48')][_0xa19e('0x47')](_0x45f7ee)){if(_0x1e5420['agents'][_0xa77fd['id']][_0xa19e('0x47')](_0x45f7ee+'CurrentCapacity')){_0x1e5420['agents'][_0xa77fd['id']][_0x45f7ee+_0xa19e('0x49')]=parseInt(_0xa77fd[_0xa19e('0x48')][_0x45f7ee],0xa);}}}_0x1e5420[_0xa19e('0x3f')][_0xa77fd['id']]['updateRealtime']();return _0xce7ccd({'code':0xc8,'message':_0x1e5420[_0xa19e('0x3f')][_0xa77fd['id']]});}else{return _0x8128f6(_0xae7dbc['error'](0x1f4,_0xa19e('0x4a')));}});},'Agents':function(_0x5afd28){return new Promise(function(_0x423d57){var _0x39a46b=_[_0xa19e('0x4b')](_0x1e5420[_0xa19e('0x3f')]);if(_0x5afd28&&_0x5afd28['id']){var _0x38ff15=_['find'](_0x39a46b,function(_0x3b7c86){return _0x3b7c86['id']===_0x5afd28['id'];});_0x423d57(_0x38ff15);}else{_0x423d57({'count':_0x39a46b['length'],'rows':_0x39a46b});}});},'ChatQueues':function(){return new Promise(function(_0x11bfc1){var _0x5daff=[];for(var _0x1ba3ae in _0x1e5420[_0xa19e('0x4c')]){if(_0x1e5420[_0xa19e('0x4c')][_0xa19e('0x47')](_0x1ba3ae)){var _0x9d442b=_0x1e5420[_0xa19e('0x4c')][_0x1ba3ae];var _0x340df1={'id':_0x9d442b['id'],'available':_0x9d442b[_0xa19e('0x4d')],'loggedIn':_0x9d442b[_0xa19e('0x4e')],'name':_0x9d442b[_0xa19e('0x4f')],'paused':_0x9d442b['paused'],'waiting':_0x9d442b[_0xa19e('0x50')]};_0x5daff[_0xa19e('0x1f')](_0x340df1);}}_0x11bfc1({'count':_0x5daff['length'],'rows':_0x5daff});});},'MailQueues':function(){return new Promise(function(_0x4195c9){var _0x53a806=[];for(var _0x1d991d in _0x1e5420['mailQueues']){if(_0x1e5420[_0xa19e('0x51')][_0xa19e('0x47')](_0x1d991d)){var _0x52159a=_0x1e5420[_0xa19e('0x51')][_0x1d991d];var _0x4ea1c3={'id':_0x52159a['id'],'available':_0x52159a[_0xa19e('0x4d')],'loggedIn':_0x52159a[_0xa19e('0x4e')],'name':_0x52159a[_0xa19e('0x4f')],'paused':_0x52159a[_0xa19e('0x52')],'waiting':_0x52159a[_0xa19e('0x50')]};_0x53a806[_0xa19e('0x1f')](_0x4ea1c3);}}_0x4195c9({'count':_0x53a806['length'],'rows':_0x53a806});});},'OpenchannelQueues':function(){return new Promise(function(_0x57d87f){var _0x45e5f6=[];for(var _0x2c9b4e in _0x1e5420['openchannelQueues']){if(_0x1e5420[_0xa19e('0x53')][_0xa19e('0x47')](_0x2c9b4e)){var _0x2ddc61=_0x1e5420['openchannelQueues'][_0x2c9b4e];var _0x3027e7={'id':_0x2ddc61['id'],'available':_0x2ddc61[_0xa19e('0x4d')],'loggedIn':_0x2ddc61['loggedIn'],'name':_0x2ddc61[_0xa19e('0x4f')],'paused':_0x2ddc61[_0xa19e('0x52')],'waiting':_0x2ddc61[_0xa19e('0x50')]};_0x45e5f6['push'](_0x3027e7);}}_0x57d87f({'count':_0x45e5f6[_0xa19e('0x21')],'rows':_0x45e5f6});});},'SmsQueues':function(){return new Promise(function(_0x3659d5){var _0x434727=[];for(var _0x510b58 in _0x1e5420[_0xa19e('0x54')]){if(_0x1e5420[_0xa19e('0x54')][_0xa19e('0x47')](_0x510b58)){var _0x5609a4=_0x1e5420[_0xa19e('0x54')][_0x510b58];var _0x156e43={'id':_0x5609a4['id'],'available':_0x5609a4[_0xa19e('0x4d')],'loggedIn':_0x5609a4[_0xa19e('0x4e')],'name':_0x5609a4[_0xa19e('0x4f')],'paused':_0x5609a4[_0xa19e('0x52')],'waiting':_0x5609a4[_0xa19e('0x50')]};_0x434727[_0xa19e('0x1f')](_0x156e43);}}_0x3659d5({'count':_0x434727[_0xa19e('0x21')],'rows':_0x434727});});},'FaxQueues':function(){return new Promise(function(_0x185987){var _0x5cb581=[];for(var _0x386121 in _0x1e5420[_0xa19e('0x55')]){if(_0x1e5420['faxQueues'][_0xa19e('0x47')](_0x386121)){var _0x606ab2=_0x1e5420['faxQueues'][_0x386121];var _0x472fea={'id':_0x606ab2['id'],'available':_0x606ab2[_0xa19e('0x4d')],'loggedIn':_0x606ab2[_0xa19e('0x4e')],'name':_0x606ab2['name'],'paused':_0x606ab2[_0xa19e('0x52')],'waiting':_0x606ab2['waiting']};_0x5cb581['push'](_0x472fea);}}_0x185987({'count':_0x5cb581['length'],'rows':_0x5cb581});});},'WhatsappQueues':function(){return new Promise(function(_0x54b290){var _0x5d3b38=[];for(var _0x379c68 in _0x1e5420[_0xa19e('0x56')]){if(_0x1e5420[_0xa19e('0x56')]['hasOwnProperty'](_0x379c68)){var _0x38fb2c=_0x1e5420[_0xa19e('0x56')][_0x379c68];var _0x1f92b7={'id':_0x38fb2c['id'],'available':_0x38fb2c[_0xa19e('0x4d')],'loggedIn':_0x38fb2c[_0xa19e('0x4e')],'name':_0x38fb2c[_0xa19e('0x4f')],'paused':_0x38fb2c[_0xa19e('0x52')],'waiting':_0x38fb2c[_0xa19e('0x50')]};_0x5d3b38['push'](_0x1f92b7);}}_0x54b290({'count':_0x5d3b38[_0xa19e('0x21')],'rows':_0x5d3b38});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x49ad35){var _0x266144=_['values'](_0x1e5420[_0xa19e('0x57')]);_0x49ad35({'count':_0x266144[_0xa19e('0x21')],'rows':_0x266144});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2d84aa){var _0x170f64=_[_0xa19e('0x4b')](_0x1e5420[_0xa19e('0x58')]);_0x2d84aa({'count':_0x170f64[_0xa19e('0x21')],'rows':_0x170f64});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5dc337){var _0x366092=_[_0xa19e('0x4b')](_0x1e5420[_0xa19e('0x59')]);_0x5dc337({'count':_0x366092[_0xa19e('0x21')],'rows':_0x366092});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5c2571){var _0x37e51c=_['values'](_0x1e5420['smsQueuesWaitingInteractions']);_0x5c2571({'count':_0x37e51c['length'],'rows':_0x37e51c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x14c08a){var _0x1e1a98=_[_0xa19e('0x4b')](_0x1e5420[_0xa19e('0x5a')]);_0x14c08a({'count':_0x1e1a98[_0xa19e('0x21')],'rows':_0x1e1a98});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x18987){var _0x5e68f1=_[_0xa19e('0x4b')](_0x1e5420['whatsappQueuesWaitingInteractions']);_0x18987({'count':_0x5e68f1[_0xa19e('0x21')],'rows':_0x5e68f1});});}};var _0x47f775=jayson['server'](_0x3c6425)['http']();_0x47f775['on'](_0xa19e('0x35'),function(_0x30a195){logger[_0xa19e('0x35')](JSON[_0xa19e('0x5b')](_0x30a195));return _0x564d2a(_0x30a195);});_0x47f775[_0xa19e('0x10')](0x232c,_0xa19e('0x5c'),function(){console[_0xa19e('0x5d')](_0xa19e('0x5e'),0x232c);return _0x28dedd(_0xa19e('0x5f')+0x232c);});});}; \ No newline at end of file +var _0x6282=['loggedIn','name','mailQueues','available','waiting','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','complete','info','stack','agent','agents','busyQueue','end','QueueReport','update','UserId','message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','find','chatQueues'];(function(_0x17fa50,_0x28e30c){var _0x2d9eb6=function(_0x2a20a1){while(--_0x2a20a1){_0x17fa50['push'](_0x17fa50['shift']());}};_0x2d9eb6(++_0x28e30c);}(_0x6282,0x76));var _0x2628=function(_0x41fc7f,_0x123a6d){_0x41fc7f=_0x41fc7f-0x0;var _0x5cabfe=_0x6282[_0x41fc7f];return _0x5cabfe;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var path=require(_0x2628('0x2'));var fs=require('fs');var jayson=require(_0x2628('0x3'));var BPromise=require('bluebird');var utils=require('./applications/utils');var logger=require(_0x2628('0x4'))(_0x2628('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2628('0x6')),'chatQueueReport':require(_0x2628('0x7')),'smsQueueReport':require(_0x2628('0x8')),'faxQueueReport':require(_0x2628('0x9')),'whatsappQueueReport':require(_0x2628('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0xb6b945,_0x144ae8,_0x2170a7){return util[_0x2628('0xb')](_0x2628('0xc'),_0xb6b945,_0x144ae8||0x0,_0x2170a7||0x0);}function getIntervals(_0x241628,_0x403569){var _0x1d12a5=[];if(!_[_0x2628('0xd')](_0x403569[_0x2628('0xe')])&&!_[_0x2628('0xd')](_0x241628[_0x403569[_0x2628('0xe')]])&&!_[_0x2628('0xd')](_0x241628[_0x403569[_0x2628('0xe')]][_0x2628('0xf')])){_0x1d12a5=_['map'](_0x241628[_0x403569['IntervalId']][_0x2628('0xf')],_0x2628('0x10'));}else if(!_[_0x2628('0xd')](_0x403569[_0x2628('0x10')])){_0x1d12a5=[_0x403569['interval']];}return _0x1d12a5;}exports['listen']=function(_0x1081a4){_0x1081a4[_0x2628('0x11')]={};return new BPromise(function(_0x4d2cfb,_0x2395fe){var _0x2f59ca={'Start':function(_0x513aee){var _0x645884=this;return new Promise(function(_0x16e67a,_0x457163){if(_0x513aee){try{var _0x4f418d=[];var _0x13a728=getId(_0x513aee[_0x2628('0x12')],_0x513aee['message']?_0x513aee[_0x2628('0x13')]['id']:0x0,_0x513aee['interaction']?_0x513aee[_0x2628('0x14')]['id']:0x0);if(_0x513aee[_0x2628('0x15')]&&_['isArray'](_0x513aee[_0x2628('0x15')])&&_0x513aee[_0x2628('0x15')]['length']){for(var _0x165824=0x0;_0x165824<_0x513aee['applications'][_0x2628('0x16')];_0x165824+=0x1){var _0x4976ce=_0x513aee['applications'][_0x165824];if(fs[_0x2628('0x17')](path[_0x2628('0x18')](__dirname,_0x2628('0x15'),_0x4976ce[_0x2628('0x19')]+_0x2628('0x1a')))){var _0x1911a2=[];switch(_0x4976ce[_0x2628('0x19')][_0x2628('0x1b')]()){case _0x2628('0x1c'):var _0x57a799=_0x4976ce[_0x2628('0x1d')][_0x2628('0x1e')](',');if(_0x513aee[_0x2628('0x12')]===_0x2628('0x1f')){_0x1911a2[_0x2628('0x20')](_0x57a799[0x0]);_0x1911a2['push'](_0x57a799[0x1]);_0x1911a2[_0x2628('0x20')](_0x57a799[_0x2628('0x21')](0x2,_0x57a799[_0x2628('0x16')])[_0x2628('0x18')](','));}else{_0x1911a2[_0x2628('0x20')](_0x57a799[0x0]);_0x1911a2['push'](_0x57a799['slice'](0x1,_0x57a799[_0x2628('0x16')])[_0x2628('0x18')](','));}break;case _0x2628('0x22'):var _0x41c18e=_0x4976ce[_0x2628('0x1d')]['split'](',');_0x1911a2[_0x2628('0x20')](_0x41c18e[0x0]);_0x1911a2[_0x2628('0x20')](_0x41c18e[0x1]);_0x1911a2[_0x2628('0x20')](_0x41c18e[_0x2628('0x21')](0x2,_0x41c18e[_0x2628('0x16')])[_0x2628('0x18')](','));break;case'dialogflowv2':var _0x541eef=_0x4976ce[_0x2628('0x1d')][_0x2628('0x1e')](',');_0x1911a2[_0x2628('0x20')](_0x541eef[0x0]);_0x1911a2[_0x2628('0x20')](_0x541eef[0x1]);_0x1911a2['push'](_0x541eef[0x2]);_0x1911a2[_0x2628('0x20')](_0x541eef[0x3]);_0x1911a2[_0x2628('0x20')](_0x541eef[_0x2628('0x21')](0x4,_0x541eef[_0x2628('0x16')])['join'](','));break;case _0x2628('0x23'):var _0x1dd96a=_0x4976ce[_0x2628('0x1d')][_0x2628('0x1e')](',');_0x1911a2['push'](_0x1dd96a[0x0]);_0x1911a2[_0x2628('0x20')](_0x1dd96a[0x1]);_0x1911a2[_0x2628('0x20')](_0x1dd96a[0x2]);_0x1911a2[_0x2628('0x20')](_0x1dd96a[0x3]);_0x1911a2[_0x2628('0x20')](_0x1dd96a[_0x2628('0x21')](0x4,_0x1dd96a[_0x2628('0x16')])[_0x2628('0x18')](','));break;case _0x2628('0x13'):_0x1911a2[_0x2628('0x20')](_0x4976ce['appdata']);break;case _0x2628('0x24'):_0x1911a2[_0x2628('0x20')](_0x4976ce[_0x2628('0x25')]);_0x1911a2[_0x2628('0x20')](_0x4976ce[_0x2628('0x1d')]);break;case'tvox':var _0x4ba58c=utils[_0x2628('0x26')](_0x513aee[_0x2628('0x27')][_0x2628('0x28')],_0x513aee);var _0x572e2d=_0x4976ce[_0x2628('0x1d')][_0x2628('0x1e')](',');_0x1911a2[_0x2628('0x20')](_0x572e2d[0x0]);_0x1911a2['push'](_0x572e2d[0x1]);_0x1911a2[_0x2628('0x20')](_0x572e2d[0x2]);_0x1911a2[_0x2628('0x20')](_0x572e2d[0x3]);_0x1911a2[_0x2628('0x20')](_0x572e2d[0x4]);_0x1911a2['push'](_0x572e2d[0x5]);_0x1911a2['push'](_0x572e2d[0x6]);_0x1911a2['push'](_0x572e2d[0x7]);_0x1911a2['push'](_0x572e2d[0x8]);_0x1911a2[_0x2628('0x20')](_0x572e2d[0x9]);_0x1911a2[_0x2628('0x20')](_0x572e2d[0xa]);_0x1911a2[_0x2628('0x20')](_0x513aee['interaction']['id']);_0x1911a2[_0x2628('0x20')](_0x513aee[_0x2628('0x13')]['id']);_0x1911a2[_0x2628('0x20')](_0x4976ce['ChatWebsiteId']);_0x1911a2[_0x2628('0x20')](_0x513aee[_0x2628('0x14')][_0x2628('0x29')]);_0x1911a2[_0x2628('0x20')](_0x513aee[_0x2628('0x2a')][_0x2628('0x2a')]);_0x1911a2[_0x2628('0x20')](_0x4ba58c);break;default:_0x1911a2=_['isNil'](_0x4976ce[_0x2628('0x1d')])?[]:_0x4976ce[_0x2628('0x1d')][_0x2628('0x1e')](',');}var _0x3dd851={'id':util[_0x2628('0xb')](_0x2628('0x2b'),_0x13a728,_0x4976ce['id'],_0x4976ce['app']),'condition':require(_0x2628('0x2c'))['condition'](_0x13a728,getIntervals(_0x1081a4[_0x2628('0x2d')],_0x4976ce),_0x1081a4),'consequence':require(_0x2628('0x2e')+_0x4976ce[_0x2628('0x19')])[_0x2628('0x2f')](_0x13a728,_0x1911a2,_0x1081a4,_0x513aee),'p':_0x4976ce[_0x2628('0x30')]||0x0};logger['info'](_0x2628('0x31'),_0x3dd851['id'],'on\x20interval',getIntervals(_0x1081a4['intervals'],_0x4976ce)[_0x2628('0x18')](_0x2628('0x32')));_0x4f418d[_0x2628('0x20')](_0x3dd851);}else{logger[_0x2628('0x33')](_0x2628('0x34'),path['join'](__dirname,_0x2628('0x15'),_0x4976ce[_0x2628('0x19')]+_0x2628('0x1a')));}}_0x1081a4[_0x2628('0x11')][_0x13a728]=new RuleEngine(_0x4f418d);_0x1081a4[_0x2628('0x11')][_0x13a728]['execute'](_0x513aee,function(_0x4665e8){logger['info'](_0x2628('0x35'),JSON[_0x2628('0x36')](_0x4665e8[_0x2628('0x37')]));if(_0x1081a4[_0x2628('0x11')][_0x13a728]){_0x1081a4['rules'][_0x13a728]['emit'](_0x2628('0x38'));}});return _0x16e67a({'code':0xc8,'message':_0x513aee});}else{logger[_0x2628('0x39')]('No\x20applications\x20to\x20execute');return _0x16e67a({'code':0xc8,'message':_0x513aee});}}catch(_0x23726f){logger[_0x2628('0x33')](_0x23726f[_0x2628('0x3a')]);return _0x457163(_0x645884[_0x2628('0x33')](0x1f4,_0x23726f));}}return _0x457163('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2e363a){var _0x1b6822=this;return new Promise(function(_0x1a34ee,_0x29847f){if(_0x2e363a[_0x2628('0x3b')]&&_0x2e363a[_0x2628('0x3b')]['id']){if(_0x1081a4[_0x2628('0x3c')][_0x2e363a[_0x2628('0x3b')]['id']]){_0x1081a4['agents'][_0x2e363a[_0x2628('0x3b')]['id']]['busy']=![];_0x1081a4[_0x2628('0x3c')][_0x2e363a['agent']['id']][_0x2628('0x3d')]=undefined;}}if(_0x2e363a[_0x2628('0x13')]&&_0x2e363a[_0x2628('0x13')]['id']){try{var _0x2b8fb9=getId(_0x2e363a[_0x2628('0x12')],_0x2e363a['message']?_0x2e363a[_0x2628('0x13')]['id']:0x0,_0x2e363a['interaction']?_0x2e363a[_0x2628('0x14')]['id']:0x0);if(_0x1081a4[_0x2628('0x11')][_0x2b8fb9]){_0x1081a4[_0x2628('0x11')][_0x2b8fb9]['emit'](_0x2628('0x3e'));if(rpc[_0x2e363a[_0x2628('0x12')]+'QueueReport']){rpc[_0x2e363a[_0x2628('0x12')]+_0x2628('0x3f')][_0x2628('0x40')](_0x2b8fb9,{'UserId':_0x2e363a[_0x2628('0x13')][_0x2628('0x41')]})['catch'](function(){logger[_0x2628('0x33')]('error\x20update\x20queue\x20report');});}}return _0x1a34ee({'code':0xc8,'message':_0x2e363a});}catch(_0x307ab6){logger[_0x2628('0x33')](_0x307ab6[_0x2628('0x3a')]);return _0x29847f(_0x1b6822[_0x2628('0x33')](0x1f4,_0x307ab6));}}logger[_0x2628('0x33')](_0x2628('0x42'));return _0x29847f(_0x1b6822[_0x2628('0x33')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x7fc50){var _0x11a733=this;return new Promise(function(_0xdcf3ac,_0x403c78){if(_0x7fc50[_0x2628('0x3b')]&&_0x7fc50[_0x2628('0x3b')]['id']){try{if(_0x1081a4[_0x2628('0x3c')][_0x7fc50[_0x2628('0x3b')]['id']]){_0x1081a4[_0x2628('0x3c')][_0x7fc50['agent']['id']]['busy']=![];_0x1081a4[_0x2628('0x3c')][_0x7fc50[_0x2628('0x3b')]['id']][_0x2628('0x3d')]=undefined;}return _0xdcf3ac({'code':0xc8,'message':_0x7fc50});}catch(_0xc7abb4){logger[_0x2628('0x33')](_0xc7abb4['stack']);return _0x403c78(_0x11a733['error'](0x1f4,_0xc7abb4));}}logger[_0x2628('0x33')]('message\x20is\x20empty');return _0x403c78(_0x11a733[_0x2628('0x33')](0x1f4,_0x2628('0x42')));});},'AbandonInteraction':function(_0x45227a){var _0x313e45=this;return new Promise(function(_0x2a5872,_0x2e677){if(_0x45227a[_0x2628('0x12')]&&_0x45227a[_0x2628('0x14')]&&_0x45227a[_0x2628('0x14')]['id']){try{var _0x3a656d=getId(_0x45227a[_0x2628('0x12')],_0x45227a[_0x2628('0x13')]?_0x45227a[_0x2628('0x13')]['id']:0x0,_0x45227a[_0x2628('0x14')]?_0x45227a[_0x2628('0x14')]['id']:0x0);if(_0x1081a4[_0x2628('0x11')][_0x3a656d]){_0x1081a4[_0x2628('0x11')][_0x3a656d][_0x2628('0x43')](_0x2628('0x3e'));}return _0x2a5872({'code':0xc8,'message':_0x45227a});}catch(_0x2c5424){logger[_0x2628('0x33')](_0x2c5424[_0x2628('0x3a')]);return _0x2e677(_0x313e45['error'](0x1f4,_0x2c5424));}}logger[_0x2628('0x33')](_0x2628('0x42'));return _0x2e677(_0x313e45['error'](0x1f4,_0x2628('0x42')));});},'AgentCapacity':function(_0x382c0b){var _0x208707=this;return new Promise(function(_0x1bf368,_0x13187b){if(_0x1081a4[_0x2628('0x3c')][_0x2628('0x44')](_0x382c0b['id'])){for(var _0x167cd1 in _0x382c0b['capacity']){if(_0x382c0b[_0x2628('0x45')][_0x2628('0x44')](_0x167cd1)){if(_0x1081a4[_0x2628('0x3c')][_0x382c0b['id']]['hasOwnProperty'](_0x167cd1+_0x2628('0x46'))){_0x1081a4[_0x2628('0x3c')][_0x382c0b['id']][_0x167cd1+_0x2628('0x46')]=parseInt(_0x382c0b[_0x2628('0x45')][_0x167cd1],0xa);}}}_0x1081a4[_0x2628('0x3c')][_0x382c0b['id']][_0x2628('0x47')]();return _0x1bf368({'code':0xc8,'message':_0x1081a4[_0x2628('0x3c')][_0x382c0b['id']]});}else{return _0x13187b(_0x208707['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x49d412){return new Promise(function(_0x28d22a){var _0x4be311=_['values'](_0x1081a4[_0x2628('0x3c')]);if(_0x49d412&&_0x49d412['id']){var _0x36bcaf=_[_0x2628('0x48')](_0x4be311,function(_0x570f37){return _0x570f37['id']===_0x49d412['id'];});_0x28d22a(_0x36bcaf);}else{_0x28d22a({'count':_0x4be311['length'],'rows':_0x4be311});}});},'ChatQueues':function(){return new Promise(function(_0x5af7e8){var _0x54f9c0=[];for(var _0x3a3477 in _0x1081a4[_0x2628('0x49')]){if(_0x1081a4[_0x2628('0x49')][_0x2628('0x44')](_0x3a3477)){var _0x2a4fc0=_0x1081a4['chatQueues'][_0x3a3477];var _0x597bb2={'id':_0x2a4fc0['id'],'available':_0x2a4fc0['available'],'loggedIn':_0x2a4fc0[_0x2628('0x4a')],'name':_0x2a4fc0[_0x2628('0x4b')],'paused':_0x2a4fc0['paused'],'waiting':_0x2a4fc0['waiting']};_0x54f9c0[_0x2628('0x20')](_0x597bb2);}}_0x5af7e8({'count':_0x54f9c0[_0x2628('0x16')],'rows':_0x54f9c0});});},'MailQueues':function(){return new Promise(function(_0x54869e){var _0x189c92=[];for(var _0x3a3a66 in _0x1081a4[_0x2628('0x4c')]){if(_0x1081a4['mailQueues']['hasOwnProperty'](_0x3a3a66)){var _0xdbd0ef=_0x1081a4[_0x2628('0x4c')][_0x3a3a66];var _0x58274b={'id':_0xdbd0ef['id'],'available':_0xdbd0ef[_0x2628('0x4d')],'loggedIn':_0xdbd0ef[_0x2628('0x4a')],'name':_0xdbd0ef[_0x2628('0x4b')],'paused':_0xdbd0ef['paused'],'waiting':_0xdbd0ef[_0x2628('0x4e')]};_0x189c92[_0x2628('0x20')](_0x58274b);}}_0x54869e({'count':_0x189c92['length'],'rows':_0x189c92});});},'OpenchannelQueues':function(){return new Promise(function(_0x22278f){var _0x93072a=[];for(var _0x219aeb in _0x1081a4[_0x2628('0x4f')]){if(_0x1081a4['openchannelQueues'][_0x2628('0x44')](_0x219aeb)){var _0xdfddbe=_0x1081a4[_0x2628('0x4f')][_0x219aeb];var _0x4a2190={'id':_0xdfddbe['id'],'available':_0xdfddbe['available'],'loggedIn':_0xdfddbe['loggedIn'],'name':_0xdfddbe[_0x2628('0x4b')],'paused':_0xdfddbe[_0x2628('0x50')],'waiting':_0xdfddbe[_0x2628('0x4e')]};_0x93072a[_0x2628('0x20')](_0x4a2190);}}_0x22278f({'count':_0x93072a['length'],'rows':_0x93072a});});},'SmsQueues':function(){return new Promise(function(_0x52d1ce){var _0x187f55=[];for(var _0x355444 in _0x1081a4['smsQueues']){if(_0x1081a4[_0x2628('0x51')][_0x2628('0x44')](_0x355444)){var _0x2b5053=_0x1081a4[_0x2628('0x51')][_0x355444];var _0x121435={'id':_0x2b5053['id'],'available':_0x2b5053[_0x2628('0x4d')],'loggedIn':_0x2b5053['loggedIn'],'name':_0x2b5053[_0x2628('0x4b')],'paused':_0x2b5053['paused'],'waiting':_0x2b5053[_0x2628('0x4e')]};_0x187f55['push'](_0x121435);}}_0x52d1ce({'count':_0x187f55[_0x2628('0x16')],'rows':_0x187f55});});},'FaxQueues':function(){return new Promise(function(_0x353412){var _0x24d571=[];for(var _0x1f6267 in _0x1081a4[_0x2628('0x52')]){if(_0x1081a4[_0x2628('0x52')][_0x2628('0x44')](_0x1f6267)){var _0xfa1f4=_0x1081a4[_0x2628('0x52')][_0x1f6267];var _0x12e835={'id':_0xfa1f4['id'],'available':_0xfa1f4[_0x2628('0x4d')],'loggedIn':_0xfa1f4[_0x2628('0x4a')],'name':_0xfa1f4[_0x2628('0x4b')],'paused':_0xfa1f4[_0x2628('0x50')],'waiting':_0xfa1f4[_0x2628('0x4e')]};_0x24d571['push'](_0x12e835);}}_0x353412({'count':_0x24d571[_0x2628('0x16')],'rows':_0x24d571});});},'WhatsappQueues':function(){return new Promise(function(_0x3170fb){var _0x443456=[];for(var _0xd41484 in _0x1081a4[_0x2628('0x53')]){if(_0x1081a4[_0x2628('0x53')][_0x2628('0x44')](_0xd41484)){var _0x3d52c6=_0x1081a4['whatsappQueues'][_0xd41484];var _0x29aacc={'id':_0x3d52c6['id'],'available':_0x3d52c6['available'],'loggedIn':_0x3d52c6[_0x2628('0x4a')],'name':_0x3d52c6['name'],'paused':_0x3d52c6[_0x2628('0x50')],'waiting':_0x3d52c6[_0x2628('0x4e')]};_0x443456[_0x2628('0x20')](_0x29aacc);}}_0x3170fb({'count':_0x443456[_0x2628('0x16')],'rows':_0x443456});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x211b28){var _0x57d96a=_[_0x2628('0x54')](_0x1081a4[_0x2628('0x55')]);_0x211b28({'count':_0x57d96a[_0x2628('0x16')],'rows':_0x57d96a});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1c3e42){var _0x7caf20=_[_0x2628('0x54')](_0x1081a4[_0x2628('0x56')]);_0x1c3e42({'count':_0x7caf20[_0x2628('0x16')],'rows':_0x7caf20});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2dfe66){var _0x14387e=_[_0x2628('0x54')](_0x1081a4['openchannelQueuesWaitingInteractions']);_0x2dfe66({'count':_0x14387e[_0x2628('0x16')],'rows':_0x14387e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4a6902){var _0x118d26=_[_0x2628('0x54')](_0x1081a4[_0x2628('0x57')]);_0x4a6902({'count':_0x118d26[_0x2628('0x16')],'rows':_0x118d26});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4b5de9){var _0x50032b=_[_0x2628('0x54')](_0x1081a4[_0x2628('0x58')]);_0x4b5de9({'count':_0x50032b['length'],'rows':_0x50032b});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2b33d){var _0x4796fe=_['values'](_0x1081a4[_0x2628('0x59')]);_0x2b33d({'count':_0x4796fe[_0x2628('0x16')],'rows':_0x4796fe});});}};var _0x47f297=jayson[_0x2628('0x5a')](_0x2f59ca)['http']();_0x47f297['on']('error',function(_0xc9e57c){logger[_0x2628('0x33')](JSON[_0x2628('0x36')](_0xc9e57c));return _0x2395fe(_0xc9e57c);});_0x47f297[_0x2628('0x5b')](0x232c,_0x2628('0x5c'),function(){console[_0x2628('0x5d')](_0x2628('0x5e'),0x232c);return _0x4d2cfb(_0x2628('0x5f')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 9cd95a6..1105fad 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 _0x2c83=['log','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','then','error','result','catch','info','stop','length','push','Command','message','indexOf','join','\x20|\x20','when'];(function(_0x18e6aa,_0x2a6682){var _0x470c24=function(_0x38aed3){while(--_0x38aed3){_0x18e6aa['push'](_0x18e6aa['shift']());}};_0x470c24(++_0x2a6682);}(_0x2c83,0x15a));var _0x32c8=function(_0x2dc95a,_0x2e82c6){_0x2dc95a=_0x2dc95a-0x0;var _0x361afd=_0x2c83[_0x2dc95a];return _0x361afd;};'use strict';var util=require(_0x32c8('0x0'));var BPromise=require(_0x32c8('0x1'));var jayson=require(_0x32c8('0x2'));var _=require('lodash');var logger=require(_0x32c8('0x3'))(_0x32c8('0x4'));var client=jayson[_0x32c8('0x5')][_0x32c8('0x6')]({'port':0x232a});function request(_0x4b0276,_0x244dbb){return new BPromise(function(_0x4ea844,_0x442dc1){return client[_0x32c8('0x7')](_0x4b0276,_0x244dbb)[_0x32c8('0x8')](function(_0x36ba6f){if(_0x36ba6f[_0x32c8('0x9')]){return _0x442dc1(_0x36ba6f[_0x32c8('0x9')]['message']);}else{return _0x4ea844(_0x36ba6f[_0x32c8('0xa')]);}})[_0x32c8('0xb')](function(_0x5383d3){return _0x442dc1(_0x5383d3);});});}exports['condition']=function(_0x3d5147,_0x223ce8,_0x586b41){return function(_0x360ddc){if(_0x586b41['rules']&&!_0x586b41['rules'][_0x3d5147]){logger[_0x32c8('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3d5147);return _0x360ddc[_0x32c8('0xd')]();}var _0x5648b0=[];for(var _0x14d38a=0x0;_0x14d38a<_0x223ce8[_0x32c8('0xe')];_0x14d38a+=0x1){_0x5648b0[_0x32c8('0xf')](request(_0x32c8('0x10'),{'command':util['format']('iftime\x20%s',_0x223ce8[_0x14d38a])})[_0x32c8('0x8')](function(_0x3f96c1){return _0x3f96c1&&_0x3f96c1[_0x32c8('0x11')]&&_0x3f96c1[_0x32c8('0x11')][_0x32c8('0x12')]('true')>=0x0?!![]:![];})[_0x32c8('0xb')](function(_0x38196f){logger[_0x32c8('0x9')]('[%s][INTERVAL]\x20%s',_0x3d5147,_0x223ce8[_0x14d38a]);}));}BPromise['all'](_0x5648b0)[_0x32c8('0x8')](function(_0x3d1a23){var _0x3fd79e=_['some'](_0x3d1a23);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x3d5147,_0x223ce8[_0x32c8('0x13')](_0x32c8('0x14')),_0x3fd79e);_0x360ddc[_0x32c8('0x15')](_0x3fd79e);})[_0x32c8('0xb')](function(_0x31b894){console[_0x32c8('0x16')](_0x31b894);logger[_0x32c8('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x3d5147,_0x223ce8['join'](_0x32c8('0x14')),_0x31b894['stack']);_0x360ddc[_0x32c8('0xd')]();});};}; \ No newline at end of file +var _0xfeea=['util','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','then','error','message','result','catch','rules','info','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','stop'];(function(_0x48abc7,_0xae7adb){var _0x1ed9f5=function(_0x40983a){while(--_0x40983a){_0x48abc7['push'](_0x48abc7['shift']());}};_0x1ed9f5(++_0xae7adb);}(_0xfeea,0x100));var _0xafee=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xfeea[_0xcd5a3d];return _0xd43207;};'use strict';var util=require(_0xafee('0x0'));var BPromise=require(_0xafee('0x1'));var jayson=require(_0xafee('0x2'));var _=require('lodash');var logger=require(_0xafee('0x3'))(_0xafee('0x4'));var client=jayson[_0xafee('0x5')][_0xafee('0x6')]({'port':0x232a});function request(_0x34b341,_0x3c5eab){return new BPromise(function(_0x21b169,_0x5ecd58){return client[_0xafee('0x7')](_0x34b341,_0x3c5eab)[_0xafee('0x8')](function(_0x463dcd){if(_0x463dcd['error']){return _0x5ecd58(_0x463dcd[_0xafee('0x9')][_0xafee('0xa')]);}else{return _0x21b169(_0x463dcd[_0xafee('0xb')]);}})[_0xafee('0xc')](function(_0x574396){return _0x5ecd58(_0x574396);});});}exports['condition']=function(_0x40bcde,_0x30b76c,_0x4ca88d){return function(_0x354dca){if(_0x4ca88d['rules']&&!_0x4ca88d[_0xafee('0xd')][_0x40bcde]){logger[_0xafee('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x40bcde);return _0x354dca['stop']();}var _0x92a50c=[];for(var _0x2fc185=0x0;_0x2fc185<_0x30b76c[_0xafee('0xf')];_0x2fc185+=0x1){_0x92a50c[_0xafee('0x10')](request(_0xafee('0x11'),{'command':util[_0xafee('0x12')](_0xafee('0x13'),_0x30b76c[_0x2fc185])})[_0xafee('0x8')](function(_0x2368b6){return _0x2368b6&&_0x2368b6[_0xafee('0xa')]&&_0x2368b6[_0xafee('0xa')][_0xafee('0x14')](_0xafee('0x15'))>=0x0?!![]:![];})[_0xafee('0xc')](function(_0x443033){logger[_0xafee('0x9')](_0xafee('0x16'),_0x40bcde,_0x30b76c[_0x2fc185]);}));}BPromise[_0xafee('0x17')](_0x92a50c)[_0xafee('0x8')](function(_0x5e78be){var _0x45d3fc=_[_0xafee('0x18')](_0x5e78be);logger[_0xafee('0xe')](_0xafee('0x19'),_0x40bcde,_0x30b76c['join'](_0xafee('0x1a')),_0x45d3fc);_0x354dca[_0xafee('0x1b')](_0x45d3fc);})['catch'](function(_0xf7946b){console[_0xafee('0x1c')](_0xf7946b);logger[_0xafee('0x9')](_0xafee('0x19'),_0x40bcde,_0x30b76c[_0xafee('0x1d')](_0xafee('0x1a')),_0xf7946b[_0xafee('0x1e')]);_0x354dca[_0xafee('0x1f')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 3d8fbc1..3d68ea0 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 _0x4e81=['[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfer','transfertargetuniqueid','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][agentconnect]','agentconnectAt','connect','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete'];(function(_0x11146c,_0x56bb9b){var _0x2fdfe0=function(_0x378c7b){while(--_0x378c7b){_0x11146c['push'](_0x11146c['shift']());}};_0x2fdfe0(++_0x56bb9b);}(_0x4e81,0x1bc));var _0x14e8=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x4e81[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var utils=require(_0x14e8('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x533fb3,_0x4b9800){utils['info'](util[_0x14e8('0x3')](_0x14e8('0x4'),_0x533fb3[_0x14e8('0x5')],_0x533fb3[_0x14e8('0x6')],_0x533fb3[_0x14e8('0x7')],_0x533fb3[_0x14e8('0x8')],_0x533fb3['interface'],_0x533fb3['calleridnum'],_0x533fb3[_0x14e8('0x9')],_0x533fb3[_0x14e8('0xa')]));if(_0x533fb3[_0x14e8('0x7')]){utils[_0x14e8('0xb')](_0x533fb3[_0x14e8('0x7')])[_0x14e8('0xc')](function(_0x39127a){if(_0x39127a){_0x533fb3[_0x14e8('0xd')]=_0x39127a[_0x14e8('0xd')];_0x533fb3['agentacw']=_0x533fb3[_0x14e8('0xe')]?_0x39127a[_0x14e8('0xf')]:![];_0x533fb3[_0x14e8('0x10')]=_0x533fb3[_0x14e8('0x11')]?_0x39127a[_0x14e8('0x12')]:0x0;}utils[_0x14e8('0x13')](_0x14e8('0x14'),_0x533fb3);});}else{utils[_0x14e8('0x13')]('CreateVoiceAgentReport',_0x533fb3);}if(_0x4b9800){delete transfers[_0x533fb3[_0x14e8('0x5')]];}else{delete agents[_0x533fb3['destuniqueid']];}}exports[_0x14e8('0x15')]=function(_0x341d40){try{utils[_0x14e8('0x16')](util['format'](_0x14e8('0x17'),_0x341d40['uniqueid']),_0x341d40);agents[_0x341d40[_0x14e8('0x18')]]=_0x341d40;agents[_0x341d40['destuniqueid']][_0x14e8('0x19')]=utils[_0x14e8('0x1a')]();agents[_0x341d40[_0x14e8('0x18')]][_0x14e8('0xa')]='called';agents[_0x341d40[_0x14e8('0x18')]][_0x14e8('0x9')]=null;agents[_0x341d40[_0x14e8('0x18')]][_0x14e8('0x1b')]=null;utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x1d'),_0x341d40[_0x14e8('0x5')],agents[_0x341d40['destuniqueid']][_0x14e8('0x8')],_0x341d40[_0x14e8('0x18')]));}catch(_0x151f16){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')]('[%s][agents][agentcalled]',_0x341d40[_0x14e8('0x5')]),_0x151f16);}};exports[_0x14e8('0x1f')]=function(_0x2abfec){try{if(!_['isNil'](agents[_0x2abfec[_0x14e8('0x18')]])){utils['debug'](util[_0x14e8('0x3')](_0x14e8('0x20'),_0x2abfec[_0x14e8('0x5')]),_0x2abfec);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x2abfec[_0x14e8('0x5')],agents[_0x2abfec['destuniqueid']][_0x14e8('0x8')],_0x2abfec[_0x14e8('0x18')]));agents[_0x2abfec['destuniqueid']]['agentringnoanswer']=!![];agents[_0x2abfec['destuniqueid']][_0x14e8('0x21')]=utils[_0x14e8('0x1a')]();agents[_0x2abfec[_0x14e8('0x18')]][_0x14e8('0xa')]=_0x14e8('0x22');agents[_0x2abfec['destuniqueid']][_0x14e8('0x23')]=_0x14e8('0x22');agents[_0x2abfec[_0x14e8('0x18')]][_0x14e8('0x24')]=_0x2abfec[_0x14e8('0x25')]?parseInt(_0x2abfec[_0x14e8('0x25')])/0x3e8:0x0;agents[_0x2abfec[_0x14e8('0x18')]]['talktime']=0x0;unanswered[_0x14e8('0x26')](_0x2abfec[_0x14e8('0x18')]);}}catch(_0x393ab0){utils['error'](util['format']('[%s][agents][agentringnoanswer]',_0x2abfec[_0x14e8('0x5')]),_0x393ab0);}};exports[_0x14e8('0x27')]=function(_0x567385){try{_[_0x14e8('0x28')](agents,function(_0x1d71ca,_0x176e8f){if(_0x1d71ca[_0x14e8('0x5')]==_0x567385['uniqueid']&&!_[_0x14e8('0x29')](unanswered,_0x1d71ca[_0x14e8('0x18')])){utils[_0x14e8('0x16')](util[_0x14e8('0x3')](_0x14e8('0x2a'),_0x567385['uniqueid']),_0x567385);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x2b'),_0x567385[_0x14e8('0x5')],_0x1d71ca['membername'],_0x1d71ca[_0x14e8('0x18')]));_0x1d71ca['agentringnoanswer']=!![];_0x1d71ca[_0x14e8('0x21')]=utils[_0x14e8('0x1a')]();_0x1d71ca[_0x14e8('0xa')]=_0x14e8('0x2c');_0x1d71ca[_0x14e8('0x23')]=_0x14e8('0x2c');_0x1d71ca[_0x14e8('0x24')]=_0x567385[_0x14e8('0x24')];_0x1d71ca[_0x14e8('0x2d')]=0x0;writeDB(_0x1d71ca);}});}catch(_0x2acf6a){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')]('[%s][agents][queuecallerabandon]',_0x567385['uniqueid']),_0x2acf6a);}};exports['agentconnect']=function(_0x16ff09){try{if(agents[_0x16ff09['destuniqueid']]){utils[_0x14e8('0x16')](util['format'](_0x14e8('0x2e'),_0x16ff09[_0x14e8('0x5')]),_0x16ff09);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x16ff09[_0x14e8('0x5')],agents[_0x16ff09['destuniqueid']][_0x14e8('0x8')],_0x16ff09[_0x14e8('0x18')]));agents[_0x16ff09[_0x14e8('0x18')]][_0x14e8('0x2f')]=utils[_0x14e8('0x1a')]();agents[_0x16ff09[_0x14e8('0x18')]]['connectedlinenum']=_0x16ff09[_0x14e8('0x9')];agents[_0x16ff09['destuniqueid']][_0x14e8('0x1b')]=_0x16ff09[_0x14e8('0x1b')];agents[_0x16ff09[_0x14e8('0x18')]]['holdtime']=_0x16ff09[_0x14e8('0x25')];agents[_0x16ff09[_0x14e8('0x18')]]['lastevent']=_0x14e8('0x30');_[_0x14e8('0x28')](agents,function(_0x1f429a,_0x3a7aa7){if(_0x1f429a[_0x14e8('0x18')]!=_0x16ff09[_0x14e8('0x18')]&&_0x1f429a[_0x14e8('0x5')]==_0x16ff09[_0x14e8('0x5')]){_0x1f429a[_0x14e8('0x2d')]=0x0;_0x1f429a[_0x14e8('0x24')]=_0x16ff09[_0x14e8('0x25')];_0x1f429a[_0x14e8('0x1f')]=!![];_0x1f429a[_0x14e8('0x21')]=utils[_0x14e8('0x1a')]();_0x1f429a[_0x14e8('0xa')]='answered_elsewhere';_0x1f429a[_0x14e8('0x23')]='answered_elsewhere';_0x1f429a['answeredelsewheredestinationuniqueid']=_0x16ff09['destuniqueid'];_0x1f429a[_0x14e8('0x31')]=_0x16ff09['membername'];writeDB(_0x1f429a);}});}}catch(_0x46a3c4){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')](_0x14e8('0x2e'),_0x16ff09[_0x14e8('0x5')]),_0x46a3c4);}};exports[_0x14e8('0xe')]=function(_0x125af5){try{if(!_[_0x14e8('0x32')](agents[_0x125af5[_0x14e8('0x18')]])){utils[_0x14e8('0x16')](util[_0x14e8('0x3')]('[%s][agents][agentcomplete]',_0x125af5[_0x14e8('0x5')]),_0x125af5);utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x33'),_0x125af5['uniqueid'],agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0x8')],_0x125af5['destuniqueid']));agents[_0x125af5['destuniqueid']][_0x14e8('0xe')]=!![];agents[_0x125af5['destuniqueid']]['agentcompleteAt']=utils[_0x14e8('0x1a')]();agents[_0x125af5[_0x14e8('0x18')]]['talktime']=utils[_0x14e8('0x34')](agents[_0x125af5[_0x14e8('0x18')]]['agentcompleteAt'],agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0x2f')]);agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0x23')]=_0x125af5[_0x14e8('0x23')];agents[_0x125af5[_0x14e8('0x18')]][_0x14e8('0xa')]=_0x14e8('0x35');writeDB(agents[_0x125af5[_0x14e8('0x18')]]);}}catch(_0x42180d){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')](_0x14e8('0x36'),_0x125af5[_0x14e8('0x5')]),_0x42180d);}};exports[_0x14e8('0x37')]=function(_0x1f50bc){try{if(!_['isNil'](agents[_0x1f50bc[_0x14e8('0x38')]])){utils['debug'](util[_0x14e8('0x3')](_0x14e8('0x39'),_0x1f50bc[_0x14e8('0x5')]),_0x1f50bc);utils[_0x14e8('0x1c')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1f50bc['uniqueid'],agents[_0x1f50bc[_0x14e8('0x38')]]['membername'],agents[_0x1f50bc['transfereruniqueid']][_0x14e8('0x5')]));agents[_0x1f50bc[_0x14e8('0x38')]]['transfer']=!![];agents[_0x1f50bc[_0x14e8('0x38')]][_0x14e8('0x3a')]=_0x14e8('0x3b');agents[_0x1f50bc[_0x14e8('0x38')]]['transferexten']=_0x1f50bc['extension'];agents[_0x1f50bc[_0x14e8('0x38')]][_0x14e8('0x3c')]=agents[_0x1f50bc[_0x14e8('0x38')]][_0x14e8('0x5')];}}catch(_0x41b5ab){utils[_0x14e8('0x1e')](util['format'](_0x14e8('0x39'),_0x1f50bc[_0x14e8('0x5')]),_0x41b5ab);}};exports[_0x14e8('0x3d')]=function(_0xd5adc1){try{utils['debug'](util[_0x14e8('0x3')](_0x14e8('0x3e'),_0xd5adc1[_0x14e8('0x3f')]),_0xd5adc1);if(_0xd5adc1[_0x14e8('0x3f')]==_0xd5adc1['origtransfererlinkedid']){if(!_[_0x14e8('0x32')](agents[_0xd5adc1[_0x14e8('0x40')]])){utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x41'),_0xd5adc1[_0x14e8('0x3f')],agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x8')]));agents[_0xd5adc1['secondtransfereruniqueid']]['transfer']=!![];agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x3a')]=_0x14e8('0x42');agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x43')]=_0xd5adc1['origtransfererexten'];agents[_0xd5adc1['secondtransfereruniqueid']]['transferuniqueid']=_0xd5adc1[_0x14e8('0x3f')];}if(_0xd5adc1[_0x14e8('0x44')]&&agents[_0xd5adc1[_0x14e8('0x44')]]){agents[_0xd5adc1['transfereeuniqueid']][_0x14e8('0x45')]=0x1;transfers[_0xd5adc1[_0x14e8('0x44')]]=_[_0x14e8('0x46')](agents[_0xd5adc1['transfereeuniqueid']]);transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x47')]=agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x47')];transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x48')]=agents[_0xd5adc1[_0x14e8('0x40')]][_0x14e8('0x48')];transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x19')]=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1['transfereeuniqueid']][_0x14e8('0x2f')]=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x24')]=0x0;transfers[_0xd5adc1[_0x14e8('0x44')]][_0x14e8('0x45')]=0x2;}}else if(_0xd5adc1[_0x14e8('0x40')]==_0xd5adc1[_0x14e8('0x49')]){if(!_[_0x14e8('0x32')](agents[_0xd5adc1[_0x14e8('0x3f')]])){utils[_0x14e8('0x1c')](util[_0x14e8('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0xd5adc1[_0x14e8('0x3f')],agents[_0xd5adc1[_0x14e8('0x3f')]]['membername']));agents[_0xd5adc1[_0x14e8('0x3f')]][_0x14e8('0x4a')]=!![];agents[_0xd5adc1[_0x14e8('0x3f')]][_0x14e8('0x3a')]=_0x14e8('0x42');agents[_0xd5adc1[_0x14e8('0x3f')]][_0x14e8('0x43')]=_0xd5adc1['secondtransfererexten'];agents[_0xd5adc1['origtransfereruniqueid']]['transferuniqueid']=_0xd5adc1[_0x14e8('0x40')];}if(_0xd5adc1[_0x14e8('0x4b')]&&agents[_0xd5adc1[_0x14e8('0x4b')]]){agents[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x45')]=0x1;transfers[_0xd5adc1[_0x14e8('0x4b')]]=_[_0x14e8('0x46')](agents[_0xd5adc1['transfertargetuniqueid']]);transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x47')]=agents[_0xd5adc1['origtransfereruniqueid']][_0x14e8('0x47')];transfers[_0xd5adc1[_0x14e8('0x4b')]]['calleridname']=agents[_0xd5adc1['origtransfereruniqueid']]['calleridname'];transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x19')]=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1[_0x14e8('0x4b')]]['agentconnectAt']=utils[_0x14e8('0x1a')]();transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x24')]=0x0;transfers[_0xd5adc1[_0x14e8('0x4b')]][_0x14e8('0x45')]=0x2;}}}catch(_0x36d0e5){utils['error'](util[_0x14e8('0x3')](_0x14e8('0x3e'),_0xd5adc1[_0x14e8('0x3f')]),_0x36d0e5);}};exports['hangup']=function(_0x5add74){try{utils[_0x14e8('0x16')](util['format'](_0x14e8('0x4c'),_0x5add74['uniqueid']),_0x5add74);if(agents[_0x5add74[_0x14e8('0x5')]]&&agents[_0x5add74['uniqueid']][_0x14e8('0x23')]===_0x14e8('0x22')){if(_0x5add74['cause']==='21'){agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x23')]=_0x14e8('0x4d');agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]=_0x14e8('0x4d');}utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x4e'),_0x5add74[_0x14e8('0x5')],agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x8')],agents[_0x5add74[_0x14e8('0x5')]]['reason'],agents[_0x5add74['uniqueid']]['lastevent']));writeDB(agents[_0x5add74[_0x14e8('0x5')]]);var _0x52f0a7=unanswered[_0x14e8('0x4f')](_0x5add74['uniqueid']);if(_0x52f0a7>-0x1){unanswered[_0x14e8('0x50')](_0x52f0a7,0x1);}}if(transfers[_0x5add74['uniqueid']]){transfers[_0x5add74['uniqueid']]['agentcomplete']=!![];transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x51')]=utils[_0x14e8('0x1a')]();transfers[_0x5add74['uniqueid']][_0x14e8('0x2d')]=utils['diffTime'](transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x51')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x2f')]);transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x23')]=_0x14e8('0x52');transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]='complete';utils[_0x14e8('0x1c')](util['format'](_0x14e8('0x4e'),_0x5add74[_0x14e8('0x5')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x8')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x23')],transfers[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]));writeDB(transfers[_0x5add74[_0x14e8('0x5')]],!![]);}if(agents[_0x5add74['uniqueid']]&&agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x2f')]){agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xe')]=!![];agents[_0x5add74['uniqueid']][_0x14e8('0x51')]=utils[_0x14e8('0x1a')]();agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x2d')]=utils['diffTime'](agents[_0x5add74[_0x14e8('0x5')]]['agentcompleteAt'],agents[_0x5add74[_0x14e8('0x5')]]['agentconnectAt']);agents[_0x5add74['uniqueid']][_0x14e8('0x23')]=agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x4a')]?_0x14e8('0x4a'):_0x14e8('0x52');agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0xa')]=_0x14e8('0x35');utils[_0x14e8('0x1c')](util[_0x14e8('0x3')](_0x14e8('0x4e'),_0x5add74['uniqueid'],agents[_0x5add74[_0x14e8('0x5')]][_0x14e8('0x8')],agents[_0x5add74[_0x14e8('0x5')]]['reason'],agents[_0x5add74['uniqueid']][_0x14e8('0xa')]));writeDB(agents[_0x5add74[_0x14e8('0x5')]]);}}catch(_0xc3ebbc){utils[_0x14e8('0x1e')](util[_0x14e8('0x3')](_0x14e8('0x4c'),_0x5add74[_0x14e8('0x5')]),_0xc3ebbc);}}; \ No newline at end of file +var _0x76dc=['origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','agent','complete','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','membername','interface','calleridnum','queue','getVoiceQueueByName','type','agentcomplete','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','lastevent','called','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','ringtime','connect','answered_elsewhere','answeredelsewheremembername','isNil','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','[%s][agents][attendedtransfer]','origtransfereruniqueid'];(function(_0xbc13e1,_0x14d88b){var _0xa87f5a=function(_0x11ea58){while(--_0x11ea58){_0xbc13e1['push'](_0xbc13e1['shift']());}};_0xa87f5a(++_0x14d88b);}(_0x76dc,0x1f2));var _0xc76d=function(_0x30b63a,_0x226768){_0x30b63a=_0x30b63a-0x0;var _0x58e99e=_0x76dc[_0x30b63a];return _0x58e99e;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var utils=require(_0xc76d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26e85e,_0x49c651){utils[_0xc76d('0x3')](util[_0xc76d('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x26e85e[_0xc76d('0x5')],_0x26e85e['channel'],_0x26e85e['queue'],_0x26e85e[_0xc76d('0x6')],_0x26e85e[_0xc76d('0x7')],_0x26e85e[_0xc76d('0x8')],_0x26e85e['connectedlinenum'],_0x26e85e['lastevent']));if(_0x26e85e[_0xc76d('0x9')]){utils[_0xc76d('0xa')](_0x26e85e[_0xc76d('0x9')])['then'](function(_0x570197){if(_0x570197){_0x26e85e[_0xc76d('0xb')]=_0x570197[_0xc76d('0xb')];_0x26e85e['agentacw']=_0x26e85e[_0xc76d('0xc')]?_0x570197['acw']:![];_0x26e85e[_0xc76d('0xd')]=_0x26e85e[_0xc76d('0xe')]?_0x570197[_0xc76d('0xf')]:0x0;}utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);});}else{utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);}if(_0x49c651){delete transfers[_0x26e85e[_0xc76d('0x5')]];}else{delete agents[_0x26e85e[_0xc76d('0x12')]];}}exports[_0xc76d('0x13')]=function(_0x1a7b47){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x1a7b47);agents[_0x1a7b47[_0xc76d('0x12')]]=_0x1a7b47;agents[_0x1a7b47[_0xc76d('0x12')]]['agentcalledAt']=utils[_0xc76d('0x16')]();agents[_0x1a7b47[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x18');agents[_0x1a7b47['destuniqueid']][_0xc76d('0x19')]=null;agents[_0x1a7b47['destuniqueid']]['connectedlinename']=null;utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1a'),_0x1a7b47[_0xc76d('0x5')],agents[_0x1a7b47[_0xc76d('0x12')]]['membername'],_0x1a7b47[_0xc76d('0x12')]));}catch(_0x361f42){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x361f42);}};exports[_0xc76d('0x1c')]=function(_0x324db7){try{if(!_['isNil'](agents[_0x324db7[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x1d'),_0x324db7[_0xc76d('0x5')]),_0x324db7);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1e'),_0x324db7[_0xc76d('0x5')],agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x6')],_0x324db7['destuniqueid']));agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x1c')]=!![];agents[_0x324db7['destuniqueid']][_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();agents[_0x324db7['destuniqueid']][_0xc76d('0x17')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x21')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x22')]=_0x324db7['ringtime']?parseInt(_0x324db7['ringtime'])/0x3e8:0x0;agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x23')]=0x0;unanswered['push'](_0x324db7[_0xc76d('0x12')]);}}catch(_0x52a79a){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x1d'),_0x324db7['uniqueid']),_0x52a79a);}};exports[_0xc76d('0x24')]=function(_0x18a7fa){try{_['forIn'](agents,function(_0x3d4076,_0x1c68f3){if(_0x3d4076[_0xc76d('0x5')]==_0x18a7fa[_0xc76d('0x5')]&&!_['includes'](unanswered,_0x3d4076[_0xc76d('0x12')])){utils['debug'](util[_0xc76d('0x4')]('[%s][agents][queuecallerabandon]',_0x18a7fa[_0xc76d('0x5')]),_0x18a7fa);utils[_0xc76d('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x18a7fa['uniqueid'],_0x3d4076['membername'],_0x3d4076[_0xc76d('0x12')]));_0x3d4076[_0xc76d('0x1c')]=!![];_0x3d4076[_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();_0x3d4076[_0xc76d('0x17')]='abandoned';_0x3d4076[_0xc76d('0x21')]='abandoned';_0x3d4076[_0xc76d('0x22')]=_0x18a7fa['holdtime'];_0x3d4076[_0xc76d('0x23')]=0x0;writeDB(_0x3d4076);}});}catch(_0x2332f5){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x25'),_0x18a7fa['uniqueid']),_0x2332f5);}};exports[_0xc76d('0x26')]=function(_0x371306){try{if(agents[_0x371306[_0xc76d('0x12')]]){utils['debug'](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x371306);utils['info'](util[_0xc76d('0x4')](_0xc76d('0x28'),_0x371306[_0xc76d('0x5')],agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x6')],_0x371306[_0xc76d('0x12')]));agents[_0x371306['destuniqueid']]['agentconnectAt']=utils[_0xc76d('0x16')]();agents[_0x371306['destuniqueid']][_0xc76d('0x19')]=_0x371306[_0xc76d('0x19')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x29')]=_0x371306['connectedlinename'];agents[_0x371306['destuniqueid']][_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x2b');_['forIn'](agents,function(_0x42404c,_0xb264b0){if(_0x42404c[_0xc76d('0x12')]!=_0x371306[_0xc76d('0x12')]&&_0x42404c[_0xc76d('0x5')]==_0x371306[_0xc76d('0x5')]){_0x42404c[_0xc76d('0x23')]=0x0;_0x42404c[_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];_0x42404c[_0xc76d('0x1c')]=!![];_0x42404c['agentringnoanswerAt']=utils['now']();_0x42404c[_0xc76d('0x17')]=_0xc76d('0x2c');_0x42404c[_0xc76d('0x21')]=_0xc76d('0x2c');_0x42404c['answeredelsewheredestinationuniqueid']=_0x371306['destuniqueid'];_0x42404c[_0xc76d('0x2d')]=_0x371306[_0xc76d('0x6')];writeDB(_0x42404c);}});}}catch(_0x3e471e){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x3e471e);}};exports[_0xc76d('0xc')]=function(_0x50e922){try{if(!_[_0xc76d('0x2e')](agents[_0x50e922[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][agentcomplete]',_0x50e922['uniqueid']),_0x50e922);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x50e922['uniqueid'],agents[_0x50e922['destuniqueid']][_0xc76d('0x6')],_0x50e922[_0xc76d('0x12')]));agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0xc')]=!![];agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0x50e922[_0xc76d('0x12')]]['talktime']=utils[_0xc76d('0x30')](agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')],agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x31')]);agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x21')]=_0x50e922[_0xc76d('0x21')];agents[_0x50e922[_0xc76d('0x12')]]['lastevent']='complete';writeDB(agents[_0x50e922[_0xc76d('0x12')]]);}}catch(_0x170f47){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x32'),_0x50e922['uniqueid']),_0x170f47);}};exports[_0xc76d('0x33')]=function(_0x1ede13){try{if(!_['isNil'](agents[_0x1ede13['transfereruniqueid']])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][blindtransfer]',_0x1ede13[_0xc76d('0x5')]),_0x1ede13);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x34'),_0x1ede13[_0xc76d('0x5')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x6')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x5')]));agents[_0x1ede13[_0xc76d('0x35')]]['transfer']=!![];agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x36')]=_0xc76d('0x37');agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x38')]=_0x1ede13[_0xc76d('0x39')];agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x3a')]=agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x5')];}}catch(_0x12c972){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x3b'),_0x1ede13['uniqueid']),_0x12c972);}};exports['attendedtransfer']=function(_0x5bec6c){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x3c'),_0x5bec6c[_0xc76d('0x3d')]),_0x5bec6c);if(_0x5bec6c[_0xc76d('0x3d')]==_0x5bec6c[_0xc76d('0x3e')]){if(!_['isNil'](agents[_0x5bec6c[_0xc76d('0x3f')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x6')]));agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x41')]=!![];agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x36')]=_0xc76d('0x42');agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x38')]=_0x5bec6c[_0xc76d('0x43')];agents[_0x5bec6c['secondtransfereruniqueid']]['transferuniqueid']=_0x5bec6c[_0xc76d('0x3d')];}if(_0x5bec6c['transfereeuniqueid']&&agents[_0x5bec6c[_0xc76d('0x44')]]){agents[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x45')]=0x1;transfers[_0x5bec6c[_0xc76d('0x44')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x44')]]);transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x8')];transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x47')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x47')];transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x31')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x44')]]['agententerreason']=0x2;}}else if(_0x5bec6c['secondtransfereruniqueid']==_0x5bec6c['secondtransfererlinkedid']){if(!_[_0xc76d('0x2e')](agents[_0x5bec6c[_0xc76d('0x3d')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x6')]));agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x41')]=!![];agents[_0x5bec6c['origtransfereruniqueid']]['transfertype']=_0xc76d('0x42');agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x38')]=_0x5bec6c['secondtransfererexten'];agents[_0x5bec6c[_0xc76d('0x3d')]]['transferuniqueid']=_0x5bec6c['secondtransfereruniqueid'];}if(_0x5bec6c['transfertargetuniqueid']&&agents[_0x5bec6c[_0xc76d('0x49')]]){agents[_0x5bec6c[_0xc76d('0x49')]]['agententerreason']=0x1;transfers[_0x5bec6c[_0xc76d('0x49')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x49')]]);transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x8')];transfers[_0x5bec6c['transfertargetuniqueid']]['calleridname']=agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x47')];transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]]['agentconnectAt']=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x45')]=0x2;}}}catch(_0x2af760){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')]('[%s][agents][attendedtransfer]',_0x5bec6c[_0xc76d('0x3d')]),_0x2af760);}};exports['hangup']=function(_0xa9f2e8){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x4a'),_0xa9f2e8['uniqueid']),_0xa9f2e8);if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8['uniqueid']]['reason']===_0xc76d('0x20')){if(_0xa9f2e8[_0xc76d('0x4b')]==='21'){agents[_0xa9f2e8['uniqueid']][_0xc76d('0x21')]=_0xc76d('0x4c');agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]=_0xc76d('0x4c');}utils['info'](util[_0xc76d('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]]['membername'],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]));writeDB(agents[_0xa9f2e8[_0xc76d('0x5')]]);var _0x277382=unanswered['indexOf'](_0xa9f2e8[_0xc76d('0x5')]);if(_0x277382>-0x1){unanswered['splice'](_0x277382,0x1);}}if(transfers[_0xa9f2e8['uniqueid']]){transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];transfers[_0xa9f2e8['uniqueid']][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=_0xc76d('0x4d');transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]=_0xc76d('0x4e');utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],transfers[_0xa9f2e8[_0xc76d('0x5')]]['membername'],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]));writeDB(transfers[_0xa9f2e8[_0xc76d('0x5')]],!![]);}if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]){agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x41')]?'transfer':_0xc76d('0x4d');agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']=_0xc76d('0x4e');utils[_0xc76d('0x3')](util['format'](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x6')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']));writeDB(agents[_0xa9f2e8['uniqueid']]);}}catch(_0xe6a1dc){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x4a'),_0xa9f2e8[_0xc76d('0x5')]),_0xe6a1dc);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 4fb73ba..bd4cd70 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 _0x8208=['FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','OutgoingSpoolFailed','context','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','now','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER'];(function(_0x505fbf,_0x33e41d){var _0x4cc28c=function(_0x1120da){while(--_0x1120da){_0x505fbf['push'](_0x505fbf['shift']());}};_0x4cc28c(++_0x33e41d);}(_0x8208,0x14b));var _0x8820=function(_0x1699c0,_0x56b5fe){_0x1699c0=_0x1699c0-0x0;var _0x9941c1=_0x8208[_0x1699c0];return _0x9941c1;};'use strict';var _=require(_0x8820('0x0'));var util=require(_0x8820('0x1'));var utils=require(_0x8820('0x2'));var transfers=require(_0x8820('0x3'));var dispositions=[_0x8820('0x4'),_0x8820('0x5'),_0x8820('0x5'),_0x8820('0x4'),_0x8820('0x4'),'NO\x20ANSWER',_0x8820('0x6'),_0x8820('0x7'),_0x8820('0x5'),_0x8820('0x5'),_0x8820('0x5')];var channels={};function writeDB(_0x23ace5){var _0x4ce495;if(transfers[_0x8820('0x8')][_0x23ace5[_0x8820('0x9')]]){_0x4ce495=_0x23ace5['uniqueid'];_0x23ace5[_0x8820('0x9')]=transfers['blinds'][_0x23ace5['uniqueid']][_0x8820('0xa')];}utils[_0x8820('0xb')](util['format'](_0x8820('0xc'),_0x23ace5['uniqueid'],_0x23ace5[_0x8820('0xd')],_0x23ace5['queue'],_0x23ace5['membername'],_0x23ace5[_0x8820('0xe')],_0x23ace5[_0x8820('0xf')],_0x23ace5[_0x8820('0x10')],_0x23ace5[_0x8820('0x11')]));if(_0x23ace5[_0x8820('0x12')]){utils['getUserByInternal'](_0x23ace5[_0x8820('0x12')])[_0x8820('0x13')](function(_0x3887d5){if(_0x3887d5){_0x23ace5[_0x8820('0x14')]=_0x3887d5['id'];}utils[_0x8820('0x15')](_0x8820('0x16'),_0x23ace5);});}else{utils['request'](_0x8820('0x16'),_0x23ace5);}if(channels[_0x23ace5['uniqueid']]){delete channels[_0x23ace5[_0x8820('0x9')]];}else if(_0x4ce495&&channels[_0x4ce495]){if(!transfers[_0x8820('0x8')][_0x4ce495][_0x8820('0x17')])delete transfers[_0x8820('0x8')][_0x4ce495];delete channels[_0x4ce495];}}exports[_0x8820('0x18')]=function(_0xeda9e7){try{utils[_0x8820('0x19')](util[_0x8820('0x1a')]('[%s][calls][newchannel]',_0xeda9e7[_0x8820('0x9')]),_0xeda9e7);if(_0xeda9e7[_0x8820('0x9')]==_0xeda9e7['linkedid']&&_0xeda9e7['channel']!=_0x8820('0x1b')){utils['info'](util[_0x8820('0x1a')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0xeda9e7[_0x8820('0x9')],_0xeda9e7[_0x8820('0x1c')],_0xeda9e7[_0x8820('0x1d')]));channels[_0xeda9e7[_0x8820('0x9')]]={'uniqueid':_0xeda9e7['uniqueid'],'accountcode':_0xeda9e7['accountcode'],'source':_0xeda9e7[_0x8820('0xf')],'destination':_0xeda9e7['exten'],'destinationcontext':_0xeda9e7['context'],'channel':_0xeda9e7[_0x8820('0xd')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x8820('0x1e')};}}catch(_0x5e6650){utils[_0x8820('0x1f')](util[_0x8820('0x1a')]('[%s][calls][newchannel]',_0xeda9e7[_0x8820('0x9')]),_0x5e6650);}};exports[_0x8820('0x20')]=function(_0x10c5d9){try{utils['debug'](util[_0x8820('0x1a')](_0x8820('0x21'),_0x10c5d9[_0x8820('0x9')]),_0x10c5d9);if(!_[_0x8820('0x22')](channels[_0x10c5d9['uniqueid']])&&_0x10c5d9[_0x8820('0x23')]==0x6){utils['info'](util[_0x8820('0x1a')](_0x8820('0x24'),_0x10c5d9[_0x8820('0x9')],_0x10c5d9[_0x8820('0x1c')],_0x10c5d9[_0x8820('0xd')]));if(_['isNil'](channels[_0x10c5d9[_0x8820('0x9')]][_0x8820('0x25')])){channels[_0x10c5d9['uniqueid']][_0x8820('0x25')]=utils['now']();}}else if(!_[_0x8820('0x22')](channels[_0x10c5d9[_0x8820('0x26')]])&&_0x10c5d9[_0x8820('0x23')]==0x6&&_0x10c5d9[_0x8820('0x1c')]!='transfer'){utils['info'](util['format'](_0x8820('0x27'),_0x10c5d9['uniqueid'],_0x10c5d9[_0x8820('0x26')],_0x10c5d9[_0x8820('0x1c')],_0x10c5d9[_0x8820('0xd')]));channels[_0x10c5d9[_0x8820('0x26')]]['accountcode']=_0x10c5d9[_0x8820('0x12')];channels[_0x10c5d9['linkedid']][_0x8820('0x28')]=_0x10c5d9['channel'];if(_['isNil'](channels[_0x10c5d9[_0x8820('0x26')]]['answertime'])){channels[_0x10c5d9['linkedid']][_0x8820('0x29')]=utils['now']();}channels[_0x10c5d9[_0x8820('0x26')]][_0x8820('0x2a')]=dispositions[_[_0x8820('0x2b')](_0x10c5d9[_0x8820('0x23')])]||_0x8820('0x6');}}catch(_0x191f86){utils[_0x8820('0x1f')](util[_0x8820('0x1a')](_0x8820('0x21'),_0x10c5d9['uniqueid']),_0x191f86);}};exports[_0x8820('0x2c')]=function(_0xf34947){try{if(!_[_0x8820('0x22')](channels[_0xf34947['uniqueid']])){utils[_0x8820('0x19')](util[_0x8820('0x1a')](_0x8820('0x2d'),_0xf34947[_0x8820('0x9')]),_0xf34947);if(_[_0x8820('0x22')](channels[_0xf34947[_0x8820('0x9')]][_0x8820('0x2e')])){channels[_0xf34947[_0x8820('0x9')]]['callerid']=_0xf34947[_0x8820('0x2f')]+'\x20<'+_0xf34947['calleridnum']+'>';}utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x30'),_0xf34947[_0x8820('0x9')],channels[_0xf34947[_0x8820('0x9')]][_0x8820('0x2e')],_0xf34947[_0x8820('0x31')]));channels[_0xf34947['uniqueid']]['endtime']=utils['now']();channels[_0xf34947['uniqueid']][_0x8820('0x32')]=utils[_0x8820('0x33')](channels[_0xf34947[_0x8820('0x9')]][_0x8820('0x34')],channels[_0xf34947[_0x8820('0x9')]][_0x8820('0x35')]);channels[_0xf34947[_0x8820('0x9')]][_0x8820('0x36')]=channels[_0xf34947[_0x8820('0x9')]][_0x8820('0x29')]?utils[_0x8820('0x33')](channels[_0xf34947['uniqueid']][_0x8820('0x34')],channels[_0xf34947[_0x8820('0x9')]][_0x8820('0x29')]):0x0;writeDB(channels[_0xf34947[_0x8820('0x9')]]);}}catch(_0x2c964b){utils[_0x8820('0x1f')](util['format']('[%s][calls][hangup]',_0xf34947[_0x8820('0x9')]),_0x2c964b);}};exports[_0x8820('0x37')]=function(_0x253e08){try{if(!_[_0x8820('0x22')](channels[_0x253e08[_0x8820('0x38')]])){utils[_0x8820('0x19')](util['format']('[%s][calls][attendedtransfer]',_0x253e08['origtransfereruniqueid']),_0x253e08);if(channels[_0x253e08[_0x8820('0x38')]][_0x8820('0xd')]==_0x253e08[_0x8820('0x39')]){utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x3a'),_0x253e08[_0x8820('0x3b')],_0x253e08[_0x8820('0x38')],_0x253e08[_0x8820('0x3c')]));channels[_0x253e08['localtwolinkedid']][_0x8820('0x28')]=_0x253e08[_0x8820('0x3c')];channels[_0x253e08[_0x8820('0x38')]][_0x8820('0x3d')]=_0x8820('0x3e');}else if(channels[_0x253e08[_0x8820('0x38')]][_0x8820('0xd')]=_0x253e08[_0x8820('0x3f')]){utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x3a'),_0x253e08['origtransfereruniqueid'],_0x253e08[_0x8820('0x38')],_0x253e08[_0x8820('0x40')]));channels[_0x253e08['localtwolinkedid']][_0x8820('0x28')]=_0x253e08[_0x8820('0x40')];channels[_0x253e08['localtwolinkedid']]['userfield']=_0x8820('0x3e');}}}catch(_0x26d532){utils[_0x8820('0x1f')](util[_0x8820('0x1a')](_0x8820('0x41'),_0x253e08[_0x8820('0x3b')]),_0x26d532);}};exports[_0x8820('0x42')]=function(_0x2fbfe8){try{if(!_[_0x8820('0x22')](channels[_0x2fbfe8[_0x8820('0x9')]])){utils['debug'](util[_0x8820('0x1a')](_0x8820('0x43'),_0x2fbfe8['uniqueid']),_0x2fbfe8);channels[_0x2fbfe8[_0x8820('0x9')]][_0x8820('0x44')]=utils[_0x8820('0x45')]();utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x46'),_0x2fbfe8['uniqueid'],channels[_0x2fbfe8[_0x8820('0x9')]][_0x8820('0x44')]));}}catch(_0x2dcd7a){utils[_0x8820('0x1f')](util['format'](_0x8820('0x43'),_0x2fbfe8[_0x8820('0x9')]),_0x2dcd7a);}};exports['musiconholdstop']=function(_0x1970db){try{if(!_['isNil'](channels[_0x1970db[_0x8820('0x9')]])){utils[_0x8820('0x19')](util['format']('[%s][calls][musiconholdstop]',_0x1970db['uniqueid']),_0x1970db);if(!_[_0x8820('0x22')](channels[_0x1970db['uniqueid']]['musiconholdstartAt'])){channels[_0x1970db['uniqueid']][_0x8820('0x47')]+=utils[_0x8820('0x33')](utils[_0x8820('0x45')](),channels[_0x1970db[_0x8820('0x9')]][_0x8820('0x44')]);utils['info'](util[_0x8820('0x1a')](_0x8820('0x48'),_0x1970db['uniqueid'],channels[_0x1970db[_0x8820('0x9')]]['mohtime']));delete channels[_0x1970db[_0x8820('0x9')]][_0x8820('0x44')];}}}catch(_0x1c037d){utils['error'](util[_0x8820('0x1a')](_0x8820('0x49'),_0x1970db[_0x8820('0x9')]),_0x1c037d);}};exports[_0x8820('0x4a')]=function(_0x5a8551){try{if(!_[_0x8820('0x22')](channels[_0x5a8551[_0x8820('0x9')]])){utils[_0x8820('0x19')](util['format']('[%s][calls][varset]',_0x5a8551['uniqueid']),_0x5a8551);if(!_[_0x8820('0x22')](_0x5a8551[_0x8820('0x4b')][_0x8820('0x4c')])){utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x4d'),_0x5a8551[_0x8820('0x9')],_0x5a8551[_0x8820('0x4e')]));channels[_0x5a8551[_0x8820('0x9')]][_0x8820('0x4f')]=_0x5a8551[_0x8820('0x4e')];}if(!_[_0x8820('0x22')](_0x5a8551['variable'][_0x8820('0x50')])){utils[_0x8820('0xb')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x5a8551['uniqueid'],_0x5a8551[_0x8820('0x4e')]));channels[_0x5a8551[_0x8820('0x9')]][_0x8820('0x51')]=_0x5a8551[_0x8820('0x4e')];channels[_0x5a8551[_0x8820('0x9')]]['callerid']='\x22'+_0x5a8551[_0x8820('0x4e')]+'\x22\x20<'+_0x5a8551[_0x8820('0x4e')]+'>';}if(!_['isNil'](_0x5a8551['variable'][_0x8820('0x52')])||!_['isNil'](_0x5a8551[_0x8820('0x4b')]['xmd-callerid'])){utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x53'),_0x5a8551[_0x8820('0x9')],!_[_0x8820('0x22')](_0x5a8551[_0x8820('0x4b')][_0x8820('0x52')])?'xmd-callerid-preview':_0x8820('0x54'),_0x5a8551[_0x8820('0x4e')]));channels[_0x5a8551[_0x8820('0x9')]]['callerid']=_0x5a8551[_0x8820('0x4e')];}if(!_[_0x8820('0x22')](_0x5a8551[_0x8820('0x4b')][_0x8820('0x55')])||!_['isNil'](_0x5a8551[_0x8820('0x4b')][_0x8820('0x56')])){utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x53'),_0x5a8551[_0x8820('0x9')],!_[_0x8820('0x22')](_0x5a8551['variable'][_0x8820('0x55')])?'xmd-queue':_0x8820('0x56'),_0x5a8551['value']));channels[_0x5a8551[_0x8820('0x9')]]['lastapplication']='Queue';channels[_0x5a8551[_0x8820('0x9')]][_0x8820('0x57')]=_0x5a8551['value'];channels[_0x5a8551[_0x8820('0x9')]]['queue']=!![];}if(!_[_0x8820('0x22')](_0x5a8551[_0x8820('0x4b')][_0x8820('0x58')])){utils['info'](util['format'](_0x8820('0x59'),_0x5a8551[_0x8820('0x9')],_0x5a8551[_0x8820('0x4e')]));channels[_0x5a8551['uniqueid']][_0x8820('0x5a')]=_0x5a8551[_0x8820('0x4e')];}if(!_[_0x8820('0x22')](_0x5a8551['variable'][_0x8820('0x5b')])){utils['info'](util[_0x8820('0x1a')](_0x8820('0x5c'),_0x5a8551[_0x8820('0x9')],_0x5a8551[_0x8820('0x4e')]));channels[_0x5a8551[_0x8820('0x9')]][_0x8820('0x5d')]=_0x5a8551[_0x8820('0x4e')];}if(!_[_0x8820('0x22')](_0x5a8551[_0x8820('0x4b')][_0x8820('0x5e')])){utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x5f'),_0x5a8551[_0x8820('0x9')],_0x5a8551[_0x8820('0x4e')]));channels[_0x5a8551[_0x8820('0x9')]]['routeid']=_0x5a8551[_0x8820('0x4e')];}if(!_[_0x8820('0x22')](_0x5a8551[_0x8820('0x4b')]['sipcallid'])){utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x60'),_0x5a8551[_0x8820('0x9')],_0x5a8551[_0x8820('0x4e')]));channels[_0x5a8551[_0x8820('0x9')]][_0x8820('0x61')]=_0x5a8551[_0x8820('0x4e')];}}}catch(_0x366744){utils[_0x8820('0x1f')](util[_0x8820('0x1a')](_0x8820('0x62'),_0x5a8551[_0x8820('0x9')]),_0x366744);}};exports['newexten']=function(_0x28ad15){try{if(!_[_0x8820('0x22')](channels[_0x28ad15['uniqueid']])){utils['debug'](util['format']('[%s][calls][newexten]',_0x28ad15[_0x8820('0x9')]),_0x28ad15);utils[_0x8820('0xb')](util[_0x8820('0x1a')](_0x8820('0x63'),_0x28ad15[_0x8820('0x9')],_0x28ad15[_0x8820('0x64')],_0x28ad15[_0x8820('0x65')]));if(_0x28ad15[_0x8820('0x64')]['toLowerCase']()==_0x8820('0x66')&&_['startsWith'](_0x28ad15[_0x8820('0x65')]['toLowerCase'](),_0x8820('0x67'))){var _0x53256f=_0x28ad15['appdata'][_0x8820('0x68')]('=');var _0x443b3e=_0x53256f[0x0][_0x8820('0x69')](_0x53256f[0x0]['lastIndexOf']('(')+0x1,_0x53256f[0x0][_0x8820('0x6a')](')'));var _0x5d3857=_0x53256f[0x1];channels[_0x28ad15['uniqueid']][_0x443b3e]=_0x5d3857;}if(!_[_0x8820('0x6b')]([_0x8820('0x2c'),_0x8820('0x6c'),_0x8820('0x6d'),_0x8820('0x66'),_0x8820('0x6e')],_0x28ad15[_0x8820('0x64')]['toLowerCase']())){channels[_0x28ad15['uniqueid']]['lastapplication']=_0x28ad15[_0x8820('0x64')];channels[_0x28ad15[_0x8820('0x9')]]['lastdata']=_0x28ad15[_0x8820('0x65')];}}}catch(_0x5b3c81){utils[_0x8820('0x1f')](util['format'](_0x8820('0x6f'),_0x28ad15[_0x8820('0x9')]),_0x5b3c81);}}; \ No newline at end of file +var _0x6fad=['source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','application','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','context','exten','calleridnum','DOCUMENTATION','error','isNil','channelstate','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value'];(function(_0x4a9d48,_0x207610){var _0x566843=function(_0x8d3a15){while(--_0x8d3a15){_0x4a9d48['push'](_0x4a9d48['shift']());}};_0x566843(++_0x207610);}(_0x6fad,0x17a));var _0xd6fa=function(_0x58319a,_0x145060){_0x58319a=_0x58319a-0x0;var _0x4cf654=_0x6fad[_0x58319a];return _0x4cf654;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var utils=require(_0xd6fa('0x2'));var transfers=require(_0xd6fa('0x3'));var dispositions=[_0xd6fa('0x4'),'FAILED',_0xd6fa('0x5'),'NO\x20ANSWER',_0xd6fa('0x4'),'NO\x20ANSWER',_0xd6fa('0x6'),'BUSY',_0xd6fa('0x5'),_0xd6fa('0x5'),_0xd6fa('0x5')];var channels={};function writeDB(_0x1d5e36){var _0x2f17ae;if(transfers[_0xd6fa('0x7')][_0x1d5e36[_0xd6fa('0x8')]]){_0x2f17ae=_0x1d5e36['uniqueid'];_0x1d5e36[_0xd6fa('0x8')]=transfers['blinds'][_0x1d5e36[_0xd6fa('0x8')]][_0xd6fa('0x9')];}utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')](_0xd6fa('0xc'),_0x1d5e36['uniqueid'],_0x1d5e36['channel'],_0x1d5e36[_0xd6fa('0xd')],_0x1d5e36[_0xd6fa('0xe')],_0x1d5e36[_0xd6fa('0xf')],_0x1d5e36['calleridnum'],_0x1d5e36[_0xd6fa('0x10')],_0x1d5e36[_0xd6fa('0x11')]));if(_0x1d5e36[_0xd6fa('0x12')]){utils[_0xd6fa('0x13')](_0x1d5e36[_0xd6fa('0x12')])[_0xd6fa('0x14')](function(_0x6486a1){if(_0x6486a1){_0x1d5e36['UserId']=_0x6486a1['id'];}utils[_0xd6fa('0x15')]('CreateVoiceCallReport',_0x1d5e36);});}else{utils['request'](_0xd6fa('0x16'),_0x1d5e36);}if(channels[_0x1d5e36[_0xd6fa('0x8')]]){delete channels[_0x1d5e36['uniqueid']];}else if(_0x2f17ae&&channels[_0x2f17ae]){if(!transfers[_0xd6fa('0x7')][_0x2f17ae][_0xd6fa('0x17')])delete transfers['blinds'][_0x2f17ae];delete channels[_0x2f17ae];}}exports[_0xd6fa('0x18')]=function(_0xa499f0){try{utils[_0xd6fa('0x19')](util['format'](_0xd6fa('0x1a'),_0xa499f0['uniqueid']),_0xa499f0);if(_0xa499f0[_0xd6fa('0x8')]==_0xa499f0[_0xd6fa('0x1b')]&&_0xa499f0[_0xd6fa('0x1c')]!=_0xd6fa('0x1d')){utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0xa499f0['uniqueid'],_0xa499f0[_0xd6fa('0x1e')],_0xa499f0[_0xd6fa('0x1f')]));channels[_0xa499f0['uniqueid']]={'uniqueid':_0xa499f0['uniqueid'],'accountcode':_0xa499f0[_0xd6fa('0x12')],'source':_0xa499f0[_0xd6fa('0x20')],'destination':_0xa499f0[_0xd6fa('0x1f')],'destinationcontext':_0xa499f0['context'],'channel':_0xa499f0[_0xd6fa('0x1c')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd6fa('0x4'),'amaflags':_0xd6fa('0x21')};}}catch(_0x239e56){utils[_0xd6fa('0x22')](util[_0xd6fa('0xb')](_0xd6fa('0x1a'),_0xa499f0[_0xd6fa('0x8')]),_0x239e56);}};exports['newstate']=function(_0x4a0c94){try{utils['debug'](util[_0xd6fa('0xb')]('[%s][calls][newstate]',_0x4a0c94['uniqueid']),_0x4a0c94);if(!_[_0xd6fa('0x23')](channels[_0x4a0c94['uniqueid']])&&_0x4a0c94[_0xd6fa('0x24')]==0x6){utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x4a0c94[_0xd6fa('0x8')],_0x4a0c94[_0xd6fa('0x1e')],_0x4a0c94['channel']));if(_[_0xd6fa('0x23')](channels[_0x4a0c94[_0xd6fa('0x8')]][_0xd6fa('0x25')])){channels[_0x4a0c94[_0xd6fa('0x8')]][_0xd6fa('0x25')]=utils[_0xd6fa('0x26')]();}}else if(!_[_0xd6fa('0x23')](channels[_0x4a0c94[_0xd6fa('0x1b')]])&&_0x4a0c94[_0xd6fa('0x24')]==0x6&&_0x4a0c94[_0xd6fa('0x1e')]!=_0xd6fa('0x27')){utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')](_0xd6fa('0x28'),_0x4a0c94[_0xd6fa('0x8')],_0x4a0c94[_0xd6fa('0x1b')],_0x4a0c94[_0xd6fa('0x1e')],_0x4a0c94['channel']));channels[_0x4a0c94[_0xd6fa('0x1b')]][_0xd6fa('0x12')]=_0x4a0c94[_0xd6fa('0x12')];channels[_0x4a0c94[_0xd6fa('0x1b')]]['destinationchannel']=_0x4a0c94['channel'];if(_[_0xd6fa('0x23')](channels[_0x4a0c94['linkedid']][_0xd6fa('0x29')])){channels[_0x4a0c94['linkedid']]['answertime']=utils[_0xd6fa('0x26')]();}channels[_0x4a0c94[_0xd6fa('0x1b')]]['disposition']=dispositions[_[_0xd6fa('0x2a')](_0x4a0c94[_0xd6fa('0x24')])]||_0xd6fa('0x6');}}catch(_0x3b4e3a){utils[_0xd6fa('0x22')](util[_0xd6fa('0xb')](_0xd6fa('0x2b'),_0x4a0c94['uniqueid']),_0x3b4e3a);}};exports['hangup']=function(_0x5a373d){try{if(!_[_0xd6fa('0x23')](channels[_0x5a373d[_0xd6fa('0x8')]])){utils[_0xd6fa('0x19')](util['format'](_0xd6fa('0x2c'),_0x5a373d['uniqueid']),_0x5a373d);if(_[_0xd6fa('0x23')](channels[_0x5a373d['uniqueid']][_0xd6fa('0x2d')])){channels[_0x5a373d[_0xd6fa('0x8')]][_0xd6fa('0x2d')]=_0x5a373d['calleridname']+'\x20<'+_0x5a373d['calleridnum']+'>';}utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')](_0xd6fa('0x2e'),_0x5a373d[_0xd6fa('0x8')],channels[_0x5a373d[_0xd6fa('0x8')]][_0xd6fa('0x2d')],_0x5a373d[_0xd6fa('0x2f')]));channels[_0x5a373d[_0xd6fa('0x8')]][_0xd6fa('0x30')]=utils[_0xd6fa('0x26')]();channels[_0x5a373d[_0xd6fa('0x8')]][_0xd6fa('0x31')]=utils['diffTime'](channels[_0x5a373d[_0xd6fa('0x8')]][_0xd6fa('0x30')],channels[_0x5a373d[_0xd6fa('0x8')]]['starttime']);channels[_0x5a373d['uniqueid']]['billableseconds']=channels[_0x5a373d[_0xd6fa('0x8')]][_0xd6fa('0x29')]?utils[_0xd6fa('0x32')](channels[_0x5a373d['uniqueid']][_0xd6fa('0x30')],channels[_0x5a373d[_0xd6fa('0x8')]][_0xd6fa('0x29')]):0x0;writeDB(channels[_0x5a373d[_0xd6fa('0x8')]]);}}catch(_0x1cbadf){utils[_0xd6fa('0x22')](util[_0xd6fa('0xb')](_0xd6fa('0x2c'),_0x5a373d['uniqueid']),_0x1cbadf);}};exports[_0xd6fa('0x33')]=function(_0x580b8d){try{if(!_[_0xd6fa('0x23')](channels[_0x580b8d[_0xd6fa('0x34')]])){utils[_0xd6fa('0x19')](util['format'](_0xd6fa('0x35'),_0x580b8d[_0xd6fa('0x36')]),_0x580b8d);if(channels[_0x580b8d['localtwolinkedid']][_0xd6fa('0x1c')]==_0x580b8d[_0xd6fa('0x37')]){utils[_0xd6fa('0xa')](util['format'](_0xd6fa('0x38'),_0x580b8d[_0xd6fa('0x36')],_0x580b8d[_0xd6fa('0x34')],_0x580b8d[_0xd6fa('0x39')]));channels[_0x580b8d[_0xd6fa('0x34')]][_0xd6fa('0x3a')]=_0x580b8d[_0xd6fa('0x39')];channels[_0x580b8d[_0xd6fa('0x34')]][_0xd6fa('0x3b')]='_attended';}else if(channels[_0x580b8d[_0xd6fa('0x34')]][_0xd6fa('0x1c')]=_0x580b8d['transfertargetchannel']){utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x580b8d[_0xd6fa('0x36')],_0x580b8d[_0xd6fa('0x34')],_0x580b8d[_0xd6fa('0x3c')]));channels[_0x580b8d[_0xd6fa('0x34')]]['destinationchannel']=_0x580b8d['origtransfererchannel'];channels[_0x580b8d[_0xd6fa('0x34')]][_0xd6fa('0x3b')]='_attended';}}}catch(_0x19dcfd){utils[_0xd6fa('0x22')](util[_0xd6fa('0xb')](_0xd6fa('0x35'),_0x580b8d[_0xd6fa('0x36')]),_0x19dcfd);}};exports[_0xd6fa('0x3d')]=function(_0x28e0b6){try{if(!_['isNil'](channels[_0x28e0b6['uniqueid']])){utils[_0xd6fa('0x19')](util[_0xd6fa('0xb')](_0xd6fa('0x3e'),_0x28e0b6['uniqueid']),_0x28e0b6);channels[_0x28e0b6['uniqueid']][_0xd6fa('0x3f')]=utils[_0xd6fa('0x26')]();utils[_0xd6fa('0xa')](util['format'](_0xd6fa('0x40'),_0x28e0b6['uniqueid'],channels[_0x28e0b6[_0xd6fa('0x8')]][_0xd6fa('0x3f')]));}}catch(_0x14bb4e){utils[_0xd6fa('0x22')](util[_0xd6fa('0xb')](_0xd6fa('0x3e'),_0x28e0b6[_0xd6fa('0x8')]),_0x14bb4e);}};exports[_0xd6fa('0x41')]=function(_0x19de63){try{if(!_[_0xd6fa('0x23')](channels[_0x19de63['uniqueid']])){utils[_0xd6fa('0x19')](util[_0xd6fa('0xb')](_0xd6fa('0x42'),_0x19de63[_0xd6fa('0x8')]),_0x19de63);if(!_[_0xd6fa('0x23')](channels[_0x19de63[_0xd6fa('0x8')]]['musiconholdstartAt'])){channels[_0x19de63[_0xd6fa('0x8')]][_0xd6fa('0x43')]+=utils[_0xd6fa('0x32')](utils['now'](),channels[_0x19de63[_0xd6fa('0x8')]][_0xd6fa('0x3f')]);utils[_0xd6fa('0xa')](util['format'](_0xd6fa('0x44'),_0x19de63[_0xd6fa('0x8')],channels[_0x19de63[_0xd6fa('0x8')]]['mohtime']));delete channels[_0x19de63[_0xd6fa('0x8')]][_0xd6fa('0x3f')];}}}catch(_0x42bfd8){utils[_0xd6fa('0x22')](util[_0xd6fa('0xb')]('[%s][calls][musiconholdstop]',_0x19de63[_0xd6fa('0x8')]),_0x42bfd8);}};exports[_0xd6fa('0x45')]=function(_0x54d37c){try{if(!_[_0xd6fa('0x23')](channels[_0x54d37c[_0xd6fa('0x8')]])){utils[_0xd6fa('0x19')](util[_0xd6fa('0xb')](_0xd6fa('0x46'),_0x54d37c[_0xd6fa('0x8')]),_0x54d37c);if(!_[_0xd6fa('0x23')](_0x54d37c[_0xd6fa('0x47')]['xmd-originatecalleridnum'])){utils['info'](util[_0xd6fa('0xb')](_0xd6fa('0x48'),_0x54d37c[_0xd6fa('0x8')],_0x54d37c[_0xd6fa('0x49')]));channels[_0x54d37c[_0xd6fa('0x8')]][_0xd6fa('0x4a')]=_0x54d37c['value'];}if(!_[_0xd6fa('0x23')](_0x54d37c['variable'][_0xd6fa('0x4b')])){utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')](_0xd6fa('0x4c'),_0x54d37c[_0xd6fa('0x8')],_0x54d37c['value']));channels[_0x54d37c[_0xd6fa('0x8')]][_0xd6fa('0x4d')]=_0x54d37c[_0xd6fa('0x49')];channels[_0x54d37c[_0xd6fa('0x8')]][_0xd6fa('0x2d')]='\x22'+_0x54d37c[_0xd6fa('0x49')]+_0xd6fa('0x4e')+_0x54d37c['value']+'>';}if(!_[_0xd6fa('0x23')](_0x54d37c['variable'][_0xd6fa('0x4f')])||!_[_0xd6fa('0x23')](_0x54d37c[_0xd6fa('0x47')][_0xd6fa('0x50')])){utils[_0xd6fa('0xa')](util['format'](_0xd6fa('0x51'),_0x54d37c['uniqueid'],!_[_0xd6fa('0x23')](_0x54d37c['variable'][_0xd6fa('0x4f')])?_0xd6fa('0x4f'):'xmd-callerid',_0x54d37c[_0xd6fa('0x49')]));channels[_0x54d37c[_0xd6fa('0x8')]]['callerid']=_0x54d37c['value'];}if(!_['isNil'](_0x54d37c['variable']['xmd-queue'])||!_[_0xd6fa('0x23')](_0x54d37c[_0xd6fa('0x47')][_0xd6fa('0x52')])){utils[_0xd6fa('0xa')](util['format'](_0xd6fa('0x51'),_0x54d37c['uniqueid'],!_['isNil'](_0x54d37c[_0xd6fa('0x47')][_0xd6fa('0x53')])?_0xd6fa('0x53'):'xmcs-queue',_0x54d37c[_0xd6fa('0x49')]));channels[_0x54d37c[_0xd6fa('0x8')]][_0xd6fa('0x54')]=_0xd6fa('0x55');channels[_0x54d37c['uniqueid']][_0xd6fa('0x56')]=_0x54d37c[_0xd6fa('0x49')];channels[_0x54d37c[_0xd6fa('0x8')]][_0xd6fa('0xd')]=!![];}if(!_['isNil'](_0x54d37c['variable'][_0xd6fa('0x57')])){utils[_0xd6fa('0xa')](util['format'](_0xd6fa('0x58'),_0x54d37c['uniqueid'],_0x54d37c[_0xd6fa('0x49')]));channels[_0x54d37c[_0xd6fa('0x8')]][_0xd6fa('0x59')]=_0x54d37c[_0xd6fa('0x49')];}if(!_['isNil'](_0x54d37c[_0xd6fa('0x47')]['xmd-cdrtype'])){utils['info'](util[_0xd6fa('0xb')](_0xd6fa('0x5a'),_0x54d37c[_0xd6fa('0x8')],_0x54d37c[_0xd6fa('0x49')]));channels[_0x54d37c['uniqueid']][_0xd6fa('0x5b')]=_0x54d37c[_0xd6fa('0x49')];}if(!_['isNil'](_0x54d37c[_0xd6fa('0x47')][_0xd6fa('0x5c')])){utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')](_0xd6fa('0x5d'),_0x54d37c[_0xd6fa('0x8')],_0x54d37c[_0xd6fa('0x49')]));channels[_0x54d37c[_0xd6fa('0x8')]][_0xd6fa('0x5e')]=_0x54d37c['value'];}if(!_['isNil'](_0x54d37c[_0xd6fa('0x47')]['sipcallid'])){utils[_0xd6fa('0xa')](util['format'](_0xd6fa('0x5f'),_0x54d37c[_0xd6fa('0x8')],_0x54d37c[_0xd6fa('0x49')]));channels[_0x54d37c['uniqueid']][_0xd6fa('0x60')]=_0x54d37c[_0xd6fa('0x49')];}}}catch(_0x5dd623){utils[_0xd6fa('0x22')](util[_0xd6fa('0xb')](_0xd6fa('0x46'),_0x54d37c[_0xd6fa('0x8')]),_0x5dd623);}};exports[_0xd6fa('0x61')]=function(_0x3ffaca){try{if(!_[_0xd6fa('0x23')](channels[_0x3ffaca[_0xd6fa('0x8')]])){utils[_0xd6fa('0x19')](util[_0xd6fa('0xb')](_0xd6fa('0x62'),_0x3ffaca[_0xd6fa('0x8')]),_0x3ffaca);utils[_0xd6fa('0xa')](util[_0xd6fa('0xb')](_0xd6fa('0x63'),_0x3ffaca[_0xd6fa('0x8')],_0x3ffaca['application'],_0x3ffaca[_0xd6fa('0x64')]));if(_0x3ffaca['application'][_0xd6fa('0x65')]()==_0xd6fa('0x66')&&_[_0xd6fa('0x67')](_0x3ffaca[_0xd6fa('0x64')][_0xd6fa('0x65')](),_0xd6fa('0x68'))){var _0x257b44=_0x3ffaca[_0xd6fa('0x64')]['split']('=');var _0x359fd4=_0x257b44[0x0][_0xd6fa('0x69')](_0x257b44[0x0][_0xd6fa('0x6a')]('(')+0x1,_0x257b44[0x0][_0xd6fa('0x6a')](')'));var _0x33889f=_0x257b44[0x1];channels[_0x3ffaca[_0xd6fa('0x8')]][_0x359fd4]=_0x33889f;}if(!_[_0xd6fa('0x6b')]([_0xd6fa('0x6c'),_0xd6fa('0x6d'),_0xd6fa('0x6e'),_0xd6fa('0x66'),_0xd6fa('0x6f')],_0x3ffaca[_0xd6fa('0x70')][_0xd6fa('0x65')]())){channels[_0x3ffaca[_0xd6fa('0x8')]][_0xd6fa('0x54')]=_0x3ffaca[_0xd6fa('0x70')];channels[_0x3ffaca[_0xd6fa('0x8')]][_0xd6fa('0x56')]=_0x3ffaca[_0xd6fa('0x64')];}}}catch(_0x3df9d2){utils['error'](util['format'](_0xd6fa('0x62'),_0x3ffaca[_0xd6fa('0x8')]),_0x3df9d2);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 50afcf1..af4830a 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 _0xfb1f=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20shutdown','fullybooted','error','[core]\x20error','close'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0xfb1f,0xd4));var _0xffb1=function(_0x2da843,_0x11bda3){_0x2da843=_0x2da843-0x0;var _0x34937b=_0xfb1f[_0x2da843];return _0x34937b;};'use strict';var utils=require(_0xffb1('0x0'));exports[_0xffb1('0x1')]=function(){utils[_0xffb1('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0xffb1('0x2')](_0xffb1('0x3'));};exports[_0xffb1('0x4')]=function(){utils[_0xffb1('0x2')]('[core]\x20fullybooted');};exports[_0xffb1('0x5')]=function(_0x562716){utils[_0xffb1('0x5')](_0xffb1('0x6'),_0x562716);};exports[_0xffb1('0x7')]=function(){utils[_0xffb1('0x2')](_0xffb1('0x8'));};exports[_0xffb1('0x9')]=function(_0x4567bf){}; \ No newline at end of file +var _0xb982=['connect','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb982,0x1f4));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var utils=require('./utils');exports[_0x2b98('0x0')]=function(){utils['info']('[core]\x20connected');};exports['shutdown']=function(){utils[_0x2b98('0x1')](_0x2b98('0x2'));};exports[_0x2b98('0x3')]=function(){utils[_0x2b98('0x1')](_0x2b98('0x4'));};exports[_0x2b98('0x5')]=function(_0x22030e){utils[_0x2b98('0x5')](_0x2b98('0x6'),_0x22030e);};exports[_0x2b98('0x7')]=function(){utils['info'](_0x2b98('0x8'));};exports[_0x2b98('0x9')]=function(_0x2ce85f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index c8bf48d..02b7043 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 _0x2f23=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','answertime'];(function(_0x3ce769,_0x12ee1e){var _0x130e6f=function(_0x571fcf){while(--_0x571fcf){_0x3ce769['push'](_0x3ce769['shift']());}};_0x130e6f(++_0x12ee1e);}(_0x2f23,0xe5));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32f2('0x0'));var util=require('util');var utils=require(_0x32f2('0x1'));var dials={};function writeDB(_0x5b9962){utils[_0x32f2('0x2')](util[_0x32f2('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x5b9962[_0x32f2('0x4')],_0x5b9962[_0x32f2('0x5')],_0x5b9962[_0x32f2('0x6')],_0x5b9962[_0x32f2('0x7')],_0x5b9962[_0x32f2('0x8')],_0x5b9962['dialstatus']));utils[_0x32f2('0x9')](_0x32f2('0xa'),_0x5b9962);delete dials[_0x5b9962[_0x32f2('0x4')]];}exports['newexten']=function(_0x405e1d){try{utils[_0x32f2('0xb')](util[_0x32f2('0x3')](_0x32f2('0xc'),_0x405e1d[_0x32f2('0x4')]),_0x405e1d);utils['info'](util[_0x32f2('0x3')](_0x32f2('0xd'),_0x405e1d[_0x32f2('0x4')],_0x405e1d[_0x32f2('0xe')],_0x405e1d[_0x32f2('0xf')]));if(_0x405e1d['application'][_0x32f2('0x10')]()==_0x32f2('0x11')&&_[_0x32f2('0x12')](_0x405e1d[_0x32f2('0xf')][_0x32f2('0x10')](),_0x32f2('0x13'))){var _0x1c659b=_0x405e1d[_0x32f2('0xf')][_0x32f2('0x14')]('=');dials[_0x405e1d[_0x32f2('0x4')]]={'routeId':_0x1c659b[0x1]};}}catch(_0x402744){utils['error'](util[_0x32f2('0x3')]('[%s][dials][newexten]',_0x405e1d['uniqueid']),_0x402744);}};exports[_0x32f2('0x15')]=function(_0x3d387d){try{utils[_0x32f2('0xb')](util[_0x32f2('0x3')](_0x32f2('0x16'),_0x3d387d[_0x32f2('0x4')]),_0x3d387d);if(!_['isNil'](_0x3d387d[_0x32f2('0x17')][_0x32f2('0x18')])){utils[_0x32f2('0x2')](util[_0x32f2('0x3')](_0x32f2('0x19'),_0x3d387d[_0x32f2('0x4')],_0x3d387d[_0x32f2('0x1a')]));dials[_0x3d387d[_0x32f2('0x4')]]={'routeId':_0x3d387d['value']};}}catch(_0x25d8c5){utils[_0x32f2('0x1b')](util[_0x32f2('0x3')](_0x32f2('0x16'),_0x3d387d[_0x32f2('0x4')]),_0x25d8c5);}};exports[_0x32f2('0x1c')]=function(_0x28118b){try{if(!_[_0x32f2('0x1d')](dials[_0x28118b[_0x32f2('0x4')]])){utils[_0x32f2('0xb')](util[_0x32f2('0x3')](_0x32f2('0x1e'),_0x28118b[_0x32f2('0x4')]),_0x28118b);dials[_0x28118b[_0x32f2('0x4')]]=_[_0x32f2('0x1f')](dials[_0x28118b[_0x32f2('0x4')]],_0x28118b);dials[_0x28118b['uniqueid']][_0x32f2('0x20')]=utils[_0x32f2('0x21')]();dials[_0x28118b['uniqueid']][_0x32f2('0x22')]=_0x32f2('0x23');utils[_0x32f2('0x2')](util[_0x32f2('0x3')](_0x32f2('0x24'),_0x28118b[_0x32f2('0x4')],dials[_0x28118b[_0x32f2('0x4')]][_0x32f2('0x20')]));}}catch(_0x23a3ea){utils[_0x32f2('0x1b')](util['format'](_0x32f2('0x1e'),_0x28118b[_0x32f2('0x4')]),_0x23a3ea);}};exports['dialend']=function(_0x3b1b3b){try{if(!_['isNil'](dials[_0x3b1b3b[_0x32f2('0x4')]])){utils[_0x32f2('0xb')](util[_0x32f2('0x3')](_0x32f2('0x25'),_0x3b1b3b[_0x32f2('0x4')]),_0x3b1b3b);dials[_0x3b1b3b[_0x32f2('0x4')]][_0x32f2('0x26')]=_0x3b1b3b[_0x32f2('0x26')];if(_0x3b1b3b[_0x32f2('0x26')]==_0x32f2('0x27')){dials[_0x3b1b3b[_0x32f2('0x4')]]=_[_0x32f2('0x1f')](dials[_0x3b1b3b[_0x32f2('0x4')]],_0x3b1b3b);dials[_0x3b1b3b[_0x32f2('0x4')]][_0x32f2('0x28')]=utils['now']();dials[_0x3b1b3b[_0x32f2('0x4')]]['lastevent']=_0x32f2('0x29');utils[_0x32f2('0x2')](util[_0x32f2('0x3')](_0x32f2('0x2a'),_0x3b1b3b[_0x32f2('0x4')],_0x3b1b3b[_0x32f2('0x26')],dials[_0x3b1b3b['uniqueid']]['answertime']));}else{utils[_0x32f2('0x2')](util[_0x32f2('0x3')](_0x32f2('0x2b'),_0x3b1b3b['uniqueid'],_0x3b1b3b[_0x32f2('0x26')]));}}}catch(_0x28dffa){utils[_0x32f2('0x1b')](util[_0x32f2('0x3')](_0x32f2('0x25'),_0x3b1b3b[_0x32f2('0x4')]),_0x28dffa);}};exports[_0x32f2('0x2c')]=function(_0x423253){try{if(!_[_0x32f2('0x1d')](dials[_0x423253['uniqueid']])){utils[_0x32f2('0xb')](util[_0x32f2('0x3')](_0x32f2('0x2d'),_0x423253[_0x32f2('0x4')]),_0x423253);utils[_0x32f2('0x2')](util['format'](_0x32f2('0x2e'),_0x423253[_0x32f2('0x4')],_0x423253[_0x32f2('0x7')],_0x423253[_0x32f2('0x2f')],_0x423253[_0x32f2('0x30')]));dials[_0x423253[_0x32f2('0x4')]]=_['assign'](dials[_0x423253[_0x32f2('0x4')]],{'endtime':utils['now'](),'lastevent':_0x32f2('0x31')});dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x32')]=utils[_0x32f2('0x33')](dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x34')],dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x20')]);dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x35')]=utils[_0x32f2('0x33')](dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x28')]||dials[_0x423253['uniqueid']]['endtime'],dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x20')]);dials[_0x423253[_0x32f2('0x4')]]['billableseconds']=dials[_0x423253[_0x32f2('0x4')]]['answertime']?utils['diffTime'](dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x34')],dials[_0x423253[_0x32f2('0x4')]][_0x32f2('0x28')]):0x0;writeDB(dials[_0x423253['uniqueid']]);}}catch(_0x2f44d9){utils[_0x32f2('0x1b')](util[_0x32f2('0x3')](_0x32f2('0x2d'),_0x423253[_0x32f2('0x4')]),_0x2f44d9);}}; \ No newline at end of file +var _0x9185=['[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','split','error','varset','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][dialend]','dialstatus','ANSWER','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','diffTime','endtime','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','request','newexten','debug'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0x9185,0x7b));var _0x5918=function(_0x2df413,_0x5303ae){_0x2df413=_0x2df413-0x0;var _0x1f5133=_0x9185[_0x2df413];return _0x1f5133;};'use strict';var _=require(_0x5918('0x0'));var util=require(_0x5918('0x1'));var utils=require(_0x5918('0x2'));var dials={};function writeDB(_0x5595f2){utils['info'](util[_0x5918('0x3')](_0x5918('0x4'),_0x5595f2[_0x5918('0x5')],_0x5595f2[_0x5918('0x6')],_0x5595f2[_0x5918('0x7')],_0x5595f2[_0x5918('0x8')],_0x5595f2['connectedlinenum'],_0x5595f2['dialstatus']));utils[_0x5918('0x9')]('CreateVoiceDialReport',_0x5595f2);delete dials[_0x5595f2[_0x5918('0x5')]];}exports[_0x5918('0xa')]=function(_0x3ae908){try{utils[_0x5918('0xb')](util[_0x5918('0x3')](_0x5918('0xc'),_0x3ae908['uniqueid']),_0x3ae908);utils[_0x5918('0xd')](util['format'](_0x5918('0xe'),_0x3ae908[_0x5918('0x5')],_0x3ae908[_0x5918('0xf')],_0x3ae908[_0x5918('0x10')]));if(_0x3ae908[_0x5918('0xf')]['toLowerCase']()=='set'&&_[_0x5918('0x11')](_0x3ae908[_0x5918('0x10')][_0x5918('0x12')](),'cdr(routeid)')){var _0x55ea7a=_0x3ae908['appdata'][_0x5918('0x13')]('=');dials[_0x3ae908['uniqueid']]={'routeId':_0x55ea7a[0x1]};}}catch(_0x3ad26c){utils[_0x5918('0x14')](util[_0x5918('0x3')](_0x5918('0xc'),_0x3ae908[_0x5918('0x5')]),_0x3ad26c);}};exports[_0x5918('0x15')]=function(_0x2406d1){try{utils[_0x5918('0xb')](util['format']('[%s][dials][varset]',_0x2406d1[_0x5918('0x5')]),_0x2406d1);if(!_['isNil'](_0x2406d1['variable']['outboundrouteid'])){utils[_0x5918('0xd')](util[_0x5918('0x3')](_0x5918('0x16'),_0x2406d1[_0x5918('0x5')],_0x2406d1[_0x5918('0x17')]));dials[_0x2406d1[_0x5918('0x5')]]={'routeId':_0x2406d1[_0x5918('0x17')]};}}catch(_0x577fd0){utils['error'](util['format'](_0x5918('0x18'),_0x2406d1[_0x5918('0x5')]),_0x577fd0);}};exports[_0x5918('0x19')]=function(_0x5a75ea){try{if(!_[_0x5918('0x1a')](dials[_0x5a75ea[_0x5918('0x5')]])){utils[_0x5918('0xb')](util[_0x5918('0x3')](_0x5918('0x1b'),_0x5a75ea[_0x5918('0x5')]),_0x5a75ea);dials[_0x5a75ea[_0x5918('0x5')]]=_[_0x5918('0x1c')](dials[_0x5a75ea[_0x5918('0x5')]],_0x5a75ea);dials[_0x5a75ea[_0x5918('0x5')]][_0x5918('0x1d')]=utils['now']();dials[_0x5a75ea['uniqueid']][_0x5918('0x1e')]=_0x5918('0x1f');utils[_0x5918('0xd')](util[_0x5918('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x5a75ea[_0x5918('0x5')],dials[_0x5a75ea[_0x5918('0x5')]]['starttime']));}}catch(_0x40b602){utils[_0x5918('0x14')](util[_0x5918('0x3')](_0x5918('0x1b'),_0x5a75ea[_0x5918('0x5')]),_0x40b602);}};exports['dialend']=function(_0x299859){try{if(!_[_0x5918('0x1a')](dials[_0x299859[_0x5918('0x5')]])){utils[_0x5918('0xb')](util[_0x5918('0x3')](_0x5918('0x20'),_0x299859[_0x5918('0x5')]),_0x299859);dials[_0x299859[_0x5918('0x5')]][_0x5918('0x21')]=_0x299859[_0x5918('0x21')];if(_0x299859['dialstatus']==_0x5918('0x22')){dials[_0x299859[_0x5918('0x5')]]=_['assign'](dials[_0x299859['uniqueid']],_0x299859);dials[_0x299859[_0x5918('0x5')]][_0x5918('0x23')]=utils[_0x5918('0x24')]();dials[_0x299859['uniqueid']][_0x5918('0x1e')]='connect';utils[_0x5918('0xd')](util[_0x5918('0x3')](_0x5918('0x25'),_0x299859[_0x5918('0x5')],_0x299859[_0x5918('0x21')],dials[_0x299859['uniqueid']][_0x5918('0x23')]));}else{utils[_0x5918('0xd')](util[_0x5918('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x299859[_0x5918('0x5')],_0x299859[_0x5918('0x21')]));}}}catch(_0xa90f5b){utils[_0x5918('0x14')](util[_0x5918('0x3')](_0x5918('0x20'),_0x299859[_0x5918('0x5')]),_0xa90f5b);}};exports[_0x5918('0x26')]=function(_0x3ab8c2){try{if(!_['isNil'](dials[_0x3ab8c2[_0x5918('0x5')]])){utils[_0x5918('0xb')](util[_0x5918('0x3')](_0x5918('0x27'),_0x3ab8c2[_0x5918('0x5')]),_0x3ab8c2);utils[_0x5918('0xd')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x3ab8c2[_0x5918('0x5')],_0x3ab8c2[_0x5918('0x8')],_0x3ab8c2[_0x5918('0x28')],_0x3ab8c2[_0x5918('0x29')]));dials[_0x3ab8c2[_0x5918('0x5')]]=_['assign'](dials[_0x3ab8c2[_0x5918('0x5')]],{'endtime':utils[_0x5918('0x24')](),'lastevent':_0x5918('0x2a')});dials[_0x3ab8c2['uniqueid']]['duration']=utils[_0x5918('0x2b')](dials[_0x3ab8c2['uniqueid']]['endtime'],dials[_0x3ab8c2['uniqueid']][_0x5918('0x1d')]);dials[_0x3ab8c2['uniqueid']]['holdtime']=utils[_0x5918('0x2b')](dials[_0x3ab8c2[_0x5918('0x5')]][_0x5918('0x23')]||dials[_0x3ab8c2[_0x5918('0x5')]][_0x5918('0x2c')],dials[_0x3ab8c2[_0x5918('0x5')]]['starttime']);dials[_0x3ab8c2['uniqueid']]['billableseconds']=dials[_0x3ab8c2[_0x5918('0x5')]][_0x5918('0x23')]?utils[_0x5918('0x2b')](dials[_0x3ab8c2['uniqueid']][_0x5918('0x2c')],dials[_0x3ab8c2['uniqueid']][_0x5918('0x23')]):0x0;writeDB(dials[_0x3ab8c2['uniqueid']]);}}catch(_0x368167){utils[_0x5918('0x14')](util['format']('[%s][dials][hangup]',_0x3ab8c2[_0x5918('0x5')]),_0x368167);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 79f107c..56e520d 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 _0xfe91=['[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','util','xdr','disabled','production','local','asterisk','port','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','error','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfe91,0x16c));var _0x1fe9=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0xfe91[_0x5471ec];return _0x121d4c;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x1fe9('0x0'));var isXDREnabled=config[_0x1fe9('0x1')]&&config['xdr'][_0x1fe9('0x2')]?!config[_0x1fe9('0x1')]['disabled']:!![];var isProduction=config['env']===_0x1fe9('0x3')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x1fe9('0x4')]===!![]||![];var ami=new AsteriskManager(config[_0x1fe9('0x5')][_0x1fe9('0x6')],config[_0x1fe9('0x5')]['ip'],config[_0x1fe9('0x5')][_0x1fe9('0x7')],config[_0x1fe9('0x5')][_0x1fe9('0x8')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x1fe9('0x9')](_0x1fe9('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x1fe9('0x9')](_0x1fe9('0xb'));}else{var agents=require(_0x1fe9('0xc'));var calls=require(_0x1fe9('0xd'));var queues=require(_0x1fe9('0xe'));var recordings=require(_0x1fe9('0xf'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x1fe9('0x10'));var core=require(_0x1fe9('0x11'));ami['on']('connect',core[_0x1fe9('0x12')]);ami['on']('shutdown',core[_0x1fe9('0x13')]);ami['on'](_0x1fe9('0x14'),core[_0x1fe9('0x14')]);ami['on']('error',core['error']);ami['on']('close',core[_0x1fe9('0x15')]);ami['on'](_0x1fe9('0x16'),core[_0x1fe9('0x16')]);ami['on'](_0x1fe9('0x17'),function(_0x31b6ca){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x1a'),_0x31b6ca[_0x1fe9('0x1b')]),_0x31b6ca);members[_0x1fe9('0x17')](_0x31b6ca);}catch(_0x39a133){utils['error'](util[_0x1fe9('0x19')](_0x1fe9('0x1a'),_0x31b6ca['device']),_0x39a133);}});ami['on'](_0x1fe9('0x1c'),function(_0x2583c7){try{utils['debug'](util[_0x1fe9('0x19')](_0x1fe9('0x1d'),_0x2583c7[_0x1fe9('0x1e')]),_0x2583c7);agents[_0x1fe9('0x1c')](_0x2583c7);}catch(_0x2463aa){utils['error'](util[_0x1fe9('0x19')](_0x1fe9('0x1d'),_0x2583c7['uniqueid']),_0x2463aa);}});ami['on']('agentringnoanswer',function(_0x2209a1){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x1f'),_0x2209a1[_0x1fe9('0x1e')]),_0x2209a1);agents['agentringnoanswer'](_0x2209a1);}catch(_0x47fe79){utils['error'](util[_0x1fe9('0x19')](_0x1fe9('0x1f'),_0x2209a1[_0x1fe9('0x1e')]),_0x47fe79);}});ami['on'](_0x1fe9('0x20'),function(_0xeeaf4b){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x21'),_0xeeaf4b[_0x1fe9('0x1e')]),_0xeeaf4b);agents[_0x1fe9('0x20')](_0xeeaf4b);queues[_0x1fe9('0x20')](_0xeeaf4b);}catch(_0x7cc4e9){utils[_0x1fe9('0x22')](util['format'](_0x1fe9('0x21'),_0xeeaf4b[_0x1fe9('0x1e')]),_0x7cc4e9);}});ami['on']('agentcomplete',function(_0x468cd5){try{utils[_0x1fe9('0x18')](util['format'](_0x1fe9('0x23'),_0x468cd5[_0x1fe9('0x1e')]),_0x468cd5);agents[_0x1fe9('0x24')](_0x468cd5);queues['agentcomplete'](_0x468cd5);members[_0x1fe9('0x24')](_0x468cd5);}catch(_0x414d94){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x23'),_0x468cd5[_0x1fe9('0x1e')]),_0x414d94);}});ami['on'](_0x1fe9('0x25'),function(_0x52973b){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')]('[%s][index][queuecallerabandon]',_0x52973b[_0x1fe9('0x1e')]),_0x52973b);agents[_0x1fe9('0x25')](_0x52973b);queues['queuecallerabandon'](_0x52973b);}catch(_0x1e012f){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x26'),_0x52973b[_0x1fe9('0x1e')]),_0x1e012f);}});ami['on']('queuecallerjoin',function(_0x58fd0e){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x27'),_0x58fd0e[_0x1fe9('0x1e')]),_0x58fd0e);queues[_0x1fe9('0x28')](_0x58fd0e);recordings[_0x1fe9('0x28')](_0x58fd0e);}catch(_0x5d7421){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x27'),_0x58fd0e[_0x1fe9('0x1e')]),_0x5d7421);}});ami['on'](_0x1fe9('0x29'),function(_0x2379b5){try{utils['debug'](util[_0x1fe9('0x19')](_0x1fe9('0x2a'),_0x2379b5['uniqueid']),_0x2379b5);queues['queuecallerleave'](_0x2379b5);}catch(_0x1f6ee3){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')]('[%s][index][queuecallerleave]',_0x2379b5[_0x1fe9('0x1e')]),_0x1f6ee3);}});ami['on'](_0x1fe9('0x2b'),function(_0x239f0b){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x2c'),_0x239f0b['uniqueid']),_0x239f0b);queues['musiconholdstart'](_0x239f0b);calls['musiconholdstart'](_0x239f0b);}catch(_0x3e24f1){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x2c'),_0x239f0b[_0x1fe9('0x1e')]),_0x3e24f1);}});ami['on'](_0x1fe9('0x2d'),function(_0x48aedf){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')]('[%s][index][musiconholdstop]',_0x48aedf[_0x1fe9('0x1e')]),_0x48aedf);queues[_0x1fe9('0x2d')](_0x48aedf);calls[_0x1fe9('0x2d')](_0x48aedf);}catch(_0x57142a){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x2e'),_0x48aedf[_0x1fe9('0x1e')]),_0x57142a);}});ami['on'](_0x1fe9('0x2f'),function(_0x40411e){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x30'),_0x40411e[_0x1fe9('0x1e')]),_0x40411e);calls['newstate'](_0x40411e);recordings[_0x1fe9('0x2f')](_0x40411e);}catch(_0x571868){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x30'),_0x40411e[_0x1fe9('0x1e')]),_0x571868);}});ami['on'](_0x1fe9('0x31'),function(_0x98a42f){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x32'),_0x98a42f[_0x1fe9('0x1e')]),_0x98a42f);calls[_0x1fe9('0x31')](_0x98a42f);recordings[_0x1fe9('0x31')](_0x98a42f);dials[_0x1fe9('0x31')](_0x98a42f);agents['hangup'](_0x98a42f);queues[_0x1fe9('0x31')](_0x98a42f);}catch(_0x237c3f){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x32'),_0x98a42f[_0x1fe9('0x1e')]),_0x237c3f);}});ami['on']('cdr',function(_0x47a62a){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x33'),_0x47a62a['uniqueid']),_0x47a62a);members[_0x1fe9('0x34')](_0x47a62a);}catch(_0x38ded0){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x33'),_0x47a62a[_0x1fe9('0x1e')]),_0x38ded0);}});ami['on'](_0x1fe9('0x35'),function(_0x415d0b){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')]('[%s][index][blindtransfer]',_0x415d0b[_0x1fe9('0x1e')]),_0x415d0b);queues[_0x1fe9('0x35')](_0x415d0b);agents['blindtransfer'](_0x415d0b);transfers[_0x1fe9('0x35')](_0x415d0b);recordings[_0x1fe9('0x35')](_0x415d0b);}catch(_0x1c2856){utils[_0x1fe9('0x22')](util['format'](_0x1fe9('0x36'),_0x415d0b[_0x1fe9('0x1e')]),_0x1c2856);}});ami['on'](_0x1fe9('0x37'),function(_0x37f483){try{utils['debug'](util[_0x1fe9('0x19')](_0x1fe9('0x38'),_0x37f483[_0x1fe9('0x39')]),_0x37f483);queues[_0x1fe9('0x37')](_0x37f483);transfers[_0x1fe9('0x37')](_0x37f483);agents[_0x1fe9('0x37')](_0x37f483);calls['attendedtransfer'](_0x37f483);}catch(_0xa554d5){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x38'),_0x37f483[_0x1fe9('0x39')]),_0xa554d5);}});ami['on'](_0x1fe9('0x3a'),function(_0x113c03){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')]('[%s][index][varset]',_0x113c03[_0x1fe9('0x1e')]),_0x113c03);queues[_0x1fe9('0x3a')](_0x113c03);recordings[_0x1fe9('0x3a')](_0x113c03);calls['varset'](_0x113c03);dials['varset'](_0x113c03);}catch(_0x15c038){utils['error'](util[_0x1fe9('0x19')]('[%s][index][varset]',_0x113c03[_0x1fe9('0x1e')]),_0x15c038);}});ami['on'](_0x1fe9('0x3b'),function(_0x27e677){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x3c'),_0x27e677[_0x1fe9('0x1e')]),_0x27e677);calls[_0x1fe9('0x3b')](_0x27e677);recordings[_0x1fe9('0x3b')](_0x27e677);dials[_0x1fe9('0x3b')](_0x27e677);}catch(_0x568892){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x3c'),_0x27e677[_0x1fe9('0x1e')]),_0x568892);}});ami['on']('newchannel',function(_0x6475df){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')]('[%s][index][newchannel]',_0x6475df['uniqueid']),_0x6475df);calls[_0x1fe9('0x3d')](_0x6475df);recordings['newchannel'](_0x6475df);}catch(_0x2b6b7f){utils[_0x1fe9('0x22')](util[_0x1fe9('0x19')](_0x1fe9('0x3e'),_0x6475df[_0x1fe9('0x1e')]),_0x2b6b7f);}});ami['on'](_0x1fe9('0x3f'),function(_0x3351d6){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x40'),_0x3351d6[_0x1fe9('0x1e')]),_0x3351d6);dials[_0x1fe9('0x3f')](_0x3351d6);}catch(_0x433a17){utils[_0x1fe9('0x22')](util['format'](_0x1fe9('0x41'),_0x3351d6[_0x1fe9('0x1e')]),_0x433a17);}});ami['on'](_0x1fe9('0x42'),function(_0x5e295d){try{utils[_0x1fe9('0x18')](util[_0x1fe9('0x19')](_0x1fe9('0x43'),_0x5e295d['uniqueid']),_0x5e295d);dials['dialend'](_0x5e295d);}catch(_0x35a958){utils['error'](util[_0x1fe9('0x19')]('[%s][index][dialend]',_0x5e295d[_0x1fe9('0x1e')]),_0x35a958);}});} \ No newline at end of file +var _0x207e=['uniqueid','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','xdr','disabled','env','production','port','asterisk','username','password','XDR\x20DISABLED','info','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','device','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]'];(function(_0x4c9d22,_0x20e504){var _0x34841a=function(_0x3184c3){while(--_0x3184c3){_0x4c9d22['push'](_0x4c9d22['shift']());}};_0x34841a(++_0x20e504);}(_0x207e,0xeb));var _0xe207=function(_0x57f8fd,_0x288c04){_0x57f8fd=_0x57f8fd-0x0;var _0x4d0da8=_0x207e[_0x57f8fd];return _0x4d0da8;};var AsteriskManager=require('asterisk-manager');var config=require(_0xe207('0x0'));var utils=require('./utils');var util=require('util');var isXDREnabled=config[_0xe207('0x1')]&&config['xdr'][_0xe207('0x2')]?!config[_0xe207('0x1')][_0xe207('0x2')]:!![];var isProduction=config[_0xe207('0x3')]===_0xe207('0x4')||![];var isLocalAsterisk=config[_0xe207('0x1')]&&config[_0xe207('0x1')]['local']===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xe207('0x5')],config['asterisk']['ip'],config[_0xe207('0x6')][_0xe207('0x7')],config[_0xe207('0x6')][_0xe207('0x8')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0xe207('0x9'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xe207('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xe207('0xb'));var calls=require(_0xe207('0xc'));var queues=require(_0xe207('0xd'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xe207('0xe'));var transfers=require(_0xe207('0xf'));var core=require(_0xe207('0x10'));ami['on'](_0xe207('0x11'),core['connect']);ami['on'](_0xe207('0x12'),core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0xe207('0x13'),core[_0xe207('0x13')]);ami['on'](_0xe207('0x14'),core[_0xe207('0x14')]);ami['on'](_0xe207('0x15'),core[_0xe207('0x15')]);ami['on'](_0xe207('0x16'),function(_0x163d35){try{utils[_0xe207('0x17')](util['format']('[%s][index][devicestatechange]',_0x163d35[_0xe207('0x18')]),_0x163d35);members[_0xe207('0x16')](_0x163d35);}catch(_0x38d741){utils[_0xe207('0x13')](util[_0xe207('0x19')](_0xe207('0x1a'),_0x163d35[_0xe207('0x18')]),_0x38d741);}});ami['on'](_0xe207('0x1b'),function(_0x4058b7){try{utils[_0xe207('0x17')](util[_0xe207('0x19')](_0xe207('0x1c'),_0x4058b7[_0xe207('0x1d')]),_0x4058b7);agents[_0xe207('0x1b')](_0x4058b7);}catch(_0x4edab6){utils[_0xe207('0x13')](util[_0xe207('0x19')]('[%s][index][agentcalled]',_0x4058b7[_0xe207('0x1d')]),_0x4edab6);}});ami['on']('agentringnoanswer',function(_0x4b293d){try{utils['debug'](util['format'](_0xe207('0x1e'),_0x4b293d[_0xe207('0x1d')]),_0x4b293d);agents['agentringnoanswer'](_0x4b293d);}catch(_0x213d13){utils['error'](util[_0xe207('0x19')]('[%s][index][agentringnoanswer]',_0x4b293d[_0xe207('0x1d')]),_0x213d13);}});ami['on'](_0xe207('0x1f'),function(_0x11dfa7){try{utils['debug'](util['format'](_0xe207('0x20'),_0x11dfa7[_0xe207('0x1d')]),_0x11dfa7);agents[_0xe207('0x1f')](_0x11dfa7);queues[_0xe207('0x1f')](_0x11dfa7);}catch(_0x343c5e){utils[_0xe207('0x13')](util[_0xe207('0x19')](_0xe207('0x20'),_0x11dfa7[_0xe207('0x1d')]),_0x343c5e);}});ami['on'](_0xe207('0x21'),function(_0x4378ed){try{utils[_0xe207('0x17')](util['format'](_0xe207('0x22'),_0x4378ed[_0xe207('0x1d')]),_0x4378ed);agents[_0xe207('0x21')](_0x4378ed);queues['agentcomplete'](_0x4378ed);members['agentcomplete'](_0x4378ed);}catch(_0x5900e9){utils['error'](util[_0xe207('0x19')]('[%s][index][agentcomplete]',_0x4378ed[_0xe207('0x1d')]),_0x5900e9);}});ami['on'](_0xe207('0x23'),function(_0x1eb0db){try{utils[_0xe207('0x17')](util[_0xe207('0x19')]('[%s][index][queuecallerabandon]',_0x1eb0db[_0xe207('0x1d')]),_0x1eb0db);agents[_0xe207('0x23')](_0x1eb0db);queues[_0xe207('0x23')](_0x1eb0db);}catch(_0x5bfa0f){utils['error'](util[_0xe207('0x19')](_0xe207('0x24'),_0x1eb0db['uniqueid']),_0x5bfa0f);}});ami['on'](_0xe207('0x25'),function(_0x3f78db){try{utils[_0xe207('0x17')](util['format'](_0xe207('0x26'),_0x3f78db['uniqueid']),_0x3f78db);queues['queuecallerjoin'](_0x3f78db);recordings[_0xe207('0x25')](_0x3f78db);}catch(_0x18277e){utils[_0xe207('0x13')](util['format']('[%s][index][queuecallerjoin]',_0x3f78db[_0xe207('0x1d')]),_0x18277e);}});ami['on'](_0xe207('0x27'),function(_0x32d639){try{utils[_0xe207('0x17')](util['format'](_0xe207('0x28'),_0x32d639[_0xe207('0x1d')]),_0x32d639);queues[_0xe207('0x27')](_0x32d639);}catch(_0x54ee37){utils[_0xe207('0x13')](util[_0xe207('0x19')](_0xe207('0x28'),_0x32d639['uniqueid']),_0x54ee37);}});ami['on'](_0xe207('0x29'),function(_0x545f37){try{utils['debug'](util[_0xe207('0x19')](_0xe207('0x2a'),_0x545f37[_0xe207('0x1d')]),_0x545f37);queues[_0xe207('0x29')](_0x545f37);calls['musiconholdstart'](_0x545f37);}catch(_0x3b1bde){utils['error'](util['format'](_0xe207('0x2a'),_0x545f37[_0xe207('0x1d')]),_0x3b1bde);}});ami['on'](_0xe207('0x2b'),function(_0x3eaa34){try{utils[_0xe207('0x17')](util[_0xe207('0x19')](_0xe207('0x2c'),_0x3eaa34[_0xe207('0x1d')]),_0x3eaa34);queues[_0xe207('0x2b')](_0x3eaa34);calls[_0xe207('0x2b')](_0x3eaa34);}catch(_0x3d689e){utils[_0xe207('0x13')](util[_0xe207('0x19')]('[%s][index][musiconholdstop]',_0x3eaa34[_0xe207('0x1d')]),_0x3d689e);}});ami['on'](_0xe207('0x2d'),function(_0x168420){try{utils['debug'](util[_0xe207('0x19')](_0xe207('0x2e'),_0x168420[_0xe207('0x1d')]),_0x168420);calls[_0xe207('0x2d')](_0x168420);recordings[_0xe207('0x2d')](_0x168420);}catch(_0x3b0bfe){utils[_0xe207('0x13')](util[_0xe207('0x19')](_0xe207('0x2e'),_0x168420['uniqueid']),_0x3b0bfe);}});ami['on']('hangup',function(_0x2cec54){try{utils[_0xe207('0x17')](util[_0xe207('0x19')](_0xe207('0x2f'),_0x2cec54[_0xe207('0x1d')]),_0x2cec54);calls[_0xe207('0x30')](_0x2cec54);recordings[_0xe207('0x30')](_0x2cec54);dials['hangup'](_0x2cec54);agents[_0xe207('0x30')](_0x2cec54);queues[_0xe207('0x30')](_0x2cec54);}catch(_0x1b3b14){utils[_0xe207('0x13')](util[_0xe207('0x19')]('[%s][index][hangup]',_0x2cec54[_0xe207('0x1d')]),_0x1b3b14);}});ami['on'](_0xe207('0x31'),function(_0x210803){try{utils[_0xe207('0x17')](util[_0xe207('0x19')](_0xe207('0x32'),_0x210803[_0xe207('0x1d')]),_0x210803);members[_0xe207('0x31')](_0x210803);}catch(_0xb14986){utils[_0xe207('0x13')](util['format'](_0xe207('0x32'),_0x210803[_0xe207('0x1d')]),_0xb14986);}});ami['on'](_0xe207('0x33'),function(_0x103cba){try{utils['debug'](util[_0xe207('0x19')](_0xe207('0x34'),_0x103cba[_0xe207('0x1d')]),_0x103cba);queues[_0xe207('0x33')](_0x103cba);agents[_0xe207('0x33')](_0x103cba);transfers[_0xe207('0x33')](_0x103cba);recordings[_0xe207('0x33')](_0x103cba);}catch(_0x1119ef){utils[_0xe207('0x13')](util[_0xe207('0x19')]('[%s][index][blindtransfer]',_0x103cba[_0xe207('0x1d')]),_0x1119ef);}});ami['on'](_0xe207('0x35'),function(_0x4def8b){try{utils[_0xe207('0x17')](util[_0xe207('0x19')](_0xe207('0x36'),_0x4def8b['origtransfereruniqueid']),_0x4def8b);queues[_0xe207('0x35')](_0x4def8b);transfers[_0xe207('0x35')](_0x4def8b);agents[_0xe207('0x35')](_0x4def8b);calls[_0xe207('0x35')](_0x4def8b);}catch(_0x1647bc){utils[_0xe207('0x13')](util[_0xe207('0x19')](_0xe207('0x36'),_0x4def8b[_0xe207('0x37')]),_0x1647bc);}});ami['on'](_0xe207('0x38'),function(_0x4d1bbf){try{utils['debug'](util['format'](_0xe207('0x39'),_0x4d1bbf['uniqueid']),_0x4d1bbf);queues[_0xe207('0x38')](_0x4d1bbf);recordings[_0xe207('0x38')](_0x4d1bbf);calls[_0xe207('0x38')](_0x4d1bbf);dials[_0xe207('0x38')](_0x4d1bbf);}catch(_0x511f5c){utils['error'](util[_0xe207('0x19')](_0xe207('0x39'),_0x4d1bbf['uniqueid']),_0x511f5c);}});ami['on'](_0xe207('0x3a'),function(_0xad8148){try{utils[_0xe207('0x17')](util[_0xe207('0x19')](_0xe207('0x3b'),_0xad8148[_0xe207('0x1d')]),_0xad8148);calls[_0xe207('0x3a')](_0xad8148);recordings[_0xe207('0x3a')](_0xad8148);dials[_0xe207('0x3a')](_0xad8148);}catch(_0x326321){utils['error'](util[_0xe207('0x19')](_0xe207('0x3b'),_0xad8148[_0xe207('0x1d')]),_0x326321);}});ami['on'](_0xe207('0x3c'),function(_0x19068c){try{utils[_0xe207('0x17')](util[_0xe207('0x19')](_0xe207('0x3d'),_0x19068c[_0xe207('0x1d')]),_0x19068c);calls[_0xe207('0x3c')](_0x19068c);recordings['newchannel'](_0x19068c);}catch(_0x22772a){utils[_0xe207('0x13')](util[_0xe207('0x19')](_0xe207('0x3d'),_0x19068c['uniqueid']),_0x22772a);}});ami['on']('dialbegin',function(_0x368eab){try{utils['debug'](util[_0xe207('0x19')]('[%s][index][dialbegin]',_0x368eab[_0xe207('0x1d')]),_0x368eab);dials[_0xe207('0x3e')](_0x368eab);}catch(_0x35ce2d){utils['error'](util[_0xe207('0x19')](_0xe207('0x3f'),_0x368eab[_0xe207('0x1d')]),_0x35ce2d);}});ami['on'](_0xe207('0x40'),function(_0x2e44b6){try{utils[_0xe207('0x17')](util['format']('[%s][index][dialend]',_0x2e44b6[_0xe207('0x1d')]),_0x2e44b6);dials[_0xe207('0x40')](_0x2e44b6);}catch(_0x565819){utils[_0xe207('0x13')](util[_0xe207('0x19')](_0xe207('0x41'),_0x2e44b6[_0xe207('0x1d')]),_0x565819);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5e83c33..df49f99 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 _0xeb02=['BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','[%s][members][devicestatechange]','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','split','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','then','name','internal','request','CreateMemberReport','getUserByName','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xeb02,0xe8));var _0x2eb0=function(_0x4b4377,_0x1f5b62){_0x4b4377=_0x4b4377-0x0;var _0x47ba65=_0xeb02[_0x4b4377];return _0x47ba65;};'use strict';var _=require(_0x2eb0('0x0'));var util=require(_0x2eb0('0x1'));var utils=require('./utils');var members={};var exclude=[_0x2eb0('0x2'),_0x2eb0('0x3')];function writeDB(_0x2cb402){utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x6'),_0x2cb402[_0x2eb0('0x7')],_0x2cb402[_0x2eb0('0x8')],_0x2cb402[_0x2eb0('0x9')],_0x2cb402[_0x2eb0('0xa')],_0x2cb402[_0x2eb0('0xb')],_0x2cb402['type']));if(_0x2cb402[_0x2eb0('0x8')]){utils['getUserByInterface'](_0x2cb402['interface'])[_0x2eb0('0xc')](function(_0x5abbaa){if(_0x5abbaa){_0x2cb402[_0x2eb0('0xb')]=_0x5abbaa[_0x2eb0('0xd')];_0x2cb402['internal']=_0x5abbaa[_0x2eb0('0xe')];utils[_0x2eb0('0xf')](_0x2eb0('0x10'),_0x2cb402);}else{utils[_0x2eb0('0x11')](_0x2cb402[_0x2eb0('0x8')]['split']('/')[0x1])['then'](function(_0x223cdd){if(_0x223cdd){_0x2cb402['membername']=_0x223cdd[_0x2eb0('0xd')];_0x2cb402['internal']=_0x223cdd[_0x2eb0('0xe')];utils['request'](_0x2eb0('0x10'),_0x2cb402);}});}})['catch'](function(_0x1b18d5){utils[_0x2eb0('0x12')](util['format'](_0x2eb0('0x13'),_0x2cb402[_0x2eb0('0x7')]),_0x1b18d5);});}delete members[_0x2cb402[_0x2eb0('0x8')]];}function startsWith(_0x57957b,_0x11563c){return _[_0x2eb0('0x14')](_0x57957b,function(_0x2c91c9){return _[_0x2eb0('0x15')](_0x11563c,_0x2c91c9);});}exports[_0x2eb0('0x16')]=function(_0x396631){try{utils[_0x2eb0('0x17')](util['format']('[%s][members][devicestatechange]',members[_0x396631['device']]?members[_0x396631['device']]['uniqueid']:_0x396631[_0x2eb0('0x18')]),_0x396631);utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x19'),members[_0x396631[_0x2eb0('0x18')]]?members[_0x396631['device']][_0x2eb0('0x7')]:_0x396631[_0x2eb0('0x18')],_0x396631[_0x2eb0('0x1a')],_0x396631[_0x2eb0('0x18')]));switch(_0x396631[_0x2eb0('0x1a')]){case _0x2eb0('0x1b'):case _0x2eb0('0x1c'):if(!startsWith(exclude,_0x396631['device'])){members[_0x396631[_0x2eb0('0x18')]]={'channel':_0x2eb0('0x1d'),'interface':_0x396631[_0x2eb0('0x18')],'type':_0x2eb0('0x1e'),'enterAt':utils[_0x2eb0('0x1f')](),'role':'agent'};}break;case _0x2eb0('0x20'):if(!_[_0x2eb0('0x21')](members[_0x396631['device']])){members[_0x396631[_0x2eb0('0x18')]][_0x2eb0('0x22')]=utils['now']();members[_0x396631[_0x2eb0('0x18')]][_0x2eb0('0x23')]=utils[_0x2eb0('0x24')](members[_0x396631[_0x2eb0('0x18')]]['exitAt'],members[_0x396631[_0x2eb0('0x18')]]['enterAt']);if(members[_0x396631[_0x2eb0('0x18')]][_0x2eb0('0x7')]){writeDB(members[_0x396631[_0x2eb0('0x18')]]);}}break;default:break;}}catch(_0x1a4828){utils[_0x2eb0('0x12')](util[_0x2eb0('0x5')](_0x2eb0('0x25'),members[_0x396631['device']]?members[_0x396631['device']][_0x2eb0('0x7')]:_0x396631[_0x2eb0('0x18')]),_0x1a4828);}};exports['agentcomplete']=function(_0x1d012f){try{if(!_['isNil'](members[_0x1d012f[_0x2eb0('0x8')]])){utils[_0x2eb0('0x17')](util[_0x2eb0('0x5')](_0x2eb0('0x26'),_0x1d012f[_0x2eb0('0x7')]),_0x1d012f);utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x27'),_0x1d012f[_0x2eb0('0x7')],_0x1d012f[_0x2eb0('0x8')],_0x1d012f['queue']));members[_0x1d012f['interface']]=_[_0x2eb0('0x28')](members[_0x1d012f[_0x2eb0('0x8')]],{'data4':_0x1d012f[_0x2eb0('0x29')],'uniqueid':_0x1d012f[_0x2eb0('0x7')]});}}catch(_0x4135d2){utils[_0x2eb0('0x12')](util[_0x2eb0('0x5')](_0x2eb0('0x26'),_0x1d012f[_0x2eb0('0x7')]),_0x4135d2);}};exports[_0x2eb0('0x2a')]=function(_0xcd6795){try{utils['debug'](util[_0x2eb0('0x5')](_0x2eb0('0x2b'),_0xcd6795['uniqueid']),_0xcd6795);if(_0xcd6795['channel']){var _0x158fc5=_0xcd6795[_0x2eb0('0x9')][_0x2eb0('0x2c')]('-')[0x0];if(!_[_0x2eb0('0x21')](members[_0x158fc5])){members[_0x158fc5]=_[_0x2eb0('0x28')](members[_0x158fc5],{'data1':members[_0x158fc5]['data1']||_0xcd6795[_0x2eb0('0x2d')],'data2':members[_0x158fc5][_0x2eb0('0xa')]||_0xcd6795[_0x2eb0('0x2e')],'data3':members[_0x158fc5][_0x2eb0('0x2f')]||_0xcd6795[_0x2eb0('0x30')],'uniqueid':members[_0x158fc5]['uniqueid']||_0xcd6795[_0x2eb0('0x7')]});utils[_0x2eb0('0x4')](util[_0x2eb0('0x5')](_0x2eb0('0x31'),_0xcd6795['uniqueid'],members[_0x158fc5][_0x2eb0('0x32')],members[_0x158fc5][_0x2eb0('0xa')],members[_0x158fc5]['data3']));if(members[_0x158fc5][_0x2eb0('0x22')]){writeDB(members[_0x158fc5]);}}}if(_0xcd6795[_0x2eb0('0x33')]){var _0x2f4c89=_0xcd6795[_0x2eb0('0x33')][_0x2eb0('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x2f4c89])){members[_0x2f4c89]=_[_0x2eb0('0x28')](members[_0x2f4c89],{'data1':members[_0x2f4c89]['data1']||_0xcd6795[_0x2eb0('0x2d')],'data2':members[_0x2f4c89][_0x2eb0('0xa')]||_0xcd6795[_0x2eb0('0x2e')],'data3':members[_0x2f4c89]['data3']||_0xcd6795[_0x2eb0('0x30')],'uniqueid':members[_0x2f4c89]['uniqueid']||_0xcd6795['uniqueid']});utils['info'](util[_0x2eb0('0x5')](_0x2eb0('0x31'),_0xcd6795[_0x2eb0('0x7')],members[_0x2f4c89][_0x2eb0('0x32')],members[_0x2f4c89][_0x2eb0('0xa')],members[_0x2f4c89]['data3']));if(members[_0x2f4c89][_0x2eb0('0x22')]){writeDB(members[_0x2f4c89]);}}}}catch(_0xb9551b){utils[_0x2eb0('0x12')](util[_0x2eb0('0x5')]('[%s][members][cdr]',_0xcd6795[_0x2eb0('0x7')]),_0xb9551b);}}; \ No newline at end of file +var _0x05bf=['info','state','voice','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','data1','type','destination','data3','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device'];(function(_0xab324c,_0x5b48ef){var _0x184480=function(_0x3391b7){while(--_0x3391b7){_0xab324c['push'](_0xab324c['shift']());}};_0x184480(++_0x5b48ef);}(_0x05bf,0x77));var _0xf05b=function(_0x2759bf,_0xbbf890){_0x2759bf=_0x2759bf-0x0;var _0x5d9d48=_0x05bf[_0x2759bf];return _0x5d9d48;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var utils=require(_0xf05b('0x2'));var members={};var exclude=[_0xf05b('0x3'),_0xf05b('0x4')];function writeDB(_0x269b5e){utils['info'](util[_0xf05b('0x5')](_0xf05b('0x6'),_0x269b5e[_0xf05b('0x7')],_0x269b5e[_0xf05b('0x8')],_0x269b5e[_0xf05b('0x9')],_0x269b5e[_0xf05b('0xa')],_0x269b5e[_0xf05b('0xb')],_0x269b5e['type']));if(_0x269b5e[_0xf05b('0x8')]){utils['getUserByInterface'](_0x269b5e[_0xf05b('0x8')])['then'](function(_0x29e008){if(_0x29e008){_0x269b5e[_0xf05b('0xb')]=_0x29e008[_0xf05b('0xc')];_0x269b5e[_0xf05b('0xd')]=_0x29e008[_0xf05b('0xd')];utils[_0xf05b('0xe')](_0xf05b('0xf'),_0x269b5e);}else{utils[_0xf05b('0x10')](_0x269b5e[_0xf05b('0x8')][_0xf05b('0x11')]('/')[0x1])[_0xf05b('0x12')](function(_0x3a2965){if(_0x3a2965){_0x269b5e[_0xf05b('0xb')]=_0x3a2965[_0xf05b('0xc')];_0x269b5e[_0xf05b('0xd')]=_0x3a2965[_0xf05b('0xd')];utils[_0xf05b('0xe')](_0xf05b('0xf'),_0x269b5e);}});}})[_0xf05b('0x13')](function(_0xdc65c2){utils[_0xf05b('0x14')](util['format'](_0xf05b('0x15'),_0x269b5e[_0xf05b('0x7')]),_0xdc65c2);});}delete members[_0x269b5e[_0xf05b('0x8')]];}function startsWith(_0x33d254,_0x44ec07){return _[_0xf05b('0x16')](_0x33d254,function(_0xbccaf8){return _[_0xf05b('0x17')](_0x44ec07,_0xbccaf8);});}exports[_0xf05b('0x18')]=function(_0x31c1e2){try{utils[_0xf05b('0x19')](util['format'](_0xf05b('0x1a'),members[_0x31c1e2[_0xf05b('0x1b')]]?members[_0x31c1e2[_0xf05b('0x1b')]][_0xf05b('0x7')]:_0x31c1e2[_0xf05b('0x1b')]),_0x31c1e2);utils[_0xf05b('0x1c')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x31c1e2[_0xf05b('0x1b')]]?members[_0x31c1e2[_0xf05b('0x1b')]][_0xf05b('0x7')]:_0x31c1e2[_0xf05b('0x1b')],_0x31c1e2[_0xf05b('0x1d')],_0x31c1e2[_0xf05b('0x1b')]));switch(_0x31c1e2['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x31c1e2['device'])){members[_0x31c1e2['device']]={'channel':_0xf05b('0x1e'),'interface':_0x31c1e2[_0xf05b('0x1b')],'type':'TALKING','enterAt':utils[_0xf05b('0x1f')](),'role':_0xf05b('0x20')};}break;case _0xf05b('0x21'):if(!_[_0xf05b('0x22')](members[_0x31c1e2['device']])){members[_0x31c1e2[_0xf05b('0x1b')]][_0xf05b('0x23')]=utils[_0xf05b('0x1f')]();members[_0x31c1e2['device']]['duration']=utils[_0xf05b('0x24')](members[_0x31c1e2[_0xf05b('0x1b')]][_0xf05b('0x23')],members[_0x31c1e2[_0xf05b('0x1b')]][_0xf05b('0x25')]);if(members[_0x31c1e2[_0xf05b('0x1b')]][_0xf05b('0x7')]){writeDB(members[_0x31c1e2[_0xf05b('0x1b')]]);}}break;default:break;}}catch(_0x5789df){utils[_0xf05b('0x14')](util[_0xf05b('0x5')](_0xf05b('0x1a'),members[_0x31c1e2[_0xf05b('0x1b')]]?members[_0x31c1e2['device']][_0xf05b('0x7')]:_0x31c1e2[_0xf05b('0x1b')]),_0x5789df);}};exports['agentcomplete']=function(_0x51ca1c){try{if(!_['isNil'](members[_0x51ca1c['interface']])){utils[_0xf05b('0x19')](util[_0xf05b('0x5')](_0xf05b('0x26'),_0x51ca1c[_0xf05b('0x7')]),_0x51ca1c);utils['info'](util[_0xf05b('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x51ca1c[_0xf05b('0x7')],_0x51ca1c['interface'],_0x51ca1c[_0xf05b('0x27')]));members[_0x51ca1c[_0xf05b('0x8')]]=_[_0xf05b('0x28')](members[_0x51ca1c[_0xf05b('0x8')]],{'data4':_0x51ca1c['queue'],'uniqueid':_0x51ca1c[_0xf05b('0x7')]});}}catch(_0x44a34a){utils[_0xf05b('0x14')](util[_0xf05b('0x5')]('[%s][members][agentcomplete]',_0x51ca1c[_0xf05b('0x7')]),_0x44a34a);}};exports[_0xf05b('0x29')]=function(_0x197ae6){try{utils[_0xf05b('0x19')](util['format'](_0xf05b('0x2a'),_0x197ae6[_0xf05b('0x7')]),_0x197ae6);if(_0x197ae6['channel']){var _0x5ab82a=_0x197ae6[_0xf05b('0x9')][_0xf05b('0x11')]('-')[0x0];if(!_[_0xf05b('0x22')](members[_0x5ab82a])){members[_0x5ab82a]=_[_0xf05b('0x28')](members[_0x5ab82a],{'data1':members[_0x5ab82a][_0xf05b('0x2b')]||_0x197ae6[_0xf05b('0x2c')],'data2':members[_0x5ab82a][_0xf05b('0xa')]||_0x197ae6['source'],'data3':members[_0x5ab82a]['data3']||_0x197ae6[_0xf05b('0x2d')],'uniqueid':members[_0x5ab82a]['uniqueid']||_0x197ae6[_0xf05b('0x7')]});utils[_0xf05b('0x1c')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x197ae6[_0xf05b('0x7')],members[_0x5ab82a]['data1'],members[_0x5ab82a][_0xf05b('0xa')],members[_0x5ab82a][_0xf05b('0x2e')]));if(members[_0x5ab82a][_0xf05b('0x23')]){writeDB(members[_0x5ab82a]);}}}if(_0x197ae6['destinationchannel']){var _0x2e3e7b=_0x197ae6[_0xf05b('0x2f')][_0xf05b('0x11')]('-')[0x0];if(!_[_0xf05b('0x22')](members[_0x2e3e7b])){members[_0x2e3e7b]=_[_0xf05b('0x28')](members[_0x2e3e7b],{'data1':members[_0x2e3e7b][_0xf05b('0x2b')]||_0x197ae6['type'],'data2':members[_0x2e3e7b][_0xf05b('0xa')]||_0x197ae6[_0xf05b('0x30')],'data3':members[_0x2e3e7b][_0xf05b('0x2e')]||_0x197ae6[_0xf05b('0x2d')],'uniqueid':members[_0x2e3e7b][_0xf05b('0x7')]||_0x197ae6[_0xf05b('0x7')]});utils[_0xf05b('0x1c')](util[_0xf05b('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x197ae6[_0xf05b('0x7')],members[_0x2e3e7b][_0xf05b('0x2b')],members[_0x2e3e7b]['data2'],members[_0x2e3e7b]['data3']));if(members[_0x2e3e7b]['exitAt']){writeDB(members[_0x2e3e7b]);}}}}catch(_0x4a5414){utils['error'](util['format'](_0xf05b('0x2a'),_0x197ae6[_0xf05b('0x7')]),_0x4a5414);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index b399dbd..5d2af3b 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 _0x54e1=['transfertype','BLIND','extension','transferuniqueid','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transferexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercomplete','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfer'];(function(_0xc65142,_0x338c38){var _0x51722c=function(_0x3e0fdc){while(--_0x3e0fdc){_0xc65142['push'](_0xc65142['shift']());}};_0x51722c(++_0x338c38);}(_0x54e1,0x1b6));var _0x154e=function(_0x515610,_0x51d4ca){_0x515610=_0x515610-0x0;var _0x555356=_0x54e1[_0x515610];return _0x555356;};'use strict';var _=require(_0x154e('0x0'));var util=require(_0x154e('0x1'));var utils=require(_0x154e('0x2'));var queues={};function writeDB(_0x1eaafc){utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x5'),_0x1eaafc[_0x154e('0x6')],_0x1eaafc['channel'],_0x1eaafc[_0x154e('0x7')],_0x1eaafc[_0x154e('0x8')],_0x1eaafc[_0x154e('0x9')],_0x1eaafc[_0x154e('0xa')],_0x1eaafc[_0x154e('0xb')]));if(_0x1eaafc[_0x154e('0x7')]){utils[_0x154e('0xc')](_0x1eaafc[_0x154e('0x7')])['then'](function(_0xfc64f1){if(_0xfc64f1){_0x1eaafc[_0x154e('0xd')]=_0xfc64f1[_0x154e('0xd')];}utils[_0x154e('0xe')](_0x154e('0xf'),_0x1eaafc);});}else{utils['request'](_0x154e('0xf'),_0x1eaafc);}if(_0x1eaafc[_0x154e('0x10')]){delete queues[_0x1eaafc[_0x154e('0x10')]];}else{delete queues[_0x1eaafc[_0x154e('0x6')]];}}exports[_0x154e('0x11')]=function(_0x3244b6){try{utils[_0x154e('0x12')](util['format'](_0x154e('0x13'),_0x3244b6[_0x154e('0x6')]),_0x3244b6);utils['info'](util[_0x154e('0x4')](_0x154e('0x14'),_0x3244b6[_0x154e('0x6')],_0x3244b6[_0x154e('0x7')],_0x3244b6[_0x154e('0x15')]));queues[_0x3244b6[_0x154e('0x6')]]=_[_0x154e('0x16')](_0x3244b6,{'originalposition':_0x3244b6[_0x154e('0x15')],'queuecallerjoinAt':utils[_0x154e('0x17')](),'mohtime':0x0});}catch(_0x2541ca){utils[_0x154e('0x18')](util[_0x154e('0x4')](_0x154e('0x13'),_0x3244b6[_0x154e('0x6')]),_0x2541ca);}};exports[_0x154e('0x19')]=function(_0x4e1b49){try{if(!_['isNil'](queues[_0x4e1b49[_0x154e('0x6')]])){utils[_0x154e('0x12')](util['format'](_0x154e('0x1a'),_0x4e1b49['uniqueid']),_0x4e1b49);if(queues[_0x4e1b49[_0x154e('0x6')]][_0x154e('0x1b')]){if(!queues[_0x4e1b49[_0x154e('0x6')]]['queuecallerabandon']&&!queues[_0x4e1b49[_0x154e('0x6')]][_0x154e('0x1c')]){queues[_0x4e1b49[_0x154e('0x6')]]['queuecallercomplete']=!![];queues[_0x4e1b49[_0x154e('0x6')]][_0x154e('0x1d')]=utils[_0x154e('0x17')]();queues[_0x4e1b49[_0x154e('0x6')]][_0x154e('0xb')]=_0x154e('0x1e');}utils['info'](util[_0x154e('0x4')](_0x154e('0x1f'),_0x4e1b49[_0x154e('0x6')],queues[_0x4e1b49['uniqueid']][_0x154e('0x20')],queues[_0x4e1b49[_0x154e('0x6')]][_0x154e('0xb')]));writeDB(queues[_0x4e1b49[_0x154e('0x6')]]);}else if(queues[_0x4e1b49[_0x154e('0x6')]]['transfereduniqueid']){utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x21'),_0x4e1b49['uniqueid'],queues[_0x4e1b49[_0x154e('0x6')]][_0x154e('0x20')],queues[_0x4e1b49['uniqueid']][_0x154e('0x10')]));queues[queues[_0x4e1b49['uniqueid']][_0x154e('0x10')]]=queues[_0x4e1b49[_0x154e('0x6')]];queues[queues[_0x4e1b49['uniqueid']][_0x154e('0x10')]][_0x154e('0x22')]=0x2;delete queues[_0x4e1b49['uniqueid']];}}}catch(_0x45f030){utils[_0x154e('0x18')](util['format']('[%s][queues][hangup]',_0x4e1b49[_0x154e('0x6')]),_0x45f030);}};exports['varset']=function(_0x1c67d5){try{utils[_0x154e('0x12')](util[_0x154e('0x4')]('[%s][queues][varset]',_0x1c67d5[_0x154e('0x6')]),_0x1c67d5);if(!_[_0x154e('0x23')](_0x1c67d5[_0x154e('0x24')][_0x154e('0x25')])&&_0x1c67d5[_0x154e('0x26')][_0x154e('0x27')]()!==_0x154e('0x28')){if(!_['isNil'](queues[_0x1c67d5[_0x154e('0x6')]])){queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x29')]=![];queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x2a')]=null;queues[_0x1c67d5[_0x154e('0x6')]]['queuecallerexit']=!![];queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x2b')]=utils[_0x154e('0x17')]();queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0xb')]=_0x1c67d5['value'][_0x154e('0x27')]();utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x2c'),_0x1c67d5[_0x154e('0x6')],queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x20')],_0x1c67d5[_0x154e('0x26')],queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0xb')]));writeDB(queues[_0x1c67d5[_0x154e('0x6')]]);}}else if(!_[_0x154e('0x23')](_0x1c67d5[_0x154e('0x24')][_0x154e('0x2d')])){if(!_[_0x154e('0x23')](queues[_0x1c67d5[_0x154e('0x6')]])&&!queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x29')]){queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x29')]=![];queues[_0x1c67d5['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x1c')]=!![];queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x2b')]=utils[_0x154e('0x17')]();queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0xb')]=_0x154e('0x2e');utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x2f'),_0x1c67d5[_0x154e('0x6')],queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0x20')],_0x1c67d5['value'],queues[_0x1c67d5[_0x154e('0x6')]][_0x154e('0xb')]));}}}catch(_0xcd66a0){utils[_0x154e('0x18')](util[_0x154e('0x4')]('[%s][queues][varset]',_0x1c67d5['uniqueid']),_0xcd66a0);}};exports[_0x154e('0x29')]=function(_0x25b8d7){try{if(!_[_0x154e('0x23')](queues[_0x25b8d7[_0x154e('0x6')]])){utils[_0x154e('0x12')](util['format'](_0x154e('0x30'),_0x25b8d7[_0x154e('0x6')]),_0x25b8d7);queues[_0x25b8d7[_0x154e('0x6')]]['queuecallerexit']=![];queues[_0x25b8d7[_0x154e('0x6')]][_0x154e('0x2b')]=null;queues[_0x25b8d7[_0x154e('0x6')]]['queuecallerabandon']=!![];queues[_0x25b8d7[_0x154e('0x6')]][_0x154e('0x2a')]=utils['now']();queues[_0x25b8d7[_0x154e('0x6')]][_0x154e('0xb')]='ABANDONED';utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x31'),_0x25b8d7[_0x154e('0x6')],queues[_0x25b8d7['uniqueid']][_0x154e('0x20')],queues[_0x25b8d7[_0x154e('0x6')]][_0x154e('0xb')]));}}catch(_0x51398f){utils[_0x154e('0x18')](util[_0x154e('0x4')](_0x154e('0x30'),_0x25b8d7[_0x154e('0x6')]),_0x51398f);}};exports[_0x154e('0x32')]=function(_0x37f9d1){try{if(!_[_0x154e('0x23')](queues[_0x37f9d1[_0x154e('0x6')]])){utils['debug'](util[_0x154e('0x4')]('[%s][queues][queuecallerleave]',_0x37f9d1[_0x154e('0x6')]),_0x37f9d1);utils['info'](util[_0x154e('0x4')](_0x154e('0x33'),_0x37f9d1['uniqueid'],queues[_0x37f9d1[_0x154e('0x6')]][_0x154e('0x20')],_0x37f9d1[_0x154e('0x34')],_0x37f9d1[_0x154e('0x35')]));queues[_0x37f9d1[_0x154e('0x6')]][_0x154e('0x32')]=!![];queues[_0x37f9d1[_0x154e('0x6')]]['queuecallerleaveAt']=utils['now']();queues[_0x37f9d1[_0x154e('0x6')]][_0x154e('0x36')]=utils[_0x154e('0x37')](queues[_0x37f9d1[_0x154e('0x6')]][_0x154e('0x1b')],queues[_0x37f9d1[_0x154e('0x6')]]['queuecallerjoinAt']);queues[_0x37f9d1['uniqueid']][_0x154e('0x15')]=_0x37f9d1[_0x154e('0x15')];queues[_0x37f9d1[_0x154e('0x6')]][_0x154e('0x38')]=_0x37f9d1[_0x154e('0x38')];queues[_0x37f9d1[_0x154e('0x6')]][_0x154e('0x34')]=_0x37f9d1[_0x154e('0x34')];queues[_0x37f9d1[_0x154e('0x6')]][_0x154e('0x35')]=_0x37f9d1[_0x154e('0x35')];}}catch(_0x20902b){utils[_0x154e('0x18')](util[_0x154e('0x4')](_0x154e('0x39'),_0x37f9d1[_0x154e('0x6')]),_0x20902b);}};exports[_0x154e('0x3a')]=function(_0xf3eea4){try{if(!_['isNil'](queues[_0xf3eea4['uniqueid']])){utils[_0x154e('0x12')](util['format'](_0x154e('0x3b'),_0xf3eea4['uniqueid']),_0xf3eea4);utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x3c'),_0xf3eea4['uniqueid'],queues[_0xf3eea4[_0x154e('0x6')]][_0x154e('0x20')],_0xf3eea4['membername'],_0xf3eea4['destaccountcode']));queues[_0xf3eea4[_0x154e('0x6')]][_0x154e('0x29')]=![];queues[_0xf3eea4['uniqueid']][_0x154e('0x29')]=![];queues[_0xf3eea4[_0x154e('0x6')]][_0x154e('0x2a')]=null;queues[_0xf3eea4[_0x154e('0x6')]]['queuecallerexit']=![];queues[_0xf3eea4[_0x154e('0x6')]][_0x154e('0xb')]=null;queues[_0xf3eea4[_0x154e('0x6')]][_0x154e('0x2b')]=null;queues[_0xf3eea4[_0x154e('0x6')]]['assigned']=!![];queues[_0xf3eea4['uniqueid']][_0x154e('0xa')]=_0xf3eea4[_0x154e('0x3d')];queues[_0xf3eea4[_0x154e('0x6')]][_0x154e('0x8')]=_0xf3eea4[_0x154e('0x3e')];}}catch(_0x173713){utils[_0x154e('0x18')](util['format'](_0x154e('0x3b'),_0xf3eea4['uniqueid']),_0x173713);}};exports[_0x154e('0x3f')]=function(_0x511e5b){try{if(!_[_0x154e('0x23')](queues[_0x511e5b[_0x154e('0x6')]])){if(queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x1b')]){utils['debug'](util[_0x154e('0x4')](_0x154e('0x40'),_0x511e5b['uniqueid']),_0x511e5b);queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x29')]=![];queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x29')]=![];queues[_0x511e5b['uniqueid']][_0x154e('0x2a')]=null;queues[_0x511e5b['uniqueid']][_0x154e('0x1c')]=![];queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x2b')]=null;queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x41')]=!![];queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x8')]=_0x511e5b[_0x154e('0x3e')];queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x42')]=!![];queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x1d')]=utils[_0x154e('0x17')]();if(_0x511e5b['reason']=='transfer'){if(!queues[_0x511e5b[_0x154e('0x6')]]['transfer']){queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0xb')]='TRANSFER';}}else{queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0xb')]=_0x154e('0x43')+_0x511e5b['reason'][_0x154e('0x27')]();}utils[_0x154e('0x3')](util[_0x154e('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x511e5b[_0x154e('0x6')],queues[_0x511e5b[_0x154e('0x6')]][_0x154e('0x20')],_0x511e5b[_0x154e('0x3e')],queues[_0x511e5b['uniqueid']][_0x154e('0xb')]));writeDB(queues[_0x511e5b[_0x154e('0x6')]]);}}}catch(_0x3251b3){utils[_0x154e('0x18')](util[_0x154e('0x4')]('[%s][queues][agentcomplete]',_0x511e5b['uniqueid']),_0x3251b3);}};exports[_0x154e('0x44')]=function(_0x3c3ce1){try{if(!_['isNil'](queues[_0x3c3ce1[_0x154e('0x45')]])){utils[_0x154e('0x12')](util['format'](_0x154e('0x46'),_0x3c3ce1[_0x154e('0x6')]),_0x3c3ce1);queues[_0x3c3ce1[_0x154e('0x45')]][_0x154e('0x47')]=!![];queues[_0x3c3ce1[_0x154e('0x45')]][_0x154e('0x48')]=_0x154e('0x49');queues[_0x3c3ce1['transfereeuniqueid']]['transferexten']=_0x3c3ce1[_0x154e('0x4a')];queues[_0x3c3ce1['transfereeuniqueid']][_0x154e('0x4b')]=_0x3c3ce1[_0x154e('0x45')];queues[_0x3c3ce1[_0x154e('0x45')]][_0x154e('0xb')]='BLINDTRANSFER';utils[_0x154e('0x3')](util[_0x154e('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3c3ce1[_0x154e('0x6')],queues[_0x3c3ce1[_0x154e('0x45')]][_0x154e('0x20')],_0x3c3ce1[_0x154e('0x45')],_0x3c3ce1[_0x154e('0x4a')]));}}catch(_0x45e7e6){utils[_0x154e('0x18')](util[_0x154e('0x4')](_0x154e('0x46'),_0x3c3ce1[_0x154e('0x6')]),_0x45e7e6);}};exports[_0x154e('0x4c')]=function(_0x55ea8d){try{utils[_0x154e('0x12')](util[_0x154e('0x4')](_0x154e('0x4d'),_0x55ea8d['origtransfereruniqueid']),_0x55ea8d);if(_0x55ea8d[_0x154e('0x4e')]==_0x55ea8d[_0x154e('0x4f')]){if(!_['isNil'](queues[_0x55ea8d[_0x154e('0x50')]])){utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x51'),_0x55ea8d[_0x154e('0x4e')],queues[_0x55ea8d[_0x154e('0x50')]][_0x154e('0x20')],_0x55ea8d[_0x154e('0x52')]));queues[_0x55ea8d[_0x154e('0x50')]][_0x154e('0x47')]=!![];queues[_0x55ea8d['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x55ea8d[_0x154e('0x50')]][_0x154e('0x53')]=_0x55ea8d['origtransfererexten'];queues[_0x55ea8d[_0x154e('0x50')]][_0x154e('0x4b')]=_0x55ea8d['origtransfereruniqueid'];queues[_0x55ea8d[_0x154e('0x50')]][_0x154e('0xb')]=_0x154e('0x54');}if(!_[_0x154e('0x23')](queues[_0x55ea8d[_0x154e('0x4f')]])){if(_0x55ea8d[_0x154e('0x55')]&&queues[_0x55ea8d[_0x154e('0x55')]]){queues[_0x55ea8d['transfereelinkedid']][_0x154e('0x22')]=0x1;queues[_0x55ea8d['transfereeuniqueid']]=_['clone'](queues[_0x55ea8d[_0x154e('0x55')]]);queues[_0x55ea8d[_0x154e('0x45')]][_0x154e('0x10')]=_0x55ea8d[_0x154e('0x56')];queues[_0x55ea8d['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x55ea8d['transfereeuniqueid']][_0x154e('0x9')]=queues[_0x55ea8d[_0x154e('0x50')]][_0x154e('0x9')];queues[_0x55ea8d['transfereeuniqueid']][_0x154e('0x57')]=queues[_0x55ea8d['secondtransfererlinkedid']][_0x154e('0x57')];queues[_0x55ea8d['transfereeuniqueid']][_0x154e('0x58')]=utils[_0x154e('0x17')]();queues[_0x55ea8d['transfereeuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x55ea8d[_0x154e('0x45')]][_0x154e('0x36')]=0x0;queues[_0x55ea8d[_0x154e('0x45')]][_0x154e('0x59')]=0x0;utils['info'](util[_0x154e('0x4')](_0x154e('0x5a'),_0x55ea8d[_0x154e('0x4e')],queues[_0x55ea8d[_0x154e('0x45')]][_0x154e('0x20')],queues[_0x55ea8d[_0x154e('0x45')]]['calleridnum'],queues[_0x55ea8d[_0x154e('0x45')]]['calleridname']));}else{utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x5b'),_0x55ea8d['origtransfereruniqueid'],queues[_0x55ea8d[_0x154e('0x4f')]][_0x154e('0x20')],_0x55ea8d[_0x154e('0x50')]));queues[_0x55ea8d[_0x154e('0x4f')]]['transfereduniqueid']=_0x55ea8d[_0x154e('0x50')];}}}else if(_0x55ea8d[_0x154e('0x5c')]==_0x55ea8d[_0x154e('0x50')]){if(!_[_0x154e('0x23')](queues[_0x55ea8d['origtransfererlinkedid']])){utils['info'](util[_0x154e('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x55ea8d['origtransfereruniqueid'],queues[_0x55ea8d[_0x154e('0x4f')]][_0x154e('0x20')],_0x55ea8d[_0x154e('0x5c')],_0x55ea8d[_0x154e('0x5d')]));queues[_0x55ea8d[_0x154e('0x4f')]]['transfer']=!![];queues[_0x55ea8d[_0x154e('0x4f')]][_0x154e('0x48')]='ATTENDED';queues[_0x55ea8d[_0x154e('0x4f')]][_0x154e('0x53')]=_0x55ea8d[_0x154e('0x5d')];queues[_0x55ea8d[_0x154e('0x4f')]][_0x154e('0x4b')]=_0x55ea8d[_0x154e('0x5c')];queues[_0x55ea8d[_0x154e('0x4f')]][_0x154e('0xb')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x55ea8d['secondtransfererlinkedid']])){if(_0x55ea8d[_0x154e('0x5e')]&&queues[_0x55ea8d[_0x154e('0x5e')]]){queues[_0x55ea8d['transfertargetlinkedid']][_0x154e('0x22')]=0x1;queues[_0x55ea8d['transfertargetuniqueid']]=_[_0x154e('0x5f')](queues[_0x55ea8d[_0x154e('0x5e')]]);queues[_0x55ea8d['transfertargetuniqueid']][_0x154e('0x10')]=_0x55ea8d[_0x154e('0x56')];queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x22')]=0x2;queues[_0x55ea8d[_0x154e('0x56')]]['calleridnum']=queues[_0x55ea8d[_0x154e('0x4f')]][_0x154e('0x9')];queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x57')]=queues[_0x55ea8d[_0x154e('0x4f')]]['calleridname'];queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x58')]=utils['now']();queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x1b')]=utils[_0x154e('0x17')]();queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x36')]=0x0;queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x59')]=0x0;utils[_0x154e('0x3')](util[_0x154e('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x55ea8d['origtransfereruniqueid'],queues[_0x55ea8d[_0x154e('0x56')]]['name'],queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x10')],queues[_0x55ea8d[_0x154e('0x56')]]['calleridnum'],queues[_0x55ea8d[_0x154e('0x56')]][_0x154e('0x57')]));}else{utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x5b'),_0x55ea8d['origtransfereruniqueid'],queues[_0x55ea8d['secondtransfererlinkedid']][_0x154e('0x20')],_0x55ea8d[_0x154e('0x4f')]));queues[_0x55ea8d[_0x154e('0x50')]]['transfereduniqueid']=_0x55ea8d[_0x154e('0x4f')];}}}}catch(_0x1089d1){utils['error'](util[_0x154e('0x4')]('[%s][queues][attendedtransfer]',_0x55ea8d['origtransfereruniqueid']),_0x1089d1);}};exports[_0x154e('0x60')]=function(_0x26a321){try{if(!_[_0x154e('0x23')](queues[_0x26a321[_0x154e('0x6')]])){utils[_0x154e('0x12')](util[_0x154e('0x4')]('[%s][queues][musiconholdstart]',_0x26a321[_0x154e('0x6')]),_0x26a321);queues[_0x26a321['uniqueid']][_0x154e('0x61')]=utils['now']();utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x62'),_0x26a321[_0x154e('0x6')],queues[_0x26a321[_0x154e('0x6')]][_0x154e('0x20')],queues[_0x26a321[_0x154e('0x6')]][_0x154e('0x61')]));}}catch(_0x34acc0){utils[_0x154e('0x18')](util[_0x154e('0x4')](_0x154e('0x63'),_0x26a321[_0x154e('0x6')]),_0x34acc0);}};exports['musiconholdstop']=function(_0x517039){try{if(!_['isNil'](queues[_0x517039['uniqueid']])){if(!_['isNil'](queues[_0x517039['uniqueid']][_0x154e('0x61')])){utils[_0x154e('0x12')](util[_0x154e('0x4')](_0x154e('0x64'),_0x517039[_0x154e('0x6')]),_0x517039);queues[_0x517039['uniqueid']][_0x154e('0x59')]+=utils[_0x154e('0x37')](utils[_0x154e('0x17')](),queues[_0x517039[_0x154e('0x6')]][_0x154e('0x61')]);utils[_0x154e('0x3')](util[_0x154e('0x4')](_0x154e('0x65'),_0x517039[_0x154e('0x6')],queues[_0x517039[_0x154e('0x6')]][_0x154e('0x20')],queues[_0x517039[_0x154e('0x6')]][_0x154e('0x59')]));delete queues[_0x517039[_0x154e('0x6')]][_0x154e('0x61')];}}}catch(_0x5bfa9a){utils['error'](util['format']('[%s][queues][musiconholdstop]',_0x517039['uniqueid']),_0x5bfa9a);}}; \ No newline at end of file +var _0x5d74=['origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertype','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transferuniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','CONTINUE','queuecallerabandonAt','now','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','transferexten','BLINDTRANSFER','[%s][queues][attendedtransfer]'];(function(_0x3bb5e2,_0x5f4621){var _0x1efc34=function(_0x45165d){while(--_0x45165d){_0x3bb5e2['push'](_0x3bb5e2['shift']());}};_0x1efc34(++_0x5f4621);}(_0x5d74,0x15c));var _0x45d7=function(_0x5db258,_0x3d8957){_0x5db258=_0x5db258-0x0;var _0x953b76=_0x5d74[_0x5db258];return _0x953b76;};'use strict';var _=require(_0x45d7('0x0'));var util=require('util');var utils=require(_0x45d7('0x1'));var queues={};function writeDB(_0x2f266b){utils[_0x45d7('0x2')](util['format'](_0x45d7('0x3'),_0x2f266b[_0x45d7('0x4')],_0x2f266b[_0x45d7('0x5')],_0x2f266b[_0x45d7('0x6')],_0x2f266b[_0x45d7('0x7')],_0x2f266b['calleridnum'],_0x2f266b[_0x45d7('0x8')],_0x2f266b[_0x45d7('0x9')]));if(_0x2f266b['queue']){utils[_0x45d7('0xa')](_0x2f266b[_0x45d7('0x6')])[_0x45d7('0xb')](function(_0x3317b1){if(_0x3317b1){_0x2f266b[_0x45d7('0xc')]=_0x3317b1['type'];}utils[_0x45d7('0xd')](_0x45d7('0xe'),_0x2f266b);});}else{utils['request']('CreateVoiceQueueReport',_0x2f266b);}if(_0x2f266b[_0x45d7('0xf')]){delete queues[_0x2f266b[_0x45d7('0xf')]];}else{delete queues[_0x2f266b[_0x45d7('0x4')]];}}exports[_0x45d7('0x10')]=function(_0x3331d7){try{utils[_0x45d7('0x11')](util['format'](_0x45d7('0x12'),_0x3331d7[_0x45d7('0x4')]),_0x3331d7);utils[_0x45d7('0x2')](util[_0x45d7('0x13')](_0x45d7('0x14'),_0x3331d7[_0x45d7('0x4')],_0x3331d7[_0x45d7('0x6')],_0x3331d7[_0x45d7('0x15')]));queues[_0x3331d7[_0x45d7('0x4')]]=_['assign'](_0x3331d7,{'originalposition':_0x3331d7[_0x45d7('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x55974f){utils[_0x45d7('0x16')](util['format'](_0x45d7('0x12'),_0x3331d7[_0x45d7('0x4')]),_0x55974f);}};exports[_0x45d7('0x17')]=function(_0x10e96a){try{if(!_[_0x45d7('0x18')](queues[_0x10e96a[_0x45d7('0x4')]])){utils[_0x45d7('0x11')](util['format'](_0x45d7('0x19'),_0x10e96a[_0x45d7('0x4')]),_0x10e96a);if(queues[_0x10e96a['uniqueid']][_0x45d7('0x1a')]){if(!queues[_0x10e96a['uniqueid']][_0x45d7('0x1b')]&&!queues[_0x10e96a['uniqueid']][_0x45d7('0x1c')]){queues[_0x10e96a[_0x45d7('0x4')]][_0x45d7('0x1d')]=!![];queues[_0x10e96a[_0x45d7('0x4')]]['queuecallercompleteAt']=utils['now']();queues[_0x10e96a[_0x45d7('0x4')]][_0x45d7('0x9')]='COMPLETEDBYAGENT';}utils[_0x45d7('0x2')](util[_0x45d7('0x13')](_0x45d7('0x1e'),_0x10e96a[_0x45d7('0x4')],queues[_0x10e96a[_0x45d7('0x4')]]['name'],queues[_0x10e96a[_0x45d7('0x4')]][_0x45d7('0x9')]));writeDB(queues[_0x10e96a['uniqueid']]);}else if(queues[_0x10e96a[_0x45d7('0x4')]][_0x45d7('0xf')]){utils[_0x45d7('0x2')](util[_0x45d7('0x13')](_0x45d7('0x1f'),_0x10e96a[_0x45d7('0x4')],queues[_0x10e96a[_0x45d7('0x4')]][_0x45d7('0x20')],queues[_0x10e96a['uniqueid']][_0x45d7('0xf')]));queues[queues[_0x10e96a[_0x45d7('0x4')]][_0x45d7('0xf')]]=queues[_0x10e96a['uniqueid']];queues[queues[_0x10e96a[_0x45d7('0x4')]][_0x45d7('0xf')]][_0x45d7('0x21')]=0x2;delete queues[_0x10e96a[_0x45d7('0x4')]];}}}catch(_0x199247){utils['error'](util['format']('[%s][queues][hangup]',_0x10e96a[_0x45d7('0x4')]),_0x199247);}};exports[_0x45d7('0x22')]=function(_0x346f44){try{utils[_0x45d7('0x11')](util[_0x45d7('0x13')](_0x45d7('0x23'),_0x346f44[_0x45d7('0x4')]),_0x346f44);if(!_['isNil'](_0x346f44[_0x45d7('0x24')][_0x45d7('0x25')])&&_0x346f44['value']['toUpperCase']()!==_0x45d7('0x26')){if(!_[_0x45d7('0x18')](queues[_0x346f44[_0x45d7('0x4')]])){queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x1b')]=![];queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x27')]=null;queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x1c')]=!![];queues[_0x346f44[_0x45d7('0x4')]]['queuecallerexitAt']=utils[_0x45d7('0x28')]();queues[_0x346f44['uniqueid']][_0x45d7('0x9')]=_0x346f44[_0x45d7('0x29')][_0x45d7('0x2a')]();utils[_0x45d7('0x2')](util[_0x45d7('0x13')](_0x45d7('0x2b'),_0x346f44['uniqueid'],queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x20')],_0x346f44['value'],queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x9')]));writeDB(queues[_0x346f44[_0x45d7('0x4')]]);}}else if(!_[_0x45d7('0x18')](_0x346f44[_0x45d7('0x24')][_0x45d7('0x2c')])){if(!_[_0x45d7('0x18')](queues[_0x346f44['uniqueid']])&&!queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x1b')]){queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x1b')]=![];queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x27')]=null;queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x1c')]=!![];queues[_0x346f44['uniqueid']][_0x45d7('0x2d')]=utils[_0x45d7('0x28')]();queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x9')]=_0x45d7('0x2e');utils[_0x45d7('0x2')](util['format'](_0x45d7('0x2f'),_0x346f44['uniqueid'],queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x20')],_0x346f44[_0x45d7('0x29')],queues[_0x346f44[_0x45d7('0x4')]][_0x45d7('0x9')]));}}}catch(_0x1596ce){utils[_0x45d7('0x16')](util[_0x45d7('0x13')]('[%s][queues][varset]',_0x346f44[_0x45d7('0x4')]),_0x1596ce);}};exports[_0x45d7('0x1b')]=function(_0x1680f1){try{if(!_[_0x45d7('0x18')](queues[_0x1680f1[_0x45d7('0x4')]])){utils[_0x45d7('0x11')](util['format'](_0x45d7('0x30'),_0x1680f1[_0x45d7('0x4')]),_0x1680f1);queues[_0x1680f1[_0x45d7('0x4')]]['queuecallerexit']=![];queues[_0x1680f1[_0x45d7('0x4')]][_0x45d7('0x2d')]=null;queues[_0x1680f1[_0x45d7('0x4')]][_0x45d7('0x1b')]=!![];queues[_0x1680f1[_0x45d7('0x4')]][_0x45d7('0x27')]=utils['now']();queues[_0x1680f1[_0x45d7('0x4')]][_0x45d7('0x9')]='ABANDONED';utils[_0x45d7('0x2')](util['format'](_0x45d7('0x31'),_0x1680f1[_0x45d7('0x4')],queues[_0x1680f1[_0x45d7('0x4')]]['name'],queues[_0x1680f1[_0x45d7('0x4')]][_0x45d7('0x9')]));}}catch(_0x46852c){utils[_0x45d7('0x16')](util[_0x45d7('0x13')](_0x45d7('0x30'),_0x1680f1[_0x45d7('0x4')]),_0x46852c);}};exports['queuecallerleave']=function(_0xa31de0){try{if(!_[_0x45d7('0x18')](queues[_0xa31de0[_0x45d7('0x4')]])){utils['debug'](util[_0x45d7('0x13')](_0x45d7('0x32'),_0xa31de0[_0x45d7('0x4')]),_0xa31de0);utils[_0x45d7('0x2')](util['format'](_0x45d7('0x33'),_0xa31de0[_0x45d7('0x4')],queues[_0xa31de0[_0x45d7('0x4')]][_0x45d7('0x20')],_0xa31de0[_0x45d7('0x34')],_0xa31de0['connectedlinename']));queues[_0xa31de0['uniqueid']]['queuecallerleave']=!![];queues[_0xa31de0['uniqueid']][_0x45d7('0x1a')]=utils[_0x45d7('0x28')]();queues[_0xa31de0['uniqueid']]['holdtime']=utils[_0x45d7('0x35')](queues[_0xa31de0[_0x45d7('0x4')]][_0x45d7('0x1a')],queues[_0xa31de0[_0x45d7('0x4')]][_0x45d7('0x36')]);queues[_0xa31de0[_0x45d7('0x4')]][_0x45d7('0x15')]=_0xa31de0[_0x45d7('0x15')];queues[_0xa31de0[_0x45d7('0x4')]][_0x45d7('0x37')]=_0xa31de0[_0x45d7('0x37')];queues[_0xa31de0[_0x45d7('0x4')]][_0x45d7('0x34')]=_0xa31de0[_0x45d7('0x34')];queues[_0xa31de0[_0x45d7('0x4')]][_0x45d7('0x38')]=_0xa31de0['connectedlinename'];}}catch(_0x33cce4){utils[_0x45d7('0x16')](util[_0x45d7('0x13')](_0x45d7('0x32'),_0xa31de0[_0x45d7('0x4')]),_0x33cce4);}};exports[_0x45d7('0x39')]=function(_0x27d9a4){try{if(!_['isNil'](queues[_0x27d9a4['uniqueid']])){utils[_0x45d7('0x11')](util['format'](_0x45d7('0x3a'),_0x27d9a4[_0x45d7('0x4')]),_0x27d9a4);utils[_0x45d7('0x2')](util[_0x45d7('0x13')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x27d9a4[_0x45d7('0x4')],queues[_0x27d9a4[_0x45d7('0x4')]][_0x45d7('0x20')],_0x27d9a4['membername'],_0x27d9a4[_0x45d7('0x3b')]));queues[_0x27d9a4['uniqueid']]['queuecallerabandon']=![];queues[_0x27d9a4[_0x45d7('0x4')]][_0x45d7('0x1b')]=![];queues[_0x27d9a4[_0x45d7('0x4')]]['queuecallerabandonAt']=null;queues[_0x27d9a4['uniqueid']]['queuecallerexit']=![];queues[_0x27d9a4[_0x45d7('0x4')]][_0x45d7('0x9')]=null;queues[_0x27d9a4[_0x45d7('0x4')]][_0x45d7('0x2d')]=null;queues[_0x27d9a4[_0x45d7('0x4')]]['assigned']=!![];queues[_0x27d9a4[_0x45d7('0x4')]][_0x45d7('0x8')]=_0x27d9a4[_0x45d7('0x3b')];queues[_0x27d9a4[_0x45d7('0x4')]][_0x45d7('0x7')]=_0x27d9a4[_0x45d7('0x3c')];}}catch(_0x4dfb6b){utils[_0x45d7('0x16')](util[_0x45d7('0x13')]('[%s][queues][agentconnect]',_0x27d9a4['uniqueid']),_0x4dfb6b);}};exports[_0x45d7('0x3d')]=function(_0x487320){try{if(!_['isNil'](queues[_0x487320[_0x45d7('0x4')]])){if(queues[_0x487320['uniqueid']][_0x45d7('0x1a')]){utils[_0x45d7('0x11')](util['format'](_0x45d7('0x3e'),_0x487320[_0x45d7('0x4')]),_0x487320);queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x1b')]=![];queues[_0x487320['uniqueid']]['queuecallerabandon']=![];queues[_0x487320['uniqueid']][_0x45d7('0x27')]=null;queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x1c')]=![];queues[_0x487320[_0x45d7('0x4')]]['queuecallerexitAt']=null;queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x3f')]=!![];queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x7')]=_0x487320[_0x45d7('0x3c')];queues[_0x487320['uniqueid']][_0x45d7('0x1d')]=!![];queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x40')]=utils[_0x45d7('0x28')]();if(_0x487320['reason']==_0x45d7('0x41')){if(!queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x41')]){queues[_0x487320[_0x45d7('0x4')]]['queuecallerexitreason']=_0x45d7('0x42');}}else{queues[_0x487320['uniqueid']][_0x45d7('0x9')]='COMPLETEDBY'+_0x487320[_0x45d7('0x43')][_0x45d7('0x2a')]();}utils[_0x45d7('0x2')](util['format'](_0x45d7('0x44'),_0x487320['uniqueid'],queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x20')],_0x487320[_0x45d7('0x3c')],queues[_0x487320[_0x45d7('0x4')]][_0x45d7('0x9')]));writeDB(queues[_0x487320[_0x45d7('0x4')]]);}}}catch(_0x1e0c52){utils['error'](util['format'](_0x45d7('0x3e'),_0x487320[_0x45d7('0x4')]),_0x1e0c52);}};exports[_0x45d7('0x45')]=function(_0x16be5e){try{if(!_[_0x45d7('0x18')](queues[_0x16be5e['transfereeuniqueid']])){utils[_0x45d7('0x11')](util[_0x45d7('0x13')](_0x45d7('0x46'),_0x16be5e[_0x45d7('0x4')]),_0x16be5e);queues[_0x16be5e['transfereeuniqueid']]['transfer']=!![];queues[_0x16be5e[_0x45d7('0x47')]]['transfertype']=_0x45d7('0x48');queues[_0x16be5e['transfereeuniqueid']][_0x45d7('0x49')]=_0x16be5e['extension'];queues[_0x16be5e[_0x45d7('0x47')]]['transferuniqueid']=_0x16be5e[_0x45d7('0x47')];queues[_0x16be5e[_0x45d7('0x47')]][_0x45d7('0x9')]=_0x45d7('0x4a');utils[_0x45d7('0x2')](util[_0x45d7('0x13')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x16be5e[_0x45d7('0x4')],queues[_0x16be5e['transfereeuniqueid']][_0x45d7('0x20')],_0x16be5e[_0x45d7('0x47')],_0x16be5e['extension']));}}catch(_0x1b933b){utils[_0x45d7('0x16')](util[_0x45d7('0x13')](_0x45d7('0x46'),_0x16be5e['uniqueid']),_0x1b933b);}};exports['attendedtransfer']=function(_0x109a8e){try{utils[_0x45d7('0x11')](util[_0x45d7('0x13')](_0x45d7('0x4b'),_0x109a8e['origtransfereruniqueid']),_0x109a8e);if(_0x109a8e[_0x45d7('0x4c')]==_0x109a8e[_0x45d7('0x4d')]){if(!_['isNil'](queues[_0x109a8e[_0x45d7('0x4e')]])){utils[_0x45d7('0x2')](util[_0x45d7('0x13')](_0x45d7('0x4f'),_0x109a8e['origtransfereruniqueid'],queues[_0x109a8e[_0x45d7('0x4e')]]['name'],_0x109a8e['origtransfererexten']));queues[_0x109a8e[_0x45d7('0x4e')]]['transfer']=!![];queues[_0x109a8e[_0x45d7('0x4e')]][_0x45d7('0x50')]='ATTENDED';queues[_0x109a8e[_0x45d7('0x4e')]][_0x45d7('0x49')]=_0x109a8e[_0x45d7('0x51')];queues[_0x109a8e[_0x45d7('0x4e')]]['transferuniqueid']=_0x109a8e[_0x45d7('0x4c')];queues[_0x109a8e[_0x45d7('0x4e')]][_0x45d7('0x9')]=_0x45d7('0x52');}if(!_[_0x45d7('0x18')](queues[_0x109a8e[_0x45d7('0x4d')]])){if(_0x109a8e[_0x45d7('0x53')]&&queues[_0x109a8e[_0x45d7('0x53')]]){queues[_0x109a8e[_0x45d7('0x53')]]['queuecallerenterreason']=0x1;queues[_0x109a8e[_0x45d7('0x47')]]=_[_0x45d7('0x54')](queues[_0x109a8e[_0x45d7('0x53')]]);queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0xf')]=_0x109a8e[_0x45d7('0x55')];queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0x21')]=0x2;queues[_0x109a8e['transfereeuniqueid']][_0x45d7('0x56')]=queues[_0x109a8e[_0x45d7('0x4e')]][_0x45d7('0x56')];queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0x57')]=queues[_0x109a8e[_0x45d7('0x4e')]]['calleridname'];queues[_0x109a8e['transfereeuniqueid']][_0x45d7('0x36')]=utils[_0x45d7('0x28')]();queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0x1a')]=utils[_0x45d7('0x28')]();queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0x58')]=0x0;queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0x59')]=0x0;utils['info'](util['format'](_0x45d7('0x5a'),_0x109a8e[_0x45d7('0x4c')],queues[_0x109a8e[_0x45d7('0x47')]]['name'],queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0x56')],queues[_0x109a8e[_0x45d7('0x47')]][_0x45d7('0x57')]));}else{utils[_0x45d7('0x2')](util[_0x45d7('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x109a8e[_0x45d7('0x4c')],queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0x20')],_0x109a8e[_0x45d7('0x4e')]));queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0xf')]=_0x109a8e[_0x45d7('0x4e')];}}}else if(_0x109a8e[_0x45d7('0x5b')]==_0x109a8e['secondtransfererlinkedid']){if(!_[_0x45d7('0x18')](queues[_0x109a8e[_0x45d7('0x4d')]])){utils[_0x45d7('0x2')](util[_0x45d7('0x13')](_0x45d7('0x5c'),_0x109a8e[_0x45d7('0x4c')],queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0x20')],_0x109a8e[_0x45d7('0x5b')],_0x109a8e[_0x45d7('0x5d')]));queues[_0x109a8e['origtransfererlinkedid']][_0x45d7('0x41')]=!![];queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0x50')]=_0x45d7('0x5e');queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0x49')]=_0x109a8e[_0x45d7('0x5d')];queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0x5f')]=_0x109a8e['secondtransfereruniqueid'];queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0x9')]=_0x45d7('0x52');}if(!_[_0x45d7('0x18')](queues[_0x109a8e[_0x45d7('0x4e')]])){if(_0x109a8e[_0x45d7('0x60')]&&queues[_0x109a8e[_0x45d7('0x60')]]){queues[_0x109a8e[_0x45d7('0x60')]][_0x45d7('0x21')]=0x1;queues[_0x109a8e[_0x45d7('0x55')]]=_[_0x45d7('0x54')](queues[_0x109a8e[_0x45d7('0x60')]]);queues[_0x109a8e[_0x45d7('0x55')]]['transfereduniqueid']=_0x109a8e[_0x45d7('0x55')];queues[_0x109a8e['transfertargetuniqueid']][_0x45d7('0x21')]=0x2;queues[_0x109a8e[_0x45d7('0x55')]][_0x45d7('0x56')]=queues[_0x109a8e[_0x45d7('0x4d')]][_0x45d7('0x56')];queues[_0x109a8e[_0x45d7('0x55')]][_0x45d7('0x57')]=queues[_0x109a8e['origtransfererlinkedid']][_0x45d7('0x57')];queues[_0x109a8e[_0x45d7('0x55')]]['queuecallerjoinAt']=utils['now']();queues[_0x109a8e[_0x45d7('0x55')]]['queuecallerleaveAt']=utils[_0x45d7('0x28')]();queues[_0x109a8e['transfertargetuniqueid']][_0x45d7('0x58')]=0x0;queues[_0x109a8e[_0x45d7('0x55')]][_0x45d7('0x59')]=0x0;utils[_0x45d7('0x2')](util[_0x45d7('0x13')](_0x45d7('0x61'),_0x109a8e[_0x45d7('0x4c')],queues[_0x109a8e[_0x45d7('0x55')]][_0x45d7('0x20')],queues[_0x109a8e['transfertargetuniqueid']][_0x45d7('0xf')],queues[_0x109a8e[_0x45d7('0x55')]][_0x45d7('0x56')],queues[_0x109a8e[_0x45d7('0x55')]][_0x45d7('0x57')]));}else{utils['info'](util[_0x45d7('0x13')](_0x45d7('0x62'),_0x109a8e[_0x45d7('0x4c')],queues[_0x109a8e[_0x45d7('0x4e')]][_0x45d7('0x20')],_0x109a8e[_0x45d7('0x4d')]));queues[_0x109a8e[_0x45d7('0x4e')]][_0x45d7('0xf')]=_0x109a8e[_0x45d7('0x4d')];}}}}catch(_0x2d3f9f){utils[_0x45d7('0x16')](util[_0x45d7('0x13')]('[%s][queues][attendedtransfer]',_0x109a8e[_0x45d7('0x4c')]),_0x2d3f9f);}};exports[_0x45d7('0x63')]=function(_0xe6e648){try{if(!_['isNil'](queues[_0xe6e648[_0x45d7('0x4')]])){utils[_0x45d7('0x11')](util[_0x45d7('0x13')](_0x45d7('0x64'),_0xe6e648[_0x45d7('0x4')]),_0xe6e648);queues[_0xe6e648[_0x45d7('0x4')]][_0x45d7('0x65')]=utils['now']();utils['info'](util[_0x45d7('0x13')](_0x45d7('0x66'),_0xe6e648[_0x45d7('0x4')],queues[_0xe6e648[_0x45d7('0x4')]][_0x45d7('0x20')],queues[_0xe6e648[_0x45d7('0x4')]]['musiconholdstartAt']));}}catch(_0x1d8265){utils[_0x45d7('0x16')](util[_0x45d7('0x13')](_0x45d7('0x64'),_0xe6e648[_0x45d7('0x4')]),_0x1d8265);}};exports[_0x45d7('0x67')]=function(_0x28aa3a){try{if(!_[_0x45d7('0x18')](queues[_0x28aa3a[_0x45d7('0x4')]])){if(!_[_0x45d7('0x18')](queues[_0x28aa3a[_0x45d7('0x4')]][_0x45d7('0x65')])){utils[_0x45d7('0x11')](util[_0x45d7('0x13')](_0x45d7('0x68'),_0x28aa3a[_0x45d7('0x4')]),_0x28aa3a);queues[_0x28aa3a[_0x45d7('0x4')]][_0x45d7('0x59')]+=utils['diffTime'](utils['now'](),queues[_0x28aa3a['uniqueid']][_0x45d7('0x65')]);utils[_0x45d7('0x2')](util['format'](_0x45d7('0x69'),_0x28aa3a[_0x45d7('0x4')],queues[_0x28aa3a[_0x45d7('0x4')]]['name'],queues[_0x28aa3a['uniqueid']][_0x45d7('0x59')]));delete queues[_0x28aa3a[_0x45d7('0x4')]][_0x45d7('0x65')];}}}catch(_0x9a26e5){utils[_0x45d7('0x16')](util[_0x45d7('0x13')](_0x45d7('0x68'),_0x28aa3a[_0x45d7('0x4')]),_0x9a26e5);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index f52b938..559702f 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 _0x1c1e=['channel','error','[%s][recordings][newchannel]','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','value','.WAV','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten'];(function(_0x493e59,_0x11c7c6){var _0x1803cf=function(_0x2e5085){while(--_0x2e5085){_0x493e59['push'](_0x493e59['shift']());}};_0x1803cf(++_0x11c7c6);}(_0x1c1e,0x7c));var _0xe1c1=function(_0x1e1b5a,_0x13b534){_0x1e1b5a=_0x1e1b5a-0x0;var _0x3206db=_0x1c1e[_0x1e1b5a];return _0x3206db;};'use strict';var _=require('lodash');var util=require(_0xe1c1('0x0'));var utils=require(_0xe1c1('0x1'));var transfers=require(_0xe1c1('0x2'));var recordings={};function writeDB(_0x505020){var _0x135bf7;utils[_0xe1c1('0x3')](util[_0xe1c1('0x4')](_0xe1c1('0x5'),_0x505020[_0xe1c1('0x6')]));if(transfers['blinds'][_0x505020[_0xe1c1('0x6')]]){_0x135bf7=_0x505020[_0xe1c1('0x6')];_0x505020[_0xe1c1('0x6')]=transfers[_0xe1c1('0x7')][_0x505020[_0xe1c1('0x6')]][_0xe1c1('0x8')];}if(_0x505020[_0xe1c1('0x9')]){utils[_0xe1c1('0xa')](_0x505020[_0xe1c1('0x9')])[_0xe1c1('0xb')](function(_0x3dac65){if(_0x3dac65){_0x505020[_0xe1c1('0xc')]=_0x3dac65[_0xe1c1('0xd')];_0x505020[_0xe1c1('0xe')]=_0x3dac65['id'];}utils[_0xe1c1('0xf')](_0xe1c1('0x10'),_0x505020);});}else{utils[_0xe1c1('0xf')](_0xe1c1('0x10'),_0x505020);}if(_0x135bf7)delete transfers[_0xe1c1('0x7')][_0x135bf7];}exports[_0xe1c1('0x11')]=function(_0x1b2062){try{utils['debug'](util[_0xe1c1('0x4')]('[%s][recordings][newchannel]',_0x1b2062['uniqueid']),_0x1b2062);if(_0x1b2062[_0xe1c1('0x6')]==_0x1b2062[_0xe1c1('0x12')]){utils['info'](util[_0xe1c1('0x4')](_0xe1c1('0x13'),_0x1b2062[_0xe1c1('0x6')],_0x1b2062[_0xe1c1('0x14')],_0x1b2062[_0xe1c1('0x15')]));recordings[_0x1b2062['uniqueid']]={'uniqueid':_0x1b2062[_0xe1c1('0x6')],'accountcode':_0x1b2062[_0xe1c1('0x9')],'exten':_0x1b2062[_0xe1c1('0x15')],'context':_0x1b2062['context'],'channel':_0x1b2062[_0xe1c1('0x16')],'monitors':[]};}}catch(_0x2f94e5){utils[_0xe1c1('0x17')](util[_0xe1c1('0x4')](_0xe1c1('0x18'),_0x1b2062[_0xe1c1('0x6')]),_0x2f94e5);}};exports[_0xe1c1('0x19')]=function(_0x28ab02){try{utils[_0xe1c1('0x1a')](util['format'](_0xe1c1('0x1b'),_0x28ab02[_0xe1c1('0x6')]),_0x28ab02);if(!_[_0xe1c1('0x1c')](recordings[_0x28ab02[_0xe1c1('0x6')]])&&_0x28ab02[_0xe1c1('0x1d')]==0x6){utils[_0xe1c1('0x3')](util[_0xe1c1('0x4')](_0xe1c1('0x1e'),_0x28ab02['uniqueid'],_0x28ab02['context'],_0x28ab02[_0xe1c1('0x16')]));}else if(!_[_0xe1c1('0x1c')](recordings[_0x28ab02['linkedid']])&&_0x28ab02['channelstate']==0x6&&_0x28ab02['context']!=_0xe1c1('0x1f')){utils[_0xe1c1('0x3')](util[_0xe1c1('0x4')](_0xe1c1('0x20'),_0x28ab02[_0xe1c1('0x6')],_0x28ab02[_0xe1c1('0x12')],_0x28ab02['context'],_0x28ab02['channel']));recordings[_0x28ab02[_0xe1c1('0x12')]][_0xe1c1('0x9')]=_0x28ab02[_0xe1c1('0x9')];}}catch(_0x564dda){utils['error'](util['format'](_0xe1c1('0x1b'),_0x28ab02[_0xe1c1('0x6')]),_0x564dda);}};exports['varset']=function(_0x29d855){try{if(!_[_0xe1c1('0x1c')](_0x29d855[_0xe1c1('0x21')])&&!_[_0xe1c1('0x1c')](_0x29d855['variable'][_0xe1c1('0x22')])){utils[_0xe1c1('0x1a')](util[_0xe1c1('0x4')](_0xe1c1('0x23'),_0x29d855[_0xe1c1('0x6')]),_0x29d855);utils[_0xe1c1('0x3')](util[_0xe1c1('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x29d855[_0xe1c1('0x6')],_0x29d855[_0xe1c1('0x21')],_0x29d855['value']));if(_['endsWith'](_0x29d855[_0xe1c1('0x24')],'.wav49')){_0x29d855[_0xe1c1('0x24')]=_0x29d855['value']['replace']('.wav49',_0xe1c1('0x25'));}if(recordings[_0x29d855[_0xe1c1('0x12')]]){var _0x41ec9c=_[_0xe1c1('0x26')](recordings[_0x29d855[_0xe1c1('0x12')]][_0xe1c1('0x27')],{'value':_0x29d855[_0xe1c1('0x24')]});if(_[_0xe1c1('0x1c')](_0x41ec9c)){recordings[_0x29d855[_0xe1c1('0x12')]][_0xe1c1('0x27')]['push']({'value':_0x29d855['value']});}}}}catch(_0x292636){utils[_0xe1c1('0x17')](util[_0xe1c1('0x4')]('[%s][recordings][varset]',_0x29d855[_0xe1c1('0x6')]),_0x292636);}};exports['hangup']=function(_0x70428a){try{if(!_[_0xe1c1('0x1c')](recordings[_0x70428a[_0xe1c1('0x6')]])){utils['debug'](util[_0xe1c1('0x4')](_0xe1c1('0x28'),_0x70428a['uniqueid']),_0x70428a);utils[_0xe1c1('0x3')](util[_0xe1c1('0x4')](_0xe1c1('0x29'),_0x70428a[_0xe1c1('0x6')],_0x70428a['calleridnum'],_0x70428a[_0xe1c1('0x2a')],_0x70428a[_0xe1c1('0x2b')]));recordings[_0x70428a[_0xe1c1('0x6')]][_0xe1c1('0x2c')]=_0x70428a[_0xe1c1('0x2c')];recordings[_0x70428a[_0xe1c1('0x6')]]['calleridname']=_0x70428a[_0xe1c1('0x2a')];recordings[_0x70428a[_0xe1c1('0x6')]][_0xe1c1('0x2d')]=_0x70428a[_0xe1c1('0x2d')];recordings[_0x70428a[_0xe1c1('0x6')]][_0xe1c1('0x2e')]=_0x70428a[_0xe1c1('0x2e')];if(recordings[_0x70428a[_0xe1c1('0x6')]][_0xe1c1('0x2f')]==_0xe1c1('0x30')&&recordings[_0x70428a[_0xe1c1('0x6')]][_0xe1c1('0x9')]){recordings[_0x70428a['uniqueid']][_0xe1c1('0x2d')]=recordings[_0x70428a['uniqueid']][_0xe1c1('0x9')];recordings[_0x70428a[_0xe1c1('0x6')]][_0xe1c1('0x2e')]='';}recordings[_0x70428a[_0xe1c1('0x6')]][_0xe1c1('0x27')][_0xe1c1('0x31')](function(_0x19b20b){var _0x214b80=_[_0xe1c1('0x32')](recordings[_0x70428a[_0xe1c1('0x6')]]);_0x214b80[_0xe1c1('0x24')]=_0x19b20b[_0xe1c1('0x24')];writeDB(_0x214b80);});delete recordings[_0x70428a[_0xe1c1('0x6')]];}}catch(_0x2b9a9c){utils[_0xe1c1('0x17')](util[_0xe1c1('0x4')](_0xe1c1('0x28'),_0x70428a[_0xe1c1('0x6')]),_0x2b9a9c);}};exports[_0xe1c1('0x33')]=function(_0x55a730){try{if(!_[_0xe1c1('0x1c')](recordings[_0x55a730[_0xe1c1('0x6')]])){utils[_0xe1c1('0x1a')](util['format'](_0xe1c1('0x34'),_0x55a730[_0xe1c1('0x6')]),_0x55a730);utils[_0xe1c1('0x3')](util[_0xe1c1('0x4')](_0xe1c1('0x35'),_0x55a730[_0xe1c1('0x6')],_0x55a730[_0xe1c1('0x36')],_0x55a730[_0xe1c1('0x37')]));if(_0x55a730[_0xe1c1('0x36')]['toLowerCase']()==_0xe1c1('0x38')&&_[_0xe1c1('0x39')](_0x55a730['appdata'][_0xe1c1('0x3a')](),'cdr')){var _0x52ad0d=_0x55a730[_0xe1c1('0x37')][_0xe1c1('0x3b')]('=');var _0x4098c4=_0x52ad0d[0x0][_0xe1c1('0x3c')](_0x52ad0d[0x0][_0xe1c1('0x3d')]('(')+0x1,_0x52ad0d[0x0][_0xe1c1('0x3d')](')'));var _0x2544f1=_0x52ad0d[0x1];recordings[_0x55a730['uniqueid']][_0x4098c4]=_0x2544f1;}}}catch(_0x456d65){utils[_0xe1c1('0x17')](util[_0xe1c1('0x4')](_0xe1c1('0x34'),_0x55a730['uniqueid']),_0x456d65);}};exports[_0xe1c1('0x3e')]=function(_0xb3d997){try{if(!_[_0xe1c1('0x1c')](recordings[_0xb3d997['uniqueid']])){utils['debug'](util[_0xe1c1('0x4')](_0xe1c1('0x3f'),_0xb3d997[_0xe1c1('0x6')]),_0xb3d997);utils['info'](util[_0xe1c1('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0xb3d997['uniqueid'],_0xb3d997[_0xe1c1('0x40')]));recordings[_0xb3d997[_0xe1c1('0x6')]][_0xe1c1('0x40')]=_0xb3d997[_0xe1c1('0x40')];}}catch(_0xca25ec){utils[_0xe1c1('0x17')](util[_0xe1c1('0x4')](_0xe1c1('0x3f'),_0xb3d997['uniqueid']),_0xca25ec);}};exports[_0xe1c1('0x41')]=function(_0x48a5d7){try{utils[_0xe1c1('0x1a')](util[_0xe1c1('0x4')]('[%s][recordings][blindtransfer]',_0x48a5d7[_0xe1c1('0x6')]),_0x48a5d7);utils[_0xe1c1('0x3')](util[_0xe1c1('0x4')](_0xe1c1('0x42'),_0x48a5d7['uniqueid'],_0x48a5d7[_0xe1c1('0x43')],_0x48a5d7['transferercalleridname'],_0x48a5d7[_0xe1c1('0x44')],_0x48a5d7[_0xe1c1('0x45')]));if(recordings[_0x48a5d7[_0xe1c1('0x46')]]&&transfers[_0xe1c1('0x7')][_0x48a5d7[_0xe1c1('0x46')]]){transfers['blinds'][_0x48a5d7[_0xe1c1('0x46')]][_0xe1c1('0x47')]=!![];}}catch(_0x7fd1c5){utils[_0xe1c1('0x17')](util[_0xe1c1('0x4')](_0xe1c1('0x48'),_0x48a5d7['uniqueid']),_0x7fd1c5);}}; \ No newline at end of file +var _0x3e3a=['newchannel','debug','linkedid','context','exten','error','[%s][recordings][newchannel]','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording'];(function(_0x187c8a,_0x5006e2){var _0x1ce995=function(_0x3a99f9){while(--_0x3a99f9){_0x187c8a['push'](_0x187c8a['shift']());}};_0x1ce995(++_0x5006e2);}(_0x3e3a,0x85));var _0xa3e3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3e3a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xa3e3('0x0'));var util=require(_0xa3e3('0x1'));var utils=require(_0xa3e3('0x2'));var transfers=require(_0xa3e3('0x3'));var recordings={};function writeDB(_0x412e6b){var _0x1513d8;utils[_0xa3e3('0x4')](util[_0xa3e3('0x5')]('[%s][recordings][writeDB]',_0x412e6b[_0xa3e3('0x6')]));if(transfers[_0xa3e3('0x7')][_0x412e6b[_0xa3e3('0x6')]]){_0x1513d8=_0x412e6b[_0xa3e3('0x6')];_0x412e6b[_0xa3e3('0x6')]=transfers['blinds'][_0x412e6b[_0xa3e3('0x6')]][_0xa3e3('0x8')];}if(_0x412e6b[_0xa3e3('0x9')]){utils[_0xa3e3('0xa')](_0x412e6b[_0xa3e3('0x9')])[_0xa3e3('0xb')](function(_0x35fc95){if(_0x35fc95){_0x412e6b[_0xa3e3('0xc')]=_0x35fc95[_0xa3e3('0xd')];_0x412e6b[_0xa3e3('0xe')]=_0x35fc95['id'];}utils[_0xa3e3('0xf')]('CreateVoiceRecording',_0x412e6b);});}else{utils['request'](_0xa3e3('0x10'),_0x412e6b);}if(_0x1513d8)delete transfers[_0xa3e3('0x7')][_0x1513d8];}exports[_0xa3e3('0x11')]=function(_0x54de63){try{utils[_0xa3e3('0x12')](util[_0xa3e3('0x5')]('[%s][recordings][newchannel]',_0x54de63[_0xa3e3('0x6')]),_0x54de63);if(_0x54de63[_0xa3e3('0x6')]==_0x54de63[_0xa3e3('0x13')]){utils['info'](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x54de63[_0xa3e3('0x6')],_0x54de63[_0xa3e3('0x14')],_0x54de63[_0xa3e3('0x15')]));recordings[_0x54de63[_0xa3e3('0x6')]]={'uniqueid':_0x54de63[_0xa3e3('0x6')],'accountcode':_0x54de63['accountcode'],'exten':_0x54de63[_0xa3e3('0x15')],'context':_0x54de63[_0xa3e3('0x14')],'channel':_0x54de63['channel'],'monitors':[]};}}catch(_0x2f3004){utils[_0xa3e3('0x16')](util[_0xa3e3('0x5')](_0xa3e3('0x17'),_0x54de63[_0xa3e3('0x6')]),_0x2f3004);}};exports[_0xa3e3('0x18')]=function(_0x59d2f3){try{utils[_0xa3e3('0x12')](util[_0xa3e3('0x5')]('[%s][recordings][newstate]',_0x59d2f3[_0xa3e3('0x6')]),_0x59d2f3);if(!_[_0xa3e3('0x19')](recordings[_0x59d2f3['uniqueid']])&&_0x59d2f3[_0xa3e3('0x1a')]==0x6){utils[_0xa3e3('0x4')](util['format'](_0xa3e3('0x1b'),_0x59d2f3[_0xa3e3('0x6')],_0x59d2f3[_0xa3e3('0x14')],_0x59d2f3[_0xa3e3('0x1c')]));}else if(!_[_0xa3e3('0x19')](recordings[_0x59d2f3[_0xa3e3('0x13')]])&&_0x59d2f3[_0xa3e3('0x1a')]==0x6&&_0x59d2f3['context']!=_0xa3e3('0x1d')){utils[_0xa3e3('0x4')](util[_0xa3e3('0x5')](_0xa3e3('0x1e'),_0x59d2f3[_0xa3e3('0x6')],_0x59d2f3['linkedid'],_0x59d2f3[_0xa3e3('0x14')],_0x59d2f3['channel']));recordings[_0x59d2f3['linkedid']]['accountcode']=_0x59d2f3[_0xa3e3('0x9')];}}catch(_0x2723b8){utils[_0xa3e3('0x16')](util[_0xa3e3('0x5')](_0xa3e3('0x1f'),_0x59d2f3['uniqueid']),_0x2723b8);}};exports[_0xa3e3('0x20')]=function(_0x2bd12e){try{if(!_['isNil'](_0x2bd12e[_0xa3e3('0x21')])&&!_[_0xa3e3('0x19')](_0x2bd12e[_0xa3e3('0x21')]['mixmonitor_filename'])){utils['debug'](util[_0xa3e3('0x5')](_0xa3e3('0x22'),_0x2bd12e[_0xa3e3('0x6')]),_0x2bd12e);utils['info'](util[_0xa3e3('0x5')](_0xa3e3('0x23'),_0x2bd12e[_0xa3e3('0x6')],_0x2bd12e[_0xa3e3('0x21')],_0x2bd12e[_0xa3e3('0x24')]));if(_[_0xa3e3('0x25')](_0x2bd12e[_0xa3e3('0x24')],'.wav49')){_0x2bd12e[_0xa3e3('0x24')]=_0x2bd12e[_0xa3e3('0x24')][_0xa3e3('0x26')]('.wav49','.WAV');}if(recordings[_0x2bd12e[_0xa3e3('0x13')]]){var _0x49d699=_['find'](recordings[_0x2bd12e[_0xa3e3('0x13')]]['monitors'],{'value':_0x2bd12e['value']});if(_[_0xa3e3('0x19')](_0x49d699)){recordings[_0x2bd12e['linkedid']][_0xa3e3('0x27')][_0xa3e3('0x28')]({'value':_0x2bd12e[_0xa3e3('0x24')]});}}}}catch(_0x31ad07){utils[_0xa3e3('0x16')](util['format'](_0xa3e3('0x22'),_0x2bd12e['uniqueid']),_0x31ad07);}};exports['hangup']=function(_0x168476){try{if(!_['isNil'](recordings[_0x168476['uniqueid']])){utils[_0xa3e3('0x12')](util[_0xa3e3('0x5')](_0xa3e3('0x29'),_0x168476['uniqueid']),_0x168476);utils['info'](util[_0xa3e3('0x5')](_0xa3e3('0x2a'),_0x168476[_0xa3e3('0x6')],_0x168476[_0xa3e3('0x2b')],_0x168476['calleridname'],_0x168476[_0xa3e3('0x2c')]));recordings[_0x168476['uniqueid']]['calleridnum']=_0x168476[_0xa3e3('0x2b')];recordings[_0x168476[_0xa3e3('0x6')]]['calleridname']=_0x168476[_0xa3e3('0x2d')];recordings[_0x168476[_0xa3e3('0x6')]]['connectedlinenum']=_0x168476[_0xa3e3('0x2e')];recordings[_0x168476['uniqueid']][_0xa3e3('0x2f')]=_0x168476[_0xa3e3('0x2f')];if(recordings[_0x168476['uniqueid']][_0xa3e3('0x30')]==_0xa3e3('0x31')&&recordings[_0x168476[_0xa3e3('0x6')]]['accountcode']){recordings[_0x168476[_0xa3e3('0x6')]][_0xa3e3('0x2e')]=recordings[_0x168476[_0xa3e3('0x6')]]['accountcode'];recordings[_0x168476['uniqueid']][_0xa3e3('0x2f')]='';}recordings[_0x168476[_0xa3e3('0x6')]][_0xa3e3('0x27')][_0xa3e3('0x32')](function(_0x1a0398){var _0x368df7=_[_0xa3e3('0x33')](recordings[_0x168476[_0xa3e3('0x6')]]);_0x368df7[_0xa3e3('0x24')]=_0x1a0398[_0xa3e3('0x24')];writeDB(_0x368df7);});delete recordings[_0x168476['uniqueid']];}}catch(_0xa4aeed){utils[_0xa3e3('0x16')](util['format']('[%s][recordings][hangup]',_0x168476[_0xa3e3('0x6')]),_0xa4aeed);}};exports[_0xa3e3('0x34')]=function(_0x24094c){try{if(!_[_0xa3e3('0x19')](recordings[_0x24094c[_0xa3e3('0x6')]])){utils['debug'](util['format']('[%s][recordings][newexten]',_0x24094c[_0xa3e3('0x6')]),_0x24094c);utils[_0xa3e3('0x4')](util[_0xa3e3('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x24094c[_0xa3e3('0x6')],_0x24094c[_0xa3e3('0x35')],_0x24094c['appdata']));if(_0x24094c['application'][_0xa3e3('0x36')]()==_0xa3e3('0x37')&&_[_0xa3e3('0x38')](_0x24094c[_0xa3e3('0x39')][_0xa3e3('0x36')](),'cdr')){var _0x12d4de=_0x24094c[_0xa3e3('0x39')][_0xa3e3('0x3a')]('=');var _0x21d1d2=_0x12d4de[0x0][_0xa3e3('0x3b')](_0x12d4de[0x0][_0xa3e3('0x3c')]('(')+0x1,_0x12d4de[0x0]['lastIndexOf'](')'));var _0x10a474=_0x12d4de[0x1];recordings[_0x24094c[_0xa3e3('0x6')]][_0x21d1d2]=_0x10a474;}}}catch(_0x31142f){utils['error'](util['format'](_0xa3e3('0x3d'),_0x24094c[_0xa3e3('0x6')]),_0x31142f);}};exports[_0xa3e3('0x3e')]=function(_0x27ecc1){try{if(!_[_0xa3e3('0x19')](recordings[_0x27ecc1['uniqueid']])){utils[_0xa3e3('0x12')](util[_0xa3e3('0x5')]('[%s][recordings][queuecallerjoin]',_0x27ecc1[_0xa3e3('0x6')]),_0x27ecc1);utils['info'](util['format'](_0xa3e3('0x3f'),_0x27ecc1[_0xa3e3('0x6')],_0x27ecc1[_0xa3e3('0x40')]));recordings[_0x27ecc1[_0xa3e3('0x6')]]['queue']=_0x27ecc1[_0xa3e3('0x40')];}}catch(_0x3e2d9a){utils[_0xa3e3('0x16')](util[_0xa3e3('0x5')](_0xa3e3('0x41'),_0x27ecc1[_0xa3e3('0x6')]),_0x3e2d9a);}};exports[_0xa3e3('0x42')]=function(_0x1d5d71){try{utils[_0xa3e3('0x12')](util[_0xa3e3('0x5')](_0xa3e3('0x43'),_0x1d5d71[_0xa3e3('0x6')]),_0x1d5d71);utils[_0xa3e3('0x4')](util[_0xa3e3('0x5')](_0xa3e3('0x44'),_0x1d5d71[_0xa3e3('0x6')],_0x1d5d71[_0xa3e3('0x45')],_0x1d5d71[_0xa3e3('0x46')],_0x1d5d71[_0xa3e3('0x47')],_0x1d5d71[_0xa3e3('0x48')]));if(recordings[_0x1d5d71[_0xa3e3('0x49')]]&&transfers[_0xa3e3('0x7')][_0x1d5d71[_0xa3e3('0x49')]]){transfers['blinds'][_0x1d5d71[_0xa3e3('0x49')]][_0xa3e3('0x4a')]=!![];}}catch(_0x15bdc8){utils['error'](util[_0xa3e3('0x5')](_0xa3e3('0x43'),_0x1d5d71[_0xa3e3('0x6')]),_0x15bdc8);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a8a4fe9..a9d39c2 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 _0x47d4=['transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname'];(function(_0x27bb5d,_0x32812b){var _0x42b0c2=function(_0x506d1f){while(--_0x506d1f){_0x27bb5d['push'](_0x27bb5d['shift']());}};_0x42b0c2(++_0x32812b);}(_0x47d4,0x70));var _0x447d=function(_0x77513f,_0x3c3cfd){_0x77513f=_0x77513f-0x0;var _0x371a4f=_0x47d4[_0x77513f];return _0x371a4f;};'use strict';var _=require('lodash');var util=require(_0x447d('0x0'));var utils=require(_0x447d('0x1'));function writeDB(_0x8fce95){utils[_0x447d('0x2')](util[_0x447d('0x3')](_0x447d('0x4'),_0x8fce95[_0x447d('0x5')]===_0x447d('0x6')?_0x8fce95['origtransfereruniqueid']:_0x8fce95[_0x447d('0x7')],_0x8fce95[_0x447d('0x5')]));utils[_0x447d('0x8')](_0x447d('0x9'),_0x8fce95);}exports['blinds']={};exports[_0x447d('0xa')]=function(_0x1cb9fc){try{utils[_0x447d('0xb')](util[_0x447d('0x3')](_0x447d('0xc'),_0x1cb9fc[_0x447d('0x7')]),_0x1cb9fc);utils['info'](util[_0x447d('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1cb9fc[_0x447d('0x7')],_0x1cb9fc[_0x447d('0xd')],_0x1cb9fc['transferercalleridname'],_0x1cb9fc[_0x447d('0xe')],_0x1cb9fc[_0x447d('0xf')]));_0x1cb9fc['type']=_0x447d('0x10');exports[_0x447d('0x11')][_0x1cb9fc[_0x447d('0x12')]]=_0x1cb9fc;writeDB(_0x1cb9fc);}catch(_0x2cf6b9){utils[_0x447d('0x13')](util[_0x447d('0x3')](_0x447d('0xc'),_0x1cb9fc[_0x447d('0x7')]),_0x2cf6b9);}};exports[_0x447d('0x14')]=function(_0x5ae7e9){try{utils[_0x447d('0xb')](util[_0x447d('0x3')](_0x447d('0x15'),_0x5ae7e9[_0x447d('0x16')]),_0x5ae7e9);utils[_0x447d('0x2')](util[_0x447d('0x3')](_0x447d('0x17'),_0x5ae7e9[_0x447d('0x16')],_0x5ae7e9[_0x447d('0x18')],_0x5ae7e9[_0x447d('0x19')],_0x5ae7e9[_0x447d('0x1a')],_0x5ae7e9[_0x447d('0x1b')]));_0x5ae7e9=_['assign'](_0x5ae7e9,{'transfererchannel':_0x5ae7e9[_0x447d('0x1c')],'transferercalleridnum':_0x5ae7e9[_0x447d('0x18')],'transferercalleridname':_0x5ae7e9[_0x447d('0x19')],'transfererconnectedlinenum':_0x5ae7e9[_0x447d('0x1d')],'transfererconnectedlinename':_0x5ae7e9[_0x447d('0x1e')],'transfereraccountcode':_0x5ae7e9[_0x447d('0x1f')],'transferercontext':_0x5ae7e9[_0x447d('0x20')],'transfererexten':_0x5ae7e9[_0x447d('0x21')],'transfererlinkedid':_0x5ae7e9[_0x447d('0x22')],'context':_0x5ae7e9[_0x447d('0x23')],'extension':_0x5ae7e9[_0x447d('0x24')],'type':_0x447d('0x6')});if(_[_0x447d('0x25')](_0x5ae7e9[_0x447d('0x26')])){_0x5ae7e9=_['assign'](_0x5ae7e9,{'transfereechannel':_0x5ae7e9[_0x447d('0x27')],'transfereecalleridnum':_0x5ae7e9[_0x447d('0x1a')],'transfereecalleridname':_0x5ae7e9[_0x447d('0x1b')],'transfereeconnectedlinenum':_0x5ae7e9[_0x447d('0x28')],'transfereeconnectedlinename':_0x5ae7e9[_0x447d('0x29')],'transfereeaccountcode':_0x5ae7e9[_0x447d('0x2a')],'transfereecontext':_0x5ae7e9[_0x447d('0x2b')],'transfereeexten':_0x5ae7e9[_0x447d('0x2c')],'transfereelinkedid':_0x5ae7e9[_0x447d('0x2d')]});}writeDB(_0x5ae7e9);}catch(_0x584eb3){utils['error'](util[_0x447d('0x3')](_0x447d('0x15'),_0x5ae7e9[_0x447d('0x16')]),_0x584eb3);}}; \ No newline at end of file +var _0x55ce=['attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0x55ce,0x104));var _0xe55c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x55ce[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe55c('0x0'));var util=require(_0xe55c('0x1'));var utils=require(_0xe55c('0x2'));function writeDB(_0x4855c1){utils[_0xe55c('0x3')](util[_0xe55c('0x4')](_0xe55c('0x5'),_0x4855c1[_0xe55c('0x6')]===_0xe55c('0x7')?_0x4855c1['origtransfereruniqueid']:_0x4855c1[_0xe55c('0x8')],_0x4855c1[_0xe55c('0x6')]));utils[_0xe55c('0x9')](_0xe55c('0xa'),_0x4855c1);}exports[_0xe55c('0xb')]={};exports[_0xe55c('0xc')]=function(_0x3031b9){try{utils[_0xe55c('0xd')](util[_0xe55c('0x4')](_0xe55c('0xe'),_0x3031b9[_0xe55c('0x8')]),_0x3031b9);utils[_0xe55c('0x3')](util[_0xe55c('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3031b9['uniqueid'],_0x3031b9[_0xe55c('0xf')],_0x3031b9[_0xe55c('0x10')],_0x3031b9[_0xe55c('0x11')],_0x3031b9[_0xe55c('0x12')]));_0x3031b9[_0xe55c('0x6')]=_0xe55c('0x13');exports['blinds'][_0x3031b9[_0xe55c('0x14')]]=_0x3031b9;writeDB(_0x3031b9);}catch(_0x4b88c9){utils[_0xe55c('0x15')](util['format'](_0xe55c('0xe'),_0x3031b9['uniqueid']),_0x4b88c9);}};exports[_0xe55c('0x16')]=function(_0x2dfb0f){try{utils[_0xe55c('0xd')](util[_0xe55c('0x4')](_0xe55c('0x17'),_0x2dfb0f[_0xe55c('0x18')]),_0x2dfb0f);utils[_0xe55c('0x3')](util[_0xe55c('0x4')](_0xe55c('0x19'),_0x2dfb0f[_0xe55c('0x18')],_0x2dfb0f[_0xe55c('0x1a')],_0x2dfb0f[_0xe55c('0x1b')],_0x2dfb0f[_0xe55c('0x1c')],_0x2dfb0f[_0xe55c('0x1d')]));_0x2dfb0f=_[_0xe55c('0x1e')](_0x2dfb0f,{'transfererchannel':_0x2dfb0f[_0xe55c('0x1f')],'transferercalleridnum':_0x2dfb0f[_0xe55c('0x1a')],'transferercalleridname':_0x2dfb0f[_0xe55c('0x1b')],'transfererconnectedlinenum':_0x2dfb0f[_0xe55c('0x20')],'transfererconnectedlinename':_0x2dfb0f[_0xe55c('0x21')],'transfereraccountcode':_0x2dfb0f[_0xe55c('0x22')],'transferercontext':_0x2dfb0f[_0xe55c('0x23')],'transfererexten':_0x2dfb0f[_0xe55c('0x24')],'transfererlinkedid':_0x2dfb0f['origtransfererlinkedid'],'context':_0x2dfb0f[_0xe55c('0x25')],'extension':_0x2dfb0f[_0xe55c('0x26')],'type':_0xe55c('0x7')});if(_[_0xe55c('0x27')](_0x2dfb0f[_0xe55c('0x28')])){_0x2dfb0f=_['assign'](_0x2dfb0f,{'transfereechannel':_0x2dfb0f[_0xe55c('0x29')],'transfereecalleridnum':_0x2dfb0f[_0xe55c('0x1c')],'transfereecalleridname':_0x2dfb0f[_0xe55c('0x1d')],'transfereeconnectedlinenum':_0x2dfb0f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2dfb0f[_0xe55c('0x2a')],'transfereeaccountcode':_0x2dfb0f[_0xe55c('0x2b')],'transfereecontext':_0x2dfb0f[_0xe55c('0x2c')],'transfereeexten':_0x2dfb0f[_0xe55c('0x2d')],'transfereelinkedid':_0x2dfb0f[_0xe55c('0x2e')]});}writeDB(_0x2dfb0f);}catch(_0x5f3cda){utils[_0xe55c('0x15')](util[_0xe55c('0x4')](_0xe55c('0x17'),_0x2dfb0f[_0xe55c('0x18')]),_0x5f3cda);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index b36551e..0097af1 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 _0x939a=['error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','stringify','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','format','subtractTime','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','xdr','info','debug','inspect'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x939a,0x1d7));var _0xa939=function(_0x103385,_0x2453ab){_0x103385=_0x103385-0x0;var _0x30074e=_0x939a[_0x103385];return _0x30074e;};'use strict';var BPromise=require(_0xa939('0x0'));var jayson=require(_0xa939('0x1'));var moment=require(_0xa939('0x2'));var util=require('util');var client=jayson[_0xa939('0x3')][_0xa939('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xa939('0x5'));exports[_0xa939('0x6')]=function(_0x47167b,_0x19fbc6){logger[_0xa939('0x6')](_0x47167b,_0x19fbc6?util['inspect'](_0x19fbc6,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x36725b,_0x2c14c0){logger[_0xa939('0x7')](_0x36725b,_0x2c14c0?util[_0xa939('0x8')](_0x2c14c0,{'showHidden':![],'depth':null}):'');};exports[_0xa939('0x9')]=function(_0x19db9f,_0x40c837){logger[_0xa939('0x9')](_0x19db9f,_0x40c837?util['inspect'](_0x40c837,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x59e794,_0x3a663f){return client[_0xa939('0xa')](_0x59e794,{'body':_0x3a663f})[_0xa939('0xb')](function(_0x2ef502){logger['debug'](_0xa939('0xc'),_0x59e794,_0x2ef502?util[_0xa939('0x8')](_0x2ef502,{'showHidden':![],'depth':null}):'');})[_0xa939('0xd')](function(_0x4f4756){logger[_0xa939('0x9')]('[utils][request]\x20name:%s',_0x59e794,_0x4f4756?util['inspect'](_0x4f4756,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2bc342){return client[_0xa939('0xa')](_0xa939('0xe'),{'options':{'raw':!![],'attributes':['id',_0xa939('0xf'),_0xa939('0x10'),_0xa939('0x11')],'where':_0x2bc342,'limit':0x1}})[_0xa939('0xb')](function(_0x194ec5){logger[_0xa939('0x7')]('[utils][getUser]\x20where:%s',JSON[_0xa939('0x12')](_0x2bc342),_0x194ec5?util[_0xa939('0x8')](_0x194ec5,{'showHidden':![],'depth':null}):'');return _0x194ec5[_0xa939('0x13')]['length']?_0x194ec5[_0xa939('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x2c5f5a){return new BPromise(function(_0x5ed0c3,_0xdd98e3){if(_0x2c5f5a){return getUser({'internal':_0x2c5f5a})['then'](function(_0x447cc7){logger[_0xa939('0x6')](_0xa939('0x14'),_0x2c5f5a,_0x447cc7?_0xa939('0x15'):'notfound');return _0x5ed0c3(_0x447cc7);})[_0xa939('0xd')](function(_0x482c72){logger[_0xa939('0x9')](_0xa939('0x16'),_0x482c72?util[_0xa939('0x8')](_0x482c72,{'showHidden':![],'depth':null}):'');return _0x5ed0c3(null);});}return _0x5ed0c3(null);});};exports[_0xa939('0x17')]=function(_0x4378ef){return new BPromise(function(_0xf226a1,_0x47b95c){if(_0x4378ef){return getUser({'interface':_0x4378ef})[_0xa939('0xb')](function(_0x781715){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x4378ef,_0x781715?'found':'notfound');return _0xf226a1(_0x781715);})[_0xa939('0xd')](function(_0x37808c){logger[_0xa939('0x9')]('[utils][getUserByInterface]',_0x37808c?util[_0xa939('0x8')](_0x37808c,{'showHidden':![],'depth':null}):'');return _0xf226a1(null);});}return _0xf226a1(null);});};exports[_0xa939('0x18')]=function(_0x5013a7){return new BPromise(function(_0x19bcd0,_0x504bea){if(_0x5013a7){return getUser({'name':_0x5013a7})[_0xa939('0xb')](function(_0x5b0417){logger['info'](_0xa939('0x19'),_0x5013a7,_0x5b0417?_0xa939('0x15'):_0xa939('0x1a'));return _0x19bcd0(_0x5b0417);})[_0xa939('0xd')](function(_0x446465){logger['error'](_0xa939('0x1b'),_0x446465?util[_0xa939('0x8')](_0x446465,{'showHidden':![],'depth':null}):'');return _0x19bcd0(null);});}return _0x19bcd0(null);});};exports[_0xa939('0x1c')]=function(_0xcb43c7){return new BPromise(function(_0x48c296,_0x3762d0){if(_0xcb43c7){return client[_0xa939('0xa')](_0xa939('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xa939('0x10'),'type',_0xa939('0x1e'),_0xa939('0x1f')],'where':{'name':_0xcb43c7},'limit':0x1}})[_0xa939('0xb')](function(_0x2a4e91){logger[_0xa939('0x7')](_0xa939('0x20'),_0xcb43c7,_0x2a4e91?util[_0xa939('0x8')](_0x2a4e91,{'showHidden':![],'depth':null}):'');logger['info'](_0xa939('0x21'),_0xcb43c7,_0x2a4e91?_0xa939('0x15'):_0xa939('0x1a'));return _0x48c296(_0x2a4e91[_0xa939('0x13')][_0xa939('0x22')]?_0x2a4e91['result'][0x0]:null);})['catch'](function(_0x1b25c2){logger['error'](_0xa939('0x23'),_0x1b25c2?util['inspect'](_0x1b25c2,{'showHidden':![],'depth':null}):'');return _0x48c296(null);});}return _0x48c296(null);});};exports[_0xa939('0x24')]=function(_0x3e7ed4,_0x36f9a6){return moment(_0x3e7ed4)[_0xa939('0x25')](_0x36f9a6,'seconds')[_0xa939('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa939('0x27')]=function(_0x7d52c7,_0x5d722e){return moment(_0x7d52c7)['subtract'](_0x5d722e,_0xa939('0x28'))[_0xa939('0x26')](_0xa939('0x29'));};exports[_0xa939('0x2a')]=function(_0x503a08,_0x22c11b){return moment(_0x503a08)[_0xa939('0x2b')](moment(_0x22c11b),_0xa939('0x28'));};exports[_0xa939('0x2c')]=function(_0x10b294,_0x464491){return parseInt(_0x10b294,0xa)+parseInt(_0x464491,0xa);};exports[_0xa939('0x2d')]=function(){return moment()[_0xa939('0x26')](_0xa939('0x29'));};exports[_0xa939('0x2e')]=function(_0x284c5d,_0xc1e51a){if(_0xc1e51a){return moment(_0x284c5d)[_0xa939('0x2e')](_0xc1e51a);}return!![];};exports[_0xa939('0x2f')]=function(_0x21b145,_0x304fea){if(_0x304fea){return moment(_0x21b145)[_0xa939('0x2f')](_0x304fea);}else if(_0x21b145){return!![];}return![];}; \ No newline at end of file +var _0x908e=['inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','length','result','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','client','http','../../config/logger','xdr'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0x908e,0x182));var _0xe908=function(_0x4cd1eb,_0x323043){_0x4cd1eb=_0x4cd1eb-0x0;var _0x3e1c1d=_0x908e[_0x4cd1eb];return _0x3e1c1d;};'use strict';var BPromise=require(_0xe908('0x0'));var jayson=require(_0xe908('0x1'));var moment=require('moment');var util=require('util');var client=jayson[_0xe908('0x2')][_0xe908('0x3')]({'port':0x2329});var logger=require(_0xe908('0x4'))(_0xe908('0x5'));exports['info']=function(_0x46a00d,_0x4c8a70){logger['info'](_0x46a00d,_0x4c8a70?util[_0xe908('0x6')](_0x4c8a70,{'showHidden':![],'depth':null}):'');};exports[_0xe908('0x7')]=function(_0x2df114,_0x1f6cd2){logger[_0xe908('0x7')](_0x2df114,_0x1f6cd2?util[_0xe908('0x6')](_0x1f6cd2,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x126ce5,_0x4794c5){logger[_0xe908('0x8')](_0x126ce5,_0x4794c5?util[_0xe908('0x6')](_0x4794c5,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4c0846,_0x22c5cc){return client[_0xe908('0x9')](_0x4c0846,{'body':_0x22c5cc})[_0xe908('0xa')](function(_0x5a61d0){logger[_0xe908('0x7')](_0xe908('0xb'),_0x4c0846,_0x5a61d0?util[_0xe908('0x6')](_0x5a61d0,{'showHidden':![],'depth':null}):'');})[_0xe908('0xc')](function(_0x54347e){logger['error'](_0xe908('0xb'),_0x4c0846,_0x54347e?util['inspect'](_0x54347e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3ac3ff){return client[_0xe908('0x9')](_0xe908('0xd'),{'options':{'raw':!![],'attributes':['id',_0xe908('0xe'),_0xe908('0xf'),'interface'],'where':_0x3ac3ff,'limit':0x1}})[_0xe908('0xa')](function(_0x34343c){logger[_0xe908('0x7')](_0xe908('0x10'),JSON['stringify'](_0x3ac3ff),_0x34343c?util['inspect'](_0x34343c,{'showHidden':![],'depth':null}):'');return _0x34343c['result'][_0xe908('0x11')]?_0x34343c[_0xe908('0x12')][0x0]:null;});}exports[_0xe908('0x13')]=function(_0x424240){return new BPromise(function(_0x5134e4,_0x1e0032){if(_0x424240){return getUser({'internal':_0x424240})[_0xe908('0xa')](function(_0x457c57){logger[_0xe908('0x14')](_0xe908('0x15'),_0x424240,_0x457c57?'found':_0xe908('0x16'));return _0x5134e4(_0x457c57);})['catch'](function(_0x3c0e63){logger[_0xe908('0x8')](_0xe908('0x17'),_0x3c0e63?util[_0xe908('0x6')](_0x3c0e63,{'showHidden':![],'depth':null}):'');return _0x5134e4(null);});}return _0x5134e4(null);});};exports[_0xe908('0x18')]=function(_0x59bca6){return new BPromise(function(_0xa1d7b9,_0x163263){if(_0x59bca6){return getUser({'interface':_0x59bca6})[_0xe908('0xa')](function(_0x376184){logger[_0xe908('0x14')](_0xe908('0x19'),_0x59bca6,_0x376184?_0xe908('0x1a'):_0xe908('0x16'));return _0xa1d7b9(_0x376184);})[_0xe908('0xc')](function(_0x537e56){logger['error'](_0xe908('0x1b'),_0x537e56?util[_0xe908('0x6')](_0x537e56,{'showHidden':![],'depth':null}):'');return _0xa1d7b9(null);});}return _0xa1d7b9(null);});};exports[_0xe908('0x1c')]=function(_0x583894){return new BPromise(function(_0x541d81,_0x1c61c1){if(_0x583894){return getUser({'name':_0x583894})['then'](function(_0x3ff92e){logger[_0xe908('0x14')](_0xe908('0x1d'),_0x583894,_0x3ff92e?_0xe908('0x1a'):_0xe908('0x16'));return _0x541d81(_0x3ff92e);})['catch'](function(_0x154d4a){logger[_0xe908('0x8')](_0xe908('0x1e'),_0x154d4a?util[_0xe908('0x6')](_0x154d4a,{'showHidden':![],'depth':null}):'');return _0x541d81(null);});}return _0x541d81(null);});};exports[_0xe908('0x1f')]=function(_0x579510){return new BPromise(function(_0x378aca,_0x3eb5b7){if(_0x579510){return client[_0xe908('0x9')](_0xe908('0x20'),{'options':{'raw':!![],'attributes':['id',_0xe908('0xf'),_0xe908('0x21'),_0xe908('0x22'),_0xe908('0x23')],'where':{'name':_0x579510},'limit':0x1}})['then'](function(_0xda590f){logger[_0xe908('0x7')](_0xe908('0x24'),_0x579510,_0xda590f?util[_0xe908('0x6')](_0xda590f,{'showHidden':![],'depth':null}):'');logger[_0xe908('0x14')](_0xe908('0x25'),_0x579510,_0xda590f?_0xe908('0x1a'):_0xe908('0x16'));return _0x378aca(_0xda590f[_0xe908('0x12')]['length']?_0xda590f[_0xe908('0x12')][0x0]:null);})['catch'](function(_0x361db3){logger[_0xe908('0x8')]('[utils][getVoiceQueueByName]',_0x361db3?util[_0xe908('0x6')](_0x361db3,{'showHidden':![],'depth':null}):'');return _0x378aca(null);});}return _0x378aca(null);});};exports['addTime']=function(_0x4b4315,_0x459a85){return moment(_0x4b4315)[_0xe908('0x26')](_0x459a85,_0xe908('0x27'))[_0xe908('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe908('0x29')]=function(_0x4c468d,_0x43904f){return moment(_0x4c468d)['subtract'](_0x43904f,_0xe908('0x27'))['format'](_0xe908('0x2a'));};exports[_0xe908('0x2b')]=function(_0x232714,_0x3ddeb0){return moment(_0x232714)[_0xe908('0x2c')](moment(_0x3ddeb0),_0xe908('0x27'));};exports[_0xe908('0x2d')]=function(_0x13d403,_0x4c6211){return parseInt(_0x13d403,0xa)+parseInt(_0x4c6211,0xa);};exports[_0xe908('0x2e')]=function(){return moment()[_0xe908('0x28')](_0xe908('0x2a'));};exports[_0xe908('0x2f')]=function(_0x11b5af,_0x3450f4){if(_0x3450f4){return moment(_0x11b5af)[_0xe908('0x2f')](_0x3450f4);}return!![];};exports[_0xe908('0x30')]=function(_0x858f52,_0x184a9d){if(_0x184a9d){return moment(_0x858f52)[_0xe908('0x30')](_0x184a9d);}else if(_0x858f52){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 049d166..ccb4af3 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 _0x63ed=['url','statusCode','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','connection','other','agent_name','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','xcally','client','role','ensureDir','log','user','then','no-user','data','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','headers','x-forwarded-for','remoteAddress'];(function(_0x505df9,_0x14138e){var _0x1cc025=function(_0x5d2a1f){while(--_0x5d2a1f){_0x505df9['push'](_0x505df9['shift']());}};_0x1cc025(++_0x14138e);}(_0x63ed,0x121));var _0xd63e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x63ed[_0x53ccf2];return _0x5a2964;};var fs=require('fs-extra');var _=require(_0xd63e('0x0'));var ewinston=require(_0xd63e('0x1'));var path=require(_0xd63e('0x2'));var util=require(_0xd63e('0x3'));var fileLogger=require(_0xd63e('0x4'))[_0xd63e('0x5')];var safeTemplate=require(_0xd63e('0x6'))[_0xd63e('0x7')];var maskSensitiveData=require('./mask-sensitive-data')[_0xd63e('0x8')];function ClientSideLogger(){function _0x5e62a9(_0x2f94ad){var _0x8e1f1=path[_0xd63e('0x9')]('/var','log',_0xd63e('0xa'));var _0x1f4321=path['join'](_0xd63e('0xb'),_0x2f94ad[_0xd63e('0xc')]+'-'+_0x2f94ad['name']);return fs[_0xd63e('0xd')](path[_0xd63e('0x9')](_0x8e1f1,_0x1f4321))['then'](function(){var _0x5bd093=fileLogger(_0xd63e('0xb'),path['join'](_0x8e1f1,_0x1f4321));return _0x5bd093;})['catch'](function(_0x268269){throw _0x268269;});}this[_0xd63e('0xe')]=function(_0x5b2131,_0x1fc7cd,_0x1ef980,_0xf146c8){return _0x5e62a9(_0x5b2131[_0xd63e('0xf')])[_0xd63e('0x10')](function(_0x579ea9){var _0x3b7db3=_0x579ea9[_0x1fc7cd];return _0x3b7db3;})[_0xd63e('0x10')](function(_0x4a44f2){var _0x1f83e2=_0x5b2131['user']?_0x5b2131[_0xd63e('0xf')]['id']:_0xd63e('0x11');var _0x269165=_0xf146c8[_0xd63e('0x12')];var _0x15d280=_0xf146c8['timestamp'];var _0x484683=new Date(Number(_0x15d280));return _0x4a44f2(_0x1f83e2,_0x484683,_0x1ef980,_0x269165);})['catch'](function(_0x482d27){fileLogger('client')[_0xd63e('0x13')](_0x482d27);});};}function setupLoggers(_0x4877ad){return new Promise(function(_0x35bb6c){var _0x4a4f41=new ClientSideLogger();var _0x558e3e=fileLogger(_0xd63e('0x14'));var _0x5459bc=fileLogger(_0xd63e('0x15'));_0x4877ad[_0xd63e('0x16')](_0xd63e('0x17'),_0x4a4f41);_0x4877ad[_0xd63e('0x18')](ewinston[_0xd63e('0x19')]({'winstonInstance':_0x558e3e,'meta':![],'statusLevels':!![],'msg':function(_0x534d2d,_0x562e02){var _0x9f5545=_0xd63e('0x1a');if(!_['isEmpty'](_0x534d2d[_0xd63e('0x1b')])){_0x9f5545+=_0xd63e('0x1c');var _0x5a253b=_0x534d2d['body'];maskSensitiveData(_0x5a253b);}return safeTemplate(util[_0xd63e('0x1d')](_0x9f5545,_0x534d2d['method'],_0x534d2d[_0xd63e('0x1e')]['x-forwarded-for']?_0x534d2d[_0xd63e('0x1e')][_0xd63e('0x1f')]:_0x534d2d['connection'][_0xd63e('0x20')]||_0x534d2d['ip'],_0x534d2d[_0xd63e('0x21')],_0x562e02[_0xd63e('0x22')],_0x562e02[_0xd63e('0x23')],_0x534d2d[_0xd63e('0xf')]?_0x534d2d[_0xd63e('0xf')]['id']:null,_0x534d2d[_0xd63e('0xf')]?_0x534d2d['user'][_0xd63e('0x24')]:null,_0x534d2d[_0xd63e('0xf')]?_0x534d2d[_0xd63e('0xf')]['role']:null,_0x5a253b?util[_0xd63e('0x25')](_0x5a253b,![],null):''));}}));_0x4877ad[_0xd63e('0x18')](ewinston['logger']({'winstonInstance':_0x5459bc,'meta':![],'statusLevels':!![],'msg':function(_0x34275f,_0xc57051){var _0x39047a=_0xd63e('0x26');if(_0x34275f[_0xd63e('0x1b')]&&_0x34275f['body'][_0xd63e('0x27')]&&_0x34275f[_0xd63e('0x1b')][_0xd63e('0x28')]){_0x39047a=_0xd63e('0x29');}return util[_0xd63e('0x1d')](_0x39047a,_0x34275f[_0xd63e('0x2a')],_0x34275f[_0xd63e('0x1e')]['x-forwarded-for']?_0x34275f[_0xd63e('0x1e')][_0xd63e('0x1f')]:_0x34275f[_0xd63e('0x2b')][_0xd63e('0x20')]||_0x34275f['ip'],_0x34275f[_0xd63e('0x21')],_0xc57051[_0xd63e('0x22')],_0xc57051[_0xd63e('0x23')],_0x34275f[_0xd63e('0xf')]?_0x34275f[_0xd63e('0xf')]['id']:null,_0x34275f[_0xd63e('0xf')]?_0x34275f[_0xd63e('0xf')][_0xd63e('0x24')]:null,_0x34275f[_0xd63e('0xf')]?_0x34275f[_0xd63e('0xf')][_0xd63e('0xc')]:null,_0x34275f[_0xd63e('0x1b')]&&_0x34275f['body'][_0xd63e('0x27')]?_0x34275f[_0xd63e('0x1b')][_0xd63e('0x27')]:_0xd63e('0x2c'),_0x34275f[_0xd63e('0x1b')]&&_0x34275f[_0xd63e('0x1b')][_0xd63e('0x28')]?_0x34275f[_0xd63e('0x1b')][_0xd63e('0x28')]:'',_0x34275f[_0xd63e('0x1b')]&&_0x34275f[_0xd63e('0x1b')][_0xd63e('0x2d')]?_0x34275f[_0xd63e('0x1b')][_0xd63e('0x2d')]:'');},'ignoreRoute':function(_0x2d0b6e){var _0x435212=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x435212['test'](_0x2d0b6e[_0xd63e('0x21')]);}}));return _0x35bb6c();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x11dd=['remoteAddress','url','statusCode','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','responseTime','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','join','client','name','ensureDir','then','catch','log','user','no-user','data','timestamp','error','api','set','client-side-logger','use','logger','body','format','headers','x-forwarded-for','connection'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x11dd,0x6f));var _0xd11d=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x11dd[_0x349367];return _0x14179b;};var fs=require(_0xd11d('0x0'));var _=require(_0xd11d('0x1'));var ewinston=require(_0xd11d('0x2'));var path=require(_0xd11d('0x3'));var util=require(_0xd11d('0x4'));var fileLogger=require(_0xd11d('0x5'))['fileLogger'];var safeTemplate=require(_0xd11d('0x6'))[_0xd11d('0x7')];var maskSensitiveData=require(_0xd11d('0x8'))[_0xd11d('0x9')];function ClientSideLogger(){function _0x127f3f(_0x1683bc){var _0x5ae99f=path['join'](_0xd11d('0xa'),'log','xcally');var _0x16f9d0=path[_0xd11d('0xb')](_0xd11d('0xc'),_0x1683bc['role']+'-'+_0x1683bc[_0xd11d('0xd')]);return fs[_0xd11d('0xe')](path['join'](_0x5ae99f,_0x16f9d0))[_0xd11d('0xf')](function(){var _0x1e8c64=fileLogger('client',path[_0xd11d('0xb')](_0x5ae99f,_0x16f9d0));return _0x1e8c64;})[_0xd11d('0x10')](function(_0x297d6d){throw _0x297d6d;});}this[_0xd11d('0x11')]=function(_0x2cebad,_0x5362ea,_0x279846,_0x2be1af){return _0x127f3f(_0x2cebad[_0xd11d('0x12')])[_0xd11d('0xf')](function(_0x57c3a8){var _0x4e355f=_0x57c3a8[_0x5362ea];return _0x4e355f;})[_0xd11d('0xf')](function(_0x3b2a90){var _0x2b55b4=_0x2cebad['user']?_0x2cebad[_0xd11d('0x12')]['id']:_0xd11d('0x13');var _0x2887a5=_0x2be1af[_0xd11d('0x14')];var _0x11cf78=_0x2be1af[_0xd11d('0x15')];var _0x2ab8e4=new Date(Number(_0x11cf78));return _0x3b2a90(_0x2b55b4,_0x2ab8e4,_0x279846,_0x2887a5);})['catch'](function(_0x3bdf8a){fileLogger('client')[_0xd11d('0x16')](_0x3bdf8a);});};}function setupLoggers(_0x1cc3a6){return new Promise(function(_0x7f3a1d){var _0x28e6e8=new ClientSideLogger();var _0x3ca12d=fileLogger(_0xd11d('0x17'));var _0x4e39da=fileLogger('auth');_0x1cc3a6[_0xd11d('0x18')](_0xd11d('0x19'),_0x28e6e8);_0x1cc3a6[_0xd11d('0x1a')](ewinston[_0xd11d('0x1b')]({'winstonInstance':_0x3ca12d,'meta':![],'statusLevels':!![],'msg':function(_0x4369c9,_0x556d41){var _0x25f5b7='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x4369c9[_0xd11d('0x1c')])){_0x25f5b7+='\x20body=%s';var _0x52a92d=_0x4369c9[_0xd11d('0x1c')];maskSensitiveData(_0x52a92d);}return safeTemplate(util[_0xd11d('0x1d')](_0x25f5b7,_0x4369c9['method'],_0x4369c9[_0xd11d('0x1e')][_0xd11d('0x1f')]?_0x4369c9[_0xd11d('0x1e')][_0xd11d('0x1f')]:_0x4369c9[_0xd11d('0x20')][_0xd11d('0x21')]||_0x4369c9['ip'],_0x4369c9[_0xd11d('0x22')],_0x556d41[_0xd11d('0x23')],_0x556d41['responseTime'],_0x4369c9['user']?_0x4369c9[_0xd11d('0x12')]['id']:null,_0x4369c9[_0xd11d('0x12')]?_0x4369c9[_0xd11d('0x12')][_0xd11d('0xd')]:null,_0x4369c9[_0xd11d('0x12')]?_0x4369c9[_0xd11d('0x12')][_0xd11d('0x24')]:null,_0x52a92d?util[_0xd11d('0x25')](_0x52a92d,![],null):''));}}));_0x1cc3a6[_0xd11d('0x1a')](ewinston[_0xd11d('0x1b')]({'winstonInstance':_0x4e39da,'meta':![],'statusLevels':!![],'msg':function(_0xaf8770,_0x1446fa){var _0x464cd8=_0xd11d('0x26');if(_0xaf8770['body']&&_0xaf8770[_0xd11d('0x1c')][_0xd11d('0x27')]&&_0xaf8770[_0xd11d('0x1c')][_0xd11d('0x28')]){_0x464cd8=_0xd11d('0x29');}return util[_0xd11d('0x1d')](_0x464cd8,_0xaf8770[_0xd11d('0x2a')],_0xaf8770[_0xd11d('0x1e')]['x-forwarded-for']?_0xaf8770[_0xd11d('0x1e')][_0xd11d('0x1f')]:_0xaf8770['connection'][_0xd11d('0x21')]||_0xaf8770['ip'],_0xaf8770['url'],_0x1446fa[_0xd11d('0x23')],_0x1446fa[_0xd11d('0x2b')],_0xaf8770[_0xd11d('0x12')]?_0xaf8770[_0xd11d('0x12')]['id']:null,_0xaf8770[_0xd11d('0x12')]?_0xaf8770[_0xd11d('0x12')]['name']:null,_0xaf8770[_0xd11d('0x12')]?_0xaf8770[_0xd11d('0x12')]['role']:null,_0xaf8770[_0xd11d('0x1c')]&&_0xaf8770['body'][_0xd11d('0x27')]?_0xaf8770[_0xd11d('0x1c')][_0xd11d('0x27')]:_0xd11d('0x2c'),_0xaf8770['body']&&_0xaf8770[_0xd11d('0x1c')][_0xd11d('0x28')]?_0xaf8770[_0xd11d('0x1c')][_0xd11d('0x28')]:'',_0xaf8770[_0xd11d('0x1c')]&&_0xaf8770[_0xd11d('0x1c')]['agent_name']?_0xaf8770[_0xd11d('0x1c')][_0xd11d('0x2d')]:'');},'ignoreRoute':function(_0x19f138){var _0x40a4ee=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x40a4ee[_0xd11d('0x2e')](_0x19f138['url']);}}));return _0x7f3a1d();});}exports[_0xd11d('0x2f')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 08b9511..b125d32 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe24e=['addColors','join','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','File','%s-%s','error','Console','warn','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20cyan'];(function(_0x491b4f,_0x21377a){var _0x22c19b=function(_0x415232){while(--_0x415232){_0x491b4f['push'](_0x491b4f['shift']());}};_0x22c19b(++_0x21377a);}(_0xe24e,0x7f));var _0xee24=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0xe24e[_0x427d3a];return _0xe5c521;};'use strict';var path=require(_0xee24('0x0'));var util=require('util');var moment=require(_0xee24('0x1'));var winston=require(_0xee24('0x2'));var config=require(_0xee24('0x3'));var debugLevel=config[_0xee24('0x4')]?config['debugLevel'][_0xee24('0x5')]():_0xee24('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':'redBG\x20white','error':_0xee24('0x7'),'warn':_0xee24('0x8'),'info':'white','print':_0xee24('0x9'),'success':_0xee24('0xa'),'http':_0xee24('0xb'),'verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0xee24('0xc')};winston[_0xee24('0xd')](XC_LOG_COLORS);function getLogFileName(_0x2f2cad,_0x4c87b8,_0x43754a){var _0x559acd=_0x2f2cad||'/var/log/xcally';return path[_0xee24('0xe')](_0x559acd,util[_0xee24('0xf')](_0xee24('0x10'),_0x4c87b8,_0x43754a));}function formatter(_0x36c1ea,_0x396ab6){_0x396ab6[_0xee24('0x11')]=_0x396ab6[_0xee24('0x11')][_0xee24('0x12')](/@@{/g,'{{{')[_0xee24('0x12')](/}@@/g,_0xee24('0x13'))[_0xee24('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xee24('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xee24('0xf')](_0xee24('0x14')),_0x396ab6[_0xee24('0x15')][_0xee24('0x16')](),_0x36c1ea,_0x396ab6[_0xee24('0x11')]);}function fileFormat(_0x52f91b,_0x4013b8){_0x4013b8[_0xee24('0x11')]=_0x4013b8[_0xee24('0x11')][_0xee24('0x12')](/@@{/g,'{{{')[_0xee24('0x12')](/}@@/g,_0xee24('0x13'))[_0xee24('0x12')](/@{/g,'{{')[_0xee24('0x12')](/}@/g,'}}');var _0x43b20c=_0x4013b8[_0xee24('0x17')]&&Object[_0xee24('0x18')](_0x4013b8[_0xee24('0x17')])[_0xee24('0x19')]?'\x0a\x09'+JSON[_0xee24('0x1a')](_0x4013b8[_0xee24('0x17')]):'';return util['format'](_0xee24('0x1b'),moment()[_0xee24('0xf')](_0xee24('0x14')),_0x4013b8[_0xee24('0x15')][_0xee24('0x16')](),_0x52f91b,_0x4013b8['message'],_0x43b20c);}function consoleLogger(){var _0x4caeca=new winston[(_0xee24('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xee24('0x1d'))]['Console']({'level':'warn','json':![],'formatter':function(_0x2ee9d1){return formatter('',_0x2ee9d1);}})]});return _0x4caeca;}function fileLogger(_0x1415f0,_0x320f56){var _0xb5443=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xee24('0x1d'))][(_0xee24('0x1e'))]({'name':util[_0xee24('0xf')](_0xee24('0x1f'),_0x1415f0,'error'),'filename':getLogFileName(_0x320f56,_0x1415f0,_0xee24('0x20')),'level':_0xee24('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4f0fb2){return fileFormat(_0x1415f0,_0x4f0fb2);}}),new winston[(_0xee24('0x1d'))][(_0xee24('0x1e'))]({'name':util[_0xee24('0xf')](_0xee24('0x1f'),_0x1415f0,debugLevel),'filename':getLogFileName(_0x320f56,_0x1415f0,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x22a482){return fileFormat(_0x1415f0,_0x22a482);}}),new winston[(_0xee24('0x1d'))][(_0xee24('0x21'))]({'level':_0xee24('0x22'),'json':![],'formatter':function(_0x467f5a){return fileFormat(_0x1415f0,_0x467f5a);}})]});return _0xb5443;}exports['consoleLogger']=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x5e91=['path','moment','winston','../config/environment','debugLevel','info','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20cyan','addColors','join','format','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','File','%s-%s','error','Console','warn','fileLogger'];(function(_0x1889d2,_0x340dfc){var _0x43d542=function(_0xca5572){while(--_0xca5572){_0x1889d2['push'](_0x1889d2['shift']());}};_0x43d542(++_0x340dfc);}(_0x5e91,0x15e));var _0x15e9=function(_0xeb4c8b,_0x1dc497){_0xeb4c8b=_0xeb4c8b-0x0;var _0x90b0d0=_0x5e91[_0xeb4c8b];return _0x90b0d0;};'use strict';var path=require(_0x15e9('0x0'));var util=require('util');var moment=require(_0x15e9('0x1'));var winston=require(_0x15e9('0x2'));var config=require(_0x15e9('0x3'));var debugLevel=config[_0x15e9('0x4')]?config[_0x15e9('0x4')]['toLowerCase']():_0x15e9('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x15e9('0x6'),'error':'red','warn':_0x15e9('0x7'),'info':_0x15e9('0x8'),'print':_0x15e9('0x9'),'success':_0x15e9('0xa'),'http':'gray','verbose':_0x15e9('0xb'),'debug':'bold\x20blue','silly':_0x15e9('0xc')};winston[_0x15e9('0xd')](XC_LOG_COLORS);function getLogFileName(_0x39268c,_0x3341c3,_0x2de412){var _0x3a16f3=_0x39268c||'/var/log/xcally';return path[_0x15e9('0xe')](_0x3a16f3,util[_0x15e9('0xf')]('%s-%s.log',_0x3341c3,_0x2de412));}function formatter(_0x3c5b0f,_0x243777){_0x243777[_0x15e9('0x10')]=_0x243777[_0x15e9('0x10')]['replace'](/@@{/g,_0x15e9('0x11'))[_0x15e9('0x12')](/}@@/g,_0x15e9('0x13'))[_0x15e9('0x12')](/@{/g,'{{')[_0x15e9('0x12')](/}@/g,'}}');return util[_0x15e9('0xf')](_0x15e9('0x14'),moment()[_0x15e9('0xf')](_0x15e9('0x15')),_0x243777['level']['toUpperCase'](),_0x3c5b0f,_0x243777['message']);}function fileFormat(_0x15fa32,_0xed0848){_0xed0848[_0x15e9('0x10')]=_0xed0848[_0x15e9('0x10')][_0x15e9('0x12')](/@@{/g,_0x15e9('0x11'))[_0x15e9('0x12')](/}@@/g,_0x15e9('0x13'))[_0x15e9('0x12')](/@{/g,'{{')[_0x15e9('0x12')](/}@/g,'}}');var _0x4b7d47=_0xed0848[_0x15e9('0x16')]&&Object['keys'](_0xed0848['meta'])[_0x15e9('0x17')]?'\x0a\x09'+JSON[_0x15e9('0x18')](_0xed0848[_0x15e9('0x16')]):'';return util[_0x15e9('0xf')](_0x15e9('0x19'),moment()[_0x15e9('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0xed0848[_0x15e9('0x1a')]['toUpperCase'](),_0x15fa32,_0xed0848[_0x15e9('0x10')],_0x4b7d47);}function consoleLogger(){var _0x665c72=new winston[(_0x15e9('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x15e9('0x1c'))]['Console']({'level':'warn','json':![],'formatter':function(_0x158155){return formatter('',_0x158155);}})]});return _0x665c72;}function fileLogger(_0x44263,_0xbbdd08){var _0x140cef=new winston[(_0x15e9('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x15e9('0x1d'))]({'name':util[_0x15e9('0xf')](_0x15e9('0x1e'),_0x44263,_0x15e9('0x1f')),'filename':getLogFileName(_0xbbdd08,_0x44263,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x322d7e){return fileFormat(_0x44263,_0x322d7e);}}),new winston[(_0x15e9('0x1c'))][(_0x15e9('0x1d'))]({'name':util['format']('%s-%s',_0x44263,debugLevel),'filename':getLogFileName(_0xbbdd08,_0x44263,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x46f734){return fileFormat(_0x44263,_0x46f734);}}),new winston[(_0x15e9('0x1c'))][(_0x15e9('0x20'))]({'level':_0x15e9('0x21'),'json':![],'formatter':function(_0x2b934c){return fileFormat(_0x44263,_0x2b934c);}})]});return _0x140cef;}exports['consoleLogger']=consoleLogger;exports[_0x15e9('0x22')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 66572f9..41e204b 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 _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0x0295,0x1f0));var _0x5029=function(_0x20275f,_0x4528c5){_0x20275f=_0x20275f-0x0;var _0x5a5457=_0x0295[_0x20275f];return _0x5a5457;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x2f7b4f,_0x138eef){var _0x332b6b=function(_0x5d0364){while(--_0x5d0364){_0x2f7b4f['push'](_0x2f7b4f['shift']());}};_0x332b6b(++_0x138eef);}(_0xda2d,0x102));var _0xdda2=function(_0x38b6e8,_0x389246){_0x38b6e8=_0x38b6e8-0x0;var _0x45d71d=_0xda2d[_0x38b6e8];return _0x45d71d;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 65f670e..fc69109 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 _0x9c00=['isPlainObject','exports','safeTemplate','lodash','replace','isArray','map'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x9c00,0x1a0));var _0x09c0=function(_0x42c7b5,_0x3f2ccf){_0x42c7b5=_0x42c7b5-0x0;var _0x3919b2=_0x9c00[_0x42c7b5];return _0x3919b2;};var _=require(_0x09c0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x170d8b){return _0x170d8b==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0xe0d293){var _0x8c9907=_0xe0d293;if(typeof _0xe0d293==='string'){_0x8c9907=_0xe0d293[_0x09c0('0x1')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x09c0('0x2')](_0xe0d293)){_0x8c9907=_0xe0d293[_0x09c0('0x3')](function(_0x2fd03e){return safeTemplate(_0x2fd03e);});}else if(_[_0x09c0('0x4')](_0xe0d293)){_0x8c9907=Object['keys'](_0xe0d293)['reduce'](function(_0x1f3d7e,_0x17d11f){_0x1f3d7e[_0x17d11f]=safeTemplate(_0xe0d293[_0x17d11f]);return _0x1f3d7e;},{});}return _0x8c9907;}module[_0x09c0('0x5')][_0x09c0('0x6')]=safeTemplate; \ No newline at end of file +var _0x8e3f=['reduce','exports','safeTemplate','lodash','{\x20{\x20','string','isArray','map','isPlainObject','keys'];(function(_0xafcc0e,_0x3792a7){var _0x3b4144=function(_0x20f136){while(--_0x20f136){_0xafcc0e['push'](_0xafcc0e['shift']());}};_0x3b4144(++_0x3792a7);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};var _=require(_0xf8e3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x42db69){return _0x42db69==='{{'?_0xf8e3('0x1'):'\x20}\x20}';}function safeTemplate(_0x3f3440){var _0x292de5=_0x3f3440;if(typeof _0x3f3440===_0xf8e3('0x2')){_0x292de5=_0x3f3440['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xf8e3('0x3')](_0x3f3440)){_0x292de5=_0x3f3440[_0xf8e3('0x4')](function(_0x4dab56){return safeTemplate(_0x4dab56);});}else if(_[_0xf8e3('0x5')](_0x3f3440)){_0x292de5=Object[_0xf8e3('0x6')](_0x3f3440)[_0xf8e3('0x7')](function(_0x1ee9f3,_0x4e9e57){_0x1ee9f3[_0x4e9e57]=safeTemplate(_0x3f3440[_0x4e9e57]);return _0x1ee9f3;},{});}return _0x292de5;}module[_0xf8e3('0x8')][_0xf8e3('0x9')]=safeTemplate; \ No newline at end of file -- 1.7.1